Version 1.13.0
diff --git a/.gitattributes b/.gitattributes
index 9dfc906..8378d02 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1,5 +1,6 @@
 # Explicitly declare text files we want to be normalized.
 *.c text
+*.cc text
 *.cpp text
 *.h text
 *.gyp text
diff --git a/.gitignore b/.gitignore
index 8672f82..eaa131d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -15,17 +15,16 @@
 /xcodebuild
 /.flaky.log
 /.debug.log
-/*.Makefile
-/*.opensdf
-/*.pyc
-/*.sdf
-/*.sln
-/*.suo
-/*.target.mk
+*.Makefile
+*.opensdf
+*.sdf
+*.sln
+*.suo
+*.target.mk
 *.host.mk
-/*.vcproj
-/*.vcxproj
-/*.vcxproj.filters
+*.vcproj
+*.vcxproj
+*.vcxproj.filters
 /*.vcxproj.user
 
 # End generated ignores. The following are hand-added because the svn:ignore
@@ -33,13 +32,16 @@
 
 # Gyp generated files
 *.xcodeproj
+*.intermediate
 
-# Dart Editor config files - also in all subdirectories.
+# Eclipse config files - also in all subdirectories.
 .children
 .project
+.settings
 
 # IntelliJ project files
 *.iml
+.idea
 
 # Built by chromebot and downloaded from Google Storage
 client/tests/drt
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 126946a..cb7f875 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,4 +1,66 @@
-## 1.12.1
+## 1.13.0 - 2015-11-18
+
+### Core library changes
+* `dart:async`
+  * `StreamTransformer` instances created with `fromHandlers` with no
+    `handleError` callback now forward stack traces along with errors to the
+    resulting streams.
+
+* `dart:core`
+  * `Uri` added `removeFragment` method.
+  * `String.allMatches` (implementing `Pattern.allMatches`) is now lazy,
+    as all `allMatches` implementations are intended to be.
+  * `Resource` is deprecated, and will be removed in a future release.
+
+* `dart:developer`
+  * Added `Timeline` class for interacting with Observatory's timeline feature.
+  * Added `ServiceExtensionHandler`, `ServiceExtensionResponse`, and `registerExtension` which enable developers to provide their own VM service protocol extensions.
+  
+* `dart:io`
+  * **Breaking:** Secure networking has changed, replacing the NSS library
+    with the BoringSSL library. `SecureSocket`, `SecureServerSocket`,
+    `RawSecureSocket`,`RawSecureServerSocket`, `HttpClient`, and `HttpServer`
+    now all use a `SecurityContext` object which contains the certificates
+    and keys used for secure TLS (SSL) networking.
+
+    This is a breaking change for server applications and for some client
+    applications. Certificates and keys are loaded into the `SecurityContext`
+    from PEM files, instead of from an NSS certificate database. Information
+    about how to change applications that use secure networking is at
+    https://www.dartlang.org/server/tls-ssl.html
+
+  * `HttpClient` no longer sends URI fragments in the request. This is not
+    allowed by the HTTP protocol.
+    The `HttpServer` still gracefully receives fragments, but discards them
+    before delivering the request.
+  * Removed server socket references. The use of server socket references
+    was deprecated back in 1.9. Use the `shared` flag when creating listening
+    sockets and `HttpServer` to distribute accepted sockets between isolates.
+
+* `dart:isolate`
+  * `spawnUri` added an `environment` named argument.
+
+### Tool changes
+
+* `docgen` and 'dartdocgen' no longer ship in the sdk. The `docgen` sources have
+   been removed from the repository.
+
+* This is the last release to ship the VM's "legacy debug protocol".
+  We intend to remove the legacy debug protocol in Dart VM 1.14.
+
+* The VM's Service Protocol has been updated to version 3.0 to take care
+  of a number of issues uncovered by the first few non-observatory
+  clients.  This is a potentially breaking change for clients.
+
+## 1.12.2 - 2015-10-21
+
+### Core library changes
+
+* `dart:io`
+
+  * A memory leak in creation of Process objects is fixed.
+
+## 1.12.1 - 2015-09-08
 
 ### Tool changes
 
@@ -46,6 +108,9 @@
     some leading "dot" segments.
     Also added `hasAbsolutePath`, `hasEmptyPath`, and `hasScheme` properties.
 
+* `dart:developer`
+  * New `log` function to transmit logging events to Observatory.
+
 * `dart:html`
   * `NodeTreeSanitizer` added the `const trusted` field. It can be used
     instead of defining a `NullTreeSanitizer` class when calling
@@ -63,8 +128,52 @@
   * Added `onError`, `onExit` and `errorsAreFatal` parameters to
     `Isolate.spawnUri`.
 
+* `dart:mirrors`
+  * `InstanceMirror.delegate` moved up to `ObjectMirror`.
+  * Fix InstanceMirror.getField optimization when the selector is an operator.
+  * Fix reflective NoSuchMethodErrors to match their non-reflective
+    counterparts when due to argument mismatches. (VM only)
+
 ### Tool changes
 
+* Documentation tools
+
+  * `dartdoc` is now the default tool to generate static HTML for API docs.
+    [Learn more](https://pub.dartlang.org/packages/dartdoc).
+
+  * `docgen` and `dartdocgen` have been deprecated. Currently plan is to remove
+    them in 1.13.
+
+* Formatter (`dartfmt`)
+
+  * Over 50 bugs fixed.
+
+  * Optimized line splitter is much faster and produces better output on
+    complex code.
+
+* Observatory
+  * Allocation profiling.
+
+  * New feature to display output from logging.
+
+  * Heap snapshot analysis works for 64-bit VMs.
+
+  * Improved ability to inspect typed data, regex and compiled code.
+
+  * Ability to break on all or uncaught exceptions from Observatory's debugger.
+
+  * Ability to set closure-specific breakpoints.
+
+  * 'anext' - step past await/yield.
+
+  * Preserve when a variable has been expanded/unexpanded in the debugger.
+
+  * Keep focus on debugger input box whenever possible.
+
+  * Echo stdout/stderr in the Observatory debugger.  Standalone-only so far.
+
+  * Minor fixes to service protocol documentation.
+
 * Pub
 
   * **Breaking:** various commands that previously ran `pub get` implicitly no
@@ -130,13 +239,6 @@
 
 [package spec proposal]: https://github.com/lrhn/dep-pkgspec
 
-* Formatter (`dartfmt`)
-
-  * Over 50 bugs fixed.
-
-  * Optimized line splitter is much faster and produces better output on
-    complex code.
-
 ### VM Service Protocol Changes
 
 * **BREAKING** The service protocol now sends JSON-RPC 2.0-compatible
@@ -153,14 +255,14 @@
 * Some RPCs that didn't include a `"jsonrpc"` property in their responses now
   include one.
 
-## 1.11.2
+## 1.11.2 - 2015-08-03
 
 ### Core library changes
 
 * Fix a bug where `WebSocket.close()` would crash if called after
   `WebSocket.cancel()`.
 
-## 1.11.1
+## 1.11.1 - 2015-07-02
 
 ### Tool changes
 
@@ -227,7 +329,7 @@
 
 * This is the first release that does not include the Eclipse-based
   **Dart Editor**.
-  See [dartlang.org/tools](https://www.dartlang.org/tools/]) for alternatives.
+  See [dartlang.org/tools](https://www.dartlang.org/tools/) for alternatives.
 * This is the last release that ships the (unsupported)
   dart2dart (aka `dart2js --output-type=dart`) utility as part
   of dart2js
diff --git a/DEPS b/DEPS
index e13d6ab..1b0567c 100644
--- a/DEPS
+++ b/DEPS
@@ -32,16 +32,17 @@
       "https://chromium.googlesource.com/external/github.com/dart-lang/%s.git",
 
   "gyp_rev": "@6ee91ad8659871916f9aa840d42e1513befdf638",
-  "co19_rev": "@f95f109fea67127a220958794ef5200a63cb454c",
+  "co19_rev": "@ead3698f33d2cd41e75b6ce5d4a1203767cedd50",
   "chromium_url": "http://src.chromium.org/svn",
   "chromium_git": "https://chromium.googlesource.com",
 
   # Revisions of /third_party/* dependencies.
   "7zip_rev" : "@19997",
-  "analyzer_cli_rev" : "@4281dbf08ccc20b20b795b438766b57afb16ad13",
+  "analyzer_cli_rev" : "@c7a22746baaa8ee6b3e6b0378f9ad9de6e486186",
   "args_tag": "@0.13.0",
   "async_tag": "@1.2.0",
-  "barback_tag" : "@0.15.2+6",
+  "barback_tag" : "@0.15.2+7",
+  "boringssl_rev" : "@daeafc22c66ad48f6b32fc8d3362eb9ba31b774e",
   "charcode_tag": "@1.1.0",
   "chrome_rev" : "@19997",
   "clang_rev" : "@28450",
@@ -49,10 +50,11 @@
   "collection_rev": "@1da9a07f32efa2ba0c391b289e2037391e31da0e",
   "crypto_rev" : "@2df57a1e26dd88e8d0614207d4b062c73209917d",
   "csslib_tag" : "@0.12.0",
-  "dartdoc_rev" : "@23dbfa91819e3c6b72e635eb9cb64a0a3224ef84",
+  "dart2js_info_rev" : "@c4ad464717e3a304fb0d44a6937c25ff2049b863",
+  "dartdoc_rev" : "@18f85ff0b389c417550e541055a84b04273f2b38",
   "dart_services_rev" : "@7aea2574e6f3924bf409a80afb8ad52aa2be4f97",
   "dart_style_tag": "@0.2.0",
-  "dev_compiler_rev": "@0.1.3",
+  "dev_compiler_rev": "@0.1.9",
   "fake_async_rev" : "@38614",
   "firefox_jsshell_rev" : "@45554",
   "glob_rev": "@704cf75e4f26b417505c5c611bdaacd8808467dd",
@@ -66,51 +68,49 @@
   "intl_rev": "@32047558bd220a53c1f4d93a26d54b83533b1475",
   "jinja2_rev": "@2222b31554f03e62600cd7e383376a7c187967a1",
   "json_rpc_2_tag": "@1.1.1",
-  "linter_tag": "@0.1.0",
+  "linter_rev": "@99e2607faf0e9bc522f2f12a24ba50f2954dbbff",
   "logging_rev": "@85d83e002670545e9039ad3985f0018ab640e597",
-  "markdown_rev": "@9a1071a859df9c9edd4f556e948f898f70bf1e5e",
+  "markdown_rev": "@4aaadf3d940bb172e1f6285af4d2b1710d309982",
   "matcher_tag": "@0.12.0",
   "metatest_rev": "@e5aa8e4e19fc4188ac2f6d38368a47d8f07c3df1",
   "mime_rev": "@75890811d4af5af080351ba8a2853ad4c8df98dd",
   "mustache4dart_rev" : "@5724cfd85151e5b6b53ddcd3380daf188fe47f92",
-  "net_nss_rev": "@f81948e9a402db94287a43bb34a07ee0daf56cb5",
-  "nss_rev": "@87b96db4268293187d7cf741907a6d5d1d8080e0",
   "oauth2_rev": "@1bff41f4d54505c36f2d1a001b83b8b745c452f5",
   "observe_rev": "@eee2b8ec34236fa46982575fbccff84f61202ac6",
-  "observatory_pub_packages_rev": "@cdc4b3d4c15b9c0c8e7702dff127b440afbb7485",
-  "package_config_tag": "@0.1.3",
+  "observatory_pub_packages_rev": "@5c199c5954146747f75ed127871207718dc87786",
+  "package_config_rev": "@0.1.3",
   "path_tag": "@1.3.6",
   "petitparser_rev" : "@37878",
   "ply_rev": "@604b32590ffad5cbb82e4afef1d305512d06ae93",
   "plugin_tag": "@0.1.0",
   "pool_rev": "@e454b4b54d2987e8d2f0fbd3ac519641ada9bd0f",
-  "pub_rev": "@5b06b469abafcf6ab7ef0b6dccf4d50e971ae258",
+  "pub_rev": "@1c08b841158e33b8090bb07e5c39df830db58d44",
   "pub_cache_tag": "@v0.1.0",
   "pub_semver_tag": "@1.2.1",
   "quiver_tag": "@0.21.4",
+  "root_certificates_rev": "@c3a41df63afacec62fcb8135196177e35fe72f71",
   "scheduled_test_tag": "@0.12.1+2",
-  "shelf_rev": "@1e87b79b21ac5e6fa2f93576d6c06eaa65285ef4",
+  "shelf_tag": "@0.6.2+1",
   "smoke_rev" : "@f3361191cc2a85ebc1e4d4c33aec672d7915aba9",
   "source_maps_tag": "@0.10.1",
-  "sqlite_rev": "@38811b79f42801662adc0458a25270ab690a6b81",
-  "shelf_static_rev": "@v0.2.1",
-  "shelf_web_socket_rev": "@ff170cec2c0e4e5722cdf47c557be63b5035a602",
+  "shelf_static_tag": "@0.2.3+1",
+  "shelf_web_socket_tag": "@0.0.1+4",
   "source_map_stack_trace_tag": "@1.0.4",
-  "source_span_tag": "@1.1.2",
-  "stack_trace_tag": "@1.3.4",
-  "string_scanner_rev": "@3e7617d6f74ba382e9b6130b1cc12091d89a9bc5",
+  "source_span_tag": "@1.2.0",
+  "stack_trace_tag": "@1.4.2",
+  "string_scanner_tag": "@0.1.4",
   "sunflower_rev": "@879b704933413414679396b129f5dfa96f7a0b1e",
   "test_tag": "@0.12.3+8",
   "test_reflective_loader_tag": "@0.0.3",
   "utf_rev": "@1f55027068759e2d52f2c12de6a57cce5f3c5ee6",
   "unittest_tag": "@0.11.6",
   "usage_rev": "@b5080dac0d26a5609b266f8fdb0d053bc4c1c638",
-  "watcher_tag": "@0.9.6",
+  "watcher_tag": "@0.9.7",
   "when_tag": "@0.2.0+2",
   "which_tag": "@0.1.3+1",
   "web_components_rev": "@0e636b534d9b12c9e96f841e6679398e91a986ec",
   "WebCore_rev" : "@44061",
-  "yaml_rev": "@563a5ffd4a800a2897b8f4dd6b19f2a370df2f2b",
+  "yaml_tag": "@2.1.5",
   "zlib_rev": "@c3d0a6190f2f8c924a05ab6cc97b8f975bddd33f",
   "font_awesome_rev": "@31824",
   "barback-0.13.0_rev": "@34853",
@@ -127,20 +127,17 @@
   Var("dart_root") + "/tests/co19/src":
       (Var("github_mirror") % "co19") + Var("co19_rev"),
 
-  Var("dart_root") + "/third_party/nss":
-      Var("chromium_git") + "/chromium/deps/nss.git" + Var("nss_rev"),
-
-  Var("dart_root") + "/third_party/sqlite":
-      Var("chromium_git") + "/chromium/src/third_party/sqlite.git" +
-      Var("sqlite_rev"),
-
   Var("dart_root") + "/third_party/zlib":
       Var("chromium_git") + "/chromium/src/third_party/zlib.git" +
       Var("zlib_rev"),
 
-  Var("dart_root") + "/third_party/net_nss":
-      Var("chromium_git") + "/chromium/src/net/third_party/nss.git" +
-      Var("net_nss_rev"),
+  Var("dart_root") + "/third_party/boringssl/src":
+      "https://boringssl.googlesource.com/boringssl.git" +
+      Var("boringssl_rev"),
+
+  Var("dart_root") + "/third_party/root_certificates":
+      "https://github.com/dart-lang/root_certificates.git" +
+      Var("root_certificates_rev"),
 
   Var("dart_root") + "/third_party/jinja2":
       Var("chromium_git") + "/chromium/src/third_party/jinja2.git" +
@@ -195,6 +192,8 @@
       (Var("github_mirror") % "csslib") + Var("csslib_tag"),
   Var("dart_root") + "/third_party/pkg_tested/dart_style":
       (Var("github_mirror") % "dart_style") + Var("dart_style_tag"),
+  Var("dart_root") + "/third_party/pkg/dart2js_info":
+      (Var("github_mirror") % "dart2js_info") + Var("dart2js_info_rev"),
   Var("dart_root") + "/third_party/pkg/dartdoc":
       (Var("github_mirror") % "dartdoc") + Var("dartdoc_rev"),
   Var("dart_root") + "/third_party/pkg/dev_compiler":
@@ -218,7 +217,7 @@
   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/linter":
-      (Var("github_mirror") % "linter") + Var("linter_tag"),
+      (Var("github_mirror") % "linter") + Var("linter_rev"),
   Var("dart_root") + "/third_party/pkg/logging":
       (Var("github_mirror") % "logging") + Var("logging_rev"),
   Var("dart_root") + "/third_party/pkg/markdown":
@@ -240,9 +239,9 @@
   Var("dart_root") + "/third_party/observatory_pub_packages":
      (Var("github_mirror") % "observatory_pub_packages")
       + Var("observatory_pub_packages_rev"),
-  Var("dart_root") + "/third_party/pkg/package_config":
+  Var("dart_root") + "/third_party/pkg_tested/package_config":
       (Var("github_mirror") % "package_config") +
-      Var("package_config_tag"),
+      Var("package_config_rev"),
   Var("dart_root") + "/third_party/pkg/path":
       (Var("github_mirror") % "path") + Var("path_tag"),
   Var("dart_root") + "/third_party/pkg/plugin":
@@ -262,12 +261,12 @@
   Var("dart_root") + "/third_party/pkg/scheduled_test":
       (Var("github_mirror") % "scheduled_test") + Var("scheduled_test_tag"),
   Var("dart_root") + "/third_party/pkg/shelf":
-      (Var("github_mirror") % "shelf") + Var("shelf_rev"),
+      (Var("github_mirror") % "shelf") + Var("shelf_tag"),
   Var("dart_root") + "/third_party/pkg/shelf_static":
-      (Var("github_mirror") % "shelf_static") + Var("shelf_static_rev"),
+      (Var("github_mirror") % "shelf_static") + Var("shelf_static_tag"),
   Var("dart_root") + "/third_party/pkg/shelf_web_socket":
       (Var("github_mirror") % "shelf_web_socket") +
-      Var("shelf_web_socket_rev"),
+      Var("shelf_web_socket_tag"),
   Var("dart_root") + "/third_party/pkg/smoke":
       (Var("github_mirror") % "smoke") + Var("smoke_rev"),
   Var("dart_root") + "/third_party/pkg/source_maps":
@@ -281,7 +280,7 @@
       (Var("github_mirror") % "stack_trace") + Var("stack_trace_tag"),
   Var("dart_root") + "/third_party/pkg/string_scanner":
       (Var("github_mirror") % "string_scanner") +
-      Var("string_scanner_rev"),
+      Var("string_scanner_tag"),
   Var("dart_root") + "/third_party/sunflower":
       (Var("github_mirror") % "sample-sunflower") +
       Var("sunflower_rev"),
@@ -306,7 +305,7 @@
   Var("dart_root") + "/third_party/pkg/which":
       (Var("github_mirror") % "which") + Var("which_tag"),
   Var("dart_root") + "/third_party/pkg/yaml":
-      (Var("github_mirror") % "yaml") + Var("yaml_rev"),
+      (Var("github_mirror") % "yaml") + Var("yaml_tag"),
 
   # These specific versions of barback and source_maps are used for testing and
   # should be pulled from bleeding_edge even on channels.
@@ -357,8 +356,8 @@
       '--no_resume',
       '--bucket',
       'dart-dependencies',
-      '-d',
-      '-r',
+      '--recursive',
+      '--directory',
       Var('dart_root') + '/tools/testing/bin',
     ],
   },
@@ -371,10 +370,25 @@
       '--no_resume',
       '--bucket',
       'dart-dependencies',
-      '-d',
-      '-r',
+      '--recursive',
+      '--directory',
       Var('dart_root') + '/third_party/d8',
     ],
   },
-
+  {
+    "name": "checked_in_dart_sdks",
+    "pattern": ".",
+    "action": [
+      "download_from_google_storage",
+      "--no_auth",
+      "--no_resume",
+      "--bucket",
+      "dart-dependencies",
+      "--recursive",
+      "--auto_platform",
+      "--extract",
+      "--directory",
+      Var('dart_root') + "/tools/sdks",
+    ],
+  },
 ]
diff --git a/README.dart-sdk b/README.dart-sdk
index 1a59eb2..47e3040 100644
--- a/README.dart-sdk
+++ b/README.dart-sdk
@@ -8,7 +8,7 @@
   dart           Dart virtual machine
   dart2js        Dart-to-JavaScript compiler
   dartanalyzer   Dart static analyzer
-  docgen         Dart documentation generator
+  dartdoc        Dart documentation generator
   pub            Pub, the Dart package manager
   dartfmt        Dart code formatter
 
diff --git a/README.md b/README.md
index 7b2589e..a95407c 100644
--- a/README.md
+++ b/README.md
@@ -12,6 +12,13 @@
 Browse [pub.dartlang.org][pubsite] for more packages and libraries contributed
 by the community and the Dart team.
 
+## Building Dart
+
+Learn how to [get the source](https://github.com/dart-lang/sdk/wiki/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).
+
 ## Contributing to Dart
 
 The easiest way to contribute to Dart is to [file issues][dartbug].
diff --git a/WATCHLISTS b/WATCHLISTS
index 762e901..9b4f4dc 100644
--- a/WATCHLISTS
+++ b/WATCHLISTS
@@ -8,7 +8,7 @@
 {
   'WATCHLIST_DEFINITIONS': {
     'runtime': {
-      'filepath': 'runtime/',
+      'filepath': '^runtime/',
     },
     'tools': {
       'filepath': 'tools/',
diff --git a/codereview.settings b/codereview.settings
index 3e78887..ada9e3c 100644
--- a/codereview.settings
+++ b/codereview.settings
@@ -1,4 +1,4 @@
 # This file is used by gcl to get repository specific information.
-CODE_REVIEW_SERVER: http://codereview.chromium.org/
+CODE_REVIEW_SERVER: http://codereview.chromium.org
 VIEW_VC: https://github.com/dart-lang/sdk/commit/
 CC_LIST: reviews@dartlang.org
diff --git a/dart.gyp b/dart.gyp
index fb973e1..81a8f05 100644
--- a/dart.gyp
+++ b/dart.gyp
@@ -94,13 +94,6 @@
       ],
     },
     {
-      'target_name': 'api_docs',
-      'type': 'none',
-      'dependencies': [
-        'utils/apidoc/docgen.gyp:dartdocgen',
-      ],
-    },
-    {
       'target_name': 'samples',
       'type': 'none',
       'dependencies': [],
diff --git a/docs/language/dartLangSpec.tex b/docs/language/dartLangSpec.tex
index efd9b0d..3850f20 100644
--- a/docs/language/dartLangSpec.tex
+++ b/docs/language/dartLangSpec.tex
@@ -2047,7 +2047,8 @@
 In both cases above, $C$ declares the same instance members as $M$ (respectively, $M_k$). If any of the instance fields of $M$ (respectively, $M_k$) have initializers, they are executed in the scope of $M$ (respectively, $M_k$) to initialize the corresponding fields of $C$. 
 
 \LMHash{}
-For each generative constructor named $q_i(T_{i1}$ $ a_{i1}, \ldots , T_{ik_i}$ $ a_{ik_i}), i \in 1..n$ of $S$, $C$ has an implicitly declared constructor named
+Let $L_M$ be the library in which $M$ is declared.
+For each generative constructor named $q_i(T_{i1}$ $ a_{i1}, \ldots , T_{ik_i}$ $ a_{ik_i}), i \in 1..n$ of $S$ that is accessible to $L_M$, $C$ has an implicitly declared constructor named
 $q'_i = [C/S]q_i$ of the form 
 
 $q'_i(a_{i1}, \ldots , a_{ik_i}):\SUPER(a_{i1}, \ldots , a_{ik_i});$.
@@ -6788,7 +6789,7 @@
 }
 
 \LMHash{}
-It is a static warning to import two different libraries with the same name.
+It is a static warning to import two different libraries with the same name unless their name is the empty string.
 
 \commentary{
 A widely disseminated library should be given a name that will not conflict with other such libraries. The preferred mechanism for this is using pub, the Dart package manager, which provides a global namespace for libraries, and conventions that leverage that namespace.
@@ -6879,7 +6880,7 @@
 We say that $L$ {\em re-exports library } $B$, and also that $L$ {\em re-exports namespace } $NS_n$. When no confusion can arise, we may simply state that $L$ {\em re-exports }$B$, or that $L$ {\em re-exports }$NS_n$.
 
 \LMHash{}
-It is a compile-time error if a name $N$ is re-exported by a library $L$ and $N$ is  introduced into the export namespace of $L$ by more than one export, unless all  exports refer to same declaration for the name $N$.  It is a static warning to export two different libraries with the same name.
+It is a compile-time error if a name $N$ is re-exported by a library $L$ and $N$ is  introduced into the export namespace of $L$ by more than one export, unless all  exports refer to same declaration for the name $N$.  It is a static warning to export two different libraries with the same name unless their name is the empty string.
 
 
 
@@ -7052,6 +7053,8 @@
 A type $T$ is {\em deferred} iff it is of the form $p.T$ where $p$ is a deferred prefix.
 It is a static warning to use a deferred type in a type annotation, type test, type cast or as a type parameter. However, all other static warnings must be issued under the assumption that all deferred libraries have successfully been loaded.
 
+% Now, when passed to a generic, p.T also has to be treated as dynamic - otherwise we have to fail immediately. Where do we say that? And how does this fit with idea that as a type object it fails? Should we say that the accessor on p returns dynamic instead of failing? Do we distinguish its use in a constructor vs its use in an annotation? It's not that we evaluate type objects in constructor args - these cannot represent parameterized types.
+
 
 \subsubsection{Type Promotion}   
 \LMLabel{typePromotion}
diff --git a/pkg/analysis_server/benchmark/integration/driver.dart b/pkg/analysis_server/benchmark/integration/driver.dart
index a3167810..80aec4c1 100644
--- a/pkg/analysis_server/benchmark/integration/driver.dart
+++ b/pkg/analysis_server/benchmark/integration/driver.dart
@@ -264,6 +264,7 @@
         m.printSummary(keyLen);
       }
     }
+
     /// TODO(danrubel) *** print warnings if driver caches are not empty ****
     print('''
 
diff --git a/pkg/analysis_server/benchmark/integration/input_converter.dart b/pkg/analysis_server/benchmark/integration/input_converter.dart
index 3d9fd5a..2e941ff 100644
--- a/pkg/analysis_server/benchmark/integration/input_converter.dart
+++ b/pkg/analysis_server/benchmark/integration/input_converter.dart
@@ -8,8 +8,8 @@
 import 'dart:convert';
 import 'dart:io';
 
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/constants.dart';
-import 'package:analysis_server/src/protocol.dart';
 import 'package:logging/logging.dart';
 import 'package:path/path.dart' as path;
 
diff --git a/pkg/analysis_server/benchmark/integration/instrumentation_input_converter.dart b/pkg/analysis_server/benchmark/integration/instrumentation_input_converter.dart
index 790da05..a43d4b4 100644
--- a/pkg/analysis_server/benchmark/integration/instrumentation_input_converter.dart
+++ b/pkg/analysis_server/benchmark/integration/instrumentation_input_converter.dart
@@ -29,8 +29,7 @@
    */
   StringBuffer readBuffer = null;
 
-  InstrumentationInputConverter(
-      String tmpSrcDirPath, PathMap srcPathMap)
+  InstrumentationInputConverter(String tmpSrcDirPath, PathMap srcPathMap)
       : super(tmpSrcDirPath, srcPathMap);
 
   @override
diff --git a/pkg/analysis_server/benchmark/integration/local_runner.dart b/pkg/analysis_server/benchmark/integration/local_runner.dart
index 78d8c2a..bd0ff6b 100644
--- a/pkg/analysis_server/benchmark/integration/local_runner.dart
+++ b/pkg/analysis_server/benchmark/integration/local_runner.dart
@@ -51,11 +51,8 @@
   if (!new Directory(join(gitDir.path, outDirName)).existsSync()) {
     throw 'failed to find out or xcodebuild directory';
   }
-  result = Process.runSync('ln', [
-    '-s',
-    join(gitDir.path, outDirName),
-    join(tmpSrcDirPath, outDirName)
-  ]);
+  result = Process.runSync('ln',
+      ['-s', join(gitDir.path, outDirName), join(tmpSrcDirPath, outDirName)]);
   if (result.exitCode != 0) throw 'failed to link out or xcodebuild: $result';
   /*
    * Collect arguments
diff --git a/pkg/analysis_server/benchmark/integration/main.dart b/pkg/analysis_server/benchmark/integration/main.dart
index 7cfb299..100ab6f 100644
--- a/pkg/analysis_server/benchmark/integration/main.dart
+++ b/pkg/analysis_server/benchmark/integration/main.dart
@@ -74,9 +74,11 @@
 ArgParser get argParser {
   _argParser = new ArgParser();
 
-  _argParser.addOption(INPUT_CMDLINE_OPTION, abbr: 'i', help: '<filePath>\n'
-      'The input file specifying how this client should interact with the server.\n'
-      'If the input file name is "stdin", then the instructions are read from standard input.');
+  _argParser.addOption(INPUT_CMDLINE_OPTION,
+      abbr: 'i',
+      help: '<filePath>\n'
+          'The input file specifying how this client should interact with the server.\n'
+          'If the input file name is "stdin", then the instructions are read from standard input.');
   _argParser.addOption(MAP_OPTION,
       abbr: 'm',
       allowMultiple: true,
@@ -87,9 +89,11 @@
           'to the target source directory <newSrcPath> used during performance testing.\n'
           'Multiple mappings can be specified.\n'
           'WARNING: The contents of the target directory will be modified');
-  _argParser.addOption(TMP_SRC_DIR_OPTION, abbr: 't', help: '<dirPath>\n'
-      'The temporary directory containing source used during performance measurement.\n'
-      'WARNING: The contents of the target directory will be modified');
+  _argParser.addOption(TMP_SRC_DIR_OPTION,
+      abbr: 't',
+      help: '<dirPath>\n'
+          'The temporary directory containing source used during performance measurement.\n'
+          'WARNING: The contents of the target directory will be modified');
   _argParser.addFlag(NEW_TASK_MODEL_OPTION,
       help: "enable the use of the new task model",
       defaultsTo: false,
@@ -119,7 +123,9 @@
     inputRaw = new File(args.inputPath).openRead();
   }
   for (PathMapEntry entry in args.srcPathMap.entries) {
-    logger.log(Level.INFO, 'mapping source path\n'
+    logger.log(
+        Level.INFO,
+        'mapping source path\n'
         '  from ${entry.oldSrcPrefix}\n  to   ${entry.newSrcPrefix}');
   }
   logger.log(Level.INFO, 'tmpSrcDir: ${args.tmpSrcDirPath}');
@@ -224,7 +230,6 @@
  * The performance measurement arguments specified on the command line.
  */
 class PerfArgs {
-
   /**
    * The file path of the instrumentation or log file
    * used to drive performance measurement,
diff --git a/pkg/analysis_server/benchmark/integration/operation.dart b/pkg/analysis_server/benchmark/integration/operation.dart
index 9e408d8..0033d1f 100644
--- a/pkg/analysis_server/benchmark/integration/operation.dart
+++ b/pkg/analysis_server/benchmark/integration/operation.dart
@@ -6,7 +6,7 @@
 
 import 'dart:async';
 
-import 'package:analysis_server/src/protocol.dart';
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:logging/logging.dart';
 
 import 'driver.dart';
@@ -87,8 +87,8 @@
     void recordResult(bool success, result) {
       Duration elapsed = stopwatch.elapsed;
       driver.results.record(method, elapsed, success: success);
-      driver.logger.log(
-          Level.FINE, 'Response received: $method : $elapsed\n  $result');
+      driver.logger
+          .log(Level.FINE, 'Response received: $method : $elapsed\n  $result');
     }
 
     driver.send(method, json['params']).then((Map<String, dynamic> result) {
diff --git a/pkg/analysis_server/benchmark/perf/analysis_timing_tests.dart b/pkg/analysis_server/benchmark/perf/analysis_timing_tests.dart
new file mode 100644
index 0000000..3d18865
--- /dev/null
+++ b/pkg/analysis_server/benchmark/perf/analysis_timing_tests.dart
@@ -0,0 +1,164 @@
+// 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 server.performance.analysis.timing;
+
+import 'dart:async';
+import 'dart:io';
+
+import 'package:analysis_server/plugin/protocol/protocol.dart';
+import 'package:args/args.dart';
+import 'package:unittest/unittest.dart';
+
+import '../../test/utils.dart';
+import 'performance_tests.dart';
+
+/**
+ * Pass in the directory of the source to be analyzed as option `--source`,
+ * optionally specify a priority file with `--priority` and the specific
+ * test to run with `--metric`.  If no test is specified, the default is
+ * `analysis`.
+ */
+main(List<String> arguments) {
+  initializeTestEnvironment();
+  ArgParser parser = _createArgParser();
+  var args = parser.parse(arguments);
+  if (args[SOURCE_OPTION] == null) {
+    print('path to source directory must be specified');
+    exit(1);
+  }
+  source = args[SOURCE_OPTION];
+  priorityFile = args[PRIORITY_FILE_OPTION];
+  metricNames.addAll(args[METRIC_NAME_OPTION]);
+  unittestConfiguration.timeout = new Duration(minutes: 20);
+
+  var test;
+
+  if (metricNames.isEmpty) {
+    test = new AnalysisTimingTest();
+  } else {
+    test = new SubscriptionTimingTest();
+  }
+
+  Future.wait([test.test_timing()]);
+}
+
+const DEFAULT_METRIC = 'analysis';
+const METRIC_NAME_OPTION = 'metric';
+const PRIORITY_FILE_OPTION = 'priority';
+const SOURCE_OPTION = 'source';
+
+final metricNames = <String>[];
+String priorityFile;
+String source;
+
+ArgParser _createArgParser() => new ArgParser()
+  ..addOption(METRIC_NAME_OPTION,
+      help: 'metric name (defaults to `analysis`)', allowMultiple: true)
+  ..addOption(SOURCE_OPTION, help: 'full path to source directory for analysis')
+  ..addOption(PRIORITY_FILE_OPTION,
+      help: '(optional) full path to a priority file');
+
+/**
+ * AnalysisTimingTest measures the time taken by the analsyis server to fully analyze
+ * the given directory. Measurement is started after setting the analysis root, and
+ * analysis is considered complete on receiving the `"isAnalyzing": false` message
+ * from the analysis server.
+ */
+class AnalysisTimingTest extends AbstractTimingTest {
+  Future test_timing() async {
+    // Set root after subscribing to avoid empty notifications.
+    await init(source);
+
+    setAnalysisRoot();
+    stopwatch.start();
+    await analysisFinished;
+    print('analysis completed in ${stopwatch.elapsed}');
+
+    await shutdown();
+  }
+}
+
+class Metric {
+  List<Duration> timings = <Duration>[];
+  Stream eventStream;
+  AnalysisService service;
+  String name;
+  Metric(this.name, this.service, this.eventStream);
+  String toString() => '$name: $service, ${eventStream.runtimeType}, $timings';
+}
+
+/**
+ * SubscriptionTimingTest measures the time taken by the analysis server to return
+ * information for navigation, semantic highlighting, outline, get occurances,
+ * overrides, folding and implemented. These timings are wrt to the specified priority file
+ * - the file that is currently opened and has focus in the editor. Measure the time from
+ * when the client subscribes for the notifications till there is a response from the server.
+ * Does not wait for analysis to be complete before subscribing for notifications.
+ */
+class SubscriptionTimingTest extends AbstractTimingTest {
+  List<Metric> _metrics;
+
+  List<Metric> get metrics =>
+      _metrics ??= metricNames.map((name) => getMetric(name)).toList();
+
+  Metric getMetric(String name) {
+    switch (name) {
+      case 'folding':
+        return new Metric(name, AnalysisService.FOLDING, onAnalysisFolding);
+      case 'highlighting':
+        return new Metric(
+            name, AnalysisService.HIGHLIGHTS, onAnalysisHighlights);
+      case 'implemented':
+        return new Metric(
+            name, AnalysisService.IMPLEMENTED, onAnalysisImplemented);
+      case 'navigation':
+        return new Metric(
+            name, AnalysisService.NAVIGATION, onAnalysisNavigation);
+      case 'outline':
+        return new Metric(name, AnalysisService.OUTLINE, onAnalysisOutline);
+      case 'occurences':
+        return new Metric(
+            name, AnalysisService.OCCURRENCES, onAnalysisOccurrences);
+      case 'overrides':
+        return new Metric(name, AnalysisService.OVERRIDES, onAnalysisOverrides);
+    }
+    print('no metric found for $name');
+    exit(1);
+    return null; // Won't get here.
+  }
+
+  Future test_timing() async {
+//   debugStdio();
+
+    expect(metrics, isNotEmpty);
+    expect(priorityFile, isNotNull,
+        reason: 'A priority file must be specified for '
+            '${metrics.first.name} testing.');
+
+    await init(source);
+    stopwatch.start();
+
+    metrics.forEach((Metric m) => m.eventStream.listen((_) {
+          m.timings.add(
+              new Duration(milliseconds: stopwatch.elapsed.inMilliseconds));
+        }));
+
+    var subscriptions = <AnalysisService, List<String>>{};
+    metrics.forEach((Metric m) => subscriptions[m.service] = [priorityFile]);
+
+    sendAnalysisSetSubscriptions(subscriptions);
+
+    // Set root after subscribing to avoid empty notifications.
+    setAnalysisRoot();
+
+    sendAnalysisSetPriorityFiles([priorityFile]);
+
+    await analysisFinished;
+    print('analysis completed in ${stopwatch.elapsed}');
+    metrics.forEach((Metric m) => print('${m.name} timings: ${m.timings}'));
+
+    await shutdown();
+  }
+}
diff --git a/pkg/analysis_server/benchmark/perf/completion_timing_tests.dart b/pkg/analysis_server/benchmark/perf/completion_timing_tests.dart
new file mode 100644
index 0000000..f28ccf4
--- /dev/null
+++ b/pkg/analysis_server/benchmark/perf/completion_timing_tests.dart
@@ -0,0 +1,84 @@
+// 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 server.performance.analysis.timing;
+
+import 'dart:async';
+import 'dart:io';
+
+import 'package:args/args.dart';
+import 'package:unittest/unittest.dart';
+
+import '../../test/utils.dart';
+import 'performance_tests.dart';
+
+/**
+ * Pass in the directory of the source to be analyzed as option `--source`,
+ * specify a priority file with `--priority` and an offset for completions
+ * with a `--offset`.
+ */
+main(List<String> arguments) {
+  initializeTestEnvironment();
+  ArgParser parser = _createArgParser();
+  var args = parser.parse(arguments);
+  if (args[SOURCE_OPTION] == null) {
+    print('path to source directory must be specified');
+    exit(1);
+  }
+  source = args[SOURCE_OPTION];
+  priorityFile = args[PRIORITY_FILE_OPTION];
+  offset = int.parse(args[COMPLETION_OFFSET]);
+
+  Future.wait([new CompletionTimingTest().test_timing()]);
+}
+
+const PRIORITY_FILE_OPTION = 'priority';
+const SOURCE_OPTION = 'source';
+const COMPLETION_OFFSET = 'offset';
+
+String priorityFile;
+String source;
+int offset;
+
+ArgParser _createArgParser() => new ArgParser()
+  ..addOption(SOURCE_OPTION, help: 'full path to source directory for analysis')
+  ..addOption(PRIORITY_FILE_OPTION, help: 'full path to a priority file')
+  ..addOption(COMPLETION_OFFSET, help: 'offset in file for code completions');
+
+/**
+ * CompletionTimingTest measures the time taken for the analysis server to respond with
+ * completion suggestions for a given file and offset. The time measured starts when
+ * the analysis root is set and is done when the completion suggestions are received
+ * from the server. The test does not wait for analysis to be complete before asking for
+ * completions.
+ */
+class CompletionTimingTest extends AbstractTimingTest {
+  List<Duration> timings = <Duration>[];
+
+  Future test_timing() async {
+//    debugStdio();
+
+    expect(priorityFile, isNotNull,
+        reason: 'A priority file must be specified for completion testing.');
+    expect(offset, isNotNull,
+        reason: 'An offset must be specified for completion testing.');
+
+    await init(source);
+    stopwatch.start();
+
+    onCompletionResults.listen((_) {
+      timings.add(new Duration(milliseconds: stopwatch.elapsed.inMilliseconds));
+    });
+
+    setAnalysisRoot();
+    sendAnalysisSetPriorityFiles([priorityFile]);
+    sendCompletionGetSuggestions(priorityFile, offset);
+
+    await analysisFinished;
+
+    print('analysis completed in ${stopwatch.elapsed}');
+    print('completion received at : ${timings}');
+    await shutdown();
+  }
+}
diff --git a/pkg/analysis_server/benchmark/perf/performance_tests.dart b/pkg/analysis_server/benchmark/perf/performance_tests.dart
new file mode 100644
index 0000000..62a752c
--- /dev/null
+++ b/pkg/analysis_server/benchmark/perf/performance_tests.dart
@@ -0,0 +1,80 @@
+// 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 server.performance;
+
+import 'dart:async';
+import 'dart:io';
+
+import 'package:analysis_server/plugin/protocol/protocol.dart';
+import 'package:unittest/unittest.dart';
+
+import '../../test/integration/integration_tests.dart';
+
+/**
+ * Base class for analysis server performance tests.
+ */
+abstract class AbstractAnalysisServerPerformanceTest
+    extends AbstractAnalysisServerIntegrationTest {
+  /**
+   * Stopwatch for timing results;
+   */
+  Stopwatch stopwatch = new Stopwatch();
+
+  /**
+   * Send the server an 'analysis.setAnalysisRoots' command directing it to
+   * analyze [sourceDirectory].
+   */
+  Future setAnalysisRoot() =>
+      sendAnalysisSetAnalysisRoots([sourceDirectory.path], []);
+
+  /**
+   * The server is automatically started before every test.
+   */
+  @override
+  Future setUp() {
+    onAnalysisErrors.listen((AnalysisErrorsParams params) {
+      currentAnalysisErrors[params.file] = params.errors;
+    });
+    onServerError.listen((ServerErrorParams params) {
+      // A server error should never happen during an integration test.
+      fail('${params.message}\n${params.stackTrace}');
+    });
+    Completer serverConnected = new Completer();
+    onServerConnected.listen((_) {
+      expect(serverConnected.isCompleted, isFalse);
+      serverConnected.complete();
+    });
+    return startServer().then((_) {
+      server.listenToOutput(dispatchNotification);
+      server.exitCode.then((_) {
+        skipShutdown = true;
+      });
+      return serverConnected.future;
+    });
+  }
+
+  /**
+   * Enable [SERVER_STATUS] notifications so that [analysisFinished]
+   * can be used.
+   */
+  Future subscribeToStatusNotifications() {
+    List<Future> futures = <Future>[];
+    futures.add(sendServerSetSubscriptions([ServerService.STATUS]));
+    return Future.wait(futures);
+  }
+
+  /**
+   * After every test, the server is stopped.
+   */
+  Future shutdown() async => await shutdownIfNeeded();
+}
+
+class AbstractTimingTest extends AbstractAnalysisServerPerformanceTest {
+  Future init(String source) async {
+    await super.setUp();
+    sourceDirectory = new Directory(source);
+    return subscribeToStatusNotifications();
+  }
+}
diff --git a/pkg/analysis_server/doc/api.html b/pkg/analysis_server/doc/api.html
index 815a2d3..707246a 100644
--- a/pkg/analysis_server/doc/api.html
+++ b/pkg/analysis_server/doc/api.html
@@ -1,4 +1,4 @@
-<html><head>
+<!DOCTYPE html><html><head>
     <meta charset="UTF-8">
     <title>Analysis Server API Specification</title>
   <style>body {
@@ -40,10 +40,28 @@
 dt.typeDefinition {
   font-weight: bold;
 }
+
+*/
+* Styles for index
+*/
+
+.subindex {
+}
+
+.subindex ul {
+  padding-left: 0px;
+  margin-left: 0px;
+
+  -webkit-margin-before: 0px;
+  -webkit-margin-start: 0px;
+  -webkit-padding-start: 0px;
+
+  list-style-type: none;
+}
 </style></head>
   <body>
     <h1>Analysis Server API Specification</h1>
-    <h1 style="color:#999999">Version 1.9.0</h1>
+    <h1 style="color:#999999">Version 1.12.0</h1>
     <p>
       This document contains a specification of the API provided by the
       analysis server.  The API in this document is currently under
@@ -175,6 +193,9 @@
       the standard JSON primitives. These data structures are
       documented in the section titled <a href="#types">Types</a>.
     </p>
+    <p>
+      To get an overview of the API, you can consult the <a href="#index">index</a>.
+    </p>
     <h3>Command-line Arguments</h3>
     <p>
       The command-line arguments that can be passed to the server.
@@ -399,6 +420,7 @@
       
       
       
+      
     <h3>Requests</h3><dl><dt class="request"><a name="request_analysis.getErrors">analysis.getErrors</a> (<a href="#request_analysis.getErrors">#</a>)</dt><dd><div class="box"><pre>request: {
   "id": String
   "method": "analysis.getErrors"
@@ -1018,6 +1040,40 @@
               other highlight regions if there is more than one
               meaning associated with a particular region.
             </p>
+          </dd></dl></dd><dt class="notification"><a name="notification_analysis.implemented">analysis.implemented</a> (<a href="#notification_analysis.implemented">#</a>)</dt><dd><div class="box"><pre>notification: {
+  "event": "analysis.implemented"
+  "params": {
+    "<b>file</b>": <a href="#type_FilePath">FilePath</a>
+    "<b>classes</b>": List&lt;<a href="#type_ImplementedClass">ImplementedClass</a>&gt;
+    "<b>members</b>": List&lt;<a href="#type_ImplementedMember">ImplementedMember</a>&gt;
+  }
+}</pre></div>
+        <p>
+          Reports the classes that are implemented or extended and
+          class members that are implemented or overridden in a file.
+        </p>
+        <p>
+          This notification is not subscribed to by default. Clients
+          can subscribe by including the value <tt>"IMPLEMENTED"</tt> in
+          the list of services passed in an analysis.setSubscriptions
+          request.
+        </p>
+        
+      <h4>Parameters</h4><dl><dt class="field"><b><i>file ( <a href="#type_FilePath">FilePath</a> )</i></b></dt><dd>
+            
+            <p>
+              The file with which the implementations are associated.
+            </p>
+          </dd><dt class="field"><b><i>classes ( List&lt;<a href="#type_ImplementedClass">ImplementedClass</a>&gt; )</i></b></dt><dd>
+            
+            <p>
+              The classes defined in the file that are implemented or extended.
+            </p>
+          </dd><dt class="field"><b><i>members ( List&lt;<a href="#type_ImplementedMember">ImplementedMember</a>&gt; )</i></b></dt><dd>
+            
+            <p>
+              The member defined in the file that are implemented or overridden.
+            </p>
           </dd></dl></dd><dt class="notification"><a name="notification_analysis.invalidate">analysis.invalidate</a> (<a href="#notification_analysis.invalidate">#</a>)</dt><dd><div class="box"><pre>notification: {
   "event": "analysis.invalidate"
   "params": {
@@ -1144,6 +1200,8 @@
   "event": "analysis.outline"
   "params": {
     "<b>file</b>": <a href="#type_FilePath">FilePath</a>
+    "<b>kind</b>": <a href="#type_FileKind">FileKind</a>
+    "<b>libraryName</b>": <span style="color:#999999">optional</span> String
     "<b>outline</b>": <a href="#type_Outline">Outline</a>
   }
 }</pre></div>
@@ -1162,6 +1220,21 @@
             <p>
               The file with which the outline is associated.
             </p>
+          </dd><dt class="field"><b><i>kind ( <a href="#type_FileKind">FileKind</a> )</i></b></dt><dd>
+            
+            <p>
+              The kind of the file.
+            </p>
+          </dd><dt class="field"><b><i>libraryName ( <span style="color:#999999">optional</span> String )</i></b></dt><dd>
+            
+            <p>
+              The name of the library defined by the file using a "library"
+              directive, or referenced by a "part of" directive. If both
+              "library" and "part of" directives are present, then the
+              "library" directive takes precedence.
+              This field will be omitted if the file has neither "library"
+              nor "part of" directives.
+            </p>
           </dd><dt class="field"><b><i>outline ( <a href="#type_Outline">Outline</a> )</i></b></dt><dd>
             
             <p>
@@ -1175,7 +1248,7 @@
   }
 }</pre></div>
         <p>
-          Reports the overridding members in a file.
+          Reports the overriding members in a file.
         </p>
         <p>
           This notification is not subscribed to by default. Clients
@@ -1490,6 +1563,7 @@
   "params": {
     "<b>file</b>": <a href="#type_FilePath">FilePath</a>
     "<b>offset</b>": int
+    "<b>superOnly</b>": <span style="color:#999999">optional</span> bool
   }
 }</pre><br><pre>response: {
   "id": String
@@ -1515,6 +1589,12 @@
             <p>
               The offset of the name of the type within the file.
             </p>
+          </dd><dt class="field"><b><i>superOnly ( <span style="color:#999999">optional</span> bool )</i></b></dt><dd>
+            
+            <p>
+              True if the client is only requesting superclasses and
+              interfaces hierarchy.
+            </p>
           </dd></dl><h4>Returns</h4><dl><dt class="field"><b><i>hierarchyItems ( <span style="color:#999999">optional</span> List&lt;<a href="#type_TypeHierarchyItem">TypeHierarchyItem</a>&gt; )</i></b></dt><dd>
             
             <p>
@@ -1968,7 +2048,7 @@
           If directives of the Dart file cannot be organized, for example
           because it has scan or parse errors, or by other reasons,
           <tt>ORGANIZE_DIRECTIVES_ERROR</tt> will be generated. The message
-          will provide datails about the reason.
+          will provide details about the reason.
         </p>
         
         
@@ -2244,6 +2324,9 @@
       
       
       
+      
+      
+      
     <dl><dt class="typeDefinition"><a name="type_AddContentOverlay">AddContentOverlay: object</a></dt><dd>
         <p>
           A directive to begin overlaying the contents of a file.  The
@@ -2297,6 +2380,20 @@
               the error. The field is omitted if there is no correction
               message associated with the error code.
             </p>
+          </dd><dt class="field"><b><i>hasFix ( <span style="color:#999999">optional</span> bool )</i></b></dt><dd>
+            
+            <p>
+              A hint to indicate to interested clients that this error has
+              an associated fix (or fixes).  The absence of this field implies
+              there are not known to be fixes.  Note that since the operation
+              to calculate whether fixes apply needs to be performant it is
+              possible that complicated tests will be skipped and a false
+              negative returned.  For this reason, this attribute should be
+              treated as a "hint".  Despite the possibility of false negatives,
+              no false positives should be returned.  If a client sees this
+              flag set they can proceed with the confidence that there are in
+              fact associated fixes.
+            </p>
           </dd></dl></dd><dt class="typeDefinition"><a name="type_AnalysisErrorFixes">AnalysisErrorFixes: object</a></dt><dd>
         <p>
           A list of fixes associated with a specific error
@@ -2358,6 +2455,12 @@
               True if the client wants to enable support for the
               proposed "null aware operators" feature.
             </p>
+          </dd><dt class="field"><b><i>enableSuperMixins ( <span style="color:#999999">optional</span> bool )</i></b></dt><dd>
+            
+            <p>
+              True if the client wants to enable support for the
+              proposed "less restricted mixins" proposal (DEP 34).
+            </p>
           </dd><dt class="field"><b><i>generateDart2jsHints ( <span style="color:#999999">optional</span> bool )</i></b></dt><dd>
             
             <p>
@@ -2382,7 +2485,7 @@
           are related to a specific list of files.
         </p>
         
-      <dl><dt class="value">FOLDING</dt><dt class="value">HIGHLIGHTS</dt><dt class="value">INVALIDATE</dt><dd>
+      <dl><dt class="value">FOLDING</dt><dt class="value">HIGHLIGHTS</dt><dt class="value">IMPLEMENTED</dt><dt class="value">INVALIDATE</dt><dd>
             
             <p>
               This service is not currently implemented and will become a
@@ -2673,7 +2776,7 @@
           An enumeration of the kinds of elements.
         </p>
         
-      <dl><dt class="value">CLASS</dt><dt class="value">CLASS_TYPE_ALIAS</dt><dt class="value">COMPILATION_UNIT</dt><dt class="value">CONSTRUCTOR</dt><dt class="value">ENUM</dt><dt class="value">ENUM_CONSTANT</dt><dt class="value">FIELD</dt><dt class="value">FUNCTION</dt><dt class="value">FUNCTION_TYPE_ALIAS</dt><dt class="value">GETTER</dt><dt class="value">LABEL</dt><dt class="value">LIBRARY</dt><dt class="value">LOCAL_VARIABLE</dt><dt class="value">METHOD</dt><dt class="value">PARAMETER</dt><dt class="value">PREFIX</dt><dt class="value">SETTER</dt><dt class="value">TOP_LEVEL_VARIABLE</dt><dt class="value">TYPE_PARAMETER</dt><dt class="value">UNIT_TEST_GROUP</dt><dt class="value">UNIT_TEST_TEST</dt><dt class="value">UNKNOWN</dt></dl></dd><dt class="typeDefinition"><a name="type_ExecutableFile">ExecutableFile: object</a></dt><dd>
+      <dl><dt class="value">CLASS</dt><dt class="value">CLASS_TYPE_ALIAS</dt><dt class="value">COMPILATION_UNIT</dt><dt class="value">CONSTRUCTOR</dt><dt class="value">ENUM</dt><dt class="value">ENUM_CONSTANT</dt><dt class="value">FIELD</dt><dt class="value">FILE</dt><dt class="value">FUNCTION</dt><dt class="value">FUNCTION_TYPE_ALIAS</dt><dt class="value">GETTER</dt><dt class="value">LABEL</dt><dt class="value">LIBRARY</dt><dt class="value">LOCAL_VARIABLE</dt><dt class="value">METHOD</dt><dt class="value">PARAMETER</dt><dt class="value">PREFIX</dt><dt class="value">SETTER</dt><dt class="value">TOP_LEVEL_VARIABLE</dt><dt class="value">TYPE_PARAMETER</dt><dt class="value">UNIT_TEST_GROUP</dt><dt class="value">UNIT_TEST_TEST</dt><dt class="value">UNKNOWN</dt></dl></dd><dt class="typeDefinition"><a name="type_ExecutableFile">ExecutableFile: object</a></dt><dd>
         <p>
           A description of an executable file.
         </p>
@@ -2704,7 +2807,12 @@
           domain.
         </p>
         
-      <dl><dt class="value">LAUNCH_DATA</dt></dl></dd><dt class="typeDefinition"><a name="type_FilePath">FilePath: String</a></dt><dd>
+      <dl><dt class="value">LAUNCH_DATA</dt></dl></dd><dt class="typeDefinition"><a name="type_FileKind">FileKind: String</a></dt><dd>
+        <p>
+          An enumeration of the kinds of files.
+        </p>
+        
+      <dl><dt class="value">LIBRARY</dt><dt class="value">PART</dt></dl></dd><dt class="typeDefinition"><a name="type_FilePath">FilePath: String</a></dt><dd>
         
         <p>
           The absolute path of a file.
@@ -2922,14 +3030,14 @@
       <dl><dt class="field"><b><i>offset ( int )</i></b></dt><dd>
             
             <p>
-              The offset of the range of characters that encompases the
+              The offset of the range of characters that encompasses the
               cursor position and has the same hover information as the
               cursor position.
             </p>
           </dd><dt class="field"><b><i>length ( int )</i></b></dt><dd>
             
             <p>
-              The length of the range of characters that encompases the
+              The length of the range of characters that encompasses the
               cursor position and has the same hover information as the
               cursor position.
             </p>
@@ -3003,6 +3111,36 @@
               is omitted if the location does not correspond to an
               expression.
             </p>
+          </dd></dl></dd><dt class="typeDefinition"><a name="type_ImplementedClass">ImplementedClass: object</a></dt><dd>
+        <p>
+          A description of a class that is implemented or extended.
+        </p>
+        
+      <dl><dt class="field"><b><i>offset ( int )</i></b></dt><dd>
+            
+            <p>
+              The offset of the name of the implemented class.
+            </p>
+          </dd><dt class="field"><b><i>length ( int )</i></b></dt><dd>
+            
+            <p>
+              The length of the name of the implemented class.
+            </p>
+          </dd></dl></dd><dt class="typeDefinition"><a name="type_ImplementedMember">ImplementedMember: object</a></dt><dd>
+        <p>
+          A description of a class member that is implemented or overridden.
+        </p>
+        
+      <dl><dt class="field"><b><i>offset ( int )</i></b></dt><dd>
+            
+            <p>
+              The offset of the name of the implemented member.
+            </p>
+          </dd><dt class="field"><b><i>length ( int )</i></b></dt><dd>
+            
+            <p>
+              The length of the name of the implemented member.
+            </p>
           </dd></dl></dd><dt class="typeDefinition"><a name="type_LinkedEditGroup">LinkedEditGroup: object</a></dt><dd>
         <p>
           A collection of positions that should be linked (edited
@@ -3108,7 +3246,7 @@
             <p>
               The indexes of the targets (in the enclosing navigation response)
               to which the given region is bound. By opening the target, clients
-              can implement one form of navigation.
+              can implement one form of navigation. This list cannot be empty.
             </p>
           </dd></dl></dd><dt class="typeDefinition"><a name="type_NavigationTarget">NavigationTarget: object</a></dt><dd>
         <p>
@@ -3529,7 +3667,7 @@
             <p>
               A request was received which the analysis server does
               not recognize, or cannot handle in its current
-              configuation.
+              configuration.
             </p>
           </dd><dt class="value">UNKNOWN_SOURCE</dt><dd>
             
@@ -3817,16 +3955,28 @@
         </p>
       <h4>Feedback</h4><p>none</p><h4>Options</h4><p>none</p></dd><dt class="refactoring">EXTRACT_LOCAL_VARIABLE</dt><dd>
         <p>
-          Create a local variable initialized by a specified
-          expression.
+          Create a local variable initialized by the expression that covers
+          the specified selection.
         </p>
         <p>
-          It is an error if the range contains anything other than a
-          complete expression (no partial expressions are allowed).
+          It is an error if the selection range is not covered by a
+          complete expression.
         </p>
         
         
-      <h4>Feedback</h4><dl><dt class="field"><b><i>names ( List&lt;String&gt; )</i></b></dt><dd>
+      <h4>Feedback</h4><dl><dt class="field"><b><i>coveringExpressionOffsets ( List&lt;int&gt; )</i></b></dt><dd>
+            
+            <p>
+              The offsets of the expressions that cover the specified
+              selection, from the down most to the up most.
+            </p>
+          </dd><dt class="field"><b><i>coveringExpressionLengths ( List&lt;int&gt; )</i></b></dt><dd>
+            
+            <p>
+              The lengths of the expressions that cover the specified
+              selection, from the down most to the up most.
+            </p>
+          </dd><dt class="field"><b><i>names ( List&lt;String&gt; )</i></b></dt><dd>
             
             <p>
               The proposed names for the local variable.
@@ -4100,6 +4250,8 @@
     <p>
       TBD
     </p>
+    <h2 class="domain"><a name="index">Index</a></h2>
+    <h3>Domains</h3><h4>server (<a href="#domain_server">↑</a>)</h4><div class="subindex"><h5>Requests</h5><ul><li><a href="#request_server.getVersion">getVersion</a></li><li><a href="#request_server.shutdown">shutdown</a></li><li><a href="#request_server.setSubscriptions">setSubscriptions</a></li></ul><h5>Notifications</h5><div class="subindex"><ul><li><a href="#notification_server.connected">connected</a></li><li><a href="#notification_server.error">error</a></li><li><a href="#notification_server.status">status</a></li></ul></div></div><h4>analysis (<a href="#domain_analysis">↑</a>)</h4><div class="subindex"><h5>Requests</h5><ul><li><a href="#request_analysis.getErrors">getErrors</a></li><li><a href="#request_analysis.getHover">getHover</a></li><li><a href="#request_analysis.getLibraryDependencies">getLibraryDependencies</a></li><li><a href="#request_analysis.getNavigation">getNavigation</a></li><li><a href="#request_analysis.reanalyze">reanalyze</a></li><li><a href="#request_analysis.setAnalysisRoots">setAnalysisRoots</a></li><li><a href="#request_analysis.setGeneralSubscriptions">setGeneralSubscriptions</a></li><li><a href="#request_analysis.setPriorityFiles">setPriorityFiles</a></li><li><a href="#request_analysis.setSubscriptions">setSubscriptions</a></li><li><a href="#request_analysis.updateContent">updateContent</a></li><li><a href="#request_analysis.updateOptions">updateOptions</a></li></ul><h5>Notifications</h5><div class="subindex"><ul><li><a href="#notification_analysis.analyzedFiles">analyzedFiles</a></li><li><a href="#notification_analysis.errors">errors</a></li><li><a href="#notification_analysis.flushResults">flushResults</a></li><li><a href="#notification_analysis.folding">folding</a></li><li><a href="#notification_analysis.highlights">highlights</a></li><li><a href="#notification_analysis.implemented">implemented</a></li><li><a href="#notification_analysis.invalidate">invalidate</a></li><li><a href="#notification_analysis.navigation">navigation</a></li><li><a href="#notification_analysis.occurrences">occurrences</a></li><li><a href="#notification_analysis.outline">outline</a></li><li><a href="#notification_analysis.overrides">overrides</a></li></ul></div></div><h4>completion (<a href="#domain_completion">↑</a>)</h4><div class="subindex"><h5>Requests</h5><ul><li><a href="#request_completion.getSuggestions">getSuggestions</a></li></ul><h5>Notifications</h5><div class="subindex"><ul><li><a href="#notification_completion.results">results</a></li></ul></div></div><h4>search (<a href="#domain_search">↑</a>)</h4><div class="subindex"><h5>Requests</h5><ul><li><a href="#request_search.findElementReferences">findElementReferences</a></li><li><a href="#request_search.findMemberDeclarations">findMemberDeclarations</a></li><li><a href="#request_search.findMemberReferences">findMemberReferences</a></li><li><a href="#request_search.findTopLevelDeclarations">findTopLevelDeclarations</a></li><li><a href="#request_search.getTypeHierarchy">getTypeHierarchy</a></li></ul><h5>Notifications</h5><div class="subindex"><ul><li><a href="#notification_search.results">results</a></li></ul></div></div><h4>edit (<a href="#domain_edit">↑</a>)</h4><div class="subindex"><h5>Requests</h5><ul><li><a href="#request_edit.format">format</a></li><li><a href="#request_edit.getAssists">getAssists</a></li><li><a href="#request_edit.getAvailableRefactorings">getAvailableRefactorings</a></li><li><a href="#request_edit.getFixes">getFixes</a></li><li><a href="#request_edit.getRefactoring">getRefactoring</a></li><li><a href="#request_edit.sortMembers">sortMembers</a></li><li><a href="#request_edit.organizeDirectives">organizeDirectives</a></li></ul></div><h4>execution (<a href="#domain_execution">↑</a>)</h4><div class="subindex"><h5>Requests</h5><ul><li><a href="#request_execution.createContext">createContext</a></li><li><a href="#request_execution.deleteContext">deleteContext</a></li><li><a href="#request_execution.mapUri">mapUri</a></li><li><a href="#request_execution.setSubscriptions">setSubscriptions</a></li></ul><h5>Notifications</h5><div class="subindex"><ul><li><a href="#notification_execution.launchData">launchData</a></li></ul></div></div><h3>Types (<a href="#types">↑</a>)</h3><div class="subindex"><ul><li><a href="#type_AddContentOverlay">AddContentOverlay</a></li><li><a href="#type_AnalysisError">AnalysisError</a></li><li><a href="#type_AnalysisErrorFixes">AnalysisErrorFixes</a></li><li><a href="#type_AnalysisErrorSeverity">AnalysisErrorSeverity</a></li><li><a href="#type_AnalysisErrorType">AnalysisErrorType</a></li><li><a href="#type_AnalysisOptions">AnalysisOptions</a></li><li><a href="#type_AnalysisService">AnalysisService</a></li><li><a href="#type_AnalysisStatus">AnalysisStatus</a></li><li><a href="#type_ChangeContentOverlay">ChangeContentOverlay</a></li><li><a href="#type_CompletionId">CompletionId</a></li><li><a href="#type_CompletionSuggestion">CompletionSuggestion</a></li><li><a href="#type_CompletionSuggestionKind">CompletionSuggestionKind</a></li><li><a href="#type_Element">Element</a></li><li><a href="#type_ElementKind">ElementKind</a></li><li><a href="#type_ExecutableFile">ExecutableFile</a></li><li><a href="#type_ExecutableKind">ExecutableKind</a></li><li><a href="#type_ExecutionContextId">ExecutionContextId</a></li><li><a href="#type_ExecutionService">ExecutionService</a></li><li><a href="#type_FileKind">FileKind</a></li><li><a href="#type_FilePath">FilePath</a></li><li><a href="#type_FoldingKind">FoldingKind</a></li><li><a href="#type_FoldingRegion">FoldingRegion</a></li><li><a href="#type_GeneralAnalysisService">GeneralAnalysisService</a></li><li><a href="#type_HighlightRegion">HighlightRegion</a></li><li><a href="#type_HighlightRegionType">HighlightRegionType</a></li><li><a href="#type_HoverInformation">HoverInformation</a></li><li><a href="#type_ImplementedClass">ImplementedClass</a></li><li><a href="#type_ImplementedMember">ImplementedMember</a></li><li><a href="#type_LinkedEditGroup">LinkedEditGroup</a></li><li><a href="#type_LinkedEditSuggestion">LinkedEditSuggestion</a></li><li><a href="#type_LinkedEditSuggestionKind">LinkedEditSuggestionKind</a></li><li><a href="#type_Location">Location</a></li><li><a href="#type_NavigationRegion">NavigationRegion</a></li><li><a href="#type_NavigationTarget">NavigationTarget</a></li><li><a href="#type_Occurrences">Occurrences</a></li><li><a href="#type_Outline">Outline</a></li><li><a href="#type_Override">Override</a></li><li><a href="#type_OverriddenMember">OverriddenMember</a></li><li><a href="#type_Position">Position</a></li><li><a href="#type_PubStatus">PubStatus</a></li><li><a href="#type_RefactoringKind">RefactoringKind</a></li><li><a href="#type_RefactoringMethodParameter">RefactoringMethodParameter</a></li><li><a href="#type_RefactoringFeedback">RefactoringFeedback</a></li><li><a href="#type_RefactoringOptions">RefactoringOptions</a></li><li><a href="#type_RefactoringMethodParameterKind">RefactoringMethodParameterKind</a></li><li><a href="#type_RefactoringProblem">RefactoringProblem</a></li><li><a href="#type_RefactoringProblemSeverity">RefactoringProblemSeverity</a></li><li><a href="#type_RemoveContentOverlay">RemoveContentOverlay</a></li><li><a href="#type_RequestError">RequestError</a></li><li><a href="#type_RequestErrorCode">RequestErrorCode</a></li><li><a href="#type_SearchId">SearchId</a></li><li><a href="#type_SearchResult">SearchResult</a></li><li><a href="#type_SearchResultKind">SearchResultKind</a></li><li><a href="#type_ServerService">ServerService</a></li><li><a href="#type_SourceChange">SourceChange</a></li><li><a href="#type_SourceEdit">SourceEdit</a></li><li><a href="#type_SourceFileEdit">SourceFileEdit</a></li><li><a href="#type_TypeHierarchyItem">TypeHierarchyItem</a></li></ul></div><h3>Refactorings (<a href="#refactorings">↑</a>)</h3><div class="subindex"><ul><li><a href="#refactoring_CONVERT_GETTER_TO_METHOD">CONVERT_GETTER_TO_METHOD</a></li><li><a href="#refactoring_CONVERT_METHOD_TO_GETTER">CONVERT_METHOD_TO_GETTER</a></li><li><a href="#refactoring_EXTRACT_LOCAL_VARIABLE">EXTRACT_LOCAL_VARIABLE</a></li><li><a href="#refactoring_EXTRACT_METHOD">EXTRACT_METHOD</a></li><li><a href="#refactoring_INLINE_LOCAL_VARIABLE">INLINE_LOCAL_VARIABLE</a></li><li><a href="#refactoring_INLINE_METHOD">INLINE_METHOD</a></li><li><a href="#refactoring_MOVE_FILE">MOVE_FILE</a></li><li><a href="#refactoring_RENAME">RENAME</a></li></ul></div>
   
 
 </body></html>
\ No newline at end of file
diff --git a/pkg/analysis_server/lib/analysis/index/index_core.dart b/pkg/analysis_server/lib/analysis/index/index_core.dart
deleted file mode 100644
index 81d232d..0000000
--- a/pkg/analysis_server/lib/analysis/index/index_core.dart
+++ /dev/null
@@ -1,274 +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.
-
-library analysis_server.analysis.index.index_core;
-
-import 'dart:async';
-import 'dart:collection';
-
-import 'package:analysis_server/src/services/index/index.dart';
-import 'package:analyzer/src/generated/engine.dart';
-import 'package:analyzer/src/generated/source.dart';
-
-/**
- * An object that can have a [Relationship] with various [Location]s in a code
- * base. The object is abstractly represented by a [kind] and an [offset] within
- * a [source].
- *
- * Clients must ensure that two distinct objects in the same source cannot have
- * the same kind and offset. Failure to do so will make it impossible for
- * clients to identify the model element corresponding to the indexable object.
- *
- * Clients are expected to subtype this class when implementing plugins.
- */
-abstract class IndexableObject {
-  /**
-   * Return the kind of this object.
-   */
-  IndexableObjectKind get kind;
-
-  /**
-   * Return the length of the indexable object within its source.
-   */
-  int get length;
-
-  /**
-   * Return the name of this element.
-   */
-  // TODO(brianwilkerson) Remove the need for this getter.
-  String get name;
-
-  /**
-   * Return the offset of the indexable object within its source.
-   */
-  int get offset;
-
-  /**
-   * Return the source containing the indexable object.
-   */
-  Source get source;
-}
-
-/**
- * The kind associated with an [IndexableObject].
- *
- * Clients are expected to implement this class when implementing plugins.
- */
-abstract class IndexableObjectKind {
-  /**
-   * The next available index for a newly created kind of indexable object.
-   */
-  static int _nextIndex = 0;
-
-  /**
-   * A table mapping indexes to object kinds.
-   */
-  static Map<int, IndexableObjectKind> _registry =
-      new HashMap<int, IndexableObjectKind>();
-
-  /**
-   * Return the next available index for a newly created kind of indexable
-   * object.
-   */
-  static int get nextIndex => _nextIndex++;
-
-  /**
-   * Return the unique index for this kind of indexable object. Implementations
-   * should invoke [nextIndex] to allocate an index that cannot be used by any
-   * other object kind.
-   */
-  int get index;
-
-  /**
-   * Return the indexable object of this kind that exists in the given
-   * [context], in the source with the given [filePath], and at the given
-   * [offset].
-   */
-  IndexableObject decode(AnalysisContext context, String filePath, int offset);
-
-  /**
-   * Return the object kind with the given [index].
-   */
-  static IndexableObjectKind getKind(int index) {
-    return _registry[index];
-  }
-
-  /**
-   * Register the given object [kind] so that it can be found by it's unique
-   * index. The index of the [kind] must not be changed after it is passed to
-   * this method.
-   */
-  static void register(IndexableObjectKind kind) {
-    int index = kind.index;
-    if (_registry.containsKey(index)) {
-      throw new ArgumentError('duplicate index for kind: $index');
-    }
-    _registry[index] = kind;
-  }
-}
-
-/**
- * An object used to add relationships to the index.
- *
- * Clients are expected to subtype this class when implementing plugins.
- */
-abstract class IndexContributor {
-  /**
-   * Contribute relationships to the given index [store] as a result of
-   * analyzing the given [source] in the given [context].
-   */
-  void contributeTo(IndexStore store, AnalysisContext context, Source source);
-}
-
-// A sketch of what the driver routine might look like:
-//
-//void buildIndexForSource(AnalysisContext context, Source source) {
-//  IndexStoreImpl store;
-//  store.aboutToIndex(context, source);
-//  try {
-//    for (IndexContributor contributor in contributors) {
-//      contributor.contributeTo(store, context, source);
-//    }
-//  } finally {
-//    store.doneIndexing();
-//  }
-//}
-
-/**
- * An object that stores information about the relationships between locations
- * in a code base.
- *
- * Clients are not expected to subtype this class.
- */
-abstract class IndexStore {
-  /**
-   * Remove all of the information from the index.
-   */
-  void clear();
-
-  /**
-   * Return a future that completes with the locations that have the given
-   * [relationship] with the given [indexable] object.
-   *
-   * For example, if the [indexable] object represents a function and the
-   * relationship is the `is-invoked-by` relationship, then the returned
-   * locations will be all of the places where the function is invoked.
-   */
-  Future<List<Location>> getRelationships(
-      IndexableObject indexable, Relationship relationship);
-
-  /**
-   * Record that the given [indexable] object and [location] have the given
-   * [relationship].
-   *
-   * For example, if the [relationship] is the `is-invoked-by` relationship,
-   * then the [indexable] object would be the function being invoked and
-   * [location] would be the point at which it is invoked. Each indexable object
-   * can have the same relationship with multiple locations. In other words, if
-   * the following code were executed
-   *
-   *     recordRelationship(indexable, isReferencedBy, location1);
-   *     recordRelationship(indexable, isReferencedBy, location2);
-   *
-   * (where `location1 != location2`) then both relationships would be
-   * maintained in the index and the result of executing
-   *
-   *     getRelationship(indexable, isReferencedBy);
-   *
-   * would be a list containing both `location1` and `location2`.
-   */
-  void recordRelationship(
-      IndexableObject indexable, Relationship relationship, Location location);
-
-  /**
-   * Remove from the index all of the information associated with the given
-   * [context].
-   *
-   * This method should be invoked when the [context] is disposed.
-   */
-  void removeContext(AnalysisContext context);
-
-  /**
-   * Remove from the index all of the information associated with indexable
-   * objects or locations in the given [source]. This includes relationships
-   * between an indexable object in [source] and any other locations, as well as
-   * relationships between any other indexable objects and locations within
-   * the [source].
-   *
-   * This method should be invoked when [source] is no longer part of the given
-   * [context].
-   */
-  void removeSource(AnalysisContext context, Source source);
-
-  /**
-   * Remove from the index all of the information associated with indexable
-   * objects or locations in the given sources. This includes relationships
-   * between an indexable object in the given sources and any other locations,
-   * as well as relationships between any other indexable objects and a location
-   * within the given sources.
-   *
-   * This method should be invoked when the sources described by the given
-   * [container] are no longer part of the given [context].
-   */
-  void removeSources(AnalysisContext context, SourceContainer container);
-}
-
-/**
- * Instances of the class [Location] represent a location related to an
- * indexable object.
- *
- * The location is expressed as an offset and length, but the offset is relative
- * to the source containing the indexable object rather than the start of the
- * indexable object within that source.
- *
- * Clients are not expected to subtype this class.
- */
-abstract class Location {
-  /**
-   * An empty list of locations.
-   */
-  static const List<Location> EMPTY_LIST = const <Location>[];
-
-  /**
-   * Return the indexable object containing this location.
-   */
-  IndexableObject get indexable;
-
-  /**
-   * Return `true` if this location is a qualified reference.
-   */
-  bool get isQualified;
-
-  /**
-   * Return `true` if this location is a resolved reference.
-   */
-  bool get isResolved;
-
-  /**
-   * Return the length of this location.
-   */
-  int get length;
-
-  /**
-   * Return the offset of this location within the source containing the
-   * indexable object.
-   */
-  int get offset;
-}
-
-/**
- * A relationship between an indexable object and a location. Relationships are
- * identified by a globally unique identifier.
- *
- * Clients are not expected to subtype this class.
- */
-abstract class Relationship {
-  /**
-   * Return a relationship that has the given [identifier]. If the relationship
-   * has already been created, then it will be returned, otherwise a new
-   * relationship will be created
-   */
-  factory Relationship(String identifier) =>
-      RelationshipImpl.getRelationship(identifier);
-}
diff --git a/pkg/analysis_server/lib/analysis/index/index_dart.dart b/pkg/analysis_server/lib/analysis/index/index_dart.dart
deleted file mode 100644
index ed1869f..0000000
--- a/pkg/analysis_server/lib/analysis/index/index_dart.dart
+++ /dev/null
@@ -1,41 +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.
-
-library analysis_server.analysis.index.index_dart;
-
-import 'package:analysis_server/analysis/index/index_core.dart';
-import 'package:analyzer/src/generated/ast.dart';
-import 'package:analyzer/src/generated/engine.dart';
-import 'package:analyzer/src/generated/source.dart';
-
-/**
- * An [IndexContributor] that can be used to contribute relationships for Dart
- * files.
- *
- * Clients are expected to subtype this class when implementing plugins.
- */
-abstract class DartIndexContributor extends IndexContributor {
-  @override
-  void contributeTo(IndexStore store, AnalysisContext context, Source source) {
-    if (!AnalysisEngine.isDartFileName(source.fullName)) {
-      return;
-    }
-    List<Source> libraries = context.getLibrariesContaining(source);
-    if (libraries.isEmpty) {
-      return;
-    }
-    libraries.forEach((Source library) {
-      CompilationUnit unit = context.resolveCompilationUnit2(source, library);
-      if (unit != null) {
-        internalContributeTo(store, unit);
-      }
-    });
-  }
-
-  /**
-   * Contribute relationships to the given index [store] based on the given
-   * fully resolved compilation[unit].
-   */
-  void internalContributeTo(IndexStore store, CompilationUnit unit);
-}
diff --git a/pkg/analysis_server/lib/completion/completion_core.dart b/pkg/analysis_server/lib/completion/completion_core.dart
deleted file mode 100644
index 39d6a83..0000000
--- a/pkg/analysis_server/lib/completion/completion_core.dart
+++ /dev/null
@@ -1,107 +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.
-
-library analysis_server.completion.completion_core;
-
-import 'package:analysis_server/src/protocol.dart';
-import 'package:analyzer/file_system/file_system.dart';
-import 'package:analyzer/src/generated/engine.dart';
-import 'package:analyzer/src/generated/source.dart';
-
-/**
- * An object used to produce completions for a specific error. Completion
- * contributors are long-lived objects and must not retain any state between
- * invocations of [computeSuggestions].
- *
- * Clients are expected to subtype this class when implementing plugins.
- */
-abstract class CompletionContributor {
-  /**
-   * Compute a list of completion suggestions based on the given completion
-   * [request] and return a result that includes those suggestions. This method
-   * is called after specific phases of analysis until the contributor indicates
-   * computation is complete by setting [CompletionResult.isLast] to `true`.
-   */
-  CompletionResult computeSuggestions(CompletionRequest request);
-}
-
-/**
- * The information about a requested list of completions.
- *
- * Clients are not expected to subtype this class.
- */
-abstract class CompletionRequest {
-  /**
-   * Return the results that were returned the last time the contributor was
-   * asked for results, or `null` if this is the first request for results at
-   * this location.
-   */
-  //CompletionResult get previousResults;
-
-  /**
-   * Return the analysis context in which the completion is being requested.
-   */
-  AnalysisContext get context;
-
-  /**
-   * Return the offset within the source at which the completion is being
-   * requested.
-   */
-  int get offset;
-
-  /**
-   * Return the resource provider associated with this request.
-   */
-  ResourceProvider get resourceProvider;
-
-  /**
-   * Return the source in which the completion is being requested.
-   */
-  Source get source;
-}
-
-/**
- * The result of computing suggestions for code completion.
- *
- * Clients are expected to subtype this class when implementing plugins.
- */
-abstract class CompletionResult {
-  /**
-   * Return `true` if this result contains suggestions that were not in the
-   * previously returned completion results. This should also be `true` if this
-   * is the first result produced for a given location.
-   */
-  bool get hasNewSuggestions;
-
-  /**
-   * Return `true` if the contributor has contributed all possible completion
-   * suggestions, or `false` if the contributor should be consulted again after
-   * more analysis has been completed.
-   */
-  bool get isLast;
-
-  /**
-   * Return the length of the text to be replaced. This will be zero (0) if the
-   * suggestion is to be inserted, otherwise it will be greater than zero. For
-   * example, if the remainder of the identifier containing the cursor is to be
-   * replaced when the suggestion is applied, in which case the length will be
-   * the number of characters in the existing identifier.
-   */
-  int get replacementLength;
-
-  /**
-   * Return the offset of the start of the text to be replaced. This will be
-   * different than the offset used to request the completion suggestions if
-   * there was a portion of text that needs to be replaced. For example, if a
-   * partial identifier is immediately before the original offset, in which case
-   * the replacementOffset will be the offset of the beginning of the
-   * identifier.
-   */
-  int get replacementOffset;
-
-  /**
-   * Return the list of suggestions being contributed by the contributor.
-   */
-  List<CompletionSuggestion> get suggestions;
-}
diff --git a/pkg/analysis_server/lib/completion/completion_dart.dart b/pkg/analysis_server/lib/completion/completion_dart.dart
deleted file mode 100644
index ee21567..0000000
--- a/pkg/analysis_server/lib/completion/completion_dart.dart
+++ /dev/null
@@ -1,87 +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.
-
-library analysis_server.completion.completion_dart;
-
-import 'package:analysis_server/completion/completion_core.dart';
-import 'package:analyzer/src/generated/ast.dart';
-import 'package:analyzer/src/generated/engine.dart';
-import 'package:analyzer/src/generated/source.dart';
-
-/**
- * An object used to produce completions for a specific error within a Dart
- * file. Completion contributors are long-lived objects and must not retain any
- * state between invocations of [computeSuggestions].
- *
- * Clients are expected to subtype this class when implementing plugins.
- */
-abstract class DartCompletionContributor extends CompletionContributor {
-  @override
-  CompletionResult computeSuggestions(CompletionRequest request) {
-    if (request is DartCompletionRequest) {
-      return internalComputeSuggestions(request);
-    }
-    AnalysisContext context = request.context;
-    Source source = request.source;
-    List<Source> libraries = context.getLibrariesContaining(source);
-    if (libraries.length < 1) {
-      return null;
-    }
-//    CompilationUnit unit =
-//        context.getResolvedCompilationUnit2(source, libraries[0]);
-//    bool isResolved = true;
-//    if (unit == null) {
-//      // TODO(brianwilkerson) Implement a method for getting a parsed
-//      // compilation unit without parsing the unit if it hasn't been parsed.
-//      unit = context.getParsedCompilationUnit(source);
-//      if (unit == null) {
-//        return null;
-//      }
-//      isResolved = false;
-//    }
-//    DartCompletionRequest dartRequest =
-//        new DartCompletionRequestImpl(request, unit, isResolved);
-//    return internalComputeSuggestions(dartRequest);
-    return null;
-  }
-
-  /**
-   * Compute a list of completion suggestions based on the given completion
-   * [request] and return a result that includes those suggestions. This method
-   * is called after specific phases of analysis until the contributor indicates
-   * computation is complete by setting [CompletionResult.isLast] to `true`.
-   */
-  CompletionResult internalComputeSuggestions(DartCompletionRequest request);
-}
-
-/**
- * The information about a requested list of completions within a Dart file.
- */
-abstract class DartCompletionRequest extends CompletionRequest {
-  /**
-   * Return `true` if the compilation [unit] is resolved.
-   */
-  bool get isResolved;
-
-  /**
-   * Return the compilation unit in which the completion was requested.
-   */
-  CompilationUnit get unit;
-
-  /**
-   * Cached information from a prior code completion operation.
-   */
-  //DartCompletionCache get cache;
-
-  /**
-   * Return the completion target.  This determines what part of the parse tree
-   * will receive the newly inserted text.
-   */
-  //CompletionTarget get target;
-
-  /**
-   * Information about the types of suggestions that should be included.
-   */
-  //OpType get _optype;
-}
diff --git a/pkg/analysis_server/lib/edit/assist/assist_core.dart b/pkg/analysis_server/lib/edit/assist/assist_core.dart
deleted file mode 100644
index 537791c..0000000
--- a/pkg/analysis_server/lib/edit/assist/assist_core.dart
+++ /dev/null
@@ -1,99 +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.
-
-library analysis_server.edit.assist.assist_core;
-
-import 'package:analysis_server/src/protocol.dart' show SourceChange;
-import 'package:analyzer/src/generated/engine.dart';
-import 'package:analyzer/src/generated/source.dart';
-
-/**
- * A description of a single proposed assist.
- *
- * Clients are not expected to subtype this class.
- */
-class Assist {
-  /**
-   * An empty list of assists.
-   */
-  static const List<Assist> EMPTY_LIST = const <Assist>[];
-
-  /**
-   * A comparator that can be used to sort assists by their relevance. The most
-   * relevant assists will be sorted before assists with a lower relevance.
-   */
-  static final Comparator<Assist> SORT_BY_RELEVANCE = (Assist firstAssist,
-          Assist secondAssist) =>
-      firstAssist.kind.relevance - secondAssist.kind.relevance;
-
-  /**
-   * A description of the assist being proposed.
-   */
-  final AssistKind kind;
-
-  /**
-   * The change to be made in order to apply the assist.
-   */
-  final SourceChange change;
-
-  /**
-   * Initialize a newly created assist to have the given [kind] and [change].
-   */
-  Assist(this.kind, this.change);
-
-  @override
-  String toString() {
-    return 'Assist(kind=$kind, change=$change)';
-  }
-}
-
-/**
- * An object used to produce assists for a specific location.
- *
- * Clients are expected to subtype this class when implementing plugins.
- */
-abstract class AssistContributor {
-  /**
-   * Return a list of assists for a location in the given [source]. The location
-   * is specified by the [offset] and [length] of the selected region. The
-   * [context] can be used to get additional information that is useful for
-   * computing assists.
-   */
-  List<Assist> computeAssists(
-      AnalysisContext context, Source source, int offset, int length);
-}
-
-/**
- * A description of a class of assists. Instances are intended to hold the
- * information that is common across a number of assists and to be shared by
- * those assists.
- *
- * Clients are not expected to subtype this class.
- */
-class AssistKind {
-  /**
-   * The name of this kind of assist, used for debugging.
-   */
-  final String name;
-
-  /**
-   * The relevance of this kind of assist for the kind of error being addressed.
-   */
-  final int relevance;
-
-  /**
-   * A human-readable description of the changes that will be applied by this
-   * kind of assist.
-   */
-  final String message;
-
-  /**
-   * Initialize a newly created kind of assist to have the given [name],
-   * [relevance] and [message].
-   */
-  const AssistKind(this.name, this.relevance, this.message);
-
-  @override
-  String toString() => name;
-}
diff --git a/pkg/analysis_server/lib/edit/assist/assist_dart.dart b/pkg/analysis_server/lib/edit/assist/assist_dart.dart
deleted file mode 100644
index ec6718c..0000000
--- a/pkg/analysis_server/lib/edit/assist/assist_dart.dart
+++ /dev/null
@@ -1,45 +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.
-
-library analysis_server.edit.assist.assist_dart;
-
-import 'package:analysis_server/edit/assist/assist_core.dart';
-import 'package:analyzer/src/generated/ast.dart';
-import 'package:analyzer/src/generated/engine.dart';
-import 'package:analyzer/src/generated/source.dart';
-
-/**
- * An [AssistContributor] that can be used to contribute assists for Dart
- * files.
- *
- * Clients are expected to subtype this class when implementing plugins.
- */
-abstract class DartAssistContributor extends AssistContributor {
-  @override
-  List<Assist> computeAssists(
-      AnalysisContext context, Source source, int offset, int length) {
-    if (!AnalysisEngine.isDartFileName(source.fullName)) {
-      return Assist.EMPTY_LIST;
-    }
-    List<Source> libraries = context.getLibrariesContaining(source);
-    if (libraries.isEmpty) {
-      return Assist.EMPTY_LIST;
-    }
-    CompilationUnit unit =
-        context.resolveCompilationUnit2(source, libraries[0]);
-    if (unit == null) {
-      return Assist.EMPTY_LIST;
-    }
-    return internalComputeAssists(unit, offset, length);
-  }
-
-  /**
-   * Return a list of assists for a location in the given [source]. The location
-   * is specified by the [offset] and [length] of the selected region. The
-   * [context] can be used to get additional information that is useful for
-   * computing assists.
-   */
-  List<Assist> internalComputeAssists(
-      CompilationUnit unit, int offset, int length);
-}
diff --git a/pkg/analysis_server/lib/edit/fix/fix_core.dart b/pkg/analysis_server/lib/edit/fix/fix_core.dart
deleted file mode 100644
index f38d59a..0000000
--- a/pkg/analysis_server/lib/edit/fix/fix_core.dart
+++ /dev/null
@@ -1,103 +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.
-
-library analysis_server.edit.fix.fix_core;
-
-import 'package:analysis_server/src/protocol.dart' show SourceChange;
-import 'package:analyzer/file_system/file_system.dart';
-import 'package:analyzer/src/generated/engine.dart';
-import 'package:analyzer/src/generated/error.dart';
-
-/**
- * A description of a single proposed fix for some problem.
- *
- * Clients are not expected to subtype this class.
- */
-class Fix {
-  /**
-   * An empty list of fixes.
-   */
-  static const List<Fix> EMPTY_LIST = const <Fix>[];
-
-  /**
-   * A comparator that can be used to sort fixes by their relevance. The most
-   * relevant fixes will be sorted before fixes with a lower relevance.
-   */
-  static final Comparator<Fix> SORT_BY_RELEVANCE = (Fix firstFix,
-          Fix secondFix) =>
-      firstFix.kind.relevance - secondFix.kind.relevance;
-
-  /**
-   * A description of the fix being proposed.
-   */
-  final FixKind kind;
-
-  /**
-   * The change to be made in order to apply the fix.
-   */
-  final SourceChange change;
-
-  /**
-   * Initialize a newly created fix to have the given [kind] and [change].
-   */
-  Fix(this.kind, this.change);
-
-  @override
-  String toString() {
-    return 'Fix(kind=$kind, change=$change)';
-  }
-}
-
-/**
- * An object used to produce fixes for a specific error. Fix contributors are
- * long-lived objects and must not retain any state between invocations of
- * [computeFixes].
- *
- * Clients are expected to subtype this class when implementing plugins.
- */
-abstract class FixContributor {
-  /**
-   * Return a list of fixes for the given [error]. The error was reported
-   * after it's source was analyzed in the given [context].
-   */
-  List<Fix> computeFixes(ResourceProvider resourceProvider,
-      AnalysisContext context, AnalysisError error);
-}
-
-/**
- * A description of a class of fixes. Instances are intended to hold the
- * information that is common across a number of fixes and to be shared by those
- * fixes. For example, if an unnecessary cast is found then one of the suggested
- * fixes will be to remove the cast. If there are multiple unnecessary casts in
- * a single file, then there will be multiple fixes, one per occurance, but they
- * will all share the same kind.
- *
- * Clients are not expected to subtype this class.
- */
-class FixKind {
-  /**
-   * The name of this kind of fix, used for debugging.
-   */
-  final String name;
-
-  /**
-   * The relevance of this kind of fix for the kind of error being addressed.
-   */
-  final int relevance;
-
-  /**
-   * A human-readable description of the changes that will be applied by this
-   * kind of fix.
-   */
-  final String message;
-
-  /**
-   * Initialize a newly created kind of fix to have the given [name],
-   * [relevance] and [message].
-   */
-  const FixKind(this.name, this.relevance, this.message);
-
-  @override
-  String toString() => name;
-}
diff --git a/pkg/analysis_server/lib/edit/fix/fix_dart.dart b/pkg/analysis_server/lib/edit/fix/fix_dart.dart
deleted file mode 100644
index c009e68..0000000
--- a/pkg/analysis_server/lib/edit/fix/fix_dart.dart
+++ /dev/null
@@ -1,46 +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.
-
-library analysis_server.edit.fix.fix_dart;
-
-import 'package:analysis_server/edit/fix/fix_core.dart';
-import 'package:analyzer/file_system/file_system.dart';
-import 'package:analyzer/src/generated/ast.dart';
-import 'package:analyzer/src/generated/engine.dart';
-import 'package:analyzer/src/generated/error.dart';
-import 'package:analyzer/src/generated/source.dart';
-
-/**
- * A [FixContributor] that can be used to contribute fixes for errors in Dart
- * files.
- *
- * Clients are expected to subtype this class when implementing plugins.
- */
-abstract class DartFixContributor extends FixContributor {
-  @override
-  List<Fix> computeFixes(ResourceProvider resourceProvider,
-      AnalysisContext context, AnalysisError error) {
-    Source source = error.source;
-    if (!AnalysisEngine.isDartFileName(source.fullName)) {
-      return Fix.EMPTY_LIST;
-    }
-    List<Source> libraries = context.getLibrariesContaining(source);
-    if (libraries.isEmpty) {
-      return Fix.EMPTY_LIST;
-    }
-    CompilationUnit unit =
-        context.resolveCompilationUnit2(source, libraries[0]);
-    if (unit == null) {
-      return Fix.EMPTY_LIST;
-    }
-    return internalComputeFixes(resourceProvider, unit, error);
-  }
-
-  /**
-   * Return a list of fixes for the given [error]. The error was reported
-   * against the given compilation [unit].
-   */
-  List<Fix> internalComputeFixes(ResourceProvider resourceProvider,
-      CompilationUnit unit, AnalysisError error);
-}
diff --git a/pkg/analysis_server/lib/plugin/analysis/analysis_domain.dart b/pkg/analysis_server/lib/plugin/analysis/analysis_domain.dart
new file mode 100644
index 0000000..821a81e
--- /dev/null
+++ b/pkg/analysis_server/lib/plugin/analysis/analysis_domain.dart
@@ -0,0 +1,80 @@
+// 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.
+
+/**
+ * Support for client code that interacts with the analysis domain of an
+ * analysis server.
+ *
+ * Plugins can gain access to the request handler that implements the analysis
+ * domain in order to extend the functionality of that domain. The class
+ * [AnalysisDomain] defines the API of the analysis domain that plugins can use.
+ *
+ * If a plugin is interested in gaining access to the analysis domain, it should
+ * register a function by including code like the following in the plugin's
+ * registerExtensions method:
+ *
+ *     AnalysisDomain analysisDomain;
+ *
+ *     @override
+ *     void registerExtensions(RegisterExtension registerExtension) {
+ *       ...
+ *       registerExtension(
+ *           SET_ANALYSIS_DOMAIN_EXTENSION_POINT_ID,
+ *           (AnalysisDomain domain) => analysisDomain = domain);
+ *       ...
+ *     }
+ */
+library analysis_server.plugin.analysis.analysis_domain;
+
+import 'dart:async';
+
+import 'package:analysis_server/plugin/protocol/protocol.dart'
+    show AnalysisService;
+import 'package:analysis_server/src/plugin/server_plugin.dart';
+import 'package:analyzer/src/generated/engine.dart'
+    show AnalysisContext, ComputedResult;
+import 'package:analyzer/src/generated/source.dart' show Source;
+import 'package:analyzer/task/model.dart' show ResultDescriptor;
+import 'package:plugin/plugin.dart';
+
+/**
+ * The identifier of the extension point that allows plugins to get access to an
+ * [AnalysisDomain]. The object used as an extension must be a
+ * [SetAnalysisDomain].
+ */
+final String SET_ANALYSIS_DOMAIN_EXTENSION_POINT_ID = Plugin.join(
+    ServerPlugin.UNIQUE_IDENTIFIER,
+    ServerPlugin.SET_ANALISYS_DOMAIN_EXTENSION_POINT);
+
+/**
+ * A function that is invoked after the analysis domain has been created and is
+ * initialized.
+ */
+typedef void SetAnalysisDomain(AnalysisDomain domain);
+
+/**
+ * An object that gives plugins access to the analysis domain of the analysis
+ * server.
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+abstract class AnalysisDomain {
+  /**
+   * Return the stream that is notified when a new value for the given
+   * [result] is computed.
+   *
+   * This method should be used by plugins that need to perform some additional
+   * processing after analysis has completed. One example would be a plugin that
+   * needed to send a notification to the client because some data was now
+   * invalidated.
+   */
+  Stream<ComputedResult> onResultComputed(ResultDescriptor result);
+
+  /**
+   * Schedule sending the given [service] notifications for the given [source]
+   * in the given [context].
+   */
+  void scheduleNotification(
+      AnalysisContext context, Source source, AnalysisService service);
+}
diff --git a/pkg/analysis_server/lib/plugin/analysis/analyzed_files.dart b/pkg/analysis_server/lib/plugin/analysis/analyzed_files.dart
new file mode 100644
index 0000000..cf728ae
--- /dev/null
+++ b/pkg/analysis_server/lib/plugin/analysis/analyzed_files.dart
@@ -0,0 +1,40 @@
+// 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.
+
+/**
+ * Support for client code that extends the set of files being analyzed by the
+ * analysis server.
+ *
+ * Plugins can contribute a list of file patterns. Any file whose path matches
+ * one or more of the contributed patterns will be analyzed. The file patterns
+ * are interpreted as glob patterns as defined by the 'glob' package.
+ *
+ * If a plugin is interested in analyzing a certain kind of file, it needs to
+ * ensure that files of that kind will be analyzed. It should register a list of
+ * file patterns by including code like the following in the plugin's
+ * registerExtensions method:
+ *
+ *     @override
+ *     void registerExtensions(RegisterExtension registerExtension) {
+ *       ...
+ *       registerExtension(
+ *           ANALYZED_FILE_PATTERNS_EXTENSION_POINT_ID,
+ *           ['*.yaml']);
+ *       ...
+ *     }
+ */
+library analysis_server.plugin.analysis.analyzed_files;
+
+import 'package:analysis_server/src/plugin/server_plugin.dart';
+import 'package:plugin/plugin.dart';
+
+/**
+ * The identifier of the extension point that allows plugins to cause certain
+ * kinds of files to be analyzed. The object used as an extension must be a list
+ * of strings. The strings are interpreted as glob patterns as defined by the
+ * 'glob' package.
+ */
+final String ANALYZED_FILE_PATTERNS_EXTENSION_POINT_ID = Plugin.join(
+    ServerPlugin.UNIQUE_IDENTIFIER,
+    ServerPlugin.ANALYZED_FILE_PATTERNS_EXTENSION_POINT);
diff --git a/pkg/analysis_server/lib/plugin/analysis/navigation/navigation.dart b/pkg/analysis_server/lib/plugin/analysis/navigation/navigation.dart
new file mode 100644
index 0000000..83e8377
--- /dev/null
+++ b/pkg/analysis_server/lib/plugin/analysis/navigation/navigation.dart
@@ -0,0 +1,40 @@
+// 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.
+
+/**
+ * Support for client code that extends the analysis server by adding new
+ * navigation contributors.
+ *
+ * Plugins can register navigation contributors. The registered contributors
+ * will be used to get navigation regions any time a client issues an
+ * 'analysis.getNavigation' request or the server is about to send an
+ * 'analysis.navigation' notification.
+ *
+ * If a plugin wants to add navigation regions, it should implement the class
+ * [NavigationContributor] and then register the contributor by including code
+ * like the following in the plugin's registerExtensions method:
+ *
+ *     @override
+ *     void registerExtensions(RegisterExtension registerExtension) {
+ *       ...
+ *       registerExtension(
+ *           NAVIGATION_CONTRIBUTOR_EXTENSION_POINT_ID,
+ *           new MyNavigationContributor());
+ *       ...
+ *     }
+ */
+library analysis_server.plugin.analysis.navigation.navigation;
+
+import 'package:analysis_server/plugin/analysis/navigation/navigation_core.dart';
+import 'package:analysis_server/src/plugin/server_plugin.dart';
+import 'package:plugin/plugin.dart';
+
+/**
+ * The identifier of the extension point that allows plugins to register
+ * navigation contributors. The object used as an extension must be
+ * a [NavigationContributor].
+ */
+final String NAVIGATION_CONTRIBUTOR_EXTENSION_POINT_ID = Plugin.join(
+    ServerPlugin.UNIQUE_IDENTIFIER,
+    ServerPlugin.NAVIGATION_CONTRIBUTOR_EXTENSION_POINT);
diff --git a/pkg/analysis_server/lib/plugin/analysis/navigation/navigation_core.dart b/pkg/analysis_server/lib/plugin/analysis/navigation/navigation_core.dart
new file mode 100644
index 0000000..dea288b
--- /dev/null
+++ b/pkg/analysis_server/lib/plugin/analysis/navigation/navigation_core.dart
@@ -0,0 +1,39 @@
+// 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 analysis_server.plugin.analysis.navigation.navigation_core;
+
+import 'package:analysis_server/plugin/protocol/protocol.dart'
+    show ElementKind, Location, NavigationRegion, NavigationTarget;
+import 'package:analyzer/src/generated/engine.dart' show AnalysisContext;
+import 'package:analyzer/src/generated/source.dart' show Source;
+
+/**
+ * An object that [NavigationContributor]s use to record navigation regions.
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+abstract class NavigationCollector {
+  /**
+   * Record a new navigation region with the given [offset] and [length] that
+   * should navigate to the given [targetLocation].
+   */
+  void addRegion(
+      int offset, int length, ElementKind targetKind, Location targetLocation);
+}
+
+/**
+ * An object used to produce navigation regions.
+ *
+ * Clients may implement this class when implementing plugins.
+ */
+abstract class NavigationContributor {
+  /**
+   * Contribute navigation regions for a subset of the content of the given
+   * [source] into the given [collector]. The subset is specified by the
+   * [offset] and [length]. The [context] can be used to access analysis results.
+   */
+  void computeNavigation(NavigationCollector collector, AnalysisContext context,
+      Source source, int offset, int length);
+}
diff --git a/pkg/analysis_server/lib/plugin/analysis/occurrences/occurrences.dart b/pkg/analysis_server/lib/plugin/analysis/occurrences/occurrences.dart
new file mode 100644
index 0000000..22aecf5
--- /dev/null
+++ b/pkg/analysis_server/lib/plugin/analysis/occurrences/occurrences.dart
@@ -0,0 +1,39 @@
+// 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.
+
+/**
+ * Support for client code that extends the analysis server by adding new
+ * occurrences contributors.
+ *
+ * Plugins can register occurrences contributors. The registered contributors
+ * will be used to get occurrence information any time the server is about to
+ * send an 'analysis.occurrences' notification.
+ *
+ * If a plugin wants to add occurrence information, it should implement the
+ * class [OccurrencesContributor] and then register the contributor by including
+ * code like the following in the plugin's registerExtensions method:
+ *
+ *     @override
+ *     void registerExtensions(RegisterExtension registerExtension) {
+ *       ...
+ *       registerExtension(
+ *           OCCURRENCES_CONTRIBUTOR_EXTENSION_POINT_ID,
+ *           new MyOccurrencesContributor());
+ *       ...
+ *     }
+ */
+library analysis_server.plugin.analysis.occurrences.occurrences;
+
+import 'package:analysis_server/plugin/analysis/occurrences/occurrences_core.dart';
+import 'package:analysis_server/src/plugin/server_plugin.dart';
+import 'package:plugin/plugin.dart';
+
+/**
+ * The identifier of the extension point that allows plugins to register
+ * occurrence information. The object used as an extension must be an
+ * [OccurrencesContributor].
+ */
+final String OCCURRENCES_CONTRIBUTOR_EXTENSION_POINT_ID = Plugin.join(
+    ServerPlugin.UNIQUE_IDENTIFIER,
+    ServerPlugin.OCCURRENCES_CONTRIBUTOR_EXTENSION_POINT);
diff --git a/pkg/analysis_server/lib/plugin/analysis/occurrences/occurrences_core.dart b/pkg/analysis_server/lib/plugin/analysis/occurrences/occurrences_core.dart
new file mode 100644
index 0000000..ac56afd
--- /dev/null
+++ b/pkg/analysis_server/lib/plugin/analysis/occurrences/occurrences_core.dart
@@ -0,0 +1,36 @@
+// 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 analysis_server.plugin.analysis.occurrences.occurrences_core;
+
+import 'package:analysis_server/plugin/protocol/protocol.dart'
+    show Element, Occurrences;
+import 'package:analyzer/src/generated/engine.dart' show AnalysisContext;
+import 'package:analyzer/src/generated/source.dart' show Source;
+
+/**
+ * An object that [OccurrencesContributor]s use to record occurrences into.
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+abstract class OccurrencesCollector {
+  /**
+   * Record a new element occurrences.
+   */
+  void addOccurrences(Occurrences occurrences);
+}
+
+/**
+ * An object used to produce occurrences.
+ *
+ * Clients may implement this class when implementing plugins.
+ */
+abstract class OccurrencesContributor {
+  /**
+   * Contribute occurrences into the given [collector].
+   * The [context] can be used to get analysis results.
+   */
+  void computeOccurrences(
+      OccurrencesCollector collector, AnalysisContext context, Source source);
+}
diff --git a/pkg/analysis_server/lib/plugin/analysis/resolver_provider.dart b/pkg/analysis_server/lib/plugin/analysis/resolver_provider.dart
new file mode 100644
index 0000000..ab6926c
--- /dev/null
+++ b/pkg/analysis_server/lib/plugin/analysis/resolver_provider.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.
+
+library analysis_server.plugin.analysis.resolver_provider;
+
+import 'package:analyzer/file_system/file_system.dart';
+import 'package:analyzer/src/generated/source.dart';
+
+/**
+ * A function that will return a [UriResolver] that can be used to resolve a
+ * specific kind of URI within the analysis context rooted at the given folder.
+ * This is currently being used to provide a package URI resolver that will be
+ * used by the server (see [ServerStarter.packageResolverProvider]).
+ */
+typedef UriResolver ResolverProvider(Folder folder);
diff --git a/pkg/analysis_server/lib/plugin/analyzed_files.dart b/pkg/analysis_server/lib/plugin/analyzed_files.dart
deleted file mode 100644
index 12c9214..0000000
--- a/pkg/analysis_server/lib/plugin/analyzed_files.dart
+++ /dev/null
@@ -1,32 +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.
-
-/**
- * Support for client code that extends the set of files being analyzed by the
- * analysis server.
- *
- * Plugins can register a function that takes a [File] and returns a [bool]
- * indicating whether the plugin is interested in having that file be analyzed.
- * The analysis server will invoke the contributed functions and analyze the
- * file if at least one of the functions returns `true`. (The server is not
- * required to invoke every function with every file.)
- */
-library analysis_server.plugin.analyzed_files;
-
-import 'package:analysis_server/src/plugin/server_plugin.dart';
-import 'package:analyzer/file_system/file_system.dart';
-import 'package:plugin/plugin.dart';
-
-/**
- * The identifier of the extension point that allows plugins to register
- * functions that can cause files to be analyzed. The object used as an
- * extension must be a [ShouldAnalyzeFile] function.
- */
-final String ANALYZE_FILE_EXTENSION_POINT_ID = Plugin.join(
-    ServerPlugin.UNIQUE_IDENTIFIER, ServerPlugin.ANALYZE_FILE_EXTENSION_POINT);
-
-/**
- * A function that returns `true` if the given [file] should be analyzed.
- */
-typedef bool ShouldAnalyzeFile(File file);
diff --git a/pkg/analysis_server/lib/plugin/assist.dart b/pkg/analysis_server/lib/plugin/assist.dart
deleted file mode 100644
index 393a479..0000000
--- a/pkg/analysis_server/lib/plugin/assist.dart
+++ /dev/null
@@ -1,21 +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.
-
-/**
- * Support for client code that extends the analysis server by adding new assist
- * contributors.
- */
-library analysis_server.plugin.assist;
-
-import 'package:analysis_server/edit/assist/assist_core.dart';
-import 'package:analysis_server/src/plugin/server_plugin.dart';
-import 'package:plugin/plugin.dart';
-
-/**
- * The identifier of the extension point that allows plugins to register assist
- * contributors. The object used as an extension must be an [AssistContributor].
- */
-final String ASSIST_CONTRIBUTOR_EXTENSION_POINT_ID = Plugin.join(
-    ServerPlugin.UNIQUE_IDENTIFIER,
-    ServerPlugin.ASSIST_CONTRIBUTOR_EXTENSION_POINT);
diff --git a/pkg/analysis_server/lib/plugin/completion.dart b/pkg/analysis_server/lib/plugin/completion.dart
deleted file mode 100644
index 8fd6159..0000000
--- a/pkg/analysis_server/lib/plugin/completion.dart
+++ /dev/null
@@ -1,22 +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.
-
-/**
- * Support for client code that extends the analysis server by adding new code
- * completion contributors.
- */
-library analysis_server.plugin.completion;
-
-import 'package:analysis_server/completion/completion_core.dart';
-import 'package:analysis_server/src/plugin/server_plugin.dart';
-import 'package:plugin/plugin.dart';
-
-/**
- * The identifier of the extension point that allows plugins to register code
- * completion contributors. The object used as an extension must be a
- * [CompletionContributor].
- */
-final String COMPLETION_CONTRIBUTOR_EXTENSION_POINT_ID = Plugin.join(
-    ServerPlugin.UNIQUE_IDENTIFIER,
-    ServerPlugin.COMPLETION_CONTRIBUTOR_EXTENSION_POINT);
diff --git a/pkg/analysis_server/lib/plugin/edit/assist/assist.dart b/pkg/analysis_server/lib/plugin/edit/assist/assist.dart
new file mode 100644
index 0000000..cda2ab7
--- /dev/null
+++ b/pkg/analysis_server/lib/plugin/edit/assist/assist.dart
@@ -0,0 +1,37 @@
+// 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.
+
+/**
+ * Support for client code that extends the analysis server by adding new assist
+ * contributors.
+ *
+ * Plugins can register assist contributors. The registered contributors will be
+ * used to get assists any time a client issues an 'edit.getAssists' request.
+ *
+ * If a plugin wants to add assists, it should implement the class
+ * [AssistContributor] and then register the contributor by including code like
+ * the following in the plugin's registerExtensions method:
+ *
+ *     @override
+ *     void registerExtensions(RegisterExtension registerExtension) {
+ *       ...
+ *       registerExtension(
+ *           ASSIST_CONTRIBUTOR_EXTENSION_POINT_ID,
+ *           new MyAssistContributor());
+ *       ...
+ *     }
+ */
+library analysis_server.plugin.edit.assist.assist;
+
+import 'package:analysis_server/plugin/edit/assist/assist_core.dart';
+import 'package:analysis_server/src/plugin/server_plugin.dart';
+import 'package:plugin/plugin.dart';
+
+/**
+ * The identifier of the extension point that allows plugins to register assist
+ * contributors. The object used as an extension must be an [AssistContributor].
+ */
+final String ASSIST_CONTRIBUTOR_EXTENSION_POINT_ID = Plugin.join(
+    ServerPlugin.UNIQUE_IDENTIFIER,
+    ServerPlugin.ASSIST_CONTRIBUTOR_EXTENSION_POINT);
diff --git a/pkg/analysis_server/lib/plugin/edit/assist/assist_core.dart b/pkg/analysis_server/lib/plugin/edit/assist/assist_core.dart
new file mode 100644
index 0000000..d4903e6
--- /dev/null
+++ b/pkg/analysis_server/lib/plugin/edit/assist/assist_core.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.
+
+library analysis_server.plugin.edit.assist.assist_core;
+
+import 'package:analysis_server/plugin/protocol/protocol.dart'
+    show SourceChange;
+import 'package:analyzer/src/generated/engine.dart';
+import 'package:analyzer/src/generated/source.dart';
+
+/**
+ * A description of a single proposed assist.
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class Assist {
+  /**
+   * An empty list of assists.
+   */
+  static const List<Assist> EMPTY_LIST = const <Assist>[];
+
+  /**
+   * A comparator that can be used to sort assists by their relevance. The most
+   * relevant assists will be sorted before assists with a lower relevance.
+   */
+  static final Comparator<Assist> SORT_BY_RELEVANCE = (Assist firstAssist,
+          Assist secondAssist) =>
+      firstAssist.kind.relevance - secondAssist.kind.relevance;
+
+  /**
+   * A description of the assist being proposed.
+   */
+  final AssistKind kind;
+
+  /**
+   * The change to be made in order to apply the assist.
+   */
+  final SourceChange change;
+
+  /**
+   * Initialize a newly created assist to have the given [kind] and [change].
+   */
+  Assist(this.kind, this.change);
+
+  @override
+  String toString() {
+    return 'Assist(kind=$kind, change=$change)';
+  }
+}
+
+/**
+ * An object used to produce assists for a specific location.
+ *
+ * Clients may implement this class when implementing plugins.
+ */
+abstract class AssistContributor {
+  /**
+   * Return a list of assists for a location in the given [source]. The location
+   * is specified by the [offset] and [length] of the selected region. The
+   * [context] can be used to get additional information that is useful for
+   * computing assists.
+   */
+  List<Assist> computeAssists(
+      AnalysisContext context, Source source, int offset, int length);
+}
+
+/**
+ * A description of a class of assists. Instances are intended to hold the
+ * information that is common across a number of assists and to be shared by
+ * those assists.
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class AssistKind {
+  /**
+   * The name of this kind of assist, used for debugging.
+   */
+  final String name;
+
+  /**
+   * The relevance of this kind of assist for the kind of error being addressed.
+   */
+  final int relevance;
+
+  /**
+   * A human-readable description of the changes that will be applied by this
+   * kind of assist.
+   */
+  final String message;
+
+  /**
+   * Initialize a newly created kind of assist to have the given [name],
+   * [relevance] and [message].
+   */
+  const AssistKind(this.name, this.relevance, this.message);
+
+  @override
+  String toString() => name;
+}
diff --git a/pkg/analysis_server/lib/plugin/edit/assist/assist_dart.dart b/pkg/analysis_server/lib/plugin/edit/assist/assist_dart.dart
new file mode 100644
index 0000000..ccdc123
--- /dev/null
+++ b/pkg/analysis_server/lib/plugin/edit/assist/assist_dart.dart
@@ -0,0 +1,45 @@
+// 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 analysis_server.plugin.edit.assist.assist_dart;
+
+import 'package:analysis_server/plugin/edit/assist/assist_core.dart';
+import 'package:analyzer/src/generated/ast.dart';
+import 'package:analyzer/src/generated/engine.dart';
+import 'package:analyzer/src/generated/source.dart';
+
+/**
+ * An [AssistContributor] that can be used to contribute assists for Dart
+ * files.
+ *
+ * Clients may extend this class when implementing plugins.
+ */
+abstract class DartAssistContributor implements AssistContributor {
+  @override
+  List<Assist> computeAssists(
+      AnalysisContext context, Source source, int offset, int length) {
+    if (!AnalysisEngine.isDartFileName(source.fullName)) {
+      return Assist.EMPTY_LIST;
+    }
+    List<Source> libraries = context.getLibrariesContaining(source);
+    if (libraries.isEmpty) {
+      return Assist.EMPTY_LIST;
+    }
+    CompilationUnit unit =
+        context.resolveCompilationUnit2(source, libraries[0]);
+    if (unit == null) {
+      return Assist.EMPTY_LIST;
+    }
+    return internalComputeAssists(unit, offset, length);
+  }
+
+  /**
+   * Return a list of assists for a location in the given [source]. The location
+   * is specified by the [offset] and [length] of the selected region. The
+   * [context] can be used to get additional information that is useful for
+   * computing assists.
+   */
+  List<Assist> internalComputeAssists(
+      CompilationUnit unit, int offset, int length);
+}
diff --git a/pkg/analysis_server/lib/plugin/edit/fix/fix.dart b/pkg/analysis_server/lib/plugin/edit/fix/fix.dart
new file mode 100644
index 0000000..a9f73d2
--- /dev/null
+++ b/pkg/analysis_server/lib/plugin/edit/fix/fix.dart
@@ -0,0 +1,37 @@
+// 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.
+
+/**
+ * Support for client code that extends the analysis server by adding new fix
+ * contributors.
+ *
+ * Plugins can register fix contributors. The registered contributors will be
+ * used to get fixes any time a client issues an 'edit.getFixes' request.
+ *
+ * If a plugin wants to add fixes, it should implement the class
+ * [FixContributor] and then register the contributor by including code like the
+ * following in the plugin's registerExtensions method:
+ *
+ *     @override
+ *     void registerExtensions(RegisterExtension registerExtension) {
+ *       ...
+ *       registerExtension(
+ *           FIX_CONTRIBUTOR_EXTENSION_POINT_ID,
+ *           new MyFixContributor());
+ *       ...
+ *     }
+ */
+library analysis_server.plugin.edit.fix.fix;
+
+import 'package:analysis_server/plugin/edit/fix/fix_core.dart';
+import 'package:analysis_server/src/plugin/server_plugin.dart';
+import 'package:plugin/plugin.dart';
+
+/**
+ * The identifier of the extension point that allows plugins to register fix
+ * contributors. The object used as an extension must be a [FixContributor].
+ */
+final String FIX_CONTRIBUTOR_EXTENSION_POINT_ID = Plugin.join(
+    ServerPlugin.UNIQUE_IDENTIFIER,
+    ServerPlugin.FIX_CONTRIBUTOR_EXTENSION_POINT);
diff --git a/pkg/analysis_server/lib/plugin/edit/fix/fix_core.dart b/pkg/analysis_server/lib/plugin/edit/fix/fix_core.dart
new file mode 100644
index 0000000..123fa24
--- /dev/null
+++ b/pkg/analysis_server/lib/plugin/edit/fix/fix_core.dart
@@ -0,0 +1,104 @@
+// 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 analysis_server.plugin.edit.fix.fix_core;
+
+import 'package:analysis_server/plugin/protocol/protocol.dart'
+    show SourceChange;
+import 'package:analyzer/file_system/file_system.dart';
+import 'package:analyzer/src/generated/engine.dart';
+import 'package:analyzer/src/generated/error.dart';
+
+/**
+ * A description of a single proposed fix for some problem.
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class Fix {
+  /**
+   * An empty list of fixes.
+   */
+  static const List<Fix> EMPTY_LIST = const <Fix>[];
+
+  /**
+   * A comparator that can be used to sort fixes by their relevance. The most
+   * relevant fixes will be sorted before fixes with a lower relevance.
+   */
+  static final Comparator<Fix> SORT_BY_RELEVANCE = (Fix firstFix,
+          Fix secondFix) =>
+      firstFix.kind.relevance - secondFix.kind.relevance;
+
+  /**
+   * A description of the fix being proposed.
+   */
+  final FixKind kind;
+
+  /**
+   * The change to be made in order to apply the fix.
+   */
+  final SourceChange change;
+
+  /**
+   * Initialize a newly created fix to have the given [kind] and [change].
+   */
+  Fix(this.kind, this.change);
+
+  @override
+  String toString() {
+    return 'Fix(kind=$kind, change=$change)';
+  }
+}
+
+/**
+ * An object used to produce fixes for a specific error. Fix contributors are
+ * long-lived objects and must not retain any state between invocations of
+ * [computeFixes].
+ *
+ * Clients may implement this class when implementing plugins.
+ */
+abstract class FixContributor {
+  /**
+   * Return a list of fixes for the given [error]. The error was reported
+   * after it's source was analyzed in the given [context].
+   */
+  List<Fix> computeFixes(ResourceProvider resourceProvider,
+      AnalysisContext context, AnalysisError error);
+}
+
+/**
+ * A description of a class of fixes. Instances are intended to hold the
+ * information that is common across a number of fixes and to be shared by those
+ * fixes. For example, if an unnecessary cast is found then one of the suggested
+ * fixes will be to remove the cast. If there are multiple unnecessary casts in
+ * a single file, then there will be multiple fixes, one per occurance, but they
+ * will all share the same kind.
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class FixKind {
+  /**
+   * The name of this kind of fix, used for debugging.
+   */
+  final String name;
+
+  /**
+   * The relevance of this kind of fix for the kind of error being addressed.
+   */
+  final int relevance;
+
+  /**
+   * A human-readable description of the changes that will be applied by this
+   * kind of fix.
+   */
+  final String message;
+
+  /**
+   * Initialize a newly created kind of fix to have the given [name],
+   * [relevance] and [message].
+   */
+  const FixKind(this.name, this.relevance, this.message);
+
+  @override
+  String toString() => name;
+}
diff --git a/pkg/analysis_server/lib/plugin/edit/fix/fix_dart.dart b/pkg/analysis_server/lib/plugin/edit/fix/fix_dart.dart
new file mode 100644
index 0000000..54baa7c
--- /dev/null
+++ b/pkg/analysis_server/lib/plugin/edit/fix/fix_dart.dart
@@ -0,0 +1,46 @@
+// 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 analysis_server.plugin.edit.fix.fix_dart;
+
+import 'package:analysis_server/plugin/edit/fix/fix_core.dart';
+import 'package:analyzer/file_system/file_system.dart';
+import 'package:analyzer/src/generated/ast.dart';
+import 'package:analyzer/src/generated/engine.dart';
+import 'package:analyzer/src/generated/error.dart';
+import 'package:analyzer/src/generated/source.dart';
+
+/**
+ * A [FixContributor] that can be used to contribute fixes for errors in Dart
+ * files.
+ *
+ * Clients may extend this class when implementing plugins.
+ */
+abstract class DartFixContributor implements FixContributor {
+  @override
+  List<Fix> computeFixes(ResourceProvider resourceProvider,
+      AnalysisContext context, AnalysisError error) {
+    Source source = error.source;
+    if (!AnalysisEngine.isDartFileName(source.fullName)) {
+      return Fix.EMPTY_LIST;
+    }
+    List<Source> libraries = context.getLibrariesContaining(source);
+    if (libraries.isEmpty) {
+      return Fix.EMPTY_LIST;
+    }
+    CompilationUnit unit =
+        context.resolveCompilationUnit2(source, libraries[0]);
+    if (unit == null) {
+      return Fix.EMPTY_LIST;
+    }
+    return internalComputeFixes(resourceProvider, unit, error);
+  }
+
+  /**
+   * Return a list of fixes for the given [error]. The error was reported
+   * against the given compilation [unit].
+   */
+  List<Fix> internalComputeFixes(ResourceProvider resourceProvider,
+      CompilationUnit unit, AnalysisError error);
+}
diff --git a/pkg/analysis_server/lib/plugin/edit/utilities/change_builder_core.dart b/pkg/analysis_server/lib/plugin/edit/utilities/change_builder_core.dart
new file mode 100644
index 0000000..8c35743
--- /dev/null
+++ b/pkg/analysis_server/lib/plugin/edit/utilities/change_builder_core.dart
@@ -0,0 +1,123 @@
+// 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 analysis_server.plugin.edit.utilities.change_builder_core;
+
+import 'package:analysis_server/plugin/protocol/protocol.dart';
+import 'package:analysis_server/src/utilities/change_builder_core.dart';
+import 'package:analyzer/src/generated/source.dart';
+
+/**
+ * A builder used to build a [SourceChange].
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+abstract class ChangeBuilder {
+  /**
+   * Initialize a newly created change builder.
+   */
+  factory ChangeBuilder() = ChangeBuilderImpl;
+
+  /**
+   * Return the source change that was built.
+   */
+  SourceChange get sourceChange;
+
+  /**
+   * Use the [buildFileEdit] function to create a collection of edits to the
+   * given [source]. The edits will be added to the source change that is being
+   * built. The [timeStamp] is the time at which the [source] was last modified
+   * and is used by clients to ensure that it is safe to apply the edits.
+   */
+  void addFileEdit(Source source, int timeStamp,
+      void buildFileEdit(FileEditBuilder builder));
+}
+
+/**
+ * A builder used to build a [SourceEdit] as part of a [SourceFileEdit].
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+abstract class EditBuilder {
+  /**
+   * Add a region of text that is part of the linked edit group with the given
+   * [groupName]. The [buildLinkedEdit] function is used to write the content of
+   * the region of text and to add suggestions for other possible values for
+   * that region.
+   */
+  void addLinkedEdit(
+      String groupName, void buildLinkedEdit(LinkedEditBuilder builder));
+
+  /**
+   * Add the given [string] to the content of the current edit.
+   */
+  void write(String string);
+
+  /**
+   * Add the given [string] to the content of the current edit and then add an
+   * end-of-line marker.
+   */
+  void writeln([String string]);
+}
+
+/**
+ * A builder used to build a [SourceFileEdit] within a [SourceChange].
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+abstract class FileEditBuilder {
+  /**
+   * Add an insertion of text at the given [offset]. The [offset] is relative to
+   * the original source. The [buildEdit] function is used to write the text to
+   * be inserted. This is fully equivalent to
+   *
+   *     addReplacement(offset, 0, buildEdit);
+   */
+  void addInsertion(int offset, void buildEdit(EditBuilder builder));
+
+  /**
+   * Add the region of text starting at the given [offset] and continuing for
+   * the given [length] to the linked edit group with the given [groupName].
+   * The [offset] is relative to the original source. This is typically used to
+   * include pre-existing regions of text in a group.
+   */
+  void addLinkedPosition(int offset, int length, String groupName);
+
+  /**
+   * Add a replacement of text starting at the given [offset] and continuing for
+   * the given [length]. The [offset] is relative to the original source. The
+   * [buildEdit] function is used to write the text that will replace the
+   * specified region.
+   */
+  void addReplacement(
+      int offset, int length, void buildEdit(EditBuilder builder));
+}
+
+/**
+ * A builder used to build a [LinkedEdit] region within an edit.
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+abstract class LinkedEditBuilder {
+  /**
+   * Add the given [value] as a suggestion with the given [kind].
+   */
+  void addSuggestion(LinkedEditSuggestionKind kind, String value);
+
+  /**
+   * Add each of the given [values] as a suggestion with the given [kind].
+   */
+  void addSuggestions(LinkedEditSuggestionKind kind, Iterable<String> values);
+
+  /**
+   * Add the given [string] to the content of the current edit.
+   */
+  void write(String string);
+
+  /**
+   * Add the given [string] to the content of the current edit and then add an
+   * end-of-line marker.
+   */
+  void writeln([String string]);
+}
diff --git a/pkg/analysis_server/lib/plugin/edit/utilities/change_builder_dart.dart b/pkg/analysis_server/lib/plugin/edit/utilities/change_builder_dart.dart
new file mode 100644
index 0000000..7d0e0c7
--- /dev/null
+++ b/pkg/analysis_server/lib/plugin/edit/utilities/change_builder_dart.dart
@@ -0,0 +1,156 @@
+// 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 analysis_server.plugin.edit.utilities.change_builder_dart;
+
+import 'package:analysis_server/plugin/edit/utilities/change_builder_core.dart';
+import 'package:analysis_server/src/utilities/change_builder_dart.dart';
+import 'package:analyzer/src/generated/ast.dart';
+import 'package:analyzer/src/generated/element.dart';
+import 'package:analyzer/src/generated/engine.dart';
+
+/**
+ * A [ChangeBuilder] used to build changes in Dart files.
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+abstract class DartChangeBuilder extends ChangeBuilder {
+  /**
+   * Initialize a newly created change builder.
+   */
+  factory DartChangeBuilder(AnalysisContext context) = DartChangeBuilderImpl;
+}
+
+/**
+ * An [EditBuilder] used to build edits in Dart files.
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+abstract class DartEditBuilder extends EditBuilder {
+  /**
+   * The group-id used for the name of a declaration.
+   */
+  static const String NAME_GROUP_ID = 'NAME';
+
+  /**
+   * The group-id used for the return type of a function, getter or method.
+   */
+  static const String RETURN_TYPE_GROUP_ID = 'RETURN_TYPE';
+
+  /**
+   * The group-id used for the name of the superclass in a class declaration.
+   */
+  static const String SUPERCLASS_GROUP_ID = 'SUPERCLASS';
+
+  /**
+   * Write the code for a declaration of a class with the given [name]. If a
+   * list of [interfaces] is provided, then the class will implement those
+   * interfaces. If [isAbstract] is `true`, then the class will be abstract. If
+   * a [memberWriter] is provided, then it will be invoked to allow members to
+   * be generated. (The members will automatically be preceeded and followed by
+   * end-of-line markers.) If a list of [mixins] is provided, then the class
+   * will mix in those classes. If a [nameGroupName] is provided, then the name
+   * of the class will be included in the linked edit group with that name. If a
+   * [superclass] is given then it will be the superclass of the class. (If a
+   * list of [mixins] is provided but no [superclass] is given then the class
+   * will extend `Object`.)
+   */
+  void writeClassDeclaration(String name,
+      {Iterable<DartType> interfaces,
+      bool isAbstract: false,
+      void memberWriter(),
+      Iterable<DartType> mixins,
+      String nameGroupName,
+      DartType superclass});
+
+  /**
+   * Write the code for a declaration of a field with the given [name]. If an
+   * [initializerWriter] is provided, it will be invoked to write the content of
+   * the initializer. (The equal sign separating the field name from the
+   * initializer expression will automatically be written.) If [isConst] is
+   * `true`, then the declaration will be preceeded by the `const` keyword. If
+   * [isFinal] is `true`, then the declaration will be preceeded by the `final`
+   * keyword. (If both [isConst] and [isFinal] are `true`, then only the `const`
+   * keyword will be written.) If [isStatic] is `true`, then the declaration
+   * will be preceeded by the `static` keyword. If a [nameGroupName] is
+   * provided, the name of the field will be included in the linked edit group
+   * with that name. If a [type] is provided, then it will be used as the type
+   * of the field. (The keyword `var` will be provided automatically when
+   * required.) If a [typeGroupName] is provided, then if a type was written
+   * it will be in the linked edit group with that name.
+   */
+  void writeFieldDeclaration(String name,
+      {void initializerWriter(),
+      bool isConst: false,
+      bool isFinal: false,
+      bool isStatic: false,
+      String nameGroupName,
+      DartType type,
+      String typeGroupName});
+
+  /**
+   * Write the code for a declaration of a getter with the given [name]. If a
+   * [bodyWriter] is provided, it will be invoked to write the body of the
+   * getter. (The space between the name and the body will automatically be
+   * written.) If [isStatic] is `true`, then the declaration will be preceeded
+   * by the `static` keyword. If a [nameGroupName] is provided, the name of the
+   * getter will be included in the linked edit group with that name. If a
+   * [returnType] is provided, then it will be used as the return type of the
+   * getter. If a [returnTypeGroupName] is provided, then if a return type was
+   * written it will be in the linked edit group with that name.
+   */
+  void writeGetterDeclaration(String name,
+      {void bodyWriter(),
+      bool isStatic: false,
+      String nameGroupName,
+      DartType returnType,
+      String returnTypeGroupName});
+
+  /**
+   * Append a placeholder for an override of the specified inherited [member].
+   */
+  void writeOverrideOfInheritedMember(ExecutableElement member);
+
+  /**
+   * Write the code for a list of [parameters], including the surrounding
+   * parentheses.
+   */
+  void writeParameters(Iterable<ParameterElement> parameters);
+
+  /**
+   * Write the code for a list of parameters that would match the given list of
+   * [arguments], including the surrounding parentheses.
+   */
+  void writeParametersMatchingArguments(ArgumentList arguments);
+
+  /**
+   * Write the code for a single parameter with the given [type] and [name].
+   * The [type] can be `null` if no type is to be specified for the parameter.
+   */
+  void writeParameterSource(DartType type, String name);
+
+  /**
+   * Write the code for a type annotation for the given [type]. If the [type] is
+   * either `null` or represents the type 'dynamic', then the behavior depends
+   * on whether a type is [required]. If [required] is `true`, then 'var' will
+   * be written; otherwise, nothing is written.
+   *
+   * If the [groupName] is not `null`, then the name of the type (including type
+   * parameters) will be included as a region in the linked edit group with that
+   * name. If the [groupName] is not `null` and [addSupertypeProposals] is
+   * `true`, then all of the supertypes of the [type] will be added as
+   * suggestions for alternatives to the type name.
+   */
+  bool writeType(DartType type,
+      {bool addSupertypeProposals: false,
+      String groupName,
+      bool required: false});
+}
+
+/**
+ * A [FileEditBuilder] used to build edits for Dart files.
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+abstract class DartFileEditBuilder extends FileEditBuilder {}
diff --git a/pkg/analysis_server/lib/plugin/fix.dart b/pkg/analysis_server/lib/plugin/fix.dart
deleted file mode 100644
index 45f69a6..0000000
--- a/pkg/analysis_server/lib/plugin/fix.dart
+++ /dev/null
@@ -1,21 +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.
-
-/**
- * Support for client code that extends the analysis server by adding new fix
- * contributors.
- */
-library analysis_server.plugin.fix;
-
-import 'package:analysis_server/edit/fix/fix_core.dart';
-import 'package:analysis_server/src/plugin/server_plugin.dart';
-import 'package:plugin/plugin.dart';
-
-/**
- * The identifier of the extension point that allows plugins to register fix
- * contributors. The object used as an extension must be a [FixContributor].
- */
-final String FIX_CONTRIBUTOR_EXTENSION_POINT_ID = Plugin.join(
-    ServerPlugin.UNIQUE_IDENTIFIER,
-    ServerPlugin.FIX_CONTRIBUTOR_EXTENSION_POINT);
diff --git a/pkg/analysis_server/lib/plugin/index.dart b/pkg/analysis_server/lib/plugin/index.dart
deleted file mode 100644
index 096c28d..0000000
--- a/pkg/analysis_server/lib/plugin/index.dart
+++ /dev/null
@@ -1,21 +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.
-
-/**
- * Support for client code that extends the analysis server by adding new index
- * contributors.
- */
-library analysis_server.plugin.index;
-
-import 'package:analysis_server/analysis/index/index_core.dart';
-import 'package:analysis_server/src/plugin/server_plugin.dart';
-import 'package:plugin/plugin.dart';
-
-/**
- * The identifier of the extension point that allows plugins to register index
- * contributors. The object used as an extension must be an [IndexContributor].
- */
-final String INDEX_CONTRIBUTOR_EXTENSION_POINT_ID = Plugin.join(
-    ServerPlugin.UNIQUE_IDENTIFIER,
-    ServerPlugin.INDEX_CONTRIBUTOR_EXTENSION_POINT);
diff --git a/pkg/analysis_server/lib/plugin/index/index.dart b/pkg/analysis_server/lib/plugin/index/index.dart
new file mode 100644
index 0000000..b87fce9
--- /dev/null
+++ b/pkg/analysis_server/lib/plugin/index/index.dart
@@ -0,0 +1,43 @@
+// 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.
+
+/**
+ * Support for client code that extends the analysis server by adding new index
+ * contributors.
+ *
+ * Plugins can register index contributors. The registered contributors will be
+ * used to contribute relationships to the index when the analysis of a file has
+ * been completed.
+ *
+ * Typical relationships include things like "this variable is referenced here"
+ * or "this method is invoked here". The index is used to improve the
+ * performance of operations such as search or building a type hierarchy by
+ * pre-computing some of the information needed by those operations.
+ *
+ * If a plugin wants to contribute information to the index, it should implement
+ * the class [IndexContributor] and then register the contributor by including
+ * code like the following in the plugin's registerExtensions method:
+ *
+ *     @override
+ *     void registerExtensions(RegisterExtension registerExtension) {
+ *       ...
+ *       registerExtension(
+ *           INDEX_CONTRIBUTOR_EXTENSION_POINT_ID,
+ *           new MyIndexContributor());
+ *       ...
+ *     }
+ */
+library analysis_server.plugin.index.index;
+
+import 'package:analysis_server/plugin/index/index_core.dart';
+import 'package:analysis_server/src/plugin/server_plugin.dart';
+import 'package:plugin/plugin.dart';
+
+/**
+ * The identifier of the extension point that allows plugins to register index
+ * contributors. The object used as an extension must be an [IndexContributor].
+ */
+final String INDEX_CONTRIBUTOR_EXTENSION_POINT_ID = Plugin.join(
+    ServerPlugin.UNIQUE_IDENTIFIER,
+    ServerPlugin.INDEX_CONTRIBUTOR_EXTENSION_POINT);
diff --git a/pkg/analysis_server/lib/plugin/index/index_core.dart b/pkg/analysis_server/lib/plugin/index/index_core.dart
new file mode 100644
index 0000000..6e927a5
--- /dev/null
+++ b/pkg/analysis_server/lib/plugin/index/index_core.dart
@@ -0,0 +1,280 @@
+// 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 analysis_server.plugin.index.index_core;
+
+import 'dart:async';
+import 'dart:collection';
+
+import 'package:analysis_server/src/services/index/index.dart';
+import 'package:analyzer/src/generated/engine.dart';
+import 'package:analyzer/src/generated/source.dart';
+
+/**
+ * Return the integer value that corresponds to the given [string]. The value of
+ * [string] may be `null`.
+ *
+ * Clients are not expected to implement this signature. A function of this type
+ * is provided by the framework to clients in order to implement the method
+ * [IndexableObjectKind.encodeHash].
+ */
+typedef int StringToInt(String string);
+
+/**
+ * An object that can have a [Relationship] with various [Location]s in a code
+ * base. The object is abstractly represented by a [kind] and an [offset] within
+ * a file with the [filePath].
+ *
+ * Clients must ensure that two distinct objects in the same source cannot have
+ * the same kind and offset. Failure to do so will make it impossible for
+ * clients to identify the model element corresponding to the indexable object.
+ *
+ * Clients may implement this class when implementing plugins.
+ */
+abstract class IndexableObject {
+  /**
+   * Return the absolute path of the file containing the indexable object.
+   */
+  String get filePath;
+
+  /**
+   * Return the kind of this object.
+   */
+  IndexableObjectKind get kind;
+
+  /**
+   * Return the offset of the indexable object within its file.
+   */
+  int get offset;
+}
+
+/**
+ * The kind associated with an [IndexableObject].
+ *
+ * Clients may implement this class when implementing plugins.
+ */
+abstract class IndexableObjectKind<T extends IndexableObject> {
+  /**
+   * The next available index for a newly created kind of indexable object.
+   */
+  static int _nextIndex = 0;
+
+  /**
+   * A table mapping indexes to object kinds.
+   */
+  static Map<int, IndexableObjectKind> _registry =
+      new HashMap<int, IndexableObjectKind>();
+
+  /**
+   * Return the next available index for a newly created kind of indexable
+   * object.
+   */
+  static int get nextIndex => _nextIndex++;
+
+  /**
+   * Return the unique index for this kind of indexable object. Implementations
+   * should invoke [nextIndex] to allocate an index that cannot be used by any
+   * other object kind.
+   */
+  int get index;
+
+  /**
+   * Return the indexable object of this kind that exists in the given
+   * [context], in the source with the given [filePath], and at the given
+   * [offset].
+   */
+  T decode(AnalysisContext context, String filePath, int offset);
+
+  /**
+   * Returns the hash value that corresponds to the given [indexable].
+   *
+   * This hash is used to remember buckets with relations of the given
+   * [indexable]. Usually the name of the indexable object is encoded
+   * using [stringToInt] and mixed with other information to produce the final
+   * result.
+   *
+   * Clients must ensure that the same value is returned for the same object.
+   *
+   * Returned values must have good selectivity, e.g. if it is possible that
+   * there are many different objects with the same name, then additional
+   * information should be mixed in, for example the hash of the source that
+   * declares the given [indexable].
+   *
+   * Clients don't have to use name to compute this result, so if an indexable
+   * object does not have a name, some other value may be returned, but it still
+   * must be always the same for the same object and have good selectivity.
+   */
+  int encodeHash(StringToInt stringToInt, T indexable);
+
+  /**
+   * Return the object kind with the given [index].
+   */
+  static IndexableObjectKind getKind(int index) {
+    return _registry[index];
+  }
+
+  /**
+   * Register the given object [kind] so that it can be found by it's unique
+   * index. The index of the [kind] must not be changed after it is passed to
+   * this method.
+   */
+  static void register(IndexableObjectKind kind) {
+    int index = kind.index;
+    if (_registry.containsKey(index)) {
+      throw new ArgumentError('duplicate index for kind: $index');
+    }
+    _registry[index] = kind;
+  }
+}
+
+/**
+ * An object used to add relationships to the index.
+ *
+ * Clients may implement this class when implementing plugins.
+ */
+abstract class IndexContributor {
+  /**
+   * Contribute relationships existing in the given [object] to the given
+   * index [store] in the given [context].
+   */
+  void contributeTo(IndexStore store, AnalysisContext context, Object object);
+}
+
+/**
+ * An object that stores information about the relationships between locations
+ * in a code base.
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+abstract class IndexStore {
+  /**
+   * Remove all of the information from the index.
+   */
+  void clear();
+
+  /**
+   * Return a future that completes with the locations that have the given
+   * [relationship] with the given [indexable] object.
+   *
+   * For example, if the [indexable] object represents a function and the
+   * relationship is the `is-invoked-by` relationship, then the returned
+   * locations will be all of the places where the function is invoked.
+   */
+  Future<List<Location>> getRelationships(
+      IndexableObject indexable, Relationship relationship);
+
+  /**
+   * Record that the given [indexable] object and [location] have the given
+   * [relationship].
+   *
+   * For example, if the [relationship] is the `is-invoked-by` relationship,
+   * then the [indexable] object would be the function being invoked and
+   * [location] would be the point at which it is invoked. Each indexable object
+   * can have the same relationship with multiple locations. In other words, if
+   * the following code were executed
+   *
+   *     recordRelationship(indexable, isReferencedBy, location1);
+   *     recordRelationship(indexable, isReferencedBy, location2);
+   *
+   * (where `location1 != location2`) then both relationships would be
+   * maintained in the index and the result of executing
+   *
+   *     getRelationship(indexable, isReferencedBy);
+   *
+   * would be a list containing both `location1` and `location2`.
+   */
+  void recordRelationship(
+      IndexableObject indexable, Relationship relationship, Location location);
+
+  /**
+   * Remove from the index all of the information associated with the given
+   * [context].
+   *
+   * This method should be invoked when the [context] is disposed.
+   */
+  void removeContext(AnalysisContext context);
+
+  /**
+   * Remove from the index all of the information associated with indexable
+   * objects or locations in the given [source]. This includes relationships
+   * between an indexable object in [source] and any other locations, as well as
+   * relationships between any other indexable objects and locations within
+   * the [source].
+   *
+   * This method should be invoked when [source] is no longer part of the given
+   * [context].
+   */
+  void removeSource(AnalysisContext context, Source source);
+
+  /**
+   * Remove from the index all of the information associated with indexable
+   * objects or locations in the given sources. This includes relationships
+   * between an indexable object in the given sources and any other locations,
+   * as well as relationships between any other indexable objects and a location
+   * within the given sources.
+   *
+   * This method should be invoked when the sources described by the given
+   * [container] are no longer part of the given [context].
+   */
+  void removeSources(AnalysisContext context, SourceContainer container);
+}
+
+/**
+ * Instances of the class [Location] represent a location related to an
+ * indexable object.
+ *
+ * The location is expressed as an offset and length, but the offset is relative
+ * to the source containing the indexable object rather than the start of the
+ * indexable object within that source.
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+abstract class Location {
+  /**
+   * An empty list of locations.
+   */
+  static const List<Location> EMPTY_LIST = const <Location>[];
+
+  /**
+   * Return the indexable object containing this location.
+   */
+  IndexableObject get indexable;
+
+  /**
+   * Return `true` if this location is a qualified reference.
+   */
+  bool get isQualified;
+
+  /**
+   * Return `true` if this location is a resolved reference.
+   */
+  bool get isResolved;
+
+  /**
+   * Return the length of this location.
+   */
+  int get length;
+
+  /**
+   * Return the offset of this location within the source containing the
+   * indexable object.
+   */
+  int get offset;
+}
+
+/**
+ * A relationship between an indexable object and a location. Relationships are
+ * identified by a globally unique identifier.
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+abstract class Relationship {
+  /**
+   * Return a relationship that has the given [identifier]. If the relationship
+   * has already been created, then it will be returned, otherwise a new
+   * relationship will be created
+   */
+  factory Relationship(String identifier) =>
+      RelationshipImpl.getRelationship(identifier);
+}
diff --git a/pkg/analysis_server/lib/plugin/protocol/generated_protocol.dart b/pkg/analysis_server/lib/plugin/protocol/generated_protocol.dart
new file mode 100644
index 0000000..db3e626
--- /dev/null
+++ b/pkg/analysis_server/lib/plugin/protocol/generated_protocol.dart
@@ -0,0 +1,16433 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+//
+// This file has been automatically generated.  Please do not edit it manually.
+// To regenerate the file, use the script
+// "pkg/analysis_server/tool/spec/generate_files".
+
+part of analysis_server.plugin.protocol.protocol;
+
+/**
+ * server.getVersion params
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class ServerGetVersionParams {
+  Request toRequest(String id) {
+    return new Request(id, "server.getVersion", null);
+  }
+
+  @override
+  bool operator==(other) {
+    if (other is ServerGetVersionParams) {
+      return true;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    return 55877452;
+  }
+}
+
+/**
+ * server.getVersion result
+ *
+ * {
+ *   "version": String
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class ServerGetVersionResult implements HasToJson {
+  String _version;
+
+  /**
+   * The version number of the analysis server.
+   */
+  String get version => _version;
+
+  /**
+   * The version number of the analysis server.
+   */
+  void set version(String value) {
+    assert(value != null);
+    this._version = value;
+  }
+
+  ServerGetVersionResult(String version) {
+    this.version = version;
+  }
+
+  factory ServerGetVersionResult.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      String version;
+      if (json.containsKey("version")) {
+        version = jsonDecoder.decodeString(jsonPath + ".version", json["version"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "version");
+      }
+      return new ServerGetVersionResult(version);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "server.getVersion result", json);
+    }
+  }
+
+  factory ServerGetVersionResult.fromResponse(Response response) {
+    return new ServerGetVersionResult.fromJson(
+        new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), "result", response._result);
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["version"] = version;
+    return result;
+  }
+
+  Response toResponse(String id) {
+    return new Response(id, result: toJson());
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is ServerGetVersionResult) {
+      return version == other.version;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, version.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+/**
+ * server.shutdown params
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class ServerShutdownParams {
+  Request toRequest(String id) {
+    return new Request(id, "server.shutdown", null);
+  }
+
+  @override
+  bool operator==(other) {
+    if (other is ServerShutdownParams) {
+      return true;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    return 366630911;
+  }
+}
+/**
+ * server.shutdown result
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class ServerShutdownResult {
+  Response toResponse(String id) {
+    return new Response(id, result: null);
+  }
+
+  @override
+  bool operator==(other) {
+    if (other is ServerShutdownResult) {
+      return true;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    return 193626532;
+  }
+}
+
+/**
+ * server.setSubscriptions params
+ *
+ * {
+ *   "subscriptions": List<ServerService>
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class ServerSetSubscriptionsParams implements HasToJson {
+  List<ServerService> _subscriptions;
+
+  /**
+   * A list of the services being subscribed to.
+   */
+  List<ServerService> get subscriptions => _subscriptions;
+
+  /**
+   * A list of the services being subscribed to.
+   */
+  void set subscriptions(List<ServerService> value) {
+    assert(value != null);
+    this._subscriptions = value;
+  }
+
+  ServerSetSubscriptionsParams(List<ServerService> subscriptions) {
+    this.subscriptions = subscriptions;
+  }
+
+  factory ServerSetSubscriptionsParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      List<ServerService> subscriptions;
+      if (json.containsKey("subscriptions")) {
+        subscriptions = jsonDecoder.decodeList(jsonPath + ".subscriptions", json["subscriptions"], (String jsonPath, Object json) => new ServerService.fromJson(jsonDecoder, jsonPath, json));
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "subscriptions");
+      }
+      return new ServerSetSubscriptionsParams(subscriptions);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "server.setSubscriptions params", json);
+    }
+  }
+
+  factory ServerSetSubscriptionsParams.fromRequest(Request request) {
+    return new ServerSetSubscriptionsParams.fromJson(
+        new RequestDecoder(request), "params", request._params);
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["subscriptions"] = subscriptions.map((ServerService value) => value.toJson()).toList();
+    return result;
+  }
+
+  Request toRequest(String id) {
+    return new Request(id, "server.setSubscriptions", toJson());
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is ServerSetSubscriptionsParams) {
+      return listEqual(subscriptions, other.subscriptions, (ServerService a, ServerService b) => a == b);
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, subscriptions.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+/**
+ * server.setSubscriptions result
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class ServerSetSubscriptionsResult {
+  Response toResponse(String id) {
+    return new Response(id, result: null);
+  }
+
+  @override
+  bool operator==(other) {
+    if (other is ServerSetSubscriptionsResult) {
+      return true;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    return 748820900;
+  }
+}
+
+/**
+ * server.connected params
+ *
+ * {
+ *   "version": String
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class ServerConnectedParams implements HasToJson {
+  String _version;
+
+  /**
+   * The version number of the analysis server.
+   */
+  String get version => _version;
+
+  /**
+   * The version number of the analysis server.
+   */
+  void set version(String value) {
+    assert(value != null);
+    this._version = value;
+  }
+
+  ServerConnectedParams(String version) {
+    this.version = version;
+  }
+
+  factory ServerConnectedParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      String version;
+      if (json.containsKey("version")) {
+        version = jsonDecoder.decodeString(jsonPath + ".version", json["version"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "version");
+      }
+      return new ServerConnectedParams(version);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "server.connected params", json);
+    }
+  }
+
+  factory ServerConnectedParams.fromNotification(Notification notification) {
+    return new ServerConnectedParams.fromJson(
+        new ResponseDecoder(null), "params", notification._params);
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["version"] = version;
+    return result;
+  }
+
+  Notification toNotification() {
+    return new Notification("server.connected", toJson());
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is ServerConnectedParams) {
+      return version == other.version;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, version.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * server.error params
+ *
+ * {
+ *   "isFatal": bool
+ *   "message": String
+ *   "stackTrace": String
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class ServerErrorParams implements HasToJson {
+  bool _isFatal;
+
+  String _message;
+
+  String _stackTrace;
+
+  /**
+   * True if the error is a fatal error, meaning that the server will shutdown
+   * automatically after sending this notification.
+   */
+  bool get isFatal => _isFatal;
+
+  /**
+   * True if the error is a fatal error, meaning that the server will shutdown
+   * automatically after sending this notification.
+   */
+  void set isFatal(bool value) {
+    assert(value != null);
+    this._isFatal = value;
+  }
+
+  /**
+   * The error message indicating what kind of error was encountered.
+   */
+  String get message => _message;
+
+  /**
+   * The error message indicating what kind of error was encountered.
+   */
+  void set message(String value) {
+    assert(value != null);
+    this._message = value;
+  }
+
+  /**
+   * The stack trace associated with the generation of the error, used for
+   * debugging the server.
+   */
+  String get stackTrace => _stackTrace;
+
+  /**
+   * The stack trace associated with the generation of the error, used for
+   * debugging the server.
+   */
+  void set stackTrace(String value) {
+    assert(value != null);
+    this._stackTrace = value;
+  }
+
+  ServerErrorParams(bool isFatal, String message, String stackTrace) {
+    this.isFatal = isFatal;
+    this.message = message;
+    this.stackTrace = stackTrace;
+  }
+
+  factory ServerErrorParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      bool isFatal;
+      if (json.containsKey("isFatal")) {
+        isFatal = jsonDecoder.decodeBool(jsonPath + ".isFatal", json["isFatal"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "isFatal");
+      }
+      String message;
+      if (json.containsKey("message")) {
+        message = jsonDecoder.decodeString(jsonPath + ".message", json["message"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "message");
+      }
+      String stackTrace;
+      if (json.containsKey("stackTrace")) {
+        stackTrace = jsonDecoder.decodeString(jsonPath + ".stackTrace", json["stackTrace"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "stackTrace");
+      }
+      return new ServerErrorParams(isFatal, message, stackTrace);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "server.error params", json);
+    }
+  }
+
+  factory ServerErrorParams.fromNotification(Notification notification) {
+    return new ServerErrorParams.fromJson(
+        new ResponseDecoder(null), "params", notification._params);
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["isFatal"] = isFatal;
+    result["message"] = message;
+    result["stackTrace"] = stackTrace;
+    return result;
+  }
+
+  Notification toNotification() {
+    return new Notification("server.error", toJson());
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is ServerErrorParams) {
+      return isFatal == other.isFatal &&
+          message == other.message &&
+          stackTrace == other.stackTrace;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, isFatal.hashCode);
+    hash = JenkinsSmiHash.combine(hash, message.hashCode);
+    hash = JenkinsSmiHash.combine(hash, stackTrace.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * server.status params
+ *
+ * {
+ *   "analysis": optional AnalysisStatus
+ *   "pub": optional PubStatus
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class ServerStatusParams implements HasToJson {
+  AnalysisStatus _analysis;
+
+  PubStatus _pub;
+
+  /**
+   * The current status of analysis, including whether analysis is being
+   * performed and if so what is being analyzed.
+   */
+  AnalysisStatus get analysis => _analysis;
+
+  /**
+   * The current status of analysis, including whether analysis is being
+   * performed and if so what is being analyzed.
+   */
+  void set analysis(AnalysisStatus value) {
+    this._analysis = value;
+  }
+
+  /**
+   * The current status of pub execution, indicating whether we are currently
+   * running pub.
+   */
+  PubStatus get pub => _pub;
+
+  /**
+   * The current status of pub execution, indicating whether we are currently
+   * running pub.
+   */
+  void set pub(PubStatus value) {
+    this._pub = value;
+  }
+
+  ServerStatusParams({AnalysisStatus analysis, PubStatus pub}) {
+    this.analysis = analysis;
+    this.pub = pub;
+  }
+
+  factory ServerStatusParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      AnalysisStatus analysis;
+      if (json.containsKey("analysis")) {
+        analysis = new AnalysisStatus.fromJson(jsonDecoder, jsonPath + ".analysis", json["analysis"]);
+      }
+      PubStatus pub;
+      if (json.containsKey("pub")) {
+        pub = new PubStatus.fromJson(jsonDecoder, jsonPath + ".pub", json["pub"]);
+      }
+      return new ServerStatusParams(analysis: analysis, pub: pub);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "server.status params", json);
+    }
+  }
+
+  factory ServerStatusParams.fromNotification(Notification notification) {
+    return new ServerStatusParams.fromJson(
+        new ResponseDecoder(null), "params", notification._params);
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    if (analysis != null) {
+      result["analysis"] = analysis.toJson();
+    }
+    if (pub != null) {
+      result["pub"] = pub.toJson();
+    }
+    return result;
+  }
+
+  Notification toNotification() {
+    return new Notification("server.status", toJson());
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is ServerStatusParams) {
+      return analysis == other.analysis &&
+          pub == other.pub;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, analysis.hashCode);
+    hash = JenkinsSmiHash.combine(hash, pub.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * analysis.getErrors params
+ *
+ * {
+ *   "file": FilePath
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class AnalysisGetErrorsParams implements HasToJson {
+  String _file;
+
+  /**
+   * The file for which errors are being requested.
+   */
+  String get file => _file;
+
+  /**
+   * The file for which errors are being requested.
+   */
+  void set file(String value) {
+    assert(value != null);
+    this._file = value;
+  }
+
+  AnalysisGetErrorsParams(String file) {
+    this.file = file;
+  }
+
+  factory AnalysisGetErrorsParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      String file;
+      if (json.containsKey("file")) {
+        file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "file");
+      }
+      return new AnalysisGetErrorsParams(file);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "analysis.getErrors params", json);
+    }
+  }
+
+  factory AnalysisGetErrorsParams.fromRequest(Request request) {
+    return new AnalysisGetErrorsParams.fromJson(
+        new RequestDecoder(request), "params", request._params);
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["file"] = file;
+    return result;
+  }
+
+  Request toRequest(String id) {
+    return new Request(id, "analysis.getErrors", toJson());
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is AnalysisGetErrorsParams) {
+      return file == other.file;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, file.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * analysis.getErrors result
+ *
+ * {
+ *   "errors": List<AnalysisError>
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class AnalysisGetErrorsResult implements HasToJson {
+  List<AnalysisError> _errors;
+
+  /**
+   * The errors associated with the file.
+   */
+  List<AnalysisError> get errors => _errors;
+
+  /**
+   * The errors associated with the file.
+   */
+  void set errors(List<AnalysisError> value) {
+    assert(value != null);
+    this._errors = value;
+  }
+
+  AnalysisGetErrorsResult(List<AnalysisError> errors) {
+    this.errors = errors;
+  }
+
+  factory AnalysisGetErrorsResult.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      List<AnalysisError> errors;
+      if (json.containsKey("errors")) {
+        errors = jsonDecoder.decodeList(jsonPath + ".errors", json["errors"], (String jsonPath, Object json) => new AnalysisError.fromJson(jsonDecoder, jsonPath, json));
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "errors");
+      }
+      return new AnalysisGetErrorsResult(errors);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "analysis.getErrors result", json);
+    }
+  }
+
+  factory AnalysisGetErrorsResult.fromResponse(Response response) {
+    return new AnalysisGetErrorsResult.fromJson(
+        new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), "result", response._result);
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["errors"] = errors.map((AnalysisError value) => value.toJson()).toList();
+    return result;
+  }
+
+  Response toResponse(String id) {
+    return new Response(id, result: toJson());
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is AnalysisGetErrorsResult) {
+      return listEqual(errors, other.errors, (AnalysisError a, AnalysisError b) => a == b);
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, errors.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * analysis.getHover params
+ *
+ * {
+ *   "file": FilePath
+ *   "offset": int
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class AnalysisGetHoverParams implements HasToJson {
+  String _file;
+
+  int _offset;
+
+  /**
+   * The file in which hover information is being requested.
+   */
+  String get file => _file;
+
+  /**
+   * The file in which hover information is being requested.
+   */
+  void set file(String value) {
+    assert(value != null);
+    this._file = value;
+  }
+
+  /**
+   * The offset for which hover information is being requested.
+   */
+  int get offset => _offset;
+
+  /**
+   * The offset for which hover information is being requested.
+   */
+  void set offset(int value) {
+    assert(value != null);
+    this._offset = value;
+  }
+
+  AnalysisGetHoverParams(String file, int offset) {
+    this.file = file;
+    this.offset = offset;
+  }
+
+  factory AnalysisGetHoverParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      String file;
+      if (json.containsKey("file")) {
+        file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "file");
+      }
+      int offset;
+      if (json.containsKey("offset")) {
+        offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "offset");
+      }
+      return new AnalysisGetHoverParams(file, offset);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "analysis.getHover params", json);
+    }
+  }
+
+  factory AnalysisGetHoverParams.fromRequest(Request request) {
+    return new AnalysisGetHoverParams.fromJson(
+        new RequestDecoder(request), "params", request._params);
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["file"] = file;
+    result["offset"] = offset;
+    return result;
+  }
+
+  Request toRequest(String id) {
+    return new Request(id, "analysis.getHover", toJson());
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is AnalysisGetHoverParams) {
+      return file == other.file &&
+          offset == other.offset;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, file.hashCode);
+    hash = JenkinsSmiHash.combine(hash, offset.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * analysis.getHover result
+ *
+ * {
+ *   "hovers": List<HoverInformation>
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class AnalysisGetHoverResult implements HasToJson {
+  List<HoverInformation> _hovers;
+
+  /**
+   * The hover information associated with the location. The list will be empty
+   * if no information could be determined for the location. The list can
+   * contain multiple items if the file is being analyzed in multiple contexts
+   * in conflicting ways (such as a part that is included in multiple
+   * libraries).
+   */
+  List<HoverInformation> get hovers => _hovers;
+
+  /**
+   * The hover information associated with the location. The list will be empty
+   * if no information could be determined for the location. The list can
+   * contain multiple items if the file is being analyzed in multiple contexts
+   * in conflicting ways (such as a part that is included in multiple
+   * libraries).
+   */
+  void set hovers(List<HoverInformation> value) {
+    assert(value != null);
+    this._hovers = value;
+  }
+
+  AnalysisGetHoverResult(List<HoverInformation> hovers) {
+    this.hovers = hovers;
+  }
+
+  factory AnalysisGetHoverResult.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      List<HoverInformation> hovers;
+      if (json.containsKey("hovers")) {
+        hovers = jsonDecoder.decodeList(jsonPath + ".hovers", json["hovers"], (String jsonPath, Object json) => new HoverInformation.fromJson(jsonDecoder, jsonPath, json));
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "hovers");
+      }
+      return new AnalysisGetHoverResult(hovers);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "analysis.getHover result", json);
+    }
+  }
+
+  factory AnalysisGetHoverResult.fromResponse(Response response) {
+    return new AnalysisGetHoverResult.fromJson(
+        new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), "result", response._result);
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["hovers"] = hovers.map((HoverInformation value) => value.toJson()).toList();
+    return result;
+  }
+
+  Response toResponse(String id) {
+    return new Response(id, result: toJson());
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is AnalysisGetHoverResult) {
+      return listEqual(hovers, other.hovers, (HoverInformation a, HoverInformation b) => a == b);
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, hovers.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+/**
+ * analysis.getLibraryDependencies params
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class AnalysisGetLibraryDependenciesParams {
+  Request toRequest(String id) {
+    return new Request(id, "analysis.getLibraryDependencies", null);
+  }
+
+  @override
+  bool operator==(other) {
+    if (other is AnalysisGetLibraryDependenciesParams) {
+      return true;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    return 246577680;
+  }
+}
+
+/**
+ * analysis.getLibraryDependencies result
+ *
+ * {
+ *   "libraries": List<FilePath>
+ *   "packageMap": Map<String, Map<String, List<FilePath>>>
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class AnalysisGetLibraryDependenciesResult implements HasToJson {
+  List<String> _libraries;
+
+  Map<String, Map<String, List<String>>> _packageMap;
+
+  /**
+   * A list of the paths of library elements referenced by files in existing
+   * analysis roots.
+   */
+  List<String> get libraries => _libraries;
+
+  /**
+   * A list of the paths of library elements referenced by files in existing
+   * analysis roots.
+   */
+  void set libraries(List<String> value) {
+    assert(value != null);
+    this._libraries = value;
+  }
+
+  /**
+   * A mapping from context source roots to package maps which map package
+   * names to source directories for use in client-side package URI resolution.
+   */
+  Map<String, Map<String, List<String>>> get packageMap => _packageMap;
+
+  /**
+   * A mapping from context source roots to package maps which map package
+   * names to source directories for use in client-side package URI resolution.
+   */
+  void set packageMap(Map<String, Map<String, List<String>>> value) {
+    assert(value != null);
+    this._packageMap = value;
+  }
+
+  AnalysisGetLibraryDependenciesResult(List<String> libraries, Map<String, Map<String, List<String>>> packageMap) {
+    this.libraries = libraries;
+    this.packageMap = packageMap;
+  }
+
+  factory AnalysisGetLibraryDependenciesResult.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      List<String> libraries;
+      if (json.containsKey("libraries")) {
+        libraries = jsonDecoder.decodeList(jsonPath + ".libraries", json["libraries"], jsonDecoder.decodeString);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "libraries");
+      }
+      Map<String, Map<String, List<String>>> packageMap;
+      if (json.containsKey("packageMap")) {
+        packageMap = jsonDecoder.decodeMap(jsonPath + ".packageMap", json["packageMap"], valueDecoder: (String jsonPath, Object json) => jsonDecoder.decodeMap(jsonPath, json, valueDecoder: (String jsonPath, Object json) => jsonDecoder.decodeList(jsonPath, json, jsonDecoder.decodeString)));
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "packageMap");
+      }
+      return new AnalysisGetLibraryDependenciesResult(libraries, packageMap);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "analysis.getLibraryDependencies result", json);
+    }
+  }
+
+  factory AnalysisGetLibraryDependenciesResult.fromResponse(Response response) {
+    return new AnalysisGetLibraryDependenciesResult.fromJson(
+        new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), "result", response._result);
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["libraries"] = libraries;
+    result["packageMap"] = packageMap;
+    return result;
+  }
+
+  Response toResponse(String id) {
+    return new Response(id, result: toJson());
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is AnalysisGetLibraryDependenciesResult) {
+      return listEqual(libraries, other.libraries, (String a, String b) => a == b) &&
+          mapEqual(packageMap, other.packageMap, (Map<String, List<String>> a, Map<String, List<String>> b) => mapEqual(a, b, (List<String> a, List<String> b) => listEqual(a, b, (String a, String b) => a == b)));
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, libraries.hashCode);
+    hash = JenkinsSmiHash.combine(hash, packageMap.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * analysis.getNavigation params
+ *
+ * {
+ *   "file": FilePath
+ *   "offset": int
+ *   "length": int
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class AnalysisGetNavigationParams implements HasToJson {
+  String _file;
+
+  int _offset;
+
+  int _length;
+
+  /**
+   * The file in which navigation information is being requested.
+   */
+  String get file => _file;
+
+  /**
+   * The file in which navigation information is being requested.
+   */
+  void set file(String value) {
+    assert(value != null);
+    this._file = value;
+  }
+
+  /**
+   * The offset of the region for which navigation information is being
+   * requested.
+   */
+  int get offset => _offset;
+
+  /**
+   * The offset of the region for which navigation information is being
+   * requested.
+   */
+  void set offset(int value) {
+    assert(value != null);
+    this._offset = value;
+  }
+
+  /**
+   * The length of the region for which navigation information is being
+   * requested.
+   */
+  int get length => _length;
+
+  /**
+   * The length of the region for which navigation information is being
+   * requested.
+   */
+  void set length(int value) {
+    assert(value != null);
+    this._length = value;
+  }
+
+  AnalysisGetNavigationParams(String file, int offset, int length) {
+    this.file = file;
+    this.offset = offset;
+    this.length = length;
+  }
+
+  factory AnalysisGetNavigationParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      String file;
+      if (json.containsKey("file")) {
+        file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "file");
+      }
+      int offset;
+      if (json.containsKey("offset")) {
+        offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "offset");
+      }
+      int length;
+      if (json.containsKey("length")) {
+        length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "length");
+      }
+      return new AnalysisGetNavigationParams(file, offset, length);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "analysis.getNavigation params", json);
+    }
+  }
+
+  factory AnalysisGetNavigationParams.fromRequest(Request request) {
+    return new AnalysisGetNavigationParams.fromJson(
+        new RequestDecoder(request), "params", request._params);
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["file"] = file;
+    result["offset"] = offset;
+    result["length"] = length;
+    return result;
+  }
+
+  Request toRequest(String id) {
+    return new Request(id, "analysis.getNavigation", toJson());
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is AnalysisGetNavigationParams) {
+      return file == other.file &&
+          offset == other.offset &&
+          length == other.length;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, file.hashCode);
+    hash = JenkinsSmiHash.combine(hash, offset.hashCode);
+    hash = JenkinsSmiHash.combine(hash, length.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * analysis.getNavigation result
+ *
+ * {
+ *   "files": List<FilePath>
+ *   "targets": List<NavigationTarget>
+ *   "regions": List<NavigationRegion>
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class AnalysisGetNavigationResult implements HasToJson {
+  List<String> _files;
+
+  List<NavigationTarget> _targets;
+
+  List<NavigationRegion> _regions;
+
+  /**
+   * A list of the paths of files that are referenced by the navigation
+   * targets.
+   */
+  List<String> get files => _files;
+
+  /**
+   * A list of the paths of files that are referenced by the navigation
+   * targets.
+   */
+  void set files(List<String> value) {
+    assert(value != null);
+    this._files = value;
+  }
+
+  /**
+   * A list of the navigation targets that are referenced by the navigation
+   * regions.
+   */
+  List<NavigationTarget> get targets => _targets;
+
+  /**
+   * A list of the navigation targets that are referenced by the navigation
+   * regions.
+   */
+  void set targets(List<NavigationTarget> value) {
+    assert(value != null);
+    this._targets = value;
+  }
+
+  /**
+   * A list of the navigation regions within the requested region of the file.
+   */
+  List<NavigationRegion> get regions => _regions;
+
+  /**
+   * A list of the navigation regions within the requested region of the file.
+   */
+  void set regions(List<NavigationRegion> value) {
+    assert(value != null);
+    this._regions = value;
+  }
+
+  AnalysisGetNavigationResult(List<String> files, List<NavigationTarget> targets, List<NavigationRegion> regions) {
+    this.files = files;
+    this.targets = targets;
+    this.regions = regions;
+  }
+
+  factory AnalysisGetNavigationResult.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      List<String> files;
+      if (json.containsKey("files")) {
+        files = jsonDecoder.decodeList(jsonPath + ".files", json["files"], jsonDecoder.decodeString);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "files");
+      }
+      List<NavigationTarget> targets;
+      if (json.containsKey("targets")) {
+        targets = jsonDecoder.decodeList(jsonPath + ".targets", json["targets"], (String jsonPath, Object json) => new NavigationTarget.fromJson(jsonDecoder, jsonPath, json));
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "targets");
+      }
+      List<NavigationRegion> regions;
+      if (json.containsKey("regions")) {
+        regions = jsonDecoder.decodeList(jsonPath + ".regions", json["regions"], (String jsonPath, Object json) => new NavigationRegion.fromJson(jsonDecoder, jsonPath, json));
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "regions");
+      }
+      return new AnalysisGetNavigationResult(files, targets, regions);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "analysis.getNavigation result", json);
+    }
+  }
+
+  factory AnalysisGetNavigationResult.fromResponse(Response response) {
+    return new AnalysisGetNavigationResult.fromJson(
+        new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), "result", response._result);
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["files"] = files;
+    result["targets"] = targets.map((NavigationTarget value) => value.toJson()).toList();
+    result["regions"] = regions.map((NavigationRegion value) => value.toJson()).toList();
+    return result;
+  }
+
+  Response toResponse(String id) {
+    return new Response(id, result: toJson());
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is AnalysisGetNavigationResult) {
+      return listEqual(files, other.files, (String a, String b) => a == b) &&
+          listEqual(targets, other.targets, (NavigationTarget a, NavigationTarget b) => a == b) &&
+          listEqual(regions, other.regions, (NavigationRegion a, NavigationRegion b) => a == b);
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, files.hashCode);
+    hash = JenkinsSmiHash.combine(hash, targets.hashCode);
+    hash = JenkinsSmiHash.combine(hash, regions.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * analysis.reanalyze params
+ *
+ * {
+ *   "roots": optional List<FilePath>
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class AnalysisReanalyzeParams implements HasToJson {
+  List<String> _roots;
+
+  /**
+   * A list of the analysis roots that are to be re-analyzed.
+   */
+  List<String> get roots => _roots;
+
+  /**
+   * A list of the analysis roots that are to be re-analyzed.
+   */
+  void set roots(List<String> value) {
+    this._roots = value;
+  }
+
+  AnalysisReanalyzeParams({List<String> roots}) {
+    this.roots = roots;
+  }
+
+  factory AnalysisReanalyzeParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      List<String> roots;
+      if (json.containsKey("roots")) {
+        roots = jsonDecoder.decodeList(jsonPath + ".roots", json["roots"], jsonDecoder.decodeString);
+      }
+      return new AnalysisReanalyzeParams(roots: roots);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "analysis.reanalyze params", json);
+    }
+  }
+
+  factory AnalysisReanalyzeParams.fromRequest(Request request) {
+    return new AnalysisReanalyzeParams.fromJson(
+        new RequestDecoder(request), "params", request._params);
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    if (roots != null) {
+      result["roots"] = roots;
+    }
+    return result;
+  }
+
+  Request toRequest(String id) {
+    return new Request(id, "analysis.reanalyze", toJson());
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is AnalysisReanalyzeParams) {
+      return listEqual(roots, other.roots, (String a, String b) => a == b);
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, roots.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+/**
+ * analysis.reanalyze result
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class AnalysisReanalyzeResult {
+  Response toResponse(String id) {
+    return new Response(id, result: null);
+  }
+
+  @override
+  bool operator==(other) {
+    if (other is AnalysisReanalyzeResult) {
+      return true;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    return 846803925;
+  }
+}
+
+/**
+ * analysis.setAnalysisRoots params
+ *
+ * {
+ *   "included": List<FilePath>
+ *   "excluded": List<FilePath>
+ *   "packageRoots": optional Map<FilePath, FilePath>
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class AnalysisSetAnalysisRootsParams implements HasToJson {
+  List<String> _included;
+
+  List<String> _excluded;
+
+  Map<String, String> _packageRoots;
+
+  /**
+   * A list of the files and directories that should be analyzed.
+   */
+  List<String> get included => _included;
+
+  /**
+   * A list of the files and directories that should be analyzed.
+   */
+  void set included(List<String> value) {
+    assert(value != null);
+    this._included = value;
+  }
+
+  /**
+   * A list of the files and directories within the included directories that
+   * should not be analyzed.
+   */
+  List<String> get excluded => _excluded;
+
+  /**
+   * A list of the files and directories within the included directories that
+   * should not be analyzed.
+   */
+  void set excluded(List<String> value) {
+    assert(value != null);
+    this._excluded = value;
+  }
+
+  /**
+   * A mapping from source directories to target directories that should
+   * override the normal package: URI resolution mechanism. The analyzer will
+   * behave as though each source directory in the map contains a special
+   * pubspec.yaml file which resolves any package: URI to the corresponding
+   * path within the target directory. The effect is the same as specifying the
+   * target directory as a "--package_root" parameter to the Dart VM when
+   * executing any Dart file inside the source directory.
+   *
+   * Files in any directories that are not overridden by this mapping have
+   * their package: URI's resolved using the normal pubspec.yaml mechanism. If
+   * this field is absent, or the empty map is specified, that indicates that
+   * the normal pubspec.yaml mechanism should always be used.
+   */
+  Map<String, String> get packageRoots => _packageRoots;
+
+  /**
+   * A mapping from source directories to target directories that should
+   * override the normal package: URI resolution mechanism. The analyzer will
+   * behave as though each source directory in the map contains a special
+   * pubspec.yaml file which resolves any package: URI to the corresponding
+   * path within the target directory. The effect is the same as specifying the
+   * target directory as a "--package_root" parameter to the Dart VM when
+   * executing any Dart file inside the source directory.
+   *
+   * Files in any directories that are not overridden by this mapping have
+   * their package: URI's resolved using the normal pubspec.yaml mechanism. If
+   * this field is absent, or the empty map is specified, that indicates that
+   * the normal pubspec.yaml mechanism should always be used.
+   */
+  void set packageRoots(Map<String, String> value) {
+    this._packageRoots = value;
+  }
+
+  AnalysisSetAnalysisRootsParams(List<String> included, List<String> excluded, {Map<String, String> packageRoots}) {
+    this.included = included;
+    this.excluded = excluded;
+    this.packageRoots = packageRoots;
+  }
+
+  factory AnalysisSetAnalysisRootsParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      List<String> included;
+      if (json.containsKey("included")) {
+        included = jsonDecoder.decodeList(jsonPath + ".included", json["included"], jsonDecoder.decodeString);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "included");
+      }
+      List<String> excluded;
+      if (json.containsKey("excluded")) {
+        excluded = jsonDecoder.decodeList(jsonPath + ".excluded", json["excluded"], jsonDecoder.decodeString);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "excluded");
+      }
+      Map<String, String> packageRoots;
+      if (json.containsKey("packageRoots")) {
+        packageRoots = jsonDecoder.decodeMap(jsonPath + ".packageRoots", json["packageRoots"], valueDecoder: jsonDecoder.decodeString);
+      }
+      return new AnalysisSetAnalysisRootsParams(included, excluded, packageRoots: packageRoots);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "analysis.setAnalysisRoots params", json);
+    }
+  }
+
+  factory AnalysisSetAnalysisRootsParams.fromRequest(Request request) {
+    return new AnalysisSetAnalysisRootsParams.fromJson(
+        new RequestDecoder(request), "params", request._params);
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["included"] = included;
+    result["excluded"] = excluded;
+    if (packageRoots != null) {
+      result["packageRoots"] = packageRoots;
+    }
+    return result;
+  }
+
+  Request toRequest(String id) {
+    return new Request(id, "analysis.setAnalysisRoots", toJson());
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is AnalysisSetAnalysisRootsParams) {
+      return listEqual(included, other.included, (String a, String b) => a == b) &&
+          listEqual(excluded, other.excluded, (String a, String b) => a == b) &&
+          mapEqual(packageRoots, other.packageRoots, (String a, String b) => a == b);
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, included.hashCode);
+    hash = JenkinsSmiHash.combine(hash, excluded.hashCode);
+    hash = JenkinsSmiHash.combine(hash, packageRoots.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+/**
+ * analysis.setAnalysisRoots result
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class AnalysisSetAnalysisRootsResult {
+  Response toResponse(String id) {
+    return new Response(id, result: null);
+  }
+
+  @override
+  bool operator==(other) {
+    if (other is AnalysisSetAnalysisRootsResult) {
+      return true;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    return 866004753;
+  }
+}
+
+/**
+ * analysis.setGeneralSubscriptions params
+ *
+ * {
+ *   "subscriptions": List<GeneralAnalysisService>
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class AnalysisSetGeneralSubscriptionsParams implements HasToJson {
+  List<GeneralAnalysisService> _subscriptions;
+
+  /**
+   * A list of the services being subscribed to.
+   */
+  List<GeneralAnalysisService> get subscriptions => _subscriptions;
+
+  /**
+   * A list of the services being subscribed to.
+   */
+  void set subscriptions(List<GeneralAnalysisService> value) {
+    assert(value != null);
+    this._subscriptions = value;
+  }
+
+  AnalysisSetGeneralSubscriptionsParams(List<GeneralAnalysisService> subscriptions) {
+    this.subscriptions = subscriptions;
+  }
+
+  factory AnalysisSetGeneralSubscriptionsParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      List<GeneralAnalysisService> subscriptions;
+      if (json.containsKey("subscriptions")) {
+        subscriptions = jsonDecoder.decodeList(jsonPath + ".subscriptions", json["subscriptions"], (String jsonPath, Object json) => new GeneralAnalysisService.fromJson(jsonDecoder, jsonPath, json));
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "subscriptions");
+      }
+      return new AnalysisSetGeneralSubscriptionsParams(subscriptions);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "analysis.setGeneralSubscriptions params", json);
+    }
+  }
+
+  factory AnalysisSetGeneralSubscriptionsParams.fromRequest(Request request) {
+    return new AnalysisSetGeneralSubscriptionsParams.fromJson(
+        new RequestDecoder(request), "params", request._params);
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["subscriptions"] = subscriptions.map((GeneralAnalysisService value) => value.toJson()).toList();
+    return result;
+  }
+
+  Request toRequest(String id) {
+    return new Request(id, "analysis.setGeneralSubscriptions", toJson());
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is AnalysisSetGeneralSubscriptionsParams) {
+      return listEqual(subscriptions, other.subscriptions, (GeneralAnalysisService a, GeneralAnalysisService b) => a == b);
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, subscriptions.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+/**
+ * analysis.setGeneralSubscriptions result
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class AnalysisSetGeneralSubscriptionsResult {
+  Response toResponse(String id) {
+    return new Response(id, result: null);
+  }
+
+  @override
+  bool operator==(other) {
+    if (other is AnalysisSetGeneralSubscriptionsResult) {
+      return true;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    return 386759562;
+  }
+}
+
+/**
+ * analysis.setPriorityFiles params
+ *
+ * {
+ *   "files": List<FilePath>
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class AnalysisSetPriorityFilesParams implements HasToJson {
+  List<String> _files;
+
+  /**
+   * The files that are to be a priority for analysis.
+   */
+  List<String> get files => _files;
+
+  /**
+   * The files that are to be a priority for analysis.
+   */
+  void set files(List<String> value) {
+    assert(value != null);
+    this._files = value;
+  }
+
+  AnalysisSetPriorityFilesParams(List<String> files) {
+    this.files = files;
+  }
+
+  factory AnalysisSetPriorityFilesParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      List<String> files;
+      if (json.containsKey("files")) {
+        files = jsonDecoder.decodeList(jsonPath + ".files", json["files"], jsonDecoder.decodeString);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "files");
+      }
+      return new AnalysisSetPriorityFilesParams(files);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "analysis.setPriorityFiles params", json);
+    }
+  }
+
+  factory AnalysisSetPriorityFilesParams.fromRequest(Request request) {
+    return new AnalysisSetPriorityFilesParams.fromJson(
+        new RequestDecoder(request), "params", request._params);
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["files"] = files;
+    return result;
+  }
+
+  Request toRequest(String id) {
+    return new Request(id, "analysis.setPriorityFiles", toJson());
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is AnalysisSetPriorityFilesParams) {
+      return listEqual(files, other.files, (String a, String b) => a == b);
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, files.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+/**
+ * analysis.setPriorityFiles result
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class AnalysisSetPriorityFilesResult {
+  Response toResponse(String id) {
+    return new Response(id, result: null);
+  }
+
+  @override
+  bool operator==(other) {
+    if (other is AnalysisSetPriorityFilesResult) {
+      return true;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    return 330050055;
+  }
+}
+
+/**
+ * analysis.setSubscriptions params
+ *
+ * {
+ *   "subscriptions": Map<AnalysisService, List<FilePath>>
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class AnalysisSetSubscriptionsParams implements HasToJson {
+  Map<AnalysisService, List<String>> _subscriptions;
+
+  /**
+   * A table mapping services to a list of the files being subscribed to the
+   * service.
+   */
+  Map<AnalysisService, List<String>> get subscriptions => _subscriptions;
+
+  /**
+   * A table mapping services to a list of the files being subscribed to the
+   * service.
+   */
+  void set subscriptions(Map<AnalysisService, List<String>> value) {
+    assert(value != null);
+    this._subscriptions = value;
+  }
+
+  AnalysisSetSubscriptionsParams(Map<AnalysisService, List<String>> subscriptions) {
+    this.subscriptions = subscriptions;
+  }
+
+  factory AnalysisSetSubscriptionsParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      Map<AnalysisService, List<String>> subscriptions;
+      if (json.containsKey("subscriptions")) {
+        subscriptions = jsonDecoder.decodeMap(jsonPath + ".subscriptions", json["subscriptions"], keyDecoder: (String jsonPath, Object json) => new AnalysisService.fromJson(jsonDecoder, jsonPath, json), valueDecoder: (String jsonPath, Object json) => jsonDecoder.decodeList(jsonPath, json, jsonDecoder.decodeString));
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "subscriptions");
+      }
+      return new AnalysisSetSubscriptionsParams(subscriptions);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "analysis.setSubscriptions params", json);
+    }
+  }
+
+  factory AnalysisSetSubscriptionsParams.fromRequest(Request request) {
+    return new AnalysisSetSubscriptionsParams.fromJson(
+        new RequestDecoder(request), "params", request._params);
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["subscriptions"] = mapMap(subscriptions, keyCallback: (AnalysisService value) => value.toJson());
+    return result;
+  }
+
+  Request toRequest(String id) {
+    return new Request(id, "analysis.setSubscriptions", toJson());
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is AnalysisSetSubscriptionsParams) {
+      return mapEqual(subscriptions, other.subscriptions, (List<String> a, List<String> b) => listEqual(a, b, (String a, String b) => a == b));
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, subscriptions.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+/**
+ * analysis.setSubscriptions result
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class AnalysisSetSubscriptionsResult {
+  Response toResponse(String id) {
+    return new Response(id, result: null);
+  }
+
+  @override
+  bool operator==(other) {
+    if (other is AnalysisSetSubscriptionsResult) {
+      return true;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    return 218088493;
+  }
+}
+
+/**
+ * analysis.updateContent params
+ *
+ * {
+ *   "files": Map<FilePath, AddContentOverlay | ChangeContentOverlay | RemoveContentOverlay>
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class AnalysisUpdateContentParams implements HasToJson {
+  Map<String, dynamic> _files;
+
+  /**
+   * A table mapping the files whose content has changed to a description of
+   * the content change.
+   */
+  Map<String, dynamic> get files => _files;
+
+  /**
+   * A table mapping the files whose content has changed to a description of
+   * the content change.
+   */
+  void set files(Map<String, dynamic> value) {
+    assert(value != null);
+    this._files = value;
+  }
+
+  AnalysisUpdateContentParams(Map<String, dynamic> files) {
+    this.files = files;
+  }
+
+  factory AnalysisUpdateContentParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      Map<String, dynamic> files;
+      if (json.containsKey("files")) {
+        files = jsonDecoder.decodeMap(jsonPath + ".files", json["files"], valueDecoder: (String jsonPath, Object json) => jsonDecoder.decodeUnion(jsonPath, json, "type", {"add": (String jsonPath, Object json) => new AddContentOverlay.fromJson(jsonDecoder, jsonPath, json), "change": (String jsonPath, Object json) => new ChangeContentOverlay.fromJson(jsonDecoder, jsonPath, json), "remove": (String jsonPath, Object json) => new RemoveContentOverlay.fromJson(jsonDecoder, jsonPath, json)}));
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "files");
+      }
+      return new AnalysisUpdateContentParams(files);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "analysis.updateContent params", json);
+    }
+  }
+
+  factory AnalysisUpdateContentParams.fromRequest(Request request) {
+    return new AnalysisUpdateContentParams.fromJson(
+        new RequestDecoder(request), "params", request._params);
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["files"] = mapMap(files, valueCallback: (dynamic value) => value.toJson());
+    return result;
+  }
+
+  Request toRequest(String id) {
+    return new Request(id, "analysis.updateContent", toJson());
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is AnalysisUpdateContentParams) {
+      return mapEqual(files, other.files, (dynamic a, dynamic b) => a == b);
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, files.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * analysis.updateContent result
+ *
+ * {
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class AnalysisUpdateContentResult implements HasToJson {
+  AnalysisUpdateContentResult();
+
+  factory AnalysisUpdateContentResult.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      return new AnalysisUpdateContentResult();
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "analysis.updateContent result", json);
+    }
+  }
+
+  factory AnalysisUpdateContentResult.fromResponse(Response response) {
+    return new AnalysisUpdateContentResult.fromJson(
+        new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), "result", response._result);
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    return result;
+  }
+
+  Response toResponse(String id) {
+    return new Response(id, result: toJson());
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is AnalysisUpdateContentResult) {
+      return true;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * analysis.updateOptions params
+ *
+ * {
+ *   "options": AnalysisOptions
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class AnalysisUpdateOptionsParams implements HasToJson {
+  AnalysisOptions _options;
+
+  /**
+   * The options that are to be used to control analysis.
+   */
+  AnalysisOptions get options => _options;
+
+  /**
+   * The options that are to be used to control analysis.
+   */
+  void set options(AnalysisOptions value) {
+    assert(value != null);
+    this._options = value;
+  }
+
+  AnalysisUpdateOptionsParams(AnalysisOptions options) {
+    this.options = options;
+  }
+
+  factory AnalysisUpdateOptionsParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      AnalysisOptions options;
+      if (json.containsKey("options")) {
+        options = new AnalysisOptions.fromJson(jsonDecoder, jsonPath + ".options", json["options"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "options");
+      }
+      return new AnalysisUpdateOptionsParams(options);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "analysis.updateOptions params", json);
+    }
+  }
+
+  factory AnalysisUpdateOptionsParams.fromRequest(Request request) {
+    return new AnalysisUpdateOptionsParams.fromJson(
+        new RequestDecoder(request), "params", request._params);
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["options"] = options.toJson();
+    return result;
+  }
+
+  Request toRequest(String id) {
+    return new Request(id, "analysis.updateOptions", toJson());
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is AnalysisUpdateOptionsParams) {
+      return options == other.options;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, options.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+/**
+ * analysis.updateOptions result
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class AnalysisUpdateOptionsResult {
+  Response toResponse(String id) {
+    return new Response(id, result: null);
+  }
+
+  @override
+  bool operator==(other) {
+    if (other is AnalysisUpdateOptionsResult) {
+      return true;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    return 179689467;
+  }
+}
+
+/**
+ * analysis.analyzedFiles params
+ *
+ * {
+ *   "directories": List<FilePath>
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class AnalysisAnalyzedFilesParams implements HasToJson {
+  List<String> _directories;
+
+  /**
+   * A list of the paths of the files that are being analyzed.
+   */
+  List<String> get directories => _directories;
+
+  /**
+   * A list of the paths of the files that are being analyzed.
+   */
+  void set directories(List<String> value) {
+    assert(value != null);
+    this._directories = value;
+  }
+
+  AnalysisAnalyzedFilesParams(List<String> directories) {
+    this.directories = directories;
+  }
+
+  factory AnalysisAnalyzedFilesParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      List<String> directories;
+      if (json.containsKey("directories")) {
+        directories = jsonDecoder.decodeList(jsonPath + ".directories", json["directories"], jsonDecoder.decodeString);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "directories");
+      }
+      return new AnalysisAnalyzedFilesParams(directories);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "analysis.analyzedFiles params", json);
+    }
+  }
+
+  factory AnalysisAnalyzedFilesParams.fromNotification(Notification notification) {
+    return new AnalysisAnalyzedFilesParams.fromJson(
+        new ResponseDecoder(null), "params", notification._params);
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["directories"] = directories;
+    return result;
+  }
+
+  Notification toNotification() {
+    return new Notification("analysis.analyzedFiles", toJson());
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is AnalysisAnalyzedFilesParams) {
+      return listEqual(directories, other.directories, (String a, String b) => a == b);
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, directories.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * analysis.errors params
+ *
+ * {
+ *   "file": FilePath
+ *   "errors": List<AnalysisError>
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class AnalysisErrorsParams implements HasToJson {
+  String _file;
+
+  List<AnalysisError> _errors;
+
+  /**
+   * The file containing the errors.
+   */
+  String get file => _file;
+
+  /**
+   * The file containing the errors.
+   */
+  void set file(String value) {
+    assert(value != null);
+    this._file = value;
+  }
+
+  /**
+   * The errors contained in the file.
+   */
+  List<AnalysisError> get errors => _errors;
+
+  /**
+   * The errors contained in the file.
+   */
+  void set errors(List<AnalysisError> value) {
+    assert(value != null);
+    this._errors = value;
+  }
+
+  AnalysisErrorsParams(String file, List<AnalysisError> errors) {
+    this.file = file;
+    this.errors = errors;
+  }
+
+  factory AnalysisErrorsParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      String file;
+      if (json.containsKey("file")) {
+        file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "file");
+      }
+      List<AnalysisError> errors;
+      if (json.containsKey("errors")) {
+        errors = jsonDecoder.decodeList(jsonPath + ".errors", json["errors"], (String jsonPath, Object json) => new AnalysisError.fromJson(jsonDecoder, jsonPath, json));
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "errors");
+      }
+      return new AnalysisErrorsParams(file, errors);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "analysis.errors params", json);
+    }
+  }
+
+  factory AnalysisErrorsParams.fromNotification(Notification notification) {
+    return new AnalysisErrorsParams.fromJson(
+        new ResponseDecoder(null), "params", notification._params);
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["file"] = file;
+    result["errors"] = errors.map((AnalysisError value) => value.toJson()).toList();
+    return result;
+  }
+
+  Notification toNotification() {
+    return new Notification("analysis.errors", toJson());
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is AnalysisErrorsParams) {
+      return file == other.file &&
+          listEqual(errors, other.errors, (AnalysisError a, AnalysisError b) => a == b);
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, file.hashCode);
+    hash = JenkinsSmiHash.combine(hash, errors.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * analysis.flushResults params
+ *
+ * {
+ *   "files": List<FilePath>
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class AnalysisFlushResultsParams implements HasToJson {
+  List<String> _files;
+
+  /**
+   * The files that are no longer being analyzed.
+   */
+  List<String> get files => _files;
+
+  /**
+   * The files that are no longer being analyzed.
+   */
+  void set files(List<String> value) {
+    assert(value != null);
+    this._files = value;
+  }
+
+  AnalysisFlushResultsParams(List<String> files) {
+    this.files = files;
+  }
+
+  factory AnalysisFlushResultsParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      List<String> files;
+      if (json.containsKey("files")) {
+        files = jsonDecoder.decodeList(jsonPath + ".files", json["files"], jsonDecoder.decodeString);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "files");
+      }
+      return new AnalysisFlushResultsParams(files);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "analysis.flushResults params", json);
+    }
+  }
+
+  factory AnalysisFlushResultsParams.fromNotification(Notification notification) {
+    return new AnalysisFlushResultsParams.fromJson(
+        new ResponseDecoder(null), "params", notification._params);
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["files"] = files;
+    return result;
+  }
+
+  Notification toNotification() {
+    return new Notification("analysis.flushResults", toJson());
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is AnalysisFlushResultsParams) {
+      return listEqual(files, other.files, (String a, String b) => a == b);
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, files.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * analysis.folding params
+ *
+ * {
+ *   "file": FilePath
+ *   "regions": List<FoldingRegion>
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class AnalysisFoldingParams implements HasToJson {
+  String _file;
+
+  List<FoldingRegion> _regions;
+
+  /**
+   * The file containing the folding regions.
+   */
+  String get file => _file;
+
+  /**
+   * The file containing the folding regions.
+   */
+  void set file(String value) {
+    assert(value != null);
+    this._file = value;
+  }
+
+  /**
+   * The folding regions contained in the file.
+   */
+  List<FoldingRegion> get regions => _regions;
+
+  /**
+   * The folding regions contained in the file.
+   */
+  void set regions(List<FoldingRegion> value) {
+    assert(value != null);
+    this._regions = value;
+  }
+
+  AnalysisFoldingParams(String file, List<FoldingRegion> regions) {
+    this.file = file;
+    this.regions = regions;
+  }
+
+  factory AnalysisFoldingParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      String file;
+      if (json.containsKey("file")) {
+        file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "file");
+      }
+      List<FoldingRegion> regions;
+      if (json.containsKey("regions")) {
+        regions = jsonDecoder.decodeList(jsonPath + ".regions", json["regions"], (String jsonPath, Object json) => new FoldingRegion.fromJson(jsonDecoder, jsonPath, json));
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "regions");
+      }
+      return new AnalysisFoldingParams(file, regions);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "analysis.folding params", json);
+    }
+  }
+
+  factory AnalysisFoldingParams.fromNotification(Notification notification) {
+    return new AnalysisFoldingParams.fromJson(
+        new ResponseDecoder(null), "params", notification._params);
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["file"] = file;
+    result["regions"] = regions.map((FoldingRegion value) => value.toJson()).toList();
+    return result;
+  }
+
+  Notification toNotification() {
+    return new Notification("analysis.folding", toJson());
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is AnalysisFoldingParams) {
+      return file == other.file &&
+          listEqual(regions, other.regions, (FoldingRegion a, FoldingRegion b) => a == b);
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, file.hashCode);
+    hash = JenkinsSmiHash.combine(hash, regions.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * analysis.highlights params
+ *
+ * {
+ *   "file": FilePath
+ *   "regions": List<HighlightRegion>
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class AnalysisHighlightsParams implements HasToJson {
+  String _file;
+
+  List<HighlightRegion> _regions;
+
+  /**
+   * The file containing the highlight regions.
+   */
+  String get file => _file;
+
+  /**
+   * The file containing the highlight regions.
+   */
+  void set file(String value) {
+    assert(value != null);
+    this._file = value;
+  }
+
+  /**
+   * The highlight regions contained in the file. Each highlight region
+   * represents a particular syntactic or semantic meaning associated with some
+   * range. Note that the highlight regions that are returned can overlap other
+   * highlight regions if there is more than one meaning associated with a
+   * particular region.
+   */
+  List<HighlightRegion> get regions => _regions;
+
+  /**
+   * The highlight regions contained in the file. Each highlight region
+   * represents a particular syntactic or semantic meaning associated with some
+   * range. Note that the highlight regions that are returned can overlap other
+   * highlight regions if there is more than one meaning associated with a
+   * particular region.
+   */
+  void set regions(List<HighlightRegion> value) {
+    assert(value != null);
+    this._regions = value;
+  }
+
+  AnalysisHighlightsParams(String file, List<HighlightRegion> regions) {
+    this.file = file;
+    this.regions = regions;
+  }
+
+  factory AnalysisHighlightsParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      String file;
+      if (json.containsKey("file")) {
+        file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "file");
+      }
+      List<HighlightRegion> regions;
+      if (json.containsKey("regions")) {
+        regions = jsonDecoder.decodeList(jsonPath + ".regions", json["regions"], (String jsonPath, Object json) => new HighlightRegion.fromJson(jsonDecoder, jsonPath, json));
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "regions");
+      }
+      return new AnalysisHighlightsParams(file, regions);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "analysis.highlights params", json);
+    }
+  }
+
+  factory AnalysisHighlightsParams.fromNotification(Notification notification) {
+    return new AnalysisHighlightsParams.fromJson(
+        new ResponseDecoder(null), "params", notification._params);
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["file"] = file;
+    result["regions"] = regions.map((HighlightRegion value) => value.toJson()).toList();
+    return result;
+  }
+
+  Notification toNotification() {
+    return new Notification("analysis.highlights", toJson());
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is AnalysisHighlightsParams) {
+      return file == other.file &&
+          listEqual(regions, other.regions, (HighlightRegion a, HighlightRegion b) => a == b);
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, file.hashCode);
+    hash = JenkinsSmiHash.combine(hash, regions.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * analysis.implemented params
+ *
+ * {
+ *   "file": FilePath
+ *   "classes": List<ImplementedClass>
+ *   "members": List<ImplementedMember>
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class AnalysisImplementedParams implements HasToJson {
+  String _file;
+
+  List<ImplementedClass> _classes;
+
+  List<ImplementedMember> _members;
+
+  /**
+   * The file with which the implementations are associated.
+   */
+  String get file => _file;
+
+  /**
+   * The file with which the implementations are associated.
+   */
+  void set file(String value) {
+    assert(value != null);
+    this._file = value;
+  }
+
+  /**
+   * The classes defined in the file that are implemented or extended.
+   */
+  List<ImplementedClass> get classes => _classes;
+
+  /**
+   * The classes defined in the file that are implemented or extended.
+   */
+  void set classes(List<ImplementedClass> value) {
+    assert(value != null);
+    this._classes = value;
+  }
+
+  /**
+   * The member defined in the file that are implemented or overridden.
+   */
+  List<ImplementedMember> get members => _members;
+
+  /**
+   * The member defined in the file that are implemented or overridden.
+   */
+  void set members(List<ImplementedMember> value) {
+    assert(value != null);
+    this._members = value;
+  }
+
+  AnalysisImplementedParams(String file, List<ImplementedClass> classes, List<ImplementedMember> members) {
+    this.file = file;
+    this.classes = classes;
+    this.members = members;
+  }
+
+  factory AnalysisImplementedParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      String file;
+      if (json.containsKey("file")) {
+        file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "file");
+      }
+      List<ImplementedClass> classes;
+      if (json.containsKey("classes")) {
+        classes = jsonDecoder.decodeList(jsonPath + ".classes", json["classes"], (String jsonPath, Object json) => new ImplementedClass.fromJson(jsonDecoder, jsonPath, json));
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "classes");
+      }
+      List<ImplementedMember> members;
+      if (json.containsKey("members")) {
+        members = jsonDecoder.decodeList(jsonPath + ".members", json["members"], (String jsonPath, Object json) => new ImplementedMember.fromJson(jsonDecoder, jsonPath, json));
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "members");
+      }
+      return new AnalysisImplementedParams(file, classes, members);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "analysis.implemented params", json);
+    }
+  }
+
+  factory AnalysisImplementedParams.fromNotification(Notification notification) {
+    return new AnalysisImplementedParams.fromJson(
+        new ResponseDecoder(null), "params", notification._params);
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["file"] = file;
+    result["classes"] = classes.map((ImplementedClass value) => value.toJson()).toList();
+    result["members"] = members.map((ImplementedMember value) => value.toJson()).toList();
+    return result;
+  }
+
+  Notification toNotification() {
+    return new Notification("analysis.implemented", toJson());
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is AnalysisImplementedParams) {
+      return file == other.file &&
+          listEqual(classes, other.classes, (ImplementedClass a, ImplementedClass b) => a == b) &&
+          listEqual(members, other.members, (ImplementedMember a, ImplementedMember b) => a == b);
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, file.hashCode);
+    hash = JenkinsSmiHash.combine(hash, classes.hashCode);
+    hash = JenkinsSmiHash.combine(hash, members.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * analysis.invalidate params
+ *
+ * {
+ *   "file": FilePath
+ *   "offset": int
+ *   "length": int
+ *   "delta": int
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class AnalysisInvalidateParams implements HasToJson {
+  String _file;
+
+  int _offset;
+
+  int _length;
+
+  int _delta;
+
+  /**
+   * The file whose information has been invalidated.
+   */
+  String get file => _file;
+
+  /**
+   * The file whose information has been invalidated.
+   */
+  void set file(String value) {
+    assert(value != null);
+    this._file = value;
+  }
+
+  /**
+   * The offset of the invalidated region.
+   */
+  int get offset => _offset;
+
+  /**
+   * The offset of the invalidated region.
+   */
+  void set offset(int value) {
+    assert(value != null);
+    this._offset = value;
+  }
+
+  /**
+   * The length of the invalidated region.
+   */
+  int get length => _length;
+
+  /**
+   * The length of the invalidated region.
+   */
+  void set length(int value) {
+    assert(value != null);
+    this._length = value;
+  }
+
+  /**
+   * The delta to be applied to the offsets in information that follows the
+   * invalidated region in order to update it so that it doesn't need to be
+   * re-requested.
+   */
+  int get delta => _delta;
+
+  /**
+   * The delta to be applied to the offsets in information that follows the
+   * invalidated region in order to update it so that it doesn't need to be
+   * re-requested.
+   */
+  void set delta(int value) {
+    assert(value != null);
+    this._delta = value;
+  }
+
+  AnalysisInvalidateParams(String file, int offset, int length, int delta) {
+    this.file = file;
+    this.offset = offset;
+    this.length = length;
+    this.delta = delta;
+  }
+
+  factory AnalysisInvalidateParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      String file;
+      if (json.containsKey("file")) {
+        file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "file");
+      }
+      int offset;
+      if (json.containsKey("offset")) {
+        offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "offset");
+      }
+      int length;
+      if (json.containsKey("length")) {
+        length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "length");
+      }
+      int delta;
+      if (json.containsKey("delta")) {
+        delta = jsonDecoder.decodeInt(jsonPath + ".delta", json["delta"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "delta");
+      }
+      return new AnalysisInvalidateParams(file, offset, length, delta);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "analysis.invalidate params", json);
+    }
+  }
+
+  factory AnalysisInvalidateParams.fromNotification(Notification notification) {
+    return new AnalysisInvalidateParams.fromJson(
+        new ResponseDecoder(null), "params", notification._params);
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["file"] = file;
+    result["offset"] = offset;
+    result["length"] = length;
+    result["delta"] = delta;
+    return result;
+  }
+
+  Notification toNotification() {
+    return new Notification("analysis.invalidate", toJson());
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is AnalysisInvalidateParams) {
+      return file == other.file &&
+          offset == other.offset &&
+          length == other.length &&
+          delta == other.delta;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, file.hashCode);
+    hash = JenkinsSmiHash.combine(hash, offset.hashCode);
+    hash = JenkinsSmiHash.combine(hash, length.hashCode);
+    hash = JenkinsSmiHash.combine(hash, delta.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * analysis.navigation params
+ *
+ * {
+ *   "file": FilePath
+ *   "regions": List<NavigationRegion>
+ *   "targets": List<NavigationTarget>
+ *   "files": List<FilePath>
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class AnalysisNavigationParams implements HasToJson {
+  String _file;
+
+  List<NavigationRegion> _regions;
+
+  List<NavigationTarget> _targets;
+
+  List<String> _files;
+
+  /**
+   * The file containing the navigation regions.
+   */
+  String get file => _file;
+
+  /**
+   * The file containing the navigation regions.
+   */
+  void set file(String value) {
+    assert(value != null);
+    this._file = value;
+  }
+
+  /**
+   * The navigation regions contained in the file. The regions are sorted by
+   * their offsets. Each navigation region represents a list of targets
+   * associated with some range. The lists will usually contain a single
+   * target, but can contain more in the case of a part that is included in
+   * multiple libraries or in Dart code that is compiled against multiple
+   * versions of a package. Note that the navigation regions that are returned
+   * do not overlap other navigation regions.
+   */
+  List<NavigationRegion> get regions => _regions;
+
+  /**
+   * The navigation regions contained in the file. The regions are sorted by
+   * their offsets. Each navigation region represents a list of targets
+   * associated with some range. The lists will usually contain a single
+   * target, but can contain more in the case of a part that is included in
+   * multiple libraries or in Dart code that is compiled against multiple
+   * versions of a package. Note that the navigation regions that are returned
+   * do not overlap other navigation regions.
+   */
+  void set regions(List<NavigationRegion> value) {
+    assert(value != null);
+    this._regions = value;
+  }
+
+  /**
+   * The navigation targets referenced in the file. They are referenced by
+   * NavigationRegions by their index in this array.
+   */
+  List<NavigationTarget> get targets => _targets;
+
+  /**
+   * The navigation targets referenced in the file. They are referenced by
+   * NavigationRegions by their index in this array.
+   */
+  void set targets(List<NavigationTarget> value) {
+    assert(value != null);
+    this._targets = value;
+  }
+
+  /**
+   * The files containing navigation targets referenced in the file. They are
+   * referenced by NavigationTargets by their index in this array.
+   */
+  List<String> get files => _files;
+
+  /**
+   * The files containing navigation targets referenced in the file. They are
+   * referenced by NavigationTargets by their index in this array.
+   */
+  void set files(List<String> value) {
+    assert(value != null);
+    this._files = value;
+  }
+
+  AnalysisNavigationParams(String file, List<NavigationRegion> regions, List<NavigationTarget> targets, List<String> files) {
+    this.file = file;
+    this.regions = regions;
+    this.targets = targets;
+    this.files = files;
+  }
+
+  factory AnalysisNavigationParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      String file;
+      if (json.containsKey("file")) {
+        file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "file");
+      }
+      List<NavigationRegion> regions;
+      if (json.containsKey("regions")) {
+        regions = jsonDecoder.decodeList(jsonPath + ".regions", json["regions"], (String jsonPath, Object json) => new NavigationRegion.fromJson(jsonDecoder, jsonPath, json));
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "regions");
+      }
+      List<NavigationTarget> targets;
+      if (json.containsKey("targets")) {
+        targets = jsonDecoder.decodeList(jsonPath + ".targets", json["targets"], (String jsonPath, Object json) => new NavigationTarget.fromJson(jsonDecoder, jsonPath, json));
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "targets");
+      }
+      List<String> files;
+      if (json.containsKey("files")) {
+        files = jsonDecoder.decodeList(jsonPath + ".files", json["files"], jsonDecoder.decodeString);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "files");
+      }
+      return new AnalysisNavigationParams(file, regions, targets, files);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "analysis.navigation params", json);
+    }
+  }
+
+  factory AnalysisNavigationParams.fromNotification(Notification notification) {
+    return new AnalysisNavigationParams.fromJson(
+        new ResponseDecoder(null), "params", notification._params);
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["file"] = file;
+    result["regions"] = regions.map((NavigationRegion value) => value.toJson()).toList();
+    result["targets"] = targets.map((NavigationTarget value) => value.toJson()).toList();
+    result["files"] = files;
+    return result;
+  }
+
+  Notification toNotification() {
+    return new Notification("analysis.navigation", toJson());
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is AnalysisNavigationParams) {
+      return file == other.file &&
+          listEqual(regions, other.regions, (NavigationRegion a, NavigationRegion b) => a == b) &&
+          listEqual(targets, other.targets, (NavigationTarget a, NavigationTarget b) => a == b) &&
+          listEqual(files, other.files, (String a, String b) => a == b);
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, file.hashCode);
+    hash = JenkinsSmiHash.combine(hash, regions.hashCode);
+    hash = JenkinsSmiHash.combine(hash, targets.hashCode);
+    hash = JenkinsSmiHash.combine(hash, files.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * analysis.occurrences params
+ *
+ * {
+ *   "file": FilePath
+ *   "occurrences": List<Occurrences>
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class AnalysisOccurrencesParams implements HasToJson {
+  String _file;
+
+  List<Occurrences> _occurrences;
+
+  /**
+   * The file in which the references occur.
+   */
+  String get file => _file;
+
+  /**
+   * The file in which the references occur.
+   */
+  void set file(String value) {
+    assert(value != null);
+    this._file = value;
+  }
+
+  /**
+   * The occurrences of references to elements within the file.
+   */
+  List<Occurrences> get occurrences => _occurrences;
+
+  /**
+   * The occurrences of references to elements within the file.
+   */
+  void set occurrences(List<Occurrences> value) {
+    assert(value != null);
+    this._occurrences = value;
+  }
+
+  AnalysisOccurrencesParams(String file, List<Occurrences> occurrences) {
+    this.file = file;
+    this.occurrences = occurrences;
+  }
+
+  factory AnalysisOccurrencesParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      String file;
+      if (json.containsKey("file")) {
+        file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "file");
+      }
+      List<Occurrences> occurrences;
+      if (json.containsKey("occurrences")) {
+        occurrences = jsonDecoder.decodeList(jsonPath + ".occurrences", json["occurrences"], (String jsonPath, Object json) => new Occurrences.fromJson(jsonDecoder, jsonPath, json));
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "occurrences");
+      }
+      return new AnalysisOccurrencesParams(file, occurrences);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "analysis.occurrences params", json);
+    }
+  }
+
+  factory AnalysisOccurrencesParams.fromNotification(Notification notification) {
+    return new AnalysisOccurrencesParams.fromJson(
+        new ResponseDecoder(null), "params", notification._params);
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["file"] = file;
+    result["occurrences"] = occurrences.map((Occurrences value) => value.toJson()).toList();
+    return result;
+  }
+
+  Notification toNotification() {
+    return new Notification("analysis.occurrences", toJson());
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is AnalysisOccurrencesParams) {
+      return file == other.file &&
+          listEqual(occurrences, other.occurrences, (Occurrences a, Occurrences b) => a == b);
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, file.hashCode);
+    hash = JenkinsSmiHash.combine(hash, occurrences.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * analysis.outline params
+ *
+ * {
+ *   "file": FilePath
+ *   "kind": FileKind
+ *   "libraryName": optional String
+ *   "outline": Outline
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class AnalysisOutlineParams implements HasToJson {
+  String _file;
+
+  FileKind _kind;
+
+  String _libraryName;
+
+  Outline _outline;
+
+  /**
+   * The file with which the outline is associated.
+   */
+  String get file => _file;
+
+  /**
+   * The file with which the outline is associated.
+   */
+  void set file(String value) {
+    assert(value != null);
+    this._file = value;
+  }
+
+  /**
+   * The kind of the file.
+   */
+  FileKind get kind => _kind;
+
+  /**
+   * The kind of the file.
+   */
+  void set kind(FileKind value) {
+    assert(value != null);
+    this._kind = value;
+  }
+
+  /**
+   * The name of the library defined by the file using a "library" directive,
+   * or referenced by a "part of" directive. If both "library" and "part of"
+   * directives are present, then the "library" directive takes precedence.
+   * This field will be omitted if the file has neither "library" nor "part of"
+   * directives.
+   */
+  String get libraryName => _libraryName;
+
+  /**
+   * The name of the library defined by the file using a "library" directive,
+   * or referenced by a "part of" directive. If both "library" and "part of"
+   * directives are present, then the "library" directive takes precedence.
+   * This field will be omitted if the file has neither "library" nor "part of"
+   * directives.
+   */
+  void set libraryName(String value) {
+    this._libraryName = value;
+  }
+
+  /**
+   * The outline associated with the file.
+   */
+  Outline get outline => _outline;
+
+  /**
+   * The outline associated with the file.
+   */
+  void set outline(Outline value) {
+    assert(value != null);
+    this._outline = value;
+  }
+
+  AnalysisOutlineParams(String file, FileKind kind, Outline outline, {String libraryName}) {
+    this.file = file;
+    this.kind = kind;
+    this.libraryName = libraryName;
+    this.outline = outline;
+  }
+
+  factory AnalysisOutlineParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      String file;
+      if (json.containsKey("file")) {
+        file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "file");
+      }
+      FileKind kind;
+      if (json.containsKey("kind")) {
+        kind = new FileKind.fromJson(jsonDecoder, jsonPath + ".kind", json["kind"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "kind");
+      }
+      String libraryName;
+      if (json.containsKey("libraryName")) {
+        libraryName = jsonDecoder.decodeString(jsonPath + ".libraryName", json["libraryName"]);
+      }
+      Outline outline;
+      if (json.containsKey("outline")) {
+        outline = new Outline.fromJson(jsonDecoder, jsonPath + ".outline", json["outline"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "outline");
+      }
+      return new AnalysisOutlineParams(file, kind, outline, libraryName: libraryName);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "analysis.outline params", json);
+    }
+  }
+
+  factory AnalysisOutlineParams.fromNotification(Notification notification) {
+    return new AnalysisOutlineParams.fromJson(
+        new ResponseDecoder(null), "params", notification._params);
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["file"] = file;
+    result["kind"] = kind.toJson();
+    if (libraryName != null) {
+      result["libraryName"] = libraryName;
+    }
+    result["outline"] = outline.toJson();
+    return result;
+  }
+
+  Notification toNotification() {
+    return new Notification("analysis.outline", toJson());
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is AnalysisOutlineParams) {
+      return file == other.file &&
+          kind == other.kind &&
+          libraryName == other.libraryName &&
+          outline == other.outline;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, file.hashCode);
+    hash = JenkinsSmiHash.combine(hash, kind.hashCode);
+    hash = JenkinsSmiHash.combine(hash, libraryName.hashCode);
+    hash = JenkinsSmiHash.combine(hash, outline.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * analysis.overrides params
+ *
+ * {
+ *   "file": FilePath
+ *   "overrides": List<Override>
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class AnalysisOverridesParams implements HasToJson {
+  String _file;
+
+  List<Override> _overrides;
+
+  /**
+   * The file with which the overrides are associated.
+   */
+  String get file => _file;
+
+  /**
+   * The file with which the overrides are associated.
+   */
+  void set file(String value) {
+    assert(value != null);
+    this._file = value;
+  }
+
+  /**
+   * The overrides associated with the file.
+   */
+  List<Override> get overrides => _overrides;
+
+  /**
+   * The overrides associated with the file.
+   */
+  void set overrides(List<Override> value) {
+    assert(value != null);
+    this._overrides = value;
+  }
+
+  AnalysisOverridesParams(String file, List<Override> overrides) {
+    this.file = file;
+    this.overrides = overrides;
+  }
+
+  factory AnalysisOverridesParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      String file;
+      if (json.containsKey("file")) {
+        file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "file");
+      }
+      List<Override> overrides;
+      if (json.containsKey("overrides")) {
+        overrides = jsonDecoder.decodeList(jsonPath + ".overrides", json["overrides"], (String jsonPath, Object json) => new Override.fromJson(jsonDecoder, jsonPath, json));
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "overrides");
+      }
+      return new AnalysisOverridesParams(file, overrides);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "analysis.overrides params", json);
+    }
+  }
+
+  factory AnalysisOverridesParams.fromNotification(Notification notification) {
+    return new AnalysisOverridesParams.fromJson(
+        new ResponseDecoder(null), "params", notification._params);
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["file"] = file;
+    result["overrides"] = overrides.map((Override value) => value.toJson()).toList();
+    return result;
+  }
+
+  Notification toNotification() {
+    return new Notification("analysis.overrides", toJson());
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is AnalysisOverridesParams) {
+      return file == other.file &&
+          listEqual(overrides, other.overrides, (Override a, Override b) => a == b);
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, file.hashCode);
+    hash = JenkinsSmiHash.combine(hash, overrides.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * completion.getSuggestions params
+ *
+ * {
+ *   "file": FilePath
+ *   "offset": int
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class CompletionGetSuggestionsParams implements HasToJson {
+  String _file;
+
+  int _offset;
+
+  /**
+   * The file containing the point at which suggestions are to be made.
+   */
+  String get file => _file;
+
+  /**
+   * The file containing the point at which suggestions are to be made.
+   */
+  void set file(String value) {
+    assert(value != null);
+    this._file = value;
+  }
+
+  /**
+   * The offset within the file at which suggestions are to be made.
+   */
+  int get offset => _offset;
+
+  /**
+   * The offset within the file at which suggestions are to be made.
+   */
+  void set offset(int value) {
+    assert(value != null);
+    this._offset = value;
+  }
+
+  CompletionGetSuggestionsParams(String file, int offset) {
+    this.file = file;
+    this.offset = offset;
+  }
+
+  factory CompletionGetSuggestionsParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      String file;
+      if (json.containsKey("file")) {
+        file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "file");
+      }
+      int offset;
+      if (json.containsKey("offset")) {
+        offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "offset");
+      }
+      return new CompletionGetSuggestionsParams(file, offset);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "completion.getSuggestions params", json);
+    }
+  }
+
+  factory CompletionGetSuggestionsParams.fromRequest(Request request) {
+    return new CompletionGetSuggestionsParams.fromJson(
+        new RequestDecoder(request), "params", request._params);
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["file"] = file;
+    result["offset"] = offset;
+    return result;
+  }
+
+  Request toRequest(String id) {
+    return new Request(id, "completion.getSuggestions", toJson());
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is CompletionGetSuggestionsParams) {
+      return file == other.file &&
+          offset == other.offset;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, file.hashCode);
+    hash = JenkinsSmiHash.combine(hash, offset.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * completion.getSuggestions result
+ *
+ * {
+ *   "id": CompletionId
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class CompletionGetSuggestionsResult implements HasToJson {
+  String _id;
+
+  /**
+   * The identifier used to associate results with this completion request.
+   */
+  String get id => _id;
+
+  /**
+   * The identifier used to associate results with this completion request.
+   */
+  void set id(String value) {
+    assert(value != null);
+    this._id = value;
+  }
+
+  CompletionGetSuggestionsResult(String id) {
+    this.id = id;
+  }
+
+  factory CompletionGetSuggestionsResult.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      String id;
+      if (json.containsKey("id")) {
+        id = jsonDecoder.decodeString(jsonPath + ".id", json["id"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "id");
+      }
+      return new CompletionGetSuggestionsResult(id);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "completion.getSuggestions result", json);
+    }
+  }
+
+  factory CompletionGetSuggestionsResult.fromResponse(Response response) {
+    return new CompletionGetSuggestionsResult.fromJson(
+        new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), "result", response._result);
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["id"] = id;
+    return result;
+  }
+
+  Response toResponse(String id) {
+    return new Response(id, result: toJson());
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is CompletionGetSuggestionsResult) {
+      return id == other.id;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, id.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * completion.results params
+ *
+ * {
+ *   "id": CompletionId
+ *   "replacementOffset": int
+ *   "replacementLength": int
+ *   "results": List<CompletionSuggestion>
+ *   "isLast": bool
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class CompletionResultsParams implements HasToJson {
+  String _id;
+
+  int _replacementOffset;
+
+  int _replacementLength;
+
+  List<CompletionSuggestion> _results;
+
+  bool _isLast;
+
+  /**
+   * The id associated with the completion.
+   */
+  String get id => _id;
+
+  /**
+   * The id associated with the completion.
+   */
+  void set id(String value) {
+    assert(value != null);
+    this._id = value;
+  }
+
+  /**
+   * The offset of the start of the text to be replaced. This will be different
+   * than the offset used to request the completion suggestions if there was a
+   * portion of an identifier before the original offset. In particular, the
+   * replacementOffset will be the offset of the beginning of said identifier.
+   */
+  int get replacementOffset => _replacementOffset;
+
+  /**
+   * The offset of the start of the text to be replaced. This will be different
+   * than the offset used to request the completion suggestions if there was a
+   * portion of an identifier before the original offset. In particular, the
+   * replacementOffset will be the offset of the beginning of said identifier.
+   */
+  void set replacementOffset(int value) {
+    assert(value != null);
+    this._replacementOffset = value;
+  }
+
+  /**
+   * The length of the text to be replaced if the remainder of the identifier
+   * containing the cursor is to be replaced when the suggestion is applied
+   * (that is, the number of characters in the existing identifier).
+   */
+  int get replacementLength => _replacementLength;
+
+  /**
+   * The length of the text to be replaced if the remainder of the identifier
+   * containing the cursor is to be replaced when the suggestion is applied
+   * (that is, the number of characters in the existing identifier).
+   */
+  void set replacementLength(int value) {
+    assert(value != null);
+    this._replacementLength = value;
+  }
+
+  /**
+   * The completion suggestions being reported. The notification contains all
+   * possible completions at the requested cursor position, even those that do
+   * not match the characters the user has already typed. This allows the
+   * client to respond to further keystrokes from the user without having to
+   * make additional requests.
+   */
+  List<CompletionSuggestion> get results => _results;
+
+  /**
+   * The completion suggestions being reported. The notification contains all
+   * possible completions at the requested cursor position, even those that do
+   * not match the characters the user has already typed. This allows the
+   * client to respond to further keystrokes from the user without having to
+   * make additional requests.
+   */
+  void set results(List<CompletionSuggestion> value) {
+    assert(value != null);
+    this._results = value;
+  }
+
+  /**
+   * True if this is that last set of results that will be returned for the
+   * indicated completion.
+   */
+  bool get isLast => _isLast;
+
+  /**
+   * True if this is that last set of results that will be returned for the
+   * indicated completion.
+   */
+  void set isLast(bool value) {
+    assert(value != null);
+    this._isLast = value;
+  }
+
+  CompletionResultsParams(String id, int replacementOffset, int replacementLength, List<CompletionSuggestion> results, bool isLast) {
+    this.id = id;
+    this.replacementOffset = replacementOffset;
+    this.replacementLength = replacementLength;
+    this.results = results;
+    this.isLast = isLast;
+  }
+
+  factory CompletionResultsParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      String id;
+      if (json.containsKey("id")) {
+        id = jsonDecoder.decodeString(jsonPath + ".id", json["id"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "id");
+      }
+      int replacementOffset;
+      if (json.containsKey("replacementOffset")) {
+        replacementOffset = jsonDecoder.decodeInt(jsonPath + ".replacementOffset", json["replacementOffset"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "replacementOffset");
+      }
+      int replacementLength;
+      if (json.containsKey("replacementLength")) {
+        replacementLength = jsonDecoder.decodeInt(jsonPath + ".replacementLength", json["replacementLength"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "replacementLength");
+      }
+      List<CompletionSuggestion> results;
+      if (json.containsKey("results")) {
+        results = jsonDecoder.decodeList(jsonPath + ".results", json["results"], (String jsonPath, Object json) => new CompletionSuggestion.fromJson(jsonDecoder, jsonPath, json));
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "results");
+      }
+      bool isLast;
+      if (json.containsKey("isLast")) {
+        isLast = jsonDecoder.decodeBool(jsonPath + ".isLast", json["isLast"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "isLast");
+      }
+      return new CompletionResultsParams(id, replacementOffset, replacementLength, results, isLast);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "completion.results params", json);
+    }
+  }
+
+  factory CompletionResultsParams.fromNotification(Notification notification) {
+    return new CompletionResultsParams.fromJson(
+        new ResponseDecoder(null), "params", notification._params);
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["id"] = id;
+    result["replacementOffset"] = replacementOffset;
+    result["replacementLength"] = replacementLength;
+    result["results"] = results.map((CompletionSuggestion value) => value.toJson()).toList();
+    result["isLast"] = isLast;
+    return result;
+  }
+
+  Notification toNotification() {
+    return new Notification("completion.results", toJson());
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is CompletionResultsParams) {
+      return id == other.id &&
+          replacementOffset == other.replacementOffset &&
+          replacementLength == other.replacementLength &&
+          listEqual(results, other.results, (CompletionSuggestion a, CompletionSuggestion b) => a == b) &&
+          isLast == other.isLast;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, id.hashCode);
+    hash = JenkinsSmiHash.combine(hash, replacementOffset.hashCode);
+    hash = JenkinsSmiHash.combine(hash, replacementLength.hashCode);
+    hash = JenkinsSmiHash.combine(hash, results.hashCode);
+    hash = JenkinsSmiHash.combine(hash, isLast.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * search.findElementReferences params
+ *
+ * {
+ *   "file": FilePath
+ *   "offset": int
+ *   "includePotential": bool
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class SearchFindElementReferencesParams implements HasToJson {
+  String _file;
+
+  int _offset;
+
+  bool _includePotential;
+
+  /**
+   * The file containing the declaration of or reference to the element used to
+   * define the search.
+   */
+  String get file => _file;
+
+  /**
+   * The file containing the declaration of or reference to the element used to
+   * define the search.
+   */
+  void set file(String value) {
+    assert(value != null);
+    this._file = value;
+  }
+
+  /**
+   * The offset within the file of the declaration of or reference to the
+   * element.
+   */
+  int get offset => _offset;
+
+  /**
+   * The offset within the file of the declaration of or reference to the
+   * element.
+   */
+  void set offset(int value) {
+    assert(value != null);
+    this._offset = value;
+  }
+
+  /**
+   * True if potential matches are to be included in the results.
+   */
+  bool get includePotential => _includePotential;
+
+  /**
+   * True if potential matches are to be included in the results.
+   */
+  void set includePotential(bool value) {
+    assert(value != null);
+    this._includePotential = value;
+  }
+
+  SearchFindElementReferencesParams(String file, int offset, bool includePotential) {
+    this.file = file;
+    this.offset = offset;
+    this.includePotential = includePotential;
+  }
+
+  factory SearchFindElementReferencesParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      String file;
+      if (json.containsKey("file")) {
+        file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "file");
+      }
+      int offset;
+      if (json.containsKey("offset")) {
+        offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "offset");
+      }
+      bool includePotential;
+      if (json.containsKey("includePotential")) {
+        includePotential = jsonDecoder.decodeBool(jsonPath + ".includePotential", json["includePotential"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "includePotential");
+      }
+      return new SearchFindElementReferencesParams(file, offset, includePotential);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "search.findElementReferences params", json);
+    }
+  }
+
+  factory SearchFindElementReferencesParams.fromRequest(Request request) {
+    return new SearchFindElementReferencesParams.fromJson(
+        new RequestDecoder(request), "params", request._params);
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["file"] = file;
+    result["offset"] = offset;
+    result["includePotential"] = includePotential;
+    return result;
+  }
+
+  Request toRequest(String id) {
+    return new Request(id, "search.findElementReferences", toJson());
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is SearchFindElementReferencesParams) {
+      return file == other.file &&
+          offset == other.offset &&
+          includePotential == other.includePotential;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, file.hashCode);
+    hash = JenkinsSmiHash.combine(hash, offset.hashCode);
+    hash = JenkinsSmiHash.combine(hash, includePotential.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * search.findElementReferences result
+ *
+ * {
+ *   "id": optional SearchId
+ *   "element": optional Element
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class SearchFindElementReferencesResult implements HasToJson {
+  String _id;
+
+  Element _element;
+
+  /**
+   * The identifier used to associate results with this search request.
+   *
+   * If no element was found at the given location, this field will be absent,
+   * and no results will be reported via the search.results notification.
+   */
+  String get id => _id;
+
+  /**
+   * The identifier used to associate results with this search request.
+   *
+   * If no element was found at the given location, this field will be absent,
+   * and no results will be reported via the search.results notification.
+   */
+  void set id(String value) {
+    this._id = value;
+  }
+
+  /**
+   * The element referenced or defined at the given offset and whose references
+   * will be returned in the search results.
+   *
+   * If no element was found at the given location, this field will be absent.
+   */
+  Element get element => _element;
+
+  /**
+   * The element referenced or defined at the given offset and whose references
+   * will be returned in the search results.
+   *
+   * If no element was found at the given location, this field will be absent.
+   */
+  void set element(Element value) {
+    this._element = value;
+  }
+
+  SearchFindElementReferencesResult({String id, Element element}) {
+    this.id = id;
+    this.element = element;
+  }
+
+  factory SearchFindElementReferencesResult.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      String id;
+      if (json.containsKey("id")) {
+        id = jsonDecoder.decodeString(jsonPath + ".id", json["id"]);
+      }
+      Element element;
+      if (json.containsKey("element")) {
+        element = new Element.fromJson(jsonDecoder, jsonPath + ".element", json["element"]);
+      }
+      return new SearchFindElementReferencesResult(id: id, element: element);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "search.findElementReferences result", json);
+    }
+  }
+
+  factory SearchFindElementReferencesResult.fromResponse(Response response) {
+    return new SearchFindElementReferencesResult.fromJson(
+        new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), "result", response._result);
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    if (id != null) {
+      result["id"] = id;
+    }
+    if (element != null) {
+      result["element"] = element.toJson();
+    }
+    return result;
+  }
+
+  Response toResponse(String id) {
+    return new Response(id, result: toJson());
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is SearchFindElementReferencesResult) {
+      return id == other.id &&
+          element == other.element;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, id.hashCode);
+    hash = JenkinsSmiHash.combine(hash, element.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * search.findMemberDeclarations params
+ *
+ * {
+ *   "name": String
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class SearchFindMemberDeclarationsParams implements HasToJson {
+  String _name;
+
+  /**
+   * The name of the declarations to be found.
+   */
+  String get name => _name;
+
+  /**
+   * The name of the declarations to be found.
+   */
+  void set name(String value) {
+    assert(value != null);
+    this._name = value;
+  }
+
+  SearchFindMemberDeclarationsParams(String name) {
+    this.name = name;
+  }
+
+  factory SearchFindMemberDeclarationsParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      String name;
+      if (json.containsKey("name")) {
+        name = jsonDecoder.decodeString(jsonPath + ".name", json["name"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "name");
+      }
+      return new SearchFindMemberDeclarationsParams(name);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "search.findMemberDeclarations params", json);
+    }
+  }
+
+  factory SearchFindMemberDeclarationsParams.fromRequest(Request request) {
+    return new SearchFindMemberDeclarationsParams.fromJson(
+        new RequestDecoder(request), "params", request._params);
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["name"] = name;
+    return result;
+  }
+
+  Request toRequest(String id) {
+    return new Request(id, "search.findMemberDeclarations", toJson());
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is SearchFindMemberDeclarationsParams) {
+      return name == other.name;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, name.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * search.findMemberDeclarations result
+ *
+ * {
+ *   "id": SearchId
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class SearchFindMemberDeclarationsResult implements HasToJson {
+  String _id;
+
+  /**
+   * The identifier used to associate results with this search request.
+   */
+  String get id => _id;
+
+  /**
+   * The identifier used to associate results with this search request.
+   */
+  void set id(String value) {
+    assert(value != null);
+    this._id = value;
+  }
+
+  SearchFindMemberDeclarationsResult(String id) {
+    this.id = id;
+  }
+
+  factory SearchFindMemberDeclarationsResult.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      String id;
+      if (json.containsKey("id")) {
+        id = jsonDecoder.decodeString(jsonPath + ".id", json["id"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "id");
+      }
+      return new SearchFindMemberDeclarationsResult(id);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "search.findMemberDeclarations result", json);
+    }
+  }
+
+  factory SearchFindMemberDeclarationsResult.fromResponse(Response response) {
+    return new SearchFindMemberDeclarationsResult.fromJson(
+        new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), "result", response._result);
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["id"] = id;
+    return result;
+  }
+
+  Response toResponse(String id) {
+    return new Response(id, result: toJson());
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is SearchFindMemberDeclarationsResult) {
+      return id == other.id;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, id.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * search.findMemberReferences params
+ *
+ * {
+ *   "name": String
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class SearchFindMemberReferencesParams implements HasToJson {
+  String _name;
+
+  /**
+   * The name of the references to be found.
+   */
+  String get name => _name;
+
+  /**
+   * The name of the references to be found.
+   */
+  void set name(String value) {
+    assert(value != null);
+    this._name = value;
+  }
+
+  SearchFindMemberReferencesParams(String name) {
+    this.name = name;
+  }
+
+  factory SearchFindMemberReferencesParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      String name;
+      if (json.containsKey("name")) {
+        name = jsonDecoder.decodeString(jsonPath + ".name", json["name"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "name");
+      }
+      return new SearchFindMemberReferencesParams(name);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "search.findMemberReferences params", json);
+    }
+  }
+
+  factory SearchFindMemberReferencesParams.fromRequest(Request request) {
+    return new SearchFindMemberReferencesParams.fromJson(
+        new RequestDecoder(request), "params", request._params);
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["name"] = name;
+    return result;
+  }
+
+  Request toRequest(String id) {
+    return new Request(id, "search.findMemberReferences", toJson());
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is SearchFindMemberReferencesParams) {
+      return name == other.name;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, name.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * search.findMemberReferences result
+ *
+ * {
+ *   "id": SearchId
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class SearchFindMemberReferencesResult implements HasToJson {
+  String _id;
+
+  /**
+   * The identifier used to associate results with this search request.
+   */
+  String get id => _id;
+
+  /**
+   * The identifier used to associate results with this search request.
+   */
+  void set id(String value) {
+    assert(value != null);
+    this._id = value;
+  }
+
+  SearchFindMemberReferencesResult(String id) {
+    this.id = id;
+  }
+
+  factory SearchFindMemberReferencesResult.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      String id;
+      if (json.containsKey("id")) {
+        id = jsonDecoder.decodeString(jsonPath + ".id", json["id"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "id");
+      }
+      return new SearchFindMemberReferencesResult(id);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "search.findMemberReferences result", json);
+    }
+  }
+
+  factory SearchFindMemberReferencesResult.fromResponse(Response response) {
+    return new SearchFindMemberReferencesResult.fromJson(
+        new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), "result", response._result);
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["id"] = id;
+    return result;
+  }
+
+  Response toResponse(String id) {
+    return new Response(id, result: toJson());
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is SearchFindMemberReferencesResult) {
+      return id == other.id;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, id.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * search.findTopLevelDeclarations params
+ *
+ * {
+ *   "pattern": String
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class SearchFindTopLevelDeclarationsParams implements HasToJson {
+  String _pattern;
+
+  /**
+   * The regular expression used to match the names of the declarations to be
+   * found.
+   */
+  String get pattern => _pattern;
+
+  /**
+   * The regular expression used to match the names of the declarations to be
+   * found.
+   */
+  void set pattern(String value) {
+    assert(value != null);
+    this._pattern = value;
+  }
+
+  SearchFindTopLevelDeclarationsParams(String pattern) {
+    this.pattern = pattern;
+  }
+
+  factory SearchFindTopLevelDeclarationsParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      String pattern;
+      if (json.containsKey("pattern")) {
+        pattern = jsonDecoder.decodeString(jsonPath + ".pattern", json["pattern"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "pattern");
+      }
+      return new SearchFindTopLevelDeclarationsParams(pattern);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "search.findTopLevelDeclarations params", json);
+    }
+  }
+
+  factory SearchFindTopLevelDeclarationsParams.fromRequest(Request request) {
+    return new SearchFindTopLevelDeclarationsParams.fromJson(
+        new RequestDecoder(request), "params", request._params);
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["pattern"] = pattern;
+    return result;
+  }
+
+  Request toRequest(String id) {
+    return new Request(id, "search.findTopLevelDeclarations", toJson());
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is SearchFindTopLevelDeclarationsParams) {
+      return pattern == other.pattern;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, pattern.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * search.findTopLevelDeclarations result
+ *
+ * {
+ *   "id": SearchId
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class SearchFindTopLevelDeclarationsResult implements HasToJson {
+  String _id;
+
+  /**
+   * The identifier used to associate results with this search request.
+   */
+  String get id => _id;
+
+  /**
+   * The identifier used to associate results with this search request.
+   */
+  void set id(String value) {
+    assert(value != null);
+    this._id = value;
+  }
+
+  SearchFindTopLevelDeclarationsResult(String id) {
+    this.id = id;
+  }
+
+  factory SearchFindTopLevelDeclarationsResult.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      String id;
+      if (json.containsKey("id")) {
+        id = jsonDecoder.decodeString(jsonPath + ".id", json["id"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "id");
+      }
+      return new SearchFindTopLevelDeclarationsResult(id);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "search.findTopLevelDeclarations result", json);
+    }
+  }
+
+  factory SearchFindTopLevelDeclarationsResult.fromResponse(Response response) {
+    return new SearchFindTopLevelDeclarationsResult.fromJson(
+        new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), "result", response._result);
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["id"] = id;
+    return result;
+  }
+
+  Response toResponse(String id) {
+    return new Response(id, result: toJson());
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is SearchFindTopLevelDeclarationsResult) {
+      return id == other.id;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, id.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * search.getTypeHierarchy params
+ *
+ * {
+ *   "file": FilePath
+ *   "offset": int
+ *   "superOnly": optional bool
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class SearchGetTypeHierarchyParams implements HasToJson {
+  String _file;
+
+  int _offset;
+
+  bool _superOnly;
+
+  /**
+   * The file containing the declaration or reference to the type for which a
+   * hierarchy is being requested.
+   */
+  String get file => _file;
+
+  /**
+   * The file containing the declaration or reference to the type for which a
+   * hierarchy is being requested.
+   */
+  void set file(String value) {
+    assert(value != null);
+    this._file = value;
+  }
+
+  /**
+   * The offset of the name of the type within the file.
+   */
+  int get offset => _offset;
+
+  /**
+   * The offset of the name of the type within the file.
+   */
+  void set offset(int value) {
+    assert(value != null);
+    this._offset = value;
+  }
+
+  /**
+   * True if the client is only requesting superclasses and interfaces
+   * hierarchy.
+   */
+  bool get superOnly => _superOnly;
+
+  /**
+   * True if the client is only requesting superclasses and interfaces
+   * hierarchy.
+   */
+  void set superOnly(bool value) {
+    this._superOnly = value;
+  }
+
+  SearchGetTypeHierarchyParams(String file, int offset, {bool superOnly}) {
+    this.file = file;
+    this.offset = offset;
+    this.superOnly = superOnly;
+  }
+
+  factory SearchGetTypeHierarchyParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      String file;
+      if (json.containsKey("file")) {
+        file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "file");
+      }
+      int offset;
+      if (json.containsKey("offset")) {
+        offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "offset");
+      }
+      bool superOnly;
+      if (json.containsKey("superOnly")) {
+        superOnly = jsonDecoder.decodeBool(jsonPath + ".superOnly", json["superOnly"]);
+      }
+      return new SearchGetTypeHierarchyParams(file, offset, superOnly: superOnly);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "search.getTypeHierarchy params", json);
+    }
+  }
+
+  factory SearchGetTypeHierarchyParams.fromRequest(Request request) {
+    return new SearchGetTypeHierarchyParams.fromJson(
+        new RequestDecoder(request), "params", request._params);
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["file"] = file;
+    result["offset"] = offset;
+    if (superOnly != null) {
+      result["superOnly"] = superOnly;
+    }
+    return result;
+  }
+
+  Request toRequest(String id) {
+    return new Request(id, "search.getTypeHierarchy", toJson());
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is SearchGetTypeHierarchyParams) {
+      return file == other.file &&
+          offset == other.offset &&
+          superOnly == other.superOnly;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, file.hashCode);
+    hash = JenkinsSmiHash.combine(hash, offset.hashCode);
+    hash = JenkinsSmiHash.combine(hash, superOnly.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * search.getTypeHierarchy result
+ *
+ * {
+ *   "hierarchyItems": optional List<TypeHierarchyItem>
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class SearchGetTypeHierarchyResult implements HasToJson {
+  List<TypeHierarchyItem> _hierarchyItems;
+
+  /**
+   * A list of the types in the requested hierarchy. The first element of the
+   * list is the item representing the type for which the hierarchy was
+   * requested. The index of other elements of the list is unspecified, but
+   * correspond to the integers used to reference supertype and subtype items
+   * within the items.
+   *
+   * This field will be absent if the code at the given file and offset does
+   * not represent a type, or if the file has not been sufficiently analyzed to
+   * allow a type hierarchy to be produced.
+   */
+  List<TypeHierarchyItem> get hierarchyItems => _hierarchyItems;
+
+  /**
+   * A list of the types in the requested hierarchy. The first element of the
+   * list is the item representing the type for which the hierarchy was
+   * requested. The index of other elements of the list is unspecified, but
+   * correspond to the integers used to reference supertype and subtype items
+   * within the items.
+   *
+   * This field will be absent if the code at the given file and offset does
+   * not represent a type, or if the file has not been sufficiently analyzed to
+   * allow a type hierarchy to be produced.
+   */
+  void set hierarchyItems(List<TypeHierarchyItem> value) {
+    this._hierarchyItems = value;
+  }
+
+  SearchGetTypeHierarchyResult({List<TypeHierarchyItem> hierarchyItems}) {
+    this.hierarchyItems = hierarchyItems;
+  }
+
+  factory SearchGetTypeHierarchyResult.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      List<TypeHierarchyItem> hierarchyItems;
+      if (json.containsKey("hierarchyItems")) {
+        hierarchyItems = jsonDecoder.decodeList(jsonPath + ".hierarchyItems", json["hierarchyItems"], (String jsonPath, Object json) => new TypeHierarchyItem.fromJson(jsonDecoder, jsonPath, json));
+      }
+      return new SearchGetTypeHierarchyResult(hierarchyItems: hierarchyItems);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "search.getTypeHierarchy result", json);
+    }
+  }
+
+  factory SearchGetTypeHierarchyResult.fromResponse(Response response) {
+    return new SearchGetTypeHierarchyResult.fromJson(
+        new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), "result", response._result);
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    if (hierarchyItems != null) {
+      result["hierarchyItems"] = hierarchyItems.map((TypeHierarchyItem value) => value.toJson()).toList();
+    }
+    return result;
+  }
+
+  Response toResponse(String id) {
+    return new Response(id, result: toJson());
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is SearchGetTypeHierarchyResult) {
+      return listEqual(hierarchyItems, other.hierarchyItems, (TypeHierarchyItem a, TypeHierarchyItem b) => a == b);
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, hierarchyItems.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * search.results params
+ *
+ * {
+ *   "id": SearchId
+ *   "results": List<SearchResult>
+ *   "isLast": bool
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class SearchResultsParams implements HasToJson {
+  String _id;
+
+  List<SearchResult> _results;
+
+  bool _isLast;
+
+  /**
+   * The id associated with the search.
+   */
+  String get id => _id;
+
+  /**
+   * The id associated with the search.
+   */
+  void set id(String value) {
+    assert(value != null);
+    this._id = value;
+  }
+
+  /**
+   * The search results being reported.
+   */
+  List<SearchResult> get results => _results;
+
+  /**
+   * The search results being reported.
+   */
+  void set results(List<SearchResult> value) {
+    assert(value != null);
+    this._results = value;
+  }
+
+  /**
+   * True if this is that last set of results that will be returned for the
+   * indicated search.
+   */
+  bool get isLast => _isLast;
+
+  /**
+   * True if this is that last set of results that will be returned for the
+   * indicated search.
+   */
+  void set isLast(bool value) {
+    assert(value != null);
+    this._isLast = value;
+  }
+
+  SearchResultsParams(String id, List<SearchResult> results, bool isLast) {
+    this.id = id;
+    this.results = results;
+    this.isLast = isLast;
+  }
+
+  factory SearchResultsParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      String id;
+      if (json.containsKey("id")) {
+        id = jsonDecoder.decodeString(jsonPath + ".id", json["id"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "id");
+      }
+      List<SearchResult> results;
+      if (json.containsKey("results")) {
+        results = jsonDecoder.decodeList(jsonPath + ".results", json["results"], (String jsonPath, Object json) => new SearchResult.fromJson(jsonDecoder, jsonPath, json));
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "results");
+      }
+      bool isLast;
+      if (json.containsKey("isLast")) {
+        isLast = jsonDecoder.decodeBool(jsonPath + ".isLast", json["isLast"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "isLast");
+      }
+      return new SearchResultsParams(id, results, isLast);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "search.results params", json);
+    }
+  }
+
+  factory SearchResultsParams.fromNotification(Notification notification) {
+    return new SearchResultsParams.fromJson(
+        new ResponseDecoder(null), "params", notification._params);
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["id"] = id;
+    result["results"] = results.map((SearchResult value) => value.toJson()).toList();
+    result["isLast"] = isLast;
+    return result;
+  }
+
+  Notification toNotification() {
+    return new Notification("search.results", toJson());
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is SearchResultsParams) {
+      return id == other.id &&
+          listEqual(results, other.results, (SearchResult a, SearchResult b) => a == b) &&
+          isLast == other.isLast;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, id.hashCode);
+    hash = JenkinsSmiHash.combine(hash, results.hashCode);
+    hash = JenkinsSmiHash.combine(hash, isLast.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * edit.format params
+ *
+ * {
+ *   "file": FilePath
+ *   "selectionOffset": int
+ *   "selectionLength": int
+ *   "lineLength": optional int
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class EditFormatParams implements HasToJson {
+  String _file;
+
+  int _selectionOffset;
+
+  int _selectionLength;
+
+  int _lineLength;
+
+  /**
+   * The file containing the code to be formatted.
+   */
+  String get file => _file;
+
+  /**
+   * The file containing the code to be formatted.
+   */
+  void set file(String value) {
+    assert(value != null);
+    this._file = value;
+  }
+
+  /**
+   * The offset of the current selection in the file.
+   */
+  int get selectionOffset => _selectionOffset;
+
+  /**
+   * The offset of the current selection in the file.
+   */
+  void set selectionOffset(int value) {
+    assert(value != null);
+    this._selectionOffset = value;
+  }
+
+  /**
+   * The length of the current selection in the file.
+   */
+  int get selectionLength => _selectionLength;
+
+  /**
+   * The length of the current selection in the file.
+   */
+  void set selectionLength(int value) {
+    assert(value != null);
+    this._selectionLength = value;
+  }
+
+  /**
+   * The line length to be used by the formatter.
+   */
+  int get lineLength => _lineLength;
+
+  /**
+   * The line length to be used by the formatter.
+   */
+  void set lineLength(int value) {
+    this._lineLength = value;
+  }
+
+  EditFormatParams(String file, int selectionOffset, int selectionLength, {int lineLength}) {
+    this.file = file;
+    this.selectionOffset = selectionOffset;
+    this.selectionLength = selectionLength;
+    this.lineLength = lineLength;
+  }
+
+  factory EditFormatParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      String file;
+      if (json.containsKey("file")) {
+        file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "file");
+      }
+      int selectionOffset;
+      if (json.containsKey("selectionOffset")) {
+        selectionOffset = jsonDecoder.decodeInt(jsonPath + ".selectionOffset", json["selectionOffset"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "selectionOffset");
+      }
+      int selectionLength;
+      if (json.containsKey("selectionLength")) {
+        selectionLength = jsonDecoder.decodeInt(jsonPath + ".selectionLength", json["selectionLength"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "selectionLength");
+      }
+      int lineLength;
+      if (json.containsKey("lineLength")) {
+        lineLength = jsonDecoder.decodeInt(jsonPath + ".lineLength", json["lineLength"]);
+      }
+      return new EditFormatParams(file, selectionOffset, selectionLength, lineLength: lineLength);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "edit.format params", json);
+    }
+  }
+
+  factory EditFormatParams.fromRequest(Request request) {
+    return new EditFormatParams.fromJson(
+        new RequestDecoder(request), "params", request._params);
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["file"] = file;
+    result["selectionOffset"] = selectionOffset;
+    result["selectionLength"] = selectionLength;
+    if (lineLength != null) {
+      result["lineLength"] = lineLength;
+    }
+    return result;
+  }
+
+  Request toRequest(String id) {
+    return new Request(id, "edit.format", toJson());
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is EditFormatParams) {
+      return file == other.file &&
+          selectionOffset == other.selectionOffset &&
+          selectionLength == other.selectionLength &&
+          lineLength == other.lineLength;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, file.hashCode);
+    hash = JenkinsSmiHash.combine(hash, selectionOffset.hashCode);
+    hash = JenkinsSmiHash.combine(hash, selectionLength.hashCode);
+    hash = JenkinsSmiHash.combine(hash, lineLength.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * edit.format result
+ *
+ * {
+ *   "edits": List<SourceEdit>
+ *   "selectionOffset": int
+ *   "selectionLength": int
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class EditFormatResult implements HasToJson {
+  List<SourceEdit> _edits;
+
+  int _selectionOffset;
+
+  int _selectionLength;
+
+  /**
+   * The edit(s) to be applied in order to format the code. The list will be
+   * empty if the code was already formatted (there are no changes).
+   */
+  List<SourceEdit> get edits => _edits;
+
+  /**
+   * The edit(s) to be applied in order to format the code. The list will be
+   * empty if the code was already formatted (there are no changes).
+   */
+  void set edits(List<SourceEdit> value) {
+    assert(value != null);
+    this._edits = value;
+  }
+
+  /**
+   * The offset of the selection after formatting the code.
+   */
+  int get selectionOffset => _selectionOffset;
+
+  /**
+   * The offset of the selection after formatting the code.
+   */
+  void set selectionOffset(int value) {
+    assert(value != null);
+    this._selectionOffset = value;
+  }
+
+  /**
+   * The length of the selection after formatting the code.
+   */
+  int get selectionLength => _selectionLength;
+
+  /**
+   * The length of the selection after formatting the code.
+   */
+  void set selectionLength(int value) {
+    assert(value != null);
+    this._selectionLength = value;
+  }
+
+  EditFormatResult(List<SourceEdit> edits, int selectionOffset, int selectionLength) {
+    this.edits = edits;
+    this.selectionOffset = selectionOffset;
+    this.selectionLength = selectionLength;
+  }
+
+  factory EditFormatResult.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      List<SourceEdit> edits;
+      if (json.containsKey("edits")) {
+        edits = jsonDecoder.decodeList(jsonPath + ".edits", json["edits"], (String jsonPath, Object json) => new SourceEdit.fromJson(jsonDecoder, jsonPath, json));
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "edits");
+      }
+      int selectionOffset;
+      if (json.containsKey("selectionOffset")) {
+        selectionOffset = jsonDecoder.decodeInt(jsonPath + ".selectionOffset", json["selectionOffset"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "selectionOffset");
+      }
+      int selectionLength;
+      if (json.containsKey("selectionLength")) {
+        selectionLength = jsonDecoder.decodeInt(jsonPath + ".selectionLength", json["selectionLength"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "selectionLength");
+      }
+      return new EditFormatResult(edits, selectionOffset, selectionLength);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "edit.format result", json);
+    }
+  }
+
+  factory EditFormatResult.fromResponse(Response response) {
+    return new EditFormatResult.fromJson(
+        new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), "result", response._result);
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["edits"] = edits.map((SourceEdit value) => value.toJson()).toList();
+    result["selectionOffset"] = selectionOffset;
+    result["selectionLength"] = selectionLength;
+    return result;
+  }
+
+  Response toResponse(String id) {
+    return new Response(id, result: toJson());
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is EditFormatResult) {
+      return listEqual(edits, other.edits, (SourceEdit a, SourceEdit b) => a == b) &&
+          selectionOffset == other.selectionOffset &&
+          selectionLength == other.selectionLength;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, edits.hashCode);
+    hash = JenkinsSmiHash.combine(hash, selectionOffset.hashCode);
+    hash = JenkinsSmiHash.combine(hash, selectionLength.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * edit.getAssists params
+ *
+ * {
+ *   "file": FilePath
+ *   "offset": int
+ *   "length": int
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class EditGetAssistsParams implements HasToJson {
+  String _file;
+
+  int _offset;
+
+  int _length;
+
+  /**
+   * The file containing the code for which assists are being requested.
+   */
+  String get file => _file;
+
+  /**
+   * The file containing the code for which assists are being requested.
+   */
+  void set file(String value) {
+    assert(value != null);
+    this._file = value;
+  }
+
+  /**
+   * The offset of the code for which assists are being requested.
+   */
+  int get offset => _offset;
+
+  /**
+   * The offset of the code for which assists are being requested.
+   */
+  void set offset(int value) {
+    assert(value != null);
+    this._offset = value;
+  }
+
+  /**
+   * The length of the code for which assists are being requested.
+   */
+  int get length => _length;
+
+  /**
+   * The length of the code for which assists are being requested.
+   */
+  void set length(int value) {
+    assert(value != null);
+    this._length = value;
+  }
+
+  EditGetAssistsParams(String file, int offset, int length) {
+    this.file = file;
+    this.offset = offset;
+    this.length = length;
+  }
+
+  factory EditGetAssistsParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      String file;
+      if (json.containsKey("file")) {
+        file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "file");
+      }
+      int offset;
+      if (json.containsKey("offset")) {
+        offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "offset");
+      }
+      int length;
+      if (json.containsKey("length")) {
+        length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "length");
+      }
+      return new EditGetAssistsParams(file, offset, length);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "edit.getAssists params", json);
+    }
+  }
+
+  factory EditGetAssistsParams.fromRequest(Request request) {
+    return new EditGetAssistsParams.fromJson(
+        new RequestDecoder(request), "params", request._params);
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["file"] = file;
+    result["offset"] = offset;
+    result["length"] = length;
+    return result;
+  }
+
+  Request toRequest(String id) {
+    return new Request(id, "edit.getAssists", toJson());
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is EditGetAssistsParams) {
+      return file == other.file &&
+          offset == other.offset &&
+          length == other.length;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, file.hashCode);
+    hash = JenkinsSmiHash.combine(hash, offset.hashCode);
+    hash = JenkinsSmiHash.combine(hash, length.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * edit.getAssists result
+ *
+ * {
+ *   "assists": List<SourceChange>
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class EditGetAssistsResult implements HasToJson {
+  List<SourceChange> _assists;
+
+  /**
+   * The assists that are available at the given location.
+   */
+  List<SourceChange> get assists => _assists;
+
+  /**
+   * The assists that are available at the given location.
+   */
+  void set assists(List<SourceChange> value) {
+    assert(value != null);
+    this._assists = value;
+  }
+
+  EditGetAssistsResult(List<SourceChange> assists) {
+    this.assists = assists;
+  }
+
+  factory EditGetAssistsResult.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      List<SourceChange> assists;
+      if (json.containsKey("assists")) {
+        assists = jsonDecoder.decodeList(jsonPath + ".assists", json["assists"], (String jsonPath, Object json) => new SourceChange.fromJson(jsonDecoder, jsonPath, json));
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "assists");
+      }
+      return new EditGetAssistsResult(assists);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "edit.getAssists result", json);
+    }
+  }
+
+  factory EditGetAssistsResult.fromResponse(Response response) {
+    return new EditGetAssistsResult.fromJson(
+        new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), "result", response._result);
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["assists"] = assists.map((SourceChange value) => value.toJson()).toList();
+    return result;
+  }
+
+  Response toResponse(String id) {
+    return new Response(id, result: toJson());
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is EditGetAssistsResult) {
+      return listEqual(assists, other.assists, (SourceChange a, SourceChange b) => a == b);
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, assists.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * edit.getAvailableRefactorings params
+ *
+ * {
+ *   "file": FilePath
+ *   "offset": int
+ *   "length": int
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class EditGetAvailableRefactoringsParams implements HasToJson {
+  String _file;
+
+  int _offset;
+
+  int _length;
+
+  /**
+   * The file containing the code on which the refactoring would be based.
+   */
+  String get file => _file;
+
+  /**
+   * The file containing the code on which the refactoring would be based.
+   */
+  void set file(String value) {
+    assert(value != null);
+    this._file = value;
+  }
+
+  /**
+   * The offset of the code on which the refactoring would be based.
+   */
+  int get offset => _offset;
+
+  /**
+   * The offset of the code on which the refactoring would be based.
+   */
+  void set offset(int value) {
+    assert(value != null);
+    this._offset = value;
+  }
+
+  /**
+   * The length of the code on which the refactoring would be based.
+   */
+  int get length => _length;
+
+  /**
+   * The length of the code on which the refactoring would be based.
+   */
+  void set length(int value) {
+    assert(value != null);
+    this._length = value;
+  }
+
+  EditGetAvailableRefactoringsParams(String file, int offset, int length) {
+    this.file = file;
+    this.offset = offset;
+    this.length = length;
+  }
+
+  factory EditGetAvailableRefactoringsParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      String file;
+      if (json.containsKey("file")) {
+        file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "file");
+      }
+      int offset;
+      if (json.containsKey("offset")) {
+        offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "offset");
+      }
+      int length;
+      if (json.containsKey("length")) {
+        length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "length");
+      }
+      return new EditGetAvailableRefactoringsParams(file, offset, length);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "edit.getAvailableRefactorings params", json);
+    }
+  }
+
+  factory EditGetAvailableRefactoringsParams.fromRequest(Request request) {
+    return new EditGetAvailableRefactoringsParams.fromJson(
+        new RequestDecoder(request), "params", request._params);
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["file"] = file;
+    result["offset"] = offset;
+    result["length"] = length;
+    return result;
+  }
+
+  Request toRequest(String id) {
+    return new Request(id, "edit.getAvailableRefactorings", toJson());
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is EditGetAvailableRefactoringsParams) {
+      return file == other.file &&
+          offset == other.offset &&
+          length == other.length;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, file.hashCode);
+    hash = JenkinsSmiHash.combine(hash, offset.hashCode);
+    hash = JenkinsSmiHash.combine(hash, length.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * edit.getAvailableRefactorings result
+ *
+ * {
+ *   "kinds": List<RefactoringKind>
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class EditGetAvailableRefactoringsResult implements HasToJson {
+  List<RefactoringKind> _kinds;
+
+  /**
+   * The kinds of refactorings that are valid for the given selection.
+   */
+  List<RefactoringKind> get kinds => _kinds;
+
+  /**
+   * The kinds of refactorings that are valid for the given selection.
+   */
+  void set kinds(List<RefactoringKind> value) {
+    assert(value != null);
+    this._kinds = value;
+  }
+
+  EditGetAvailableRefactoringsResult(List<RefactoringKind> kinds) {
+    this.kinds = kinds;
+  }
+
+  factory EditGetAvailableRefactoringsResult.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      List<RefactoringKind> kinds;
+      if (json.containsKey("kinds")) {
+        kinds = jsonDecoder.decodeList(jsonPath + ".kinds", json["kinds"], (String jsonPath, Object json) => new RefactoringKind.fromJson(jsonDecoder, jsonPath, json));
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "kinds");
+      }
+      return new EditGetAvailableRefactoringsResult(kinds);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "edit.getAvailableRefactorings result", json);
+    }
+  }
+
+  factory EditGetAvailableRefactoringsResult.fromResponse(Response response) {
+    return new EditGetAvailableRefactoringsResult.fromJson(
+        new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), "result", response._result);
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["kinds"] = kinds.map((RefactoringKind value) => value.toJson()).toList();
+    return result;
+  }
+
+  Response toResponse(String id) {
+    return new Response(id, result: toJson());
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is EditGetAvailableRefactoringsResult) {
+      return listEqual(kinds, other.kinds, (RefactoringKind a, RefactoringKind b) => a == b);
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, kinds.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * edit.getFixes params
+ *
+ * {
+ *   "file": FilePath
+ *   "offset": int
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class EditGetFixesParams implements HasToJson {
+  String _file;
+
+  int _offset;
+
+  /**
+   * The file containing the errors for which fixes are being requested.
+   */
+  String get file => _file;
+
+  /**
+   * The file containing the errors for which fixes are being requested.
+   */
+  void set file(String value) {
+    assert(value != null);
+    this._file = value;
+  }
+
+  /**
+   * The offset used to select the errors for which fixes will be returned.
+   */
+  int get offset => _offset;
+
+  /**
+   * The offset used to select the errors for which fixes will be returned.
+   */
+  void set offset(int value) {
+    assert(value != null);
+    this._offset = value;
+  }
+
+  EditGetFixesParams(String file, int offset) {
+    this.file = file;
+    this.offset = offset;
+  }
+
+  factory EditGetFixesParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      String file;
+      if (json.containsKey("file")) {
+        file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "file");
+      }
+      int offset;
+      if (json.containsKey("offset")) {
+        offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "offset");
+      }
+      return new EditGetFixesParams(file, offset);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "edit.getFixes params", json);
+    }
+  }
+
+  factory EditGetFixesParams.fromRequest(Request request) {
+    return new EditGetFixesParams.fromJson(
+        new RequestDecoder(request), "params", request._params);
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["file"] = file;
+    result["offset"] = offset;
+    return result;
+  }
+
+  Request toRequest(String id) {
+    return new Request(id, "edit.getFixes", toJson());
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is EditGetFixesParams) {
+      return file == other.file &&
+          offset == other.offset;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, file.hashCode);
+    hash = JenkinsSmiHash.combine(hash, offset.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * edit.getFixes result
+ *
+ * {
+ *   "fixes": List<AnalysisErrorFixes>
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class EditGetFixesResult implements HasToJson {
+  List<AnalysisErrorFixes> _fixes;
+
+  /**
+   * The fixes that are available for the errors at the given offset.
+   */
+  List<AnalysisErrorFixes> get fixes => _fixes;
+
+  /**
+   * The fixes that are available for the errors at the given offset.
+   */
+  void set fixes(List<AnalysisErrorFixes> value) {
+    assert(value != null);
+    this._fixes = value;
+  }
+
+  EditGetFixesResult(List<AnalysisErrorFixes> fixes) {
+    this.fixes = fixes;
+  }
+
+  factory EditGetFixesResult.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      List<AnalysisErrorFixes> fixes;
+      if (json.containsKey("fixes")) {
+        fixes = jsonDecoder.decodeList(jsonPath + ".fixes", json["fixes"], (String jsonPath, Object json) => new AnalysisErrorFixes.fromJson(jsonDecoder, jsonPath, json));
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "fixes");
+      }
+      return new EditGetFixesResult(fixes);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "edit.getFixes result", json);
+    }
+  }
+
+  factory EditGetFixesResult.fromResponse(Response response) {
+    return new EditGetFixesResult.fromJson(
+        new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), "result", response._result);
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["fixes"] = fixes.map((AnalysisErrorFixes value) => value.toJson()).toList();
+    return result;
+  }
+
+  Response toResponse(String id) {
+    return new Response(id, result: toJson());
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is EditGetFixesResult) {
+      return listEqual(fixes, other.fixes, (AnalysisErrorFixes a, AnalysisErrorFixes b) => a == b);
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, fixes.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * edit.getRefactoring params
+ *
+ * {
+ *   "kind": RefactoringKind
+ *   "file": FilePath
+ *   "offset": int
+ *   "length": int
+ *   "validateOnly": bool
+ *   "options": optional RefactoringOptions
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class EditGetRefactoringParams implements HasToJson {
+  RefactoringKind _kind;
+
+  String _file;
+
+  int _offset;
+
+  int _length;
+
+  bool _validateOnly;
+
+  RefactoringOptions _options;
+
+  /**
+   * The kind of refactoring to be performed.
+   */
+  RefactoringKind get kind => _kind;
+
+  /**
+   * The kind of refactoring to be performed.
+   */
+  void set kind(RefactoringKind value) {
+    assert(value != null);
+    this._kind = value;
+  }
+
+  /**
+   * The file containing the code involved in the refactoring.
+   */
+  String get file => _file;
+
+  /**
+   * The file containing the code involved in the refactoring.
+   */
+  void set file(String value) {
+    assert(value != null);
+    this._file = value;
+  }
+
+  /**
+   * The offset of the region involved in the refactoring.
+   */
+  int get offset => _offset;
+
+  /**
+   * The offset of the region involved in the refactoring.
+   */
+  void set offset(int value) {
+    assert(value != null);
+    this._offset = value;
+  }
+
+  /**
+   * The length of the region involved in the refactoring.
+   */
+  int get length => _length;
+
+  /**
+   * The length of the region involved in the refactoring.
+   */
+  void set length(int value) {
+    assert(value != null);
+    this._length = value;
+  }
+
+  /**
+   * True if the client is only requesting that the values of the options be
+   * validated and no change be generated.
+   */
+  bool get validateOnly => _validateOnly;
+
+  /**
+   * True if the client is only requesting that the values of the options be
+   * validated and no change be generated.
+   */
+  void set validateOnly(bool value) {
+    assert(value != null);
+    this._validateOnly = value;
+  }
+
+  /**
+   * Data used to provide values provided by the user. The structure of the
+   * data is dependent on the kind of refactoring being performed. The data
+   * that is expected is documented in the section titled Refactorings, labeled
+   * as “Options”. This field can be omitted if the refactoring does not
+   * require any options or if the values of those options are not known.
+   */
+  RefactoringOptions get options => _options;
+
+  /**
+   * Data used to provide values provided by the user. The structure of the
+   * data is dependent on the kind of refactoring being performed. The data
+   * that is expected is documented in the section titled Refactorings, labeled
+   * as “Options”. This field can be omitted if the refactoring does not
+   * require any options or if the values of those options are not known.
+   */
+  void set options(RefactoringOptions value) {
+    this._options = value;
+  }
+
+  EditGetRefactoringParams(RefactoringKind kind, String file, int offset, int length, bool validateOnly, {RefactoringOptions options}) {
+    this.kind = kind;
+    this.file = file;
+    this.offset = offset;
+    this.length = length;
+    this.validateOnly = validateOnly;
+    this.options = options;
+  }
+
+  factory EditGetRefactoringParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      RefactoringKind kind;
+      if (json.containsKey("kind")) {
+        kind = new RefactoringKind.fromJson(jsonDecoder, jsonPath + ".kind", json["kind"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "kind");
+      }
+      String file;
+      if (json.containsKey("file")) {
+        file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "file");
+      }
+      int offset;
+      if (json.containsKey("offset")) {
+        offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "offset");
+      }
+      int length;
+      if (json.containsKey("length")) {
+        length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "length");
+      }
+      bool validateOnly;
+      if (json.containsKey("validateOnly")) {
+        validateOnly = jsonDecoder.decodeBool(jsonPath + ".validateOnly", json["validateOnly"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "validateOnly");
+      }
+      RefactoringOptions options;
+      if (json.containsKey("options")) {
+        options = new RefactoringOptions.fromJson(jsonDecoder, jsonPath + ".options", json["options"], kind);
+      }
+      return new EditGetRefactoringParams(kind, file, offset, length, validateOnly, options: options);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "edit.getRefactoring params", json);
+    }
+  }
+
+  factory EditGetRefactoringParams.fromRequest(Request request) {
+    var params = new EditGetRefactoringParams.fromJson(
+        new RequestDecoder(request), "params", request._params);
+    REQUEST_ID_REFACTORING_KINDS[request.id] = params.kind;
+    return params;
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["kind"] = kind.toJson();
+    result["file"] = file;
+    result["offset"] = offset;
+    result["length"] = length;
+    result["validateOnly"] = validateOnly;
+    if (options != null) {
+      result["options"] = options.toJson();
+    }
+    return result;
+  }
+
+  Request toRequest(String id) {
+    return new Request(id, "edit.getRefactoring", toJson());
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is EditGetRefactoringParams) {
+      return kind == other.kind &&
+          file == other.file &&
+          offset == other.offset &&
+          length == other.length &&
+          validateOnly == other.validateOnly &&
+          options == other.options;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, kind.hashCode);
+    hash = JenkinsSmiHash.combine(hash, file.hashCode);
+    hash = JenkinsSmiHash.combine(hash, offset.hashCode);
+    hash = JenkinsSmiHash.combine(hash, length.hashCode);
+    hash = JenkinsSmiHash.combine(hash, validateOnly.hashCode);
+    hash = JenkinsSmiHash.combine(hash, options.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * edit.getRefactoring result
+ *
+ * {
+ *   "initialProblems": List<RefactoringProblem>
+ *   "optionsProblems": List<RefactoringProblem>
+ *   "finalProblems": List<RefactoringProblem>
+ *   "feedback": optional RefactoringFeedback
+ *   "change": optional SourceChange
+ *   "potentialEdits": optional List<String>
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class EditGetRefactoringResult implements HasToJson {
+  List<RefactoringProblem> _initialProblems;
+
+  List<RefactoringProblem> _optionsProblems;
+
+  List<RefactoringProblem> _finalProblems;
+
+  RefactoringFeedback _feedback;
+
+  SourceChange _change;
+
+  List<String> _potentialEdits;
+
+  /**
+   * The initial status of the refactoring, i.e. problems related to the
+   * context in which the refactoring is requested. The array will be empty if
+   * there are no known problems.
+   */
+  List<RefactoringProblem> get initialProblems => _initialProblems;
+
+  /**
+   * The initial status of the refactoring, i.e. problems related to the
+   * context in which the refactoring is requested. The array will be empty if
+   * there are no known problems.
+   */
+  void set initialProblems(List<RefactoringProblem> value) {
+    assert(value != null);
+    this._initialProblems = value;
+  }
+
+  /**
+   * The options validation status, i.e. problems in the given options, such as
+   * light-weight validation of a new name, flags compatibility, etc. The array
+   * will be empty if there are no known problems.
+   */
+  List<RefactoringProblem> get optionsProblems => _optionsProblems;
+
+  /**
+   * The options validation status, i.e. problems in the given options, such as
+   * light-weight validation of a new name, flags compatibility, etc. The array
+   * will be empty if there are no known problems.
+   */
+  void set optionsProblems(List<RefactoringProblem> value) {
+    assert(value != null);
+    this._optionsProblems = value;
+  }
+
+  /**
+   * The final status of the refactoring, i.e. problems identified in the
+   * result of a full, potentially expensive validation and / or change
+   * creation. The array will be empty if there are no known problems.
+   */
+  List<RefactoringProblem> get finalProblems => _finalProblems;
+
+  /**
+   * The final status of the refactoring, i.e. problems identified in the
+   * result of a full, potentially expensive validation and / or change
+   * creation. The array will be empty if there are no known problems.
+   */
+  void set finalProblems(List<RefactoringProblem> value) {
+    assert(value != null);
+    this._finalProblems = value;
+  }
+
+  /**
+   * Data used to provide feedback to the user. The structure of the data is
+   * dependent on the kind of refactoring being created. The data that is
+   * returned is documented in the section titled Refactorings, labeled as
+   * “Feedback”.
+   */
+  RefactoringFeedback get feedback => _feedback;
+
+  /**
+   * Data used to provide feedback to the user. The structure of the data is
+   * dependent on the kind of refactoring being created. The data that is
+   * returned is documented in the section titled Refactorings, labeled as
+   * “Feedback”.
+   */
+  void set feedback(RefactoringFeedback value) {
+    this._feedback = value;
+  }
+
+  /**
+   * The changes that are to be applied to affect the refactoring. This field
+   * will be omitted if there are problems that prevent a set of changes from
+   * being computed, such as having no options specified for a refactoring that
+   * requires them, or if only validation was requested.
+   */
+  SourceChange get change => _change;
+
+  /**
+   * The changes that are to be applied to affect the refactoring. This field
+   * will be omitted if there are problems that prevent a set of changes from
+   * being computed, such as having no options specified for a refactoring that
+   * requires them, or if only validation was requested.
+   */
+  void set change(SourceChange value) {
+    this._change = value;
+  }
+
+  /**
+   * The ids of source edits that are not known to be valid. An edit is not
+   * known to be valid if there was insufficient type information for the
+   * server to be able to determine whether or not the code needs to be
+   * modified, such as when a member is being renamed and there is a reference
+   * to a member from an unknown type. This field will be omitted if the change
+   * field is omitted or if there are no potential edits for the refactoring.
+   */
+  List<String> get potentialEdits => _potentialEdits;
+
+  /**
+   * The ids of source edits that are not known to be valid. An edit is not
+   * known to be valid if there was insufficient type information for the
+   * server to be able to determine whether or not the code needs to be
+   * modified, such as when a member is being renamed and there is a reference
+   * to a member from an unknown type. This field will be omitted if the change
+   * field is omitted or if there are no potential edits for the refactoring.
+   */
+  void set potentialEdits(List<String> value) {
+    this._potentialEdits = value;
+  }
+
+  EditGetRefactoringResult(List<RefactoringProblem> initialProblems, List<RefactoringProblem> optionsProblems, List<RefactoringProblem> finalProblems, {RefactoringFeedback feedback, SourceChange change, List<String> potentialEdits}) {
+    this.initialProblems = initialProblems;
+    this.optionsProblems = optionsProblems;
+    this.finalProblems = finalProblems;
+    this.feedback = feedback;
+    this.change = change;
+    this.potentialEdits = potentialEdits;
+  }
+
+  factory EditGetRefactoringResult.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      List<RefactoringProblem> initialProblems;
+      if (json.containsKey("initialProblems")) {
+        initialProblems = jsonDecoder.decodeList(jsonPath + ".initialProblems", json["initialProblems"], (String jsonPath, Object json) => new RefactoringProblem.fromJson(jsonDecoder, jsonPath, json));
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "initialProblems");
+      }
+      List<RefactoringProblem> optionsProblems;
+      if (json.containsKey("optionsProblems")) {
+        optionsProblems = jsonDecoder.decodeList(jsonPath + ".optionsProblems", json["optionsProblems"], (String jsonPath, Object json) => new RefactoringProblem.fromJson(jsonDecoder, jsonPath, json));
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "optionsProblems");
+      }
+      List<RefactoringProblem> finalProblems;
+      if (json.containsKey("finalProblems")) {
+        finalProblems = jsonDecoder.decodeList(jsonPath + ".finalProblems", json["finalProblems"], (String jsonPath, Object json) => new RefactoringProblem.fromJson(jsonDecoder, jsonPath, json));
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "finalProblems");
+      }
+      RefactoringFeedback feedback;
+      if (json.containsKey("feedback")) {
+        feedback = new RefactoringFeedback.fromJson(jsonDecoder, jsonPath + ".feedback", json["feedback"], json);
+      }
+      SourceChange change;
+      if (json.containsKey("change")) {
+        change = new SourceChange.fromJson(jsonDecoder, jsonPath + ".change", json["change"]);
+      }
+      List<String> potentialEdits;
+      if (json.containsKey("potentialEdits")) {
+        potentialEdits = jsonDecoder.decodeList(jsonPath + ".potentialEdits", json["potentialEdits"], jsonDecoder.decodeString);
+      }
+      return new EditGetRefactoringResult(initialProblems, optionsProblems, finalProblems, feedback: feedback, change: change, potentialEdits: potentialEdits);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "edit.getRefactoring result", json);
+    }
+  }
+
+  factory EditGetRefactoringResult.fromResponse(Response response) {
+    return new EditGetRefactoringResult.fromJson(
+        new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), "result", response._result);
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["initialProblems"] = initialProblems.map((RefactoringProblem value) => value.toJson()).toList();
+    result["optionsProblems"] = optionsProblems.map((RefactoringProblem value) => value.toJson()).toList();
+    result["finalProblems"] = finalProblems.map((RefactoringProblem value) => value.toJson()).toList();
+    if (feedback != null) {
+      result["feedback"] = feedback.toJson();
+    }
+    if (change != null) {
+      result["change"] = change.toJson();
+    }
+    if (potentialEdits != null) {
+      result["potentialEdits"] = potentialEdits;
+    }
+    return result;
+  }
+
+  Response toResponse(String id) {
+    return new Response(id, result: toJson());
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is EditGetRefactoringResult) {
+      return listEqual(initialProblems, other.initialProblems, (RefactoringProblem a, RefactoringProblem b) => a == b) &&
+          listEqual(optionsProblems, other.optionsProblems, (RefactoringProblem a, RefactoringProblem b) => a == b) &&
+          listEqual(finalProblems, other.finalProblems, (RefactoringProblem a, RefactoringProblem b) => a == b) &&
+          feedback == other.feedback &&
+          change == other.change &&
+          listEqual(potentialEdits, other.potentialEdits, (String a, String b) => a == b);
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, initialProblems.hashCode);
+    hash = JenkinsSmiHash.combine(hash, optionsProblems.hashCode);
+    hash = JenkinsSmiHash.combine(hash, finalProblems.hashCode);
+    hash = JenkinsSmiHash.combine(hash, feedback.hashCode);
+    hash = JenkinsSmiHash.combine(hash, change.hashCode);
+    hash = JenkinsSmiHash.combine(hash, potentialEdits.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * edit.sortMembers params
+ *
+ * {
+ *   "file": FilePath
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class EditSortMembersParams implements HasToJson {
+  String _file;
+
+  /**
+   * The Dart file to sort.
+   */
+  String get file => _file;
+
+  /**
+   * The Dart file to sort.
+   */
+  void set file(String value) {
+    assert(value != null);
+    this._file = value;
+  }
+
+  EditSortMembersParams(String file) {
+    this.file = file;
+  }
+
+  factory EditSortMembersParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      String file;
+      if (json.containsKey("file")) {
+        file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "file");
+      }
+      return new EditSortMembersParams(file);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "edit.sortMembers params", json);
+    }
+  }
+
+  factory EditSortMembersParams.fromRequest(Request request) {
+    return new EditSortMembersParams.fromJson(
+        new RequestDecoder(request), "params", request._params);
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["file"] = file;
+    return result;
+  }
+
+  Request toRequest(String id) {
+    return new Request(id, "edit.sortMembers", toJson());
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is EditSortMembersParams) {
+      return file == other.file;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, file.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * edit.sortMembers result
+ *
+ * {
+ *   "edit": SourceFileEdit
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class EditSortMembersResult implements HasToJson {
+  SourceFileEdit _edit;
+
+  /**
+   * The file edit that is to be applied to the given file to effect the
+   * sorting.
+   */
+  SourceFileEdit get edit => _edit;
+
+  /**
+   * The file edit that is to be applied to the given file to effect the
+   * sorting.
+   */
+  void set edit(SourceFileEdit value) {
+    assert(value != null);
+    this._edit = value;
+  }
+
+  EditSortMembersResult(SourceFileEdit edit) {
+    this.edit = edit;
+  }
+
+  factory EditSortMembersResult.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      SourceFileEdit edit;
+      if (json.containsKey("edit")) {
+        edit = new SourceFileEdit.fromJson(jsonDecoder, jsonPath + ".edit", json["edit"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "edit");
+      }
+      return new EditSortMembersResult(edit);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "edit.sortMembers result", json);
+    }
+  }
+
+  factory EditSortMembersResult.fromResponse(Response response) {
+    return new EditSortMembersResult.fromJson(
+        new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), "result", response._result);
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["edit"] = edit.toJson();
+    return result;
+  }
+
+  Response toResponse(String id) {
+    return new Response(id, result: toJson());
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is EditSortMembersResult) {
+      return edit == other.edit;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, edit.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * edit.organizeDirectives params
+ *
+ * {
+ *   "file": FilePath
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class EditOrganizeDirectivesParams implements HasToJson {
+  String _file;
+
+  /**
+   * The Dart file to organize directives in.
+   */
+  String get file => _file;
+
+  /**
+   * The Dart file to organize directives in.
+   */
+  void set file(String value) {
+    assert(value != null);
+    this._file = value;
+  }
+
+  EditOrganizeDirectivesParams(String file) {
+    this.file = file;
+  }
+
+  factory EditOrganizeDirectivesParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      String file;
+      if (json.containsKey("file")) {
+        file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "file");
+      }
+      return new EditOrganizeDirectivesParams(file);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "edit.organizeDirectives params", json);
+    }
+  }
+
+  factory EditOrganizeDirectivesParams.fromRequest(Request request) {
+    return new EditOrganizeDirectivesParams.fromJson(
+        new RequestDecoder(request), "params", request._params);
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["file"] = file;
+    return result;
+  }
+
+  Request toRequest(String id) {
+    return new Request(id, "edit.organizeDirectives", toJson());
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is EditOrganizeDirectivesParams) {
+      return file == other.file;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, file.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * edit.organizeDirectives result
+ *
+ * {
+ *   "edit": SourceFileEdit
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class EditOrganizeDirectivesResult implements HasToJson {
+  SourceFileEdit _edit;
+
+  /**
+   * The file edit that is to be applied to the given file to effect the
+   * organizing.
+   */
+  SourceFileEdit get edit => _edit;
+
+  /**
+   * The file edit that is to be applied to the given file to effect the
+   * organizing.
+   */
+  void set edit(SourceFileEdit value) {
+    assert(value != null);
+    this._edit = value;
+  }
+
+  EditOrganizeDirectivesResult(SourceFileEdit edit) {
+    this.edit = edit;
+  }
+
+  factory EditOrganizeDirectivesResult.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      SourceFileEdit edit;
+      if (json.containsKey("edit")) {
+        edit = new SourceFileEdit.fromJson(jsonDecoder, jsonPath + ".edit", json["edit"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "edit");
+      }
+      return new EditOrganizeDirectivesResult(edit);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "edit.organizeDirectives result", json);
+    }
+  }
+
+  factory EditOrganizeDirectivesResult.fromResponse(Response response) {
+    return new EditOrganizeDirectivesResult.fromJson(
+        new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), "result", response._result);
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["edit"] = edit.toJson();
+    return result;
+  }
+
+  Response toResponse(String id) {
+    return new Response(id, result: toJson());
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is EditOrganizeDirectivesResult) {
+      return edit == other.edit;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, edit.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * execution.createContext params
+ *
+ * {
+ *   "contextRoot": FilePath
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class ExecutionCreateContextParams implements HasToJson {
+  String _contextRoot;
+
+  /**
+   * The path of the Dart or HTML file that will be launched, or the path of
+   * the directory containing the file.
+   */
+  String get contextRoot => _contextRoot;
+
+  /**
+   * The path of the Dart or HTML file that will be launched, or the path of
+   * the directory containing the file.
+   */
+  void set contextRoot(String value) {
+    assert(value != null);
+    this._contextRoot = value;
+  }
+
+  ExecutionCreateContextParams(String contextRoot) {
+    this.contextRoot = contextRoot;
+  }
+
+  factory ExecutionCreateContextParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      String contextRoot;
+      if (json.containsKey("contextRoot")) {
+        contextRoot = jsonDecoder.decodeString(jsonPath + ".contextRoot", json["contextRoot"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "contextRoot");
+      }
+      return new ExecutionCreateContextParams(contextRoot);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "execution.createContext params", json);
+    }
+  }
+
+  factory ExecutionCreateContextParams.fromRequest(Request request) {
+    return new ExecutionCreateContextParams.fromJson(
+        new RequestDecoder(request), "params", request._params);
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["contextRoot"] = contextRoot;
+    return result;
+  }
+
+  Request toRequest(String id) {
+    return new Request(id, "execution.createContext", toJson());
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is ExecutionCreateContextParams) {
+      return contextRoot == other.contextRoot;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, contextRoot.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * execution.createContext result
+ *
+ * {
+ *   "id": ExecutionContextId
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class ExecutionCreateContextResult implements HasToJson {
+  String _id;
+
+  /**
+   * The identifier used to refer to the execution context that was created.
+   */
+  String get id => _id;
+
+  /**
+   * The identifier used to refer to the execution context that was created.
+   */
+  void set id(String value) {
+    assert(value != null);
+    this._id = value;
+  }
+
+  ExecutionCreateContextResult(String id) {
+    this.id = id;
+  }
+
+  factory ExecutionCreateContextResult.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      String id;
+      if (json.containsKey("id")) {
+        id = jsonDecoder.decodeString(jsonPath + ".id", json["id"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "id");
+      }
+      return new ExecutionCreateContextResult(id);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "execution.createContext result", json);
+    }
+  }
+
+  factory ExecutionCreateContextResult.fromResponse(Response response) {
+    return new ExecutionCreateContextResult.fromJson(
+        new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), "result", response._result);
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["id"] = id;
+    return result;
+  }
+
+  Response toResponse(String id) {
+    return new Response(id, result: toJson());
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is ExecutionCreateContextResult) {
+      return id == other.id;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, id.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * execution.deleteContext params
+ *
+ * {
+ *   "id": ExecutionContextId
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class ExecutionDeleteContextParams implements HasToJson {
+  String _id;
+
+  /**
+   * The identifier of the execution context that is to be deleted.
+   */
+  String get id => _id;
+
+  /**
+   * The identifier of the execution context that is to be deleted.
+   */
+  void set id(String value) {
+    assert(value != null);
+    this._id = value;
+  }
+
+  ExecutionDeleteContextParams(String id) {
+    this.id = id;
+  }
+
+  factory ExecutionDeleteContextParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      String id;
+      if (json.containsKey("id")) {
+        id = jsonDecoder.decodeString(jsonPath + ".id", json["id"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "id");
+      }
+      return new ExecutionDeleteContextParams(id);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "execution.deleteContext params", json);
+    }
+  }
+
+  factory ExecutionDeleteContextParams.fromRequest(Request request) {
+    return new ExecutionDeleteContextParams.fromJson(
+        new RequestDecoder(request), "params", request._params);
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["id"] = id;
+    return result;
+  }
+
+  Request toRequest(String id) {
+    return new Request(id, "execution.deleteContext", toJson());
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is ExecutionDeleteContextParams) {
+      return id == other.id;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, id.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+/**
+ * execution.deleteContext result
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class ExecutionDeleteContextResult {
+  Response toResponse(String id) {
+    return new Response(id, result: null);
+  }
+
+  @override
+  bool operator==(other) {
+    if (other is ExecutionDeleteContextResult) {
+      return true;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    return 479954425;
+  }
+}
+
+/**
+ * execution.mapUri params
+ *
+ * {
+ *   "id": ExecutionContextId
+ *   "file": optional FilePath
+ *   "uri": optional String
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class ExecutionMapUriParams implements HasToJson {
+  String _id;
+
+  String _file;
+
+  String _uri;
+
+  /**
+   * The identifier of the execution context in which the URI is to be mapped.
+   */
+  String get id => _id;
+
+  /**
+   * The identifier of the execution context in which the URI is to be mapped.
+   */
+  void set id(String value) {
+    assert(value != null);
+    this._id = value;
+  }
+
+  /**
+   * The path of the file to be mapped into a URI.
+   */
+  String get file => _file;
+
+  /**
+   * The path of the file to be mapped into a URI.
+   */
+  void set file(String value) {
+    this._file = value;
+  }
+
+  /**
+   * The URI to be mapped into a file path.
+   */
+  String get uri => _uri;
+
+  /**
+   * The URI to be mapped into a file path.
+   */
+  void set uri(String value) {
+    this._uri = value;
+  }
+
+  ExecutionMapUriParams(String id, {String file, String uri}) {
+    this.id = id;
+    this.file = file;
+    this.uri = uri;
+  }
+
+  factory ExecutionMapUriParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      String id;
+      if (json.containsKey("id")) {
+        id = jsonDecoder.decodeString(jsonPath + ".id", json["id"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "id");
+      }
+      String file;
+      if (json.containsKey("file")) {
+        file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]);
+      }
+      String uri;
+      if (json.containsKey("uri")) {
+        uri = jsonDecoder.decodeString(jsonPath + ".uri", json["uri"]);
+      }
+      return new ExecutionMapUriParams(id, file: file, uri: uri);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "execution.mapUri params", json);
+    }
+  }
+
+  factory ExecutionMapUriParams.fromRequest(Request request) {
+    return new ExecutionMapUriParams.fromJson(
+        new RequestDecoder(request), "params", request._params);
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["id"] = id;
+    if (file != null) {
+      result["file"] = file;
+    }
+    if (uri != null) {
+      result["uri"] = uri;
+    }
+    return result;
+  }
+
+  Request toRequest(String id) {
+    return new Request(id, "execution.mapUri", toJson());
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is ExecutionMapUriParams) {
+      return id == other.id &&
+          file == other.file &&
+          uri == other.uri;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, id.hashCode);
+    hash = JenkinsSmiHash.combine(hash, file.hashCode);
+    hash = JenkinsSmiHash.combine(hash, uri.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * execution.mapUri result
+ *
+ * {
+ *   "file": optional FilePath
+ *   "uri": optional String
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class ExecutionMapUriResult implements HasToJson {
+  String _file;
+
+  String _uri;
+
+  /**
+   * The file to which the URI was mapped. This field is omitted if the uri
+   * field was not given in the request.
+   */
+  String get file => _file;
+
+  /**
+   * The file to which the URI was mapped. This field is omitted if the uri
+   * field was not given in the request.
+   */
+  void set file(String value) {
+    this._file = value;
+  }
+
+  /**
+   * The URI to which the file path was mapped. This field is omitted if the
+   * file field was not given in the request.
+   */
+  String get uri => _uri;
+
+  /**
+   * The URI to which the file path was mapped. This field is omitted if the
+   * file field was not given in the request.
+   */
+  void set uri(String value) {
+    this._uri = value;
+  }
+
+  ExecutionMapUriResult({String file, String uri}) {
+    this.file = file;
+    this.uri = uri;
+  }
+
+  factory ExecutionMapUriResult.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      String file;
+      if (json.containsKey("file")) {
+        file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]);
+      }
+      String uri;
+      if (json.containsKey("uri")) {
+        uri = jsonDecoder.decodeString(jsonPath + ".uri", json["uri"]);
+      }
+      return new ExecutionMapUriResult(file: file, uri: uri);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "execution.mapUri result", json);
+    }
+  }
+
+  factory ExecutionMapUriResult.fromResponse(Response response) {
+    return new ExecutionMapUriResult.fromJson(
+        new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), "result", response._result);
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    if (file != null) {
+      result["file"] = file;
+    }
+    if (uri != null) {
+      result["uri"] = uri;
+    }
+    return result;
+  }
+
+  Response toResponse(String id) {
+    return new Response(id, result: toJson());
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is ExecutionMapUriResult) {
+      return file == other.file &&
+          uri == other.uri;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, file.hashCode);
+    hash = JenkinsSmiHash.combine(hash, uri.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * execution.setSubscriptions params
+ *
+ * {
+ *   "subscriptions": List<ExecutionService>
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class ExecutionSetSubscriptionsParams implements HasToJson {
+  List<ExecutionService> _subscriptions;
+
+  /**
+   * A list of the services being subscribed to.
+   */
+  List<ExecutionService> get subscriptions => _subscriptions;
+
+  /**
+   * A list of the services being subscribed to.
+   */
+  void set subscriptions(List<ExecutionService> value) {
+    assert(value != null);
+    this._subscriptions = value;
+  }
+
+  ExecutionSetSubscriptionsParams(List<ExecutionService> subscriptions) {
+    this.subscriptions = subscriptions;
+  }
+
+  factory ExecutionSetSubscriptionsParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      List<ExecutionService> subscriptions;
+      if (json.containsKey("subscriptions")) {
+        subscriptions = jsonDecoder.decodeList(jsonPath + ".subscriptions", json["subscriptions"], (String jsonPath, Object json) => new ExecutionService.fromJson(jsonDecoder, jsonPath, json));
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "subscriptions");
+      }
+      return new ExecutionSetSubscriptionsParams(subscriptions);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "execution.setSubscriptions params", json);
+    }
+  }
+
+  factory ExecutionSetSubscriptionsParams.fromRequest(Request request) {
+    return new ExecutionSetSubscriptionsParams.fromJson(
+        new RequestDecoder(request), "params", request._params);
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["subscriptions"] = subscriptions.map((ExecutionService value) => value.toJson()).toList();
+    return result;
+  }
+
+  Request toRequest(String id) {
+    return new Request(id, "execution.setSubscriptions", toJson());
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is ExecutionSetSubscriptionsParams) {
+      return listEqual(subscriptions, other.subscriptions, (ExecutionService a, ExecutionService b) => a == b);
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, subscriptions.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+/**
+ * execution.setSubscriptions result
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class ExecutionSetSubscriptionsResult {
+  Response toResponse(String id) {
+    return new Response(id, result: null);
+  }
+
+  @override
+  bool operator==(other) {
+    if (other is ExecutionSetSubscriptionsResult) {
+      return true;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    return 287678780;
+  }
+}
+
+/**
+ * execution.launchData params
+ *
+ * {
+ *   "file": FilePath
+ *   "kind": optional ExecutableKind
+ *   "referencedFiles": optional List<FilePath>
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class ExecutionLaunchDataParams implements HasToJson {
+  String _file;
+
+  ExecutableKind _kind;
+
+  List<String> _referencedFiles;
+
+  /**
+   * The file for which launch data is being provided. This will either be a
+   * Dart library or an HTML file.
+   */
+  String get file => _file;
+
+  /**
+   * The file for which launch data is being provided. This will either be a
+   * Dart library or an HTML file.
+   */
+  void set file(String value) {
+    assert(value != null);
+    this._file = value;
+  }
+
+  /**
+   * The kind of the executable file. This field is omitted if the file is not
+   * a Dart file.
+   */
+  ExecutableKind get kind => _kind;
+
+  /**
+   * The kind of the executable file. This field is omitted if the file is not
+   * a Dart file.
+   */
+  void set kind(ExecutableKind value) {
+    this._kind = value;
+  }
+
+  /**
+   * A list of the Dart files that are referenced by the file. This field is
+   * omitted if the file is not an HTML file.
+   */
+  List<String> get referencedFiles => _referencedFiles;
+
+  /**
+   * A list of the Dart files that are referenced by the file. This field is
+   * omitted if the file is not an HTML file.
+   */
+  void set referencedFiles(List<String> value) {
+    this._referencedFiles = value;
+  }
+
+  ExecutionLaunchDataParams(String file, {ExecutableKind kind, List<String> referencedFiles}) {
+    this.file = file;
+    this.kind = kind;
+    this.referencedFiles = referencedFiles;
+  }
+
+  factory ExecutionLaunchDataParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      String file;
+      if (json.containsKey("file")) {
+        file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "file");
+      }
+      ExecutableKind kind;
+      if (json.containsKey("kind")) {
+        kind = new ExecutableKind.fromJson(jsonDecoder, jsonPath + ".kind", json["kind"]);
+      }
+      List<String> referencedFiles;
+      if (json.containsKey("referencedFiles")) {
+        referencedFiles = jsonDecoder.decodeList(jsonPath + ".referencedFiles", json["referencedFiles"], jsonDecoder.decodeString);
+      }
+      return new ExecutionLaunchDataParams(file, kind: kind, referencedFiles: referencedFiles);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "execution.launchData params", json);
+    }
+  }
+
+  factory ExecutionLaunchDataParams.fromNotification(Notification notification) {
+    return new ExecutionLaunchDataParams.fromJson(
+        new ResponseDecoder(null), "params", notification._params);
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["file"] = file;
+    if (kind != null) {
+      result["kind"] = kind.toJson();
+    }
+    if (referencedFiles != null) {
+      result["referencedFiles"] = referencedFiles;
+    }
+    return result;
+  }
+
+  Notification toNotification() {
+    return new Notification("execution.launchData", toJson());
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is ExecutionLaunchDataParams) {
+      return file == other.file &&
+          kind == other.kind &&
+          listEqual(referencedFiles, other.referencedFiles, (String a, String b) => a == b);
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, file.hashCode);
+    hash = JenkinsSmiHash.combine(hash, kind.hashCode);
+    hash = JenkinsSmiHash.combine(hash, referencedFiles.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * AddContentOverlay
+ *
+ * {
+ *   "type": "add"
+ *   "content": String
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class AddContentOverlay implements HasToJson {
+  String _content;
+
+  /**
+   * The new content of the file.
+   */
+  String get content => _content;
+
+  /**
+   * The new content of the file.
+   */
+  void set content(String value) {
+    assert(value != null);
+    this._content = value;
+  }
+
+  AddContentOverlay(String content) {
+    this.content = content;
+  }
+
+  factory AddContentOverlay.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      if (json["type"] != "add") {
+        throw jsonDecoder.mismatch(jsonPath, "equal " + "add", json);
+      }
+      String content;
+      if (json.containsKey("content")) {
+        content = jsonDecoder.decodeString(jsonPath + ".content", json["content"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "content");
+      }
+      return new AddContentOverlay(content);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "AddContentOverlay", json);
+    }
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["type"] = "add";
+    result["content"] = content;
+    return result;
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is AddContentOverlay) {
+      return content == other.content;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, 704418402);
+    hash = JenkinsSmiHash.combine(hash, content.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * AnalysisError
+ *
+ * {
+ *   "severity": AnalysisErrorSeverity
+ *   "type": AnalysisErrorType
+ *   "location": Location
+ *   "message": String
+ *   "correction": optional String
+ *   "hasFix": optional bool
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class AnalysisError implements HasToJson {
+  AnalysisErrorSeverity _severity;
+
+  AnalysisErrorType _type;
+
+  Location _location;
+
+  String _message;
+
+  String _correction;
+
+  bool _hasFix;
+
+  /**
+   * The severity of the error.
+   */
+  AnalysisErrorSeverity get severity => _severity;
+
+  /**
+   * The severity of the error.
+   */
+  void set severity(AnalysisErrorSeverity value) {
+    assert(value != null);
+    this._severity = value;
+  }
+
+  /**
+   * The type of the error.
+   */
+  AnalysisErrorType get type => _type;
+
+  /**
+   * The type of the error.
+   */
+  void set type(AnalysisErrorType value) {
+    assert(value != null);
+    this._type = value;
+  }
+
+  /**
+   * The location associated with the error.
+   */
+  Location get location => _location;
+
+  /**
+   * The location associated with the error.
+   */
+  void set location(Location value) {
+    assert(value != null);
+    this._location = value;
+  }
+
+  /**
+   * The message to be displayed for this error. The message should indicate
+   * what is wrong with the code and why it is wrong.
+   */
+  String get message => _message;
+
+  /**
+   * The message to be displayed for this error. The message should indicate
+   * what is wrong with the code and why it is wrong.
+   */
+  void set message(String value) {
+    assert(value != null);
+    this._message = value;
+  }
+
+  /**
+   * The correction message to be displayed for this error. The correction
+   * message should indicate how the user can fix the error. The field is
+   * omitted if there is no correction message associated with the error code.
+   */
+  String get correction => _correction;
+
+  /**
+   * The correction message to be displayed for this error. The correction
+   * message should indicate how the user can fix the error. The field is
+   * omitted if there is no correction message associated with the error code.
+   */
+  void set correction(String value) {
+    this._correction = value;
+  }
+
+  /**
+   * A hint to indicate to interested clients that this error has an associated
+   * fix (or fixes). The absence of this field implies there are not known to
+   * be fixes. Note that since the operation to calculate whether fixes apply
+   * needs to be performant it is possible that complicated tests will be
+   * skipped and a false negative returned. For this reason, this attribute
+   * should be treated as a "hint". Despite the possibility of false negatives,
+   * no false positives should be returned. If a client sees this flag set they
+   * can proceed with the confidence that there are in fact associated fixes.
+   */
+  bool get hasFix => _hasFix;
+
+  /**
+   * A hint to indicate to interested clients that this error has an associated
+   * fix (or fixes). The absence of this field implies there are not known to
+   * be fixes. Note that since the operation to calculate whether fixes apply
+   * needs to be performant it is possible that complicated tests will be
+   * skipped and a false negative returned. For this reason, this attribute
+   * should be treated as a "hint". Despite the possibility of false negatives,
+   * no false positives should be returned. If a client sees this flag set they
+   * can proceed with the confidence that there are in fact associated fixes.
+   */
+  void set hasFix(bool value) {
+    this._hasFix = value;
+  }
+
+  AnalysisError(AnalysisErrorSeverity severity, AnalysisErrorType type, Location location, String message, {String correction, bool hasFix}) {
+    this.severity = severity;
+    this.type = type;
+    this.location = location;
+    this.message = message;
+    this.correction = correction;
+    this.hasFix = hasFix;
+  }
+
+  factory AnalysisError.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      AnalysisErrorSeverity severity;
+      if (json.containsKey("severity")) {
+        severity = new AnalysisErrorSeverity.fromJson(jsonDecoder, jsonPath + ".severity", json["severity"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "severity");
+      }
+      AnalysisErrorType type;
+      if (json.containsKey("type")) {
+        type = new AnalysisErrorType.fromJson(jsonDecoder, jsonPath + ".type", json["type"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "type");
+      }
+      Location location;
+      if (json.containsKey("location")) {
+        location = new Location.fromJson(jsonDecoder, jsonPath + ".location", json["location"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "location");
+      }
+      String message;
+      if (json.containsKey("message")) {
+        message = jsonDecoder.decodeString(jsonPath + ".message", json["message"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "message");
+      }
+      String correction;
+      if (json.containsKey("correction")) {
+        correction = jsonDecoder.decodeString(jsonPath + ".correction", json["correction"]);
+      }
+      bool hasFix;
+      if (json.containsKey("hasFix")) {
+        hasFix = jsonDecoder.decodeBool(jsonPath + ".hasFix", json["hasFix"]);
+      }
+      return new AnalysisError(severity, type, location, message, correction: correction, hasFix: hasFix);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "AnalysisError", json);
+    }
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["severity"] = severity.toJson();
+    result["type"] = type.toJson();
+    result["location"] = location.toJson();
+    result["message"] = message;
+    if (correction != null) {
+      result["correction"] = correction;
+    }
+    if (hasFix != null) {
+      result["hasFix"] = hasFix;
+    }
+    return result;
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is AnalysisError) {
+      return severity == other.severity &&
+          type == other.type &&
+          location == other.location &&
+          message == other.message &&
+          correction == other.correction &&
+          hasFix == other.hasFix;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, severity.hashCode);
+    hash = JenkinsSmiHash.combine(hash, type.hashCode);
+    hash = JenkinsSmiHash.combine(hash, location.hashCode);
+    hash = JenkinsSmiHash.combine(hash, message.hashCode);
+    hash = JenkinsSmiHash.combine(hash, correction.hashCode);
+    hash = JenkinsSmiHash.combine(hash, hasFix.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * AnalysisErrorFixes
+ *
+ * {
+ *   "error": AnalysisError
+ *   "fixes": List<SourceChange>
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class AnalysisErrorFixes implements HasToJson {
+  AnalysisError _error;
+
+  List<SourceChange> _fixes;
+
+  /**
+   * The error with which the fixes are associated.
+   */
+  AnalysisError get error => _error;
+
+  /**
+   * The error with which the fixes are associated.
+   */
+  void set error(AnalysisError value) {
+    assert(value != null);
+    this._error = value;
+  }
+
+  /**
+   * The fixes associated with the error.
+   */
+  List<SourceChange> get fixes => _fixes;
+
+  /**
+   * The fixes associated with the error.
+   */
+  void set fixes(List<SourceChange> value) {
+    assert(value != null);
+    this._fixes = value;
+  }
+
+  AnalysisErrorFixes(AnalysisError error, {List<SourceChange> fixes}) {
+    this.error = error;
+    if (fixes == null) {
+      this.fixes = <SourceChange>[];
+    } else {
+      this.fixes = fixes;
+    }
+  }
+
+  factory AnalysisErrorFixes.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      AnalysisError error;
+      if (json.containsKey("error")) {
+        error = new AnalysisError.fromJson(jsonDecoder, jsonPath + ".error", json["error"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "error");
+      }
+      List<SourceChange> fixes;
+      if (json.containsKey("fixes")) {
+        fixes = jsonDecoder.decodeList(jsonPath + ".fixes", json["fixes"], (String jsonPath, Object json) => new SourceChange.fromJson(jsonDecoder, jsonPath, json));
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "fixes");
+      }
+      return new AnalysisErrorFixes(error, fixes: fixes);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "AnalysisErrorFixes", json);
+    }
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["error"] = error.toJson();
+    result["fixes"] = fixes.map((SourceChange value) => value.toJson()).toList();
+    return result;
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is AnalysisErrorFixes) {
+      return error == other.error &&
+          listEqual(fixes, other.fixes, (SourceChange a, SourceChange b) => a == b);
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, error.hashCode);
+    hash = JenkinsSmiHash.combine(hash, fixes.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * AnalysisErrorSeverity
+ *
+ * enum {
+ *   INFO
+ *   WARNING
+ *   ERROR
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class AnalysisErrorSeverity implements Enum {
+  static const INFO = const AnalysisErrorSeverity._("INFO");
+
+  static const WARNING = const AnalysisErrorSeverity._("WARNING");
+
+  static const ERROR = const AnalysisErrorSeverity._("ERROR");
+
+  /**
+   * A list containing all of the enum values that are defined.
+   */
+  static const List<AnalysisErrorSeverity> VALUES = const <AnalysisErrorSeverity>[INFO, WARNING, ERROR];
+
+  final String name;
+
+  const AnalysisErrorSeverity._(this.name);
+
+  factory AnalysisErrorSeverity(String name) {
+    switch (name) {
+      case "INFO":
+        return INFO;
+      case "WARNING":
+        return WARNING;
+      case "ERROR":
+        return ERROR;
+    }
+    throw new Exception('Illegal enum value: $name');
+  }
+
+  factory AnalysisErrorSeverity.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json is String) {
+      try {
+        return new AnalysisErrorSeverity(json);
+      } catch(_) {
+        // Fall through
+      }
+    }
+    throw jsonDecoder.mismatch(jsonPath, "AnalysisErrorSeverity", json);
+  }
+
+  @override
+  String toString() => "AnalysisErrorSeverity.$name";
+
+  String toJson() => name;
+}
+
+/**
+ * AnalysisErrorType
+ *
+ * enum {
+ *   CHECKED_MODE_COMPILE_TIME_ERROR
+ *   COMPILE_TIME_ERROR
+ *   HINT
+ *   LINT
+ *   STATIC_TYPE_WARNING
+ *   STATIC_WARNING
+ *   SYNTACTIC_ERROR
+ *   TODO
+ * }
+ *
+ * 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 COMPILE_TIME_ERROR = const AnalysisErrorType._("COMPILE_TIME_ERROR");
+
+  static const HINT = const AnalysisErrorType._("HINT");
+
+  static const LINT = const AnalysisErrorType._("LINT");
+
+  static const STATIC_TYPE_WARNING = const AnalysisErrorType._("STATIC_TYPE_WARNING");
+
+  static const STATIC_WARNING = const AnalysisErrorType._("STATIC_WARNING");
+
+  static const SYNTACTIC_ERROR = const AnalysisErrorType._("SYNTACTIC_ERROR");
+
+  static const TODO = const AnalysisErrorType._("TODO");
+
+  /**
+   * A list containing all of the enum values that are defined.
+   */
+  static const List<AnalysisErrorType> VALUES = const <AnalysisErrorType>[CHECKED_MODE_COMPILE_TIME_ERROR, COMPILE_TIME_ERROR, HINT, LINT, STATIC_TYPE_WARNING, STATIC_WARNING, SYNTACTIC_ERROR, TODO];
+
+  final String name;
+
+  const AnalysisErrorType._(this.name);
+
+  factory AnalysisErrorType(String name) {
+    switch (name) {
+      case "CHECKED_MODE_COMPILE_TIME_ERROR":
+        return CHECKED_MODE_COMPILE_TIME_ERROR;
+      case "COMPILE_TIME_ERROR":
+        return COMPILE_TIME_ERROR;
+      case "HINT":
+        return HINT;
+      case "LINT":
+        return LINT;
+      case "STATIC_TYPE_WARNING":
+        return STATIC_TYPE_WARNING;
+      case "STATIC_WARNING":
+        return STATIC_WARNING;
+      case "SYNTACTIC_ERROR":
+        return SYNTACTIC_ERROR;
+      case "TODO":
+        return TODO;
+    }
+    throw new Exception('Illegal enum value: $name');
+  }
+
+  factory AnalysisErrorType.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json is String) {
+      try {
+        return new AnalysisErrorType(json);
+      } catch(_) {
+        // Fall through
+      }
+    }
+    throw jsonDecoder.mismatch(jsonPath, "AnalysisErrorType", json);
+  }
+
+  @override
+  String toString() => "AnalysisErrorType.$name";
+
+  String toJson() => name;
+}
+
+/**
+ * AnalysisOptions
+ *
+ * {
+ *   "enableAsync": optional bool
+ *   "enableDeferredLoading": optional bool
+ *   "enableEnums": optional bool
+ *   "enableNullAwareOperators": optional bool
+ *   "enableSuperMixins": optional bool
+ *   "generateDart2jsHints": optional bool
+ *   "generateHints": optional bool
+ *   "generateLints": optional bool
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class AnalysisOptions implements HasToJson {
+  bool _enableAsync;
+
+  bool _enableDeferredLoading;
+
+  bool _enableEnums;
+
+  bool _enableNullAwareOperators;
+
+  bool _enableSuperMixins;
+
+  bool _generateDart2jsHints;
+
+  bool _generateHints;
+
+  bool _generateLints;
+
+  /**
+   * Deprecated: this feature is always enabled.
+   *
+   * True if the client wants to enable support for the proposed async feature.
+   */
+  bool get enableAsync => _enableAsync;
+
+  /**
+   * Deprecated: this feature is always enabled.
+   *
+   * True if the client wants to enable support for the proposed async feature.
+   */
+  void set enableAsync(bool value) {
+    this._enableAsync = value;
+  }
+
+  /**
+   * Deprecated: this feature is always enabled.
+   *
+   * True if the client wants to enable support for the proposed deferred
+   * loading feature.
+   */
+  bool get enableDeferredLoading => _enableDeferredLoading;
+
+  /**
+   * Deprecated: this feature is always enabled.
+   *
+   * True if the client wants to enable support for the proposed deferred
+   * loading feature.
+   */
+  void set enableDeferredLoading(bool value) {
+    this._enableDeferredLoading = value;
+  }
+
+  /**
+   * Deprecated: this feature is always enabled.
+   *
+   * True if the client wants to enable support for the proposed enum feature.
+   */
+  bool get enableEnums => _enableEnums;
+
+  /**
+   * Deprecated: this feature is always enabled.
+   *
+   * True if the client wants to enable support for the proposed enum feature.
+   */
+  void set enableEnums(bool value) {
+    this._enableEnums = value;
+  }
+
+  /**
+   * Deprecated: this feature is always enabled.
+   *
+   * True if the client wants to enable support for the proposed "null aware
+   * operators" feature.
+   */
+  bool get enableNullAwareOperators => _enableNullAwareOperators;
+
+  /**
+   * Deprecated: this feature is always enabled.
+   *
+   * True if the client wants to enable support for the proposed "null aware
+   * operators" feature.
+   */
+  void set enableNullAwareOperators(bool value) {
+    this._enableNullAwareOperators = value;
+  }
+
+  /**
+   * True if the client wants to enable support for the proposed "less
+   * restricted mixins" proposal (DEP 34).
+   */
+  bool get enableSuperMixins => _enableSuperMixins;
+
+  /**
+   * True if the client wants to enable support for the proposed "less
+   * restricted mixins" proposal (DEP 34).
+   */
+  void set enableSuperMixins(bool value) {
+    this._enableSuperMixins = value;
+  }
+
+  /**
+   * True if hints that are specific to dart2js should be generated. This
+   * option is ignored if generateHints is false.
+   */
+  bool get generateDart2jsHints => _generateDart2jsHints;
+
+  /**
+   * True if hints that are specific to dart2js should be generated. This
+   * option is ignored if generateHints is false.
+   */
+  void set generateDart2jsHints(bool value) {
+    this._generateDart2jsHints = value;
+  }
+
+  /**
+   * True if hints should be generated as part of generating errors and
+   * warnings.
+   */
+  bool get generateHints => _generateHints;
+
+  /**
+   * True if hints should be generated as part of generating errors and
+   * warnings.
+   */
+  void set generateHints(bool value) {
+    this._generateHints = value;
+  }
+
+  /**
+   * True if lints should be generated as part of generating errors and
+   * warnings.
+   */
+  bool get generateLints => _generateLints;
+
+  /**
+   * True if lints should be generated as part of generating errors and
+   * warnings.
+   */
+  void set generateLints(bool value) {
+    this._generateLints = value;
+  }
+
+  AnalysisOptions({bool enableAsync, bool enableDeferredLoading, bool enableEnums, bool enableNullAwareOperators, bool enableSuperMixins, bool generateDart2jsHints, bool generateHints, bool generateLints}) {
+    this.enableAsync = enableAsync;
+    this.enableDeferredLoading = enableDeferredLoading;
+    this.enableEnums = enableEnums;
+    this.enableNullAwareOperators = enableNullAwareOperators;
+    this.enableSuperMixins = enableSuperMixins;
+    this.generateDart2jsHints = generateDart2jsHints;
+    this.generateHints = generateHints;
+    this.generateLints = generateLints;
+  }
+
+  factory AnalysisOptions.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      bool enableAsync;
+      if (json.containsKey("enableAsync")) {
+        enableAsync = jsonDecoder.decodeBool(jsonPath + ".enableAsync", json["enableAsync"]);
+      }
+      bool enableDeferredLoading;
+      if (json.containsKey("enableDeferredLoading")) {
+        enableDeferredLoading = jsonDecoder.decodeBool(jsonPath + ".enableDeferredLoading", json["enableDeferredLoading"]);
+      }
+      bool enableEnums;
+      if (json.containsKey("enableEnums")) {
+        enableEnums = jsonDecoder.decodeBool(jsonPath + ".enableEnums", json["enableEnums"]);
+      }
+      bool enableNullAwareOperators;
+      if (json.containsKey("enableNullAwareOperators")) {
+        enableNullAwareOperators = jsonDecoder.decodeBool(jsonPath + ".enableNullAwareOperators", json["enableNullAwareOperators"]);
+      }
+      bool enableSuperMixins;
+      if (json.containsKey("enableSuperMixins")) {
+        enableSuperMixins = jsonDecoder.decodeBool(jsonPath + ".enableSuperMixins", json["enableSuperMixins"]);
+      }
+      bool generateDart2jsHints;
+      if (json.containsKey("generateDart2jsHints")) {
+        generateDart2jsHints = jsonDecoder.decodeBool(jsonPath + ".generateDart2jsHints", json["generateDart2jsHints"]);
+      }
+      bool generateHints;
+      if (json.containsKey("generateHints")) {
+        generateHints = jsonDecoder.decodeBool(jsonPath + ".generateHints", json["generateHints"]);
+      }
+      bool generateLints;
+      if (json.containsKey("generateLints")) {
+        generateLints = jsonDecoder.decodeBool(jsonPath + ".generateLints", json["generateLints"]);
+      }
+      return new AnalysisOptions(enableAsync: enableAsync, enableDeferredLoading: enableDeferredLoading, enableEnums: enableEnums, enableNullAwareOperators: enableNullAwareOperators, enableSuperMixins: enableSuperMixins, generateDart2jsHints: generateDart2jsHints, generateHints: generateHints, generateLints: generateLints);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "AnalysisOptions", json);
+    }
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    if (enableAsync != null) {
+      result["enableAsync"] = enableAsync;
+    }
+    if (enableDeferredLoading != null) {
+      result["enableDeferredLoading"] = enableDeferredLoading;
+    }
+    if (enableEnums != null) {
+      result["enableEnums"] = enableEnums;
+    }
+    if (enableNullAwareOperators != null) {
+      result["enableNullAwareOperators"] = enableNullAwareOperators;
+    }
+    if (enableSuperMixins != null) {
+      result["enableSuperMixins"] = enableSuperMixins;
+    }
+    if (generateDart2jsHints != null) {
+      result["generateDart2jsHints"] = generateDart2jsHints;
+    }
+    if (generateHints != null) {
+      result["generateHints"] = generateHints;
+    }
+    if (generateLints != null) {
+      result["generateLints"] = generateLints;
+    }
+    return result;
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is AnalysisOptions) {
+      return enableAsync == other.enableAsync &&
+          enableDeferredLoading == other.enableDeferredLoading &&
+          enableEnums == other.enableEnums &&
+          enableNullAwareOperators == other.enableNullAwareOperators &&
+          enableSuperMixins == other.enableSuperMixins &&
+          generateDart2jsHints == other.generateDart2jsHints &&
+          generateHints == other.generateHints &&
+          generateLints == other.generateLints;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, enableAsync.hashCode);
+    hash = JenkinsSmiHash.combine(hash, enableDeferredLoading.hashCode);
+    hash = JenkinsSmiHash.combine(hash, enableEnums.hashCode);
+    hash = JenkinsSmiHash.combine(hash, enableNullAwareOperators.hashCode);
+    hash = JenkinsSmiHash.combine(hash, enableSuperMixins.hashCode);
+    hash = JenkinsSmiHash.combine(hash, generateDart2jsHints.hashCode);
+    hash = JenkinsSmiHash.combine(hash, generateHints.hashCode);
+    hash = JenkinsSmiHash.combine(hash, generateLints.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * AnalysisService
+ *
+ * enum {
+ *   FOLDING
+ *   HIGHLIGHTS
+ *   IMPLEMENTED
+ *   INVALIDATE
+ *   NAVIGATION
+ *   OCCURRENCES
+ *   OUTLINE
+ *   OVERRIDES
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class AnalysisService implements Enum {
+  static const FOLDING = const AnalysisService._("FOLDING");
+
+  static const HIGHLIGHTS = const AnalysisService._("HIGHLIGHTS");
+
+  static const 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 NAVIGATION = const AnalysisService._("NAVIGATION");
+
+  static const OCCURRENCES = const AnalysisService._("OCCURRENCES");
+
+  static const OUTLINE = const AnalysisService._("OUTLINE");
+
+  static const OVERRIDES = const AnalysisService._("OVERRIDES");
+
+  /**
+   * A list containing all of the enum values that are defined.
+   */
+  static const List<AnalysisService> VALUES = const <AnalysisService>[FOLDING, HIGHLIGHTS, IMPLEMENTED, INVALIDATE, NAVIGATION, OCCURRENCES, OUTLINE, OVERRIDES];
+
+  final String name;
+
+  const AnalysisService._(this.name);
+
+  factory AnalysisService(String name) {
+    switch (name) {
+      case "FOLDING":
+        return FOLDING;
+      case "HIGHLIGHTS":
+        return HIGHLIGHTS;
+      case "IMPLEMENTED":
+        return IMPLEMENTED;
+      case "INVALIDATE":
+        return INVALIDATE;
+      case "NAVIGATION":
+        return NAVIGATION;
+      case "OCCURRENCES":
+        return OCCURRENCES;
+      case "OUTLINE":
+        return OUTLINE;
+      case "OVERRIDES":
+        return OVERRIDES;
+    }
+    throw new Exception('Illegal enum value: $name');
+  }
+
+  factory AnalysisService.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json is String) {
+      try {
+        return new AnalysisService(json);
+      } catch(_) {
+        // Fall through
+      }
+    }
+    throw jsonDecoder.mismatch(jsonPath, "AnalysisService", json);
+  }
+
+  @override
+  String toString() => "AnalysisService.$name";
+
+  String toJson() => name;
+}
+
+/**
+ * AnalysisStatus
+ *
+ * {
+ *   "isAnalyzing": bool
+ *   "analysisTarget": optional String
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class AnalysisStatus implements HasToJson {
+  bool _isAnalyzing;
+
+  String _analysisTarget;
+
+  /**
+   * True if analysis is currently being performed.
+   */
+  bool get isAnalyzing => _isAnalyzing;
+
+  /**
+   * True if analysis is currently being performed.
+   */
+  void set isAnalyzing(bool value) {
+    assert(value != null);
+    this._isAnalyzing = value;
+  }
+
+  /**
+   * The name of the current target of analysis. This field is omitted if
+   * analyzing is false.
+   */
+  String get analysisTarget => _analysisTarget;
+
+  /**
+   * The name of the current target of analysis. This field is omitted if
+   * analyzing is false.
+   */
+  void set analysisTarget(String value) {
+    this._analysisTarget = value;
+  }
+
+  AnalysisStatus(bool isAnalyzing, {String analysisTarget}) {
+    this.isAnalyzing = isAnalyzing;
+    this.analysisTarget = analysisTarget;
+  }
+
+  factory AnalysisStatus.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      bool isAnalyzing;
+      if (json.containsKey("isAnalyzing")) {
+        isAnalyzing = jsonDecoder.decodeBool(jsonPath + ".isAnalyzing", json["isAnalyzing"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "isAnalyzing");
+      }
+      String analysisTarget;
+      if (json.containsKey("analysisTarget")) {
+        analysisTarget = jsonDecoder.decodeString(jsonPath + ".analysisTarget", json["analysisTarget"]);
+      }
+      return new AnalysisStatus(isAnalyzing, analysisTarget: analysisTarget);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "AnalysisStatus", json);
+    }
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["isAnalyzing"] = isAnalyzing;
+    if (analysisTarget != null) {
+      result["analysisTarget"] = analysisTarget;
+    }
+    return result;
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is AnalysisStatus) {
+      return isAnalyzing == other.isAnalyzing &&
+          analysisTarget == other.analysisTarget;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, isAnalyzing.hashCode);
+    hash = JenkinsSmiHash.combine(hash, analysisTarget.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * ChangeContentOverlay
+ *
+ * {
+ *   "type": "change"
+ *   "edits": List<SourceEdit>
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class ChangeContentOverlay implements HasToJson {
+  List<SourceEdit> _edits;
+
+  /**
+   * The edits to be applied to the file.
+   */
+  List<SourceEdit> get edits => _edits;
+
+  /**
+   * The edits to be applied to the file.
+   */
+  void set edits(List<SourceEdit> value) {
+    assert(value != null);
+    this._edits = value;
+  }
+
+  ChangeContentOverlay(List<SourceEdit> edits) {
+    this.edits = edits;
+  }
+
+  factory ChangeContentOverlay.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      if (json["type"] != "change") {
+        throw jsonDecoder.mismatch(jsonPath, "equal " + "change", json);
+      }
+      List<SourceEdit> edits;
+      if (json.containsKey("edits")) {
+        edits = jsonDecoder.decodeList(jsonPath + ".edits", json["edits"], (String jsonPath, Object json) => new SourceEdit.fromJson(jsonDecoder, jsonPath, json));
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "edits");
+      }
+      return new ChangeContentOverlay(edits);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "ChangeContentOverlay", json);
+    }
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["type"] = "change";
+    result["edits"] = edits.map((SourceEdit value) => value.toJson()).toList();
+    return result;
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is ChangeContentOverlay) {
+      return listEqual(edits, other.edits, (SourceEdit a, SourceEdit b) => a == b);
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, 873118866);
+    hash = JenkinsSmiHash.combine(hash, edits.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * CompletionSuggestion
+ *
+ * {
+ *   "kind": CompletionSuggestionKind
+ *   "relevance": int
+ *   "completion": String
+ *   "selectionOffset": int
+ *   "selectionLength": int
+ *   "isDeprecated": bool
+ *   "isPotential": bool
+ *   "docSummary": optional String
+ *   "docComplete": optional String
+ *   "declaringType": optional String
+ *   "element": optional Element
+ *   "returnType": optional String
+ *   "parameterNames": optional List<String>
+ *   "parameterTypes": optional List<String>
+ *   "requiredParameterCount": optional int
+ *   "hasNamedParameters": optional bool
+ *   "parameterName": optional String
+ *   "parameterType": optional String
+ *   "importUri": optional String
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class CompletionSuggestion implements HasToJson {
+  CompletionSuggestionKind _kind;
+
+  int _relevance;
+
+  String _completion;
+
+  int _selectionOffset;
+
+  int _selectionLength;
+
+  bool _isDeprecated;
+
+  bool _isPotential;
+
+  String _docSummary;
+
+  String _docComplete;
+
+  String _declaringType;
+
+  Element _element;
+
+  String _returnType;
+
+  List<String> _parameterNames;
+
+  List<String> _parameterTypes;
+
+  int _requiredParameterCount;
+
+  bool _hasNamedParameters;
+
+  String _parameterName;
+
+  String _parameterType;
+
+  String _importUri;
+
+  /**
+   * The kind of element being suggested.
+   */
+  CompletionSuggestionKind get kind => _kind;
+
+  /**
+   * The kind of element being suggested.
+   */
+  void set kind(CompletionSuggestionKind value) {
+    assert(value != null);
+    this._kind = value;
+  }
+
+  /**
+   * The relevance of this completion suggestion where a higher number
+   * indicates a higher relevance.
+   */
+  int get relevance => _relevance;
+
+  /**
+   * The relevance of this completion suggestion where a higher number
+   * indicates a higher relevance.
+   */
+  void set relevance(int value) {
+    assert(value != null);
+    this._relevance = value;
+  }
+
+  /**
+   * The identifier to be inserted if the suggestion is selected. If the
+   * suggestion is for a method or function, the client might want to
+   * additionally insert a template for the parameters. The information
+   * required in order to do so is contained in other fields.
+   */
+  String get completion => _completion;
+
+  /**
+   * The identifier to be inserted if the suggestion is selected. If the
+   * suggestion is for a method or function, the client might want to
+   * additionally insert a template for the parameters. The information
+   * required in order to do so is contained in other fields.
+   */
+  void set completion(String value) {
+    assert(value != null);
+    this._completion = value;
+  }
+
+  /**
+   * The offset, relative to the beginning of the completion, of where the
+   * selection should be placed after insertion.
+   */
+  int get selectionOffset => _selectionOffset;
+
+  /**
+   * The offset, relative to the beginning of the completion, of where the
+   * selection should be placed after insertion.
+   */
+  void set selectionOffset(int value) {
+    assert(value != null);
+    this._selectionOffset = value;
+  }
+
+  /**
+   * The number of characters that should be selected after insertion.
+   */
+  int get selectionLength => _selectionLength;
+
+  /**
+   * The number of characters that should be selected after insertion.
+   */
+  void set selectionLength(int value) {
+    assert(value != null);
+    this._selectionLength = value;
+  }
+
+  /**
+   * True if the suggested element is deprecated.
+   */
+  bool get isDeprecated => _isDeprecated;
+
+  /**
+   * True if the suggested element is deprecated.
+   */
+  void set isDeprecated(bool value) {
+    assert(value != null);
+    this._isDeprecated = value;
+  }
+
+  /**
+   * True if the element is not known to be valid for the target. This happens
+   * if the type of the target is dynamic.
+   */
+  bool get isPotential => _isPotential;
+
+  /**
+   * True if the element is not known to be valid for the target. This happens
+   * if the type of the target is dynamic.
+   */
+  void set isPotential(bool value) {
+    assert(value != null);
+    this._isPotential = value;
+  }
+
+  /**
+   * An abbreviated version of the Dartdoc associated with the element being
+   * suggested, This field is omitted if there is no Dartdoc associated with
+   * the element.
+   */
+  String get docSummary => _docSummary;
+
+  /**
+   * An abbreviated version of the Dartdoc associated with the element being
+   * suggested, This field is omitted if there is no Dartdoc associated with
+   * the element.
+   */
+  void set docSummary(String value) {
+    this._docSummary = value;
+  }
+
+  /**
+   * The Dartdoc associated with the element being suggested, This field is
+   * omitted if there is no Dartdoc associated with the element.
+   */
+  String get docComplete => _docComplete;
+
+  /**
+   * The Dartdoc associated with the element being suggested, This field is
+   * omitted if there is no Dartdoc associated with the element.
+   */
+  void set docComplete(String value) {
+    this._docComplete = value;
+  }
+
+  /**
+   * The class that declares the element being suggested. This field is omitted
+   * if the suggested element is not a member of a class.
+   */
+  String get declaringType => _declaringType;
+
+  /**
+   * The class that declares the element being suggested. This field is omitted
+   * if the suggested element is not a member of a class.
+   */
+  void set declaringType(String value) {
+    this._declaringType = value;
+  }
+
+  /**
+   * Information about the element reference being suggested.
+   */
+  Element get element => _element;
+
+  /**
+   * Information about the element reference being suggested.
+   */
+  void set element(Element value) {
+    this._element = value;
+  }
+
+  /**
+   * The return type of the getter, function or method or the type of the field
+   * being suggested. This field is omitted if the suggested element is not a
+   * getter, function or method.
+   */
+  String get returnType => _returnType;
+
+  /**
+   * The return type of the getter, function or method or the type of the field
+   * being suggested. This field is omitted if the suggested element is not a
+   * getter, function or method.
+   */
+  void set returnType(String value) {
+    this._returnType = value;
+  }
+
+  /**
+   * The names of the parameters of the function or method being suggested.
+   * This field is omitted if the suggested element is not a setter, function
+   * or method.
+   */
+  List<String> get parameterNames => _parameterNames;
+
+  /**
+   * The names of the parameters of the function or method being suggested.
+   * This field is omitted if the suggested element is not a setter, function
+   * or method.
+   */
+  void set parameterNames(List<String> value) {
+    this._parameterNames = value;
+  }
+
+  /**
+   * The types of the parameters of the function or method being suggested.
+   * This field is omitted if the parameterNames field is omitted.
+   */
+  List<String> get parameterTypes => _parameterTypes;
+
+  /**
+   * The types of the parameters of the function or method being suggested.
+   * This field is omitted if the parameterNames field is omitted.
+   */
+  void set parameterTypes(List<String> value) {
+    this._parameterTypes = value;
+  }
+
+  /**
+   * The number of required parameters for the function or method being
+   * suggested. This field is omitted if the parameterNames field is omitted.
+   */
+  int get requiredParameterCount => _requiredParameterCount;
+
+  /**
+   * The number of required parameters for the function or method being
+   * suggested. This field is omitted if the parameterNames field is omitted.
+   */
+  void set requiredParameterCount(int value) {
+    this._requiredParameterCount = value;
+  }
+
+  /**
+   * True if the function or method being suggested has at least one named
+   * parameter. This field is omitted if the parameterNames field is omitted.
+   */
+  bool get hasNamedParameters => _hasNamedParameters;
+
+  /**
+   * True if the function or method being suggested has at least one named
+   * parameter. This field is omitted if the parameterNames field is omitted.
+   */
+  void set hasNamedParameters(bool value) {
+    this._hasNamedParameters = value;
+  }
+
+  /**
+   * The name of the optional parameter being suggested. This field is omitted
+   * if the suggestion is not the addition of an optional argument within an
+   * argument list.
+   */
+  String get parameterName => _parameterName;
+
+  /**
+   * The name of the optional parameter being suggested. This field is omitted
+   * if the suggestion is not the addition of an optional argument within an
+   * argument list.
+   */
+  void set parameterName(String value) {
+    this._parameterName = value;
+  }
+
+  /**
+   * The type of the options parameter being suggested. This field is omitted
+   * if the parameterName field is omitted.
+   */
+  String get parameterType => _parameterType;
+
+  /**
+   * The type of the options parameter being suggested. This field is omitted
+   * if the parameterName field is omitted.
+   */
+  void set parameterType(String value) {
+    this._parameterType = value;
+  }
+
+  /**
+   * The import to be added if the suggestion is out of scope and needs an
+   * import to be added to be in scope.
+   */
+  String get importUri => _importUri;
+
+  /**
+   * The import to be added if the suggestion is out of scope and needs an
+   * import to be added to be in scope.
+   */
+  void set importUri(String value) {
+    this._importUri = value;
+  }
+
+  CompletionSuggestion(CompletionSuggestionKind kind, int relevance, String completion, int selectionOffset, int selectionLength, bool isDeprecated, bool isPotential, {String docSummary, String docComplete, String declaringType, Element element, String returnType, List<String> parameterNames, List<String> parameterTypes, int requiredParameterCount, bool hasNamedParameters, String parameterName, String parameterType, String importUri}) {
+    this.kind = kind;
+    this.relevance = relevance;
+    this.completion = completion;
+    this.selectionOffset = selectionOffset;
+    this.selectionLength = selectionLength;
+    this.isDeprecated = isDeprecated;
+    this.isPotential = isPotential;
+    this.docSummary = docSummary;
+    this.docComplete = docComplete;
+    this.declaringType = declaringType;
+    this.element = element;
+    this.returnType = returnType;
+    this.parameterNames = parameterNames;
+    this.parameterTypes = parameterTypes;
+    this.requiredParameterCount = requiredParameterCount;
+    this.hasNamedParameters = hasNamedParameters;
+    this.parameterName = parameterName;
+    this.parameterType = parameterType;
+    this.importUri = importUri;
+  }
+
+  factory CompletionSuggestion.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      CompletionSuggestionKind kind;
+      if (json.containsKey("kind")) {
+        kind = new CompletionSuggestionKind.fromJson(jsonDecoder, jsonPath + ".kind", json["kind"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "kind");
+      }
+      int relevance;
+      if (json.containsKey("relevance")) {
+        relevance = jsonDecoder.decodeInt(jsonPath + ".relevance", json["relevance"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "relevance");
+      }
+      String completion;
+      if (json.containsKey("completion")) {
+        completion = jsonDecoder.decodeString(jsonPath + ".completion", json["completion"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "completion");
+      }
+      int selectionOffset;
+      if (json.containsKey("selectionOffset")) {
+        selectionOffset = jsonDecoder.decodeInt(jsonPath + ".selectionOffset", json["selectionOffset"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "selectionOffset");
+      }
+      int selectionLength;
+      if (json.containsKey("selectionLength")) {
+        selectionLength = jsonDecoder.decodeInt(jsonPath + ".selectionLength", json["selectionLength"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "selectionLength");
+      }
+      bool isDeprecated;
+      if (json.containsKey("isDeprecated")) {
+        isDeprecated = jsonDecoder.decodeBool(jsonPath + ".isDeprecated", json["isDeprecated"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "isDeprecated");
+      }
+      bool isPotential;
+      if (json.containsKey("isPotential")) {
+        isPotential = jsonDecoder.decodeBool(jsonPath + ".isPotential", json["isPotential"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "isPotential");
+      }
+      String docSummary;
+      if (json.containsKey("docSummary")) {
+        docSummary = jsonDecoder.decodeString(jsonPath + ".docSummary", json["docSummary"]);
+      }
+      String docComplete;
+      if (json.containsKey("docComplete")) {
+        docComplete = jsonDecoder.decodeString(jsonPath + ".docComplete", json["docComplete"]);
+      }
+      String declaringType;
+      if (json.containsKey("declaringType")) {
+        declaringType = jsonDecoder.decodeString(jsonPath + ".declaringType", json["declaringType"]);
+      }
+      Element element;
+      if (json.containsKey("element")) {
+        element = new Element.fromJson(jsonDecoder, jsonPath + ".element", json["element"]);
+      }
+      String returnType;
+      if (json.containsKey("returnType")) {
+        returnType = jsonDecoder.decodeString(jsonPath + ".returnType", json["returnType"]);
+      }
+      List<String> parameterNames;
+      if (json.containsKey("parameterNames")) {
+        parameterNames = jsonDecoder.decodeList(jsonPath + ".parameterNames", json["parameterNames"], jsonDecoder.decodeString);
+      }
+      List<String> parameterTypes;
+      if (json.containsKey("parameterTypes")) {
+        parameterTypes = jsonDecoder.decodeList(jsonPath + ".parameterTypes", json["parameterTypes"], jsonDecoder.decodeString);
+      }
+      int requiredParameterCount;
+      if (json.containsKey("requiredParameterCount")) {
+        requiredParameterCount = jsonDecoder.decodeInt(jsonPath + ".requiredParameterCount", json["requiredParameterCount"]);
+      }
+      bool hasNamedParameters;
+      if (json.containsKey("hasNamedParameters")) {
+        hasNamedParameters = jsonDecoder.decodeBool(jsonPath + ".hasNamedParameters", json["hasNamedParameters"]);
+      }
+      String parameterName;
+      if (json.containsKey("parameterName")) {
+        parameterName = jsonDecoder.decodeString(jsonPath + ".parameterName", json["parameterName"]);
+      }
+      String parameterType;
+      if (json.containsKey("parameterType")) {
+        parameterType = jsonDecoder.decodeString(jsonPath + ".parameterType", json["parameterType"]);
+      }
+      String importUri;
+      if (json.containsKey("importUri")) {
+        importUri = jsonDecoder.decodeString(jsonPath + ".importUri", json["importUri"]);
+      }
+      return new CompletionSuggestion(kind, relevance, completion, selectionOffset, selectionLength, isDeprecated, isPotential, docSummary: docSummary, docComplete: docComplete, declaringType: declaringType, element: element, returnType: returnType, parameterNames: parameterNames, parameterTypes: parameterTypes, requiredParameterCount: requiredParameterCount, hasNamedParameters: hasNamedParameters, parameterName: parameterName, parameterType: parameterType, importUri: importUri);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "CompletionSuggestion", json);
+    }
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["kind"] = kind.toJson();
+    result["relevance"] = relevance;
+    result["completion"] = completion;
+    result["selectionOffset"] = selectionOffset;
+    result["selectionLength"] = selectionLength;
+    result["isDeprecated"] = isDeprecated;
+    result["isPotential"] = isPotential;
+    if (docSummary != null) {
+      result["docSummary"] = docSummary;
+    }
+    if (docComplete != null) {
+      result["docComplete"] = docComplete;
+    }
+    if (declaringType != null) {
+      result["declaringType"] = declaringType;
+    }
+    if (element != null) {
+      result["element"] = element.toJson();
+    }
+    if (returnType != null) {
+      result["returnType"] = returnType;
+    }
+    if (parameterNames != null) {
+      result["parameterNames"] = parameterNames;
+    }
+    if (parameterTypes != null) {
+      result["parameterTypes"] = parameterTypes;
+    }
+    if (requiredParameterCount != null) {
+      result["requiredParameterCount"] = requiredParameterCount;
+    }
+    if (hasNamedParameters != null) {
+      result["hasNamedParameters"] = hasNamedParameters;
+    }
+    if (parameterName != null) {
+      result["parameterName"] = parameterName;
+    }
+    if (parameterType != null) {
+      result["parameterType"] = parameterType;
+    }
+    if (importUri != null) {
+      result["importUri"] = importUri;
+    }
+    return result;
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is CompletionSuggestion) {
+      return kind == other.kind &&
+          relevance == other.relevance &&
+          completion == other.completion &&
+          selectionOffset == other.selectionOffset &&
+          selectionLength == other.selectionLength &&
+          isDeprecated == other.isDeprecated &&
+          isPotential == other.isPotential &&
+          docSummary == other.docSummary &&
+          docComplete == other.docComplete &&
+          declaringType == other.declaringType &&
+          element == other.element &&
+          returnType == other.returnType &&
+          listEqual(parameterNames, other.parameterNames, (String a, String b) => a == b) &&
+          listEqual(parameterTypes, other.parameterTypes, (String a, String b) => a == b) &&
+          requiredParameterCount == other.requiredParameterCount &&
+          hasNamedParameters == other.hasNamedParameters &&
+          parameterName == other.parameterName &&
+          parameterType == other.parameterType &&
+          importUri == other.importUri;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, kind.hashCode);
+    hash = JenkinsSmiHash.combine(hash, relevance.hashCode);
+    hash = JenkinsSmiHash.combine(hash, completion.hashCode);
+    hash = JenkinsSmiHash.combine(hash, selectionOffset.hashCode);
+    hash = JenkinsSmiHash.combine(hash, selectionLength.hashCode);
+    hash = JenkinsSmiHash.combine(hash, isDeprecated.hashCode);
+    hash = JenkinsSmiHash.combine(hash, isPotential.hashCode);
+    hash = JenkinsSmiHash.combine(hash, docSummary.hashCode);
+    hash = JenkinsSmiHash.combine(hash, docComplete.hashCode);
+    hash = JenkinsSmiHash.combine(hash, declaringType.hashCode);
+    hash = JenkinsSmiHash.combine(hash, element.hashCode);
+    hash = JenkinsSmiHash.combine(hash, returnType.hashCode);
+    hash = JenkinsSmiHash.combine(hash, parameterNames.hashCode);
+    hash = JenkinsSmiHash.combine(hash, parameterTypes.hashCode);
+    hash = JenkinsSmiHash.combine(hash, requiredParameterCount.hashCode);
+    hash = JenkinsSmiHash.combine(hash, hasNamedParameters.hashCode);
+    hash = JenkinsSmiHash.combine(hash, parameterName.hashCode);
+    hash = JenkinsSmiHash.combine(hash, parameterType.hashCode);
+    hash = JenkinsSmiHash.combine(hash, importUri.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * CompletionSuggestionKind
+ *
+ * enum {
+ *   ARGUMENT_LIST
+ *   IMPORT
+ *   IDENTIFIER
+ *   INVOCATION
+ *   KEYWORD
+ *   NAMED_ARGUMENT
+ *   OPTIONAL_ARGUMENT
+ *   PARAMETER
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class CompletionSuggestionKind implements Enum {
+  /**
+   * A list of arguments for the method or function that is being invoked. For
+   * this suggestion kind, the completion field is a textual representation of
+   * the invocation and the parameterNames, parameterTypes, and
+   * requiredParameterCount attributes are defined.
+   */
+  static const ARGUMENT_LIST = const CompletionSuggestionKind._("ARGUMENT_LIST");
+
+  static const IMPORT = const CompletionSuggestionKind._("IMPORT");
+
+  /**
+   * The element identifier should be inserted at the completion location. For
+   * example "someMethod" in import 'myLib.dart' show someMethod; . For
+   * suggestions of this kind, the element attribute is defined and the
+   * completion field is the element's identifier.
+   */
+  static const IDENTIFIER = const CompletionSuggestionKind._("IDENTIFIER");
+
+  /**
+   * The element is being invoked at the completion location. For example,
+   * "someMethod" in x.someMethod(); . For suggestions of this kind, the
+   * element attribute is defined and the completion field is the element's
+   * identifier.
+   */
+  static const 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");
+
+  /**
+   * 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 OPTIONAL_ARGUMENT = const CompletionSuggestionKind._("OPTIONAL_ARGUMENT");
+
+  static const PARAMETER = const CompletionSuggestionKind._("PARAMETER");
+
+  /**
+   * A list containing all of the enum values that are defined.
+   */
+  static const List<CompletionSuggestionKind> VALUES = const <CompletionSuggestionKind>[ARGUMENT_LIST, IMPORT, IDENTIFIER, INVOCATION, KEYWORD, NAMED_ARGUMENT, OPTIONAL_ARGUMENT, PARAMETER];
+
+  final String name;
+
+  const CompletionSuggestionKind._(this.name);
+
+  factory CompletionSuggestionKind(String name) {
+    switch (name) {
+      case "ARGUMENT_LIST":
+        return ARGUMENT_LIST;
+      case "IMPORT":
+        return IMPORT;
+      case "IDENTIFIER":
+        return IDENTIFIER;
+      case "INVOCATION":
+        return INVOCATION;
+      case "KEYWORD":
+        return KEYWORD;
+      case "NAMED_ARGUMENT":
+        return NAMED_ARGUMENT;
+      case "OPTIONAL_ARGUMENT":
+        return OPTIONAL_ARGUMENT;
+      case "PARAMETER":
+        return PARAMETER;
+    }
+    throw new Exception('Illegal enum value: $name');
+  }
+
+  factory CompletionSuggestionKind.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json is String) {
+      try {
+        return new CompletionSuggestionKind(json);
+      } catch(_) {
+        // Fall through
+      }
+    }
+    throw jsonDecoder.mismatch(jsonPath, "CompletionSuggestionKind", json);
+  }
+
+  @override
+  String toString() => "CompletionSuggestionKind.$name";
+
+  String toJson() => name;
+}
+
+/**
+ * Element
+ *
+ * {
+ *   "kind": ElementKind
+ *   "name": String
+ *   "location": optional Location
+ *   "flags": int
+ *   "parameters": optional String
+ *   "returnType": optional String
+ *   "typeParameters": optional String
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class Element implements HasToJson {
+  static const int FLAG_ABSTRACT = 0x01;
+  static const int FLAG_CONST = 0x02;
+  static const int FLAG_FINAL = 0x04;
+  static const int FLAG_STATIC = 0x08;
+  static const int FLAG_PRIVATE = 0x10;
+  static const int FLAG_DEPRECATED = 0x20;
+
+  static int makeFlags({isAbstract: false, isConst: false, isFinal: false, isStatic: false, isPrivate: false, isDeprecated: false}) {
+    int flags = 0;
+    if (isAbstract) flags |= FLAG_ABSTRACT;
+    if (isConst) flags |= FLAG_CONST;
+    if (isFinal) flags |= FLAG_FINAL;
+    if (isStatic) flags |= FLAG_STATIC;
+    if (isPrivate) flags |= FLAG_PRIVATE;
+    if (isDeprecated) flags |= FLAG_DEPRECATED;
+    return flags;
+  }
+
+  ElementKind _kind;
+
+  String _name;
+
+  Location _location;
+
+  int _flags;
+
+  String _parameters;
+
+  String _returnType;
+
+  String _typeParameters;
+
+  /**
+   * The kind of the element.
+   */
+  ElementKind get kind => _kind;
+
+  /**
+   * The kind of the element.
+   */
+  void set kind(ElementKind value) {
+    assert(value != null);
+    this._kind = value;
+  }
+
+  /**
+   * The name of the element. This is typically used as the label in the
+   * outline.
+   */
+  String get name => _name;
+
+  /**
+   * The name of the element. This is typically used as the label in the
+   * outline.
+   */
+  void set name(String value) {
+    assert(value != null);
+    this._name = value;
+  }
+
+  /**
+   * The location of the name in the declaration of the element.
+   */
+  Location get location => _location;
+
+  /**
+   * The location of the name in the declaration of the element.
+   */
+  void set location(Location value) {
+    this._location = value;
+  }
+
+  /**
+   * A bit-map containing the following flags:
+   *
+   * - 0x01 - set if the element is explicitly or implicitly abstract
+   * - 0x02 - set if the element was declared to be ‘const’
+   * - 0x04 - set if the element was declared to be ‘final’
+   * - 0x08 - set if the element is a static member of a class or is a
+   *   top-level function or field
+   * - 0x10 - set if the element is private
+   * - 0x20 - set if the element is deprecated
+   */
+  int get flags => _flags;
+
+  /**
+   * A bit-map containing the following flags:
+   *
+   * - 0x01 - set if the element is explicitly or implicitly abstract
+   * - 0x02 - set if the element was declared to be ‘const’
+   * - 0x04 - set if the element was declared to be ‘final’
+   * - 0x08 - set if the element is a static member of a class or is a
+   *   top-level function or field
+   * - 0x10 - set if the element is private
+   * - 0x20 - set if the element is deprecated
+   */
+  void set flags(int value) {
+    assert(value != null);
+    this._flags = value;
+  }
+
+  /**
+   * The parameter list for the element. If the element is not a method or
+   * function this field will not be defined. If the element doesn't have
+   * parameters (e.g. getter), this field will not be defined. If the element
+   * has zero parameters, this field will have a value of "()".
+   */
+  String get parameters => _parameters;
+
+  /**
+   * The parameter list for the element. If the element is not a method or
+   * function this field will not be defined. If the element doesn't have
+   * parameters (e.g. getter), this field will not be defined. If the element
+   * has zero parameters, this field will have a value of "()".
+   */
+  void set parameters(String value) {
+    this._parameters = value;
+  }
+
+  /**
+   * The return type of the element. If the element is not a method or function
+   * this field will not be defined. If the element does not have a declared
+   * return type, this field will contain an empty string.
+   */
+  String get returnType => _returnType;
+
+  /**
+   * The return type of the element. If the element is not a method or function
+   * this field will not be defined. If the element does not have a declared
+   * return type, this field will contain an empty string.
+   */
+  void set returnType(String value) {
+    this._returnType = value;
+  }
+
+  /**
+   * The type parameter list for the element. If the element doesn't have type
+   * parameters, this field will not be defined.
+   */
+  String get typeParameters => _typeParameters;
+
+  /**
+   * The type parameter list for the element. If the element doesn't have type
+   * parameters, this field will not be defined.
+   */
+  void set typeParameters(String value) {
+    this._typeParameters = value;
+  }
+
+  Element(ElementKind kind, String name, int flags, {Location location, String parameters, String returnType, String typeParameters}) {
+    this.kind = kind;
+    this.name = name;
+    this.location = location;
+    this.flags = flags;
+    this.parameters = parameters;
+    this.returnType = returnType;
+    this.typeParameters = typeParameters;
+  }
+
+  factory Element.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      ElementKind kind;
+      if (json.containsKey("kind")) {
+        kind = new ElementKind.fromJson(jsonDecoder, jsonPath + ".kind", json["kind"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "kind");
+      }
+      String name;
+      if (json.containsKey("name")) {
+        name = jsonDecoder.decodeString(jsonPath + ".name", json["name"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "name");
+      }
+      Location location;
+      if (json.containsKey("location")) {
+        location = new Location.fromJson(jsonDecoder, jsonPath + ".location", json["location"]);
+      }
+      int flags;
+      if (json.containsKey("flags")) {
+        flags = jsonDecoder.decodeInt(jsonPath + ".flags", json["flags"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "flags");
+      }
+      String parameters;
+      if (json.containsKey("parameters")) {
+        parameters = jsonDecoder.decodeString(jsonPath + ".parameters", json["parameters"]);
+      }
+      String returnType;
+      if (json.containsKey("returnType")) {
+        returnType = jsonDecoder.decodeString(jsonPath + ".returnType", json["returnType"]);
+      }
+      String typeParameters;
+      if (json.containsKey("typeParameters")) {
+        typeParameters = jsonDecoder.decodeString(jsonPath + ".typeParameters", json["typeParameters"]);
+      }
+      return new Element(kind, name, flags, location: location, parameters: parameters, returnType: returnType, typeParameters: typeParameters);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "Element", json);
+    }
+  }
+
+  bool get isAbstract => (flags & FLAG_ABSTRACT) != 0;
+  bool get isConst => (flags & FLAG_CONST) != 0;
+  bool get isFinal => (flags & FLAG_FINAL) != 0;
+  bool get isStatic => (flags & FLAG_STATIC) != 0;
+  bool get isPrivate => (flags & FLAG_PRIVATE) != 0;
+  bool get isDeprecated => (flags & FLAG_DEPRECATED) != 0;
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["kind"] = kind.toJson();
+    result["name"] = name;
+    if (location != null) {
+      result["location"] = location.toJson();
+    }
+    result["flags"] = flags;
+    if (parameters != null) {
+      result["parameters"] = parameters;
+    }
+    if (returnType != null) {
+      result["returnType"] = returnType;
+    }
+    if (typeParameters != null) {
+      result["typeParameters"] = typeParameters;
+    }
+    return result;
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is Element) {
+      return kind == other.kind &&
+          name == other.name &&
+          location == other.location &&
+          flags == other.flags &&
+          parameters == other.parameters &&
+          returnType == other.returnType &&
+          typeParameters == other.typeParameters;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, kind.hashCode);
+    hash = JenkinsSmiHash.combine(hash, name.hashCode);
+    hash = JenkinsSmiHash.combine(hash, location.hashCode);
+    hash = JenkinsSmiHash.combine(hash, flags.hashCode);
+    hash = JenkinsSmiHash.combine(hash, parameters.hashCode);
+    hash = JenkinsSmiHash.combine(hash, returnType.hashCode);
+    hash = JenkinsSmiHash.combine(hash, typeParameters.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * ElementKind
+ *
+ * enum {
+ *   CLASS
+ *   CLASS_TYPE_ALIAS
+ *   COMPILATION_UNIT
+ *   CONSTRUCTOR
+ *   ENUM
+ *   ENUM_CONSTANT
+ *   FIELD
+ *   FILE
+ *   FUNCTION
+ *   FUNCTION_TYPE_ALIAS
+ *   GETTER
+ *   LABEL
+ *   LIBRARY
+ *   LOCAL_VARIABLE
+ *   METHOD
+ *   PARAMETER
+ *   PREFIX
+ *   SETTER
+ *   TOP_LEVEL_VARIABLE
+ *   TYPE_PARAMETER
+ *   UNIT_TEST_GROUP
+ *   UNIT_TEST_TEST
+ *   UNKNOWN
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class ElementKind implements Enum {
+  static const CLASS = const ElementKind._("CLASS");
+
+  static const CLASS_TYPE_ALIAS = const ElementKind._("CLASS_TYPE_ALIAS");
+
+  static const COMPILATION_UNIT = const ElementKind._("COMPILATION_UNIT");
+
+  static const CONSTRUCTOR = const ElementKind._("CONSTRUCTOR");
+
+  static const ENUM = const ElementKind._("ENUM");
+
+  static const ENUM_CONSTANT = const ElementKind._("ENUM_CONSTANT");
+
+  static const FIELD = const ElementKind._("FIELD");
+
+  static const FILE = const ElementKind._("FILE");
+
+  static const FUNCTION = const ElementKind._("FUNCTION");
+
+  static const FUNCTION_TYPE_ALIAS = const ElementKind._("FUNCTION_TYPE_ALIAS");
+
+  static const GETTER = const ElementKind._("GETTER");
+
+  static const LABEL = const ElementKind._("LABEL");
+
+  static const LIBRARY = const ElementKind._("LIBRARY");
+
+  static const LOCAL_VARIABLE = const ElementKind._("LOCAL_VARIABLE");
+
+  static const METHOD = const ElementKind._("METHOD");
+
+  static const PARAMETER = const ElementKind._("PARAMETER");
+
+  static const PREFIX = const ElementKind._("PREFIX");
+
+  static const SETTER = const ElementKind._("SETTER");
+
+  static const TOP_LEVEL_VARIABLE = const ElementKind._("TOP_LEVEL_VARIABLE");
+
+  static const TYPE_PARAMETER = const ElementKind._("TYPE_PARAMETER");
+
+  static const UNIT_TEST_GROUP = const ElementKind._("UNIT_TEST_GROUP");
+
+  static const UNIT_TEST_TEST = const ElementKind._("UNIT_TEST_TEST");
+
+  static const UNKNOWN = const ElementKind._("UNKNOWN");
+
+  /**
+   * A list containing all of the enum values that are defined.
+   */
+  static const List<ElementKind> VALUES = const <ElementKind>[CLASS, CLASS_TYPE_ALIAS, COMPILATION_UNIT, CONSTRUCTOR, ENUM, ENUM_CONSTANT, FIELD, FILE, FUNCTION, FUNCTION_TYPE_ALIAS, GETTER, LABEL, LIBRARY, LOCAL_VARIABLE, METHOD, PARAMETER, PREFIX, SETTER, TOP_LEVEL_VARIABLE, TYPE_PARAMETER, UNIT_TEST_GROUP, UNIT_TEST_TEST, UNKNOWN];
+
+  final String name;
+
+  const ElementKind._(this.name);
+
+  factory ElementKind(String name) {
+    switch (name) {
+      case "CLASS":
+        return CLASS;
+      case "CLASS_TYPE_ALIAS":
+        return CLASS_TYPE_ALIAS;
+      case "COMPILATION_UNIT":
+        return COMPILATION_UNIT;
+      case "CONSTRUCTOR":
+        return CONSTRUCTOR;
+      case "ENUM":
+        return ENUM;
+      case "ENUM_CONSTANT":
+        return ENUM_CONSTANT;
+      case "FIELD":
+        return FIELD;
+      case "FILE":
+        return FILE;
+      case "FUNCTION":
+        return FUNCTION;
+      case "FUNCTION_TYPE_ALIAS":
+        return FUNCTION_TYPE_ALIAS;
+      case "GETTER":
+        return GETTER;
+      case "LABEL":
+        return LABEL;
+      case "LIBRARY":
+        return LIBRARY;
+      case "LOCAL_VARIABLE":
+        return LOCAL_VARIABLE;
+      case "METHOD":
+        return METHOD;
+      case "PARAMETER":
+        return PARAMETER;
+      case "PREFIX":
+        return PREFIX;
+      case "SETTER":
+        return SETTER;
+      case "TOP_LEVEL_VARIABLE":
+        return TOP_LEVEL_VARIABLE;
+      case "TYPE_PARAMETER":
+        return TYPE_PARAMETER;
+      case "UNIT_TEST_GROUP":
+        return UNIT_TEST_GROUP;
+      case "UNIT_TEST_TEST":
+        return UNIT_TEST_TEST;
+      case "UNKNOWN":
+        return UNKNOWN;
+    }
+    throw new Exception('Illegal enum value: $name');
+  }
+
+  factory ElementKind.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json is String) {
+      try {
+        return new ElementKind(json);
+      } catch(_) {
+        // Fall through
+      }
+    }
+    throw jsonDecoder.mismatch(jsonPath, "ElementKind", json);
+  }
+
+  @override
+  String toString() => "ElementKind.$name";
+
+  String toJson() => name;
+}
+
+/**
+ * ExecutableFile
+ *
+ * {
+ *   "file": FilePath
+ *   "kind": ExecutableKind
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class ExecutableFile implements HasToJson {
+  String _file;
+
+  ExecutableKind _kind;
+
+  /**
+   * The path of the executable file.
+   */
+  String get file => _file;
+
+  /**
+   * The path of the executable file.
+   */
+  void set file(String value) {
+    assert(value != null);
+    this._file = value;
+  }
+
+  /**
+   * The kind of the executable file.
+   */
+  ExecutableKind get kind => _kind;
+
+  /**
+   * The kind of the executable file.
+   */
+  void set kind(ExecutableKind value) {
+    assert(value != null);
+    this._kind = value;
+  }
+
+  ExecutableFile(String file, ExecutableKind kind) {
+    this.file = file;
+    this.kind = kind;
+  }
+
+  factory ExecutableFile.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      String file;
+      if (json.containsKey("file")) {
+        file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "file");
+      }
+      ExecutableKind kind;
+      if (json.containsKey("kind")) {
+        kind = new ExecutableKind.fromJson(jsonDecoder, jsonPath + ".kind", json["kind"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "kind");
+      }
+      return new ExecutableFile(file, kind);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "ExecutableFile", json);
+    }
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["file"] = file;
+    result["kind"] = kind.toJson();
+    return result;
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is ExecutableFile) {
+      return file == other.file &&
+          kind == other.kind;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, file.hashCode);
+    hash = JenkinsSmiHash.combine(hash, kind.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * ExecutableKind
+ *
+ * enum {
+ *   CLIENT
+ *   EITHER
+ *   NOT_EXECUTABLE
+ *   SERVER
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class ExecutableKind implements Enum {
+  static const CLIENT = const ExecutableKind._("CLIENT");
+
+  static const EITHER = const ExecutableKind._("EITHER");
+
+  static const NOT_EXECUTABLE = const ExecutableKind._("NOT_EXECUTABLE");
+
+  static const SERVER = const ExecutableKind._("SERVER");
+
+  /**
+   * A list containing all of the enum values that are defined.
+   */
+  static const List<ExecutableKind> VALUES = const <ExecutableKind>[CLIENT, EITHER, NOT_EXECUTABLE, SERVER];
+
+  final String name;
+
+  const ExecutableKind._(this.name);
+
+  factory ExecutableKind(String name) {
+    switch (name) {
+      case "CLIENT":
+        return CLIENT;
+      case "EITHER":
+        return EITHER;
+      case "NOT_EXECUTABLE":
+        return NOT_EXECUTABLE;
+      case "SERVER":
+        return SERVER;
+    }
+    throw new Exception('Illegal enum value: $name');
+  }
+
+  factory ExecutableKind.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json is String) {
+      try {
+        return new ExecutableKind(json);
+      } catch(_) {
+        // Fall through
+      }
+    }
+    throw jsonDecoder.mismatch(jsonPath, "ExecutableKind", json);
+  }
+
+  @override
+  String toString() => "ExecutableKind.$name";
+
+  String toJson() => name;
+}
+
+/**
+ * ExecutionService
+ *
+ * enum {
+ *   LAUNCH_DATA
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class ExecutionService implements Enum {
+  static const LAUNCH_DATA = const ExecutionService._("LAUNCH_DATA");
+
+  /**
+   * A list containing all of the enum values that are defined.
+   */
+  static const List<ExecutionService> VALUES = const <ExecutionService>[LAUNCH_DATA];
+
+  final String name;
+
+  const ExecutionService._(this.name);
+
+  factory ExecutionService(String name) {
+    switch (name) {
+      case "LAUNCH_DATA":
+        return LAUNCH_DATA;
+    }
+    throw new Exception('Illegal enum value: $name');
+  }
+
+  factory ExecutionService.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json is String) {
+      try {
+        return new ExecutionService(json);
+      } catch(_) {
+        // Fall through
+      }
+    }
+    throw jsonDecoder.mismatch(jsonPath, "ExecutionService", json);
+  }
+
+  @override
+  String toString() => "ExecutionService.$name";
+
+  String toJson() => name;
+}
+
+/**
+ * FileKind
+ *
+ * enum {
+ *   LIBRARY
+ *   PART
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class FileKind implements Enum {
+  static const LIBRARY = const FileKind._("LIBRARY");
+
+  static const PART = const FileKind._("PART");
+
+  /**
+   * A list containing all of the enum values that are defined.
+   */
+  static const List<FileKind> VALUES = const <FileKind>[LIBRARY, PART];
+
+  final String name;
+
+  const FileKind._(this.name);
+
+  factory FileKind(String name) {
+    switch (name) {
+      case "LIBRARY":
+        return LIBRARY;
+      case "PART":
+        return PART;
+    }
+    throw new Exception('Illegal enum value: $name');
+  }
+
+  factory FileKind.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json is String) {
+      try {
+        return new FileKind(json);
+      } catch(_) {
+        // Fall through
+      }
+    }
+    throw jsonDecoder.mismatch(jsonPath, "FileKind", json);
+  }
+
+  @override
+  String toString() => "FileKind.$name";
+
+  String toJson() => name;
+}
+
+/**
+ * FoldingKind
+ *
+ * enum {
+ *   COMMENT
+ *   CLASS_MEMBER
+ *   DIRECTIVES
+ *   DOCUMENTATION_COMMENT
+ *   TOP_LEVEL_DECLARATION
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class FoldingKind implements Enum {
+  static const COMMENT = const FoldingKind._("COMMENT");
+
+  static const CLASS_MEMBER = const FoldingKind._("CLASS_MEMBER");
+
+  static const DIRECTIVES = const FoldingKind._("DIRECTIVES");
+
+  static const DOCUMENTATION_COMMENT = const FoldingKind._("DOCUMENTATION_COMMENT");
+
+  static const TOP_LEVEL_DECLARATION = const FoldingKind._("TOP_LEVEL_DECLARATION");
+
+  /**
+   * A list containing all of the enum values that are defined.
+   */
+  static const List<FoldingKind> VALUES = const <FoldingKind>[COMMENT, CLASS_MEMBER, DIRECTIVES, DOCUMENTATION_COMMENT, TOP_LEVEL_DECLARATION];
+
+  final String name;
+
+  const FoldingKind._(this.name);
+
+  factory FoldingKind(String name) {
+    switch (name) {
+      case "COMMENT":
+        return COMMENT;
+      case "CLASS_MEMBER":
+        return CLASS_MEMBER;
+      case "DIRECTIVES":
+        return DIRECTIVES;
+      case "DOCUMENTATION_COMMENT":
+        return DOCUMENTATION_COMMENT;
+      case "TOP_LEVEL_DECLARATION":
+        return TOP_LEVEL_DECLARATION;
+    }
+    throw new Exception('Illegal enum value: $name');
+  }
+
+  factory FoldingKind.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json is String) {
+      try {
+        return new FoldingKind(json);
+      } catch(_) {
+        // Fall through
+      }
+    }
+    throw jsonDecoder.mismatch(jsonPath, "FoldingKind", json);
+  }
+
+  @override
+  String toString() => "FoldingKind.$name";
+
+  String toJson() => name;
+}
+
+/**
+ * FoldingRegion
+ *
+ * {
+ *   "kind": FoldingKind
+ *   "offset": int
+ *   "length": int
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class FoldingRegion implements HasToJson {
+  FoldingKind _kind;
+
+  int _offset;
+
+  int _length;
+
+  /**
+   * The kind of the region.
+   */
+  FoldingKind get kind => _kind;
+
+  /**
+   * The kind of the region.
+   */
+  void set kind(FoldingKind value) {
+    assert(value != null);
+    this._kind = value;
+  }
+
+  /**
+   * The offset of the region to be folded.
+   */
+  int get offset => _offset;
+
+  /**
+   * The offset of the region to be folded.
+   */
+  void set offset(int value) {
+    assert(value != null);
+    this._offset = value;
+  }
+
+  /**
+   * The length of the region to be folded.
+   */
+  int get length => _length;
+
+  /**
+   * The length of the region to be folded.
+   */
+  void set length(int value) {
+    assert(value != null);
+    this._length = value;
+  }
+
+  FoldingRegion(FoldingKind kind, int offset, int length) {
+    this.kind = kind;
+    this.offset = offset;
+    this.length = length;
+  }
+
+  factory FoldingRegion.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      FoldingKind kind;
+      if (json.containsKey("kind")) {
+        kind = new FoldingKind.fromJson(jsonDecoder, jsonPath + ".kind", json["kind"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "kind");
+      }
+      int offset;
+      if (json.containsKey("offset")) {
+        offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "offset");
+      }
+      int length;
+      if (json.containsKey("length")) {
+        length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "length");
+      }
+      return new FoldingRegion(kind, offset, length);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "FoldingRegion", json);
+    }
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["kind"] = kind.toJson();
+    result["offset"] = offset;
+    result["length"] = length;
+    return result;
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is FoldingRegion) {
+      return kind == other.kind &&
+          offset == other.offset &&
+          length == other.length;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, kind.hashCode);
+    hash = JenkinsSmiHash.combine(hash, offset.hashCode);
+    hash = JenkinsSmiHash.combine(hash, length.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * GeneralAnalysisService
+ *
+ * enum {
+ *   ANALYZED_FILES
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class GeneralAnalysisService implements Enum {
+  static const ANALYZED_FILES = const GeneralAnalysisService._("ANALYZED_FILES");
+
+  /**
+   * A list containing all of the enum values that are defined.
+   */
+  static const List<GeneralAnalysisService> VALUES = const <GeneralAnalysisService>[ANALYZED_FILES];
+
+  final String name;
+
+  const GeneralAnalysisService._(this.name);
+
+  factory GeneralAnalysisService(String name) {
+    switch (name) {
+      case "ANALYZED_FILES":
+        return ANALYZED_FILES;
+    }
+    throw new Exception('Illegal enum value: $name');
+  }
+
+  factory GeneralAnalysisService.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json is String) {
+      try {
+        return new GeneralAnalysisService(json);
+      } catch(_) {
+        // Fall through
+      }
+    }
+    throw jsonDecoder.mismatch(jsonPath, "GeneralAnalysisService", json);
+  }
+
+  @override
+  String toString() => "GeneralAnalysisService.$name";
+
+  String toJson() => name;
+}
+
+/**
+ * HighlightRegion
+ *
+ * {
+ *   "type": HighlightRegionType
+ *   "offset": int
+ *   "length": int
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class HighlightRegion implements HasToJson {
+  HighlightRegionType _type;
+
+  int _offset;
+
+  int _length;
+
+  /**
+   * The type of highlight associated with the region.
+   */
+  HighlightRegionType get type => _type;
+
+  /**
+   * The type of highlight associated with the region.
+   */
+  void set type(HighlightRegionType value) {
+    assert(value != null);
+    this._type = value;
+  }
+
+  /**
+   * The offset of the region to be highlighted.
+   */
+  int get offset => _offset;
+
+  /**
+   * The offset of the region to be highlighted.
+   */
+  void set offset(int value) {
+    assert(value != null);
+    this._offset = value;
+  }
+
+  /**
+   * The length of the region to be highlighted.
+   */
+  int get length => _length;
+
+  /**
+   * The length of the region to be highlighted.
+   */
+  void set length(int value) {
+    assert(value != null);
+    this._length = value;
+  }
+
+  HighlightRegion(HighlightRegionType type, int offset, int length) {
+    this.type = type;
+    this.offset = offset;
+    this.length = length;
+  }
+
+  factory HighlightRegion.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      HighlightRegionType type;
+      if (json.containsKey("type")) {
+        type = new HighlightRegionType.fromJson(jsonDecoder, jsonPath + ".type", json["type"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "type");
+      }
+      int offset;
+      if (json.containsKey("offset")) {
+        offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "offset");
+      }
+      int length;
+      if (json.containsKey("length")) {
+        length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "length");
+      }
+      return new HighlightRegion(type, offset, length);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "HighlightRegion", json);
+    }
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["type"] = type.toJson();
+    result["offset"] = offset;
+    result["length"] = length;
+    return result;
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is HighlightRegion) {
+      return type == other.type &&
+          offset == other.offset &&
+          length == other.length;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, type.hashCode);
+    hash = JenkinsSmiHash.combine(hash, offset.hashCode);
+    hash = JenkinsSmiHash.combine(hash, length.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * HighlightRegionType
+ *
+ * enum {
+ *   ANNOTATION
+ *   BUILT_IN
+ *   CLASS
+ *   COMMENT_BLOCK
+ *   COMMENT_DOCUMENTATION
+ *   COMMENT_END_OF_LINE
+ *   CONSTRUCTOR
+ *   DIRECTIVE
+ *   DYNAMIC_TYPE
+ *   DYNAMIC_LOCAL_VARIABLE_DECLARATION
+ *   DYNAMIC_LOCAL_VARIABLE_REFERENCE
+ *   DYNAMIC_PARAMETER_DECLARATION
+ *   DYNAMIC_PARAMETER_REFERENCE
+ *   ENUM
+ *   ENUM_CONSTANT
+ *   FIELD
+ *   FIELD_STATIC
+ *   FUNCTION
+ *   FUNCTION_DECLARATION
+ *   FUNCTION_TYPE_ALIAS
+ *   GETTER_DECLARATION
+ *   IDENTIFIER_DEFAULT
+ *   IMPORT_PREFIX
+ *   INSTANCE_FIELD_DECLARATION
+ *   INSTANCE_FIELD_REFERENCE
+ *   INSTANCE_GETTER_DECLARATION
+ *   INSTANCE_GETTER_REFERENCE
+ *   INSTANCE_METHOD_DECLARATION
+ *   INSTANCE_METHOD_REFERENCE
+ *   INSTANCE_SETTER_DECLARATION
+ *   INSTANCE_SETTER_REFERENCE
+ *   INVALID_STRING_ESCAPE
+ *   KEYWORD
+ *   LABEL
+ *   LIBRARY_NAME
+ *   LITERAL_BOOLEAN
+ *   LITERAL_DOUBLE
+ *   LITERAL_INTEGER
+ *   LITERAL_LIST
+ *   LITERAL_MAP
+ *   LITERAL_STRING
+ *   LOCAL_FUNCTION_DECLARATION
+ *   LOCAL_FUNCTION_REFERENCE
+ *   LOCAL_VARIABLE
+ *   LOCAL_VARIABLE_DECLARATION
+ *   LOCAL_VARIABLE_REFERENCE
+ *   METHOD
+ *   METHOD_DECLARATION
+ *   METHOD_DECLARATION_STATIC
+ *   METHOD_STATIC
+ *   PARAMETER
+ *   SETTER_DECLARATION
+ *   TOP_LEVEL_VARIABLE
+ *   PARAMETER_DECLARATION
+ *   PARAMETER_REFERENCE
+ *   STATIC_FIELD_DECLARATION
+ *   STATIC_GETTER_DECLARATION
+ *   STATIC_GETTER_REFERENCE
+ *   STATIC_METHOD_DECLARATION
+ *   STATIC_METHOD_REFERENCE
+ *   STATIC_SETTER_DECLARATION
+ *   STATIC_SETTER_REFERENCE
+ *   TOP_LEVEL_FUNCTION_DECLARATION
+ *   TOP_LEVEL_FUNCTION_REFERENCE
+ *   TOP_LEVEL_GETTER_DECLARATION
+ *   TOP_LEVEL_GETTER_REFERENCE
+ *   TOP_LEVEL_SETTER_DECLARATION
+ *   TOP_LEVEL_SETTER_REFERENCE
+ *   TOP_LEVEL_VARIABLE_DECLARATION
+ *   TYPE_NAME_DYNAMIC
+ *   TYPE_PARAMETER
+ *   UNRESOLVED_INSTANCE_MEMBER_REFERENCE
+ *   VALID_STRING_ESCAPE
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class HighlightRegionType implements Enum {
+  static const ANNOTATION = const HighlightRegionType._("ANNOTATION");
+
+  static const BUILT_IN = const HighlightRegionType._("BUILT_IN");
+
+  static const CLASS = const HighlightRegionType._("CLASS");
+
+  static const COMMENT_BLOCK = const HighlightRegionType._("COMMENT_BLOCK");
+
+  static const COMMENT_DOCUMENTATION = const HighlightRegionType._("COMMENT_DOCUMENTATION");
+
+  static const COMMENT_END_OF_LINE = const HighlightRegionType._("COMMENT_END_OF_LINE");
+
+  static const CONSTRUCTOR = const HighlightRegionType._("CONSTRUCTOR");
+
+  static const DIRECTIVE = const HighlightRegionType._("DIRECTIVE");
+
+  /**
+   * Only for version 1 of highlight.
+   */
+  static const DYNAMIC_TYPE = const HighlightRegionType._("DYNAMIC_TYPE");
+
+  /**
+   * Only for version 2 of highlight.
+   */
+  static const 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");
+
+  /**
+   * Only for version 2 of highlight.
+   */
+  static const 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 ENUM = const HighlightRegionType._("ENUM");
+
+  static const ENUM_CONSTANT = const HighlightRegionType._("ENUM_CONSTANT");
+
+  /**
+   * Only for version 1 of highlight.
+   */
+  static const FIELD = const HighlightRegionType._("FIELD");
+
+  /**
+   * Only for version 1 of highlight.
+   */
+  static const FIELD_STATIC = const HighlightRegionType._("FIELD_STATIC");
+
+  /**
+   * Only for version 1 of highlight.
+   */
+  static const FUNCTION = const HighlightRegionType._("FUNCTION");
+
+  /**
+   * Only for version 1 of highlight.
+   */
+  static const FUNCTION_DECLARATION = const HighlightRegionType._("FUNCTION_DECLARATION");
+
+  static const FUNCTION_TYPE_ALIAS = const HighlightRegionType._("FUNCTION_TYPE_ALIAS");
+
+  /**
+   * Only for version 1 of highlight.
+   */
+  static const GETTER_DECLARATION = const HighlightRegionType._("GETTER_DECLARATION");
+
+  static const IDENTIFIER_DEFAULT = const HighlightRegionType._("IDENTIFIER_DEFAULT");
+
+  static const IMPORT_PREFIX = const HighlightRegionType._("IMPORT_PREFIX");
+
+  /**
+   * Only for version 2 of highlight.
+   */
+  static const INSTANCE_FIELD_DECLARATION = const HighlightRegionType._("INSTANCE_FIELD_DECLARATION");
+
+  /**
+   * Only for version 2 of highlight.
+   */
+  static const INSTANCE_FIELD_REFERENCE = const HighlightRegionType._("INSTANCE_FIELD_REFERENCE");
+
+  /**
+   * Only for version 2 of highlight.
+   */
+  static const INSTANCE_GETTER_DECLARATION = const HighlightRegionType._("INSTANCE_GETTER_DECLARATION");
+
+  /**
+   * Only for version 2 of highlight.
+   */
+  static const INSTANCE_GETTER_REFERENCE = const HighlightRegionType._("INSTANCE_GETTER_REFERENCE");
+
+  /**
+   * Only for version 2 of highlight.
+   */
+  static const INSTANCE_METHOD_DECLARATION = const HighlightRegionType._("INSTANCE_METHOD_DECLARATION");
+
+  /**
+   * Only for version 2 of highlight.
+   */
+  static const INSTANCE_METHOD_REFERENCE = const HighlightRegionType._("INSTANCE_METHOD_REFERENCE");
+
+  /**
+   * Only for version 2 of highlight.
+   */
+  static const INSTANCE_SETTER_DECLARATION = const HighlightRegionType._("INSTANCE_SETTER_DECLARATION");
+
+  /**
+   * Only for version 2 of highlight.
+   */
+  static const 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 KEYWORD = const HighlightRegionType._("KEYWORD");
+
+  static const LABEL = const HighlightRegionType._("LABEL");
+
+  /**
+   * Only for version 2 of highlight.
+   */
+  static const LIBRARY_NAME = const HighlightRegionType._("LIBRARY_NAME");
+
+  static const LITERAL_BOOLEAN = const HighlightRegionType._("LITERAL_BOOLEAN");
+
+  static const LITERAL_DOUBLE = const HighlightRegionType._("LITERAL_DOUBLE");
+
+  static const LITERAL_INTEGER = const HighlightRegionType._("LITERAL_INTEGER");
+
+  static const LITERAL_LIST = const HighlightRegionType._("LITERAL_LIST");
+
+  static const LITERAL_MAP = const HighlightRegionType._("LITERAL_MAP");
+
+  static const LITERAL_STRING = const HighlightRegionType._("LITERAL_STRING");
+
+  /**
+   * Only for version 2 of highlight.
+   */
+  static const LOCAL_FUNCTION_DECLARATION = const HighlightRegionType._("LOCAL_FUNCTION_DECLARATION");
+
+  /**
+   * Only for version 2 of highlight.
+   */
+  static const LOCAL_FUNCTION_REFERENCE = const HighlightRegionType._("LOCAL_FUNCTION_REFERENCE");
+
+  /**
+   * Only for version 1 of highlight.
+   */
+  static const LOCAL_VARIABLE = const HighlightRegionType._("LOCAL_VARIABLE");
+
+  static const LOCAL_VARIABLE_DECLARATION = const HighlightRegionType._("LOCAL_VARIABLE_DECLARATION");
+
+  /**
+   * Only for version 2 of highlight.
+   */
+  static const LOCAL_VARIABLE_REFERENCE = const HighlightRegionType._("LOCAL_VARIABLE_REFERENCE");
+
+  /**
+   * Only for version 1 of highlight.
+   */
+  static const METHOD = const HighlightRegionType._("METHOD");
+
+  /**
+   * Only for version 1 of highlight.
+   */
+  static const METHOD_DECLARATION = const HighlightRegionType._("METHOD_DECLARATION");
+
+  /**
+   * Only for version 1 of highlight.
+   */
+  static const METHOD_DECLARATION_STATIC = const HighlightRegionType._("METHOD_DECLARATION_STATIC");
+
+  /**
+   * Only for version 1 of highlight.
+   */
+  static const METHOD_STATIC = const HighlightRegionType._("METHOD_STATIC");
+
+  /**
+   * Only for version 1 of highlight.
+   */
+  static const PARAMETER = const HighlightRegionType._("PARAMETER");
+
+  /**
+   * Only for version 1 of highlight.
+   */
+  static const SETTER_DECLARATION = const HighlightRegionType._("SETTER_DECLARATION");
+
+  /**
+   * Only for version 1 of highlight.
+   */
+  static const TOP_LEVEL_VARIABLE = const HighlightRegionType._("TOP_LEVEL_VARIABLE");
+
+  /**
+   * Only for version 2 of highlight.
+   */
+  static const PARAMETER_DECLARATION = const HighlightRegionType._("PARAMETER_DECLARATION");
+
+  /**
+   * Only for version 2 of highlight.
+   */
+  static const PARAMETER_REFERENCE = const HighlightRegionType._("PARAMETER_REFERENCE");
+
+  /**
+   * Only for version 2 of highlight.
+   */
+  static const STATIC_FIELD_DECLARATION = const HighlightRegionType._("STATIC_FIELD_DECLARATION");
+
+  /**
+   * Only for version 2 of highlight.
+   */
+  static const STATIC_GETTER_DECLARATION = const HighlightRegionType._("STATIC_GETTER_DECLARATION");
+
+  /**
+   * Only for version 2 of highlight.
+   */
+  static const STATIC_GETTER_REFERENCE = const HighlightRegionType._("STATIC_GETTER_REFERENCE");
+
+  /**
+   * Only for version 2 of highlight.
+   */
+  static const STATIC_METHOD_DECLARATION = const HighlightRegionType._("STATIC_METHOD_DECLARATION");
+
+  /**
+   * Only for version 2 of highlight.
+   */
+  static const STATIC_METHOD_REFERENCE = const HighlightRegionType._("STATIC_METHOD_REFERENCE");
+
+  /**
+   * Only for version 2 of highlight.
+   */
+  static const STATIC_SETTER_DECLARATION = const HighlightRegionType._("STATIC_SETTER_DECLARATION");
+
+  /**
+   * Only for version 2 of highlight.
+   */
+  static const 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");
+
+  /**
+   * Only for version 2 of highlight.
+   */
+  static const 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");
+
+  /**
+   * Only for version 2 of highlight.
+   */
+  static const 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");
+
+  /**
+   * Only for version 2 of highlight.
+   */
+  static const 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 TYPE_NAME_DYNAMIC = const HighlightRegionType._("TYPE_NAME_DYNAMIC");
+
+  static const TYPE_PARAMETER = const HighlightRegionType._("TYPE_PARAMETER");
+
+  /**
+   * Only for version 2 of highlight.
+   */
+  static const 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");
+
+  /**
+   * A list containing all of the enum values that are defined.
+   */
+  static const List<HighlightRegionType> VALUES = const <HighlightRegionType>[ANNOTATION, BUILT_IN, CLASS, COMMENT_BLOCK, COMMENT_DOCUMENTATION, COMMENT_END_OF_LINE, CONSTRUCTOR, DIRECTIVE, DYNAMIC_TYPE, DYNAMIC_LOCAL_VARIABLE_DECLARATION, DYNAMIC_LOCAL_VARIABLE_REFERENCE, DYNAMIC_PARAMETER_DECLARATION, DYNAMIC_PARAMETER_REFERENCE, ENUM, ENUM_CONSTANT, FIELD, FIELD_STATIC, FUNCTION, FUNCTION_DECLARATION, FUNCTION_TYPE_ALIAS, GETTER_DECLARATION, IDENTIFIER_DEFAULT, IMPORT_PREFIX, INSTANCE_FIELD_DECLARATION, INSTANCE_FIELD_REFERENCE, INSTANCE_GETTER_DECLARATION, INSTANCE_GETTER_REFERENCE, INSTANCE_METHOD_DECLARATION, INSTANCE_METHOD_REFERENCE, INSTANCE_SETTER_DECLARATION, INSTANCE_SETTER_REFERENCE, INVALID_STRING_ESCAPE, KEYWORD, LABEL, LIBRARY_NAME, LITERAL_BOOLEAN, LITERAL_DOUBLE, LITERAL_INTEGER, LITERAL_LIST, LITERAL_MAP, LITERAL_STRING, LOCAL_FUNCTION_DECLARATION, LOCAL_FUNCTION_REFERENCE, LOCAL_VARIABLE, LOCAL_VARIABLE_DECLARATION, LOCAL_VARIABLE_REFERENCE, METHOD, METHOD_DECLARATION, METHOD_DECLARATION_STATIC, METHOD_STATIC, PARAMETER, SETTER_DECLARATION, TOP_LEVEL_VARIABLE, PARAMETER_DECLARATION, PARAMETER_REFERENCE, STATIC_FIELD_DECLARATION, STATIC_GETTER_DECLARATION, STATIC_GETTER_REFERENCE, STATIC_METHOD_DECLARATION, STATIC_METHOD_REFERENCE, STATIC_SETTER_DECLARATION, STATIC_SETTER_REFERENCE, TOP_LEVEL_FUNCTION_DECLARATION, TOP_LEVEL_FUNCTION_REFERENCE, TOP_LEVEL_GETTER_DECLARATION, TOP_LEVEL_GETTER_REFERENCE, TOP_LEVEL_SETTER_DECLARATION, TOP_LEVEL_SETTER_REFERENCE, TOP_LEVEL_VARIABLE_DECLARATION, TYPE_NAME_DYNAMIC, TYPE_PARAMETER, UNRESOLVED_INSTANCE_MEMBER_REFERENCE, VALID_STRING_ESCAPE];
+
+  final String name;
+
+  const HighlightRegionType._(this.name);
+
+  factory HighlightRegionType(String name) {
+    switch (name) {
+      case "ANNOTATION":
+        return ANNOTATION;
+      case "BUILT_IN":
+        return BUILT_IN;
+      case "CLASS":
+        return CLASS;
+      case "COMMENT_BLOCK":
+        return COMMENT_BLOCK;
+      case "COMMENT_DOCUMENTATION":
+        return COMMENT_DOCUMENTATION;
+      case "COMMENT_END_OF_LINE":
+        return COMMENT_END_OF_LINE;
+      case "CONSTRUCTOR":
+        return CONSTRUCTOR;
+      case "DIRECTIVE":
+        return DIRECTIVE;
+      case "DYNAMIC_TYPE":
+        return DYNAMIC_TYPE;
+      case "DYNAMIC_LOCAL_VARIABLE_DECLARATION":
+        return DYNAMIC_LOCAL_VARIABLE_DECLARATION;
+      case "DYNAMIC_LOCAL_VARIABLE_REFERENCE":
+        return DYNAMIC_LOCAL_VARIABLE_REFERENCE;
+      case "DYNAMIC_PARAMETER_DECLARATION":
+        return DYNAMIC_PARAMETER_DECLARATION;
+      case "DYNAMIC_PARAMETER_REFERENCE":
+        return DYNAMIC_PARAMETER_REFERENCE;
+      case "ENUM":
+        return ENUM;
+      case "ENUM_CONSTANT":
+        return ENUM_CONSTANT;
+      case "FIELD":
+        return FIELD;
+      case "FIELD_STATIC":
+        return FIELD_STATIC;
+      case "FUNCTION":
+        return FUNCTION;
+      case "FUNCTION_DECLARATION":
+        return FUNCTION_DECLARATION;
+      case "FUNCTION_TYPE_ALIAS":
+        return FUNCTION_TYPE_ALIAS;
+      case "GETTER_DECLARATION":
+        return GETTER_DECLARATION;
+      case "IDENTIFIER_DEFAULT":
+        return IDENTIFIER_DEFAULT;
+      case "IMPORT_PREFIX":
+        return IMPORT_PREFIX;
+      case "INSTANCE_FIELD_DECLARATION":
+        return INSTANCE_FIELD_DECLARATION;
+      case "INSTANCE_FIELD_REFERENCE":
+        return INSTANCE_FIELD_REFERENCE;
+      case "INSTANCE_GETTER_DECLARATION":
+        return INSTANCE_GETTER_DECLARATION;
+      case "INSTANCE_GETTER_REFERENCE":
+        return INSTANCE_GETTER_REFERENCE;
+      case "INSTANCE_METHOD_DECLARATION":
+        return INSTANCE_METHOD_DECLARATION;
+      case "INSTANCE_METHOD_REFERENCE":
+        return INSTANCE_METHOD_REFERENCE;
+      case "INSTANCE_SETTER_DECLARATION":
+        return INSTANCE_SETTER_DECLARATION;
+      case "INSTANCE_SETTER_REFERENCE":
+        return INSTANCE_SETTER_REFERENCE;
+      case "INVALID_STRING_ESCAPE":
+        return INVALID_STRING_ESCAPE;
+      case "KEYWORD":
+        return KEYWORD;
+      case "LABEL":
+        return LABEL;
+      case "LIBRARY_NAME":
+        return LIBRARY_NAME;
+      case "LITERAL_BOOLEAN":
+        return LITERAL_BOOLEAN;
+      case "LITERAL_DOUBLE":
+        return LITERAL_DOUBLE;
+      case "LITERAL_INTEGER":
+        return LITERAL_INTEGER;
+      case "LITERAL_LIST":
+        return LITERAL_LIST;
+      case "LITERAL_MAP":
+        return LITERAL_MAP;
+      case "LITERAL_STRING":
+        return LITERAL_STRING;
+      case "LOCAL_FUNCTION_DECLARATION":
+        return LOCAL_FUNCTION_DECLARATION;
+      case "LOCAL_FUNCTION_REFERENCE":
+        return LOCAL_FUNCTION_REFERENCE;
+      case "LOCAL_VARIABLE":
+        return LOCAL_VARIABLE;
+      case "LOCAL_VARIABLE_DECLARATION":
+        return LOCAL_VARIABLE_DECLARATION;
+      case "LOCAL_VARIABLE_REFERENCE":
+        return LOCAL_VARIABLE_REFERENCE;
+      case "METHOD":
+        return METHOD;
+      case "METHOD_DECLARATION":
+        return METHOD_DECLARATION;
+      case "METHOD_DECLARATION_STATIC":
+        return METHOD_DECLARATION_STATIC;
+      case "METHOD_STATIC":
+        return METHOD_STATIC;
+      case "PARAMETER":
+        return PARAMETER;
+      case "SETTER_DECLARATION":
+        return SETTER_DECLARATION;
+      case "TOP_LEVEL_VARIABLE":
+        return TOP_LEVEL_VARIABLE;
+      case "PARAMETER_DECLARATION":
+        return PARAMETER_DECLARATION;
+      case "PARAMETER_REFERENCE":
+        return PARAMETER_REFERENCE;
+      case "STATIC_FIELD_DECLARATION":
+        return STATIC_FIELD_DECLARATION;
+      case "STATIC_GETTER_DECLARATION":
+        return STATIC_GETTER_DECLARATION;
+      case "STATIC_GETTER_REFERENCE":
+        return STATIC_GETTER_REFERENCE;
+      case "STATIC_METHOD_DECLARATION":
+        return STATIC_METHOD_DECLARATION;
+      case "STATIC_METHOD_REFERENCE":
+        return STATIC_METHOD_REFERENCE;
+      case "STATIC_SETTER_DECLARATION":
+        return STATIC_SETTER_DECLARATION;
+      case "STATIC_SETTER_REFERENCE":
+        return STATIC_SETTER_REFERENCE;
+      case "TOP_LEVEL_FUNCTION_DECLARATION":
+        return TOP_LEVEL_FUNCTION_DECLARATION;
+      case "TOP_LEVEL_FUNCTION_REFERENCE":
+        return TOP_LEVEL_FUNCTION_REFERENCE;
+      case "TOP_LEVEL_GETTER_DECLARATION":
+        return TOP_LEVEL_GETTER_DECLARATION;
+      case "TOP_LEVEL_GETTER_REFERENCE":
+        return TOP_LEVEL_GETTER_REFERENCE;
+      case "TOP_LEVEL_SETTER_DECLARATION":
+        return TOP_LEVEL_SETTER_DECLARATION;
+      case "TOP_LEVEL_SETTER_REFERENCE":
+        return TOP_LEVEL_SETTER_REFERENCE;
+      case "TOP_LEVEL_VARIABLE_DECLARATION":
+        return TOP_LEVEL_VARIABLE_DECLARATION;
+      case "TYPE_NAME_DYNAMIC":
+        return TYPE_NAME_DYNAMIC;
+      case "TYPE_PARAMETER":
+        return TYPE_PARAMETER;
+      case "UNRESOLVED_INSTANCE_MEMBER_REFERENCE":
+        return UNRESOLVED_INSTANCE_MEMBER_REFERENCE;
+      case "VALID_STRING_ESCAPE":
+        return VALID_STRING_ESCAPE;
+    }
+    throw new Exception('Illegal enum value: $name');
+  }
+
+  factory HighlightRegionType.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json is String) {
+      try {
+        return new HighlightRegionType(json);
+      } catch(_) {
+        // Fall through
+      }
+    }
+    throw jsonDecoder.mismatch(jsonPath, "HighlightRegionType", json);
+  }
+
+  @override
+  String toString() => "HighlightRegionType.$name";
+
+  String toJson() => name;
+}
+
+/**
+ * HoverInformation
+ *
+ * {
+ *   "offset": int
+ *   "length": int
+ *   "containingLibraryPath": optional String
+ *   "containingLibraryName": optional String
+ *   "containingClassDescription": optional String
+ *   "dartdoc": optional String
+ *   "elementDescription": optional String
+ *   "elementKind": optional String
+ *   "parameter": optional String
+ *   "propagatedType": optional String
+ *   "staticType": optional String
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class HoverInformation implements HasToJson {
+  int _offset;
+
+  int _length;
+
+  String _containingLibraryPath;
+
+  String _containingLibraryName;
+
+  String _containingClassDescription;
+
+  String _dartdoc;
+
+  String _elementDescription;
+
+  String _elementKind;
+
+  String _parameter;
+
+  String _propagatedType;
+
+  String _staticType;
+
+  /**
+   * The offset of the range of characters that encompasses the cursor position
+   * and has the same hover information as the cursor position.
+   */
+  int get offset => _offset;
+
+  /**
+   * The offset of the range of characters that encompasses the cursor position
+   * and has the same hover information as the cursor position.
+   */
+  void set offset(int value) {
+    assert(value != null);
+    this._offset = value;
+  }
+
+  /**
+   * The length of the range of characters that encompasses the cursor position
+   * and has the same hover information as the cursor position.
+   */
+  int get length => _length;
+
+  /**
+   * The length of the range of characters that encompasses the cursor position
+   * and has the same hover information as the cursor position.
+   */
+  void set length(int value) {
+    assert(value != null);
+    this._length = value;
+  }
+
+  /**
+   * The path to the defining compilation unit of the library in which the
+   * referenced element is declared. This data is omitted if there is no
+   * referenced element, or if the element is declared inside an HTML file.
+   */
+  String get containingLibraryPath => _containingLibraryPath;
+
+  /**
+   * The path to the defining compilation unit of the library in which the
+   * referenced element is declared. This data is omitted if there is no
+   * referenced element, or if the element is declared inside an HTML file.
+   */
+  void set containingLibraryPath(String value) {
+    this._containingLibraryPath = value;
+  }
+
+  /**
+   * The name of the library in which the referenced element is declared. This
+   * data is omitted if there is no referenced element, or if the element is
+   * declared inside an HTML file.
+   */
+  String get containingLibraryName => _containingLibraryName;
+
+  /**
+   * The name of the library in which the referenced element is declared. This
+   * data is omitted if there is no referenced element, or if the element is
+   * declared inside an HTML file.
+   */
+  void set containingLibraryName(String value) {
+    this._containingLibraryName = value;
+  }
+
+  /**
+   * A human-readable description of the class declaring the element being
+   * referenced. This data is omitted if there is no referenced element, or if
+   * the element is not a class member.
+   */
+  String get containingClassDescription => _containingClassDescription;
+
+  /**
+   * A human-readable description of the class declaring the element being
+   * referenced. This data is omitted if there is no referenced element, or if
+   * the element is not a class member.
+   */
+  void set containingClassDescription(String value) {
+    this._containingClassDescription = value;
+  }
+
+  /**
+   * The dartdoc associated with the referenced element. Other than the removal
+   * of the comment delimiters, including leading asterisks in the case of a
+   * block comment, the dartdoc is unprocessed markdown. This data is omitted
+   * if there is no referenced element, or if the element has no dartdoc.
+   */
+  String get dartdoc => _dartdoc;
+
+  /**
+   * The dartdoc associated with the referenced element. Other than the removal
+   * of the comment delimiters, including leading asterisks in the case of a
+   * block comment, the dartdoc is unprocessed markdown. This data is omitted
+   * if there is no referenced element, or if the element has no dartdoc.
+   */
+  void set dartdoc(String value) {
+    this._dartdoc = value;
+  }
+
+  /**
+   * A human-readable description of the element being referenced. This data is
+   * omitted if there is no referenced element.
+   */
+  String get elementDescription => _elementDescription;
+
+  /**
+   * A human-readable description of the element being referenced. This data is
+   * omitted if there is no referenced element.
+   */
+  void set elementDescription(String value) {
+    this._elementDescription = value;
+  }
+
+  /**
+   * A human-readable description of the kind of element being referenced (such
+   * as “class” or “function type alias”). This data is omitted if there is no
+   * referenced element.
+   */
+  String get elementKind => _elementKind;
+
+  /**
+   * A human-readable description of the kind of element being referenced (such
+   * as “class” or “function type alias”). This data is omitted if there is no
+   * referenced element.
+   */
+  void set elementKind(String value) {
+    this._elementKind = value;
+  }
+
+  /**
+   * A human-readable description of the parameter corresponding to the
+   * expression being hovered over. This data is omitted if the location is not
+   * in an argument to a function.
+   */
+  String get parameter => _parameter;
+
+  /**
+   * A human-readable description of the parameter corresponding to the
+   * expression being hovered over. This data is omitted if the location is not
+   * in an argument to a function.
+   */
+  void set parameter(String value) {
+    this._parameter = value;
+  }
+
+  /**
+   * The name of the propagated type of the expression. This data is omitted if
+   * the location does not correspond to an expression or if there is no
+   * propagated type information.
+   */
+  String get propagatedType => _propagatedType;
+
+  /**
+   * The name of the propagated type of the expression. This data is omitted if
+   * the location does not correspond to an expression or if there is no
+   * propagated type information.
+   */
+  void set propagatedType(String value) {
+    this._propagatedType = value;
+  }
+
+  /**
+   * The name of the static type of the expression. This data is omitted if the
+   * location does not correspond to an expression.
+   */
+  String get staticType => _staticType;
+
+  /**
+   * The name of the static type of the expression. This data is omitted if the
+   * location does not correspond to an expression.
+   */
+  void set staticType(String value) {
+    this._staticType = value;
+  }
+
+  HoverInformation(int offset, int length, {String containingLibraryPath, String containingLibraryName, String containingClassDescription, String dartdoc, String elementDescription, String elementKind, String parameter, String propagatedType, String staticType}) {
+    this.offset = offset;
+    this.length = length;
+    this.containingLibraryPath = containingLibraryPath;
+    this.containingLibraryName = containingLibraryName;
+    this.containingClassDescription = containingClassDescription;
+    this.dartdoc = dartdoc;
+    this.elementDescription = elementDescription;
+    this.elementKind = elementKind;
+    this.parameter = parameter;
+    this.propagatedType = propagatedType;
+    this.staticType = staticType;
+  }
+
+  factory HoverInformation.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      int offset;
+      if (json.containsKey("offset")) {
+        offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "offset");
+      }
+      int length;
+      if (json.containsKey("length")) {
+        length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "length");
+      }
+      String containingLibraryPath;
+      if (json.containsKey("containingLibraryPath")) {
+        containingLibraryPath = jsonDecoder.decodeString(jsonPath + ".containingLibraryPath", json["containingLibraryPath"]);
+      }
+      String containingLibraryName;
+      if (json.containsKey("containingLibraryName")) {
+        containingLibraryName = jsonDecoder.decodeString(jsonPath + ".containingLibraryName", json["containingLibraryName"]);
+      }
+      String containingClassDescription;
+      if (json.containsKey("containingClassDescription")) {
+        containingClassDescription = jsonDecoder.decodeString(jsonPath + ".containingClassDescription", json["containingClassDescription"]);
+      }
+      String dartdoc;
+      if (json.containsKey("dartdoc")) {
+        dartdoc = jsonDecoder.decodeString(jsonPath + ".dartdoc", json["dartdoc"]);
+      }
+      String elementDescription;
+      if (json.containsKey("elementDescription")) {
+        elementDescription = jsonDecoder.decodeString(jsonPath + ".elementDescription", json["elementDescription"]);
+      }
+      String elementKind;
+      if (json.containsKey("elementKind")) {
+        elementKind = jsonDecoder.decodeString(jsonPath + ".elementKind", json["elementKind"]);
+      }
+      String parameter;
+      if (json.containsKey("parameter")) {
+        parameter = jsonDecoder.decodeString(jsonPath + ".parameter", json["parameter"]);
+      }
+      String propagatedType;
+      if (json.containsKey("propagatedType")) {
+        propagatedType = jsonDecoder.decodeString(jsonPath + ".propagatedType", json["propagatedType"]);
+      }
+      String staticType;
+      if (json.containsKey("staticType")) {
+        staticType = jsonDecoder.decodeString(jsonPath + ".staticType", json["staticType"]);
+      }
+      return new HoverInformation(offset, length, containingLibraryPath: containingLibraryPath, containingLibraryName: containingLibraryName, containingClassDescription: containingClassDescription, dartdoc: dartdoc, elementDescription: elementDescription, elementKind: elementKind, parameter: parameter, propagatedType: propagatedType, staticType: staticType);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "HoverInformation", json);
+    }
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["offset"] = offset;
+    result["length"] = length;
+    if (containingLibraryPath != null) {
+      result["containingLibraryPath"] = containingLibraryPath;
+    }
+    if (containingLibraryName != null) {
+      result["containingLibraryName"] = containingLibraryName;
+    }
+    if (containingClassDescription != null) {
+      result["containingClassDescription"] = containingClassDescription;
+    }
+    if (dartdoc != null) {
+      result["dartdoc"] = dartdoc;
+    }
+    if (elementDescription != null) {
+      result["elementDescription"] = elementDescription;
+    }
+    if (elementKind != null) {
+      result["elementKind"] = elementKind;
+    }
+    if (parameter != null) {
+      result["parameter"] = parameter;
+    }
+    if (propagatedType != null) {
+      result["propagatedType"] = propagatedType;
+    }
+    if (staticType != null) {
+      result["staticType"] = staticType;
+    }
+    return result;
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is HoverInformation) {
+      return offset == other.offset &&
+          length == other.length &&
+          containingLibraryPath == other.containingLibraryPath &&
+          containingLibraryName == other.containingLibraryName &&
+          containingClassDescription == other.containingClassDescription &&
+          dartdoc == other.dartdoc &&
+          elementDescription == other.elementDescription &&
+          elementKind == other.elementKind &&
+          parameter == other.parameter &&
+          propagatedType == other.propagatedType &&
+          staticType == other.staticType;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, offset.hashCode);
+    hash = JenkinsSmiHash.combine(hash, length.hashCode);
+    hash = JenkinsSmiHash.combine(hash, containingLibraryPath.hashCode);
+    hash = JenkinsSmiHash.combine(hash, containingLibraryName.hashCode);
+    hash = JenkinsSmiHash.combine(hash, containingClassDescription.hashCode);
+    hash = JenkinsSmiHash.combine(hash, dartdoc.hashCode);
+    hash = JenkinsSmiHash.combine(hash, elementDescription.hashCode);
+    hash = JenkinsSmiHash.combine(hash, elementKind.hashCode);
+    hash = JenkinsSmiHash.combine(hash, parameter.hashCode);
+    hash = JenkinsSmiHash.combine(hash, propagatedType.hashCode);
+    hash = JenkinsSmiHash.combine(hash, staticType.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * ImplementedClass
+ *
+ * {
+ *   "offset": int
+ *   "length": int
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class ImplementedClass implements HasToJson {
+  int _offset;
+
+  int _length;
+
+  /**
+   * The offset of the name of the implemented class.
+   */
+  int get offset => _offset;
+
+  /**
+   * The offset of the name of the implemented class.
+   */
+  void set offset(int value) {
+    assert(value != null);
+    this._offset = value;
+  }
+
+  /**
+   * The length of the name of the implemented class.
+   */
+  int get length => _length;
+
+  /**
+   * The length of the name of the implemented class.
+   */
+  void set length(int value) {
+    assert(value != null);
+    this._length = value;
+  }
+
+  ImplementedClass(int offset, int length) {
+    this.offset = offset;
+    this.length = length;
+  }
+
+  factory ImplementedClass.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      int offset;
+      if (json.containsKey("offset")) {
+        offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "offset");
+      }
+      int length;
+      if (json.containsKey("length")) {
+        length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "length");
+      }
+      return new ImplementedClass(offset, length);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "ImplementedClass", json);
+    }
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["offset"] = offset;
+    result["length"] = length;
+    return result;
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is ImplementedClass) {
+      return offset == other.offset &&
+          length == other.length;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, offset.hashCode);
+    hash = JenkinsSmiHash.combine(hash, length.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * ImplementedMember
+ *
+ * {
+ *   "offset": int
+ *   "length": int
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class ImplementedMember implements HasToJson {
+  int _offset;
+
+  int _length;
+
+  /**
+   * The offset of the name of the implemented member.
+   */
+  int get offset => _offset;
+
+  /**
+   * The offset of the name of the implemented member.
+   */
+  void set offset(int value) {
+    assert(value != null);
+    this._offset = value;
+  }
+
+  /**
+   * The length of the name of the implemented member.
+   */
+  int get length => _length;
+
+  /**
+   * The length of the name of the implemented member.
+   */
+  void set length(int value) {
+    assert(value != null);
+    this._length = value;
+  }
+
+  ImplementedMember(int offset, int length) {
+    this.offset = offset;
+    this.length = length;
+  }
+
+  factory ImplementedMember.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      int offset;
+      if (json.containsKey("offset")) {
+        offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "offset");
+      }
+      int length;
+      if (json.containsKey("length")) {
+        length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "length");
+      }
+      return new ImplementedMember(offset, length);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "ImplementedMember", json);
+    }
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["offset"] = offset;
+    result["length"] = length;
+    return result;
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is ImplementedMember) {
+      return offset == other.offset &&
+          length == other.length;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, offset.hashCode);
+    hash = JenkinsSmiHash.combine(hash, length.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * LinkedEditGroup
+ *
+ * {
+ *   "positions": List<Position>
+ *   "length": int
+ *   "suggestions": List<LinkedEditSuggestion>
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class LinkedEditGroup implements HasToJson {
+  List<Position> _positions;
+
+  int _length;
+
+  List<LinkedEditSuggestion> _suggestions;
+
+  /**
+   * The positions of the regions that should be edited simultaneously.
+   */
+  List<Position> get positions => _positions;
+
+  /**
+   * The positions of the regions that should be edited simultaneously.
+   */
+  void set positions(List<Position> value) {
+    assert(value != null);
+    this._positions = value;
+  }
+
+  /**
+   * The length of the regions that should be edited simultaneously.
+   */
+  int get length => _length;
+
+  /**
+   * The length of the regions that should be edited simultaneously.
+   */
+  void set length(int value) {
+    assert(value != null);
+    this._length = value;
+  }
+
+  /**
+   * Pre-computed suggestions for what every region might want to be changed
+   * to.
+   */
+  List<LinkedEditSuggestion> get suggestions => _suggestions;
+
+  /**
+   * Pre-computed suggestions for what every region might want to be changed
+   * to.
+   */
+  void set suggestions(List<LinkedEditSuggestion> value) {
+    assert(value != null);
+    this._suggestions = value;
+  }
+
+  LinkedEditGroup(List<Position> positions, int length, List<LinkedEditSuggestion> suggestions) {
+    this.positions = positions;
+    this.length = length;
+    this.suggestions = suggestions;
+  }
+
+  factory LinkedEditGroup.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      List<Position> positions;
+      if (json.containsKey("positions")) {
+        positions = jsonDecoder.decodeList(jsonPath + ".positions", json["positions"], (String jsonPath, Object json) => new Position.fromJson(jsonDecoder, jsonPath, json));
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "positions");
+      }
+      int length;
+      if (json.containsKey("length")) {
+        length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "length");
+      }
+      List<LinkedEditSuggestion> suggestions;
+      if (json.containsKey("suggestions")) {
+        suggestions = jsonDecoder.decodeList(jsonPath + ".suggestions", json["suggestions"], (String jsonPath, Object json) => new LinkedEditSuggestion.fromJson(jsonDecoder, jsonPath, json));
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "suggestions");
+      }
+      return new LinkedEditGroup(positions, length, suggestions);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "LinkedEditGroup", json);
+    }
+  }
+
+  /**
+   * Construct an empty LinkedEditGroup.
+   */
+  LinkedEditGroup.empty() : this(<Position>[], 0, <LinkedEditSuggestion>[]);
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["positions"] = positions.map((Position value) => value.toJson()).toList();
+    result["length"] = length;
+    result["suggestions"] = suggestions.map((LinkedEditSuggestion value) => value.toJson()).toList();
+    return result;
+  }
+
+  /**
+   * Add a new position and change the length.
+   */
+  void addPosition(Position position, int length) {
+    positions.add(position);
+    this.length = length;
+  }
+
+  /**
+   * Add a new suggestion.
+   */
+  void addSuggestion(LinkedEditSuggestion suggestion) {
+    suggestions.add(suggestion);
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is LinkedEditGroup) {
+      return listEqual(positions, other.positions, (Position a, Position b) => a == b) &&
+          length == other.length &&
+          listEqual(suggestions, other.suggestions, (LinkedEditSuggestion a, LinkedEditSuggestion b) => a == b);
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, positions.hashCode);
+    hash = JenkinsSmiHash.combine(hash, length.hashCode);
+    hash = JenkinsSmiHash.combine(hash, suggestions.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * LinkedEditSuggestion
+ *
+ * {
+ *   "value": String
+ *   "kind": LinkedEditSuggestionKind
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class LinkedEditSuggestion implements HasToJson {
+  String _value;
+
+  LinkedEditSuggestionKind _kind;
+
+  /**
+   * The value that could be used to replace all of the linked edit regions.
+   */
+  String get value => _value;
+
+  /**
+   * The value that could be used to replace all of the linked edit regions.
+   */
+  void set value(String value) {
+    assert(value != null);
+    this._value = value;
+  }
+
+  /**
+   * The kind of value being proposed.
+   */
+  LinkedEditSuggestionKind get kind => _kind;
+
+  /**
+   * The kind of value being proposed.
+   */
+  void set kind(LinkedEditSuggestionKind value) {
+    assert(value != null);
+    this._kind = value;
+  }
+
+  LinkedEditSuggestion(String value, LinkedEditSuggestionKind kind) {
+    this.value = value;
+    this.kind = kind;
+  }
+
+  factory LinkedEditSuggestion.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      String value;
+      if (json.containsKey("value")) {
+        value = jsonDecoder.decodeString(jsonPath + ".value", json["value"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "value");
+      }
+      LinkedEditSuggestionKind kind;
+      if (json.containsKey("kind")) {
+        kind = new LinkedEditSuggestionKind.fromJson(jsonDecoder, jsonPath + ".kind", json["kind"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "kind");
+      }
+      return new LinkedEditSuggestion(value, kind);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "LinkedEditSuggestion", json);
+    }
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["value"] = value;
+    result["kind"] = kind.toJson();
+    return result;
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is LinkedEditSuggestion) {
+      return value == other.value &&
+          kind == other.kind;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, value.hashCode);
+    hash = JenkinsSmiHash.combine(hash, kind.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * LinkedEditSuggestionKind
+ *
+ * enum {
+ *   METHOD
+ *   PARAMETER
+ *   TYPE
+ *   VARIABLE
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class LinkedEditSuggestionKind implements Enum {
+  static const METHOD = const LinkedEditSuggestionKind._("METHOD");
+
+  static const PARAMETER = const LinkedEditSuggestionKind._("PARAMETER");
+
+  static const TYPE = const LinkedEditSuggestionKind._("TYPE");
+
+  static const VARIABLE = const LinkedEditSuggestionKind._("VARIABLE");
+
+  /**
+   * A list containing all of the enum values that are defined.
+   */
+  static const List<LinkedEditSuggestionKind> VALUES = const <LinkedEditSuggestionKind>[METHOD, PARAMETER, TYPE, VARIABLE];
+
+  final String name;
+
+  const LinkedEditSuggestionKind._(this.name);
+
+  factory LinkedEditSuggestionKind(String name) {
+    switch (name) {
+      case "METHOD":
+        return METHOD;
+      case "PARAMETER":
+        return PARAMETER;
+      case "TYPE":
+        return TYPE;
+      case "VARIABLE":
+        return VARIABLE;
+    }
+    throw new Exception('Illegal enum value: $name');
+  }
+
+  factory LinkedEditSuggestionKind.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json is String) {
+      try {
+        return new LinkedEditSuggestionKind(json);
+      } catch(_) {
+        // Fall through
+      }
+    }
+    throw jsonDecoder.mismatch(jsonPath, "LinkedEditSuggestionKind", json);
+  }
+
+  @override
+  String toString() => "LinkedEditSuggestionKind.$name";
+
+  String toJson() => name;
+}
+
+/**
+ * Location
+ *
+ * {
+ *   "file": FilePath
+ *   "offset": int
+ *   "length": int
+ *   "startLine": int
+ *   "startColumn": int
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class Location implements HasToJson {
+  String _file;
+
+  int _offset;
+
+  int _length;
+
+  int _startLine;
+
+  int _startColumn;
+
+  /**
+   * The file containing the range.
+   */
+  String get file => _file;
+
+  /**
+   * The file containing the range.
+   */
+  void set file(String value) {
+    assert(value != null);
+    this._file = value;
+  }
+
+  /**
+   * The offset of the range.
+   */
+  int get offset => _offset;
+
+  /**
+   * The offset of the range.
+   */
+  void set offset(int value) {
+    assert(value != null);
+    this._offset = value;
+  }
+
+  /**
+   * The length of the range.
+   */
+  int get length => _length;
+
+  /**
+   * The length of the range.
+   */
+  void set length(int value) {
+    assert(value != null);
+    this._length = value;
+  }
+
+  /**
+   * The one-based index of the line containing the first character of the
+   * range.
+   */
+  int get startLine => _startLine;
+
+  /**
+   * The one-based index of the line containing the first character of the
+   * range.
+   */
+  void set startLine(int value) {
+    assert(value != null);
+    this._startLine = value;
+  }
+
+  /**
+   * The one-based index of the column containing the first character of the
+   * range.
+   */
+  int get startColumn => _startColumn;
+
+  /**
+   * The one-based index of the column containing the first character of the
+   * range.
+   */
+  void set startColumn(int value) {
+    assert(value != null);
+    this._startColumn = value;
+  }
+
+  Location(String file, int offset, int length, int startLine, int startColumn) {
+    this.file = file;
+    this.offset = offset;
+    this.length = length;
+    this.startLine = startLine;
+    this.startColumn = startColumn;
+  }
+
+  factory Location.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      String file;
+      if (json.containsKey("file")) {
+        file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "file");
+      }
+      int offset;
+      if (json.containsKey("offset")) {
+        offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "offset");
+      }
+      int length;
+      if (json.containsKey("length")) {
+        length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "length");
+      }
+      int startLine;
+      if (json.containsKey("startLine")) {
+        startLine = jsonDecoder.decodeInt(jsonPath + ".startLine", json["startLine"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "startLine");
+      }
+      int startColumn;
+      if (json.containsKey("startColumn")) {
+        startColumn = jsonDecoder.decodeInt(jsonPath + ".startColumn", json["startColumn"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "startColumn");
+      }
+      return new Location(file, offset, length, startLine, startColumn);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "Location", json);
+    }
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["file"] = file;
+    result["offset"] = offset;
+    result["length"] = length;
+    result["startLine"] = startLine;
+    result["startColumn"] = startColumn;
+    return result;
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is Location) {
+      return file == other.file &&
+          offset == other.offset &&
+          length == other.length &&
+          startLine == other.startLine &&
+          startColumn == other.startColumn;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, file.hashCode);
+    hash = JenkinsSmiHash.combine(hash, offset.hashCode);
+    hash = JenkinsSmiHash.combine(hash, length.hashCode);
+    hash = JenkinsSmiHash.combine(hash, startLine.hashCode);
+    hash = JenkinsSmiHash.combine(hash, startColumn.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * NavigationRegion
+ *
+ * {
+ *   "offset": int
+ *   "length": int
+ *   "targets": List<int>
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class NavigationRegion implements HasToJson {
+  int _offset;
+
+  int _length;
+
+  List<int> _targets;
+
+  /**
+   * The offset of the region from which the user can navigate.
+   */
+  int get offset => _offset;
+
+  /**
+   * The offset of the region from which the user can navigate.
+   */
+  void set offset(int value) {
+    assert(value != null);
+    this._offset = value;
+  }
+
+  /**
+   * The length of the region from which the user can navigate.
+   */
+  int get length => _length;
+
+  /**
+   * The length of the region from which the user can navigate.
+   */
+  void set length(int value) {
+    assert(value != null);
+    this._length = value;
+  }
+
+  /**
+   * The indexes of the targets (in the enclosing navigation response) to which
+   * the given region is bound. By opening the target, clients can implement
+   * one form of navigation. This list cannot be empty.
+   */
+  List<int> get targets => _targets;
+
+  /**
+   * The indexes of the targets (in the enclosing navigation response) to which
+   * the given region is bound. By opening the target, clients can implement
+   * one form of navigation. This list cannot be empty.
+   */
+  void set targets(List<int> value) {
+    assert(value != null);
+    this._targets = value;
+  }
+
+  NavigationRegion(int offset, int length, List<int> targets) {
+    this.offset = offset;
+    this.length = length;
+    this.targets = targets;
+  }
+
+  factory NavigationRegion.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      int offset;
+      if (json.containsKey("offset")) {
+        offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "offset");
+      }
+      int length;
+      if (json.containsKey("length")) {
+        length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "length");
+      }
+      List<int> targets;
+      if (json.containsKey("targets")) {
+        targets = jsonDecoder.decodeList(jsonPath + ".targets", json["targets"], jsonDecoder.decodeInt);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "targets");
+      }
+      return new NavigationRegion(offset, length, targets);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "NavigationRegion", json);
+    }
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["offset"] = offset;
+    result["length"] = length;
+    result["targets"] = targets;
+    return result;
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is NavigationRegion) {
+      return offset == other.offset &&
+          length == other.length &&
+          listEqual(targets, other.targets, (int a, int b) => a == b);
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, offset.hashCode);
+    hash = JenkinsSmiHash.combine(hash, length.hashCode);
+    hash = JenkinsSmiHash.combine(hash, targets.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * NavigationTarget
+ *
+ * {
+ *   "kind": ElementKind
+ *   "fileIndex": int
+ *   "offset": int
+ *   "length": int
+ *   "startLine": int
+ *   "startColumn": int
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class NavigationTarget implements HasToJson {
+  ElementKind _kind;
+
+  int _fileIndex;
+
+  int _offset;
+
+  int _length;
+
+  int _startLine;
+
+  int _startColumn;
+
+  /**
+   * The kind of the element.
+   */
+  ElementKind get kind => _kind;
+
+  /**
+   * The kind of the element.
+   */
+  void set kind(ElementKind value) {
+    assert(value != null);
+    this._kind = value;
+  }
+
+  /**
+   * The index of the file (in the enclosing navigation response) to navigate
+   * to.
+   */
+  int get fileIndex => _fileIndex;
+
+  /**
+   * The index of the file (in the enclosing navigation response) to navigate
+   * to.
+   */
+  void set fileIndex(int value) {
+    assert(value != null);
+    this._fileIndex = value;
+  }
+
+  /**
+   * The offset of the region from which the user can navigate.
+   */
+  int get offset => _offset;
+
+  /**
+   * The offset of the region from which the user can navigate.
+   */
+  void set offset(int value) {
+    assert(value != null);
+    this._offset = value;
+  }
+
+  /**
+   * The length of the region from which the user can navigate.
+   */
+  int get length => _length;
+
+  /**
+   * The length of the region from which the user can navigate.
+   */
+  void set length(int value) {
+    assert(value != null);
+    this._length = value;
+  }
+
+  /**
+   * The one-based index of the line containing the first character of the
+   * region.
+   */
+  int get startLine => _startLine;
+
+  /**
+   * The one-based index of the line containing the first character of the
+   * region.
+   */
+  void set startLine(int value) {
+    assert(value != null);
+    this._startLine = value;
+  }
+
+  /**
+   * The one-based index of the column containing the first character of the
+   * region.
+   */
+  int get startColumn => _startColumn;
+
+  /**
+   * The one-based index of the column containing the first character of the
+   * region.
+   */
+  void set startColumn(int value) {
+    assert(value != null);
+    this._startColumn = value;
+  }
+
+  NavigationTarget(ElementKind kind, int fileIndex, int offset, int length, int startLine, int startColumn) {
+    this.kind = kind;
+    this.fileIndex = fileIndex;
+    this.offset = offset;
+    this.length = length;
+    this.startLine = startLine;
+    this.startColumn = startColumn;
+  }
+
+  factory NavigationTarget.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      ElementKind kind;
+      if (json.containsKey("kind")) {
+        kind = new ElementKind.fromJson(jsonDecoder, jsonPath + ".kind", json["kind"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "kind");
+      }
+      int fileIndex;
+      if (json.containsKey("fileIndex")) {
+        fileIndex = jsonDecoder.decodeInt(jsonPath + ".fileIndex", json["fileIndex"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "fileIndex");
+      }
+      int offset;
+      if (json.containsKey("offset")) {
+        offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "offset");
+      }
+      int length;
+      if (json.containsKey("length")) {
+        length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "length");
+      }
+      int startLine;
+      if (json.containsKey("startLine")) {
+        startLine = jsonDecoder.decodeInt(jsonPath + ".startLine", json["startLine"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "startLine");
+      }
+      int startColumn;
+      if (json.containsKey("startColumn")) {
+        startColumn = jsonDecoder.decodeInt(jsonPath + ".startColumn", json["startColumn"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "startColumn");
+      }
+      return new NavigationTarget(kind, fileIndex, offset, length, startLine, startColumn);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "NavigationTarget", json);
+    }
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["kind"] = kind.toJson();
+    result["fileIndex"] = fileIndex;
+    result["offset"] = offset;
+    result["length"] = length;
+    result["startLine"] = startLine;
+    result["startColumn"] = startColumn;
+    return result;
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is NavigationTarget) {
+      return kind == other.kind &&
+          fileIndex == other.fileIndex &&
+          offset == other.offset &&
+          length == other.length &&
+          startLine == other.startLine &&
+          startColumn == other.startColumn;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, kind.hashCode);
+    hash = JenkinsSmiHash.combine(hash, fileIndex.hashCode);
+    hash = JenkinsSmiHash.combine(hash, offset.hashCode);
+    hash = JenkinsSmiHash.combine(hash, length.hashCode);
+    hash = JenkinsSmiHash.combine(hash, startLine.hashCode);
+    hash = JenkinsSmiHash.combine(hash, startColumn.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * Occurrences
+ *
+ * {
+ *   "element": Element
+ *   "offsets": List<int>
+ *   "length": int
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class Occurrences implements HasToJson {
+  Element _element;
+
+  List<int> _offsets;
+
+  int _length;
+
+  /**
+   * The element that was referenced.
+   */
+  Element get element => _element;
+
+  /**
+   * The element that was referenced.
+   */
+  void set element(Element value) {
+    assert(value != null);
+    this._element = value;
+  }
+
+  /**
+   * The offsets of the name of the referenced element within the file.
+   */
+  List<int> get offsets => _offsets;
+
+  /**
+   * The offsets of the name of the referenced element within the file.
+   */
+  void set offsets(List<int> value) {
+    assert(value != null);
+    this._offsets = value;
+  }
+
+  /**
+   * The length of the name of the referenced element.
+   */
+  int get length => _length;
+
+  /**
+   * The length of the name of the referenced element.
+   */
+  void set length(int value) {
+    assert(value != null);
+    this._length = value;
+  }
+
+  Occurrences(Element element, List<int> offsets, int length) {
+    this.element = element;
+    this.offsets = offsets;
+    this.length = length;
+  }
+
+  factory Occurrences.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      Element element;
+      if (json.containsKey("element")) {
+        element = new Element.fromJson(jsonDecoder, jsonPath + ".element", json["element"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "element");
+      }
+      List<int> offsets;
+      if (json.containsKey("offsets")) {
+        offsets = jsonDecoder.decodeList(jsonPath + ".offsets", json["offsets"], jsonDecoder.decodeInt);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "offsets");
+      }
+      int length;
+      if (json.containsKey("length")) {
+        length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "length");
+      }
+      return new Occurrences(element, offsets, length);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "Occurrences", json);
+    }
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["element"] = element.toJson();
+    result["offsets"] = offsets;
+    result["length"] = length;
+    return result;
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is Occurrences) {
+      return element == other.element &&
+          listEqual(offsets, other.offsets, (int a, int b) => a == b) &&
+          length == other.length;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, element.hashCode);
+    hash = JenkinsSmiHash.combine(hash, offsets.hashCode);
+    hash = JenkinsSmiHash.combine(hash, length.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * Outline
+ *
+ * {
+ *   "element": Element
+ *   "offset": int
+ *   "length": int
+ *   "children": optional List<Outline>
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class Outline implements HasToJson {
+  Element _element;
+
+  int _offset;
+
+  int _length;
+
+  List<Outline> _children;
+
+  /**
+   * A description of the element represented by this node.
+   */
+  Element get element => _element;
+
+  /**
+   * A description of the element represented by this node.
+   */
+  void set element(Element value) {
+    assert(value != null);
+    this._element = value;
+  }
+
+  /**
+   * The offset of the first character of the element. This is different than
+   * the offset in the Element, which if the offset of the name of the element.
+   * It can be used, for example, to map locations in the file back to an
+   * outline.
+   */
+  int get offset => _offset;
+
+  /**
+   * The offset of the first character of the element. This is different than
+   * the offset in the Element, which if the offset of the name of the element.
+   * It can be used, for example, to map locations in the file back to an
+   * outline.
+   */
+  void set offset(int value) {
+    assert(value != null);
+    this._offset = value;
+  }
+
+  /**
+   * The length of the element.
+   */
+  int get length => _length;
+
+  /**
+   * The length of the element.
+   */
+  void set length(int value) {
+    assert(value != null);
+    this._length = value;
+  }
+
+  /**
+   * The children of the node. The field will be omitted if the node has no
+   * children.
+   */
+  List<Outline> get children => _children;
+
+  /**
+   * The children of the node. The field will be omitted if the node has no
+   * children.
+   */
+  void set children(List<Outline> value) {
+    this._children = value;
+  }
+
+  Outline(Element element, int offset, int length, {List<Outline> children}) {
+    this.element = element;
+    this.offset = offset;
+    this.length = length;
+    this.children = children;
+  }
+
+  factory Outline.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      Element element;
+      if (json.containsKey("element")) {
+        element = new Element.fromJson(jsonDecoder, jsonPath + ".element", json["element"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "element");
+      }
+      int offset;
+      if (json.containsKey("offset")) {
+        offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "offset");
+      }
+      int length;
+      if (json.containsKey("length")) {
+        length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "length");
+      }
+      List<Outline> children;
+      if (json.containsKey("children")) {
+        children = jsonDecoder.decodeList(jsonPath + ".children", json["children"], (String jsonPath, Object json) => new Outline.fromJson(jsonDecoder, jsonPath, json));
+      }
+      return new Outline(element, offset, length, children: children);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "Outline", json);
+    }
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["element"] = element.toJson();
+    result["offset"] = offset;
+    result["length"] = length;
+    if (children != null) {
+      result["children"] = children.map((Outline value) => value.toJson()).toList();
+    }
+    return result;
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is Outline) {
+      return element == other.element &&
+          offset == other.offset &&
+          length == other.length &&
+          listEqual(children, other.children, (Outline a, Outline b) => a == b);
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, element.hashCode);
+    hash = JenkinsSmiHash.combine(hash, offset.hashCode);
+    hash = JenkinsSmiHash.combine(hash, length.hashCode);
+    hash = JenkinsSmiHash.combine(hash, children.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * Override
+ *
+ * {
+ *   "offset": int
+ *   "length": int
+ *   "superclassMember": optional OverriddenMember
+ *   "interfaceMembers": optional List<OverriddenMember>
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class Override implements HasToJson {
+  int _offset;
+
+  int _length;
+
+  OverriddenMember _superclassMember;
+
+  List<OverriddenMember> _interfaceMembers;
+
+  /**
+   * The offset of the name of the overriding member.
+   */
+  int get offset => _offset;
+
+  /**
+   * The offset of the name of the overriding member.
+   */
+  void set offset(int value) {
+    assert(value != null);
+    this._offset = value;
+  }
+
+  /**
+   * The length of the name of the overriding member.
+   */
+  int get length => _length;
+
+  /**
+   * The length of the name of the overriding member.
+   */
+  void set length(int value) {
+    assert(value != null);
+    this._length = value;
+  }
+
+  /**
+   * The member inherited from a superclass that is overridden by the
+   * overriding member. The field is omitted if there is no superclass member,
+   * in which case there must be at least one interface member.
+   */
+  OverriddenMember get superclassMember => _superclassMember;
+
+  /**
+   * The member inherited from a superclass that is overridden by the
+   * overriding member. The field is omitted if there is no superclass member,
+   * in which case there must be at least one interface member.
+   */
+  void set superclassMember(OverriddenMember value) {
+    this._superclassMember = value;
+  }
+
+  /**
+   * The members inherited from interfaces that are overridden by the
+   * overriding member. The field is omitted if there are no interface members,
+   * in which case there must be a superclass member.
+   */
+  List<OverriddenMember> get interfaceMembers => _interfaceMembers;
+
+  /**
+   * The members inherited from interfaces that are overridden by the
+   * overriding member. The field is omitted if there are no interface members,
+   * in which case there must be a superclass member.
+   */
+  void set interfaceMembers(List<OverriddenMember> value) {
+    this._interfaceMembers = value;
+  }
+
+  Override(int offset, int length, {OverriddenMember superclassMember, List<OverriddenMember> interfaceMembers}) {
+    this.offset = offset;
+    this.length = length;
+    this.superclassMember = superclassMember;
+    this.interfaceMembers = interfaceMembers;
+  }
+
+  factory Override.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      int offset;
+      if (json.containsKey("offset")) {
+        offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "offset");
+      }
+      int length;
+      if (json.containsKey("length")) {
+        length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "length");
+      }
+      OverriddenMember superclassMember;
+      if (json.containsKey("superclassMember")) {
+        superclassMember = new OverriddenMember.fromJson(jsonDecoder, jsonPath + ".superclassMember", json["superclassMember"]);
+      }
+      List<OverriddenMember> interfaceMembers;
+      if (json.containsKey("interfaceMembers")) {
+        interfaceMembers = jsonDecoder.decodeList(jsonPath + ".interfaceMembers", json["interfaceMembers"], (String jsonPath, Object json) => new OverriddenMember.fromJson(jsonDecoder, jsonPath, json));
+      }
+      return new Override(offset, length, superclassMember: superclassMember, interfaceMembers: interfaceMembers);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "Override", json);
+    }
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["offset"] = offset;
+    result["length"] = length;
+    if (superclassMember != null) {
+      result["superclassMember"] = superclassMember.toJson();
+    }
+    if (interfaceMembers != null) {
+      result["interfaceMembers"] = interfaceMembers.map((OverriddenMember value) => value.toJson()).toList();
+    }
+    return result;
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is Override) {
+      return offset == other.offset &&
+          length == other.length &&
+          superclassMember == other.superclassMember &&
+          listEqual(interfaceMembers, other.interfaceMembers, (OverriddenMember a, OverriddenMember b) => a == b);
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, offset.hashCode);
+    hash = JenkinsSmiHash.combine(hash, length.hashCode);
+    hash = JenkinsSmiHash.combine(hash, superclassMember.hashCode);
+    hash = JenkinsSmiHash.combine(hash, interfaceMembers.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * OverriddenMember
+ *
+ * {
+ *   "element": Element
+ *   "className": String
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class OverriddenMember implements HasToJson {
+  Element _element;
+
+  String _className;
+
+  /**
+   * The element that is being overridden.
+   */
+  Element get element => _element;
+
+  /**
+   * The element that is being overridden.
+   */
+  void set element(Element value) {
+    assert(value != null);
+    this._element = value;
+  }
+
+  /**
+   * The name of the class in which the member is defined.
+   */
+  String get className => _className;
+
+  /**
+   * The name of the class in which the member is defined.
+   */
+  void set className(String value) {
+    assert(value != null);
+    this._className = value;
+  }
+
+  OverriddenMember(Element element, String className) {
+    this.element = element;
+    this.className = className;
+  }
+
+  factory OverriddenMember.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      Element element;
+      if (json.containsKey("element")) {
+        element = new Element.fromJson(jsonDecoder, jsonPath + ".element", json["element"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "element");
+      }
+      String className;
+      if (json.containsKey("className")) {
+        className = jsonDecoder.decodeString(jsonPath + ".className", json["className"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "className");
+      }
+      return new OverriddenMember(element, className);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "OverriddenMember", json);
+    }
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["element"] = element.toJson();
+    result["className"] = className;
+    return result;
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is OverriddenMember) {
+      return element == other.element &&
+          className == other.className;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, element.hashCode);
+    hash = JenkinsSmiHash.combine(hash, className.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * Position
+ *
+ * {
+ *   "file": FilePath
+ *   "offset": int
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class Position implements HasToJson {
+  String _file;
+
+  int _offset;
+
+  /**
+   * The file containing the position.
+   */
+  String get file => _file;
+
+  /**
+   * The file containing the position.
+   */
+  void set file(String value) {
+    assert(value != null);
+    this._file = value;
+  }
+
+  /**
+   * The offset of the position.
+   */
+  int get offset => _offset;
+
+  /**
+   * The offset of the position.
+   */
+  void set offset(int value) {
+    assert(value != null);
+    this._offset = value;
+  }
+
+  Position(String file, int offset) {
+    this.file = file;
+    this.offset = offset;
+  }
+
+  factory Position.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      String file;
+      if (json.containsKey("file")) {
+        file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "file");
+      }
+      int offset;
+      if (json.containsKey("offset")) {
+        offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "offset");
+      }
+      return new Position(file, offset);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "Position", json);
+    }
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["file"] = file;
+    result["offset"] = offset;
+    return result;
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is Position) {
+      return file == other.file &&
+          offset == other.offset;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, file.hashCode);
+    hash = JenkinsSmiHash.combine(hash, offset.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * PubStatus
+ *
+ * {
+ *   "isListingPackageDirs": bool
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class PubStatus implements HasToJson {
+  bool _isListingPackageDirs;
+
+  /**
+   * True if the server is currently running pub to produce a list of package
+   * directories.
+   */
+  bool get isListingPackageDirs => _isListingPackageDirs;
+
+  /**
+   * True if the server is currently running pub to produce a list of package
+   * directories.
+   */
+  void set isListingPackageDirs(bool value) {
+    assert(value != null);
+    this._isListingPackageDirs = value;
+  }
+
+  PubStatus(bool isListingPackageDirs) {
+    this.isListingPackageDirs = isListingPackageDirs;
+  }
+
+  factory PubStatus.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      bool isListingPackageDirs;
+      if (json.containsKey("isListingPackageDirs")) {
+        isListingPackageDirs = jsonDecoder.decodeBool(jsonPath + ".isListingPackageDirs", json["isListingPackageDirs"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "isListingPackageDirs");
+      }
+      return new PubStatus(isListingPackageDirs);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "PubStatus", json);
+    }
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["isListingPackageDirs"] = isListingPackageDirs;
+    return result;
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is PubStatus) {
+      return isListingPackageDirs == other.isListingPackageDirs;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, isListingPackageDirs.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * RefactoringKind
+ *
+ * enum {
+ *   CONVERT_GETTER_TO_METHOD
+ *   CONVERT_METHOD_TO_GETTER
+ *   EXTRACT_LOCAL_VARIABLE
+ *   EXTRACT_METHOD
+ *   INLINE_LOCAL_VARIABLE
+ *   INLINE_METHOD
+ *   MOVE_FILE
+ *   RENAME
+ *   SORT_MEMBERS
+ * }
+ *
+ * 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 CONVERT_METHOD_TO_GETTER = const RefactoringKind._("CONVERT_METHOD_TO_GETTER");
+
+  static const EXTRACT_LOCAL_VARIABLE = const RefactoringKind._("EXTRACT_LOCAL_VARIABLE");
+
+  static const EXTRACT_METHOD = const RefactoringKind._("EXTRACT_METHOD");
+
+  static const INLINE_LOCAL_VARIABLE = const RefactoringKind._("INLINE_LOCAL_VARIABLE");
+
+  static const INLINE_METHOD = const RefactoringKind._("INLINE_METHOD");
+
+  static const MOVE_FILE = const RefactoringKind._("MOVE_FILE");
+
+  static const RENAME = const RefactoringKind._("RENAME");
+
+  static const SORT_MEMBERS = const RefactoringKind._("SORT_MEMBERS");
+
+  /**
+   * A list containing all of the enum values that are defined.
+   */
+  static const List<RefactoringKind> VALUES = const <RefactoringKind>[CONVERT_GETTER_TO_METHOD, CONVERT_METHOD_TO_GETTER, EXTRACT_LOCAL_VARIABLE, EXTRACT_METHOD, INLINE_LOCAL_VARIABLE, INLINE_METHOD, MOVE_FILE, RENAME, SORT_MEMBERS];
+
+  final String name;
+
+  const RefactoringKind._(this.name);
+
+  factory RefactoringKind(String name) {
+    switch (name) {
+      case "CONVERT_GETTER_TO_METHOD":
+        return CONVERT_GETTER_TO_METHOD;
+      case "CONVERT_METHOD_TO_GETTER":
+        return CONVERT_METHOD_TO_GETTER;
+      case "EXTRACT_LOCAL_VARIABLE":
+        return EXTRACT_LOCAL_VARIABLE;
+      case "EXTRACT_METHOD":
+        return EXTRACT_METHOD;
+      case "INLINE_LOCAL_VARIABLE":
+        return INLINE_LOCAL_VARIABLE;
+      case "INLINE_METHOD":
+        return INLINE_METHOD;
+      case "MOVE_FILE":
+        return MOVE_FILE;
+      case "RENAME":
+        return RENAME;
+      case "SORT_MEMBERS":
+        return SORT_MEMBERS;
+    }
+    throw new Exception('Illegal enum value: $name');
+  }
+
+  factory RefactoringKind.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json is String) {
+      try {
+        return new RefactoringKind(json);
+      } catch(_) {
+        // Fall through
+      }
+    }
+    throw jsonDecoder.mismatch(jsonPath, "RefactoringKind", json);
+  }
+
+  @override
+  String toString() => "RefactoringKind.$name";
+
+  String toJson() => name;
+}
+
+/**
+ * RefactoringMethodParameter
+ *
+ * {
+ *   "id": optional String
+ *   "kind": RefactoringMethodParameterKind
+ *   "type": String
+ *   "name": String
+ *   "parameters": optional String
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class RefactoringMethodParameter implements HasToJson {
+  String _id;
+
+  RefactoringMethodParameterKind _kind;
+
+  String _type;
+
+  String _name;
+
+  String _parameters;
+
+  /**
+   * The unique identifier of the parameter. Clients may omit this field for
+   * the parameters they want to add.
+   */
+  String get id => _id;
+
+  /**
+   * The unique identifier of the parameter. Clients may omit this field for
+   * the parameters they want to add.
+   */
+  void set id(String value) {
+    this._id = value;
+  }
+
+  /**
+   * The kind of the parameter.
+   */
+  RefactoringMethodParameterKind get kind => _kind;
+
+  /**
+   * The kind of the parameter.
+   */
+  void set kind(RefactoringMethodParameterKind value) {
+    assert(value != null);
+    this._kind = value;
+  }
+
+  /**
+   * The type that should be given to the parameter, or the return type of the
+   * parameter's function type.
+   */
+  String get type => _type;
+
+  /**
+   * The type that should be given to the parameter, or the return type of the
+   * parameter's function type.
+   */
+  void set type(String value) {
+    assert(value != null);
+    this._type = value;
+  }
+
+  /**
+   * The name that should be given to the parameter.
+   */
+  String get name => _name;
+
+  /**
+   * The name that should be given to the parameter.
+   */
+  void set name(String value) {
+    assert(value != null);
+    this._name = value;
+  }
+
+  /**
+   * The parameter list of the parameter's function type. If the parameter is
+   * not of a function type, this field will not be defined. If the function
+   * type has zero parameters, this field will have a value of "()".
+   */
+  String get parameters => _parameters;
+
+  /**
+   * The parameter list of the parameter's function type. If the parameter is
+   * not of a function type, this field will not be defined. If the function
+   * type has zero parameters, this field will have a value of "()".
+   */
+  void set parameters(String value) {
+    this._parameters = value;
+  }
+
+  RefactoringMethodParameter(RefactoringMethodParameterKind kind, String type, String name, {String id, String parameters}) {
+    this.id = id;
+    this.kind = kind;
+    this.type = type;
+    this.name = name;
+    this.parameters = parameters;
+  }
+
+  factory RefactoringMethodParameter.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      String id;
+      if (json.containsKey("id")) {
+        id = jsonDecoder.decodeString(jsonPath + ".id", json["id"]);
+      }
+      RefactoringMethodParameterKind kind;
+      if (json.containsKey("kind")) {
+        kind = new RefactoringMethodParameterKind.fromJson(jsonDecoder, jsonPath + ".kind", json["kind"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "kind");
+      }
+      String type;
+      if (json.containsKey("type")) {
+        type = jsonDecoder.decodeString(jsonPath + ".type", json["type"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "type");
+      }
+      String name;
+      if (json.containsKey("name")) {
+        name = jsonDecoder.decodeString(jsonPath + ".name", json["name"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "name");
+      }
+      String parameters;
+      if (json.containsKey("parameters")) {
+        parameters = jsonDecoder.decodeString(jsonPath + ".parameters", json["parameters"]);
+      }
+      return new RefactoringMethodParameter(kind, type, name, id: id, parameters: parameters);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "RefactoringMethodParameter", json);
+    }
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    if (id != null) {
+      result["id"] = id;
+    }
+    result["kind"] = kind.toJson();
+    result["type"] = type;
+    result["name"] = name;
+    if (parameters != null) {
+      result["parameters"] = parameters;
+    }
+    return result;
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is RefactoringMethodParameter) {
+      return id == other.id &&
+          kind == other.kind &&
+          type == other.type &&
+          name == other.name &&
+          parameters == other.parameters;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, id.hashCode);
+    hash = JenkinsSmiHash.combine(hash, kind.hashCode);
+    hash = JenkinsSmiHash.combine(hash, type.hashCode);
+    hash = JenkinsSmiHash.combine(hash, name.hashCode);
+    hash = JenkinsSmiHash.combine(hash, parameters.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * RefactoringFeedback
+ *
+ * {
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class RefactoringFeedback implements HasToJson {
+  RefactoringFeedback();
+
+  factory RefactoringFeedback.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json, Map responseJson) {
+    return refactoringFeedbackFromJson(jsonDecoder, jsonPath, json, responseJson);
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    return result;
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is RefactoringFeedback) {
+      return true;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * RefactoringOptions
+ *
+ * {
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class RefactoringOptions implements HasToJson {
+  RefactoringOptions();
+
+  factory RefactoringOptions.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json, RefactoringKind kind) {
+    return refactoringOptionsFromJson(jsonDecoder, jsonPath, json, kind);
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    return result;
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is RefactoringOptions) {
+      return true;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * RefactoringMethodParameterKind
+ *
+ * enum {
+ *   REQUIRED
+ *   POSITIONAL
+ *   NAMED
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class RefactoringMethodParameterKind implements Enum {
+  static const REQUIRED = const RefactoringMethodParameterKind._("REQUIRED");
+
+  static const POSITIONAL = const RefactoringMethodParameterKind._("POSITIONAL");
+
+  static const NAMED = const RefactoringMethodParameterKind._("NAMED");
+
+  /**
+   * A list containing all of the enum values that are defined.
+   */
+  static const List<RefactoringMethodParameterKind> VALUES = const <RefactoringMethodParameterKind>[REQUIRED, POSITIONAL, NAMED];
+
+  final String name;
+
+  const RefactoringMethodParameterKind._(this.name);
+
+  factory RefactoringMethodParameterKind(String name) {
+    switch (name) {
+      case "REQUIRED":
+        return REQUIRED;
+      case "POSITIONAL":
+        return POSITIONAL;
+      case "NAMED":
+        return NAMED;
+    }
+    throw new Exception('Illegal enum value: $name');
+  }
+
+  factory RefactoringMethodParameterKind.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json is String) {
+      try {
+        return new RefactoringMethodParameterKind(json);
+      } catch(_) {
+        // Fall through
+      }
+    }
+    throw jsonDecoder.mismatch(jsonPath, "RefactoringMethodParameterKind", json);
+  }
+
+  @override
+  String toString() => "RefactoringMethodParameterKind.$name";
+
+  String toJson() => name;
+}
+
+/**
+ * RefactoringProblem
+ *
+ * {
+ *   "severity": RefactoringProblemSeverity
+ *   "message": String
+ *   "location": optional Location
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class RefactoringProblem implements HasToJson {
+  RefactoringProblemSeverity _severity;
+
+  String _message;
+
+  Location _location;
+
+  /**
+   * The severity of the problem being represented.
+   */
+  RefactoringProblemSeverity get severity => _severity;
+
+  /**
+   * The severity of the problem being represented.
+   */
+  void set severity(RefactoringProblemSeverity value) {
+    assert(value != null);
+    this._severity = value;
+  }
+
+  /**
+   * A human-readable description of the problem being represented.
+   */
+  String get message => _message;
+
+  /**
+   * A human-readable description of the problem being represented.
+   */
+  void set message(String value) {
+    assert(value != null);
+    this._message = value;
+  }
+
+  /**
+   * The location of the problem being represented. This field is omitted
+   * unless there is a specific location associated with the problem (such as a
+   * location where an element being renamed will be shadowed).
+   */
+  Location get location => _location;
+
+  /**
+   * The location of the problem being represented. This field is omitted
+   * unless there is a specific location associated with the problem (such as a
+   * location where an element being renamed will be shadowed).
+   */
+  void set location(Location value) {
+    this._location = value;
+  }
+
+  RefactoringProblem(RefactoringProblemSeverity severity, String message, {Location location}) {
+    this.severity = severity;
+    this.message = message;
+    this.location = location;
+  }
+
+  factory RefactoringProblem.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      RefactoringProblemSeverity severity;
+      if (json.containsKey("severity")) {
+        severity = new RefactoringProblemSeverity.fromJson(jsonDecoder, jsonPath + ".severity", json["severity"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "severity");
+      }
+      String message;
+      if (json.containsKey("message")) {
+        message = jsonDecoder.decodeString(jsonPath + ".message", json["message"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "message");
+      }
+      Location location;
+      if (json.containsKey("location")) {
+        location = new Location.fromJson(jsonDecoder, jsonPath + ".location", json["location"]);
+      }
+      return new RefactoringProblem(severity, message, location: location);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "RefactoringProblem", json);
+    }
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["severity"] = severity.toJson();
+    result["message"] = message;
+    if (location != null) {
+      result["location"] = location.toJson();
+    }
+    return result;
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is RefactoringProblem) {
+      return severity == other.severity &&
+          message == other.message &&
+          location == other.location;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, severity.hashCode);
+    hash = JenkinsSmiHash.combine(hash, message.hashCode);
+    hash = JenkinsSmiHash.combine(hash, location.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * RefactoringProblemSeverity
+ *
+ * enum {
+ *   INFO
+ *   WARNING
+ *   ERROR
+ *   FATAL
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class RefactoringProblemSeverity implements Enum {
+  static const INFO = const RefactoringProblemSeverity._("INFO");
+
+  static const WARNING = const RefactoringProblemSeverity._("WARNING");
+
+  static const ERROR = const RefactoringProblemSeverity._("ERROR");
+
+  static const FATAL = const RefactoringProblemSeverity._("FATAL");
+
+  /**
+   * A list containing all of the enum values that are defined.
+   */
+  static const List<RefactoringProblemSeverity> VALUES = const <RefactoringProblemSeverity>[INFO, WARNING, ERROR, FATAL];
+
+  final String name;
+
+  const RefactoringProblemSeverity._(this.name);
+
+  factory RefactoringProblemSeverity(String name) {
+    switch (name) {
+      case "INFO":
+        return INFO;
+      case "WARNING":
+        return WARNING;
+      case "ERROR":
+        return ERROR;
+      case "FATAL":
+        return FATAL;
+    }
+    throw new Exception('Illegal enum value: $name');
+  }
+
+  factory RefactoringProblemSeverity.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json is String) {
+      try {
+        return new RefactoringProblemSeverity(json);
+      } catch(_) {
+        // Fall through
+      }
+    }
+    throw jsonDecoder.mismatch(jsonPath, "RefactoringProblemSeverity", json);
+  }
+
+  /**
+   * Returns the [RefactoringProblemSeverity] with the maximal severity.
+   */
+  static RefactoringProblemSeverity max(RefactoringProblemSeverity a, RefactoringProblemSeverity b) =>
+      maxRefactoringProblemSeverity(a, b);
+
+  @override
+  String toString() => "RefactoringProblemSeverity.$name";
+
+  String toJson() => name;
+}
+
+/**
+ * RemoveContentOverlay
+ *
+ * {
+ *   "type": "remove"
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class RemoveContentOverlay implements HasToJson {
+  RemoveContentOverlay();
+
+  factory RemoveContentOverlay.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      if (json["type"] != "remove") {
+        throw jsonDecoder.mismatch(jsonPath, "equal " + "remove", json);
+      }
+      return new RemoveContentOverlay();
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "RemoveContentOverlay", json);
+    }
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["type"] = "remove";
+    return result;
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is RemoveContentOverlay) {
+      return true;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, 114870849);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * RequestError
+ *
+ * {
+ *   "code": RequestErrorCode
+ *   "message": String
+ *   "stackTrace": optional String
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class RequestError implements HasToJson {
+  RequestErrorCode _code;
+
+  String _message;
+
+  String _stackTrace;
+
+  /**
+   * A code that uniquely identifies the error that occurred.
+   */
+  RequestErrorCode get code => _code;
+
+  /**
+   * A code that uniquely identifies the error that occurred.
+   */
+  void set code(RequestErrorCode value) {
+    assert(value != null);
+    this._code = value;
+  }
+
+  /**
+   * A short description of the error.
+   */
+  String get message => _message;
+
+  /**
+   * A short description of the error.
+   */
+  void set message(String value) {
+    assert(value != null);
+    this._message = value;
+  }
+
+  /**
+   * The stack trace associated with processing the request, used for debugging
+   * the server.
+   */
+  String get stackTrace => _stackTrace;
+
+  /**
+   * The stack trace associated with processing the request, used for debugging
+   * the server.
+   */
+  void set stackTrace(String value) {
+    this._stackTrace = value;
+  }
+
+  RequestError(RequestErrorCode code, String message, {String stackTrace}) {
+    this.code = code;
+    this.message = message;
+    this.stackTrace = stackTrace;
+  }
+
+  factory RequestError.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      RequestErrorCode code;
+      if (json.containsKey("code")) {
+        code = new RequestErrorCode.fromJson(jsonDecoder, jsonPath + ".code", json["code"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "code");
+      }
+      String message;
+      if (json.containsKey("message")) {
+        message = jsonDecoder.decodeString(jsonPath + ".message", json["message"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "message");
+      }
+      String stackTrace;
+      if (json.containsKey("stackTrace")) {
+        stackTrace = jsonDecoder.decodeString(jsonPath + ".stackTrace", json["stackTrace"]);
+      }
+      return new RequestError(code, message, stackTrace: stackTrace);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "RequestError", json);
+    }
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["code"] = code.toJson();
+    result["message"] = message;
+    if (stackTrace != null) {
+      result["stackTrace"] = stackTrace;
+    }
+    return result;
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is RequestError) {
+      return code == other.code &&
+          message == other.message &&
+          stackTrace == other.stackTrace;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, code.hashCode);
+    hash = JenkinsSmiHash.combine(hash, message.hashCode);
+    hash = JenkinsSmiHash.combine(hash, stackTrace.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * RequestErrorCode
+ *
+ * enum {
+ *   CONTENT_MODIFIED
+ *   FILE_NOT_ANALYZED
+ *   FORMAT_INVALID_FILE
+ *   FORMAT_WITH_ERRORS
+ *   GET_ERRORS_INVALID_FILE
+ *   GET_NAVIGATION_INVALID_FILE
+ *   INVALID_ANALYSIS_ROOT
+ *   INVALID_EXECUTION_CONTEXT
+ *   INVALID_OVERLAY_CHANGE
+ *   INVALID_PARAMETER
+ *   INVALID_REQUEST
+ *   NO_INDEX_GENERATED
+ *   ORGANIZE_DIRECTIVES_ERROR
+ *   REFACTORING_REQUEST_CANCELLED
+ *   SERVER_ALREADY_STARTED
+ *   SERVER_ERROR
+ *   SORT_MEMBERS_INVALID_FILE
+ *   SORT_MEMBERS_PARSE_ERRORS
+ *   UNANALYZED_PRIORITY_FILES
+ *   UNKNOWN_REQUEST
+ *   UNKNOWN_SOURCE
+ *   UNSUPPORTED_FEATURE
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class RequestErrorCode implements Enum {
+  /**
+   * An "analysis.getErrors" or "analysis.getNavigation" request could not be
+   * satisfied because the content of the file changed before the requested
+   * results could be computed.
+   */
+  static const 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");
+
+  /**
+   * 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");
+
+  /**
+   * An "edit.format" request specified a file that contains syntax errors.
+   */
+  static const 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");
+
+  /**
+   * 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");
+
+  /**
+   * 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");
+
+  /**
+   * The context root used to create an execution context does not exist.
+   */
+  static const INVALID_EXECUTION_CONTEXT = const RequestErrorCode._("INVALID_EXECUTION_CONTEXT");
+
+  /**
+   * 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");
+
+  /**
+   * One of the method parameters was invalid.
+   */
+  static const INVALID_PARAMETER = const RequestErrorCode._("INVALID_PARAMETER");
+
+  /**
+   * A malformed request was received.
+   */
+  static const 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");
+
+  /**
+   * 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");
+
+  /**
+   * Another refactoring request was received during processing of this one.
+   */
+  static const REFACTORING_REQUEST_CANCELLED = const RequestErrorCode._("REFACTORING_REQUEST_CANCELLED");
+
+  /**
+   * The analysis server has already been started (and hence won't accept new
+   * connections).
+   *
+   * This error is included for future expansion; at present the analysis
+   * 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");
+
+  /**
+   * An internal error occurred in the analysis server. Also see the
+   * server.error notification.
+   */
+  static const 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");
+
+  /**
+   * 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");
+
+  /**
+   * An "analysis.setPriorityFiles" request includes one or more files that are
+   * not being analyzed.
+   *
+   * 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");
+
+  /**
+   * 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");
+
+  /**
+   * The analysis server was requested to perform an action on a source that
+   * does not exist.
+   */
+  static const UNKNOWN_SOURCE = const RequestErrorCode._("UNKNOWN_SOURCE");
+
+  /**
+   * The analysis server was requested to perform an action which is not
+   * supported.
+   *
+   * This is a legacy error; it will be removed before the API reaches version
+   * 1.0.
+   */
+  static const UNSUPPORTED_FEATURE = const RequestErrorCode._("UNSUPPORTED_FEATURE");
+
+  /**
+   * A list containing all of the enum values that are defined.
+   */
+  static const List<RequestErrorCode> VALUES = const <RequestErrorCode>[CONTENT_MODIFIED, FILE_NOT_ANALYZED, FORMAT_INVALID_FILE, FORMAT_WITH_ERRORS, GET_ERRORS_INVALID_FILE, GET_NAVIGATION_INVALID_FILE, INVALID_ANALYSIS_ROOT, INVALID_EXECUTION_CONTEXT, INVALID_OVERLAY_CHANGE, INVALID_PARAMETER, INVALID_REQUEST, NO_INDEX_GENERATED, ORGANIZE_DIRECTIVES_ERROR, REFACTORING_REQUEST_CANCELLED, SERVER_ALREADY_STARTED, SERVER_ERROR, SORT_MEMBERS_INVALID_FILE, SORT_MEMBERS_PARSE_ERRORS, UNANALYZED_PRIORITY_FILES, UNKNOWN_REQUEST, UNKNOWN_SOURCE, UNSUPPORTED_FEATURE];
+
+  final String name;
+
+  const RequestErrorCode._(this.name);
+
+  factory RequestErrorCode(String name) {
+    switch (name) {
+      case "CONTENT_MODIFIED":
+        return CONTENT_MODIFIED;
+      case "FILE_NOT_ANALYZED":
+        return FILE_NOT_ANALYZED;
+      case "FORMAT_INVALID_FILE":
+        return FORMAT_INVALID_FILE;
+      case "FORMAT_WITH_ERRORS":
+        return FORMAT_WITH_ERRORS;
+      case "GET_ERRORS_INVALID_FILE":
+        return GET_ERRORS_INVALID_FILE;
+      case "GET_NAVIGATION_INVALID_FILE":
+        return GET_NAVIGATION_INVALID_FILE;
+      case "INVALID_ANALYSIS_ROOT":
+        return INVALID_ANALYSIS_ROOT;
+      case "INVALID_EXECUTION_CONTEXT":
+        return INVALID_EXECUTION_CONTEXT;
+      case "INVALID_OVERLAY_CHANGE":
+        return INVALID_OVERLAY_CHANGE;
+      case "INVALID_PARAMETER":
+        return INVALID_PARAMETER;
+      case "INVALID_REQUEST":
+        return INVALID_REQUEST;
+      case "NO_INDEX_GENERATED":
+        return NO_INDEX_GENERATED;
+      case "ORGANIZE_DIRECTIVES_ERROR":
+        return ORGANIZE_DIRECTIVES_ERROR;
+      case "REFACTORING_REQUEST_CANCELLED":
+        return REFACTORING_REQUEST_CANCELLED;
+      case "SERVER_ALREADY_STARTED":
+        return SERVER_ALREADY_STARTED;
+      case "SERVER_ERROR":
+        return SERVER_ERROR;
+      case "SORT_MEMBERS_INVALID_FILE":
+        return SORT_MEMBERS_INVALID_FILE;
+      case "SORT_MEMBERS_PARSE_ERRORS":
+        return SORT_MEMBERS_PARSE_ERRORS;
+      case "UNANALYZED_PRIORITY_FILES":
+        return UNANALYZED_PRIORITY_FILES;
+      case "UNKNOWN_REQUEST":
+        return UNKNOWN_REQUEST;
+      case "UNKNOWN_SOURCE":
+        return UNKNOWN_SOURCE;
+      case "UNSUPPORTED_FEATURE":
+        return UNSUPPORTED_FEATURE;
+    }
+    throw new Exception('Illegal enum value: $name');
+  }
+
+  factory RequestErrorCode.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json is String) {
+      try {
+        return new RequestErrorCode(json);
+      } catch(_) {
+        // Fall through
+      }
+    }
+    throw jsonDecoder.mismatch(jsonPath, "RequestErrorCode", json);
+  }
+
+  @override
+  String toString() => "RequestErrorCode.$name";
+
+  String toJson() => name;
+}
+
+/**
+ * SearchResult
+ *
+ * {
+ *   "location": Location
+ *   "kind": SearchResultKind
+ *   "isPotential": bool
+ *   "path": List<Element>
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class SearchResult implements HasToJson {
+  Location _location;
+
+  SearchResultKind _kind;
+
+  bool _isPotential;
+
+  List<Element> _path;
+
+  /**
+   * The location of the code that matched the search criteria.
+   */
+  Location get location => _location;
+
+  /**
+   * The location of the code that matched the search criteria.
+   */
+  void set location(Location value) {
+    assert(value != null);
+    this._location = value;
+  }
+
+  /**
+   * The kind of element that was found or the kind of reference that was
+   * found.
+   */
+  SearchResultKind get kind => _kind;
+
+  /**
+   * The kind of element that was found or the kind of reference that was
+   * found.
+   */
+  void set kind(SearchResultKind value) {
+    assert(value != null);
+    this._kind = value;
+  }
+
+  /**
+   * True if the result is a potential match but cannot be confirmed to be a
+   * match. For example, if all references to a method m defined in some class
+   * were requested, and a reference to a method m from an unknown class were
+   * found, it would be marked as being a potential match.
+   */
+  bool get isPotential => _isPotential;
+
+  /**
+   * True if the result is a potential match but cannot be confirmed to be a
+   * match. For example, if all references to a method m defined in some class
+   * were requested, and a reference to a method m from an unknown class were
+   * found, it would be marked as being a potential match.
+   */
+  void set isPotential(bool value) {
+    assert(value != null);
+    this._isPotential = value;
+  }
+
+  /**
+   * The elements that contain the result, starting with the most immediately
+   * enclosing ancestor and ending with the library.
+   */
+  List<Element> get path => _path;
+
+  /**
+   * The elements that contain the result, starting with the most immediately
+   * enclosing ancestor and ending with the library.
+   */
+  void set path(List<Element> value) {
+    assert(value != null);
+    this._path = value;
+  }
+
+  SearchResult(Location location, SearchResultKind kind, bool isPotential, List<Element> path) {
+    this.location = location;
+    this.kind = kind;
+    this.isPotential = isPotential;
+    this.path = path;
+  }
+
+  factory SearchResult.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      Location location;
+      if (json.containsKey("location")) {
+        location = new Location.fromJson(jsonDecoder, jsonPath + ".location", json["location"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "location");
+      }
+      SearchResultKind kind;
+      if (json.containsKey("kind")) {
+        kind = new SearchResultKind.fromJson(jsonDecoder, jsonPath + ".kind", json["kind"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "kind");
+      }
+      bool isPotential;
+      if (json.containsKey("isPotential")) {
+        isPotential = jsonDecoder.decodeBool(jsonPath + ".isPotential", json["isPotential"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "isPotential");
+      }
+      List<Element> path;
+      if (json.containsKey("path")) {
+        path = jsonDecoder.decodeList(jsonPath + ".path", json["path"], (String jsonPath, Object json) => new Element.fromJson(jsonDecoder, jsonPath, json));
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "path");
+      }
+      return new SearchResult(location, kind, isPotential, path);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "SearchResult", json);
+    }
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["location"] = location.toJson();
+    result["kind"] = kind.toJson();
+    result["isPotential"] = isPotential;
+    result["path"] = path.map((Element value) => value.toJson()).toList();
+    return result;
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is SearchResult) {
+      return location == other.location &&
+          kind == other.kind &&
+          isPotential == other.isPotential &&
+          listEqual(path, other.path, (Element a, Element b) => a == b);
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, location.hashCode);
+    hash = JenkinsSmiHash.combine(hash, kind.hashCode);
+    hash = JenkinsSmiHash.combine(hash, isPotential.hashCode);
+    hash = JenkinsSmiHash.combine(hash, path.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * SearchResultKind
+ *
+ * enum {
+ *   DECLARATION
+ *   INVOCATION
+ *   READ
+ *   READ_WRITE
+ *   REFERENCE
+ *   UNKNOWN
+ *   WRITE
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class SearchResultKind implements Enum {
+  /**
+   * The declaration of an element.
+   */
+  static const DECLARATION = const SearchResultKind._("DECLARATION");
+
+  /**
+   * The invocation of a function or method.
+   */
+  static const INVOCATION = const SearchResultKind._("INVOCATION");
+
+  /**
+   * A reference to a field, parameter or variable where it is being read.
+   */
+  static const 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");
+
+  /**
+   * A reference to an element.
+   */
+  static const REFERENCE = const SearchResultKind._("REFERENCE");
+
+  /**
+   * Some other kind of search result.
+   */
+  static const UNKNOWN = const SearchResultKind._("UNKNOWN");
+
+  /**
+   * A reference to a field, parameter or variable where it is being written.
+   */
+  static const WRITE = const SearchResultKind._("WRITE");
+
+  /**
+   * A list containing all of the enum values that are defined.
+   */
+  static const List<SearchResultKind> VALUES = const <SearchResultKind>[DECLARATION, INVOCATION, READ, READ_WRITE, REFERENCE, UNKNOWN, WRITE];
+
+  final String name;
+
+  const SearchResultKind._(this.name);
+
+  factory SearchResultKind(String name) {
+    switch (name) {
+      case "DECLARATION":
+        return DECLARATION;
+      case "INVOCATION":
+        return INVOCATION;
+      case "READ":
+        return READ;
+      case "READ_WRITE":
+        return READ_WRITE;
+      case "REFERENCE":
+        return REFERENCE;
+      case "UNKNOWN":
+        return UNKNOWN;
+      case "WRITE":
+        return WRITE;
+    }
+    throw new Exception('Illegal enum value: $name');
+  }
+
+  factory SearchResultKind.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json is String) {
+      try {
+        return new SearchResultKind(json);
+      } catch(_) {
+        // Fall through
+      }
+    }
+    throw jsonDecoder.mismatch(jsonPath, "SearchResultKind", json);
+  }
+
+  @override
+  String toString() => "SearchResultKind.$name";
+
+  String toJson() => name;
+}
+
+/**
+ * ServerService
+ *
+ * enum {
+ *   STATUS
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class ServerService implements Enum {
+  static const STATUS = const ServerService._("STATUS");
+
+  /**
+   * A list containing all of the enum values that are defined.
+   */
+  static const List<ServerService> VALUES = const <ServerService>[STATUS];
+
+  final String name;
+
+  const ServerService._(this.name);
+
+  factory ServerService(String name) {
+    switch (name) {
+      case "STATUS":
+        return STATUS;
+    }
+    throw new Exception('Illegal enum value: $name');
+  }
+
+  factory ServerService.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json is String) {
+      try {
+        return new ServerService(json);
+      } catch(_) {
+        // Fall through
+      }
+    }
+    throw jsonDecoder.mismatch(jsonPath, "ServerService", json);
+  }
+
+  @override
+  String toString() => "ServerService.$name";
+
+  String toJson() => name;
+}
+
+/**
+ * SourceChange
+ *
+ * {
+ *   "message": String
+ *   "edits": List<SourceFileEdit>
+ *   "linkedEditGroups": List<LinkedEditGroup>
+ *   "selection": optional Position
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class SourceChange implements HasToJson {
+  String _message;
+
+  List<SourceFileEdit> _edits;
+
+  List<LinkedEditGroup> _linkedEditGroups;
+
+  Position _selection;
+
+  /**
+   * A human-readable description of the change to be applied.
+   */
+  String get message => _message;
+
+  /**
+   * A human-readable description of the change to be applied.
+   */
+  void set message(String value) {
+    assert(value != null);
+    this._message = value;
+  }
+
+  /**
+   * A list of the edits used to effect the change, grouped by file.
+   */
+  List<SourceFileEdit> get edits => _edits;
+
+  /**
+   * A list of the edits used to effect the change, grouped by file.
+   */
+  void set edits(List<SourceFileEdit> value) {
+    assert(value != null);
+    this._edits = value;
+  }
+
+  /**
+   * A list of the linked editing groups used to customize the changes that
+   * were made.
+   */
+  List<LinkedEditGroup> get linkedEditGroups => _linkedEditGroups;
+
+  /**
+   * A list of the linked editing groups used to customize the changes that
+   * were made.
+   */
+  void set linkedEditGroups(List<LinkedEditGroup> value) {
+    assert(value != null);
+    this._linkedEditGroups = value;
+  }
+
+  /**
+   * The position that should be selected after the edits have been applied.
+   */
+  Position get selection => _selection;
+
+  /**
+   * The position that should be selected after the edits have been applied.
+   */
+  void set selection(Position value) {
+    this._selection = value;
+  }
+
+  SourceChange(String message, {List<SourceFileEdit> edits, List<LinkedEditGroup> linkedEditGroups, Position selection}) {
+    this.message = message;
+    if (edits == null) {
+      this.edits = <SourceFileEdit>[];
+    } else {
+      this.edits = edits;
+    }
+    if (linkedEditGroups == null) {
+      this.linkedEditGroups = <LinkedEditGroup>[];
+    } else {
+      this.linkedEditGroups = linkedEditGroups;
+    }
+    this.selection = selection;
+  }
+
+  factory SourceChange.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      String message;
+      if (json.containsKey("message")) {
+        message = jsonDecoder.decodeString(jsonPath + ".message", json["message"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "message");
+      }
+      List<SourceFileEdit> edits;
+      if (json.containsKey("edits")) {
+        edits = jsonDecoder.decodeList(jsonPath + ".edits", json["edits"], (String jsonPath, Object json) => new SourceFileEdit.fromJson(jsonDecoder, jsonPath, json));
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "edits");
+      }
+      List<LinkedEditGroup> linkedEditGroups;
+      if (json.containsKey("linkedEditGroups")) {
+        linkedEditGroups = jsonDecoder.decodeList(jsonPath + ".linkedEditGroups", json["linkedEditGroups"], (String jsonPath, Object json) => new LinkedEditGroup.fromJson(jsonDecoder, jsonPath, json));
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "linkedEditGroups");
+      }
+      Position selection;
+      if (json.containsKey("selection")) {
+        selection = new Position.fromJson(jsonDecoder, jsonPath + ".selection", json["selection"]);
+      }
+      return new SourceChange(message, edits: edits, linkedEditGroups: linkedEditGroups, selection: selection);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "SourceChange", json);
+    }
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["message"] = message;
+    result["edits"] = edits.map((SourceFileEdit value) => value.toJson()).toList();
+    result["linkedEditGroups"] = linkedEditGroups.map((LinkedEditGroup value) => value.toJson()).toList();
+    if (selection != null) {
+      result["selection"] = selection.toJson();
+    }
+    return result;
+  }
+
+  /**
+   * Adds [edit] to the [FileEdit] for the given [file].
+   */
+  void addEdit(String file, int fileStamp, SourceEdit edit) =>
+      addEditToSourceChange(this, file, fileStamp, edit);
+
+  /**
+   * Adds the given [FileEdit].
+   */
+  void addFileEdit(SourceFileEdit edit) {
+    edits.add(edit);
+  }
+
+  /**
+   * Adds the given [LinkedEditGroup].
+   */
+  void addLinkedEditGroup(LinkedEditGroup linkedEditGroup) {
+    linkedEditGroups.add(linkedEditGroup);
+  }
+
+  /**
+   * Returns the [FileEdit] for the given [file], maybe `null`.
+   */
+  SourceFileEdit getFileEdit(String file) =>
+      getChangeFileEdit(this, file);
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is SourceChange) {
+      return message == other.message &&
+          listEqual(edits, other.edits, (SourceFileEdit a, SourceFileEdit b) => a == b) &&
+          listEqual(linkedEditGroups, other.linkedEditGroups, (LinkedEditGroup a, LinkedEditGroup b) => a == b) &&
+          selection == other.selection;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, message.hashCode);
+    hash = JenkinsSmiHash.combine(hash, edits.hashCode);
+    hash = JenkinsSmiHash.combine(hash, linkedEditGroups.hashCode);
+    hash = JenkinsSmiHash.combine(hash, selection.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * SourceEdit
+ *
+ * {
+ *   "offset": int
+ *   "length": int
+ *   "replacement": String
+ *   "id": optional String
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class SourceEdit implements HasToJson {
+  /**
+   * Get the result of applying a set of [edits] to the given [code]. Edits are
+   * applied in the order they appear in [edits].
+   */
+  static String applySequence(String code, Iterable<SourceEdit> edits) =>
+      applySequenceOfEdits(code, edits);
+
+  int _offset;
+
+  int _length;
+
+  String _replacement;
+
+  String _id;
+
+  /**
+   * The offset of the region to be modified.
+   */
+  int get offset => _offset;
+
+  /**
+   * The offset of the region to be modified.
+   */
+  void set offset(int value) {
+    assert(value != null);
+    this._offset = value;
+  }
+
+  /**
+   * The length of the region to be modified.
+   */
+  int get length => _length;
+
+  /**
+   * The length of the region to be modified.
+   */
+  void set length(int value) {
+    assert(value != null);
+    this._length = value;
+  }
+
+  /**
+   * The code that is to replace the specified region in the original code.
+   */
+  String get replacement => _replacement;
+
+  /**
+   * The code that is to replace the specified region in the original code.
+   */
+  void set replacement(String value) {
+    assert(value != null);
+    this._replacement = value;
+  }
+
+  /**
+   * An identifier that uniquely identifies this source edit from other edits
+   * in the same response. This field is omitted unless a containing structure
+   * needs to be able to identify the edit for some reason.
+   *
+   * For example, some refactoring operations can produce edits that might not
+   * be appropriate (referred to as potential edits). Such edits will have an
+   * id so that they can be referenced. Edits in the same response that do not
+   * need to be referenced will not have an id.
+   */
+  String get id => _id;
+
+  /**
+   * An identifier that uniquely identifies this source edit from other edits
+   * in the same response. This field is omitted unless a containing structure
+   * needs to be able to identify the edit for some reason.
+   *
+   * For example, some refactoring operations can produce edits that might not
+   * be appropriate (referred to as potential edits). Such edits will have an
+   * id so that they can be referenced. Edits in the same response that do not
+   * need to be referenced will not have an id.
+   */
+  void set id(String value) {
+    this._id = value;
+  }
+
+  SourceEdit(int offset, int length, String replacement, {String id}) {
+    this.offset = offset;
+    this.length = length;
+    this.replacement = replacement;
+    this.id = id;
+  }
+
+  factory SourceEdit.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      int offset;
+      if (json.containsKey("offset")) {
+        offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "offset");
+      }
+      int length;
+      if (json.containsKey("length")) {
+        length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "length");
+      }
+      String replacement;
+      if (json.containsKey("replacement")) {
+        replacement = jsonDecoder.decodeString(jsonPath + ".replacement", json["replacement"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "replacement");
+      }
+      String id;
+      if (json.containsKey("id")) {
+        id = jsonDecoder.decodeString(jsonPath + ".id", json["id"]);
+      }
+      return new SourceEdit(offset, length, replacement, id: id);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "SourceEdit", json);
+    }
+  }
+
+  /**
+   * The end of the region to be modified.
+   */
+  int get end => offset + length;
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["offset"] = offset;
+    result["length"] = length;
+    result["replacement"] = replacement;
+    if (id != null) {
+      result["id"] = id;
+    }
+    return result;
+  }
+
+  /**
+   * Get the result of applying the edit to the given [code].
+   */
+  String apply(String code) => applyEdit(code, this);
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is SourceEdit) {
+      return offset == other.offset &&
+          length == other.length &&
+          replacement == other.replacement &&
+          id == other.id;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, offset.hashCode);
+    hash = JenkinsSmiHash.combine(hash, length.hashCode);
+    hash = JenkinsSmiHash.combine(hash, replacement.hashCode);
+    hash = JenkinsSmiHash.combine(hash, id.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * SourceFileEdit
+ *
+ * {
+ *   "file": FilePath
+ *   "fileStamp": long
+ *   "edits": List<SourceEdit>
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class SourceFileEdit implements HasToJson {
+  String _file;
+
+  int _fileStamp;
+
+  List<SourceEdit> _edits;
+
+  /**
+   * The file containing the code to be modified.
+   */
+  String get file => _file;
+
+  /**
+   * The file containing the code to be modified.
+   */
+  void set file(String value) {
+    assert(value != null);
+    this._file = value;
+  }
+
+  /**
+   * The modification stamp of the file at the moment when the change was
+   * created, in milliseconds since the "Unix epoch". Will be -1 if the file
+   * did not exist and should be created. The client may use this field to make
+   * sure that the file was not changed since then, so it is safe to apply the
+   * change.
+   */
+  int get fileStamp => _fileStamp;
+
+  /**
+   * The modification stamp of the file at the moment when the change was
+   * created, in milliseconds since the "Unix epoch". Will be -1 if the file
+   * did not exist and should be created. The client may use this field to make
+   * sure that the file was not changed since then, so it is safe to apply the
+   * change.
+   */
+  void set fileStamp(int value) {
+    assert(value != null);
+    this._fileStamp = value;
+  }
+
+  /**
+   * A list of the edits used to effect the change.
+   */
+  List<SourceEdit> get edits => _edits;
+
+  /**
+   * A list of the edits used to effect the change.
+   */
+  void set edits(List<SourceEdit> value) {
+    assert(value != null);
+    this._edits = value;
+  }
+
+  SourceFileEdit(String file, int fileStamp, {List<SourceEdit> edits}) {
+    this.file = file;
+    this.fileStamp = fileStamp;
+    if (edits == null) {
+      this.edits = <SourceEdit>[];
+    } else {
+      this.edits = edits;
+    }
+  }
+
+  factory SourceFileEdit.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      String file;
+      if (json.containsKey("file")) {
+        file = jsonDecoder.decodeString(jsonPath + ".file", json["file"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "file");
+      }
+      int fileStamp;
+      if (json.containsKey("fileStamp")) {
+        fileStamp = jsonDecoder.decodeInt(jsonPath + ".fileStamp", json["fileStamp"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "fileStamp");
+      }
+      List<SourceEdit> edits;
+      if (json.containsKey("edits")) {
+        edits = jsonDecoder.decodeList(jsonPath + ".edits", json["edits"], (String jsonPath, Object json) => new SourceEdit.fromJson(jsonDecoder, jsonPath, json));
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "edits");
+      }
+      return new SourceFileEdit(file, fileStamp, edits: edits);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "SourceFileEdit", json);
+    }
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["file"] = file;
+    result["fileStamp"] = fileStamp;
+    result["edits"] = edits.map((SourceEdit value) => value.toJson()).toList();
+    return result;
+  }
+
+  /**
+   * Adds the given [Edit] to the list.
+   */
+  void add(SourceEdit edit) => addEditForSource(this, edit);
+
+  /**
+   * Adds the given [Edit]s.
+   */
+  void addAll(Iterable<SourceEdit> edits) =>
+      addAllEditsForSource(this, edits);
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is SourceFileEdit) {
+      return file == other.file &&
+          fileStamp == other.fileStamp &&
+          listEqual(edits, other.edits, (SourceEdit a, SourceEdit b) => a == b);
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, file.hashCode);
+    hash = JenkinsSmiHash.combine(hash, fileStamp.hashCode);
+    hash = JenkinsSmiHash.combine(hash, edits.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * TypeHierarchyItem
+ *
+ * {
+ *   "classElement": Element
+ *   "displayName": optional String
+ *   "memberElement": optional Element
+ *   "superclass": optional int
+ *   "interfaces": List<int>
+ *   "mixins": List<int>
+ *   "subclasses": List<int>
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class TypeHierarchyItem implements HasToJson {
+  Element _classElement;
+
+  String _displayName;
+
+  Element _memberElement;
+
+  int _superclass;
+
+  List<int> _interfaces;
+
+  List<int> _mixins;
+
+  List<int> _subclasses;
+
+  /**
+   * The class element represented by this item.
+   */
+  Element get classElement => _classElement;
+
+  /**
+   * The class element represented by this item.
+   */
+  void set classElement(Element value) {
+    assert(value != null);
+    this._classElement = value;
+  }
+
+  /**
+   * The name to be displayed for the class. This field will be omitted if the
+   * display name is the same as the name of the element. The display name is
+   * different if there is additional type information to be displayed, such as
+   * type arguments.
+   */
+  String get displayName => _displayName;
+
+  /**
+   * The name to be displayed for the class. This field will be omitted if the
+   * display name is the same as the name of the element. The display name is
+   * different if there is additional type information to be displayed, such as
+   * type arguments.
+   */
+  void set displayName(String value) {
+    this._displayName = value;
+  }
+
+  /**
+   * The member in the class corresponding to the member on which the hierarchy
+   * was requested. This field will be omitted if the hierarchy was not
+   * requested for a member or if the class does not have a corresponding
+   * member.
+   */
+  Element get memberElement => _memberElement;
+
+  /**
+   * The member in the class corresponding to the member on which the hierarchy
+   * was requested. This field will be omitted if the hierarchy was not
+   * requested for a member or if the class does not have a corresponding
+   * member.
+   */
+  void set memberElement(Element value) {
+    this._memberElement = value;
+  }
+
+  /**
+   * The index of the item representing the superclass of this class. This
+   * field will be omitted if this item represents the class Object.
+   */
+  int get superclass => _superclass;
+
+  /**
+   * The index of the item representing the superclass of this class. This
+   * field will be omitted if this item represents the class Object.
+   */
+  void set superclass(int value) {
+    this._superclass = value;
+  }
+
+  /**
+   * The indexes of the items representing the interfaces implemented by this
+   * class. The list will be empty if there are no implemented interfaces.
+   */
+  List<int> get interfaces => _interfaces;
+
+  /**
+   * The indexes of the items representing the interfaces implemented by this
+   * class. The list will be empty if there are no implemented interfaces.
+   */
+  void set interfaces(List<int> value) {
+    assert(value != null);
+    this._interfaces = value;
+  }
+
+  /**
+   * The indexes of the items representing the mixins referenced by this class.
+   * The list will be empty if there are no classes mixed in to this class.
+   */
+  List<int> get mixins => _mixins;
+
+  /**
+   * The indexes of the items representing the mixins referenced by this class.
+   * The list will be empty if there are no classes mixed in to this class.
+   */
+  void set mixins(List<int> value) {
+    assert(value != null);
+    this._mixins = value;
+  }
+
+  /**
+   * The indexes of the items representing the subtypes of this class. The list
+   * will be empty if there are no subtypes or if this item represents a
+   * supertype of the pivot type.
+   */
+  List<int> get subclasses => _subclasses;
+
+  /**
+   * The indexes of the items representing the subtypes of this class. The list
+   * will be empty if there are no subtypes or if this item represents a
+   * supertype of the pivot type.
+   */
+  void set subclasses(List<int> value) {
+    assert(value != null);
+    this._subclasses = value;
+  }
+
+  TypeHierarchyItem(Element classElement, {String displayName, Element memberElement, int superclass, List<int> interfaces, List<int> mixins, List<int> subclasses}) {
+    this.classElement = classElement;
+    this.displayName = displayName;
+    this.memberElement = memberElement;
+    this.superclass = superclass;
+    if (interfaces == null) {
+      this.interfaces = <int>[];
+    } else {
+      this.interfaces = interfaces;
+    }
+    if (mixins == null) {
+      this.mixins = <int>[];
+    } else {
+      this.mixins = mixins;
+    }
+    if (subclasses == null) {
+      this.subclasses = <int>[];
+    } else {
+      this.subclasses = subclasses;
+    }
+  }
+
+  factory TypeHierarchyItem.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      Element classElement;
+      if (json.containsKey("classElement")) {
+        classElement = new Element.fromJson(jsonDecoder, jsonPath + ".classElement", json["classElement"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "classElement");
+      }
+      String displayName;
+      if (json.containsKey("displayName")) {
+        displayName = jsonDecoder.decodeString(jsonPath + ".displayName", json["displayName"]);
+      }
+      Element memberElement;
+      if (json.containsKey("memberElement")) {
+        memberElement = new Element.fromJson(jsonDecoder, jsonPath + ".memberElement", json["memberElement"]);
+      }
+      int superclass;
+      if (json.containsKey("superclass")) {
+        superclass = jsonDecoder.decodeInt(jsonPath + ".superclass", json["superclass"]);
+      }
+      List<int> interfaces;
+      if (json.containsKey("interfaces")) {
+        interfaces = jsonDecoder.decodeList(jsonPath + ".interfaces", json["interfaces"], jsonDecoder.decodeInt);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "interfaces");
+      }
+      List<int> mixins;
+      if (json.containsKey("mixins")) {
+        mixins = jsonDecoder.decodeList(jsonPath + ".mixins", json["mixins"], jsonDecoder.decodeInt);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "mixins");
+      }
+      List<int> subclasses;
+      if (json.containsKey("subclasses")) {
+        subclasses = jsonDecoder.decodeList(jsonPath + ".subclasses", json["subclasses"], jsonDecoder.decodeInt);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "subclasses");
+      }
+      return new TypeHierarchyItem(classElement, displayName: displayName, memberElement: memberElement, superclass: superclass, interfaces: interfaces, mixins: mixins, subclasses: subclasses);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "TypeHierarchyItem", json);
+    }
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["classElement"] = classElement.toJson();
+    if (displayName != null) {
+      result["displayName"] = displayName;
+    }
+    if (memberElement != null) {
+      result["memberElement"] = memberElement.toJson();
+    }
+    if (superclass != null) {
+      result["superclass"] = superclass;
+    }
+    result["interfaces"] = interfaces;
+    result["mixins"] = mixins;
+    result["subclasses"] = subclasses;
+    return result;
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is TypeHierarchyItem) {
+      return classElement == other.classElement &&
+          displayName == other.displayName &&
+          memberElement == other.memberElement &&
+          superclass == other.superclass &&
+          listEqual(interfaces, other.interfaces, (int a, int b) => a == b) &&
+          listEqual(mixins, other.mixins, (int a, int b) => a == b) &&
+          listEqual(subclasses, other.subclasses, (int a, int b) => a == b);
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, classElement.hashCode);
+    hash = JenkinsSmiHash.combine(hash, displayName.hashCode);
+    hash = JenkinsSmiHash.combine(hash, memberElement.hashCode);
+    hash = JenkinsSmiHash.combine(hash, superclass.hashCode);
+    hash = JenkinsSmiHash.combine(hash, interfaces.hashCode);
+    hash = JenkinsSmiHash.combine(hash, mixins.hashCode);
+    hash = JenkinsSmiHash.combine(hash, subclasses.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+/**
+ * convertGetterToMethod feedback
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class ConvertGetterToMethodFeedback {
+  @override
+  bool operator==(other) {
+    if (other is ConvertGetterToMethodFeedback) {
+      return true;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    return 616032599;
+  }
+}
+/**
+ * convertGetterToMethod options
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class ConvertGetterToMethodOptions {
+  @override
+  bool operator==(other) {
+    if (other is ConvertGetterToMethodOptions) {
+      return true;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    return 488848400;
+  }
+}
+/**
+ * convertMethodToGetter feedback
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class ConvertMethodToGetterFeedback {
+  @override
+  bool operator==(other) {
+    if (other is ConvertMethodToGetterFeedback) {
+      return true;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    return 165291526;
+  }
+}
+/**
+ * convertMethodToGetter options
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class ConvertMethodToGetterOptions {
+  @override
+  bool operator==(other) {
+    if (other is ConvertMethodToGetterOptions) {
+      return true;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    return 27952290;
+  }
+}
+
+/**
+ * extractLocalVariable feedback
+ *
+ * {
+ *   "coveringExpressionOffsets": List<int>
+ *   "coveringExpressionLengths": List<int>
+ *   "names": List<String>
+ *   "offsets": List<int>
+ *   "lengths": List<int>
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class ExtractLocalVariableFeedback extends RefactoringFeedback implements HasToJson {
+  List<int> _coveringExpressionOffsets;
+
+  List<int> _coveringExpressionLengths;
+
+  List<String> _names;
+
+  List<int> _offsets;
+
+  List<int> _lengths;
+
+  /**
+   * The offsets of the expressions that cover the specified selection, from
+   * the down most to the up most.
+   */
+  List<int> get coveringExpressionOffsets => _coveringExpressionOffsets;
+
+  /**
+   * The offsets of the expressions that cover the specified selection, from
+   * the down most to the up most.
+   */
+  void set coveringExpressionOffsets(List<int> value) {
+    assert(value != null);
+    this._coveringExpressionOffsets = value;
+  }
+
+  /**
+   * The lengths of the expressions that cover the specified selection, from
+   * the down most to the up most.
+   */
+  List<int> get coveringExpressionLengths => _coveringExpressionLengths;
+
+  /**
+   * The lengths of the expressions that cover the specified selection, from
+   * the down most to the up most.
+   */
+  void set coveringExpressionLengths(List<int> value) {
+    assert(value != null);
+    this._coveringExpressionLengths = value;
+  }
+
+  /**
+   * The proposed names for the local variable.
+   */
+  List<String> get names => _names;
+
+  /**
+   * The proposed names for the local variable.
+   */
+  void set names(List<String> value) {
+    assert(value != null);
+    this._names = value;
+  }
+
+  /**
+   * The offsets of the expressions that would be replaced by a reference to
+   * the variable.
+   */
+  List<int> get offsets => _offsets;
+
+  /**
+   * The offsets of the expressions that would be replaced by a reference to
+   * the variable.
+   */
+  void set offsets(List<int> value) {
+    assert(value != null);
+    this._offsets = value;
+  }
+
+  /**
+   * The lengths of the expressions that would be replaced by a reference to
+   * the variable. The lengths correspond to the offsets. In other words, for a
+   * given expression, if the offset of that expression is offsets[i], then the
+   * length of that expression is lengths[i].
+   */
+  List<int> get lengths => _lengths;
+
+  /**
+   * The lengths of the expressions that would be replaced by a reference to
+   * the variable. The lengths correspond to the offsets. In other words, for a
+   * given expression, if the offset of that expression is offsets[i], then the
+   * length of that expression is lengths[i].
+   */
+  void set lengths(List<int> value) {
+    assert(value != null);
+    this._lengths = value;
+  }
+
+  ExtractLocalVariableFeedback(List<int> coveringExpressionOffsets, List<int> coveringExpressionLengths, List<String> names, List<int> offsets, List<int> lengths) {
+    this.coveringExpressionOffsets = coveringExpressionOffsets;
+    this.coveringExpressionLengths = coveringExpressionLengths;
+    this.names = names;
+    this.offsets = offsets;
+    this.lengths = lengths;
+  }
+
+  factory ExtractLocalVariableFeedback.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      List<int> coveringExpressionOffsets;
+      if (json.containsKey("coveringExpressionOffsets")) {
+        coveringExpressionOffsets = jsonDecoder.decodeList(jsonPath + ".coveringExpressionOffsets", json["coveringExpressionOffsets"], jsonDecoder.decodeInt);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "coveringExpressionOffsets");
+      }
+      List<int> coveringExpressionLengths;
+      if (json.containsKey("coveringExpressionLengths")) {
+        coveringExpressionLengths = jsonDecoder.decodeList(jsonPath + ".coveringExpressionLengths", json["coveringExpressionLengths"], jsonDecoder.decodeInt);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "coveringExpressionLengths");
+      }
+      List<String> names;
+      if (json.containsKey("names")) {
+        names = jsonDecoder.decodeList(jsonPath + ".names", json["names"], jsonDecoder.decodeString);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "names");
+      }
+      List<int> offsets;
+      if (json.containsKey("offsets")) {
+        offsets = jsonDecoder.decodeList(jsonPath + ".offsets", json["offsets"], jsonDecoder.decodeInt);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "offsets");
+      }
+      List<int> lengths;
+      if (json.containsKey("lengths")) {
+        lengths = jsonDecoder.decodeList(jsonPath + ".lengths", json["lengths"], jsonDecoder.decodeInt);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "lengths");
+      }
+      return new ExtractLocalVariableFeedback(coveringExpressionOffsets, coveringExpressionLengths, names, offsets, lengths);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "extractLocalVariable feedback", json);
+    }
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["coveringExpressionOffsets"] = coveringExpressionOffsets;
+    result["coveringExpressionLengths"] = coveringExpressionLengths;
+    result["names"] = names;
+    result["offsets"] = offsets;
+    result["lengths"] = lengths;
+    return result;
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is ExtractLocalVariableFeedback) {
+      return listEqual(coveringExpressionOffsets, other.coveringExpressionOffsets, (int a, int b) => a == b) &&
+          listEqual(coveringExpressionLengths, other.coveringExpressionLengths, (int a, int b) => a == b) &&
+          listEqual(names, other.names, (String a, String b) => a == b) &&
+          listEqual(offsets, other.offsets, (int a, int b) => a == b) &&
+          listEqual(lengths, other.lengths, (int a, int b) => a == b);
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, coveringExpressionOffsets.hashCode);
+    hash = JenkinsSmiHash.combine(hash, coveringExpressionLengths.hashCode);
+    hash = JenkinsSmiHash.combine(hash, names.hashCode);
+    hash = JenkinsSmiHash.combine(hash, offsets.hashCode);
+    hash = JenkinsSmiHash.combine(hash, lengths.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * extractLocalVariable options
+ *
+ * {
+ *   "name": String
+ *   "extractAll": bool
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class ExtractLocalVariableOptions extends RefactoringOptions implements HasToJson {
+  String _name;
+
+  bool _extractAll;
+
+  /**
+   * The name that the local variable should be given.
+   */
+  String get name => _name;
+
+  /**
+   * The name that the local variable should be given.
+   */
+  void set name(String value) {
+    assert(value != null);
+    this._name = value;
+  }
+
+  /**
+   * True if all occurrences of the expression within the scope in which the
+   * variable will be defined should be replaced by a reference to the local
+   * variable. The expression used to initiate the refactoring will always be
+   * replaced.
+   */
+  bool get extractAll => _extractAll;
+
+  /**
+   * True if all occurrences of the expression within the scope in which the
+   * variable will be defined should be replaced by a reference to the local
+   * variable. The expression used to initiate the refactoring will always be
+   * replaced.
+   */
+  void set extractAll(bool value) {
+    assert(value != null);
+    this._extractAll = value;
+  }
+
+  ExtractLocalVariableOptions(String name, bool extractAll) {
+    this.name = name;
+    this.extractAll = extractAll;
+  }
+
+  factory ExtractLocalVariableOptions.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      String name;
+      if (json.containsKey("name")) {
+        name = jsonDecoder.decodeString(jsonPath + ".name", json["name"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "name");
+      }
+      bool extractAll;
+      if (json.containsKey("extractAll")) {
+        extractAll = jsonDecoder.decodeBool(jsonPath + ".extractAll", json["extractAll"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "extractAll");
+      }
+      return new ExtractLocalVariableOptions(name, extractAll);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "extractLocalVariable options", json);
+    }
+  }
+
+  factory ExtractLocalVariableOptions.fromRefactoringParams(EditGetRefactoringParams refactoringParams, Request request) {
+    return new ExtractLocalVariableOptions.fromJson(
+        new RequestDecoder(request), "options", refactoringParams.options);
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["name"] = name;
+    result["extractAll"] = extractAll;
+    return result;
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is ExtractLocalVariableOptions) {
+      return name == other.name &&
+          extractAll == other.extractAll;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, name.hashCode);
+    hash = JenkinsSmiHash.combine(hash, extractAll.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * extractMethod feedback
+ *
+ * {
+ *   "offset": int
+ *   "length": int
+ *   "returnType": String
+ *   "names": List<String>
+ *   "canCreateGetter": bool
+ *   "parameters": List<RefactoringMethodParameter>
+ *   "offsets": List<int>
+ *   "lengths": List<int>
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class ExtractMethodFeedback extends RefactoringFeedback implements HasToJson {
+  int _offset;
+
+  int _length;
+
+  String _returnType;
+
+  List<String> _names;
+
+  bool _canCreateGetter;
+
+  List<RefactoringMethodParameter> _parameters;
+
+  List<int> _offsets;
+
+  List<int> _lengths;
+
+  /**
+   * The offset to the beginning of the expression or statements that will be
+   * extracted.
+   */
+  int get offset => _offset;
+
+  /**
+   * The offset to the beginning of the expression or statements that will be
+   * extracted.
+   */
+  void set offset(int value) {
+    assert(value != null);
+    this._offset = value;
+  }
+
+  /**
+   * The length of the expression or statements that will be extracted.
+   */
+  int get length => _length;
+
+  /**
+   * The length of the expression or statements that will be extracted.
+   */
+  void set length(int value) {
+    assert(value != null);
+    this._length = value;
+  }
+
+  /**
+   * The proposed return type for the method. If the returned element does not
+   * have a declared return type, this field will contain an empty string.
+   */
+  String get returnType => _returnType;
+
+  /**
+   * The proposed return type for the method. If the returned element does not
+   * have a declared return type, this field will contain an empty string.
+   */
+  void set returnType(String value) {
+    assert(value != null);
+    this._returnType = value;
+  }
+
+  /**
+   * The proposed names for the method.
+   */
+  List<String> get names => _names;
+
+  /**
+   * The proposed names for the method.
+   */
+  void set names(List<String> value) {
+    assert(value != null);
+    this._names = value;
+  }
+
+  /**
+   * True if a getter could be created rather than a method.
+   */
+  bool get canCreateGetter => _canCreateGetter;
+
+  /**
+   * True if a getter could be created rather than a method.
+   */
+  void set canCreateGetter(bool value) {
+    assert(value != null);
+    this._canCreateGetter = value;
+  }
+
+  /**
+   * The proposed parameters for the method.
+   */
+  List<RefactoringMethodParameter> get parameters => _parameters;
+
+  /**
+   * The proposed parameters for the method.
+   */
+  void set parameters(List<RefactoringMethodParameter> value) {
+    assert(value != null);
+    this._parameters = value;
+  }
+
+  /**
+   * The offsets of the expressions or statements that would be replaced by an
+   * invocation of the method.
+   */
+  List<int> get offsets => _offsets;
+
+  /**
+   * The offsets of the expressions or statements that would be replaced by an
+   * invocation of the method.
+   */
+  void set offsets(List<int> value) {
+    assert(value != null);
+    this._offsets = value;
+  }
+
+  /**
+   * The lengths of the expressions or statements that would be replaced by an
+   * invocation of the method. The lengths correspond to the offsets. In other
+   * words, for a given expression (or block of statements), if the offset of
+   * that expression is offsets[i], then the length of that expression is
+   * lengths[i].
+   */
+  List<int> get lengths => _lengths;
+
+  /**
+   * The lengths of the expressions or statements that would be replaced by an
+   * invocation of the method. The lengths correspond to the offsets. In other
+   * words, for a given expression (or block of statements), if the offset of
+   * that expression is offsets[i], then the length of that expression is
+   * lengths[i].
+   */
+  void set lengths(List<int> value) {
+    assert(value != null);
+    this._lengths = value;
+  }
+
+  ExtractMethodFeedback(int offset, int length, String returnType, List<String> names, bool canCreateGetter, List<RefactoringMethodParameter> parameters, List<int> offsets, List<int> lengths) {
+    this.offset = offset;
+    this.length = length;
+    this.returnType = returnType;
+    this.names = names;
+    this.canCreateGetter = canCreateGetter;
+    this.parameters = parameters;
+    this.offsets = offsets;
+    this.lengths = lengths;
+  }
+
+  factory ExtractMethodFeedback.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      int offset;
+      if (json.containsKey("offset")) {
+        offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "offset");
+      }
+      int length;
+      if (json.containsKey("length")) {
+        length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "length");
+      }
+      String returnType;
+      if (json.containsKey("returnType")) {
+        returnType = jsonDecoder.decodeString(jsonPath + ".returnType", json["returnType"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "returnType");
+      }
+      List<String> names;
+      if (json.containsKey("names")) {
+        names = jsonDecoder.decodeList(jsonPath + ".names", json["names"], jsonDecoder.decodeString);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "names");
+      }
+      bool canCreateGetter;
+      if (json.containsKey("canCreateGetter")) {
+        canCreateGetter = jsonDecoder.decodeBool(jsonPath + ".canCreateGetter", json["canCreateGetter"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "canCreateGetter");
+      }
+      List<RefactoringMethodParameter> parameters;
+      if (json.containsKey("parameters")) {
+        parameters = jsonDecoder.decodeList(jsonPath + ".parameters", json["parameters"], (String jsonPath, Object json) => new RefactoringMethodParameter.fromJson(jsonDecoder, jsonPath, json));
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "parameters");
+      }
+      List<int> offsets;
+      if (json.containsKey("offsets")) {
+        offsets = jsonDecoder.decodeList(jsonPath + ".offsets", json["offsets"], jsonDecoder.decodeInt);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "offsets");
+      }
+      List<int> lengths;
+      if (json.containsKey("lengths")) {
+        lengths = jsonDecoder.decodeList(jsonPath + ".lengths", json["lengths"], jsonDecoder.decodeInt);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "lengths");
+      }
+      return new ExtractMethodFeedback(offset, length, returnType, names, canCreateGetter, parameters, offsets, lengths);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "extractMethod feedback", json);
+    }
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["offset"] = offset;
+    result["length"] = length;
+    result["returnType"] = returnType;
+    result["names"] = names;
+    result["canCreateGetter"] = canCreateGetter;
+    result["parameters"] = parameters.map((RefactoringMethodParameter value) => value.toJson()).toList();
+    result["offsets"] = offsets;
+    result["lengths"] = lengths;
+    return result;
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is ExtractMethodFeedback) {
+      return offset == other.offset &&
+          length == other.length &&
+          returnType == other.returnType &&
+          listEqual(names, other.names, (String a, String b) => a == b) &&
+          canCreateGetter == other.canCreateGetter &&
+          listEqual(parameters, other.parameters, (RefactoringMethodParameter a, RefactoringMethodParameter b) => a == b) &&
+          listEqual(offsets, other.offsets, (int a, int b) => a == b) &&
+          listEqual(lengths, other.lengths, (int a, int b) => a == b);
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, offset.hashCode);
+    hash = JenkinsSmiHash.combine(hash, length.hashCode);
+    hash = JenkinsSmiHash.combine(hash, returnType.hashCode);
+    hash = JenkinsSmiHash.combine(hash, names.hashCode);
+    hash = JenkinsSmiHash.combine(hash, canCreateGetter.hashCode);
+    hash = JenkinsSmiHash.combine(hash, parameters.hashCode);
+    hash = JenkinsSmiHash.combine(hash, offsets.hashCode);
+    hash = JenkinsSmiHash.combine(hash, lengths.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * extractMethod options
+ *
+ * {
+ *   "returnType": String
+ *   "createGetter": bool
+ *   "name": String
+ *   "parameters": List<RefactoringMethodParameter>
+ *   "extractAll": bool
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class ExtractMethodOptions extends RefactoringOptions implements HasToJson {
+  String _returnType;
+
+  bool _createGetter;
+
+  String _name;
+
+  List<RefactoringMethodParameter> _parameters;
+
+  bool _extractAll;
+
+  /**
+   * The return type that should be defined for the method.
+   */
+  String get returnType => _returnType;
+
+  /**
+   * The return type that should be defined for the method.
+   */
+  void set returnType(String value) {
+    assert(value != null);
+    this._returnType = value;
+  }
+
+  /**
+   * True if a getter should be created rather than a method. It is an error if
+   * this field is true and the list of parameters is non-empty.
+   */
+  bool get createGetter => _createGetter;
+
+  /**
+   * True if a getter should be created rather than a method. It is an error if
+   * this field is true and the list of parameters is non-empty.
+   */
+  void set createGetter(bool value) {
+    assert(value != null);
+    this._createGetter = value;
+  }
+
+  /**
+   * The name that the method should be given.
+   */
+  String get name => _name;
+
+  /**
+   * The name that the method should be given.
+   */
+  void set name(String value) {
+    assert(value != null);
+    this._name = value;
+  }
+
+  /**
+   * The parameters that should be defined for the method.
+   *
+   * It is an error if a REQUIRED or NAMED parameter follows a POSITIONAL
+   * parameter. It is an error if a REQUIRED or POSITIONAL parameter follows a
+   * NAMED parameter.
+   *
+   * - To change the order and/or update proposed parameters, add parameters
+   *   with the same identifiers as proposed.
+   * - To add new parameters, omit their identifier.
+   * - To remove some parameters, omit them in this list.
+   */
+  List<RefactoringMethodParameter> get parameters => _parameters;
+
+  /**
+   * The parameters that should be defined for the method.
+   *
+   * It is an error if a REQUIRED or NAMED parameter follows a POSITIONAL
+   * parameter. It is an error if a REQUIRED or POSITIONAL parameter follows a
+   * NAMED parameter.
+   *
+   * - To change the order and/or update proposed parameters, add parameters
+   *   with the same identifiers as proposed.
+   * - To add new parameters, omit their identifier.
+   * - To remove some parameters, omit them in this list.
+   */
+  void set parameters(List<RefactoringMethodParameter> value) {
+    assert(value != null);
+    this._parameters = value;
+  }
+
+  /**
+   * True if all occurrences of the expression or statements should be replaced
+   * by an invocation of the method. The expression or statements used to
+   * initiate the refactoring will always be replaced.
+   */
+  bool get extractAll => _extractAll;
+
+  /**
+   * True if all occurrences of the expression or statements should be replaced
+   * by an invocation of the method. The expression or statements used to
+   * initiate the refactoring will always be replaced.
+   */
+  void set extractAll(bool value) {
+    assert(value != null);
+    this._extractAll = value;
+  }
+
+  ExtractMethodOptions(String returnType, bool createGetter, String name, List<RefactoringMethodParameter> parameters, bool extractAll) {
+    this.returnType = returnType;
+    this.createGetter = createGetter;
+    this.name = name;
+    this.parameters = parameters;
+    this.extractAll = extractAll;
+  }
+
+  factory ExtractMethodOptions.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      String returnType;
+      if (json.containsKey("returnType")) {
+        returnType = jsonDecoder.decodeString(jsonPath + ".returnType", json["returnType"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "returnType");
+      }
+      bool createGetter;
+      if (json.containsKey("createGetter")) {
+        createGetter = jsonDecoder.decodeBool(jsonPath + ".createGetter", json["createGetter"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "createGetter");
+      }
+      String name;
+      if (json.containsKey("name")) {
+        name = jsonDecoder.decodeString(jsonPath + ".name", json["name"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "name");
+      }
+      List<RefactoringMethodParameter> parameters;
+      if (json.containsKey("parameters")) {
+        parameters = jsonDecoder.decodeList(jsonPath + ".parameters", json["parameters"], (String jsonPath, Object json) => new RefactoringMethodParameter.fromJson(jsonDecoder, jsonPath, json));
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "parameters");
+      }
+      bool extractAll;
+      if (json.containsKey("extractAll")) {
+        extractAll = jsonDecoder.decodeBool(jsonPath + ".extractAll", json["extractAll"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "extractAll");
+      }
+      return new ExtractMethodOptions(returnType, createGetter, name, parameters, extractAll);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "extractMethod options", json);
+    }
+  }
+
+  factory ExtractMethodOptions.fromRefactoringParams(EditGetRefactoringParams refactoringParams, Request request) {
+    return new ExtractMethodOptions.fromJson(
+        new RequestDecoder(request), "options", refactoringParams.options);
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["returnType"] = returnType;
+    result["createGetter"] = createGetter;
+    result["name"] = name;
+    result["parameters"] = parameters.map((RefactoringMethodParameter value) => value.toJson()).toList();
+    result["extractAll"] = extractAll;
+    return result;
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is ExtractMethodOptions) {
+      return returnType == other.returnType &&
+          createGetter == other.createGetter &&
+          name == other.name &&
+          listEqual(parameters, other.parameters, (RefactoringMethodParameter a, RefactoringMethodParameter b) => a == b) &&
+          extractAll == other.extractAll;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, returnType.hashCode);
+    hash = JenkinsSmiHash.combine(hash, createGetter.hashCode);
+    hash = JenkinsSmiHash.combine(hash, name.hashCode);
+    hash = JenkinsSmiHash.combine(hash, parameters.hashCode);
+    hash = JenkinsSmiHash.combine(hash, extractAll.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * inlineLocalVariable feedback
+ *
+ * {
+ *   "name": String
+ *   "occurrences": int
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class InlineLocalVariableFeedback extends RefactoringFeedback implements HasToJson {
+  String _name;
+
+  int _occurrences;
+
+  /**
+   * The name of the variable being inlined.
+   */
+  String get name => _name;
+
+  /**
+   * The name of the variable being inlined.
+   */
+  void set name(String value) {
+    assert(value != null);
+    this._name = value;
+  }
+
+  /**
+   * The number of times the variable occurs.
+   */
+  int get occurrences => _occurrences;
+
+  /**
+   * The number of times the variable occurs.
+   */
+  void set occurrences(int value) {
+    assert(value != null);
+    this._occurrences = value;
+  }
+
+  InlineLocalVariableFeedback(String name, int occurrences) {
+    this.name = name;
+    this.occurrences = occurrences;
+  }
+
+  factory InlineLocalVariableFeedback.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      String name;
+      if (json.containsKey("name")) {
+        name = jsonDecoder.decodeString(jsonPath + ".name", json["name"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "name");
+      }
+      int occurrences;
+      if (json.containsKey("occurrences")) {
+        occurrences = jsonDecoder.decodeInt(jsonPath + ".occurrences", json["occurrences"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "occurrences");
+      }
+      return new InlineLocalVariableFeedback(name, occurrences);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "inlineLocalVariable feedback", json);
+    }
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["name"] = name;
+    result["occurrences"] = occurrences;
+    return result;
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is InlineLocalVariableFeedback) {
+      return name == other.name &&
+          occurrences == other.occurrences;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, name.hashCode);
+    hash = JenkinsSmiHash.combine(hash, occurrences.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+/**
+ * inlineLocalVariable options
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class InlineLocalVariableOptions {
+  @override
+  bool operator==(other) {
+    if (other is InlineLocalVariableOptions) {
+      return true;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    return 540364977;
+  }
+}
+
+/**
+ * inlineMethod feedback
+ *
+ * {
+ *   "className": optional String
+ *   "methodName": String
+ *   "isDeclaration": bool
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class InlineMethodFeedback extends RefactoringFeedback implements HasToJson {
+  String _className;
+
+  String _methodName;
+
+  bool _isDeclaration;
+
+  /**
+   * The name of the class enclosing the method being inlined. If not a class
+   * member is being inlined, this field will be absent.
+   */
+  String get className => _className;
+
+  /**
+   * The name of the class enclosing the method being inlined. If not a class
+   * member is being inlined, this field will be absent.
+   */
+  void set className(String value) {
+    this._className = value;
+  }
+
+  /**
+   * The name of the method (or function) being inlined.
+   */
+  String get methodName => _methodName;
+
+  /**
+   * The name of the method (or function) being inlined.
+   */
+  void set methodName(String value) {
+    assert(value != null);
+    this._methodName = value;
+  }
+
+  /**
+   * True if the declaration of the method is selected. So all references
+   * should be inlined.
+   */
+  bool get isDeclaration => _isDeclaration;
+
+  /**
+   * True if the declaration of the method is selected. So all references
+   * should be inlined.
+   */
+  void set isDeclaration(bool value) {
+    assert(value != null);
+    this._isDeclaration = value;
+  }
+
+  InlineMethodFeedback(String methodName, bool isDeclaration, {String className}) {
+    this.className = className;
+    this.methodName = methodName;
+    this.isDeclaration = isDeclaration;
+  }
+
+  factory InlineMethodFeedback.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      String className;
+      if (json.containsKey("className")) {
+        className = jsonDecoder.decodeString(jsonPath + ".className", json["className"]);
+      }
+      String methodName;
+      if (json.containsKey("methodName")) {
+        methodName = jsonDecoder.decodeString(jsonPath + ".methodName", json["methodName"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "methodName");
+      }
+      bool isDeclaration;
+      if (json.containsKey("isDeclaration")) {
+        isDeclaration = jsonDecoder.decodeBool(jsonPath + ".isDeclaration", json["isDeclaration"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "isDeclaration");
+      }
+      return new InlineMethodFeedback(methodName, isDeclaration, className: className);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "inlineMethod feedback", json);
+    }
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    if (className != null) {
+      result["className"] = className;
+    }
+    result["methodName"] = methodName;
+    result["isDeclaration"] = isDeclaration;
+    return result;
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is InlineMethodFeedback) {
+      return className == other.className &&
+          methodName == other.methodName &&
+          isDeclaration == other.isDeclaration;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, className.hashCode);
+    hash = JenkinsSmiHash.combine(hash, methodName.hashCode);
+    hash = JenkinsSmiHash.combine(hash, isDeclaration.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * inlineMethod options
+ *
+ * {
+ *   "deleteSource": bool
+ *   "inlineAll": bool
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class InlineMethodOptions extends RefactoringOptions implements HasToJson {
+  bool _deleteSource;
+
+  bool _inlineAll;
+
+  /**
+   * True if the method being inlined should be removed. It is an error if this
+   * field is true and inlineAll is false.
+   */
+  bool get deleteSource => _deleteSource;
+
+  /**
+   * True if the method being inlined should be removed. It is an error if this
+   * field is true and inlineAll is false.
+   */
+  void set deleteSource(bool value) {
+    assert(value != null);
+    this._deleteSource = value;
+  }
+
+  /**
+   * True if all invocations of the method should be inlined, or false if only
+   * the invocation site used to create this refactoring should be inlined.
+   */
+  bool get inlineAll => _inlineAll;
+
+  /**
+   * True if all invocations of the method should be inlined, or false if only
+   * the invocation site used to create this refactoring should be inlined.
+   */
+  void set inlineAll(bool value) {
+    assert(value != null);
+    this._inlineAll = value;
+  }
+
+  InlineMethodOptions(bool deleteSource, bool inlineAll) {
+    this.deleteSource = deleteSource;
+    this.inlineAll = inlineAll;
+  }
+
+  factory InlineMethodOptions.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      bool deleteSource;
+      if (json.containsKey("deleteSource")) {
+        deleteSource = jsonDecoder.decodeBool(jsonPath + ".deleteSource", json["deleteSource"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "deleteSource");
+      }
+      bool inlineAll;
+      if (json.containsKey("inlineAll")) {
+        inlineAll = jsonDecoder.decodeBool(jsonPath + ".inlineAll", json["inlineAll"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "inlineAll");
+      }
+      return new InlineMethodOptions(deleteSource, inlineAll);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "inlineMethod options", json);
+    }
+  }
+
+  factory InlineMethodOptions.fromRefactoringParams(EditGetRefactoringParams refactoringParams, Request request) {
+    return new InlineMethodOptions.fromJson(
+        new RequestDecoder(request), "options", refactoringParams.options);
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["deleteSource"] = deleteSource;
+    result["inlineAll"] = inlineAll;
+    return result;
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is InlineMethodOptions) {
+      return deleteSource == other.deleteSource &&
+          inlineAll == other.inlineAll;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, deleteSource.hashCode);
+    hash = JenkinsSmiHash.combine(hash, inlineAll.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+/**
+ * moveFile feedback
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class MoveFileFeedback {
+  @override
+  bool operator==(other) {
+    if (other is MoveFileFeedback) {
+      return true;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    return 438975893;
+  }
+}
+
+/**
+ * moveFile options
+ *
+ * {
+ *   "newFile": FilePath
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class MoveFileOptions extends RefactoringOptions implements HasToJson {
+  String _newFile;
+
+  /**
+   * The new file path to which the given file is being moved.
+   */
+  String get newFile => _newFile;
+
+  /**
+   * The new file path to which the given file is being moved.
+   */
+  void set newFile(String value) {
+    assert(value != null);
+    this._newFile = value;
+  }
+
+  MoveFileOptions(String newFile) {
+    this.newFile = newFile;
+  }
+
+  factory MoveFileOptions.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      String newFile;
+      if (json.containsKey("newFile")) {
+        newFile = jsonDecoder.decodeString(jsonPath + ".newFile", json["newFile"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "newFile");
+      }
+      return new MoveFileOptions(newFile);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "moveFile options", json);
+    }
+  }
+
+  factory MoveFileOptions.fromRefactoringParams(EditGetRefactoringParams refactoringParams, Request request) {
+    return new MoveFileOptions.fromJson(
+        new RequestDecoder(request), "options", refactoringParams.options);
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["newFile"] = newFile;
+    return result;
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is MoveFileOptions) {
+      return newFile == other.newFile;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, newFile.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * rename feedback
+ *
+ * {
+ *   "offset": int
+ *   "length": int
+ *   "elementKindName": String
+ *   "oldName": String
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class RenameFeedback extends RefactoringFeedback implements HasToJson {
+  int _offset;
+
+  int _length;
+
+  String _elementKindName;
+
+  String _oldName;
+
+  /**
+   * The offset to the beginning of the name selected to be renamed.
+   */
+  int get offset => _offset;
+
+  /**
+   * The offset to the beginning of the name selected to be renamed.
+   */
+  void set offset(int value) {
+    assert(value != null);
+    this._offset = value;
+  }
+
+  /**
+   * The length of the name selected to be renamed.
+   */
+  int get length => _length;
+
+  /**
+   * The length of the name selected to be renamed.
+   */
+  void set length(int value) {
+    assert(value != null);
+    this._length = value;
+  }
+
+  /**
+   * The human-readable description of the kind of element being renamed (such
+   * as “class” or “function type alias”).
+   */
+  String get elementKindName => _elementKindName;
+
+  /**
+   * The human-readable description of the kind of element being renamed (such
+   * as “class” or “function type alias”).
+   */
+  void set elementKindName(String value) {
+    assert(value != null);
+    this._elementKindName = value;
+  }
+
+  /**
+   * The old name of the element before the refactoring.
+   */
+  String get oldName => _oldName;
+
+  /**
+   * The old name of the element before the refactoring.
+   */
+  void set oldName(String value) {
+    assert(value != null);
+    this._oldName = value;
+  }
+
+  RenameFeedback(int offset, int length, String elementKindName, String oldName) {
+    this.offset = offset;
+    this.length = length;
+    this.elementKindName = elementKindName;
+    this.oldName = oldName;
+  }
+
+  factory RenameFeedback.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      int offset;
+      if (json.containsKey("offset")) {
+        offset = jsonDecoder.decodeInt(jsonPath + ".offset", json["offset"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "offset");
+      }
+      int length;
+      if (json.containsKey("length")) {
+        length = jsonDecoder.decodeInt(jsonPath + ".length", json["length"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "length");
+      }
+      String elementKindName;
+      if (json.containsKey("elementKindName")) {
+        elementKindName = jsonDecoder.decodeString(jsonPath + ".elementKindName", json["elementKindName"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "elementKindName");
+      }
+      String oldName;
+      if (json.containsKey("oldName")) {
+        oldName = jsonDecoder.decodeString(jsonPath + ".oldName", json["oldName"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "oldName");
+      }
+      return new RenameFeedback(offset, length, elementKindName, oldName);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "rename feedback", json);
+    }
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["offset"] = offset;
+    result["length"] = length;
+    result["elementKindName"] = elementKindName;
+    result["oldName"] = oldName;
+    return result;
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is RenameFeedback) {
+      return offset == other.offset &&
+          length == other.length &&
+          elementKindName == other.elementKindName &&
+          oldName == other.oldName;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, offset.hashCode);
+    hash = JenkinsSmiHash.combine(hash, length.hashCode);
+    hash = JenkinsSmiHash.combine(hash, elementKindName.hashCode);
+    hash = JenkinsSmiHash.combine(hash, oldName.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
+
+/**
+ * rename options
+ *
+ * {
+ *   "newName": String
+ * }
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class RenameOptions extends RefactoringOptions implements HasToJson {
+  String _newName;
+
+  /**
+   * The name that the element should have after the refactoring.
+   */
+  String get newName => _newName;
+
+  /**
+   * The name that the element should have after the refactoring.
+   */
+  void set newName(String value) {
+    assert(value != null);
+    this._newName = value;
+  }
+
+  RenameOptions(String newName) {
+    this.newName = newName;
+  }
+
+  factory RenameOptions.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
+    if (json == null) {
+      json = {};
+    }
+    if (json is Map) {
+      String newName;
+      if (json.containsKey("newName")) {
+        newName = jsonDecoder.decodeString(jsonPath + ".newName", json["newName"]);
+      } else {
+        throw jsonDecoder.missingKey(jsonPath, "newName");
+      }
+      return new RenameOptions(newName);
+    } else {
+      throw jsonDecoder.mismatch(jsonPath, "rename options", json);
+    }
+  }
+
+  factory RenameOptions.fromRefactoringParams(EditGetRefactoringParams refactoringParams, Request request) {
+    return new RenameOptions.fromJson(
+        new RequestDecoder(request), "options", refactoringParams.options);
+  }
+
+  Map<String, dynamic> toJson() {
+    Map<String, dynamic> result = {};
+    result["newName"] = newName;
+    return result;
+  }
+
+  @override
+  String toString() => JSON.encode(toJson());
+
+  @override
+  bool operator==(other) {
+    if (other is RenameOptions) {
+      return newName == other.newName;
+    }
+    return false;
+  }
+
+  @override
+  int get hashCode {
+    int hash = 0;
+    hash = JenkinsSmiHash.combine(hash, newName.hashCode);
+    return JenkinsSmiHash.finish(hash);
+  }
+}
diff --git a/pkg/analysis_server/lib/plugin/protocol/protocol.dart b/pkg/analysis_server/lib/plugin/protocol/protocol.dart
new file mode 100644
index 0000000..823ffd6
--- /dev/null
+++ b/pkg/analysis_server/lib/plugin/protocol/protocol.dart
@@ -0,0 +1,565 @@
+// 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.
+
+/**
+ * Support for client code that needs to interact with the requests, responses
+ * and notifications that are part of the analysis server's wire protocol.
+ */
+library analysis_server.plugin.protocol.protocol;
+
+import 'dart:collection';
+import 'dart:convert' hide JsonDecoder;
+
+import 'package:analysis_server/src/protocol/protocol_internal.dart';
+
+part 'generated_protocol.dart';
+
+/**
+ * A [RequestHandler] that supports [startup] and [shutdown] methods.
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+abstract class DomainHandler extends RequestHandler {
+  /**
+   * Perform any operations associated with the shutdown of the domain. It is
+   * not guaranteed that this method will be called. If it is, it will be
+   * called after the last [Request] has been made.
+   */
+  void shutdown() {}
+
+  /**
+   * Perform any operations associated with the startup of the domain. This
+   * will be called before the first [Request].
+   */
+  void startup() {}
+}
+
+/**
+ * An interface for enumerated types in the protocol.
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+abstract class Enum {
+  /**
+   * The name of the enumerated value. This should match the name of the
+   * static getter which provides access to this enumerated value.
+   */
+  String get name;
+}
+
+/**
+ * A notification from the server about an event that occurred.
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class Notification {
+  /**
+   * The name of the JSON attribute containing the name of the event that
+   * triggered the notification.
+   */
+  static const String EVENT = 'event';
+
+  /**
+   * The name of the JSON attribute containing the result values.
+   */
+  static const String PARAMS = 'params';
+
+  /**
+   * The name of the event that triggered the notification.
+   */
+  final String event;
+
+  /**
+   * A table mapping the names of notification parameters to their values, or
+   * `null` if there are no notification parameters.
+   */
+  Map<String, Object> _params;
+
+  /**
+   * Initialize a newly created [Notification] to have the given [event] name.
+   * If [_params] is provided, it will be used as the params; otherwise no
+   * params will be used.
+   */
+  Notification(this.event, [this._params]);
+
+  /**
+   * Initialize a newly created instance based on the given JSON data.
+   */
+  factory Notification.fromJson(Map<String, Object> json) {
+    return new Notification(
+        json[Notification.EVENT], json[Notification.PARAMS]);
+  }
+
+  /**
+   * Return a table representing the structure of the Json object that will be
+   * sent to the client to represent this response.
+   */
+  Map<String, Object> toJson() {
+    Map<String, Object> jsonObject = {};
+    jsonObject[EVENT] = event;
+    if (_params != null) {
+      jsonObject[PARAMS] = _params;
+    }
+    return jsonObject;
+  }
+}
+
+/**
+ * A request that was received from the client.
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class Request {
+  /**
+   * The name of the JSON attribute containing the id of the request.
+   */
+  static const String ID = 'id';
+
+  /**
+   * The name of the JSON attribute containing the name of the request.
+   */
+  static const String METHOD = 'method';
+
+  /**
+   * The name of the JSON attribute containing the request parameters.
+   */
+  static const String PARAMS = 'params';
+
+  /**
+   * The name of the optional JSON attribute indicating the time (milliseconds
+   * since epoch) at which the client made the request.
+   */
+  static const String CLIENT_REQUEST_TIME = 'clientRequestTime';
+
+  /**
+   * The unique identifier used to identify this request.
+   */
+  final String id;
+
+  /**
+   * The method being requested.
+   */
+  final String method;
+
+  /**
+   * A table mapping the names of request parameters to their values.
+   */
+  final Map<String, Object> _params;
+
+  /**
+   * The time (milliseconds since epoch) at which the client made the request
+   * or `null` if this information is not provided by the client.
+   */
+  final int clientRequestTime;
+
+  /**
+   * Initialize a newly created [Request] to have the given [id] and [method]
+   * name.  If [params] is supplied, it is used as the "params" map for the
+   * request.  Otherwise an empty "params" map is allocated.
+   */
+  Request(this.id, this.method,
+      [Map<String, Object> params, this.clientRequestTime])
+      : _params = params != null ? params : new HashMap<String, Object>();
+
+  /**
+   * Return a request parsed from the given json, or `null` if the [data] is
+   * not a valid json representation of a request. The [data] is expected to
+   * have the following format:
+   *
+   *   {
+   *     'clientRequestTime': millisecondsSinceEpoch
+   *     'id': String,
+   *     'method': methodName,
+   *     'params': {
+   *       paramter_name: value
+   *     }
+   *   }
+   *
+   * where both the parameters and clientRequestTime are optional.
+   *
+   * The parameters can contain any number of name/value pairs. The
+   * clientRequestTime must be an int representing the time at which the client
+   * issued the request (milliseconds since epoch).
+   */
+  factory Request.fromJson(Map<String, dynamic> result) {
+    var id = result[Request.ID];
+    var method = result[Request.METHOD];
+    if (id is! String || method is! String) {
+      return null;
+    }
+    var time = result[Request.CLIENT_REQUEST_TIME];
+    if (time != null && time is! int) {
+      return null;
+    }
+    var params = result[Request.PARAMS];
+    if (params is Map || params == null) {
+      return new Request(id, method, params, time);
+    } else {
+      return null;
+    }
+  }
+
+  /**
+   * Return a request parsed from the given [data], or `null` if the [data] is
+   * not a valid json representation of a request. The [data] is expected to
+   * have the following format:
+   *
+   *   {
+   *     'clientRequestTime': millisecondsSinceEpoch
+   *     'id': String,
+   *     'method': methodName,
+   *     'params': {
+   *       paramter_name: value
+   *     }
+   *   }
+   *
+   * where both the parameters and clientRequestTime are optional.
+   *
+   * The parameters can contain any number of name/value pairs. The
+   * clientRequestTime must be an int representing the time at which the client
+   * issued the request (milliseconds since epoch).
+   */
+  factory Request.fromString(String data) {
+    try {
+      var result = JSON.decode(data);
+      if (result is Map) {
+        return new Request.fromJson(result);
+      }
+      return null;
+    } catch (exception) {
+      return null;
+    }
+  }
+
+  /**
+   * Return a table representing the structure of the Json object that will be
+   * sent to the client to represent this response.
+   */
+  Map<String, Object> toJson() {
+    Map<String, Object> jsonObject = new HashMap<String, Object>();
+    jsonObject[ID] = id;
+    jsonObject[METHOD] = method;
+    if (_params.isNotEmpty) {
+      jsonObject[PARAMS] = _params;
+    }
+    if (clientRequestTime != null) {
+      jsonObject[CLIENT_REQUEST_TIME] = clientRequestTime;
+    }
+    return jsonObject;
+  }
+}
+
+/**
+ * An exception that occurred during the handling of a request that requires
+ * that an error be returned to the client.
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class RequestFailure implements Exception {
+  /**
+   * The response to be returned as a result of the failure.
+   */
+  final Response response;
+
+  /**
+   * Initialize a newly created exception to return the given reponse.
+   */
+  RequestFailure(this.response);
+}
+
+/**
+ * An object that can handle requests and produce responses for them.
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+abstract class RequestHandler {
+  /**
+   * Attempt to handle the given [request]. If the request is not recognized by
+   * this handler, return `null` so that other handlers will be given a chance
+   * to handle it. Otherwise, return the response that should be passed back to
+   * the client.
+   */
+  Response handleRequest(Request request);
+}
+
+/**
+ * A response to a request.
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class Response {
+  /**
+   * The [Response] instance that is returned when a real [Response] cannot
+   * be provided at the moment.
+   */
+  static final Response DELAYED_RESPONSE = new Response('DELAYED_RESPONSE');
+
+  /**
+   * The name of the JSON attribute containing the id of the request for which
+   * this is a response.
+   */
+  static const String ID = 'id';
+
+  /**
+   * The name of the JSON attribute containing the error message.
+   */
+  static const String ERROR = 'error';
+
+  /**
+   * The name of the JSON attribute containing the result values.
+   */
+  static const String RESULT = 'result';
+
+  /**
+   * The unique identifier used to identify the request that this response is
+   * associated with.
+   */
+  final String id;
+
+  /**
+   * The error that was caused by attempting to handle the request, or `null` if
+   * there was no error.
+   */
+  final RequestError error;
+
+  /**
+   * A table mapping the names of result fields to their values.  Should be
+   * `null` if there is no result to send.
+   */
+  Map<String, Object> _result;
+
+  /**
+   * Initialize a newly created instance to represent a response to a request
+   * with the given [id].  If [_result] is provided, it will be used as the
+   * result; otherwise an empty result will be used.  If an [error] is provided
+   * then the response will represent an error condition.
+   */
+  Response(this.id, {Map<String, Object> result, this.error})
+      : _result = result;
+
+  /**
+   * Initialize a newly created instance to represent the FILE_NOT_ANALYZED
+   * error condition.
+   */
+  Response.fileNotAnalyzed(Request request, String file)
+      : this(request.id,
+            error: new RequestError(RequestErrorCode.FILE_NOT_ANALYZED,
+                'File is not analyzed: $file.'));
+
+  /**
+   * Initialize a newly created instance to represent the FORMAT_INVALID_FILE
+   * error condition.
+   */
+  Response.formatInvalidFile(Request request)
+      : this(request.id,
+            error: new RequestError(RequestErrorCode.FORMAT_INVALID_FILE,
+                'Error during `edit.format`: invalid file.'));
+
+  /**
+   * Initialize a newly created instance to represent the FORMAT_WITH_ERROR
+   * error condition.
+   */
+  Response.formatWithErrors(Request request)
+      : this(request.id,
+            error: new RequestError(RequestErrorCode.FORMAT_WITH_ERRORS,
+                'Error during `edit.format`: source contains syntax errors.'));
+
+  /**
+   * Initialize a newly created instance based on the given JSON data.
+   */
+  factory Response.fromJson(Map<String, Object> json) {
+    try {
+      Object id = json[Response.ID];
+      if (id is! String) {
+        return null;
+      }
+      Object error = json[Response.ERROR];
+      RequestError decodedError;
+      if (error is Map) {
+        decodedError = new RequestError.fromJson(
+            new ResponseDecoder(null), '.error', error);
+      }
+      Object result = json[Response.RESULT];
+      Map<String, Object> decodedResult;
+      if (result is Map) {
+        decodedResult = result;
+      }
+      return new Response(id, error: decodedError, result: decodedResult);
+    } catch (exception) {
+      return null;
+    }
+  }
+
+  /**
+   * Initialize a newly created instance to represent the
+   * GET_ERRORS_INVALID_FILE error condition.
+   */
+  Response.getErrorsInvalidFile(Request request)
+      : this(request.id,
+            error: new RequestError(RequestErrorCode.GET_ERRORS_INVALID_FILE,
+                'Error during `analysis.getErrors`: invalid file.'));
+
+  /**
+   * Initialize a newly created instance to represent the
+   * GET_NAVIGATION_INVALID_FILE error condition.
+   */
+  Response.getNavigationInvalidFile(Request request)
+      : this(request.id,
+            error: new RequestError(
+                RequestErrorCode.GET_NAVIGATION_INVALID_FILE,
+                'Error during `analysis.getNavigation`: invalid file.'));
+
+  /**
+   * Initialize a newly created instance to represent an error condition caused
+   * by an analysis.reanalyze [request] that specifies an analysis root that is
+   * not in the current list of analysis roots.
+   */
+  Response.invalidAnalysisRoot(Request request, String rootPath)
+      : this(request.id,
+            error: new RequestError(RequestErrorCode.INVALID_ANALYSIS_ROOT,
+                "Invalid analysis root: $rootPath"));
+
+  /**
+   * Initialize a newly created instance to represent an error condition caused
+   * by a [request] that specifies an execution context whose context root does
+   * not exist.
+   */
+  Response.invalidExecutionContext(Request request, String contextId)
+      : this(request.id,
+            error: new RequestError(RequestErrorCode.INVALID_EXECUTION_CONTEXT,
+                "Invalid execution context: $contextId"));
+
+  /**
+   * Initialize a newly created instance to represent an error condition caused
+   * by a [request] that had invalid parameter.  [path] is the path to the
+   * invalid parameter, in Javascript notation (e.g. "foo.bar" means that the
+   * parameter "foo" contained a key "bar" whose value was the wrong type).
+   * [expectation] is a description of the type of data that was expected.
+   */
+  Response.invalidParameter(Request request, String path, String expectation)
+      : this(request.id,
+            error: new RequestError(RequestErrorCode.INVALID_PARAMETER,
+                "Invalid parameter '$path'. $expectation."));
+
+  /**
+   * Initialize a newly created instance to represent an error condition caused
+   * by a malformed request.
+   */
+  Response.invalidRequestFormat()
+      : this('',
+            error: new RequestError(
+                RequestErrorCode.INVALID_REQUEST, 'Invalid request'));
+
+  /**
+   * Initialize a newly created instance to represent an error condition caused
+   * by a request that requires an index, but indexing is disabled.
+   */
+  Response.noIndexGenerated(Request request)
+      : this(request.id,
+            error: new RequestError(
+                RequestErrorCode.NO_INDEX_GENERATED, 'Indexing is disabled'));
+
+  /**
+   * Initialize a newly created instance to represent the
+   * ORGANIZE_DIRECTIVES_ERROR error condition.
+   */
+  Response.organizeDirectivesError(Request request, String message)
+      : this(request.id,
+            error: new RequestError(
+                RequestErrorCode.ORGANIZE_DIRECTIVES_ERROR, message));
+
+  /**
+   * Initialize a newly created instance to represent the
+   * REFACTORING_REQUEST_CANCELLED error condition.
+   */
+  Response.refactoringRequestCancelled(Request request)
+      : this(request.id,
+            error: new RequestError(
+                RequestErrorCode.REFACTORING_REQUEST_CANCELLED,
+                'The `edit.getRefactoring` request was cancelled.'));
+
+  /**
+   * Initialize a newly created instance to represent the SERVER_ERROR error
+   * condition.
+   */
+  factory Response.serverError(Request request, exception, stackTrace) {
+    RequestError error =
+        new RequestError(RequestErrorCode.SERVER_ERROR, exception.toString());
+    if (stackTrace != null) {
+      error.stackTrace = stackTrace.toString();
+    }
+    return new Response(request.id, error: error);
+  }
+
+  /**
+   * Initialize a newly created instance to represent the
+   * SORT_MEMBERS_INVALID_FILE error condition.
+   */
+  Response.sortMembersInvalidFile(Request request)
+      : this(request.id,
+            error: new RequestError(RequestErrorCode.SORT_MEMBERS_INVALID_FILE,
+                'Error during `edit.sortMembers`: invalid file.'));
+
+  /**
+   * Initialize a newly created instance to represent the
+   * SORT_MEMBERS_PARSE_ERRORS error condition.
+   */
+  Response.sortMembersParseErrors(Request request, int numErrors)
+      : this(request.id,
+            error: new RequestError(RequestErrorCode.SORT_MEMBERS_PARSE_ERRORS,
+                'Error during `edit.sortMembers`: file has $numErrors scan/parse errors.'));
+
+  /**
+   * Initialize a newly created instance to represent an error condition caused
+   * by a `analysis.setPriorityFiles` [request] that includes one or more files
+   * that are not being analyzed.
+   */
+  Response.unanalyzedPriorityFiles(String requestId, String fileNames)
+      : this(requestId,
+            error: new RequestError(RequestErrorCode.UNANALYZED_PRIORITY_FILES,
+                "Unanalyzed files cannot be a priority: '$fileNames'"));
+
+  /**
+   * Initialize a newly created instance to represent an error condition caused
+   * by a [request] that cannot be handled by any known handlers.
+   */
+  Response.unknownRequest(Request request)
+      : this(request.id,
+            error: new RequestError(
+                RequestErrorCode.UNKNOWN_REQUEST, 'Unknown request'));
+
+  /**
+   * Initialize a newly created instance to represent an error condition caused
+   * by a [request] referencing a source that does not exist.
+   */
+  Response.unknownSource(Request request)
+      : this(request.id,
+            error: new RequestError(
+                RequestErrorCode.UNKNOWN_SOURCE, 'Unknown source'));
+
+  /**
+   * Initialize a newly created instance to represent an error condition caused
+   * by a [request] for a service that is not supported.
+   */
+  Response.unsupportedFeature(String requestId, String message)
+      : this(requestId,
+            error: new RequestError(
+                RequestErrorCode.UNSUPPORTED_FEATURE, message));
+
+  /**
+   * Return a table representing the structure of the Json object that will be
+   * sent to the client to represent this response.
+   */
+  Map<String, Object> toJson() {
+    Map<String, Object> jsonObject = new HashMap<String, Object>();
+    jsonObject[ID] = id;
+    if (error != null) {
+      jsonObject[ERROR] = error.toJson();
+    }
+    if (_result != null) {
+      jsonObject[RESULT] = _result;
+    }
+    return jsonObject;
+  }
+}
diff --git a/pkg/analysis_server/lib/plugin/protocol/protocol_dart.dart b/pkg/analysis_server/lib/plugin/protocol/protocol_dart.dart
new file mode 100644
index 0000000..c27a188
--- /dev/null
+++ b/pkg/analysis_server/lib/plugin/protocol/protocol_dart.dart
@@ -0,0 +1,218 @@
+// 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.
+
+/**
+ * Utilities for converting Dart entities into analysis server's protocol
+ * entities.
+ */
+library analysis_server.plugin.protocol.protocol_dart;
+
+import 'package:analysis_server/plugin/protocol/protocol.dart';
+import 'package:analysis_server/src/protocol_server.dart';
+import 'package:analyzer/src/generated/element.dart' as engine;
+import 'package:analyzer/src/generated/utilities_dart.dart' as engine;
+
+/**
+ * Return a protocol [Element] corresponding to the given [engine.Element].
+ */
+Element convertElement(engine.Element element) {
+  String name = element.displayName;
+  String elementTypeParameters = _getTypeParametersString(element);
+  String elementParameters = _getParametersString(element);
+  String elementReturnType = getReturnTypeString(element);
+  ElementKind kind = convertElementToElementKind(element);
+  return new Element(
+      kind,
+      name,
+      Element.makeFlags(
+          isPrivate: element.isPrivate,
+          isDeprecated: element.isDeprecated,
+          isAbstract: _isAbstract(element),
+          isConst: _isConst(element),
+          isFinal: _isFinal(element),
+          isStatic: _isStatic(element)),
+      location: newLocation_fromElement(element),
+      typeParameters: elementTypeParameters,
+      parameters: elementParameters,
+      returnType: elementReturnType);
+}
+
+/**
+ * Return a protocol [ElementKind] corresponding to the given
+ * [engine.ElementKind].
+ *
+ * This does not take into account that an instance of [ClassElement] can be an
+ * enum and an instance of [FieldElement] can be an enum constant.
+ * Use [convertElementToElementKind] where possible.
+ */
+ElementKind convertElementKind(engine.ElementKind kind) {
+  if (kind == engine.ElementKind.CLASS) {
+    return ElementKind.CLASS;
+  }
+  if (kind == engine.ElementKind.COMPILATION_UNIT) {
+    return ElementKind.COMPILATION_UNIT;
+  }
+  if (kind == engine.ElementKind.CONSTRUCTOR) {
+    return ElementKind.CONSTRUCTOR;
+  }
+  if (kind == engine.ElementKind.FIELD) {
+    return ElementKind.FIELD;
+  }
+  if (kind == engine.ElementKind.FUNCTION) {
+    return ElementKind.FUNCTION;
+  }
+  if (kind == engine.ElementKind.FUNCTION_TYPE_ALIAS) {
+    return ElementKind.FUNCTION_TYPE_ALIAS;
+  }
+  if (kind == engine.ElementKind.GETTER) {
+    return ElementKind.GETTER;
+  }
+  if (kind == engine.ElementKind.LABEL) {
+    return ElementKind.LABEL;
+  }
+  if (kind == engine.ElementKind.LIBRARY) {
+    return ElementKind.LIBRARY;
+  }
+  if (kind == engine.ElementKind.LOCAL_VARIABLE) {
+    return ElementKind.LOCAL_VARIABLE;
+  }
+  if (kind == engine.ElementKind.METHOD) {
+    return ElementKind.METHOD;
+  }
+  if (kind == engine.ElementKind.PARAMETER) {
+    return ElementKind.PARAMETER;
+  }
+  if (kind == engine.ElementKind.PREFIX) {
+    return ElementKind.PREFIX;
+  }
+  if (kind == engine.ElementKind.SETTER) {
+    return ElementKind.SETTER;
+  }
+  if (kind == engine.ElementKind.TOP_LEVEL_VARIABLE) {
+    return ElementKind.TOP_LEVEL_VARIABLE;
+  }
+  if (kind == engine.ElementKind.TYPE_PARAMETER) {
+    return ElementKind.TYPE_PARAMETER;
+  }
+  return ElementKind.UNKNOWN;
+}
+
+/**
+ * Return an [ElementKind] corresponding to the given [engine.Element].
+ */
+ElementKind convertElementToElementKind(engine.Element element) {
+  if (element is engine.ClassElement && element.isEnum) {
+    return ElementKind.ENUM;
+  }
+  if (element is engine.FieldElement &&
+      element.isEnumConstant &&
+      // MyEnum.values and MyEnum.one.index return isEnumConstant = true
+      // so these additional checks are necessary.
+      // TODO(danrubel) MyEnum.values is constant, but is a list
+      // so should it return isEnumConstant = true?
+      // MyEnum.one.index is final but *not* constant
+      // so should it return isEnumConstant = true?
+      // Or should we return ElementKind.ENUM_CONSTANT here
+      // in either or both of these cases?
+      element.type != null &&
+      element.type.element == element.enclosingElement) {
+    return ElementKind.ENUM_CONSTANT;
+  }
+  return convertElementKind(element.kind);
+}
+
+String _getParametersString(engine.Element element) {
+  // TODO(scheglov) expose the corresponding feature from ExecutableElement
+  List<engine.ParameterElement> parameters;
+  if (element is engine.ExecutableElement) {
+    // valid getters don't have parameters
+    if (element.kind == engine.ElementKind.GETTER &&
+        element.parameters.isEmpty) {
+      return null;
+    }
+    parameters = element.parameters;
+  } else if (element is engine.FunctionTypeAliasElement) {
+    parameters = element.parameters;
+  } else {
+    return null;
+  }
+  StringBuffer sb = new StringBuffer();
+  String closeOptionalString = '';
+  for (engine.ParameterElement parameter in parameters) {
+    if (sb.isNotEmpty) {
+      sb.write(', ');
+    }
+    if (closeOptionalString.isEmpty) {
+      engine.ParameterKind kind = parameter.parameterKind;
+      if (kind == engine.ParameterKind.NAMED) {
+        sb.write('{');
+        closeOptionalString = '}';
+      }
+      if (kind == engine.ParameterKind.POSITIONAL) {
+        sb.write('[');
+        closeOptionalString = ']';
+      }
+    }
+    parameter.appendToWithoutDelimiters(sb);
+  }
+  sb.write(closeOptionalString);
+  return '(' + sb.toString() + ')';
+}
+
+String _getTypeParametersString(engine.Element element) {
+  List<engine.TypeParameterElement> typeParameters;
+  if (element is engine.ClassElement) {
+    typeParameters = element.typeParameters;
+  } else if (element is engine.FunctionTypeAliasElement) {
+    typeParameters = element.typeParameters;
+  }
+  if (typeParameters == null || typeParameters.isEmpty) {
+    return null;
+  }
+  return '<${typeParameters.join(', ')}>';
+}
+
+bool _isAbstract(engine.Element element) {
+  // TODO(scheglov) add isAbstract to Element API
+  if (element is engine.ClassElement) {
+    return element.isAbstract;
+  }
+  if (element is engine.MethodElement) {
+    return element.isAbstract;
+  }
+  if (element is engine.PropertyAccessorElement) {
+    return element.isAbstract;
+  }
+  return false;
+}
+
+bool _isConst(engine.Element element) {
+  // TODO(scheglov) add isConst to Element API
+  if (element is engine.ConstructorElement) {
+    return element.isConst;
+  }
+  if (element is engine.VariableElement) {
+    return element.isConst;
+  }
+  return false;
+}
+
+bool _isFinal(engine.Element element) {
+  // TODO(scheglov) add isFinal to Element API
+  if (element is engine.VariableElement) {
+    return element.isFinal;
+  }
+  return false;
+}
+
+bool _isStatic(engine.Element element) {
+  // TODO(scheglov) add isStatic to Element API
+  if (element is engine.ExecutableElement) {
+    return element.isStatic;
+  }
+  if (element is engine.PropertyInducingElement) {
+    return element.isStatic;
+  }
+  return false;
+}
diff --git a/pkg/analysis_server/lib/src/analysis_logger.dart b/pkg/analysis_server/lib/src/analysis_logger.dart
index 5f73552..04ad6c6 100644
--- a/pkg/analysis_server/lib/src/analysis_logger.dart
+++ b/pkg/analysis_server/lib/src/analysis_logger.dart
@@ -4,6 +4,7 @@
 
 library analysis.logger;
 
+import 'package:analysis_server/src/analysis_server.dart';
 import 'package:analyzer/src/generated/engine.dart';
 import 'package:analyzer/src/generated/java_engine.dart';
 import 'package:logging/logging.dart' as logging;
@@ -18,10 +19,20 @@
    */
   final logging.Logger baseLogger = new logging.Logger('analysis.server');
 
-  AnalysisLogger() {
+  /**
+   * The analysis server that is using this logger.
+   */
+  final AnalysisServer server;
+
+  AnalysisLogger(this.server) {
+    assert(server != null);
     logging.Logger.root.onRecord.listen((logging.LogRecord record) {
       AnalysisEngine.instance.instrumentationService.logLogEntry(
-          record.level.name, record.time, record.message);
+          record.level.name,
+          record.time,
+          record.message,
+          record.error,
+          record.stackTrace);
     });
   }
 
@@ -32,6 +43,8 @@
     } else {
       baseLogger.severe(message, exception.exception, exception.stackTrace);
     }
+    server.sendServerErrorNotification(
+        message, exception, exception?.stackTrace);
   }
 
   @override
diff --git a/pkg/analysis_server/lib/src/analysis_manager.dart b/pkg/analysis_server/lib/src/analysis_manager.dart
index 72d1b5e..fd9bfcd 100644
--- a/pkg/analysis_server/lib/src/analysis_manager.dart
+++ b/pkg/analysis_server/lib/src/analysis_manager.dart
@@ -6,9 +6,9 @@
 import 'dart:convert';
 import 'dart:io';
 
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/channel/channel.dart';
 import 'package:analysis_server/src/channel/web_socket_channel.dart';
-import 'package:analysis_server/src/protocol.dart';
 
 /**
  * [AnalysisManager] is used to launch and manage an analysis server
diff --git a/pkg/analysis_server/lib/src/analysis_server.dart b/pkg/analysis_server/lib/src/analysis_server.dart
index 21a0f7e..60f8d8c 100644
--- a/pkg/analysis_server/lib/src/analysis_server.dart
+++ b/pkg/analysis_server/lib/src/analysis_server.dart
@@ -9,7 +9,8 @@
 import 'dart:core' hide Resource;
 import 'dart:math' show max;
 
-import 'package:analysis_server/plugin/analyzed_files.dart';
+import 'package:analysis_server/plugin/analysis/resolver_provider.dart';
+import 'package:analysis_server/plugin/protocol/protocol.dart' hide Element;
 import 'package:analysis_server/src/analysis_logger.dart';
 import 'package:analysis_server/src/channel/channel.dart';
 import 'package:analysis_server/src/context_manager.dart';
@@ -17,11 +18,9 @@
 import 'package:analysis_server/src/operation/operation_analysis.dart';
 import 'package:analysis_server/src/operation/operation_queue.dart';
 import 'package:analysis_server/src/plugin/server_plugin.dart';
-import 'package:analysis_server/src/protocol.dart' hide Element;
 import 'package:analysis_server/src/services/correction/namespace.dart';
 import 'package:analysis_server/src/services/index/index.dart';
 import 'package:analysis_server/src/services/search/search_engine.dart';
-import 'package:analysis_server/uri/resolver_provider.dart';
 import 'package:analyzer/file_system/file_system.dart';
 import 'package:analyzer/instrumentation/instrumentation.dart';
 import 'package:analyzer/source/pub_package_map_provider.dart';
@@ -29,10 +28,12 @@
 import 'package:analyzer/src/generated/element.dart';
 import 'package:analyzer/src/generated/engine.dart';
 import 'package:analyzer/src/generated/java_engine.dart';
+import 'package:analyzer/src/generated/java_io.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:glob/glob.dart';
 import 'package:plugin/plugin.dart';
 
 typedef void OptionUpdater(AnalysisOptionsImpl options);
@@ -70,7 +71,7 @@
    * The version of the analysis server. The value should be replaced
    * automatically during the build.
    */
-  static final String VERSION = '1.9.0';
+  static final String VERSION = '1.12.0';
 
   /**
    * The number of milliseconds to perform operations before inserting
@@ -183,7 +184,8 @@
    * A table mapping [AnalysisContext]s to the completers that should be
    * completed when analysis of this context is finished.
    */
-  Map<AnalysisContext, Completer<AnalysisDoneReason>> contextAnalysisDoneCompleters =
+  Map<AnalysisContext,
+          Completer<AnalysisDoneReason>> contextAnalysisDoneCompleters =
       new HashMap<AnalysisContext, Completer<AnalysisDoneReason>>();
 
   /**
@@ -283,28 +285,28 @@
    * Initialize a newly created server to receive requests from and send
    * responses to the given [channel].
    *
-   * If a [contextManager] is provided, then the [packageResolverProvider] will
-   * be ignored.
-   *
    * If [rethrowExceptions] is true, then any exceptions thrown by analysis are
    * propagated up the call stack.  The default is true to allow analysis
    * exceptions to show up in unit tests, but it should be set to false when
    * running a full analysis server.
    */
-  AnalysisServer(this.channel, this.resourceProvider,
-      PubPackageMapProvider packageMapProvider, Index _index, this.serverPlugin,
-      this.options, this.defaultSdk, this.instrumentationService,
-      {ContextManager contextManager: null,
-      ResolverProvider packageResolverProvider: null,
+  AnalysisServer(
+      this.channel,
+      this.resourceProvider,
+      PubPackageMapProvider packageMapProvider,
+      Index _index,
+      this.serverPlugin,
+      this.options,
+      this.defaultSdk,
+      this.instrumentationService,
+      {ResolverProvider packageResolverProvider: null,
       this.rethrowExceptions: true})
       : index = _index,
         searchEngine = _index != null ? createSearchEngine(_index) : null {
     _performance = performanceDuringStartup;
     operationQueue = new ServerOperationQueue();
-    if (contextManager == null) {
-      contextManager = new ContextManagerImpl(resourceProvider,
-          packageResolverProvider, packageMapProvider, instrumentationService);
-    }
+    contextManager = new ContextManagerImpl(resourceProvider,
+        packageResolverProvider, packageMapProvider, instrumentationService);
     ServerContextManagerCallbacks contextManagerCallbacks =
         new ServerContextManagerCallbacks(this, resourceProvider);
     contextManager.callbacks = contextManagerCallbacks;
@@ -314,9 +316,8 @@
     defaultContextOptions.incrementalValidation =
         options.enableIncrementalResolutionValidation;
     defaultContextOptions.generateImplicitErrors = false;
-    this.contextManager = contextManager;
     _noErrorNotification = options.noErrorNotification;
-    AnalysisEngine.instance.logger = new AnalysisLogger();
+    AnalysisEngine.instance.logger = new AnalysisLogger(this);
     _onAnalysisStartedController = new StreamController.broadcast();
     _onFileAnalyzedController = new StreamController.broadcast();
     _onPriorityChangeController =
@@ -450,6 +451,26 @@
     return folderMap.values;
   }
 
+  CompilationUnitElement getCompilationUnitElement(String file) {
+    ContextSourcePair pair = getContextSourcePair(file);
+    if (pair == null) {
+      return null;
+    }
+    // prepare AnalysisContext and Source
+    AnalysisContext context = pair.context;
+    Source unitSource = pair.source;
+    if (context == null || unitSource == null) {
+      return null;
+    }
+    // get element in the first library
+    List<Source> librarySources = context.getLibrariesContaining(unitSource);
+    if (!librarySources.isNotEmpty) {
+      return null;
+    }
+    Source librarySource = librarySources.first;
+    return context.getCompilationUnitElement(unitSource, librarySource);
+  }
+
   /**
    * Return the [AnalysisContext] that contains the given [path].
    * Return `null` if no context contains the [path].
@@ -477,9 +498,9 @@
    * first context that implicitly analyzes it.
    *
    * If the [path] is not analyzed by any context, a [ContextSourcePair] with
-   * a `null` context and `file` [Source] is returned.
+   * a `null` context and a `file` [Source] is returned.
    *
-   * If the [path] dosn't represent a file, a [ContextSourcePair] with a `null`
+   * If the [path] doesn't represent a file, a [ContextSourcePair] with a `null`
    * context and `null` [Source] is returned.
    *
    * Does not return `null`.
@@ -490,8 +511,8 @@
       Uri uri = resourceProvider.pathContext.toUri(path);
       Source sdkSource = defaultSdk.fromFileUri(uri);
       if (sdkSource != null) {
-        AnalysisContext anyContext = folderMap.values.first;
-        return new ContextSourcePair(anyContext, sdkSource);
+        AnalysisContext sdkContext = defaultSdk.context;
+        return new ContextSourcePair(sdkContext, sdkSource);
       }
     }
     // try to find the deep-most containing context
@@ -536,7 +557,7 @@
    */
   List<Element> getElementsAtOffset(String file, int offset) {
     List<AstNode> nodes = getNodesAtOffset(file, offset);
-    return getElementsOfNodes(nodes, offset);
+    return getElementsOfNodes(nodes);
   }
 
   /**
@@ -544,7 +565,7 @@
    *
    * May be empty if not resolved, but not `null`.
    */
-  List<Element> getElementsOfNodes(List<AstNode> nodes, int offset) {
+  List<Element> getElementsOfNodes(List<AstNode> nodes) {
     List<Element> elements = <Element>[];
     for (AstNode node in nodes) {
       if (node is SimpleIdentifier && node.parent is LibraryIdentifier) {
@@ -553,7 +574,10 @@
       if (node is LibraryIdentifier) {
         node = node.parent;
       }
-      Element element = ElementLocator.locateWithOffset(node, offset);
+      if (node is StringLiteral && node.parent is UriBasedDirective) {
+        continue;
+      }
+      Element element = ElementLocator.locate(node);
       if (node is SimpleIdentifier && element is PrefixElement) {
         element = getImportElement(node);
       }
@@ -564,6 +588,23 @@
     return elements;
   }
 
+// TODO(brianwilkerson) Add the following method after 'prioritySources' has
+// been added to InternalAnalysisContext.
+//  /**
+//   * Return a list containing the full names of all of the sources that are
+//   * priority sources.
+//   */
+//  List<String> getPriorityFiles() {
+//    List<String> priorityFiles = new List<String>();
+//    folderMap.values.forEach((ContextDirectory directory) {
+//      InternalAnalysisContext context = directory.context;
+//      context.prioritySources.forEach((Source source) {
+//        priorityFiles.add(source.fullName);
+//      });
+//    });
+//    return priorityFiles;
+//  }
+
   /**
    * Return an analysis error info containing the array of all of the errors and
    * the line info associated with [file].
@@ -590,23 +631,6 @@
     return context.getErrors(source);
   }
 
-// TODO(brianwilkerson) Add the following method after 'prioritySources' has
-// been added to InternalAnalysisContext.
-//  /**
-//   * Return a list containing the full names of all of the sources that are
-//   * priority sources.
-//   */
-//  List<String> getPriorityFiles() {
-//    List<String> priorityFiles = new List<String>();
-//    folderMap.values.forEach((ContextDirectory directory) {
-//      InternalAnalysisContext context = directory.context;
-//      context.prioritySources.forEach((Source source) {
-//        priorityFiles.add(source.fullName);
-//      });
-//    });
-//    return priorityFiles;
-//  }
-
   /**
    * Returns resolved [AstNode]s at the given [offset] of the given [file].
    *
@@ -688,7 +712,11 @@
         channel.sendResponse(new Response.unknownRequest(request));
       });
     }, onError: (exception, stackTrace) {
-      sendServerErrorNotification(exception, stackTrace, fatal: true);
+      sendServerErrorNotification(
+          'Failed to handle request: ${request.toJson()}',
+          exception,
+          stackTrace,
+          fatal: true);
     });
   }
 
@@ -769,12 +797,13 @@
     try {
       operation.perform(this);
     } catch (exception, stackTrace) {
-      AnalysisEngine.instance.logger.logError("${exception}\n${stackTrace}");
+      sendServerErrorNotification(
+          'Failed to perform operation: $operation', exception, stackTrace,
+          fatal: true);
       if (rethrowExceptions) {
         throw new AnalysisException('Unexpected exception during analysis',
             new CaughtException(exception, stackTrace));
       }
-      sendServerErrorNotification(exception, stackTrace, fatal: true);
       shutdown();
     } finally {
       if (_test_onOperationPerformedCompleter != null) {
@@ -790,6 +819,7 @@
           sendAnalysisNotificationAnalyzedFiles(this);
         }
         sendStatusNotification(null);
+        _scheduleAnalysisImplementedNotification();
         if (_onAnalysisCompleteCompleter != null) {
           _onAnalysisCompleteCompleter.complete();
           _onAnalysisCompleteCompleter = null;
@@ -863,7 +893,8 @@
   /**
    * Sends a `server.error` notification.
    */
-  void sendServerErrorNotification(exception, stackTrace, {bool fatal: false}) {
+  void sendServerErrorNotification(String msg, exception, stackTrace,
+      {bool fatal: false}) {
     // prepare exception.toString()
     String exceptionString;
     if (exception != null) {
@@ -871,6 +902,8 @@
     } else {
       exceptionString = 'null exception';
     }
+    // prepare message
+    String message = msg != null ? '$msg\n$exceptionString' : exceptionString;
     // prepare stackTrace.toString()
     String stackTraceString;
     if (stackTrace != null) {
@@ -888,7 +921,7 @@
     }
     // send the notification
     channel.sendNotification(
-        new ServerErrorParams(fatal, exceptionString, stackTraceString)
+        new ServerErrorParams(fatal, message, stackTraceString)
             .toNotification());
   }
 
@@ -951,9 +984,26 @@
         if (context == null) {
           continue;
         }
+        Source source = contextSource.source;
+        // Ensure that if the AST is flushed / not ready, it will be
+        // computed eventually.
+        if (AnalysisEngine.isDartFileName(file)) {
+          (context as InternalAnalysisContext).ensureResolvedDartUnits(source);
+        }
+        // Send notifications that don't directly take an AST.
+        switch (service) {
+          case AnalysisService.NAVIGATION:
+            sendAnalysisNotificationNavigation(this, context, source);
+            continue;
+          case AnalysisService.OCCURRENCES:
+            sendAnalysisNotificationOccurrences(this, context, source);
+            continue;
+        }
         // Dart unit notifications.
         if (AnalysisEngine.isDartFileName(file)) {
-          Source source = contextSource.source;
+          // TODO(scheglov) This way to get resolved information is very Dart
+          // specific. OTOH as it is planned now Angular results are not
+          // flushable.
           CompilationUnit dartUnit =
               _getResolvedCompilationUnitToResendNotification(context, source);
           if (dartUnit != null) {
@@ -961,17 +1011,12 @@
               case AnalysisService.HIGHLIGHTS:
                 sendAnalysisNotificationHighlights(this, file, dartUnit);
                 break;
-              case AnalysisService.NAVIGATION:
-                // TODO(scheglov) consider support for one unit in 2+ libraries
-                sendAnalysisNotificationNavigation(this, file, dartUnit);
-                break;
-              case AnalysisService.OCCURRENCES:
-                sendAnalysisNotificationOccurrences(this, file, dartUnit);
-                break;
               case AnalysisService.OUTLINE:
                 AnalysisContext context = dartUnit.element.context;
                 LineInfo lineInfo = context.getLineInfo(source);
-                sendAnalysisNotificationOutline(this, file, lineInfo, dartUnit);
+                SourceKind kind = context.getKindOf(source);
+                sendAnalysisNotificationOutline(
+                    this, file, lineInfo, kind, dartUnit);
                 break;
               case AnalysisService.OVERRIDES:
                 sendAnalysisNotificationOverrides(this, file, dartUnit);
@@ -983,6 +1028,11 @@
     });
     // remember new subscriptions
     this.analysisServices = subscriptions;
+    // special case for implemented elements
+    if (analysisServices.containsKey(AnalysisService.IMPLEMENTED) &&
+        isAnalysisComplete()) {
+      _scheduleAnalysisImplementedNotification();
+    }
   }
 
   /**
@@ -1039,9 +1089,12 @@
       }
       // Fill the source map.
       bool contextFound = false;
+      if (preferredContext != null) {
+        sourceMap.putIfAbsent(preferredContext, () => <Source>[]).add(source);
+        contextFound = true;
+      }
       for (AnalysisContext context in folderMap.values) {
-        if (context == preferredContext ||
-            context.getKindOf(source) != SourceKind.UNKNOWN) {
+        if (context.getKindOf(source) != SourceKind.UNKNOWN) {
           sourceMap.putIfAbsent(context, () => <Source>[]).add(source);
           contextFound = true;
         }
@@ -1059,11 +1112,7 @@
       throw new RequestFailure(
           new Response.unanalyzedPriorityFiles(requestId, buffer.toString()));
     }
-    folderMap.forEach((Folder folder, AnalysisContext context) {
-      List<Source> sourceList = sourceMap[context];
-      if (sourceList == null) {
-        sourceList = Source.EMPTY_LIST;
-      }
+    sourceMap.forEach((context, List<Source> sourceList) {
       context.analysisPriorityOrder = sourceList;
       // Schedule the context for analysis so that it has the opportunity to
       // cache the AST's for the priority sources as soon as possible.
@@ -1186,9 +1235,16 @@
               if (dartUnits != null) {
                 AnalysisErrorInfo errorInfo = context.getErrors(source);
                 for (var dartUnit in dartUnits) {
-                  scheduleNotificationOperations(this, file, errorInfo.lineInfo,
-                      context, null, dartUnit, errorInfo.errors);
-                  scheduleIndexOperation(this, file, context, dartUnit);
+                  scheduleNotificationOperations(
+                      this,
+                      source,
+                      file,
+                      errorInfo.lineInfo,
+                      context,
+                      null,
+                      dartUnit,
+                      errorInfo.errors);
+                  scheduleIndexOperation(this, file, dartUnit);
                 }
               } else {
                 schedulePerformAnalysisOperation(context);
@@ -1273,6 +1329,13 @@
     });
   }
 
+  _scheduleAnalysisImplementedNotification() async {
+    Set<String> files = analysisServices[AnalysisService.IMPLEMENTED];
+    if (files != null) {
+      scheduleImplementedNotification(this, files);
+    }
+  }
+
   /**
    * Schedules [performOperation] exection.
    */
@@ -1349,8 +1412,35 @@
    */
   final ResourceProvider resourceProvider;
 
+  /**
+   * A list of the globs used to determine which files should be analyzed. The
+   * list is lazily created and should be accessed using [analyzedFilesGlobs].
+   */
+  List<Glob> _analyzedFilesGlobs = null;
+
   ServerContextManagerCallbacks(this.analysisServer, this.resourceProvider);
 
+  /**
+   * Return a list of the globs used to determine which files should be analyzed.
+   */
+  List<Glob> get analyzedFilesGlobs {
+    if (_analyzedFilesGlobs == null) {
+      _analyzedFilesGlobs = <Glob>[];
+      List<String> patterns = analysisServer.serverPlugin.analyzedFilePatterns;
+      for (String pattern in patterns) {
+        try {
+          _analyzedFilesGlobs
+              .add(new Glob(pattern, context: JavaFile.pathContext));
+        } catch (exception, stackTrace) {
+          AnalysisEngine.instance.logger.logError(
+              'Invalid glob pattern: "$pattern"',
+              new CaughtException(exception, stackTrace));
+        }
+      }
+    }
+    return _analyzedFilesGlobs;
+  }
+
   @override
   AnalysisContext addContext(Folder folder, FolderDisposition disposition) {
     InternalAnalysisContext context =
@@ -1408,10 +1498,8 @@
 
   @override
   bool shouldFileBeAnalyzed(File file) {
-    List<ShouldAnalyzeFile> functions =
-        analysisServer.serverPlugin.analyzeFileFunctions;
-    for (ShouldAnalyzeFile shouldAnalyzeFile in functions) {
-      if (shouldAnalyzeFile(file)) {
+    for (Glob glob in analyzedFilesGlobs) {
+      if (glob.matches(file.path)) {
         // Emacs creates dummy links to track the fact that a file is open for
         // editing and has unsaved changes (e.g. having unsaved changes to
         // 'foo.dart' causes a link '.#foo.dart' to be created, which points to
@@ -1462,7 +1550,6 @@
  * such as request latency.
  */
 class ServerPerformance {
-
   /**
    * The creation time and the time when performance information
    * started to be recorded here.
diff --git a/pkg/analysis_server/lib/src/channel/byte_stream_channel.dart b/pkg/analysis_server/lib/src/channel/byte_stream_channel.dart
index bfcac2d..ce6235d 100644
--- a/pkg/analysis_server/lib/src/channel/byte_stream_channel.dart
+++ b/pkg/analysis_server/lib/src/channel/byte_stream_channel.dart
@@ -8,9 +8,9 @@
 import 'dart:convert';
 import 'dart:io';
 
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/analysis_server.dart';
 import 'package:analysis_server/src/channel/channel.dart';
-import 'package:analysis_server/src/protocol.dart';
 import 'package:analyzer/instrumentation/instrumentation.dart';
 
 /**
@@ -30,7 +30,7 @@
 
   ByteStreamClientChannel(this.input, this.output) {
     Stream jsonStream = input
-        .transform((new Utf8Codec()).decoder)
+        .transform(const Utf8Decoder())
         .transform(new LineSplitter())
         .transform(new JsonStreamDecoder())
         .where((json) => json is Map)
@@ -105,11 +105,9 @@
   @override
   void listen(void onRequest(Request request),
       {Function onError, void onDone()}) {
-    _input
-        .transform((new Utf8Codec()).decoder)
-        .transform(new LineSplitter())
-        .listen((String data) => _readRequest(data, onRequest),
-            onError: onError, onDone: () {
+    _input.transform(const Utf8Decoder()).transform(new LineSplitter()).listen(
+        (String data) => _readRequest(data, onRequest),
+        onError: onError, onDone: () {
       close();
       onDone();
     });
diff --git a/pkg/analysis_server/lib/src/channel/channel.dart b/pkg/analysis_server/lib/src/channel/channel.dart
index 041b122..f3e473d 100644
--- a/pkg/analysis_server/lib/src/channel/channel.dart
+++ b/pkg/analysis_server/lib/src/channel/channel.dart
@@ -7,7 +7,7 @@
 import 'dart:async';
 import 'dart:convert';
 
-import 'package:analysis_server/src/protocol.dart';
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 
 /**
  * Instances of the class [ChannelChunkSink] uses a [Converter] to translate
diff --git a/pkg/analysis_server/lib/src/channel/web_socket_channel.dart b/pkg/analysis_server/lib/src/channel/web_socket_channel.dart
index 9dc4f00..961bee6 100644
--- a/pkg/analysis_server/lib/src/channel/web_socket_channel.dart
+++ b/pkg/analysis_server/lib/src/channel/web_socket_channel.dart
@@ -8,9 +8,9 @@
 import 'dart:convert';
 import 'dart:io';
 
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/analysis_server.dart';
 import 'package:analysis_server/src/channel/channel.dart';
-import 'package:analysis_server/src/protocol.dart';
 import 'package:analyzer/instrumentation/instrumentation.dart';
 
 /**
diff --git a/pkg/analysis_server/lib/src/collections.dart b/pkg/analysis_server/lib/src/collections.dart
index 8ab3da8..1a1ba38 100644
--- a/pkg/analysis_server/lib/src/collections.dart
+++ b/pkg/analysis_server/lib/src/collections.dart
@@ -28,3 +28,20 @@
   }
   return list;
 }
+
+/// A pair of values.
+class Pair<E, F> {
+  final E first;
+  final F last;
+
+  Pair(this.first, this.last);
+
+  int get hashCode => first.hashCode ^ last.hashCode;
+
+  bool operator ==(other) {
+    if (other is! Pair) return false;
+    return other.first == first && other.last == last;
+  }
+
+  String toString() => '($first, $last)';
+}
diff --git a/pkg/analysis_server/lib/src/computer/computer_highlights.dart b/pkg/analysis_server/lib/src/computer/computer_highlights.dart
index 0491336..1fc175b 100644
--- a/pkg/analysis_server/lib/src/computer/computer_highlights.dart
+++ b/pkg/analysis_server/lib/src/computer/computer_highlights.dart
@@ -4,7 +4,7 @@
 
 library computer.highlights;
 
-import 'package:analysis_server/src/protocol.dart' hide Element;
+import 'package:analysis_server/plugin/protocol/protocol.dart' hide Element;
 import 'package:analyzer/src/generated/ast.dart';
 import 'package:analyzer/src/generated/element.dart';
 import 'package:analyzer/src/generated/scanner.dart';
diff --git a/pkg/analysis_server/lib/src/computer/computer_highlights2.dart b/pkg/analysis_server/lib/src/computer/computer_highlights2.dart
index f89d278..ddab12f 100644
--- a/pkg/analysis_server/lib/src/computer/computer_highlights2.dart
+++ b/pkg/analysis_server/lib/src/computer/computer_highlights2.dart
@@ -4,7 +4,7 @@
 
 library computer.highlights2;
 
-import 'package:analysis_server/src/protocol.dart' hide Element;
+import 'package:analysis_server/plugin/protocol/protocol.dart' hide Element;
 import 'package:analyzer/src/generated/ast.dart';
 import 'package:analyzer/src/generated/element.dart';
 import 'package:analyzer/src/generated/scanner.dart';
@@ -63,15 +63,15 @@
     if (_addIdentifierRegion_constructor(node)) {
       return;
     }
-    if (_addIdentifierRegion_dynamicLocal(node)) {
-      return;
-    }
     if (_addIdentifierRegion_getterSetterDeclaration(node)) {
       return;
     }
     if (_addIdentifierRegion_field(node)) {
       return;
     }
+    if (_addIdentifierRegion_dynamicLocal(node)) {
+      return;
+    }
     if (_addIdentifierRegion_function(node)) {
       return;
     }
@@ -96,6 +96,9 @@
     if (_addIdentifierRegion_typeParameter(node)) {
       return;
     }
+    if (_addIdentifierRegion_unresolvedInstanceMemberReference(node)) {
+      return;
+    }
     _addRegion_node(node, HighlightRegionType.IDENTIFIER_DEFAULT);
   }
 
@@ -352,6 +355,38 @@
     return _addRegion_node(node, HighlightRegionType.TYPE_PARAMETER);
   }
 
+  bool _addIdentifierRegion_unresolvedInstanceMemberReference(
+      SimpleIdentifier node) {
+    // unresolved
+    Element element = node.bestElement;
+    if (element != null) {
+      return false;
+    }
+    // invoke / get / set
+    bool decorate = false;
+    AstNode parent = node.parent;
+    if (parent is MethodInvocation) {
+      Expression target = parent.realTarget;
+      if (parent.methodName == node &&
+          target != null &&
+          _isDynamicExpression(target)) {
+        decorate = true;
+      }
+    } else if (node.inGetterContext() || node.inSetterContext()) {
+      if (parent is PrefixedIdentifier) {
+        decorate = parent.identifier == node;
+      } else if (parent is PropertyAccess) {
+        decorate = parent.propertyName == node;
+      }
+    }
+    if (decorate) {
+      _addRegion_node(
+          node, HighlightRegionType.UNRESOLVED_INSTANCE_MEMBER_REFERENCE);
+      return true;
+    }
+    return false;
+  }
+
   void _addRegion(int offset, int length, HighlightRegionType type) {
     _regions.add(new HighlightRegion(type, offset, length));
   }
@@ -384,6 +419,13 @@
     int end = b.end;
     _addRegion(offset, end - offset, type);
   }
+
+  static bool _isDynamicExpression(Expression e) {
+    if (e is SimpleIdentifier && e.staticElement is PrefixElement) {
+      return false;
+    }
+    return e.bestType.isDynamic;
+  }
 }
 
 /**
@@ -598,6 +640,12 @@
   }
 
   @override
+  Object visitLibraryIdentifier(LibraryIdentifier node) {
+    computer._addRegion_node(node, HighlightRegionType.LIBRARY_NAME);
+    return null;
+  }
+
+  @override
   Object visitListLiteral(ListLiteral node) {
     computer._addRegion_node(node, HighlightRegionType.LITERAL_LIST);
     computer._addRegion_token(node.constKeyword, HighlightRegionType.KEYWORD);
diff --git a/pkg/analysis_server/lib/src/computer/computer_hover.dart b/pkg/analysis_server/lib/src/computer/computer_hover.dart
index e80a243..a6f7337 100644
--- a/pkg/analysis_server/lib/src/computer/computer_hover.dart
+++ b/pkg/analysis_server/lib/src/computer/computer_hover.dart
@@ -4,7 +4,8 @@
 
 library computer.hover;
 
-import 'package:analysis_server/src/protocol.dart' show HoverInformation;
+import 'package:analysis_server/plugin/protocol/protocol.dart'
+    show HoverInformation;
 import 'package:analyzer/src/generated/ast.dart';
 import 'package:analyzer/src/generated/element.dart';
 
@@ -83,7 +84,7 @@
       HoverInformation hover =
           new HoverInformation(expression.offset, expression.length);
       // element
-      Element element = ElementLocator.locateWithOffset(expression, _offset);
+      Element element = ElementLocator.locate(expression);
       if (element != null) {
         // variable, if synthetic accessor
         if (element is PropertyAccessorElement) {
@@ -111,9 +112,7 @@
           }
         }
         // documentation
-        String dartDoc = element.computeDocumentationComment();
-        dartDoc = _removeDartDocDelimiters(dartDoc);
-        hover.dartdoc = dartDoc;
+        hover.dartdoc = _computeDocumentation(element);
       }
       // parameter
       hover.parameter = _safeToString(expression.bestParameterElement);
@@ -127,5 +126,13 @@
     return null;
   }
 
+  String _computeDocumentation(Element element) {
+    if (element is ParameterElement) {
+      element = element.enclosingElement;
+    }
+    String dartDoc = element.computeDocumentationComment();
+    return _removeDartDocDelimiters(dartDoc);
+  }
+
   static _safeToString(obj) => obj != null ? obj.toString() : null;
 }
diff --git a/pkg/analysis_server/lib/src/computer/computer_navigation.dart b/pkg/analysis_server/lib/src/computer/computer_navigation.dart
deleted file mode 100644
index b1caf9b..0000000
--- a/pkg/analysis_server/lib/src/computer/computer_navigation.dart
+++ /dev/null
@@ -1,275 +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 computer.navigation;
-
-import 'dart:collection';
-
-import 'package:analysis_server/src/protocol_server.dart' as protocol;
-import 'package:analyzer/src/generated/ast.dart';
-import 'package:analyzer/src/generated/element.dart';
-import 'package:analyzer/src/generated/scanner.dart';
-import 'package:analyzer/src/generated/source.dart';
-
-/**
- * A computer for navigation regions in a Dart [CompilationUnit].
- */
-class DartUnitNavigationComputer {
-  final List<String> files = <String>[];
-  final Map<String, int> fileMap = new HashMap<String, int>();
-  final List<protocol.NavigationTarget> targets = <protocol.NavigationTarget>[];
-  final Map<Element, int> targetMap = new HashMap<Element, int>();
-  final List<protocol.NavigationRegion> regions = <protocol.NavigationRegion>[];
-
-  /**
-   * Computes [regions], [targets] and [files].
-   */
-  void compute(AstNode node) {
-    node.accept(new _DartUnitNavigationComputerVisitor(this));
-  }
-
-  int _addFile(String file) {
-    int index = fileMap[file];
-    if (index == null) {
-      index = files.length;
-      files.add(file);
-      fileMap[file] = index;
-    }
-    return index;
-  }
-
-  void _addRegion(int offset, int length, Element element) {
-    if (element is FieldFormalParameterElement) {
-      element = (element as FieldFormalParameterElement).field;
-    }
-    if (element == null || element == DynamicElementImpl.instance) {
-      return;
-    }
-    if (element.location == null) {
-      return;
-    }
-    int targetIndex = _addTarget(element);
-    regions
-        .add(new protocol.NavigationRegion(offset, length, <int>[targetIndex]));
-  }
-
-  void _addRegion_nodeStart_nodeEnd(AstNode a, AstNode b, Element element) {
-    int offset = a.offset;
-    int length = b.end - offset;
-    _addRegion(offset, length, element);
-  }
-
-  void _addRegion_tokenStart_nodeEnd(Token a, AstNode b, Element element) {
-    int offset = a.offset;
-    int length = b.end - offset;
-    _addRegion(offset, length, element);
-  }
-
-  void _addRegionForNode(AstNode node, Element element) {
-    int offset = node.offset;
-    int length = node.length;
-    _addRegion(offset, length, element);
-  }
-
-  void _addRegionForToken(Token token, Element element) {
-    int offset = token.offset;
-    int length = token.length;
-    _addRegion(offset, length, element);
-  }
-
-  int _addTarget(Element element) {
-    int index = targetMap[element];
-    if (index == null) {
-      index = targets.length;
-      protocol.NavigationTarget target =
-          protocol.newNavigationTarget_fromElement(element, _addFile);
-      targets.add(target);
-      targetMap[element] = index;
-    }
-    return index;
-  }
-}
-
-class _DartUnitNavigationComputerVisitor extends RecursiveAstVisitor {
-  final DartUnitNavigationComputer computer;
-
-  _DartUnitNavigationComputerVisitor(this.computer);
-
-  @override
-  visitAssignmentExpression(AssignmentExpression node) {
-    _safelyVisit(node.leftHandSide);
-    computer._addRegionForToken(node.operator, node.bestElement);
-    _safelyVisit(node.rightHandSide);
-  }
-
-  @override
-  visitBinaryExpression(BinaryExpression node) {
-    _safelyVisit(node.leftOperand);
-    computer._addRegionForToken(node.operator, node.bestElement);
-    _safelyVisit(node.rightOperand);
-  }
-
-  @override
-  visitCompilationUnit(CompilationUnit unit) {
-    // prepare top-level nodes sorted by their offsets
-    List<AstNode> nodes = <AstNode>[];
-    nodes.addAll(unit.directives);
-    nodes.addAll(unit.declarations);
-    nodes.sort((a, b) {
-      return a.offset - b.offset;
-    });
-    // visit sorted nodes
-    for (AstNode node in nodes) {
-      node.accept(this);
-    }
-  }
-
-  @override
-  visitConstructorDeclaration(ConstructorDeclaration node) {
-    // associate constructor with "T" or "T.name"
-    {
-      AstNode firstNode = node.returnType;
-      AstNode lastNode = node.name;
-      if (lastNode == null) {
-        lastNode = firstNode;
-      }
-      if (firstNode != null && lastNode != null) {
-        computer._addRegion_nodeStart_nodeEnd(
-            firstNode, lastNode, node.element);
-      }
-    }
-    super.visitConstructorDeclaration(node);
-  }
-
-  @override
-  visitConstructorName(ConstructorName node) {
-    AstNode parent = node.parent;
-    if (parent is InstanceCreationExpression &&
-        parent.constructorName == node) {
-      _addConstructorName(parent, node);
-    } else if (parent is ConstructorDeclaration &&
-        parent.redirectedConstructor == node) {
-      _addConstructorName(node, node);
-    }
-  }
-
-  @override
-  visitExportDirective(ExportDirective node) {
-    ExportElement exportElement = node.element;
-    if (exportElement != null) {
-      Element libraryElement = exportElement.exportedLibrary;
-      _addUriDirectiveRegion(node, libraryElement);
-    }
-    super.visitExportDirective(node);
-  }
-
-  @override
-  visitImportDirective(ImportDirective node) {
-    ImportElement importElement = node.element;
-    if (importElement != null) {
-      Element libraryElement = importElement.importedLibrary;
-      _addUriDirectiveRegion(node, libraryElement);
-    }
-    super.visitImportDirective(node);
-  }
-
-  @override
-  visitIndexExpression(IndexExpression node) {
-    super.visitIndexExpression(node);
-    computer._addRegionForToken(node.rightBracket, node.bestElement);
-  }
-
-  @override
-  visitPartDirective(PartDirective node) {
-    _addUriDirectiveRegion(node, node.element);
-    super.visitPartDirective(node);
-  }
-
-  @override
-  visitPartOfDirective(PartOfDirective node) {
-    computer._addRegion_tokenStart_nodeEnd(
-        node.keyword, node.libraryName, node.element);
-    super.visitPartOfDirective(node);
-  }
-
-  @override
-  visitPostfixExpression(PostfixExpression node) {
-    super.visitPostfixExpression(node);
-    computer._addRegionForToken(node.operator, node.bestElement);
-  }
-
-  @override
-  visitPrefixExpression(PrefixExpression node) {
-    computer._addRegionForToken(node.operator, node.bestElement);
-    super.visitPrefixExpression(node);
-  }
-
-  @override
-  visitSimpleIdentifier(SimpleIdentifier node) {
-    if (node.parent is ConstructorDeclaration) {
-      return;
-    }
-    Element element = node.bestElement;
-    computer._addRegionForNode(node, element);
-  }
-
-  @override
-  visitSuperConstructorInvocation(SuperConstructorInvocation node) {
-    Element element = node.staticElement;
-    if (element != null && element.isSynthetic) {
-      element = element.enclosingElement;
-    }
-    // add region
-    SimpleIdentifier name = node.constructorName;
-    if (name != null) {
-      computer._addRegion_nodeStart_nodeEnd(node, name, element);
-    } else {
-      computer._addRegionForToken(node.superKeyword, element);
-    }
-    // process arguments
-    _safelyVisit(node.argumentList);
-  }
-
-  void _addConstructorName(AstNode parent, ConstructorName node) {
-    Element element = node.staticElement;
-    if (element == null) {
-      return;
-    }
-    // if a synthetic constructor, navigate to the class
-    if (element.isSynthetic) {
-      element = element.enclosingElement;
-    }
-    // add regions
-    TypeName typeName = node.type;
-    computer._addRegionForNode(typeName.name, element);
-    // <TypeA, TypeB>
-    TypeArgumentList typeArguments = typeName.typeArguments;
-    if (typeArguments != null) {
-      typeArguments.accept(this);
-    }
-    // optional "name"
-    if (node.name != null) {
-      computer._addRegionForNode(node.name, element);
-    }
-  }
-
-  /**
-   * If the source of the given [element] (referenced by the [node]) exists,
-   * then add the navigation region from the [node] to the [element].
-   */
-  void _addUriDirectiveRegion(UriBasedDirective node, Element element) {
-    if (element != null) {
-      Source source = element.source;
-      if (element.context.exists(source)) {
-        computer._addRegionForNode(node.uri, element);
-      }
-    }
-  }
-
-  void _safelyVisit(AstNode node) {
-    if (node != null) {
-      node.accept(this);
-    }
-  }
-}
diff --git a/pkg/analysis_server/lib/src/computer/computer_occurrences.dart b/pkg/analysis_server/lib/src/computer/computer_occurrences.dart
deleted file mode 100644
index 4897a1a..0000000
--- a/pkg/analysis_server/lib/src/computer/computer_occurrences.dart
+++ /dev/null
@@ -1,78 +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 computer.occurrences;
-
-import 'dart:collection';
-
-import 'package:analysis_server/src/protocol_server.dart' as protocol;
-import 'package:analyzer/src/generated/ast.dart';
-import 'package:analyzer/src/generated/element.dart';
-
-/**
- * A computer for elements occurrences in a Dart [CompilationUnit].
- */
-class DartUnitOccurrencesComputer {
-  final CompilationUnit _unit;
-
-  final Map<Element, List<int>> _elementsOffsets =
-      new HashMap<Element, List<int>>();
-
-  DartUnitOccurrencesComputer(this._unit);
-
-  /**
-   * Returns the computed occurrences, not `null`.
-   */
-  List<protocol.Occurrences> compute() {
-    _unit.accept(new _DartUnitOccurrencesComputerVisitor(this));
-    List<protocol.Occurrences> occurrences = <protocol.Occurrences>[];
-    _elementsOffsets.forEach((engineElement, offsets) {
-      var serverElement = protocol.newElement_fromEngine(engineElement);
-      var length = engineElement.displayName.length;
-      occurrences.add(new protocol.Occurrences(serverElement, offsets, length));
-    });
-    return occurrences;
-  }
-
-  void _addOccurrence(Element element, int offset) {
-    element = _canonicalizeElement(element);
-    if (element == null || element == DynamicElementImpl.instance) {
-      return;
-    }
-    List<int> offsets = _elementsOffsets[element];
-    if (offsets == null) {
-      offsets = <int>[];
-      _elementsOffsets[element] = offsets;
-    }
-    offsets.add(offset);
-  }
-
-  Element _canonicalizeElement(Element element) {
-    if (element is FieldFormalParameterElement) {
-      element = (element as FieldFormalParameterElement).field;
-    }
-    if (element is PropertyAccessorElement) {
-      element = (element as PropertyAccessorElement).variable;
-    }
-    if (element is Member) {
-      element = (element as Member).baseElement;
-    }
-    return element;
-  }
-}
-
-class _DartUnitOccurrencesComputerVisitor extends RecursiveAstVisitor {
-  final DartUnitOccurrencesComputer computer;
-
-  _DartUnitOccurrencesComputerVisitor(this.computer);
-
-  @override
-  visitSimpleIdentifier(SimpleIdentifier node) {
-    Element element = node.bestElement;
-    if (element != null) {
-      computer._addOccurrence(element, node.offset);
-    }
-    return super.visitSimpleIdentifier(node);
-  }
-}
diff --git a/pkg/analysis_server/lib/src/computer/computer_outline.dart b/pkg/analysis_server/lib/src/computer/computer_outline.dart
index 81e9b50..9b4c9b7 100644
--- a/pkg/analysis_server/lib/src/computer/computer_outline.dart
+++ b/pkg/analysis_server/lib/src/computer/computer_outline.dart
@@ -4,8 +4,8 @@
 
 library computer.outline;
 
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/collections.dart';
-import 'package:analysis_server/src/protocol.dart';
 import 'package:analyzer/src/generated/ast.dart';
 import 'package:analyzer/src/generated/element.dart' as engine;
 import 'package:analyzer/src/generated/source.dart';
@@ -137,7 +137,7 @@
     }
     // unit or class member
     if (parent is CompilationUnit) {
-      firstOffset = 0;
+      firstOffset = node.offset;
       siblings = parent.declarations;
     } else if (parent is ClassDeclaration) {
       firstOffset = parent.leftBracket.end;
@@ -160,7 +160,10 @@
     SimpleIdentifier nameNode = node.name;
     String name = nameNode.name;
     _SourceRegion sourceRegion = _getSourceRegion(node);
-    Element element = new Element(ElementKind.CLASS, name, Element.makeFlags(
+    Element element = new Element(
+        ElementKind.CLASS,
+        name,
+        Element.makeFlags(
             isPrivate: Identifier.isPrivateName(name),
             isDeprecated: _isDeprecated(node),
             isAbstract: node.isAbstract),
@@ -174,11 +177,13 @@
     SimpleIdentifier nameNode = node.name;
     String name = nameNode.name;
     _SourceRegion sourceRegion = _getSourceRegion(node);
-    Element element = new Element(ElementKind.CLASS_TYPE_ALIAS, name, Element
-            .makeFlags(
-                isPrivate: Identifier.isPrivateName(name),
-                isDeprecated: _isDeprecated(node),
-                isAbstract: node.isAbstract),
+    Element element = new Element(
+        ElementKind.CLASS_TYPE_ALIAS,
+        name,
+        Element.makeFlags(
+            isPrivate: Identifier.isPrivateName(name),
+            isDeprecated: _isDeprecated(node),
+            isAbstract: node.isAbstract),
         location: _getLocationNode(nameNode),
         typeParameters: _getTypeParametersStr(node.typeParameters));
     return new Outline(element, sourceRegion.offset, sourceRegion.length);
@@ -201,9 +206,11 @@
     _SourceRegion sourceRegion = _getSourceRegion(constructor);
     FormalParameterList parameters = constructor.parameters;
     String parametersStr = parameters != null ? parameters.toSource() : '';
-    Element element = new Element(ElementKind.CONSTRUCTOR, name, Element
-            .makeFlags(
-                isPrivate: isPrivate, isDeprecated: _isDeprecated(constructor)),
+    Element element = new Element(
+        ElementKind.CONSTRUCTOR,
+        name,
+        Element.makeFlags(
+            isPrivate: isPrivate, isDeprecated: _isDeprecated(constructor)),
         location: _getLocationOffsetLength(offset, length),
         parameters: parametersStr);
     List<Outline> contents = _addLocalFunctionOutlines(constructor.body);
@@ -217,10 +224,12 @@
     SimpleIdentifier nameNode = node.name;
     String name = nameNode.name;
     _SourceRegion sourceRegion = _getSourceRegion(node);
-    Element element = new Element(ElementKind.ENUM_CONSTANT, name, Element
-            .makeFlags(
-                isPrivate: Identifier.isPrivateName(name),
-                isDeprecated: _isDeprecated(node)),
+    Element element = new Element(
+        ElementKind.ENUM_CONSTANT,
+        name,
+        Element.makeFlags(
+            isPrivate: Identifier.isPrivateName(name),
+            isDeprecated: _isDeprecated(node)),
         location: _getLocationNode(nameNode));
     return new Outline(element, sourceRegion.offset, sourceRegion.length);
   }
@@ -229,7 +238,10 @@
     SimpleIdentifier nameNode = node.name;
     String name = nameNode.name;
     _SourceRegion sourceRegion = _getSourceRegion(node);
-    Element element = new Element(ElementKind.ENUM, name, Element.makeFlags(
+    Element element = new Element(
+        ElementKind.ENUM,
+        name,
+        Element.makeFlags(
             isPrivate: Identifier.isPrivateName(name),
             isDeprecated: _isDeprecated(node)),
         location: _getLocationNode(nameNode));
@@ -254,7 +266,10 @@
     _SourceRegion sourceRegion = _getSourceRegion(function);
     String parametersStr = parameters != null ? parameters.toSource() : '';
     String returnTypeStr = returnType != null ? returnType.toSource() : '';
-    Element element = new Element(kind, name, Element.makeFlags(
+    Element element = new Element(
+        kind,
+        name,
+        Element.makeFlags(
             isPrivate: Identifier.isPrivateName(name),
             isDeprecated: _isDeprecated(function),
             isStatic: isStatic),
@@ -276,10 +291,12 @@
     FormalParameterList parameters = node.parameters;
     String parametersStr = parameters != null ? parameters.toSource() : '';
     String returnTypeStr = returnType != null ? returnType.toSource() : '';
-    Element element = new Element(ElementKind.FUNCTION_TYPE_ALIAS, name, Element
-            .makeFlags(
-                isPrivate: Identifier.isPrivateName(name),
-                isDeprecated: _isDeprecated(node)),
+    Element element = new Element(
+        ElementKind.FUNCTION_TYPE_ALIAS,
+        name,
+        Element.makeFlags(
+            isPrivate: Identifier.isPrivateName(name),
+            isDeprecated: _isDeprecated(node)),
         location: _getLocationNode(nameNode),
         parameters: parametersStr,
         returnType: returnTypeStr,
@@ -303,7 +320,10 @@
     _SourceRegion sourceRegion = _getSourceRegion(method);
     String parametersStr = parameters != null ? parameters.toSource() : null;
     String returnTypeStr = returnType != null ? returnType.toSource() : '';
-    Element element = new Element(kind, name, Element.makeFlags(
+    Element element = new Element(
+        kind,
+        name,
+        Element.makeFlags(
             isPrivate: Identifier.isPrivateName(name),
             isDeprecated: _isDeprecated(method),
             isAbstract: method.isAbstract,
@@ -326,30 +346,34 @@
         children: nullIfEmpty(unitContents));
   }
 
-  static String _getTypeParametersStr(TypeParameterList parameters) {
-    if (parameters == null) {
-      return null;
-    }
-    return parameters.toSource();
-  }
-
   Outline _newVariableOutline(String typeName, ElementKind kind,
       VariableDeclaration variable, bool isStatic) {
     SimpleIdentifier nameNode = variable.name;
     String name = nameNode.name;
     _SourceRegion sourceRegion = _getSourceRegion(variable);
-    Element element = new Element(kind, name, Element.makeFlags(
+    Element element = new Element(
+        kind,
+        name,
+        Element.makeFlags(
             isPrivate: Identifier.isPrivateName(name),
             isDeprecated: _isDeprecated(variable),
             isStatic: isStatic,
             isConst: variable.isConst,
             isFinal: variable.isFinal),
-        location: _getLocationNode(nameNode), returnType: typeName);
+        location: _getLocationNode(nameNode),
+        returnType: typeName);
     Outline outline =
         new Outline(element, sourceRegion.offset, sourceRegion.length);
     return outline;
   }
 
+  static String _getTypeParametersStr(TypeParameterList parameters) {
+    if (parameters == null) {
+      return null;
+    }
+    return parameters.toSource();
+  }
+
   /**
    * Returns `true` if the given [element] is not `null` and deprecated.
    */
diff --git a/pkg/analysis_server/lib/src/computer/computer_overrides.dart b/pkg/analysis_server/lib/src/computer/computer_overrides.dart
index 4c8cc8f..b817147 100644
--- a/pkg/analysis_server/lib/src/computer/computer_overrides.dart
+++ b/pkg/analysis_server/lib/src/computer/computer_overrides.dart
@@ -51,8 +51,11 @@
     return _overrides;
   }
 
-  void _addInterfaceOverrides(List<engine.Element> elements, String name,
-      engine.InterfaceType type, bool checkType,
+  void _addInterfaceOverrides(
+      Set<engine.Element> elements,
+      String name,
+      engine.InterfaceType type,
+      bool checkType,
       Set<engine.InterfaceType> visited) {
     if (type == null) {
       return;
@@ -65,6 +68,7 @@
       engine.Element element = _lookupMember(type.element, name);
       if (element != null) {
         elements.add(element);
+        return;
       }
     }
     // check interfaces
@@ -85,9 +89,10 @@
       }
     }
     // interfaces
-    List<engine.Element> interfaceEngineElements = <engine.Element>[];
+    Set<engine.Element> interfaceEngineElements = new Set<engine.Element>();
     _addInterfaceOverrides(interfaceEngineElements, name, _currentClass.type,
         false, new Set<engine.InterfaceType>());
+    interfaceEngineElements.remove(superEngineElement);
     // is there any override?
     if (superEngineElement != null || interfaceEngineElements.isNotEmpty) {
       OverriddenMember superMember = superEngineElement != null
diff --git a/pkg/analysis_server/lib/src/constants.dart b/pkg/analysis_server/lib/src/constants.dart
index f37446b..a32ad98 100644
--- a/pkg/analysis_server/lib/src/constants.dart
+++ b/pkg/analysis_server/lib/src/constants.dart
@@ -41,6 +41,7 @@
 const String ANALYSIS_ANALYZED_FILES = 'analysis.analyzedFiles';
 const String ANALYSIS_ERRORS = 'analysis.errors';
 const String ANALYSIS_HIGHLIGHTS = 'analysis.highlights';
+const String ANALYSIS_IMPLEMENTED = 'analysis.implemented';
 const String ANALYSIS_NAVIGATION = 'analysis.navigation';
 const String ANALYSIS_OCCURRENCES = 'analysis.occurrences';
 const String ANALYSIS_OUTLINE = 'analysis.outline';
@@ -136,6 +137,7 @@
 const String FILES = 'files';
 const String FIXES = 'fixes';
 const String FLAGS = 'flags';
+const String HAS_FIX = 'hasFix';
 const String HIERARCHY_ITEMS = 'hierarchyItems';
 const String HOVERS = 'hovers';
 const String ID = 'id';
diff --git a/pkg/analysis_server/lib/src/context_manager.dart b/pkg/analysis_server/lib/src/context_manager.dart
index 3820db5..e232607 100644
--- a/pkg/analysis_server/lib/src/context_manager.dart
+++ b/pkg/analysis_server/lib/src/context_manager.dart
@@ -9,18 +9,20 @@
 import 'dart:convert';
 import 'dart:core' hide Resource;
 
+import 'package:analysis_server/plugin/analysis/resolver_provider.dart';
 import 'package:analysis_server/src/analysis_server.dart';
-import 'package:analysis_server/src/server_options.dart';
-import 'package:analysis_server/uri/resolver_provider.dart';
 import 'package:analyzer/file_system/file_system.dart';
 import 'package:analyzer/instrumentation/instrumentation.dart';
+import 'package:analyzer/plugin/options.dart';
 import 'package:analyzer/source/analysis_options_provider.dart';
 import 'package:analyzer/source/package_map_provider.dart';
 import 'package:analyzer/source/package_map_resolver.dart';
 import 'package:analyzer/source/path_filter.dart';
 import 'package:analyzer/source/pub_package_map_provider.dart';
 import 'package:analyzer/source/sdk_ext.dart';
+import 'package:analyzer/src/context/context.dart' as context;
 import 'package:analyzer/src/generated/engine.dart';
+import 'package:analyzer/src/generated/java_engine.dart';
 import 'package:analyzer/src/generated/java_io.dart';
 import 'package:analyzer/src/generated/source.dart';
 import 'package:analyzer/src/generated/source_io.dart';
@@ -95,7 +97,7 @@
       : contextManager = contextManager,
         folder = folder,
         pathFilter = new PathFilter(
-            contextManager.resourceProvider.pathContext, folder.path, null) {
+            folder.path, null, contextManager.resourceProvider.pathContext) {
     packageDescriptionPath = packagespecFile.path;
     parent.children.add(this);
   }
@@ -309,10 +311,9 @@
  */
 class ContextManagerImpl implements ContextManager {
   /**
-   * Temporary flag to hide WIP .packages support (DEP 5).
+   * The name of the `doc` directory.
    */
-  static bool ENABLE_PACKAGESPEC_SUPPORT = serverOptions.isSet(
-      'ContextManagerImpl.ENABLE_PACKAGESPEC_SUPPORT', defaultValue: true);
+  static const String DOC_DIR_NAME = 'doc';
 
   /**
    * The name of the `lib` directory.
@@ -438,7 +439,7 @@
    */
   ContextInfo getContextInfoFor(Folder folder) {
     ContextInfo info = _getInnermostContextInfoFor(folder.path);
-    if (folder == info.folder) {
+    if (info != null && folder == info.folder) {
       return info;
     }
     return null;
@@ -461,16 +462,64 @@
   }
 
   /**
-   * Process [options] for the context having info [info].
+   * Process [options] for the given context [info].
    */
-  void processOptionsForContext(
-      ContextInfo info, Map<String, YamlNode> options) {
+  void processOptionsForContext(ContextInfo info, Folder folder,
+      {bool optionsRemoved: false}) {
+    Map<String, YamlNode> options;
+    try {
+      options = analysisOptionsProvider.getOptions(folder);
+    } catch (e, stacktrace) {
+      AnalysisEngine.instance.logger.logError(
+          'Error processing .analysis_options',
+          new CaughtException(e, stacktrace));
+      // TODO(pquitslund): contribute plugin that sends error notification on
+      // options file.
+      // Related test:
+      //   context_manager_test.test_analysis_options_parse_failure()
+      // AnalysisEngine.instance.optionsPlugin.optionsProcessors
+      //      .forEach((OptionsProcessor p) => p.onError(e));
+    }
+
+    if (options == null && !optionsRemoved) {
+      return;
+    }
+
+    // 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));
+      }
+    });
+
+    // In case options files are removed, revert to default options.
+    if (optionsRemoved) {
+      info.context.analysisOptions = new AnalysisOptionsImpl();
+      return;
+    }
+
+    // Analysis options are processed 'in-line'.
     YamlMap analyzer = options['analyzer'];
     if (analyzer == null) {
       // No options for analyzer.
       return;
     }
 
+    // Set strong mode (default is false).
+    bool strongMode = analyzer['strong-mode'] ?? false;
+    AnalysisContext context = info.context;
+    if (context.analysisOptions.strongMode != strongMode) {
+      AnalysisOptionsImpl options =
+          new AnalysisOptionsImpl.from(context.analysisOptions);
+      options.strongMode = strongMode;
+      context.analysisOptions = options;
+    }
+
     // Set ignore patterns.
     YamlList exclude = analyzer['exclude'];
     if (exclude != null) {
@@ -530,6 +579,10 @@
       Resource resource = resourceProvider.getResource(path);
       if (resource is Folder) {
         includedFolders.add(resource);
+      } else if (!resource.exists) {
+        // Non-existent resources are ignored.  TODO(paulberry): we should set
+        // up a watcher to ensure that if the resource appears later, we will
+        // begin analyzing it.
       } else {
         // TODO(scheglov) implemented separate files analysis
         throw new UnimplementedError('$path is not a folder. '
@@ -596,7 +649,7 @@
   }
 
   /**
-   * Resursively adds all Dart and HTML files to the [changeSet].
+   * Recursively adds all Dart and HTML files to the [changeSet].
    */
   void _addPreviouslyExcludedSources(ContextInfo info, ChangeSet changeSet,
       Folder folder, List<String> oldExcludedPaths) {
@@ -643,10 +696,12 @@
   }
 
   /**
-   * Resursively adds all Dart and HTML files to the [changeSet].
+   * Recursively adds all Dart and HTML files to the [changeSet].
    */
   void _addSourceFiles(ChangeSet changeSet, Folder folder, ContextInfo info) {
-    if (info.excludesResource(folder) || folder.shortName.startsWith('.')) {
+    if (info.excludesResource(folder) ||
+        folder.shortName.startsWith('.') ||
+        _isInTopLevelDocDir(info.folder.path, folder.path)) {
       return;
     }
     List<Resource> children = null;
@@ -680,6 +735,19 @@
     }
   }
 
+  void _checkForAnalysisOptionsUpdate(
+      String path, ContextInfo info, ChangeType changeType) {
+    if (AnalysisEngine.isAnalysisOptionsFileName(path, pathContext)) {
+      var analysisContext = info.context;
+      if (analysisContext is context.AnalysisContextImpl) {
+        processOptionsForContext(info, info.folder,
+            optionsRemoved: changeType == ChangeType.REMOVE);
+        analysisContext.invalidateCachedResults();
+        callbacks.applyChangesToContext(info.folder, new ChangeSet());
+      }
+    }
+  }
+
   void _checkForPackagespecUpdate(
       String path, ContextInfo info, Folder folder) {
     // Check to see if this is the .packages file for this context and if so,
@@ -766,12 +834,10 @@
       PackageMapInfo packageMapInfo;
       callbacks.beginComputePackageMap();
       try {
-        if (ENABLE_PACKAGESPEC_SUPPORT) {
-          // Try .packages first.
-          if (pathos.basename(packagespecFile.path) == PACKAGE_SPEC_NAME) {
-            Packages packages = _readPackagespec(packagespecFile);
-            return new PackagesFileDisposition(packages);
-          }
+        // Try .packages first.
+        if (pathContext.basename(packagespecFile.path) == PACKAGE_SPEC_NAME) {
+          Packages packages = _readPackagespec(packagespecFile);
+          return new PackagesFileDisposition(packages);
         }
         if (packageResolverProvider != null) {
           UriResolver resolver = packageResolverProvider(folder);
@@ -803,8 +869,7 @@
       ContextInfo parent, Folder folder, File packagespecFile) {
     ContextInfo info = new ContextInfo(this, parent, folder, packagespecFile,
         normalizedPackageRoots[folder.path]);
-    Map<String, YamlNode> options = analysisOptionsProvider.getOptions(folder);
-    processOptionsForContext(info, options);
+
     FolderDisposition disposition;
     List<String> dependencies = <String>[];
 
@@ -817,6 +882,9 @@
     info.setDependencies(dependencies);
     info.context = callbacks.addContext(folder, disposition);
     info.context.name = folder.path;
+
+    processOptionsForContext(info, folder);
+
     return info;
   }
 
@@ -834,13 +902,18 @@
    */
   void _createContexts(
       ContextInfo parent, Folder folder, bool withPackageSpecOnly) {
+    if (_isExcluded(folder.path) ||
+        folder.shortName.startsWith('.') ||
+        folder.shortName == 'packages') {
+      return;
+    }
     // Decide whether a context needs to be created for [folder] here, and if
     // so, create it.
     File packageSpec = _findPackageSpecFile(folder);
     bool createContext = packageSpec.exists || !withPackageSpecOnly;
     if (withPackageSpecOnly &&
         packageSpec.exists &&
-        (parent != null) &&
+        parent != null &&
         parent.ignored(packageSpec.path)) {
       // Don't create a context if the package spec is required and ignored.
       createContext = false;
@@ -930,10 +1003,8 @@
     // so, create it.
     File packageSpec;
 
-    if (ENABLE_PACKAGESPEC_SUPPORT) {
-      // Start by looking for .packages.
-      packageSpec = folder.getChild(PACKAGE_SPEC_NAME);
-    }
+    // Start by looking for .packages.
+    packageSpec = folder.getChild(PACKAGE_SPEC_NAME);
 
     // Fall back to looking for a pubspec.
     if (packageSpec == null || !packageSpec.exists) {
@@ -988,7 +1059,10 @@
       _recomputeFolderDisposition(info);
     }
     // maybe excluded globally
-    if (_isExcluded(path)) {
+    if (_isExcluded(path) ||
+        _isContainedInDotFolder(info.folder.path, path) ||
+        _isInPackagesDir(info.folder.path, path) ||
+        _isInTopLevelDocDir(info.folder.path, path)) {
       return;
     }
     // maybe excluded from the context, so other context will handle it
@@ -1001,46 +1075,33 @@
     // handle the change
     switch (event.type) {
       case ChangeType.ADD:
-        if (_isInPackagesDir(path, info.folder)) {
-          return;
-        }
-
         Resource resource = resourceProvider.getResource(path);
 
-        if (ENABLE_PACKAGESPEC_SUPPORT) {
-          String directoryPath = pathContext.dirname(path);
+        String directoryPath = pathContext.dirname(path);
 
-          // Check to see if we need to create a new context.
-          if (info.isTopLevel) {
-
-            // Only create a new context if this is not the same directory
-            // described by our info object.
-            if (info.folder.path != directoryPath) {
-              if (_isPubspec(path)) {
-                // Check for a sibling .packages file.
-                if (!resourceProvider.getFile(
-                    pathos.join(directoryPath, PACKAGE_SPEC_NAME)).exists) {
-                  _extractContext(info, resource);
-                  return;
-                }
-              }
-              if (_isPackagespec(path)) {
-                // Check for a sibling pubspec.yaml file.
-                if (!resourceProvider
-                    .getFile(pathos.join(directoryPath, PUBSPEC_NAME)).exists) {
-                  _extractContext(info, resource);
-                  return;
-                }
+        // Check to see if we need to create a new context.
+        if (info.isTopLevel) {
+          // Only create a new context if this is not the same directory
+          // described by our info object.
+          if (info.folder.path != directoryPath) {
+            if (_isPubspec(path)) {
+              // Check for a sibling .packages file.
+              if (!resourceProvider
+                  .getFile(pathContext.join(directoryPath, PACKAGE_SPEC_NAME))
+                  .exists) {
+                _extractContext(info, resource);
+                return;
               }
             }
-          }
-        } else {
-          // pubspec was added in a sub-folder, extract a new context
-          if (_isPubspec(path) &&
-              info.isTopLevel &&
-              !info.isPathToPackageDescription(path)) {
-            _extractContext(info, resource);
-            return;
+            if (_isPackagespec(path)) {
+              // Check for a sibling pubspec.yaml file.
+              if (!resourceProvider
+                  .getFile(pathContext.join(directoryPath, PUBSPEC_NAME))
+                  .exists) {
+                _extractContext(info, resource);
+                return;
+              }
+            }
           }
         }
 
@@ -1064,32 +1125,27 @@
         // Note that it's important to verify that there is NEITHER a .packages nor a
         // lingering pubspec.yaml before merging.
         if (!info.isTopLevel) {
-          if (ENABLE_PACKAGESPEC_SUPPORT) {
-            String directoryPath = pathContext.dirname(path);
+          String directoryPath = pathContext.dirname(path);
 
-            // Only merge if this is the same directory described by our info object.
-            if (info.folder.path == directoryPath) {
-              if (_isPubspec(path)) {
-                // Check for a sibling .packages file.
-                if (!resourceProvider.getFile(
-                    pathos.join(directoryPath, PACKAGE_SPEC_NAME)).exists) {
-                  _mergeContext(info);
-                  return;
-                }
-              }
-              if (_isPackagespec(path)) {
-                // Check for a sibling pubspec.yaml file.
-                if (!resourceProvider
-                    .getFile(pathos.join(directoryPath, PUBSPEC_NAME)).exists) {
-                  _mergeContext(info);
-                  return;
-                }
+          // Only merge if this is the same directory described by our info object.
+          if (info.folder.path == directoryPath) {
+            if (_isPubspec(path)) {
+              // Check for a sibling .packages file.
+              if (!resourceProvider
+                  .getFile(pathContext.join(directoryPath, PACKAGE_SPEC_NAME))
+                  .exists) {
+                _mergeContext(info);
+                return;
               }
             }
-          } else {
-            if (info.isPathToPackageDescription(path)) {
-              _mergeContext(info);
-              return;
+            if (_isPackagespec(path)) {
+              // Check for a sibling pubspec.yaml file.
+              if (!resourceProvider
+                  .getFile(pathContext.join(directoryPath, PUBSPEC_NAME))
+                  .exists) {
+                _mergeContext(info);
+                return;
+              }
             }
           }
         }
@@ -1115,9 +1171,25 @@
         }
         break;
     }
-
-    //TODO(pquitslund): find the right place for this
     _checkForPackagespecUpdate(path, info, info.folder);
+    _checkForAnalysisOptionsUpdate(path, info, event.type);
+  }
+
+  /**
+   * Determine whether the given [path], when interpreted relative to the
+   * context root [root], contains a folder whose name starts with '.'.
+   */
+  bool _isContainedInDotFolder(String root, String path) {
+    String relativePath =
+        pathContext.relative(pathContext.dirname(path), from: root);
+    for (String pathComponent in pathContext.split(relativePath)) {
+      if (pathComponent.startsWith('.') &&
+          pathComponent != '.' &&
+          pathComponent != '..') {
+        return true;
+      }
+    }
+    return false;
   }
 
   /**
@@ -1138,15 +1210,25 @@
   }
 
   /**
-   * Determine if the path from [folder] to [path] contains a 'packages'
-   * directory.
+   * Determine whether the given [path], when interpreted relative to the
+   * context root [root], contains a 'packages' folder.
    */
-  bool _isInPackagesDir(String path, Folder folder) {
-    String relativePath = pathContext.relative(path, from: folder.path);
+  bool _isInPackagesDir(String root, String path) {
+    String relativePath = pathContext.relative(path, from: root);
     List<String> pathParts = pathContext.split(relativePath);
     return pathParts.contains(PACKAGES_NAME);
   }
 
+  /**
+   * Determine whether the given [path] is in the direct 'doc' folder of the
+   * context root [root].
+   */
+  bool _isInTopLevelDocDir(String root, String path) {
+    String relativePath = pathContext.relative(path, from: root);
+    return relativePath == DOC_DIR_NAME ||
+        relativePath.startsWith(DOC_DIR_NAME + pathContext.separator);
+  }
+
   bool _isPackagespec(String path) =>
       pathContext.basename(path) == PACKAGE_SPEC_NAME;
 
@@ -1242,7 +1324,8 @@
   /**
    * Initialize a newly created event to indicate which contexts have changed.
    */
-  ContextsChangedEvent({this.added: AnalysisContext.EMPTY_LIST,
+  ContextsChangedEvent(
+      {this.added: AnalysisContext.EMPTY_LIST,
       this.changed: AnalysisContext.EMPTY_LIST,
       this.removed: AnalysisContext.EMPTY_LIST});
 }
@@ -1267,7 +1350,8 @@
 
   @override
   Iterable<UriResolver> createPackageUriResolvers(
-      ResourceProvider resourceProvider) => <UriResolver>[resolver];
+          ResourceProvider resourceProvider) =>
+      <UriResolver>[resolver];
 }
 
 /**
@@ -1325,7 +1409,8 @@
 
   @override
   Iterable<UriResolver> createPackageUriResolvers(
-      ResourceProvider resourceProvider) => const <UriResolver>[];
+          ResourceProvider resourceProvider) =>
+      const <UriResolver>[];
 }
 
 /**
@@ -1346,8 +1431,10 @@
   @override
   Iterable<UriResolver> createPackageUriResolvers(
           ResourceProvider resourceProvider) =>
-      <UriResolver>[new SdkExtUriResolver(packageMap),
-                    new PackageMapUriResolver(resourceProvider, packageMap)];
+      <UriResolver>[
+        new SdkExtUriResolver(packageMap),
+        new PackageMapUriResolver(resourceProvider, packageMap)
+      ];
 }
 
 /**
diff --git a/pkg/analysis_server/lib/src/domain_analysis.dart b/pkg/analysis_server/lib/src/domain_analysis.dart
index 483f532..494d37c 100644
--- a/pkg/analysis_server/lib/src/domain_analysis.dart
+++ b/pkg/analysis_server/lib/src/domain_analysis.dart
@@ -7,15 +7,27 @@
 import 'dart:async';
 import 'dart:core' hide Resource;
 
+import 'package:analysis_server/plugin/analysis/analysis_domain.dart';
 import 'package:analysis_server/src/analysis_server.dart';
 import 'package:analysis_server/src/computer/computer_hover.dart';
-import 'package:analysis_server/src/computer/computer_navigation.dart';
 import 'package:analysis_server/src/constants.dart';
+import 'package:analysis_server/src/context_manager.dart';
+import 'package:analysis_server/src/domains/analysis/navigation.dart';
+import 'package:analysis_server/src/operation/operation_analysis.dart'
+    show
+        NavigationOperation,
+        OccurrencesOperation,
+        sendAnalysisNotificationNavigation;
+import 'package:analysis_server/src/protocol/protocol_internal.dart';
 import 'package:analysis_server/src/protocol_server.dart';
 import 'package:analysis_server/src/services/dependencies/library_dependencies.dart';
 import 'package:analyzer/file_system/file_system.dart';
 import 'package:analyzer/src/generated/ast.dart';
+import 'package:analyzer/src/generated/element.dart';
 import 'package:analyzer/src/generated/engine.dart' as engine;
+import 'package:analyzer/src/generated/java_engine.dart' show CaughtException;
+import 'package:analyzer/src/generated/source.dart';
+import 'package:analyzer/task/model.dart' show ResultDescriptor;
 
 /**
  * Instances of the class [AnalysisDomainHandler] implement a [RequestHandler]
@@ -30,7 +42,9 @@
   /**
    * Initialize a newly created handler to handle requests for the given [server].
    */
-  AnalysisDomainHandler(this.server);
+  AnalysisDomainHandler(this.server) {
+    _callAnalysisDomainReceivers();
+  }
 
   /**
    * Implement the `analysis.getErrors` request.
@@ -125,15 +139,15 @@
           if (units.isEmpty) {
             server.sendResponse(new Response.getNavigationInvalidFile(request));
           } else {
-            DartUnitNavigationComputer computer =
-                new DartUnitNavigationComputer();
-            _GetNavigationAstVisitor visitor = new _GetNavigationAstVisitor(
-                params.offset, params.offset + params.length, computer);
-            for (CompilationUnit unit in units) {
-              unit.accept(visitor);
-            }
+            CompilationUnitElement unitElement = units.first.element;
+            NavigationCollectorImpl collector = computeNavigation(
+                server,
+                unitElement.context,
+                unitElement.source,
+                params.offset,
+                params.length);
             server.sendResponse(new AnalysisGetNavigationResult(
-                    computer.files, computer.targets, computer.regions)
+                    collector.files, collector.targets, collector.regions)
                 .toResponse(request.id));
           }
           break;
@@ -281,40 +295,82 @@
         options.lint = newOptions.generateLints;
       });
     }
+    if (newOptions.enableSuperMixins != null) {
+      updaters.add((engine.AnalysisOptionsImpl options) {
+        options.enableSuperMixins = newOptions.enableSuperMixins;
+      });
+    }
     server.updateOptions(updaters);
     return new AnalysisUpdateOptionsResult().toResponse(request.id);
   }
+
+  /**
+   * Call all the registered [SetAnalysisDomain] functions.
+   */
+  void _callAnalysisDomainReceivers() {
+    AnalysisDomain analysisDomain = new AnalysisDomainImpl(server);
+    for (SetAnalysisDomain function
+        in server.serverPlugin.setAnalysisDomainFunctions) {
+      try {
+        function(analysisDomain);
+      } catch (exception, stackTrace) {
+        engine.AnalysisEngine.instance.logger.logError(
+            'Exception from analysis domain receiver: ${function.runtimeType}',
+            new CaughtException(exception, stackTrace));
+      }
+    }
+  }
 }
 
 /**
- * An AST visitor that computer navigation regions in the givne region.
+ * An implementation of [AnalysisDomain] for [AnalysisServer].
  */
-class _GetNavigationAstVisitor extends UnifyingAstVisitor {
-  final int rangeStart;
-  final int rangeEnd;
-  final DartUnitNavigationComputer computer;
+class AnalysisDomainImpl implements AnalysisDomain {
+  final AnalysisServer server;
 
-  _GetNavigationAstVisitor(this.rangeStart, this.rangeEnd, this.computer);
+  final Map<ResultDescriptor,
+          StreamController<engine.ComputedResult>> controllers =
+      <ResultDescriptor, StreamController<engine.ComputedResult>>{};
 
-  bool isInRange(int offset) {
-    return rangeStart <= offset && offset <= rangeEnd;
+  AnalysisDomainImpl(this.server) {
+    server.onContextsChanged.listen((ContextsChangedEvent event) {
+      event.added.forEach(_subscribeForContext);
+    });
   }
 
   @override
-  visitNode(AstNode node) {
-    // The node ends before the range starts.
-    if (node.end < rangeStart) {
-      return;
+  Stream<engine.ComputedResult> onResultComputed(ResultDescriptor descriptor) {
+    Stream<engine.ComputedResult> stream = controllers
+        .putIfAbsent(descriptor,
+            () => new StreamController<engine.ComputedResult>.broadcast())
+        .stream;
+    server.getAnalysisContexts().forEach(_subscribeForContext);
+    return stream;
+  }
+
+  @override
+  void scheduleNotification(
+      engine.AnalysisContext context, Source source, AnalysisService service) {
+    String file = source.fullName;
+    if (server.hasAnalysisSubscription(service, file)) {
+      if (service == AnalysisService.NAVIGATION) {
+        server.scheduleOperation(new NavigationOperation(context, source));
+      }
+      if (service == AnalysisService.OCCURRENCES) {
+        server.scheduleOperation(new OccurrencesOperation(context, source));
+      }
     }
-    // The node starts after the range ends.
-    if (node.offset > rangeEnd) {
-      return;
+  }
+
+  void _subscribeForContext(engine.AnalysisContext context) {
+    for (ResultDescriptor descriptor in controllers.keys) {
+      context.onResultComputed(descriptor).listen((result) {
+        StreamController<engine.ComputedResult> controller =
+            controllers[result.descriptor];
+        if (controller != null) {
+          controller.add(result);
+        }
+      });
     }
-    // The node starts or ends in the range.
-    if (isInRange(node.offset) || isInRange(node.end)) {
-      computer.compute(node);
-      return;
-    }
-    super.visitNode(node);
   }
 }
diff --git a/pkg/analysis_server/lib/src/domain_completion.dart b/pkg/analysis_server/lib/src/domain_completion.dart
index a956a7d..6d43e53 100644
--- a/pkg/analysis_server/lib/src/domain_completion.dart
+++ b/pkg/analysis_server/lib/src/domain_completion.dart
@@ -6,12 +6,12 @@
 
 import 'dart:async';
 
-import 'package:analysis_server/completion/completion_core.dart'
-    show CompletionRequest, CompletionResult;
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/analysis_server.dart';
 import 'package:analysis_server/src/constants.dart';
 import 'package:analysis_server/src/context_manager.dart';
-import 'package:analysis_server/src/protocol.dart';
+import 'package:analysis_server/src/provisional/completion/completion_core.dart'
+    show CompletionRequest, CompletionResult;
 import 'package:analysis_server/src/services/completion/completion_manager.dart';
 import 'package:analysis_server/src/services/search/search_engine.dart';
 import 'package:analyzer/src/generated/engine.dart';
@@ -57,12 +57,12 @@
   StreamSubscription<SourcesChangedEvent> _sourcesChangedSubscription;
 
   /**
-   * Code completion peformance for the last completion operation.
+   * Code completion performance for the last completion operation.
    */
   CompletionPerformance performance;
 
   /**
-   * A list of code completion peformance measurements for the latest
+   * A list of code completion performance measurements for the latest
    * completion operation up to [performanceListMaxLength] measurements.
    */
   final List<CompletionPerformance> performanceList =
@@ -131,15 +131,22 @@
     if (searchEngine == null) {
       return new Response.noIndexGenerated(request);
     }
-    try {
-      String requestName = request.method;
-      if (requestName == COMPLETION_GET_SUGGESTIONS) {
-        return processRequest(request);
+    return runZoned(() {
+      try {
+        String requestName = request.method;
+        if (requestName == COMPLETION_GET_SUGGESTIONS) {
+          return processRequest(request);
+        }
+      } on RequestFailure catch (exception) {
+        return exception.response;
       }
-    } on RequestFailure catch (exception) {
-      return exception.response;
-    }
-    return null;
+      return null;
+    }, onError: (exception, stackTrace) {
+      server.sendServerErrorNotification(
+          'Failed to handle completion domain request: ${request.toJson()}',
+          exception,
+          stackTrace);
+    });
   }
 
   /**
@@ -192,15 +199,16 @@
     int notificationCount = 0;
     manager.results(completionRequest).listen((CompletionResult result) {
       ++notificationCount;
+      bool isLast = result is CompletionResultImpl ? result.isLast : true;
       performance.logElapseTime("notification $notificationCount send", () {
         sendCompletionNotification(completionId, result.replacementOffset,
-            result.replacementLength, result.suggestions, result.isLast);
+            result.replacementLength, result.suggestions, isLast);
       });
       if (notificationCount == 1) {
         performance.logFirstNotificationComplete('notification 1 complete');
         performance.suggestionCountFirst = result.suggestions.length;
       }
-      if (result.isLast) {
+      if (isLast) {
         performance.notificationCount = notificationCount;
         performance.suggestionCountLast = result.suggestions.length;
         performance.complete();
@@ -235,8 +243,11 @@
   /**
    * Send completion notification results.
    */
-  void sendCompletionNotification(String completionId, int replacementOffset,
-      int replacementLength, Iterable<CompletionSuggestion> results,
+  void sendCompletionNotification(
+      String completionId,
+      int replacementOffset,
+      int replacementLength,
+      Iterable<CompletionSuggestion> results,
       bool isLast) {
     server.sendNotification(new CompletionResultsParams(
             completionId, replacementOffset, replacementLength, results, isLast)
diff --git a/pkg/analysis_server/lib/src/domain_execution.dart b/pkg/analysis_server/lib/src/domain_execution.dart
index f0b6677..470d3c3 100644
--- a/pkg/analysis_server/lib/src/domain_execution.dart
+++ b/pkg/analysis_server/lib/src/domain_execution.dart
@@ -8,9 +8,9 @@
 import 'dart:collection';
 import 'dart:core' hide Resource;
 
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/analysis_server.dart';
 import 'package:analysis_server/src/constants.dart';
-import 'package:analysis_server/src/protocol.dart';
 import 'package:analyzer/file_system/file_system.dart';
 import 'package:analyzer/src/generated/engine.dart';
 import 'package:analyzer/src/generated/source.dart';
diff --git a/pkg/analysis_server/lib/src/domain_experimental.dart b/pkg/analysis_server/lib/src/domain_experimental.dart
new file mode 100644
index 0000000..43631f2
--- /dev/null
+++ b/pkg/analysis_server/lib/src/domain_experimental.dart
@@ -0,0 +1,51 @@
+// 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 src.domain_experimental;
+
+import 'dart:core' hide Resource;
+
+import 'package:analysis_server/plugin/protocol/protocol.dart';
+import 'package:analysis_server/src/analysis_server.dart';
+
+/**
+ * Instances of the class [ExperimentalDomainHandler] implement a
+ * [RequestHandler] that handles requests in the `experimental` domain.
+ */
+class ExperimentalDomainHandler implements RequestHandler {
+  /**
+   * The analysis server that is using this handler to process requests.
+   */
+  final AnalysisServer server;
+
+  /**
+   * The name of the request used to get diagnostic information.
+   */
+  static const String EXPERIMENTAL_DIAGNOSTICS = 'experimental.diagnostics';
+
+  /**
+   * Initialize a newly created handler to handle requests for the given [server].
+   */
+  ExperimentalDomainHandler(this.server);
+
+  @override
+  Response handleRequest(Request request) {
+    try {
+      String requestName = request.method;
+      if (requestName == EXPERIMENTAL_DIAGNOSTICS) {
+        return computeDiagnostics(request);
+      }
+    } on RequestFailure catch (exception) {
+      return exception.response;
+    }
+    return null;
+  }
+
+  /**
+   * Implement the `experimental.diagnostics` request.
+   */
+  Response computeDiagnostics(Request request) {
+    return new Response.unknownRequest(request);
+  }
+}
diff --git a/pkg/analysis_server/lib/src/domain_server.dart b/pkg/analysis_server/lib/src/domain_server.dart
index 81930b9..7a7b34c 100644
--- a/pkg/analysis_server/lib/src/domain_server.dart
+++ b/pkg/analysis_server/lib/src/domain_server.dart
@@ -4,9 +4,9 @@
 
 library domain.server;
 
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/analysis_server.dart';
 import 'package:analysis_server/src/constants.dart';
-import 'package:analysis_server/src/protocol.dart';
 
 /**
  * Instances of the class [ServerDomainHandler] implement a [RequestHandler]
@@ -55,7 +55,8 @@
    */
   Response setSubscriptions(Request request) {
     server.serverServices =
-        new ServerSetSubscriptionsParams.fromRequest(request).subscriptions
+        new ServerSetSubscriptionsParams.fromRequest(request)
+            .subscriptions
             .toSet();
     return new ServerSetSubscriptionsResult().toResponse(request.id);
   }
diff --git a/pkg/analysis_server/lib/src/domains/analysis/implemented_dart.dart b/pkg/analysis_server/lib/src/domains/analysis/implemented_dart.dart
new file mode 100644
index 0000000..f96f42f
--- /dev/null
+++ b/pkg/analysis_server/lib/src/domains/analysis/implemented_dart.dart
@@ -0,0 +1,76 @@
+// 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 domains.analysis.implemented_dart;
+
+import 'package:analysis_server/src/protocol_server.dart' as protocol;
+import 'package:analysis_server/src/services/search/hierarchy.dart';
+import 'package:analysis_server/src/services/search/search_engine.dart';
+import 'package:analyzer/src/generated/element.dart';
+
+class ImplementedComputer {
+  final SearchEngine searchEngine;
+  final CompilationUnitElement unitElement;
+
+  List<protocol.ImplementedClass> classes = <protocol.ImplementedClass>[];
+  List<protocol.ImplementedMember> members = <protocol.ImplementedMember>[];
+
+  Set<ClassElement> subtypes;
+
+  ImplementedComputer(this.searchEngine, this.unitElement);
+
+  compute() async {
+    for (ClassElement type in unitElement.types) {
+      // always include Object and its members
+      if (type.supertype == null) {
+        _addImplementedClass(type);
+        type.accessors.forEach(_addImplementedMember);
+        type.fields.forEach(_addImplementedMember);
+        type.methods.forEach(_addImplementedMember);
+        continue;
+      }
+      // analyze ancestors
+      subtypes = await getSubClasses(searchEngine, type);
+      if (subtypes.isNotEmpty) {
+        _addImplementedClass(type);
+      }
+      type.accessors.forEach(_addMemberIfImplemented);
+      type.fields.forEach(_addMemberIfImplemented);
+      type.methods.forEach(_addMemberIfImplemented);
+    }
+  }
+
+  void _addImplementedClass(ClassElement type) {
+    int offset = type.nameOffset;
+    int length = type.nameLength;
+    classes.add(new protocol.ImplementedClass(offset, length));
+  }
+
+  void _addImplementedMember(Element member) {
+    int offset = member.nameOffset;
+    int length = member.nameLength;
+    members.add(new protocol.ImplementedMember(offset, length));
+  }
+
+  void _addMemberIfImplemented(Element element) {
+    if (!element.isSynthetic) {
+      String name = element.displayName;
+      if (name != null && _hasOverride(name)) {
+        _addImplementedMember(element);
+      }
+    }
+  }
+
+  bool _hasOverride(String name) {
+    for (ClassElement subtype in subtypes) {
+      if (subtype.getMethod(name) != null) {
+        return true;
+      }
+      if (subtype.getField(name) != null) {
+        return true;
+      }
+    }
+    return false;
+  }
+}
diff --git a/pkg/analysis_server/lib/src/domains/analysis/navigation.dart b/pkg/analysis_server/lib/src/domains/analysis/navigation.dart
new file mode 100644
index 0000000..9911d92
--- /dev/null
+++ b/pkg/analysis_server/lib/src/domains/analysis/navigation.dart
@@ -0,0 +1,106 @@
+// 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 domains.analysis.navigation;
+
+import 'dart:collection';
+
+import 'package:analysis_server/plugin/analysis/navigation/navigation_core.dart';
+import 'package:analysis_server/src/analysis_server.dart';
+import 'package:analysis_server/src/collections.dart';
+import 'package:analysis_server/src/protocol_server.dart' as protocol;
+import 'package:analyzer/src/generated/engine.dart'
+    show AnalysisContext, AnalysisEngine;
+import 'package:analyzer/src/generated/java_engine.dart' show CaughtException;
+import 'package:analyzer/src/generated/source.dart' show Source;
+
+/**
+ * Compute all known navigation information for the given part of [source].
+ */
+NavigationCollectorImpl computeNavigation(AnalysisServer server,
+    AnalysisContext context, Source source, int offset, int length) {
+  NavigationCollectorImpl collector = new NavigationCollectorImpl();
+  List<NavigationContributor> contributors =
+      server.serverPlugin.navigationContributors;
+  for (NavigationContributor contributor in contributors) {
+    try {
+      contributor.computeNavigation(collector, context, source, offset, length);
+    } catch (exception, stackTrace) {
+      AnalysisEngine.instance.logger.logError(
+          'Exception from navigation contributor: ${contributor.runtimeType}',
+          new CaughtException(exception, stackTrace));
+    }
+  }
+  collector.sortRegions();
+  return collector;
+}
+
+/**
+ * A concrete implementation of  [NavigationCollector].
+ */
+class NavigationCollectorImpl implements NavigationCollector {
+  /**
+   * A list of navigation regions.
+   */
+  final List<protocol.NavigationRegion> regions = <protocol.NavigationRegion>[];
+
+  /**
+   * All the unique targets referenced by [regions].
+   */
+  final List<protocol.NavigationTarget> targets = <protocol.NavigationTarget>[];
+  final Map<Pair<protocol.ElementKind, protocol.Location>, int> targetMap =
+      new HashMap<Pair<protocol.ElementKind, protocol.Location>, int>();
+
+  /**
+   * All the unique files referenced by [targets].
+   */
+  final List<String> files = <String>[];
+  final Map<String, int> fileMap = new HashMap<String, int>();
+
+  @override
+  void addRegion(int offset, int length, protocol.ElementKind targetKind,
+      protocol.Location targetLocation) {
+    int targetIndex = _addTarget(targetKind, targetLocation);
+    protocol.NavigationRegion region =
+        new protocol.NavigationRegion(offset, length, <int>[targetIndex]);
+    regions.add(region);
+  }
+
+  void sortRegions() {
+    regions.sort((a, b) {
+      return a.offset - b.offset;
+    });
+  }
+
+  int _addFile(String file) {
+    int index = fileMap[file];
+    if (index == null) {
+      index = files.length;
+      files.add(file);
+      fileMap[file] = index;
+    }
+    return index;
+  }
+
+  int _addTarget(protocol.ElementKind kind, protocol.Location location) {
+    var pair =
+        new Pair<protocol.ElementKind, protocol.Location>(kind, location);
+    int index = targetMap[pair];
+    if (index == null) {
+      String file = location.file;
+      int fileIndex = _addFile(file);
+      index = targets.length;
+      protocol.NavigationTarget target = new protocol.NavigationTarget(
+          kind,
+          fileIndex,
+          location.offset,
+          location.length,
+          location.startLine,
+          location.startColumn);
+      targets.add(target);
+      targetMap[pair] = index;
+    }
+    return index;
+  }
+}
diff --git a/pkg/analysis_server/lib/src/domains/analysis/navigation_dart.dart b/pkg/analysis_server/lib/src/domains/analysis/navigation_dart.dart
new file mode 100644
index 0000000..dc4616f
--- /dev/null
+++ b/pkg/analysis_server/lib/src/domains/analysis/navigation_dart.dart
@@ -0,0 +1,312 @@
+// 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 domains.analysis.navigation_dart;
+
+import 'package:analysis_server/plugin/analysis/navigation/navigation_core.dart';
+import 'package:analysis_server/src/protocol_server.dart' as protocol;
+import 'package:analyzer/src/generated/ast.dart';
+import 'package:analyzer/src/generated/element.dart';
+import 'package:analyzer/src/generated/engine.dart';
+import 'package:analyzer/src/generated/scanner.dart';
+import 'package:analyzer/src/generated/source.dart';
+
+/**
+ * A computer for navigation regions in a Dart [CompilationUnit].
+ */
+class DartNavigationComputer implements NavigationContributor {
+  @override
+  void computeNavigation(NavigationCollector collector, AnalysisContext context,
+      Source source, int offset, int length) {
+    List<Source> libraries = context.getLibrariesContaining(source);
+    if (libraries.isNotEmpty) {
+      CompilationUnit unit =
+          context.getResolvedCompilationUnit2(source, libraries.first);
+      if (unit != null) {
+        _DartNavigationCollector dartCollector =
+            new _DartNavigationCollector(collector);
+        _DartNavigationComputerVisitor visitor =
+            new _DartNavigationComputerVisitor(dartCollector);
+        if (offset == null || length == null) {
+          unit.accept(visitor);
+        } else {
+          AstNode node = _getNodeForRange(unit, offset, length);
+          node?.accept(visitor);
+        }
+      }
+    }
+  }
+
+  static AstNode _getNodeForRange(
+      CompilationUnit unit, int offset, int length) {
+    AstNode node = new NodeLocator(offset, offset + length).searchWithin(unit);
+    for (AstNode n = node; n != null; n = n.parent) {
+      if (n is Directive) {
+        return n;
+      }
+    }
+    return node;
+  }
+}
+
+/**
+ * A Dart specific wrapper around [NavigationCollector].
+ */
+class _DartNavigationCollector {
+  final NavigationCollector collector;
+
+  _DartNavigationCollector(this.collector);
+
+  void _addRegion(int offset, int length, Element element) {
+    if (element is FieldFormalParameterElement) {
+      element = (element as FieldFormalParameterElement).field;
+    }
+    if (element == null || element == DynamicElementImpl.instance) {
+      return;
+    }
+    if (element.location == null) {
+      return;
+    }
+    protocol.ElementKind kind = protocol.convertElementKind(element.kind);
+    protocol.Location location = protocol.newLocation_fromElement(element);
+    if (location == null) {
+      return;
+    }
+    collector.addRegion(offset, length, kind, location);
+  }
+
+  void _addRegion_nodeStart_nodeEnd(AstNode a, AstNode b, Element element) {
+    int offset = a.offset;
+    int length = b.end - offset;
+    _addRegion(offset, length, element);
+  }
+
+  void _addRegionForNode(AstNode node, Element element) {
+    if (node == null) {
+      return;
+    }
+    int offset = node.offset;
+    int length = node.length;
+    _addRegion(offset, length, element);
+  }
+
+  void _addRegionForToken(Token token, Element element) {
+    int offset = token.offset;
+    int length = token.length;
+    _addRegion(offset, length, element);
+  }
+}
+
+class _DartNavigationComputerVisitor extends RecursiveAstVisitor {
+  final _DartNavigationCollector computer;
+
+  _DartNavigationComputerVisitor(this.computer);
+
+  @override
+  visitAnnotation(Annotation node) {
+    Element element = node.element;
+    if (element is ConstructorElement && element.isSynthetic) {
+      element = element.enclosingElement;
+    }
+    Identifier name = node.name;
+    if (name is PrefixedIdentifier) {
+      // use constructor in: @PrefixClass.constructorName
+      Element prefixElement = name.prefix.staticElement;
+      if (prefixElement is ClassElement) {
+        prefixElement = element;
+      }
+      computer._addRegionForNode(name.prefix, prefixElement);
+      // always constructor
+      computer._addRegionForNode(name.identifier, element);
+    } else {
+      computer._addRegionForNode(name, element);
+    }
+    computer._addRegionForNode(node.constructorName, element);
+    // arguments
+    _safelyVisit(node.arguments);
+  }
+
+  @override
+  visitAssignmentExpression(AssignmentExpression node) {
+    _safelyVisit(node.leftHandSide);
+    computer._addRegionForToken(node.operator, node.bestElement);
+    _safelyVisit(node.rightHandSide);
+  }
+
+  @override
+  visitBinaryExpression(BinaryExpression node) {
+    _safelyVisit(node.leftOperand);
+    computer._addRegionForToken(node.operator, node.bestElement);
+    _safelyVisit(node.rightOperand);
+  }
+
+  @override
+  visitCompilationUnit(CompilationUnit unit) {
+    // prepare top-level nodes sorted by their offsets
+    List<AstNode> nodes = <AstNode>[];
+    nodes.addAll(unit.directives);
+    nodes.addAll(unit.declarations);
+    nodes.sort((a, b) {
+      return a.offset - b.offset;
+    });
+    // visit sorted nodes
+    for (AstNode node in nodes) {
+      node.accept(this);
+    }
+  }
+
+  @override
+  visitConstructorDeclaration(ConstructorDeclaration node) {
+    // associate constructor with "T" or "T.name"
+    {
+      AstNode firstNode = node.returnType;
+      AstNode lastNode = node.name;
+      if (lastNode == null) {
+        lastNode = firstNode;
+      }
+      if (firstNode != null && lastNode != null) {
+        computer._addRegion_nodeStart_nodeEnd(
+            firstNode, lastNode, node.element);
+      }
+    }
+    super.visitConstructorDeclaration(node);
+  }
+
+  @override
+  visitConstructorName(ConstructorName node) {
+    AstNode parent = node.parent;
+    if (parent is InstanceCreationExpression &&
+        parent.constructorName == node) {
+      _addConstructorName(parent, node);
+    } else if (parent is ConstructorDeclaration &&
+        parent.redirectedConstructor == node) {
+      _addConstructorName(node, node);
+    }
+  }
+
+  @override
+  visitExportDirective(ExportDirective node) {
+    ExportElement exportElement = node.element;
+    if (exportElement != null) {
+      Element libraryElement = exportElement.exportedLibrary;
+      _addUriDirectiveRegion(node, libraryElement);
+    }
+    super.visitExportDirective(node);
+  }
+
+  @override
+  visitImportDirective(ImportDirective node) {
+    ImportElement importElement = node.element;
+    if (importElement != null) {
+      Element libraryElement = importElement.importedLibrary;
+      _addUriDirectiveRegion(node, libraryElement);
+    }
+    super.visitImportDirective(node);
+  }
+
+  @override
+  visitIndexExpression(IndexExpression node) {
+    super.visitIndexExpression(node);
+    MethodElement element = node.bestElement;
+    computer._addRegionForToken(node.leftBracket, element);
+    computer._addRegionForToken(node.rightBracket, element);
+  }
+
+  @override
+  visitLibraryDirective(LibraryDirective node) {
+    computer._addRegionForNode(node.name, node.element);
+  }
+
+  @override
+  visitPartDirective(PartDirective node) {
+    _addUriDirectiveRegion(node, node.element);
+    super.visitPartDirective(node);
+  }
+
+  @override
+  visitPartOfDirective(PartOfDirective node) {
+    computer._addRegionForNode(node.libraryName, node.element);
+    super.visitPartOfDirective(node);
+  }
+
+  @override
+  visitPostfixExpression(PostfixExpression node) {
+    super.visitPostfixExpression(node);
+    computer._addRegionForToken(node.operator, node.bestElement);
+  }
+
+  @override
+  visitPrefixExpression(PrefixExpression node) {
+    computer._addRegionForToken(node.operator, node.bestElement);
+    super.visitPrefixExpression(node);
+  }
+
+  @override
+  visitSimpleIdentifier(SimpleIdentifier node) {
+    if (node.parent is ConstructorDeclaration) {
+      return;
+    }
+    Element element = node.bestElement;
+    computer._addRegionForNode(node, element);
+  }
+
+  @override
+  visitSuperConstructorInvocation(SuperConstructorInvocation node) {
+    Element element = node.staticElement;
+    if (element != null && element.isSynthetic) {
+      element = element.enclosingElement;
+    }
+    // add region
+    SimpleIdentifier name = node.constructorName;
+    if (name != null) {
+      computer._addRegion_nodeStart_nodeEnd(node, name, element);
+    } else {
+      computer._addRegionForToken(node.superKeyword, element);
+    }
+    // process arguments
+    _safelyVisit(node.argumentList);
+  }
+
+  void _addConstructorName(AstNode parent, ConstructorName node) {
+    Element element = node.staticElement;
+    if (element == null) {
+      return;
+    }
+    // if a synthetic constructor, navigate to the class
+    if (element.isSynthetic) {
+      element = element.enclosingElement;
+    }
+    // add regions
+    TypeName typeName = node.type;
+    computer._addRegionForNode(typeName.name, element);
+    // <TypeA, TypeB>
+    TypeArgumentList typeArguments = typeName.typeArguments;
+    if (typeArguments != null) {
+      typeArguments.accept(this);
+    }
+    // optional "name"
+    if (node.name != null) {
+      computer._addRegionForNode(node.name, element);
+    }
+  }
+
+  /**
+   * If the source of the given [element] (referenced by the [node]) exists,
+   * then add the navigation region from the [node] to the [element].
+   */
+  void _addUriDirectiveRegion(UriBasedDirective node, Element element) {
+    if (element != null) {
+      Source source = element.source;
+      if (element.context.exists(source)) {
+        computer._addRegionForNode(node.uri, element);
+      }
+    }
+  }
+
+  void _safelyVisit(AstNode node) {
+    if (node != null) {
+      node.accept(this);
+    }
+  }
+}
diff --git a/pkg/analysis_server/lib/src/domains/analysis/occurrences.dart b/pkg/analysis_server/lib/src/domains/analysis/occurrences.dart
new file mode 100644
index 0000000..2c3668d
--- /dev/null
+++ b/pkg/analysis_server/lib/src/domains/analysis/occurrences.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.
+
+library domains.analysis.occurrences;
+
+import 'package:analysis_server/plugin/analysis/occurrences/occurrences_core.dart';
+import 'package:analysis_server/src/analysis_server.dart';
+import 'package:analysis_server/src/protocol_server.dart' as protocol;
+import 'package:analyzer/src/generated/engine.dart'
+    show AnalysisContext, AnalysisEngine;
+import 'package:analyzer/src/generated/java_engine.dart' show CaughtException;
+import 'package:analyzer/src/generated/source.dart' show Source;
+
+/**
+ * Compute all known occurrences for the given [source].
+ */
+OccurrencesCollectorImpl computeOccurrences(
+    AnalysisServer server, AnalysisContext context, Source source) {
+  OccurrencesCollectorImpl collector = new OccurrencesCollectorImpl();
+  List<OccurrencesContributor> contributors =
+      server.serverPlugin.occurrencesContributors;
+  for (OccurrencesContributor contributor in contributors) {
+    try {
+      contributor.computeOccurrences(collector, context, source);
+    } catch (exception, stackTrace) {
+      AnalysisEngine.instance.logger.logError(
+          'Exception from occurrences contributor: ${contributor.runtimeType}',
+          new CaughtException(exception, stackTrace));
+    }
+  }
+  return collector;
+}
+
+/**
+ * A concrete implementation of [OccurrencesCollector].
+ */
+class OccurrencesCollectorImpl implements OccurrencesCollector {
+  Map<protocol.Element, protocol.Occurrences> elementOccurrences =
+      <protocol.Element, protocol.Occurrences>{};
+
+  List<protocol.Occurrences> get allOccurrences {
+    return elementOccurrences.values.toList();
+  }
+
+  @override
+  void addOccurrences(protocol.Occurrences current) {
+    protocol.Element element = current.element;
+    protocol.Occurrences existing = elementOccurrences[element];
+    if (existing != null) {
+      List<int> offsets = _merge(existing.offsets, current.offsets);
+      current = new protocol.Occurrences(element, offsets, existing.length);
+    }
+    elementOccurrences[element] = current;
+  }
+
+  static List<int> _merge(List<int> a, List<int> b) {
+    return <int>[]..addAll(a)..addAll(b);
+  }
+}
diff --git a/pkg/analysis_server/lib/src/domains/analysis/occurrences_dart.dart b/pkg/analysis_server/lib/src/domains/analysis/occurrences_dart.dart
new file mode 100644
index 0000000..adf253e
--- /dev/null
+++ b/pkg/analysis_server/lib/src/domains/analysis/occurrences_dart.dart
@@ -0,0 +1,79 @@
+// 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 domains.analysis.occurrences_dart;
+
+import 'package:analysis_server/plugin/analysis/occurrences/occurrences_core.dart';
+import 'package:analysis_server/src/protocol_server.dart' as protocol;
+import 'package:analyzer/src/generated/ast.dart';
+import 'package:analyzer/src/generated/element.dart';
+import 'package:analyzer/src/generated/engine.dart';
+import 'package:analyzer/src/generated/source.dart';
+
+/**
+ * A computer for occurrences in a Dart [CompilationUnit].
+ */
+class DartOccurrencesComputer implements OccurrencesContributor {
+  @override
+  void computeOccurrences(
+      OccurrencesCollector collector, AnalysisContext context, Source source) {
+    List<Source> libraries = context.getLibrariesContaining(source);
+    if (libraries.isNotEmpty) {
+      CompilationUnit unit =
+          context.getResolvedCompilationUnit2(source, libraries.first);
+      if (unit != null) {
+        _DartUnitOccurrencesComputerVisitor visitor =
+            new _DartUnitOccurrencesComputerVisitor();
+        unit.accept(visitor);
+        visitor.elementsOffsets.forEach((engineElement, offsets) {
+          int length = engineElement.nameLength;
+          protocol.Element serverElement =
+              protocol.convertElement(engineElement);
+          protocol.Occurrences occurrences =
+              new protocol.Occurrences(serverElement, offsets, length);
+          collector.addOccurrences(occurrences);
+        });
+      }
+    }
+  }
+}
+
+class _DartUnitOccurrencesComputerVisitor extends RecursiveAstVisitor {
+  final Map<Element, List<int>> elementsOffsets = <Element, List<int>>{};
+
+  @override
+  visitSimpleIdentifier(SimpleIdentifier node) {
+    Element element = node.bestElement;
+    if (element != null) {
+      _addOccurrence(element, node.offset);
+    }
+    return super.visitSimpleIdentifier(node);
+  }
+
+  void _addOccurrence(Element element, int offset) {
+    element = _canonicalizeElement(element);
+    if (element == null || element == DynamicElementImpl.instance) {
+      return;
+    }
+    List<int> offsets = elementsOffsets[element];
+    if (offsets == null) {
+      offsets = <int>[];
+      elementsOffsets[element] = offsets;
+    }
+    offsets.add(offset);
+  }
+
+  Element _canonicalizeElement(Element element) {
+    if (element is FieldFormalParameterElement) {
+      element = (element as FieldFormalParameterElement).field;
+    }
+    if (element is PropertyAccessorElement) {
+      element = (element as PropertyAccessorElement).variable;
+    }
+    if (element is Member) {
+      element = (element as Member).baseElement;
+    }
+    return element;
+  }
+}
diff --git a/pkg/analysis_server/lib/src/edit/edit_domain.dart b/pkg/analysis_server/lib/src/edit/edit_domain.dart
index 3213537..3931907 100644
--- a/pkg/analysis_server/lib/src/edit/edit_domain.dart
+++ b/pkg/analysis_server/lib/src/edit/edit_domain.dart
@@ -6,8 +6,8 @@
 
 import 'dart:async';
 
-import 'package:analysis_server/edit/assist/assist_core.dart';
-import 'package:analysis_server/edit/fix/fix_core.dart';
+import 'package:analysis_server/plugin/edit/assist/assist_core.dart';
+import 'package:analysis_server/plugin/edit/fix/fix_core.dart';
 import 'package:analysis_server/src/analysis_server.dart';
 import 'package:analysis_server/src/collections.dart';
 import 'package:analysis_server/src/constants.dart';
@@ -32,6 +32,10 @@
 bool test_simulateRefactoringException_final = false;
 bool test_simulateRefactoringException_init = false;
 
+bool test_simulateRefactoringReset_afterCreateChange = false;
+bool test_simulateRefactoringReset_afterFinalConditions = false;
+bool test_simulateRefactoringReset_afterInitialConditions = false;
+
 /**
  * Instances of the class [EditDomainHandler] implement a [RequestHandler]
  * that handles requests in the edit domain.
@@ -452,6 +456,7 @@
       }
       // validation and create change
       finalStatus = await refactoring.checkFinalConditions();
+      _checkForReset_afterFinalConditions();
       if (_hasFatalError) {
         _sendResultResponse();
         return;
@@ -463,15 +468,47 @@
       // create change
       result.change = await refactoring.createChange();
       result.potentialEdits = nullIfEmpty(refactoring.potentialEditIds);
+      _checkForReset_afterCreateChange();
       _sendResultResponse();
     }, onError: (exception, stackTrace) {
-      server.instrumentationService.logException(exception, stackTrace);
-      server.sendResponse(
-          new Response.serverError(_request, exception, stackTrace));
+      if (exception is _ResetError) {
+        cancel();
+      } else {
+        server.instrumentationService.logException(exception, stackTrace);
+        server.sendResponse(
+            new Response.serverError(_request, exception, stackTrace));
+      }
       _reset();
     });
   }
 
+  void _checkForReset_afterCreateChange() {
+    if (test_simulateRefactoringReset_afterCreateChange) {
+      _reset();
+    }
+    if (refactoring == null) {
+      throw new _ResetError();
+    }
+  }
+
+  void _checkForReset_afterFinalConditions() {
+    if (test_simulateRefactoringReset_afterFinalConditions) {
+      _reset();
+    }
+    if (refactoring == null) {
+      throw new _ResetError();
+    }
+  }
+
+  void _checkForReset_afterInitialConditions() {
+    if (test_simulateRefactoringReset_afterInitialConditions) {
+      _reset();
+    }
+    if (refactoring == null) {
+      throw new _ResetError();
+    }
+  }
+
   /**
    * Initializes this context to perform a refactoring with the specified
    * parameters. The existing [Refactoring] is reused or created as needed.
@@ -520,7 +557,8 @@
       List<CompilationUnit> units = server.getResolvedCompilationUnits(file);
       if (units.isNotEmpty) {
         refactoring = new ExtractLocalRefactoring(units[0], offset, length);
-        feedback = new ExtractLocalVariableFeedback([], [], []);
+        feedback = new ExtractLocalVariableFeedback(
+            <int>[], <int>[], <String>[], <int>[], <int>[]);
       }
     }
     if (kind == RefactoringKind.EXTRACT_METHOD) {
@@ -528,8 +566,8 @@
       if (units.isNotEmpty) {
         refactoring = new ExtractMethodRefactoring(
             searchEngine, units[0], offset, length);
-        feedback = new ExtractMethodFeedback(
-            offset, length, '', [], false, [], [], []);
+        feedback = new ExtractMethodFeedback(offset, length, '', <String>[],
+            false, <RefactoringMethodParameter>[], <int>[], <int>[]);
       }
     }
     if (kind == RefactoringKind.INLINE_LOCAL_VARIABLE) {
@@ -555,7 +593,7 @@
     }
     if (kind == RefactoringKind.RENAME) {
       List<AstNode> nodes = server.getNodesAtOffset(file, offset);
-      List<Element> elements = server.getElementsOfNodes(nodes, offset);
+      List<Element> elements = server.getElementsOfNodes(nodes);
       if (nodes.isNotEmpty && elements.isNotEmpty) {
         AstNode node = nodes[0];
         Element element = elements[0];
@@ -581,6 +619,7 @@
     }
     // check initial conditions
     initStatus = await refactoring.checkInitialConditions();
+    _checkForReset_afterInitialConditions();
     if (refactoring is ExtractLocalRefactoring) {
       ExtractLocalRefactoring refactoring = this.refactoring;
       ExtractLocalVariableFeedback feedback = this.feedback;
@@ -692,3 +731,9 @@
     return new RefactoringStatus();
   }
 }
+
+/**
+ * [_RefactoringManager] throws instances of this class internally to stop
+ * processing in a manager that was reset.
+ */
+class _ResetError {}
diff --git a/pkg/analysis_server/lib/src/generated_protocol.dart b/pkg/analysis_server/lib/src/generated_protocol.dart
deleted file mode 100644
index f92288f..0000000
--- a/pkg/analysis_server/lib/src/generated_protocol.dart
+++ /dev/null
@@ -1,15547 +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.
-//
-// This file has been automatically generated.  Please do not edit it manually.
-// To regenerate the file, use the script
-// "pkg/analysis_server/tool/spec/generate_files".
-
-part of protocol;
-/**
- * server.getVersion params
- */
-class ServerGetVersionParams {
-  Request toRequest(String id) {
-    return new Request(id, "server.getVersion", null);
-  }
-
-  @override
-  bool operator==(other) {
-    if (other is ServerGetVersionParams) {
-      return true;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    return 55877452;
-  }
-}
-
-/**
- * server.getVersion result
- *
- * {
- *   "version": String
- * }
- */
-class ServerGetVersionResult implements HasToJson {
-  String _version;
-
-  /**
-   * The version number of the analysis server.
-   */
-  String get version => _version;
-
-  /**
-   * The version number of the analysis server.
-   */
-  void set version(String value) {
-    assert(value != null);
-    this._version = value;
-  }
-
-  ServerGetVersionResult(String version) {
-    this.version = version;
-  }
-
-  factory ServerGetVersionResult.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      String version;
-      if (json.containsKey("version")) {
-        version = jsonDecoder._decodeString(jsonPath + ".version", json["version"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "version");
-      }
-      return new ServerGetVersionResult(version);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "server.getVersion result", json);
-    }
-  }
-
-  factory ServerGetVersionResult.fromResponse(Response response) {
-    return new ServerGetVersionResult.fromJson(
-        new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), "result", response._result);
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["version"] = version;
-    return result;
-  }
-
-  Response toResponse(String id) {
-    return new Response(id, result: toJson());
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is ServerGetVersionResult) {
-      return version == other.version;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, version.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-/**
- * server.shutdown params
- */
-class ServerShutdownParams {
-  Request toRequest(String id) {
-    return new Request(id, "server.shutdown", null);
-  }
-
-  @override
-  bool operator==(other) {
-    if (other is ServerShutdownParams) {
-      return true;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    return 366630911;
-  }
-}
-/**
- * server.shutdown result
- */
-class ServerShutdownResult {
-  Response toResponse(String id) {
-    return new Response(id, result: null);
-  }
-
-  @override
-  bool operator==(other) {
-    if (other is ServerShutdownResult) {
-      return true;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    return 193626532;
-  }
-}
-
-/**
- * server.setSubscriptions params
- *
- * {
- *   "subscriptions": List<ServerService>
- * }
- */
-class ServerSetSubscriptionsParams implements HasToJson {
-  List<ServerService> _subscriptions;
-
-  /**
-   * A list of the services being subscribed to.
-   */
-  List<ServerService> get subscriptions => _subscriptions;
-
-  /**
-   * A list of the services being subscribed to.
-   */
-  void set subscriptions(List<ServerService> value) {
-    assert(value != null);
-    this._subscriptions = value;
-  }
-
-  ServerSetSubscriptionsParams(List<ServerService> subscriptions) {
-    this.subscriptions = subscriptions;
-  }
-
-  factory ServerSetSubscriptionsParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      List<ServerService> subscriptions;
-      if (json.containsKey("subscriptions")) {
-        subscriptions = jsonDecoder._decodeList(jsonPath + ".subscriptions", json["subscriptions"], (String jsonPath, Object json) => new ServerService.fromJson(jsonDecoder, jsonPath, json));
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "subscriptions");
-      }
-      return new ServerSetSubscriptionsParams(subscriptions);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "server.setSubscriptions params", json);
-    }
-  }
-
-  factory ServerSetSubscriptionsParams.fromRequest(Request request) {
-    return new ServerSetSubscriptionsParams.fromJson(
-        new RequestDecoder(request), "params", request._params);
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["subscriptions"] = subscriptions.map((ServerService value) => value.toJson()).toList();
-    return result;
-  }
-
-  Request toRequest(String id) {
-    return new Request(id, "server.setSubscriptions", toJson());
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is ServerSetSubscriptionsParams) {
-      return _listEqual(subscriptions, other.subscriptions, (ServerService a, ServerService b) => a == b);
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, subscriptions.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-/**
- * server.setSubscriptions result
- */
-class ServerSetSubscriptionsResult {
-  Response toResponse(String id) {
-    return new Response(id, result: null);
-  }
-
-  @override
-  bool operator==(other) {
-    if (other is ServerSetSubscriptionsResult) {
-      return true;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    return 748820900;
-  }
-}
-
-/**
- * server.connected params
- *
- * {
- *   "version": String
- * }
- */
-class ServerConnectedParams implements HasToJson {
-  String _version;
-
-  /**
-   * The version number of the analysis server.
-   */
-  String get version => _version;
-
-  /**
-   * The version number of the analysis server.
-   */
-  void set version(String value) {
-    assert(value != null);
-    this._version = value;
-  }
-
-  ServerConnectedParams(String version) {
-    this.version = version;
-  }
-
-  factory ServerConnectedParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      String version;
-      if (json.containsKey("version")) {
-        version = jsonDecoder._decodeString(jsonPath + ".version", json["version"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "version");
-      }
-      return new ServerConnectedParams(version);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "server.connected params", json);
-    }
-  }
-
-  factory ServerConnectedParams.fromNotification(Notification notification) {
-    return new ServerConnectedParams.fromJson(
-        new ResponseDecoder(null), "params", notification._params);
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["version"] = version;
-    return result;
-  }
-
-  Notification toNotification() {
-    return new Notification("server.connected", toJson());
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is ServerConnectedParams) {
-      return version == other.version;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, version.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * server.error params
- *
- * {
- *   "isFatal": bool
- *   "message": String
- *   "stackTrace": String
- * }
- */
-class ServerErrorParams implements HasToJson {
-  bool _isFatal;
-
-  String _message;
-
-  String _stackTrace;
-
-  /**
-   * True if the error is a fatal error, meaning that the server will shutdown
-   * automatically after sending this notification.
-   */
-  bool get isFatal => _isFatal;
-
-  /**
-   * True if the error is a fatal error, meaning that the server will shutdown
-   * automatically after sending this notification.
-   */
-  void set isFatal(bool value) {
-    assert(value != null);
-    this._isFatal = value;
-  }
-
-  /**
-   * The error message indicating what kind of error was encountered.
-   */
-  String get message => _message;
-
-  /**
-   * The error message indicating what kind of error was encountered.
-   */
-  void set message(String value) {
-    assert(value != null);
-    this._message = value;
-  }
-
-  /**
-   * The stack trace associated with the generation of the error, used for
-   * debugging the server.
-   */
-  String get stackTrace => _stackTrace;
-
-  /**
-   * The stack trace associated with the generation of the error, used for
-   * debugging the server.
-   */
-  void set stackTrace(String value) {
-    assert(value != null);
-    this._stackTrace = value;
-  }
-
-  ServerErrorParams(bool isFatal, String message, String stackTrace) {
-    this.isFatal = isFatal;
-    this.message = message;
-    this.stackTrace = stackTrace;
-  }
-
-  factory ServerErrorParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      bool isFatal;
-      if (json.containsKey("isFatal")) {
-        isFatal = jsonDecoder._decodeBool(jsonPath + ".isFatal", json["isFatal"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "isFatal");
-      }
-      String message;
-      if (json.containsKey("message")) {
-        message = jsonDecoder._decodeString(jsonPath + ".message", json["message"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "message");
-      }
-      String stackTrace;
-      if (json.containsKey("stackTrace")) {
-        stackTrace = jsonDecoder._decodeString(jsonPath + ".stackTrace", json["stackTrace"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "stackTrace");
-      }
-      return new ServerErrorParams(isFatal, message, stackTrace);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "server.error params", json);
-    }
-  }
-
-  factory ServerErrorParams.fromNotification(Notification notification) {
-    return new ServerErrorParams.fromJson(
-        new ResponseDecoder(null), "params", notification._params);
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["isFatal"] = isFatal;
-    result["message"] = message;
-    result["stackTrace"] = stackTrace;
-    return result;
-  }
-
-  Notification toNotification() {
-    return new Notification("server.error", toJson());
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is ServerErrorParams) {
-      return isFatal == other.isFatal &&
-          message == other.message &&
-          stackTrace == other.stackTrace;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, isFatal.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, message.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, stackTrace.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * server.status params
- *
- * {
- *   "analysis": optional AnalysisStatus
- *   "pub": optional PubStatus
- * }
- */
-class ServerStatusParams implements HasToJson {
-  AnalysisStatus _analysis;
-
-  PubStatus _pub;
-
-  /**
-   * The current status of analysis, including whether analysis is being
-   * performed and if so what is being analyzed.
-   */
-  AnalysisStatus get analysis => _analysis;
-
-  /**
-   * The current status of analysis, including whether analysis is being
-   * performed and if so what is being analyzed.
-   */
-  void set analysis(AnalysisStatus value) {
-    this._analysis = value;
-  }
-
-  /**
-   * The current status of pub execution, indicating whether we are currently
-   * running pub.
-   */
-  PubStatus get pub => _pub;
-
-  /**
-   * The current status of pub execution, indicating whether we are currently
-   * running pub.
-   */
-  void set pub(PubStatus value) {
-    this._pub = value;
-  }
-
-  ServerStatusParams({AnalysisStatus analysis, PubStatus pub}) {
-    this.analysis = analysis;
-    this.pub = pub;
-  }
-
-  factory ServerStatusParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      AnalysisStatus analysis;
-      if (json.containsKey("analysis")) {
-        analysis = new AnalysisStatus.fromJson(jsonDecoder, jsonPath + ".analysis", json["analysis"]);
-      }
-      PubStatus pub;
-      if (json.containsKey("pub")) {
-        pub = new PubStatus.fromJson(jsonDecoder, jsonPath + ".pub", json["pub"]);
-      }
-      return new ServerStatusParams(analysis: analysis, pub: pub);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "server.status params", json);
-    }
-  }
-
-  factory ServerStatusParams.fromNotification(Notification notification) {
-    return new ServerStatusParams.fromJson(
-        new ResponseDecoder(null), "params", notification._params);
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    if (analysis != null) {
-      result["analysis"] = analysis.toJson();
-    }
-    if (pub != null) {
-      result["pub"] = pub.toJson();
-    }
-    return result;
-  }
-
-  Notification toNotification() {
-    return new Notification("server.status", toJson());
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is ServerStatusParams) {
-      return analysis == other.analysis &&
-          pub == other.pub;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, analysis.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, pub.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * analysis.getErrors params
- *
- * {
- *   "file": FilePath
- * }
- */
-class AnalysisGetErrorsParams implements HasToJson {
-  String _file;
-
-  /**
-   * The file for which errors are being requested.
-   */
-  String get file => _file;
-
-  /**
-   * The file for which errors are being requested.
-   */
-  void set file(String value) {
-    assert(value != null);
-    this._file = value;
-  }
-
-  AnalysisGetErrorsParams(String file) {
-    this.file = file;
-  }
-
-  factory AnalysisGetErrorsParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      String file;
-      if (json.containsKey("file")) {
-        file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "file");
-      }
-      return new AnalysisGetErrorsParams(file);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "analysis.getErrors params", json);
-    }
-  }
-
-  factory AnalysisGetErrorsParams.fromRequest(Request request) {
-    return new AnalysisGetErrorsParams.fromJson(
-        new RequestDecoder(request), "params", request._params);
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["file"] = file;
-    return result;
-  }
-
-  Request toRequest(String id) {
-    return new Request(id, "analysis.getErrors", toJson());
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is AnalysisGetErrorsParams) {
-      return file == other.file;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, file.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * analysis.getErrors result
- *
- * {
- *   "errors": List<AnalysisError>
- * }
- */
-class AnalysisGetErrorsResult implements HasToJson {
-  List<AnalysisError> _errors;
-
-  /**
-   * The errors associated with the file.
-   */
-  List<AnalysisError> get errors => _errors;
-
-  /**
-   * The errors associated with the file.
-   */
-  void set errors(List<AnalysisError> value) {
-    assert(value != null);
-    this._errors = value;
-  }
-
-  AnalysisGetErrorsResult(List<AnalysisError> errors) {
-    this.errors = errors;
-  }
-
-  factory AnalysisGetErrorsResult.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      List<AnalysisError> errors;
-      if (json.containsKey("errors")) {
-        errors = jsonDecoder._decodeList(jsonPath + ".errors", json["errors"], (String jsonPath, Object json) => new AnalysisError.fromJson(jsonDecoder, jsonPath, json));
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "errors");
-      }
-      return new AnalysisGetErrorsResult(errors);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "analysis.getErrors result", json);
-    }
-  }
-
-  factory AnalysisGetErrorsResult.fromResponse(Response response) {
-    return new AnalysisGetErrorsResult.fromJson(
-        new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), "result", response._result);
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["errors"] = errors.map((AnalysisError value) => value.toJson()).toList();
-    return result;
-  }
-
-  Response toResponse(String id) {
-    return new Response(id, result: toJson());
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is AnalysisGetErrorsResult) {
-      return _listEqual(errors, other.errors, (AnalysisError a, AnalysisError b) => a == b);
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, errors.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * analysis.getHover params
- *
- * {
- *   "file": FilePath
- *   "offset": int
- * }
- */
-class AnalysisGetHoverParams implements HasToJson {
-  String _file;
-
-  int _offset;
-
-  /**
-   * The file in which hover information is being requested.
-   */
-  String get file => _file;
-
-  /**
-   * The file in which hover information is being requested.
-   */
-  void set file(String value) {
-    assert(value != null);
-    this._file = value;
-  }
-
-  /**
-   * The offset for which hover information is being requested.
-   */
-  int get offset => _offset;
-
-  /**
-   * The offset for which hover information is being requested.
-   */
-  void set offset(int value) {
-    assert(value != null);
-    this._offset = value;
-  }
-
-  AnalysisGetHoverParams(String file, int offset) {
-    this.file = file;
-    this.offset = offset;
-  }
-
-  factory AnalysisGetHoverParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      String file;
-      if (json.containsKey("file")) {
-        file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "file");
-      }
-      int offset;
-      if (json.containsKey("offset")) {
-        offset = jsonDecoder._decodeInt(jsonPath + ".offset", json["offset"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "offset");
-      }
-      return new AnalysisGetHoverParams(file, offset);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "analysis.getHover params", json);
-    }
-  }
-
-  factory AnalysisGetHoverParams.fromRequest(Request request) {
-    return new AnalysisGetHoverParams.fromJson(
-        new RequestDecoder(request), "params", request._params);
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["file"] = file;
-    result["offset"] = offset;
-    return result;
-  }
-
-  Request toRequest(String id) {
-    return new Request(id, "analysis.getHover", toJson());
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is AnalysisGetHoverParams) {
-      return file == other.file &&
-          offset == other.offset;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, file.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, offset.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * analysis.getHover result
- *
- * {
- *   "hovers": List<HoverInformation>
- * }
- */
-class AnalysisGetHoverResult implements HasToJson {
-  List<HoverInformation> _hovers;
-
-  /**
-   * The hover information associated with the location. The list will be empty
-   * if no information could be determined for the location. The list can
-   * contain multiple items if the file is being analyzed in multiple contexts
-   * in conflicting ways (such as a part that is included in multiple
-   * libraries).
-   */
-  List<HoverInformation> get hovers => _hovers;
-
-  /**
-   * The hover information associated with the location. The list will be empty
-   * if no information could be determined for the location. The list can
-   * contain multiple items if the file is being analyzed in multiple contexts
-   * in conflicting ways (such as a part that is included in multiple
-   * libraries).
-   */
-  void set hovers(List<HoverInformation> value) {
-    assert(value != null);
-    this._hovers = value;
-  }
-
-  AnalysisGetHoverResult(List<HoverInformation> hovers) {
-    this.hovers = hovers;
-  }
-
-  factory AnalysisGetHoverResult.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      List<HoverInformation> hovers;
-      if (json.containsKey("hovers")) {
-        hovers = jsonDecoder._decodeList(jsonPath + ".hovers", json["hovers"], (String jsonPath, Object json) => new HoverInformation.fromJson(jsonDecoder, jsonPath, json));
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "hovers");
-      }
-      return new AnalysisGetHoverResult(hovers);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "analysis.getHover result", json);
-    }
-  }
-
-  factory AnalysisGetHoverResult.fromResponse(Response response) {
-    return new AnalysisGetHoverResult.fromJson(
-        new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), "result", response._result);
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["hovers"] = hovers.map((HoverInformation value) => value.toJson()).toList();
-    return result;
-  }
-
-  Response toResponse(String id) {
-    return new Response(id, result: toJson());
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is AnalysisGetHoverResult) {
-      return _listEqual(hovers, other.hovers, (HoverInformation a, HoverInformation b) => a == b);
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, hovers.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-/**
- * analysis.getLibraryDependencies params
- */
-class AnalysisGetLibraryDependenciesParams {
-  Request toRequest(String id) {
-    return new Request(id, "analysis.getLibraryDependencies", null);
-  }
-
-  @override
-  bool operator==(other) {
-    if (other is AnalysisGetLibraryDependenciesParams) {
-      return true;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    return 246577680;
-  }
-}
-
-/**
- * analysis.getLibraryDependencies result
- *
- * {
- *   "libraries": List<FilePath>
- *   "packageMap": Map<String, Map<String, List<FilePath>>>
- * }
- */
-class AnalysisGetLibraryDependenciesResult implements HasToJson {
-  List<String> _libraries;
-
-  Map<String, Map<String, List<String>>> _packageMap;
-
-  /**
-   * A list of the paths of library elements referenced by files in existing
-   * analysis roots.
-   */
-  List<String> get libraries => _libraries;
-
-  /**
-   * A list of the paths of library elements referenced by files in existing
-   * analysis roots.
-   */
-  void set libraries(List<String> value) {
-    assert(value != null);
-    this._libraries = value;
-  }
-
-  /**
-   * A mapping from context source roots to package maps which map package
-   * names to source directories for use in client-side package URI resolution.
-   */
-  Map<String, Map<String, List<String>>> get packageMap => _packageMap;
-
-  /**
-   * A mapping from context source roots to package maps which map package
-   * names to source directories for use in client-side package URI resolution.
-   */
-  void set packageMap(Map<String, Map<String, List<String>>> value) {
-    assert(value != null);
-    this._packageMap = value;
-  }
-
-  AnalysisGetLibraryDependenciesResult(List<String> libraries, Map<String, Map<String, List<String>>> packageMap) {
-    this.libraries = libraries;
-    this.packageMap = packageMap;
-  }
-
-  factory AnalysisGetLibraryDependenciesResult.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      List<String> libraries;
-      if (json.containsKey("libraries")) {
-        libraries = jsonDecoder._decodeList(jsonPath + ".libraries", json["libraries"], jsonDecoder._decodeString);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "libraries");
-      }
-      Map<String, Map<String, List<String>>> packageMap;
-      if (json.containsKey("packageMap")) {
-        packageMap = jsonDecoder._decodeMap(jsonPath + ".packageMap", json["packageMap"], valueDecoder: (String jsonPath, Object json) => jsonDecoder._decodeMap(jsonPath, json, valueDecoder: (String jsonPath, Object json) => jsonDecoder._decodeList(jsonPath, json, jsonDecoder._decodeString)));
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "packageMap");
-      }
-      return new AnalysisGetLibraryDependenciesResult(libraries, packageMap);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "analysis.getLibraryDependencies result", json);
-    }
-  }
-
-  factory AnalysisGetLibraryDependenciesResult.fromResponse(Response response) {
-    return new AnalysisGetLibraryDependenciesResult.fromJson(
-        new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), "result", response._result);
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["libraries"] = libraries;
-    result["packageMap"] = packageMap;
-    return result;
-  }
-
-  Response toResponse(String id) {
-    return new Response(id, result: toJson());
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is AnalysisGetLibraryDependenciesResult) {
-      return _listEqual(libraries, other.libraries, (String a, String b) => a == b) &&
-          _mapEqual(packageMap, other.packageMap, (Map<String, List<String>> a, Map<String, List<String>> b) => _mapEqual(a, b, (List<String> a, List<String> b) => _listEqual(a, b, (String a, String b) => a == b)));
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, libraries.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, packageMap.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * analysis.getNavigation params
- *
- * {
- *   "file": FilePath
- *   "offset": int
- *   "length": int
- * }
- */
-class AnalysisGetNavigationParams implements HasToJson {
-  String _file;
-
-  int _offset;
-
-  int _length;
-
-  /**
-   * The file in which navigation information is being requested.
-   */
-  String get file => _file;
-
-  /**
-   * The file in which navigation information is being requested.
-   */
-  void set file(String value) {
-    assert(value != null);
-    this._file = value;
-  }
-
-  /**
-   * The offset of the region for which navigation information is being
-   * requested.
-   */
-  int get offset => _offset;
-
-  /**
-   * The offset of the region for which navigation information is being
-   * requested.
-   */
-  void set offset(int value) {
-    assert(value != null);
-    this._offset = value;
-  }
-
-  /**
-   * The length of the region for which navigation information is being
-   * requested.
-   */
-  int get length => _length;
-
-  /**
-   * The length of the region for which navigation information is being
-   * requested.
-   */
-  void set length(int value) {
-    assert(value != null);
-    this._length = value;
-  }
-
-  AnalysisGetNavigationParams(String file, int offset, int length) {
-    this.file = file;
-    this.offset = offset;
-    this.length = length;
-  }
-
-  factory AnalysisGetNavigationParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      String file;
-      if (json.containsKey("file")) {
-        file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "file");
-      }
-      int offset;
-      if (json.containsKey("offset")) {
-        offset = jsonDecoder._decodeInt(jsonPath + ".offset", json["offset"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "offset");
-      }
-      int length;
-      if (json.containsKey("length")) {
-        length = jsonDecoder._decodeInt(jsonPath + ".length", json["length"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "length");
-      }
-      return new AnalysisGetNavigationParams(file, offset, length);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "analysis.getNavigation params", json);
-    }
-  }
-
-  factory AnalysisGetNavigationParams.fromRequest(Request request) {
-    return new AnalysisGetNavigationParams.fromJson(
-        new RequestDecoder(request), "params", request._params);
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["file"] = file;
-    result["offset"] = offset;
-    result["length"] = length;
-    return result;
-  }
-
-  Request toRequest(String id) {
-    return new Request(id, "analysis.getNavigation", toJson());
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is AnalysisGetNavigationParams) {
-      return file == other.file &&
-          offset == other.offset &&
-          length == other.length;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, file.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, offset.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, length.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * analysis.getNavigation result
- *
- * {
- *   "files": List<FilePath>
- *   "targets": List<NavigationTarget>
- *   "regions": List<NavigationRegion>
- * }
- */
-class AnalysisGetNavigationResult implements HasToJson {
-  List<String> _files;
-
-  List<NavigationTarget> _targets;
-
-  List<NavigationRegion> _regions;
-
-  /**
-   * A list of the paths of files that are referenced by the navigation
-   * targets.
-   */
-  List<String> get files => _files;
-
-  /**
-   * A list of the paths of files that are referenced by the navigation
-   * targets.
-   */
-  void set files(List<String> value) {
-    assert(value != null);
-    this._files = value;
-  }
-
-  /**
-   * A list of the navigation targets that are referenced by the navigation
-   * regions.
-   */
-  List<NavigationTarget> get targets => _targets;
-
-  /**
-   * A list of the navigation targets that are referenced by the navigation
-   * regions.
-   */
-  void set targets(List<NavigationTarget> value) {
-    assert(value != null);
-    this._targets = value;
-  }
-
-  /**
-   * A list of the navigation regions within the requested region of the file.
-   */
-  List<NavigationRegion> get regions => _regions;
-
-  /**
-   * A list of the navigation regions within the requested region of the file.
-   */
-  void set regions(List<NavigationRegion> value) {
-    assert(value != null);
-    this._regions = value;
-  }
-
-  AnalysisGetNavigationResult(List<String> files, List<NavigationTarget> targets, List<NavigationRegion> regions) {
-    this.files = files;
-    this.targets = targets;
-    this.regions = regions;
-  }
-
-  factory AnalysisGetNavigationResult.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      List<String> files;
-      if (json.containsKey("files")) {
-        files = jsonDecoder._decodeList(jsonPath + ".files", json["files"], jsonDecoder._decodeString);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "files");
-      }
-      List<NavigationTarget> targets;
-      if (json.containsKey("targets")) {
-        targets = jsonDecoder._decodeList(jsonPath + ".targets", json["targets"], (String jsonPath, Object json) => new NavigationTarget.fromJson(jsonDecoder, jsonPath, json));
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "targets");
-      }
-      List<NavigationRegion> regions;
-      if (json.containsKey("regions")) {
-        regions = jsonDecoder._decodeList(jsonPath + ".regions", json["regions"], (String jsonPath, Object json) => new NavigationRegion.fromJson(jsonDecoder, jsonPath, json));
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "regions");
-      }
-      return new AnalysisGetNavigationResult(files, targets, regions);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "analysis.getNavigation result", json);
-    }
-  }
-
-  factory AnalysisGetNavigationResult.fromResponse(Response response) {
-    return new AnalysisGetNavigationResult.fromJson(
-        new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), "result", response._result);
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["files"] = files;
-    result["targets"] = targets.map((NavigationTarget value) => value.toJson()).toList();
-    result["regions"] = regions.map((NavigationRegion value) => value.toJson()).toList();
-    return result;
-  }
-
-  Response toResponse(String id) {
-    return new Response(id, result: toJson());
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is AnalysisGetNavigationResult) {
-      return _listEqual(files, other.files, (String a, String b) => a == b) &&
-          _listEqual(targets, other.targets, (NavigationTarget a, NavigationTarget b) => a == b) &&
-          _listEqual(regions, other.regions, (NavigationRegion a, NavigationRegion b) => a == b);
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, files.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, targets.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, regions.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * analysis.reanalyze params
- *
- * {
- *   "roots": optional List<FilePath>
- * }
- */
-class AnalysisReanalyzeParams implements HasToJson {
-  List<String> _roots;
-
-  /**
-   * A list of the analysis roots that are to be re-analyzed.
-   */
-  List<String> get roots => _roots;
-
-  /**
-   * A list of the analysis roots that are to be re-analyzed.
-   */
-  void set roots(List<String> value) {
-    this._roots = value;
-  }
-
-  AnalysisReanalyzeParams({List<String> roots}) {
-    this.roots = roots;
-  }
-
-  factory AnalysisReanalyzeParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      List<String> roots;
-      if (json.containsKey("roots")) {
-        roots = jsonDecoder._decodeList(jsonPath + ".roots", json["roots"], jsonDecoder._decodeString);
-      }
-      return new AnalysisReanalyzeParams(roots: roots);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "analysis.reanalyze params", json);
-    }
-  }
-
-  factory AnalysisReanalyzeParams.fromRequest(Request request) {
-    return new AnalysisReanalyzeParams.fromJson(
-        new RequestDecoder(request), "params", request._params);
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    if (roots != null) {
-      result["roots"] = roots;
-    }
-    return result;
-  }
-
-  Request toRequest(String id) {
-    return new Request(id, "analysis.reanalyze", toJson());
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is AnalysisReanalyzeParams) {
-      return _listEqual(roots, other.roots, (String a, String b) => a == b);
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, roots.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-/**
- * analysis.reanalyze result
- */
-class AnalysisReanalyzeResult {
-  Response toResponse(String id) {
-    return new Response(id, result: null);
-  }
-
-  @override
-  bool operator==(other) {
-    if (other is AnalysisReanalyzeResult) {
-      return true;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    return 846803925;
-  }
-}
-
-/**
- * analysis.setAnalysisRoots params
- *
- * {
- *   "included": List<FilePath>
- *   "excluded": List<FilePath>
- *   "packageRoots": optional Map<FilePath, FilePath>
- * }
- */
-class AnalysisSetAnalysisRootsParams implements HasToJson {
-  List<String> _included;
-
-  List<String> _excluded;
-
-  Map<String, String> _packageRoots;
-
-  /**
-   * A list of the files and directories that should be analyzed.
-   */
-  List<String> get included => _included;
-
-  /**
-   * A list of the files and directories that should be analyzed.
-   */
-  void set included(List<String> value) {
-    assert(value != null);
-    this._included = value;
-  }
-
-  /**
-   * A list of the files and directories within the included directories that
-   * should not be analyzed.
-   */
-  List<String> get excluded => _excluded;
-
-  /**
-   * A list of the files and directories within the included directories that
-   * should not be analyzed.
-   */
-  void set excluded(List<String> value) {
-    assert(value != null);
-    this._excluded = value;
-  }
-
-  /**
-   * A mapping from source directories to target directories that should
-   * override the normal package: URI resolution mechanism. The analyzer will
-   * behave as though each source directory in the map contains a special
-   * pubspec.yaml file which resolves any package: URI to the corresponding
-   * path within the target directory. The effect is the same as specifying the
-   * target directory as a "--package_root" parameter to the Dart VM when
-   * executing any Dart file inside the source directory.
-   *
-   * Files in any directories that are not overridden by this mapping have
-   * their package: URI's resolved using the normal pubspec.yaml mechanism. If
-   * this field is absent, or the empty map is specified, that indicates that
-   * the normal pubspec.yaml mechanism should always be used.
-   */
-  Map<String, String> get packageRoots => _packageRoots;
-
-  /**
-   * A mapping from source directories to target directories that should
-   * override the normal package: URI resolution mechanism. The analyzer will
-   * behave as though each source directory in the map contains a special
-   * pubspec.yaml file which resolves any package: URI to the corresponding
-   * path within the target directory. The effect is the same as specifying the
-   * target directory as a "--package_root" parameter to the Dart VM when
-   * executing any Dart file inside the source directory.
-   *
-   * Files in any directories that are not overridden by this mapping have
-   * their package: URI's resolved using the normal pubspec.yaml mechanism. If
-   * this field is absent, or the empty map is specified, that indicates that
-   * the normal pubspec.yaml mechanism should always be used.
-   */
-  void set packageRoots(Map<String, String> value) {
-    this._packageRoots = value;
-  }
-
-  AnalysisSetAnalysisRootsParams(List<String> included, List<String> excluded, {Map<String, String> packageRoots}) {
-    this.included = included;
-    this.excluded = excluded;
-    this.packageRoots = packageRoots;
-  }
-
-  factory AnalysisSetAnalysisRootsParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      List<String> included;
-      if (json.containsKey("included")) {
-        included = jsonDecoder._decodeList(jsonPath + ".included", json["included"], jsonDecoder._decodeString);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "included");
-      }
-      List<String> excluded;
-      if (json.containsKey("excluded")) {
-        excluded = jsonDecoder._decodeList(jsonPath + ".excluded", json["excluded"], jsonDecoder._decodeString);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "excluded");
-      }
-      Map<String, String> packageRoots;
-      if (json.containsKey("packageRoots")) {
-        packageRoots = jsonDecoder._decodeMap(jsonPath + ".packageRoots", json["packageRoots"], valueDecoder: jsonDecoder._decodeString);
-      }
-      return new AnalysisSetAnalysisRootsParams(included, excluded, packageRoots: packageRoots);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "analysis.setAnalysisRoots params", json);
-    }
-  }
-
-  factory AnalysisSetAnalysisRootsParams.fromRequest(Request request) {
-    return new AnalysisSetAnalysisRootsParams.fromJson(
-        new RequestDecoder(request), "params", request._params);
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["included"] = included;
-    result["excluded"] = excluded;
-    if (packageRoots != null) {
-      result["packageRoots"] = packageRoots;
-    }
-    return result;
-  }
-
-  Request toRequest(String id) {
-    return new Request(id, "analysis.setAnalysisRoots", toJson());
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is AnalysisSetAnalysisRootsParams) {
-      return _listEqual(included, other.included, (String a, String b) => a == b) &&
-          _listEqual(excluded, other.excluded, (String a, String b) => a == b) &&
-          _mapEqual(packageRoots, other.packageRoots, (String a, String b) => a == b);
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, included.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, excluded.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, packageRoots.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-/**
- * analysis.setAnalysisRoots result
- */
-class AnalysisSetAnalysisRootsResult {
-  Response toResponse(String id) {
-    return new Response(id, result: null);
-  }
-
-  @override
-  bool operator==(other) {
-    if (other is AnalysisSetAnalysisRootsResult) {
-      return true;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    return 866004753;
-  }
-}
-
-/**
- * analysis.setGeneralSubscriptions params
- *
- * {
- *   "subscriptions": List<GeneralAnalysisService>
- * }
- */
-class AnalysisSetGeneralSubscriptionsParams implements HasToJson {
-  List<GeneralAnalysisService> _subscriptions;
-
-  /**
-   * A list of the services being subscribed to.
-   */
-  List<GeneralAnalysisService> get subscriptions => _subscriptions;
-
-  /**
-   * A list of the services being subscribed to.
-   */
-  void set subscriptions(List<GeneralAnalysisService> value) {
-    assert(value != null);
-    this._subscriptions = value;
-  }
-
-  AnalysisSetGeneralSubscriptionsParams(List<GeneralAnalysisService> subscriptions) {
-    this.subscriptions = subscriptions;
-  }
-
-  factory AnalysisSetGeneralSubscriptionsParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      List<GeneralAnalysisService> subscriptions;
-      if (json.containsKey("subscriptions")) {
-        subscriptions = jsonDecoder._decodeList(jsonPath + ".subscriptions", json["subscriptions"], (String jsonPath, Object json) => new GeneralAnalysisService.fromJson(jsonDecoder, jsonPath, json));
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "subscriptions");
-      }
-      return new AnalysisSetGeneralSubscriptionsParams(subscriptions);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "analysis.setGeneralSubscriptions params", json);
-    }
-  }
-
-  factory AnalysisSetGeneralSubscriptionsParams.fromRequest(Request request) {
-    return new AnalysisSetGeneralSubscriptionsParams.fromJson(
-        new RequestDecoder(request), "params", request._params);
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["subscriptions"] = subscriptions.map((GeneralAnalysisService value) => value.toJson()).toList();
-    return result;
-  }
-
-  Request toRequest(String id) {
-    return new Request(id, "analysis.setGeneralSubscriptions", toJson());
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is AnalysisSetGeneralSubscriptionsParams) {
-      return _listEqual(subscriptions, other.subscriptions, (GeneralAnalysisService a, GeneralAnalysisService b) => a == b);
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, subscriptions.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-/**
- * analysis.setGeneralSubscriptions result
- */
-class AnalysisSetGeneralSubscriptionsResult {
-  Response toResponse(String id) {
-    return new Response(id, result: null);
-  }
-
-  @override
-  bool operator==(other) {
-    if (other is AnalysisSetGeneralSubscriptionsResult) {
-      return true;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    return 386759562;
-  }
-}
-
-/**
- * analysis.setPriorityFiles params
- *
- * {
- *   "files": List<FilePath>
- * }
- */
-class AnalysisSetPriorityFilesParams implements HasToJson {
-  List<String> _files;
-
-  /**
-   * The files that are to be a priority for analysis.
-   */
-  List<String> get files => _files;
-
-  /**
-   * The files that are to be a priority for analysis.
-   */
-  void set files(List<String> value) {
-    assert(value != null);
-    this._files = value;
-  }
-
-  AnalysisSetPriorityFilesParams(List<String> files) {
-    this.files = files;
-  }
-
-  factory AnalysisSetPriorityFilesParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      List<String> files;
-      if (json.containsKey("files")) {
-        files = jsonDecoder._decodeList(jsonPath + ".files", json["files"], jsonDecoder._decodeString);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "files");
-      }
-      return new AnalysisSetPriorityFilesParams(files);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "analysis.setPriorityFiles params", json);
-    }
-  }
-
-  factory AnalysisSetPriorityFilesParams.fromRequest(Request request) {
-    return new AnalysisSetPriorityFilesParams.fromJson(
-        new RequestDecoder(request), "params", request._params);
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["files"] = files;
-    return result;
-  }
-
-  Request toRequest(String id) {
-    return new Request(id, "analysis.setPriorityFiles", toJson());
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is AnalysisSetPriorityFilesParams) {
-      return _listEqual(files, other.files, (String a, String b) => a == b);
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, files.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-/**
- * analysis.setPriorityFiles result
- */
-class AnalysisSetPriorityFilesResult {
-  Response toResponse(String id) {
-    return new Response(id, result: null);
-  }
-
-  @override
-  bool operator==(other) {
-    if (other is AnalysisSetPriorityFilesResult) {
-      return true;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    return 330050055;
-  }
-}
-
-/**
- * analysis.setSubscriptions params
- *
- * {
- *   "subscriptions": Map<AnalysisService, List<FilePath>>
- * }
- */
-class AnalysisSetSubscriptionsParams implements HasToJson {
-  Map<AnalysisService, List<String>> _subscriptions;
-
-  /**
-   * A table mapping services to a list of the files being subscribed to the
-   * service.
-   */
-  Map<AnalysisService, List<String>> get subscriptions => _subscriptions;
-
-  /**
-   * A table mapping services to a list of the files being subscribed to the
-   * service.
-   */
-  void set subscriptions(Map<AnalysisService, List<String>> value) {
-    assert(value != null);
-    this._subscriptions = value;
-  }
-
-  AnalysisSetSubscriptionsParams(Map<AnalysisService, List<String>> subscriptions) {
-    this.subscriptions = subscriptions;
-  }
-
-  factory AnalysisSetSubscriptionsParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      Map<AnalysisService, List<String>> subscriptions;
-      if (json.containsKey("subscriptions")) {
-        subscriptions = jsonDecoder._decodeMap(jsonPath + ".subscriptions", json["subscriptions"], keyDecoder: (String jsonPath, Object json) => new AnalysisService.fromJson(jsonDecoder, jsonPath, json), valueDecoder: (String jsonPath, Object json) => jsonDecoder._decodeList(jsonPath, json, jsonDecoder._decodeString));
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "subscriptions");
-      }
-      return new AnalysisSetSubscriptionsParams(subscriptions);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "analysis.setSubscriptions params", json);
-    }
-  }
-
-  factory AnalysisSetSubscriptionsParams.fromRequest(Request request) {
-    return new AnalysisSetSubscriptionsParams.fromJson(
-        new RequestDecoder(request), "params", request._params);
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["subscriptions"] = mapMap(subscriptions, keyCallback: (AnalysisService value) => value.toJson());
-    return result;
-  }
-
-  Request toRequest(String id) {
-    return new Request(id, "analysis.setSubscriptions", toJson());
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is AnalysisSetSubscriptionsParams) {
-      return _mapEqual(subscriptions, other.subscriptions, (List<String> a, List<String> b) => _listEqual(a, b, (String a, String b) => a == b));
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, subscriptions.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-/**
- * analysis.setSubscriptions result
- */
-class AnalysisSetSubscriptionsResult {
-  Response toResponse(String id) {
-    return new Response(id, result: null);
-  }
-
-  @override
-  bool operator==(other) {
-    if (other is AnalysisSetSubscriptionsResult) {
-      return true;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    return 218088493;
-  }
-}
-
-/**
- * analysis.updateContent params
- *
- * {
- *   "files": Map<FilePath, AddContentOverlay | ChangeContentOverlay | RemoveContentOverlay>
- * }
- */
-class AnalysisUpdateContentParams implements HasToJson {
-  Map<String, dynamic> _files;
-
-  /**
-   * A table mapping the files whose content has changed to a description of
-   * the content change.
-   */
-  Map<String, dynamic> get files => _files;
-
-  /**
-   * A table mapping the files whose content has changed to a description of
-   * the content change.
-   */
-  void set files(Map<String, dynamic> value) {
-    assert(value != null);
-    this._files = value;
-  }
-
-  AnalysisUpdateContentParams(Map<String, dynamic> files) {
-    this.files = files;
-  }
-
-  factory AnalysisUpdateContentParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      Map<String, dynamic> files;
-      if (json.containsKey("files")) {
-        files = jsonDecoder._decodeMap(jsonPath + ".files", json["files"], valueDecoder: (String jsonPath, Object json) => jsonDecoder._decodeUnion(jsonPath, json, "type", {"add": (String jsonPath, Object json) => new AddContentOverlay.fromJson(jsonDecoder, jsonPath, json), "change": (String jsonPath, Object json) => new ChangeContentOverlay.fromJson(jsonDecoder, jsonPath, json), "remove": (String jsonPath, Object json) => new RemoveContentOverlay.fromJson(jsonDecoder, jsonPath, json)}));
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "files");
-      }
-      return new AnalysisUpdateContentParams(files);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "analysis.updateContent params", json);
-    }
-  }
-
-  factory AnalysisUpdateContentParams.fromRequest(Request request) {
-    return new AnalysisUpdateContentParams.fromJson(
-        new RequestDecoder(request), "params", request._params);
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["files"] = mapMap(files, valueCallback: (dynamic value) => value.toJson());
-    return result;
-  }
-
-  Request toRequest(String id) {
-    return new Request(id, "analysis.updateContent", toJson());
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is AnalysisUpdateContentParams) {
-      return _mapEqual(files, other.files, (dynamic a, dynamic b) => a == b);
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, files.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * analysis.updateContent result
- *
- * {
- * }
- */
-class AnalysisUpdateContentResult implements HasToJson {
-  AnalysisUpdateContentResult();
-
-  factory AnalysisUpdateContentResult.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      return new AnalysisUpdateContentResult();
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "analysis.updateContent result", json);
-    }
-  }
-
-  factory AnalysisUpdateContentResult.fromResponse(Response response) {
-    return new AnalysisUpdateContentResult.fromJson(
-        new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), "result", response._result);
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    return result;
-  }
-
-  Response toResponse(String id) {
-    return new Response(id, result: toJson());
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is AnalysisUpdateContentResult) {
-      return true;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * analysis.updateOptions params
- *
- * {
- *   "options": AnalysisOptions
- * }
- */
-class AnalysisUpdateOptionsParams implements HasToJson {
-  AnalysisOptions _options;
-
-  /**
-   * The options that are to be used to control analysis.
-   */
-  AnalysisOptions get options => _options;
-
-  /**
-   * The options that are to be used to control analysis.
-   */
-  void set options(AnalysisOptions value) {
-    assert(value != null);
-    this._options = value;
-  }
-
-  AnalysisUpdateOptionsParams(AnalysisOptions options) {
-    this.options = options;
-  }
-
-  factory AnalysisUpdateOptionsParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      AnalysisOptions options;
-      if (json.containsKey("options")) {
-        options = new AnalysisOptions.fromJson(jsonDecoder, jsonPath + ".options", json["options"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "options");
-      }
-      return new AnalysisUpdateOptionsParams(options);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "analysis.updateOptions params", json);
-    }
-  }
-
-  factory AnalysisUpdateOptionsParams.fromRequest(Request request) {
-    return new AnalysisUpdateOptionsParams.fromJson(
-        new RequestDecoder(request), "params", request._params);
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["options"] = options.toJson();
-    return result;
-  }
-
-  Request toRequest(String id) {
-    return new Request(id, "analysis.updateOptions", toJson());
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is AnalysisUpdateOptionsParams) {
-      return options == other.options;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, options.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-/**
- * analysis.updateOptions result
- */
-class AnalysisUpdateOptionsResult {
-  Response toResponse(String id) {
-    return new Response(id, result: null);
-  }
-
-  @override
-  bool operator==(other) {
-    if (other is AnalysisUpdateOptionsResult) {
-      return true;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    return 179689467;
-  }
-}
-
-/**
- * analysis.analyzedFiles params
- *
- * {
- *   "directories": List<FilePath>
- * }
- */
-class AnalysisAnalyzedFilesParams implements HasToJson {
-  List<String> _directories;
-
-  /**
-   * A list of the paths of the files that are being analyzed.
-   */
-  List<String> get directories => _directories;
-
-  /**
-   * A list of the paths of the files that are being analyzed.
-   */
-  void set directories(List<String> value) {
-    assert(value != null);
-    this._directories = value;
-  }
-
-  AnalysisAnalyzedFilesParams(List<String> directories) {
-    this.directories = directories;
-  }
-
-  factory AnalysisAnalyzedFilesParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      List<String> directories;
-      if (json.containsKey("directories")) {
-        directories = jsonDecoder._decodeList(jsonPath + ".directories", json["directories"], jsonDecoder._decodeString);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "directories");
-      }
-      return new AnalysisAnalyzedFilesParams(directories);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "analysis.analyzedFiles params", json);
-    }
-  }
-
-  factory AnalysisAnalyzedFilesParams.fromNotification(Notification notification) {
-    return new AnalysisAnalyzedFilesParams.fromJson(
-        new ResponseDecoder(null), "params", notification._params);
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["directories"] = directories;
-    return result;
-  }
-
-  Notification toNotification() {
-    return new Notification("analysis.analyzedFiles", toJson());
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is AnalysisAnalyzedFilesParams) {
-      return _listEqual(directories, other.directories, (String a, String b) => a == b);
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, directories.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * analysis.errors params
- *
- * {
- *   "file": FilePath
- *   "errors": List<AnalysisError>
- * }
- */
-class AnalysisErrorsParams implements HasToJson {
-  String _file;
-
-  List<AnalysisError> _errors;
-
-  /**
-   * The file containing the errors.
-   */
-  String get file => _file;
-
-  /**
-   * The file containing the errors.
-   */
-  void set file(String value) {
-    assert(value != null);
-    this._file = value;
-  }
-
-  /**
-   * The errors contained in the file.
-   */
-  List<AnalysisError> get errors => _errors;
-
-  /**
-   * The errors contained in the file.
-   */
-  void set errors(List<AnalysisError> value) {
-    assert(value != null);
-    this._errors = value;
-  }
-
-  AnalysisErrorsParams(String file, List<AnalysisError> errors) {
-    this.file = file;
-    this.errors = errors;
-  }
-
-  factory AnalysisErrorsParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      String file;
-      if (json.containsKey("file")) {
-        file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "file");
-      }
-      List<AnalysisError> errors;
-      if (json.containsKey("errors")) {
-        errors = jsonDecoder._decodeList(jsonPath + ".errors", json["errors"], (String jsonPath, Object json) => new AnalysisError.fromJson(jsonDecoder, jsonPath, json));
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "errors");
-      }
-      return new AnalysisErrorsParams(file, errors);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "analysis.errors params", json);
-    }
-  }
-
-  factory AnalysisErrorsParams.fromNotification(Notification notification) {
-    return new AnalysisErrorsParams.fromJson(
-        new ResponseDecoder(null), "params", notification._params);
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["file"] = file;
-    result["errors"] = errors.map((AnalysisError value) => value.toJson()).toList();
-    return result;
-  }
-
-  Notification toNotification() {
-    return new Notification("analysis.errors", toJson());
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is AnalysisErrorsParams) {
-      return file == other.file &&
-          _listEqual(errors, other.errors, (AnalysisError a, AnalysisError b) => a == b);
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, file.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, errors.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * analysis.flushResults params
- *
- * {
- *   "files": List<FilePath>
- * }
- */
-class AnalysisFlushResultsParams implements HasToJson {
-  List<String> _files;
-
-  /**
-   * The files that are no longer being analyzed.
-   */
-  List<String> get files => _files;
-
-  /**
-   * The files that are no longer being analyzed.
-   */
-  void set files(List<String> value) {
-    assert(value != null);
-    this._files = value;
-  }
-
-  AnalysisFlushResultsParams(List<String> files) {
-    this.files = files;
-  }
-
-  factory AnalysisFlushResultsParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      List<String> files;
-      if (json.containsKey("files")) {
-        files = jsonDecoder._decodeList(jsonPath + ".files", json["files"], jsonDecoder._decodeString);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "files");
-      }
-      return new AnalysisFlushResultsParams(files);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "analysis.flushResults params", json);
-    }
-  }
-
-  factory AnalysisFlushResultsParams.fromNotification(Notification notification) {
-    return new AnalysisFlushResultsParams.fromJson(
-        new ResponseDecoder(null), "params", notification._params);
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["files"] = files;
-    return result;
-  }
-
-  Notification toNotification() {
-    return new Notification("analysis.flushResults", toJson());
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is AnalysisFlushResultsParams) {
-      return _listEqual(files, other.files, (String a, String b) => a == b);
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, files.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * analysis.folding params
- *
- * {
- *   "file": FilePath
- *   "regions": List<FoldingRegion>
- * }
- */
-class AnalysisFoldingParams implements HasToJson {
-  String _file;
-
-  List<FoldingRegion> _regions;
-
-  /**
-   * The file containing the folding regions.
-   */
-  String get file => _file;
-
-  /**
-   * The file containing the folding regions.
-   */
-  void set file(String value) {
-    assert(value != null);
-    this._file = value;
-  }
-
-  /**
-   * The folding regions contained in the file.
-   */
-  List<FoldingRegion> get regions => _regions;
-
-  /**
-   * The folding regions contained in the file.
-   */
-  void set regions(List<FoldingRegion> value) {
-    assert(value != null);
-    this._regions = value;
-  }
-
-  AnalysisFoldingParams(String file, List<FoldingRegion> regions) {
-    this.file = file;
-    this.regions = regions;
-  }
-
-  factory AnalysisFoldingParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      String file;
-      if (json.containsKey("file")) {
-        file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "file");
-      }
-      List<FoldingRegion> regions;
-      if (json.containsKey("regions")) {
-        regions = jsonDecoder._decodeList(jsonPath + ".regions", json["regions"], (String jsonPath, Object json) => new FoldingRegion.fromJson(jsonDecoder, jsonPath, json));
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "regions");
-      }
-      return new AnalysisFoldingParams(file, regions);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "analysis.folding params", json);
-    }
-  }
-
-  factory AnalysisFoldingParams.fromNotification(Notification notification) {
-    return new AnalysisFoldingParams.fromJson(
-        new ResponseDecoder(null), "params", notification._params);
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["file"] = file;
-    result["regions"] = regions.map((FoldingRegion value) => value.toJson()).toList();
-    return result;
-  }
-
-  Notification toNotification() {
-    return new Notification("analysis.folding", toJson());
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is AnalysisFoldingParams) {
-      return file == other.file &&
-          _listEqual(regions, other.regions, (FoldingRegion a, FoldingRegion b) => a == b);
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, file.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, regions.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * analysis.highlights params
- *
- * {
- *   "file": FilePath
- *   "regions": List<HighlightRegion>
- * }
- */
-class AnalysisHighlightsParams implements HasToJson {
-  String _file;
-
-  List<HighlightRegion> _regions;
-
-  /**
-   * The file containing the highlight regions.
-   */
-  String get file => _file;
-
-  /**
-   * The file containing the highlight regions.
-   */
-  void set file(String value) {
-    assert(value != null);
-    this._file = value;
-  }
-
-  /**
-   * The highlight regions contained in the file. Each highlight region
-   * represents a particular syntactic or semantic meaning associated with some
-   * range. Note that the highlight regions that are returned can overlap other
-   * highlight regions if there is more than one meaning associated with a
-   * particular region.
-   */
-  List<HighlightRegion> get regions => _regions;
-
-  /**
-   * The highlight regions contained in the file. Each highlight region
-   * represents a particular syntactic or semantic meaning associated with some
-   * range. Note that the highlight regions that are returned can overlap other
-   * highlight regions if there is more than one meaning associated with a
-   * particular region.
-   */
-  void set regions(List<HighlightRegion> value) {
-    assert(value != null);
-    this._regions = value;
-  }
-
-  AnalysisHighlightsParams(String file, List<HighlightRegion> regions) {
-    this.file = file;
-    this.regions = regions;
-  }
-
-  factory AnalysisHighlightsParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      String file;
-      if (json.containsKey("file")) {
-        file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "file");
-      }
-      List<HighlightRegion> regions;
-      if (json.containsKey("regions")) {
-        regions = jsonDecoder._decodeList(jsonPath + ".regions", json["regions"], (String jsonPath, Object json) => new HighlightRegion.fromJson(jsonDecoder, jsonPath, json));
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "regions");
-      }
-      return new AnalysisHighlightsParams(file, regions);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "analysis.highlights params", json);
-    }
-  }
-
-  factory AnalysisHighlightsParams.fromNotification(Notification notification) {
-    return new AnalysisHighlightsParams.fromJson(
-        new ResponseDecoder(null), "params", notification._params);
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["file"] = file;
-    result["regions"] = regions.map((HighlightRegion value) => value.toJson()).toList();
-    return result;
-  }
-
-  Notification toNotification() {
-    return new Notification("analysis.highlights", toJson());
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is AnalysisHighlightsParams) {
-      return file == other.file &&
-          _listEqual(regions, other.regions, (HighlightRegion a, HighlightRegion b) => a == b);
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, file.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, regions.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * analysis.invalidate params
- *
- * {
- *   "file": FilePath
- *   "offset": int
- *   "length": int
- *   "delta": int
- * }
- */
-class AnalysisInvalidateParams implements HasToJson {
-  String _file;
-
-  int _offset;
-
-  int _length;
-
-  int _delta;
-
-  /**
-   * The file whose information has been invalidated.
-   */
-  String get file => _file;
-
-  /**
-   * The file whose information has been invalidated.
-   */
-  void set file(String value) {
-    assert(value != null);
-    this._file = value;
-  }
-
-  /**
-   * The offset of the invalidated region.
-   */
-  int get offset => _offset;
-
-  /**
-   * The offset of the invalidated region.
-   */
-  void set offset(int value) {
-    assert(value != null);
-    this._offset = value;
-  }
-
-  /**
-   * The length of the invalidated region.
-   */
-  int get length => _length;
-
-  /**
-   * The length of the invalidated region.
-   */
-  void set length(int value) {
-    assert(value != null);
-    this._length = value;
-  }
-
-  /**
-   * The delta to be applied to the offsets in information that follows the
-   * invalidated region in order to update it so that it doesn't need to be
-   * re-requested.
-   */
-  int get delta => _delta;
-
-  /**
-   * The delta to be applied to the offsets in information that follows the
-   * invalidated region in order to update it so that it doesn't need to be
-   * re-requested.
-   */
-  void set delta(int value) {
-    assert(value != null);
-    this._delta = value;
-  }
-
-  AnalysisInvalidateParams(String file, int offset, int length, int delta) {
-    this.file = file;
-    this.offset = offset;
-    this.length = length;
-    this.delta = delta;
-  }
-
-  factory AnalysisInvalidateParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      String file;
-      if (json.containsKey("file")) {
-        file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "file");
-      }
-      int offset;
-      if (json.containsKey("offset")) {
-        offset = jsonDecoder._decodeInt(jsonPath + ".offset", json["offset"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "offset");
-      }
-      int length;
-      if (json.containsKey("length")) {
-        length = jsonDecoder._decodeInt(jsonPath + ".length", json["length"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "length");
-      }
-      int delta;
-      if (json.containsKey("delta")) {
-        delta = jsonDecoder._decodeInt(jsonPath + ".delta", json["delta"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "delta");
-      }
-      return new AnalysisInvalidateParams(file, offset, length, delta);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "analysis.invalidate params", json);
-    }
-  }
-
-  factory AnalysisInvalidateParams.fromNotification(Notification notification) {
-    return new AnalysisInvalidateParams.fromJson(
-        new ResponseDecoder(null), "params", notification._params);
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["file"] = file;
-    result["offset"] = offset;
-    result["length"] = length;
-    result["delta"] = delta;
-    return result;
-  }
-
-  Notification toNotification() {
-    return new Notification("analysis.invalidate", toJson());
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is AnalysisInvalidateParams) {
-      return file == other.file &&
-          offset == other.offset &&
-          length == other.length &&
-          delta == other.delta;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, file.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, offset.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, length.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, delta.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * analysis.navigation params
- *
- * {
- *   "file": FilePath
- *   "regions": List<NavigationRegion>
- *   "targets": List<NavigationTarget>
- *   "files": List<FilePath>
- * }
- */
-class AnalysisNavigationParams implements HasToJson {
-  String _file;
-
-  List<NavigationRegion> _regions;
-
-  List<NavigationTarget> _targets;
-
-  List<String> _files;
-
-  /**
-   * The file containing the navigation regions.
-   */
-  String get file => _file;
-
-  /**
-   * The file containing the navigation regions.
-   */
-  void set file(String value) {
-    assert(value != null);
-    this._file = value;
-  }
-
-  /**
-   * The navigation regions contained in the file. The regions are sorted by
-   * their offsets. Each navigation region represents a list of targets
-   * associated with some range. The lists will usually contain a single
-   * target, but can contain more in the case of a part that is included in
-   * multiple libraries or in Dart code that is compiled against multiple
-   * versions of a package. Note that the navigation regions that are returned
-   * do not overlap other navigation regions.
-   */
-  List<NavigationRegion> get regions => _regions;
-
-  /**
-   * The navigation regions contained in the file. The regions are sorted by
-   * their offsets. Each navigation region represents a list of targets
-   * associated with some range. The lists will usually contain a single
-   * target, but can contain more in the case of a part that is included in
-   * multiple libraries or in Dart code that is compiled against multiple
-   * versions of a package. Note that the navigation regions that are returned
-   * do not overlap other navigation regions.
-   */
-  void set regions(List<NavigationRegion> value) {
-    assert(value != null);
-    this._regions = value;
-  }
-
-  /**
-   * The navigation targets referenced in the file. They are referenced by
-   * NavigationRegions by their index in this array.
-   */
-  List<NavigationTarget> get targets => _targets;
-
-  /**
-   * The navigation targets referenced in the file. They are referenced by
-   * NavigationRegions by their index in this array.
-   */
-  void set targets(List<NavigationTarget> value) {
-    assert(value != null);
-    this._targets = value;
-  }
-
-  /**
-   * The files containing navigation targets referenced in the file. They are
-   * referenced by NavigationTargets by their index in this array.
-   */
-  List<String> get files => _files;
-
-  /**
-   * The files containing navigation targets referenced in the file. They are
-   * referenced by NavigationTargets by their index in this array.
-   */
-  void set files(List<String> value) {
-    assert(value != null);
-    this._files = value;
-  }
-
-  AnalysisNavigationParams(String file, List<NavigationRegion> regions, List<NavigationTarget> targets, List<String> files) {
-    this.file = file;
-    this.regions = regions;
-    this.targets = targets;
-    this.files = files;
-  }
-
-  factory AnalysisNavigationParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      String file;
-      if (json.containsKey("file")) {
-        file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "file");
-      }
-      List<NavigationRegion> regions;
-      if (json.containsKey("regions")) {
-        regions = jsonDecoder._decodeList(jsonPath + ".regions", json["regions"], (String jsonPath, Object json) => new NavigationRegion.fromJson(jsonDecoder, jsonPath, json));
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "regions");
-      }
-      List<NavigationTarget> targets;
-      if (json.containsKey("targets")) {
-        targets = jsonDecoder._decodeList(jsonPath + ".targets", json["targets"], (String jsonPath, Object json) => new NavigationTarget.fromJson(jsonDecoder, jsonPath, json));
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "targets");
-      }
-      List<String> files;
-      if (json.containsKey("files")) {
-        files = jsonDecoder._decodeList(jsonPath + ".files", json["files"], jsonDecoder._decodeString);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "files");
-      }
-      return new AnalysisNavigationParams(file, regions, targets, files);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "analysis.navigation params", json);
-    }
-  }
-
-  factory AnalysisNavigationParams.fromNotification(Notification notification) {
-    return new AnalysisNavigationParams.fromJson(
-        new ResponseDecoder(null), "params", notification._params);
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["file"] = file;
-    result["regions"] = regions.map((NavigationRegion value) => value.toJson()).toList();
-    result["targets"] = targets.map((NavigationTarget value) => value.toJson()).toList();
-    result["files"] = files;
-    return result;
-  }
-
-  Notification toNotification() {
-    return new Notification("analysis.navigation", toJson());
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is AnalysisNavigationParams) {
-      return file == other.file &&
-          _listEqual(regions, other.regions, (NavigationRegion a, NavigationRegion b) => a == b) &&
-          _listEqual(targets, other.targets, (NavigationTarget a, NavigationTarget b) => a == b) &&
-          _listEqual(files, other.files, (String a, String b) => a == b);
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, file.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, regions.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, targets.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, files.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * analysis.occurrences params
- *
- * {
- *   "file": FilePath
- *   "occurrences": List<Occurrences>
- * }
- */
-class AnalysisOccurrencesParams implements HasToJson {
-  String _file;
-
-  List<Occurrences> _occurrences;
-
-  /**
-   * The file in which the references occur.
-   */
-  String get file => _file;
-
-  /**
-   * The file in which the references occur.
-   */
-  void set file(String value) {
-    assert(value != null);
-    this._file = value;
-  }
-
-  /**
-   * The occurrences of references to elements within the file.
-   */
-  List<Occurrences> get occurrences => _occurrences;
-
-  /**
-   * The occurrences of references to elements within the file.
-   */
-  void set occurrences(List<Occurrences> value) {
-    assert(value != null);
-    this._occurrences = value;
-  }
-
-  AnalysisOccurrencesParams(String file, List<Occurrences> occurrences) {
-    this.file = file;
-    this.occurrences = occurrences;
-  }
-
-  factory AnalysisOccurrencesParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      String file;
-      if (json.containsKey("file")) {
-        file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "file");
-      }
-      List<Occurrences> occurrences;
-      if (json.containsKey("occurrences")) {
-        occurrences = jsonDecoder._decodeList(jsonPath + ".occurrences", json["occurrences"], (String jsonPath, Object json) => new Occurrences.fromJson(jsonDecoder, jsonPath, json));
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "occurrences");
-      }
-      return new AnalysisOccurrencesParams(file, occurrences);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "analysis.occurrences params", json);
-    }
-  }
-
-  factory AnalysisOccurrencesParams.fromNotification(Notification notification) {
-    return new AnalysisOccurrencesParams.fromJson(
-        new ResponseDecoder(null), "params", notification._params);
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["file"] = file;
-    result["occurrences"] = occurrences.map((Occurrences value) => value.toJson()).toList();
-    return result;
-  }
-
-  Notification toNotification() {
-    return new Notification("analysis.occurrences", toJson());
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is AnalysisOccurrencesParams) {
-      return file == other.file &&
-          _listEqual(occurrences, other.occurrences, (Occurrences a, Occurrences b) => a == b);
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, file.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, occurrences.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * analysis.outline params
- *
- * {
- *   "file": FilePath
- *   "outline": Outline
- * }
- */
-class AnalysisOutlineParams implements HasToJson {
-  String _file;
-
-  Outline _outline;
-
-  /**
-   * The file with which the outline is associated.
-   */
-  String get file => _file;
-
-  /**
-   * The file with which the outline is associated.
-   */
-  void set file(String value) {
-    assert(value != null);
-    this._file = value;
-  }
-
-  /**
-   * The outline associated with the file.
-   */
-  Outline get outline => _outline;
-
-  /**
-   * The outline associated with the file.
-   */
-  void set outline(Outline value) {
-    assert(value != null);
-    this._outline = value;
-  }
-
-  AnalysisOutlineParams(String file, Outline outline) {
-    this.file = file;
-    this.outline = outline;
-  }
-
-  factory AnalysisOutlineParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      String file;
-      if (json.containsKey("file")) {
-        file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "file");
-      }
-      Outline outline;
-      if (json.containsKey("outline")) {
-        outline = new Outline.fromJson(jsonDecoder, jsonPath + ".outline", json["outline"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "outline");
-      }
-      return new AnalysisOutlineParams(file, outline);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "analysis.outline params", json);
-    }
-  }
-
-  factory AnalysisOutlineParams.fromNotification(Notification notification) {
-    return new AnalysisOutlineParams.fromJson(
-        new ResponseDecoder(null), "params", notification._params);
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["file"] = file;
-    result["outline"] = outline.toJson();
-    return result;
-  }
-
-  Notification toNotification() {
-    return new Notification("analysis.outline", toJson());
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is AnalysisOutlineParams) {
-      return file == other.file &&
-          outline == other.outline;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, file.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, outline.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * analysis.overrides params
- *
- * {
- *   "file": FilePath
- *   "overrides": List<Override>
- * }
- */
-class AnalysisOverridesParams implements HasToJson {
-  String _file;
-
-  List<Override> _overrides;
-
-  /**
-   * The file with which the overrides are associated.
-   */
-  String get file => _file;
-
-  /**
-   * The file with which the overrides are associated.
-   */
-  void set file(String value) {
-    assert(value != null);
-    this._file = value;
-  }
-
-  /**
-   * The overrides associated with the file.
-   */
-  List<Override> get overrides => _overrides;
-
-  /**
-   * The overrides associated with the file.
-   */
-  void set overrides(List<Override> value) {
-    assert(value != null);
-    this._overrides = value;
-  }
-
-  AnalysisOverridesParams(String file, List<Override> overrides) {
-    this.file = file;
-    this.overrides = overrides;
-  }
-
-  factory AnalysisOverridesParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      String file;
-      if (json.containsKey("file")) {
-        file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "file");
-      }
-      List<Override> overrides;
-      if (json.containsKey("overrides")) {
-        overrides = jsonDecoder._decodeList(jsonPath + ".overrides", json["overrides"], (String jsonPath, Object json) => new Override.fromJson(jsonDecoder, jsonPath, json));
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "overrides");
-      }
-      return new AnalysisOverridesParams(file, overrides);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "analysis.overrides params", json);
-    }
-  }
-
-  factory AnalysisOverridesParams.fromNotification(Notification notification) {
-    return new AnalysisOverridesParams.fromJson(
-        new ResponseDecoder(null), "params", notification._params);
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["file"] = file;
-    result["overrides"] = overrides.map((Override value) => value.toJson()).toList();
-    return result;
-  }
-
-  Notification toNotification() {
-    return new Notification("analysis.overrides", toJson());
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is AnalysisOverridesParams) {
-      return file == other.file &&
-          _listEqual(overrides, other.overrides, (Override a, Override b) => a == b);
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, file.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, overrides.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * completion.getSuggestions params
- *
- * {
- *   "file": FilePath
- *   "offset": int
- * }
- */
-class CompletionGetSuggestionsParams implements HasToJson {
-  String _file;
-
-  int _offset;
-
-  /**
-   * The file containing the point at which suggestions are to be made.
-   */
-  String get file => _file;
-
-  /**
-   * The file containing the point at which suggestions are to be made.
-   */
-  void set file(String value) {
-    assert(value != null);
-    this._file = value;
-  }
-
-  /**
-   * The offset within the file at which suggestions are to be made.
-   */
-  int get offset => _offset;
-
-  /**
-   * The offset within the file at which suggestions are to be made.
-   */
-  void set offset(int value) {
-    assert(value != null);
-    this._offset = value;
-  }
-
-  CompletionGetSuggestionsParams(String file, int offset) {
-    this.file = file;
-    this.offset = offset;
-  }
-
-  factory CompletionGetSuggestionsParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      String file;
-      if (json.containsKey("file")) {
-        file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "file");
-      }
-      int offset;
-      if (json.containsKey("offset")) {
-        offset = jsonDecoder._decodeInt(jsonPath + ".offset", json["offset"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "offset");
-      }
-      return new CompletionGetSuggestionsParams(file, offset);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "completion.getSuggestions params", json);
-    }
-  }
-
-  factory CompletionGetSuggestionsParams.fromRequest(Request request) {
-    return new CompletionGetSuggestionsParams.fromJson(
-        new RequestDecoder(request), "params", request._params);
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["file"] = file;
-    result["offset"] = offset;
-    return result;
-  }
-
-  Request toRequest(String id) {
-    return new Request(id, "completion.getSuggestions", toJson());
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is CompletionGetSuggestionsParams) {
-      return file == other.file &&
-          offset == other.offset;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, file.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, offset.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * completion.getSuggestions result
- *
- * {
- *   "id": CompletionId
- * }
- */
-class CompletionGetSuggestionsResult implements HasToJson {
-  String _id;
-
-  /**
-   * The identifier used to associate results with this completion request.
-   */
-  String get id => _id;
-
-  /**
-   * The identifier used to associate results with this completion request.
-   */
-  void set id(String value) {
-    assert(value != null);
-    this._id = value;
-  }
-
-  CompletionGetSuggestionsResult(String id) {
-    this.id = id;
-  }
-
-  factory CompletionGetSuggestionsResult.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      String id;
-      if (json.containsKey("id")) {
-        id = jsonDecoder._decodeString(jsonPath + ".id", json["id"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "id");
-      }
-      return new CompletionGetSuggestionsResult(id);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "completion.getSuggestions result", json);
-    }
-  }
-
-  factory CompletionGetSuggestionsResult.fromResponse(Response response) {
-    return new CompletionGetSuggestionsResult.fromJson(
-        new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), "result", response._result);
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["id"] = id;
-    return result;
-  }
-
-  Response toResponse(String id) {
-    return new Response(id, result: toJson());
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is CompletionGetSuggestionsResult) {
-      return id == other.id;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, id.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * completion.results params
- *
- * {
- *   "id": CompletionId
- *   "replacementOffset": int
- *   "replacementLength": int
- *   "results": List<CompletionSuggestion>
- *   "isLast": bool
- * }
- */
-class CompletionResultsParams implements HasToJson {
-  String _id;
-
-  int _replacementOffset;
-
-  int _replacementLength;
-
-  List<CompletionSuggestion> _results;
-
-  bool _isLast;
-
-  /**
-   * The id associated with the completion.
-   */
-  String get id => _id;
-
-  /**
-   * The id associated with the completion.
-   */
-  void set id(String value) {
-    assert(value != null);
-    this._id = value;
-  }
-
-  /**
-   * The offset of the start of the text to be replaced. This will be different
-   * than the offset used to request the completion suggestions if there was a
-   * portion of an identifier before the original offset. In particular, the
-   * replacementOffset will be the offset of the beginning of said identifier.
-   */
-  int get replacementOffset => _replacementOffset;
-
-  /**
-   * The offset of the start of the text to be replaced. This will be different
-   * than the offset used to request the completion suggestions if there was a
-   * portion of an identifier before the original offset. In particular, the
-   * replacementOffset will be the offset of the beginning of said identifier.
-   */
-  void set replacementOffset(int value) {
-    assert(value != null);
-    this._replacementOffset = value;
-  }
-
-  /**
-   * The length of the text to be replaced if the remainder of the identifier
-   * containing the cursor is to be replaced when the suggestion is applied
-   * (that is, the number of characters in the existing identifier).
-   */
-  int get replacementLength => _replacementLength;
-
-  /**
-   * The length of the text to be replaced if the remainder of the identifier
-   * containing the cursor is to be replaced when the suggestion is applied
-   * (that is, the number of characters in the existing identifier).
-   */
-  void set replacementLength(int value) {
-    assert(value != null);
-    this._replacementLength = value;
-  }
-
-  /**
-   * The completion suggestions being reported. The notification contains all
-   * possible completions at the requested cursor position, even those that do
-   * not match the characters the user has already typed. This allows the
-   * client to respond to further keystrokes from the user without having to
-   * make additional requests.
-   */
-  List<CompletionSuggestion> get results => _results;
-
-  /**
-   * The completion suggestions being reported. The notification contains all
-   * possible completions at the requested cursor position, even those that do
-   * not match the characters the user has already typed. This allows the
-   * client to respond to further keystrokes from the user without having to
-   * make additional requests.
-   */
-  void set results(List<CompletionSuggestion> value) {
-    assert(value != null);
-    this._results = value;
-  }
-
-  /**
-   * True if this is that last set of results that will be returned for the
-   * indicated completion.
-   */
-  bool get isLast => _isLast;
-
-  /**
-   * True if this is that last set of results that will be returned for the
-   * indicated completion.
-   */
-  void set isLast(bool value) {
-    assert(value != null);
-    this._isLast = value;
-  }
-
-  CompletionResultsParams(String id, int replacementOffset, int replacementLength, List<CompletionSuggestion> results, bool isLast) {
-    this.id = id;
-    this.replacementOffset = replacementOffset;
-    this.replacementLength = replacementLength;
-    this.results = results;
-    this.isLast = isLast;
-  }
-
-  factory CompletionResultsParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      String id;
-      if (json.containsKey("id")) {
-        id = jsonDecoder._decodeString(jsonPath + ".id", json["id"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "id");
-      }
-      int replacementOffset;
-      if (json.containsKey("replacementOffset")) {
-        replacementOffset = jsonDecoder._decodeInt(jsonPath + ".replacementOffset", json["replacementOffset"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "replacementOffset");
-      }
-      int replacementLength;
-      if (json.containsKey("replacementLength")) {
-        replacementLength = jsonDecoder._decodeInt(jsonPath + ".replacementLength", json["replacementLength"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "replacementLength");
-      }
-      List<CompletionSuggestion> results;
-      if (json.containsKey("results")) {
-        results = jsonDecoder._decodeList(jsonPath + ".results", json["results"], (String jsonPath, Object json) => new CompletionSuggestion.fromJson(jsonDecoder, jsonPath, json));
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "results");
-      }
-      bool isLast;
-      if (json.containsKey("isLast")) {
-        isLast = jsonDecoder._decodeBool(jsonPath + ".isLast", json["isLast"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "isLast");
-      }
-      return new CompletionResultsParams(id, replacementOffset, replacementLength, results, isLast);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "completion.results params", json);
-    }
-  }
-
-  factory CompletionResultsParams.fromNotification(Notification notification) {
-    return new CompletionResultsParams.fromJson(
-        new ResponseDecoder(null), "params", notification._params);
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["id"] = id;
-    result["replacementOffset"] = replacementOffset;
-    result["replacementLength"] = replacementLength;
-    result["results"] = results.map((CompletionSuggestion value) => value.toJson()).toList();
-    result["isLast"] = isLast;
-    return result;
-  }
-
-  Notification toNotification() {
-    return new Notification("completion.results", toJson());
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is CompletionResultsParams) {
-      return id == other.id &&
-          replacementOffset == other.replacementOffset &&
-          replacementLength == other.replacementLength &&
-          _listEqual(results, other.results, (CompletionSuggestion a, CompletionSuggestion b) => a == b) &&
-          isLast == other.isLast;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, id.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, replacementOffset.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, replacementLength.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, results.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, isLast.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * search.findElementReferences params
- *
- * {
- *   "file": FilePath
- *   "offset": int
- *   "includePotential": bool
- * }
- */
-class SearchFindElementReferencesParams implements HasToJson {
-  String _file;
-
-  int _offset;
-
-  bool _includePotential;
-
-  /**
-   * The file containing the declaration of or reference to the element used to
-   * define the search.
-   */
-  String get file => _file;
-
-  /**
-   * The file containing the declaration of or reference to the element used to
-   * define the search.
-   */
-  void set file(String value) {
-    assert(value != null);
-    this._file = value;
-  }
-
-  /**
-   * The offset within the file of the declaration of or reference to the
-   * element.
-   */
-  int get offset => _offset;
-
-  /**
-   * The offset within the file of the declaration of or reference to the
-   * element.
-   */
-  void set offset(int value) {
-    assert(value != null);
-    this._offset = value;
-  }
-
-  /**
-   * True if potential matches are to be included in the results.
-   */
-  bool get includePotential => _includePotential;
-
-  /**
-   * True if potential matches are to be included in the results.
-   */
-  void set includePotential(bool value) {
-    assert(value != null);
-    this._includePotential = value;
-  }
-
-  SearchFindElementReferencesParams(String file, int offset, bool includePotential) {
-    this.file = file;
-    this.offset = offset;
-    this.includePotential = includePotential;
-  }
-
-  factory SearchFindElementReferencesParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      String file;
-      if (json.containsKey("file")) {
-        file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "file");
-      }
-      int offset;
-      if (json.containsKey("offset")) {
-        offset = jsonDecoder._decodeInt(jsonPath + ".offset", json["offset"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "offset");
-      }
-      bool includePotential;
-      if (json.containsKey("includePotential")) {
-        includePotential = jsonDecoder._decodeBool(jsonPath + ".includePotential", json["includePotential"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "includePotential");
-      }
-      return new SearchFindElementReferencesParams(file, offset, includePotential);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "search.findElementReferences params", json);
-    }
-  }
-
-  factory SearchFindElementReferencesParams.fromRequest(Request request) {
-    return new SearchFindElementReferencesParams.fromJson(
-        new RequestDecoder(request), "params", request._params);
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["file"] = file;
-    result["offset"] = offset;
-    result["includePotential"] = includePotential;
-    return result;
-  }
-
-  Request toRequest(String id) {
-    return new Request(id, "search.findElementReferences", toJson());
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is SearchFindElementReferencesParams) {
-      return file == other.file &&
-          offset == other.offset &&
-          includePotential == other.includePotential;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, file.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, offset.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, includePotential.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * search.findElementReferences result
- *
- * {
- *   "id": optional SearchId
- *   "element": optional Element
- * }
- */
-class SearchFindElementReferencesResult implements HasToJson {
-  String _id;
-
-  Element _element;
-
-  /**
-   * The identifier used to associate results with this search request.
-   *
-   * If no element was found at the given location, this field will be absent,
-   * and no results will be reported via the search.results notification.
-   */
-  String get id => _id;
-
-  /**
-   * The identifier used to associate results with this search request.
-   *
-   * If no element was found at the given location, this field will be absent,
-   * and no results will be reported via the search.results notification.
-   */
-  void set id(String value) {
-    this._id = value;
-  }
-
-  /**
-   * The element referenced or defined at the given offset and whose references
-   * will be returned in the search results.
-   *
-   * If no element was found at the given location, this field will be absent.
-   */
-  Element get element => _element;
-
-  /**
-   * The element referenced or defined at the given offset and whose references
-   * will be returned in the search results.
-   *
-   * If no element was found at the given location, this field will be absent.
-   */
-  void set element(Element value) {
-    this._element = value;
-  }
-
-  SearchFindElementReferencesResult({String id, Element element}) {
-    this.id = id;
-    this.element = element;
-  }
-
-  factory SearchFindElementReferencesResult.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      String id;
-      if (json.containsKey("id")) {
-        id = jsonDecoder._decodeString(jsonPath + ".id", json["id"]);
-      }
-      Element element;
-      if (json.containsKey("element")) {
-        element = new Element.fromJson(jsonDecoder, jsonPath + ".element", json["element"]);
-      }
-      return new SearchFindElementReferencesResult(id: id, element: element);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "search.findElementReferences result", json);
-    }
-  }
-
-  factory SearchFindElementReferencesResult.fromResponse(Response response) {
-    return new SearchFindElementReferencesResult.fromJson(
-        new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), "result", response._result);
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    if (id != null) {
-      result["id"] = id;
-    }
-    if (element != null) {
-      result["element"] = element.toJson();
-    }
-    return result;
-  }
-
-  Response toResponse(String id) {
-    return new Response(id, result: toJson());
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is SearchFindElementReferencesResult) {
-      return id == other.id &&
-          element == other.element;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, id.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, element.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * search.findMemberDeclarations params
- *
- * {
- *   "name": String
- * }
- */
-class SearchFindMemberDeclarationsParams implements HasToJson {
-  String _name;
-
-  /**
-   * The name of the declarations to be found.
-   */
-  String get name => _name;
-
-  /**
-   * The name of the declarations to be found.
-   */
-  void set name(String value) {
-    assert(value != null);
-    this._name = value;
-  }
-
-  SearchFindMemberDeclarationsParams(String name) {
-    this.name = name;
-  }
-
-  factory SearchFindMemberDeclarationsParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      String name;
-      if (json.containsKey("name")) {
-        name = jsonDecoder._decodeString(jsonPath + ".name", json["name"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "name");
-      }
-      return new SearchFindMemberDeclarationsParams(name);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "search.findMemberDeclarations params", json);
-    }
-  }
-
-  factory SearchFindMemberDeclarationsParams.fromRequest(Request request) {
-    return new SearchFindMemberDeclarationsParams.fromJson(
-        new RequestDecoder(request), "params", request._params);
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["name"] = name;
-    return result;
-  }
-
-  Request toRequest(String id) {
-    return new Request(id, "search.findMemberDeclarations", toJson());
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is SearchFindMemberDeclarationsParams) {
-      return name == other.name;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, name.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * search.findMemberDeclarations result
- *
- * {
- *   "id": SearchId
- * }
- */
-class SearchFindMemberDeclarationsResult implements HasToJson {
-  String _id;
-
-  /**
-   * The identifier used to associate results with this search request.
-   */
-  String get id => _id;
-
-  /**
-   * The identifier used to associate results with this search request.
-   */
-  void set id(String value) {
-    assert(value != null);
-    this._id = value;
-  }
-
-  SearchFindMemberDeclarationsResult(String id) {
-    this.id = id;
-  }
-
-  factory SearchFindMemberDeclarationsResult.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      String id;
-      if (json.containsKey("id")) {
-        id = jsonDecoder._decodeString(jsonPath + ".id", json["id"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "id");
-      }
-      return new SearchFindMemberDeclarationsResult(id);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "search.findMemberDeclarations result", json);
-    }
-  }
-
-  factory SearchFindMemberDeclarationsResult.fromResponse(Response response) {
-    return new SearchFindMemberDeclarationsResult.fromJson(
-        new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), "result", response._result);
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["id"] = id;
-    return result;
-  }
-
-  Response toResponse(String id) {
-    return new Response(id, result: toJson());
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is SearchFindMemberDeclarationsResult) {
-      return id == other.id;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, id.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * search.findMemberReferences params
- *
- * {
- *   "name": String
- * }
- */
-class SearchFindMemberReferencesParams implements HasToJson {
-  String _name;
-
-  /**
-   * The name of the references to be found.
-   */
-  String get name => _name;
-
-  /**
-   * The name of the references to be found.
-   */
-  void set name(String value) {
-    assert(value != null);
-    this._name = value;
-  }
-
-  SearchFindMemberReferencesParams(String name) {
-    this.name = name;
-  }
-
-  factory SearchFindMemberReferencesParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      String name;
-      if (json.containsKey("name")) {
-        name = jsonDecoder._decodeString(jsonPath + ".name", json["name"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "name");
-      }
-      return new SearchFindMemberReferencesParams(name);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "search.findMemberReferences params", json);
-    }
-  }
-
-  factory SearchFindMemberReferencesParams.fromRequest(Request request) {
-    return new SearchFindMemberReferencesParams.fromJson(
-        new RequestDecoder(request), "params", request._params);
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["name"] = name;
-    return result;
-  }
-
-  Request toRequest(String id) {
-    return new Request(id, "search.findMemberReferences", toJson());
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is SearchFindMemberReferencesParams) {
-      return name == other.name;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, name.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * search.findMemberReferences result
- *
- * {
- *   "id": SearchId
- * }
- */
-class SearchFindMemberReferencesResult implements HasToJson {
-  String _id;
-
-  /**
-   * The identifier used to associate results with this search request.
-   */
-  String get id => _id;
-
-  /**
-   * The identifier used to associate results with this search request.
-   */
-  void set id(String value) {
-    assert(value != null);
-    this._id = value;
-  }
-
-  SearchFindMemberReferencesResult(String id) {
-    this.id = id;
-  }
-
-  factory SearchFindMemberReferencesResult.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      String id;
-      if (json.containsKey("id")) {
-        id = jsonDecoder._decodeString(jsonPath + ".id", json["id"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "id");
-      }
-      return new SearchFindMemberReferencesResult(id);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "search.findMemberReferences result", json);
-    }
-  }
-
-  factory SearchFindMemberReferencesResult.fromResponse(Response response) {
-    return new SearchFindMemberReferencesResult.fromJson(
-        new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), "result", response._result);
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["id"] = id;
-    return result;
-  }
-
-  Response toResponse(String id) {
-    return new Response(id, result: toJson());
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is SearchFindMemberReferencesResult) {
-      return id == other.id;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, id.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * search.findTopLevelDeclarations params
- *
- * {
- *   "pattern": String
- * }
- */
-class SearchFindTopLevelDeclarationsParams implements HasToJson {
-  String _pattern;
-
-  /**
-   * The regular expression used to match the names of the declarations to be
-   * found.
-   */
-  String get pattern => _pattern;
-
-  /**
-   * The regular expression used to match the names of the declarations to be
-   * found.
-   */
-  void set pattern(String value) {
-    assert(value != null);
-    this._pattern = value;
-  }
-
-  SearchFindTopLevelDeclarationsParams(String pattern) {
-    this.pattern = pattern;
-  }
-
-  factory SearchFindTopLevelDeclarationsParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      String pattern;
-      if (json.containsKey("pattern")) {
-        pattern = jsonDecoder._decodeString(jsonPath + ".pattern", json["pattern"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "pattern");
-      }
-      return new SearchFindTopLevelDeclarationsParams(pattern);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "search.findTopLevelDeclarations params", json);
-    }
-  }
-
-  factory SearchFindTopLevelDeclarationsParams.fromRequest(Request request) {
-    return new SearchFindTopLevelDeclarationsParams.fromJson(
-        new RequestDecoder(request), "params", request._params);
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["pattern"] = pattern;
-    return result;
-  }
-
-  Request toRequest(String id) {
-    return new Request(id, "search.findTopLevelDeclarations", toJson());
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is SearchFindTopLevelDeclarationsParams) {
-      return pattern == other.pattern;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, pattern.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * search.findTopLevelDeclarations result
- *
- * {
- *   "id": SearchId
- * }
- */
-class SearchFindTopLevelDeclarationsResult implements HasToJson {
-  String _id;
-
-  /**
-   * The identifier used to associate results with this search request.
-   */
-  String get id => _id;
-
-  /**
-   * The identifier used to associate results with this search request.
-   */
-  void set id(String value) {
-    assert(value != null);
-    this._id = value;
-  }
-
-  SearchFindTopLevelDeclarationsResult(String id) {
-    this.id = id;
-  }
-
-  factory SearchFindTopLevelDeclarationsResult.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      String id;
-      if (json.containsKey("id")) {
-        id = jsonDecoder._decodeString(jsonPath + ".id", json["id"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "id");
-      }
-      return new SearchFindTopLevelDeclarationsResult(id);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "search.findTopLevelDeclarations result", json);
-    }
-  }
-
-  factory SearchFindTopLevelDeclarationsResult.fromResponse(Response response) {
-    return new SearchFindTopLevelDeclarationsResult.fromJson(
-        new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), "result", response._result);
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["id"] = id;
-    return result;
-  }
-
-  Response toResponse(String id) {
-    return new Response(id, result: toJson());
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is SearchFindTopLevelDeclarationsResult) {
-      return id == other.id;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, id.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * search.getTypeHierarchy params
- *
- * {
- *   "file": FilePath
- *   "offset": int
- * }
- */
-class SearchGetTypeHierarchyParams implements HasToJson {
-  String _file;
-
-  int _offset;
-
-  /**
-   * The file containing the declaration or reference to the type for which a
-   * hierarchy is being requested.
-   */
-  String get file => _file;
-
-  /**
-   * The file containing the declaration or reference to the type for which a
-   * hierarchy is being requested.
-   */
-  void set file(String value) {
-    assert(value != null);
-    this._file = value;
-  }
-
-  /**
-   * The offset of the name of the type within the file.
-   */
-  int get offset => _offset;
-
-  /**
-   * The offset of the name of the type within the file.
-   */
-  void set offset(int value) {
-    assert(value != null);
-    this._offset = value;
-  }
-
-  SearchGetTypeHierarchyParams(String file, int offset) {
-    this.file = file;
-    this.offset = offset;
-  }
-
-  factory SearchGetTypeHierarchyParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      String file;
-      if (json.containsKey("file")) {
-        file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "file");
-      }
-      int offset;
-      if (json.containsKey("offset")) {
-        offset = jsonDecoder._decodeInt(jsonPath + ".offset", json["offset"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "offset");
-      }
-      return new SearchGetTypeHierarchyParams(file, offset);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "search.getTypeHierarchy params", json);
-    }
-  }
-
-  factory SearchGetTypeHierarchyParams.fromRequest(Request request) {
-    return new SearchGetTypeHierarchyParams.fromJson(
-        new RequestDecoder(request), "params", request._params);
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["file"] = file;
-    result["offset"] = offset;
-    return result;
-  }
-
-  Request toRequest(String id) {
-    return new Request(id, "search.getTypeHierarchy", toJson());
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is SearchGetTypeHierarchyParams) {
-      return file == other.file &&
-          offset == other.offset;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, file.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, offset.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * search.getTypeHierarchy result
- *
- * {
- *   "hierarchyItems": optional List<TypeHierarchyItem>
- * }
- */
-class SearchGetTypeHierarchyResult implements HasToJson {
-  List<TypeHierarchyItem> _hierarchyItems;
-
-  /**
-   * A list of the types in the requested hierarchy. The first element of the
-   * list is the item representing the type for which the hierarchy was
-   * requested. The index of other elements of the list is unspecified, but
-   * correspond to the integers used to reference supertype and subtype items
-   * within the items.
-   *
-   * This field will be absent if the code at the given file and offset does
-   * not represent a type, or if the file has not been sufficiently analyzed to
-   * allow a type hierarchy to be produced.
-   */
-  List<TypeHierarchyItem> get hierarchyItems => _hierarchyItems;
-
-  /**
-   * A list of the types in the requested hierarchy. The first element of the
-   * list is the item representing the type for which the hierarchy was
-   * requested. The index of other elements of the list is unspecified, but
-   * correspond to the integers used to reference supertype and subtype items
-   * within the items.
-   *
-   * This field will be absent if the code at the given file and offset does
-   * not represent a type, or if the file has not been sufficiently analyzed to
-   * allow a type hierarchy to be produced.
-   */
-  void set hierarchyItems(List<TypeHierarchyItem> value) {
-    this._hierarchyItems = value;
-  }
-
-  SearchGetTypeHierarchyResult({List<TypeHierarchyItem> hierarchyItems}) {
-    this.hierarchyItems = hierarchyItems;
-  }
-
-  factory SearchGetTypeHierarchyResult.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      List<TypeHierarchyItem> hierarchyItems;
-      if (json.containsKey("hierarchyItems")) {
-        hierarchyItems = jsonDecoder._decodeList(jsonPath + ".hierarchyItems", json["hierarchyItems"], (String jsonPath, Object json) => new TypeHierarchyItem.fromJson(jsonDecoder, jsonPath, json));
-      }
-      return new SearchGetTypeHierarchyResult(hierarchyItems: hierarchyItems);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "search.getTypeHierarchy result", json);
-    }
-  }
-
-  factory SearchGetTypeHierarchyResult.fromResponse(Response response) {
-    return new SearchGetTypeHierarchyResult.fromJson(
-        new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), "result", response._result);
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    if (hierarchyItems != null) {
-      result["hierarchyItems"] = hierarchyItems.map((TypeHierarchyItem value) => value.toJson()).toList();
-    }
-    return result;
-  }
-
-  Response toResponse(String id) {
-    return new Response(id, result: toJson());
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is SearchGetTypeHierarchyResult) {
-      return _listEqual(hierarchyItems, other.hierarchyItems, (TypeHierarchyItem a, TypeHierarchyItem b) => a == b);
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, hierarchyItems.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * search.results params
- *
- * {
- *   "id": SearchId
- *   "results": List<SearchResult>
- *   "isLast": bool
- * }
- */
-class SearchResultsParams implements HasToJson {
-  String _id;
-
-  List<SearchResult> _results;
-
-  bool _isLast;
-
-  /**
-   * The id associated with the search.
-   */
-  String get id => _id;
-
-  /**
-   * The id associated with the search.
-   */
-  void set id(String value) {
-    assert(value != null);
-    this._id = value;
-  }
-
-  /**
-   * The search results being reported.
-   */
-  List<SearchResult> get results => _results;
-
-  /**
-   * The search results being reported.
-   */
-  void set results(List<SearchResult> value) {
-    assert(value != null);
-    this._results = value;
-  }
-
-  /**
-   * True if this is that last set of results that will be returned for the
-   * indicated search.
-   */
-  bool get isLast => _isLast;
-
-  /**
-   * True if this is that last set of results that will be returned for the
-   * indicated search.
-   */
-  void set isLast(bool value) {
-    assert(value != null);
-    this._isLast = value;
-  }
-
-  SearchResultsParams(String id, List<SearchResult> results, bool isLast) {
-    this.id = id;
-    this.results = results;
-    this.isLast = isLast;
-  }
-
-  factory SearchResultsParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      String id;
-      if (json.containsKey("id")) {
-        id = jsonDecoder._decodeString(jsonPath + ".id", json["id"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "id");
-      }
-      List<SearchResult> results;
-      if (json.containsKey("results")) {
-        results = jsonDecoder._decodeList(jsonPath + ".results", json["results"], (String jsonPath, Object json) => new SearchResult.fromJson(jsonDecoder, jsonPath, json));
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "results");
-      }
-      bool isLast;
-      if (json.containsKey("isLast")) {
-        isLast = jsonDecoder._decodeBool(jsonPath + ".isLast", json["isLast"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "isLast");
-      }
-      return new SearchResultsParams(id, results, isLast);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "search.results params", json);
-    }
-  }
-
-  factory SearchResultsParams.fromNotification(Notification notification) {
-    return new SearchResultsParams.fromJson(
-        new ResponseDecoder(null), "params", notification._params);
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["id"] = id;
-    result["results"] = results.map((SearchResult value) => value.toJson()).toList();
-    result["isLast"] = isLast;
-    return result;
-  }
-
-  Notification toNotification() {
-    return new Notification("search.results", toJson());
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is SearchResultsParams) {
-      return id == other.id &&
-          _listEqual(results, other.results, (SearchResult a, SearchResult b) => a == b) &&
-          isLast == other.isLast;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, id.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, results.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, isLast.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * edit.format params
- *
- * {
- *   "file": FilePath
- *   "selectionOffset": int
- *   "selectionLength": int
- *   "lineLength": optional int
- * }
- */
-class EditFormatParams implements HasToJson {
-  String _file;
-
-  int _selectionOffset;
-
-  int _selectionLength;
-
-  int _lineLength;
-
-  /**
-   * The file containing the code to be formatted.
-   */
-  String get file => _file;
-
-  /**
-   * The file containing the code to be formatted.
-   */
-  void set file(String value) {
-    assert(value != null);
-    this._file = value;
-  }
-
-  /**
-   * The offset of the current selection in the file.
-   */
-  int get selectionOffset => _selectionOffset;
-
-  /**
-   * The offset of the current selection in the file.
-   */
-  void set selectionOffset(int value) {
-    assert(value != null);
-    this._selectionOffset = value;
-  }
-
-  /**
-   * The length of the current selection in the file.
-   */
-  int get selectionLength => _selectionLength;
-
-  /**
-   * The length of the current selection in the file.
-   */
-  void set selectionLength(int value) {
-    assert(value != null);
-    this._selectionLength = value;
-  }
-
-  /**
-   * The line length to be used by the formatter.
-   */
-  int get lineLength => _lineLength;
-
-  /**
-   * The line length to be used by the formatter.
-   */
-  void set lineLength(int value) {
-    this._lineLength = value;
-  }
-
-  EditFormatParams(String file, int selectionOffset, int selectionLength, {int lineLength}) {
-    this.file = file;
-    this.selectionOffset = selectionOffset;
-    this.selectionLength = selectionLength;
-    this.lineLength = lineLength;
-  }
-
-  factory EditFormatParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      String file;
-      if (json.containsKey("file")) {
-        file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "file");
-      }
-      int selectionOffset;
-      if (json.containsKey("selectionOffset")) {
-        selectionOffset = jsonDecoder._decodeInt(jsonPath + ".selectionOffset", json["selectionOffset"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "selectionOffset");
-      }
-      int selectionLength;
-      if (json.containsKey("selectionLength")) {
-        selectionLength = jsonDecoder._decodeInt(jsonPath + ".selectionLength", json["selectionLength"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "selectionLength");
-      }
-      int lineLength;
-      if (json.containsKey("lineLength")) {
-        lineLength = jsonDecoder._decodeInt(jsonPath + ".lineLength", json["lineLength"]);
-      }
-      return new EditFormatParams(file, selectionOffset, selectionLength, lineLength: lineLength);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "edit.format params", json);
-    }
-  }
-
-  factory EditFormatParams.fromRequest(Request request) {
-    return new EditFormatParams.fromJson(
-        new RequestDecoder(request), "params", request._params);
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["file"] = file;
-    result["selectionOffset"] = selectionOffset;
-    result["selectionLength"] = selectionLength;
-    if (lineLength != null) {
-      result["lineLength"] = lineLength;
-    }
-    return result;
-  }
-
-  Request toRequest(String id) {
-    return new Request(id, "edit.format", toJson());
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is EditFormatParams) {
-      return file == other.file &&
-          selectionOffset == other.selectionOffset &&
-          selectionLength == other.selectionLength &&
-          lineLength == other.lineLength;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, file.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, selectionOffset.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, selectionLength.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, lineLength.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * edit.format result
- *
- * {
- *   "edits": List<SourceEdit>
- *   "selectionOffset": int
- *   "selectionLength": int
- * }
- */
-class EditFormatResult implements HasToJson {
-  List<SourceEdit> _edits;
-
-  int _selectionOffset;
-
-  int _selectionLength;
-
-  /**
-   * The edit(s) to be applied in order to format the code. The list will be
-   * empty if the code was already formatted (there are no changes).
-   */
-  List<SourceEdit> get edits => _edits;
-
-  /**
-   * The edit(s) to be applied in order to format the code. The list will be
-   * empty if the code was already formatted (there are no changes).
-   */
-  void set edits(List<SourceEdit> value) {
-    assert(value != null);
-    this._edits = value;
-  }
-
-  /**
-   * The offset of the selection after formatting the code.
-   */
-  int get selectionOffset => _selectionOffset;
-
-  /**
-   * The offset of the selection after formatting the code.
-   */
-  void set selectionOffset(int value) {
-    assert(value != null);
-    this._selectionOffset = value;
-  }
-
-  /**
-   * The length of the selection after formatting the code.
-   */
-  int get selectionLength => _selectionLength;
-
-  /**
-   * The length of the selection after formatting the code.
-   */
-  void set selectionLength(int value) {
-    assert(value != null);
-    this._selectionLength = value;
-  }
-
-  EditFormatResult(List<SourceEdit> edits, int selectionOffset, int selectionLength) {
-    this.edits = edits;
-    this.selectionOffset = selectionOffset;
-    this.selectionLength = selectionLength;
-  }
-
-  factory EditFormatResult.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      List<SourceEdit> edits;
-      if (json.containsKey("edits")) {
-        edits = jsonDecoder._decodeList(jsonPath + ".edits", json["edits"], (String jsonPath, Object json) => new SourceEdit.fromJson(jsonDecoder, jsonPath, json));
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "edits");
-      }
-      int selectionOffset;
-      if (json.containsKey("selectionOffset")) {
-        selectionOffset = jsonDecoder._decodeInt(jsonPath + ".selectionOffset", json["selectionOffset"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "selectionOffset");
-      }
-      int selectionLength;
-      if (json.containsKey("selectionLength")) {
-        selectionLength = jsonDecoder._decodeInt(jsonPath + ".selectionLength", json["selectionLength"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "selectionLength");
-      }
-      return new EditFormatResult(edits, selectionOffset, selectionLength);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "edit.format result", json);
-    }
-  }
-
-  factory EditFormatResult.fromResponse(Response response) {
-    return new EditFormatResult.fromJson(
-        new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), "result", response._result);
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["edits"] = edits.map((SourceEdit value) => value.toJson()).toList();
-    result["selectionOffset"] = selectionOffset;
-    result["selectionLength"] = selectionLength;
-    return result;
-  }
-
-  Response toResponse(String id) {
-    return new Response(id, result: toJson());
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is EditFormatResult) {
-      return _listEqual(edits, other.edits, (SourceEdit a, SourceEdit b) => a == b) &&
-          selectionOffset == other.selectionOffset &&
-          selectionLength == other.selectionLength;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, edits.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, selectionOffset.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, selectionLength.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * edit.getAssists params
- *
- * {
- *   "file": FilePath
- *   "offset": int
- *   "length": int
- * }
- */
-class EditGetAssistsParams implements HasToJson {
-  String _file;
-
-  int _offset;
-
-  int _length;
-
-  /**
-   * The file containing the code for which assists are being requested.
-   */
-  String get file => _file;
-
-  /**
-   * The file containing the code for which assists are being requested.
-   */
-  void set file(String value) {
-    assert(value != null);
-    this._file = value;
-  }
-
-  /**
-   * The offset of the code for which assists are being requested.
-   */
-  int get offset => _offset;
-
-  /**
-   * The offset of the code for which assists are being requested.
-   */
-  void set offset(int value) {
-    assert(value != null);
-    this._offset = value;
-  }
-
-  /**
-   * The length of the code for which assists are being requested.
-   */
-  int get length => _length;
-
-  /**
-   * The length of the code for which assists are being requested.
-   */
-  void set length(int value) {
-    assert(value != null);
-    this._length = value;
-  }
-
-  EditGetAssistsParams(String file, int offset, int length) {
-    this.file = file;
-    this.offset = offset;
-    this.length = length;
-  }
-
-  factory EditGetAssistsParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      String file;
-      if (json.containsKey("file")) {
-        file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "file");
-      }
-      int offset;
-      if (json.containsKey("offset")) {
-        offset = jsonDecoder._decodeInt(jsonPath + ".offset", json["offset"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "offset");
-      }
-      int length;
-      if (json.containsKey("length")) {
-        length = jsonDecoder._decodeInt(jsonPath + ".length", json["length"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "length");
-      }
-      return new EditGetAssistsParams(file, offset, length);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "edit.getAssists params", json);
-    }
-  }
-
-  factory EditGetAssistsParams.fromRequest(Request request) {
-    return new EditGetAssistsParams.fromJson(
-        new RequestDecoder(request), "params", request._params);
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["file"] = file;
-    result["offset"] = offset;
-    result["length"] = length;
-    return result;
-  }
-
-  Request toRequest(String id) {
-    return new Request(id, "edit.getAssists", toJson());
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is EditGetAssistsParams) {
-      return file == other.file &&
-          offset == other.offset &&
-          length == other.length;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, file.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, offset.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, length.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * edit.getAssists result
- *
- * {
- *   "assists": List<SourceChange>
- * }
- */
-class EditGetAssistsResult implements HasToJson {
-  List<SourceChange> _assists;
-
-  /**
-   * The assists that are available at the given location.
-   */
-  List<SourceChange> get assists => _assists;
-
-  /**
-   * The assists that are available at the given location.
-   */
-  void set assists(List<SourceChange> value) {
-    assert(value != null);
-    this._assists = value;
-  }
-
-  EditGetAssistsResult(List<SourceChange> assists) {
-    this.assists = assists;
-  }
-
-  factory EditGetAssistsResult.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      List<SourceChange> assists;
-      if (json.containsKey("assists")) {
-        assists = jsonDecoder._decodeList(jsonPath + ".assists", json["assists"], (String jsonPath, Object json) => new SourceChange.fromJson(jsonDecoder, jsonPath, json));
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "assists");
-      }
-      return new EditGetAssistsResult(assists);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "edit.getAssists result", json);
-    }
-  }
-
-  factory EditGetAssistsResult.fromResponse(Response response) {
-    return new EditGetAssistsResult.fromJson(
-        new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), "result", response._result);
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["assists"] = assists.map((SourceChange value) => value.toJson()).toList();
-    return result;
-  }
-
-  Response toResponse(String id) {
-    return new Response(id, result: toJson());
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is EditGetAssistsResult) {
-      return _listEqual(assists, other.assists, (SourceChange a, SourceChange b) => a == b);
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, assists.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * edit.getAvailableRefactorings params
- *
- * {
- *   "file": FilePath
- *   "offset": int
- *   "length": int
- * }
- */
-class EditGetAvailableRefactoringsParams implements HasToJson {
-  String _file;
-
-  int _offset;
-
-  int _length;
-
-  /**
-   * The file containing the code on which the refactoring would be based.
-   */
-  String get file => _file;
-
-  /**
-   * The file containing the code on which the refactoring would be based.
-   */
-  void set file(String value) {
-    assert(value != null);
-    this._file = value;
-  }
-
-  /**
-   * The offset of the code on which the refactoring would be based.
-   */
-  int get offset => _offset;
-
-  /**
-   * The offset of the code on which the refactoring would be based.
-   */
-  void set offset(int value) {
-    assert(value != null);
-    this._offset = value;
-  }
-
-  /**
-   * The length of the code on which the refactoring would be based.
-   */
-  int get length => _length;
-
-  /**
-   * The length of the code on which the refactoring would be based.
-   */
-  void set length(int value) {
-    assert(value != null);
-    this._length = value;
-  }
-
-  EditGetAvailableRefactoringsParams(String file, int offset, int length) {
-    this.file = file;
-    this.offset = offset;
-    this.length = length;
-  }
-
-  factory EditGetAvailableRefactoringsParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      String file;
-      if (json.containsKey("file")) {
-        file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "file");
-      }
-      int offset;
-      if (json.containsKey("offset")) {
-        offset = jsonDecoder._decodeInt(jsonPath + ".offset", json["offset"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "offset");
-      }
-      int length;
-      if (json.containsKey("length")) {
-        length = jsonDecoder._decodeInt(jsonPath + ".length", json["length"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "length");
-      }
-      return new EditGetAvailableRefactoringsParams(file, offset, length);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "edit.getAvailableRefactorings params", json);
-    }
-  }
-
-  factory EditGetAvailableRefactoringsParams.fromRequest(Request request) {
-    return new EditGetAvailableRefactoringsParams.fromJson(
-        new RequestDecoder(request), "params", request._params);
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["file"] = file;
-    result["offset"] = offset;
-    result["length"] = length;
-    return result;
-  }
-
-  Request toRequest(String id) {
-    return new Request(id, "edit.getAvailableRefactorings", toJson());
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is EditGetAvailableRefactoringsParams) {
-      return file == other.file &&
-          offset == other.offset &&
-          length == other.length;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, file.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, offset.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, length.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * edit.getAvailableRefactorings result
- *
- * {
- *   "kinds": List<RefactoringKind>
- * }
- */
-class EditGetAvailableRefactoringsResult implements HasToJson {
-  List<RefactoringKind> _kinds;
-
-  /**
-   * The kinds of refactorings that are valid for the given selection.
-   */
-  List<RefactoringKind> get kinds => _kinds;
-
-  /**
-   * The kinds of refactorings that are valid for the given selection.
-   */
-  void set kinds(List<RefactoringKind> value) {
-    assert(value != null);
-    this._kinds = value;
-  }
-
-  EditGetAvailableRefactoringsResult(List<RefactoringKind> kinds) {
-    this.kinds = kinds;
-  }
-
-  factory EditGetAvailableRefactoringsResult.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      List<RefactoringKind> kinds;
-      if (json.containsKey("kinds")) {
-        kinds = jsonDecoder._decodeList(jsonPath + ".kinds", json["kinds"], (String jsonPath, Object json) => new RefactoringKind.fromJson(jsonDecoder, jsonPath, json));
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "kinds");
-      }
-      return new EditGetAvailableRefactoringsResult(kinds);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "edit.getAvailableRefactorings result", json);
-    }
-  }
-
-  factory EditGetAvailableRefactoringsResult.fromResponse(Response response) {
-    return new EditGetAvailableRefactoringsResult.fromJson(
-        new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), "result", response._result);
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["kinds"] = kinds.map((RefactoringKind value) => value.toJson()).toList();
-    return result;
-  }
-
-  Response toResponse(String id) {
-    return new Response(id, result: toJson());
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is EditGetAvailableRefactoringsResult) {
-      return _listEqual(kinds, other.kinds, (RefactoringKind a, RefactoringKind b) => a == b);
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, kinds.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * edit.getFixes params
- *
- * {
- *   "file": FilePath
- *   "offset": int
- * }
- */
-class EditGetFixesParams implements HasToJson {
-  String _file;
-
-  int _offset;
-
-  /**
-   * The file containing the errors for which fixes are being requested.
-   */
-  String get file => _file;
-
-  /**
-   * The file containing the errors for which fixes are being requested.
-   */
-  void set file(String value) {
-    assert(value != null);
-    this._file = value;
-  }
-
-  /**
-   * The offset used to select the errors for which fixes will be returned.
-   */
-  int get offset => _offset;
-
-  /**
-   * The offset used to select the errors for which fixes will be returned.
-   */
-  void set offset(int value) {
-    assert(value != null);
-    this._offset = value;
-  }
-
-  EditGetFixesParams(String file, int offset) {
-    this.file = file;
-    this.offset = offset;
-  }
-
-  factory EditGetFixesParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      String file;
-      if (json.containsKey("file")) {
-        file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "file");
-      }
-      int offset;
-      if (json.containsKey("offset")) {
-        offset = jsonDecoder._decodeInt(jsonPath + ".offset", json["offset"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "offset");
-      }
-      return new EditGetFixesParams(file, offset);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "edit.getFixes params", json);
-    }
-  }
-
-  factory EditGetFixesParams.fromRequest(Request request) {
-    return new EditGetFixesParams.fromJson(
-        new RequestDecoder(request), "params", request._params);
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["file"] = file;
-    result["offset"] = offset;
-    return result;
-  }
-
-  Request toRequest(String id) {
-    return new Request(id, "edit.getFixes", toJson());
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is EditGetFixesParams) {
-      return file == other.file &&
-          offset == other.offset;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, file.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, offset.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * edit.getFixes result
- *
- * {
- *   "fixes": List<AnalysisErrorFixes>
- * }
- */
-class EditGetFixesResult implements HasToJson {
-  List<AnalysisErrorFixes> _fixes;
-
-  /**
-   * The fixes that are available for the errors at the given offset.
-   */
-  List<AnalysisErrorFixes> get fixes => _fixes;
-
-  /**
-   * The fixes that are available for the errors at the given offset.
-   */
-  void set fixes(List<AnalysisErrorFixes> value) {
-    assert(value != null);
-    this._fixes = value;
-  }
-
-  EditGetFixesResult(List<AnalysisErrorFixes> fixes) {
-    this.fixes = fixes;
-  }
-
-  factory EditGetFixesResult.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      List<AnalysisErrorFixes> fixes;
-      if (json.containsKey("fixes")) {
-        fixes = jsonDecoder._decodeList(jsonPath + ".fixes", json["fixes"], (String jsonPath, Object json) => new AnalysisErrorFixes.fromJson(jsonDecoder, jsonPath, json));
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "fixes");
-      }
-      return new EditGetFixesResult(fixes);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "edit.getFixes result", json);
-    }
-  }
-
-  factory EditGetFixesResult.fromResponse(Response response) {
-    return new EditGetFixesResult.fromJson(
-        new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), "result", response._result);
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["fixes"] = fixes.map((AnalysisErrorFixes value) => value.toJson()).toList();
-    return result;
-  }
-
-  Response toResponse(String id) {
-    return new Response(id, result: toJson());
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is EditGetFixesResult) {
-      return _listEqual(fixes, other.fixes, (AnalysisErrorFixes a, AnalysisErrorFixes b) => a == b);
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, fixes.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * edit.getRefactoring params
- *
- * {
- *   "kind": RefactoringKind
- *   "file": FilePath
- *   "offset": int
- *   "length": int
- *   "validateOnly": bool
- *   "options": optional RefactoringOptions
- * }
- */
-class EditGetRefactoringParams implements HasToJson {
-  RefactoringKind _kind;
-
-  String _file;
-
-  int _offset;
-
-  int _length;
-
-  bool _validateOnly;
-
-  RefactoringOptions _options;
-
-  /**
-   * The kind of refactoring to be performed.
-   */
-  RefactoringKind get kind => _kind;
-
-  /**
-   * The kind of refactoring to be performed.
-   */
-  void set kind(RefactoringKind value) {
-    assert(value != null);
-    this._kind = value;
-  }
-
-  /**
-   * The file containing the code involved in the refactoring.
-   */
-  String get file => _file;
-
-  /**
-   * The file containing the code involved in the refactoring.
-   */
-  void set file(String value) {
-    assert(value != null);
-    this._file = value;
-  }
-
-  /**
-   * The offset of the region involved in the refactoring.
-   */
-  int get offset => _offset;
-
-  /**
-   * The offset of the region involved in the refactoring.
-   */
-  void set offset(int value) {
-    assert(value != null);
-    this._offset = value;
-  }
-
-  /**
-   * The length of the region involved in the refactoring.
-   */
-  int get length => _length;
-
-  /**
-   * The length of the region involved in the refactoring.
-   */
-  void set length(int value) {
-    assert(value != null);
-    this._length = value;
-  }
-
-  /**
-   * True if the client is only requesting that the values of the options be
-   * validated and no change be generated.
-   */
-  bool get validateOnly => _validateOnly;
-
-  /**
-   * True if the client is only requesting that the values of the options be
-   * validated and no change be generated.
-   */
-  void set validateOnly(bool value) {
-    assert(value != null);
-    this._validateOnly = value;
-  }
-
-  /**
-   * Data used to provide values provided by the user. The structure of the
-   * data is dependent on the kind of refactoring being performed. The data
-   * that is expected is documented in the section titled Refactorings, labeled
-   * as “Options”. This field can be omitted if the refactoring does not
-   * require any options or if the values of those options are not known.
-   */
-  RefactoringOptions get options => _options;
-
-  /**
-   * Data used to provide values provided by the user. The structure of the
-   * data is dependent on the kind of refactoring being performed. The data
-   * that is expected is documented in the section titled Refactorings, labeled
-   * as “Options”. This field can be omitted if the refactoring does not
-   * require any options or if the values of those options are not known.
-   */
-  void set options(RefactoringOptions value) {
-    this._options = value;
-  }
-
-  EditGetRefactoringParams(RefactoringKind kind, String file, int offset, int length, bool validateOnly, {RefactoringOptions options}) {
-    this.kind = kind;
-    this.file = file;
-    this.offset = offset;
-    this.length = length;
-    this.validateOnly = validateOnly;
-    this.options = options;
-  }
-
-  factory EditGetRefactoringParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      RefactoringKind kind;
-      if (json.containsKey("kind")) {
-        kind = new RefactoringKind.fromJson(jsonDecoder, jsonPath + ".kind", json["kind"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "kind");
-      }
-      String file;
-      if (json.containsKey("file")) {
-        file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "file");
-      }
-      int offset;
-      if (json.containsKey("offset")) {
-        offset = jsonDecoder._decodeInt(jsonPath + ".offset", json["offset"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "offset");
-      }
-      int length;
-      if (json.containsKey("length")) {
-        length = jsonDecoder._decodeInt(jsonPath + ".length", json["length"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "length");
-      }
-      bool validateOnly;
-      if (json.containsKey("validateOnly")) {
-        validateOnly = jsonDecoder._decodeBool(jsonPath + ".validateOnly", json["validateOnly"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "validateOnly");
-      }
-      RefactoringOptions options;
-      if (json.containsKey("options")) {
-        options = new RefactoringOptions.fromJson(jsonDecoder, jsonPath + ".options", json["options"], kind);
-      }
-      return new EditGetRefactoringParams(kind, file, offset, length, validateOnly, options: options);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "edit.getRefactoring params", json);
-    }
-  }
-
-  factory EditGetRefactoringParams.fromRequest(Request request) {
-    var params = new EditGetRefactoringParams.fromJson(
-        new RequestDecoder(request), "params", request._params);
-    REQUEST_ID_REFACTORING_KINDS[request.id] = params.kind;
-    return params;
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["kind"] = kind.toJson();
-    result["file"] = file;
-    result["offset"] = offset;
-    result["length"] = length;
-    result["validateOnly"] = validateOnly;
-    if (options != null) {
-      result["options"] = options.toJson();
-    }
-    return result;
-  }
-
-  Request toRequest(String id) {
-    return new Request(id, "edit.getRefactoring", toJson());
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is EditGetRefactoringParams) {
-      return kind == other.kind &&
-          file == other.file &&
-          offset == other.offset &&
-          length == other.length &&
-          validateOnly == other.validateOnly &&
-          options == other.options;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, kind.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, file.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, offset.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, length.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, validateOnly.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, options.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * edit.getRefactoring result
- *
- * {
- *   "initialProblems": List<RefactoringProblem>
- *   "optionsProblems": List<RefactoringProblem>
- *   "finalProblems": List<RefactoringProblem>
- *   "feedback": optional RefactoringFeedback
- *   "change": optional SourceChange
- *   "potentialEdits": optional List<String>
- * }
- */
-class EditGetRefactoringResult implements HasToJson {
-  List<RefactoringProblem> _initialProblems;
-
-  List<RefactoringProblem> _optionsProblems;
-
-  List<RefactoringProblem> _finalProblems;
-
-  RefactoringFeedback _feedback;
-
-  SourceChange _change;
-
-  List<String> _potentialEdits;
-
-  /**
-   * The initial status of the refactoring, i.e. problems related to the
-   * context in which the refactoring is requested. The array will be empty if
-   * there are no known problems.
-   */
-  List<RefactoringProblem> get initialProblems => _initialProblems;
-
-  /**
-   * The initial status of the refactoring, i.e. problems related to the
-   * context in which the refactoring is requested. The array will be empty if
-   * there are no known problems.
-   */
-  void set initialProblems(List<RefactoringProblem> value) {
-    assert(value != null);
-    this._initialProblems = value;
-  }
-
-  /**
-   * The options validation status, i.e. problems in the given options, such as
-   * light-weight validation of a new name, flags compatibility, etc. The array
-   * will be empty if there are no known problems.
-   */
-  List<RefactoringProblem> get optionsProblems => _optionsProblems;
-
-  /**
-   * The options validation status, i.e. problems in the given options, such as
-   * light-weight validation of a new name, flags compatibility, etc. The array
-   * will be empty if there are no known problems.
-   */
-  void set optionsProblems(List<RefactoringProblem> value) {
-    assert(value != null);
-    this._optionsProblems = value;
-  }
-
-  /**
-   * The final status of the refactoring, i.e. problems identified in the
-   * result of a full, potentially expensive validation and / or change
-   * creation. The array will be empty if there are no known problems.
-   */
-  List<RefactoringProblem> get finalProblems => _finalProblems;
-
-  /**
-   * The final status of the refactoring, i.e. problems identified in the
-   * result of a full, potentially expensive validation and / or change
-   * creation. The array will be empty if there are no known problems.
-   */
-  void set finalProblems(List<RefactoringProblem> value) {
-    assert(value != null);
-    this._finalProblems = value;
-  }
-
-  /**
-   * Data used to provide feedback to the user. The structure of the data is
-   * dependent on the kind of refactoring being created. The data that is
-   * returned is documented in the section titled Refactorings, labeled as
-   * “Feedback”.
-   */
-  RefactoringFeedback get feedback => _feedback;
-
-  /**
-   * Data used to provide feedback to the user. The structure of the data is
-   * dependent on the kind of refactoring being created. The data that is
-   * returned is documented in the section titled Refactorings, labeled as
-   * “Feedback”.
-   */
-  void set feedback(RefactoringFeedback value) {
-    this._feedback = value;
-  }
-
-  /**
-   * The changes that are to be applied to affect the refactoring. This field
-   * will be omitted if there are problems that prevent a set of changes from
-   * being computed, such as having no options specified for a refactoring that
-   * requires them, or if only validation was requested.
-   */
-  SourceChange get change => _change;
-
-  /**
-   * The changes that are to be applied to affect the refactoring. This field
-   * will be omitted if there are problems that prevent a set of changes from
-   * being computed, such as having no options specified for a refactoring that
-   * requires them, or if only validation was requested.
-   */
-  void set change(SourceChange value) {
-    this._change = value;
-  }
-
-  /**
-   * The ids of source edits that are not known to be valid. An edit is not
-   * known to be valid if there was insufficient type information for the
-   * server to be able to determine whether or not the code needs to be
-   * modified, such as when a member is being renamed and there is a reference
-   * to a member from an unknown type. This field will be omitted if the change
-   * field is omitted or if there are no potential edits for the refactoring.
-   */
-  List<String> get potentialEdits => _potentialEdits;
-
-  /**
-   * The ids of source edits that are not known to be valid. An edit is not
-   * known to be valid if there was insufficient type information for the
-   * server to be able to determine whether or not the code needs to be
-   * modified, such as when a member is being renamed and there is a reference
-   * to a member from an unknown type. This field will be omitted if the change
-   * field is omitted or if there are no potential edits for the refactoring.
-   */
-  void set potentialEdits(List<String> value) {
-    this._potentialEdits = value;
-  }
-
-  EditGetRefactoringResult(List<RefactoringProblem> initialProblems, List<RefactoringProblem> optionsProblems, List<RefactoringProblem> finalProblems, {RefactoringFeedback feedback, SourceChange change, List<String> potentialEdits}) {
-    this.initialProblems = initialProblems;
-    this.optionsProblems = optionsProblems;
-    this.finalProblems = finalProblems;
-    this.feedback = feedback;
-    this.change = change;
-    this.potentialEdits = potentialEdits;
-  }
-
-  factory EditGetRefactoringResult.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      List<RefactoringProblem> initialProblems;
-      if (json.containsKey("initialProblems")) {
-        initialProblems = jsonDecoder._decodeList(jsonPath + ".initialProblems", json["initialProblems"], (String jsonPath, Object json) => new RefactoringProblem.fromJson(jsonDecoder, jsonPath, json));
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "initialProblems");
-      }
-      List<RefactoringProblem> optionsProblems;
-      if (json.containsKey("optionsProblems")) {
-        optionsProblems = jsonDecoder._decodeList(jsonPath + ".optionsProblems", json["optionsProblems"], (String jsonPath, Object json) => new RefactoringProblem.fromJson(jsonDecoder, jsonPath, json));
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "optionsProblems");
-      }
-      List<RefactoringProblem> finalProblems;
-      if (json.containsKey("finalProblems")) {
-        finalProblems = jsonDecoder._decodeList(jsonPath + ".finalProblems", json["finalProblems"], (String jsonPath, Object json) => new RefactoringProblem.fromJson(jsonDecoder, jsonPath, json));
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "finalProblems");
-      }
-      RefactoringFeedback feedback;
-      if (json.containsKey("feedback")) {
-        feedback = new RefactoringFeedback.fromJson(jsonDecoder, jsonPath + ".feedback", json["feedback"], json);
-      }
-      SourceChange change;
-      if (json.containsKey("change")) {
-        change = new SourceChange.fromJson(jsonDecoder, jsonPath + ".change", json["change"]);
-      }
-      List<String> potentialEdits;
-      if (json.containsKey("potentialEdits")) {
-        potentialEdits = jsonDecoder._decodeList(jsonPath + ".potentialEdits", json["potentialEdits"], jsonDecoder._decodeString);
-      }
-      return new EditGetRefactoringResult(initialProblems, optionsProblems, finalProblems, feedback: feedback, change: change, potentialEdits: potentialEdits);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "edit.getRefactoring result", json);
-    }
-  }
-
-  factory EditGetRefactoringResult.fromResponse(Response response) {
-    return new EditGetRefactoringResult.fromJson(
-        new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), "result", response._result);
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["initialProblems"] = initialProblems.map((RefactoringProblem value) => value.toJson()).toList();
-    result["optionsProblems"] = optionsProblems.map((RefactoringProblem value) => value.toJson()).toList();
-    result["finalProblems"] = finalProblems.map((RefactoringProblem value) => value.toJson()).toList();
-    if (feedback != null) {
-      result["feedback"] = feedback.toJson();
-    }
-    if (change != null) {
-      result["change"] = change.toJson();
-    }
-    if (potentialEdits != null) {
-      result["potentialEdits"] = potentialEdits;
-    }
-    return result;
-  }
-
-  Response toResponse(String id) {
-    return new Response(id, result: toJson());
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is EditGetRefactoringResult) {
-      return _listEqual(initialProblems, other.initialProblems, (RefactoringProblem a, RefactoringProblem b) => a == b) &&
-          _listEqual(optionsProblems, other.optionsProblems, (RefactoringProblem a, RefactoringProblem b) => a == b) &&
-          _listEqual(finalProblems, other.finalProblems, (RefactoringProblem a, RefactoringProblem b) => a == b) &&
-          feedback == other.feedback &&
-          change == other.change &&
-          _listEqual(potentialEdits, other.potentialEdits, (String a, String b) => a == b);
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, initialProblems.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, optionsProblems.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, finalProblems.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, feedback.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, change.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, potentialEdits.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * edit.sortMembers params
- *
- * {
- *   "file": FilePath
- * }
- */
-class EditSortMembersParams implements HasToJson {
-  String _file;
-
-  /**
-   * The Dart file to sort.
-   */
-  String get file => _file;
-
-  /**
-   * The Dart file to sort.
-   */
-  void set file(String value) {
-    assert(value != null);
-    this._file = value;
-  }
-
-  EditSortMembersParams(String file) {
-    this.file = file;
-  }
-
-  factory EditSortMembersParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      String file;
-      if (json.containsKey("file")) {
-        file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "file");
-      }
-      return new EditSortMembersParams(file);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "edit.sortMembers params", json);
-    }
-  }
-
-  factory EditSortMembersParams.fromRequest(Request request) {
-    return new EditSortMembersParams.fromJson(
-        new RequestDecoder(request), "params", request._params);
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["file"] = file;
-    return result;
-  }
-
-  Request toRequest(String id) {
-    return new Request(id, "edit.sortMembers", toJson());
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is EditSortMembersParams) {
-      return file == other.file;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, file.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * edit.sortMembers result
- *
- * {
- *   "edit": SourceFileEdit
- * }
- */
-class EditSortMembersResult implements HasToJson {
-  SourceFileEdit _edit;
-
-  /**
-   * The file edit that is to be applied to the given file to effect the
-   * sorting.
-   */
-  SourceFileEdit get edit => _edit;
-
-  /**
-   * The file edit that is to be applied to the given file to effect the
-   * sorting.
-   */
-  void set edit(SourceFileEdit value) {
-    assert(value != null);
-    this._edit = value;
-  }
-
-  EditSortMembersResult(SourceFileEdit edit) {
-    this.edit = edit;
-  }
-
-  factory EditSortMembersResult.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      SourceFileEdit edit;
-      if (json.containsKey("edit")) {
-        edit = new SourceFileEdit.fromJson(jsonDecoder, jsonPath + ".edit", json["edit"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "edit");
-      }
-      return new EditSortMembersResult(edit);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "edit.sortMembers result", json);
-    }
-  }
-
-  factory EditSortMembersResult.fromResponse(Response response) {
-    return new EditSortMembersResult.fromJson(
-        new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), "result", response._result);
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["edit"] = edit.toJson();
-    return result;
-  }
-
-  Response toResponse(String id) {
-    return new Response(id, result: toJson());
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is EditSortMembersResult) {
-      return edit == other.edit;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, edit.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * edit.organizeDirectives params
- *
- * {
- *   "file": FilePath
- * }
- */
-class EditOrganizeDirectivesParams implements HasToJson {
-  String _file;
-
-  /**
-   * The Dart file to organize directives in.
-   */
-  String get file => _file;
-
-  /**
-   * The Dart file to organize directives in.
-   */
-  void set file(String value) {
-    assert(value != null);
-    this._file = value;
-  }
-
-  EditOrganizeDirectivesParams(String file) {
-    this.file = file;
-  }
-
-  factory EditOrganizeDirectivesParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      String file;
-      if (json.containsKey("file")) {
-        file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "file");
-      }
-      return new EditOrganizeDirectivesParams(file);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "edit.organizeDirectives params", json);
-    }
-  }
-
-  factory EditOrganizeDirectivesParams.fromRequest(Request request) {
-    return new EditOrganizeDirectivesParams.fromJson(
-        new RequestDecoder(request), "params", request._params);
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["file"] = file;
-    return result;
-  }
-
-  Request toRequest(String id) {
-    return new Request(id, "edit.organizeDirectives", toJson());
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is EditOrganizeDirectivesParams) {
-      return file == other.file;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, file.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * edit.organizeDirectives result
- *
- * {
- *   "edit": SourceFileEdit
- * }
- */
-class EditOrganizeDirectivesResult implements HasToJson {
-  SourceFileEdit _edit;
-
-  /**
-   * The file edit that is to be applied to the given file to effect the
-   * organizing.
-   */
-  SourceFileEdit get edit => _edit;
-
-  /**
-   * The file edit that is to be applied to the given file to effect the
-   * organizing.
-   */
-  void set edit(SourceFileEdit value) {
-    assert(value != null);
-    this._edit = value;
-  }
-
-  EditOrganizeDirectivesResult(SourceFileEdit edit) {
-    this.edit = edit;
-  }
-
-  factory EditOrganizeDirectivesResult.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      SourceFileEdit edit;
-      if (json.containsKey("edit")) {
-        edit = new SourceFileEdit.fromJson(jsonDecoder, jsonPath + ".edit", json["edit"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "edit");
-      }
-      return new EditOrganizeDirectivesResult(edit);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "edit.organizeDirectives result", json);
-    }
-  }
-
-  factory EditOrganizeDirectivesResult.fromResponse(Response response) {
-    return new EditOrganizeDirectivesResult.fromJson(
-        new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), "result", response._result);
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["edit"] = edit.toJson();
-    return result;
-  }
-
-  Response toResponse(String id) {
-    return new Response(id, result: toJson());
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is EditOrganizeDirectivesResult) {
-      return edit == other.edit;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, edit.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * execution.createContext params
- *
- * {
- *   "contextRoot": FilePath
- * }
- */
-class ExecutionCreateContextParams implements HasToJson {
-  String _contextRoot;
-
-  /**
-   * The path of the Dart or HTML file that will be launched, or the path of
-   * the directory containing the file.
-   */
-  String get contextRoot => _contextRoot;
-
-  /**
-   * The path of the Dart or HTML file that will be launched, or the path of
-   * the directory containing the file.
-   */
-  void set contextRoot(String value) {
-    assert(value != null);
-    this._contextRoot = value;
-  }
-
-  ExecutionCreateContextParams(String contextRoot) {
-    this.contextRoot = contextRoot;
-  }
-
-  factory ExecutionCreateContextParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      String contextRoot;
-      if (json.containsKey("contextRoot")) {
-        contextRoot = jsonDecoder._decodeString(jsonPath + ".contextRoot", json["contextRoot"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "contextRoot");
-      }
-      return new ExecutionCreateContextParams(contextRoot);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "execution.createContext params", json);
-    }
-  }
-
-  factory ExecutionCreateContextParams.fromRequest(Request request) {
-    return new ExecutionCreateContextParams.fromJson(
-        new RequestDecoder(request), "params", request._params);
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["contextRoot"] = contextRoot;
-    return result;
-  }
-
-  Request toRequest(String id) {
-    return new Request(id, "execution.createContext", toJson());
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is ExecutionCreateContextParams) {
-      return contextRoot == other.contextRoot;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, contextRoot.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * execution.createContext result
- *
- * {
- *   "id": ExecutionContextId
- * }
- */
-class ExecutionCreateContextResult implements HasToJson {
-  String _id;
-
-  /**
-   * The identifier used to refer to the execution context that was created.
-   */
-  String get id => _id;
-
-  /**
-   * The identifier used to refer to the execution context that was created.
-   */
-  void set id(String value) {
-    assert(value != null);
-    this._id = value;
-  }
-
-  ExecutionCreateContextResult(String id) {
-    this.id = id;
-  }
-
-  factory ExecutionCreateContextResult.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      String id;
-      if (json.containsKey("id")) {
-        id = jsonDecoder._decodeString(jsonPath + ".id", json["id"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "id");
-      }
-      return new ExecutionCreateContextResult(id);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "execution.createContext result", json);
-    }
-  }
-
-  factory ExecutionCreateContextResult.fromResponse(Response response) {
-    return new ExecutionCreateContextResult.fromJson(
-        new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), "result", response._result);
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["id"] = id;
-    return result;
-  }
-
-  Response toResponse(String id) {
-    return new Response(id, result: toJson());
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is ExecutionCreateContextResult) {
-      return id == other.id;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, id.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * execution.deleteContext params
- *
- * {
- *   "id": ExecutionContextId
- * }
- */
-class ExecutionDeleteContextParams implements HasToJson {
-  String _id;
-
-  /**
-   * The identifier of the execution context that is to be deleted.
-   */
-  String get id => _id;
-
-  /**
-   * The identifier of the execution context that is to be deleted.
-   */
-  void set id(String value) {
-    assert(value != null);
-    this._id = value;
-  }
-
-  ExecutionDeleteContextParams(String id) {
-    this.id = id;
-  }
-
-  factory ExecutionDeleteContextParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      String id;
-      if (json.containsKey("id")) {
-        id = jsonDecoder._decodeString(jsonPath + ".id", json["id"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "id");
-      }
-      return new ExecutionDeleteContextParams(id);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "execution.deleteContext params", json);
-    }
-  }
-
-  factory ExecutionDeleteContextParams.fromRequest(Request request) {
-    return new ExecutionDeleteContextParams.fromJson(
-        new RequestDecoder(request), "params", request._params);
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["id"] = id;
-    return result;
-  }
-
-  Request toRequest(String id) {
-    return new Request(id, "execution.deleteContext", toJson());
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is ExecutionDeleteContextParams) {
-      return id == other.id;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, id.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-/**
- * execution.deleteContext result
- */
-class ExecutionDeleteContextResult {
-  Response toResponse(String id) {
-    return new Response(id, result: null);
-  }
-
-  @override
-  bool operator==(other) {
-    if (other is ExecutionDeleteContextResult) {
-      return true;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    return 479954425;
-  }
-}
-
-/**
- * execution.mapUri params
- *
- * {
- *   "id": ExecutionContextId
- *   "file": optional FilePath
- *   "uri": optional String
- * }
- */
-class ExecutionMapUriParams implements HasToJson {
-  String _id;
-
-  String _file;
-
-  String _uri;
-
-  /**
-   * The identifier of the execution context in which the URI is to be mapped.
-   */
-  String get id => _id;
-
-  /**
-   * The identifier of the execution context in which the URI is to be mapped.
-   */
-  void set id(String value) {
-    assert(value != null);
-    this._id = value;
-  }
-
-  /**
-   * The path of the file to be mapped into a URI.
-   */
-  String get file => _file;
-
-  /**
-   * The path of the file to be mapped into a URI.
-   */
-  void set file(String value) {
-    this._file = value;
-  }
-
-  /**
-   * The URI to be mapped into a file path.
-   */
-  String get uri => _uri;
-
-  /**
-   * The URI to be mapped into a file path.
-   */
-  void set uri(String value) {
-    this._uri = value;
-  }
-
-  ExecutionMapUriParams(String id, {String file, String uri}) {
-    this.id = id;
-    this.file = file;
-    this.uri = uri;
-  }
-
-  factory ExecutionMapUriParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      String id;
-      if (json.containsKey("id")) {
-        id = jsonDecoder._decodeString(jsonPath + ".id", json["id"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "id");
-      }
-      String file;
-      if (json.containsKey("file")) {
-        file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]);
-      }
-      String uri;
-      if (json.containsKey("uri")) {
-        uri = jsonDecoder._decodeString(jsonPath + ".uri", json["uri"]);
-      }
-      return new ExecutionMapUriParams(id, file: file, uri: uri);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "execution.mapUri params", json);
-    }
-  }
-
-  factory ExecutionMapUriParams.fromRequest(Request request) {
-    return new ExecutionMapUriParams.fromJson(
-        new RequestDecoder(request), "params", request._params);
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["id"] = id;
-    if (file != null) {
-      result["file"] = file;
-    }
-    if (uri != null) {
-      result["uri"] = uri;
-    }
-    return result;
-  }
-
-  Request toRequest(String id) {
-    return new Request(id, "execution.mapUri", toJson());
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is ExecutionMapUriParams) {
-      return id == other.id &&
-          file == other.file &&
-          uri == other.uri;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, id.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, file.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, uri.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * execution.mapUri result
- *
- * {
- *   "file": optional FilePath
- *   "uri": optional String
- * }
- */
-class ExecutionMapUriResult implements HasToJson {
-  String _file;
-
-  String _uri;
-
-  /**
-   * The file to which the URI was mapped. This field is omitted if the uri
-   * field was not given in the request.
-   */
-  String get file => _file;
-
-  /**
-   * The file to which the URI was mapped. This field is omitted if the uri
-   * field was not given in the request.
-   */
-  void set file(String value) {
-    this._file = value;
-  }
-
-  /**
-   * The URI to which the file path was mapped. This field is omitted if the
-   * file field was not given in the request.
-   */
-  String get uri => _uri;
-
-  /**
-   * The URI to which the file path was mapped. This field is omitted if the
-   * file field was not given in the request.
-   */
-  void set uri(String value) {
-    this._uri = value;
-  }
-
-  ExecutionMapUriResult({String file, String uri}) {
-    this.file = file;
-    this.uri = uri;
-  }
-
-  factory ExecutionMapUriResult.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      String file;
-      if (json.containsKey("file")) {
-        file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]);
-      }
-      String uri;
-      if (json.containsKey("uri")) {
-        uri = jsonDecoder._decodeString(jsonPath + ".uri", json["uri"]);
-      }
-      return new ExecutionMapUriResult(file: file, uri: uri);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "execution.mapUri result", json);
-    }
-  }
-
-  factory ExecutionMapUriResult.fromResponse(Response response) {
-    return new ExecutionMapUriResult.fromJson(
-        new ResponseDecoder(REQUEST_ID_REFACTORING_KINDS.remove(response.id)), "result", response._result);
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    if (file != null) {
-      result["file"] = file;
-    }
-    if (uri != null) {
-      result["uri"] = uri;
-    }
-    return result;
-  }
-
-  Response toResponse(String id) {
-    return new Response(id, result: toJson());
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is ExecutionMapUriResult) {
-      return file == other.file &&
-          uri == other.uri;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, file.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, uri.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * execution.setSubscriptions params
- *
- * {
- *   "subscriptions": List<ExecutionService>
- * }
- */
-class ExecutionSetSubscriptionsParams implements HasToJson {
-  List<ExecutionService> _subscriptions;
-
-  /**
-   * A list of the services being subscribed to.
-   */
-  List<ExecutionService> get subscriptions => _subscriptions;
-
-  /**
-   * A list of the services being subscribed to.
-   */
-  void set subscriptions(List<ExecutionService> value) {
-    assert(value != null);
-    this._subscriptions = value;
-  }
-
-  ExecutionSetSubscriptionsParams(List<ExecutionService> subscriptions) {
-    this.subscriptions = subscriptions;
-  }
-
-  factory ExecutionSetSubscriptionsParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      List<ExecutionService> subscriptions;
-      if (json.containsKey("subscriptions")) {
-        subscriptions = jsonDecoder._decodeList(jsonPath + ".subscriptions", json["subscriptions"], (String jsonPath, Object json) => new ExecutionService.fromJson(jsonDecoder, jsonPath, json));
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "subscriptions");
-      }
-      return new ExecutionSetSubscriptionsParams(subscriptions);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "execution.setSubscriptions params", json);
-    }
-  }
-
-  factory ExecutionSetSubscriptionsParams.fromRequest(Request request) {
-    return new ExecutionSetSubscriptionsParams.fromJson(
-        new RequestDecoder(request), "params", request._params);
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["subscriptions"] = subscriptions.map((ExecutionService value) => value.toJson()).toList();
-    return result;
-  }
-
-  Request toRequest(String id) {
-    return new Request(id, "execution.setSubscriptions", toJson());
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is ExecutionSetSubscriptionsParams) {
-      return _listEqual(subscriptions, other.subscriptions, (ExecutionService a, ExecutionService b) => a == b);
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, subscriptions.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-/**
- * execution.setSubscriptions result
- */
-class ExecutionSetSubscriptionsResult {
-  Response toResponse(String id) {
-    return new Response(id, result: null);
-  }
-
-  @override
-  bool operator==(other) {
-    if (other is ExecutionSetSubscriptionsResult) {
-      return true;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    return 287678780;
-  }
-}
-
-/**
- * execution.launchData params
- *
- * {
- *   "file": FilePath
- *   "kind": optional ExecutableKind
- *   "referencedFiles": optional List<FilePath>
- * }
- */
-class ExecutionLaunchDataParams implements HasToJson {
-  String _file;
-
-  ExecutableKind _kind;
-
-  List<String> _referencedFiles;
-
-  /**
-   * The file for which launch data is being provided. This will either be a
-   * Dart library or an HTML file.
-   */
-  String get file => _file;
-
-  /**
-   * The file for which launch data is being provided. This will either be a
-   * Dart library or an HTML file.
-   */
-  void set file(String value) {
-    assert(value != null);
-    this._file = value;
-  }
-
-  /**
-   * The kind of the executable file. This field is omitted if the file is not
-   * a Dart file.
-   */
-  ExecutableKind get kind => _kind;
-
-  /**
-   * The kind of the executable file. This field is omitted if the file is not
-   * a Dart file.
-   */
-  void set kind(ExecutableKind value) {
-    this._kind = value;
-  }
-
-  /**
-   * A list of the Dart files that are referenced by the file. This field is
-   * omitted if the file is not an HTML file.
-   */
-  List<String> get referencedFiles => _referencedFiles;
-
-  /**
-   * A list of the Dart files that are referenced by the file. This field is
-   * omitted if the file is not an HTML file.
-   */
-  void set referencedFiles(List<String> value) {
-    this._referencedFiles = value;
-  }
-
-  ExecutionLaunchDataParams(String file, {ExecutableKind kind, List<String> referencedFiles}) {
-    this.file = file;
-    this.kind = kind;
-    this.referencedFiles = referencedFiles;
-  }
-
-  factory ExecutionLaunchDataParams.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      String file;
-      if (json.containsKey("file")) {
-        file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "file");
-      }
-      ExecutableKind kind;
-      if (json.containsKey("kind")) {
-        kind = new ExecutableKind.fromJson(jsonDecoder, jsonPath + ".kind", json["kind"]);
-      }
-      List<String> referencedFiles;
-      if (json.containsKey("referencedFiles")) {
-        referencedFiles = jsonDecoder._decodeList(jsonPath + ".referencedFiles", json["referencedFiles"], jsonDecoder._decodeString);
-      }
-      return new ExecutionLaunchDataParams(file, kind: kind, referencedFiles: referencedFiles);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "execution.launchData params", json);
-    }
-  }
-
-  factory ExecutionLaunchDataParams.fromNotification(Notification notification) {
-    return new ExecutionLaunchDataParams.fromJson(
-        new ResponseDecoder(null), "params", notification._params);
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["file"] = file;
-    if (kind != null) {
-      result["kind"] = kind.toJson();
-    }
-    if (referencedFiles != null) {
-      result["referencedFiles"] = referencedFiles;
-    }
-    return result;
-  }
-
-  Notification toNotification() {
-    return new Notification("execution.launchData", toJson());
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is ExecutionLaunchDataParams) {
-      return file == other.file &&
-          kind == other.kind &&
-          _listEqual(referencedFiles, other.referencedFiles, (String a, String b) => a == b);
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, file.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, kind.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, referencedFiles.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * AddContentOverlay
- *
- * {
- *   "type": "add"
- *   "content": String
- * }
- */
-class AddContentOverlay implements HasToJson {
-  String _content;
-
-  /**
-   * The new content of the file.
-   */
-  String get content => _content;
-
-  /**
-   * The new content of the file.
-   */
-  void set content(String value) {
-    assert(value != null);
-    this._content = value;
-  }
-
-  AddContentOverlay(String content) {
-    this.content = content;
-  }
-
-  factory AddContentOverlay.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      if (json["type"] != "add") {
-        throw jsonDecoder.mismatch(jsonPath, "equal " + "add", json);
-      }
-      String content;
-      if (json.containsKey("content")) {
-        content = jsonDecoder._decodeString(jsonPath + ".content", json["content"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "content");
-      }
-      return new AddContentOverlay(content);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "AddContentOverlay", json);
-    }
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["type"] = "add";
-    result["content"] = content;
-    return result;
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is AddContentOverlay) {
-      return content == other.content;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, 704418402);
-    hash = _JenkinsSmiHash.combine(hash, content.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * AnalysisError
- *
- * {
- *   "severity": AnalysisErrorSeverity
- *   "type": AnalysisErrorType
- *   "location": Location
- *   "message": String
- *   "correction": optional String
- * }
- */
-class AnalysisError implements HasToJson {
-  AnalysisErrorSeverity _severity;
-
-  AnalysisErrorType _type;
-
-  Location _location;
-
-  String _message;
-
-  String _correction;
-
-  /**
-   * The severity of the error.
-   */
-  AnalysisErrorSeverity get severity => _severity;
-
-  /**
-   * The severity of the error.
-   */
-  void set severity(AnalysisErrorSeverity value) {
-    assert(value != null);
-    this._severity = value;
-  }
-
-  /**
-   * The type of the error.
-   */
-  AnalysisErrorType get type => _type;
-
-  /**
-   * The type of the error.
-   */
-  void set type(AnalysisErrorType value) {
-    assert(value != null);
-    this._type = value;
-  }
-
-  /**
-   * The location associated with the error.
-   */
-  Location get location => _location;
-
-  /**
-   * The location associated with the error.
-   */
-  void set location(Location value) {
-    assert(value != null);
-    this._location = value;
-  }
-
-  /**
-   * The message to be displayed for this error. The message should indicate
-   * what is wrong with the code and why it is wrong.
-   */
-  String get message => _message;
-
-  /**
-   * The message to be displayed for this error. The message should indicate
-   * what is wrong with the code and why it is wrong.
-   */
-  void set message(String value) {
-    assert(value != null);
-    this._message = value;
-  }
-
-  /**
-   * The correction message to be displayed for this error. The correction
-   * message should indicate how the user can fix the error. The field is
-   * omitted if there is no correction message associated with the error code.
-   */
-  String get correction => _correction;
-
-  /**
-   * The correction message to be displayed for this error. The correction
-   * message should indicate how the user can fix the error. The field is
-   * omitted if there is no correction message associated with the error code.
-   */
-  void set correction(String value) {
-    this._correction = value;
-  }
-
-  AnalysisError(AnalysisErrorSeverity severity, AnalysisErrorType type, Location location, String message, {String correction}) {
-    this.severity = severity;
-    this.type = type;
-    this.location = location;
-    this.message = message;
-    this.correction = correction;
-  }
-
-  factory AnalysisError.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      AnalysisErrorSeverity severity;
-      if (json.containsKey("severity")) {
-        severity = new AnalysisErrorSeverity.fromJson(jsonDecoder, jsonPath + ".severity", json["severity"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "severity");
-      }
-      AnalysisErrorType type;
-      if (json.containsKey("type")) {
-        type = new AnalysisErrorType.fromJson(jsonDecoder, jsonPath + ".type", json["type"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "type");
-      }
-      Location location;
-      if (json.containsKey("location")) {
-        location = new Location.fromJson(jsonDecoder, jsonPath + ".location", json["location"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "location");
-      }
-      String message;
-      if (json.containsKey("message")) {
-        message = jsonDecoder._decodeString(jsonPath + ".message", json["message"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "message");
-      }
-      String correction;
-      if (json.containsKey("correction")) {
-        correction = jsonDecoder._decodeString(jsonPath + ".correction", json["correction"]);
-      }
-      return new AnalysisError(severity, type, location, message, correction: correction);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "AnalysisError", json);
-    }
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["severity"] = severity.toJson();
-    result["type"] = type.toJson();
-    result["location"] = location.toJson();
-    result["message"] = message;
-    if (correction != null) {
-      result["correction"] = correction;
-    }
-    return result;
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is AnalysisError) {
-      return severity == other.severity &&
-          type == other.type &&
-          location == other.location &&
-          message == other.message &&
-          correction == other.correction;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, severity.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, type.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, location.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, message.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, correction.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * AnalysisErrorFixes
- *
- * {
- *   "error": AnalysisError
- *   "fixes": List<SourceChange>
- * }
- */
-class AnalysisErrorFixes implements HasToJson {
-  AnalysisError _error;
-
-  List<SourceChange> _fixes;
-
-  /**
-   * The error with which the fixes are associated.
-   */
-  AnalysisError get error => _error;
-
-  /**
-   * The error with which the fixes are associated.
-   */
-  void set error(AnalysisError value) {
-    assert(value != null);
-    this._error = value;
-  }
-
-  /**
-   * The fixes associated with the error.
-   */
-  List<SourceChange> get fixes => _fixes;
-
-  /**
-   * The fixes associated with the error.
-   */
-  void set fixes(List<SourceChange> value) {
-    assert(value != null);
-    this._fixes = value;
-  }
-
-  AnalysisErrorFixes(AnalysisError error, {List<SourceChange> fixes}) {
-    this.error = error;
-    if (fixes == null) {
-      this.fixes = <SourceChange>[];
-    } else {
-      this.fixes = fixes;
-    }
-  }
-
-  factory AnalysisErrorFixes.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      AnalysisError error;
-      if (json.containsKey("error")) {
-        error = new AnalysisError.fromJson(jsonDecoder, jsonPath + ".error", json["error"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "error");
-      }
-      List<SourceChange> fixes;
-      if (json.containsKey("fixes")) {
-        fixes = jsonDecoder._decodeList(jsonPath + ".fixes", json["fixes"], (String jsonPath, Object json) => new SourceChange.fromJson(jsonDecoder, jsonPath, json));
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "fixes");
-      }
-      return new AnalysisErrorFixes(error, fixes: fixes);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "AnalysisErrorFixes", json);
-    }
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["error"] = error.toJson();
-    result["fixes"] = fixes.map((SourceChange value) => value.toJson()).toList();
-    return result;
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is AnalysisErrorFixes) {
-      return error == other.error &&
-          _listEqual(fixes, other.fixes, (SourceChange a, SourceChange b) => a == b);
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, error.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, fixes.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * AnalysisErrorSeverity
- *
- * enum {
- *   INFO
- *   WARNING
- *   ERROR
- * }
- */
-class AnalysisErrorSeverity implements Enum {
-  static const INFO = const AnalysisErrorSeverity._("INFO");
-
-  static const WARNING = const AnalysisErrorSeverity._("WARNING");
-
-  static const ERROR = const AnalysisErrorSeverity._("ERROR");
-
-  /**
-   * A list containing all of the enum values that are defined.
-   */
-  static const List<AnalysisErrorSeverity> VALUES = const <AnalysisErrorSeverity>[INFO, WARNING, ERROR];
-
-  final String name;
-
-  const AnalysisErrorSeverity._(this.name);
-
-  factory AnalysisErrorSeverity(String name) {
-    switch (name) {
-      case "INFO":
-        return INFO;
-      case "WARNING":
-        return WARNING;
-      case "ERROR":
-        return ERROR;
-    }
-    throw new Exception('Illegal enum value: $name');
-  }
-
-  factory AnalysisErrorSeverity.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json is String) {
-      try {
-        return new AnalysisErrorSeverity(json);
-      } catch(_) {
-        // Fall through
-      }
-    }
-    throw jsonDecoder.mismatch(jsonPath, "AnalysisErrorSeverity", json);
-  }
-
-  @override
-  String toString() => "AnalysisErrorSeverity.$name";
-
-  String toJson() => name;
-}
-
-/**
- * AnalysisErrorType
- *
- * enum {
- *   CHECKED_MODE_COMPILE_TIME_ERROR
- *   COMPILE_TIME_ERROR
- *   HINT
- *   LINT
- *   STATIC_TYPE_WARNING
- *   STATIC_WARNING
- *   SYNTACTIC_ERROR
- *   TODO
- * }
- */
-class AnalysisErrorType implements Enum {
-  static const CHECKED_MODE_COMPILE_TIME_ERROR = const AnalysisErrorType._("CHECKED_MODE_COMPILE_TIME_ERROR");
-
-  static const COMPILE_TIME_ERROR = const AnalysisErrorType._("COMPILE_TIME_ERROR");
-
-  static const HINT = const AnalysisErrorType._("HINT");
-
-  static const LINT = const AnalysisErrorType._("LINT");
-
-  static const STATIC_TYPE_WARNING = const AnalysisErrorType._("STATIC_TYPE_WARNING");
-
-  static const STATIC_WARNING = const AnalysisErrorType._("STATIC_WARNING");
-
-  static const SYNTACTIC_ERROR = const AnalysisErrorType._("SYNTACTIC_ERROR");
-
-  static const TODO = const AnalysisErrorType._("TODO");
-
-  /**
-   * A list containing all of the enum values that are defined.
-   */
-  static const List<AnalysisErrorType> VALUES = const <AnalysisErrorType>[CHECKED_MODE_COMPILE_TIME_ERROR, COMPILE_TIME_ERROR, HINT, LINT, STATIC_TYPE_WARNING, STATIC_WARNING, SYNTACTIC_ERROR, TODO];
-
-  final String name;
-
-  const AnalysisErrorType._(this.name);
-
-  factory AnalysisErrorType(String name) {
-    switch (name) {
-      case "CHECKED_MODE_COMPILE_TIME_ERROR":
-        return CHECKED_MODE_COMPILE_TIME_ERROR;
-      case "COMPILE_TIME_ERROR":
-        return COMPILE_TIME_ERROR;
-      case "HINT":
-        return HINT;
-      case "LINT":
-        return LINT;
-      case "STATIC_TYPE_WARNING":
-        return STATIC_TYPE_WARNING;
-      case "STATIC_WARNING":
-        return STATIC_WARNING;
-      case "SYNTACTIC_ERROR":
-        return SYNTACTIC_ERROR;
-      case "TODO":
-        return TODO;
-    }
-    throw new Exception('Illegal enum value: $name');
-  }
-
-  factory AnalysisErrorType.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json is String) {
-      try {
-        return new AnalysisErrorType(json);
-      } catch(_) {
-        // Fall through
-      }
-    }
-    throw jsonDecoder.mismatch(jsonPath, "AnalysisErrorType", json);
-  }
-
-  @override
-  String toString() => "AnalysisErrorType.$name";
-
-  String toJson() => name;
-}
-
-/**
- * AnalysisOptions
- *
- * {
- *   "enableAsync": optional bool
- *   "enableDeferredLoading": optional bool
- *   "enableEnums": optional bool
- *   "enableNullAwareOperators": optional bool
- *   "generateDart2jsHints": optional bool
- *   "generateHints": optional bool
- *   "generateLints": optional bool
- * }
- */
-class AnalysisOptions implements HasToJson {
-  bool _enableAsync;
-
-  bool _enableDeferredLoading;
-
-  bool _enableEnums;
-
-  bool _enableNullAwareOperators;
-
-  bool _generateDart2jsHints;
-
-  bool _generateHints;
-
-  bool _generateLints;
-
-  /**
-   * Deprecated: this feature is always enabled.
-   *
-   * True if the client wants to enable support for the proposed async feature.
-   */
-  bool get enableAsync => _enableAsync;
-
-  /**
-   * Deprecated: this feature is always enabled.
-   *
-   * True if the client wants to enable support for the proposed async feature.
-   */
-  void set enableAsync(bool value) {
-    this._enableAsync = value;
-  }
-
-  /**
-   * Deprecated: this feature is always enabled.
-   *
-   * True if the client wants to enable support for the proposed deferred
-   * loading feature.
-   */
-  bool get enableDeferredLoading => _enableDeferredLoading;
-
-  /**
-   * Deprecated: this feature is always enabled.
-   *
-   * True if the client wants to enable support for the proposed deferred
-   * loading feature.
-   */
-  void set enableDeferredLoading(bool value) {
-    this._enableDeferredLoading = value;
-  }
-
-  /**
-   * Deprecated: this feature is always enabled.
-   *
-   * True if the client wants to enable support for the proposed enum feature.
-   */
-  bool get enableEnums => _enableEnums;
-
-  /**
-   * Deprecated: this feature is always enabled.
-   *
-   * True if the client wants to enable support for the proposed enum feature.
-   */
-  void set enableEnums(bool value) {
-    this._enableEnums = value;
-  }
-
-  /**
-   * Deprecated: this feature is always enabled.
-   *
-   * True if the client wants to enable support for the proposed "null aware
-   * operators" feature.
-   */
-  bool get enableNullAwareOperators => _enableNullAwareOperators;
-
-  /**
-   * Deprecated: this feature is always enabled.
-   *
-   * True if the client wants to enable support for the proposed "null aware
-   * operators" feature.
-   */
-  void set enableNullAwareOperators(bool value) {
-    this._enableNullAwareOperators = value;
-  }
-
-  /**
-   * True if hints that are specific to dart2js should be generated. This
-   * option is ignored if generateHints is false.
-   */
-  bool get generateDart2jsHints => _generateDart2jsHints;
-
-  /**
-   * True if hints that are specific to dart2js should be generated. This
-   * option is ignored if generateHints is false.
-   */
-  void set generateDart2jsHints(bool value) {
-    this._generateDart2jsHints = value;
-  }
-
-  /**
-   * True if hints should be generated as part of generating errors and
-   * warnings.
-   */
-  bool get generateHints => _generateHints;
-
-  /**
-   * True if hints should be generated as part of generating errors and
-   * warnings.
-   */
-  void set generateHints(bool value) {
-    this._generateHints = value;
-  }
-
-  /**
-   * True if lints should be generated as part of generating errors and
-   * warnings.
-   */
-  bool get generateLints => _generateLints;
-
-  /**
-   * True if lints should be generated as part of generating errors and
-   * warnings.
-   */
-  void set generateLints(bool value) {
-    this._generateLints = value;
-  }
-
-  AnalysisOptions({bool enableAsync, bool enableDeferredLoading, bool enableEnums, bool enableNullAwareOperators, bool generateDart2jsHints, bool generateHints, bool generateLints}) {
-    this.enableAsync = enableAsync;
-    this.enableDeferredLoading = enableDeferredLoading;
-    this.enableEnums = enableEnums;
-    this.enableNullAwareOperators = enableNullAwareOperators;
-    this.generateDart2jsHints = generateDart2jsHints;
-    this.generateHints = generateHints;
-    this.generateLints = generateLints;
-  }
-
-  factory AnalysisOptions.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      bool enableAsync;
-      if (json.containsKey("enableAsync")) {
-        enableAsync = jsonDecoder._decodeBool(jsonPath + ".enableAsync", json["enableAsync"]);
-      }
-      bool enableDeferredLoading;
-      if (json.containsKey("enableDeferredLoading")) {
-        enableDeferredLoading = jsonDecoder._decodeBool(jsonPath + ".enableDeferredLoading", json["enableDeferredLoading"]);
-      }
-      bool enableEnums;
-      if (json.containsKey("enableEnums")) {
-        enableEnums = jsonDecoder._decodeBool(jsonPath + ".enableEnums", json["enableEnums"]);
-      }
-      bool enableNullAwareOperators;
-      if (json.containsKey("enableNullAwareOperators")) {
-        enableNullAwareOperators = jsonDecoder._decodeBool(jsonPath + ".enableNullAwareOperators", json["enableNullAwareOperators"]);
-      }
-      bool generateDart2jsHints;
-      if (json.containsKey("generateDart2jsHints")) {
-        generateDart2jsHints = jsonDecoder._decodeBool(jsonPath + ".generateDart2jsHints", json["generateDart2jsHints"]);
-      }
-      bool generateHints;
-      if (json.containsKey("generateHints")) {
-        generateHints = jsonDecoder._decodeBool(jsonPath + ".generateHints", json["generateHints"]);
-      }
-      bool generateLints;
-      if (json.containsKey("generateLints")) {
-        generateLints = jsonDecoder._decodeBool(jsonPath + ".generateLints", json["generateLints"]);
-      }
-      return new AnalysisOptions(enableAsync: enableAsync, enableDeferredLoading: enableDeferredLoading, enableEnums: enableEnums, enableNullAwareOperators: enableNullAwareOperators, generateDart2jsHints: generateDart2jsHints, generateHints: generateHints, generateLints: generateLints);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "AnalysisOptions", json);
-    }
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    if (enableAsync != null) {
-      result["enableAsync"] = enableAsync;
-    }
-    if (enableDeferredLoading != null) {
-      result["enableDeferredLoading"] = enableDeferredLoading;
-    }
-    if (enableEnums != null) {
-      result["enableEnums"] = enableEnums;
-    }
-    if (enableNullAwareOperators != null) {
-      result["enableNullAwareOperators"] = enableNullAwareOperators;
-    }
-    if (generateDart2jsHints != null) {
-      result["generateDart2jsHints"] = generateDart2jsHints;
-    }
-    if (generateHints != null) {
-      result["generateHints"] = generateHints;
-    }
-    if (generateLints != null) {
-      result["generateLints"] = generateLints;
-    }
-    return result;
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is AnalysisOptions) {
-      return enableAsync == other.enableAsync &&
-          enableDeferredLoading == other.enableDeferredLoading &&
-          enableEnums == other.enableEnums &&
-          enableNullAwareOperators == other.enableNullAwareOperators &&
-          generateDart2jsHints == other.generateDart2jsHints &&
-          generateHints == other.generateHints &&
-          generateLints == other.generateLints;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, enableAsync.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, enableDeferredLoading.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, enableEnums.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, enableNullAwareOperators.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, generateDart2jsHints.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, generateHints.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, generateLints.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * AnalysisService
- *
- * enum {
- *   FOLDING
- *   HIGHLIGHTS
- *   INVALIDATE
- *   NAVIGATION
- *   OCCURRENCES
- *   OUTLINE
- *   OVERRIDES
- * }
- */
-class AnalysisService implements Enum {
-  static const FOLDING = const AnalysisService._("FOLDING");
-
-  static const HIGHLIGHTS = const AnalysisService._("HIGHLIGHTS");
-
-  /**
-   * This service is not currently implemented and will become a
-   * GeneralAnalysisService in a future release.
-   */
-  static const INVALIDATE = const AnalysisService._("INVALIDATE");
-
-  static const NAVIGATION = const AnalysisService._("NAVIGATION");
-
-  static const OCCURRENCES = const AnalysisService._("OCCURRENCES");
-
-  static const OUTLINE = const AnalysisService._("OUTLINE");
-
-  static const OVERRIDES = const AnalysisService._("OVERRIDES");
-
-  /**
-   * A list containing all of the enum values that are defined.
-   */
-  static const List<AnalysisService> VALUES = const <AnalysisService>[FOLDING, HIGHLIGHTS, INVALIDATE, NAVIGATION, OCCURRENCES, OUTLINE, OVERRIDES];
-
-  final String name;
-
-  const AnalysisService._(this.name);
-
-  factory AnalysisService(String name) {
-    switch (name) {
-      case "FOLDING":
-        return FOLDING;
-      case "HIGHLIGHTS":
-        return HIGHLIGHTS;
-      case "INVALIDATE":
-        return INVALIDATE;
-      case "NAVIGATION":
-        return NAVIGATION;
-      case "OCCURRENCES":
-        return OCCURRENCES;
-      case "OUTLINE":
-        return OUTLINE;
-      case "OVERRIDES":
-        return OVERRIDES;
-    }
-    throw new Exception('Illegal enum value: $name');
-  }
-
-  factory AnalysisService.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json is String) {
-      try {
-        return new AnalysisService(json);
-      } catch(_) {
-        // Fall through
-      }
-    }
-    throw jsonDecoder.mismatch(jsonPath, "AnalysisService", json);
-  }
-
-  @override
-  String toString() => "AnalysisService.$name";
-
-  String toJson() => name;
-}
-
-/**
- * AnalysisStatus
- *
- * {
- *   "isAnalyzing": bool
- *   "analysisTarget": optional String
- * }
- */
-class AnalysisStatus implements HasToJson {
-  bool _isAnalyzing;
-
-  String _analysisTarget;
-
-  /**
-   * True if analysis is currently being performed.
-   */
-  bool get isAnalyzing => _isAnalyzing;
-
-  /**
-   * True if analysis is currently being performed.
-   */
-  void set isAnalyzing(bool value) {
-    assert(value != null);
-    this._isAnalyzing = value;
-  }
-
-  /**
-   * The name of the current target of analysis. This field is omitted if
-   * analyzing is false.
-   */
-  String get analysisTarget => _analysisTarget;
-
-  /**
-   * The name of the current target of analysis. This field is omitted if
-   * analyzing is false.
-   */
-  void set analysisTarget(String value) {
-    this._analysisTarget = value;
-  }
-
-  AnalysisStatus(bool isAnalyzing, {String analysisTarget}) {
-    this.isAnalyzing = isAnalyzing;
-    this.analysisTarget = analysisTarget;
-  }
-
-  factory AnalysisStatus.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      bool isAnalyzing;
-      if (json.containsKey("isAnalyzing")) {
-        isAnalyzing = jsonDecoder._decodeBool(jsonPath + ".isAnalyzing", json["isAnalyzing"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "isAnalyzing");
-      }
-      String analysisTarget;
-      if (json.containsKey("analysisTarget")) {
-        analysisTarget = jsonDecoder._decodeString(jsonPath + ".analysisTarget", json["analysisTarget"]);
-      }
-      return new AnalysisStatus(isAnalyzing, analysisTarget: analysisTarget);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "AnalysisStatus", json);
-    }
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["isAnalyzing"] = isAnalyzing;
-    if (analysisTarget != null) {
-      result["analysisTarget"] = analysisTarget;
-    }
-    return result;
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is AnalysisStatus) {
-      return isAnalyzing == other.isAnalyzing &&
-          analysisTarget == other.analysisTarget;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, isAnalyzing.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, analysisTarget.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * ChangeContentOverlay
- *
- * {
- *   "type": "change"
- *   "edits": List<SourceEdit>
- * }
- */
-class ChangeContentOverlay implements HasToJson {
-  List<SourceEdit> _edits;
-
-  /**
-   * The edits to be applied to the file.
-   */
-  List<SourceEdit> get edits => _edits;
-
-  /**
-   * The edits to be applied to the file.
-   */
-  void set edits(List<SourceEdit> value) {
-    assert(value != null);
-    this._edits = value;
-  }
-
-  ChangeContentOverlay(List<SourceEdit> edits) {
-    this.edits = edits;
-  }
-
-  factory ChangeContentOverlay.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      if (json["type"] != "change") {
-        throw jsonDecoder.mismatch(jsonPath, "equal " + "change", json);
-      }
-      List<SourceEdit> edits;
-      if (json.containsKey("edits")) {
-        edits = jsonDecoder._decodeList(jsonPath + ".edits", json["edits"], (String jsonPath, Object json) => new SourceEdit.fromJson(jsonDecoder, jsonPath, json));
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "edits");
-      }
-      return new ChangeContentOverlay(edits);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "ChangeContentOverlay", json);
-    }
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["type"] = "change";
-    result["edits"] = edits.map((SourceEdit value) => value.toJson()).toList();
-    return result;
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is ChangeContentOverlay) {
-      return _listEqual(edits, other.edits, (SourceEdit a, SourceEdit b) => a == b);
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, 873118866);
-    hash = _JenkinsSmiHash.combine(hash, edits.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * CompletionSuggestion
- *
- * {
- *   "kind": CompletionSuggestionKind
- *   "relevance": int
- *   "completion": String
- *   "selectionOffset": int
- *   "selectionLength": int
- *   "isDeprecated": bool
- *   "isPotential": bool
- *   "docSummary": optional String
- *   "docComplete": optional String
- *   "declaringType": optional String
- *   "element": optional Element
- *   "returnType": optional String
- *   "parameterNames": optional List<String>
- *   "parameterTypes": optional List<String>
- *   "requiredParameterCount": optional int
- *   "hasNamedParameters": optional bool
- *   "parameterName": optional String
- *   "parameterType": optional String
- *   "importUri": optional String
- * }
- */
-class CompletionSuggestion implements HasToJson {
-  CompletionSuggestionKind _kind;
-
-  int _relevance;
-
-  String _completion;
-
-  int _selectionOffset;
-
-  int _selectionLength;
-
-  bool _isDeprecated;
-
-  bool _isPotential;
-
-  String _docSummary;
-
-  String _docComplete;
-
-  String _declaringType;
-
-  Element _element;
-
-  String _returnType;
-
-  List<String> _parameterNames;
-
-  List<String> _parameterTypes;
-
-  int _requiredParameterCount;
-
-  bool _hasNamedParameters;
-
-  String _parameterName;
-
-  String _parameterType;
-
-  String _importUri;
-
-  /**
-   * The kind of element being suggested.
-   */
-  CompletionSuggestionKind get kind => _kind;
-
-  /**
-   * The kind of element being suggested.
-   */
-  void set kind(CompletionSuggestionKind value) {
-    assert(value != null);
-    this._kind = value;
-  }
-
-  /**
-   * The relevance of this completion suggestion where a higher number
-   * indicates a higher relevance.
-   */
-  int get relevance => _relevance;
-
-  /**
-   * The relevance of this completion suggestion where a higher number
-   * indicates a higher relevance.
-   */
-  void set relevance(int value) {
-    assert(value != null);
-    this._relevance = value;
-  }
-
-  /**
-   * The identifier to be inserted if the suggestion is selected. If the
-   * suggestion is for a method or function, the client might want to
-   * additionally insert a template for the parameters. The information
-   * required in order to do so is contained in other fields.
-   */
-  String get completion => _completion;
-
-  /**
-   * The identifier to be inserted if the suggestion is selected. If the
-   * suggestion is for a method or function, the client might want to
-   * additionally insert a template for the parameters. The information
-   * required in order to do so is contained in other fields.
-   */
-  void set completion(String value) {
-    assert(value != null);
-    this._completion = value;
-  }
-
-  /**
-   * The offset, relative to the beginning of the completion, of where the
-   * selection should be placed after insertion.
-   */
-  int get selectionOffset => _selectionOffset;
-
-  /**
-   * The offset, relative to the beginning of the completion, of where the
-   * selection should be placed after insertion.
-   */
-  void set selectionOffset(int value) {
-    assert(value != null);
-    this._selectionOffset = value;
-  }
-
-  /**
-   * The number of characters that should be selected after insertion.
-   */
-  int get selectionLength => _selectionLength;
-
-  /**
-   * The number of characters that should be selected after insertion.
-   */
-  void set selectionLength(int value) {
-    assert(value != null);
-    this._selectionLength = value;
-  }
-
-  /**
-   * True if the suggested element is deprecated.
-   */
-  bool get isDeprecated => _isDeprecated;
-
-  /**
-   * True if the suggested element is deprecated.
-   */
-  void set isDeprecated(bool value) {
-    assert(value != null);
-    this._isDeprecated = value;
-  }
-
-  /**
-   * True if the element is not known to be valid for the target. This happens
-   * if the type of the target is dynamic.
-   */
-  bool get isPotential => _isPotential;
-
-  /**
-   * True if the element is not known to be valid for the target. This happens
-   * if the type of the target is dynamic.
-   */
-  void set isPotential(bool value) {
-    assert(value != null);
-    this._isPotential = value;
-  }
-
-  /**
-   * An abbreviated version of the Dartdoc associated with the element being
-   * suggested, This field is omitted if there is no Dartdoc associated with
-   * the element.
-   */
-  String get docSummary => _docSummary;
-
-  /**
-   * An abbreviated version of the Dartdoc associated with the element being
-   * suggested, This field is omitted if there is no Dartdoc associated with
-   * the element.
-   */
-  void set docSummary(String value) {
-    this._docSummary = value;
-  }
-
-  /**
-   * The Dartdoc associated with the element being suggested, This field is
-   * omitted if there is no Dartdoc associated with the element.
-   */
-  String get docComplete => _docComplete;
-
-  /**
-   * The Dartdoc associated with the element being suggested, This field is
-   * omitted if there is no Dartdoc associated with the element.
-   */
-  void set docComplete(String value) {
-    this._docComplete = value;
-  }
-
-  /**
-   * The class that declares the element being suggested. This field is omitted
-   * if the suggested element is not a member of a class.
-   */
-  String get declaringType => _declaringType;
-
-  /**
-   * The class that declares the element being suggested. This field is omitted
-   * if the suggested element is not a member of a class.
-   */
-  void set declaringType(String value) {
-    this._declaringType = value;
-  }
-
-  /**
-   * Information about the element reference being suggested.
-   */
-  Element get element => _element;
-
-  /**
-   * Information about the element reference being suggested.
-   */
-  void set element(Element value) {
-    this._element = value;
-  }
-
-  /**
-   * The return type of the getter, function or method or the type of the field
-   * being suggested. This field is omitted if the suggested element is not a
-   * getter, function or method.
-   */
-  String get returnType => _returnType;
-
-  /**
-   * The return type of the getter, function or method or the type of the field
-   * being suggested. This field is omitted if the suggested element is not a
-   * getter, function or method.
-   */
-  void set returnType(String value) {
-    this._returnType = value;
-  }
-
-  /**
-   * The names of the parameters of the function or method being suggested.
-   * This field is omitted if the suggested element is not a setter, function
-   * or method.
-   */
-  List<String> get parameterNames => _parameterNames;
-
-  /**
-   * The names of the parameters of the function or method being suggested.
-   * This field is omitted if the suggested element is not a setter, function
-   * or method.
-   */
-  void set parameterNames(List<String> value) {
-    this._parameterNames = value;
-  }
-
-  /**
-   * The types of the parameters of the function or method being suggested.
-   * This field is omitted if the parameterNames field is omitted.
-   */
-  List<String> get parameterTypes => _parameterTypes;
-
-  /**
-   * The types of the parameters of the function or method being suggested.
-   * This field is omitted if the parameterNames field is omitted.
-   */
-  void set parameterTypes(List<String> value) {
-    this._parameterTypes = value;
-  }
-
-  /**
-   * The number of required parameters for the function or method being
-   * suggested. This field is omitted if the parameterNames field is omitted.
-   */
-  int get requiredParameterCount => _requiredParameterCount;
-
-  /**
-   * The number of required parameters for the function or method being
-   * suggested. This field is omitted if the parameterNames field is omitted.
-   */
-  void set requiredParameterCount(int value) {
-    this._requiredParameterCount = value;
-  }
-
-  /**
-   * True if the function or method being suggested has at least one named
-   * parameter. This field is omitted if the parameterNames field is omitted.
-   */
-  bool get hasNamedParameters => _hasNamedParameters;
-
-  /**
-   * True if the function or method being suggested has at least one named
-   * parameter. This field is omitted if the parameterNames field is omitted.
-   */
-  void set hasNamedParameters(bool value) {
-    this._hasNamedParameters = value;
-  }
-
-  /**
-   * The name of the optional parameter being suggested. This field is omitted
-   * if the suggestion is not the addition of an optional argument within an
-   * argument list.
-   */
-  String get parameterName => _parameterName;
-
-  /**
-   * The name of the optional parameter being suggested. This field is omitted
-   * if the suggestion is not the addition of an optional argument within an
-   * argument list.
-   */
-  void set parameterName(String value) {
-    this._parameterName = value;
-  }
-
-  /**
-   * The type of the options parameter being suggested. This field is omitted
-   * if the parameterName field is omitted.
-   */
-  String get parameterType => _parameterType;
-
-  /**
-   * The type of the options parameter being suggested. This field is omitted
-   * if the parameterName field is omitted.
-   */
-  void set parameterType(String value) {
-    this._parameterType = value;
-  }
-
-  /**
-   * The import to be added if the suggestion is out of scope and needs an
-   * import to be added to be in scope.
-   */
-  String get importUri => _importUri;
-
-  /**
-   * The import to be added if the suggestion is out of scope and needs an
-   * import to be added to be in scope.
-   */
-  void set importUri(String value) {
-    this._importUri = value;
-  }
-
-  CompletionSuggestion(CompletionSuggestionKind kind, int relevance, String completion, int selectionOffset, int selectionLength, bool isDeprecated, bool isPotential, {String docSummary, String docComplete, String declaringType, Element element, String returnType, List<String> parameterNames, List<String> parameterTypes, int requiredParameterCount, bool hasNamedParameters, String parameterName, String parameterType, String importUri}) {
-    this.kind = kind;
-    this.relevance = relevance;
-    this.completion = completion;
-    this.selectionOffset = selectionOffset;
-    this.selectionLength = selectionLength;
-    this.isDeprecated = isDeprecated;
-    this.isPotential = isPotential;
-    this.docSummary = docSummary;
-    this.docComplete = docComplete;
-    this.declaringType = declaringType;
-    this.element = element;
-    this.returnType = returnType;
-    this.parameterNames = parameterNames;
-    this.parameterTypes = parameterTypes;
-    this.requiredParameterCount = requiredParameterCount;
-    this.hasNamedParameters = hasNamedParameters;
-    this.parameterName = parameterName;
-    this.parameterType = parameterType;
-    this.importUri = importUri;
-  }
-
-  factory CompletionSuggestion.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      CompletionSuggestionKind kind;
-      if (json.containsKey("kind")) {
-        kind = new CompletionSuggestionKind.fromJson(jsonDecoder, jsonPath + ".kind", json["kind"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "kind");
-      }
-      int relevance;
-      if (json.containsKey("relevance")) {
-        relevance = jsonDecoder._decodeInt(jsonPath + ".relevance", json["relevance"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "relevance");
-      }
-      String completion;
-      if (json.containsKey("completion")) {
-        completion = jsonDecoder._decodeString(jsonPath + ".completion", json["completion"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "completion");
-      }
-      int selectionOffset;
-      if (json.containsKey("selectionOffset")) {
-        selectionOffset = jsonDecoder._decodeInt(jsonPath + ".selectionOffset", json["selectionOffset"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "selectionOffset");
-      }
-      int selectionLength;
-      if (json.containsKey("selectionLength")) {
-        selectionLength = jsonDecoder._decodeInt(jsonPath + ".selectionLength", json["selectionLength"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "selectionLength");
-      }
-      bool isDeprecated;
-      if (json.containsKey("isDeprecated")) {
-        isDeprecated = jsonDecoder._decodeBool(jsonPath + ".isDeprecated", json["isDeprecated"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "isDeprecated");
-      }
-      bool isPotential;
-      if (json.containsKey("isPotential")) {
-        isPotential = jsonDecoder._decodeBool(jsonPath + ".isPotential", json["isPotential"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "isPotential");
-      }
-      String docSummary;
-      if (json.containsKey("docSummary")) {
-        docSummary = jsonDecoder._decodeString(jsonPath + ".docSummary", json["docSummary"]);
-      }
-      String docComplete;
-      if (json.containsKey("docComplete")) {
-        docComplete = jsonDecoder._decodeString(jsonPath + ".docComplete", json["docComplete"]);
-      }
-      String declaringType;
-      if (json.containsKey("declaringType")) {
-        declaringType = jsonDecoder._decodeString(jsonPath + ".declaringType", json["declaringType"]);
-      }
-      Element element;
-      if (json.containsKey("element")) {
-        element = new Element.fromJson(jsonDecoder, jsonPath + ".element", json["element"]);
-      }
-      String returnType;
-      if (json.containsKey("returnType")) {
-        returnType = jsonDecoder._decodeString(jsonPath + ".returnType", json["returnType"]);
-      }
-      List<String> parameterNames;
-      if (json.containsKey("parameterNames")) {
-        parameterNames = jsonDecoder._decodeList(jsonPath + ".parameterNames", json["parameterNames"], jsonDecoder._decodeString);
-      }
-      List<String> parameterTypes;
-      if (json.containsKey("parameterTypes")) {
-        parameterTypes = jsonDecoder._decodeList(jsonPath + ".parameterTypes", json["parameterTypes"], jsonDecoder._decodeString);
-      }
-      int requiredParameterCount;
-      if (json.containsKey("requiredParameterCount")) {
-        requiredParameterCount = jsonDecoder._decodeInt(jsonPath + ".requiredParameterCount", json["requiredParameterCount"]);
-      }
-      bool hasNamedParameters;
-      if (json.containsKey("hasNamedParameters")) {
-        hasNamedParameters = jsonDecoder._decodeBool(jsonPath + ".hasNamedParameters", json["hasNamedParameters"]);
-      }
-      String parameterName;
-      if (json.containsKey("parameterName")) {
-        parameterName = jsonDecoder._decodeString(jsonPath + ".parameterName", json["parameterName"]);
-      }
-      String parameterType;
-      if (json.containsKey("parameterType")) {
-        parameterType = jsonDecoder._decodeString(jsonPath + ".parameterType", json["parameterType"]);
-      }
-      String importUri;
-      if (json.containsKey("importUri")) {
-        importUri = jsonDecoder._decodeString(jsonPath + ".importUri", json["importUri"]);
-      }
-      return new CompletionSuggestion(kind, relevance, completion, selectionOffset, selectionLength, isDeprecated, isPotential, docSummary: docSummary, docComplete: docComplete, declaringType: declaringType, element: element, returnType: returnType, parameterNames: parameterNames, parameterTypes: parameterTypes, requiredParameterCount: requiredParameterCount, hasNamedParameters: hasNamedParameters, parameterName: parameterName, parameterType: parameterType, importUri: importUri);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "CompletionSuggestion", json);
-    }
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["kind"] = kind.toJson();
-    result["relevance"] = relevance;
-    result["completion"] = completion;
-    result["selectionOffset"] = selectionOffset;
-    result["selectionLength"] = selectionLength;
-    result["isDeprecated"] = isDeprecated;
-    result["isPotential"] = isPotential;
-    if (docSummary != null) {
-      result["docSummary"] = docSummary;
-    }
-    if (docComplete != null) {
-      result["docComplete"] = docComplete;
-    }
-    if (declaringType != null) {
-      result["declaringType"] = declaringType;
-    }
-    if (element != null) {
-      result["element"] = element.toJson();
-    }
-    if (returnType != null) {
-      result["returnType"] = returnType;
-    }
-    if (parameterNames != null) {
-      result["parameterNames"] = parameterNames;
-    }
-    if (parameterTypes != null) {
-      result["parameterTypes"] = parameterTypes;
-    }
-    if (requiredParameterCount != null) {
-      result["requiredParameterCount"] = requiredParameterCount;
-    }
-    if (hasNamedParameters != null) {
-      result["hasNamedParameters"] = hasNamedParameters;
-    }
-    if (parameterName != null) {
-      result["parameterName"] = parameterName;
-    }
-    if (parameterType != null) {
-      result["parameterType"] = parameterType;
-    }
-    if (importUri != null) {
-      result["importUri"] = importUri;
-    }
-    return result;
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is CompletionSuggestion) {
-      return kind == other.kind &&
-          relevance == other.relevance &&
-          completion == other.completion &&
-          selectionOffset == other.selectionOffset &&
-          selectionLength == other.selectionLength &&
-          isDeprecated == other.isDeprecated &&
-          isPotential == other.isPotential &&
-          docSummary == other.docSummary &&
-          docComplete == other.docComplete &&
-          declaringType == other.declaringType &&
-          element == other.element &&
-          returnType == other.returnType &&
-          _listEqual(parameterNames, other.parameterNames, (String a, String b) => a == b) &&
-          _listEqual(parameterTypes, other.parameterTypes, (String a, String b) => a == b) &&
-          requiredParameterCount == other.requiredParameterCount &&
-          hasNamedParameters == other.hasNamedParameters &&
-          parameterName == other.parameterName &&
-          parameterType == other.parameterType &&
-          importUri == other.importUri;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, kind.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, relevance.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, completion.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, selectionOffset.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, selectionLength.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, isDeprecated.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, isPotential.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, docSummary.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, docComplete.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, declaringType.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, element.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, returnType.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, parameterNames.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, parameterTypes.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, requiredParameterCount.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, hasNamedParameters.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, parameterName.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, parameterType.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, importUri.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * CompletionSuggestionKind
- *
- * enum {
- *   ARGUMENT_LIST
- *   IMPORT
- *   IDENTIFIER
- *   INVOCATION
- *   KEYWORD
- *   NAMED_ARGUMENT
- *   OPTIONAL_ARGUMENT
- *   PARAMETER
- * }
- */
-class CompletionSuggestionKind implements Enum {
-  /**
-   * A list of arguments for the method or function that is being invoked. For
-   * this suggestion kind, the completion field is a textual representation of
-   * the invocation and the parameterNames, parameterTypes, and
-   * requiredParameterCount attributes are defined.
-   */
-  static const ARGUMENT_LIST = const CompletionSuggestionKind._("ARGUMENT_LIST");
-
-  static const IMPORT = const CompletionSuggestionKind._("IMPORT");
-
-  /**
-   * The element identifier should be inserted at the completion location. For
-   * example "someMethod" in import 'myLib.dart' show someMethod; . For
-   * suggestions of this kind, the element attribute is defined and the
-   * completion field is the element's identifier.
-   */
-  static const IDENTIFIER = const CompletionSuggestionKind._("IDENTIFIER");
-
-  /**
-   * The element is being invoked at the completion location. For example,
-   * "someMethod" in x.someMethod(); . For suggestions of this kind, the
-   * element attribute is defined and the completion field is the element's
-   * identifier.
-   */
-  static const 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");
-
-  /**
-   * 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 OPTIONAL_ARGUMENT = const CompletionSuggestionKind._("OPTIONAL_ARGUMENT");
-
-  static const PARAMETER = const CompletionSuggestionKind._("PARAMETER");
-
-  /**
-   * A list containing all of the enum values that are defined.
-   */
-  static const List<CompletionSuggestionKind> VALUES = const <CompletionSuggestionKind>[ARGUMENT_LIST, IMPORT, IDENTIFIER, INVOCATION, KEYWORD, NAMED_ARGUMENT, OPTIONAL_ARGUMENT, PARAMETER];
-
-  final String name;
-
-  const CompletionSuggestionKind._(this.name);
-
-  factory CompletionSuggestionKind(String name) {
-    switch (name) {
-      case "ARGUMENT_LIST":
-        return ARGUMENT_LIST;
-      case "IMPORT":
-        return IMPORT;
-      case "IDENTIFIER":
-        return IDENTIFIER;
-      case "INVOCATION":
-        return INVOCATION;
-      case "KEYWORD":
-        return KEYWORD;
-      case "NAMED_ARGUMENT":
-        return NAMED_ARGUMENT;
-      case "OPTIONAL_ARGUMENT":
-        return OPTIONAL_ARGUMENT;
-      case "PARAMETER":
-        return PARAMETER;
-    }
-    throw new Exception('Illegal enum value: $name');
-  }
-
-  factory CompletionSuggestionKind.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json is String) {
-      try {
-        return new CompletionSuggestionKind(json);
-      } catch(_) {
-        // Fall through
-      }
-    }
-    throw jsonDecoder.mismatch(jsonPath, "CompletionSuggestionKind", json);
-  }
-
-  @override
-  String toString() => "CompletionSuggestionKind.$name";
-
-  String toJson() => name;
-}
-
-/**
- * Element
- *
- * {
- *   "kind": ElementKind
- *   "name": String
- *   "location": optional Location
- *   "flags": int
- *   "parameters": optional String
- *   "returnType": optional String
- *   "typeParameters": optional String
- * }
- */
-class Element implements HasToJson {
-  static const int FLAG_ABSTRACT = 0x01;
-  static const int FLAG_CONST = 0x02;
-  static const int FLAG_FINAL = 0x04;
-  static const int FLAG_STATIC = 0x08;
-  static const int FLAG_PRIVATE = 0x10;
-  static const int FLAG_DEPRECATED = 0x20;
-
-  static int makeFlags({isAbstract: false, isConst: false, isFinal: false, isStatic: false, isPrivate: false, isDeprecated: false}) {
-    int flags = 0;
-    if (isAbstract) flags |= FLAG_ABSTRACT;
-    if (isConst) flags |= FLAG_CONST;
-    if (isFinal) flags |= FLAG_FINAL;
-    if (isStatic) flags |= FLAG_STATIC;
-    if (isPrivate) flags |= FLAG_PRIVATE;
-    if (isDeprecated) flags |= FLAG_DEPRECATED;
-    return flags;
-  }
-
-  ElementKind _kind;
-
-  String _name;
-
-  Location _location;
-
-  int _flags;
-
-  String _parameters;
-
-  String _returnType;
-
-  String _typeParameters;
-
-  /**
-   * The kind of the element.
-   */
-  ElementKind get kind => _kind;
-
-  /**
-   * The kind of the element.
-   */
-  void set kind(ElementKind value) {
-    assert(value != null);
-    this._kind = value;
-  }
-
-  /**
-   * The name of the element. This is typically used as the label in the
-   * outline.
-   */
-  String get name => _name;
-
-  /**
-   * The name of the element. This is typically used as the label in the
-   * outline.
-   */
-  void set name(String value) {
-    assert(value != null);
-    this._name = value;
-  }
-
-  /**
-   * The location of the name in the declaration of the element.
-   */
-  Location get location => _location;
-
-  /**
-   * The location of the name in the declaration of the element.
-   */
-  void set location(Location value) {
-    this._location = value;
-  }
-
-  /**
-   * A bit-map containing the following flags:
-   *
-   * - 0x01 - set if the element is explicitly or implicitly abstract
-   * - 0x02 - set if the element was declared to be ‘const’
-   * - 0x04 - set if the element was declared to be ‘final’
-   * - 0x08 - set if the element is a static member of a class or is a
-   *   top-level function or field
-   * - 0x10 - set if the element is private
-   * - 0x20 - set if the element is deprecated
-   */
-  int get flags => _flags;
-
-  /**
-   * A bit-map containing the following flags:
-   *
-   * - 0x01 - set if the element is explicitly or implicitly abstract
-   * - 0x02 - set if the element was declared to be ‘const’
-   * - 0x04 - set if the element was declared to be ‘final’
-   * - 0x08 - set if the element is a static member of a class or is a
-   *   top-level function or field
-   * - 0x10 - set if the element is private
-   * - 0x20 - set if the element is deprecated
-   */
-  void set flags(int value) {
-    assert(value != null);
-    this._flags = value;
-  }
-
-  /**
-   * The parameter list for the element. If the element is not a method or
-   * function this field will not be defined. If the element doesn't have
-   * parameters (e.g. getter), this field will not be defined. If the element
-   * has zero parameters, this field will have a value of "()".
-   */
-  String get parameters => _parameters;
-
-  /**
-   * The parameter list for the element. If the element is not a method or
-   * function this field will not be defined. If the element doesn't have
-   * parameters (e.g. getter), this field will not be defined. If the element
-   * has zero parameters, this field will have a value of "()".
-   */
-  void set parameters(String value) {
-    this._parameters = value;
-  }
-
-  /**
-   * The return type of the element. If the element is not a method or function
-   * this field will not be defined. If the element does not have a declared
-   * return type, this field will contain an empty string.
-   */
-  String get returnType => _returnType;
-
-  /**
-   * The return type of the element. If the element is not a method or function
-   * this field will not be defined. If the element does not have a declared
-   * return type, this field will contain an empty string.
-   */
-  void set returnType(String value) {
-    this._returnType = value;
-  }
-
-  /**
-   * The type parameter list for the element. If the element doesn't have type
-   * parameters, this field will not be defined.
-   */
-  String get typeParameters => _typeParameters;
-
-  /**
-   * The type parameter list for the element. If the element doesn't have type
-   * parameters, this field will not be defined.
-   */
-  void set typeParameters(String value) {
-    this._typeParameters = value;
-  }
-
-  Element(ElementKind kind, String name, int flags, {Location location, String parameters, String returnType, String typeParameters}) {
-    this.kind = kind;
-    this.name = name;
-    this.location = location;
-    this.flags = flags;
-    this.parameters = parameters;
-    this.returnType = returnType;
-    this.typeParameters = typeParameters;
-  }
-
-  factory Element.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      ElementKind kind;
-      if (json.containsKey("kind")) {
-        kind = new ElementKind.fromJson(jsonDecoder, jsonPath + ".kind", json["kind"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "kind");
-      }
-      String name;
-      if (json.containsKey("name")) {
-        name = jsonDecoder._decodeString(jsonPath + ".name", json["name"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "name");
-      }
-      Location location;
-      if (json.containsKey("location")) {
-        location = new Location.fromJson(jsonDecoder, jsonPath + ".location", json["location"]);
-      }
-      int flags;
-      if (json.containsKey("flags")) {
-        flags = jsonDecoder._decodeInt(jsonPath + ".flags", json["flags"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "flags");
-      }
-      String parameters;
-      if (json.containsKey("parameters")) {
-        parameters = jsonDecoder._decodeString(jsonPath + ".parameters", json["parameters"]);
-      }
-      String returnType;
-      if (json.containsKey("returnType")) {
-        returnType = jsonDecoder._decodeString(jsonPath + ".returnType", json["returnType"]);
-      }
-      String typeParameters;
-      if (json.containsKey("typeParameters")) {
-        typeParameters = jsonDecoder._decodeString(jsonPath + ".typeParameters", json["typeParameters"]);
-      }
-      return new Element(kind, name, flags, location: location, parameters: parameters, returnType: returnType, typeParameters: typeParameters);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "Element", json);
-    }
-  }
-
-  bool get isAbstract => (flags & FLAG_ABSTRACT) != 0;
-  bool get isConst => (flags & FLAG_CONST) != 0;
-  bool get isFinal => (flags & FLAG_FINAL) != 0;
-  bool get isStatic => (flags & FLAG_STATIC) != 0;
-  bool get isPrivate => (flags & FLAG_PRIVATE) != 0;
-  bool get isDeprecated => (flags & FLAG_DEPRECATED) != 0;
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["kind"] = kind.toJson();
-    result["name"] = name;
-    if (location != null) {
-      result["location"] = location.toJson();
-    }
-    result["flags"] = flags;
-    if (parameters != null) {
-      result["parameters"] = parameters;
-    }
-    if (returnType != null) {
-      result["returnType"] = returnType;
-    }
-    if (typeParameters != null) {
-      result["typeParameters"] = typeParameters;
-    }
-    return result;
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is Element) {
-      return kind == other.kind &&
-          name == other.name &&
-          location == other.location &&
-          flags == other.flags &&
-          parameters == other.parameters &&
-          returnType == other.returnType &&
-          typeParameters == other.typeParameters;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, kind.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, name.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, location.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, flags.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, parameters.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, returnType.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, typeParameters.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * ElementKind
- *
- * enum {
- *   CLASS
- *   CLASS_TYPE_ALIAS
- *   COMPILATION_UNIT
- *   CONSTRUCTOR
- *   ENUM
- *   ENUM_CONSTANT
- *   FIELD
- *   FUNCTION
- *   FUNCTION_TYPE_ALIAS
- *   GETTER
- *   LABEL
- *   LIBRARY
- *   LOCAL_VARIABLE
- *   METHOD
- *   PARAMETER
- *   PREFIX
- *   SETTER
- *   TOP_LEVEL_VARIABLE
- *   TYPE_PARAMETER
- *   UNIT_TEST_GROUP
- *   UNIT_TEST_TEST
- *   UNKNOWN
- * }
- */
-class ElementKind implements Enum {
-  static const CLASS = const ElementKind._("CLASS");
-
-  static const CLASS_TYPE_ALIAS = const ElementKind._("CLASS_TYPE_ALIAS");
-
-  static const COMPILATION_UNIT = const ElementKind._("COMPILATION_UNIT");
-
-  static const CONSTRUCTOR = const ElementKind._("CONSTRUCTOR");
-
-  static const ENUM = const ElementKind._("ENUM");
-
-  static const ENUM_CONSTANT = const ElementKind._("ENUM_CONSTANT");
-
-  static const FIELD = const ElementKind._("FIELD");
-
-  static const FUNCTION = const ElementKind._("FUNCTION");
-
-  static const FUNCTION_TYPE_ALIAS = const ElementKind._("FUNCTION_TYPE_ALIAS");
-
-  static const GETTER = const ElementKind._("GETTER");
-
-  static const LABEL = const ElementKind._("LABEL");
-
-  static const LIBRARY = const ElementKind._("LIBRARY");
-
-  static const LOCAL_VARIABLE = const ElementKind._("LOCAL_VARIABLE");
-
-  static const METHOD = const ElementKind._("METHOD");
-
-  static const PARAMETER = const ElementKind._("PARAMETER");
-
-  static const PREFIX = const ElementKind._("PREFIX");
-
-  static const SETTER = const ElementKind._("SETTER");
-
-  static const TOP_LEVEL_VARIABLE = const ElementKind._("TOP_LEVEL_VARIABLE");
-
-  static const TYPE_PARAMETER = const ElementKind._("TYPE_PARAMETER");
-
-  static const UNIT_TEST_GROUP = const ElementKind._("UNIT_TEST_GROUP");
-
-  static const UNIT_TEST_TEST = const ElementKind._("UNIT_TEST_TEST");
-
-  static const UNKNOWN = const ElementKind._("UNKNOWN");
-
-  /**
-   * A list containing all of the enum values that are defined.
-   */
-  static const List<ElementKind> VALUES = const <ElementKind>[CLASS, CLASS_TYPE_ALIAS, COMPILATION_UNIT, CONSTRUCTOR, ENUM, ENUM_CONSTANT, FIELD, FUNCTION, FUNCTION_TYPE_ALIAS, GETTER, LABEL, LIBRARY, LOCAL_VARIABLE, METHOD, PARAMETER, PREFIX, SETTER, TOP_LEVEL_VARIABLE, TYPE_PARAMETER, UNIT_TEST_GROUP, UNIT_TEST_TEST, UNKNOWN];
-
-  final String name;
-
-  const ElementKind._(this.name);
-
-  factory ElementKind(String name) {
-    switch (name) {
-      case "CLASS":
-        return CLASS;
-      case "CLASS_TYPE_ALIAS":
-        return CLASS_TYPE_ALIAS;
-      case "COMPILATION_UNIT":
-        return COMPILATION_UNIT;
-      case "CONSTRUCTOR":
-        return CONSTRUCTOR;
-      case "ENUM":
-        return ENUM;
-      case "ENUM_CONSTANT":
-        return ENUM_CONSTANT;
-      case "FIELD":
-        return FIELD;
-      case "FUNCTION":
-        return FUNCTION;
-      case "FUNCTION_TYPE_ALIAS":
-        return FUNCTION_TYPE_ALIAS;
-      case "GETTER":
-        return GETTER;
-      case "LABEL":
-        return LABEL;
-      case "LIBRARY":
-        return LIBRARY;
-      case "LOCAL_VARIABLE":
-        return LOCAL_VARIABLE;
-      case "METHOD":
-        return METHOD;
-      case "PARAMETER":
-        return PARAMETER;
-      case "PREFIX":
-        return PREFIX;
-      case "SETTER":
-        return SETTER;
-      case "TOP_LEVEL_VARIABLE":
-        return TOP_LEVEL_VARIABLE;
-      case "TYPE_PARAMETER":
-        return TYPE_PARAMETER;
-      case "UNIT_TEST_GROUP":
-        return UNIT_TEST_GROUP;
-      case "UNIT_TEST_TEST":
-        return UNIT_TEST_TEST;
-      case "UNKNOWN":
-        return UNKNOWN;
-    }
-    throw new Exception('Illegal enum value: $name');
-  }
-
-  factory ElementKind.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json is String) {
-      try {
-        return new ElementKind(json);
-      } catch(_) {
-        // Fall through
-      }
-    }
-    throw jsonDecoder.mismatch(jsonPath, "ElementKind", json);
-  }
-
-  @override
-  String toString() => "ElementKind.$name";
-
-  String toJson() => name;
-}
-
-/**
- * ExecutableFile
- *
- * {
- *   "file": FilePath
- *   "kind": ExecutableKind
- * }
- */
-class ExecutableFile implements HasToJson {
-  String _file;
-
-  ExecutableKind _kind;
-
-  /**
-   * The path of the executable file.
-   */
-  String get file => _file;
-
-  /**
-   * The path of the executable file.
-   */
-  void set file(String value) {
-    assert(value != null);
-    this._file = value;
-  }
-
-  /**
-   * The kind of the executable file.
-   */
-  ExecutableKind get kind => _kind;
-
-  /**
-   * The kind of the executable file.
-   */
-  void set kind(ExecutableKind value) {
-    assert(value != null);
-    this._kind = value;
-  }
-
-  ExecutableFile(String file, ExecutableKind kind) {
-    this.file = file;
-    this.kind = kind;
-  }
-
-  factory ExecutableFile.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      String file;
-      if (json.containsKey("file")) {
-        file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "file");
-      }
-      ExecutableKind kind;
-      if (json.containsKey("kind")) {
-        kind = new ExecutableKind.fromJson(jsonDecoder, jsonPath + ".kind", json["kind"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "kind");
-      }
-      return new ExecutableFile(file, kind);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "ExecutableFile", json);
-    }
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["file"] = file;
-    result["kind"] = kind.toJson();
-    return result;
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is ExecutableFile) {
-      return file == other.file &&
-          kind == other.kind;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, file.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, kind.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * ExecutableKind
- *
- * enum {
- *   CLIENT
- *   EITHER
- *   NOT_EXECUTABLE
- *   SERVER
- * }
- */
-class ExecutableKind implements Enum {
-  static const CLIENT = const ExecutableKind._("CLIENT");
-
-  static const EITHER = const ExecutableKind._("EITHER");
-
-  static const NOT_EXECUTABLE = const ExecutableKind._("NOT_EXECUTABLE");
-
-  static const SERVER = const ExecutableKind._("SERVER");
-
-  /**
-   * A list containing all of the enum values that are defined.
-   */
-  static const List<ExecutableKind> VALUES = const <ExecutableKind>[CLIENT, EITHER, NOT_EXECUTABLE, SERVER];
-
-  final String name;
-
-  const ExecutableKind._(this.name);
-
-  factory ExecutableKind(String name) {
-    switch (name) {
-      case "CLIENT":
-        return CLIENT;
-      case "EITHER":
-        return EITHER;
-      case "NOT_EXECUTABLE":
-        return NOT_EXECUTABLE;
-      case "SERVER":
-        return SERVER;
-    }
-    throw new Exception('Illegal enum value: $name');
-  }
-
-  factory ExecutableKind.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json is String) {
-      try {
-        return new ExecutableKind(json);
-      } catch(_) {
-        // Fall through
-      }
-    }
-    throw jsonDecoder.mismatch(jsonPath, "ExecutableKind", json);
-  }
-
-  @override
-  String toString() => "ExecutableKind.$name";
-
-  String toJson() => name;
-}
-
-/**
- * ExecutionService
- *
- * enum {
- *   LAUNCH_DATA
- * }
- */
-class ExecutionService implements Enum {
-  static const LAUNCH_DATA = const ExecutionService._("LAUNCH_DATA");
-
-  /**
-   * A list containing all of the enum values that are defined.
-   */
-  static const List<ExecutionService> VALUES = const <ExecutionService>[LAUNCH_DATA];
-
-  final String name;
-
-  const ExecutionService._(this.name);
-
-  factory ExecutionService(String name) {
-    switch (name) {
-      case "LAUNCH_DATA":
-        return LAUNCH_DATA;
-    }
-    throw new Exception('Illegal enum value: $name');
-  }
-
-  factory ExecutionService.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json is String) {
-      try {
-        return new ExecutionService(json);
-      } catch(_) {
-        // Fall through
-      }
-    }
-    throw jsonDecoder.mismatch(jsonPath, "ExecutionService", json);
-  }
-
-  @override
-  String toString() => "ExecutionService.$name";
-
-  String toJson() => name;
-}
-
-/**
- * FoldingKind
- *
- * enum {
- *   COMMENT
- *   CLASS_MEMBER
- *   DIRECTIVES
- *   DOCUMENTATION_COMMENT
- *   TOP_LEVEL_DECLARATION
- * }
- */
-class FoldingKind implements Enum {
-  static const COMMENT = const FoldingKind._("COMMENT");
-
-  static const CLASS_MEMBER = const FoldingKind._("CLASS_MEMBER");
-
-  static const DIRECTIVES = const FoldingKind._("DIRECTIVES");
-
-  static const DOCUMENTATION_COMMENT = const FoldingKind._("DOCUMENTATION_COMMENT");
-
-  static const TOP_LEVEL_DECLARATION = const FoldingKind._("TOP_LEVEL_DECLARATION");
-
-  /**
-   * A list containing all of the enum values that are defined.
-   */
-  static const List<FoldingKind> VALUES = const <FoldingKind>[COMMENT, CLASS_MEMBER, DIRECTIVES, DOCUMENTATION_COMMENT, TOP_LEVEL_DECLARATION];
-
-  final String name;
-
-  const FoldingKind._(this.name);
-
-  factory FoldingKind(String name) {
-    switch (name) {
-      case "COMMENT":
-        return COMMENT;
-      case "CLASS_MEMBER":
-        return CLASS_MEMBER;
-      case "DIRECTIVES":
-        return DIRECTIVES;
-      case "DOCUMENTATION_COMMENT":
-        return DOCUMENTATION_COMMENT;
-      case "TOP_LEVEL_DECLARATION":
-        return TOP_LEVEL_DECLARATION;
-    }
-    throw new Exception('Illegal enum value: $name');
-  }
-
-  factory FoldingKind.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json is String) {
-      try {
-        return new FoldingKind(json);
-      } catch(_) {
-        // Fall through
-      }
-    }
-    throw jsonDecoder.mismatch(jsonPath, "FoldingKind", json);
-  }
-
-  @override
-  String toString() => "FoldingKind.$name";
-
-  String toJson() => name;
-}
-
-/**
- * FoldingRegion
- *
- * {
- *   "kind": FoldingKind
- *   "offset": int
- *   "length": int
- * }
- */
-class FoldingRegion implements HasToJson {
-  FoldingKind _kind;
-
-  int _offset;
-
-  int _length;
-
-  /**
-   * The kind of the region.
-   */
-  FoldingKind get kind => _kind;
-
-  /**
-   * The kind of the region.
-   */
-  void set kind(FoldingKind value) {
-    assert(value != null);
-    this._kind = value;
-  }
-
-  /**
-   * The offset of the region to be folded.
-   */
-  int get offset => _offset;
-
-  /**
-   * The offset of the region to be folded.
-   */
-  void set offset(int value) {
-    assert(value != null);
-    this._offset = value;
-  }
-
-  /**
-   * The length of the region to be folded.
-   */
-  int get length => _length;
-
-  /**
-   * The length of the region to be folded.
-   */
-  void set length(int value) {
-    assert(value != null);
-    this._length = value;
-  }
-
-  FoldingRegion(FoldingKind kind, int offset, int length) {
-    this.kind = kind;
-    this.offset = offset;
-    this.length = length;
-  }
-
-  factory FoldingRegion.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      FoldingKind kind;
-      if (json.containsKey("kind")) {
-        kind = new FoldingKind.fromJson(jsonDecoder, jsonPath + ".kind", json["kind"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "kind");
-      }
-      int offset;
-      if (json.containsKey("offset")) {
-        offset = jsonDecoder._decodeInt(jsonPath + ".offset", json["offset"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "offset");
-      }
-      int length;
-      if (json.containsKey("length")) {
-        length = jsonDecoder._decodeInt(jsonPath + ".length", json["length"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "length");
-      }
-      return new FoldingRegion(kind, offset, length);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "FoldingRegion", json);
-    }
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["kind"] = kind.toJson();
-    result["offset"] = offset;
-    result["length"] = length;
-    return result;
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is FoldingRegion) {
-      return kind == other.kind &&
-          offset == other.offset &&
-          length == other.length;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, kind.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, offset.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, length.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * GeneralAnalysisService
- *
- * enum {
- *   ANALYZED_FILES
- * }
- */
-class GeneralAnalysisService implements Enum {
-  static const ANALYZED_FILES = const GeneralAnalysisService._("ANALYZED_FILES");
-
-  /**
-   * A list containing all of the enum values that are defined.
-   */
-  static const List<GeneralAnalysisService> VALUES = const <GeneralAnalysisService>[ANALYZED_FILES];
-
-  final String name;
-
-  const GeneralAnalysisService._(this.name);
-
-  factory GeneralAnalysisService(String name) {
-    switch (name) {
-      case "ANALYZED_FILES":
-        return ANALYZED_FILES;
-    }
-    throw new Exception('Illegal enum value: $name');
-  }
-
-  factory GeneralAnalysisService.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json is String) {
-      try {
-        return new GeneralAnalysisService(json);
-      } catch(_) {
-        // Fall through
-      }
-    }
-    throw jsonDecoder.mismatch(jsonPath, "GeneralAnalysisService", json);
-  }
-
-  @override
-  String toString() => "GeneralAnalysisService.$name";
-
-  String toJson() => name;
-}
-
-/**
- * HighlightRegion
- *
- * {
- *   "type": HighlightRegionType
- *   "offset": int
- *   "length": int
- * }
- */
-class HighlightRegion implements HasToJson {
-  HighlightRegionType _type;
-
-  int _offset;
-
-  int _length;
-
-  /**
-   * The type of highlight associated with the region.
-   */
-  HighlightRegionType get type => _type;
-
-  /**
-   * The type of highlight associated with the region.
-   */
-  void set type(HighlightRegionType value) {
-    assert(value != null);
-    this._type = value;
-  }
-
-  /**
-   * The offset of the region to be highlighted.
-   */
-  int get offset => _offset;
-
-  /**
-   * The offset of the region to be highlighted.
-   */
-  void set offset(int value) {
-    assert(value != null);
-    this._offset = value;
-  }
-
-  /**
-   * The length of the region to be highlighted.
-   */
-  int get length => _length;
-
-  /**
-   * The length of the region to be highlighted.
-   */
-  void set length(int value) {
-    assert(value != null);
-    this._length = value;
-  }
-
-  HighlightRegion(HighlightRegionType type, int offset, int length) {
-    this.type = type;
-    this.offset = offset;
-    this.length = length;
-  }
-
-  factory HighlightRegion.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      HighlightRegionType type;
-      if (json.containsKey("type")) {
-        type = new HighlightRegionType.fromJson(jsonDecoder, jsonPath + ".type", json["type"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "type");
-      }
-      int offset;
-      if (json.containsKey("offset")) {
-        offset = jsonDecoder._decodeInt(jsonPath + ".offset", json["offset"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "offset");
-      }
-      int length;
-      if (json.containsKey("length")) {
-        length = jsonDecoder._decodeInt(jsonPath + ".length", json["length"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "length");
-      }
-      return new HighlightRegion(type, offset, length);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "HighlightRegion", json);
-    }
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["type"] = type.toJson();
-    result["offset"] = offset;
-    result["length"] = length;
-    return result;
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is HighlightRegion) {
-      return type == other.type &&
-          offset == other.offset &&
-          length == other.length;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, type.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, offset.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, length.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * HighlightRegionType
- *
- * enum {
- *   ANNOTATION
- *   BUILT_IN
- *   CLASS
- *   COMMENT_BLOCK
- *   COMMENT_DOCUMENTATION
- *   COMMENT_END_OF_LINE
- *   CONSTRUCTOR
- *   DIRECTIVE
- *   DYNAMIC_TYPE
- *   DYNAMIC_LOCAL_VARIABLE_DECLARATION
- *   DYNAMIC_LOCAL_VARIABLE_REFERENCE
- *   DYNAMIC_PARAMETER_DECLARATION
- *   DYNAMIC_PARAMETER_REFERENCE
- *   ENUM
- *   ENUM_CONSTANT
- *   FIELD
- *   FIELD_STATIC
- *   FUNCTION
- *   FUNCTION_DECLARATION
- *   FUNCTION_TYPE_ALIAS
- *   GETTER_DECLARATION
- *   IDENTIFIER_DEFAULT
- *   IMPORT_PREFIX
- *   INSTANCE_FIELD_DECLARATION
- *   INSTANCE_FIELD_REFERENCE
- *   INSTANCE_GETTER_DECLARATION
- *   INSTANCE_GETTER_REFERENCE
- *   INSTANCE_METHOD_DECLARATION
- *   INSTANCE_METHOD_REFERENCE
- *   INSTANCE_SETTER_DECLARATION
- *   INSTANCE_SETTER_REFERENCE
- *   INVALID_STRING_ESCAPE
- *   KEYWORD
- *   LABEL
- *   LIBRARY_NAME
- *   LITERAL_BOOLEAN
- *   LITERAL_DOUBLE
- *   LITERAL_INTEGER
- *   LITERAL_LIST
- *   LITERAL_MAP
- *   LITERAL_STRING
- *   LOCAL_FUNCTION_DECLARATION
- *   LOCAL_FUNCTION_REFERENCE
- *   LOCAL_VARIABLE
- *   LOCAL_VARIABLE_DECLARATION
- *   LOCAL_VARIABLE_REFERENCE
- *   METHOD
- *   METHOD_DECLARATION
- *   METHOD_DECLARATION_STATIC
- *   METHOD_STATIC
- *   PARAMETER
- *   SETTER_DECLARATION
- *   TOP_LEVEL_VARIABLE
- *   PARAMETER_DECLARATION
- *   PARAMETER_REFERENCE
- *   STATIC_FIELD_DECLARATION
- *   STATIC_GETTER_DECLARATION
- *   STATIC_GETTER_REFERENCE
- *   STATIC_METHOD_DECLARATION
- *   STATIC_METHOD_REFERENCE
- *   STATIC_SETTER_DECLARATION
- *   STATIC_SETTER_REFERENCE
- *   TOP_LEVEL_FUNCTION_DECLARATION
- *   TOP_LEVEL_FUNCTION_REFERENCE
- *   TOP_LEVEL_GETTER_DECLARATION
- *   TOP_LEVEL_GETTER_REFERENCE
- *   TOP_LEVEL_SETTER_DECLARATION
- *   TOP_LEVEL_SETTER_REFERENCE
- *   TOP_LEVEL_VARIABLE_DECLARATION
- *   TYPE_NAME_DYNAMIC
- *   TYPE_PARAMETER
- *   UNRESOLVED_INSTANCE_MEMBER_REFERENCE
- *   VALID_STRING_ESCAPE
- * }
- */
-class HighlightRegionType implements Enum {
-  static const ANNOTATION = const HighlightRegionType._("ANNOTATION");
-
-  static const BUILT_IN = const HighlightRegionType._("BUILT_IN");
-
-  static const CLASS = const HighlightRegionType._("CLASS");
-
-  static const COMMENT_BLOCK = const HighlightRegionType._("COMMENT_BLOCK");
-
-  static const COMMENT_DOCUMENTATION = const HighlightRegionType._("COMMENT_DOCUMENTATION");
-
-  static const COMMENT_END_OF_LINE = const HighlightRegionType._("COMMENT_END_OF_LINE");
-
-  static const CONSTRUCTOR = const HighlightRegionType._("CONSTRUCTOR");
-
-  static const DIRECTIVE = const HighlightRegionType._("DIRECTIVE");
-
-  /**
-   * Only for version 1 of highlight.
-   */
-  static const DYNAMIC_TYPE = const HighlightRegionType._("DYNAMIC_TYPE");
-
-  /**
-   * Only for version 2 of highlight.
-   */
-  static const 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");
-
-  /**
-   * Only for version 2 of highlight.
-   */
-  static const 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 ENUM = const HighlightRegionType._("ENUM");
-
-  static const ENUM_CONSTANT = const HighlightRegionType._("ENUM_CONSTANT");
-
-  /**
-   * Only for version 1 of highlight.
-   */
-  static const FIELD = const HighlightRegionType._("FIELD");
-
-  /**
-   * Only for version 1 of highlight.
-   */
-  static const FIELD_STATIC = const HighlightRegionType._("FIELD_STATIC");
-
-  /**
-   * Only for version 1 of highlight.
-   */
-  static const FUNCTION = const HighlightRegionType._("FUNCTION");
-
-  /**
-   * Only for version 1 of highlight.
-   */
-  static const FUNCTION_DECLARATION = const HighlightRegionType._("FUNCTION_DECLARATION");
-
-  static const FUNCTION_TYPE_ALIAS = const HighlightRegionType._("FUNCTION_TYPE_ALIAS");
-
-  /**
-   * Only for version 1 of highlight.
-   */
-  static const GETTER_DECLARATION = const HighlightRegionType._("GETTER_DECLARATION");
-
-  static const IDENTIFIER_DEFAULT = const HighlightRegionType._("IDENTIFIER_DEFAULT");
-
-  static const IMPORT_PREFIX = const HighlightRegionType._("IMPORT_PREFIX");
-
-  /**
-   * Only for version 2 of highlight.
-   */
-  static const INSTANCE_FIELD_DECLARATION = const HighlightRegionType._("INSTANCE_FIELD_DECLARATION");
-
-  /**
-   * Only for version 2 of highlight.
-   */
-  static const INSTANCE_FIELD_REFERENCE = const HighlightRegionType._("INSTANCE_FIELD_REFERENCE");
-
-  /**
-   * Only for version 2 of highlight.
-   */
-  static const INSTANCE_GETTER_DECLARATION = const HighlightRegionType._("INSTANCE_GETTER_DECLARATION");
-
-  /**
-   * Only for version 2 of highlight.
-   */
-  static const INSTANCE_GETTER_REFERENCE = const HighlightRegionType._("INSTANCE_GETTER_REFERENCE");
-
-  /**
-   * Only for version 2 of highlight.
-   */
-  static const INSTANCE_METHOD_DECLARATION = const HighlightRegionType._("INSTANCE_METHOD_DECLARATION");
-
-  /**
-   * Only for version 2 of highlight.
-   */
-  static const INSTANCE_METHOD_REFERENCE = const HighlightRegionType._("INSTANCE_METHOD_REFERENCE");
-
-  /**
-   * Only for version 2 of highlight.
-   */
-  static const INSTANCE_SETTER_DECLARATION = const HighlightRegionType._("INSTANCE_SETTER_DECLARATION");
-
-  /**
-   * Only for version 2 of highlight.
-   */
-  static const 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 KEYWORD = const HighlightRegionType._("KEYWORD");
-
-  static const LABEL = const HighlightRegionType._("LABEL");
-
-  /**
-   * Only for version 2 of highlight.
-   */
-  static const LIBRARY_NAME = const HighlightRegionType._("LIBRARY_NAME");
-
-  static const LITERAL_BOOLEAN = const HighlightRegionType._("LITERAL_BOOLEAN");
-
-  static const LITERAL_DOUBLE = const HighlightRegionType._("LITERAL_DOUBLE");
-
-  static const LITERAL_INTEGER = const HighlightRegionType._("LITERAL_INTEGER");
-
-  static const LITERAL_LIST = const HighlightRegionType._("LITERAL_LIST");
-
-  static const LITERAL_MAP = const HighlightRegionType._("LITERAL_MAP");
-
-  static const LITERAL_STRING = const HighlightRegionType._("LITERAL_STRING");
-
-  /**
-   * Only for version 2 of highlight.
-   */
-  static const LOCAL_FUNCTION_DECLARATION = const HighlightRegionType._("LOCAL_FUNCTION_DECLARATION");
-
-  /**
-   * Only for version 2 of highlight.
-   */
-  static const LOCAL_FUNCTION_REFERENCE = const HighlightRegionType._("LOCAL_FUNCTION_REFERENCE");
-
-  /**
-   * Only for version 1 of highlight.
-   */
-  static const LOCAL_VARIABLE = const HighlightRegionType._("LOCAL_VARIABLE");
-
-  static const LOCAL_VARIABLE_DECLARATION = const HighlightRegionType._("LOCAL_VARIABLE_DECLARATION");
-
-  /**
-   * Only for version 2 of highlight.
-   */
-  static const LOCAL_VARIABLE_REFERENCE = const HighlightRegionType._("LOCAL_VARIABLE_REFERENCE");
-
-  /**
-   * Only for version 1 of highlight.
-   */
-  static const METHOD = const HighlightRegionType._("METHOD");
-
-  /**
-   * Only for version 1 of highlight.
-   */
-  static const METHOD_DECLARATION = const HighlightRegionType._("METHOD_DECLARATION");
-
-  /**
-   * Only for version 1 of highlight.
-   */
-  static const METHOD_DECLARATION_STATIC = const HighlightRegionType._("METHOD_DECLARATION_STATIC");
-
-  /**
-   * Only for version 1 of highlight.
-   */
-  static const METHOD_STATIC = const HighlightRegionType._("METHOD_STATIC");
-
-  /**
-   * Only for version 1 of highlight.
-   */
-  static const PARAMETER = const HighlightRegionType._("PARAMETER");
-
-  /**
-   * Only for version 1 of highlight.
-   */
-  static const SETTER_DECLARATION = const HighlightRegionType._("SETTER_DECLARATION");
-
-  /**
-   * Only for version 1 of highlight.
-   */
-  static const TOP_LEVEL_VARIABLE = const HighlightRegionType._("TOP_LEVEL_VARIABLE");
-
-  /**
-   * Only for version 2 of highlight.
-   */
-  static const PARAMETER_DECLARATION = const HighlightRegionType._("PARAMETER_DECLARATION");
-
-  /**
-   * Only for version 2 of highlight.
-   */
-  static const PARAMETER_REFERENCE = const HighlightRegionType._("PARAMETER_REFERENCE");
-
-  /**
-   * Only for version 2 of highlight.
-   */
-  static const STATIC_FIELD_DECLARATION = const HighlightRegionType._("STATIC_FIELD_DECLARATION");
-
-  /**
-   * Only for version 2 of highlight.
-   */
-  static const STATIC_GETTER_DECLARATION = const HighlightRegionType._("STATIC_GETTER_DECLARATION");
-
-  /**
-   * Only for version 2 of highlight.
-   */
-  static const STATIC_GETTER_REFERENCE = const HighlightRegionType._("STATIC_GETTER_REFERENCE");
-
-  /**
-   * Only for version 2 of highlight.
-   */
-  static const STATIC_METHOD_DECLARATION = const HighlightRegionType._("STATIC_METHOD_DECLARATION");
-
-  /**
-   * Only for version 2 of highlight.
-   */
-  static const STATIC_METHOD_REFERENCE = const HighlightRegionType._("STATIC_METHOD_REFERENCE");
-
-  /**
-   * Only for version 2 of highlight.
-   */
-  static const STATIC_SETTER_DECLARATION = const HighlightRegionType._("STATIC_SETTER_DECLARATION");
-
-  /**
-   * Only for version 2 of highlight.
-   */
-  static const 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");
-
-  /**
-   * Only for version 2 of highlight.
-   */
-  static const 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");
-
-  /**
-   * Only for version 2 of highlight.
-   */
-  static const 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");
-
-  /**
-   * Only for version 2 of highlight.
-   */
-  static const 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 TYPE_NAME_DYNAMIC = const HighlightRegionType._("TYPE_NAME_DYNAMIC");
-
-  static const TYPE_PARAMETER = const HighlightRegionType._("TYPE_PARAMETER");
-
-  /**
-   * Only for version 2 of highlight.
-   */
-  static const 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");
-
-  /**
-   * A list containing all of the enum values that are defined.
-   */
-  static const List<HighlightRegionType> VALUES = const <HighlightRegionType>[ANNOTATION, BUILT_IN, CLASS, COMMENT_BLOCK, COMMENT_DOCUMENTATION, COMMENT_END_OF_LINE, CONSTRUCTOR, DIRECTIVE, DYNAMIC_TYPE, DYNAMIC_LOCAL_VARIABLE_DECLARATION, DYNAMIC_LOCAL_VARIABLE_REFERENCE, DYNAMIC_PARAMETER_DECLARATION, DYNAMIC_PARAMETER_REFERENCE, ENUM, ENUM_CONSTANT, FIELD, FIELD_STATIC, FUNCTION, FUNCTION_DECLARATION, FUNCTION_TYPE_ALIAS, GETTER_DECLARATION, IDENTIFIER_DEFAULT, IMPORT_PREFIX, INSTANCE_FIELD_DECLARATION, INSTANCE_FIELD_REFERENCE, INSTANCE_GETTER_DECLARATION, INSTANCE_GETTER_REFERENCE, INSTANCE_METHOD_DECLARATION, INSTANCE_METHOD_REFERENCE, INSTANCE_SETTER_DECLARATION, INSTANCE_SETTER_REFERENCE, INVALID_STRING_ESCAPE, KEYWORD, LABEL, LIBRARY_NAME, LITERAL_BOOLEAN, LITERAL_DOUBLE, LITERAL_INTEGER, LITERAL_LIST, LITERAL_MAP, LITERAL_STRING, LOCAL_FUNCTION_DECLARATION, LOCAL_FUNCTION_REFERENCE, LOCAL_VARIABLE, LOCAL_VARIABLE_DECLARATION, LOCAL_VARIABLE_REFERENCE, METHOD, METHOD_DECLARATION, METHOD_DECLARATION_STATIC, METHOD_STATIC, PARAMETER, SETTER_DECLARATION, TOP_LEVEL_VARIABLE, PARAMETER_DECLARATION, PARAMETER_REFERENCE, STATIC_FIELD_DECLARATION, STATIC_GETTER_DECLARATION, STATIC_GETTER_REFERENCE, STATIC_METHOD_DECLARATION, STATIC_METHOD_REFERENCE, STATIC_SETTER_DECLARATION, STATIC_SETTER_REFERENCE, TOP_LEVEL_FUNCTION_DECLARATION, TOP_LEVEL_FUNCTION_REFERENCE, TOP_LEVEL_GETTER_DECLARATION, TOP_LEVEL_GETTER_REFERENCE, TOP_LEVEL_SETTER_DECLARATION, TOP_LEVEL_SETTER_REFERENCE, TOP_LEVEL_VARIABLE_DECLARATION, TYPE_NAME_DYNAMIC, TYPE_PARAMETER, UNRESOLVED_INSTANCE_MEMBER_REFERENCE, VALID_STRING_ESCAPE];
-
-  final String name;
-
-  const HighlightRegionType._(this.name);
-
-  factory HighlightRegionType(String name) {
-    switch (name) {
-      case "ANNOTATION":
-        return ANNOTATION;
-      case "BUILT_IN":
-        return BUILT_IN;
-      case "CLASS":
-        return CLASS;
-      case "COMMENT_BLOCK":
-        return COMMENT_BLOCK;
-      case "COMMENT_DOCUMENTATION":
-        return COMMENT_DOCUMENTATION;
-      case "COMMENT_END_OF_LINE":
-        return COMMENT_END_OF_LINE;
-      case "CONSTRUCTOR":
-        return CONSTRUCTOR;
-      case "DIRECTIVE":
-        return DIRECTIVE;
-      case "DYNAMIC_TYPE":
-        return DYNAMIC_TYPE;
-      case "DYNAMIC_LOCAL_VARIABLE_DECLARATION":
-        return DYNAMIC_LOCAL_VARIABLE_DECLARATION;
-      case "DYNAMIC_LOCAL_VARIABLE_REFERENCE":
-        return DYNAMIC_LOCAL_VARIABLE_REFERENCE;
-      case "DYNAMIC_PARAMETER_DECLARATION":
-        return DYNAMIC_PARAMETER_DECLARATION;
-      case "DYNAMIC_PARAMETER_REFERENCE":
-        return DYNAMIC_PARAMETER_REFERENCE;
-      case "ENUM":
-        return ENUM;
-      case "ENUM_CONSTANT":
-        return ENUM_CONSTANT;
-      case "FIELD":
-        return FIELD;
-      case "FIELD_STATIC":
-        return FIELD_STATIC;
-      case "FUNCTION":
-        return FUNCTION;
-      case "FUNCTION_DECLARATION":
-        return FUNCTION_DECLARATION;
-      case "FUNCTION_TYPE_ALIAS":
-        return FUNCTION_TYPE_ALIAS;
-      case "GETTER_DECLARATION":
-        return GETTER_DECLARATION;
-      case "IDENTIFIER_DEFAULT":
-        return IDENTIFIER_DEFAULT;
-      case "IMPORT_PREFIX":
-        return IMPORT_PREFIX;
-      case "INSTANCE_FIELD_DECLARATION":
-        return INSTANCE_FIELD_DECLARATION;
-      case "INSTANCE_FIELD_REFERENCE":
-        return INSTANCE_FIELD_REFERENCE;
-      case "INSTANCE_GETTER_DECLARATION":
-        return INSTANCE_GETTER_DECLARATION;
-      case "INSTANCE_GETTER_REFERENCE":
-        return INSTANCE_GETTER_REFERENCE;
-      case "INSTANCE_METHOD_DECLARATION":
-        return INSTANCE_METHOD_DECLARATION;
-      case "INSTANCE_METHOD_REFERENCE":
-        return INSTANCE_METHOD_REFERENCE;
-      case "INSTANCE_SETTER_DECLARATION":
-        return INSTANCE_SETTER_DECLARATION;
-      case "INSTANCE_SETTER_REFERENCE":
-        return INSTANCE_SETTER_REFERENCE;
-      case "INVALID_STRING_ESCAPE":
-        return INVALID_STRING_ESCAPE;
-      case "KEYWORD":
-        return KEYWORD;
-      case "LABEL":
-        return LABEL;
-      case "LIBRARY_NAME":
-        return LIBRARY_NAME;
-      case "LITERAL_BOOLEAN":
-        return LITERAL_BOOLEAN;
-      case "LITERAL_DOUBLE":
-        return LITERAL_DOUBLE;
-      case "LITERAL_INTEGER":
-        return LITERAL_INTEGER;
-      case "LITERAL_LIST":
-        return LITERAL_LIST;
-      case "LITERAL_MAP":
-        return LITERAL_MAP;
-      case "LITERAL_STRING":
-        return LITERAL_STRING;
-      case "LOCAL_FUNCTION_DECLARATION":
-        return LOCAL_FUNCTION_DECLARATION;
-      case "LOCAL_FUNCTION_REFERENCE":
-        return LOCAL_FUNCTION_REFERENCE;
-      case "LOCAL_VARIABLE":
-        return LOCAL_VARIABLE;
-      case "LOCAL_VARIABLE_DECLARATION":
-        return LOCAL_VARIABLE_DECLARATION;
-      case "LOCAL_VARIABLE_REFERENCE":
-        return LOCAL_VARIABLE_REFERENCE;
-      case "METHOD":
-        return METHOD;
-      case "METHOD_DECLARATION":
-        return METHOD_DECLARATION;
-      case "METHOD_DECLARATION_STATIC":
-        return METHOD_DECLARATION_STATIC;
-      case "METHOD_STATIC":
-        return METHOD_STATIC;
-      case "PARAMETER":
-        return PARAMETER;
-      case "SETTER_DECLARATION":
-        return SETTER_DECLARATION;
-      case "TOP_LEVEL_VARIABLE":
-        return TOP_LEVEL_VARIABLE;
-      case "PARAMETER_DECLARATION":
-        return PARAMETER_DECLARATION;
-      case "PARAMETER_REFERENCE":
-        return PARAMETER_REFERENCE;
-      case "STATIC_FIELD_DECLARATION":
-        return STATIC_FIELD_DECLARATION;
-      case "STATIC_GETTER_DECLARATION":
-        return STATIC_GETTER_DECLARATION;
-      case "STATIC_GETTER_REFERENCE":
-        return STATIC_GETTER_REFERENCE;
-      case "STATIC_METHOD_DECLARATION":
-        return STATIC_METHOD_DECLARATION;
-      case "STATIC_METHOD_REFERENCE":
-        return STATIC_METHOD_REFERENCE;
-      case "STATIC_SETTER_DECLARATION":
-        return STATIC_SETTER_DECLARATION;
-      case "STATIC_SETTER_REFERENCE":
-        return STATIC_SETTER_REFERENCE;
-      case "TOP_LEVEL_FUNCTION_DECLARATION":
-        return TOP_LEVEL_FUNCTION_DECLARATION;
-      case "TOP_LEVEL_FUNCTION_REFERENCE":
-        return TOP_LEVEL_FUNCTION_REFERENCE;
-      case "TOP_LEVEL_GETTER_DECLARATION":
-        return TOP_LEVEL_GETTER_DECLARATION;
-      case "TOP_LEVEL_GETTER_REFERENCE":
-        return TOP_LEVEL_GETTER_REFERENCE;
-      case "TOP_LEVEL_SETTER_DECLARATION":
-        return TOP_LEVEL_SETTER_DECLARATION;
-      case "TOP_LEVEL_SETTER_REFERENCE":
-        return TOP_LEVEL_SETTER_REFERENCE;
-      case "TOP_LEVEL_VARIABLE_DECLARATION":
-        return TOP_LEVEL_VARIABLE_DECLARATION;
-      case "TYPE_NAME_DYNAMIC":
-        return TYPE_NAME_DYNAMIC;
-      case "TYPE_PARAMETER":
-        return TYPE_PARAMETER;
-      case "UNRESOLVED_INSTANCE_MEMBER_REFERENCE":
-        return UNRESOLVED_INSTANCE_MEMBER_REFERENCE;
-      case "VALID_STRING_ESCAPE":
-        return VALID_STRING_ESCAPE;
-    }
-    throw new Exception('Illegal enum value: $name');
-  }
-
-  factory HighlightRegionType.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json is String) {
-      try {
-        return new HighlightRegionType(json);
-      } catch(_) {
-        // Fall through
-      }
-    }
-    throw jsonDecoder.mismatch(jsonPath, "HighlightRegionType", json);
-  }
-
-  @override
-  String toString() => "HighlightRegionType.$name";
-
-  String toJson() => name;
-}
-
-/**
- * HoverInformation
- *
- * {
- *   "offset": int
- *   "length": int
- *   "containingLibraryPath": optional String
- *   "containingLibraryName": optional String
- *   "containingClassDescription": optional String
- *   "dartdoc": optional String
- *   "elementDescription": optional String
- *   "elementKind": optional String
- *   "parameter": optional String
- *   "propagatedType": optional String
- *   "staticType": optional String
- * }
- */
-class HoverInformation implements HasToJson {
-  int _offset;
-
-  int _length;
-
-  String _containingLibraryPath;
-
-  String _containingLibraryName;
-
-  String _containingClassDescription;
-
-  String _dartdoc;
-
-  String _elementDescription;
-
-  String _elementKind;
-
-  String _parameter;
-
-  String _propagatedType;
-
-  String _staticType;
-
-  /**
-   * The offset of the range of characters that encompases the cursor position
-   * and has the same hover information as the cursor position.
-   */
-  int get offset => _offset;
-
-  /**
-   * The offset of the range of characters that encompases the cursor position
-   * and has the same hover information as the cursor position.
-   */
-  void set offset(int value) {
-    assert(value != null);
-    this._offset = value;
-  }
-
-  /**
-   * The length of the range of characters that encompases the cursor position
-   * and has the same hover information as the cursor position.
-   */
-  int get length => _length;
-
-  /**
-   * The length of the range of characters that encompases the cursor position
-   * and has the same hover information as the cursor position.
-   */
-  void set length(int value) {
-    assert(value != null);
-    this._length = value;
-  }
-
-  /**
-   * The path to the defining compilation unit of the library in which the
-   * referenced element is declared. This data is omitted if there is no
-   * referenced element, or if the element is declared inside an HTML file.
-   */
-  String get containingLibraryPath => _containingLibraryPath;
-
-  /**
-   * The path to the defining compilation unit of the library in which the
-   * referenced element is declared. This data is omitted if there is no
-   * referenced element, or if the element is declared inside an HTML file.
-   */
-  void set containingLibraryPath(String value) {
-    this._containingLibraryPath = value;
-  }
-
-  /**
-   * The name of the library in which the referenced element is declared. This
-   * data is omitted if there is no referenced element, or if the element is
-   * declared inside an HTML file.
-   */
-  String get containingLibraryName => _containingLibraryName;
-
-  /**
-   * The name of the library in which the referenced element is declared. This
-   * data is omitted if there is no referenced element, or if the element is
-   * declared inside an HTML file.
-   */
-  void set containingLibraryName(String value) {
-    this._containingLibraryName = value;
-  }
-
-  /**
-   * A human-readable description of the class declaring the element being
-   * referenced. This data is omitted if there is no referenced element, or if
-   * the element is not a class member.
-   */
-  String get containingClassDescription => _containingClassDescription;
-
-  /**
-   * A human-readable description of the class declaring the element being
-   * referenced. This data is omitted if there is no referenced element, or if
-   * the element is not a class member.
-   */
-  void set containingClassDescription(String value) {
-    this._containingClassDescription = value;
-  }
-
-  /**
-   * The dartdoc associated with the referenced element. Other than the removal
-   * of the comment delimiters, including leading asterisks in the case of a
-   * block comment, the dartdoc is unprocessed markdown. This data is omitted
-   * if there is no referenced element, or if the element has no dartdoc.
-   */
-  String get dartdoc => _dartdoc;
-
-  /**
-   * The dartdoc associated with the referenced element. Other than the removal
-   * of the comment delimiters, including leading asterisks in the case of a
-   * block comment, the dartdoc is unprocessed markdown. This data is omitted
-   * if there is no referenced element, or if the element has no dartdoc.
-   */
-  void set dartdoc(String value) {
-    this._dartdoc = value;
-  }
-
-  /**
-   * A human-readable description of the element being referenced. This data is
-   * omitted if there is no referenced element.
-   */
-  String get elementDescription => _elementDescription;
-
-  /**
-   * A human-readable description of the element being referenced. This data is
-   * omitted if there is no referenced element.
-   */
-  void set elementDescription(String value) {
-    this._elementDescription = value;
-  }
-
-  /**
-   * A human-readable description of the kind of element being referenced (such
-   * as “class” or “function type alias”). This data is omitted if there is no
-   * referenced element.
-   */
-  String get elementKind => _elementKind;
-
-  /**
-   * A human-readable description of the kind of element being referenced (such
-   * as “class” or “function type alias”). This data is omitted if there is no
-   * referenced element.
-   */
-  void set elementKind(String value) {
-    this._elementKind = value;
-  }
-
-  /**
-   * A human-readable description of the parameter corresponding to the
-   * expression being hovered over. This data is omitted if the location is not
-   * in an argument to a function.
-   */
-  String get parameter => _parameter;
-
-  /**
-   * A human-readable description of the parameter corresponding to the
-   * expression being hovered over. This data is omitted if the location is not
-   * in an argument to a function.
-   */
-  void set parameter(String value) {
-    this._parameter = value;
-  }
-
-  /**
-   * The name of the propagated type of the expression. This data is omitted if
-   * the location does not correspond to an expression or if there is no
-   * propagated type information.
-   */
-  String get propagatedType => _propagatedType;
-
-  /**
-   * The name of the propagated type of the expression. This data is omitted if
-   * the location does not correspond to an expression or if there is no
-   * propagated type information.
-   */
-  void set propagatedType(String value) {
-    this._propagatedType = value;
-  }
-
-  /**
-   * The name of the static type of the expression. This data is omitted if the
-   * location does not correspond to an expression.
-   */
-  String get staticType => _staticType;
-
-  /**
-   * The name of the static type of the expression. This data is omitted if the
-   * location does not correspond to an expression.
-   */
-  void set staticType(String value) {
-    this._staticType = value;
-  }
-
-  HoverInformation(int offset, int length, {String containingLibraryPath, String containingLibraryName, String containingClassDescription, String dartdoc, String elementDescription, String elementKind, String parameter, String propagatedType, String staticType}) {
-    this.offset = offset;
-    this.length = length;
-    this.containingLibraryPath = containingLibraryPath;
-    this.containingLibraryName = containingLibraryName;
-    this.containingClassDescription = containingClassDescription;
-    this.dartdoc = dartdoc;
-    this.elementDescription = elementDescription;
-    this.elementKind = elementKind;
-    this.parameter = parameter;
-    this.propagatedType = propagatedType;
-    this.staticType = staticType;
-  }
-
-  factory HoverInformation.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      int offset;
-      if (json.containsKey("offset")) {
-        offset = jsonDecoder._decodeInt(jsonPath + ".offset", json["offset"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "offset");
-      }
-      int length;
-      if (json.containsKey("length")) {
-        length = jsonDecoder._decodeInt(jsonPath + ".length", json["length"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "length");
-      }
-      String containingLibraryPath;
-      if (json.containsKey("containingLibraryPath")) {
-        containingLibraryPath = jsonDecoder._decodeString(jsonPath + ".containingLibraryPath", json["containingLibraryPath"]);
-      }
-      String containingLibraryName;
-      if (json.containsKey("containingLibraryName")) {
-        containingLibraryName = jsonDecoder._decodeString(jsonPath + ".containingLibraryName", json["containingLibraryName"]);
-      }
-      String containingClassDescription;
-      if (json.containsKey("containingClassDescription")) {
-        containingClassDescription = jsonDecoder._decodeString(jsonPath + ".containingClassDescription", json["containingClassDescription"]);
-      }
-      String dartdoc;
-      if (json.containsKey("dartdoc")) {
-        dartdoc = jsonDecoder._decodeString(jsonPath + ".dartdoc", json["dartdoc"]);
-      }
-      String elementDescription;
-      if (json.containsKey("elementDescription")) {
-        elementDescription = jsonDecoder._decodeString(jsonPath + ".elementDescription", json["elementDescription"]);
-      }
-      String elementKind;
-      if (json.containsKey("elementKind")) {
-        elementKind = jsonDecoder._decodeString(jsonPath + ".elementKind", json["elementKind"]);
-      }
-      String parameter;
-      if (json.containsKey("parameter")) {
-        parameter = jsonDecoder._decodeString(jsonPath + ".parameter", json["parameter"]);
-      }
-      String propagatedType;
-      if (json.containsKey("propagatedType")) {
-        propagatedType = jsonDecoder._decodeString(jsonPath + ".propagatedType", json["propagatedType"]);
-      }
-      String staticType;
-      if (json.containsKey("staticType")) {
-        staticType = jsonDecoder._decodeString(jsonPath + ".staticType", json["staticType"]);
-      }
-      return new HoverInformation(offset, length, containingLibraryPath: containingLibraryPath, containingLibraryName: containingLibraryName, containingClassDescription: containingClassDescription, dartdoc: dartdoc, elementDescription: elementDescription, elementKind: elementKind, parameter: parameter, propagatedType: propagatedType, staticType: staticType);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "HoverInformation", json);
-    }
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["offset"] = offset;
-    result["length"] = length;
-    if (containingLibraryPath != null) {
-      result["containingLibraryPath"] = containingLibraryPath;
-    }
-    if (containingLibraryName != null) {
-      result["containingLibraryName"] = containingLibraryName;
-    }
-    if (containingClassDescription != null) {
-      result["containingClassDescription"] = containingClassDescription;
-    }
-    if (dartdoc != null) {
-      result["dartdoc"] = dartdoc;
-    }
-    if (elementDescription != null) {
-      result["elementDescription"] = elementDescription;
-    }
-    if (elementKind != null) {
-      result["elementKind"] = elementKind;
-    }
-    if (parameter != null) {
-      result["parameter"] = parameter;
-    }
-    if (propagatedType != null) {
-      result["propagatedType"] = propagatedType;
-    }
-    if (staticType != null) {
-      result["staticType"] = staticType;
-    }
-    return result;
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is HoverInformation) {
-      return offset == other.offset &&
-          length == other.length &&
-          containingLibraryPath == other.containingLibraryPath &&
-          containingLibraryName == other.containingLibraryName &&
-          containingClassDescription == other.containingClassDescription &&
-          dartdoc == other.dartdoc &&
-          elementDescription == other.elementDescription &&
-          elementKind == other.elementKind &&
-          parameter == other.parameter &&
-          propagatedType == other.propagatedType &&
-          staticType == other.staticType;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, offset.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, length.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, containingLibraryPath.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, containingLibraryName.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, containingClassDescription.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, dartdoc.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, elementDescription.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, elementKind.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, parameter.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, propagatedType.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, staticType.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * LinkedEditGroup
- *
- * {
- *   "positions": List<Position>
- *   "length": int
- *   "suggestions": List<LinkedEditSuggestion>
- * }
- */
-class LinkedEditGroup implements HasToJson {
-  List<Position> _positions;
-
-  int _length;
-
-  List<LinkedEditSuggestion> _suggestions;
-
-  /**
-   * The positions of the regions that should be edited simultaneously.
-   */
-  List<Position> get positions => _positions;
-
-  /**
-   * The positions of the regions that should be edited simultaneously.
-   */
-  void set positions(List<Position> value) {
-    assert(value != null);
-    this._positions = value;
-  }
-
-  /**
-   * The length of the regions that should be edited simultaneously.
-   */
-  int get length => _length;
-
-  /**
-   * The length of the regions that should be edited simultaneously.
-   */
-  void set length(int value) {
-    assert(value != null);
-    this._length = value;
-  }
-
-  /**
-   * Pre-computed suggestions for what every region might want to be changed
-   * to.
-   */
-  List<LinkedEditSuggestion> get suggestions => _suggestions;
-
-  /**
-   * Pre-computed suggestions for what every region might want to be changed
-   * to.
-   */
-  void set suggestions(List<LinkedEditSuggestion> value) {
-    assert(value != null);
-    this._suggestions = value;
-  }
-
-  LinkedEditGroup(List<Position> positions, int length, List<LinkedEditSuggestion> suggestions) {
-    this.positions = positions;
-    this.length = length;
-    this.suggestions = suggestions;
-  }
-
-  factory LinkedEditGroup.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      List<Position> positions;
-      if (json.containsKey("positions")) {
-        positions = jsonDecoder._decodeList(jsonPath + ".positions", json["positions"], (String jsonPath, Object json) => new Position.fromJson(jsonDecoder, jsonPath, json));
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "positions");
-      }
-      int length;
-      if (json.containsKey("length")) {
-        length = jsonDecoder._decodeInt(jsonPath + ".length", json["length"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "length");
-      }
-      List<LinkedEditSuggestion> suggestions;
-      if (json.containsKey("suggestions")) {
-        suggestions = jsonDecoder._decodeList(jsonPath + ".suggestions", json["suggestions"], (String jsonPath, Object json) => new LinkedEditSuggestion.fromJson(jsonDecoder, jsonPath, json));
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "suggestions");
-      }
-      return new LinkedEditGroup(positions, length, suggestions);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "LinkedEditGroup", json);
-    }
-  }
-
-  /**
-   * Construct an empty LinkedEditGroup.
-   */
-  LinkedEditGroup.empty() : this(<Position>[], 0, <LinkedEditSuggestion>[]);
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["positions"] = positions.map((Position value) => value.toJson()).toList();
-    result["length"] = length;
-    result["suggestions"] = suggestions.map((LinkedEditSuggestion value) => value.toJson()).toList();
-    return result;
-  }
-
-  /**
-   * Add a new position and change the length.
-   */
-  void addPosition(Position position, int length) {
-    positions.add(position);
-    this.length = length;
-  }
-
-  /**
-   * Add a new suggestion.
-   */
-  void addSuggestion(LinkedEditSuggestion suggestion) {
-    suggestions.add(suggestion);
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is LinkedEditGroup) {
-      return _listEqual(positions, other.positions, (Position a, Position b) => a == b) &&
-          length == other.length &&
-          _listEqual(suggestions, other.suggestions, (LinkedEditSuggestion a, LinkedEditSuggestion b) => a == b);
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, positions.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, length.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, suggestions.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * LinkedEditSuggestion
- *
- * {
- *   "value": String
- *   "kind": LinkedEditSuggestionKind
- * }
- */
-class LinkedEditSuggestion implements HasToJson {
-  String _value;
-
-  LinkedEditSuggestionKind _kind;
-
-  /**
-   * The value that could be used to replace all of the linked edit regions.
-   */
-  String get value => _value;
-
-  /**
-   * The value that could be used to replace all of the linked edit regions.
-   */
-  void set value(String value) {
-    assert(value != null);
-    this._value = value;
-  }
-
-  /**
-   * The kind of value being proposed.
-   */
-  LinkedEditSuggestionKind get kind => _kind;
-
-  /**
-   * The kind of value being proposed.
-   */
-  void set kind(LinkedEditSuggestionKind value) {
-    assert(value != null);
-    this._kind = value;
-  }
-
-  LinkedEditSuggestion(String value, LinkedEditSuggestionKind kind) {
-    this.value = value;
-    this.kind = kind;
-  }
-
-  factory LinkedEditSuggestion.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      String value;
-      if (json.containsKey("value")) {
-        value = jsonDecoder._decodeString(jsonPath + ".value", json["value"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "value");
-      }
-      LinkedEditSuggestionKind kind;
-      if (json.containsKey("kind")) {
-        kind = new LinkedEditSuggestionKind.fromJson(jsonDecoder, jsonPath + ".kind", json["kind"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "kind");
-      }
-      return new LinkedEditSuggestion(value, kind);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "LinkedEditSuggestion", json);
-    }
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["value"] = value;
-    result["kind"] = kind.toJson();
-    return result;
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is LinkedEditSuggestion) {
-      return value == other.value &&
-          kind == other.kind;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, value.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, kind.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * LinkedEditSuggestionKind
- *
- * enum {
- *   METHOD
- *   PARAMETER
- *   TYPE
- *   VARIABLE
- * }
- */
-class LinkedEditSuggestionKind implements Enum {
-  static const METHOD = const LinkedEditSuggestionKind._("METHOD");
-
-  static const PARAMETER = const LinkedEditSuggestionKind._("PARAMETER");
-
-  static const TYPE = const LinkedEditSuggestionKind._("TYPE");
-
-  static const VARIABLE = const LinkedEditSuggestionKind._("VARIABLE");
-
-  /**
-   * A list containing all of the enum values that are defined.
-   */
-  static const List<LinkedEditSuggestionKind> VALUES = const <LinkedEditSuggestionKind>[METHOD, PARAMETER, TYPE, VARIABLE];
-
-  final String name;
-
-  const LinkedEditSuggestionKind._(this.name);
-
-  factory LinkedEditSuggestionKind(String name) {
-    switch (name) {
-      case "METHOD":
-        return METHOD;
-      case "PARAMETER":
-        return PARAMETER;
-      case "TYPE":
-        return TYPE;
-      case "VARIABLE":
-        return VARIABLE;
-    }
-    throw new Exception('Illegal enum value: $name');
-  }
-
-  factory LinkedEditSuggestionKind.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json is String) {
-      try {
-        return new LinkedEditSuggestionKind(json);
-      } catch(_) {
-        // Fall through
-      }
-    }
-    throw jsonDecoder.mismatch(jsonPath, "LinkedEditSuggestionKind", json);
-  }
-
-  @override
-  String toString() => "LinkedEditSuggestionKind.$name";
-
-  String toJson() => name;
-}
-
-/**
- * Location
- *
- * {
- *   "file": FilePath
- *   "offset": int
- *   "length": int
- *   "startLine": int
- *   "startColumn": int
- * }
- */
-class Location implements HasToJson {
-  String _file;
-
-  int _offset;
-
-  int _length;
-
-  int _startLine;
-
-  int _startColumn;
-
-  /**
-   * The file containing the range.
-   */
-  String get file => _file;
-
-  /**
-   * The file containing the range.
-   */
-  void set file(String value) {
-    assert(value != null);
-    this._file = value;
-  }
-
-  /**
-   * The offset of the range.
-   */
-  int get offset => _offset;
-
-  /**
-   * The offset of the range.
-   */
-  void set offset(int value) {
-    assert(value != null);
-    this._offset = value;
-  }
-
-  /**
-   * The length of the range.
-   */
-  int get length => _length;
-
-  /**
-   * The length of the range.
-   */
-  void set length(int value) {
-    assert(value != null);
-    this._length = value;
-  }
-
-  /**
-   * The one-based index of the line containing the first character of the
-   * range.
-   */
-  int get startLine => _startLine;
-
-  /**
-   * The one-based index of the line containing the first character of the
-   * range.
-   */
-  void set startLine(int value) {
-    assert(value != null);
-    this._startLine = value;
-  }
-
-  /**
-   * The one-based index of the column containing the first character of the
-   * range.
-   */
-  int get startColumn => _startColumn;
-
-  /**
-   * The one-based index of the column containing the first character of the
-   * range.
-   */
-  void set startColumn(int value) {
-    assert(value != null);
-    this._startColumn = value;
-  }
-
-  Location(String file, int offset, int length, int startLine, int startColumn) {
-    this.file = file;
-    this.offset = offset;
-    this.length = length;
-    this.startLine = startLine;
-    this.startColumn = startColumn;
-  }
-
-  factory Location.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      String file;
-      if (json.containsKey("file")) {
-        file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "file");
-      }
-      int offset;
-      if (json.containsKey("offset")) {
-        offset = jsonDecoder._decodeInt(jsonPath + ".offset", json["offset"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "offset");
-      }
-      int length;
-      if (json.containsKey("length")) {
-        length = jsonDecoder._decodeInt(jsonPath + ".length", json["length"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "length");
-      }
-      int startLine;
-      if (json.containsKey("startLine")) {
-        startLine = jsonDecoder._decodeInt(jsonPath + ".startLine", json["startLine"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "startLine");
-      }
-      int startColumn;
-      if (json.containsKey("startColumn")) {
-        startColumn = jsonDecoder._decodeInt(jsonPath + ".startColumn", json["startColumn"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "startColumn");
-      }
-      return new Location(file, offset, length, startLine, startColumn);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "Location", json);
-    }
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["file"] = file;
-    result["offset"] = offset;
-    result["length"] = length;
-    result["startLine"] = startLine;
-    result["startColumn"] = startColumn;
-    return result;
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is Location) {
-      return file == other.file &&
-          offset == other.offset &&
-          length == other.length &&
-          startLine == other.startLine &&
-          startColumn == other.startColumn;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, file.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, offset.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, length.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, startLine.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, startColumn.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * NavigationRegion
- *
- * {
- *   "offset": int
- *   "length": int
- *   "targets": List<int>
- * }
- */
-class NavigationRegion implements HasToJson {
-  int _offset;
-
-  int _length;
-
-  List<int> _targets;
-
-  /**
-   * The offset of the region from which the user can navigate.
-   */
-  int get offset => _offset;
-
-  /**
-   * The offset of the region from which the user can navigate.
-   */
-  void set offset(int value) {
-    assert(value != null);
-    this._offset = value;
-  }
-
-  /**
-   * The length of the region from which the user can navigate.
-   */
-  int get length => _length;
-
-  /**
-   * The length of the region from which the user can navigate.
-   */
-  void set length(int value) {
-    assert(value != null);
-    this._length = value;
-  }
-
-  /**
-   * The indexes of the targets (in the enclosing navigation response) to which
-   * the given region is bound. By opening the target, clients can implement
-   * one form of navigation.
-   */
-  List<int> get targets => _targets;
-
-  /**
-   * The indexes of the targets (in the enclosing navigation response) to which
-   * the given region is bound. By opening the target, clients can implement
-   * one form of navigation.
-   */
-  void set targets(List<int> value) {
-    assert(value != null);
-    this._targets = value;
-  }
-
-  NavigationRegion(int offset, int length, List<int> targets) {
-    this.offset = offset;
-    this.length = length;
-    this.targets = targets;
-  }
-
-  factory NavigationRegion.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      int offset;
-      if (json.containsKey("offset")) {
-        offset = jsonDecoder._decodeInt(jsonPath + ".offset", json["offset"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "offset");
-      }
-      int length;
-      if (json.containsKey("length")) {
-        length = jsonDecoder._decodeInt(jsonPath + ".length", json["length"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "length");
-      }
-      List<int> targets;
-      if (json.containsKey("targets")) {
-        targets = jsonDecoder._decodeList(jsonPath + ".targets", json["targets"], jsonDecoder._decodeInt);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "targets");
-      }
-      return new NavigationRegion(offset, length, targets);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "NavigationRegion", json);
-    }
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["offset"] = offset;
-    result["length"] = length;
-    result["targets"] = targets;
-    return result;
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is NavigationRegion) {
-      return offset == other.offset &&
-          length == other.length &&
-          _listEqual(targets, other.targets, (int a, int b) => a == b);
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, offset.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, length.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, targets.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * NavigationTarget
- *
- * {
- *   "kind": ElementKind
- *   "fileIndex": int
- *   "offset": int
- *   "length": int
- *   "startLine": int
- *   "startColumn": int
- * }
- */
-class NavigationTarget implements HasToJson {
-  ElementKind _kind;
-
-  int _fileIndex;
-
-  int _offset;
-
-  int _length;
-
-  int _startLine;
-
-  int _startColumn;
-
-  /**
-   * The kind of the element.
-   */
-  ElementKind get kind => _kind;
-
-  /**
-   * The kind of the element.
-   */
-  void set kind(ElementKind value) {
-    assert(value != null);
-    this._kind = value;
-  }
-
-  /**
-   * The index of the file (in the enclosing navigation response) to navigate
-   * to.
-   */
-  int get fileIndex => _fileIndex;
-
-  /**
-   * The index of the file (in the enclosing navigation response) to navigate
-   * to.
-   */
-  void set fileIndex(int value) {
-    assert(value != null);
-    this._fileIndex = value;
-  }
-
-  /**
-   * The offset of the region from which the user can navigate.
-   */
-  int get offset => _offset;
-
-  /**
-   * The offset of the region from which the user can navigate.
-   */
-  void set offset(int value) {
-    assert(value != null);
-    this._offset = value;
-  }
-
-  /**
-   * The length of the region from which the user can navigate.
-   */
-  int get length => _length;
-
-  /**
-   * The length of the region from which the user can navigate.
-   */
-  void set length(int value) {
-    assert(value != null);
-    this._length = value;
-  }
-
-  /**
-   * The one-based index of the line containing the first character of the
-   * region.
-   */
-  int get startLine => _startLine;
-
-  /**
-   * The one-based index of the line containing the first character of the
-   * region.
-   */
-  void set startLine(int value) {
-    assert(value != null);
-    this._startLine = value;
-  }
-
-  /**
-   * The one-based index of the column containing the first character of the
-   * region.
-   */
-  int get startColumn => _startColumn;
-
-  /**
-   * The one-based index of the column containing the first character of the
-   * region.
-   */
-  void set startColumn(int value) {
-    assert(value != null);
-    this._startColumn = value;
-  }
-
-  NavigationTarget(ElementKind kind, int fileIndex, int offset, int length, int startLine, int startColumn) {
-    this.kind = kind;
-    this.fileIndex = fileIndex;
-    this.offset = offset;
-    this.length = length;
-    this.startLine = startLine;
-    this.startColumn = startColumn;
-  }
-
-  factory NavigationTarget.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      ElementKind kind;
-      if (json.containsKey("kind")) {
-        kind = new ElementKind.fromJson(jsonDecoder, jsonPath + ".kind", json["kind"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "kind");
-      }
-      int fileIndex;
-      if (json.containsKey("fileIndex")) {
-        fileIndex = jsonDecoder._decodeInt(jsonPath + ".fileIndex", json["fileIndex"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "fileIndex");
-      }
-      int offset;
-      if (json.containsKey("offset")) {
-        offset = jsonDecoder._decodeInt(jsonPath + ".offset", json["offset"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "offset");
-      }
-      int length;
-      if (json.containsKey("length")) {
-        length = jsonDecoder._decodeInt(jsonPath + ".length", json["length"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "length");
-      }
-      int startLine;
-      if (json.containsKey("startLine")) {
-        startLine = jsonDecoder._decodeInt(jsonPath + ".startLine", json["startLine"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "startLine");
-      }
-      int startColumn;
-      if (json.containsKey("startColumn")) {
-        startColumn = jsonDecoder._decodeInt(jsonPath + ".startColumn", json["startColumn"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "startColumn");
-      }
-      return new NavigationTarget(kind, fileIndex, offset, length, startLine, startColumn);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "NavigationTarget", json);
-    }
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["kind"] = kind.toJson();
-    result["fileIndex"] = fileIndex;
-    result["offset"] = offset;
-    result["length"] = length;
-    result["startLine"] = startLine;
-    result["startColumn"] = startColumn;
-    return result;
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is NavigationTarget) {
-      return kind == other.kind &&
-          fileIndex == other.fileIndex &&
-          offset == other.offset &&
-          length == other.length &&
-          startLine == other.startLine &&
-          startColumn == other.startColumn;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, kind.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, fileIndex.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, offset.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, length.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, startLine.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, startColumn.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * Occurrences
- *
- * {
- *   "element": Element
- *   "offsets": List<int>
- *   "length": int
- * }
- */
-class Occurrences implements HasToJson {
-  Element _element;
-
-  List<int> _offsets;
-
-  int _length;
-
-  /**
-   * The element that was referenced.
-   */
-  Element get element => _element;
-
-  /**
-   * The element that was referenced.
-   */
-  void set element(Element value) {
-    assert(value != null);
-    this._element = value;
-  }
-
-  /**
-   * The offsets of the name of the referenced element within the file.
-   */
-  List<int> get offsets => _offsets;
-
-  /**
-   * The offsets of the name of the referenced element within the file.
-   */
-  void set offsets(List<int> value) {
-    assert(value != null);
-    this._offsets = value;
-  }
-
-  /**
-   * The length of the name of the referenced element.
-   */
-  int get length => _length;
-
-  /**
-   * The length of the name of the referenced element.
-   */
-  void set length(int value) {
-    assert(value != null);
-    this._length = value;
-  }
-
-  Occurrences(Element element, List<int> offsets, int length) {
-    this.element = element;
-    this.offsets = offsets;
-    this.length = length;
-  }
-
-  factory Occurrences.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      Element element;
-      if (json.containsKey("element")) {
-        element = new Element.fromJson(jsonDecoder, jsonPath + ".element", json["element"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "element");
-      }
-      List<int> offsets;
-      if (json.containsKey("offsets")) {
-        offsets = jsonDecoder._decodeList(jsonPath + ".offsets", json["offsets"], jsonDecoder._decodeInt);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "offsets");
-      }
-      int length;
-      if (json.containsKey("length")) {
-        length = jsonDecoder._decodeInt(jsonPath + ".length", json["length"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "length");
-      }
-      return new Occurrences(element, offsets, length);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "Occurrences", json);
-    }
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["element"] = element.toJson();
-    result["offsets"] = offsets;
-    result["length"] = length;
-    return result;
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is Occurrences) {
-      return element == other.element &&
-          _listEqual(offsets, other.offsets, (int a, int b) => a == b) &&
-          length == other.length;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, element.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, offsets.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, length.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * Outline
- *
- * {
- *   "element": Element
- *   "offset": int
- *   "length": int
- *   "children": optional List<Outline>
- * }
- */
-class Outline implements HasToJson {
-  Element _element;
-
-  int _offset;
-
-  int _length;
-
-  List<Outline> _children;
-
-  /**
-   * A description of the element represented by this node.
-   */
-  Element get element => _element;
-
-  /**
-   * A description of the element represented by this node.
-   */
-  void set element(Element value) {
-    assert(value != null);
-    this._element = value;
-  }
-
-  /**
-   * The offset of the first character of the element. This is different than
-   * the offset in the Element, which if the offset of the name of the element.
-   * It can be used, for example, to map locations in the file back to an
-   * outline.
-   */
-  int get offset => _offset;
-
-  /**
-   * The offset of the first character of the element. This is different than
-   * the offset in the Element, which if the offset of the name of the element.
-   * It can be used, for example, to map locations in the file back to an
-   * outline.
-   */
-  void set offset(int value) {
-    assert(value != null);
-    this._offset = value;
-  }
-
-  /**
-   * The length of the element.
-   */
-  int get length => _length;
-
-  /**
-   * The length of the element.
-   */
-  void set length(int value) {
-    assert(value != null);
-    this._length = value;
-  }
-
-  /**
-   * The children of the node. The field will be omitted if the node has no
-   * children.
-   */
-  List<Outline> get children => _children;
-
-  /**
-   * The children of the node. The field will be omitted if the node has no
-   * children.
-   */
-  void set children(List<Outline> value) {
-    this._children = value;
-  }
-
-  Outline(Element element, int offset, int length, {List<Outline> children}) {
-    this.element = element;
-    this.offset = offset;
-    this.length = length;
-    this.children = children;
-  }
-
-  factory Outline.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      Element element;
-      if (json.containsKey("element")) {
-        element = new Element.fromJson(jsonDecoder, jsonPath + ".element", json["element"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "element");
-      }
-      int offset;
-      if (json.containsKey("offset")) {
-        offset = jsonDecoder._decodeInt(jsonPath + ".offset", json["offset"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "offset");
-      }
-      int length;
-      if (json.containsKey("length")) {
-        length = jsonDecoder._decodeInt(jsonPath + ".length", json["length"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "length");
-      }
-      List<Outline> children;
-      if (json.containsKey("children")) {
-        children = jsonDecoder._decodeList(jsonPath + ".children", json["children"], (String jsonPath, Object json) => new Outline.fromJson(jsonDecoder, jsonPath, json));
-      }
-      return new Outline(element, offset, length, children: children);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "Outline", json);
-    }
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["element"] = element.toJson();
-    result["offset"] = offset;
-    result["length"] = length;
-    if (children != null) {
-      result["children"] = children.map((Outline value) => value.toJson()).toList();
-    }
-    return result;
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is Outline) {
-      return element == other.element &&
-          offset == other.offset &&
-          length == other.length &&
-          _listEqual(children, other.children, (Outline a, Outline b) => a == b);
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, element.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, offset.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, length.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, children.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * Override
- *
- * {
- *   "offset": int
- *   "length": int
- *   "superclassMember": optional OverriddenMember
- *   "interfaceMembers": optional List<OverriddenMember>
- * }
- */
-class Override implements HasToJson {
-  int _offset;
-
-  int _length;
-
-  OverriddenMember _superclassMember;
-
-  List<OverriddenMember> _interfaceMembers;
-
-  /**
-   * The offset of the name of the overriding member.
-   */
-  int get offset => _offset;
-
-  /**
-   * The offset of the name of the overriding member.
-   */
-  void set offset(int value) {
-    assert(value != null);
-    this._offset = value;
-  }
-
-  /**
-   * The length of the name of the overriding member.
-   */
-  int get length => _length;
-
-  /**
-   * The length of the name of the overriding member.
-   */
-  void set length(int value) {
-    assert(value != null);
-    this._length = value;
-  }
-
-  /**
-   * The member inherited from a superclass that is overridden by the
-   * overriding member. The field is omitted if there is no superclass member,
-   * in which case there must be at least one interface member.
-   */
-  OverriddenMember get superclassMember => _superclassMember;
-
-  /**
-   * The member inherited from a superclass that is overridden by the
-   * overriding member. The field is omitted if there is no superclass member,
-   * in which case there must be at least one interface member.
-   */
-  void set superclassMember(OverriddenMember value) {
-    this._superclassMember = value;
-  }
-
-  /**
-   * The members inherited from interfaces that are overridden by the
-   * overriding member. The field is omitted if there are no interface members,
-   * in which case there must be a superclass member.
-   */
-  List<OverriddenMember> get interfaceMembers => _interfaceMembers;
-
-  /**
-   * The members inherited from interfaces that are overridden by the
-   * overriding member. The field is omitted if there are no interface members,
-   * in which case there must be a superclass member.
-   */
-  void set interfaceMembers(List<OverriddenMember> value) {
-    this._interfaceMembers = value;
-  }
-
-  Override(int offset, int length, {OverriddenMember superclassMember, List<OverriddenMember> interfaceMembers}) {
-    this.offset = offset;
-    this.length = length;
-    this.superclassMember = superclassMember;
-    this.interfaceMembers = interfaceMembers;
-  }
-
-  factory Override.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      int offset;
-      if (json.containsKey("offset")) {
-        offset = jsonDecoder._decodeInt(jsonPath + ".offset", json["offset"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "offset");
-      }
-      int length;
-      if (json.containsKey("length")) {
-        length = jsonDecoder._decodeInt(jsonPath + ".length", json["length"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "length");
-      }
-      OverriddenMember superclassMember;
-      if (json.containsKey("superclassMember")) {
-        superclassMember = new OverriddenMember.fromJson(jsonDecoder, jsonPath + ".superclassMember", json["superclassMember"]);
-      }
-      List<OverriddenMember> interfaceMembers;
-      if (json.containsKey("interfaceMembers")) {
-        interfaceMembers = jsonDecoder._decodeList(jsonPath + ".interfaceMembers", json["interfaceMembers"], (String jsonPath, Object json) => new OverriddenMember.fromJson(jsonDecoder, jsonPath, json));
-      }
-      return new Override(offset, length, superclassMember: superclassMember, interfaceMembers: interfaceMembers);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "Override", json);
-    }
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["offset"] = offset;
-    result["length"] = length;
-    if (superclassMember != null) {
-      result["superclassMember"] = superclassMember.toJson();
-    }
-    if (interfaceMembers != null) {
-      result["interfaceMembers"] = interfaceMembers.map((OverriddenMember value) => value.toJson()).toList();
-    }
-    return result;
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is Override) {
-      return offset == other.offset &&
-          length == other.length &&
-          superclassMember == other.superclassMember &&
-          _listEqual(interfaceMembers, other.interfaceMembers, (OverriddenMember a, OverriddenMember b) => a == b);
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, offset.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, length.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, superclassMember.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, interfaceMembers.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * OverriddenMember
- *
- * {
- *   "element": Element
- *   "className": String
- * }
- */
-class OverriddenMember implements HasToJson {
-  Element _element;
-
-  String _className;
-
-  /**
-   * The element that is being overridden.
-   */
-  Element get element => _element;
-
-  /**
-   * The element that is being overridden.
-   */
-  void set element(Element value) {
-    assert(value != null);
-    this._element = value;
-  }
-
-  /**
-   * The name of the class in which the member is defined.
-   */
-  String get className => _className;
-
-  /**
-   * The name of the class in which the member is defined.
-   */
-  void set className(String value) {
-    assert(value != null);
-    this._className = value;
-  }
-
-  OverriddenMember(Element element, String className) {
-    this.element = element;
-    this.className = className;
-  }
-
-  factory OverriddenMember.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      Element element;
-      if (json.containsKey("element")) {
-        element = new Element.fromJson(jsonDecoder, jsonPath + ".element", json["element"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "element");
-      }
-      String className;
-      if (json.containsKey("className")) {
-        className = jsonDecoder._decodeString(jsonPath + ".className", json["className"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "className");
-      }
-      return new OverriddenMember(element, className);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "OverriddenMember", json);
-    }
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["element"] = element.toJson();
-    result["className"] = className;
-    return result;
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is OverriddenMember) {
-      return element == other.element &&
-          className == other.className;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, element.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, className.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * Position
- *
- * {
- *   "file": FilePath
- *   "offset": int
- * }
- */
-class Position implements HasToJson {
-  String _file;
-
-  int _offset;
-
-  /**
-   * The file containing the position.
-   */
-  String get file => _file;
-
-  /**
-   * The file containing the position.
-   */
-  void set file(String value) {
-    assert(value != null);
-    this._file = value;
-  }
-
-  /**
-   * The offset of the position.
-   */
-  int get offset => _offset;
-
-  /**
-   * The offset of the position.
-   */
-  void set offset(int value) {
-    assert(value != null);
-    this._offset = value;
-  }
-
-  Position(String file, int offset) {
-    this.file = file;
-    this.offset = offset;
-  }
-
-  factory Position.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      String file;
-      if (json.containsKey("file")) {
-        file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "file");
-      }
-      int offset;
-      if (json.containsKey("offset")) {
-        offset = jsonDecoder._decodeInt(jsonPath + ".offset", json["offset"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "offset");
-      }
-      return new Position(file, offset);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "Position", json);
-    }
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["file"] = file;
-    result["offset"] = offset;
-    return result;
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is Position) {
-      return file == other.file &&
-          offset == other.offset;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, file.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, offset.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * PubStatus
- *
- * {
- *   "isListingPackageDirs": bool
- * }
- */
-class PubStatus implements HasToJson {
-  bool _isListingPackageDirs;
-
-  /**
-   * True if the server is currently running pub to produce a list of package
-   * directories.
-   */
-  bool get isListingPackageDirs => _isListingPackageDirs;
-
-  /**
-   * True if the server is currently running pub to produce a list of package
-   * directories.
-   */
-  void set isListingPackageDirs(bool value) {
-    assert(value != null);
-    this._isListingPackageDirs = value;
-  }
-
-  PubStatus(bool isListingPackageDirs) {
-    this.isListingPackageDirs = isListingPackageDirs;
-  }
-
-  factory PubStatus.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      bool isListingPackageDirs;
-      if (json.containsKey("isListingPackageDirs")) {
-        isListingPackageDirs = jsonDecoder._decodeBool(jsonPath + ".isListingPackageDirs", json["isListingPackageDirs"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "isListingPackageDirs");
-      }
-      return new PubStatus(isListingPackageDirs);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "PubStatus", json);
-    }
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["isListingPackageDirs"] = isListingPackageDirs;
-    return result;
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is PubStatus) {
-      return isListingPackageDirs == other.isListingPackageDirs;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, isListingPackageDirs.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * RefactoringKind
- *
- * enum {
- *   CONVERT_GETTER_TO_METHOD
- *   CONVERT_METHOD_TO_GETTER
- *   EXTRACT_LOCAL_VARIABLE
- *   EXTRACT_METHOD
- *   INLINE_LOCAL_VARIABLE
- *   INLINE_METHOD
- *   MOVE_FILE
- *   RENAME
- *   SORT_MEMBERS
- * }
- */
-class RefactoringKind implements Enum {
-  static const CONVERT_GETTER_TO_METHOD = const RefactoringKind._("CONVERT_GETTER_TO_METHOD");
-
-  static const CONVERT_METHOD_TO_GETTER = const RefactoringKind._("CONVERT_METHOD_TO_GETTER");
-
-  static const EXTRACT_LOCAL_VARIABLE = const RefactoringKind._("EXTRACT_LOCAL_VARIABLE");
-
-  static const EXTRACT_METHOD = const RefactoringKind._("EXTRACT_METHOD");
-
-  static const INLINE_LOCAL_VARIABLE = const RefactoringKind._("INLINE_LOCAL_VARIABLE");
-
-  static const INLINE_METHOD = const RefactoringKind._("INLINE_METHOD");
-
-  static const MOVE_FILE = const RefactoringKind._("MOVE_FILE");
-
-  static const RENAME = const RefactoringKind._("RENAME");
-
-  static const SORT_MEMBERS = const RefactoringKind._("SORT_MEMBERS");
-
-  /**
-   * A list containing all of the enum values that are defined.
-   */
-  static const List<RefactoringKind> VALUES = const <RefactoringKind>[CONVERT_GETTER_TO_METHOD, CONVERT_METHOD_TO_GETTER, EXTRACT_LOCAL_VARIABLE, EXTRACT_METHOD, INLINE_LOCAL_VARIABLE, INLINE_METHOD, MOVE_FILE, RENAME, SORT_MEMBERS];
-
-  final String name;
-
-  const RefactoringKind._(this.name);
-
-  factory RefactoringKind(String name) {
-    switch (name) {
-      case "CONVERT_GETTER_TO_METHOD":
-        return CONVERT_GETTER_TO_METHOD;
-      case "CONVERT_METHOD_TO_GETTER":
-        return CONVERT_METHOD_TO_GETTER;
-      case "EXTRACT_LOCAL_VARIABLE":
-        return EXTRACT_LOCAL_VARIABLE;
-      case "EXTRACT_METHOD":
-        return EXTRACT_METHOD;
-      case "INLINE_LOCAL_VARIABLE":
-        return INLINE_LOCAL_VARIABLE;
-      case "INLINE_METHOD":
-        return INLINE_METHOD;
-      case "MOVE_FILE":
-        return MOVE_FILE;
-      case "RENAME":
-        return RENAME;
-      case "SORT_MEMBERS":
-        return SORT_MEMBERS;
-    }
-    throw new Exception('Illegal enum value: $name');
-  }
-
-  factory RefactoringKind.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json is String) {
-      try {
-        return new RefactoringKind(json);
-      } catch(_) {
-        // Fall through
-      }
-    }
-    throw jsonDecoder.mismatch(jsonPath, "RefactoringKind", json);
-  }
-
-  @override
-  String toString() => "RefactoringKind.$name";
-
-  String toJson() => name;
-}
-
-/**
- * RefactoringMethodParameter
- *
- * {
- *   "id": optional String
- *   "kind": RefactoringMethodParameterKind
- *   "type": String
- *   "name": String
- *   "parameters": optional String
- * }
- */
-class RefactoringMethodParameter implements HasToJson {
-  String _id;
-
-  RefactoringMethodParameterKind _kind;
-
-  String _type;
-
-  String _name;
-
-  String _parameters;
-
-  /**
-   * The unique identifier of the parameter. Clients may omit this field for
-   * the parameters they want to add.
-   */
-  String get id => _id;
-
-  /**
-   * The unique identifier of the parameter. Clients may omit this field for
-   * the parameters they want to add.
-   */
-  void set id(String value) {
-    this._id = value;
-  }
-
-  /**
-   * The kind of the parameter.
-   */
-  RefactoringMethodParameterKind get kind => _kind;
-
-  /**
-   * The kind of the parameter.
-   */
-  void set kind(RefactoringMethodParameterKind value) {
-    assert(value != null);
-    this._kind = value;
-  }
-
-  /**
-   * The type that should be given to the parameter, or the return type of the
-   * parameter's function type.
-   */
-  String get type => _type;
-
-  /**
-   * The type that should be given to the parameter, or the return type of the
-   * parameter's function type.
-   */
-  void set type(String value) {
-    assert(value != null);
-    this._type = value;
-  }
-
-  /**
-   * The name that should be given to the parameter.
-   */
-  String get name => _name;
-
-  /**
-   * The name that should be given to the parameter.
-   */
-  void set name(String value) {
-    assert(value != null);
-    this._name = value;
-  }
-
-  /**
-   * The parameter list of the parameter's function type. If the parameter is
-   * not of a function type, this field will not be defined. If the function
-   * type has zero parameters, this field will have a value of "()".
-   */
-  String get parameters => _parameters;
-
-  /**
-   * The parameter list of the parameter's function type. If the parameter is
-   * not of a function type, this field will not be defined. If the function
-   * type has zero parameters, this field will have a value of "()".
-   */
-  void set parameters(String value) {
-    this._parameters = value;
-  }
-
-  RefactoringMethodParameter(RefactoringMethodParameterKind kind, String type, String name, {String id, String parameters}) {
-    this.id = id;
-    this.kind = kind;
-    this.type = type;
-    this.name = name;
-    this.parameters = parameters;
-  }
-
-  factory RefactoringMethodParameter.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      String id;
-      if (json.containsKey("id")) {
-        id = jsonDecoder._decodeString(jsonPath + ".id", json["id"]);
-      }
-      RefactoringMethodParameterKind kind;
-      if (json.containsKey("kind")) {
-        kind = new RefactoringMethodParameterKind.fromJson(jsonDecoder, jsonPath + ".kind", json["kind"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "kind");
-      }
-      String type;
-      if (json.containsKey("type")) {
-        type = jsonDecoder._decodeString(jsonPath + ".type", json["type"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "type");
-      }
-      String name;
-      if (json.containsKey("name")) {
-        name = jsonDecoder._decodeString(jsonPath + ".name", json["name"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "name");
-      }
-      String parameters;
-      if (json.containsKey("parameters")) {
-        parameters = jsonDecoder._decodeString(jsonPath + ".parameters", json["parameters"]);
-      }
-      return new RefactoringMethodParameter(kind, type, name, id: id, parameters: parameters);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "RefactoringMethodParameter", json);
-    }
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    if (id != null) {
-      result["id"] = id;
-    }
-    result["kind"] = kind.toJson();
-    result["type"] = type;
-    result["name"] = name;
-    if (parameters != null) {
-      result["parameters"] = parameters;
-    }
-    return result;
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is RefactoringMethodParameter) {
-      return id == other.id &&
-          kind == other.kind &&
-          type == other.type &&
-          name == other.name &&
-          parameters == other.parameters;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, id.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, kind.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, type.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, name.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, parameters.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * RefactoringFeedback
- *
- * {
- * }
- */
-class RefactoringFeedback implements HasToJson {
-  RefactoringFeedback();
-
-  factory RefactoringFeedback.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json, Map responseJson) {
-    return _refactoringFeedbackFromJson(jsonDecoder, jsonPath, json, responseJson);
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    return result;
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is RefactoringFeedback) {
-      return true;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * RefactoringOptions
- *
- * {
- * }
- */
-class RefactoringOptions implements HasToJson {
-  RefactoringOptions();
-
-  factory RefactoringOptions.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json, RefactoringKind kind) {
-    return _refactoringOptionsFromJson(jsonDecoder, jsonPath, json, kind);
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    return result;
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is RefactoringOptions) {
-      return true;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * RefactoringMethodParameterKind
- *
- * enum {
- *   REQUIRED
- *   POSITIONAL
- *   NAMED
- * }
- */
-class RefactoringMethodParameterKind implements Enum {
-  static const REQUIRED = const RefactoringMethodParameterKind._("REQUIRED");
-
-  static const POSITIONAL = const RefactoringMethodParameterKind._("POSITIONAL");
-
-  static const NAMED = const RefactoringMethodParameterKind._("NAMED");
-
-  /**
-   * A list containing all of the enum values that are defined.
-   */
-  static const List<RefactoringMethodParameterKind> VALUES = const <RefactoringMethodParameterKind>[REQUIRED, POSITIONAL, NAMED];
-
-  final String name;
-
-  const RefactoringMethodParameterKind._(this.name);
-
-  factory RefactoringMethodParameterKind(String name) {
-    switch (name) {
-      case "REQUIRED":
-        return REQUIRED;
-      case "POSITIONAL":
-        return POSITIONAL;
-      case "NAMED":
-        return NAMED;
-    }
-    throw new Exception('Illegal enum value: $name');
-  }
-
-  factory RefactoringMethodParameterKind.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json is String) {
-      try {
-        return new RefactoringMethodParameterKind(json);
-      } catch(_) {
-        // Fall through
-      }
-    }
-    throw jsonDecoder.mismatch(jsonPath, "RefactoringMethodParameterKind", json);
-  }
-
-  @override
-  String toString() => "RefactoringMethodParameterKind.$name";
-
-  String toJson() => name;
-}
-
-/**
- * RefactoringProblem
- *
- * {
- *   "severity": RefactoringProblemSeverity
- *   "message": String
- *   "location": optional Location
- * }
- */
-class RefactoringProblem implements HasToJson {
-  RefactoringProblemSeverity _severity;
-
-  String _message;
-
-  Location _location;
-
-  /**
-   * The severity of the problem being represented.
-   */
-  RefactoringProblemSeverity get severity => _severity;
-
-  /**
-   * The severity of the problem being represented.
-   */
-  void set severity(RefactoringProblemSeverity value) {
-    assert(value != null);
-    this._severity = value;
-  }
-
-  /**
-   * A human-readable description of the problem being represented.
-   */
-  String get message => _message;
-
-  /**
-   * A human-readable description of the problem being represented.
-   */
-  void set message(String value) {
-    assert(value != null);
-    this._message = value;
-  }
-
-  /**
-   * The location of the problem being represented. This field is omitted
-   * unless there is a specific location associated with the problem (such as a
-   * location where an element being renamed will be shadowed).
-   */
-  Location get location => _location;
-
-  /**
-   * The location of the problem being represented. This field is omitted
-   * unless there is a specific location associated with the problem (such as a
-   * location where an element being renamed will be shadowed).
-   */
-  void set location(Location value) {
-    this._location = value;
-  }
-
-  RefactoringProblem(RefactoringProblemSeverity severity, String message, {Location location}) {
-    this.severity = severity;
-    this.message = message;
-    this.location = location;
-  }
-
-  factory RefactoringProblem.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      RefactoringProblemSeverity severity;
-      if (json.containsKey("severity")) {
-        severity = new RefactoringProblemSeverity.fromJson(jsonDecoder, jsonPath + ".severity", json["severity"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "severity");
-      }
-      String message;
-      if (json.containsKey("message")) {
-        message = jsonDecoder._decodeString(jsonPath + ".message", json["message"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "message");
-      }
-      Location location;
-      if (json.containsKey("location")) {
-        location = new Location.fromJson(jsonDecoder, jsonPath + ".location", json["location"]);
-      }
-      return new RefactoringProblem(severity, message, location: location);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "RefactoringProblem", json);
-    }
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["severity"] = severity.toJson();
-    result["message"] = message;
-    if (location != null) {
-      result["location"] = location.toJson();
-    }
-    return result;
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is RefactoringProblem) {
-      return severity == other.severity &&
-          message == other.message &&
-          location == other.location;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, severity.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, message.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, location.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * RefactoringProblemSeverity
- *
- * enum {
- *   INFO
- *   WARNING
- *   ERROR
- *   FATAL
- * }
- */
-class RefactoringProblemSeverity implements Enum {
-  static const INFO = const RefactoringProblemSeverity._("INFO");
-
-  static const WARNING = const RefactoringProblemSeverity._("WARNING");
-
-  static const ERROR = const RefactoringProblemSeverity._("ERROR");
-
-  static const FATAL = const RefactoringProblemSeverity._("FATAL");
-
-  /**
-   * A list containing all of the enum values that are defined.
-   */
-  static const List<RefactoringProblemSeverity> VALUES = const <RefactoringProblemSeverity>[INFO, WARNING, ERROR, FATAL];
-
-  final String name;
-
-  const RefactoringProblemSeverity._(this.name);
-
-  factory RefactoringProblemSeverity(String name) {
-    switch (name) {
-      case "INFO":
-        return INFO;
-      case "WARNING":
-        return WARNING;
-      case "ERROR":
-        return ERROR;
-      case "FATAL":
-        return FATAL;
-    }
-    throw new Exception('Illegal enum value: $name');
-  }
-
-  factory RefactoringProblemSeverity.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json is String) {
-      try {
-        return new RefactoringProblemSeverity(json);
-      } catch(_) {
-        // Fall through
-      }
-    }
-    throw jsonDecoder.mismatch(jsonPath, "RefactoringProblemSeverity", json);
-  }
-
-  /**
-   * Returns the [RefactoringProblemSeverity] with the maximal severity.
-   */
-  static RefactoringProblemSeverity max(RefactoringProblemSeverity a, RefactoringProblemSeverity b) =>
-      _maxRefactoringProblemSeverity(a, b);
-
-  @override
-  String toString() => "RefactoringProblemSeverity.$name";
-
-  String toJson() => name;
-}
-
-/**
- * RemoveContentOverlay
- *
- * {
- *   "type": "remove"
- * }
- */
-class RemoveContentOverlay implements HasToJson {
-  RemoveContentOverlay();
-
-  factory RemoveContentOverlay.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      if (json["type"] != "remove") {
-        throw jsonDecoder.mismatch(jsonPath, "equal " + "remove", json);
-      }
-      return new RemoveContentOverlay();
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "RemoveContentOverlay", json);
-    }
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["type"] = "remove";
-    return result;
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is RemoveContentOverlay) {
-      return true;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, 114870849);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * RequestError
- *
- * {
- *   "code": RequestErrorCode
- *   "message": String
- *   "stackTrace": optional String
- * }
- */
-class RequestError implements HasToJson {
-  RequestErrorCode _code;
-
-  String _message;
-
-  String _stackTrace;
-
-  /**
-   * A code that uniquely identifies the error that occurred.
-   */
-  RequestErrorCode get code => _code;
-
-  /**
-   * A code that uniquely identifies the error that occurred.
-   */
-  void set code(RequestErrorCode value) {
-    assert(value != null);
-    this._code = value;
-  }
-
-  /**
-   * A short description of the error.
-   */
-  String get message => _message;
-
-  /**
-   * A short description of the error.
-   */
-  void set message(String value) {
-    assert(value != null);
-    this._message = value;
-  }
-
-  /**
-   * The stack trace associated with processing the request, used for debugging
-   * the server.
-   */
-  String get stackTrace => _stackTrace;
-
-  /**
-   * The stack trace associated with processing the request, used for debugging
-   * the server.
-   */
-  void set stackTrace(String value) {
-    this._stackTrace = value;
-  }
-
-  RequestError(RequestErrorCode code, String message, {String stackTrace}) {
-    this.code = code;
-    this.message = message;
-    this.stackTrace = stackTrace;
-  }
-
-  factory RequestError.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      RequestErrorCode code;
-      if (json.containsKey("code")) {
-        code = new RequestErrorCode.fromJson(jsonDecoder, jsonPath + ".code", json["code"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "code");
-      }
-      String message;
-      if (json.containsKey("message")) {
-        message = jsonDecoder._decodeString(jsonPath + ".message", json["message"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "message");
-      }
-      String stackTrace;
-      if (json.containsKey("stackTrace")) {
-        stackTrace = jsonDecoder._decodeString(jsonPath + ".stackTrace", json["stackTrace"]);
-      }
-      return new RequestError(code, message, stackTrace: stackTrace);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "RequestError", json);
-    }
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["code"] = code.toJson();
-    result["message"] = message;
-    if (stackTrace != null) {
-      result["stackTrace"] = stackTrace;
-    }
-    return result;
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is RequestError) {
-      return code == other.code &&
-          message == other.message &&
-          stackTrace == other.stackTrace;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, code.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, message.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, stackTrace.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * RequestErrorCode
- *
- * enum {
- *   CONTENT_MODIFIED
- *   FILE_NOT_ANALYZED
- *   FORMAT_INVALID_FILE
- *   FORMAT_WITH_ERRORS
- *   GET_ERRORS_INVALID_FILE
- *   GET_NAVIGATION_INVALID_FILE
- *   INVALID_ANALYSIS_ROOT
- *   INVALID_EXECUTION_CONTEXT
- *   INVALID_OVERLAY_CHANGE
- *   INVALID_PARAMETER
- *   INVALID_REQUEST
- *   NO_INDEX_GENERATED
- *   ORGANIZE_DIRECTIVES_ERROR
- *   REFACTORING_REQUEST_CANCELLED
- *   SERVER_ALREADY_STARTED
- *   SERVER_ERROR
- *   SORT_MEMBERS_INVALID_FILE
- *   SORT_MEMBERS_PARSE_ERRORS
- *   UNANALYZED_PRIORITY_FILES
- *   UNKNOWN_REQUEST
- *   UNKNOWN_SOURCE
- *   UNSUPPORTED_FEATURE
- * }
- */
-class RequestErrorCode implements Enum {
-  /**
-   * An "analysis.getErrors" or "analysis.getNavigation" request could not be
-   * satisfied because the content of the file changed before the requested
-   * results could be computed.
-   */
-  static const 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");
-
-  /**
-   * 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");
-
-  /**
-   * An "edit.format" request specified a file that contains syntax errors.
-   */
-  static const 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");
-
-  /**
-   * 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");
-
-  /**
-   * 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");
-
-  /**
-   * The context root used to create an execution context does not exist.
-   */
-  static const INVALID_EXECUTION_CONTEXT = const RequestErrorCode._("INVALID_EXECUTION_CONTEXT");
-
-  /**
-   * 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");
-
-  /**
-   * One of the method parameters was invalid.
-   */
-  static const INVALID_PARAMETER = const RequestErrorCode._("INVALID_PARAMETER");
-
-  /**
-   * A malformed request was received.
-   */
-  static const 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");
-
-  /**
-   * 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");
-
-  /**
-   * Another refactoring request was received during processing of this one.
-   */
-  static const REFACTORING_REQUEST_CANCELLED = const RequestErrorCode._("REFACTORING_REQUEST_CANCELLED");
-
-  /**
-   * The analysis server has already been started (and hence won't accept new
-   * connections).
-   *
-   * This error is included for future expansion; at present the analysis
-   * 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");
-
-  /**
-   * An internal error occurred in the analysis server. Also see the
-   * server.error notification.
-   */
-  static const 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");
-
-  /**
-   * 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");
-
-  /**
-   * An "analysis.setPriorityFiles" request includes one or more files that are
-   * not being analyzed.
-   *
-   * 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");
-
-  /**
-   * A request was received which the analysis server does not recognize, or
-   * cannot handle in its current configuation.
-   */
-  static const 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");
-
-  /**
-   * The analysis server was requested to perform an action which is not
-   * supported.
-   *
-   * This is a legacy error; it will be removed before the API reaches version
-   * 1.0.
-   */
-  static const UNSUPPORTED_FEATURE = const RequestErrorCode._("UNSUPPORTED_FEATURE");
-
-  /**
-   * A list containing all of the enum values that are defined.
-   */
-  static const List<RequestErrorCode> VALUES = const <RequestErrorCode>[CONTENT_MODIFIED, FILE_NOT_ANALYZED, FORMAT_INVALID_FILE, FORMAT_WITH_ERRORS, GET_ERRORS_INVALID_FILE, GET_NAVIGATION_INVALID_FILE, INVALID_ANALYSIS_ROOT, INVALID_EXECUTION_CONTEXT, INVALID_OVERLAY_CHANGE, INVALID_PARAMETER, INVALID_REQUEST, NO_INDEX_GENERATED, ORGANIZE_DIRECTIVES_ERROR, REFACTORING_REQUEST_CANCELLED, SERVER_ALREADY_STARTED, SERVER_ERROR, SORT_MEMBERS_INVALID_FILE, SORT_MEMBERS_PARSE_ERRORS, UNANALYZED_PRIORITY_FILES, UNKNOWN_REQUEST, UNKNOWN_SOURCE, UNSUPPORTED_FEATURE];
-
-  final String name;
-
-  const RequestErrorCode._(this.name);
-
-  factory RequestErrorCode(String name) {
-    switch (name) {
-      case "CONTENT_MODIFIED":
-        return CONTENT_MODIFIED;
-      case "FILE_NOT_ANALYZED":
-        return FILE_NOT_ANALYZED;
-      case "FORMAT_INVALID_FILE":
-        return FORMAT_INVALID_FILE;
-      case "FORMAT_WITH_ERRORS":
-        return FORMAT_WITH_ERRORS;
-      case "GET_ERRORS_INVALID_FILE":
-        return GET_ERRORS_INVALID_FILE;
-      case "GET_NAVIGATION_INVALID_FILE":
-        return GET_NAVIGATION_INVALID_FILE;
-      case "INVALID_ANALYSIS_ROOT":
-        return INVALID_ANALYSIS_ROOT;
-      case "INVALID_EXECUTION_CONTEXT":
-        return INVALID_EXECUTION_CONTEXT;
-      case "INVALID_OVERLAY_CHANGE":
-        return INVALID_OVERLAY_CHANGE;
-      case "INVALID_PARAMETER":
-        return INVALID_PARAMETER;
-      case "INVALID_REQUEST":
-        return INVALID_REQUEST;
-      case "NO_INDEX_GENERATED":
-        return NO_INDEX_GENERATED;
-      case "ORGANIZE_DIRECTIVES_ERROR":
-        return ORGANIZE_DIRECTIVES_ERROR;
-      case "REFACTORING_REQUEST_CANCELLED":
-        return REFACTORING_REQUEST_CANCELLED;
-      case "SERVER_ALREADY_STARTED":
-        return SERVER_ALREADY_STARTED;
-      case "SERVER_ERROR":
-        return SERVER_ERROR;
-      case "SORT_MEMBERS_INVALID_FILE":
-        return SORT_MEMBERS_INVALID_FILE;
-      case "SORT_MEMBERS_PARSE_ERRORS":
-        return SORT_MEMBERS_PARSE_ERRORS;
-      case "UNANALYZED_PRIORITY_FILES":
-        return UNANALYZED_PRIORITY_FILES;
-      case "UNKNOWN_REQUEST":
-        return UNKNOWN_REQUEST;
-      case "UNKNOWN_SOURCE":
-        return UNKNOWN_SOURCE;
-      case "UNSUPPORTED_FEATURE":
-        return UNSUPPORTED_FEATURE;
-    }
-    throw new Exception('Illegal enum value: $name');
-  }
-
-  factory RequestErrorCode.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json is String) {
-      try {
-        return new RequestErrorCode(json);
-      } catch(_) {
-        // Fall through
-      }
-    }
-    throw jsonDecoder.mismatch(jsonPath, "RequestErrorCode", json);
-  }
-
-  @override
-  String toString() => "RequestErrorCode.$name";
-
-  String toJson() => name;
-}
-
-/**
- * SearchResult
- *
- * {
- *   "location": Location
- *   "kind": SearchResultKind
- *   "isPotential": bool
- *   "path": List<Element>
- * }
- */
-class SearchResult implements HasToJson {
-  Location _location;
-
-  SearchResultKind _kind;
-
-  bool _isPotential;
-
-  List<Element> _path;
-
-  /**
-   * The location of the code that matched the search criteria.
-   */
-  Location get location => _location;
-
-  /**
-   * The location of the code that matched the search criteria.
-   */
-  void set location(Location value) {
-    assert(value != null);
-    this._location = value;
-  }
-
-  /**
-   * The kind of element that was found or the kind of reference that was
-   * found.
-   */
-  SearchResultKind get kind => _kind;
-
-  /**
-   * The kind of element that was found or the kind of reference that was
-   * found.
-   */
-  void set kind(SearchResultKind value) {
-    assert(value != null);
-    this._kind = value;
-  }
-
-  /**
-   * True if the result is a potential match but cannot be confirmed to be a
-   * match. For example, if all references to a method m defined in some class
-   * were requested, and a reference to a method m from an unknown class were
-   * found, it would be marked as being a potential match.
-   */
-  bool get isPotential => _isPotential;
-
-  /**
-   * True if the result is a potential match but cannot be confirmed to be a
-   * match. For example, if all references to a method m defined in some class
-   * were requested, and a reference to a method m from an unknown class were
-   * found, it would be marked as being a potential match.
-   */
-  void set isPotential(bool value) {
-    assert(value != null);
-    this._isPotential = value;
-  }
-
-  /**
-   * The elements that contain the result, starting with the most immediately
-   * enclosing ancestor and ending with the library.
-   */
-  List<Element> get path => _path;
-
-  /**
-   * The elements that contain the result, starting with the most immediately
-   * enclosing ancestor and ending with the library.
-   */
-  void set path(List<Element> value) {
-    assert(value != null);
-    this._path = value;
-  }
-
-  SearchResult(Location location, SearchResultKind kind, bool isPotential, List<Element> path) {
-    this.location = location;
-    this.kind = kind;
-    this.isPotential = isPotential;
-    this.path = path;
-  }
-
-  factory SearchResult.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      Location location;
-      if (json.containsKey("location")) {
-        location = new Location.fromJson(jsonDecoder, jsonPath + ".location", json["location"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "location");
-      }
-      SearchResultKind kind;
-      if (json.containsKey("kind")) {
-        kind = new SearchResultKind.fromJson(jsonDecoder, jsonPath + ".kind", json["kind"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "kind");
-      }
-      bool isPotential;
-      if (json.containsKey("isPotential")) {
-        isPotential = jsonDecoder._decodeBool(jsonPath + ".isPotential", json["isPotential"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "isPotential");
-      }
-      List<Element> path;
-      if (json.containsKey("path")) {
-        path = jsonDecoder._decodeList(jsonPath + ".path", json["path"], (String jsonPath, Object json) => new Element.fromJson(jsonDecoder, jsonPath, json));
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "path");
-      }
-      return new SearchResult(location, kind, isPotential, path);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "SearchResult", json);
-    }
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["location"] = location.toJson();
-    result["kind"] = kind.toJson();
-    result["isPotential"] = isPotential;
-    result["path"] = path.map((Element value) => value.toJson()).toList();
-    return result;
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is SearchResult) {
-      return location == other.location &&
-          kind == other.kind &&
-          isPotential == other.isPotential &&
-          _listEqual(path, other.path, (Element a, Element b) => a == b);
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, location.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, kind.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, isPotential.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, path.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * SearchResultKind
- *
- * enum {
- *   DECLARATION
- *   INVOCATION
- *   READ
- *   READ_WRITE
- *   REFERENCE
- *   UNKNOWN
- *   WRITE
- * }
- */
-class SearchResultKind implements Enum {
-  /**
-   * The declaration of an element.
-   */
-  static const DECLARATION = const SearchResultKind._("DECLARATION");
-
-  /**
-   * The invocation of a function or method.
-   */
-  static const INVOCATION = const SearchResultKind._("INVOCATION");
-
-  /**
-   * A reference to a field, parameter or variable where it is being read.
-   */
-  static const 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");
-
-  /**
-   * A reference to an element.
-   */
-  static const REFERENCE = const SearchResultKind._("REFERENCE");
-
-  /**
-   * Some other kind of search result.
-   */
-  static const UNKNOWN = const SearchResultKind._("UNKNOWN");
-
-  /**
-   * A reference to a field, parameter or variable where it is being written.
-   */
-  static const WRITE = const SearchResultKind._("WRITE");
-
-  /**
-   * A list containing all of the enum values that are defined.
-   */
-  static const List<SearchResultKind> VALUES = const <SearchResultKind>[DECLARATION, INVOCATION, READ, READ_WRITE, REFERENCE, UNKNOWN, WRITE];
-
-  final String name;
-
-  const SearchResultKind._(this.name);
-
-  factory SearchResultKind(String name) {
-    switch (name) {
-      case "DECLARATION":
-        return DECLARATION;
-      case "INVOCATION":
-        return INVOCATION;
-      case "READ":
-        return READ;
-      case "READ_WRITE":
-        return READ_WRITE;
-      case "REFERENCE":
-        return REFERENCE;
-      case "UNKNOWN":
-        return UNKNOWN;
-      case "WRITE":
-        return WRITE;
-    }
-    throw new Exception('Illegal enum value: $name');
-  }
-
-  factory SearchResultKind.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json is String) {
-      try {
-        return new SearchResultKind(json);
-      } catch(_) {
-        // Fall through
-      }
-    }
-    throw jsonDecoder.mismatch(jsonPath, "SearchResultKind", json);
-  }
-
-  @override
-  String toString() => "SearchResultKind.$name";
-
-  String toJson() => name;
-}
-
-/**
- * ServerService
- *
- * enum {
- *   STATUS
- * }
- */
-class ServerService implements Enum {
-  static const STATUS = const ServerService._("STATUS");
-
-  /**
-   * A list containing all of the enum values that are defined.
-   */
-  static const List<ServerService> VALUES = const <ServerService>[STATUS];
-
-  final String name;
-
-  const ServerService._(this.name);
-
-  factory ServerService(String name) {
-    switch (name) {
-      case "STATUS":
-        return STATUS;
-    }
-    throw new Exception('Illegal enum value: $name');
-  }
-
-  factory ServerService.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json is String) {
-      try {
-        return new ServerService(json);
-      } catch(_) {
-        // Fall through
-      }
-    }
-    throw jsonDecoder.mismatch(jsonPath, "ServerService", json);
-  }
-
-  @override
-  String toString() => "ServerService.$name";
-
-  String toJson() => name;
-}
-
-/**
- * SourceChange
- *
- * {
- *   "message": String
- *   "edits": List<SourceFileEdit>
- *   "linkedEditGroups": List<LinkedEditGroup>
- *   "selection": optional Position
- * }
- */
-class SourceChange implements HasToJson {
-  String _message;
-
-  List<SourceFileEdit> _edits;
-
-  List<LinkedEditGroup> _linkedEditGroups;
-
-  Position _selection;
-
-  /**
-   * A human-readable description of the change to be applied.
-   */
-  String get message => _message;
-
-  /**
-   * A human-readable description of the change to be applied.
-   */
-  void set message(String value) {
-    assert(value != null);
-    this._message = value;
-  }
-
-  /**
-   * A list of the edits used to effect the change, grouped by file.
-   */
-  List<SourceFileEdit> get edits => _edits;
-
-  /**
-   * A list of the edits used to effect the change, grouped by file.
-   */
-  void set edits(List<SourceFileEdit> value) {
-    assert(value != null);
-    this._edits = value;
-  }
-
-  /**
-   * A list of the linked editing groups used to customize the changes that
-   * were made.
-   */
-  List<LinkedEditGroup> get linkedEditGroups => _linkedEditGroups;
-
-  /**
-   * A list of the linked editing groups used to customize the changes that
-   * were made.
-   */
-  void set linkedEditGroups(List<LinkedEditGroup> value) {
-    assert(value != null);
-    this._linkedEditGroups = value;
-  }
-
-  /**
-   * The position that should be selected after the edits have been applied.
-   */
-  Position get selection => _selection;
-
-  /**
-   * The position that should be selected after the edits have been applied.
-   */
-  void set selection(Position value) {
-    this._selection = value;
-  }
-
-  SourceChange(String message, {List<SourceFileEdit> edits, List<LinkedEditGroup> linkedEditGroups, Position selection}) {
-    this.message = message;
-    if (edits == null) {
-      this.edits = <SourceFileEdit>[];
-    } else {
-      this.edits = edits;
-    }
-    if (linkedEditGroups == null) {
-      this.linkedEditGroups = <LinkedEditGroup>[];
-    } else {
-      this.linkedEditGroups = linkedEditGroups;
-    }
-    this.selection = selection;
-  }
-
-  factory SourceChange.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      String message;
-      if (json.containsKey("message")) {
-        message = jsonDecoder._decodeString(jsonPath + ".message", json["message"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "message");
-      }
-      List<SourceFileEdit> edits;
-      if (json.containsKey("edits")) {
-        edits = jsonDecoder._decodeList(jsonPath + ".edits", json["edits"], (String jsonPath, Object json) => new SourceFileEdit.fromJson(jsonDecoder, jsonPath, json));
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "edits");
-      }
-      List<LinkedEditGroup> linkedEditGroups;
-      if (json.containsKey("linkedEditGroups")) {
-        linkedEditGroups = jsonDecoder._decodeList(jsonPath + ".linkedEditGroups", json["linkedEditGroups"], (String jsonPath, Object json) => new LinkedEditGroup.fromJson(jsonDecoder, jsonPath, json));
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "linkedEditGroups");
-      }
-      Position selection;
-      if (json.containsKey("selection")) {
-        selection = new Position.fromJson(jsonDecoder, jsonPath + ".selection", json["selection"]);
-      }
-      return new SourceChange(message, edits: edits, linkedEditGroups: linkedEditGroups, selection: selection);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "SourceChange", json);
-    }
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["message"] = message;
-    result["edits"] = edits.map((SourceFileEdit value) => value.toJson()).toList();
-    result["linkedEditGroups"] = linkedEditGroups.map((LinkedEditGroup value) => value.toJson()).toList();
-    if (selection != null) {
-      result["selection"] = selection.toJson();
-    }
-    return result;
-  }
-
-  /**
-   * Adds [edit] to the [FileEdit] for the given [file].
-   */
-  void addEdit(String file, int fileStamp, SourceEdit edit) =>
-      _addEditToSourceChange(this, file, fileStamp, edit);
-
-  /**
-   * Adds the given [FileEdit].
-   */
-  void addFileEdit(SourceFileEdit edit) {
-    edits.add(edit);
-  }
-
-  /**
-   * Adds the given [LinkedEditGroup].
-   */
-  void addLinkedEditGroup(LinkedEditGroup linkedEditGroup) {
-    linkedEditGroups.add(linkedEditGroup);
-  }
-
-  /**
-   * Returns the [FileEdit] for the given [file], maybe `null`.
-   */
-  SourceFileEdit getFileEdit(String file) =>
-      _getChangeFileEdit(this, file);
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is SourceChange) {
-      return message == other.message &&
-          _listEqual(edits, other.edits, (SourceFileEdit a, SourceFileEdit b) => a == b) &&
-          _listEqual(linkedEditGroups, other.linkedEditGroups, (LinkedEditGroup a, LinkedEditGroup b) => a == b) &&
-          selection == other.selection;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, message.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, edits.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, linkedEditGroups.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, selection.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * SourceEdit
- *
- * {
- *   "offset": int
- *   "length": int
- *   "replacement": String
- *   "id": optional String
- * }
- */
-class SourceEdit implements HasToJson {
-  /**
-   * Get the result of applying a set of [edits] to the given [code]. Edits are
-   * applied in the order they appear in [edits].
-   */
-  static String applySequence(String code, Iterable<SourceEdit> edits) =>
-      _applySequence(code, edits);
-
-  int _offset;
-
-  int _length;
-
-  String _replacement;
-
-  String _id;
-
-  /**
-   * The offset of the region to be modified.
-   */
-  int get offset => _offset;
-
-  /**
-   * The offset of the region to be modified.
-   */
-  void set offset(int value) {
-    assert(value != null);
-    this._offset = value;
-  }
-
-  /**
-   * The length of the region to be modified.
-   */
-  int get length => _length;
-
-  /**
-   * The length of the region to be modified.
-   */
-  void set length(int value) {
-    assert(value != null);
-    this._length = value;
-  }
-
-  /**
-   * The code that is to replace the specified region in the original code.
-   */
-  String get replacement => _replacement;
-
-  /**
-   * The code that is to replace the specified region in the original code.
-   */
-  void set replacement(String value) {
-    assert(value != null);
-    this._replacement = value;
-  }
-
-  /**
-   * An identifier that uniquely identifies this source edit from other edits
-   * in the same response. This field is omitted unless a containing structure
-   * needs to be able to identify the edit for some reason.
-   *
-   * For example, some refactoring operations can produce edits that might not
-   * be appropriate (referred to as potential edits). Such edits will have an
-   * id so that they can be referenced. Edits in the same response that do not
-   * need to be referenced will not have an id.
-   */
-  String get id => _id;
-
-  /**
-   * An identifier that uniquely identifies this source edit from other edits
-   * in the same response. This field is omitted unless a containing structure
-   * needs to be able to identify the edit for some reason.
-   *
-   * For example, some refactoring operations can produce edits that might not
-   * be appropriate (referred to as potential edits). Such edits will have an
-   * id so that they can be referenced. Edits in the same response that do not
-   * need to be referenced will not have an id.
-   */
-  void set id(String value) {
-    this._id = value;
-  }
-
-  SourceEdit(int offset, int length, String replacement, {String id}) {
-    this.offset = offset;
-    this.length = length;
-    this.replacement = replacement;
-    this.id = id;
-  }
-
-  factory SourceEdit.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      int offset;
-      if (json.containsKey("offset")) {
-        offset = jsonDecoder._decodeInt(jsonPath + ".offset", json["offset"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "offset");
-      }
-      int length;
-      if (json.containsKey("length")) {
-        length = jsonDecoder._decodeInt(jsonPath + ".length", json["length"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "length");
-      }
-      String replacement;
-      if (json.containsKey("replacement")) {
-        replacement = jsonDecoder._decodeString(jsonPath + ".replacement", json["replacement"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "replacement");
-      }
-      String id;
-      if (json.containsKey("id")) {
-        id = jsonDecoder._decodeString(jsonPath + ".id", json["id"]);
-      }
-      return new SourceEdit(offset, length, replacement, id: id);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "SourceEdit", json);
-    }
-  }
-
-  /**
-   * The end of the region to be modified.
-   */
-  int get end => offset + length;
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["offset"] = offset;
-    result["length"] = length;
-    result["replacement"] = replacement;
-    if (id != null) {
-      result["id"] = id;
-    }
-    return result;
-  }
-
-  /**
-   * Get the result of applying the edit to the given [code].
-   */
-  String apply(String code) => _applyEdit(code, this);
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is SourceEdit) {
-      return offset == other.offset &&
-          length == other.length &&
-          replacement == other.replacement &&
-          id == other.id;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, offset.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, length.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, replacement.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, id.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * SourceFileEdit
- *
- * {
- *   "file": FilePath
- *   "fileStamp": long
- *   "edits": List<SourceEdit>
- * }
- */
-class SourceFileEdit implements HasToJson {
-  String _file;
-
-  int _fileStamp;
-
-  List<SourceEdit> _edits;
-
-  /**
-   * The file containing the code to be modified.
-   */
-  String get file => _file;
-
-  /**
-   * The file containing the code to be modified.
-   */
-  void set file(String value) {
-    assert(value != null);
-    this._file = value;
-  }
-
-  /**
-   * The modification stamp of the file at the moment when the change was
-   * created, in milliseconds since the "Unix epoch". Will be -1 if the file
-   * did not exist and should be created. The client may use this field to make
-   * sure that the file was not changed since then, so it is safe to apply the
-   * change.
-   */
-  int get fileStamp => _fileStamp;
-
-  /**
-   * The modification stamp of the file at the moment when the change was
-   * created, in milliseconds since the "Unix epoch". Will be -1 if the file
-   * did not exist and should be created. The client may use this field to make
-   * sure that the file was not changed since then, so it is safe to apply the
-   * change.
-   */
-  void set fileStamp(int value) {
-    assert(value != null);
-    this._fileStamp = value;
-  }
-
-  /**
-   * A list of the edits used to effect the change.
-   */
-  List<SourceEdit> get edits => _edits;
-
-  /**
-   * A list of the edits used to effect the change.
-   */
-  void set edits(List<SourceEdit> value) {
-    assert(value != null);
-    this._edits = value;
-  }
-
-  SourceFileEdit(String file, int fileStamp, {List<SourceEdit> edits}) {
-    this.file = file;
-    this.fileStamp = fileStamp;
-    if (edits == null) {
-      this.edits = <SourceEdit>[];
-    } else {
-      this.edits = edits;
-    }
-  }
-
-  factory SourceFileEdit.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      String file;
-      if (json.containsKey("file")) {
-        file = jsonDecoder._decodeString(jsonPath + ".file", json["file"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "file");
-      }
-      int fileStamp;
-      if (json.containsKey("fileStamp")) {
-        fileStamp = jsonDecoder._decodeInt(jsonPath + ".fileStamp", json["fileStamp"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "fileStamp");
-      }
-      List<SourceEdit> edits;
-      if (json.containsKey("edits")) {
-        edits = jsonDecoder._decodeList(jsonPath + ".edits", json["edits"], (String jsonPath, Object json) => new SourceEdit.fromJson(jsonDecoder, jsonPath, json));
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "edits");
-      }
-      return new SourceFileEdit(file, fileStamp, edits: edits);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "SourceFileEdit", json);
-    }
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["file"] = file;
-    result["fileStamp"] = fileStamp;
-    result["edits"] = edits.map((SourceEdit value) => value.toJson()).toList();
-    return result;
-  }
-
-  /**
-   * Adds the given [Edit] to the list.
-   */
-  void add(SourceEdit edit) => _addEditForSource(this, edit);
-
-  /**
-   * Adds the given [Edit]s.
-   */
-  void addAll(Iterable<SourceEdit> edits) =>
-      _addAllEditsForSource(this, edits);
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is SourceFileEdit) {
-      return file == other.file &&
-          fileStamp == other.fileStamp &&
-          _listEqual(edits, other.edits, (SourceEdit a, SourceEdit b) => a == b);
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, file.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, fileStamp.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, edits.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * TypeHierarchyItem
- *
- * {
- *   "classElement": Element
- *   "displayName": optional String
- *   "memberElement": optional Element
- *   "superclass": optional int
- *   "interfaces": List<int>
- *   "mixins": List<int>
- *   "subclasses": List<int>
- * }
- */
-class TypeHierarchyItem implements HasToJson {
-  Element _classElement;
-
-  String _displayName;
-
-  Element _memberElement;
-
-  int _superclass;
-
-  List<int> _interfaces;
-
-  List<int> _mixins;
-
-  List<int> _subclasses;
-
-  /**
-   * The class element represented by this item.
-   */
-  Element get classElement => _classElement;
-
-  /**
-   * The class element represented by this item.
-   */
-  void set classElement(Element value) {
-    assert(value != null);
-    this._classElement = value;
-  }
-
-  /**
-   * The name to be displayed for the class. This field will be omitted if the
-   * display name is the same as the name of the element. The display name is
-   * different if there is additional type information to be displayed, such as
-   * type arguments.
-   */
-  String get displayName => _displayName;
-
-  /**
-   * The name to be displayed for the class. This field will be omitted if the
-   * display name is the same as the name of the element. The display name is
-   * different if there is additional type information to be displayed, such as
-   * type arguments.
-   */
-  void set displayName(String value) {
-    this._displayName = value;
-  }
-
-  /**
-   * The member in the class corresponding to the member on which the hierarchy
-   * was requested. This field will be omitted if the hierarchy was not
-   * requested for a member or if the class does not have a corresponding
-   * member.
-   */
-  Element get memberElement => _memberElement;
-
-  /**
-   * The member in the class corresponding to the member on which the hierarchy
-   * was requested. This field will be omitted if the hierarchy was not
-   * requested for a member or if the class does not have a corresponding
-   * member.
-   */
-  void set memberElement(Element value) {
-    this._memberElement = value;
-  }
-
-  /**
-   * The index of the item representing the superclass of this class. This
-   * field will be omitted if this item represents the class Object.
-   */
-  int get superclass => _superclass;
-
-  /**
-   * The index of the item representing the superclass of this class. This
-   * field will be omitted if this item represents the class Object.
-   */
-  void set superclass(int value) {
-    this._superclass = value;
-  }
-
-  /**
-   * The indexes of the items representing the interfaces implemented by this
-   * class. The list will be empty if there are no implemented interfaces.
-   */
-  List<int> get interfaces => _interfaces;
-
-  /**
-   * The indexes of the items representing the interfaces implemented by this
-   * class. The list will be empty if there are no implemented interfaces.
-   */
-  void set interfaces(List<int> value) {
-    assert(value != null);
-    this._interfaces = value;
-  }
-
-  /**
-   * The indexes of the items representing the mixins referenced by this class.
-   * The list will be empty if there are no classes mixed in to this class.
-   */
-  List<int> get mixins => _mixins;
-
-  /**
-   * The indexes of the items representing the mixins referenced by this class.
-   * The list will be empty if there are no classes mixed in to this class.
-   */
-  void set mixins(List<int> value) {
-    assert(value != null);
-    this._mixins = value;
-  }
-
-  /**
-   * The indexes of the items representing the subtypes of this class. The list
-   * will be empty if there are no subtypes or if this item represents a
-   * supertype of the pivot type.
-   */
-  List<int> get subclasses => _subclasses;
-
-  /**
-   * The indexes of the items representing the subtypes of this class. The list
-   * will be empty if there are no subtypes or if this item represents a
-   * supertype of the pivot type.
-   */
-  void set subclasses(List<int> value) {
-    assert(value != null);
-    this._subclasses = value;
-  }
-
-  TypeHierarchyItem(Element classElement, {String displayName, Element memberElement, int superclass, List<int> interfaces, List<int> mixins, List<int> subclasses}) {
-    this.classElement = classElement;
-    this.displayName = displayName;
-    this.memberElement = memberElement;
-    this.superclass = superclass;
-    if (interfaces == null) {
-      this.interfaces = <int>[];
-    } else {
-      this.interfaces = interfaces;
-    }
-    if (mixins == null) {
-      this.mixins = <int>[];
-    } else {
-      this.mixins = mixins;
-    }
-    if (subclasses == null) {
-      this.subclasses = <int>[];
-    } else {
-      this.subclasses = subclasses;
-    }
-  }
-
-  factory TypeHierarchyItem.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      Element classElement;
-      if (json.containsKey("classElement")) {
-        classElement = new Element.fromJson(jsonDecoder, jsonPath + ".classElement", json["classElement"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "classElement");
-      }
-      String displayName;
-      if (json.containsKey("displayName")) {
-        displayName = jsonDecoder._decodeString(jsonPath + ".displayName", json["displayName"]);
-      }
-      Element memberElement;
-      if (json.containsKey("memberElement")) {
-        memberElement = new Element.fromJson(jsonDecoder, jsonPath + ".memberElement", json["memberElement"]);
-      }
-      int superclass;
-      if (json.containsKey("superclass")) {
-        superclass = jsonDecoder._decodeInt(jsonPath + ".superclass", json["superclass"]);
-      }
-      List<int> interfaces;
-      if (json.containsKey("interfaces")) {
-        interfaces = jsonDecoder._decodeList(jsonPath + ".interfaces", json["interfaces"], jsonDecoder._decodeInt);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "interfaces");
-      }
-      List<int> mixins;
-      if (json.containsKey("mixins")) {
-        mixins = jsonDecoder._decodeList(jsonPath + ".mixins", json["mixins"], jsonDecoder._decodeInt);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "mixins");
-      }
-      List<int> subclasses;
-      if (json.containsKey("subclasses")) {
-        subclasses = jsonDecoder._decodeList(jsonPath + ".subclasses", json["subclasses"], jsonDecoder._decodeInt);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "subclasses");
-      }
-      return new TypeHierarchyItem(classElement, displayName: displayName, memberElement: memberElement, superclass: superclass, interfaces: interfaces, mixins: mixins, subclasses: subclasses);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "TypeHierarchyItem", json);
-    }
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["classElement"] = classElement.toJson();
-    if (displayName != null) {
-      result["displayName"] = displayName;
-    }
-    if (memberElement != null) {
-      result["memberElement"] = memberElement.toJson();
-    }
-    if (superclass != null) {
-      result["superclass"] = superclass;
-    }
-    result["interfaces"] = interfaces;
-    result["mixins"] = mixins;
-    result["subclasses"] = subclasses;
-    return result;
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is TypeHierarchyItem) {
-      return classElement == other.classElement &&
-          displayName == other.displayName &&
-          memberElement == other.memberElement &&
-          superclass == other.superclass &&
-          _listEqual(interfaces, other.interfaces, (int a, int b) => a == b) &&
-          _listEqual(mixins, other.mixins, (int a, int b) => a == b) &&
-          _listEqual(subclasses, other.subclasses, (int a, int b) => a == b);
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, classElement.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, displayName.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, memberElement.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, superclass.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, interfaces.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, mixins.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, subclasses.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-/**
- * convertGetterToMethod feedback
- */
-class ConvertGetterToMethodFeedback {
-  @override
-  bool operator==(other) {
-    if (other is ConvertGetterToMethodFeedback) {
-      return true;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    return 616032599;
-  }
-}
-/**
- * convertGetterToMethod options
- */
-class ConvertGetterToMethodOptions {
-  @override
-  bool operator==(other) {
-    if (other is ConvertGetterToMethodOptions) {
-      return true;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    return 488848400;
-  }
-}
-/**
- * convertMethodToGetter feedback
- */
-class ConvertMethodToGetterFeedback {
-  @override
-  bool operator==(other) {
-    if (other is ConvertMethodToGetterFeedback) {
-      return true;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    return 165291526;
-  }
-}
-/**
- * convertMethodToGetter options
- */
-class ConvertMethodToGetterOptions {
-  @override
-  bool operator==(other) {
-    if (other is ConvertMethodToGetterOptions) {
-      return true;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    return 27952290;
-  }
-}
-
-/**
- * extractLocalVariable feedback
- *
- * {
- *   "names": List<String>
- *   "offsets": List<int>
- *   "lengths": List<int>
- * }
- */
-class ExtractLocalVariableFeedback extends RefactoringFeedback implements HasToJson {
-  List<String> _names;
-
-  List<int> _offsets;
-
-  List<int> _lengths;
-
-  /**
-   * The proposed names for the local variable.
-   */
-  List<String> get names => _names;
-
-  /**
-   * The proposed names for the local variable.
-   */
-  void set names(List<String> value) {
-    assert(value != null);
-    this._names = value;
-  }
-
-  /**
-   * The offsets of the expressions that would be replaced by a reference to
-   * the variable.
-   */
-  List<int> get offsets => _offsets;
-
-  /**
-   * The offsets of the expressions that would be replaced by a reference to
-   * the variable.
-   */
-  void set offsets(List<int> value) {
-    assert(value != null);
-    this._offsets = value;
-  }
-
-  /**
-   * The lengths of the expressions that would be replaced by a reference to
-   * the variable. The lengths correspond to the offsets. In other words, for a
-   * given expression, if the offset of that expression is offsets[i], then the
-   * length of that expression is lengths[i].
-   */
-  List<int> get lengths => _lengths;
-
-  /**
-   * The lengths of the expressions that would be replaced by a reference to
-   * the variable. The lengths correspond to the offsets. In other words, for a
-   * given expression, if the offset of that expression is offsets[i], then the
-   * length of that expression is lengths[i].
-   */
-  void set lengths(List<int> value) {
-    assert(value != null);
-    this._lengths = value;
-  }
-
-  ExtractLocalVariableFeedback(List<String> names, List<int> offsets, List<int> lengths) {
-    this.names = names;
-    this.offsets = offsets;
-    this.lengths = lengths;
-  }
-
-  factory ExtractLocalVariableFeedback.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      List<String> names;
-      if (json.containsKey("names")) {
-        names = jsonDecoder._decodeList(jsonPath + ".names", json["names"], jsonDecoder._decodeString);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "names");
-      }
-      List<int> offsets;
-      if (json.containsKey("offsets")) {
-        offsets = jsonDecoder._decodeList(jsonPath + ".offsets", json["offsets"], jsonDecoder._decodeInt);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "offsets");
-      }
-      List<int> lengths;
-      if (json.containsKey("lengths")) {
-        lengths = jsonDecoder._decodeList(jsonPath + ".lengths", json["lengths"], jsonDecoder._decodeInt);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "lengths");
-      }
-      return new ExtractLocalVariableFeedback(names, offsets, lengths);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "extractLocalVariable feedback", json);
-    }
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["names"] = names;
-    result["offsets"] = offsets;
-    result["lengths"] = lengths;
-    return result;
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is ExtractLocalVariableFeedback) {
-      return _listEqual(names, other.names, (String a, String b) => a == b) &&
-          _listEqual(offsets, other.offsets, (int a, int b) => a == b) &&
-          _listEqual(lengths, other.lengths, (int a, int b) => a == b);
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, names.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, offsets.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, lengths.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * extractLocalVariable options
- *
- * {
- *   "name": String
- *   "extractAll": bool
- * }
- */
-class ExtractLocalVariableOptions extends RefactoringOptions implements HasToJson {
-  String _name;
-
-  bool _extractAll;
-
-  /**
-   * The name that the local variable should be given.
-   */
-  String get name => _name;
-
-  /**
-   * The name that the local variable should be given.
-   */
-  void set name(String value) {
-    assert(value != null);
-    this._name = value;
-  }
-
-  /**
-   * True if all occurrences of the expression within the scope in which the
-   * variable will be defined should be replaced by a reference to the local
-   * variable. The expression used to initiate the refactoring will always be
-   * replaced.
-   */
-  bool get extractAll => _extractAll;
-
-  /**
-   * True if all occurrences of the expression within the scope in which the
-   * variable will be defined should be replaced by a reference to the local
-   * variable. The expression used to initiate the refactoring will always be
-   * replaced.
-   */
-  void set extractAll(bool value) {
-    assert(value != null);
-    this._extractAll = value;
-  }
-
-  ExtractLocalVariableOptions(String name, bool extractAll) {
-    this.name = name;
-    this.extractAll = extractAll;
-  }
-
-  factory ExtractLocalVariableOptions.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      String name;
-      if (json.containsKey("name")) {
-        name = jsonDecoder._decodeString(jsonPath + ".name", json["name"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "name");
-      }
-      bool extractAll;
-      if (json.containsKey("extractAll")) {
-        extractAll = jsonDecoder._decodeBool(jsonPath + ".extractAll", json["extractAll"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "extractAll");
-      }
-      return new ExtractLocalVariableOptions(name, extractAll);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "extractLocalVariable options", json);
-    }
-  }
-
-  factory ExtractLocalVariableOptions.fromRefactoringParams(EditGetRefactoringParams refactoringParams, Request request) {
-    return new ExtractLocalVariableOptions.fromJson(
-        new RequestDecoder(request), "options", refactoringParams.options);
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["name"] = name;
-    result["extractAll"] = extractAll;
-    return result;
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is ExtractLocalVariableOptions) {
-      return name == other.name &&
-          extractAll == other.extractAll;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, name.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, extractAll.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * extractMethod feedback
- *
- * {
- *   "offset": int
- *   "length": int
- *   "returnType": String
- *   "names": List<String>
- *   "canCreateGetter": bool
- *   "parameters": List<RefactoringMethodParameter>
- *   "offsets": List<int>
- *   "lengths": List<int>
- * }
- */
-class ExtractMethodFeedback extends RefactoringFeedback implements HasToJson {
-  int _offset;
-
-  int _length;
-
-  String _returnType;
-
-  List<String> _names;
-
-  bool _canCreateGetter;
-
-  List<RefactoringMethodParameter> _parameters;
-
-  List<int> _offsets;
-
-  List<int> _lengths;
-
-  /**
-   * The offset to the beginning of the expression or statements that will be
-   * extracted.
-   */
-  int get offset => _offset;
-
-  /**
-   * The offset to the beginning of the expression or statements that will be
-   * extracted.
-   */
-  void set offset(int value) {
-    assert(value != null);
-    this._offset = value;
-  }
-
-  /**
-   * The length of the expression or statements that will be extracted.
-   */
-  int get length => _length;
-
-  /**
-   * The length of the expression or statements that will be extracted.
-   */
-  void set length(int value) {
-    assert(value != null);
-    this._length = value;
-  }
-
-  /**
-   * The proposed return type for the method. If the returned element does not
-   * have a declared return type, this field will contain an empty string.
-   */
-  String get returnType => _returnType;
-
-  /**
-   * The proposed return type for the method. If the returned element does not
-   * have a declared return type, this field will contain an empty string.
-   */
-  void set returnType(String value) {
-    assert(value != null);
-    this._returnType = value;
-  }
-
-  /**
-   * The proposed names for the method.
-   */
-  List<String> get names => _names;
-
-  /**
-   * The proposed names for the method.
-   */
-  void set names(List<String> value) {
-    assert(value != null);
-    this._names = value;
-  }
-
-  /**
-   * True if a getter could be created rather than a method.
-   */
-  bool get canCreateGetter => _canCreateGetter;
-
-  /**
-   * True if a getter could be created rather than a method.
-   */
-  void set canCreateGetter(bool value) {
-    assert(value != null);
-    this._canCreateGetter = value;
-  }
-
-  /**
-   * The proposed parameters for the method.
-   */
-  List<RefactoringMethodParameter> get parameters => _parameters;
-
-  /**
-   * The proposed parameters for the method.
-   */
-  void set parameters(List<RefactoringMethodParameter> value) {
-    assert(value != null);
-    this._parameters = value;
-  }
-
-  /**
-   * The offsets of the expressions or statements that would be replaced by an
-   * invocation of the method.
-   */
-  List<int> get offsets => _offsets;
-
-  /**
-   * The offsets of the expressions or statements that would be replaced by an
-   * invocation of the method.
-   */
-  void set offsets(List<int> value) {
-    assert(value != null);
-    this._offsets = value;
-  }
-
-  /**
-   * The lengths of the expressions or statements that would be replaced by an
-   * invocation of the method. The lengths correspond to the offsets. In other
-   * words, for a given expression (or block of statements), if the offset of
-   * that expression is offsets[i], then the length of that expression is
-   * lengths[i].
-   */
-  List<int> get lengths => _lengths;
-
-  /**
-   * The lengths of the expressions or statements that would be replaced by an
-   * invocation of the method. The lengths correspond to the offsets. In other
-   * words, for a given expression (or block of statements), if the offset of
-   * that expression is offsets[i], then the length of that expression is
-   * lengths[i].
-   */
-  void set lengths(List<int> value) {
-    assert(value != null);
-    this._lengths = value;
-  }
-
-  ExtractMethodFeedback(int offset, int length, String returnType, List<String> names, bool canCreateGetter, List<RefactoringMethodParameter> parameters, List<int> offsets, List<int> lengths) {
-    this.offset = offset;
-    this.length = length;
-    this.returnType = returnType;
-    this.names = names;
-    this.canCreateGetter = canCreateGetter;
-    this.parameters = parameters;
-    this.offsets = offsets;
-    this.lengths = lengths;
-  }
-
-  factory ExtractMethodFeedback.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      int offset;
-      if (json.containsKey("offset")) {
-        offset = jsonDecoder._decodeInt(jsonPath + ".offset", json["offset"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "offset");
-      }
-      int length;
-      if (json.containsKey("length")) {
-        length = jsonDecoder._decodeInt(jsonPath + ".length", json["length"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "length");
-      }
-      String returnType;
-      if (json.containsKey("returnType")) {
-        returnType = jsonDecoder._decodeString(jsonPath + ".returnType", json["returnType"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "returnType");
-      }
-      List<String> names;
-      if (json.containsKey("names")) {
-        names = jsonDecoder._decodeList(jsonPath + ".names", json["names"], jsonDecoder._decodeString);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "names");
-      }
-      bool canCreateGetter;
-      if (json.containsKey("canCreateGetter")) {
-        canCreateGetter = jsonDecoder._decodeBool(jsonPath + ".canCreateGetter", json["canCreateGetter"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "canCreateGetter");
-      }
-      List<RefactoringMethodParameter> parameters;
-      if (json.containsKey("parameters")) {
-        parameters = jsonDecoder._decodeList(jsonPath + ".parameters", json["parameters"], (String jsonPath, Object json) => new RefactoringMethodParameter.fromJson(jsonDecoder, jsonPath, json));
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "parameters");
-      }
-      List<int> offsets;
-      if (json.containsKey("offsets")) {
-        offsets = jsonDecoder._decodeList(jsonPath + ".offsets", json["offsets"], jsonDecoder._decodeInt);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "offsets");
-      }
-      List<int> lengths;
-      if (json.containsKey("lengths")) {
-        lengths = jsonDecoder._decodeList(jsonPath + ".lengths", json["lengths"], jsonDecoder._decodeInt);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "lengths");
-      }
-      return new ExtractMethodFeedback(offset, length, returnType, names, canCreateGetter, parameters, offsets, lengths);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "extractMethod feedback", json);
-    }
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["offset"] = offset;
-    result["length"] = length;
-    result["returnType"] = returnType;
-    result["names"] = names;
-    result["canCreateGetter"] = canCreateGetter;
-    result["parameters"] = parameters.map((RefactoringMethodParameter value) => value.toJson()).toList();
-    result["offsets"] = offsets;
-    result["lengths"] = lengths;
-    return result;
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is ExtractMethodFeedback) {
-      return offset == other.offset &&
-          length == other.length &&
-          returnType == other.returnType &&
-          _listEqual(names, other.names, (String a, String b) => a == b) &&
-          canCreateGetter == other.canCreateGetter &&
-          _listEqual(parameters, other.parameters, (RefactoringMethodParameter a, RefactoringMethodParameter b) => a == b) &&
-          _listEqual(offsets, other.offsets, (int a, int b) => a == b) &&
-          _listEqual(lengths, other.lengths, (int a, int b) => a == b);
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, offset.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, length.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, returnType.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, names.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, canCreateGetter.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, parameters.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, offsets.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, lengths.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * extractMethod options
- *
- * {
- *   "returnType": String
- *   "createGetter": bool
- *   "name": String
- *   "parameters": List<RefactoringMethodParameter>
- *   "extractAll": bool
- * }
- */
-class ExtractMethodOptions extends RefactoringOptions implements HasToJson {
-  String _returnType;
-
-  bool _createGetter;
-
-  String _name;
-
-  List<RefactoringMethodParameter> _parameters;
-
-  bool _extractAll;
-
-  /**
-   * The return type that should be defined for the method.
-   */
-  String get returnType => _returnType;
-
-  /**
-   * The return type that should be defined for the method.
-   */
-  void set returnType(String value) {
-    assert(value != null);
-    this._returnType = value;
-  }
-
-  /**
-   * True if a getter should be created rather than a method. It is an error if
-   * this field is true and the list of parameters is non-empty.
-   */
-  bool get createGetter => _createGetter;
-
-  /**
-   * True if a getter should be created rather than a method. It is an error if
-   * this field is true and the list of parameters is non-empty.
-   */
-  void set createGetter(bool value) {
-    assert(value != null);
-    this._createGetter = value;
-  }
-
-  /**
-   * The name that the method should be given.
-   */
-  String get name => _name;
-
-  /**
-   * The name that the method should be given.
-   */
-  void set name(String value) {
-    assert(value != null);
-    this._name = value;
-  }
-
-  /**
-   * The parameters that should be defined for the method.
-   *
-   * It is an error if a REQUIRED or NAMED parameter follows a POSITIONAL
-   * parameter. It is an error if a REQUIRED or POSITIONAL parameter follows a
-   * NAMED parameter.
-   *
-   * - To change the order and/or update proposed parameters, add parameters
-   *   with the same identifiers as proposed.
-   * - To add new parameters, omit their identifier.
-   * - To remove some parameters, omit them in this list.
-   */
-  List<RefactoringMethodParameter> get parameters => _parameters;
-
-  /**
-   * The parameters that should be defined for the method.
-   *
-   * It is an error if a REQUIRED or NAMED parameter follows a POSITIONAL
-   * parameter. It is an error if a REQUIRED or POSITIONAL parameter follows a
-   * NAMED parameter.
-   *
-   * - To change the order and/or update proposed parameters, add parameters
-   *   with the same identifiers as proposed.
-   * - To add new parameters, omit their identifier.
-   * - To remove some parameters, omit them in this list.
-   */
-  void set parameters(List<RefactoringMethodParameter> value) {
-    assert(value != null);
-    this._parameters = value;
-  }
-
-  /**
-   * True if all occurrences of the expression or statements should be replaced
-   * by an invocation of the method. The expression or statements used to
-   * initiate the refactoring will always be replaced.
-   */
-  bool get extractAll => _extractAll;
-
-  /**
-   * True if all occurrences of the expression or statements should be replaced
-   * by an invocation of the method. The expression or statements used to
-   * initiate the refactoring will always be replaced.
-   */
-  void set extractAll(bool value) {
-    assert(value != null);
-    this._extractAll = value;
-  }
-
-  ExtractMethodOptions(String returnType, bool createGetter, String name, List<RefactoringMethodParameter> parameters, bool extractAll) {
-    this.returnType = returnType;
-    this.createGetter = createGetter;
-    this.name = name;
-    this.parameters = parameters;
-    this.extractAll = extractAll;
-  }
-
-  factory ExtractMethodOptions.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      String returnType;
-      if (json.containsKey("returnType")) {
-        returnType = jsonDecoder._decodeString(jsonPath + ".returnType", json["returnType"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "returnType");
-      }
-      bool createGetter;
-      if (json.containsKey("createGetter")) {
-        createGetter = jsonDecoder._decodeBool(jsonPath + ".createGetter", json["createGetter"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "createGetter");
-      }
-      String name;
-      if (json.containsKey("name")) {
-        name = jsonDecoder._decodeString(jsonPath + ".name", json["name"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "name");
-      }
-      List<RefactoringMethodParameter> parameters;
-      if (json.containsKey("parameters")) {
-        parameters = jsonDecoder._decodeList(jsonPath + ".parameters", json["parameters"], (String jsonPath, Object json) => new RefactoringMethodParameter.fromJson(jsonDecoder, jsonPath, json));
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "parameters");
-      }
-      bool extractAll;
-      if (json.containsKey("extractAll")) {
-        extractAll = jsonDecoder._decodeBool(jsonPath + ".extractAll", json["extractAll"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "extractAll");
-      }
-      return new ExtractMethodOptions(returnType, createGetter, name, parameters, extractAll);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "extractMethod options", json);
-    }
-  }
-
-  factory ExtractMethodOptions.fromRefactoringParams(EditGetRefactoringParams refactoringParams, Request request) {
-    return new ExtractMethodOptions.fromJson(
-        new RequestDecoder(request), "options", refactoringParams.options);
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["returnType"] = returnType;
-    result["createGetter"] = createGetter;
-    result["name"] = name;
-    result["parameters"] = parameters.map((RefactoringMethodParameter value) => value.toJson()).toList();
-    result["extractAll"] = extractAll;
-    return result;
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is ExtractMethodOptions) {
-      return returnType == other.returnType &&
-          createGetter == other.createGetter &&
-          name == other.name &&
-          _listEqual(parameters, other.parameters, (RefactoringMethodParameter a, RefactoringMethodParameter b) => a == b) &&
-          extractAll == other.extractAll;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, returnType.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, createGetter.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, name.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, parameters.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, extractAll.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * inlineLocalVariable feedback
- *
- * {
- *   "name": String
- *   "occurrences": int
- * }
- */
-class InlineLocalVariableFeedback extends RefactoringFeedback implements HasToJson {
-  String _name;
-
-  int _occurrences;
-
-  /**
-   * The name of the variable being inlined.
-   */
-  String get name => _name;
-
-  /**
-   * The name of the variable being inlined.
-   */
-  void set name(String value) {
-    assert(value != null);
-    this._name = value;
-  }
-
-  /**
-   * The number of times the variable occurs.
-   */
-  int get occurrences => _occurrences;
-
-  /**
-   * The number of times the variable occurs.
-   */
-  void set occurrences(int value) {
-    assert(value != null);
-    this._occurrences = value;
-  }
-
-  InlineLocalVariableFeedback(String name, int occurrences) {
-    this.name = name;
-    this.occurrences = occurrences;
-  }
-
-  factory InlineLocalVariableFeedback.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      String name;
-      if (json.containsKey("name")) {
-        name = jsonDecoder._decodeString(jsonPath + ".name", json["name"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "name");
-      }
-      int occurrences;
-      if (json.containsKey("occurrences")) {
-        occurrences = jsonDecoder._decodeInt(jsonPath + ".occurrences", json["occurrences"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "occurrences");
-      }
-      return new InlineLocalVariableFeedback(name, occurrences);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "inlineLocalVariable feedback", json);
-    }
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["name"] = name;
-    result["occurrences"] = occurrences;
-    return result;
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is InlineLocalVariableFeedback) {
-      return name == other.name &&
-          occurrences == other.occurrences;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, name.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, occurrences.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-/**
- * inlineLocalVariable options
- */
-class InlineLocalVariableOptions {
-  @override
-  bool operator==(other) {
-    if (other is InlineLocalVariableOptions) {
-      return true;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    return 540364977;
-  }
-}
-
-/**
- * inlineMethod feedback
- *
- * {
- *   "className": optional String
- *   "methodName": String
- *   "isDeclaration": bool
- * }
- */
-class InlineMethodFeedback extends RefactoringFeedback implements HasToJson {
-  String _className;
-
-  String _methodName;
-
-  bool _isDeclaration;
-
-  /**
-   * The name of the class enclosing the method being inlined. If not a class
-   * member is being inlined, this field will be absent.
-   */
-  String get className => _className;
-
-  /**
-   * The name of the class enclosing the method being inlined. If not a class
-   * member is being inlined, this field will be absent.
-   */
-  void set className(String value) {
-    this._className = value;
-  }
-
-  /**
-   * The name of the method (or function) being inlined.
-   */
-  String get methodName => _methodName;
-
-  /**
-   * The name of the method (or function) being inlined.
-   */
-  void set methodName(String value) {
-    assert(value != null);
-    this._methodName = value;
-  }
-
-  /**
-   * True if the declaration of the method is selected. So all references
-   * should be inlined.
-   */
-  bool get isDeclaration => _isDeclaration;
-
-  /**
-   * True if the declaration of the method is selected. So all references
-   * should be inlined.
-   */
-  void set isDeclaration(bool value) {
-    assert(value != null);
-    this._isDeclaration = value;
-  }
-
-  InlineMethodFeedback(String methodName, bool isDeclaration, {String className}) {
-    this.className = className;
-    this.methodName = methodName;
-    this.isDeclaration = isDeclaration;
-  }
-
-  factory InlineMethodFeedback.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      String className;
-      if (json.containsKey("className")) {
-        className = jsonDecoder._decodeString(jsonPath + ".className", json["className"]);
-      }
-      String methodName;
-      if (json.containsKey("methodName")) {
-        methodName = jsonDecoder._decodeString(jsonPath + ".methodName", json["methodName"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "methodName");
-      }
-      bool isDeclaration;
-      if (json.containsKey("isDeclaration")) {
-        isDeclaration = jsonDecoder._decodeBool(jsonPath + ".isDeclaration", json["isDeclaration"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "isDeclaration");
-      }
-      return new InlineMethodFeedback(methodName, isDeclaration, className: className);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "inlineMethod feedback", json);
-    }
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    if (className != null) {
-      result["className"] = className;
-    }
-    result["methodName"] = methodName;
-    result["isDeclaration"] = isDeclaration;
-    return result;
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is InlineMethodFeedback) {
-      return className == other.className &&
-          methodName == other.methodName &&
-          isDeclaration == other.isDeclaration;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, className.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, methodName.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, isDeclaration.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * inlineMethod options
- *
- * {
- *   "deleteSource": bool
- *   "inlineAll": bool
- * }
- */
-class InlineMethodOptions extends RefactoringOptions implements HasToJson {
-  bool _deleteSource;
-
-  bool _inlineAll;
-
-  /**
-   * True if the method being inlined should be removed. It is an error if this
-   * field is true and inlineAll is false.
-   */
-  bool get deleteSource => _deleteSource;
-
-  /**
-   * True if the method being inlined should be removed. It is an error if this
-   * field is true and inlineAll is false.
-   */
-  void set deleteSource(bool value) {
-    assert(value != null);
-    this._deleteSource = value;
-  }
-
-  /**
-   * True if all invocations of the method should be inlined, or false if only
-   * the invocation site used to create this refactoring should be inlined.
-   */
-  bool get inlineAll => _inlineAll;
-
-  /**
-   * True if all invocations of the method should be inlined, or false if only
-   * the invocation site used to create this refactoring should be inlined.
-   */
-  void set inlineAll(bool value) {
-    assert(value != null);
-    this._inlineAll = value;
-  }
-
-  InlineMethodOptions(bool deleteSource, bool inlineAll) {
-    this.deleteSource = deleteSource;
-    this.inlineAll = inlineAll;
-  }
-
-  factory InlineMethodOptions.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      bool deleteSource;
-      if (json.containsKey("deleteSource")) {
-        deleteSource = jsonDecoder._decodeBool(jsonPath + ".deleteSource", json["deleteSource"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "deleteSource");
-      }
-      bool inlineAll;
-      if (json.containsKey("inlineAll")) {
-        inlineAll = jsonDecoder._decodeBool(jsonPath + ".inlineAll", json["inlineAll"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "inlineAll");
-      }
-      return new InlineMethodOptions(deleteSource, inlineAll);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "inlineMethod options", json);
-    }
-  }
-
-  factory InlineMethodOptions.fromRefactoringParams(EditGetRefactoringParams refactoringParams, Request request) {
-    return new InlineMethodOptions.fromJson(
-        new RequestDecoder(request), "options", refactoringParams.options);
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["deleteSource"] = deleteSource;
-    result["inlineAll"] = inlineAll;
-    return result;
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is InlineMethodOptions) {
-      return deleteSource == other.deleteSource &&
-          inlineAll == other.inlineAll;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, deleteSource.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, inlineAll.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-/**
- * moveFile feedback
- */
-class MoveFileFeedback {
-  @override
-  bool operator==(other) {
-    if (other is MoveFileFeedback) {
-      return true;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    return 438975893;
-  }
-}
-
-/**
- * moveFile options
- *
- * {
- *   "newFile": FilePath
- * }
- */
-class MoveFileOptions extends RefactoringOptions implements HasToJson {
-  String _newFile;
-
-  /**
-   * The new file path to which the given file is being moved.
-   */
-  String get newFile => _newFile;
-
-  /**
-   * The new file path to which the given file is being moved.
-   */
-  void set newFile(String value) {
-    assert(value != null);
-    this._newFile = value;
-  }
-
-  MoveFileOptions(String newFile) {
-    this.newFile = newFile;
-  }
-
-  factory MoveFileOptions.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      String newFile;
-      if (json.containsKey("newFile")) {
-        newFile = jsonDecoder._decodeString(jsonPath + ".newFile", json["newFile"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "newFile");
-      }
-      return new MoveFileOptions(newFile);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "moveFile options", json);
-    }
-  }
-
-  factory MoveFileOptions.fromRefactoringParams(EditGetRefactoringParams refactoringParams, Request request) {
-    return new MoveFileOptions.fromJson(
-        new RequestDecoder(request), "options", refactoringParams.options);
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["newFile"] = newFile;
-    return result;
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is MoveFileOptions) {
-      return newFile == other.newFile;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, newFile.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * rename feedback
- *
- * {
- *   "offset": int
- *   "length": int
- *   "elementKindName": String
- *   "oldName": String
- * }
- */
-class RenameFeedback extends RefactoringFeedback implements HasToJson {
-  int _offset;
-
-  int _length;
-
-  String _elementKindName;
-
-  String _oldName;
-
-  /**
-   * The offset to the beginning of the name selected to be renamed.
-   */
-  int get offset => _offset;
-
-  /**
-   * The offset to the beginning of the name selected to be renamed.
-   */
-  void set offset(int value) {
-    assert(value != null);
-    this._offset = value;
-  }
-
-  /**
-   * The length of the name selected to be renamed.
-   */
-  int get length => _length;
-
-  /**
-   * The length of the name selected to be renamed.
-   */
-  void set length(int value) {
-    assert(value != null);
-    this._length = value;
-  }
-
-  /**
-   * The human-readable description of the kind of element being renamed (such
-   * as “class” or “function type alias”).
-   */
-  String get elementKindName => _elementKindName;
-
-  /**
-   * The human-readable description of the kind of element being renamed (such
-   * as “class” or “function type alias”).
-   */
-  void set elementKindName(String value) {
-    assert(value != null);
-    this._elementKindName = value;
-  }
-
-  /**
-   * The old name of the element before the refactoring.
-   */
-  String get oldName => _oldName;
-
-  /**
-   * The old name of the element before the refactoring.
-   */
-  void set oldName(String value) {
-    assert(value != null);
-    this._oldName = value;
-  }
-
-  RenameFeedback(int offset, int length, String elementKindName, String oldName) {
-    this.offset = offset;
-    this.length = length;
-    this.elementKindName = elementKindName;
-    this.oldName = oldName;
-  }
-
-  factory RenameFeedback.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      int offset;
-      if (json.containsKey("offset")) {
-        offset = jsonDecoder._decodeInt(jsonPath + ".offset", json["offset"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "offset");
-      }
-      int length;
-      if (json.containsKey("length")) {
-        length = jsonDecoder._decodeInt(jsonPath + ".length", json["length"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "length");
-      }
-      String elementKindName;
-      if (json.containsKey("elementKindName")) {
-        elementKindName = jsonDecoder._decodeString(jsonPath + ".elementKindName", json["elementKindName"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "elementKindName");
-      }
-      String oldName;
-      if (json.containsKey("oldName")) {
-        oldName = jsonDecoder._decodeString(jsonPath + ".oldName", json["oldName"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "oldName");
-      }
-      return new RenameFeedback(offset, length, elementKindName, oldName);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "rename feedback", json);
-    }
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["offset"] = offset;
-    result["length"] = length;
-    result["elementKindName"] = elementKindName;
-    result["oldName"] = oldName;
-    return result;
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is RenameFeedback) {
-      return offset == other.offset &&
-          length == other.length &&
-          elementKindName == other.elementKindName &&
-          oldName == other.oldName;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, offset.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, length.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, elementKindName.hashCode);
-    hash = _JenkinsSmiHash.combine(hash, oldName.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
-
-/**
- * rename options
- *
- * {
- *   "newName": String
- * }
- */
-class RenameOptions extends RefactoringOptions implements HasToJson {
-  String _newName;
-
-  /**
-   * The name that the element should have after the refactoring.
-   */
-  String get newName => _newName;
-
-  /**
-   * The name that the element should have after the refactoring.
-   */
-  void set newName(String value) {
-    assert(value != null);
-    this._newName = value;
-  }
-
-  RenameOptions(String newName) {
-    this.newName = newName;
-  }
-
-  factory RenameOptions.fromJson(JsonDecoder jsonDecoder, String jsonPath, Object json) {
-    if (json == null) {
-      json = {};
-    }
-    if (json is Map) {
-      String newName;
-      if (json.containsKey("newName")) {
-        newName = jsonDecoder._decodeString(jsonPath + ".newName", json["newName"]);
-      } else {
-        throw jsonDecoder.missingKey(jsonPath, "newName");
-      }
-      return new RenameOptions(newName);
-    } else {
-      throw jsonDecoder.mismatch(jsonPath, "rename options", json);
-    }
-  }
-
-  factory RenameOptions.fromRefactoringParams(EditGetRefactoringParams refactoringParams, Request request) {
-    return new RenameOptions.fromJson(
-        new RequestDecoder(request), "options", refactoringParams.options);
-  }
-
-  Map<String, dynamic> toJson() {
-    Map<String, dynamic> result = {};
-    result["newName"] = newName;
-    return result;
-  }
-
-  @override
-  String toString() => JSON.encode(toJson());
-
-  @override
-  bool operator==(other) {
-    if (other is RenameOptions) {
-      return newName == other.newName;
-    }
-    return false;
-  }
-
-  @override
-  int get hashCode {
-    int hash = 0;
-    hash = _JenkinsSmiHash.combine(hash, newName.hashCode);
-    return _JenkinsSmiHash.finish(hash);
-  }
-}
diff --git a/pkg/analysis_server/lib/src/get_handler.dart b/pkg/analysis_server/lib/src/get_handler.dart
index 360b5da..fbf70a1 100644
--- a/pkg/analysis_server/lib/src/get_handler.dart
+++ b/pkg/analysis_server/lib/src/get_handler.dart
@@ -10,13 +10,13 @@
 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_execution.dart';
 import 'package:analysis_server/src/operation/operation.dart';
 import 'package:analysis_server/src/operation/operation_analysis.dart';
 import 'package:analysis_server/src/operation/operation_queue.dart';
-import 'package:analysis_server/src/protocol.dart' hide Element;
 import 'package:analysis_server/src/services/index/index.dart';
 import 'package:analysis_server/src/services/index/local_index.dart';
 import 'package:analysis_server/src/services/index/store/split_store.dart';
@@ -174,8 +174,8 @@
     if (analysisServer == null) {
       return null;
     }
-    return analysisServer.handlers.firstWhere(
-        (h) => h is CompletionDomainHandler, orElse: () => null);
+    return analysisServer.handlers
+        .firstWhere((h) => h is CompletionDomainHandler, orElse: () => null);
   }
 
   /**
@@ -218,7 +218,8 @@
    */
   Folder _findFolder(AnalysisServer analysisServer, String contextFilter) {
     return analysisServer.folderMap.keys.firstWhere(
-        (Folder folder) => folder.path == contextFilter, orElse: () => null);
+        (Folder folder) => folder.path == contextFilter,
+        orElse: () => null);
   }
 
   /**
@@ -299,12 +300,15 @@
           buffer.write('<p><b>Task performace 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);
+          _writeRow(
+              buffer,
+              [
+                'Task Name',
+                'Count',
+                'Total Time (in ms)',
+                'Average Time (in ms)'
+              ],
+              header: true);
 
           Map<Type, int> countMap = newTask.AnalysisTask.countMap;
           Map<Type, Stopwatch> stopwatchMap = newTask.AnalysisTask.stopwatchMap;
@@ -324,7 +328,12 @@
               count,
               taskTime,
               count <= 0 ? '-' : (taskTime / count).toStringAsFixed(3)
-            ], classes: [null, "right", "right", "right"]);
+            ], classes: [
+              null,
+              "right",
+              "right",
+              "right"
+            ]);
           });
           _writeRow(buffer, ['Total', '-', totalTime, '-'],
               classes: [null, "right", "right", "right"]);
@@ -392,10 +401,8 @@
     AnalysisContextImpl context = analysisServer.folderMap[folder];
 
     _writeResponse(request, (StringBuffer buffer) {
-      _writePage(buffer, 'Analysis Server - AST Structure', [
-        'Context: $contextFilter',
-        'File: $sourceUri'
-      ], (HttpResponse) {
+      _writePage(buffer, 'Analysis Server - AST Structure',
+          ['Context: $contextFilter', 'File: $sourceUri'], (HttpResponse) {
         Source source = context.sourceFactory.forUri(sourceUri);
         if (source == null) {
           buffer.write('<p>Not found.</p>');
@@ -465,10 +472,8 @@
     AnalysisContextImpl context = analysisServer.folderMap[folder];
 
     _writeResponse(request, (StringBuffer buffer) {
-      _writePage(buffer, 'Analysis Server - Cache Entry', [
-        'Context: $contextFilter',
-        'File: $sourceUri'
-      ], (HttpResponse) {
+      _writePage(buffer, 'Analysis Server - Cache Entry',
+          ['Context: $contextFilter', 'File: $sourceUri'], (HttpResponse) {
         buffer.write('<h3>Analyzing Contexts</h3><p>');
         bool first = true;
         allContexts.forEach((Folder folder) {
@@ -482,10 +487,13 @@
           if (analyzingContext == context) {
             buffer.write(folder.path);
           } else {
-            buffer.write(makeLink(CACHE_ENTRY_PATH, {
-              CONTEXT_QUERY_PARAM: folder.path,
-              SOURCE_QUERY_PARAM: sourceUri
-            }, HTML_ESCAPE.convert(folder.path)));
+            buffer.write(makeLink(
+                CACHE_ENTRY_PATH,
+                {
+                  CONTEXT_QUERY_PARAM: folder.path,
+                  SOURCE_QUERY_PARAM: sourceUri
+                },
+                HTML_ESCAPE.convert(folder.path)));
           }
           if (entryMap[folder].explicitlyAdded) {
             buffer.write(' (explicit)');
@@ -512,7 +520,9 @@
           for (Source librarySource in entry.containingLibraries) {
             String libraryName = HTML_ESCAPE.convert(librarySource.fullName);
             buffer.write('<h3>In library $libraryName:</h3>');
-            _writeDescriptorTable(buffer, entry.libraryDescriptors,
+            _writeDescriptorTable(
+                buffer,
+                entry.libraryDescriptors,
                 (DataDescriptor descriptor) =>
                     entry.getStateInLibrary(descriptor, librarySource),
                 (DataDescriptor descriptor) =>
@@ -575,10 +585,13 @@
       if (state != stateFilter || rowDesc.toString() != descriptorFilter) {
         return;
       }
-      String link = makeLink(CACHE_ENTRY_PATH, {
-        CONTEXT_QUERY_PARAM: folder.path,
-        SOURCE_QUERY_PARAM: source.uri.toString()
-      }, HTML_ESCAPE.convert(source.fullName));
+      String link = makeLink(
+          CACHE_ENTRY_PATH,
+          {
+            CONTEXT_QUERY_PARAM: folder.path,
+            SOURCE_QUERY_PARAM: source.uri.toString()
+          },
+          HTML_ESCAPE.convert(source.fullName));
       links.add(link);
     });
 
@@ -717,10 +730,14 @@
         if (exception != null) {
           exceptions.add(exception);
         }
-        String link = makeLink(CACHE_ENTRY_PATH, {
-          CONTEXT_QUERY_PARAM: folder.path,
-          SOURCE_QUERY_PARAM: source.uri.toString()
-        }, sourceName, exception != null);
+        String link = makeLink(
+            CACHE_ENTRY_PATH,
+            {
+              CONTEXT_QUERY_PARAM: folder.path,
+              SOURCE_QUERY_PARAM: source.uri.toString()
+            },
+            sourceName,
+            exception != null);
         if (sourceEntry.explicitlyAdded) {
           explicitNames.add(sourceName);
         } else {
@@ -759,8 +776,9 @@
     }
 
     _writeResponse(request, (StringBuffer buffer) {
-      _writePage(buffer, 'Analysis Server - Context',
-          ['Context: $contextFilter'], (StringBuffer buffer) {
+      _writePage(
+          buffer, 'Analysis Server - Context', ['Context: $contextFilter'],
+          (StringBuffer buffer) {
         List headerRowText = ['Context'];
         headerRowText.addAll(CacheState.values);
         buffer.write('<h3>Summary</h3>');
@@ -884,8 +902,8 @@
           buffer.write('<table border="1">');
           _writeRow(buffer, ['Element', 'Relationship', 'Location'],
               header: true);
-          relations.forEach((List<String> elementPath,
-              List<InspectLocation> relations) {
+          relations.forEach(
+              (List<String> elementPath, List<InspectLocation> relations) {
             String elementLocation = elementPath.join(' ');
             relations.forEach((InspectLocation location) {
               var relString = location.relationship.identifier;
@@ -1041,9 +1059,8 @@
           buffer.write('<br>');
         }
         String key = folder.shortName;
-        buffer.write(makeLink(CONTEXT_PATH, {
-          CONTEXT_QUERY_PARAM: folder.path
-        }, key, _hasException(folderMap[folder])));
+        buffer.write(makeLink(CONTEXT_PATH, {CONTEXT_QUERY_PARAM: folder.path},
+            key, _hasException(folderMap[folder])));
       });
       buffer.write('</p>');
 
@@ -1054,6 +1071,7 @@
       _writeOption(buffer, 'Cache size', options.cacheSize);
       _writeOption(
           buffer, 'Enable strict call checks', options.enableStrictCallChecks);
+      _writeOption(buffer, 'Enable super mixins', options.enableSuperMixins);
       _writeOption(buffer, 'Generate hints', options.hint);
       _writeOption(buffer, 'Generate dart2js hints', options.dart2jsHint);
       _writeOption(buffer, 'Generate errors in implicit files',
@@ -1129,24 +1147,26 @@
       return;
     }
     buffer.write('<table>');
-    _writeRow(buffer, [
-      'Start Time',
-      '',
-      'First (ms)',
-      '',
-      'Complete (ms)',
-      '',
-      '# Notifications',
-      '',
-      '# Suggestions',
-      '',
-      'Snippet'
-    ], header: true);
+    _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}');
+      String link = makeLink(COMPLETION_PATH, {'index': '$index'},
+          '${performance.startTimeAndMs}');
       _writeRow(buffer, [
         link,
         '&nbsp;&nbsp;',
@@ -1188,9 +1208,12 @@
    * [linkParameters] will be used if the value is too large to be displayed on
    * the current page and needs to be linked to a separate page.
    */
-  void _writeDescriptorTable(StringBuffer buffer,
-      List<DataDescriptor> descriptors, CacheState getState(DataDescriptor),
-      dynamic getValue(DataDescriptor), Map<String, String> linkParameters) {
+  void _writeDescriptorTable(
+      StringBuffer buffer,
+      List<DataDescriptor> descriptors,
+      CacheState getState(DataDescriptor),
+      dynamic getValue(DataDescriptor),
+      Map<String, String> linkParameters) {
     buffer.write('<dl>');
     for (DataDescriptor descriptor in descriptors) {
       String descriptorName = HTML_ESCAPE.convert(descriptor.toString());
@@ -1362,9 +1385,9 @@
    */
   void _writePluginStatus(StringBuffer buffer) {
     void writePlugin(Plugin plugin) {
-      buffer.write(_server.serverPlugin.uniqueIdentifier);
+      buffer.write(plugin.uniqueIdentifier);
       buffer.write(' (');
-      buffer.write(_server.serverPlugin.runtimeType);
+      buffer.write(plugin.runtimeType);
       buffer.write(')<br>');
     }
     buffer.write('<h3>Plugin Status</h3><p>');
diff --git a/pkg/analysis_server/lib/src/operation/operation.dart b/pkg/analysis_server/lib/src/operation/operation.dart
index 6c5732d..1a43a188 100644
--- a/pkg/analysis_server/lib/src/operation/operation.dart
+++ b/pkg/analysis_server/lib/src/operation/operation.dart
@@ -9,6 +9,21 @@
 import 'package:analyzer/src/generated/source.dart';
 
 /**
+ * [MergeableOperation] can decide whether other operation can be merged into
+ * it, so that it should not be added as a separate operation.
+ */
+abstract class MergeableOperation extends ServerOperation {
+  MergeableOperation(AnalysisContext context) : super(context);
+
+  /**
+   * Attempt to merge the given [other] operation into this one, return `true`
+   * in case of success, so that [other] should not be added as a separate
+   * operation.
+   */
+  bool merge(ServerOperation other);
+}
+
+/**
  * The class [ServerOperation] defines the behavior of objects used to perform
  * operations on a [AnalysisServer].
  */
diff --git a/pkg/analysis_server/lib/src/operation/operation_analysis.dart b/pkg/analysis_server/lib/src/operation/operation_analysis.dart
index 70b1e9b..aeb8d03 100644
--- a/pkg/analysis_server/lib/src/operation/operation_analysis.dart
+++ b/pkg/analysis_server/lib/src/operation/operation_analysis.dart
@@ -7,15 +7,18 @@
 import 'package:analysis_server/src/analysis_server.dart';
 import 'package:analysis_server/src/computer/computer_highlights.dart';
 import 'package:analysis_server/src/computer/computer_highlights2.dart';
-import 'package:analysis_server/src/computer/computer_navigation.dart';
-import 'package:analysis_server/src/computer/computer_occurrences.dart';
 import 'package:analysis_server/src/computer/computer_outline.dart';
 import 'package:analysis_server/src/computer/computer_overrides.dart';
+import 'package:analysis_server/src/domains/analysis/implemented_dart.dart';
+import 'package:analysis_server/src/domains/analysis/navigation.dart';
+import 'package:analysis_server/src/domains/analysis/occurrences.dart';
 import 'package:analysis_server/src/operation/operation.dart';
 import 'package:analysis_server/src/protocol_server.dart' as protocol;
 import 'package:analysis_server/src/services/dependencies/library_dependencies.dart';
 import 'package:analysis_server/src/services/index/index.dart';
+import 'package:analysis_server/src/services/search/search_engine.dart';
 import 'package:analyzer/src/generated/ast.dart';
+import 'package:analyzer/src/generated/element.dart';
 import 'package:analyzer/src/generated/engine.dart';
 import 'package:analyzer/src/generated/error.dart';
 import 'package:analyzer/src/generated/html.dart';
@@ -39,12 +42,32 @@
   }
 }
 
+scheduleImplementedNotification(
+    AnalysisServer server, Iterable<String> files) async {
+  SearchEngine searchEngine = server.searchEngine;
+  if (searchEngine == null) {
+    return;
+  }
+  for (String file in files) {
+    CompilationUnitElement unitElement = server.getCompilationUnitElement(file);
+    if (unitElement != null) {
+      ImplementedComputer computer =
+          new ImplementedComputer(searchEngine, unitElement);
+      await computer.compute();
+      var params = new protocol.AnalysisImplementedParams(
+          file, computer.classes, computer.members);
+      server.sendNotification(params.toNotification());
+    }
+  }
+}
+
 /**
  * Schedules indexing of the given [file] using the resolved [dartUnit].
  */
-void scheduleIndexOperation(AnalysisServer server, String file,
-    AnalysisContext context, CompilationUnit dartUnit) {
+void scheduleIndexOperation(
+    AnalysisServer server, String file, CompilationUnit dartUnit) {
   if (server.index != null) {
+    AnalysisContext context = dartUnit.element.context;
     server.addOperation(new _DartIndexOperation(context, file, dartUnit));
   }
 }
@@ -53,9 +76,15 @@
  * Schedules sending notifications for the given [file] using the resolved
  * [resolvedDartUnit].
  */
-void scheduleNotificationOperations(AnalysisServer server, String file,
-    LineInfo lineInfo, AnalysisContext context, CompilationUnit parsedDartUnit,
-    CompilationUnit resolvedDartUnit, List<AnalysisError> errors) {
+void scheduleNotificationOperations(
+    AnalysisServer server,
+    Source source,
+    String file,
+    LineInfo lineInfo,
+    AnalysisContext context,
+    CompilationUnit parsedDartUnit,
+    CompilationUnit resolvedDartUnit,
+    List<AnalysisError> errors) {
   // If the file belongs to any analysis root, check whether we're in it now.
   AnalysisContext containingContext = server.getContainingContext(file);
   if (containingContext != null && context != containingContext) {
@@ -72,13 +101,11 @@
     }
     if (server.hasAnalysisSubscription(
         protocol.AnalysisService.NAVIGATION, file)) {
-      server.scheduleOperation(
-          new _DartNavigationOperation(context, file, resolvedDartUnit));
+      server.scheduleOperation(new NavigationOperation(context, source));
     }
     if (server.hasAnalysisSubscription(
         protocol.AnalysisService.OCCURRENCES, file)) {
-      server.scheduleOperation(
-          new _DartOccurrencesOperation(context, file, resolvedDartUnit));
+      server.scheduleOperation(new OccurrencesOperation(context, source));
     }
     if (server.hasAnalysisSubscription(
         protocol.AnalysisService.OVERRIDES, file)) {
@@ -89,8 +116,9 @@
   if (dartUnit != null) {
     if (server.hasAnalysisSubscription(
         protocol.AnalysisService.OUTLINE, file)) {
-      server.scheduleOperation(
-          new _DartOutlineOperation(context, file, lineInfo, dartUnit));
+      SourceKind sourceKind = context.getKindOf(source);
+      server.scheduleOperation(new _DartOutlineOperation(
+          context, file, lineInfo, sourceKind, dartUnit));
     }
   }
   // errors
@@ -162,31 +190,47 @@
 }
 
 void sendAnalysisNotificationNavigation(
-    AnalysisServer server, String file, CompilationUnit dartUnit) {
+    AnalysisServer server, AnalysisContext context, Source source) {
   _sendNotification(server, () {
-    var computer = new DartUnitNavigationComputer();
-    computer.compute(dartUnit);
+    NavigationCollectorImpl collector =
+        computeNavigation(server, context, source, null, null);
+    String file = source.fullName;
     var params = new protocol.AnalysisNavigationParams(
-        file, computer.regions, computer.targets, computer.files);
+        file, collector.regions, collector.targets, collector.files);
     server.sendNotification(params.toNotification());
   });
 }
 
 void sendAnalysisNotificationOccurrences(
-    AnalysisServer server, String file, CompilationUnit dartUnit) {
+    AnalysisServer server, AnalysisContext context, Source source) {
   _sendNotification(server, () {
-    var occurrences = new DartUnitOccurrencesComputer(dartUnit).compute();
-    var params = new protocol.AnalysisOccurrencesParams(file, occurrences);
+    OccurrencesCollectorImpl collector =
+        computeOccurrences(server, context, source);
+    String file = source.fullName;
+    var params =
+        new protocol.AnalysisOccurrencesParams(file, collector.allOccurrences);
     server.sendNotification(params.toNotification());
   });
 }
 
 void sendAnalysisNotificationOutline(AnalysisServer server, String file,
-    LineInfo lineInfo, CompilationUnit dartUnit) {
+    LineInfo lineInfo, SourceKind sourceKind, CompilationUnit dartUnit) {
   _sendNotification(server, () {
+    // compute FileKind
+    protocol.FileKind fileKind = protocol.FileKind.LIBRARY;
+    if (sourceKind == SourceKind.LIBRARY) {
+      fileKind = protocol.FileKind.LIBRARY;
+    } else if (sourceKind == SourceKind.PART) {
+      fileKind = protocol.FileKind.PART;
+    }
+    // compute library name
+    String libraryName = _computeLibraryName(dartUnit);
+    // compute Outline
     var computer = new DartUnitOutlineComputer(file, lineInfo, dartUnit);
-    var outline = computer.compute();
-    var params = new protocol.AnalysisOutlineParams(file, outline);
+    protocol.Outline outline = computer.compute();
+    // send notification
+    var params = new protocol.AnalysisOutlineParams(file, fileKind, outline,
+        libraryName: libraryName);
     server.sendNotification(params.toNotification());
   });
 }
@@ -210,6 +254,20 @@
   context.analysisOptions = options;
 }
 
+String _computeLibraryName(CompilationUnit unit) {
+  for (Directive directive in unit.directives) {
+    if (directive is LibraryDirective && directive.name != null) {
+      return directive.name.name;
+    }
+  }
+  for (Directive directive in unit.directives) {
+    if (directive is PartOfDirective && directive.libraryName != null) {
+      return directive.libraryName.name;
+    }
+  }
+  return null;
+}
+
 /**
  * Runs the given notification producing function [f], catching exceptions.
  */
@@ -218,11 +276,48 @@
     try {
       f();
     } catch (exception, stackTrace) {
-      server.sendServerErrorNotification(exception, stackTrace);
+      server.sendServerErrorNotification(
+          'Failed to send notification', exception, stackTrace);
     }
   });
 }
 
+class NavigationOperation extends _NotificationOperation
+    implements MergeableOperation {
+  NavigationOperation(AnalysisContext context, Source source)
+      : super(context, source);
+
+  @override
+  bool merge(ServerOperation other) {
+    return other is NavigationOperation &&
+        other.context == context &&
+        other.source == source;
+  }
+
+  @override
+  void perform(AnalysisServer server) {
+    sendAnalysisNotificationNavigation(server, context, source);
+  }
+}
+
+class OccurrencesOperation extends _NotificationOperation
+    implements MergeableOperation {
+  OccurrencesOperation(AnalysisContext context, Source source)
+      : super(context, source);
+
+  @override
+  bool merge(ServerOperation other) {
+    return other is OccurrencesOperation &&
+        other.context == context &&
+        other.source == source;
+  }
+
+  @override
+  void perform(AnalysisServer server) {
+    sendAnalysisNotificationOccurrences(server, context, source);
+  }
+}
+
 /**
  * Instances of [PerformAnalysisOperation] perform a single analysis task.
  */
@@ -304,8 +399,8 @@
       // Dart
       CompilationUnit parsedDartUnit = notice.parsedDartUnit;
       CompilationUnit resolvedDartUnit = notice.resolvedDartUnit;
-      scheduleNotificationOperations(server, file, notice.lineInfo, context,
-          parsedDartUnit, resolvedDartUnit, notice.errors);
+      scheduleNotificationOperations(server, source, file, notice.lineInfo,
+          context, parsedDartUnit, resolvedDartUnit, notice.errors);
       // done
       server.fileAnalyzed(notice);
     }
@@ -321,10 +416,11 @@
       try {
         CompilationUnit dartUnit = notice.resolvedDartUnit;
         if (dartUnit != null) {
-          server.addOperation(new _DartIndexOperation(context, file, dartUnit));
+          scheduleIndexOperation(server, file, dartUnit);
         }
       } catch (exception, stackTrace) {
-        server.sendServerErrorNotification(exception, stackTrace);
+        server.sendServerErrorNotification(
+            'Failed to index Dart file: $file', exception, stackTrace);
       }
       // HTML
       try {
@@ -333,7 +429,8 @@
           server.addOperation(new _HtmlIndexOperation(context, file, htmlUnit));
         }
       } catch (exception, stackTrace) {
-        server.sendServerErrorNotification(exception, stackTrace);
+        server.sendServerErrorNotification(
+            'Failed to index HTML file: $file', exception, stackTrace);
       }
     }
   }
@@ -366,25 +463,16 @@
     ServerPerformanceStatistics.indexOperation.makeCurrentWhile(() {
       try {
         Index index = server.index;
-        index.indexUnit(context, unit);
+        AnalysisContext context = unit.element.context;
+        index.index(context, unit);
       } catch (exception, stackTrace) {
-        server.sendServerErrorNotification(exception, stackTrace);
+        server.sendServerErrorNotification(
+            'Failed to index: $file', exception, stackTrace);
       }
     });
   }
 }
 
-class _DartNavigationOperation extends _DartNotificationOperation {
-  _DartNavigationOperation(
-      AnalysisContext context, String file, CompilationUnit unit)
-      : super(context, file, unit);
-
-  @override
-  void perform(AnalysisServer server) {
-    sendAnalysisNotificationNavigation(server, file, unit);
-  }
-}
-
 abstract class _DartNotificationOperation extends _SingleFileOperation {
   final CompilationUnit unit;
 
@@ -397,27 +485,17 @@
   }
 }
 
-class _DartOccurrencesOperation extends _DartNotificationOperation {
-  _DartOccurrencesOperation(
-      AnalysisContext context, String file, CompilationUnit unit)
-      : super(context, file, unit);
-
-  @override
-  void perform(AnalysisServer server) {
-    sendAnalysisNotificationOccurrences(server, file, unit);
-  }
-}
-
 class _DartOutlineOperation extends _DartNotificationOperation {
   final LineInfo lineInfo;
+  final SourceKind sourceKind;
 
-  _DartOutlineOperation(
-      AnalysisContext context, String file, this.lineInfo, CompilationUnit unit)
+  _DartOutlineOperation(AnalysisContext context, String file, this.lineInfo,
+      this.sourceKind, CompilationUnit unit)
       : super(context, file, unit);
 
   @override
   void perform(AnalysisServer server) {
-    sendAnalysisNotificationOutline(server, file, lineInfo, unit);
+    sendAnalysisNotificationOutline(server, file, lineInfo, sourceKind, unit);
   }
 }
 
@@ -446,7 +524,7 @@
   @override
   void perform(AnalysisServer server) {
     Index index = server.index;
-    index.indexHtmlUnit(context, unit);
+    index.index(context, unit);
   }
 }
 
@@ -469,6 +547,22 @@
   }
 }
 
+abstract class _NotificationOperation extends SourceSensitiveOperation {
+  final Source source;
+
+  _NotificationOperation(AnalysisContext context, this.source) : super(context);
+
+  @override
+  ServerOperationPriority get priority {
+    return ServerOperationPriority.ANALYSIS_NOTIFICATION;
+  }
+
+  @override
+  bool shouldBeDiscardedOnSourceChange(Source source) {
+    return source == this.source;
+  }
+}
+
 abstract class _SingleFileOperation extends SourceSensitiveOperation {
   final String file;
 
diff --git a/pkg/analysis_server/lib/src/operation/operation_queue.dart b/pkg/analysis_server/lib/src/operation/operation_queue.dart
index ced4a8c..1687a4b 100644
--- a/pkg/analysis_server/lib/src/operation/operation_queue.dart
+++ b/pkg/analysis_server/lib/src/operation/operation_queue.dart
@@ -39,6 +39,14 @@
   void add(ServerOperation operation) {
     int queueIndex = operation.priority.ordinal;
     Queue<ServerOperation> queue = _queues[queueIndex];
+    // try to merge into an existing operation
+    for (ServerOperation existingOperation in queue) {
+      if (existingOperation is MergeableOperation &&
+          existingOperation.merge(operation)) {
+        return;
+      }
+    }
+    // add it
     queue.addLast(operation);
   }
 
@@ -119,7 +127,7 @@
    */
   ServerOperation takeIf(bool test(ServerOperation operation)) {
     for (Queue<ServerOperation> queue in _queues) {
-      for (var operation in queue) {
+      for (ServerOperation operation in queue) {
         if (test(operation)) {
           queue.remove(operation);
           return operation;
diff --git a/pkg/analysis_server/lib/src/plugin/linter_plugin.dart b/pkg/analysis_server/lib/src/plugin/linter_plugin.dart
new file mode 100644
index 0000000..07fb54e
--- /dev/null
+++ b/pkg/analysis_server/lib/src/plugin/linter_plugin.dart
@@ -0,0 +1,36 @@
+// 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 analysis_server.src.plugin.linter_plugin;
+
+import 'package:analysis_server/src/services/linter/linter.dart';
+import 'package:analyzer/plugin/options.dart';
+import 'package:plugin/plugin.dart';
+
+/// The shared linter server plugin instance.
+final LinterServerPlugin linterServerPlugin = new LinterServerPlugin();
+
+/// A plugin that defines the extension points and extensions that enhance
+/// linting in the server.
+class LinterServerPlugin implements Plugin {
+  /// The unique identifier of this plugin.
+  static const String UNIQUE_IDENTIFIER = 'linter.server';
+
+  @override
+  String get uniqueIdentifier => UNIQUE_IDENTIFIER;
+
+  @override
+  void registerExtensionPoints(RegisterExtensionPoint registerExtensionPoint) {
+    // None.
+  }
+
+  @override
+  void registerExtensions(RegisterExtension registerExtension) {
+    //
+    // Register options validators.
+    //
+    registerExtension(
+        OPTIONS_VALIDATOR_EXTENSION_POINT_ID, new LinterRuleOptionsValidator());
+  }
+}
diff --git a/pkg/analysis_server/lib/src/plugin/server_plugin.dart b/pkg/analysis_server/lib/src/plugin/server_plugin.dart
index be413c6..b4de83f 100644
--- a/pkg/analysis_server/lib/src/plugin/server_plugin.dart
+++ b/pkg/analysis_server/lib/src/plugin/server_plugin.dart
@@ -4,24 +4,33 @@
 
 library analysis_server.src.plugin.server_plugin;
 
-import 'package:analysis_server/analysis/index/index_core.dart';
-import 'package:analysis_server/completion/completion_core.dart';
-import 'package:analysis_server/edit/assist/assist_core.dart';
-import 'package:analysis_server/edit/fix/fix_core.dart';
-import 'package:analysis_server/plugin/analyzed_files.dart';
-import 'package:analysis_server/plugin/assist.dart';
-import 'package:analysis_server/plugin/fix.dart';
+import 'package:analysis_server/plugin/analysis/analysis_domain.dart';
+import 'package:analysis_server/plugin/analysis/analyzed_files.dart';
+import 'package:analysis_server/plugin/analysis/navigation/navigation.dart';
+import 'package:analysis_server/plugin/analysis/navigation/navigation_core.dart';
+import 'package:analysis_server/plugin/analysis/occurrences/occurrences.dart';
+import 'package:analysis_server/plugin/analysis/occurrences/occurrences_core.dart';
+import 'package:analysis_server/plugin/edit/assist/assist.dart';
+import 'package:analysis_server/plugin/edit/assist/assist_core.dart';
+import 'package:analysis_server/plugin/edit/fix/fix.dart';
+import 'package:analysis_server/plugin/edit/fix/fix_core.dart';
+import 'package:analysis_server/plugin/index/index.dart';
+import 'package:analysis_server/plugin/index/index_core.dart';
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/analysis_server.dart';
 import 'package:analysis_server/src/domain_analysis.dart';
 import 'package:analysis_server/src/domain_completion.dart';
 import 'package:analysis_server/src/domain_execution.dart';
+import 'package:analysis_server/src/domain_experimental.dart';
 import 'package:analysis_server/src/domain_server.dart';
+import 'package:analysis_server/src/domains/analysis/navigation_dart.dart';
+import 'package:analysis_server/src/domains/analysis/occurrences_dart.dart';
 import 'package:analysis_server/src/edit/edit_domain.dart';
-import 'package:analysis_server/src/protocol.dart';
+import 'package:analysis_server/src/provisional/completion/completion_core.dart';
 import 'package:analysis_server/src/search/search_domain.dart';
 import 'package:analysis_server/src/services/correction/assist_internal.dart';
 import 'package:analysis_server/src/services/correction/fix_internal.dart';
-import 'package:analyzer/file_system/file_system.dart';
+import 'package:analysis_server/src/services/index/index_contributor.dart';
 import 'package:analyzer/src/generated/engine.dart';
 import 'package:plugin/plugin.dart';
 
@@ -38,9 +47,10 @@
 class ServerPlugin implements Plugin {
   /**
    * The simple identifier of the extension point that allows plugins to
-   * register functions that can cause files to be analyzed.
+   * register file patterns that will cause files to be analyzed.
    */
-  static const String ANALYZE_FILE_EXTENSION_POINT = 'analyzeFile';
+  static const String ANALYZED_FILE_PATTERNS_EXTENSION_POINT =
+      'analyzedFilePatterns';
 
   /**
    * The simple identifier of the extension point that allows plugins to
@@ -74,15 +84,35 @@
   static const String INDEX_CONTRIBUTOR_EXTENSION_POINT = 'indexContributor';
 
   /**
+   * The simple identifier of the extension point that allows plugins to
+   * register navigation contributors.
+   */
+  static const String NAVIGATION_CONTRIBUTOR_EXTENSION_POINT =
+      'navigationContributor';
+
+  /**
+   * The simple identifier of the extension point that allows plugins to
+   * register element occurrences.
+   */
+  static const String OCCURRENCES_CONTRIBUTOR_EXTENSION_POINT =
+      'occurrencesContributor';
+
+  /**
+   * The simple identifier of the extension point that allows plugins to
+   * register analysis result listeners.
+   */
+  static const String SET_ANALISYS_DOMAIN_EXTENSION_POINT = 'setAnalysisDomain';
+
+  /**
    * The unique identifier of this plugin.
    */
   static const String UNIQUE_IDENTIFIER = 'analysis_server.core';
 
   /**
-   * The extension point that allows plugins to register functions that can
+   * The extension point that allows plugins to register file patterns that will
    * cause files to be analyzed.
    */
-  ExtensionPoint analyzeFileExtensionPoint;
+  ExtensionPoint analyzedFilePatternsExtensionPoint;
 
   /**
    * The extension point that allows plugins to register assist contributors.
@@ -113,16 +143,40 @@
   ExtensionPoint indexContributorExtensionPoint;
 
   /**
+   * The extension point that allows plugins to register navigation
+   * contributors.
+   */
+  ExtensionPoint navigationContributorExtensionPoint;
+
+  /**
+   * The extension point that allows plugins to register occurrences
+   * contributors.
+   */
+  ExtensionPoint occurrencesContributorExtensionPoint;
+
+  /**
+   * The extension point that allows plugins to get access to the `analysis`
+   * domain.
+   */
+  ExtensionPoint setAnalysisDomainExtensionPoint;
+
+  /**
    * Initialize a newly created plugin.
    */
   ServerPlugin();
 
   /**
-   * Return a list containing all of the functions that can cause files to be
-   * analyzed.
+   * Return a list containing all of the file patterns that can cause files to
+   * be analyzed.
    */
-  List<ShouldAnalyzeFile> get analyzeFileFunctions =>
-      analyzeFileExtensionPoint.extensions;
+  List<String> get analyzedFilePatterns {
+    List<String> patterns = <String>[];
+    for (List<String> extension
+        in analyzedFilePatternsExtensionPoint.extensions) {
+      patterns.addAll(extension);
+    }
+    return patterns;
+  }
 
   /**
    * Return a list containing all of the assist contributors that were
@@ -151,6 +205,27 @@
   List<IndexContributor> get indexContributors =>
       indexContributorExtensionPoint.extensions;
 
+  /**
+   * Return a list containing all of the navigation contributors that were
+   * contributed.
+   */
+  List<NavigationContributor> get navigationContributors =>
+      navigationContributorExtensionPoint.extensions;
+
+  /**
+   * Return a list containing all of the occurrences contributors that were
+   * contributed.
+   */
+  List<OccurrencesContributor> get occurrencesContributors =>
+      occurrencesContributorExtensionPoint.extensions;
+
+  /**
+   * Return a list containing all of the receivers of the `analysis` domain
+   * instance.
+   */
+  List<SetAnalysisDomain> get setAnalysisDomainFunctions =>
+      setAnalysisDomainExtensionPoint.extensions;
+
   @override
   String get uniqueIdentifier => UNIQUE_IDENTIFIER;
 
@@ -169,8 +244,12 @@
 
   @override
   void registerExtensionPoints(RegisterExtensionPoint registerExtensionPoint) {
-    analyzeFileExtensionPoint = registerExtensionPoint(
-        ANALYZE_FILE_EXTENSION_POINT, _validateAnalyzeFileExtension);
+    setAnalysisDomainExtensionPoint = registerExtensionPoint(
+        SET_ANALISYS_DOMAIN_EXTENSION_POINT,
+        _validateSetAnalysisDomainFunction);
+    analyzedFilePatternsExtensionPoint = registerExtensionPoint(
+        ANALYZED_FILE_PATTERNS_EXTENSION_POINT,
+        _validateAnalyzedFilePatternsExtension);
     assistContributorExtensionPoint = registerExtensionPoint(
         ASSIST_CONTRIBUTOR_EXTENSION_POINT,
         _validateAssistContributorExtension);
@@ -183,16 +262,26 @@
         FIX_CONTRIBUTOR_EXTENSION_POINT, _validateFixContributorExtension);
     indexContributorExtensionPoint = registerExtensionPoint(
         INDEX_CONTRIBUTOR_EXTENSION_POINT, _validateIndexContributorExtension);
+    navigationContributorExtensionPoint = registerExtensionPoint(
+        NAVIGATION_CONTRIBUTOR_EXTENSION_POINT,
+        _validateNavigationContributorExtension);
+    occurrencesContributorExtensionPoint = registerExtensionPoint(
+        OCCURRENCES_CONTRIBUTOR_EXTENSION_POINT,
+        _validateOccurrencesContributorExtension);
   }
 
   @override
   void registerExtensions(RegisterExtension registerExtension) {
     //
-    // Register analyze file functions.
+    // Register analyzed file patterns.
     //
-    registerExtension(ANALYZE_FILE_EXTENSION_POINT_ID,
-        (File file) => AnalysisEngine.isDartFileName(file.path) ||
-            AnalysisEngine.isHtmlFileName(file.path));
+    List<String> patterns = <String>[
+      '{*:/,/}**/*.${AnalysisEngine.SUFFIX_DART}',
+      '{*:/,/}**/*.${AnalysisEngine.SUFFIX_HTML}',
+      '{*:/,/}**/*.${AnalysisEngine.SUFFIX_HTM}',
+      '{*:/,/}**/${AnalysisEngine.ANALYSIS_OPTIONS_FILE}'
+    ];
+    registerExtension(ANALYZED_FILE_PATTERNS_EXTENSION_POINT_ID, patterns);
     //
     // Register assist contributors.
     //
@@ -204,6 +293,13 @@
     // TODO(brianwilkerson) Register the completion contributors.
 //    registerExtension(COMPLETION_CONTRIBUTOR_EXTENSION_POINT_ID, ???);
     //
+    // Register analysis contributors.
+    //
+    registerExtension(NAVIGATION_CONTRIBUTOR_EXTENSION_POINT_ID,
+        new DartNavigationComputer());
+    registerExtension(OCCURRENCES_CONTRIBUTOR_EXTENSION_POINT_ID,
+        new DartOccurrencesComputer());
+    //
     // Register domains.
     //
     String domainId = Plugin.join(UNIQUE_IDENTIFIER, DOMAIN_EXTENSION_POINT);
@@ -219,6 +315,8 @@
         (AnalysisServer server) => new CompletionDomainHandler(server));
     registerExtension(domainId,
         (AnalysisServer server) => new ExecutionDomainHandler(server));
+    registerExtension(domainId,
+        (AnalysisServer server) => new ExperimentalDomainHandler(server));
     //
     // Register fix contributors.
     //
@@ -227,19 +325,31 @@
     //
     // Register index contributors.
     //
-    // TODO(brianwilkerson) Register the index contributors.
-//    registerExtension(INDEX_CONTRIBUTOR_EXTENSION_POINT, ???);
+    registerExtension(
+        INDEX_CONTRIBUTOR_EXTENSION_POINT_ID, new DartIndexContributor());
+  }
+
+  /**
+   * Return `true` if the list being used as an [extension] contains any
+   * elements that are not strings.
+   */
+  bool _containsNonString(List extension) {
+    for (Object element in extension) {
+      if (element is! String) {
+        return true;
+      }
+    }
+    return false;
   }
 
   /**
    * Validate the given extension by throwing an [ExtensionError] if it is not a
-   * valid assist contributor.
+   * valid list of analyzed file patterns.
    */
-  void _validateAnalyzeFileExtension(Object extension) {
-    if (extension is! ShouldAnalyzeFile) {
-      String id = analyzeFileExtensionPoint.uniqueIdentifier;
-      throw new ExtensionError(
-          'Extensions to $id must be an ShouldAnalyzeFile function');
+  void _validateAnalyzedFilePatternsExtension(Object extension) {
+    if (extension is! List || _containsNonString(extension)) {
+      String id = analyzedFilePatternsExtensionPoint.uniqueIdentifier;
+      throw new ExtensionError('Extensions to $id must be a List of Strings');
     }
   }
 
@@ -300,4 +410,40 @@
       throw new ExtensionError('Extensions to $id must be an IndexContributor');
     }
   }
+
+  /**
+   * Validate the given extension by throwing an [ExtensionError] if it is not a
+   * valid navigation contributor.
+   */
+  void _validateNavigationContributorExtension(Object extension) {
+    if (extension is! NavigationContributor) {
+      String id = navigationContributorExtensionPoint.uniqueIdentifier;
+      throw new ExtensionError(
+          'Extensions to $id must be an NavigationContributor');
+    }
+  }
+
+  /**
+   * Validate the given extension by throwing an [ExtensionError] if it is not a
+   * valid occurrences contributor.
+   */
+  void _validateOccurrencesContributorExtension(Object extension) {
+    if (extension is! OccurrencesContributor) {
+      String id = occurrencesContributorExtensionPoint.uniqueIdentifier;
+      throw new ExtensionError(
+          'Extensions to $id must be an OccurrencesContributor');
+    }
+  }
+
+  /**
+   * Validate the given extension by throwing an [ExtensionError] if it is not a
+   * valid analysis domain receiver.
+   */
+  void _validateSetAnalysisDomainFunction(Object extension) {
+    if (extension is! SetAnalysisDomain) {
+      String id = setAnalysisDomainExtensionPoint.uniqueIdentifier;
+      throw new ExtensionError(
+          'Extensions to $id must be a SetAnalysisDomain function');
+    }
+  }
 }
diff --git a/pkg/analysis_server/lib/src/protocol.dart b/pkg/analysis_server/lib/src/protocol.dart
deleted file mode 100644
index ef960f0..0000000
--- a/pkg/analysis_server/lib/src/protocol.dart
+++ /dev/null
@@ -1,999 +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 protocol;
-
-import 'dart:collection';
-import 'dart:convert';
-
-part 'generated_protocol.dart';
-
-final Map<String, RefactoringKind> REQUEST_ID_REFACTORING_KINDS =
-    new HashMap<String, RefactoringKind>();
-
-/**
- * Translate the input [map], applying [keyCallback] to all its keys, and
- * [valueCallback] to all its values.
- */
-mapMap(Map map, {dynamic keyCallback(key), dynamic valueCallback(value)}) {
-  Map result = {};
-  map.forEach((key, value) {
-    if (keyCallback != null) {
-      key = keyCallback(key);
-    }
-    if (valueCallback != null) {
-      value = valueCallback(value);
-    }
-    result[key] = value;
-  });
-  return result;
-}
-
-/**
- * Adds the given [sourceEdits] to the list in [sourceFileEdit].
- */
-void _addAllEditsForSource(
-    SourceFileEdit sourceFileEdit, Iterable<SourceEdit> edits) {
-  edits.forEach(sourceFileEdit.add);
-}
-
-/**
- * Adds the given [sourceEdit] to the list in [sourceFileEdit].
- */
-void _addEditForSource(SourceFileEdit sourceFileEdit, SourceEdit sourceEdit) {
-  List<SourceEdit> edits = sourceFileEdit.edits;
-  int index = 0;
-  while (index < edits.length && edits[index].offset > sourceEdit.offset) {
-    index++;
-  }
-  edits.insert(index, sourceEdit);
-}
-
-/**
- * Adds [edit] to the [FileEdit] for the given [file].
- */
-void _addEditToSourceChange(
-    SourceChange change, String file, int fileStamp, SourceEdit edit) {
-  SourceFileEdit fileEdit = change.getFileEdit(file);
-  if (fileEdit == null) {
-    fileEdit = new SourceFileEdit(file, fileStamp);
-    change.addFileEdit(fileEdit);
-  }
-  fileEdit.add(edit);
-}
-
-/**
- * Get the result of applying the edit to the given [code].  Access via
- * SourceEdit.apply().
- */
-String _applyEdit(String code, SourceEdit edit) {
-  if (edit.length < 0) {
-    throw new RangeError('length is negative');
-  }
-  return code.replaceRange(edit.offset, edit.end, edit.replacement);
-}
-
-/**
- * Get the result of applying a set of [edits] to the given [code].  Edits
- * are applied in the order they appear in [edits].  Access via
- * SourceEdit.applySequence().
- */
-String _applySequence(String code, Iterable<SourceEdit> edits) {
-  edits.forEach((SourceEdit edit) {
-    code = edit.apply(code);
-  });
-  return code;
-}
-
-/**
- * Returns the [FileEdit] for the given [file], maybe `null`.
- */
-SourceFileEdit _getChangeFileEdit(SourceChange change, String file) {
-  for (SourceFileEdit fileEdit in change.edits) {
-    if (fileEdit.file == file) {
-      return fileEdit;
-    }
-  }
-  return null;
-}
-
-/**
- * Compare the lists [listA] and [listB], using [itemEqual] to compare
- * list elements.
- */
-bool _listEqual(List listA, List listB, bool itemEqual(a, b)) {
-  if (listA == null) {
-    return listB == null;
-  }
-  if (listB == null) {
-    return false;
-  }
-  if (listA.length != listB.length) {
-    return false;
-  }
-  for (int i = 0; i < listA.length; i++) {
-    if (!itemEqual(listA[i], listB[i])) {
-      return false;
-    }
-  }
-  return true;
-}
-
-/**
- * Compare the maps [mapA] and [mapB], using [valueEqual] to compare map
- * values.
- */
-bool _mapEqual(Map mapA, Map mapB, bool valueEqual(a, b)) {
-  if (mapA == null) {
-    return mapB == null;
-  }
-  if (mapB == null) {
-    return false;
-  }
-  if (mapA.length != mapB.length) {
-    return false;
-  }
-  for (var key in mapA.keys) {
-    if (!mapB.containsKey(key)) {
-      return false;
-    }
-    if (!valueEqual(mapA[key], mapB[key])) {
-      return false;
-    }
-  }
-  return true;
-}
-
-RefactoringProblemSeverity _maxRefactoringProblemSeverity(
-    RefactoringProblemSeverity a, RefactoringProblemSeverity b) {
-  if (b == null) {
-    return a;
-  }
-  if (a == null) {
-    return b;
-  } else if (a == RefactoringProblemSeverity.INFO) {
-    return b;
-  } else if (a == RefactoringProblemSeverity.WARNING) {
-    if (b == RefactoringProblemSeverity.ERROR ||
-        b == RefactoringProblemSeverity.FATAL) {
-      return b;
-    }
-  } else if (a == RefactoringProblemSeverity.ERROR) {
-    if (b == RefactoringProblemSeverity.FATAL) {
-      return b;
-    }
-  }
-  return a;
-}
-
-/**
- * Create a [RefactoringFeedback] corresponding the given [kind].
- */
-RefactoringFeedback _refactoringFeedbackFromJson(
-    JsonDecoder jsonDecoder, String jsonPath, Object json, Map feedbackJson) {
-  RefactoringKind kind = jsonDecoder.refactoringKind;
-  if (kind == RefactoringKind.EXTRACT_LOCAL_VARIABLE) {
-    return new ExtractLocalVariableFeedback.fromJson(
-        jsonDecoder, jsonPath, json);
-  }
-  if (kind == RefactoringKind.EXTRACT_METHOD) {
-    return new ExtractMethodFeedback.fromJson(jsonDecoder, jsonPath, json);
-  }
-  if (kind == RefactoringKind.INLINE_LOCAL_VARIABLE) {
-    return new InlineLocalVariableFeedback.fromJson(
-        jsonDecoder, jsonPath, json);
-  }
-  if (kind == RefactoringKind.INLINE_METHOD) {
-    return new InlineMethodFeedback.fromJson(jsonDecoder, jsonPath, json);
-  }
-  if (kind == RefactoringKind.RENAME) {
-    return new RenameFeedback.fromJson(jsonDecoder, jsonPath, json);
-  }
-  return null;
-}
-
-/**
- * Create a [RefactoringOptions] corresponding the given [kind].
- */
-RefactoringOptions _refactoringOptionsFromJson(JsonDecoder jsonDecoder,
-    String jsonPath, Object json, RefactoringKind kind) {
-  if (kind == RefactoringKind.EXTRACT_LOCAL_VARIABLE) {
-    return new ExtractLocalVariableOptions.fromJson(
-        jsonDecoder, jsonPath, json);
-  }
-  if (kind == RefactoringKind.EXTRACT_METHOD) {
-    return new ExtractMethodOptions.fromJson(jsonDecoder, jsonPath, json);
-  }
-  if (kind == RefactoringKind.INLINE_METHOD) {
-    return new InlineMethodOptions.fromJson(jsonDecoder, jsonPath, json);
-  }
-  if (kind == RefactoringKind.MOVE_FILE) {
-    return new MoveFileOptions.fromJson(jsonDecoder, jsonPath, json);
-  }
-  if (kind == RefactoringKind.RENAME) {
-    return new RenameOptions.fromJson(jsonDecoder, jsonPath, json);
-  }
-  return null;
-}
-
-/**
- * Type of callbacks used to decode parts of JSON objects.  [jsonPath] is a
- * string describing the part of the JSON object being decoded, and [value] is
- * the part to decode.
- */
-typedef Object JsonDecoderCallback(String jsonPath, Object value);
-
-/**
- * Instances of the class [DomainHandler] implement a [RequestHandler] and
- * also startup and shutdown methods.
- */
-abstract class DomainHandler extends RequestHandler {
-  /**
-   * Perform any operations associated with the shutdown of the domain. It is
-   * not guaranteed that this method will be called. If it is, it will be
-   * called after the last [Request] has been made.
-   */
-  void shutdown() {}
-
-  /**
-   * Perform any operations associated with the startup of the domain. This
-   * will be called before the first [Request].
-   */
-  void startup() {}
-}
-
-/**
- * Classes implementing [Enum] represent enumerated types in the protocol.
- */
-abstract class Enum {
-  /**
-   * The name of the enumerated value.  This should match the name of the
-   * static getter which provides access to this enumerated value.
-   */
-  String get name;
-}
-
-/**
- * Instances of the class [HasToJson] implement [toJson] method that returns
- * a JSON presentation.
- */
-abstract class HasToJson {
-  /**
-   * Returns a JSON presentation of the object.
-   */
-  Map<String, Object> toJson();
-}
-
-/**
- * Base class for decoding JSON objects.  The derived class must implement
- * error reporting logic.
- */
-abstract class JsonDecoder {
-  /**
-   * Retrieve the RefactoringKind that should be assumed when decoding
-   * refactoring feedback objects, or null if no refactoring feedback object is
-   * expected to be encountered.
-   */
-  RefactoringKind get refactoringKind;
-
-  /**
-   * Create an exception to throw if the JSON object at [jsonPath] fails to
-   * match the API definition of [expected].
-   */
-  dynamic mismatch(String jsonPath, String expected, [Object actual]);
-
-  /**
-   * Create an exception to throw if the JSON object at [jsonPath] is missing
-   * the key [key].
-   */
-  dynamic missingKey(String jsonPath, String key);
-
-  /**
-   * Decode a JSON object that is expected to be a boolean.  The strings "true"
-   * and "false" are also accepted.
-   */
-  bool _decodeBool(String jsonPath, Object json) {
-    if (json is bool) {
-      return json;
-    } else if (json == 'true') {
-      return true;
-    } else if (json == 'false') {
-      return false;
-    }
-    throw mismatch(jsonPath, 'bool', json);
-  }
-
-  /**
-   * Decode a JSON object that is expected to be an integer.  A string
-   * representation of an integer is also accepted.
-   */
-  int _decodeInt(String jsonPath, Object json) {
-    if (json is int) {
-      return json;
-    } else if (json is String) {
-      return int.parse(json, onError: (String value) {
-        throw mismatch(jsonPath, 'int', json);
-      });
-    }
-    throw mismatch(jsonPath, 'int', json);
-  }
-
-  /**
-   * Decode a JSON object that is expected to be a List.  [decoder] is used to
-   * decode the items in the list.
-   */
-  List _decodeList(String jsonPath, Object json,
-      [JsonDecoderCallback decoder]) {
-    if (json == null) {
-      return [];
-    } else if (json is List) {
-      List result = [];
-      for (int i = 0; i < json.length; i++) {
-        result.add(decoder('$jsonPath[$i]', json[i]));
-      }
-      return result;
-    } else {
-      throw mismatch(jsonPath, 'List', json);
-    }
-  }
-
-  /**
-   * Decode a JSON object that is expected to be a Map.  [keyDecoder] is used
-   * to decode the keys, and [valueDecoder] is used to decode the values.
-   */
-  Map _decodeMap(String jsonPath, Object json,
-      {JsonDecoderCallback keyDecoder, JsonDecoderCallback valueDecoder}) {
-    if (json == null) {
-      return {};
-    } else if (json is Map) {
-      Map result = {};
-      json.forEach((String key, value) {
-        Object decodedKey;
-        if (keyDecoder != null) {
-          decodedKey = keyDecoder('$jsonPath.key', key);
-        } else {
-          decodedKey = key;
-        }
-        if (valueDecoder != null) {
-          value = valueDecoder('$jsonPath[${JSON.encode(key)}]', value);
-        }
-        result[decodedKey] = value;
-      });
-      return result;
-    } else {
-      throw mismatch(jsonPath, 'Map', json);
-    }
-  }
-
-  /**
-   * Decode a JSON object that is expected to be a string.
-   */
-  String _decodeString(String jsonPath, Object json) {
-    if (json is String) {
-      return json;
-    } else {
-      throw mismatch(jsonPath, 'String', json);
-    }
-  }
-
-  /**
-   * Decode a JSON object that is expected to be one of several choices,
-   * where the choices are disambiguated by the contents of the field [field].
-   * [decoders] is a map from each possible string in the field to the decoder
-   * that should be used to decode the JSON object.
-   */
-  Object _decodeUnion(String jsonPath, Map json, String field,
-      Map<String, JsonDecoderCallback> decoders) {
-    if (json is Map) {
-      if (!json.containsKey(field)) {
-        throw missingKey(jsonPath, field);
-      }
-      var disambiguatorPath = '$jsonPath[${JSON.encode(field)}]';
-      String disambiguator = _decodeString(disambiguatorPath, json[field]);
-      if (!decoders.containsKey(disambiguator)) {
-        throw mismatch(
-            disambiguatorPath, 'One of: ${decoders.keys.toList()}', json);
-      }
-      return decoders[disambiguator](jsonPath, json);
-    } else {
-      throw mismatch(jsonPath, 'Map', json);
-    }
-  }
-}
-
-/**
- * Instances of the class [Notification] represent a notification from the
- * server about an event that occurred.
- */
-class Notification {
-  /**
-   * The name of the JSON attribute containing the name of the event that
-   * triggered the notification.
-   */
-  static const String EVENT = 'event';
-
-  /**
-   * The name of the JSON attribute containing the result values.
-   */
-  static const String PARAMS = 'params';
-
-  /**
-   * The name of the event that triggered the notification.
-   */
-  final String event;
-
-  /**
-   * A table mapping the names of notification parameters to their values, or
-   * null if there are no notification parameters.
-   */
-  Map<String, Object> _params;
-
-  /**
-   * Initialize a newly created [Notification] to have the given [event] name.
-   * If [_params] is provided, it will be used as the params; otherwise no
-   * params will be used.
-   */
-  Notification(this.event, [this._params]);
-
-  /**
-   * Initialize a newly created instance based upon the given JSON data
-   */
-  factory Notification.fromJson(Map<String, Object> json) {
-    return new Notification(
-        json[Notification.EVENT], json[Notification.PARAMS]);
-  }
-
-  /**
-   * Return a table representing the structure of the Json object that will be
-   * sent to the client to represent this response.
-   */
-  Map<String, Object> toJson() {
-    Map<String, Object> jsonObject = {};
-    jsonObject[EVENT] = event;
-    if (_params != null) {
-      jsonObject[PARAMS] = _params;
-    }
-    return jsonObject;
-  }
-}
-
-/**
- * Instances of the class [Request] represent a request that was received.
- */
-class Request {
-  /**
-   * The name of the JSON attribute containing the id of the request.
-   */
-  static const String ID = 'id';
-
-  /**
-   * The name of the JSON attribute containing the name of the request.
-   */
-  static const String METHOD = 'method';
-
-  /**
-   * The name of the JSON attribute containing the request parameters.
-   */
-  static const String PARAMS = 'params';
-
-  /**
-   * The name of the optional JSON attribute indicating the time
-   * (milliseconds since epoch) at which the client made the request.
-   */
-  static const String CLIENT_REQUEST_TIME = 'clientRequestTime';
-
-  /**
-   * The unique identifier used to identify this request.
-   */
-  final String id;
-
-  /**
-   * The method being requested.
-   */
-  final String method;
-
-  /**
-   * A table mapping the names of request parameters to their values.
-   */
-  final Map<String, Object> _params;
-
-  /**
-   * The time (milliseconds since epoch) at which the client made the request
-   * or `null` if this information is not provided by the client.
-   */
-  final int clientRequestTime;
-
-  /**
-   * Initialize a newly created [Request] to have the given [id] and [method]
-   * name.  If [params] is supplied, it is used as the "params" map for the
-   * request.  Otherwise an empty "params" map is allocated.
-   */
-  Request(this.id, this.method,
-      [Map<String, Object> params, this.clientRequestTime])
-      : _params = params != null ? params : new HashMap<String, Object>();
-
-  /**
-   * Return a request parsed from the given json, or `null` if the [data] is
-   * not a valid json representation of a request. The [data] is expected to
-   * have the following format:
-   *
-   *   {
-   *     'clientRequestTime': millisecondsSinceEpoch
-   *     'id': String,
-   *     'method': methodName,
-   *     'params': {
-   *       paramter_name: value
-   *     }
-   *   }
-   *
-   * where both the parameters and clientRequestTime are optional.
-   * The parameters can contain any number of name/value pairs.
-   * The clientRequestTime must be an int representing the time at which
-   * the client issued the request (milliseconds since epoch).
-   */
-  factory Request.fromJson(Map<String, dynamic> result) {
-    var id = result[Request.ID];
-    var method = result[Request.METHOD];
-    if (id is! String || method is! String) {
-      return null;
-    }
-    var time = result[Request.CLIENT_REQUEST_TIME];
-    if (time != null && time is! int) {
-      return null;
-    }
-    var params = result[Request.PARAMS];
-    if (params is Map || params == null) {
-      return new Request(id, method, params, time);
-    } else {
-      return null;
-    }
-  }
-
-  /**
-   * Return a request parsed from the given [data], or `null` if the [data] is
-   * not a valid json representation of a request. The [data] is expected to
-   * have the following format:
-   *
-   *   {
-   *     'clientRequestTime': millisecondsSinceEpoch
-   *     'id': String,
-   *     'method': methodName,
-   *     'params': {
-   *       paramter_name: value
-   *     }
-   *   }
-   *
-   * where both the parameters and clientRequestTime are optional.
-   * The parameters can contain any number of name/value pairs.
-   * The clientRequestTime must be an int representing the time at which
-   * the client issued the request (milliseconds since epoch).
-   */
-  factory Request.fromString(String data) {
-    try {
-      var result = JSON.decode(data);
-      if (result is Map) {
-        return new Request.fromJson(result);
-      }
-      return null;
-    } catch (exception) {
-      return null;
-    }
-  }
-
-  /**
-   * Return a table representing the structure of the Json object that will be
-   * sent to the client to represent this response.
-   */
-  Map<String, Object> toJson() {
-    Map<String, Object> jsonObject = new HashMap<String, Object>();
-    jsonObject[ID] = id;
-    jsonObject[METHOD] = method;
-    if (_params.isNotEmpty) {
-      jsonObject[PARAMS] = _params;
-    }
-    if (clientRequestTime != null) {
-      jsonObject[CLIENT_REQUEST_TIME] = clientRequestTime;
-    }
-    return jsonObject;
-  }
-}
-
-/**
- * JsonDecoder for decoding requests.  Errors are reporting by throwing a
- * [RequestFailure].
- */
-class RequestDecoder extends JsonDecoder {
-  /**
-   * The request being deserialized.
-   */
-  final Request _request;
-
-  RequestDecoder(this._request);
-
-  RefactoringKind get refactoringKind {
-    // Refactoring feedback objects should never appear in requests.
-    return null;
-  }
-
-  @override
-  dynamic mismatch(String jsonPath, String expected, [Object actual]) {
-    StringBuffer buffer = new StringBuffer();
-    buffer.write('Expected to be ');
-    buffer.write(expected);
-    if (actual != null) {
-      buffer.write('; found "');
-      buffer.write(JSON.encode(actual));
-      buffer.write('"');
-    }
-    return new RequestFailure(
-        new Response.invalidParameter(_request, jsonPath, buffer.toString()));
-  }
-
-  @override
-  dynamic missingKey(String jsonPath, String key) {
-    return new RequestFailure(new Response.invalidParameter(
-        _request, jsonPath, 'Expected to contain key ${JSON.encode(key)}'));
-  }
-}
-
-/**
- * Instances of the class [RequestFailure] represent an exception that occurred
- * during the handling of a request that requires that an error be returned to
- * the client.
- */
-class RequestFailure implements Exception {
-  /**
-   * The response to be returned as a result of the failure.
-   */
-  final Response response;
-
-  /**
-   * Initialize a newly created exception to return the given reponse.
-   */
-  RequestFailure(this.response);
-}
-
-/**
- * Instances of the class [RequestHandler] implement a handler that can handle
- * requests and produce responses for them.
- */
-abstract class RequestHandler {
-  /**
-   * Attempt to handle the given [request]. If the request is not recognized by
-   * this handler, return `null` so that other handlers will be given a chance
-   * to handle it. Otherwise, return the response that should be passed back to
-   * the client.
-   */
-  Response handleRequest(Request request);
-}
-
-/**
- * Instances of the class [Response] represent a response to a request.
- */
-class Response {
-  /**
-   * The [Response] instance that is returned when a real [Response] cannot
-   * be provided at the moment.
-   */
-  static final Response DELAYED_RESPONSE = new Response('DELAYED_RESPONSE');
-
-  /**
-   * The name of the JSON attribute containing the id of the request for which
-   * this is a response.
-   */
-  static const String ID = 'id';
-
-  /**
-   * The name of the JSON attribute containing the error message.
-   */
-  static const String ERROR = 'error';
-
-  /**
-   * The name of the JSON attribute containing the result values.
-   */
-  static const String RESULT = 'result';
-
-  /**
-   * The unique identifier used to identify the request that this response is
-   * associated with.
-   */
-  final String id;
-
-  /**
-   * The error that was caused by attempting to handle the request, or `null` if
-   * there was no error.
-   */
-  final RequestError error;
-
-  /**
-   * A table mapping the names of result fields to their values.  Should be
-   * null if there is no result to send.
-   */
-  Map<String, Object> _result;
-
-  /**
-   * Initialize a newly created instance to represent a response to a request
-   * with the given [id].  If [_result] is provided, it will be used as the
-   * result; otherwise an empty result will be used.  If an [error] is provided
-   * then the response will represent an error condition.
-   */
-  Response(this.id, {Map<String, Object> result, this.error})
-      : _result = result;
-
-  /**
-   * Initialize a newly created instance to represent the
-   * FILE_NOT_ANALYZED error condition.
-   */
-  Response.fileNotAnalyzed(Request request, String file)
-      : this(request.id,
-            error: new RequestError(RequestErrorCode.FILE_NOT_ANALYZED,
-                'File is not analyzed: $file.'));
-
-  /**
-   * Initialize a newly created instance to represent the FORMAT_INVALID_FILE
-   * error condition.
-   */
-  Response.formatInvalidFile(Request request)
-      : this(request.id,
-            error: new RequestError(RequestErrorCode.FORMAT_INVALID_FILE,
-                'Error during `edit.format`: invalid file.'));
-
-  /**
-   * Initialize a newly created instance to represent the FORMAT_WITH_ERROR
-   * error condition.
-   */
-  Response.formatWithErrors(Request request)
-      : this(request.id,
-            error: new RequestError(RequestErrorCode.FORMAT_WITH_ERRORS,
-                'Error during `edit.format`: source contains syntax errors.'));
-
-  /**
-   * Initialize a newly created instance based upon the given JSON data
-   */
-  factory Response.fromJson(Map<String, Object> json) {
-    try {
-      Object id = json[Response.ID];
-      if (id is! String) {
-        return null;
-      }
-      Object error = json[Response.ERROR];
-      RequestError decodedError;
-      if (error is Map) {
-        decodedError = new RequestError.fromJson(
-            new ResponseDecoder(null), '.error', error);
-      }
-      Object result = json[Response.RESULT];
-      Map<String, Object> decodedResult;
-      if (result is Map) {
-        decodedResult = result;
-      }
-      return new Response(id, error: decodedError, result: decodedResult);
-    } catch (exception) {
-      return null;
-    }
-  }
-
-  /**
-   * Initialize a newly created instance to represent the
-   * GET_ERRORS_INVALID_FILE error condition.
-   */
-  Response.getErrorsInvalidFile(Request request)
-      : this(request.id,
-            error: new RequestError(RequestErrorCode.GET_ERRORS_INVALID_FILE,
-                'Error during `analysis.getErrors`: invalid file.'));
-
-  /**
-   * Initialize a newly created instance to represent the
-   * GET_NAVIGATION_INVALID_FILE error condition.
-   */
-  Response.getNavigationInvalidFile(Request request)
-      : this(request.id,
-            error: new RequestError(
-                RequestErrorCode.GET_NAVIGATION_INVALID_FILE,
-                'Error during `analysis.getNavigation`: invalid file.'));
-
-  /**
-   * Initialize a newly created instance to represent an error condition caused
-   * by an analysis.reanalyze [request] that specifies an analysis root that is
-   * not in the current list of analysis roots.
-   */
-  Response.invalidAnalysisRoot(Request request, String rootPath)
-      : this(request.id,
-            error: new RequestError(RequestErrorCode.INVALID_ANALYSIS_ROOT,
-                "Invalid analysis root: $rootPath"));
-
-  /**
-   * Initialize a newly created instance to represent an error condition caused
-   * by a [request] that specifies an execution context whose context root does
-   * not exist.
-   */
-  Response.invalidExecutionContext(Request request, String contextId)
-      : this(request.id,
-            error: new RequestError(RequestErrorCode.INVALID_EXECUTION_CONTEXT,
-                "Invalid execution context: $contextId"));
-
-  /**
-   * Initialize a newly created instance to represent an error condition caused
-   * by a [request] that had invalid parameter.  [path] is the path to the
-   * invalid parameter, in Javascript notation (e.g. "foo.bar" means that the
-   * parameter "foo" contained a key "bar" whose value was the wrong type).
-   * [expectation] is a description of the type of data that was expected.
-   */
-  Response.invalidParameter(Request request, String path, String expectation)
-      : this(request.id,
-            error: new RequestError(RequestErrorCode.INVALID_PARAMETER,
-                "Invalid parameter '$path'. $expectation."));
-
-  /**
-   * Initialize a newly created instance to represent an error condition caused
-   * by a malformed request.
-   */
-  Response.invalidRequestFormat()
-      : this('',
-            error: new RequestError(
-                RequestErrorCode.INVALID_REQUEST, 'Invalid request'));
-
-  /**
-   * Initialize a newly created instance to represent an error condition caused
-   * by a request that requires an index, but indexing is disabled.
-   */
-  Response.noIndexGenerated(Request request)
-      : this(request.id,
-            error: new RequestError(
-                RequestErrorCode.NO_INDEX_GENERATED, 'Indexing is disabled'));
-
-  /**
-   * Initialize a newly created instance to represent the
-   * ORGANIZE_DIRECTIVES_ERROR error condition.
-   */
-  Response.organizeDirectivesError(Request request, String message)
-      : this(request.id,
-            error: new RequestError(
-                RequestErrorCode.ORGANIZE_DIRECTIVES_ERROR, message));
-
-  /**
-   * Initialize a newly created instance to represent the
-   * REFACTORING_REQUEST_CANCELLED error condition.
-   */
-  Response.refactoringRequestCancelled(Request request)
-      : this(request.id,
-            error: new RequestError(
-                RequestErrorCode.REFACTORING_REQUEST_CANCELLED,
-                'The `edit.getRefactoring` request was cancelled.'));
-
-  /**
-   * Initialize a newly created instance to represent the SERVER_ERROR error
-   * condition.
-   */
-  factory Response.serverError(Request request, exception, stackTrace) {
-    RequestError error =
-        new RequestError(RequestErrorCode.SERVER_ERROR, exception.toString());
-    if (stackTrace != null) {
-      error.stackTrace = stackTrace.toString();
-    }
-    return new Response(request.id, error: error);
-  }
-
-  /**
-   * Initialize a newly created instance to represent the
-   * SORT_MEMBERS_INVALID_FILE error condition.
-   */
-  Response.sortMembersInvalidFile(Request request)
-      : this(request.id,
-            error: new RequestError(RequestErrorCode.SORT_MEMBERS_INVALID_FILE,
-                'Error during `edit.sortMembers`: invalid file.'));
-
-  /**
-   * Initialize a newly created instance to represent the
-   * SORT_MEMBERS_PARSE_ERRORS error condition.
-   */
-  Response.sortMembersParseErrors(Request request, int numErrors)
-      : this(request.id,
-            error: new RequestError(RequestErrorCode.SORT_MEMBERS_PARSE_ERRORS,
-                'Error during `edit.sortMembers`: file has $numErrors scan/parse errors.'));
-
-  /**
-   * Initialize a newly created instance to represent an error condition caused
-   * by a `analysis.setPriorityFiles` [request] that includes one or more files
-   * that are not being analyzed.
-   */
-  Response.unanalyzedPriorityFiles(String requestId, String fileNames)
-      : this(requestId,
-            error: new RequestError(RequestErrorCode.UNANALYZED_PRIORITY_FILES,
-                "Unanalyzed files cannot be a priority: '$fileNames'"));
-
-  /**
-   * Initialize a newly created instance to represent an error condition caused
-   * by a [request] that cannot be handled by any known handlers.
-   */
-  Response.unknownRequest(Request request)
-      : this(request.id,
-            error: new RequestError(
-                RequestErrorCode.UNKNOWN_REQUEST, 'Unknown request'));
-
-  /**
-   * Initialize a newly created instance to represent an error condition caused
-   * by a [request] referencing a source that does not exist.
-   */
-  Response.unknownSource(Request request)
-      : this(request.id,
-            error: new RequestError(
-                RequestErrorCode.UNKNOWN_SOURCE, 'Unknown source'));
-
-  Response.unsupportedFeature(String requestId, String message)
-      : this(requestId,
-            error: new RequestError(
-                RequestErrorCode.UNSUPPORTED_FEATURE, message));
-
-  /**
-   * Return a table representing the structure of the Json object that will be
-   * sent to the client to represent this response.
-   */
-  Map<String, Object> toJson() {
-    Map<String, Object> jsonObject = new HashMap<String, Object>();
-    jsonObject[ID] = id;
-    if (error != null) {
-      jsonObject[ERROR] = error.toJson();
-    }
-    if (_result != null) {
-      jsonObject[RESULT] = _result;
-    }
-    return jsonObject;
-  }
-}
-
-/**
- * JsonDecoder for decoding responses from the server.  This is intended to be
- * used only for testing.  Errors are reported using bare [Exception] objects.
- */
-class ResponseDecoder extends JsonDecoder {
-  final RefactoringKind refactoringKind;
-
-  ResponseDecoder(this.refactoringKind);
-
-  @override
-  dynamic mismatch(String jsonPath, String expected, [Object actual]) {
-    StringBuffer buffer = new StringBuffer();
-    buffer.write('Expected ');
-    buffer.write(expected);
-    if (actual != null) {
-      buffer.write(' found "');
-      buffer.write(JSON.encode(actual));
-      buffer.write('"');
-    }
-    buffer.write(' at ');
-    buffer.write(jsonPath);
-    return new Exception(buffer.toString());
-  }
-
-  @override
-  dynamic missingKey(String jsonPath, String key) {
-    return new Exception('Missing key $key at $jsonPath');
-  }
-}
-
-/**
- * Jenkins hash function, optimized for small integers.  Borrowed from
- * sdk/lib/math/jenkins_smi_hash.dart.
- *
- * TODO(paulberry): Move to somewhere that can be shared with other code.
- */
-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 hash4(a, b, c, d) =>
-      finish(combine(combine(combine(combine(0, a), b), c), d));
-}
diff --git a/pkg/analysis_server/lib/src/protocol/protocol_internal.dart b/pkg/analysis_server/lib/src/protocol/protocol_internal.dart
new file mode 100644
index 0000000..256523a
--- /dev/null
+++ b/pkg/analysis_server/lib/src/protocol/protocol_internal.dart
@@ -0,0 +1,465 @@
+// 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 analysis_server.src.protocol.protocol_internal;
+
+import 'dart:collection';
+import 'dart:convert' hide JsonDecoder;
+
+import 'package:analysis_server/plugin/protocol/protocol.dart';
+
+final Map<String, RefactoringKind> REQUEST_ID_REFACTORING_KINDS =
+    new HashMap<String, RefactoringKind>();
+
+/**
+ * Adds the given [sourceEdits] to the list in [sourceFileEdit].
+ */
+void addAllEditsForSource(
+    SourceFileEdit sourceFileEdit, Iterable<SourceEdit> edits) {
+  edits.forEach(sourceFileEdit.add);
+}
+
+/**
+ * Adds the given [sourceEdit] to the list in [sourceFileEdit].
+ */
+void addEditForSource(SourceFileEdit sourceFileEdit, SourceEdit sourceEdit) {
+  List<SourceEdit> edits = sourceFileEdit.edits;
+  int index = 0;
+  while (index < edits.length && edits[index].offset > sourceEdit.offset) {
+    index++;
+  }
+  edits.insert(index, sourceEdit);
+}
+
+/**
+ * Adds [edit] to the [FileEdit] for the given [file].
+ */
+void addEditToSourceChange(
+    SourceChange change, String file, int fileStamp, SourceEdit edit) {
+  SourceFileEdit fileEdit = change.getFileEdit(file);
+  if (fileEdit == null) {
+    fileEdit = new SourceFileEdit(file, fileStamp);
+    change.addFileEdit(fileEdit);
+  }
+  fileEdit.add(edit);
+}
+
+/**
+ * Get the result of applying the edit to the given [code].  Access via
+ * SourceEdit.apply().
+ */
+String applyEdit(String code, SourceEdit edit) {
+  if (edit.length < 0) {
+    throw new RangeError('length is negative');
+  }
+  return code.replaceRange(edit.offset, edit.end, edit.replacement);
+}
+
+/**
+ * Get the result of applying a set of [edits] to the given [code].  Edits
+ * are applied in the order they appear in [edits].  Access via
+ * SourceEdit.applySequence().
+ */
+String applySequenceOfEdits(String code, Iterable<SourceEdit> edits) {
+  edits.forEach((SourceEdit edit) {
+    code = edit.apply(code);
+  });
+  return code;
+}
+
+/**
+ * Returns the [FileEdit] for the given [file], maybe `null`.
+ */
+SourceFileEdit getChangeFileEdit(SourceChange change, String file) {
+  for (SourceFileEdit fileEdit in change.edits) {
+    if (fileEdit.file == file) {
+      return fileEdit;
+    }
+  }
+  return null;
+}
+
+/**
+ * Compare the lists [listA] and [listB], using [itemEqual] to compare
+ * list elements.
+ */
+bool listEqual(List listA, List listB, bool itemEqual(a, b)) {
+  if (listA == null) {
+    return listB == null;
+  }
+  if (listB == null) {
+    return false;
+  }
+  if (listA.length != listB.length) {
+    return false;
+  }
+  for (int i = 0; i < listA.length; i++) {
+    if (!itemEqual(listA[i], listB[i])) {
+      return false;
+    }
+  }
+  return true;
+}
+
+/**
+ * Compare the maps [mapA] and [mapB], using [valueEqual] to compare map
+ * values.
+ */
+bool mapEqual(Map mapA, Map mapB, bool valueEqual(a, b)) {
+  if (mapA == null) {
+    return mapB == null;
+  }
+  if (mapB == null) {
+    return false;
+  }
+  if (mapA.length != mapB.length) {
+    return false;
+  }
+  for (var key in mapA.keys) {
+    if (!mapB.containsKey(key)) {
+      return false;
+    }
+    if (!valueEqual(mapA[key], mapB[key])) {
+      return false;
+    }
+  }
+  return true;
+}
+
+/**
+ * Translate the input [map], applying [keyCallback] to all its keys, and
+ * [valueCallback] to all its values.
+ */
+mapMap(Map map, {dynamic keyCallback(key), dynamic valueCallback(value)}) {
+  Map result = {};
+  map.forEach((key, value) {
+    if (keyCallback != null) {
+      key = keyCallback(key);
+    }
+    if (valueCallback != null) {
+      value = valueCallback(value);
+    }
+    result[key] = value;
+  });
+  return result;
+}
+
+RefactoringProblemSeverity maxRefactoringProblemSeverity(
+    RefactoringProblemSeverity a, RefactoringProblemSeverity b) {
+  if (b == null) {
+    return a;
+  }
+  if (a == null) {
+    return b;
+  } else if (a == RefactoringProblemSeverity.INFO) {
+    return b;
+  } else if (a == RefactoringProblemSeverity.WARNING) {
+    if (b == RefactoringProblemSeverity.ERROR ||
+        b == RefactoringProblemSeverity.FATAL) {
+      return b;
+    }
+  } else if (a == RefactoringProblemSeverity.ERROR) {
+    if (b == RefactoringProblemSeverity.FATAL) {
+      return b;
+    }
+  }
+  return a;
+}
+
+/**
+ * Create a [RefactoringFeedback] corresponding the given [kind].
+ */
+RefactoringFeedback refactoringFeedbackFromJson(
+    JsonDecoder jsonDecoder, String jsonPath, Object json, Map feedbackJson) {
+  RefactoringKind kind = jsonDecoder.refactoringKind;
+  if (kind == RefactoringKind.EXTRACT_LOCAL_VARIABLE) {
+    return new ExtractLocalVariableFeedback.fromJson(
+        jsonDecoder, jsonPath, json);
+  }
+  if (kind == RefactoringKind.EXTRACT_METHOD) {
+    return new ExtractMethodFeedback.fromJson(jsonDecoder, jsonPath, json);
+  }
+  if (kind == RefactoringKind.INLINE_LOCAL_VARIABLE) {
+    return new InlineLocalVariableFeedback.fromJson(
+        jsonDecoder, jsonPath, json);
+  }
+  if (kind == RefactoringKind.INLINE_METHOD) {
+    return new InlineMethodFeedback.fromJson(jsonDecoder, jsonPath, json);
+  }
+  if (kind == RefactoringKind.RENAME) {
+    return new RenameFeedback.fromJson(jsonDecoder, jsonPath, json);
+  }
+  return null;
+}
+
+/**
+ * Create a [RefactoringOptions] corresponding the given [kind].
+ */
+RefactoringOptions refactoringOptionsFromJson(JsonDecoder jsonDecoder,
+    String jsonPath, Object json, RefactoringKind kind) {
+  if (kind == RefactoringKind.EXTRACT_LOCAL_VARIABLE) {
+    return new ExtractLocalVariableOptions.fromJson(
+        jsonDecoder, jsonPath, json);
+  }
+  if (kind == RefactoringKind.EXTRACT_METHOD) {
+    return new ExtractMethodOptions.fromJson(jsonDecoder, jsonPath, json);
+  }
+  if (kind == RefactoringKind.INLINE_METHOD) {
+    return new InlineMethodOptions.fromJson(jsonDecoder, jsonPath, json);
+  }
+  if (kind == RefactoringKind.MOVE_FILE) {
+    return new MoveFileOptions.fromJson(jsonDecoder, jsonPath, json);
+  }
+  if (kind == RefactoringKind.RENAME) {
+    return new RenameOptions.fromJson(jsonDecoder, jsonPath, json);
+  }
+  return null;
+}
+
+/**
+ * Type of callbacks used to decode parts of JSON objects.  [jsonPath] is a
+ * string describing the part of the JSON object being decoded, and [value] is
+ * the part to decode.
+ */
+typedef Object JsonDecoderCallback(String jsonPath, Object value);
+
+/**
+ * Instances of the class [HasToJson] implement [toJson] method that returns
+ * a JSON presentation.
+ */
+abstract class HasToJson {
+  /**
+   * Returns a JSON presentation of the object.
+   */
+  Map<String, Object> toJson();
+}
+
+/**
+ * Jenkins hash function, optimized for small integers.  Borrowed from
+ * sdk/lib/math/jenkins_smi_hash.dart.
+ *
+ * TODO(paulberry): Move to somewhere that can be shared with other code.
+ */
+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 hash4(a, b, c, d) =>
+      finish(combine(combine(combine(combine(0, a), b), c), d));
+}
+
+/**
+ * Base class for decoding JSON objects.  The derived class must implement
+ * error reporting logic.
+ */
+abstract class JsonDecoder {
+  /**
+   * Retrieve the RefactoringKind that should be assumed when decoding
+   * refactoring feedback objects, or null if no refactoring feedback object is
+   * expected to be encountered.
+   */
+  RefactoringKind get refactoringKind;
+
+  /**
+   * Decode a JSON object that is expected to be a boolean.  The strings "true"
+   * and "false" are also accepted.
+   */
+  bool decodeBool(String jsonPath, Object json) {
+    if (json is bool) {
+      return json;
+    } else if (json == 'true') {
+      return true;
+    } else if (json == 'false') {
+      return false;
+    }
+    throw mismatch(jsonPath, 'bool', json);
+  }
+
+  /**
+   * Decode a JSON object that is expected to be an integer.  A string
+   * representation of an integer is also accepted.
+   */
+  int decodeInt(String jsonPath, Object json) {
+    if (json is int) {
+      return json;
+    } else if (json is String) {
+      return int.parse(json, onError: (String value) {
+        throw mismatch(jsonPath, 'int', json);
+      });
+    }
+    throw mismatch(jsonPath, 'int', json);
+  }
+
+  /**
+   * Decode a JSON object that is expected to be a List.  [decoder] is used to
+   * decode the items in the list.
+   */
+  List decodeList(String jsonPath, Object json, [JsonDecoderCallback decoder]) {
+    if (json == null) {
+      return [];
+    } else if (json is List) {
+      List result = [];
+      for (int i = 0; i < json.length; i++) {
+        result.add(decoder('$jsonPath[$i]', json[i]));
+      }
+      return result;
+    } else {
+      throw mismatch(jsonPath, 'List', json);
+    }
+  }
+
+  /**
+   * Decode a JSON object that is expected to be a Map.  [keyDecoder] is used
+   * to decode the keys, and [valueDecoder] is used to decode the values.
+   */
+  Map decodeMap(String jsonPath, Object json,
+      {JsonDecoderCallback keyDecoder, JsonDecoderCallback valueDecoder}) {
+    if (json == null) {
+      return {};
+    } else if (json is Map) {
+      Map result = {};
+      json.forEach((String key, value) {
+        Object decodedKey;
+        if (keyDecoder != null) {
+          decodedKey = keyDecoder('$jsonPath.key', key);
+        } else {
+          decodedKey = key;
+        }
+        if (valueDecoder != null) {
+          value = valueDecoder('$jsonPath[${JSON.encode(key)}]', value);
+        }
+        result[decodedKey] = value;
+      });
+      return result;
+    } else {
+      throw mismatch(jsonPath, 'Map', json);
+    }
+  }
+
+  /**
+   * Decode a JSON object that is expected to be a string.
+   */
+  String decodeString(String jsonPath, Object json) {
+    if (json is String) {
+      return json;
+    } else {
+      throw mismatch(jsonPath, 'String', json);
+    }
+  }
+
+  /**
+   * Decode a JSON object that is expected to be one of several choices,
+   * where the choices are disambiguated by the contents of the field [field].
+   * [decoders] is a map from each possible string in the field to the decoder
+   * that should be used to decode the JSON object.
+   */
+  Object decodeUnion(String jsonPath, Map json, String field,
+      Map<String, JsonDecoderCallback> decoders) {
+    if (json is Map) {
+      if (!json.containsKey(field)) {
+        throw missingKey(jsonPath, field);
+      }
+      var disambiguatorPath = '$jsonPath[${JSON.encode(field)}]';
+      String disambiguator = decodeString(disambiguatorPath, json[field]);
+      if (!decoders.containsKey(disambiguator)) {
+        throw mismatch(
+            disambiguatorPath, 'One of: ${decoders.keys.toList()}', json);
+      }
+      return decoders[disambiguator](jsonPath, json);
+    } else {
+      throw mismatch(jsonPath, 'Map', json);
+    }
+  }
+
+  /**
+   * Create an exception to throw if the JSON object at [jsonPath] fails to
+   * match the API definition of [expected].
+   */
+  dynamic mismatch(String jsonPath, String expected, [Object actual]);
+
+  /**
+   * Create an exception to throw if the JSON object at [jsonPath] is missing
+   * the key [key].
+   */
+  dynamic missingKey(String jsonPath, String key);
+}
+
+/**
+ * JsonDecoder for decoding requests.  Errors are reporting by throwing a
+ * [RequestFailure].
+ */
+class RequestDecoder extends JsonDecoder {
+  /**
+   * The request being deserialized.
+   */
+  final Request _request;
+
+  RequestDecoder(this._request);
+
+  RefactoringKind get refactoringKind {
+    // Refactoring feedback objects should never appear in requests.
+    return null;
+  }
+
+  @override
+  dynamic mismatch(String jsonPath, String expected, [Object actual]) {
+    StringBuffer buffer = new StringBuffer();
+    buffer.write('Expected to be ');
+    buffer.write(expected);
+    if (actual != null) {
+      buffer.write('; found "');
+      buffer.write(JSON.encode(actual));
+      buffer.write('"');
+    }
+    return new RequestFailure(
+        new Response.invalidParameter(_request, jsonPath, buffer.toString()));
+  }
+
+  @override
+  dynamic missingKey(String jsonPath, String key) {
+    return new RequestFailure(new Response.invalidParameter(
+        _request, jsonPath, 'Expected to contain key ${JSON.encode(key)}'));
+  }
+}
+
+/**
+ * JsonDecoder for decoding responses from the server.  This is intended to be
+ * used only for testing.  Errors are reported using bare [Exception] objects.
+ */
+class ResponseDecoder extends JsonDecoder {
+  final RefactoringKind refactoringKind;
+
+  ResponseDecoder(this.refactoringKind);
+
+  @override
+  dynamic mismatch(String jsonPath, String expected, [Object actual]) {
+    StringBuffer buffer = new StringBuffer();
+    buffer.write('Expected ');
+    buffer.write(expected);
+    if (actual != null) {
+      buffer.write(' found "');
+      buffer.write(JSON.encode(actual));
+      buffer.write('"');
+    }
+    buffer.write(' at ');
+    buffer.write(jsonPath);
+    return new Exception(buffer.toString());
+  }
+
+  @override
+  dynamic missingKey(String jsonPath, String key) {
+    return new Exception('Missing key $key at $jsonPath');
+  }
+}
diff --git a/pkg/analysis_server/lib/src/protocol_server.dart b/pkg/analysis_server/lib/src/protocol_server.dart
index 4f0b490..678361f 100644
--- a/pkg/analysis_server/lib/src/protocol_server.dart
+++ b/pkg/analysis_server/lib/src/protocol_server.dart
@@ -4,7 +4,9 @@
 
 library protocol.server;
 
-import 'package:analysis_server/src/protocol.dart';
+import 'package:analysis_server/plugin/protocol/protocol.dart';
+import 'package:analysis_server/plugin/protocol/protocol_dart.dart';
+import 'package:analysis_server/src/services/correction/fix.dart';
 import 'package:analysis_server/src/services/search/search_engine.dart'
     as engine;
 import 'package:analyzer/src/generated/ast.dart' as engine;
@@ -14,7 +16,8 @@
 import 'package:analyzer/src/generated/source.dart' as engine;
 import 'package:analyzer/src/generated/utilities_dart.dart' as engine;
 
-export 'package:analysis_server/src/protocol.dart';
+export 'package:analysis_server/plugin/protocol/protocol.dart';
+export 'package:analysis_server/plugin/protocol/protocol_dart.dart';
 
 /**
  * Returns a list of AnalysisErrors correponding to the given list of Engine
@@ -92,112 +95,9 @@
   var type = new AnalysisErrorType(errorCode.type.name);
   String message = error.message;
   String correction = error.correction;
+  bool fix = hasFix(error.errorCode);
   return new AnalysisError(severity, type, location, message,
-      correction: correction);
-}
-
-/**
- * Construct based on a value from the analyzer engine.
- */
-Element newElement_fromEngine(engine.Element element) {
-  String name = element.displayName;
-  String elementTypeParameters = _getTypeParametersString(element);
-  String elementParameters = _getParametersString(element);
-  String elementReturnType = getReturnTypeString(element);
-  ElementKind kind = newElementKind_fromEngineElement(element);
-  return new Element(kind, name, Element.makeFlags(
-          isPrivate: element.isPrivate,
-          isDeprecated: element.isDeprecated,
-          isAbstract: _isAbstract(element),
-          isConst: _isConst(element),
-          isFinal: _isFinal(element),
-          isStatic: _isStatic(element)),
-      location: newLocation_fromElement(element),
-      typeParameters: elementTypeParameters,
-      parameters: elementParameters,
-      returnType: elementReturnType);
-}
-
-/**
- * Construct based on a value from the analyzer engine.
- * This does not take into account that
- * instances of ClassElement can be an enum and
- * instances of FieldElement can be an enum constant.
- * Use [newElementKind_fromEngineElement] where possible.
- */
-ElementKind newElementKind_fromEngine(engine.ElementKind kind) {
-  if (kind == engine.ElementKind.CLASS) {
-    return ElementKind.CLASS;
-  }
-  if (kind == engine.ElementKind.COMPILATION_UNIT) {
-    return ElementKind.COMPILATION_UNIT;
-  }
-  if (kind == engine.ElementKind.CONSTRUCTOR) {
-    return ElementKind.CONSTRUCTOR;
-  }
-  if (kind == engine.ElementKind.FIELD) {
-    return ElementKind.FIELD;
-  }
-  if (kind == engine.ElementKind.FUNCTION) {
-    return ElementKind.FUNCTION;
-  }
-  if (kind == engine.ElementKind.FUNCTION_TYPE_ALIAS) {
-    return ElementKind.FUNCTION_TYPE_ALIAS;
-  }
-  if (kind == engine.ElementKind.GETTER) {
-    return ElementKind.GETTER;
-  }
-  if (kind == engine.ElementKind.LABEL) {
-    return ElementKind.LABEL;
-  }
-  if (kind == engine.ElementKind.LIBRARY) {
-    return ElementKind.LIBRARY;
-  }
-  if (kind == engine.ElementKind.LOCAL_VARIABLE) {
-    return ElementKind.LOCAL_VARIABLE;
-  }
-  if (kind == engine.ElementKind.METHOD) {
-    return ElementKind.METHOD;
-  }
-  if (kind == engine.ElementKind.PARAMETER) {
-    return ElementKind.PARAMETER;
-  }
-  if (kind == engine.ElementKind.PREFIX) {
-    return ElementKind.PREFIX;
-  }
-  if (kind == engine.ElementKind.SETTER) {
-    return ElementKind.SETTER;
-  }
-  if (kind == engine.ElementKind.TOP_LEVEL_VARIABLE) {
-    return ElementKind.TOP_LEVEL_VARIABLE;
-  }
-  if (kind == engine.ElementKind.TYPE_PARAMETER) {
-    return ElementKind.TYPE_PARAMETER;
-  }
-  return ElementKind.UNKNOWN;
-}
-
-/**
- * Construct based on a value from the analyzer engine.
- */
-ElementKind newElementKind_fromEngineElement(engine.Element element) {
-  if (element is engine.ClassElement && element.isEnum) {
-    return ElementKind.ENUM;
-  }
-  if (element is engine.FieldElement && element.isEnumConstant &&
-      // MyEnum.values and MyEnum.one.index return isEnumConstant = true
-      // so these additional checks are necessary.
-      // TODO(danrubel) MyEnum.values is constant, but is a list
-      // so should it return isEnumConstant = true?
-      // MyEnum.one.index is final but *not* constant
-      // so should it return isEnumConstant = true?
-      // Or should we return ElementKind.ENUM_CONSTANT here
-      // in either or both of these cases?
-      element.type != null &&
-      element.type.element == element.enclosingElement) {
-    return ElementKind.ENUM_CONSTANT;
-  }
-  return newElementKind_fromEngine(element.kind);
+      correction: correction, hasFix: fix);
 }
 
 /**
@@ -209,9 +109,8 @@
   if (context == null || source == null) {
     return null;
   }
-  String name = element.displayName;
   int offset = element.nameOffset;
-  int length = name != null ? name.length : 0;
+  int length = element.nameLength;
   if (element is engine.CompilationUnitElement) {
     offset = 0;
     length = 0;
@@ -253,21 +152,11 @@
   return _locationForArgs(context, source, range);
 }
 
-NavigationTarget newNavigationTarget_fromElement(
-    engine.Element element, int fileToIndex(String file)) {
-  ElementKind kind = newElementKind_fromEngine(element.kind);
-  Location location = newLocation_fromElement(element);
-  String file = location.file;
-  int fileIndex = fileToIndex(file);
-  return new NavigationTarget(kind, fileIndex, location.offset, location.length,
-      location.startLine, location.startColumn);
-}
-
 /**
  * Construct based on an element from the analyzer engine.
  */
 OverriddenMember newOverriddenMember_fromEngine(engine.Element member) {
-  Element element = newElement_fromEngine(member);
+  Element element = convertElement(member);
   String className = member.enclosingElement.displayName;
   return new OverriddenMember(element, className);
 }
@@ -318,7 +207,7 @@
 List<Element> _computePath(engine.Element element) {
   List<Element> path = <Element>[];
   while (element != null) {
-    path.add(newElement_fromEngine(element));
+    path.add(convertElement(element));
     // go up
     if (element is engine.PrefixElement) {
       // imports are library children, but they are physically in the unit
@@ -331,100 +220,6 @@
   return path;
 }
 
-String _getParametersString(engine.Element element) {
-  // TODO(scheglov) expose the corresponding feature from ExecutableElement
-  List<engine.ParameterElement> parameters;
-  if (element is engine.ExecutableElement) {
-    // valid getters don't have parameters
-    if (element.kind == engine.ElementKind.GETTER &&
-        element.parameters.isEmpty) {
-      return null;
-    }
-    parameters = element.parameters;
-  } else if (element is engine.FunctionTypeAliasElement) {
-    parameters = element.parameters;
-  } else {
-    return null;
-  }
-  StringBuffer sb = new StringBuffer();
-  String closeOptionalString = '';
-  for (engine.ParameterElement parameter in parameters) {
-    if (sb.isNotEmpty) {
-      sb.write(', ');
-    }
-    if (closeOptionalString.isEmpty) {
-      if (parameter.kind == engine.ParameterKind.NAMED) {
-        sb.write('{');
-        closeOptionalString = '}';
-      }
-      if (parameter.kind == engine.ParameterKind.POSITIONAL) {
-        sb.write('[');
-        closeOptionalString = ']';
-      }
-    }
-    sb.write(parameter.toString());
-  }
-  sb.write(closeOptionalString);
-  return '(' + sb.toString() + ')';
-}
-
-String _getTypeParametersString(engine.Element element) {
-  List<engine.TypeParameterElement> typeParameters;
-  if (element is engine.ClassElement) {
-    typeParameters = element.typeParameters;
-  } else if (element is engine.FunctionTypeAliasElement) {
-    typeParameters = element.typeParameters;
-  }
-  if (typeParameters == null || typeParameters.isEmpty) {
-    return null;
-  }
-  return '<${typeParameters.join(', ')}>';
-}
-
-bool _isAbstract(engine.Element element) {
-  // TODO(scheglov) add isAbstract to Element API
-  if (element is engine.ClassElement) {
-    return element.isAbstract;
-  }
-  if (element is engine.MethodElement) {
-    return element.isAbstract;
-  }
-  if (element is engine.PropertyAccessorElement) {
-    return element.isAbstract;
-  }
-  return false;
-}
-
-bool _isConst(engine.Element element) {
-  // TODO(scheglov) add isConst to Element API
-  if (element is engine.ConstructorElement) {
-    return element.isConst;
-  }
-  if (element is engine.VariableElement) {
-    return element.isConst;
-  }
-  return false;
-}
-
-bool _isFinal(engine.Element element) {
-  // TODO(scheglov) add isFinal to Element API
-  if (element is engine.VariableElement) {
-    return element.isFinal;
-  }
-  return false;
-}
-
-bool _isStatic(engine.Element element) {
-  // TODO(scheglov) add isStatic to Element API
-  if (element is engine.ExecutableElement) {
-    return element.isStatic;
-  }
-  if (element is engine.PropertyInducingElement) {
-    return element.isStatic;
-  }
-  return false;
-}
-
 /**
  * Creates a new [Location].
  */
diff --git a/pkg/analysis_server/lib/src/provisional/completion/completion.dart b/pkg/analysis_server/lib/src/provisional/completion/completion.dart
new file mode 100644
index 0000000..9a71bc0
--- /dev/null
+++ b/pkg/analysis_server/lib/src/provisional/completion/completion.dart
@@ -0,0 +1,39 @@
+// 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.
+
+/**
+ * Support for client code that extends the analysis server by adding new code
+ * completion contributors.
+ *
+ * Plugins can register completion contributors. The registered contributors
+ * will be used to get completions any time a client issues a
+ * 'completion.getSuggestions' request.
+ *
+ * If a plugin wants to add completions, it should implement the class
+ * [CompletionContributor] and then register the contributor by including code
+ * like the following in the plugin's registerExtensions method:
+ *
+ *     @override
+ *     void registerExtensions(RegisterExtension registerExtension) {
+ *       ...
+ *       registerExtension(
+ *           COMPLETION_CONTRIBUTOR_EXTENSION_POINT_ID,
+ *           new MyCompletionContributor());
+ *       ...
+ *     }
+ */
+library analysis_server.src.provisional.completion.completion;
+
+import 'package:analysis_server/src/plugin/server_plugin.dart';
+import 'package:analysis_server/src/provisional/completion/completion_core.dart';
+import 'package:plugin/plugin.dart';
+
+/**
+ * The identifier of the extension point that allows plugins to register code
+ * completion contributors. The object used as an extension must be a
+ * [CompletionContributor].
+ */
+final String COMPLETION_CONTRIBUTOR_EXTENSION_POINT_ID = Plugin.join(
+    ServerPlugin.UNIQUE_IDENTIFIER,
+    ServerPlugin.COMPLETION_CONTRIBUTOR_EXTENSION_POINT);
diff --git a/pkg/analysis_server/lib/src/provisional/completion/completion_core.dart b/pkg/analysis_server/lib/src/provisional/completion/completion_core.dart
new file mode 100644
index 0000000..75f830b
--- /dev/null
+++ b/pkg/analysis_server/lib/src/provisional/completion/completion_core.dart
@@ -0,0 +1,84 @@
+// 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 analysis_server.src.provisional.completion.completion_core;
+
+import 'package:analysis_server/plugin/protocol/protocol.dart';
+import 'package:analyzer/file_system/file_system.dart';
+import 'package:analyzer/src/generated/engine.dart';
+import 'package:analyzer/src/generated/source.dart';
+
+/**
+ * An object used to produce completions for a specific error. Completion
+ * contributors are long-lived objects and must not retain any state between
+ * invocations of [computeSuggestions].
+ *
+ * Clients may implement this class when implementing plugins.
+ */
+abstract class CompletionContributor {
+  /**
+   * Compute a list of completion suggestions based on the given completion
+   * [request]. Return the suggestions that were computed.
+   */
+  List<CompletionSuggestion> computeSuggestions(CompletionRequest request);
+}
+
+/**
+ * The information about a requested list of completions.
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+abstract class CompletionRequest {
+  /**
+   * Return the analysis context in which the completion is being requested.
+   */
+  AnalysisContext get context;
+
+  /**
+   * Return the offset within the source at which the completion is being
+   * requested.
+   */
+  int get offset;
+
+  /**
+   * Return the resource provider associated with this request.
+   */
+  ResourceProvider get resourceProvider;
+
+  /**
+   * Return the source in which the completion is being requested.
+   */
+  Source get source;
+}
+
+/**
+ * The result of computing suggestions for code completion.
+ *
+ * Clients may implement this class when implementing plugins.
+ */
+abstract class CompletionResult {
+  /**
+   * Return the length of the text to be replaced. This will be zero (0) if the
+   * suggestion is to be inserted, otherwise it will be greater than zero. For
+   * example, if the remainder of the identifier containing the cursor is to be
+   * replaced when the suggestion is applied, in which case the length will be
+   * the number of characters in the existing identifier.
+   */
+  int get replacementLength;
+
+  /**
+   * Return the offset of the start of the text to be replaced. This will be
+   * different than the offset used to request the completion suggestions if
+   * there was a portion of text that needs to be replaced. For example, if a
+   * partial identifier is immediately before the original offset, in which case
+   * the replacementOffset will be the offset of the beginning of the
+   * identifier.
+   */
+  int get replacementOffset;
+
+  /**
+   * Return the list of suggestions being contributed by the contributor.
+   */
+  List<CompletionSuggestion> get suggestions;
+}
diff --git a/pkg/analysis_server/lib/src/provisional/completion/completion_dart.dart b/pkg/analysis_server/lib/src/provisional/completion/completion_dart.dart
new file mode 100644
index 0000000..e52c433
--- /dev/null
+++ b/pkg/analysis_server/lib/src/provisional/completion/completion_dart.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.
+
+library analysis_server.src.provisional.completion.completion_dart;
+
+import 'package:analysis_server/plugin/protocol/protocol.dart';
+import 'package:analysis_server/src/provisional/completion/completion_core.dart';
+import 'package:analysis_server/src/provisional/completion/dart/completion_target.dart';
+import 'package:analyzer/src/generated/ast.dart';
+import 'package:analyzer/src/generated/engine.dart';
+import 'package:analyzer/src/generated/source.dart';
+
+/**
+ * An object used to produce completions for a specific error within a Dart
+ * file. Completion contributors are long-lived objects and must not retain any
+ * state between invocations of [computeSuggestions].
+ *
+ * Clients may extend this class when implementing plugins.
+ */
+abstract class DartCompletionContributor implements CompletionContributor {
+  @override
+  List<CompletionSuggestion> computeSuggestions(CompletionRequest request) {
+    if (request is DartCompletionRequest) {
+      return internalComputeSuggestions(request);
+    }
+    AnalysisContext context = request.context;
+    Source source = request.source;
+    List<Source> libraries = context.getLibrariesContaining(source);
+    if (libraries.length < 1) {
+      return null;
+    }
+//    CompilationUnit unit =
+//        context.getResolvedCompilationUnit2(source, libraries[0]);
+//    bool isResolved = true;
+//    if (unit == null) {
+//      // TODO(brianwilkerson) Implement a method for getting a parsed
+//      // compilation unit without parsing the unit if it hasn't been parsed.
+//      unit = context.getParsedCompilationUnit(source);
+//      if (unit == null) {
+//        return null;
+//      }
+//      isResolved = false;
+//    }
+//    DartCompletionRequest dartRequest =
+//        new DartCompletionRequestImpl(request, unit, isResolved);
+//    return internalComputeSuggestions(dartRequest);
+    return null;
+  }
+
+  /**
+   * Compute a list of completion suggestions based on the given completion
+   * [request]. Return the suggestions that were computed.
+   */
+  List<CompletionSuggestion> internalComputeSuggestions(
+      DartCompletionRequest request);
+}
+
+/**
+ * The information about a requested list of completions within a Dart file.
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+abstract class DartCompletionRequest extends CompletionRequest {
+  /**
+   * Return `true` if the compilation [unit] is resolved.
+   */
+  bool get isResolved;
+
+  /**
+   * Return the completion target.  This determines what part of the parse tree
+   * will receive the newly inserted text.
+   */
+  CompletionTarget get target;
+
+  /**
+   * Cached information from a prior code completion operation.
+   */
+  //DartCompletionCache get cache;
+
+  /**
+   * Return the compilation unit in which the completion was requested.
+   */
+  CompilationUnit get unit;
+
+  /**
+   * Information about the types of suggestions that should be included.
+   */
+  //OpType get _optype;
+}
diff --git a/pkg/analysis_server/lib/src/provisional/completion/dart/completion_target.dart b/pkg/analysis_server/lib/src/provisional/completion/dart/completion_target.dart
new file mode 100644
index 0000000..e94016a
--- /dev/null
+++ b/pkg/analysis_server/lib/src/provisional/completion/dart/completion_target.dart
@@ -0,0 +1,379 @@
+// 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 analysis_server.src.provisional.completion.dart.completion_target;
+
+import 'package:analyzer/src/generated/ast.dart';
+import 'package:analyzer/src/generated/element.dart';
+import 'package:analyzer/src/generated/scanner.dart';
+import 'package:analyzer/src/generated/utilities_dart.dart';
+
+int _computeArgIndex(AstNode containingNode, Object entity) {
+  var argList = containingNode;
+  if (argList is ArgumentList) {
+    NodeList<Expression> args = argList.arguments;
+    for (int index = 0; index < args.length; ++index) {
+      if (entity == args[index]) {
+        return index;
+      }
+    }
+    if (args.isEmpty) {
+      return 0;
+    }
+  }
+  return null;
+}
+
+/**
+ * A CompletionTarget represents an edge in the parse tree which connects an
+ * AST node (the [containingNode] of the completion) to one of its children
+ * (the [entity], which represents the place in the parse tree where the newly
+ * completed text will be inserted).
+ *
+ * To illustrate, consider the following snippet of code, and its associated
+ * parse tree.  (T's represent tokens, N's represent AST nodes.  Some trivial
+ * AST nodes are not shown).
+ *
+ *            ___N        (function declaration)
+ *           /    \
+ *          /    __N_______  (function body)
+ *         /    /  |a      \
+ *        /    /   N______  \  (statement)
+ *       /    /   /       \  \
+ *      /    /   N____     \  \  (assignment expression)
+ *     |    /   /|    \     \  \
+ *     .   |   / |    _N___  \  |  ("as" expression)
+ *     .   |  |  |   / |   \c | |
+ *     .   |  N  |  N  |b   N | |  (simple identifiers)
+ *         |  |  |  |  |    | | |
+ *         T  T  T  T  T    T T T
+ *     m() { foo = bar as  Baz; }
+ *
+ * The Completion target is usually placed as high in the tree as possible so
+ * that we can produce the most meaningful completions with minimal effort.
+ * For instance, if the cursor is inside the identifier "foo", the completion
+ * target will be the edge marked "a", so that we will produce all completions
+ * that could possibly start a statement, even those which would conflict with
+ * the current parse (such as the keyword "for", which begins a "for"
+ * statement).  As a consequence of this, the [entity] will usually not be the
+ * first child of the [containingNode] node.
+ *
+ * Note that the [containingNode] is always an AST node, but the [entity] may
+ * not be.  For instance, if the cursor is inside the keyword "as", the
+ * completion target will be the edge marked "b", so the [entity] is the token
+ * "as".
+ *
+ * If the cursor is between tokens, the completion target is usually associated
+ * with the token that follows the cursor (since that's the token that will be
+ * displaced when the new text is inserted).  For example, if the cursor is
+ * after the "{" character, then the completion target will be the edge marked
+ * "a", just as it is if the cursor is inside the identifier "foo".  However
+ * there is one exception: if the cursor is at the rightmost edge of a keyword
+ * or identifier, then the completion target is associated with that token,
+ * since any further letters typed will change the meaning of the identifier or
+ * keyword, rather than creating a new token.  So for instance, if the cursor
+ * is just after the "s" of "as", the completion target will be the edge marked
+ * "b", but if the cursor target is after the first space following "as", then
+ * the completion target will be the edge marked "c".
+ *
+ * If the file is empty, or the cursor is after all the text in the file, then
+ * there may be no edge in the parse tree which is appropriate to act as the
+ * completion target; in this case, [entity] is set to null and
+ * [containingNode] is set to the CompilationUnit.
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class CompletionTarget {
+  /**
+   * The context in which the completion is occurring.  This is the AST node
+   * which is a direct parent of [entity].
+   */
+  final AstNode containingNode;
+
+  /**
+   * The entity which the completed text will replace (or which will be
+   * displaced once the completed text is inserted).  This may be an AstNode or
+   * a Token, or it may be null if the cursor is after all tokens in the file.
+   *
+   * Usually, the entity won't be the first child of the [containingNode] (this
+   * is a consequence of placing the completion target as high in the tree as
+   * possible).  However, there is one exception: when the cursor is inside of
+   * a multi-character token which is not a keyword or identifier (e.g. a
+   * comment, or a token like "+=", the entity will be always be the token.
+   */
+  final Object entity;
+
+  /**
+   * The [entity] is a comment token, which is either not a documentation
+   * comment or the position is not in a [CommentReference].
+   */
+  final bool isCommentText;
+
+  /**
+   * If the target is an argument in an [ArgumentList], then this is the index
+   * of the argument in the list, otherwise this is `null`.
+   */
+  final int argIndex;
+
+  /**
+   * Compute the appropriate [CompletionTarget] for the given [offset] within
+   * the [compilationUnit].
+   */
+  factory CompletionTarget.forOffset(
+      CompilationUnit compilationUnit, int offset) {
+    // The precise algorithm is as follows.  We perform a depth-first search of
+    // all edges in the parse tree (both those that point to AST nodes and
+    // those that point to tokens), visiting parents before children.  The
+    // first edge which points to an entity satisfying either _isCandidateToken
+    // or _isCandidateNode is the completion target.  If no edge is found that
+    // satisfies these two predicates, then we set the completion target entity
+    // to null and the containingNode to the compilationUnit.
+    //
+    // Note that if a token is not a candidate target, then none of the tokens
+    // that precede it are candidate targets either.  Therefore any entity
+    // whose last token is not a candidate target can be skipped.  This lets us
+    // prune the search to the point where no recursion is necessary; at each
+    // step in the process we know exactly which child node we need to proceed
+    // to.
+    AstNode containingNode = compilationUnit;
+    outerLoop: while (true) {
+      if (containingNode is Comment) {
+        // Comments are handled specially: we descend into any CommentReference
+        // child node that contains the cursor offset.
+        Comment comment = containingNode;
+        for (CommentReference commentReference in comment.references) {
+          if (commentReference.offset <= offset &&
+              offset <= commentReference.end) {
+            containingNode = commentReference;
+            continue outerLoop;
+          }
+        }
+      }
+      for (var entity in containingNode.childEntities) {
+        if (entity is Token) {
+          if (_isCandidateToken(entity, offset)) {
+            // Try to replace with a comment token.
+            Token commentToken = _getContainingCommentToken(entity, offset);
+            if (commentToken != null) {
+              return new CompletionTarget._(containingNode, commentToken, true);
+            }
+            // Target found.
+            return new CompletionTarget._(containingNode, entity, false);
+          } else {
+            // Since entity is a token, we don't need to look inside it; just
+            // proceed to the next entity.
+            continue;
+          }
+        } else if (entity is AstNode) {
+          // If the last token in the node isn't a candidate target, then
+          // neither the node nor any of its descendants can possibly be the
+          // completion target, so we can skip the node entirely.
+          if (!_isCandidateToken(entity.endToken, offset)) {
+            continue;
+          }
+
+          // If the node is a candidate target, then we are done.
+          if (_isCandidateNode(entity, offset)) {
+            // Check to see if the offset is in a preceding comment
+            Token commentToken =
+                _getContainingCommentToken(entity.beginToken, offset);
+            if (commentToken != null) {
+              entity = commentToken;
+              // If the preceding comment is dartdoc token, then update
+              // the containing node to be the dartdoc comment.
+              // Otherwise completion is not required.
+              Comment docComment =
+                  _getContainingDocComment(containingNode, commentToken);
+              if (docComment != null) {
+                containingNode = docComment;
+              } else {
+                return new CompletionTarget._(
+                    compilationUnit, commentToken, true);
+              }
+            }
+            return new CompletionTarget._(containingNode, entity, false);
+          }
+
+          // Otherwise, the completion target is somewhere inside the entity,
+          // so we need to jump to the start of the outer loop to examine its
+          // contents.
+          containingNode = entity;
+          continue outerLoop;
+        } else {
+          // Unexpected entity found (all entities in a parse tree should be
+          // AST nodes or tokens).
+          assert(false);
+        }
+      }
+
+      // No completion target found.  It should only be possible to reach here
+      // the first time through the outer loop (since we only jump to the start
+      // of the outer loop after determining that the completion target is
+      // inside an entity).  We can check that assumption by verifying that
+      // containingNode is still the compilationUnit.
+      assert(identical(containingNode, compilationUnit));
+
+      // Since no completion target was found, we set the completion target
+      // entity to null and use the compilationUnit as the parent.
+      return new CompletionTarget._(compilationUnit, null, false);
+    }
+  }
+
+  /**
+   * Create a [CompletionTarget] holding the given [containingNode] and
+   * [entity].
+   */
+  CompletionTarget._(AstNode containingNode, Object entity, this.isCommentText)
+      : this.containingNode = containingNode,
+        this.entity = entity,
+        this.argIndex = _computeArgIndex(containingNode, entity);
+
+  /**
+   * Return `true` if the target is a functional argument in an argument list.
+   * The target [AstNode] hierarchy *must* be resolved for this to work.
+   */
+  bool isFunctionalArgument() {
+    if (argIndex == null) {
+      return false;
+    }
+    AstNode argList = containingNode;
+    if (argList is! ArgumentList) {
+      return false;
+    }
+    AstNode parent = argList.parent;
+    if (parent is InstanceCreationExpression) {
+      DartType instType = parent.bestType;
+      if (instType != null) {
+        Element intTypeElem = instType.element;
+        if (intTypeElem is ClassElement) {
+          SimpleIdentifier constructorName = parent.constructorName.name;
+          ConstructorElement constructor = constructorName != null
+              ? intTypeElem.getNamedConstructor(constructorName.name)
+              : intTypeElem.unnamedConstructor;
+          return constructor != null &&
+              _isFunctionalParameter(constructor.parameters, argIndex);
+        }
+      }
+    } else if (parent is MethodInvocation) {
+      SimpleIdentifier methodName = parent.methodName;
+      if (methodName != null) {
+        Element methodElem = methodName.bestElement;
+        if (methodElem is MethodElement) {
+          return _isFunctionalParameter(methodElem.parameters, argIndex);
+        } else if (methodElem is FunctionElement) {
+          return _isFunctionalParameter(methodElem.parameters, argIndex);
+        }
+      }
+    }
+    return false;
+  }
+
+  /**
+   * Determine if the offset is contained in a preceding comment token
+   * and return that token, otherwise return `null`.
+   */
+  static Token _getContainingCommentToken(Token token, int offset) {
+    if (token == null) {
+      return null;
+    }
+    if (offset >= token.offset) {
+      return null;
+    }
+    token = token.precedingComments;
+    while (token != null) {
+      if (offset <= token.offset) {
+        return null;
+      }
+      if (offset <= token.end) {
+        if (token.type == TokenType.SINGLE_LINE_COMMENT || offset < token.end) {
+          return token;
+        }
+      }
+      token = token.next;
+    }
+    return null;
+  }
+
+  /**
+   * Determine if the given token is part of the given node's dart doc.
+   */
+  static Comment _getContainingDocComment(AstNode node, Token token) {
+    if (node is AnnotatedNode) {
+      Comment docComment = node.documentationComment;
+      if (docComment != null && docComment.tokens.contains(token)) {
+        return docComment;
+      }
+    }
+    return null;
+  }
+
+  /**
+   * Determine whether [node] could possibly be the [entity] for a
+   * [CompletionTarget] associated with the given [offset].
+   */
+  static bool _isCandidateNode(AstNode node, int offset) {
+    // If the node's first token is a keyword or identifier, then the node is a
+    // candidate entity if its first token is.
+    Token beginToken = node.beginToken;
+    if (beginToken.type == TokenType.KEYWORD ||
+        beginToken.type == TokenType.IDENTIFIER) {
+      return _isCandidateToken(beginToken, offset);
+    }
+
+    // Otherwise, the node is a candidate entity only if the offset is before
+    // the beginning of the node.  This ensures that completions within a token
+    // (e.g. inside a literal string or inside a comment) are evaluated within
+    // the context of the token itself.
+    return offset <= node.offset;
+  }
+
+  /**
+   * Determine whether [token] could possibly be the [entity] for a
+   * [CompletionTarget] associated with the given [offset].
+   */
+  static bool _isCandidateToken(Token token, int offset) {
+    // A token is considered a candidate entity if the cursor offset is (a)
+    // before the start of the token, (b) within the token, (c) at the end of
+    // the token and the token is a keyword or identifier, or (d) at the
+    // location of the token and the token is zero length.
+    if (offset < token.end) {
+      return true;
+    } else if (offset == token.end) {
+      return token.type == TokenType.KEYWORD ||
+          token.type == TokenType.IDENTIFIER ||
+          token.length == 0;
+    } else if (!token.isSynthetic) {
+      return false;
+    }
+    // If the current token is synthetic, then check the previous token
+    // because it may have been dropped from the parse tree
+    Token previous = token.previous;
+    if (offset < previous.end) {
+      return true;
+    } else if (offset == previous.end) {
+      return token.type == TokenType.KEYWORD ||
+          previous.type == TokenType.IDENTIFIER;
+    } else {
+      return false;
+    }
+  }
+
+  /**
+   * Return `true` if the parameter is a functional parameter.
+   */
+  static bool _isFunctionalParameter(
+      List<ParameterElement> parameters, int paramIndex) {
+    if (paramIndex < parameters.length) {
+      ParameterElement param = parameters[paramIndex];
+      DartType paramType = param.type;
+      if (param.parameterKind == ParameterKind.NAMED) {
+        // TODO(danrubel) handle named parameters
+        return false;
+      } else {
+        return paramType is FunctionType || paramType is FunctionTypeAlias;
+      }
+    }
+    return false;
+  }
+}
diff --git a/pkg/analysis_server/lib/src/provisional/refactoring/refactoring_core.dart b/pkg/analysis_server/lib/src/provisional/refactoring/refactoring_core.dart
new file mode 100644
index 0000000..086ce71
--- /dev/null
+++ b/pkg/analysis_server/lib/src/provisional/refactoring/refactoring_core.dart
@@ -0,0 +1,102 @@
+// 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 analysis_server.edit.refactoring.refactoring_core;
+
+import 'dart:async';
+
+import 'package:analysis_server/plugin/protocol/protocol.dart';
+import 'package:analyzer/src/generated/engine.dart';
+import 'package:analyzer/src/generated/source.dart';
+
+/**
+ * Abstract interface for all refactorings.
+ */
+abstract class Refactoring {
+  /**
+   * Return the ids of source edits that are not known to be valid.
+   *
+   * An edit is not known to be valid if there was insufficient type information
+   * for the server to be able to determine whether or not the code needs to be
+   * modified, such as when a member is being renamed and there is a reference
+   * to a member from an unknown type. This field will be omitted if the change
+   * field is omitted or if there are no potential edits for the refactoring.
+   */
+  List<String> get potentialEditIds;
+
+  /**
+   * Return the human readable name of this refactoring.
+   */
+  String get refactoringName;
+
+  /**
+   * Checks all conditions - [checkInitialConditions] and
+   * [checkFinalConditions] to decide if refactoring can be performed.
+   */
+  Future<RefactoringStatus> checkAllConditions();
+
+  /**
+   * Validates environment to check if this refactoring can be performed.
+   *
+   * This check may be slow, because many refactorings use search engine.
+   */
+  Future<RefactoringStatus> checkFinalConditions();
+
+  /**
+   * Validates arguments to check if this refactoring can be performed.
+   *
+   * This check should be quick because it is used often as arguments change.
+   */
+  Future<RefactoringStatus> checkInitialConditions();
+
+  /**
+   * Return the [Change] to apply to perform this refactoring.
+   */
+  Future<SourceChange> createChange();
+
+  /**
+   * Return `true` if the [Change] created by refactoring may be unsafe,
+   * so we want user to review the [Change] to ensure that he understands it.
+   */
+  bool requiresPreview();
+}
+
+/**
+ *
+ *
+ * Clients may implement this class when implementing plugins.
+ */
+abstract class RefactoringContributor {
+  /**
+   *
+   */
+  Refactoring createRefactoring(AnalysisContext context, RefactoringKind kind,
+      Source source, int offset, int length);
+
+  /**
+   *
+   */
+  List<RefactoringKind> getAvailableRefactorings(
+      AnalysisContext context, Source source, int offset, int length);
+}
+
+/**
+ *
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+abstract class RefactoringKind {
+  factory RefactoringKind(String name, bool requiresOptions) {
+  } // TODO(brianwilkerson) Redirect to impl class.
+  bool get requiresOptions;
+}
+
+/**
+ *
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+abstract class RefactoringStatus {
+  // TODO(brianwilkerson) Fill this in.
+}
diff --git a/pkg/analysis_server/lib/src/search/element_references.dart b/pkg/analysis_server/lib/src/search/element_references.dart
index 3f54327..d470afe 100644
--- a/pkg/analysis_server/lib/src/search/element_references.dart
+++ b/pkg/analysis_server/lib/src/search/element_references.dart
@@ -90,7 +90,7 @@
 
   SearchResult _newDeclarationResult(Element refElement) {
     int nameOffset = refElement.nameOffset;
-    int nameLength = refElement.name.length;
+    int nameLength = refElement.nameLength;
     SearchMatch searchMatch = new SearchMatch(MatchKind.DECLARATION, refElement,
         new SourceRange(nameOffset, nameLength), true, false);
     return newSearchResult_fromMatch(searchMatch);
diff --git a/pkg/analysis_server/lib/src/search/search_domain.dart b/pkg/analysis_server/lib/src/search/search_domain.dart
index 7fba8d8..c0650e0 100644
--- a/pkg/analysis_server/lib/src/search/search_domain.dart
+++ b/pkg/analysis_server/lib/src/search/search_domain.dart
@@ -6,12 +6,16 @@
 
 import 'dart:async';
 
+import 'package:analysis_server/plugin/index/index_core.dart';
 import 'package:analysis_server/src/analysis_server.dart';
 import 'package:analysis_server/src/constants.dart';
 import 'package:analysis_server/src/protocol_server.dart' as protocol;
 import 'package:analysis_server/src/search/element_references.dart';
 import 'package:analysis_server/src/search/type_hierarchy.dart';
+import 'package:analysis_server/src/services/index/index.dart';
+import 'package:analysis_server/src/services/index/indexable_file.dart';
 import 'package:analysis_server/src/services/search/search_engine.dart';
+import 'package:analyzer/src/generated/ast.dart';
 import 'package:analyzer/src/generated/element.dart';
 
 /**
@@ -25,9 +29,14 @@
   final AnalysisServer server;
 
   /**
+   * The [Index] for this server.
+   */
+  final Index index;
+
+  /**
    * The [SearchEngine] for this server.
    */
-  SearchEngine searchEngine;
+  final SearchEngine searchEngine;
 
   /**
    * The next search response id.
@@ -37,9 +46,10 @@
   /**
    * Initialize a newly created handler to handle requests for the given [server].
    */
-  SearchDomainHandler(this.server) {
-    searchEngine = server.searchEngine;
-  }
+  SearchDomainHandler(AnalysisServer server)
+      : server = server,
+        index = server.index,
+        searchEngine = server.searchEngine;
 
   Future findElementReferences(protocol.Request request) async {
     var params =
@@ -62,8 +72,37 @@
     }).where((Element element) {
       return element != null;
     }).toList();
-    // search
+    // prepare referenced file
+    String referencedFile = _getFileReferencedAt(params.file, params.offset);
+    // respond
     String searchId = (_nextSearchId++).toString();
+    var result = new protocol.SearchFindElementReferencesResult();
+    if (elements.isNotEmpty) {
+      result.id = searchId;
+      result.element = protocol.convertElement(elements.first);
+    } else if (referencedFile != null) {
+      result.id = searchId;
+      result.element =
+          new protocol.Element(protocol.ElementKind.FILE, referencedFile, 0);
+    }
+    _sendSearchResult(request, result);
+    // search for file
+    if (referencedFile != null) {
+      List<Location> locations = await index.getRelationships(
+          new IndexableFile(referencedFile), IndexConstants.IS_REFERENCED_BY);
+      List<protocol.SearchResult> results = <protocol.SearchResult>[];
+      for (Location location in locations) {
+        IndexableFile locationFile = location.indexable;
+        results.add(new protocol.SearchResult(
+            new protocol.Location(
+                locationFile.path, location.offset, location.length, -1, -1),
+            protocol.SearchResultKind.REFERENCE,
+            false,
+            []));
+      }
+      _sendSearchNotification(searchId, elements.isEmpty, results);
+    }
+    // search elements
     elements.forEach((Element element) async {
       var computer = new ElementReferencesComputer(searchEngine);
       List<protocol.SearchResult> results =
@@ -71,13 +110,6 @@
       bool isLast = identical(element, elements.last);
       _sendSearchNotification(searchId, isLast, results);
     });
-    // respond
-    var result = new protocol.SearchFindElementReferencesResult();
-    if (elements.isNotEmpty) {
-      result.id = searchId;
-      result.element = protocol.newElement_fromEngine(elements[0]);
-    }
-    _sendSearchResult(request, result);
   }
 
   Future findMemberDeclarations(protocol.Request request) async {
@@ -127,20 +159,34 @@
    */
   Future getTypeHierarchy(protocol.Request request) async {
     var params = new protocol.SearchGetTypeHierarchyParams.fromRequest(request);
-    await server.onAnalysisComplete;
+    String file = params.file;
+    // wait for analysis
+    if (params.superOnly == true) {
+      await server.onFileAnalysisComplete(file);
+    } else {
+      await server.onAnalysisComplete;
+    }
     // prepare element
-    List<Element> elements =
-        server.getElementsAtOffset(params.file, params.offset);
+    List<Element> elements = server.getElementsAtOffset(file, params.offset);
     if (elements.isEmpty) {
-      protocol.Response response =
-          new protocol.SearchGetTypeHierarchyResult().toResponse(request.id);
-      server.sendResponse(response);
+      _sendTypeHierarchyNull(request);
       return;
     }
     Element element = elements.first;
+    // maybe supertype hierarchy only
+    if (params.superOnly == true) {
+      TypeHierarchyComputer computer =
+          new TypeHierarchyComputer(searchEngine, element);
+      List<protocol.TypeHierarchyItem> items = computer.computeSuper();
+      protocol.Response response = new protocol.SearchGetTypeHierarchyResult(
+          hierarchyItems: items).toResponse(request.id);
+      server.sendResponse(response);
+      return;
+    }
     // prepare type hierarchy
-    TypeHierarchyComputer computer = new TypeHierarchyComputer(searchEngine);
-    List<protocol.TypeHierarchyItem> items = await computer.compute(element);
+    TypeHierarchyComputer computer =
+        new TypeHierarchyComputer(searchEngine, element);
+    List<protocol.TypeHierarchyItem> items = await computer.compute();
     protocol.Response response = new protocol.SearchGetTypeHierarchyResult(
         hierarchyItems: items).toResponse(request.id);
     server.sendResponse(response);
@@ -175,6 +221,31 @@
     return null;
   }
 
+  /**
+   * Return the full path of the file referenced in the given [file] at the
+   * given [offset], maybe `null`.
+   */
+  String _getFileReferencedAt(String file, int offset) {
+    List<AstNode> nodes = server.getNodesAtOffset(file, offset);
+    if (nodes.length == 1) {
+      AstNode node = nodes.single;
+      if (node is SimpleIdentifier &&
+          node.parent is LibraryIdentifier &&
+          node.parent.parent is LibraryDirective) {
+        LibraryDirective libraryDirective = node.parent.parent;
+        return libraryDirective?.element?.source?.fullName;
+      }
+      if (node is StringLiteral && node.parent is UriBasedDirective) {
+        UriBasedDirective uriBasedDirective = node.parent;
+        return uriBasedDirective.source?.fullName;
+      }
+      if (node is UriBasedDirective) {
+        return node.source?.fullName;
+      }
+    }
+    return null;
+  }
+
   void _sendSearchNotification(
       String searchId, bool isLast, Iterable<protocol.SearchResult> results) {
     server.sendNotification(
@@ -190,6 +261,12 @@
     server.sendResponse(response);
   }
 
+  void _sendTypeHierarchyNull(protocol.Request request) {
+    protocol.Response response =
+        new protocol.SearchGetTypeHierarchyResult().toResponse(request.id);
+    server.sendResponse(response);
+  }
+
   static protocol.SearchResult toResult(SearchMatch match) {
     return protocol.newSearchResult_fromMatch(match);
   }
diff --git a/pkg/analysis_server/lib/src/search/type_hierarchy.dart b/pkg/analysis_server/lib/src/search/type_hierarchy.dart
index c0c38ed..0a666f3 100644
--- a/pkg/analysis_server/lib/src/search/type_hierarchy.dart
+++ b/pkg/analysis_server/lib/src/search/type_hierarchy.dart
@@ -8,7 +8,7 @@
 import 'dart:collection';
 
 import 'package:analysis_server/src/protocol_server.dart'
-    show TypeHierarchyItem, newElement_fromEngine;
+    show TypeHierarchyItem, convertElement;
 import 'package:analysis_server/src/services/search/hierarchy.dart';
 import 'package:analysis_server/src/services/search/search_engine.dart';
 import 'package:analyzer/src/generated/element.dart';
@@ -19,35 +19,42 @@
 class TypeHierarchyComputer {
   final SearchEngine _searchEngine;
 
+  Element _pivotElement;
   LibraryElement _pivotLibrary;
   ElementKind _pivotKind;
-  bool _pivotFieldFinal;
   String _pivotName;
+  bool _pivotFieldFinal;
+  ClassElement _pivotClass;
 
   final List<TypeHierarchyItem> _items = <TypeHierarchyItem>[];
   final List<ClassElement> _itemClassElements = <ClassElement>[];
   final Map<Element, TypeHierarchyItem> _elementItemMap =
       new HashMap<Element, TypeHierarchyItem>();
 
-  TypeHierarchyComputer(this._searchEngine);
+  TypeHierarchyComputer(this._searchEngine, this._pivotElement) {
+    _pivotLibrary = _pivotElement.library;
+    _pivotKind = _pivotElement.kind;
+    _pivotName = _pivotElement.name;
+    // try to find enclosing ClassElement
+    Element element = _pivotElement;
+    if (_pivotElement is FieldElement) {
+      _pivotFieldFinal = (_pivotElement as FieldElement).isFinal;
+      element = _pivotElement.enclosingElement;
+    }
+    if (_pivotElement is ExecutableElement) {
+      element = _pivotElement.enclosingElement;
+    }
+    if (element is ClassElement) {
+      _pivotClass = element;
+    }
+  }
 
   /**
    * Returns the computed type hierarchy, maybe `null`.
    */
-  Future<List<TypeHierarchyItem>> compute(Element element) {
-    _pivotLibrary = element.library;
-    _pivotKind = element.kind;
-    _pivotName = element.name;
-    if (element is FieldElement) {
-      _pivotFieldFinal = (element as FieldElement).isFinal;
-      element = element.enclosingElement;
-    }
-    if (element is ExecutableElement &&
-        element.enclosingElement is ClassElement) {
-      element = element.enclosingElement;
-    }
-    if (element is ClassElement) {
-      InterfaceType type = element.type;
+  Future<List<TypeHierarchyItem>> compute() {
+    if (_pivotClass != null) {
+      InterfaceType type = _pivotClass.type;
       _createSuperItem(type);
       return _createSubclasses(_items[0], 0, type).then((_) {
         return new Future.value(_items);
@@ -56,6 +63,18 @@
     return new Future.value(null);
   }
 
+  /**
+   * Returns the computed super type only type hierarchy, maybe `null`.
+   */
+  List<TypeHierarchyItem> computeSuper() {
+    if (_pivotClass != null) {
+      InterfaceType type = _pivotClass.type;
+      _createSuperItem(type);
+      return _items;
+    }
+    return null;
+  }
+
   Future _createSubclasses(
       TypeHierarchyItem item, int itemId, InterfaceType type) {
     var future = getDirectSubClasses(_searchEngine, type.element);
@@ -66,14 +85,14 @@
         TypeHierarchyItem subItem = _elementItemMap[subElement];
         if (subItem != null) {
           int id = _items.indexOf(subItem);
-          subItem.subclasses.add(id);
+          item.subclasses.add(id);
           continue;
         }
         // create a subclass item
         ExecutableElement subMemberElement = _findMemberElement(subElement);
-        subItem = new TypeHierarchyItem(newElement_fromEngine(subElement),
+        subItem = new TypeHierarchyItem(convertElement(subElement),
             memberElement: subMemberElement != null
-                ? newElement_fromEngine(subMemberElement)
+                ? convertElement(subMemberElement)
                 : null,
             superclass: itemId);
         int subItemId = _items.length;
@@ -110,11 +129,10 @@
       }
       ClassElement classElement = type.element;
       ExecutableElement memberElement = _findMemberElement(classElement);
-      item = new TypeHierarchyItem(newElement_fromEngine(classElement),
+      item = new TypeHierarchyItem(convertElement(classElement),
           displayName: displayName,
-          memberElement: memberElement != null
-              ? newElement_fromEngine(memberElement)
-              : null);
+          memberElement:
+              memberElement != null ? convertElement(memberElement) : null);
       _elementItemMap[classElement] = item;
       itemId = _items.length;
       _items.add(item);
@@ -174,6 +192,9 @@
           result = mixinElement.lookUpSetter(_pivotName, _pivotLibrary);
         }
       }
+      if (result == _pivotElement) {
+        return null;
+      }
       if (result != null) {
         return result;
       }
diff --git a/pkg/analysis_server/lib/src/server/driver.dart b/pkg/analysis_server/lib/src/server/driver.dart
index 8097f94..f00f452 100644
--- a/pkg/analysis_server/lib/src/server/driver.dart
+++ b/pkg/analysis_server/lib/src/server/driver.dart
@@ -8,14 +8,14 @@
 import 'dart:io';
 import 'dart:math';
 
+import 'package:analysis_server/plugin/analysis/resolver_provider.dart';
 import 'package:analysis_server/src/analysis_server.dart';
-import 'package:analysis_server/src/context_manager.dart';
+import 'package:analysis_server/src/plugin/linter_plugin.dart';
 import 'package:analysis_server/src/plugin/server_plugin.dart';
 import 'package:analysis_server/src/server/http_server.dart';
 import 'package:analysis_server/src/server/stdio_server.dart';
 import 'package:analysis_server/src/socket_server.dart';
 import 'package:analysis_server/starter.dart';
-import 'package:analysis_server/uri/resolver_provider.dart';
 import 'package:analyzer/file_system/physical_file_system.dart';
 import 'package:analyzer/instrumentation/file_instrumentation.dart';
 import 'package:analyzer/instrumentation/instrumentation.dart';
@@ -25,7 +25,7 @@
 import 'package:analyzer/src/generated/sdk.dart';
 import 'package:analyzer/src/generated/sdk_io.dart';
 import 'package:args/args.dart';
-import 'package:plugin/manager.dart';
+import 'package:linter/src/plugin/linter_plugin.dart';
 import 'package:plugin/plugin.dart';
 
 /**
@@ -72,8 +72,13 @@
 
   /// Defines a flag.
   /// See [ArgParser.addFlag()].
-  void addFlag(String name, {String abbr, String help, bool defaultsTo: false,
-      bool negatable: true, void callback(bool value), bool hide: false}) {
+  void addFlag(String name,
+      {String abbr,
+      String help,
+      bool defaultsTo: false,
+      bool negatable: true,
+      void callback(bool value),
+      bool hide: false}) {
     _knownFlags.add(name);
     _parser.addFlag(name,
         abbr: abbr,
@@ -86,8 +91,13 @@
 
   /// Defines a value-taking option.
   /// See [ArgParser.addOption()].
-  void addOption(String name, {String abbr, String help, List<String> allowed,
-      Map<String, String> allowedHelp, String defaultsTo, void callback(value),
+  void addOption(String name,
+      {String abbr,
+      String help,
+      List<String> allowed,
+      Map<String, String> allowedHelp,
+      String defaultsTo,
+      void callback(value),
       bool allowMultiple: false}) {
     _knownFlags.add(name);
     _parser.addOption(name,
@@ -108,9 +118,9 @@
   /// flags and options defined by this parser, and returns the result. The
   /// values of any defined variables are captured in the given map.
   /// See [ArgParser].
-  ArgResults parse(
-      List<String> args, Map<String, String> definedVariables) => _parser
-      .parse(_filterUnknowns(parseDefinedVariables(args, definedVariables)));
+  ArgResults parse(List<String> args, Map<String, String> definedVariables) =>
+      _parser.parse(
+          _filterUnknowns(parseDefinedVariables(args, definedVariables)));
 
   List<String> parseDefinedVariables(
       List<String> args, Map<String, String> definedVariables) {
@@ -132,12 +142,10 @@
   }
 
   List<String> _filterUnknowns(List<String> args) {
-
     // Only filter args if the ignore flag is specified, or if
     // _alwaysIgnoreUnrecognized was set to true
     if (_alwaysIgnoreUnrecognized ||
         args.contains('--ignore-unrecognized-flags')) {
-
       // Filter all unrecognized flags and options.
       List<String> filtered = <String>[];
       for (int i = 0; i < args.length; ++i) {
@@ -199,6 +207,11 @@
   static const String CLIENT_VERSION = "client-version";
 
   /**
+   * The name of the option used to disable the use of the new task model.
+   */
+  static const String DISABLE_NEW_TASK_MODEL = "disable-new-task-model";
+
+  /**
    * The name of the option used to enable incremental resolution of API
    * changes.
    */
@@ -211,11 +224,6 @@
   static const String ENABLE_INSTRUMENTATION_OPTION = "enable-instrumentation";
 
   /**
-   * The name of the option used to enable the use of the new task model.
-   */
-  static const String ENABLE_NEW_TASK_MODEL = "enable-new-task-model";
-
-  /**
    * The name of the option used to set the file read mode.
    */
   static const String FILE_READ_MODE = "file-read-mode";
@@ -291,16 +299,9 @@
   InstrumentationServer instrumentationServer;
 
   /**
-   * The context manager used to create analysis contexts within each of the
-   * analysis roots.
-   */
-  ContextManager contextManager;
-
-  /**
    * The package resolver provider used to override the way package URI's are
    * resolved in some contexts.
    */
-  @deprecated
   ResolverProvider packageResolverProvider;
 
   /**
@@ -380,12 +381,14 @@
     //
     // Initialize the instrumentation service.
     //
-    if (instrumentationServer != null) {
-      String filePath = results[INSTRUMENTATION_LOG_FILE];
-      if (filePath != null) {
-        instrumentationServer = new MulticastInstrumentationServer(
-            [instrumentationServer, new FileInstrumentationServer(filePath)]);
-      }
+    String logFilePath = results[INSTRUMENTATION_LOG_FILE];
+    if (logFilePath != null) {
+      FileInstrumentationServer fileBasedServer =
+          new FileInstrumentationServer(logFilePath);
+      instrumentationServer = instrumentationServer != null
+          ? new MulticastInstrumentationServer(
+              [instrumentationServer, fileBasedServer])
+          : fileBasedServer;
     }
     InstrumentationService service =
         new InstrumentationService(instrumentationServer);
@@ -395,24 +398,27 @@
     //
     // Enable the new task model, if appropriate.
     //
-    if (results[ENABLE_NEW_TASK_MODEL]) {
-      AnalysisEngine.instance.useTaskModel = true;
-    }
+    AnalysisEngine.instance.useTaskModel = !results[DISABLE_NEW_TASK_MODEL];
     //
     // Process all of the plugins so that extensions are registered.
     //
     ServerPlugin serverPlugin = new ServerPlugin();
     List<Plugin> plugins = <Plugin>[];
-    plugins.add(AnalysisEngine.instance.enginePlugin);
     plugins.add(serverPlugin);
     plugins.addAll(_userDefinedPlugins);
-    ExtensionManager manager = new ExtensionManager();
-    manager.processPlugins(plugins);
+    plugins.add(linterPlugin);
+    plugins.add(linterServerPlugin);
+
+    // Defer to the extension manager in AE for plugin registration.
+    AnalysisEngine.instance.userDefinedPlugins = plugins;
+    // Force registration.
+    AnalysisEngine.instance.taskManager;
+
     //
     // Create the sockets and start listening for requests.
     //
     socketServer = new SocketServer(analysisServerOptions, defaultSdk, service,
-        serverPlugin, contextManager, packageResolverProvider);
+        serverPlugin, packageResolverProvider);
     httpServer = new HttpAnalysisServer(socketServer);
     stdioServer = new StdioAnalysisServer(socketServer);
     socketServer.userDefinedPlugins = _userDefinedPlugins;
@@ -430,9 +436,8 @@
         exit(0);
       });
     },
-        print: results[INTERNAL_PRINT_TO_CONSOLE]
-            ? null
-            : httpServer.recordPrint);
+        print:
+            results[INTERNAL_PRINT_TO_CONSOLE] ? null : httpServer.recordPrint);
   }
 
   /**
@@ -447,16 +452,17 @@
         dynamic exception, StackTrace stackTrace) {
       service.logPriorityException(exception, stackTrace);
       AnalysisServer analysisServer = socketServer.analysisServer;
-      analysisServer.sendServerErrorNotification(exception, stackTrace);
+      analysisServer.sendServerErrorNotification(
+          'Captured exception', exception, stackTrace);
       throw exception;
     };
     Function printFunction = print == null
         ? null
         : (Zone self, ZoneDelegate parent, Zone zone, String line) {
-      // Note: we don't pass the line on to stdout, because that is reserved
-      // for communication to the client.
-      print(line);
-    };
+            // Note: we don't pass the line on to stdout, because that is reserved
+            // for communication to the client.
+            print(line);
+          };
     ZoneSpecification zoneSpecification = new ZoneSpecification(
         handleUncaughtError: errorFunction, print: printFunction);
     return runZoned(callback, zoneSpecification: zoneSpecification);
@@ -471,6 +477,11 @@
     parser.addOption(CLIENT_ID,
         help: "an identifier used to identify the client");
     parser.addOption(CLIENT_VERSION, help: "the version of the client");
+    parser.addFlag(DISABLE_NEW_TASK_MODEL,
+        help: "disable the use of the new task model",
+        defaultsTo: false,
+        hide: true,
+        negatable: false);
     parser.addFlag(ENABLE_INCREMENTAL_RESOLUTION_API,
         help: "enable using incremental resolution for API changes",
         defaultsTo: false,
@@ -479,11 +490,6 @@
         help: "enable sending instrumentation information to a server",
         defaultsTo: false,
         negatable: false);
-    parser.addFlag(ENABLE_NEW_TASK_MODEL,
-        help: "enable the use of the new task model",
-        defaultsTo: false,
-        hide: true,
-        negatable: false);
     parser.addFlag(HELP_OPTION,
         help: "print this help message without starting a server",
         defaultsTo: false,
@@ -495,14 +501,15 @@
         defaultsTo: false,
         negatable: false);
     parser.addOption(INSTRUMENTATION_LOG_FILE,
-        help: "the path of the file to which instrumentation data will be written");
+        help:
+            "the path of the file to which instrumentation data will be written");
     parser.addFlag(INTERNAL_PRINT_TO_CONSOLE,
         help: "enable sending `print` output to the console",
         defaultsTo: false,
         negatable: false);
     parser.addOption(PORT_OPTION,
         help: "the http diagnostic port on which the server provides"
-        " status and performance information");
+            " status and performance information");
     parser.addOption(INTERNAL_DELAY_FREQUENCY);
     parser.addOption(SDK_OPTION, help: "[path] the path to the sdk");
     parser.addFlag(NO_ERROR_NOTIFICATION,
@@ -521,10 +528,10 @@
             "the file offset and range information incorrect.",
         allowed: ["as-is", "normalize-eol-always"],
         allowedHelp: {
-      "as-is": "file contents are read as-is, no file changes occur",
-      "normalize-eol-always":
-          r'file contents normalize the end of line characters to the single character new line `\n`'
-    },
+          "as-is": "file contents are read as-is, no file changes occur",
+          "normalize-eol-always":
+              r'file contents normalize the end of line characters to the single character new line `\n`'
+        },
         defaultsTo: "as-is");
 
     return parser;
@@ -546,7 +553,8 @@
   String _readUuid(InstrumentationService service) {
     File uuidFile = new File(PhysicalResourceProvider.INSTANCE
         .getStateLocation('.instrumentation')
-        .getChild('uuid.txt').path);
+        .getChild('uuid.txt')
+        .path);
     try {
       if (uuidFile.existsSync()) {
         String uuid = uuidFile.readAsStringSync();
diff --git a/pkg/analysis_server/lib/src/server/http_server.dart b/pkg/analysis_server/lib/src/server/http_server.dart
index 3372933..c047d1f 100644
--- a/pkg/analysis_server/lib/src/server/http_server.dart
+++ b/pkg/analysis_server/lib/src/server/http_server.dart
@@ -76,8 +76,13 @@
    * Begin serving HTTP requests over the given port.
    */
   void serveHttp(int port) {
-    _server = HttpServer.bind(InternetAddress.LOOPBACK_IP_V4, port);
-    _server.then(_handleServer);
+    try {
+      _server = HttpServer.bind(InternetAddress.LOOPBACK_IP_V4, port);
+      _server.then(_handleServer);
+    } catch (exception) {
+      // We were unable to start the server, and there's nothing we can do about
+      // it.
+    }
   }
 
   /**
diff --git a/pkg/analysis_server/lib/src/services/completion/arglist_contributor.dart b/pkg/analysis_server/lib/src/services/completion/arglist_contributor.dart
index 56a6d73..4f7780d 100644
--- a/pkg/analysis_server/lib/src/services/completion/arglist_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/arglist_contributor.dart
@@ -19,8 +19,13 @@
     DartCompletionRequest request, List<String> namedArgs, String name) {
   if (name != null && name.length > 0 && !namedArgs.contains(name)) {
     request.addSuggestion(new CompletionSuggestion(
-        CompletionSuggestionKind.NAMED_ARGUMENT, DART_RELEVANCE_NAMED_PARAMETER,
-        '$name: ', name.length + 2, 0, false, false));
+        CompletionSuggestionKind.NAMED_ARGUMENT,
+        DART_RELEVANCE_NAMED_PARAMETER,
+        '$name: ',
+        name.length + 2,
+        0,
+        false,
+        false));
   }
 }
 
@@ -136,6 +141,21 @@
           }
         }
       }
+      String constructorName;
+      if (parent is Annotation && parent.name != null) {
+        constructorName = parent.name.toSource();
+      }
+      if (parent is InstanceCreationExpression &&
+          parent.constructorName != null) {
+        constructorName = parent.constructorName.toSource();
+      }
+      if (constructorName != null && constructorName.length > 0) {
+        if (new _LocalArgSuggestionBuilder(
+            request, request.offset, constructorName).visit(node)) {
+          return null;
+        }
+        return new _ArgSuggestionBuilder(request, constructorName);
+      }
     }
     return null;
   }
@@ -169,6 +189,15 @@
         }
       }
     }
+    if (parent is InstanceCreationExpression) {
+      ConstructorName constructorName = parent.constructorName;
+      if (constructorName != null) {
+        ConstructorElement element = constructorName.staticElement;
+        if (element is ExecutableElement) {
+          _addSuggestions(element.parameters);
+        }
+      }
+    }
     return new Future.value(false);
   }
 
@@ -189,8 +218,13 @@
     }
     completion.write(')');
     CompletionSuggestion suggestion = new CompletionSuggestion(
-        CompletionSuggestionKind.ARGUMENT_LIST, DART_RELEVANCE_HIGH,
-        completion.toString(), completion.length, 0, false, false);
+        CompletionSuggestionKind.ARGUMENT_LIST,
+        DART_RELEVANCE_HIGH,
+        completion.toString(),
+        completion.length,
+        0,
+        false,
+        false);
     suggestion.parameterNames = paramNames;
     suggestion.parameterTypes = paramTypes;
     request.addSuggestion(suggestion);
@@ -211,13 +245,15 @@
     }
     Iterable<ParameterElement> requiredParam = parameters.where(
         (ParameterElement p) => p.parameterKind == ParameterKind.REQUIRED);
-    if (requiredParam.length > 0 && _isEmptyArgList(request)) {
+    int requiredCount = requiredParam.length;
+    if (requiredCount > 0 && _isEmptyArgList(request)) {
       _addArgListSuggestion(requiredParam);
       return;
     }
-    if (_isAppendingToArgList(request) &&
-        _argCount(request) > requiredParam.length) {
-      _addDefaultParamSuggestions(parameters);
+    if (_isAppendingToArgList(request)) {
+      if (requiredCount == 0 || requiredCount < _argCount(request)) {
+        _addDefaultParamSuggestions(parameters);
+      }
     }
   }
 
@@ -243,7 +279,26 @@
       : super(offset);
 
   @override
-  void declaredClass(ClassDeclaration declaration) {}
+  void declaredClass(ClassDeclaration declaration) {
+    String className = null;
+    if (declaration.name != null) {
+      className = declaration.name.name;
+    }
+    if (className != null && className.length > 0) {
+      for (ClassMember member in declaration.members) {
+        if (member is ConstructorDeclaration) {
+          String selector = className;
+          if (member.name != null) {
+            selector = '$selector.${member.name.name}';
+          }
+          if (selector == name) {
+            _addSuggestions(member.parameters);
+            finished();
+          }
+        }
+      }
+    }
+  }
 
   @override
   void declaredClassTypeAlias(ClassTypeAlias declaration) {}
@@ -305,8 +360,13 @@
     }
     completion.write(')');
     CompletionSuggestion suggestion = new CompletionSuggestion(
-        CompletionSuggestionKind.ARGUMENT_LIST, DART_RELEVANCE_HIGH,
-        completion.toString(), completion.length, 0, false, false);
+        CompletionSuggestionKind.ARGUMENT_LIST,
+        DART_RELEVANCE_HIGH,
+        completion.toString(),
+        completion.length,
+        0,
+        false,
+        false);
     suggestion.parameterNames = paramNames;
     suggestion.parameterTypes = paramTypes;
     request.addSuggestion(suggestion);
@@ -330,13 +390,15 @@
     }
     Iterable<FormalParameter> requiredParam = parameters.parameters
         .where((FormalParameter p) => p.kind == ParameterKind.REQUIRED);
-    if (requiredParam.length > 0 && _isEmptyArgList(request)) {
+    int requiredCount = requiredParam.length;
+    if (requiredCount > 0 && _isEmptyArgList(request)) {
       _addArgListSuggestion(requiredParam);
       return;
     }
-    if (_isAppendingToArgList(request) &&
-        _argCount(request) > requiredParam.length) {
-      _addDefaultParamSuggestions(parameters);
+    if (_isAppendingToArgList(request)) {
+      if (requiredCount == 0 || requiredCount < _argCount(request)) {
+        _addDefaultParamSuggestions(parameters);
+      }
     }
   }
 
diff --git a/pkg/analysis_server/lib/src/services/completion/combinator_contributor.dart b/pkg/analysis_server/lib/src/services/completion/combinator_contributor.dart
index 402d4a2..a8ef022 100644
--- a/pkg/analysis_server/lib/src/services/completion/combinator_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/combinator_contributor.dart
@@ -67,7 +67,7 @@
 class _CombinatorSuggestionBuilder extends LibraryElementSuggestionBuilder {
   _CombinatorSuggestionBuilder(
       DartCompletionRequest request, CompletionSuggestionKind kind)
-      : super(request, kind, false);
+      : super(request, kind, false, false);
 
   Future<bool> execute(AstNode node) {
     var directive = node.getAncestor((parent) => parent is NamespaceDirective);
diff --git a/pkg/analysis_server/lib/src/services/completion/common_usage_computer.dart b/pkg/analysis_server/lib/src/services/completion/common_usage_computer.dart
index 70f1542..e3c44ce 100644
--- a/pkg/analysis_server/lib/src/services/completion/common_usage_computer.dart
+++ b/pkg/analysis_server/lib/src/services/completion/common_usage_computer.dart
@@ -7,7 +7,10 @@
 import 'package:analysis_server/src/protocol_server.dart' as protocol;
 import 'package:analysis_server/src/protocol_server.dart'
     show CompletionSuggestion, CompletionSuggestionKind;
-import 'package:analysis_server/src/services/completion/dart_completion_manager.dart';
+import 'package:analysis_server/src/provisional/completion/completion_dart.dart';
+import 'package:analysis_server/src/services/completion/contribution_sorter.dart';
+import 'package:analysis_server/src/services/completion/dart_completion_manager.dart'
+    show DART_RELEVANCE_COMMON_USAGE;
 import 'package:analyzer/src/generated/ast.dart';
 import 'package:analyzer/src/generated/element.dart';
 
@@ -15,9 +18,10 @@
 
 /**
  * A computer for adjusting the relevance of completions computed by others
- * based upon common Dart usage patterns.
+ * based upon common Dart usage patterns. This is a long-lived object
+ * that should not maintain state between calls to it's [sort] method.
  */
-class CommonUsageComputer {
+class CommonUsageComputer implements ContributionSorter {
   /**
    * A map of <library>.<classname> to an ordered list of method names,
    * field names, getter names, and named constructors.
@@ -28,23 +32,10 @@
 
   CommonUsageComputer([this.selectorRelevance = defaultSelectorRelevance]);
 
-  /**
-   * Adjusts the relevance based on the given completion context.
-   * The compilation unit and completion node
-   * in the given completion context may not be resolved.
-   * This method should execute quickly and not block waiting for any analysis.
-   */
-  void computeFast(DartCompletionRequest request) {
-    _update(request);
-  }
-
-  /**
-   * Adjusts the relevance based on the given completion context.
-   * The compilation unit and completion node
-   * in the given completion context are resolved.
-   */
-  void computeFull(DartCompletionRequest request) {
-    _update(request);
+  @override
+  void sort(DartCompletionRequest request,
+      Iterable<CompletionSuggestion> suggestions) {
+    _update(request, suggestions);
   }
 
   /**
@@ -52,7 +43,8 @@
    * The compilation unit and completion node
    * in the given completion context may not be resolved.
    */
-  void _update(DartCompletionRequest request) {
+  void _update(DartCompletionRequest request,
+      Iterable<CompletionSuggestion> suggestions) {
     var visitor = new _BestTypeVisitor(request.target.entity);
     DartType type = request.target.containingNode.accept(visitor);
     if (type != null) {
@@ -60,7 +52,7 @@
       if (typeElem != null) {
         LibraryElement libElem = typeElem.library;
         if (libElem != null) {
-          _updateInvocationRelevance(request, type, libElem);
+          _updateInvocationRelevance(request, type, libElem, suggestions);
         }
       }
     }
@@ -70,12 +62,12 @@
    * Adjusts the relevance of all method suggestions based upon the given
    * target type and library.
    */
-  void _updateInvocationRelevance(
-      DartCompletionRequest request, DartType type, LibraryElement libElem) {
+  void _updateInvocationRelevance(DartCompletionRequest request, DartType type,
+      LibraryElement libElem, Iterable<CompletionSuggestion> suggestions) {
     String typeName = type.name;
     List<String> selectors = selectorRelevance['${libElem.name}.${typeName}'];
     if (selectors != null) {
-      for (CompletionSuggestion suggestion in request.suggestions) {
+      for (CompletionSuggestion suggestion in suggestions) {
         protocol.Element element = suggestion.element;
         if (element != null &&
             (element.kind == protocol.ElementKind.CONSTRUCTOR ||
@@ -99,7 +91,6 @@
  * An [AstVisitor] used to determine the best defining type of a node.
  */
 class _BestTypeVisitor extends GeneralizingAstVisitor {
-
   /**
    * The entity which the completed text will replace (or which will be
    * displaced once the completed text is inserted).  This may be an AstNode or
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 a8ed44b..68fa732 100644
--- a/pkg/analysis_server/lib/src/services/completion/completion_core.dart
+++ b/pkg/analysis_server/lib/src/services/completion/completion_core.dart
@@ -4,7 +4,7 @@
 
 library analysis_server.src.services.completion.completion_dart;
 
-import 'package:analysis_server/completion/completion_core.dart';
+import 'package:analysis_server/src/provisional/completion/completion_core.dart';
 import 'package:analyzer/file_system/file_system.dart';
 import 'package:analyzer/src/generated/engine.dart';
 import 'package:analyzer/src/generated/source.dart';
diff --git a/pkg/analysis_server/lib/src/services/completion/completion_dart.dart b/pkg/analysis_server/lib/src/services/completion/completion_dart.dart
index 2dd4eeb..1cfff04 100644
--- a/pkg/analysis_server/lib/src/services/completion/completion_dart.dart
+++ b/pkg/analysis_server/lib/src/services/completion/completion_dart.dart
@@ -4,8 +4,9 @@
 
 library analysis_server.src.services.completion.completion_dart;
 
-import 'package:analysis_server/completion/completion_core.dart';
-import 'package:analysis_server/completion/completion_dart.dart';
+import 'package:analysis_server/src/provisional/completion/completion_core.dart';
+import 'package:analysis_server/src/provisional/completion/completion_dart.dart';
+import 'package:analysis_server/src/provisional/completion/dart/completion_target.dart';
 import 'package:analysis_server/src/services/completion/completion_core.dart';
 import 'package:analyzer/src/generated/ast.dart';
 
@@ -25,10 +26,16 @@
   final bool isResolved;
 
   /**
+   * The completion target.  This determines what part of the parse tree
+   * will receive the newly inserted text.
+   */
+  final CompletionTarget target;
+
+  /**
    * Initialize a newly created completion request based on the given arguments.
    */
   DartCompletionRequestImpl(
-      CompletionRequest request, this.unit, this.isResolved)
+      CompletionRequest request, this.unit, this.isResolved, this.target)
       : super(request.context, request.resourceProvider, request.source,
-          request.offset);
+            request.offset);
 }
diff --git a/pkg/analysis_server/lib/src/services/completion/completion_manager.dart b/pkg/analysis_server/lib/src/services/completion/completion_manager.dart
index 986cc8b..2ba4340 100644
--- a/pkg/analysis_server/lib/src/services/completion/completion_manager.dart
+++ b/pkg/analysis_server/lib/src/services/completion/completion_manager.dart
@@ -6,10 +6,10 @@
 
 import 'dart:async';
 
-import 'package:analysis_server/completion/completion_core.dart'
-    show CompletionRequest, CompletionResult;
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/analysis_server.dart';
-import 'package:analysis_server/src/protocol.dart';
+import 'package:analysis_server/src/provisional/completion/completion_core.dart'
+    show CompletionRequest, CompletionResult;
 import 'package:analysis_server/src/services/completion/dart_completion_manager.dart';
 import 'package:analysis_server/src/services/search/search_engine.dart';
 import 'package:analyzer/file_system/file_system.dart';
@@ -21,7 +21,6 @@
  * for use in the next code completion.
  */
 abstract class CompletionCache {
-
   /**
    * The context in which the completion was computed.
    */
@@ -39,7 +38,6 @@
  * Manages completion contributors for a given completion request.
  */
 abstract class CompletionManager {
-
   /**
    * The context in which the completion was computed.
    */
@@ -222,7 +220,6 @@
  * Encapsulates information specific to a particular completion request.
  */
 class CompletionRequestImpl implements CompletionRequest {
-
   /**
    * The underlying analysis server for this completion request.
    */
@@ -247,7 +244,6 @@
  * Code completion result generated by an [CompletionManager].
  */
 class CompletionResultImpl implements CompletionResult {
-
   /**
    * The length of the text to be replaced if the remainder of the identifier
    * containing the cursor is to be replaced when the suggestion is applied
@@ -277,11 +273,9 @@
   CompletionResultImpl(this.replacementOffset, this.replacementLength,
       this.suggestions, this.last);
 
-  @override
-  // TODO(brianwilkerson) Figure out whether this is correct.
-  bool get hasNewSuggestions => suggestions.isNotEmpty;
-
-  @override
+  /**
+   * Return `true` if this is the last completion result that will be produced.
+   */
   bool get isLast => last;
 }
 
@@ -298,7 +292,6 @@
  * The performance of an operation when computing code completion.
  */
 class OperationPerformance {
-
   /**
    * The name of the operation
    */
diff --git a/pkg/analysis_server/lib/src/services/completion/completion_target.dart b/pkg/analysis_server/lib/src/services/completion/completion_target.dart
deleted file mode 100644
index 7c7badc..0000000
--- a/pkg/analysis_server/lib/src/services/completion/completion_target.dart
+++ /dev/null
@@ -1,345 +0,0 @@
-import 'package:analyzer/src/generated/ast.dart';
-import 'package:analyzer/src/generated/element.dart';
-import 'package:analyzer/src/generated/scanner.dart';
-import 'package:analyzer/src/generated/utilities_dart.dart';
-
-int _computeArgIndex(AstNode containingNode, Object entity) {
-  var argList = containingNode;
-  if (argList is ArgumentList) {
-    NodeList<Expression> args = argList.arguments;
-    for (int index = 0; index < args.length; ++index) {
-      if (entity == args[index]) {
-        return index;
-      }
-    }
-    if (args.isEmpty) {
-      return 0;
-    }
-  }
-  return null;
-}
-
-/**
- * A CompletionTarget represents an edge in the parse tree which connects an
- * AST node (the [containingNode] of the completion) to one of its children
- * (the [entity], which represents the place in the parse tree where the newly
- * completed text will be inserted).
- *
- * To illustrate, consider the following snippet of code, and its associated
- * parse tree.  (T's represent tokens, N's represent AST nodes.  Some trivial
- * AST nodes are not shown).
- *
- *            ___N        (function declaration)
- *           /    \
- *          /    __N_______  (function body)
- *         /    /  |a      \
- *        /    /   N______  \  (statement)
- *       /    /   /       \  \
- *      /    /   N____     \  \  (assignment expression)
- *     |    /   /|    \     \  \
- *     .   |   / |    _N___  \  |  ("as" expression)
- *     .   |  |  |   / |   \c | |
- *     .   |  N  |  N  |b   N | |  (simple identifiers)
- *         |  |  |  |  |    | | |
- *         T  T  T  T  T    T T T
- *     m() { foo = bar as  Baz; }
- *
- * The Completion target is usually placed as high in the tree as possible so
- * that we can produce the most meaningful completions with minimal effort.
- * For instance, if the cursor is inside the identifier "foo", the completion
- * target will be the edge marked "a", so that we will produce all completions
- * that could possibly start a statement, even those which would conflict with
- * the current parse (such as the keyword "for", which begins a "for"
- * statement).  As a consequence of this, the [entity] will usually not be the
- * first child of the [containingNode] node.
- *
- * Note that the [containingNode] is always an AST node, but the [entity] may
- * not be.  For instance, if the cursor is inside the keyword "as", the
- * completion target will be the edge marked "b", so the [entity] is the token
- * "as".
- *
- * If the cursor is between tokens, the completion target is usually associated
- * with the token that follows the cursor (since that's the token that will be
- * displaced when the new text is inserted).  For example, if the cursor is
- * after the "{" character, then the completion target will be the edge marked
- * "a", just as it is if the cursor is inside the identifier "foo".  However
- * there is one exception: if the cursor is at the rightmost edge of a keyword
- * or identifier, then the completion target is associated with that token,
- * since any further letters typed will change the meaning of the identifier or
- * keyword, rather than creating a new token.  So for instance, if the cursor
- * is just after the "s" of "as", the completion target will be the edge marked
- * "b", but if the cursor target is after the first space following "as", then
- * the completion target will be the edge marked "c".
- *
- * If the file is empty, or the cursor is after all the text in the file, then
- * there may be no edge in the parse tree which is appropriate to act as the
- * completion target; in this case, [entity] is set to null and
- * [containingNode] is set to the CompilationUnit.
- */
-class CompletionTarget {
-  /**
-   * The context in which the completion is occurring.  This is the AST node
-   * which is a direct parent of [entity].
-   */
-  final AstNode containingNode;
-
-  /**
-   * The entity which the completed text will replace (or which will be
-   * displaced once the completed text is inserted).  This may be an AstNode or
-   * a Token, or it may be null if the cursor is after all tokens in the file.
-   *
-   * Usually, the entity won't be the first child of the [containingNode] (this
-   * is a consequence of placing the completion target as high in the tree as
-   * possible).  However, there is one exception: when the cursor is inside of
-   * a multi-character token which is not a keyword or identifier (e.g. a
-   * comment, or a token like "+=", the entity will be always be the token.
-   */
-  final Object entity;
-
-  /**
-   * If the target is an argument in an [ArgumentList], then this is the index
-   * of the argument in the list, otherwise this is `null`.
-   */
-  final int argIndex;
-
-  /**
-   * Compute the appropriate [CompletionTarget] for the given [offset] within
-   * the [compilationUnit].
-   */
-  factory CompletionTarget.forOffset(
-      CompilationUnit compilationUnit, int offset) {
-    // The precise algorithm is as follows.  We perform a depth-first search of
-    // all edges in the parse tree (both those that point to AST nodes and
-    // those that point to tokens), visiting parents before children.  The
-    // first edge which points to an entity satisfying either _isCandidateToken
-    // or _isCandidateNode is the completion target.  If no edge is found that
-    // satisfies these two predicates, then we set the completion target entity
-    // to null and the containingNode to the compilationUnit.
-    //
-    // Note that if a token is not a candidate target, then none of the tokens
-    // that precede it are candidate targets either.  Therefore any entity
-    // whose last token is not a candidate target can be skipped.  This lets us
-    // prune the search to the point where no recursion is necessary; at each
-    // step in the process we know exactly which child node we need to proceed
-    // to.
-    AstNode containingNode = compilationUnit;
-    outerLoop: while (true) {
-      if (containingNode is Comment) {
-        // Comments are handled specially: we descend into any CommentReference
-        // child node that contains the cursor offset.
-        Comment comment = containingNode;
-        for (CommentReference commentReference in comment.references) {
-          if (commentReference.offset <= offset &&
-              offset <= commentReference.end) {
-            containingNode = commentReference;
-            continue outerLoop;
-          }
-        }
-      }
-      for (var entity in containingNode.childEntities) {
-        if (entity is Token) {
-          if (_isCandidateToken(entity, offset)) {
-            // Target found.
-            return new CompletionTarget._(containingNode, entity);
-          } else {
-            // Since entity is a token, we don't need to look inside it; just
-            // proceed to the next entity.
-            continue;
-          }
-        } else if (entity is AstNode) {
-          // If the last token in the node isn't a candidate target, then
-          // neither the node nor any of its descendants can possibly be the
-          // completion target, so we can skip the node entirely.
-          if (!_isCandidateToken(entity.endToken, offset)) {
-            continue;
-          }
-
-          // If the node is a candidate target, then we are done.
-          if (_isCandidateNode(entity, offset)) {
-            // Check to see if the offset is in a preceeding comment
-            Token commentToken = _getContainingCommentToken(entity, offset);
-            if (commentToken != null) {
-              entity = commentToken;
-              // If the preceeding comment is dartdoc token then update
-              // the containing node to be the dartdoc comment
-              Comment docComment =
-                  _getContainingDocComment(containingNode, commentToken);
-              if (docComment != null) {
-                containingNode = docComment;
-              }
-            }
-            return new CompletionTarget._(containingNode, entity);
-          }
-
-          // Otherwise, the completion target is somewhere inside the entity,
-          // so we need to jump to the start of the outer loop to examine its
-          // contents.
-          containingNode = entity;
-          continue outerLoop;
-        } else {
-          // Unexpected entity found (all entities in a parse tree should be
-          // AST nodes or tokens).
-          assert(false);
-        }
-      }
-
-      // No completion target found.  It should only be possible to reach here
-      // the first time through the outer loop (since we only jump to the start
-      // of the outer loop after determining that the completion target is
-      // inside an entity).  We can check that assumption by verifying that
-      // containingNode is still the compilationUnit.
-      assert(identical(containingNode, compilationUnit));
-
-      // Since no completion target was found, we set the completion target
-      // entity to null and use the compilationUnit as the parent.
-      return new CompletionTarget._(compilationUnit, null);
-    }
-  }
-
-  /**
-   * Create a [CompletionTarget] holding the given [containingNode] and
-   * [entity].
-   */
-  CompletionTarget._(AstNode containingNode, Object entity)
-      : this.containingNode = containingNode,
-        this.entity = entity,
-        this.argIndex = _computeArgIndex(containingNode, entity);
-
-  /**
-   * Return `true` if the target is a functional argument in an argument list.
-   * The target [AstNode] hierarchy *must* be resolved for this to work.
-   */
-  bool isFunctionalArgument() {
-    if (argIndex == null) {
-      return false;
-    }
-    AstNode argList = containingNode;
-    if (argList is! ArgumentList) {
-      return false;
-    }
-    AstNode parent = argList.parent;
-    if (parent is InstanceCreationExpression) {
-      DartType instType = parent.bestType;
-      if (instType != null) {
-        Element intTypeElem = instType.element;
-        if (intTypeElem is ClassElement) {
-          SimpleIdentifier constructorName = parent.constructorName.name;
-          ConstructorElement constructor = constructorName != null
-              ? intTypeElem.getNamedConstructor(constructorName.name)
-              : intTypeElem.unnamedConstructor;
-          return constructor != null &&
-              _isFunctionalParameter(constructor.parameters, argIndex);
-        }
-      }
-    } else if (parent is MethodInvocation) {
-      SimpleIdentifier methodName = parent.methodName;
-      if (methodName != null) {
-        Element methodElem = methodName.bestElement;
-        if (methodElem is MethodElement) {
-          return _isFunctionalParameter(methodElem.parameters, argIndex);
-        } else if (methodElem is FunctionElement) {
-          return _isFunctionalParameter(methodElem.parameters, argIndex);
-        }
-      }
-    }
-    return false;
-  }
-
-  /**
-   * Determine if the offset is contained in a preceeding comment token
-   * and return that token, otherwise return `null`.
-   */
-  static Token _getContainingCommentToken(AstNode node, int offset) {
-    if (offset >= node.offset) {
-      return null;
-    }
-    Token token = node.beginToken;
-    if (token == null) {
-      return null;
-    }
-    token = token.precedingComments;
-    while (token != null) {
-      if (offset <= token.offset) {
-        return null;
-      }
-      if (offset <= token.end) {
-        if (token.type == TokenType.SINGLE_LINE_COMMENT || offset < token.end) {
-          return token;
-        }
-      }
-      token = token.next;
-    }
-    return null;
-  }
-
-  /**
-   * Determine if the given token is part of the given node's dart doc.
-   */
-  static Comment _getContainingDocComment(AstNode node, Token token) {
-    if (node is AnnotatedNode) {
-      Comment docComment = node.documentationComment;
-      if (docComment != null && docComment.tokens.contains(token)) {
-        return docComment;
-      }
-    }
-    return null;
-  }
-
-  /**
-   * Determine whether [node] could possibly be the [entity] for a
-   * [CompletionTarget] associated with the given [offset].
-   */
-  static bool _isCandidateNode(AstNode node, int offset) {
-    // If the node's first token is a keyword or identifier, then the node is a
-    // candidate entity if its first token is.
-    Token beginToken = node.beginToken;
-    if (beginToken.type == TokenType.KEYWORD ||
-        beginToken.type == TokenType.IDENTIFIER) {
-      return _isCandidateToken(beginToken, offset);
-    }
-
-    // Otherwise, the node is a candidate entity only if the offset is before
-    // the beginning of the node.  This ensures that completions within a token
-    // (e.g. inside a literal string or inside a comment) are evaluated within
-    // the context of the token itself.
-    return offset <= node.offset;
-  }
-
-  /**
-   * Determine whether [token] could possibly be the [entity] for a
-   * [CompletionTarget] associated with the given [offset].
-   */
-  static bool _isCandidateToken(Token token, int offset) {
-    // A token is considered a candidate entity if the cursor offset is (a)
-    // before the start of the token, (b) within the token, (c) at the end of
-    // the token and the token is a keyword or identifier, or (d) at the
-    // location of the token and the token is zero length.
-    if (offset < token.end) {
-      return true;
-    } else if (offset == token.end) {
-      return token.type == TokenType.KEYWORD ||
-          token.type == TokenType.IDENTIFIER ||
-          token.length == 0;
-    } else {
-      return false;
-    }
-  }
-
-  /**
-   * Return `true` if the parameter is a functional parameter.
-   */
-  static bool _isFunctionalParameter(
-      List<ParameterElement> parameters, int paramIndex) {
-    if (paramIndex < parameters.length) {
-      ParameterElement param = parameters[paramIndex];
-      DartType paramType = param.type;
-      if (param.parameterKind == ParameterKind.NAMED) {
-        // TODO(danrubel) handle named parameters
-        return false;
-      } else {
-        return paramType is FunctionType || paramType is FunctionTypeAlias;
-      }
-    }
-    return false;
-  }
-}
diff --git a/pkg/analysis_server/lib/src/services/completion/contribution_sorter.dart b/pkg/analysis_server/lib/src/services/completion/contribution_sorter.dart
new file mode 100644
index 0000000..3d9dd87
--- /dev/null
+++ b/pkg/analysis_server/lib/src/services/completion/contribution_sorter.dart
@@ -0,0 +1,26 @@
+// 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 services.completion.sorter;
+
+import 'package:analysis_server/plugin/protocol/protocol.dart';
+import 'package:analysis_server/src/provisional/completion/completion_dart.dart';
+
+/**
+ * The abstract class `ContributionSorter` defines the behavior of objects
+ * that are used to adjust the relevance of an existing list of suggestions.
+ * This is a long-lived object that should not maintain state between
+ * calls to it's [sort] method.
+ */
+abstract class ContributionSorter {
+  /**
+   * After [CompletionSuggestion]s have been computed,
+   * this method is called to adjust the relevance of those suggestions.
+   * The compilation unit and completion node
+   * in the given completion context may not be resolved.
+   * This method should execute quickly and not block.
+   */
+  void sort(DartCompletionRequest request,
+      Iterable<CompletionSuggestion> suggestions);
+}
diff --git a/pkg/analysis_server/lib/src/services/completion/dart_completion_cache.dart b/pkg/analysis_server/lib/src/services/completion/dart_completion_cache.dart
index 67a7245..2fbe91e 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart_completion_cache.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart_completion_cache.dart
@@ -24,7 +24,6 @@
  * completion operation.
  */
 class DartCompletionCache extends CompletionCache {
-
   /**
    * A hash of the import directives
    * or `null` if nothing has been cached.
@@ -262,12 +261,17 @@
     CompletionSuggestion suggestion = null;
     String completion = importElem.prefix.displayName;
     if (completion != null && completion.length > 0) {
-      suggestion = new CompletionSuggestion(CompletionSuggestionKind.INVOCATION,
-          DART_RELEVANCE_DEFAULT, completion, completion.length, 0,
-          importElem.isDeprecated, false);
+      suggestion = new CompletionSuggestion(
+          CompletionSuggestionKind.INVOCATION,
+          DART_RELEVANCE_DEFAULT,
+          completion,
+          completion.length,
+          0,
+          importElem.isDeprecated,
+          false);
       LibraryElement lib = importElem.importedLibrary;
       if (lib != null) {
-        suggestion.element = newElement_fromEngine(lib);
+        suggestion.element = convertElement(lib);
       }
       libraryPrefixSuggestions.add(suggestion);
       _importedCompletions.add(suggestion.completion);
@@ -280,7 +284,6 @@
    */
   void _addNonImportedElementSuggestions(
       List<SearchMatch> matches, Set<LibraryElement> excludedLibs) {
-
     // Exclude internal Dart SDK libraries
     for (var lib in context.sourceFactory.dartSdk.sdkLibraries) {
       if (lib.isInternal) {
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 b3a78e6..161197d 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
@@ -6,23 +6,27 @@
 
 import 'dart:async';
 
-import 'package:analysis_server/completion/completion_core.dart'
-    show CompletionRequest;
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/analysis_server.dart';
-import 'package:analysis_server/src/protocol.dart';
+import 'package:analysis_server/src/provisional/completion/completion_core.dart'
+    show CompletionRequest;
+import 'package:analysis_server/src/provisional/completion/completion_dart.dart'
+    as newApi;
+import 'package:analysis_server/src/provisional/completion/dart/completion_target.dart';
 import 'package:analysis_server/src/services/completion/arglist_contributor.dart';
 import 'package:analysis_server/src/services/completion/combinator_contributor.dart';
 import 'package:analysis_server/src/services/completion/common_usage_computer.dart';
 import 'package:analysis_server/src/services/completion/completion_manager.dart';
-import 'package:analysis_server/src/services/completion/completion_target.dart';
+import 'package:analysis_server/src/services/completion/contribution_sorter.dart';
 import 'package:analysis_server/src/services/completion/dart_completion_cache.dart';
-import 'package:analysis_server/src/services/completion/import_uri_contributor.dart';
 import 'package:analysis_server/src/services/completion/imported_reference_contributor.dart';
 import 'package:analysis_server/src/services/completion/keyword_contributor.dart';
 import 'package:analysis_server/src/services/completion/local_reference_contributor.dart';
 import 'package:analysis_server/src/services/completion/optype.dart';
 import 'package:analysis_server/src/services/completion/prefixed_element_contributor.dart';
+import 'package:analysis_server/src/services/completion/uri_contributor.dart';
 import 'package:analysis_server/src/services/search/search_engine.dart';
+import 'package:analyzer/file_system/file_system.dart';
 import 'package:analyzer/src/generated/ast.dart';
 import 'package:analyzer/src/generated/engine.dart';
 import 'package:analyzer/src/generated/scanner.dart';
@@ -72,14 +76,21 @@
  * Manages code completion for a given Dart file completion request.
  */
 class DartCompletionManager extends CompletionManager {
+  /**
+   * The [defaultContributionSorter] is a long-lived object that isn't allowed
+   * to maintain state between calls to [ContributionSorter#sort(...)].
+   */
+  static ContributionSorter defaultContributionSorter =
+      new CommonUsageComputer();
+
   final SearchEngine searchEngine;
   final DartCompletionCache cache;
   List<DartCompletionContributor> contributors;
-  CommonUsageComputer commonUsageComputer;
+  ContributionSorter contributionSorter;
 
   DartCompletionManager(
       AnalysisContext context, this.searchEngine, Source source, this.cache,
-      [this.contributors, this.commonUsageComputer])
+      [this.contributors, this.contributionSorter])
       : super(context, source) {
     if (contributors == null) {
       contributors = [
@@ -92,11 +103,14 @@
         new ArgListContributor(),
         new CombinatorContributor(),
         new PrefixedElementContributor(),
-        new ImportUriContributor(),
+        new UriContributor(),
+        // TODO(brianwilkerson) Use the completion contributor extension point
+        // to add the contributor below (and eventually, all the contributors).
+//        new NewCompletionWrapper(new InheritedContributor())
       ];
     }
-    if (commonUsageComputer == null) {
-      commonUsageComputer = new CommonUsageComputer();
+    if (contributionSorter == null) {
+      contributionSorter = defaultContributionSorter;
     }
   }
 
@@ -167,8 +181,12 @@
           return c.computeFast(request);
         });
       });
-      commonUsageComputer.computeFast(request);
-      sendResults(request, todo.isEmpty);
+      contributionSorter.sort(
+          new OldRequestWrapper(request), request.suggestions);
+
+      if (todo.isEmpty) {
+        sendResults(request, todo.isEmpty);
+      }
       return todo;
     });
   }
@@ -205,7 +223,8 @@
               performance.logElapseTime(completeTag);
               bool last = --count == 0;
               if (changed || last) {
-                commonUsageComputer.computeFull(request);
+                contributionSorter.sort(
+                    new OldRequestWrapper(request), request.suggestions);
                 sendResults(request, last);
               }
             });
@@ -322,17 +341,20 @@
       Source source, int offset, this.cache)
       : super(server, context, source, offset);
 
-  factory DartCompletionRequest.from(CompletionRequestImpl request,
-      DartCompletionCache cache) => new DartCompletionRequest(
-      request.server, request.context, request.source, request.offset, cache);
+  factory DartCompletionRequest.from(
+          CompletionRequestImpl request, DartCompletionCache cache) =>
+      new DartCompletionRequest(request.server, request.context, request.source,
+          request.offset, cache);
 
   /**
    * 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 context
+        .getContents(source)
+        .data
+        .substring(replacementOffset, offset);
   }
 
   /**
@@ -378,9 +400,12 @@
         // because [DartCompletionCache] may be caching that suggestion
         // for future completion requests
         _suggestions[index] = new CompletionSuggestion(
-            CompletionSuggestionKind.IDENTIFIER, suggestion.relevance,
-            suggestion.completion, suggestion.selectionOffset,
-            suggestion.selectionLength, suggestion.isDeprecated,
+            CompletionSuggestionKind.IDENTIFIER,
+            suggestion.relevance,
+            suggestion.completion,
+            suggestion.selectionOffset,
+            suggestion.selectionLength,
+            suggestion.isDeprecated,
             suggestion.isPotential,
             declaringType: suggestion.declaringType,
             parameterNames: suggestion.parameterNames,
@@ -393,3 +418,82 @@
     }
   }
 }
+
+/**
+ * A wrapper around a new dart completion contributor that makes it usable where
+ * an old dart completion contributor is expected.
+ */
+class NewCompletionWrapper implements DartCompletionContributor {
+  /**
+   * The new-style contributor that is being wrapped.
+   */
+  final newApi.DartCompletionContributor contributor;
+
+  /**
+   * Initialize a newly created wrapper for the given [contributor].
+   */
+  NewCompletionWrapper(this.contributor);
+
+  @override
+  bool computeFast(DartCompletionRequest request) {
+    List<CompletionSuggestion> suggestions =
+        contributor.computeSuggestions(new OldRequestWrapper(request));
+    if (suggestions == null) {
+      return false;
+    }
+    for (CompletionSuggestion suggestion in suggestions) {
+      request.addSuggestion(suggestion);
+    }
+    return true;
+  }
+
+  @override
+  Future<bool> computeFull(DartCompletionRequest request) async {
+    List<CompletionSuggestion> suggestions =
+        contributor.computeSuggestions(new OldRequestWrapper(request));
+    if (suggestions != null) {
+      for (CompletionSuggestion suggestion in suggestions) {
+        request.addSuggestion(suggestion);
+      }
+      return true;
+    }
+    return false;
+  }
+
+  @override
+  String toString() => 'wrapped $contributor';
+}
+
+/**
+ * A wrapper around an old dart completion request that makes it usable where a
+ * new dart completion request is expected.
+ */
+class OldRequestWrapper implements newApi.DartCompletionRequest {
+  final DartCompletionRequest request;
+
+  OldRequestWrapper(this.request);
+
+  @override
+  AnalysisContext get context => request.context;
+
+  @override
+  bool get isResolved => request.unit.element != null;
+
+  @override
+  int get offset => request.offset;
+
+  @override
+  ResourceProvider get resourceProvider => request.resourceProvider;
+
+  @override
+  Source get source => request.source;
+
+  @override
+  CompletionTarget get target => request.target;
+
+  @override
+  CompilationUnit get unit => request.unit;
+
+  @override
+  String toString() => 'wrapped $request';
+}
diff --git a/pkg/analysis_server/lib/src/services/completion/import_uri_contributor.dart b/pkg/analysis_server/lib/src/services/completion/import_uri_contributor.dart
deleted file mode 100644
index 574931b..0000000
--- a/pkg/analysis_server/lib/src/services/completion/import_uri_contributor.dart
+++ /dev/null
@@ -1,169 +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 services.completion.contributor.dart.importuri;
-
-import 'dart:async';
-import 'dart:collection';
-import 'dart:core' hide Resource;
-
-import 'package:analysis_server/src/services/completion/dart_completion_manager.dart';
-import 'package:analyzer/file_system/file_system.dart';
-import 'package:analyzer/src/generated/ast.dart';
-import 'package:analyzer/src/generated/sdk.dart';
-import 'package:analyzer/src/generated/source.dart';
-import 'package:path/path.dart';
-
-import '../../protocol_server.dart'
-    show CompletionSuggestion, CompletionSuggestionKind;
-
-/**
- * A contributor for calculating uri suggestions
- * for import and part directives.
- */
-class ImportUriContributor extends DartCompletionContributor {
-  _ImportUriSuggestionBuilder builder;
-
-  @override
-  bool computeFast(DartCompletionRequest request) {
-    builder = new _ImportUriSuggestionBuilder(request);
-    return builder.computeFast(request.target.containingNode);
-  }
-
-  @override
-  Future<bool> computeFull(DartCompletionRequest request) {
-    return new Future.value(false);
-  }
-}
-
-class _ImportUriSuggestionBuilder extends SimpleAstVisitor {
-  final DartCompletionRequest request;
-  HashSet<String> _importedUris;
-
-  _ImportUriSuggestionBuilder(this.request);
-
-  bool computeFast(AstNode node) {
-    node.accept(this);
-    return true;
-  }
-
-  @override
-  visitSimpleStringLiteral(SimpleStringLiteral node) {
-    AstNode parent = node.parent;
-    if (parent is ImportDirective && parent.uri == node) {
-      String partial = node.literal.lexeme.substring(
-          node.contentsOffset - node.offset, request.offset - node.offset);
-      _computeImportedUris();
-      request.replacementOffset = node.contentsOffset;
-      request.replacementLength = node.contentsEnd - node.contentsOffset;
-      _addDartSuggestions();
-      _addPackageSuggestions(partial);
-      _addFileSuggestions(partial);
-    } else if (parent is PartDirective && parent.uri == node) {
-      String partial = node.literal.lexeme.substring(
-          node.contentsOffset - node.offset, request.offset - node.offset);
-      _computeImportedUris();
-      request.replacementOffset = node.contentsOffset;
-      request.replacementLength = node.contentsEnd - node.contentsOffset;
-      _addFileSuggestions(partial);
-    }
-  }
-
-  void _addDartSuggestions() {
-    _addSuggestion('dart:');
-    SourceFactory factory = request.context.sourceFactory;
-    for (SdkLibrary lib in factory.dartSdk.sdkLibraries) {
-      if (!lib.isInternal && !lib.isImplementation) {
-        if (!lib.shortName.startsWith('dart:_')) {
-          _addSuggestion(lib.shortName);
-        }
-      }
-    }
-  }
-
-  void _addFileSuggestions(String partial) {
-    Source source = request.source;
-    String sourceFullName = source.fullName;
-    String sourceShortName = source.shortName;
-    String dirPath = (partial.endsWith('/') || partial.endsWith(separator))
-        ? partial
-        : dirname(partial);
-    String prefix = dirPath == '.' ? '' : dirPath;
-    if (isRelative(dirPath)) {
-      String sourceDir = dirname(sourceFullName);
-      if (isAbsolute(sourceDir)) {
-        dirPath = join(sourceDir, dirPath);
-      } else {
-        return;
-      }
-    }
-    Resource dir = request.resourceProvider.getResource(dirPath);
-    if (dir is Folder) {
-      for (Resource child in dir.getChildren()) {
-        String completion;
-        if (child is Folder) {
-          completion = '$prefix${child.shortName}$separator';
-        } else {
-          completion = '$prefix${child.shortName}';
-        }
-        if (completion != sourceShortName && completion != sourceFullName) {
-          _addSuggestion(completion);
-        }
-      }
-    }
-  }
-
-  void _addPackageFolderSuggestions(
-      String partial, String prefix, Folder folder) {
-    for (Resource child in folder.getChildren()) {
-      if (child is Folder) {
-        String childPrefix = '$prefix${child.shortName}/';
-        _addSuggestion(childPrefix);
-        if (partial.startsWith(childPrefix)) {
-          _addPackageFolderSuggestions(partial, childPrefix, child);
-        }
-      } else {
-        _addSuggestion('$prefix${child.shortName}');
-      }
-    }
-  }
-
-  void _addPackageSuggestions(String partial) {
-    SourceFactory factory = request.context.sourceFactory;
-    Map<String, List<Folder>> packageMap = factory.packageMap;
-    if (packageMap != null) {
-      _addSuggestion('package:');
-      packageMap.forEach((String pkgName, List<Folder> folders) {
-        String prefix = 'package:$pkgName/';
-        _addSuggestion(prefix);
-        for (Folder folder in folders) {
-          if (folder.exists) {
-            _addPackageFolderSuggestions(partial, prefix, folder);
-          }
-        }
-      });
-    }
-  }
-
-  void _addSuggestion(String completion) {
-    if (!_importedUris.contains(completion)) {
-      request.addSuggestion(new CompletionSuggestion(
-          CompletionSuggestionKind.IMPORT, DART_RELEVANCE_DEFAULT, completion,
-          completion.length, 0, false, false));
-    }
-  }
-
-  void _computeImportedUris() {
-    _importedUris = new HashSet<String>();
-    _importedUris.add('dart:core');
-    for (Directive directive in request.unit.directives) {
-      if (directive is ImportDirective) {
-        String uri = directive.uriContent;
-        if (uri != null && uri.length > 0) {
-          _importedUris.add(uri);
-        }
-      }
-    }
-  }
-}
diff --git a/pkg/analysis_server/lib/src/services/completion/imported_reference_contributor.dart b/pkg/analysis_server/lib/src/services/completion/imported_reference_contributor.dart
index 0fced1d..b283ce9 100644
--- a/pkg/analysis_server/lib/src/services/completion/imported_reference_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/imported_reference_contributor.dart
@@ -25,10 +25,16 @@
   bool suggestionsComputed;
   _ImportedSuggestionBuilder builder;
 
-  ImportedReferenceContributor({this.shouldWaitForLowPrioritySuggestions: false});
+  ImportedReferenceContributor(
+      {this.shouldWaitForLowPrioritySuggestions: false});
 
   @override
   bool computeFast(DartCompletionRequest request) {
+    // Don't suggest in comments.
+    if (request.target.isCommentText) {
+      return true;
+    }
+
     OpType optype = request.optype;
     if (!optype.isPrefixed) {
       if (optype.includeReturnValueSuggestions ||
@@ -40,7 +46,8 @@
             shouldWaitForLowPrioritySuggestions;
         // If target is an argument in an argument list
         // then suggestions may need to be adjusted
-        suggestionsComputed = builder.computeFast(request.target.containingNode);
+        suggestionsComputed =
+            builder.computeFast(request.target.containingNode);
         return suggestionsComputed && request.target.argIndex == null;
       }
     }
@@ -187,7 +194,7 @@
    */
   void _addInheritedSuggestions(AstNode node) {
     var classDecl = node.getAncestor((p) => p is ClassDeclaration);
-    if (classDecl is ClassDeclaration) {
+    if (classDecl is ClassDeclaration && !optype.inStaticMethodBody) {
       // Build a list of inherited types that are imported
       // and include any inherited imported members
       List<String> inheritedTypes = new List<String>();
diff --git a/pkg/analysis_server/lib/src/services/completion/inherited_contributor.dart b/pkg/analysis_server/lib/src/services/completion/inherited_contributor.dart
new file mode 100644
index 0000000..451da53
--- /dev/null
+++ b/pkg/analysis_server/lib/src/services/completion/inherited_contributor.dart
@@ -0,0 +1,160 @@
+// 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 services.completion.computer.dart.invocation;
+
+import 'package:analysis_server/plugin/edit/utilities/change_builder_dart.dart';
+import 'package:analysis_server/src/protocol_server.dart'
+    show CompletionSuggestion, CompletionSuggestionKind, SourceChange;
+import 'package:analysis_server/src/protocol_server.dart' as protocol
+    hide CompletionSuggestion, CompletionSuggestionKind;
+import 'package:analysis_server/src/provisional/completion/completion_dart.dart';
+import 'package:analysis_server/src/services/completion/dart_completion_manager.dart'
+    show DART_RELEVANCE_HIGH;
+import 'package:analyzer/src/generated/ast.dart';
+import 'package:analyzer/src/generated/element.dart';
+import 'package:analyzer/src/generated/engine.dart';
+import 'package:analyzer/src/generated/resolver.dart';
+import 'package:analyzer/src/generated/source.dart';
+
+/**
+ * A completion contributor used to suggest replacing partial identifiers inside
+ * a class declaration with templates for inherited members.
+ */
+class InheritedContributor extends DartCompletionContributor {
+  @override
+  List<CompletionSuggestion> internalComputeSuggestions(
+      DartCompletionRequest request) {
+    if (!request.isResolved) {
+      return null;
+    }
+    AstNode node = new NodeLocator(request.offset).searchWithin(request.unit);
+    if (node == null || !_isMemberLevelIdentifier(node)) {
+      return null;
+    }
+    ClassDeclaration classDeclaration =
+        node.getAncestor((AstNode node) => node is ClassDeclaration);
+    if (classDeclaration != null) {
+      ClassElement element = classDeclaration.element;
+      if (element == null) {
+        return null;
+      }
+      return _suggestInheritedMembers(request, node, element);
+    }
+    return null;
+  }
+
+  /**
+   * Return a template for an override of the given [element] in the given
+   * [source]. If selected, the template will replace the given [identifier].
+   */
+  String _buildRepacementText(
+      Source source, SimpleIdentifier identifier, Element element) {
+    AnalysisContext context = element.context;
+    DartChangeBuilder builder = new DartChangeBuilder(context);
+    builder.addFileEdit(source, context.getModificationStamp(source),
+        (DartFileEditBuilder builder) {
+      builder.addReplacement(identifier.offset, identifier.length,
+          (DartEditBuilder builder) {
+        builder.writeOverrideOfInheritedMember(element);
+      });
+    });
+    return builder.sourceChange.edits[0].edits[0].replacement.trim();
+  }
+
+  /**
+   * Build a suggestion to replace the partial [identifier] in the given
+   * [source] with an override of the given [element].
+   */
+  CompletionSuggestion _buildSuggestion(
+      Source source, SimpleIdentifier identifier, Element element) {
+    String completion = _buildRepacementText(source, identifier, element);
+    CompletionSuggestion suggestion = new CompletionSuggestion(
+        CompletionSuggestionKind.IDENTIFIER,
+        DART_RELEVANCE_HIGH,
+        completion,
+        identifier.offset,
+        0,
+        element.isDeprecated,
+        false);
+    suggestion.element = protocol.convertElement(element);
+    return suggestion;
+  }
+
+  /**
+   * Return a list containing the names of all of the inherited by not
+   * implemented members of the class represented by the given [element] that
+   * start with the given [prefix]. The [map] is used to find all of the members
+   * that are inherited.
+   */
+  List<String> _computeMemberNames(
+      MemberMap map, ClassElement element, String prefix) {
+    List<String> memberNames = <String>[];
+    int count = map.size;
+    for (int i = 0; i < count; i++) {
+      String memberName = map.getKey(i);
+      if (memberName.startsWith(prefix) && !_hasMember(element, memberName)) {
+        memberNames.add(memberName);
+      }
+    }
+    return memberNames;
+  }
+
+  /**
+   * Return `true` if the given [classElement] directly declares a member with
+   * the given [memberName].
+   */
+  bool _hasMember(ClassElement classElement, String memberName) {
+    return classElement.getField(memberName) != null ||
+        classElement.getGetter(memberName) != null ||
+        classElement.getMethod(memberName) != null ||
+        classElement.getSetter(memberName) != null;
+  }
+
+  /**
+   * Return `true` if the given [node] looks like a partial identifier inside a
+   * class declaration.
+   */
+  bool _isMemberLevelIdentifier(AstNode node) {
+    if (node is SimpleIdentifier) {
+      AstNode parent1 = node.parent;
+      if (parent1 is TypeName) {
+        AstNode parent2 = parent1.parent;
+        if (parent2 is VariableDeclarationList) {
+          AstNode parent3 = parent2.parent;
+          if (parent3 is FieldDeclaration) {
+            NodeList<VariableDeclaration> variables = parent2.variables;
+            return variables.length == 1 && variables[0].name.name.isEmpty;
+          }
+        }
+      }
+    }
+    return false;
+  }
+
+  /**
+   * Add any suggestions that are appropriate to the given [request], using the
+   * given [element] to find inherited members whose name has the given
+   * [identifier] as a prefix.
+   */
+  List<CompletionSuggestion> _suggestInheritedMembers(
+      DartCompletionRequest request,
+      SimpleIdentifier identifier,
+      ClassElement element) {
+    String name = identifier.name;
+    InheritanceManager manager = new InheritanceManager(element.library);
+    MemberMap map = manager.getMapOfMembersInheritedFromInterfaces(element);
+    List<String> memberNames = _computeMemberNames(map, element, name);
+    memberNames.sort();
+    List<CompletionSuggestion> suggestions = <CompletionSuggestion>[];
+    for (String memberName in memberNames) {
+      CompletionSuggestion suggestion =
+          _buildSuggestion(request.source, identifier, map.get(memberName));
+      if (suggestion != null) {
+        suggestions.add(suggestion);
+      }
+    }
+    return suggestions;
+  }
+}
diff --git a/pkg/analysis_server/lib/src/services/completion/keyword_contributor.dart b/pkg/analysis_server/lib/src/services/completion/keyword_contributor.dart
index 33dfa58..0da2c8c 100644
--- a/pkg/analysis_server/lib/src/services/completion/keyword_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/keyword_contributor.dart
@@ -1,4 +1,5 @@
 // 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.
 
@@ -6,7 +7,7 @@
 
 import 'dart:async';
 
-import 'package:analysis_server/src/protocol.dart';
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/services/completion/dart_completion_manager.dart';
 import 'package:analyzer/src/generated/ast.dart';
 import 'package:analyzer/src/generated/scanner.dart';
@@ -21,7 +22,9 @@
 class KeywordContributor extends DartCompletionContributor {
   @override
   bool computeFast(DartCompletionRequest request) {
-    request.target.containingNode.accept(new _KeywordVisitor(request));
+    if (!request.target.isCommentText) {
+      request.target.containingNode.accept(new _KeywordVisitor(request));
+    }
     return true;
   }
 
@@ -32,7 +35,7 @@
 }
 
 /**
- * A vistor for generating keyword suggestions.
+ * A visitor for generating keyword suggestions.
  */
 class _KeywordVisitor extends GeneralizingAstVisitor {
   final DartCompletionRequest request;
@@ -70,6 +73,9 @@
       }
     }
     _addStatementKeywords(node);
+    if (_inCatchClause(node)) {
+      _addSuggestion(Keyword.RETHROW, DART_RELEVANCE_KEYWORD - 1);
+    }
   }
 
   @override
@@ -124,15 +130,8 @@
           !node.directives.any((d) => d is LibraryDirective)) {
         _addSuggestions([Keyword.LIBRARY], DART_RELEVANCE_HIGH);
       }
-      _addSuggestions([Keyword.EXPORT, Keyword.PART], DART_RELEVANCE_HIGH);
-      _addSuggestion2("import '';",
-          offset: 8, relevance: DART_RELEVANCE_HIGH + 1);
-      _addSuggestion2("import '' as ;",
-          offset: 8, relevance: DART_RELEVANCE_HIGH);
-      _addSuggestion2("import '' hide ;",
-          offset: 8, relevance: DART_RELEVANCE_HIGH);
-      _addSuggestion2("import '' show ;",
-          offset: 8, relevance: DART_RELEVANCE_HIGH);
+      _addSuggestions(
+          [Keyword.IMPORT, Keyword.EXPORT, Keyword.PART], DART_RELEVANCE_HIGH);
     }
     if (entity == null || entity is Declaration) {
       if (previousMember is FunctionDeclaration &&
@@ -145,14 +144,6 @@
   }
 
   @override
-  visitPropertyAccess(PropertyAccess node) {
-    // suggestions before '.' but not after
-    if (entity != node.propertyName) {
-      super.visitPropertyAccess(node);
-    }
-  }
-
-  @override
   visitExpression(Expression node) {
     _addExpressionKeywords(node);
   }
@@ -165,15 +156,48 @@
   }
 
   @override
+  visitForEachStatement(ForEachStatement node) {
+    if (entity == node.inKeyword) {
+      Token previous = node.inKeyword.previous;
+      if (previous is SyntheticStringToken && previous.lexeme == 'in') {
+        previous = previous.previous;
+      }
+      if (previous != null && previous.type == TokenType.EQ) {
+        _addSuggestions([
+          Keyword.CONST,
+          Keyword.FALSE,
+          Keyword.NEW,
+          Keyword.NULL,
+          Keyword.TRUE
+        ]);
+      } else {
+        _addSuggestion(Keyword.IN, DART_RELEVANCE_HIGH);
+      }
+    }
+  }
+
+  @override
   visitFormalParameterList(FormalParameterList node) {
-    AstNode constructorDecl =
+    AstNode constructorDeclaration =
         node.getAncestor((p) => p is ConstructorDeclaration);
-    if (constructorDecl != null) {
+    if (constructorDeclaration != null) {
       _addSuggestions([Keyword.THIS]);
     }
   }
 
   @override
+  visitForStatement(ForStatement node) {
+    // Handle the degenerate case while typing - for (int x i^)
+    if (node.condition == entity && entity is SimpleIdentifier) {
+      Token entityToken = (entity as SimpleIdentifier).beginToken;
+      if (entityToken.previous.isSynthetic &&
+          entityToken.previous.type == TokenType.SEMICOLON) {
+        _addSuggestion(Keyword.IN, DART_RELEVANCE_HIGH);
+      }
+    }
+  }
+
+  @override
   visitFunctionExpression(FunctionExpression node) {
     if (entity == node.body) {
       if (!node.body.isAsynchronous) {
@@ -203,7 +227,12 @@
         _addSuggestion(Keyword.DEFERRED, DART_RELEVANCE_HIGH);
       }
     }
-    if (entity == node.semicolon || node.combinators.contains(entity)) {
+    // Handle degenerate case where import statement does not have a semicolon
+    // and the cursor is in the uri string
+    if ((entity == node.semicolon &&
+            node.uri != null &&
+            node.uri.offset + 1 != request.offset) ||
+        node.combinators.contains(entity)) {
       _addImportDirectiveKeywords(node);
     }
   }
@@ -218,6 +247,15 @@
   }
 
   @override
+  visitIsExpression(IsExpression node) {
+    if (entity == node.isOperator) {
+      _addSuggestion(Keyword.IS, DART_RELEVANCE_HIGH);
+    } else {
+      _addExpressionKeywords(node);
+    }
+  }
+
+  @override
   visitLibraryIdentifier(LibraryIdentifier node) {
     // no suggestions
   }
@@ -263,6 +301,14 @@
   }
 
   @override
+  visitPropertyAccess(PropertyAccess node) {
+    // suggestions before '.' but not after
+    if (entity != node.propertyName) {
+      super.visitPropertyAccess(node);
+    }
+  }
+
+  @override
   visitReturnStatement(ReturnStatement node) {
     if (entity == node.expression) {
       _addExpressionKeywords(node);
@@ -345,7 +391,13 @@
   }
 
   void _addExpressionKeywords(AstNode node) {
-    _addSuggestions([Keyword.FALSE, Keyword.NEW, Keyword.NULL, Keyword.TRUE,]);
+    _addSuggestions([
+      Keyword.CONST,
+      Keyword.FALSE,
+      Keyword.NEW,
+      Keyword.NULL,
+      Keyword.TRUE,
+    ]);
     if (_inClassMemberBody(node)) {
       _addSuggestions([Keyword.SUPER, Keyword.THIS,]);
     }
@@ -355,12 +407,24 @@
   }
 
   void _addImportDirectiveKeywords(ImportDirective node) {
-    if (node.asKeyword == null) {
+    bool hasDeferredKeyword = node.deferredKeyword != null;
+    bool hasAsKeyword = node.asKeyword != null;
+    if (!hasAsKeyword) {
       _addSuggestion(Keyword.AS, DART_RELEVANCE_HIGH);
-      if (node.deferredKeyword == null) {
+    }
+    if (!hasDeferredKeyword) {
+      if (!hasAsKeyword) {
+        _addSuggestion2('deferred as', relevance: DART_RELEVANCE_HIGH);
+      } else if (entity == node.asKeyword) {
         _addSuggestion(Keyword.DEFERRED, DART_RELEVANCE_HIGH);
       }
     }
+    if (!hasDeferredKeyword || hasAsKeyword) {
+      if (node.combinators.isEmpty) {
+        _addSuggestion2('show', relevance: DART_RELEVANCE_HIGH);
+        _addSuggestion2('hide', relevance: DART_RELEVANCE_HIGH);
+      }
+    }
   }
 
   void _addStatementKeywords(AstNode node) {
@@ -370,12 +434,18 @@
     if (_inAsyncMethodOrFunction(node)) {
       _addSuggestion2(AWAIT);
     }
+    if (_inLoop(node)) {
+      _addSuggestions([Keyword.BREAK, Keyword.CONTINUE]);
+    }
+    if (_inSwitch(node)) {
+      _addSuggestions([Keyword.BREAK]);
+    }
     _addSuggestions([
       Keyword.ASSERT,
-      Keyword.CONTINUE,
+      Keyword.CONST,
       Keyword.DO,
       Keyword.FINAL,
-      //Keyword.FOR,
+      Keyword.FOR,
       Keyword.IF,
       Keyword.NEW,
       Keyword.RETURN,
@@ -386,8 +456,6 @@
       Keyword.VOID,
       Keyword.WHILE
     ]);
-    _addSuggestion2('for ()', offset: 5);
-    _addSuggestion(Keyword.RETHROW, DART_RELEVANCE_KEYWORD - 1);
   }
 
   void _addSuggestion(Keyword keyword,
@@ -401,8 +469,13 @@
       offset = completion.length;
     }
     request.addSuggestion(new CompletionSuggestion(
-        CompletionSuggestionKind.KEYWORD, relevance, completion, offset, 0,
-        false, false));
+        CompletionSuggestionKind.KEYWORD,
+        relevance,
+        completion,
+        offset,
+        0,
+        false,
+        false));
   }
 
   void _addSuggestions(List<Keyword> keywords,
@@ -417,6 +490,9 @@
     return body != null && body.isAsynchronous;
   }
 
+  bool _inCatchClause(Block node) =>
+      node.getAncestor((p) => p is CatchClause) != null;
+
   bool _inClassMemberBody(AstNode node) {
     while (true) {
       AstNode body = node.getAncestor((n) => n is FunctionBody);
@@ -430,4 +506,20 @@
       node = parent;
     }
   }
+
+  bool _inDoLoop(AstNode node) =>
+      node.getAncestor((p) => p is DoStatement) != null;
+
+  bool _inForLoop(AstNode node) =>
+      node.getAncestor((p) => p is ForStatement || p is ForEachStatement) !=
+          null;
+
+  bool _inLoop(AstNode node) =>
+      _inDoLoop(node) || _inForLoop(node) || _inWhileLoop(node);
+
+  bool _inSwitch(AstNode node) =>
+      node.getAncestor((p) => p is SwitchStatement) != null;
+
+  bool _inWhileLoop(AstNode node) =>
+      node.getAncestor((p) => p is WhileStatement) != null;
 }
diff --git a/pkg/analysis_server/lib/src/services/completion/local_declaration_visitor.dart b/pkg/analysis_server/lib/src/services/completion/local_declaration_visitor.dart
index ac99637..360774a 100644
--- a/pkg/analysis_server/lib/src/services/completion/local_declaration_visitor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/local_declaration_visitor.dart
@@ -14,11 +14,18 @@
  * which catches the exception thrown by [finished()].
  */
 abstract class LocalDeclarationVisitor extends GeneralizingAstVisitor {
-  static final TypeName STACKTRACE_TYPE = new TypeName(new SimpleIdentifier(
-      new StringToken(TokenType.IDENTIFIER, 'StackTrace', 0)), null);
+  static final TypeName STACKTRACE_TYPE = new TypeName(
+      new SimpleIdentifier(
+          new StringToken(TokenType.IDENTIFIER, 'StackTrace', 0)),
+      null);
 
   final int offset;
 
+  /**
+   * `true` if local inherited types should be visited.
+   */
+  bool includeLocalInheritedTypes = true;
+
   LocalDeclarationVisitor(this.offset);
 
   void declaredClass(ClassDeclaration declaration);
@@ -113,9 +120,11 @@
   void visitClassDeclaration(ClassDeclaration node) {
     _visitClassDeclarationMembers(node);
     // imported types are handled by the imported reference contributor
-    visitInheritedTypes(node, localDeclaration: (ClassDeclaration classNode) {
-      _visitClassDeclarationMembers(classNode);
-    });
+    if (includeLocalInheritedTypes) {
+      visitInheritedTypes(node, localDeclaration: (ClassDeclaration classNode) {
+        _visitClassDeclarationMembers(classNode);
+      });
+    }
     visitNode(node);
   }
 
@@ -231,7 +240,7 @@
   }
 
   void _visitClassDeclarationMembers(ClassDeclaration node) {
-    node.members.forEach((ClassMember member) {
+    for (ClassMember member in node.members) {
       if (member is FieldDeclaration) {
         member.fields.variables.forEach((VariableDeclaration varDecl) {
           declaredField(member, varDecl);
@@ -239,7 +248,7 @@
       } else if (member is MethodDeclaration) {
         declaredMethod(member);
       }
-    });
+    }
   }
 
   void _visitParamList(FormalParameterList paramList) {
diff --git a/pkg/analysis_server/lib/src/services/completion/local_reference_contributor.dart b/pkg/analysis_server/lib/src/services/completion/local_reference_contributor.dart
index 9cfbb0d..6753a40 100644
--- a/pkg/analysis_server/lib/src/services/completion/local_reference_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/local_reference_contributor.dart
@@ -6,15 +6,15 @@
 
 import 'dart:async';
 
-import 'package:analysis_server/src/protocol.dart' as protocol
+import 'package:analysis_server/plugin/protocol/protocol.dart' as protocol
     show Element, ElementKind;
-import 'package:analysis_server/src/protocol.dart' hide Element, ElementKind;
+import 'package:analysis_server/plugin/protocol/protocol.dart'
+    hide Element, ElementKind;
 import 'package:analysis_server/src/services/completion/dart_completion_manager.dart';
 import 'package:analysis_server/src/services/completion/local_declaration_visitor.dart';
 import 'package:analysis_server/src/services/completion/local_suggestion_builder.dart';
 import 'package:analysis_server/src/services/completion/optype.dart';
 import 'package:analyzer/src/generated/ast.dart';
-import 'package:analyzer/src/generated/source.dart';
 import 'package:analyzer/src/generated/utilities_dart.dart';
 
 /**
@@ -24,6 +24,11 @@
 class LocalReferenceContributor extends DartCompletionContributor {
   @override
   bool computeFast(DartCompletionRequest request) {
+    // Don't suggest in comments.
+    if (request.target.isCommentText) {
+      return true;
+    }
+
     OpType optype = request.optype;
 
     // Collect suggestions from the specific child [AstNode] that contains
@@ -38,7 +43,8 @@
       }
       if (optype.includeStatementLabelSuggestions ||
           optype.includeCaseLabelSuggestions) {
-        _LabelVisitor labelVisitor = new _LabelVisitor(request,
+        _LabelVisitor labelVisitor = new _LabelVisitor(
+            request,
             optype.includeStatementLabelSuggestions,
             optype.includeCaseLabelSuggestions);
         labelVisitor.visit(request.target.containingNode);
@@ -188,8 +194,12 @@
     element.returnType = classDecl.name.name;
     CompletionSuggestion suggestion = new CompletionSuggestion(
         CompletionSuggestionKind.INVOCATION,
-        deprecated ? DART_RELEVANCE_LOW : DART_RELEVANCE_DEFAULT, completion,
-        completion.length, 0, deprecated, false,
+        deprecated ? DART_RELEVANCE_LOW : DART_RELEVANCE_DEFAULT,
+        completion,
+        completion.length,
+        0,
+        deprecated,
+        false,
         declaringType: classDecl.name.name,
         element: element,
         parameterNames: parameterNames,
@@ -325,8 +335,13 @@
       String completion = id.name;
       if (completion != null && completion.length > 0 && completion != '_') {
         CompletionSuggestion suggestion = new CompletionSuggestion(
-            CompletionSuggestionKind.IDENTIFIER, DART_RELEVANCE_DEFAULT,
-            completion, completion.length, 0, false, false);
+            CompletionSuggestionKind.IDENTIFIER,
+            DART_RELEVANCE_DEFAULT,
+            completion,
+            completion.length,
+            0,
+            false,
+            false);
         request.addSuggestion(suggestion);
         return suggestion;
       }
@@ -342,8 +357,21 @@
 class _LocalVisitor extends LocalDeclarationVisitor {
   final DartCompletionRequest request;
   final OpType optype;
+  int privateMemberRelevance = DART_RELEVANCE_DEFAULT;
 
-  _LocalVisitor(this.request, int offset, this.optype) : super(offset);
+  _LocalVisitor(this.request, int offset, this.optype) : super(offset) {
+    includeLocalInheritedTypes = !optype.inStaticMethodBody;
+    if (request.replacementLength > 0) {
+      var contents = request.context.getContents(request.source);
+      if (contents != null &&
+          contents.data != null &&
+          contents.data.startsWith('_', request.replacementOffset)) {
+        // If user typed identifier starting with '_'
+        // then do not suppress the relevance of private members
+        privateMemberRelevance = null;
+      }
+    }
+  }
 
   @override
   void declaredClass(ClassDeclaration declaration) {
@@ -375,7 +403,8 @@
 
   @override
   void declaredField(FieldDeclaration fieldDecl, VariableDeclaration varDecl) {
-    if (optype.includeReturnValueSuggestions) {
+    if (optype.includeReturnValueSuggestions &&
+        (!optype.inStaticMethodBody || fieldDecl.isStatic)) {
       CompletionSuggestion suggestion =
           createFieldSuggestion(request.source, fieldDecl, varDecl);
       if (suggestion != null) {
@@ -440,8 +469,9 @@
 
   @override
   void declaredMethod(MethodDeclaration declaration) {
-    if (optype.includeReturnValueSuggestions ||
-        optype.includeVoidReturnSuggestions) {
+    if ((optype.includeReturnValueSuggestions ||
+            optype.includeVoidReturnSuggestions) &&
+        (!optype.inStaticMethodBody || declaration.isStatic)) {
       protocol.ElementKind elemKind;
       FormalParameterList param;
       TypeName typeName = declaration.returnType;
@@ -523,20 +553,28 @@
       }
       return typeId.name;
     }).toList();
-    suggestion.requiredParameterCount = paramList.where(
-        (FormalParameter param) => param is! DefaultFormalParameter).length;
+    suggestion.requiredParameterCount = paramList
+        .where((FormalParameter param) => param is! DefaultFormalParameter)
+        .length;
     suggestion.hasNamedParameters = paramList
         .any((FormalParameter param) => param.kind == ParameterKind.NAMED);
   }
 
   void _addSuggestion(
       SimpleIdentifier id, TypeName typeName, protocol.ElementKind elemKind,
-      {bool isAbstract: false, bool isDeprecated: false,
-      ClassDeclaration classDecl, FormalParameterList param,
+      {bool isAbstract: false,
+      bool isDeprecated: false,
+      ClassDeclaration classDecl,
+      FormalParameterList param,
       int relevance: DART_RELEVANCE_DEFAULT}) {
     CompletionSuggestion suggestion = createSuggestion(
-        id, isDeprecated, relevance, typeName, classDecl: classDecl);
+        id, isDeprecated, relevance, typeName,
+        classDecl: classDecl);
     if (suggestion != null) {
+      if (privateMemberRelevance != null &&
+          suggestion.completion.startsWith('_')) {
+        suggestion.relevance = privateMemberRelevance;
+      }
       request.addSuggestion(suggestion);
       suggestion.element = createElement(request.source, elemKind, id,
           isAbstract: isAbstract,
diff --git a/pkg/analysis_server/lib/src/services/completion/local_suggestion_builder.dart b/pkg/analysis_server/lib/src/services/completion/local_suggestion_builder.dart
index 324e1a7..4981136 100644
--- a/pkg/analysis_server/lib/src/services/completion/local_suggestion_builder.dart
+++ b/pkg/analysis_server/lib/src/services/completion/local_suggestion_builder.dart
@@ -4,9 +4,10 @@
 
 library services.completion.suggestion.builder.local;
 
-import 'package:analysis_server/src/protocol.dart' as protocol
+import 'package:analysis_server/plugin/protocol/protocol.dart' as protocol
     show Element, ElementKind;
-import 'package:analysis_server/src/protocol.dart' hide Element, ElementKind;
+import 'package:analysis_server/plugin/protocol/protocol.dart'
+    hide Element, ElementKind;
 import 'package:analysis_server/src/services/completion/dart_completion_manager.dart';
 import 'package:analyzer/src/generated/ast.dart';
 import 'package:analyzer/src/generated/scanner.dart';
@@ -22,7 +23,9 @@
  */
 protocol.Element createElement(
     Source source, protocol.ElementKind kind, SimpleIdentifier id,
-    {String parameters, TypeName returnType, bool isAbstract: false,
+    {String parameters,
+    TypeName returnType,
+    bool isAbstract: false,
     bool isDeprecated: false}) {
   String name;
   Location location;
@@ -75,9 +78,14 @@
   }
   CompletionSuggestion suggestion = new CompletionSuggestion(
       CompletionSuggestionKind.INVOCATION,
-      isDeprecated ? DART_RELEVANCE_LOW : defaultRelevance, completion,
-      completion.length, 0, isDeprecated, false,
-      returnType: nameForType(returnType), element: element);
+      isDeprecated ? DART_RELEVANCE_LOW : defaultRelevance,
+      completion,
+      completion.length,
+      0,
+      isDeprecated,
+      false,
+      returnType: nameForType(returnType),
+      element: element);
   if (classDecl != null) {
     SimpleIdentifier classId = classDecl.name;
     if (classId != null) {
diff --git a/pkg/analysis_server/lib/src/services/completion/optype.dart b/pkg/analysis_server/lib/src/services/completion/optype.dart
index 7ab13f9..3408e96 100644
--- a/pkg/analysis_server/lib/src/services/completion/optype.dart
+++ b/pkg/analysis_server/lib/src/services/completion/optype.dart
@@ -4,7 +4,7 @@
 
 library services.completion.dart.optype;
 
-import 'package:analysis_server/src/services/completion/completion_target.dart';
+import 'package:analysis_server/src/provisional/completion/dart/completion_target.dart';
 import 'package:analyzer/src/generated/ast.dart';
 import 'package:analyzer/src/generated/scanner.dart';
 
@@ -14,7 +14,6 @@
  * suggestions were requested.
  */
 class OpType {
-
   /**
    * Indicates whether constructor suggestions should be included.
    */
@@ -48,6 +47,11 @@
   bool includeCaseLabelSuggestions = false;
 
   /**
+   * Indicates whether the completion location is in the body of a static method.
+   */
+  bool inStaticMethodBody = false;
+
+  /**
    * Indicates whether the completion target is prefixed.
    */
   bool isPrefixed = false;
@@ -60,6 +64,10 @@
     OpType optype = new OpType._();
     target.containingNode
         .accept(new _OpTypeAstVisitor(optype, target.entity, offset));
+    var mthDecl =
+        target.containingNode.getAncestor((p) => p is MethodDeclaration);
+    optype.inStaticMethodBody =
+        mthDecl is MethodDeclaration && mthDecl.isStatic;
     return optype;
   }
 
@@ -74,7 +82,6 @@
 }
 
 class _OpTypeAstVisitor extends GeneralizingAstVisitor {
-
   /**
    * The entity (AstNode or Token) which will be replaced or displaced by the
    * added text.
@@ -288,6 +295,16 @@
   }
 
   @override
+  void visitFieldFormalParameter(FieldFormalParameter node) {
+    if (entity == node.identifier) {
+      optype.isPrefixed = true;
+    } else {
+      optype.includeReturnValueSuggestions = true;
+      optype.includeTypeNameSuggestions = true;
+    }
+  }
+
+  @override
   void visitForEachStatement(ForEachStatement node) {
     if (identical(entity, node.identifier)) {
       optype.includeTypeNameSuggestions = true;
@@ -308,7 +325,36 @@
 
   @override
   void visitFormalParameterList(FormalParameterList node) {
-    optype.includeTypeNameSuggestions = true;
+    dynamic entity = this.entity;
+    if (entity is Token && entity.previous != null) {
+      TokenType type = entity.previous.type;
+      if (type == TokenType.OPEN_PAREN || type == TokenType.COMMA) {
+        optype.includeTypeNameSuggestions = true;
+      }
+    }
+    // Handle default normal parameter just as a normal parameter.
+    if (entity is DefaultFormalParameter) {
+      entity = entity.parameter;
+    }
+    // "(^ this.field)"
+    if (entity is FieldFormalParameter) {
+      if (offset < entity.thisKeyword.offset) {
+        optype.includeTypeNameSuggestions = true;
+      }
+    }
+    // "(Type name)"
+    if (entity is SimpleFormalParameter) {
+      // "(Type^)" is parsed as a parameter with the _name_ "Type".
+      if (entity.type == null) {
+        optype.includeTypeNameSuggestions = true;
+      }
+      // If inside of "Type" in "(Type^ name)", then include types.
+      if (entity.type != null &&
+          entity.type.offset <= offset &&
+          offset <= entity.type.end) {
+        optype.includeTypeNameSuggestions = true;
+      }
+    }
   }
 
   @override
@@ -442,21 +488,13 @@
   }
 
   @override
-  void visitFieldFormalParameter(FieldFormalParameter node) {
-    if (entity == node.identifier) {
-      optype.isPrefixed = true;
-    } else {
+  void visitNormalFormalParameter(NormalFormalParameter node) {
+    if (node.identifier != entity) {
       optype.includeReturnValueSuggestions = true;
       optype.includeTypeNameSuggestions = true;
     }
   }
 
-  @override
-  void visitNormalFormalParameter(NormalFormalParameter node) {
-    optype.includeReturnValueSuggestions = true;
-    optype.includeTypeNameSuggestions = true;
-  }
-
   void visitParenthesizedExpression(ParenthesizedExpression node) {
     if (identical(entity, node.expression)) {
       optype.includeReturnValueSuggestions = true;
@@ -472,7 +510,13 @@
 
   @override
   void visitPrefixedIdentifier(PrefixedIdentifier node) {
-    if (identical(entity, node.identifier)) {
+    if (identical(entity, node.identifier) ||
+        // In addition to the standard case,
+        // handle the exceptional case where the parser considers the would-be
+        // identifier to be a keyword and inserts a synthetic identifier
+        (node.identifier != null &&
+            node.identifier.isSynthetic &&
+            identical(entity, node.identifier.beginToken.previous))) {
       optype.isPrefixed = true;
       if (node.parent is TypeName && node.parent.parent is ConstructorName) {
         optype.includeConstructorSuggestions = true;
@@ -562,9 +606,9 @@
     if (entity is SwitchMember && entity != node.members.first) {
       SwitchMember member = entity as SwitchMember;
       if (offset <= member.offset) {
-          optype.includeReturnValueSuggestions = true;
-          optype.includeTypeNameSuggestions = true;
-          optype.includeVoidReturnSuggestions = true;
+        optype.includeReturnValueSuggestions = true;
+        optype.includeTypeNameSuggestions = true;
+        optype.includeVoidReturnSuggestions = true;
       }
     }
   }
diff --git a/pkg/analysis_server/lib/src/services/completion/prefixed_element_contributor.dart b/pkg/analysis_server/lib/src/services/completion/prefixed_element_contributor.dart
index f3a9db4..5a52da8 100644
--- a/pkg/analysis_server/lib/src/services/completion/prefixed_element_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/prefixed_element_contributor.dart
@@ -19,7 +19,6 @@
 
 import '../../protocol_server.dart'
     show CompletionSuggestion, CompletionSuggestionKind;
-import '../../protocol_server.dart' as protocol;
 
 /**
  * A contributor for calculating invocation / access suggestions
@@ -110,7 +109,6 @@
       ConstructorDeclaration constructorDecl =
           node.getAncestor((p) => p is ConstructorDeclaration);
       if (constructorDecl != null) {
-
         // Compute fields already referenced
         List<String> referencedFields = new List<String>();
         for (FormalParameter param in constructorDecl.parameters.parameters) {
@@ -129,7 +127,7 @@
         ClassDeclaration classDecl =
             constructorDecl.getAncestor((p) => p is ClassDeclaration);
         for (ClassMember member in classDecl.members) {
-          if (member is FieldDeclaration) {
+          if (member is FieldDeclaration && !member.isStatic) {
             for (VariableDeclaration varDecl in member.fields.variables) {
               SimpleIdentifier fieldId = varDecl.name;
               if (fieldId != null) {
@@ -213,7 +211,6 @@
  * and if found, tries to determine a type for that declaration.
  */
 class _LocalBestTypeVisitor extends LocalDeclarationVisitor {
-
   /**
    * The name for the declaration to be found.
    */
@@ -403,9 +400,16 @@
           if (directive.prefix.name == element.name) {
             // Suggest elements from the imported library
             LibraryElement library = directive.uriElement;
-            LibraryElementSuggestionBuilder.suggestionsFor(request,
-                CompletionSuggestionKind.INVOCATION, library,
-                request.target.containingNode.parent is TypeName);
+            AstNode node = request.target.containingNode;
+            bool typesOnly = node.parent is TypeName;
+            bool instCreation =
+                typesOnly && node.parent.parent is ConstructorName;
+            LibraryElementSuggestionBuilder.suggestionsFor(
+                request,
+                CompletionSuggestionKind.INVOCATION,
+                library,
+                typesOnly,
+                instCreation);
             modified = true;
             if (directive.deferredKeyword != null) {
               FunctionElement loadLibFunct = library.loadLibraryFunction;
diff --git a/pkg/analysis_server/lib/src/services/completion/suggestion_builder.dart b/pkg/analysis_server/lib/src/services/completion/suggestion_builder.dart
index c6e376a..5117855 100644
--- a/pkg/analysis_server/lib/src/services/completion/suggestion_builder.dart
+++ b/pkg/analysis_server/lib/src/services/completion/suggestion_builder.dart
@@ -13,8 +13,9 @@
 import 'package:analysis_server/src/services/completion/dart_completion_manager.dart';
 import 'package:analyzer/src/generated/ast.dart';
 import 'package:analyzer/src/generated/element.dart';
-import 'package:analyzer/src/generated/utilities_dart.dart';
+import 'package:analyzer/src/generated/engine.dart' as engine;
 import 'package:analyzer/src/generated/source.dart';
+import 'package:analyzer/src/generated/utilities_dart.dart';
 import 'package:path/path.dart' as path;
 
 const String DYNAMIC = 'dynamic';
@@ -26,18 +27,27 @@
  * importForSource as the source to which an import should be added.
  */
 CompletionSuggestion createSuggestion(Element element,
-    {CompletionSuggestionKind kind: CompletionSuggestionKind.INVOCATION,
-    int relevance: DART_RELEVANCE_DEFAULT, Source importForSource}) {
+    {String completion,
+    CompletionSuggestionKind kind: CompletionSuggestionKind.INVOCATION,
+    int relevance: DART_RELEVANCE_DEFAULT,
+    Source importForSource}) {
   if (element is ExecutableElement && element.isOperator) {
     // Do not include operators in suggestions
     return null;
   }
-  String completion = element.displayName;
+  if (completion == null) {
+    completion = element.displayName;
+  }
   bool isDeprecated = element.isDeprecated;
-  CompletionSuggestion suggestion = new CompletionSuggestion(kind,
-      isDeprecated ? DART_RELEVANCE_LOW : relevance, completion,
-      completion.length, 0, isDeprecated, false);
-  suggestion.element = protocol.newElement_fromEngine(element);
+  CompletionSuggestion suggestion = new CompletionSuggestion(
+      kind,
+      isDeprecated ? DART_RELEVANCE_LOW : relevance,
+      completion,
+      completion.length,
+      0,
+      isDeprecated,
+      false);
+  suggestion.element = protocol.convertElement(element);
   Element enclosingElement = element.enclosingElement;
   if (enclosingElement is ClassElement) {
     suggestion.declaringType = enclosingElement.displayName;
@@ -50,9 +60,10 @@
     suggestion.parameterTypes = element.parameters
         .map((ParameterElement parameter) => parameter.type.displayName)
         .toList();
-    suggestion.requiredParameterCount = element.parameters.where(
-        (ParameterElement parameter) =>
-            parameter.parameterKind == ParameterKind.REQUIRED).length;
+    suggestion.requiredParameterCount = element.parameters
+        .where((ParameterElement parameter) =>
+            parameter.parameterKind == ParameterKind.REQUIRED)
+        .length;
     suggestion.hasNamedParameters = element.parameters.any(
         (ParameterElement parameter) =>
             parameter.parameterKind == ParameterKind.NAMED);
@@ -130,7 +141,7 @@
 }
 
 /**
- * Starting with the given class node, traverse the inheritence hierarchy
+ * Starting with the given class node, traverse the inheritance hierarchy
  * calling the given functions with each non-null non-empty inherited class
  * declaration. For each locally defined declaration, call [localDeclaration].
  * For each class identifier in the hierarchy that is not defined locally,
@@ -175,7 +186,6 @@
  * Common mixin for sharing behavior
  */
 abstract class ElementSuggestionBuilder {
-
   /**
    * Return the kind of suggestions that should be built.
    */
@@ -189,7 +199,8 @@
   /**
    * Add a suggestion based upon the given element.
    */
-  void addSuggestion(Element element, {int relevance: DART_RELEVANCE_DEFAULT}) {
+  void addSuggestion(Element element,
+      {String prefix, int relevance: DART_RELEVANCE_DEFAULT}) {
     if (element.isPrivate) {
       LibraryElement elementLibrary = element.library;
       CompilationUnitElement unitElem = request.unit.element;
@@ -201,18 +212,25 @@
         return;
       }
     }
-    if (element.isSynthetic) {
+    if (prefix == null && element.isSynthetic) {
       if ((element is PropertyAccessorElement) ||
           element is FieldElement && !_isSpecialEnumField(element)) {
         return;
       }
     }
     String completion = element.displayName;
+    if (prefix != null && prefix.length > 0) {
+      if (completion == null || completion.length <= 0) {
+        completion = prefix;
+      } else {
+        completion = '$prefix.$completion';
+      }
+    }
     if (completion == null || completion.length <= 0) {
       return;
     }
-    CompletionSuggestion suggestion =
-        createSuggestion(element, kind: kind, relevance: relevance);
+    CompletionSuggestion suggestion = createSuggestion(element,
+        completion: completion, kind: kind, relevance: relevance);
     if (suggestion != null) {
       request.addSuggestion(suggestion);
     }
@@ -419,13 +437,19 @@
       {bool isSuper: false, String containingMethodName: null}) {
     CompilationUnit compilationUnit =
         request.target.containingNode.getAncestor((n) => n is CompilationUnit);
-    LibraryElement library = compilationUnit.element.library;
+    CompilationUnitElement unitElem = compilationUnit.element;
+    if (unitElem == null) {
+      engine.AnalysisEngine.instance.logger
+          .logInformation('Completion expected resolved AST');
+      return;
+    }
+    LibraryElement library = unitElem.library;
     if (type is DynamicTypeImpl) {
       type = request.cache.objectClassElement.type;
     }
     if (type is InterfaceType) {
-      return new InterfaceTypeSuggestionBuilder(request)._buildSuggestions(
-          type, library, isSuper, containingMethodName);
+      new InterfaceTypeSuggestionBuilder(request)
+          ._buildSuggestions(type, library, isSuper, containingMethodName);
     }
   }
 }
@@ -440,12 +464,18 @@
   final DartCompletionRequest request;
   final CompletionSuggestionKind kind;
   final bool typesOnly;
+  final bool instCreation;
 
-  LibraryElementSuggestionBuilder(this.request, this.kind, this.typesOnly);
+  LibraryElementSuggestionBuilder(
+      this.request, this.kind, this.typesOnly, this.instCreation);
 
   @override
   visitClassElement(ClassElement element) {
-    addSuggestion(element);
+    if (instCreation) {
+      element.visitChildren(this);
+    } else {
+      addSuggestion(element);
+    }
   }
 
   @override
@@ -460,6 +490,19 @@
   }
 
   @override
+  visitConstructorElement(ConstructorElement element) {
+    if (instCreation) {
+      ClassElement classElem = element.enclosingElement;
+      if (classElem != null) {
+        String prefix = classElem.name;
+        if (prefix != null && prefix.length > 0) {
+          addSuggestion(element, prefix: prefix);
+        }
+      }
+    }
+  }
+
+  @override
   visitElement(Element element) {
     // ignored
   }
@@ -473,7 +516,9 @@
 
   @override
   visitFunctionTypeAliasElement(FunctionTypeAliasElement element) {
-    addSuggestion(element);
+    if (!instCreation) {
+      addSuggestion(element);
+    }
   }
 
   @override
@@ -486,11 +531,15 @@
   /**
    * Add suggestions for the visible members in the given library
    */
-  static void suggestionsFor(DartCompletionRequest request,
-      CompletionSuggestionKind kind, LibraryElement library, bool typesOnly) {
+  static void suggestionsFor(
+      DartCompletionRequest request,
+      CompletionSuggestionKind kind,
+      LibraryElement library,
+      bool typesOnly,
+      bool instCreation) {
     if (library != null) {
-      library.visitChildren(
-          new LibraryElementSuggestionBuilder(request, kind, typesOnly));
+      library.visitChildren(new LibraryElementSuggestionBuilder(
+          request, kind, typesOnly, instCreation));
     }
   }
 }
@@ -500,7 +549,8 @@
  * the visible named constructors in that class.
  */
 class NamedConstructorSuggestionBuilder extends GeneralizingElementVisitor
-    with ElementSuggestionBuilder implements SuggestionBuilder {
+    with ElementSuggestionBuilder
+    implements SuggestionBuilder {
   final DartCompletionRequest request;
 
   NamedConstructorSuggestionBuilder(this.request);
diff --git a/pkg/analysis_server/lib/src/services/completion/uri_contributor.dart b/pkg/analysis_server/lib/src/services/completion/uri_contributor.dart
new file mode 100644
index 0000000..c6b20d3
--- /dev/null
+++ b/pkg/analysis_server/lib/src/services/completion/uri_contributor.dart
@@ -0,0 +1,202 @@
+// 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 services.completion.contributor.dart.importuri;
+
+import 'dart:async';
+import 'dart:core' hide Resource;
+
+import 'package:analysis_server/src/services/completion/dart_completion_manager.dart';
+import 'package:analyzer/file_system/file_system.dart';
+import 'package:analyzer/src/generated/ast.dart';
+import 'package:analyzer/src/generated/sdk.dart';
+import 'package:analyzer/src/generated/source.dart';
+import 'package:path/path.dart' show posix;
+import 'package:path/src/context.dart';
+
+import '../../protocol_server.dart'
+    show CompletionSuggestion, CompletionSuggestionKind;
+
+/**
+ * A contributor for calculating uri suggestions
+ * for import and part directives.
+ */
+class UriContributor extends DartCompletionContributor {
+  _UriSuggestionBuilder builder;
+
+  @override
+  bool computeFast(DartCompletionRequest request) {
+    builder = new _UriSuggestionBuilder(request);
+    return builder.computeFast(request.target.containingNode);
+  }
+
+  @override
+  Future<bool> computeFull(DartCompletionRequest request) {
+    return new Future.value(false);
+  }
+}
+
+class _UriSuggestionBuilder extends SimpleAstVisitor {
+  final DartCompletionRequest request;
+
+  _UriSuggestionBuilder(this.request);
+
+  bool computeFast(AstNode node) {
+    node.accept(this);
+    return true;
+  }
+
+  @override
+  visitExportDirective(ExportDirective node) {
+    visitNamespaceDirective(node);
+  }
+
+  @override
+  visitImportDirective(ImportDirective node) {
+    visitNamespaceDirective(node);
+  }
+
+  visitNamespaceDirective(NamespaceDirective node) {
+    StringLiteral uri = node.uri;
+    if (uri is SimpleStringLiteral) {
+      int offset = request.offset;
+      if (uri.offset < offset &&
+          (offset < uri.end || offset == uri.offset + 1)) {
+        // Handle degenerate case where import or export is only line in file
+        // and there is no semicolon
+        visitSimpleStringLiteral(uri);
+      }
+    }
+  }
+
+  @override
+  visitSimpleStringLiteral(SimpleStringLiteral node) {
+    AstNode parent = node.parent;
+    if (parent is NamespaceDirective && parent.uri == node) {
+      String partialUri = _extractPartialUri(node);
+      if (partialUri != null) {
+        _addDartSuggestions();
+        _addPackageSuggestions(partialUri);
+        _addFileSuggestions(partialUri);
+      }
+    } else if (parent is PartDirective && parent.uri == node) {
+      String partialUri = _extractPartialUri(node);
+      if (partialUri != null) {
+        _addFileSuggestions(partialUri);
+      }
+    }
+  }
+
+  void _addDartSuggestions() {
+    _addSuggestion('dart:');
+    SourceFactory factory = request.context.sourceFactory;
+    for (SdkLibrary lib in factory.dartSdk.sdkLibraries) {
+      if (!lib.isInternal && !lib.isImplementation) {
+        if (!lib.shortName.startsWith('dart:_')) {
+          _addSuggestion(lib.shortName,
+              relevance: lib.shortName == 'dart:core'
+                  ? DART_RELEVANCE_LOW
+                  : DART_RELEVANCE_DEFAULT);
+        }
+      }
+    }
+  }
+
+  void _addFileSuggestions(String partialUri) {
+    ResourceProvider resProvider = request.resourceProvider;
+    Context resContext = resProvider.pathContext;
+    Source source = request.source;
+
+    String parentUri;
+    if ((partialUri.endsWith('/'))) {
+      parentUri = partialUri;
+    } else {
+      parentUri = posix.dirname(partialUri);
+      if (parentUri != '.' && !parentUri.endsWith('/')) {
+        parentUri = '$parentUri/';
+      }
+    }
+    String uriPrefix = parentUri == '.' ? '' : parentUri;
+
+    String dirPath = resContext.normalize(parentUri);
+    if (resContext.isRelative(dirPath)) {
+      String sourceDirPath = resContext.dirname(source.fullName);
+      if (resContext.isAbsolute(sourceDirPath)) {
+        dirPath = resContext.join(sourceDirPath, dirPath);
+      } else {
+        return;
+      }
+    }
+
+    Resource dir = resProvider.getResource(dirPath);
+    if (dir is Folder) {
+      for (Resource child in dir.getChildren()) {
+        String completion;
+        if (child is Folder) {
+          completion = '$uriPrefix${child.shortName}/';
+        } else {
+          completion = '$uriPrefix${child.shortName}';
+        }
+        if (completion != source.shortName) {
+          _addSuggestion(completion);
+        }
+      }
+    }
+  }
+
+  void _addPackageFolderSuggestions(
+      String partial, String prefix, Folder folder) {
+    for (Resource child in folder.getChildren()) {
+      if (child is Folder) {
+        String childPrefix = '$prefix${child.shortName}/';
+        _addSuggestion(childPrefix);
+        if (partial.startsWith(childPrefix)) {
+          _addPackageFolderSuggestions(partial, childPrefix, child);
+        }
+      } else {
+        _addSuggestion('$prefix${child.shortName}');
+      }
+    }
+  }
+
+  void _addPackageSuggestions(String partial) {
+    SourceFactory factory = request.context.sourceFactory;
+    Map<String, List<Folder>> packageMap = factory.packageMap;
+    if (packageMap != null) {
+      _addSuggestion('package:');
+      packageMap.forEach((String pkgName, List<Folder> folders) {
+        String prefix = 'package:$pkgName/';
+        _addSuggestion(prefix);
+        for (Folder folder in folders) {
+          if (folder.exists) {
+            _addPackageFolderSuggestions(partial, prefix, folder);
+          }
+        }
+      });
+    }
+  }
+
+  void _addSuggestion(String completion,
+      {int relevance: DART_RELEVANCE_DEFAULT}) {
+    request.addSuggestion(new CompletionSuggestion(
+        CompletionSuggestionKind.IMPORT,
+        relevance,
+        completion,
+        completion.length,
+        0,
+        false,
+        false));
+  }
+
+  String _extractPartialUri(SimpleStringLiteral node) {
+    if (request.offset < node.contentsOffset) {
+      return null;
+    }
+    String partial = node.literal.lexeme.substring(
+        node.contentsOffset - node.offset, request.offset - node.offset);
+    request.replacementOffset = node.contentsOffset;
+    request.replacementLength = node.contentsEnd - node.contentsOffset;
+    return partial;
+  }
+}
diff --git a/pkg/analysis_server/lib/src/services/correction/assist.dart b/pkg/analysis_server/lib/src/services/correction/assist.dart
index 5bdbe24..45ad25f 100644
--- a/pkg/analysis_server/lib/src/services/correction/assist.dart
+++ b/pkg/analysis_server/lib/src/services/correction/assist.dart
@@ -4,7 +4,7 @@
 
 library services.correction.assist;
 
-import 'package:analysis_server/edit/assist/assist_core.dart';
+import 'package:analysis_server/plugin/edit/assist/assist_core.dart';
 import 'package:analysis_server/src/plugin/server_plugin.dart';
 import 'package:analyzer/src/generated/engine.dart';
 import 'package:analyzer/src/generated/java_engine.dart';
@@ -82,10 +82,12 @@
   static const REMOVE_TYPE_ANNOTATION =
       const AssistKind('REMOVE_TYPE_ANNOTATION', 29, "Remove type annotation");
   static const REPLACE_CONDITIONAL_WITH_IF_ELSE = const AssistKind(
-      'REPLACE_CONDITIONAL_WITH_IF_ELSE', 30,
+      'REPLACE_CONDITIONAL_WITH_IF_ELSE',
+      30,
       "Replace conditional with 'if-else'");
   static const REPLACE_IF_ELSE_WITH_CONDITIONAL = const AssistKind(
-      'REPLACE_IF_ELSE_WITH_CONDITIONAL', 30,
+      'REPLACE_IF_ELSE_WITH_CONDITIONAL',
+      30,
       "Replace 'if-else' with conditional ('c ? x : y')");
   static const SPLIT_AND_CONDITION =
       const AssistKind('SPLIT_AND_CONDITION', 30, "Split && condition");
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 cf87d27..d83ca2f 100644
--- a/pkg/analysis_server/lib/src/services/correction/assist_internal.dart
+++ b/pkg/analysis_server/lib/src/services/correction/assist_internal.dart
@@ -6,8 +6,8 @@
 
 import 'dart:collection';
 
-import 'package:analysis_server/edit/assist/assist_core.dart';
-import 'package:analysis_server/edit/assist/assist_dart.dart';
+import 'package:analysis_server/plugin/edit/assist/assist_core.dart';
+import 'package:analysis_server/plugin/edit/assist/assist_dart.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/name_suggestion.dart';
@@ -331,30 +331,27 @@
 
   void _addProposal_assignToLocalVariable() {
     // prepare enclosing ExpressionStatement
-    Statement statement = node.getAncestor((node) => node is Statement);
-    if (statement is! ExpressionStatement) {
+    ExpressionStatement expressionStatement;
+    for (AstNode node = this.node; node != null; node = node.parent) {
+      if (node is ExpressionStatement) {
+        expressionStatement = node;
+        break;
+      }
+      if (node is ArgumentList ||
+          node is AssignmentExpression ||
+          node is Statement ||
+          node is ThrowExpression) {
+        _coverageMarker();
+        return;
+      }
+    }
+    if (expressionStatement == null) {
       _coverageMarker();
       return;
     }
-    ExpressionStatement expressionStatement = statement as ExpressionStatement;
     // prepare expression
     Expression expression = expressionStatement.expression;
     int offset = expression.offset;
-    // ignore if in arguments
-    if (node.getAncestor((node) => node is ArgumentList) != null) {
-      _coverageMarker();
-      return;
-    }
-    // ignore if already assignment
-    if (expression is AssignmentExpression) {
-      _coverageMarker();
-      return;
-    }
-    // ignore "throw"
-    if (expression is ThrowExpression) {
-      _coverageMarker();
-      return;
-    }
     // prepare expression type
     DartType type = expression.bestType;
     if (type.isVoid) {
@@ -394,7 +391,7 @@
   void _addProposal_convertToBlockFunctionBody() {
     FunctionBody body = getEnclosingFunctionBody();
     // prepare expression body
-    if (body is! ExpressionFunctionBody) {
+    if (body is! ExpressionFunctionBody || body.isGenerator) {
       _coverageMarker();
       return;
     }
@@ -405,10 +402,16 @@
     String prefix = utils.getNodePrefix(body.parent);
     String indent = utils.getIndent(1);
     // add change
-    String statementCode =
-        (returnValueType.isVoid ? '' : 'return ') + returnValueCode;
     SourceBuilder sb = new SourceBuilder(file, body.offset);
-    sb.append('{$eol$prefix$indent$statementCode;');
+    if (body.isAsynchronous) {
+      sb.append('async ');
+    }
+    sb.append('{$eol$prefix$indent');
+    if (!returnValueType.isVoid) {
+      sb.append('return ');
+    }
+    sb.append(returnValueCode);
+    sb.append(';');
     sb.setExitOffset();
     sb.append('$eol$prefix}');
     _insertBuilder(sb, body.length);
@@ -419,7 +422,7 @@
   void _addProposal_convertToExpressionFunctionBody() {
     // prepare current body
     FunctionBody body = getEnclosingFunctionBody();
-    if (body is! BlockFunctionBody) {
+    if (body is! BlockFunctionBody || body.isGenerator) {
       _coverageMarker();
       return;
     }
@@ -442,12 +445,17 @@
       return;
     }
     // add change
-    String newBodySource = '=> ${_getNodeText(returnExpression)}';
+    SourceBuilder sb = new SourceBuilder(file, body.offset);
+    if (body.isAsynchronous) {
+      sb.append('async ');
+    }
+    sb.append('=> ');
+    sb.append(_getNodeText(returnExpression));
     if (body.parent is! FunctionExpression ||
         body.parent.parent is FunctionDeclaration) {
-      newBodySource += ';';
+      sb.append(';');
     }
-    _addReplaceEdit(rangeNode(body), newBodySource);
+    _insertBuilder(sb, body.length);
     // add proposal
     _addAssist(DartAssistKind.CONVERT_INTO_EXPRESSION_BODY, []);
   }
diff --git a/pkg/analysis_server/lib/src/services/correction/fix.dart b/pkg/analysis_server/lib/src/services/correction/fix.dart
index dde87a0..3fe6567 100644
--- a/pkg/analysis_server/lib/src/services/correction/fix.dart
+++ b/pkg/analysis_server/lib/src/services/correction/fix.dart
@@ -4,12 +4,13 @@
 
 library analysis_server.src.services.correction.fix;
 
-import 'package:analysis_server/edit/fix/fix_core.dart';
+import 'package:analysis_server/plugin/edit/fix/fix_core.dart';
 import 'package:analysis_server/src/plugin/server_plugin.dart';
 import 'package:analyzer/file_system/file_system.dart';
 import 'package:analyzer/src/generated/engine.dart';
 import 'package:analyzer/src/generated/error.dart';
 import 'package:analyzer/src/generated/java_engine.dart';
+import 'package:analyzer/src/generated/parser.dart';
 
 /**
  * Compute and return the fixes available for the given [error]. The error was
@@ -38,6 +39,63 @@
 }
 
 /**
+ * Return true if this [errorCode] is likely to have a fix associated with it.
+ */
+bool hasFix(ErrorCode errorCode) => errorCode ==
+        StaticWarningCode.UNDEFINED_CLASS_BOOLEAN ||
+    errorCode == StaticWarningCode.CONCRETE_CLASS_WITH_ABSTRACT_MEMBER ||
+    errorCode == StaticWarningCode.EXTRA_POSITIONAL_ARGUMENTS ||
+    errorCode == StaticWarningCode.NEW_WITH_UNDEFINED_CONSTRUCTOR ||
+    errorCode ==
+        StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE ||
+    errorCode ==
+        StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_TWO ||
+    errorCode ==
+        StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_THREE ||
+    errorCode ==
+        StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FOUR ||
+    errorCode ==
+        StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_FIVE_PLUS ||
+    errorCode == StaticWarningCode.CAST_TO_NON_TYPE ||
+    errorCode == StaticWarningCode.TYPE_TEST_WITH_UNDEFINED_NAME ||
+    errorCode == StaticWarningCode.UNDEFINED_CLASS ||
+    errorCode == StaticWarningCode.FINAL_NOT_INITIALIZED ||
+    errorCode == StaticWarningCode.FINAL_NOT_INITIALIZED_CONSTRUCTOR_1 ||
+    errorCode == StaticWarningCode.FINAL_NOT_INITIALIZED_CONSTRUCTOR_2 ||
+    errorCode == StaticWarningCode.FINAL_NOT_INITIALIZED_CONSTRUCTOR_3_PLUS ||
+    errorCode == StaticWarningCode.UNDEFINED_IDENTIFIER ||
+    errorCode ==
+        CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE ||
+    errorCode == CompileTimeErrorCode.INVALID_ANNOTATION ||
+    errorCode == CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT ||
+    errorCode == CompileTimeErrorCode.PART_OF_NON_PART ||
+    errorCode ==
+        CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT ||
+    errorCode == CompileTimeErrorCode.URI_DOES_NOT_EXIST ||
+    errorCode == HintCode.DEAD_CODE ||
+    errorCode == HintCode.DIVISION_OPTIMIZATION ||
+    errorCode == HintCode.TYPE_CHECK_IS_NOT_NULL ||
+    errorCode == HintCode.TYPE_CHECK_IS_NULL ||
+    errorCode == HintCode.UNDEFINED_GETTER ||
+    errorCode == HintCode.UNDEFINED_SETTER ||
+    errorCode == HintCode.UNNECESSARY_CAST ||
+    errorCode == HintCode.UNUSED_CATCH_CLAUSE ||
+    errorCode == HintCode.UNUSED_CATCH_STACK ||
+    errorCode == HintCode.UNUSED_IMPORT ||
+    errorCode == HintCode.UNDEFINED_METHOD ||
+    errorCode == ParserErrorCode.EXPECTED_TOKEN ||
+    errorCode == ParserErrorCode.GETTER_WITH_PARAMETERS ||
+    errorCode == ParserErrorCode.VAR_AS_TYPE_NAME ||
+    errorCode == StaticTypeWarningCode.ILLEGAL_ASYNC_RETURN_TYPE ||
+    errorCode == StaticTypeWarningCode.INSTANCE_ACCESS_TO_STATIC_MEMBER ||
+    errorCode == StaticTypeWarningCode.INVOCATION_OF_NON_FUNCTION ||
+    errorCode == StaticTypeWarningCode.NON_TYPE_AS_TYPE_ARGUMENT ||
+    errorCode == StaticTypeWarningCode.UNDEFINED_FUNCTION ||
+    errorCode == StaticTypeWarningCode.UNDEFINED_GETTER ||
+    errorCode == StaticTypeWarningCode.UNDEFINED_METHOD ||
+    errorCode == StaticTypeWarningCode.UNDEFINED_SETTER;
+
+/**
  * An enumeration of possible quick fix kinds.
  */
 class DartFixKind {
@@ -51,6 +109,7 @@
       "Add optional positional parameter");
   static const ADD_MISSING_PARAMETER_REQUIRED = const FixKind(
       'ADD_MISSING_PARAMETER_REQUIRED', 30, "Add required parameter");
+  static const ADD_NE_NULL = const FixKind('ADD_NE_NULL', 50, "Add != null");
   static const ADD_PACKAGE_DEPENDENCY = const FixKind(
       'ADD_PACKAGE_DEPENDENCY', 50, "Add dependency on package '{0}'");
   static const ADD_PART_OF =
@@ -85,7 +144,7 @@
   static const CREATE_METHOD =
       const FixKind('CREATE_METHOD', 50, "Create method '{0}'");
   static const CREATE_MISSING_OVERRIDES = const FixKind(
-      'CREATE_MISSING_OVERRIDES', 50, "Create {0} missing override(s)");
+      'CREATE_MISSING_OVERRIDES', 49, "Create {0} missing override(s)");
   static const CREATE_NO_SUCH_METHOD = const FixKind(
       'CREATE_NO_SUCH_METHOD', 51, "Create 'noSuchMethod' method");
   static const IMPORT_LIBRARY_PREFIX = const FixKind('IMPORT_LIBRARY_PREFIX',
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 d1ec86e..a6f3099 100644
--- a/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
+++ b/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
@@ -7,9 +7,9 @@
 import 'dart:collection';
 import 'dart:core' hide Resource;
 
-import 'package:analysis_server/edit/fix/fix_core.dart';
-import 'package:analysis_server/edit/fix/fix_dart.dart';
-import 'package:analysis_server/src/protocol.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/plugin/protocol/protocol.dart'
     hide AnalysisError, Element, ElementKind;
 import 'package:analysis_server/src/protocol_server.dart'
     show doSourceChange_addElementEdit, doSourceChange_addSourceEdit;
@@ -35,7 +35,6 @@
 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 ppp;
 
 /**
  * A predicate is a one-argument function that returns a boolean value.
@@ -272,6 +271,9 @@
     if (errorCode == StaticTypeWarningCode.INVOCATION_OF_NON_FUNCTION) {
       _addFix_removeParentheses_inGetterInvocation();
     }
+    if (errorCode == StaticTypeWarningCode.NON_BOOL_CONDITION) {
+      _addFix_nonBoolCondition_addNotNull();
+    }
     if (errorCode == StaticTypeWarningCode.NON_TYPE_AS_TYPE_ARGUMENT) {
       _addFix_importLibrary_withType();
       _addFix_createClass();
@@ -452,6 +454,9 @@
       if (parent is PrefixedIdentifier) {
         PrefixedIdentifier prefixedIdentifier = parent;
         prefixElement = prefixedIdentifier.prefix.staticElement;
+        if (prefixElement == null) {
+          return;
+        }
         parent = prefixedIdentifier.parent;
         nameNode = prefixedIdentifier.identifier;
         name = prefixedIdentifier.identifier.name;
@@ -1334,6 +1339,7 @@
     }
     // may be there is an existing import,
     // but it is with prefix and we don't use this prefix
+    Set<Source> alreadyImportedWithPrefix = new Set<Source>();
     for (ImportElement imp in unitLibraryElement.imports) {
       // prepare element
       LibraryElement libraryElement = imp.importedLibrary;
@@ -1370,13 +1376,13 @@
         if (libraryElement.isInSdk) {
           libraryName = imp.uri;
         }
+        // don't add this library again
+        alreadyImportedWithPrefix.add(libraryElement.source);
         // update library
         String newShowCode = 'show ${StringUtils.join(showNames, ", ")}';
         _addReplaceEdit(
             rf.rangeOffsetEnd(showCombinator), newShowCode, unitLibraryElement);
         _addFix(DartFixKind.IMPORT_LIBRARY_SHOW, [libraryName]);
-        // we support only one import without prefix
-        return;
       }
     }
     // check SDK libraries
@@ -1417,6 +1423,10 @@
         if (librarySource.isInSystemLibrary) {
           continue;
         }
+        // maybe already imported with a prefix
+        if (alreadyImportedWithPrefix.contains(librarySource)) {
+          continue;
+        }
         // prepare LibraryElement
         LibraryElement libraryElement =
             context.getLibraryElement(librarySource);
@@ -1516,6 +1526,11 @@
     _addFix(DartFixKind.MAKE_CLASS_ABSTRACT, [className]);
   }
 
+  void _addFix_nonBoolCondition_addNotNull() {
+    _addInsertEdit(error.offset + error.length, ' != null');
+    _addFix(DartFixKind.ADD_NE_NULL, []);
+  }
+
   void _addFix_removeDeadCode() {
     AstNode coveringNode = this.coveredNode;
     if (coveringNode is Expression) {
@@ -1867,6 +1882,11 @@
           sourcePrefix = eol;
         }
         sourceSuffix = eol;
+        // use different utils
+        CompilationUnitElement targetUnitElement =
+            getCompilationUnitElement(targetClassElement);
+        CompilationUnit targetUnit = getParsedUnit(targetUnitElement);
+        utils = new CorrectionUtils(targetUnit);
       }
       String targetFile = targetElement.source.fullName;
       // build method source
diff --git a/pkg/analysis_server/lib/src/services/correction/name_suggestion.dart b/pkg/analysis_server/lib/src/services/correction/name_suggestion.dart
index c9e4ef6..5234405 100644
--- a/pkg/analysis_server/lib/src/services/correction/name_suggestion.dart
+++ b/pkg/analysis_server/lib/src/services/correction/name_suggestion.dart
@@ -11,46 +11,6 @@
 List<String> _KNOWN_METHOD_NAME_PREFIXES = ['get', 'is', 'to'];
 
 /**
- * Returns a list of words for the given camel case string.
- *
- * 'getCamelWords' => ['get', 'Camel', 'Words']
- * 'getHTMLText' => ['get', 'HTML', 'Text']
- */
-List<String> getCamelWords(String str) {
-  if (str == null || str.isEmpty) {
-    return <String>[];
-  }
-  List<String> parts = <String>[];
-  bool wasLowerCase = false;
-  bool wasUpperCase = false;
-  int wordStart = 0;
-  for (int i = 0; i < str.length; i++) {
-    int c = str.codeUnitAt(i);
-    var newLowerCase = isLowerCase(c);
-    var newUpperCase = isUpperCase(c);
-    // myWord
-    // | ^
-    if (wasLowerCase && newUpperCase) {
-      parts.add(str.substring(wordStart, i));
-      wordStart = i;
-    }
-    // myHTMLText
-    //   |   ^
-    if (wasUpperCase &&
-        newUpperCase &&
-        i + 1 < str.length &&
-        isLowerCase(str.codeUnitAt(i + 1))) {
-      parts.add(str.substring(wordStart, i));
-      wordStart = i;
-    }
-    wasLowerCase = newLowerCase;
-    wasUpperCase = newUpperCase;
-  }
-  parts.add(str.substring(wordStart));
-  return parts;
-}
-
-/**
  * Returns possible names for a variable with the given expected type and
  * expression assigned.
  */
diff --git a/pkg/analysis_server/lib/src/services/correction/namespace.dart b/pkg/analysis_server/lib/src/services/correction/namespace.dart
index 305052a..1ca99ba 100644
--- a/pkg/analysis_server/lib/src/services/correction/namespace.dart
+++ b/pkg/analysis_server/lib/src/services/correction/namespace.dart
@@ -57,8 +57,10 @@
  * [element] - the referenced element.
  * [importElementsMap] - the cache of [Element]s imported by [ImportElement]s.
  */
-ImportElement internal_getImportElement(LibraryElement libraryElement,
-    String prefix, Element element,
+ImportElement internal_getImportElement(
+    LibraryElement libraryElement,
+    String prefix,
+    Element element,
     Map<ImportElement, Set<Element>> importElementsMap) {
   // validate Element
   if (element == null) {
diff --git a/pkg/analysis_server/lib/src/services/correction/organize_directives.dart b/pkg/analysis_server/lib/src/services/correction/organize_directives.dart
index b12ecb1..a4adfac 100644
--- a/pkg/analysis_server/lib/src/services/correction/organize_directives.dart
+++ b/pkg/analysis_server/lib/src/services/correction/organize_directives.dart
@@ -4,12 +4,12 @@
 
 library services.src.refactoring.organize_directives;
 
-import 'package:analysis_server/src/protocol.dart' hide AnalysisError, Element;
+import 'package:analysis_server/plugin/protocol/protocol.dart'
+    hide AnalysisError, Element;
 import 'package:analysis_server/src/services/correction/strings.dart';
 import 'package:analyzer/src/generated/ast.dart';
 import 'package:analyzer/src/generated/error.dart';
 import 'package:analyzer/src/generated/scanner.dart';
-import 'dart:math';
 
 /**
  * Organizer of directives in the [unit].
@@ -57,7 +57,8 @@
 
   bool _isUnusedImport(UriBasedDirective directive) {
     for (AnalysisError error in errors) {
-      if (error.errorCode == HintCode.UNUSED_IMPORT &&
+      if ((error.errorCode == HintCode.DUPLICATE_IMPORT ||
+              error.errorCode == HintCode.UNUSED_IMPORT) &&
           directive.uri.offset == error.offset) {
         return true;
       }
diff --git a/pkg/analysis_server/lib/src/services/correction/sort_members.dart b/pkg/analysis_server/lib/src/services/correction/sort_members.dart
index e6acec7..1810cda 100644
--- a/pkg/analysis_server/lib/src/services/correction/sort_members.dart
+++ b/pkg/analysis_server/lib/src/services/correction/sort_members.dart
@@ -4,7 +4,7 @@
 
 library services.src.refactoring.sort_members;
 
-import 'package:analysis_server/src/protocol.dart' hide Element;
+import 'package:analysis_server/plugin/protocol/protocol.dart' hide Element;
 import 'package:analysis_server/src/services/correction/strings.dart';
 import 'package:analyzer/src/generated/ast.dart';
 import 'package:analyzer/src/generated/scanner.dart';
@@ -15,6 +15,8 @@
 class MemberSorter {
   static List<_PriorityItem> _PRIORITY_ITEMS = [
     new _PriorityItem(false, _MemberKind.UNIT_FUNCTION_MAIN, false),
+    new _PriorityItem(false, _MemberKind.UNIT_VARIABLE_CONST, false),
+    new _PriorityItem(false, _MemberKind.UNIT_VARIABLE_CONST, true),
     new _PriorityItem(false, _MemberKind.UNIT_VARIABLE, false),
     new _PriorityItem(false, _MemberKind.UNIT_VARIABLE, true),
     new _PriorityItem(false, _MemberKind.UNIT_ACCESSOR, false),
@@ -67,7 +69,8 @@
       String suffix = code.substring(code.length - suffixLength, code.length);
       int commonLength = findCommonOverlap(prefix, suffix);
       suffixLength -= commonLength;
-      SourceEdit edit = new SourceEdit(prefixLength,
+      SourceEdit edit = new SourceEdit(
+          prefixLength,
           initialCode.length - suffixLength - prefixLength,
           code.substring(prefixLength, code.length - suffixLength));
       edits.add(edit);
@@ -300,7 +303,11 @@
         List<VariableDeclaration> variables =
             variableDeclaration.variables.variables;
         if (!variables.isEmpty) {
-          kind = _MemberKind.UNIT_VARIABLE;
+          if (variableDeclaration.variables.isConst) {
+            kind = _MemberKind.UNIT_VARIABLE_CONST;
+          } else {
+            kind = _MemberKind.UNIT_VARIABLE;
+          }
           name = variables[0].name.name;
         }
       }
@@ -443,11 +450,12 @@
   static const UNIT_FUNCTION = const _MemberKind('UNIT_FUNCTION', 2);
   static const UNIT_FUNCTION_TYPE = const _MemberKind('UNIT_FUNCTION_TYPE', 3);
   static const UNIT_CLASS = const _MemberKind('UNIT_CLASS', 4);
-  static const UNIT_VARIABLE = const _MemberKind('UNIT_VARIABLE', 5);
-  static const CLASS_ACCESSOR = const _MemberKind('CLASS_ACCESSOR', 6);
-  static const CLASS_CONSTRUCTOR = const _MemberKind('CLASS_CONSTRUCTOR', 7);
-  static const CLASS_FIELD = const _MemberKind('CLASS_FIELD', 8);
-  static const CLASS_METHOD = const _MemberKind('CLASS_METHOD', 9);
+  static const UNIT_VARIABLE_CONST = const _MemberKind('UNIT_VARIABLE', 5);
+  static const UNIT_VARIABLE = const _MemberKind('UNIT_VARIABLE', 6);
+  static const CLASS_ACCESSOR = const _MemberKind('CLASS_ACCESSOR', 7);
+  static const CLASS_CONSTRUCTOR = const _MemberKind('CLASS_CONSTRUCTOR', 8);
+  static const CLASS_FIELD = const _MemberKind('CLASS_FIELD', 9);
+  static const CLASS_METHOD = const _MemberKind('CLASS_METHOD', 10);
 
   final String name;
   final int ordinal;
diff --git a/pkg/analysis_server/lib/src/services/correction/source_buffer.dart b/pkg/analysis_server/lib/src/services/correction/source_buffer.dart
index 56eac5b..d56aa3d 100644
--- a/pkg/analysis_server/lib/src/services/correction/source_buffer.dart
+++ b/pkg/analysis_server/lib/src/services/correction/source_buffer.dart
@@ -4,7 +4,7 @@
 
 library services.src.correction.source_buffer;
 
-import 'package:analysis_server/src/protocol.dart';
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analyzer/src/generated/source.dart';
 
 /**
diff --git a/pkg/analysis_server/lib/src/services/correction/source_range.dart b/pkg/analysis_server/lib/src/services/correction/source_range.dart
index 9ee7078..779dde7 100644
--- a/pkg/analysis_server/lib/src/services/correction/source_range.dart
+++ b/pkg/analysis_server/lib/src/services/correction/source_range.dart
@@ -11,7 +11,7 @@
 import 'package:analyzer/src/generated/source.dart';
 
 SourceRange rangeElementName(Element element) {
-  return new SourceRange(element.nameOffset, element.displayName.length);
+  return new SourceRange(element.nameOffset, element.nameLength);
 }
 
 SourceRange rangeEndEnd(a, b) {
diff --git a/pkg/analysis_server/lib/src/services/correction/statement_analyzer.dart b/pkg/analysis_server/lib/src/services/correction/statement_analyzer.dart
index de3da05..e7c8361 100644
--- a/pkg/analysis_server/lib/src/services/correction/statement_analyzer.dart
+++ b/pkg/analysis_server/lib/src/services/correction/statement_analyzer.dart
@@ -190,7 +190,8 @@
       AstNode lastNode = nodes.last;
       SourceRange rangeAfterLastNode = rangeEndEnd(lastNode, selection);
       if (_hasTokens(rangeAfterLastNode)) {
-        invalidSelection("The end of the selection contains characters that "
+        invalidSelection(
+            "The end of the selection contains characters that "
             "do not belong to a statement.",
             newLocation_fromUnit(unit, rangeAfterLastNode));
       }
diff --git a/pkg/analysis_server/lib/src/services/correction/status.dart b/pkg/analysis_server/lib/src/services/correction/status.dart
index df37d12..9fbc1af 100644
--- a/pkg/analysis_server/lib/src/services/correction/status.dart
+++ b/pkg/analysis_server/lib/src/services/correction/status.dart
@@ -4,7 +4,7 @@
 
 library services.status;
 
-import 'package:analysis_server/src/protocol.dart';
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 
 /**
  * An outcome of a condition checking operation.
diff --git a/pkg/analysis_server/lib/src/services/correction/strings.dart b/pkg/analysis_server/lib/src/services/correction/strings.dart
index 3c44fb6..c2ea6cb 100644
--- a/pkg/analysis_server/lib/src/services/correction/strings.dart
+++ b/pkg/analysis_server/lib/src/services/correction/strings.dart
@@ -119,6 +119,46 @@
 }
 
 /**
+ * Returns a list of words for the given camel case string.
+ *
+ * 'getCamelWords' => ['get', 'Camel', 'Words']
+ * 'getHTMLText' => ['get', 'HTML', 'Text']
+ */
+List<String> getCamelWords(String str) {
+  if (str == null || str.isEmpty) {
+    return <String>[];
+  }
+  List<String> parts = <String>[];
+  bool wasLowerCase = false;
+  bool wasUpperCase = false;
+  int wordStart = 0;
+  for (int i = 0; i < str.length; i++) {
+    int c = str.codeUnitAt(i);
+    var newLowerCase = isLowerCase(c);
+    var newUpperCase = isUpperCase(c);
+    // myWord
+    // | ^
+    if (wasLowerCase && newUpperCase) {
+      parts.add(str.substring(wordStart, i));
+      wordStart = i;
+    }
+    // myHTMLText
+    //   |   ^
+    if (wasUpperCase &&
+        newUpperCase &&
+        i + 1 < str.length &&
+        isLowerCase(str.codeUnitAt(i + 1))) {
+      parts.add(str.substring(wordStart, i));
+      wordStart = i;
+    }
+    wasLowerCase = newLowerCase;
+    wasUpperCase = newUpperCase;
+  }
+  parts.add(str.substring(wordStart));
+  return parts;
+}
+
+/**
  * Checks if [str] is `null`, empty or is whitespace.
  */
 bool isBlank(String str) {
diff --git a/pkg/analysis_server/lib/src/services/correction/util.dart b/pkg/analysis_server/lib/src/services/correction/util.dart
index 1af70b0..a74488f 100644
--- a/pkg/analysis_server/lib/src/services/correction/util.dart
+++ b/pkg/analysis_server/lib/src/services/correction/util.dart
@@ -6,7 +6,7 @@
 
 import 'dart:math';
 
-import 'package:analysis_server/src/protocol.dart'
+import 'package:analysis_server/plugin/protocol/protocol.dart'
     show SourceChange, SourceEdit;
 import 'package:analysis_server/src/protocol_server.dart'
     show doSourceChange_addElementEdit;
@@ -143,6 +143,18 @@
   return ranges;
 }
 
+/**
+ * Return the given [element] if it is a [CompilationUnitElement].
+ * Return the enclosing [CompilationUnitElement] of the given [element],
+ * maybe `null`.
+ */
+CompilationUnitElement getCompilationUnitElement(Element element) {
+  if (element is CompilationUnitElement) {
+    return element;
+  }
+  return element.getAncestor((e) => e is CompilationUnitElement);
+}
+
 String getDefaultValueCode(DartType type) {
   if (type != null) {
     String typeName = type.displayName;
@@ -175,7 +187,9 @@
  */
 String getElementQualifiedName(Element element) {
   ElementKind kind = element.kind;
-  if (kind == ElementKind.FIELD || kind == ElementKind.METHOD) {
+  if (kind == ElementKind.CONSTRUCTOR ||
+      kind == ElementKind.FIELD ||
+      kind == ElementKind.METHOD) {
     return '${element.enclosingElement.displayName}.${element.displayName}';
   } else {
     return element.displayName;
@@ -439,8 +453,7 @@
  * The resulting AST structure may or may not be resolved.
  */
 AstNode getParsedClassElementNode(ClassElement classElement) {
-  CompilationUnitElement unitElement =
-      classElement.getAncestor((e) => e is CompilationUnitElement);
+  CompilationUnitElement unitElement = getCompilationUnitElement(classElement);
   CompilationUnit unit = getParsedUnit(unitElement);
   int offset = classElement.nameOffset;
   AstNode classNameNode = new NodeLocator(offset).searchWithin(unit);
diff --git a/pkg/analysis_server/lib/src/services/generated/completion.dart.unused b/pkg/analysis_server/lib/src/services/generated/completion.dart.unused
deleted file mode 100644
index fad936f..0000000
--- a/pkg/analysis_server/lib/src/services/generated/completion.dart.unused
+++ /dev/null
@@ -1,3700 +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.
-
-// This code was auto-generated, is not intended to be edited, and is subject to
-// significant change. Please see the README file for more information.
-
-library services.completion;
-
-import 'dart:collection';
-import "dart:math" as math;
-
-import 'package:analysis_server/src/protocol.dart'
-    show CompletionSuggestionKind;
-import 'package:analyzer/src/generated/java_core.dart' hide StringUtils;
-import 'package:analyzer/src/generated/java_engine.dart';
-import 'package:analyzer/src/generated/java_io.dart';
-import 'package:analyzer/src/generated/ast.dart';
-import 'package:analyzer/src/generated/element.dart';
-import 'package:analyzer/src/generated/engine.dart';
-import 'package:analyzer/src/generated/error.dart';
-import 'package:analyzer/src/generated/resolver.dart';
-import 'package:analyzer/src/generated/scanner.dart';
-import 'package:analyzer/src/generated/sdk.dart';
-import 'package:analyzer/src/generated/source_io.dart';
-import 'package:analyzer/src/generated/utilities_dart.dart';
-
-import 'stubs.dart';
-import 'util.dart';
-
-class AstNodeClassifier_CompletionEngine_typeOf extends CompletionEngine_AstNodeClassifier {
-  final CompletionEngine CompletionEngine_this;
-
-  DartType result = null;
-
-  AstNodeClassifier_CompletionEngine_typeOf(this.CompletionEngine_this);
-
-  @override
-  Object visitPrefixedIdentifier(PrefixedIdentifier node) => visitSimpleIdentifier(node.identifier);
-
-  @override
-  Object visitSimpleIdentifier(SimpleIdentifier node) {
-    Element elem = node.bestElement;
-    if (elem != null && elem.kind == ElementKind.GETTER) {
-      PropertyAccessorElement accessor = elem as PropertyAccessorElement;
-      if (accessor.isSynthetic) {
-        PropertyInducingElement var2 = accessor.variable;
-        result = CompletionEngine_this._typeSearch(var2);
-      }
-    }
-    return null;
-  }
-}
-
-/**
- * The analysis engine for code completion.
- *
- * Note: During development package-private methods are used to group element-specific completion
- * utilities.
- *
- * TODO: Recognize when completion is requested in the middle of a multi-character operator.
- * Re-write the AST as it would be if an identifier were present at the completion point then
- * restart the analysis.
- */
-class CompletionEngine {
-  static String _C_DYNAMIC = "dynamic";
-
-  static String _C_FALSE = "false";
-
-  static String _C_NULL = "null";
-
-  static String _C_PARAMNAME = "arg";
-
-  static String _C_TRUE = "true";
-
-  static String _C_VAR = "var";
-
-  static String _C_VOID = "void";
-
-  static bool _isPrivate(Element element) {
-    String name = element.displayName;
-    return Identifier.isPrivateName(name);
-  }
-
-  static bool _isSyntheticIdentifier(Expression expression) => expression is SimpleIdentifier && expression.isSynthetic;
-
-  CompletionRequestor _requestor;
-
-  final CompletionFactory _factory;
-
-  AssistContext _context;
-
-  Filter _filter;
-
-  CompletionState _state;
-
-  List<LibraryElement> _libraries;
-
-  CompletionEngine(CompletionRequestor requestor, this._factory) {
-    this._requestor = requestor;
-    this._state = new CompletionState();
-  }
-
-  /**
-   * Analyze the source unit in the given context to determine completion proposals at the selection
-   * offset of the context.
-   *
-   * @throws Exception
-   */
-  void complete(AssistContext context) {
-    this._context = context;
-    _requestor.beginReporting();
-    AstNode completionNode = context.coveredNode;
-    if (completionNode != null) {
-      _state.context = completionNode;
-      CompletionEngine_TerminalNodeCompleter visitor = new CompletionEngine_TerminalNodeCompleter(this);
-      completionNode.accept(visitor);
-    }
-    _requestor.endReporting();
-  }
-
-  void _analyzeAnnotationName(SimpleIdentifier identifier) {
-    _filter = _createFilter(identifier);
-    CompletionEngine_NameCollector names = _collectTopLevelElementVisibleAt(identifier);
-    for (Element element in names.uniqueElements) {
-      if (element is PropertyAccessorElement) {
-        element = (element as PropertyAccessorElement).variable;
-      }
-      if (element is TopLevelVariableElement) {
-        TopLevelVariableElement variable = element as TopLevelVariableElement;
-        if (_state._isCompileTimeConstantRequired && !variable.isConst) {
-          continue;
-        }
-        _proposeName(element, identifier, names);
-      }
-      if (element is ClassElement) {
-        ClassElement classElement = element as ClassElement;
-        for (ConstructorElement constructor in classElement.constructors) {
-          _pNamedConstructor(classElement, constructor, identifier);
-        }
-      }
-    }
-  }
-
-  void _analyzeConstructorTypeName(SimpleIdentifier identifier) {
-    _filter = _createFilter(identifier);
-    List<Element> types = _findAllTypes(currentLibrary, TopLevelNamesKind.DECLARED_AND_IMPORTS);
-    for (Element type in types) {
-      if (type is ClassElement) {
-        _namedConstructorReference(type, identifier);
-      }
-    }
-    List<Element> prefixes = _findAllPrefixes();
-    for (Element prefix in prefixes) {
-      _pName(prefix, identifier);
-    }
-  }
-
-  void _analyzeDeclarationName(VariableDeclaration varDecl) {
-    // We might want to propose multiple names for a declaration based on types someday.
-    // For now, just use whatever is already there.
-    SimpleIdentifier identifier = varDecl.name;
-    _filter = _createFilter(identifier);
-    VariableDeclarationList varList = varDecl.parent as VariableDeclarationList;
-    TypeName type = varList.type;
-    if (identifier.length > 0) {
-      _pName3(identifier.name, CompletionSuggestionKind.LOCAL_VARIABLE);
-    }
-    if (type == null) {
-      if (varList.keyword == null) {
-        // Interpret as the type name of a typed variable declaration { DivE!; }
-        _analyzeLocalName(identifier);
-      }
-    } else {
-      _pParamName(type.name.name.toLowerCase());
-    }
-  }
-
-  void _analyzeDirectAccess(DartType receiverType, SimpleIdentifier completionNode) {
-    if (receiverType != null) {
-      // Complete this.!y where this is absent
-      Element rcvrTypeElem = receiverType.element;
-      if (receiverType.isDynamic) {
-        rcvrTypeElem = objectClassElement;
-      }
-      if (rcvrTypeElem is ClassElement) {
-        _directAccess(rcvrTypeElem as ClassElement, completionNode);
-      }
-    }
-  }
-
-  void _analyzeImmediateField(SimpleIdentifier fieldName) {
-    _filter = _createFilter(fieldName);
-    ClassDeclaration classDecl = fieldName.getAncestor((node) => node is ClassDeclaration);
-    ClassElement classElement = classDecl.element;
-    for (FieldElement field in classElement.fields) {
-      _pName3(field.displayName, CompletionSuggestionKind.FIELD);
-    }
-  }
-
-  void _analyzeLiteralReference(BooleanLiteral literal) {
-    //    state.setContext(literal);
-    Ident ident = _createIdent(literal.parent);
-    ident.token = literal.literal;
-    _filter = _createFilter(ident);
-    _analyzeLocalName(ident);
-  }
-
-  void _analyzeLocalName(SimpleIdentifier identifier) {
-    // Completion x!
-    _filter = _createFilter(identifier);
-    // TODO Filter out types that have no static members.
-    CompletionEngine_NameCollector names = _collectIdentifiersVisibleAt(identifier);
-    for (Element element in names.uniqueElements) {
-      if (_state._isSourceDeclarationStatic) {
-        if (element is FieldElement) {
-          if (!element.isStatic) {
-            continue;
-          }
-        } else if (element is PropertyAccessorElement) {
-          if (!element.isStatic) {
-            continue;
-          }
-        }
-      }
-      if (_state._isOptionalArgumentRequired) {
-        if (element is! ParameterElement) {
-          continue;
-        }
-        ParameterElement param = element as ParameterElement;
-        if (!param.parameterKind.isOptional) {
-          continue;
-        }
-      }
-      _proposeName(element, identifier, names);
-    }
-    if (_state._areLiteralsAllowed) {
-      _pNull();
-      _pTrue();
-      _pFalse();
-    }
-  }
-
-  void _analyzeNamedParameter(ArgumentList args, SimpleIdentifier identifier) {
-    // Completion x!
-    _filter = _createFilter(identifier);
-    // prepare parameters
-    List<ParameterElement> parameters = _getParameterElements(args);
-    if (parameters == null) {
-      return;
-    }
-    // remember already used names
-    Set<String> usedNames = new Set();
-    for (Expression arg in args.arguments) {
-      if (arg is NamedExpression) {
-        NamedExpression namedExpr = arg;
-        String name = namedExpr.name.label.name;
-        usedNames.add(name);
-      }
-    }
-    // propose named parameters
-    for (ParameterElement parameterElement in parameters) {
-      // should be named
-      if (parameterElement.parameterKind != ParameterKind.NAMED) {
-        continue;
-      }
-      // filter by name
-      if (_filterDisallows(parameterElement)) {
-        continue;
-      }
-      // may be already used
-      String parameterName = parameterElement.name;
-      if (usedNames.contains(parameterName)) {
-        continue;
-      }
-      // OK, add proposal
-      CompletionProposal prop = _createProposal4(CompletionSuggestionKind.NAMED_ARGUMENT);
-      prop.setCompletion(parameterName);
-      prop.setParameterName(parameterName);
-      prop.setParameterType(parameterElement.type.displayName);
-      prop.setLocation(identifier.offset);
-      prop.setReplacementLength(identifier.length);
-      prop.setRelevance(CompletionProposal.RELEVANCE_HIGH);
-      _requestor.accept(prop);
-    }
-  }
-
-  void _analyzeNewParameterName(List<FormalParameter> params, SimpleIdentifier typeIdent, String identifierName) {
-    String typeName = typeIdent.name;
-    _filter = _createFilter(_createIdent(typeIdent));
-    List<String> names = new List<String>();
-    for (FormalParameter node in params) {
-      names.add(node.identifier.name);
-    }
-    // Find name similar to typeName not in names, ditto for identifierName.
-    if (identifierName == null || identifierName.isEmpty) {
-      String candidate = typeName == null || typeName.isEmpty ? _C_PARAMNAME : typeName.toLowerCase();
-      _pParamName(_makeNonconflictingName(candidate, names));
-    } else {
-      _pParamName(_makeNonconflictingName(identifierName, names));
-      if (typeName != null && !typeName.isEmpty) {
-        _pParamName(_makeNonconflictingName(typeName.toLowerCase(), names));
-      }
-    }
-  }
-
-  void _analyzePositionalArgument(ArgumentList args, SimpleIdentifier identifier) {
-    // Show parameter name only if there is nothing to complete, so that if there is only
-    // one match, we won't to force user to choose.
-    if (!StringUtils.isEmpty(identifier.name)) {
-      return;
-    }
-    // prepare parameters
-    List<ParameterElement> parameters = _getParameterElements(args);
-    if (parameters == null) {
-      return;
-    }
-    // show current parameter
-    int argIndex = args.arguments.indexOf(identifier);
-    if (argIndex == -1) {
-      argIndex = 0;
-    }
-    if (argIndex >= 0 && argIndex < parameters.length) {
-      ParameterElement parameter = parameters[argIndex];
-      if (parameter.parameterKind != ParameterKind.NAMED) {
-        String parameterName = parameter.displayName;
-        CompletionProposal prop = _createProposal4(CompletionSuggestionKind.OPTIONAL_ARGUMENT);
-        prop.setCompletion(parameterName);
-        prop.setParameterName(parameterName);
-        prop.setParameterType(parameter.type.displayName);
-        prop.setLocation(identifier.offset);
-        prop.setReplacementLength(identifier.length);
-        prop.setRelevance(CompletionProposal.RELEVANCE_HIGH);
-        _requestor.accept(prop);
-      }
-    }
-  }
-
-  void _analyzePrefixedAccess(Expression receiver, SimpleIdentifier completionNode) {
-    if (receiver is ThisExpression && !_state._isThisAllowed) {
-      return;
-    }
-    DartType receiverType = _typeOf2(receiver);
-    bool forSuper = receiver is SuperExpression;
-    _analyzePrefixedAccess2(receiverType, forSuper, completionNode);
-  }
-
-  void _analyzePrefixedAccess2(DartType receiverType, bool forSuper, SimpleIdentifier completionNode) {
-    if (receiverType != null) {
-      // Complete x.!y
-      Element rcvrTypeElem = receiverType.element;
-      if (receiverType.isBottom) {
-        receiverType = objectType;
-      }
-      if (receiverType.isDynamic) {
-        receiverType = objectType;
-      }
-      if (receiverType is InterfaceType) {
-        _prefixedAccess(receiverType, forSuper, completionNode);
-      } else if (rcvrTypeElem is TypeParameterElement) {
-        TypeParameterElement typeParamElem = rcvrTypeElem;
-        _analyzePrefixedAccess2(typeParamElem.bound, false, completionNode);
-      }
-    }
-  }
-
-  void _analyzeReceiver(SimpleIdentifier identifier) {
-    // Completion x!.y
-    _filter = _createFilter(identifier);
-    CompletionEngine_NameCollector names = _collectIdentifiersVisibleAt(identifier);
-    for (Element element in names.uniqueElements) {
-      _proposeName(element, identifier, names);
-    }
-  }
-
-  void _analyzeSuperConstructorInvocation(SuperConstructorInvocation node) {
-    ClassDeclaration enclosingClassNode = node.getAncestor((node) => node is ClassDeclaration);
-    if (enclosingClassNode != null) {
-      ClassElement enclosingClassElement = enclosingClassNode.element;
-      if (enclosingClassElement != null) {
-        ClassElement superClassElement = enclosingClassElement.supertype.element;
-        _constructorReference(superClassElement, node.constructorName);
-      }
-    }
-  }
-
-  void _analyzeTypeName(SimpleIdentifier identifier, SimpleIdentifier nameIdent) {
-    _filter = _createFilter(identifier);
-    String name = nameIdent == null ? "" : nameIdent.name;
-    List<Element> types = _findAllTypes(currentLibrary, TopLevelNamesKind.DECLARED_AND_IMPORTS);
-    for (Element type in types) {
-      if (_state._isForMixin) {
-        if (type is! ClassElement) {
-          continue;
-        }
-        ClassElement classElement = type as ClassElement;
-        if (!classElement.isValidMixin) {
-          continue;
-        }
-      }
-      if (type.displayName == name) {
-        continue;
-      }
-      _pName(type, nameIdent);
-    }
-    if (!_state._isForMixin) {
-      ClassDeclaration classDecl = identifier.getAncestor((node) => node is ClassDeclaration);
-      if (classDecl != null) {
-        ClassElement classElement = classDecl.element;
-        for (TypeParameterElement param in classElement.typeParameters) {
-          _pName(param, nameIdent);
-        }
-      }
-    }
-    List<Element> prefixes = _findAllPrefixes();
-    for (Element prefix in prefixes) {
-      _pName(prefix, nameIdent);
-    }
-    if (_state._isDynamicAllowed) {
-      _pDynamic();
-    }
-    if (_state._isVarAllowed) {
-      _pVar();
-    }
-    if (_state._isVoidAllowed) {
-      _pVoid();
-    }
-  }
-
-  void _constructorReference(ClassElement classElement, SimpleIdentifier identifier) {
-    // Complete identifier when it refers to a constructor defined in classElement.
-    _filter = _createFilter(identifier);
-    for (ConstructorElement cons in classElement.constructors) {
-      if (_state._isCompileTimeConstantRequired == cons.isConst && _filterAllows(cons)) {
-        _pExecutable2(cons, identifier, false);
-      }
-    }
-  }
-
-  void _directAccess(ClassElement classElement, SimpleIdentifier identifier) {
-    _filter = _createFilter(identifier);
-    CompletionEngine_NameCollector names = _createNameCollector();
-    names.addLocalNames(identifier);
-    names._addNamesDefinedByHierarchy(classElement, false);
-    names._addTopLevelNames2(currentLibrary, TopLevelNamesKind.DECLARED_AND_IMPORTS);
-    _proposeNames(names, identifier);
-  }
-
-  void _dispatchPrefixAnalysis(InstanceCreationExpression node) {
-    // prepare ClassElement
-    ClassElement classElement;
-    {
-      Element typeElement = _typeOf2(node).element;
-      if (typeElement is! ClassElement) {
-        return;
-      }
-      classElement = typeElement as ClassElement;
-    }
-    // prepare constructor name
-    Identifier typeName = node.constructorName.type.name;
-    SimpleIdentifier identifier = null;
-    if (typeName is SimpleIdentifier) {
-      identifier = typeName;
-    } else if (typeName is PrefixedIdentifier) {
-      identifier = typeName.identifier;
-    }
-    if (identifier == null) {
-      identifier = _createIdent(node);
-    }
-    // analyze constructor name
-    _analyzeConstructorTypeName(identifier);
-    _constructorReference(classElement, identifier);
-  }
-
-  void _dispatchPrefixAnalysis2(MethodInvocation node) {
-    // This might be a library prefix on a top-level function
-    Expression expr = node.realTarget;
-    if (expr is SimpleIdentifier) {
-      SimpleIdentifier ident = expr;
-      if (ident.bestElement is PrefixElement) {
-        _prefixedAccess2(ident, node.methodName);
-        return;
-      } else if (ident.bestElement is ClassElement) {
-        _state._areInstanceReferencesProhibited = true;
-        _state._areStaticReferencesProhibited = false;
-      } else {
-        _state._areInstanceReferencesProhibited = false;
-        _state._areStaticReferencesProhibited = true;
-      }
-    }
-    if (expr == null) {
-      _analyzeLocalName(_createIdent(node));
-    } else {
-      _analyzePrefixedAccess(expr, node.methodName);
-    }
-  }
-
-  void _dispatchPrefixAnalysis3(PrefixedIdentifier node, SimpleIdentifier identifier) {
-    SimpleIdentifier receiverName = node.prefix;
-    Element receiver = receiverName.bestElement;
-    if (receiver == null) {
-      _prefixedAccess2(receiverName, identifier);
-      return;
-    }
-    while (true) {
-      if (receiver.kind == ElementKind.PREFIX || receiver.kind == ElementKind.IMPORT) {
-        // Complete lib_prefix.name
-        _prefixedAccess2(receiverName, identifier);
-      } else {
-        {
-          DartType receiverType;
-          DartType propType = _typeOf2(receiverName);
-          if (propType == null || propType.isDynamic) {
-            receiverType = _typeOf(receiver);
-          } else {
-            DartType declType = _typeOf(receiver);
-            if (propType.isMoreSpecificThan(declType)) {
-              receiverType = propType;
-            } else {
-              receiverType = declType;
-            }
-          }
-          _analyzePrefixedAccess2(receiverType, false, identifier);
-          break;
-        }
-      }
-      break;
-    }
-  }
-
-  void _fieldReference(ClassElement classElement, SimpleIdentifier identifier) {
-    // Complete identifier when it refers to a constructor defined in classElement.
-    _filter = _createFilter(identifier);
-    for (FieldElement cons in classElement.fields) {
-      if (_filterAllows(cons)) {
-        _pField(cons, identifier, classElement);
-      }
-    }
-  }
-
-  void _namedConstructorReference(ClassElement classElement, SimpleIdentifier identifier) {
-    // Complete identifier when it refers to a named constructor defined in classElement.
-    if (_filter == null) {
-      _filter = _createFilter(identifier);
-    }
-    for (ConstructorElement cons in classElement.constructors) {
-      if (!_isVisible(cons)) {
-        continue;
-      }
-      if (_state._isCompileTimeConstantRequired && !cons.isConst) {
-        continue;
-      }
-      _pNamedConstructor(classElement, cons, identifier);
-    }
-  }
-
-  void _namespacePubReference(NamespaceDirective node, Set<String> packageUris) {
-    // no import URI or package:
-    String prefix = _filter._prefix;
-    List<String> prefixStrings = prefix.split(":");
-    if (!prefix.isEmpty && !"package:".startsWith(prefixStrings[0])) {
-      return;
-    }
-    // if no URI yet, propose package:
-    if (prefix.isEmpty) {
-      _pImportUriWithScheme(node, "package:");
-      return;
-    }
-    // check "packages" folder for package libraries that are not added to AnalysisContext
-    {
-      Source contextSource = _context.source;
-      if (contextSource is FileBasedSource) {
-        FileBasedSource contextFileSource = contextSource;
-        String contextFilePath = contextFileSource.fullName;
-        JavaFile contextFile = new JavaFile(contextFilePath);
-        JavaFile contextFolder = contextFile.getParentFile();
-        JavaFile contextPackages = new JavaFile.relative(contextFolder, "packages");
-        if (contextPackages.isDirectory()) {
-          for (JavaFile packageFolder in contextPackages.listFiles()) {
-            String packageName = packageFolder.getName();
-            String packageLibName = "${packageName}.dart";
-            JavaFile packageFile = new JavaFile.relative(packageFolder, packageLibName);
-            if (packageFile.exists() && packageFile.isFile()) {
-              packageUris.add("package:${packageName}/${packageLibName}");
-            }
-          }
-        }
-      }
-    }
-    // add known package: URIs
-    for (String uri in packageUris) {
-      if (_filterDisallows2(uri)) {
-        continue;
-      }
-      CompletionProposal prop = _createProposal4(CompletionSuggestionKind.IMPORT);
-      prop.setCompletion(uri);
-      // put "lib" before "lib/src"
-      if (!uri.contains("/src/")) {
-        prop.setRelevance(CompletionProposal.RELEVANCE_HIGH);
-      }
-      // done
-      _requestor.accept(prop);
-    }
-  }
-
-  void _namespaceReference(NamespaceDirective node, SimpleStringLiteral literal) {
-    String lit = literal.literal.lexeme;
-    if (!lit.isEmpty) {
-      lit = lit.substring(1, math.max(lit.length - 1, 0));
-    }
-    _filter = _createFilter(new Ident.con2(node, lit, literal.offset + 1));
-    Set<String> packageUris = new Set();
-    List<LibraryElement> libraries = new List<LibraryElement>();
-    List<LibraryElement> librariesInLib = new List<LibraryElement>();
-    String currentLibraryName = currentLibrary.source.fullName;
-    AnalysisContext ac = analysisContext;
-    List<Source> sources = ac.librarySources;
-    for (Source s in sources) {
-      String sName = s.fullName;
-      // skip current library
-      if (currentLibraryName == sName) {
-        continue;
-      }
-      // ".pub-cache/..../unittest-0.8.8/lib/unittest.dart" -> "package:unittest/unittest.dart"
-      {
-        Uri uri = ac.sourceFactory.restoreUri(s);
-        if (uri != null) {
-          String uriString = uri.toString();
-          if (uriString.startsWith("package:")) {
-            packageUris.add(uriString);
-          }
-        }
-      }
-      LibraryElement lib = ac.getLibraryElement(s);
-      if (lib == null) {
-        continue;
-      } else if (_isUnitInLibFolder(lib.definingCompilationUnit)) {
-        librariesInLib.add(lib);
-      } else {
-        libraries.add(lib);
-      }
-    }
-    _namespaceSdkReference(node);
-    _namespacePubReference(node, packageUris);
-  }
-
-  void _namespaceSdkReference(NamespaceDirective node) {
-    String prefix = _filter._prefix;
-    List<String> prefixStrings = prefix.split(":");
-    if (!prefix.isEmpty && !"dart:".startsWith(prefixStrings[0])) {
-      return;
-    }
-    if (prefix.isEmpty) {
-      _pImportUriWithScheme(node, "dart:");
-      return;
-    }
-    // add DartSdk libraries
-    DartSdk dartSdk = analysisContext.sourceFactory.dartSdk;
-    for (SdkLibrary library in dartSdk.sdkLibraries) {
-      String name = library.shortName;
-      // ignore internal
-      if (library.isInternal) {
-        continue;
-      }
-      // ignore implementation
-      if (library.isImplementation) {
-        continue;
-      }
-      // standard libraries name name starting with "dart:"
-      name = StringUtils.removeStart(name, "dart:");
-      // ignore private libraries
-      if (Identifier.isPrivateName(name)) {
-        continue;
-      }
-      // add with "dart:" prefix
-      _pName3("dart:${name}", CompletionSuggestionKind.IMPORT);
-    }
-  }
-
-  void _operatorAccess(Expression expr, SimpleIdentifier identifier) {
-    _state._requiresOperators();
-    _analyzePrefixedAccess(expr, identifier);
-  }
-
-  void _prefixedAccess(InterfaceType type, bool forSuper, SimpleIdentifier identifier) {
-    // Complete identifier when it refers to field or method in classElement.
-    _filter = _createFilter(identifier);
-    CompletionEngine_NameCollector names = _createNameCollector();
-    if (_state._areInstanceReferencesProhibited) {
-      names._addNamesDefinedByType2(type);
-    } else {
-      names._addNamesDefinedByHierarchy2(type, forSuper);
-    }
-    _proposeNames(names, identifier);
-  }
-
-  void _prefixedAccess2(SimpleIdentifier prefixName, SimpleIdentifier identifier) {
-    if (_filter == null) {
-      _filter = _createFilter(identifier);
-    }
-    CompletionEngine_NameCollector names = _createNameCollector();
-    List<ImportElement> prefixImports = _importsWithName(prefixName);
-    // Library prefixes do not have a unique AST representation so we need to fudge state vars.
-    bool litsAllowed = _state._areLiteralsAllowed;
-    _state._areLiteralsAllowed = false;
-    names._addTopLevelNames(prefixImports, TopLevelNamesKind.DECLARED_AND_EXPORTS);
-    _state._areLiteralsAllowed = litsAllowed;
-    _proposeNames(names, identifier);
-  }
-
-  List<InterfaceType> _allSubtypes(ClassElement classElement) {
-    // TODO(scheglov) translate it
-    return [];
-  }
-
-  CompletionEngine_NameCollector _collectIdentifiersVisibleAt(AstNode ident) {
-    CompletionEngine_NameCollector names = _createNameCollector();
-    ScopedNameFinder finder = new ScopedNameFinder(_completionLocation());
-    ident.accept(finder);
-    names.addAll(finder.locals.values);
-    Declaration decl = finder.declaration;
-    if (decl != null && decl.parent is ClassDeclaration) {
-      ClassElement classElement = (decl.parent as ClassDeclaration).element;
-      names._addNamesDefinedByHierarchy(classElement, false);
-    }
-    names._addTopLevelNames2(currentLibrary, TopLevelNamesKind.DECLARED_AND_IMPORTS);
-    return names;
-  }
-
-  CompletionEngine_NameCollector _collectTopLevelElementVisibleAt(AstNode ident) {
-    CompletionEngine_NameCollector names = _createNameCollector();
-    names._addTopLevelNames2(currentLibrary, TopLevelNamesKind.DECLARED_AND_IMPORTS);
-    return names;
-  }
-
-  int _completionLocation() => _context.selectionOffset;
-
-  int _completionTokenOffset() => _completionLocation() - _filter._prefix.length;
-
-  List<FormalParameter> _copyWithout(NodeList oldList, AstNode deletion) {
-    List<FormalParameter> newList = new List<FormalParameter>();
-    oldList.accept(new GeneralizingAstVisitor_CompletionEngine_copyWithout(deletion, newList));
-    return newList;
-  }
-
-  Filter _createFilter(SimpleIdentifier ident) => new Filter.con1(ident, _context.selectionOffset);
-
-  Ident _createIdent(AstNode node) => new Ident.con1(node, _completionLocation());
-
-  CompletionEngine_NameCollector _createNameCollector() => new CompletionEngine_NameCollector(this);
-
-  CompletionProposal _createProposal(Element element) {
-    String completion = element.displayName;
-    return _createProposal3(element, completion);
-  }
-
-  CompletionProposal _createProposal2(Element element, SimpleIdentifier identifier) {
-    // Create a completion proposal for the element: variable, field, class, function.
-    if (_filterDisallows(element)) {
-      return null;
-    }
-    CompletionProposal prop = _createProposal(element);
-    Element container = element.enclosingElement;
-    if (container != null) {
-      prop.setDeclaringType(container.displayName);
-    }
-    DartType type = _typeOf(element);
-    if (type != null) {
-      prop.setReturnType(type.name);
-    }
-    if (identifier != null) {
-      prop.setReplacementLengthIdentifier(identifier.length);
-    }
-    return prop;
-  }
-
-  CompletionProposal _createProposal3(Element element, String completion) {
-    CompletionSuggestionKind kind = _proposalKindOf(element);
-    CompletionProposal prop = _createProposal4(kind);
-    prop.setElement(element);
-    prop.setCompletion(completion);
-    prop.setDeprecated(_isDeprecated(element));
-    if (_isPrivate(element)) {
-      prop.setRelevance(CompletionProposal.RELEVANCE_LOW);
-    }
-    if (_filter._isSameCasePrefix(element.name)) {
-      prop.incRelevance();
-    }
-    return prop;
-  }
-
-  CompletionProposal _createProposal4(CompletionSuggestionKind kind) => _factory.createCompletionProposal(kind, _completionTokenOffset());
-
-  List<LibraryElement> _currentLibraryList() {
-    Set<LibraryElement> libraries = new Set<LibraryElement>();
-    LibraryElement curLib = currentLibrary;
-    libraries.add(curLib);
-    Queue<LibraryElement> queue = new Queue<LibraryElement>();
-    queue.addAll(curLib.importedLibraries);
-    _currentLibraryLister(queue, libraries);
-    return new List.from(libraries);
-  }
-
-  void _currentLibraryLister(Queue<LibraryElement> queue, Set<LibraryElement> libraries) {
-    while (!queue.isEmpty) {
-      LibraryElement sourceLib = queue.removeFirst();
-      libraries.add(sourceLib);
-      List<LibraryElement> expLibs = sourceLib.exportedLibraries;
-      for (LibraryElement lib in expLibs) {
-        if (!libraries.contains(lib)) {
-          queue.add(lib);
-        }
-      }
-    }
-  }
-
-  bool _filterAllows(Element element) => _filter._match(element);
-
-  bool _filterDisallows(Element element) => !_filter._match(element);
-
-  bool _filterDisallows2(String name) => !_filter._match2(name);
-
-  List<Element> _findAllNotTypes(List<Element> elements) {
-    return elements.where((Element element) {
-      ElementKind kind = element.kind;
-      return kind == ElementKind.FUNCTION
-          || kind == ElementKind.TOP_LEVEL_VARIABLE
-          || kind == ElementKind.GETTER
-          || kind == ElementKind.SETTER;
-      }).toList();
-  }
-
-  List<Element> _findAllPrefixes() {
-    LibraryElement lib = _context.compilationUnitElement.enclosingElement;
-    return lib.prefixes;
-  }
-
-  List<Element> _findAllTypes(LibraryElement library, TopLevelNamesKind topKind) {
-    List<Element> elements = _findTopLevelElements(library, topKind);
-    return _findAllTypes2(elements);
-  }
-
-  List<Element> _findAllTypes2(List<Element> elements) {
-    return elements.where((Element element) {
-      ElementKind kind = element.kind;
-      return kind == ElementKind.CLASS
-          || kind == ElementKind.FUNCTION_TYPE_ALIAS;
-      }).toList();
-  }
-
-  List<Element> _findTopLevelElements(LibraryElement library, TopLevelNamesKind topKind) {
-    List<Element> elements = [];
-    if (topKind == TopLevelNamesKind.DECLARED_AND_IMPORTS) {
-      elements.addAll(CorrectionUtils.getTopLevelElements(library));
-      for (ImportElement imp in library.imports) {
-        elements.addAll(CorrectionUtils.getImportNamespace(imp).values);
-      }
-      _removeNotMatchingFilter(elements);
-    }
-    if (topKind == TopLevelNamesKind.DECLARED_AND_EXPORTS) {
-      elements.addAll(CorrectionUtils.getExportNamespace2(library).values);
-      _removeNotMatchingFilter(elements);
-    }
-    return elements;
-  }
-
-  AnalysisContext get analysisContext => _context.compilationUnitElement.context;
-
-  LibraryElement get currentLibrary => _context.compilationUnitElement.enclosingElement;
-
-  FunctionType _getFunctionType(Element element) {
-    if (element is ExecutableElement) {
-      ExecutableElement executableElement = element;
-      return executableElement.type;
-    }
-    if (element is VariableElement) {
-      VariableElement variableElement = element;
-      DartType type = variableElement.type;
-      if (type is FunctionType) {
-        return type;
-      }
-    }
-    return null;
-  }
-
-  ClassElement get objectClassElement => typeProvider.objectType.element;
-
-  InterfaceType get objectType => typeProvider.objectType;
-
-  List<ParameterElement> _getParameterElements(ArgumentList args) {
-    List<ParameterElement> parameters = null;
-    AstNode argsParent = args.parent;
-    if (argsParent is MethodInvocation) {
-      MethodInvocation invocation = argsParent;
-      Element nameElement = invocation.methodName.staticElement;
-      FunctionType functionType = _getFunctionType(nameElement);
-      if (functionType != null) {
-        parameters = functionType.parameters;
-      }
-    }
-    if (argsParent is InstanceCreationExpression) {
-      InstanceCreationExpression creation = argsParent;
-      ConstructorElement element = creation.staticElement;
-      if (element != null) {
-        parameters = element.parameters;
-      }
-    }
-    if (argsParent is Annotation) {
-      Annotation annotation = argsParent;
-      Element element = annotation.element;
-      if (element is ConstructorElement) {
-        parameters = element.parameters;
-      }
-    }
-    return parameters;
-  }
-
-  TypeProvider get typeProvider {
-    AnalysisContext analysisContext = _context.compilationUnitElement.context;
-    try {
-      return (analysisContext as InternalAnalysisContext).typeProvider;
-    } on AnalysisException catch (exception) {
-      // TODO(brianwilkerson) Figure out the right thing to do if the core cannot be resolved.
-      return null;
-    }
-  }
-
-  bool get hasErrorBeforeCompletionLocation {
-    List<AnalysisError> errors = _context.errors;
-    if (errors == null || errors.length == 0) {
-      return false;
-    }
-    return errors[0].offset <= _completionLocation();
-  }
-
-  List<ImportElement> _importsWithName(SimpleIdentifier libName) {
-    String name = libName.name;
-    List<ImportElement> imports = <ImportElement>[];
-    for (ImportElement imp in currentLibrary.imports) {
-      PrefixElement prefix = imp.prefix;
-      if (prefix != null) {
-        String impName = prefix.displayName;
-        if (name == impName) {
-          imports.add(imp);
-        }
-      }
-    }
-    return imports;
-  }
-
-  bool _isCompletingKeyword(Token keyword) {
-    if (keyword == null) {
-      return false;
-    }
-    int completionLoc = _context.selectionOffset;
-    if (completionLoc >= keyword.offset && completionLoc <= keyword.end) {
-      return true;
-    }
-    return false;
-  }
-
-  bool _isCompletionAfter(int loc) => loc <= _completionLocation();
-
-  bool _isCompletionBefore(int loc) => _completionLocation() <= loc;
-
-  bool _isCompletionBetween(int firstLoc, int secondLoc) => _isCompletionAfter(firstLoc) && _isCompletionBefore(secondLoc);
-
-  bool _isDeprecated(Element element) => element != null && element.isDeprecated;
-
-  bool _isInCurrentLibrary(Element element) {
-    LibraryElement libElement = currentLibrary;
-    return identical(element.library, libElement);
-  }
-
-  bool _isUnitInLibFolder(CompilationUnitElement cu) {
-    String pathString = cu.source.fullName;
-    if (pathString.indexOf("/lib/") == -1) {
-      return false;
-    }
-    return true;
-  }
-
-  bool _isVisible(Element element) => !_isPrivate(element) || _isInCurrentLibrary(element);
-
-  String _makeNonconflictingName(String candidate, List<String> names) {
-    String possibility = candidate;
-    int count = 0;
-    loop: while (true) {
-      String name = count == 0 ? possibility : "${possibility}${count}";
-      for (String conflict in names) {
-        if (name == conflict) {
-          count += 1;
-          continue loop;
-        }
-      }
-      return name;
-    }
-  }
-
-  void _pArgumentList(CompletionProposal proposal, int offset, int len) {
-    // prepare parameters
-    List<String> parameterNames = proposal.parameterNames;
-    if (parameterNames.length == 0) {
-      return;
-    }
-    // fill arguments proposal
-    CompletionProposal prop = _createProposal4(CompletionSuggestionKind.ARGUMENT_LIST);
-    prop.setElement(proposal.element);
-    prop.setCompletion(proposal.completion).setReturnType(proposal.returnType);
-    prop.setParameterNames(parameterNames);
-    prop.setParameterTypes(proposal.parameterTypes);
-    prop.setParameterStyle(proposal.positionalParameterCount, proposal.hasNamed, proposal.hasPositional);
-    prop.setReplacementLength(0).setLocation(_completionLocation());
-    prop.setRelevance(CompletionProposal.RELEVANCE_HIGH);
-    _requestor.accept(prop);
-  }
-
-  void _pDynamic() {
-    _pWord(_C_DYNAMIC, CompletionSuggestionKind.LOCAL_VARIABLE);
-  }
-
-  void _pExecutable(Element element, FunctionType functionType, SimpleIdentifier identifier, bool isPotentialMatch) {
-    // Create a completion proposal for the element: function, method, getter, setter, constructor.
-    String name = element.displayName;
-    if (name.isEmpty) {
-      return;
-    }
-    if (_filterDisallows(element)) {
-      return;
-    }
-    if (!_isVisible(element)) {
-      return;
-    }
-    // May be we are in argument of function type parameter, propose function reference.
-    if (_state._targetParameter != null) {
-      DartType parameterType = _state._targetParameter.type;
-      if (parameterType is FunctionType) {
-        if (functionType.isAssignableTo(parameterType)) {
-          _pName2(name, element, CompletionProposal.RELEVANCE_HIGH, CompletionSuggestionKind.METHOD_NAME);
-        }
-      }
-    }
-    CompletionProposal prop = _createProposal(element);
-    prop.setPotentialMatch(isPotentialMatch);
-    if (isPotentialMatch) {
-      prop.setRelevance(CompletionProposal.RELEVANCE_LOW);
-    }
-    _setParameterInfo(functionType, prop);
-    prop.setCompletion(name).setReturnType(functionType.returnType.displayName);
-    // If there is already argument list, then update only method name.
-    if (identifier.parent is MethodInvocation && (identifier.parent as MethodInvocation).argumentList != null) {
-      prop.setKind(CompletionSuggestionKind.METHOD_NAME);
-    }
-    Element container = element.enclosingElement;
-    if (container != null) {
-      prop.setDeclaringType(container.displayName);
-    }
-    _requestor.accept(prop);
-  }
-
-  void _pExecutable2(ExecutableElement element, SimpleIdentifier identifier, bool isPotentialMatch) {
-    _pExecutable(element, element.type, identifier, isPotentialMatch);
-  }
-
-  void _pExecutable3(VariableElement element, SimpleIdentifier identifier) {
-    // Create a completion proposal for the element: top-level variable.
-    String name = element.displayName;
-    if (name.isEmpty || _filterDisallows(element)) {
-      return;
-    }
-    CompletionProposal prop = _createProposal(element);
-    if (element.type != null) {
-      prop.setReturnType(element.type.name);
-    }
-    Element container = element.enclosingElement;
-    if (container != null) {
-      prop.setDeclaringType(container.displayName);
-    }
-    if (identifier != null) {
-      prop.setReplacementLengthIdentifier(identifier.length);
-    }
-    _requestor.accept(prop);
-  }
-
-  void _pFalse() {
-    _pWord(_C_FALSE, CompletionSuggestionKind.LOCAL_VARIABLE);
-  }
-
-  void _pField(FieldElement element, SimpleIdentifier identifier, ClassElement classElement) {
-    // Create a completion proposal for the element: field only.
-    if (_filterDisallows(element)) {
-      return;
-    }
-    CompletionProposal prop = _createProposal(element);
-    Element container = element.enclosingElement;
-    prop.setDeclaringType(container.displayName);
-    _requestor.accept(prop);
-  }
-
-  /**
-   * Proposes URI with the given scheme for the given [NamespaceDirective].
-   */
-  void _pImportUriWithScheme(NamespaceDirective node, String uriScheme) {
-    String newUri = "${uriScheme}${new String.fromCharCode(CompletionProposal.CURSOR_MARKER)}";
-    if (node.uri.isSynthetic) {
-      newUri = "'${newUri}'";
-      if (node.semicolon == null || node.semicolon.isSynthetic) {
-        newUri += ";";
-      }
-    }
-    if (_context.selectionOffset == node.keyword.end) {
-      newUri = " ${newUri}";
-    }
-    _pName3(newUri, CompletionSuggestionKind.IMPORT);
-  }
-
-  void _pKeyword(Token keyword) {
-    _filter = new Filter.con2(keyword.lexeme, keyword.offset, _completionLocation());
-    // This isn't as useful as it might seem. It only works in the case that completion
-    // is requested on an existing recognizable keyword.
-    // TODO: Add keyword proposal kind
-    CompletionProposal prop = _createProposal4(CompletionSuggestionKind.LIBRARY_PREFIX);
-    prop.setCompletion(keyword.lexeme);
-    _requestor.accept(prop);
-  }
-
-  void _pName(Element element, SimpleIdentifier identifier) {
-    CompletionProposal prop = _createProposal2(element, identifier);
-    if (prop != null) {
-      _requestor.accept(prop);
-    }
-  }
-
-  void _pName2(String name, Element element, int relevance, CompletionSuggestionKind kind) {
-    if (_filterDisallows2(name)) {
-      return;
-    }
-    CompletionProposal prop = _createProposal4(kind);
-    prop.setRelevance(relevance);
-    prop.setCompletion(name);
-    prop.setElement(element);
-    _requestor.accept(prop);
-  }
-
-  void _pName3(String name, CompletionSuggestionKind kind) {
-    if (_filterDisallows2(name)) {
-      return;
-    }
-    CompletionProposal prop = _createProposal4(kind);
-    prop.setCompletion(name);
-    _requestor.accept(prop);
-  }
-
-  void _pNamedConstructor(ClassElement classElement, ConstructorElement element, SimpleIdentifier identifier) {
-    // Create a completion proposal for the named constructor.
-    String name = classElement.displayName;
-    if (!element.displayName.isEmpty) {
-      name += ".${element.displayName}";
-    }
-    if (_filterDisallows2(name)) {
-      return;
-    }
-    CompletionProposal prop = _createProposal3(element, name);
-    _setParameterInfo(element.type, prop);
-    prop.setReturnType(element.type.returnType.name);
-    Element container = element.enclosingElement;
-    prop.setDeclaringType(container.displayName);
-    if (identifier != null) {
-      prop.setReplacementLengthIdentifier(identifier.length);
-    }
-    _requestor.accept(prop);
-  }
-
-  void _pNull() {
-    _pWord(_C_NULL, CompletionSuggestionKind.LOCAL_VARIABLE);
-  }
-
-  void _pParamName(String name) {
-    if (_filterDisallows2(name)) {
-      return;
-    }
-    CompletionProposal prop = _createProposal4(CompletionSuggestionKind.PARAMETER);
-    prop.setCompletion(name);
-    _requestor.accept(prop);
-  }
-
-  CompletionSuggestionKind _proposalKindOf(Element element) {
-    CompletionSuggestionKind kind;
-    while (true) {
-      if (element.kind == ElementKind.CONSTRUCTOR) {
-        kind = CompletionSuggestionKind.CONSTRUCTOR;
-      } else if (element.kind == ElementKind.FUNCTION) {
-        kind = CompletionSuggestionKind.FUNCTION;
-      } else if (element.kind == ElementKind.METHOD) {
-        kind = CompletionSuggestionKind.METHOD;
-      } else if (element.kind == ElementKind.GETTER) {
-        kind = CompletionSuggestionKind.GETTER;
-      } else if (element.kind == ElementKind.SETTER) {
-        kind = CompletionSuggestionKind.SETTER;
-      } else if (element.kind == ElementKind.CLASS) {
-        kind = CompletionSuggestionKind.CLASS;
-      } else if (element.kind == ElementKind.FIELD) {
-        kind = CompletionSuggestionKind.FIELD;
-      } else if (element.kind == ElementKind.IMPORT) {
-        kind = CompletionSuggestionKind.IMPORT;
-      } else if (element.kind == ElementKind.PARAMETER) {
-        kind = CompletionSuggestionKind.PARAMETER;
-      } else if (element.kind == ElementKind.PREFIX) {
-        kind = CompletionSuggestionKind.LIBRARY_PREFIX;
-      } else if (element.kind == ElementKind.FUNCTION_TYPE_ALIAS) {
-        kind = CompletionSuggestionKind.CLASS_ALIAS;
-      } else if (element.kind == ElementKind.TYPE_PARAMETER) {
-        kind = CompletionSuggestionKind.TYPE_PARAMETER;
-      } else if (element.kind == ElementKind.LOCAL_VARIABLE || element.kind == ElementKind.TOP_LEVEL_VARIABLE) {
-        kind = CompletionSuggestionKind.LOCAL_VARIABLE;
-      } else {
-        throw new IllegalArgumentException();
-      }
-      break;
-    }
-    return kind;
-  }
-
-  void _proposeCombinator(Combinator node, SimpleIdentifier identifier) {
-    _filter = _createFilter(identifier);
-    NamespaceDirective directive = node.parent as NamespaceDirective;
-    LibraryElement libraryElement = directive.uriElement;
-    if (libraryElement != null) {
-      // prepare Elements with unique names
-      CompletionEngine_NameCollector nameCollector = _createNameCollector();
-      Iterable<Element> elements = CorrectionUtils.getExportNamespace2(libraryElement).values;
-      for (Element element in elements) {
-        if (_filterDisallows(element)) {
-          continue;
-        }
-        nameCollector._mergeName(element);
-      }
-      // propose each Element
-      for (Element element in nameCollector.uniqueElements) {
-        CompletionProposal proposal = _createProposal(element);
-        if (proposal.kind == CompletionSuggestionKind.FUNCTION) {
-          proposal.setKind(CompletionSuggestionKind.METHOD_NAME);
-        }
-        _requestor.accept(proposal);
-      }
-    }
-  }
-
-  void _proposeName(Element element, SimpleIdentifier identifier, CompletionEngine_NameCollector names) {
-    while (true) {
-      if (element.kind == ElementKind.FUNCTION || element.kind == ElementKind.GETTER || element.kind == ElementKind.METHOD || element.kind == ElementKind.SETTER) {
-        ExecutableElement candidate = element as ExecutableElement;
-        _pExecutable2(candidate, identifier, names._isPotentialMatch(candidate));
-      } else if (element.kind == ElementKind.LOCAL_VARIABLE || element.kind == ElementKind.PARAMETER || element.kind == ElementKind.TOP_LEVEL_VARIABLE) {
-        FunctionType functionType = _getFunctionType(element);
-        if (functionType != null) {
-          _pExecutable(element, functionType, identifier, names._isPotentialMatch(element));
-        } else {
-          VariableElement var2 = element as VariableElement;
-          _pExecutable3(var2, identifier);
-        }
-      } else if (element.kind == ElementKind.CLASS) {
-        _pName(element, identifier);
-      } else {
-      }
-      break;
-    }
-  }
-
-  void _proposeNames(CompletionEngine_NameCollector names, SimpleIdentifier identifier) {
-    for (Element element in names.uniqueElements) {
-      _proposeName(element, identifier, names);
-    }
-  }
-
-  void _pTrue() {
-    _pWord(_C_TRUE, CompletionSuggestionKind.LOCAL_VARIABLE);
-  }
-
-  void _pVar() {
-    _pWord(_C_VAR, CompletionSuggestionKind.LOCAL_VARIABLE);
-  }
-
-  void _pVoid() {
-    _pWord(_C_VOID, CompletionSuggestionKind.LOCAL_VARIABLE);
-  }
-
-  void _pWord(String word, CompletionSuggestionKind kind) {
-    if (_filterDisallows2(word)) {
-      return;
-    }
-    CompletionProposal prop = _createProposal4(kind);
-    prop.setCompletion(word);
-    _requestor.accept(prop);
-  }
-
-  void _removeNotMatchingFilter(List<Element> elements) {
-    if (_filter == null) {
-      return;
-    }
-    _filter._makePattern();
-    _filter._removeNotMatching(elements);
-  }
-
-  void _setParameterInfo(FunctionType functionType, CompletionProposal prop) {
-    List<String> params = new List<String>();
-    List<String> types = new List<String>();
-    bool named = false, positional = false;
-    int posCount = 0;
-    for (ParameterElement param in functionType.parameters) {
-      if (!param.isSynthetic) {
-        while (true) {
-          if (param.parameterKind == ParameterKind.REQUIRED) {
-            posCount += 1;
-          } else if (param.parameterKind == ParameterKind.NAMED) {
-            named = true;
-          } else if (param.parameterKind == ParameterKind.POSITIONAL) {
-            positional = true;
-          }
-          break;
-        }
-        params.add(param.displayName);
-        types.add(param.type.toString());
-      }
-    }
-    prop.setParameterNames(params);
-    prop.setParameterTypes(types);
-    prop.setParameterStyle(posCount, named, positional);
-  }
-
-  SimpleIdentifier _typeDeclarationName(AstNode node) {
-    AstNode parent = node;
-    while (parent != null) {
-      if (parent is ClassDeclaration) {
-        return (parent as ClassDeclaration).name;
-      }
-      if (parent is ClassTypeAlias) {
-        return (parent as ClassTypeAlias).name;
-      }
-      if (parent is FunctionTypeAlias) {
-        return (parent as FunctionTypeAlias).name;
-      }
-      parent = parent.parent;
-    }
-    return null;
-  }
-
-  DartType _typeOf(Element receiver) {
-    DartType receiverType;
-    while (true) {
-      if (receiver.kind == ElementKind.FIELD || receiver.kind == ElementKind.PARAMETER || receiver.kind == ElementKind.LOCAL_VARIABLE || receiver.kind == ElementKind.TOP_LEVEL_VARIABLE) {
-        {
-          VariableElement receiverElement = receiver as VariableElement;
-          receiverType = receiverElement.type;
-          break;
-        }
-      } else if (receiver.kind == ElementKind.GETTER) {
-        PropertyAccessorElement accessor = receiver as PropertyAccessorElement;
-        if (accessor.isSynthetic) {
-          PropertyInducingElement inducer = accessor.variable;
-          DartType inducerType = inducer.type;
-          if (inducerType == null || inducerType.isDynamic) {
-            receiverType = _typeSearch(inducer);
-            if (receiverType != null) {
-              break;
-            }
-          }
-        }
-        FunctionType accType = accessor.type;
-        receiverType = accType == null ? null : accType.returnType;
-      } else if (receiver.kind == ElementKind.CONSTRUCTOR || receiver.kind == ElementKind.FUNCTION || receiver.kind == ElementKind.METHOD || receiver.kind == ElementKind.SETTER) {
-        {
-          ExecutableElement receiverElement = receiver as ExecutableElement;
-          FunctionType funType = receiverElement.type;
-          receiverType = funType == null ? null : funType.returnType;
-          break;
-        }
-      } else if (receiver.kind == ElementKind.CLASS) {
-        {
-          ClassElement receiverElement = receiver as ClassElement;
-          receiverType = receiverElement.type;
-          break;
-        }
-      } else if (receiver.kind == ElementKind.DYNAMIC) {
-        {
-          receiverType = DynamicTypeImpl.instance;
-          break;
-        }
-      } else if (receiver.kind == ElementKind.FUNCTION_TYPE_ALIAS) {
-        {
-          FunctionTypeAliasElement receiverElement = receiver as FunctionTypeAliasElement;
-          FunctionType funType = receiverElement.type;
-          receiverType = funType == null ? null : funType.returnType;
-          break;
-        }
-      } else {
-        {
-          receiverType = null;
-          break;
-        }
-      }
-      break;
-    }
-    return receiverType;
-  }
-
-  DartType _typeOf2(Expression expr) {
-    DartType type = expr.bestType;
-    if (type.isDynamic) {
-      AstNodeClassifier_CompletionEngine_typeOf visitor
-          = new AstNodeClassifier_CompletionEngine_typeOf(this);
-      expr.accept(visitor);
-      DartType result = visitor.result;
-      if (result != null) {
-        return result;
-      }
-    }
-    return type;
-  }
-
-  DartType _typeOfContainingClass(AstNode node) {
-    AstNode parent = node;
-    while (parent != null) {
-      if (parent is ClassDeclaration) {
-        return (parent as ClassDeclaration).element.type;
-      }
-      parent = parent.parent;
-    }
-    return DynamicTypeImpl.instance;
-  }
-
-  DartType _typeSearch(PropertyInducingElement varElement) {
-    // TODO(scheglov) translate it
-    return null;
-  }
-}
-
-abstract class CompletionEngine_AstNodeClassifier extends GeneralizingAstVisitor<Object> {
-  @override
-  Object visitNode(AstNode node) => null;
-}
-
-class CompletionEngine_CommentReferenceCompleter extends CompletionEngine_AstNodeClassifier {
-  final CompletionEngine CompletionEngine_this;
-
-  final SimpleIdentifier _identifier;
-
-  CompletionEngine_NameCollector _names;
-
-  Set<Element> _enclosingElements = new Set();
-
-  CompletionEngine_CommentReferenceCompleter(this.CompletionEngine_this, this._identifier) {
-    CompletionEngine_this._filter = CompletionEngine_this._createFilter(_identifier);
-    _names = CompletionEngine_this._collectTopLevelElementVisibleAt(_identifier);
-  }
-
-  @override
-  Object visitClassDeclaration(ClassDeclaration node) {
-    ClassElement classElement = node.element;
-    _names._addNamesDefinedByHierarchy(classElement, false);
-    _enclosingElements.add(classElement);
-    return null;
-  }
-
-  @override
-  Object visitComment(Comment node) {
-    node.parent.accept(this);
-    // propose names
-    for (Element element in _names.uniqueElements) {
-      CompletionProposal proposal = CompletionEngine_this._createProposal2(element, _identifier);
-      if (proposal != null) {
-        // we don't want to add arguments, just names
-        if (element is MethodElement || element is FunctionElement) {
-          proposal.setKind(CompletionSuggestionKind.METHOD_NAME);
-        }
-        // elevate priority for local elements
-        if (_enclosingElements.contains(element.enclosingElement)) {
-          proposal.setRelevance(CompletionProposal.RELEVANCE_HIGH);
-        }
-        // propose
-        CompletionEngine_this._requestor.accept(proposal);
-      }
-    }
-    // done
-    return null;
-  }
-
-  @override
-  Object visitConstructorDeclaration(ConstructorDeclaration node) {
-    _visitExecutableDeclaration(node);
-    // pass through
-    return node.parent.accept(this);
-  }
-
-  @override
-  Object visitFunctionDeclaration(FunctionDeclaration node) {
-    _visitExecutableDeclaration(node);
-    return null;
-  }
-
-  @override
-  Object visitFunctionTypeAlias(FunctionTypeAlias node) {
-    FunctionTypeAliasElement element = node.element;
-    _names._mergeNames(element.parameters);
-    _enclosingElements.add(element);
-    return null;
-  }
-
-  @override
-  Object visitMethodDeclaration(MethodDeclaration node) {
-    _visitExecutableDeclaration(node);
-    // pass through
-    return node.parent.accept(this);
-  }
-
-  void _visitExecutableDeclaration(Declaration node) {
-    ExecutableElement element = node.element as ExecutableElement;
-    _names._mergeNames(element.parameters);
-    _enclosingElements.add(element);
-  }
-}
-
-/**
- * An IdentifierCompleter is used to classify the parent of the completion node when it has
- * previously been determined that the completion node is a SimpleIdentifier.
- */
-class CompletionEngine_IdentifierCompleter extends CompletionEngine_AstNodeClassifier {
-  final CompletionEngine CompletionEngine_this;
-
-  SimpleIdentifier _completionNode;
-
-  CompletionEngine_IdentifierCompleter(this.CompletionEngine_this, SimpleIdentifier node) {
-    _completionNode = node;
-  }
-
-  @override
-  Object visitAnnotation(Annotation node) {
-    if (_completionNode is SimpleIdentifier) {
-      CompletionEngine_this._analyzeAnnotationName(_completionNode);
-    }
-    return null;
-  }
-
-  @override
-  Object visitArgumentList(ArgumentList node) {
-    if (_completionNode is SimpleIdentifier) {
-      if (CompletionEngine_this._isCompletionBetween(node.leftParenthesis.end, node.rightParenthesis.offset)) {
-        CompletionEngine_this._analyzeLocalName(_completionNode);
-        CompletionEngine_this._analyzePositionalArgument(node, _completionNode);
-        CompletionEngine_this._analyzeNamedParameter(node, _completionNode);
-      }
-    }
-    return null;
-  }
-
-  @override
-  Object visitAssignmentExpression(AssignmentExpression node) {
-    if (_completionNode is SimpleIdentifier) {
-      CompletionEngine_this._analyzeLocalName(_completionNode);
-    }
-    return null;
-  }
-
-  @override
-  Object visitBinaryExpression(BinaryExpression node) {
-    if (identical(node.leftOperand, _completionNode)) {
-      CompletionEngine_this._analyzeLocalName(_completionNode);
-    } else if (identical(node.rightOperand, _completionNode)) {
-      CompletionEngine_this._analyzeLocalName(_completionNode);
-    }
-    return null;
-  }
-
-  @override
-  Object visitCombinator(Combinator node) {
-    CompletionEngine_this._proposeCombinator(node, _completionNode);
-    return null;
-  }
-
-  @override
-  Object visitCommentReference(CommentReference node) {
-    AstNode comment = node.parent;
-    CompletionEngine_CommentReferenceCompleter visitor = new CompletionEngine_CommentReferenceCompleter(CompletionEngine_this, _completionNode);
-    return comment.accept(visitor);
-  }
-
-  @override
-  Object visitConstructorDeclaration(ConstructorDeclaration node) {
-    if (identical(node.returnType, _completionNode)) {
-      CompletionEngine_this._filter = CompletionEngine_this._createFilter(_completionNode);
-      CompletionEngine_this._pName3(_completionNode.name, CompletionSuggestionKind.CONSTRUCTOR);
-    }
-    return null;
-  }
-
-  @override
-  Object visitConstructorFieldInitializer(ConstructorFieldInitializer node) {
-    // { A() : this.!x = 1; }
-    if (identical(node.fieldName, _completionNode)) {
-      ClassElement classElement = (node.parent as ConstructorDeclaration).element.enclosingElement;
-      CompletionEngine_this._fieldReference(classElement, node.fieldName);
-    }
-    return null;
-  }
-
-  @override
-  Object visitConstructorName(ConstructorName node) {
-    if (identical(node.name, _completionNode)) {
-      // { new A.!c(); }
-      TypeName typeName = node.type;
-      if (typeName != null) {
-        DartType type = typeName.type;
-        Element typeElement = type.element;
-        if (typeElement is ClassElement) {
-          ClassElement classElement = typeElement;
-          CompletionEngine_this._constructorReference(classElement, node.name);
-        }
-      }
-    }
-    return null;
-  }
-
-  @override
-  Object visitDoStatement(DoStatement node) {
-    if (identical(node.condition, _completionNode)) {
-      CompletionEngine_this._analyzeLocalName(_completionNode);
-    }
-    return null;
-  }
-
-  @override
-  Object visitExpression(Expression node) {
-    SimpleIdentifier ident;
-    if (_completionNode is SimpleIdentifier) {
-      ident = _completionNode;
-    } else {
-      ident = CompletionEngine_this._createIdent(node);
-    }
-    CompletionEngine_this._analyzeLocalName(ident);
-    return null;
-  }
-
-  @override
-  Object visitExpressionFunctionBody(ExpressionFunctionBody node) {
-    if (identical(_completionNode, node.expression)) {
-      CompletionEngine_this._analyzeLocalName(_completionNode);
-    }
-    return null;
-  }
-
-  @override
-  Object visitExpressionStatement(ExpressionStatement node) {
-    SimpleIdentifier ident;
-    if (_completionNode is SimpleIdentifier) {
-      ident = _completionNode;
-    } else {
-      ident = CompletionEngine_this._createIdent(node);
-    }
-    CompletionEngine_this._analyzeLocalName(ident);
-    return null;
-  }
-
-  @override
-  Object visitFieldFormalParameter(FieldFormalParameter node) {
-    if (identical(_completionNode, node.identifier)) {
-      CompletionEngine_this._analyzeImmediateField(node.identifier);
-    }
-    return null;
-  }
-
-  @override
-  Object visitForEachStatement(ForEachStatement node) {
-    if (identical(node.iterator, _completionNode)) {
-      CompletionEngine_this._analyzeLocalName(_completionNode);
-    }
-    return null;
-  }
-
-  @override
-  Object visitFunctionTypeAlias(FunctionTypeAlias node) {
-    if (identical(node.name, _completionNode)) {
-      if (node.returnType == null) {
-        // This may be an incomplete class type alias
-        CompletionEngine_this._state._includesUndefinedTypes();
-        CompletionEngine_this._analyzeTypeName(node.name, CompletionEngine_this._typeDeclarationName(node));
-      }
-    }
-    return null;
-  }
-
-  @override
-  Object visitIfStatement(IfStatement node) {
-    if (identical(node.condition, _completionNode)) {
-      // { if (!) }
-      CompletionEngine_this._analyzeLocalName(new Ident.con3(node, _completionNode.token));
-    }
-    return null;
-  }
-
-  @override
-  Object visitInterpolationExpression(InterpolationExpression node) {
-    if (node.expression is SimpleIdentifier) {
-      SimpleIdentifier ident = node.expression as SimpleIdentifier;
-      CompletionEngine_this._analyzeLocalName(ident);
-    }
-    return null;
-  }
-
-  @override
-  Object visitLibraryIdentifier(LibraryIdentifier node) => null;
-
-  @override
-  Object visitMethodDeclaration(MethodDeclaration node) {
-    if (identical(_completionNode, node.name)) {
-      if (node.returnType == null) {
-        // class Foo {const F!(); }
-        CompletionEngine_this._analyzeLocalName(_completionNode);
-      }
-    }
-    return null;
-  }
-
-  @override
-  Object visitMethodInvocation(MethodInvocation node) {
-    if (identical(node.methodName, _completionNode)) {
-      // { x.!y() }
-      Expression expr = node.realTarget;
-      DartType receiverType;
-      if (expr == null) {
-        receiverType = CompletionEngine_this._typeOfContainingClass(node);
-        CompletionEngine_this._analyzeDirectAccess(receiverType, node.methodName);
-      } else {
-        CompletionEngine_this._dispatchPrefixAnalysis2(node);
-      }
-    } else if (identical(node.target, _completionNode)) {
-      // { x!.y() } -- only reached when node.getTarget() is a simple identifier.
-      if (_completionNode is SimpleIdentifier) {
-        SimpleIdentifier ident = _completionNode;
-        CompletionEngine_this._analyzeReceiver(ident);
-      }
-    }
-    return null;
-  }
-
-  @override
-  Object visitParenthesizedExpression(ParenthesizedExpression node) {
-    // Incomplete closure: foo((Str!)); We check if "()" is argument for function typed parameter.
-    if (node.parent is ArgumentList) {
-      ParameterElement parameterElement = node.bestParameterElement;
-      if (parameterElement != null && parameterElement.type is FunctionType) {
-        Ident ident = CompletionEngine_this._createIdent(_completionNode);
-        CompletionEngine_this._analyzeTypeName(_completionNode, ident);
-      }
-    }
-    return super.visitParenthesizedExpression(node);
-  }
-
-  @override
-  Object visitPrefixedIdentifier(PrefixedIdentifier node) {
-    if (identical(node.prefix, _completionNode)) {
-      // { x!.y }
-      CompletionEngine_this._analyzeLocalName(node.prefix);
-    } else {
-      // { v.! }
-      CompletionEngine_this._dispatchPrefixAnalysis3(node, node.identifier);
-    }
-    return null;
-  }
-
-  @override
-  Object visitPropertyAccess(PropertyAccess node) {
-    if (node.target != null && node.target.length == 0) {
-      return null;
-    }
-    // { o.!hashCode }
-    if (identical(node.propertyName, _completionNode)) {
-      CompletionEngine_this._analyzePrefixedAccess(node.realTarget, node.propertyName);
-    }
-    return null;
-  }
-
-  @override
-  Object visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) {
-    // { A.Fac() : this.!b(); }
-    if (identical(node.constructorName, _completionNode)) {
-      ClassElement classElement = node.staticElement.enclosingElement;
-      CompletionEngine_this._constructorReference(classElement, node.constructorName);
-    }
-    return null;
-  }
-
-  @override
-  Object visitReturnStatement(ReturnStatement node) {
-    if (_completionNode is SimpleIdentifier) {
-      CompletionEngine_this._analyzeLocalName(_completionNode);
-    }
-    return null;
-  }
-
-  @override
-  Object visitSimpleFormalParameter(SimpleFormalParameter node) {
-    if (identical(node.identifier, _completionNode)) {
-      if (node.keyword == null && node.type == null) {
-        Ident ident = CompletionEngine_this._createIdent(node);
-        CompletionEngine_this._analyzeTypeName(node.identifier, ident);
-      }
-    }
-    return null;
-  }
-
-  @override
-  Object visitSuperConstructorInvocation(SuperConstructorInvocation node) {
-    CompletionEngine_this._analyzeSuperConstructorInvocation(node);
-    return null;
-  }
-
-  @override
-  Object visitSwitchCase(SwitchCase node) {
-    if (identical(_completionNode, node.expression)) {
-      CompletionEngine_this._analyzeLocalName(_completionNode);
-    }
-    return null;
-  }
-
-  @override
-  Object visitSwitchStatement(SwitchStatement node) {
-    if (identical(node.expression, _completionNode)) {
-      CompletionEngine_this._analyzeLocalName(_completionNode);
-    }
-    return null;
-  }
-
-  @override
-  Object visitTypeName(TypeName node) {
-    AstNode parent = node.parent;
-    if (parent != null) {
-      CompletionEngine_TypeNameCompleter visitor = new CompletionEngine_TypeNameCompleter(CompletionEngine_this, _completionNode, node);
-      return parent.accept(visitor);
-    }
-    return null;
-  }
-
-  @override
-  Object visitTypeParameter(TypeParameter node) {
-    // { X<!Y> }
-    if (CompletionEngine_this._isCompletionBetween(node.offset, node.end)) {
-      CompletionEngine_this._analyzeTypeName(_completionNode, CompletionEngine_this._typeDeclarationName(node));
-    }
-    return null;
-  }
-
-  @override
-  Object visitVariableDeclaration(VariableDeclaration node) {
-    if (identical(node.name, _completionNode)) {
-      CompletionEngine_this._analyzeDeclarationName(node);
-    } else if (identical(node.initializer, _completionNode)) {
-      CompletionEngine_this._analyzeLocalName(node.initializer as SimpleIdentifier);
-    }
-    return null;
-  }
-
-  @override
-  Object visitWhileStatement(WhileStatement node) {
-    if (identical(node.condition, _completionNode)) {
-      CompletionEngine_this._analyzeLocalName(_completionNode);
-    }
-    return null;
-  }
-}
-
-class CompletionEngine_NameCollector {
-  final CompletionEngine CompletionEngine_this;
-
-  Map<String, List<Element>> _uniqueNames = new Map<String, List<Element>>();
-
-  Set<Element> _potentialMatches;
-
-  CompletionEngine_NameCollector(this.CompletionEngine_this);
-
-  void addAll(Iterable<SimpleIdentifier> values) {
-    for (SimpleIdentifier id in values) {
-      _mergeName(id.bestElement);
-    }
-  }
-
-  void addLocalNames(SimpleIdentifier identifier) {
-    AstNode node = identifier;
-    Declaration decl;
-    while ((decl = node.getAncestor((node) => node is Declaration)) != null) {
-      Element declElement = decl.element;
-      if (declElement is ExecutableElement) {
-        _addNamesDefinedByExecutable(declElement);
-      } else {
-        return;
-      }
-      node = decl.parent;
-    }
-  }
-
-  void _addNamesDefinedByExecutable(ExecutableElement execElement) {
-    _mergeNames(execElement.parameters);
-    _mergeNames(execElement.localVariables);
-    _mergeNames(execElement.functions);
-  }
-
-  void _addNamesDefinedByHierarchy(ClassElement classElement, bool forSuper) {
-    _addNamesDefinedByHierarchy2(classElement.type, forSuper);
-  }
-
-  void _addNamesDefinedByHierarchy2(InterfaceType type, bool forSuper) {
-    List<InterfaceType> superTypes = type.element.allSupertypes;
-    if (!forSuper) {
-      superTypes.insert(0, type);
-    }
-    _addNamesDefinedByTypes(superTypes);
-    // Collect names defined by subtypes separately so they can be identified later.
-    CompletionEngine_NameCollector potentialMatchCollector = CompletionEngine_this._createNameCollector();
-    if (!type.isObject) {
-      potentialMatchCollector._addNamesDefinedByTypes(CompletionEngine_this._allSubtypes(type.element));
-    }
-    _potentialMatches = new Set<Element>();
-    for (List<Element> matches in potentialMatchCollector._uniqueNames.values) {
-      for (Element match in matches) {
-        _mergeName(match);
-        _potentialMatches.add(match);
-      }
-    }
-  }
-
-  void _addNamesDefinedByType(ClassElement classElement) {
-    _addNamesDefinedByType2(classElement.type);
-  }
-
-  void _addNamesDefinedByType2(InterfaceType type) {
-    if (_inPrivateLibrary(type)) {
-      return;
-    }
-    List<PropertyAccessorElement> accessors = type.accessors;
-    _mergeNames(accessors);
-    List<MethodElement> methods = type.methods;
-    _mergeNames(methods);
-    _mergeNames(type.element.typeParameters);
-    _filterStaticRefs(accessors);
-    _filterStaticRefs(methods);
-  }
-
-  void _addNamesDefinedByTypes(List<InterfaceType> types) {
-    for (InterfaceType type in types) {
-      _addNamesDefinedByType2(type);
-    }
-  }
-
-  void _addTopLevelNames(List<ImportElement> imports, TopLevelNamesKind topKind) {
-    for (ImportElement imp in imports) {
-      Iterable<Element> elementsCollection = CorrectionUtils.getImportNamespace(imp).values;
-      List<Element> elements = [];
-      _addTopLevelNames4(elements);
-    }
-  }
-
-  void _addTopLevelNames2(LibraryElement library, TopLevelNamesKind topKind) {
-    List<Element> elements = CompletionEngine_this._findTopLevelElements(library, topKind);
-    _addTopLevelNames4(elements);
-  }
-
-  void _addTopLevelNames3(List<LibraryElement> libraries, TopLevelNamesKind topKind) {
-    for (LibraryElement library in libraries) {
-      _addTopLevelNames2(library, topKind);
-    }
-  }
-
-  Iterable<List<Element>> get names => _uniqueNames.values;
-
-  Iterable<Element> get uniqueElements {
-    List<Element> uniqueElements = [];
-    for (List<Element> uniques in _uniqueNames.values) {
-      Element element = uniques[0];
-      uniqueElements.add(element);
-    }
-    return uniqueElements;
-  }
-
-  bool _isPotentialMatch(Element element) => _potentialMatches != null && _potentialMatches.contains(element);
-
-  void _remove(Element element) {
-    String name = element.displayName;
-    List<Element> list = _uniqueNames[name];
-    if (list == null) {
-      return;
-    }
-    list.remove(element);
-    if (list.isEmpty) {
-      _uniqueNames.remove(name);
-    }
-  }
-
-  void _addTopLevelNames4(List<Element> elements) {
-    _mergeNames(CompletionEngine_this._findAllTypes2(elements));
-    if (!CompletionEngine_this._state._areClassesRequired) {
-      _mergeNames(CompletionEngine_this._findAllNotTypes(elements));
-      _mergeNames(CompletionEngine_this._findAllPrefixes());
-    }
-  }
-
-  void _filterStaticRefs(List<ExecutableElement> elements) {
-    for (ExecutableElement execElem in elements) {
-      if (CompletionEngine_this._state._areInstanceReferencesProhibited && !execElem.isStatic) {
-        _remove(execElem);
-      } else if (CompletionEngine_this._state._areStaticReferencesProhibited && execElem.isStatic) {
-        _remove(execElem);
-      } else if (!CompletionEngine_this._state._areOperatorsAllowed && execElem.isOperator) {
-        _remove(execElem);
-      } else if (CompletionEngine_this._state._areMethodsProhibited && !execElem.isOperator) {
-        _remove(execElem);
-      }
-    }
-  }
-
-  bool _inPrivateLibrary(InterfaceType type) {
-    LibraryElement lib = type.element.library;
-    if (!lib.name.startsWith("_")) {
-      return false;
-    }
-    // allow completion in the same library
-    if (identical(lib, CompletionEngine_this.currentLibrary)) {
-      return false;
-    }
-    // eliminate types defined in private libraries
-    return true;
-  }
-
-  void _mergeName(Element element) {
-    if (element == null) {
-      return;
-    }
-    // ignore private
-    String name = element.displayName;
-    if (Identifier.isPrivateName(name)) {
-      if (!CompletionEngine_this._isInCurrentLibrary(element)) {
-        return;
-      }
-    }
-    // add to other Element(s) with such name
-    List<Element> dups = _uniqueNames[name];
-    if (dups == null) {
-      dups = new List<Element>();
-      _uniqueNames[name] = dups;
-    }
-    dups.add(element);
-  }
-
-  void _mergeNames(List<Element> elements) {
-    for (Element element in elements) {
-      _mergeName(element);
-    }
-  }
-}
-
-/**
- * An StringCompleter is used to classify the parent of the completion node when it has previously
- * been determined that the completion node is a SimpleStringLiteral.
- */
-class CompletionEngine_StringCompleter extends CompletionEngine_AstNodeClassifier {
-  final CompletionEngine CompletionEngine_this;
-
-  SimpleStringLiteral _completionNode;
-
-  CompletionEngine_StringCompleter(this.CompletionEngine_this, SimpleStringLiteral node) {
-    _completionNode = node;
-  }
-
-  @override
-  Object visitNamespaceDirective(NamespaceDirective node) {
-    if (identical(_completionNode, node.uri)) {
-      CompletionEngine_this._namespaceReference(node, _completionNode);
-    }
-    return null;
-  }
-}
-
-/**
- * A TerminalNodeCompleter is used to classify the completion node when nothing else is known
- * about it.
- */
-class CompletionEngine_TerminalNodeCompleter extends CompletionEngine_AstNodeClassifier {
-  final CompletionEngine CompletionEngine_this;
-
-  CompletionEngine_TerminalNodeCompleter(this.CompletionEngine_this);
-
-  @override
-  Object visitArgumentList(ArgumentList node) {
-    if (node.arguments.isEmpty && CompletionEngine_this._isCompletionBetween(node.leftParenthesis.end, node.rightParenthesis.offset)) {
-      if (node.parent is MethodInvocation) {
-        // or node.getParent().accept(this); ?
-        MethodInvocation invokeNode = node.parent as MethodInvocation;
-        SimpleIdentifier methodName = invokeNode.methodName;
-        ProposalCollector proposalRequestor = new ProposalCollector(CompletionEngine_this._requestor);
-        try {
-          CompletionEngine_this._requestor = proposalRequestor;
-          CompletionEngine_this._dispatchPrefixAnalysis2(invokeNode);
-        } finally {
-          CompletionEngine_this._requestor = proposalRequestor.requestor;
-        }
-        int offset = methodName.offset;
-        int len = node.rightParenthesis.end - offset;
-        String name = methodName.name;
-        for (CompletionProposal proposal in proposalRequestor.proposals) {
-          if (proposal.completion == name) {
-            CompletionEngine_this._pArgumentList(proposal, offset, len);
-          }
-        }
-      } else if (node.parent is InstanceCreationExpression) {
-        InstanceCreationExpression invokeNode = node.parent as InstanceCreationExpression;
-        ConstructorName methodName = invokeNode.constructorName;
-        ProposalCollector proposalRequestor = new ProposalCollector(CompletionEngine_this._requestor);
-        try {
-          CompletionEngine_this._requestor = proposalRequestor;
-          CompletionEngine_this._dispatchPrefixAnalysis(invokeNode);
-        } finally {
-          CompletionEngine_this._requestor = proposalRequestor.requestor;
-        }
-        int offset = methodName.offset;
-        int len = node.rightParenthesis.end - offset;
-        for (CompletionProposal proposal in proposalRequestor.proposals) {
-          if (proposal.element == invokeNode.staticElement) {
-            CompletionEngine_this._pArgumentList(proposal, offset, len);
-          }
-        }
-      } else if (node.parent is Annotation) {
-        Annotation annotation = node.parent as Annotation;
-        Element annotationElement = annotation.element;
-        if (annotationElement is ConstructorElement) {
-          ConstructorElement constructorElement = annotationElement;
-          // we don't need any filter
-          CompletionEngine_this._filter = new Filter.con2("", -1, 0);
-          // fill parameters for "pArgumentList"
-          CompletionProposal prop = CompletionEngine_this._createProposal(constructorElement);
-          CompletionEngine_this._setParameterInfo(constructorElement.type, prop);
-          prop.setCompletion(constructorElement.enclosingElement.name);
-          // propose the whole parameters list
-          CompletionEngine_this._pArgumentList(prop, 0, 0);
-        }
-      }
-    }
-    if (CompletionEngine_this._isCompletionBetween(node.leftParenthesis.end, node.rightParenthesis.offset)) {
-      Ident ident = CompletionEngine_this._createIdent(node);
-      CompletionEngine_this._analyzeLocalName(ident);
-      CompletionEngine_this._analyzePositionalArgument(node, ident);
-      CompletionEngine_this._analyzeNamedParameter(node, ident);
-    }
-    return null;
-  }
-
-  @override
-  Object visitAsExpression(AsExpression node) {
-    if (CompletionEngine_this._isCompletionAfter(node.asOperator.end)) {
-      CompletionEngine_this._state._isDynamicAllowed = false;
-      CompletionEngine_this._state._isVoidAllowed = false;
-      CompletionEngine_this._analyzeTypeName(CompletionEngine_this._createIdent(node), null);
-    }
-    return null;
-  }
-
-  @override
-  Object visitAssertStatement(AssertStatement node) {
-    if (CompletionEngine_this._isCompletingKeyword(node.keyword)) {
-      CompletionEngine_this._pKeyword(node.keyword);
-    }
-    return null;
-  }
-
-  @override
-  Object visitBlock(Block node) {
-    if (CompletionEngine_this._isCompletionBetween(node.leftBracket.end, node.rightBracket.offset)) {
-      // { {! stmt; !} }
-      CompletionEngine_this._analyzeLocalName(CompletionEngine_this._createIdent(node));
-    }
-    return null;
-  }
-
-  @override
-  Object visitBooleanLiteral(BooleanLiteral node) {
-    CompletionEngine_this._analyzeLiteralReference(node);
-    return null;
-  }
-
-  @override
-  Object visitBreakStatement(BreakStatement node) {
-    if (CompletionEngine_this._isCompletingKeyword(node.keyword)) {
-      CompletionEngine_this._pKeyword(node.keyword);
-    }
-    return null;
-  }
-
-  @override
-  Object visitCatchClause(CatchClause node) {
-    if (CompletionEngine_this._isCompletingKeyword(node.onKeyword)) {
-      CompletionEngine_this._pKeyword(node.onKeyword);
-    } else if (CompletionEngine_this._isCompletingKeyword(node.catchKeyword)) {
-      CompletionEngine_this._pKeyword(node.catchKeyword);
-    }
-    return null;
-  }
-
-  @override
-  Object visitClassDeclaration(ClassDeclaration node) {
-    if (CompletionEngine_this._isCompletingKeyword(node.classKeyword)) {
-      CompletionEngine_this._pKeyword(node.classKeyword);
-    } else if (CompletionEngine_this._isCompletingKeyword(node.abstractKeyword)) {
-      CompletionEngine_this._pKeyword(node.abstractKeyword);
-    } else if (!node.leftBracket.isSynthetic) {
-      if (CompletionEngine_this._isCompletionAfter(node.leftBracket.end)) {
-        if (node.rightBracket.isSynthetic || CompletionEngine_this._isCompletionBefore(node.rightBracket.offset)) {
-          if (!CompletionEngine_this.hasErrorBeforeCompletionLocation) {
-            CompletionEngine_this._analyzeLocalName(CompletionEngine_this._createIdent(node));
-          }
-        }
-      }
-    }
-    // TODO { abstract ! class ! A ! extends B implements C, D ! {}}
-    return null;
-  }
-
-  @override
-  Object visitClassTypeAlias(ClassTypeAlias node) {
-    if (CompletionEngine_this._isCompletingKeyword(node.keyword)) {
-      CompletionEngine_this._pKeyword(node.keyword);
-    }
-    // TODO { typedef ! A ! = ! B ! with C, D !; }
-    return null;
-  }
-
-  @override
-  Object visitCombinator(Combinator node) {
-    if (CompletionEngine_this._isCompletingKeyword(node.keyword)) {
-      CompletionEngine_this._pKeyword(node.keyword);
-    }
-    return null;
-  }
-
-  @override
-  Object visitCompilationUnit(CompilationUnit node) => null;
-
-  @override
-  Object visitConstructorName(ConstructorName node) {
-    // { new A.!c(); }
-    TypeName typeName = node.type;
-    if (typeName != null) {
-      DartType type = typeName.type;
-      Element typeElement = type.element;
-      if (typeElement is ClassElement) {
-        ClassElement classElement = typeElement;
-        CompletionEngine_this._constructorReference(classElement, node.name);
-      }
-    }
-    return null;
-  }
-
-  @override
-  Object visitContinueStatement(ContinueStatement node) {
-    if (CompletionEngine_this._isCompletingKeyword(node.keyword)) {
-      CompletionEngine_this._pKeyword(node.keyword);
-    }
-    return null;
-  }
-
-  @override
-  Object visitDirective(Directive node) {
-    if (CompletionEngine_this._isCompletingKeyword(node.keyword)) {
-      CompletionEngine_this._pKeyword(node.keyword);
-    }
-    return null;
-  }
-
-  @override
-  Object visitDoStatement(DoStatement node) {
-    if (CompletionEngine_this._isCompletingKeyword(node.doKeyword)) {
-      CompletionEngine_this._pKeyword(node.doKeyword);
-    } else if (CompletionEngine_this._isCompletingKeyword(node.whileKeyword)) {
-      CompletionEngine_this._pKeyword(node.whileKeyword);
-    } else if (CompletionEngine_this._isCompletionBetween(node.condition.end, node.rightParenthesis.offset)) {
-      CompletionEngine_this._operatorAccess(node.condition, CompletionEngine_this._createIdent(node));
-    }
-    return null;
-  }
-
-  @override
-  Object visitDoubleLiteral(DoubleLiteral node) => null;
-
-  @override
-  Object visitExportDirective(ExportDirective node) {
-    visitNamespaceDirective(node);
-    return null;
-  }
-
-  @override
-  Object visitExpression(Expression node) {
-    CompletionEngine_this._analyzeLocalName(CompletionEngine_this._createIdent(node));
-    return null;
-  }
-
-  @override
-  Object visitExpressionFunctionBody(ExpressionFunctionBody node) {
-    if (node.expression != null && node.semicolon != null) {
-      if (CompletionEngine_this._isCompletionBetween(node.expression.end, node.semicolon.offset)) {
-        CompletionEngine_this._operatorAccess(node.expression, CompletionEngine_this._createIdent(node));
-      }
-    }
-    return null;
-  }
-
-  @override
-  Object visitExpressionStatement(ExpressionStatement node) {
-    CompletionEngine_this._analyzeLocalName(CompletionEngine_this._createIdent(node));
-    return null;
-  }
-
-  @override
-  Object visitExtendsClause(ExtendsClause node) {
-    if (CompletionEngine_this._isCompletingKeyword(node.keyword)) {
-      CompletionEngine_this._pKeyword(node.keyword);
-    } else if (node.superclass == null) {
-      // { X extends ! }
-      CompletionEngine_this._analyzeTypeName(CompletionEngine_this._createIdent(node), CompletionEngine_this._typeDeclarationName(node));
-    } else {
-      // { X extends ! Y }
-      CompletionEngine_this._analyzeTypeName(CompletionEngine_this._createIdent(node), CompletionEngine_this._typeDeclarationName(node));
-    }
-    return null;
-  }
-
-  @override
-  Object visitForEachStatement(ForEachStatement node) {
-    if (CompletionEngine_this._isCompletingKeyword(node.forKeyword)) {
-      CompletionEngine_this._pKeyword(node.forKeyword);
-    } else if (CompletionEngine_this._isCompletingKeyword(node.inKeyword)) {
-      CompletionEngine_this._pKeyword(node.inKeyword);
-    }
-    return null;
-  }
-
-  @override
-  Object visitFormalParameterList(FormalParameterList node) {
-    if (CompletionEngine_this._isCompletionBetween(node.leftParenthesis.end, node.rightParenthesis.offset)) {
-      NodeList<FormalParameter> params = node.parameters;
-      if (!params.isEmpty) {
-        FormalParameter last = params[params.length - 1];
-        if (CompletionEngine_this._isCompletionBetween(last.end, node.rightParenthesis.offset)) {
-          List<FormalParameter> newParams = CompletionEngine_this._copyWithout(params, last);
-          CompletionEngine_this._analyzeNewParameterName(newParams, last.identifier, null);
-        } else {
-          Ident ident = CompletionEngine_this._createIdent(node);
-          CompletionEngine_this._analyzeTypeName(ident, ident);
-        }
-      } else {
-        Ident ident = CompletionEngine_this._createIdent(node);
-        CompletionEngine_this._analyzeTypeName(ident, ident);
-      }
-    }
-    return null;
-  }
-
-  @override
-  Object visitForStatement(ForStatement node) {
-    if (CompletionEngine_this._isCompletingKeyword(node.forKeyword)) {
-      CompletionEngine_this._pKeyword(node.forKeyword);
-    }
-    return null;
-  }
-
-  @override
-  Object visitFunctionTypeAlias(FunctionTypeAlias node) {
-    if (CompletionEngine_this._isCompletingKeyword(node.keyword)) {
-      CompletionEngine_this._pKeyword(node.keyword);
-    }
-    return null;
-  }
-
-  @override
-  Object visitIfStatement(IfStatement node) {
-    if (CompletionEngine_this._isCompletingKeyword(node.ifKeyword)) {
-      CompletionEngine_this._pKeyword(node.ifKeyword);
-    } else if (CompletionEngine_this._isCompletingKeyword(node.elseKeyword)) {
-      CompletionEngine_this._pKeyword(node.elseKeyword);
-    } else if (CompletionEngine_this._isCompletionBetween(node.condition.end, node.rightParenthesis.offset)) {
-      CompletionEngine_this._operatorAccess(node.condition, CompletionEngine_this._createIdent(node));
-    }
-    return null;
-  }
-
-  @override
-  Object visitImplementsClause(ImplementsClause node) {
-    if (CompletionEngine_this._isCompletingKeyword(node.keyword)) {
-      CompletionEngine_this._pKeyword(node.keyword);
-    } else if (node.interfaces.isEmpty) {
-      // { X implements ! }
-      CompletionEngine_this._analyzeTypeName(CompletionEngine_this._createIdent(node), CompletionEngine_this._typeDeclarationName(node));
-    } else {
-      // { X implements ! Y }
-      CompletionEngine_this._analyzeTypeName(CompletionEngine_this._createIdent(node), CompletionEngine_this._typeDeclarationName(node));
-    }
-    return null;
-  }
-
-  @override
-  Object visitImportDirective(ImportDirective node) {
-    if (CompletionEngine_this._isCompletingKeyword(node.asToken)) {
-      CompletionEngine_this._pKeyword(node.asToken);
-    } else {
-      visitNamespaceDirective(node);
-    }
-    return null;
-  }
-
-  @override
-  Object visitInstanceCreationExpression(InstanceCreationExpression node) {
-    if (CompletionEngine_this._isCompletingKeyword(node.keyword)) {
-      CompletionEngine_this._pKeyword(node.keyword);
-      Ident ident = new Ident.con3(node, node.keyword);
-      CompletionEngine_this._analyzeLocalName(ident);
-    } else {
-      Ident ident = CompletionEngine_this._createIdent(node);
-      CompletionEngine_this._analyzeConstructorTypeName(ident);
-    }
-    return null;
-  }
-
-  @override
-  Object visitIsExpression(IsExpression node) {
-    Ident ident;
-    Token isToken = node.isOperator;
-    int isTokenEnd = isToken.end;
-    if (isTokenEnd == CompletionEngine_this._completionLocation()) {
-      Expression expression = node.expression;
-      int offset = isToken.offset;
-      // { target.is! } possible name completion, parsed as "target.{synthetic} is!"
-      if (expression is PrefixedIdentifier) {
-        PrefixedIdentifier prefIdent = expression;
-        if (prefIdent.identifier.isSynthetic) {
-          CompletionEngine_this._analyzePrefixedAccess(prefIdent.prefix, new Ident.con2(node, "is", offset));
-        } else {
-          CompletionEngine_this._pKeyword(isToken);
-        }
-        return null;
-      }
-      // { expr is! }
-      if (!CompletionEngine._isSyntheticIdentifier(expression)) {
-        CompletionEngine_this._pKeyword(node.isOperator);
-        return null;
-      }
-      // { is! } possible name completion
-      ident = new Ident.con2(node, "is", offset);
-    } else if (CompletionEngine_this._isCompletionAfter(isTokenEnd)) {
-      CompletionEngine_this._state._isDynamicAllowed = false;
-      CompletionEngine_this._state._isVoidAllowed = false;
-      CompletionEngine_this._analyzeTypeName(CompletionEngine_this._createIdent(node), null);
-      return null;
-    } else {
-      ident = CompletionEngine_this._createIdent(node);
-    }
-    CompletionEngine_this._analyzeLocalName(ident);
-    return null;
-  }
-
-  @override
-  Object visitLibraryIdentifier(LibraryIdentifier node) => null;
-
-  @override
-  Object visitMethodInvocation(MethodInvocation node) {
-    Token period = node.period;
-    if (period != null && CompletionEngine_this._isCompletionAfter(period.end)) {
-      // { x.!y() }
-      CompletionEngine_this._dispatchPrefixAnalysis2(node);
-    }
-    return null;
-  }
-
-  @override
-  Object visitNamespaceDirective(NamespaceDirective node) {
-    StringLiteral uri = node.uri;
-    if (uri != null && uri.isSynthetic && node.keyword.end <= CompletionEngine_this._context.selectionOffset) {
-      uri.accept(this);
-    }
-    return super.visitNamespaceDirective(node);
-  }
-
-  @override
-  Object visitPartOfDirective(PartOfDirective node) {
-    if (CompletionEngine_this._isCompletingKeyword(node.ofToken)) {
-      CompletionEngine_this._pKeyword(node.ofToken);
-    } else {
-      visitDirective(node);
-    }
-    return null;
-  }
-
-  @override
-  Object visitPrefixedIdentifier(PrefixedIdentifier node) {
-    if (CompletionEngine_this._isCompletionAfter(node.period.end)) {
-      if (CompletionEngine_this._isCompletionBefore(node.identifier.offset)) {
-        // { x.! } or { x.!  y } Note missing/implied semicolon before y; this looks like an
-        // obscure case but it occurs frequently when editing existing code.
-        CompletionEngine_this._dispatchPrefixAnalysis3(node, node.identifier);
-      }
-    }
-    return null;
-  }
-
-  @override
-  Object visitPropertyAccess(PropertyAccess node) {
-    if (node.target != null && node.target.length == 0) {
-      return null;
-    }
-    Expression target = node.realTarget;
-    // The "1 + str.!.length" is parsed as "(1 + str).!.length",
-    // but actually user wants "1 + (str.!).length".
-    // So, if completion inside of period-period ".!." then it is not really a cascade completion.
-    Token operator = node.operator;
-    if (operator.type == TokenType.PERIOD_PERIOD) {
-      int completionLocation = CompletionEngine_this._completionLocation();
-      if (completionLocation > operator.offset && completionLocation < operator.end) {
-        while (target is BinaryExpression) {
-          target = (target as BinaryExpression).rightOperand;
-        }
-      }
-    }
-    // do prefixed completion
-    CompletionEngine_this._analyzePrefixedAccess(target, node.propertyName);
-    return null;
-  }
-
-  @override
-  Object visitReturnStatement(ReturnStatement node) {
-    if (CompletionEngine_this._isCompletingKeyword(node.keyword)) {
-      CompletionEngine_this._pKeyword(node.keyword);
-      return null;
-    }
-    Expression expression = node.expression;
-    // return !
-    if (expression is SimpleIdentifier) {
-      SimpleIdentifier identifier = expression;
-      CompletionEngine_this._analyzeLocalName(identifier);
-      return null;
-    }
-    // return expression ! ;
-    Token semicolon = node.semicolon;
-    if (expression != null && semicolon != null && CompletionEngine_this._isCompletionBetween(expression.end, semicolon.offset)) {
-      CompletionEngine_this._operatorAccess(expression, CompletionEngine_this._createIdent(node));
-      return null;
-    }
-    return null;
-  }
-
-  @override
-  Object visitSimpleFormalParameter(SimpleFormalParameter node) {
-    if (node.keyword != null && CompletionEngine_this._isCompletionBefore(node.keyword.end)) {
-      // f() { g(var! z) }
-      Token token = node.keyword;
-      Ident ident = new Ident.con3(node, token);
-      CompletionEngine_this._analyzeTypeName(ident, ident);
-    }
-    return null;
-  }
-
-  @override
-  Object visitSimpleIdentifier(SimpleIdentifier node) {
-    AstNode parent = node.parent;
-    if (parent != null) {
-      CompletionEngine_IdentifierCompleter visitor = new CompletionEngine_IdentifierCompleter(CompletionEngine_this, node);
-      return parent.accept(visitor);
-    }
-    return null;
-  }
-
-  @override
-  Object visitSimpleStringLiteral(SimpleStringLiteral node) {
-    AstNode parent = node.parent;
-    if (parent is Directive) {
-      CompletionEngine_StringCompleter visitor = new CompletionEngine_StringCompleter(CompletionEngine_this, node);
-      return parent.accept(visitor);
-    }
-    return null;
-  }
-
-  @override
-  Object visitSuperConstructorInvocation(SuperConstructorInvocation node) {
-    CompletionEngine_this._analyzeSuperConstructorInvocation(node);
-    return null;
-  }
-
-  @override
-  Object visitSwitchMember(SwitchMember node) {
-    if (CompletionEngine_this._isCompletingKeyword(node.keyword)) {
-      CompletionEngine_this._pKeyword(node.keyword);
-    }
-    return null;
-  }
-
-  @override
-  Object visitSwitchStatement(SwitchStatement node) {
-    if (CompletionEngine_this._isCompletingKeyword(node.keyword)) {
-      CompletionEngine_this._pKeyword(node.keyword);
-    }
-    return null;
-  }
-
-  @override
-  Object visitTryStatement(TryStatement node) {
-    if (CompletionEngine_this._isCompletingKeyword(node.tryKeyword)) {
-      CompletionEngine_this._pKeyword(node.tryKeyword);
-    }
-    return null;
-  }
-
-  @override
-  Object visitTypeArgumentList(TypeArgumentList node) {
-    if (CompletionEngine_this._isCompletionBetween(node.leftBracket.end, node.rightBracket.offset)) {
-      CompletionEngine_this._analyzeTypeName(CompletionEngine_this._createIdent(node), null);
-    }
-    return null;
-  }
-
-  @override
-  Object visitTypeParameter(TypeParameter node) {
-    if (CompletionEngine_this._isCompletingKeyword(node.keyword)) {
-      CompletionEngine_this._pKeyword(node.keyword);
-    } else if (node.name.name.isEmpty && CompletionEngine_this._isCompletionBefore(node.keyword.offset)) {
-      // { < ! extends X> }
-      CompletionEngine_this._analyzeTypeName(node.name, CompletionEngine_this._typeDeclarationName(node));
-    }
-    // { <! X ! extends ! Y !> }
-    return null;
-  }
-
-  @override
-  Object visitTypeParameterList(TypeParameterList node) {
-    // { <X extends A,! B,! > }
-    if (CompletionEngine_this._isCompletionBetween(node.leftBracket.end, node.rightBracket.offset)) {
-      CompletionEngine_this._analyzeTypeName(CompletionEngine_this._createIdent(node), CompletionEngine_this._typeDeclarationName(node));
-    }
-    return null;
-  }
-
-  @override
-  Object visitVariableDeclaration(VariableDeclaration node) {
-    if (CompletionEngine_this._isCompletionAfter(node.equals.end)) {
-      // { var x =! ...}
-      CompletionEngine_this._analyzeLocalName(CompletionEngine_this._createIdent(node));
-    }
-    return null;
-  }
-
-  @override
-  Object visitVariableDeclarationList(VariableDeclarationList node) {
-    if (CompletionEngine_this._isCompletingKeyword(node.keyword)) {
-      CompletionEngine_this._pKeyword(node.keyword);
-      CompletionEngine_this._analyzeTypeName(new Ident.con3(node, node.keyword), null);
-    }
-    return null;
-  }
-
-  @override
-  Object visitWhileStatement(WhileStatement node) {
-    if (CompletionEngine_this._isCompletingKeyword(node.keyword)) {
-      CompletionEngine_this._pKeyword(node.keyword);
-    } else if (CompletionEngine_this._isCompletionBetween(node.condition.end, node.rightParenthesis.offset)) {
-      CompletionEngine_this._operatorAccess(node.condition, CompletionEngine_this._createIdent(node));
-    }
-    return null;
-  }
-
-  @override
-  Object visitWithClause(WithClause node) {
-    if (CompletionEngine_this._isCompletingKeyword(node.withKeyword)) {
-      CompletionEngine_this._pKeyword(node.withKeyword);
-    } else if (node.mixinTypes.isEmpty) {
-      // { X with ! }
-      CompletionEngine_this._analyzeTypeName(CompletionEngine_this._createIdent(node), CompletionEngine_this._typeDeclarationName(node));
-    } else {
-      // { X with ! Y }
-      CompletionEngine_this._analyzeTypeName(CompletionEngine_this._createIdent(node), CompletionEngine_this._typeDeclarationName(node));
-    }
-    return null;
-  }
-}
-
-/**
- * A TypeNameCompleter is used to classify the parent of a SimpleIdentifier after it has been
- * identified as a TypeName by the IdentifierCompleter.
- */
-class CompletionEngine_TypeNameCompleter extends CompletionEngine_AstNodeClassifier {
-  final CompletionEngine CompletionEngine_this;
-
-  final SimpleIdentifier _identifier;
-
-  final TypeName _typeName;
-
-  CompletionEngine_TypeNameCompleter(this.CompletionEngine_this, this._identifier, this._typeName);
-
-  @override
-  Object visitAsExpression(AsExpression node) {
-    if (identical(node.type, _typeName)) {
-      CompletionEngine_this._state._isDynamicAllowed = false;
-      CompletionEngine_this._state._isVoidAllowed = false;
-      CompletionEngine_this._analyzeTypeName(_identifier, null);
-    }
-    return null;
-  }
-
-  @override
-  Object visitCatchClause(CatchClause node) {
-    if (identical(node.exceptionType, _typeName)) {
-      CompletionEngine_this._analyzeTypeName(_identifier, null);
-    }
-    return null;
-  }
-
-  @override
-  Object visitClassTypeAlias(ClassTypeAlias node) {
-    CompletionEngine_this._analyzeTypeName(_identifier, CompletionEngine_this._typeDeclarationName(node));
-    return null;
-  }
-
-  @override
-  Object visitConstructorName(ConstructorName node) {
-    if (identical(_typeName, node.type)) {
-      if (node.period != null) {
-        if (CompletionEngine_this._isCompletionAfter(node.period.end)) {
-          // Is this branch reachable? Probably only in IdentifierCompleter.
-          "".toString();
-        } else {
-          // { new Cla!ss.cons() }
-          Element element = _identifier.bestElement;
-          if (element is ClassElement) {
-            CompletionEngine_this._namedConstructorReference(element, _identifier);
-          }
-        }
-      } else {
-        // { new ! } { new Na!me(); } { new js!on. }
-        CompletionEngine_this._analyzeConstructorTypeName(_identifier);
-      }
-    }
-    return null;
-  }
-
-  @override
-  Object visitExtendsClause(ExtendsClause node) {
-    CompletionEngine_this._analyzeTypeName(_identifier, CompletionEngine_this._typeDeclarationName(node));
-    return null;
-  }
-
-  @override
-  Object visitFunctionTypeAlias(FunctionTypeAlias node) {
-    CompletionEngine_this._analyzeTypeName(_identifier, CompletionEngine_this._typeDeclarationName(node));
-    return null;
-  }
-
-  @override
-  Object visitImplementsClause(ImplementsClause node) {
-    CompletionEngine_this._analyzeTypeName(_identifier, CompletionEngine_this._typeDeclarationName(node));
-    return null;
-  }
-
-  @override
-  Object visitIsExpression(IsExpression node) {
-    if (identical(_typeName, node.type)) {
-      Token isToken = node.isOperator;
-      if (CompletionEngine_this._completionLocation() == isToken.end) {
-        Expression expression = node.expression;
-        int offset = isToken.offset;
-        // { target.is! } possible name completion, parsed as "target.{synthetic} is!"
-        if (expression is PrefixedIdentifier) {
-          PrefixedIdentifier prefIdent = expression;
-          if (prefIdent.identifier.isSynthetic) {
-            CompletionEngine_this._analyzePrefixedAccess(prefIdent.prefix, new Ident.con2(node, "is", offset));
-          } else {
-            CompletionEngine_this._pKeyword(node.isOperator);
-          }
-          return null;
-        }
-        // { expr is! }
-        if (!CompletionEngine._isSyntheticIdentifier(expression)) {
-          CompletionEngine_this._pKeyword(node.isOperator);
-          return null;
-        }
-        // { is! } possible name completion
-        CompletionEngine_this._analyzeLocalName(new Ident.con2(node, "is", offset));
-      } else {
-        CompletionEngine_this._analyzeTypeName(node.type.name as SimpleIdentifier, null);
-      }
-    }
-    return null;
-  }
-
-  @override
-  Object visitMethodDeclaration(MethodDeclaration node) {
-    if (identical(node.returnType, _typeName)) {
-      CompletionEngine_this._analyzeTypeName(_identifier, null);
-    }
-    return null;
-  }
-
-  @override
-  Object visitSimpleFormalParameter(SimpleFormalParameter node) {
-    CompletionEngine_this._analyzeTypeName(_identifier, null);
-    return null;
-  }
-
-  @override
-  Object visitTypeArgumentList(TypeArgumentList node) {
-    if (CompletionEngine_this._isCompletionBetween(node.leftBracket.end, node.rightBracket.offset)) {
-      CompletionEngine_this._analyzeTypeName(_identifier, null);
-    }
-    return null;
-  }
-
-  @override
-  Object visitTypeParameter(TypeParameter node) {
-    if (identical(node.bound, _typeName)) {
-      // { X<A extends !Y> }
-      CompletionEngine_this._analyzeTypeName(_identifier, CompletionEngine_this._typeDeclarationName(node));
-    }
-    return null;
-  }
-
-  @override
-  Object visitVariableDeclarationList(VariableDeclarationList node) {
-    if (node.parent is Statement) {
-      CompletionEngine_this._analyzeLocalName(_identifier);
-    } else {
-      CompletionEngine_this._analyzeTypeName(_identifier, null);
-    }
-    return null;
-  }
-
-  @override
-  Object visitWithClause(WithClause node) {
-    CompletionEngine_this._analyzeTypeName(_identifier, CompletionEngine_this._typeDeclarationName(node));
-    return null;
-  }
-}
-
-/**
- * The factory class used to create completion proposals.
- */
-class CompletionFactory {
-  /**
-   * Create a completion proposal of the given kind.
-   */
-  CompletionProposal createCompletionProposal(CompletionSuggestionKind kind, int insertionPoint) {
-    CompletionProposalImpl prop = new CompletionProposalImpl();
-    prop.setKind(kind);
-    prop.setLocation(insertionPoint);
-    return prop;
-  }
-}
-
-abstract class CompletionProposal {
-  static final int RELEVANCE_LOW = 0;
-
-  static final int RELEVANCE_DEFAULT = 10;
-
-  static final int RELEVANCE_HIGH = 20;
-
-  /**
-   * This character is used to specify location of the cursor after completion.
-   */
-  static final int CURSOR_MARKER = 0x2758;
-
-  void applyPartitionOffset(int partitionOffset);
-
-  String get completion;
-
-  String get declaringType;
-
-  Element get element;
-
-  CompletionSuggestionKind get kind;
-
-  int get location;
-
-  String get parameterName;
-
-  List<String> get parameterNames;
-
-  String get parameterType;
-
-  List<String> get parameterTypes;
-
-  int get positionalParameterCount;
-
-  int get relevance;
-
-  int get replacementLength;
-
-  int get replacementLengthIdentifier;
-
-  String get returnType;
-
-  bool get hasNamed;
-
-  bool get hasPositional;
-
-  CompletionProposal incRelevance();
-
-  bool get isDeprecated;
-
-  bool get isPotentialMatch;
-
-  CompletionProposal setCompletion(String x);
-
-  CompletionProposal setDeclaringType(String name);
-
-  CompletionProposal setDeprecated(bool deprecated);
-
-  CompletionProposal setElement(Element element);
-
-  CompletionProposal setKind(CompletionSuggestionKind x);
-
-  CompletionProposal setLocation(int x);
-
-  CompletionProposal setParameterName(String paramName);
-
-  CompletionProposal setParameterNames(List<String> paramNames);
-
-  CompletionProposal setParameterStyle(int count, bool named, bool positional);
-
-  CompletionProposal setParameterType(String paramType);
-
-  CompletionProposal setParameterTypes(List<String> paramTypes);
-
-  CompletionProposal setPotentialMatch(bool isPotentialMatch);
-
-  CompletionProposal setRelevance(int n);
-
-  CompletionProposal setReplacementLength(int x);
-
-  CompletionProposal setReplacementLengthIdentifier(int x);
-
-  CompletionProposal setReturnType(String name);
-}
-
-class CompletionProposalImpl implements CompletionProposal {
-  Element _element;
-
-  String _completion = "";
-
-  String _returnType = "";
-
-  String _declaringType = "";
-
-  List<String> _parameterNames = StringUtilities.EMPTY_ARRAY;
-
-  List<String> _parameterTypes = StringUtilities.EMPTY_ARRAY;
-
-  String _parameterName;
-
-  String _parameterType;
-
-  CompletionSuggestionKind _kind = null;
-
-  int _location = 0;
-
-  int _replacementLength = 0;
-
-  int _replacementLength2 = 0;
-
-  int _positionalParameterCount = 0;
-
-  bool _named = false;
-
-  bool _positional = false;
-
-  bool _deprecated = false;
-
-  bool _potential = false;
-
-  int _relevance = CompletionProposal.RELEVANCE_DEFAULT;
-
-  @override
-  void applyPartitionOffset(int partitionOffset) {
-    _location += partitionOffset;
-  }
-
-  @override
-  String get completion => _completion;
-
-  @override
-  String get declaringType => _declaringType;
-
-  @override
-  Element get element => _element;
-
-  @override
-  CompletionSuggestionKind get kind => _kind;
-
-  @override
-  int get location => _location;
-
-  @override
-  String get parameterName => _parameterName;
-
-  @override
-  List<String> get parameterNames => _parameterNames;
-
-  @override
-  String get parameterType => _parameterType;
-
-  @override
-  List<String> get parameterTypes => _parameterTypes;
-
-  @override
-  int get positionalParameterCount => _positionalParameterCount;
-
-  @override
-  int get relevance => _relevance;
-
-  @override
-  int get replacementLength => _replacementLength;
-
-  @override
-  int get replacementLengthIdentifier => _replacementLength2;
-
-  @override
-  String get returnType => _returnType;
-
-  @override
-  bool get hasNamed => _named;
-
-  @override
-  bool get hasPositional => _positional;
-
-  @override
-  CompletionProposal incRelevance() {
-    _relevance++;
-    return this;
-  }
-
-  @override
-  bool get isDeprecated => _deprecated;
-
-  @override
-  bool get isPotentialMatch => _potential;
-
-  @override
-  CompletionProposal setCompletion(String x) {
-    _completion = x;
-    if (_replacementLength == 0) {
-      setReplacementLength(x.length);
-    }
-    return this;
-  }
-
-  @override
-  CompletionProposal setDeclaringType(String name) {
-    _declaringType = name;
-    return this;
-  }
-
-  @override
-  CompletionProposal setDeprecated(bool deprecated) {
-    this._deprecated = deprecated;
-    return this;
-  }
-
-  @override
-  CompletionProposal setElement(Element element) {
-    this._element = element;
-    return this;
-  }
-
-  @override
-  CompletionProposal setKind(CompletionSuggestionKind x) {
-    _kind = x;
-    return this;
-  }
-
-  @override
-  CompletionProposal setLocation(int x) {
-    _location = x;
-    return this;
-  }
-
-  @override
-  CompletionProposal setParameterName(String parameterName) {
-    this._parameterName = parameterName;
-    return this;
-  }
-
-  @override
-  CompletionProposal setParameterNames(List<String> paramNames) {
-    _parameterNames = paramNames;
-    return this;
-  }
-
-  @override
-  CompletionProposal setParameterStyle(int count, bool named, bool positional) {
-    this._named = named;
-    this._positional = positional;
-    this._positionalParameterCount = count;
-    return this;
-  }
-
-  @override
-  CompletionProposal setParameterType(String parameterType) {
-    this._parameterType = parameterType;
-    return this;
-  }
-
-  @override
-  CompletionProposal setParameterTypes(List<String> paramTypes) {
-    _parameterTypes = paramTypes;
-    return this;
-  }
-
-  @override
-  CompletionProposal setPotentialMatch(bool isPotentialMatch) {
-    _potential = isPotentialMatch;
-    return this;
-  }
-
-  @override
-  CompletionProposal setRelevance(int n) {
-    _relevance = n;
-    return this;
-  }
-
-  @override
-  CompletionProposal setReplacementLength(int x) {
-    _replacementLength = x;
-    return this;
-  }
-
-  @override
-  CompletionProposal setReplacementLengthIdentifier(int x) {
-    _replacementLength2 = x;
-    return this;
-  }
-
-  @override
-  CompletionProposal setReturnType(String name) {
-    _returnType = name;
-    return this;
-  }
-}
-
-/**
- * A pathway for reporting completion proposals back to the client.
- */
-abstract class CompletionRequestor {
-  /**
-   * Record the given completion proposal for eventual presentation to the user.
-   */
-  accept(CompletionProposal proposal);
-
-  void beginReporting();
-
-  void endReporting();
-}
-
-/**
- */
-class CompletionState {
-  bool _isForMixin = false;
-
-  bool _isVoidAllowed = false;
-
-  bool _isDynamicAllowed = false;
-
-  bool _isSourceDeclarationStatic = false;
-
-  bool _isThisAllowed = true;
-
-  bool _isVarAllowed = false;
-
-  bool _areLiteralsAllowed = false;
-
-  bool _areLiteralsProhibited = false;
-
-  bool _areOperatorsAllowed = false;
-
-  bool _areStaticReferencesProhibited = false;
-
-  bool _areInstanceReferencesProhibited = false;
-
-  bool _areUndefinedTypesProhibited = false;
-
-  bool _isCompileTimeConstantRequired = false;
-
-  bool _isOptionalArgumentRequired = false;
-
-  bool _areMethodsProhibited = false;
-
-  bool _areClassesRequired = false;
-
-  ParameterElement _targetParameter;
-
-  void mustBeInstantiableType() {
-    _areClassesRequired = true;
-    _prohibitsLiterals();
-  }
-
-  void _includesLiterals() {
-    if (!_areLiteralsProhibited) {
-      _areLiteralsAllowed = true;
-    }
-  }
-
-  void _includesOperators() {
-    _areOperatorsAllowed = true;
-  }
-
-  void _includesUndefinedDeclarationTypes() {
-    if (!_areUndefinedTypesProhibited) {
-      _isVoidAllowed = true;
-      _isDynamicAllowed = true;
-    }
-  }
-
-  void _includesUndefinedTypes() {
-    _isVarAllowed = true;
-    _isDynamicAllowed = true;
-  }
-
-  void _mustBeMixin() {
-    _isForMixin = true;
-  }
-
-  void _prohibitsInstanceReferences() {
-    _areInstanceReferencesProhibited = true;
-  }
-
-  void _prohibitsLiterals() {
-    _areLiteralsAllowed = false;
-    _areLiteralsProhibited = true;
-  }
-
-  void _prohibitsStaticReferences() {
-    _areStaticReferencesProhibited = true;
-  }
-
-  void _prohibitThis() {
-    _isThisAllowed = false;
-  }
-
-  void _prohibitsUndefinedTypes() {
-    _areUndefinedTypesProhibited = true;
-  }
-
-  void _requiresConst(bool isConst) {
-    _isCompileTimeConstantRequired = isConst;
-  }
-
-  void _requiresOperators() {
-    _includesOperators();
-    _areMethodsProhibited = true;
-  }
-
-  void _requiresOptionalArgument() {
-    _isOptionalArgumentRequired = true;
-    _prohibitsLiterals();
-  }
-
-  void set context(AstNode base) {
-    base.accept(new ContextAnalyzer(this, base));
-  }
-
-  void _sourceDeclarationIsStatic(bool state) {
-    _isSourceDeclarationStatic = state;
-    if (state) {
-      if (!_areStaticReferencesProhibited) {
-        _prohibitsInstanceReferences();
-      }
-    }
-  }
-}
-
-/**
- */
-class ContextAnalyzer extends GeneralizingAstVisitor<Object> {
-  final CompletionState _state;
-
-  final AstNode _completionNode;
-
-  AstNode _child;
-
-  bool _inExpression = false;
-
-  bool _inIdentifier = false;
-
-  bool _inTypeName = false;
-
-  bool _maybeInvocationArgument = true;
-
-  ContextAnalyzer(this._state, this._completionNode);
-
-  @override
-  Object visitAnnotation(Annotation node) {
-    _state._requiresConst(true);
-    return super.visitAnnotation(node);
-  }
-
-  @override
-  Object visitCatchClause(CatchClause node) {
-    if (identical(node.exceptionType, _child)) {
-      _state._prohibitsLiterals();
-    }
-    return null;
-  }
-
-  @override
-  Object visitCompilationUnitMember(CompilationUnitMember node) {
-    if (node is! ClassDeclaration) {
-      _state._prohibitThis();
-    }
-    return super.visitCompilationUnitMember(node);
-  }
-
-  @override
-  Object visitConstructorInitializer(ConstructorInitializer node) {
-    _state._prohibitThis();
-    return super.visitConstructorInitializer(node);
-  }
-
-  @override
-  Object visitDirective(Directive node) {
-    _state._prohibitsLiterals();
-    return super.visitDirective(node);
-  }
-
-  @override
-  Object visitDoStatement(DoStatement node) {
-    if (identical(_child, node.condition)) {
-      _state._includesLiterals();
-    }
-    return super.visitDoStatement(node);
-  }
-
-  @override
-  Object visitExpression(Expression node) {
-    _inExpression = true;
-    _state._includesLiterals();
-    _mayBeSetParameterElement(node);
-    return super.visitExpression(node);
-  }
-
-  @override
-  Object visitFieldDeclaration(FieldDeclaration node) {
-    _state._prohibitThis();
-    return super.visitFieldDeclaration(node);
-  }
-
-  @override
-  Object visitForEachStatement(ForEachStatement node) {
-    if (identical(_child, node.iterator)) {
-      _state._includesLiterals();
-    }
-    return super.visitForEachStatement(node);
-  }
-
-  @override
-  Object visitFunctionExpression(FunctionExpression node) {
-    if (node.parent is Declaration) {
-      // Function expressions that are part of a declaration are not to be treated as expressions.
-      return visitNode(node);
-    } else {
-      return visitExpression(node);
-    }
-  }
-
-  @override
-  Object visitFunctionTypeAlias(FunctionTypeAlias node) {
-    if (_inTypeName || node.returnType == null) {
-      // This may be an incomplete class type alias
-      _state._includesUndefinedDeclarationTypes();
-    }
-    return super.visitFunctionTypeAlias(node);
-  }
-
-  @override
-  Object visitIdentifier(Identifier node) {
-    _mayBeSetParameterElement(node);
-    // Identifiers cannot safely be generalized to expressions, so just walk up one level.
-    // LibraryIdentifier is never an expression. PrefixedIdentifier may be an expression, but
-    // not in a catch-clause or a declaration. SimpleIdentifier may be an expression, but not
-    // in a constructor name, label, or where PrefixedIdentifier is not.
-    return visitNode(node);
-  }
-
-  @override
-  Object visitInstanceCreationExpression(InstanceCreationExpression node) {
-    _state._requiresConst(node.isConst);
-    if (identical(_completionNode.parent.parent, _child)) {
-      _state.mustBeInstantiableType();
-    }
-    return super.visitInstanceCreationExpression(node);
-  }
-
-  @override
-  Object visitMethodDeclaration(MethodDeclaration node) {
-    _state._sourceDeclarationIsStatic(node.isStatic);
-    if (identical(_child, node.returnType)) {
-      _state._includesUndefinedDeclarationTypes();
-    }
-    if (node.isStatic) {
-      _state._prohibitThis();
-    }
-    return super.visitMethodDeclaration(node);
-  }
-
-  @override
-  Object visitNode(AstNode node) {
-    // Walk UP the tree, not down.
-    AstNode parent = node.parent;
-    _updateIfShouldGetTargetParameter(node, parent);
-    if (parent != null) {
-      _child = node;
-      parent.accept(this);
-    }
-    return null;
-  }
-
-  @override
-  Object visitPrefixedIdentifier(PrefixedIdentifier node) {
-    if (identical(node, _completionNode) || identical(node.identifier, _completionNode)) {
-      SimpleIdentifier prefix = node.prefix;
-      if (_isClassLiteral(prefix)) {
-        _state._prohibitsInstanceReferences();
-      } else {
-        _state._prohibitsStaticReferences();
-      }
-    }
-    return super.visitPrefixedIdentifier(node);
-  }
-
-  @override
-  Object visitPropertyAccess(PropertyAccess node) {
-    if (identical(node, _completionNode) || identical(node.propertyName, _completionNode)) {
-      Expression target = node.realTarget;
-      if (_isClassLiteral(target)) {
-        _state._prohibitsInstanceReferences();
-      } else {
-        _state._prohibitsStaticReferences();
-      }
-    }
-    return super.visitPropertyAccess(node);
-  }
-
-  @override
-  Object visitSimpleFormalParameter(SimpleFormalParameter node) {
-    _state._includesUndefinedTypes();
-    return super.visitSimpleFormalParameter(node);
-  }
-
-  @override
-  Object visitSimpleIdentifier(SimpleIdentifier node) {
-    _inIdentifier = true;
-    return super.visitSimpleIdentifier(node);
-  }
-
-  @override
-  Object visitSwitchStatement(SwitchStatement node) {
-    if (identical(_child, node.expression)) {
-      _state._includesLiterals();
-    }
-    return super.visitSwitchStatement(node);
-  }
-
-  @override
-  Object visitTypeArgumentList(TypeArgumentList node) {
-    _state._prohibitsUndefinedTypes();
-    return super.visitTypeArgumentList(node);
-  }
-
-  @override
-  Object visitTypeName(TypeName node) {
-    _inTypeName = true;
-    return super.visitTypeName(node);
-  }
-
-  @override
-  Object visitVariableDeclaration(VariableDeclaration node) {
-    if (identical(node.name, _completionNode)) {
-      _state._prohibitsLiterals();
-    }
-    return super.visitVariableDeclaration(node);
-  }
-
-  @override
-  Object visitVariableDeclarationList(VariableDeclarationList node) {
-    _state._includesUndefinedDeclarationTypes();
-    return super.visitVariableDeclarationList(node);
-  }
-
-  @override
-  Object visitWhileStatement(WhileStatement node) {
-    if (identical(_child, node.condition)) {
-      _state._includesLiterals();
-    }
-    return super.visitWhileStatement(node);
-  }
-
-  @override
-  Object visitWithClause(WithClause node) {
-    _state._mustBeMixin();
-    return super.visitWithClause(node);
-  }
-
-  bool _isClassLiteral(Expression expression) => expression is Identifier && expression.staticElement is ClassElement;
-
-  void _mayBeSetParameterElement(Expression node) {
-    if (!_maybeInvocationArgument) {
-      return;
-    }
-    if (node.parent is ArgumentList) {
-      if (_state._targetParameter == null) {
-        _state._targetParameter = node.bestParameterElement;
-      }
-    }
-  }
-
-  void _updateIfShouldGetTargetParameter(AstNode node, AstNode parent) {
-    if (!_maybeInvocationArgument) {
-      return;
-    }
-    // prefix.node
-    if (parent is PrefixedIdentifier) {
-      if (identical(parent.identifier, node)) {
-        return;
-      }
-    }
-    // something unknown
-    _maybeInvocationArgument = false;
-  }
-}
-
-class Filter {
-  String _prefix;
-
-  String _originalPrefix;
-
-  RegExp _pattern;
-
-  Filter.con1(SimpleIdentifier ident, int loc) : this.con2(ident.name, ident.offset, loc);
-
-  Filter.con2(String name, int pos, int loc) {
-    int len = loc - pos;
-    if (len > 0) {
-      if (len <= name.length) {
-        _prefix = name.substring(0, len);
-      } else {
-        _prefix = name;
-      }
-    } else {
-      _prefix = "";
-    }
-    _originalPrefix = _prefix;
-    _prefix = _prefix.toLowerCase();
-  }
-
-  /**
-   * @return `true` if the given name starts with the same prefix as used for filter.
-   */
-  bool _isSameCasePrefix(String name) => name.startsWith(_originalPrefix);
-
-  String _makePattern() {
-    // TODO(scheglov) translate it
-    return null;
-  }
-
-  bool _match(Element elem) => _match2(elem.displayName);
-
-  bool _match2(String name) {
-    // Return true if the filter passes.
-    if (name.toLowerCase().startsWith(_prefix)) {
-      return true;
-    }
-    return _matchPattern(name);
-  }
-
-  void _removeNotMatching(List<Element> elements) {
-    for (int i = elements.length - 1; i >= 0; i--) {
-      if (!_match(elements[i])) {
-        elements.removeAt(i);
-      }
-    }
-  }
-
-  bool _matchPattern(String name) {
-    // TODO(scheglov) translate it
-    return false;
-  }
-}
-
-class GeneralizingAstVisitor_CompletionEngine_copyWithout extends GeneralizingAstVisitor<Object> {
-  AstNode deletion;
-
-  List<FormalParameter> newList;
-
-  GeneralizingAstVisitor_CompletionEngine_copyWithout(this.deletion, this.newList) : super();
-
-  @override
-  Object visitNode(AstNode node) {
-    if (!identical(node, deletion)) {
-      newList.add(node as FormalParameter);
-    }
-    return null;
-  }
-}
-
-/**
- * An [Ident] is a wrapper for a String that provides type equivalence with SimpleIdentifier.
- */
-class Ident extends EphemeralIdentifier {
-  String _name;
-
-  Ident.con1(AstNode parent, int offset) : super(parent, offset);
-
-  Ident.con2(AstNode parent, String name, int offset) : super(parent, offset) {
-    this._name = name;
-  }
-
-  Ident.con3(AstNode parent, Token name) : super(parent, name.offset) {
-    this._name = name.lexeme;
-  }
-
-  @override
-  String get name {
-    if (_name != null) {
-      return _name;
-    }
-    String n = super.name;
-    if (n != null) {
-      return n;
-    }
-    return "";
-  }
-}
-
-class ProposalCollector implements CompletionRequestor {
-  final CompletionRequestor requestor;
-
-  List<CompletionProposal> _proposals;
-
-  ProposalCollector(this.requestor) {
-    this._proposals = new List<CompletionProposal>();
-  }
-
-  @override
-  accept(CompletionProposal proposal) {
-    _proposals.add(proposal);
-  }
-
-  @override
-  void beginReporting() {
-    requestor.beginReporting();
-  }
-
-  @override
-  void endReporting() {
-    requestor.endReporting();
-  }
-
-  List<CompletionProposal> get proposals => _proposals;
-}
-
-class SearchFilter_CompletionEngine_allSubtypes implements SearchFilter {
-  ClassElement classElement;
-
-  SearchFilter_CompletionEngine_allSubtypes(this.classElement);
-
-  @override
-  bool passes(SearchMatch match) {
-    Element element = match.element;
-    if (element is ClassElement) {
-      ClassElement clElem = element;
-      while (clElem != null) {
-        InterfaceType ifType = clElem.supertype;
-        if (ifType == null) {
-          return false;
-        }
-        clElem = ifType.element;
-        if (identical(clElem, classElement)) {
-          return true;
-        }
-      }
-    }
-    return false;
-  }
-}
-
-class TopLevelNamesKind extends Enum<TopLevelNamesKind> {
-  static const TopLevelNamesKind DECLARED_AND_IMPORTS = const TopLevelNamesKind('DECLARED_AND_IMPORTS', 0);
-
-  static const TopLevelNamesKind DECLARED_AND_EXPORTS = const TopLevelNamesKind('DECLARED_AND_EXPORTS', 1);
-
-  static const List<TopLevelNamesKind> values = const [DECLARED_AND_IMPORTS, DECLARED_AND_EXPORTS];
-
-  const TopLevelNamesKind(String name, int ordinal) : super(name, ordinal);
-}
\ No newline at end of file
diff --git a/pkg/analysis_server/lib/src/services/generated/stubs.dart b/pkg/analysis_server/lib/src/services/generated/stubs.dart
deleted file mode 100644
index 8d0982c..0000000
--- a/pkg/analysis_server/lib/src/services/generated/stubs.dart
+++ /dev/null
@@ -1,148 +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.
-
-// This code was auto-generated, is not intended to be edited, and is subject to
-// significant change. Please see the README file for more information.
-
-library service.correction.stubs;
-
-import 'package:analyzer/src/generated/ast.dart' show AstNode;
-import 'package:analyzer/src/generated/element.dart';
-import 'package:analyzer/src/generated/scanner.dart';
-import 'package:analyzer/src/generated/source.dart';
-
-abstract class SearchFilter {
-  bool passes(SearchMatch match);
-}
-
-class SearchMatch {
-  final Element element = null;
-  final SourceRange sourceRange = null;
-}
-
-class SearchEngine {}
-
-class SourceRangeFactory {
-  static SourceRange rangeElementName(Element element) {
-    return new SourceRange(element.nameOffset, element.name.length);
-  }
-
-  static SourceRange rangeEndEnd(a, b) {
-    int offset = a.end;
-    var length = b.end - offset;
-    return new SourceRange(offset, length);
-  }
-
-  static SourceRange rangeEndLength(a, int length) {
-    return new SourceRange(a.nameOffset, length);
-  }
-
-  static SourceRange rangeEndStart(a, b) {
-    int offset = a.end;
-    var length = b.offset - offset;
-    return new SourceRange(offset, length);
-  }
-
-  static SourceRange rangeNode(AstNode node) {
-    return new SourceRange(node.offset, node.length);
-  }
-
-  static SourceRange rangeNodes(List<AstNode> nodes) {
-    if (nodes.isEmpty) {
-      return new SourceRange(0, 0);
-    }
-    AstNode first = nodes.first;
-    AstNode last = nodes.last;
-    return rangeStartEnd(first, last);
-  }
-
-  static SourceRange rangeStartEnd(a, b) {
-    int offset = a.offset;
-    var length = b.end - offset;
-    return new SourceRange(offset, length);
-  }
-
-  static SourceRange rangeStartLength(a, int length) {
-    int offset = a.offset;
-    return new SourceRange(offset, length);
-  }
-
-  static SourceRange rangeStartStart(a, b) {
-    int offset = a.offset;
-    var length = b.offset - offset;
-    return new SourceRange(offset, length);
-  }
-
-  static SourceRange rangeToken(Token node) {
-    return new SourceRange(node.offset, node.length);
-  }
-}
-
-class StringUtils {
-  static String capitalize(String str) {
-    if (isEmpty(str)) {
-      return str;
-    }
-    return str.substring(0, 1).toUpperCase() + str.substring(1);
-  }
-
-  static bool equals(String cs1, String cs2) {
-    if (cs1 == cs2) {
-      return true;
-    }
-    if (cs1 == null || cs2 == null) {
-      return false;
-    }
-    return cs1 == cs2;
-  }
-
-  static bool isEmpty(String str) {
-    return str == null || str.isEmpty;
-  }
-
-  static String join(Iterable iter,
-      [String separator = ' ', int start = 0, int end = -1]) {
-    if (start != 0) {
-      iter = iter.skip(start);
-    }
-    if (end != -1) {
-      iter = iter.take(end - start);
-    }
-    return iter.join(separator);
-  }
-
-  static String remove(String str, String remove) {
-    if (isEmpty(str) || isEmpty(remove)) {
-      return str;
-    }
-    return str.replaceAll(remove, '');
-  }
-
-  static String removeStart(String str, String remove) {
-    if (isEmpty(str) || isEmpty(remove)) {
-      return str;
-    }
-    if (str.startsWith(remove)) {
-      return str.substring(remove.length);
-    }
-    return str;
-  }
-
-  static String repeat(String s, int n) {
-    StringBuffer sb = new StringBuffer();
-    for (int i = 0; i < n; i++) {
-      sb.write(s);
-    }
-    return sb.toString();
-  }
-
-  static List<String> split(String s, [String pattern = '']) {
-    return s.split(pattern);
-  }
-
-  static List<String> splitByWholeSeparatorPreserveAllTokens(
-      String s, String pattern) {
-    return s.split(pattern);
-  }
-}
diff --git a/pkg/analysis_server/lib/src/services/generated/util.dart b/pkg/analysis_server/lib/src/services/generated/util.dart
deleted file mode 100644
index 31a15c3..0000000
--- a/pkg/analysis_server/lib/src/services/generated/util.dart
+++ /dev/null
@@ -1,1833 +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.
-
-// This code was auto-generated, is not intended to be edited, and is subject to
-// significant change. Please see the README file for more information.
-
-library services.util;
-
-import 'dart:collection';
-import "dart:math" as math;
-
-import 'package:analyzer/src/generated/java_core.dart' hide StringUtils;
-import 'package:analyzer/src/generated/ast.dart';
-import 'package:analyzer/src/generated/element.dart';
-import 'package:analyzer/src/generated/engine.dart';
-import 'package:analyzer/src/generated/error.dart';
-import 'package:analyzer/src/generated/resolver.dart';
-import 'package:analyzer/src/generated/source.dart';
-import 'package:analyzer/src/generated/scanner.dart';
-
-import 'stubs.dart';
-
-/**
- * Context for which assistance should be provided.
- */
-class AssistContext {
-  final SearchEngine searchEngine;
-
-  final AnalysisContext analysisContext;
-
-  final String analysisContextId;
-
-  final Source source;
-
-  final CompilationUnit compilationUnit;
-
-  final int selectionOffset;
-
-  final int selectionLength;
-
-  AstNode _coveredNode;
-
-  AstNode _coveringNode;
-
-  Element _coveredElement;
-
-  bool _coveredElementFound = false;
-
-  AssistContext.con1(this.searchEngine, this.analysisContext,
-      this.analysisContextId, this.source, this.compilationUnit,
-      this.selectionOffset, this.selectionLength);
-
-  AssistContext.con2(SearchEngine searchEngine, AnalysisContext analysisContext,
-      String analysisContextId, Source source, CompilationUnit compilationUnit,
-      SourceRange selectionRange)
-      : this.con1(searchEngine, analysisContext, analysisContextId, source,
-          compilationUnit, selectionRange.offset, selectionRange.length);
-
-  /**
-   * @return the resolved [CompilationUnitElement] of the [Source].
-   */
-  CompilationUnitElement get compilationUnitElement => compilationUnit.element;
-
-  /**
-   * @return the [Element] of the [coveredNode], may be <code>null</code>.
-   */
-  Element get coveredElement {
-    if (!_coveredElementFound) {
-      _coveredElementFound = true;
-      AstNode coveredNode = this.coveredNode;
-      if (coveredNode == null) {
-        return null;
-      }
-      _coveredElement =
-          ElementLocator.locateWithOffset(coveredNode, selectionOffset);
-    }
-    return _coveredElement;
-  }
-
-  /**
-   * @return the [AstNode] that is covered by the selection.
-   */
-  AstNode get coveredNode {
-    if (_coveredNode == null) {
-      NodeLocator locator = new NodeLocator(selectionOffset, selectionOffset);
-      _coveredNode = locator.searchWithin(compilationUnit);
-    }
-    return _coveredNode;
-  }
-
-  /**
-   * @return the ASTNode that covers the selection.
-   */
-  AstNode get coveringNode {
-    if (_coveringNode == null) {
-      NodeLocator locator =
-          new NodeLocator(selectionOffset, selectionOffset + selectionLength);
-      _coveringNode = locator.searchWithin(compilationUnit);
-    }
-    return _coveringNode;
-  }
-
-  /**
-   * @return the errors associated with the [Source].
-   */
-  List<AnalysisError> get errors {
-    Source source = this.source;
-    if (analysisContext == null || source == null) {
-      return AnalysisError.NO_ERRORS;
-    }
-    return analysisContext.getErrors(source).errors;
-  }
-
-  /**
-   * @return the [SourceRange] of the selection.
-   */
-  SourceRange get selectionRange =>
-      new SourceRange(selectionOffset, selectionLength);
-}
-
-/**
- * Utilities for analyzing [CompilationUnit], its parts and source.
- */
-class CorrectionUtils {
-  static List<String> _KNOWN_METHOD_NAME_PREFIXES = ["get", "is", "to"];
-
-  /**
-   * @return <code>true</code> if given [List]s are equals at given position.
-   */
-  static bool allListsEqual(List<List> lists, int position) {
-    Object element = lists[0][position];
-    for (List list in lists) {
-      if (!identical(list[position], element)) {
-        return false;
-      }
-    }
-    return true;
-  }
-
-  /**
-   * @return <code>true</code> if given [SourceRange] covers given [AstNode].
-   */
-  static bool covers(SourceRange r, AstNode node) {
-    SourceRange nodeRange = SourceRangeFactory.rangeNode(node);
-    return r.covers(nodeRange);
-  }
-
-  /**
-   * @return all direct children of the given [Element].
-   */
-  static List<Element> getChildren(Element parent) =>
-      getChildren2(parent, null);
-
-  /**
-   * @param name the required name of children; may be <code>null</code> to get children with any
-   *          name.
-   * @return all direct children of the given [Element], with given name.
-   */
-  static List<Element> getChildren2(Element parent, String name) {
-    List<Element> children = [];
-    parent.accept(new GeneralizingElementVisitor_CorrectionUtils_getChildren(
-        parent, name, children));
-    return children;
-  }
-
-  static String getDefaultValueCode(DartType type) {
-    if (type != null) {
-      String typeName = type.displayName;
-      if (typeName == "bool") {
-        return "false";
-      }
-      if (typeName == "int") {
-        return "0";
-      }
-      if (typeName == "double") {
-        return "0.0";
-      }
-      if (typeName == "String") {
-        return "''";
-      }
-    }
-    // no better guess
-    return "null";
-  }
-
-  /**
-   * @return the name of the [Element] kind.
-   */
-  static String getElementKindName(Element element) {
-    ElementKind kind = element.kind;
-    return getElementKindName2(kind);
-  }
-
-  /**
-   * @return the display name of the [ElementKind].
-   */
-  static String getElementKindName2(ElementKind kind) => kind.displayName;
-
-  /**
-   * @return the human name of the [Element].
-   */
-  static String getElementQualifiedName(Element element) {
-    ElementKind kind = element.kind;
-    while (true) {
-      if (kind == ElementKind.FIELD || kind == ElementKind.METHOD) {
-        return "${element.enclosingElement.displayName}.${element.displayName}";
-      } else {
-        return element.displayName;
-      }
-      break;
-    }
-  }
-
-  /**
-   * @return the [ExecutableElement] of the enclosing executable [AstNode].
-   */
-  static ExecutableElement getEnclosingExecutableElement(AstNode node) {
-    while (node != null) {
-      if (node is FunctionDeclaration) {
-        return node.element;
-      }
-      if (node is ConstructorDeclaration) {
-        return node.element;
-      }
-      if (node is MethodDeclaration) {
-        return node.element;
-      }
-      node = node.parent;
-    }
-    return null;
-  }
-
-  /**
-   * @return the enclosing executable [AstNode].
-   */
-  static AstNode getEnclosingExecutableNode(AstNode node) {
-    while (node != null) {
-      if (node is FunctionDeclaration) {
-        return node;
-      }
-      if (node is ConstructorDeclaration) {
-        return node;
-      }
-      if (node is MethodDeclaration) {
-        return node;
-      }
-      node = node.parent;
-    }
-    return null;
-  }
-
-  /**
-   * @return [Element] exported from the given [LibraryElement].
-   */
-  static Element getExportedElement(LibraryElement library, String name) {
-    if (library == null) {
-      return null;
-    }
-    return getExportNamespace2(library)[name];
-  }
-
-  /**
-   * TODO(scheglov) may be replace with some API for this
-   *
-   * @return the namespace of the given [ExportElement].
-   */
-  static Map<String, Element> getExportNamespace(ExportElement exp) {
-    Namespace namespace =
-        new NamespaceBuilder().createExportNamespaceForDirective(exp);
-    return namespace.definedNames;
-  }
-
-  /**
-   * TODO(scheglov) may be replace with some API for this
-   *
-   * @return the export namespace of the given [LibraryElement].
-   */
-  static Map<String, Element> getExportNamespace2(LibraryElement library) {
-    Namespace namespace =
-        new NamespaceBuilder().createExportNamespaceForLibrary(library);
-    return namespace.definedNames;
-  }
-
-  /**
-   * @return [getExpressionPrecedence] for parent node, or `0` if parent node
-   *         is [ParenthesizedExpression]. The reason is that `(expr)` is always
-   *         executed after `expr`.
-   */
-  static int getExpressionParentPrecedence(AstNode node) {
-    AstNode parent = node.parent;
-    if (parent is ParenthesizedExpression) {
-      return 0;
-    }
-    return getExpressionPrecedence(parent);
-  }
-
-  /**
-   * Return the precedence of the given [node]: the result of invoking
-   * [Expression.precedence] if the node is an [Expression], or a negative value
-   * otherwise.
-   */
-  static int getExpressionPrecedence(AstNode node) {
-    if (node is Expression) {
-      return node.precedence;
-    }
-    return -1000;
-  }
-
-  /**
-   * TODO(scheglov) may be replace with some API for this
-   *
-   * @return the namespace of the given [ImportElement].
-   */
-  static Map<String, Element> getImportNamespace(ImportElement imp) {
-    Namespace namespace =
-        new NamespaceBuilder().createImportNamespaceForDirective(imp);
-    return namespace.definedNames;
-  }
-
-  /**
-   * @return all [CompilationUnitElement] the given [LibraryElement] consists of.
-   */
-  static List<CompilationUnitElement> getLibraryUnits(LibraryElement library) {
-    List<CompilationUnitElement> units = [];
-    units.add(library.definingCompilationUnit);
-    units.addAll(library.parts);
-    return units;
-  }
-
-  /**
-   * @return the line prefix from the given source, i.e. basically just whitespace prefix of the
-   *         given [String].
-   */
-  static String getLinesPrefix(String lines) {
-    int index = 0;
-    while (index < lines.length) {
-      int c = lines.codeUnitAt(index);
-      if (!Character.isWhitespace(c)) {
-        break;
-      }
-      index++;
-    }
-    return lines.substring(0, index);
-  }
-
-  /**
-   * @return the [LocalVariableElement] or [ParameterElement] if given
-   *         [SimpleIdentifier] is the reference to local variable or parameter, or
-   *         <code>null</code> in the other case.
-   */
-  static VariableElement getLocalOrParameterVariableElement(
-      SimpleIdentifier node) {
-    Element element = node.staticElement;
-    if (element is LocalVariableElement) {
-      return element;
-    }
-    if (element is ParameterElement) {
-      return element;
-    }
-    return null;
-  }
-
-  /**
-   * @return the [LocalVariableElement] if given [SimpleIdentifier] is the reference to
-   *         local variable, or <code>null</code> in the other case.
-   */
-  static LocalVariableElement getLocalVariableElement(SimpleIdentifier node) {
-    Element element = node.staticElement;
-    if (element is LocalVariableElement) {
-      return element;
-    }
-    return null;
-  }
-
-  /**
-   * @return the nearest common ancestor [AstNode] of the given [AstNode]s.
-   */
-  static AstNode getNearestCommonAncestor(List<AstNode> nodes) {
-    // may be no nodes
-    if (nodes.isEmpty) {
-      return null;
-    }
-    // prepare parents
-    List<List<AstNode>> parents = [];
-    for (AstNode node in nodes) {
-      parents.add(getParents(node));
-    }
-    // find min length
-    int minLength = 2147483647;
-    for (List<AstNode> parentList in parents) {
-      minLength = math.min(minLength, parentList.length);
-    }
-    // find deepest parent
-    int i = 0;
-    for (; i < minLength; i++) {
-      if (!allListsEqual(parents, i)) {
-        break;
-      }
-    }
-    return parents[0][i - 1];
-  }
-
-  /**
-   * @return the [Expression] qualified if given node is name part of a [PropertyAccess]
-   *         or [PrefixedIdentifier]. May be <code>null</code>.
-   */
-  static Expression getNodeQualifier(SimpleIdentifier node) {
-    AstNode parent = node.parent;
-    if (parent is PropertyAccess) {
-      PropertyAccess propertyAccess = parent;
-      if (identical(propertyAccess.propertyName, node)) {
-        return propertyAccess.target;
-      }
-    }
-    if (parent is PrefixedIdentifier) {
-      PrefixedIdentifier prefixed = parent;
-      if (identical(prefixed.identifier, node)) {
-        return prefixed.prefix;
-      }
-    }
-    return null;
-  }
-
-  /**
-   * @return the [ParameterElement] if given [SimpleIdentifier] is the reference to
-   *         parameter, or <code>null</code> in the other case.
-   */
-  static ParameterElement getParameterElement(SimpleIdentifier node) {
-    Element element = node.staticElement;
-    if (element is ParameterElement) {
-      return element;
-    }
-    return null;
-  }
-
-  /**
-   * Return the precedence of the given [expression]'s parent. May be `-1` no
-   * operator.
-   *
-   * See [getPrecedence].
-   */
-  static int getParentPrecedence(Expression expression) {
-    AstNode parent = expression.parent;
-    if (parent is Expression) {
-      return getPrecedence(parent);
-    }
-    return -1;
-  }
-
-  /**
-   * @return parent [AstNode]s from [CompilationUnit] (at index "0") to the given one.
-   */
-  static List<AstNode> getParents(AstNode node) {
-    // prepare number of parents
-    int numParents = 0;
-    {
-      AstNode current = node.parent;
-      while (current != null) {
-        numParents++;
-        current = current.parent;
-      }
-    }
-    // fill array of parents
-    List<AstNode> parents = new List<AstNode>(numParents);
-    AstNode current = node.parent;
-    int index = numParents;
-    while (current != null) {
-      parents[--index] = current;
-      current = current.parent;
-    }
-    return parents;
-  }
-
-  /**
-   * @return the precedence of the given [Expression] operator. May be
-   *         `Integer#MAX_VALUE` if not an operator.
-   */
-  static int getPrecedence(Expression expression) {
-    if (expression is BinaryExpression) {
-      BinaryExpression binaryExpression = expression;
-      return binaryExpression.operator.type.precedence;
-    }
-    if (expression is PrefixExpression) {
-      PrefixExpression prefixExpression = expression;
-      return prefixExpression.operator.type.precedence;
-    }
-    if (expression is PostfixExpression) {
-      PostfixExpression postfixExpression = expression;
-      return postfixExpression.operator.type.precedence;
-    }
-    return 2147483647;
-  }
-
-  /**
-   * @return the [PropertyAccessorElement] if given [SimpleIdentifier] is the reference
-   *         to property, or <code>null</code> in the other case.
-   */
-  static PropertyAccessorElement getPropertyAccessorElement(
-      SimpleIdentifier node) {
-    Element element = node.staticElement;
-    if (element is PropertyAccessorElement) {
-      return element;
-    }
-    return null;
-  }
-
-  /**
-   * If given [AstNode] is name of qualified property extraction, returns target from which
-   * this property is extracted. Otherwise `null`.
-   */
-  static Expression getQualifiedPropertyTarget(AstNode node) {
-    AstNode parent = node.parent;
-    if (parent is PrefixedIdentifier) {
-      PrefixedIdentifier prefixed = parent;
-      if (identical(prefixed.identifier, node)) {
-        return parent.prefix;
-      }
-    }
-    if (parent is PropertyAccess) {
-      PropertyAccess access = parent;
-      if (identical(access.propertyName, node)) {
-        return access.realTarget;
-      }
-    }
-    return null;
-  }
-
-  /**
-   * Returns the name of the file which corresponds to the name of the class according to the style
-   * guide. However class does not have to be in this file.
-   */
-  static String getRecommentedFileNameForClass(String className) {
-    int len = className.length;
-    StringBuffer buffer = new StringBuffer();
-    bool prevWasUpper = false;
-    for (int i = 0; i < len; i++) {
-      int c = className.codeUnitAt(i);
-      if (Character.isUpperCase(c)) {
-        bool nextIsUpper =
-            i < len - 1 && Character.isUpperCase(className.codeUnitAt(i + 1));
-        if (i == 0) {} else if (prevWasUpper) {
-          // HTTPServer
-          //     ^
-          if (!nextIsUpper) {
-            buffer.writeCharCode(0x5F);
-          }
-        } else {
-          // HttpServer
-          //     ^
-          buffer.writeCharCode(0x5F);
-        }
-        prevWasUpper = true;
-        c = Character.toLowerCase(c);
-      } else {
-        prevWasUpper = false;
-      }
-      buffer.writeCharCode(c);
-    }
-    buffer.write(".dart");
-    String fileName = buffer.toString();
-    return fileName;
-  }
-
-  /**
-   * @return given [Statement] if not [Block], first child [Statement] if
-   *         [Block], or <code>null</code> if more than one child.
-   */
-  static Statement getSingleStatement(Statement statement) {
-    if (statement is Block) {
-      List<Statement> blockStatements = statement.statements;
-      if (blockStatements.length != 1) {
-        return null;
-      }
-      return blockStatements[0];
-    }
-    return statement;
-  }
-
-  /**
-   * @return the [String] content of the given [Source].
-   */
-  static String getSourceContent(AnalysisContext context, Source source) =>
-      context.getContents(source).data.toString();
-
-  /**
-   * @return given [Statement] if not [Block], all children [Statement]s if
-   *         [Block].
-   */
-  static List<Statement> getStatements(Statement statement) {
-    if (statement is Block) {
-      return statement.statements;
-    }
-    return [];
-  }
-
-  /**
-   * @return all top-level elements declared in the given [LibraryElement].
-   */
-  static List<Element> getTopLevelElements(LibraryElement library) {
-    List<Element> elements = [];
-    List<CompilationUnitElement> units = getLibraryUnits(library);
-    for (CompilationUnitElement unit in units) {
-      elements.addAll(unit.functions);
-      elements.addAll(unit.functionTypeAliases);
-      elements.addAll(unit.types);
-      elements.addAll(unit.topLevelVariables);
-    }
-    return elements;
-  }
-
-  /**
-   * @return the possible names for variable with initializer of the given [StringLiteral].
-   */
-  static List<String> getVariableNameSuggestions(
-      String text, Set<String> excluded) {
-    // filter out everything except of letters and white spaces
-    {
-      StringBuffer buffer = new StringBuffer();
-      for (int i = 0; i < text.length; i++) {
-        int c = text.codeUnitAt(i);
-        if (Character.isLetter(c) || Character.isWhitespace(c)) {
-          buffer.writeCharCode(c);
-        }
-      }
-      text = buffer.toString();
-    }
-    // make single camel-case text
-    {
-      List<String> words = StringUtils.split(text);
-      StringBuffer buffer = new StringBuffer();
-      for (int i = 0; i < words.length; i++) {
-        String word = words[i];
-        if (i > 0) {
-          word = StringUtils.capitalize(word);
-        }
-        buffer.write(word);
-      }
-      text = buffer.toString();
-    }
-    // split camel-case into separate suggested names
-    Set<String> res = new LinkedHashSet();
-    _addAll(excluded, res, _getVariableNameSuggestions(text));
-    return new List.from(res);
-  }
-
-  /**
-   * @return the possible names for variable with given expected type and expression.
-   */
-  static List<String> getVariableNameSuggestions2(DartType expectedType,
-      Expression assignedExpression, Set<String> excluded) {
-    Set<String> res = new LinkedHashSet();
-    // use expression
-    if (assignedExpression != null) {
-      String nameFromExpression =
-          _getBaseNameFromExpression(assignedExpression);
-      if (nameFromExpression != null) {
-        nameFromExpression = StringUtils.removeStart(nameFromExpression, "_");
-        _addAll(excluded, res, _getVariableNameSuggestions(nameFromExpression));
-      }
-      String nameFromParent =
-          _getBaseNameFromLocationInParent(assignedExpression);
-      if (nameFromParent != null) {
-        _addAll(excluded, res, _getVariableNameSuggestions(nameFromParent));
-      }
-    }
-    // use type
-    if (expectedType != null && !expectedType.isDynamic) {
-      String typeName = expectedType.name;
-      if ("int" == typeName) {
-        _addSingleCharacterName(excluded, res, 0x69);
-      } else if ("double" == typeName) {
-        _addSingleCharacterName(excluded, res, 0x64);
-      } else if ("String" == typeName) {
-        _addSingleCharacterName(excluded, res, 0x73);
-      } else {
-        _addAll(excluded, res, _getVariableNameSuggestions(typeName));
-      }
-      res.remove(typeName);
-    }
-    // done
-    return new List.from(res);
-  }
-
-  /**
-   * Return `true` if the given [element]'s display name ([Element.displayName])
-   * is equal to the given [name].
-   */
-  static bool hasDisplayName(Element element, String name) {
-    if (element == null) {
-      return false;
-    }
-    String elementDisplayName = element.displayName;
-    return StringUtils.equals(elementDisplayName, name);
-  }
-
-  /**
-   * Return `true` if the given [element]'s name ([Element.name]) is equal to
-   * the given [name].
-   */
-  static bool hasName(Element element, String name) {
-    if (element == null) {
-      return false;
-    }
-    String elementName = element.name;
-    return StringUtils.equals(elementName, name);
-  }
-
-  /**
-   * @return `true` if the given [SimpleIdentifier] is the name of the
-   *         [NamedExpression].
-   */
-  static bool isNamedExpressionName(SimpleIdentifier node) {
-    AstNode parent = node.parent;
-    if (parent is Label) {
-      Label label = parent;
-      if (identical(label.label, node)) {
-        AstNode parent2 = label.parent;
-        if (parent2 is NamedExpression) {
-          return identical(parent2.name, label);
-        }
-      }
-    }
-    return false;
-  }
-
-  /**
-   * Adds "toAdd" items which are not excluded.
-   */
-  static void _addAll(
-      Set<String> excluded, Set<String> result, Iterable<String> toAdd) {
-    for (String item in toAdd) {
-      // add name based on "item", but not "excluded"
-      for (int suffix = 1;; suffix++) {
-        // prepare name, just "item" or "item2", "item3", etc
-        String name = item;
-        if (suffix > 1) {
-          name += suffix.toString();
-        }
-        // add once found not excluded
-        if (!excluded.contains(name)) {
-          result.add(name);
-          break;
-        }
-      }
-    }
-  }
-
-  /**
-   * Add to "result" then given "c" or the first ASCII character after it.
-   */
-  static void _addSingleCharacterName(
-      Set<String> excluded, Set<String> result, int c) {
-    while (c < 0x7A) {
-      String name = new String.fromCharCode(c);
-      // may be done
-      if (!excluded.contains(name)) {
-        result.add(name);
-        break;
-      }
-      // next character
-      c = (c + 1);
-    }
-  }
-
-  static String _getBaseNameFromExpression(Expression expression) {
-    String name = null;
-    // e as Type
-    if (expression is AsExpression) {
-      AsExpression asExpression = expression as AsExpression;
-      expression = asExpression.expression;
-    }
-    // analyze expressions
-    if (expression is SimpleIdentifier) {
-      SimpleIdentifier node = expression;
-      return node.name;
-    } else if (expression is PrefixedIdentifier) {
-      PrefixedIdentifier node = expression;
-      return node.identifier.name;
-    } else if (expression is MethodInvocation) {
-      name = expression.methodName.name;
-    } else if (expression is InstanceCreationExpression) {
-      InstanceCreationExpression creation = expression;
-      ConstructorName constructorName = creation.constructorName;
-      TypeName typeName = constructorName.type;
-      if (typeName != null) {
-        Identifier typeNameIdentifier = typeName.name;
-        // new ClassName()
-        if (typeNameIdentifier is SimpleIdentifier) {
-          return typeNameIdentifier.name;
-        }
-        // new prefix.name();
-        if (typeNameIdentifier is PrefixedIdentifier) {
-          PrefixedIdentifier prefixed = typeNameIdentifier;
-          // new prefix.ClassName()
-          if (prefixed.prefix.staticElement is PrefixElement) {
-            return prefixed.identifier.name;
-          }
-          // new ClassName.constructorName()
-          return prefixed.prefix.name;
-        }
-      }
-    }
-    // strip known prefixes
-    if (name != null) {
-      for (int i = 0; i < _KNOWN_METHOD_NAME_PREFIXES.length; i++) {
-        String curr = _KNOWN_METHOD_NAME_PREFIXES[i];
-        if (name.startsWith(curr)) {
-          if (name == curr) {
-            return null;
-          } else if (Character.isUpperCase(name.codeUnitAt(curr.length))) {
-            return name.substring(curr.length);
-          }
-        }
-      }
-    }
-    // done
-    return name;
-  }
-
-  static String _getBaseNameFromLocationInParent(Expression expression) {
-    // value in named expression
-    if (expression.parent is NamedExpression) {
-      NamedExpression namedExpression = expression.parent as NamedExpression;
-      if (identical(namedExpression.expression, expression)) {
-        return namedExpression.name.label.name;
-      }
-    }
-    // positional argument
-    {
-      ParameterElement parameter = expression.propagatedParameterElement;
-      if (parameter == null) {
-        parameter = expression.staticParameterElement;
-      }
-      if (parameter != null) {
-        return parameter.displayName;
-      }
-    }
-    // unknown
-    return null;
-  }
-
-  /**
-   * @return [Expression]s from <code>operands</code> which are completely covered by given
-   *         [SourceRange]. Range should start and end between given [Expression]s.
-   */
-  static List<Expression> _getOperandsForSourceRange(
-      List<Expression> operands, SourceRange range) {
-    assert(!operands.isEmpty);
-    List<Expression> subOperands = [];
-    // track range enter/exit
-    bool entered = false;
-    bool exited = false;
-    // may be range starts before or on first operand
-    if (range.offset <= operands[0].offset) {
-      entered = true;
-    }
-    // iterate over gaps between operands
-    for (int i = 0; i < operands.length - 1; i++) {
-      Expression operand = operands[i];
-      Expression nextOperand = operands[i + 1];
-      SourceRange inclusiveGap =
-          SourceRangeFactory.rangeEndStart(operand, nextOperand).getMoveEnd(1);
-      // add operand, if already entered range
-      if (entered) {
-        subOperands.add(operand);
-        // may be last operand in range
-        if (range.endsIn(inclusiveGap)) {
-          exited = true;
-        }
-      } else {
-        // may be first operand in range
-        if (range.startsIn(inclusiveGap)) {
-          entered = true;
-        }
-      }
-    }
-    // check if last operand is in range
-    Expression lastGroupMember = operands[operands.length - 1];
-    if (range.end == lastGroupMember.end) {
-      subOperands.add(lastGroupMember);
-      exited = true;
-    }
-    // we expect that range covers only given operands
-    if (!exited) {
-      return [];
-    }
-    // done
-    return subOperands;
-  }
-
-  /**
-   * @return all operands of the given [BinaryExpression] and its children with the same
-   *         operator.
-   */
-  static List<Expression> _getOperandsInOrderFor(BinaryExpression groupRoot) {
-    List<Expression> operands = [];
-    TokenType groupOperatorType = groupRoot.operator.type;
-    groupRoot.accept(
-        new GeneralizingAstVisitor_CorrectionUtils_getOperandsInOrderFor(
-            groupOperatorType, operands));
-    return operands;
-  }
-
-  /**
-   * @return all variants of names by removing leading words by one.
-   */
-  static List<String> _getVariableNameSuggestions(String name) {
-    List<String> result = [];
-    List<String> parts =
-        name.split("(?<!(^|[A-Z]))(?=[A-Z])|(?<!^)(?=[A-Z][a-z])");
-    for (int i = 0; i < parts.length; i++) {
-      String suggestion =
-          "${parts[i].toLowerCase()}${StringUtils.join(parts, "", i + 1, parts.length)}";
-      result.add(suggestion);
-    }
-    return result;
-  }
-
-  final CompilationUnit unit;
-
-  LibraryElement _library;
-
-  String _buffer;
-
-  String _endOfLine;
-
-  CorrectionUtils(this.unit) {
-    CompilationUnitElement element = unit.element;
-    this._library = element.library;
-    this._buffer = getSourceContent(element.context, element.source);
-  }
-
-  /**
-   * @return the [AstNode] that encloses the given offset.
-   */
-  AstNode findNode(int offset) => new NodeLocator(offset).searchWithin(unit);
-
-  /**
-   * TODO(scheglov) replace with nodes once there will be [CompilationUnit.comments].
-   *
-   * @return the [SourceRange]s of all comments in [CompilationUnit].
-   */
-  List<SourceRange> get commentRanges {
-    List<SourceRange> ranges = [];
-    Token token = unit.beginToken;
-    while (token != null && token.type != TokenType.EOF) {
-      Token commentToken = token.precedingComments;
-      while (commentToken != null) {
-        ranges.add(SourceRangeFactory.rangeToken(commentToken));
-        commentToken = commentToken.next;
-      }
-      token = token.next;
-    }
-    return ranges;
-  }
-
-  /**
-   * @return the EOL to use for this [CompilationUnit].
-   */
-  String get endOfLine {
-    if (_endOfLine == null) {
-      if (_buffer.contains("\r\n")) {
-        _endOfLine = "\r\n";
-      } else {
-        _endOfLine = "\n";
-      }
-    }
-    return _endOfLine;
-  }
-
-  /**
-   * @return the default indentation with given level.
-   */
-  String getIndent(int level) => StringUtils.repeat("  ", level);
-
-  /**
-   * @return the source of the given [SourceRange] with indentation changed from "oldIndent"
-   *         to "newIndent", keeping indentation of the lines relative to each other.
-   */
-  String getIndentSource(
-      SourceRange range, String oldIndent, String newIndent) {
-    String oldSource = getText3(range);
-    return getIndentSource3(oldSource, oldIndent, newIndent);
-  }
-
-  /**
-   * Indents given source left or right.
-   *
-   * @return the source with changed indentation.
-   */
-  String getIndentSource2(String source, bool right) {
-    StringBuffer buffer = new StringBuffer();
-    String indent = getIndent(1);
-    String eol = endOfLine;
-    List<String> lines =
-        StringUtils.splitByWholeSeparatorPreserveAllTokens(source, eol);
-    for (int i = 0; i < lines.length; i++) {
-      String line = lines[i];
-      // last line, stop if empty
-      if (i == lines.length - 1 && StringUtils.isEmpty(line)) {
-        break;
-      }
-      // update line
-      if (right) {
-        line = "${indent}${line}";
-      } else {
-        line = StringUtils.removeStart(line, indent);
-      }
-      // append line
-      buffer.write(line);
-      buffer.write(eol);
-    }
-    return buffer.toString();
-  }
-
-  /**
-   * @return the source with indentation changed from "oldIndent" to "newIndent", keeping
-   *         indentation of the lines relative to each other.
-   */
-  String getIndentSource3(String source, String oldIndent, String newIndent) {
-    // prepare STRING token ranges
-    List<SourceRange> lineRanges = [];
-    for (Token token in TokenUtils.getTokens(source)) {
-      if (token.type == TokenType.STRING) {
-        lineRanges.add(SourceRangeFactory.rangeToken(token));
-      }
-    }
-    // re-indent lines
-    StringBuffer buffer = new StringBuffer();
-    String eol = endOfLine;
-    List<String> lines =
-        StringUtils.splitByWholeSeparatorPreserveAllTokens(source, eol);
-    int lineOffset = 0;
-    for (int i = 0; i < lines.length; i++) {
-      String line = lines[i];
-      // last line, stop if empty
-      if (i == lines.length - 1 && StringUtils.isEmpty(line)) {
-        break;
-      }
-      // check if "offset" is in one of the String ranges
-      bool inString = false;
-      for (SourceRange lineRange in lineRanges) {
-        if (lineOffset > lineRange.offset && lineOffset < lineRange.end) {
-          inString = true;
-        }
-        if (lineOffset > lineRange.end) {
-          break;
-        }
-      }
-      lineOffset += line.length + eol.length;
-      // update line indent
-      if (!inString) {
-        line = "${newIndent}${StringUtils.removeStart(line, oldIndent)}";
-      }
-      // append line
-      buffer.write(line);
-      buffer.write(eol);
-    }
-    return buffer.toString();
-  }
-
-  /**
-   * @return [InsertDesc], description where to insert new library-related directive.
-   */
-  CorrectionUtils_InsertDesc get insertDescImport {
-    // analyze directives
-    Directive prevDirective = null;
-    for (Directive directive in unit.directives) {
-      if (directive is LibraryDirective ||
-          directive is ImportDirective ||
-          directive is ExportDirective) {
-        prevDirective = directive;
-      }
-    }
-    // insert after last library-related directive
-    if (prevDirective != null) {
-      CorrectionUtils_InsertDesc result = new CorrectionUtils_InsertDesc();
-      result.offset = prevDirective.end;
-      String eol = endOfLine;
-      if (prevDirective is LibraryDirective) {
-        result.prefix = "${eol}${eol}";
-      } else {
-        result.prefix = eol;
-      }
-      return result;
-    }
-    // no directives, use "top" location
-    return insertDescTop;
-  }
-
-  /**
-   * @return [InsertDesc], description where to insert new 'part 'directive.
-   */
-  CorrectionUtils_InsertDesc get insertDescPart {
-    // analyze directives
-    Directive prevDirective = null;
-    for (Directive directive in unit.directives) {
-      prevDirective = directive;
-    }
-    // insert after last directive
-    if (prevDirective != null) {
-      CorrectionUtils_InsertDesc result = new CorrectionUtils_InsertDesc();
-      result.offset = prevDirective.end;
-      String eol = endOfLine;
-      if (prevDirective is PartDirective) {
-        result.prefix = eol;
-      } else {
-        result.prefix = "${eol}${eol}";
-      }
-      return result;
-    }
-    // no directives, use "top" location
-    return insertDescTop;
-  }
-
-  /**
-   * @return [InsertDesc], description where to insert new directive or top-level declaration
-   *         at the top of file.
-   */
-  CorrectionUtils_InsertDesc get insertDescTop {
-    // skip leading line comments
-    int offset = 0;
-    bool insertEmptyLineBefore = false;
-    bool insertEmptyLineAfter = false;
-    String source = text;
-    // skip hash-bang
-    if (offset < source.length - 2) {
-      String linePrefix = getText2(offset, 2);
-      if (linePrefix == "#!") {
-        insertEmptyLineBefore = true;
-        offset = getLineNext(offset);
-        // skip empty lines to first line comment
-        int emptyOffset = offset;
-        while (emptyOffset < source.length - 2) {
-          int nextLineOffset = getLineNext(emptyOffset);
-          String line = source.substring(emptyOffset, nextLineOffset);
-          if (line.trim().isEmpty) {
-            emptyOffset = nextLineOffset;
-            continue;
-          } else if (line.startsWith("//")) {
-            offset = emptyOffset;
-            break;
-          } else {
-            break;
-          }
-        }
-      }
-    }
-    // skip line comments
-    while (offset < source.length - 2) {
-      String linePrefix = getText2(offset, 2);
-      if (linePrefix == "//") {
-        insertEmptyLineBefore = true;
-        offset = getLineNext(offset);
-      } else {
-        break;
-      }
-    }
-    // determine if empty line is required after
-    int nextLineOffset = getLineNext(offset);
-    String insertLine = source.substring(offset, nextLineOffset);
-    if (!insertLine.trim().isEmpty) {
-      insertEmptyLineAfter = true;
-    }
-    // fill InsertDesc
-    CorrectionUtils_InsertDesc desc = new CorrectionUtils_InsertDesc();
-    desc.offset = offset;
-    if (insertEmptyLineBefore) {
-      desc.prefix = endOfLine;
-    }
-    if (insertEmptyLineAfter) {
-      desc.suffix = endOfLine;
-    }
-    return desc;
-  }
-
-  /**
-   * Skips whitespace characters and single EOL on the right from the given position. If from
-   * statement or method end, then this is in the most cases start of the next line.
-   */
-  int getLineContentEnd(int index) {
-    int length = _buffer.length;
-    // skip whitespace characters
-    while (index < length) {
-      int c = _buffer.codeUnitAt(index);
-      if (!Character.isWhitespace(c) || c == 0xD || c == 0xA) {
-        break;
-      }
-      index++;
-    }
-    // skip single \r
-    if (index < length && _buffer.codeUnitAt(index) == 0xD) {
-      index++;
-    }
-    // skip single \n
-    if (index < length && _buffer.codeUnitAt(index) == 0xA) {
-      index++;
-    }
-    // done
-    return index;
-  }
-
-  /**
-   * @return the index of the last space or tab on the left from the given one, if from statement or
-   *         method start, then this is in most cases start of the line.
-   */
-  int getLineContentStart(int index) {
-    while (index > 0) {
-      int c = _buffer.codeUnitAt(index - 1);
-      if (c != 0x20 && c != 0x9) {
-        break;
-      }
-      index--;
-    }
-    return index;
-  }
-
-  /**
-   * @return the start index of the next line after the line which contains given index.
-   */
-  int getLineNext(int index) {
-    int length = _buffer.length;
-    // skip to the end of the line
-    while (index < length) {
-      int c = _buffer.codeUnitAt(index);
-      if (c == 0xD || c == 0xA) {
-        break;
-      }
-      index++;
-    }
-    // skip single \r
-    if (index < length && _buffer.codeUnitAt(index) == 0xD) {
-      index++;
-    }
-    // skip single \n
-    if (index < length && _buffer.codeUnitAt(index) == 0xA) {
-      index++;
-    }
-    // done
-    return index;
-  }
-
-  /**
-   * @return the whitespace prefix of the line which contains given offset.
-   */
-  String getLinePrefix(int index) {
-    int lineStart = getLineThis(index);
-    int length = _buffer.length;
-    int lineNonWhitespace = lineStart;
-    while (lineNonWhitespace < length) {
-      int c = _buffer.codeUnitAt(lineNonWhitespace);
-      if (c == 0xD || c == 0xA) {
-        break;
-      }
-      if (!Character.isWhitespace(c)) {
-        break;
-      }
-      lineNonWhitespace++;
-    }
-    return getText2(lineStart, lineNonWhitespace - lineStart);
-  }
-
-  /**
-   * @return the [getLinesRange] for given [Statement]s.
-   */
-  SourceRange getLinesRange(List<Statement> statements) {
-    SourceRange range = SourceRangeFactory.rangeNodes(statements);
-    return getLinesRange2(range);
-  }
-
-  /**
-   * @return the [SourceRange] which starts at the start of the line of "offset" and ends at
-   *         the start of the next line after "end" of the given [SourceRange], i.e. basically
-   *         complete lines of the source for given [SourceRange].
-   */
-  SourceRange getLinesRange2(SourceRange range) {
-    // start
-    int startOffset = range.offset;
-    int startLineOffset = getLineContentStart(startOffset);
-    // end
-    int endOffset = range.end;
-    int afterEndLineOffset = getLineContentEnd(endOffset);
-    // range
-    return SourceRangeFactory.rangeStartEnd(
-        startLineOffset, afterEndLineOffset);
-  }
-
-  /**
-   * @return the [getLinesRange] for given [Statement]s.
-   */
-  SourceRange getLinesRange3(List<Statement> statements) => getLinesRange([]);
-
-  /**
-   * @return the start index of the line which contains given index.
-   */
-  int getLineThis(int index) {
-    while (index > 0) {
-      int c = _buffer.codeUnitAt(index - 1);
-      if (c == 0xD || c == 0xA) {
-        break;
-      }
-      index--;
-    }
-    return index;
-  }
-
-  /**
-   * @return the line prefix consisting of spaces and tabs on the left from the given
-   *         [AstNode].
-   */
-  String getNodePrefix(AstNode node) {
-    int offset = node.offset;
-    // function literal is special, it uses offset of enclosing line
-    if (node is FunctionExpression) {
-      return getLinePrefix(offset);
-    }
-    // use just prefix directly before node
-    return getPrefix(offset);
-  }
-
-  /**
-   * @return the index of the first non-whitespace character after given index.
-   */
-  int getNonWhitespaceForward(int index) {
-    int length = _buffer.length;
-    // skip whitespace characters
-    while (index < length) {
-      int c = _buffer.codeUnitAt(index);
-      if (!Character.isWhitespace(c)) {
-        break;
-      }
-      index++;
-    }
-    // done
-    return index;
-  }
-
-  /**
-   * @return the source for the parameter with the given type and name.
-   */
-  String getParameterSource(DartType type, String name) {
-    // no type
-    if (type == null || type.isDynamic) {
-      return name;
-    }
-    // function type
-    if (type is FunctionType) {
-      FunctionType functionType = type;
-      StringBuffer buffer = new StringBuffer();
-      // return type
-      DartType returnType = functionType.returnType;
-      if (returnType != null && !returnType.isDynamic) {
-        buffer.write(getTypeSource2(returnType));
-        buffer.writeCharCode(0x20);
-      }
-      // parameter name
-      buffer.write(name);
-      // parameters
-      buffer.writeCharCode(0x28);
-      List<ParameterElement> fParameters = functionType.parameters;
-      for (int i = 0; i < fParameters.length; i++) {
-        ParameterElement fParameter = fParameters[i];
-        if (i != 0) {
-          buffer.write(", ");
-        }
-        buffer.write(getParameterSource(fParameter.type, fParameter.name));
-      }
-      buffer.writeCharCode(0x29);
-      // done
-      return buffer.toString();
-    }
-    // simple type
-    return "${getTypeSource2(type)} ${name}";
-  }
-
-  /**
-   * @return the line prefix consisting of spaces and tabs on the left from the given offset.
-   */
-  String getPrefix(int endIndex) {
-    int startIndex = getLineContentStart(endIndex);
-    return _buffer.substring(startIndex, endIndex);
-  }
-
-  /**
-   * @return the full text of unit.
-   */
-  String get text => _buffer;
-
-  /**
-   * @return the given range of text from unit.
-   */
-  String getText(AstNode node) => getText2(node.offset, node.length);
-
-  /**
-   * @return the given range of text from unit.
-   */
-  String getText2(int offset, int length) =>
-      _buffer.substring(offset, offset + length);
-
-  /**
-   * @return the given range of text from unit.
-   */
-  String getText3(SourceRange range) => getText2(range.offset, range.length);
-
-  /**
-   * @return the actual type source of the given [Expression], may be `null` if can not
-   *         be resolved, should be treated as <code>Dynamic</code>.
-   */
-  String getTypeSource(Expression expression) {
-    if (expression == null) {
-      return null;
-    }
-    DartType type = expression.bestType;
-    String typeSource = getTypeSource2(type);
-    if ("dynamic" == typeSource) {
-      return null;
-    }
-    return typeSource;
-  }
-
-  /**
-   * @return the source to reference the given [Type] in this [CompilationUnit].
-   */
-  String getTypeSource2(DartType type) {
-    StringBuffer buffer = new StringBuffer();
-    // prepare element
-    Element element = type.element;
-    if (element == null) {
-      String source = type.toString();
-      source = StringUtils.remove(source, "<dynamic>");
-      source = StringUtils.remove(source, "<dynamic, dynamic>");
-      return source;
-    }
-    // append prefix
-    {
-      ImportElement imp = _getImportElement(element);
-      if (imp != null && imp.prefix != null) {
-        buffer.write(imp.prefix.displayName);
-        buffer.write(".");
-      }
-    }
-    // append simple name
-    String name = element.displayName;
-    buffer.write(name);
-    // may be type arguments
-    if (type is InterfaceType) {
-      InterfaceType interfaceType = type;
-      List<DartType> arguments = interfaceType.typeArguments;
-      // check if has arguments
-      bool hasArguments = false;
-      for (DartType argument in arguments) {
-        if (!argument.isDynamic) {
-          hasArguments = true;
-          break;
-        }
-      }
-      // append type arguments
-      if (hasArguments) {
-        buffer.write("<");
-        for (int i = 0; i < arguments.length; i++) {
-          DartType argument = arguments[i];
-          if (i != 0) {
-            buffer.write(", ");
-          }
-          buffer.write(getTypeSource2(argument));
-        }
-        buffer.write(">");
-      }
-    }
-    // done
-    return buffer.toString();
-  }
-
-  /**
-   * @return <code>true</code> if selection range contains only whitespace.
-   */
-  bool isJustWhitespace(SourceRange range) =>
-      getText3(range).trim().length == 0;
-
-  /**
-   * @return <code>true</code> if selection range contains only whitespace or comments
-   */
-  bool isJustWhitespaceOrComment(SourceRange range) {
-    String trimmedText = getText3(range).trim();
-    // may be whitespace
-    if (trimmedText.isEmpty) {
-      return true;
-    }
-    // may be comment
-    return TokenUtils.getTokens(trimmedText).isEmpty;
-  }
-
-  /**
-   * @return <code>true</code> if "selection" covers "node" and there are any non-whitespace tokens
-   *         between "selection" and "node" start/end.
-   */
-  bool selectionIncludesNonWhitespaceOutsideNode(
-          SourceRange selection, AstNode node) =>
-      _selectionIncludesNonWhitespaceOutsideRange(
-          selection, SourceRangeFactory.rangeNode(node));
-
-  /**
-   * @return <code>true</code> if given range of [BinaryExpression] can be extracted.
-   */
-  bool validateBinaryExpressionRange(
-      BinaryExpression binaryExpression, SourceRange range) {
-    // only parts of associative expression are safe to extract
-    if (!binaryExpression.operator.type.isAssociativeOperator) {
-      return false;
-    }
-    // prepare selected operands
-    List<Expression> operands = _getOperandsInOrderFor(binaryExpression);
-    List<Expression> subOperands = _getOperandsForSourceRange(operands, range);
-    // if empty, then something wrong with selection
-    if (subOperands.isEmpty) {
-      return false;
-    }
-    // may be some punctuation included into selection - operators, braces, etc
-    if (_selectionIncludesNonWhitespaceOutsideOperands(range, subOperands)) {
-      return false;
-    }
-    // OK
-    return true;
-  }
-
-  /**
-   * @return the [ImportElement] used to import given [Element] into [library].
-   *         May be `null` if was not imported, i.e. declared in the same library.
-   */
-  ImportElement _getImportElement(Element element) {
-    for (ImportElement imp in _library.imports) {
-      Map<String, Element> definedNames = getImportNamespace(imp);
-      if (definedNames.containsValue(element)) {
-        return imp;
-      }
-    }
-    return null;
-  }
-
-  bool _selectionIncludesNonWhitespaceOutsideOperands(
-          SourceRange selection, List<Expression> operands) =>
-      _selectionIncludesNonWhitespaceOutsideRange(
-          selection, SourceRangeFactory.rangeNodes(operands));
-
-  /**
-   * @return <code>true</code> if "selection" covers "range" and there are any non-whitespace tokens
-   *         between "selection" and "range" start/end.
-   */
-  bool _selectionIncludesNonWhitespaceOutsideRange(
-      SourceRange selection, SourceRange range) {
-    // selection should cover range
-    if (!selection.covers(range)) {
-      return false;
-    }
-    // non-whitespace between selection start and range start
-    if (!isJustWhitespaceOrComment(
-        SourceRangeFactory.rangeStartStart(selection, range))) {
-      return true;
-    }
-    // non-whitespace after range
-    if (!isJustWhitespaceOrComment(
-        SourceRangeFactory.rangeEndEnd(range, selection))) {
-      return true;
-    }
-    // only whitespace in selection around range
-    return false;
-  }
-}
-
-/**
- * Describes where to insert new directive or top-level declaration.
- */
-class CorrectionUtils_InsertDesc {
-  int offset = 0;
-
-  String prefix = "";
-
-  String suffix = "";
-}
-
-class GeneralizingAstVisitor_CorrectionUtils_getOperandsInOrderFor
-    extends GeneralizingAstVisitor<Object> {
-  TokenType groupOperatorType;
-
-  List<Expression> operands;
-
-  GeneralizingAstVisitor_CorrectionUtils_getOperandsInOrderFor(
-      this.groupOperatorType, this.operands)
-      : super();
-
-  @override
-  Object visitExpression(Expression node) {
-    if (node is BinaryExpression && node.operator.type == groupOperatorType) {
-      return super.visitNode(node);
-    }
-    operands.add(node);
-    return null;
-  }
-}
-
-class GeneralizingElementVisitor_CorrectionUtils_getChildren
-    extends GeneralizingElementVisitor<Object> {
-  Element parent;
-
-  String name;
-
-  List<Element> children;
-
-  GeneralizingElementVisitor_CorrectionUtils_getChildren(
-      this.parent, this.name, this.children)
-      : super();
-
-  @override
-  Object visitElement(Element element) {
-    if (identical(element, parent)) {
-      super.visitElement(element);
-    } else if (name == null || CorrectionUtils.hasDisplayName(element, name)) {
-      children.add(element);
-    }
-    return null;
-  }
-}
-
-class GeneralizingElementVisitor_HierarchyUtils_getDirectMembers
-    extends GeneralizingElementVisitor<Object> {
-  ClassElement clazz;
-
-  bool includeSynthetic = false;
-
-  List<Element> members;
-
-  GeneralizingElementVisitor_HierarchyUtils_getDirectMembers(
-      this.clazz, this.includeSynthetic, this.members)
-      : super();
-
-  @override
-  Object visitElement(Element element) {
-    if (identical(element, clazz)) {
-      return super.visitElement(element);
-    }
-    if (!includeSynthetic && element.isSynthetic) {
-      return null;
-    }
-    if (element is ConstructorElement) {
-      return null;
-    }
-    if (element is ExecutableElement) {
-      members.add(element);
-    }
-    if (element is FieldElement) {
-      members.add(element);
-    }
-    return null;
-  }
-}
-
-class NameOccurrencesFinder extends RecursiveAstVisitor<Object> {
-  static Iterable<AstNode> findIn(SimpleIdentifier ident, AstNode root) {
-    if (ident == null || ident.bestElement == null) {
-      return new Set<AstNode>();
-    }
-    NameOccurrencesFinder finder = new NameOccurrencesFinder(ident.bestElement);
-    root.accept(finder);
-    return finder.matches;
-  }
-
-  Element _target;
-
-  Element _target2;
-
-  Element _target3;
-
-  Element _target4;
-
-  Set<AstNode> _matches;
-
-  NameOccurrencesFinder(Element source) {
-    this._target = source;
-    while (true) {
-      if (source.kind == ElementKind.GETTER ||
-          source.kind == ElementKind.SETTER) {
-        PropertyAccessorElement accessorElem =
-            source as PropertyAccessorElement;
-        this._target2 = accessorElem.variable;
-        if (source is Member) {
-          Member member = source;
-          this._target4 = member.baseElement;
-        }
-        if (this._target2 is Member) {
-          Member member = source as Member;
-          this._target3 = member.baseElement;
-        }
-      } else if (source.kind == ElementKind.FIELD ||
-          source.kind == ElementKind.TOP_LEVEL_VARIABLE) {
-        PropertyInducingElement propertyElem =
-            source as PropertyInducingElement;
-        this._target2 = propertyElem.getter;
-        this._target3 = propertyElem.setter;
-      } else if (source.kind == ElementKind.METHOD) {
-        if (source is Member) {
-          Member member = source;
-          this._target4 = member.baseElement;
-        }
-      } else if (source.kind == ElementKind.PARAMETER) {
-        ParameterElement param = source as ParameterElement;
-        if (param.isInitializingFormal) {
-          FieldFormalParameterElement fieldInit =
-              param as FieldFormalParameterElement;
-          this._target2 = fieldInit.field;
-        }
-      } else {}
-      break;
-    }
-    if (_target2 == null) {
-      _target2 = _target;
-    }
-    if (_target3 == null) {
-      _target3 = _target;
-    }
-    if (_target4 == null) {
-      _target4 = _target;
-    }
-    this._matches = new Set<AstNode>();
-  }
-
-  Iterable<AstNode> get matches => _matches;
-
-  @override
-  Object visitSimpleIdentifier(SimpleIdentifier node) {
-    Element element = node.bestElement;
-    if (element == null) {
-      return null;
-    }
-    _match(element, node);
-    if (element is Member) {
-      Member member = element;
-      _match(member.baseElement, node);
-    }
-    while (true) {
-      if (element.kind == ElementKind.GETTER ||
-          element.kind == ElementKind.SETTER) {
-        PropertyAccessorElement accessorElem =
-            element as PropertyAccessorElement;
-        _match(accessorElem.variable, node);
-      } else if (element.kind == ElementKind.FIELD ||
-          element.kind == ElementKind.TOP_LEVEL_VARIABLE) {
-        PropertyInducingElement propertyElem =
-            element as PropertyInducingElement;
-        _match(propertyElem.getter, node);
-        _match(propertyElem.setter, node);
-      } else if (element.kind == ElementKind.PARAMETER) {
-        ParameterElement param = element as ParameterElement;
-        if (param.isInitializingFormal) {
-          FieldFormalParameterElement fieldInit =
-              param as FieldFormalParameterElement;
-          _match(fieldInit.field, node);
-        }
-      } else {}
-      break;
-    }
-    return null;
-  }
-
-  void _match(Element element, AstNode node) {
-    if (identical(_target, element) ||
-        identical(_target2, element) ||
-        identical(_target3, element) ||
-        identical(_target4, element)) {
-      _matches.add(node);
-    }
-  }
-}
-
-/**
- * Utilities to work with [Token]s.
- */
-class TokenUtils {
-  /**
-   * @return the first [KeywordToken] with given [Keyword], may be <code>null</code> if
-   *         not found.
-   */
-  static KeywordToken findKeywordToken(List<Token> tokens, Keyword keyword) {
-    for (Token token in tokens) {
-      if (token is KeywordToken) {
-        KeywordToken keywordToken = token;
-        if (keywordToken.keyword == keyword) {
-          return keywordToken;
-        }
-      }
-    }
-    return null;
-  }
-
-  /**
-   * @return the first [Token] with given [TokenType], may be <code>null</code> if not
-   *         found.
-   */
-  static Token findToken(List<Token> tokens, TokenType type) {
-    for (Token token in tokens) {
-      if (token.type == type) {
-        return token;
-      }
-    }
-    return null;
-  }
-
-  /**
-   * @return [Token]s of the given Dart source, not <code>null</code>, may be empty if no
-   *         tokens or some exception happens.
-   */
-  static List<Token> getTokens(String s) {
-    try {
-      List<Token> tokens = [];
-      Scanner scanner = new Scanner(null, new CharSequenceReader(s), null);
-      Token token = scanner.tokenize();
-      while (token.type != TokenType.EOF) {
-        tokens.add(token);
-        token = token.next;
-      }
-      return tokens;
-    } catch (e) {
-      return [];
-    }
-  }
-
-  /**
-   * @return <code>true</code> if given [Token]s contain only single [Token] with given
-   *         [TokenType].
-   */
-  static bool hasOnly(List<Token> tokens, TokenType type) =>
-      tokens.length == 1 && tokens[0].type == type;
-}
diff --git a/pkg/analysis_server/lib/src/services/index/index.dart b/pkg/analysis_server/lib/src/services/index/index.dart
index 374ccaf..5b2204c 100644
--- a/pkg/analysis_server/lib/src/services/index/index.dart
+++ b/pkg/analysis_server/lib/src/services/index/index.dart
@@ -6,13 +6,10 @@
 
 import 'dart:async';
 
-import 'package:analysis_server/analysis/index/index_core.dart';
+import 'package:analysis_server/plugin/index/index_core.dart';
 import 'package:analysis_server/src/services/index/indexable_element.dart';
-import 'package:analyzer/src/generated/ast.dart';
 import 'package:analyzer/src/generated/element.dart';
 import 'package:analyzer/src/generated/engine.dart';
-import 'package:analyzer/src/generated/html.dart';
-import 'package:analyzer/src/generated/source.dart';
 
 /**
  * A filter for [Element] names.
@@ -45,20 +42,12 @@
   List<Element> getTopLevelDeclarations(ElementNameFilter nameFilter);
 
   /**
-   * Processes the given [HtmlUnit] in order to record the relationships.
+   * Processes the given [object] in order to record the relationships.
    *
-   * [context] - the [AnalysisContext] in which [HtmlUnit] was resolved.
-   * [unit] - the [HtmlUnit] being indexed.
+   * [context] - the [AnalysisContext] in which the [object] being indexed.
+   * [object] - the object being indexed.
    */
-  void indexHtmlUnit(AnalysisContext context, HtmlUnit unit);
-
-  /**
-   * Processes the given [CompilationUnit] in order to record the relationships.
-   *
-   * [context] - the [AnalysisContext] in which [CompilationUnit] was resolved.
-   * [unit] - the [CompilationUnit] being indexed.
-   */
-  void indexUnit(AnalysisContext context, CompilationUnit unit);
+  void index(AnalysisContext context, Object object);
 
   /**
    * Starts the index.
@@ -78,8 +67,6 @@
  * a concrete kind of this name - field, method or something else.
  */
 class IndexableName implements IndexableObject {
-  // TODO(brianwilkerson) Replace NameElement with this class. This will require
-  // generalizing the search engine to use IndexableObject rather than Element.
   /**
    * The name to be indexed.
    */
@@ -91,10 +78,10 @@
   IndexableName(this.name);
 
   @override
-  IndexableObjectKind get kind => IndexableNameKind.INSTANCE;
+  String get filePath => null;
 
   @override
-  int get length => 0;
+  IndexableNameKind get kind => IndexableNameKind.INSTANCE;
 
   @override
   int get offset {
@@ -102,7 +89,8 @@
   }
 
   @override
-  Source get source => null;
+  bool operator ==(Object object) =>
+      object is IndexableName && object.name == name;
 
   @override
   String toString() => name;
@@ -111,7 +99,7 @@
 /**
  * The kind of an indexable name.
  */
-class IndexableNameKind implements IndexableObjectKind {
+class IndexableNameKind implements IndexableObjectKind<IndexableName> {
   /**
    * The unique instance of this class.
    */
@@ -131,10 +119,16 @@
   }
 
   @override
-  IndexableObject decode(AnalysisContext context, String filePath, int offset) {
+  IndexableName decode(AnalysisContext context, String filePath, int offset) {
     throw new UnsupportedError(
         'Indexable names cannot be decoded through their kind');
   }
+
+  @override
+  int encodeHash(StringToInt stringToInt, IndexableName indexable) {
+    String name = indexable.name;
+    return stringToInt(name);
+  }
 }
 
 /**
@@ -151,6 +145,14 @@
 
   /**
    * Left: class.
+   *   Has ancestor (extended or implemented, directly or indirectly).
+   * Right: other class declaration.
+   */
+  static final RelationshipImpl HAS_ANCESTOR =
+      RelationshipImpl.getRelationship("has-ancestor");
+
+  /**
+   * Left: class.
    *   Is extended by.
    * Right: other class declaration.
    */
@@ -320,20 +322,6 @@
 }
 
 /**
- * An [Element] which is used to index references to the name without specifying
- * a concrete kind of this name - field, method or something else.
- */
-class NameElement extends ElementImpl {
-  NameElement(String name) : super(name, -1);
-
-  @override
-  ElementKind get kind => ElementKind.NAME;
-
-  @override
-  accept(ElementVisitor visitor) => null;
-}
-
-/**
  * Relationship between an element and a location. Relationships are identified
  * by a globally unique identifier.
  */
@@ -349,7 +337,7 @@
   static int _NEXT_HASH_CODE = 0;
 
   /**
-   * The artifitial hash code for this object.
+   * The artificial hash code for this object.
    */
   final int _hashCode = _NEXT_HASH_CODE++;
 
diff --git a/pkg/analysis_server/lib/src/services/index/index_contributor.dart b/pkg/analysis_server/lib/src/services/index/index_contributor.dart
index 53ef464..6fcd934 100644
--- a/pkg/analysis_server/lib/src/services/index/index_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/index/index_contributor.dart
@@ -6,82 +6,29 @@
 
 import 'dart:collection' show Queue;
 
-import 'package:analysis_server/analysis/index/index_core.dart';
-import 'package:analysis_server/analysis/index/index_dart.dart';
+import 'package:analysis_server/plugin/index/index_core.dart';
 import 'package:analysis_server/src/services/correction/namespace.dart';
 import 'package:analysis_server/src/services/index/index.dart';
 import 'package:analysis_server/src/services/index/index_store.dart';
 import 'package:analysis_server/src/services/index/indexable_element.dart';
+import 'package:analysis_server/src/services/index/indexable_file.dart';
 import 'package:analyzer/src/generated/ast.dart';
 import 'package:analyzer/src/generated/element.dart';
 import 'package:analyzer/src/generated/engine.dart';
-import 'package:analyzer/src/generated/html.dart' as ht;
 import 'package:analyzer/src/generated/java_engine.dart';
 import 'package:analyzer/src/generated/scanner.dart';
 import 'package:analyzer/src/generated/source.dart';
 
 /**
- * Adds data to [store] based on the resolved Dart [unit].
+ * An [IndexContributor] that contributes relationships for Dart files.
  */
-void indexDartUnit(
-    InternalIndexStore store, AnalysisContext context, CompilationUnit unit) {
-  // check unit
-  if (unit == null) {
-    return;
-  }
-  // prepare unit element
-  CompilationUnitElement unitElement = unit.element;
-  if (unitElement == null) {
-    return;
-  }
-  // about to index
-  bool mayIndex = store.aboutToIndexDart(context, unitElement);
-  if (!mayIndex) {
-    return;
-  }
-  // do index
-  try {
-    unit.accept(new _IndexContributor(store));
-    store.doneIndex();
-  } catch (e) {
-    store.cancelIndexDart();
-    rethrow;
-  }
-}
-
-/**
- * Adds data to [store] based on the resolved HTML [unit].
- */
-void indexHtmlUnit(
-    InternalIndexStore store, AnalysisContext context, ht.HtmlUnit unit) {
-  // check unit
-  if (unit == null) {
-    return;
-  }
-  // prepare unit element
-  HtmlElement unitElement = unit.element;
-  if (unitElement == null) {
-    return;
-  }
-  // about to index
-  bool mayIndex = store.aboutToIndexHtml(context, unitElement);
-  if (!mayIndex) {
-    return;
-  }
-  // do index
-  store.doneIndex();
-}
-
-/**
- * An [IndexContributor] that can be used to contribute relationships for Dart
- * files.
- */
-class DefaultDartIndexContributor extends DartIndexContributor {
+class DartIndexContributor extends IndexContributor {
   @override
-  void internalContributeTo(IndexStore store, CompilationUnit unit) {
-    _IndexContributor contributor =
-        new _IndexContributor(store as InternalIndexStore);
-    unit.accept(contributor);
+  void contributeTo(IndexStore store, AnalysisContext context, Object object) {
+    if (store is InternalIndexStore && object is CompilationUnit) {
+      _IndexContributor contributor = new _IndexContributor(store);
+      object.accept(contributor);
+    }
   }
 }
 
@@ -91,6 +38,7 @@
 class _IndexContributor extends GeneralizingAstVisitor {
   final InternalIndexStore _store;
 
+  CompilationUnitElement _unitElement;
   LibraryElement _libraryElement;
 
   Map<ImportElement, Set<Element>> _importElementsMap = {};
@@ -127,7 +75,7 @@
    * Record the given relationship between the given [Element] and
    * [LocationImpl].
    */
-  void recordRelationship(
+  void recordRelationshipElement(
       Element element, RelationshipImpl relationship, LocationImpl location) {
     if (element != null && location != null) {
       _store.recordRelationship(
@@ -135,6 +83,17 @@
     }
   }
 
+  /**
+   * Record the given relationship between the given [IndexableObject] and
+   * [LocationImpl].
+   */
+  void recordRelationshipIndexable(IndexableObject indexable,
+      RelationshipImpl relationship, LocationImpl location) {
+    if (indexable != null && location != null) {
+      _store.recordRelationship(indexable, relationship, location);
+    }
+  }
+
   @override
   visitAssignmentExpression(AssignmentExpression node) {
     _recordOperatorReference(node.operator, node.bestElement);
@@ -153,6 +112,7 @@
     enterScope(element);
     try {
       _recordTopLevelElementDefinition(element);
+      _recordHasAncestor(element);
       {
         ExtendsClause extendsClause = node.extendsClause;
         if (extendsClause != null) {
@@ -162,7 +122,9 @@
           InterfaceType superType = element.supertype;
           if (superType != null) {
             ClassElement objectElement = superType.element;
-            recordRelationship(objectElement, IndexConstants.IS_EXTENDED_BY,
+            recordRelationshipElement(
+                objectElement,
+                IndexConstants.IS_EXTENDED_BY,
                 _createLocationForOffset(node.name.offset, 0));
           }
         }
@@ -195,6 +157,7 @@
     enterScope(element);
     try {
       _recordTopLevelElementDefinition(element);
+      _recordHasAncestor(element);
       {
         TypeName superclassNode = node.superclass;
         if (superclassNode != null) {
@@ -225,10 +188,10 @@
 
   @override
   visitCompilationUnit(CompilationUnit node) {
-    CompilationUnitElement unitElement = node.element;
-    if (unitElement != null) {
-      _elementStack.add(unitElement);
-      _libraryElement = unitElement.enclosingElement;
+    _unitElement = node.element;
+    if (_unitElement != null) {
+      _elementStack.add(_unitElement);
+      _libraryElement = _unitElement.enclosingElement;
       if (_libraryElement != null) {
         super.visitCompilationUnit(node);
       }
@@ -254,7 +217,8 @@
     if (fieldName != null) {
       Element element = fieldName.staticElement;
       LocationImpl location = _createLocationForNode(fieldName);
-      recordRelationship(element, IndexConstants.IS_WRITTEN_BY, location);
+      recordRelationshipElement(
+          element, IndexConstants.IS_WRITTEN_BY, location);
     }
     // index expression
     if (expression != null) {
@@ -282,7 +246,8 @@
       location = _createLocationForOffset(start, 0);
     }
     // record relationship
-    recordRelationship(element, IndexConstants.IS_REFERENCED_BY, location);
+    recordRelationshipElement(
+        element, IndexConstants.IS_REFERENCED_BY, location);
     super.visitConstructorName(node);
   }
 
@@ -316,6 +281,7 @@
       LibraryElement expLibrary = element.exportedLibrary;
       _recordLibraryReference(node, expLibrary);
     }
+    _recordUriFileReference(node);
     super.visitExportDirective(node);
   }
 
@@ -356,6 +322,7 @@
       LibraryElement impLibrary = element.importedLibrary;
       _recordLibraryReference(node, impLibrary);
     }
+    _recordUriFileReference(node);
     super.visitImportDirective(node);
   }
 
@@ -366,7 +333,8 @@
       Token operator = node.leftBracket;
       LocationImpl location =
           _createLocationForToken(operator, element != null);
-      recordRelationship(element, IndexConstants.IS_INVOKED_BY, location);
+      recordRelationshipElement(
+          element, IndexConstants.IS_INVOKED_BY, location);
     }
     super.visitIndexExpression(node);
   }
@@ -386,18 +354,20 @@
   visitMethodInvocation(MethodInvocation node) {
     SimpleIdentifier name = node.methodName;
     LocationImpl location = _createLocationForNode(name);
+    // name invocation
+    recordRelationshipIndexable(
+        new IndexableName(name.name), IndexConstants.IS_INVOKED_BY, location);
     // element invocation
     Element element = name.bestElement;
     if (element is MethodElement ||
         element is PropertyAccessorElement ||
         element is FunctionElement ||
         element is VariableElement) {
-      recordRelationship(element, IndexConstants.IS_INVOKED_BY, location);
-    }
-    // name invocation
-    {
-      recordRelationship(
-          new NameElement(name.name), IndexConstants.IS_INVOKED_BY, location);
+      recordRelationshipElement(
+          element, IndexConstants.IS_INVOKED_BY, location);
+    } else if (element is ClassElement) {
+      recordRelationshipElement(
+          element, IndexConstants.IS_REFERENCED_BY, location);
     }
     _recordImportElementReferenceWithoutPrefix(name);
     super.visitMethodInvocation(node);
@@ -407,14 +377,17 @@
   visitPartDirective(PartDirective node) {
     Element element = node.element;
     LocationImpl location = _createLocationForNode(node.uri);
-    recordRelationship(element, IndexConstants.IS_REFERENCED_BY, location);
+    recordRelationshipElement(
+        element, IndexConstants.IS_REFERENCED_BY, location);
+    _recordUriFileReference(node);
     super.visitPartDirective(node);
   }
 
   @override
   visitPartOfDirective(PartOfDirective node) {
     LocationImpl location = _createLocationForNode(node.libraryName);
-    recordRelationship(node.element, IndexConstants.IS_REFERENCED_BY, location);
+    recordRelationshipElement(
+        node.element, IndexConstants.IS_REFERENCED_BY, location);
   }
 
   @override
@@ -441,21 +414,22 @@
       int start = node.thisKeyword.end;
       location = _createLocationForOffset(start, 0);
     }
-    recordRelationship(element, IndexConstants.IS_REFERENCED_BY, location);
+    recordRelationshipElement(
+        element, IndexConstants.IS_REFERENCED_BY, location);
     super.visitRedirectingConstructorInvocation(node);
   }
 
   @override
   visitSimpleIdentifier(SimpleIdentifier node) {
-    NameElement nameElement = new NameElement(node.name);
+    IndexableName indexableName = new IndexableName(node.name);
     LocationImpl location = _createLocationForNode(node);
     if (location == null) {
       return;
     }
     // name in declaration
     if (node.inDeclarationContext()) {
-      recordRelationship(
-          nameElement, IndexConstants.NAME_IS_DEFINED_BY, location);
+      recordRelationshipIndexable(
+          indexableName, IndexConstants.NAME_IS_DEFINED_BY, location);
       return;
     }
     // prepare information
@@ -470,12 +444,14 @@
       bool inGetterContext = node.inGetterContext();
       bool inSetterContext = node.inSetterContext();
       if (inGetterContext && inSetterContext) {
-        recordRelationship(
-            nameElement, IndexConstants.IS_READ_WRITTEN_BY, location);
+        recordRelationshipIndexable(
+            indexableName, IndexConstants.IS_READ_WRITTEN_BY, location);
       } else if (inGetterContext) {
-        recordRelationship(nameElement, IndexConstants.IS_READ_BY, location);
+        recordRelationshipIndexable(
+            indexableName, IndexConstants.IS_READ_BY, location);
       } else if (inSetterContext) {
-        recordRelationship(nameElement, IndexConstants.IS_WRITTEN_BY, location);
+        recordRelationshipIndexable(
+            indexableName, IndexConstants.IS_WRITTEN_BY, location);
       }
     }
     // this.field parameter
@@ -483,7 +459,7 @@
       RelationshipImpl relationship = peekElement().element == element
           ? IndexConstants.IS_WRITTEN_BY
           : IndexConstants.IS_REFERENCED_BY;
-      recordRelationship(element.field, relationship, location);
+      recordRelationshipElement(element.field, relationship, location);
       return;
     }
     // record specific relations
@@ -495,22 +471,26 @@
         element is PropertyAccessorElement ||
         element is PropertyInducingElement ||
         element is TypeParameterElement) {
-      recordRelationship(element, IndexConstants.IS_REFERENCED_BY, location);
+      recordRelationshipElement(
+          element, IndexConstants.IS_REFERENCED_BY, location);
     } else if (element is PrefixElement) {
-      recordRelationship(element, IndexConstants.IS_REFERENCED_BY, location);
+      recordRelationshipElement(
+          element, IndexConstants.IS_REFERENCED_BY, location);
       _recordImportElementReferenceWithPrefix(node);
     } else if (element is ParameterElement || element is LocalVariableElement) {
       bool inGetterContext = node.inGetterContext();
       bool inSetterContext = node.inSetterContext();
       if (inGetterContext && inSetterContext) {
-        recordRelationship(
+        recordRelationshipElement(
             element, IndexConstants.IS_READ_WRITTEN_BY, location);
       } else if (inGetterContext) {
-        recordRelationship(element, IndexConstants.IS_READ_BY, location);
+        recordRelationshipElement(element, IndexConstants.IS_READ_BY, location);
       } else if (inSetterContext) {
-        recordRelationship(element, IndexConstants.IS_WRITTEN_BY, location);
+        recordRelationshipElement(
+            element, IndexConstants.IS_WRITTEN_BY, location);
       } else {
-        recordRelationship(element, IndexConstants.IS_REFERENCED_BY, location);
+        recordRelationshipElement(
+            element, IndexConstants.IS_REFERENCED_BY, location);
       }
     }
     _recordImportElementReferenceWithoutPrefix(node);
@@ -529,7 +509,8 @@
       int start = node.superKeyword.end;
       location = _createLocationForOffset(start, 0);
     }
-    recordRelationship(element, IndexConstants.IS_REFERENCED_BY, location);
+    recordRelationshipElement(
+        element, IndexConstants.IS_REFERENCED_BY, location);
     super.visitSuperConstructorInvocation(node);
   }
 
@@ -562,7 +543,8 @@
       SimpleIdentifier name = node.name;
       LocationImpl location = _createLocationForNode(name);
       location = _getLocationWithExpressionType(location, node.initializer);
-      recordRelationship(element, IndexConstants.NAME_IS_DEFINED_BY, location);
+      recordRelationshipElement(
+          element, IndexConstants.NAME_IS_DEFINED_BY, location);
     }
     // visit
     enterScope(element);
@@ -673,6 +655,40 @@
     return false;
   }
 
+  void _recordHasAncestor(ClassElement element) {
+    int offset = element.nameOffset;
+    int length = element.nameLength;
+    LocationImpl location = _createLocationForOffset(offset, length);
+    _recordHasAncestor0(location, element, false, <ClassElement>[]);
+  }
+
+  void _recordHasAncestor0(LocationImpl location, ClassElement element,
+      bool includeThis, List<ClassElement> visitedElements) {
+    if (element == null) {
+      return;
+    }
+    if (visitedElements.contains(element)) {
+      return;
+    }
+    visitedElements.add(element);
+    if (includeThis) {
+      recordRelationshipElement(element, IndexConstants.HAS_ANCESTOR, location);
+    }
+    {
+      InterfaceType superType = element.supertype;
+      if (superType != null) {
+        _recordHasAncestor0(location, superType.element, true, visitedElements);
+      }
+    }
+    for (InterfaceType mixinType in element.mixins) {
+      _recordHasAncestor0(location, mixinType.element, true, visitedElements);
+    }
+    for (InterfaceType implementedType in element.interfaces) {
+      _recordHasAncestor0(
+          location, implementedType.element, true, visitedElements);
+    }
+  }
+
   /**
    * Records [ImportElement] reference if given [SimpleIdentifier] references some
    * top-level element and not qualified with import prefix.
@@ -689,7 +705,7 @@
         _libraryElement, null, element, _importElementsMap);
     if (importElement != null) {
       LocationImpl location = _createLocationForOffset(node.offset, 0);
-      recordRelationship(
+      recordRelationshipElement(
           importElement, IndexConstants.IS_REFERENCED_BY, location);
     }
   }
@@ -704,7 +720,7 @@
       int offset = prefixNode.offset;
       int length = info.periodEnd - offset;
       LocationImpl location = _createLocationForOffset(offset, length);
-      recordRelationship(
+      recordRelationshipElement(
           info.element, IndexConstants.IS_REFERENCED_BY, location);
     }
   }
@@ -716,7 +732,7 @@
   void _recordLibraryReference(UriBasedDirective node, LibraryElement library) {
     if (library != null) {
       LocationImpl location = _createLocationForNode(node.uri);
-      recordRelationship(library.definingCompilationUnit,
+      recordRelationshipElement(library.definingCompilationUnit,
           IndexConstants.IS_REFERENCED_BY, location);
     }
   }
@@ -739,12 +755,14 @@
       if (StringUtilities.endsWithChar(name, 0x3D) && name != "==") {
         name = name.substring(0, name.length - 1);
       }
-      Element nameElement = new NameElement(name);
-      recordRelationship(nameElement, IndexConstants.IS_INVOKED_BY, location);
+      IndexableName indexableName = new IndexableName(name);
+      recordRelationshipIndexable(
+          indexableName, IndexConstants.IS_INVOKED_BY, location);
     }
     // record element reference
     if (element != null) {
-      recordRelationship(element, IndexConstants.IS_INVOKED_BY, location);
+      recordRelationshipElement(
+          element, IndexConstants.IS_INVOKED_BY, location);
     }
   }
 
@@ -756,7 +774,7 @@
       Identifier superName = superNode.name;
       if (superName != null) {
         Element superElement = superName.staticElement;
-        recordRelationship(
+        recordRelationshipElement(
             superElement, relationship, _createLocationForNode(superNode));
       }
     }
@@ -768,14 +786,27 @@
   void _recordTopLevelElementDefinition(Element element) {
     if (element != null) {
       IndexableElement indexable = new IndexableElement(element);
-      int offset = indexable.offset;
-      int length = indexable.length;
+      int offset = element.nameOffset;
+      int length = element.nameLength;
       LocationImpl location = new LocationImpl(indexable, offset, length);
-      recordRelationship(_libraryElement, IndexConstants.DEFINES, location);
+      recordRelationshipElement(
+          _libraryElement, IndexConstants.DEFINES, location);
       _store.recordTopLevelDeclaration(element);
     }
   }
 
+  void _recordUriFileReference(UriBasedDirective directive) {
+    Source source = directive.source;
+    if (source != null) {
+      LocationImpl location = new LocationImpl(
+          new IndexableFile(_unitElement.source.fullName),
+          directive.uri.offset,
+          directive.uri.length);
+      _store.recordRelationship(new IndexableFile(source.fullName),
+          IndexConstants.IS_REFERENCED_BY, location);
+    }
+  }
+
   /**
    * If the given expression has resolved type, returns the new location with this type.
    *
diff --git a/pkg/analysis_server/lib/src/services/index/index_store.dart b/pkg/analysis_server/lib/src/services/index/index_store.dart
index 858d0ac..574a727 100644
--- a/pkg/analysis_server/lib/src/services/index/index_store.dart
+++ b/pkg/analysis_server/lib/src/services/index/index_store.dart
@@ -4,7 +4,7 @@
 
 library services.index_store;
 
-import 'package:analysis_server/analysis/index/index_core.dart';
+import 'package:analysis_server/plugin/index/index_core.dart';
 import 'package:analysis_server/src/services/index/index.dart';
 import 'package:analyzer/src/generated/element.dart';
 import 'package:analyzer/src/generated/engine.dart';
@@ -20,48 +20,27 @@
   String get statistics;
 
   /**
-   * Notifies the index store that we are going to index an unit with the given
-   * [unitElement].
+   * Notifies the index store that we are going to index the given [object].
    *
-   * If the unit is a part of a library, then all its locations are removed.
+   * [context] - the [AnalysisContext] in which the [object] being indexed.
+   * [object] - the object being indexed.
    *
-   * If it is a defining compilation unit of a library, then index store also
-   * checks if some previously indexed parts of the library are not parts of the
-   * library anymore, and clears their information.
-   *
-   * [context] - the [AnalysisContext] in which unit being indexed.
-   * [unitElement] - the element of the unit being indexed.
-   *
-   * Returns `true` if the given [unitElement] may be indexed, or `false` if
+   * Returns `true` if the given [object] may be indexed, or `false` if
    * belongs to a disposed [AnalysisContext], is not resolved completely, etc.
    */
-  bool aboutToIndexDart(
-      AnalysisContext context, CompilationUnitElement unitElement);
+  bool aboutToIndex(AnalysisContext context, Object object);
 
   /**
-   * Notifies the index store that we are going to index an unit with the given
-   * [htmlElement].
-   *
-   * [context] - the [AnalysisContext] in which unit being indexed.
-   * [htmlElement] - the [HtmlElement] being indexed.
-   *
-   * Returns `true` if the given [htmlElement] may be indexed, or `false` if
-   * belongs to a disposed [AnalysisContext], is not resolved completely, etc.
-   */
-  bool aboutToIndexHtml(AnalysisContext context, HtmlElement htmlElement);
-
-  /**
-   * Notifies the index store that there was an error during the current Dart
+   * Notifies the index store that there was an error during the current
    * indexing, and all the information recorded after the last
-   * [aboutToIndexDart] invocation must be discarded.
+   * [aboutToIndex] invocation must be discarded.
    */
-  void cancelIndexDart();
+  void cancelIndex();
 
   /**
-   * Notifies the index store that the current Dart or HTML unit indexing is
-   * done.
+   * Notifies the index store that the current object indexing is done.
    *
-   * If this method is not invoked after corresponding "aboutToIndex*"
+   * If this method is not invoked after corresponding [aboutToIndex]
    * invocation, all recorded information may be lost.
    */
   void doneIndex();
diff --git a/pkg/analysis_server/lib/src/services/index/indexable_element.dart b/pkg/analysis_server/lib/src/services/index/indexable_element.dart
index c0a30e7..57f8659 100644
--- a/pkg/analysis_server/lib/src/services/index/indexable_element.dart
+++ b/pkg/analysis_server/lib/src/services/index/indexable_element.dart
@@ -6,10 +6,11 @@
 
 import 'dart:collection';
 
-import 'package:analysis_server/analysis/index/index_core.dart';
+import 'package:analysis_server/plugin/index/index_core.dart';
 import 'package:analyzer/src/generated/element.dart';
 import 'package:analyzer/src/generated/engine.dart';
 import 'package:analyzer/src/generated/source.dart';
+import 'package:analyzer/src/generated/utilities_general.dart';
 
 /**
  * A wrapper around an [Element] that implements the [IndexableObject] interface.
@@ -30,16 +31,15 @@
   }
 
   @override
+  String get filePath {
+    return element.source?.fullName;
+  }
+
+  @override
   int get hashCode => element.hashCode;
 
   @override
-  IndexableObjectKind get kind => IndexableElementKind.forElement(element);
-
-  @override
-  int get length => element.displayName.length;
-
-  @override
-  String get name => element.displayName;
+  IndexableElementKind get kind => IndexableElementKind.forElement(element);
 
   @override
   int get offset {
@@ -50,9 +50,6 @@
   }
 
   @override
-  Source get source => element.source;
-
-  @override
   bool operator ==(Object object) =>
       object is IndexableElement && element == object.element;
 
@@ -63,11 +60,11 @@
 /**
  * The kind associated with an [IndexableElement].
  */
-class IndexableElementKind implements IndexableObjectKind {
+class IndexableElementKind implements IndexableObjectKind<IndexableElement> {
   /**
    * A table mapping element kinds to the corresponding indexable element kind.
    */
-  static Map<ElementKind, IndexableElementKind> _kindMap =
+  static final Map<ElementKind, IndexableElementKind> _kindMap =
       new HashMap<ElementKind, IndexableElementKind>();
 
   /**
@@ -75,7 +72,7 @@
    * of constructors associated with a class) to the indexable element kind used
    * to represent it.
    */
-  static Map<int, IndexableElementKind> _constructorKinds =
+  static final Map<int, IndexableElementKind> _constructorKinds =
       new HashMap<int, IndexableElementKind>();
 
   @override
@@ -107,7 +104,8 @@
   }
 
   @override
-  IndexableObject decode(AnalysisContext context, String filePath, int offset) {
+  IndexableElement decode(
+      AnalysisContext context, String filePath, int offset) {
     List<Source> unitSources = context.getSourcesWithFullName(filePath);
     for (Source unitSource in unitSources) {
       List<Source> libSources = context.getLibrariesContaining(unitSource);
@@ -145,6 +143,20 @@
     return null;
   }
 
+  @override
+  int encodeHash(StringToInt stringToInt, IndexableElement indexable) {
+    Element element = indexable.element;
+    String elementName = element.displayName;
+    int elementNameId = stringToInt(elementName);
+    LibraryElement libraryElement = element.library;
+    if (libraryElement != null) {
+      String libraryPath = libraryElement.source.fullName;
+      int libraryPathId = stringToInt(libraryPath);
+      return JenkinsSmiHash.combine(libraryPathId, elementNameId);
+    }
+    return elementNameId;
+  }
+
   /**
    * Return the indexable element kind representing the given [element].
    */
diff --git a/pkg/analysis_server/lib/src/services/index/indexable_file.dart b/pkg/analysis_server/lib/src/services/index/indexable_file.dart
new file mode 100644
index 0000000..7babfef
--- /dev/null
+++ b/pkg/analysis_server/lib/src/services/index/indexable_file.dart
@@ -0,0 +1,74 @@
+// 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 services.index.indexable_file;
+
+import 'package:analysis_server/plugin/index/index_core.dart';
+import 'package:analyzer/src/generated/engine.dart';
+
+/**
+ * An [IndexableObject] which is used to index references to a file.
+ */
+class IndexableFile implements IndexableObject {
+  /**
+   * The path of the file to be indexed.
+   */
+  @override
+  final String path;
+
+  /**
+   * Initialize a newly created indexable file to represent the given [path].
+   */
+  IndexableFile(this.path);
+
+  @override
+  String get filePath => path;
+
+  @override
+  IndexableObjectKind get kind => IndexableFileKind.INSTANCE;
+
+  @override
+  int get offset => -1;
+
+  @override
+  bool operator ==(Object object) =>
+      object is IndexableFile && object.path == path;
+
+  @override
+  String toString() => path;
+}
+
+/**
+ * The kind of an indexable file.
+ */
+class IndexableFileKind implements IndexableObjectKind<IndexableFile> {
+  /**
+   * The unique instance of this class.
+   */
+  static final IndexableFileKind INSTANCE =
+      new IndexableFileKind._(IndexableObjectKind.nextIndex);
+
+  /**
+   * The index uniquely identifying this kind.
+   */
+  final int index;
+
+  /**
+   * Initialize a newly created kind to have the given [index].
+   */
+  IndexableFileKind._(this.index) {
+    IndexableObjectKind.register(this);
+  }
+
+  @override
+  IndexableFile decode(AnalysisContext context, String filePath, int offset) {
+    return new IndexableFile(filePath);
+  }
+
+  @override
+  int encodeHash(StringToInt stringToInt, IndexableFile indexable) {
+    String path = indexable.path;
+    return stringToInt(path);
+  }
+}
diff --git a/pkg/analysis_server/lib/src/services/index/local_file_index.dart b/pkg/analysis_server/lib/src/services/index/local_file_index.dart
index c845c11..022fa1b 100644
--- a/pkg/analysis_server/lib/src/services/index/local_file_index.dart
+++ b/pkg/analysis_server/lib/src/services/index/local_file_index.dart
@@ -14,8 +14,12 @@
 Index createLocalFileIndex() {
   var fileManager = new TemporaryFolderFileManager();
   var stringCodec = new StringCodec();
-  var nodeManager = new FileNodeManager(fileManager,
-      AnalysisEngine.instance.logger, stringCodec, new ContextCodec(),
-      new ElementCodec(stringCodec), new RelationshipCodec(stringCodec));
+  var nodeManager = new FileNodeManager(
+      fileManager,
+      AnalysisEngine.instance.logger,
+      stringCodec,
+      new ContextCodec(),
+      new ElementCodec(stringCodec),
+      new RelationshipCodec(stringCodec));
   return new LocalIndex(nodeManager);
 }
diff --git a/pkg/analysis_server/lib/src/services/index/local_index.dart b/pkg/analysis_server/lib/src/services/index/local_index.dart
index 887a003..624d3ff 100644
--- a/pkg/analysis_server/lib/src/services/index/local_index.dart
+++ b/pkg/analysis_server/lib/src/services/index/local_index.dart
@@ -6,15 +6,11 @@
 
 import 'dart:async';
 
-import 'package:analysis_server/analysis/index/index_core.dart';
+import 'package:analysis_server/plugin/index/index_core.dart';
 import 'package:analysis_server/src/services/index/index.dart';
-import 'package:analysis_server/src/services/index/index_contributor.dart'
-    as oldContributors;
 import 'package:analysis_server/src/services/index/store/split_store.dart';
-import 'package:analyzer/src/generated/ast.dart';
 import 'package:analyzer/src/generated/element.dart';
 import 'package:analyzer/src/generated/engine.dart';
-import 'package:analyzer/src/generated/html.dart';
 import 'package:analyzer/src/generated/source.dart';
 
 /**
@@ -24,12 +20,14 @@
   /**
    * The index contributors used by this index.
    */
-  List<IndexContributor> contributors;
+  List<IndexContributor> contributors = <IndexContributor>[];
 
   SplitIndexStore _store;
 
   LocalIndex(NodeManager nodeManager) {
-    _store = new SplitIndexStore(nodeManager);
+    // TODO(scheglov) get IndexObjectManager(s) as a parameter
+    _store = new SplitIndexStore(
+        nodeManager, <IndexObjectManager>[new DartUnitIndexObjectManager()]);
   }
 
   @override
@@ -50,11 +48,11 @@
 
   /**
    * Returns a `Future<List<Location>>` that completes with the list of
-   * [LocationImpl]s of the given [relationship] with the given [element].
+   * [LocationImpl]s of the given [relationship] with the given [indexable].
    *
-   * For example, if the [element] represents a function and the [relationship]
-   * is the `is-invoked-by` relationship, then the locations will be all of the
-   * places where the function is invoked.
+   * For example, if the [indexable] represents a function element and the
+   * [relationship] is the `is-invoked-by` relationship, then the locations
+   * will be all of the places where the function is invoked.
    */
   @override
   Future<List<LocationImpl>> getRelationships(
@@ -68,13 +66,22 @@
   }
 
   @override
-  void indexHtmlUnit(AnalysisContext context, HtmlUnit unit) {
-    oldContributors.indexHtmlUnit(_store, context, unit);
-  }
-
-  @override
-  void indexUnit(AnalysisContext context, CompilationUnit unit) {
-    oldContributors.indexDartUnit(_store, context, unit);
+  void index(AnalysisContext context, Object object) {
+    // about to index
+    bool mayIndex = _store.aboutToIndex(context, object);
+    if (!mayIndex) {
+      return;
+    }
+    // do index
+    try {
+      for (IndexContributor contributor in contributors) {
+        contributor.contributeTo(_store, context, object);
+      }
+      _store.doneIndex();
+    } catch (e) {
+      _store.cancelIndex();
+      rethrow;
+    }
   }
 
   @override
diff --git a/pkg/analysis_server/lib/src/services/index/local_memory_index.dart b/pkg/analysis_server/lib/src/services/index/local_memory_index.dart
index 7e2c8fc..484085f 100644
--- a/pkg/analysis_server/lib/src/services/index/local_memory_index.dart
+++ b/pkg/analysis_server/lib/src/services/index/local_memory_index.dart
@@ -4,10 +4,15 @@
 
 library services.index.memory_file_index;
 
+import 'package:analysis_server/plugin/index/index_core.dart';
 import 'package:analysis_server/src/services/index/index.dart';
+import 'package:analysis_server/src/services/index/index_contributor.dart';
 import 'package:analysis_server/src/services/index/local_index.dart';
 import 'package:analysis_server/src/services/index/store/memory_node_manager.dart';
 
 Index createLocalMemoryIndex() {
-  return new LocalIndex(new MemoryNodeManager());
+  MemoryNodeManager nodeManager = new MemoryNodeManager();
+  LocalIndex index = new LocalIndex(nodeManager);
+  index.contributors = <IndexContributor>[new DartIndexContributor()];
+  return index;
 }
diff --git a/pkg/analysis_server/lib/src/services/index/store/codec.dart b/pkg/analysis_server/lib/src/services/index/store/codec.dart
index 062eae6..8fd23ab 100644
--- a/pkg/analysis_server/lib/src/services/index/store/codec.dart
+++ b/pkg/analysis_server/lib/src/services/index/store/codec.dart
@@ -6,13 +6,9 @@
 
 import 'dart:collection';
 
-import 'package:analysis_server/analysis/index/index_core.dart';
+import 'package:analysis_server/plugin/index/index_core.dart';
 import 'package:analysis_server/src/services/index/index.dart';
-import 'package:analysis_server/src/services/index/indexable_element.dart';
-import 'package:analyzer/src/generated/element.dart';
 import 'package:analyzer/src/generated/engine.dart';
-import 'package:analyzer/src/generated/source.dart';
-import 'package:analyzer/src/generated/utilities_general.dart';
 
 /**
  * A helper that encodes/decodes [AnalysisContext]s from/to integers.
@@ -79,71 +75,55 @@
    */
   IndexableObject decode(
       AnalysisContext context, int fileId, int offset, int kindId) {
-    String filePath = _stringCodec.decode(fileId);
     IndexableObjectKind kind = IndexableObjectKind.getKind(kindId);
     if (kind == null) {
       return null;
     } else if (kind is IndexableNameKind) {
-      return new IndexableElement(new NameElement(_stringCodec.decode(offset)));
+      String name = _stringCodec.decode(offset);
+      return new IndexableName(name);
     }
+    String filePath = _stringCodec.decode(fileId);
     return kind.decode(context, filePath, offset);
   }
 
   /**
-   * Returns the first component of the [element] id.
-   * In the most cases it is an encoding of the [element]'s file path.
-   * If the given [element] is not defined in a file, returns `-1`.
+   * Returns the first component of the [indexable] id.
+   * In the most cases it is an encoding of the [indexable]'s file path.
+   * If the given [indexable] is not defined in a file, returns `-1`.
    */
   int encode1(IndexableObject indexable) {
-    Source source = indexable.source;
-    if (source == null) {
+    String filePath = indexable.filePath;
+    if (filePath == null) {
       return -1;
     }
-    String filePath = source.fullName;
     return _stringCodec.encode(filePath);
   }
 
   /**
-   * Returns the second component of the [element] id.
-   * In the most cases it is the [element]'s name offset.
+   * Returns the second component of the [indexable] id.
+   * In the most cases it is the [indexable]'s name offset.
    */
   int encode2(IndexableObject indexable) {
     if (indexable is IndexableName) {
       String name = indexable.name;
       return _stringCodec.encode(name);
     }
-    int offset = indexable.offset;
-    if (offset < 0) {
-      return _stringCodec.encode(indexable.name);
-    }
-    return offset;
+    return indexable.offset;
   }
 
   /**
-   * Returns the third component of the [element] id.
-   * In the most cases it is the [element]'s kind.
+   * Returns the third component of the [indexable] id.
+   * In the most cases it is the [indexable]'s kind.
    */
   int encode3(IndexableObject indexable) {
     return indexable.kind.index;
   }
 
   /**
-   * Returns an integer that corresponds to the name of [element].
+   * Returns an integer that corresponds to the name of [indexable].
    */
   int encodeHash(IndexableObject indexable) {
-    // TODO(brianwilkerson) Consider moving this to IndexableObjectKind so that
-    // we don't have to break encapsulation.
-    String elementName = indexable.name; // was: indexable.displayName;
-    int elementNameId = _stringCodec.encode(elementName);
-    if (indexable is IndexableElement) {
-      LibraryElement libraryElement = indexable.element.library;
-      if (libraryElement != null) {
-        String libraryPath = libraryElement.source.fullName;
-        int libraryPathId = _stringCodec.encode(libraryPath);
-        return JenkinsSmiHash.combine(libraryPathId, elementNameId);
-      }
-    }
-    return elementNameId;
+    return indexable.kind.encodeHash(_stringCodec.encode, indexable);
   }
 }
 
diff --git a/pkg/analysis_server/lib/src/services/index/store/split_store.dart b/pkg/analysis_server/lib/src/services/index/store/split_store.dart
index ee5c3b8..880cad3 100644
--- a/pkg/analysis_server/lib/src/services/index/store/split_store.dart
+++ b/pkg/analysis_server/lib/src/services/index/store/split_store.dart
@@ -8,13 +8,14 @@
 import 'dart:collection';
 import 'dart:typed_data';
 
-import 'package:analysis_server/analysis/index/index_core.dart';
+import 'package:analysis_server/plugin/index/index_core.dart';
 import 'package:analysis_server/src/analysis_server.dart';
 import 'package:analysis_server/src/services/index/index.dart';
 import 'package:analysis_server/src/services/index/index_store.dart';
 import 'package:analysis_server/src/services/index/indexable_element.dart';
 import 'package:analysis_server/src/services/index/store/codec.dart';
 import 'package:analysis_server/src/services/index/store/collection.dart';
+import 'package:analyzer/src/generated/ast.dart' show CompilationUnit;
 import 'package:analyzer/src/generated/element.dart';
 import 'package:analyzer/src/generated/engine.dart';
 import 'package:analyzer/src/generated/java_engine.dart';
@@ -22,6 +23,187 @@
 import 'package:analyzer/src/generated/utilities_general.dart';
 
 /**
+ * The implementation of [IndexObjectManager] for indexing
+ * [CompilationUnitElement]s.
+ */
+class DartUnitIndexObjectManager extends IndexObjectManager {
+  /**
+   * The mapping of library [Source] to the [Source]s of part units.
+   */
+  Map<AnalysisContext, Map<Source, Set<Source>>> _contextToLibraryToUnits =
+      new HashMap<AnalysisContext, Map<Source, Set<Source>>>();
+
+  /**
+   * The mapping of unit [Source] to the [Source]s of libraries it is used in.
+   */
+  Map<AnalysisContext, Map<Source, Set<Source>>> _contextToUnitToLibraries =
+      new HashMap<AnalysisContext, Map<Source, Set<Source>>>();
+
+  @override
+  String aboutToIndex(AnalysisContext context, Object object) {
+    CompilationUnitElement unitElement;
+    if (object is CompilationUnit) {
+      unitElement = object.element;
+    } else if (object is CompilationUnitElement) {
+      unitElement = object;
+    }
+    // validate unit
+    if (unitElement == null) {
+      return null;
+    }
+    LibraryElement libraryElement = unitElement.library;
+    if (libraryElement == null) {
+      return null;
+    }
+    CompilationUnitElement definingUnitElement =
+        libraryElement.definingCompilationUnit;
+    if (definingUnitElement == null) {
+      return null;
+    }
+    // prepare sources
+    Source library = definingUnitElement.source;
+    Source unit = unitElement.source;
+    // special handling for the defining library unit
+    if (unit == library) {
+      // prepare new parts
+      HashSet<Source> newParts = new HashSet<Source>();
+      for (CompilationUnitElement part in libraryElement.parts) {
+        newParts.add(part.source);
+      }
+      // prepare old parts
+      Map<Source, Set<Source>> libraryToUnits =
+          _contextToLibraryToUnits[context];
+      if (libraryToUnits == null) {
+        libraryToUnits = new HashMap<Source, Set<Source>>();
+        _contextToLibraryToUnits[context] = libraryToUnits;
+      }
+      Set<Source> oldParts = libraryToUnits[library];
+      // check if some parts are not in the library now
+      if (oldParts != null) {
+        Set<Source> noParts = oldParts.difference(newParts);
+        for (Source noPart in noParts) {
+          String nodeName = _getNodeName(library, noPart);
+          site.removeNodeByName(context, nodeName);
+          site.removeSource(library);
+          site.removeSource(noPart);
+        }
+      }
+      // remember new parts
+      libraryToUnits[library] = newParts;
+    }
+    // remember library/unit relations
+    _recordUnitInLibrary(context, library, unit);
+    _recordLibraryWithUnit(context, library, unit);
+    site.addSource(library);
+    site.addSource(unit);
+    // prepare node
+    String nodeName = _getNodeName(library, unit);
+    return nodeName;
+  }
+
+  @override
+  void removeContext(AnalysisContext context) {
+    _contextToLibraryToUnits.remove(context);
+    _contextToUnitToLibraries.remove(context);
+  }
+
+  @override
+  void removeSource(AnalysisContext context, Source source) {
+    // remove nodes for unit/library pairs
+    Map<Source, Set<Source>> unitToLibraries =
+        _contextToUnitToLibraries[context];
+    if (unitToLibraries != null) {
+      Set<Source> libraries = unitToLibraries.remove(source);
+      if (libraries != null) {
+        for (Source library in libraries) {
+          String nodeName = _getNodeName(library, source);
+          site.removeNodeByName(context, nodeName);
+          site.removeSource(library);
+          site.removeSource(source);
+        }
+      }
+    }
+    // remove nodes for library/unit pairs
+    Map<Source, Set<Source>> libraryToUnits = _contextToLibraryToUnits[context];
+    if (libraryToUnits != null) {
+      Set<Source> units = libraryToUnits.remove(source);
+      if (units != null) {
+        for (Source unit in units) {
+          String nodeName = _getNodeName(source, unit);
+          site.removeNodeByName(context, nodeName);
+          site.removeSource(source);
+          site.removeSource(unit);
+        }
+      }
+    }
+  }
+
+  @override
+  void removeSources(AnalysisContext context, SourceContainer container) {
+    // remove nodes for unit/library pairs
+    Map<Source, Set<Source>> unitToLibraries =
+        _contextToUnitToLibraries[context];
+    if (unitToLibraries != null) {
+      List<Source> units = unitToLibraries.keys.toList();
+      for (Source source in units) {
+        if (container == null || container.contains(source)) {
+          removeSource(context, source);
+        }
+      }
+    }
+    // remove nodes for library/unit pairs
+    Map<Source, Set<Source>> libraryToUnits = _contextToLibraryToUnits[context];
+    if (libraryToUnits != null) {
+      List<Source> libraries = libraryToUnits.keys.toList();
+      for (Source source in libraries) {
+        if (container == null || container.contains(source)) {
+          removeSource(context, source);
+        }
+      }
+    }
+  }
+
+  String _getNodeName(Source library, Source unit) {
+    String libraryName = library != null ? library.fullName : null;
+    String unitName = unit.fullName;
+    int libraryNameIndex = site.encodeString(libraryName);
+    int unitNameIndex = site.encodeString(unitName);
+    return 'DartUnitElement_${libraryNameIndex}_${unitNameIndex}.index';
+  }
+
+  void _recordLibraryWithUnit(
+      AnalysisContext context, Source library, Source unit) {
+    Map<Source, Set<Source>> libraryToUnits = _contextToLibraryToUnits[context];
+    if (libraryToUnits == null) {
+      libraryToUnits = new HashMap<Source, Set<Source>>();
+      _contextToLibraryToUnits[context] = libraryToUnits;
+    }
+    Set<Source> units = libraryToUnits[library];
+    if (units == null) {
+      units = new HashSet<Source>();
+      libraryToUnits[library] = units;
+    }
+    units.add(unit);
+  }
+
+  void _recordUnitInLibrary(
+      AnalysisContext context, Source library, Source unit) {
+    Map<Source, Set<Source>> unitToLibraries =
+        _contextToUnitToLibraries[context];
+    if (unitToLibraries == null) {
+      unitToLibraries = new HashMap<Source, Set<Source>>();
+      _contextToUnitToLibraries[context] = unitToLibraries;
+    }
+    Set<Source> libraries = unitToLibraries[unit];
+    if (libraries == null) {
+      libraries = new HashSet<Source>();
+      unitToLibraries[unit] = libraries;
+    }
+    libraries.add(library);
+  }
+}
+
+/**
  * A manager for files content.
  */
 abstract class FileManager {
@@ -341,6 +523,36 @@
   }
 }
 
+/**
+ * [SplitIndexStore] uses instances of this class to manager index nodes.
+ */
+abstract class IndexObjectManager {
+  SplitIndexStoreSite site;
+
+  /**
+   * Notifies the manager that the given [object] is to be indexed.
+   * Returns the name of the index node to put information into.
+   */
+  String aboutToIndex(AnalysisContext context, Object object);
+
+  /**
+   * Notifies the manager that the given [context] is disposed.
+   */
+  void removeContext(AnalysisContext context);
+
+  /**
+   * Notifies the manager that the given [source] is no longer part of
+   * the given [context].
+   */
+  void removeSource(AnalysisContext context, Source source);
+
+  /**
+   * Notifies the manager that the sources described by the given [container]
+   * are no longer part of the given [context].
+   */
+  void removeSources(AnalysisContext context, SourceContainer container);
+}
+
 class InspectLocation {
   final String nodeName;
   final RelationshipImpl relationship;
@@ -482,8 +694,10 @@
   RelationKeyData.forData(
       this.elementId1, this.elementId2, this.elementId3, this.relationshipId);
 
-  RelationKeyData.forObject(ElementCodec elementCodec,
-      RelationshipCodec relationshipCodec, IndexableObject indexable,
+  RelationKeyData.forObject(
+      ElementCodec elementCodec,
+      RelationshipCodec relationshipCodec,
+      IndexableObject indexable,
       RelationshipImpl relationship)
       : elementId1 = elementCodec.encode1(indexable),
         elementId2 = elementCodec.encode2(indexable),
@@ -524,9 +738,26 @@
  */
 class SplitIndexStore implements InternalIndexStore {
   /**
+   * The [NodeManager] to get/put [IndexNode]s.
+   */
+  final NodeManager _nodeManager;
+
+  final List<IndexObjectManager> _objectManagers;
+
+  /**
    * The [ContextCodec] to encode/decode [AnalysisContext]s.
    */
-  ContextCodec _contextCodec;
+  final ContextCodec _contextCodec;
+
+  /**
+   * The [ElementCodec] to encode/decode [Element]s.
+   */
+  final ElementCodec _elementCodec;
+
+  /**
+   * The [StringCodec] to encode/decode [String]s.
+   */
+  final StringCodec _stringCodec;
 
   /**
    * Information about top-level elements.
@@ -534,60 +765,35 @@
    *
    * Order of keys: contextId, nodeId.
    */
-  Map<int, Map<int, List<_TopElementData>>> _topDeclarations =
+  final Map<int, Map<int, List<_TopElementData>>> _topDeclarations =
       new Map<int, Map<int, List<_TopElementData>>>();
 
-  /**
-   * The mapping of library [Source] to the [Source]s of part units.
-   */
-  Map<AnalysisContext, Map<Source, Set<Source>>> _contextToLibraryToUnits =
-      new HashMap<AnalysisContext, Map<Source, Set<Source>>>();
-
-  /**
-   * The mapping of unit [Source] to the [Source]s of libraries it is used in.
-   */
-  Map<AnalysisContext, Map<Source, Set<Source>>> _contextToUnitToLibraries =
-      new HashMap<AnalysisContext, Map<Source, Set<Source>>>();
-
-  int _currentContextId = 0;
-
-  IndexNode _currentNode;
-
+  int _currentContextId;
   String _currentNodeName;
-
-  int _currentNodeNameId = 0;
-
-  /**
-   * The [ElementCodec] to encode/decode [Element]s.
-   */
-  ElementCodec _elementCodec;
+  int _currentNodeNameId;
+  IndexNode _currentNode;
 
   /**
    * A table mapping element names to the node names that may have relations with elements with
    * these names.
    */
-  Map<RelationshipImpl, IntToIntSetMap> _relToNameMap =
+  final Map<RelationshipImpl, IntToIntSetMap> _relToNameMap =
       new HashMap<RelationshipImpl, IntToIntSetMap>();
 
   /**
-   * The [NodeManager] to get/put [IndexNode]s.
-   */
-  final NodeManager _nodeManager;
-
-  /**
    * The set of known [Source]s.
    */
-  Set<Source> _sources = new HashSet<Source>();
+  final Set<Source> _sources = new HashSet<Source>();
 
-  /**
-   * The [StringCodec] to encode/decode [String]s.
-   */
-  StringCodec _stringCodec;
-
-  SplitIndexStore(this._nodeManager) {
-    this._contextCodec = _nodeManager.contextCodec;
-    this._elementCodec = _nodeManager.elementCodec;
-    this._stringCodec = _nodeManager.stringCodec;
+  SplitIndexStore(NodeManager _nodeManager, this._objectManagers)
+      : _nodeManager = _nodeManager,
+        _contextCodec = _nodeManager.contextCodec,
+        _elementCodec = _nodeManager.elementCodec,
+        _stringCodec = _nodeManager.stringCodec {
+    SplitIndexStoreSiteImpl site = new SplitIndexStoreSiteImpl(this);
+    for (IndexObjectManager manager in _objectManagers) {
+      manager.site = site;
+    }
   }
 
   @override
@@ -606,64 +812,22 @@
   }
 
   @override
-  bool aboutToIndexDart(
-      AnalysisContext context, CompilationUnitElement unitElement) {
-    // may be already disposed in other thread
-    if (context.isDisposed) {
+  bool aboutToIndex(AnalysisContext context, Object object) {
+    if (context == null || context.isDisposed) {
       return false;
     }
-    // validate unit
-    if (unitElement == null) {
-      return false;
-    }
-    LibraryElement libraryElement = unitElement.library;
-    if (libraryElement == null) {
-      return false;
-    }
-    CompilationUnitElement definingUnitElement =
-        libraryElement.definingCompilationUnit;
-    if (definingUnitElement == null) {
-      return false;
-    }
-    // prepare sources
-    Source library = definingUnitElement.source;
-    Source unit = unitElement.source;
-    // special handling for the defining library unit
-    if (unit == library) {
-      // prepare new parts
-      HashSet<Source> newParts = new HashSet<Source>();
-      for (CompilationUnitElement part in libraryElement.parts) {
-        newParts.add(part.source);
+    // try to find a node name
+    _currentNodeName = null;
+    for (IndexObjectManager manager in _objectManagers) {
+      _currentNodeName = manager.aboutToIndex(context, object);
+      if (_currentNodeName != null) {
+        break;
       }
-      // prepare old parts
-      Map<Source, Set<Source>> libraryToUnits =
-          _contextToLibraryToUnits[context];
-      if (libraryToUnits == null) {
-        libraryToUnits = new HashMap<Source, Set<Source>>();
-        _contextToLibraryToUnits[context] = libraryToUnits;
-      }
-      Set<Source> oldParts = libraryToUnits[library];
-      // check if some parts are not in the library now
-      if (oldParts != null) {
-        Set<Source> noParts = oldParts.difference(newParts);
-        for (Source noPart in noParts) {
-          _removeLocations(context, library, noPart);
-        }
-      }
-      // remember new parts
-      libraryToUnits[library] = newParts;
     }
-    // remember library/unit relations
-    _recordUnitInLibrary(context, library, unit);
-    _recordLibraryWithUnit(context, library, unit);
-    _sources.add(library);
-    _sources.add(unit);
+    if (_currentNodeName == null) {
+      return false;
+    }
     // prepare node
-    String libraryName = library.fullName;
-    String unitName = unit.fullName;
-    int libraryNameIndex = _stringCodec.encode(libraryName);
-    int unitNameIndex = _stringCodec.encode(unitName);
-    _currentNodeName = '${libraryNameIndex}_${unitNameIndex}.index';
     _currentNodeNameId = _stringCodec.encode(_currentNodeName);
     _currentNode = _nodeManager.newNode(context);
     _currentContextId = _contextCodec.encode(context);
@@ -676,27 +840,7 @@
   }
 
   @override
-  bool aboutToIndexHtml(AnalysisContext context, HtmlElement htmlElement) {
-    // may be already disposed in other thread
-    if (context.isDisposed) {
-      return false;
-    }
-    // remove locations
-    Source source = htmlElement.source;
-    _removeLocations(context, null, source);
-    // remember library/unit relations
-    _recordUnitInLibrary(context, null, source);
-    // prepare node
-    String sourceName = source.fullName;
-    int sourceNameIndex = _stringCodec.encode(sourceName);
-    _currentNodeName = '${sourceNameIndex}.index';
-    _currentNodeNameId = _stringCodec.encode(_currentNodeName);
-    _currentNode = _nodeManager.newNode(context);
-    return true;
-  }
-
-  @override
-  void cancelIndexDart() {
+  void cancelIndex() {
     if (_currentNode != null) {
       // remove top-level information for the current node
       for (Map<int, dynamic> nodeRelations in _topDeclarations.values) {
@@ -861,8 +1005,8 @@
       nodeDeclarations[_currentNodeNameId] = declarations;
     }
     // record LocationData
-    declarations
-        .add(new _TopElementData(_elementCodec, new IndexableElement(element)));
+    declarations.add(new _TopElementData(
+        _elementCodec, element.displayName, new IndexableElement(element)));
   }
 
   @override
@@ -873,8 +1017,9 @@
     // remove sources
     removeSources(context, null);
     // remove context information
-    _contextToLibraryToUnits.remove(context);
-    _contextToUnitToLibraries.remove(context);
+    for (IndexObjectManager manager in _objectManagers) {
+      manager.removeContext(context);
+    }
     _topDeclarations.remove(_contextCodec.encode(context));
     // remove context from codec
     _contextCodec.remove(context);
@@ -885,26 +1030,8 @@
     if (context == null) {
       return;
     }
-    // remove nodes for unit/library pairs
-    Map<Source, Set<Source>> unitToLibraries =
-        _contextToUnitToLibraries[context];
-    if (unitToLibraries != null) {
-      Set<Source> libraries = unitToLibraries.remove(source);
-      if (libraries != null) {
-        for (Source library in libraries) {
-          _removeLocations(context, library, source);
-        }
-      }
-    }
-    // remove nodes for library/unit pairs
-    Map<Source, Set<Source>> libraryToUnits = _contextToLibraryToUnits[context];
-    if (libraryToUnits != null) {
-      Set<Source> units = libraryToUnits.remove(source);
-      if (units != null) {
-        for (Source unit in units) {
-          _removeLocations(context, source, unit);
-        }
-      }
+    for (IndexObjectManager manager in _objectManagers) {
+      manager.removeSource(context, source);
     }
   }
 
@@ -913,42 +1040,9 @@
     if (context == null) {
       return;
     }
-    // remove nodes for unit/library pairs
-    Map<Source, Set<Source>> unitToLibraries =
-        _contextToUnitToLibraries[context];
-    if (unitToLibraries != null) {
-      List<Source> units = new List<Source>.from(unitToLibraries.keys);
-      for (Source source in units) {
-        if (container == null || container.contains(source)) {
-          removeSource(context, source);
-        }
-      }
+    for (IndexObjectManager manager in _objectManagers) {
+      manager.removeSources(context, container);
     }
-    // remove nodes for library/unit pairs
-    Map<Source, Set<Source>> libraryToUnits = _contextToLibraryToUnits[context];
-    if (libraryToUnits != null) {
-      List<Source> libraries = new List<Source>.from(libraryToUnits.keys);
-      for (Source source in libraries) {
-        if (container == null || container.contains(source)) {
-          removeSource(context, source);
-        }
-      }
-    }
-  }
-
-  void _recordLibraryWithUnit(
-      AnalysisContext context, Source library, Source unit) {
-    Map<Source, Set<Source>> libraryToUnits = _contextToLibraryToUnits[context];
-    if (libraryToUnits == null) {
-      libraryToUnits = new HashMap<Source, Set<Source>>();
-      _contextToLibraryToUnits[context] = libraryToUnits;
-    }
-    Set<Source> units = libraryToUnits[library];
-    if (units == null) {
-      units = new HashSet<Source>();
-      libraryToUnits[library] = units;
-    }
-    units.add(unit);
   }
 
   void _recordNodeNameForElement(
@@ -962,37 +1056,9 @@
     nameToNodeNames.add(nameId, _currentNodeNameId);
   }
 
-  void _recordUnitInLibrary(
-      AnalysisContext context, Source library, Source unit) {
-    Map<Source, Set<Source>> unitToLibraries =
-        _contextToUnitToLibraries[context];
-    if (unitToLibraries == null) {
-      unitToLibraries = new HashMap<Source, Set<Source>>();
-      _contextToUnitToLibraries[context] = unitToLibraries;
-    }
-    Set<Source> libraries = unitToLibraries[unit];
-    if (libraries == null) {
-      libraries = new HashSet<Source>();
-      unitToLibraries[unit] = libraries;
-    }
-    libraries.add(library);
-  }
-
-  /**
-   * Removes locations recorded in the given library/unit pair.
-   */
-  void _removeLocations(AnalysisContext context, Source library, Source unit) {
-    // remove node
-    String libraryName = library != null ? library.fullName : null;
-    String unitName = unit.fullName;
-    int libraryNameIndex = _stringCodec.encode(libraryName);
-    int unitNameIndex = _stringCodec.encode(unitName);
-    String nodeName = '${libraryNameIndex}_${unitNameIndex}.index';
+  void _removeNodeByName(AnalysisContext context, String nodeName) {
     int nodeNameId = _stringCodec.encode(nodeName);
     _nodeManager.removeNode(nodeName);
-    // remove source
-    _sources.remove(library);
-    _sources.remove(unit);
     // remove top-level relations
     {
       int contextId = _contextCodec.encode(context);
@@ -1004,6 +1070,45 @@
   }
 }
 
+/**
+ * Interface to [SplitIndexStore] for [IndexObjectManager] implementations.
+ */
+abstract class SplitIndexStoreSite {
+  void addSource(Source source);
+  int encodeString(String str);
+  void removeNodeByName(AnalysisContext context, String nodeName);
+  void removeSource(Source source);
+}
+
+/**
+ * The implementaiton of [SplitIndexStoreSite].
+ */
+class SplitIndexStoreSiteImpl implements SplitIndexStoreSite {
+  final SplitIndexStore store;
+
+  SplitIndexStoreSiteImpl(this.store);
+
+  @override
+  void addSource(Source source) {
+    store._sources.add(source);
+  }
+
+  @override
+  int encodeString(String str) {
+    return store._stringCodec.encode(str);
+  }
+
+  @override
+  void removeNodeByName(AnalysisContext context, String nodeName) {
+    store._removeNodeByName(context, nodeName);
+  }
+
+  @override
+  void removeSource(Source source) {
+    store._sources.remove(source);
+  }
+}
+
 class _DataInputStream {
   ByteData _byteData;
   int _byteOffset = 0;
@@ -1049,10 +1154,9 @@
   final int elementId3;
 
   factory _TopElementData(
-      ElementCodec elementCodec, IndexableObject indexable) {
-    return new _TopElementData._(indexable.name,
-        elementCodec.encode1(indexable), elementCodec.encode2(indexable),
-        elementCodec.encode3(indexable));
+      ElementCodec elementCodec, String name, IndexableObject indexable) {
+    return new _TopElementData._(name, elementCodec.encode1(indexable),
+        elementCodec.encode2(indexable), elementCodec.encode3(indexable));
   }
 
   _TopElementData._(
diff --git a/pkg/analysis_server/lib/src/services/linter/linter.dart b/pkg/analysis_server/lib/src/services/linter/linter.dart
new file mode 100644
index 0000000..87692ea
--- /dev/null
+++ b/pkg/analysis_server/lib/src/services/linter/linter.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 services.src.linter;
+
+import 'package:analyzer/plugin/options.dart';
+import 'package:analyzer/analyzer.dart';
+import 'package:yaml/yaml.dart';
+import 'package:linter/src/rules.dart';
+import 'package:linter/src/linter.dart';
+
+/**
+ * An error code indicating an undefined lint rule.
+ *
+ * Parameters:
+ * 0: the rule name
+ */
+const AnalysisOptionsWarningCode UNDEFINED_LINT_WARNING =
+    const AnalysisOptionsWarningCode(
+        'UNDEFINED_LINT_WARNING', "Undefined lint rule '{0}'");
+
+/// Validates `linter` rule configurations.
+class LinterRuleOptionsValidator extends OptionsValidator {
+  static const linter = 'linter';
+  static const rulesKey = 'rules';
+  @override
+  List<AnalysisError> validate(
+      ErrorReporter reporter, Map<String, YamlNode> options) {
+    List<AnalysisError> errors = <AnalysisError>[];
+    var node = options[linter];
+    if (node is YamlMap) {
+      var rules = node.nodes[rulesKey];
+      validateRules(rules, reporter);
+    }
+    return errors;
+  }
+
+  validateRules(dynamic rules, ErrorReporter reporter) {
+    if (rules is YamlList) {
+      //TODO(pq): migrate this to a proper API once there is one.
+      Iterable<String> registeredLints = ruleRegistry.map((r) => r.name);
+      rules.nodes.forEach((YamlNode ruleNode) {
+        if (!registeredLints.contains(ruleNode.value)) {
+          reporter.reportErrorForSpan(
+              UNDEFINED_LINT_WARNING, ruleNode.span, [ruleNode.value]);
+        }
+      });
+    }
+  }
+}
diff --git a/pkg/analysis_server/lib/src/services/refactoring/extract_local.dart b/pkg/analysis_server/lib/src/services/refactoring/extract_local.dart
index 3acc982..6cfd951 100644
--- a/pkg/analysis_server/lib/src/services/refactoring/extract_local.dart
+++ b/pkg/analysis_server/lib/src/services/refactoring/extract_local.dart
@@ -150,9 +150,11 @@
         String declStatement = prefix + indent + declarationSource + eol;
         String exprStatement = prefix + indent + 'return ';
         Expression expr = target.expression;
-        doSourceChange_addElementEdit(change, unitElement, new SourceEdit(
-            target.offset, expr.offset - target.offset,
-            '{' + eol + declStatement + exprStatement));
+        doSourceChange_addElementEdit(
+            change,
+            unitElement,
+            new SourceEdit(target.offset, expr.offset - target.offset,
+                '{' + eol + declStatement + exprStatement));
         doSourceChange_addElementEdit(change, unitElement,
             new SourceEdit(expr.end, 0, ';' + eol + prefix + '}'));
       }
@@ -378,7 +380,8 @@
           stringLiteralPart, excludedVariableNames));
     } else if (singleExpression != null) {
       names.addAll(getVariableNameSuggestionsForExpression(
-          singleExpression.staticType, singleExpression,
+          singleExpression.staticType,
+          singleExpression,
           excludedVariableNames));
     }
   }
diff --git a/pkg/analysis_server/lib/src/services/refactoring/extract_method.dart b/pkg/analysis_server/lib/src/services/refactoring/extract_method.dart
index be9162d..e83082b 100644
--- a/pkg/analysis_server/lib/src/services/refactoring/extract_method.dart
+++ b/pkg/analysis_server/lib/src/services/refactoring/extract_method.dart
@@ -594,7 +594,7 @@
     }
     // maybe ends with "return" statement
     if (_selectionStatements != null) {
-      _ReturnTypeComputer returnTypeComputer = new _ReturnTypeComputer();
+      _ReturnTypeComputer returnTypeComputer = new _ReturnTypeComputer(context);
       _selectionStatements.forEach((statement) {
         statement.accept(returnTypeComputer);
       });
@@ -731,7 +731,8 @@
     names.clear();
     if (_selectionExpression != null) {
       names.addAll(getVariableNameSuggestionsForExpression(
-          _selectionExpression.staticType, _selectionExpression,
+          _selectionExpression.staticType,
+          _selectionExpression,
           _excludedNames));
     }
   }
@@ -817,8 +818,10 @@
   Object visitConstructorInitializer(ConstructorInitializer node) {
     super.visitConstructorInitializer(node);
     if (_isFirstSelectedNode(node)) {
-      invalidSelection('Cannot extract a constructor initializer. '
-          'Select expression part of initializer.', newLocation_fromNode(node));
+      invalidSelection(
+          'Cannot extract a constructor initializer. '
+          'Select expression part of initializer.',
+          newLocation_fromNode(node));
     }
     return null;
   }
@@ -870,8 +873,10 @@
   Object visitVariableDeclaration(VariableDeclaration node) {
     super.visitVariableDeclaration(node);
     if (_isFirstSelectedNode(node)) {
-      invalidSelection('Cannot extract a variable declaration fragment. '
-          'Select whole declaration statement.', newLocation_fromNode(node));
+      invalidSelection(
+          'Cannot extract a variable declaration fragment. '
+          'Select whole declaration statement.',
+          newLocation_fromNode(node));
     }
     return null;
   }
@@ -1153,8 +1158,12 @@
 }
 
 class _ReturnTypeComputer extends RecursiveAstVisitor {
+  final AnalysisContext context;
+
   DartType returnType;
 
+  _ReturnTypeComputer(this.context);
+
   @override
   visitBlockFunctionBody(BlockFunctionBody node) {}
 
@@ -1177,7 +1186,8 @@
       if (returnType is InterfaceType && type is InterfaceType) {
         returnType = InterfaceType.getSmartLeastUpperBound(returnType, type);
       } else {
-        returnType = returnType.getLeastUpperBound(type);
+        returnType = context.typeSystem
+            .getLeastUpperBound(context.typeProvider, returnType, type);
       }
     }
   }
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 35ba073..7c7e6356 100644
--- a/pkg/analysis_server/lib/src/services/refactoring/inline_method.dart
+++ b/pkg/analysis_server/lib/src/services/refactoring/inline_method.dart
@@ -45,13 +45,17 @@
  * Returns the source which should replace given invocation with given
  * arguments.
  */
-String _getMethodSourceForInvocation(RefactoringStatus status, _SourcePart part,
-    CorrectionUtils utils, AstNode contextNode, Expression targetExpression,
+String _getMethodSourceForInvocation(
+    RefactoringStatus status,
+    _SourcePart part,
+    CorrectionUtils utils,
+    AstNode contextNode,
+    Expression targetExpression,
     List<Expression> arguments) {
   // prepare edits to replace parameters with arguments
   List<SourceEdit> edits = <SourceEdit>[];
-  part._parameters.forEach((ParameterElement parameter,
-      List<_ParameterOccurrence> occurrences) {
+  part._parameters.forEach(
+      (ParameterElement parameter, List<_ParameterOccurrence> occurrences) {
     // prepare argument
     Expression argument = null;
     for (Expression arg in arguments) {
diff --git a/pkg/analysis_server/lib/src/services/refactoring/move_file.dart b/pkg/analysis_server/lib/src/services/refactoring/move_file.dart
index 849b9e1..d5663403 100644
--- a/pkg/analysis_server/lib/src/services/refactoring/move_file.dart
+++ b/pkg/analysis_server/lib/src/services/refactoring/move_file.dart
@@ -172,9 +172,11 @@
           if (uri != null) {
             String oldPrefix = 'package:$oldPackageName/';
             if (uri.startsWith(oldPrefix)) {
-              doSourceChange_addElementEdit(change, library, new SourceEdit(
-                  element.uriOffset + 1, oldPrefix.length,
-                  'package:$newPackageName/'));
+              doSourceChange_addElementEdit(
+                  change,
+                  library,
+                  new SourceEdit(element.uriOffset + 1, oldPrefix.length,
+                      'package:$newPackageName/'));
             }
           }
         }
diff --git a/pkg/analysis_server/lib/src/services/refactoring/refactoring.dart b/pkg/analysis_server/lib/src/services/refactoring/refactoring.dart
index 1a29c3e..a4d3c6b 100644
--- a/pkg/analysis_server/lib/src/services/refactoring/refactoring.dart
+++ b/pkg/analysis_server/lib/src/services/refactoring/refactoring.dart
@@ -6,7 +6,7 @@
 
 import 'dart:async';
 
-import 'package:analysis_server/src/protocol.dart'
+import 'package:analysis_server/plugin/protocol/protocol.dart'
     show RefactoringMethodParameter, SourceChange;
 import 'package:analysis_server/src/services/correction/status.dart';
 import 'package:analysis_server/src/services/refactoring/convert_getter_to_method.dart';
@@ -278,8 +278,11 @@
   /**
    * Returns a new [MoveFileRefactoring] instance.
    */
-  factory MoveFileRefactoring(ResourceProvider resourceProvider,
-      SearchEngine searchEngine, AnalysisContext context, Source source,
+  factory MoveFileRefactoring(
+      ResourceProvider resourceProvider,
+      SearchEngine searchEngine,
+      AnalysisContext context,
+      Source source,
       String oldFile) {
     return new MoveFileRefactoringImpl(
         resourceProvider, searchEngine, context, source, oldFile);
@@ -353,6 +356,9 @@
    * type.
    */
   factory RenameRefactoring(SearchEngine searchEngine, Element element) {
+    if (element == null) {
+      return null;
+    }
     if (element is PropertyAccessorElement) {
       element = (element as PropertyAccessorElement).variable;
     }
diff --git a/pkg/analysis_server/lib/src/services/refactoring/rename.dart b/pkg/analysis_server/lib/src/services/refactoring/rename.dart
index 012b7a1..a9bdb74 100644
--- a/pkg/analysis_server/lib/src/services/refactoring/rename.dart
+++ b/pkg/analysis_server/lib/src/services/refactoring/rename.dart
@@ -9,12 +9,15 @@
 import 'package:analysis_server/src/protocol_server.dart' hide Element;
 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/correction/util.dart';
 import 'package:analysis_server/src/services/refactoring/refactoring.dart';
 import 'package:analysis_server/src/services/refactoring/refactoring_internal.dart';
 import 'package:analysis_server/src/services/search/search_engine.dart';
 import 'package:analyzer/src/generated/element.dart';
 import 'package:analyzer/src/generated/engine.dart';
+import 'package:analyzer/src/generated/java_core.dart';
 import 'package:analyzer/src/generated/source.dart';
+import 'package:path/path.dart' as pathos;
 
 /**
  * Returns `true` if two given [Element]s are [LocalElement]s and have
@@ -50,6 +53,18 @@
   return librarySourcesOfSource.contains(librarySourceOfElement);
 }
 
+bool isElementInPubCache(Element element) {
+  Source source = element.source;
+  String path = source.fullName;
+  return isPathInPubCache(path);
+}
+
+bool isElementInSdkOrPubCache(Element element) {
+  Source source = element.source;
+  String path = source.fullName;
+  return source.isInSystemLibrary || isPathInPubCache(path);
+}
+
 /**
  * Checks if the given [Element] is in the given [AnalysisContext].
  */
@@ -57,6 +72,23 @@
   return element.context == context;
 }
 
+bool isPathInPubCache(String path) {
+  List<String> parts = pathos.split(path);
+  if (parts.contains('.pub-cache')) {
+    return true;
+  }
+  for (int i = 0; i < parts.length - 1; i++) {
+    if (parts[i] == 'Pub' && parts[i + 1] == 'Cache') {
+      return true;
+    }
+    if (parts[i] == 'third_party' &&
+        (parts[i + 1] == 'pkg' || parts[i + 1] == 'pkg_tested')) {
+      return true;
+    }
+  }
+  return false;
+}
+
 /**
  * Checks if the given unqualified [SearchMatch] intersects with visibility
  * range of [localElement].
@@ -136,6 +168,20 @@
   @override
   Future<RefactoringStatus> checkInitialConditions() {
     RefactoringStatus result = new RefactoringStatus();
+    if (element.source.isInSystemLibrary) {
+      String message = format(
+          "The {0} '{1}' is defined in the SDK, so cannot be renamed.",
+          getElementKindName(element),
+          getElementQualifiedName(element));
+      result.addFatalError(message);
+    }
+    if (isElementInPubCache(element)) {
+      String message = format(
+          "The {0} '{1}' is defined in a pub package, so cannot be renamed.",
+          getElementKindName(element),
+          getElementQualifiedName(element));
+      result.addFatalError(message);
+    }
     return new Future.value(result);
   }
 
@@ -151,7 +197,8 @@
 
   @override
   Future<SourceChange> createChange() async {
-    change = new SourceChange(refactoringName);
+    String changeName = "$refactoringName '$oldName' to '$newName'";
+    change = new SourceChange(changeName);
     await fillChange();
     return change;
   }
diff --git a/pkg/analysis_server/lib/src/services/refactoring/rename_class_member.dart b/pkg/analysis_server/lib/src/services/refactoring/rename_class_member.dart
index 791f4b8..00fa3b9 100644
--- a/pkg/analysis_server/lib/src/services/refactoring/rename_class_member.dart
+++ b/pkg/analysis_server/lib/src/services/refactoring/rename_class_member.dart
@@ -58,8 +58,8 @@
   }
 
   @override
-  Future<RefactoringStatus> checkInitialConditions() {
-    RefactoringStatus result = new RefactoringStatus();
+  Future<RefactoringStatus> checkInitialConditions() async {
+    RefactoringStatus result = await super.checkInitialConditions();
     if (element is MethodElement && (element as MethodElement).isOperator) {
       result.addFatalError('Cannot rename operator.');
     }
@@ -100,6 +100,11 @@
       if (reference.isResolved) {
         continue;
       }
+      // ignore references from SDK and pub cache
+      if (isElementInSdkOrPubCache(reference.element)) {
+        print('ignore: $reference');
+        continue;
+      }
       // check the element being renamed is accessible
       {
         LibraryElement whereLibrary = reference.element.library;
@@ -152,16 +157,42 @@
   Future<RefactoringStatus> validate() async {
     // check if there is a member with "newName" in the same ClassElement
     for (Element newNameMember in getChildren(elementClass, name)) {
-      result.addError(format(
-          "Class '{0}' already declares {1} with name '{2}'.",
-          elementClass.displayName, getElementKindName(newNameMember),
-          name), newLocation_fromElement(newNameMember));
+      result.addError(
+          format(
+              "Class '{0}' already declares {1} with name '{2}'.",
+              elementClass.displayName,
+              getElementKindName(newNameMember),
+              name),
+          newLocation_fromElement(newNameMember));
     }
     // do chained computations
     Set<ClassElement> superClasses = getSuperClasses(elementClass);
     await _prepareReferences();
     Set<ClassElement> subClasses =
         await getSubClasses(searchEngine, elementClass);
+    // check shadowing of class names
+    if (element != null) {
+      for (Element element in elements) {
+        ClassElement clazz = element.enclosingElement;
+        if (clazz.name == name) {
+          result.addError(
+              format(
+                  "Renamed {0} has the same name as the declaring class '{1}'.",
+                  elementKind.displayName,
+                  name),
+              newLocation_fromElement(element));
+        }
+      }
+    } else {
+      if (elementClass.name == name) {
+        result.addError(
+            format(
+                "Created {0} has the same name as the declaring class '{1}'.",
+                elementKind.displayName,
+                name),
+            newLocation_fromElement(elementClass));
+      }
+    }
     // check shadowing in hierarchy
     List<SearchMatch> declarations =
         await searchEngine.searchElementDeclarations(name);
@@ -170,17 +201,23 @@
       Element nameClass = nameElement.enclosingElement;
       // renamed Element shadows member of superclass
       if (superClasses.contains(nameClass)) {
-        result.addError(format(isRename
+        result.addError(
+            format(
+                isRename
                     ? "Renamed {0} will shadow {1} '{2}'."
                     : "Created {0} will shadow {1} '{2}'.",
-                elementKind.displayName, getElementKindName(nameElement),
+                elementKind.displayName,
+                getElementKindName(nameElement),
                 getElementQualifiedName(nameElement)),
             newLocation_fromElement(nameElement));
       }
       // renamed Element is shadowed by member of subclass
       if (isRename && subClasses.contains(nameClass)) {
-        result.addError(format("Renamed {0} will be shadowed by {1} '{2}'.",
-                elementKind.displayName, getElementKindName(nameElement),
+        result.addError(
+            format(
+                "Renamed {0} will be shadowed by {1} '{2}'.",
+                elementKind.displayName,
+                getElementKindName(nameElement),
                 getElementQualifiedName(nameElement)),
             newLocation_fromElement(nameElement));
       }
@@ -193,10 +230,13 @@
             subClasses.contains(enclosingClass)) {
           for (SearchMatch reference in references) {
             if (isReferenceInLocalRange(localElement, reference)) {
-              result.addError(format(
-                  "Usage of renamed {0} will be shadowed by {1} '{2}'.",
-                  elementKind.displayName, getElementKindName(localElement),
-                  localElement.displayName), newLocation_fromMatch(reference));
+              result.addError(
+                  format(
+                      "Usage of renamed {0} will be shadowed by {1} '{2}'.",
+                      elementKind.displayName,
+                      getElementKindName(localElement),
+                      localElement.displayName),
+                  newLocation_fromMatch(reference));
             }
           }
         }
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 636c8bb..d5c489a 100644
--- a/pkg/analysis_server/lib/src/services/refactoring/rename_constructor.dart
+++ b/pkg/analysis_server/lib/src/services/refactoring/rename_constructor.dart
@@ -72,7 +72,9 @@
     for (Element newNameMember in getChildren(parentClass, newName)) {
       String message = format(
           "Class '{0}' already declares {1} with name '{2}'.",
-          parentClass.displayName, getElementKindName(newNameMember), newName);
+          parentClass.displayName,
+          getElementKindName(newNameMember),
+          newName);
       result.addError(message, newLocation_fromElement(newNameMember));
     }
   }
diff --git a/pkg/analysis_server/lib/src/services/refactoring/rename_import.dart b/pkg/analysis_server/lib/src/services/refactoring/rename_import.dart
index 608eb73..4dcd752 100644
--- a/pkg/analysis_server/lib/src/services/refactoring/rename_import.dart
+++ b/pkg/analysis_server/lib/src/services/refactoring/rename_import.dart
@@ -54,7 +54,7 @@
       SourceEdit edit = null;
       if (newName.isEmpty) {
         int uriEnd = element.uriEnd;
-        int prefixEnd = element.prefixOffset + prefix.displayName.length;
+        int prefixEnd = element.prefixOffset + prefix.nameLength;
         SourceRange range = rangeStartEnd(uriEnd, prefixEnd);
         edit = newSourceEdit_range(range, "");
       } else {
@@ -63,7 +63,7 @@
           edit = newSourceEdit_range(range, " as ${newName}");
         } else {
           int offset = element.prefixOffset;
-          int length = prefix.displayName.length;
+          int length = prefix.nameLength;
           SourceRange range = rangeStartLength(offset, length);
           edit = newSourceEdit_range(range, newName);
         }
@@ -82,8 +82,11 @@
         SimpleIdentifier interpolationIdentifier =
             _getInterpolationIdentifier(reference);
         if (interpolationIdentifier != null) {
-          doSourceChange_addElementEdit(change, reference.element,
-              new SourceEdit(interpolationIdentifier.offset,
+          doSourceChange_addElementEdit(
+              change,
+              reference.element,
+              new SourceEdit(
+                  interpolationIdentifier.offset,
                   interpolationIdentifier.length,
                   '{$newName.${interpolationIdentifier.name}}'));
         } else {
diff --git a/pkg/analysis_server/lib/src/services/refactoring/rename_library.dart b/pkg/analysis_server/lib/src/services/refactoring/rename_library.dart
index 56b6c74..54b6948 100644
--- a/pkg/analysis_server/lib/src/services/refactoring/rename_library.dart
+++ b/pkg/analysis_server/lib/src/services/refactoring/rename_library.dart
@@ -6,7 +6,7 @@
 
 import 'dart:async';
 
-import 'package:analysis_server/src/protocol.dart';
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/services/correction/status.dart';
 import 'package:analysis_server/src/services/refactoring/naming_conventions.dart';
 import 'package:analysis_server/src/services/refactoring/refactoring.dart';
diff --git a/pkg/analysis_server/lib/src/services/refactoring/rename_unit_member.dart b/pkg/analysis_server/lib/src/services/refactoring/rename_unit_member.dart
index 2d2f797..8ab7de3 100644
--- a/pkg/analysis_server/lib/src/services/refactoring/rename_unit_member.dart
+++ b/pkg/analysis_server/lib/src/services/refactoring/rename_unit_member.dart
@@ -198,7 +198,8 @@
           if (hasDisplayName(shadow, name)) {
             String message = format(
                 "Reference to renamed {0} will be shadowed by {1} '{2}'.",
-                getElementKindName(element), getElementKindName(shadow),
+                getElementKindName(element),
+                getElementKindName(shadow),
                 getElementQualifiedName(shadow));
             result.addError(message, newLocation_fromElement(shadow));
           }
@@ -249,10 +250,13 @@
           continue;
         }
         // OK, reference will be shadowed be the element being renamed
-        String message = format(isRename
+        String message = format(
+            isRename
                 ? "Renamed {0} will shadow {1} '{2}'."
-                : "Created {0} will shadow {1} '{2}'.", elementKind.displayName,
-            getElementKindName(member), getElementQualifiedName(member));
+                : "Created {0} will shadow {1} '{2}'.",
+            elementKind.displayName,
+            getElementKindName(member),
+            getElementQualifiedName(member));
         result.addError(message, newLocation_fromMatch(memberReference));
       }
     }
diff --git a/pkg/analysis_server/lib/src/services/search/hierarchy.dart b/pkg/analysis_server/lib/src/services/search/hierarchy.dart
index 0f8d76ce..496a4c0 100644
--- a/pkg/analysis_server/lib/src/services/search/hierarchy.dart
+++ b/pkg/analysis_server/lib/src/services/search/hierarchy.dart
@@ -132,27 +132,14 @@
  */
 Future<Set<ClassElement>> getSubClasses(
     SearchEngine searchEngine, ClassElement seed) {
-  Set<ClassElement> subs = new HashSet<ClassElement>();
-  // prepare queue
-  List<ClassElement> queue = new List<ClassElement>();
-  queue.add(seed);
-  // schedule subclasss search
-  addSubClasses() {
-    // add direct subclasses of the next class
-    while (queue.isNotEmpty) {
-      ClassElement clazz = queue.removeLast();
-      if (subs.add(clazz)) {
-        return getDirectSubClasses(searchEngine, clazz).then((directSubs) {
-          queue.addAll(directSubs);
-          return new Future(addSubClasses);
-        });
-      }
+  return searchEngine.searchAllSubtypes(seed).then((List<SearchMatch> matches) {
+    Set<ClassElement> ancestors = new HashSet<ClassElement>();
+    for (SearchMatch match in matches) {
+      ClassElement ancestor = match.element;
+      ancestors.add(ancestor);
     }
-    // done
-    subs.remove(seed);
-    return subs;
-  }
-  return new Future(addSubClasses);
+    return ancestors;
+  });
 }
 
 /**
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 e754d9f..4e294bd 100644
--- a/pkg/analysis_server/lib/src/services/search/search_engine.dart
+++ b/pkg/analysis_server/lib/src/services/search/search_engine.dart
@@ -68,6 +68,13 @@
  */
 abstract class SearchEngine {
   /**
+   * Returns all subtypes of the given [type].
+   *
+   * [type] - the [ClassElement] being subtyped by the found matches.
+   */
+  Future<List<SearchMatch>> searchAllSubtypes(ClassElement type);
+
+  /**
    * Returns declarations of elements with the given name.
    *
    * [name] - the name being declared by the found matches.
@@ -97,9 +104,9 @@
   Future<List<SearchMatch>> searchReferences(Element element);
 
   /**
-   * Returns subtypes of the given [type].
+   * Returns direct subtypes of the given [type].
    *
-   * [type] - the [ClassElemnet] being subtyped by the found matches.
+   * [type] - the [ClassElement] being subtyped by the found matches.
    */
   Future<List<SearchMatch>> searchSubtypes(ClassElement type);
 
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 be37a96..cfe43eb 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
@@ -6,7 +6,7 @@
 
 import 'dart:async';
 
-import 'package:analysis_server/analysis/index/index_core.dart';
+import 'package:analysis_server/plugin/index/index_core.dart';
 import 'package:analysis_server/src/services/correction/source_range.dart';
 import 'package:analysis_server/src/services/index/index.dart';
 import 'package:analysis_server/src/services/index/indexable_element.dart';
@@ -23,11 +23,19 @@
   SearchEngineImpl(this._index);
 
   @override
-  Future<List<SearchMatch>> searchElementDeclarations(String name) {
-    NameElement element = new NameElement(name);
+  Future<List<SearchMatch>> searchAllSubtypes(ClassElement type) {
     _Requestor requestor = new _Requestor(_index);
-    requestor.add(
-        element, IndexConstants.NAME_IS_DEFINED_BY, MatchKind.DECLARATION);
+    requestor.addElement(
+        type, IndexConstants.HAS_ANCESTOR, MatchKind.DECLARATION);
+    return requestor.merge();
+  }
+
+  @override
+  Future<List<SearchMatch>> searchElementDeclarations(String name) {
+    IndexableName indexableName = new IndexableName(name);
+    _Requestor requestor = new _Requestor(_index);
+    requestor.add(indexableName, IndexConstants.NAME_IS_DEFINED_BY,
+        MatchKind.DECLARATION);
     return requestor.merge();
   }
 
@@ -42,13 +50,14 @@
 
   @override
   Future<List<SearchMatch>> searchMemberReferences(String name) {
-    NameElement element = new NameElement(name);
+    IndexableName indexableName = new IndexableName(name);
     _Requestor requestor = new _Requestor(_index);
-    requestor.add(element, IndexConstants.IS_INVOKED_BY, MatchKind.INVOCATION);
-    requestor.add(element, IndexConstants.IS_READ_BY, MatchKind.READ);
     requestor.add(
-        element, IndexConstants.IS_READ_WRITTEN_BY, MatchKind.READ_WRITE);
-    requestor.add(element, IndexConstants.IS_WRITTEN_BY, MatchKind.WRITE);
+        indexableName, IndexConstants.IS_INVOKED_BY, MatchKind.INVOCATION);
+    requestor.add(indexableName, IndexConstants.IS_READ_BY, MatchKind.READ);
+    requestor.add(
+        indexableName, IndexConstants.IS_READ_WRITTEN_BY, MatchKind.READ_WRITE);
+    requestor.add(indexableName, IndexConstants.IS_WRITTEN_BY, MatchKind.WRITE);
     return requestor.merge();
   }
 
@@ -93,9 +102,12 @@
   @override
   Future<List<SearchMatch>> searchSubtypes(ClassElement type) {
     _Requestor requestor = new _Requestor(_index);
-    requestor.add(type, IndexConstants.IS_EXTENDED_BY, MatchKind.REFERENCE);
-    requestor.add(type, IndexConstants.IS_MIXED_IN_BY, MatchKind.REFERENCE);
-    requestor.add(type, IndexConstants.IS_IMPLEMENTED_BY, MatchKind.REFERENCE);
+    requestor.addElement(
+        type, IndexConstants.IS_EXTENDED_BY, MatchKind.REFERENCE);
+    requestor.addElement(
+        type, IndexConstants.IS_MIXED_IN_BY, MatchKind.REFERENCE);
+    requestor.addElement(
+        type, IndexConstants.IS_IMPLEMENTED_BY, MatchKind.REFERENCE);
     return requestor.merge();
   }
 
@@ -114,7 +126,7 @@
 
   Future<List<SearchMatch>> _searchReferences(Element element) {
     _Requestor requestor = new _Requestor(_index);
-    requestor.add(
+    requestor.addElement(
         element, IndexConstants.IS_REFERENCED_BY, MatchKind.REFERENCE);
     return requestor.merge();
   }
@@ -122,7 +134,7 @@
   Future<List<SearchMatch>> _searchReferences_Constructor(
       ConstructorElement constructor) {
     _Requestor requestor = new _Requestor(_index);
-    requestor.add(
+    requestor.addElement(
         constructor, IndexConstants.IS_REFERENCED_BY, MatchKind.REFERENCE);
     return requestor.merge();
   }
@@ -133,16 +145,20 @@
     PropertyAccessorElement setter = field.setter;
     _Requestor requestor = new _Requestor(_index);
     // field itself
-    requestor.add(field, IndexConstants.IS_REFERENCED_BY, MatchKind.REFERENCE);
-    requestor.add(field, IndexConstants.IS_WRITTEN_BY, MatchKind.WRITE);
+    requestor.addElement(
+        field, IndexConstants.IS_REFERENCED_BY, MatchKind.REFERENCE);
+    requestor.addElement(field, IndexConstants.IS_WRITTEN_BY, MatchKind.WRITE);
     // getter
     if (getter != null) {
-      requestor.add(getter, IndexConstants.IS_REFERENCED_BY, MatchKind.READ);
-      requestor.add(getter, IndexConstants.IS_INVOKED_BY, MatchKind.INVOCATION);
+      requestor.addElement(
+          getter, IndexConstants.IS_REFERENCED_BY, MatchKind.READ);
+      requestor.addElement(
+          getter, IndexConstants.IS_INVOKED_BY, MatchKind.INVOCATION);
     }
     // setter
     if (setter != null) {
-      requestor.add(setter, IndexConstants.IS_REFERENCED_BY, MatchKind.WRITE);
+      requestor.addElement(
+          setter, IndexConstants.IS_REFERENCED_BY, MatchKind.WRITE);
     }
     // done
     return requestor.merge();
@@ -151,20 +167,23 @@
   Future<List<SearchMatch>> _searchReferences_Function(
       FunctionElement function) {
     _Requestor requestor = new _Requestor(_index);
-    requestor.add(
+    requestor.addElement(
         function, IndexConstants.IS_REFERENCED_BY, MatchKind.REFERENCE);
-    requestor.add(function, IndexConstants.IS_INVOKED_BY, MatchKind.INVOCATION);
+    requestor.addElement(
+        function, IndexConstants.IS_INVOKED_BY, MatchKind.INVOCATION);
     return requestor.merge();
   }
 
   Future<List<SearchMatch>> _searchReferences_LocalVariable(
       LocalVariableElement variable) {
     _Requestor requestor = new _Requestor(_index);
-    requestor.add(variable, IndexConstants.IS_READ_BY, MatchKind.READ);
-    requestor.add(
+    requestor.addElement(variable, IndexConstants.IS_READ_BY, MatchKind.READ);
+    requestor.addElement(
         variable, IndexConstants.IS_READ_WRITTEN_BY, MatchKind.READ_WRITE);
-    requestor.add(variable, IndexConstants.IS_WRITTEN_BY, MatchKind.WRITE);
-    requestor.add(variable, IndexConstants.IS_INVOKED_BY, MatchKind.INVOCATION);
+    requestor.addElement(
+        variable, IndexConstants.IS_WRITTEN_BY, MatchKind.WRITE);
+    requestor.addElement(
+        variable, IndexConstants.IS_INVOKED_BY, MatchKind.INVOCATION);
     return requestor.merge();
   }
 
@@ -173,21 +192,24 @@
     if (method is MethodMember) {
       method = (method as MethodMember).baseElement;
     }
-    requestor.add(method, IndexConstants.IS_REFERENCED_BY, MatchKind.REFERENCE);
-    requestor.add(method, IndexConstants.IS_INVOKED_BY, MatchKind.INVOCATION);
+    requestor.addElement(
+        method, IndexConstants.IS_REFERENCED_BY, MatchKind.REFERENCE);
+    requestor.addElement(
+        method, IndexConstants.IS_INVOKED_BY, MatchKind.INVOCATION);
     return requestor.merge();
   }
 
   Future<List<SearchMatch>> _searchReferences_Parameter(
       ParameterElement parameter) {
     _Requestor requestor = new _Requestor(_index);
-    requestor.add(parameter, IndexConstants.IS_READ_BY, MatchKind.READ);
-    requestor.add(
+    requestor.addElement(parameter, IndexConstants.IS_READ_BY, MatchKind.READ);
+    requestor.addElement(
         parameter, IndexConstants.IS_READ_WRITTEN_BY, MatchKind.READ_WRITE);
-    requestor.add(parameter, IndexConstants.IS_WRITTEN_BY, MatchKind.WRITE);
-    requestor.add(
+    requestor.addElement(
+        parameter, IndexConstants.IS_WRITTEN_BY, MatchKind.WRITE);
+    requestor.addElement(
         parameter, IndexConstants.IS_REFERENCED_BY, MatchKind.REFERENCE);
-    requestor.add(
+    requestor.addElement(
         parameter, IndexConstants.IS_INVOKED_BY, MatchKind.INVOCATION);
     return requestor.merge();
   }
@@ -199,17 +221,20 @@
 
   _Requestor(this.index);
 
-  void add(Element element, RelationshipImpl relationship, MatchKind kind) {
-    Future relationsFuture =
-        index.getRelationships(new IndexableElement(element), relationship);
+  void add(IndexableObject indexable, RelationshipImpl relationship,
+      MatchKind kind) {
+    Future relationsFuture = index.getRelationships(indexable, relationship);
     Future matchesFuture = relationsFuture.then((List<LocationImpl> locations) {
       List<SearchMatch> matches = <SearchMatch>[];
       for (LocationImpl location in locations) {
         IndexableObject indexable = location.indexable;
         if (indexable is IndexableElement) {
-          matches.add(new SearchMatch(kind, indexable.element,
+          matches.add(new SearchMatch(
+              kind,
+              indexable.element,
               new SourceRange(location.offset, location.length),
-              location.isResolved, location.isQualified));
+              location.isResolved,
+              location.isQualified));
         }
       }
       return matches;
@@ -217,6 +242,12 @@
     futures.add(matchesFuture);
   }
 
+  void addElement(
+      Element element, RelationshipImpl relationship, MatchKind kind) {
+    IndexableElement indexable = new IndexableElement(element);
+    add(indexable, relationship, kind);
+  }
+
   Future<List<SearchMatch>> merge() {
     return Future.wait(futures).then((List<List<SearchMatch>> matchesList) {
       return matchesList.expand((matches) => matches).toList();
diff --git a/pkg/analysis_server/lib/src/socket_server.dart b/pkg/analysis_server/lib/src/socket_server.dart
index d5abd12..f3e1c5c 100644
--- a/pkg/analysis_server/lib/src/socket_server.dart
+++ b/pkg/analysis_server/lib/src/socket_server.dart
@@ -4,14 +4,13 @@
 
 library socket.server;
 
+import 'package:analysis_server/plugin/analysis/resolver_provider.dart';
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/analysis_server.dart';
 import 'package:analysis_server/src/channel/channel.dart';
-import 'package:analysis_server/src/context_manager.dart';
 import 'package:analysis_server/src/plugin/server_plugin.dart';
-import 'package:analysis_server/src/protocol.dart';
 import 'package:analysis_server/src/services/index/index.dart';
 import 'package:analysis_server/src/services/index/local_file_index.dart';
-import 'package:analysis_server/uri/resolver_provider.dart';
 import 'package:analyzer/file_system/physical_file_system.dart';
 import 'package:analyzer/instrumentation/instrumentation.dart';
 import 'package:analyzer/source/pub_package_map_provider.dart';
@@ -29,7 +28,6 @@
   final DirectoryBasedDartSdk defaultSdk;
   final InstrumentationService instrumentationService;
   final ServerPlugin serverPlugin;
-  final ContextManager contextManager;
   final ResolverProvider packageResolverProvider;
 
   /**
@@ -43,8 +41,11 @@
    */
   List<Plugin> userDefinedPlugins;
 
-  SocketServer(this.analysisServerOptions, this.defaultSdk,
-      this.instrumentationService, this.serverPlugin, this.contextManager,
+  SocketServer(
+      this.analysisServerOptions,
+      this.defaultSdk,
+      this.instrumentationService,
+      this.serverPlugin,
       this.packageResolverProvider);
 
   /**
@@ -80,10 +81,15 @@
       index.run();
     }
 
-    analysisServer = new AnalysisServer(serverChannel, resourceProvider,
-        new PubPackageMapProvider(resourceProvider, defaultSdk), index,
-        serverPlugin, analysisServerOptions, defaultSdk, instrumentationService,
-        contextManager: contextManager,
+    analysisServer = new AnalysisServer(
+        serverChannel,
+        resourceProvider,
+        new PubPackageMapProvider(resourceProvider, defaultSdk),
+        index,
+        serverPlugin,
+        analysisServerOptions,
+        defaultSdk,
+        instrumentationService,
         packageResolverProvider: packageResolverProvider,
         rethrowExceptions: false);
     analysisServer.userDefinedPlugins = userDefinedPlugins;
diff --git a/pkg/analysis_server/lib/src/status/get_handler.dart b/pkg/analysis_server/lib/src/status/get_handler.dart
index 5b5236c..a83d95e 100644
--- a/pkg/analysis_server/lib/src/status/get_handler.dart
+++ b/pkg/analysis_server/lib/src/status/get_handler.dart
@@ -10,13 +10,13 @@
 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_execution.dart';
 import 'package:analysis_server/src/operation/operation.dart';
 import 'package:analysis_server/src/operation/operation_analysis.dart';
 import 'package:analysis_server/src/operation/operation_queue.dart';
-import 'package:analysis_server/src/protocol.dart' hide Element;
 import 'package:analysis_server/src/services/index/index.dart';
 import 'package:analysis_server/src/services/index/local_index.dart';
 import 'package:analysis_server/src/services/index/store/split_store.dart';
@@ -25,16 +25,23 @@
 import 'package:analysis_server/src/status/element_writer.dart';
 import 'package:analyzer/file_system/file_system.dart';
 import 'package:analyzer/src/context/cache.dart';
+import 'package:analyzer/src/context/context.dart' show AnalysisContextImpl;
 import 'package:analyzer/src/generated/ast.dart';
 import 'package:analyzer/src/generated/element.dart';
 import 'package:analyzer/src/generated/engine.dart'
-    hide AnalysisContextImpl, AnalysisTask;
+    hide AnalysisCache, AnalysisContextImpl, AnalysisTask;
 import 'package:analyzer/src/generated/java_engine.dart';
+import 'package:analyzer/src/generated/resolver.dart';
 import 'package:analyzer/src/generated/source.dart';
 import 'package:analyzer/src/generated/utilities_collection.dart';
 import 'package:analyzer/src/generated/utilities_general.dart';
 import 'package:analyzer/src/task/dart.dart';
+import 'package:analyzer/src/task/driver.dart';
+import 'package:analyzer/src/task/html.dart';
+import 'package:analyzer/src/task/options.dart';
 import 'package:analyzer/task/dart.dart';
+import 'package:analyzer/task/general.dart';
+import 'package:analyzer/task/html.dart';
 import 'package:analyzer/task/model.dart';
 import 'package:plugin/plugin.dart';
 
@@ -179,8 +186,8 @@
     if (analysisServer == null) {
       return null;
     }
-    return analysisServer.handlers.firstWhere(
-        (h) => h is CompletionDomainHandler, orElse: () => null);
+    return analysisServer.handlers
+        .firstWhere((h) => h is CompletionDomainHandler, orElse: () => null);
   }
 
   /**
@@ -223,7 +230,8 @@
    */
   Folder _findFolder(AnalysisServer analysisServer, String contextFilter) {
     return analysisServer.folderMap.keys.firstWhere(
-        (Folder folder) => folder.path == contextFilter, orElse: () => null);
+        (Folder folder) => folder.path == contextFilter,
+        orElse: () => null);
   }
 
   /**
@@ -254,10 +262,114 @@
     if (unit != null) {
       return unit;
     }
+    unit = entry.getValue(RESOLVED_UNIT6);
+    if (unit != null) {
+      return unit;
+    }
+    unit = entry.getValue(RESOLVED_UNIT7);
+    if (unit != null) {
+      return unit;
+    }
+    unit = entry.getValue(RESOLVED_UNIT8);
+    if (unit != null) {
+      return unit;
+    }
+    unit = entry.getValue(RESOLVED_UNIT9);
+    if (unit != null) {
+      return unit;
+    }
+    unit = entry.getValue(RESOLVED_UNIT10);
+    if (unit != null) {
+      return unit;
+    }
     return entry.getValue(RESOLVED_UNIT);
   }
 
   /**
+   * Return a list of the result descriptors whose state should be displayed for
+   * the given cache [entry].
+   */
+  List<ResultDescriptor> _getExpectedResults(CacheEntry entry) {
+    AnalysisTarget target = entry.target;
+    Set<ResultDescriptor> results = entry.nonInvalidResults.toSet();
+    if (target is Source) {
+      String name = target.shortName;
+      results.add(CONTENT);
+      results.add(LINE_INFO);
+      results.add(MODIFICATION_TIME);
+      if (AnalysisEngine.isDartFileName(name)) {
+        results.add(BUILD_DIRECTIVES_ERRORS);
+        results.add(BUILD_LIBRARY_ERRORS);
+        results.add(CONTAINING_LIBRARIES);
+        results.add(DART_ERRORS);
+        results.add(EXPLICITLY_IMPORTED_LIBRARIES);
+        results.add(EXPORT_SOURCE_CLOSURE);
+        results.add(EXPORTED_LIBRARIES);
+        results.add(IMPORTED_LIBRARIES);
+        results.add(INCLUDED_PARTS);
+        results.add(IS_LAUNCHABLE);
+        results.add(LIBRARY_ELEMENT1);
+        results.add(LIBRARY_ELEMENT2);
+        results.add(LIBRARY_ELEMENT3);
+        results.add(LIBRARY_ELEMENT4);
+        results.add(LIBRARY_ELEMENT5);
+        results.add(LIBRARY_ELEMENT);
+        results.add(LIBRARY_ERRORS_READY);
+        results.add(PARSE_ERRORS);
+        results.add(PARSED_UNIT);
+        results.add(REFERENCED_NAMES);
+        results.add(SCAN_ERRORS);
+        results.add(SOURCE_KIND);
+        results.add(TOKEN_STREAM);
+        results.add(UNITS);
+      } else if (AnalysisEngine.isHtmlFileName(name)) {
+        results.add(DART_SCRIPTS);
+        results.add(HTML_DOCUMENT);
+        results.add(HTML_DOCUMENT_ERRORS);
+        results.add(HTML_ERRORS);
+        results.add(REFERENCED_LIBRARIES);
+      } else if (AnalysisEngine.isAnalysisOptionsFileName(name)) {
+        results.add(ANALYSIS_OPTIONS_ERRORS);
+      }
+    } else if (target is LibrarySpecificUnit) {
+      results.add(COMPILATION_UNIT_CONSTANTS);
+      results.add(COMPILATION_UNIT_ELEMENT);
+      results.add(HINTS);
+      results.add(LINTS);
+      results.add(INFERABLE_STATIC_VARIABLES_IN_UNIT);
+      results.add(LIBRARY_UNIT_ERRORS);
+      results.add(RESOLVE_TYPE_NAMES_ERRORS);
+      results.add(RESOLVE_UNIT_ERRORS);
+      results.add(RESOLVED_UNIT1);
+      results.add(RESOLVED_UNIT2);
+      results.add(RESOLVED_UNIT3);
+      results.add(RESOLVED_UNIT4);
+      results.add(RESOLVED_UNIT5);
+      results.add(RESOLVED_UNIT6);
+      results.add(RESOLVED_UNIT7);
+      results.add(RESOLVED_UNIT8);
+      results.add(RESOLVED_UNIT9);
+      results.add(RESOLVED_UNIT10);
+      results.add(RESOLVED_UNIT);
+      results.add(STRONG_MODE_ERRORS);
+      results.add(USED_IMPORTED_ELEMENTS);
+      results.add(USED_LOCAL_ELEMENTS);
+      results.add(VARIABLE_REFERENCE_ERRORS);
+      results.add(VERIFY_ERRORS);
+    } else if (target is ConstantEvaluationTarget) {
+      results.add(CONSTANT_DEPENDENCIES);
+      results.add(CONSTANT_VALUE);
+      if (target is VariableElement) {
+        results.add(INFERABLE_STATIC_VARIABLE_DEPENDENCIES);
+        results.add(INFERRED_STATIC_VARIABLE);
+      }
+    } else if (target is AnalysisContextTarget) {
+      results.add(TYPE_PROVIDER);
+    }
+    return results.toList();
+  }
+
+  /**
    * Return `true` if the given analysis [context] has at least one entry with
    * an exception.
    */
@@ -265,7 +377,8 @@
     MapIterator<AnalysisTarget, CacheEntry> iterator =
         context.analysisCache.iterator();
     while (iterator.moveNext()) {
-      if (iterator.value.exception != null) {
+      CacheEntry entry = iterator.value;
+      if (entry == null || entry.exception != null) {
         return true;
       }
     }
@@ -298,68 +411,197 @@
       _writePage(buffer, 'Analysis Server - Analysis Performance', [],
           (StringBuffer buffer) {
         buffer.write('<h3>Analysis Performance</h3>');
-        //
-        // 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>');
-        //
-        // Write task model timing information.
-        //
-        buffer.write('<p><b>Task performace 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;
+        _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]);
           }
-          int taskTime = stopwatchMap[taskClass].elapsedMilliseconds;
-          totalTaskTime += taskTime;
-          _writeRow(buffer, [
-            taskClass.toString(),
-            count,
-            taskTime,
-            count <= 0 ? '-' : (taskTime / count).toStringAsFixed(3)
-          ], classes: [null, "right", "right", "right"]);
+          tags.forEach(writeRow);
+          buffer.write('</table>');
+          //
+          // Write target counts.
+          //
+          void incrementCount(Map<String, int> counts, String key) {
+            int count = counts[key];
+            if (count == null) {
+              count = 1;
+            } else {
+              count++;
+            }
+            counts[key] = count;
+          }
+          Set<AnalysisTarget> countedTargets = new HashSet<AnalysisTarget>();
+          Map<String, int> sourceTypeCounts = new HashMap<String, int>();
+          Map<String, int> typeCounts = new HashMap<String, int>();
+          analysisServer.folderMap
+              .forEach((Folder folder, InternalAnalysisContext context) {
+            AnalysisCache cache = context.analysisCache;
+            MapIterator<AnalysisTarget, CacheEntry> iterator = cache.iterator();
+            while (iterator.moveNext()) {
+              AnalysisTarget target = iterator.key;
+              if (countedTargets.add(target)) {
+                if (target is Source) {
+                  String name = target.fullName;
+                  String sourceName;
+                  if (AnalysisEngine.isDartFileName(name)) {
+                    if (iterator.value.explicitlyAdded) {
+                      sourceName = 'Dart file (explicit)';
+                    } else {
+                      sourceName = 'Dart file (implicit)';
+                    }
+                  } else if (AnalysisEngine.isHtmlFileName(name)) {
+                    if (iterator.value.explicitlyAdded) {
+                      sourceName = 'Html file (explicit)';
+                    } else {
+                      sourceName = 'Html file (implicit)';
+                    }
+                  } else {
+                    if (iterator.value.explicitlyAdded) {
+                      sourceName = 'Unknown file (explicit)';
+                    } else {
+                      sourceName = 'Unknown file (implicit)';
+                    }
+                  }
+                  incrementCount(sourceTypeCounts, sourceName);
+                } else if (target is ConstantEvaluationTarget) {
+                  incrementCount(typeCounts, 'ConstantEvaluationTarget');
+                } else {
+                  String typeName = target.runtimeType.toString();
+                  incrementCount(typeCounts, typeName);
+                }
+              }
+            }
+          });
+          List<String> sourceTypeNames = sourceTypeCounts.keys.toList();
+          sourceTypeNames.sort();
+          List<String> typeNames = typeCounts.keys.toList();
+          typeNames.sort();
+
+          buffer.write('<p><b>Target counts</b></p>');
+          buffer.write(
+              '<table style="border-collapse: separate; border-spacing: 10px 5px;">');
+          _writeRow(buffer, ['Target', 'Count'], header: true);
+          for (String sourceTypeName in sourceTypeNames) {
+            _writeRow(
+                buffer, [sourceTypeName, sourceTypeCounts[sourceTypeName]],
+                classes: [null, "right"]);
+          }
+          for (String typeName in typeNames) {
+            _writeRow(buffer, [typeName, typeCounts[typeName]],
+                classes: [null, "right"]);
+          }
+          buffer.write('</table>');
+        }, (StringBuffer buffer) {
+          //
+          // Write task model timing information.
+          //
+          buffer.write('<p><b>Task performace 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>');
         });
-        _writeRow(buffer, ['Total', '-', totalTaskTime, '-'],
-            classes: [null, "right", "right", "right"]);
-        buffer.write('</table>');
+        //
+        // Write task model inputs timing information.
+        //
+        {
+          buffer.write('<p><b>Task inputs performace 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<TaskDescriptor, int> countMap = WorkItem.countMap;
+          Map<TaskDescriptor, Stopwatch> stopwatchMap = WorkItem.stopwatchMap;
+          List<TaskDescriptor> taskClasses = stopwatchMap.keys.toList();
+          taskClasses.sort((TaskDescriptor first, TaskDescriptor second) {
+            String firstName = first.name;
+            String secondName = second.name;
+            return firstName.compareTo(secondName);
+          });
+          taskClasses.forEach((TaskDescriptor descriptor) {
+            int count = countMap[descriptor];
+            if (count == null) {
+              count = 0;
+            }
+            int taskTime = stopwatchMap[descriptor].elapsedMilliseconds;
+            _writeRow(buffer, [
+              descriptor.name,
+              count,
+              taskTime,
+              count <= 0 ? '-' : (taskTime / count).toStringAsFixed(3)
+            ], classes: [
+              null,
+              "right",
+              "right",
+              "right"
+            ]);
+          });
+          buffer.write('</table>');
+        }
       });
     });
   }
@@ -390,31 +632,34 @@
     InternalAnalysisContext context = analysisServer.folderMap[folder];
 
     _writeResponse(request, (StringBuffer buffer) {
-      _writePage(buffer, 'Analysis Server - AST Structure', [
-        'Context: $contextFilter',
-        'File: $sourceUri'
-      ], (HttpResponse) {
+      _writePage(buffer, 'Analysis Server - AST Structure',
+          ['Context: $contextFilter', 'File: $sourceUri'], (HttpResponse) {
         Source source = context.sourceFactory.forUri(sourceUri);
         if (source == null) {
           buffer.write('<p>Not found.</p>');
           return;
         }
-        CacheEntry entry = context.analysisCache.get(source);
-        if (entry == null) {
-          buffer.write('<p>Not found.</p>');
-          return;
-        }
-        CompilationUnit ast = _getAnyAst(entry);
-        if (ast == null) {
-          buffer.write('<p>null</p>');
-          return;
-        }
-        AstWriter writer = new AstWriter(buffer);
-        ast.accept(writer);
-        if (writer.exceptions.isNotEmpty) {
-          buffer.write('<h3>Exceptions while creating page</h3>');
-          for (CaughtException exception in writer.exceptions) {
-            _writeException(buffer, exception);
+        List<Source> libraries = context.getLibrariesContaining(source);
+        for (Source library in libraries) {
+          AnalysisTarget target = new LibrarySpecificUnit(library, source);
+          CacheEntry entry = context.analysisCache.get(target);
+          buffer.write('<b>$target</b><br>');
+          if (entry == null) {
+            buffer.write('<p>Not found.</p>');
+            continue;
+          }
+          CompilationUnit ast = _getAnyAst(entry);
+          if (ast == null) {
+            buffer.write('<p>null</p>');
+            continue;
+          }
+          AstWriter writer = new AstWriter(buffer);
+          ast.accept(writer);
+          if (writer.exceptions.isNotEmpty) {
+            buffer.write('<h3>Exceptions while creating page</h3>');
+            for (CaughtException exception in writer.exceptions) {
+              _writeException(buffer, exception);
+            }
           }
         }
       });
@@ -474,10 +719,9 @@
     InternalAnalysisContext context = analysisServer.folderMap[folder];
 
     _writeResponse(request, (StringBuffer buffer) {
-      _writePage(buffer, 'Analysis Server - Cache Entry', [
-        'Context: $contextFilter',
-        'File: $sourceUri'
-      ], (HttpResponse) {
+      _writePage(buffer, 'Analysis Server - Cache Entry',
+          ['Context: $contextFilter', 'File: $sourceUri'], (HttpResponse) {
+        List<CacheEntry> entries = entryMap[folder];
         buffer.write('<h3>Analyzing Contexts</h3><p>');
         bool first = true;
         allContexts.forEach((Folder folder) {
@@ -491,20 +735,30 @@
           if (analyzingContext == context) {
             buffer.write(folder.path);
           } else {
-            buffer.write(makeLink(CACHE_ENTRY_PATH, {
-              CONTEXT_QUERY_PARAM: folder.path,
-              SOURCE_QUERY_PARAM: sourceUri
-            }, HTML_ESCAPE.convert(folder.path)));
+            buffer.write(makeLink(
+                CACHE_ENTRY_PATH,
+                {
+                  CONTEXT_QUERY_PARAM: folder.path,
+                  SOURCE_QUERY_PARAM: sourceUri
+                },
+                HTML_ESCAPE.convert(folder.path)));
           }
-          if (entryMap[folder][0].explicitlyAdded) {
-            buffer.write(' (explicit)');
+          if (entries == null) {
+            buffer.write(' (file does not exist)');
           } else {
-            buffer.write(' (implicit)');
+            CacheEntry sourceEntry = entries
+                .firstWhere((CacheEntry entry) => entry.target is Source);
+            if (sourceEntry == null) {
+              buffer.write(' (missing source entry)');
+            } else if (sourceEntry.explicitlyAdded) {
+              buffer.write(' (explicit)');
+            } else {
+              buffer.write(' (implicit)');
+            }
           }
         });
         buffer.write('</p>');
 
-        List<CacheEntry> entries = entryMap[folder];
         if (entries == null) {
           buffer.write('<p>Not being analyzed in this context.</p>');
           return;
@@ -514,35 +768,43 @@
             CONTEXT_QUERY_PARAM: folder.path,
             SOURCE_QUERY_PARAM: sourceUri
           };
-          List<ResultDescriptor> results = entry.nonInvalidResults;
+          List<ResultDescriptor> results = _getExpectedResults(entry);
           results.sort((ResultDescriptor first, ResultDescriptor second) =>
               first.toString().compareTo(second.toString()));
 
           buffer.write('<h3>');
           buffer.write(HTML_ESCAPE.convert(entry.target.toString()));
           buffer.write('</h3>');
-          buffer.write('<dl>');
-          buffer.write('<dt>time</dt><dd>');
+          buffer.write('<p>time</p><blockquote><p>Value</p><blockquote>');
           buffer.write(entry.modificationTime);
-          buffer.write('</dd></dl>');
+          buffer.write('</blockquote></blockquote>');
           for (ResultDescriptor result in results) {
             ResultData data = entry.getResultData(result);
+            CacheState state = entry.getState(result);
             String descriptorName = HTML_ESCAPE.convert(result.toString());
-            String descriptorState = HTML_ESCAPE.convert(data.state.toString());
-            buffer.write('<dt>$descriptorName ($descriptorState)</dt><dd>');
-            try {
-              _writeValueAsHtml(buffer, data.value, linkParameters);
-            } catch (exception) {
-              buffer.write('(${HTML_ESCAPE.convert(exception.toString())})');
+            String descriptorState = HTML_ESCAPE.convert(state.toString());
+            buffer
+                .write('<p>$descriptorName ($descriptorState)</p><blockquote>');
+            if (state == CacheState.VALID) {
+              buffer.write('<p>Value</p><blockquote>');
+              try {
+                _writeValueAsHtml(
+                    buffer, entry.getValue(result), linkParameters);
+              } catch (exception) {
+                buffer.write('(${HTML_ESCAPE.convert(exception.toString())})');
+              }
+              buffer.write('</blockquote>');
             }
-            buffer.write('</dd>');
+            _writeTargetedResults(buffer, 'Depends on', data.dependedOnResults);
+            _writeTargetedResults(
+                buffer, 'Depended on by', data.dependentResults);
+            buffer.write('</blockquote>');
           }
           if (entry.exception != null) {
             buffer.write('<dt>exception</dt><dd>');
             _writeException(buffer, entry.exception);
-            buffer.write('</dd></dl>');
+            buffer.write('</dd>');
           }
-          buffer.write('</dl>');
         }
       });
     });
@@ -737,21 +999,25 @@
         .map((Source source) => source.fullName)
         .toList();
     MapIterator<AnalysisTarget, CacheEntry> iterator =
-        context.analysisCache.iterator();
+        context.analysisCache.iterator(context: context);
     while (iterator.moveNext()) {
-      Source source = iterator.key.source;
-      if (source != null) {
+      AnalysisTarget target = iterator.key;
+      if (target is Source) {
         CacheEntry entry = iterator.value;
-        String sourceName = source.fullName;
+        String sourceName = target.fullName;
         if (!links.containsKey(sourceName)) {
           CaughtException exception = entry.exception;
           if (exception != null) {
             exceptions.add(exception);
           }
-          String link = makeLink(CACHE_ENTRY_PATH, {
-            CONTEXT_QUERY_PARAM: folder.path,
-            SOURCE_QUERY_PARAM: source.uri.toString()
-          }, sourceName, exception != null);
+          String link = makeLink(
+              CACHE_ENTRY_PATH,
+              {
+                CONTEXT_QUERY_PARAM: folder.path,
+                SOURCE_QUERY_PARAM: target.uri.toString()
+              },
+              sourceName,
+              exception != null);
           if (entry.explicitlyAdded) {
             explicitNames.add(sourceName);
           } else {
@@ -764,6 +1030,9 @@
     explicitNames.sort();
     implicitNames.sort();
 
+    AnalysisDriver driver = (context as AnalysisContextImpl).driver;
+    List<WorkItem> workItems = driver.currentWorkOrder?.workItems;
+
     _overlayContents.clear();
     context.visitContentCache((String fullName, int stamp, String contents) {
       _overlayContents[fullName] = contents;
@@ -775,7 +1044,7 @@
       if (fileNames == null || fileNames.isEmpty) {
         buffer.write('<p>None</p>');
       } else {
-        buffer.write('<table style="width: 100%">');
+        buffer.write('<p><table style="width: 100%">');
         for (String fileName in fileNames) {
           buffer.write('<tr><td>');
           buffer.write(links[fileName]);
@@ -786,33 +1055,34 @@
           }
           buffer.write('</td></tr>');
         }
-        buffer.write('</table>');
+        buffer.write('</table></p>');
       }
     }
 
     _writeResponse(request, (StringBuffer buffer) {
-      _writePage(buffer, 'Analysis Server - Context',
-          ['Context: $contextFilter'], (StringBuffer buffer) {
-        List headerRowText = ['Context'];
-        headerRowText.addAll(CacheState.values);
-        buffer.write('<h3>Summary</h3>');
-        buffer.write('<table>');
-        _writeRow(buffer, headerRowText, header: true);
-        AnalysisContextStatistics statistics = context.statistics;
-        statistics.cacheRows.forEach((AnalysisContextStatistics_CacheRow row) {
-          List rowText = [row.name];
-          for (CacheState state in CacheState.values) {
-            String text = row.getCount(state).toString();
-            Map<String, String> params = <String, String>{
-              STATE_QUERY_PARAM: state.toString(),
-              CONTEXT_QUERY_PARAM: folder.path,
-              DESCRIPTOR_QUERY_PARAM: row.name
-            };
-            rowText.add(makeLink(CACHE_STATE_PATH, params, text));
-          }
-          _writeRow(buffer, rowText, classes: [null, "right"]);
+      _writePage(
+          buffer, 'Analysis Server - Context', ['Context: $contextFilter'],
+          (StringBuffer buffer) {
+        buffer.write('<h3>Most Recently Perfomed Tasks</h3>');
+        AnalysisTask.LAST_TASKS.forEach((String description) {
+          buffer.write('<p>$description</p>');
         });
-        buffer.write('</table>');
+
+        String _describe(WorkItem item) {
+          if (item == null) {
+            return 'None';
+          }
+          return '${item.descriptor?.name} computing ${item.spawningResult?.name} for ${item.target?.toString()}';
+        }
+
+        buffer.write('<h3>Work Items</h3>');
+        buffer.write(
+            '<p><b>Current:</b> ${_describe(driver.currentWorkOrder?.current)}</p>');
+        if (workItems != null) {
+          buffer.writeAll(workItems.reversed
+              .map((item) => '<p>${_describe(item)}</p>')
+              ?.toList());
+        }
 
         _writeFiles(buffer, 'Priority Files', priorityNames);
         _writeFiles(buffer, 'Explicitly Analyzed Files', explicitNames);
@@ -916,8 +1186,8 @@
           buffer.write('<table border="1">');
           _writeRow(buffer, ['Element', 'Relationship', 'Location'],
               header: true);
-          relations.forEach((List<String> elementPath,
-              List<InspectLocation> relations) {
+          relations.forEach(
+              (List<String> elementPath, List<InspectLocation> relations) {
             String elementLocation = elementPath.join(' ');
             relations.forEach((InspectLocation location) {
               var relString = location.relationship.identifier;
@@ -1073,10 +1343,13 @@
           buffer.write('<br>');
         }
         String key = folder.shortName;
-        buffer.write(makeLink(CONTEXT_PATH, {
-          CONTEXT_QUERY_PARAM: folder.path
-        }, key, _hasException(folderMap[folder])));
+        buffer.write(makeLink(CONTEXT_PATH, {CONTEXT_QUERY_PARAM: folder.path},
+            key, _hasException(folderMap[folder])));
+        if (!folder.getChild('.packages').exists) {
+          buffer.write(' <b>[No .packages file]</b>');
+        }
       });
+      // TODO(brianwilkerson) Add items for the SDK contexts (currently only one).
       buffer.write('</p>');
 
       buffer.write('<p><b>Options</b></p>');
@@ -1086,6 +1359,7 @@
       _writeOption(buffer, 'Cache size', options.cacheSize);
       _writeOption(
           buffer, 'Enable strict call checks', options.enableStrictCallChecks);
+      _writeOption(buffer, 'Enable super mixins', options.enableSuperMixins);
       _writeOption(buffer, 'Generate hints', options.hint);
       _writeOption(buffer, 'Generate dart2js hints', options.dart2jsHint);
       _writeOption(buffer, 'Generate errors in implicit files',
@@ -1161,24 +1435,26 @@
       return;
     }
     buffer.write('<table>');
-    _writeRow(buffer, [
-      'Start Time',
-      '',
-      'First (ms)',
-      '',
-      'Complete (ms)',
-      '',
-      '# Notifications',
-      '',
-      '# Suggestions',
-      '',
-      'Snippet'
-    ], header: true);
+    _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}');
+      String link = makeLink(COMPLETION_PATH, {'index': '$index'},
+          '${performance.startTimeAndMs}');
       _writeRow(buffer, [
         link,
         '&nbsp;&nbsp;',
@@ -1282,6 +1558,24 @@
     }
   }
 
+  void _writeListOfStrings(
+      StringBuffer buffer, String listName, Iterable<String> items) {
+    List<String> itemList = items.toList();
+    itemList.sort((String a, String b) {
+      a = a.toLowerCase();
+      b = b.toLowerCase();
+      return a.compareTo(b);
+    });
+    buffer.write('List "listName" containing ${itemList.length} entries:');
+    buffer.write('<ul>');
+    for (String member in itemList) {
+      buffer.write('<li>');
+      buffer.write(member);
+      buffer.write('</li>');
+    }
+    buffer.write('</ul>');
+  }
+
   /**
    * Write a representation of an analysis option with the given [name] and
    * [value] to the given [buffer]. The option should be separated from other
@@ -1367,9 +1661,9 @@
    */
   void _writePluginStatus(StringBuffer buffer) {
     void writePlugin(Plugin plugin) {
-      buffer.write(_server.serverPlugin.uniqueIdentifier);
+      buffer.write(plugin.uniqueIdentifier);
       buffer.write(' (');
-      buffer.write(_server.serverPlugin.runtimeType);
+      buffer.write(plugin.runtimeType);
       buffer.write(')<br>');
     }
     buffer.write('<h3>Plugin Status</h3><p>');
@@ -1573,6 +1867,39 @@
   }
 
   /**
+   * Write the targeted results returned by iterating over the [results] to the
+   * given [buffer]. The list will have the given [title] written before it.
+   */
+  void _writeTargetedResults(
+      StringBuffer buffer, String title, Iterable<TargetedResult> results) {
+    List<TargetedResult> sortedResults = results.toList();
+    sortedResults.sort((TargetedResult first, TargetedResult second) {
+      int nameOrder =
+          first.result.toString().compareTo(second.result.toString());
+      if (nameOrder != 0) {
+        return nameOrder;
+      }
+      return first.target.toString().compareTo(second.target.toString());
+    });
+
+    buffer.write('<p>');
+    buffer.write(title);
+    buffer.write('</p><blockquote>');
+    if (results.isEmpty) {
+      buffer.write('nothing');
+    } else {
+      for (TargetedResult result in sortedResults) {
+        buffer.write('<p>');
+        buffer.write(result.result.toString());
+        buffer.write(' of ');
+        buffer.write(result.target.toString());
+        buffer.write('<p>');
+      }
+    }
+    buffer.write('</blockquote>');
+  }
+
+  /**
    * Write two columns of information to the given [buffer], where the
    * [leftColumn] and [rightColumn] functions are used to generate the content
    * of those columns.
@@ -1615,6 +1942,22 @@
       String link =
           makeLink(ELEMENT_PATH, linkParameters, value.runtimeType.toString());
       buffer.write('<i>$link</i>');
+    } else if (value is UsedLocalElements) {
+      buffer.write('<ul>');
+      {
+        HashSet<Element> elements = value.elements;
+        buffer.write('List "elements" containing ${elements.length} entries');
+        buffer.write('<ul>');
+        for (Element element in elements) {
+          buffer.write('<li>');
+          buffer.write('<i>${element.runtimeType}</i>  $element');
+          buffer.write('</li>');
+        }
+        buffer.write('</ul>');
+      }
+      _writeListOfStrings(buffer, 'members', value.members);
+      _writeListOfStrings(buffer, 'readMembers', value.readMembers);
+      buffer.write('</ul>');
     } else {
       buffer.write(HTML_ESCAPE.convert(value.toString()));
       buffer.write(' <i>(${value.runtimeType.toString()})</i>');
diff --git a/pkg/analysis_server/lib/src/status/tree_writer.dart b/pkg/analysis_server/lib/src/status/tree_writer.dart
index ec9fb85..4b5b3a4 100644
--- a/pkg/analysis_server/lib/src/status/tree_writer.dart
+++ b/pkg/analysis_server/lib/src/status/tree_writer.dart
@@ -124,9 +124,8 @@
           String name = value.name;
           if (name != null) {
             buffer.write('&nbsp;&nbsp;[');
-            buffer.write(GetHandler.makeLink(GetHandler.INDEX_ELEMENT_BY_NAME, {
-              'name': name
-            }, 'search index'));
+            buffer.write(GetHandler.makeLink(GetHandler.INDEX_ELEMENT_BY_NAME,
+                {'name': name}, 'search index'));
             buffer.write(']');
           }
         }
diff --git a/pkg/analysis_server/lib/src/utilities/change_builder_core.dart b/pkg/analysis_server/lib/src/utilities/change_builder_core.dart
index 9f0225b..a5fe204 100644
--- a/pkg/analysis_server/lib/src/utilities/change_builder_core.dart
+++ b/pkg/analysis_server/lib/src/utilities/change_builder_core.dart
@@ -4,8 +4,8 @@
 
 library analysis_server.src.utilities.change_builder_core;
 
-import 'package:analysis_server/src/protocol.dart';
-import 'package:analysis_server/utilities/change_builder_core.dart';
+import 'package:analysis_server/plugin/edit/utilities/change_builder_core.dart';
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analyzer/src/generated/source.dart';
 
 /**
diff --git a/pkg/analysis_server/lib/src/utilities/change_builder_dart.dart b/pkg/analysis_server/lib/src/utilities/change_builder_dart.dart
index e6b1de9..f40dd36 100644
--- a/pkg/analysis_server/lib/src/utilities/change_builder_dart.dart
+++ b/pkg/analysis_server/lib/src/utilities/change_builder_dart.dart
@@ -4,12 +4,12 @@
 
 library analysis_server.src.utilities.change_builder_dart;
 
-import 'package:analysis_server/src/protocol.dart' hide ElementKind;
+import 'package:analysis_server/plugin/edit/utilities/change_builder_core.dart';
+import 'package:analysis_server/plugin/edit/utilities/change_builder_dart.dart';
+import 'package:analysis_server/plugin/protocol/protocol.dart' hide ElementKind;
 import 'package:analysis_server/src/services/correction/name_suggestion.dart';
 import 'package:analysis_server/src/services/correction/util.dart';
 import 'package:analysis_server/src/utilities/change_builder_core.dart';
-import 'package:analysis_server/utilities/change_builder_core.dart';
-import 'package:analysis_server/utilities/change_builder_dart.dart';
 import 'package:analyzer/src/generated/ast.dart';
 import 'package:analyzer/src/generated/element.dart';
 import 'package:analyzer/src/generated/engine.dart';
@@ -58,9 +58,13 @@
   DartFileEditBuilderImpl get dartFileEditBuilder => fileEditBuilder;
 
   @override
-  void writeClassDeclaration(String name, {Iterable<DartType> interfaces,
-      bool isAbstract: false, void memberWriter(), Iterable<DartType> mixins,
-      String nameGroupName, DartType superclass}) {
+  void writeClassDeclaration(String name,
+      {Iterable<DartType> interfaces,
+      bool isAbstract: false,
+      void memberWriter(),
+      Iterable<DartType> mixins,
+      String nameGroupName,
+      DartType superclass}) {
     // TODO(brianwilkerson) Add support for type parameters, probably as a
     // parameterWriter parameter.
     // TODO(brianwilkerson) Add a superclassGroupName parameter.
@@ -95,7 +99,8 @@
 
   //@override
   void writeConstructorDeclaration(ClassElement classElement,
-      {ArgumentList argumentList, SimpleIdentifier constructorName,
+      {ArgumentList argumentList,
+      SimpleIdentifier constructorName,
       bool isConst: false}) {
     // TODO(brianwilkerson) Clean up the API and add it to the public API.
     //
@@ -134,9 +139,14 @@
   }
 
   @override
-  void writeFieldDeclaration(String name, {void initializerWriter(),
-      bool isConst: false, bool isFinal: false, bool isStatic: false,
-      String nameGroupName, DartType type, String typeGroupName}) {
+  void writeFieldDeclaration(String name,
+      {void initializerWriter(),
+      bool isConst: false,
+      bool isFinal: false,
+      bool isStatic: false,
+      String nameGroupName,
+      DartType type,
+      String typeGroupName}) {
     if (isStatic) {
       write(Keyword.STATIC.syntax);
       write(' ');
@@ -170,8 +180,11 @@
   }
 
   @override
-  void writeGetterDeclaration(String name, {void bodyWriter(),
-      bool isStatic: false, String nameGroupName, DartType returnType,
+  void writeGetterDeclaration(String name,
+      {void bodyWriter(),
+      bool isStatic: false,
+      String nameGroupName,
+      DartType returnType,
       String returnTypeGroupName}) {
     if (isStatic) {
       write(Keyword.STATIC.syntax);
@@ -349,8 +362,10 @@
   }
 
   @override
-  bool writeType(DartType type, {bool addSupertypeProposals: false,
-      String groupName, bool required: false}) {
+  bool writeType(DartType type,
+      {bool addSupertypeProposals: false,
+      String groupName,
+      bool required: false}) {
     if (type != null && !type.isDynamic) {
       String typeSource =
           utils.getTypeSource(type, dartFileEditBuilder.librariesToImport);
diff --git a/pkg/analysis_server/lib/starter.dart b/pkg/analysis_server/lib/starter.dart
index 87821c1..ad5b19d 100644
--- a/pkg/analysis_server/lib/starter.dart
+++ b/pkg/analysis_server/lib/starter.dart
@@ -2,16 +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 driver;
+library analysis_server.starter;
 
-import 'package:analysis_server/src/context_manager.dart';
+import 'package:analysis_server/plugin/analysis/resolver_provider.dart';
 import 'package:analysis_server/src/server/driver.dart';
-import 'package:analysis_server/uri/resolver_provider.dart';
 import 'package:analyzer/instrumentation/instrumentation.dart';
 import 'package:plugin/plugin.dart';
 
 /**
- * An object that can be used to start an analysis server.
+ * An object that can be used to start an analysis server. This class exists so
+ * that clients can configure an analysis server before starting it.
+ *
+ * Clients may not extend, implement or mix-in this class.
  */
 abstract class ServerStarter {
   /**
@@ -20,12 +22,6 @@
   factory ServerStarter() = Driver;
 
   /**
-   * Set the context manager used to create analysis contexts within each of the
-   * analysis roots.
-   */
-  void set contextManager(ContextManager manager);
-
-  /**
    * Set the instrumentation [server] that is to be used by the analysis server.
    */
   void set instrumentationServer(InstrumentationServer server);
@@ -35,7 +31,6 @@
    * are resolved in some contexts. The provider should return `null` if the
    * default package resolution scheme should be used instead.
    */
-  @deprecated
   void set packageResolverProvider(ResolverProvider provider);
 
   /**
diff --git a/pkg/analysis_server/lib/uri/resolver_provider.dart b/pkg/analysis_server/lib/uri/resolver_provider.dart
deleted file mode 100644
index 36ae274..0000000
--- a/pkg/analysis_server/lib/uri/resolver_provider.dart
+++ /dev/null
@@ -1,16 +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.
-
-library analysis_server.uri.resolver_provider;
-
-import 'package:analyzer/file_system/file_system.dart';
-import 'package:analyzer/src/generated/source.dart';
-
-/**
- * A function that will return a [UriResolver] that can be used to resolve a
- * specific kind of URI within the analysis context rooted at the given folder.
- * This is currently being used to provide a package URI resolver that will be
- * used by the server (see [ServerStarter.packageResolverProvider]).
- */
-typedef UriResolver ResolverProvider(Folder folder);
diff --git a/pkg/analysis_server/lib/utilities/change_builder_core.dart b/pkg/analysis_server/lib/utilities/change_builder_core.dart
deleted file mode 100644
index 7c69c46..0000000
--- a/pkg/analysis_server/lib/utilities/change_builder_core.dart
+++ /dev/null
@@ -1,123 +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.
-
-library analysis_server.utilities.change_builder_core;
-
-import 'package:analysis_server/src/utilities/change_builder_core.dart';
-import 'package:analysis_server/src/protocol.dart';
-import 'package:analyzer/src/generated/source.dart';
-
-/**
- * A builder used to build a [SourceChange].
- *
- * Clients are not expected to subtype this class.
- */
-abstract class ChangeBuilder {
-  /**
-   * Initialize a newly created change builder.
-   */
-  factory ChangeBuilder() = ChangeBuilderImpl;
-
-  /**
-   * Return the source change that was built.
-   */
-  SourceChange get sourceChange;
-
-  /**
-   * Use the [buildFileEdit] function to create a collection of edits to the
-   * given [source]. The edits will be added to the source change that is being
-   * built. The [timeStamp] is the time at which the [source] was last modified
-   * and is used by clients to ensure that it is safe to apply the edits.
-   */
-  void addFileEdit(Source source, int timeStamp,
-      void buildFileEdit(FileEditBuilder builder));
-}
-
-/**
- * A builder used to build a [SourceEdit] as part of a [SourceFileEdit].
- *
- * Clients are not expected to subtype this class.
- */
-abstract class EditBuilder {
-  /**
-   * Add a region of text that is part of the linked edit group with the given
-   * [groupName]. The [buildLinkedEdit] function is used to write the content of
-   * the region of text and to add suggestions for other possible values for
-   * that region.
-   */
-  void addLinkedEdit(
-      String groupName, void buildLinkedEdit(LinkedEditBuilder builder));
-
-  /**
-   * Add the given [string] to the content of the current edit.
-   */
-  void write(String string);
-
-  /**
-   * Add the given [string] to the content of the current edit and then add an
-   * end-of-line marker.
-   */
-  void writeln([String string]);
-}
-
-/**
- * A builder used to build a [SourceFileEdit] within a [SourceChange].
- *
- * Clients are not expected to subtype this class.
- */
-abstract class FileEditBuilder {
-  /**
-   * Add an insertion of text at the given [offset]. The [offset] is relative to
-   * the original source. The [buildEdit] function is used to write the text to
-   * be inserted. This is fully equivalent to
-   *
-   *     addReplacement(offset, 0, buildEdit);
-   */
-  void addInsertion(int offset, void buildEdit(EditBuilder builder));
-
-  /**
-   * Add the region of text starting at the given [offset] and continuing for
-   * the given [length] to the linked edit group with the given [groupName].
-   * The [offset] is relative to the original source. This is typically used to
-   * include pre-existing regions of text in a group.
-   */
-  void addLinkedPosition(int offset, int length, String groupName);
-
-  /**
-   * Add a replacement of text starting at the given [offset] and continuing for
-   * the given [length]. The [offset] is relative to the original source. The
-   * [buildEdit] function is used to write the text that will replace the
-   * specified region.
-   */
-  void addReplacement(
-      int offset, int length, void buildEdit(EditBuilder builder));
-}
-
-/**
- * A builder used to build a [LinkedEdit] region within an edit.
- *
- * Clients are not expected to subtype this class.
- */
-abstract class LinkedEditBuilder {
-  /**
-   * Add the given [value] as a suggestion with the given [kind].
-   */
-  void addSuggestion(LinkedEditSuggestionKind kind, String value);
-
-  /**
-   * Add each of the given [values] as a suggestion with the given [kind].
-   */
-  void addSuggestions(LinkedEditSuggestionKind kind, Iterable<String> values);
-
-  /**
-   * Add the given [string] to the content of the current edit.
-   */
-  void write(String string);
-
-  /**
-   * Add the given [string] to the content of the current edit and then add an
-   * end-of-line marker.
-   */
-  void writeln([String string]);
-}
diff --git a/pkg/analysis_server/lib/utilities/change_builder_dart.dart b/pkg/analysis_server/lib/utilities/change_builder_dart.dart
deleted file mode 100644
index b81b22a..0000000
--- a/pkg/analysis_server/lib/utilities/change_builder_dart.dart
+++ /dev/null
@@ -1,142 +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.
-
-library analysis_server.utilities.change_builder_dart;
-
-import 'package:analysis_server/src/utilities/change_builder_dart.dart';
-import 'package:analysis_server/utilities/change_builder_core.dart';
-import 'package:analyzer/src/generated/ast.dart';
-import 'package:analyzer/src/generated/element.dart';
-import 'package:analyzer/src/generated/engine.dart';
-
-/**
- * A [ChangeBuilder] used to build changes in Dart files.
- *
- * Clients are not expected to subtype this class.
- */
-abstract class DartChangeBuilder extends ChangeBuilder {
-  /**
-   * Initialize a newly created change builder.
-   */
-  factory DartChangeBuilder(AnalysisContext context) = DartChangeBuilderImpl;
-}
-
-/**
- * An [EditBuilder] used to build edits in Dart files.
- *
- * Clients are not expected to subtype this class.
- */
-abstract class DartEditBuilder extends EditBuilder {
-  /**
-   * The group-id used for the name of a declaration.
-   */
-  static const String NAME_GROUP_ID = 'NAME';
-
-  /**
-   * The group-id used for the return type of a function, getter or method.
-   */
-  static const String RETURN_TYPE_GROUP_ID = 'RETURN_TYPE';
-
-  /**
-   * The group-id used for the name of the superclass in a class declaration.
-   */
-  static const String SUPERCLASS_GROUP_ID = 'SUPERCLASS';
-
-  /**
-   * Write the code for a declaration of a class with the given [name]. If a
-   * list of [interfaces] is provided, then the class will implement those
-   * interfaces. If [isAbstract] is `true`, then the class will be abstract. If
-   * a [memberWriter] is provided, then it will be invoked to allow members to
-   * be generated. (The members will automatically be preceeded and followed by
-   * end-of-line markers.) If a list of [mixins] is provided, then the class
-   * will mix in those classes. If a [nameGroupName] is provided, then the name
-   * of the class will be included in the linked edit group with that name. If a
-   * [superclass] is given then it will be the superclass of the class. (If a
-   * list of [mixins] is provided but no [superclass] is given then the class
-   * will extend `Object`.)
-   */
-  void writeClassDeclaration(String name, {Iterable<DartType> interfaces,
-      bool isAbstract: false, void memberWriter(), Iterable<DartType> mixins,
-      String nameGroupName, DartType superclass});
-
-  /**
-   * Write the code for a declaration of a field with the given [name]. If an
-   * [initializerWriter] is provided, it will be invoked to write the content of
-   * the initializer. (The equal sign separating the field name from the
-   * initializer expression will automatically be written.) If [isConst] is
-   * `true`, then the declaration will be preceeded by the `const` keyword. If
-   * [isFinal] is `true`, then the declaration will be preceeded by the `final`
-   * keyword. (If both [isConst] and [isFinal] are `true`, then only the `const`
-   * keyword will be written.) If [isStatic] is `true`, then the declaration
-   * will be preceeded by the `static` keyword. If a [nameGroupName] is
-   * provided, the name of the field will be included in the linked edit group
-   * with that name. If a [type] is provided, then it will be used as the type
-   * of the field. (The keyword `var` will be provided automatically when
-   * required.) If a [typeGroupName] is provided, then if a type was written
-   * it will be in the linked edit group with that name.
-   */
-  void writeFieldDeclaration(String name, {void initializerWriter(),
-      bool isConst: false, bool isFinal: false, bool isStatic: false,
-      String nameGroupName, DartType type, String typeGroupName});
-
-  /**
-   * Write the code for a declaration of a getter with the given [name]. If a
-   * [bodyWriter] is provided, it will be invoked to write the body of the
-   * getter. (The space between the name and the body will automatically be
-   * written.) If [isStatic] is `true`, then the declaration will be preceeded
-   * by the `static` keyword. If a [nameGroupName] is provided, the name of the
-   * getter will be included in the linked edit group with that name. If a
-   * [returnType] is provided, then it will be used as the return type of the
-   * getter. If a [returnTypeGroupName] is provided, then if a return type was
-   * written it will be in the linked edit group with that name.
-   */
-  void writeGetterDeclaration(String name, {void bodyWriter(),
-      bool isStatic: false, String nameGroupName, DartType returnType,
-      String returnTypeGroupName});
-
-  /**
-   * Append a placeholder for an override of the specified inherited [member].
-   */
-  void writeOverrideOfInheritedMember(ExecutableElement member);
-
-  /**
-   * Write the code for a list of [parameters], including the surrounding
-   * parentheses.
-   */
-  void writeParameters(Iterable<ParameterElement> parameters);
-
-  /**
-   * Write the code for a list of parameters that would match the given list of
-   * [arguments], including the surrounding parentheses.
-   */
-  void writeParametersMatchingArguments(ArgumentList arguments);
-
-  /**
-   * Write the code for a single parameter with the given [type] and [name].
-   * The [type] can be `null` if no type is to be specified for the parameter.
-   */
-  void writeParameterSource(DartType type, String name);
-
-  /**
-   * Write the code for a type annotation for the given [type]. If the [type] is
-   * either `null` or represents the type 'dynamic', then the behavior depends
-   * on whether a type is [required]. If [required] is `true`, then 'var' will
-   * be written; otherwise, nothing is written.
-   *
-   * If the [groupName] is not `null`, then the name of the type (including type
-   * parameters) will be included as a region in the linked edit group with that
-   * name. If the [groupName] is not `null` and [addSupertypeProposals] is
-   * `true`, then all of the supertypes of the [type] will be added as
-   * suggestions for alternatives to the type name.
-   */
-  bool writeType(DartType type, {bool addSupertypeProposals: false,
-      String groupName, bool required: false});
-}
-
-/**
- * A [FileEditBuilder] used to build edits for Dart files.
- *
- * Clients are not expected to subtype this class.
- */
-abstract class DartFileEditBuilder extends FileEditBuilder {}
diff --git a/pkg/analysis_server/pubspec.yaml b/pkg/analysis_server/pubspec.yaml
index 2b14dd6..3f53b5b 100644
--- a/pkg/analysis_server/pubspec.yaml
+++ b/pkg/analysis_server/pubspec.yaml
@@ -4,11 +4,12 @@
 description: A server that performs analysis of Dart code over character streams using JSON-RPC encoded information.
 homepage: http://www.dartlang.org
 environment:
-  sdk: '>=1.9.0 <2.0.0'
+  sdk: '>=1.12.0 <2.0.0'
 dependencies:
-  analyzer: '>=0.26.0-alpha.0 <0.27.0'
+  analyzer: '>=0.26.1+16 <0.27.0'
   args: '>=0.13.0 <0.14.0'
-  dart_style: '>=0.1.7 <0.2.0'
+  dart_style: '>=0.2.0 <0.3.0'
+  linter: ^0.1.3+2
   logging: any
   path: any
   plugin: <0.2.0
diff --git a/pkg/analysis_server/test/abstract_context.dart b/pkg/analysis_server/test/abstract_context.dart
index 696a2ae..46f0dbf 100644
--- a/pkg/analysis_server/test/abstract_context.dart
+++ b/pkg/analysis_server/test/abstract_context.dart
@@ -41,7 +41,7 @@
   static final DartSdk SDK = new MockSdk();
   static final UriResolver SDK_RESOLVER = new DartUriResolver(SDK);
 
-  MemoryResourceProvider provider = new MemoryResourceProvider();
+  MemoryResourceProvider provider;
   Map<String, List<Folder>> packageMap;
   UriResolver resourceResolver;
   AnalysisContext context;
@@ -83,6 +83,7 @@
   }
 
   void setUp() {
+    setupResourceProvider();
     resourceResolver = new ResourceUriResolver(provider);
     packageMap = new Map<String, List<Folder>>();
     PackageMapUriResolver packageResolver =
@@ -92,6 +93,10 @@
         new SourceFactory([SDK_RESOLVER, packageResolver, resourceResolver]);
   }
 
+  void setupResourceProvider() {
+    provider = new MemoryResourceProvider();
+  }
+
   void tearDown() {
     context = null;
     provider = null;
diff --git a/pkg/analysis_server/test/analysis/get_errors_test.dart b/pkg/analysis_server/test/analysis/get_errors_test.dart
index 4cc0a2f..65a524a4 100644
--- a/pkg/analysis_server/test/analysis/get_errors_test.dart
+++ b/pkg/analysis_server/test/analysis/get_errors_test.dart
@@ -6,16 +6,17 @@
 
 import 'dart:async';
 
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/domain_analysis.dart';
-import 'package:analysis_server/src/protocol.dart';
 import 'package:analyzer/file_system/file_system.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 import 'package:unittest/unittest.dart';
 
 import '../analysis_abstract.dart';
+import '../utils.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(GetErrorsTest);
 }
 
@@ -50,7 +51,9 @@
 
   test_fileWithoutContext() {
     String file = '/outside.dart';
-    addFile(file, '''
+    addFile(
+        file,
+        '''
 main() {
   print(42);
 }
diff --git a/pkg/analysis_server/test/analysis/get_hover_test.dart b/pkg/analysis_server/test/analysis/get_hover_test.dart
index 7261b3c..34db510 100644
--- a/pkg/analysis_server/test/analysis/get_hover_test.dart
+++ b/pkg/analysis_server/test/analysis/get_hover_test.dart
@@ -6,14 +6,15 @@
 
 import 'dart:async';
 
-import 'package:analysis_server/src/protocol.dart';
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 import 'package:unittest/unittest.dart';
 
 import '../analysis_abstract.dart';
+import '../utils.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(AnalysisHoverTest);
 }
 
@@ -167,6 +168,31 @@
     });
   }
 
+  test_expression_parameter() {
+    addTestFile('''
+library my.library;
+class A {
+  /// The method documentation.
+  m(int p) {
+  }
+}
+''');
+    return prepareHover('p) {').then((HoverInformation hover) {
+      // element
+      expect(hover.containingLibraryName, isNull);
+      expect(hover.containingLibraryPath, isNull);
+      expect(hover.containingClassDescription, isNull);
+      expect(hover.dartdoc, 'The method documentation.');
+      expect(hover.elementDescription, 'int p');
+      expect(hover.elementKind, 'parameter');
+      // types
+      expect(hover.staticType, 'int');
+      expect(hover.propagatedType, isNull);
+      // no parameter
+      expect(hover.parameter, isNull);
+    });
+  }
+
   test_expression_syntheticGetter() {
     addTestFile('''
 library my.library;
diff --git a/pkg/analysis_server/test/analysis/get_navigation_test.dart b/pkg/analysis_server/test/analysis/get_navigation_test.dart
index 752ee27..add8b90 100644
--- a/pkg/analysis_server/test/analysis/get_navigation_test.dart
+++ b/pkg/analysis_server/test/analysis/get_navigation_test.dart
@@ -4,22 +4,23 @@
 
 library test.analysis.get_navigation;
 
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/domain_analysis.dart';
-import 'package:analysis_server/src/protocol.dart';
 import 'package:analyzer/file_system/file_system.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 import 'package:unittest/unittest.dart';
 
+import '../utils.dart';
 import 'notification_navigation_test.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(GetNavigationTest);
 }
 
 @reflectiveTest
 class GetNavigationTest extends AbstractNavigationTest {
-  static const String requestId = 'test-getNavigtion';
+  static const String requestId = 'test-getNavigation';
 
   @override
   void setUp() {
@@ -47,7 +48,9 @@
 
   test_fileWithoutContext() {
     String file = '/outside.dart';
-    addFile(file, '''
+    addFile(
+        file,
+        '''
 main() {
   print(42);
 }
@@ -55,6 +58,48 @@
     return _checkInvalid(file, -1, -1);
   }
 
+  test_importDirective() async {
+    addTestFile('''
+import 'dart:math';
+
+main() {
+}''');
+    await waitForTasksFinished();
+    await _getNavigation(testFile, 0, 17);
+    expect(regions, hasLength(1));
+    assertHasRegionString("'dart:math'");
+    expect(testTargets, hasLength(1));
+    expect(testTargets[0].kind, ElementKind.LIBRARY);
+  }
+
+  test_importKeyword() async {
+    addTestFile('''
+import 'dart:math';
+
+main() {
+}''');
+    await waitForTasksFinished();
+    await _getNavigation(testFile, 0, 1);
+    expect(regions, hasLength(1));
+    assertHasRegionString("'dart:math'");
+    expect(testTargets, hasLength(1));
+    expect(testTargets[0].kind, ElementKind.LIBRARY);
+  }
+
+  test_importUri() async {
+    addTestFile('''
+import 'dart:math';
+
+main() {
+}''');
+    await waitForTasksFinished();
+    await _getNavigation(testFile, 7, 11);
+    expect(regions, hasLength(1));
+    assertHasRegionString("'dart:math'");
+    expect(testTargets, hasLength(1));
+    expect(testTargets[0].kind, ElementKind.LIBRARY);
+  }
+
   test_multipleRegions() async {
     addTestFile('''
 main() {
@@ -85,6 +130,52 @@
     assertNoRegionAt('ddd)');
   }
 
+  test_operator_index() async {
+    addTestFile('''
+class A {
+  A operator [](index) => null;
+  operator []=(index, A value) {}
+}
+main() {
+  var a = new A();
+  a[0] // [];
+  a[1] = 1; // []=;
+  a[2] += 2;
+}
+''');
+    await waitForTasksFinished();
+    {
+      String search = '[0';
+      await _getNavigation(testFile, testCode.indexOf(search), 1);
+      assertHasOperatorRegion(search, 1, '[](index)', 2);
+    }
+    {
+      String search = '] // []';
+      await _getNavigation(testFile, testCode.indexOf(search), 1);
+      assertHasOperatorRegion(search, 1, '[](index)', 2);
+    }
+    {
+      String search = '[1';
+      await _getNavigation(testFile, testCode.indexOf(search), 1);
+      assertHasOperatorRegion(search, 1, '[]=(index', 3);
+    }
+    {
+      String search = '] = 1';
+      await _getNavigation(testFile, testCode.indexOf(search), 1);
+      assertHasOperatorRegion(search, 1, '[]=(index', 3);
+    }
+    {
+      String search = '[2';
+      await _getNavigation(testFile, testCode.indexOf(search), 1);
+      assertHasOperatorRegion(search, 1, '[]=(index', 3);
+    }
+    {
+      String search = '] += 2';
+      await _getNavigation(testFile, testCode.indexOf(search), 1);
+      assertHasOperatorRegion(search, 1, '[]=(index', 3);
+    }
+  }
+
   test_removeContextAfterRequest() async {
     addTestFile('''
 main() {
diff --git a/pkg/analysis_server/test/analysis/notification_analysis_options_test.dart b/pkg/analysis_server/test/analysis/notification_analysis_options_test.dart
new file mode 100644
index 0000000..1d4c9d1
--- /dev/null
+++ b/pkg/analysis_server/test/analysis/notification_analysis_options_test.dart
@@ -0,0 +1,233 @@
+// 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 test.analysis.notification.analysis_options;
+
+import 'package:analysis_server/plugin/protocol/protocol.dart';
+import 'package:analysis_server/src/constants.dart';
+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_reflective_loader/test_reflective_loader.dart';
+import 'package:unittest/unittest.dart';
+
+import '../analysis_abstract.dart';
+import '../mocks.dart';
+import '../utils.dart';
+
+main() {
+  initializeTestEnvironment();
+  defineReflectiveTests(AnalysisOptionsFileNotificationTest);
+}
+
+@reflectiveTest
+class AnalysisOptionsFileNotificationTest extends AbstractAnalysisTest {
+  /// Cached model state in case tests need to set task model to on/off.
+  bool wasTaskModelEnabled;
+
+  Map<String, List<AnalysisError>> filesErrors = {};
+
+  final testSource = '''
+main() {
+  var x = '';
+  int y = x; // Not assignable in strong-mode
+  print(y);
+}''';
+
+  List<AnalysisError> get errors => filesErrors[testFile];
+
+  List<AnalysisError> get optionsFileErrors => filesErrors[optionsFilePath];
+
+  String get optionsFilePath => '$projectPath/.analysis_options';
+
+  AnalysisContext get testContext => server.getContainingContext(testFile);
+
+  void addOptionsFile(String contents) {
+    addFile(optionsFilePath, contents);
+  }
+
+  void deleteFile(String filePath) {
+    resourceProvider.deleteFile(filePath);
+  }
+
+  @override
+  void processNotification(Notification notification) {
+    if (notification.event == ANALYSIS_ERRORS) {
+      var decoded = new AnalysisErrorsParams.fromNotification(notification);
+      filesErrors[decoded.file] = decoded.errors;
+    }
+  }
+
+  void setAnalysisRoot() {
+    Request request =
+        new AnalysisSetAnalysisRootsParams([projectPath], []).toRequest('0');
+    handleSuccessfulRequest(request);
+  }
+
+  void setStrongMode(bool isSet) {
+    addOptionsFile('''
+analyzer:
+  strong-mode: $isSet
+''');
+  }
+
+  @override
+  void setUp() {
+    super.setUp();
+    server.handlers = [new AnalysisDomainHandler(server)];
+    wasTaskModelEnabled = AnalysisEngine.instance.useTaskModel;
+    AnalysisEngine.instance.useTaskModel = true;
+  }
+
+  @override
+  void tearDown() {
+    AnalysisEngine.instance.useTaskModel = wasTaskModelEnabled;
+    super.tearDown();
+  }
+
+  test_lint_options_changes() async {
+    addOptionsFile('''
+linter:
+  rules:
+    - camel_case_types
+    - constant_identifier_names
+''');
+
+    addTestFile(testSource);
+    setAnalysisRoot();
+
+    await waitForTasksFinished();
+
+    verifyLintsEnabled(['camel_case_types', 'constant_identifier_names']);
+
+    addOptionsFile('''
+linter:
+  rules:
+    - camel_case_types
+''');
+
+    await pumpEventQueue();
+    await waitForTasksFinished();
+
+    verifyLintsEnabled(['camel_case_types']);
+  }
+
+  test_lint_options_unsupported() async {
+    addOptionsFile('''
+linter:
+  rules:
+    - unsupported
+''');
+
+    addTestFile(testSource);
+    setAnalysisRoot();
+
+    await waitForTasksFinished();
+
+    expect(optionsFileErrors, hasLength(1));
+    expect(optionsFileErrors.first.severity, AnalysisErrorSeverity.WARNING);
+    expect(optionsFileErrors.first.type, AnalysisErrorType.STATIC_WARNING);
+  }
+
+  test_options_file_added() async {
+    addTestFile(testSource);
+    setAnalysisRoot();
+
+    await waitForTasksFinished();
+
+    // Verify strong-mode disabled.
+    verifyStrongMode(enabled: false);
+
+    // Clear errors.
+    filesErrors[testFile] = [];
+
+    // Add options file with strong mode enabled.
+    setStrongMode(true);
+
+    await pumpEventQueue();
+    await waitForTasksFinished();
+
+    verifyStrongMode(enabled: true);
+  }
+
+  test_options_file_parse_error() async {
+    addOptionsFile('''
+; #bang
+''');
+    setAnalysisRoot();
+
+    await waitForTasksFinished();
+
+    expect(optionsFileErrors, hasLength(1));
+    expect(optionsFileErrors.first.severity, AnalysisErrorSeverity.ERROR);
+    expect(optionsFileErrors.first.type, AnalysisErrorType.COMPILE_TIME_ERROR);
+  }
+
+  test_options_file_removed() async {
+    setStrongMode(true);
+
+    addTestFile(testSource);
+    setAnalysisRoot();
+
+    await waitForTasksFinished();
+
+    verifyStrongMode(enabled: true);
+
+    // Clear errors.
+    filesErrors[testFile] = [];
+
+    deleteFile(optionsFilePath);
+
+    await pumpEventQueue();
+    await waitForTasksFinished();
+
+    verifyStrongMode(enabled: false);
+  }
+
+  test_strong_mode_changed() async {
+    setStrongMode(true);
+
+    addTestFile(testSource);
+    setAnalysisRoot();
+
+    await waitForTasksFinished();
+
+    verifyStrongMode(enabled: true);
+
+    // Clear errors.
+    filesErrors[testFile] = [];
+
+    setStrongMode(false);
+
+    await pumpEventQueue();
+    await waitForTasksFinished();
+
+    verifyStrongMode(enabled: false);
+  }
+
+  void verifyLintsEnabled(List<String> lints) {
+    expect(testContext.analysisOptions.lint, true);
+    var rules = getLints(testContext).map((rule) => rule.name);
+    expect(rules, unorderedEquals(lints));
+  }
+
+  verifyStrongMode({bool enabled}) {
+    // Verify strong-mode enabled.
+    expect(testContext.analysisOptions.strongMode, enabled);
+
+    if (enabled) {
+      // Should produce a warning and an error.
+      expect(
+          errors.map((error) => error.type),
+          unorderedEquals([
+            AnalysisErrorType.STATIC_TYPE_WARNING,
+            AnalysisErrorType.COMPILE_TIME_ERROR
+          ]));
+    } else {
+      // Should only produce a hint.
+      expect(errors.map((error) => error.type),
+          unorderedEquals([AnalysisErrorType.HINT]));
+    }
+  }
+}
diff --git a/pkg/analysis_server/test/analysis/notification_analyzedFiles_test.dart b/pkg/analysis_server/test/analysis/notification_analyzedFiles_test.dart
index c4fbf14..13c5073 100644
--- a/pkg/analysis_server/test/analysis/notification_analyzedFiles_test.dart
+++ b/pkg/analysis_server/test/analysis/notification_analyzedFiles_test.dart
@@ -6,16 +6,17 @@
 
 import 'dart:async';
 
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/constants.dart';
-import 'package:analysis_server/src/protocol.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() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(AnalysisNotificationAnalyzedFilesTest);
 }
 
diff --git a/pkg/analysis_server/test/analysis/notification_errors_test.dart b/pkg/analysis_server/test/analysis/notification_errors_test.dart
index 3375ba4..46de68d 100644
--- a/pkg/analysis_server/test/analysis/notification_errors_test.dart
+++ b/pkg/analysis_server/test/analysis/notification_errors_test.dart
@@ -4,16 +4,20 @@
 
 library test.analysis.notification_errors;
 
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/constants.dart';
 import 'package:analysis_server/src/domain_analysis.dart';
-import 'package:analysis_server/src/protocol.dart';
+import 'package:analyzer/src/generated/engine.dart';
+import 'package:analyzer/src/services/lint.dart';
+import 'package:linter/src/linter.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 import 'package:unittest/unittest.dart';
 
 import '../analysis_abstract.dart';
+import '../utils.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(NotificationErrorsTest);
 }
 
@@ -21,6 +25,9 @@
 class NotificationErrorsTest extends AbstractAnalysisTest {
   Map<String, List<AnalysisError>> filesErrors = {};
 
+  /// Cached model state in case tests need to set task model to on/off.
+  bool wasTaskModelEnabled;
+
   void processNotification(Notification notification) {
     if (notification.event == ANALYSIS_ERRORS) {
       var decoded = new AnalysisErrorsParams.fromNotification(notification);
@@ -32,6 +39,69 @@
   void setUp() {
     super.setUp();
     server.handlers = [new AnalysisDomainHandler(server),];
+    wasTaskModelEnabled = AnalysisEngine.instance.useTaskModel;
+  }
+
+  @override
+  void tearDown() {
+    AnalysisEngine.instance.useTaskModel = wasTaskModelEnabled;
+    super.tearDown();
+  }
+
+  test_importError() {
+    createProject();
+
+    addTestFile('''
+import 'does_not_exist.dart';
+''');
+    return waitForTasksFinished().then((_) {
+      List<AnalysisError> errors = filesErrors[testFile];
+      // Verify that we are generating only 1 error for the bad URI.
+      // https://github.com/dart-lang/sdk/issues/23754
+      expect(errors, hasLength(1));
+      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'));
+    });
+  }
+
+  test_lintError() {
+    // Requires task model.
+    AnalysisEngine.instance.useTaskModel = true;
+
+    var camelCaseTypesLintName = 'camel_case_types';
+
+    addFile(
+        '$projectPath/.analysis_options',
+        '''
+linter:
+  rules:
+    - $camelCaseTypesLintName
+''');
+
+    addTestFile('class a { }');
+
+    Request request =
+        new AnalysisSetAnalysisRootsParams([projectPath], []).toRequest('0');
+    handleSuccessfulRequest(request);
+
+    return waitForTasksFinished().then((_) {
+      AnalysisContext testContext = server.getContainingContext(testFile);
+      List<Linter> lints = getLints(testContext);
+      // Registry should only contain single lint rule.
+      expect(lints, hasLength(1));
+      LintRule lint = lints.first as LintRule;
+      expect(lint.name, camelCaseTypesLintName);
+      // Verify lint error result.
+      List<AnalysisError> errors = filesErrors[testFile];
+      expect(errors, hasLength(1));
+      AnalysisError error = errors[0];
+      expect(error.location.file, '/project/bin/test.dart');
+      expect(error.severity, AnalysisErrorSeverity.INFO);
+      expect(error.type, AnalysisErrorType.LINT);
+      expect(error.message, lint.description);
+    });
   }
 
   test_notInAnalysisRoot() {
diff --git a/pkg/analysis_server/test/analysis/notification_highlights_test.dart b/pkg/analysis_server/test/analysis/notification_highlights_test.dart
index 5e08e7b..a44d798 100644
--- a/pkg/analysis_server/test/analysis/notification_highlights_test.dart
+++ b/pkg/analysis_server/test/analysis/notification_highlights_test.dart
@@ -6,14 +6,16 @@
 
 import 'dart:async';
 
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/constants.dart';
-import 'package:analysis_server/src/protocol.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);
 }
@@ -995,7 +997,9 @@
   }
 
   void _addLibraryForTestPart() {
-    addFile('$testFolder/my_lib.dart', '''
+    addFile(
+        '$testFolder/my_lib.dart',
+        '''
 library lib;
 part 'test.dart';
     ''');
diff --git a/pkg/analysis_server/test/analysis/notification_highlights_test2.dart b/pkg/analysis_server/test/analysis/notification_highlights_test2.dart
index 7659125..28eda94 100644
--- a/pkg/analysis_server/test/analysis/notification_highlights_test2.dart
+++ b/pkg/analysis_server/test/analysis/notification_highlights_test2.dart
@@ -6,14 +6,16 @@
 
 import 'dart:async';
 
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/constants.dart';
-import 'package:analysis_server/src/protocol.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);
 }
@@ -729,6 +731,19 @@
     });
   }
 
+  test_INSTANCE_FIELD_dynamic() {
+    addTestFile('''
+class A {
+  var f;
+  A(this.f);
+}
+''');
+    return prepareHighlights().then((_) {
+      assertHasRegion(HighlightRegionType.INSTANCE_FIELD_DECLARATION, 'f;');
+      assertHasRegion(HighlightRegionType.INSTANCE_FIELD_REFERENCE, 'f);');
+    });
+  }
+
   test_KEYWORD() {
     addTestFile('''
 main() {
@@ -819,6 +834,25 @@
     });
   }
 
+  test_LIBRARY_NAME_libraryDirective() {
+    addTestFile('''
+library my.lib.name;
+''');
+    return prepareHighlights().then((_) {
+      assertHasStringRegion(HighlightRegionType.LIBRARY_NAME, 'my.lib.name');
+    });
+  }
+
+  test_LIBRARY_NAME_partOfDirective() {
+    _addLibraryForTestPart();
+    addTestFile('''
+part of my.lib.name;
+''');
+    return prepareHighlights().then((_) {
+      assertHasStringRegion(HighlightRegionType.LIBRARY_NAME, 'my.lib.name');
+    });
+  }
+
   test_LITERAL_BOOLEAN() {
     addTestFile('var V = true;');
     return prepareHighlights().then((_) {
@@ -1060,8 +1094,62 @@
     });
   }
 
+  test_UNRESOLVED_INSTANCE_MEMBER_REFERENCE_dynamicVarTarget() {
+    addTestFile('''
+main(p) {
+  p.aaa;
+  p.aaa++;
+  p.aaa += 0;
+  ++p.aaa; // ++
+  p.aaa = 0;
+  p.bbb(0);
+  ''.length.ccc().ddd();
+}
+''');
+    return prepareHighlights().then((_) {
+      HighlightRegionType type =
+          HighlightRegionType.UNRESOLVED_INSTANCE_MEMBER_REFERENCE;
+      assertHasRegion(type, 'aaa');
+      assertHasRegion(type, 'aaa++');
+      assertHasRegion(type, 'aaa += 0');
+      assertHasRegion(type, 'aaa; // ++');
+      assertHasRegion(type, 'aaa =');
+      assertHasRegion(type, 'bbb(');
+      assertHasRegion(type, 'ddd()');
+    });
+  }
+
+  test_UNRESOLVED_INSTANCE_MEMBER_REFERENCE_nonDynamicTarget() {
+    addTestFile('''
+import 'dart:math' as math;
+main(String str) {
+  new Object().aaa();
+  math.bbb();
+  str.ccc();
+}
+class A {
+  m() {
+    unresolved(1);
+    this.unresolved(2);
+    super.unresolved(3);
+  }
+}
+''');
+    return prepareHighlights().then((_) {
+      HighlightRegionType type = HighlightRegionType.IDENTIFIER_DEFAULT;
+      assertHasRegion(type, 'aaa()');
+      assertHasRegion(type, 'bbb()');
+      assertHasRegion(type, 'ccc()');
+      assertHasRegion(type, 'unresolved(1)');
+      assertHasRegion(type, 'unresolved(2)');
+      assertHasRegion(type, 'unresolved(3)');
+    });
+  }
+
   void _addLibraryForTestPart() {
-    addFile('$testFolder/my_lib.dart', '''
+    addFile(
+        '$testFolder/my_lib.dart',
+        '''
 library lib;
 part 'test.dart';
     ''');
diff --git a/pkg/analysis_server/test/analysis/notification_implemented_test.dart b/pkg/analysis_server/test/analysis/notification_implemented_test.dart
new file mode 100644
index 0000000..5c1c6ed
--- /dev/null
+++ b/pkg/analysis_server/test/analysis/notification_implemented_test.dart
@@ -0,0 +1,328 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library test.analysis.notification.implemented;
+
+import 'dart:async';
+
+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:analysis_server/src/services/index/local_memory_index.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);
+}
+
+@reflectiveTest
+class AnalysisNotificationImplementedTest extends AbstractAnalysisTest {
+  List<ImplementedClass> implementedClasses;
+  List<ImplementedMember> implementedMembers;
+
+  /**
+   * Validates that there is an [ImplementedClass] at the offset of [search].
+   *
+   * If [length] is not specified explicitly, then length of an identifier
+   * from [search] is used.
+   */
+  void assertHasImplementedClass(String search, [int length = -1]) {
+    int offset = findOffset(search);
+    if (length == -1) {
+      length = findIdentifierLength(search);
+    }
+    if (implementedClasses == null) {
+      fail('No notification of impemented classes was received');
+    }
+    for (ImplementedClass clazz in implementedClasses) {
+      if (clazz.offset == offset && clazz.length == length) {
+        return;
+      }
+    }
+    fail('Expect to find an implemented class at $offset'
+        ' in $implementedClasses');
+  }
+
+  /**
+   * Validates that there is an [ImplementedClass] at the offset of [search].
+   *
+   * If [length] is not specified explicitly, then length of an identifier
+   * from [search] is used.
+   */
+  void assertHasImplementedMember(String search, [int length = -1]) {
+    int offset = findOffset(search);
+    if (length == -1) {
+      length = findIdentifierLength(search);
+    }
+    if (implementedMembers == null) {
+      fail('No notification of impemented members was received');
+    }
+    for (ImplementedMember member in implementedMembers) {
+      if (member.offset == offset && member.length == length) {
+        return;
+      }
+    }
+    fail('Expect to find an implemented member at $offset'
+        ' in $implementedMembers');
+  }
+
+  /**
+   * Validates that there is no an [ImplementedClass] at the offset of [search].
+   *
+   * If [length] is not specified explicitly, then length of an identifier
+   * from [search] is used.
+   */
+  void assertNoImplementedMember(String search, [int length = -1]) {
+    int offset = findOffset(search);
+    if (length == -1) {
+      length = findIdentifierLength(search);
+    }
+    if (implementedMembers == null) {
+      fail('No notification of impemented members was received');
+    }
+    for (ImplementedMember member in implementedMembers) {
+      if (member.offset == offset) {
+        fail('Unexpected implemented member at $offset'
+            ' in $implementedMembers');
+      }
+    }
+  }
+
+  @override
+  Index createIndex() {
+    return createLocalMemoryIndex();
+  }
+
+  /**
+   * Subscribe for `IMPLEMENTED` and wait for the notification.
+   */
+  Future prepareImplementedElements() {
+    subscribeForImplemented();
+    return waitForImplementedElements();
+  }
+
+  void processNotification(Notification notification) {
+    if (notification.event == ANALYSIS_IMPLEMENTED) {
+      var params = new AnalysisImplementedParams.fromNotification(notification);
+      if (params.file == testFile) {
+        implementedClasses = params.classes;
+        implementedMembers = params.members;
+      }
+    }
+  }
+
+  void setUp() {
+    super.setUp();
+    createProject();
+  }
+
+  void subscribeForImplemented() {
+    addAnalysisSubscription(AnalysisService.IMPLEMENTED, testFile);
+  }
+
+  test_afterAnalysis() async {
+    addTestFile('''
+class A {}
+class B extends A {}
+''');
+    await waitForTasksFinished();
+    await prepareImplementedElements();
+    assertHasImplementedClass('A {');
+  }
+
+  test_afterIncrementalResolution() async {
+    subscribeForImplemented();
+    addTestFile('''
+class A {}
+class B extends A {}
+''');
+    await prepareImplementedElements();
+    assertHasImplementedClass('A {');
+    // add a space
+    implementedClasses = null;
+    testCode = '''
+class A  {}
+class B extends A {}
+''';
+    server.updateContent('1', {testFile: new AddContentOverlay(testCode)});
+    await waitForImplementedElements();
+    assertHasImplementedClass('A  {');
+  }
+
+  test_class_extended() async {
+    addTestFile('''
+class A {}
+class B extends A {}
+''');
+    await prepareImplementedElements();
+    assertHasImplementedClass('A {');
+  }
+
+  test_class_implemented() async {
+    addTestFile('''
+class A {}
+class B implements A {}
+''');
+    await prepareImplementedElements();
+    assertHasImplementedClass('A {');
+  }
+
+  test_class_mixed() async {
+    addTestFile('''
+class A {}
+class B = Object with A;
+''');
+    await prepareImplementedElements();
+    assertHasImplementedClass('A {');
+  }
+
+  test_field_withField() async {
+    addTestFile('''
+class A {
+  int f; // A
+}
+class B extends A {
+  int f;
+}
+''');
+    await prepareImplementedElements();
+    assertHasImplementedMember('f; // A');
+  }
+
+  test_field_withGetter() async {
+    addTestFile('''
+class A {
+  int f; // A
+}
+class B extends A {
+  get f => null;
+}
+''');
+    await prepareImplementedElements();
+    assertHasImplementedMember('f; // A');
+  }
+
+  test_field_withSetter() async {
+    addTestFile('''
+class A {
+  int f; // A
+}
+class B extends A {
+  void set f(_) {}
+}
+''');
+    await prepareImplementedElements();
+    assertHasImplementedMember('f; // A');
+  }
+
+  test_getter_withField() async {
+    addTestFile('''
+class A {
+  get f => null; // A
+}
+class B extends A {
+  int f;
+}
+''');
+    await prepareImplementedElements();
+    assertHasImplementedMember('f => null; // A');
+  }
+
+  test_getter_withGetter() async {
+    addTestFile('''
+class A {
+  get f => null; // A
+}
+class B extends A {
+  get f => null;
+}
+''');
+    await prepareImplementedElements();
+    assertHasImplementedMember('f => null; // A');
+  }
+
+  test_method_withMethod() async {
+    addTestFile('''
+class A {
+  m() {} // A
+}
+class B extends A {
+  m() {} // B
+}
+''');
+    await prepareImplementedElements();
+    assertHasImplementedMember('m() {} // A');
+    assertNoImplementedMember('m() {} // B');
+  }
+
+  test_method_withMethod_indirectSubclass() async {
+    addTestFile('''
+class A {
+  m() {} // A
+}
+class B extends A {
+}
+class C extends A {
+  m() {}
+}
+''');
+    await prepareImplementedElements();
+    assertHasImplementedMember('m() {} // A');
+  }
+
+  test_method_withMethod_wasAbstract() async {
+    addTestFile('''
+abstract class A {
+  m(); // A
+}
+class B extends A {
+  m() {}
+}
+''');
+    await prepareImplementedElements();
+    assertHasImplementedMember('m(); // A');
+  }
+
+  test_setter_withField() async {
+    addTestFile('''
+class A {
+  set f(_) {} // A
+}
+class B extends A {
+  int f;
+}
+''');
+    await prepareImplementedElements();
+    assertHasImplementedMember('f(_) {} // A');
+  }
+
+  test_setter_withSetter() async {
+    addTestFile('''
+class A {
+  set f(_) {} // A
+}
+class B extends A {
+  set f(_) {} // B
+}
+''');
+    await prepareImplementedElements();
+    assertHasImplementedMember('f(_) {} // A');
+  }
+
+  Future waitForImplementedElements() {
+    Future waitForNotification(int times) {
+      if (times == 0 || implementedClasses != null) {
+        return new Future.value();
+      }
+      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 09de3e8..68b347c 100644
--- a/pkg/analysis_server/test/analysis/notification_navigation_test.dart
+++ b/pkg/analysis_server/test/analysis/notification_navigation_test.dart
@@ -6,15 +6,16 @@
 
 import 'dart:async';
 
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/constants.dart';
-import 'package:analysis_server/src/protocol.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 import 'package:unittest/unittest.dart';
 
 import '../analysis_abstract.dart';
+import '../utils.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(AnalysisNotificationNavigationTest);
 }
 
@@ -25,6 +26,7 @@
 
   NavigationRegion testRegion;
   List<int> testTargetIndexes;
+  List<NavigationTarget> testTargets;
   NavigationTarget testTarget;
 
   /**
@@ -32,8 +34,6 @@
    * at [offset] and with the given [length].
    */
   void assertHasFileTarget(String file, int offset, int length) {
-    List<NavigationTarget> testTargets =
-        testTargetIndexes.map((int index) => targets[index]).toList();
     for (NavigationTarget target in testTargets) {
       if (targetFiles[target.fileIndex] == file &&
           target.offset == offset &&
@@ -44,7 +44,8 @@
     }
     fail(
         'Expected to find target (file=$file; offset=$offset; length=$length) in\n'
-        '${testRegion} in\n' '${testTargets.join('\n')}');
+        '${testRegion} in\n'
+        '${testTargets.join('\n')}');
   }
 
   void assertHasOperatorRegion(String regionSearch, int regionLength,
@@ -101,6 +102,14 @@
   }
 
   /**
+   * Validates that there is a target in [testTargets]  with [testFile], at the
+   * offset of [str] in [testFile], and with the length of  [str].
+   */
+  void assertHasTargetString(String str) {
+    assertHasTarget(str, str.length);
+  }
+
+  /**
    * Validates that there is no a region at [search] and with the given
    * [length].
    */
@@ -157,6 +166,7 @@
         }
         testRegion = region;
         testTargetIndexes = region.targets;
+        testTargets = testTargetIndexes.map((i) => targets[i]).toList();
         return;
       }
     }
@@ -205,6 +215,113 @@
     });
   }
 
+  test_annotationConstructor_implicit() async {
+    addTestFile('''
+class A {
+}
+@A()
+main() {
+}
+''');
+    await prepareNavigation();
+    assertHasRegionString('A()', 'A'.length);
+    assertHasTarget('A {');
+  }
+
+  test_annotationConstructor_importPrefix() async {
+    addFile(
+        '$testFolder/my_annotation.dart',
+        r'''
+library an;
+class MyAnnotation {
+  const MyAnnotation();
+  const MyAnnotation.named();
+}
+''');
+    addTestFile('''
+import 'my_annotation.dart' as man;
+@man.MyAnnotation()
+@man.MyAnnotation.named()
+main() {
+}
+''');
+    await prepareNavigation();
+    assertHasRegion('MyAnnotation()');
+    assertHasRegion('MyAnnotation.named()');
+    assertHasRegion('named()');
+    {
+      assertHasRegion('man.MyAnnotation()');
+      assertHasTarget('man;');
+    }
+    {
+      assertHasRegion('man.MyAnnotation.named()');
+      assertHasTarget('man;');
+    }
+  }
+
+  test_annotationConstructor_named() async {
+    addTestFile('''
+class A {
+  const A.named(p);
+}
+@A.named(0)
+main() {
+}
+''');
+    await prepareNavigation();
+    {
+      assertHasRegion('A.named(0)');
+      assertHasTarget('named(p);');
+    }
+    {
+      assertHasRegion('named(0)');
+      assertHasTarget('named(p);');
+    }
+  }
+
+  test_annotationConstructor_unnamed() async {
+    addTestFile('''
+class A {
+  const A();
+}
+@A()
+main() {
+}
+''');
+    await prepareNavigation();
+    assertHasRegionString('A()', 'A'.length);
+    assertHasTarget('A();', 0);
+  }
+
+  test_annotationField() async {
+    addTestFile('''
+const myan = new Object();
+@myan // ref
+main() {
+}
+''');
+    await prepareNavigation();
+    assertHasRegion('myan // ref');
+    assertHasTarget('myan = new Object();');
+  }
+
+  test_annotationField_importPrefix() async {
+    addFile(
+        '$testFolder/mayn.dart',
+        r'''
+library an;
+const myan = new Object();
+''');
+    addTestFile('''
+import 'mayn.dart' as man;
+@man.myan // ref
+main() {
+}
+''');
+    await prepareNavigation();
+    assertHasRegion('myan // ref');
+  }
+
   test_class_fromSDK() {
     addTestFile('''
 int V = 42;
@@ -579,6 +696,16 @@
     });
   }
 
+  test_library() {
+    addTestFile('''
+library my.lib;
+''');
+    return prepareNavigation().then((_) {
+      assertHasRegionString('my.lib');
+      assertHasTargetString('my.lib');
+    });
+  }
+
   test_multiplyDefinedElement() {
     addFile('$projectPath/bin/libA.dart', 'library A; int TEST = 1;');
     addFile('$projectPath/bin/libB.dart', 'library B; int TEST = 2;');
@@ -650,8 +777,11 @@
 }
 ''');
     return prepareNavigation().then((_) {
+      assertHasOperatorRegion('[0', 1, '[](index)', 2);
       assertHasOperatorRegion('] // []', 1, '[](index)', 2);
+      assertHasOperatorRegion('[1', 1, '[]=(index,', 3);
       assertHasOperatorRegion('] = 1;', 1, '[]=(index,', 3);
+      assertHasOperatorRegion('[2', 1, '[]=(index,', 3);
       assertHasOperatorRegion('] += 2;', 1, '[]=(index,', 3);
       assertHasOperatorRegion('+= 2;', 2, '+(other)', 1);
     });
@@ -662,7 +792,7 @@
     var libFile = addFile('$projectPath/bin/lib.dart', libCode);
     addTestFile('part of lib;');
     return prepareNavigation().then((_) {
-      assertHasRegionString('part of lib');
+      assertHasRegionString('lib');
       assertHasFileTarget(libFile, libCode.indexOf('lib;'), 'lib'.length);
     });
   }
diff --git a/pkg/analysis_server/test/analysis/notification_occurrences_test.dart b/pkg/analysis_server/test/analysis/notification_occurrences_test.dart
index d7f8779..cc7ebab 100644
--- a/pkg/analysis_server/test/analysis/notification_occurrences_test.dart
+++ b/pkg/analysis_server/test/analysis/notification_occurrences_test.dart
@@ -6,15 +6,16 @@
 
 import 'dart:async';
 
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/constants.dart';
-import 'package:analysis_server/src/protocol.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 import 'package:unittest/unittest.dart';
 
 import '../analysis_abstract.dart';
+import '../utils.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(AnalysisNotificationOccurrencesTest);
 }
 
diff --git a/pkg/analysis_server/test/analysis/notification_outline_test.dart b/pkg/analysis_server/test/analysis/notification_outline_test.dart
index 6311762..679baae 100644
--- a/pkg/analysis_server/test/analysis/notification_outline_test.dart
+++ b/pkg/analysis_server/test/analysis/notification_outline_test.dart
@@ -6,19 +6,23 @@
 
 import 'dart:async';
 
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/constants.dart';
-import 'package:analysis_server/src/protocol.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);
 }
 
 @reflectiveTest
 class _AnalysisNotificationOutlineTest extends AbstractAnalysisTest {
+  FileKind fileKind;
+  String libraryName;
   Outline outline;
 
   Future prepareOutline() {
@@ -30,6 +34,8 @@
     if (notification.event == ANALYSIS_OUTLINE) {
       var params = new AnalysisOutlineParams.fromNotification(notification);
       if (params.file == testFile) {
+        fileKind = params.kind;
+        libraryName = params.libraryName;
         outline = params.outline;
       }
     }
@@ -309,6 +315,43 @@
     });
   }
 
+  test_libraryName_hasLibraryDirective() async {
+    addTestFile('''
+library my.lib;
+''');
+    await prepareOutline();
+    expect(fileKind, FileKind.LIBRARY);
+    expect(libraryName, 'my.lib');
+  }
+
+  test_libraryName_hasLibraryPartOfDirectives() async {
+    addTestFile('''
+part of lib.in.part.of;
+library my.lib;
+''');
+    await prepareOutline();
+    expect(fileKind, FileKind.LIBRARY);
+    expect(libraryName, 'my.lib');
+  }
+
+  test_libraryName_hasPartOfDirective() async {
+    addTestFile('''
+part of my.lib;
+''');
+    await prepareOutline();
+    expect(fileKind, FileKind.PART);
+    expect(libraryName, 'my.lib');
+  }
+
+  test_libraryName_noDirectives() async {
+    addTestFile('''
+class A {}
+''');
+    await prepareOutline();
+    expect(fileKind, FileKind.LIBRARY);
+    expect(libraryName, isNull);
+  }
+
   test_localFunctions() {
     addTestFile('''
 class A {
@@ -575,6 +618,8 @@
 
   test_sourceRange_inUnit() {
     addTestFile('''
+library lib;
+/// My first class.
 class A {
 } // endA
 class B {
@@ -591,7 +636,7 @@
         expect(element.kind, ElementKind.CLASS);
         expect(element.name, "A");
         {
-          int offset = 0;
+          int offset = testCode.indexOf("/// My first class.");
           int end = testCode.indexOf(" // endA");
           expect(outline.offset, offset);
           expect(outline.length, end - offset);
diff --git a/pkg/analysis_server/test/analysis/notification_overrides_test.dart b/pkg/analysis_server/test/analysis/notification_overrides_test.dart
index 86b1dc1..fa1a0b5 100644
--- a/pkg/analysis_server/test/analysis/notification_overrides_test.dart
+++ b/pkg/analysis_server/test/analysis/notification_overrides_test.dart
@@ -6,15 +6,16 @@
 
 import 'dart:async';
 
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/constants.dart';
-import 'package:analysis_server/src/protocol.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 import 'package:unittest/unittest.dart';
 
 import '../analysis_abstract.dart';
+import '../utils.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(AnalysisNotificationOverridesTest);
 }
 
@@ -226,6 +227,58 @@
     });
   }
 
+  test_interface_stopWhenFound() {
+    addTestFile('''
+class A {
+  m() {} // in A
+}
+class B extends A {
+  m() {} // in B
+}
+class C implements B {
+  m() {} // in C
+}
+''');
+    return prepareOverrides().then((_) {
+      assertHasOverride('m() {} // in C');
+      expect(override.interfaceMembers, hasLength(1));
+      assertHasInterfaceMember('m() {} // in B');
+    });
+  }
+
+  test_mix_sameMethod() {
+    addTestFile('''
+class A {
+  m() {} // in A
+}
+abstract class B extends A {
+}
+class C extends A implements A {
+  m() {} // in C
+}
+''');
+    return prepareOverrides().then((_) {
+      assertHasOverride('m() {} // in C');
+      assertHasSuperElement('m() {} // in A');
+      assertNoInterfaceMembers();
+    });
+  }
+
+  test_mix_sameMethod_Object_hashCode() {
+    addTestFile('''
+class A {}
+abstract class B {}
+class C extends A implements A {
+  int get hashCode => 42;
+}
+''');
+    return prepareOverrides().then((_) {
+      assertHasOverride('hashCode => 42;');
+      expect(override.superclassMember, isNotNull);
+      expect(override.interfaceMembers, isNull);
+    });
+  }
+
   test_staticMembers() {
     addTestFile('''
 class A {
diff --git a/pkg/analysis_server/test/analysis/reanalyze_test.dart b/pkg/analysis_server/test/analysis/reanalyze_test.dart
index 0884fdb..310e6d7 100644
--- a/pkg/analysis_server/test/analysis/reanalyze_test.dart
+++ b/pkg/analysis_server/test/analysis/reanalyze_test.dart
@@ -4,16 +4,17 @@
 
 library test.analysis.reanalyze;
 
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/constants.dart';
-import 'package:analysis_server/src/protocol.dart';
 import 'package:analyzer/src/generated/engine.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 import 'package:unittest/unittest.dart';
 
 import '../analysis_abstract.dart';
+import '../utils.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(ReanalyzeTest);
 }
 
diff --git a/pkg/analysis_server/test/analysis/set_priority_files_test.dart b/pkg/analysis_server/test/analysis/set_priority_files_test.dart
new file mode 100644
index 0000000..8626ef8
--- /dev/null
+++ b/pkg/analysis_server/test/analysis/set_priority_files_test.dart
@@ -0,0 +1,62 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library test.analysis.set_priority_files;
+
+import 'package:analysis_server/plugin/protocol/protocol.dart';
+import 'package:analysis_server/src/domain_analysis.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);
+}
+
+@reflectiveTest
+class SetPriorityFilesTest extends AbstractAnalysisTest {
+  @override
+  void setUp() {
+    super.setUp();
+    server.handlers = [new AnalysisDomainHandler(server),];
+    createProject();
+  }
+
+  test_fileDoesNotExist() async {
+    String file = '$projectPath/doesNotExist.dart';
+    Response response = await _setPriorityFile(file);
+    expect(response, isResponseSuccess('0'));
+  }
+
+  test_fileInAnalysisRoot() async {
+    addTestFile('');
+    Response response = await _setPriorityFile(testFile);
+    expect(response, isResponseSuccess('0'));
+  }
+
+  test_fileInSdk() async {
+    addTestFile('');
+    await server.onAnalysisComplete;
+    Response response = await _setPriorityFile('/lib/convert/convert.dart');
+    expect(response, isResponseSuccess('0'));
+  }
+
+  test_fileNotInAnalysisRoot() async {
+    String path = '/other/file.dart';
+    addFile(path, '');
+    Response response = await _setPriorityFile(path);
+    expect(response.error, isNotNull);
+    expect(response.error.code, RequestErrorCode.UNANALYZED_PRIORITY_FILES);
+  }
+
+  _setPriorityFile(String file) async {
+    Request request =
+        new AnalysisSetPriorityFilesParams(<String>[file]).toRequest('0');
+    return await serverChannel.sendRequest(request);
+  }
+}
diff --git a/pkg/analysis_server/test/analysis/test_all.dart b/pkg/analysis_server/test/analysis/test_all.dart
index 69e0e9b..05b49f3d 100644
--- a/pkg/analysis_server/test/analysis/test_all.dart
+++ b/pkg/analysis_server/test/analysis/test_all.dart
@@ -5,37 +5,44 @@
 
 import 'package:unittest/unittest.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;
+import 'notification_analysis_options_test.dart' as notification_analysis_options_test;
 import 'notification_analyzedFiles_test.dart'
     as notification_analyzedFiles_test;
 import 'notification_errors_test.dart' as notification_errors_test;
 import 'notification_highlights_test.dart' as notification_highlights_test;
 import 'notification_highlights_test2.dart' as notification_highlights_test2;
+import 'notification_implemented_test.dart' as notification_implemented_test;
 import 'notification_navigation_test.dart' as notification_navigation_test;
 import 'notification_occurrences_test.dart' as notification_occurrences_test;
 import 'notification_outline_test.dart' as notification_outline_test;
 import 'notification_overrides_test.dart' as notification_overrides_test;
+import 'set_priority_files_test.dart' as set_priority_files_test;
 import 'update_content_test.dart' as update_content_test;
 
 /**
  * Utility for manually running all tests.
  */
 main() {
-  groupSep = ' | ';
-  group('search', () {
+  initializeTestEnvironment();
+  group('analysis', () {
     get_errors_test.main();
     get_hover_test.main();
     get_navigation_test.main();
+    notification_analysis_options_test.main();
     notification_analyzedFiles_test.main();
     notification_errors_test.main();
     notification_highlights_test.main();
     notification_highlights_test2.main();
+    notification_implemented_test.main();
     notification_navigation_test.main();
     notification_occurrences_test.main();
     notification_outline_test.main();
     notification_overrides_test.main();
+    set_priority_files_test.main();
     update_content_test.main();
   });
 }
diff --git a/pkg/analysis_server/test/analysis/update_content_test.dart b/pkg/analysis_server/test/analysis/update_content_test.dart
index 135ce6a..6fbc5d8 100644
--- a/pkg/analysis_server/test/analysis/update_content_test.dart
+++ b/pkg/analysis_server/test/analysis/update_content_test.dart
@@ -4,9 +4,9 @@
 
 library test.analysis.updateContent;
 
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/analysis_server.dart';
 import 'package:analysis_server/src/constants.dart';
-import 'package:analysis_server/src/protocol.dart';
 import 'package:analysis_server/src/services/index/index.dart';
 import 'package:analyzer/file_system/file_system.dart';
 import 'package:analyzer/src/generated/ast.dart';
@@ -17,9 +17,10 @@
 import 'package:unittest/unittest.dart';
 
 import '../analysis_abstract.dart';
+import '../utils.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(UpdateContentTest);
 }
 
@@ -55,8 +56,9 @@
     createProject();
     addTestFile('');
     await server.onAnalysisComplete;
-    server.setAnalysisSubscriptions(
-        {AnalysisService.NAVIGATION: [testFile].toSet()});
+    server.setAnalysisSubscriptions({
+      AnalysisService.NAVIGATION: [testFile].toSet()
+    });
     // update file, analyze, but don't sent notifications
     navigationCount = 0;
     server.updateContent('1', {testFile: new AddContentOverlay('foo() {}')});
@@ -93,7 +95,7 @@
     createProject();
     addTestFile('main() { print(1); }');
     await server.onAnalysisComplete;
-    verify(server.index.indexUnit(anyObject, testUnitMatcher)).times(1);
+    verify(server.index.index(anyObject, testUnitMatcher)).times(1);
     // add an overlay
     server.updateContent(
         '1', {testFile: new AddContentOverlay('main() { print(2); }')});
@@ -105,22 +107,32 @@
     server.updateContent('2', {testFile: new RemoveContentOverlay()});
     // Validate that at the end the unit was indexed.
     await server.onAnalysisComplete;
-    verify(server.index.indexUnit(anyObject, testUnitMatcher)).times(2);
+    if (AnalysisEngine.instance.useTaskModel) {
+      verify(server.index.index(anyObject, testUnitMatcher)).times(3);
+    } else {
+      verify(server.index.index(anyObject, testUnitMatcher)).times(2);
+    }
   }
 
   test_multiple_contexts() async {
     String fooPath = '/project1/foo.dart';
-    resourceProvider.newFile(fooPath, '''
+    resourceProvider.newFile(
+        fooPath,
+        '''
 library foo;
 import '../project2/baz.dart';
 main() { f(); }''');
     String barPath = '/project2/bar.dart';
-    resourceProvider.newFile(barPath, '''
+    resourceProvider.newFile(
+        barPath,
+        '''
 library bar;
 import 'baz.dart';
 main() { f(); }''');
     String bazPath = '/project2/baz.dart';
-    resourceProvider.newFile(bazPath, '''
+    resourceProvider.newFile(
+        bazPath,
+        '''
 library baz;
 f(int i) {}
 ''');
diff --git a/pkg/analysis_server/test/analysis_abstract.dart b/pkg/analysis_server/test/analysis_abstract.dart
index 539f718..c367665 100644
--- a/pkg/analysis_server/test/analysis_abstract.dart
+++ b/pkg/analysis_server/test/analysis_abstract.dart
@@ -6,16 +6,20 @@
 
 import 'dart:async';
 
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/analysis_server.dart';
 import 'package:analysis_server/src/constants.dart';
 import 'package:analysis_server/src/domain_analysis.dart';
+import 'package:analysis_server/src/plugin/linter_plugin.dart';
 import 'package:analysis_server/src/plugin/server_plugin.dart';
-import 'package:analysis_server/src/protocol.dart';
 import 'package:analysis_server/src/services/index/index.dart';
 import 'package:analyzer/file_system/file_system.dart';
 import 'package:analyzer/file_system/memory_file_system.dart';
 import 'package:analyzer/instrumentation/instrumentation.dart';
+import 'package:analyzer/src/generated/engine.dart';
+import 'package:linter/src/plugin/linter_plugin.dart';
 import 'package:plugin/manager.dart';
+import 'package:plugin/plugin.dart';
 import 'package:unittest/unittest.dart';
 
 import 'mock_sdk.dart';
@@ -51,7 +55,7 @@
   final Map<AnalysisService, List<String>> analysisSubscriptions = {};
 
   String projectPath = '/project';
-  String testFolder = '/project/bin/';
+  String testFolder = '/project/bin';
   String testFile = '/project/bin/test.dart';
   String testCode;
 
@@ -83,6 +87,8 @@
     handleSuccessfulRequest(request);
   }
 
+  void addServerPlugins(List<Plugin> plugins) {}
+
   String addTestFile(String content) {
     addFile(testFile, content);
     this.testCode = content;
@@ -90,12 +96,30 @@
   }
 
   AnalysisServer createAnalysisServer(Index index) {
-    ExtensionManager manager = new ExtensionManager();
     ServerPlugin serverPlugin = new ServerPlugin();
-    manager.processPlugins([serverPlugin]);
-    return new AnalysisServer(serverChannel, resourceProvider,
-        packageMapProvider, index, serverPlugin, new AnalysisServerOptions(),
-        new MockSdk(), InstrumentationService.NULL_SERVICE);
+    // TODO(pq): this convoluted extension registry dance needs cleanup.
+    List<Plugin> plugins = <Plugin>[
+      serverPlugin,
+      linterPlugin,
+      linterServerPlugin
+    ];
+    // Accessing `taskManager` ensures that AE plugins are registered.
+    AnalysisEngine.instance.taskManager;
+    plugins.addAll(AnalysisEngine.instance.supportedPlugins);
+    addServerPlugins(plugins);
+    // process plugins
+    ExtensionManager manager = new ExtensionManager();
+    manager.processPlugins(plugins);
+    // create server
+    return new AnalysisServer(
+        serverChannel,
+        resourceProvider,
+        packageMapProvider,
+        index,
+        serverPlugin,
+        new AnalysisServerOptions(),
+        new MockSdk(),
+        InstrumentationService.NULL_SERVICE);
   }
 
   Index createIndex() {
@@ -169,7 +193,8 @@
     packageMapProvider = new MockPackageMapProvider();
     Index index = createIndex();
     server = createAnalysisServer(index);
-    handler = new AnalysisDomainHandler(server);
+    handler = server.handlers
+        .singleWhere((handler) => handler is AnalysisDomainHandler);
     // listen for notifications
     Stream<Notification> notificationStream =
         serverChannel.notificationController.stream;
diff --git a/pkg/analysis_server/test/analysis_server_test.dart b/pkg/analysis_server/test/analysis_server_test.dart
index 467a170..d964390 100644
--- a/pkg/analysis_server/test/analysis_server_test.dart
+++ b/pkg/analysis_server/test/analysis_server_test.dart
@@ -6,13 +6,13 @@
 
 import 'dart:async';
 
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/analysis_server.dart';
 import 'package:analysis_server/src/constants.dart';
 import 'package:analysis_server/src/context_manager.dart';
 import 'package:analysis_server/src/domain_server.dart';
 import 'package:analysis_server/src/operation/operation.dart';
 import 'package:analysis_server/src/plugin/server_plugin.dart';
-import 'package:analysis_server/src/protocol.dart';
 import 'package:analyzer/file_system/file_system.dart';
 import 'package:analyzer/file_system/memory_file_system.dart';
 import 'package:analyzer/instrumentation/instrumentation.dart';
@@ -27,9 +27,10 @@
 
 import 'mock_sdk.dart';
 import 'mocks.dart';
+import 'utils.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(AnalysisServerTest);
 }
 
@@ -53,12 +54,16 @@
     // bar.dart.
     resourceProvider.newFolder('/foo');
     resourceProvider.newFolder('/bar');
-    File foo = resourceProvider.newFile('/foo/foo.dart', '''
+    File foo = resourceProvider.newFile(
+        '/foo/foo.dart',
+        '''
 libary foo;
 import "../bar/bar.dart";
 ''');
     Source fooSource = foo.createSource();
-    File bar = resourceProvider.newFile('/bar/bar.dart', '''
+    File bar = resourceProvider.newFile(
+        '/bar/bar.dart',
+        '''
 library bar;
 import "../foo/foo.dart";
 ''');
@@ -121,9 +126,16 @@
     ExtensionManager manager = new ExtensionManager();
     ServerPlugin serverPlugin = new ServerPlugin();
     manager.processPlugins([serverPlugin]);
-    server = new AnalysisServer(channel, resourceProvider, packageMapProvider,
-        null, serverPlugin, new AnalysisServerOptions(), new MockSdk(),
-        InstrumentationService.NULL_SERVICE, rethrowExceptions: true);
+    server = new AnalysisServer(
+        channel,
+        resourceProvider,
+        packageMapProvider,
+        null,
+        serverPlugin,
+        new AnalysisServerOptions(),
+        new MockSdk(),
+        InstrumentationService.NULL_SERVICE,
+        rethrowExceptions: true);
   }
 
   Future test_contextDisposed() {
@@ -209,7 +221,7 @@
     File bar = resourceProvider.newFile('/bar/bar.dart', 'library lib;');
     Source barSource = bar.createSource();
     server.setAnalysisRoots('0', ['/foo', '/bar'], [], {});
-    return pumpEventQueue(200).then((_) {
+    return pumpEventQueue(500).then((_) {
       expect(server.statusAnalyzing, isFalse);
       // Make sure getAnalysisContext returns the proper context for each.
       AnalysisContext fooContext =
@@ -405,8 +417,8 @@
 
   void test_rethrowExceptions() {
     Exception exceptionToThrow = new Exception('test exception');
-    MockServerOperation operation = new MockServerOperation(
-        ServerOperationPriority.ANALYSIS, (_) {
+    MockServerOperation operation =
+        new MockServerOperation(ServerOperationPriority.ANALYSIS, (_) {
       throw exceptionToThrow;
     });
     server.operationQueue.add(operation);
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 4a5631b..d1887be 100644
--- a/pkg/analysis_server/test/channel/byte_stream_channel_test.dart
+++ b/pkg/analysis_server/test/channel/byte_stream_channel_test.dart
@@ -8,14 +8,16 @@
 import 'dart:convert';
 import 'dart:io';
 
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/channel/byte_stream_channel.dart';
-import 'package:analysis_server/src/protocol.dart';
 import 'package:analyzer/instrumentation/instrumentation.dart';
 import 'package:unittest/unittest.dart';
 
 import '../mocks.dart';
+import '../utils.dart';
 
 main() {
+  initializeTestEnvironment();
   group('ByteStreamClientChannel', () {
     setUp(ByteStreamClientChannelTest.setUp);
     test('close', ByteStreamClientChannelTest.close);
@@ -215,8 +217,9 @@
 
   static Future sendNotification() {
     channel.sendNotification(new Notification('foo'));
-    return outputLineStream.first.timeout(new Duration(seconds: 1)).then(
-        (String notification) {
+    return outputLineStream.first
+        .timeout(new Duration(seconds: 1))
+        .then((String notification) {
       var jsonNotification = new JsonCodec().decode(notification);
       expect(jsonNotification, isMap);
       expect(jsonNotification, contains('event'));
@@ -226,8 +229,9 @@
 
   static Future sendResponse() {
     channel.sendResponse(new Response('foo'));
-    return outputLineStream.first.timeout(new Duration(seconds: 1)).then(
-        (String response) {
+    return outputLineStream.first
+        .timeout(new Duration(seconds: 1))
+        .then((String response) {
       var jsonResponse = new JsonCodec().decode(response);
       expect(jsonResponse, isMap);
       expect(jsonResponse, contains('id'));
diff --git a/pkg/analysis_server/test/channel/test_all.dart b/pkg/analysis_server/test/channel/test_all.dart
index 896155e..d177863 100644
--- a/pkg/analysis_server/test/channel/test_all.dart
+++ b/pkg/analysis_server/test/channel/test_all.dart
@@ -6,6 +6,7 @@
 
 import 'package:unittest/unittest.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;
 
@@ -13,7 +14,7 @@
  * Utility for manually running all tests.
  */
 main() {
-  groupSep = ' | ';
+  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 b7b6391..a9d42ed 100644
--- a/pkg/analysis_server/test/channel/web_socket_channel_test.dart
+++ b/pkg/analysis_server/test/channel/web_socket_channel_test.dart
@@ -6,14 +6,16 @@
 
 import 'dart:async';
 
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/channel/web_socket_channel.dart';
-import 'package:analysis_server/src/protocol.dart';
 import 'package:analyzer/instrumentation/instrumentation.dart';
 import 'package:unittest/unittest.dart';
 
 import '../mocks.dart';
+import '../utils.dart';
 
 main() {
+  initializeTestEnvironment();
   group('WebSocketChannel', () {
     setUp(WebSocketChannelTest.setUp);
     test('close', WebSocketChannelTest.close);
@@ -128,8 +130,9 @@
 
   static Future response() {
     server.sendResponse(new Response('myId'));
-    return client.responseStream.first.timeout(new Duration(seconds: 1)).then(
-        (Response response) {
+    return client.responseStream.first
+        .timeout(new Duration(seconds: 1))
+        .then((Response response) {
       expect(response.id, equals('myId'));
       expectMsgCount(responseCount: 1);
     });
diff --git a/pkg/analysis_server/test/completion_test.dart b/pkg/analysis_server/test/completion_test.dart
index bd78eda..7fc8d23 100644
--- a/pkg/analysis_server/test/completion_test.dart
+++ b/pkg/analysis_server/test/completion_test.dart
@@ -10,6 +10,13 @@
 import 'package:unittest/unittest.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
@@ -17,11 +24,6 @@
  */
 const String SOLO_TEST = null;
 
-main() {
-  CompletionTestBuilder builder = new CompletionTestBuilder();
-  builder.buildAll();
-}
-
 /**
  * Type of functions used to create tests.
  */
@@ -53,193 +55,316 @@
   }
 
   void buildCommentSnippetTests() {
-    buildTests('testCommentSnippets001', '''
+    buildTests(
+        'testCommentSnippets001',
+        '''
 class X {static final num MAX = 0;num yc,xc;mth() {xc = yc = MA!1X;x!2c.abs();num f = M!3AX;}}''',
         <String>["1+MAX", "2+xc", "3+MAX"]);
 
-    buildTests('testCommentSnippets002', '''
+    buildTests(
+        'testCommentSnippets002',
+        '''
 class Y {String x='hi';mth() {x.l!1ength;int n = 0;x!2.codeUnitAt(n!3);}}''',
         <String>["1+length", "2+x", "3+n"]);
 
-    buildTests('testCommentSnippets004', '''
+    buildTests(
+        'testCommentSnippets004',
+        '''
 class A {!1int x; !2mth() {!3int y = this.!5x!6;}}class B{}''',
         <String>["1+A", "2+B", "3+x", "3-y", "5+mth", "6+x"]);
 
-    buildTests('testCommentSnippets005', '''
+    buildTests(
+        'testCommentSnippets005',
+        '''
 class Date { static Date JUN, JUL;}class X { m() { return Da!1te.JU!2L; }}''',
         <String>["1+Date", "2+JUN", "2+JUL"]);
 
-    buildTests('testCommentSnippets007', '''
+    buildTests(
+        'testCommentSnippets007',
+        '''
 class C {mth(Map x, !1) {}mtf(!2, Map x) {}m() {for (in!3t i=0; i<5; i++); A!4 x;}}class int{}class Arrays{}''',
         <String>["1+bool", "2+bool", "3+int", "4+Arrays"]);
 
-    buildTests('testCommentSnippets008', '''
-class Date{}final num M = Dat!1''', <String>["1+Date"]);
+    buildTests(
+        'testCommentSnippets008',
+        '''
+class Date{}final num M = Dat!1''',
+        <String>["1+Date"]);
 
     // space, char, eol are important
-    buildTests('testCommentSnippets009', '''
-class Maps{}class x extends!5 !2M!3 !4implements!6 !1\n{}''', <String>[
-      "1+Map",
-      "2+Maps",
-      "3+Maps",
-      "4-Maps",
-      "4+implements",
-      "5-Maps",
-      "6-Map",
-      "6+implements"
-    ], failingTests: '46');
+    buildTests(
+        'testCommentSnippets009',
+        '''
+class Maps{}class x extends!5 !2M!3 !4implements!6 !1\n{}''',
+        <String>[
+          "1+Map",
+          "2+Maps",
+          "3+Maps",
+          "4-Maps",
+          "4+implements",
+          "5-Maps",
+          "6-Map",
+          "6+implements"
+        ],
+        failingTests: '46');
 
     // space, char, eol are important
-    buildTests('testCommentSnippets010', '''
-class x implements !1{}''', <String>["1+Map"]);
+    buildTests(
+        'testCommentSnippets010',
+        '''
+class x implements !1{}''',
+        <String>["1+Map"]);
 
     // space, char, eol are important
-    buildTests('testCommentSnippets011', '''
-class x implements M!1{}''', <String>["1+Map"]);
+    buildTests(
+        'testCommentSnippets011',
+        '''
+class x implements M!1{}''',
+        <String>["1+Map"]);
 
     // space, char, eol are important
-    buildTests('testCommentSnippets012', '''
-class x implements M!1\n{}''', <String>["1+Map"]);
+    buildTests(
+        'testCommentSnippets012',
+        '''
+class x implements M!1\n{}''',
+        <String>["1+Map"]);
 
-    buildTests('testCommentSnippets013', '''
-class x !2{!1}!3''', <String>["1+num", "2-num", "3+num"]);
+    buildTests(
+        'testCommentSnippets013',
+        '''
+class x !2{!1}!3''',
+        <String>["1+num", "2-num", "3+num"]);
 
     // trailing space is important
-    buildTests('testCommentSnippets014', '''
-typedef n!1 ;''', <String>["1+num"]);
+    buildTests(
+        'testCommentSnippets014',
+        '''
+typedef n!1 ;''',
+        <String>["1+num"]);
 
-    buildTests('testCommentSnippets015', '''
-class D {f(){} g(){f!1(f!2);}}''', <String>["1+f", "2+f"]);
+    buildTests(
+        'testCommentSnippets015',
+        '''
+class D {f(){} g(){f!1(f!2);}}''',
+        <String>["1+f", "2+f"]);
 
-    buildTests('testCommentSnippets016', '''
-class F {m() { m(); !1}}''', <String>["1+m"]);
+    buildTests(
+        'testCommentSnippets016',
+        '''
+class F {m() { m(); !1}}''',
+        <String>["1+m"]);
 
-    buildTests('testCommentSnippets017', '''
-class F {var x = !1false;}''', <String>["1+true"]);
+    buildTests(
+        'testCommentSnippets017',
+        '''
+class F {var x = !1false;}''',
+        <String>["1+true"]);
 
-    buildTests('testCommentSnippets018', '''
+    buildTests(
+        'testCommentSnippets018',
+        '''
 class Map{}class Arrays{}class C{ m(!1){} n(!2 x, q)''',
         <String>["1+Map", "1-void", "1-null", "2+Arrays", "2-void", "2-null"]);
 
-    buildTests('testCommentSnippets019', '''
-class A{m(){Object x;x.!1/**/clear()''', <String>["1+toString"]);
+    buildTests(
+        'testCommentSnippets019',
+        '''
+class A{m(){Object x;x.!1/**/clear()''',
+        <String>["1+toString"]);
 
-    buildTests('testCommentSnippets020', '''
+    buildTests(
+        'testCommentSnippets020',
+        '''
 classMap{}class tst {var newt;void newf(){}test() {var newz;new!1/**/;}}''',
         <String>["1+newt", "1+newf", "1+newz", "1-Map"]);
 
-    buildTests('testCommentSnippets021', '''
+    buildTests(
+        'testCommentSnippets021',
+        '''
 class Map{}class tst {var newt;void newf(){}test() {var newz;new !1/**/;}}''',
         <String>["1+Map", "1-newt"]);
 
-    buildTests('testCommentSnippets022', '''
-class Map{}class F{m(){new !1;}}''', <String>["1+Map"]);
+    buildTests(
+        'testCommentSnippets022',
+        '''
+class Map{}class F{m(){new !1;}}''',
+        <String>["1+Map"]);
 
-    buildTests('testCommentSnippets022a', '''
-class Map{}class F{m(){new !1''', <String>["1+Map"]);
+    buildTests(
+        'testCommentSnippets022a',
+        '''
+class Map{}class F{m(){new !1''',
+        <String>["1+Map"]);
 
-    buildTests('testCommentSnippets022b', '''
+    buildTests(
+        'testCommentSnippets022b',
+        '''
 class Map{factory Map.qq(){return null;}}class F{m(){new Map.!1qq();}}''',
         <String>["1+qq"]);
 
-    buildTests('testCommentSnippets023', '''
+    buildTests(
+        'testCommentSnippets023',
+        '''
 class X {X c; X(this.!1c!3) : super() {c.!2}}''',
         <String>["1+c", "2+c", "3+c"]);
 
-    buildTests('testCommentSnippets024', '''
-class q {m(Map q){var x;m(!1)}n(){var x;n(!2)}}''', <String>["1+x", "2+x"]);
+    buildTests(
+        'testCommentSnippets024',
+        '''
+class q {m(Map q){var x;m(!1)}n(){var x;n(!2)}}''',
+        <String>["1+x", "2+x"]);
 
-    buildTests('testCommentSnippets025', '''
+    buildTests(
+        'testCommentSnippets025',
+        '''
 class q {num m() {var q; num x=!1 q!3 + !2/**/;}}''',
         <String>["1+q", "2+q", "3+q"]);
 
-    buildTests('testCommentSnippets026', '''
-class List{}class a implements !1{}''', <String>["1+List"]);
+    buildTests(
+        'testCommentSnippets026',
+        '''
+class List{}class a implements !1{}''',
+        <String>["1+List"]);
 
-    buildTests('testCommentSnippets027', '''
+    buildTests(
+        'testCommentSnippets027',
+        '''
 class String{}class List{}class test <X extends !1String!2> {}''',
         <String>["1+List", "2+String", "2-List"]);
 
-    buildTests('testCommentSnippets028', '''
+    buildTests(
+        'testCommentSnippets028',
+        '''
 class String{}class List{}class DateTime{}typedef T Y<T extends !1>(List input);''',
         <String>["1+DateTime", "1+String"]);
 
-    buildTests('testCommentSnippets029', '''
+    buildTests(
+        'testCommentSnippets029',
+        '''
 interface A<X> default B<X extends !1List!2> {}''',
         <String>["1+DateTime", "2+List"]);
 
-    buildTests('testCommentSnippets030', '''
+    buildTests(
+        'testCommentSnippets030',
+        '''
 class Bar<T extends Foo> {const Bar(!1T!2 k);T!3 m(T!4 a, T!5 b){}final T!6 f = null;}''',
         <String>["1+T", "2+T", "3+T", "4+T", "5+T", "6+T"],
         failingTests: '123456');
 
-    buildTests('testCommentSnippets031', '''
+    buildTests(
+        'testCommentSnippets031',
+        '''
 class Bar<T extends Foo> {m(x){if (x is !1) return;if (x is!!!2)}}''',
-        <String>["1+Bar", "1+T", "2+T", "2+Bar"], failingTests: '12');
+        <String>["1+Bar", "1+T", "2+T", "2+Bar"],
+        failingTests: '12');
 
-    buildTests('testCommentSnippets032', '''
+    buildTests(
+        'testCommentSnippets032',
+        '''
 class Fit{}class Bar<T extends Fooa> {const !2F!1ara();}''',
-        <String>["1+Fit", "1+Fara", "1-Bar", "2+Fit"], failingTests: '1');
+        <String>["1+Fit", "1+Fara", "1-Bar", "2+Fit"],
+        failingTests: '1');
 
     // Type propagation
-    buildTests('testCommentSnippets033', '''
+    buildTests(
+        'testCommentSnippets033',
+        '''
 class List{add(){}length(){}}t1() {var x;if (x is List) {x.!1add(3);}}''',
         <String>["1+add", "1+length"]);
 
     // Type propagation
-    buildTests('testCommentSnippets035', '''
+    buildTests(
+        'testCommentSnippets035',
+        '''
 class List{clear(){}length(){}}t3() {var x=new List(), y=x.!1length();x.!2clear();}''',
         <String>["1+length", "2+clear"]);
 
-    buildTests('testCommentSnippets036', '''
-class List{}t3() {var x=new List!1}''', <String>["1+List"]);
+    buildTests(
+        'testCommentSnippets036',
+        '''
+class List{}t3() {var x=new List!1}''',
+        <String>["1+List"]);
 
-    buildTests('testCommentSnippets037', '''
+    buildTests(
+        'testCommentSnippets037',
+        '''
 class List{factory List.from(){}}t3() {var x=new List.!1}''',
         <String>["1+from"]);
 
-    buildTests('testCommentSnippets038', '''
-f(){int xa; String s = '\$x!1';}''', <String>["1+xa"]);
+    buildTests(
+        'testCommentSnippets038',
+        '''
+f(){int xa; String s = '\$x!1';}''',
+        <String>["1+xa"]);
 
-    buildTests('testCommentSnippets038a', '''
-int xa; String s = '\$x!1\'''', <String>["1+xa"]);
+    buildTests(
+        'testCommentSnippets038a',
+        '''
+int xa; String s = '\$x!1\'''',
+        <String>["1+xa"]);
 
-    buildTests('testCommentSnippets039', '''
-f(){int xa; String s = '\$!1';}''', <String>["1+xa"]);
+    buildTests(
+        'testCommentSnippets039',
+        '''
+f(){int xa; String s = '\$!1';}''',
+        <String>["1+xa"]);
 
-    buildTests('testCommentSnippets039a', '''
-int xa; String s = '\$!1\'''', <String>["1+xa"]);
+    buildTests(
+        'testCommentSnippets039a',
+        '''
+int xa; String s = '\$!1\'''',
+        <String>["1+xa"]);
 
-    buildTests('testCommentSnippets040', '''
+    buildTests(
+        'testCommentSnippets040',
+        '''
 class List{add(){}}class Map{}class X{m(){List list; list.!1 Map map;}}''',
         <String>["1+add"]);
 
-    buildTests('testCommentSnippets041', '''
+    buildTests(
+        'testCommentSnippets041',
+        '''
 class List{add(){}length(){}}class X{m(){List list; list.!1 zox();}}''',
         <String>["1+add"]);
 
-    buildTests('testCommentSnippets042', '''
+    buildTests(
+        'testCommentSnippets042',
+        '''
 class DateTime{static const int WED=3;int get day;}fd(){DateTime d=new DateTime.now();d.!1WED!2;}''',
         <String>["1+day", "2-WED"]);
 
-    buildTests('testCommentSnippets043', '''
-class L{var k;void.!1}''', <String>["1-k"]);
+    buildTests(
+        'testCommentSnippets043',
+        '''
+class L{var k;void.!1}''',
+        <String>["1-k"]);
 
-    buildTests('testCommentSnippets044', '''
+    buildTests(
+        'testCommentSnippets044',
+        '''
 class List{}class XXX {XXX.fisk();}main() {main(); new !1}}''',
         <String>["1+List", "1+XXX.fisk"]);
 
-    buildTests('testCommentSnippets047', '''
-f(){int x;int y=!1;}''', <String>["1+x"]);
+    buildTests(
+        'testCommentSnippets047',
+        '''
+f(){int x;int y=!1;}''',
+        <String>["1+x"]);
 
-    buildTests('testCommentSnippets048', '''
-import 'dart:convert' as json;f() {var x=new js!1}''', <String>["1+json"]);
+    buildTests(
+        'testCommentSnippets048',
+        '''
+import 'dart:convert' as json;f() {var x=new js!1}''',
+        <String>["1+json"]);
 
-    buildTests('testCommentSnippets049', '''
+    buildTests(
+        'testCommentSnippets049',
+        '''
 import 'dart:convert' as json;
 import 'dart:convert' as jxx;
 class JsonDecoderX{}
-f1() {var x=new !2j!1s!3}''', <String>[
+f1() {var x=new !2j!1s!3}''',
+        <String>[
       "1+json",
       "1+jxx",
       "2+json",
@@ -249,7 +374,9 @@
       "3-jxx"
     ]);
 
-    buildTests('testCommentSnippets050', '''
+    buildTests(
+        'testCommentSnippets050',
+        '''
 class xdr {
   xdr();
   const xdr.a(a,b,c);
@@ -260,7 +387,8 @@
 k() {
   new x!1dr().f();
   const x!2dr.!3a(1, 2, 3);
-}''', <String>[
+}''',
+        <String>[
       "1+xdr",
       "1+xa",
       "1+xdr.a",
@@ -274,7 +402,9 @@
     ]);
 
     // Type propagation.
-    buildTests('testCommentSnippets051', '''
+    buildTests(
+        'testCommentSnippets051',
+        '''
 class String{int length(){} String toUpperCase(){} bool isEmpty(){}}class Map{getKeys(){}}
 void r() {
   var v;
@@ -282,10 +412,13 @@
     v.!1length;
     v.!2getKeys;
   }
-}''', <String>["1+length", "2-getKeys"]);
+}''',
+        <String>["1+length", "2-getKeys"]);
 
     // Type propagation.
-    buildTests('testCommentSnippets052', '''
+    buildTests(
+        'testCommentSnippets052',
+        '''
 class String{int length(){} String toUpperCase(){} bool isEmpty(){}}class Map{getKeys(){}}
 void r() {
   List<String> values = ['a','b','c'];
@@ -293,10 +426,13 @@
     v.!1toUpperCase;
     v.!2getKeys;
   }
-}''', <String>["1+toUpperCase", "2-getKeys"]);
+}''',
+        <String>["1+toUpperCase", "2-getKeys"]);
 
     // Type propagation.
-    buildTests('testCommentSnippets053', '''
+    buildTests(
+        'testCommentSnippets053',
+        '''
 class String{int length(){} String toUpperCase(){} bool isEmpty(){}}class Map{getKeys(){}}
 void r() {
   var v;
@@ -304,9 +440,12 @@
     v.!1toUpperCase;
     v.!2getKeys;
   }
-}''', <String>["1+toUpperCase", "2-getKeys"]);
+}''',
+        <String>["1+toUpperCase", "2-getKeys"]);
 
-    buildTests('testCommentSnippets054', '''
+    buildTests(
+        'testCommentSnippets054',
+        '''
 class String{int length(){} String toUpperCase(){} bool isEmpty(){}}class Map{getKeys(){}}
 void r() {
   var v;
@@ -314,48 +453,67 @@
     v.!2toUpperCase;
     v.!3getKeys;
   }
-}''', <String>["1+isEmpty", "2+toUpperCase", "3-getKeys"]);
+}''',
+        <String>["1+isEmpty", "2+toUpperCase", "3-getKeys"]);
 
-    buildTests('testCommentSnippets055', '''
+    buildTests(
+        'testCommentSnippets055',
+        '''
 class String{int length(){} String toUpperCase(){} bool isEmpty(){}}class Map{getKeys(){}}
 void r() {
   String v;
   if (v is Object) {
     v.!1toUpperCase;
   }
-}''', <String>["1+toUpperCase"]);
+}''',
+        <String>["1+toUpperCase"]);
 
     // Type propagation.
-    buildTests('testCommentSnippets056', '''
+    buildTests(
+        'testCommentSnippets056',
+        '''
 class String{int length(){} String toUpperCase(){} bool isEmpty(){}}class Map{getKeys(){}}
 void f(var v) {
   if (v is!! String) {
     return;
   }
   v.!1toUpperCase;
-}''', <String>["1+toUpperCase"]);
+}''',
+        <String>["1+toUpperCase"]);
 
     // Type propagation.
-    buildTests('testCommentSnippets057', '''
+    buildTests(
+        'testCommentSnippets057',
+        '''
 class String{int length(){} String toUpperCase(){} bool isEmpty(){}}class Map{getKeys(){}}
 void f(var v) {
   if ((v as String).!2length == 0) {
     v.!1toUpperCase;
   }
-}''', <String>["1+toUpperCase", "2+length"]);
+}''',
+        <String>["1+toUpperCase", "2+length"]);
 
-    buildTests('testCommentSnippets058', '''
+    buildTests(
+        'testCommentSnippets058',
+        '''
 typedef vo!2id callback(int k);
 void x(callback q){}
 void r() {
   callback v;
   x(!1);
-}''', <String>["1+v", "2+void"], failingTests: '2');
+}''',
+        <String>["1+v", "2+void"],
+        failingTests: '2');
 
-    buildTests('testCommentSnippets059', '''
-f(){((int x) => x+4).!1call(1);}''', <String>["1-call"]);
+    buildTests(
+        'testCommentSnippets059',
+        '''
+f(){((int x) => x+4).!1call(1);}''',
+        <String>["1-call"]);
 
-    buildTests('testCommentSnippets060', '''
+    buildTests(
+        'testCommentSnippets060',
+        '''
 class Map{}
 abstract class MM extends Map{factory MM() => new Map();}
 class Z {
@@ -363,22 +521,30 @@
   f() {
     x!1
   }
-}''', <String>["1+x", "1-x[]"]);
+}''',
+        <String>["1+x", "1-x[]"]);
 
-    buildTests('testCommentSnippets061', '''
+    buildTests(
+        'testCommentSnippets061',
+        '''
 class A{m(){!1f(3);!2}}n(){!3f(3);!4}f(x)=>x*3;''',
         <String>["1+f", "1+n", "2+f", "2+n", "3+f", "3+n", "4+f", "4+n"]);
 
     // Type propagation.
-    buildTests('testCommentSnippets063', '''
+    buildTests(
+        'testCommentSnippets063',
+        '''
 class String{int length(){} String toUpperCase(){} bool isEmpty(){}}class Map{getKeys(){}}
 void r(var v) {
   v.!1toUpperCase;
   assert(v is String);
   v.!2toUpperCase;
-}''', <String>["1-toUpperCase", "2+toUpperCase"]);
+}''',
+        <String>["1-toUpperCase", "2+toUpperCase"]);
 
-    buildTests('testCommentSnippets064', '''
+    buildTests(
+        'testCommentSnippets064',
+        '''
 class Spline {
   Line c;
   Spline a() {
@@ -401,7 +567,8 @@
   Spline h() {
     return null;
   }
-}''', <String>[
+}''',
+        <String>[
       "1+a",
       "2+b",
       "1-g",
@@ -415,7 +582,9 @@
       "9+h"
     ]);
 
-    buildTests('testCommentSnippets065', '''
+    buildTests(
+        'testCommentSnippets065',
+        '''
 class Spline {
   Line c;
   Spline a() {
@@ -437,9 +606,12 @@
   Spline h() {
     return null;
   }
-}''', <String>["1+a"]);
+}''',
+        <String>["1+a"]);
 
-    buildTests('testCommentSnippets066', '''
+    buildTests(
+        'testCommentSnippets066',
+        '''
 class Spline {
   Line c;
   Spline a() {
@@ -461,9 +633,12 @@
   Spline h() {
     return null;
   }
-}''', <String>["1+b"]);
+}''',
+        <String>["1+b"]);
 
-    buildTests('testCommentSnippets067', '''
+    buildTests(
+        'testCommentSnippets067',
+        '''
 class Spline {
   Line c;
   Spline a() {
@@ -485,9 +660,12 @@
   Spline h() {
     return null;
   }
-}''', <String>["1+b"]);
+}''',
+        <String>["1+b"]);
 
-    buildTests('testCommentSnippets068', '''
+    buildTests(
+        'testCommentSnippets068',
+        '''
 class Spline {
   Line c;
   Spline a() {
@@ -509,9 +687,12 @@
   Spline h() {
     return null;
   }
-}''', <String>["1+c"]);
+}''',
+        <String>["1+c"]);
 
-    buildTests('testCommentSnippets069', '''
+    buildTests(
+        'testCommentSnippets069',
+        '''
 class Spline {
   Line c;
   Spline a() {
@@ -533,9 +714,12 @@
   Spline h() {
     return null;
   }
-}''', <String>["1+c"]);
+}''',
+        <String>["1+c"]);
 
-    buildTests('testCommentSnippets070', '''
+    buildTests(
+        'testCommentSnippets070',
+        '''
 class Spline {
   Line c;
   Spline a() {
@@ -557,9 +741,12 @@
   Spline h() {
     return null;
   }
-}''', <String>["1+b"]);
+}''',
+        <String>["1+b"]);
 
-    buildTests('testCommentSnippets072', '''
+    buildTests(
+        'testCommentSnippets072',
+        '''
 class X {
   int _p;
   set p(int x) => _p = x;
@@ -567,9 +754,12 @@
 f() {
   X x = new X();
   x.!1p = 3;
-}''', <String>["1+p"]);
+}''',
+        <String>["1+p"]);
 
-    buildTests('testCommentSnippets073', '''
+    buildTests(
+        'testCommentSnippets073',
+        '''
 class X {
   m() {
     JSON.stri!1;
@@ -578,28 +768,41 @@
 }
 class JSON {
   static stringify() {}
-}''', <String>["1+stringify"]);
+}''',
+        <String>["1+stringify"]);
 
-    buildTests('testCommentSnippets074', '''
+    buildTests(
+        'testCommentSnippets074',
+        '''
 class X {
   m() {
     _x!1
   }
   _x1(){}
-}''', <String>["1+_x1"]);
+}''',
+        <String>["1+_x1"]);
 
-    buildTests('testCommentSnippets075', '''
-p(x)=>0;var E;f(q)=>!1p(!2E);''', <String>["1+p", "2+E"]);
+    buildTests(
+        'testCommentSnippets075',
+        '''
+p(x)=>0;var E;f(q)=>!1p(!2E);''',
+        <String>["1+p", "2+E"]);
 
-    buildTests('testCommentSnippets076', '''
+    buildTests(
+        'testCommentSnippets076',
+        '''
 class Map<K,V>{}class List<E>{}class int{}main() {var m=new Map<Lis!1t<Map<int,in!2t>>,List<!3int>>();}''',
         <String>["1+List", "2+int", "3+int"]);
 
-    buildTests('testCommentSnippets076a', '''
+    buildTests(
+        'testCommentSnippets076a',
+        '''
 class Map<K,V>{}class List<E>{}class int{}main() {var m=new Map<Lis!1t<Map<int,in!2t>>,List<!3>>();}''',
         <String>["1+List", "2+int", "3+int"]);
 
-    buildTests('testCommentSnippets077', '''
+    buildTests(
+        'testCommentSnippets077',
+        '''
 class FileMode {
   static const READ = const FileMode._internal(0);
   static const WRITE = const FileMode._internal(1);
@@ -613,7 +816,8 @@
   factory File(String path) => null;
   factory File.fromPath(Path path) => null;
 }
-f() => new Fil!1''', <String>[
+f() => new Fil!1''',
+        <String>[
       "1+File",
       "1+File.fromPath",
       "1+FileMode",
@@ -621,60 +825,91 @@
       "1+FileMode._internal"
     ]);
 
-    buildTests('testCommentSnippets078', '''
+    buildTests(
+        'testCommentSnippets078',
+        '''
 class Map{static from()=>null;clear(){}}void main() { Map.!1 }''',
         <String>["1+from", "1-clear"]); // static method, instance method
 
-    buildTests('testCommentSnippets079', '''
+    buildTests(
+        'testCommentSnippets079',
+        '''
 class Map{static from()=>null;clear(){}}void main() { Map s; s.!1 }''',
         <String>["1-from", "1+clear"]); // static method, instance method
 
-    buildTests('testCommentSnippets080', '''
+    buildTests(
+        'testCommentSnippets080',
+        '''
 class RuntimeError{var message;}void main() { RuntimeError.!1 }''',
         <String>["1-message"]); // field
 
-    buildTests('testCommentSnippets081', '''
-class Foo {this.!1}''', <String>["1-Object"], failingTests: '1');
+    buildTests(
+        'testCommentSnippets081',
+        '''
+class Foo {this.!1}''',
+        <String>["1-Object"],
+        failingTests: '1');
 
-    buildTests('testCommentSnippets082', '''
+    buildTests(
+        'testCommentSnippets082',
+        '''
         class HttpRequest {}
         class HttpResponse {}
         main() {
           var v = (HttpRequest req, HttpResp!1)
-        }''', <String>["1+HttpResponse"]);
+        }''',
+        <String>["1+HttpResponse"]);
 
-    buildTests('testCommentSnippets083', '''
-main() {(.!1)}''', <String>["1-toString"]);
+    buildTests(
+        'testCommentSnippets083',
+        '''
+main() {(.!1)}''',
+        <String>["1-toString"]);
 
-    buildTests('testCommentSnippets083a', '''
-main() { .!1 }''', <String>["1-toString"]);
+    buildTests(
+        'testCommentSnippets083a',
+        '''
+main() { .!1 }''',
+        <String>["1-toString"]);
 
-    buildTests('testCommentSnippets083b', '''
-main() { null.!1 }''', <String>["1+toString"], failingTests: '1');
+    buildTests(
+        'testCommentSnippets083b',
+        '''
+main() { null.!1 }''',
+        <String>["1+toString"],
+        failingTests: '1');
 
-    buildTests('testCommentSnippets084', '''
-class List{}class Map{}typedef X = !1Lis!2t with !3Ma!4p;''', <String>[
-      "1+Map",
-      "2+List",
-      "2-Map",
-      "3+List",
-      "4+Map",
-      "4-List"
-    ], failingTests: '1234');
+    buildTests(
+        'testCommentSnippets084',
+        '''
+class List{}class Map{}typedef X = !1Lis!2t with !3Ma!4p;''',
+        <String>["1+Map", "2+List", "2-Map", "3+List", "4+Map", "4-List"],
+        failingTests: '1234');
 
-    buildTests('testCommentSnippets085', '''
+    buildTests(
+        'testCommentSnippets085',
+        '''
 class List{}class Map{}class Z extends List with !1Ma!2p {}''',
-        <String>["1+List", "1+Map", "2+Map", "2-List"], failingTests: '12');
+        <String>["1+List", "1+Map", "2+Map", "2-List"],
+        failingTests: '12');
 
-    buildTests('testCommentSnippets086', '''
-class Q{f(){xy() {!2};x!1y();}}''', <String>["1+xy", "2+f", "2-xy"],
+    buildTests(
+        'testCommentSnippets086',
+        '''
+class Q{f(){xy() {!2};x!1y();}}''',
+        <String>["1+xy", "2+f", "2-xy"],
         failingTests: '2');
 
-    buildTests('testCommentSnippets087', '''
+    buildTests(
+        'testCommentSnippets087',
+        '''
 class Map{}class Q extends Object with !1Map {}''',
-        <String>["1+Map", "1-HashMap"], failingTests: '1');
+        <String>["1+Map", "1-HashMap"],
+        failingTests: '1');
 
-    buildTests('testCommentSnippets088', '''
+    buildTests(
+        'testCommentSnippets088',
+        '''
 class A {
   int f;
   B m(){}
@@ -686,9 +921,12 @@
 class Z {
   B q;
   f() {q.!1}
-}''', <String>["1+f", "1+m"]); // f->num, m()->A
+}''',
+        <String>["1+f", "1+m"]); // f->num, m()->A
 
-    buildTests('testCommentSnippets089', '''
+    buildTests(
+        'testCommentSnippets089',
+        '''
 class Q {
   fqe() {
     xya() {
@@ -706,127 +944,170 @@
   fqi() {
     !5
   }
-}''', <String>[
-      "1+fqe",
-      "1+fqi",
-      "1+Q",
-      "1-xya",
-      "1-xyb",
-      "1-xza",
-      "2+fqe",
-      "2+fqi",
-      "2+Q",
-      "2-xya",
-      "2-xyb",
-      "2-xza",
-      "3+fqe",
-      "3+fqi",
-      "3+Q",
-      "3-xya",
-      "3+xyb",
-      "3-xza",
-      "4+fqe",
-      "4+fqi",
-      "4+Q",
-      "4+xya",
-      "4-xyb",
-      "4+xza",
-      "5+fqe",
-      "5+fqi",
-      "5+Q",
-      "5-xya",
-      "5-xyb",
-      "5-xza"
-    ], failingTests: '123');
+}''',
+        <String>[
+          "1+fqe",
+          "1+fqi",
+          "1+Q",
+          "1-xya",
+          "1-xyb",
+          "1-xza",
+          "2+fqe",
+          "2+fqi",
+          "2+Q",
+          "2-xya",
+          "2-xyb",
+          "2-xza",
+          "3+fqe",
+          "3+fqi",
+          "3+Q",
+          "3-xya",
+          "3+xyb",
+          "3-xza",
+          "4+fqe",
+          "4+fqi",
+          "4+Q",
+          "4+xya",
+          "4-xyb",
+          "4+xza",
+          "5+fqe",
+          "5+fqi",
+          "5+Q",
+          "5-xya",
+          "5-xyb",
+          "5-xza"
+        ],
+        failingTests: '123');
 
-    buildTests('testCommentSnippets090', '''
-class X { f() { var a = 'x'; a.!1 }}''', <String>["1+length"]);
+    buildTests(
+        'testCommentSnippets090',
+        '''
+class X { f() { var a = 'x'; a.!1 }}''',
+        <String>["1+length"]);
   }
 
   void buildCompletionTests() {
-    buildTests('testCompletion_alias_field', '''
-typedef int fnint(int k); fn!1int x;''', <String>["1+fnint"]);
+    buildTests(
+        'testCompletion_alias_field',
+        '''
+typedef int fnint(int k); fn!1int x;''',
+        <String>["1+fnint"]);
 
-    buildTests('testCompletion_annotation_argumentList', '''
+    buildTests(
+        'testCompletion_annotation_argumentList',
+        '''
 class AAA {",
   const AAA({int aaa, int bbb});",
 }",
 ",
 @AAA(!1)
 main() {
-}''', <String>["1+AAA" /*":" + ProposalKind.ARGUMENT_LIST*/, "1+aaa", "1+bbb"],
+}''',
+        <String>[
+          "1+AAA" /*":" + ProposalKind.ARGUMENT_LIST*/,
+          "1+aaa",
+          "1+bbb"
+        ],
         failingTests: '1');
 
-    buildTests('testCompletion_annotation_topLevelVar', '''
+    buildTests(
+        'testCompletion_annotation_topLevelVar',
+        '''
 const fooConst = null;
 final fooNotConst = null;
 const bar = null;
 
 @foo!1
 main() {
-}''', <String>["1+fooConst", "1-fooNotConst", "1-bar"], failingTests: '1');
+}''',
+        <String>["1+fooConst", "1-fooNotConst", "1-bar"],
+        failingTests: '1');
 
-    buildTests('testCompletion_annotation_type', '''
+    buildTests(
+        'testCompletion_annotation_type',
+        '''
 class AAA {
   const AAA({int a, int b});
   const AAA.nnn(int c, int d);
 }
 @AAA!1
 main() {
-}''', <String>[
-      "1+AAA" /*":" + ProposalKind.CONSTRUCTOR*/,
-      "1+AAA.nnn" /*":" + ProposalKind.CONSTRUCTOR*/
-    ], failingTests: '1');
+}''',
+        <String>[
+          "1+AAA" /*":" + ProposalKind.CONSTRUCTOR*/,
+          "1+AAA.nnn" /*":" + ProposalKind.CONSTRUCTOR*/
+        ],
+        failingTests: '1');
 
-    buildTests('testCompletion_annotation_type_inClass_withoutMember', '''
+    buildTests(
+        'testCompletion_annotation_type_inClass_withoutMember',
+        '''
 class AAA {
   const AAA();
 }
 
 class C {
   @A!1
-}''', <String>["1+AAA" /*":" + ProposalKind.CONSTRUCTOR*/]);
+}''',
+        <String>["1+AAA" /*":" + ProposalKind.CONSTRUCTOR*/]);
 
-    buildTests('testCompletion_argument_typeName', '''
+    buildTests(
+        'testCompletion_argument_typeName',
+        '''
 class Enum {
   static Enum FOO = new Enum();
 }
 f(Enum e) {}
 main() {
   f(En!1);
-}''', <String>["1+Enum"]);
+}''',
+        <String>["1+Enum"]);
 
-    buildTests('testCompletion_arguments_ignoreEmpty', '''
+    buildTests(
+        'testCompletion_arguments_ignoreEmpty',
+        '''
 class A {
   test() {}
 }
 main(A a) {
   a.test(!1);
-}''', <String>["1-test"]);
+}''',
+        <String>["1-test"]);
 
-    buildTests('testCompletion_as_asIdentifierPrefix', '''
+    buildTests(
+        'testCompletion_as_asIdentifierPrefix',
+        '''
 main(p) {
   var asVisible;
   var v = as!1;
-}''', <String>["1+asVisible"]);
+}''',
+        <String>["1+asVisible"]);
 
-    buildTests('testCompletion_as_asPrefixedIdentifierStart', '''
+    buildTests(
+        'testCompletion_as_asPrefixedIdentifierStart',
+        '''
 class A {
   var asVisible;
 }
 
 main(A p) {
   var v = p.as!1;
-}''', <String>["1+asVisible"]);
+}''',
+        <String>["1+asVisible"]);
 
-    buildTests('testCompletion_as_incompleteStatement', '''
+    buildTests(
+        'testCompletion_as_incompleteStatement',
+        '''
 class MyClass {}
 main(p) {
   var justSomeVar;
   var v = p as !1
-}''', <String>["1+MyClass", "1-justSomeVar"]);
+}''',
+        <String>["1+MyClass", "1-justSomeVar"]);
 
-    buildTests('testCompletion_cascade', '''
+    buildTests(
+        'testCompletion_cascade',
+        '''
 class A {
   aaa() {}
 }
@@ -834,61 +1115,91 @@
 
 main(A a) {
   a..!1 aaa();
-}''', <String>["1+aaa", "1-main"]);
+}''',
+        <String>["1+aaa", "1-main"]);
 
-    buildTests('testCompletion_combinator_afterComma', '''
+    buildTests(
+        'testCompletion_combinator_afterComma',
+        '''
 "import 'dart:math' show cos, !1;''',
-        <String>["1+PI", "1+sin", "1+Random", "1-String"], failingTests: '1');
+        <String>["1+PI", "1+sin", "1+Random", "1-String"],
+        failingTests: '1');
 
-    buildTests('testCompletion_combinator_ended', '''
+    buildTests(
+        'testCompletion_combinator_ended',
+        '''
 import 'dart:math' show !1;"''',
         <String>["1+PI", "1+sin", "1+Random", "1-String"]);
 
-    buildTests('testCompletion_combinator_export', '''
+    buildTests(
+        'testCompletion_combinator_export',
+        '''
 export 'dart:math' show !1;"''',
         <String>["1+PI", "1+sin", "1+Random", "1-String"]);
 
-    buildTests('testCompletion_combinator_hide', '''
+    buildTests(
+        'testCompletion_combinator_hide',
+        '''
 import 'dart:math' hide !1;"''',
         <String>["1+PI", "1+sin", "1+Random", "1-String"]);
 
-    buildTests('testCompletion_combinator_notEnded', '''
+    buildTests(
+        'testCompletion_combinator_notEnded',
+        '''
 import 'dart:math' show !1"''',
         <String>["1+PI", "1+sin", "1+Random", "1-String"]);
 
-    buildTests('testCompletion_combinator_usePrefix', '''
+    buildTests(
+        'testCompletion_combinator_usePrefix',
+        '''
 import 'dart:math' show s!1"''',
         <String>["1+sin", "1+sqrt", "1-cos", "1-String"]);
 
-    buildTests('testCompletion_constructor_field', '''
-class X { X(this.field); int f!1ield;}''', <String>["1+field"],
+    buildTests(
+        'testCompletion_constructor_field',
+        '''
+class X { X(this.field); int f!1ield;}''',
+        <String>["1+field"],
         failingTests: '1');
 
-    buildTests('testCompletion_constructorArguments_showOnlyCurrent', '''
+    buildTests(
+        'testCompletion_constructorArguments_showOnlyCurrent',
+        '''
 class A {
   A.first(int p);
   A.second(double p);
 }
 main() {
   new A.first(!1);
-}''', <String>["1+A.first", "1-A.second"], failingTests: '1');
+}''',
+        <String>["1+A.first", "1-A.second"],
+        failingTests: '1');
 
-    buildTests('testCompletion_constructorArguments_whenPrefixedType', '''
+    buildTests(
+        'testCompletion_constructorArguments_whenPrefixedType',
+        '''
 import 'dart:math' as m;
 main() {
   new m.Random(!1);
-}''', <String>["1+Random:ARGUMENT_LIST"], failingTests: '1');
+}''',
+        <String>["1+Random:ARGUMENT_LIST"],
+        failingTests: '1');
 
-    buildTests('testCompletion_dartDoc_reference_forClass', '''
+    buildTests(
+        'testCompletion_dartDoc_reference_forClass',
+        '''
 /**
  * [int!1]
  * [method!2]
  */
 class AAA {
   methodA() {}
-}''', <String>["1+int", "1-method", "2+methodA", "2-int"]);
+}''',
+        <String>["1+int", "1-method", "2+methodA", "2-int"]);
 
-    buildTests('testCompletion_dartDoc_reference_forConstructor', '''
+    buildTests(
+        'testCompletion_dartDoc_reference_forConstructor',
+        '''
 class A {
   /**
    * [aa!1]
@@ -897,43 +1208,54 @@
    */
   A.named(aaa, bbb) {}
   methodA() {}
-}''', <String>["1+aaa", "1-bbb", "2+int", "2-double", "3+methodA"]);
+}''',
+        <String>["1+aaa", "1-bbb", "2+int", "2-double", "3+methodA"]);
 
-    buildTests('testCompletion_dartDoc_reference_forFunction', '''
+    buildTests(
+        'testCompletion_dartDoc_reference_forFunction',
+        '''
 /**
  * [aa!1]
  * [int!2]
  * [function!3]
  */
 functionA(aaa, bbb) {}
-functionB() {}''', <String>[
-      "1+aaa",
-      "1-bbb",
-      "2+int",
-      "2-double",
-      "3+functionA",
-      "3+functionB",
-      "3-int"
-    ], failingTests: '1');
+functionB() {}''',
+        <String>[
+          "1+aaa",
+          "1-bbb",
+          "2+int",
+          "2-double",
+          "3+functionA",
+          "3+functionB",
+          "3-int"
+        ],
+        failingTests: '1');
 
-    buildTests('testCompletion_dartDoc_reference_forFunctionTypeAlias', '''
+    buildTests(
+        'testCompletion_dartDoc_reference_forFunctionTypeAlias',
+        '''
 /**
  * [aa!1]
  * [int!2]
  * [Function!3]
  */
 typedef FunctionA(aaa, bbb) {}
-typedef FunctionB() {}''', <String>[
-      "1+aaa",
-      "1-bbb",
-      "2+int",
-      "2-double",
-      "3+FunctionA",
-      "3+FunctionB",
-      "3-int"
-    ], failingTests: '1');
+typedef FunctionB() {}''',
+        <String>[
+          "1+aaa",
+          "1-bbb",
+          "2+int",
+          "2-double",
+          "3+FunctionA",
+          "3+FunctionB",
+          "3-int"
+        ],
+        failingTests: '1');
 
-    buildTests('testCompletion_dartDoc_reference_forMethod', '''
+    buildTests(
+        'testCompletion_dartDoc_reference_forMethod',
+        '''
 class A {
   /**
    * [aa!1]
@@ -942,7 +1264,8 @@
    */
   methodA(aaa, bbb) {}
   methodB() {}
-}''', <String>[
+}''',
+        <String>[
       "1+aaa",
       "1-bbb",
       "2+int",
@@ -952,7 +1275,9 @@
       "3-int"
     ]);
 
-    buildTests('testCompletion_dartDoc_reference_incomplete', '''
+    buildTests(
+        'testCompletion_dartDoc_reference_incomplete',
+        '''
 /**
  * [doubl!1 some text
  * other text
@@ -966,7 +1291,8 @@
 /**
  * [!3] some text
  */
-class C {}''', <String>[
+class C {}''',
+        <String>[
       "1+double",
       "1-int",
       "2+int",
@@ -975,25 +1301,34 @@
       "3+String"
     ]);
 
-    buildTests('testCompletion_double_inFractionPart', '''
+    buildTests(
+        'testCompletion_double_inFractionPart',
+        '''
 main() {
   1.0!1
-}''', <String>["1-abs", "1-main"]);
+}''',
+        <String>["1-abs", "1-main"]);
 
-    buildTests('testCompletion_enum', '''
+    buildTests(
+        'testCompletion_enum',
+        '''
 enum MyEnum {A, B, C}
 main() {
   MyEnum.!1;
-}''', <String>["1+values", "1+A", "1+B", "1+C"]);
+}''',
+        <String>["1+values", "1+A", "1+B", "1+C"]);
 
-    buildTests('testCompletion_exactPrefix_hasHigherRelevance', '''
+    buildTests(
+        'testCompletion_exactPrefix_hasHigherRelevance',
+        '''
 var STR;
 main(p) {
   var str;
   str!1;
   STR!2;
   Str!3;
-}''', <String>[
+}''',
+        <String>[
       "1+str" /*",rel=" + (CompletionProposal.RELEVANCE_DEFAULT + 1)*/,
       "1+STR" /*",rel=" + (CompletionProposal.RELEVANCE_DEFAULT + 0)*/,
       "2+STR" /*",rel=" + (CompletionProposal.RELEVANCE_DEFAULT + 1)*/,
@@ -1003,68 +1338,115 @@
       "3+str" /*",rel=" + (CompletionProposal.RELEVANCE_DEFAULT + 0)*/
     ]);
 
-    buildTests('testCompletion_export_dart', '''
+    buildTests(
+        'testCompletion_export_dart',
+        '''
 import 'dart:math
 import 'dart:_chrome
 import 'dart:_collection.dev
-export 'dart:!1''', <String>[
-      "1+dart:core",
-      "1+dart:math",
-      "1-dart:_chrome",
-      "1-dart:_collection.dev"
-    ], failingTests: '1');
+export 'dart:!1''',
+        <String>[
+          "1+dart:core",
+          "1+dart:math",
+          "1-dart:_chrome",
+          "1-dart:_collection.dev"
+        ],
+        failingTests: '1');
 
-    buildTests('testCompletion_export_noStringLiteral_noSemicolon', '''
+    buildTests(
+        'testCompletion_export_noStringLiteral_noSemicolon',
+        '''
 import !1
 
-class A {}''', <String>["1+'dart:!';", "1+'package:!';"], failingTests: '1');
+class A {}''',
+        <String>["1+'dart:!';", "1+'package:!';"],
+        failingTests: '1');
 
-    buildTests('testCompletion_forStmt_vars', '''
+    buildTests(
+        'testCompletion_forStmt_vars',
+        '''
 class int{}class Foo { mth() { for (in!1t i = 0; i!2 < 5; i!3++); }}''',
         <String>["1+int", "2+i", "3+i"]);
 
-    buildTests('testCompletion_function', '''
+    buildTests(
+        'testCompletion_function',
+        '''
 class Foo { int boo = 7; mth() { PNGS.sort((String a, Str!1) => a.compareTo(b)); }}''',
         <String>["1+String"]);
 
-    buildTests('testCompletion_function_partial', '''
+    buildTests(
+        'testCompletion_function_partial',
+        '''
 class Foo { int boo = 7; mth() { PNGS.sort((String a, Str!1)); }}''',
         <String>["1+String"]);
 
-    buildTests('testCompletion_functionTypeParameter_namedArgument', '''
+    buildTests(
+        'testCompletion_functionTypeParameter_namedArgument',
+        '''
 typedef FFF(a, b, {x1, x2, y});
 main(FFF fff) {
   fff(1, 2, !1)!2;
-}''', <String>["1+x1", "2-x2"], failingTests: '1');
+}''',
+        <String>["1+x1", "2-x2"],
+        failingTests: '1');
 
-    buildTests('testCompletion_ifStmt_field1', '''
-class Foo { int myField = 7; mth() { if (!1) {}}}''', <String>["1+myField"]);
+    buildTests(
+        'testCompletion_ifStmt_field1',
+        '''
+class Foo { int myField = 7; mth() { if (!1) {}}}''',
+        <String>["1+myField"]);
 
-    buildTests('testCompletion_ifStmt_field1a', '''
-class Foo { int myField = 7; mth() { if (!1) }}''', <String>["1+myField"]);
+    buildTests(
+        'testCompletion_ifStmt_field1a',
+        '''
+class Foo { int myField = 7; mth() { if (!1) }}''',
+        <String>["1+myField"]);
 
-    buildTests('testCompletion_ifStmt_field2', '''
-class Foo { int myField = 7; mth() { if (m!1) {}}}''', <String>["1+myField"]);
+    buildTests(
+        'testCompletion_ifStmt_field2',
+        '''
+class Foo { int myField = 7; mth() { if (m!1) {}}}''',
+        <String>["1+myField"]);
 
-    buildTests('testCompletion_ifStmt_field2a', '''
-class Foo { int myField = 7; mth() { if (m!1) }}''', <String>["1+myField"]);
+    buildTests(
+        'testCompletion_ifStmt_field2a',
+        '''
+class Foo { int myField = 7; mth() { if (m!1) }}''',
+        <String>["1+myField"]);
 
-    buildTests('testCompletion_ifStmt_field2b', '''
-class Foo { myField = 7; mth() { if (m!1) {}}}''', <String>["1+myField"]);
+    buildTests(
+        'testCompletion_ifStmt_field2b',
+        '''
+class Foo { myField = 7; mth() { if (m!1) {}}}''',
+        <String>["1+myField"]);
 
-    buildTests('testCompletion_ifStmt_localVar', '''
-class Foo { mth() { int value = 7; if (v!1) {}}}''', <String>["1+value"]);
+    buildTests(
+        'testCompletion_ifStmt_localVar',
+        '''
+class Foo { mth() { int value = 7; if (v!1) {}}}''',
+        <String>["1+value"]);
 
-    buildTests('testCompletion_ifStmt_localVara', '''
-class Foo { mth() { value = 7; if (v!1) {}}}''', <String>["1-value"]);
+    buildTests(
+        'testCompletion_ifStmt_localVara',
+        '''
+class Foo { mth() { value = 7; if (v!1) {}}}''',
+        <String>["1-value"]);
 
-    buildTests('testCompletion_ifStmt_topLevelVar', '''
-int topValue = 7; class Foo { mth() { if (t!1) {}}}''', <String>["1+topValue"]);
+    buildTests(
+        'testCompletion_ifStmt_topLevelVar',
+        '''
+int topValue = 7; class Foo { mth() { if (t!1) {}}}''',
+        <String>["1+topValue"]);
 
-    buildTests('testCompletion_ifStmt_topLevelVara', '''
-topValue = 7; class Foo { mth() { if (t!1) {}}}''', <String>["1+topValue"]);
+    buildTests(
+        'testCompletion_ifStmt_topLevelVara',
+        '''
+topValue = 7; class Foo { mth() { if (t!1) {}}}''',
+        <String>["1+topValue"]);
 
-    buildTests('testCompletion_ifStmt_unionType_nonStrict', '''
+    buildTests(
+        'testCompletion_ifStmt_unionType_nonStrict',
+        '''
 class A { a() => null; x() => null}
 class B { a() => null; y() => null}
 void main() {
@@ -1076,9 +1458,13 @@
     x = new B();
   }
   x.!1;
-}''', <String>["1+a", "1+x", "1+y"], failingTests: '1');
+}''',
+        <String>["1+a", "1+x", "1+y"],
+        failingTests: '1');
 
-    buildTests('testCompletion_ifStmt_unionType_strict', '''
+    buildTests(
+        'testCompletion_ifStmt_unionType_strict',
+        '''
 class A { a() => null; x() => null}
 class B { a() => null; y() => null}
 void main() {
@@ -1090,74 +1476,116 @@
     x = new B();
   }
   x.!1;
-}''', <String>["1+a", "1-x", "1-y"], failingTests: '1');
+}''',
+        <String>["1+a", "1-x", "1-y"],
+        failingTests: '1');
 
-    buildTests('testCompletion_import', '''
-import '!1';''', <String>["1+dart:!", "1+package:!"]);
+    buildTests(
+        'testCompletion_import',
+        '''
+import '!1';''',
+        <String>["1+dart:!", "1+package:!"]);
 
-    buildTests('testCompletion_import_dart', '''
+    buildTests(
+        'testCompletion_import_dart',
+        '''
 import 'dart:math
 import 'dart:_chrome
 import 'dart:_collection.dev
-import 'dart:!1''', <String>[
-      "1+dart:core",
-      "1+dart:math",
-      "1-dart:_chrome",
-      "1-dart:_collection.dev"
-    ], failingTests: '1');
+import 'dart:!1''',
+        <String>[
+          "1+dart:core",
+          "1+dart:math",
+          "1-dart:_chrome",
+          "1-dart:_collection.dev"
+        ],
+        failingTests: '1');
 
-    buildTests('testCompletion_import_hasStringLiteral_noSemicolon', '''
+    buildTests(
+        'testCompletion_import_hasStringLiteral_noSemicolon',
+        '''
 import '!1'
 
-class A {}''', <String>["1+dart:!", "1+package:!"]);
+class A {}''',
+        <String>["1+dart:!", "1+package:!"]);
 
-    buildTests('testCompletion_import_noSpace', '''
-import!1''', <String>["1+ 'dart:!';", "1+ 'package:!';"], failingTests: '1');
+    buildTests(
+        'testCompletion_import_noSpace',
+        '''
+import!1''',
+        <String>["1+ 'dart:!';", "1+ 'package:!';"],
+        failingTests: '1');
 
-    buildTests('testCompletion_import_noStringLiteral', '''
-import !1;''', <String>["1+'dart:!'", "1+'package:!'"], failingTests: '1');
+    buildTests(
+        'testCompletion_import_noStringLiteral',
+        '''
+import !1;''',
+        <String>["1+'dart:!'", "1+'package:!'"],
+        failingTests: '1');
 
-    buildTests('testCompletion_import_noStringLiteral_noSemicolon', '''
+    buildTests(
+        'testCompletion_import_noStringLiteral_noSemicolon',
+        '''
 import !1
 
-class A {}''', <String>["1+'dart:!';", "1+'package:!';"], failingTests: '1');
+class A {}''',
+        <String>["1+'dart:!';", "1+'package:!';"],
+        failingTests: '1');
 
-    buildTests('testCompletion_incompleteClassMember', '''
+    buildTests(
+        'testCompletion_incompleteClassMember',
+        '''
 class A {
   Str!1
   final f = null;
-}''', <String>["1+String", "1-bool"]);
+}''',
+        <String>["1+String", "1-bool"]);
 
-    buildTests('testCompletion_incompleteClosure_parameterType', '''
+    buildTests(
+        'testCompletion_incompleteClosure_parameterType',
+        '''
 f1(cb(String s)) {}
 f2(String s) {}
 main() {
   f1((Str!1));
   f2((Str!2));
-}''', <String>["1+String", "1-bool", "2+String", "2-bool"]);
+}''',
+        <String>["1+String", "1-bool", "2+String", "2-bool"]);
 
-    buildTests('testCompletion_inPeriodPeriod', '''
+    buildTests(
+        'testCompletion_inPeriodPeriod',
+        '''
 main(String str) {
   1 < str.!1.length;
   1 + str.!2.length;
   1 + 2 * str.!3.length;
-}''', <String>["1+codeUnits", "2+codeUnits", "3+codeUnits"],
+}''',
+        <String>["1+codeUnits", "2+codeUnits", "3+codeUnits"],
         failingTests: '123');
 
     // no checks, but no exceptions
-    buildTests('testCompletion_instanceCreation_unresolved', '''
+    buildTests(
+        'testCompletion_instanceCreation_unresolved',
+        '''
 class A {
 }
 main() {
   new NoSuchClass(!1);
   new A.noSuchConstructor(!2);
-}''', <String>["1+int", "2+int"]);
+}''',
+        <String>["1+int", "2+int"]);
 
-    buildTests('testCompletion_import_lib', '''
-import '!1''', <String>["1+my_lib.dart"],
-        extraFiles: <String, String>{"/my_lib.dart": ""}, failingTests: '1');
+    buildTests(
+        'testCompletion_import_lib',
+        '''
+import '!1''',
+        <String>["1+my_lib.dart"],
+        extraFiles: <String, String>{"/my_lib.dart": ""},
+        failingTests: '1');
 
-    buildTests('testCompletion_is', '''
+    buildTests(
+        'testCompletion_is',
+        '''
 class MyClass {}
 main(p) {
   var isVariable;
@@ -1165,23 +1593,29 @@
   var v1 = p is MyCla!2;
   var v2 = p is !3;
   var v2 = p is!4;
-}''', <String>[
+}''',
+        <String>[
       "1+MyClass",
       "2+MyClass",
       "3+MyClass",
       "3-v1",
       "4+is",
       "4-isVariable"
-    ], failingTests: '4');
+    ]);
 
-    buildTests('testCompletion_is_asIdentifierStart', '''
+    buildTests(
+        'testCompletion_is_asIdentifierStart',
+        '''
 main(p) {
   var isVisible;
   var v1 = is!1;
   var v2 = is!2
-}''', <String>["1+isVisible", "2+isVisible"]);
+}''',
+        <String>["1+isVisible", "2+isVisible"]);
 
-    buildTests('testCompletion_is_asPrefixedIdentifierStart', '''
+    buildTests(
+        'testCompletion_is_asPrefixedIdentifierStart',
+        '''
 class A {
   var isVisible;
 }
@@ -1189,39 +1623,60 @@
 main(A p) {
   var v1 = p.is!1;
   var v2 = p.is!2
-}''', <String>["1+isVisible", "2+isVisible"]);
+}''',
+        <String>["1+isVisible", "2+isVisible"]);
 
-    buildTests('testCompletion_is_incompleteStatement1', '''
+    buildTests(
+        'testCompletion_is_incompleteStatement1',
+        '''
 class MyClass {}
 main(p) {
   var justSomeVar;
   var v = p is !1
-}''', <String>["1+MyClass", "1-justSomeVar"]);
+}''',
+        <String>["1+MyClass", "1-justSomeVar"]);
 
-    buildTests('testCompletion_is_incompleteStatement2', '''
+    buildTests(
+        'testCompletion_is_incompleteStatement2',
+        '''
 class MyClass {}
 main(p) {
   var isVariable;
   var v = p is!1
-}''', <String>["1+is", "1-isVariable"], failingTests: '1');
+}''',
+        <String>["1+is", "1-isVariable"]);
 
-    buildTests('testCompletion_keyword_in', '''
-class Foo { int input = 7; mth() { if (in!1) {}}}''', <String>["1+input"]);
+    buildTests(
+        'testCompletion_keyword_in',
+        '''
+class Foo { int input = 7; mth() { if (in!1) {}}}''',
+        <String>["1+input"]);
 
-    buildTests('testCompletion_keyword_syntheticIdentifier', '''
+    buildTests(
+        'testCompletion_keyword_syntheticIdentifier',
+        '''
 main() {
   var caseVar;
   var otherVar;
   var v = case!1
-}''', <String>["1+caseVar", "1-otherVar"]);
+}''',
+        <String>["1+caseVar", "1-otherVar"]);
 
-    buildTests('testCompletion_libraryIdentifier_atEOF', '''
-library int.!1''', <String>["1-parse", "1-bool"]);
+    buildTests(
+        'testCompletion_libraryIdentifier_atEOF',
+        '''
+library int.!1''',
+        <String>["1-parse", "1-bool"]);
 
-    buildTests('testCompletion_libraryIdentifier_notEOF', '''
-library int.!1''', <String>["1-parse", "1-bool"]);
+    buildTests(
+        'testCompletion_libraryIdentifier_notEOF',
+        '''
+library int.!1''',
+        <String>["1-parse", "1-bool"]);
 
-    buildTests('testCompletion_methodRef_asArg_incompatibleFunctionType', '''
+    buildTests(
+        'testCompletion_methodRef_asArg_incompatibleFunctionType',
+        '''
 foo( f(int p) ) {}
 class Functions {
   static myFuncInt(int p) {}
@@ -1230,12 +1685,16 @@
 bar(p) {}
 main(p) {
   foo( Functions.!1; );
-}''', <String>[
-      "1+myFuncInt" /*":" + ProposalKind.METHOD_NAME*/,
-      "1-myFuncDouble" /*":" + ProposalKind.METHOD_NAME*/
-    ], failingTests: '1');
+}''',
+        <String>[
+          "1+myFuncInt" /*":" + ProposalKind.METHOD_NAME*/,
+          "1-myFuncDouble" /*":" + ProposalKind.METHOD_NAME*/
+        ],
+        failingTests: '1');
 
-    buildTests('testCompletion_methodRef_asArg_notFunctionType', '''
+    buildTests(
+        'testCompletion_methodRef_asArg_notFunctionType',
+        '''
 foo( f(int p) ) {}
 class Functions {
   static myFunc(int p) {}
@@ -1243,91 +1702,133 @@
 bar(p) {}
 main(p) {
   foo( (int p) => Functions.!1; );
-}''', <String>[
-      "1+myFunc" /*":" + ProposalKind.METHOD*/,
-      "1-myFunc" /*":" + ProposalKind.METHOD_NAME*/
-    ], failingTests: '1');
+}''',
+        <String>[
+          "1+myFunc" /*":" + ProposalKind.METHOD*/,
+          "1-myFunc" /*":" + ProposalKind.METHOD_NAME*/
+        ],
+        failingTests: '1');
 
-    buildTests('testCompletion_methodRef_asArg_ofFunctionType', '''
+    buildTests(
+        'testCompletion_methodRef_asArg_ofFunctionType',
+        '''
 foo( f(int p) ) {}
 class Functions {
   static int myFunc(int p) {}
 }
 main(p) {
   foo(Functions.!1);
-}''', <String>[
+}''',
+        <String>[
       "1+myFunc" /*":" + ProposalKind.METHOD*/,
       "1+myFunc" /*":" + ProposalKind.METHOD_NAME*/
     ]);
 
-    buildTests('testCompletion_namedArgument_alreadyUsed', '''
-func({foo}) {} main() { func(foo: 0, fo!1); }''', <String>["1-foo"]);
+    buildTests(
+        'testCompletion_namedArgument_alreadyUsed',
+        '''
+func({foo}) {} main() { func(foo: 0, fo!1); }''',
+        <String>["1-foo"]);
 
-    buildTests('testCompletion_namedArgument_constructor', '''
+    buildTests(
+        'testCompletion_namedArgument_constructor',
+        '''
 class A {A({foo, bar}) {}} main() { new A(fo!1); }''',
-        <String>["1+foo", "1-bar"], failingTests: '1');
+        <String>["1+foo", "1-bar"],
+        failingTests: '1');
 
-    buildTests('testCompletion_namedArgument_empty', '''
-func({foo, bar}) {} main() { func(!1); }''', <String>[
-      "1+foo" /*":" + ProposalKind.NAMED_ARGUMENT*/,
-      "1-foo" /*":" + ProposalKind.OPTIONAL_ARGUMENT*/
-    ], failingTests: '1');
+    buildTests(
+        'testCompletion_namedArgument_empty',
+        '''
+func({foo, bar}) {} main() { func(!1); }''',
+        <String>[
+          "1+foo" /*":" + ProposalKind.NAMED_ARGUMENT*/,
+          "1-foo" /*":" + ProposalKind.OPTIONAL_ARGUMENT*/
+        ],
+        failingTests: '1');
 
-    buildTests('testCompletion_namedArgument_function', '''
+    buildTests(
+        'testCompletion_namedArgument_function',
+        '''
 func({foo, bar}) {} main() { func(fo!1); }''',
-        <String>["1+foo", "1-bar"], failingTests: '1');
+        <String>["1+foo", "1-bar"],
+        failingTests: '1');
 
-    buildTests('testCompletion_namedArgument_notNamed', '''
-func([foo]) {} main() { func(fo!1); }''', <String>["1-foo"]);
+    buildTests(
+        'testCompletion_namedArgument_notNamed',
+        '''
+func([foo]) {} main() { func(fo!1); }''',
+        <String>["1-foo"]);
 
-    buildTests('testCompletion_namedArgument_unresolvedFunction', '''
-main() { func(fo!1); }''', <String>["1-foo"]);
+    buildTests(
+        'testCompletion_namedArgument_unresolvedFunction',
+        '''
+main() { func(fo!1); }''',
+        <String>["1-foo"]);
 
-    buildTests('testCompletion_newMemberType1', '''
+    buildTests(
+        'testCompletion_newMemberType1',
+        '''
 class Collection{}class List extends Collection{}class Foo { !1 }''',
         <String>["1+Collection", "1+List"]);
 
-    buildTests('testCompletion_newMemberType2', '''
+    buildTests(
+        'testCompletion_newMemberType2',
+        '''
 class Collection{}class List extends Collection{}class Foo {!1}''',
         <String>["1+Collection", "1+List"]);
 
-    buildTests('testCompletion_newMemberType3', '''
+    buildTests(
+        'testCompletion_newMemberType3',
+        '''
 class Collection{}class List extends Collection{}class Foo {L!1}''',
         <String>["1-Collection", "1+List"]);
 
-    buildTests('testCompletion_newMemberType4', '''
+    buildTests(
+        'testCompletion_newMemberType4',
+        '''
 class Collection{}class List extends Collection{}class Foo {C!1}''',
         <String>["1+Collection", "1-List"]);
 
-    buildTests('testCompletion_positionalArgument_constructor', '''
+    buildTests(
+        'testCompletion_positionalArgument_constructor',
+        '''
 class A {
   A([foo, bar]);
 }
 main() {
   new A(!1);
   new A(0, !2);
-}''', <String>[
-      "1+foo" /*":" + ProposalKind.OPTIONAL_ARGUMENT*/,
-      "1-bar",
-      "2-foo",
-      "2+bar" /*":"
+}''',
+        <String>[
+          "1+foo" /*":" + ProposalKind.OPTIONAL_ARGUMENT*/,
+          "1-bar",
+          "2-foo",
+          "2+bar" /*":"
         + ProposalKind.OPTIONAL_ARGUMENT*/
-    ], failingTests: '12');
+        ],
+        failingTests: '12');
 
-    buildTests('testCompletion_positionalArgument_function', '''
+    buildTests(
+        'testCompletion_positionalArgument_function',
+        '''
 func([foo, bar]) {}
 main() {
   func(!1);
   func(0, !2);
-}''', <String>[
-      "1+foo" /*":" + ProposalKind.OPTIONAL_ARGUMENT*/,
-      "1-bar",
-      "2-foo",
-      "2+bar" /*":"
+}''',
+        <String>[
+          "1+foo" /*":" + ProposalKind.OPTIONAL_ARGUMENT*/,
+          "1-bar",
+          "2-foo",
+          "2+bar" /*":"
         + ProposalKind.OPTIONAL_ARGUMENT*/
-    ], failingTests: '12');
+        ],
+        failingTests: '12');
 
-    buildTests('testCompletion_preferStaticType', '''
+    buildTests(
+        'testCompletion_preferStaticType',
+        '''
 class A {
   foo() {}
 }
@@ -1337,40 +1838,53 @@
 main() {
   A v = new B();
   v.!1
-}''', <String>[
-      "1+foo",
-      "1-bar,potential=false,declaringType=B",
-      "1+bar,potential=true,declaringType=B"
-    ], failingTests: '1');
+}''',
+        <String>[
+          "1+foo",
+          "1-bar,potential=false,declaringType=B",
+          "1+bar,potential=true,declaringType=B"
+        ],
+        failingTests: '1');
 
-    buildTests('testCompletion_privateElement_sameLibrary_constructor', '''
+    buildTests(
+        'testCompletion_privateElement_sameLibrary_constructor',
+        '''
 class A {
   A._c();
   A.c();
 }
 main() {
   new A.!1
-}''', <String>["1+_c", "1+c"]);
+}''',
+        <String>["1+_c", "1+c"]);
 
-    buildTests('testCompletion_privateElement_sameLibrary_member', '''
+    buildTests(
+        'testCompletion_privateElement_sameLibrary_member',
+        '''
 class A {
   _m() {}
   m() {}
 }
 main(A a) {
   a.!1
-}''', <String>["1+_m", "1+m"]);
+}''',
+        <String>["1+_m", "1+m"]);
 
-    buildTests('testCompletion_propertyAccess_whenClassTarget', '''
+    buildTests(
+        'testCompletion_propertyAccess_whenClassTarget',
+        '''
 class A {
   static int FIELD;
   int field;
 }
 main() {
   A.!1
-}''', <String>["1+FIELD", "1-field"]);
+}''',
+        <String>["1+FIELD", "1-field"]);
 
-    buildTests('testCompletion_propertyAccess_whenClassTarget_excludeSuper', '''
+    buildTests(
+        'testCompletion_propertyAccess_whenClassTarget_excludeSuper',
+        '''
 class A {
   static int FIELD_A;
   static int methodA() {}
@@ -1381,10 +1895,13 @@
 }
 main() {
   B.!1;
-}''', <String>["1+FIELD_B", "1-FIELD_A", "1+methodB", "1-methodA"],
+}''',
+        <String>["1+FIELD_B", "1-FIELD_A", "1+methodB", "1-methodA"],
         failingTests: '1');
 
-    buildTests('testCompletion_propertyAccess_whenInstanceTarget', '''
+    buildTests(
+        'testCompletion_propertyAccess_whenInstanceTarget',
+        '''
 class A {
   static int FIELD;
   int fieldA;
@@ -1398,19 +1915,30 @@
 main(B b, C c) {
   b.a.!1;
   c.!2;
-}''', <String>["1-FIELD", "1+fieldA", "2+fieldC", "2+fieldA"]);
+}''',
+        <String>["1-FIELD", "1+fieldA", "2+fieldC", "2+fieldA"]);
 
-    buildTests('testCompletion_return_withIdentifierPrefix', '''
-f() { var vvv = 42; return v!1 }''', <String>["1+vvv"]);
+    buildTests(
+        'testCompletion_return_withIdentifierPrefix',
+        '''
+f() { var vvv = 42; return v!1 }''',
+        <String>["1+vvv"]);
 
-    buildTests('testCompletion_return_withoutExpression', '''
-f() { var vvv = 42; return !1 }''', <String>["1+vvv"]);
+    buildTests(
+        'testCompletion_return_withoutExpression',
+        '''
+f() { var vvv = 42; return !1 }''',
+        <String>["1+vvv"]);
 
-    buildTests('testCompletion_staticField1', '''
+    buildTests(
+        'testCompletion_staticField1',
+        '''
 class num{}class Sunflower {static final n!2um MAX_D = 300;nu!3m xc, yc;Sun!4flower() {x!Xc = y!Yc = MA!1 }}''',
         <String>["1+MAX_D", "X+xc", "Y+yc", "2+num", "3+num", "4+Sunflower"]);
 
-    buildTests('testCompletion_super_superType', '''
+    buildTests(
+        'testCompletion_super_superType',
+        '''
 class A {
   var fa;
   ma() {}
@@ -1421,9 +1949,12 @@
   main() {
     super.!1
   }
-}''', <String>["1+fa", "1-fb", "1+ma", "1-mb"]);
+}''',
+        <String>["1+fa", "1-fb", "1+ma", "1-mb"]);
 
-    buildTests('testCompletion_superConstructorInvocation_noNamePrefix', '''
+    buildTests(
+        'testCompletion_superConstructorInvocation_noNamePrefix',
+        '''
 class A {
   A.fooA();
   A.fooB();
@@ -1431,9 +1962,13 @@
 }
 class B extends A {
   B() : super.!1
-}''', <String>["1+fooA", "1+fooB", "1+bar"], failingTests: '1');
+}''',
+        <String>["1+fooA", "1+fooB", "1+bar"],
+        failingTests: '1');
 
-    buildTests('testCompletion_superConstructorInvocation_withNamePrefix', '''
+    buildTests(
+        'testCompletion_superConstructorInvocation_withNamePrefix',
+        '''
 class A {
   A.fooA();
   A.fooB();
@@ -1441,44 +1976,71 @@
 }
 class B extends A {
   B() : super.f!1
-}''', <String>["1+fooA", "1+fooB", "1-bar"], failingTests: '1');
+}''',
+        <String>["1+fooA", "1+fooB", "1-bar"],
+        failingTests: '1');
 
-    buildTests('testCompletion_this_bad_inConstructorInitializer', '''
+    buildTests(
+        'testCompletion_this_bad_inConstructorInitializer',
+        '''
 class A {
   var f;
   A() : f = this.!1;
-}''', <String>["1-toString"], failingTests: '1');
+}''',
+        <String>["1-toString"],
+        failingTests: '1');
 
-    buildTests('testCompletion_this_bad_inFieldDeclaration', '''
+    buildTests(
+        'testCompletion_this_bad_inFieldDeclaration',
+        '''
 class A {
   var f = this.!1;
-}''', <String>["1-toString"], failingTests: '1');
+}''',
+        <String>["1-toString"],
+        failingTests: '1');
 
-    buildTests('testCompletion_this_bad_inStaticMethod', '''
+    buildTests(
+        'testCompletion_this_bad_inStaticMethod',
+        '''
 class A {
   static m() {
     this.!1;
   }
-}''', <String>["1-toString"], failingTests: '1');
+}''',
+        <String>["1-toString"],
+        failingTests: '1');
 
-    buildTests('testCompletion_this_bad_inTopLevelFunction', '''
+    buildTests(
+        'testCompletion_this_bad_inTopLevelFunction',
+        '''
 main() {
   this.!1;
-}''', <String>["1-toString"], failingTests: '1');
+}''',
+        <String>["1-toString"],
+        failingTests: '1');
 
-    buildTests('testCompletion_this_bad_inTopLevelVariableDeclaration', '''
-var v = this.!1;''', <String>["1-toString"], failingTests: '1');
+    buildTests(
+        'testCompletion_this_bad_inTopLevelVariableDeclaration',
+        '''
+var v = this.!1;''',
+        <String>["1-toString"],
+        failingTests: '1');
 
-    buildTests('testCompletion_this_OK_inConstructorBody', '''
+    buildTests(
+        'testCompletion_this_OK_inConstructorBody',
+        '''
 class A {
   var f;
   m() {}
   A() {
     this.!1;
   }
-}''', <String>["1+f", "1+m"]);
+}''',
+        <String>["1+f", "1+m"]);
 
-    buildTests('testCompletion_this_OK_localAndSuper', '''
+    buildTests(
+        'testCompletion_this_OK_localAndSuper',
+        '''
 class A {
   var fa;
   ma() {}
@@ -1489,49 +2051,70 @@
   main() {
     this.!1
   }
-}''', <String>["1+fa", "1+fb", "1+ma", "1+mb"]);
+}''',
+        <String>["1+fa", "1+fb", "1+ma", "1+mb"]);
 
-    buildTests('testCompletion_topLevelField_init2', '''
+    buildTests(
+        'testCompletion_topLevelField_init2',
+        '''
 class DateTime{static var JUN;}final num M = Dat!1eTime.JUN;''',
         <String>["1+DateTime", "1-void"]);
 
-    buildTests('testCompletion_while', '''
-class Foo { int boo = 7; mth() { while (b!1) {} }}''', <String>["1+boo"]);
+    buildTests(
+        'testCompletion_while',
+        '''
+class Foo { int boo = 7; mth() { while (b!1) {} }}''',
+        <String>["1+boo"]);
   }
 
   void buildLibraryTests() {
     Map<String, String> sources = new HashMap<String, String>();
 
-    buildTests('test_export_ignoreIfThisLibraryExports', '''
+    buildTests(
+        'test_export_ignoreIfThisLibraryExports',
+        '''
 export 'dart:math';
 libFunction() {};
 main() {
   !1
-}''', <String>["1-cos", "1+libFunction"]);
+}''',
+        <String>["1-cos", "1+libFunction"]);
 
     sources.clear();
     sources["/lib.dart"] = '''
 library lib;
 export 'dart:math' hide sin;
 libFunction() {};''';
-    buildTests('test_export_showIfImportLibraryWithExport', '''
+    buildTests(
+        'test_export_showIfImportLibraryWithExport',
+        '''
 import 'lib.dart' as p;
 main() {
   p.!1
-}''', <String>["1+cos", "1-sin", "1+libFunction"],
-        extraFiles: sources, failingTests: '1');
+}''',
+        <String>["1+cos", "1-sin", "1+libFunction"],
+        extraFiles: sources,
+        failingTests: '1');
 
-    buildTests('test_importPrefix_hideCombinator', '''
+    buildTests(
+        'test_importPrefix_hideCombinator',
+        '''
 import 'dart:math' as math hide PI;
 main() {
   math.!1
-}''', <String>["1-PI", "1+LN10"], failingTests: '1');
+}''',
+        <String>["1-PI", "1+LN10"],
+        failingTests: '1');
 
-    buildTests('test_importPrefix_showCombinator', '''
+    buildTests(
+        'test_importPrefix_showCombinator',
+        '''
 import 'dart:math' as math show PI;
 main() {
   math.!1
-}''', <String>["1+PI", "1-LN10"], failingTests: '1');
+}''',
+        <String>["1+PI", "1-LN10"],
+        failingTests: '1');
 
     sources.clear();
     sources["/lib.dart"] = '''
@@ -1541,11 +2124,16 @@
 
 class A extends _A {
 }''';
-    buildTests('test_memberOfPrivateClass_otherLibrary', '''
+    buildTests(
+        'test_memberOfPrivateClass_otherLibrary',
+        '''
 import 'lib.dart';
 main(A a) {
   a.!1
-}''', <String>["1+foo"], extraFiles: sources, failingTests: '1');
+}''',
+        <String>["1+foo"],
+        extraFiles: sources,
+        failingTests: '1');
 
     sources.clear();
     sources["/lib.dart"] = '''
@@ -1554,11 +2142,15 @@
   A.c();
   A._c();
 }''';
-    buildTests('test_noPrivateElement_otherLibrary_constructor', '''
+    buildTests(
+        'test_noPrivateElement_otherLibrary_constructor',
+        '''
 import 'lib.dart';
 main() {
   new A.!1
-}''', <String>["1-_c", "1+c"], failingTests: '1');
+}''',
+        <String>["1-_c", "1+c"],
+        failingTests: '1');
 
     sources.clear();
     sources["/lib.dart"] = '''
@@ -1567,12 +2159,16 @@
   var f;
   var _f;
 }''';
-    buildTests('test_noPrivateElement_otherLibrary_member', '''
+    buildTests(
+        'test_noPrivateElement_otherLibrary_member',
+        '''
               import 'lib.dart';
               main(A a) {
                 a.!1
-              }''', <String>["1-_f", "1+f"],
-        extraFiles: sources, failingTests: '1');
+              }''',
+        <String>["1-_f", "1+f"],
+        extraFiles: sources,
+        failingTests: '1');
 
     sources.clear();
     sources["/firth.dart"] = '''
@@ -1580,34 +2176,41 @@
 class SerializationException {
   const SerializationException();
 }''';
-    buildTests('testLibrary001', '''
+    buildTests(
+        'testLibrary001',
+        '''
 import 'firth.dart';
 main() {
-throw new Seria!1lizationException();}''', <String>["1+SerializationException"],
-        extraFiles: sources, failingTests: '1');
+throw new Seria!1lizationException();}''',
+        <String>["1+SerializationException"],
+        extraFiles: sources,
+        failingTests: '1');
 
     // Type propagation.
     // TODO Include corelib analysis (this works in the editor)
-    buildTests('testLibrary002',
+    buildTests(
+        'testLibrary002',
         '''t2() {var q=[0],z=q.!1length;q.!2clear();}''',
-        <String>["1+length", "1+isEmpty", "2+clear"], failingTests: '1');
+        <String>["1+length", "1+isEmpty", "2+clear"],
+        failingTests: '1');
 
     // TODO Include corelib analysis
-    buildTests('testLibrary003', '''class X{var q; f() {q.!1a!2}}''', <String>[
-      "1+end",
-      "2+abs",
-      "2-end"
-    ], failingTests: '12');
+    buildTests('testLibrary003', '''class X{var q; f() {q.!1a!2}}''',
+        <String>["1+end", "2+abs", "2-end"],
+        failingTests: '12');
 
     // TODO Include corelib analysis
     // Resolving dart:html takes between 2.5s and 30s; json, about 0.12s
-    buildTests('testLibrary004', '''
+    buildTests(
+        'testLibrary004',
+        '''
             library foo;
             import 'dart:convert' as json;
             class JsonDecoderX{}
             f1() {var x=new json.!1}
             f2() {var x=new json.JsonDe!2}
-            f3() {var x=new json.JsonDecoder!3}''', <String>[
+            f3() {var x=new json.JsonDecoder!3}''',
+        <String>[
       "1+JsonDecoder",
       "1-JsonDecoderX",
       "2+JsonDecoder",
@@ -1619,9 +2222,8 @@
     // TODO Enable after type propagation is implemented. Not yet.
     // TODO Include corelib analysis
     buildTests('testLibrary005',
-            '''var PHI;main(){PHI=5.3;PHI.abs().!1 Object x;}''', <String>[
-      "1+abs"
-    ], failingTests: '1');
+        '''var PHI;main(){PHI=5.3;PHI.abs().!1 Object x;}''', <String>["1+abs"],
+        failingTests: '1');
 
     // Exercise import and export handling.
     // Libraries are defined in partial order of increasing dependency.
@@ -1644,7 +2246,9 @@
 library imp2;
 export 'exp2a.dart';
 i2() {}''';
-    buildTests('testLibrary006', '''
+    buildTests(
+        'testLibrary006',
+        '''
 import 'imp1.dart';
 import 'imp2.dart';
 main() {!1
@@ -1653,8 +2257,10 @@
   e1a();
   e1b();
   e2a();
-}''', <String>["1+i1", "1+i2", "1+e1a", "1+e2a", "1+e1b"],
-        extraFiles: sources, failingTests: '1');
+}''',
+        <String>["1+i1", "1+i2", "1+e1a", "1+e2a", "1+e1b"],
+        extraFiles: sources,
+        failingTests: '1');
 
     // Exercise import and export handling.
     // Libraries are defined in partial order of increasing dependency.
@@ -1662,13 +2268,17 @@
     sources["/l1.dart"] = '''
 library l1;
 var _l1t; var l1t;''';
-    buildTests('testLibrary007', '''
+    buildTests(
+        'testLibrary007',
+        '''
 import 'l1.dart';
 main() {
   var x = l!1
   var y = _!2
-}''', <String>["1+l1t", "1-_l1t", "2-_l1t"],
-        extraFiles: sources, failingTests: '1');
+}''',
+        <String>["1+l1t", "1-_l1t", "2-_l1t"],
+        extraFiles: sources,
+        failingTests: '1');
 
     // Check private library exclusion
     sources.clear();
@@ -1685,7 +2295,9 @@
   void privateMethod() {
   }
 }''';
-    buildTests('testLibrary008', '''
+    buildTests(
+        'testLibrary008',
+        '''
 import 'private.dart';
 import 'public.dart';
 class Test {
@@ -1693,8 +2305,10 @@
     NonPrivate x = new NonPrivate();
     x.!1 //publicMethod but not privateMethod should appear
   }
-}''', <String>["1-privateMethod", "1+publicMethod"],
-        extraFiles: sources, failingTests: '1');
+}''',
+        <String>["1-privateMethod", "1+publicMethod"],
+        extraFiles: sources,
+        failingTests: '1');
 
     // Exercise library prefixes.
     sources.clear();
@@ -1703,7 +2317,9 @@
 int X = 1;
 void m(){}
 class Y {}''';
-    buildTests('testLibrary009', '''
+    buildTests(
+        'testLibrary009',
+        '''
 import 'lib.dart' as Q;
 void a() {
   var x = Q.!1
@@ -1716,27 +2332,33 @@
 }
 void d() {
   new Q.!4
-}''', <String>[
-      "1+X",
-      "1+m",
-      "1+Y",
-      "2+X",
-      "2+m",
-      "2+Y",
-      "3+X",
-      "3+m",
-      "3+Y",
-      "4+Y",
-      "4-m",
-      "4-X"
-    ], extraFiles: sources, failingTests: '1234');
+}''',
+        <String>[
+          "1+X",
+          "1+m",
+          "1+Y",
+          "2+X",
+          "2+m",
+          "2+Y",
+          "3+X",
+          "3+m",
+          "3+Y",
+          "4+Y",
+          "4-m",
+          "4-X"
+        ],
+        extraFiles: sources,
+        failingTests: '1234');
   }
 
   void buildNumberedTests() {
-    buildTests('test001', '''
+    buildTests(
+        'test001',
+        '''
 void r1(var v) {
   v.!1toString!2().!3hash!4Code
-}''', <String>[
+}''',
+        <String>[
       "1+toString",
       "1-==",
       "2+toString",
@@ -1746,160 +2368,199 @@
       "4-toString"
     ]);
 
-    buildTests('test002', '''
+    buildTests(
+        'test002',
+        '''
 void r2(var vim) {
   v!1.toString()
-}''', <String>["1+vim"]);
+}''',
+        <String>["1+vim"]);
 
-    buildTests('test003', '''
+    buildTests(
+        'test003',
+        '''
 class A {
   int a() => 3;
   int b() => this.!1a();
-}''', <String>["1+a"]);
+}''',
+        <String>["1+a"]);
 
-    buildTests('test004', '''
+    buildTests(
+        'test004',
+        '''
 class A {
   int x;
   A() : this.!1x = 1;
   A.b() : this();
   A.c() : this.!2b();
   g() => new A.!3c();
-}''', <String>["1+x", "2+b", "3+c"], failingTests: '12');
+}''',
+        <String>["1+x", "2+b", "3+c"],
+        failingTests: '12');
 
-    buildTests('test005', '''
+    buildTests(
+        'test005',
+        '''
 class A {}
 void rr(var vim) {
   var !1vq = v!2.toString();
   var vf;
   v!3.toString();
-}''', <String>[
-      "1-A",
-      "1-vim",
-      "1+vq",
-      "1-vf",
-      "1-this",
-      "1-void",
-      "1-null",
-      "1-false",
-      "2-A",
-      "2+vim",
-      "2-vf",
-      "2-vq",
-      "2-this",
-      "2-void",
-      "2-null",
-      "2-false",
-      "3+vf",
-      "3+vq",
-      "3+vim",
-      "3-A"
-    ], failingTests: '1');
+}''',
+        <String>[
+          "1-A",
+          "1-vim",
+          "1+vq",
+          "1-vf",
+          "1-this",
+          "1-void",
+          "1-null",
+          "1-false",
+          "2-A",
+          "2+vim",
+          "2-vf",
+          "2-vq",
+          "2-this",
+          "2-void",
+          "2-null",
+          "2-false",
+          "3+vf",
+          "3+vq",
+          "3+vim",
+          "3-A"
+        ],
+        failingTests: '1');
 
-    buildTests('test006', '''
+    buildTests(
+        'test006',
+        '''
 void r2(var vim, {va: 2, b: 3}) {
   v!1.toString()
-}''', <String>["1+va", "1-b"]);
+}''',
+        <String>["1+va", "1-b"]);
 
-    buildTests('test007', '''
+    buildTests(
+        'test007',
+        '''
 void r2(var vim, [va: 2, b: 3]) {
   v!1.toString()
-}''', <String>["1+va", "1-b"]);
+}''',
+        <String>["1+va", "1-b"]);
 
     // keywords
-    buildTests('test008', '''
+    buildTests(
+        'test008',
+        '''
 !1class Aclass {}
 class Bclass !2extends!3 !4Aclass {}
 !5typedef Ctype = !6Bclass with !7Aclass;
 class Dclass extends !8Ctype {}
 !9abstract class Eclass implements Dclass,!C Ctype, Bclass {}
-class Fclass extends Bclass !Awith !B Eclass {}''', <String>[
-      "1+class",
-      "1-implements",
-      "1-extends",
-      "1-with",
-      "2+extends",
-      "3+extends",
-      "4+Aclass",
-      "4-Bclass",
-      "5+typedef",
-      "6+Bclass",
-      "6-Ctype",
-      "7+Aclass",
-      "7-Bclass",
-      "8+Ctype",
-      "9+abstract",
-      "A+with",
-      "B+Eclass",
-      "B-Dclass",
-      "B-Ctype",
-      "C+Bclass",
-      "C-Eclass"
-    ], failingTests: '23467ABC');
+class Fclass extends Bclass !Awith !B Eclass {}''',
+        <String>[
+          "1+class",
+          "1-implements",
+          "1-extends",
+          "1-with",
+          "2+extends",
+          "3+extends",
+          "4+Aclass",
+          "4-Bclass",
+          "5+typedef",
+          "6+Bclass",
+          "6-Ctype",
+          "7+Aclass",
+          "7-Bclass",
+          "8+Ctype",
+          "9+abstract",
+          "A+with",
+          "B+Eclass",
+          "B-Dclass",
+          "B-Ctype",
+          "C+Bclass",
+          "C-Eclass"
+        ],
+        failingTests: '23467ABC');
 
     // keywords
-    buildTests('test009', '''
+    buildTests(
+        'test009',
+        '''
 typedef !1dy!2namic TestFn1();
 typedef !3vo!4id TestFn2();
-typ!7edef !5n!6''', <String>[
-      "1+void",
-      "1+TestFn2",
-      "2+dynamic",
-      "2-void",
-      "3+dynamic",
-      "4+void",
-      "4-dynamic",
-      "5+TestFn2",
-      "6+num",
-      "7+typedef"
-    ], failingTests: '1234');
+typ!7edef !5n!6''',
+        <String>[
+          "1+void",
+          "1+TestFn2",
+          "2+dynamic",
+          "2-void",
+          "3+dynamic",
+          "4+void",
+          "4-dynamic",
+          "5+TestFn2",
+          "6+num",
+          "7+typedef"
+        ],
+        failingTests: '1234');
 
-    buildTests('test010', '''
+    buildTests(
+        'test010',
+        '''
 class test !8<!1t !2 !3extends String,!4 List,!5 !6>!7 {}
-class tezetst !9<!BString,!C !DList>!A {}''', <String>[
-      "1-String",
-      "1-List",
-      "1-test",
-      "2-String",
-      "2-test",
-      "3+extends",
-      "4-tezetst",
-      "4-test",
-      "5-String",
-      "6-List",
-      "7-List",
-      "8-List",
-      "9-String",
-      "A-String",
-      "B-String",
-      "C-List",
-      "C-tezetst",
-      "D-List",
-      "D-test"
-    ], failingTests: '23');
+class tezetst !9<!BString,!C !DList>!A {}''',
+        <String>[
+          "1-String",
+          "1-List",
+          "1-test",
+          "2-String",
+          "2-test",
+          "3+extends",
+          "4-tezetst",
+          "4-test",
+          "5-String",
+          "6-List",
+          "7-List",
+          "8-List",
+          "9-String",
+          "A-String",
+          "B-String",
+          "C-List",
+          "C-tezetst",
+          "D-List",
+          "D-test"
+        ],
+        failingTests: '23');
 
     // name generation with conflicts
     buildTests('test011', '''r2(var object, Object object1, Object !1);''',
-        <String>["1+object2"], failingTests: '1');
+        <String>["1+object2"],
+        failingTests: '1');
 
     // reserved words
-    buildTests('test012', '''
+    buildTests(
+        'test012',
+        '''
 class X {
   f() {
     g(!1var!2 z) {!3true.!4toString();};
   }
-}''', <String>[
-      "1+var",
-      "1+dynamic",
-      "1-f",
-      "2+var",
-      "2-dynamic",
-      "3+false",
-      "3+true",
-      "4+toString"
-    ], failingTests: '123');
+}''',
+        <String>[
+          "1+var",
+          "1+dynamic",
+          "1-f",
+          "2+var",
+          "2-dynamic",
+          "3+false",
+          "3+true",
+          "4+toString"
+        ],
+        failingTests: '123');
 
     // conditions & operators
-    buildTests('test013', '''
+    buildTests(
+        'test013',
+        '''
 class Q {
   bool x;
   List zs;
@@ -1914,22 +2575,26 @@
     } on !5Object catch(a){}
     if (!7x !6) {} else {};
   }
-}''', <String>[
-      "1+x",
-      "2+x",
-      "3+zs",
-      "4+k",
-      "5+Q",
-      "5-a",
-      "6+==",
-      "7+x",
-      "8+==",
-      "9+==",
-      "0+k"
-    ], failingTests: '689');
+}''',
+        <String>[
+          "1+x",
+          "2+x",
+          "3+zs",
+          "4+k",
+          "5+Q",
+          "5-a",
+          "6+==",
+          "7+x",
+          "8+==",
+          "9+==",
+          "0+k"
+        ],
+        failingTests: '689');
 
     // keywords
-    buildTests('test014', '''
+    buildTests(
+        'test014',
+        '''
 class Q {
   bool x;
   List zs;
@@ -1947,64 +2612,74 @@
     !Jif (x) {} !Kelse {};
     !Lreturn;
   }
-}''', <String>[
-      "1+while",
-      "2+do",
-      "3+while",
-      "4+for (!)",
-      "5+in",
-      "6+for (!)",
-      "7+switch",
-      "8+case",
-      "9+default",
-      "A+try",
-      "B+on",
-      "C+catch",
-      "D+var",
-      "E+void",
-      "F+assert",
-      "G+continue",
-      "H+break",
-      "J+if",
-      "K+else",
-      "L+return"
-    ], failingTests: '35BCHK');
+}''',
+        <String>[
+          "1+while",
+          "2+do",
+          "3+while",
+          "4+for",
+          "5+in",
+          "6+for",
+          "7+switch",
+          "8+case",
+          "9+default",
+          "A+try",
+          "B+on",
+          "C+catch",
+          "D+var",
+          "E+void",
+          "F+assert",
+          "G+continue",
+          "H+break",
+          "J+if",
+          "K+else",
+          "L+return"
+        ],
+        failingTests: '3BCK');
 
     // operators in function
     buildTests('test015', '''f(a,b,c) => a + b * c !1;''', <String>["1+=="],
         failingTests: '1');
 
     // operators in return
-    buildTests('test016',
-        '''class X {dynamic f(a,b,c) {return a + b * c !1;}}''', <String>[
-      "1+=="
-    ], failingTests: '1');
+    buildTests(
+        'test016',
+        '''class X {dynamic f(a,b,c) {return a + b * c !1;}}''',
+        <String>["1+=="],
+        failingTests: '1');
 
     // keywords
-    buildTests('test017', '''
+    buildTests(
+        'test017',
+        '''
 !1!2import 'x' !5as r;
 !3export '!8uri' !6hide Q !7show X;
-!4part 'x';''', <String>[
-      "1+library",
-      "2+import '!';",
-      "3+export",
-      "4+part",
-      "5+as",
-      "6+hide",
-      "7+show",
-      "8-null"
-    ], failingTests: '567');
+!4part 'x';''',
+        <String>[
+          "1+library",
+          "2+import",
+          "3+export",
+          "4+part",
+          "5+as",
+          "6+hide",
+          "7+show",
+          "8-null"
+        ],
+        failingTests: '567');
 
     // keywords
     buildTests('test018', '''!1part !2of foo;''', <String>["1+part", "2+of"],
         failingTests: '2');
 
-    buildTests('test019', '''
+    buildTests(
+        'test019',
+        '''
 var truefalse = 0;
 var falsetrue = 1;
 main() {
   var foo = true!1
-}''', <String>["1+true", "1+truefalse", "1-falsetrue"]);
+}''',
+        <String>["1+true", "1+truefalse", "1-falsetrue"]);
 
     buildTests('test020', '''var x = null.!1''', <String>["1+toString"],
         failingTests: '1');
@@ -2013,7 +2688,9 @@
 
     buildTests('test022', '''var x = .!1;''', <String>["1-toString"]);
 
-    buildTests('test023', '''
+    buildTests(
+        'test023',
+        '''
 class Map{getKeys(){}}
 class X {
   static x1(Map m) {
@@ -2022,18 +2699,24 @@
   x2(Map m) {
     m.!2getKeys;
   }
-}''', <String>["1+getKeys", "2+getKeys"]);
+}''',
+        <String>["1+getKeys", "2+getKeys"]);
 
 // Note lack of semicolon following completion location
-    buildTests('test024', '''
+    buildTests(
+        'test024',
+        '''
 class List{factory List.from(Iterable other) {}}
 class F {
   f() {
     new List.!1
   }
-}''', <String>["1+from"]);
+}''',
+        <String>["1+from"]);
 
-    buildTests('test025', '''
+    buildTests(
+        'test025',
+        '''
 class R {
   static R _m;
   static R m;
@@ -2065,7 +2748,8 @@
     var g = R.!Em;
     var h = R.!Fg();
   }
-}''', <String>[
+}''',
+        <String>[
       "1+m",
       "2+_m",
       "3+g",
@@ -2094,11 +2778,14 @@
 
     buildTests('test030', '''n(){[1].forEach((x){!1});}''', <String>["1+x"]);
 
-    buildTests('test031',
+    buildTests(
+        'test031',
         '''class Caster {} m() {try {} on Cas!1ter catch (CastBlock) {!2}}''',
         <String>["1+Caster", "1-CastBlock", "2+Caster", "2+CastBlock"]);
 
-    buildTests('test032', '''
+    buildTests(
+        'test032',
+        '''
 const ONE = 1;
 const ICHI = 10;
 const UKSI = 100;
@@ -2112,7 +2799,8 @@
     case ONE!1: return;
     default: return;
   }
-}''', <String>[
+}''',
+        <String>[
       "1+ONE",
       "1-UKSI",
       "2+EIN",
@@ -2123,14 +2811,18 @@
       "3+ONE"
     ]);
 
-    buildTests('test033',
+    buildTests(
+        'test033',
         '''class A{}class B extends A{b(){}}class C implements A {c(){}}class X{x(){A f;f.!1}}''',
-        <String>["1+b", "1-c"], failingTests: '1');
+        <String>["1+b", "1-c"],
+        failingTests: '1');
 
     // TODO(scheglov) decide what to do with Type for untyped field (not
     // supported by the new store)
     // test analysis of untyped fields and top-level vars
-    buildTests('test034', '''
+    buildTests(
+        'test034',
+        '''
 var topvar;
 class Top {top(){}}
 class Left extends Top {left(){}}
@@ -2153,16 +2845,20 @@
     topvar.!1top();
     field.!2top();
   }
-}''', <String>["1+top", "2+top"], failingTests: '12');
+}''',
+        <String>["1+top", "2+top"],
+        failingTests: '12');
 
     // test analysis of untyped fields and top-level vars
     buildTests('test035', '''class Y {final x='hi';mth() {x.!1length;}}''',
-        <String>["1+length"]);
+        <String>["1+length"], failingTests: '1');
 
     // TODO(scheglov) decide what to do with Type for untyped field (not
     // supported by the new store)
     // test analysis of untyped fields and top-level vars
-    buildTests('test036', '''
+    buildTests(
+        'test036',
+        '''
 class A1 {
   var field;
   A1() : field = 0;
@@ -2174,16 +2870,24 @@
 main() {
   A1 a = new A1();
   a.field.!2
-}''', <String>["1+round", "2+round"], failingTests: '12');
+}''',
+        <String>["1+round", "2+round"],
+        failingTests: '12');
 
-    buildTests('test037', '''
+    buildTests(
+        'test037',
+        '''
 class HttpServer{}
 class HttpClient{}
 main() {
   new HtS!1
-}''', <String>["1+HttpServer", "1-HttpClient"], failingTests: '1');
+}''',
+        <String>["1+HttpServer", "1-HttpClient"],
+        failingTests: '1');
 
-    buildTests('test038', '''
+    buildTests(
+        'test038',
+        '''
 class X {
   x(){}
 }
@@ -2197,35 +2901,38 @@
     ay.!1y;
     az.!2x;
   }
-}''', <String>["1+y", "1-x", "2+x", "2-y"], failingTests: '2');
+}''',
+        <String>["1+y", "1-x", "2+x", "2-y"],
+        failingTests: '2');
 
     // test analysis of untyped fields and top-level vars
-    buildTests('test039', '''class X{}var x = null as !1X;''', <String>[
-      "1+X",
-      "1-void"
-    ]);
+    buildTests('test039', '''class X{}var x = null as !1X;''',
+        <String>["1+X", "1-void"]);
 
     // test arg lists with named params
     buildTests('test040', '''m(){f(a, b, {x1, x2, y}) {};f(1, 2, !1)!2;}''',
-        <String>["1+x1", "2-x2"], failingTests: '1');
+        <String>["1+x1", "2-x2"],
+        failingTests: '1');
 
     // test arg lists with named params
     buildTests('test041', '''m(){f(a, b, {x1, x2, y}) {};f(1, 2, !1''',
-        <String>["1+x1", "1+x2", "1+y"], failingTests: '1');
+        <String>["1+x1", "1+x2", "1+y"],
+        failingTests: '1');
 
     // test arg lists with named params
     buildTests('test042', '''m(){f(a, b, {x1, x2, y}) {};f(1, 2, !1;!2''',
-        <String>["1+x1", "1+x2", "2-y"], failingTests: '1');
+        <String>["1+x1", "1+x2", "2-y"],
+        failingTests: '1');
   }
 
   void buildOtherTests() {
     buildTests('test_classMembers_inGetter',
         '''class A { var fff; get z {ff!1}}''', <String>["1+fff"]);
 
-    buildTests('testSingle',
-        '''class A {int x; !2mth() {int y = this.x;}}class B{}''', <String>[
-      "2+B"
-    ]);
+    buildTests(
+        'testSingle',
+        '''class A {int x; !2mth() {int y = this.x;}}class B{}''',
+        <String>["2+B"]);
   }
 
   /**
diff --git a/pkg/analysis_server/test/completion_test_support.dart b/pkg/analysis_server/test/completion_test_support.dart
index 8d002eb..0f00d1e 100644
--- a/pkg/analysis_server/test/completion_test_support.dart
+++ b/pkg/analysis_server/test/completion_test_support.dart
@@ -7,7 +7,7 @@
 import 'dart:async';
 import 'dart:collection';
 
-import 'package:analysis_server/src/protocol.dart';
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analyzer/src/generated/java_core.dart';
 import 'package:unittest/unittest.dart';
 
@@ -190,18 +190,14 @@
       if (!badPoints.isEmpty) {
         err.write("No test location for tests:");
         for (String ch in badPoints) {
-          err
-            ..write(' ')
-            ..write(ch);
+          err..write(' ')..write(ch);
         }
         err.write(' ');
       }
       if (!badResults.isEmpty) {
         err.write("No results for tests:");
         for (String ch in badResults) {
-          err
-            ..write(' ')
-            ..write(ch);
+          err..write(' ')..write(ch);
         }
       }
       throw new IllegalStateException(err.toString());
diff --git a/pkg/analysis_server/test/context_manager_test.dart b/pkg/analysis_server/test/context_manager_test.dart
index 1c469f6..081c8b6 100644
--- a/pkg/analysis_server/test/context_manager_test.dart
+++ b/pkg/analysis_server/test/context_manager_test.dart
@@ -19,9 +19,10 @@
 import 'package:unittest/unittest.dart';
 
 import 'mocks.dart';
+import 'utils.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(AbstractContextManagerTest);
 }
 
@@ -88,18 +89,34 @@
     callbacks = new TestContextManagerCallbacks(resourceProvider);
     manager.callbacks = callbacks;
     resourceProvider.newFolder(projPath);
-    ContextManagerImpl.ENABLE_PACKAGESPEC_SUPPORT = true;
   }
 
-  void tearDown() {
-    ContextManagerImpl.ENABLE_PACKAGESPEC_SUPPORT = false;
+  test_analysis_options_parse_failure() async {
+    // Create files.
+    String libPath = newFolder([projPath, 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 with ignore list.
+    newFile(
+        [projPath, '.analysis_options'],
+        r'''
+;
+''');
+    // Setup context.
+    manager.setRoots(<String>[projPath], <String>[], <String, String>{});
+
+    // No error means success.
   }
 
   void test_contextsInAnalysisRoot_nestedContext() {
-    String subProjPath = join(projPath, 'subproj');
+    String subProjPath = posix.join(projPath, 'subproj');
     Folder subProjFolder = resourceProvider.newFolder(subProjPath);
-    resourceProvider.newFile(join(subProjPath, 'pubspec.yaml'), 'contents');
-    String subProjFilePath = join(subProjPath, 'file.dart');
+    resourceProvider.newFile(
+        posix.join(subProjPath, 'pubspec.yaml'), 'contents');
+    String subProjFilePath = 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
@@ -151,10 +168,11 @@
   }
 
   void test_isInAnalysisRoot_inNestedContext() {
-    String subProjPath = join(projPath, 'subproj');
+    String subProjPath = posix.join(projPath, 'subproj');
     Folder subProjFolder = resourceProvider.newFolder(subProjPath);
-    resourceProvider.newFile(join(subProjPath, 'pubspec.yaml'), 'contents');
-    String subProjFilePath = join(subProjPath, 'file.dart');
+    resourceProvider.newFile(
+        posix.join(subProjPath, 'pubspec.yaml'), 'contents');
+    String subProjFilePath = 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.
@@ -214,7 +232,9 @@
     String sdkExtSrcPath = newFolder([projPath, 'sdk_ext', 'src']);
     newFile([sdkExtSrcPath, 'part.dart']);
     // Setup analysis options file with ignore list.
-    newFile([projPath, '.analysis_options'], r'''
+    newFile(
+        [projPath, '.analysis_options'],
+        r'''
 analyzer:
   exclude:
     - lib/nope.dart
@@ -235,17 +255,23 @@
     // Create files.
     String libPath = newFolder([projPath, LIB_NAME]);
     newFile([libPath, 'main.dart']);
-    newFile([libPath, 'pubspec.yaml'], r'''
+    newFile(
+        [libPath, 'pubspec.yaml'],
+        r'''
 name: foobar
 ''');
     String otherLibPath = newFolder([projPath, 'other_lib']);
     newFile([otherLibPath, 'entry.dart']);
-    newFile([otherLibPath, 'pubspec.yaml'], r'''
+    newFile(
+        [otherLibPath, 'pubspec.yaml'],
+        r'''
 name: other_lib
 ''');
     // Setup analysis options file with ignore list that ignores the 'other_lib'
     // directory by name.
-    newFile([projPath, '.analysis_options'], r'''
+    newFile(
+        [projPath, '.analysis_options'],
+        r'''
 analyzer:
   exclude:
     - 'other_lib'
@@ -254,38 +280,8 @@
     manager.setRoots(<String>[projPath], <String>[], <String, String>{});
     // Verify that the context in other_lib wasn't created and that the
     // context in lib was created.
-    var contexts = manager.contextsInAnalysisRoot(
-        resourceProvider.newFolder(projPath));
-    expect(contexts.length, 2);
-    expect(contexts[0].name, equals('/my/proj'));
-    expect(contexts[1].name, equals('/my/proj/lib'));
-  }
-
-  test_path_filter_wildcard_child_contexts_option() async {
-    // Create files.
-    String libPath = newFolder([projPath, LIB_NAME]);
-    newFile([libPath, 'main.dart']);
-    newFile([libPath, 'pubspec.yaml'], r'''
-name: foobar
-''');
-    String otherLibPath = newFolder([projPath, 'other_lib']);
-    newFile([otherLibPath, 'entry.dart']);
-    newFile([otherLibPath, 'pubspec.yaml'], r'''
-name: other_lib
-''');
-    // Setup analysis options file with ignore list that ignores 'other_lib'
-    // and all immediate children.
-    newFile([projPath, '.analysis_options'], r'''
-analyzer:
-  exclude:
-    - 'other_lib/*'
-''');
-    // Setup context.
-    manager.setRoots(<String>[projPath], <String>[], <String, String>{});
-    // Verify that the context in other_lib wasn't created and that the
-    // context in lib was created.
-    var contexts = manager.contextsInAnalysisRoot(
-        resourceProvider.newFolder(projPath));
+    var contexts =
+        manager.contextsInAnalysisRoot(resourceProvider.newFolder(projPath));
     expect(contexts.length, 2);
     expect(contexts[0].name, equals('/my/proj'));
     expect(contexts[1].name, equals('/my/proj/lib'));
@@ -295,17 +291,23 @@
     // Create files.
     String libPath = newFolder([projPath, LIB_NAME]);
     newFile([libPath, 'main.dart']);
-    newFile([libPath, 'pubspec.yaml'], r'''
+    newFile(
+        [libPath, 'pubspec.yaml'],
+        r'''
   name: foobar
   ''');
     String otherLibPath = newFolder([projPath, 'other_lib']);
     newFile([otherLibPath, 'entry.dart']);
-    newFile([otherLibPath, 'pubspec.yaml'], r'''
+    newFile(
+        [otherLibPath, 'pubspec.yaml'],
+        r'''
   name: other_lib
   ''');
     // Setup analysis options file with ignore list that ignores 'other_lib'
     // and all descendants.
-    newFile([projPath, '.analysis_options'], r'''
+    newFile(
+        [projPath, '.analysis_options'],
+        r'''
 analyzer:
   exclude:
     - 'other_lib/**'
@@ -314,52 +316,49 @@
     manager.setRoots(<String>[projPath], <String>[], <String, String>{});
     // Verify that the context in other_lib wasn't created and that the
     // context in lib was created.
-    var contexts = manager.contextsInAnalysisRoot(
-        resourceProvider.newFolder(projPath));
+    var contexts =
+        manager.contextsInAnalysisRoot(resourceProvider.newFolder(projPath));
     expect(contexts.length, 2);
     expect(contexts[0].name, equals('/my/proj'));
     expect(contexts[1].name, equals('/my/proj/lib'));
   }
 
-  // TODO(paulberry): This test only tests PackagesFileDisposition.
-  // Once http://dartbug.com/23909 is fixed, add a test for sdk extensions
-  // and PackageMapDisposition.
-  test_sdk_ext_packagespec() async {
+  test_path_filter_wildcard_child_contexts_option() async {
     // Create files.
     String libPath = newFolder([projPath, LIB_NAME]);
     newFile([libPath, 'main.dart']);
-    newFile([libPath, 'nope.dart']);
-    String sdkExtPath = newFolder([projPath, 'sdk_ext']);
-    newFile([sdkExtPath, 'entry.dart']);
-    String sdkExtSrcPath = newFolder([projPath, 'sdk_ext', 'src']);
-    newFile([sdkExtSrcPath, 'part.dart']);
-    // Setup sdk extension mapping.
     newFile(
-        [libPath, '_sdkext'],
+        [libPath, 'pubspec.yaml'],
         r'''
-{
-  "dart:foobar": "../sdk_ext/entry.dart"
-}
+name: foobar
 ''');
-    // Setup .packages file
+    String otherLibPath = newFolder([projPath, 'other_lib']);
+    newFile([otherLibPath, 'entry.dart']);
     newFile(
-      [projPath, '.packages'],
-      r'''
-test_pack:lib/
+        [otherLibPath, 'pubspec.yaml'],
+        r'''
+name: other_lib
+''');
+    // Setup analysis options file with ignore list that ignores 'other_lib'
+    // and all immediate children.
+    newFile(
+        [projPath, '.analysis_options'],
+        r'''
+analyzer:
+  exclude:
+    - 'other_lib/*'
 ''');
     // Setup context.
     manager.setRoots(<String>[projPath], <String>[], <String, String>{});
-    // Confirm that one context was created.
+    // Verify that the context in other_lib wasn't created and that the
+    // context in lib was created.
     var contexts =
         manager.contextsInAnalysisRoot(resourceProvider.newFolder(projPath));
-    expect(contexts, isNotNull);
-    expect(contexts.length, equals(1));
-    var context = contexts[0];
-    var source = context.sourceFactory.forUri('dart:foobar');
-    expect(source.fullName, equals('/my/proj/sdk_ext/entry.dart'));
+    expect(contexts.length, 2);
+    expect(contexts[0].name, equals('/my/proj'));
+    expect(contexts[1].name, equals('/my/proj/lib'));
   }
 
-
   test_refresh_folder_with_packagespec() {
     // create a context with a .packages file
     String packagespecFile = posix.join(projPath, '.packages');
@@ -376,6 +375,9 @@
     });
   }
 
+  // TODO(paulberry): This test only tests PackagesFileDisposition.
+  // Once http://dartbug.com/23909 is fixed, add a test for sdk extensions
+  // and PackageMapDisposition.
   test_refresh_folder_with_packagespec_subfolders() {
     // Create a folder with no .packages file, containing two subfolders with
     // .packages files.
@@ -467,6 +469,41 @@
     });
   }
 
+  test_sdk_ext_packagespec() async {
+    // Create files.
+    String libPath = newFolder([projPath, LIB_NAME]);
+    newFile([libPath, 'main.dart']);
+    newFile([libPath, 'nope.dart']);
+    String sdkExtPath = newFolder([projPath, 'sdk_ext']);
+    newFile([sdkExtPath, 'entry.dart']);
+    String sdkExtSrcPath = newFolder([projPath, 'sdk_ext', 'src']);
+    newFile([sdkExtSrcPath, 'part.dart']);
+    // Setup sdk extension mapping.
+    newFile(
+        [libPath, '_sdkext'],
+        r'''
+{
+  "dart:foobar": "../sdk_ext/entry.dart"
+}
+''');
+    // Setup .packages file
+    newFile(
+        [projPath, '.packages'],
+        r'''
+test_pack:lib/
+''');
+    // Setup context.
+    manager.setRoots(<String>[projPath], <String>[], <String, String>{});
+    // Confirm that one context was created.
+    var contexts =
+        manager.contextsInAnalysisRoot(resourceProvider.newFolder(projPath));
+    expect(contexts, isNotNull);
+    expect(contexts.length, equals(1));
+    var context = contexts[0];
+    var source = context.sourceFactory.forUri('dart:foobar');
+    expect(source.fullName, equals('/my/proj/sdk_ext/entry.dart'));
+  }
+
   void test_setRoots_addFolderWithDartFile() {
     String filePath = posix.join(projPath, 'foo.dart');
     resourceProvider.newFile(filePath, 'contents');
@@ -513,8 +550,9 @@
     newFile([examplePath, ContextManagerImpl.PACKAGE_SPEC_NAME]);
     newFile([examplePath, 'example.dart']);
 
-    packageMapProvider.packageMap['proj'] =
-        [resourceProvider.getResource(libPath)];
+    packageMapProvider.packageMap['proj'] = [
+      resourceProvider.getResource(libPath)
+    ];
 
     manager.setRoots(<String>[projPath], <String>[], <String, String>{});
 
@@ -541,8 +579,9 @@
     newFile([examplePath, ContextManagerImpl.PUBSPEC_NAME]);
     newFile([examplePath, 'example.dart']);
 
-    packageMapProvider.packageMap['proj'] =
-        [resourceProvider.getResource(libPath)];
+    packageMapProvider.packageMap['proj'] = [
+      resourceProvider.getResource(libPath)
+    ];
 
     manager.setRoots(<String>[projPath], <String>[], <String, String>{});
 
@@ -640,8 +679,9 @@
     newFile([srcPath, 'internal.dart']);
     String testFilePath = newFile([testPath, 'main_test.dart']);
 
-    packageMapProvider.packageMap['proj'] =
-        [resourceProvider.getResource(libPath)];
+    packageMapProvider.packageMap['proj'] = [
+      resourceProvider.getResource(libPath)
+    ];
 
     manager.setRoots(<String>[projPath], <String>[], <String, String>{});
     Set<Source> sources = callbacks.currentContextSources[projPath];
@@ -700,8 +740,12 @@
     resourceProvider.newFile(subProjectB_file, 'library b;');
     // configure package maps
     packageMapProvider.packageMaps = {
-      subProjectA: {'foo': [resourceProvider.newFolder('/package/foo')]},
-      subProjectB: {'bar': [resourceProvider.newFolder('/package/bar')]},
+      subProjectA: {
+        'foo': [resourceProvider.newFolder('/package/foo')]
+      },
+      subProjectB: {
+        'bar': [resourceProvider.newFolder('/package/bar')]
+      },
     };
     // set roots
     manager.setRoots(<String>[root], <String>[], <String, String>{});
@@ -722,14 +766,15 @@
     String packagePathFoo = '/package1/foo';
     String packageRootPath = '/package2/foo';
     Folder packageFolder = resourceProvider.newFolder(packagePathFoo);
-    packageMapProvider.packageMap = {'foo': [packageFolder]};
+    packageMapProvider.packageMap = {
+      'foo': [packageFolder]
+    };
     List<String> includedPaths = <String>[projPath];
     List<String> excludedPaths = <String>[];
     manager.setRoots(includedPaths, excludedPaths, <String, String>{});
     _checkPackageMap(projPath, equals(packageMapProvider.packageMap));
-    manager.setRoots(includedPaths, excludedPaths, <String, String>{
-      projPath: packageRootPath
-    });
+    manager.setRoots(includedPaths, excludedPaths,
+        <String, String>{projPath: packageRootPath});
     _checkPackageRoot(projPath, equals(packageRootPath));
   }
 
@@ -738,13 +783,11 @@
     String packageRootPath2 = '/package2';
     List<String> includedPaths = <String>[projPath];
     List<String> excludedPaths = <String>[];
-    manager.setRoots(includedPaths, excludedPaths, <String, String>{
-      projPath: packageRootPath1
-    });
+    manager.setRoots(includedPaths, excludedPaths,
+        <String, String>{projPath: packageRootPath1});
     _checkPackageRoot(projPath, equals(packageRootPath1));
-    manager.setRoots(includedPaths, excludedPaths, <String, String>{
-      projPath: packageRootPath2
-    });
+    manager.setRoots(includedPaths, excludedPaths,
+        <String, String>{projPath: packageRootPath2});
     _checkPackageRoot(projPath, equals(packageRootPath2));
   }
 
@@ -872,22 +915,69 @@
     callbacks.assertContextFiles(project, [fileA, fileB]);
   }
 
+  void test_setRoots_ignoreDocFolder() {
+    String project = '/project';
+    String fileA = '$project/foo.dart';
+    String fileB = '$project/lib/doc/bar.dart';
+    String fileC = '$project/doc/bar.dart';
+    resourceProvider.newFile(fileA, '');
+    resourceProvider.newFile(fileB, '');
+    resourceProvider.newFile(fileC, '');
+    manager.setRoots(<String>[project], <String>[], <String, String>{});
+    callbacks.assertContextPaths([project]);
+    callbacks.assertContextFiles(project, [fileA, fileB]);
+  }
+
   void test_setRoots_newFolderWithPackageRoot() {
     String packageRootPath = '/package';
-    manager.setRoots(<String>[projPath], <String>[], <String, String>{
-      projPath: packageRootPath
-    });
+    manager.setRoots(<String>[projPath], <String>[],
+        <String, String>{projPath: packageRootPath});
     _checkPackageRoot(projPath, equals(packageRootPath));
   }
 
   void test_setRoots_newlyAddedFoldersGetProperPackageMap() {
     String packagePath = '/package/foo';
     Folder packageFolder = resourceProvider.newFolder(packagePath);
-    packageMapProvider.packageMap = {'foo': [packageFolder]};
+    packageMapProvider.packageMap = {
+      'foo': [packageFolder]
+    };
     manager.setRoots(<String>[projPath], <String>[], <String, String>{});
     _checkPackageMap(projPath, equals(packageMapProvider.packageMap));
   }
 
+  void test_setRoots_noContext_excludedFolder() {
+    // prepare paths
+    String project = '/project';
+    String excludedFolder = '$project/excluded';
+    String excludedPubspec = '$excludedFolder/pubspec.yaml';
+    // create files
+    resourceProvider.newFile(excludedPubspec, 'name: ignore-me');
+    // set "/project", and exclude "/project/excluded"
+    manager.setRoots(
+        <String>[project], <String>[excludedFolder], <String, String>{});
+    callbacks.assertContextPaths([project]);
+  }
+
+  void test_setRoots_noContext_inDotFolder() {
+    String pubspecPath = posix.join(projPath, '.pub', 'pubspec.yaml');
+    resourceProvider.newFile(pubspecPath, 'name: test');
+    manager.setRoots(<String>[projPath], <String>[], <String, String>{});
+    // verify
+    expect(callbacks.currentContextPaths, hasLength(1));
+    expect(callbacks.currentContextPaths, contains(projPath));
+    expect(callbacks.currentContextFilePaths[projPath], hasLength(0));
+  }
+
+  void test_setRoots_noContext_inPackagesFolder() {
+    String pubspecPath = posix.join(projPath, 'packages', 'pubspec.yaml');
+    resourceProvider.newFile(pubspecPath, 'name: test');
+    manager.setRoots(<String>[projPath], <String>[], <String, String>{});
+    // verify
+    expect(callbacks.currentContextPaths, hasLength(1));
+    expect(callbacks.currentContextPaths, contains(projPath));
+    expect(callbacks.currentContextFilePaths[projPath], hasLength(0));
+  }
+
   void test_setRoots_packageResolver() {
     Uri uri = Uri.parse('package:foo/foo.dart');
     Source source = new TestSource();
@@ -905,6 +995,19 @@
     expect(result, same(source));
   }
 
+  void test_setRoots_pathContainsDotFile() {
+    // If the path to a file (relative to the context root) contains a folder
+    // whose name begins with '.', then the file is ignored.
+    String project = '/project';
+    String fileA = '$project/foo.dart';
+    String fileB = '$project/.pub/bar.dart';
+    resourceProvider.newFile(fileA, '');
+    resourceProvider.newFile(fileB, '');
+    manager.setRoots(<String>[project], <String>[], <String, String>{});
+    callbacks.assertContextPaths([project]);
+    callbacks.assertContextFiles(project, [fileA]);
+  }
+
   void test_setRoots_removeFolderWithoutPubspec() {
     packageMapProvider.packageMap = null;
     // add one root - there is a context
@@ -1016,17 +1119,49 @@
     String packagePathFoo = '/package1/foo';
     String packageRootPath = '/package2/foo';
     Folder packageFolder = resourceProvider.newFolder(packagePathFoo);
-    packageMapProvider.packageMap = {'foo': [packageFolder]};
+    packageMapProvider.packageMap = {
+      'foo': [packageFolder]
+    };
     List<String> includedPaths = <String>[projPath];
     List<String> excludedPaths = <String>[];
-    manager.setRoots(includedPaths, excludedPaths, <String, String>{
-      projPath: packageRootPath
-    });
+    manager.setRoots(includedPaths, excludedPaths,
+        <String, String>{projPath: packageRootPath});
     _checkPackageRoot(projPath, equals(packageRootPath));
     manager.setRoots(includedPaths, excludedPaths, <String, String>{});
     _checkPackageMap(projPath, equals(packageMapProvider.packageMap));
   }
 
+  void test_setRoots_rootPathContainsDotFile() {
+    // If the path to the context root itself contains a folder whose name
+    // begins with '.', then that is not sufficient to cause any files in the
+    // context to be ignored.
+    String project = '/.pub/project';
+    String fileA = '$project/foo.dart';
+    resourceProvider.newFile(fileA, '');
+    manager.setRoots(<String>[project], <String>[], <String, String>{});
+    callbacks.assertContextPaths([project]);
+    callbacks.assertContextFiles(project, [fileA]);
+  }
+
+  test_strong_mode_analysis_option() async {
+    // Create files.
+    newFile(
+        [projPath, '.analysis_options'],
+        r'''
+analyzer:
+  strong-mode: true
+''');
+    String libPath = newFolder([projPath, LIB_NAME]);
+    newFile([libPath, 'main.dart']);
+    // Setup context.
+    manager.setRoots(<String>[projPath], <String>[], <String, String>{});
+    // Verify that analysis options was parsed and strong-mode set.
+    Map<String, int> fileTimestamps =
+        callbacks.currentContextFilePaths[projPath];
+    expect(fileTimestamps, isNotEmpty);
+    expect(callbacks.currentContext.analysisOptions.strongMode, true);
+  }
+
   test_watch_addDummyLink() {
     manager.setRoots(<String>[projPath], <String>[], <String, String>{});
     // empty folder initially
@@ -1077,6 +1212,76 @@
     });
   }
 
+  test_watch_addFile_inDocFolder_inner() {
+    // prepare paths
+    String project = '/project';
+    String fileA = '$project/a.dart';
+    String fileB = '$project/lib/doc/b.dart';
+    // create files
+    resourceProvider.newFile(fileA, '');
+    // set roots
+    manager.setRoots(<String>[project], <String>[], <String, String>{});
+    callbacks.assertContextPaths([project]);
+    callbacks.assertContextFiles(project, [fileA]);
+    // add a "lib/doc" file, it is not ignored
+    resourceProvider.newFile(fileB, '');
+    return pumpEventQueue().then((_) {
+      callbacks.assertContextPaths([project]);
+      callbacks.assertContextFiles(project, [fileA, fileB]);
+    });
+  }
+
+  test_watch_addFile_inDocFolder_topLevel() {
+    // prepare paths
+    String project = '/project';
+    String fileA = '$project/a.dart';
+    String fileB = '$project/doc/b.dart';
+    // create files
+    resourceProvider.newFile(fileA, '');
+    // set roots
+    manager.setRoots(<String>[project], <String>[], <String, String>{});
+    callbacks.assertContextPaths([project]);
+    callbacks.assertContextFiles(project, [fileA]);
+    // add a "doc" file, it is ignored
+    resourceProvider.newFile(fileB, '');
+    return pumpEventQueue().then((_) {
+      callbacks.assertContextPaths([project]);
+      callbacks.assertContextFiles(project, [fileA]);
+    });
+  }
+
+  test_watch_addFile_pathContainsDotFile() async {
+    // If a file is added and the path to it (relative to the context root)
+    // contains a folder whose name begins with '.', then the file is ignored.
+    String project = '/project';
+    String fileA = '$project/foo.dart';
+    String fileB = '$project/.pub/bar.dart';
+    resourceProvider.newFile(fileA, '');
+    manager.setRoots(<String>[project], <String>[], <String, String>{});
+    callbacks.assertContextPaths([project]);
+    callbacks.assertContextFiles(project, [fileA]);
+    resourceProvider.newFile(fileB, '');
+    await pumpEventQueue();
+    callbacks.assertContextPaths([project]);
+    callbacks.assertContextFiles(project, [fileA]);
+  }
+
+  test_watch_addFile_rootPathContainsDotFile() async {
+    // If a file is added and the path to the context contains a folder whose
+    // name begins with '.', then the file is not ignored.
+    String project = '/.pub/project';
+    String fileA = '$project/foo.dart';
+    String fileB = '$project/bar/baz.dart';
+    resourceProvider.newFile(fileA, '');
+    manager.setRoots(<String>[project], <String>[], <String, String>{});
+    callbacks.assertContextPaths([project]);
+    callbacks.assertContextFiles(project, [fileA]);
+    resourceProvider.newFile(fileB, '');
+    await pumpEventQueue();
+    callbacks.assertContextPaths([project]);
+    callbacks.assertContextFiles(project, [fileA, fileB]);
+  }
+
   test_watch_addFileInSubfolder() {
     manager.setRoots(<String>[projPath], <String>[], <String, String>{});
     // empty folder initially
@@ -1351,7 +1556,17 @@
   }
 
   test_watch_deletePackagespec_fromSubFolder_withPubspec() {
-    // prepare paths
+    // prepare paths:
+    //
+    // root
+    //   root.dart
+    //   sub
+    //     aaa
+    //       .packages
+    //       pubspec.yaml
+    //       bin
+    //         a.dart
+    //
     String root = '/root';
     String rootFile = '$root/root.dart';
     String subProject = '$root/sub/aaa';
@@ -1564,8 +1779,8 @@
    * A map from the paths of contexts to a set of the sources that should be
    * explicitly analyzed in those contexts.
    */
-  final Map<String, Set<Source>> currentContextSources = <String, Set<Source>>{
-  };
+  final Map<String, Set<Source>> currentContextSources =
+      <String, Set<Source>>{};
 
   /**
    * Map from context to folder disposition.
@@ -1594,8 +1809,9 @@
     currentContextSources[path] = new HashSet<Source>();
     currentContextDispositions[path] = disposition;
     currentContext = AnalysisEngine.instance.createAnalysisContext();
-    List<UriResolver> resolvers = [new FileUriResolver()];
+    List<UriResolver> resolvers = [];
     resolvers.addAll(disposition.createPackageUriResolvers(resourceProvider));
+    resolvers.add(new FileUriResolver());
     currentContext.sourceFactory =
         new SourceFactory(resolvers, disposition.packages);
     return currentContext;
diff --git a/pkg/analysis_server/test/domain_analysis_test.dart b/pkg/analysis_server/test/domain_analysis_test.dart
index 25b4d88..640d2fd 100644
--- a/pkg/analysis_server/test/domain_analysis_test.dart
+++ b/pkg/analysis_server/test/domain_analysis_test.dart
@@ -6,11 +6,11 @@
 
 import 'dart:async';
 
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/analysis_server.dart';
 import 'package:analysis_server/src/constants.dart';
 import 'package:analysis_server/src/domain_analysis.dart';
 import 'package:analysis_server/src/plugin/server_plugin.dart';
-import 'package:analysis_server/src/protocol.dart';
 import 'package:analyzer/file_system/memory_file_system.dart';
 import 'package:analyzer/instrumentation/instrumentation.dart';
 import 'package:path/path.dart';
@@ -21,9 +21,10 @@
 import 'analysis_abstract.dart';
 import 'mock_sdk.dart';
 import 'mocks.dart';
+import 'utils.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
 
   defineReflectiveTests(AnalysisDomainTest);
   defineReflectiveTests(SetSubscriptionsTest);
@@ -39,9 +40,14 @@
     ExtensionManager manager = new ExtensionManager();
     ServerPlugin serverPlugin = new ServerPlugin();
     manager.processPlugins([serverPlugin]);
-    server = new AnalysisServer(serverChannel, resourceProvider,
-        new MockPackageMapProvider(), null, serverPlugin,
-        new AnalysisServerOptions(), new MockSdk(),
+    server = new AnalysisServer(
+        serverChannel,
+        resourceProvider,
+        new MockPackageMapProvider(),
+        null,
+        serverPlugin,
+        new AnalysisServerOptions(),
+        new MockSdk(),
         InstrumentationService.NULL_SERVICE);
     handler = new AnalysisDomainHandler(server);
   });
@@ -89,6 +95,18 @@
             expect(units, hasLength(1));
           });
         });
+
+        test('nonexistent folder', () async {
+          String fileB = '/project_b/b.dart';
+          resourceProvider.newFile(fileB, '// b');
+          var response = testSetAnalysisRoots(['/project_a', '/project_b'], []);
+          var serverRef = server;
+          expect(response, isResponseSuccess('0'));
+          // Non-existence of /project_a should not prevent files in /project_b
+          // from being analyzed.
+          await server.onAnalysisComplete;
+          expect(serverRef.getResolvedCompilationUnits(fileB), hasLength(1));
+        });
       });
     });
 
@@ -132,8 +150,9 @@
 
     group('updateOptions', () {
       test('invalid', () {
-        var request = new Request(
-            '0', ANALYSIS_UPDATE_OPTIONS, {OPTIONS: {'not-an-option': true}});
+        var request = new Request('0', ANALYSIS_UPDATE_OPTIONS, {
+          OPTIONS: {'not-an-option': true}
+        });
         var response = handler.handleRequest(request);
         // Invalid options should be silently ignored.
         expect(response, isResponseSuccess('0'));
@@ -156,7 +175,9 @@
     helper.createSingleFileProject('// empty');
     return helper.onAnalysisComplete.then((_) {
       Request request = new Request('0', ANALYSIS_UPDATE_CONTENT, {
-        'files': {helper.testFile: {TYPE: 'foo',}}
+        'files': {
+          helper.testFile: {TYPE: 'foo',}
+        }
       });
       Response response = helper.handler.handleRequest(request);
       expect(response, isResponseFailure('0'));
@@ -291,7 +312,9 @@
     // Prepare a source file that has errors because it refers to an unknown
     // package.
     String pkgFile = '/packages/pkgA/libA.dart';
-    resourceProvider.newFile(pkgFile, '''
+    resourceProvider.newFile(
+        pkgFile,
+        '''
 library lib_a;
 class A {}
 ''');
@@ -322,12 +345,15 @@
   test_setRoots_packages() {
     // prepare package
     String pkgFile = '/packages/pkgA/libA.dart';
-    resourceProvider.newFile(pkgFile, '''
+    resourceProvider.newFile(
+        pkgFile,
+        '''
 library lib_a;
 class A {}
 ''');
-    packageMapProvider.packageMap['pkgA'] =
-        [resourceProvider.getResource('/packages/pkgA')];
+    packageMapProvider.packageMap['pkgA'] = [
+      resourceProvider.getResource('/packages/pkgA')
+    ];
     addTestFile('''
 import 'package:pkgA/libA.dart';
 main(A a) {
@@ -368,9 +394,14 @@
     ExtensionManager manager = new ExtensionManager();
     ServerPlugin serverPlugin = new ServerPlugin();
     manager.processPlugins([serverPlugin]);
-    server = new AnalysisServer(serverChannel, resourceProvider,
-        new MockPackageMapProvider(), null, serverPlugin,
-        new AnalysisServerOptions(), new MockSdk(),
+    server = new AnalysisServer(
+        serverChannel,
+        resourceProvider,
+        new MockPackageMapProvider(),
+        null,
+        serverPlugin,
+        new AnalysisServerOptions(),
+        new MockSdk(),
         InstrumentationService.NULL_SERVICE);
     handler = new AnalysisDomainHandler(server);
     // listen for notifications
@@ -593,7 +624,9 @@
 
   test_afterAnalysis_packageFile_external() async {
     String pkgFile = '/packages/pkgA/lib/libA.dart';
-    resourceProvider.newFile(pkgFile, '''
+    resourceProvider.newFile(
+        pkgFile,
+        '''
 library lib_a;
 class A {}
 ''');
@@ -623,11 +656,15 @@
     String pkgB = '/pkgA';
     String pkgFileA = '$pkgA/lib/libA.dart';
     String pkgFileB = '$pkgA/lib/libB.dart';
-    resourceProvider.newFile(pkgFileA, '''
+    resourceProvider.newFile(
+        pkgFileA,
+        '''
 library lib_a;
 class A {}
 ''');
-    resourceProvider.newFile(pkgFileB, '''
+    resourceProvider.newFile(
+        pkgFileB,
+        '''
 import 'package:pkgA/libA.dart';
 main() {
   new A();
@@ -657,7 +694,9 @@
 
   test_afterAnalysis_packageFile_notUsed() async {
     String pkgFile = '/packages/pkgA/lib/libA.dart';
-    resourceProvider.newFile(pkgFile, '''
+    resourceProvider.newFile(
+        pkgFile,
+        '''
 library lib_a;
 class A {}
 ''');
diff --git a/pkg/analysis_server/test/domain_completion_test.dart b/pkg/analysis_server/test/domain_completion_test.dart
index 08916ce..f0d6f83 100644
--- a/pkg/analysis_server/test/domain_completion_test.dart
+++ b/pkg/analysis_server/test/domain_completion_test.dart
@@ -6,8 +6,7 @@
 
 import 'dart:async';
 
-import 'package:analysis_server/completion/completion_core.dart'
-    show CompletionRequest, CompletionResult;
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/analysis_server.dart';
 import 'package:analysis_server/src/channel/channel.dart';
 import 'package:analysis_server/src/constants.dart';
@@ -15,8 +14,12 @@
 import 'package:analysis_server/src/domain_analysis.dart';
 import 'package:analysis_server/src/domain_completion.dart';
 import 'package:analysis_server/src/plugin/server_plugin.dart';
-import 'package:analysis_server/src/protocol.dart';
+import 'package:analysis_server/src/provisional/completion/completion_core.dart'
+    show CompletionRequest, CompletionResult;
+import 'package:analysis_server/src/provisional/completion/completion_dart.dart'
+    as newApi;
 import 'package:analysis_server/src/services/completion/completion_manager.dart';
+import 'package:analysis_server/src/services/completion/contribution_sorter.dart';
 import 'package:analysis_server/src/services/completion/dart_completion_manager.dart';
 import 'package:analysis_server/src/services/index/index.dart' show Index;
 import 'package:analysis_server/src/services/index/local_memory_index.dart';
@@ -34,9 +37,10 @@
 import 'analysis_abstract.dart';
 import 'mock_sdk.dart';
 import 'mocks.dart';
+import 'utils.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(CompletionManagerTest);
   defineReflectiveTests(CompletionTest);
   defineReflectiveTests(_NoSearchEngine);
@@ -50,13 +54,21 @@
   int requestCount = 0;
   String testFile2 = '/project/bin/test2.dart';
 
+  /// Cached model state in case tests need to set task model to on/off.
+  bool wasTaskModelEnabled;
+
   AnalysisServer createAnalysisServer(Index index) {
     ExtensionManager manager = new ExtensionManager();
     ServerPlugin serverPlugin = new ServerPlugin();
     manager.processPlugins([serverPlugin]);
-    return new Test_AnalysisServer(super.serverChannel, super.resourceProvider,
-        super.packageMapProvider, index, serverPlugin,
-        new AnalysisServerOptions(), new MockSdk(),
+    return new Test_AnalysisServer(
+        super.serverChannel,
+        super.resourceProvider,
+        super.packageMapProvider,
+        index,
+        serverPlugin,
+        new AnalysisServerOptions(),
+        new MockSdk(),
         InstrumentationService.NULL_SERVICE);
   }
 
@@ -75,6 +87,8 @@
   @override
   void setUp() {
     super.setUp();
+    wasTaskModelEnabled = AnalysisEngine.instance.useTaskModel;
+    AnalysisEngine.instance.useTaskModel = true;
     createProject();
     analysisDomain = handler;
     completionDomain = new Test_CompletionDomainHandler(server);
@@ -87,6 +101,7 @@
     super.tearDown();
     analysisDomain = null;
     completionDomain = null;
+    AnalysisEngine.instance.useTaskModel = wasTaskModelEnabled;
   }
 
   /**
@@ -262,7 +277,7 @@
   List<CompletionSuggestion> suggestions = [];
   bool suggestionsDone = false;
 
-  String addTestFile(String content, {offset}) {
+  String addTestFile(String content, {int offset}) {
     completionOffset = content.indexOf('^');
     if (offset != null) {
       expect(completionOffset, -1, reason: 'cannot supply offset and ^');
@@ -277,8 +292,10 @@
   }
 
   void assertHasResult(CompletionSuggestionKind kind, String completion,
-      [int relevance = DART_RELEVANCE_DEFAULT, bool isDeprecated = false,
-      bool isPotential = false]) {
+      {int relevance: DART_RELEVANCE_DEFAULT,
+      bool isDeprecated: false,
+      bool isPotential: false,
+      int selectionOffset}) {
     var cs;
     suggestions.forEach((s) {
       if (s.completion == completion) {
@@ -295,7 +312,7 @@
     }
     expect(cs.kind, equals(kind));
     expect(cs.relevance, equals(relevance));
-    expect(cs.selectionOffset, equals(completion.length));
+    expect(cs.selectionOffset, selectionOffset ?? completion.length);
     expect(cs.selectionLength, equals(0));
     expect(cs.isDeprecated, equals(isDeprecated));
     expect(cs.isPotential, equals(isPotential));
@@ -379,6 +396,65 @@
     });
   }
 
+  test_imports_incremental() async {
+    addTestFile('''library foo;
+      e^
+      import "dart:async";
+      import "package:foo/foo.dart";
+      class foo { }''');
+    await waitForTasksFinished();
+    server.updateContent('uc1', {testFile: new AddContentOverlay(testCode)});
+    server.updateContent('uc2', {
+      testFile:
+          new ChangeContentOverlay([new SourceEdit(completionOffset, 0, 'xp')])
+    });
+    completionOffset += 2;
+    await getSuggestions();
+    expect(replacementOffset, completionOffset - 3);
+    expect(replacementLength, 3);
+    assertHasResult(CompletionSuggestionKind.KEYWORD, 'export',
+        relevance: DART_RELEVANCE_HIGH);
+    assertHasResult(CompletionSuggestionKind.KEYWORD, 'import',
+        relevance: DART_RELEVANCE_HIGH);
+    assertNoResult('extends');
+    assertNoResult('library');
+  }
+
+  test_imports_partial() async {
+    addTestFile('''^
+      import "package:foo/foo.dart";
+      import "package:bar/bar.dart";
+      class Baz { }''');
+
+    // Wait for analysis then edit the content
+    await waitForTasksFinished();
+    String revisedContent = testCode.substring(0, completionOffset) +
+        'i' +
+        testCode.substring(completionOffset);
+    ++completionOffset;
+    server.handleRequest(new AnalysisUpdateContentParams(
+        {testFile: new AddContentOverlay(revisedContent)}).toRequest('add1'));
+
+    // Request code completion immediately after edit
+    Response response = handleSuccessfulRequest(
+        new CompletionGetSuggestionsParams(testFile, completionOffset)
+            .toRequest('0'));
+    completionId = response.id;
+    assertValidId(completionId);
+    await waitForTasksFinished();
+    expect(replacementOffset, completionOffset - 1);
+    expect(replacementLength, 1);
+    assertHasResult(CompletionSuggestionKind.KEYWORD, 'library',
+        relevance: DART_RELEVANCE_HIGH);
+    assertHasResult(CompletionSuggestionKind.KEYWORD, 'import',
+        relevance: DART_RELEVANCE_HIGH);
+    assertHasResult(CompletionSuggestionKind.KEYWORD, 'export',
+        relevance: DART_RELEVANCE_HIGH);
+    assertHasResult(CompletionSuggestionKind.KEYWORD, 'part',
+        relevance: DART_RELEVANCE_HIGH);
+    assertNoResult('extends');
+  }
+
   test_imports_prefixed() {
     addTestFile('''
       import 'dart:html' as foo;
@@ -403,6 +479,29 @@
     });
   }
 
+  test_invocation_sdk_relevancy_off() {
+    var originalSorter = DartCompletionManager.defaultContributionSorter;
+    var mockSorter = new MockRelevancySorter();
+    DartCompletionManager.defaultContributionSorter = mockSorter;
+    addTestFile('main() {Map m; m.^}');
+    return getSuggestions().then((_) {
+      // Assert that the CommonUsageComputer has been replaced
+      expect(suggestions.any((s) => s.relevance == DART_RELEVANCE_COMMON_USAGE),
+          isFalse);
+      DartCompletionManager.defaultContributionSorter = originalSorter;
+      mockSorter.enabled = false;
+    });
+  }
+
+  test_invocation_sdk_relevancy_on() {
+    addTestFile('main() {Map m; m.^}');
+    return getSuggestions().then((_) {
+      // Assert that the CommonUsageComputer is working
+      expect(suggestions.any((s) => s.relevance == DART_RELEVANCE_COMMON_USAGE),
+          isTrue);
+    });
+  }
+
   test_invocation_withTrailingStmt() {
     addTestFile('class A {b() {}} main() {A a; a.^ int x = 7;}');
     return getSuggestions().then((_) {
@@ -417,10 +516,10 @@
     return getSuggestions().then((_) {
       expect(replacementOffset, equals(completionOffset - 2));
       expect(replacementLength, equals(2));
-      assertHasResult(
-          CompletionSuggestionKind.KEYWORD, 'export', DART_RELEVANCE_HIGH);
-      assertHasResult(
-          CompletionSuggestionKind.KEYWORD, 'class', DART_RELEVANCE_HIGH);
+      assertHasResult(CompletionSuggestionKind.KEYWORD, 'export',
+          relevance: DART_RELEVANCE_HIGH);
+      assertHasResult(CompletionSuggestionKind.KEYWORD, 'class',
+          relevance: DART_RELEVANCE_HIGH);
     });
   }
 
@@ -440,12 +539,12 @@
       expect(replacementOffset, equals(completionOffset));
       expect(replacementLength, equals(0));
       assertHasResult(CompletionSuggestionKind.INVOCATION, 'A');
-      assertHasResult(
-          CompletionSuggestionKind.INVOCATION, 'a', DART_RELEVANCE_LOCAL_FIELD);
+      assertHasResult(CompletionSuggestionKind.INVOCATION, 'a',
+          relevance: DART_RELEVANCE_LOCAL_FIELD);
       assertHasResult(CompletionSuggestionKind.INVOCATION, 'b',
-          DART_RELEVANCE_LOCAL_VARIABLE);
+          relevance: DART_RELEVANCE_LOCAL_VARIABLE);
       assertHasResult(CompletionSuggestionKind.INVOCATION, 'x',
-          DART_RELEVANCE_LOCAL_METHOD);
+          relevance: DART_RELEVANCE_LOCAL_METHOD);
       assertHasResult(CompletionSuggestionKind.INVOCATION, 'DateTime');
     });
   }
@@ -470,12 +569,14 @@
       expect(replacementOffset, equals(completionOffset));
       expect(replacementLength, equals(0));
       assertHasResult(CompletionSuggestionKind.INVOCATION, 'm',
-          DART_RELEVANCE_LOCAL_METHOD);
+          relevance: DART_RELEVANCE_LOCAL_METHOD);
     });
   }
 
   test_partFile() {
-    addFile('/project/bin/testA.dart', '''
+    addFile(
+        '/project/bin/testA.dart',
+        '''
       library libA;
       part "$testFile";
       import 'dart:html';
@@ -495,7 +596,9 @@
   }
 
   test_partFile2() {
-    addFile('/testA.dart', '''
+    addFile(
+        '/testA.dart',
+        '''
       part of libA;
       class A { }''');
     addTestFile('''
@@ -541,7 +644,7 @@
       // Suggestions based upon imported elements are partially filtered
       //assertHasResult(CompletionSuggestionKind.INVOCATION, 'Object');
       assertHasResult(CompletionSuggestionKind.INVOCATION, 'test',
-          DART_RELEVANCE_LOCAL_TOP_LEVEL_VARIABLE);
+          relevance: DART_RELEVANCE_LOCAL_TOP_LEVEL_VARIABLE);
       assertNoResult('HtmlElement');
     });
   }
@@ -619,6 +722,18 @@
   noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
 }
 
+class MockRelevancySorter implements ContributionSorter {
+  bool enabled = true;
+
+  @override
+  void sort(newApi.DartCompletionRequest request,
+      List<CompletionSuggestion> suggestions) {
+    if (!enabled) {
+      throw 'unexpected sort';
+    }
+  }
+}
+
 /**
  * Mock stream for tracking calls to listen and subscription.cancel.
  */
@@ -655,14 +770,24 @@
 class Test_AnalysisServer extends AnalysisServer {
   final MockContext mockContext = new MockContext();
 
-  Test_AnalysisServer(ServerCommunicationChannel channel,
+  Test_AnalysisServer(
+      ServerCommunicationChannel channel,
       ResourceProvider resourceProvider,
-      PubPackageMapProvider packageMapProvider, Index index,
-      ServerPlugin serverPlugin, AnalysisServerOptions analysisServerOptions,
-      DartSdk defaultSdk, InstrumentationService instrumentationService)
-      : super(channel, resourceProvider, packageMapProvider, index,
-          serverPlugin, analysisServerOptions, defaultSdk,
-          instrumentationService);
+      PubPackageMapProvider packageMapProvider,
+      Index index,
+      ServerPlugin serverPlugin,
+      AnalysisServerOptions analysisServerOptions,
+      DartSdk defaultSdk,
+      InstrumentationService instrumentationService)
+      : super(
+            channel,
+            resourceProvider,
+            packageMapProvider,
+            index,
+            serverPlugin,
+            analysisServerOptions,
+            defaultSdk,
+            instrumentationService);
 
   @override
   AnalysisContext getAnalysisContext(String path) {
diff --git a/pkg/analysis_server/test/domain_execution_test.dart b/pkg/analysis_server/test/domain_execution_test.dart
index 2ff54e1..927d46d 100644
--- a/pkg/analysis_server/test/domain_execution_test.dart
+++ b/pkg/analysis_server/test/domain_execution_test.dart
@@ -6,12 +6,12 @@
 
 import 'dart:async';
 
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/analysis_server.dart';
 import 'package:analysis_server/src/constants.dart';
 import 'package:analysis_server/src/context_manager.dart';
 import 'package:analysis_server/src/domain_execution.dart';
 import 'package:analysis_server/src/plugin/server_plugin.dart';
-import 'package:analysis_server/src/protocol.dart';
 import 'package:analyzer/file_system/file_system.dart';
 import 'package:analyzer/file_system/memory_file_system.dart';
 import 'package:analyzer/instrumentation/instrumentation.dart';
@@ -25,8 +25,10 @@
 import 'mock_sdk.dart';
 import 'mocks.dart';
 import 'operation/operation_queue_test.dart';
+import 'utils.dart';
 
 main() {
+  initializeTestEnvironment();
   group('ExecutionDomainHandler', () {
     MemoryResourceProvider provider = new MemoryResourceProvider();
     AnalysisServer server;
@@ -36,9 +38,14 @@
       ExtensionManager manager = new ExtensionManager();
       ServerPlugin serverPlugin = new ServerPlugin();
       manager.processPlugins([serverPlugin]);
-      server = new AnalysisServer(new MockServerChannel(), provider,
-          new MockPackageMapProvider(), null, serverPlugin,
-          new AnalysisServerOptions(), new MockSdk(),
+      server = new AnalysisServer(
+          new MockServerChannel(),
+          provider,
+          new MockPackageMapProvider(),
+          null,
+          serverPlugin,
+          new AnalysisServerOptions(),
+          new MockSdk(),
           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 d76b376..51237cd 100644
--- a/pkg/analysis_server/test/domain_server_test.dart
+++ b/pkg/analysis_server/test/domain_server_test.dart
@@ -4,11 +4,11 @@
 
 library test.domain.server;
 
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/analysis_server.dart';
 import 'package:analysis_server/src/constants.dart';
 import 'package:analysis_server/src/domain_server.dart';
 import 'package:analysis_server/src/plugin/server_plugin.dart';
-import 'package:analysis_server/src/protocol.dart';
 import 'package:analyzer/file_system/memory_file_system.dart';
 import 'package:analyzer/instrumentation/instrumentation.dart';
 import 'package:plugin/manager.dart';
@@ -16,20 +16,28 @@
 
 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();
     ExtensionManager manager = new ExtensionManager();
     ServerPlugin serverPlugin = new ServerPlugin();
     manager.processPlugins([serverPlugin]);
-    server = new AnalysisServer(serverChannel, resourceProvider,
-        new MockPackageMapProvider(), null, serverPlugin,
-        new AnalysisServerOptions(), new MockSdk(),
+    server = new AnalysisServer(
+        serverChannel,
+        resourceProvider,
+        new MockPackageMapProvider(),
+        null,
+        serverPlugin,
+        new AnalysisServerOptions(),
+        new MockSdk(),
         InstrumentationService.NULL_SERVICE);
     handler = new ServerDomainHandler(server);
   });
@@ -38,16 +46,19 @@
     test('getVersion', () {
       var request = new ServerGetVersionParams().toRequest('0');
       var response = handler.handleRequest(request);
-      expect(response.toJson(), equals({
-        Response.ID: '0',
-        Response.RESULT: {VERSION: AnalysisServer.VERSION}
-      }));
+      expect(
+          response.toJson(),
+          equals({
+            Response.ID: '0',
+            Response.RESULT: {VERSION: AnalysisServer.VERSION}
+          }));
     });
 
     group('setSubscriptions', () {
       test('invalid service name', () {
-        Request request = new Request(
-            '0', SERVER_SET_SUBSCRIPTIONS, {SUBSCRIPTIONS: ['noSuchService']});
+        Request request = new Request('0', SERVER_SET_SUBSCRIPTIONS, {
+          SUBSCRIPTIONS: ['noSuchService']
+        });
         var response = handler.handleRequest(request);
         expect(response, isResponseFailure('0'));
       });
diff --git a/pkg/analysis_server/test/edit/assists_test.dart b/pkg/analysis_server/test/edit/assists_test.dart
index 42ca88a..b6572c4 100644
--- a/pkg/analysis_server/test/edit/assists_test.dart
+++ b/pkg/analysis_server/test/edit/assists_test.dart
@@ -6,16 +6,17 @@
 
 import 'dart:async';
 
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/edit/edit_domain.dart';
-import 'package:analysis_server/src/protocol.dart';
 import 'package:plugin/manager.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() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(AssistsTest);
 }
 
@@ -53,7 +54,9 @@
 ''');
     await waitForTasksFinished();
     prepareAssists('v =');
-    _assertHasChange('Remove type annotation', '''
+    _assertHasChange(
+        'Remove type annotation',
+        '''
 main() {
   var v = 1;
 }
@@ -68,7 +71,9 @@
 ''');
     await waitForTasksFinished();
     prepareAssists('v =');
-    _assertHasChange('Split variable declaration', '''
+    _assertHasChange(
+        'Split variable declaration',
+        '''
 main() {
   int v;
   v = 1;
@@ -87,7 +92,9 @@
     int offset = findOffset('  print(1)');
     int length = findOffset('}') - offset;
     prepareAssistsAt(offset, length);
-    _assertHasChange("Surround with 'if'", '''
+    _assertHasChange(
+        "Surround with 'if'",
+        '''
 main() {
   if (condition) {
     print(1);
diff --git a/pkg/analysis_server/test/edit/fixes_test.dart b/pkg/analysis_server/test/edit/fixes_test.dart
index 800b9f8..531bf43 100644
--- a/pkg/analysis_server/test/edit/fixes_test.dart
+++ b/pkg/analysis_server/test/edit/fixes_test.dart
@@ -6,18 +6,19 @@
 
 import 'dart:async';
 
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/domain_analysis.dart';
 import 'package:analysis_server/src/edit/edit_domain.dart';
-import 'package:analysis_server/src/protocol.dart';
 import 'package:plugin/manager.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() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(FixesTest);
 }
 
diff --git a/pkg/analysis_server/test/edit/format_test.dart b/pkg/analysis_server/test/edit/format_test.dart
index 20dbdb3..e04ccf1 100644
--- a/pkg/analysis_server/test/edit/format_test.dart
+++ b/pkg/analysis_server/test/edit/format_test.dart
@@ -6,17 +6,18 @@
 
 import 'dart:async';
 
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/edit/edit_domain.dart';
-import 'package:analysis_server/src/protocol.dart';
 import 'package:plugin/manager.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() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(FormatTest);
 }
 
@@ -31,6 +32,24 @@
     handler = new EditDomainHandler(server);
   }
 
+  Future test_format_longLine() {
+    String content = '''
+fun(firstParam, secondParam, thirdParam, fourthParam) {
+  if (firstParam.noNull && secondParam.noNull && thirdParam.noNull && fourthParam.noNull) {}
+}
+''';
+    addTestFile(content);
+    return waitForTasksFinished().then((_) {
+      EditFormatResult formatResult = _formatAt(0, 3, lineLength: 100);
+
+      expect(formatResult.edits, isNotNull);
+      expect(formatResult.edits, hasLength(0));
+
+      expect(formatResult.selectionOffset, equals(0));
+      expect(formatResult.selectionLength, equals(3));
+    });
+  }
+
   Future test_format_noOp() {
     // Already formatted source
     addTestFile('''
@@ -86,24 +105,6 @@
     });
   }
 
-  Future test_format_longLine() {
-    String content = '''
-fun(firstParam, secondParam, thirdParam, fourthParam) {
-  if (firstParam.noNull && secondParam.noNull && thirdParam.noNull && fourthParam.noNull) {}
-}
-''';
-    addTestFile(content);
-    return waitForTasksFinished().then((_) {
-      EditFormatResult formatResult = _formatAt(0, 3, lineLength: 100);
-
-      expect(formatResult.edits, isNotNull);
-      expect(formatResult.edits, hasLength(0));
-
-      expect(formatResult.selectionOffset, equals(0));
-      expect(formatResult.selectionLength, equals(3));
-    });
-  }
-
   Future test_format_withErrors() {
     addTestFile('''
 main() { int x = 
@@ -115,9 +116,11 @@
     });
   }
 
-  EditFormatResult _formatAt(int selectionOffset, int selectionLength, {int lineLength}) {
+  EditFormatResult _formatAt(int selectionOffset, int selectionLength,
+      {int lineLength}) {
     Request request = new EditFormatParams(
-        testFile, selectionOffset, selectionLength, lineLength: lineLength).toRequest('0');
+        testFile, selectionOffset, selectionLength,
+        lineLength: lineLength).toRequest('0');
     Response response = handleSuccessfulRequest(request);
     return new EditFormatResult.fromResponse(response);
   }
diff --git a/pkg/analysis_server/test/edit/organize_directives_test.dart b/pkg/analysis_server/test/edit/organize_directives_test.dart
index e4402ef..5223627 100644
--- a/pkg/analysis_server/test/edit/organize_directives_test.dart
+++ b/pkg/analysis_server/test/edit/organize_directives_test.dart
@@ -6,17 +6,18 @@
 
 import 'dart:async';
 
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/edit/edit_domain.dart';
-import 'package:analysis_server/src/protocol.dart';
 import 'package:plugin/manager.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() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(OrganizeDirectivesTest);
 }
 
@@ -64,6 +65,28 @@
         response, isResponseFailure('0', RequestErrorCode.FILE_NOT_ANALYZED));
   }
 
+  Future test_OK_remove_duplicateImports_withSamePrefix() {
+    addTestFile('''
+library lib;
+
+import 'dart:async' as async;
+import 'dart:async' as async;
+
+main() {
+  async.Future f;
+}
+''');
+    return _assertOrganized(r'''
+library lib;
+
+import 'dart:async' as async;
+
+main() {
+  async.Future f;
+}
+''');
+  }
+
   Future test_OK_remove_unresolvedDirectives() {
     addFile('$testFolder/existing_part1.dart', 'part of lib;');
     addFile('$testFolder/existing_part2.dart', 'part of lib;');
diff --git a/pkg/analysis_server/test/edit/refactoring_test.dart b/pkg/analysis_server/test/edit/refactoring_test.dart
index d59999f..0cc4971 100644
--- a/pkg/analysis_server/test/edit/refactoring_test.dart
+++ b/pkg/analysis_server/test/edit/refactoring_test.dart
@@ -6,8 +6,8 @@
 
 import 'dart:async';
 
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/edit/edit_domain.dart';
-import 'package:analysis_server/src/protocol.dart';
 import 'package:analysis_server/src/services/index/index.dart';
 import 'package:analysis_server/src/services/index/local_memory_index.dart';
 import 'package:plugin/manager.dart';
@@ -16,9 +16,10 @@
 
 import '../analysis_abstract.dart';
 import '../mocks.dart';
+import '../utils.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(ConvertGetterMethodToMethodTest);
   defineReflectiveTests(ConvertMethodToGetterTest);
   defineReflectiveTests(ExtractLocalVariableTest);
@@ -43,7 +44,8 @@
 ''');
     return assertSuccessfulRefactoring(() {
       return _sendConvertRequest('test =>');
-    }, '''
+    },
+        '''
 int test() => 42;
 main() {
   var a = 1 + test();
@@ -92,7 +94,8 @@
 ''');
     return assertSuccessfulRefactoring(() {
       return _sendConvertRequest('test => 2');
-    }, '''
+    },
+        '''
 class A {
   int test() => 1;
 }
@@ -116,8 +119,11 @@
 
   Future<Response> _sendConvertRequest(String search) {
     Request request = new EditGetRefactoringParams(
-        RefactoringKind.CONVERT_GETTER_TO_METHOD, testFile, findOffset(search),
-        0, false).toRequest('0');
+        RefactoringKind.CONVERT_GETTER_TO_METHOD,
+        testFile,
+        findOffset(search),
+        0,
+        false).toRequest('0');
     return serverChannel.sendRequest(request);
   }
 }
@@ -134,7 +140,8 @@
 ''');
     return assertSuccessfulRefactoring(() {
       return _sendConvertRequest('test() =>');
-    }, '''
+    },
+        '''
 int get test => 42;
 main() {
   var a = 1 + test;
@@ -200,7 +207,8 @@
 ''');
     return assertSuccessfulRefactoring(() {
       return _sendConvertRequest('test() => 2');
-    }, '''
+    },
+        '''
 class A {
   int get test => 1;
 }
@@ -224,8 +232,11 @@
 
   Future<Response> _sendConvertRequest(String search) {
     Request request = new EditGetRefactoringParams(
-        RefactoringKind.CONVERT_METHOD_TO_GETTER, testFile, findOffset(search),
-        0, false).toRequest('0');
+        RefactoringKind.CONVERT_METHOD_TO_GETTER,
+        testFile,
+        findOffset(search),
+        0,
+        false).toRequest('0');
     return serverChannel.sendRequest(request);
   }
 }
@@ -258,6 +269,9 @@
     test_simulateRefactoringException_init = false;
     test_simulateRefactoringException_final = false;
     test_simulateRefactoringException_change = false;
+    test_simulateRefactoringReset_afterInitialConditions = false;
+    test_simulateRefactoringReset_afterFinalConditions = false;
+    test_simulateRefactoringReset_afterCreateChange = false;
     super.tearDown();
   }
 
@@ -270,7 +284,8 @@
 ''');
     return assertSuccessfulRefactoring(() {
       return sendStringRequest('1 + 2', 'res', true);
-    }, '''
+    },
+        '''
 main() {
   var res = 1 + 2;
   print(res);
@@ -288,7 +303,8 @@
 ''');
     return assertSuccessfulRefactoring(() {
       return sendStringSuffixRequest('1 + 2', '); // marker', 'res', false);
-    }, '''
+    },
+        '''
 main() {
   print(1 + 2);
   var res = 1 + 2;
@@ -327,7 +343,9 @@
       assertResultProblemsWarning(result.optionsProblems,
           'Variable name should start with a lowercase letter.');
       // ...but there is still a change
-      assertTestRefactoringResult(result, '''
+      assertTestRefactoringResult(
+          result,
+          '''
 main() {
   var Name = 1 + 2;
   print(Name);
@@ -352,6 +370,48 @@
     });
   }
 
+  test_reset_afterCreateChange() {
+    test_simulateRefactoringReset_afterCreateChange = true;
+    addTestFile('''
+main() {
+  print(1 + 2);
+}
+''');
+    return waitForTasksFinished().then((_) {
+      return sendStringRequest('1 + 2', 'res', true).then((response) {
+        _expectRefactoringRequestCancelled(response);
+      });
+    });
+  }
+
+  test_reset_afterFinalConditions() {
+    test_simulateRefactoringReset_afterFinalConditions = true;
+    addTestFile('''
+main() {
+  print(1 + 2);
+}
+''');
+    return waitForTasksFinished().then((_) {
+      return sendStringRequest('1 + 2', 'res', true).then((response) {
+        _expectRefactoringRequestCancelled(response);
+      });
+    });
+  }
+
+  test_reset_afterInitialConditions() {
+    test_simulateRefactoringReset_afterInitialConditions = true;
+    addTestFile('''
+main() {
+  print(1 + 2);
+}
+''');
+    return waitForTasksFinished().then((_) {
+      return sendStringRequest('1 + 2', 'res', true).then((response) {
+        _expectRefactoringRequestCancelled(response);
+      });
+    });
+  }
+
   test_serverError_change() {
     test_simulateRefactoringException_change = true;
     addTestFile('''
@@ -396,6 +456,12 @@
       });
     });
   }
+
+  void _expectRefactoringRequestCancelled(Response response) {
+    expect(response.error, isNotNull);
+    expect(response,
+        isResponseFailure('0', RequestErrorCode.REFACTORING_REQUEST_CANCELLED));
+  }
 }
 
 @reflectiveTest
@@ -413,7 +479,9 @@
 }
 ''');
     _setOffsetLengthForString('1 + 2');
-    return assertSuccessfulRefactoring(_computeChange, '''
+    return assertSuccessfulRefactoring(
+        _computeChange,
+        '''
 main() {
   print(res());
   print(res());
@@ -433,7 +501,9 @@
 }
 ''');
     _setOffsetLengthForString('a + b');
-    return assertSuccessfulRefactoring(_computeChange, '''
+    return assertSuccessfulRefactoring(
+        _computeChange,
+        '''
 main() {
   int a = 1;
   int b = 2;
@@ -463,7 +533,9 @@
       parameters[1].type = 'num';
       parameters.insert(0, parameters.removeLast());
       options.parameters = parameters;
-      return assertSuccessfulRefactoring(_sendExtractRequest, '''
+      return assertSuccessfulRefactoring(
+          _sendExtractRequest,
+          '''
 main() {
   int a = 1;
   int b = 2;
@@ -542,7 +614,9 @@
 }
 ''');
     _setOffsetLengthForStartEnd();
-    return assertSuccessfulRefactoring(_computeChange, '''
+    return assertSuccessfulRefactoring(
+        _computeChange,
+        '''
 main() {
   int a = 1;
   int b = 2;
@@ -675,9 +749,13 @@
   }
 
   Future test_convertMethodToGetter_hasElement() {
-    return assertHasKind('''
+    return assertHasKind(
+        '''
 int getValue() => 42;
-''', 'getValue', RefactoringKind.CONVERT_METHOD_TO_GETTER, true);
+''',
+        'getValue',
+        RefactoringKind.CONVERT_METHOD_TO_GETTER,
+        true);
   }
 
   Future test_extractLocal() async {
@@ -693,108 +771,130 @@
   }
 
   Future test_rename_hasElement_class() {
-    return assertHasRenameRefactoring('''
+    return assertHasRenameRefactoring(
+        '''
 class Test {}
 main() {
   Test v;
 }
-''', 'Test v');
+''',
+        'Test v');
   }
 
   Future test_rename_hasElement_constructor() {
-    return assertHasRenameRefactoring('''
+    return assertHasRenameRefactoring(
+        '''
 class A {
   A.test() {}
 }
 main() {
   new A.test();
 }
-''', 'test();');
+''',
+        'test();');
   }
 
   Future test_rename_hasElement_function() {
-    return assertHasRenameRefactoring('''
+    return assertHasRenameRefactoring(
+        '''
 main() {
   test();
 }
 test() {}
-''', 'test();');
+''',
+        'test();');
   }
 
   Future test_rename_hasElement_importElement_directive() {
-    return assertHasRenameRefactoring('''
+    return assertHasRenameRefactoring(
+        '''
 import 'dart:math' as math;
 main() {
   math.PI;
 }
-''', 'import ');
+''',
+        'import ');
   }
 
   Future test_rename_hasElement_importElement_prefixDecl() {
-    return assertHasRenameRefactoring('''
+    return assertHasRenameRefactoring(
+        '''
 import 'dart:math' as math;
 main() {
   math.PI;
 }
-''', 'math;');
+''',
+        'math;');
   }
 
   Future test_rename_hasElement_importElement_prefixRef() {
-    return assertHasRenameRefactoring('''
+    return assertHasRenameRefactoring(
+        '''
 import 'dart:async' as test;
 import 'dart:math' as test;
 main() {
   test.PI;
 }
-''', 'test.PI;');
+''',
+        'test.PI;');
   }
 
   Future test_rename_hasElement_instanceGetter() {
-    return assertHasRenameRefactoring('''
+    return assertHasRenameRefactoring(
+        '''
 class A {
   get test => 0;
 }
 main(A a) {
   a.test;
 }
-''', 'test;');
+''',
+        'test;');
   }
 
   Future test_rename_hasElement_instanceSetter() {
-    return assertHasRenameRefactoring('''
+    return assertHasRenameRefactoring(
+        '''
 class A {
   set test(x) {}
 }
 main(A a) {
   a.test = 2;
 }
-''', 'test = 2;');
+''',
+        'test = 2;');
   }
 
   Future test_rename_hasElement_library() {
-    return assertHasRenameRefactoring('''
+    return assertHasRenameRefactoring(
+        '''
 library my.lib;
-''', 'library ');
+''',
+        'library ');
   }
 
   Future test_rename_hasElement_localVariable() {
-    return assertHasRenameRefactoring('''
+    return assertHasRenameRefactoring(
+        '''
 main() {
   int test = 0;
   print(test);
 }
-''', 'test = 0;');
+''',
+        'test = 0;');
   }
 
   Future test_rename_hasElement_method() {
-    return assertHasRenameRefactoring('''
+    return assertHasRenameRefactoring(
+        '''
 class A {
   test() {}
 }
 main(A a) {
   a.test();
 }
-''', 'test();');
+''',
+        'test();');
   }
 
   Future test_rename_noElement() async {
@@ -850,7 +950,8 @@
 ''');
     return assertSuccessfulRefactoring(() {
       return _sendInlineRequest('test + 2');
-    }, '''
+    },
+        '''
 main() {
   int a = 42 + 2;
   print(42);
@@ -860,7 +961,10 @@
 
   Future<Response> _sendInlineRequest(String search) {
     Request request = new EditGetRefactoringParams(
-        RefactoringKind.INLINE_LOCAL_VARIABLE, testFile, findOffset(search), 0,
+        RefactoringKind.INLINE_LOCAL_VARIABLE,
+        testFile,
+        findOffset(search),
+        0,
         false).toRequest('0');
     return serverChannel.sendRequest(request);
   }
@@ -921,7 +1025,8 @@
 ''');
     return assertSuccessfulRefactoring(() {
       return _sendInlineRequest('test(int p)');
-    }, '''
+    },
+        '''
 class A {
   int f;
   main() {
@@ -946,7 +1051,8 @@
 ''');
     return assertSuccessfulRefactoring(() {
       return _sendInlineRequest('test(a');
-    }, '''
+    },
+        '''
 main() {
   print(1 + 2);
   print(10 + 20);
@@ -968,7 +1074,8 @@
     options.inlineAll = false;
     return assertSuccessfulRefactoring(() {
       return _sendInlineRequest('test(10,');
-    }, '''
+    },
+        '''
 test(a, b) {
   print(a + b);
 }
@@ -1000,7 +1107,8 @@
     _setOptions('/project/test.dart');
     return assertSuccessfulRefactoring(() {
       return _sendMoveRequest();
-    }, '''
+    },
+        '''
 import 'dart:math';
 import 'bin/lib.dart';
 ''');
@@ -1008,8 +1116,8 @@
 
   Future<Response> _sendMoveRequest() {
     Request request = new EditGetRefactoringParams(
-            RefactoringKind.MOVE_FILE, testFile, 0, 0, false, options: options)
-        .toRequest('0');
+        RefactoringKind.MOVE_FILE, testFile, 0, 0, false,
+        options: options).toRequest('0');
     return serverChannel.sendRequest(request);
   }
 
@@ -1063,7 +1171,8 @@
 ''');
     return assertSuccessfulRefactoring(() {
       return sendRenameRequest('Test {', 'NewName');
-    }, '''
+    },
+        '''
 class NewName {
   NewName() {}
   NewName.named() {}
@@ -1124,7 +1233,9 @@
       assertResultProblemsWarning(result.optionsProblems,
           'Class name should start with an uppercase letter.');
       // ...but there is still a change
-      assertTestRefactoringResult(result, '''
+      assertTestRefactoringResult(
+          result,
+          '''
 class newName {}
 main() {
   newName v;
@@ -1137,7 +1248,9 @@
       }).then((result) {
         assertResultProblemsOK(result);
         // ...and there is a new change
-        assertTestRefactoringResult(result, '''
+        assertTestRefactoringResult(
+            result,
+            '''
 class NewName {}
 main() {
   NewName v;
@@ -1159,7 +1272,8 @@
 ''');
     return assertSuccessfulRefactoring(() {
       return sendRenameRequest('test = 0', 'newName');
-    }, '''
+    },
+        '''
 class A {
   var newName = 0;
   A(this.newName);
@@ -1182,7 +1296,8 @@
 ''');
     return assertSuccessfulRefactoring(() {
       return sendRenameRequest('test);', 'newName');
-    }, '''
+    },
+        '''
 class A {
   var newName = 0;
   A(this.newName);
@@ -1205,7 +1320,8 @@
 ''');
     return assertSuccessfulRefactoring(() {
       return sendRenameRequest('test: 42', 'newName');
-    }, '''
+    },
+        '''
 class A {
   final int newName;
   A({this.newName: 0});
@@ -1227,7 +1343,8 @@
 ''');
     return assertSuccessfulRefactoring(() {
       return sendRenameRequest('test =>', 'newName');
-    }, '''
+    },
+        '''
 class A {
   get newName => 0;
   main() {
@@ -1251,7 +1368,8 @@
 ''');
     return assertSuccessfulRefactoring(() {
       return sendRenameRequest('test() {}', 'newName');
-    }, '''
+    },
+        '''
 class A {
   newName() {}
   main() {
@@ -1302,7 +1420,8 @@
 ''');
     return assertSuccessfulRefactoring(() {
       return sendRenameRequest('test = 0', 'newName');
-    }, '''
+    },
+        '''
 class A {
   set newName(x) {}
   main() {
@@ -1323,7 +1442,8 @@
 ''');
     return assertSuccessfulRefactoring(() {
       return sendRenameRequest('B;', 'newName');
-    }, '''
+    },
+        '''
 class A {
   A() = B.newName;
 }
@@ -1344,7 +1464,8 @@
 ''');
     return assertSuccessfulRefactoring(() {
       return sendRenameRequest('test();', 'newName');
-    }, '''
+    },
+        '''
 class A {
   A.newName() {}
 }
@@ -1365,7 +1486,8 @@
 ''');
     return assertSuccessfulRefactoring(() {
       return sendRenameRequest('A();', 'newName');
-    }, '''
+    },
+        '''
 class A {
   A.newName() {}
 }
@@ -1386,7 +1508,8 @@
 ''');
     return assertSuccessfulRefactoring(() {
       return sendRenameRequest('new A();', 'newName');
-    }, '''
+    },
+        '''
 class A {
   A.newName() {}
 }
@@ -1423,7 +1546,8 @@
 ''');
     return assertSuccessfulRefactoring(() {
       return sendRenameRequest('test() {}', 'newName');
-    }, '''
+    },
+        '''
 newName() {}
 main() {
   newName();
@@ -1443,7 +1567,8 @@
 ''');
     return assertSuccessfulRefactoring(() {
       return sendRenameRequest("import 'dart:async';", 'new_name');
-    }, '''
+    },
+        '''
 import 'dart:math';
 import 'dart:async' as new_name;
 main() {
@@ -1464,7 +1589,8 @@
 ''');
     return assertSuccessfulRefactoring(() {
       return sendRenameRequest("import 'dart:async' as test;", '');
-    }, '''
+    },
+        '''
 import 'dart:math' as test;
 import 'dart:async';
 main() {
@@ -1492,7 +1618,8 @@
 ''');
     return assertSuccessfulRefactoring(() {
       return sendRenameRequest('library aaa', 'my.new_name');
-    }, '''
+    },
+        '''
 library my.new_name;
 ''');
   }
@@ -1503,7 +1630,8 @@
 ''');
     return assertSuccessfulRefactoring(() {
       return sendRenameRequest('aaa', 'my.new_name');
-    }, '''
+    },
+        '''
 library my.new_name;
 ''');
   }
@@ -1514,11 +1642,30 @@
 ''');
     return assertSuccessfulRefactoring(() {
       return sendRenameRequest('.bbb', 'my.new_name');
-    }, '''
+    },
+        '''
 library my.new_name;
 ''');
   }
 
+  test_library_partOfDirective() {
+    addFile(
+        '$testFolder/my_lib.dart',
+        '''
+library aaa.bbb.ccc;
+part 'test.dart';
+''');
+    addTestFile('''
+part of aaa.bbb.ccc;
+''');
+    return assertSuccessfulRefactoring(() {
+      return sendRenameRequest('aaa.bb', 'my.new_name');
+    },
+        '''
+part of my.new_name;
+''');
+  }
+
   test_localVariable() {
     addTestFile('''
 main() {
@@ -1530,7 +1677,8 @@
 ''');
     return assertSuccessfulRefactoring(() {
       return sendRenameRequest('test = 1', 'newName');
-    }, '''
+    },
+        '''
 main() {
   int newName = 0;
   newName = 1;
@@ -1701,8 +1849,8 @@
       RefactoringKind kind, int offset, int length, RefactoringOptions options,
       [bool validateOnly = false]) {
     Request request = new EditGetRefactoringParams(
-            kind, testFile, offset, length, validateOnly, options: options)
-        .toRequest('0');
+        kind, testFile, offset, length, validateOnly,
+        options: options).toRequest('0');
     return serverChannel.sendRequest(request);
   }
 
diff --git a/pkg/analysis_server/test/edit/sort_members_test.dart b/pkg/analysis_server/test/edit/sort_members_test.dart
index 194baa9..8bae43f 100644
--- a/pkg/analysis_server/test/edit/sort_members_test.dart
+++ b/pkg/analysis_server/test/edit/sort_members_test.dart
@@ -6,17 +6,18 @@
 
 import 'dart:async';
 
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/edit/edit_domain.dart';
-import 'package:analysis_server/src/protocol.dart';
 import 'package:plugin/manager.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() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(SortMembersTest);
 }
 
diff --git a/pkg/analysis_server/test/edit/test_all.dart b/pkg/analysis_server/test/edit/test_all.dart
index e9a9ea1..ef861d8 100644
--- a/pkg/analysis_server/test/edit/test_all.dart
+++ b/pkg/analysis_server/test/edit/test_all.dart
@@ -6,6 +6,7 @@
 
 import 'package:unittest/unittest.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;
@@ -17,7 +18,7 @@
  * Utility for manually running all tests.
  */
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   group('edit', () {
     assists_test.main();
     fixes_test.main();
diff --git a/pkg/analysis_server/test/integration/analysis/analysis_options_test.dart b/pkg/analysis_server/test/integration/analysis/analysis_options_test.dart
new file mode 100644
index 0000000..c1cabe0
--- /dev/null
+++ b/pkg/analysis_server/test/integration/analysis/analysis_options_test.dart
@@ -0,0 +1,47 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library test.integration.analysis.analysis_options;
+
+import 'package:analysis_server/plugin/protocol/protocol.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);
+}
+
+@reflectiveTest
+class OptionsIntegrationTest extends AbstractAnalysisServerIntegrationTest {
+  test_option_warning() async {
+    String options = sourcePath('.analysis_options');
+    writeFile(
+        options,
+        '''
+linter:
+  rules:
+    - camel_case_typo # :)
+''');
+
+    standardAnalysisSetup();
+
+    await analysisFinished;
+
+    expect(currentAnalysisErrors[options], isList);
+    List<AnalysisError> errors = currentAnalysisErrors[options];
+    expect(errors, hasLength(1));
+    AnalysisError error = errors[0];
+    expect(error.location.file, options);
+    expect(error.severity, AnalysisErrorSeverity.WARNING);
+    expect(error.type, AnalysisErrorType.STATIC_WARNING);
+    expect(error.location.offset, 23);
+    expect(error.location.length, 'camel_case_typo'.length);
+    expect(error.location.startLine, 3);
+    expect(error.location.startColumn, 7);
+  }
+}
diff --git a/pkg/analysis_server/test/integration/analysis/error_test.dart b/pkg/analysis_server/test/integration/analysis/error_test.dart
index 7337545..cd490fa 100644
--- a/pkg/analysis_server/test/integration/analysis/error_test.dart
+++ b/pkg/analysis_server/test/integration/analysis/error_test.dart
@@ -4,13 +4,15 @@
 
 library test.integration.analysis.error;
 
-import 'package:analysis_server/src/protocol.dart';
+import 'package:analysis_server/plugin/protocol/protocol.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);
 }
 
@@ -19,7 +21,9 @@
     extends AbstractAnalysisServerIntegrationTest {
   test_detect_simple_error() {
     String pathname = sourcePath('test.dart');
-    writeFile(pathname, '''
+    writeFile(
+        pathname,
+        '''
 main() {
   print(null) // parse error: missing ';'
 }''');
@@ -31,4 +35,64 @@
       expect(errors[0].location.file, equals(pathname));
     });
   }
+
+  test_super_mixins_disabled() async {
+    String pathname = sourcePath('test.dart');
+    writeFile(
+        pathname,
+        '''
+class Test extends Object with C {
+  void foo() {}
+}
+abstract class B {
+  void foo();
+}
+abstract class C extends B {
+  void bar() {
+    super.foo();
+  }
+}
+''');
+    standardAnalysisSetup();
+    await analysisFinished;
+    expect(currentAnalysisErrors[pathname], isList);
+    List<AnalysisError> errors = currentAnalysisErrors[pathname];
+    expect(errors, hasLength(2));
+    Set<String> allErrorMessages =
+        errors.map((AnalysisError e) => e.message).toSet();
+    expect(
+        allErrorMessages,
+        contains(
+            "The class 'C' cannot 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'"));
+  }
+
+  test_super_mixins_enabled() async {
+    String pathname = sourcePath('test.dart');
+    writeFile(
+        pathname,
+        '''
+class Test extends Object with C {
+  void foo() {}
+}
+abstract class B {
+  void foo();
+}
+abstract class C extends B {
+  void bar() {
+    super.foo();
+  }
+}
+''');
+    await sendAnalysisUpdateOptions(
+        new AnalysisOptions()..enableSuperMixins = true);
+    standardAnalysisSetup();
+    await analysisFinished;
+    expect(currentAnalysisErrors[pathname], isList);
+    List<AnalysisError> errors = currentAnalysisErrors[pathname];
+    expect(errors, isEmpty);
+  }
 }
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 091eea6..2024194 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,9 +6,11 @@
 
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 
+import '../../utils.dart';
 import 'get_errors.dart';
 
 main() {
+  initializeTestEnvironment();
   defineReflectiveTests(Test);
 }
 
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 34fa7e7..51ef942 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,9 +6,11 @@
 
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 
+import '../../utils.dart';
 import 'get_errors.dart';
 
 main() {
+  initializeTestEnvironment();
   defineReflectiveTests(Test);
 }
 
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 3928d99..b42cd9e 100644
--- a/pkg/analysis_server/test/integration/analysis/get_hover_test.dart
+++ b/pkg/analysis_server/test/integration/analysis/get_hover_test.dart
@@ -6,14 +6,16 @@
 
 import 'dart:async';
 
-import 'package:analysis_server/src/protocol.dart';
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:path/path.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);
 }
 
@@ -62,9 +64,13 @@
    * expected propagated type of the element.
    */
   checkHover(String target, int length, List<String> descriptionRegexps,
-      String kind, List<String> staticTypeRegexps, {bool isLocal: false,
-      bool isCore: false, String docRegexp: null, bool isLiteral: false,
-      List<String> parameterRegexps: null, propagatedType: null}) {
+      String kind, List<String> staticTypeRegexps,
+      {bool isLocal: false,
+      bool isCore: false,
+      String docRegexp: null,
+      bool isLiteral: false,
+      List<String> parameterRegexps: null,
+      propagatedType: null}) {
     int offset = text.indexOf(target);
     return sendAnalysisGetHover(pathname, offset).then((result) {
       expect(result.hovers, hasLength(1));
@@ -141,10 +147,8 @@
     // request is made.  So wait for analysis to finish before testing anything.
     return analysisFinished.then((_) {
       List<Future> tests = [];
-      tests.add(checkHover('topLevelVar;', 11, [
-        'List',
-        'topLevelVar'
-      ], 'top level variable', ['List']));
+      tests.add(checkHover('topLevelVar;', 11, ['List', 'topLevelVar'],
+          'top level variable', ['List']));
       tests.add(checkHover(
           'func(', 4, ['func', 'int', 'param'], 'function', ['int', 'void'],
           docRegexp: 'Documentation for func'));
@@ -157,10 +161,8 @@
       tests.add(checkHover(
           'localVar =', 8, ['num', 'localVar'], 'local variable', ['num'],
           isLocal: true, propagatedType: 'int'));
-      tests.add(checkHover('topLevelVar.length;', 11, [
-        'List',
-        'topLevelVar'
-      ], 'top level variable', ['List']));
+      tests.add(checkHover('topLevelVar.length;', 11, ['List', 'topLevelVar'],
+          'top level variable', ['List']));
       tests.add(checkHover(
           'length;', 6, ['get', 'length', 'int'], 'getter', ['int'],
           isCore: true, docRegexp: '.*'));
diff --git a/pkg/analysis_server/test/integration/analysis/highlights_test.dart b/pkg/analysis_server/test/integration/analysis/highlights_test.dart
index b466ff6..7605ea3 100644
--- a/pkg/analysis_server/test/integration/analysis/highlights_test.dart
+++ b/pkg/analysis_server/test/integration/analysis/highlights_test.dart
@@ -4,13 +4,15 @@
 
 library test.integration.analysis.highlights;
 
-import 'package:analysis_server/src/protocol.dart';
+import 'package:analysis_server/plugin/protocol/protocol.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);
 }
 
@@ -70,7 +72,9 @@
 ''';
     writeFile(pathname, text);
     standardAnalysisSetup();
-    sendAnalysisSetSubscriptions({AnalysisService.HIGHLIGHTS: [pathname]});
+    sendAnalysisSetSubscriptions({
+      AnalysisService.HIGHLIGHTS: [pathname]
+    });
     // Map from highlight type to highlighted text
     Map<HighlightRegionType, Set<String>> highlights;
     onAnalysisHighlights.listen((AnalysisHighlightsParams params) {
@@ -96,21 +100,10 @@
         highlights.remove(type);
       }
       check(HighlightRegionType.ANNOTATION, ['@override']);
-      check(HighlightRegionType.BUILT_IN, [
-        'as',
-        'get',
-        'import',
-        'set',
-        'static',
-        'typedef'
-      ]);
-      check(HighlightRegionType.CLASS, [
-        'Class',
-        'Class2',
-        'Future',
-        'Map',
-        'int'
-      ]);
+      check(HighlightRegionType.BUILT_IN,
+          ['as', 'get', 'import', 'set', 'static', 'typedef']);
+      check(HighlightRegionType.CLASS,
+          ['Class', 'Class2', 'Future', 'Map', 'int']);
       check(HighlightRegionType.COMMENT_BLOCK, ['/* Block comment */']);
       check(HighlightRegionType.COMMENT_DOCUMENTATION,
           ['/**\n * Doc comment\n */']);
@@ -132,10 +125,8 @@
       check(HighlightRegionType.LITERAL_DOUBLE, ['1.0']);
       check(HighlightRegionType.LITERAL_INTEGER, ['2', '42']);
       check(HighlightRegionType.LITERAL_LIST, ['[]']);
-      check(HighlightRegionType.LITERAL_MAP, [
-        '{1.0: [].toList()}',
-        '{2: local}'
-      ]);
+      check(HighlightRegionType.LITERAL_MAP,
+          ['{1.0: [].toList()}', '{2: local}']);
       check(HighlightRegionType.LITERAL_STRING, ["'dart:async'", "'string'"]);
       check(HighlightRegionType.LOCAL_VARIABLE, ['local']);
       check(HighlightRegionType.LOCAL_VARIABLE_DECLARATION, ['local']);
@@ -145,10 +136,8 @@
       check(HighlightRegionType.METHOD_STATIC, ['wait']);
       check(HighlightRegionType.PARAMETER, ['parameter']);
       check(HighlightRegionType.SETTER_DECLARATION, ['setter']);
-      check(HighlightRegionType.TOP_LEVEL_VARIABLE, [
-        'override',
-        'topLevelVariable'
-      ]);
+      check(HighlightRegionType.TOP_LEVEL_VARIABLE,
+          ['override', 'topLevelVariable']);
       check(HighlightRegionType.TYPE_NAME_DYNAMIC, ['dynamic']);
       check(HighlightRegionType.TYPE_PARAMETER, ['TypeParameter']);
       expect(highlights, isEmpty);
diff --git a/pkg/analysis_server/test/integration/analysis/highlights_test2.dart b/pkg/analysis_server/test/integration/analysis/highlights_test2.dart
index 71913f0..54dd3ef 100644
--- a/pkg/analysis_server/test/integration/analysis/highlights_test2.dart
+++ b/pkg/analysis_server/test/integration/analysis/highlights_test2.dart
@@ -6,13 +6,15 @@
 
 import 'dart:async';
 
-import 'package:analysis_server/src/protocol.dart';
+import 'package:analysis_server/plugin/protocol/protocol.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);
 }
 
@@ -77,7 +79,9 @@
 ''';
     writeFile(pathname, text);
     standardAnalysisSetup();
-    sendAnalysisSetSubscriptions({AnalysisService.HIGHLIGHTS: [pathname]});
+    sendAnalysisSetSubscriptions({
+      AnalysisService.HIGHLIGHTS: [pathname]
+    });
     // Map from highlight type to highlighted text
     Map<HighlightRegionType, Set<String>> highlights;
     onAnalysisHighlights.listen((AnalysisHighlightsParams params) {
@@ -103,21 +107,10 @@
         highlights.remove(type);
       }
       check(HighlightRegionType.ANNOTATION, ['@override']);
-      check(HighlightRegionType.BUILT_IN, [
-        'as',
-        'get',
-        'import',
-        'set',
-        'static',
-        'typedef'
-      ]);
-      check(HighlightRegionType.CLASS, [
-        'Class',
-        'Class2',
-        'Future',
-        'Map',
-        'int'
-      ]);
+      check(HighlightRegionType.BUILT_IN,
+          ['as', 'get', 'import', 'set', 'static', 'typedef']);
+      check(HighlightRegionType.CLASS,
+          ['Class', 'Class2', 'Future', 'Map', 'int']);
       check(HighlightRegionType.COMMENT_BLOCK, ['/* Block comment */']);
       check(HighlightRegionType.COMMENT_DOCUMENTATION,
           ['/**\n * Doc comment\n */']);
@@ -140,10 +133,8 @@
       check(HighlightRegionType.LITERAL_DOUBLE, ['1.0']);
       check(HighlightRegionType.LITERAL_INTEGER, ['2', '42']);
       check(HighlightRegionType.LITERAL_LIST, ['[]']);
-      check(HighlightRegionType.LITERAL_MAP, [
-        '{1.0: [].toList()}',
-        '{2: local}'
-      ]);
+      check(HighlightRegionType.LITERAL_MAP,
+          ['{1.0: [].toList()}', '{2: local}']);
       check(HighlightRegionType.LITERAL_STRING, ["'dart:async'", "'string'"]);
       check(HighlightRegionType.LOCAL_VARIABLE_DECLARATION, ['local']);
       check(HighlightRegionType.LOCAL_VARIABLE_REFERENCE, ['local']);
diff --git a/pkg/analysis_server/test/integration/analysis/lint_test.dart b/pkg/analysis_server/test/integration/analysis/lint_test.dart
new file mode 100644
index 0000000..e75120c
--- /dev/null
+++ b/pkg/analysis_server/test/integration/analysis/lint_test.dart
@@ -0,0 +1,65 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library test.integration.analysis.lint;
+
+import 'package:analysis_server/plugin/protocol/protocol.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);
+}
+
+@reflectiveTest
+class LintIntegrationTest extends AbstractAnalysisServerIntegrationTest {
+  test_no_lints_when_not_specified() async {
+    String source = sourcePath('test.dart');
+    writeFile(
+        source,
+        '''
+class abc { // lint: not CamelCase (should get ignored though)
+}''');
+    standardAnalysisSetup();
+
+    await analysisFinished;
+    expect(currentAnalysisErrors[source], isList);
+    // Should be empty without .analysis_options.
+    List<AnalysisError> errors = currentAnalysisErrors[source];
+    expect(errors, hasLength(0));
+  }
+
+  test_simple_lint() async {
+    writeFile(
+        sourcePath('.analysis_options'),
+        '''
+linter:
+  rules:
+    - camel_case_types
+''');
+
+    String source = sourcePath('test.dart');
+    writeFile(
+        source,
+        '''
+class a { // lint: not CamelCase
+}''');
+
+    standardAnalysisSetup();
+
+    await analysisFinished;
+
+    expect(currentAnalysisErrors[source], isList);
+    List<AnalysisError> errors = currentAnalysisErrors[source];
+    expect(errors, hasLength(1));
+    AnalysisError error = errors[0];
+    expect(error.location.file, source);
+    expect(error.severity, AnalysisErrorSeverity.INFO);
+    expect(error.type, AnalysisErrorType.LINT);
+  }
+}
diff --git a/pkg/analysis_server/test/integration/analysis/navigation_test.dart b/pkg/analysis_server/test/integration/analysis/navigation_test.dart
index c633811..35dd9e2 100644
--- a/pkg/analysis_server/test/integration/analysis/navigation_test.dart
+++ b/pkg/analysis_server/test/integration/analysis/navigation_test.dart
@@ -4,13 +4,15 @@
 
 library test.integration.analysis.navigation;
 
-import 'package:analysis_server/src/protocol.dart';
+import 'package:analysis_server/plugin/protocol/protocol.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);
 }
 
@@ -54,7 +56,9 @@
 ''';
     writeFile(pathname2, text2);
     standardAnalysisSetup();
-    sendAnalysisSetSubscriptions({AnalysisService.NAVIGATION: [pathname1]});
+    sendAnalysisSetSubscriptions({
+      AnalysisService.NAVIGATION: [pathname1]
+    });
     List<NavigationRegion> regions;
     List<NavigationTarget> targets;
     List<String> targetFiles;
@@ -101,10 +105,12 @@
       checkLocal('Class<int>', 'Class<TypeParameter>', ElementKind.CLASS);
       checkRemote(
           "'test2.dart';", r'test2.dart$', ElementKind.COMPILATION_UNIT);
-      checkLocal('Class<int>.constructor',
+      checkLocal(
+          'Class<int>.constructor',
           'constructor(); /* constructor declaration */',
           ElementKind.CONSTRUCTOR);
-      checkLocal('constructor(); // usage',
+      checkLocal(
+          'constructor(); // usage',
           'constructor(); /* constructor declaration */',
           ElementKind.CONSTRUCTOR);
       checkLocal('field;', 'field;', ElementKind.FIELD);
diff --git a/pkg/analysis_server/test/integration/analysis/occurrences_test.dart b/pkg/analysis_server/test/integration/analysis/occurrences_test.dart
index 5b084ec..1bcb270 100644
--- a/pkg/analysis_server/test/integration/analysis/occurrences_test.dart
+++ b/pkg/analysis_server/test/integration/analysis/occurrences_test.dart
@@ -4,13 +4,15 @@
 
 library test.integration.analysis.occurrences;
 
-import 'package:analysis_server/src/protocol.dart';
+import 'package:analysis_server/plugin/protocol/protocol.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);
 }
 
@@ -31,7 +33,9 @@
 ''';
     writeFile(pathname, text);
     standardAnalysisSetup();
-    sendAnalysisSetSubscriptions({AnalysisService.OCCURRENCES: [pathname]});
+    sendAnalysisSetSubscriptions({
+      AnalysisService.OCCURRENCES: [pathname]
+    });
     List<Occurrences> occurrences;
     onAnalysisOccurrences.listen((AnalysisOccurrencesParams params) {
       expect(params.file, equals(pathname));
diff --git a/pkg/analysis_server/test/integration/analysis/outline_test.dart b/pkg/analysis_server/test/integration/analysis/outline_test.dart
index 1369c3d..7d7d853 100644
--- a/pkg/analysis_server/test/integration/analysis/outline_test.dart
+++ b/pkg/analysis_server/test/integration/analysis/outline_test.dart
@@ -4,13 +4,15 @@
 
 library test.integration.analysis.outline;
 
-import 'package:analysis_server/src/protocol.dart';
+import 'package:analysis_server/plugin/protocol/protocol.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);
 }
 
@@ -53,7 +55,9 @@
 ''';
     writeFile(pathname, text);
     standardAnalysisSetup();
-    sendAnalysisSetSubscriptions({AnalysisService.OUTLINE: [pathname]});
+    sendAnalysisSetSubscriptions({
+      AnalysisService.OUTLINE: [pathname]
+    });
     Outline outline;
     onAnalysisOutline.listen((AnalysisOutlineParams params) {
       expect(params.file, equals(pathname));
diff --git a/pkg/analysis_server/test/integration/analysis/overrides_test.dart b/pkg/analysis_server/test/integration/analysis/overrides_test.dart
index 12872c2..e7b77dc 100644
--- a/pkg/analysis_server/test/integration/analysis/overrides_test.dart
+++ b/pkg/analysis_server/test/integration/analysis/overrides_test.dart
@@ -4,13 +4,15 @@
 
 library test.integration.analysis.overrides;
 
-import 'package:analysis_server/src/protocol.dart';
+import 'package:analysis_server/plugin/protocol/protocol.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);
 }
 
@@ -53,7 +55,9 @@
 ''';
     writeFile(pathname, text);
     standardAnalysisSetup();
-    sendAnalysisSetSubscriptions({AnalysisService.OVERRIDES: [pathname]});
+    sendAnalysisSetSubscriptions({
+      AnalysisService.OVERRIDES: [pathname]
+    });
     List<Override> overrides;
     onAnalysisOverrides.listen((AnalysisOverridesParams params) {
       expect(params.file, equals(pathname));
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 bafba77..7ce03d2 100644
--- a/pkg/analysis_server/test/integration/analysis/package_root_test.dart
+++ b/pkg/analysis_server/test/integration/analysis/package_root_test.dart
@@ -4,14 +4,16 @@
 
 library test.integration.analysis.packageRoot;
 
-import 'package:analysis_server/src/protocol.dart';
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:path/path.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);
 }
 
@@ -39,7 +41,9 @@
     writeFile(mainPath, mainText);
     String normalizedFooBarPath = writeFile(fooBarPath, fooBarText);
     sendServerSetSubscriptions([ServerService.STATUS]);
-    sendAnalysisSetSubscriptions({AnalysisService.NAVIGATION: [mainPath]});
+    sendAnalysisSetSubscriptions({
+      AnalysisService.NAVIGATION: [mainPath]
+    });
     List<NavigationRegion> navigationRegions;
     List<NavigationTarget> navigationTargets;
     List<String> navigationTargetFiles;
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 806b82c..443bab1 100644
--- a/pkg/analysis_server/test/integration/analysis/reanalyze_concurrent_test.dart
+++ b/pkg/analysis_server/test/integration/analysis/reanalyze_concurrent_test.dart
@@ -14,9 +14,11 @@
 
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 
+import '../../utils.dart';
 import '../integration_tests.dart';
 
 main() {
+  initializeTestEnvironment();
   defineReflectiveTests(Test);
 }
 
diff --git a/pkg/analysis_server/test/integration/analysis/reanalyze_test.dart b/pkg/analysis_server/test/integration/analysis/reanalyze_test.dart
index 79aee38..df1250b 100644
--- a/pkg/analysis_server/test/integration/analysis/reanalyze_test.dart
+++ b/pkg/analysis_server/test/integration/analysis/reanalyze_test.dart
@@ -4,13 +4,15 @@
 
 library test.integration.analysis.reanalyze;
 
-import 'package:analysis_server/src/protocol.dart';
+import 'package:analysis_server/plugin/protocol/protocol.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);
 }
 
diff --git a/pkg/analysis_server/test/integration/analysis/test_all.dart b/pkg/analysis_server/test/integration/analysis/test_all.dart
index 8b820e0..1952f20 100644
--- a/pkg/analysis_server/test/integration/analysis/test_all.dart
+++ b/pkg/analysis_server/test/integration/analysis/test_all.dart
@@ -6,6 +6,8 @@
 
 import 'package:unittest/unittest.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;
 import 'get_errors_before_analysis_test.dart'
@@ -13,6 +15,7 @@
 import 'get_hover_test.dart' as get_hover_test;
 import 'highlights_test.dart' as highlights_test;
 import 'highlights_test2.dart' as highlights_test2;
+import 'lint_test.dart' as lint_test;
 import 'navigation_test.dart' as navigation_test;
 import 'occurrences_test.dart' as occurrences_test;
 import 'outline_test.dart' as outline_test;
@@ -27,14 +30,16 @@
  * Utility for manually running all integration tests.
  */
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   group('analysis', () {
+    analysis_options_test.main();
     error_test.main();
     get_errors_after_analysis_test.main();
     get_errors_before_analysis_test.main();
     get_hover_test.main();
     highlights_test.main();
     highlights_test2.main();
+    lint_test.main();
     navigation_test.main();
     occurrences_test.main();
     outline_test.main();
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 6bf7cd3..3eb72ff 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
@@ -4,13 +4,15 @@
 
 library test.integration.analysis.update.content.list;
 
-import 'package:analysis_server/src/protocol.dart';
+import 'package:analysis_server/plugin/protocol/protocol.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);
 }
 
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 18da8a6..6ea46cf 100644
--- a/pkg/analysis_server/test/integration/analysis/update_content_test.dart
+++ b/pkg/analysis_server/test/integration/analysis/update_content_test.dart
@@ -4,13 +4,15 @@
 
 library test.integration.analysis.update.content;
 
-import 'package:analysis_server/src/protocol.dart';
+import 'package:analysis_server/plugin/protocol/protocol.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);
 }
 
diff --git a/pkg/analysis_server/test/integration/asynchrony_test.dart b/pkg/analysis_server/test/integration/asynchrony_test.dart
deleted file mode 100644
index 79852cb..0000000
--- a/pkg/analysis_server/test/integration/asynchrony_test.dart
+++ /dev/null
@@ -1,78 +0,0 @@
-// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library test.integration.analysis.error;
-
-import 'dart:async';
-
-import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
-
-import 'integration_tests.dart';
-
-main() {
-//  defineReflectiveTests(AsynchronyIntegrationTest);
-}
-
-/**
- * Verify that the server's input and output streams are asynchronous by
- * attempting to flood its input buffer with commands without listening to
- * its output buffer for responses.  The server should continue to train its
- * input buffer even though its output buffer is full.
- *
- * Once enough commands have been sent, we begin reading from the server's
- * output buffer, and verify that it responds to the last command.
- *
- * NB.
- *
- * This test was intentionally disabled, because after r43123 server
- * writes to stdout synchronously. So, now it is the client's responsibility
- * to read stdout in a timely manner to avoid blocking the server.
- */
-@reflectiveTest
-class AsynchronyIntegrationTest {
-  /**
-   * Number of messages to queue up before listening for responses.
-   */
-  static const MESSAGE_COUNT = 10000;
-
-  /**
-   * Connection to the analysis server.
-   */
-  final Server server = new Server();
-
-  Future setUp() {
-    return server.start();
-  }
-
-  test_asynchrony() {
-    // Send MESSAGE_COUNT messages to the server without listening for
-    // responses.
-    Future lastMessageResult;
-    for (int i = 0; i < MESSAGE_COUNT; i++) {
-      lastMessageResult = server.send('server.getVersion', null);
-    }
-
-    // Flush the server's standard input stream to verify that it has really
-    // received them all.  If the server is blocked waiting for us to read
-    // its responses, the flush will never complete.
-    return server.flushCommands().then((_) {
-
-      // Begin processing responses from the server.
-      server.listenToOutput((String event, params) {
-        // The only expected notification is server.connected.
-        if (event != 'server.connected') {
-          fail('Unexpected notification: $event');
-        }
-      });
-
-      // Terminate the test when the response to the last message is received.
-      return lastMessageResult.then((_) {
-        server.send("server.shutdown", null).then((_) {
-          return server.exitCode;
-        });
-      });
-    });
-  }
-}
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 12687e4..a318ea2 100644
--- a/pkg/analysis_server/test/integration/completion/get_suggestions_test.dart
+++ b/pkg/analysis_server/test/integration/completion/get_suggestions_test.dart
@@ -4,13 +4,15 @@
 
 library test.integration.completion.get.suggestions;
 
-import 'package:analysis_server/src/protocol.dart';
+import 'package:analysis_server/plugin/protocol/protocol.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);
 }
 
@@ -32,7 +34,9 @@
   }
 
   test_getSuggestions() async {
-    setTestSource('test.dart', r'''
+    setTestSource(
+        'test.dart',
+        r'''
 String test = '';
 main() {
   test.^
@@ -54,7 +58,9 @@
   }
 
   test_getSuggestions_onlyOverlay() async {
-    setTestSource('test.dart', r'''
+    setTestSource(
+        'test.dart',
+        r'''
 String test = '';
 main() {
   test.^
@@ -78,7 +84,9 @@
   }
 
   test_getSuggestions_onlyOverlay_noWait() async {
-    setTestSource('test.dart', r'''
+    setTestSource(
+        'test.dart',
+        r'''
 String test = '';
 main() {
   test.^
diff --git a/pkg/analysis_server/test/integration/completion/test_all.dart b/pkg/analysis_server/test/integration/completion/test_all.dart
index dc3e046..aae07f3 100644
--- a/pkg/analysis_server/test/integration/completion/test_all.dart
+++ b/pkg/analysis_server/test/integration/completion/test_all.dart
@@ -6,13 +6,14 @@
 
 import 'package:unittest/unittest.dart';
 
+import '../../utils.dart';
 import 'get_suggestions_test.dart' as get_suggestions_test;
 
 /**
  * Utility for manually running all integration tests.
  */
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   group('completion', () {
     get_suggestions_test.main();
   });
diff --git a/pkg/analysis_server/test/integration/integration_test_methods.dart b/pkg/analysis_server/test/integration/integration_test_methods.dart
index 8f3915e..bfe19dd 100644
--- a/pkg/analysis_server/test/integration/integration_test_methods.dart
+++ b/pkg/analysis_server/test/integration/integration_test_methods.dart
@@ -13,7 +13,8 @@
 
 import 'dart:async';
 
-import 'package:analysis_server/src/protocol.dart';
+import 'package:analysis_server/plugin/protocol/protocol.dart';
+import 'package:analysis_server/src/protocol/protocol_internal.dart';
 import 'package:unittest/unittest.dart';
 
 import 'integration_tests.dart';
@@ -689,6 +690,35 @@
   StreamController<AnalysisHighlightsParams> _onAnalysisHighlights;
 
   /**
+   * Reports the classes that are implemented or extended and class members
+   * that are implemented or overridden in a file.
+   *
+   * This notification is not subscribed to by default. Clients can subscribe
+   * by including the value "IMPLEMENTED" in the list of services passed in an
+   * analysis.setSubscriptions request.
+   *
+   * Parameters
+   *
+   * file ( FilePath )
+   *
+   *   The file with which the implementations are associated.
+   *
+   * classes ( List<ImplementedClass> )
+   *
+   *   The classes defined in the file that are implemented or extended.
+   *
+   * members ( List<ImplementedMember> )
+   *
+   *   The member defined in the file that are implemented or overridden.
+   */
+  Stream<AnalysisImplementedParams> onAnalysisImplemented;
+
+  /**
+   * Stream controller for [onAnalysisImplemented].
+   */
+  StreamController<AnalysisImplementedParams> _onAnalysisImplemented;
+
+  /**
    * Reports that the navigation information associated with a region of a
    * single file has become invalid and should be re-requested.
    *
@@ -800,6 +830,18 @@
    *
    *   The file with which the outline is associated.
    *
+   * kind ( FileKind )
+   *
+   *   The kind of the file.
+   *
+   * libraryName ( optional String )
+   *
+   *   The name of the library defined by the file using a "library" directive,
+   *   or referenced by a "part of" directive. If both "library" and "part of"
+   *   directives are present, then the "library" directive takes precedence.
+   *   This field will be omitted if the file has neither "library" nor "part
+   *   of" directives.
+   *
    * outline ( Outline )
    *
    *   The outline associated with the file.
@@ -812,7 +854,7 @@
   StreamController<AnalysisOutlineParams> _onAnalysisOutline;
 
   /**
-   * Reports the overridding members in a file.
+   * Reports the overriding members in a file.
    *
    * This notification is not subscribed to by default. Clients can subscribe
    * by including the value "OVERRIDES" in the list of services passed in an
@@ -1062,6 +1104,11 @@
    *
    *   The offset of the name of the type within the file.
    *
+   * superOnly ( optional bool )
+   *
+   *   True if the client is only requesting superclasses and interfaces
+   *   hierarchy.
+   *
    * Returns
    *
    * hierarchyItems ( optional List<TypeHierarchyItem> )
@@ -1076,8 +1123,8 @@
    *   not represent a type, or if the file has not been sufficiently analyzed
    *   to allow a type hierarchy to be produced.
    */
-  Future<SearchGetTypeHierarchyResult> sendSearchGetTypeHierarchy(String file, int offset) {
-    var params = new SearchGetTypeHierarchyParams(file, offset).toJson();
+  Future<SearchGetTypeHierarchyResult> sendSearchGetTypeHierarchy(String file, int offset, {bool superOnly}) {
+    var params = new SearchGetTypeHierarchyParams(file, offset, superOnly: superOnly).toJson();
     return server.send("search.getTypeHierarchy", params)
         .then((result) {
       ResponseDecoder decoder = new ResponseDecoder(null);
@@ -1398,7 +1445,7 @@
    *
    * If directives of the Dart file cannot be organized, for example because it
    * has scan or parse errors, or by other reasons, ORGANIZE_DIRECTIVES_ERROR
-   * will be generated. The message will provide datails about the reason.
+   * will be generated. The message will provide details about the reason.
    *
    * Parameters
    *
@@ -1602,6 +1649,8 @@
     onAnalysisFolding = _onAnalysisFolding.stream.asBroadcastStream();
     _onAnalysisHighlights = new StreamController<AnalysisHighlightsParams>(sync: true);
     onAnalysisHighlights = _onAnalysisHighlights.stream.asBroadcastStream();
+    _onAnalysisImplemented = new StreamController<AnalysisImplementedParams>(sync: true);
+    onAnalysisImplemented = _onAnalysisImplemented.stream.asBroadcastStream();
     _onAnalysisInvalidate = new StreamController<AnalysisInvalidateParams>(sync: true);
     onAnalysisInvalidate = _onAnalysisInvalidate.stream.asBroadcastStream();
     _onAnalysisNavigation = new StreamController<AnalysisNavigationParams>(sync: true);
@@ -1659,6 +1708,10 @@
         expect(params, isAnalysisHighlightsParams);
         _onAnalysisHighlights.add(new AnalysisHighlightsParams.fromJson(decoder, 'params', params));
         break;
+      case "analysis.implemented":
+        expect(params, isAnalysisImplementedParams);
+        _onAnalysisImplemented.add(new AnalysisImplementedParams.fromJson(decoder, 'params', params));
+        break;
       case "analysis.invalidate":
         expect(params, isAnalysisInvalidateParams);
         _onAnalysisInvalidate.add(new AnalysisInvalidateParams.fromJson(decoder, 'params', params));
diff --git a/pkg/analysis_server/test/integration/integration_tests.dart b/pkg/analysis_server/test/integration/integration_tests.dart
index 3345554..5004f86 100644
--- a/pkg/analysis_server/test/integration/integration_tests.dart
+++ b/pkg/analysis_server/test/integration/integration_tests.dart
@@ -9,14 +9,14 @@
 import 'dart:convert';
 import 'dart:io';
 
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/constants.dart';
-import 'package:analysis_server/src/protocol.dart';
+import 'package:analysis_server/src/server/driver.dart' as analysisServer;
 import 'package:path/path.dart';
 import 'package:unittest/unittest.dart';
 
 import 'integration_test_methods.dart';
 import 'protocol_matchers.dart';
-import 'package:analysis_server/src/server/driver.dart' as analysisServer;
 
 const Matcher isBool = const isInstanceOf<bool>('bool');
 
@@ -28,11 +28,11 @@
 
 const Matcher isObject = isMap;
 
+const Matcher isString = const isInstanceOf<String>('String');
+
 final Matcher isResponse = new MatchesJsonObject('response', {'id': isString},
     optionalFields: {'result': anything, 'error': isRequestError});
 
-const Matcher isString = const isInstanceOf<String>('String');
-
 Matcher isListOf(Matcher elementMatcher) => new _ListOf(elementMatcher);
 
 Matcher isMapOf(Matcher keyMatcher, Matcher valueMatcher) =>
@@ -165,6 +165,21 @@
   }
 
   /**
+   * If [skipShutdown] is not set, shut down the server.
+   */
+  Future shutdownIfNeeded() {
+    if (skipShutdown) {
+      return new Future.value();
+    }
+    // Give the server a short time to comply with the shutdown request; if it
+    // doesn't exit, then forcibly terminate it.
+    sendServerShutdown();
+    return server.exitCode.timeout(SHUTDOWN_TIMEOUT, onTimeout: () {
+      return server.kill();
+    });
+  }
+
+  /**
    * Convert the given [relativePath] to an absolute path, by interpreting it
    * relative to [sourceDirectory].  On Windows any forward slashes in
    * [relativePath] are converted to backslashes.
@@ -197,7 +212,7 @@
    * After every test, the server is stopped and [sourceDirectory] is deleted.
    */
   Future tearDown() {
-    return _shutdownIfNeeded().then((_) {
+    return shutdownIfNeeded().then((_) {
       sourceDirectory.deleteSync(recursive: true);
     });
   }
@@ -218,21 +233,6 @@
     file.writeAsStringSync(contents);
     return file.resolveSymbolicLinksSync();
   }
-
-  /**
-   * If [skipShutdown] is not set, shut down the server.
-   */
-  Future _shutdownIfNeeded() {
-    if (skipShutdown) {
-      return new Future.value();
-    }
-    // Give the server a short time to comply with the shutdown request; if it
-    // doesn't exit, then forcibly terminate it.
-    sendServerShutdown();
-    return server.exitCode.timeout(SHUTDOWN_TIMEOUT, onTimeout: () {
-      return server.kill();
-    });
-  }
 }
 
 /**
@@ -349,8 +349,8 @@
     if (requiredFields != null) {
       requiredFields.forEach((String key, Matcher valueMatcher) {
         if (!item.containsKey(key)) {
-          mismatches.add(
-              (Description mismatchDescription) => mismatchDescription
+          mismatches.add((Description mismatchDescription) =>
+              mismatchDescription
                   .add('is missing field ')
                   .addDescriptionOf(key)
                   .add(' (')
@@ -381,7 +381,10 @@
    */
   void _checkField(String key, value, Matcher valueMatcher,
       List<MismatchDescriber> mismatches) {
-    checkSubstructure(value, valueMatcher, mismatches,
+    checkSubstructure(
+        value,
+        valueMatcher,
+        mismatches,
         (Description description) =>
             description.add('field ').addDescriptionOf(key));
   }
@@ -590,8 +593,11 @@
    * `true`, the server will be started with "--observe" and
    * "--pause-isolates-on-exit", allowing the observatory to be used.
    */
-  Future start({bool debugServer: false, int diagnosticPort,
-      bool profileServer: false, bool newTaskModel: false,
+  Future start(
+      {bool debugServer: false,
+      int diagnosticPort,
+      bool profileServer: false,
+      bool newTaskModel: true,
       bool useAnalysisHighlight2: false}) {
     if (_process != null) {
       throw new Exception('Process already started');
@@ -621,9 +627,11 @@
     if (useAnalysisHighlight2) {
       arguments.add('--useAnalysisHighlight2');
     }
-    if (newTaskModel) {
-      arguments.add('--${analysisServer.Driver.ENABLE_NEW_TASK_MODEL}');
+    if (!newTaskModel) {
+      arguments.add('--${analysisServer.Driver.DISABLE_NEW_TASK_MODEL}');
     }
+//    print('Launching $serverPath');
+//    print('$dartBinary ${arguments.join(' ')}');
     return Process.start(dartBinary, arguments).then((Process process) {
       _process = process;
       process.exitCode.then((int code) {
@@ -696,8 +704,8 @@
   Description describeMismatch(
       item, Description mismatchDescription, Map matchState, bool verbose) {
     if (item is! List) {
-      return super.describeMismatch(
-          item, mismatchDescription, matchState, verbose);
+      return super
+          .describeMismatch(item, mismatchDescription, matchState, verbose);
     } else {
       return iterableMatcher.describeMismatch(
           item, mismatchDescription, matchState, verbose);
@@ -744,10 +752,16 @@
       return;
     }
     item.forEach((key, value) {
-      checkSubstructure(key, keyMatcher, mismatches,
+      checkSubstructure(
+          key,
+          keyMatcher,
+          mismatches,
           (Description description) =>
               description.add('key ').addDescriptionOf(key));
-      checkSubstructure(value, valueMatcher, mismatches,
+      checkSubstructure(
+          value,
+          valueMatcher,
+          mismatches,
           (Description description) =>
               description.add('field ').addDescriptionOf(key));
     });
@@ -850,8 +864,8 @@
       }
       return mismatchDescription;
     } else {
-      return super.describeMismatch(
-          item, mismatchDescription, matchState, verbose);
+      return super
+          .describeMismatch(item, mismatchDescription, matchState, verbose);
     }
   }
 
@@ -878,6 +892,6 @@
    */
   MismatchDescriber simpleDescription(String description) =>
       (Description mismatchDescription) {
-    mismatchDescription.add(description);
-  };
+        mismatchDescription.add(description);
+      };
 }
diff --git a/pkg/analysis_server/test/integration/protocol_matchers.dart b/pkg/analysis_server/test/integration/protocol_matchers.dart
index 24cc21e..6d0ec42 100644
--- a/pkg/analysis_server/test/integration/protocol_matchers.dart
+++ b/pkg/analysis_server/test/integration/protocol_matchers.dart
@@ -398,6 +398,22 @@
   }));
 
 /**
+ * analysis.implemented params
+ *
+ * {
+ *   "file": FilePath
+ *   "classes": List<ImplementedClass>
+ *   "members": List<ImplementedMember>
+ * }
+ */
+final Matcher isAnalysisImplementedParams = new LazyMatcher(() => new MatchesJsonObject(
+  "analysis.implemented params", {
+    "file": isFilePath,
+    "classes": isListOf(isImplementedClass),
+    "members": isListOf(isImplementedMember)
+  }));
+
+/**
  * analysis.invalidate params
  *
  * {
@@ -452,13 +468,18 @@
  *
  * {
  *   "file": FilePath
+ *   "kind": FileKind
+ *   "libraryName": optional String
  *   "outline": Outline
  * }
  */
 final Matcher isAnalysisOutlineParams = new LazyMatcher(() => new MatchesJsonObject(
   "analysis.outline params", {
     "file": isFilePath,
+    "kind": isFileKind,
     "outline": isOutline
+  }, optionalFields: {
+    "libraryName": isString
   }));
 
 /**
@@ -629,12 +650,15 @@
  * {
  *   "file": FilePath
  *   "offset": int
+ *   "superOnly": optional bool
  * }
  */
 final Matcher isSearchGetTypeHierarchyParams = new LazyMatcher(() => new MatchesJsonObject(
   "search.getTypeHierarchy params", {
     "file": isFilePath,
     "offset": isInt
+  }, optionalFields: {
+    "superOnly": isBool
   }));
 
 /**
@@ -1005,6 +1029,7 @@
  *   "location": Location
  *   "message": String
  *   "correction": optional String
+ *   "hasFix": optional bool
  * }
  */
 final Matcher isAnalysisError = new LazyMatcher(() => new MatchesJsonObject(
@@ -1014,7 +1039,8 @@
     "location": isLocation,
     "message": isString
   }, optionalFields: {
-    "correction": isString
+    "correction": isString,
+    "hasFix": isBool
   }));
 
 /**
@@ -1079,6 +1105,7 @@
  *   "enableDeferredLoading": optional bool
  *   "enableEnums": optional bool
  *   "enableNullAwareOperators": optional bool
+ *   "enableSuperMixins": optional bool
  *   "generateDart2jsHints": optional bool
  *   "generateHints": optional bool
  *   "generateLints": optional bool
@@ -1090,6 +1117,7 @@
     "enableDeferredLoading": isBool,
     "enableEnums": isBool,
     "enableNullAwareOperators": isBool,
+    "enableSuperMixins": isBool,
     "generateDart2jsHints": isBool,
     "generateHints": isBool,
     "generateLints": isBool
@@ -1101,6 +1129,7 @@
  * enum {
  *   FOLDING
  *   HIGHLIGHTS
+ *   IMPLEMENTED
  *   INVALIDATE
  *   NAVIGATION
  *   OCCURRENCES
@@ -1111,6 +1140,7 @@
 final Matcher isAnalysisService = new MatchesEnum("AnalysisService", [
   "FOLDING",
   "HIGHLIGHTS",
+  "IMPLEMENTED",
   "INVALIDATE",
   "NAVIGATION",
   "OCCURRENCES",
@@ -1264,6 +1294,7 @@
  *   ENUM
  *   ENUM_CONSTANT
  *   FIELD
+ *   FILE
  *   FUNCTION
  *   FUNCTION_TYPE_ALIAS
  *   GETTER
@@ -1289,6 +1320,7 @@
   "ENUM",
   "ENUM_CONSTANT",
   "FIELD",
+  "FILE",
   "FUNCTION",
   "FUNCTION_TYPE_ALIAS",
   "GETTER",
@@ -1356,6 +1388,19 @@
 ]);
 
 /**
+ * FileKind
+ *
+ * enum {
+ *   LIBRARY
+ *   PART
+ * }
+ */
+final Matcher isFileKind = new MatchesEnum("FileKind", [
+  "LIBRARY",
+  "PART"
+]);
+
+/**
  * FilePath
  *
  * String
@@ -1613,6 +1658,34 @@
   }));
 
 /**
+ * ImplementedClass
+ *
+ * {
+ *   "offset": int
+ *   "length": int
+ * }
+ */
+final Matcher isImplementedClass = new LazyMatcher(() => new MatchesJsonObject(
+  "ImplementedClass", {
+    "offset": isInt,
+    "length": isInt
+  }));
+
+/**
+ * ImplementedMember
+ *
+ * {
+ *   "offset": int
+ *   "length": int
+ * }
+ */
+final Matcher isImplementedMember = new LazyMatcher(() => new MatchesJsonObject(
+  "ImplementedMember", {
+    "offset": isInt,
+    "length": isInt
+  }));
+
+/**
  * LinkedEditGroup
  *
  * {
@@ -2170,6 +2243,8 @@
  * extractLocalVariable feedback
  *
  * {
+ *   "coveringExpressionOffsets": List<int>
+ *   "coveringExpressionLengths": List<int>
  *   "names": List<String>
  *   "offsets": List<int>
  *   "lengths": List<int>
@@ -2177,6 +2252,8 @@
  */
 final Matcher isExtractLocalVariableFeedback = new LazyMatcher(() => new MatchesJsonObject(
   "extractLocalVariable feedback", {
+    "coveringExpressionOffsets": isListOf(isInt),
+    "coveringExpressionLengths": isListOf(isInt),
     "names": isListOf(isString),
     "offsets": isListOf(isInt),
     "lengths": isListOf(isInt)
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 fdab854..a4ab04e 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
@@ -6,13 +6,15 @@
 
 import 'dart:async';
 
-import 'package:analysis_server/src/protocol.dart';
+import 'package:analysis_server/plugin/protocol/protocol.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);
 }
 
diff --git a/pkg/analysis_server/test/integration/search/test_all.dart b/pkg/analysis_server/test/integration/search/test_all.dart
index e3c4459..7c58783 100644
--- a/pkg/analysis_server/test/integration/search/test_all.dart
+++ b/pkg/analysis_server/test/integration/search/test_all.dart
@@ -6,13 +6,14 @@
 
 import 'package:unittest/unittest.dart';
 
+import '../../utils.dart';
 import 'get_type_hierarchy_test.dart' as get_type_hierarchy_test;
 
 /**
  * Utility for manually running all integration tests.
  */
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   group('search', () {
     get_type_hierarchy_test.main();
   });
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 7f7b529..d1ba458 100644
--- a/pkg/analysis_server/test/integration/server/get_version_test.dart
+++ b/pkg/analysis_server/test/integration/server/get_version_test.dart
@@ -6,9 +6,11 @@
 
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 
+import '../../utils.dart';
 import '../integration_tests.dart';
 
 main() {
+  initializeTestEnvironment();
   defineReflectiveTests(Test);
 }
 
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 bcf15db..af778cf 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
@@ -7,9 +7,11 @@
 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);
 }
 
@@ -18,9 +20,9 @@
   test_setSubscriptions_invalidService() {
     // TODO(paulberry): verify that if an invalid service is specified, the
     // current subscriptions are unchanged.
-    return server
-        .send("server.setSubscriptions", {'subscriptions': ['bogus']})
-        .then((_) {
+    return server.send("server.setSubscriptions", {
+      'subscriptions': ['bogus']
+    }).then((_) {
       fail('setSubscriptions should have produced an error');
     }, onError: (error) {
       // The expected error occurred.
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 517445b..e649594 100644
--- a/pkg/analysis_server/test/integration/server/set_subscriptions_test.dart
+++ b/pkg/analysis_server/test/integration/server/set_subscriptions_test.dart
@@ -6,13 +6,15 @@
 
 import 'dart:async';
 
-import 'package:analysis_server/src/protocol.dart';
+import 'package:analysis_server/plugin/protocol/protocol.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);
 }
 
@@ -31,7 +33,9 @@
     });
     return sendServerSetSubscriptions([]).then((_) {
       String pathname = sourcePath('test.dart');
-      writeFile(pathname, '''
+      writeFile(
+          pathname,
+          '''
 main() {
   var x;
 }''');
@@ -42,7 +46,9 @@
         expect(statusReceived, isFalse);
         return sendServerSetSubscriptions([ServerService.STATUS]).then((_) {
           // Tickle test.dart just in case analysis has already completed.
-          writeFile(pathname, '''
+          writeFile(
+              pathname,
+              '''
 main() {
   var y;
 }''');
diff --git a/pkg/analysis_server/test/integration/server/shutdown_test.dart b/pkg/analysis_server/test/integration/server/shutdown_test.dart
index 7a5de26..7ba89c7 100644
--- a/pkg/analysis_server/test/integration/server/shutdown_test.dart
+++ b/pkg/analysis_server/test/integration/server/shutdown_test.dart
@@ -9,9 +9,11 @@
 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);
 }
 
diff --git a/pkg/analysis_server/test/integration/server/status_test.dart b/pkg/analysis_server/test/integration/server/status_test.dart
index c386b88..340a4b5 100644
--- a/pkg/analysis_server/test/integration/server/status_test.dart
+++ b/pkg/analysis_server/test/integration/server/status_test.dart
@@ -6,13 +6,15 @@
 
 import 'dart:async';
 
-import 'package:analysis_server/src/protocol.dart';
+import 'package:analysis_server/plugin/protocol/protocol.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);
 }
 
@@ -35,7 +37,9 @@
         }
       }
     });
-    writeFile(sourcePath('test.dart'), '''
+    writeFile(
+        sourcePath('test.dart'),
+        '''
 main() {
   var x;
 }''');
diff --git a/pkg/analysis_server/test/integration/server/test_all.dart b/pkg/analysis_server/test/integration/server/test_all.dart
index 499814e..2b81672 100644
--- a/pkg/analysis_server/test/integration/server/test_all.dart
+++ b/pkg/analysis_server/test/integration/server/test_all.dart
@@ -6,6 +6,7 @@
 
 import 'package:unittest/unittest.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;
@@ -17,7 +18,7 @@
  * Utility for manually running all integration tests.
  */
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   group('server', () {
     get_version_test.main();
     set_subscriptions_test.main();
diff --git a/pkg/analysis_server/test/integration/test_all.dart b/pkg/analysis_server/test/integration/test_all.dart
index 54d3fb2..e217c92 100644
--- a/pkg/analysis_server/test/integration/test_all.dart
+++ b/pkg/analysis_server/test/integration/test_all.dart
@@ -6,8 +6,8 @@
 
 import 'package:unittest/unittest.dart';
 
+import '../utils.dart';
 import 'analysis/test_all.dart' as analysis_test_all;
-import 'asynchrony_test.dart' as asynchrony_test;
 import 'completion/test_all.dart' as completion_test_all;
 import 'search/test_all.dart' as search_test_all;
 import 'server/test_all.dart' as server_test_all;
@@ -16,10 +16,9 @@
  * Utility for manually running all integration tests.
  */
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   group('analysis_server_integration', () {
     analysis_test_all.main();
-    asynchrony_test.main();
     completion_test_all.main();
     search_test_all.main();
     server_test_all.main();
diff --git a/pkg/analysis_server/test/mock_sdk.dart b/pkg/analysis_server/test/mock_sdk.dart
index 78ee244..99be8fc 100644
--- a/pkg/analysis_server/test/mock_sdk.dart
+++ b/pkg/analysis_server/test/mock_sdk.dart
@@ -12,8 +12,10 @@
 import 'package:analyzer/src/generated/source.dart';
 
 class MockSdk implements DartSdk {
-  static const _MockSdkLibrary LIB_CORE = const _MockSdkLibrary('dart:core',
-      '/lib/core/core.dart', '''
+  static const _MockSdkLibrary LIB_CORE = const _MockSdkLibrary(
+      'dart:core',
+      '/lib/core/core.dart',
+      '''
 library dart.core;
 
 import 'dart:async';
@@ -95,6 +97,7 @@
 }
 
 abstract class Map<K, V> extends Object {
+  bool containsKey(Object key);
   Iterable<K> get keys;
 }
 
@@ -112,8 +115,10 @@
 }
 ''');
 
-  static const _MockSdkLibrary LIB_ASYNC = const _MockSdkLibrary('dart:async',
-      '/lib/async/async.dart', '''
+  static const _MockSdkLibrary LIB_ASYNC = const _MockSdkLibrary(
+      'dart:async',
+      '/lib/async/async.dart',
+      '''
 library dart.async;
 
 import 'dart:math';
@@ -130,14 +135,18 @@
 ''');
 
   static const _MockSdkLibrary LIB_COLLECTION = const _MockSdkLibrary(
-      'dart:collection', '/lib/collection/collection.dart', '''
+      'dart:collection',
+      '/lib/collection/collection.dart',
+      '''
 library dart.collection;
 
 abstract class HashMap<K, V> implements Map<K, V> {}
 ''');
 
   static const _MockSdkLibrary LIB_CONVERT = const _MockSdkLibrary(
-      'dart:convert', '/lib/convert/convert.dart', '''
+      'dart:convert',
+      '/lib/convert/convert.dart',
+      '''
 library dart.convert;
 
 import 'dart:async';
@@ -146,8 +155,10 @@
 class JsonDecoder extends Converter<String, Object> {}
 ''');
 
-  static const _MockSdkLibrary LIB_MATH = const _MockSdkLibrary('dart:math',
-      '/lib/math/math.dart', '''
+  static const _MockSdkLibrary LIB_MATH = const _MockSdkLibrary(
+      'dart:math',
+      '/lib/math/math.dart',
+      '''
 library dart.math;
 const double E = 2.718281828459045;
 const double PI = 3.1415926535897932;
@@ -165,14 +176,18 @@
 }
 ''');
 
-  static const _MockSdkLibrary LIB_HTML = const _MockSdkLibrary('dart:html',
-      '/lib/html/dartium/html_dartium.dart', '''
+  static const _MockSdkLibrary LIB_HTML = const _MockSdkLibrary(
+      'dart:html',
+      '/lib/html/dartium/html_dartium.dart',
+      '''
 library dart.html;
 class HtmlElement {}
 ''');
 
   static const _MockSdkLibrary LIB_INTERNAL = const _MockSdkLibrary(
-      'dart:_internal', '/lib/internal/internal.dart', '''
+      'dart:_internal',
+      '/lib/internal/internal.dart',
+      '''
 library dart._internal;
 external void printToConsole(String line);
 ''');
diff --git a/pkg/analysis_server/test/mocks.dart b/pkg/analysis_server/test/mocks.dart
index 3358b47..428f53b 100644
--- a/pkg/analysis_server/test/mocks.dart
+++ b/pkg/analysis_server/test/mocks.dart
@@ -9,11 +9,12 @@
 @MirrorsUsed(targets: 'mocks', override: '*')
 import 'dart:mirrors';
 
+import 'package:analysis_server/plugin/protocol/protocol.dart'
+    hide Element, ElementKind;
 import 'package:analysis_server/src/analysis_server.dart';
 import 'package:analysis_server/src/channel/channel.dart';
 import 'package:analysis_server/src/operation/operation.dart';
 import 'package:analysis_server/src/operation/operation_analysis.dart';
-import 'package:analysis_server/src/protocol.dart' hide Element, ElementKind;
 import 'package:analyzer/file_system/file_system.dart' as resource;
 import 'package:analyzer/file_system/memory_file_system.dart' as resource;
 import 'package:analyzer/source/package_map_provider.dart';
@@ -58,7 +59,7 @@
  * 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 = 500]) {
+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
@@ -229,8 +230,8 @@
   @override
   void listen(void onRequest(Request request),
       {Function onError, void onDone()}) {
-    requestController.stream.listen(onRequest,
-        onError: onError, onDone: onDone);
+    requestController.stream
+        .listen(onRequest, onError: onError, onDone: onDone);
   }
 
   @override
@@ -330,8 +331,8 @@
       controller.close().then((_) => twin.controller.close());
 
   StreamSubscription<T> listen(void onData(T event),
-      {Function onError, void onDone(), bool cancelOnError}) => stream.listen(
-          onData,
+          {Function onError, void onDone(), bool cancelOnError}) =>
+      stream.listen(onData,
           onError: onError, onDone: onDone, cancelOnError: cancelOnError);
 
   noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
diff --git a/pkg/analysis_server/test/operation/operation_queue_test.dart b/pkg/analysis_server/test/operation/operation_queue_test.dart
index 47f0bcf..ed7fbca 100644
--- a/pkg/analysis_server/test/operation/operation_queue_test.dart
+++ b/pkg/analysis_server/test/operation/operation_queue_test.dart
@@ -18,9 +18,10 @@
 import 'package:unittest/unittest.dart';
 
 import '../mocks.dart';
+import '../utils.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(ServerOperationQueueTest);
 }
 
@@ -59,6 +60,23 @@
 class ServerOperationQueueTest {
   ServerOperationQueue queue = new ServerOperationQueue();
 
+  void test_add_withMerge() {
+    var opA = new _MergeableOperationMock();
+    var opB = new _MergeableOperationMock();
+    var opC = new _MergeableOperationMock();
+    when(opA.merge(opC)).thenReturn(true);
+    when(opA.merge(anyObject)).thenReturn(false);
+    when(opB.merge(anyObject)).thenReturn(false);
+    when(opC.merge(anyObject)).thenReturn(false);
+    queue.add(opA);
+    queue.add(opB);
+    queue.add(opC);
+    expect(queue.take(), same(opA));
+    expect(queue.take(), same(opB));
+    // no opC, it was merged into opA
+    expect(queue.isEmpty, isTrue);
+  }
+
   void test_clear() {
     var operationA = mockOperation(ServerOperationPriority.ANALYSIS);
     var operationB = mockOperation(ServerOperationPriority.ANALYSIS_CONTINUE);
@@ -105,6 +123,20 @@
     expect(queue.isEmpty, isTrue);
   }
 
+  void test_peek() {
+    var operationA = mockOperation(ServerOperationPriority.ANALYSIS);
+    var operationB = mockOperation(ServerOperationPriority.ANALYSIS);
+    queue.add(operationA);
+    queue.add(operationB);
+    expect(queue.peek(), operationA);
+    expect(queue.peek(), operationA);
+    expect(queue.peek(), operationA);
+  }
+
+  void test_peek_empty() {
+    expect(queue.peek(), isNull);
+  }
+
   void test_reschedule() {
     var prioritySource = new MockSource();
     var analysisContextA = new AnalysisContextMock();
@@ -179,6 +211,27 @@
     expect(queue.take(), operationA);
     expect(queue.take(), isNull);
   }
+
+  void test_takeIf() {
+    var operationA = mockOperation(ServerOperationPriority.ANALYSIS);
+    var operationB = mockOperation(ServerOperationPriority.ANALYSIS);
+    queue.add(operationA);
+    queue.add(operationB);
+    expect(queue.takeIf((_) => false), isNull);
+    expect(queue.takeIf((operation) => operation == operationB), operationB);
+    expect(queue.takeIf((operation) => operation == operationB), isNull);
+    expect(queue.takeIf((operation) => operation == operationA), operationA);
+    expect(queue.isEmpty, isTrue);
+  }
+}
+
+class _MergeableOperationMock extends TypedMock implements MergeableOperation {
+  @override
+  ServerOperationPriority get priority {
+    return ServerOperationPriority.ANALYSIS_NOTIFICATION;
+  }
+
+  noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
 }
 
 class _ServerOperationMock extends TypedMock implements ServerOperation {
diff --git a/pkg/analysis_server/test/operation/operation_test.dart b/pkg/analysis_server/test/operation/operation_test.dart
index f9639fe..1972129 100644
--- a/pkg/analysis_server/test/operation/operation_test.dart
+++ b/pkg/analysis_server/test/operation/operation_test.dart
@@ -7,8 +7,10 @@
 import 'package:analysis_server/src/operation/operation.dart';
 import 'package:unittest/unittest.dart';
 
+import '../utils.dart';
+
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
 
   group('ServerOperationPriority', () {
     test('toString', () {
diff --git a/pkg/analysis_server/test/operation/test_all.dart b/pkg/analysis_server/test/operation/test_all.dart
index ca3c425..4296f39 100644
--- a/pkg/analysis_server/test/operation/test_all.dart
+++ b/pkg/analysis_server/test/operation/test_all.dart
@@ -6,6 +6,7 @@
 
 import 'package:unittest/unittest.dart';
 
+import '../utils.dart';
 import 'operation_queue_test.dart' as operation_queue_test;
 import 'operation_test.dart' as operation_test;
 
@@ -13,7 +14,7 @@
  * Utility for manually running all tests.
  */
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   group('operation', () {
     operation_queue_test.main();
     operation_test.main();
diff --git a/pkg/analysis_server/test/plugin/protocol_dart_test.dart b/pkg/analysis_server/test/plugin/protocol_dart_test.dart
new file mode 100644
index 0000000..35cf37d
--- /dev/null
+++ b/pkg/analysis_server/test/plugin/protocol_dart_test.dart
@@ -0,0 +1,474 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library test.computer.element;
+
+import 'package:analysis_server/plugin/protocol/protocol.dart';
+import 'package:analysis_server/plugin/protocol/protocol_dart.dart';
+import 'package:analyzer/src/generated/ast.dart' as engine;
+import 'package:analyzer/src/generated/element.dart' as engine;
+import 'package:analyzer/src/generated/error.dart' as engine;
+import 'package:analyzer/src/generated/source.dart' as engine;
+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);
+}
+
+@reflectiveTest
+class ElementKindTest {
+  void test_fromEngine() {
+    expect(convertElementKind(engine.ElementKind.CLASS), ElementKind.CLASS);
+    expect(convertElementKind(engine.ElementKind.COMPILATION_UNIT),
+        ElementKind.COMPILATION_UNIT);
+    expect(convertElementKind(engine.ElementKind.CONSTRUCTOR),
+        ElementKind.CONSTRUCTOR);
+    expect(convertElementKind(engine.ElementKind.FIELD), ElementKind.FIELD);
+    expect(
+        convertElementKind(engine.ElementKind.FUNCTION), ElementKind.FUNCTION);
+    expect(convertElementKind(engine.ElementKind.FUNCTION_TYPE_ALIAS),
+        ElementKind.FUNCTION_TYPE_ALIAS);
+    expect(convertElementKind(engine.ElementKind.GETTER), ElementKind.GETTER);
+    expect(convertElementKind(engine.ElementKind.LABEL), ElementKind.LABEL);
+    expect(convertElementKind(engine.ElementKind.LIBRARY), ElementKind.LIBRARY);
+    expect(convertElementKind(engine.ElementKind.LOCAL_VARIABLE),
+        ElementKind.LOCAL_VARIABLE);
+    expect(convertElementKind(engine.ElementKind.METHOD), ElementKind.METHOD);
+    expect(convertElementKind(engine.ElementKind.PARAMETER),
+        ElementKind.PARAMETER);
+    expect(convertElementKind(engine.ElementKind.SETTER), ElementKind.SETTER);
+    expect(convertElementKind(engine.ElementKind.TOP_LEVEL_VARIABLE),
+        ElementKind.TOP_LEVEL_VARIABLE);
+    expect(convertElementKind(engine.ElementKind.TYPE_PARAMETER),
+        ElementKind.TYPE_PARAMETER);
+  }
+
+  void test_string_constructor() {
+    expect(new ElementKind(ElementKind.CLASS.name), ElementKind.CLASS);
+    expect(new ElementKind(ElementKind.CLASS_TYPE_ALIAS.name),
+        ElementKind.CLASS_TYPE_ALIAS);
+    expect(new ElementKind(ElementKind.COMPILATION_UNIT.name),
+        ElementKind.COMPILATION_UNIT);
+    expect(
+        new ElementKind(ElementKind.CONSTRUCTOR.name), ElementKind.CONSTRUCTOR);
+    expect(new ElementKind(ElementKind.FIELD.name), ElementKind.FIELD);
+    expect(new ElementKind(ElementKind.FUNCTION.name), ElementKind.FUNCTION);
+    expect(new ElementKind(ElementKind.FUNCTION_TYPE_ALIAS.name),
+        ElementKind.FUNCTION_TYPE_ALIAS);
+    expect(new ElementKind(ElementKind.GETTER.name), ElementKind.GETTER);
+    expect(new ElementKind(ElementKind.LIBRARY.name), ElementKind.LIBRARY);
+    expect(new ElementKind(ElementKind.LOCAL_VARIABLE.name),
+        ElementKind.LOCAL_VARIABLE);
+    expect(new ElementKind(ElementKind.METHOD.name), ElementKind.METHOD);
+    expect(new ElementKind(ElementKind.PARAMETER.name), ElementKind.PARAMETER);
+    expect(new ElementKind(ElementKind.SETTER.name), ElementKind.SETTER);
+    expect(new ElementKind(ElementKind.TOP_LEVEL_VARIABLE.name),
+        ElementKind.TOP_LEVEL_VARIABLE);
+    expect(new ElementKind(ElementKind.TYPE_PARAMETER.name),
+        ElementKind.TYPE_PARAMETER);
+    expect(new ElementKind(ElementKind.UNIT_TEST_TEST.name),
+        ElementKind.UNIT_TEST_TEST);
+    expect(new ElementKind(ElementKind.UNIT_TEST_GROUP.name),
+        ElementKind.UNIT_TEST_GROUP);
+    expect(new ElementKind(ElementKind.UNKNOWN.name), ElementKind.UNKNOWN);
+    expect(() {
+      new ElementKind('no-such-kind');
+    }, throws);
+  }
+
+  void test_toString() {
+    expect(ElementKind.CLASS.toString(), 'ElementKind.CLASS');
+    expect(ElementKind.COMPILATION_UNIT.toString(),
+        'ElementKind.COMPILATION_UNIT');
+  }
+}
+
+@reflectiveTest
+class ElementTest extends AbstractContextTest {
+  engine.Element findElementInUnit(engine.CompilationUnit unit, String name,
+      [engine.ElementKind kind]) {
+    return findChildElement(unit.element, name, kind);
+  }
+
+  void test_fromElement_CLASS() {
+    engine.Source source = addSource(
+        '/test.dart',
+        '''
+@deprecated
+abstract class _A {}
+class B<K, V> {}''');
+    engine.CompilationUnit unit = resolveLibraryUnit(source);
+    {
+      engine.ClassElement engineElement = findElementInUnit(unit, '_A');
+      // create notification Element
+      Element element = convertElement(engineElement);
+      expect(element.kind, ElementKind.CLASS);
+      expect(element.name, '_A');
+      expect(element.typeParameters, isNull);
+      {
+        Location location = element.location;
+        expect(location.file, '/test.dart');
+        expect(location.offset, 27);
+        expect(location.length, '_A'.length);
+        expect(location.startLine, 2);
+        expect(location.startColumn, 16);
+      }
+      expect(element.parameters, isNull);
+      expect(
+          element.flags,
+          Element.FLAG_ABSTRACT |
+              Element.FLAG_DEPRECATED |
+              Element.FLAG_PRIVATE);
+    }
+    {
+      engine.ClassElement engineElement = findElementInUnit(unit, 'B');
+      // create notification Element
+      Element element = convertElement(engineElement);
+      expect(element.kind, ElementKind.CLASS);
+      expect(element.name, 'B');
+      expect(element.typeParameters, '<K, V>');
+      expect(element.flags, 0);
+    }
+  }
+
+  void test_fromElement_CONSTRUCTOR() {
+    engine.Source source = addSource(
+        '/test.dart',
+        '''
+class A {
+  const A.myConstructor(int a, [String b]);
+}''');
+    engine.CompilationUnit unit = resolveLibraryUnit(source);
+    engine.ConstructorElement engineElement =
+        findElementInUnit(unit, 'myConstructor');
+    // create notification Element
+    Element element = convertElement(engineElement);
+    expect(element.kind, ElementKind.CONSTRUCTOR);
+    expect(element.name, 'myConstructor');
+    expect(element.typeParameters, isNull);
+    {
+      Location location = element.location;
+      expect(location.file, '/test.dart');
+      expect(location.offset, 20);
+      expect(location.length, 'myConstructor'.length);
+      expect(location.startLine, 2);
+      expect(location.startColumn, 11);
+    }
+    expect(element.parameters, '(int a, [String b])');
+    expect(element.returnType, 'A');
+    expect(element.flags, Element.FLAG_CONST);
+  }
+
+  void test_fromElement_dynamic() {
+    var engineElement = engine.DynamicElementImpl.instance;
+    // create notification Element
+    Element element = convertElement(engineElement);
+    expect(element.kind, ElementKind.UNKNOWN);
+    expect(element.name, 'dynamic');
+    expect(element.location, isNull);
+    expect(element.parameters, isNull);
+    expect(element.returnType, isNull);
+    expect(element.flags, 0);
+  }
+
+  void test_fromElement_ENUM() {
+    engine.Source source = addSource(
+        '/test.dart',
+        '''
+@deprecated
+enum _E1 { one, two }
+enum E2 { three, four }''');
+    engine.CompilationUnit unit = resolveLibraryUnit(source);
+    {
+      engine.ClassElement engineElement = findElementInUnit(unit, '_E1');
+      expect(engineElement.isDeprecated, isTrue);
+      // create notification Element
+      Element element = convertElement(engineElement);
+      expect(element.kind, ElementKind.ENUM);
+      expect(element.name, '_E1');
+      expect(element.typeParameters, isNull);
+      {
+        Location location = element.location;
+        expect(location.file, '/test.dart');
+        expect(location.offset, 17);
+        expect(location.length, '_E1'.length);
+        expect(location.startLine, 2);
+        expect(location.startColumn, 6);
+      }
+      expect(element.parameters, isNull);
+      expect(
+          element.flags,
+          (engineElement.isDeprecated ? Element.FLAG_DEPRECATED : 0) |
+              Element.FLAG_PRIVATE);
+    }
+    {
+      engine.ClassElement engineElement = findElementInUnit(unit, 'E2');
+      // create notification Element
+      Element element = convertElement(engineElement);
+      expect(element.kind, ElementKind.ENUM);
+      expect(element.name, 'E2');
+      expect(element.typeParameters, isNull);
+      expect(element.flags, 0);
+    }
+  }
+
+  void test_fromElement_ENUM_CONSTANT() {
+    engine.Source source = addSource(
+        '/test.dart',
+        '''
+@deprecated
+enum _E1 { one, two }
+enum E2 { three, four }''');
+    engine.CompilationUnit unit = resolveLibraryUnit(source);
+    {
+      engine.FieldElement engineElement = findElementInUnit(unit, 'one');
+      // create notification Element
+      Element element = convertElement(engineElement);
+      expect(element.kind, ElementKind.ENUM_CONSTANT);
+      expect(element.name, 'one');
+      {
+        Location location = element.location;
+        expect(location.file, '/test.dart');
+        expect(location.offset, 23);
+        expect(location.length, 'one'.length);
+        expect(location.startLine, 2);
+        expect(location.startColumn, 12);
+      }
+      expect(element.parameters, isNull);
+      expect(element.returnType, '_E1');
+      // TODO(danrubel) determine why enum constant is not marked as deprecated
+      //engine.ClassElement classElement = engineElement.enclosingElement;
+      //expect(classElement.isDeprecated, isTrue);
+      expect(
+          element.flags,
+          // Element.FLAG_DEPRECATED |
+          Element.FLAG_CONST | Element.FLAG_STATIC);
+    }
+    {
+      engine.FieldElement engineElement = findElementInUnit(unit, 'three');
+      // create notification Element
+      Element element = convertElement(engineElement);
+      expect(element.kind, ElementKind.ENUM_CONSTANT);
+      expect(element.name, 'three');
+      {
+        Location location = element.location;
+        expect(location.file, '/test.dart');
+        expect(location.offset, 44);
+        expect(location.length, 'three'.length);
+        expect(location.startLine, 3);
+        expect(location.startColumn, 11);
+      }
+      expect(element.parameters, isNull);
+      expect(element.returnType, 'E2');
+      expect(element.flags, Element.FLAG_CONST | Element.FLAG_STATIC);
+    }
+    {
+      engine.FieldElement engineElement = findElementInUnit(unit, 'index');
+      // create notification Element
+      Element element = convertElement(engineElement);
+      expect(element.kind, ElementKind.FIELD);
+      expect(element.name, 'index');
+      {
+        Location location = element.location;
+        expect(location.file, '/test.dart');
+        expect(location.offset, -1);
+        expect(location.length, 'index'.length);
+        expect(location.startLine, 1);
+        expect(location.startColumn, 0);
+      }
+      expect(element.parameters, isNull);
+      expect(element.returnType, 'int');
+      expect(element.flags, Element.FLAG_FINAL);
+    }
+    {
+      engine.FieldElement engineElement = findElementInUnit(unit, 'values');
+      // create notification Element
+      Element element = convertElement(engineElement);
+      expect(element.kind, ElementKind.FIELD);
+      expect(element.name, 'values');
+      {
+        Location location = element.location;
+        expect(location.file, '/test.dart');
+        expect(location.offset, -1);
+        expect(location.length, 'values'.length);
+        expect(location.startLine, 1);
+        expect(location.startColumn, 0);
+      }
+      expect(element.parameters, isNull);
+      expect(element.returnType, 'List<E2>');
+      expect(element.flags, Element.FLAG_CONST | Element.FLAG_STATIC);
+    }
+  }
+
+  void test_fromElement_FIELD() {
+    engine.Source source = addSource(
+        '/test.dart',
+        '''
+class A {
+  static const myField = 42;
+}''');
+    engine.CompilationUnit unit = resolveLibraryUnit(source);
+    engine.FieldElement engineElement = findElementInUnit(unit, 'myField');
+    // create notification Element
+    Element element = convertElement(engineElement);
+    expect(element.kind, ElementKind.FIELD);
+    expect(element.name, 'myField');
+    {
+      Location location = element.location;
+      expect(location.file, '/test.dart');
+      expect(location.offset, 25);
+      expect(location.length, 'myField'.length);
+      expect(location.startLine, 2);
+      expect(location.startColumn, 16);
+    }
+    expect(element.parameters, isNull);
+    expect(element.returnType, 'dynamic');
+    expect(element.flags, Element.FLAG_CONST | Element.FLAG_STATIC);
+  }
+
+  void test_fromElement_FUNCTION_TYPE_ALIAS() {
+    engine.Source source = addSource(
+        '/test.dart',
+        '''
+typedef int F<T>(String x);
+''');
+    engine.CompilationUnit unit = resolveLibraryUnit(source);
+    engine.FunctionTypeAliasElement engineElement =
+        findElementInUnit(unit, 'F');
+    // create notification Element
+    Element element = convertElement(engineElement);
+    expect(element.kind, ElementKind.FUNCTION_TYPE_ALIAS);
+    expect(element.name, 'F');
+    expect(element.typeParameters, '<T>');
+    {
+      Location location = element.location;
+      expect(location.file, '/test.dart');
+      expect(location.offset, 12);
+      expect(location.length, 'F'.length);
+      expect(location.startLine, 1);
+      expect(location.startColumn, 13);
+    }
+    expect(element.parameters, '(String x)');
+    expect(element.returnType, 'int');
+    expect(element.flags, 0);
+  }
+
+  void test_fromElement_GETTER() {
+    engine.Source source = addSource(
+        '/test.dart',
+        '''
+class A {
+  String get myGetter => 42;
+}''');
+    engine.CompilationUnit unit = resolveLibraryUnit(source);
+    engine.PropertyAccessorElement engineElement =
+        findElementInUnit(unit, 'myGetter', engine.ElementKind.GETTER);
+    // create notification Element
+    Element element = convertElement(engineElement);
+    expect(element.kind, ElementKind.GETTER);
+    expect(element.name, 'myGetter');
+    {
+      Location location = element.location;
+      expect(location.file, '/test.dart');
+      expect(location.offset, 23);
+      expect(location.length, 'myGetter'.length);
+      expect(location.startLine, 2);
+      expect(location.startColumn, 14);
+    }
+    expect(element.parameters, isNull);
+    expect(element.returnType, 'String');
+    expect(element.flags, 0);
+  }
+
+  void test_fromElement_LABEL() {
+    engine.Source source = addSource(
+        '/test.dart',
+        '''
+main() {
+myLabel:
+  while (true) {
+    break myLabel;
+  }
+}''');
+    engine.CompilationUnit unit = resolveLibraryUnit(source);
+    engine.LabelElement engineElement = findElementInUnit(unit, 'myLabel');
+    // create notification Element
+    Element element = convertElement(engineElement);
+    expect(element.kind, ElementKind.LABEL);
+    expect(element.name, 'myLabel');
+    {
+      Location location = element.location;
+      expect(location.file, '/test.dart');
+      expect(location.offset, 9);
+      expect(location.length, 'myLabel'.length);
+      expect(location.startLine, 2);
+      expect(location.startColumn, 1);
+    }
+    expect(element.parameters, isNull);
+    expect(element.returnType, isNull);
+    expect(element.flags, 0);
+  }
+
+  void test_fromElement_METHOD() {
+    engine.Source source = addSource(
+        '/test.dart',
+        '''
+class A {
+  static List<String> myMethod(int a, {String b, int c}) {
+    return null;
+  }
+}''');
+    engine.CompilationUnit unit = resolveLibraryUnit(source);
+    engine.MethodElement engineElement = findElementInUnit(unit, 'myMethod');
+    // create notification Element
+    Element element = convertElement(engineElement);
+    expect(element.kind, ElementKind.METHOD);
+    expect(element.name, 'myMethod');
+    {
+      Location location = element.location;
+      expect(location.file, '/test.dart');
+      expect(location.offset, 32);
+      expect(location.length, 'myGetter'.length);
+      expect(location.startLine, 2);
+      expect(location.startColumn, 23);
+    }
+    expect(element.parameters, '(int a, {String b, int c})');
+    expect(element.returnType, 'List<String>');
+    expect(element.flags, Element.FLAG_STATIC);
+  }
+
+  void test_fromElement_SETTER() {
+    engine.Source source = addSource(
+        '/test.dart',
+        '''
+class A {
+  set mySetter(String x) {}
+}''');
+    engine.CompilationUnit unit = resolveLibraryUnit(source);
+    engine.FieldElement engineFieldElement =
+        findElementInUnit(unit, 'mySetter', engine.ElementKind.FIELD);
+    engine.PropertyAccessorElement engineElement = engineFieldElement.setter;
+    // create notification Element
+    Element element = convertElement(engineElement);
+    expect(element.kind, ElementKind.SETTER);
+    expect(element.name, 'mySetter');
+    {
+      Location location = element.location;
+      expect(location.file, '/test.dart');
+      expect(location.offset, 16);
+      expect(location.length, 'mySetter'.length);
+      expect(location.startLine, 2);
+      expect(location.startColumn, 7);
+    }
+    expect(element.parameters, '(String x)');
+    expect(element.returnType, isNull);
+    expect(element.flags, 0);
+  }
+}
diff --git a/pkg/analysis_server/test/plugin/set_analysis_domain_test.dart b/pkg/analysis_server/test/plugin/set_analysis_domain_test.dart
new file mode 100644
index 0000000..592b8dd
--- /dev/null
+++ b/pkg/analysis_server/test/plugin/set_analysis_domain_test.dart
@@ -0,0 +1,166 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library test.plugin.analysis_contributor;
+
+import 'dart:async';
+
+import 'package:analysis_server/plugin/analysis/analysis_domain.dart';
+import 'package:analysis_server/plugin/analysis/navigation/navigation.dart';
+import 'package:analysis_server/plugin/analysis/navigation/navigation_core.dart';
+import 'package:analysis_server/plugin/analysis/occurrences/occurrences.dart';
+import 'package:analysis_server/plugin/analysis/occurrences/occurrences_core.dart';
+import 'package:analysis_server/plugin/protocol/protocol.dart';
+import 'package:analysis_server/src/constants.dart';
+import 'package:analyzer/src/generated/engine.dart';
+import 'package:analyzer/src/generated/source.dart';
+import 'package:analyzer/task/dart.dart';
+import 'package:plugin/plugin.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
+import 'package:unittest/unittest.dart';
+
+import '../analysis_abstract.dart';
+import '../utils.dart';
+
+main() {
+  initializeTestEnvironment();
+  if (AnalysisEngine.instance.useTaskModel) {
+    defineReflectiveTests(SetAnalysisDomainTest);
+  }
+}
+
+/**
+ * This test uses [SET_ANALYSIS_DOMAIN_EXTENSION_POINT_ID] and
+ * [NAVIGATION_CONTRIBUTOR_EXTENSION_POINT_ID] extension points to validate
+ * that plugins can listen for analysis and force sending navigation
+ * notifications.
+ */
+@reflectiveTest
+class SetAnalysisDomainTest extends AbstractAnalysisTest {
+  final Set<String> parsedUnitFiles = new Set<String>();
+
+  AnalysisNavigationParams navigationParams;
+  AnalysisOccurrencesParams occurrencesParams;
+
+  @override
+  void addServerPlugins(List<Plugin> plugins) {
+    var plugin = new TestSetAnalysisDomainPlugin(this);
+    plugins.add(plugin);
+  }
+
+  @override
+  void processNotification(Notification notification) {
+    if (notification.event == ANALYSIS_NAVIGATION) {
+      var params = new AnalysisNavigationParams.fromNotification(notification);
+      if (params.file == testFile) {
+        navigationParams = params;
+      }
+    }
+    if (notification.event == ANALYSIS_OCCURRENCES) {
+      var params = new AnalysisOccurrencesParams.fromNotification(notification);
+      if (params.file == testFile) {
+        occurrencesParams = params;
+      }
+    }
+  }
+
+  Future test_contributorIsInvoked() async {
+    createProject();
+    addAnalysisSubscription(AnalysisService.NAVIGATION, testFile);
+    addAnalysisSubscription(AnalysisService.OCCURRENCES, testFile);
+    addTestFile('// usually no navigation');
+    await server.onAnalysisComplete;
+    // we have PARSED_UNIT
+    expect(parsedUnitFiles, contains(testFile));
+    // we have an additional navigation region/target
+    {
+      expect(navigationParams.regions, hasLength(1));
+      {
+        NavigationRegion region = navigationParams.regions.single;
+        expect(region.offset, 1);
+        expect(region.length, 5);
+        expect(region.targets.single, 0);
+      }
+      {
+        NavigationTarget target = navigationParams.targets.single;
+        expect(target.fileIndex, 0);
+        expect(target.offset, 1);
+        expect(target.length, 2);
+        expect(target.startLine, 3);
+        expect(target.startColumn, 4);
+      }
+      expect(navigationParams.files.single, '/testLocation.dart');
+    }
+    // we have additional occurrences
+    {
+      expect(occurrencesParams.occurrences, hasLength(1));
+      Occurrences occurrences = occurrencesParams.occurrences.single;
+      expect(occurrences.element.name, 'TestElement');
+      expect(occurrences.length, 5);
+      expect(occurrences.offsets, unorderedEquals([1, 2, 3]));
+    }
+  }
+}
+
+class TestNavigationContributor implements NavigationContributor {
+  final SetAnalysisDomainTest test;
+
+  TestNavigationContributor(this.test);
+
+  @override
+  void computeNavigation(NavigationCollector collector, AnalysisContext context,
+      Source source, int offset, int length) {
+    collector.addRegion(1, 5, ElementKind.CLASS,
+        new Location('/testLocation.dart', 1, 2, 3, 4));
+  }
+}
+
+class TestOccurrencesContributor implements OccurrencesContributor {
+  final SetAnalysisDomainTest test;
+
+  TestOccurrencesContributor(this.test);
+
+  @override
+  void computeOccurrences(
+      OccurrencesCollector collector, AnalysisContext context, Source source) {
+    Element element = new Element(ElementKind.UNKNOWN, 'TestElement', 0);
+    collector.addOccurrences(new Occurrences(element, <int>[1, 2], 5));
+    collector.addOccurrences(new Occurrences(element, <int>[3], 5));
+  }
+}
+
+class TestSetAnalysisDomainPlugin implements Plugin {
+  final SetAnalysisDomainTest test;
+
+  TestSetAnalysisDomainPlugin(this.test);
+
+  @override
+  String get uniqueIdentifier => 'test';
+
+  @override
+  void registerExtensionPoints(RegisterExtensionPoint register) {}
+
+  @override
+  void registerExtensions(RegisterExtension register) {
+    register(SET_ANALYSIS_DOMAIN_EXTENSION_POINT_ID, _setAnalysisDomain);
+    register(NAVIGATION_CONTRIBUTOR_EXTENSION_POINT_ID,
+        new TestNavigationContributor(test));
+    register(OCCURRENCES_CONTRIBUTOR_EXTENSION_POINT_ID,
+        new TestOccurrencesContributor(test));
+  }
+
+  void _setAnalysisDomain(AnalysisDomain domain) {
+    domain.onResultComputed(PARSED_UNIT).listen((result) {
+      expect(result.context, isNotNull);
+      expect(result.target, isNotNull);
+      expect(result.value, isNotNull);
+      Source source = result.target.source;
+      test.parsedUnitFiles.add(source.fullName);
+      domain.scheduleNotification(
+          result.context, source, AnalysisService.NAVIGATION);
+      domain.scheduleNotification(
+          result.context, source, AnalysisService.OCCURRENCES);
+    });
+  }
+}
diff --git a/pkg/analysis_server/test/plugin/test_all.dart b/pkg/analysis_server/test/plugin/test_all.dart
new file mode 100644
index 0000000..5ad008b
--- /dev/null
+++ b/pkg/analysis_server/test/plugin/test_all.dart
@@ -0,0 +1,21 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+library test.plugin.analysis_contributor;
+
+import 'package:unittest/unittest.dart';
+
+import '../utils.dart';
+import 'protocol_dart_test.dart' as protocol_dart_test;
+import 'set_analysis_domain_test.dart' as set_analysis_domain_test;
+
+/**
+ * Utility for manually running all tests.
+ */
+main() {
+  initializeTestEnvironment();
+  group('plugin', () {
+    protocol_dart_test.main();
+    set_analysis_domain_test.main();
+  });
+}
diff --git a/pkg/analysis_server/test/protocol_server_test.dart b/pkg/analysis_server/test/protocol_server_test.dart
index 6c9fedb..5f503b6 100644
--- a/pkg/analysis_server/test/protocol_server_test.dart
+++ b/pkg/analysis_server/test/protocol_server_test.dart
@@ -17,14 +17,12 @@
 import 'package:typed_mock/typed_mock.dart';
 import 'package:unittest/unittest.dart';
 
-import 'abstract_context.dart';
 import 'mocks.dart';
+import 'utils.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(AnalysisErrorTest);
-  defineReflectiveTests(ElementTest);
-  defineReflectiveTests(ElementKindTest);
   defineReflectiveTests(EnumTest);
 }
 
@@ -71,7 +69,8 @@
         START_COLUMN: 2
       },
       MESSAGE: 'my message',
-      CORRECTION: 'my correction'
+      CORRECTION: 'my correction',
+      HAS_FIX: false
     });
   }
 
@@ -88,7 +87,8 @@
         START_LINE: 3,
         START_COLUMN: 2
       },
-      MESSAGE: 'my message'
+      MESSAGE: 'my message',
+      HAS_FIX: false
     });
   }
 
@@ -105,446 +105,13 @@
         START_LINE: -1,
         START_COLUMN: -1
       },
-      MESSAGE: 'my message'
+      MESSAGE: 'my message',
+      HAS_FIX: false
     });
   }
 }
 
 @reflectiveTest
-class ElementKindTest {
-  void test_fromEngine() {
-    expect(
-        newElementKind_fromEngine(engine.ElementKind.CLASS), ElementKind.CLASS);
-    expect(newElementKind_fromEngine(engine.ElementKind.COMPILATION_UNIT),
-        ElementKind.COMPILATION_UNIT);
-    expect(newElementKind_fromEngine(engine.ElementKind.CONSTRUCTOR),
-        ElementKind.CONSTRUCTOR);
-    expect(
-        newElementKind_fromEngine(engine.ElementKind.FIELD), ElementKind.FIELD);
-    expect(newElementKind_fromEngine(engine.ElementKind.FUNCTION),
-        ElementKind.FUNCTION);
-    expect(newElementKind_fromEngine(engine.ElementKind.FUNCTION_TYPE_ALIAS),
-        ElementKind.FUNCTION_TYPE_ALIAS);
-    expect(newElementKind_fromEngine(engine.ElementKind.GETTER),
-        ElementKind.GETTER);
-    expect(
-        newElementKind_fromEngine(engine.ElementKind.LABEL), ElementKind.LABEL);
-    expect(newElementKind_fromEngine(engine.ElementKind.LIBRARY),
-        ElementKind.LIBRARY);
-    expect(newElementKind_fromEngine(engine.ElementKind.LOCAL_VARIABLE),
-        ElementKind.LOCAL_VARIABLE);
-    expect(newElementKind_fromEngine(engine.ElementKind.METHOD),
-        ElementKind.METHOD);
-    expect(newElementKind_fromEngine(engine.ElementKind.PARAMETER),
-        ElementKind.PARAMETER);
-    expect(newElementKind_fromEngine(engine.ElementKind.SETTER),
-        ElementKind.SETTER);
-    expect(newElementKind_fromEngine(engine.ElementKind.TOP_LEVEL_VARIABLE),
-        ElementKind.TOP_LEVEL_VARIABLE);
-    expect(newElementKind_fromEngine(engine.ElementKind.TYPE_PARAMETER),
-        ElementKind.TYPE_PARAMETER);
-  }
-
-  void test_string_constructor() {
-    expect(new ElementKind(ElementKind.CLASS.name), ElementKind.CLASS);
-    expect(new ElementKind(ElementKind.CLASS_TYPE_ALIAS.name),
-        ElementKind.CLASS_TYPE_ALIAS);
-    expect(new ElementKind(ElementKind.COMPILATION_UNIT.name),
-        ElementKind.COMPILATION_UNIT);
-    expect(
-        new ElementKind(ElementKind.CONSTRUCTOR.name), ElementKind.CONSTRUCTOR);
-    expect(new ElementKind(ElementKind.FIELD.name), ElementKind.FIELD);
-    expect(new ElementKind(ElementKind.FUNCTION.name), ElementKind.FUNCTION);
-    expect(new ElementKind(ElementKind.FUNCTION_TYPE_ALIAS.name),
-        ElementKind.FUNCTION_TYPE_ALIAS);
-    expect(new ElementKind(ElementKind.GETTER.name), ElementKind.GETTER);
-    expect(new ElementKind(ElementKind.LIBRARY.name), ElementKind.LIBRARY);
-    expect(new ElementKind(ElementKind.LOCAL_VARIABLE.name),
-        ElementKind.LOCAL_VARIABLE);
-    expect(new ElementKind(ElementKind.METHOD.name), ElementKind.METHOD);
-    expect(new ElementKind(ElementKind.PARAMETER.name), ElementKind.PARAMETER);
-    expect(new ElementKind(ElementKind.SETTER.name), ElementKind.SETTER);
-    expect(new ElementKind(ElementKind.TOP_LEVEL_VARIABLE.name),
-        ElementKind.TOP_LEVEL_VARIABLE);
-    expect(new ElementKind(ElementKind.TYPE_PARAMETER.name),
-        ElementKind.TYPE_PARAMETER);
-    expect(new ElementKind(ElementKind.UNIT_TEST_TEST.name),
-        ElementKind.UNIT_TEST_TEST);
-    expect(new ElementKind(ElementKind.UNIT_TEST_GROUP.name),
-        ElementKind.UNIT_TEST_GROUP);
-    expect(new ElementKind(ElementKind.UNKNOWN.name), ElementKind.UNKNOWN);
-    expect(() {
-      new ElementKind('no-such-kind');
-    }, throws);
-  }
-
-  void test_toString() {
-    expect(ElementKind.CLASS.toString(), 'ElementKind.CLASS');
-    expect(ElementKind.COMPILATION_UNIT.toString(),
-        'ElementKind.COMPILATION_UNIT');
-  }
-}
-
-@reflectiveTest
-class ElementTest extends AbstractContextTest {
-  engine.Element findElementInUnit(engine.CompilationUnit unit, String name,
-      [engine.ElementKind kind]) {
-    return findChildElement(unit.element, name, kind);
-  }
-
-  void test_fromElement_CLASS() {
-    engine.Source source = addSource('/test.dart', '''
-@deprecated
-abstract class _A {}
-class B<K, V> {}''');
-    engine.CompilationUnit unit = resolveLibraryUnit(source);
-    {
-      engine.ClassElement engineElement = findElementInUnit(unit, '_A');
-      // create notification Element
-      Element element = newElement_fromEngine(engineElement);
-      expect(element.kind, ElementKind.CLASS);
-      expect(element.name, '_A');
-      expect(element.typeParameters, isNull);
-      {
-        Location location = element.location;
-        expect(location.file, '/test.dart');
-        expect(location.offset, 27);
-        expect(location.length, '_A'.length);
-        expect(location.startLine, 2);
-        expect(location.startColumn, 16);
-      }
-      expect(element.parameters, isNull);
-      expect(element.flags, Element.FLAG_ABSTRACT |
-          Element.FLAG_DEPRECATED |
-          Element.FLAG_PRIVATE);
-    }
-    {
-      engine.ClassElement engineElement = findElementInUnit(unit, 'B');
-      // create notification Element
-      Element element = newElement_fromEngine(engineElement);
-      expect(element.kind, ElementKind.CLASS);
-      expect(element.name, 'B');
-      expect(element.typeParameters, '<K, V>');
-      expect(element.flags, 0);
-    }
-  }
-
-  void test_fromElement_CONSTRUCTOR() {
-    engine.Source source = addSource('/test.dart', '''
-class A {
-  const A.myConstructor(int a, [String b]);
-}''');
-    engine.CompilationUnit unit = resolveLibraryUnit(source);
-    engine.ConstructorElement engineElement =
-        findElementInUnit(unit, 'myConstructor');
-    // create notification Element
-    Element element = newElement_fromEngine(engineElement);
-    expect(element.kind, ElementKind.CONSTRUCTOR);
-    expect(element.name, 'myConstructor');
-    expect(element.typeParameters, isNull);
-    {
-      Location location = element.location;
-      expect(location.file, '/test.dart');
-      expect(location.offset, 20);
-      expect(location.length, 'myConstructor'.length);
-      expect(location.startLine, 2);
-      expect(location.startColumn, 11);
-    }
-    expect(element.parameters, '(int a, [String b])');
-    expect(element.returnType, 'A');
-    expect(element.flags, Element.FLAG_CONST);
-  }
-
-  void test_fromElement_dynamic() {
-    var engineElement = engine.DynamicElementImpl.instance;
-    // create notification Element
-    Element element = newElement_fromEngine(engineElement);
-    expect(element.kind, ElementKind.UNKNOWN);
-    expect(element.name, 'dynamic');
-    expect(element.location, isNull);
-    expect(element.parameters, isNull);
-    expect(element.returnType, isNull);
-    expect(element.flags, 0);
-  }
-
-  void test_fromElement_ENUM() {
-    engine.Source source = addSource('/test.dart', '''
-@deprecated
-enum _E1 { one, two }
-enum E2 { three, four }''');
-    engine.CompilationUnit unit = resolveLibraryUnit(source);
-    {
-      engine.ClassElement engineElement = findElementInUnit(unit, '_E1');
-      expect(engineElement.isDeprecated, isTrue);
-      // create notification Element
-      Element element = newElement_fromEngine(engineElement);
-      expect(element.kind, ElementKind.ENUM);
-      expect(element.name, '_E1');
-      expect(element.typeParameters, isNull);
-      {
-        Location location = element.location;
-        expect(location.file, '/test.dart');
-        expect(location.offset, 17);
-        expect(location.length, '_E1'.length);
-        expect(location.startLine, 2);
-        expect(location.startColumn, 6);
-      }
-      expect(element.parameters, isNull);
-      expect(element.flags,
-          (engineElement.isDeprecated ? Element.FLAG_DEPRECATED : 0) |
-              Element.FLAG_PRIVATE);
-    }
-    {
-      engine.ClassElement engineElement = findElementInUnit(unit, 'E2');
-      // create notification Element
-      Element element = newElement_fromEngine(engineElement);
-      expect(element.kind, ElementKind.ENUM);
-      expect(element.name, 'E2');
-      expect(element.typeParameters, isNull);
-      expect(element.flags, 0);
-    }
-  }
-
-  void test_fromElement_ENUM_CONSTANT() {
-    engine.Source source = addSource('/test.dart', '''
-@deprecated
-enum _E1 { one, two }
-enum E2 { three, four }''');
-    engine.CompilationUnit unit = resolveLibraryUnit(source);
-    {
-      engine.FieldElement engineElement = findElementInUnit(unit, 'one');
-      // create notification Element
-      Element element = newElement_fromEngine(engineElement);
-      expect(element.kind, ElementKind.ENUM_CONSTANT);
-      expect(element.name, 'one');
-      {
-        Location location = element.location;
-        expect(location.file, '/test.dart');
-        expect(location.offset, 23);
-        expect(location.length, 'one'.length);
-        expect(location.startLine, 2);
-        expect(location.startColumn, 12);
-      }
-      expect(element.parameters, isNull);
-      expect(element.returnType, '_E1');
-      // TODO(danrubel) determine why enum constant is not marked as deprecated
-      //engine.ClassElement classElement = engineElement.enclosingElement;
-      //expect(classElement.isDeprecated, isTrue);
-      expect(element.flags,
-          // Element.FLAG_DEPRECATED |
-          Element.FLAG_CONST | Element.FLAG_STATIC);
-    }
-    {
-      engine.FieldElement engineElement = findElementInUnit(unit, 'three');
-      // create notification Element
-      Element element = newElement_fromEngine(engineElement);
-      expect(element.kind, ElementKind.ENUM_CONSTANT);
-      expect(element.name, 'three');
-      {
-        Location location = element.location;
-        expect(location.file, '/test.dart');
-        expect(location.offset, 44);
-        expect(location.length, 'three'.length);
-        expect(location.startLine, 3);
-        expect(location.startColumn, 11);
-      }
-      expect(element.parameters, isNull);
-      expect(element.returnType, 'E2');
-      expect(element.flags, Element.FLAG_CONST | Element.FLAG_STATIC);
-    }
-    {
-      engine.FieldElement engineElement = findElementInUnit(unit, 'index');
-      // create notification Element
-      Element element = newElement_fromEngine(engineElement);
-      expect(element.kind, ElementKind.FIELD);
-      expect(element.name, 'index');
-      {
-        Location location = element.location;
-        expect(location.file, '/test.dart');
-        expect(location.offset, -1);
-        expect(location.length, 'index'.length);
-        expect(location.startLine, 1);
-        expect(location.startColumn, 0);
-      }
-      expect(element.parameters, isNull);
-      expect(element.returnType, 'int');
-      expect(element.flags, Element.FLAG_FINAL);
-    }
-    {
-      engine.FieldElement engineElement = findElementInUnit(unit, 'values');
-      // create notification Element
-      Element element = newElement_fromEngine(engineElement);
-      expect(element.kind, ElementKind.FIELD);
-      expect(element.name, 'values');
-      {
-        Location location = element.location;
-        expect(location.file, '/test.dart');
-        expect(location.offset, -1);
-        expect(location.length, 'values'.length);
-        expect(location.startLine, 1);
-        expect(location.startColumn, 0);
-      }
-      expect(element.parameters, isNull);
-      expect(element.returnType, 'List<E2>');
-      expect(element.flags, Element.FLAG_CONST | Element.FLAG_STATIC);
-    }
-  }
-
-  void test_fromElement_FIELD() {
-    engine.Source source = addSource('/test.dart', '''
-class A {
-  static const myField = 42;
-}''');
-    engine.CompilationUnit unit = resolveLibraryUnit(source);
-    engine.FieldElement engineElement = findElementInUnit(unit, 'myField');
-    // create notification Element
-    Element element = newElement_fromEngine(engineElement);
-    expect(element.kind, ElementKind.FIELD);
-    expect(element.name, 'myField');
-    {
-      Location location = element.location;
-      expect(location.file, '/test.dart');
-      expect(location.offset, 25);
-      expect(location.length, 'myField'.length);
-      expect(location.startLine, 2);
-      expect(location.startColumn, 16);
-    }
-    expect(element.parameters, isNull);
-    expect(element.returnType, 'dynamic');
-    expect(element.flags, Element.FLAG_CONST | Element.FLAG_STATIC);
-  }
-
-  void test_fromElement_FUNCTION_TYPE_ALIAS() {
-    engine.Source source = addSource('/test.dart', '''
-typedef int F<T>(String x);
-''');
-    engine.CompilationUnit unit = resolveLibraryUnit(source);
-    engine.FunctionTypeAliasElement engineElement =
-        findElementInUnit(unit, 'F');
-    // create notification Element
-    Element element = newElement_fromEngine(engineElement);
-    expect(element.kind, ElementKind.FUNCTION_TYPE_ALIAS);
-    expect(element.name, 'F');
-    expect(element.typeParameters, '<T>');
-    {
-      Location location = element.location;
-      expect(location.file, '/test.dart');
-      expect(location.offset, 12);
-      expect(location.length, 'F'.length);
-      expect(location.startLine, 1);
-      expect(location.startColumn, 13);
-    }
-    expect(element.parameters, '(String x)');
-    expect(element.returnType, 'int');
-    expect(element.flags, 0);
-  }
-
-  void test_fromElement_GETTER() {
-    engine.Source source = addSource('/test.dart', '''
-class A {
-  String get myGetter => 42;
-}''');
-    engine.CompilationUnit unit = resolveLibraryUnit(source);
-    engine.PropertyAccessorElement engineElement =
-        findElementInUnit(unit, 'myGetter', engine.ElementKind.GETTER);
-    // create notification Element
-    Element element = newElement_fromEngine(engineElement);
-    expect(element.kind, ElementKind.GETTER);
-    expect(element.name, 'myGetter');
-    {
-      Location location = element.location;
-      expect(location.file, '/test.dart');
-      expect(location.offset, 23);
-      expect(location.length, 'myGetter'.length);
-      expect(location.startLine, 2);
-      expect(location.startColumn, 14);
-    }
-    expect(element.parameters, isNull);
-    expect(element.returnType, 'String');
-    expect(element.flags, 0);
-  }
-
-  void test_fromElement_LABEL() {
-    engine.Source source = addSource('/test.dart', '''
-main() {
-myLabel:
-  while (true) {
-    break myLabel;
-  }
-}''');
-    engine.CompilationUnit unit = resolveLibraryUnit(source);
-    engine.LabelElement engineElement = findElementInUnit(unit, 'myLabel');
-    // create notification Element
-    Element element = newElement_fromEngine(engineElement);
-    expect(element.kind, ElementKind.LABEL);
-    expect(element.name, 'myLabel');
-    {
-      Location location = element.location;
-      expect(location.file, '/test.dart');
-      expect(location.offset, 9);
-      expect(location.length, 'myLabel'.length);
-      expect(location.startLine, 2);
-      expect(location.startColumn, 1);
-    }
-    expect(element.parameters, isNull);
-    expect(element.returnType, isNull);
-    expect(element.flags, 0);
-  }
-
-  void test_fromElement_METHOD() {
-    engine.Source source = addSource('/test.dart', '''
-class A {
-  static List<String> myMethod(int a, {String b}) {
-    return null;
-  }
-}''');
-    engine.CompilationUnit unit = resolveLibraryUnit(source);
-    engine.MethodElement engineElement = findElementInUnit(unit, 'myMethod');
-    // create notification Element
-    Element element = newElement_fromEngine(engineElement);
-    expect(element.kind, ElementKind.METHOD);
-    expect(element.name, 'myMethod');
-    {
-      Location location = element.location;
-      expect(location.file, '/test.dart');
-      expect(location.offset, 32);
-      expect(location.length, 'myGetter'.length);
-      expect(location.startLine, 2);
-      expect(location.startColumn, 23);
-    }
-    expect(element.parameters, '(int a, {String b})');
-    expect(element.returnType, 'List<String>');
-    expect(element.flags, Element.FLAG_STATIC);
-  }
-
-  void test_fromElement_SETTER() {
-    engine.Source source = addSource('/test.dart', '''
-class A {
-  set mySetter(String x) {}
-}''');
-    engine.CompilationUnit unit = resolveLibraryUnit(source);
-    engine.FieldElement engineFieldElement =
-        findElementInUnit(unit, 'mySetter', engine.ElementKind.FIELD);
-    engine.PropertyAccessorElement engineElement = engineFieldElement.setter;
-    // create notification Element
-    Element element = newElement_fromEngine(engineElement);
-    expect(element.kind, ElementKind.SETTER);
-    expect(element.name, 'mySetter');
-    {
-      Location location = element.location;
-      expect(location.file, '/test.dart');
-      expect(location.offset, 16);
-      expect(location.length, 'mySetter'.length);
-      expect(location.startLine, 2);
-      expect(location.startColumn, 7);
-    }
-    expect(element.parameters, '(String x)');
-    expect(element.returnType, isNull);
-    expect(element.flags, 0);
-  }
-}
-
-@reflectiveTest
 class EnumTest {
   void test_AnalysisErrorSeverity() {
     new EnumTester<engine.ErrorSeverity, AnalysisErrorSeverity>().run(
@@ -560,8 +127,8 @@
   }
 
   void test_ElementKind() {
-    new EnumTester<engine.ElementKind, ElementKind>().run(
-        newElementKind_fromEngine, exceptions: {
+    new EnumTester<engine.ElementKind, ElementKind>()
+        .run(convertElementKind, exceptions: {
       // TODO(paulberry): do any of the exceptions below constitute bugs?
       engine.ElementKind.DYNAMIC: ElementKind.UNKNOWN,
       engine.ElementKind.EMBEDDED_HTML_SCRIPT: ElementKind.UNKNOWN,
diff --git a/pkg/analysis_server/test/protocol_test.dart b/pkg/analysis_server/test/protocol_test.dart
index ddd1b35..93dde63 100644
--- a/pkg/analysis_server/test/protocol_test.dart
+++ b/pkg/analysis_server/test/protocol_test.dart
@@ -6,13 +6,16 @@
 
 import 'dart:convert';
 
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/constants.dart';
-import 'package:analysis_server/src/protocol.dart';
+import 'package:analysis_server/src/protocol/protocol_internal.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 import 'package:unittest/unittest.dart';
 
+import 'utils.dart';
+
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(NotificationTest);
   defineReflectiveTests(RequestTest);
   defineReflectiveTests(RequestErrorTest);
@@ -77,7 +80,11 @@
     expect(notification.event, equals('foo'));
     expect(notification.toJson()['params'], equals({'x': 'y'}));
     expect(
-        notification.toJson(), equals({'event': 'foo', 'params': {'x': 'y'}}));
+        notification.toJson(),
+        equals({
+          'event': 'foo',
+          'params': {'x': 'y'}
+        }));
   }
 }
 
@@ -108,12 +115,10 @@
   void test_toJson() {
     var trace = 'a stack trace\r\nbar';
     RequestError error = new RequestError(
-        RequestErrorCode.UNKNOWN_REQUEST, 'msg', stackTrace: trace);
-    expect(error.toJson(), {
-      CODE: 'UNKNOWN_REQUEST',
-      MESSAGE: 'msg',
-      STACK_TRACE: trace
-    });
+        RequestErrorCode.UNKNOWN_REQUEST, 'msg',
+        stackTrace: trace);
+    expect(error.toJson(),
+        {CODE: 'UNKNOWN_REQUEST', MESSAGE: 'msg', STACK_TRACE: trace});
   }
 }
 
@@ -184,11 +189,13 @@
 
   void test_toJson_withParams() {
     Request request = new Request('one', 'aMethod', {'foo': 'bar'});
-    expect(request.toJson(), equals({
-      Request.ID: 'one',
-      Request.METHOD: 'aMethod',
-      Request.PARAMS: {'foo': 'bar'}
-    }));
+    expect(
+        request.toJson(),
+        equals({
+          Request.ID: 'one',
+          Request.METHOD: 'aMethod',
+          Request.PARAMS: {'foo': 'bar'}
+        }));
   }
 }
 
@@ -198,33 +205,45 @@
     Response response = new Response.invalidRequestFormat();
     expect(response.id, equals(''));
     expect(response.error, isNotNull);
-    expect(response.toJson(), equals({
-      Response.ID: '',
-      Response.ERROR: {'code': 'INVALID_REQUEST', 'message': 'Invalid request'}
-    }));
+    expect(
+        response.toJson(),
+        equals({
+          Response.ID: '',
+          Response.ERROR: {
+            'code': 'INVALID_REQUEST',
+            'message': 'Invalid request'
+          }
+        }));
   }
 
   void test_create_unanalyzedPriorityFiles() {
     Response response = new Response.unanalyzedPriorityFiles('0', 'file list');
     expect(response.id, equals('0'));
     expect(response.error, isNotNull);
-    expect(response.toJson(), equals({
-      Response.ID: '0',
-      Response.ERROR: {
-        'code': 'UNANALYZED_PRIORITY_FILES',
-        'message': "Unanalyzed files cannot be a priority: 'file list'"
-      }
-    }));
+    expect(
+        response.toJson(),
+        equals({
+          Response.ID: '0',
+          Response.ERROR: {
+            'code': 'UNANALYZED_PRIORITY_FILES',
+            'message': "Unanalyzed files cannot be a priority: 'file list'"
+          }
+        }));
   }
 
   void test_create_unknownRequest() {
     Response response = new Response.unknownRequest(new Request('0', ''));
     expect(response.id, equals('0'));
     expect(response.error, isNotNull);
-    expect(response.toJson(), equals({
-      Response.ID: '0',
-      Response.ERROR: {'code': 'UNKNOWN_REQUEST', 'message': 'Unknown request'}
-    }));
+    expect(
+        response.toJson(),
+        equals({
+          Response.ID: '0',
+          Response.ERROR: {
+            'code': 'UNKNOWN_REQUEST',
+            'message': 'Unknown request'
+          }
+        }));
   }
 
   void test_fromJson() {
diff --git a/pkg/analysis_server/test/search/abstract_search_domain.dart b/pkg/analysis_server/test/search/abstract_search_domain.dart
index 90f7d47..e88af42 100644
--- a/pkg/analysis_server/test/search/abstract_search_domain.dart
+++ b/pkg/analysis_server/test/search/abstract_search_domain.dart
@@ -6,8 +6,8 @@
 
 import 'dart:async';
 
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/constants.dart';
-import 'package:analysis_server/src/protocol.dart';
 import 'package:analysis_server/src/search/search_domain.dart';
 import 'package:analysis_server/src/services/index/index.dart' show Index;
 import 'package:analysis_server/src/services/index/local_memory_index.dart';
@@ -66,7 +66,13 @@
 
   String getPathString(List<Element> path) {
     return path.map((Element element) {
-      return '${element.kind.name} ${element.name}';
+      String kindName = element.kind.name;
+      String name = element.name;
+      if (name.isEmpty) {
+        return kindName;
+      } else {
+        return '$kindName $name';
+      }
     }).join('\n');
   }
 
diff --git a/pkg/analysis_server/test/search/element_references_test.dart b/pkg/analysis_server/test/search/element_references_test.dart
index dce6b8c..0ef1ccf 100644
--- a/pkg/analysis_server/test/search/element_references_test.dart
+++ b/pkg/analysis_server/test/search/element_references_test.dart
@@ -6,15 +6,16 @@
 
 import 'dart:async';
 
-import 'package:analysis_server/src/protocol.dart';
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/services/index/index.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 import 'package:unittest/unittest.dart';
 
+import '../utils.dart';
 import 'abstract_search_domain.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(ElementReferencesTest);
   defineReflectiveTests(_NoSearchEngine);
 }
@@ -221,6 +222,178 @@
     assertHasResult(SearchResultKind.READ, 'fff); // in m()');
   }
 
+  test_file_libraryUnit_atImportDirective() async {
+    String fileLib = '$testFolder/my_lib.dart';
+    String fileUser = '$testFolder/userA.dart';
+    String codeUser = "import 'my_lib.dart'; // U";
+    addFile(fileLib, 'library my.lib;');
+    addFile(fileUser, codeUser);
+    addTestFile('''
+import 'my_lib.dart'; // T
+''');
+    await findElementReferences('import ', false);
+    expect(searchElement.kind, ElementKind.FILE);
+    expect(results, hasLength(2));
+    // in U
+    {
+      SearchResult result = results.singleWhere((result) {
+        return result.location.file == fileUser;
+      });
+      expect(result.location.offset, codeUser.indexOf("'my_lib.dart'; // U"));
+      expect(result.location.length, "'my_lib.dart'".length);
+    }
+    // in T
+    {
+      SearchResult result = results.singleWhere((result) {
+        return result.location.file == testFile;
+      });
+      expect(result.location.offset, testCode.indexOf("'my_lib.dart'; // T"));
+      expect(result.location.length, "'my_lib.dart'".length);
+    }
+  }
+
+  test_file_libraryUnit_atImportDirectiveUri() async {
+    String fileLib = '$testFolder/my_lib.dart';
+    String fileA = '$testFolder/userA.dart';
+    String fileB = '$testFolder/userB.dart';
+    String codeA = "import 'my_lib.dart'; // A";
+    String codeB = "export 'my_lib.dart'; // B";
+    addFile(fileLib, 'library my.lib;');
+    addFile(fileA, codeA);
+    addFile(fileB, codeB);
+    addTestFile('''
+import 'my_lib.dart'; // T
+''');
+    await findElementReferences('my_', false);
+    expect(searchElement.kind, ElementKind.FILE);
+    expect(results, hasLength(3));
+    // in A
+    {
+      SearchResult result = results.singleWhere((result) {
+        return result.location.file == fileA;
+      });
+      expect(result.location.offset, codeA.indexOf("'my_lib.dart'; // A"));
+      expect(result.location.length, "'my_lib.dart'".length);
+    }
+    // in B
+    {
+      SearchResult result = results.singleWhere((result) {
+        return result.location.file == fileB;
+      });
+      expect(result.location.offset, codeB.indexOf("'my_lib.dart'; // B"));
+      expect(result.location.length, "'my_lib.dart'".length);
+    }
+    // in T
+    {
+      SearchResult result = results.singleWhere((result) {
+        return result.location.file == testFile;
+      });
+      expect(result.location.offset, testCode.indexOf("'my_lib.dart'; // T"));
+      expect(result.location.length, "'my_lib.dart'".length);
+    }
+  }
+
+  test_file_libraryUnit_atLibraryDirectiveIdentifier() async {
+    String fileA = '$testFolder/userA.dart';
+    String fileB = '$testFolder/userB.dart';
+    String codeA = "import 'test.dart'; // A";
+    String codeB = "export 'test.dart'; // B";
+    addFile(fileA, codeA);
+    addFile(fileB, codeB);
+    addTestFile('''
+library my.test.lib;
+''');
+    await findElementReferences('test.', false);
+    expect(searchElement.kind, ElementKind.LIBRARY);
+    expect(results, hasLength(2));
+    // in A
+    {
+      SearchResult result = results.singleWhere((result) {
+        return result.location.file == fileA;
+      });
+      expect(result.location.offset, codeA.indexOf("'test.dart'; // A"));
+      expect(result.location.length, "'test.dart'".length);
+    }
+    // in B
+    {
+      SearchResult result = results.singleWhere((result) {
+        return result.location.file == fileB;
+      });
+      expect(result.location.offset, codeB.indexOf("'test.dart'; // B"));
+      expect(result.location.length, "'test.dart'".length);
+    }
+  }
+
+  test_file_partUnit_atPartDirective() async {
+    String filePart = '$testFolder/my_part.dart';
+    String fileOther = '$testFolder/userOther.dart';
+    String codeOther = '''
+library lib;
+part 'my_part.dart'; // O
+''';
+    addFile(filePart, 'part of lib;');
+    addFile(fileOther, codeOther);
+    addTestFile('''
+library lib;
+part 'my_part.dart'; // T
+''');
+    await findElementReferences('part ', false);
+    expect(searchElement.kind, ElementKind.FILE);
+    expect(searchElement.name, filePart);
+    expect(results, hasLength(2));
+    // in O
+    {
+      SearchResult result = results.singleWhere((result) {
+        return result.location.file == fileOther;
+      });
+      expect(result.location.offset, codeOther.indexOf("'my_part.dart'; // O"));
+      expect(result.location.length, "'my_part.dart'".length);
+    }
+    // in T
+    {
+      SearchResult result = results.singleWhere((result) {
+        return result.location.file == testFile;
+      });
+      expect(result.location.offset, testCode.indexOf("'my_part.dart'; // T"));
+      expect(result.location.length, "'my_part.dart'".length);
+    }
+  }
+
+  test_file_partUnit_atPartDirectiveUri() async {
+    String filePart = '$testFolder/my_part.dart';
+    String fileOther = '$testFolder/userOther.dart';
+    String codeOther = '''
+library lib;
+part 'my_part.dart'; // O
+''';
+    addFile(filePart, 'part of lib;');
+    addFile(fileOther, codeOther);
+    addTestFile('''
+library lib;
+part 'my_part.dart'; // T
+''');
+    await findElementReferences('my_', false);
+    expect(searchElement.kind, ElementKind.FILE);
+    expect(searchElement.name, filePart);
+    expect(results, hasLength(2));
+    // in O
+    {
+      SearchResult result = results.singleWhere((result) {
+        return result.location.file == fileOther;
+      });
+      expect(result.location.offset, codeOther.indexOf("'my_part.dart'; // O"));
+      expect(result.location.length, "'my_part.dart'".length);
+    }
+    // in T
+    {
+      SearchResult result = results.singleWhere((result) {
+        return result.location.file == testFile;
+      });
+      expect(result.location.offset, testCode.indexOf("'my_part.dart'; // T"));
+      expect(result.location.length, "'my_part.dart'".length);
+    }
+  }
+
   test_function() async {
     addTestFile('''
 fff(p) {}
@@ -453,7 +626,9 @@
 ''');
     await findElementReferences('A {}', false);
     assertHasResult(SearchResultKind.REFERENCE, 'A a = null;');
-    expect(getPathString(result.path), '''
+    expect(
+        getPathString(result.path),
+        '''
 LOCAL_VARIABLE a
 CONSTRUCTOR named
 CLASS B
@@ -473,9 +648,11 @@
 ''');
     await findElementReferences('A {}', false);
     assertHasResult(SearchResultKind.REFERENCE, 'A a = null;');
-    expect(getPathString(result.path), '''
+    expect(
+        getPathString(result.path),
+        '''
 LOCAL_VARIABLE a
-CONSTRUCTOR 
+CONSTRUCTOR
 CLASS B
 COMPILATION_UNIT test.dart
 LIBRARY my_lib''');
@@ -491,7 +668,9 @@
 ''');
     await findElementReferences('A {}', false);
     assertHasResult(SearchResultKind.REFERENCE, 'A a = null;');
-    expect(getPathString(result.path), '''
+    expect(
+        getPathString(result.path),
+        '''
 LOCAL_VARIABLE a
 FUNCTION main
 COMPILATION_UNIT test.dart
@@ -601,18 +780,6 @@
     assertHasResult(SearchResultKind.REFERENCE, 'ppp.Stream');
   }
 
-  test_prefix_null() async {
-    addTestFile('''
-import 'dart:async';
-main() {
-  Future a;
-  Stream b;
-}
-''');
-    await findElementReferences("import ", false);
-    expect(searchElement, isNull);
-  }
-
   test_topLevelVariable_explicit() async {
     addTestFile('''
 var vvv = 1;
diff --git a/pkg/analysis_server/test/search/member_declarations_test.dart b/pkg/analysis_server/test/search/member_declarations_test.dart
index 849bb20..607e058 100644
--- a/pkg/analysis_server/test/search/member_declarations_test.dart
+++ b/pkg/analysis_server/test/search/member_declarations_test.dart
@@ -6,14 +6,15 @@
 
 import 'dart:async';
 
-import 'package:analysis_server/src/protocol.dart';
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 import 'package:unittest/unittest.dart';
 
+import '../utils.dart';
 import 'abstract_search_domain.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(MemberDeclarationsTest);
 }
 
diff --git a/pkg/analysis_server/test/search/member_references_test.dart b/pkg/analysis_server/test/search/member_references_test.dart
index 79f159d..ba65bcc 100644
--- a/pkg/analysis_server/test/search/member_references_test.dart
+++ b/pkg/analysis_server/test/search/member_references_test.dart
@@ -6,14 +6,15 @@
 
 import 'dart:async';
 
-import 'package:analysis_server/src/protocol.dart';
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 import 'package:unittest/unittest.dart';
 
+import '../utils.dart';
 import 'abstract_search_domain.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(MemberReferencesTest);
 }
 
diff --git a/pkg/analysis_server/test/search/search_result_test.dart b/pkg/analysis_server/test/search/search_result_test.dart
index 1b6f918..2f3ef07 100644
--- a/pkg/analysis_server/test/search/search_result_test.dart
+++ b/pkg/analysis_server/test/search/search_result_test.dart
@@ -9,8 +9,10 @@
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 import 'package:unittest/unittest.dart';
 
+import '../utils.dart';
+
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(SearchResultKindTest);
 }
 
diff --git a/pkg/analysis_server/test/search/test_all.dart b/pkg/analysis_server/test/search/test_all.dart
index 9818ebb..fc5de31 100644
--- a/pkg/analysis_server/test/search/test_all.dart
+++ b/pkg/analysis_server/test/search/test_all.dart
@@ -5,6 +5,7 @@
 
 import 'package:unittest/unittest.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;
@@ -16,7 +17,7 @@
  * Utility for manually running all tests.
  */
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   group('search', () {
     element_references_test.main();
     member_declarations.main();
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 96ef6c6..81fa08b 100644
--- a/pkg/analysis_server/test/search/top_level_declarations_test.dart
+++ b/pkg/analysis_server/test/search/top_level_declarations_test.dart
@@ -6,14 +6,15 @@
 
 import 'dart:async';
 
-import 'package:analysis_server/src/protocol.dart';
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 import 'package:unittest/unittest.dart';
 
+import '../utils.dart';
 import 'abstract_search_domain.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(TopLevelDeclarationsTest);
 }
 
diff --git a/pkg/analysis_server/test/search/type_hierarchy_test.dart b/pkg/analysis_server/test/search/type_hierarchy_test.dart
index ac45e26..1d6ddf9a 100644
--- a/pkg/analysis_server/test/search/type_hierarchy_test.dart
+++ b/pkg/analysis_server/test/search/type_hierarchy_test.dart
@@ -6,7 +6,7 @@
 
 import 'dart:async';
 
-import 'package:analysis_server/src/protocol.dart';
+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:analysis_server/src/services/index/local_memory_index.dart';
@@ -14,9 +14,10 @@
 import 'package:unittest/unittest.dart';
 
 import '../analysis_abstract.dart';
+import '../utils.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(GetTypeHierarchyTest);
 }
 
@@ -74,7 +75,7 @@
         'superclass': 1,
         'interfaces': [],
         'mixins': [],
-        'subclasses': []
+        'subclasses': [1]
       },
       {
         'classElement': {
@@ -86,7 +87,7 @@
         'superclass': 0,
         'interfaces': [],
         'mixins': [],
-        'subclasses': [1]
+        'subclasses': []
       }
     ]);
   }
@@ -106,16 +107,79 @@
     expect(itemA.displayName, 'A<int>');
   }
 
+  test_class_double_subclass() async {
+    addTestFile('''
+class AAA {} // A
+
+class BBB extends AAA {}
+
+class CCC extends BBB implements AAA {}
+''');
+    List<TypeHierarchyItem> items = await _getTypeHierarchy('AAA {} // A');
+    expect(_toJson(items), [
+      {
+        'classElement': {
+          'kind': 'CLASS',
+          'name': 'AAA',
+          'location': anything,
+          'flags': 0
+        },
+        'superclass': 1,
+        'interfaces': [],
+        'mixins': [],
+        'subclasses': [2, 3]
+      },
+      {
+        'classElement': {
+          'kind': 'CLASS',
+          'name': 'Object',
+          'location': anything,
+          'flags': 0
+        },
+        'interfaces': [],
+        'mixins': [],
+        'subclasses': []
+      },
+      {
+        'classElement': {
+          'kind': 'CLASS',
+          'name': 'CCC',
+          'location': anything,
+          'flags': 0
+        },
+        'superclass': 0,
+        'interfaces': [],
+        'mixins': [],
+        'subclasses': []
+      },
+      {
+        'classElement': {
+          'kind': 'CLASS',
+          'name': 'BBB',
+          'location': anything,
+          'flags': 0
+        },
+        'superclass': 0,
+        'interfaces': [],
+        'mixins': [],
+        'subclasses': [2]
+      }
+    ]);
+  }
+
   test_class_extends_fileAndPackageUris() async {
     // prepare packages
     String pkgFile = '/packages/pkgA/libA.dart';
-    resourceProvider.newFile(pkgFile, '''
+    resourceProvider.newFile(
+        pkgFile,
+        '''
 library lib_a;
 class A {}
 class B extends A {}
 ''');
-    packageMapProvider.packageMap['pkgA'] =
-        [resourceProvider.getResource('/packages/pkgA')];
+    packageMapProvider.packageMap['pkgA'] = [
+      resourceProvider.getResource('/packages/pkgA')
+    ];
     // reference the package from a project
     addTestFile('''
 import 'package:pkgA/libA.dart';
@@ -635,6 +699,56 @@
         itemD.memberElement.location.offset, findOffset('test() {} // in D'));
   }
 
+  test_member_ofMixin2_method() async {
+    addTestFile('''
+class M1 {
+  void test() {} // in M1
+}
+class M2 {
+  void test() {} // in M2
+}
+class D1 extends Object with M1 {}
+class D2 extends Object with M1, M2 {}
+class D3 extends Object with M2, M1 {}
+class D4 extends Object with M2, M1 {
+  void test() {} // in D4
+}
+''');
+    List<TypeHierarchyItem> items =
+        await _getTypeHierarchy('test() {} // in M1');
+    var itemM1 = items.firstWhere((e) => e.classElement.name == 'M1');
+    var item1 = items.firstWhere((e) => e.classElement.name == 'D1');
+    var item2 = items.firstWhere((e) => e.classElement.name == 'D2');
+    var item3 = items.firstWhere((e) => e.classElement.name == 'D3');
+    var item4 = items.firstWhere((e) => e.classElement.name == 'D4');
+    expect(itemM1, isNotNull);
+    expect(item1, isNotNull);
+    expect(item2, isNotNull);
+    expect(item3, isNotNull);
+    expect(item4, isNotNull);
+    // D1 does not override
+    {
+      Element member1 = item1.memberElement;
+      expect(member1, isNull);
+    }
+    // D2 mixes-in M2 last, which overrides
+    {
+      Element member2 = item2.memberElement;
+      expect(member2, isNotNull);
+      expect(member2.location.offset, findOffset('test() {} // in M2'));
+    }
+    // D3 mixes-in M1 last and does not override itself
+    {
+      Element member3 = item3.memberElement;
+      expect(member3, isNull);
+    }
+    // D4 mixes-in M1 last, but it also overrides
+    {
+      Element member4 = item4.memberElement;
+      expect(member4.location.offset, findOffset('test() {} // in D4'));
+    }
+  }
+
   test_member_ofMixin_getter() async {
     addTestFile('''
 abstract class Base {
@@ -787,18 +901,90 @@
         itemD.memberElement.location.offset, findOffset('test(x) {} // in D'));
   }
 
-  Request _createGetTypeHierarchyRequest(String search) {
-    return new SearchGetTypeHierarchyParams(testFile, findOffset(search))
-        .toRequest(requestId);
+  test_superOnly() async {
+    addTestFile('''
+class A {}
+class B {}
+class C extends A implements B {}
+class D extends C {}
+''');
+    List<TypeHierarchyItem> items =
+        await _getTypeHierarchy('C extends', superOnly: true);
+    expect(_toJson(items), [
+      {
+        'classElement': {
+          'kind': 'CLASS',
+          'name': 'C',
+          'location': anything,
+          'flags': 0
+        },
+        'superclass': 1,
+        'interfaces': [3],
+        'mixins': [],
+        'subclasses': []
+      },
+      {
+        'classElement': {
+          'kind': 'CLASS',
+          'name': 'A',
+          'location': anything,
+          'flags': 0
+        },
+        'superclass': 2,
+        'interfaces': [],
+        'mixins': [],
+        'subclasses': []
+      },
+      {
+        'classElement': {
+          'kind': 'CLASS',
+          'name': 'Object',
+          'location': anything,
+          'flags': 0
+        },
+        'interfaces': [],
+        'mixins': [],
+        'subclasses': []
+      },
+      {
+        'classElement': {
+          'kind': 'CLASS',
+          'name': 'B',
+          'location': anything,
+          'flags': 0
+        },
+        'superclass': 2,
+        'interfaces': [],
+        'mixins': [],
+        'subclasses': []
+      }
+    ]);
   }
 
-  Future<List<TypeHierarchyItem>> _getTypeHierarchy(String search) async {
+  test_superOnly_fileDoesNotExist() async {
+    Request request = new SearchGetTypeHierarchyParams(
+        '/does/not/exist.dart', 0,
+        superOnly: true).toRequest(requestId);
+    Response response = await serverChannel.sendRequest(request);
+    List<TypeHierarchyItem> items =
+        new SearchGetTypeHierarchyResult.fromResponse(response).hierarchyItems;
+    expect(items, isNull);
+  }
+
+  Request _createGetTypeHierarchyRequest(String search, {bool superOnly}) {
+    return new SearchGetTypeHierarchyParams(testFile, findOffset(search),
+        superOnly: superOnly).toRequest(requestId);
+  }
+
+  Future<List<TypeHierarchyItem>> _getTypeHierarchy(String search,
+      {bool superOnly}) async {
     await waitForTasksFinished();
-    Request request = _createGetTypeHierarchyRequest(search);
+    Request request =
+        _createGetTypeHierarchyRequest(search, superOnly: superOnly);
     Response response = await serverChannel.sendRequest(request);
     expect(serverErrors, isEmpty);
-    return new SearchGetTypeHierarchyResult.fromResponse(
-        response).hierarchyItems;
+    return new SearchGetTypeHierarchyResult.fromResponse(response)
+        .hierarchyItems;
   }
 
   List _toJson(List<TypeHierarchyItem> items) {
diff --git a/pkg/analysis_server/test/server_options_test.dart b/pkg/analysis_server/test/server_options_test.dart
index f3a3790..4a32152 100644
--- a/pkg/analysis_server/test/server_options_test.dart
+++ b/pkg/analysis_server/test/server_options_test.dart
@@ -10,8 +10,10 @@
 import 'package:analysis_server/src/server_options.dart';
 import 'package:unittest/unittest.dart';
 
+import 'utils.dart';
+
 void main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
 
   group('server_options', () {
     test('basic - []', () {
diff --git a/pkg/analysis_server/test/services/completion/arglist_contributor_test.dart b/pkg/analysis_server/test/services/completion/arglist_contributor_test.dart
index 5218204..9bb8aa7 100644
--- a/pkg/analysis_server/test/services/completion/arglist_contributor_test.dart
+++ b/pkg/analysis_server/test/services/completion/arglist_contributor_test.dart
@@ -4,16 +4,17 @@
 
 library test.services.completion.dart.arglist;
 
-import 'package:analysis_server/src/protocol.dart';
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/services/completion/arglist_contributor.dart';
 import 'package:analysis_server/src/services/completion/dart_completion_manager.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 import 'package:unittest/unittest.dart';
 
+import '../../utils.dart';
 import 'completion_test_util.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(ArgListContributorTest);
 }
 
@@ -41,8 +42,10 @@
     assertNoOtherSuggestions([cs]);
   }
 
-  void assertSuggestArgumentList_params(List<String> expectedNames,
-      List<String> expectedTypes, List<String> actualNames,
+  void assertSuggestArgumentList_params(
+      List<String> expectedNames,
+      List<String> expectedTypes,
+      List<String> actualNames,
       List<String> actualTypes) {
     if (actualNames != null &&
         actualNames.length == expectedNames.length &&
@@ -87,6 +90,17 @@
     contributor = new ArgListContributor();
   }
 
+  test_Annotation_local_constructor_named_param() {
+    //
+    addTestSource('''
+class A { A({int one, String two: 'defaultValue'}) { } }
+@A(^) main() { }''');
+    computeFast();
+    return computeFull((bool result) {
+      assertSuggestArguments(namedArguments: ['one', 'two']);
+    });
+  }
+
   test_ArgumentList_getter() {
     addTestSource('class A {int get foo => 7; main() {foo(^)}');
     computeFast();
@@ -95,9 +109,31 @@
     });
   }
 
+  test_ArgumentList_imported_constructor_named_param() {
+    //
+    addSource('/libA.dart', 'library libA; class A{A({int one}){}}');
+    addTestSource('import "/libA.dart"; main() { new A(^);}');
+    computeFast();
+    return computeFull((bool result) {
+      assertSuggestArguments(namedArguments: ['one']);
+    });
+  }
+
+  test_ArgumentList_imported_constructor_named_param2() {
+    //
+    addSource('/libA.dart', 'library libA; class A{A.foo({int one}){}}');
+    addTestSource('import "/libA.dart"; main() { new A.foo(^);}');
+    computeFast();
+    return computeFull((bool result) {
+      assertSuggestArguments(namedArguments: ['one']);
+    });
+  }
+
   test_ArgumentList_imported_function_0() {
     // ArgumentList  MethodInvocation  ExpressionStatement  Block
-    addSource('/libA.dart', '''
+    addSource(
+        '/libA.dart',
+        '''
       library A;
       bool hasLength(int expected) { }
       expect() { }
@@ -115,7 +151,9 @@
 
   test_ArgumentList_imported_function_1() {
     // ArgumentList  MethodInvocation  ExpressionStatement  Block
-    addSource('/libA.dart', '''
+    addSource(
+        '/libA.dart',
+        '''
       library A;
       bool hasLength(int expected) { }
       expect(String arg) { }
@@ -133,7 +171,9 @@
 
   test_ArgumentList_imported_function_2() {
     // ArgumentList  MethodInvocation  ExpressionStatement  Block
-    addSource('/libA.dart', '''
+    addSource(
+        '/libA.dart',
+        '''
       library A;
       bool hasLength(int expected) { }
       expect(String arg1, int arg2) { }
@@ -151,7 +191,9 @@
 
   test_ArgumentList_imported_function_3() {
     // ArgumentList  MethodInvocation  ExpressionStatement  Block
-    addSource('/libA.dart', '''
+    addSource(
+        '/libA.dart',
+        '''
       library A;
       bool hasLength(int expected) { }
       expect(String arg1, int arg2, {bool arg3}) { }
@@ -169,7 +211,9 @@
 
   test_ArgumentList_imported_function_3a() {
     // ArgumentList  MethodInvocation  ExpressionStatement  Block
-    addSource('/libA.dart', '''
+    addSource(
+        '/libA.dart',
+        '''
       library A;
       bool hasLength(int expected) { }
       expect(String arg1, int arg2, {bool arg3}) { }
@@ -187,7 +231,9 @@
 
   test_ArgumentList_imported_function_3b() {
     // ArgumentList  MethodInvocation  ExpressionStatement  Block
-    addSource('/libA.dart', '''
+    addSource(
+        '/libA.dart',
+        '''
       library A;
       bool hasLength(int expected) { }
       expect(String arg1, int arg2, {bool arg3}) { }
@@ -205,7 +251,9 @@
 
   test_ArgumentList_imported_function_3c() {
     // ArgumentList  MethodInvocation  ExpressionStatement  Block
-    addSource('/libA.dart', '''
+    addSource(
+        '/libA.dart',
+        '''
       library A;
       bool hasLength(int expected) { }
       expect(String arg1, int arg2, {bool arg3}) { }
@@ -223,7 +271,9 @@
 
   test_ArgumentList_imported_function_3d() {
     // ArgumentList  MethodInvocation  ExpressionStatement  Block
-    addSource('/libA.dart', '''
+    addSource(
+        '/libA.dart',
+        '''
       library A;
       bool hasLength(int expected) { }
       expect(String arg1, int arg2, {bool arg3}) { }
@@ -275,6 +325,28 @@
     });
   }
 
+  test_ArgumentList_local_constructor_named_param() {
+    //
+    addTestSource('''
+class A { A({int one, String two: 'defaultValue'}) { } }
+main() { new A(^);}''');
+    computeFast();
+    return computeFull((bool result) {
+      assertSuggestArguments(namedArguments: ['one', 'two']);
+    });
+  }
+
+  test_ArgumentList_local_constructor_named_param2() {
+    //
+    addTestSource('''
+class A { A.foo({int one, String two: 'defaultValue'}) { } }
+main() { new A.foo(^);}''');
+    computeFast();
+    return computeFull((bool result) {
+      assertSuggestArguments(namedArguments: ['one', 'two']);
+    });
+  }
+
   test_ArgumentList_local_function_1() {
     // ArgumentList  MethodInvocation  ExpressionStatement  Block
     addTestSource('''
@@ -419,7 +491,9 @@
 
   test_ArgumentList_local_method_0() {
     // ArgumentList  MethodInvocation  ExpressionStatement  Block
-    addSource('/libA.dart', '''
+    addSource(
+        '/libA.dart',
+        '''
       library A;
       bool hasLength(int expected) { }
       void baz() { }''');
@@ -437,7 +511,9 @@
 
   test_ArgumentList_local_method_2() {
     // ArgumentList  MethodInvocation  ExpressionStatement  Block
-    addSource('/libA.dart', '''
+    addSource(
+        '/libA.dart',
+        '''
       library A;
       bool hasLength(int expected) { }
       void baz() { }''');
diff --git a/pkg/analysis_server/test/services/completion/combinator_contributor_test.dart b/pkg/analysis_server/test/services/completion/combinator_contributor_test.dart
index 60e402c..f0698a0 100644
--- a/pkg/analysis_server/test/services/completion/combinator_contributor_test.dart
+++ b/pkg/analysis_server/test/services/completion/combinator_contributor_test.dart
@@ -4,16 +4,16 @@
 
 library test.services.completion.dart.combinator;
 
-import 'package:analysis_server/src/protocol.dart';
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/services/completion/combinator_contributor.dart';
 import 'package:analysis_server/src/services/completion/dart_completion_manager.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
+import '../../utils.dart';
 import 'completion_test_util.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(CombinatorContributorTest);
 }
 
@@ -40,17 +40,23 @@
 
   test_Combinator_hide() {
     // SimpleIdentifier  HideCombinator  ImportDirective
-    addSource('/testAB.dart', '''
+    addSource(
+        '/testAB.dart',
+        '''
       library libAB;
       part '/partAB.dart';
       class A { }
       class B { }''');
-    addSource('/partAB.dart', '''
+    addSource(
+        '/partAB.dart',
+        '''
       part of libAB;
       var T1;
       PB F1() => new PB();
       class PB { }''');
-    addSource('/testCD.dart', '''
+    addSource(
+        '/testCD.dart',
+        '''
       class C { }
       class D { }''');
     addTestSource('''
@@ -81,19 +87,25 @@
 
   test_Combinator_show() {
     // SimpleIdentifier  HideCombinator  ImportDirective
-    addSource('/testAB.dart', '''
+    addSource(
+        '/testAB.dart',
+        '''
       library libAB;
       part '/partAB.dart';
       class A { }
       class B { }''');
-    addSource('/partAB.dart', '''
+    addSource(
+        '/partAB.dart',
+        '''
       part of libAB;
       var T1;
       PB F1() => new PB();
       typedef PB2 F2(int blat);
       class Clz = Object with Object;
       class PB { }''');
-    addSource('/testCD.dart', '''
+    addSource(
+        '/testCD.dart',
+        '''
       class C { }
       class D { }''');
     addTestSource('''
diff --git a/pkg/analysis_server/test/services/completion/common_usage_computer_test.dart b/pkg/analysis_server/test/services/completion/common_usage_computer_test.dart
index 9a46aac..3e15f2e 100644
--- a/pkg/analysis_server/test/services/completion/common_usage_computer_test.dart
+++ b/pkg/analysis_server/test/services/completion/common_usage_computer_test.dart
@@ -6,11 +6,11 @@
 
 import 'dart:async';
 
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/analysis_server.dart'
     show ContextSourcePair;
 import 'package:analysis_server/src/constants.dart';
 import 'package:analysis_server/src/domain_completion.dart';
-import 'package:analysis_server/src/protocol.dart';
 import 'package:analysis_server/src/services/completion/common_usage_computer.dart';
 import 'package:analysis_server/src/services/completion/dart_completion_cache.dart';
 import 'package:analysis_server/src/services/completion/dart_completion_manager.dart';
@@ -23,9 +23,10 @@
 
 import '../../analysis_abstract.dart';
 import '../../mocks.dart';
+import '../../utils.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(CommonUsageComputerTest);
 }
 
@@ -48,7 +49,8 @@
   }
 
   void assertHasResult(CompletionSuggestionKind kind, String completion,
-      [int relevance = DART_RELEVANCE_DEFAULT, bool isDeprecated = false,
+      [int relevance = DART_RELEVANCE_DEFAULT,
+      bool isDeprecated = false,
       bool isPotential = false]) {
     var cs;
     suggestions.forEach((s) {
@@ -99,9 +101,13 @@
     ContextSourcePair contextSource = server.getContextSourcePair(params.file);
     AnalysisContext context = contextSource.context;
     Source source = contextSource.source;
-    DartCompletionManager completionManager = new DartCompletionManager(context,
-        server.searchEngine, source, new DartCompletionCache(context, source),
-        null, new CommonUsageComputer(selectorRelevance));
+    DartCompletionManager completionManager = new DartCompletionManager(
+        context,
+        server.searchEngine,
+        source,
+        new DartCompletionCache(context, source),
+        null,
+        new CommonUsageComputer(selectorRelevance));
 
     Response response =
         domainHandler.processRequest(request, completionManager);
@@ -137,7 +143,9 @@
   test_ConstructorName() async {
     // SimpleIdentifier  ConstructorName  InstanceCreationExpression
     addTestFile('import "dart:async"; class A {x() {new Future.^}}');
-    await getSuggestions({'dart.async.Future': ['value', 'wait']});
+    await getSuggestions({
+      'dart.async.Future': ['value', 'wait']
+    });
     expect(replacementOffset, equals(completionOffset));
     expect(replacementLength, equals(0));
     assertHasResult(CompletionSuggestionKind.INVOCATION, 'delayed');
@@ -151,7 +159,9 @@
   test_PrefixedIdentifier_field() async {
     // SimpleIdentifier  PrefixedIdentifeir  ExpressionStatement
     addTestFile('class A {static int s1; static int s2; x() {A.^}}');
-    await getSuggestions({'.A': ['s2']});
+    await getSuggestions({
+      '.A': ['s2']
+    });
     expect(replacementOffset, equals(completionOffset));
     expect(replacementLength, equals(0));
     assertHasResult(CompletionSuggestionKind.INVOCATION, 's1');
@@ -165,7 +175,9 @@
   test_PrefixedIdentifier_getter() async {
     // SimpleIdentifier  PrefixedIdentifeir  ExpressionStatement
     addTestFile('class A {int get g1 => 1; int get g2 => 2; x() {new A().^}}');
-    await getSuggestions({'.A': ['g2']});
+    await getSuggestions({
+      '.A': ['g2']
+    });
     expect(replacementOffset, equals(completionOffset));
     expect(replacementLength, equals(0));
     assertHasResult(CompletionSuggestionKind.INVOCATION, 'g1');
@@ -179,7 +191,9 @@
   test_PrefixedIdentifier_setter() async {
     // SimpleIdentifier  PrefixedIdentifeir  ExpressionStatement
     addTestFile('class A {set s1(v) {}; set s2(v) {}; x() {new A().^}}');
-    await getSuggestions({'.A': ['s2']});
+    await getSuggestions({
+      '.A': ['s2']
+    });
     expect(replacementOffset, equals(completionOffset));
     expect(replacementLength, equals(0));
     assertHasResult(CompletionSuggestionKind.INVOCATION, 's1');
@@ -193,7 +207,9 @@
   test_PrefixedIdentifier_static_method() async {
     // SimpleIdentifier  PrefixedIdentifeir  ExpressionStatement
     addTestFile('import "dart:async"; class A {x() {Future.^}}');
-    await getSuggestions({'dart.async.Future': ['value', 'wait']});
+    await getSuggestions({
+      'dart.async.Future': ['value', 'wait']
+    });
     expect(replacementOffset, equals(completionOffset));
     expect(replacementLength, equals(0));
     assertHasResult(CompletionSuggestionKind.INVOCATION, 'wait',
@@ -206,7 +222,9 @@
   test_PropertyAccess() async {
     // SimpleIdentifier  PropertyAccess  ExpressionStatement
     addTestFile('import "dart:math"; class A {x() {new Random().^}}');
-    await getSuggestions({'dart.math.Random': ['nextInt', 'nextDouble']});
+    await getSuggestions({
+      'dart.math.Random': ['nextInt', 'nextDouble']
+    });
     expect(replacementOffset, equals(completionOffset));
     expect(replacementLength, equals(0));
     assertHasResult(CompletionSuggestionKind.INVOCATION, 'nextBool');
diff --git a/pkg/analysis_server/test/services/completion/completion_computer_test.dart b/pkg/analysis_server/test/services/completion/completion_computer_test.dart
index e69eaba..21b3393 100644
--- a/pkg/analysis_server/test/services/completion/completion_computer_test.dart
+++ b/pkg/analysis_server/test/services/completion/completion_computer_test.dart
@@ -6,10 +6,10 @@
 
 import 'dart:async';
 
-import 'package:analysis_server/completion/completion_core.dart'
-    show CompletionRequest, CompletionResult;
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/analysis_server.dart';
-import 'package:analysis_server/src/protocol.dart';
+import 'package:analysis_server/src/provisional/completion/completion_core.dart'
+    show CompletionRequest, CompletionResult;
 import 'package:analysis_server/src/services/completion/completion_manager.dart';
 import 'package:analysis_server/src/services/completion/dart_completion_manager.dart';
 import 'package:analysis_server/src/services/index/index.dart';
@@ -23,9 +23,10 @@
 
 import '../../abstract_single_unit.dart';
 import '../../operation/operation_queue_test.dart';
+import '../../utils.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(DartCompletionManagerTest);
 }
 
@@ -89,31 +90,30 @@
     CompletionRequest completionRequest =
         new CompletionRequestImpl(server, context, source, 0);
     manager.results(completionRequest).listen((CompletionResult r) {
+      bool isLast = r is CompletionResultImpl ? r.isLast : true;
       switch (++count) {
         case 1:
           contributor1.assertCalls(context, source, 0, searchEngine);
+          expect(contributor1.fastCount, equals(1));
+          expect(contributor1.fullCount, equals(0));
           contributor2.assertCalls(context, source, 0, searchEngine);
-          expect(r.isLast, isFalse);
-          expect(r.suggestions, hasLength(1));
-          expect(r.suggestions, contains(suggestion1));
-          resolveLibrary();
-          break;
-        case 2:
-          contributor1.assertFull(0);
-          contributor2.assertFull(1);
-          expect(r.isLast, isTrue);
+          expect(contributor2.fastCount, equals(1));
+          expect(contributor2.fullCount, equals(1));
+          expect(isLast, isTrue);
           expect(r.suggestions, hasLength(2));
           expect(r.suggestions, contains(suggestion1));
           expect(r.suggestions, contains(suggestion2));
+          resolveLibrary();
           break;
         default:
           fail('unexpected');
       }
     }, onDone: () {
       done = true;
-      expect(count, equals(2));
+      // There is only one notification
+      expect(count, equals(1));
     });
-    return pumpEventQueue().then((_) {
+    return pumpEventQueue(150).then((_) {
       expect(done, isTrue);
     });
   }
@@ -128,11 +128,16 @@
     CompletionRequest completionRequest =
         new CompletionRequestImpl(server, context, source, 0);
     manager.results(completionRequest).listen((CompletionResult r) {
+      bool isLast = r is CompletionResultImpl ? r.isLast : true;
       switch (++count) {
         case 1:
           contributor1.assertCalls(context, source, 0, searchEngine);
+          expect(contributor1.fastCount, equals(1));
+          expect(contributor1.fullCount, equals(0));
           contributor2.assertCalls(context, source, 0, searchEngine);
-          expect(r.isLast, isTrue);
+          expect(contributor2.fastCount, equals(1));
+          expect(contributor2.fullCount, equals(0));
+          expect(isLast, isTrue);
           expect(r.suggestions, hasLength(2));
           expect(r.suggestions, contains(suggestion1));
           expect(r.suggestions, contains(suggestion2));
@@ -173,8 +178,6 @@
     expect(request.source, equals(source));
     expect(request.offset, equals(offset));
     expect(request.searchEngine, equals(searchEngine));
-    expect(this.fastCount, equals(1));
-    expect(this.fullCount, equals(0));
   }
 
   assertFull(int fullCount) {
diff --git a/pkg/analysis_server/test/services/completion/completion_manager_test.dart b/pkg/analysis_server/test/services/completion/completion_manager_test.dart
index 9efd78c..eab5223 100644
--- a/pkg/analysis_server/test/services/completion/completion_manager_test.dart
+++ b/pkg/analysis_server/test/services/completion/completion_manager_test.dart
@@ -11,9 +11,10 @@
 import 'package:unittest/unittest.dart';
 
 import '../../abstract_context.dart';
+import '../../utils.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(CompletionManagerTest);
 }
 
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 072f97c..169874b 100644
--- a/pkg/analysis_server/test/services/completion/completion_target_test.dart
+++ b/pkg/analysis_server/test/services/completion/completion_target_test.dart
@@ -4,16 +4,17 @@
 
 library test.services.completion.target;
 
-import 'package:analysis_server/src/services/completion/completion_target.dart';
+import 'package:analysis_server/src/provisional/completion/dart/completion_target.dart';
 import 'package:analyzer/src/generated/ast.dart';
 import 'package:analyzer/src/generated/source.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 import 'package:unittest/unittest.dart';
 
 import '../../abstract_context.dart';
+import '../../utils.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(CompletionTargetTest);
 }
 
@@ -138,6 +139,16 @@
     assertTarget('}', '{}');
   }
 
+  test_Block_keyword() {
+    addTestSource('class C { static C get instance => null; } main() {C.in^}');
+    assertTarget('in', 'C.in');
+  }
+
+  test_Block_keyword2() {
+    addTestSource('class C { static C get instance => null; } main() {C.i^n}');
+    assertTarget('in', 'C.in');
+  }
+
   test_FormalParameter_partialType() {
     // SimpleIdentifier  PrefixedIdentifier  TypeName
     addTestSource('foo(b.^ f) { }');
diff --git a/pkg/analysis_server/test/services/completion/completion_test_util.dart b/pkg/analysis_server/test/services/completion/completion_test_util.dart
index 6bcbce1..a533731 100644
--- a/pkg/analysis_server/test/services/completion/completion_test_util.dart
+++ b/pkg/analysis_server/test/services/completion/completion_test_util.dart
@@ -6,13 +6,14 @@
 
 import 'dart:async';
 
-import 'package:analysis_server/src/analysis_server.dart';
-import 'package:analysis_server/src/protocol.dart' as protocol
+import 'package:analysis_server/plugin/protocol/protocol.dart' as protocol
     show Element, ElementKind;
-import 'package:analysis_server/src/protocol.dart' hide Element, ElementKind;
+import 'package:analysis_server/plugin/protocol/protocol.dart'
+    hide Element, ElementKind;
+import 'package:analysis_server/src/analysis_server.dart';
+import 'package:analysis_server/src/provisional/completion/dart/completion_target.dart';
 import 'package:analysis_server/src/services/completion/common_usage_computer.dart';
 import 'package:analysis_server/src/services/completion/completion_manager.dart';
-import 'package:analysis_server/src/services/completion/completion_target.dart';
 import 'package:analysis_server/src/services/completion/dart_completion_cache.dart';
 import 'package:analysis_server/src/services/completion/dart_completion_manager.dart';
 import 'package:analysis_server/src/services/completion/imported_reference_contributor.dart';
@@ -52,7 +53,7 @@
   void addResolvedUnit(String file, String code) {
     Source source = addSource(file, code);
     CompilationUnit unit = resolveLibraryUnit(source);
-    index.indexUnit(context, unit);
+    index.index(context, unit);
   }
 
   void addTestSource(String content) {
@@ -95,7 +96,8 @@
       return;
     }
     CompletionSuggestion suggestion = request.suggestions.firstWhere(
-        (CompletionSuggestion cs) => cs.kind == kind, orElse: () => null);
+        (CompletionSuggestion cs) => cs.kind == kind,
+        orElse: () => null);
     if (suggestion != null) {
       failedCompletion('did not expect completion: $completion\n  $suggestion');
     }
@@ -113,9 +115,13 @@
 
   CompletionSuggestion assertSuggest(String completion,
       {CompletionSuggestionKind csKind: CompletionSuggestionKind.INVOCATION,
-      int relevance: DART_RELEVANCE_DEFAULT, String importUri,
-      protocol.ElementKind elemKind: null, bool isDeprecated: false,
-      bool isPotential: false, String elemFile, int elemOffset}) {
+      int relevance: DART_RELEVANCE_DEFAULT,
+      String importUri,
+      protocol.ElementKind elemKind: null,
+      bool isDeprecated: false,
+      bool isPotential: false,
+      String elemFile,
+      int elemOffset}) {
     CompletionSuggestion cs =
         getSuggest(completion: completion, csKind: csKind, elemKind: elemKind);
     if (cs == null) {
@@ -151,9 +157,12 @@
   }
 
   CompletionSuggestion assertSuggestClass(String name,
-      {int relevance: DART_RELEVANCE_DEFAULT, String importUri,
+      {int relevance: DART_RELEVANCE_DEFAULT,
+      String importUri,
       CompletionSuggestionKind kind: CompletionSuggestionKind.INVOCATION,
-      bool isDeprecated: false, String elemFile, int elemOffset}) {
+      bool isDeprecated: false,
+      String elemFile,
+      int elemOffset}) {
     CompletionSuggestion cs = assertSuggest(name,
         csKind: kind,
         relevance: relevance,
@@ -187,7 +196,8 @@
   }
 
   CompletionSuggestion assertSuggestConstructor(String name,
-      {int relevance: DART_RELEVANCE_DEFAULT, String importUri,
+      {int relevance: DART_RELEVANCE_DEFAULT,
+      String importUri,
       int elemOffset}) {
     CompletionSuggestion cs = assertSuggest(name,
         relevance: relevance, importUri: importUri, elemOffset: elemOffset);
@@ -200,7 +210,8 @@
   }
 
   CompletionSuggestion assertSuggestField(String name, String type,
-      {int relevance: DART_RELEVANCE_DEFAULT, String importUri,
+      {int relevance: DART_RELEVANCE_DEFAULT,
+      String importUri,
       CompletionSuggestionKind kind: CompletionSuggestionKind.INVOCATION,
       bool isDeprecated: false}) {
     CompletionSuggestion cs = assertSuggest(name,
@@ -224,7 +235,8 @@
 
   CompletionSuggestion assertSuggestFunction(String name, String returnType,
       {CompletionSuggestionKind kind: CompletionSuggestionKind.INVOCATION,
-      bool deprecated: false, int relevance: DART_RELEVANCE_DEFAULT,
+      bool deprecated: false,
+      int relevance: DART_RELEVANCE_DEFAULT,
       String importUri}) {
     CompletionSuggestion cs = assertSuggest(name,
         csKind: kind,
@@ -276,7 +288,8 @@
   }
 
   CompletionSuggestion assertSuggestGetter(String name, String returnType,
-      {int relevance: DART_RELEVANCE_DEFAULT, String importUri,
+      {int relevance: DART_RELEVANCE_DEFAULT,
+      String importUri,
       CompletionSuggestionKind kind: CompletionSuggestionKind.INVOCATION,
       bool isDeprecated: false}) {
     CompletionSuggestion cs = assertSuggest(name,
@@ -323,7 +336,8 @@
 
   CompletionSuggestion assertSuggestMethod(
       String name, String declaringType, String returnType,
-      {int relevance: DART_RELEVANCE_DEFAULT, String importUri,
+      {int relevance: DART_RELEVANCE_DEFAULT,
+      String importUri,
       CompletionSuggestionKind kind: CompletionSuggestionKind.INVOCATION,
       bool isDeprecated: false}) {
     CompletionSuggestion cs = assertSuggest(name,
@@ -347,7 +361,8 @@
   }
 
   CompletionSuggestion assertSuggestNamedConstructor(
-      String name, String returnType, [int relevance = DART_RELEVANCE_DEFAULT,
+      String name, String returnType,
+      [int relevance = DART_RELEVANCE_DEFAULT,
       CompletionSuggestionKind kind = CompletionSuggestionKind.INVOCATION]) {
     if (contributor is PrefixedElementContributor) {
       CompletionSuggestion cs =
@@ -374,7 +389,8 @@
   }
 
   CompletionSuggestion assertSuggestSetter(String name,
-      [int relevance = DART_RELEVANCE_DEFAULT, String importUri,
+      [int relevance = DART_RELEVANCE_DEFAULT,
+      String importUri,
       CompletionSuggestionKind kind = CompletionSuggestionKind.INVOCATION]) {
     CompletionSuggestion cs = assertSuggest(name,
         csKind: kind,
@@ -469,7 +485,8 @@
     fail(sb.toString());
   }
 
-  CompletionSuggestion getSuggest({String completion: null,
+  CompletionSuggestion getSuggest(
+      {String completion: null,
       CompletionSuggestionKind csKind: null,
       protocol.ElementKind elemKind: null}) {
     CompletionSuggestion cs;
@@ -497,25 +514,23 @@
   }
 
   void resolve(bool fullAnalysis) {
-
     // Index SDK
     for (Source librarySource in context.librarySources) {
       CompilationUnit unit =
           context.getResolvedCompilationUnit2(librarySource, librarySource);
       if (unit != null) {
-        index.indexUnit(context, unit);
+        index.index(context, unit);
       }
     }
 
     var result = context.performAnalysisTask();
     bool resolved = false;
     while (result.hasMoreWork) {
-
       // Update the index
       result.changeNotices.forEach((ChangeNotice notice) {
         CompilationUnit unit = notice.resolvedDartUnit;
         if (unit != null) {
-          index.indexUnit(context, unit);
+          index.index(context, unit);
         }
       });
 
@@ -561,7 +576,6 @@
  * and `LocalContributorTest`.
  */
 abstract class AbstractSelectorSuggestionTest extends AbstractCompletionTest {
-
   /**
    * Assert that the ImportedReferenceContributor uses cached results
    * to produce identical suggestions to the original set of suggestions.
@@ -590,7 +604,8 @@
 
   CompletionSuggestion assertSuggestImportedClass(String name,
       {CompletionSuggestionKind kind: CompletionSuggestionKind.INVOCATION,
-      int relevance: DART_RELEVANCE_DEFAULT, String importUri,
+      int relevance: DART_RELEVANCE_DEFAULT,
+      String importUri,
       String elemFile}) {
     return assertNotSuggested(name);
   }
@@ -608,13 +623,15 @@
   CompletionSuggestion assertSuggestImportedFunction(
       String name, String returnType,
       {CompletionSuggestionKind kind: CompletionSuggestionKind.INVOCATION,
-      bool deprecated: false, int relevance: DART_RELEVANCE_DEFAULT,
+      bool deprecated: false,
+      int relevance: DART_RELEVANCE_DEFAULT,
       String importUri}) {
     return assertNotSuggested(name);
   }
 
   CompletionSuggestion assertSuggestImportedFunctionTypeAlias(
-      String name, String returnType, [bool isDeprecated = false,
+      String name, String returnType,
+      [bool isDeprecated = false,
       int relevance = DART_RELEVANCE_DEFAULT,
       CompletionSuggestionKind kind = CompletionSuggestionKind.INVOCATION]) {
     return assertNotSuggested(name);
@@ -638,7 +655,8 @@
   }
 
   CompletionSuggestion assertSuggestImportedTopLevelVar(
-      String name, String returnType, [int relevance = DART_RELEVANCE_DEFAULT,
+      String name, String returnType,
+      [int relevance = DART_RELEVANCE_DEFAULT,
       CompletionSuggestionKind kind = CompletionSuggestionKind.INVOCATION,
       String importUri]) {
     return assertNotSuggested(name);
@@ -701,8 +719,10 @@
 
   CompletionSuggestion assertSuggestLocalClass(String name,
       {CompletionSuggestionKind kind: CompletionSuggestionKind.INVOCATION,
-      int relevance: DART_RELEVANCE_DEFAULT, bool isDeprecated: false,
-      String elemFile, int elemOffset}) {
+      int relevance: DART_RELEVANCE_DEFAULT,
+      bool isDeprecated: false,
+      String elemFile,
+      int elemOffset}) {
     return assertNotSuggested(name);
   }
 
@@ -722,7 +742,8 @@
   }
 
   CompletionSuggestion assertSuggestLocalFunction(
-      String name, String returnType, {bool deprecated: false,
+      String name, String returnType,
+      {bool deprecated: false,
       int relevance: DART_RELEVANCE_LOCAL_FUNCTION,
       CompletionSuggestionKind kind: CompletionSuggestionKind.INVOCATION}) {
     return assertNotSuggested(name);
@@ -776,7 +797,9 @@
 
   test_ArgumentList() {
     // ArgumentList  MethodInvocation  ExpressionStatement  Block
-    addSource('/libA.dart', '''
+    addSource(
+        '/libA.dart',
+        '''
       library A;
       bool hasLength(int expected) { }
       void baz() { }''');
@@ -803,7 +826,9 @@
 
   test_ArgumentList_imported_function() {
     // ArgumentList  MethodInvocation  ExpressionStatement  Block
-    addSource('/libA.dart', '''
+    addSource(
+        '/libA.dart',
+        '''
       library A;
       bool hasLength(int expected) { }
       expect(arg) { }
@@ -831,7 +856,9 @@
 
   test_ArgumentList_InstanceCreationExpression_functionalArg() {
     // ArgumentList  InstanceCreationExpression  ExpressionStatement  Block
-    addSource('/libA.dart', '''
+    addSource(
+        '/libA.dart',
+        '''
       library A;
       class A { A(f()) { } }
       bool hasLength(int expected) { }
@@ -866,7 +893,9 @@
 
   test_ArgumentList_InstanceCreationExpression_typedefArg() {
     // ArgumentList  InstanceCreationExpression  ExpressionStatement  Block
-    addSource('/libA.dart', '''
+    addSource(
+        '/libA.dart',
+        '''
       library A;
       typedef Funct();
       class A { A(Funct f) { } }
@@ -902,7 +931,9 @@
 
   test_ArgumentList_local_function() {
     // ArgumentList  MethodInvocation  ExpressionStatement  Block
-    addSource('/libA.dart', '''
+    addSource(
+        '/libA.dart',
+        '''
       library A;
       bool hasLength(int expected) { }
       void baz() { }''');
@@ -930,7 +961,9 @@
 
   test_ArgumentList_local_method() {
     // ArgumentList  MethodInvocation  ExpressionStatement  Block
-    addSource('/libA.dart', '''
+    addSource(
+        '/libA.dart',
+        '''
       library A;
       bool hasLength(int expected) { }
       void baz() { }''');
@@ -958,7 +991,9 @@
 
   test_ArgumentList_MethodInvocation_functionalArg() {
     // ArgumentList  MethodInvocation  ExpressionStatement  Block
-    addSource('/libA.dart', '''
+    addSource(
+        '/libA.dart',
+        '''
       library A;
       class A { A(f()) { } }
       bool hasLength(int expected) { }
@@ -993,7 +1028,9 @@
 
   test_ArgumentList_MethodInvocation_methodArg() {
     // ArgumentList  MethodInvocation  ExpressionStatement  Block
-    addSource('/libA.dart', '''
+    addSource(
+        '/libA.dart',
+        '''
       library A;
       class A { A(f()) { } }
       bool hasLength(int expected) { }
@@ -1026,7 +1063,9 @@
   test_ArgumentList_namedParam() {
     // SimpleIdentifier  NamedExpression  ArgumentList  MethodInvocation
     // ExpressionStatement
-    addSource('/libA.dart', '''
+    addSource(
+        '/libA.dart',
+        '''
       library A;
       bool hasLength(int expected) { }''');
     addTestSource('''
@@ -1225,21 +1264,29 @@
 
   test_Block() {
     // Block  BlockFunctionBody  MethodDeclaration
-    addSource('/testAB.dart', '''
+    addSource(
+        '/testAB.dart',
+        '''
       export "dart:math" hide max;
       class A {int x;}
       @deprecated D1() {int x;}
       class _B {boo() { partBoo() {}} }''');
-    addSource('/testCD.dart', '''
+    addSource(
+        '/testCD.dart',
+        '''
       String T1;
       var _T2;
       class C { }
       class D { }''');
-    addSource('/testEEF.dart', '''
+    addSource(
+        '/testEEF.dart',
+        '''
       class EE { }
       class F { }''');
     addSource('/testG.dart', 'class G { }');
-    addSource('/testH.dart', '''
+    addSource(
+        '/testH.dart',
+        '''
       class H { }
       int T3;
       var _T4;'''); // not imported
@@ -1311,7 +1358,8 @@
       //assertSuggestImportedTopLevelVar('T3', 'int', COMPLETION_RELEVANCE_LOW);
       assertNotSuggested('_T4');
       assertSuggestLocalTopLevelVar('T5', 'int');
-      assertSuggestLocalTopLevelVar('_T6', null);
+      assertSuggestLocalTopLevelVar('_T6', null,
+          relevance: DART_RELEVANCE_DEFAULT);
       assertNotSuggested('==');
       assertSuggestLocalGetter('T7', 'String');
       assertSuggestLocalSetter('T8');
@@ -1327,21 +1375,29 @@
 
   test_Block_final() {
     // Block  BlockFunctionBody  MethodDeclaration
-    addSource('/testAB.dart', '''
+    addSource(
+        '/testAB.dart',
+        '''
       export "dart:math" hide max;
       class A {int x;}
       @deprecated D1() {int x;}
       class _B {boo() { partBoo() {}} }''');
-    addSource('/testCD.dart', '''
+    addSource(
+        '/testCD.dart',
+        '''
       String T1;
       var _T2;
       class C { }
       class D { }''');
-    addSource('/testEEF.dart', '''
+    addSource(
+        '/testEEF.dart',
+        '''
       class EE { }
       class F { }''');
     addSource('/testG.dart', 'class G { }');
-    addSource('/testH.dart', '''
+    addSource(
+        '/testH.dart',
+        '''
       class H { }
       int T3;
       var _T4;'''); // not imported
@@ -1442,21 +1498,29 @@
 
   test_Block_final_final() {
     // Block  BlockFunctionBody  MethodDeclaration
-    addSource('/testAB.dart', '''
+    addSource(
+        '/testAB.dart',
+        '''
       export "dart:math" hide max;
       class A {int x;}
       @deprecated D1() {int x;}
       class _B {boo() { partBoo() {}} }''');
-    addSource('/testCD.dart', '''
+    addSource(
+        '/testCD.dart',
+        '''
       String T1;
       var _T2;
       class C { }
       class D { }''');
-    addSource('/testEEF.dart', '''
+    addSource(
+        '/testEEF.dart',
+        '''
       class EE { }
       class F { }''');
     addSource('/testG.dart', 'class G { }');
-    addSource('/testH.dart', '''
+    addSource(
+        '/testH.dart',
+        '''
       class H { }
       int T3;
       var _T4;'''); // not imported
@@ -1541,21 +1605,29 @@
 
   test_Block_final_var() {
     // Block  BlockFunctionBody  MethodDeclaration
-    addSource('/testAB.dart', '''
+    addSource(
+        '/testAB.dart',
+        '''
       export "dart:math" hide max;
       class A {int x;}
       @deprecated D1() {int x;}
       class _B {boo() { partBoo() {}} }''');
-    addSource('/testCD.dart', '''
+    addSource(
+        '/testCD.dart',
+        '''
       String T1;
       var _T2;
       class C { }
       class D { }''');
-    addSource('/testEEF.dart', '''
+    addSource(
+        '/testEEF.dart',
+        '''
       class EE { }
       class F { }''');
     addSource('/testG.dart', 'class G { }');
-    addSource('/testH.dart', '''
+    addSource(
+        '/testH.dart',
+        '''
       class H { }
       int T3;
       var _T4;'''); // not imported
@@ -1639,21 +1711,29 @@
   }
 
   test_Block_identifier_partial() {
-    addSource('/testAB.dart', '''
+    addSource(
+        '/testAB.dart',
+        '''
       export "dart:math" hide max;
       class A {int x;}
       @deprecated D1() {int x;}
       class _B { }''');
-    addSource('/testCD.dart', '''
+    addSource(
+        '/testCD.dart',
+        '''
       String T1;
       var _T2;
       class C { }
       class D { }''');
-    addSource('/testEEF.dart', '''
+    addSource(
+        '/testEEF.dart',
+        '''
       class EE { }
       class F { }''');
     addSource('/testG.dart', 'class G { }');
-    addSource('/testH.dart', '''
+    addSource(
+        '/testH.dart',
+        '''
       class H { }
       class D3 { }
       int T3;
@@ -1722,7 +1802,9 @@
 
   test_Block_inherited_imported() {
     // Block  BlockFunctionBody  MethodDeclaration  ClassDeclaration
-    addSource('/testB.dart', '''
+    addSource(
+        '/testB.dart',
+        '''
       lib B;
       class F { var f1; f2() { } get f3 => 0; set f4(fx) { } var _pf; }
       class E extends F { var e1; e2() { } }
@@ -1778,21 +1860,29 @@
   }
 
   test_Block_local_function() {
-    addSource('/testAB.dart', '''
+    addSource(
+        '/testAB.dart',
+        '''
       export "dart:math" hide max;
       class A {int x;}
       @deprecated D1() {int x;}
       class _B {boo() { partBoo() {}} }''');
-    addSource('/testCD.dart', '''
+    addSource(
+        '/testCD.dart',
+        '''
       String T1;
       var _T2;
       class C { }
       class D { }''');
-    addSource('/testEEF.dart', '''
+    addSource(
+        '/testEEF.dart',
+        '''
       class EE { }
       class F { }''');
     addSource('/testG.dart', 'class G { }');
-    addSource('/testH.dart', '''
+    addSource(
+        '/testH.dart',
+        '''
       class H { }
       int T3;
       var _T4;'''); // not imported
@@ -1851,7 +1941,9 @@
 
   test_CascadeExpression_selector1() {
     // PropertyAccess  CascadeExpression  ExpressionStatement  Block
-    addSource('/testB.dart', '''
+    addSource(
+        '/testB.dart',
+        '''
       class B { }''');
     addTestSource('''
       import "/testB.dart";
@@ -1877,7 +1969,9 @@
 
   test_CascadeExpression_selector2() {
     // SimpleIdentifier  PropertyAccess  CascadeExpression  ExpressionStatement
-    addSource('/testB.dart', '''
+    addSource(
+        '/testB.dart',
+        '''
       class B { }''');
     addTestSource('''
       import "/testB.dart";
@@ -1901,7 +1995,9 @@
 
   test_CascadeExpression_selector2_withTrailingReturn() {
     // PropertyAccess  CascadeExpression  ExpressionStatement  Block
-    addSource('/testB.dart', '''
+    addSource(
+        '/testB.dart',
+        '''
       class B { }''');
     addTestSource('''
       import "/testB.dart";
@@ -2002,7 +2098,9 @@
 
   test_ClassDeclaration_body() {
     // ClassDeclaration  CompilationUnit
-    addSource('/testB.dart', '''
+    addSource(
+        '/testB.dart',
+        '''
       class B { }''');
     addTestSource('''
       import "testB.dart" as x;
@@ -2036,7 +2134,9 @@
 
   test_ClassDeclaration_body_final() {
     // ClassDeclaration  CompilationUnit
-    addSource('/testB.dart', '''
+    addSource(
+        '/testB.dart',
+        '''
       class B { }''');
     addTestSource('''
       import "testB.dart" as x;
@@ -2055,9 +2155,57 @@
     });
   }
 
+  test_ClassDeclaration_body_final_field() {
+    // ClassDeclaration  CompilationUnit
+    addSource(
+        '/testB.dart',
+        '''
+      class B { }''');
+    addTestSource('''
+      import "testB.dart" as x;
+      class A {final ^ A(){}}
+      class _B {}
+      A T;''');
+    computeFast();
+    return computeFull((bool result) {
+      expect(request.replacementOffset, completionOffset);
+      expect(request.replacementLength, 0);
+      assertSuggestLocalClass('A');
+      assertSuggestLocalClass('_B');
+      assertSuggestImportedClass('String');
+      assertNotSuggested('T');
+      assertSuggestLibraryPrefix('x');
+    });
+  }
+
+  test_ClassDeclaration_body_final_field2() {
+    // ClassDeclaration  CompilationUnit
+    addSource(
+        '/testB.dart',
+        '''
+      class B { }''');
+    addTestSource('''
+      import "testB.dart" as Soo;
+      class A {final S^ A();}
+      class _B {}
+      A Sew;''');
+    computeFast();
+    return computeFull((bool result) {
+      expect(request.replacementOffset, completionOffset - 1);
+      expect(request.replacementLength, 1);
+      assertSuggestLocalClass('A');
+      assertSuggestLocalClass('_B');
+      assertSuggestImportedClass('String');
+      assertNotSuggested('Sew');
+      assertSuggestLibraryPrefix('Soo');
+    });
+  }
+
   test_ClassDeclaration_body_final_final() {
     // ClassDeclaration  CompilationUnit
-    addSource('/testB.dart', '''
+    addSource(
+        '/testB.dart',
+        '''
       class B { }''');
     addTestSource('''
       import "testB.dart" as x;
@@ -2078,7 +2226,9 @@
 
   test_ClassDeclaration_body_final_var() {
     // ClassDeclaration  CompilationUnit
-    addSource('/testB.dart', '''
+    addSource(
+        '/testB.dart',
+        '''
       class B { }''');
     addTestSource('''
       import "testB.dart" as x;
@@ -2099,17 +2249,23 @@
 
   test_Combinator_hide() {
     // SimpleIdentifier  HideCombinator  ImportDirective
-    addSource('/testAB.dart', '''
+    addSource(
+        '/testAB.dart',
+        '''
       library libAB;
       part '/partAB.dart';
       class A { }
       class B { }''');
-    addSource('/partAB.dart', '''
+    addSource(
+        '/partAB.dart',
+        '''
       part of libAB;
       var T1;
       PB F1() => new PB();
       class PB { }''');
-    addSource('/testCD.dart', '''
+    addSource(
+        '/testCD.dart',
+        '''
       class C { }
       class D { }''');
     addTestSource('''
@@ -2124,19 +2280,25 @@
 
   test_Combinator_show() {
     // SimpleIdentifier  HideCombinator  ImportDirective
-    addSource('/testAB.dart', '''
+    addSource(
+        '/testAB.dart',
+        '''
       library libAB;
       part '/partAB.dart';
       class A { }
       class B { }''');
-    addSource('/partAB.dart', '''
+    addSource(
+        '/partAB.dart',
+        '''
       part of libAB;
       var T1;
       PB F1() => new PB();
       typedef PB2 F2(int blat);
       class Clz = Object with Object;
       class PB { }''');
-    addSource('/testCD.dart', '''
+    addSource(
+        '/testCD.dart',
+        '''
       class C { }
       class D { }''');
     addTestSource('''
@@ -2151,7 +2313,9 @@
 
   test_ConditionalExpression_elseExpression() {
     // SimpleIdentifier  ConditionalExpression  ReturnStatement
-    addSource('/testA.dart', '''
+    addSource(
+        '/testA.dart',
+        '''
       int T1;
       F1() { }
       class A {int x;}''');
@@ -2172,7 +2336,9 @@
 
   test_ConditionalExpression_elseExpression_empty() {
     // SimpleIdentifier  ConditionalExpression  ReturnStatement
-    addSource('/testA.dart', '''
+    addSource(
+        '/testA.dart',
+        '''
       int T1;
       F1() { }
       class A {int x;}''');
@@ -2199,7 +2365,9 @@
 
   test_ConditionalExpression_partial_thenExpression() {
     // SimpleIdentifier  ConditionalExpression  ReturnStatement
-    addSource('/testA.dart', '''
+    addSource(
+        '/testA.dart',
+        '''
       int T1;
       F1() { }
       class A {int x;}''');
@@ -2220,7 +2388,9 @@
 
   test_ConditionalExpression_partial_thenExpression_empty() {
     // SimpleIdentifier  ConditionalExpression  ReturnStatement
-    addSource('/testA.dart', '''
+    addSource(
+        '/testA.dart',
+        '''
       int T1;
       F1() { }
       class A {int x;}''');
@@ -2247,7 +2417,9 @@
 
   test_ConditionalExpression_thenExpression() {
     // SimpleIdentifier  ConditionalExpression  ReturnStatement
-    addSource('/testA.dart', '''
+    addSource(
+        '/testA.dart',
+        '''
       int T1;
       F1() { }
       class A {int x;}''');
@@ -2269,7 +2441,9 @@
   test_ConstructorName_importedClass() {
     // SimpleIdentifier  PrefixedIdentifier  TypeName  ConstructorName
     // InstanceCreationExpression
-    addSource('/testB.dart', '''
+    addSource(
+        '/testB.dart',
+        '''
       lib B;
       int T1;
       F1() { }
@@ -2294,7 +2468,9 @@
   test_ConstructorName_importedFactory() {
     // SimpleIdentifier  PrefixedIdentifier  TypeName  ConstructorName
     // InstanceCreationExpression
-    addSource('/testB.dart', '''
+    addSource(
+        '/testB.dart',
+        '''
       lib B;
       int T1;
       F1() { }
@@ -2397,7 +2573,9 @@
 
   test_ExpressionStatement_identifier() {
     // SimpleIdentifier  ExpressionStatement  Block
-    addSource('/testA.dart', '''
+    addSource(
+        '/testA.dart',
+        '''
       _B F1() { }
       class A {int x;}
       class _B { }''');
@@ -2425,7 +2603,9 @@
 
   test_ExpressionStatement_name() {
     // ExpressionStatement  Block  BlockFunctionBody  MethodDeclaration
-    addSource('/testA.dart', '''
+    addSource(
+        '/testA.dart',
+        '''
       B T1;
       class B{}''');
     addTestSource('''
@@ -2632,7 +2812,9 @@
 
   test_FunctionDeclaration_returnType_afterComment() {
     // ClassDeclaration  CompilationUnit
-    addSource('/testA.dart', '''
+    addSource(
+        '/testA.dart',
+        '''
       int T1;
       F1() { }
       typedef D1();
@@ -2663,7 +2845,9 @@
 
   test_FunctionDeclaration_returnType_afterComment2() {
     // FunctionDeclaration  ClassDeclaration  CompilationUnit
-    addSource('/testA.dart', '''
+    addSource(
+        '/testA.dart',
+        '''
       int T1;
       F1() { }
       typedef D1();
@@ -2694,7 +2878,9 @@
 
   test_FunctionDeclaration_returnType_afterComment3() {
     // FunctionDeclaration  ClassDeclaration  CompilationUnit
-    addSource('/testA.dart', '''
+    addSource(
+        '/testA.dart',
+        '''
       int T1;
       F1() { }
       typedef D1();
@@ -2820,7 +3006,9 @@
 
   test_IndexExpression() {
     // ExpressionStatement  Block
-    addSource('/testA.dart', '''
+    addSource(
+        '/testA.dart',
+        '''
       int T1;
       F1() { }
       class A {int x;}''');
@@ -2847,7 +3035,9 @@
 
   test_IndexExpression2() {
     // SimpleIdentifier IndexExpression ExpressionStatement  Block
-    addSource('/testA.dart', '''
+    addSource(
+        '/testA.dart',
+        '''
       int T1;
       F1() { }
       class A {int x;}''');
@@ -2868,7 +3058,9 @@
 
   test_InstanceCreationExpression_imported() {
     // SimpleIdentifier  TypeName  ConstructorName  InstanceCreationExpression
-    addSource('/testA.dart', '''
+    addSource(
+        '/testA.dart',
+        '''
       int T1;
       F1() { }
       class A {A(this.x) { } int x;}''');
@@ -2915,7 +3107,9 @@
 
   test_InterpolationExpression() {
     // SimpleIdentifier  InterpolationExpression  StringInterpolation
-    addSource('/testA.dart', '''
+    addSource(
+        '/testA.dart',
+        '''
       int T1;
       F1() { }
       typedef D1();
@@ -2950,7 +3144,9 @@
 
   test_InterpolationExpression_block() {
     // SimpleIdentifier  InterpolationExpression  StringInterpolation
-    addSource('/testA.dart', '''
+    addSource(
+        '/testA.dart',
+        '''
       int T1;
       F1() { }
       typedef D1();
@@ -3031,7 +3227,9 @@
 
   test_IsExpression() {
     // SimpleIdentifier  TypeName  IsExpression  IfStatement
-    addSource('/testB.dart', '''
+    addSource(
+        '/testB.dart',
+        '''
       lib B;
       foo() { }
       class X {X.c(); X._d(); z() {}}''');
@@ -3104,7 +3302,9 @@
   }
 
   test_keyword() {
-    addSource('/testB.dart', '''
+    addSource(
+        '/testB.dart',
+        '''
       lib B;
       int newT1;
       int T1;
@@ -3165,7 +3365,9 @@
 
   test_MapLiteralEntry() {
     // MapLiteralEntry  MapLiteral  VariableDeclaration
-    addSource('/testA.dart', '''
+    addSource(
+        '/testA.dart',
+        '''
       int T1;
       F1() { }
       typedef D1();
@@ -3199,7 +3401,9 @@
 
   test_MapLiteralEntry1() {
     // MapLiteralEntry  MapLiteral  VariableDeclaration
-    addSource('/testA.dart', '''
+    addSource(
+        '/testA.dart',
+        '''
       int T1;
       F1() { }
       typedef D1();
@@ -3226,7 +3430,9 @@
 
   test_MapLiteralEntry2() {
     // SimpleIdentifier  MapLiteralEntry  MapLiteral  VariableDeclaration
-    addSource('/testA.dart', '''
+    addSource(
+        '/testA.dart',
+        '''
       int T1;
       F1() { }
       typedef D1();
@@ -3269,7 +3475,8 @@
         expect(getterF.element.isDeprecated, isTrue);
         expect(getterF.element.isPrivate, isFalse);
       }
-      CompletionSuggestion getterG = assertSuggestLocalGetter('_g', null);
+      CompletionSuggestion getterG = assertSuggestLocalGetter('_g', null,
+          relevance: DART_RELEVANCE_DEFAULT);
       if (getterG != null) {
         expect(getterG.element.isDeprecated, isFalse);
         expect(getterG.element.isPrivate, isTrue);
@@ -3277,6 +3484,46 @@
     });
   }
 
+  test_MethodDeclaration_body_static() {
+    // Block  BlockFunctionBody  MethodDeclaration
+    addSource(
+        '/testC.dart',
+        '''
+      class C {
+        c1() {}
+        var c2;
+        static c3() {}
+        static var c4;}''');
+    addTestSource('''
+      import "/testC.dart";
+      class B extends C {
+        b1() {}
+        var b2;
+        static b3() {}
+        static var b4;}
+      class A extends B {
+        a1() {}
+        var a2;
+        static a3() {}
+        static var a4;
+        static a() {^}}''');
+    computeFast();
+    return computeFull((bool result) {
+      assertNotSuggested('a1');
+      assertNotSuggested('a2');
+      assertSuggestLocalMethod('a3', 'A', null);
+      assertSuggestLocalField('a4', null);
+      assertNotSuggested('b1');
+      assertNotSuggested('b2');
+      assertNotSuggested('b3');
+      assertNotSuggested('b4');
+      assertNotSuggested('c1');
+      assertNotSuggested('c2');
+      assertNotSuggested('c3');
+      assertNotSuggested('c4');
+    });
+  }
+
   test_MethodDeclaration_members() {
     // Block  BlockFunctionBody  MethodDeclaration
     addTestSource('class A {@deprecated X f; Z _a() {^} var _g;}');
@@ -3284,7 +3531,8 @@
     return computeFull((bool result) {
       expect(request.replacementOffset, completionOffset);
       expect(request.replacementLength, 0);
-      CompletionSuggestion methodA = assertSuggestLocalMethod('_a', 'A', 'Z');
+      CompletionSuggestion methodA = assertSuggestLocalMethod('_a', 'A', 'Z',
+          relevance: DART_RELEVANCE_DEFAULT);
       if (methodA != null) {
         expect(methodA.element.isDeprecated, isFalse);
         expect(methodA.element.isPrivate, isTrue);
@@ -3348,7 +3596,9 @@
 
   test_MethodDeclaration_returnType() {
     // ClassDeclaration  CompilationUnit
-    addSource('/testA.dart', '''
+    addSource(
+        '/testA.dart',
+        '''
       int T1;
       F1() { }
       typedef D1();
@@ -3378,7 +3628,9 @@
 
   test_MethodDeclaration_returnType_afterComment() {
     // ClassDeclaration  CompilationUnit
-    addSource('/testA.dart', '''
+    addSource(
+        '/testA.dart',
+        '''
       int T1;
       F1() { }
       typedef D1();
@@ -3408,7 +3660,9 @@
 
   test_MethodDeclaration_returnType_afterComment2() {
     // MethodDeclaration  ClassDeclaration  CompilationUnit
-    addSource('/testA.dart', '''
+    addSource(
+        '/testA.dart',
+        '''
       int T1;
       F1() { }
       typedef D1();
@@ -3438,7 +3692,9 @@
 
   test_MethodDeclaration_returnType_afterComment3() {
     // MethodDeclaration  ClassDeclaration  CompilationUnit
-    addSource('/testA.dart', '''
+    addSource(
+        '/testA.dart',
+        '''
       int T1;
       F1() { }
       typedef D1();
@@ -3515,14 +3771,26 @@
     });
   }
 
+  test_parameterName_excludeTypes() {
+    addTestSource('m(int ^) {}');
+    return computeFull((bool result) {
+      assertNotSuggested('int');
+      assertNotSuggested('bool');
+    });
+  }
+
   test_partFile_TypeName() {
     // SimpleIdentifier  TypeName  ConstructorName
-    addSource('/testB.dart', '''
+    addSource(
+        '/testB.dart',
+        '''
       lib B;
       int T1;
       F1() { }
       class X {X.c(); X._d(); z() {}}''');
-    addSource('/testA.dart', '''
+    addSource(
+        '/testA.dart',
+        '''
       library libA;
       import "/testB.dart";
       part "$testFile";
@@ -3551,12 +3819,16 @@
 
   test_partFile_TypeName2() {
     // SimpleIdentifier  TypeName  ConstructorName
-    addSource('/testB.dart', '''
+    addSource(
+        '/testB.dart',
+        '''
       lib B;
       int T1;
       F1() { }
       class X {X.c(); X._d(); z() {}}''');
-    addSource('/testA.dart', '''
+    addSource(
+        '/testA.dart',
+        '''
       part of libA;
       class B { }''');
     addTestSource('''
@@ -3585,7 +3857,9 @@
 
   test_PrefixedIdentifier_class_const() {
     // SimpleIdentifier PrefixedIdentifier ExpressionStatement Block
-    addSource('/testB.dart', '''
+    addSource(
+        '/testB.dart',
+        '''
       lib B;
       class I {
         static const scI = 'boo';
@@ -3632,7 +3906,9 @@
 
   test_PrefixedIdentifier_class_imported() {
     // SimpleIdentifier  PrefixedIdentifier  ExpressionStatement
-    addSource('/testB.dart', '''
+    addSource(
+        '/testB.dart',
+        '''
       lib B;
       class I {X get f => new A();get _g => new A();}
       class A implements I {
@@ -3714,7 +3990,9 @@
 
   test_PrefixedIdentifier_library() {
     // SimpleIdentifier  PrefixedIdentifier  ExpressionStatement
-    addSource('/testB.dart', '''
+    addSource(
+        '/testB.dart',
+        '''
       lib B;
       var T1;
       class X { }
@@ -3741,7 +4019,9 @@
 
   test_PrefixedIdentifier_library_typesOnly() {
     // SimpleIdentifier  PrefixedIdentifier  TypeName
-    addSource('/testB.dart', '''
+    addSource(
+        '/testB.dart',
+        '''
       lib B;
       var T1;
       class X { }
@@ -3768,7 +4048,9 @@
 
   test_PrefixedIdentifier_library_typesOnly2() {
     // SimpleIdentifier  PrefixedIdentifier  TypeName
-    addSource('/testB.dart', '''
+    addSource(
+        '/testB.dart',
+        '''
       lib B;
       var T1;
       class X { }
@@ -3795,7 +4077,9 @@
 
   test_PrefixedIdentifier_parameter() {
     // SimpleIdentifier  PrefixedIdentifier  ExpressionStatement
-    addSource('/testB.dart', '''
+    addSource(
+        '/testB.dart',
+        '''
       lib B;
       class _W {M y; var _z;}
       class X extends _W {}
@@ -3815,7 +4099,9 @@
 
   test_PrefixedIdentifier_prefix() {
     // SimpleIdentifier  PrefixedIdentifier  ExpressionStatement
-    addSource('/testA.dart', '''
+    addSource(
+        '/testA.dart',
+        '''
       class A {static int bar = 10;}
       _B() {}''');
     addTestSource('''
@@ -3938,6 +4224,14 @@
     });
   }
 
+  test_localVariableDeclarationName() {
+    addTestSource('main() {String m^}');
+    return computeFull((bool result) {
+      assertNotSuggested('main');
+      assertNotSuggested('min');
+    });
+  }
+
   test_PrefixedIdentifier_trailingStmt_param2() {
     // SimpleIdentifier  PrefixedIdentifier  ExpressionStatement
     addTestSource('f(String g) {g.^ int y = 0;}');
@@ -4017,11 +4311,12 @@
 
   test_SwitchStatement_case() {
     // SwitchStatement  Block  BlockFunctionBody  MethodDeclaration
-    addTestSource('class A {String g(int x) {switch(x) {case 0: ^}}}');
+    addTestSource('class A {String g(int x) {var t; switch(x) {case 0: ^}}}');
     computeFast();
     return computeFull((bool result) {
       assertSuggestLocalClass('A');
       assertSuggestLocalMethod('g', 'A', 'String');
+      assertSuggestLocalVariable('t', null);
       assertSuggestImportedClass('String');
     });
   }
@@ -4117,7 +4412,7 @@
       class A implements I {
         A(this.^) {}
         A.z() {}
-        var b; X _c;
+        var b; X _c; static sb;
         X get d => new A();get _e => new A();
         // no semicolon between completion point and next statement
         set s1(I x) {} set _s2(I x) {m(null);}
@@ -4131,6 +4426,7 @@
           relevance: DART_RELEVANCE_LOCAL_FIELD);
       assertSuggestInvocationField('_c', 'X',
           relevance: DART_RELEVANCE_LOCAL_FIELD);
+      assertNotSuggested('sb');
       assertNotSuggested('d');
       assertNotSuggested('_e');
       assertNotSuggested('f');
@@ -4286,7 +4582,9 @@
 
   test_TypeArgumentList() {
     // SimpleIdentifier  BinaryExpression  ExpressionStatement
-    addSource('/testA.dart', '''
+    addSource(
+        '/testA.dart',
+        '''
       class C1 {int x;}
       F1() => 0;
       typedef String T1(int blat);''');
@@ -4313,7 +4611,9 @@
 
   test_TypeArgumentList2() {
     // TypeName  TypeArgumentList  TypeName
-    addSource('/testA.dart', '''
+    addSource(
+        '/testA.dart',
+        '''
       class C1 {int x;}
       F1() => 0;
       typedef String T1(int blat);''');
@@ -4336,7 +4636,9 @@
   test_VariableDeclaration_name() {
     // SimpleIdentifier  VariableDeclaration  VariableDeclarationList
     // VariableDeclarationStatement  Block
-    addSource('/testB.dart', '''
+    addSource(
+        '/testB.dart',
+        '''
       lib B;
       foo() { }
       class _B { }
@@ -4365,7 +4667,9 @@
   test_VariableDeclarationStatement_RHS() {
     // SimpleIdentifier  VariableDeclaration  VariableDeclarationList
     // VariableDeclarationStatement
-    addSource('/testB.dart', '''
+    addSource(
+        '/testB.dart',
+        '''
       lib B;
       foo() { }
       class _B { }
@@ -4391,7 +4695,9 @@
   test_VariableDeclarationStatement_RHS_missing_semicolon() {
     // VariableDeclaration  VariableDeclarationList
     // VariableDeclarationStatement
-    addSource('/testB.dart', '''
+    addSource(
+        '/testB.dart',
+        '''
       lib B;
       foo1() { }
       void bar1() { }
diff --git a/pkg/analysis_server/test/services/completion/import_uri_contributor_test.dart b/pkg/analysis_server/test/services/completion/import_uri_contributor_test.dart
deleted file mode 100644
index e584c4d..0000000
--- a/pkg/analysis_server/test/services/completion/import_uri_contributor_test.dart
+++ /dev/null
@@ -1,270 +0,0 @@
-// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library test.services.completion.contributor.dart.importuri;
-
-import 'dart:io';
-
-import 'package:analysis_server/src/protocol.dart';
-import 'package:analysis_server/src/services/completion/import_uri_contributor.dart';
-import 'package:path/path.dart';
-import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
-
-import 'completion_test_util.dart';
-
-main() {
-  groupSep = ' | ';
-  defineReflectiveTests(ImportUriContributorTest);
-}
-
-@reflectiveTest
-class ImportUriContributorTest extends AbstractCompletionTest {
-  @override
-  void setUpContributor() {
-    contributor = new ImportUriContributor();
-  }
-
-  test_import() {
-    addTestSource('import "^" import');
-    computeFast();
-    expect(request.replacementOffset, completionOffset);
-    expect(request.replacementLength, 0);
-    assertSuggest('dart:', csKind: CompletionSuggestionKind.IMPORT);
-    assertSuggest('package:', csKind: CompletionSuggestionKind.IMPORT);
-  }
-
-  test_import_dart() {
-    addTestSource('import "d^" import');
-    computeFast();
-    expect(request.replacementOffset, completionOffset - 1);
-    expect(request.replacementLength, 1);
-    assertSuggest('dart:', csKind: CompletionSuggestionKind.IMPORT);
-    assertNotSuggested('dart:core');
-    assertNotSuggested('dart:_internal');
-    assertSuggest('dart:async', csKind: CompletionSuggestionKind.IMPORT);
-    assertSuggest('dart:math', csKind: CompletionSuggestionKind.IMPORT);
-  }
-
-  test_import_dart2() {
-    addTestSource('import "dart:async"; import "d^"');
-    computeFast();
-    expect(request.replacementOffset, completionOffset - 1);
-    expect(request.replacementLength, 1);
-    assertSuggest('dart:', csKind: CompletionSuggestionKind.IMPORT);
-    assertNotSuggested('dart:core');
-    assertNotSuggested('dart:_internal');
-    assertNotSuggested('dart:async');
-    assertSuggest('dart:math', csKind: CompletionSuggestionKind.IMPORT);
-  }
-
-  test_import_file() {
-    // TODO(danrubel) fix file uri suggestions on Windows
-    if (Platform.isWindows) return;
-    testFile = '/proj/completion.dart';
-    addSource('/proj/other.dart', 'library other;');
-    addSource('/proj/foo/bar.dart', 'library bar;');
-    addSource('/blat.dart', 'library blat;');
-    addTestSource('import "^" import');
-    computeFast();
-    expect(request.replacementOffset, completionOffset);
-    expect(request.replacementLength, 0);
-    assertNotSuggested('completion.dart');
-    assertSuggest('other.dart', csKind: CompletionSuggestionKind.IMPORT);
-    assertNotSuggested('foo');
-    assertSuggest('foo${separator}', csKind: CompletionSuggestionKind.IMPORT);
-    assertNotSuggested('foo${separator}bar.dart');
-    assertNotSuggested('..${separator}blat.dart');
-  }
-
-  test_import_file2() {
-    // TODO(danrubel) fix file uri suggestions on Windows
-    if (Platform.isWindows) return;
-    testFile = '/proj/completion.dart';
-    addSource('/proj/other.dart', 'library other;');
-    addSource('/proj/foo/bar.dart', 'library bar;');
-    addSource('/blat.dart', 'library blat;');
-    addTestSource('import "..^" import');
-    computeFast();
-    expect(request.replacementOffset, completionOffset - 2);
-    expect(request.replacementLength, 2);
-    assertNotSuggested('completion.dart');
-    assertSuggest('other.dart', csKind: CompletionSuggestionKind.IMPORT);
-    assertNotSuggested('foo');
-    assertSuggest('foo${separator}', csKind: CompletionSuggestionKind.IMPORT);
-    assertNotSuggested('foo${separator}bar.dart');
-    assertNotSuggested('..${separator}blat.dart');
-  }
-
-  test_import_file_child() {
-    // TODO(danrubel) fix file uri suggestions on Windows
-    if (Platform.isWindows) return;
-    testFile = '/proj/completion.dart';
-    addSource('/proj/other.dart', 'library other;');
-    addSource('/proj/foo/bar.dart', 'library bar;');
-    addSource('/blat.dart', 'library blat;');
-    addTestSource('import "foo/^" import');
-    computeFast();
-    expect(request.replacementOffset, completionOffset - 4);
-    expect(request.replacementLength, 4);
-    assertNotSuggested('completion.dart');
-    assertNotSuggested('other.dart');
-    assertNotSuggested('foo');
-    assertNotSuggested('foo${separator}');
-    assertSuggest('foo${separator}bar.dart', csKind: CompletionSuggestionKind.IMPORT);
-    assertNotSuggested('..${separator}blat.dart');
-  }
-
-  test_import_file_parent() {
-    // TODO(danrubel) fix file uri suggestions on Windows
-    if (Platform.isWindows) return;
-    testFile = '/proj/completion.dart';
-    addSource('/proj/other.dart', 'library other;');
-    addSource('/proj/foo/bar.dart', 'library bar;');
-    addSource('/blat.dart', 'library blat;');
-    addTestSource('import "../^" import');
-    computeFast();
-    expect(request.replacementOffset, completionOffset - 3);
-    expect(request.replacementLength, 3);
-    assertNotSuggested('completion.dart');
-    assertNotSuggested('other.dart');
-    assertNotSuggested('foo');
-    assertNotSuggested('foo${separator}');
-    assertNotSuggested('foo${separator}bar.dart');
-    assertSuggest('..${separator}blat.dart', csKind: CompletionSuggestionKind.IMPORT);
-  }
-
-  test_import_package() {
-    addPackageSource('foo', 'foo.dart', 'library foo;');
-    addPackageSource('foo', 'baz/too.dart', 'library too;');
-    addPackageSource('bar', 'bar.dart', 'library bar;');
-    addTestSource('import "p^" import');
-    computeFast();
-    expect(request.replacementOffset, completionOffset - 1);
-    expect(request.replacementLength, 1);
-    assertSuggest('package:', csKind: CompletionSuggestionKind.IMPORT);
-    assertSuggest('package:foo/', csKind: CompletionSuggestionKind.IMPORT);
-    assertSuggest('package:foo/foo.dart',
-        csKind: CompletionSuggestionKind.IMPORT);
-    assertSuggest('package:foo/baz/', csKind: CompletionSuggestionKind.IMPORT);
-    assertNotSuggested('package:foo/baz/too.dart');
-    assertSuggest('package:bar/', csKind: CompletionSuggestionKind.IMPORT);
-    assertSuggest('package:bar/bar.dart',
-        csKind: CompletionSuggestionKind.IMPORT);
-  }
-
-  test_import_package2() {
-    addPackageSource('foo', 'foo.dart', 'library foo;');
-    addPackageSource('foo', 'baz/too.dart', 'library too;');
-    addPackageSource('bar', 'bar.dart', 'library bar;');
-    addTestSource('import "package:foo/baz/^" import');
-    computeFast();
-    assertSuggest('package:foo/baz/too.dart',
-        csKind: CompletionSuggestionKind.IMPORT);
-  }
-
-  test_import_package_missing_lib() {
-    var pkgSrc = addPackageSource('bar', 'bar.dart', 'library bar;');
-    provider.deleteFolder(dirname(pkgSrc.fullName));
-    addTestSource('import "p^" class');
-    computeFast();
-    expect(request.replacementOffset, completionOffset - 1);
-    expect(request.replacementLength, 1);
-    assertSuggest('package:', csKind: CompletionSuggestionKind.IMPORT);
-    assertSuggest('package:bar/', csKind: CompletionSuggestionKind.IMPORT);
-    assertNotSuggested('package:bar/bar.dart');
-  }
-
-  test_outside_import() {
-    addTestSource('import ^"d" import');
-    computeFast();
-    computeFull((_) {
-      assertNoSuggestions();
-    });
-  }
-
-  test_outside_import2() {
-    addTestSource('import "d"^ import');
-    computeFast();
-    computeFull((_) {
-      assertNoSuggestions();
-    });
-  }
-
-  test_part_file() {
-    // TODO(danrubel) fix file uri suggestions on Windows
-    if (Platform.isWindows) return;
-    testFile = '/proj/completion.dart';
-    addSource('/proj/other.dart', 'library other;');
-    addSource('/proj/foo/bar.dart', 'library bar;');
-    addSource('/blat.dart', 'library blat;');
-    addTestSource('library x; part "^" import');
-    computeFast();
-    expect(request.replacementOffset, completionOffset);
-    expect(request.replacementLength, 0);
-    assertNotSuggested('completion.dart');
-    assertSuggest('other.dart', csKind: CompletionSuggestionKind.IMPORT);
-    assertNotSuggested('foo');
-    assertSuggest('foo${separator}', csKind: CompletionSuggestionKind.IMPORT);
-    assertNotSuggested('foo${separator}bar.dart');
-    assertNotSuggested('..${separator}blat.dart');
-  }
-
-  test_part_file2() {
-    // TODO(danrubel) fix file uri suggestions on Windows
-    if (Platform.isWindows) return;
-    testFile = '/proj/completion.dart';
-    addSource('/proj/other.dart', 'library other;');
-    addSource('/proj/foo/bar.dart', 'library bar;');
-    addSource('/blat.dart', 'library blat;');
-    addTestSource('library x; part "..^" import');
-    computeFast();
-    expect(request.replacementOffset, completionOffset - 2);
-    expect(request.replacementLength, 2);
-    assertNotSuggested('completion.dart');
-    assertSuggest('other.dart', csKind: CompletionSuggestionKind.IMPORT);
-    assertNotSuggested('foo');
-    assertSuggest('foo${separator}', csKind: CompletionSuggestionKind.IMPORT);
-    assertNotSuggested('foo${separator}bar.dart');
-    assertNotSuggested('..${separator}blat.dart');
-  }
-
-  test_part_file_child() {
-    // TODO(danrubel) fix file uri suggestions on Windows
-    if (Platform.isWindows) return;
-    testFile = '/proj/completion.dart';
-    addSource('/proj/other.dart', 'library other;');
-    addSource('/proj/foo/bar.dart', 'library bar;');
-    addSource('/blat.dart', 'library blat;');
-    addTestSource('library x; part "foo/^" import');
-    computeFast();
-    expect(request.replacementOffset, completionOffset - 4);
-    expect(request.replacementLength, 4);
-    assertNotSuggested('completion.dart');
-    assertNotSuggested('other.dart');
-    assertNotSuggested('foo');
-    assertNotSuggested('foo${separator}');
-    assertSuggest('foo${separator}bar.dart', csKind: CompletionSuggestionKind.IMPORT);
-    assertNotSuggested('..${separator}blat.dart');
-  }
-
-  test_part_file_parent() {
-    // TODO(danrubel) fix file uri suggestions on Windows
-    if (Platform.isWindows) return;
-    testFile = '/proj/completion.dart';
-    addSource('/proj/other.dart', 'library other;');
-    addSource('/proj/foo/bar.dart', 'library bar;');
-    addSource('/blat.dart', 'library blat;');
-    addTestSource('library x; part "../^" import');
-    computeFast();
-    expect(request.replacementOffset, completionOffset - 3);
-    expect(request.replacementLength, 3);
-    assertNotSuggested('completion.dart');
-    assertNotSuggested('other.dart');
-    assertNotSuggested('foo');
-    assertNotSuggested('foo${separator}');
-    assertNotSuggested('foo${separator}bar.dart');
-    assertSuggest('..${separator}blat.dart', csKind: CompletionSuggestionKind.IMPORT);
-  }
-}
diff --git a/pkg/analysis_server/test/services/completion/imported_reference_contributor_test.dart b/pkg/analysis_server/test/services/completion/imported_reference_contributor_test.dart
index 42a32cd..95cbb70 100644
--- a/pkg/analysis_server/test/services/completion/imported_reference_contributor_test.dart
+++ b/pkg/analysis_server/test/services/completion/imported_reference_contributor_test.dart
@@ -4,10 +4,11 @@
 
 library test.services.completion.toplevel;
 
-import 'package:analysis_server/src/analysis_server.dart';
-import 'package:analysis_server/src/protocol.dart' as protocol
+import 'package:analysis_server/plugin/protocol/protocol.dart' as protocol
     show Element, ElementKind;
-import 'package:analysis_server/src/protocol.dart' hide Element, ElementKind;
+import 'package:analysis_server/plugin/protocol/protocol.dart'
+    hide Element, ElementKind;
+import 'package:analysis_server/src/analysis_server.dart';
 import 'package:analysis_server/src/services/completion/dart_completion_cache.dart';
 import 'package:analysis_server/src/services/completion/dart_completion_manager.dart';
 import 'package:analysis_server/src/services/completion/imported_reference_contributor.dart';
@@ -20,10 +21,11 @@
 
 import '../../abstract_context.dart';
 import '../../operation/operation_queue_test.dart';
+import '../../utils.dart';
 import 'completion_test_util.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(ImportedReferenceContributorTest);
 }
 
@@ -45,7 +47,8 @@
    */
   @override
   assertCachedCompute(_) {
-    if (!(contributor as ImportedReferenceContributor).shouldWaitForLowPrioritySuggestions) {
+    if (!(contributor as ImportedReferenceContributor)
+        .shouldWaitForLowPrioritySuggestions) {
       return null;
     }
     List<CompletionSuggestion> oldSuggestions = request.suggestions;
@@ -125,7 +128,8 @@
   @override
   CompletionSuggestion assertSuggestImportedClass(String name,
       {CompletionSuggestionKind kind: CompletionSuggestionKind.INVOCATION,
-      int relevance: DART_RELEVANCE_DEFAULT, String importUri,
+      int relevance: DART_RELEVANCE_DEFAULT,
+      String importUri,
       String elemFile}) {
     return assertSuggestClass(name,
         relevance: relevance,
@@ -152,7 +156,8 @@
   CompletionSuggestion assertSuggestImportedFunction(
       String name, String returnType,
       {CompletionSuggestionKind kind: CompletionSuggestionKind.INVOCATION,
-      bool deprecated: false, int relevance: DART_RELEVANCE_DEFAULT,
+      bool deprecated: false,
+      int relevance: DART_RELEVANCE_DEFAULT,
       String importUri}) {
     return assertSuggestFunction(name, returnType,
         kind: kind,
@@ -163,7 +168,8 @@
 
   @override
   CompletionSuggestion assertSuggestImportedFunctionTypeAlias(
-      String name, String returnType, [bool isDeprecated = false,
+      String name, String returnType,
+      [bool isDeprecated = false,
       int relevance = DART_RELEVANCE_DEFAULT,
       CompletionSuggestionKind kind = CompletionSuggestionKind.INVOCATION,
       String importUri]) {
@@ -192,7 +198,8 @@
 
   @override
   CompletionSuggestion assertSuggestImportedTopLevelVar(
-      String name, String returnType, [int relevance = DART_RELEVANCE_DEFAULT,
+      String name, String returnType,
+      [int relevance = DART_RELEVANCE_DEFAULT,
       CompletionSuggestionKind kind = CompletionSuggestionKind.INVOCATION,
       String importUri]) {
     return assertSuggestTopLevelVar(
@@ -284,21 +291,29 @@
 
   test_Block_partial_results() {
     // Block  BlockFunctionBody  MethodDeclaration
-    addSource('/testAB.dart', '''
+    addSource(
+        '/testAB.dart',
+        '''
       export "dart:math" hide max;
       class A {int x;}
       @deprecated D1() {int x;}
       class _B { }''');
-    addSource('/testCD.dart', '''
+    addSource(
+        '/testCD.dart',
+        '''
       String T1;
       var _T2;
       class C { }
       class D { }''');
-    addSource('/testEEF.dart', '''
+    addSource(
+        '/testEEF.dart',
+        '''
       class EE { }
       class F { }''');
     addSource('/testG.dart', 'class G { }');
-    addSource('/testH.dart', '''
+    addSource(
+        '/testH.dart',
+        '''
       class H { }
       int T3;
       var _T4;'''); // not imported
@@ -334,7 +349,9 @@
   }
 
   test_function_parameters_mixed_required_and_named() {
-    addSource('/libA.dart', '''
+    addSource(
+        '/libA.dart',
+        '''
 void m(x, {int y}) {}
 ''');
     addTestSource('''
@@ -356,7 +373,9 @@
   }
 
   test_function_parameters_mixed_required_and_positional() {
-    addSource('/libA.dart', '''
+    addSource(
+        '/libA.dart',
+        '''
 void m(x, [int y]) {}
 ''');
     addTestSource('''
@@ -378,7 +397,9 @@
   }
 
   test_function_parameters_named() {
-    addSource('/libA.dart', '''
+    addSource(
+        '/libA.dart',
+        '''
 void m({x, int y}) {}
 ''');
     addTestSource('''
@@ -400,7 +421,9 @@
   }
 
   test_function_parameters_none() {
-    addSource('/libA.dart', '''
+    addSource(
+        '/libA.dart',
+        '''
 void m() {}
 ''');
     addTestSource('''
@@ -420,7 +443,9 @@
   }
 
   test_function_parameters_positional() {
-    addSource('/libA.dart', '''
+    addSource(
+        '/libA.dart',
+        '''
 void m([x, int y]) {}
 ''');
     addTestSource('''
@@ -442,7 +467,9 @@
   }
 
   test_function_parameters_required() {
-    addSource('/libA.dart', '''
+    addSource(
+        '/libA.dart',
+        '''
 void m(x, int y) {}
 ''');
     addTestSource('''
@@ -463,8 +490,21 @@
     });
   }
 
+  test_inComment_endOfLine() {
+    addTestSource('''
+main() {
+  // text ^
+}
+''');
+    return computeFull((bool result) {
+      assertNoSuggestions();
+    });
+  }
+
   test_InstanceCreationExpression() {
-    addSource('/testA.dart', '''
+    addSource(
+        '/testA.dart',
+        '''
 class A {foo(){var f; {var x;}}}
 class B {B(this.x, [String boo]) { } int x;}
 class C {C.bar({boo: 'hoo', int z: 0}) { } }''');
@@ -499,8 +539,7 @@
       expect(suggestion.hasNamedParameters, false);
 
       suggestion = assertSuggestImportedConstructor('C.bar');
-      expect(
-          suggestion.element.parameters, "({dynamic boo: 'hoo'}, {int z: 0})");
+      expect(suggestion.element.parameters, "({dynamic boo: 'hoo', int z: 0})");
       expect(suggestion.parameterNames, hasLength(2));
       expect(suggestion.parameterNames[0], 'boo');
       expect(suggestion.parameterTypes[0], 'dynamic');
@@ -526,7 +565,9 @@
   }
 
   test_method_parameters_mixed_required_and_named() {
-    addSource('/libA.dart', '''
+    addSource(
+        '/libA.dart',
+        '''
 class A {
   void m(x, {int y}) {}
 }
@@ -551,7 +592,9 @@
   }
 
   test_method_parameters_mixed_required_and_positional() {
-    addSource('/libA.dart', '''
+    addSource(
+        '/libA.dart',
+        '''
 class A {
   void m(x, [int y]) {}
 }
@@ -576,7 +619,9 @@
   }
 
   test_method_parameters_named() {
-    addSource('/libA.dart', '''
+    addSource(
+        '/libA.dart',
+        '''
 class A {
   void m({x, int y}) {}
 }
@@ -601,7 +646,9 @@
   }
 
   test_method_parameters_none() {
-    addSource('/libA.dart', '''
+    addSource(
+        '/libA.dart',
+        '''
 class A {
   void m() {}
 }
@@ -624,7 +671,9 @@
   }
 
   test_method_parameters_positional() {
-    addSource('/libA.dart', '''
+    addSource(
+        '/libA.dart',
+        '''
 class A {
   void m([x, int y]) {}
 }
@@ -649,7 +698,9 @@
   }
 
   test_method_parameters_required() {
-    addSource('/libA.dart', '''
+    addSource(
+        '/libA.dart',
+        '''
 class A {
   void m(x, int y) {}
 }
@@ -674,7 +725,9 @@
   }
 
   test_mixin_ordering() {
-    addSource('/libA.dart', '''
+    addSource(
+        '/libA.dart',
+        '''
 class B {}
 class M1 {
   void m() {}
@@ -700,7 +753,6 @@
    * Ensure that completions in one context don't appear in another
    */
   test_multiple_contexts() {
-
     // Create a 2nd context with source
     var context2 = AnalysisEngine.instance.createAnalysisContext();
     context2.sourceFactory =
@@ -719,14 +771,16 @@
       result.changeNotices.forEach((ChangeNotice notice) {
         CompilationUnit unit = notice.resolvedDartUnit;
         if (unit != null) {
-          index.indexUnit(context2, unit);
+          index.index(context2, unit);
         }
       });
       result = context2.performAnalysisTask();
     }
 
     // Check that source in 2nd context does not appear in completion in 1st
-    addSource('/context1/libA.dart', '''
+    addSource(
+        '/context1/libA.dart',
+        '''
       library libA;
       class ClassInLocalContext {int x;}''');
     testFile = '/context1/completionTest.dart';
@@ -744,7 +798,9 @@
   }
 
   test_no_parameters_field() {
-    addSource('/libA.dart', '''
+    addSource(
+        '/libA.dart',
+        '''
 class A {
   int x;
 }
@@ -762,7 +818,9 @@
   }
 
   test_no_parameters_getter() {
-    addSource('/libA.dart', '''
+    addSource(
+        '/libA.dart',
+        '''
 class A {
   int get x => null;
 }
@@ -780,7 +838,9 @@
   }
 
   test_no_parameters_setter() {
-    addSource('/libA.dart', '''
+    addSource(
+        '/libA.dart',
+        '''
 class A {
   set x(int value) {};
 }
diff --git a/pkg/analysis_server/test/services/completion/inherited_computer_test.dart b/pkg/analysis_server/test/services/completion/inherited_computer_test.dart
new file mode 100644
index 0000000..a50fa2f
--- /dev/null
+++ b/pkg/analysis_server/test/services/completion/inherited_computer_test.dart
@@ -0,0 +1,75 @@
+// 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 test.services.completion.inherited_computer_test;
+
+import 'package:analysis_server/plugin/protocol/protocol.dart';
+import 'package:analysis_server/src/services/completion/dart_completion_manager.dart';
+import 'package:analysis_server/src/services/completion/inherited_contributor.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
+import 'package:unittest/src/matcher/core_matchers.dart';
+import 'package:unittest/unittest.dart';
+
+import '../../utils.dart';
+import 'completion_test_util.dart';
+
+main() {
+  initializeTestEnvironment();
+//  defineReflectiveTests(InheritedContributorTest);
+}
+
+@reflectiveTest
+class InheritedContributorTest extends AbstractCompletionTest {
+  @override
+  void setUpContributor() {
+    contributor = new NewCompletionWrapper(new InheritedContributor());
+  }
+
+  test_fromMultipleSuperclasses() {
+    addTestSource(r'''
+class A {
+  notSuggested() => null;
+  A suggested1(int x) => null;
+  B suggested2(String y) => null;
+}
+class B extends A {
+  B suggested2(String y) => null;
+  C suggested3([String z]) => null;
+}
+class C extends B {
+  sugg^
+}
+''');
+    computeFast();
+    return computeFull((bool result) {
+      _assertOverride(
+          '@override\n  A suggested1(int x) {\n    // TODO: implement suggested1\n    return null;\n  }');
+      _assertOverride(
+          '''@override\n  B suggested2(String y) {\n    // TODO: implement suggested2\n    return null;\n  }''');
+      _assertOverride(
+          '''@override\n  C suggested3([String z]) {\n    // TODO: implement suggested3\n    return null;\n  }''');
+      assertNotSuggested(
+          '''@override\n  notSuggested() {\n    // TODO: implement notSuggested\n    return null;\n  }''');
+    });
+  }
+
+  CompletionSuggestion _assertOverride(String completion) {
+    CompletionSuggestion cs = getSuggest(
+        completion: completion,
+        csKind: CompletionSuggestionKind.IDENTIFIER,
+        elemKind: null);
+    if (cs == null) {
+      failedCompletion('expected $completion', request.suggestions);
+    }
+    expect(cs.kind, equals(CompletionSuggestionKind.IDENTIFIER));
+    expect(cs.relevance, equals(DART_RELEVANCE_HIGH));
+    expect(cs.importUri, null);
+//    expect(cs.selectionOffset, equals(completion.length));
+    expect(cs.selectionLength, equals(0));
+    expect(cs.isDeprecated, isFalse);
+    expect(cs.isPotential, isFalse);
+    expect(cs.element, isNotNull);
+    return cs;
+  }
+}
diff --git a/pkg/analysis_server/test/services/completion/keyword_contributor_test.dart b/pkg/analysis_server/test/services/completion/keyword_contributor_test.dart
index 6db5b89..4a2085f 100644
--- a/pkg/analysis_server/test/services/completion/keyword_contributor_test.dart
+++ b/pkg/analysis_server/test/services/completion/keyword_contributor_test.dart
@@ -4,17 +4,18 @@
 
 library test.services.completion.dart.keyword;
 
-import 'package:analysis_server/src/protocol.dart';
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/services/completion/dart_completion_manager.dart';
 import 'package:analysis_server/src/services/completion/keyword_contributor.dart';
 import 'package:analyzer/src/generated/scanner.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 import 'package:unittest/unittest.dart';
 
+import '../../utils.dart';
 import 'completion_test_util.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(KeywordContributorTest);
 }
 
@@ -78,13 +79,33 @@
 
   static const List<Keyword> STMT_START_IN_CLASS = const [
     Keyword.ASSERT,
+    Keyword.CONST,
+    Keyword.DO,
+    Keyword.FINAL,
+    Keyword.FOR,
+    Keyword.IF,
+    Keyword.NEW,
+    Keyword.RETURN,
+    Keyword.SUPER,
+    Keyword.SWITCH,
+    Keyword.THIS,
+    Keyword.THROW,
+    Keyword.TRY,
+    Keyword.VAR,
+    Keyword.VOID,
+    Keyword.WHILE
+  ];
+
+  static const List<Keyword> STMT_START_IN_LOOP_IN_CLASS = const [
+    Keyword.ASSERT,
+    Keyword.BREAK,
+    Keyword.CONST,
     Keyword.CONTINUE,
     Keyword.DO,
     Keyword.FINAL,
     Keyword.FOR,
     Keyword.IF,
     Keyword.NEW,
-    Keyword.RETHROW,
     Keyword.RETURN,
     Keyword.SUPER,
     Keyword.SWITCH,
@@ -98,15 +119,15 @@
 
   static const List<Keyword> STMT_START_IN_SWITCH_IN_CLASS = const [
     Keyword.ASSERT,
+    Keyword.BREAK,
     Keyword.CASE,
-    Keyword.CONTINUE,
+    Keyword.CONST,
     Keyword.DEFAULT,
     Keyword.DO,
     Keyword.FINAL,
     Keyword.FOR,
     Keyword.IF,
     Keyword.NEW,
-    Keyword.RETHROW,
     Keyword.RETURN,
     Keyword.SUPER,
     Keyword.SWITCH,
@@ -120,15 +141,15 @@
 
   static const List<Keyword> STMT_START_IN_SWITCH_OUTSIDE_CLASS = const [
     Keyword.ASSERT,
+    Keyword.BREAK,
     Keyword.CASE,
-    Keyword.CONTINUE,
+    Keyword.CONST,
     Keyword.DEFAULT,
     Keyword.DO,
     Keyword.FINAL,
     Keyword.FOR,
     Keyword.IF,
     Keyword.NEW,
-    Keyword.RETHROW,
     Keyword.RETURN,
     Keyword.SWITCH,
     Keyword.THROW,
@@ -140,13 +161,31 @@
 
   static const List<Keyword> STMT_START_OUTSIDE_CLASS = const [
     Keyword.ASSERT,
+    Keyword.CONST,
+    Keyword.DO,
+    Keyword.FINAL,
+    Keyword.FOR,
+    Keyword.IF,
+    Keyword.NEW,
+    Keyword.RETURN,
+    Keyword.SWITCH,
+    Keyword.THROW,
+    Keyword.TRY,
+    Keyword.VAR,
+    Keyword.VOID,
+    Keyword.WHILE
+  ];
+
+  static const List<Keyword> STMT_START_IN_LOOP_OUTSIDE_CLASS = const [
+    Keyword.ASSERT,
+    Keyword.BREAK,
+    Keyword.CONST,
     Keyword.CONTINUE,
     Keyword.DO,
     Keyword.FINAL,
     Keyword.FOR,
     Keyword.IF,
     Keyword.NEW,
-    Keyword.RETHROW,
     Keyword.RETURN,
     Keyword.SWITCH,
     Keyword.THROW,
@@ -157,6 +196,7 @@
   ];
 
   static const List<Keyword> EXPRESSION_START_INSTANCE = const [
+    Keyword.CONST,
     Keyword.FALSE,
     Keyword.NEW,
     Keyword.NULL,
@@ -166,23 +206,13 @@
   ];
 
   static const List<Keyword> EXPRESSION_START_NO_INSTANCE = const [
+    Keyword.CONST,
     Keyword.FALSE,
     Keyword.NEW,
     Keyword.NULL,
     Keyword.TRUE,
   ];
 
-  static final Map<String, List<String>> keywordTemplates =
-      <String, List<String>>{
-    Keyword.IMPORT.syntax: [
-      "import '^';",
-      "import '^' as ;",
-      "import '^' hide ;",
-      "import '^' show ;"
-    ],
-    Keyword.FOR.syntax: ['for (^)']
-  };
-
   void assertSuggestKeywords(Iterable<Keyword> expectedKeywords,
       {List<String> pseudoKeywords: NO_PSEUDO_KEYWORDS,
       int relevance: DART_RELEVANCE_KEYWORD}) {
@@ -191,18 +221,6 @@
     Set<String> actualCompletions = new Set<String>();
     expectedCompletions.addAll(expectedKeywords.map((k) => k.syntax));
     expectedCompletions.addAll(pseudoKeywords);
-    keywordTemplates.forEach((String key, List<String> templates) {
-      if (expectedCompletions.remove(key)) {
-        for (String t in templates) {
-          int offset = t.indexOf('^');
-          if (offset != -1) {
-            t = '${t.substring(0, offset)}${t.substring(offset + 1)}';
-            expectedOffsets[t] = offset;
-          }
-          expectedCompletions.add(t);
-        }
-      }
-    });
     for (CompletionSuggestion s in request.suggestions) {
       if (s.kind == CompletionSuggestionKind.KEYWORD) {
         Keyword k = Keyword.keywords[s.completion];
@@ -251,6 +269,35 @@
     }
   }
 
+  fail_import_partial() {
+    addTestSource('imp^ import "package:foo/foo.dart"; import "bar.dart";');
+    expect(computeFast(), isTrue);
+    // TODO(danrubel) should not suggest declaration keywords
+    assertNotSuggested('class');
+  }
+
+  fail_import_partial4() {
+    addTestSource('^ imp import "package:foo/foo.dart";');
+    expect(computeFast(), isTrue);
+    // TODO(danrubel) should not suggest declaration keywords
+    assertNotSuggested('class');
+  }
+
+  fail_import_partial5() {
+    addTestSource('library libA; imp^ import "package:foo/foo.dart";');
+    expect(computeFast(), isTrue);
+    // TODO(danrubel) should not suggest declaration keywords
+    assertNotSuggested('class');
+  }
+
+  fail_import_partial6() {
+    addTestSource(
+        'library bar; import "zoo.dart"; imp^ import "package:foo/foo.dart";');
+    expect(computeFast(), isTrue);
+    // TODO(danrubel) should not suggest declaration keywords
+    assertNotSuggested('class');
+  }
+
   @override
   void setUpContributor() {
     contributor = new KeywordContributor();
@@ -383,6 +430,15 @@
         relevance: DART_RELEVANCE_HIGH);
   }
 
+  test_catch() {
+    addTestSource('main() {try {} catch (e) {^}}}');
+    expect(computeFast(), isTrue);
+    var keywords = <Keyword>[];
+    keywords.addAll(STMT_START_OUTSIDE_CLASS);
+    keywords.add(Keyword.RETHROW);
+    assertSuggestKeywords(keywords, relevance: DART_RELEVANCE_KEYWORD);
+  }
+
   test_class() {
     addTestSource('class A e^ { }');
     expect(computeFast(), isTrue);
@@ -532,6 +588,20 @@
     assertSuggestKeywords([Keyword.THIS]);
   }
 
+  test_do_break_continue() {
+    addTestSource('main() {do {^} while (true);}');
+    expect(computeFast(), isTrue);
+    assertSuggestKeywords(STMT_START_IN_LOOP_OUTSIDE_CLASS,
+        relevance: DART_RELEVANCE_KEYWORD);
+  }
+
+  test_do_break_continue2() {
+    addTestSource('class A {foo() {do {^} while (true);}}');
+    expect(computeFast(), isTrue);
+    assertSuggestKeywords(STMT_START_IN_LOOP_IN_CLASS,
+        relevance: DART_RELEVANCE_KEYWORD);
+  }
+
   test_empty() {
     addTestSource('^');
     expect(computeFast(), isTrue);
@@ -539,6 +609,44 @@
         relevance: DART_RELEVANCE_HIGH);
   }
 
+  test_for_break_continue() {
+    addTestSource('main() {for (int x in myList) {^}}');
+    expect(computeFast(), isTrue);
+    assertSuggestKeywords(STMT_START_IN_LOOP_OUTSIDE_CLASS,
+        relevance: DART_RELEVANCE_KEYWORD);
+  }
+
+  test_for_break_continue2() {
+    addTestSource('class A {foo() {for (int x in myList) {^}}}');
+    expect(computeFast(), isTrue);
+    assertSuggestKeywords(STMT_START_IN_LOOP_IN_CLASS,
+        relevance: DART_RELEVANCE_KEYWORD);
+  }
+
+  test_for_expression_in() {
+    addTestSource('main() {for (int x i^)}');
+    expect(computeFast(), isTrue);
+    assertSuggestKeywords([Keyword.IN], relevance: DART_RELEVANCE_HIGH);
+  }
+
+  test_for_expression_in2() {
+    addTestSource('main() {for (int x in^)}');
+    expect(computeFast(), isTrue);
+    assertSuggestKeywords([Keyword.IN], relevance: DART_RELEVANCE_HIGH);
+  }
+
+  test_for_expression_init() {
+    addTestSource('main() {for (int x = i^)}');
+    expect(computeFast(), isTrue);
+    assertSuggestKeywords(EXPRESSION_START_NO_INSTANCE);
+  }
+
+  test_for_expression_init2() {
+    addTestSource('main() {for (int x = in^)}');
+    expect(computeFast(), isTrue);
+    assertSuggestKeywords(EXPRESSION_START_NO_INSTANCE);
+  }
+
   test_function_async() {
     addTestSource('main()^');
     expect(computeFast(), isTrue);
@@ -741,7 +849,8 @@
   test_import() {
     addTestSource('import "foo" deferred as foo ^;');
     expect(computeFast(), isTrue);
-    assertSuggestKeywords([], relevance: DART_RELEVANCE_HIGH);
+    assertSuggestKeywords([],
+        pseudoKeywords: ['show', 'hide'], relevance: DART_RELEVANCE_HIGH);
   }
 
   test_import_as() {
@@ -777,63 +886,180 @@
   test_import_deferred3() {
     addTestSource('import "foo" d^ show foo;');
     expect(computeFast(), isTrue);
-    assertSuggestKeywords([Keyword.AS, Keyword.DEFERRED],
-        relevance: DART_RELEVANCE_HIGH);
+    assertSuggestKeywords([Keyword.AS],
+        pseudoKeywords: ['deferred as'], relevance: DART_RELEVANCE_HIGH);
   }
 
   test_import_deferred4() {
     addTestSource('import "foo" d^ hide foo;');
     expect(computeFast(), isTrue);
-    assertSuggestKeywords([Keyword.AS, Keyword.DEFERRED],
-        relevance: DART_RELEVANCE_HIGH);
+    assertSuggestKeywords([Keyword.AS],
+        pseudoKeywords: ['deferred as'], relevance: DART_RELEVANCE_HIGH);
   }
 
   test_import_deferred5() {
     addTestSource('import "foo" d^');
     expect(computeFast(), isTrue);
-    assertSuggestKeywords([Keyword.AS, Keyword.DEFERRED],
+    assertSuggestKeywords([Keyword.AS],
+        pseudoKeywords: ['deferred as', 'show', 'hide'],
         relevance: DART_RELEVANCE_HIGH);
   }
 
   test_import_deferred6() {
     addTestSource('import "foo" d^ import');
     expect(computeFast(), isTrue);
-    assertSuggestKeywords([Keyword.AS, Keyword.DEFERRED],
+    assertSuggestKeywords([Keyword.AS],
+        pseudoKeywords: ['deferred as', 'show', 'hide'],
         relevance: DART_RELEVANCE_HIGH);
   }
 
   test_import_deferred_as() {
     addTestSource('import "foo" ^;');
     expect(computeFast(), isTrue);
-    assertSuggestKeywords([Keyword.AS, Keyword.DEFERRED],
+    assertSuggestKeywords([Keyword.AS],
+        pseudoKeywords: ['deferred as', 'show', 'hide'],
         relevance: DART_RELEVANCE_HIGH);
   }
 
   test_import_deferred_as2() {
     addTestSource('import "foo" d^;');
     expect(computeFast(), isTrue);
-    assertSuggestKeywords([Keyword.AS, Keyword.DEFERRED],
+    assertSuggestKeywords([Keyword.AS],
+        pseudoKeywords: ['deferred as', 'show', 'hide'],
         relevance: DART_RELEVANCE_HIGH);
   }
 
   test_import_deferred_as3() {
     addTestSource('import "foo" ^');
     expect(computeFast(), isTrue);
-    assertSuggestKeywords([Keyword.AS, Keyword.DEFERRED],
+    assertSuggestKeywords([Keyword.AS],
+        pseudoKeywords: ['deferred as', 'show', 'hide'],
         relevance: DART_RELEVANCE_HIGH);
   }
 
   test_import_deferred_as4() {
     addTestSource('import "foo" d^');
     expect(computeFast(), isTrue);
-    assertSuggestKeywords([Keyword.AS, Keyword.DEFERRED],
+    assertSuggestKeywords([Keyword.AS],
+        pseudoKeywords: ['deferred as', 'show', 'hide'],
+        relevance: DART_RELEVANCE_HIGH);
+  }
+
+  test_import_deferred_as5() {
+    addTestSource('import "foo" sh^ import "bar"; import "baz";');
+    expect(computeFast(), isTrue);
+    assertSuggestKeywords([Keyword.AS],
+        pseudoKeywords: ['deferred as', 'show', 'hide'],
         relevance: DART_RELEVANCE_HIGH);
   }
 
   test_import_deferred_not() {
     addTestSource('import "foo" as foo ^;');
     expect(computeFast(), isTrue);
-    assertSuggestKeywords([], relevance: DART_RELEVANCE_HIGH);
+    assertSuggestKeywords([],
+        pseudoKeywords: ['show', 'hide'], relevance: DART_RELEVANCE_HIGH);
+  }
+
+  test_import_deferred_partial() {
+    addTestSource('import "package:foo/foo.dart" def^ as foo;');
+    expect(computeFast(), isTrue);
+    assertSuggestKeywords([Keyword.DEFERRED], relevance: DART_RELEVANCE_HIGH);
+    expect(request.replacementOffset, 30);
+    expect(request.replacementLength, 3);
+  }
+
+  test_import_incomplete() {
+    addTestSource('import "^"');
+    expect(computeFast(), isTrue);
+    assertNoSuggestions();
+  }
+
+  test_import_partial() {
+    addTestSource('imp^ import "package:foo/foo.dart"; import "bar.dart";');
+    expect(computeFast(), isTrue);
+    // TODO(danrubel) should not suggest declaration keywords
+    assertSuggestKeywords(DIRECTIVE_DECLARATION_AND_LIBRARY_KEYWORDS,
+        relevance: DART_RELEVANCE_HIGH);
+    expect(request.replacementOffset, 0);
+    expect(request.replacementLength, 3);
+  }
+
+  test_import_partial2() {
+    addTestSource('^imp import "package:foo/foo.dart";');
+    expect(computeFast(), isTrue);
+    // TODO(danrubel) should not suggest declaration keywords
+    assertSuggestKeywords(DIRECTIVE_DECLARATION_AND_LIBRARY_KEYWORDS,
+        relevance: DART_RELEVANCE_HIGH);
+    expect(request.replacementOffset, 0);
+    expect(request.replacementLength, 3);
+  }
+
+  test_import_partial3() {
+    addTestSource(' ^imp import "package:foo/foo.dart"; import "bar.dart";');
+    expect(computeFast(), isTrue);
+    // TODO(danrubel) should not suggest declaration keywords
+    assertSuggestKeywords(DIRECTIVE_DECLARATION_AND_LIBRARY_KEYWORDS,
+        relevance: DART_RELEVANCE_HIGH);
+    expect(request.replacementOffset, 1);
+    expect(request.replacementLength, 3);
+  }
+
+  test_import_partial4() {
+    addTestSource('^ imp import "package:foo/foo.dart";');
+    expect(computeFast(), isTrue);
+    // TODO(danrubel) should not suggest declaration keywords
+    assertSuggestKeywords(DIRECTIVE_DECLARATION_AND_LIBRARY_KEYWORDS,
+        relevance: DART_RELEVANCE_HIGH);
+    expect(request.replacementOffset, 0);
+    expect(request.replacementLength, 0);
+  }
+
+  test_import_partial5() {
+    addTestSource('library libA; imp^ import "package:foo/foo.dart";');
+    expect(computeFast(), isTrue);
+    // TODO(danrubel) should not suggest declaration keywords
+    assertSuggestKeywords(DIRECTIVE_AND_DECLARATION_KEYWORDS,
+        relevance: DART_RELEVANCE_HIGH);
+    expect(request.replacementOffset, 14);
+    expect(request.replacementLength, 3);
+  }
+
+  test_import_partial6() {
+    addTestSource(
+        'library bar; import "zoo.dart"; imp^ import "package:foo/foo.dart";');
+    expect(computeFast(), isTrue);
+    // TODO(danrubel) should not suggest declaration keywords
+    assertSuggestKeywords(DIRECTIVE_AND_DECLARATION_KEYWORDS,
+        relevance: DART_RELEVANCE_HIGH);
+    expect(request.replacementOffset, 32);
+    expect(request.replacementLength, 3);
+  }
+
+  test_inComment_block() {
+    addTestSource('''
+main() {
+  /* text ^ */
+  print(42);
+}
+''');
+    expect(computeFast(), isTrue);
+    assertNoSuggestions();
+  }
+
+  test_inComment_endOfLine() {
+    addTestSource('''
+main() {
+  // text ^
+}
+''');
+    expect(computeFast(), isTrue);
+    assertNoSuggestions();
+  }
+
+  test_is_expression() {
+    addTestSource('main() {if (x is^)}');
+    expect(computeFast(), isTrue);
+    assertSuggestKeywords([Keyword.IS], relevance: DART_RELEVANCE_HIGH);
   }
 
   test_library() {
@@ -1167,6 +1393,20 @@
     assertSuggestKeywords(STMT_START_IN_SWITCH_IN_CLASS);
   }
 
+  test_while_break_continue() {
+    addTestSource('main() {while (true) {^}}');
+    expect(computeFast(), isTrue);
+    assertSuggestKeywords(STMT_START_IN_LOOP_OUTSIDE_CLASS,
+        relevance: DART_RELEVANCE_KEYWORD);
+  }
+
+  test_while_break_continue2() {
+    addTestSource('class A {foo() {while (true) {^}}}');
+    expect(computeFast(), isTrue);
+    assertSuggestKeywords(STMT_START_IN_LOOP_IN_CLASS,
+        relevance: DART_RELEVANCE_KEYWORD);
+  }
+
   void _appendCompletions(
       StringBuffer msg, Iterable<String> completions, Iterable<String> other) {
     List<String> sorted = completions.toList();
diff --git a/pkg/analysis_server/test/services/completion/local_declaration_visitor_test.dart b/pkg/analysis_server/test/services/completion/local_declaration_visitor_test.dart
index 230291d..e1ab7da 100644
--- a/pkg/analysis_server/test/services/completion/local_declaration_visitor_test.dart
+++ b/pkg/analysis_server/test/services/completion/local_declaration_visitor_test.dart
@@ -12,8 +12,10 @@
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 import 'package:unittest/unittest.dart';
 
+import '../../utils.dart';
+
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(LocalDeclarationVisitorTest);
 }
 
diff --git a/pkg/analysis_server/test/services/completion/local_reference_contributor_test.dart b/pkg/analysis_server/test/services/completion/local_reference_contributor_test.dart
index 36310da..700f414 100644
--- a/pkg/analysis_server/test/services/completion/local_reference_contributor_test.dart
+++ b/pkg/analysis_server/test/services/completion/local_reference_contributor_test.dart
@@ -4,18 +4,20 @@
 
 library test.services.completion.dart.local;
 
-import 'package:analysis_server/src/protocol.dart' as protocol
+import 'package:analysis_server/plugin/protocol/protocol.dart' as protocol
     show Element, ElementKind;
-import 'package:analysis_server/src/protocol.dart' hide Element, ElementKind;
+import 'package:analysis_server/plugin/protocol/protocol.dart'
+    hide Element, ElementKind;
 import 'package:analysis_server/src/services/completion/dart_completion_manager.dart';
 import 'package:analysis_server/src/services/completion/local_reference_contributor.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 import 'package:unittest/unittest.dart';
 
+import '../../utils.dart';
 import 'completion_test_util.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(LocalReferenceContributorTest);
 }
 
@@ -24,8 +26,10 @@
   @override
   CompletionSuggestion assertSuggestLocalClass(String name,
       {CompletionSuggestionKind kind: CompletionSuggestionKind.INVOCATION,
-      int relevance: DART_RELEVANCE_DEFAULT, bool isDeprecated: false,
-      String elemFile, int elemOffset}) {
+      int relevance: DART_RELEVANCE_DEFAULT,
+      bool isDeprecated: false,
+      String elemFile,
+      int elemOffset}) {
     return assertSuggestClass(name,
         elemFile: elemFile,
         elemOffset: elemOffset,
@@ -57,7 +61,8 @@
   CompletionSuggestion assertSuggestLocalFunction(
       String name, String returnType,
       {CompletionSuggestionKind kind: CompletionSuggestionKind.INVOCATION,
-      bool deprecated: false, int relevance: DART_RELEVANCE_LOCAL_FUNCTION}) {
+      bool deprecated: false,
+      int relevance: DART_RELEVANCE_LOCAL_FUNCTION}) {
     return assertSuggestFunction(name, returnType,
         kind: kind, deprecated: deprecated, relevance: relevance);
   }
@@ -598,6 +603,38 @@
     assertNotSuggested('MC');
   }
 
+  test_inComment_block_beforeNode() {
+    addTestSource('''
+main(aaa, bbb) {
+  /* text ^ */
+  print(42);
+}
+''');
+    expect(computeFast(), isTrue);
+    assertNoSuggestions();
+  }
+
+  test_inComment_endOfLine_beforeNode() {
+    addTestSource('''
+main(aaa, bbb) {
+  // text ^
+  print(42);
+}
+''');
+    expect(computeFast(), isTrue);
+    assertNoSuggestions();
+  }
+
+  test_inComment_endOfLine_beforeToken() {
+    addTestSource('''
+main(aaa, bbb) {
+  // text ^
+}
+''');
+    expect(computeFast(), isTrue);
+    assertNoSuggestions();
+  }
+
   test_InstanceCreationExpression() {
     addTestSource('''
 class A {foo(){var f; {var x;}}}
@@ -789,6 +826,20 @@
     assertSuggestMethod('m', 'B', null, relevance: DART_RELEVANCE_LOCAL_METHOD);
   }
 
+  test_prioritization_private() {
+    addTestSource('main() {var ab; var _ab; _^}');
+    expect(computeFast(), isTrue);
+    assertSuggestLocalVariable('ab', null);
+    assertSuggestLocalVariable('_ab', null);
+  }
+
+  test_prioritization_public() {
+    addTestSource('main() {var ab; var _ab; a^}');
+    expect(computeFast(), isTrue);
+    assertSuggestLocalVariable('ab', null);
+    assertSuggestLocalVariable('_ab', null, relevance: DART_RELEVANCE_DEFAULT);
+  }
+
   test_shadowed_name() {
     addTestSource('var a; class A { var a; m() { ^ } }');
     expect(computeFast(), isTrue);
diff --git a/pkg/analysis_server/test/services/completion/optype_test.dart b/pkg/analysis_server/test/services/completion/optype_test.dart
index 04ce497..94b5daf 100644
--- a/pkg/analysis_server/test/services/completion/optype_test.dart
+++ b/pkg/analysis_server/test/services/completion/optype_test.dart
@@ -4,7 +4,7 @@
 
 library test.services.completion.contributor.dart.optype;
 
-import 'package:analysis_server/src/services/completion/completion_target.dart';
+import 'package:analysis_server/src/provisional/completion/dart/completion_target.dart';
 import 'package:analysis_server/src/services/completion/optype.dart';
 import 'package:analyzer/src/generated/ast.dart';
 import 'package:analyzer/src/generated/engine.dart';
@@ -13,9 +13,10 @@
 import 'package:unittest/unittest.dart';
 
 import '../../abstract_context.dart';
+import '../../utils.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(OpTypeTest);
 }
 
@@ -42,19 +43,27 @@
     visitor = new OpType.forCompletion(completionTarget, offset);
   }
 
-  void assertOpType({bool prefixed: false, bool returnValue: false,
-      bool typeNames: false, bool voidReturn: false, bool statementLabel: false,
-      bool caseLabel: false, bool constructors: false}) {
-    expect(visitor.includeReturnValueSuggestions, returnValue,
-        reason: 'returnValue');
-    expect(visitor.includeTypeNameSuggestions, typeNames, reason: 'typeNames');
-    expect(visitor.includeVoidReturnSuggestions, voidReturn,
-        reason: 'voidReturn');
-    expect(visitor.includeStatementLabelSuggestions, statementLabel,
-        reason: 'statementLabel');
+  void assertOpType(
+      {bool caseLabel: false,
+      bool constructors: false,
+      bool prefixed: false,
+      bool returnValue: false,
+      bool statementLabel: false,
+      bool staticMethodBody: false,
+      bool typeNames: false,
+      bool voidReturn: false}) {
     expect(visitor.includeCaseLabelSuggestions, caseLabel, reason: 'caseLabel');
     expect(visitor.includeConstructorSuggestions, constructors,
         reason: 'constructors');
+    expect(visitor.includeReturnValueSuggestions, returnValue,
+        reason: 'returnValue');
+    expect(visitor.includeStatementLabelSuggestions, statementLabel,
+        reason: 'statementLabel');
+    expect(visitor.includeTypeNameSuggestions, typeNames, reason: 'typeNames');
+    expect(visitor.includeVoidReturnSuggestions, voidReturn,
+        reason: 'voidReturn');
+    expect(visitor.inStaticMethodBody, staticMethodBody,
+        reason: 'staticMethodBody');
     expect(visitor.isPrefixed, prefixed, reason: 'prefixed');
   }
 
@@ -237,6 +246,21 @@
     assertOpType(returnValue: true, typeNames: true, voidReturn: true);
   }
 
+  test_Block_keyword() {
+    addTestSource('class C { static C get instance => null; } main() {C.in^}');
+    assertOpType(
+        prefixed: true, returnValue: true, typeNames: true, voidReturn: true);
+  }
+
+  test_Block_static() {
+    addTestSource('class A {static foo() {^}}');
+    assertOpType(
+        returnValue: true,
+        typeNames: true,
+        staticMethodBody: true,
+        voidReturn: true);
+  }
+
   test_Break_after_label() {
     addTestSource('main() { foo: while (true) { break foo ^ ; } }');
     assertOpType(/* No valid completions */);
@@ -607,7 +631,7 @@
   test_FunctionDeclaration_inLineComment4() {
     // Comment  CompilationUnit
     addTestSource('''
-      // normal comment 
+      // normal comment
       // normal comment 2^
       zoo(z) { } String name;''');
     assertOpType();
@@ -928,7 +952,7 @@
     // Comment  ClassDeclaration  CompilationUnit
     addTestSource('''
       class C2 {
-        // normal comment 
+        // normal comment
         // normal comment 2^
         zoo(z) { } String name; }''');
     assertOpType();
@@ -1118,12 +1142,60 @@
     assertOpType(returnValue: true, typeNames: true);
   }
 
-  test_SimpleFormalParameter() {
+  test_SimpleFormalParameter_closure() {
     // SimpleIdentifier  SimpleFormalParameter  FormalParameterList
     addTestSource('mth() { PNGS.sort((String a, Str^) => a.compareTo(b)); }');
     assertOpType(typeNames: true);
   }
 
+  test_SimpleFormalParameter_name1() {
+    // SimpleIdentifier  SimpleFormalParameter  FormalParameterList
+    addTestSource('m(String na^) {}');
+    assertOpType(typeNames: false);
+  }
+
+  test_SimpleFormalParameter_name2() {
+    // SimpleIdentifier  SimpleFormalParameter  FormalParameterList
+    addTestSource('m(int first, String na^) {}');
+    assertOpType(typeNames: false);
+  }
+
+  test_SimpleFormalParameter_type_optionalNamed() {
+    // SimpleIdentifier  DefaultFormalParameter  FormalParameterList
+    addTestSource('m({Str^}) {}');
+    assertOpType(typeNames: true);
+  }
+
+  test_SimpleFormalParameter_type_optionalPositional() {
+    // SimpleIdentifier  DefaultFormalParameter  FormalParameterList
+    addTestSource('m([Str^]) {}');
+    assertOpType(typeNames: true);
+  }
+
+  test_SimpleFormalParameter_type_withName() {
+    // SimpleIdentifier  SimpleFormalParameter  FormalParameterList
+    addTestSource('m(Str^ name) {}');
+    assertOpType(typeNames: true);
+  }
+
+  test_SimpleFormalParameter_type_withoutName1() {
+    // SimpleIdentifier  SimpleFormalParameter  FormalParameterList
+    addTestSource('m(Str^) {}');
+    assertOpType(typeNames: true);
+  }
+
+  test_SimpleFormalParameter_type_withoutName2() {
+    // FormalParameterList
+    addTestSource('m(^) {}');
+    assertOpType(typeNames: true);
+  }
+
+  test_SimpleFormalParameter_type_withoutName3() {
+    // SimpleIdentifier  SimpleFormalParameter  FormalParameterList
+    addTestSource('m(int first, Str^) {}');
+    assertOpType(typeNames: true);
+  }
+
   test_SwitchCase_before() {
     // SwitchCase  SwitchStatement  Block
     addTestSource('main() {switch(k) {^case 1:}}');
@@ -1296,6 +1368,20 @@
     assertOpType();
   }
 
+  test_VariableDeclaration_name_hasSome_parameterizedType() {
+    // SimpleIdentifier  VariableDeclaration  VariableDeclarationList
+    // VariableDeclarationStatement  Block
+    addTestSource('main() {List<int> m^}');
+    assertOpType();
+  }
+
+  test_VariableDeclaration_name_hasSome_simpleType() {
+    // SimpleIdentifier  VariableDeclaration  VariableDeclarationList
+    // VariableDeclarationStatement  Block
+    addTestSource('main() {String m^}');
+    assertOpType();
+  }
+
   test_VariableDeclarationList_final() {
     // VariableDeclarationList  VariableDeclarationStatement  Block
     addTestSource('main() {final ^}');
diff --git a/pkg/analysis_server/test/services/completion/prefixed_element_contributor_test.dart b/pkg/analysis_server/test/services/completion/prefixed_element_contributor_test.dart
index 7778869..6e15a0c 100644
--- a/pkg/analysis_server/test/services/completion/prefixed_element_contributor_test.dart
+++ b/pkg/analysis_server/test/services/completion/prefixed_element_contributor_test.dart
@@ -6,16 +6,17 @@
 
 import 'dart:async';
 
-import 'package:analysis_server/src/protocol.dart';
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/services/completion/dart_completion_manager.dart';
 import 'package:analysis_server/src/services/completion/prefixed_element_contributor.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 import 'package:unittest/unittest.dart';
 
+import '../../utils.dart';
 import 'completion_test_util.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(PrefixedElementContributorTest);
 }
 
@@ -216,6 +217,13 @@
     });
   }
 
+  test_keyword() {
+    addTestSource('class C { static C get instance => null; } main() {C.in^}');
+    return computeFull((bool result) {
+      assertSuggestGetter('instance', 'C');
+    });
+  }
+
   test_libraryPrefix() {
     // SimpleIdentifier  PrefixedIdentifier  ExpressionStatement
     addTestSource('import "dart:async" as bar; foo() {bar.^}');
@@ -233,6 +241,15 @@
     });
   }
 
+  test_libraryPrefix3() {
+    // SimpleIdentifier  MethodInvocation  ExpressionStatement
+    addTestSource('import "dart:async" as bar; foo() {new bar.F^ print("f")}');
+    return computeFull((bool result) {
+      assertSuggestConstructor('Future');
+      assertSuggestConstructor('Future.delayed');
+    });
+  }
+
   test_libraryPrefix_deferred() {
     // SimpleIdentifier  PrefixedIdentifier  ExpressionStatement
     addTestSource('import "dart:async" deferred as bar; foo() {bar.^}');
diff --git a/pkg/analysis_server/test/services/completion/test_all.dart b/pkg/analysis_server/test/services/completion/test_all.dart
index 3ccfb64..69735da 100644
--- a/pkg/analysis_server/test/services/completion/test_all.dart
+++ b/pkg/analysis_server/test/services/completion/test_all.dart
@@ -6,24 +6,26 @@
 
 import 'package:unittest/unittest.dart';
 
+import '../../utils.dart';
 import 'arglist_contributor_test.dart' as arglist_test;
 import 'combinator_contributor_test.dart' as combinator_test;
 import 'common_usage_computer_test.dart' as common_usage_computer_test;
 import 'completion_computer_test.dart' as completion_computer_test;
 import 'completion_manager_test.dart' as completion_manager_test;
 import 'completion_target_test.dart' as completion_target_test;
-import 'import_uri_contributor_test.dart' as import_uri_test;
 import 'imported_reference_contributor_test.dart' as imported_test;
+import 'inherited_computer_test.dart' as inherited_computer_test;
 import 'keyword_contributor_test.dart' as keyword_test;
 import 'local_declaration_visitor_test.dart' as local_declaration_visitor_test;
 import 'local_reference_contributor_test.dart'
     as local_reference_contributor_test;
 import 'optype_test.dart' as optype_test;
 import 'prefixed_element_contributor_test.dart' as invocation_test;
+import 'uri_contributor_test.dart' as uri_contributor_test;
 
 /// Utility for manually running all tests.
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   group('completion', () {
     arglist_test.main();
     combinator_test.main();
@@ -31,12 +33,13 @@
     completion_computer_test.main();
     completion_manager_test.main();
     completion_target_test.main();
-    import_uri_test.main();
     imported_test.main();
+    inherited_computer_test.main();
     invocation_test.main();
     keyword_test.main();
     local_declaration_visitor_test.main();
     local_reference_contributor_test.main();
     optype_test.main();
+    uri_contributor_test.main();
   });
 }
diff --git a/pkg/analysis_server/test/services/completion/uri_contributor_test.dart b/pkg/analysis_server/test/services/completion/uri_contributor_test.dart
new file mode 100644
index 0000000..22ebe15
--- /dev/null
+++ b/pkg/analysis_server/test/services/completion/uri_contributor_test.dart
@@ -0,0 +1,543 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library test.services.completion.contributor.dart.importuri;
+
+import 'package:analysis_server/plugin/protocol/protocol.dart';
+import 'package:analysis_server/src/services/completion/dart_completion_manager.dart';
+import 'package:analysis_server/src/services/completion/uri_contributor.dart';
+import 'package:analyzer/file_system/memory_file_system.dart';
+import 'package:path/path.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
+import 'package:unittest/unittest.dart';
+
+import '../../utils.dart';
+import 'completion_test_util.dart';
+
+main() {
+  initializeTestEnvironment();
+  defineReflectiveTests(UriContributorTest);
+  defineReflectiveTests(UriContributorWindowsTest);
+}
+
+@reflectiveTest
+class UriContributorTest extends AbstractCompletionTest {
+  @override
+  void setUpContributor() {
+    contributor = new UriContributor();
+  }
+
+  test_after_import() {
+    addTestSource('import "p"^');
+    computeFast();
+    expect(request.replacementOffset, completionOffset);
+    expect(request.replacementLength, 0);
+    assertNoSuggestions();
+  }
+
+  test_after_import_raw() {
+    addTestSource('import r"p"^');
+    computeFast();
+    expect(request.replacementOffset, completionOffset);
+    expect(request.replacementLength, 0);
+    assertNoSuggestions();
+  }
+
+  test_before_import() {
+    addTestSource('import ^"p"');
+    computeFast();
+    expect(request.replacementOffset, completionOffset);
+    expect(request.replacementLength, 0);
+    assertNoSuggestions();
+  }
+
+  test_before_import_raw() {
+    addTestSource('import ^r"p"');
+    computeFast();
+    expect(request.replacementOffset, completionOffset);
+    expect(request.replacementLength, 0);
+    assertNoSuggestions();
+  }
+
+  test_before_import_raw2() {
+    addTestSource('import r^"p"');
+    computeFast();
+    expect(request.replacementOffset, completionOffset);
+    expect(request.replacementLength, 0);
+    assertNoSuggestions();
+  }
+
+  test_export_package2() {
+    addPackageSource('foo', 'foo.dart', 'library foo;');
+    addPackageSource('foo', 'baz/too.dart', 'library too;');
+    addPackageSource('bar', 'bar.dart', 'library bar;');
+    addTestSource('export "package:foo/baz/^" import');
+    computeFast();
+    assertSuggest('package:foo/baz/too.dart',
+        csKind: CompletionSuggestionKind.IMPORT);
+  }
+
+  test_import() {
+    addTestSource('import "^"');
+    computeFast();
+    expect(request.replacementOffset, completionOffset);
+    expect(request.replacementLength, 0);
+    assertSuggest('dart:', csKind: CompletionSuggestionKind.IMPORT);
+    assertSuggest('package:', csKind: CompletionSuggestionKind.IMPORT);
+  }
+
+  test_import2() {
+    addTestSource('import "^" import');
+    computeFast();
+    expect(request.replacementOffset, completionOffset);
+    expect(request.replacementLength, 0);
+    assertSuggest('dart:', csKind: CompletionSuggestionKind.IMPORT);
+    assertSuggest('package:', csKind: CompletionSuggestionKind.IMPORT);
+  }
+
+  test_import_dart() {
+    addTestSource('import "d^" import');
+    computeFast();
+    expect(request.replacementOffset, completionOffset - 1);
+    expect(request.replacementLength, 1);
+    assertSuggest('dart:', csKind: CompletionSuggestionKind.IMPORT);
+    assertSuggest('dart:core',
+        csKind: CompletionSuggestionKind.IMPORT, relevance: DART_RELEVANCE_LOW);
+    assertNotSuggested('dart:_internal');
+    assertSuggest('dart:async', csKind: CompletionSuggestionKind.IMPORT);
+    assertSuggest('dart:math', csKind: CompletionSuggestionKind.IMPORT);
+  }
+
+  test_import_dart2() {
+    addTestSource('import "dart:async"; import "d^"');
+    computeFast();
+    expect(request.replacementOffset, completionOffset - 1);
+    expect(request.replacementLength, 1);
+    assertSuggest('dart:', csKind: CompletionSuggestionKind.IMPORT);
+    assertSuggest('dart:core',
+        csKind: CompletionSuggestionKind.IMPORT, relevance: DART_RELEVANCE_LOW);
+    assertNotSuggested('dart:_internal');
+    assertSuggest('dart:async', csKind: CompletionSuggestionKind.IMPORT);
+    assertSuggest('dart:math', csKind: CompletionSuggestionKind.IMPORT);
+  }
+
+  test_import_file() {
+    testFile = '/proj/completion.dart';
+    addSource('/proj/other.dart', 'library other;');
+    addSource('/proj/foo/bar.dart', 'library bar;');
+    addSource('/blat.dart', 'library blat;');
+    addTestSource('import "^" import');
+    computeFast();
+    expect(request.replacementOffset, completionOffset);
+    expect(request.replacementLength, 0);
+    assertNotSuggested('completion.dart');
+    assertSuggest('other.dart', csKind: CompletionSuggestionKind.IMPORT);
+    assertNotSuggested('foo');
+    assertSuggest('foo/', csKind: CompletionSuggestionKind.IMPORT);
+    assertNotSuggested('foo/bar.dart');
+    assertNotSuggested('../blat.dart');
+  }
+
+  test_import_file2() {
+    testFile = '/proj/completion.dart';
+    addSource('/proj/other.dart', 'library other;');
+    addSource('/proj/foo/bar.dart', 'library bar;');
+    addSource('/blat.dart', 'library blat;');
+    addTestSource('import "..^" import');
+    computeFast();
+    expect(request.replacementOffset, completionOffset - 2);
+    expect(request.replacementLength, 2);
+    assertNotSuggested('completion.dart');
+    assertSuggest('other.dart', csKind: CompletionSuggestionKind.IMPORT);
+    assertNotSuggested('foo');
+    assertSuggest('foo/', csKind: CompletionSuggestionKind.IMPORT);
+    assertNotSuggested('foo/bar.dart');
+    assertNotSuggested('../blat.dart');
+  }
+
+  test_import_file_child() {
+    testFile = '/proj/completion.dart';
+    addSource('/proj/other.dart', 'library other;');
+    addSource('/proj/foo/bar.dart', 'library bar;');
+    addSource('/blat.dart', 'library blat;');
+    addTestSource('import "foo/^" import');
+    computeFast();
+    expect(request.replacementOffset, completionOffset - 4);
+    expect(request.replacementLength, 4);
+    assertNotSuggested('completion.dart');
+    assertNotSuggested('other.dart');
+    assertNotSuggested('foo');
+    assertNotSuggested('foo/');
+    assertSuggest('foo/bar.dart', csKind: CompletionSuggestionKind.IMPORT);
+    assertNotSuggested('../blat.dart');
+  }
+
+  test_import_file_parent() {
+    testFile = '/proj/completion.dart';
+    addSource('/proj/other.dart', 'library other;');
+    addSource('/proj/foo/bar.dart', 'library bar;');
+    addSource('/blat.dart', 'library blat;');
+    addTestSource('import "../^" import');
+    computeFast();
+    expect(request.replacementOffset, completionOffset - 3);
+    expect(request.replacementLength, 3);
+    assertNotSuggested('completion.dart');
+    assertNotSuggested('other.dart');
+    assertNotSuggested('foo');
+    assertNotSuggested('foo/');
+    assertNotSuggested('foo/bar.dart');
+    assertSuggest('../blat.dart', csKind: CompletionSuggestionKind.IMPORT);
+  }
+
+  test_import_file_parent2() {
+    testFile = '/proj/completion.dart';
+    addSource('/proj/other.dart', 'library other;');
+    addSource('/proj/foo/bar.dart', 'library bar;');
+    addSource('/blat.dart', 'library blat;');
+    addTestSource('import "../b^" import');
+    computeFast();
+    expect(request.replacementOffset, completionOffset - 4);
+    expect(request.replacementLength, 4);
+    assertNotSuggested('completion.dart');
+    assertNotSuggested('other.dart');
+    assertNotSuggested('foo');
+    assertNotSuggested('foo/');
+    assertNotSuggested('foo/bar.dart');
+    assertSuggest('../blat.dart', csKind: CompletionSuggestionKind.IMPORT);
+  }
+
+  test_import_package() {
+    addPackageSource('foo', 'foo.dart', 'library foo;');
+    addPackageSource('foo', 'baz/too.dart', 'library too;');
+    addPackageSource('bar', 'bar.dart', 'library bar;');
+    addTestSource('import "p^" import');
+    computeFast();
+    expect(request.replacementOffset, completionOffset - 1);
+    expect(request.replacementLength, 1);
+    assertSuggest('package:', csKind: CompletionSuggestionKind.IMPORT);
+    assertSuggest('package:foo/', csKind: CompletionSuggestionKind.IMPORT);
+    assertSuggest('package:foo/foo.dart',
+        csKind: CompletionSuggestionKind.IMPORT);
+    assertSuggest('package:foo/baz/', csKind: CompletionSuggestionKind.IMPORT);
+    assertNotSuggested('package:foo/baz/too.dart');
+    assertSuggest('package:bar/', csKind: CompletionSuggestionKind.IMPORT);
+    assertSuggest('package:bar/bar.dart',
+        csKind: CompletionSuggestionKind.IMPORT);
+  }
+
+  test_import_package2() {
+    addPackageSource('foo', 'foo.dart', 'library foo;');
+    addPackageSource('foo', 'baz/too.dart', 'library too;');
+    addPackageSource('bar', 'bar.dart', 'library bar;');
+    addTestSource('import "package:foo/baz/^" import');
+    computeFast();
+    assertSuggest('package:foo/baz/too.dart',
+        csKind: CompletionSuggestionKind.IMPORT);
+  }
+
+  test_import_package2_raw() {
+    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');
+    computeFast();
+    assertSuggest('package:foo/baz/too.dart',
+        csKind: CompletionSuggestionKind.IMPORT);
+  }
+
+  test_import_package_missing_lib() {
+    var pkgSrc = addPackageSource('bar', 'bar.dart', 'library bar;');
+    provider.deleteFolder(dirname(pkgSrc.fullName));
+    addTestSource('import "p^" class');
+    computeFast();
+    expect(request.replacementOffset, completionOffset - 1);
+    expect(request.replacementLength, 1);
+    assertSuggest('package:', csKind: CompletionSuggestionKind.IMPORT);
+    assertSuggest('package:bar/', csKind: CompletionSuggestionKind.IMPORT);
+    assertNotSuggested('package:bar/bar.dart');
+  }
+
+  test_import_package_raw() {
+    addPackageSource('foo', 'foo.dart', 'library foo;');
+    addPackageSource('foo', 'baz/too.dart', 'library too;');
+    addPackageSource('bar', 'bar.dart', 'library bar;');
+    addTestSource('import r"p^" import');
+    computeFast();
+    expect(request.replacementOffset, completionOffset - 1);
+    expect(request.replacementLength, 1);
+    assertSuggest('package:', csKind: CompletionSuggestionKind.IMPORT);
+    assertSuggest('package:foo/', csKind: CompletionSuggestionKind.IMPORT);
+    assertSuggest('package:foo/foo.dart',
+        csKind: CompletionSuggestionKind.IMPORT);
+    assertSuggest('package:foo/baz/', csKind: CompletionSuggestionKind.IMPORT);
+    assertNotSuggested('package:foo/baz/too.dart');
+    assertSuggest('package:bar/', csKind: CompletionSuggestionKind.IMPORT);
+    assertSuggest('package:bar/bar.dart',
+        csKind: CompletionSuggestionKind.IMPORT);
+  }
+
+  test_import_raw() {
+    addTestSource('import r"^" import');
+    computeFast();
+    expect(request.replacementOffset, completionOffset);
+    expect(request.replacementLength, 0);
+    assertSuggest('dart:', csKind: CompletionSuggestionKind.IMPORT);
+    assertSuggest('package:', csKind: CompletionSuggestionKind.IMPORT);
+  }
+
+  test_outside_import() {
+    addTestSource('import ^"d" import');
+    computeFast();
+    computeFull((_) {
+      assertNoSuggestions();
+    });
+  }
+
+  test_outside_import2() {
+    addTestSource('import "d"^ import');
+    computeFast();
+    computeFull((_) {
+      assertNoSuggestions();
+    });
+  }
+
+  test_part_file() {
+    testFile = '/proj/completion.dart';
+    addSource('/proj/other.dart', 'library other;');
+    addSource('/proj/foo/bar.dart', 'library bar;');
+    addSource('/blat.dart', 'library blat;');
+    addTestSource('library x; part "^" import');
+    computeFast();
+    expect(request.replacementOffset, completionOffset);
+    expect(request.replacementLength, 0);
+    assertNotSuggested('completion.dart');
+    assertSuggest('other.dart', csKind: CompletionSuggestionKind.IMPORT);
+    assertNotSuggested('foo');
+    assertSuggest('foo/', csKind: CompletionSuggestionKind.IMPORT);
+    assertNotSuggested('foo/bar.dart');
+    assertNotSuggested('../blat.dart');
+  }
+
+  test_part_file2() {
+    testFile = '/proj/completion.dart';
+    addSource('/proj/other.dart', 'library other;');
+    addSource('/proj/foo/bar.dart', 'library bar;');
+    addSource('/blat.dart', 'library blat;');
+    addTestSource('library x; part "..^" import');
+    computeFast();
+    expect(request.replacementOffset, completionOffset - 2);
+    expect(request.replacementLength, 2);
+    assertNotSuggested('completion.dart');
+    assertSuggest('other.dart', csKind: CompletionSuggestionKind.IMPORT);
+    assertNotSuggested('foo');
+    assertSuggest('foo/', csKind: CompletionSuggestionKind.IMPORT);
+    assertNotSuggested('foo/bar.dart');
+    assertNotSuggested('../blat.dart');
+  }
+
+  test_part_file_child() {
+    testFile = '/proj/completion.dart';
+    addSource('/proj/other.dart', 'library other;');
+    addSource('/proj/foo/bar.dart', 'library bar;');
+    addSource('/blat.dart', 'library blat;');
+    addTestSource('library x; part "foo/^" import');
+    computeFast();
+    expect(request.replacementOffset, completionOffset - 4);
+    expect(request.replacementLength, 4);
+    assertNotSuggested('completion.dart');
+    assertNotSuggested('other.dart');
+    assertNotSuggested('foo');
+    assertNotSuggested('foo/');
+    assertSuggest('foo/bar.dart', csKind: CompletionSuggestionKind.IMPORT);
+    assertNotSuggested('../blat.dart');
+  }
+
+  test_part_file_parent() {
+    testFile = '/proj/completion.dart';
+    addSource('/proj/other.dart', 'library other;');
+    addSource('/proj/foo/bar.dart', 'library bar;');
+    addSource('/blat.dart', 'library blat;');
+    addTestSource('library x; part "../^" import');
+    computeFast();
+    expect(request.replacementOffset, completionOffset - 3);
+    expect(request.replacementLength, 3);
+    assertNotSuggested('completion.dart');
+    assertNotSuggested('other.dart');
+    assertNotSuggested('foo');
+    assertNotSuggested('foo/');
+    assertNotSuggested('foo/bar.dart');
+    assertSuggest('../blat.dart', csKind: CompletionSuggestionKind.IMPORT);
+  }
+}
+
+@reflectiveTest
+class UriContributorWindowsTest extends AbstractCompletionTest {
+  @override
+  void setUpContributor() {
+    contributor = new UriContributor();
+  }
+
+  @override
+  void setupResourceProvider() {
+    provider = new _TestWinResourceProvider();
+  }
+
+  test_import_file() {
+    testFile = '\\proj\\completion.dart';
+    addSource('\\proj\\other.dart', 'library other;');
+    addSource('\\proj\\foo\\bar.dart', 'library bar;');
+    addSource('\\blat.dart', 'library blat;');
+    addTestSource('import "^" import');
+    computeFast();
+    expect(request.replacementOffset, completionOffset);
+    expect(request.replacementLength, 0);
+    assertNotSuggested('completion.dart');
+    assertSuggest('other.dart', csKind: CompletionSuggestionKind.IMPORT);
+    assertNotSuggested('foo');
+    assertSuggest('foo/', csKind: CompletionSuggestionKind.IMPORT);
+    assertNotSuggested('foo/bar.dart');
+    assertNotSuggested('../blat.dart');
+  }
+
+  test_import_file2() {
+    testFile = '\\proj\\completion.dart';
+    addSource('\\proj\\other.dart', 'library other;');
+    addSource('\\proj\\foo\\bar.dart', 'library bar;');
+    addSource('\\blat.dart', 'library blat;');
+    addTestSource('import "..^" import');
+    computeFast();
+    expect(request.replacementOffset, completionOffset - 2);
+    expect(request.replacementLength, 2);
+    assertNotSuggested('completion.dart');
+    assertSuggest('other.dart', csKind: CompletionSuggestionKind.IMPORT);
+    assertNotSuggested('foo');
+    assertSuggest('foo/', csKind: CompletionSuggestionKind.IMPORT);
+    assertNotSuggested('foo/bar.dart');
+    assertNotSuggested('../blat.dart');
+  }
+
+  test_import_file_child() {
+    testFile = '\\proj\\completion.dart';
+    addSource('\\proj\\other.dart', 'library other;');
+    addSource('\\proj\\foo\\bar.dart', 'library bar;');
+    addSource('\\blat.dart', 'library blat;');
+    addTestSource('import "foo/^" import');
+    computeFast();
+    expect(request.replacementOffset, completionOffset - 4);
+    expect(request.replacementLength, 4);
+    assertNotSuggested('completion.dart');
+    assertNotSuggested('other.dart');
+    assertNotSuggested('foo');
+    assertNotSuggested('foo/');
+    assertSuggest('foo/bar.dart', csKind: CompletionSuggestionKind.IMPORT);
+    assertNotSuggested('../blat.dart');
+  }
+
+  test_import_file_parent() {
+    testFile = '\\proj\\completion.dart';
+    addSource('\\proj\\other.dart', 'library other;');
+    addSource('\\proj\\foo\\bar.dart', 'library bar;');
+    addSource('\\blat.dart', 'library blat;');
+    addTestSource('import "../^" import');
+    computeFast();
+    expect(request.replacementOffset, completionOffset - 3);
+    expect(request.replacementLength, 3);
+    assertNotSuggested('completion.dart');
+    assertNotSuggested('other.dart');
+    assertNotSuggested('foo');
+    assertNotSuggested('foo/');
+    assertNotSuggested('foo/bar.dart');
+    assertSuggest('../blat.dart', csKind: CompletionSuggestionKind.IMPORT);
+  }
+
+  test_import_file_parent2() {
+    testFile = '\\proj\\completion.dart';
+    addSource('\\proj\\other.dart', 'library other;');
+    addSource('\\proj\\foo\\bar.dart', 'library bar;');
+    addSource('\\blat.dart', 'library blat;');
+    addTestSource('import "../b^" import');
+    computeFast();
+    expect(request.replacementOffset, completionOffset - 4);
+    expect(request.replacementLength, 4);
+    assertNotSuggested('completion.dart');
+    assertNotSuggested('other.dart');
+    assertNotSuggested('foo');
+    assertNotSuggested('foo/');
+    assertNotSuggested('foo/bar.dart');
+    assertSuggest('../blat.dart', csKind: CompletionSuggestionKind.IMPORT);
+  }
+
+  test_part_file() {
+    testFile = '\\proj\\completion.dart';
+    addSource('\\proj\\other.dart', 'library other;');
+    addSource('\\proj\\foo\\bar.dart', 'library bar;');
+    addSource('\\blat.dart', 'library blat;');
+    addTestSource('library x; part "^" import');
+    computeFast();
+    expect(request.replacementOffset, completionOffset);
+    expect(request.replacementLength, 0);
+    assertNotSuggested('completion.dart');
+    assertSuggest('other.dart', csKind: CompletionSuggestionKind.IMPORT);
+    assertNotSuggested('foo');
+    assertSuggest('foo/', csKind: CompletionSuggestionKind.IMPORT);
+    assertNotSuggested('foo/bar.dart');
+    assertNotSuggested('../blat.dart');
+  }
+
+  test_part_file2() {
+    testFile = '\\proj\\completion.dart';
+    addSource('\\proj\\other.dart', 'library other;');
+    addSource('\\proj\\foo\\bar.dart', 'library bar;');
+    addSource('\\blat.dart', 'library blat;');
+    addTestSource('library x; part "..^" import');
+    computeFast();
+    expect(request.replacementOffset, completionOffset - 2);
+    expect(request.replacementLength, 2);
+    assertNotSuggested('completion.dart');
+    assertSuggest('other.dart', csKind: CompletionSuggestionKind.IMPORT);
+    assertNotSuggested('foo');
+    assertSuggest('foo/', csKind: CompletionSuggestionKind.IMPORT);
+    assertNotSuggested('foo/bar.dart');
+    assertNotSuggested('../blat.dart');
+  }
+
+  test_part_file_child() {
+    testFile = '\\proj\\completion.dart';
+    addSource('\\proj\\other.dart', 'library other;');
+    addSource('\\proj\\foo\\bar.dart', 'library bar;');
+    addSource('\\blat.dart', 'library blat;');
+    addTestSource('library x; part "foo/^" import');
+    computeFast();
+    expect(request.replacementOffset, completionOffset - 4);
+    expect(request.replacementLength, 4);
+    assertNotSuggested('completion.dart');
+    assertNotSuggested('other.dart');
+    assertNotSuggested('foo');
+    assertNotSuggested('foo/');
+    assertSuggest('foo/bar.dart', csKind: CompletionSuggestionKind.IMPORT);
+    assertNotSuggested('../blat.dart');
+  }
+
+  test_part_file_parent() {
+    testFile = '\\proj\\completion.dart';
+    addSource('\\proj\\other.dart', 'library other;');
+    addSource('\\proj\\foo\\bar.dart', 'library bar;');
+    addSource('\\blat.dart', 'library blat;');
+    addTestSource('library x; part "../^" import');
+    computeFast();
+    expect(request.replacementOffset, completionOffset - 3);
+    expect(request.replacementLength, 3);
+    assertNotSuggested('completion.dart');
+    assertNotSuggested('other.dart');
+    assertNotSuggested('foo');
+    assertNotSuggested('foo/');
+    assertNotSuggested('foo/bar.dart');
+    assertSuggest('../blat.dart', csKind: CompletionSuggestionKind.IMPORT);
+  }
+}
+
+class _TestWinResourceProvider extends MemoryResourceProvider {
+  @override
+  Context get pathContext => windows;
+}
diff --git a/pkg/analysis_server/test/services/correction/assist_test.dart b/pkg/analysis_server/test/services/correction/assist_test.dart
index e1c9f62..2885f27 100644
--- a/pkg/analysis_server/test/services/correction/assist_test.dart
+++ b/pkg/analysis_server/test/services/correction/assist_test.dart
@@ -4,9 +4,9 @@
 
 library test.services.correction.assist;
 
-import 'package:analysis_server/edit/assist/assist_core.dart';
+import 'package:analysis_server/plugin/edit/assist/assist_core.dart';
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/plugin/server_plugin.dart';
-import 'package:analysis_server/src/protocol.dart';
 import 'package:analysis_server/src/services/correction/assist.dart';
 import 'package:analyzer/src/generated/source.dart';
 import 'package:plugin/manager.dart';
@@ -14,9 +14,10 @@
 import 'package:unittest/unittest.dart';
 
 import '../../abstract_single_unit.dart';
+import '../../utils.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(AssistProcessorTest);
 }
 
@@ -793,6 +794,26 @@
     assertNoAssistAt('vvv =', DartAssistKind.ASSIGN_TO_LOCAL_VARIABLE);
   }
 
+  void test_assignToLocalVariable_inClosure() {
+    resolveTestUnit(r'''
+main() {
+  print(() {
+    12345;
+  });
+}
+''');
+    assertHasAssistAt(
+        '345',
+        DartAssistKind.ASSIGN_TO_LOCAL_VARIABLE,
+        '''
+main() {
+  print(() {
+    var i = 12345;
+  });
+}
+''');
+  }
+
   void test_assignToLocalVariable_invocationArgument() {
     resolveTestUnit(r'''
 main() {
@@ -822,6 +843,24 @@
     assertNoAssistAt('f();', DartAssistKind.ASSIGN_TO_LOCAL_VARIABLE);
   }
 
+  void test_convertToBlockBody_OK_async() {
+    resolveTestUnit('''
+class A {
+  mmm() async => 123;
+}
+''');
+    assertHasAssistAt(
+        'mmm()',
+        DartAssistKind.CONVERT_INTO_BLOCK_BODY,
+        '''
+class A {
+  mmm() async {
+    return 123;
+  }
+}
+''');
+  }
+
   void test_convertToBlockBody_OK_closure() {
     resolveTestUnit('''
 setup(x) {}
@@ -954,6 +993,24 @@
     assertNoAssistAt('fff() {', DartAssistKind.CONVERT_INTO_BLOCK_BODY);
   }
 
+  void test_convertToExpressionBody_OK_async() {
+    resolveTestUnit('''
+class A {
+  mmm() async {
+    return 42;
+  }
+}
+''');
+    assertHasAssistAt(
+        'mmm',
+        DartAssistKind.CONVERT_INTO_EXPRESSION_BODY,
+        '''
+class A {
+  mmm() async => 42;
+}
+''');
+  }
+
   void test_convertToExpressionBody_OK_closure() {
     resolveTestUnit('''
 setup(x) {}
diff --git a/pkg/analysis_server/test/services/correction/change_test.dart b/pkg/analysis_server/test/services/correction/change_test.dart
index 3a551ca..0cc92b4 100644
--- a/pkg/analysis_server/test/services/correction/change_test.dart
+++ b/pkg/analysis_server/test/services/correction/change_test.dart
@@ -10,8 +10,10 @@
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 import 'package:unittest/unittest.dart';
 
+import '../../utils.dart';
+
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(ChangeTest);
   defineReflectiveTests(EditTest);
   defineReflectiveTests(FileEditTest);
@@ -152,13 +154,10 @@
     expect(edit.offset, 1);
     expect(edit.length, 2);
     expect(edit.replacement, 'foo');
-    expect(edit.toJson(), {
-      'offset': 1,
-      'length': 2,
-      'replacement': 'foo',
-      'id': 'my-id'
-    });
+    expect(edit.toJson(),
+        {'offset': 1, 'length': 2, 'replacement': 'foo', 'id': 'my-id'});
   }
+
   void test_toJson() {
     SourceEdit edit = new SourceEdit(1, 2, 'foo');
     var expectedJson = {OFFSET: 1, LENGTH: 2, REPLACEMENT: 'foo'};
@@ -195,7 +194,9 @@
     SourceFileEdit fileEdit = new SourceFileEdit('/test.dart', 100);
     fileEdit.add(new SourceEdit(1, 2, 'aaa'));
     fileEdit.add(new SourceEdit(10, 20, 'bbb'));
-    expect(fileEdit.toString(), '{"file":"/test.dart","fileStamp":100,"edits":['
+    expect(
+        fileEdit.toString(),
+        '{"file":"/test.dart","fileStamp":100,"edits":['
         '{"offset":10,"length":20,"replacement":"bbb"},'
         '{"offset":1,"length":2,"replacement":"aaa"}]}');
   }
@@ -222,7 +223,10 @@
     LinkedEditGroup group = new LinkedEditGroup.empty();
     group.addPosition(new Position('/a.dart', 1), 2);
     group.addPosition(new Position('/b.dart', 10), 2);
-    expect(group.toString(), '{"positions":[' '{"file":"/a.dart","offset":1},'
+    expect(
+        group.toString(),
+        '{"positions":['
+        '{"file":"/a.dart","offset":1},'
         '{"file":"/b.dart","offset":10}],"length":2,"suggestions":[]}');
   }
 
diff --git a/pkg/analysis_server/test/services/correction/fix_test.dart b/pkg/analysis_server/test/services/correction/fix_test.dart
index 13d3d99..14f2fc8 100644
--- a/pkg/analysis_server/test/services/correction/fix_test.dart
+++ b/pkg/analysis_server/test/services/correction/fix_test.dart
@@ -4,8 +4,9 @@
 
 library test.services.correction.fix;
 
-import 'package:analysis_server/edit/fix/fix_core.dart';
-import 'package:analysis_server/src/protocol.dart' hide AnalysisError;
+import 'package:analysis_server/plugin/edit/fix/fix_core.dart';
+import 'package:analysis_server/plugin/protocol/protocol.dart'
+    hide AnalysisError;
 import 'package:analysis_server/src/services/correction/fix.dart';
 import 'package:analysis_server/src/services/correction/fix_internal.dart';
 import 'package:analyzer/file_system/file_system.dart';
@@ -18,9 +19,10 @@
 
 import '../../abstract_context.dart';
 import '../../abstract_single_unit.dart';
+import '../../utils.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(FixProcessorTest);
 }
 
@@ -540,6 +542,15 @@
     _assertLinkedGroup(change.linkedEditGroups[0], ['Test v =', 'Test {']);
   }
 
+  void test_createClass_BAD_hasUnresolvedPrefix() {
+    resolveTestUnit('''
+main() {
+  prefix.Test v = null;
+}
+''');
+    assertNoFix(DartFixKind.CREATE_CLASS);
+  }
+
   void test_createClass_inLibraryOfPrefix() {
     String libCode = r'''
 library my.lib;
@@ -1533,6 +1544,37 @@
 ''');
   }
 
+  void test_createGetter_location_afterLastGetter() {
+    resolveTestUnit('''
+class A {
+  int existingField;
+
+  int get existingGetter => null;
+
+  existingMethod() {}
+}
+main(A a) {
+  int v = a.test;
+}
+''');
+    assertHasFix(
+        DartFixKind.CREATE_GETTER,
+        '''
+class A {
+  int existingField;
+
+  int get existingGetter => null;
+
+  int get test => null;
+
+  existingMethod() {}
+}
+main(A a) {
+  int v = a.test;
+}
+''');
+  }
+
   void test_createGetter_multiLevel() {
     resolveTestUnit('''
 class A {
@@ -2202,37 +2244,6 @@
 ''');
   }
 
-  void test_creatGetter_location_afterLastGetter() {
-    resolveTestUnit('''
-class A {
-  int existingField;
-
-  int get existingGetter => null;
-
-  existingMethod() {}
-}
-main(A a) {
-  int v = a.test;
-}
-''');
-    assertHasFix(
-        DartFixKind.CREATE_GETTER,
-        '''
-class A {
-  int existingField;
-
-  int get existingGetter => null;
-
-  int get test => null;
-
-  existingMethod() {}
-}
-main(A a) {
-  int v = a.test;
-}
-''');
-  }
-
   void test_creationFunction_forFunctionType_cascadeSecond() {
     resolveTestUnit('''
 class A {
@@ -2611,44 +2622,6 @@
 ''');
   }
 
-  void test_importLibraryPrefix_withClass() {
-    resolveTestUnit('''
-import 'dart:async' as pref;
-main() {
-  pref.Stream s = null;
-  Future f = null;
-}
-''');
-    assertHasFix(
-        DartFixKind.IMPORT_LIBRARY_PREFIX,
-        '''
-import 'dart:async' as pref;
-main() {
-  pref.Stream s = null;
-  pref.Future f = null;
-}
-''');
-  }
-
-  void test_importLibraryPrefix_withTopLevelVariable() {
-    resolveTestUnit('''
-import 'dart:math' as pref;
-main() {
-  print(pref.E);
-  print(PI);
-}
-''');
-    assertHasFix(
-        DartFixKind.IMPORT_LIBRARY_PREFIX,
-        '''
-import 'dart:math' as pref;
-main() {
-  print(pref.E);
-  print(pref.PI);
-}
-''');
-  }
-
   void test_importLibraryProject_withClass_annotation() {
     addSource(
         '/lib.dart',
@@ -2675,6 +2648,41 @@
 ''');
   }
 
+  void test_importLibraryProject_withClass_hasOtherLibraryWithPrefix() {
+    testFile = '/project/bin/test.dart';
+    addSource(
+        '/project/bin/a.dart',
+        '''
+library a;
+class One {}
+''');
+    addSource(
+        '/project/bin/b.dart',
+        '''
+library b;
+class One {}
+class Two {}
+''');
+    resolveTestUnit('''
+import 'b.dart' show Two;
+main () {
+  new Two();
+  new One();
+}
+''');
+    performAllAnalysisTasks();
+    assertHasFix(
+        DartFixKind.IMPORT_LIBRARY_PROJECT,
+        '''
+import 'b.dart' show Two;
+import 'a.dart';
+main () {
+  new Two();
+  new One();
+}
+''');
+  }
+
   void test_importLibraryProject_withClass_inParentFolder() {
     testFile = '/project/bin/test.dart';
     addSource(
@@ -3125,6 +3133,25 @@
     }
   }
 
+  void test_nonBoolCondition_addNotNull() {
+    resolveTestUnit('''
+main(String p) {
+  if (p) {
+    print(p);
+  }
+}
+''');
+    assertHasFix(
+        DartFixKind.ADD_NE_NULL,
+        '''
+main(String p) {
+  if (p != null) {
+    print(p);
+  }
+}
+''');
+  }
+
   void test_removeDeadCode_condition() {
     resolveTestUnit('''
 main(int p) {
@@ -4201,6 +4228,84 @@
 ''');
   }
 
+  void test_undefinedMethod_parameterType_differentPrefixInTargetUnit() {
+    String code2 = r'''
+library test2;
+import 'test3.dart' as bbb;
+export 'test3.dart';
+class D {
+}
+''';
+    addSource('/test2.dart', code2);
+    addSource(
+        '/test3.dart',
+        r'''
+library test3;
+class E {}
+''');
+    resolveTestUnit('''
+library test;
+import 'test2.dart' as aaa;
+main(aaa.D d, aaa.E e) {
+  d.foo(e);
+}
+''');
+    AnalysisError error = _findErrorToFix();
+    fix = _assertHasFix(DartFixKind.CREATE_METHOD, error);
+    change = fix.change;
+    // apply to "test2.dart"
+    List<SourceFileEdit> fileEdits = change.edits;
+    expect(fileEdits, hasLength(1));
+    SourceFileEdit fileEdit = change.edits[0];
+    expect(fileEdit.file, '/test2.dart');
+    expect(
+        SourceEdit.applySequence(code2, fileEdit.edits),
+        r'''
+library test2;
+import 'test3.dart' as bbb;
+export 'test3.dart';
+class D {
+  void foo(bbb.E e) {
+  }
+}
+''');
+  }
+
+  void test_undefinedMethod_parameterType_inTargetUnit() {
+    String code2 = r'''
+library test2;
+class D {
+}
+class E {}
+''';
+    addSource('/test2.dart', code2);
+    resolveTestUnit('''
+library test;
+import 'test2.dart' as test2;
+main(test2.D d, test2.E e) {
+  d.foo(e);
+}
+''');
+    AnalysisError error = _findErrorToFix();
+    fix = _assertHasFix(DartFixKind.CREATE_METHOD, error);
+    change = fix.change;
+    // apply to "test2.dart"
+    List<SourceFileEdit> fileEdits = change.edits;
+    expect(fileEdits, hasLength(1));
+    SourceFileEdit fileEdit = change.edits[0];
+    expect(fileEdit.file, '/test2.dart');
+    expect(
+        SourceEdit.applySequence(code2, fileEdit.edits),
+        r'''
+library test2;
+class D {
+  void foo(E e) {
+  }
+}
+class E {}
+''');
+  }
+
   void test_undefinedMethod_useSimilar_ignoreOperators() {
     resolveTestUnit('''
 main(Object object) {
@@ -4363,6 +4468,44 @@
 ''');
   }
 
+  void test_useImportPrefix_withClass() {
+    resolveTestUnit('''
+import 'dart:async' as pref;
+main() {
+  pref.Stream s = null;
+  Future f = null;
+}
+''');
+    assertHasFix(
+        DartFixKind.IMPORT_LIBRARY_PREFIX,
+        '''
+import 'dart:async' as pref;
+main() {
+  pref.Stream s = null;
+  pref.Future f = null;
+}
+''');
+  }
+
+  void test_useImportPrefix_withTopLevelVariable() {
+    resolveTestUnit('''
+import 'dart:math' as pref;
+main() {
+  print(pref.E);
+  print(PI);
+}
+''');
+    assertHasFix(
+        DartFixKind.IMPORT_LIBRARY_PREFIX,
+        '''
+import 'dart:math' as pref;
+main() {
+  print(pref.E);
+  print(pref.PI);
+}
+''');
+  }
+
   /**
    * Computes fixes and verifies that there is a fix of the given kind.
    */
diff --git a/pkg/analysis_server/test/services/correction/levenshtein_test.dart b/pkg/analysis_server/test/services/correction/levenshtein_test.dart
index bf5d6e5..a1b0a92 100644
--- a/pkg/analysis_server/test/services/correction/levenshtein_test.dart
+++ b/pkg/analysis_server/test/services/correction/levenshtein_test.dart
@@ -8,8 +8,10 @@
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 import 'package:unittest/unittest.dart';
 
+import '../../utils.dart';
+
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(LevenshteinTest);
 }
 
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 e7aa554..deb386d 100644
--- a/pkg/analysis_server/test/services/correction/name_suggestion_test.dart
+++ b/pkg/analysis_server/test/services/correction/name_suggestion_test.dart
@@ -11,9 +11,10 @@
 import 'package:unittest/unittest.dart';
 
 import '../../abstract_single_unit.dart';
+import '../../utils.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(VariableNameSuggestionTest);
 }
 
@@ -57,11 +58,13 @@
     DartType expectedType = (findElement('res') as LocalVariableElement).type;
     Expression assignedExpression = findNodeAtString('0.0;');
     // first choice for "double" is "d"
-    expect(getVariableNameSuggestionsForExpression(
+    expect(
+        getVariableNameSuggestionsForExpression(
             expectedType, assignedExpression, new Set.from([])),
         unorderedEquals(['d']));
     // if "d" is used, try "e", "f", etc
-    expect(getVariableNameSuggestionsForExpression(
+    expect(
+        getVariableNameSuggestionsForExpression(
             expectedType, assignedExpression, new Set.from(['d', 'e'])),
         unorderedEquals(['f']));
   }
@@ -75,11 +78,13 @@
     DartType expectedType = (findElement('res') as LocalVariableElement).type;
     Expression assignedExpression = findNodeAtString('0;');
     // first choice for "int" is "i"
-    expect(getVariableNameSuggestionsForExpression(
+    expect(
+        getVariableNameSuggestionsForExpression(
             expectedType, assignedExpression, new Set.from([])),
         unorderedEquals(['i']));
     // if "i" is used, try "j", "k", etc
-    expect(getVariableNameSuggestionsForExpression(
+    expect(
+        getVariableNameSuggestionsForExpression(
             expectedType, assignedExpression, new Set.from(['i', 'j'])),
         unorderedEquals(['k']));
   }
@@ -93,7 +98,8 @@
     DartType expectedType = (findElement('res') as LocalVariableElement).type;
     Expression assignedExpression = findNodeAtString("'abc';");
     // first choice for "String" is "s"
-    expect(getVariableNameSuggestionsForExpression(
+    expect(
+        getVariableNameSuggestionsForExpression(
             expectedType, assignedExpression, new Set.from([])),
         unorderedEquals(['s']));
   }
@@ -109,10 +115,12 @@
 }
 ''');
     var excluded = new Set.from([]);
-    expect(getVariableNameSuggestionsForExpression(
+    expect(
+        getVariableNameSuggestionsForExpression(
             null, findNodeAtString('new NoSuchClass()'), excluded),
         unorderedEquals(['noSuchClass', 'suchClass', 'class']));
-    expect(getVariableNameSuggestionsForExpression(
+    expect(
+        getVariableNameSuggestionsForExpression(
             null, findNodeAtString('new NoSuchClass.named()'), excluded),
         unorderedEquals(['noSuchClass', 'suchClass', 'class']));
     // TODO(scheglov) This test does not work.
@@ -238,9 +246,12 @@
 }
 ''');
     var excluded = new Set.from([]);
-    expect(getVariableNameSuggestionsForExpression(null,
-        findNodeAtString('p.sorted', (node) => node is PrefixedIdentifier),
-        excluded), unorderedEquals(['sortedNodes', 'nodes']));
+    expect(
+        getVariableNameSuggestionsForExpression(
+            null,
+            findNodeAtString('p.sorted', (node) => node is PrefixedIdentifier),
+            excluded),
+        unorderedEquals(['sortedNodes', 'nodes']));
   }
 
   void test_forExpression_privateName() {
@@ -251,12 +262,18 @@
 }
 ''');
     var excluded = new Set.from([]);
-    expect(getVariableNameSuggestionsForExpression(null,
-        findNodeAtString('p._name', (node) => node is PrefixedIdentifier),
-        excluded), unorderedEquals(['name']));
-    expect(getVariableNameSuggestionsForExpression(null,
-        findNodeAtString('p._compute', (node) => node is MethodInvocation),
-        excluded), unorderedEquals(['computeSuffix', 'suffix']));
+    expect(
+        getVariableNameSuggestionsForExpression(
+            null,
+            findNodeAtString('p._name', (node) => node is PrefixedIdentifier),
+            excluded),
+        unorderedEquals(['name']));
+    expect(
+        getVariableNameSuggestionsForExpression(
+            null,
+            findNodeAtString('p._compute', (node) => node is MethodInvocation),
+            excluded),
+        unorderedEquals(['computeSuffix', 'suffix']));
   }
 
   void test_forExpression_propertyAccess() {
@@ -293,8 +310,12 @@
 }
 ''');
     var excluded = new Set.from([]);
-    expect(getVariableNameSuggestionsForExpression(null, findNodeAtString(
-            'getSortedNodes();', (node) => node is MethodInvocation), excluded),
+    expect(
+        getVariableNameSuggestionsForExpression(
+            null,
+            findNodeAtString(
+                'getSortedNodes();', (node) => node is MethodInvocation),
+            excluded),
         unorderedEquals(['sortedNodes', 'nodes']));
   }
 
@@ -314,22 +335,4 @@
           unorderedEquals(['goodbyeCruelWorld', 'cruelWorld', 'world2']));
     }
   }
-
-  void test_getCamelWords_empty() {
-    expect(getCamelWords(''), unorderedEquals([]));
-  }
-
-  void test_getCamelWords_multipleUpper() {
-    expect(getCamelWords('sortedHTMLNodes'),
-        unorderedEquals(['sorted', 'HTML', 'Nodes']));
-  }
-
-  void test_getCamelWords_simpleCamel() {
-    expect(getCamelWords('mySimpleText'),
-        unorderedEquals(['my', 'Simple', 'Text']));
-  }
-
-  void test_getCamelWords_simpleName() {
-    expect(getCamelWords('name'), unorderedEquals(['name']));
-  }
 }
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 d9423a4..f21b14f 100644
--- a/pkg/analysis_server/test/services/correction/organize_directives_test.dart
+++ b/pkg/analysis_server/test/services/correction/organize_directives_test.dart
@@ -4,16 +4,18 @@
 
 library test.services.refactoring.organize_directives;
 
-import 'package:analysis_server/src/protocol.dart' hide AnalysisError;
+import 'package:analysis_server/plugin/protocol/protocol.dart'
+    hide AnalysisError;
 import 'package:analysis_server/src/services/correction/organize_directives.dart';
 import 'package:analyzer/src/generated/error.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 import 'package:unittest/unittest.dart';
 
 import '../../abstract_single_unit.dart';
+import '../../utils.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(OrganizeDirectivesTest);
 }
 
@@ -21,6 +23,89 @@
 class OrganizeDirectivesTest extends AbstractSingleUnitTest {
   List<AnalysisError> testErrors;
 
+  void test_keep_duplicateImports_withDifferentPrefix() {
+    _computeUnitAndErrors(r'''
+import 'dart:async' as async1;
+import 'dart:async' as async2;
+
+main() {
+  async1.Future f;
+  async2.Stream s;
+}''');
+    // validate change
+    _assertOrganize(
+        r'''
+import 'dart:async' as async1;
+import 'dart:async' as async2;
+
+main() {
+  async1.Future f;
+  async2.Stream s;
+}''',
+        removeUnresolved: true,
+        removeUnused: true);
+  }
+
+  void test_remove_duplicateImports() {
+    _computeUnitAndErrors(r'''
+import 'dart:async';
+import 'dart:async';
+
+main() {
+  Future f;
+}''');
+    // validate change
+    _assertOrganize(
+        r'''
+import 'dart:async';
+
+main() {
+  Future f;
+}''',
+        removeUnresolved: true,
+        removeUnused: true);
+  }
+
+  void test_remove_duplicateImports_differentText_uri() {
+    _computeUnitAndErrors(r'''
+import 'dart:async' as async;
+import "dart:async" as async;
+
+main() {
+  async.Future f;
+}''');
+    // validate change
+    _assertOrganize(
+        r'''
+import 'dart:async' as async;
+
+main() {
+  async.Future f;
+}''',
+        removeUnresolved: true,
+        removeUnused: true);
+  }
+
+  void test_remove_duplicateImports_withSamePrefix() {
+    _computeUnitAndErrors(r'''
+import 'dart:async' as async;
+import 'dart:async' as async;
+
+main() {
+  async.Future f;
+}''');
+    // validate change
+    _assertOrganize(
+        r'''
+import 'dart:async' as async;
+
+main() {
+  async.Future f;
+}''',
+        removeUnresolved: true,
+        removeUnused: true);
+  }
+
   void test_remove_unresolvedDirectives() {
     addSource('/existing_part1.dart', 'part of lib;');
     addSource('/existing_part2.dart', 'part of lib;');
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 bbf1869..b32f502 100644
--- a/pkg/analysis_server/test/services/correction/sort_members_test.dart
+++ b/pkg/analysis_server/test/services/correction/sort_members_test.dart
@@ -4,15 +4,16 @@
 
 library test.services.refactoring.sort_members;
 
-import 'package:analysis_server/src/protocol.dart';
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/services/correction/sort_members.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 import 'package:unittest/unittest.dart';
 
 import '../../abstract_single_unit.dart';
+import '../../utils.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(SortMembersTest);
 }
 
@@ -674,6 +675,24 @@
 ''');
   }
 
+  void test_unitMembers_topLevelVariable_withConst() {
+    _parseTestUnit(r'''
+int c;
+int a;
+const B = 2;
+int b;
+const A = 1;
+''');
+    // validate change
+    _assertSort(r'''
+const A = 1;
+const B = 2;
+int a;
+int b;
+int c;
+''');
+  }
+
   void _assertSort(String expectedCode) {
     MemberSorter sorter = new MemberSorter(testCode, testUnit);
     List<SourceEdit> edits = sorter.sort();
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 4754b56..ebb0091 100644
--- a/pkg/analysis_server/test/services/correction/source_range_test.dart
+++ b/pkg/analysis_server/test/services/correction/source_range_test.dart
@@ -14,9 +14,10 @@
 import 'package:unittest/unittest.dart';
 
 import '../../abstract_single_unit.dart';
+import '../../utils.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(SourceRangesTest);
 }
 
diff --git a/pkg/analysis_server/test/services/correction/status_test.dart b/pkg/analysis_server/test/services/correction/status_test.dart
index 9620aee..6405e01 100644
--- a/pkg/analysis_server/test/services/correction/status_test.dart
+++ b/pkg/analysis_server/test/services/correction/status_test.dart
@@ -15,9 +15,10 @@
 import 'package:unittest/unittest.dart';
 
 import '../../abstract_single_unit.dart';
+import '../../utils.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(RefactoringLocationTest);
   defineReflectiveTests(RefactoringStatusTest);
 }
diff --git a/pkg/analysis_server/test/services/correction/strings_test.dart b/pkg/analysis_server/test/services/correction/strings_test.dart
index 5f78332..3fb37fb 100644
--- a/pkg/analysis_server/test/services/correction/strings_test.dart
+++ b/pkg/analysis_server/test/services/correction/strings_test.dart
@@ -8,8 +8,10 @@
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 import 'package:unittest/unittest.dart' hide isEmpty;
 
+import '../../utils.dart';
+
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(StringsTest);
 }
 
@@ -31,6 +33,15 @@
     expect(compareStrings('b', 'a'), 1);
   }
 
+  void test_countMatches() {
+    expect(countMatches(null, null), 0);
+    expect(countMatches('abc', null), 0);
+    expect(countMatches(null, 'abc'), 0);
+    expect(countMatches('ababa', 'a'), 3);
+    expect(countMatches('ababa', 'ab'), 2);
+    expect(countMatches('aaabaa', 'aa'), 2);
+  }
+
   void test_findCommonOverlap() {
     expect(findCommonOverlap('', 'abcd'), 0);
     expect(findCommonOverlap('abc', 'abcd'), 3);
@@ -52,6 +63,13 @@
     expect(findCommonSuffix('123', 'xyz123'), 3);
   }
 
+  void test_getCamelWords() {
+    expect(getCamelWords(null), []);
+    expect(getCamelWords(''), []);
+    expect(getCamelWords('getCamelWords'), ['get', 'Camel', 'Words']);
+    expect(getCamelWords('getHTMLText'), ['get', 'HTML', 'Text']);
+  }
+
   void test_isBlank() {
     expect(isBlank(null), isTrue);
     expect(isBlank(''), isTrue);
diff --git a/pkg/analysis_server/test/services/correction/test_all.dart b/pkg/analysis_server/test/services/correction/test_all.dart
index 418fa67..d1a6bb5 100644
--- a/pkg/analysis_server/test/services/correction/test_all.dart
+++ b/pkg/analysis_server/test/services/correction/test_all.dart
@@ -6,6 +6,7 @@
 
 import 'package:unittest/unittest.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;
@@ -19,7 +20,7 @@
 
 /// Utility for manually running all tests.
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   group('correction', () {
     assist_test.main();
     change_test.main();
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 75003c3..69ccf4b 100644
--- a/pkg/analysis_server/test/services/dependencies/library_dependencies_test.dart
+++ b/pkg/analysis_server/test/services/dependencies/library_dependencies_test.dart
@@ -9,9 +9,10 @@
 import 'package:unittest/unittest.dart';
 
 import '../../abstract_context.dart';
+import '../../utils.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(LibraryDependenciesTest);
 }
 
diff --git a/pkg/analysis_server/test/services/dependencies/test_all.dart b/pkg/analysis_server/test/services/dependencies/test_all.dart
index ccc4b9d..1874a07 100644
--- a/pkg/analysis_server/test/services/dependencies/test_all.dart
+++ b/pkg/analysis_server/test/services/dependencies/test_all.dart
@@ -6,11 +6,12 @@
 
 import 'package:unittest/unittest.dart';
 
+import '../../utils.dart';
 import 'library_dependencies_test.dart' as library_dependencies_test;
 
 /// Utility for manually running all tests.
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   group('dependencies', () {
     library_dependencies_test.main();
   });
diff --git a/pkg/analysis_server/test/services/index/dart_index_contributor_test.dart b/pkg/analysis_server/test/services/index/dart_index_contributor_test.dart
index a93591e..1830a28 100644
--- a/pkg/analysis_server/test/services/index/dart_index_contributor_test.dart
+++ b/pkg/analysis_server/test/services/index/dart_index_contributor_test.dart
@@ -4,47 +4,62 @@
 
 library test.services.src.index.dart_index_contributor;
 
-import 'package:analysis_server/analysis/index/index_core.dart';
+import 'package:analysis_server/plugin/index/index_core.dart';
 import 'package:analysis_server/src/services/index/index.dart';
 import 'package:analysis_server/src/services/index/index_contributor.dart';
 import 'package:analysis_server/src/services/index/index_store.dart';
 import 'package:analysis_server/src/services/index/indexable_element.dart';
+import 'package:analysis_server/src/services/index/indexable_file.dart';
 import 'package:analyzer/src/generated/ast.dart';
 import 'package:analyzer/src/generated/element.dart';
+import 'package:analyzer/src/generated/engine.dart';
 import 'package:analyzer/src/generated/source.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() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(DartUnitContributorTest);
 }
 
+void indexDartUnit(
+    InternalIndexStore store, AnalysisContext context, CompilationUnit unit) {
+  new DartIndexContributor().contributeTo(store, context, unit);
+}
+
 /**
  * Returns `true` if the [actual] location the same properties as [expected].
  */
 bool _equalsLocation(LocationImpl actual, ExpectedLocation expected) {
-  return _equalsLocationProperties(actual, expected.element, expected.offset,
+  return _equalsLocationProperties(actual, expected.indexable, expected.offset,
       expected.length, expected.isQualified, expected.isResolved);
 }
 
 /**
  * Returns `true` if the [actual] location the expected properties.
  */
-bool _equalsLocationProperties(LocationImpl actual, Element expectedElement,
-    int expectedOffset, int expectedLength, bool isQualified, bool isResolved) {
-  return (expectedElement == null || expectedElement == actual.element) &&
+bool _equalsLocationProperties(
+    LocationImpl actual,
+    IndexableObject expectedIndexable,
+    int expectedOffset,
+    int expectedLength,
+    bool isQualified,
+    bool isResolved) {
+  return (expectedIndexable == null || expectedIndexable == actual.indexable) &&
       expectedOffset == actual.offset &&
       expectedLength == actual.length &&
       isQualified == actual.isQualified &&
       isResolved == actual.isResolved;
 }
 
-bool _equalsRecordedRelation(RecordedRelation recordedRelation,
-    IndexableObject expectedIndexable, RelationshipImpl expectedRelationship,
+bool _equalsRecordedRelation(
+    RecordedRelation recordedRelation,
+    IndexableObject expectedIndexable,
+    RelationshipImpl expectedRelationship,
     ExpectedLocation expectedLocation) {
   return expectedIndexable == recordedRelation.indexable &&
       (expectedRelationship == null ||
@@ -66,9 +81,9 @@
 
   void setUp() {
     super.setUp();
-    when(store.aboutToIndexDart(context, anyObject)).thenReturn(true);
-    when(store.recordRelationship(anyObject, anyObject, anyObject))
-        .thenInvoke((IndexableObject indexable, RelationshipImpl relationship,
+    when(store.aboutToIndex(context, anyObject)).thenReturn(true);
+    when(store.recordRelationship(anyObject, anyObject, anyObject)).thenInvoke(
+        (IndexableObject indexable, RelationshipImpl relationship,
             LocationImpl location) {
       recordedRelations
           .add(new RecordedRelation(indexable, relationship, location));
@@ -79,6 +94,27 @@
     });
   }
 
+  void test_isReferencedBy_PrefixElement() {
+    _indexTestUnit('''
+import 'dart:async' as ppp;
+main() {
+  ppp.Future a;
+  ppp.Stream b;
+}
+''');
+    // prepare elements
+    PrefixElement element = findNodeElementAtString('ppp;');
+    Element elementA = findElement('a');
+    Element elementB = findElement('b');
+    IndexableElement indexable = new IndexableElement(element);
+    // verify
+    _assertRecordedRelation(indexable, IndexConstants.IS_REFERENCED_BY,
+        _expectedLocation(elementA, 'ppp.Future'));
+    _assertRecordedRelation(indexable, IndexConstants.IS_REFERENCED_BY,
+        _expectedLocation(elementB, 'ppp.Stream'));
+    _assertNoRecordedRelation(indexable, null, _expectedLocation(null, 'ppp;'));
+  }
+
   void test_bad_unresolvedFieldFormalParameter() {
     verifyNoTestUnitErrors = false;
     _indexTestUnit('''
@@ -152,30 +188,263 @@
         IndexConstants.IS_READ_BY, _expectedLocation(mainElement, 'v in []'));
   }
 
-  void test_isDefinedBy_NameElement_method() {
+  void test_hasAncestor_ClassDeclaration() {
+    _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 {}
+''');
+    // prepare elements
+    ClassElement classElementA = findElement("A");
+    ClassElement classElementB1 = findElement("B1");
+    ClassElement classElementB2 = findElement("B2");
+    ClassElement classElementC1 = findElement("C1");
+    ClassElement classElementC2 = findElement("C2");
+    ClassElement classElementC3 = findElement("C3");
+    ClassElement classElementC4 = findElement("C4");
+    ClassElement classElementM = findElement("M");
+    // verify
+    _assertRecordedRelationForElement(
+        classElementA,
+        IndexConstants.HAS_ANCESTOR,
+        _expectedLocation(classElementB1, 'B1 extends A'));
+    _assertRecordedRelationForElement(
+        classElementA,
+        IndexConstants.HAS_ANCESTOR,
+        _expectedLocation(classElementB2, 'B2 implements A'));
+    _assertRecordedRelationForElement(
+        classElementA,
+        IndexConstants.HAS_ANCESTOR,
+        _expectedLocation(classElementC1, 'C1 extends B1'));
+    _assertRecordedRelationForElement(
+        classElementA,
+        IndexConstants.HAS_ANCESTOR,
+        _expectedLocation(classElementC2, 'C2 extends B2'));
+    _assertRecordedRelationForElement(
+        classElementA,
+        IndexConstants.HAS_ANCESTOR,
+        _expectedLocation(classElementC3, 'C3 implements B1'));
+    _assertRecordedRelationForElement(
+        classElementA,
+        IndexConstants.HAS_ANCESTOR,
+        _expectedLocation(classElementC4, 'C4 implements B2'));
+    _assertRecordedRelationForElement(
+        classElementA,
+        IndexConstants.HAS_ANCESTOR,
+        _expectedLocation(classElementM, 'M extends Object with A'));
+  }
+
+  void test_hasAncestor_ClassTypeAlias() {
+    _indexTestUnit('''
+class A {}
+class B extends A {}
+class C1 = Object with A;
+class C2 = Object with B;
+''');
+    // prepare elements
+    ClassElement classElementA = findElement("A");
+    ClassElement classElementB = findElement("B");
+    ClassElement classElementC1 = findElement("C1");
+    ClassElement classElementC2 = findElement("C2");
+    // verify
+    _assertRecordedRelationForElement(
+        classElementA,
+        IndexConstants.HAS_ANCESTOR,
+        _expectedLocation(classElementC1, 'C1 = Object with A'));
+    _assertRecordedRelationForElement(
+        classElementA,
+        IndexConstants.HAS_ANCESTOR,
+        _expectedLocation(classElementC2, 'C2 = Object with B'));
+    _assertRecordedRelationForElement(
+        classElementB,
+        IndexConstants.HAS_ANCESTOR,
+        _expectedLocation(classElementC2, 'C2 = Object with B'));
+  }
+
+  void test_IndexableName_field() {
+    _indexTestUnit('''
+class A {
+  int field;
+}
+main(A a, p) {
+  print(a.field); // r
+  print(p.field); // ur
+  {
+    var field = 42;
+    print(field); // not a member
+  }
+}
+''');
+    // prepare elements
+    Element mainElement = findElement('main');
+    FieldElement fieldElement = findElement('field');
+    IndexableName indexable = new IndexableName('field');
+    // verify
+    _assertRecordedRelation(indexable, IndexConstants.NAME_IS_DEFINED_BY,
+        _expectedLocation(fieldElement, 'field;'));
+    _assertRecordedRelation(indexable, IndexConstants.IS_READ_BY,
+        _expectedLocationQ(mainElement, 'field); // r'));
+    _assertRecordedRelation(indexable, IndexConstants.IS_READ_BY,
+        _expectedLocationQU(mainElement, 'field); // ur'));
+    _assertNoRecordedRelation(indexable, IndexConstants.IS_READ_BY,
+        _expectedLocation(mainElement, 'field); // not a member'));
+  }
+
+  void test_IndexableName_isDefinedBy_localVariable_inForEach() {
+    _indexTestUnit('''
+class A {
+  main() {
+    for (int test in []) {
+    }
+  }
+}
+''');
+    // prepare elements
+    LocalVariableElement testElement = findElement('test');
+    IndexableName indexable = new IndexableName('test');
+    // verify
+    _assertRecordedRelation(indexable, IndexConstants.NAME_IS_DEFINED_BY,
+        _expectedLocation(testElement, 'test in []'));
+  }
+
+  void test_IndexableName_method() {
+    _indexTestUnit('''
+class A {
+  method() {}
+}
+main(A a, p) {
+  a.method(); // r
+  p.method(); // ur
+}
+''');
+    // prepare elements
+    Element mainElement = findElement('main');
+    MethodElement methodElement = findElement('method');
+    IndexableName indexable = new IndexableName('method');
+    // verify
+    _assertRecordedRelation(indexable, IndexConstants.NAME_IS_DEFINED_BY,
+        _expectedLocation(methodElement, 'method() {}'));
+    _assertRecordedRelation(indexable, IndexConstants.IS_INVOKED_BY,
+        _expectedLocationQ(mainElement, 'method(); // r'));
+    _assertRecordedRelation(indexable, IndexConstants.IS_INVOKED_BY,
+        _expectedLocationQU(mainElement, 'method(); // ur'));
+  }
+
+  void test_IndexableName_operator_resolved() {
+    _indexTestUnit('''
+class A {
+  operator +(o) {}
+  operator -(o) {}
+  operator ~() {}
+  operator ==(o) {}
+}
+main(A a) {
+  a + 5;
+  a += 5;
+  a == 5;
+  ++a;
+  --a;
+  ~a;
+  a++;
+  a--;
+}
+''');
+    // prepare elements
+    Element mainElement = findElement('main');
+    // binary
+    _assertRecordedRelationForName('+', IndexConstants.IS_INVOKED_BY,
+        _expectedLocationQ(mainElement, '+ 5', length: 1));
+    _assertRecordedRelationForName('+', IndexConstants.IS_INVOKED_BY,
+        _expectedLocationQ(mainElement, '+= 5', length: 2));
+    _assertRecordedRelationForName('==', IndexConstants.IS_INVOKED_BY,
+        _expectedLocationQ(mainElement, '== 5', length: 2));
+    // prefix
+    _assertRecordedRelationForName('+', IndexConstants.IS_INVOKED_BY,
+        _expectedLocationQ(mainElement, '++a', length: 2));
+    _assertRecordedRelationForName('-', IndexConstants.IS_INVOKED_BY,
+        _expectedLocationQ(mainElement, '--a', length: 2));
+    _assertRecordedRelationForName('~', IndexConstants.IS_INVOKED_BY,
+        _expectedLocationQ(mainElement, '~a', length: 1));
+    // postfix
+    _assertRecordedRelationForName('+', IndexConstants.IS_INVOKED_BY,
+        _expectedLocationQ(mainElement, '++;', length: 2));
+    _assertRecordedRelationForName('-', IndexConstants.IS_INVOKED_BY,
+        _expectedLocationQ(mainElement, '--;', length: 2));
+  }
+
+  void test_IndexableName_operator_unresolved() {
+    _indexTestUnit('''
+class A {
+  operator +(o) {}
+  operator -(o) {}
+  operator ~() {}
+  operator ==(o) {}
+}
+main(a) {
+  a + 5;
+  a += 5;
+  a == 5;
+  ++a;
+  --a;
+  ~a;
+  a++;
+  a--;
+}
+''');
+    // prepare elements
+    Element mainElement = findElement('main');
+    // binary
+    _assertRecordedRelationForName('+', IndexConstants.IS_INVOKED_BY,
+        _expectedLocationQU(mainElement, '+ 5', length: 1));
+    _assertRecordedRelationForName('+', IndexConstants.IS_INVOKED_BY,
+        _expectedLocationQU(mainElement, '+= 5', length: 2));
+    _assertRecordedRelationForName('==', IndexConstants.IS_INVOKED_BY,
+        _expectedLocationQU(mainElement, '== 5', length: 2));
+    // prefix
+    _assertRecordedRelationForName('+', IndexConstants.IS_INVOKED_BY,
+        _expectedLocationQU(mainElement, '++a', length: 2));
+    _assertRecordedRelationForName('-', IndexConstants.IS_INVOKED_BY,
+        _expectedLocationQU(mainElement, '--a', length: 2));
+    _assertRecordedRelationForName('~', IndexConstants.IS_INVOKED_BY,
+        _expectedLocationQU(mainElement, '~a', length: 1));
+    // postfix
+    _assertRecordedRelationForName('+', IndexConstants.IS_INVOKED_BY,
+        _expectedLocationQU(mainElement, '++;', length: 2));
+    _assertRecordedRelationForName('-', IndexConstants.IS_INVOKED_BY,
+        _expectedLocationQU(mainElement, '--;', length: 2));
+  }
+
+  void test_isDefinedBy_IndexableName_method() {
     _indexTestUnit('''
 class A {
   m() {}
 }''');
     // prepare elements
     Element methodElement = findElement("m");
-    Element nameElement = new NameElement("m");
+    IndexableName nameIndexable = new IndexableName("m");
     // verify
-    _assertRecordedRelationForElement(nameElement,
+    _assertRecordedRelationForIndexable(
+        nameIndexable,
         IndexConstants.NAME_IS_DEFINED_BY,
         _expectedLocation(methodElement, 'm() {}'));
   }
 
-  void test_isDefinedBy_NameElement_operator() {
+  void test_isDefinedBy_IndexableName_operator() {
     _indexTestUnit('''
 class A {
   operator +(o) {}
 }''');
     // prepare elements
     Element methodElement = findElement("+");
-    Element nameElement = new NameElement("+");
+    IndexableName nameIndexable = new IndexableName("+");
     // verify
-    _assertRecordedRelationForElement(nameElement,
+    _assertRecordedRelationForIndexable(
+        nameIndexable,
         IndexConstants.NAME_IS_DEFINED_BY,
         _expectedLocation(methodElement, '+(o) {}', length: 1));
   }
@@ -189,7 +458,8 @@
     ClassElement classElementA = findElement("A");
     ClassElement classElementB = findElement("B");
     // verify
-    _assertRecordedRelationForElement(classElementA,
+    _assertRecordedRelationForElement(
+        classElementA,
         IndexConstants.IS_EXTENDED_BY,
         _expectedLocation(classElementB, 'A {} // 2'));
   }
@@ -202,7 +472,8 @@
     ClassElement classElementA = findElement("A");
     ClassElement classElementObject = classElementA.supertype.element;
     // verify
-    _assertRecordedRelationForElement(classElementObject,
+    _assertRecordedRelationForElement(
+        classElementObject,
         IndexConstants.IS_EXTENDED_BY,
         _expectedLocation(classElementA, 'A {}', length: 0));
   }
@@ -217,7 +488,8 @@
     ClassElement classElementA = findElement("A");
     ClassElement classElementC = findElement("C");
     // verify
-    _assertRecordedRelationForElement(classElementA,
+    _assertRecordedRelationForElement(
+        classElementA,
         IndexConstants.IS_EXTENDED_BY,
         _expectedLocation(classElementC, 'A with'));
   }
@@ -231,7 +503,8 @@
     ClassElement classElementA = findElement("A");
     ClassElement classElementB = findElement("B");
     // verify
-    _assertRecordedRelationForElement(classElementA,
+    _assertRecordedRelationForElement(
+        classElementA,
         IndexConstants.IS_IMPLEMENTED_BY,
         _expectedLocation(classElementB, 'A {} // 2'));
   }
@@ -246,7 +519,8 @@
     ClassElement classElementB = findElement("B");
     ClassElement classElementC = findElement("C");
     // verify
-    _assertRecordedRelationForElement(classElementB,
+    _assertRecordedRelationForElement(
+        classElementB,
         IndexConstants.IS_IMPLEMENTED_BY,
         _expectedLocation(classElementC, 'B; // 3'));
   }
@@ -273,7 +547,9 @@
   }
 
   void test_isInvokedBy_FunctionElement() {
-    addSource('/lib.dart', '''
+    addSource(
+        '/lib.dart',
+        '''
 library lib;
 foo() {}
 ''');
@@ -343,7 +619,8 @@
     Element mainElement = findElement("main");
     Element methodElement = findElement("foo");
     // verify
-    _assertRecordedRelationForElement(methodElement,
+    _assertRecordedRelationForElement(
+        methodElement,
         IndexConstants.IS_INVOKED_BY,
         _expectedLocationQ(mainElement, 'foo();'));
   }
@@ -393,7 +670,8 @@
     // verify
     _assertRecordedRelationForElement(readElement, IndexConstants.IS_INVOKED_BY,
         _expectedLocationQ(mainElement, '[0]', length: 1));
-    _assertRecordedRelationForElement(writeElement,
+    _assertRecordedRelationForElement(
+        writeElement,
         IndexConstants.IS_INVOKED_BY,
         _expectedLocationQ(mainElement, '[1] =', length: 1));
   }
@@ -437,7 +715,8 @@
     ClassElement classElementA = findElement("A");
     ClassElement classElementB = findElement("B");
     // verify
-    _assertRecordedRelationForElement(classElementA,
+    _assertRecordedRelationForElement(
+        classElementA,
         IndexConstants.IS_MIXED_IN_BY,
         _expectedLocation(classElementB, 'A {} // 2'));
   }
@@ -451,7 +730,8 @@
     ClassElement classElementA = findElement("A");
     ClassElement classElementB = findElement("B");
     // verify
-    _assertRecordedRelationForElement(classElementA,
+    _assertRecordedRelationForElement(
+        classElementA,
         IndexConstants.IS_MIXED_IN_BY,
         _expectedLocation(classElementB, 'A; // 2'));
   }
@@ -495,7 +775,8 @@
     Element mainElement = findElement("main");
     Element parameterElement = findElement("p");
     // verify
-    _assertRecordedRelationForElement(parameterElement,
+    _assertRecordedRelationForElement(
+        parameterElement,
         IndexConstants.IS_READ_WRITTEN_BY,
         _expectedLocation(mainElement, 'p += 1'));
   }
@@ -511,7 +792,8 @@
     Element mainElement = findElement("main");
     Element variableElement = findElement("v");
     // verify
-    _assertRecordedRelationForElement(variableElement,
+    _assertRecordedRelationForElement(
+        variableElement,
         IndexConstants.IS_READ_WRITTEN_BY,
         _expectedLocation(mainElement, 'v += 1'));
   }
@@ -547,6 +829,22 @@
         _expectedLocation(mainElement, 'A.field); // 3'));
   }
 
+  void test_isReferencedBy_ClassElement_invocation() {
+    verifyNoTestUnitErrors = false;
+    _indexTestUnit('''
+class A {}
+main() {
+  A(); // invalid code, but still a reference
+}''');
+    // prepare elements
+    Element mainElement = findElement('main');
+    Element classElement = findElement('A');
+    IndexableElement indexable = new IndexableElement(classElement);
+    // verify
+    _assertRecordedRelation(indexable, IndexConstants.IS_REFERENCED_BY,
+        _expectedLocation(mainElement, 'A();'));
+  }
+
   void test_isReferencedBy_ClassTypeAlias() {
     _indexTestUnit('''
 class A {}
@@ -568,7 +866,9 @@
   }
 
   void test_isReferencedBy_CompilationUnitElement_export() {
-    addSource('/lib.dart', '''
+    addSource(
+        '/lib.dart',
+        '''
 library lib;
 ''');
     _indexTestUnit('''
@@ -578,13 +878,16 @@
     LibraryElement libElement = testLibraryElement.exportedLibraries[0];
     CompilationUnitElement libUnitElement = libElement.definingCompilationUnit;
     // verify
-    _assertRecordedRelationForElement(libUnitElement,
+    _assertRecordedRelationForElement(
+        libUnitElement,
         IndexConstants.IS_REFERENCED_BY,
         _expectedLocation(testUnitElement, "'lib.dart'", length: 10));
   }
 
   void test_isReferencedBy_CompilationUnitElement_import() {
-    addSource('/lib.dart', '''
+    addSource(
+        '/lib.dart',
+        '''
 library lib;
 ''');
     _indexTestUnit('''
@@ -594,7 +897,8 @@
     LibraryElement libElement = testLibraryElement.imports[0].importedLibrary;
     CompilationUnitElement libUnitElement = libElement.definingCompilationUnit;
     // verify
-    _assertRecordedRelationForElement(libUnitElement,
+    _assertRecordedRelationForElement(
+        libUnitElement,
         IndexConstants.IS_REFERENCED_BY,
         _expectedLocation(testUnitElement, "'lib.dart'", length: 10));
   }
@@ -608,7 +912,8 @@
     // prepare elements
     CompilationUnitElement myUnitElement = testLibraryElement.parts[0];
     // verify
-    _assertRecordedRelationForElement(myUnitElement,
+    _assertRecordedRelationForElement(
+        myUnitElement,
         IndexConstants.IS_REFERENCED_BY,
         _expectedLocation(testUnitElement, "'my_unit.dart';", length: 14));
   }
@@ -678,9 +983,11 @@
     // verify
     _assertRecordedRelationForElement(consA, IndexConstants.IS_REFERENCED_BY,
         _expectedLocation(mainElement, '(); // marker-main-1', length: 0));
-    _assertRecordedRelationForElement(consA_named,
-        IndexConstants.IS_REFERENCED_BY, _expectedLocation(
-            mainElement, '.named(); // marker-main-2', length: 6));
+    _assertRecordedRelationForElement(
+        consA_named,
+        IndexConstants.IS_REFERENCED_BY,
+        _expectedLocation(mainElement, '.named(); // marker-main-2',
+            length: 6));
   }
 
   void test_isReferencedBy_ConstructorElement_redirection() {
@@ -700,11 +1007,13 @@
     ConstructorElement constructorA_bar =
         findNodeElementAtString("A.bar()", isConstructor);
     // A()
-    _assertRecordedRelationForElement(constructorA,
+    _assertRecordedRelationForElement(
+        constructorA,
         IndexConstants.IS_REFERENCED_BY,
         _expectedLocation(constructorA_foo, '(); // marker', length: 0));
     // A.foo()
-    _assertRecordedRelationForElement(constructorA_bar,
+    _assertRecordedRelationForElement(
+        constructorA_bar,
         IndexConstants.IS_REFERENCED_BY,
         _expectedLocation(constructorA, '.bar();', length: 4));
   }
@@ -743,11 +1052,57 @@
         _expectedLocationQ(mainElement, 'field = 2; // q'));
     _assertRecordedRelation(indexableGetter, IndexConstants.IS_REFERENCED_BY,
         _expectedLocationQ(mainElement, 'field); // q'));
-    _assertRecordedRelationForElement(fieldElement,
+    _assertRecordedRelationForElement(
+        fieldElement,
         IndexConstants.IS_REFERENCED_BY,
         _expectedLocation(mainElement, 'field: 3'));
   }
 
+  void test_isReferencedBy_fileOfLibrary_byImportingExportingFile() {
+    addSource('/lib.dart', '');
+    _indexTestUnit('''
+import 'lib.dart'; // 1
+export 'lib.dart'; // 2
+''');
+    // verify
+    IndexableFile libIndexableFile = new IndexableFile('/lib.dart');
+    IndexableFile testIndexableFile = new IndexableFile(testFile);
+    _assertRecordedRelationForIndexable(
+        libIndexableFile,
+        IndexConstants.IS_REFERENCED_BY,
+        new ExpectedLocation(
+            testIndexableFile,
+            testCode.indexOf("'lib.dart'; // 1"),
+            "'lib.dart'".length,
+            false,
+            true));
+    _assertRecordedRelationForIndexable(
+        libIndexableFile,
+        IndexConstants.IS_REFERENCED_BY,
+        new ExpectedLocation(
+            testIndexableFile,
+            testCode.indexOf("'lib.dart'; // 2"),
+            "'lib.dart'".length,
+            false,
+            true));
+  }
+
+  void test_isReferencedBy_fileOfPart_bySourcingFile() {
+    addSource('/part.dart', 'part of my.lib;');
+    _indexTestUnit('''
+library my.lib;
+part 'part.dart';
+''');
+    // verify
+    IndexableFile partIndexableFile = new IndexableFile('/part.dart');
+    IndexableFile testIndexableFile = new IndexableFile(testFile);
+    _assertRecordedRelationForIndexable(
+        partIndexableFile,
+        IndexConstants.IS_REFERENCED_BY,
+        new ExpectedLocation(testIndexableFile, testCode.indexOf("'part.dart'"),
+            "'part.dart'".length, false, true));
+  }
+
   void test_isReferencedBy_FunctionElement() {
     _indexTestUnit('''
 foo() {}
@@ -811,7 +1166,9 @@
   }
 
   void test_isReferencedBy_ImportElement_noPrefix() {
-    addSource('/lib.dart', '''
+    addSource(
+        '/lib.dart',
+        '''
 library lib;
 var myVar;
 myFunction() {}
@@ -846,11 +1203,15 @@
   }
 
   void test_isReferencedBy_ImportElement_withPrefix() {
-    addSource('/libA.dart', '''
+    addSource(
+        '/libA.dart',
+        '''
 library libA;
 var myVar;
 ''');
-    addSource('/libB.dart', '''
+    addSource(
+        '/libB.dart',
+        '''
 library libB;
 class MyClass {}
 ''');
@@ -867,16 +1228,20 @@
     ImportElement importElementB = testLibraryElement.imports[1];
     Element mainElement = findElement('main');
     // verify
-    _assertRecordedRelationForElement(importElementA,
+    _assertRecordedRelationForElement(
+        importElementA,
         IndexConstants.IS_REFERENCED_BY,
         _expectedLocation(mainElement, 'pref.myVar = 1;', length: 5));
-    _assertRecordedRelationForElement(importElementB,
+    _assertRecordedRelationForElement(
+        importElementB,
         IndexConstants.IS_REFERENCED_BY,
         _expectedLocation(mainElement, 'pref.MyClass();', length: 5));
   }
 
   void test_isReferencedBy_ImportElement_withPrefix_combinators() {
-    addSource('/lib.dart', '''
+    addSource(
+        '/lib.dart',
+        '''
 library lib;
 class A {}
 class B {}
@@ -896,16 +1261,20 @@
     ImportElement importElementB = testLibraryElement.imports[1];
     Element mainElement = findElement('main');
     // verify
-    _assertRecordedRelationForElement(importElementA,
+    _assertRecordedRelationForElement(
+        importElementA,
         IndexConstants.IS_REFERENCED_BY,
         _expectedLocation(mainElement, 'pref.A();', length: 5));
-    _assertRecordedRelationForElement(importElementB,
+    _assertRecordedRelationForElement(
+        importElementB,
         IndexConstants.IS_REFERENCED_BY,
         _expectedLocation(mainElement, 'pref.B();', length: 5));
   }
 
   void test_isReferencedBy_ImportElement_withPrefix_invocation() {
-    addSource('/lib.dart', '''
+    addSource(
+        '/lib.dart',
+        '''
 library lib;
 myFunc() {}
 ''');
@@ -919,13 +1288,16 @@
     ImportElement importElement = testLibraryElement.imports[0];
     Element mainElement = findElement('main');
     // verify
-    _assertRecordedRelationForElement(importElement,
+    _assertRecordedRelationForElement(
+        importElement,
         IndexConstants.IS_REFERENCED_BY,
         _expectedLocation(mainElement, 'pref.myFunc();', length: 5));
   }
 
   void test_isReferencedBy_ImportElement_withPrefix_oneCandidate() {
-    addSource('/lib.dart', '''
+    addSource(
+        '/lib.dart',
+        '''
 library lib;
 class A {}
 class B {}
@@ -940,14 +1312,17 @@
     ImportElement importElement = testLibraryElement.imports[0];
     Element mainElement = findElement('main');
     // verify
-    _assertRecordedRelationForElement(importElement,
+    _assertRecordedRelationForElement(
+        importElement,
         IndexConstants.IS_REFERENCED_BY,
         _expectedLocation(mainElement, 'pref.A();', length: 5));
   }
 
   void test_isReferencedBy_ImportElement_withPrefix_unresolvedElement() {
     verifyNoTestUnitErrors = false;
-    addSource('/lib.dart', '''
+    addSource(
+        '/lib.dart',
+        '''
 library lib;
 ''');
     _indexTestUnit('''
@@ -993,8 +1368,10 @@
         _expectedLocation(mainElement, 'L;'));
   }
 
-  void test_isReferencedBy_libraryName() {
-    Source libSource = addSource('/lib.dart', '''
+  void test_isReferencedBy_libraryName_byPartOf() {
+    Source libSource = addSource(
+        '/lib.dart',
+        '''
 library lib;
 part 'test.dart';
 ''');
@@ -1005,7 +1382,8 @@
     testLibraryElement = testUnitElement.library;
     indexDartUnit(store, context, testUnit);
     // verify
-    _assertRecordedRelationForElement(testLibraryElement,
+    _assertRecordedRelationForElement(
+        testLibraryElement,
         IndexConstants.IS_REFERENCED_BY,
         _expectedLocation(testUnitElement, "lib;"));
   }
@@ -1045,29 +1423,10 @@
         _expectedLocation(mainElement, 'p: 1'));
   }
 
-  void test_isReferencedBy_PrefixElement() {
-    _indexTestUnit('''
-import 'dart:async' as ppp;
-main() {
-  ppp.Future a;
-  ppp.Stream b;
-}
-''');
-    // prepare elements
-    PrefixElement element = findNodeElementAtString('ppp;');
-    Element elementA = findElement('a');
-    Element elementB = findElement('b');
-    IndexableElement indexable = new IndexableElement(element);
-    // verify
-    _assertRecordedRelation(indexable, IndexConstants.IS_REFERENCED_BY,
-        _expectedLocation(elementA, 'ppp.Future'));
-    _assertRecordedRelation(indexable, IndexConstants.IS_REFERENCED_BY,
-        _expectedLocation(elementB, 'ppp.Stream'));
-    _assertNoRecordedRelation(indexable, null, _expectedLocation(null, 'ppp;'));
-  }
-
   void test_isReferencedBy_TopLevelVariableElement() {
-    addSource('/lib.dart', '''
+    addSource(
+        '/lib.dart',
+        '''
 library lib;
 var V;
 ''');
@@ -1107,7 +1466,8 @@
     Element classElementA = findElement('A');
     Element variableElement = findElement('myVariable');
     // verify
-    _assertRecordedRelationForElement(classElementA,
+    _assertRecordedRelationForElement(
+        classElementA,
         IndexConstants.IS_REFERENCED_BY,
         _expectedLocation(variableElement, 'A myVariable'));
   }
@@ -1148,7 +1508,8 @@
     ConstructorElement constructorElement = classElement.constructors[0];
     FieldElement fieldElement = findElement("field");
     // verify
-    _assertRecordedRelationForElement(fieldElement,
+    _assertRecordedRelationForElement(
+        fieldElement,
         IndexConstants.IS_WRITTEN_BY,
         _expectedLocation(constructorElement, 'field = 5'));
   }
@@ -1164,7 +1525,8 @@
     FieldElement fieldElement = findElement("field");
     Element fieldParameterElement = findNodeElementAtString("field);");
     // verify
-    _assertRecordedRelationForElement(fieldElement,
+    _assertRecordedRelationForElement(
+        fieldElement,
         IndexConstants.IS_WRITTEN_BY,
         _expectedLocation(fieldParameterElement, 'field);'));
   }
@@ -1196,160 +1558,6 @@
         _expectedLocation(mainElement, 'v = 1'));
   }
 
-  void test_NameElement_field() {
-    _indexTestUnit('''
-class A {
-  int field;
-}
-main(A a, p) {
-  print(a.field); // r
-  print(p.field); // ur
-  {
-    var field = 42;
-    print(field); // not a member
-  }
-}
-''');
-    // prepare elements
-    Element mainElement = findElement('main');
-    FieldElement fieldElement = findElement('field');
-    IndexableElement indexable = new IndexableElement(new NameElement('field'));
-    // verify
-    _assertRecordedRelation(indexable, IndexConstants.NAME_IS_DEFINED_BY,
-        _expectedLocation(fieldElement, 'field;'));
-    _assertRecordedRelation(indexable, IndexConstants.IS_READ_BY,
-        _expectedLocationQ(mainElement, 'field); // r'));
-    _assertRecordedRelation(indexable, IndexConstants.IS_READ_BY,
-        _expectedLocationQU(mainElement, 'field); // ur'));
-    _assertNoRecordedRelation(indexable, IndexConstants.IS_READ_BY,
-        _expectedLocation(mainElement, 'field); // not a member'));
-  }
-
-  void test_NameElement_isDefinedBy_localVariable_inForEach() {
-    _indexTestUnit('''
-class A {
-  main() {
-    for (int test in []) {
-    }
-  }
-}
-''');
-    // prepare elements
-    LocalVariableElement testElement = findElement('test');
-    IndexableElement indexable = new IndexableElement(new NameElement('test'));
-    // verify
-    _assertRecordedRelation(indexable, IndexConstants.NAME_IS_DEFINED_BY,
-        _expectedLocation(testElement, 'test in []'));
-  }
-
-  void test_NameElement_method() {
-    _indexTestUnit('''
-class A {
-  method() {}
-}
-main(A a, p) {
-  a.method(); // r
-  p.method(); // ur
-}
-''');
-    // prepare elements
-    Element mainElement = findElement('main');
-    MethodElement methodElement = findElement('method');
-    IndexableElement indexable =
-        new IndexableElement(new NameElement('method'));
-    // verify
-    _assertRecordedRelation(indexable, IndexConstants.NAME_IS_DEFINED_BY,
-        _expectedLocation(methodElement, 'method() {}'));
-    _assertRecordedRelation(indexable, IndexConstants.IS_INVOKED_BY,
-        _expectedLocationQ(mainElement, 'method(); // r'));
-    _assertRecordedRelation(indexable, IndexConstants.IS_INVOKED_BY,
-        _expectedLocationQU(mainElement, 'method(); // ur'));
-  }
-
-  void test_NameElement_operator_resolved() {
-    _indexTestUnit('''
-class A {
-  operator +(o) {}
-  operator -(o) {}
-  operator ~() {}
-  operator ==(o) {}
-}
-main(A a) {
-  a + 5;
-  a += 5;
-  a == 5;
-  ++a;
-  --a;
-  ~a;
-  a++;
-  a--;
-}
-''');
-    // prepare elements
-    Element mainElement = findElement('main');
-    // binary
-    _assertRecordedRelationForName('+', IndexConstants.IS_INVOKED_BY,
-        _expectedLocationQ(mainElement, '+ 5', length: 1));
-    _assertRecordedRelationForName('+', IndexConstants.IS_INVOKED_BY,
-        _expectedLocationQ(mainElement, '+= 5', length: 2));
-    _assertRecordedRelationForName('==', IndexConstants.IS_INVOKED_BY,
-        _expectedLocationQ(mainElement, '== 5', length: 2));
-    // prefix
-    _assertRecordedRelationForName('+', IndexConstants.IS_INVOKED_BY,
-        _expectedLocationQ(mainElement, '++a', length: 2));
-    _assertRecordedRelationForName('-', IndexConstants.IS_INVOKED_BY,
-        _expectedLocationQ(mainElement, '--a', length: 2));
-    _assertRecordedRelationForName('~', IndexConstants.IS_INVOKED_BY,
-        _expectedLocationQ(mainElement, '~a', length: 1));
-    // postfix
-    _assertRecordedRelationForName('+', IndexConstants.IS_INVOKED_BY,
-        _expectedLocationQ(mainElement, '++;', length: 2));
-    _assertRecordedRelationForName('-', IndexConstants.IS_INVOKED_BY,
-        _expectedLocationQ(mainElement, '--;', length: 2));
-  }
-
-  void test_NameElement_operator_unresolved() {
-    _indexTestUnit('''
-class A {
-  operator +(o) {}
-  operator -(o) {}
-  operator ~() {}
-  operator ==(o) {}
-}
-main(a) {
-  a + 5;
-  a += 5;
-  a == 5;
-  ++a;
-  --a;
-  ~a;
-  a++;
-  a--;
-}
-''');
-    // prepare elements
-    Element mainElement = findElement('main');
-    // binary
-    _assertRecordedRelationForName('+', IndexConstants.IS_INVOKED_BY,
-        _expectedLocationQU(mainElement, '+ 5', length: 1));
-    _assertRecordedRelationForName('+', IndexConstants.IS_INVOKED_BY,
-        _expectedLocationQU(mainElement, '+= 5', length: 2));
-    _assertRecordedRelationForName('==', IndexConstants.IS_INVOKED_BY,
-        _expectedLocationQU(mainElement, '== 5', length: 2));
-    // prefix
-    _assertRecordedRelationForName('+', IndexConstants.IS_INVOKED_BY,
-        _expectedLocationQU(mainElement, '++a', length: 2));
-    _assertRecordedRelationForName('-', IndexConstants.IS_INVOKED_BY,
-        _expectedLocationQU(mainElement, '--a', length: 2));
-    _assertRecordedRelationForName('~', IndexConstants.IS_INVOKED_BY,
-        _expectedLocationQU(mainElement, '~a', length: 1));
-    // postfix
-    _assertRecordedRelationForName('+', IndexConstants.IS_INVOKED_BY,
-        _expectedLocationQU(mainElement, '++;', length: 2));
-    _assertRecordedRelationForName('-', IndexConstants.IS_INVOKED_BY,
-        _expectedLocationQU(mainElement, '--;', length: 2));
-  }
-
   void test_nameIsInvokedBy() {
     _indexTestUnit('''
 class A {
@@ -1361,7 +1569,7 @@
 }''');
     // prepare elements
     Element mainElement = findElement("main");
-    IndexableElement indexable = new IndexableElement(new NameElement('test'));
+    IndexableName indexable = new IndexableName('test');
     // verify
     _assertRecordedRelation(indexable, IndexConstants.IS_INVOKED_BY,
         _expectedLocationQ(mainElement, 'test(1)'));
@@ -1382,7 +1590,7 @@
 }''');
     // prepare elements
     Element mainElement = findElement("main");
-    IndexableElement indexable = new IndexableElement(new NameElement('test'));
+    IndexableName indexable = new IndexableName('test');
     // verify
     _assertRecordedRelation(indexable, IndexConstants.IS_READ_BY,
         _expectedLocationQ(mainElement, 'test); // a'));
@@ -1401,7 +1609,7 @@
 }''');
     // prepare elements
     Element mainElement = findElement("main");
-    IndexableElement indexable = new IndexableElement(new NameElement('test'));
+    IndexableName indexable = new IndexableName('test');
     // verify
     _assertRecordedRelation(indexable, IndexConstants.IS_READ_WRITTEN_BY,
         _expectedLocationQ(mainElement, 'test += 1'));
@@ -1420,7 +1628,7 @@
 }''');
     // prepare elements
     Element mainElement = findElement("main");
-    IndexableElement indexable = new IndexableElement(new NameElement('test'));
+    IndexableName indexable = new IndexableName('test');
     // verify
     _assertRecordedRelation(indexable, IndexConstants.IS_WRITTEN_BY,
         _expectedLocationQ(mainElement, 'test = 1'));
@@ -1439,7 +1647,11 @@
 
   void _assertDefinesTopLevelElement(Element element) {
     ExpectedLocation location = new ExpectedLocation(
-        element, element.nameOffset, element.name.length, false, true);
+        new IndexableElement(element),
+        element.nameOffset,
+        element.nameLength,
+        false,
+        true);
     _assertRecordedRelationForElement(
         testLibraryElement, IndexConstants.DEFINES, location);
     expect(recordedTopElements, contains(element));
@@ -1471,7 +1683,8 @@
   /**
    * Asserts that [recordedRelations] has an item with the expected properties.
    */
-  LocationImpl _assertRecordedRelation(IndexableObject expectedIndexable,
+  LocationImpl _assertRecordedRelation(
+      IndexableObject expectedIndexable,
       RelationshipImpl expectedRelationship,
       ExpectedLocation expectedLocation) {
     for (RecordedRelation recordedRelation in recordedRelations) {
@@ -1480,30 +1693,45 @@
         return recordedRelation.location;
       }
     }
-    fail(
-        "not found\n$expectedIndexable $expectedRelationship " "in $expectedLocation in\n" +
-            recordedRelations.join('\n'));
+    fail("not found\n$expectedIndexable $expectedRelationship "
+        "in $expectedLocation in\n" +
+        recordedRelations.join('\n'));
     return null;
   }
 
   /**
    * Asserts that [recordedRelations] has an item with the expected properties.
    */
-  LocationImpl _assertRecordedRelationForElement(Element expectedElement,
+  LocationImpl _assertRecordedRelationForElement(
+      Element expectedElement,
       RelationshipImpl expectedRelationship,
       ExpectedLocation expectedLocation) {
-    return _assertRecordedRelation(new IndexableElement(expectedElement),
-        expectedRelationship, expectedLocation);
+    return _assertRecordedRelationForIndexable(
+        new IndexableElement(expectedElement),
+        expectedRelationship,
+        expectedLocation);
   }
 
   /**
    * Asserts that [recordedRelations] has an item with the expected properties.
    */
-  LocationImpl _assertRecordedRelationForName(String expectedName,
+  LocationImpl _assertRecordedRelationForIndexable(
+      IndexableObject expectedIndexable,
       RelationshipImpl expectedRelationship,
       ExpectedLocation expectedLocation) {
-    return _assertRecordedRelationForElement(
-        new NameElement(expectedName), expectedRelationship, expectedLocation);
+    return _assertRecordedRelation(
+        expectedIndexable, expectedRelationship, expectedLocation);
+  }
+
+  /**
+   * Asserts that [recordedRelations] has an item with the expected properties.
+   */
+  LocationImpl _assertRecordedRelationForName(
+      String expectedName,
+      RelationshipImpl expectedRelationship,
+      ExpectedLocation expectedLocation) {
+    return _assertRecordedRelationForIndexable(new IndexableName(expectedName),
+        expectedRelationship, expectedLocation);
   }
 
   ExpectedLocation _expectedLocation(Element element, String search,
@@ -1512,8 +1740,10 @@
     if (length == -1) {
       length = getLeadingIdentifierLength(search);
     }
+    IndexableObject indexable =
+        element != null ? new IndexableElement(element) : null;
     return new ExpectedLocation(
-        element, offset, length, isQualified, isResolved);
+        indexable, offset, length, isQualified, isResolved);
   }
 
   ExpectedLocation _expectedLocationQ(Element element, String search,
@@ -1535,18 +1765,18 @@
 }
 
 class ExpectedLocation {
-  Element element;
+  IndexableObject indexable;
   int offset;
   int length;
   bool isQualified;
   bool isResolved;
 
-  ExpectedLocation(this.element, this.offset, this.length, this.isQualified,
+  ExpectedLocation(this.indexable, this.offset, this.length, this.isQualified,
       this.isResolved);
 
   @override
   String toString() {
-    return 'ExpectedLocation(element=$element; offset=$offset; length=$length;'
+    return 'ExpectedLocation(indexable=$indexable; offset=$offset; length=$length;'
         ' isQualified=$isQualified isResolved=$isResolved)';
   }
 }
@@ -1568,7 +1798,8 @@
   @override
   String toString() {
     return 'RecordedRelation(indexable=$indexable; relationship=$relationship; '
-        'location=$location; flags=' '${location.isQualified ? "Q" : ""}'
+        'location=$location; flags='
+        '${location.isQualified ? "Q" : ""}'
         '${location.isResolved ? "R" : ""})';
   }
 }
diff --git a/pkg/analysis_server/test/services/index/indexable_file_test.dart b/pkg/analysis_server/test/services/index/indexable_file_test.dart
new file mode 100644
index 0000000..e790b84
--- /dev/null
+++ b/pkg/analysis_server/test/services/index/indexable_file_test.dart
@@ -0,0 +1,58 @@
+// 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 test.services.index.indexable_file;
+
+import 'package:analysis_server/src/services/index/indexable_file.dart';
+import 'package:analysis_server/src/services/index/store/codec.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
+import 'package:unittest/unittest.dart';
+
+import '../../utils.dart';
+
+main() {
+  initializeTestEnvironment();
+  defineReflectiveTests(IndexableFileKindTest);
+  defineReflectiveTests(IndexableFileTest);
+}
+
+@reflectiveTest
+class IndexableFileKindTest {
+  void test_decode() {
+    IndexableFile object =
+        IndexableFileKind.INSTANCE.decode(null, '/a.dart', -1);
+    expect(object.path, '/a.dart');
+  }
+
+  void test_encodeHash() {
+    StringCodec stringCodec = new StringCodec();
+    String path = '/a/bb/ccc.dart';
+    int hash1 = IndexableFileKind.INSTANCE
+        .encodeHash(stringCodec.encode, new IndexableFile(path));
+    int hash2 = IndexableFileKind.INSTANCE
+        .encodeHash(stringCodec.encode, new IndexableFile(path));
+    expect(hash2, hash1);
+  }
+}
+
+@reflectiveTest
+class IndexableFileTest {
+  void test_equals() {
+    IndexableFile a = new IndexableFile('/a.dart');
+    IndexableFile a2 = new IndexableFile('/a.dart');
+    IndexableFile b = new IndexableFile('/b.dart');
+    expect(a == a, isTrue);
+    expect(a == a2, isTrue);
+    expect(a == b, isFalse);
+  }
+
+  void test_getters() {
+    String path = '/a/bb/ccc.dart';
+    IndexableFile indexable = new IndexableFile(path);
+    expect(indexable.kind, IndexableFileKind.INSTANCE);
+    expect(indexable.filePath, path);
+    expect(indexable.offset, -1);
+    expect(indexable.toString(), path);
+  }
+}
diff --git a/pkg/analysis_server/test/services/index/local_file_index_test.dart b/pkg/analysis_server/test/services/index/local_file_index_test.dart
index 794f32f..a92a22f 100644
--- a/pkg/analysis_server/test/services/index/local_file_index_test.dart
+++ b/pkg/analysis_server/test/services/index/local_file_index_test.dart
@@ -8,8 +8,10 @@
 import 'package:analysis_server/src/services/index/local_file_index.dart';
 import 'package:unittest/unittest.dart';
 
+import '../../utils.dart';
+
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   test('createLocalFileIndex', () {
     Index index = createLocalFileIndex();
     expect(index, isNotNull);
diff --git a/pkg/analysis_server/test/services/index/local_index_test.dart b/pkg/analysis_server/test/services/index/local_index_test.dart
index 3faa925..dc2e92a 100644
--- a/pkg/analysis_server/test/services/index/local_index_test.dart
+++ b/pkg/analysis_server/test/services/index/local_index_test.dart
@@ -4,20 +4,21 @@
 
 library test.services.src.index.local_index;
 
+import 'package:analysis_server/src/services/index/index_contributor.dart';
 import 'package:analysis_server/src/services/index/local_index.dart';
 import 'package:analysis_server/src/services/index/local_memory_index.dart';
 import 'package:analyzer/src/generated/ast.dart';
 import 'package:analyzer/src/generated/element.dart';
-import 'package:analyzer/src/generated/html.dart';
 import 'package:analyzer/src/generated/source_io.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 import 'package:unittest/unittest.dart';
 
 import '../../abstract_context.dart';
+import '../../utils.dart';
 import 'store/single_source_container.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(LocalIndexTest);
 }
 
@@ -36,6 +37,7 @@
   void setUp() {
     super.setUp();
     index = createLocalMemoryIndex();
+    index.contributors = [new DartIndexContributor()];
   }
 
   void tearDown() {
@@ -51,27 +53,18 @@
     expect(_getTopElements(), isEmpty);
   }
 
-  void test_indexHtmlUnit_nullUnit() {
-    index.indexHtmlUnit(context, null);
-  }
-
-  void test_indexHtmlUnit_nullUnitElement() {
-    HtmlUnit unit = new HtmlUnit(null, [], null);
-    index.indexHtmlUnit(context, unit);
-  }
-
-  void test_indexUnit() {
+  void test_index() {
     _indexTest('main() {}');
     _assertElementNames(_getTopElements(), ['main']);
   }
 
-  void test_indexUnit_nullUnit() {
-    index.indexUnit(context, null);
+  void test_index_nullObject() {
+    index.index(context, null);
   }
 
-  void test_indexUnit_nullUnitElement() {
+  void test_index_nullUnitElement() {
     CompilationUnit unit = new CompilationUnit(null, null, [], [], null);
-    index.indexUnit(context, unit);
+    index.index(context, unit);
   }
 
   void test_removeContext() {
@@ -114,7 +107,7 @@
   Source _indexLibraryUnit(String path, String content) {
     Source source = addSource(path, content);
     CompilationUnit dartUnit = resolveLibraryUnit(source);
-    index.indexUnit(context, dartUnit);
+    index.index(context, dartUnit);
     return source;
   }
 
diff --git a/pkg/analysis_server/test/services/index/store/codec_test.dart b/pkg/analysis_server/test/services/index/store/codec_test.dart
index 3c0eb1a..cfc6b97 100644
--- a/pkg/analysis_server/test/services/index/store/codec_test.dart
+++ b/pkg/analysis_server/test/services/index/store/codec_test.dart
@@ -4,7 +4,7 @@
 
 library test.services.src.index.store.codec;
 
-import 'package:analysis_server/analysis/index/index_core.dart';
+import 'package:analysis_server/plugin/index/index_core.dart';
 import 'package:analysis_server/src/services/index/index.dart';
 import 'package:analysis_server/src/services/index/indexable_element.dart';
 import 'package:analysis_server/src/services/index/store/codec.dart';
@@ -15,9 +15,10 @@
 
 import '../../../abstract_single_unit.dart';
 import '../../../mocks.dart';
+import '../../../utils.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(_ContextCodecTest);
   defineReflectiveTests(_ElementCodecTest);
   defineReflectiveTests(_RelationshipCodecTest);
@@ -74,7 +75,9 @@
   }
 
   void test_encode_CompilationUnitElement() {
-    addSource('/my_part.dart', '''
+    addSource(
+        '/my_part.dart',
+        '''
 part of my_lib;
 ''');
     resolveTestUnit('''
@@ -90,7 +93,7 @@
       int id2 = codec.encode2(indexable);
       int id3 = codec.encode3(indexable);
       expect(id1, isNonNegative);
-      expect(id2, isNonNegative);
+      expect(id2, -1);
       expect(id3, IndexableElementKind.forElement(element).index);
       validateDecode(id1, id2, id3, element);
     }
@@ -103,7 +106,7 @@
       int id2 = codec.encode2(indexable);
       int id3 = codec.encode3(indexable);
       expect(id1, isNonNegative);
-      expect(id2, isNonNegative);
+      expect(id2, -1);
       expect(id3, IndexableElementKind.forElement(element).index);
       validateDecode(id1, id2, id3, element);
     }
@@ -249,6 +252,17 @@
     validateDecode(id1, id2, id3, element);
   }
 
+  void test_encode_IndexableName() {
+    IndexableName indexable = new IndexableName('test');
+    int id1 = codec.encode1(indexable);
+    int id2 = codec.encode2(indexable);
+    int id3 = codec.encode3(indexable);
+    expect(id1, -1);
+    expect(id2, isNonNegative);
+    expect(id3, IndexableNameKind.INSTANCE.index);
+    expect(codec.decode(context, id1, id2, id3), indexable);
+  }
+
   void test_encode_LibraryElement() {
     resolveTestUnit('''
 class A {
@@ -261,7 +275,7 @@
     int id2 = codec.encode2(indexable);
     int id3 = codec.encode3(indexable);
     expect(id1, isNonNegative);
-    expect(id2, isNonNegative);
+    expect(id2, -1);
     expect(id3, IndexableElementKind.forElement(element).index);
     validateDecode(id1, id2, id3, element);
   }
@@ -283,17 +297,6 @@
     validateDecode(id1, id2, id3, element);
   }
 
-  void test_encode_NameElement() {
-    Element element = new NameElement('test');
-    IndexableObject indexable = new IndexableElement(element);
-    int id1 = codec.encode1(indexable);
-    int id2 = codec.encode2(indexable);
-    int id3 = codec.encode3(indexable);
-    expect(id1, -1);
-    expect(id2, isNonNegative);
-    expect(id3, IndexableElementKind.forElement(element).index);
-  }
-
   void test_encode_nullLibraryElement() {
     resolveTestUnit('''
 test() {}
diff --git a/pkg/analysis_server/test/services/index/store/collection_test.dart b/pkg/analysis_server/test/services/index/store/collection_test.dart
index 917afad..77e6bb7 100644
--- a/pkg/analysis_server/test/services/index/store/collection_test.dart
+++ b/pkg/analysis_server/test/services/index/store/collection_test.dart
@@ -8,8 +8,10 @@
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 import 'package:unittest/unittest.dart';
 
+import '../../../utils.dart';
+
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(_IntArrayToIntMapTest);
   defineReflectiveTests(_IntToIntSetMapTest);
 }
diff --git a/pkg/analysis_server/test/services/index/store/split_store_test.dart b/pkg/analysis_server/test/services/index/store/split_store_test.dart
index b954996..ab91ca6 100644
--- a/pkg/analysis_server/test/services/index/store/split_store_test.dart
+++ b/pkg/analysis_server/test/services/index/store/split_store_test.dart
@@ -6,7 +6,7 @@
 
 import 'dart:async';
 
-import 'package:analysis_server/analysis/index/index_core.dart';
+import 'package:analysis_server/plugin/index/index_core.dart';
 import 'package:analysis_server/src/services/index/index.dart';
 import 'package:analysis_server/src/services/index/indexable_element.dart';
 import 'package:analysis_server/src/services/index/store/codec.dart';
@@ -20,11 +20,12 @@
 import 'package:unittest/unittest.dart';
 
 import '../../../mocks.dart';
+import '../../../utils.dart';
 import 'mocks.dart';
 import 'single_source_container.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(_FileNodeManagerTest);
   defineReflectiveTests(_IndexNodeTest);
   defineReflectiveTests(_LocationDataTest);
@@ -33,7 +34,8 @@
 }
 
 void _assertHasLocation(List<LocationImpl> locations, IndexableElement element,
-    int offset, int length, {bool isQualified: false, bool isResolved: true}) {
+    int offset, int length,
+    {bool isQualified: false, bool isResolved: true}) {
   for (LocationImpl location in locations) {
     if ((element == null || location.indexable == element) &&
         location.offset == offset &&
@@ -490,11 +492,14 @@
   IndexableElement indexableC;
   IndexableElement indexableD;
 
-  HtmlElement htmlElementA = new MockHtmlElement();
-  HtmlElement htmlElementB = new MockHtmlElement();
-  LibraryElement libraryElement = new MockLibraryElement();
   Source librarySource = new MockSource('librarySource');
   CompilationUnitElement libraryUnitElement = new MockCompilationUnitElement();
+  LibraryElement libraryElement = new MockLibraryElement();
+
+  Source librarySourceB = new MockSource('librarySourceB');
+  LibraryElement libraryElementB = new MockLibraryElement();
+  CompilationUnitElement libraryUnitElementB = new MockCompilationUnitElement();
+
   ElementCodec elementCodec = new MockElementCodec();
   MemoryNodeManager nodeManager = new MemoryNodeManager();
   RelationshipImpl relationship =
@@ -516,7 +521,8 @@
     indexableD = new IndexableElement(elementD);
 
     nodeManager.elementCodec = elementCodec;
-    store = new SplitIndexStore(nodeManager);
+    store = new SplitIndexStore(
+        nodeManager, <IndexObjectManager>[new DartUnitIndexObjectManager()]);
     when(elementCodec.encode1(indexableA)).thenReturn(11);
     when(elementCodec.encode2(indexableA)).thenReturn(12);
     when(elementCodec.encode3(indexableA)).thenReturn(13);
@@ -536,7 +542,6 @@
     when(contextA.isDisposed).thenReturn(false);
     when(contextB.isDisposed).thenReturn(false);
     when(contextC.isDisposed).thenReturn(false);
-    when(librarySource.fullName).thenReturn('/home/user/librarySource.dart');
     when(sourceA.fullName).thenReturn('/home/user/sourceA.dart');
     when(sourceB.fullName).thenReturn('/home/user/sourceB.dart');
     when(sourceC.fullName).thenReturn('/home/user/sourceC.dart');
@@ -565,25 +570,31 @@
     when(unitElementB.library).thenReturn(libraryElement);
     when(unitElementC.library).thenReturn(libraryElement);
     when(unitElementD.library).thenReturn(libraryElement);
-    when(htmlElementA.source).thenReturn(sourceA);
-    when(htmlElementB.source).thenReturn(sourceB);
     // library
+    when(librarySource.fullName).thenReturn('/home/user/librarySource.dart');
     when(libraryUnitElement.library).thenReturn(libraryElement);
     when(libraryUnitElement.source).thenReturn(librarySource);
     when(libraryElement.source).thenReturn(librarySource);
     when(libraryElement.definingCompilationUnit).thenReturn(libraryUnitElement);
+    // library B
+    when(librarySourceB.fullName).thenReturn('/home/user/librarySource.dart');
+    when(libraryUnitElementB.library).thenReturn(libraryElementB);
+    when(libraryUnitElementB.source).thenReturn(librarySourceB);
+    when(libraryElementB.source).thenReturn(librarySourceB);
+    when(libraryElementB.definingCompilationUnit)
+        .thenReturn(libraryUnitElementB);
   }
 
   void test_aboutToIndexDart_disposedContext() {
     when(contextA.isDisposed).thenReturn(true);
-    expect(store.aboutToIndexDart(contextA, unitElementA), isFalse);
+    expect(store.aboutToIndex(contextA, unitElementA), isFalse);
   }
 
   Future test_aboutToIndexDart_library_first() {
     when(libraryElement.parts)
         .thenReturn(<CompilationUnitElement>[unitElementA, unitElementB]);
     {
-      store.aboutToIndexDart(contextA, libraryUnitElement);
+      store.aboutToIndex(contextA, libraryUnitElement);
       store.doneIndex();
     }
     return store
@@ -597,12 +608,12 @@
     LocationImpl locationA = mockLocation(indexableA);
     LocationImpl locationB = mockLocation(indexableB);
     {
-      store.aboutToIndexDart(contextA, unitElementA);
+      store.aboutToIndex(contextA, unitElementA);
       store.recordRelationship(indexableA, relationship, locationA);
       store.doneIndex();
     }
     {
-      store.aboutToIndexDart(contextA, unitElementB);
+      store.aboutToIndex(contextA, unitElementB);
       store.recordRelationship(indexableA, relationship, locationB);
       store.doneIndex();
     }
@@ -614,7 +625,7 @@
       // apply "libraryUnitElement", only with "B"
       when(libraryElement.parts).thenReturn([unitElementB]);
       {
-        store.aboutToIndexDart(contextA, libraryUnitElement);
+        store.aboutToIndex(contextA, libraryUnitElement);
         store.doneIndex();
       }
     }).then((_) {
@@ -626,54 +637,32 @@
     });
   }
 
+  void test_aboutToIndexDart_nullContext() {
+    expect(store.aboutToIndex(null, unitElementA), isFalse);
+  }
+
   void test_aboutToIndexDart_nullLibraryElement() {
     when(unitElementA.library).thenReturn(null);
-    expect(store.aboutToIndexDart(contextA, unitElementA), isFalse);
+    expect(store.aboutToIndex(contextA, unitElementA), isFalse);
   }
 
   void test_aboutToIndexDart_nullLibraryUnitElement() {
     when(libraryElement.definingCompilationUnit).thenReturn(null);
-    expect(store.aboutToIndexDart(contextA, unitElementA), isFalse);
+    expect(store.aboutToIndex(contextA, unitElementA), isFalse);
   }
 
   void test_aboutToIndexDart_nullUnitElement() {
-    expect(store.aboutToIndexDart(contextA, null), isFalse);
-  }
-
-  test_aboutToIndexHtml_() {
-    LocationImpl locationA = mockLocation(indexableA);
-    LocationImpl locationB = mockLocation(indexableB);
-    {
-      store.aboutToIndexHtml(contextA, htmlElementA);
-      store.recordRelationship(indexableA, relationship, locationA);
-      store.doneIndex();
-    }
-    {
-      store.aboutToIndexHtml(contextA, htmlElementB);
-      store.recordRelationship(indexableA, relationship, locationB);
-      store.doneIndex();
-    }
-    // "A" and "B" locations
-    return store
-        .getRelationships(indexableA, relationship)
-        .then((List<LocationImpl> locations) {
-      assertLocations(locations, [locationA, locationB]);
-    });
-  }
-
-  void test_aboutToIndexHtml_disposedContext() {
-    when(contextA.isDisposed).thenReturn(true);
-    expect(store.aboutToIndexHtml(contextA, htmlElementA), isFalse);
+    expect(store.aboutToIndex(contextA, null), isFalse);
   }
 
   test_cancelIndexDart() {
     LocationImpl locationA = mockLocation(indexableA);
     LocationImpl locationB = mockLocation(indexableA);
-    store.aboutToIndexDart(contextA, unitElementA);
+    store.aboutToIndex(contextA, unitElementA);
     store.recordRelationship(indexableA, relationship, locationA);
     store.recordRelationship(indexableA, relationship, locationB);
     store.recordTopLevelDeclaration(elementA);
-    store.cancelIndexDart();
+    store.cancelIndex();
     return store
         .getRelationships(indexableA, relationship)
         .then((List<LocationImpl> locations) {
@@ -684,7 +673,7 @@
 
   void test_clear() {
     LocationImpl locationA = mockLocation(indexableA);
-    store.aboutToIndexDart(contextA, unitElementA);
+    store.aboutToIndex(contextA, unitElementA);
     store.recordRelationship(indexableA, relationship, locationA);
     store.doneIndex();
     expect(nodeManager.isEmpty(), isFalse);
@@ -712,12 +701,12 @@
     LocationImpl locationA = mockLocation(indexableA);
     LocationImpl locationB = mockLocation(indexableB);
     {
-      store.aboutToIndexDart(contextA, unitElementA);
+      store.aboutToIndex(contextA, unitElementA);
       store.recordRelationship(indexableA, relationship, locationA);
       store.doneIndex();
     }
     {
-      store.aboutToIndexDart(contextA, unitElementB);
+      store.aboutToIndex(contextA, unitElementB);
       store.recordRelationship(indexableA, relationship, locationB);
       store.doneIndex();
     }
@@ -755,12 +744,12 @@
     LocationImpl locationA = mockLocation(indexableA);
     LocationImpl locationB = mockLocation(indexableB);
     {
-      store.aboutToIndexDart(contextA, unitElementA);
+      store.aboutToIndex(contextA, unitElementA);
       store.recordRelationship(indexableA, relationship, locationA);
       store.doneIndex();
     }
     {
-      store.aboutToIndexDart(contextA, unitElementB);
+      store.aboutToIndex(contextA, unitElementB);
       store.recordRelationship(indexableA, relationship, locationB);
       store.doneIndex();
     }
@@ -773,7 +762,7 @@
 
   test_recordRelationship_oneLocation() {
     LocationImpl locationA = mockLocation(indexableA);
-    store.aboutToIndexDart(contextA, unitElementA);
+    store.aboutToIndex(contextA, unitElementA);
     store.recordRelationship(indexableA, relationship, locationA);
     store.doneIndex();
     return store
@@ -786,7 +775,7 @@
   test_recordRelationship_twoLocations() {
     LocationImpl locationA = mockLocation(indexableA);
     LocationImpl locationB = mockLocation(indexableA);
-    store.aboutToIndexDart(contextA, unitElementA);
+    store.aboutToIndex(contextA, unitElementA);
     store.recordRelationship(indexableA, relationship, locationA);
     store.recordRelationship(indexableA, relationship, locationB);
     store.doneIndex();
@@ -801,12 +790,12 @@
     LocationImpl locationA = mockLocation(indexableA);
     LocationImpl locationB = mockLocation(indexableB);
     {
-      store.aboutToIndexDart(contextA, unitElementA);
+      store.aboutToIndex(contextA, unitElementA);
       store.recordRelationship(indexableA, relationship, locationA);
       store.doneIndex();
     }
     {
-      store.aboutToIndexDart(contextA, unitElementB);
+      store.aboutToIndex(contextA, unitElementB);
       store.recordRelationship(indexableA, relationship, locationB);
       store.doneIndex();
     }
@@ -830,39 +819,39 @@
     store.removeContext(null);
   }
 
-  test_removeSource_library() {
+  test_removeSource_library() async {
+    when(elementB.library).thenReturn(libraryElementB);
+    when(unitElementB.library).thenReturn(libraryElementB);
     LocationImpl locationA = mockLocation(indexableA);
     LocationImpl locationB = mockLocation(indexableB);
     LocationImpl locationC = mockLocation(indexableC);
     {
-      store.aboutToIndexDart(contextA, unitElementA);
-      store.recordRelationship(indexableA, relationship, locationA);
+      store.aboutToIndex(contextA, unitElementA);
+      store.recordRelationship(indexableD, relationship, locationA);
       store.doneIndex();
     }
     {
-      store.aboutToIndexDart(contextA, unitElementB);
-      store.recordRelationship(indexableA, relationship, locationB);
+      store.aboutToIndex(contextA, unitElementB);
+      store.recordRelationship(indexableD, relationship, locationB);
       store.doneIndex();
     }
     {
-      store.aboutToIndexDart(contextA, unitElementC);
-      store.recordRelationship(indexableA, relationship, locationC);
+      store.aboutToIndex(contextA, unitElementC);
+      store.recordRelationship(indexableD, relationship, locationC);
       store.doneIndex();
     }
     // "A", "B" and "C" locations
-    return store
-        .getRelationships(indexableA, relationship)
-        .then((List<LocationImpl> locations) {
+    {
+      var locations = await store.getRelationships(indexableD, relationship);
       assertLocations(locations, [locationA, locationB, locationC]);
-    }).then((_) {
-      // remove "librarySource"
-      store.removeSource(contextA, librarySource);
-      return store
-          .getRelationships(indexableA, relationship)
-          .then((List<LocationImpl> locations) {
-        assertLocations(locations, []);
-      });
-    });
+    }
+    // remove "librarySource"
+    store.removeSource(contextA, librarySource);
+    // only "B" location, which is in "librarySourceB"
+    {
+      var locations = await store.getRelationships(indexableD, relationship);
+      assertLocations(locations, [locationB]);
+    }
   }
 
   void test_removeSource_nullContext() {
@@ -874,17 +863,17 @@
     LocationImpl locationB = mockLocation(indexableB);
     LocationImpl locationC = mockLocation(indexableC);
     {
-      store.aboutToIndexDart(contextA, unitElementA);
+      store.aboutToIndex(contextA, unitElementA);
       store.recordRelationship(indexableA, relationship, locationA);
       store.doneIndex();
     }
     {
-      store.aboutToIndexDart(contextA, unitElementB);
+      store.aboutToIndex(contextA, unitElementB);
       store.recordRelationship(indexableA, relationship, locationB);
       store.doneIndex();
     }
     {
-      store.aboutToIndexDart(contextA, unitElementC);
+      store.aboutToIndex(contextA, unitElementC);
       store.recordRelationship(indexableA, relationship, locationC);
       store.doneIndex();
     }
@@ -908,12 +897,12 @@
     LocationImpl locationA = mockLocation(indexableA);
     LocationImpl locationB = mockLocation(indexableB);
     {
-      store.aboutToIndexDart(contextA, unitElementA);
+      store.aboutToIndex(contextA, unitElementA);
       store.recordRelationship(indexableA, relationship, locationA);
       store.doneIndex();
     }
     {
-      store.aboutToIndexDart(contextA, unitElementB);
+      store.aboutToIndex(contextA, unitElementB);
       store.recordRelationship(indexableA, relationship, locationB);
       store.doneIndex();
     }
@@ -939,17 +928,17 @@
 
   void test_removeSources_unit() {
     {
-      store.aboutToIndexDart(contextA, unitElementA);
+      store.aboutToIndex(contextA, unitElementA);
       store.recordTopLevelDeclaration(elementA);
       store.doneIndex();
     }
     {
-      store.aboutToIndexDart(contextA, unitElementB);
+      store.aboutToIndex(contextA, unitElementB);
       store.recordTopLevelDeclaration(elementB);
       store.doneIndex();
     }
     {
-      store.aboutToIndexDart(contextA, unitElementC);
+      store.aboutToIndex(contextA, unitElementC);
       store.recordTopLevelDeclaration(elementC);
       store.doneIndex();
     }
@@ -973,12 +962,12 @@
     when(elementCodec.decode(contextB, 21, 22, 23))
         .thenReturn(new IndexableElement(elementB));
     {
-      store.aboutToIndexDart(contextA, unitElementA);
+      store.aboutToIndex(contextA, unitElementA);
       store.recordTopLevelDeclaration(elementA);
       store.doneIndex();
     }
     {
-      store.aboutToIndexDart(contextB, unitElementB);
+      store.aboutToIndex(contextB, unitElementB);
       store.recordTopLevelDeclaration(elementB);
       store.doneIndex();
     }
@@ -989,7 +978,7 @@
     }
     // re-index "unitElementA"
     {
-      store.aboutToIndexDart(contextA, unitElementA);
+      store.aboutToIndex(contextA, unitElementA);
       store.doneIndex();
     }
     {
@@ -1004,12 +993,12 @@
     when(elementCodec.decode(contextB, 21, 22, 23))
         .thenReturn(new IndexableElement(elementB));
     {
-      store.aboutToIndexDart(contextA, unitElementA);
+      store.aboutToIndex(contextA, unitElementA);
       store.recordTopLevelDeclaration(elementA);
       store.doneIndex();
     }
     {
-      store.aboutToIndexDart(contextB, unitElementB);
+      store.aboutToIndex(contextB, unitElementB);
       store.recordTopLevelDeclaration(elementB);
       store.doneIndex();
     }
@@ -1032,12 +1021,12 @@
     when(elementCodec.decode(contextB, 21, 22, 23))
         .thenReturn(new IndexableElement(elementB));
     {
-      store.aboutToIndexDart(contextA, unitElementA);
+      store.aboutToIndex(contextA, unitElementA);
       store.recordTopLevelDeclaration(elementA);
       store.doneIndex();
     }
     {
-      store.aboutToIndexDart(contextB, unitElementB);
+      store.aboutToIndex(contextB, unitElementB);
       store.recordTopLevelDeclaration(elementB);
       store.doneIndex();
     }
@@ -1060,12 +1049,12 @@
     when(elementCodec.decode(contextB, 21, 22, 23))
         .thenReturn(new IndexableElement(elementB));
     {
-      store.aboutToIndexDart(contextA, unitElementA);
+      store.aboutToIndex(contextA, unitElementA);
       store.recordTopLevelDeclaration(elementA);
       store.doneIndex();
     }
     {
-      store.aboutToIndexDart(contextB, unitElementB);
+      store.aboutToIndex(contextB, unitElementB);
       store.recordTopLevelDeclaration(elementB);
       store.doneIndex();
     }
diff --git a/pkg/analysis_server/test/services/index/store/temporary_folder_file_manager_test.dart b/pkg/analysis_server/test/services/index/store/temporary_folder_file_manager_test.dart
index 3eaf5bc..a6974aa 100644
--- a/pkg/analysis_server/test/services/index/store/temporary_folder_file_manager_test.dart
+++ b/pkg/analysis_server/test/services/index/store/temporary_folder_file_manager_test.dart
@@ -11,8 +11,10 @@
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 import 'package:unittest/unittest.dart';
 
+import '../../../utils.dart';
+
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(_SeparateFileManagerTest);
 }
 
diff --git a/pkg/analysis_server/test/services/index/store/test_all.dart b/pkg/analysis_server/test/services/index/store/test_all.dart
index 236b2e5..ab63c97 100644
--- a/pkg/analysis_server/test/services/index/store/test_all.dart
+++ b/pkg/analysis_server/test/services/index/store/test_all.dart
@@ -6,6 +6,7 @@
 
 import 'package:unittest/unittest.dart';
 
+import '../../../utils.dart';
 import 'codec_test.dart' as codec_test;
 import 'collection_test.dart' as collection_test;
 import 'split_store_test.dart' as split_store_test;
@@ -15,7 +16,7 @@
  * Utility for manually running all tests.
  */
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   group('store', () {
     codec_test.main();
     collection_test.main();
diff --git a/pkg/analysis_server/test/services/index/test_all.dart b/pkg/analysis_server/test/services/index/test_all.dart
index 5aff005..8f64484 100644
--- a/pkg/analysis_server/test/services/index/test_all.dart
+++ b/pkg/analysis_server/test/services/index/test_all.dart
@@ -6,7 +6,9 @@
 
 import 'package:unittest/unittest.dart';
 
+import '../../utils.dart';
 import 'dart_index_contributor_test.dart' as dart_index_contributor_test;
+import 'indexable_file_test.dart' as indexable_file_test;
 import 'local_file_index_test.dart' as local_file_index_test;
 import 'local_index_test.dart' as local_index_test;
 import 'store/test_all.dart' as store_test_all;
@@ -15,9 +17,10 @@
  * Utility for manually running all tests.
  */
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   group('index', () {
     dart_index_contributor_test.main();
+    indexable_file_test.main();
     local_file_index_test.main();
     local_index_test.main();
     store_test_all.main();
diff --git a/pkg/analysis_server/test/services/linter/linter_test.dart b/pkg/analysis_server/test/services/linter/linter_test.dart
new file mode 100644
index 0000000..a1f57eb
--- /dev/null
+++ b/pkg/analysis_server/test/services/linter/linter_test.dart
@@ -0,0 +1,77 @@
+// 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 test.services.linter;
+
+import 'package:analysis_server/src/services/linter/linter.dart';
+import 'package:analyzer/analyzer.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_reflective_loader/test_reflective_loader.dart';
+import 'package:unittest/unittest.dart';
+
+import '../../utils.dart';
+
+main() {
+  initializeTestEnvironment();
+  defineReflectiveTests(LinterRuleOptionsValidatorTest);
+}
+
+@reflectiveTest
+class LinterRuleOptionsValidatorTest {
+  final LinterRuleOptionsValidator validator= new LinterRuleOptionsValidator();
+  final AnalysisOptionsProvider optionsProvider = new AnalysisOptionsProvider();
+
+  RecordingErrorListener recorder;
+  ErrorReporter reporter;
+
+  List<AnalysisError> get errors => recorder.errors;
+
+  setUp() {
+    recorder = new RecordingErrorListener();
+    reporter = new ErrorReporter(recorder, new _TestSource());
+  }
+
+  test_linter_defined_rules() {
+    validate(
+        '''
+linter:
+  rules:
+    - camel_case_types
+    ''',
+        []);
+  }
+
+  test_linter_no_rules() {
+    validate(
+        '''
+linter:
+  rules:
+    ''',
+        []);
+  }
+
+  test_linter_undefined_rule() {
+    validate(
+        '''
+linter:
+  rules:
+    - undefined
+    ''',
+        [UNDEFINED_LINT_WARNING]);
+  }
+
+  validate(String source, List<AnalysisOptionsErrorCode> expected) {
+    var options = optionsProvider.getOptionsFromString(source);
+    validator.validate(reporter, options);
+    expect(errors.map((AnalysisError e) => e.errorCode),
+        unorderedEquals(expected));
+  }
+}
+
+class _TestSource implements Source {
+  @override
+  noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
+}
diff --git a/pkg/analysis_server/test/services/refactoring/abstract_refactoring.dart b/pkg/analysis_server/test/services/refactoring/abstract_refactoring.dart
index 8ed4913..576f364 100644
--- a/pkg/analysis_server/test/services/refactoring/abstract_refactoring.dart
+++ b/pkg/analysis_server/test/services/refactoring/abstract_refactoring.dart
@@ -6,7 +6,7 @@
 
 import 'dart:async';
 
-import 'package:analysis_server/src/protocol.dart';
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/services/correction/status.dart';
 import 'package:analysis_server/src/services/index/index.dart';
 import 'package:analysis_server/src/services/index/local_memory_index.dart';
@@ -92,7 +92,8 @@
    */
   void assertRefactoringStatus(
       RefactoringStatus status, RefactoringProblemSeverity expectedSeverity,
-      {String expectedMessage, SourceRange expectedContextRange,
+      {String expectedMessage,
+      SourceRange expectedContextRange,
       String expectedContextSearch}) {
     expect(status.severity, expectedSeverity, reason: status.toString());
     if (expectedSeverity != null) {
@@ -147,13 +148,13 @@
 
   void indexTestUnit(String code) {
     resolveTestUnit(code);
-    index.indexUnit(context, testUnit);
+    index.index(context, testUnit);
   }
 
   void indexUnit(String file, String code) {
     Source source = addSource(file, code);
     CompilationUnit unit = resolveLibraryUnit(source);
-    index.indexUnit(context, unit);
+    index.index(context, unit);
   }
 
   void setUp() {
diff --git a/pkg/analysis_server/test/services/refactoring/abstract_rename.dart b/pkg/analysis_server/test/services/refactoring/abstract_rename.dart
index 98fd12a..0dd3c77 100644
--- a/pkg/analysis_server/test/services/refactoring/abstract_rename.dart
+++ b/pkg/analysis_server/test/services/refactoring/abstract_rename.dart
@@ -4,7 +4,7 @@
 
 library test.services.refactoring.rename;
 
-import 'package:analysis_server/src/protocol.dart' hide Element;
+import 'package:analysis_server/plugin/protocol/protocol.dart' hide Element;
 import 'package:analysis_server/src/services/correction/namespace.dart';
 import 'package:analysis_server/src/services/refactoring/refactoring.dart';
 import 'package:analyzer/src/generated/ast.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 1c90d2a..ca3a1db 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
@@ -6,17 +6,17 @@
 
 import 'dart:async';
 
-import 'package:analysis_server/src/protocol.dart' hide ElementKind;
+import 'package:analysis_server/plugin/protocol/protocol.dart' hide ElementKind;
 import 'package:analysis_server/src/services/correction/status.dart';
 import 'package:analysis_server/src/services/refactoring/refactoring.dart';
 import 'package:analyzer/src/generated/element.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
+import '../../utils.dart';
 import 'abstract_refactoring.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(ConvertGetterToMethodTest);
 }
 
@@ -89,7 +89,9 @@
   }
 
   test_change_multipleFiles() {
-    indexUnit('/other.dart', r'''
+    indexUnit(
+        '/other.dart',
+        r'''
 class A {
   int get test => 1;
 }
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 11f3f8a..2e3551f 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
@@ -6,17 +6,17 @@
 
 import 'dart:async';
 
-import 'package:analysis_server/src/protocol.dart' hide ElementKind;
+import 'package:analysis_server/plugin/protocol/protocol.dart' hide ElementKind;
 import 'package:analysis_server/src/services/correction/status.dart';
 import 'package:analysis_server/src/services/refactoring/refactoring.dart';
 import 'package:analyzer/src/generated/element.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
+import '../../utils.dart';
 import 'abstract_refactoring.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(ConvertMethodToGetterTest);
 }
 
@@ -89,7 +89,9 @@
   }
 
   test_change_multipleFiles() {
-    indexUnit('/other.dart', r'''
+    indexUnit(
+        '/other.dart',
+        r'''
 class A {
   int test() => 1;
 }
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 a5c29c2..a5dd25a 100644
--- a/pkg/analysis_server/test/services/refactoring/extract_local_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/extract_local_test.dart
@@ -6,17 +6,18 @@
 
 import 'dart:async';
 
-import 'package:analysis_server/src/protocol.dart';
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 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_reflective_loader/test_reflective_loader.dart';
 import 'package:unittest/unittest.dart';
 
+import '../../utils.dart';
 import 'abstract_refactoring.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(ExtractLocalTest);
 }
 
@@ -35,7 +36,8 @@
     // conflicting name
     RefactoringStatus status = await refactoring.checkAllConditions();
     assertRefactoringStatus(status, RefactoringProblemSeverity.WARNING,
-        expectedMessage: "A variable with name 'res' is already defined in the visible scope.");
+        expectedMessage:
+            "A variable with name 'res' is already defined in the visible scope.");
   }
 
   test_checkFinalConditions_sameVariable_before() async {
@@ -49,7 +51,8 @@
     // conflicting name
     RefactoringStatus status = await refactoring.checkAllConditions();
     assertRefactoringStatus(status, RefactoringProblemSeverity.WARNING,
-        expectedMessage: "A variable with name 'res' is already defined in the visible scope.");
+        expectedMessage:
+            "A variable with name 'res' is already defined in the visible scope.");
   }
 
   test_checkInitialConditions_assignmentLeftHandSize() async {
@@ -127,7 +130,8 @@
     // check conditions
     RefactoringStatus status = await refactoring.checkAllConditions();
     assertRefactoringStatus(status, RefactoringProblemSeverity.FATAL,
-        expectedMessage: 'Expression inside of function must be selected to activate this refactoring.');
+        expectedMessage:
+            'Expression inside of function must be selected to activate this refactoring.');
   }
 
   test_checkInitialConditions_stringSelection_leadingQuote() async {
@@ -140,7 +144,8 @@
     // check conditions
     RefactoringStatus status = await refactoring.checkAllConditions();
     assertRefactoringStatus(status, RefactoringProblemSeverity.FATAL,
-        expectedMessage: 'Cannot extract only leading or trailing quote of string literal.');
+        expectedMessage:
+            'Cannot extract only leading or trailing quote of string literal.');
   }
 
   test_checkInitialConditions_stringSelection_trailingQuote() async {
@@ -153,7 +158,8 @@
     // check conditions
     RefactoringStatus status = await refactoring.checkAllConditions();
     assertRefactoringStatus(status, RefactoringProblemSeverity.FATAL,
-        expectedMessage: 'Cannot extract only leading or trailing quote of string literal.');
+        expectedMessage:
+            'Cannot extract only leading or trailing quote of string literal.');
   }
 
   test_checkLocalName() {
@@ -933,7 +939,8 @@
   Future _assertInitialConditions_fatal_selection() async {
     RefactoringStatus status = await refactoring.checkInitialConditions();
     assertRefactoringStatus(status, RefactoringProblemSeverity.FATAL,
-        expectedMessage: 'Expression must be selected to activate this refactoring.');
+        expectedMessage:
+            'Expression must be selected to activate this refactoring.');
   }
 
   /**
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 d33a930..ff3b3b0 100644
--- a/pkg/analysis_server/test/services/refactoring/extract_method_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/extract_method_test.dart
@@ -6,17 +6,18 @@
 
 import 'dart:async';
 
-import 'package:analysis_server/src/protocol.dart';
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 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_reflective_loader/test_reflective_loader.dart';
 import 'package:unittest/unittest.dart';
 
+import '../../utils.dart';
 import 'abstract_refactoring.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(ExtractMethodTest);
 }
 
@@ -872,7 +873,8 @@
     // check
     RefactoringStatus status = await refactoring.checkInitialConditions();
     assertRefactoringStatus(status, RefactoringProblemSeverity.FATAL,
-        expectedMessage: 'Cannot extract closure as method, it references 1 external variable(s).');
+        expectedMessage:
+            'Cannot extract closure as method, it references 1 external variable(s).');
   }
 
   test_closure_bad_referencesParameter() async {
@@ -886,7 +888,8 @@
     // check
     RefactoringStatus status = await refactoring.checkInitialConditions();
     assertRefactoringStatus(status, RefactoringProblemSeverity.FATAL,
-        expectedMessage: 'Cannot extract closure as method, it references 1 external variable(s).');
+        expectedMessage:
+            'Cannot extract closure as method, it references 1 external variable(s).');
   }
 
   test_fromTopLevelVariableInitializerClosure() {
@@ -1065,6 +1068,24 @@
     expect(refactoring.returnType, 'int');
   }
 
+  test_returnType_mixInterfaceFunction() async {
+    indexTestUnit('''
+main() {
+// start
+  if (true) {
+    return 1;
+  } else {
+    return () {};
+  }
+// end
+}
+''');
+    _createRefactoringForStartEndComments();
+    // do check
+    await refactoring.checkInitialConditions();
+    expect(refactoring.returnType, 'Object');
+  }
+
   test_returnType_statements() async {
     indexTestUnit('''
 main() {
@@ -2578,6 +2599,35 @@
 ''');
   }
 
+  test_statements_return_multiple_interfaceFunction() {
+    indexTestUnit('''
+main(bool b) {
+// start
+  if (b) {
+    return 1;
+  }
+  return () {};
+// end
+}
+''');
+    _createRefactoringForStartEndComments();
+    // apply refactoring
+    return _assertSuccessfulRefactoring('''
+main(bool b) {
+// start
+  return res(b);
+// end
+}
+
+Object res(bool b) {
+  if (b) {
+    return 1;
+  }
+  return () {};
+}
+''');
+  }
+
   test_statements_return_multiple_sameElementDifferentTypeArgs() {
     indexTestUnit('''
 main(bool b) {
@@ -2668,7 +2718,9 @@
   }
 
   void _addLibraryReturningAsync() {
-    addSource('/asyncLib.dart', r'''
+    addSource(
+        '/asyncLib.dart',
+        r'''
 library asyncLib;
 import 'dart:async';
 Future<int> newFuture() => null;
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 01c7467..9b58386 100644
--- a/pkg/analysis_server/test/services/refactoring/inline_local_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/inline_local_test.dart
@@ -4,17 +4,18 @@
 
 library test.services.refactoring.inline_local;
 
-import 'package:analysis_server/src/protocol.dart' hide Element;
+import 'package:analysis_server/plugin/protocol/protocol.dart' hide Element;
 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_reflective_loader/test_reflective_loader.dart';
 import 'package:unittest/unittest.dart';
 
+import '../../utils.dart';
 import 'abstract_refactoring.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(InlineLocalTest);
 }
 
@@ -627,7 +628,7 @@
     expect(refactoring.referenceCount, 0);
     assertRefactoringStatus(status, RefactoringProblemSeverity.FATAL,
         expectedMessage: 'Local variable declaration or reference must be '
-        'selected to activate this refactoring.');
+            'selected to activate this refactoring.');
   }
 
   void _createRefactoring(String search) {
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 92cbc76..8ff6c84 100644
--- a/pkg/analysis_server/test/services/refactoring/inline_method_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/inline_method_test.dart
@@ -6,7 +6,7 @@
 
 import 'dart:async';
 
-import 'package:analysis_server/src/protocol.dart' hide Element;
+import 'package:analysis_server/plugin/protocol/protocol.dart' hide Element;
 import 'package:analysis_server/src/services/correction/status.dart';
 import 'package:analysis_server/src/services/refactoring/inline_method.dart';
 import 'package:analysis_server/src/services/refactoring/refactoring.dart';
@@ -14,10 +14,11 @@
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 import 'package:unittest/unittest.dart';
 
+import '../../utils.dart';
 import 'abstract_refactoring.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(InlineMethodTest);
 }
 
@@ -116,7 +117,8 @@
     // final conditions
     status = await refactoring.checkFinalConditions();
     assertRefactoringStatus(status, RefactoringProblemSeverity.ERROR,
-        expectedMessage: 'All references must be inlined to remove the source.');
+        expectedMessage:
+            'All references must be inlined to remove the source.');
   }
 
   test_bad_notExecutableElement() {
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 cbae32f..2de53d8 100644
--- a/pkg/analysis_server/test/services/refactoring/move_file_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/move_file_test.dart
@@ -12,13 +12,13 @@
 import 'package:analyzer/src/generated/engine.dart';
 import 'package:analyzer/src/generated/source.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
 import '../../abstract_context.dart';
+import '../../utils.dart';
 import 'abstract_refactoring.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(MoveFileTest);
 }
 
@@ -52,7 +52,9 @@
     assertNoFileChange(pathA);
     assertFileChangeResult(pathB, "import '22/new_name.dart';");
     assertNoFileChange(pathC);
-    assertFileChangeResult(testFile, '''
+    assertFileChangeResult(
+        testFile,
+        '''
 library lib;
 import 'dart:math';
 import 'c.dart';
@@ -65,7 +67,9 @@
   test_file_importedLibrary() async {
     String pathA = '/project/000/1111/a.dart';
     testFile = '/project/000/1111/sub/folder/test.dart';
-    addSource(pathA, '''
+    addSource(
+        pathA,
+        '''
 import 'sub/folder/test.dart';
 ''');
     addTestSource('');
@@ -73,7 +77,9 @@
     // perform refactoring
     _createRefactoring('/project/000/new/folder/name/new_name.dart');
     await _assertSuccessfulRefactoring();
-    assertFileChangeResult(pathA, '''
+    assertFileChangeResult(
+        pathA,
+        '''
 import '../new/folder/name/new_name.dart';
 ''');
     assertNoFileChange(testFile);
@@ -82,7 +88,9 @@
   test_file_importedLibrary_down() async {
     String pathA = '/project/000/1111/a.dart';
     testFile = '/project/000/1111/test.dart';
-    addSource(pathA, '''
+    addSource(
+        pathA,
+        '''
 import 'test.dart';
 ''');
     addTestSource('');
@@ -90,7 +98,9 @@
     // perform refactoring
     _createRefactoring('/project/000/1111/22/new_name.dart');
     await _assertSuccessfulRefactoring();
-    assertFileChangeResult(pathA, '''
+    assertFileChangeResult(
+        pathA,
+        '''
 import '22/new_name.dart';
 ''');
     assertNoFileChange(testFile);
@@ -110,7 +120,9 @@
     ]);
     // do testing
     String pathA = '/project/bin/a.dart';
-    addSource(pathA, '''
+    addSource(
+        pathA,
+        '''
 import 'package:my_pkg/aaa/test.dart';
 ''');
     addTestSource('');
@@ -118,7 +130,9 @@
     // perform refactoring
     _createRefactoring('/packages/my_pkg/bbb/ccc/new_name.dart');
     await _assertSuccessfulRefactoring();
-    assertFileChangeResult(pathA, '''
+    assertFileChangeResult(
+        pathA,
+        '''
 import 'package:my_pkg/bbb/ccc/new_name.dart';
 ''');
     assertNoFileChange(testFile);
@@ -127,7 +141,9 @@
   test_file_importedLibrary_up() async {
     String pathA = '/project/000/1111/a.dart';
     testFile = '/project/000/1111/22/test.dart';
-    addSource(pathA, '''
+    addSource(
+        pathA,
+        '''
 import '22/test.dart';
 ''');
     addTestSource('');
@@ -135,7 +151,9 @@
     // perform refactoring
     _createRefactoring('/project/000/1111/new_name.dart');
     await _assertSuccessfulRefactoring();
-    assertFileChangeResult(pathA, '''
+    assertFileChangeResult(
+        pathA,
+        '''
 import 'new_name.dart';
 ''');
     assertNoFileChange(testFile);
@@ -144,7 +162,9 @@
   test_file_sourcedUnit() async {
     String pathA = '/project/000/1111/a.dart';
     testFile = '/project/000/1111/22/test.dart';
-    addSource(pathA, '''
+    addSource(
+        pathA,
+        '''
 library lib;
 part '22/test.dart';
 ''');
@@ -155,7 +175,9 @@
     // perform refactoring
     _createRefactoring('/project/000/1111/22/new_name.dart');
     await _assertSuccessfulRefactoring();
-    assertFileChangeResult(pathA, '''
+    assertFileChangeResult(
+        pathA,
+        '''
 library lib;
 part '22/new_name.dart';
 ''');
@@ -166,11 +188,15 @@
     String pathA = '/project/000/1111/a.dart';
     String pathB = '/project/000/b.dart';
     testFile = '/project/000/1111/22/test.dart';
-    addSource(pathA, '''
+    addSource(
+        pathA,
+        '''
 library lib;
 part '22/test.dart';
 ''');
-    addSource(pathB, '''
+    addSource(
+        pathB,
+        '''
 library lib;
 part '1111/22/test.dart';
 ''');
@@ -181,11 +207,15 @@
     // perform refactoring
     _createRefactoring('/project/000/1111/22/new_name.dart');
     await _assertSuccessfulRefactoring();
-    assertFileChangeResult(pathA, '''
+    assertFileChangeResult(
+        pathA,
+        '''
 library lib;
 part '22/new_name.dart';
 ''');
-    assertFileChangeResult(pathB, '''
+    assertFileChangeResult(
+        pathB,
+        '''
 library lib;
 part '1111/22/new_name.dart';
 ''');
@@ -195,13 +225,17 @@
   test_project() async {
     String pubspecPath = '/testName/pubspec.yaml';
     String appPath = '/testName/bin/myApp.dart';
-    provider.newFile(pubspecPath, '''
+    provider.newFile(
+        pubspecPath,
+        '''
 name: testName
 version: 0.0.1
 description: My pubspec file.
 ''');
     addSource('/testName/lib/myLib.dart', '');
-    addSource(appPath, '''
+    addSource(
+        appPath,
+        '''
 import 'package:testName/myLib.dart';
 export 'package:testName/myLib.dart';
 ''');
@@ -220,12 +254,16 @@
         provider, searchEngine, context, null, '/testName');
     refactoring.newFile = '/newName';
     await _assertSuccessfulRefactoring();
-    assertFileChangeResult(pubspecPath, '''
+    assertFileChangeResult(
+        pubspecPath,
+        '''
 name: newName
 version: 0.0.1
 description: My pubspec file.
 ''');
-    assertFileChangeResult(appPath, '''
+    assertFileChangeResult(
+        appPath,
+        '''
 import 'package:newName/myLib.dart';
 export 'package:newName/myLib.dart';
 ''');
@@ -253,7 +291,7 @@
       }
       for (ChangeNotice notice in result.changeNotices) {
         if (notice.source.fullName.startsWith('/project/')) {
-          index.indexUnit(context, notice.resolvedDartUnit);
+          index.index(context, notice.resolvedDartUnit);
         }
       }
     }
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 b43fac4..7b9ead8 100644
--- a/pkg/analysis_server/test/services/refactoring/naming_conventions_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/naming_conventions_test.dart
@@ -4,17 +4,17 @@
 
 library test.services.refactoring.naming_conventions;
 
-import 'package:analysis_server/src/protocol.dart'
+import 'package:analysis_server/plugin/protocol/protocol.dart'
     show RefactoringProblemSeverity;
 import 'package:analysis_server/src/services/refactoring/naming_conventions.dart';
 import 'package:analysis_server/src/services/refactoring/refactoring.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'package:unittest/unittest.dart';
 
+import '../../utils.dart';
 import 'abstract_refactoring.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(NamingConventionsTest);
 }
 
@@ -50,7 +50,8 @@
   void test_validateClassName_notIdentifierStart() {
     assertRefactoringStatus(
         validateClassName("-NewName"), RefactoringProblemSeverity.FATAL,
-        expectedMessage: "Class name must begin with an uppercase letter or underscore.");
+        expectedMessage:
+            "Class name must begin with an uppercase letter or underscore.");
   }
 
   void test_validateClassName_null() {
@@ -84,7 +85,8 @@
   void test_validateConstructorName_doesNotStartWithLowerCase() {
     assertRefactoringStatus(
         validateConstructorName("NewName"), RefactoringProblemSeverity.WARNING,
-        expectedMessage: "Constructor name should start with a lowercase letter.");
+        expectedMessage:
+            "Constructor name should start with a lowercase letter.");
   }
 
   void test_validateConstructorName_empty() {
@@ -94,7 +96,8 @@
   void test_validateConstructorName_leadingBlanks() {
     assertRefactoringStatus(
         validateConstructorName(" newName"), RefactoringProblemSeverity.FATAL,
-        expectedMessage: "Constructor name must not start or end with a blank.");
+        expectedMessage:
+            "Constructor name must not start or end with a blank.");
   }
 
   void test_validateConstructorName_notIdentifierMiddle() {
@@ -106,7 +109,8 @@
   void test_validateConstructorName_notIdentifierStart() {
     assertRefactoringStatus(
         validateConstructorName("2name"), RefactoringProblemSeverity.FATAL,
-        expectedMessage: "Constructor name must begin with a lowercase letter or underscore.");
+        expectedMessage:
+            "Constructor name must begin with a lowercase letter or underscore.");
   }
 
   void test_validateConstructorName_null() {
@@ -126,7 +130,8 @@
   void test_validateConstructorName_trailingBlanks() {
     assertRefactoringStatus(
         validateConstructorName("newName "), RefactoringProblemSeverity.FATAL,
-        expectedMessage: "Constructor name must not start or end with a blank.");
+        expectedMessage:
+            "Constructor name must not start or end with a blank.");
   }
 
   void test_validateFieldName_doesNotStartWithLowerCase() {
@@ -156,7 +161,8 @@
   void test_validateFieldName_notIdentifierStart() {
     assertRefactoringStatus(
         validateFieldName("2newName"), RefactoringProblemSeverity.FATAL,
-        expectedMessage: "Field name must begin with a lowercase letter or underscore.");
+        expectedMessage:
+            "Field name must begin with a lowercase letter or underscore.");
   }
 
   void test_validateFieldName_null() {
@@ -210,7 +216,8 @@
   void test_validateFunctionName_notIdentifierStart() {
     assertRefactoringStatus(
         validateFunctionName("2newName"), RefactoringProblemSeverity.FATAL,
-        expectedMessage: "Function name must begin with a lowercase letter or underscore.");
+        expectedMessage:
+            "Function name must begin with a lowercase letter or underscore.");
   }
 
   void test_validateFunctionName_null() {
@@ -240,7 +247,8 @@
   void test_validateFunctionTypeAliasName_doesNotStartWithLowerCase() {
     assertRefactoringStatus(validateFunctionTypeAliasName("newName"),
         RefactoringProblemSeverity.WARNING,
-        expectedMessage: "Function type alias name should start with an uppercase letter.");
+        expectedMessage:
+            "Function type alias name should start with an uppercase letter.");
   }
 
   void test_validateFunctionTypeAliasName_empty() {
@@ -252,7 +260,8 @@
   void test_validateFunctionTypeAliasName_leadingBlanks() {
     assertRefactoringStatus(validateFunctionTypeAliasName(" NewName"),
         RefactoringProblemSeverity.FATAL,
-        expectedMessage: "Function type alias name must not start or end with a blank.");
+        expectedMessage:
+            "Function type alias name must not start or end with a blank.");
   }
 
   void test_validateFunctionTypeAliasName_notIdentifierMiddle() {
@@ -264,7 +273,8 @@
   void test_validateFunctionTypeAliasName_notIdentifierStart() {
     assertRefactoringStatus(validateFunctionTypeAliasName("-NewName"),
         RefactoringProblemSeverity.FATAL,
-        expectedMessage: "Function type alias name must begin with an uppercase letter or underscore.");
+        expectedMessage:
+            "Function type alias name must begin with an uppercase letter or underscore.");
   }
 
   void test_validateFunctionTypeAliasName_null() {
@@ -292,13 +302,15 @@
   void test_validateFunctionTypeAliasName_trailingBlanks() {
     assertRefactoringStatus(validateFunctionTypeAliasName("NewName "),
         RefactoringProblemSeverity.FATAL,
-        expectedMessage: "Function type alias name must not start or end with a blank.");
+        expectedMessage:
+            "Function type alias name must not start or end with a blank.");
   }
 
   void test_validateImportPrefixName_doesNotStartWithLowerCase() {
     assertRefactoringStatus(
         validateImportPrefixName("NewName"), RefactoringProblemSeverity.WARNING,
-        expectedMessage: "Import prefix name should start with a lowercase letter.");
+        expectedMessage:
+            "Import prefix name should start with a lowercase letter.");
   }
 
   void test_validateImportPrefixName_empty() {
@@ -308,7 +320,8 @@
   void test_validateImportPrefixName_leadingBlanks() {
     assertRefactoringStatus(
         validateImportPrefixName(" newName"), RefactoringProblemSeverity.FATAL,
-        expectedMessage: "Import prefix name must not start or end with a blank.");
+        expectedMessage:
+            "Import prefix name must not start or end with a blank.");
   }
 
   void test_validateImportPrefixName_notIdentifierMiddle() {
@@ -320,7 +333,8 @@
   void test_validateImportPrefixName_notIdentifierStart() {
     assertRefactoringStatus(
         validateImportPrefixName("2newName"), RefactoringProblemSeverity.FATAL,
-        expectedMessage: "Import prefix name must begin with a lowercase letter or underscore.");
+        expectedMessage:
+            "Import prefix name must begin with a lowercase letter or underscore.");
   }
 
   void test_validateImportPrefixName_null() {
@@ -344,7 +358,8 @@
   void test_validateImportPrefixName_trailingBlanks() {
     assertRefactoringStatus(
         validateImportPrefixName("newName "), RefactoringProblemSeverity.FATAL,
-        expectedMessage: "Import prefix name must not start or end with a blank.");
+        expectedMessage:
+            "Import prefix name must not start or end with a blank.");
   }
 
   void test_validateLabelName_doesNotStartWithLowerCase() {
@@ -374,7 +389,8 @@
   void test_validateLabelName_notIdentifierStart() {
     assertRefactoringStatus(
         validateLabelName("2newName"), RefactoringProblemSeverity.FATAL,
-        expectedMessage: "Label name must begin with a lowercase letter or underscore.");
+        expectedMessage:
+            "Label name must begin with a lowercase letter or underscore.");
   }
 
   void test_validateLabelName_null() {
@@ -420,19 +436,22 @@
         expectedMessage: "Library name identifier must not be empty.");
     assertRefactoringStatus(
         validateLibraryName("my. .name"), RefactoringProblemSeverity.FATAL,
-        expectedMessage: "Library name identifier must not start or end with a blank.");
+        expectedMessage:
+            "Library name identifier must not start or end with a blank.");
   }
 
   void test_validateLibraryName_hasUpperCase() {
     assertRefactoringStatus(
         validateLibraryName("my.newName"), RefactoringProblemSeverity.WARNING,
-        expectedMessage: "Library name should consist of lowercase identifier separated by dots.");
+        expectedMessage:
+            "Library name should consist of lowercase identifier separated by dots.");
   }
 
   void test_validateLibraryName_leadingBlanks() {
     assertRefactoringStatus(
         validateLibraryName("my. name"), RefactoringProblemSeverity.FATAL,
-        expectedMessage: "Library name identifier must not start or end with a blank.");
+        expectedMessage:
+            "Library name identifier must not start or end with a blank.");
   }
 
   void test_validateLibraryName_notIdentifierMiddle() {
@@ -444,7 +463,8 @@
   void test_validateLibraryName_notIdentifierStart() {
     assertRefactoringStatus(
         validateLibraryName("my.2bad.name"), RefactoringProblemSeverity.FATAL,
-        expectedMessage: "Library name identifier must begin with a lowercase letter or underscore.");
+        expectedMessage:
+            "Library name identifier must begin with a lowercase letter or underscore.");
   }
 
   void test_validateLibraryName_null() {
@@ -464,7 +484,8 @@
   void test_validateLibraryName_trailingBlanks() {
     assertRefactoringStatus(
         validateLibraryName("my.bad .name"), RefactoringProblemSeverity.FATAL,
-        expectedMessage: "Library name identifier must not start or end with a blank.");
+        expectedMessage:
+            "Library name identifier must not start or end with a blank.");
   }
 
   void test_validateMethodName_doesNotStartWithLowerCase() {
@@ -500,7 +521,8 @@
   void test_validateMethodName_notIdentifierStart() {
     assertRefactoringStatus(
         validateMethodName("2newName"), RefactoringProblemSeverity.FATAL,
-        expectedMessage: "Method name must begin with a lowercase letter or underscore.");
+        expectedMessage:
+            "Method name must begin with a lowercase letter or underscore.");
   }
 
   void test_validateMethodName_null() {
@@ -530,7 +552,8 @@
   void test_validateParameterName_doesNotStartWithLowerCase() {
     assertRefactoringStatus(
         validateParameterName("NewName"), RefactoringProblemSeverity.WARNING,
-        expectedMessage: "Parameter name should start with a lowercase letter.");
+        expectedMessage:
+            "Parameter name should start with a lowercase letter.");
   }
 
   void test_validateParameterName_empty() {
@@ -554,7 +577,8 @@
   void test_validateParameterName_notIdentifierStart() {
     assertRefactoringStatus(
         validateParameterName("2newName"), RefactoringProblemSeverity.FATAL,
-        expectedMessage: "Parameter name must begin with a lowercase letter or underscore.");
+        expectedMessage:
+            "Parameter name must begin with a lowercase letter or underscore.");
   }
 
   void test_validateParameterName_null() {
@@ -608,7 +632,8 @@
   void test_validateVariableName_notIdentifierStart() {
     assertRefactoringStatus(
         validateVariableName("2newName"), RefactoringProblemSeverity.FATAL,
-        expectedMessage: "Variable name must begin with a lowercase letter or underscore.");
+        expectedMessage:
+            "Variable name must begin with a lowercase letter or underscore.");
   }
 
   void test_validateVariableName_null() {
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 e88f489..43a0a35 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
@@ -4,20 +4,75 @@
 
 library test.services.refactoring.rename_class_member;
 
-import 'package:analysis_server/src/protocol.dart';
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/services/correction/status.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 import 'package:unittest/unittest.dart';
 
+import '../../utils.dart';
 import 'abstract_rename.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(RenameClassMemberTest);
 }
 
 @reflectiveTest
 class RenameClassMemberTest extends RenameRefactoringTest {
+  test_checkFinalConditions_classNameConflict_sameClass() async {
+    indexTestUnit('''
+class NewName {
+  void test() {}
+}
+''');
+    createRenameRefactoringAtString('test() {}');
+    // check status
+    refactoring.newName = 'NewName';
+    RefactoringStatus status = await refactoring.checkFinalConditions();
+    assertRefactoringStatus(status, RefactoringProblemSeverity.ERROR,
+        expectedMessage:
+            "Renamed method has the same name as the declaring class 'NewName'.",
+        expectedContextSearch: 'test() {}');
+  }
+
+  test_checkFinalConditions_classNameConflict_subClass() async {
+    indexTestUnit('''
+class A {
+  void test() {} // 1
+}
+class NewName extends A {
+  void test() {} // 2
+}
+''');
+    createRenameRefactoringAtString('test() {} // 1');
+    // check status
+    refactoring.newName = 'NewName';
+    RefactoringStatus status = await refactoring.checkFinalConditions();
+    assertRefactoringStatus(status, RefactoringProblemSeverity.ERROR,
+        expectedMessage:
+            "Renamed method has the same name as the declaring class 'NewName'.",
+        expectedContextSearch: 'test() {} // 2');
+  }
+
+  test_checkFinalConditions_classNameConflict_superClass() async {
+    indexTestUnit('''
+class NewName {
+  void test() {} // 1
+}
+class B extends NewName {
+  void test() {} // 2
+}
+''');
+    createRenameRefactoringAtString('test() {} // 2');
+    // check status
+    refactoring.newName = 'NewName';
+    RefactoringStatus status = await refactoring.checkFinalConditions();
+    assertRefactoringStatus(status, RefactoringProblemSeverity.ERROR,
+        expectedMessage:
+            "Renamed method has the same name as the declaring class 'NewName'.",
+        expectedContextSearch: 'test() {} // 1');
+  }
+
   test_checkFinalConditions_hasMember_MethodElement() async {
     indexTestUnit('''
 class A {
@@ -30,7 +85,8 @@
     refactoring.newName = 'newName';
     RefactoringStatus status = await refactoring.checkFinalConditions();
     assertRefactoringStatus(status, RefactoringProblemSeverity.ERROR,
-        expectedMessage: "Class 'A' already declares method with name 'newName'.",
+        expectedMessage:
+            "Class 'A' already declares method with name 'newName'.",
         expectedContextSearch: 'newName() {} // existing');
   }
 
@@ -61,7 +117,9 @@
   test() {}
 }
 ''');
-    indexUnit('/lib.dart', '''
+    indexUnit(
+        '/lib.dart',
+        '''
 library my.lib;
 import 'test.dart';
 
@@ -92,7 +150,8 @@
     refactoring.newName = 'newName';
     RefactoringStatus status = await refactoring.checkFinalConditions();
     assertRefactoringStatus(status, RefactoringProblemSeverity.ERROR,
-        expectedMessage: "Usage of renamed method will be shadowed by local variable 'newName'.",
+        expectedMessage:
+            "Usage of renamed method will be shadowed by local variable 'newName'.",
         expectedContextSearch: 'test(); // marker');
   }
 
@@ -113,7 +172,8 @@
     refactoring.newName = 'newName';
     RefactoringStatus status = await refactoring.checkFinalConditions();
     assertRefactoringStatus(status, RefactoringProblemSeverity.ERROR,
-        expectedMessage: "Usage of renamed method will be shadowed by local variable 'newName'.",
+        expectedMessage:
+            "Usage of renamed method will be shadowed by local variable 'newName'.",
         expectedContextSearch: 'test(); // marker');
   }
 
@@ -164,7 +224,8 @@
     refactoring.newName = 'newName';
     RefactoringStatus status = await refactoring.checkFinalConditions();
     assertRefactoringStatus(status, RefactoringProblemSeverity.ERROR,
-        expectedMessage: "Usage of renamed method will be shadowed by parameter 'newName'.",
+        expectedMessage:
+            "Usage of renamed method will be shadowed by parameter 'newName'.",
         expectedContextSearch: 'test(); // marker');
   }
 
@@ -229,10 +290,26 @@
     refactoring.newName = 'newName';
     RefactoringStatus status = await refactoring.checkFinalConditions();
     assertRefactoringStatus(status, RefactoringProblemSeverity.ERROR,
-        expectedMessage: "Renamed method will be shadowed by method 'B.newName'.",
+        expectedMessage:
+            "Renamed method will be shadowed by method 'B.newName'.",
         expectedContextSearch: 'newName() {} // marker');
   }
 
+  test_checkInitialConditions_inSDK() async {
+    indexTestUnit('''
+main() {
+  'abc'.toUpperCase();
+}
+''');
+    createRenameRefactoringAtString('toUpperCase()');
+    // check status
+    refactoring.newName = 'NewName';
+    RefactoringStatus status = await refactoring.checkInitialConditions();
+    assertRefactoringStatus(status, RefactoringProblemSeverity.FATAL,
+        expectedMessage:
+            "The method 'String.toUpperCase' is defined in the SDK, so cannot be renamed.");
+  }
+
   test_checkInitialConditions_operator() async {
     indexTestUnit('''
 class A {
@@ -284,7 +361,8 @@
     refactoring.newName = 'test';
     assertRefactoringStatus(
         refactoring.checkNewName(), RefactoringProblemSeverity.FATAL,
-        expectedMessage: "The new name must be different than the current name.");
+        expectedMessage:
+            "The new name must be different than the current name.");
     // OK
     refactoring.newName = 'newName';
     assertRefactoringStatusOK(refactoring.checkNewName());
@@ -558,8 +636,47 @@
     assertPotentialEdits(['test(); // 1', 'test(); // 2']);
   }
 
+  test_createChange_MethodElement_potential_inPubCache() async {
+    String pkgLib = '/.pub-cache/lib.dart';
+    indexUnit(
+        pkgLib,
+        r'''
+processObj(p) {
+  p.test();
+}
+''');
+    indexTestUnit('''
+import '$pkgLib';
+class A {
+  test() {}
+}
+main(var a) {
+  a.test();
+}
+''');
+    // configure refactoring
+    createRenameRefactoringAtString('test() {}');
+    expect(refactoring.refactoringName, 'Rename Method');
+    expect(refactoring.oldName, 'test');
+    refactoring.newName = 'newName';
+    // validate change
+    await assertSuccessfulRefactoring('''
+import '/.pub-cache/lib.dart';
+class A {
+  newName() {}
+}
+main(var a) {
+  a.newName();
+}
+''');
+    SourceFileEdit fileEdit = refactoringChange.getFileEdit(pkgLib);
+    expect(fileEdit, isNull);
+  }
+
   test_createChange_MethodElement_potential_private_otherLibrary() async {
-    indexUnit('/lib.dart', '''
+    indexUnit(
+        '/lib.dart',
+        '''
 library lib;
 main(p) {
   p._test();
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 04ec5dc..9b6d46e 100644
--- a/pkg/analysis_server/test/services/refactoring/rename_constructor_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/rename_constructor_test.dart
@@ -4,17 +4,19 @@
 
 library test.services.refactoring.rename_constructor;
 
-import 'package:analysis_server/src/protocol.dart';
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/services/correction/status.dart';
+import 'package:analysis_server/src/services/refactoring/refactoring.dart';
 import 'package:analyzer/src/generated/ast.dart';
 import 'package:analyzer/src/generated/element.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 import 'package:unittest/unittest.dart';
 
+import '../../utils.dart';
 import 'abstract_rename.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(RenameConstructorTest);
 }
 
@@ -32,7 +34,8 @@
     refactoring.newName = 'newName';
     RefactoringStatus status = await refactoring.checkFinalConditions();
     assertRefactoringStatus(status, RefactoringProblemSeverity.ERROR,
-        expectedMessage: "Class 'A' already declares constructor with name 'newName'.",
+        expectedMessage:
+            "Class 'A' already declares constructor with name 'newName'.",
         expectedContextSearch: 'newName() {} // existing');
   }
 
@@ -48,10 +51,26 @@
     refactoring.newName = 'newName';
     RefactoringStatus status = await refactoring.checkFinalConditions();
     assertRefactoringStatus(status, RefactoringProblemSeverity.ERROR,
-        expectedMessage: "Class 'A' already declares method with name 'newName'.",
+        expectedMessage:
+            "Class 'A' already declares method with name 'newName'.",
         expectedContextSearch: 'newName() {} // existing');
   }
 
+  test_checkInitialConditions_inSDK() async {
+    indexTestUnit('''
+main() {
+  new String.fromCharCodes([]);
+}
+''');
+    createRenameRefactoringAtString('fromCharCodes(');
+    // check status
+    refactoring.newName = 'newName';
+    RefactoringStatus status = await refactoring.checkInitialConditions();
+    assertRefactoringStatus(status, RefactoringProblemSeverity.FATAL,
+        expectedMessage:
+            "The constructor 'String.fromCharCodes' is defined in the SDK, so cannot be renamed.");
+  }
+
   test_checkNewName() {
     indexTestUnit('''
 class A {
@@ -69,7 +88,8 @@
     refactoring.newName = 'test';
     assertRefactoringStatus(
         refactoring.checkNewName(), RefactoringProblemSeverity.FATAL,
-        expectedMessage: "The new name must be different than the current name.");
+        expectedMessage:
+            "The new name must be different than the current name.");
     // empty
     refactoring.newName = '';
     assertRefactoringStatusOK(refactoring.checkNewName());
@@ -180,6 +200,11 @@
 ''');
   }
 
+  void test_newInstance_nullElement() {
+    RenameRefactoring refactoring = new RenameRefactoring(searchEngine, null);
+    expect(refactoring, isNull);
+  }
+
   void _createConstructorDeclarationRefactoring(String search) {
     ConstructorElement element = findNodeElementAtString(
         search, (node) => node is ConstructorDeclaration);
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 806eda4..538baaf 100644
--- a/pkg/analysis_server/test/services/refactoring/rename_import_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/rename_import_test.dart
@@ -4,15 +4,16 @@
 
 library test.services.refactoring.rename_import;
 
-import 'package:analysis_server/src/protocol.dart';
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analyzer/src/generated/ast.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 import 'package:unittest/unittest.dart';
 
+import '../../utils.dart';
 import 'abstract_rename.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(RenameImportTest);
 }
 
@@ -31,7 +32,8 @@
     refactoring.newName = 'test';
     assertRefactoringStatus(
         refactoring.checkNewName(), RefactoringProblemSeverity.FATAL,
-        expectedMessage: "The new name must be different than the current name.");
+        expectedMessage:
+            "The new name must be different than the current name.");
     // empty
     refactoring.newName = '';
     assertRefactoringStatusOK(refactoring.checkNewName());
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 dadf102..613a0d6 100644
--- a/pkg/analysis_server/test/services/refactoring/rename_label_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/rename_label_test.dart
@@ -4,14 +4,15 @@
 
 library test.services.refactoring.rename_label;
 
-import 'package:analysis_server/src/protocol.dart';
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 import 'package:unittest/unittest.dart';
 
+import '../../utils.dart';
 import 'abstract_rename.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(RenameLabelTest);
 }
 
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 098ff7d..9a8f259 100644
--- a/pkg/analysis_server/test/services/refactoring/rename_library_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/rename_library_test.dart
@@ -4,15 +4,16 @@
 
 library test.services.refactoring.rename_library;
 
-import 'package:analysis_server/src/protocol.dart';
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analyzer/src/generated/source.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 import 'package:unittest/unittest.dart';
 
+import '../../utils.dart';
 import 'abstract_rename.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(RenameLibraryTest);
 }
 
@@ -37,18 +38,21 @@
     refactoring.newName = 'my.app';
     assertRefactoringStatus(
         refactoring.checkNewName(), RefactoringProblemSeverity.FATAL,
-        expectedMessage: "The new name must be different than the current name.");
+        expectedMessage:
+            "The new name must be different than the current name.");
   }
 
   test_createChange() async {
-    Source unitSource = addSource('/part.dart', '''
+    Source unitSource = addSource(
+        '/part.dart',
+        '''
 part of my.app;
 ''');
     indexTestUnit('''
 library my.app;
 part 'part.dart';
 ''');
-    index.indexUnit(
+    index.index(
         context, context.resolveCompilationUnit2(unitSource, testSource));
     // configure refactoring
     _createRenameRefactoring();
@@ -60,7 +64,38 @@
 library the.new.name;
 part 'part.dart';
 ''');
-    assertFileChangeResult('/part.dart', '''
+    assertFileChangeResult(
+        '/part.dart',
+        '''
+part of the.new.name;
+''');
+  }
+
+  test_createChange_hasWhitespaces() async {
+    Source unitSource = addSource(
+        '/part.dart',
+        '''
+part of my .  app;
+''');
+    indexTestUnit('''
+library my    . app;
+part 'part.dart';
+''');
+    index.index(
+        context, context.resolveCompilationUnit2(unitSource, testSource));
+    // configure refactoring
+    _createRenameRefactoring();
+    expect(refactoring.refactoringName, 'Rename Library');
+    expect(refactoring.elementKindName, 'library');
+    refactoring.newName = 'the.new.name';
+    // validate change
+    await assertSuccessfulRefactoring('''
+library the.new.name;
+part 'part.dart';
+''');
+    assertFileChangeResult(
+        '/part.dart',
+        '''
 part of the.new.name;
 ''');
   }
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 81bc8b8..a92bd0d 100644
--- a/pkg/analysis_server/test/services/refactoring/rename_local_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/rename_local_test.dart
@@ -4,15 +4,16 @@
 
 library test.services.refactoring.rename_local;
 
-import 'package:analysis_server/src/protocol.dart';
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/services/correction/status.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 import 'package:unittest/unittest.dart';
 
+import '../../utils.dart';
 import 'abstract_rename.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(RenameLocalTest);
 }
 
@@ -131,7 +132,7 @@
     RefactoringStatus status = await refactoring.checkFinalConditions();
     assertRefactoringStatus(status, RefactoringProblemSeverity.ERROR,
         expectedMessage: 'Usage of field "A.newName" declared in "test.dart" '
-        'will be shadowed by renamed local variable.',
+            'will be shadowed by renamed local variable.',
         expectedContextSearch: 'newName);');
   }
 
@@ -154,7 +155,7 @@
     RefactoringStatus status = await refactoring.checkFinalConditions();
     assertRefactoringStatus(status, RefactoringProblemSeverity.ERROR,
         expectedMessage: 'Usage of field "B.newName" declared in "test.dart" '
-        'will be shadowed by renamed parameter.',
+            'will be shadowed by renamed parameter.',
         expectedContextSearch: 'newName);');
   }
 
@@ -422,7 +423,9 @@
   A({test});
 }
 ''');
-    indexUnit('/test2.dart', '''
+    indexUnit(
+        '/test2.dart',
+        '''
 import 'test.dart';
 main() {
   new A(test: 2);
@@ -438,7 +441,9 @@
   A({newName});
 }
 ''');
-    assertFileChangeResult('/test2.dart', '''
+    assertFileChangeResult(
+        '/test2.dart',
+        '''
 import 'test.dart';
 main() {
   new A(newName: 2);
@@ -447,7 +452,9 @@
   }
 
   test_createChange_parameter_named_updateHierarchy() async {
-    indexUnit('/test2.dart', '''
+    indexUnit(
+        '/test2.dart',
+        '''
 library test2;
 class A {
   void foo({int test: 1}) {
@@ -491,7 +498,9 @@
   }
 }
 ''');
-    assertFileChangeResult('/test2.dart', '''
+    assertFileChangeResult(
+        '/test2.dart',
+        '''
 library test2;
 class A {
   void foo({int newName: 1}) {
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 229d1be..78a5cd4 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
@@ -4,15 +4,16 @@
 
 library test.services.refactoring.rename_unit_member;
 
-import 'package:analysis_server/src/protocol.dart';
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/services/correction/status.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 import 'package:unittest/unittest.dart';
 
+import '../../utils.dart';
 import 'abstract_rename.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(RenameUnitMemberTest);
 }
 
@@ -42,7 +43,8 @@
     refactoring.newName = 'NewName';
     RefactoringStatus status = await refactoring.checkFinalConditions();
     assertRefactoringStatus(status, RefactoringProblemSeverity.ERROR,
-        expectedMessage: "Library already declares function type alias with name 'NewName'.",
+        expectedMessage:
+            "Library already declares function type alias with name 'NewName'.",
         expectedContextSearch: 'NewName(); // existing');
   }
 
@@ -69,7 +71,9 @@
     indexTestUnit('''
 class Test {}
 ''');
-    indexUnit('/lib.dart', '''
+    indexUnit(
+        '/lib.dart',
+        '''
 library my.lib;
 import 'test.dart';
 
@@ -100,7 +104,8 @@
     refactoring.newName = 'NewName';
     RefactoringStatus status = await refactoring.checkFinalConditions();
     assertRefactoringStatus(status, RefactoringProblemSeverity.ERROR,
-        expectedMessage: "Reference to renamed class will be shadowed by method 'A.NewName'.",
+        expectedMessage:
+            "Reference to renamed class will be shadowed by method 'A.NewName'.",
         expectedContextSearch: 'NewName() {}');
   }
 
@@ -108,7 +113,9 @@
     indexTestUnit('''
 class Test {}
 ''');
-    indexUnit('/lib.dart', '''
+    indexUnit(
+        '/lib.dart',
+        '''
 library my.lib;
 import 'test.dart';
 class A {
@@ -132,7 +139,9 @@
     indexTestUnit('''
 class Test {}
 ''');
-    indexUnit('/lib.dart', '''
+    indexUnit(
+        '/lib.dart',
+        '''
 library my.lib;
 import 'test.dart' hide Test;
 class A {
@@ -173,7 +182,9 @@
   }
 
   test_checkFinalConditions_shadowsInSubClass_notImportedLib() async {
-    indexUnit('/lib.dart', '''
+    indexUnit(
+        '/lib.dart',
+        '''
 library my.lib;
 class A {
   NewName() {}
@@ -213,6 +224,63 @@
     assertRefactoringStatusOK(status);
   }
 
+  test_checkInitialConditions_inPubCache_posix() async {
+    addSource(
+        '/.pub-cache/lib.dart',
+        r'''
+class A {}
+''');
+    indexTestUnit('''
+import '/.pub-cache/lib.dart';
+main() {
+  A a;
+}
+''');
+    createRenameRefactoringAtString('A a');
+    // check status
+    refactoring.newName = 'NewName';
+    RefactoringStatus status = await refactoring.checkInitialConditions();
+    assertRefactoringStatus(status, RefactoringProblemSeverity.FATAL,
+        expectedMessage:
+            "The class 'A' is defined in a pub package, so cannot be renamed.");
+  }
+
+  test_checkInitialConditions_inPubCache_windows() async {
+    addSource(
+        '/Pub/Cache/lib.dart',
+        r'''
+class A {}
+''');
+    indexTestUnit('''
+import '/Pub/Cache/lib.dart';
+main() {
+  A a;
+}
+''');
+    createRenameRefactoringAtString('A a');
+    // check status
+    refactoring.newName = 'NewName';
+    RefactoringStatus status = await refactoring.checkInitialConditions();
+    assertRefactoringStatus(status, RefactoringProblemSeverity.FATAL,
+        expectedMessage:
+            "The class 'A' is defined in a pub package, so cannot be renamed.");
+  }
+
+  test_checkInitialConditions_inSDK() async {
+    indexTestUnit('''
+main() {
+  String s;
+}
+''');
+    createRenameRefactoringAtString('String s');
+    // check status
+    refactoring.newName = 'NewName';
+    RefactoringStatus status = await refactoring.checkInitialConditions();
+    assertRefactoringStatus(status, RefactoringProblemSeverity.FATAL,
+        expectedMessage:
+            "The class 'String' is defined in the SDK, so cannot be renamed.");
+  }
+
   test_checkNewName_ClassElement() {
     indexTestUnit('''
 class Test {}
@@ -232,7 +300,8 @@
     refactoring.newName = 'Test';
     assertRefactoringStatus(
         refactoring.checkNewName(), RefactoringProblemSeverity.FATAL,
-        expectedMessage: "The new name must be different than the current name.");
+        expectedMessage:
+            "The new name must be different than the current name.");
     // OK
     refactoring.newName = 'NewName';
     assertRefactoringStatusOK(refactoring.checkNewName());
@@ -331,6 +400,31 @@
 ''');
   }
 
+  test_createChange_ClassElement_invocation() {
+    verifyNoTestUnitErrors = false;
+    indexTestUnit('''
+class Test {
+}
+main() {
+  Test(); // invalid code, but still a reference
+}
+''');
+    // configure refactoring
+    createRenameRefactoringAtString('Test();');
+    expect(refactoring.refactoringName, 'Rename Class');
+    expect(refactoring.elementKindName, 'class');
+    expect(refactoring.oldName, 'Test');
+    refactoring.newName = 'NewName';
+    // validate change
+    return assertSuccessfulRefactoring('''
+class NewName {
+}
+main() {
+  NewName(); // invalid code, but still a reference
+}
+''');
+  }
+
   test_createChange_ClassElement_parameterTypeNested() {
     indexTestUnit('''
 class Test {
diff --git a/pkg/analysis_server/test/services/refactoring/test_all.dart b/pkg/analysis_server/test/services/refactoring/test_all.dart
index e80b9a7..1dcb857 100644
--- a/pkg/analysis_server/test/services/refactoring/test_all.dart
+++ b/pkg/analysis_server/test/services/refactoring/test_all.dart
@@ -6,6 +6,7 @@
 
 import 'package:unittest/unittest.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;
@@ -24,7 +25,7 @@
 
 /// Utility for manually running all tests.
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   group('refactoring', () {
     convert_getter_to_method_test.main();
     convert_method_to_getter_test.main();
diff --git a/pkg/analysis_server/test/services/search/hierarchy_test.dart b/pkg/analysis_server/test/services/search/hierarchy_test.dart
index 8bb1c61..720dc9a 100644
--- a/pkg/analysis_server/test/services/search/hierarchy_test.dart
+++ b/pkg/analysis_server/test/services/search/hierarchy_test.dart
@@ -15,9 +15,10 @@
 import 'package:unittest/unittest.dart';
 
 import '../../abstract_single_unit.dart';
+import '../../utils.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(HierarchyTest);
 }
 
@@ -222,8 +223,10 @@
     {
       ClassElement classB = findElement('B');
       List<Element> members = getMembers(classB);
-      expect(members.map((e) => e.name), unorderedEquals(
-          ['mb1', 'mb2', 'ma1', 'ma2', '==', 'toString', 'hashCode']));
+      expect(
+          members.map((e) => e.name),
+          unorderedEquals(
+              ['mb1', 'mb2', 'ma1', 'ma2', '==', 'toString', 'hashCode']));
     }
   }
 
@@ -313,6 +316,6 @@
 
   void _indexTestUnit(String code) {
     resolveTestUnit(code);
-    index.indexUnit(context, testUnit);
+    index.index(context, testUnit);
   }
 }
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 7eaf70b..1453d46 100644
--- a/pkg/analysis_server/test/services/search/search_engine_test.dart
+++ b/pkg/analysis_server/test/services/search/search_engine_test.dart
@@ -17,9 +17,10 @@
 import 'package:unittest/unittest.dart';
 
 import '../../abstract_single_unit.dart';
+import '../../utils.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(SearchEngineImplTest);
 }
 
@@ -76,6 +77,27 @@
     searchEngine = new SearchEngineImpl(index);
   }
 
+  Future test_searchAllSubtypes() {
+    _indexTestUnit('''
+class T {}
+class A extends T {}
+class B extends A {}
+class C implements B {}
+''');
+    ClassElement element = findElement('T');
+    ClassElement elementA = findElement('A');
+    ClassElement elementB = findElement('B');
+    ClassElement elementC = findElement('C');
+    var expected = [
+      _expectId(elementA, MatchKind.DECLARATION, 'A extends T'),
+      _expectId(elementB, MatchKind.DECLARATION, 'B extends A'),
+      _expectId(elementC, MatchKind.DECLARATION, 'C implements B')
+    ];
+    return searchEngine.searchAllSubtypes(element).then((matches) {
+      _assertMatches(matches, expected);
+    });
+  }
+
   Future test_searchElementDeclarations() {
     _indexTestUnit('''
 class A {
@@ -185,7 +207,9 @@
   }
 
   Future test_searchReferences_CompilationUnitElement() {
-    addSource('/my_part.dart', '''
+    addSource(
+        '/my_part.dart',
+        '''
 part of lib;
 ''');
     _indexTestUnit('''
@@ -211,8 +235,9 @@
 ''');
     ConstructorElement element = findElement('named');
     Element mainElement = findElement('main');
-    var expected =
-        [_expectId(mainElement, MatchKind.REFERENCE, '.named();', length: 6)];
+    var expected = [
+      _expectId(mainElement, MatchKind.REFERENCE, '.named();', length: 6)
+    ];
     return _verifyReferences(element, expected);
   }
 
@@ -313,8 +338,9 @@
     ImportElement element = testLibraryElement.imports[0];
     Element mainElement = findElement('main');
     var kind = MatchKind.REFERENCE;
-    var expected =
-        [_expectId(mainElement, kind, 'math.PI);', length: 'math.'.length)];
+    var expected = [
+      _expectId(mainElement, kind, 'math.PI);', length: 'math.'.length)
+    ];
     return _verifyReferences(element, expected);
   }
 
@@ -352,8 +378,8 @@
     LibraryElement element = testLibraryElement;
     CompilationUnitElement elementA = element.parts[0];
     CompilationUnitElement elementB = element.parts[1];
-    index.indexUnit(context, elementA.computeNode());
-    index.indexUnit(context, elementB.computeNode());
+    index.index(context, elementA.computeNode());
+    index.index(context, elementB.computeNode());
     var expected = [
       new ExpectedMatch(elementA, MatchKind.REFERENCE,
           codeA.indexOf('lib; // A'), 'lib'.length),
@@ -418,8 +444,9 @@
 ''');
     MethodMember method = findNodeElementAtString('m(); // ref');
     Element mainElement = findElement('main');
-    var expected =
-        [_expectIdQ(mainElement, MatchKind.INVOCATION, 'm(); // ref')];
+    var expected = [
+      _expectIdQ(mainElement, MatchKind.INVOCATION, 'm(); // ref')
+    ];
     return _verifyReferences(method, expected);
   }
 
@@ -505,7 +532,9 @@
   }
 
   Future test_searchReferences_TopLevelVariableElement() {
-    addSource('/lib.dart', '''
+    addSource(
+        '/lib.dart',
+        '''
 library lib;
 var V;
 ''');
@@ -620,7 +649,7 @@
 
   void _indexTestUnit(String code) {
     resolveTestUnit(code);
-    index.indexUnit(context, testUnit);
+    index.index(context, testUnit);
   }
 
   Future _verifyReferences(
diff --git a/pkg/analysis_server/test/services/search/test_all.dart b/pkg/analysis_server/test/services/search/test_all.dart
index 4f17bd7..187d3f3 100644
--- a/pkg/analysis_server/test/services/search/test_all.dart
+++ b/pkg/analysis_server/test/services/search/test_all.dart
@@ -6,6 +6,7 @@
 
 import 'package:unittest/unittest.dart';
 
+import '../../utils.dart';
 import 'hierarchy_test.dart' as hierarchy_test;
 import 'search_engine_test.dart' as search_engine_test;
 
@@ -13,7 +14,7 @@
  * Utility for manually running all tests.
  */
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   group('search', () {
     hierarchy_test.main();
     search_engine_test.main();
diff --git a/pkg/analysis_server/test/services/test_all.dart b/pkg/analysis_server/test/services/test_all.dart
index 8ccc397..e0c2086 100644
--- a/pkg/analysis_server/test/services/test_all.dart
+++ b/pkg/analysis_server/test/services/test_all.dart
@@ -4,22 +4,23 @@
 
 library test.services;
 
-import 'package:unittest/unittest.dart';
-
+import '../utils.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;
 import 'index/test_all.dart' as index_all;
+import 'linter/linter_test.dart' as linter_all;
 import 'refactoring/test_all.dart' as refactoring_all;
 import 'search/test_all.dart' as search_all;
 
 /// Utility for manually running all tests.
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   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/socket_server_test.dart b/pkg/analysis_server/test/socket_server_test.dart
index ba79457..2190ee1 100644
--- a/pkg/analysis_server/test/socket_server_test.dart
+++ b/pkg/analysis_server/test/socket_server_test.dart
@@ -6,10 +6,10 @@
 
 import 'dart:async';
 
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/analysis_server.dart';
 import 'package:analysis_server/src/constants.dart';
 import 'package:analysis_server/src/plugin/server_plugin.dart';
-import 'package:analysis_server/src/protocol.dart';
 import 'package:analysis_server/src/socket_server.dart';
 import 'package:analyzer/instrumentation/instrumentation.dart';
 import 'package:analyzer/src/generated/sdk_io.dart';
@@ -17,8 +17,10 @@
 import 'package:unittest/unittest.dart';
 
 import 'mocks.dart';
+import 'utils.dart';
 
 main() {
+  initializeTestEnvironment();
   group('SocketServer', () {
     test('createAnalysisServer_successful',
         SocketServerTest.createAnalysisServer_successful);
@@ -109,9 +111,12 @@
     ServerPlugin serverPlugin = new ServerPlugin();
     ExtensionManager manager = new ExtensionManager();
     manager.processPlugins([serverPlugin]);
-    return new SocketServer(new AnalysisServerOptions(),
-        DirectoryBasedDartSdk.defaultSdk, InstrumentationService.NULL_SERVICE,
-        serverPlugin, null, null);
+    return new SocketServer(
+        new AnalysisServerOptions(),
+        DirectoryBasedDartSdk.defaultSdk,
+        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 aaf8a0f..2c1d252 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
@@ -16,8 +16,10 @@
 import 'package:analyzer/src/generated/sdk_io.dart';
 import 'package:unittest/unittest.dart';
 
+import '../utils.dart';
+
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
 
   group('CachingPubPackageMapProvider', () {
     MemoryResourceProvider resProvider;
@@ -29,7 +31,9 @@
       'input_files': ['/tmp/proj1/pubspec.yaml']
     };
 
-    Map result1error = {'input_files': ['/tmp/proj1/pubspec.lock']};
+    Map result1error = {
+      'input_files': ['/tmp/proj1/pubspec.lock']
+    };
 
     Map result2 = {
       'packages': {'bar': '/tmp/proj2/packages/bar'},
@@ -66,8 +70,10 @@
     }
 
     CachingPubPackageMapProvider newPkgProvider() {
-      return new CachingPubPackageMapProvider(resProvider,
-          DirectoryBasedDartSdk.defaultSdk, mockRunner.runPubList,
+      return new CachingPubPackageMapProvider(
+          resProvider,
+          DirectoryBasedDartSdk.defaultSdk,
+          mockRunner.runPubList,
           mockWriteFile);
     }
 
@@ -79,7 +85,6 @@
     });
 
     group('computePackageMap', () {
-
       // Assert pub list called once and results are cached in memory
       test('cache memory', () {
         expect(mockRunner.runCount, 0);
diff --git a/pkg/analysis_server/test/source/test_all.dart b/pkg/analysis_server/test/source/test_all.dart
index 3a3e709..1389dd3 100644
--- a/pkg/analysis_server/test/source/test_all.dart
+++ b/pkg/analysis_server/test/source/test_all.dart
@@ -4,11 +4,11 @@
 
 library test.source;
 
+import '../utils.dart';
 import 'caching_put_package_map_provider_test.dart' as caching_provider_test;
-import 'package:unittest/unittest.dart';
 
 /// Utility for manually running all tests.
 main() {
-  groupSep = ' | ';
+  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 d5f5729..a3642f6 100644
--- a/pkg/analysis_server/test/src/test_all.dart
+++ b/pkg/analysis_server/test/src/test_all.dart
@@ -6,13 +6,14 @@
 
 import 'package:unittest/unittest.dart';
 
+import '../utils.dart';
 import 'utilities/test_all.dart' as utilities_all;
 
 /**
  * Utility for manually running all tests.
  */
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   group('analysis_server', () {
     utilities_all.main();
   });
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 a378fad..43adc4e 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
@@ -4,15 +4,17 @@
 
 library analysis_server.test.src.utilities.change_builder_core_test;
 
+import 'package:analysis_server/plugin/edit/utilities/change_builder_core.dart';
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/utilities/change_builder_core.dart';
-import 'package:analysis_server/src/protocol.dart';
-import 'package:analysis_server/utilities/change_builder_core.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 import 'package:unittest/unittest.dart';
+
 import '../../domain_execution_test.dart';
+import '../../utils.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(ChangeBuilderImplTest);
   defineReflectiveTests(EditBuilderImplTest);
   defineReflectiveTests(FileEditBuilderImplTest);
@@ -25,7 +27,8 @@
     ChangeBuilderImpl builder = new ChangeBuilderImpl();
     TestSource source = new TestSource('/test.dart');
     int timeStamp = 54;
-    FileEditBuilderImpl fileEditBuilder = builder.createFileEditBuilder(source, timeStamp);
+    FileEditBuilderImpl fileEditBuilder =
+        builder.createFileEditBuilder(source, timeStamp);
     expect(fileEditBuilder, new isInstanceOf<FileEditBuilder>());
     SourceFileEdit fileEdit = fileEditBuilder.fileEdit;
     expect(fileEdit.file, source.fullName);
@@ -190,7 +193,8 @@
     expect(edit, isNotNull);
     expect(edit.offset, offset);
     expect(edit.length, length);
-    expect(edit.replacement == '$text\n' || edit.replacement == '$text\r\n', isTrue);
+    expect(edit.replacement == '$text\n' || edit.replacement == '$text\r\n',
+        isTrue);
   }
 }
 
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 513fbd8..7c6442b 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
@@ -4,18 +4,19 @@
 
 library analysis_server.test.src.utilities.change_builder_dart_test;
 
-import 'package:analysis_server/src/protocol.dart';
+import 'package:analysis_server/plugin/edit/utilities/change_builder_dart.dart';
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:analysis_server/src/utilities/change_builder_dart.dart';
-import 'package:analysis_server/utilities/change_builder_dart.dart';
 import 'package:analyzer/src/generated/ast.dart';
 import 'package:analyzer/src/generated/source.dart';
 import 'package:test_reflective_loader/test_reflective_loader.dart';
 import 'package:unittest/unittest.dart';
 
 import '../../abstract_context.dart';
+import '../../utils.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(DartChangeBuilderImplTest);
   defineReflectiveTests(DartEditBuilderImplTest);
   defineReflectiveTests(DartFileEditBuilderImplTest);
@@ -361,7 +362,8 @@
     DartChangeBuilderImpl builder = new DartChangeBuilderImpl(context);
     builder.addFileEdit(source, 1, (DartFileEditBuilderImpl builder) {
       builder.addInsertion(content.length - 1, (DartEditBuilderImpl builder) {
-        builder.writeGetterDeclaration('g', returnType: classA.element.type, returnTypeGroupName: 'returnType');
+        builder.writeGetterDeclaration('g',
+            returnType: classA.element.type, returnTypeGroupName: 'returnType');
       });
     });
     SourceEdit edit = getEdit(builder);
@@ -598,8 +600,8 @@
     LinkedEditGroup group = linkedEditGroups[0];
     List<LinkedEditSuggestion> suggestions = group.suggestions;
     expect(suggestions, hasLength(4));
-    Iterable<String> values = suggestions
-        .map((LinkedEditSuggestion suggestion) {
+    Iterable<String> values =
+        suggestions.map((LinkedEditSuggestion suggestion) {
       expect(suggestion.kind, LinkedEditSuggestionKind.TYPE);
       return suggestion.value;
     });
@@ -746,7 +748,8 @@
     builder.addFileEdit(source, 1, (DartFileEditBuilderImpl builder) {
       builder.addInsertion(content.length - 1, (DartEditBuilder builder) {
         (builder as DartEditBuilderImpl).writeTypes(
-            [classA.element.type, classB.element.type], prefix: 'implements ');
+            [classA.element.type, classB.element.type],
+            prefix: 'implements ');
       });
     });
     SourceEdit edit = getEdit(builder);
diff --git a/pkg/analysis_server/test/src/utilities/test_all.dart b/pkg/analysis_server/test/src/utilities/test_all.dart
index e2ce06e..cdb4f83 100644
--- a/pkg/analysis_server/test/src/utilities/test_all.dart
+++ b/pkg/analysis_server/test/src/utilities/test_all.dart
@@ -4,14 +4,13 @@
 
 library test.services;
 
-import 'package:unittest/unittest.dart';
-
+import '../../utils.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() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   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 a8d885d..99b76fc 100644
--- a/pkg/analysis_server/test/src/watch_manager_test.dart
+++ b/pkg/analysis_server/test/src/watch_manager_test.dart
@@ -14,9 +14,10 @@
 import 'package:watcher/watcher.dart';
 
 import '../mocks.dart';
+import '../utils.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   defineReflectiveTests(WatchManagerTest);
   defineReflectiveTests(WatchNodeTest);
 }
diff --git a/pkg/analysis_server/test/test_all.dart b/pkg/analysis_server/test/test_all.dart
index 77faa63..a89913d 100644
--- a/pkg/analysis_server/test/test_all.dart
+++ b/pkg/analysis_server/test/test_all.dart
@@ -14,20 +14,22 @@
 import 'domain_server_test.dart' as domain_server_test;
 import 'edit/test_all.dart' as edit_all;
 import 'operation/test_all.dart' as operation_test_all;
+import 'plugin/test_all.dart' as plugin_all;
 import 'protocol_server_test.dart' as protocol_server_test;
 import 'protocol_test.dart' as protocol_test;
 import 'search/test_all.dart' as search_all;
-import 'services/test_all.dart' as services_all;
 import 'server_options_test.dart' as server_options;
+import 'services/test_all.dart' as services_all;
 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() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   group('analysis_server', () {
     analysis_all.main();
     analysis_server_test.main();
@@ -39,6 +41,7 @@
     domain_server_test.main();
     edit_all.main();
     operation_test_all.main();
+    plugin_all.main();
     protocol_server_test.main();
     protocol_test.main();
     search_all.main();
diff --git a/pkg/analysis_server/test/timing/completion/completion_simple.dart b/pkg/analysis_server/test/timing/completion/completion_simple.dart
index 7f05d7b..de1d17a 100644
--- a/pkg/analysis_server/test/timing/completion/completion_simple.dart
+++ b/pkg/analysis_server/test/timing/completion/completion_simple.dart
@@ -7,7 +7,7 @@
 import 'dart:async';
 import 'dart:io';
 
-import 'package:analysis_server/src/protocol.dart';
+import 'package:analysis_server/plugin/protocol/protocol.dart';
 import 'package:path/path.dart';
 
 import '../timing_framework.dart';
diff --git a/pkg/analysis_server/test/utils.dart b/pkg/analysis_server/test/utils.dart
new file mode 100644
index 0000000..2ca53b7
--- /dev/null
+++ b/pkg/analysis_server/test/utils.dart
@@ -0,0 +1,14 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library analysis_server.test.utils;
+
+import 'package:analyzer/src/generated/java_io.dart';
+import 'package:path/path.dart' as path;
+import 'package:unittest/unittest.dart';
+
+void initializeTestEnvironment() {
+  groupSep = ' | ';
+  JavaFile.pathContext = path.posix;
+}
diff --git a/pkg/analysis_server/tool/spec/codegen_dart_protocol.dart b/pkg/analysis_server/tool/spec/codegen_dart_protocol.dart
index 755ed52..b77f4ef 100644
--- a/pkg/analysis_server/tool/spec/codegen_dart_protocol.dart
+++ b/pkg/analysis_server/tool/spec/codegen_dart_protocol.dart
@@ -35,8 +35,8 @@
   'deprecated': '0x20'
 };
 
-final GeneratedFile target = new GeneratedFile(
-    '../../lib/src/generated_protocol.dart', () {
+final GeneratedFile target =
+    new GeneratedFile('../../lib/plugin/protocol/generated_protocol.dart', () {
   CodegenProtocolVisitor visitor = new CodegenProtocolVisitor(readApi());
   return visitor.collectCode(visitor.visitApi);
 });
@@ -67,6 +67,13 @@
   };
 
   /**
+   * The disclaimer added to the documentation comment for each of the classes
+   * that are generated.
+   */
+  static const String disclaimer =
+      'Clients may not extend, implement or mix-in this class.';
+
+  /**
    * Visitor used to produce doc comments.
    */
   final ToHtmlVisitor toHtmlVisitor;
@@ -100,13 +107,13 @@
       String itemTypeName = dartType(resolvedType.itemType);
       String subComparison = compareEqualsCode(resolvedType.itemType, 'a', 'b');
       String closure = '($itemTypeName a, $itemTypeName b) => $subComparison';
-      return '_listEqual($thisVar, $otherVar, $closure)';
+      return 'listEqual($thisVar, $otherVar, $closure)';
     } else if (resolvedType is TypeMap) {
       String valueTypeName = dartType(resolvedType.valueType);
       String subComparison =
           compareEqualsCode(resolvedType.valueType, 'a', 'b');
       String closure = '($valueTypeName a, $valueTypeName b) => $subComparison';
-      return '_mapEqual($thisVar, $otherVar, $closure)';
+      return 'mapEqual($thisVar, $otherVar, $closure)';
     }
     throw new Exception(
         "Don't know how to compare for equality: $resolvedType");
@@ -121,7 +128,7 @@
       String dartTypeName = capitalize(impliedType.camelName);
       if (type == null) {
         emitEmptyObjectClass(dartTypeName, impliedType);
-      } else if (type is TypeObject || type == null) {
+      } else if (type is TypeObject) {
         writeln();
         emitObjectClass(dartTypeName, type, impliedType);
       } else if (type is TypeEnum) {
@@ -212,6 +219,9 @@
       toHtmlVisitor.p(() {
         toHtmlVisitor.write(impliedType.humanReadableName);
       });
+      toHtmlVisitor.p(() {
+        toHtmlVisitor.write(disclaimer);
+      });
     }));
     writeln('class $className {');
     indent(() {
@@ -242,6 +252,9 @@
       if (impliedType.type != null) {
         toHtmlVisitor.showType(null, impliedType.type);
       }
+      toHtmlVisitor.p(() {
+        toHtmlVisitor.write(disclaimer);
+      });
     }));
     writeln('class $className implements Enum {');
     indent(() {
@@ -366,6 +379,9 @@
       if (impliedType.type != null) {
         toHtmlVisitor.showType(null, impliedType.type);
       }
+      toHtmlVisitor.p(() {
+        toHtmlVisitor.write(disclaimer);
+      });
     }));
     write('class $className');
     if (impliedType.kind == 'refactoringFeedback') {
@@ -553,7 +569,7 @@
       writeln('factory RefactoringFeedback.fromJson(JsonDecoder jsonDecoder, '
           'String jsonPath, Object json, Map responseJson) {');
       indent(() {
-        writeln('return _refactoringFeedbackFromJson(jsonDecoder, jsonPath, '
+        writeln('return refactoringFeedbackFromJson(jsonDecoder, jsonPath, '
             'json, responseJson);');
       });
       writeln('}');
@@ -563,8 +579,8 @@
       writeln('factory RefactoringOptions.fromJson(JsonDecoder jsonDecoder, '
           'String jsonPath, Object json, RefactoringKind kind) {');
       indent(() {
-        writeln(
-            'return _refactoringOptionsFromJson(jsonDecoder, jsonPath, ' 'json, kind);');
+        writeln('return refactoringOptionsFromJson(jsonDecoder, jsonPath, '
+            'json, kind);');
       });
       writeln('}');
       return;
@@ -652,9 +668,9 @@
           } else {
             valueToCombine = '${field.name}.hashCode';
           }
-          writeln('hash = _JenkinsSmiHash.combine(hash, $valueToCombine);');
+          writeln('hash = JenkinsSmiHash.combine(hash, $valueToCombine);');
         }
-        writeln('return _JenkinsSmiHash.finish(hash);');
+        writeln('return JenkinsSmiHash.finish(hash);');
       }
     });
     writeln('}');
@@ -678,7 +694,7 @@
         ]);
         writeln(
             'static RefactoringProblemSeverity max(RefactoringProblemSeverity a, RefactoringProblemSeverity b) =>');
-        writeln('    _maxRefactoringProblemSeverity(a, b);');
+        writeln('    maxRefactoringProblemSeverity(a, b);');
         return true;
       default:
         return false;
@@ -734,7 +750,7 @@
           new dom.Text('Adds [edit] to the [FileEdit] for the given [file].')
         ]);
         writeln('void addEdit(String file, int fileStamp, SourceEdit edit) =>');
-        writeln('    _addEditToSourceChange(this, file, fileStamp, edit);');
+        writeln('    addEditToSourceChange(this, file, fileStamp, edit);');
         writeln();
         docComment([new dom.Text('Adds the given [FileEdit].')]);
         writeln('void addFileEdit(SourceFileEdit edit) {');
@@ -755,22 +771,22 @@
               'Returns the [FileEdit] for the given [file], maybe `null`.')
         ]);
         writeln('SourceFileEdit getFileEdit(String file) =>');
-        writeln('    _getChangeFileEdit(this, file);');
+        writeln('    getChangeFileEdit(this, file);');
         return true;
       case 'SourceEdit':
         docComment([
           new dom.Text(
               'Get the result of applying the edit to the given [code].')
         ]);
-        writeln('String apply(String code) => _applyEdit(code, this);');
+        writeln('String apply(String code) => applyEdit(code, this);');
         return true;
       case 'SourceFileEdit':
         docComment([new dom.Text('Adds the given [Edit] to the list.')]);
-        writeln('void add(SourceEdit edit) => _addEditForSource(this, edit);');
+        writeln('void add(SourceEdit edit) => addEditForSource(this, edit);');
         writeln();
         docComment([new dom.Text('Adds the given [Edit]s.')]);
         writeln('void addAll(Iterable<SourceEdit> edits) =>');
-        writeln('    _addAllEditsForSource(this, edits);');
+        writeln('    addAllEditsForSource(this, edits);');
         return true;
       default:
         return false;
@@ -812,7 +828,7 @@
         ]);
         writeln(
             'static String applySequence(String code, Iterable<SourceEdit> edits) =>');
-        writeln('    _applySequence(code, edits);');
+        writeln('    applySequenceOfEdits(code, edits);');
         return true;
       default:
         return false;
@@ -929,12 +945,12 @@
       } else {
         switch (type.typeName) {
           case 'String':
-            return new FromJsonFunction('jsonDecoder._decodeString');
+            return new FromJsonFunction('jsonDecoder.decodeString');
           case 'bool':
-            return new FromJsonFunction('jsonDecoder._decodeBool');
+            return new FromJsonFunction('jsonDecoder.decodeBool');
           case 'int':
           case 'long':
-            return new FromJsonFunction('jsonDecoder._decodeInt');
+            return new FromJsonFunction('jsonDecoder.decodeInt');
           case 'object':
             return new FromJsonIdentity();
           default:
@@ -950,11 +966,11 @@
       }
       FromJsonCode valueCode = fromJsonCode(type.valueType);
       if (keyCode.isIdentity && valueCode.isIdentity) {
-        return new FromJsonFunction('jsonDecoder._decodeMap');
+        return new FromJsonFunction('jsonDecoder.decodeMap');
       } else {
         return new FromJsonSnippet((String jsonPath, String json) {
           StringBuffer result = new StringBuffer();
-          result.write('jsonDecoder._decodeMap($jsonPath, $json');
+          result.write('jsonDecoder.decodeMap($jsonPath, $json');
           if (!keyCode.isIdentity) {
             result.write(', keyDecoder: ${keyCode.asClosure}');
           }
@@ -968,10 +984,10 @@
     } else if (type is TypeList) {
       FromJsonCode itemCode = fromJsonCode(type.itemType);
       if (itemCode.isIdentity) {
-        return new FromJsonFunction('jsonDecoder._decodeList');
+        return new FromJsonFunction('jsonDecoder.decodeList');
       } else {
         return new FromJsonSnippet((String jsonPath, String json) =>
-            'jsonDecoder._decodeList($jsonPath, $json, ${itemCode.asClosure})');
+            'jsonDecoder.decodeList($jsonPath, $json, ${itemCode.asClosure})');
       }
     } else if (type is TypeUnion) {
       List<String> decoders = <String>[];
@@ -994,7 +1010,7 @@
         }
       }
       return new FromJsonSnippet((String jsonPath, String json) =>
-          'jsonDecoder._decodeUnion($jsonPath, $json, ${literalString(type.field)}, {${decoders.join(', ')}})');
+          'jsonDecoder.decodeUnion($jsonPath, $json, ${literalString(type.field)}, {${decoders.join(', ')}})');
     } else {
       throw new Exception("Can't convert $type from JSON");
     }
@@ -1080,7 +1096,8 @@
   visitApi() {
     outputHeader();
     writeln();
-    writeln('part of protocol;');
+    writeln('part of analysis_server.plugin.protocol.protocol;');
+    writeln();
     emitClasses();
   }
 }
diff --git a/pkg/analysis_server/tool/spec/codegen_inttest_methods.dart b/pkg/analysis_server/tool/spec/codegen_inttest_methods.dart
index bc7bce6..bdc8910 100644
--- a/pkg/analysis_server/tool/spec/codegen_inttest_methods.dart
+++ b/pkg/analysis_server/tool/spec/codegen_inttest_methods.dart
@@ -107,7 +107,8 @@
     writeln();
     writeln("import 'dart:async';");
     writeln();
-    writeln("import 'package:analysis_server/src/protocol.dart';");
+    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();
     writeln("import 'integration_tests.dart';");
@@ -160,11 +161,9 @@
   visitNotification(Notification notification) {
     String streamName =
         camelJoin(['on', notification.domainName, notification.event]);
-    String className = camelJoin([
-      notification.domainName,
-      notification.event,
-      'params'
-    ], doCapitalize: true);
+    String className = camelJoin(
+        [notification.domainName, notification.event, 'params'],
+        doCapitalize: true);
     writeln();
     docComment(toHtmlVisitor.collectHtml(() {
       toHtmlVisitor.translateHtml(notification.html);
@@ -234,7 +233,8 @@
     writeln('$futureClass $methodName(${args.join(', ')}) {');
     indent(() {
       String requestClass = camelJoin(
-          [request.domainName, request.method, 'params'], doCapitalize: true);
+          [request.domainName, request.method, 'params'],
+          doCapitalize: true);
       String paramsVar = 'null';
       if (request.params != null) {
         paramsVar = 'params';
diff --git a/pkg/analysis_server/tool/spec/codegen_matchers.dart b/pkg/analysis_server/tool/spec/codegen_matchers.dart
index e0e6448..5786493 100644
--- a/pkg/analysis_server/tool/spec/codegen_matchers.dart
+++ b/pkg/analysis_server/tool/spec/codegen_matchers.dart
@@ -15,8 +15,8 @@
 import 'implied_types.dart';
 import 'to_html.dart';
 
-final GeneratedFile target = new GeneratedFile(
-    '../../test/integration/protocol_matchers.dart', () {
+final GeneratedFile target =
+    new GeneratedFile('../../test/integration/protocol_matchers.dart', () {
   CodegenMatchersVisitor visitor = new CodegenMatchersVisitor(readApi());
   return visitor.collectCode(visitor.visitApi);
 });
diff --git a/pkg/analysis_server/tool/spec/codegen_tools.dart b/pkg/analysis_server/tool/spec/codegen_tools.dart
index 078f809..f3fcb5d 100644
--- a/pkg/analysis_server/tool/spec/codegen_tools.dart
+++ b/pkg/analysis_server/tool/spec/codegen_tools.dart
@@ -15,7 +15,8 @@
 import 'html_tools.dart';
 import 'text_formatter.dart';
 
-final RegExp trailingWhitespaceRegExp = new RegExp(r' +$', multiLine: true);
+final RegExp trailingWhitespaceRegExp = new RegExp(r'[\n ]+$');
+final RegExp trailingSpacesInLineRegExp = new RegExp(r' +$', multiLine: true);
 
 /**
  * Join the given strings using camelCase.  If [doCapitalize] is true, the first
@@ -71,12 +72,18 @@
    * Execute [callback], collecting any code that is output using [write]
    * or [writeln], and return the result as a string.
    */
-  String collectCode(void callback()) {
+  String collectCode(void callback(), {bool removeTrailingNewLine: false}) {
     _CodeGeneratorState oldState = _state;
     try {
       _state = new _CodeGeneratorState();
       callback();
-      return _state.buffer.toString().replaceAll(trailingWhitespaceRegExp, '');
+      var text =
+          _state.buffer.toString().replaceAll(trailingSpacesInLineRegExp, '');
+      if (!removeTrailingNewLine) {
+        return text;
+      } else {
+        return text.replaceAll(trailingWhitespaceRegExp, '');
+      }
     } finally {
       _state = oldState;
     }
@@ -88,15 +95,14 @@
    * When generating java code, the output is compatible with Javadoc, which
    * understands certain HTML constructs.
    */
-  void docComment(List<dom.Node> docs) {
-    if (containsOnlyWhitespace(docs)) {
-      return;
-    }
+  void docComment(List<dom.Node> docs, {bool removeTrailingNewLine: false}) {
+    if (containsOnlyWhitespace(docs)) return;
     writeln(codeGeneratorSettings.docCommentStartMarker);
     int width = codeGeneratorSettings.commentLineLength;
     bool javadocStyle = codeGeneratorSettings.languageName == 'java';
     indentBy(codeGeneratorSettings.docCommentLineLeader, () {
-      write(nodesToText(docs, width - _state.indent.length, javadocStyle));
+      write(nodesToText(docs, width - _state.indent.length, javadocStyle,
+          removeTrailingNewLine: removeTrailingNewLine));
     });
     writeln(codeGeneratorSettings.docCommentEndMarker);
   }
@@ -105,8 +111,8 @@
    * Execute [callback], indenting any code it outputs.
    */
   void indent(void callback()) {
-    indentSpecial(codeGeneratorSettings.indent, codeGeneratorSettings.indent,
-      callback);
+    indentSpecial(
+        codeGeneratorSettings.indent, codeGeneratorSettings.indent, callback);
   }
 
   /**
@@ -151,17 +157,17 @@
       header = '''
 /*
  * Copyright (c) 2014, the Dart project authors.
- * 
+ *
  * Licensed under the Eclipse Public License v1.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.eclipse.org/legal/epl-v10.html
- * 
+ *
  * 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.
- * 
+ *
  * This file has been automatically generated.  Please do not edit it manually.
  * To regenerate the file, use the script "pkg/analysis_server/tool/spec/generate_files".
  */''';
@@ -245,10 +251,14 @@
    */
   String indent;
 
-  CodeGeneratorSettings({this.languageName: 'java',
-      this.lineCommentLineLeader: '// ', this.docCommentStartMarker: '/**',
-      this.docCommentLineLeader: ' * ', this.docCommentEndMarker: ' */',
-      this.commentLineLength: 99, this.indent: '  '});
+  CodeGeneratorSettings(
+      {this.languageName: 'java',
+      this.lineCommentLineLeader: '// ',
+      this.docCommentStartMarker: '/**',
+      this.docCommentLineLeader: ' * ',
+      this.docCommentEndMarker: ' */',
+      this.commentLineLength: 99,
+      this.indent: '  '});
 }
 
 abstract class GeneratedContent {
@@ -262,7 +272,6 @@
  * generated HTML). No other content should exist in the directory.
  */
 class GeneratedDirectory extends GeneratedContent {
-
   /**
    * The path to the directory that will have the generated content.
    */
@@ -303,8 +312,9 @@
         }
       }
       int nonHiddenFileCount = 0;
-      outputFile.listSync(recursive: false, followLinks: false).forEach(
-          (FileSystemEntity fileSystemEntity) {
+      outputFile
+          .listSync(recursive: false, followLinks: false)
+          .forEach((FileSystemEntity fileSystemEntity) {
         if (fileSystemEntity is File &&
             !basename(fileSystemEntity.path).startsWith('.')) {
           nonHiddenFileCount++;
diff --git a/pkg/analysis_server/tool/spec/from_html.dart b/pkg/analysis_server/tool/spec/from_html.dart
index 72c1ee2..1ae9425 100644
--- a/pkg/analysis_server/tool/spec/from_html.dart
+++ b/pkg/analysis_server/tool/spec/from_html.dart
@@ -37,7 +37,8 @@
   'ref',
   'code',
   'version',
-  'union'
+  'union',
+  'index'
 ];
 
 /**
@@ -73,6 +74,9 @@
     },
     'version': (dom.Element element) {
       versions.add(innerText(element));
+    },
+    'index': (dom.Element element) {
+      /* Ignore; generated dynamically. */
     }
   });
   if (versions.length != 1) {
@@ -119,6 +123,7 @@
         '$context: Expected $expectedName, found ${element.localName}');
   }
 }
+
 /**
  * Create a [Domain] object from an HTML representation such as:
  *
@@ -288,7 +293,9 @@
   File htmlFile = new File('spec_input.html');
   String htmlContents = htmlFile.readAsStringSync();
   dom.Document document = parser.parse(htmlContents);
-  return apiFromHtml(document.firstChild);
+  dom.Element htmlElement = document.children
+      .singleWhere((element) => element.localName.toLowerCase() == 'html');
+  return apiFromHtml(htmlElement);
 }
 
 void recurse(dom.Element parent, String context,
@@ -415,6 +422,7 @@
   TypeDecl type = processContentsAsType(html, context);
   return new TypeDefinition(name, type, html);
 }
+
 /**
  * Create a [TypeEnum] from an HTML description.
  */
@@ -476,8 +484,8 @@
   checkName(html, 'field', context);
   String name = html.attributes['name'];
   context = '$context.${name != null ? name : 'field'}';
-  checkAttributes(
-      html, ['name'], context, optionalAttributes: ['optional', 'value']);
+  checkAttributes(html, ['name'], context,
+      optionalAttributes: ['optional', 'value']);
   bool optional = false;
   String optionalString = html.attributes['optional'];
   if (optionalString != null) {
diff --git a/pkg/analysis_server/tool/spec/generated/java/AnalysisServer.java b/pkg/analysis_server/tool/spec/generated/java/AnalysisServer.java
index c183dac..83223c6 100644
--- a/pkg/analysis_server/tool/spec/generated/java/AnalysisServer.java
+++ b/pkg/analysis_server/tool/spec/generated/java/AnalysisServer.java
@@ -361,7 +361,7 @@
    *
    * If directives of the Dart file cannot be organized, for example because it has scan or parse
    * errors, or by other reasons, ORGANIZE_DIRECTIVES_ERROR will be generated. The message will
-   * provide datails about the reason.
+   * provide details about the reason.
    *
    * @param file The Dart file to organize directives in.
    */
@@ -518,8 +518,9 @@
    * @param file The file containing the declaration or reference to the type for which a hierarchy
    *         is being requested.
    * @param offset The offset of the name of the type within the file.
+   * @param superOnly True if the client is only requesting superclasses and interfaces hierarchy.
    */
-  public void search_getTypeHierarchy(String file, int offset, GetTypeHierarchyConsumer consumer);
+  public void search_getTypeHierarchy(String file, int offset, boolean superOnly, GetTypeHierarchyConsumer consumer);
 
   /**
    * {@code server.getVersion}
diff --git a/pkg/analysis_server/tool/spec/generated/java/types/AnalysisError.java b/pkg/analysis_server/tool/spec/generated/java/types/AnalysisError.java
index c85d882..baf27c0 100644
--- a/pkg/analysis_server/tool/spec/generated/java/types/AnalysisError.java
+++ b/pkg/analysis_server/tool/spec/generated/java/types/AnalysisError.java
@@ -72,14 +72,26 @@
   private final String correction;
 
   /**
+   * A hint to indicate to interested clients that this error has an associated fix (or fixes). The
+   * absence of this field implies there are not known to be fixes. Note that since the operation to
+   * calculate whether fixes apply needs to be performant it is possible that complicated tests will
+   * be skipped and a false negative returned. For this reason, this attribute should be treated as a
+   * "hint". Despite the possibility of false negatives, no false positives should be returned. If a
+   * client sees this flag set they can proceed with the confidence that there are in fact associated
+   * fixes.
+   */
+  private final Boolean hasFix;
+
+  /**
    * Constructor for {@link AnalysisError}.
    */
-  public AnalysisError(String severity, String type, Location location, String message, String correction) {
+  public AnalysisError(String severity, String type, Location location, String message, String correction, Boolean hasFix) {
     this.severity = severity;
     this.type = type;
     this.location = location;
     this.message = message;
     this.correction = correction;
+    this.hasFix = hasFix;
   }
 
   @Override
@@ -91,7 +103,8 @@
         ObjectUtilities.equals(other.type, type) &&
         ObjectUtilities.equals(other.location, location) &&
         ObjectUtilities.equals(other.message, message) &&
-        ObjectUtilities.equals(other.correction, correction);
+        ObjectUtilities.equals(other.correction, correction) &&
+        ObjectUtilities.equals(other.hasFix, hasFix);
     }
     return false;
   }
@@ -102,7 +115,8 @@
     Location location = Location.fromJson(jsonObject.get("location").getAsJsonObject());
     String message = jsonObject.get("message").getAsString();
     String correction = jsonObject.get("correction") == null ? null : jsonObject.get("correction").getAsString();
-    return new AnalysisError(severity, type, location, message, correction);
+    Boolean hasFix = jsonObject.get("hasFix") == null ? null : jsonObject.get("hasFix").getAsBoolean();
+    return new AnalysisError(severity, type, location, message, correction, hasFix);
   }
 
   public static List<AnalysisError> fromJsonArray(JsonArray jsonArray) {
@@ -127,6 +141,19 @@
   }
 
   /**
+   * A hint to indicate to interested clients that this error has an associated fix (or fixes). The
+   * absence of this field implies there are not known to be fixes. Note that since the operation to
+   * calculate whether fixes apply needs to be performant it is possible that complicated tests will
+   * be skipped and a false negative returned. For this reason, this attribute should be treated as a
+   * "hint". Despite the possibility of false negatives, no false positives should be returned. If a
+   * client sees this flag set they can proceed with the confidence that there are in fact associated
+   * fixes.
+   */
+  public Boolean getHasFix() {
+    return hasFix;
+  }
+
+  /**
    * The location associated with the error.
    */
   public Location getLocation() {
@@ -163,6 +190,7 @@
     builder.append(location);
     builder.append(message);
     builder.append(correction);
+    builder.append(hasFix);
     return builder.toHashCode();
   }
 
@@ -175,6 +203,9 @@
     if (correction != null) {
       jsonObject.addProperty("correction", correction);
     }
+    if (hasFix != null) {
+      jsonObject.addProperty("hasFix", hasFix);
+    }
     return jsonObject;
   }
 
@@ -191,7 +222,9 @@
     builder.append("message=");
     builder.append(message + ", ");
     builder.append("correction=");
-    builder.append(correction);
+    builder.append(correction + ", ");
+    builder.append("hasFix=");
+    builder.append(hasFix);
     builder.append("]");
     return builder.toString();
   }
diff --git a/pkg/analysis_server/tool/spec/generated/java/types/AnalysisOptions.java b/pkg/analysis_server/tool/spec/generated/java/types/AnalysisOptions.java
index fa91052..afdde92 100644
--- a/pkg/analysis_server/tool/spec/generated/java/types/AnalysisOptions.java
+++ b/pkg/analysis_server/tool/spec/generated/java/types/AnalysisOptions.java
@@ -73,6 +73,12 @@
   private final Boolean enableNullAwareOperators;
 
   /**
+   * True if the client wants to enable support for the proposed "less restricted mixins" proposal
+   * (DEP 34).
+   */
+  private final Boolean enableSuperMixins;
+
+  /**
    * True if hints that are specific to dart2js should be generated. This option is ignored if
    * generateHints is false.
    */
@@ -91,11 +97,12 @@
   /**
    * Constructor for {@link AnalysisOptions}.
    */
-  public AnalysisOptions(Boolean enableAsync, Boolean enableDeferredLoading, Boolean enableEnums, Boolean enableNullAwareOperators, Boolean generateDart2jsHints, Boolean generateHints, Boolean generateLints) {
+  public AnalysisOptions(Boolean enableAsync, Boolean enableDeferredLoading, Boolean enableEnums, Boolean enableNullAwareOperators, Boolean enableSuperMixins, Boolean generateDart2jsHints, Boolean generateHints, Boolean generateLints) {
     this.enableAsync = enableAsync;
     this.enableDeferredLoading = enableDeferredLoading;
     this.enableEnums = enableEnums;
     this.enableNullAwareOperators = enableNullAwareOperators;
+    this.enableSuperMixins = enableSuperMixins;
     this.generateDart2jsHints = generateDart2jsHints;
     this.generateHints = generateHints;
     this.generateLints = generateLints;
@@ -110,6 +117,7 @@
         ObjectUtilities.equals(other.enableDeferredLoading, enableDeferredLoading) &&
         ObjectUtilities.equals(other.enableEnums, enableEnums) &&
         ObjectUtilities.equals(other.enableNullAwareOperators, enableNullAwareOperators) &&
+        ObjectUtilities.equals(other.enableSuperMixins, enableSuperMixins) &&
         ObjectUtilities.equals(other.generateDart2jsHints, generateDart2jsHints) &&
         ObjectUtilities.equals(other.generateHints, generateHints) &&
         ObjectUtilities.equals(other.generateLints, generateLints);
@@ -122,10 +130,11 @@
     Boolean enableDeferredLoading = jsonObject.get("enableDeferredLoading") == null ? null : jsonObject.get("enableDeferredLoading").getAsBoolean();
     Boolean enableEnums = jsonObject.get("enableEnums") == null ? null : jsonObject.get("enableEnums").getAsBoolean();
     Boolean enableNullAwareOperators = jsonObject.get("enableNullAwareOperators") == null ? null : jsonObject.get("enableNullAwareOperators").getAsBoolean();
+    Boolean enableSuperMixins = jsonObject.get("enableSuperMixins") == null ? null : jsonObject.get("enableSuperMixins").getAsBoolean();
     Boolean generateDart2jsHints = jsonObject.get("generateDart2jsHints") == null ? null : jsonObject.get("generateDart2jsHints").getAsBoolean();
     Boolean generateHints = jsonObject.get("generateHints") == null ? null : jsonObject.get("generateHints").getAsBoolean();
     Boolean generateLints = jsonObject.get("generateLints") == null ? null : jsonObject.get("generateLints").getAsBoolean();
-    return new AnalysisOptions(enableAsync, enableDeferredLoading, enableEnums, enableNullAwareOperators, generateDart2jsHints, generateHints, generateLints);
+    return new AnalysisOptions(enableAsync, enableDeferredLoading, enableEnums, enableNullAwareOperators, enableSuperMixins, generateDart2jsHints, generateHints, generateLints);
   }
 
   public static List<AnalysisOptions> fromJsonArray(JsonArray jsonArray) {
@@ -177,6 +186,14 @@
   }
 
   /**
+   * True if the client wants to enable support for the proposed "less restricted mixins" proposal
+   * (DEP 34).
+   */
+  public Boolean getEnableSuperMixins() {
+    return enableSuperMixins;
+  }
+
+  /**
    * True if hints that are specific to dart2js should be generated. This option is ignored if
    * generateHints is false.
    */
@@ -205,6 +222,7 @@
     builder.append(enableDeferredLoading);
     builder.append(enableEnums);
     builder.append(enableNullAwareOperators);
+    builder.append(enableSuperMixins);
     builder.append(generateDart2jsHints);
     builder.append(generateHints);
     builder.append(generateLints);
@@ -225,6 +243,9 @@
     if (enableNullAwareOperators != null) {
       jsonObject.addProperty("enableNullAwareOperators", enableNullAwareOperators);
     }
+    if (enableSuperMixins != null) {
+      jsonObject.addProperty("enableSuperMixins", enableSuperMixins);
+    }
     if (generateDart2jsHints != null) {
       jsonObject.addProperty("generateDart2jsHints", generateDart2jsHints);
     }
@@ -249,6 +270,8 @@
     builder.append(enableEnums + ", ");
     builder.append("enableNullAwareOperators=");
     builder.append(enableNullAwareOperators + ", ");
+    builder.append("enableSuperMixins=");
+    builder.append(enableSuperMixins + ", ");
     builder.append("generateDart2jsHints=");
     builder.append(generateDart2jsHints + ", ");
     builder.append("generateHints=");
diff --git a/pkg/analysis_server/tool/spec/generated/java/types/AnalysisService.java b/pkg/analysis_server/tool/spec/generated/java/types/AnalysisService.java
index ca3b8e9..02bd9f6 100644
--- a/pkg/analysis_server/tool/spec/generated/java/types/AnalysisService.java
+++ b/pkg/analysis_server/tool/spec/generated/java/types/AnalysisService.java
@@ -28,6 +28,8 @@
 
   public static final String HIGHLIGHTS = "HIGHLIGHTS";
 
+  public static final String IMPLEMENTED = "IMPLEMENTED";
+
   /**
    * This service is not currently implemented and will become a GeneralAnalysisService in a future
    * release.
diff --git a/pkg/analysis_server/tool/spec/generated/java/types/ElementKind.java b/pkg/analysis_server/tool/spec/generated/java/types/ElementKind.java
index 7426bda..b84c921 100644
--- a/pkg/analysis_server/tool/spec/generated/java/types/ElementKind.java
+++ b/pkg/analysis_server/tool/spec/generated/java/types/ElementKind.java
@@ -37,6 +37,8 @@
 
   public static final String FIELD = "FIELD";
 
+  public static final String FILE = "FILE";
+
   public static final String FUNCTION = "FUNCTION";
 
   public static final String FUNCTION_TYPE_ALIAS = "FUNCTION_TYPE_ALIAS";
diff --git a/pkg/analysis_server/tool/spec/generated/java/types/ExtractLocalVariableFeedback.java b/pkg/analysis_server/tool/spec/generated/java/types/ExtractLocalVariableFeedback.java
index c329329..e00506d 100644
--- a/pkg/analysis_server/tool/spec/generated/java/types/ExtractLocalVariableFeedback.java
+++ b/pkg/analysis_server/tool/spec/generated/java/types/ExtractLocalVariableFeedback.java
@@ -42,6 +42,18 @@
   public static final List<ExtractLocalVariableFeedback> EMPTY_LIST = Lists.newArrayList();
 
   /**
+   * The offsets of the expressions that cover the specified selection, from the down most to the up
+   * most.
+   */
+  private final int[] coveringExpressionOffsets;
+
+  /**
+   * The lengths of the expressions that cover the specified selection, from the down most to the up
+   * most.
+   */
+  private final int[] coveringExpressionLengths;
+
+  /**
    * The proposed names for the local variable.
    */
   private final List<String> names;
@@ -61,7 +73,9 @@
   /**
    * Constructor for {@link ExtractLocalVariableFeedback}.
    */
-  public ExtractLocalVariableFeedback(List<String> names, int[] offsets, int[] lengths) {
+  public ExtractLocalVariableFeedback(int[] coveringExpressionOffsets, int[] coveringExpressionLengths, List<String> names, int[] offsets, int[] lengths) {
+    this.coveringExpressionOffsets = coveringExpressionOffsets;
+    this.coveringExpressionLengths = coveringExpressionLengths;
     this.names = names;
     this.offsets = offsets;
     this.lengths = lengths;
@@ -72,6 +86,8 @@
     if (obj instanceof ExtractLocalVariableFeedback) {
       ExtractLocalVariableFeedback other = (ExtractLocalVariableFeedback) obj;
       return
+        Arrays.equals(other.coveringExpressionOffsets, coveringExpressionOffsets) &&
+        Arrays.equals(other.coveringExpressionLengths, coveringExpressionLengths) &&
         ObjectUtilities.equals(other.names, names) &&
         Arrays.equals(other.offsets, offsets) &&
         Arrays.equals(other.lengths, lengths);
@@ -80,10 +96,12 @@
   }
 
   public static ExtractLocalVariableFeedback fromJson(JsonObject jsonObject) {
+    int[] coveringExpressionOffsets = JsonUtilities.decodeIntArray(jsonObject.get("coveringExpressionOffsets").getAsJsonArray());
+    int[] coveringExpressionLengths = JsonUtilities.decodeIntArray(jsonObject.get("coveringExpressionLengths").getAsJsonArray());
     List<String> names = JsonUtilities.decodeStringList(jsonObject.get("names").getAsJsonArray());
     int[] offsets = JsonUtilities.decodeIntArray(jsonObject.get("offsets").getAsJsonArray());
     int[] lengths = JsonUtilities.decodeIntArray(jsonObject.get("lengths").getAsJsonArray());
-    return new ExtractLocalVariableFeedback(names, offsets, lengths);
+    return new ExtractLocalVariableFeedback(coveringExpressionOffsets, coveringExpressionLengths, names, offsets, lengths);
   }
 
   public static List<ExtractLocalVariableFeedback> fromJsonArray(JsonArray jsonArray) {
@@ -99,6 +117,22 @@
   }
 
   /**
+   * The lengths of the expressions that cover the specified selection, from the down most to the up
+   * most.
+   */
+  public int[] getCoveringExpressionLengths() {
+    return coveringExpressionLengths;
+  }
+
+  /**
+   * The offsets of the expressions that cover the specified selection, from the down most to the up
+   * most.
+   */
+  public int[] getCoveringExpressionOffsets() {
+    return coveringExpressionOffsets;
+  }
+
+  /**
    * The lengths of the expressions that would be replaced by a reference to the variable. The
    * lengths correspond to the offsets. In other words, for a given expression, if the offset of that
    * expression is offsets[i], then the length of that expression is lengths[i].
@@ -124,6 +158,8 @@
   @Override
   public int hashCode() {
     HashCodeBuilder builder = new HashCodeBuilder();
+    builder.append(coveringExpressionOffsets);
+    builder.append(coveringExpressionLengths);
     builder.append(names);
     builder.append(offsets);
     builder.append(lengths);
@@ -132,6 +168,16 @@
 
   public JsonObject toJson() {
     JsonObject jsonObject = new JsonObject();
+    JsonArray jsonArrayCoveringExpressionOffsets = new JsonArray();
+    for (int elt : coveringExpressionOffsets) {
+      jsonArrayCoveringExpressionOffsets.add(new JsonPrimitive(elt));
+    }
+    jsonObject.add("coveringExpressionOffsets", jsonArrayCoveringExpressionOffsets);
+    JsonArray jsonArrayCoveringExpressionLengths = new JsonArray();
+    for (int elt : coveringExpressionLengths) {
+      jsonArrayCoveringExpressionLengths.add(new JsonPrimitive(elt));
+    }
+    jsonObject.add("coveringExpressionLengths", jsonArrayCoveringExpressionLengths);
     JsonArray jsonArrayNames = new JsonArray();
     for (String elt : names) {
       jsonArrayNames.add(new JsonPrimitive(elt));
@@ -154,6 +200,10 @@
   public String toString() {
     StringBuilder builder = new StringBuilder();
     builder.append("[");
+    builder.append("coveringExpressionOffsets=");
+    builder.append(StringUtils.join(coveringExpressionOffsets, ", ") + ", ");
+    builder.append("coveringExpressionLengths=");
+    builder.append(StringUtils.join(coveringExpressionLengths, ", ") + ", ");
     builder.append("names=");
     builder.append(StringUtils.join(names, ", ") + ", ");
     builder.append("offsets=");
diff --git a/pkg/analysis_server/tool/spec/generated/java/types/FileKind.java b/pkg/analysis_server/tool/spec/generated/java/types/FileKind.java
new file mode 100644
index 0000000..d9ba7bb
--- /dev/null
+++ b/pkg/analysis_server/tool/spec/generated/java/types/FileKind.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2014, the Dart project authors.
+ *
+ * Licensed under the Eclipse Public License v1.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.eclipse.org/legal/epl-v10.html
+ *
+ * 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.
+ *
+ * This file has been automatically generated.  Please do not edit it manually.
+ * To regenerate the file, use the script "pkg/analysis_server/tool/spec/generate_files".
+ */
+package org.dartlang.analysis.server.protocol;
+
+/**
+ * An enumeration of the kinds of files.
+ *
+ * @coverage dart.server.generated.types
+ */
+public class FileKind {
+
+  public static final String LIBRARY = "LIBRARY";
+
+  public static final String PART = "PART";
+
+}
diff --git a/pkg/analysis_server/tool/spec/generated/java/types/HoverInformation.java b/pkg/analysis_server/tool/spec/generated/java/types/HoverInformation.java
index ac80ee8..c360b6a 100644
--- a/pkg/analysis_server/tool/spec/generated/java/types/HoverInformation.java
+++ b/pkg/analysis_server/tool/spec/generated/java/types/HoverInformation.java
@@ -44,14 +44,14 @@
   public static final List<HoverInformation> EMPTY_LIST = Lists.newArrayList();
 
   /**
-   * The offset of the range of characters that encompases the cursor position and has the same hover
-   * information as the cursor position.
+   * The offset of the range of characters that encompasses the cursor position and has the same
+   * hover information as the cursor position.
    */
   private final int offset;
 
   /**
-   * The length of the range of characters that encompases the cursor position and has the same hover
-   * information as the cursor position.
+   * The length of the range of characters that encompasses the cursor position and has the same
+   * hover information as the cursor position.
    */
   private final int length;
 
@@ -228,16 +228,16 @@
   }
 
   /**
-   * The length of the range of characters that encompases the cursor position and has the same hover
-   * information as the cursor position.
+   * The length of the range of characters that encompasses the cursor position and has the same
+   * hover information as the cursor position.
    */
   public int getLength() {
     return length;
   }
 
   /**
-   * The offset of the range of characters that encompases the cursor position and has the same hover
-   * information as the cursor position.
+   * The offset of the range of characters that encompasses the cursor position and has the same
+   * hover information as the cursor position.
    */
   public int getOffset() {
     return offset;
diff --git a/pkg/analysis_server/tool/spec/generated/java/types/ImplementedClass.java b/pkg/analysis_server/tool/spec/generated/java/types/ImplementedClass.java
new file mode 100644
index 0000000..dbe7096
--- /dev/null
+++ b/pkg/analysis_server/tool/spec/generated/java/types/ImplementedClass.java
@@ -0,0 +1,134 @@
+/*
+ * Copyright (c) 2014, the Dart project authors.
+ *
+ * Licensed under the Eclipse Public License v1.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.eclipse.org/legal/epl-v10.html
+ *
+ * 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.
+ *
+ * This file has been automatically generated.  Please do not edit it manually.
+ * To regenerate the file, use the script "pkg/analysis_server/tool/spec/generate_files".
+ */
+package org.dartlang.analysis.server.protocol;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import com.google.common.collect.Lists;
+import com.google.dart.server.utilities.general.JsonUtilities;
+import com.google.dart.server.utilities.general.ObjectUtilities;
+import com.google.gson.JsonArray;
+import com.google.gson.JsonElement;
+import com.google.gson.JsonObject;
+import com.google.gson.JsonPrimitive;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+import java.util.ArrayList;
+import java.util.Iterator;
+import org.apache.commons.lang3.StringUtils;
+
+/**
+ * A description of a class that is implemented or extended.
+ *
+ * @coverage dart.server.generated.types
+ */
+@SuppressWarnings("unused")
+public class ImplementedClass {
+
+  public static final ImplementedClass[] EMPTY_ARRAY = new ImplementedClass[0];
+
+  public static final List<ImplementedClass> EMPTY_LIST = Lists.newArrayList();
+
+  /**
+   * The offset of the name of the implemented class.
+   */
+  private final int offset;
+
+  /**
+   * The length of the name of the implemented class.
+   */
+  private final int length;
+
+  /**
+   * Constructor for {@link ImplementedClass}.
+   */
+  public ImplementedClass(int offset, int length) {
+    this.offset = offset;
+    this.length = length;
+  }
+
+  @Override
+  public boolean equals(Object obj) {
+    if (obj instanceof ImplementedClass) {
+      ImplementedClass other = (ImplementedClass) obj;
+      return
+        other.offset == offset &&
+        other.length == length;
+    }
+    return false;
+  }
+
+  public static ImplementedClass fromJson(JsonObject jsonObject) {
+    int offset = jsonObject.get("offset").getAsInt();
+    int length = jsonObject.get("length").getAsInt();
+    return new ImplementedClass(offset, length);
+  }
+
+  public static List<ImplementedClass> fromJsonArray(JsonArray jsonArray) {
+    if (jsonArray == null) {
+      return EMPTY_LIST;
+    }
+    ArrayList<ImplementedClass> list = new ArrayList<ImplementedClass>(jsonArray.size());
+    Iterator<JsonElement> iterator = jsonArray.iterator();
+    while (iterator.hasNext()) {
+      list.add(fromJson(iterator.next().getAsJsonObject()));
+    }
+    return list;
+  }
+
+  /**
+   * The length of the name of the implemented class.
+   */
+  public int getLength() {
+    return length;
+  }
+
+  /**
+   * The offset of the name of the implemented class.
+   */
+  public int getOffset() {
+    return offset;
+  }
+
+  @Override
+  public int hashCode() {
+    HashCodeBuilder builder = new HashCodeBuilder();
+    builder.append(offset);
+    builder.append(length);
+    return builder.toHashCode();
+  }
+
+  public JsonObject toJson() {
+    JsonObject jsonObject = new JsonObject();
+    jsonObject.addProperty("offset", offset);
+    jsonObject.addProperty("length", length);
+    return jsonObject;
+  }
+
+  @Override
+  public String toString() {
+    StringBuilder builder = new StringBuilder();
+    builder.append("[");
+    builder.append("offset=");
+    builder.append(offset + ", ");
+    builder.append("length=");
+    builder.append(length);
+    builder.append("]");
+    return builder.toString();
+  }
+
+}
diff --git a/pkg/analysis_server/tool/spec/generated/java/types/ImplementedMember.java b/pkg/analysis_server/tool/spec/generated/java/types/ImplementedMember.java
new file mode 100644
index 0000000..941d1a8
--- /dev/null
+++ b/pkg/analysis_server/tool/spec/generated/java/types/ImplementedMember.java
@@ -0,0 +1,134 @@
+/*
+ * Copyright (c) 2014, the Dart project authors.
+ *
+ * Licensed under the Eclipse Public License v1.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.eclipse.org/legal/epl-v10.html
+ *
+ * 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.
+ *
+ * This file has been automatically generated.  Please do not edit it manually.
+ * To regenerate the file, use the script "pkg/analysis_server/tool/spec/generate_files".
+ */
+package org.dartlang.analysis.server.protocol;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import com.google.common.collect.Lists;
+import com.google.dart.server.utilities.general.JsonUtilities;
+import com.google.dart.server.utilities.general.ObjectUtilities;
+import com.google.gson.JsonArray;
+import com.google.gson.JsonElement;
+import com.google.gson.JsonObject;
+import com.google.gson.JsonPrimitive;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+import java.util.ArrayList;
+import java.util.Iterator;
+import org.apache.commons.lang3.StringUtils;
+
+/**
+ * A description of a class member that is implemented or overridden.
+ *
+ * @coverage dart.server.generated.types
+ */
+@SuppressWarnings("unused")
+public class ImplementedMember {
+
+  public static final ImplementedMember[] EMPTY_ARRAY = new ImplementedMember[0];
+
+  public static final List<ImplementedMember> EMPTY_LIST = Lists.newArrayList();
+
+  /**
+   * The offset of the name of the implemented member.
+   */
+  private final int offset;
+
+  /**
+   * The length of the name of the implemented member.
+   */
+  private final int length;
+
+  /**
+   * Constructor for {@link ImplementedMember}.
+   */
+  public ImplementedMember(int offset, int length) {
+    this.offset = offset;
+    this.length = length;
+  }
+
+  @Override
+  public boolean equals(Object obj) {
+    if (obj instanceof ImplementedMember) {
+      ImplementedMember other = (ImplementedMember) obj;
+      return
+        other.offset == offset &&
+        other.length == length;
+    }
+    return false;
+  }
+
+  public static ImplementedMember fromJson(JsonObject jsonObject) {
+    int offset = jsonObject.get("offset").getAsInt();
+    int length = jsonObject.get("length").getAsInt();
+    return new ImplementedMember(offset, length);
+  }
+
+  public static List<ImplementedMember> fromJsonArray(JsonArray jsonArray) {
+    if (jsonArray == null) {
+      return EMPTY_LIST;
+    }
+    ArrayList<ImplementedMember> list = new ArrayList<ImplementedMember>(jsonArray.size());
+    Iterator<JsonElement> iterator = jsonArray.iterator();
+    while (iterator.hasNext()) {
+      list.add(fromJson(iterator.next().getAsJsonObject()));
+    }
+    return list;
+  }
+
+  /**
+   * The length of the name of the implemented member.
+   */
+  public int getLength() {
+    return length;
+  }
+
+  /**
+   * The offset of the name of the implemented member.
+   */
+  public int getOffset() {
+    return offset;
+  }
+
+  @Override
+  public int hashCode() {
+    HashCodeBuilder builder = new HashCodeBuilder();
+    builder.append(offset);
+    builder.append(length);
+    return builder.toHashCode();
+  }
+
+  public JsonObject toJson() {
+    JsonObject jsonObject = new JsonObject();
+    jsonObject.addProperty("offset", offset);
+    jsonObject.addProperty("length", length);
+    return jsonObject;
+  }
+
+  @Override
+  public String toString() {
+    StringBuilder builder = new StringBuilder();
+    builder.append("[");
+    builder.append("offset=");
+    builder.append(offset + ", ");
+    builder.append("length=");
+    builder.append(length);
+    builder.append("]");
+    return builder.toString();
+  }
+
+}
diff --git a/pkg/analysis_server/tool/spec/generated/java/types/NavigationRegion.java b/pkg/analysis_server/tool/spec/generated/java/types/NavigationRegion.java
index b42bdc7..8500056 100644
--- a/pkg/analysis_server/tool/spec/generated/java/types/NavigationRegion.java
+++ b/pkg/analysis_server/tool/spec/generated/java/types/NavigationRegion.java
@@ -55,7 +55,8 @@
 
   /**
    * The indexes of the targets (in the enclosing navigation response) to which the given region is
-   * bound. By opening the target, clients can implement one form of navigation.
+   * bound. By opening the target, clients can implement one form of navigation. This list cannot be
+   * empty.
    */
   private final int[] targets;
 
@@ -125,7 +126,8 @@
 
   /**
    * The indexes of the targets (in the enclosing navigation response) to which the given region is
-   * bound. By opening the target, clients can implement one form of navigation.
+   * bound. By opening the target, clients can implement one form of navigation. This list cannot be
+   * empty.
    */
   public int[] getTargets() {
     return targets;
diff --git a/pkg/analysis_server/tool/spec/generated/java/types/RequestErrorCode.java b/pkg/analysis_server/tool/spec/generated/java/types/RequestErrorCode.java
index a8615d2..3730a03 100644
--- a/pkg/analysis_server/tool/spec/generated/java/types/RequestErrorCode.java
+++ b/pkg/analysis_server/tool/spec/generated/java/types/RequestErrorCode.java
@@ -135,7 +135,7 @@
 
   /**
    * A request was received which the analysis server does not recognize, or cannot handle in its
-   * current configuation.
+   * current configuration.
    */
   public static final String UNKNOWN_REQUEST = "UNKNOWN_REQUEST";
 
diff --git a/pkg/analysis_server/tool/spec/spec_input.html b/pkg/analysis_server/tool/spec/spec_input.html
index 6bd7e09..8c349e3 100644
--- a/pkg/analysis_server/tool/spec/spec_input.html
+++ b/pkg/analysis_server/tool/spec/spec_input.html
@@ -1,3 +1,4 @@
+<!doctype html>
 <html>
   <head>
     <meta charset="UTF-8"/>
@@ -5,7 +6,7 @@
   </head>
   <body>
     <h1>Analysis Server API Specification</h1>
-    <h1 style="color:#999999">Version <version>1.9.0</version></h1>
+    <h1 style="color:#999999">Version <version>1.12.0</version></h1>
     <p>
       This document contains a specification of the API provided by the
       analysis server.  The API in this document is currently under
@@ -137,6 +138,9 @@
       the standard JSON primitives. These data structures are
       documented in the section titled <a href="#types">Types</a>.
     </p>
+    <p>
+      To get an overview of the API, you can consult the <a href="#index">index</a>.
+    </p>
     <h3>Command-line Arguments</h3>
     <p>
       The command-line arguments that can be passed to the server.
@@ -875,6 +879,38 @@
           </field>
         </params>
       </notification>
+      <notification event="implemented">
+        <p>
+          Reports the classes that are implemented or extended and
+          class members that are implemented or overridden in a file.
+        </p>
+        <p>
+          This notification is not subscribed to by default. Clients
+          can subscribe by including the value <tt>"IMPLEMENTED"</tt> in
+          the list of services passed in an analysis.setSubscriptions
+          request.
+        </p>
+        <params>
+          <field name="file">
+            <ref>FilePath</ref>
+            <p>
+              The file with which the implementations are associated.
+            </p>
+          </field>
+          <field name="classes">
+            <list><ref>ImplementedClass</ref></list>
+            <p>
+              The classes defined in the file that are implemented or extended.
+            </p>
+          </field>
+          <field name="members">
+            <list><ref>ImplementedMember</ref></list>
+            <p>
+              The member defined in the file that are implemented or overridden.
+            </p>
+          </field>
+        </params>
+      </notification>
       <notification event="invalidate">
         <p>
           Reports that the navigation information associated with a region of a
@@ -1008,6 +1044,23 @@
               The file with which the outline is associated.
             </p>
           </field>
+          <field name="kind">
+            <ref>FileKind</ref>
+            <p>
+              The kind of the file.
+            </p>
+          </field>
+          <field name="libraryName" optional="true">
+            <ref>String</ref>
+            <p>
+              The name of the library defined by the file using a "library"
+              directive, or referenced by a "part of" directive. If both
+              "library" and "part of" directives are present, then the
+              "library" directive takes precedence.
+              This field will be omitted if the file has neither "library"
+              nor "part of" directives.
+            </p>
+          </field>
           <field name="outline">
             <ref>Outline</ref>
             <p>
@@ -1018,7 +1071,7 @@
       </notification>
       <notification event="overrides">
         <p>
-          Reports the overridding members in a file.
+          Reports the overriding members in a file.
         </p>
         <p>
           This notification is not subscribed to by default. Clients
@@ -1305,6 +1358,13 @@
               The offset of the name of the type within the file.
             </p>
           </field>
+          <field name="superOnly" optional="true">
+            <ref>bool</ref>
+            <p>
+              True if the client is only requesting superclasses and
+              interfaces hierarchy.
+            </p>
+          </field>
         </params>
         <result>
           <field name="hierarchyItems" optional="true">
@@ -1712,7 +1772,7 @@
           If directives of the Dart file cannot be organized, for example
           because it has scan or parse errors, or by other reasons,
           <tt>ORGANIZE_DIRECTIVES_ERROR</tt> will be generated. The message
-          will provide datails about the reason.
+          will provide details about the reason.
         </p>
         <params>
           <field name="file">
@@ -1967,6 +2027,21 @@
               message associated with the error code.
             </p>
           </field>
+          <field name="hasFix" optional="true">
+            <ref>bool</ref>
+            <p>
+              A hint to indicate to interested clients that this error has
+              an associated fix (or fixes).  The absence of this field implies
+              there are not known to be fixes.  Note that since the operation
+              to calculate whether fixes apply needs to be performant it is
+              possible that complicated tests will be skipped and a false
+              negative returned.  For this reason, this attribute should be
+              treated as a "hint".  Despite the possibility of false negatives,
+              no false positives should be returned.  If a client sees this
+              flag set they can proceed with the confidence that there are in
+              fact associated fixes.
+            </p>
+          </field>
         </object>
       </type>
       <type name="AnalysisErrorFixes">
@@ -2053,6 +2128,13 @@
               proposed "null aware operators" feature.
             </p>
           </field>
+          <field name="enableSuperMixins" optional="true">
+            <ref>bool</ref>
+            <p>
+              True if the client wants to enable support for the
+              proposed "less restricted mixins" proposal (DEP 34).
+            </p>
+          </field>
           <field name="generateDart2jsHints" optional="true">
             <ref>bool</ref>
             <p>
@@ -2084,6 +2166,7 @@
         <enum>
           <value><code>FOLDING</code></value>
           <value><code>HIGHLIGHTS</code></value>
+          <value><code>IMPLEMENTED</code></value>
           <value>
             <code>INVALIDATE</code>
             <p>
@@ -2438,6 +2521,7 @@
           <value><code>ENUM</code></value>
           <value><code>ENUM_CONSTANT</code></value>
           <value><code>FIELD</code></value>
+          <value><code>FILE</code></value>
           <value><code>FUNCTION</code></value>
           <value><code>FUNCTION_TYPE_ALIAS</code></value>
           <value><code>GETTER</code></value>
@@ -2500,6 +2584,15 @@
           <value><code>LAUNCH_DATA</code></value>
         </enum>
       </type>
+      <type name="FileKind">
+        <p>
+          An enumeration of the kinds of files.
+        </p>
+        <enum>
+          <value><code>LIBRARY</code></value>
+          <value><code>PART</code></value>
+        </enum>
+      </type>
       <type name="FilePath">
         <ref>String</ref>
         <p>
@@ -2814,7 +2907,7 @@
           <field name="offset">
             <ref>int</ref>
             <p>
-              The offset of the range of characters that encompases the
+              The offset of the range of characters that encompasses the
               cursor position and has the same hover information as the
               cursor position.
             </p>
@@ -2822,7 +2915,7 @@
           <field name="length">
             <ref>int</ref>
             <p>
-              The length of the range of characters that encompases the
+              The length of the range of characters that encompasses the
               cursor position and has the same hover information as the
               cursor position.
             </p>
@@ -2908,6 +3001,44 @@
           </field>
         </object>
       </type>
+      <type name="ImplementedClass">
+        <p>
+          A description of a class that is implemented or extended.
+        </p>
+        <object>
+          <field name="offset">
+            <ref>int</ref>
+            <p>
+              The offset of the name of the implemented class.
+            </p>
+          </field>
+          <field name="length">
+            <ref>int</ref>
+            <p>
+              The length of the name of the implemented class.
+            </p>
+          </field>
+        </object>
+      </type>
+      <type name="ImplementedMember">
+        <p>
+          A description of a class member that is implemented or overridden.
+        </p>
+        <object>
+          <field name="offset">
+            <ref>int</ref>
+            <p>
+              The offset of the name of the implemented member.
+            </p>
+          </field>
+          <field name="length">
+            <ref>int</ref>
+            <p>
+              The length of the name of the implemented member.
+            </p>
+          </field>
+        </object>
+      </type>
       <type name="LinkedEditGroup">
         <p>
           A collection of positions that should be linked (edited
@@ -3037,7 +3168,7 @@
             <p>
               The indexes of the targets (in the enclosing navigation response)
               to which the given region is bound. By opening the target, clients
-              can implement one form of navigation.
+              can implement one form of navigation. This list cannot be empty.
             </p>
           </field>
         </object>
@@ -3563,7 +3694,7 @@
             <p>
               A request was received which the analysis server does
               not recognize, or cannot handle in its current
-              configuation.
+              configuration.
             </p>
           </value>
           <value>
@@ -3896,14 +4027,28 @@
       </refactoring>
       <refactoring kind="EXTRACT_LOCAL_VARIABLE">
         <p>
-          Create a local variable initialized by a specified
-          expression.
+          Create a local variable initialized by the expression that covers
+          the specified selection.
         </p>
         <p>
-          It is an error if the range contains anything other than a
-          complete expression (no partial expressions are allowed).
+          It is an error if the selection range is not covered by a
+          complete expression.
         </p>
         <feedback>
+          <field name="coveringExpressionOffsets">
+            <list><ref>int</ref></list>
+            <p>
+              The offsets of the expressions that cover the specified
+              selection, from the down most to the up most.
+            </p>
+          </field>
+          <field name="coveringExpressionLengths">
+            <list><ref>int</ref></list>
+            <p>
+              The lengths of the expressions that cover the specified
+              selection, from the down most to the up most.
+            </p>
+          </field>
           <field name="names">
             <list><ref>String</ref></list>
             <p>
@@ -4226,5 +4371,7 @@
     <p>
       TBD
     </p>
+    <h2 class="domain"><a name="index">Index</a></h2>
+    <index></index>
   </body>
 </html>
diff --git a/pkg/analysis_server/tool/spec/text_formatter.dart b/pkg/analysis_server/tool/spec/text_formatter.dart
index 17a7996..a4eb82c 100644
--- a/pkg/analysis_server/tool/spec/text_formatter.dart
+++ b/pkg/analysis_server/tool/spec/text_formatter.dart
@@ -19,12 +19,13 @@
  * If [javadocStyle] is true, then the output is compatable with Javadoc,
  * which understands certain HTML constructs.
  */
-String nodesToText(List<dom.Node> desc, int width, bool javadocStyle) {
+String nodesToText(List<dom.Node> desc, int width, bool javadocStyle,
+    {bool removeTrailingNewLine: false}) {
   _TextFormatter formatter = new _TextFormatter(width, javadocStyle);
   return formatter.collectCode(() {
     formatter.addAll(desc);
     formatter.lineBreak(false);
-  });
+  }, removeTrailingNewLine: removeTrailingNewLine);
 }
 
 /**
diff --git a/pkg/analysis_server/tool/spec/to_html.dart b/pkg/analysis_server/tool/spec/to_html.dart
index 804db2d..2164c9f 100644
--- a/pkg/analysis_server/tool/spec/to_html.dart
+++ b/pkg/analysis_server/tool/spec/to_html.dart
@@ -61,11 +61,30 @@
 dt.typeDefinition {
   font-weight: bold;
 }
+
+*/
+* Styles for index
+*/
+
+.subindex {
+}
+
+.subindex ul {
+  padding-left: 0px;
+  margin-left: 0px;
+
+  -webkit-margin-before: 0px;
+  -webkit-margin-start: 0px;
+  -webkit-padding-start: 0px;
+
+  list-style-type: none;
+}
 '''.trim();
 
 final GeneratedFile target = new GeneratedFile('../../doc/api.html', () {
   ToHtmlVisitor visitor = new ToHtmlVisitor(readApi());
   dom.Document document = new dom.Document();
+  document.append(new dom.DocumentType('html', null, null));
   for (dom.Node node in visitor.collectHtml(visitor.visitApi)) {
     document.append(node);
   }
@@ -107,6 +126,7 @@
   void box(void callback()) {
     element('div', {'class': 'box'}, callback);
   }
+
   void br() => element('br', {});
   void dd(void callback()) => element('dd', {}, callback);
   void dl(void callback()) => element('dl', {}, callback);
@@ -122,8 +142,10 @@
     }
     return element('h2', {'class': cls}, callback);
   }
+
   void h3(void callback()) => element('h3', {}, callback);
   void h4(void callback()) => element('h4', {}, callback);
+  void h5(void callback()) => element('h5', {}, callback);
   void hangingIndent(void callback()) =>
       element('div', {'class': 'hangingIndent'}, callback);
   void head(void callback()) => element('head', {}, callback);
@@ -132,6 +154,7 @@
   void link(String id, void callback()) {
     element('a', {'href': '#$id'}, callback);
   }
+
   void p(void callback()) => element('p', {}, callback);
   void pre(void callback()) => element('pre', {}, callback);
   void title(void callback()) => element('title', {}, callback);
@@ -232,9 +255,6 @@
           continue;
         }
         switch (node.localName) {
-          case 'api':
-            translateHtml(node, squashParagraphs: squashParagraphs);
-            break;
           case 'domain':
             visitDomain(apiMappings.domains[node]);
             break;
@@ -255,6 +275,9 @@
           case 'version':
             translateHtml(node, squashParagraphs: squashParagraphs);
             break;
+          case 'index':
+            generateIndex();
+            break;
           default:
             if (!specialElements.contains(node.localName)) {
               element(node.localName, node.attributes, () {
@@ -470,6 +493,103 @@
       super.visitTypes(types);
     });
   }
+
+  void generateIndex() {
+    h3(() => write('Domains'));
+    for (var domain in api.domains) {
+      if (domain.requests.length == 0 && domain.notifications == 0) continue;
+      generateDomainIndex(domain);
+    }
+
+    generateTypesIndex(definedTypes);
+    generateRefactoringsIndex(api.refactorings);
+  }
+
+  void generateDomainIndex(Domain domain) {
+    h4(() {
+      write(domain.name);
+      write(' (');
+      link('domain_${domain.name}', () => write('\u2191'));
+      write(')');
+    });
+    if (domain.requests.length > 0) {
+      element('div', {'class': 'subindex'}, () {
+        generateRequestsIndex(domain.requests);
+        if (domain.notifications.length > 0) {
+          generateNotificationsIndex(domain.notifications);
+        }
+      });
+    } else if (domain.notifications.length > 0) {
+      element('div', {'class': 'subindex'}, () {
+        generateNotificationsIndex(domain.notifications);
+      });
+    }
+  }
+
+  void generateRequestsIndex(Iterable<Request> requests) {
+    h5(() => write("Requests"));
+    element('ul', {}, () {
+      for (var request in requests) {
+        element(
+            'li',
+            {},
+            () => link(
+                'request_${request.longMethod}', () => write(request.method)));
+      }
+    });
+  }
+
+  void generateNotificationsIndex(Iterable<Notification> notifications) {
+    h5(() => write("Notifications"));
+    element('div', {'class': 'subindex'}, () {
+      element('ul', {}, () {
+        for (var notification in notifications) {
+          element(
+              'li',
+              {},
+              () => link('notification_${notification.longEvent}',
+                  () => write(notification.event)));
+        }
+      });
+    });
+  }
+
+  void generateTypesIndex(Set<String> types) {
+    h3(() {
+      write("Types");
+      write(' (');
+      link('types', () => write('\u2191'));
+      write(')');
+    });
+    element('div', {'class': 'subindex'}, () {
+      element('ul', {}, () {
+        for (var type in types) {
+          element('li', {}, () => link('type_$type', () => write(type)));
+        }
+      });
+    });
+  }
+
+  void generateRefactoringsIndex(Iterable<Refactoring> refactorings) {
+    h3(() {
+      write("Refactorings");
+      write(' (');
+      link('refactorings', () => write('\u2191'));
+      write(')');
+    });
+    // TODO: Individual refactorings are not yet hyperlinked.
+    element('div', {'class': 'subindex'}, () {
+      element('ul', {}, () {
+        for (var refactoring in refactorings) {
+          element(
+              'li',
+              {},
+              () => link('refactoring_${refactoring.kind}',
+                  () => write(refactoring.kind)));
+        }
+      });
+    });
+  }
 }
 
 /**
diff --git a/pkg/analyzer/CHANGELOG.md b/pkg/analyzer/CHANGELOG.md
index 7c67e09..4f4165d 100644
--- a/pkg/analyzer/CHANGELOG.md
+++ b/pkg/analyzer/CHANGELOG.md
@@ -1,29 +1,71 @@
+## 0.26.1+16
+* (Internal) Options validation plugin API update.
+
+## 0.26.1+15
+* (Internal) Provisional options validation plugin API.
+
+## 0.26.1+13
+* (Internal) Plugin processing fixes.
+
+## 0.26.1+11
+* Fixes to address lint registry memory leaking.
+
+## 0.26.1+10
+* New `AnalysisContext` API for associating configuration data with contexts
+  (`setConfigurationData()` and `getConfigurationData()`).
+
+## 0.26.1+9
+* `OptionsProcessor` extension point API changed to pass associated
+  `AnalysisContext` instance into the `optionsProcessed` call-back.
+
+## 0.26.1+6
+* Provisional (internal) plugin manifest parsing.
+
+## 0.26.1+5
+* Plugin configuration `ErrorHandler` typedef API fix.
+
+## 0.26.1+4
+* Provisional (internal) support for plugin configuration via `.analysis_options`.
+
+## 0.26.1+2
+
+* Extension point for WorkManagerFactory(s).
+* Resolve enum documentation comments.
+* Fix display of parameter lists in servers Element structure (issue 24194)
+* Band-aid fix for issue #24191.
+
+## 0.26.1+1
+
+* Removed a warning about importing unnamed libraries
+* Fix handling of empty URIs in `.packages` files (issue 24126)
+
+## 0.26.1
+
+* Fix line starts in multiline comments (issue 23919).
+* Various small fixes to Windows path handling.
+* Update LineInfo computation during incremental resolution.
+* Make exclude list apply to contexts (issue 23941).
+* Fix type propagation for asynchronous for-in statements.
+* Fix ToStringVisitor for external functions (issue 23968).
+* Fix sorting of compilation unit members.
+* Add forwarding for DefaultFormalParameter metadata.
+* Fix most implementations of UriResolver.restoreAbsolute.
+* Disable dart2js hints by default.
+* Support older SDKs (Dart 1.11).
+
 ## 0.26.0
 
-* No changes from 0.26.0-alpha.2.
-
-## 0.26.0-alpha.2
-
-* Fix highlight range for missing enum constant in switch (issue 23904).
-* Fix analyzer's treatment of `ClassName?.staticMember` to match spec.
-* Implement DEP 34 (less restricted mixins).
-* Fix some implementations of `UriResolver.resolveUri(..)` that did not
-  properly handle the new `actualUri` argument.
-
-## 0.26.0-alpha.1
-
-* Change `ResolutionCopier.visitAwaitExpression` to copy *Type fields.
-
-## 0.26.0-alpha.0
-
-* API change: `UriResolver.resolveUri(..)` now takes an optional `actualUri`.
-
-## 0.25.3-alpha.0
-
 * Add hook for listening to implicitly analyzed files
 * Add a PathFilter and AnalysisOptionsProvider utility classes to aid
   clients in excluding files from analysis when directed to do so by an
   options file.
+* API change: `UriResolver.resolveUri(..)` now takes an optional `actualUri`.
+* Change `ResolutionCopier.visitAwaitExpression` to copy *Type fields.
+* Fix highlight range for missing enum constant in switch (issue 23904).
+* Fix analyzer's treatment of `ClassName?.staticMember` to match spec.
+* Implement DEP 34 (less restricted mixins).
+* Fix some implementations of `UriResolver.resolveUri(..)` that did not
+  properly handle the new `actualUri` argument.
 
 ## 0.25.2
 
diff --git a/pkg/analyzer/README.md b/pkg/analyzer/README.md
index eb5c89e..c6ad981 100644
--- a/pkg/analyzer/README.md
+++ b/pkg/analyzer/README.md
@@ -1,27 +1,113 @@
-The analysis package defines support for performing static analysis of Dart
-code. It was designed to support tooling efforts, but has also been used for
-such things as statistics gathering and code transformers.
+# Analyzer for Dart
 
-If you are interested in providing Dart support in a long-running tool, such as
-an editor or IDE, you should use the analysis server instead of this package.
-The analysis server is currently shipped as an executable in the SDK and will
-be released as a package in the near future. In the meantime, if you'd like to
-learn more about it, please look at the
-[Analysis Server API Specification](http://htmlpreview.github.io/?https://github.com/dart-lang/sdk/blob/master/pkg/analysis_server/doc/api.html)
-or contact the mailing list (see below).
+This package provides a low-level _library_ that performs static analysis
+of Dart code. It is useful for tool
+integration and embedding.
 
-The API's in this package are, quite frankly, a mess at the moment. They were
+End-users should use the [dartanalyzer][analyzercli] command-line tool
+to analyze their Dart code.
+
+Integrators that want to add Dart support to their editor
+should use the _Dart Analysis Server_.
+The [Analysis Server API Specification][serverapi] is available.
+If you are adding Dart support to an editor or IDE, please let us know
+by emailing our [list][].
+
+## Configuring the analyzer
+
+Both the dartanalyzer and Dart Analysis Server can be configured
+with a `.analysis_options` file. This YAML file can control which files
+and paths are analyzed, which lints are applied, and more.
+
+If you are embedding the analyzer library in your project, you are
+responsible for finding the `.analysis_options` file, parsing it,
+and configuring the analyzer.
+
+The `.analysis_options` file should live
+at the root of your project (for example, next to your `pubspec.yaml`).
+Different embedders of analyzer, such as dartanalyzer or Dart Analysis Server,
+may choose to find the file in various different ways. Consult their
+documentation to learn more.
+
+Here is an example file that instructs the analyzer
+to ignore two files:
+
+```
+analyzer:
+  exclude:
+    - test/_data/p4/lib/lib1.dart
+    - test/_data/p5/p5.dart
+    - test/_data/bad*.dart
+    - test/_brokendata/**
+```
+
+Note that you can use globs, as defined by the [glob package][glob].
+
+Here is an example file that enables the analyzer's [strong mode][strongmode]:
+
+```
+analyzer:
+  strong-mode: true
+```
+
+Here is an example file that enables two lint rules:
+
+```
+linter:
+  rules:
+    - camel_case_types
+    - empty_constructor_bodies
+```
+
+Check out all the available [Dart lint rules][lintrules].
+
+You can combine the `analyzer` section and the `linter` section into a single
+configuration. Here is an example:
+
+```
+analyzer:
+  exclude:
+    - test/_data/p4/lib/lib1.dart
+linter:
+  rules:
+    - camel_case_types
+```
+
+## Who uses this library?
+
+Many tools embed this library, such as:
+
+* dartfmt - a formatter for Dart code
+* dartdoc - a documentation generator for Dart code
+* Dart Analysis Server - a stateful server that supports IDEs and editors
+
+## Support
+
+Questions and requests for additional functionality are welcome.
+Please open an issue at
+[http://dartbug.com](http://dartbug.com)
+or by email
+[analyzer-discuss@dartlang.org][list].
+
+## Background
+
+The APIs in this package are, quite frankly, a mess at the moment. They were
 originally machine generated by a translator and were based on an earlier Java
 implementation. Several of the API's still look like their Java predecessors
 (or worse) rather than clean Dart API's.
 
 In addition, there is currently no clean distinction between public and internal
-API's. We plan to address this issue soon, but doing so will, unfortunately,
+APIs. We plan to address this issue but doing so will, unfortunately,
 require a large number of breaking changes. We will try to minimize the pain
 this causes for our clients, but some pain is inevitable.
 
-Questions and requests for additional functionality are welcome, and can be made
-by either opening an issue at
-[http://dartbug.com](http://dartbug.com)
-or by emailing
-[analyzer-discuss@dartlang.org](https://groups.google.com/a/dartlang.org/forum/#!forum/analyzer-discuss).
+## License
+
+See the LICENSE file.
+
+[serverapi]: http://htmlpreview.github.io/?https://github.com/dart-lang/sdk/blob/master/pkg/analysis_server/doc/api.html
+[analyzercli]: https://github.com/dart-lang/analyzer_cli
+[list]: https://groups.google.com/a/dartlang.org/forum/#!forum/analyzer-discuss
+[lintrules]: http://dart-lang.github.io/linter/lints/
+[strongmode]: https://github.com/dart-lang/dev_compiler/blob/master/STRONG_MODE.md
+[glob]: https://pub.dartlang.org/packages/glob
diff --git a/pkg/analyzer/lib/file_system/file_system.dart b/pkg/analyzer/lib/file_system/file_system.dart
index 788600b..7d3ed95 100644
--- a/pkg/analyzer/lib/file_system/file_system.dart
+++ b/pkg/analyzer/lib/file_system/file_system.dart
@@ -140,14 +140,14 @@
 
   /**
    * Return a [File] that corresponds to the given [path].
-   * 
+   *
    * A file may or may not exist at this location.
    */
   File getFile(String path);
 
   /**
    * Return a [Folder] that corresponds to the given [path].
-   * 
+   *
    * A folder may or may not exist at this location.
    */
   Folder getFolder(String path);
@@ -194,7 +194,8 @@
   }
 
   @override
-  Uri restoreAbsolute(Source source) => source.uri;
+  Uri restoreAbsolute(Source source) =>
+      _provider.pathContext.toUri(source.fullName);
 
   /**
    * Return `true` if the given [uri] is a `file` URI.
diff --git a/pkg/analyzer/lib/file_system/memory_file_system.dart b/pkg/analyzer/lib/file_system/memory_file_system.dart
index cfc3aa2..058f9eb 100644
--- a/pkg/analyzer/lib/file_system/memory_file_system.dart
+++ b/pkg/analyzer/lib/file_system/memory_file_system.dart
@@ -72,7 +72,7 @@
 
   @override
   Resource getResource(String path) {
-    path = posix.normalize(path);
+    path = pathContext.normalize(path);
     Resource resource = _pathToResource[path];
     if (resource == null) {
       resource = new _MemoryFile(this, path);
@@ -97,8 +97,8 @@
    * appears in its parent directory, but whose `exists` property is false)
    */
   File newDummyLink(String path) {
-    path = posix.normalize(path);
-    newFolder(posix.dirname(path));
+    path = pathContext.normalize(path);
+    newFolder(pathContext.dirname(path));
     _MemoryDummyLink link = new _MemoryDummyLink(this, path);
     _pathToResource[path] = link;
     _pathToTimestamp[path] = nextStamp++;
@@ -107,10 +107,10 @@
   }
 
   File newFile(String path, String content, [int stamp]) {
-    path = posix.normalize(path);
-    _MemoryResource folder = _pathToResource[posix.dirname(path)];
+    path = pathContext.normalize(path);
+    _MemoryResource folder = _pathToResource[pathContext.dirname(path)];
     if (folder == null) {
-      newFolder(posix.dirname(path));
+      newFolder(pathContext.dirname(path));
     } else if (folder is! Folder) {
       throw new ArgumentError('Cannot create file ($path) as child of file');
     }
@@ -123,13 +123,14 @@
   }
 
   Folder newFolder(String path) {
-    path = posix.normalize(path);
-    if (!path.startsWith('/')) {
-      throw new ArgumentError("Path must start with '/'");
+    path = pathContext.normalize(path);
+    if (!path.startsWith(pathContext.separator)) {
+      throw new ArgumentError(
+          "Path must start with '${pathContext.separator}' : $path");
     }
     _MemoryResource resource = _pathToResource[path];
     if (resource == null) {
-      String parentPath = posix.dirname(path);
+      String parentPath = pathContext.dirname(path);
       if (parentPath != path) {
         newFolder(parentPath);
       }
@@ -149,8 +150,8 @@
   }
 
   File updateFile(String path, String content, [int stamp]) {
-    path = posix.normalize(path);
-    newFolder(posix.dirname(path));
+    path = pathContext.normalize(path);
+    newFolder(pathContext.dirname(path));
     _MemoryFile file = new _MemoryFile(this, path);
     _pathToResource[path] = file;
     _pathToContent[path] = content;
@@ -178,7 +179,7 @@
   void _notifyWatchers(String path, ChangeType changeType) {
     _pathToWatchers.forEach((String watcherPath,
         List<StreamController<WatchEvent>> streamControllers) {
-      if (watcherPath == path || posix.isWithin(watcherPath, path)) {
+      if (watcherPath == path || pathContext.isWithin(watcherPath, path)) {
         for (StreamController<WatchEvent> streamController
             in streamControllers) {
           streamController.add(new WatchEvent(changeType, path));
@@ -261,7 +262,7 @@
   @override
   Source createSource([Uri uri]) {
     if (uri == null) {
-      uri = posix.toUri(path);
+      uri = _provider.pathContext.toUri(path);
     }
     return new _MemoryFileSource(this, uri);
   }
@@ -362,7 +363,13 @@
 
   @override
   Uri resolveRelativeUri(Uri relativeUri) {
-    return uri.resolveUri(relativeUri);
+    Uri baseUri = uri;
+    String scheme = uri.scheme;
+    if (scheme == DartUriResolver.DART_SCHEME) {
+      String libraryName = uri.path;
+      baseUri = Uri.parse('$scheme:$libraryName/$libraryName.dart');
+    }
+    return baseUri.resolveUri(relativeUri);
   }
 
   @override
@@ -381,15 +388,15 @@
 
   @override
   String canonicalizePath(String relPath) {
-    relPath = posix.normalize(relPath);
-    String childPath = posix.join(path, relPath);
-    childPath = posix.normalize(childPath);
+    relPath = _provider.pathContext.normalize(relPath);
+    String childPath = _provider.pathContext.join(path, relPath);
+    childPath = _provider.pathContext.normalize(childPath);
     return childPath;
   }
 
   @override
   bool contains(String path) {
-    return posix.isWithin(this.path, path);
+    return _provider.pathContext.isWithin(this.path, path);
   }
 
   @override
@@ -419,7 +426,7 @@
     }
     List<Resource> children = <Resource>[];
     _provider._pathToResource.forEach((resourcePath, resource) {
-      if (posix.dirname(resourcePath) == path) {
+      if (_provider.pathContext.dirname(resourcePath) == path) {
         children.add(resource);
       }
     });
@@ -465,7 +472,7 @@
 
   @override
   Folder get parent {
-    String parentPath = posix.dirname(path);
+    String parentPath = _provider.pathContext.dirname(path);
     if (parentPath == path) {
       return null;
     }
@@ -473,7 +480,7 @@
   }
 
   @override
-  String get shortName => posix.basename(path);
+  String get shortName => _provider.pathContext.basename(path);
 
   @override
   bool operator ==(other) {
diff --git a/pkg/analyzer/lib/file_system/physical_file_system.dart b/pkg/analyzer/lib/file_system/physical_file_system.dart
index b8fdcf1..303d175 100644
--- a/pkg/analyzer/lib/file_system/physical_file_system.dart
+++ b/pkg/analyzer/lib/file_system/physical_file_system.dart
@@ -19,8 +19,8 @@
  * A `dart:io` based implementation of [ResourceProvider].
  */
 class PhysicalResourceProvider implements ResourceProvider {
-  static final NORMALIZE_EOL_ALWAYS =
-      (String string) => string.replaceAll(new RegExp('\r\n?'), '\n');
+  static final NORMALIZE_EOL_ALWAYS = (String string) =>
+      string.replaceAll(new RegExp('\r\n?'), '\n');
 
   static final PhysicalResourceProvider INSTANCE =
       new PhysicalResourceProvider(null);
diff --git a/pkg/analyzer/lib/instrumentation/instrumentation.dart b/pkg/analyzer/lib/instrumentation/instrumentation.dart
index ee3c747..18772de 100644
--- a/pkg/analyzer/lib/instrumentation/instrumentation.dart
+++ b/pkg/analyzer/lib/instrumentation/instrumentation.dart
@@ -150,12 +150,21 @@
    * entry has the given [level] and [message], and was created at the given
    * [time].
    */
-  void logLogEntry(String level, DateTime time, String message) {
+  void logLogEntry(String level, DateTime time, String message,
+      Object exception, StackTrace stackTrace) {
     if (_instrumentationServer != null) {
       String timeStamp =
           time == null ? 'null' : time.millisecondsSinceEpoch.toString();
-      _instrumentationServer
-          .log(_join([TAG_LOG_ENTRY, level, timeStamp, message]));
+      String exceptionText = exception.toString();
+      String stackTraceText = stackTrace.toString();
+      _instrumentationServer.log(_join([
+        TAG_LOG_ENTRY,
+        level,
+        timeStamp,
+        message,
+        exceptionText,
+        stackTraceText
+      ]));
     }
   }
 
diff --git a/pkg/analyzer/lib/plugin/options.dart b/pkg/analyzer/lib/plugin/options.dart
index cc0b88d..cec20c2 100644
--- a/pkg/analyzer/lib/plugin/options.dart
+++ b/pkg/analyzer/lib/plugin/options.dart
@@ -6,6 +6,8 @@
 /// analysis options file.
 library analyzer.plugin.options;
 
+import 'package:analyzer/src/generated/engine.dart';
+import 'package:analyzer/src/generated/error.dart';
 import 'package:analyzer/src/plugin/options_plugin.dart';
 import 'package:plugin/plugin.dart';
 import 'package:yaml/yaml.dart';
@@ -17,8 +19,17 @@
     OptionsPlugin.UNIQUE_IDENTIFIER,
     OptionsPlugin.OPTIONS_PROCESSOR_EXTENSION_POINT);
 
+/// The identifier of the extension point that allows plugins to validate
+/// options defined in the analysis options file. The object used as an
+/// extension must be an [OptionsValidator].
+final String OPTIONS_VALIDATOR_EXTENSION_POINT_ID = Plugin.join(
+    OptionsPlugin.UNIQUE_IDENTIFIER,
+    OptionsPlugin.OPTIONS_VALIDATOR_EXTENSION_POINT);
+
 /// Processes options defined in the analysis options file.
-/// 
+///
+/// Clients may implement this class when implementing plugins.
+///
 /// The options file format is intentionally very open-ended, giving clients
 /// utmost flexibility in defining their own options.  The only hardfast
 /// expectation is that options files will contain a mapping from Strings
@@ -45,17 +56,29 @@
 ///     bool useMultiPackage =
 ///         options['compiler']['resolver']['useMultiPackage'];
 abstract class OptionsProcessor {
-
   /// Called when an error occurs in processing options.
   void onError(Exception exception);
 
-  /// Called when the options file is processed.
+  /// Called when an options file is processed.
   ///
   /// The options file is processed on analyzer initialization and
   /// subsequently when the file is changed on disk.  In the event of a
   /// change notification, note that the notification simply indicates
   /// a change on disk. Content in specific option scopes may or may not
   /// be different. It is up to the implementer to check whether specific
-  /// options have changed and to handle those changes appropriately.
-  void optionsProcessed(Map<String, YamlNode> options);
+  /// options have changed and to handle those changes appropriately. In
+  /// addition to the [options] map, the associated analysis [context] is
+  /// provided as well to allow for context-specific configuration.
+  void optionsProcessed(AnalysisContext context, Map<String, YamlNode> options);
+}
+
+/// Validates options as defined in an analysis options file.
+///
+/// Clients may implement this class when implementing plugins.
+///
+/// See [OptionsProcessor] for a description of the options file format.
+///
+abstract class OptionsValidator {
+  /// Validate [options], reporting any errors to the given [reporter].
+  void validate(ErrorReporter reporter, Map<String, YamlNode> options);
 }
diff --git a/pkg/analyzer/lib/plugin/task.dart b/pkg/analyzer/lib/plugin/task.dart
index 8ea132f..d3eb4cd 100644
--- a/pkg/analyzer/lib/plugin/task.dart
+++ b/pkg/analyzer/lib/plugin/task.dart
@@ -8,14 +8,61 @@
  */
 library analyzer.plugin.task;
 
+import 'package:analyzer/src/generated/engine.dart' hide WorkManager;
 import 'package:analyzer/src/plugin/engine_plugin.dart';
 import 'package:analyzer/task/model.dart';
 import 'package:plugin/plugin.dart';
 
 /**
  * The identifier of the extension point that allows plugins to register new
+ * analysis error results to compute for a Dart source. The object used as an
+ * extension must be a [ResultDescriptor].
+ */
+final String DART_ERRORS_FOR_SOURCE_EXTENSION_POINT_ID = Plugin.join(
+    EnginePlugin.UNIQUE_IDENTIFIER,
+    EnginePlugin.DART_ERRORS_FOR_SOURCE_EXTENSION_POINT);
+
+/**
+ * The identifier of the extension point that allows plugins to register new
+ * analysis error results to compute for a Dart library specific unit. The
+ * object used as an extension must be a [ResultDescriptor].
+ */
+final String DART_ERRORS_FOR_UNIT_EXTENSION_POINT_ID = Plugin.join(
+    EnginePlugin.UNIQUE_IDENTIFIER,
+    EnginePlugin.DART_ERRORS_FOR_UNIT_EXTENSION_POINT);
+
+/**
+ * The identifier of the extension point that allows plugins to register new
+ * analysis error results to compute for an HTML source. The object used as an
+ * extension must be a [ResultDescriptor].
+ */
+final String HTML_ERRORS_EXTENSION_POINT_ID = Plugin.join(
+    EnginePlugin.UNIQUE_IDENTIFIER, EnginePlugin.HTML_ERRORS_EXTENSION_POINT);
+
+/**
+ * The identifier of the extension point that allows plugins to register new
  * analysis tasks with the analysis engine. The object used as an extension must
  * be a [TaskDescriptor].
+ *
+ * Contributed tasks should never extract information from Dart elements or AST
+ * (e.g. offsets) of a source and put it into results for targets in other
+ * sources. Dart elements and ASTs are updated during incremental resolution,
+ * and invalidation of results is intentionally limited by the source bounds
+ * for performance reasons.
  */
 final String TASK_EXTENSION_POINT_ID = Plugin.join(
     EnginePlugin.UNIQUE_IDENTIFIER, EnginePlugin.TASK_EXTENSION_POINT);
+
+/**
+ * The identifier of the extension point that allows plugins to register new
+ * work managers with the analysis engine. The object used as an extension must
+ * be a [WorkManagerFactory].
+ */
+final String WORK_MANAGER_EXTENSION_POINT_ID = Plugin.join(
+    EnginePlugin.UNIQUE_IDENTIFIER,
+    EnginePlugin.WORK_MANAGER_FACTORY_EXTENSION_POINT);
+
+/**
+ * A function that will create a new [WorkManager] for the given [context].
+ */
+typedef WorkManager WorkManagerFactory(InternalAnalysisContext context);
diff --git a/pkg/analyzer/lib/source/analysis_options_provider.dart b/pkg/analyzer/lib/source/analysis_options_provider.dart
index a3ac86b..29062a2 100644
--- a/pkg/analyzer/lib/source/analysis_options_provider.dart
+++ b/pkg/analyzer/lib/source/analysis_options_provider.dart
@@ -5,18 +5,17 @@
 library source.analysis_options_provider;
 
 import 'package:analyzer/file_system/file_system.dart';
+import 'package:analyzer/src/generated/engine.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 name of the analysis options source file.
-  static const String ANALYSIS_OPTIONS_NAME = '.analysis_options';
-
-  /// Provide the options found in [root]/[ANALYSIS_OPTIONS_NAME].
+  /// Provide the options found in [root]/[ANALYSIS_OPTIONS_FILE].
   /// Return an empty options map if the file does not exist.
   Map<String, YamlNode> getOptions(Folder root) {
-    var optionsSource =
-        _readAnalysisOptionsFile(root.getChild(ANALYSIS_OPTIONS_NAME));
+    var optionsSource = _readAnalysisOptionsFile(
+        root.getChild(AnalysisEngine.ANALYSIS_OPTIONS_FILE));
     return getOptionsFromString(optionsSource);
   }
 
@@ -34,17 +33,23 @@
     if (optionsSource == null) {
       return options;
     }
-    var doc = loadYaml(optionsSource);
-    if (doc is! YamlMap) {
-      throw new Exception(
-          'Bad options file format (expected map, got ${doc.runtimeType})');
+    YamlNode doc = loadYamlNode(optionsSource);
+    // Empty options.
+    if (doc is YamlScalar && doc.value == null) {
+      return options;
+    }
+    if ((doc != null) && (doc is! YamlMap)) {
+      throw new OptionsFormatException(
+          'Bad options file format (expected map, got ${doc.runtimeType})',
+          doc.span);
     }
     if (doc is YamlMap) {
       doc.forEach((k, v) {
         if (k is! String) {
-          throw new Exception(
+          throw new OptionsFormatException(
               'Bad options file format (expected String scope key, '
-              'got ${k.runtimeType})');
+              'got ${k.runtimeType})',
+              k != null ? k.span : doc.span);
         }
         options[k] = v;
       });
@@ -63,3 +68,14 @@
     }
   }
 }
+
+/// Thrown on options format exceptions.
+class OptionsFormatException implements Exception {
+  final String message;
+  final SourceSpan span;
+  OptionsFormatException(this.message, [this.span]);
+
+  @override
+  String toString() =>
+      'OptionsFormatException: ${message?.toString()}, ${span?.toString()}';
+}
diff --git a/pkg/analyzer/lib/source/path_filter.dart b/pkg/analyzer/lib/source/path_filter.dart
index f4123f8..40e81a6 100644
--- a/pkg/analyzer/lib/source/path_filter.dart
+++ b/pkg/analyzer/lib/source/path_filter.dart
@@ -5,13 +5,13 @@
 library source.path_filter;
 
 import 'package:glob/glob.dart' as glob;
-import 'package:path/path.dart';
+import 'package:path/path.dart' as path;
 
 /// Filter paths against a set of [ignorePatterns] relative to a [root]
 /// directory. Paths outside of [root] are also ignored.
 class PathFilter {
   /// The path context to use when manipulating paths.
-  final Context pathContext;
+  final path.Context pathContext;
 
   /// Path that all ignore patterns are relative to.
   final String root;
@@ -20,7 +20,9 @@
   final List<glob.Glob> _ignorePatterns = new List<glob.Glob>();
 
   /// Construct a new path filter rooted at [root] with [ignorePatterns].
-  PathFilter(this.pathContext, this.root, List<String> ignorePatterns) {
+  /// If [pathContext] is not specified, then the system path context is used.
+  PathFilter(this.root, List<String> ignorePatterns, [path.Context pathContext])
+      : this.pathContext = pathContext != null ? pathContext : path.context {
     setIgnorePatterns(ignorePatterns);
   }
 
diff --git a/pkg/analyzer/lib/source/pub_package_map_provider.dart b/pkg/analyzer/lib/source/pub_package_map_provider.dart
index 3e9936d..07fdba7 100644
--- a/pkg/analyzer/lib/source/pub_package_map_provider.dart
+++ b/pkg/analyzer/lib/source/pub_package_map_provider.dart
@@ -162,8 +162,8 @@
     String workingDirectory = folder.path;
     int subprocessId = AnalysisEngine.instance.instrumentationService
         .logSubprocessStart(executablePath, arguments, workingDirectory);
-    io.ProcessResult result = io.Process.runSync(executablePath, arguments,
-        workingDirectory: workingDirectory);
+    io.ProcessResult result = io.Process
+        .runSync(executablePath, arguments, workingDirectory: workingDirectory);
     AnalysisEngine.instance.instrumentationService.logSubprocessResult(
         subprocessId, result.exitCode, result.stdout, result.stderr);
     return result;
diff --git a/pkg/analyzer/lib/source/sdk_ext.dart b/pkg/analyzer/lib/source/sdk_ext.dart
index 7caad43..646a19f 100644
--- a/pkg/analyzer/lib/source/sdk_ext.dart
+++ b/pkg/analyzer/lib/source/sdk_ext.dart
@@ -27,7 +27,7 @@
   static const String SDK_EXT_NAME = '_sdkext';
   static const String DART_COLON_PREFIX = 'dart:';
 
-  final Map<String, String> _urlMappings = <String,String>{};
+  final Map<String, String> _urlMappings = <String, String>{};
 
   /// Construct a [SdkExtUriResolver] from a package map
   /// (see [PackageMapProvider]).
@@ -42,7 +42,7 @@
   int get length => _urlMappings.length;
 
   /// Return the path mapping for [libName] or null if there is none.
-  String operator[](String libName) => _urlMappings[libName];
+  String operator [](String libName) => _urlMappings[libName];
 
   /// Programmatically add a new SDK extension given a JSON description
   /// ([sdkExtJSON]) and a lib directory ([libDir]).
@@ -76,13 +76,25 @@
 
   @override
   Uri restoreAbsolute(Source source) {
-    String libraryName = _libraryName(source.uri);
-    if (_registeredSdkExtension(libraryName)) {
-      return source.uri;
+    String extensionName = _findExtensionNameFor(source.fullName);
+    if (extensionName != null) {
+      return Uri.parse(extensionName);
     }
+    // TODO(johnmccutchan): Handle restoring parts.
     return null;
   }
 
+  /// Return the extension name for [fullName] or `null`.
+  String _findExtensionNameFor(String fullName) {
+    var result;
+    _urlMappings.forEach((extensionName, pathMapping) {
+      if (pathMapping == fullName) {
+        result = extensionName;
+      }
+    });
+    return result;
+  }
+
   /// Return the library name of [importUri].
   String _libraryName(Uri importUri) {
     var uri = importUri.toString();
@@ -152,11 +164,6 @@
     }
   }
 
-  /// Returns true if [libraryName] is a registered sdk extension.
-  bool _registeredSdkExtension(String libraryName) {
-    return _urlMappings[libraryName] != null;
-  }
-
   /// Resolve an import of an sdk extension.
   Source _resolveEntry(Uri libraryEntry, Uri importUri) {
     // Library entry.
diff --git a/pkg/analyzer/lib/src/cancelable_future.dart b/pkg/analyzer/lib/src/cancelable_future.dart
index 4ec7b26..733cac5 100644
--- a/pkg/analyzer/lib/src/cancelable_future.dart
+++ b/pkg/analyzer/lib/src/cancelable_future.dart
@@ -259,8 +259,8 @@
   Future timeout(Duration timeLimit, {onTimeout()}) {
     // TODO(paulberry): Implement this in such a way that a timeout cancels
     // the future.
-    return _completer._outerCompleter.future.timeout(timeLimit,
-        onTimeout: onTimeout);
+    return _completer._outerCompleter.future
+        .timeout(timeLimit, onTimeout: onTimeout);
   }
 
   @override
diff --git a/pkg/analyzer/lib/src/codegen/html.dart b/pkg/analyzer/lib/src/codegen/html.dart
new file mode 100644
index 0000000..4307c5c
--- /dev/null
+++ b/pkg/analyzer/lib/src/codegen/html.dart
@@ -0,0 +1,138 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/**
+ * Tools for manipulating HTML during code generation of analyzer and analysis
+ * server.
+ */
+library analyzer.src.codegen.html;
+
+import 'package:html/dom.dart' as dom;
+
+/**
+ * Make a deep copy of the given HTML nodes.
+ */
+List<dom.Node> cloneHtmlNodes(List<dom.Node> nodes) =>
+    nodes.map((dom.Node node) => node.clone(true)).toList();
+
+/**
+ * Return true if the given iterable contains only whitespace text nodes.
+ */
+bool containsOnlyWhitespace(Iterable<dom.Node> nodes) {
+  for (dom.Node node in nodes) {
+    if (!isWhitespaceNode(node)) {
+      return false;
+    }
+  }
+  return true;
+}
+
+/**
+ * Get the text contents of the element, ignoring all markup.
+ */
+String innerText(dom.Element parent) {
+  StringBuffer buffer = new StringBuffer();
+  void recurse(dom.Element parent) {
+    for (dom.Node child in parent.nodes) {
+      if (child is dom.Text) {
+        buffer.write(child.text);
+      } else if (child is dom.Element) {
+        recurse(child);
+      }
+    }
+  }
+  recurse(parent);
+  return buffer.toString();
+}
+
+/**
+ * Return true if the given node is a text node containing only whitespace, or
+ * a comment.
+ */
+bool isWhitespaceNode(dom.Node node) {
+  if (node is dom.Element) {
+    return false;
+  } else if (node is dom.Text) {
+    return node.text.trim().isEmpty;
+  }
+  // Treat all other types of nodes (e.g. comments) as whitespace.
+  return true;
+}
+
+/**
+ * Create an HTML element with the given name, attributes, and child nodes.
+ */
+dom.Element makeElement(
+    String name, Map<dynamic, String> attributes, List<dom.Node> children) {
+  dom.Element result = new dom.Element.tag(name);
+  result.attributes.addAll(attributes);
+  for (dom.Node child in children) {
+    result.append(child);
+  }
+  return result;
+}
+
+/**
+ * Mixin class for generating HTML.
+ */
+class HtmlGenerator {
+  List<dom.Node> _html;
+
+  /**
+   * Add the given [node] to the HTML output.
+   */
+  void add(dom.Node node) {
+    _html.add(node);
+  }
+
+  /**
+   * Add the given [nodes] to the HTML output.
+   */
+  void addAll(Iterable<dom.Node> nodes) {
+    for (dom.Node node in nodes) {
+      add(node);
+    }
+  }
+
+  /**
+   * Execute [callback], collecting any code that is output using [write],
+   * [writeln], [add], [addAll] or [element], and return the result as a list
+   * of HTML nodes.
+   */
+  List<dom.Node> collectHtml(void callback()) {
+    List<dom.Node> oldHtml = _html;
+    try {
+      _html = <dom.Node>[];
+      if (callback != null) {
+        callback();
+      }
+      return _html;
+    } finally {
+      _html = oldHtml;
+    }
+  }
+
+  /**
+   * Execute [callback], wrapping its output in an element with the given
+   * [name] and [attributes].
+   */
+  void element(String name, Map<dynamic, String> attributes,
+      [void callback()]) {
+    add(makeElement(name, attributes, collectHtml(callback)));
+  }
+
+  /**
+   * Output text without ending the current line.
+   */
+  void write(String text) {
+    _html.add(new dom.Text(text));
+  }
+
+  /**
+   * Output text, ending the current line.
+   */
+  void writeln([Object obj = '']) {
+    write('$obj\n');
+  }
+}
diff --git a/pkg/analyzer/lib/src/codegen/text_formatter.dart b/pkg/analyzer/lib/src/codegen/text_formatter.dart
new file mode 100644
index 0000000..28669e0
--- /dev/null
+++ b/pkg/analyzer/lib/src/codegen/text_formatter.dart
@@ -0,0 +1,247 @@
+// 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.
+
+/**
+ * Code for converting HTML into text, for use during code generation of
+ * analyzer and analysis server.
+ */
+library analyzer.src.codegen.text_formatter;
+
+import 'package:html/dom.dart' as dom;
+
+import 'tools.dart';
+
+final RegExp whitespace = new RegExp(r'\s');
+
+/**
+ * Convert the HTML in [desc] into text, word wrapping at width [width].
+ *
+ * If [javadocStyle] is true, then the output is compatable with Javadoc,
+ * which understands certain HTML constructs.
+ */
+String nodesToText(List<dom.Node> desc, int width, bool javadocStyle,
+    {bool removeTrailingNewLine: false}) {
+  _TextFormatter formatter = new _TextFormatter(width, javadocStyle);
+  return formatter.collectCode(() {
+    formatter.addAll(desc);
+    formatter.lineBreak(false);
+  }, removeTrailingNewLine: removeTrailingNewLine);
+}
+
+/**
+ * Engine that transforms HTML to text.  The input HTML is processed one
+ * character at a time, gathering characters into words and words into lines.
+ */
+class _TextFormatter extends CodeGenerator {
+  /**
+   * Word-wrapping width.
+   */
+  final int width;
+
+  /**
+   * The word currently being gathered.
+   */
+  String word = '';
+
+  /**
+   * The line currently being gathered.
+   */
+  String line = '';
+
+  /**
+   * True if a blank line should be inserted before the next word.
+   */
+  bool verticalSpaceNeeded = false;
+
+  /**
+   * True if no text has been output yet.  This suppresses blank lines.
+   */
+  bool atStart = true;
+
+  /**
+   * True if we are processing a <pre> element, thus whitespace should be
+   * preserved.
+   */
+  bool preserveSpaces = false;
+
+  /**
+   * True if the output should be Javadoc compatible.
+   */
+  final bool javadocStyle;
+
+  _TextFormatter(this.width, this.javadocStyle);
+
+  /**
+   * Process an HTML node.
+   */
+  void add(dom.Node node) {
+    if (node is dom.Text) {
+      for (String char in node.text.split('')) {
+        if (preserveSpaces) {
+          wordBreak();
+          write(escape(char));
+        } else if (whitespace.hasMatch(char)) {
+          wordBreak();
+        } else {
+          resolveVerticalSpace();
+          word += escape(char);
+        }
+      }
+    } else if (node is dom.Element) {
+      switch (node.localName) {
+        case 'br':
+          lineBreak(false);
+          break;
+        case 'dl':
+        case 'dt':
+        case 'h1':
+        case 'h2':
+        case 'h3':
+        case 'h4':
+        case 'p':
+          lineBreak(true);
+          addAll(node.nodes);
+          lineBreak(true);
+          break;
+        case 'div':
+          lineBreak(false);
+          if (node.classes.contains('hangingIndent')) {
+            resolveVerticalSpace();
+            indentSpecial('', '        ', () {
+              addAll(node.nodes);
+              lineBreak(false);
+            });
+          } else {
+            addAll(node.nodes);
+            lineBreak(false);
+          }
+          break;
+        case 'ul':
+          lineBreak(false);
+          addAll(node.nodes);
+          lineBreak(false);
+          break;
+        case 'li':
+          lineBreak(false);
+          resolveVerticalSpace();
+          indentSpecial('- ', '  ', () {
+            addAll(node.nodes);
+            lineBreak(false);
+          });
+          break;
+        case 'dd':
+          lineBreak(true);
+          indent(() {
+            addAll(node.nodes);
+            lineBreak(true);
+          });
+          break;
+        case 'pre':
+          lineBreak(false);
+          resolveVerticalSpace();
+          if (javadocStyle) {
+            writeln('<pre>');
+          }
+          bool oldPreserveSpaces = preserveSpaces;
+          try {
+            preserveSpaces = true;
+            addAll(node.nodes);
+          } finally {
+            preserveSpaces = oldPreserveSpaces;
+          }
+          writeln();
+          if (javadocStyle) {
+            writeln('</pre>');
+          }
+          lineBreak(false);
+          break;
+        case 'a':
+        case 'b':
+        case 'body':
+        case 'html':
+        case 'i':
+        case 'span':
+        case 'tt':
+          addAll(node.nodes);
+          break;
+        case 'head':
+          break;
+        default:
+          throw new Exception('Unexpected HTML element: ${node.localName}');
+      }
+    } else {
+      throw new Exception('Unexpected HTML: $node');
+    }
+  }
+
+  /**
+   * Process a list of HTML nodes.
+   */
+  void addAll(List<dom.Node> nodes) {
+    for (dom.Node node in nodes) {
+      add(node);
+    }
+  }
+
+  /**
+   * Escape the given character for HTML.
+   */
+  String escape(String char) {
+    if (javadocStyle) {
+      switch (char) {
+        case '<':
+          return '&lt;';
+        case '>':
+          return '&gt;';
+        case '&':
+          return '&amp;';
+      }
+    }
+    return char;
+  }
+
+  /**
+   * Terminate the current word and/or line, if either is in progress.
+   */
+  void lineBreak(bool gap) {
+    wordBreak();
+    if (line.isNotEmpty) {
+      writeln(line);
+      line = '';
+    }
+    if (gap && !atStart) {
+      verticalSpaceNeeded = true;
+    }
+  }
+
+  /**
+   * Insert vertical space if necessary.
+   */
+  void resolveVerticalSpace() {
+    if (verticalSpaceNeeded) {
+      writeln();
+      verticalSpaceNeeded = false;
+    }
+  }
+
+  /**
+   * Terminate the current word, if a word is in progress.
+   */
+  void wordBreak() {
+    if (word.isNotEmpty) {
+      atStart = false;
+      if (line.isNotEmpty) {
+        if (indentWidth + line.length + 1 + word.length <= width) {
+          line += ' $word';
+        } else {
+          writeln(line);
+          line = word;
+        }
+      } else {
+        line = word;
+      }
+      word = '';
+    }
+  }
+}
diff --git a/pkg/analyzer/lib/src/codegen/tools.dart b/pkg/analyzer/lib/src/codegen/tools.dart
new file mode 100644
index 0000000..3b2115d
--- /dev/null
+++ b/pkg/analyzer/lib/src/codegen/tools.dart
@@ -0,0 +1,557 @@
+// 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.
+
+/**
+ * Tools for generating code in analyzer and analysis server.
+ */
+library analyzer.src.codegen.tools;
+
+import 'dart:io';
+
+import 'package:html/dom.dart' as dom;
+import 'package:path/path.dart';
+
+import 'html.dart';
+import 'text_formatter.dart';
+
+final RegExp trailingWhitespaceRegExp = new RegExp(r'[\n ]+$');
+final RegExp trailingSpacesInLineRegExp = new RegExp(r' +$', multiLine: true);
+
+/**
+ * Join the given strings using camelCase.  If [doCapitalize] is true, the first
+ * part will be capitalized as well.
+ */
+String camelJoin(List<String> parts, {bool doCapitalize: false}) {
+  List<String> upcasedParts = <String>[];
+  for (int i = 0; i < parts.length; i++) {
+    if (i == 0 && !doCapitalize) {
+      upcasedParts.add(parts[i]);
+    } else {
+      upcasedParts.add(capitalize(parts[i]));
+    }
+  }
+  return upcasedParts.join();
+}
+
+/**
+ * Capitalize and return the passed String.
+ */
+String capitalize(String string) {
+  return string[0].toUpperCase() + string.substring(1);
+}
+
+/**
+ * Type of functions used to compute the contents of a set of generated files.
+ */
+typedef Map<String, FileContentsComputer> DirectoryContentsComputer();
+
+/**
+ * Type of functions used to compute the contents of a generated file.
+ */
+typedef String FileContentsComputer();
+
+/**
+ * Mixin class for generating code.
+ */
+class CodeGenerator {
+  _CodeGeneratorState _state;
+
+  /**
+   * Settings that specialize code generation behavior for a given
+   * programming language.
+   */
+  CodeGeneratorSettings codeGeneratorSettings = new CodeGeneratorSettings();
+
+  /**
+   * Measure the width of the current indentation level.
+   */
+  int get indentWidth => _state.nextIndent.length;
+
+  /**
+   * Execute [callback], collecting any code that is output using [write]
+   * or [writeln], and return the result as a string.
+   */
+  String collectCode(void callback(), {bool removeTrailingNewLine: false}) {
+    _CodeGeneratorState oldState = _state;
+    try {
+      _state = new _CodeGeneratorState();
+      callback();
+      var text =
+          _state.buffer.toString().replaceAll(trailingSpacesInLineRegExp, '');
+      if (!removeTrailingNewLine) {
+        return text;
+      } else {
+        return text.replaceAll(trailingWhitespaceRegExp, '');
+      }
+    } finally {
+      _state = oldState;
+    }
+  }
+
+  /**
+   * Generate a doc comment based on the HTML in [docs].
+   *
+   * When generating java code, the output is compatible with Javadoc, which
+   * understands certain HTML constructs.
+   */
+  void docComment(List<dom.Node> docs, {bool removeTrailingNewLine: false}) {
+    if (containsOnlyWhitespace(docs)) return;
+    writeln(codeGeneratorSettings.docCommentStartMarker);
+    int width = codeGeneratorSettings.commentLineLength;
+    bool javadocStyle = codeGeneratorSettings.languageName == 'java';
+    indentBy(codeGeneratorSettings.docCommentLineLeader, () {
+      write(nodesToText(docs, width - _state.indent.length, javadocStyle,
+          removeTrailingNewLine: removeTrailingNewLine));
+    });
+    writeln(codeGeneratorSettings.docCommentEndMarker);
+  }
+
+  /**
+   * Execute [callback], indenting any code it outputs.
+   */
+  void indent(void callback()) {
+    indentSpecial(
+        codeGeneratorSettings.indent, codeGeneratorSettings.indent, callback);
+  }
+
+  /**
+   * Execute [callback], using [additionalIndent] to indent any code it outputs.
+   */
+  void indentBy(String additionalIndent, void callback()) =>
+      indentSpecial(additionalIndent, additionalIndent, callback);
+
+  /**
+   * Execute [callback], using [additionalIndent] to indent any code it outputs.
+   * The first line of output is indented by [firstAdditionalIndent] instead of
+   * [additionalIndent].
+   */
+  void indentSpecial(
+      String firstAdditionalIndent, String additionalIndent, void callback()) {
+    String oldNextIndent = _state.nextIndent;
+    String oldIndent = _state.indent;
+    try {
+      _state.nextIndent += firstAdditionalIndent;
+      _state.indent += additionalIndent;
+      callback();
+    } finally {
+      _state.nextIndent = oldNextIndent;
+      _state.indent = oldIndent;
+    }
+  }
+
+  void lineComment(List<dom.Node> docs) {
+    if (containsOnlyWhitespace(docs)) {
+      return;
+    }
+    write(codeGeneratorSettings.lineCommentLineLeader);
+    int width = codeGeneratorSettings.commentLineLength;
+    indentBy(codeGeneratorSettings.lineCommentLineLeader, () {
+      write(nodesToText(docs, width - _state.indent.length, false));
+    });
+  }
+
+  void outputHeader({bool javaStyle: false}) {
+    String header;
+    if (codeGeneratorSettings.languageName == 'java') {
+      header = '''
+/*
+ * Copyright (c) 2014, the Dart project authors.
+ *
+ * Licensed under the Eclipse Public License v1.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.eclipse.org/legal/epl-v10.html
+ *
+ * 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.
+ *
+ * This file has been automatically generated.  Please do not edit it manually.
+ * To regenerate the file, use the script "pkg/analysis_server/tool/spec/generate_files".
+ */''';
+    } else if (codeGeneratorSettings.languageName == 'python') {
+      header = '''
+# Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+# for details. All rights reserved. Use of this source code is governed by a
+# BSD-style license that can be found in the LICENSE file.
+#
+# This file has been automatically generated.  Please do not edit it manually.
+# To regenerate the file, use the script
+# "pkg/analysis_server/tool/spec/generate_files".
+''';
+    } else {
+      header = '''
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+//
+// This file has been automatically generated.  Please do not edit it manually.
+// To regenerate the file, use the script
+// "pkg/analysis_server/tool/spec/generate_files".
+''';
+    }
+    writeln(header.trim());
+  }
+
+  /**
+   * Output text without ending the current line.
+   */
+  void write(Object obj) {
+    _state.write(obj.toString());
+  }
+
+  /**
+   * Output text, ending the current line.
+   */
+  void writeln([Object obj = '']) {
+    _state.write('$obj\n');
+  }
+}
+
+/**
+ * Controls several settings of [CodeGenerator].
+ *
+ * The default settings are valid for generating Java and Dart code.
+ */
+class CodeGeneratorSettings {
+  /**
+   * Name of the language being generated. Lowercase.
+   */
+  String languageName;
+
+  /**
+   * Marker used in line comments.
+   */
+  String lineCommentLineLeader;
+
+  /**
+   * Start marker for doc comments.
+   */
+  String docCommentStartMarker;
+
+  /**
+   * Line leader for body lines in doc comments.
+   */
+  String docCommentLineLeader;
+
+  /**
+   * End marker for doc comments.
+   */
+  String docCommentEndMarker;
+
+  /**
+   * Line length for doc comment lines.
+   */
+  int commentLineLength;
+
+  /**
+   * String used for indenting code.
+   */
+  String indent;
+
+  CodeGeneratorSettings(
+      {this.languageName: 'java',
+      this.lineCommentLineLeader: '// ',
+      this.docCommentStartMarker: '/**',
+      this.docCommentLineLeader: ' * ',
+      this.docCommentEndMarker: ' */',
+      this.commentLineLength: 99,
+      this.indent: '  '});
+}
+
+abstract class GeneratedContent {
+  FileSystemEntity get outputFile;
+  bool check();
+  void generate();
+}
+
+/**
+ * Class representing a single output directory (either generated code or
+ * generated HTML). No other content should exist in the directory.
+ */
+class GeneratedDirectory extends GeneratedContent {
+  /**
+   * The path to the directory that will have the generated content.
+   */
+  final String outputDirPath;
+
+  /**
+   * Callback function that computes the directory contents.
+   */
+  final DirectoryContentsComputer directoryContentsComputer;
+
+  GeneratedDirectory(this.outputDirPath, this.directoryContentsComputer);
+
+  /**
+   * Get a Directory object representing the output directory.
+   */
+  Directory get outputFile =>
+      new Directory(joinAll(posix.split(outputDirPath)));
+
+  /**
+   * Check whether the directory has the correct contents, and return true if it
+   * does.
+   */
+  @override
+  bool check() {
+    Map<String, FileContentsComputer> map = directoryContentsComputer();
+    try {
+      for (String file in map.keys) {
+        FileContentsComputer fileContentsComputer = map[file];
+        String expectedContents = fileContentsComputer();
+        File outputFile =
+            new File(joinAll(posix.split(posix.join(outputDirPath, file))));
+        String actualContents = outputFile.readAsStringSync();
+        // Normalize Windows line endings to Unix line endings so that the
+        // comparison doesn't fail on Windows.
+        actualContents = actualContents.replaceAll('\r\n', '\n');
+        if (expectedContents != actualContents) {
+          return false;
+        }
+      }
+      int nonHiddenFileCount = 0;
+      outputFile
+          .listSync(recursive: false, followLinks: false)
+          .forEach((FileSystemEntity fileSystemEntity) {
+        if (fileSystemEntity is File &&
+            !basename(fileSystemEntity.path).startsWith('.')) {
+          nonHiddenFileCount++;
+        }
+      });
+      if (nonHiddenFileCount != map.length) {
+        // The number of files generated doesn't match the number we expected to
+        // generate.
+        return false;
+      }
+    } catch (e) {
+      // There was a problem reading the file (most likely because it didn't
+      // exist).  Treat that the same as if the file doesn't have the expected
+      // contents.
+      return false;
+    }
+    return true;
+  }
+
+  /**
+   * Replace the directory with the correct contents.  [spec] is the "tool/spec"
+   * directory.  If [spec] is unspecified, it is assumed to be the directory
+   * containing Platform.executable.
+   */
+  @override
+  void generate() {
+    try {
+      // delete the contents of the directory (and the directory itself)
+      outputFile.deleteSync(recursive: true);
+    } catch (e) {
+      // Error caught while trying to delete the directory, this can happen if
+      // it didn't yet exist.
+    }
+    // re-create the empty directory
+    outputFile.createSync(recursive: true);
+
+    // generate all of the files in the directory
+    Map<String, FileContentsComputer> map = directoryContentsComputer();
+    map.forEach((String file, FileContentsComputer fileContentsComputer) {
+      File outputFile = new File(joinAll(posix.split(outputDirPath + file)));
+      outputFile.writeAsStringSync(fileContentsComputer());
+    });
+  }
+}
+
+/**
+ * Class representing a single output file (either generated code or generated
+ * HTML).
+ */
+class GeneratedFile extends GeneratedContent {
+  /**
+   * The output file to which generated output should be written, relative to
+   * the "tool/spec" directory.  This filename uses the posix path separator
+   * ('/') regardless of the OS.
+   */
+  final String outputPath;
+
+  /**
+   * Callback function which computes the file.
+   */
+  final FileContentsComputer computeContents;
+
+  GeneratedFile(this.outputPath, this.computeContents);
+
+  /**
+   * Get a File object representing the output file.
+   */
+  File get outputFile => new File(joinAll(posix.split(outputPath)));
+
+  /**
+   * Check whether the file has the correct contents, and return true if it
+   * does.
+   */
+  @override
+  bool check() {
+    String expectedContents = computeContents();
+    try {
+      String actualContents = outputFile.readAsStringSync();
+      // Normalize Windows line endings to Unix line endings so that the
+      // comparison doesn't fail on Windows.
+      actualContents = actualContents.replaceAll('\r\n', '\n');
+      return expectedContents == actualContents;
+    } catch (e) {
+      // There was a problem reading the file (most likely because it didn't
+      // exist).  Treat that the same as if the file doesn't have the expected
+      // contents.
+      return false;
+    }
+  }
+
+  /**
+   * Replace the file with the correct contents.  [spec] is the "tool/spec"
+   * directory.  If [spec] is unspecified, it is assumed to be the directory
+   * containing Platform.executable.
+   */
+  void generate() {
+    outputFile.writeAsStringSync(computeContents());
+  }
+}
+
+/**
+ * Mixin class for generating HTML representations of code that are suitable
+ * for enclosing inside a <pre> element.
+ */
+abstract class HtmlCodeGenerator {
+  _HtmlCodeGeneratorState _state;
+
+  /**
+   * Add the given [node] to the HTML output.
+   */
+  void add(dom.Node node) {
+    _state.add(node);
+  }
+
+  /**
+   * Add the given [nodes] to the HTML output.
+   */
+  void addAll(Iterable<dom.Node> nodes) {
+    for (dom.Node node in nodes) {
+      _state.add(node);
+    }
+  }
+
+  /**
+   * Execute [callback], collecting any code that is output using [write],
+   * [writeln], [add], or [addAll], and return the result as a list of DOM
+   * nodes.
+   */
+  List<dom.Node> collectHtml(void callback()) {
+    _HtmlCodeGeneratorState oldState = _state;
+    try {
+      _state = new _HtmlCodeGeneratorState();
+      if (callback != null) {
+        callback();
+      }
+      return _state.buffer;
+    } finally {
+      _state = oldState;
+    }
+  }
+
+  /**
+   * Execute [callback], wrapping its output in an element with the given
+   * [name] and [attributes].
+   */
+  void element(String name, Map<String, String> attributes, [void callback()]) {
+    add(makeElement(name, attributes, collectHtml(callback)));
+  }
+
+  /**
+   * Execute [callback], indenting any code it outputs by two spaces.
+   */
+  void indent(void callback()) {
+    String oldIndent = _state.indent;
+    try {
+      _state.indent += '  ';
+      callback();
+    } finally {
+      _state.indent = oldIndent;
+    }
+  }
+
+  /**
+   * Output text without ending the current line.
+   */
+  void write(Object obj) {
+    _state.write(obj.toString());
+  }
+
+  /**
+   * Output text, ending the current line.
+   */
+  void writeln([Object obj = '']) {
+    _state.write('$obj\n');
+  }
+}
+
+/**
+ * State used by [CodeGenerator].
+ */
+class _CodeGeneratorState {
+  StringBuffer buffer = new StringBuffer();
+  String nextIndent = '';
+  String indent = '';
+  bool indentNeeded = true;
+
+  void write(String text) {
+    List<String> lines = text.split('\n');
+    for (int i = 0; i < lines.length; i++) {
+      if (i == lines.length - 1 && lines[i].isEmpty) {
+        break;
+      }
+      if (indentNeeded) {
+        buffer.write(nextIndent);
+        nextIndent = indent;
+      }
+      indentNeeded = false;
+      buffer.write(lines[i]);
+      if (i != lines.length - 1) {
+        buffer.writeln();
+        indentNeeded = true;
+      }
+    }
+  }
+}
+
+/**
+ * State used by [HtmlCodeGenerator].
+ */
+class _HtmlCodeGeneratorState {
+  List<dom.Node> buffer = <dom.Node>[];
+  String indent = '';
+  bool indentNeeded = true;
+
+  void add(dom.Node node) {
+    if (node is dom.Text) {
+      write(node.text);
+    } else {
+      buffer.add(node);
+    }
+  }
+
+  void write(String text) {
+    if (text.isEmpty) {
+      return;
+    }
+    if (indentNeeded) {
+      buffer.add(new dom.Text(indent));
+    }
+    List<String> lines = text.split('\n');
+    if (lines.last.isEmpty) {
+      lines.removeLast();
+      buffer.add(new dom.Text(lines.join('\n$indent') + '\n'));
+      indentNeeded = true;
+    } else {
+      buffer.add(new dom.Text(lines.join('\n$indent')));
+      indentNeeded = false;
+    }
+  }
+}
diff --git a/pkg/analyzer/lib/src/context/cache.dart b/pkg/analyzer/lib/src/context/cache.dart
index c12262d..a609421 100644
--- a/pkg/analyzer/lib/src/context/cache.dart
+++ b/pkg/analyzer/lib/src/context/cache.dart
@@ -12,7 +12,6 @@
 import 'package:analyzer/src/generated/java_engine.dart';
 import 'package:analyzer/src/generated/source.dart';
 import 'package:analyzer/src/generated/utilities_collection.dart';
-import 'package:analyzer/src/generated/utilities_general.dart';
 import 'package:analyzer/src/task/model.dart';
 import 'package:analyzer/task/model.dart';
 
@@ -39,28 +38,37 @@
   /**
    * The [StreamController] reporting [InvalidatedResult]s.
    */
-  final StreamController<InvalidatedResult> _onResultInvalidated =
-      new StreamController<InvalidatedResult>.broadcast(sync: true);
+  final ReentrantSynchronousStream<InvalidatedResult> onResultInvalidated =
+      new ReentrantSynchronousStream<InvalidatedResult>();
+
+  final List<
+      ReentrantSynchronousStreamSubscription> onResultInvalidatedPartitionSubscriptions = <
+      ReentrantSynchronousStreamSubscription>[];
 
   /**
-   * Initialize a newly created cache to have the given [partitions]. The
+   * Initialize a newly created cache to have the given [_partitions]. The
    * partitions will be searched in the order in which they appear in the array,
    * so the most specific partition (usually an [SdkCachePartition]) should be
    * first and the most general (usually a [UniversalCachePartition]) last.
    */
   AnalysisCache(this._partitions) {
     for (CachePartition partition in _partitions) {
-      partition.onResultInvalidated.listen((InvalidatedResult event) {
-        _onResultInvalidated.add(event);
+      ReentrantSynchronousStreamSubscription<InvalidatedResult> subscription =
+          partition.onResultInvalidated.listen((InvalidatedResult event) {
+        onResultInvalidated.add(event);
       });
+      onResultInvalidatedPartitionSubscriptions.add(subscription);
     }
   }
 
   /**
-   * Return the stream that is notified when a value is invalidated.
+   * Return an iterator returning all of the [Source] targets.
    */
-  Stream<InvalidatedResult> get onResultInvalidated =>
-      _onResultInvalidated.stream;
+  Iterable<Source> get sources {
+    return _partitions
+        .map((CachePartition partition) => partition._sources)
+        .expand((Iterable<Source> sources) => sources);
+  }
 
   // TODO(brianwilkerson) Implement or delete this.
 //  /**
@@ -80,12 +88,13 @@
 //  }
 
   /**
-   * Return an iterator returning all of the [Source] targets.
+   * Free any allocated resources and references.
    */
-  Iterable<Source> get sources {
-    return _partitions
-        .map((CachePartition partition) => partition._sources)
-        .expand((Iterable<Source> sources) => sources);
+  void dispose() {
+    for (ReentrantSynchronousStreamSubscription subscription
+        in onResultInvalidatedPartitionSubscriptions) {
+      subscription.cancel();
+    }
   }
 
   /**
@@ -173,14 +182,17 @@
 
   /**
    * Return an iterator returning all of the map entries mapping targets to
-   * cache entries.
+   * cache entries. If the [context] is not `null`, then only entries that are
+   * owned by the given context will be returned.
    */
-  MapIterator<AnalysisTarget, CacheEntry> iterator() {
-    int count = _partitions.length;
+  MapIterator<AnalysisTarget, CacheEntry> iterator(
+      {InternalAnalysisContext context: null}) {
     List<Map<AnalysisTarget, CacheEntry>> maps =
-        new List<Map<AnalysisTarget, CacheEntry>>(count);
-    for (int i = 0; i < count; i++) {
-      maps[i] = _partitions[i].map;
+        <Map<AnalysisTarget, CacheEntry>>[];
+    for (CachePartition partition in _partitions) {
+      if (context == null || partition.context == context) {
+        maps.add(partition.map);
+      }
     }
     return new MultipleMapIterator<AnalysisTarget, CacheEntry>(maps);
   }
@@ -259,6 +271,11 @@
   static int _EXPLICITLY_ADDED_FLAG = 0;
 
   /**
+   * The next invalidation process identifier.
+   */
+  static int nextInvalidateId = 0;
+
+  /**
    * The target this entry is about.
    */
   final AnalysisTarget target;
@@ -447,7 +464,7 @@
     if (state == CacheState.INVALID) {
       ResultData data = _resultMap[descriptor];
       if (data != null) {
-        _invalidate(descriptor, delta);
+        _invalidate(nextInvalidateId++, descriptor, delta, 0);
       }
     } else {
       ResultData data = getResultData(descriptor);
@@ -466,8 +483,11 @@
    * Set the value of the result represented by the given [descriptor] to the
    * given [value].
    */
-  /*<V>*/ void setValue(ResultDescriptor /*<V>*/ descriptor, dynamic /*V*/
-      value, List<TargetedResult> dependedOn) {
+  /*<V>*/ void setValue(
+      ResultDescriptor /*<V>*/ descriptor,
+      dynamic /*V*/
+      value,
+      List<TargetedResult> dependedOn) {
 //    {
 //      String valueStr = '$value';
 //      if (valueStr.length > 20) {
@@ -492,11 +512,14 @@
    * Set the value of the result represented by the given [descriptor] to the
    * given [value], keep its dependency, invalidate all the dependent result.
    */
-  void setValueIncremental(ResultDescriptor descriptor, dynamic value) {
+  void setValueIncremental(
+      ResultDescriptor descriptor, dynamic value, bool invalidateDependent) {
     ResultData data = getResultData(descriptor);
-    List<TargetedResult> dependedOn = data.dependedOnResults;
-    _invalidate(descriptor, null);
-    setValue(descriptor, value, dependedOn);
+    data.state = CacheState.VALID;
+    data.value = value;
+    if (invalidateDependent) {
+      _invalidateDependentResults(nextInvalidateId++, data, null, 0);
+    }
   }
 
   @override
@@ -515,50 +538,57 @@
    * Invalidate the result represented by the given [descriptor] and propagate
    * invalidation to other results that depend on it.
    */
-  void _invalidate(ResultDescriptor descriptor, Delta delta) {
+  void _invalidate(
+      int id, ResultDescriptor descriptor, Delta delta, int level) {
+    ResultData thisData = _resultMap[descriptor];
+    if (thisData == null) {
+      return;
+    }
+    // Stop if already validated.
+    if (delta != null) {
+      if (thisData.invalidateId == id) {
+        return;
+      }
+      thisData.invalidateId = id;
+    }
+    // Ask the delta to validate.
     DeltaResult deltaResult = null;
     if (delta != null) {
       deltaResult = delta.validate(_partition.context, target, descriptor);
       if (deltaResult == DeltaResult.STOP) {
-//        print('not-invalidate $descriptor for $target');
         return;
       }
     }
-//    print('invalidate $descriptor for $target');
-    ResultData thisData;
-    if (deltaResult == null || deltaResult == DeltaResult.INVALIDATE) {
-      thisData = _resultMap.remove(descriptor);
+    if (deltaResult == DeltaResult.INVALIDATE_NO_DELTA) {
+      delta = null;
     }
-    if (deltaResult == DeltaResult.KEEP_CONTINUE) {
-      thisData = _resultMap[descriptor];
-    }
-    if (thisData == null) {
-      return;
+    if (deltaResult == null ||
+        deltaResult == DeltaResult.INVALIDATE ||
+        deltaResult == DeltaResult.INVALIDATE_NO_DELTA) {
+      _resultMap.remove(descriptor);
+//      {
+//        String indent = '  ' * level;
+//        print('[$id]$indent invalidate $descriptor for $target');
+//      }
     }
     // Stop depending on other results.
     TargetedResult thisResult = new TargetedResult(target, descriptor);
     for (TargetedResult dependedOnResult in thisData.dependedOnResults) {
       ResultData data = _partition._getDataFor(dependedOnResult);
-      if (data != null) {
+      if (data != null && deltaResult != DeltaResult.KEEP_CONTINUE) {
         data.dependentResults.remove(thisResult);
       }
     }
     // Invalidate results that depend on this result.
-    List<TargetedResult> dependentResults = thisData.dependentResults.toList();
-    for (TargetedResult dependentResult in dependentResults) {
-      CacheEntry entry = _partition.get(dependentResult.target);
-      if (entry != null) {
-        entry._invalidate(dependentResult.result, delta);
-      }
-    }
-    // If empty, remove the entry altogether.
-    if (_resultMap.isEmpty) {
+    _invalidateDependentResults(id, thisData, delta, level + 1);
+    // If empty and not explicitly added, remove the entry altogether.
+    if (_resultMap.isEmpty && !explicitlyAdded) {
       _partition._targetMap.remove(target);
       _partition._removeIfSource(target);
     }
     // Notify controller.
-    _partition._onResultInvalidated
-        .add(new InvalidatedResult(this, descriptor));
+    _partition.onResultInvalidated
+        .add(new InvalidatedResult(this, descriptor, thisData.value));
   }
 
   /**
@@ -567,7 +597,21 @@
   void _invalidateAll() {
     List<ResultDescriptor> results = _resultMap.keys.toList();
     for (ResultDescriptor result in results) {
-      _invalidate(result, null);
+      _invalidate(nextInvalidateId++, result, null, 0);
+    }
+  }
+
+  /**
+   * Invalidate results that depend on [thisData].
+   */
+  void _invalidateDependentResults(
+      int id, ResultData thisData, Delta delta, int level) {
+    List<TargetedResult> dependentResults = thisData.dependentResults.toList();
+    for (TargetedResult dependentResult in dependentResults) {
+      CacheEntry entry = _partition.get(dependentResult.target);
+      if (entry != null) {
+        entry._invalidate(id, dependentResult.result, delta, level);
+      }
     }
   }
 
@@ -805,8 +849,8 @@
   /**
    * The [StreamController] reporting [InvalidatedResult]s.
    */
-  final StreamController<InvalidatedResult> _onResultInvalidated =
-      new StreamController<InvalidatedResult>.broadcast(sync: true);
+  final ReentrantSynchronousStream<InvalidatedResult> onResultInvalidated =
+      new ReentrantSynchronousStream<InvalidatedResult>();
 
   /**
    * A table mapping the targets belonging to this partition to the information
@@ -841,12 +885,6 @@
   Map<AnalysisTarget, CacheEntry> get map => _targetMap;
 
   /**
-   * Return the stream that is notified when a value is invalidated.
-   */
-  Stream<InvalidatedResult> get onResultInvalidated =>
-      _onResultInvalidated.stream;
-
-  /**
    * Notifies the partition that the client is going to stop using it.
    */
   void dispose() {
@@ -953,10 +991,8 @@
   void _addIfSource(AnalysisTarget target) {
     if (target is Source) {
       _sources.add(target);
-      {
-        String fullName = target.fullName;
-        _pathToSources.putIfAbsent(fullName, () => <Source>[]).add(target);
-      }
+      String fullName = target.fullName;
+      _pathToSources.putIfAbsent(fullName, () => <Source>[]).add(target);
     }
   }
 
@@ -1022,9 +1058,32 @@
 }
 
 /**
- * The possible results of validating analysis results againt a [Delta].
+ * The possible results of validating analysis results against a [Delta].
  */
-enum DeltaResult { INVALIDATE, KEEP_CONTINUE, STOP }
+enum DeltaResult {
+  /**
+   * Invalidate this result and continue visiting dependent results
+   * with this [Delta].
+   */
+  INVALIDATE,
+
+  /**
+   * Invalidate this result and stop using this [Delta], so unconditionally
+   * invalidate all the dependent results.
+   */
+  INVALIDATE_NO_DELTA,
+
+  /**
+   * Keep this result and continue validating dependent results
+   * with this [Delta].
+   */
+  KEEP_CONTINUE,
+
+  /**
+   * Keep this result and stop visiting results that depend on this one.
+   */
+  STOP
+}
 
 /**
  * [InvalidatedResult] describes an invalidated result.
@@ -1040,13 +1099,66 @@
    */
   final ResultDescriptor descriptor;
 
-  InvalidatedResult(this.entry, this.descriptor);
+  /**
+   * The value of the result which was invalidated.
+   */
+  final Object value;
+
+  InvalidatedResult(this.entry, this.descriptor, this.value);
 
   @override
   String toString() => '$descriptor of ${entry.target}';
 }
 
 /**
+ * A Stream-like interface, which broadcasts events synchronously.
+ * If a second event is fired while delivering a first event, then the second
+ * event will be delivered first, and then delivering of the first will be
+ * continued.
+ */
+class ReentrantSynchronousStream<T> {
+  final List<Function> listeners = <Function>[];
+
+  /**
+   * Send the given [event] to the stream.
+   */
+  void add(T event) {
+    List<Function> listeners = this.listeners.toList();
+    for (Function listener in listeners) {
+      listener(event);
+    }
+  }
+
+  /**
+   * Listen for the events in this stream.
+   * Note that if the [listener] fires a new event, then the [listener] will be
+   * invoked again before returning from the [add] invocation.
+   */
+  ReentrantSynchronousStreamSubscription<T> listen(void listener(T event)) {
+    listeners.add(listener);
+    return new ReentrantSynchronousStreamSubscription<T>(this, listener);
+  }
+}
+
+/**
+ * A subscription on events from a [ReentrantSynchronousStream].
+ */
+class ReentrantSynchronousStreamSubscription<T> {
+  final ReentrantSynchronousStream<T> _stream;
+  final Function _listener;
+
+  ReentrantSynchronousStreamSubscription(this._stream, this._listener);
+
+  /**
+   * Cancels this subscription.
+   * It will no longer receive events.
+   */
+  void cancel() {
+    _stream.listeners.remove(_listener);
+  }
+}
+
+/**
  * The data about a single analysis result that is stored in a [CacheEntry].
  */
 // TODO(brianwilkerson) Consider making this a generic class so that the value
@@ -1069,6 +1181,13 @@
   Object value;
 
   /**
+   * The identifier of the invalidation process that most recently checked
+   * this value. If it is the same as the current invalidation identifier,
+   * then there is no reason to check it (and its subtree again).
+   */
+  int invalidateId = -1;
+
+  /**
    * A list of the results on which this result depends.
    */
   List<TargetedResult> dependedOnResults = <TargetedResult>[];
@@ -1117,46 +1236,6 @@
 }
 
 /**
- * A specification of a specific result computed for a specific target.
- */
-class TargetedResult {
-  /**
-   * An empty list of results.
-   */
-  static final List<TargetedResult> EMPTY_LIST = const <TargetedResult>[];
-
-  /**
-   * The target with which the result is associated.
-   */
-  final AnalysisTarget target;
-
-  /**
-   * The result associated with the target.
-   */
-  final ResultDescriptor result;
-
-  /**
-   * Initialize a new targeted result.
-   */
-  TargetedResult(this.target, this.result);
-
-  @override
-  int get hashCode {
-    return JenkinsSmiHash.combine(target.hashCode, result.hashCode);
-  }
-
-  @override
-  bool operator ==(other) {
-    return other is TargetedResult &&
-        other.target == target &&
-        other.result == result;
-  }
-
-  @override
-  String toString() => '$result for $target';
-}
-
-/**
  * A cache partition that contains all targets not contained in other partitions.
  */
 class UniversalCachePartition extends CachePartition {
diff --git a/pkg/analyzer/lib/src/context/context.dart b/pkg/analyzer/lib/src/context/context.dart
index e48a5cc..4f2c08d 100644
--- a/pkg/analyzer/lib/src/context/context.dart
+++ b/pkg/analyzer/lib/src/context/context.dart
@@ -8,6 +8,7 @@
 import 'dart:collection';
 
 import 'package:analyzer/instrumentation/instrumentation.dart';
+import 'package:analyzer/plugin/task.dart';
 import 'package:analyzer/src/cancelable_future.dart';
 import 'package:analyzer/src/context/cache.dart';
 import 'package:analyzer/src/generated/ast.dart';
@@ -26,15 +27,12 @@
 import 'package:analyzer/src/generated/java_core.dart';
 import 'package:analyzer/src/generated/java_engine.dart';
 import 'package:analyzer/src/generated/resolver.dart';
-import 'package:analyzer/src/generated/scanner.dart';
 import 'package:analyzer/src/generated/sdk.dart' show DartSdk;
 import 'package:analyzer/src/generated/source.dart';
 import 'package:analyzer/src/generated/utilities_collection.dart';
 import 'package:analyzer/src/task/dart.dart';
 import 'package:analyzer/src/task/dart_work_manager.dart';
 import 'package:analyzer/src/task/driver.dart';
-import 'package:analyzer/src/task/html.dart';
-import 'package:analyzer/src/task/html_work_manager.dart';
 import 'package:analyzer/src/task/incremental_element_builder.dart';
 import 'package:analyzer/src/task/manager.dart';
 import 'package:analyzer/task/dart.dart';
@@ -117,21 +115,27 @@
   AnalysisCache _cache;
 
   /**
+   * Configuration data associated with this context.
+   */
+  final HashMap<ResultDescriptor, Object> _configurationData =
+      new HashMap<ResultDescriptor, Object>();
+
+  /**
    * The task manager used to manage the tasks used to analyze code.
    */
   TaskManager _taskManager;
 
   /**
+   * A list of all [WorkManager]s used by this context.
+   */
+  final List<WorkManager> workManagers = <WorkManager>[];
+
+  /**
    * The [DartWorkManager] instance that performs Dart specific scheduling.
    */
   DartWorkManager dartWorkManager;
 
   /**
-   * The work manager that performs HTML specific scheduling.
-   */
-  HtmlWorkManager htmlWorkManager;
-
-  /**
    * The analysis driver used to perform analysis.
    */
   AnalysisDriver driver;
@@ -162,6 +166,11 @@
   TypeProvider _typeProvider;
 
   /**
+   * The [TypeSystem] for this context, `null` if not yet created.
+   */
+  TypeSystem _typeSystem;
+
+  /**
    * The controller for sending [SourcesChangedEvent]s.
    */
   StreamController<SourcesChangedEvent> _onSourcesChangedController;
@@ -219,11 +228,17 @@
     _privatePartition = new UniversalCachePartition(this);
     _cache = createCacheFromSourceFactory(null);
     _taskManager = AnalysisEngine.instance.taskManager;
-    // TODO(scheglov) Get WorkManager(Factory)(s) from plugins.
-    dartWorkManager = new DartWorkManager(this);
-    htmlWorkManager = new HtmlWorkManager(this);
-    driver = new AnalysisDriver(
-        _taskManager, <WorkManager>[dartWorkManager, htmlWorkManager], this);
+    for (WorkManagerFactory factory
+        in AnalysisEngine.instance.enginePlugin.workManagerFactories) {
+      WorkManager workManager = factory(this);
+      if (workManager != null) {
+        workManagers.add(workManager);
+        if (workManager is DartWorkManager) {
+          dartWorkManager = workManager;
+        }
+      }
+    }
+    driver = new AnalysisDriver(_taskManager, workManagers, this);
     _onSourcesChangedController =
         new StreamController<SourcesChangedEvent>.broadcast();
     _implicitAnalysisEventsController =
@@ -247,6 +262,7 @@
         (this._options.hint && !options.hint) ||
         (this._options.lint && !options.lint) ||
         this._options.preserveComments != options.preserveComments ||
+        this._options.strongMode != options.strongMode ||
         this._options.enableStrictCallChecks !=
             options.enableStrictCallChecks ||
         this._options.enableSuperMixins != options.enableSuperMixins;
@@ -267,9 +283,11 @@
     this._options.incrementalValidation = options.incrementalValidation;
     this._options.lint = options.lint;
     this._options.preserveComments = options.preserveComments;
+    this._options.strongMode = options.strongMode;
     if (needsRecompute) {
-      dartWorkManager.onAnalysisOptionsChanged();
-      htmlWorkManager.onAnalysisOptionsChanged();
+      for (WorkManager workManager in workManagers) {
+        workManager.onAnalysisOptionsChanged();
+      }
     }
   }
 
@@ -287,8 +305,10 @@
         _priorityOrder = sources;
       }
     }
-    dartWorkManager.applyPriorityTargets(_priorityOrder);
-    htmlWorkManager.applyPriorityTargets(_priorityOrder);
+    for (WorkManager workManager in workManagers) {
+      workManager.applyPriorityTargets(_priorityOrder);
+    }
+    driver.reset();
   }
 
   @override
@@ -360,7 +380,8 @@
   /**
    * Make _pendingFutureSources available to unit tests.
    */
-  HashMap<AnalysisTarget, List<PendingFuture>> get pendingFutureSources_forTesting =>
+  HashMap<AnalysisTarget,
+      List<PendingFuture>> get pendingFutureSources_forTesting =>
       _pendingFutureTargets;
 
   @override
@@ -389,8 +410,9 @@
     factory.context = this;
     _sourceFactory = factory;
     _cache = createCacheFromSourceFactory(factory);
-    dartWorkManager.onSourceFactoryChanged();
-    htmlWorkManager.onSourceFactoryChanged();
+    for (WorkManager workManager in workManagers) {
+      workManager.onSourceFactoryChanged();
+    }
   }
 
   @override
@@ -470,6 +492,14 @@
   }
 
   @override
+  TypeSystem get typeSystem {
+    if (_typeSystem == null) {
+      _typeSystem = TypeSystem.create(this);
+    }
+    return _typeSystem;
+  }
+
+  @override
   void addListener(AnalysisListener listener) {
     if (!_listeners.contains(listener)) {
       _listeners.add(listener);
@@ -531,10 +561,10 @@
     for (Source source in removedSources) {
       _sourceRemoved(source);
     }
-    dartWorkManager.applyChange(
-        changeSet.addedSources, changeSet.changedSources, removedSources);
-    htmlWorkManager.applyChange(
-        changeSet.addedSources, changeSet.changedSources, removedSources);
+    for (WorkManager workManager in workManagers) {
+      workManager.applyChange(
+          changeSet.addedSources, changeSet.changedSources, removedSources);
+    }
     _onSourcesChangedController.add(new SourcesChangedEvent(changeSet));
   }
 
@@ -547,42 +577,22 @@
     if (source == null) {
       return null;
     }
-    CompilationUnit unit = parseCompilationUnit(source);
-    if (unit == null) {
+    SourceRange docRange = element.docRange;
+    if (docRange == null) {
       return null;
     }
-    NodeLocator locator = new NodeLocator(element.nameOffset);
-    AstNode nameNode = locator.searchWithin(unit);
-    while (nameNode != null) {
-      if (nameNode is AnnotatedNode) {
-        Comment comment = nameNode.documentationComment;
-        if (comment == null) {
-          return null;
-        }
-        StringBuffer buffer = new StringBuffer();
-        List<Token> tokens = comment.tokens;
-        for (int i = 0; i < tokens.length; i++) {
-          if (i > 0) {
-            buffer.write("\n");
-          }
-          buffer.write(tokens[i].lexeme);
-        }
-        return buffer.toString();
-      }
-      nameNode = nameNode.parent;
-    }
-    return null;
+    String code = getContents(source).data;
+    String comment = code.substring(docRange.offset, docRange.end);
+    return comment.replaceAll('\r\n', '\n');
   }
 
   @override
   List<AnalysisError> computeErrors(Source source) {
     String name = source.shortName;
-    if (AnalysisEngine.isDartFileName(name)) {
-      return computeResult(source, DART_ERRORS);
-    } else if (AnalysisEngine.isHtmlFileName(name)) {
+    if (AnalysisEngine.isHtmlFileName(name)) {
       return computeResult(source, HTML_ERRORS);
     }
-    return AnalysisError.NO_ERRORS;
+    return computeResult(source, DART_ERRORS);
   }
 
   @override
@@ -634,23 +644,18 @@
         !AnalysisEngine.isDartFileName(librarySource.shortName)) {
       return new CancelableFuture.error(new AnalysisNotScheduledError());
     }
-    var unitTarget = new LibrarySpecificUnit(librarySource, unitSource);
-    return new _AnalysisFutureHelper<CompilationUnit>(this).computeAsync(
-        unitTarget, (CacheEntry entry) {
-      CacheState state = entry.getState(RESOLVED_UNIT);
-      if (state == CacheState.ERROR) {
-        throw entry.exception;
-      } else if (state == CacheState.INVALID) {
-        return null;
-      }
-      return entry.getValue(RESOLVED_UNIT);
-    }, () {
-      dartWorkManager.addPriorityResult(unitTarget, RESOLVED_UNIT);
-    });
+    return new AnalysisFutureHelper<CompilationUnit>(
+        this,
+        new LibrarySpecificUnit(librarySource, unitSource),
+        RESOLVED_UNIT).computeAsync();
   }
 
+  @override
   Object /*V*/ computeResult(
       AnalysisTarget target, ResultDescriptor /*<V>*/ descriptor) {
+    // Make sure we are not trying to invoke the task model in a reentrant
+    // fashion.
+    assert(!driver.isTaskRunning);
     CacheEntry entry = getCacheEntry(target);
     CacheState state = entry.getState(descriptor);
     if (state == CacheState.FLUSHED || state == CacheState.INVALID) {
@@ -691,6 +696,7 @@
     }
     _pendingFutureTargets.clear();
     _privatePartition.dispose();
+    _cache.dispose();
   }
 
   @override
@@ -701,7 +707,7 @@
     for (Source librarySource in containingLibraries) {
       LibrarySpecificUnit target =
           new LibrarySpecificUnit(librarySource, unitSource);
-      CompilationUnit unit = _cache.getValue(target, RESOLVED_UNIT);
+      CompilationUnit unit = getResult(target, RESOLVED_UNIT);
       if (unit == null) {
         units = null;
         break;
@@ -755,10 +761,13 @@
   CompilationUnitElement getCompilationUnitElement(
       Source unitSource, Source librarySource) {
     AnalysisTarget target = new LibrarySpecificUnit(librarySource, unitSource);
-    return _cache.getValue(target, COMPILATION_UNIT_ELEMENT);
+    return getResult(target, COMPILATION_UNIT_ELEMENT);
   }
 
   @override
+  Object getConfigurationData(ResultDescriptor key) => _configurationData[key];
+
+  @override
   TimestampedData<String> getContents(Source source) {
     String contents = _contentCache.getContents(source);
     if (contents != null) {
@@ -801,13 +810,13 @@
 
   @override
   AnalysisErrorInfo getErrors(Source source) {
-    String name = source.shortName;
-    if (AnalysisEngine.isDartFileName(name) || source is DartScript) {
-      return dartWorkManager.getErrors(source);
-    } else if (AnalysisEngine.isHtmlFileName(name)) {
-      return htmlWorkManager.getErrors(source);
+    List<AnalysisError> allErrors = <AnalysisError>[];
+    for (WorkManager workManager in workManagers) {
+      List<AnalysisError> errors = workManager.getErrors(source);
+      allErrors.addAll(errors);
     }
-    return new AnalysisErrorInfoImpl(AnalysisError.NO_ERRORS, null);
+    LineInfo lineInfo = getLineInfo(source);
+    return new AnalysisErrorInfoImpl(allErrors, lineInfo);
   }
 
   @override
@@ -828,7 +837,7 @@
     for (Source source in _cache.sources) {
       if (AnalysisEngine.isHtmlFileName(source.shortName)) {
         List<Source> referencedLibraries =
-            analysisCache.getValue(source, REFERENCED_LIBRARIES);
+            getResult(source, REFERENCED_LIBRARIES);
         if (_containsAny(referencedLibraries, librarySources)) {
           htmlSources.add(source);
         }
@@ -844,7 +853,7 @@
   SourceKind getKindOf(Source source) {
     String name = source.shortName;
     if (AnalysisEngine.isDartFileName(name)) {
-      return _cache.getValue(source, SOURCE_KIND);
+      return getResult(source, SOURCE_KIND);
     } else if (AnalysisEngine.isHtmlFileName(name)) {
       return SourceKind.HTML;
     }
@@ -891,10 +900,10 @@
 
   @override
   LibraryElement getLibraryElement(Source source) =>
-      _cache.getValue(source, LIBRARY_ELEMENT);
+      getResult(source, LIBRARY_ELEMENT);
 
   @override
-  LineInfo getLineInfo(Source source) => _cache.getValue(source, LINE_INFO);
+  LineInfo getLineInfo(Source source) => getResult(source, LINE_INFO);
 
   @override
   int getModificationStamp(Source source) {
@@ -945,7 +954,7 @@
         !AnalysisEngine.isDartFileName(librarySource.shortName)) {
       return null;
     }
-    return _cache.getValue(
+    return getResult(
         new LibrarySpecificUnit(librarySource, unitSource), RESOLVED_UNIT);
   }
 
@@ -958,6 +967,11 @@
   }
 
   @override
+  Object getResult(AnalysisTarget target, ResultDescriptor result) {
+    return _cache.getValue(target, result);
+  }
+
+  @override
   List<Source> getSourcesWithFullName(String path) {
     return analysisCache.getSourcesWithFullName(path);
   }
@@ -1009,9 +1023,16 @@
     return changed;
   }
 
+  /**
+   * Invalidate analysis cache.
+   */
+  void invalidateCachedResults() {
+    _cache = createCacheFromSourceFactory(_sourceFactory);
+  }
+
   @override
   void invalidateLibraryHints(Source librarySource) {
-    List<Source> sources = _cache.getValue(librarySource, UNITS);
+    List<Source> sources = getResult(librarySource, UNITS);
     if (sources != null) {
       for (Source source in sources) {
         getCacheEntry(source).setState(HINTS, CacheState.INVALID);
@@ -1022,13 +1043,17 @@
   @override
   bool isClientLibrary(Source librarySource) {
     CacheEntry entry = _cache.get(librarySource);
-    return entry.getValue(IS_CLIENT) && entry.getValue(IS_LAUNCHABLE);
+    return entry != null &&
+        _referencesDartHtml(librarySource) &&
+        entry.getValue(IS_LAUNCHABLE);
   }
 
   @override
   bool isServerLibrary(Source librarySource) {
     CacheEntry entry = _cache.get(librarySource);
-    return !entry.getValue(IS_CLIENT) && entry.getValue(IS_LAUNCHABLE);
+    return entry != null &&
+        !_referencesDartHtml(librarySource) &&
+        entry.getValue(IS_LAUNCHABLE);
   }
 
   @override
@@ -1105,7 +1130,6 @@
       setValue(IMPORTED_LIBRARIES, Source.EMPTY_LIST);
       // IMPORT_SOURCE_CLOSURE
       setValue(INCLUDED_PARTS, Source.EMPTY_LIST);
-      setValue(IS_CLIENT, true);
       setValue(IS_LAUNCHABLE, false);
       setValue(LIBRARY_ELEMENT, library);
       setValue(LIBRARY_ELEMENT1, library);
@@ -1126,16 +1150,25 @@
           new LibrarySpecificUnit(librarySource, librarySource);
       entry = getCacheEntry(unit);
       setValue(HINTS, AnalysisError.NO_ERRORS);
-      // dartEntry.setValue(LINTS, AnalysisError.NO_ERRORS);
-      entry.setState(RESOLVE_REFERENCES_ERRORS, CacheState.FLUSHED);
+      setValue(LINTS, AnalysisError.NO_ERRORS);
+      setValue(LIBRARY_UNIT_ERRORS, AnalysisError.NO_ERRORS);
+      setValue(RESOLVE_TYPE_NAMES_ERRORS, AnalysisError.NO_ERRORS);
+      setValue(RESOLVE_UNIT_ERRORS, AnalysisError.NO_ERRORS);
       entry.setState(RESOLVED_UNIT, CacheState.FLUSHED);
       entry.setState(RESOLVED_UNIT1, CacheState.FLUSHED);
       entry.setState(RESOLVED_UNIT2, CacheState.FLUSHED);
       entry.setState(RESOLVED_UNIT3, CacheState.FLUSHED);
       entry.setState(RESOLVED_UNIT4, CacheState.FLUSHED);
       entry.setState(RESOLVED_UNIT5, CacheState.FLUSHED);
+      entry.setState(RESOLVED_UNIT6, CacheState.FLUSHED);
+      entry.setState(RESOLVED_UNIT7, CacheState.FLUSHED);
+      entry.setState(RESOLVED_UNIT8, CacheState.FLUSHED);
+      entry.setState(RESOLVED_UNIT9, CacheState.FLUSHED);
+      entry.setState(RESOLVED_UNIT10, CacheState.FLUSHED);
       // USED_IMPORTED_ELEMENTS
       // USED_LOCAL_ELEMENTS
+      setValue(STRONG_MODE_ERRORS, AnalysisError.NO_ERRORS);
+      setValue(VARIABLE_REFERENCE_ERRORS, AnalysisError.NO_ERRORS);
       setValue(VERIFY_ERRORS, AnalysisError.NO_ERRORS);
     });
 
@@ -1160,10 +1193,6 @@
   @override
   CompilationUnit resolveCompilationUnit2(
       Source unitSource, Source librarySource) {
-    if (!AnalysisEngine.isDartFileName(unitSource.shortName) ||
-        !AnalysisEngine.isDartFileName(librarySource.shortName)) {
-      return null;
-    }
     return computeResult(
         new LibrarySpecificUnit(librarySource, unitSource), RESOLVED_UNIT);
   }
@@ -1186,6 +1215,11 @@
   }
 
   @override
+  void setConfigurationData(ResultDescriptor key, Object data) {
+    _configurationData[key] = data;
+  }
+
+  @override
   void setContents(Source source, String contents) {
     _contentsChanged(source, contents, true);
   }
@@ -1211,6 +1245,11 @@
     entry.setState(RESOLVED_UNIT3, CacheState.FLUSHED);
     entry.setState(RESOLVED_UNIT4, CacheState.FLUSHED);
     entry.setState(RESOLVED_UNIT5, CacheState.FLUSHED);
+    entry.setState(RESOLVED_UNIT6, CacheState.FLUSHED);
+    entry.setState(RESOLVED_UNIT7, CacheState.FLUSHED);
+    entry.setState(RESOLVED_UNIT8, CacheState.FLUSHED);
+    entry.setState(RESOLVED_UNIT9, CacheState.FLUSHED);
+    entry.setState(RESOLVED_UNIT10, CacheState.FLUSHED);
     entry.setState(RESOLVED_UNIT, CacheState.FLUSHED);
   }
 
@@ -1473,7 +1512,10 @@
       CacheEntry cacheEntry = _cache.get(target);
       List<PendingFuture> pendingFutures = _pendingFutureTargets[target];
       for (int i = 0; i < pendingFutures.length;) {
-        if (pendingFutures[i].evaluate(cacheEntry)) {
+        if (cacheEntry == null) {
+          pendingFutures[i].forciblyComplete();
+          pendingFutures.removeAt(i);
+        } else if (pendingFutures[i].evaluate(cacheEntry)) {
           pendingFutures.removeAt(i);
         } else {
           i++;
@@ -1530,8 +1572,12 @@
    * related to it. If so, add the source to the set of sources that need to be
    * processed. This method is intended to be used for testing purposes only.
    */
-  void _getSourcesNeedingProcessing(Source source, CacheEntry entry,
-      bool isPriority, bool hintsEnabled, bool lintsEnabled,
+  void _getSourcesNeedingProcessing(
+      Source source,
+      CacheEntry entry,
+      bool isPriority,
+      bool hintsEnabled,
+      bool lintsEnabled,
       HashSet<Source> sources) {
     CacheState state = entry.getState(CONTENT);
     if (state == CacheState.INVALID ||
@@ -1612,16 +1658,16 @@
               return;
             }
           }
-//          if (lintsEnabled) {
-//            state = unitEntry.getState(LINTS);
-//            if (state == CacheState.INVALID ||
-//                (isPriority && state == CacheState.FLUSHED)) {
-//              sources.add(source);
-//              return;
-//            } else if (state == CacheState.ERROR) {
-//              return;
-//            }
-//          }
+          if (lintsEnabled) {
+            state = unitEntry.getState(LINTS);
+            if (state == CacheState.INVALID ||
+                (isPriority && state == CacheState.FLUSHED)) {
+              sources.add(source);
+              return;
+            } else if (state == CacheState.ERROR) {
+              return;
+            }
+          }
         }
       }
 //    } else if (kind == SourceKind.HTML) {
@@ -1660,6 +1706,26 @@
     }
   }
 
+  bool _referencesDartHtml(Source librarySource) {
+    Source htmlSource = sourceFactory.forUri(DartSdk.DART_HTML);
+    Set<Source> checkedSources = new Set<Source>();
+    bool _refHtml(Source source) {
+      if (!checkedSources.add(source)) {
+        return false;
+      }
+      if (source == htmlSource) {
+        return true;
+      }
+      LibraryElement library = _cache.getValue(source, LIBRARY_ELEMENT);
+      if (library != null) {
+        return library.importedLibraries.any((x) => _refHtml(x.source)) ||
+            library.exportedLibraries.any((x) => _refHtml(x.source));
+      }
+      return false;
+    }
+    return _refHtml(librarySource);
+  }
+
   void _removeFromCache(Source source) {
     CacheEntry entry = _cache.remove(source);
     if (entry != null && !entry.explicitlyAdded) {
@@ -1689,6 +1755,7 @@
    * that referenced the source before it existed.
    */
   void _sourceAvailable(Source source) {
+    driver.reset();
     // TODO(brianwilkerson) This method needs to check whether the source was
     // previously being implicitly analyzed. If so, the cache entry needs to be
     // update to reflect the new status and an event needs to be generated to
@@ -1726,7 +1793,9 @@
           }
           return;
         }
-      } catch (e) {}
+      } catch (e) {
+        entry.modificationTime = -1;
+      }
     }
     // We need to invalidate the cache.
     {
@@ -1763,10 +1832,11 @@
       }
       entry.setState(CONTENT, CacheState.INVALID);
     }
-    dartWorkManager.applyChange(
-        Source.EMPTY_LIST, <Source>[source], Source.EMPTY_LIST);
-    htmlWorkManager.applyChange(
-        Source.EMPTY_LIST, <Source>[source], Source.EMPTY_LIST);
+    driver.reset();
+    for (WorkManager workManager in workManagers) {
+      workManager.applyChange(
+          Source.EMPTY_LIST, <Source>[source], Source.EMPTY_LIST);
+    }
   }
 
   /**
@@ -1804,6 +1874,7 @@
    * Record that the given [source] has been removed.
    */
   void _sourceRemoved(Source source) {
+    driver.reset();
     _removeFromCache(source);
     _removeFromPriorityOrder(source);
   }
@@ -1846,11 +1917,17 @@
       // do resolution
       Stopwatch perfCounter = new Stopwatch()..start();
       PoorMansIncrementalResolver resolver = new PoorMansIncrementalResolver(
-          typeProvider, unitSource, null, sourceEntry, unitEntry, oldUnit,
-          analysisOptions.incrementalApi, analysisOptions);
+          typeProvider,
+          unitSource,
+          null,
+          sourceEntry,
+          unitEntry,
+          oldUnit,
+          analysisOptions.incrementalApi);
       bool success = resolver.resolve(newCode);
       AnalysisEngine.instance.instrumentationService.logPerformance(
-          AnalysisPerformanceKind.INCREMENTAL, perfCounter,
+          AnalysisPerformanceKind.INCREMENTAL,
+          perfCounter,
           'success=$success,context_id=$_id,code_length=${newCode.length}');
       if (!success) {
         return false;
@@ -1879,6 +1956,52 @@
 }
 
 /**
+ * A helper class used to create futures for [AnalysisContextImpl].
+ * Using a helper class allows us to preserve the generic parameter T.
+ */
+class AnalysisFutureHelper<T> {
+  final AnalysisContextImpl _context;
+  final AnalysisTarget _target;
+  final ResultDescriptor<T> _descriptor;
+
+  AnalysisFutureHelper(this._context, this._target, this._descriptor);
+
+  /**
+   * Return a future that will be completed with the result specified
+   * in the constructor. If the result is cached, the future will be
+   * completed immediately with the resulting value. If not, then
+   * analysis is scheduled that will produce the required result.
+   * If the result cannot be generated, then the future will be completed with
+   * the error AnalysisNotScheduledError.
+   */
+  CancelableFuture<T> computeAsync() {
+    if (_context.isDisposed) {
+      // No further analysis is expected, so return a future that completes
+      // immediately with AnalysisNotScheduledError.
+      return new CancelableFuture.error(new AnalysisNotScheduledError());
+    }
+    CacheEntry entry = _context.getCacheEntry(_target);
+    PendingFuture pendingFuture =
+        new PendingFuture<T>(_context, _target, (CacheEntry entry) {
+      CacheState state = entry.getState(_descriptor);
+      if (state == CacheState.ERROR) {
+        throw entry.exception;
+      } else if (state == CacheState.INVALID) {
+        return null;
+      }
+      return entry.getValue(_descriptor);
+    });
+    if (!pendingFuture.evaluate(entry)) {
+      _context._pendingFutureTargets
+          .putIfAbsent(_target, () => <PendingFuture>[])
+          .add(pendingFuture);
+      _context.dartWorkManager.addPriorityResult(_target, _descriptor);
+    }
+    return pendingFuture.future;
+  }
+}
+
+/**
  * An object that manages the partitions that can be shared between analysis
  * contexts.
  */
@@ -2017,50 +2140,3 @@
     ]);
   }
 }
-
-/**
- * A helper class used to create futures for [AnalysisContextImpl].
- * Using a helper class allows us to preserve the generic parameter T.
- */
-class _AnalysisFutureHelper<T> {
-  final AnalysisContextImpl _context;
-
-  _AnalysisFutureHelper(this._context);
-
-  /**
-   * Return a future that will be completed with the result of calling
-   * [computeValue]. If [computeValue] returns non-`null`, the future will be
-   * completed immediately with the resulting value. If it returns `null`, then
-   * [scheduleComputation] is invoked to schedule analysis that will produce
-   * the required result, and [computeValue] will be re-executed in the future,
-   * after the next time the cached information for [target] has changed. If
-   * [computeValue] throws an exception, the future will fail with that
-   * exception.
-   *
-   * If the [computeValue] still returns `null` after there is no further
-   * analysis to be done for [target], then the future will be completed with
-   * the error AnalysisNotScheduledError.
-   *
-   * Since [computeValue] will be called while the state of analysis is being
-   * updated, it should be free of side effects so that it doesn't cause
-   * reentrant changes to the analysis state.
-   */
-  CancelableFuture<T> computeAsync(AnalysisTarget target,
-      T computeValue(CacheEntry entry), void scheduleComputation()) {
-    if (_context.isDisposed) {
-      // No further analysis is expected, so return a future that completes
-      // immediately with AnalysisNotScheduledError.
-      return new CancelableFuture.error(new AnalysisNotScheduledError());
-    }
-    CacheEntry entry = _context.getCacheEntry(target);
-    PendingFuture pendingFuture =
-        new PendingFuture<T>(_context, target, computeValue);
-    if (!pendingFuture.evaluate(entry)) {
-      _context._pendingFutureTargets
-          .putIfAbsent(target, () => <PendingFuture>[])
-          .add(pendingFuture);
-      scheduleComputation();
-    }
-    return pendingFuture.future;
-  }
-}
diff --git a/pkg/analyzer/lib/src/generated/ast.dart b/pkg/analyzer/lib/src/generated/ast.dart
index f4a8ff3..03cb8f1 100644
--- a/pkg/analyzer/lib/src/generated/ast.dart
+++ b/pkg/analyzer/lib/src/generated/ast.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.
 
-// This code was auto-generated, is not intended to be edited, and is subject to
-// significant change. Please see the README file for more information.
-
 library engine.ast;
 
 import 'dart:collection';
@@ -426,10 +423,8 @@
   @override
   Token get beginToken => leftParenthesis;
 
-  /**
-   * TODO(paulberry): Add commas.
-   */
   @override
+  // TODO(paulberry): Add commas.
   Iterable get childEntities => new ChildEntities()
     ..add(leftParenthesis)
     ..addAll(_arguments)
@@ -966,7 +961,8 @@
    * cloning AST nodes if [cloneTokens] is `true`.
    */
   AstCloner(
-      [this.cloneTokens = false]); // TODO(brianwilkerson) Change this to be a named parameter.
+      [this.cloneTokens =
+          false]); // TODO(brianwilkerson) Change this to be a named parameter.
 
   /**
    * Return a clone of the given [node].
@@ -1018,23 +1014,30 @@
 
   @override
   Annotation visitAnnotation(Annotation node) => new Annotation(
-      cloneToken(node.atSign), cloneNode(node.name), cloneToken(node.period),
-      cloneNode(node.constructorName), cloneNode(node.arguments));
+      cloneToken(node.atSign),
+      cloneNode(node.name),
+      cloneToken(node.period),
+      cloneNode(node.constructorName),
+      cloneNode(node.arguments));
 
   @override
   ArgumentList visitArgumentList(ArgumentList node) => new ArgumentList(
-      cloneToken(node.leftParenthesis), cloneNodeList(node.arguments),
+      cloneToken(node.leftParenthesis),
+      cloneNodeList(node.arguments),
       cloneToken(node.rightParenthesis));
 
   @override
   AsExpression visitAsExpression(AsExpression node) => new AsExpression(
-      cloneNode(node.expression), cloneToken(node.asOperator),
+      cloneNode(node.expression),
+      cloneToken(node.asOperator),
       cloneNode(node.type));
 
   @override
   AstNode visitAssertStatement(AssertStatement node) => new AssertStatement(
-      cloneToken(node.assertKeyword), cloneToken(node.leftParenthesis),
-      cloneNode(node.condition), cloneToken(node.rightParenthesis),
+      cloneToken(node.assertKeyword),
+      cloneToken(node.leftParenthesis),
+      cloneNode(node.condition),
+      cloneToken(node.rightParenthesis),
       cloneToken(node.semicolon));
 
   @override
@@ -1057,9 +1060,9 @@
       cloneNodeList(node.statements), cloneToken(node.rightBracket));
 
   @override
-  BlockFunctionBody visitBlockFunctionBody(
-      BlockFunctionBody node) => new BlockFunctionBody(
-      cloneToken(node.keyword), cloneToken(node.star), cloneNode(node.block));
+  BlockFunctionBody visitBlockFunctionBody(BlockFunctionBody node) =>
+      new BlockFunctionBody(cloneToken(node.keyword), cloneToken(node.star),
+          cloneNode(node.block));
 
   @override
   BooleanLiteral visitBooleanLiteral(BooleanLiteral node) =>
@@ -1067,7 +1070,8 @@
 
   @override
   BreakStatement visitBreakStatement(BreakStatement node) => new BreakStatement(
-      cloneToken(node.breakKeyword), cloneNode(node.label),
+      cloneToken(node.breakKeyword),
+      cloneNode(node.label),
       cloneToken(node.semicolon));
 
   @override
@@ -1077,32 +1081,47 @@
 
   @override
   CatchClause visitCatchClause(CatchClause node) => new CatchClause(
-      cloneToken(node.onKeyword), cloneNode(node.exceptionType),
-      cloneToken(node.catchKeyword), cloneToken(node.leftParenthesis),
-      cloneNode(node.exceptionParameter), cloneToken(node.comma),
-      cloneNode(node.stackTraceParameter), cloneToken(node.rightParenthesis),
+      cloneToken(node.onKeyword),
+      cloneNode(node.exceptionType),
+      cloneToken(node.catchKeyword),
+      cloneToken(node.leftParenthesis),
+      cloneNode(node.exceptionParameter),
+      cloneToken(node.comma),
+      cloneNode(node.stackTraceParameter),
+      cloneToken(node.rightParenthesis),
       cloneNode(node.body));
 
   @override
   ClassDeclaration visitClassDeclaration(ClassDeclaration node) {
     ClassDeclaration copy = new ClassDeclaration(
-        cloneNode(node.documentationComment), cloneNodeList(node.metadata),
-        cloneToken(node.abstractKeyword), cloneToken(node.classKeyword),
-        cloneNode(node.name), cloneNode(node.typeParameters),
-        cloneNode(node.extendsClause), cloneNode(node.withClause),
-        cloneNode(node.implementsClause), cloneToken(node.leftBracket),
-        cloneNodeList(node.members), cloneToken(node.rightBracket));
+        cloneNode(node.documentationComment),
+        cloneNodeList(node.metadata),
+        cloneToken(node.abstractKeyword),
+        cloneToken(node.classKeyword),
+        cloneNode(node.name),
+        cloneNode(node.typeParameters),
+        cloneNode(node.extendsClause),
+        cloneNode(node.withClause),
+        cloneNode(node.implementsClause),
+        cloneToken(node.leftBracket),
+        cloneNodeList(node.members),
+        cloneToken(node.rightBracket));
     copy.nativeClause = cloneNode(node.nativeClause);
     return copy;
   }
 
   @override
   ClassTypeAlias visitClassTypeAlias(ClassTypeAlias node) => new ClassTypeAlias(
-      cloneNode(node.documentationComment), cloneNodeList(node.metadata),
-      cloneToken(node.typedefKeyword), cloneNode(node.name),
-      cloneNode(node.typeParameters), cloneToken(node.equals),
-      cloneToken(node.abstractKeyword), cloneNode(node.superclass),
-      cloneNode(node.withClause), cloneNode(node.implementsClause),
+      cloneNode(node.documentationComment),
+      cloneNodeList(node.metadata),
+      cloneToken(node.typedefKeyword),
+      cloneNode(node.name),
+      cloneNode(node.typeParameters),
+      cloneToken(node.equals),
+      cloneToken(node.abstractKeyword),
+      cloneNode(node.superclass),
+      cloneNode(node.withClause),
+      cloneNode(node.implementsClause),
       cloneToken(node.semicolon));
 
   @override
@@ -1123,36 +1142,53 @@
 
   @override
   CompilationUnit visitCompilationUnit(CompilationUnit node) {
-    CompilationUnit clone = new CompilationUnit(cloneToken(node.beginToken),
-        cloneNode(node.scriptTag), cloneNodeList(node.directives),
-        cloneNodeList(node.declarations), cloneToken(node.endToken));
+    CompilationUnit clone = new CompilationUnit(
+        cloneToken(node.beginToken),
+        cloneNode(node.scriptTag),
+        cloneNodeList(node.directives),
+        cloneNodeList(node.declarations),
+        cloneToken(node.endToken));
     clone.lineInfo = node.lineInfo;
     return clone;
   }
 
   @override
   ConditionalExpression visitConditionalExpression(
-      ConditionalExpression node) => new ConditionalExpression(
-      cloneNode(node.condition), cloneToken(node.question),
-      cloneNode(node.thenExpression), cloneToken(node.colon),
-      cloneNode(node.elseExpression));
+          ConditionalExpression node) =>
+      new ConditionalExpression(
+          cloneNode(node.condition),
+          cloneToken(node.question),
+          cloneNode(node.thenExpression),
+          cloneToken(node.colon),
+          cloneNode(node.elseExpression));
 
   @override
   ConstructorDeclaration visitConstructorDeclaration(
-      ConstructorDeclaration node) => new ConstructorDeclaration(
-      cloneNode(node.documentationComment), cloneNodeList(node.metadata),
-      cloneToken(node.externalKeyword), cloneToken(node.constKeyword),
-      cloneToken(node.factoryKeyword), cloneNode(node.returnType),
-      cloneToken(node.period), cloneNode(node.name), cloneNode(node.parameters),
-      cloneToken(node.separator), cloneNodeList(node.initializers),
-      cloneNode(node.redirectedConstructor), cloneNode(node.body));
+          ConstructorDeclaration node) =>
+      new ConstructorDeclaration(
+          cloneNode(node.documentationComment),
+          cloneNodeList(node.metadata),
+          cloneToken(node.externalKeyword),
+          cloneToken(node.constKeyword),
+          cloneToken(node.factoryKeyword),
+          cloneNode(node.returnType),
+          cloneToken(node.period),
+          cloneNode(node.name),
+          cloneNode(node.parameters),
+          cloneToken(node.separator),
+          cloneNodeList(node.initializers),
+          cloneNode(node.redirectedConstructor),
+          cloneNode(node.body));
 
   @override
   ConstructorFieldInitializer visitConstructorFieldInitializer(
-      ConstructorFieldInitializer node) => new ConstructorFieldInitializer(
-      cloneToken(node.thisKeyword), cloneToken(node.period),
-      cloneNode(node.fieldName), cloneToken(node.equals),
-      cloneNode(node.expression));
+          ConstructorFieldInitializer node) =>
+      new ConstructorFieldInitializer(
+          cloneToken(node.thisKeyword),
+          cloneToken(node.period),
+          cloneNode(node.fieldName),
+          cloneToken(node.equals),
+          cloneNode(node.expression));
 
   @override
   ConstructorName visitConstructorName(ConstructorName node) =>
@@ -1166,21 +1202,27 @@
 
   @override
   DeclaredIdentifier visitDeclaredIdentifier(DeclaredIdentifier node) =>
-      new DeclaredIdentifier(cloneNode(node.documentationComment),
-          cloneNodeList(node.metadata), cloneToken(node.keyword),
-          cloneNode(node.type), cloneNode(node.identifier));
+      new DeclaredIdentifier(
+          cloneNode(node.documentationComment),
+          cloneNodeList(node.metadata),
+          cloneToken(node.keyword),
+          cloneNode(node.type),
+          cloneNode(node.identifier));
 
   @override
   DefaultFormalParameter visitDefaultFormalParameter(
-      DefaultFormalParameter node) => new DefaultFormalParameter(
-      cloneNode(node.parameter), node.kind, cloneToken(node.separator),
-      cloneNode(node.defaultValue));
+          DefaultFormalParameter node) =>
+      new DefaultFormalParameter(cloneNode(node.parameter), node.kind,
+          cloneToken(node.separator), cloneNode(node.defaultValue));
 
   @override
   DoStatement visitDoStatement(DoStatement node) => new DoStatement(
-      cloneToken(node.doKeyword), cloneNode(node.body),
-      cloneToken(node.whileKeyword), cloneToken(node.leftParenthesis),
-      cloneNode(node.condition), cloneToken(node.rightParenthesis),
+      cloneToken(node.doKeyword),
+      cloneNode(node.body),
+      cloneToken(node.whileKeyword),
+      cloneToken(node.leftParenthesis),
+      cloneNode(node.condition),
+      cloneToken(node.rightParenthesis),
       cloneToken(node.semicolon));
 
   @override
@@ -1202,17 +1244,24 @@
 
   @override
   EnumDeclaration visitEnumDeclaration(EnumDeclaration node) =>
-      new EnumDeclaration(cloneNode(node.documentationComment),
-          cloneNodeList(node.metadata), cloneToken(node.enumKeyword),
-          cloneNode(node.name), cloneToken(node.leftBracket),
-          cloneNodeList(node.constants), cloneToken(node.rightBracket));
+      new EnumDeclaration(
+          cloneNode(node.documentationComment),
+          cloneNodeList(node.metadata),
+          cloneToken(node.enumKeyword),
+          cloneNode(node.name),
+          cloneToken(node.leftBracket),
+          cloneNodeList(node.constants),
+          cloneToken(node.rightBracket));
 
   @override
   ExportDirective visitExportDirective(ExportDirective node) {
     ExportDirective directive = new ExportDirective(
-        cloneNode(node.documentationComment), cloneNodeList(node.metadata),
-        cloneToken(node.keyword), cloneNode(node.uri),
-        cloneNodeList(node.combinators), cloneToken(node.semicolon));
+        cloneNode(node.documentationComment),
+        cloneNodeList(node.metadata),
+        cloneToken(node.keyword),
+        cloneNode(node.uri),
+        cloneNodeList(node.combinators),
+        cloneToken(node.semicolon));
     directive.source = node.source;
     directive.uriContent = node.uriContent;
     return directive;
@@ -1220,9 +1269,12 @@
 
   @override
   ExpressionFunctionBody visitExpressionFunctionBody(
-      ExpressionFunctionBody node) => new ExpressionFunctionBody(
-      cloneToken(node.keyword), cloneToken(node.functionDefinition),
-      cloneNode(node.expression), cloneToken(node.semicolon));
+          ExpressionFunctionBody node) =>
+      new ExpressionFunctionBody(
+          cloneToken(node.keyword),
+          cloneToken(node.functionDefinition),
+          cloneNode(node.expression),
+          cloneToken(node.semicolon));
 
   @override
   ExpressionStatement visitExpressionStatement(ExpressionStatement node) =>
@@ -1235,55 +1287,83 @@
 
   @override
   FieldDeclaration visitFieldDeclaration(FieldDeclaration node) =>
-      new FieldDeclaration(cloneNode(node.documentationComment),
-          cloneNodeList(node.metadata), cloneToken(node.staticKeyword),
-          cloneNode(node.fields), cloneToken(node.semicolon));
+      new FieldDeclaration(
+          cloneNode(node.documentationComment),
+          cloneNodeList(node.metadata),
+          cloneToken(node.staticKeyword),
+          cloneNode(node.fields),
+          cloneToken(node.semicolon));
 
   @override
   FieldFormalParameter visitFieldFormalParameter(FieldFormalParameter node) =>
-      new FieldFormalParameter(cloneNode(node.documentationComment),
-          cloneNodeList(node.metadata), cloneToken(node.keyword),
-          cloneNode(node.type), cloneToken(node.thisKeyword),
-          cloneToken(node.period), cloneNode(node.identifier),
-          cloneNode(node.typeParameters), cloneNode(node.parameters));
+      new FieldFormalParameter(
+          cloneNode(node.documentationComment),
+          cloneNodeList(node.metadata),
+          cloneToken(node.keyword),
+          cloneNode(node.type),
+          cloneToken(node.thisKeyword),
+          cloneToken(node.period),
+          cloneNode(node.identifier),
+          cloneNode(node.typeParameters),
+          cloneNode(node.parameters));
 
   @override
   ForEachStatement visitForEachStatement(ForEachStatement node) {
     DeclaredIdentifier loopVariable = node.loopVariable;
     if (loopVariable == null) {
-      return new ForEachStatement.withReference(cloneToken(node.awaitKeyword),
-          cloneToken(node.forKeyword), cloneToken(node.leftParenthesis),
-          cloneNode(node.identifier), cloneToken(node.inKeyword),
-          cloneNode(node.iterable), cloneToken(node.rightParenthesis),
+      return new ForEachStatement.withReference(
+          cloneToken(node.awaitKeyword),
+          cloneToken(node.forKeyword),
+          cloneToken(node.leftParenthesis),
+          cloneNode(node.identifier),
+          cloneToken(node.inKeyword),
+          cloneNode(node.iterable),
+          cloneToken(node.rightParenthesis),
           cloneNode(node.body));
     }
-    return new ForEachStatement.withDeclaration(cloneToken(node.awaitKeyword),
-        cloneToken(node.forKeyword), cloneToken(node.leftParenthesis),
-        cloneNode(loopVariable), cloneToken(node.inKeyword),
-        cloneNode(node.iterable), cloneToken(node.rightParenthesis),
+    return new ForEachStatement.withDeclaration(
+        cloneToken(node.awaitKeyword),
+        cloneToken(node.forKeyword),
+        cloneToken(node.leftParenthesis),
+        cloneNode(loopVariable),
+        cloneToken(node.inKeyword),
+        cloneNode(node.iterable),
+        cloneToken(node.rightParenthesis),
         cloneNode(node.body));
   }
 
   @override
   FormalParameterList visitFormalParameterList(FormalParameterList node) =>
-      new FormalParameterList(cloneToken(node.leftParenthesis),
-          cloneNodeList(node.parameters), cloneToken(node.leftDelimiter),
-          cloneToken(node.rightDelimiter), cloneToken(node.rightParenthesis));
+      new FormalParameterList(
+          cloneToken(node.leftParenthesis),
+          cloneNodeList(node.parameters),
+          cloneToken(node.leftDelimiter),
+          cloneToken(node.rightDelimiter),
+          cloneToken(node.rightParenthesis));
 
   @override
   ForStatement visitForStatement(ForStatement node) => new ForStatement(
-      cloneToken(node.forKeyword), cloneToken(node.leftParenthesis),
-      cloneNode(node.variables), cloneNode(node.initialization),
-      cloneToken(node.leftSeparator), cloneNode(node.condition),
-      cloneToken(node.rightSeparator), cloneNodeList(node.updaters),
-      cloneToken(node.rightParenthesis), cloneNode(node.body));
+      cloneToken(node.forKeyword),
+      cloneToken(node.leftParenthesis),
+      cloneNode(node.variables),
+      cloneNode(node.initialization),
+      cloneToken(node.leftSeparator),
+      cloneNode(node.condition),
+      cloneToken(node.rightSeparator),
+      cloneNodeList(node.updaters),
+      cloneToken(node.rightParenthesis),
+      cloneNode(node.body));
 
   @override
   FunctionDeclaration visitFunctionDeclaration(FunctionDeclaration node) =>
-      new FunctionDeclaration(cloneNode(node.documentationComment),
-          cloneNodeList(node.metadata), cloneToken(node.externalKeyword),
-          cloneNode(node.returnType), cloneToken(node.propertyKeyword),
-          cloneNode(node.name), cloneNode(node.functionExpression));
+      new FunctionDeclaration(
+          cloneNode(node.documentationComment),
+          cloneNodeList(node.metadata),
+          cloneToken(node.externalKeyword),
+          cloneNode(node.returnType),
+          cloneToken(node.propertyKeyword),
+          cloneNode(node.name),
+          cloneNode(node.functionExpression));
 
   @override
   FunctionDeclarationStatement visitFunctionDeclarationStatement(
@@ -1297,24 +1377,32 @@
 
   @override
   FunctionExpressionInvocation visitFunctionExpressionInvocation(
-      FunctionExpressionInvocation node) => new FunctionExpressionInvocation(
-      cloneNode(node.function), cloneNode(node.typeArguments),
-      cloneNode(node.argumentList));
+          FunctionExpressionInvocation node) =>
+      new FunctionExpressionInvocation(cloneNode(node.function),
+          cloneNode(node.typeArguments), cloneNode(node.argumentList));
 
   @override
   FunctionTypeAlias visitFunctionTypeAlias(FunctionTypeAlias node) =>
-      new FunctionTypeAlias(cloneNode(node.documentationComment),
-          cloneNodeList(node.metadata), cloneToken(node.typedefKeyword),
-          cloneNode(node.returnType), cloneNode(node.name),
-          cloneNode(node.typeParameters), cloneNode(node.parameters),
+      new FunctionTypeAlias(
+          cloneNode(node.documentationComment),
+          cloneNodeList(node.metadata),
+          cloneToken(node.typedefKeyword),
+          cloneNode(node.returnType),
+          cloneNode(node.name),
+          cloneNode(node.typeParameters),
+          cloneNode(node.parameters),
           cloneToken(node.semicolon));
 
   @override
   FunctionTypedFormalParameter visitFunctionTypedFormalParameter(
-      FunctionTypedFormalParameter node) => new FunctionTypedFormalParameter(
-      cloneNode(node.documentationComment), cloneNodeList(node.metadata),
-      cloneNode(node.returnType), cloneNode(node.identifier),
-      cloneNode(node.typeParameters), cloneNode(node.parameters));
+          FunctionTypedFormalParameter node) =>
+      new FunctionTypedFormalParameter(
+          cloneNode(node.documentationComment),
+          cloneNodeList(node.metadata),
+          cloneNode(node.returnType),
+          cloneNode(node.identifier),
+          cloneNode(node.typeParameters),
+          cloneNode(node.parameters));
 
   @override
   HideCombinator visitHideCombinator(HideCombinator node) => new HideCombinator(
@@ -1322,9 +1410,12 @@
 
   @override
   IfStatement visitIfStatement(IfStatement node) => new IfStatement(
-      cloneToken(node.ifKeyword), cloneToken(node.leftParenthesis),
-      cloneNode(node.condition), cloneToken(node.rightParenthesis),
-      cloneNode(node.thenStatement), cloneToken(node.elseKeyword),
+      cloneToken(node.ifKeyword),
+      cloneToken(node.leftParenthesis),
+      cloneNode(node.condition),
+      cloneToken(node.rightParenthesis),
+      cloneNode(node.thenStatement),
+      cloneToken(node.elseKeyword),
       cloneNode(node.elseStatement));
 
   @override
@@ -1335,10 +1426,14 @@
   @override
   ImportDirective visitImportDirective(ImportDirective node) {
     ImportDirective directive = new ImportDirective(
-        cloneNode(node.documentationComment), cloneNodeList(node.metadata),
-        cloneToken(node.keyword), cloneNode(node.uri),
-        cloneToken(node.deferredKeyword), cloneToken(node.asKeyword),
-        cloneNode(node.prefix), cloneNodeList(node.combinators),
+        cloneNode(node.documentationComment),
+        cloneNodeList(node.metadata),
+        cloneToken(node.keyword),
+        cloneNode(node.uri),
+        cloneToken(node.deferredKeyword),
+        cloneToken(node.asKeyword),
+        cloneNode(node.prefix),
+        cloneNodeList(node.combinators),
         cloneToken(node.semicolon));
     directive.source = node.source;
     directive.uriContent = node.uriContent;
@@ -1349,21 +1444,25 @@
   IndexExpression visitIndexExpression(IndexExpression node) {
     Token period = node.period;
     if (period == null) {
-      return new IndexExpression.forTarget(cloneNode(node.target),
-          cloneToken(node.leftBracket), cloneNode(node.index),
+      return new IndexExpression.forTarget(
+          cloneNode(node.target),
+          cloneToken(node.leftBracket),
+          cloneNode(node.index),
           cloneToken(node.rightBracket));
     } else {
-      return new IndexExpression.forCascade(cloneToken(period),
-          cloneToken(node.leftBracket), cloneNode(node.index),
+      return new IndexExpression.forCascade(
+          cloneToken(period),
+          cloneToken(node.leftBracket),
+          cloneNode(node.index),
           cloneToken(node.rightBracket));
     }
   }
 
   @override
   InstanceCreationExpression visitInstanceCreationExpression(
-      InstanceCreationExpression node) => new InstanceCreationExpression(
-      cloneToken(node.keyword), cloneNode(node.constructorName),
-      cloneNode(node.argumentList));
+          InstanceCreationExpression node) =>
+      new InstanceCreationExpression(cloneToken(node.keyword),
+          cloneNode(node.constructorName), cloneNode(node.argumentList));
 
   @override
   IntegerLiteral visitIntegerLiteral(IntegerLiteral node) =>
@@ -1371,9 +1470,9 @@
 
   @override
   InterpolationExpression visitInterpolationExpression(
-      InterpolationExpression node) => new InterpolationExpression(
-      cloneToken(node.leftBracket), cloneNode(node.expression),
-      cloneToken(node.rightBracket));
+          InterpolationExpression node) =>
+      new InterpolationExpression(cloneToken(node.leftBracket),
+          cloneNode(node.expression), cloneToken(node.rightBracket));
 
   @override
   InterpolationString visitInterpolationString(InterpolationString node) =>
@@ -1381,8 +1480,10 @@
 
   @override
   IsExpression visitIsExpression(IsExpression node) => new IsExpression(
-      cloneNode(node.expression), cloneToken(node.isOperator),
-      cloneToken(node.notOperator), cloneNode(node.type));
+      cloneNode(node.expression),
+      cloneToken(node.isOperator),
+      cloneToken(node.notOperator),
+      cloneNode(node.type));
 
   @override
   Label visitLabel(Label node) =>
@@ -1395,9 +1496,12 @@
 
   @override
   LibraryDirective visitLibraryDirective(LibraryDirective node) =>
-      new LibraryDirective(cloneNode(node.documentationComment),
-          cloneNodeList(node.metadata), cloneToken(node.libraryKeyword),
-          cloneNode(node.name), cloneToken(node.semicolon));
+      new LibraryDirective(
+          cloneNode(node.documentationComment),
+          cloneNodeList(node.metadata),
+          cloneToken(node.libraryKeyword),
+          cloneNode(node.name),
+          cloneToken(node.semicolon));
 
   @override
   LibraryIdentifier visitLibraryIdentifier(LibraryIdentifier node) =>
@@ -1405,34 +1509,47 @@
 
   @override
   ListLiteral visitListLiteral(ListLiteral node) => new ListLiteral(
-      cloneToken(node.constKeyword), cloneNode(node.typeArguments),
-      cloneToken(node.leftBracket), cloneNodeList(node.elements),
+      cloneToken(node.constKeyword),
+      cloneNode(node.typeArguments),
+      cloneToken(node.leftBracket),
+      cloneNodeList(node.elements),
       cloneToken(node.rightBracket));
 
   @override
   MapLiteral visitMapLiteral(MapLiteral node) => new MapLiteral(
-      cloneToken(node.constKeyword), cloneNode(node.typeArguments),
-      cloneToken(node.leftBracket), cloneNodeList(node.entries),
+      cloneToken(node.constKeyword),
+      cloneNode(node.typeArguments),
+      cloneToken(node.leftBracket),
+      cloneNodeList(node.entries),
       cloneToken(node.rightBracket));
 
   @override
-  MapLiteralEntry visitMapLiteralEntry(
-      MapLiteralEntry node) => new MapLiteralEntry(
-      cloneNode(node.key), cloneToken(node.separator), cloneNode(node.value));
+  MapLiteralEntry visitMapLiteralEntry(MapLiteralEntry node) =>
+      new MapLiteralEntry(cloneNode(node.key), cloneToken(node.separator),
+          cloneNode(node.value));
 
   @override
   MethodDeclaration visitMethodDeclaration(MethodDeclaration node) =>
-      new MethodDeclaration(cloneNode(node.documentationComment),
-          cloneNodeList(node.metadata), cloneToken(node.externalKeyword),
-          cloneToken(node.modifierKeyword), cloneNode(node.returnType),
-          cloneToken(node.propertyKeyword), cloneToken(node.operatorKeyword),
-          cloneNode(node.name), cloneNode(node.typeParameters),
-          cloneNode(node.parameters), cloneNode(node.body));
+      new MethodDeclaration(
+          cloneNode(node.documentationComment),
+          cloneNodeList(node.metadata),
+          cloneToken(node.externalKeyword),
+          cloneToken(node.modifierKeyword),
+          cloneNode(node.returnType),
+          cloneToken(node.propertyKeyword),
+          cloneToken(node.operatorKeyword),
+          cloneNode(node.name),
+          cloneNode(node.typeParameters),
+          cloneNode(node.parameters),
+          cloneNode(node.body));
 
   @override
   MethodInvocation visitMethodInvocation(MethodInvocation node) =>
-      new MethodInvocation(cloneNode(node.target), cloneToken(node.operator),
-          cloneNode(node.methodName), cloneNode(node.typeArguments),
+      new MethodInvocation(
+          cloneNode(node.target),
+          cloneToken(node.operator),
+          cloneNode(node.methodName),
+          cloneNode(node.typeArguments),
           cloneNode(node.argumentList));
 
   @override
@@ -1454,15 +1571,17 @@
 
   @override
   ParenthesizedExpression visitParenthesizedExpression(
-      ParenthesizedExpression node) => new ParenthesizedExpression(
-      cloneToken(node.leftParenthesis), cloneNode(node.expression),
-      cloneToken(node.rightParenthesis));
+          ParenthesizedExpression node) =>
+      new ParenthesizedExpression(cloneToken(node.leftParenthesis),
+          cloneNode(node.expression), cloneToken(node.rightParenthesis));
 
   @override
   PartDirective visitPartDirective(PartDirective node) {
     PartDirective directive = new PartDirective(
-        cloneNode(node.documentationComment), cloneNodeList(node.metadata),
-        cloneToken(node.partKeyword), cloneNode(node.uri),
+        cloneNode(node.documentationComment),
+        cloneNodeList(node.metadata),
+        cloneToken(node.partKeyword),
+        cloneNode(node.uri),
         cloneToken(node.semicolon));
     directive.source = node.source;
     directive.uriContent = node.uriContent;
@@ -1471,9 +1590,12 @@
 
   @override
   PartOfDirective visitPartOfDirective(PartOfDirective node) =>
-      new PartOfDirective(cloneNode(node.documentationComment),
-          cloneNodeList(node.metadata), cloneToken(node.partKeyword),
-          cloneToken(node.ofKeyword), cloneNode(node.libraryName),
+      new PartOfDirective(
+          cloneNode(node.documentationComment),
+          cloneNodeList(node.metadata),
+          cloneToken(node.partKeyword),
+          cloneToken(node.ofKeyword),
+          cloneNode(node.libraryName),
           cloneToken(node.semicolon));
 
   @override
@@ -1491,14 +1613,17 @@
 
   @override
   PropertyAccess visitPropertyAccess(PropertyAccess node) => new PropertyAccess(
-      cloneNode(node.target), cloneToken(node.operator),
+      cloneNode(node.target),
+      cloneToken(node.operator),
       cloneNode(node.propertyName));
 
   @override
   RedirectingConstructorInvocation visitRedirectingConstructorInvocation(
           RedirectingConstructorInvocation node) =>
-      new RedirectingConstructorInvocation(cloneToken(node.thisKeyword),
-          cloneToken(node.period), cloneNode(node.constructorName),
+      new RedirectingConstructorInvocation(
+          cloneToken(node.thisKeyword),
+          cloneToken(node.period),
+          cloneNode(node.constructorName),
           cloneNode(node.argumentList));
 
   @override
@@ -1520,10 +1645,13 @@
 
   @override
   SimpleFormalParameter visitSimpleFormalParameter(
-      SimpleFormalParameter node) => new SimpleFormalParameter(
-      cloneNode(node.documentationComment), cloneNodeList(node.metadata),
-      cloneToken(node.keyword), cloneNode(node.type),
-      cloneNode(node.identifier));
+          SimpleFormalParameter node) =>
+      new SimpleFormalParameter(
+          cloneNode(node.documentationComment),
+          cloneNodeList(node.metadata),
+          cloneToken(node.keyword),
+          cloneNode(node.type),
+          cloneNode(node.identifier));
 
   @override
   SimpleIdentifier visitSimpleIdentifier(SimpleIdentifier node) =>
@@ -1539,9 +1667,12 @@
 
   @override
   SuperConstructorInvocation visitSuperConstructorInvocation(
-      SuperConstructorInvocation node) => new SuperConstructorInvocation(
-      cloneToken(node.superKeyword), cloneToken(node.period),
-      cloneNode(node.constructorName), cloneNode(node.argumentList));
+          SuperConstructorInvocation node) =>
+      new SuperConstructorInvocation(
+          cloneToken(node.superKeyword),
+          cloneToken(node.period),
+          cloneNode(node.constructorName),
+          cloneNode(node.argumentList));
 
   @override
   SuperExpression visitSuperExpression(SuperExpression node) =>
@@ -1549,21 +1680,29 @@
 
   @override
   SwitchCase visitSwitchCase(SwitchCase node) => new SwitchCase(
-      cloneNodeList(node.labels), cloneToken(node.keyword),
-      cloneNode(node.expression), cloneToken(node.colon),
+      cloneNodeList(node.labels),
+      cloneToken(node.keyword),
+      cloneNode(node.expression),
+      cloneToken(node.colon),
       cloneNodeList(node.statements));
 
   @override
   SwitchDefault visitSwitchDefault(SwitchDefault node) => new SwitchDefault(
-      cloneNodeList(node.labels), cloneToken(node.keyword),
-      cloneToken(node.colon), cloneNodeList(node.statements));
+      cloneNodeList(node.labels),
+      cloneToken(node.keyword),
+      cloneToken(node.colon),
+      cloneNodeList(node.statements));
 
   @override
   SwitchStatement visitSwitchStatement(SwitchStatement node) =>
-      new SwitchStatement(cloneToken(node.switchKeyword),
-          cloneToken(node.leftParenthesis), cloneNode(node.expression),
-          cloneToken(node.rightParenthesis), cloneToken(node.leftBracket),
-          cloneNodeList(node.members), cloneToken(node.rightBracket));
+      new SwitchStatement(
+          cloneToken(node.switchKeyword),
+          cloneToken(node.leftParenthesis),
+          cloneNode(node.expression),
+          cloneToken(node.rightParenthesis),
+          cloneToken(node.leftBracket),
+          cloneNodeList(node.members),
+          cloneToken(node.rightBracket));
 
   @override
   SymbolLiteral visitSymbolLiteral(SymbolLiteral node) => new SymbolLiteral(
@@ -1580,14 +1719,19 @@
 
   @override
   TopLevelVariableDeclaration visitTopLevelVariableDeclaration(
-      TopLevelVariableDeclaration node) => new TopLevelVariableDeclaration(
-      cloneNode(node.documentationComment), cloneNodeList(node.metadata),
-      cloneNode(node.variables), cloneToken(node.semicolon));
+          TopLevelVariableDeclaration node) =>
+      new TopLevelVariableDeclaration(
+          cloneNode(node.documentationComment),
+          cloneNodeList(node.metadata),
+          cloneNode(node.variables),
+          cloneToken(node.semicolon));
 
   @override
   TryStatement visitTryStatement(TryStatement node) => new TryStatement(
-      cloneToken(node.tryKeyword), cloneNode(node.body),
-      cloneNodeList(node.catchClauses), cloneToken(node.finallyKeyword),
+      cloneToken(node.tryKeyword),
+      cloneNode(node.body),
+      cloneNodeList(node.catchClauses),
+      cloneToken(node.finallyKeyword),
       cloneNode(node.finallyBlock));
 
   @override
@@ -1601,8 +1745,10 @@
 
   @override
   TypeParameter visitTypeParameter(TypeParameter node) => new TypeParameter(
-      cloneNode(node.documentationComment), cloneNodeList(node.metadata),
-      cloneNode(node.name), cloneToken(node.extendsKeyword),
+      cloneNode(node.documentationComment),
+      cloneNodeList(node.metadata),
+      cloneNode(node.name),
+      cloneToken(node.extendsKeyword),
       cloneNode(node.bound));
 
   @override
@@ -1617,20 +1763,26 @@
 
   @override
   VariableDeclarationList visitVariableDeclarationList(
-      VariableDeclarationList node) => new VariableDeclarationList(
-      cloneNode(node.documentationComment), cloneNodeList(node.metadata),
-      cloneToken(node.keyword), cloneNode(node.type),
-      cloneNodeList(node.variables));
+          VariableDeclarationList node) =>
+      new VariableDeclarationList(
+          cloneNode(node.documentationComment),
+          cloneNodeList(node.metadata),
+          cloneToken(node.keyword),
+          cloneNode(node.type),
+          cloneNodeList(node.variables));
 
   @override
   VariableDeclarationStatement visitVariableDeclarationStatement(
-      VariableDeclarationStatement node) => new VariableDeclarationStatement(
-      cloneNode(node.variables), cloneToken(node.semicolon));
+          VariableDeclarationStatement node) =>
+      new VariableDeclarationStatement(
+          cloneNode(node.variables), cloneToken(node.semicolon));
 
   @override
   WhileStatement visitWhileStatement(WhileStatement node) => new WhileStatement(
-      cloneToken(node.whileKeyword), cloneToken(node.leftParenthesis),
-      cloneNode(node.condition), cloneToken(node.rightParenthesis),
+      cloneToken(node.whileKeyword),
+      cloneToken(node.leftParenthesis),
+      cloneNode(node.condition),
+      cloneToken(node.rightParenthesis),
       cloneNode(node.body));
 
   @override
@@ -1639,8 +1791,10 @@
 
   @override
   YieldStatement visitYieldStatement(YieldStatement node) => new YieldStatement(
-      cloneToken(node.yieldKeyword), cloneToken(node.star),
-      cloneNode(node.expression), cloneToken(node.semicolon));
+      cloneToken(node.yieldKeyword),
+      cloneToken(node.star),
+      cloneNode(node.expression),
+      cloneToken(node.semicolon));
 
   /**
    * Return a clone of the given [node].
@@ -2729,8 +2883,8 @@
    * the same offset, and a positive value if the offset of the first node is
    * greater than the offset of the second node.
    */
-  static Comparator<AstNode> LEXICAL_ORDER =
-      (AstNode first, AstNode second) => second.offset - first.offset;
+  static Comparator<AstNode> LEXICAL_ORDER = (AstNode first, AstNode second) =>
+      first.offset - second.offset;
 
   /**
    * The parent of the node, or `null` if the node is the root of an AST
@@ -3480,7 +3634,12 @@
   }
 
   @override
-  Token get beginToken => _block.beginToken;
+  Token get beginToken {
+    if (keyword != null) {
+      return keyword;
+    }
+    return _block.beginToken;
+  }
 
   /**
    * Return the block representing the body of the function.
@@ -3675,7 +3834,7 @@
   Token get keyword => breakKeyword;
 
   /**
-   * Sethe token representing the 'break' keyword to the given [token].
+   * Set the token representing the 'break' keyword to the given [token].
    */
   @deprecated // Use "this.breakKeyword"
   void set keyword(Token token) {
@@ -3849,9 +4008,16 @@
    * [comma] and [stackTraceParameter] can be `null` if the stack trace is not
    * referencable within the body.
    */
-  CatchClause(this.onKeyword, TypeName exceptionType, this.catchKeyword,
-      this.leftParenthesis, SimpleIdentifier exceptionParameter, this.comma,
-      SimpleIdentifier stackTraceParameter, this.rightParenthesis, Block body) {
+  CatchClause(
+      this.onKeyword,
+      TypeName exceptionType,
+      this.catchKeyword,
+      this.leftParenthesis,
+      SimpleIdentifier exceptionParameter,
+      this.comma,
+      SimpleIdentifier stackTraceParameter,
+      this.rightParenthesis,
+      Block body) {
     _exceptionType = _becomeParentOf(exceptionType);
     _exceptionParameter = _becomeParentOf(exceptionParameter);
     _stackTraceParameter = _becomeParentOf(stackTraceParameter);
@@ -4054,11 +4220,19 @@
    * corresponding clause. The list of [members] can be `null` if the class does
    * not have any members.
    */
-  ClassDeclaration(Comment comment, List<Annotation> metadata,
-      this.abstractKeyword, this.classKeyword, SimpleIdentifier name,
-      TypeParameterList typeParameters, ExtendsClause extendsClause,
-      WithClause withClause, ImplementsClause implementsClause,
-      this.leftBracket, List<ClassMember> members, this.rightBracket)
+  ClassDeclaration(
+      Comment comment,
+      List<Annotation> metadata,
+      this.abstractKeyword,
+      this.classKeyword,
+      SimpleIdentifier name,
+      TypeParameterList typeParameters,
+      ExtendsClause extendsClause,
+      WithClause withClause,
+      ImplementsClause implementsClause,
+      this.leftBracket,
+      List<ClassMember> members,
+      this.rightBracket)
       : super(comment, metadata, name) {
     _typeParameters = _becomeParentOf(typeParameters);
     _extendsClause = _becomeParentOf(extendsClause);
@@ -4310,10 +4484,18 @@
    * `null` if the class is not abstract. The [implementsClause] can be `null`
    * if the class does not implement any interfaces.
    */
-  ClassTypeAlias(Comment comment, List<Annotation> metadata, Token keyword,
-      SimpleIdentifier name, TypeParameterList typeParameters, this.equals,
-      this.abstractKeyword, TypeName superclass, WithClause withClause,
-      ImplementsClause implementsClause, Token semicolon)
+  ClassTypeAlias(
+      Comment comment,
+      List<Annotation> metadata,
+      Token keyword,
+      SimpleIdentifier name,
+      TypeParameterList typeParameters,
+      this.equals,
+      this.abstractKeyword,
+      TypeName superclass,
+      WithClause withClause,
+      ImplementsClause implementsClause,
+      Token semicolon)
       : super(comment, metadata, keyword, name, semicolon) {
     _typeParameters = _becomeParentOf(typeParameters);
     _superclass = _becomeParentOf(superclass);
@@ -4700,8 +4882,11 @@
    * are no directives in the compilation unit. The list of [declarations] can
    * be `null` if there are no declarations in the compilation unit.
    */
-  CompilationUnit(this.beginToken, ScriptTag scriptTag,
-      List<Directive> directives, List<CompilationUnitMember> declarations,
+  CompilationUnit(
+      this.beginToken,
+      ScriptTag scriptTag,
+      List<Directive> directives,
+      List<CompilationUnitMember> declarations,
       this.endToken) {
     _scriptTag = _becomeParentOf(scriptTag);
     _directives = new NodeList<Directive>(this, directives);
@@ -4930,47 +5115,81 @@
   }
 }
 
-/**
- * An object that can be used to evaluate constant expressions to produce their
- * compile-time value. According to the Dart Language Specification:
- * <blockquote>
- * A constant expression is one of the following:
- * * A literal number.
- * * A literal boolean.
- * * A literal string where any interpolated expression is a compile-time
- *   constant that evaluates to a numeric, string or boolean value or to `null`.
- * * `null`.
- * * A reference to a static constant variable.
- * * An identifier expression that denotes a constant variable, a class or a
- *   type parameter.
- * * A constant constructor invocation.
- * * A constant list literal.
- * * A constant map literal.
- * * A simple or qualified identifier denoting a top-level function or a static
- *   method.
- * * A parenthesized expression `(e)` where `e` is a constant expression.
- * * An expression of one of the forms `identical(e1, e2)`, `e1 == e2`,
- *   `e1 != e2` where `e1` and `e2` are constant expressions that evaluate to a
- *   numeric, string or boolean value or to `null`.
- * * 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 or to `null`.
- * * 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`.
- * * 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`.
- * </blockquote>
- * The values returned by instances of this class are therefore `null` and
- * instances of the classes `Boolean`, `BigInteger`, `Double`, `String`, and
- * `DartObject`.
- *
- * 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.
- */
+/// Instances of the class [ConstantEvaluator] evaluate constant expressions to
+/// produce their compile-time value.
+///
+/// According to the Dart Language Specification:
+///
+/// > A constant expression is one of the following:
+/// >
+/// > * A literal number.
+/// > * A literal boolean.
+/// > * A literal string where any interpolated expression is a compile-time
+/// >   constant that evaluates to a numeric, string or boolean value or to
+/// >   **null**.
+/// > * A literal symbol.
+/// > * **null**.
+/// > * A qualified reference to a static constant variable.
+/// > * An identifier expression that denotes a constant variable, class or type
+/// >   alias.
+/// > * A constant constructor invocation.
+/// > * A constant list literal.
+/// > * A constant map literal.
+/// > * A simple or qualified identifier denoting a top-level function or a
+/// >   static method.
+/// > * A parenthesized expression _(e)_ where _e_ is a constant expression.
+/// > * <span>
+/// >   An expression of the form <i>identical(e<sub>1</sub>, e<sub>2</sub>)</i>
+/// >   where <i>e<sub>1</sub></i> and <i>e<sub>2</sub></i> are constant
+/// >   expressions and <i>identical()</i> is statically bound to the predefined
+/// >   dart function <i>identical()</i> discussed above.
+/// >   </span>
+/// > * <span>
+/// >   An expression of one of the forms <i>e<sub>1</sub> == e<sub>2</sub></i>
+/// >   or <i>e<sub>1</sub> != e<sub>2</sub></i> where <i>e<sub>1</sub></i> and
+/// >   <i>e<sub>2</sub></i> are constant expressions that evaluate to a
+/// >   numeric, string or boolean value.
+/// >   </span>
+/// > * <span>
+/// >   An expression of one of the forms <i>!e</i>, <i>e<sub>1</sub> &amp;&amp;
+/// >   e<sub>2</sub></i> or <i>e<sub>1</sub> || e<sub>2</sub></i>, where
+/// >   <i>e</i>, <i>e<sub>1</sub></i> and <i>e<sub>2</sub></i> are constant
+/// >   expressions that evaluate to a boolean value.
+/// >   </span>
+/// > * <span>
+/// >   An expression of one of the forms <i>~e</i>, <i>e<sub>1</sub> ^
+/// >   e<sub>2</sub></i>, <i>e<sub>1</sub> &amp; e<sub>2</sub></i>,
+/// >   <i>e<sub>1</sub> | e<sub>2</sub></i>, <i>e<sub>1</sub> &gt;&gt;
+/// >   e<sub>2</sub></i> or <i>e<sub>1</sub> &lt;&lt; e<sub>2</sub></i>, where
+/// >   <i>e</i>, <i>e<sub>1</sub></i> and <i>e<sub>2</sub></i> are constant
+/// >   expressions that evaluate to an integer value or to <b>null</b>.
+/// >   </span>
+/// > * <span>
+/// >   An expression of one of the forms <i>-e</i>, <i>e<sub>1</sub> +
+/// >   e<sub>2</sub></i>, <i>e<sub>1</sub> -e<sub>2</sub></i>,
+/// >   <i>e<sub>1</sub> * e<sub>2</sub></i>, <i>e<sub>1</sub> /
+/// >   e<sub>2</sub></i>, <i>e<sub>1</sub> ~/ e<sub>2</sub></i>,
+/// >   <i>e<sub>1</sub> &gt; e<sub>2</sub></i>, <i>e<sub>1</sub> &lt;
+/// >   e<sub>2</sub></i>, <i>e<sub>1</sub> &gt;= e<sub>2</sub></i>,
+/// >   <i>e<sub>1</sub> &lt;= e<sub>2</sub></i> or <i>e<sub>1</sub> %
+/// >   e<sub>2</sub></i>, where <i>e</i>, <i>e<sub>1</sub></i> and
+/// >   <i>e<sub>2</sub></i> are constant expressions that evaluate to a numeric
+/// >   value or to <b>null</b>.
+/// >   </span>
+/// > * <span>
+/// >   An expression of the form <i>e<sub>1</sub> ? e<sub>2</sub> :
+/// >   e<sub>3</sub></i> where <i>e<sub>1</sub></i>, <i>e<sub>2</sub></i> and
+/// >   <i>e<sub>3</sub></i> are constant expressions, and <i>e<sub>1</sub></i>
+/// >   evaluates to a boolean value.
+/// >   </span>
+///
+/// The values returned by instances of this class are therefore `null` and
+/// instances of the classes `Boolean`, `BigInteger`, `Double`, `String`, and
+/// `DartObject`.
+///
+/// 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.
 class ConstantEvaluator extends GeneralizingAstVisitor<Object> {
   /**
    * The value returned for expressions (or non-expression nodes) that are not
@@ -5372,12 +5591,20 @@
    * does not redirect to a different constructor. The [body] can be `null` if
    * the constructor does not have a body.
    */
-  ConstructorDeclaration(Comment comment, List<Annotation> metadata,
-      this.externalKeyword, this.constKeyword, this.factoryKeyword,
-      Identifier returnType, this.period, SimpleIdentifier name,
-      FormalParameterList parameters, this.separator,
+  ConstructorDeclaration(
+      Comment comment,
+      List<Annotation> metadata,
+      this.externalKeyword,
+      this.constKeyword,
+      this.factoryKeyword,
+      Identifier returnType,
+      this.period,
+      SimpleIdentifier name,
+      FormalParameterList parameters,
+      this.separator,
       List<ConstructorInitializer> initializers,
-      ConstructorName redirectedConstructor, FunctionBody body)
+      ConstructorName redirectedConstructor,
+      FunctionBody body)
       : super(comment, metadata) {
     _returnType = _becomeParentOf(returnType);
     _name = _becomeParentOf(name);
@@ -6024,6 +6251,9 @@
   @override
   bool get isFinal => _parameter != null && _parameter.isFinal;
 
+  @override
+  NodeList<Annotation> get metadata => _parameter.metadata;
+
   /**
    * Return the formal parameter with which the default value is associated.
    */
@@ -6155,8 +6385,13 @@
   /**
    * Initialize a newly created do loop.
    */
-  DoStatement(this.doKeyword, Statement body, this.whileKeyword,
-      this.leftParenthesis, Expression condition, this.rightParenthesis,
+  DoStatement(
+      this.doKeyword,
+      Statement body,
+      this.whileKeyword,
+      this.leftParenthesis,
+      Expression condition,
+      this.rightParenthesis,
       this.semicolon) {
     _body = _becomeParentOf(body);
     _condition = _becomeParentOf(condition);
@@ -6272,25 +6507,6 @@
     ElementLocator_ElementMapper mapper = new ElementLocator_ElementMapper();
     return node.accept(mapper);
   }
-
-  /**
-   * Return the element associated with the given [node], or `null` if there is
-   * no element associated with the node.
-   */
-  static Element locateWithOffset(AstNode node, int offset) {
-    // TODO(brianwilkerson) 'offset' is not used. Figure out what's going on:
-    // whether there's a bug or whether this method is unnecessary.
-    if (node == null) {
-      return null;
-    }
-    // try to get Element from node
-    Element nodeElement = locate(node);
-    if (nodeElement != null) {
-      return nodeElement;
-    }
-    // no Element
-    return null;
-  }
 }
 
 /**
@@ -6380,6 +6596,9 @@
       node.methodName.bestElement;
 
   @override
+  Element visitPartOfDirective(PartOfDirective node) => node.element;
+
+  @override
   Element visitPostfixExpression(PostfixExpression node) => node.bestElement;
 
   @override
@@ -6562,9 +6781,14 @@
    * corresponding attribute. The list of [constants] must contain at least one
    * value.
    */
-  EnumDeclaration(Comment comment, List<Annotation> metadata, this.enumKeyword,
-      SimpleIdentifier name, this.leftBracket,
-      List<EnumConstantDeclaration> constants, this.rightBracket)
+  EnumDeclaration(
+      Comment comment,
+      List<Annotation> metadata,
+      this.enumKeyword,
+      SimpleIdentifier name,
+      this.leftBracket,
+      List<EnumConstantDeclaration> constants,
+      this.rightBracket)
       : super(comment, metadata, name) {
     _constants = new NodeList<EnumConstantDeclaration>(this, constants);
   }
@@ -7179,9 +7403,16 @@
    * [parameters] can be `null` if this is not a function-typed field formal
    * parameter.
    */
-  FieldFormalParameter(Comment comment, List<Annotation> metadata, this.keyword,
-      TypeName type, this.thisKeyword, this.period, SimpleIdentifier identifier,
-      TypeParameterList typeParameters, FormalParameterList parameters)
+  FieldFormalParameter(
+      Comment comment,
+      List<Annotation> metadata,
+      this.keyword,
+      TypeName type,
+      this.thisKeyword,
+      this.period,
+      SimpleIdentifier identifier,
+      TypeParameterList typeParameters,
+      FormalParameterList parameters)
       : super(comment, metadata, identifier) {
     _type = _becomeParentOf(type);
     _typeParameters = _becomeParentOf(typeParameters);
@@ -7353,9 +7584,15 @@
    * `null` if this is not an asynchronous for loop.
    */
   @deprecated // Use new ForEachStatement.withDeclaration(...)
-  ForEachStatement.con1(this.awaitKeyword, this.forKeyword,
-      this.leftParenthesis, DeclaredIdentifier loopVariable, this.inKeyword,
-      Expression iterator, this.rightParenthesis, Statement body) {
+  ForEachStatement.con1(
+      this.awaitKeyword,
+      this.forKeyword,
+      this.leftParenthesis,
+      DeclaredIdentifier loopVariable,
+      this.inKeyword,
+      Expression iterator,
+      this.rightParenthesis,
+      Statement body) {
     _loopVariable = _becomeParentOf(loopVariable);
     _iterable = _becomeParentOf(iterator);
     _body = _becomeParentOf(body);
@@ -7366,9 +7603,15 @@
    * `null` if this is not an asynchronous for loop.
    */
   @deprecated // Use new ForEachStatement.withReference(...)
-  ForEachStatement.con2(this.awaitKeyword, this.forKeyword,
-      this.leftParenthesis, SimpleIdentifier identifier, this.inKeyword,
-      Expression iterator, this.rightParenthesis, Statement body) {
+  ForEachStatement.con2(
+      this.awaitKeyword,
+      this.forKeyword,
+      this.leftParenthesis,
+      SimpleIdentifier identifier,
+      this.inKeyword,
+      Expression iterator,
+      this.rightParenthesis,
+      Statement body) {
     _identifier = _becomeParentOf(identifier);
     _iterable = _becomeParentOf(iterator);
     _body = _becomeParentOf(body);
@@ -7379,9 +7622,15 @@
    * is declared internally (in the for-loop part). The [awaitKeyword] can be
    * `null` if this is not an asynchronous for loop.
    */
-  ForEachStatement.withDeclaration(this.awaitKeyword, this.forKeyword,
-      this.leftParenthesis, DeclaredIdentifier loopVariable, this.inKeyword,
-      Expression iterator, this.rightParenthesis, Statement body) {
+  ForEachStatement.withDeclaration(
+      this.awaitKeyword,
+      this.forKeyword,
+      this.leftParenthesis,
+      DeclaredIdentifier loopVariable,
+      this.inKeyword,
+      Expression iterator,
+      this.rightParenthesis,
+      Statement body) {
     _loopVariable = _becomeParentOf(loopVariable);
     _iterable = _becomeParentOf(iterator);
     _body = _becomeParentOf(body);
@@ -7392,9 +7641,15 @@
    * is declared outside the for loop. The [awaitKeyword] can be `null` if this
    * is not an asynchronous for loop.
    */
-  ForEachStatement.withReference(this.awaitKeyword, this.forKeyword,
-      this.leftParenthesis, SimpleIdentifier identifier, this.inKeyword,
-      Expression iterator, this.rightParenthesis, Statement body) {
+  ForEachStatement.withReference(
+      this.awaitKeyword,
+      this.forKeyword,
+      this.leftParenthesis,
+      SimpleIdentifier identifier,
+      this.inKeyword,
+      Expression iterator,
+      this.rightParenthesis,
+      Statement body) {
     _identifier = _becomeParentOf(identifier);
     _iterable = _becomeParentOf(iterator);
     _body = _becomeParentOf(body);
@@ -7528,6 +7783,11 @@
    * Return the kind of this parameter.
    */
   ParameterKind get kind;
+
+  /**
+   * Return the annotations associated with this parameter.
+   */
+  NodeList<Annotation> get metadata;
 }
 
 /**
@@ -7720,10 +7980,17 @@
    * [updaters] can be `null` if the loop does not have the corresponding
    * attribute.
    */
-  ForStatement(this.forKeyword, this.leftParenthesis,
-      VariableDeclarationList variableList, Expression initialization,
-      this.leftSeparator, Expression condition, this.rightSeparator,
-      List<Expression> updaters, this.rightParenthesis, Statement body) {
+  ForStatement(
+      this.forKeyword,
+      this.leftParenthesis,
+      VariableDeclarationList variableList,
+      Expression initialization,
+      this.leftSeparator,
+      Expression condition,
+      this.rightSeparator,
+      List<Expression> updaters,
+      this.rightParenthesis,
+      Statement body) {
     _variableList = _becomeParentOf(variableList);
     _initialization = _becomeParentOf(initialization);
     _condition = _becomeParentOf(condition);
@@ -7898,9 +8165,14 @@
    * return type was specified. The [propertyKeyword] can be `null` if the
    * function is neither a getter or a setter.
    */
-  FunctionDeclaration(Comment comment, List<Annotation> metadata,
-      this.externalKeyword, TypeName returnType, this.propertyKeyword,
-      SimpleIdentifier name, FunctionExpression functionExpression)
+  FunctionDeclaration(
+      Comment comment,
+      List<Annotation> metadata,
+      this.externalKeyword,
+      TypeName returnType,
+      this.propertyKeyword,
+      SimpleIdentifier name,
+      FunctionExpression functionExpression)
       : super(comment, metadata, name) {
     _returnType = _becomeParentOf(returnType);
     _functionExpression = _becomeParentOf(functionExpression);
@@ -8316,9 +8588,14 @@
    * was specified. The [typeParameters] can be `null` if the function has no
    * type parameters.
    */
-  FunctionTypeAlias(Comment comment, List<Annotation> metadata, Token keyword,
-      TypeName returnType, SimpleIdentifier name,
-      TypeParameterList typeParameters, FormalParameterList parameters,
+  FunctionTypeAlias(
+      Comment comment,
+      List<Annotation> metadata,
+      Token keyword,
+      TypeName returnType,
+      SimpleIdentifier name,
+      TypeParameterList typeParameters,
+      FormalParameterList parameters,
       Token semicolon)
       : super(comment, metadata, keyword, name, semicolon) {
     _returnType = _becomeParentOf(returnType);
@@ -8423,9 +8700,13 @@
    * corresponding attribute. The [returnType] can be `null` if no return type
    * was specified.
    */
-  FunctionTypedFormalParameter(Comment comment, List<Annotation> metadata,
-      TypeName returnType, SimpleIdentifier identifier,
-      TypeParameterList typeParameters, FormalParameterList parameters)
+  FunctionTypedFormalParameter(
+      Comment comment,
+      List<Annotation> metadata,
+      TypeName returnType,
+      SimpleIdentifier identifier,
+      TypeParameterList typeParameters,
+      FormalParameterList parameters)
       : super(comment, metadata, identifier) {
     _returnType = _becomeParentOf(returnType);
     _typeParameters = _becomeParentOf(typeParameters);
@@ -9082,8 +9363,13 @@
    * Initialize a newly created if statement. The [elseKeyword] and
    * [elseStatement] can be `null` if there is no else clause.
    */
-  IfStatement(this.ifKeyword, this.leftParenthesis, Expression condition,
-      this.rightParenthesis, Statement thenStatement, this.elseKeyword,
+  IfStatement(
+      this.ifKeyword,
+      this.leftParenthesis,
+      Expression condition,
+      this.rightParenthesis,
+      Statement thenStatement,
+      this.elseKeyword,
       Statement elseStatement) {
     _condition = _becomeParentOf(condition);
     _thenStatement = _becomeParentOf(thenStatement);
@@ -9190,10 +9476,8 @@
   @override
   Token get beginToken => implementsKeyword;
 
-  /**
-   * TODO(paulberry): add commas.
-   */
   @override
+  // TODO(paulberry): add commas.
   Iterable get childEntities => new ChildEntities()
     ..add(implementsKeyword)
     ..addAll(interfaces);
@@ -9237,8 +9521,8 @@
  * >   | [Annotation] 'import' [StringLiteral] 'deferred' 'as' identifier [Combinator]* ';'
  */
 class ImportDirective extends NamespaceDirective {
-  static Comparator<ImportDirective> COMPARATOR = (ImportDirective import1,
-      ImportDirective import2) {
+  static Comparator<ImportDirective> COMPARATOR =
+      (ImportDirective import1, ImportDirective import2) {
     //
     // uri
     //
@@ -9357,9 +9641,16 @@
    * does not specify a prefix. The list of [combinators] can be `null` if there
    * are no combinators.
    */
-  ImportDirective(Comment comment, List<Annotation> metadata, Token keyword,
-      StringLiteral libraryUri, this.deferredKeyword, this.asKeyword,
-      SimpleIdentifier prefix, List<Combinator> combinators, Token semicolon)
+  ImportDirective(
+      Comment comment,
+      List<Annotation> metadata,
+      Token keyword,
+      StringLiteral libraryUri,
+      this.deferredKeyword,
+      this.asKeyword,
+      SimpleIdentifier prefix,
+      List<Combinator> combinators,
+      Token semicolon)
       : super(comment, metadata, keyword, libraryUri, combinators, semicolon) {
     _prefix = _becomeParentOf(prefix);
   }
@@ -9474,16 +9765,20 @@
 
   @override
   Annotation visitAnnotation(Annotation node) {
-    Annotation copy = new Annotation(_mapToken(node.atSign),
-        _cloneNode(node.name), _mapToken(node.period),
-        _cloneNode(node.constructorName), _cloneNode(node.arguments));
+    Annotation copy = new Annotation(
+        _mapToken(node.atSign),
+        _cloneNode(node.name),
+        _mapToken(node.period),
+        _cloneNode(node.constructorName),
+        _cloneNode(node.arguments));
     copy.element = node.element;
     return copy;
   }
 
   @override
   ArgumentList visitArgumentList(ArgumentList node) => new ArgumentList(
-      _mapToken(node.leftParenthesis), _cloneNodeList(node.arguments),
+      _mapToken(node.leftParenthesis),
+      _cloneNodeList(node.arguments),
       _mapToken(node.rightParenthesis));
 
   @override
@@ -9497,14 +9792,17 @@
 
   @override
   AstNode visitAssertStatement(AssertStatement node) => new AssertStatement(
-      _mapToken(node.assertKeyword), _mapToken(node.leftParenthesis),
-      _cloneNode(node.condition), _mapToken(node.rightParenthesis),
+      _mapToken(node.assertKeyword),
+      _mapToken(node.leftParenthesis),
+      _cloneNode(node.condition),
+      _mapToken(node.rightParenthesis),
       _mapToken(node.semicolon));
 
   @override
   AssignmentExpression visitAssignmentExpression(AssignmentExpression node) {
     AssignmentExpression copy = new AssignmentExpression(
-        _cloneNode(node.leftHandSide), _mapToken(node.operator),
+        _cloneNode(node.leftHandSide),
+        _mapToken(node.operator),
         _cloneNode(node.rightHandSide));
     copy.propagatedElement = node.propagatedElement;
     copy.propagatedType = node.propagatedType;
@@ -9534,9 +9832,9 @@
       _cloneNodeList(node.statements), _mapToken(node.rightBracket));
 
   @override
-  BlockFunctionBody visitBlockFunctionBody(
-      BlockFunctionBody node) => new BlockFunctionBody(
-      _mapToken(node.keyword), _mapToken(node.star), _cloneNode(node.block));
+  BlockFunctionBody visitBlockFunctionBody(BlockFunctionBody node) =>
+      new BlockFunctionBody(_mapToken(node.keyword), _mapToken(node.star),
+          _cloneNode(node.block));
 
   @override
   BooleanLiteral visitBooleanLiteral(BooleanLiteral node) {
@@ -9549,7 +9847,8 @@
 
   @override
   BreakStatement visitBreakStatement(BreakStatement node) => new BreakStatement(
-      _mapToken(node.breakKeyword), _cloneNode(node.label),
+      _mapToken(node.breakKeyword),
+      _cloneNode(node.label),
       _mapToken(node.semicolon));
 
   @override
@@ -9563,32 +9862,47 @@
 
   @override
   CatchClause visitCatchClause(CatchClause node) => new CatchClause(
-      _mapToken(node.onKeyword), _cloneNode(node.exceptionType),
-      _mapToken(node.catchKeyword), _mapToken(node.leftParenthesis),
-      _cloneNode(node.exceptionParameter), _mapToken(node.comma),
-      _cloneNode(node.stackTraceParameter), _mapToken(node.rightParenthesis),
+      _mapToken(node.onKeyword),
+      _cloneNode(node.exceptionType),
+      _mapToken(node.catchKeyword),
+      _mapToken(node.leftParenthesis),
+      _cloneNode(node.exceptionParameter),
+      _mapToken(node.comma),
+      _cloneNode(node.stackTraceParameter),
+      _mapToken(node.rightParenthesis),
       _cloneNode(node.body));
 
   @override
   ClassDeclaration visitClassDeclaration(ClassDeclaration node) {
     ClassDeclaration copy = new ClassDeclaration(
-        _cloneNode(node.documentationComment), _cloneNodeList(node.metadata),
-        _mapToken(node.abstractKeyword), _mapToken(node.classKeyword),
-        _cloneNode(node.name), _cloneNode(node.typeParameters),
-        _cloneNode(node.extendsClause), _cloneNode(node.withClause),
-        _cloneNode(node.implementsClause), _mapToken(node.leftBracket),
-        _cloneNodeList(node.members), _mapToken(node.rightBracket));
+        _cloneNode(node.documentationComment),
+        _cloneNodeList(node.metadata),
+        _mapToken(node.abstractKeyword),
+        _mapToken(node.classKeyword),
+        _cloneNode(node.name),
+        _cloneNode(node.typeParameters),
+        _cloneNode(node.extendsClause),
+        _cloneNode(node.withClause),
+        _cloneNode(node.implementsClause),
+        _mapToken(node.leftBracket),
+        _cloneNodeList(node.members),
+        _mapToken(node.rightBracket));
     copy.nativeClause = _cloneNode(node.nativeClause);
     return copy;
   }
 
   @override
   ClassTypeAlias visitClassTypeAlias(ClassTypeAlias node) => new ClassTypeAlias(
-      _cloneNode(node.documentationComment), _cloneNodeList(node.metadata),
-      _mapToken(node.typedefKeyword), _cloneNode(node.name),
-      _cloneNode(node.typeParameters), _mapToken(node.equals),
-      _mapToken(node.abstractKeyword), _cloneNode(node.superclass),
-      _cloneNode(node.withClause), _cloneNode(node.implementsClause),
+      _cloneNode(node.documentationComment),
+      _cloneNodeList(node.metadata),
+      _mapToken(node.typedefKeyword),
+      _cloneNode(node.name),
+      _cloneNode(node.typeParameters),
+      _mapToken(node.equals),
+      _mapToken(node.abstractKeyword),
+      _cloneNode(node.superclass),
+      _cloneNode(node.withClause),
+      _cloneNode(node.implementsClause),
       _mapToken(node.semicolon));
 
   @override
@@ -9609,9 +9923,12 @@
 
   @override
   CompilationUnit visitCompilationUnit(CompilationUnit node) {
-    CompilationUnit copy = new CompilationUnit(_mapToken(node.beginToken),
-        _cloneNode(node.scriptTag), _cloneNodeList(node.directives),
-        _cloneNodeList(node.declarations), _mapToken(node.endToken));
+    CompilationUnit copy = new CompilationUnit(
+        _mapToken(node.beginToken),
+        _cloneNode(node.scriptTag),
+        _cloneNodeList(node.directives),
+        _cloneNodeList(node.declarations),
+        _mapToken(node.endToken));
     copy.lineInfo = node.lineInfo;
     copy.element = node.element;
     return copy;
@@ -9620,8 +9937,10 @@
   @override
   ConditionalExpression visitConditionalExpression(ConditionalExpression node) {
     ConditionalExpression copy = new ConditionalExpression(
-        _cloneNode(node.condition), _mapToken(node.question),
-        _cloneNode(node.thenExpression), _mapToken(node.colon),
+        _cloneNode(node.condition),
+        _mapToken(node.question),
+        _cloneNode(node.thenExpression),
+        _mapToken(node.colon),
         _cloneNode(node.elseExpression));
     copy.propagatedType = node.propagatedType;
     copy.staticType = node.staticType;
@@ -9632,23 +9951,32 @@
   ConstructorDeclaration visitConstructorDeclaration(
       ConstructorDeclaration node) {
     ConstructorDeclaration copy = new ConstructorDeclaration(
-        _cloneNode(node.documentationComment), _cloneNodeList(node.metadata),
-        _mapToken(node.externalKeyword), _mapToken(node.constKeyword),
-        _mapToken(node.factoryKeyword), _cloneNode(node.returnType),
-        _mapToken(node.period), _cloneNode(node.name),
-        _cloneNode(node.parameters), _mapToken(node.separator),
+        _cloneNode(node.documentationComment),
+        _cloneNodeList(node.metadata),
+        _mapToken(node.externalKeyword),
+        _mapToken(node.constKeyword),
+        _mapToken(node.factoryKeyword),
+        _cloneNode(node.returnType),
+        _mapToken(node.period),
+        _cloneNode(node.name),
+        _cloneNode(node.parameters),
+        _mapToken(node.separator),
         _cloneNodeList(node.initializers),
-        _cloneNode(node.redirectedConstructor), _cloneNode(node.body));
+        _cloneNode(node.redirectedConstructor),
+        _cloneNode(node.body));
     copy.element = node.element;
     return copy;
   }
 
   @override
   ConstructorFieldInitializer visitConstructorFieldInitializer(
-      ConstructorFieldInitializer node) => new ConstructorFieldInitializer(
-      _mapToken(node.thisKeyword), _mapToken(node.period),
-      _cloneNode(node.fieldName), _mapToken(node.equals),
-      _cloneNode(node.expression));
+          ConstructorFieldInitializer node) =>
+      new ConstructorFieldInitializer(
+          _mapToken(node.thisKeyword),
+          _mapToken(node.period),
+          _cloneNode(node.fieldName),
+          _mapToken(node.equals),
+          _cloneNode(node.expression));
 
   @override
   ConstructorName visitConstructorName(ConstructorName node) {
@@ -9665,21 +9993,27 @@
 
   @override
   DeclaredIdentifier visitDeclaredIdentifier(DeclaredIdentifier node) =>
-      new DeclaredIdentifier(_cloneNode(node.documentationComment),
-          _cloneNodeList(node.metadata), _mapToken(node.keyword),
-          _cloneNode(node.type), _cloneNode(node.identifier));
+      new DeclaredIdentifier(
+          _cloneNode(node.documentationComment),
+          _cloneNodeList(node.metadata),
+          _mapToken(node.keyword),
+          _cloneNode(node.type),
+          _cloneNode(node.identifier));
 
   @override
   DefaultFormalParameter visitDefaultFormalParameter(
-      DefaultFormalParameter node) => new DefaultFormalParameter(
-      _cloneNode(node.parameter), node.kind, _mapToken(node.separator),
-      _cloneNode(node.defaultValue));
+          DefaultFormalParameter node) =>
+      new DefaultFormalParameter(_cloneNode(node.parameter), node.kind,
+          _mapToken(node.separator), _cloneNode(node.defaultValue));
 
   @override
   DoStatement visitDoStatement(DoStatement node) => new DoStatement(
-      _mapToken(node.doKeyword), _cloneNode(node.body),
-      _mapToken(node.whileKeyword), _mapToken(node.leftParenthesis),
-      _cloneNode(node.condition), _mapToken(node.rightParenthesis),
+      _mapToken(node.doKeyword),
+      _cloneNode(node.body),
+      _mapToken(node.whileKeyword),
+      _mapToken(node.leftParenthesis),
+      _cloneNode(node.condition),
+      _mapToken(node.rightParenthesis),
       _mapToken(node.semicolon));
 
   @override
@@ -9705,26 +10039,35 @@
 
   @override
   AstNode visitEnumDeclaration(EnumDeclaration node) => new EnumDeclaration(
-      _cloneNode(node.documentationComment), _cloneNodeList(node.metadata),
-      _mapToken(node.enumKeyword), _cloneNode(node.name),
-      _mapToken(node.leftBracket), _cloneNodeList(node.constants),
+      _cloneNode(node.documentationComment),
+      _cloneNodeList(node.metadata),
+      _mapToken(node.enumKeyword),
+      _cloneNode(node.name),
+      _mapToken(node.leftBracket),
+      _cloneNodeList(node.constants),
       _mapToken(node.rightBracket));
 
   @override
   ExportDirective visitExportDirective(ExportDirective node) {
     ExportDirective copy = new ExportDirective(
-        _cloneNode(node.documentationComment), _cloneNodeList(node.metadata),
-        _mapToken(node.keyword), _cloneNode(node.uri),
-        _cloneNodeList(node.combinators), _mapToken(node.semicolon));
+        _cloneNode(node.documentationComment),
+        _cloneNodeList(node.metadata),
+        _mapToken(node.keyword),
+        _cloneNode(node.uri),
+        _cloneNodeList(node.combinators),
+        _mapToken(node.semicolon));
     copy.element = node.element;
     return copy;
   }
 
   @override
   ExpressionFunctionBody visitExpressionFunctionBody(
-      ExpressionFunctionBody node) => new ExpressionFunctionBody(
-      _mapToken(node.keyword), _mapToken(node.functionDefinition),
-      _cloneNode(node.expression), _mapToken(node.semicolon));
+          ExpressionFunctionBody node) =>
+      new ExpressionFunctionBody(
+          _mapToken(node.keyword),
+          _mapToken(node.functionDefinition),
+          _cloneNode(node.expression),
+          _mapToken(node.semicolon));
 
   @override
   ExpressionStatement visitExpressionStatement(ExpressionStatement node) =>
@@ -9737,55 +10080,83 @@
 
   @override
   FieldDeclaration visitFieldDeclaration(FieldDeclaration node) =>
-      new FieldDeclaration(_cloneNode(node.documentationComment),
-          _cloneNodeList(node.metadata), _mapToken(node.staticKeyword),
-          _cloneNode(node.fields), _mapToken(node.semicolon));
+      new FieldDeclaration(
+          _cloneNode(node.documentationComment),
+          _cloneNodeList(node.metadata),
+          _mapToken(node.staticKeyword),
+          _cloneNode(node.fields),
+          _mapToken(node.semicolon));
 
   @override
   FieldFormalParameter visitFieldFormalParameter(FieldFormalParameter node) =>
-      new FieldFormalParameter(_cloneNode(node.documentationComment),
-          _cloneNodeList(node.metadata), _mapToken(node.keyword),
-          _cloneNode(node.type), _mapToken(node.thisKeyword),
-          _mapToken(node.period), _cloneNode(node.identifier),
-          _cloneNode(node.typeParameters), _cloneNode(node.parameters));
+      new FieldFormalParameter(
+          _cloneNode(node.documentationComment),
+          _cloneNodeList(node.metadata),
+          _mapToken(node.keyword),
+          _cloneNode(node.type),
+          _mapToken(node.thisKeyword),
+          _mapToken(node.period),
+          _cloneNode(node.identifier),
+          _cloneNode(node.typeParameters),
+          _cloneNode(node.parameters));
 
   @override
   ForEachStatement visitForEachStatement(ForEachStatement node) {
     DeclaredIdentifier loopVariable = node.loopVariable;
     if (loopVariable == null) {
-      return new ForEachStatement.withReference(_mapToken(node.awaitKeyword),
-          _mapToken(node.forKeyword), _mapToken(node.leftParenthesis),
-          _cloneNode(node.identifier), _mapToken(node.inKeyword),
-          _cloneNode(node.iterable), _mapToken(node.rightParenthesis),
+      return new ForEachStatement.withReference(
+          _mapToken(node.awaitKeyword),
+          _mapToken(node.forKeyword),
+          _mapToken(node.leftParenthesis),
+          _cloneNode(node.identifier),
+          _mapToken(node.inKeyword),
+          _cloneNode(node.iterable),
+          _mapToken(node.rightParenthesis),
           _cloneNode(node.body));
     }
-    return new ForEachStatement.withDeclaration(_mapToken(node.awaitKeyword),
-        _mapToken(node.forKeyword), _mapToken(node.leftParenthesis),
-        _cloneNode(loopVariable), _mapToken(node.inKeyword),
-        _cloneNode(node.iterable), _mapToken(node.rightParenthesis),
+    return new ForEachStatement.withDeclaration(
+        _mapToken(node.awaitKeyword),
+        _mapToken(node.forKeyword),
+        _mapToken(node.leftParenthesis),
+        _cloneNode(loopVariable),
+        _mapToken(node.inKeyword),
+        _cloneNode(node.iterable),
+        _mapToken(node.rightParenthesis),
         _cloneNode(node.body));
   }
 
   @override
   FormalParameterList visitFormalParameterList(FormalParameterList node) =>
-      new FormalParameterList(_mapToken(node.leftParenthesis),
-          _cloneNodeList(node.parameters), _mapToken(node.leftDelimiter),
-          _mapToken(node.rightDelimiter), _mapToken(node.rightParenthesis));
+      new FormalParameterList(
+          _mapToken(node.leftParenthesis),
+          _cloneNodeList(node.parameters),
+          _mapToken(node.leftDelimiter),
+          _mapToken(node.rightDelimiter),
+          _mapToken(node.rightParenthesis));
 
   @override
   ForStatement visitForStatement(ForStatement node) => new ForStatement(
-      _mapToken(node.forKeyword), _mapToken(node.leftParenthesis),
-      _cloneNode(node.variables), _cloneNode(node.initialization),
-      _mapToken(node.leftSeparator), _cloneNode(node.condition),
-      _mapToken(node.rightSeparator), _cloneNodeList(node.updaters),
-      _mapToken(node.rightParenthesis), _cloneNode(node.body));
+      _mapToken(node.forKeyword),
+      _mapToken(node.leftParenthesis),
+      _cloneNode(node.variables),
+      _cloneNode(node.initialization),
+      _mapToken(node.leftSeparator),
+      _cloneNode(node.condition),
+      _mapToken(node.rightSeparator),
+      _cloneNodeList(node.updaters),
+      _mapToken(node.rightParenthesis),
+      _cloneNode(node.body));
 
   @override
   FunctionDeclaration visitFunctionDeclaration(FunctionDeclaration node) =>
-      new FunctionDeclaration(_cloneNode(node.documentationComment),
-          _cloneNodeList(node.metadata), _mapToken(node.externalKeyword),
-          _cloneNode(node.returnType), _mapToken(node.propertyKeyword),
-          _cloneNode(node.name), _cloneNode(node.functionExpression));
+      new FunctionDeclaration(
+          _cloneNode(node.documentationComment),
+          _cloneNodeList(node.metadata),
+          _mapToken(node.externalKeyword),
+          _cloneNode(node.returnType),
+          _mapToken(node.propertyKeyword),
+          _cloneNode(node.name),
+          _cloneNode(node.functionExpression));
 
   @override
   FunctionDeclarationStatement visitFunctionDeclarationStatement(
@@ -9795,7 +10166,8 @@
   @override
   FunctionExpression visitFunctionExpression(FunctionExpression node) {
     FunctionExpression copy = new FunctionExpression(
-        _cloneNode(node.typeParameters), _cloneNode(node.parameters),
+        _cloneNode(node.typeParameters),
+        _cloneNode(node.parameters),
         _cloneNode(node.body));
     copy.element = node.element;
     copy.propagatedType = node.propagatedType;
@@ -9807,7 +10179,8 @@
   FunctionExpressionInvocation visitFunctionExpressionInvocation(
       FunctionExpressionInvocation node) {
     FunctionExpressionInvocation copy = new FunctionExpressionInvocation(
-        _cloneNode(node.function), _cloneNode(node.typeArguments),
+        _cloneNode(node.function),
+        _cloneNode(node.typeArguments),
         _cloneNode(node.argumentList));
     copy.propagatedElement = node.propagatedElement;
     copy.propagatedType = node.propagatedType;
@@ -9818,18 +10191,26 @@
 
   @override
   FunctionTypeAlias visitFunctionTypeAlias(FunctionTypeAlias node) =>
-      new FunctionTypeAlias(_cloneNode(node.documentationComment),
-          _cloneNodeList(node.metadata), _mapToken(node.typedefKeyword),
-          _cloneNode(node.returnType), _cloneNode(node.name),
-          _cloneNode(node.typeParameters), _cloneNode(node.parameters),
+      new FunctionTypeAlias(
+          _cloneNode(node.documentationComment),
+          _cloneNodeList(node.metadata),
+          _mapToken(node.typedefKeyword),
+          _cloneNode(node.returnType),
+          _cloneNode(node.name),
+          _cloneNode(node.typeParameters),
+          _cloneNode(node.parameters),
           _mapToken(node.semicolon));
 
   @override
   FunctionTypedFormalParameter visitFunctionTypedFormalParameter(
-      FunctionTypedFormalParameter node) => new FunctionTypedFormalParameter(
-      _cloneNode(node.documentationComment), _cloneNodeList(node.metadata),
-      _cloneNode(node.returnType), _cloneNode(node.identifier),
-      _cloneNode(node.typeParameters), _cloneNode(node.parameters));
+          FunctionTypedFormalParameter node) =>
+      new FunctionTypedFormalParameter(
+          _cloneNode(node.documentationComment),
+          _cloneNodeList(node.metadata),
+          _cloneNode(node.returnType),
+          _cloneNode(node.identifier),
+          _cloneNode(node.typeParameters),
+          _cloneNode(node.parameters));
 
   @override
   HideCombinator visitHideCombinator(HideCombinator node) => new HideCombinator(
@@ -9837,9 +10218,12 @@
 
   @override
   IfStatement visitIfStatement(IfStatement node) => new IfStatement(
-      _mapToken(node.ifKeyword), _mapToken(node.leftParenthesis),
-      _cloneNode(node.condition), _mapToken(node.rightParenthesis),
-      _cloneNode(node.thenStatement), _mapToken(node.elseKeyword),
+      _mapToken(node.ifKeyword),
+      _mapToken(node.leftParenthesis),
+      _cloneNode(node.condition),
+      _mapToken(node.rightParenthesis),
+      _cloneNode(node.thenStatement),
+      _mapToken(node.elseKeyword),
       _cloneNode(node.elseStatement));
 
   @override
@@ -9849,19 +10233,26 @@
 
   @override
   ImportDirective visitImportDirective(ImportDirective node) =>
-      new ImportDirective(_cloneNode(node.documentationComment),
-          _cloneNodeList(node.metadata), _mapToken(node.keyword),
-          _cloneNode(node.uri), _mapToken(node.deferredKeyword),
-          _mapToken(node.asKeyword), _cloneNode(node.prefix),
-          _cloneNodeList(node.combinators), _mapToken(node.semicolon));
+      new ImportDirective(
+          _cloneNode(node.documentationComment),
+          _cloneNodeList(node.metadata),
+          _mapToken(node.keyword),
+          _cloneNode(node.uri),
+          _mapToken(node.deferredKeyword),
+          _mapToken(node.asKeyword),
+          _cloneNode(node.prefix),
+          _cloneNodeList(node.combinators),
+          _mapToken(node.semicolon));
 
   @override
   IndexExpression visitIndexExpression(IndexExpression node) {
     Token period = _mapToken(node.period);
     IndexExpression copy;
     if (period == null) {
-      copy = new IndexExpression.forTarget(_cloneNode(node.target),
-          _mapToken(node.leftBracket), _cloneNode(node.index),
+      copy = new IndexExpression.forTarget(
+          _cloneNode(node.target),
+          _mapToken(node.leftBracket),
+          _cloneNode(node.index),
           _mapToken(node.rightBracket));
     } else {
       copy = new IndexExpression.forCascade(period, _mapToken(node.leftBracket),
@@ -9879,7 +10270,8 @@
   InstanceCreationExpression visitInstanceCreationExpression(
       InstanceCreationExpression node) {
     InstanceCreationExpression copy = new InstanceCreationExpression(
-        _mapToken(node.keyword), _cloneNode(node.constructorName),
+        _mapToken(node.keyword),
+        _cloneNode(node.constructorName),
         _cloneNode(node.argumentList));
     copy.propagatedType = node.propagatedType;
     copy.staticElement = node.staticElement;
@@ -9898,9 +10290,9 @@
 
   @override
   InterpolationExpression visitInterpolationExpression(
-      InterpolationExpression node) => new InterpolationExpression(
-      _mapToken(node.leftBracket), _cloneNode(node.expression),
-      _mapToken(node.rightBracket));
+          InterpolationExpression node) =>
+      new InterpolationExpression(_mapToken(node.leftBracket),
+          _cloneNode(node.expression), _mapToken(node.rightBracket));
 
   @override
   InterpolationString visitInterpolationString(InterpolationString node) =>
@@ -9908,8 +10300,10 @@
 
   @override
   IsExpression visitIsExpression(IsExpression node) {
-    IsExpression copy = new IsExpression(_cloneNode(node.expression),
-        _mapToken(node.isOperator), _mapToken(node.notOperator),
+    IsExpression copy = new IsExpression(
+        _cloneNode(node.expression),
+        _mapToken(node.isOperator),
+        _mapToken(node.notOperator),
         _cloneNode(node.type));
     copy.propagatedType = node.propagatedType;
     copy.staticType = node.staticType;
@@ -9927,9 +10321,12 @@
 
   @override
   LibraryDirective visitLibraryDirective(LibraryDirective node) =>
-      new LibraryDirective(_cloneNode(node.documentationComment),
-          _cloneNodeList(node.metadata), _mapToken(node.libraryKeyword),
-          _cloneNode(node.name), _mapToken(node.semicolon));
+      new LibraryDirective(
+          _cloneNode(node.documentationComment),
+          _cloneNodeList(node.metadata),
+          _mapToken(node.libraryKeyword),
+          _cloneNode(node.name),
+          _mapToken(node.semicolon));
 
   @override
   LibraryIdentifier visitLibraryIdentifier(LibraryIdentifier node) {
@@ -9942,9 +10339,12 @@
 
   @override
   ListLiteral visitListLiteral(ListLiteral node) {
-    ListLiteral copy = new ListLiteral(_mapToken(node.constKeyword),
-        _cloneNode(node.typeArguments), _mapToken(node.leftBracket),
-        _cloneNodeList(node.elements), _mapToken(node.rightBracket));
+    ListLiteral copy = new ListLiteral(
+        _mapToken(node.constKeyword),
+        _cloneNode(node.typeArguments),
+        _mapToken(node.leftBracket),
+        _cloneNodeList(node.elements),
+        _mapToken(node.rightBracket));
     copy.propagatedType = node.propagatedType;
     copy.staticType = node.staticType;
     return copy;
@@ -9952,33 +10352,45 @@
 
   @override
   MapLiteral visitMapLiteral(MapLiteral node) {
-    MapLiteral copy = new MapLiteral(_mapToken(node.constKeyword),
-        _cloneNode(node.typeArguments), _mapToken(node.leftBracket),
-        _cloneNodeList(node.entries), _mapToken(node.rightBracket));
+    MapLiteral copy = new MapLiteral(
+        _mapToken(node.constKeyword),
+        _cloneNode(node.typeArguments),
+        _mapToken(node.leftBracket),
+        _cloneNodeList(node.entries),
+        _mapToken(node.rightBracket));
     copy.propagatedType = node.propagatedType;
     copy.staticType = node.staticType;
     return copy;
   }
 
   @override
-  MapLiteralEntry visitMapLiteralEntry(
-      MapLiteralEntry node) => new MapLiteralEntry(
-      _cloneNode(node.key), _mapToken(node.separator), _cloneNode(node.value));
+  MapLiteralEntry visitMapLiteralEntry(MapLiteralEntry node) =>
+      new MapLiteralEntry(_cloneNode(node.key), _mapToken(node.separator),
+          _cloneNode(node.value));
 
   @override
   MethodDeclaration visitMethodDeclaration(MethodDeclaration node) =>
-      new MethodDeclaration(_cloneNode(node.documentationComment),
-          _cloneNodeList(node.metadata), _mapToken(node.externalKeyword),
-          _mapToken(node.modifierKeyword), _cloneNode(node.returnType),
-          _mapToken(node.propertyKeyword), _mapToken(node.operatorKeyword),
-          _cloneNode(node.name), _cloneNode(node._typeParameters),
-          _cloneNode(node.parameters), _cloneNode(node.body));
+      new MethodDeclaration(
+          _cloneNode(node.documentationComment),
+          _cloneNodeList(node.metadata),
+          _mapToken(node.externalKeyword),
+          _mapToken(node.modifierKeyword),
+          _cloneNode(node.returnType),
+          _mapToken(node.propertyKeyword),
+          _mapToken(node.operatorKeyword),
+          _cloneNode(node.name),
+          _cloneNode(node._typeParameters),
+          _cloneNode(node.parameters),
+          _cloneNode(node.body));
 
   @override
   MethodInvocation visitMethodInvocation(MethodInvocation node) {
-    MethodInvocation copy = new MethodInvocation(_cloneNode(node.target),
-        _mapToken(node.operator), _cloneNode(node.methodName),
-        _cloneNode(node.typeArguments), _cloneNode(node.argumentList));
+    MethodInvocation copy = new MethodInvocation(
+        _cloneNode(node.target),
+        _mapToken(node.operator),
+        _cloneNode(node.methodName),
+        _cloneNode(node.typeArguments),
+        _cloneNode(node.argumentList));
     copy.propagatedType = node.propagatedType;
     copy.staticType = node.staticType;
     return copy;
@@ -10014,7 +10426,8 @@
   ParenthesizedExpression visitParenthesizedExpression(
       ParenthesizedExpression node) {
     ParenthesizedExpression copy = new ParenthesizedExpression(
-        _mapToken(node.leftParenthesis), _cloneNode(node.expression),
+        _mapToken(node.leftParenthesis),
+        _cloneNode(node.expression),
         _mapToken(node.rightParenthesis));
     copy.propagatedType = node.propagatedType;
     copy.staticType = node.staticType;
@@ -10024,8 +10437,10 @@
   @override
   PartDirective visitPartDirective(PartDirective node) {
     PartDirective copy = new PartDirective(
-        _cloneNode(node.documentationComment), _cloneNodeList(node.metadata),
-        _mapToken(node.partKeyword), _cloneNode(node.uri),
+        _cloneNode(node.documentationComment),
+        _cloneNodeList(node.metadata),
+        _mapToken(node.partKeyword),
+        _cloneNode(node.uri),
         _mapToken(node.semicolon));
     copy.element = node.element;
     return copy;
@@ -10034,9 +10449,12 @@
   @override
   PartOfDirective visitPartOfDirective(PartOfDirective node) {
     PartOfDirective copy = new PartOfDirective(
-        _cloneNode(node.documentationComment), _cloneNodeList(node.metadata),
-        _mapToken(node.partKeyword), _mapToken(node.ofKeyword),
-        _cloneNode(node.libraryName), _mapToken(node.semicolon));
+        _cloneNode(node.documentationComment),
+        _cloneNodeList(node.metadata),
+        _mapToken(node.partKeyword),
+        _mapToken(node.ofKeyword),
+        _cloneNode(node.libraryName),
+        _mapToken(node.semicolon));
     copy.element = node.element;
     return copy;
   }
@@ -10085,8 +10503,10 @@
   RedirectingConstructorInvocation visitRedirectingConstructorInvocation(
       RedirectingConstructorInvocation node) {
     RedirectingConstructorInvocation copy =
-        new RedirectingConstructorInvocation(_mapToken(node.thisKeyword),
-            _mapToken(node.period), _cloneNode(node.constructorName),
+        new RedirectingConstructorInvocation(
+            _mapToken(node.thisKeyword),
+            _mapToken(node.period),
+            _cloneNode(node.constructorName),
             _cloneNode(node.argumentList));
     copy.staticElement = node.staticElement;
     return copy;
@@ -10116,10 +10536,13 @@
 
   @override
   SimpleFormalParameter visitSimpleFormalParameter(
-      SimpleFormalParameter node) => new SimpleFormalParameter(
-      _cloneNode(node.documentationComment), _cloneNodeList(node.metadata),
-      _mapToken(node.keyword), _cloneNode(node.type),
-      _cloneNode(node.identifier));
+          SimpleFormalParameter node) =>
+      new SimpleFormalParameter(
+          _cloneNode(node.documentationComment),
+          _cloneNodeList(node.metadata),
+          _mapToken(node.keyword),
+          _cloneNode(node.type),
+          _cloneNode(node.identifier));
 
   @override
   SimpleIdentifier visitSimpleIdentifier(SimpleIdentifier node) {
@@ -10163,8 +10586,10 @@
   SuperConstructorInvocation visitSuperConstructorInvocation(
       SuperConstructorInvocation node) {
     SuperConstructorInvocation copy = new SuperConstructorInvocation(
-        _mapToken(node.superKeyword), _mapToken(node.period),
-        _cloneNode(node.constructorName), _cloneNode(node.argumentList));
+        _mapToken(node.superKeyword),
+        _mapToken(node.period),
+        _cloneNode(node.constructorName),
+        _cloneNode(node.argumentList));
     copy.staticElement = node.staticElement;
     return copy;
   }
@@ -10179,21 +10604,29 @@
 
   @override
   SwitchCase visitSwitchCase(SwitchCase node) => new SwitchCase(
-      _cloneNodeList(node.labels), _mapToken(node.keyword),
-      _cloneNode(node.expression), _mapToken(node.colon),
+      _cloneNodeList(node.labels),
+      _mapToken(node.keyword),
+      _cloneNode(node.expression),
+      _mapToken(node.colon),
       _cloneNodeList(node.statements));
 
   @override
   SwitchDefault visitSwitchDefault(SwitchDefault node) => new SwitchDefault(
-      _cloneNodeList(node.labels), _mapToken(node.keyword),
-      _mapToken(node.colon), _cloneNodeList(node.statements));
+      _cloneNodeList(node.labels),
+      _mapToken(node.keyword),
+      _mapToken(node.colon),
+      _cloneNodeList(node.statements));
 
   @override
   SwitchStatement visitSwitchStatement(SwitchStatement node) =>
-      new SwitchStatement(_mapToken(node.switchKeyword),
-          _mapToken(node.leftParenthesis), _cloneNode(node.expression),
-          _mapToken(node.rightParenthesis), _mapToken(node.leftBracket),
-          _cloneNodeList(node.members), _mapToken(node.rightBracket));
+      new SwitchStatement(
+          _mapToken(node.switchKeyword),
+          _mapToken(node.leftParenthesis),
+          _cloneNode(node.expression),
+          _mapToken(node.rightParenthesis),
+          _mapToken(node.leftBracket),
+          _cloneNodeList(node.members),
+          _mapToken(node.rightBracket));
 
   @override
   AstNode visitSymbolLiteral(SymbolLiteral node) {
@@ -10223,14 +10656,19 @@
 
   @override
   TopLevelVariableDeclaration visitTopLevelVariableDeclaration(
-      TopLevelVariableDeclaration node) => new TopLevelVariableDeclaration(
-      _cloneNode(node.documentationComment), _cloneNodeList(node.metadata),
-      _cloneNode(node.variables), _mapToken(node.semicolon));
+          TopLevelVariableDeclaration node) =>
+      new TopLevelVariableDeclaration(
+          _cloneNode(node.documentationComment),
+          _cloneNodeList(node.metadata),
+          _cloneNode(node.variables),
+          _mapToken(node.semicolon));
 
   @override
   TryStatement visitTryStatement(TryStatement node) => new TryStatement(
-      _mapToken(node.tryKeyword), _cloneNode(node.body),
-      _cloneNodeList(node.catchClauses), _mapToken(node.finallyKeyword),
+      _mapToken(node.tryKeyword),
+      _cloneNode(node.body),
+      _cloneNodeList(node.catchClauses),
+      _mapToken(node.finallyKeyword),
       _cloneNode(node.finallyBlock));
 
   @override
@@ -10248,8 +10686,10 @@
 
   @override
   TypeParameter visitTypeParameter(TypeParameter node) => new TypeParameter(
-      _cloneNode(node.documentationComment), _cloneNodeList(node.metadata),
-      _cloneNode(node.name), _mapToken(node.extendsKeyword),
+      _cloneNode(node.documentationComment),
+      _cloneNodeList(node.metadata),
+      _cloneNode(node.name),
+      _mapToken(node.extendsKeyword),
       _cloneNode(node.bound));
 
   @override
@@ -10264,19 +10704,26 @@
 
   @override
   VariableDeclarationList visitVariableDeclarationList(
-      VariableDeclarationList node) => new VariableDeclarationList(null,
-      _cloneNodeList(node.metadata), _mapToken(node.keyword),
-      _cloneNode(node.type), _cloneNodeList(node.variables));
+          VariableDeclarationList node) =>
+      new VariableDeclarationList(
+          null,
+          _cloneNodeList(node.metadata),
+          _mapToken(node.keyword),
+          _cloneNode(node.type),
+          _cloneNodeList(node.variables));
 
   @override
   VariableDeclarationStatement visitVariableDeclarationStatement(
-      VariableDeclarationStatement node) => new VariableDeclarationStatement(
-      _cloneNode(node.variables), _mapToken(node.semicolon));
+          VariableDeclarationStatement node) =>
+      new VariableDeclarationStatement(
+          _cloneNode(node.variables), _mapToken(node.semicolon));
 
   @override
   WhileStatement visitWhileStatement(WhileStatement node) => new WhileStatement(
-      _mapToken(node.whileKeyword), _mapToken(node.leftParenthesis),
-      _cloneNode(node.condition), _mapToken(node.rightParenthesis),
+      _mapToken(node.whileKeyword),
+      _mapToken(node.leftParenthesis),
+      _cloneNode(node.condition),
+      _mapToken(node.rightParenthesis),
       _cloneNode(node.body));
 
   @override
@@ -10285,8 +10732,10 @@
 
   @override
   YieldStatement visitYieldStatement(YieldStatement node) => new YieldStatement(
-      _mapToken(node.yieldKeyword), _mapToken(node.star),
-      _cloneNode(node.expression), _mapToken(node.semicolon));
+      _mapToken(node.yieldKeyword),
+      _mapToken(node.star),
+      _cloneNode(node.expression),
+      _mapToken(node.semicolon));
 
   AstNode _cloneNode(AstNode node) {
     if (node == null) {
@@ -11204,10 +11653,8 @@
   @override
   Element get bestElement => staticElement;
 
-  /**
-   * TODO(paulberry): add "." tokens.
-   */
   @override
+  // TODO(paulberry): add "." tokens.
   Iterable get childEntities => new ChildEntities()..addAll(_components);
 
   /**
@@ -11297,10 +11744,8 @@
     return leftBracket;
   }
 
-  /**
-   * TODO(paulberry): add commas.
-   */
   @override
+  // TODO(paulberry): add commas.
   Iterable get childEntities => super._childEntities
     ..add(leftBracket)
     ..addAll(_elements)
@@ -11387,10 +11832,8 @@
     return leftBracket;
   }
 
-  /**
-   * TODO(paulberry): add commas.
-   */
   @override
+  // TODO(paulberry): add commas.
   Iterable get childEntities => super._childEntities
     ..add(leftBracket)
     ..addAll(entries)
@@ -11569,10 +12012,17 @@
    * method does not implement an operator. The [parameters] must be `null` if
    * this method declares a getter.
    */
-  MethodDeclaration(Comment comment, List<Annotation> metadata,
-      this.externalKeyword, this.modifierKeyword, TypeName returnType,
-      this.propertyKeyword, this.operatorKeyword, SimpleIdentifier name,
-      TypeParameterList typeParameters, FormalParameterList parameters,
+  MethodDeclaration(
+      Comment comment,
+      List<Annotation> metadata,
+      this.externalKeyword,
+      this.modifierKeyword,
+      TypeName returnType,
+      this.propertyKeyword,
+      this.operatorKeyword,
+      SimpleIdentifier name,
+      TypeParameterList typeParameters,
+      FormalParameterList parameters,
       FunctionBody body)
       : super(comment, metadata) {
     _returnType = _becomeParentOf(returnType);
@@ -11776,8 +12226,11 @@
    * Initialize a newly created method invocation. The [target] and [operator]
    * can be `null` if there is no target.
    */
-  MethodInvocation(Expression target, this.operator,
-      SimpleIdentifier methodName, TypeArgumentList typeArguments,
+  MethodInvocation(
+      Expression target,
+      this.operator,
+      SimpleIdentifier methodName,
+      TypeArgumentList typeArguments,
       ArgumentList argumentList) {
     _target = _becomeParentOf(target);
     _methodName = _becomeParentOf(methodName);
@@ -12148,7 +12601,7 @@
   StringLiteral get name => _name;
 
   /**
-   * Sets the name of the native object that implements the class to the given
+   * Set the name of the native object that implements the class to the given
    * [name].
    */
   void set name(StringLiteral name) {
@@ -13734,9 +14187,7 @@
     return ParameterKind.REQUIRED;
   }
 
-  /**
-   * Return the annotations associated with this parameter.
-   */
+  @override
   NodeList<Annotation> get metadata => _metadata;
 
   /**
@@ -15737,10 +16188,8 @@
     _shownNames = new NodeList<SimpleIdentifier>(this, shownNames);
   }
 
-  /**
-   * TODO(paulberry): add commas.
-   */
   @override
+  // TODO(paulberry): add commas.
   Iterable get childEntities => new ChildEntities()
     ..add(keyword)
     ..addAll(_shownNames);
@@ -16006,7 +16455,8 @@
 
   @override
   R visitRedirectingConstructorInvocation(
-      RedirectingConstructorInvocation node) => null;
+          RedirectingConstructorInvocation node) =>
+      null;
 
   @override
   R visitRethrowExpression(RethrowExpression node) => null;
@@ -16238,7 +16688,7 @@
   Token get endToken => token;
 
   /**
-   * Returns `true` if this identifier is the "name" part of a prefixed
+   * Return `true` if this identifier is the "name" part of a prefixed
    * identifier or a method invocation.
    */
   bool get isQualified {
@@ -17227,9 +17677,14 @@
    * Initialize a newly created switch statement. The list of [members] can be
    * `null` if there are no switch members.
    */
-  SwitchStatement(this.switchKeyword, this.leftParenthesis,
-      Expression expression, this.rightParenthesis, this.leftBracket,
-      List<SwitchMember> members, this.rightBracket) {
+  SwitchStatement(
+      this.switchKeyword,
+      this.leftParenthesis,
+      Expression expression,
+      this.rightParenthesis,
+      this.leftBracket,
+      List<SwitchMember> members,
+      this.rightBracket) {
     _expression = _becomeParentOf(expression);
     _members = new NodeList<SwitchMember>(this, members);
   }
@@ -17318,10 +17773,8 @@
   @override
   Token get beginToken => poundSign;
 
-  /**
-   * TODO(paulberry): add "." tokens.
-   */
   @override
+  // TODO(paulberry): add "." tokens.
   Iterable get childEntities => new ChildEntities()
     ..add(poundSign)
     ..addAll(components);
@@ -17602,7 +18055,6 @@
   Object visitAwaitExpression(AwaitExpression node) {
     _writer.print("await ");
     _visitNode(node.expression);
-    _writer.print(";");
     return null;
   }
 
@@ -17893,6 +18345,7 @@
 
   @override
   Object visitFieldFormalParameter(FieldFormalParameter node) {
+    _visitNodeListWithSeparatorAndSuffix(node.metadata, ' ', ' ');
     _visitTokenWithSuffix(node.keyword, " ");
     _visitNodeWithSuffix(node.type, " ");
     _writer.print("this.");
@@ -17971,6 +18424,7 @@
   @override
   Object visitFunctionDeclaration(FunctionDeclaration node) {
     _visitNodeListWithSeparatorAndSuffix(node.metadata, " ", " ");
+    _visitTokenWithSuffix(node.externalKeyword, " ");
     _visitNodeWithSuffix(node.returnType, " ");
     _visitTokenWithSuffix(node.propertyKeyword, " ");
     _visitNode(node.name);
@@ -17988,7 +18442,9 @@
   Object visitFunctionExpression(FunctionExpression node) {
     _visitNode(node.typeParameters);
     _visitNode(node.parameters);
-    _writer.print(' ');
+    if (node.body is! EmptyFunctionBody) {
+      _writer.print(' ');
+    }
     _visitNode(node.body);
     return null;
   }
@@ -18015,6 +18471,7 @@
 
   @override
   Object visitFunctionTypedFormalParameter(FunctionTypedFormalParameter node) {
+    _visitNodeListWithSeparatorAndSuffix(node.metadata, ' ', ' ');
     _visitNodeWithSuffix(node.returnType, " ");
     _visitNode(node.identifier);
     _visitNode(node.typeParameters);
@@ -18345,6 +18802,7 @@
 
   @override
   Object visitSimpleFormalParameter(SimpleFormalParameter node) {
+    _visitNodeListWithSeparatorAndSuffix(node.metadata, ' ', ' ');
     _visitTokenWithSuffix(node.keyword, " ");
     _visitNodeWithSuffix(node.type, " ");
     _visitNode(node.identifier);
@@ -18853,10 +19311,8 @@
   @override
   Token get beginToken => leftBracket;
 
-  /**
-   * TODO(paulberry): Add commas.
-   */
   @override
+  // TODO(paulberry): Add commas.
   Iterable get childEntities => new ChildEntities()
     ..add(leftBracket)
     ..addAll(_arguments)
@@ -19447,7 +19903,8 @@
 
   @override
   R visitRedirectingConstructorInvocation(
-      RedirectingConstructorInvocation node) => visitNode(node);
+          RedirectingConstructorInvocation node) =>
+      visitNode(node);
 
   @override
   R visitRethrowExpression(RethrowExpression node) => visitNode(node);
@@ -19833,10 +20290,8 @@
     _variables = new NodeList<VariableDeclaration>(this, variables);
   }
 
-  /**
-   * TODO(paulberry): include commas.
-   */
   @override
+  // TODO(paulberry): include commas.
   Iterable get childEntities => super._childEntities
     ..add(keyword)
     ..add(_type)
@@ -20089,10 +20544,8 @@
   @override
   Token get beginToken => withKeyword;
 
-  /**
-   * TODO(paulberry): add commas.
-   */
   @override
+  // TODO(paulberry): add commas.
   Iterable get childEntities => new ChildEntities()
     ..add(withKeyword)
     ..addAll(_mixinTypes);
diff --git a/pkg/analyzer/lib/src/generated/constant.dart b/pkg/analyzer/lib/src/generated/constant.dart
index 742f64d..aca4af5 100644
--- a/pkg/analyzer/lib/src/generated/constant.dart
+++ b/pkg/analyzer/lib/src/generated/constant.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.
 
-// This code was auto-generated, is not intended to be edited, and is subject to
-// significant change. Please see the README file for more information.
-
 library engine.constant;
 
 import 'dart:collection';
@@ -217,6 +214,11 @@
       "^(?:${ConstantValueComputer._OPERATOR_RE}\$|$_PUBLIC_IDENTIFIER_RE(?:=?\$|[.](?!\$)))+?\$");
 
   /**
+   * The type provider used to access the known types.
+   */
+  final TypeProvider typeProvider;
+
+  /**
    * The type system.  This is used to gues the types of constants when their
    * exact value is unknown.
    */
@@ -240,17 +242,12 @@
    * given, is used to verify correct dependency analysis when running unit
    * tests.
    */
-  ConstantEvaluationEngine(TypeProvider typeProvider, this._declaredVariables,
-      {ConstantEvaluationValidator validator})
+  ConstantEvaluationEngine(this.typeProvider, this._declaredVariables,
+      {ConstantEvaluationValidator validator, TypeSystem typeSystem})
       : validator = validator != null
-          ? validator
-          : new ConstantEvaluationValidator_ForProduction(),
-        typeSystem = new TypeSystemImpl(typeProvider);
-
-  /**
-   * The type provider used to access the known types.
-   */
-  TypeProvider get typeProvider => typeSystem.typeProvider;
+            ? validator
+            : new ConstantEvaluationValidator_ForProduction(),
+        typeSystem = typeSystem != null ? typeSystem : new TypeSystemImpl();
 
   /**
    * Check that the arguments to a call to fromEnvironment() are correct. The
@@ -261,7 +258,8 @@
    * "defaultValue" is always allowed to be null. Return `true` if the arguments
    * are correct, `false` if there is an error.
    */
-  bool checkFromEnvironmentArguments(NodeList<Expression> arguments,
+  bool checkFromEnvironmentArguments(
+      NodeList<Expression> arguments,
       List<DartObjectImpl> argumentValues,
       HashMap<String, DartObjectImpl> namedArgumentValues,
       InterfaceType expectedDefaultValueType) {
@@ -300,7 +298,8 @@
    * named arguments. Return `true` if the arguments are correct, `false` if
    * there is an error.
    */
-  bool checkSymbolArguments(NodeList<Expression> arguments,
+  bool checkSymbolArguments(
+      NodeList<Expression> arguments,
       List<DartObjectImpl> argumentValues,
       HashMap<String, DartObjectImpl> namedArgumentValues) {
     if (arguments.length != 1) {
@@ -312,7 +311,7 @@
     if (!identical(argumentValues[0].type, typeProvider.stringType)) {
       return false;
     }
-    String name = argumentValues[0].stringValue;
+    String name = argumentValues[0].toStringValue();
     return isValidPublicSymbol(name);
   }
 
@@ -321,23 +320,21 @@
    */
   void computeConstantValue(ConstantEvaluationTarget constant) {
     validator.beforeComputeValue(constant);
-    if (constant is ParameterElement) {
+    if (constant is ParameterElementImpl) {
       if (constant.initializer != null) {
-        Expression defaultValue =
-            (constant as PotentiallyConstVariableElement).constantInitializer;
+        Expression defaultValue = constant.constantInitializer;
         if (defaultValue != null) {
           RecordingErrorListener errorListener = new RecordingErrorListener();
           ErrorReporter errorReporter =
               new ErrorReporter(errorListener, constant.source);
           DartObjectImpl dartObject =
               defaultValue.accept(new ConstantVisitor(this, errorReporter));
-          (constant as ParameterElementImpl).evaluationResult =
+          constant.evaluationResult =
               new EvaluationResultImpl(dartObject, errorListener.errors);
         }
       }
-    } else if (constant is VariableElement) {
-      Expression constantInitializer =
-          (constant as PotentiallyConstVariableElement).constantInitializer;
+    } else if (constant is VariableElementImpl) {
+      Expression constantInitializer = constant.constantInitializer;
       if (constantInitializer != null) {
         RecordingErrorListener errorListener = new RecordingErrorListener();
         ErrorReporter errorReporter =
@@ -352,10 +349,11 @@
           if (!runtimeTypeMatch(dartObject, constant.type)) {
             errorReporter.reportErrorForElement(
                 CheckedModeCompileTimeErrorCode.VARIABLE_TYPE_MISMATCH,
-                constant, [dartObject.type, constant.type]);
+                constant,
+                [dartObject.type, constant.type]);
           }
         }
-        (constant as VariableElementImpl).evaluationResult =
+        constant.evaluationResult =
             new EvaluationResultImpl(dartObject, errorListener.errors);
       }
     } else if (constant is ConstructorElement) {
@@ -400,8 +398,11 @@
               errorListener, sourceCompilationUnit.element.source);
           ConstantVisitor constantVisitor =
               new ConstantVisitor(this, errorReporter);
-          DartObjectImpl result = evaluateConstructorCall(constNode,
-              constNode.arguments.arguments, element, constantVisitor,
+          DartObjectImpl result = evaluateConstructorCall(
+              constNode,
+              constNode.arguments.arguments,
+              element,
+              constantVisitor,
               errorReporter);
           elementAnnotation.evaluationResult =
               new EvaluationResultImpl(result, errorListener.errors);
@@ -412,6 +413,12 @@
           elementAnnotation.evaluationResult = new EvaluationResultImpl(null);
         }
       }
+    } else if (constant is VariableElement) {
+      // constant is a VariableElement but not a VariableElementImpl.  This can
+      // happen sometimes in the case of invalid user code (for example, a
+      // constant expression that refers to a nonstatic field inside a generic
+      // class will wind up referring to a FieldMember).  The error is detected
+      // elsewhere, so just silently ignore it here.
     } else {
       // Should not happen.
       assert(false);
@@ -436,15 +443,14 @@
   void computeDependencies(
       ConstantEvaluationTarget constant, ReferenceFinderCallback callback) {
     ReferenceFinder referenceFinder = new ReferenceFinder(callback);
-    if (constant is ParameterElement) {
+    if (constant is ParameterElementImpl) {
       if (constant.initializer != null) {
-        Expression defaultValue =
-            (constant as ConstVariableElement).constantInitializer;
+        Expression defaultValue = constant.constantInitializer;
         if (defaultValue != null) {
           defaultValue.accept(referenceFinder);
         }
       }
-    } else if (constant is PotentiallyConstVariableElement) {
+    } else if (constant is VariableElementImpl) {
       Expression initializer = constant.constantInitializer;
       if (initializer != null) {
         initializer.accept(referenceFinder);
@@ -529,6 +535,12 @@
       if (constNode.arguments != null) {
         constNode.arguments.accept(referenceFinder);
       }
+    } else if (constant is VariableElement) {
+      // constant is a VariableElement but not a VariableElementImpl.  This can
+      // happen sometimes in the case of invalid user code (for example, a
+      // constant expression that refers to a nonstatic field inside a generic
+      // class will wind up referring to a FieldMember).  So just don't bother
+      // computing any dependencies.
     } else {
       // Should not happen.
       assert(false);
@@ -546,7 +558,8 @@
    * fromEnvironment(). Return a [DartObjectImpl] object corresponding to the
    * evaluated result.
    */
-  DartObjectImpl computeValueFromEnvironment(DartObject environmentValue,
+  DartObjectImpl computeValueFromEnvironment(
+      DartObject environmentValue,
       DartObjectImpl builtInDefaultValue,
       HashMap<String, DartObjectImpl> namedArgumentValues) {
     DartObjectImpl value = environmentValue as DartObjectImpl;
@@ -573,9 +586,12 @@
     return value;
   }
 
-  DartObjectImpl evaluateConstructorCall(AstNode node,
-      NodeList<Expression> arguments, ConstructorElement constructor,
-      ConstantVisitor constantVisitor, ErrorReporter errorReporter) {
+  DartObjectImpl evaluateConstructorCall(
+      AstNode node,
+      NodeList<Expression> arguments,
+      ConstructorElement constructor,
+      ConstantVisitor constantVisitor,
+      ErrorReporter errorReporter) {
     if (!_getConstructorBase(constructor).isCycleFree) {
       // It's not safe to evaluate this constructor, so bail out.
       // TODO(paulberry): ensure that a reasonable error message is produced
@@ -619,26 +635,29 @@
           return null;
         }
         String variableName =
-            argumentCount < 1 ? null : argumentValues[0].stringValue;
+            argumentCount < 1 ? null : argumentValues[0].toStringValue();
         if (identical(definingClass, typeProvider.boolType)) {
           DartObject valueFromEnvironment;
           valueFromEnvironment =
               _declaredVariables.getBool(typeProvider, variableName);
-          return computeValueFromEnvironment(valueFromEnvironment,
+          return computeValueFromEnvironment(
+              valueFromEnvironment,
               new DartObjectImpl(typeProvider.boolType, BoolState.FALSE_STATE),
               namedArgumentValues);
         } else if (identical(definingClass, typeProvider.intType)) {
           DartObject valueFromEnvironment;
           valueFromEnvironment =
               _declaredVariables.getInt(typeProvider, variableName);
-          return computeValueFromEnvironment(valueFromEnvironment,
+          return computeValueFromEnvironment(
+              valueFromEnvironment,
               new DartObjectImpl(typeProvider.nullType, NullState.NULL_STATE),
               namedArgumentValues);
         } else if (identical(definingClass, typeProvider.stringType)) {
           DartObject valueFromEnvironment;
           valueFromEnvironment =
               _declaredVariables.getString(typeProvider, variableName);
-          return computeValueFromEnvironment(valueFromEnvironment,
+          return computeValueFromEnvironment(
+              valueFromEnvironment,
               new DartObjectImpl(typeProvider.nullType, NullState.NULL_STATE),
               namedArgumentValues);
         }
@@ -651,7 +670,7 @@
               CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION, node);
           return null;
         }
-        String argumentValue = argumentValues[0].stringValue;
+        String argumentValue = argumentValues[0].toStringValue();
         return new DartObjectImpl(
             definingClass, new SymbolState(argumentValue));
       }
@@ -690,7 +709,8 @@
         if (fieldValue != null && !runtimeTypeMatch(fieldValue, fieldType)) {
           errorReporter.reportErrorForNode(
               CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_FIELD_TYPE_MISMATCH,
-              node, [fieldValue.type, field.name, fieldType]);
+              node,
+              [fieldValue.type, field.name, fieldType]);
         }
         fieldMap[field.name] = evaluationResult.value;
       }
@@ -737,7 +757,8 @@
         if (!runtimeTypeMatch(argumentValue, parameter.type)) {
           errorReporter.reportErrorForNode(
               CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH,
-              errorTarget, [argumentValue.type, parameter.type]);
+              errorTarget,
+              [argumentValue.type, parameter.type]);
         }
         if (baseParameter.isInitializingFormal) {
           FieldElement field = (parameter as FieldFormalParameterElement).field;
@@ -750,7 +771,8 @@
               if (!runtimeTypeMatch(argumentValue, fieldType)) {
                 errorReporter.reportErrorForNode(
                     CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH,
-                    errorTarget, [argumentValue.type, fieldType]);
+                    errorTarget,
+                    [argumentValue.type, fieldType]);
               }
             }
             String fieldName = field.name;
@@ -767,7 +789,8 @@
       }
     }
     ConstantVisitor initializerVisitor = new ConstantVisitor(
-        this, errorReporter, lexicalEnvironment: parameterMap);
+        this, errorReporter,
+        lexicalEnvironment: parameterMap);
     String superName = null;
     NodeList<Expression> superArguments = null;
     for (ConstructorInitializer initializer in initializers) {
@@ -790,7 +813,8 @@
             if (!runtimeTypeMatch(evaluationResult, field.type)) {
               errorReporter.reportErrorForNode(
                   CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_FIELD_TYPE_MISMATCH,
-                  node, [evaluationResult.type, fieldName, field.type]);
+                  node,
+                  [evaluationResult.type, fieldName, field.type]);
             }
           }
         }
@@ -806,9 +830,12 @@
         // it redirects to.
         ConstructorElement constructor = initializer.staticElement;
         if (constructor != null && constructor.isConst) {
-          return evaluateConstructorCall(node,
-              initializer.argumentList.arguments, constructor,
-              initializerVisitor, errorReporter);
+          return evaluateConstructorCall(
+              node,
+              initializer.argumentList.arguments,
+              constructor,
+              initializerVisitor,
+              errorReporter);
         }
       }
     }
@@ -828,10 +855,13 @@
     return new DartObjectImpl(definingClass, new GenericState(fieldMap));
   }
 
-  void evaluateSuperConstructorCall(AstNode node,
+  void evaluateSuperConstructorCall(
+      AstNode node,
       HashMap<String, DartObjectImpl> fieldMap,
-      ConstructorElement superConstructor, NodeList<Expression> superArguments,
-      ConstantVisitor initializerVisitor, ErrorReporter errorReporter) {
+      ConstructorElement superConstructor,
+      NodeList<Expression> superArguments,
+      ConstantVisitor initializerVisitor,
+      ErrorReporter errorReporter) {
     if (superConstructor != null && superConstructor.isConst) {
       DartObjectImpl evaluationResult = evaluateConstructorCall(node,
           superArguments, superConstructor, initializerVisitor, errorReporter);
@@ -997,6 +1027,9 @@
       return false;
     }
   }
+
+  @override
+  String toString() => 'Constant: $annotation';
 }
 
 /**
@@ -1061,62 +1094,81 @@
   void beforeGetParameterDefault(ParameterElement parameter) {}
 }
 
-/**
- * Instances of the class `ConstantEvaluator` evaluate constant expressions to
- * produce their compile-time value. According to the Dart Language
- * Specification:
- * <blockquote>
- * A constant expression is one of the following:
- * * A literal number.
- * * A literal boolean.
- * * A literal string where any interpolated expression is a compile-time
- *   constant that evaluates to a numeric, string or boolean value or to
- *   <b>null</b>.
- * * A literal symbol.
- * * <b>null</b>.
- * * A qualified reference to a static constant variable.
- * * An identifier expression that denotes a constant variable, class or type
- *   alias.
- * * A constant constructor invocation.
- * * A constant list literal.
- * * A constant map literal.
- * * A simple or qualified identifier denoting a top-level function or a static
- *   method.
- * * A parenthesized expression <i>(e)</i> where <i>e</i> is a constant
- *   expression.
- * * An expression of the form <i>identical(e<sub>1</sub>, e<sub>2</sub>)</i>
- *   where <i>e<sub>1</sub></i> and <i>e<sub>2</sub></i> are constant
- *   expressions and <i>identical()</i> is statically bound to the predefined
- *   dart function <i>identical()</i> discussed above.
- * * An expression of one of the forms <i>e<sub>1</sub> == e<sub>2</sub></i> or
- *   <i>e<sub>1</sub> != e<sub>2</sub></i> where <i>e<sub>1</sub></i> and
- *   <i>e<sub>2</sub></i> are constant expressions that evaluate to a numeric,
- *   string or boolean value.
- * * An expression of one of the forms <i>!e</i>, <i>e<sub>1</sub> &amp;&amp;
- *   e<sub>2</sub></i> or <i>e<sub>1</sub> || e<sub>2</sub></i>, where <i>e</i>,
- *   <i>e1</sub></i> and <i>e2</sub></i> are constant expressions that evaluate
- *   to a boolean value.
- * * An expression of one of the forms <i>~e</i>, <i>e<sub>1</sub> ^
- *   e<sub>2</sub></i>, <i>e<sub>1</sub> &amp; e<sub>2</sub></i>,
- *   <i>e<sub>1</sub> | e<sub>2</sub></i>, <i>e<sub>1</sub> &gt;&gt;
- *   e<sub>2</sub></i> or <i>e<sub>1</sub> &lt;&lt; e<sub>2</sub></i>, where
- *   <i>e</i>, <i>e<sub>1</sub></i> and <i>e<sub>2</sub></i> are constant
- *   expressions that evaluate to an integer value or to <b>null</b>.
- * * An expression of one of the forms <i>-e</i>, <i>e<sub>1</sub> +
- *   e<sub>2</sub></i>, <i>e<sub>1</sub> -e<sub>2</sub></i>, <i>e<sub>1</sub> *
- *   e<sub>2</sub></i>, <i>e<sub>1</sub> / e<sub>2</sub></i>, <i>e<sub>1</sub>
- *   ~/ e<sub>2</sub></i>, <i>e<sub>1</sub> &gt; e<sub>2</sub></i>,
- *   <i>e<sub>1</sub> &lt; e<sub>2</sub></i>, <i>e<sub>1</sub> &gt;=
- *   e<sub>2</sub></i>, <i>e<sub>1</sub> &lt;= e<sub>2</sub></i> or
- *   <i>e<sub>1</sub> % e<sub>2</sub></i>, where <i>e</i>, <i>e<sub>1</sub></i>
- *   and <i>e<sub>2</sub></i> are constant expressions that evaluate to a
- *   numeric value or to <b>null</b>.
- * * An expression of the form <i>e<sub>1</sub> ? e<sub>2</sub> :
- *   e<sub>3</sub></i> where <i>e<sub>1</sub></i>, <i>e<sub>2</sub></i> and
- *   <i>e<sub>3</sub></i> are constant expressions, and <i>e<sub>1</sub></i>
- *   evaluates to a boolean value.
- * </blockquote>
- */
+/// Instances of the class [ConstantEvaluator] evaluate constant expressions to
+/// produce their compile-time value.
+///
+/// According to the Dart Language Specification:
+///
+/// > A constant expression is one of the following:
+/// >
+/// > * A literal number.
+/// > * A literal boolean.
+/// > * A literal string where any interpolated expression is a compile-time
+/// >   constant that evaluates to a numeric, string or boolean value or to
+/// >   **null**.
+/// > * A literal symbol.
+/// > * **null**.
+/// > * A qualified reference to a static constant variable.
+/// > * An identifier expression that denotes a constant variable, class or type
+/// >   alias.
+/// > * A constant constructor invocation.
+/// > * A constant list literal.
+/// > * A constant map literal.
+/// > * A simple or qualified identifier denoting a top-level function or a
+/// >   static method.
+/// > * A parenthesized expression _(e)_ where _e_ is a constant expression.
+/// > * <span>
+/// >   An expression of the form <i>identical(e<sub>1</sub>, e<sub>2</sub>)</i>
+/// >   where <i>e<sub>1</sub></i> and <i>e<sub>2</sub></i> are constant
+/// >   expressions and <i>identical()</i> is statically bound to the predefined
+/// >   dart function <i>identical()</i> discussed above.
+/// >   </span>
+/// > * <span>
+/// >   An expression of one of the forms <i>e<sub>1</sub> == e<sub>2</sub></i>
+/// >   or <i>e<sub>1</sub> != e<sub>2</sub></i> where <i>e<sub>1</sub></i> and
+/// >   <i>e<sub>2</sub></i> are constant expressions that evaluate to a
+/// >   numeric, string or boolean value.
+/// >   </span>
+/// > * <span>
+/// >   An expression of one of the forms <i>!e</i>, <i>e<sub>1</sub> &amp;&amp;
+/// >   e<sub>2</sub></i> or <i>e<sub>1</sub> || e<sub>2</sub></i>, where
+/// >   <i>e</i>, <i>e<sub>1</sub></i> and <i>e<sub>2</sub></i> are constant
+/// >   expressions that evaluate to a boolean value.
+/// >   </span>
+/// > * <span>
+/// >   An expression of one of the forms <i>~e</i>, <i>e<sub>1</sub> ^
+/// >   e<sub>2</sub></i>, <i>e<sub>1</sub> &amp; e<sub>2</sub></i>,
+/// >   <i>e<sub>1</sub> | e<sub>2</sub></i>, <i>e<sub>1</sub> &gt;&gt;
+/// >   e<sub>2</sub></i> or <i>e<sub>1</sub> &lt;&lt; e<sub>2</sub></i>, where
+/// >   <i>e</i>, <i>e<sub>1</sub></i> and <i>e<sub>2</sub></i> are constant
+/// >   expressions that evaluate to an integer value or to <b>null</b>.
+/// >   </span>
+/// > * <span>
+/// >   An expression of one of the forms <i>-e</i>, <i>e<sub>1</sub> +
+/// >   e<sub>2</sub></i>, <i>e<sub>1</sub> -e<sub>2</sub></i>,
+/// >   <i>e<sub>1</sub> * e<sub>2</sub></i>, <i>e<sub>1</sub> /
+/// >   e<sub>2</sub></i>, <i>e<sub>1</sub> ~/ e<sub>2</sub></i>,
+/// >   <i>e<sub>1</sub> &gt; e<sub>2</sub></i>, <i>e<sub>1</sub> &lt;
+/// >   e<sub>2</sub></i>, <i>e<sub>1</sub> &gt;= e<sub>2</sub></i>,
+/// >   <i>e<sub>1</sub> &lt;= e<sub>2</sub></i> or <i>e<sub>1</sub> %
+/// >   e<sub>2</sub></i>, where <i>e</i>, <i>e<sub>1</sub></i> and
+/// >   <i>e<sub>2</sub></i> are constant expressions that evaluate to a numeric
+/// >   value or to <b>null</b>.
+/// >   </span>
+/// > * <span>
+/// >   An expression of the form <i>e<sub>1</sub> ? e<sub>2</sub> :
+/// >   e<sub>3</sub></i> where <i>e<sub>1</sub></i>, <i>e<sub>2</sub></i> and
+/// >   <i>e<sub>3</sub></i> are constant expressions, and <i>e<sub>1</sub></i>
+/// >   evaluates to a boolean value.
+/// >   </span>
+///
+/// The values returned by instances of this class are therefore `null` and
+/// instances of the classes `Boolean`, `BigInteger`, `Double`, `String`, and
+/// `DartObject`.
+///
+/// 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.
 class ConstantEvaluator {
   /**
    * The source containing the expression(s) that will be evaluated.
@@ -1129,17 +1181,24 @@
   final TypeProvider _typeProvider;
 
   /**
+   * The type system primitives.
+   */
+  final TypeSystem _typeSystem;
+
+  /**
    * Initialize a newly created evaluator to evaluate expressions in the given
    * [source]. The [typeProvider] is the type provider used to access known
    * types.
    */
-  ConstantEvaluator(this._source, this._typeProvider);
+  ConstantEvaluator(this._source, this._typeProvider, {TypeSystem typeSystem})
+      : _typeSystem = typeSystem != null ? typeSystem : new TypeSystemImpl();
 
   EvaluationResult evaluate(Expression expression) {
     RecordingErrorListener errorListener = new RecordingErrorListener();
     ErrorReporter errorReporter = new ErrorReporter(errorListener, _source);
     DartObjectImpl result = expression.accept(new ConstantVisitor(
-        new ConstantEvaluationEngine(_typeProvider, new DeclaredVariables()),
+        new ConstantEvaluationEngine(_typeProvider, new DeclaredVariables(),
+            typeSystem: _typeSystem),
         errorReporter));
     if (result != null) {
       return EvaluationResult.forValue(result);
@@ -1175,8 +1234,9 @@
   @override
   Object visitAnnotation(Annotation node) {
     super.visitAnnotation(node);
+    AnalysisContext owningContext = _getOwningContext();
     constantsToCompute.add(new ConstantEvaluationTarget_Annotation(
-        context, source, librarySource, node));
+        owningContext, source, librarySource, node));
     return null;
   }
 
@@ -1226,6 +1286,14 @@
     }
     return null;
   }
+
+  AnalysisContext _getOwningContext() {
+    if (context is InternalAnalysisContext) {
+      InternalAnalysisContext internalContext = context;
+      return internalContext.getContextFor(librarySource);
+    }
+    return context;
+  }
 }
 
 /**
@@ -1283,9 +1351,10 @@
    */
   ConstantValueComputer(this._context, TypeProvider typeProvider,
       DeclaredVariables declaredVariables,
-      [ConstantEvaluationValidator validator])
+      [ConstantEvaluationValidator validator, TypeSystem typeSystem])
       : evaluationEngine = new ConstantEvaluationEngine(
-          typeProvider, declaredVariables, validator: validator);
+            typeProvider, declaredVariables,
+            validator: validator, typeSystem: typeSystem);
 
   /**
    * Add the constants in the given compilation [unit] to the list of constants
@@ -1547,15 +1616,16 @@
     if (conditionResult == null) {
       return conditionResult;
     }
-    if (conditionResult.isTrue) {
+    if (conditionResult.toBoolValue() == true) {
       return thenResult;
-    } else if (conditionResult.isFalse) {
+    } else if (conditionResult.toBoolValue() == false) {
       return elseResult;
     }
     ParameterizedType thenType = thenResult.type;
     ParameterizedType elseType = elseResult.type;
     return new DartObjectImpl.validWithUnknownValue(
-        _typeSystem.getLeastUpperBound(thenType, elseType) as InterfaceType);
+        _typeSystem.getLeastUpperBound(_typeProvider, thenType, elseType)
+        as InterfaceType);
   }
 
   @override
@@ -1884,64 +1954,214 @@
 }
 
 /**
- * The state of a Dart object.
+ * A representation of the value of a compile-time constant expression.
+ *
+ * Note that, unlike the mirrors system, the object being represented does *not*
+ * exist. This interface allows static analysis tools to determine something
+ * about the state of the object that would exist if the code that creates the
+ * object were executed, but none of the code being analyzed is actually
+ * executed.
  */
 abstract class DartObject {
   /**
    * Return the boolean value of this object, or `null` if either the value of
    * this object is not known or this object is not of type 'bool'.
+   *
+   * Deprecated. Use [toBoolValue].
    */
+  @deprecated
   bool get boolValue;
 
   /**
    * Return the floating point value of this object, or `null` if either the
    * value of this object is not known or this object is not of type 'double'.
+   *
+   * Deprecated. Use [toDoubleValue].
    */
+  @deprecated
   double get doubleValue;
 
   /**
    * Return `true` if this object's value can be represented exactly.
+   *
+   * Deprecated. The semantics of this method were not clear. One semantic is
+   * covered by [hasKnownValue].
    */
+  @deprecated
   bool get hasExactValue;
 
   /**
+   * Return `true` if the value of the object being represented is known.
+   *
+   * This method will return `false` if
+   * * the value being represented is the value of a declared variable (a
+   *   variable whose value is provided at run-time using a `-D` command-line
+   *   option), or
+   * * the value is a function.
+   *
+   * The result of this method does not imply anything about the state of
+   * object representations returned by the method [getField], those that are
+   * elements of the list returned by [toListValue], or the keys or values in
+   * the map returned by [toMapValue]. For example, a representation of a list
+   * can return `true` even if one or more of the elements of that list would
+   * return `false`.
+   */
+  bool get hasKnownValue;
+
+  /**
    * Return the integer value of this object, or `null` if either the value of
    * this object is not known or this object is not of type 'int'.
+   *
+   * Deprecated. Use [toIntValue].
    */
+  @deprecated
   int get intValue;
 
   /**
    * Return `true` if this object represents the value 'false'.
+   *
+   * Deprecated. Use `object.toBoolValue() == false`.
    */
+  @deprecated
   bool get isFalse;
 
   /**
-   * Return `true` if this object represents the value 'null'.
+   * Return `true` if the object being represented represents the value 'null'.
    */
   bool get isNull;
 
   /**
    * Return `true` if this object represents the value 'true'.
+   *
+   * Deprecated. Use `object.toBoolValue() == true`.
    */
+  @deprecated
   bool get isTrue;
 
   /**
    * Return the string value of this object, or `null` if either the value of
    * this object is not known or this object is not of type 'String'.
+   *
+   * Deprecated. Use [toStringValue].
    */
+  @deprecated
   String get stringValue;
 
   /**
-   * Return the run-time type of this object.
+   * Return a representation of the type of the object being represented.
+   *
+   * For values resulting from the invocation of a 'const' constructor, this
+   * will be a representation of the run-time type of the object.
+   *
+   * For values resulting from a literal expression, this will be a
+   * representation of the static type of the value -- `int` for integer
+   * literals, `List` for list literals, etc. -- even when the static type is an
+   * abstract type (such as `List`) and hence will never be the run-time type of
+   * the represented object.
+   *
+   * For values resulting from any other kind of expression, this will be a
+   * representation of the result of evaluating the expression.
+   *
+   * Return `null` if the expression cannot be evaluated, either because it is
+   * not a valid constant expression or because one or more of the values used
+   * in the expression does not have a known value.
+   *
+   * This method can return a representation of the type, even if this object
+   * would return `false` from [hasKnownValue].
    */
   ParameterizedType get type;
 
   /**
    * Return this object's value if it can be represented exactly, or `null` if
    * either the value cannot be represented exactly or if the value is `null`.
-   * Clients should use [hasExactValue] to distinguish between these two cases.
+   * Clients should use `hasExactValue` to distinguish between these two cases.
+   *
+   * Deprecated. Use one of the `isXValue()` methods.
    */
+  @deprecated
   Object get value;
+
+  /**
+   * Return a representation of the value of the field with the given [name].
+   *
+   * Return `null` if either the object being represented does not have a field
+   * with the given name or if the implementation of the class of the object is
+   * invalid, making it impossible to determine that value of the field.
+   *
+   * Note that, unlike the mirrors API, this method does *not* invoke a getter;
+   * it simply returns a representation of the known state of a field.
+   */
+  DartObject getField(String name);
+
+  /**
+   * Return a boolean corresponding to the value of the object being
+   * represented, or `null` if
+   * * this object is not of type 'bool',
+   * * the value of the object being represented is not known, or
+   * * the value of the object being represented is `null`.
+   */
+  bool toBoolValue();
+
+  /**
+   * Return a double corresponding to the value of the object being represented,
+   * or `null`
+   * if
+   * * this object is not of type 'double',
+   * * the value of the object being represented is not known, or
+   * * the value of the object being represented is `null`.
+   */
+  double toDoubleValue();
+
+  /**
+   * Return an integer corresponding to the value of the object being
+   * represented, or `null` if
+   * * this object is not of type 'int',
+   * * the value of the object being represented is not known, or
+   * * the value of the object being represented is `null`.
+   */
+  int toIntValue();
+
+  /**
+   * Return a list corresponding to the value of the object being represented,
+   * or `null` if
+   * * this object is not of type 'List', or
+   * * the value of the object being represented is `null`.
+   */
+  List<DartObject> toListValue();
+
+  /**
+   * Return a map corresponding to the value of the object being represented, or
+   * `null` if
+   * * this object is not of type 'Map', or
+   * * the value of the object being represented is `null`.
+   */
+  Map<DartObject, DartObject> toMapValue();
+
+  /**
+   * Return a string corresponding to the value of the object being represented,
+   * or `null` if
+   * * this object is not of type 'String',
+   * * the value of the object being represented is not known, or
+   * * the value of the object being represented is `null`.
+   */
+  String toStringValue();
+
+  /**
+   * Return a string corresponding to the value of the object being represented,
+   * or `null` if
+   * * this object is not of type 'Symbol', or
+   * * the value of the object being represented is `null`.
+   * (We return the string
+   */
+  String toSymbolValue();
+
+  /**
+   * Return the representation of the type corresponding to the value of the
+   * object being represented, or `null` if
+   * * this object is not of type 'Type', or
+   * * the value of the object being represented is `null`.
+   */
+  ParameterizedType toTypeValue();
 }
 
 /**
@@ -2338,24 +2558,17 @@
     return new DartObjectImpl(type, GenericState.UNKNOWN_VALUE);
   }
 
+  @deprecated
   @override
-  bool get boolValue {
-    if (_state is BoolState) {
-      return (_state as BoolState).value;
-    }
-    return null;
-  }
+  bool get boolValue => toBoolValue();
 
+  @deprecated
   @override
-  double get doubleValue {
-    if (_state is DoubleState) {
-      return (_state as DoubleState).value;
-    }
-    return null;
-  }
+  double get doubleValue => toDoubleValue();
 
   HashMap<String, DartObjectImpl> get fields => _state.fields;
 
+  @deprecated
   @override
   bool get hasExactValue => _state.hasExactValue;
 
@@ -2363,12 +2576,11 @@
   int get hashCode => JenkinsSmiHash.hash2(type.hashCode, _state.hashCode);
 
   @override
-  int get intValue {
-    if (_state is IntState) {
-      return (_state as IntState).value;
-    }
-    return null;
-  }
+  bool get hasKnownValue => !_state.isUnknown;
+
+  @deprecated
+  @override
+  int get intValue => toIntValue();
 
   /**
    * Return `true` if this object represents an object whose type is 'bool'.
@@ -2381,13 +2593,14 @@
    */
   bool get isBoolNumStringOrNull => _state.isBoolNumStringOrNull;
 
+  @deprecated
   @override
-  bool get isFalse =>
-      _state is BoolState && identical((_state as BoolState).value, false);
+  bool get isFalse => toBoolValue() == false;
 
   @override
   bool get isNull => _state is NullState;
 
+  @deprecated
   @override
   bool get isTrue =>
       _state is BoolState && identical((_state as BoolState).value, true);
@@ -2403,14 +2616,11 @@
    */
   bool get isUserDefinedObject => _state is GenericState;
 
+  @deprecated
   @override
-  String get stringValue {
-    if (_state is StringState) {
-      return (_state as StringState).value;
-    }
-    return null;
-  }
+  String get stringValue => toStringValue();
 
+  @deprecated
   @override
   Object get value => _state.value;
 
@@ -2572,6 +2782,14 @@
         typeProvider.boolType, _state.equalEqual(rightOperand._state));
   }
 
+  @override
+  DartObject getField(String name) {
+    if (_state is GenericState) {
+      return (_state as GenericState).fields[name];
+    }
+    return null;
+  }
+
   /**
    * Return the result of invoking the '&gt;' operator on this object with the
    * [rightOperand]. The [typeProvider] is the type provider used to find known
@@ -2593,9 +2811,10 @@
    * Throws an [EvaluationException] if the operator is not appropriate for an
    * object of this kind.
    */
-  DartObjectImpl greaterThanOrEqual(TypeProvider typeProvider,
-      DartObjectImpl rightOperand) => new DartObjectImpl(
-      typeProvider.boolType, _state.greaterThanOrEqual(rightOperand._state));
+  DartObjectImpl greaterThanOrEqual(
+          TypeProvider typeProvider, DartObjectImpl rightOperand) =>
+      new DartObjectImpl(typeProvider.boolType,
+          _state.greaterThanOrEqual(rightOperand._state));
 
   /**
    * Return the result of invoking the '~/' operator on this object with the
@@ -2844,7 +3063,77 @@
   }
 
   @override
+  bool toBoolValue() {
+    if (_state is BoolState) {
+      return (_state as BoolState).value;
+    }
+    return null;
+  }
+
+  @override
+  double toDoubleValue() {
+    if (_state is DoubleState) {
+      return (_state as DoubleState).value;
+    }
+    return null;
+  }
+
+  @override
+  int toIntValue() {
+    if (_state is IntState) {
+      return (_state as IntState).value;
+    }
+    return null;
+  }
+
+  @override
+  List<DartObject> toListValue() {
+    if (_state is ListState) {
+      return (_state as ListState)._elements;
+    }
+    return null;
+  }
+
+  @override
+  Map<DartObject, DartObject> toMapValue() {
+    if (_state is MapState) {
+      return (_state as MapState)._entries;
+    }
+    return null;
+  }
+
+  @override
   String toString() => "${type.displayName} ($_state)";
+
+  @override
+  String toStringValue() {
+    if (_state is StringState) {
+      return (_state as StringState).value;
+    }
+    return null;
+  }
+
+  @override
+  String toSymbolValue() {
+    if (_state is SymbolState) {
+      return (_state as SymbolState).value;
+    }
+    return null;
+  }
+
+  @override
+  ParameterizedType toTypeValue() {
+    if (_state is TypeState) {
+      Element element = (_state as TypeState).value;
+      if (element is ClassElement) {
+        return element.type;
+      }
+      if (element is FunctionElement) {
+        return element.type;
+      }
+    }
+    return null;
+  }
 }
 
 /**
diff --git a/pkg/analyzer/lib/src/generated/element.dart b/pkg/analyzer/lib/src/generated/element.dart
index 69beffe..7085b8d 100644
--- a/pkg/analyzer/lib/src/generated/element.dart
+++ b/pkg/analyzer/lib/src/generated/element.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.
 
-// This code was auto-generated, is not intended to be edited, and is subject to
-// significant change. Please see the README file for more information.
-
 library engine.element;
 
 import 'dart:collection';
+import 'dart:math' show min;
 
 import 'package:analyzer/src/generated/utilities_general.dart';
 import 'package:analyzer/src/task/dart.dart';
@@ -15,7 +13,7 @@
     show AnalysisTarget, ConstantEvaluationTarget;
 
 import 'ast.dart';
-import 'constant.dart' show EvaluationResultImpl;
+import 'constant.dart' show DartObject, EvaluationResultImpl;
 import 'engine.dart' show AnalysisContext, AnalysisEngine, AnalysisException;
 import 'html.dart' show XmlAttributeNode, XmlTagNode;
 import 'java_core.dart';
@@ -556,6 +554,12 @@
   SourceRange withClauseRange;
 
   /**
+   * A flag indicating whether the types associated with the instance members of
+   * this class have been inferred.
+   */
+  bool hasBeenInferred = false;
+
+  /**
    * Initialize a newly created class element to have the given [name] at the
    * given [offset] in the file that contains the declaration of this element.
    */
@@ -1756,6 +1760,9 @@
   ConstFieldElementImpl.forNode(Identifier name) : super.forNode(name);
 
   @override
+  DartObject get constantValue => _result.value;
+
+  @override
   EvaluationResultImpl get evaluationResult => _result;
 
   @override
@@ -1787,6 +1794,9 @@
   ConstLocalVariableElementImpl.forNode(Identifier name) : super.forNode(name);
 
   @override
+  DartObject get constantValue => _result.value;
+
+  @override
   EvaluationResultImpl get evaluationResult => _result;
 
   @override
@@ -2105,6 +2115,9 @@
   ConstTopLevelVariableElementImpl(Identifier name) : super.forNode(name);
 
   @override
+  DartObject get constantValue => _result.value;
+
+  @override
   EvaluationResultImpl get evaluationResult => _result;
 
   @override
@@ -2124,7 +2137,7 @@
  *
  * This class is not intended to be part of the public API for analyzer.
  */
-abstract class ConstVariableElement implements PotentiallyConstVariableElement {
+abstract class ConstVariableElement {
   /**
    * If this element represents a constant variable, and it has an initializer,
    * a copy of the initializer for the constant.  Otherwise `null`.
@@ -2269,6 +2282,9 @@
   DefaultFieldFormalParameterElementImpl(Identifier name) : super(name);
 
   @override
+  DartObject get constantValue => _result.value;
+
+  @override
   EvaluationResultImpl get evaluationResult => _result;
 
   @override
@@ -2293,6 +2309,9 @@
   DefaultParameterElementImpl(Identifier name) : super.forNode(name);
 
   @override
+  DartObject get constantValue => _result.value;
+
+  @override
   EvaluationResultImpl get evaluationResult => _result;
 
   @override
@@ -2459,6 +2478,12 @@
   String get displayName;
 
   /**
+   * Return the source range of the documentation comment for this element,
+   * or `null` if this element does not or cannot have a documentation.
+   */
+  SourceRange get docRange;
+
+  /**
    * Return the element that either physically or logically encloses this
    * element. This will be `null` if this element is a library because libraries
    * are the top-level elements in the model.
@@ -2533,6 +2558,12 @@
   String get name;
 
   /**
+   * Return the length of the name of this element in the file that contains the
+   * declaration of this element, or `0` if this element does not have a name.
+   */
+  int get nameLength;
+
+  /**
    * Return the offset of the name of this element in the file that contains the
    * declaration of this element, or `-1` if this element is synthetic, does not
    * have a name, or otherwise does not have an offset.
@@ -2643,6 +2674,14 @@
   static const List<ElementAnnotation> EMPTY_LIST = const <ElementAnnotation>[];
 
   /**
+   * Return a representation of the value of this annotation.
+   *
+   * Return `null` if the value of this annotation could not be computed because
+   * of errors.
+   */
+  DartObject get constantValue;
+
+  /**
    * Return the element representing the field, variable, or const constructor
    * being used as an annotation.
    */
@@ -2722,6 +2761,9 @@
   ElementAnnotationImpl(this.element);
 
   @override
+  DartObject get constantValue => evaluationResult.value;
+
+  @override
   bool get isDeprecated {
     if (element != null) {
       LibraryElement library = element.library;
@@ -2819,6 +2861,17 @@
   ElementLocation _cachedLocation;
 
   /**
+   * The offset to the beginning of the documentation comment,
+   * or `null` if this element does not have a documentation comment.
+   */
+  int _docRangeOffset;
+
+  /**
+   * The length of the documentation comment range for this element.
+   */
+  int _docRangeLength;
+
+  /**
    * Initialize a newly created element to have the given [name] at the given
    * [_nameOffset].
    */
@@ -2844,6 +2897,14 @@
   String get displayName => _name;
 
   @override
+  SourceRange get docRange {
+    if (_docRangeOffset != null && _docRangeLength != null) {
+      return new SourceRange(_docRangeOffset, _docRangeLength);
+    }
+    return null;
+  }
+
+  @override
   Element get enclosingElement => _enclosingElement;
 
   /**
@@ -2933,10 +2994,10 @@
     _cachedHashCode = null;
   }
 
-  /**
-   * The offset of the name of this element in the file that contains the
-   * declaration of this element.
-   */
+  @override
+  int get nameLength => displayName != null ? displayName.length : 0;
+
+  @override
   int get nameOffset => _nameOffset;
 
   /**
@@ -3093,6 +3154,14 @@
   }
 
   /**
+   * Set the documentation comment source range for this element.
+   */
+  void setDocRange(int offset, int length) {
+    _docRangeOffset = offset;
+    _docRangeLength = length;
+  }
+
+  /**
    * Set whether the given [modifier] is associated with this element to
    * correspond to the given [value].
    */
@@ -3526,6 +3595,14 @@
   List<FunctionElement> get functions;
 
   /**
+   * Return `true` if this executable element did not have an explicit return
+   * type specified for it in the original source. Note that if there was no
+   * explicit return type, and if the element model is fully populated, then
+   * the [returnType] will not be `null`.
+   */
+  bool get hasImplicitReturnType;
+
+  /**
    * Return `true` if this executable element is abstract. Executable elements
    * are abstract if they are not external and have no body.
    */
@@ -3589,7 +3666,9 @@
   List<ParameterElement> get parameters;
 
   /**
-   * Return the return type defined by this executable element.
+   * Return the return type defined by this executable element. If the element
+   * model is fully populated, then the [returnType] will not be `null`, even
+   * if no return type was explicitly specified.
    */
   DartType get returnType;
 
@@ -3702,6 +3781,16 @@
   }
 
   @override
+  bool get hasImplicitReturnType => hasModifier(Modifier.IMPLICIT_TYPE);
+
+  /**
+   * Set whether this executable element has an implicit return type.
+   */
+  void set hasImplicitReturnType(bool hasImplicitReturnType) {
+    setModifier(Modifier.IMPLICIT_TYPE, hasImplicitReturnType);
+  }
+
+  @override
   bool get isAbstract => hasModifier(Modifier.ABSTRACT);
 
   @override
@@ -3888,6 +3977,9 @@
   }
 
   @override
+  bool get hasImplicitReturnType => baseElement.hasImplicitReturnType;
+
+  @override
   bool get isAbstract => baseElement.isAbstract;
 
   @override
@@ -4091,7 +4183,6 @@
  * A concrete implementation of a [FieldElement].
  */
 class FieldElementImpl extends PropertyInducingElementImpl
-    with PotentiallyConstVariableElement
     implements FieldElement {
   /**
    * An empty list of field elements.
@@ -4118,9 +4209,6 @@
       enclosingElement != null ? enclosingElement.isEnum : false;
 
   @override
-  bool get isStatic => hasModifier(Modifier.STATIC);
-
-  @override
   ElementKind get kind => ElementKind.FIELD;
 
   /**
@@ -4235,9 +4323,6 @@
   bool get isEnumConstant => baseElement.isEnumConstant;
 
   @override
-  bool get isStatic => baseElement.isStatic;
-
-  @override
   DartType get propagatedType => substituteFor(baseElement.propagatedType);
 
   @override
@@ -7281,6 +7366,15 @@
   List<ExportElement> _exports = ExportElement.EMPTY_LIST;
 
   /**
+   * A list containing the strongly connected component in the import/export
+   * graph in which the current library resides.  Computed on demand, null
+   * if not present.  If _libraryCycle is set, then the _libraryCycle field
+   * for all libraries reachable from this library in the import/export graph
+   * is also set.
+   */
+  List<LibraryElement> _libraryCycle = null;
+
+  /**
    * A list containing all of the compilation units that are included in this
    * library using a `part` directive.
    */
@@ -7292,6 +7386,9 @@
    */
   FunctionElement _loadLibraryFunction;
 
+  @override
+  final int nameLength;
+
   /**
    * The export [Namespace] of this library, `null` if it has not been
    * computed yet.
@@ -7310,7 +7407,7 @@
    * Initialize a newly created library element in the given [context] to have
    * the given [name] and [offset].
    */
-  LibraryElementImpl(this.context, String name, int offset)
+  LibraryElementImpl(this.context, String name, int offset, this.nameLength)
       : super(name, offset);
 
   /**
@@ -7318,7 +7415,8 @@
    * the given [name].
    */
   LibraryElementImpl.forNode(this.context, LibraryIdentifier name)
-      : super.forNode(name);
+      : super.forNode(name),
+        nameLength = name != null ? name.length : 0;
 
   @override
   CompilationUnitElement get definingCompilationUnit =>
@@ -7419,6 +7517,57 @@
     this._imports = imports;
   }
 
+  /** Given an update to this library which may have added or deleted edges
+   * in the import/export graph originating from this node only, remove any
+   * cached library cycles in the element model which may have been invalidated.
+   */
+  void invalidateLibraryCycles() {
+    if (_libraryCycle == null) {
+      // We have already invalidated this node, or we have never computed
+      // library cycle information for it.  In the former case, we're done. In
+      // the latter case, this node cannot be reachable from any node for which
+      // we have computed library cycle information.  Therefore, any edges added
+      // or deleted in the update causing this invalidation can only be edges to
+      // nodes which either have no library cycle information (and hence do not
+      // need invalidation), or which do not reach this node by any path.
+      // In either case, no further invalidation is needed.
+      return;
+    }
+    // If we have pre-computed library cycle information, then we must
+    // invalidate the information both on this element, and on certain
+    // other elements.  Edges originating at this node may have been
+    // added or deleted.  A deleted edge that points outside of this cycle
+    // cannot change the cycle information for anything outside of this cycle,
+    // and so it is sufficient to delete the cached library information on this
+    // cycle.  An added edge which points to another node within the cycle
+    // only invalidates the cycle.  An added edge which points to a node earlier
+    // in the topological sort of cycles induces no invalidation (since there
+    // are by definition no back edges from earlier cycles in the topological
+    // order, and hence no possible cycle can have been introduced.  The only
+    // remaining case is that we have added an edge to a node which is later
+    // in the topological sort of cycles.  This can induce cycles, since it
+    // represents a new back edge.  It would be sufficient to invalidate the
+    // cycle information for all nodes that are between the target and the
+    // node in the topological order.  For simplicity, we simply invalidate
+    // all nodes which are reachable from the the source node.
+    // Note that in the invalidation phase, we do not cut off when we encounter
+    // a node with no library cycle information, since we do not know whether
+    // we are in the case where invalidation has already been performed, or we
+    // are in the case where library cycles have simply never been computed from
+    // a newly reachable node.
+    Set<LibraryElementImpl> active = new HashSet();
+    void invalidate(LibraryElementImpl library) {
+      if (!active.add(library)) return;
+      if (library._libraryCycle != null) {
+        library._libraryCycle.forEach(invalidate);
+        library._libraryCycle = null;
+      }
+      library.exportedLibraries.forEach(invalidate);
+      library.importedLibraries.forEach(invalidate);
+    }
+    invalidate(this);
+  }
+
   @override
   bool get isBrowserApplication =>
       entryPoint != null && isOrImportsBrowserLibrary;
@@ -7464,52 +7613,73 @@
   @override
   LibraryElement get library => this;
 
-  @override
-  FunctionElement get loadLibraryFunction {
-    if (_loadLibraryFunction == null) {
-      FunctionElementImpl function =
-          new FunctionElementImpl(FunctionElement.LOAD_LIBRARY_NAME, -1);
-      function.synthetic = true;
-      function.enclosingElement = this;
-      function.returnType = loadLibraryReturnType;
-      function.type = new FunctionTypeImpl(function);
-      _loadLibraryFunction = function;
+  List<LibraryElement> get libraryCycle {
+    if (_libraryCycle != null) {
+      return _libraryCycle;
     }
-    return _loadLibraryFunction;
+
+    // Global counter for this run of the algorithm
+    int counter = 0;
+    // The discovery times of each library
+    Map<LibraryElementImpl, int> indices = {};
+    // The set of scc candidates
+    Set<LibraryElementImpl> active = new Set();
+    // The stack of discovered elements
+    List<LibraryElementImpl> stack = [];
+    // For a given library that has not yet been processed by this run of the
+    // algorithm, compute the strongly connected components.
+    int scc(LibraryElementImpl library) {
+      int index = counter++;
+      int root = index;
+      indices[library] = index;
+      active.add(library);
+      stack.add(library);
+      void recurse(LibraryElementImpl child) {
+        if (!indices.containsKey(child)) {
+          // We haven't visited this child yet, so recurse on the child,
+          // returning the lowest numbered node reachable from the child.  If
+          // the child can reach a root which is lower numbered than anything
+          // we've reached so far, update the root.
+          root = min(root, scc(child));
+        } else if (active.contains(child)) {
+          // The child has been visited, but has not yet been placed into a
+          // component.  If the child is higher than anything we've seen so far
+          // update the root appropriately.
+          root = min(root, indices[child]);
+        }
+      }
+      // Recurse on all of the children in the import/export graph, filtering
+      // out those for which library cycles have already been computed.
+      library.exportedLibraries
+          .where((l) => l._libraryCycle == null)
+          .forEach(recurse);
+      library.importedLibraries
+          .where((l) => l._libraryCycle == null)
+          .forEach(recurse);
+
+      if (root == index) {
+        // This is the root of a strongly connected component.
+        // Pop the elements, and share the component across all
+        // of the elements.
+        List<LibraryElement> component = <LibraryElement>[];
+        LibraryElementImpl cur = null;
+        do {
+          cur = stack.removeLast();
+          active.remove(cur);
+          component.add(cur);
+          cur._libraryCycle = component;
+        } while (cur != library);
+      }
+      return root;
+    }
+    scc(library);
+    return _libraryCycle;
   }
 
-  /**
-   * Return the object representing the type 'Future' from the 'dart:async'
-   * library, or the type 'void' if the type 'Future' cannot be accessed.
-   */
-  DartType get loadLibraryReturnType {
-    try {
-      Source asyncSource = context.sourceFactory.forUri(DartSdk.DART_ASYNC);
-      if (asyncSource == null) {
-        AnalysisEngine.instance.logger
-            .logError("Could not create a source for dart:async");
-        return VoidTypeImpl.instance;
-      }
-      LibraryElement asyncElement = context.computeLibraryElement(asyncSource);
-      if (asyncElement == null) {
-        AnalysisEngine.instance.logger
-            .logError("Could not build the element model for dart:async");
-        return VoidTypeImpl.instance;
-      }
-      ClassElement futureElement = asyncElement.getType("Future");
-      if (futureElement == null) {
-        AnalysisEngine.instance.logger
-            .logError("Could not find type Future in dart:async");
-        return VoidTypeImpl.instance;
-      }
-      InterfaceType futureType = futureElement.type;
-      return futureType.substitute4(<DartType>[DynamicTypeImpl.instance]);
-    } on AnalysisException catch (exception, stackTrace) {
-      AnalysisEngine.instance.logger.logError(
-          "Could not build the element model for dart:async",
-          new CaughtException(exception, stackTrace));
-      return VoidTypeImpl.instance;
-    }
+  @override
+  FunctionElement get loadLibraryFunction {
+    assert(_loadLibraryFunction != null);
+    return _loadLibraryFunction;
   }
 
   @override
@@ -7570,6 +7740,20 @@
   @override
   accept(ElementVisitor visitor) => visitor.visitLibraryElement(this);
 
+  /**
+   * Create the [FunctionElement] to be returned by [loadLibraryFunction],
+   * using types provided by [typeProvider].
+   */
+  void createLoadLibraryFunction(TypeProvider typeProvider) {
+    FunctionElementImpl function =
+        new FunctionElementImpl(FunctionElement.LOAD_LIBRARY_NAME, -1);
+    function.synthetic = true;
+    function.enclosingElement = this;
+    function.returnType = typeProvider.futureDynamicType;
+    function.type = new FunctionTypeImpl(function);
+    _loadLibraryFunction = function;
+  }
+
   @override
   ElementImpl getChild(String identifier) {
     if ((_definingCompilationUnit as CompilationUnitElementImpl).identifier ==
@@ -7754,7 +7938,6 @@
  * A concrete implementation of a [LocalVariableElement].
  */
 class LocalVariableElementImpl extends VariableElementImpl
-    with PotentiallyConstVariableElement
     implements LocalVariableElement {
   /**
    * An empty list of field elements.
@@ -7887,6 +8070,9 @@
   @override
   String get displayName => _baseElement.displayName;
 
+  @override
+  SourceRange get docRange => _baseElement.docRange;
+
   int get id => _baseElement.id;
 
   @override
@@ -7920,6 +8106,9 @@
   String get name => _baseElement.name;
 
   @override
+  int get nameLength => _baseElement.nameLength;
+
+  @override
   int get nameOffset => _baseElement.nameOffset;
 
   @deprecated
@@ -8257,45 +8446,52 @@
   static const Modifier HAS_EXT_URI = const Modifier('HAS_EXT_URI', 10);
 
   /**
+   * Indicates that the associated element did not have an explicit type
+   * associated with it. If the element is an [ExecutableElement], then the
+   * type being referred to is the return type.
+   */
+  static const Modifier IMPLICIT_TYPE = const Modifier('IMPLICIT_TYPE', 11);
+
+  /**
    * Indicates that a class can validly be used as a mixin.
    */
-  static const Modifier MIXIN = const Modifier('MIXIN', 11);
+  static const Modifier MIXIN = const Modifier('MIXIN', 12);
 
   /**
    * Indicates that a class is a mixin application.
    */
   static const Modifier MIXIN_APPLICATION =
-      const Modifier('MIXIN_APPLICATION', 12);
+      const Modifier('MIXIN_APPLICATION', 13);
 
   /**
    * Indicates that the value of a parameter or local variable might be mutated
    * within the context.
    */
   static const Modifier POTENTIALLY_MUTATED_IN_CONTEXT =
-      const Modifier('POTENTIALLY_MUTATED_IN_CONTEXT', 13);
+      const Modifier('POTENTIALLY_MUTATED_IN_CONTEXT', 14);
 
   /**
    * Indicates that the value of a parameter or local variable might be mutated
    * within the scope.
    */
   static const Modifier POTENTIALLY_MUTATED_IN_SCOPE =
-      const Modifier('POTENTIALLY_MUTATED_IN_SCOPE', 14);
+      const Modifier('POTENTIALLY_MUTATED_IN_SCOPE', 15);
 
   /**
    * Indicates that a class contains an explicit reference to 'super'.
    */
   static const Modifier REFERENCES_SUPER =
-      const Modifier('REFERENCES_SUPER', 15);
+      const Modifier('REFERENCES_SUPER', 16);
 
   /**
    * Indicates that the pseudo-modifier 'set' was applied to the element.
    */
-  static const Modifier SETTER = const Modifier('SETTER', 16);
+  static const Modifier SETTER = const Modifier('SETTER', 17);
 
   /**
    * Indicates that the modifier 'static' was applied to the element.
    */
-  static const Modifier STATIC = const Modifier('STATIC', 17);
+  static const Modifier STATIC = const Modifier('STATIC', 18);
 
   /**
    * Indicates that the element does not appear in the source code but was
@@ -8303,7 +8499,7 @@
    * constructors, an implicit zero-argument constructor will be created and it
    * will be marked as being synthetic.
    */
-  static const Modifier SYNTHETIC = const Modifier('SYNTHETIC', 18);
+  static const Modifier SYNTHETIC = const Modifier('SYNTHETIC', 19);
 
   static const List<Modifier> values = const [
     ABSTRACT,
@@ -8317,6 +8513,7 @@
     GENERATOR,
     GETTER,
     HAS_EXT_URI,
+    IMPLICIT_TYPE,
     MIXIN,
     MIXIN_APPLICATION,
     POTENTIALLY_MUTATED_IN_CONTEXT,
@@ -8386,6 +8583,9 @@
   String get displayName => _name;
 
   @override
+  SourceRange get docRange => null;
+
+  @override
   Element get enclosingElement => null;
 
   @override
@@ -8425,6 +8625,9 @@
   String get name => _name;
 
   @override
+  int get nameLength => displayName != null ? displayName.length : 0;
+
+  @override
   int get nameOffset => -1;
 
   @deprecated
@@ -8657,6 +8860,12 @@
    */
   List<TypeParameterElement> get typeParameters;
 
+  /**
+   * Append the type, name and possibly the default value of this parameter to
+   * the given [buffer].
+   */
+  void appendToWithoutDelimiters(StringBuffer buffer);
+
   @override
   FormalParameter computeNode();
 }
@@ -8665,7 +8874,7 @@
  * A concrete implementation of a [ParameterElement].
  */
 class ParameterElementImpl extends VariableElementImpl
-    with PotentiallyConstVariableElement
+    with ParameterElementMixin
     implements ParameterElement {
   /**
    * An empty list of parameter elements.
@@ -8801,24 +9010,6 @@
     buffer.write(right);
   }
 
-  /**
-   * Append the type and name of this parameter to the given [buffer].
-   */
-  void appendToWithoutDelimiters(StringBuffer buffer) {
-    buffer.write(type);
-    buffer.write(" ");
-    buffer.write(displayName);
-    if (_defaultValueCode != null) {
-      if (parameterKind == ParameterKind.NAMED) {
-        buffer.write(": ");
-      }
-      if (parameterKind == ParameterKind.POSITIONAL) {
-        buffer.write(" = ");
-      }
-      buffer.write(_defaultValueCode);
-    }
-  }
-
   @override
   FormalParameter computeNode() =>
       getNodeMatching((node) => node is FormalParameter);
@@ -8864,6 +9055,28 @@
 }
 
 /**
+ * A mixin that provides a common implementation for methods defined in
+ * [ParameterElement].
+ */
+abstract class ParameterElementMixin implements ParameterElement {
+  @override
+  void appendToWithoutDelimiters(StringBuffer buffer) {
+    buffer.write(type);
+    buffer.write(" ");
+    buffer.write(displayName);
+    if (defaultValueCode != null) {
+      if (parameterKind == ParameterKind.NAMED) {
+        buffer.write(": ");
+      }
+      if (parameterKind == ParameterKind.POSITIONAL) {
+        buffer.write(" = ");
+      }
+      buffer.write(defaultValueCode);
+    }
+  }
+}
+
+/**
  * A type with type parameters, such as a class or function type alias.
  */
 abstract class ParameterizedType implements DartType {
@@ -8887,7 +9100,9 @@
  * A parameter element defined in a parameterized type where the values of the
  * type parameters are known.
  */
-class ParameterMember extends VariableMember implements ParameterElement {
+class ParameterMember extends VariableMember
+    with ParameterElementMixin
+    implements ParameterElement {
   /**
    * Initialize a newly created element to represent a constructor, based on the
    * [baseElement], defined by the [definingType].
@@ -9018,28 +9233,6 @@
 }
 
 /**
- * Interface used by elements that might represent constant variables.
- *
- * This class may be used as a mixin in the case where [constInitializer] is
- * known to return null.
- *
- * This class is not intended to be part of the public API for analyzer.
- */
-abstract class PotentiallyConstVariableElement
-    implements VariableElementImpl, ConstantEvaluationTarget {
-  /**
-   * If this element represents a constant variable, and it has an initializer,
-   * a copy of the initializer for the constant.  Otherwise `null`.
-   *
-   * Note that in correct Dart code, all constant variables must have
-   * initializers.  However, analyzer also needs to handle incorrect Dart code,
-   * in which case there might be some constant variables that lack
-   * initializers.
-   */
-  Expression get constantInitializer => null;
-}
-
-/**
  * A prefix used to import one or more libraries into another library.
  */
 abstract class PrefixElement implements Element {
@@ -9486,13 +9679,6 @@
   PropertyAccessorElement get getter;
 
   /**
-   * Return `true` if this element is a static element. A static element is an
-   * element that is not associated with a particular instance, but rather with
-   * an entire library or class.
-   */
-  bool get isStatic;
-
-  /**
    * Return the propagated type of this variable, or `null` if type propagation
    * has not been performed, for example because the variable is not final.
    */
@@ -9855,7 +10041,6 @@
  * A concrete implementation of a [TopLevelVariableElement].
  */
 class TopLevelVariableElementImpl extends PropertyInducingElementImpl
-    with PotentiallyConstVariableElement
     implements TopLevelVariableElement {
   /**
    * An empty list of top-level variable elements.
@@ -10449,6 +10634,21 @@
   static const List<VariableElement> EMPTY_LIST = const <VariableElement>[];
 
   /**
+   * Return a representation of the value of this variable.
+   *
+   * Return `null` if either this variable was not declared with the 'const'
+   * modifier or if the value of this variable could not be computed because of
+   * errors.
+   */
+  DartObject get constantValue;
+
+  /**
+   * Return `true` if this variable element did not have an explicit type
+   * specified for it.
+   */
+  bool get hasImplicitType;
+
+  /**
    * Return a synthetic function representing this variable's initializer, or
    * `null` if this variable does not have an initializer. The function will
    * have no parameters. The return type of the function will be the
@@ -10485,6 +10685,19 @@
   bool get isPotentiallyMutatedInScope;
 
   /**
+   * Return `true` if this element is a static variable, as per section 8 of the
+   * Dart Language Specification:
+   *
+   * > A static variable is a variable that is not associated with a particular
+   * > instance, but rather with an entire library or class. Static variables
+   * > include library variables and class variables. Class variables are
+   * > variables whose declaration is immediately nested inside a class
+   * > declaration and includes the modifier static. A library variable is
+   * > implicitly static.
+   */
+  bool get isStatic;
+
+  /**
    * Return the declared type of this variable, or `null` if the variable did
    * not have a declared type (such as if it was declared using the keyword
    * 'var').
@@ -10532,6 +10745,20 @@
     setModifier(Modifier.CONST, isConst);
   }
 
+  @override
+  DartObject get constantValue => null;
+
+  /**
+   * If this element represents a constant variable, and it has an initializer,
+   * a copy of the initializer for the constant.  Otherwise `null`.
+   *
+   * Note that in correct Dart code, all constant variables must have
+   * initializers.  However, analyzer also needs to handle incorrect Dart code,
+   * in which case there might be some constant variables that lack
+   * initializers.
+   */
+  Expression get constantInitializer => null;
+
   /**
    * Return the result of evaluating this variable's initializer as a
    * compile-time constant expression, or `null` if this variable is not a
@@ -10557,6 +10784,16 @@
   }
 
   @override
+  bool get hasImplicitType => hasModifier(Modifier.IMPLICIT_TYPE);
+
+  /**
+   * Set whether this variable element has an implicit type.
+   */
+  void set hasImplicitType(bool hasImplicitType) {
+    setModifier(Modifier.IMPLICIT_TYPE, hasImplicitType);
+  }
+
+  @override
   FunctionElement get initializer => _initializer;
 
   /**
@@ -10583,6 +10820,9 @@
   bool get isPotentiallyMutatedInScope => false;
 
   @override
+  bool get isStatic => hasModifier(Modifier.STATIC);
+
+  @override
   void appendTo(StringBuffer buffer) {
     buffer.write(type);
     buffer.write(" ");
@@ -10612,6 +10852,12 @@
   VariableElement get baseElement => super.baseElement as VariableElement;
 
   @override
+  DartObject get constantValue => baseElement.constantValue;
+
+  @override
+  bool get hasImplicitType => baseElement.hasImplicitType;
+
+  @override
   FunctionElement get initializer {
     //
     // Elements within this element should have type parameters substituted,
@@ -10636,6 +10882,9 @@
       baseElement.isPotentiallyMutatedInScope;
 
   @override
+  bool get isStatic => baseElement.isStatic;
+
+  @override
   DartType get type => substituteFor(baseElement.type);
 
   @override
diff --git a/pkg/analyzer/lib/src/generated/element_handle.dart b/pkg/analyzer/lib/src/generated/element_handle.dart
index e5921d6..f496602 100644
--- a/pkg/analyzer/lib/src/generated/element_handle.dart
+++ b/pkg/analyzer/lib/src/generated/element_handle.dart
@@ -2,19 +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.
 
-// This code was auto-generated, is not intended to be edited, and is subject to
-// significant change. Please see the README file for more information.
-
 library engine.element_handle;
 
-import 'ast.dart';
-import 'element.dart';
-import 'engine.dart';
-import 'java_core.dart';
-import 'java_engine.dart';
-import 'resolver.dart';
-import 'source.dart';
-import 'utilities_dart.dart';
+import 'package:analyzer/src/generated/ast.dart';
+import 'package:analyzer/src/generated/constant.dart';
+import 'package:analyzer/src/generated/element.dart';
+import 'package:analyzer/src/generated/engine.dart';
+import 'package:analyzer/src/generated/java_core.dart';
+import 'package:analyzer/src/generated/java_engine.dart';
+import 'package:analyzer/src/generated/resolver.dart';
+import 'package:analyzer/src/generated/source.dart';
+import 'package:analyzer/src/generated/utilities_dart.dart';
 
 /**
  * Instances of the class `ClassElementHandle` implement a handle to a `ClassElement`.
@@ -340,6 +338,9 @@
   String get displayName => actualElement.displayName;
 
   @override
+  SourceRange get docRange => actualElement.docRange;
+
+  @override
   Element get enclosingElement => actualElement.enclosingElement;
 
   @override
@@ -374,6 +375,9 @@
   String get name => actualElement.name;
 
   @override
+  int get nameLength => actualElement.nameLength;
+
+  @override
   int get nameOffset => actualElement.nameOffset;
 
   @deprecated
@@ -515,6 +519,9 @@
   List<FunctionElement> get functions => actualElement.functions;
 
   @override
+  bool get hasImplicitReturnType => actualElement.hasImplicitReturnType;
+
+  @override
   bool get isAbstract => actualElement.isAbstract;
 
   @override
@@ -610,9 +617,6 @@
   bool get isEnumConstant => actualElement.isEnumConstant;
 
   @override
-  bool get isStatic => actualElement.isStatic;
-
-  @override
   ElementKind get kind => ElementKind.FIELD;
 
   @override
@@ -895,6 +899,7 @@
  * `ParameterElement`.
  */
 class ParameterElementHandle extends VariableElementHandle
+    with ParameterElementMixin
     implements ParameterElement {
   /**
    * Initialize a newly created element handle to represent the given element.
@@ -1020,9 +1025,6 @@
   PropertyAccessorElement get getter => actualElement.getter;
 
   @override
-  bool get isStatic => actualElement.isStatic;
-
-  @override
   DartType get propagatedType => actualElement.propagatedType;
 
   @override
@@ -1091,6 +1093,12 @@
   VariableElement get actualElement => super.actualElement as VariableElement;
 
   @override
+  DartObject get constantValue => actualElement.constantValue;
+
+  @override
+  bool get hasImplicitType => actualElement.hasImplicitType;
+
+  @override
   FunctionElement get initializer => actualElement.initializer;
 
   @override
@@ -1108,8 +1116,12 @@
       actualElement.isPotentiallyMutatedInScope;
 
   @override
+  bool get isStatic => actualElement.isStatic;
+
+  @override
   DartType get type => actualElement.type;
 }
+
 /**
  * TODO(scheglov) invalid implementation
  */
diff --git a/pkg/analyzer/lib/src/generated/element_resolver.dart b/pkg/analyzer/lib/src/generated/element_resolver.dart
index 1e5794a..ffe623b 100644
--- a/pkg/analyzer/lib/src/generated/element_resolver.dart
+++ b/pkg/analyzer/lib/src/generated/element_resolver.dart
@@ -161,20 +161,20 @@
             _lookUpMethod(leftHandSide, propagatedType, methodName);
         node.propagatedElement = propagatedMethod;
         if (_shouldReportMissingMember(staticType, staticMethod)) {
-          _recordUndefinedToken(staticType.element,
-              StaticTypeWarningCode.UNDEFINED_METHOD, operator, [
-            methodName,
-            staticType.displayName
-          ]);
+          _recordUndefinedToken(
+              staticType.element,
+              StaticTypeWarningCode.UNDEFINED_METHOD,
+              operator,
+              [methodName, staticType.displayName]);
         } else if (_enableHints &&
             _shouldReportMissingMember(propagatedType, propagatedMethod) &&
             !_memberFoundInSubclass(
                 propagatedType.element, methodName, true, false)) {
-          _recordUndefinedToken(propagatedType.element,
-              HintCode.UNDEFINED_METHOD, operator, [
-            methodName,
-            propagatedType.displayName
-          ]);
+          _recordUndefinedToken(
+              propagatedType.element,
+              HintCode.UNDEFINED_METHOD,
+              operator,
+              [methodName, propagatedType.displayName]);
         }
       }
     }
@@ -203,6 +203,7 @@
     setMetadata(node.element, node);
     return null;
   }
+
   @override
   Object visitClassTypeAlias(ClassTypeAlias node) {
     setMetadata(node.element, node);
@@ -494,8 +495,13 @@
       node.staticElement = setterStaticMethod;
       node.propagatedElement = setterPropagatedMethod;
       // generate undefined method warning
-      _checkForUndefinedIndexOperator(node, target, getterMethodName,
-          setterStaticMethod, setterPropagatedMethod, staticType,
+      _checkForUndefinedIndexOperator(
+          node,
+          target,
+          getterMethodName,
+          setterStaticMethod,
+          setterPropagatedMethod,
+          staticType,
           propagatedType);
       // lookup getter method
       MethodElement getterStaticMethod =
@@ -507,8 +513,13 @@
           new AuxiliaryElements(getterStaticMethod, getterPropagatedMethod);
       node.auxiliaryElements = auxiliaryElements;
       // generate undefined method warning
-      _checkForUndefinedIndexOperator(node, target, getterMethodName,
-          getterStaticMethod, getterPropagatedMethod, staticType,
+      _checkForUndefinedIndexOperator(
+          node,
+          target,
+          getterMethodName,
+          getterStaticMethod,
+          getterPropagatedMethod,
+          staticType,
           propagatedType);
     } else if (isInGetterContext) {
       // lookup getter method
@@ -592,7 +603,8 @@
         _isDeferredPrefix(target)) {
       if (node.operator.type == sc.TokenType.QUESTION_PERIOD) {
         _resolver.reportErrorForNode(
-            CompileTimeErrorCode.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT, target,
+            CompileTimeErrorCode.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT,
+            target,
             [(target as SimpleIdentifier).name]);
       }
       LibraryElement importedLibrary = _getImportedLibrary(target);
@@ -721,10 +733,8 @@
         ErrorCode proxyErrorCode = (generatedWithTypePropagation
             ? HintCode.UNDEFINED_METHOD
             : StaticTypeWarningCode.UNDEFINED_METHOD);
-        _recordUndefinedNode(targetType.element, proxyErrorCode, methodName, [
-          methodName.name,
-          targetTypeName
-        ]);
+        _recordUndefinedNode(targetType.element, proxyErrorCode, methodName,
+            [methodName.name, targetTypeName]);
       }
     } else if (identical(
         errorCode, StaticTypeWarningCode.UNDEFINED_SUPER_METHOD)) {
@@ -766,17 +776,17 @@
     node.propagatedElement = propagatedMethod;
     if (_shouldReportMissingMember(staticType, staticMethod)) {
       if (operand is SuperExpression) {
-        _recordUndefinedToken(staticType.element,
-            StaticTypeWarningCode.UNDEFINED_SUPER_OPERATOR, node.operator, [
-          methodName,
-          staticType.displayName
-        ]);
+        _recordUndefinedToken(
+            staticType.element,
+            StaticTypeWarningCode.UNDEFINED_SUPER_OPERATOR,
+            node.operator,
+            [methodName, staticType.displayName]);
       } else {
-        _recordUndefinedToken(staticType.element,
-            StaticTypeWarningCode.UNDEFINED_OPERATOR, node.operator, [
-          methodName,
-          staticType.displayName
-        ]);
+        _recordUndefinedToken(
+            staticType.element,
+            StaticTypeWarningCode.UNDEFINED_OPERATOR,
+            node.operator,
+            [methodName, staticType.displayName]);
       }
     } else if (_enableHints &&
         _shouldReportMissingMember(propagatedType, propagatedMethod) &&
@@ -879,27 +889,27 @@
       node.propagatedElement = propagatedMethod;
       if (_shouldReportMissingMember(staticType, staticMethod)) {
         if (operand is SuperExpression) {
-          _recordUndefinedToken(staticType.element,
-              StaticTypeWarningCode.UNDEFINED_SUPER_OPERATOR, operator, [
-            methodName,
-            staticType.displayName
-          ]);
+          _recordUndefinedToken(
+              staticType.element,
+              StaticTypeWarningCode.UNDEFINED_SUPER_OPERATOR,
+              operator,
+              [methodName, staticType.displayName]);
         } else {
-          _recordUndefinedToken(staticType.element,
-              StaticTypeWarningCode.UNDEFINED_OPERATOR, operator, [
-            methodName,
-            staticType.displayName
-          ]);
+          _recordUndefinedToken(
+              staticType.element,
+              StaticTypeWarningCode.UNDEFINED_OPERATOR,
+              operator,
+              [methodName, staticType.displayName]);
         }
       } else if (_enableHints &&
           _shouldReportMissingMember(propagatedType, propagatedMethod) &&
           !_memberFoundInSubclass(
               propagatedType.element, methodName, true, false)) {
-        _recordUndefinedToken(propagatedType.element,
-            HintCode.UNDEFINED_OPERATOR, operator, [
-          methodName,
-          propagatedType.displayName
-        ]);
+        _recordUndefinedToken(
+            propagatedType.element,
+            HintCode.UNDEFINED_OPERATOR,
+            operator,
+            [methodName, propagatedType.displayName]);
       }
     }
     return null;
@@ -964,10 +974,18 @@
       return null;
     }
     //
-    // We ignore identifiers that have already been resolved, such as
-    // identifiers representing the name in a declaration.
+    // Ignore nodes that should have been resolved before getting here.
     //
-    if (node.staticElement != null) {
+    if (node.inDeclarationContext()) {
+      return null;
+    }
+    AstNode parent = node.parent;
+    if (parent is FieldFormalParameter) {
+      return null;
+    } else if (parent is ConstructorFieldInitializer &&
+        parent.fieldName == node) {
+      return null;
+    } else if (parent is Annotation && parent.constructorName == node) {
       return null;
     }
     //
@@ -1005,7 +1023,8 @@
             CompileTimeErrorCode.INVALID_ANNOTATION, annotation);
       } else if (element is PrefixElement) {
         _resolver.reportErrorForNode(
-            CompileTimeErrorCode.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT, node,
+            CompileTimeErrorCode.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT,
+            node,
             [element.name]);
       } else {
         _recordUndefinedNode(_resolver.enclosingClass,
@@ -1052,14 +1071,14 @@
             !enclosingClass.isSuperConstructorAccessible(element))) {
       if (name != null) {
         _resolver.reportErrorForNode(
-            CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER, node, [
-          superType.displayName,
-          name
-        ]);
+            CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER,
+            node,
+            [superType.displayName, name]);
       } else {
         _resolver.reportErrorForNode(
             CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT,
-            node, [superType.displayName]);
+            node,
+            [superType.displayName]);
       }
       return null;
     } else {
@@ -1197,9 +1216,13 @@
    * the target of the expression. The [methodName] is the name of the operator
    * associated with the context of using of the given index expression.
    */
-  bool _checkForUndefinedIndexOperator(IndexExpression expression,
-      Expression target, String methodName, MethodElement staticMethod,
-      MethodElement propagatedMethod, DartType staticType,
+  bool _checkForUndefinedIndexOperator(
+      IndexExpression expression,
+      Expression target,
+      String methodName,
+      MethodElement staticMethod,
+      MethodElement propagatedMethod,
+      DartType staticType,
       DartType propagatedType) {
     bool shouldReportMissingMember_static =
         _shouldReportMissingMember(staticType, staticMethod);
@@ -1226,17 +1249,13 @@
       DartType type =
           shouldReportMissingMember_static ? staticType : propagatedType;
       if (leftBracket == null || rightBracket == null) {
-        _recordUndefinedNode(type.element, errorCode, expression, [
-          methodName,
-          type.displayName
-        ]);
+        _recordUndefinedNode(type.element, errorCode, expression,
+            [methodName, type.displayName]);
       } else {
         int offset = leftBracket.offset;
         int length = rightBracket.offset - offset + 1;
-        _recordUndefinedOffset(type.element, errorCode, offset, length, [
-          methodName,
-          type.displayName
-        ]);
+        _recordUndefinedOffset(type.element, errorCode, offset, length,
+            [methodName, type.displayName]);
       }
       return true;
     }
@@ -1581,8 +1600,10 @@
    * been examined, used to prevent infinite recursion and to optimize the
    * search.
    */
-  PropertyAccessorElement _lookUpGetterInInterfaces(InterfaceType targetType,
-      bool includeTargetType, String getterName,
+  PropertyAccessorElement _lookUpGetterInInterfaces(
+      InterfaceType targetType,
+      bool includeTargetType,
+      String getterName,
       HashSet<ClassElement> visitedInterfaces) {
     // TODO(brianwilkerson) This isn't correct. Section 8.1.1 of the
     // specification (titled "Inheritance and Overriding" under "Interfaces")
@@ -1655,8 +1676,10 @@
    * interfaces that have been examined, used to prevent infinite recursion and
    * to optimize the search.
    */
-  ExecutableElement _lookUpGetterOrMethodInInterfaces(InterfaceType targetType,
-      bool includeTargetType, String memberName,
+  ExecutableElement _lookUpGetterOrMethodInInterfaces(
+      InterfaceType targetType,
+      bool includeTargetType,
+      String memberName,
       HashSet<ClassElement> visitedInterfaces) {
     // TODO(brianwilkerson) This isn't correct. Section 8.1.1 of the
     // specification (titled "Inheritance and Overriding" under "Interfaces")
@@ -1736,8 +1759,10 @@
    * been examined, used to prevent infinite recursion and to optimize the
    * search.
    */
-  MethodElement _lookUpMethodInInterfaces(InterfaceType targetType,
-      bool includeTargetType, String methodName,
+  MethodElement _lookUpMethodInInterfaces(
+      InterfaceType targetType,
+      bool includeTargetType,
+      String methodName,
       HashSet<ClassElement> visitedInterfaces) {
     // TODO(brianwilkerson) This isn't correct. Section 8.1.1 of the
     // specification (titled "Inheritance and Overriding" under "Interfaces")
@@ -1814,8 +1839,10 @@
    * been examined, used to prevent infinite recursion and to optimize the
    * search.
    */
-  PropertyAccessorElement _lookUpSetterInInterfaces(InterfaceType targetType,
-      bool includeTargetType, String setterName,
+  PropertyAccessorElement _lookUpSetterInInterfaces(
+      InterfaceType targetType,
+      bool includeTargetType,
+      String setterName,
       HashSet<ClassElement> visitedInterfaces) {
     // TODO(brianwilkerson) This isn't correct. Section 8.1.1 of the
     // specification (titled "Inheritance and Overriding" under "Interfaces")
@@ -2011,8 +2038,8 @@
       // Class(args)
       if (element1 is ClassElement) {
         ClassElement classElement = element1;
-        constructor = new InterfaceTypeImpl(classElement).lookUpConstructor(
-            null, _definingLibrary);
+        constructor = new InterfaceTypeImpl(classElement)
+            .lookUpConstructor(null, _definingLibrary);
       }
     }
     //
@@ -2040,8 +2067,8 @@
       // Class.constructor(args)
       if (element1 is ClassElement) {
         ClassElement classElement = element1;
-        constructor = new InterfaceTypeImpl(classElement).lookUpConstructor(
-            nameNode2.name, _definingLibrary);
+        constructor = new InterfaceTypeImpl(classElement)
+            .lookUpConstructor(nameNode2.name, _definingLibrary);
         nameNode2.staticElement = constructor;
       }
     }
@@ -2064,8 +2091,8 @@
           return;
         }
         // prefix.Class.constructor(args)
-        constructor = new InterfaceTypeImpl(classElement).lookUpConstructor(
-            name3, _definingLibrary);
+        constructor = new InterfaceTypeImpl(classElement)
+            .lookUpConstructor(name3, _definingLibrary);
         nameNode3.staticElement = constructor;
       }
     }
@@ -2188,19 +2215,15 @@
       ErrorCode errorCode = (reportError
           ? CompileTimeErrorCode.NOT_ENOUGH_REQUIRED_ARGUMENTS
           : StaticWarningCode.NOT_ENOUGH_REQUIRED_ARGUMENTS);
-      _resolver.reportErrorForNode(errorCode, argumentList, [
-        requiredParameters.length,
-        positionalArgumentCount
-      ]);
+      _resolver.reportErrorForNode(errorCode, argumentList,
+          [requiredParameters.length, positionalArgumentCount]);
     } else if (positionalArgumentCount > unnamedParameterCount &&
         noBlankArguments) {
       ErrorCode errorCode = (reportError
           ? CompileTimeErrorCode.EXTRA_POSITIONAL_ARGUMENTS
           : StaticWarningCode.EXTRA_POSITIONAL_ARGUMENTS);
-      _resolver.reportErrorForNode(errorCode, argumentList, [
-        unnamedParameterCount,
-        positionalArgumentCount
-      ]);
+      _resolver.reportErrorForNode(errorCode, argumentList,
+          [unnamedParameterCount, positionalArgumentCount]);
     }
     return resolvedParameters;
   }
@@ -2218,27 +2241,27 @@
       node.propagatedElement = propagatedMethod;
       if (_shouldReportMissingMember(staticType, staticMethod)) {
         if (leftOperand is SuperExpression) {
-          _recordUndefinedToken(staticType.element,
-              StaticTypeWarningCode.UNDEFINED_SUPER_OPERATOR, node.operator, [
-            methodName,
-            staticType.displayName
-          ]);
+          _recordUndefinedToken(
+              staticType.element,
+              StaticTypeWarningCode.UNDEFINED_SUPER_OPERATOR,
+              node.operator,
+              [methodName, staticType.displayName]);
         } else {
-          _recordUndefinedToken(staticType.element,
-              StaticTypeWarningCode.UNDEFINED_OPERATOR, node.operator, [
-            methodName,
-            staticType.displayName
-          ]);
+          _recordUndefinedToken(
+              staticType.element,
+              StaticTypeWarningCode.UNDEFINED_OPERATOR,
+              node.operator,
+              [methodName, staticType.displayName]);
         }
       } else if (_enableHints &&
           _shouldReportMissingMember(propagatedType, propagatedMethod) &&
           !_memberFoundInSubclass(
               propagatedType.element, methodName, true, false)) {
-        _recordUndefinedToken(propagatedType.element,
-            HintCode.UNDEFINED_OPERATOR, node.operator, [
-          methodName,
-          propagatedType.displayName
-        ]);
+        _recordUndefinedToken(
+            propagatedType.element,
+            HintCode.UNDEFINED_OPERATOR,
+            node.operator,
+            [methodName, propagatedType.displayName]);
       }
     }
   }
@@ -2371,7 +2394,8 @@
         if (isConditional) {
           _resolver.reportErrorForNode(
               CompileTimeErrorCode.PREFIX_IDENTIFIER_NOT_FOLLOWED_BY_DOT,
-              target, [target.name]);
+              target,
+              [target.name]);
         }
         //
         // Look to see whether the name of the method is really part of a
@@ -2480,7 +2504,8 @@
             return;
           } else if (classElement.isEnum && propertyName.name == "_name") {
             _resolver.reportErrorForNode(
-                CompileTimeErrorCode.ACCESS_PRIVATE_ENUM_FIELD, propertyName,
+                CompileTimeErrorCode.ACCESS_PRIVATE_ENUM_FIELD,
+                propertyName,
                 [propertyName.name]);
             return;
           }
@@ -2507,10 +2532,8 @@
         } else {
           errorCode = HintCode.UNDEFINED_SETTER;
         }
-        _recordUndefinedNode(declaringElement, errorCode, propertyName, [
-          propertyName.name,
-          displayType.displayName
-        ]);
+        _recordUndefinedNode(declaringElement, errorCode, propertyName,
+            [propertyName.name, displayType.displayName]);
       } else if (propertyName.inGetterContext()) {
         ErrorCode errorCode;
         if (shouldReportMissingMember_static) {
@@ -2530,13 +2553,13 @@
         } else {
           errorCode = HintCode.UNDEFINED_GETTER;
         }
-        _recordUndefinedNode(declaringElement, errorCode, propertyName, [
-          propertyName.name,
-          displayType.displayName
-        ]);
+        _recordUndefinedNode(declaringElement, errorCode, propertyName,
+            [propertyName.name, displayType.displayName]);
       } else {
-        _recordUndefinedNode(declaringElement,
-            StaticWarningCode.UNDEFINED_IDENTIFIER, propertyName,
+        _recordUndefinedNode(
+            declaringElement,
+            StaticWarningCode.UNDEFINED_IDENTIFIER,
+            propertyName,
             [propertyName.name]);
       }
     }
diff --git a/pkg/analyzer/lib/src/generated/engine.dart b/pkg/analyzer/lib/src/generated/engine.dart
index 5086437..5822a61 100644
--- a/pkg/analyzer/lib/src/generated/engine.dart
+++ b/pkg/analyzer/lib/src/generated/engine.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.
 
-// This code was auto-generated, is not intended to be edited, and is subject to
-// significant change. Please see the README file for more information.
-
 library engine;
 
 import 'dart:async';
@@ -21,8 +18,10 @@
 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' as newContext;
 import 'package:analyzer/task/model.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';
 
@@ -432,6 +431,11 @@
   TypeProvider get typeProvider;
 
   /**
+   * Return a type system for this context.
+   */
+  TypeSystem get typeSystem;
+
+  /**
    * Add the given [listener] to the list of objects that are to be notified
    * when various analysis results are produced in this context.
    */
@@ -556,6 +560,13 @@
       Source source, Source librarySource);
 
   /**
+   * Perform work until the given [result] has been computed for the given
+   * [target]. Return the computed value.
+   */
+  Object /*V*/ computeResult(
+      AnalysisTarget target, ResultDescriptor /*<V>*/ result);
+
+  /**
    * Notifies the context that the client is going to stop using this context.
    */
   void dispose();
@@ -580,6 +591,14 @@
       Source unitSource, Source librarySource);
 
   /**
+   * Return configuration data associated with the given key or `null` if no
+   * state has been associated with the given [key].
+   *
+   * See [setConfigurationData].
+   */
+  Object getConfigurationData(ResultDescriptor key);
+
+  /**
    * Return the contents and timestamp of the given [source].
    *
    * This method should be used rather than the method [Source.getContents]
@@ -721,6 +740,15 @@
   ht.HtmlUnit getResolvedHtmlUnit(Source htmlSource);
 
   /**
+   * Return the value of the given [result] for the given [target].
+   *
+   * If the corresponding [target] does not exist, or the [result] is not
+   * computed yet, then the default value is returned.
+   */
+  Object /*V*/ getResult(
+      AnalysisTarget target, ResultDescriptor /*<V>*/ result);
+
+  /**
    * Return a list of the sources being analyzed in this context whose full path
    * is equal to the given [path].
    */
@@ -867,6 +895,13 @@
       Source source, String contents, int offset, int oldLength, int newLength);
 
   /**
+   * Associate this configuration [data] object with the given descriptor [key].
+   *
+   * See [getConfigurationData].
+   */
+  void setConfigurationData(ResultDescriptor key, Object data);
+
+  /**
    * Set the contents of the given [source] to the given [contents] and mark the
    * source as having changed. This has the effect of overriding the default
    * contents of the source. If the contents are `null` the override is removed
@@ -919,6 +954,12 @@
   String name;
 
   /**
+   * Configuration data associated with this context.
+   */
+  final HashMap<ResultDescriptor, Object> _configurationData =
+      new HashMap<ResultDescriptor, Object>();
+
+  /**
    * The set of analysis options controlling the behavior of this context.
    */
   AnalysisOptionsImpl _options = new AnalysisOptionsImpl();
@@ -1027,6 +1068,11 @@
   TypeProvider _typeProvider;
 
   /**
+   * The [TypeSystem] for this context, `null` if not yet created.
+   */
+  TypeSystem _typeSystem;
+
+  /**
    * The object used to manage the list of sources that need to be analyzed.
    */
   WorkManager _workManager = new WorkManager();
@@ -1092,7 +1138,8 @@
    */
   AnalysisContextImpl() {
     _resultRecorder = new AnalysisContextImpl_AnalysisTaskResultRecorder(this);
-    _privatePartition = new UniversalCachePartition(this,
+    _privatePartition = new UniversalCachePartition(
+        this,
         AnalysisOptionsImpl.DEFAULT_CACHE_SIZE,
         new AnalysisContextImpl_ContextRetentionPolicy(this));
     _cache = createCacheFromSourceFactory(null);
@@ -1118,6 +1165,7 @@
         this._options.dart2jsHint != options.dart2jsHint ||
         (this._options.hint && !options.hint) ||
         this._options.preserveComments != options.preserveComments ||
+        this._options.strongMode != options.strongMode ||
         this._options.enableStrictCallChecks !=
             options.enableStrictCallChecks ||
         this._options.enableSuperMixins != options.enableSuperMixins;
@@ -1153,6 +1201,7 @@
     this._options.incrementalValidation = options.incrementalValidation;
     this._options.lint = options.lint;
     this._options.preserveComments = options.preserveComments;
+    this._options.strongMode = options.strongMode;
     _generateImplicitErrors = options.generateImplicitErrors;
     _generateSdkErrors = options.generateSdkErrors;
     if (needsRecompute) {
@@ -1534,6 +1583,19 @@
   }
 
   @override
+  TypeSystem get typeSystem {
+    if (_typeSystem == null) {
+      _typeSystem = TypeSystem.create(this);
+    }
+    return _typeSystem;
+  }
+
+  @override
+  List<newContext.WorkManager> get workManagers {
+    throw new NotImplementedException('In not task-based AnalysisContext.');
+  }
+
+  @override
   void addListener(AnalysisListener listener) {
     if (!_listeners.contains(listener)) {
       _listeners.add(listener);
@@ -1607,31 +1669,13 @@
     if (source == null) {
       return null;
     }
-    CompilationUnit unit = parseCompilationUnit(source);
-    if (unit == null) {
+    SourceRange docRange = element.docRange;
+    if (docRange == null) {
       return null;
     }
-    NodeLocator locator = new NodeLocator(element.nameOffset);
-    AstNode nameNode = locator.searchWithin(unit);
-    while (nameNode != null) {
-      if (nameNode is AnnotatedNode) {
-        Comment comment = nameNode.documentationComment;
-        if (comment == null) {
-          return null;
-        }
-        StringBuffer buffer = new StringBuffer();
-        List<Token> tokens = comment.tokens;
-        for (int i = 0; i < tokens.length; i++) {
-          if (i > 0) {
-            buffer.write("\n");
-          }
-          buffer.write(tokens[i].lexeme);
-        }
-        return buffer.toString();
-      }
-      nameNode = nameNode.parent;
-    }
-    return null;
+    String code = getContents(source).data;
+    String comment = code.substring(docRange.offset, docRange.end);
+    return comment.replaceAll('\r\n', '\n');
   }
 
   @override
@@ -1651,11 +1695,15 @@
             _getDartParseData(source, dartEntry, DartEntry.PARSE_ERRORS));
         dartEntry = _getReadableDartEntry(source);
         if (dartEntry.getValue(DartEntry.SOURCE_KIND) == SourceKind.LIBRARY) {
-          ListUtilities.addAll(errors, _getDartResolutionData(
-              source, source, dartEntry, DartEntry.RESOLUTION_ERRORS));
+          ListUtilities.addAll(
+              errors,
+              _getDartResolutionData(
+                  source, source, dartEntry, DartEntry.RESOLUTION_ERRORS));
           dartEntry = _getReadableDartEntry(source);
-          ListUtilities.addAll(errors, _getDartVerificationData(
-              source, source, dartEntry, DartEntry.VERIFICATION_ERRORS));
+          ListUtilities.addAll(
+              errors,
+              _getDartVerificationData(
+                  source, source, dartEntry, DartEntry.VERIFICATION_ERRORS));
           if (enableHints) {
             dartEntry = _getReadableDartEntry(source);
             ListUtilities.addAll(errors,
@@ -1669,20 +1717,28 @@
         } else {
           List<Source> libraries = getLibrariesContaining(source);
           for (Source librarySource in libraries) {
-            ListUtilities.addAll(errors, _getDartResolutionData(
-                source, librarySource, dartEntry, DartEntry.RESOLUTION_ERRORS));
+            ListUtilities.addAll(
+                errors,
+                _getDartResolutionData(source, librarySource, dartEntry,
+                    DartEntry.RESOLUTION_ERRORS));
             dartEntry = _getReadableDartEntry(source);
-            ListUtilities.addAll(errors, _getDartVerificationData(source,
-                librarySource, dartEntry, DartEntry.VERIFICATION_ERRORS));
+            ListUtilities.addAll(
+                errors,
+                _getDartVerificationData(source, librarySource, dartEntry,
+                    DartEntry.VERIFICATION_ERRORS));
             if (enableHints) {
               dartEntry = _getReadableDartEntry(source);
-              ListUtilities.addAll(errors, _getDartHintData(
-                  source, librarySource, dartEntry, DartEntry.HINTS));
+              ListUtilities.addAll(
+                  errors,
+                  _getDartHintData(
+                      source, librarySource, dartEntry, DartEntry.HINTS));
             }
             if (enableLints) {
               dartEntry = _getReadableDartEntry(source);
-              ListUtilities.addAll(errors, _getDartLintData(
-                  source, librarySource, dartEntry, DartEntry.LINTS));
+              ListUtilities.addAll(
+                  errors,
+                  _getDartLintData(
+                      source, librarySource, dartEntry, DartEntry.LINTS));
             }
           }
         }
@@ -1778,8 +1834,8 @@
   @override
   CancelableFuture<CompilationUnit> computeResolvedCompilationUnitAsync(
       Source unitSource, Source librarySource) {
-    return new _AnalysisFutureHelper<CompilationUnit>(this).computeAsync(
-        unitSource, (SourceEntry sourceEntry) {
+    return new _AnalysisFutureHelper<CompilationUnit>(this)
+        .computeAsync(unitSource, (SourceEntry sourceEntry) {
       if (sourceEntry is DartEntry) {
         if (sourceEntry.getStateInLibrary(
                 DartEntry.RESOLVED_UNIT, librarySource) ==
@@ -1793,6 +1849,11 @@
     });
   }
 
+  @override
+  Object computeResult(AnalysisTarget target, ResultDescriptor result) {
+    return result.defaultValue;
+  }
+
   /**
    * Create an analysis cache based on the given source [factory].
    */
@@ -1901,6 +1962,9 @@
   }
 
   @override
+  Object getConfigurationData(ResultDescriptor key) => _configurationData[key];
+
+  @override
   TimestampedData<String> getContents(Source source) {
     String contents = _contentCache.getContents(source);
     if (contents != null) {
@@ -2120,7 +2184,8 @@
       if (dartEntry == null) {
         AnalysisEngine.instance.logger.logError(
             "Could not compute the public namespace for ${library.source.fullName}",
-            new CaughtException(new AnalysisException(
+            new CaughtException(
+                new AnalysisException(
                     "A Dart file became a non-Dart file: ${source.fullName}"),
                 null));
         return null;
@@ -2170,6 +2235,11 @@
   }
 
   @override
+  Object getResult(AnalysisTarget target, ResultDescriptor result) {
+    return result.defaultValue;
+  }
+
+  @override
   List<Source> getSourcesWithFullName(String path) {
     List<Source> sources = <Source>[];
     MapIterator<Source, SourceEntry> iterator = _cache.iterator();
@@ -2315,7 +2385,8 @@
         _validateLastIncrementalResolutionResult();
         if (_performAnalysisTaskStopwatch != null) {
           AnalysisEngine.instance.instrumentationService.logPerformance(
-              AnalysisPerformanceKind.FULL, _performAnalysisTaskStopwatch,
+              AnalysisPerformanceKind.FULL,
+              _performAnalysisTaskStopwatch,
               'context_id=$_id');
           _performAnalysisTaskStopwatch = null;
         }
@@ -2569,7 +2640,8 @@
 
   @override
   CompilationUnit resolveCompilationUnit2(
-      Source unitSource, Source librarySource) => _getDartResolutionData2(
+          Source unitSource, Source librarySource) =>
+      _getDartResolutionData2(
           unitSource, librarySource, DartEntry.RESOLVED_UNIT, null);
 
   @override
@@ -2589,6 +2661,11 @@
   }
 
   @override
+  void setConfigurationData(ResultDescriptor key, Object data) {
+    _configurationData[key] = data;
+  }
+
+  @override
   void setContents(Source source, String contents) {
     _contentsChanged(source, contents, true);
   }
@@ -2893,7 +2970,9 @@
       // source continues to change, this loop will eventually terminate.
       //
       dartEntry = _cacheDartScanData(source, dartEntry, DartEntry.TOKEN_STREAM);
-      dartEntry = new ParseDartTask(this, source,
+      dartEntry = new ParseDartTask(
+              this,
+              source,
               dartEntry.getValue(DartEntry.TOKEN_STREAM),
               dartEntry.getValue(SourceEntry.LINE_INFO))
           .perform(_resultRecorder) as DartEntry;
@@ -2957,8 +3036,8 @@
       //
       try {
         if (dartEntry.getState(SourceEntry.CONTENT) != CacheState.VALID) {
-          dartEntry = new GetContentTask(this, source)
-              .perform(_resultRecorder) as DartEntry;
+          dartEntry = new GetContentTask(this, source).perform(_resultRecorder)
+              as DartEntry;
         }
         dartEntry = new ScanDartTask(
                 this, source, dartEntry.getValue(SourceEntry.CONTENT))
@@ -3034,8 +3113,8 @@
       //
       try {
         if (htmlEntry.getState(SourceEntry.CONTENT) != CacheState.VALID) {
-          htmlEntry = new GetContentTask(this, source)
-              .perform(_resultRecorder) as HtmlEntry;
+          htmlEntry = new GetContentTask(this, source).perform(_resultRecorder)
+              as HtmlEntry;
         }
         htmlEntry = new ParseHtmlTask(
                 this, source, htmlEntry.getValue(SourceEntry.CONTENT))
@@ -3171,8 +3250,14 @@
       if (contents != originalContents) {
         if (_options.incremental) {
           _incrementalAnalysisCache = IncrementalAnalysisCache.update(
-              _incrementalAnalysisCache, source, originalContents, contents,
-              offset, oldLength, newLength, _getReadableSourceEntry(source));
+              _incrementalAnalysisCache,
+              source,
+              originalContents,
+              contents,
+              offset,
+              oldLength,
+              newLength,
+              _getReadableSourceEntry(source));
         }
         _sourceChanged(source);
         changed = true;
@@ -3220,11 +3305,12 @@
     CompilationUnit unit =
         unitEntry.getValueInLibrary(DartEntry.RESOLVED_UNIT, librarySource);
     if (unit == null) {
-      CaughtException exception = new CaughtException(new AnalysisException(
+      CaughtException exception = new CaughtException(
+          new AnalysisException(
               "Entry has VALID state for RESOLVED_UNIT but null value for ${unitSource.fullName} in ${librarySource.fullName}"),
           null);
-      AnalysisEngine.instance.logger.logInformation(
-          exception.toString(), exception);
+      AnalysisEngine.instance.logger
+          .logInformation(exception.toString(), exception);
       unitEntry.recordResolutionError(exception);
       return new AnalysisContextImpl_TaskData(null, false);
     }
@@ -3322,8 +3408,10 @@
     }
     Token tokenStream = dartEntry.getValue(DartEntry.TOKEN_STREAM);
     dartEntry.setState(DartEntry.TOKEN_STREAM, CacheState.FLUSHED);
-    return new AnalysisContextImpl_TaskData(new ParseDartTask(this, source,
-        tokenStream, dartEntry.getValue(SourceEntry.LINE_INFO)), false);
+    return new AnalysisContextImpl_TaskData(
+        new ParseDartTask(this, source, tokenStream,
+            dartEntry.getValue(SourceEntry.LINE_INFO)),
+        false);
   }
 
   /**
@@ -3356,8 +3444,10 @@
       if (taskData != null) {
         return taskData;
       }
-      return new AnalysisContextImpl_TaskData(new ResolveDartLibraryCycleTask(
-          this, source, source, builder.librariesInCycle), false);
+      return new AnalysisContextImpl_TaskData(
+          new ResolveDartLibraryCycleTask(
+              this, source, source, builder.librariesInCycle),
+          false);
     } on AnalysisException catch (exception, stackTrace) {
       dartEntry
           .recordResolutionError(new CaughtException(exception, stackTrace));
@@ -3377,9 +3467,10 @@
     if (htmlEntry.getState(HtmlEntry.PARSED_UNIT) != CacheState.VALID) {
       return _createParseHtmlTask(source, htmlEntry);
     }
-    return new AnalysisContextImpl_TaskData(new ResolveHtmlTask(this, source,
-        htmlEntry.modificationTime,
-        htmlEntry.getValue(HtmlEntry.PARSED_UNIT)), false);
+    return new AnalysisContextImpl_TaskData(
+        new ResolveHtmlTask(this, source, htmlEntry.modificationTime,
+            htmlEntry.getValue(HtmlEntry.PARSED_UNIT)),
+        false);
   }
 
   /**
@@ -3723,8 +3814,11 @@
    * related to it. Return the task that should be performed, or `null` if there
    * is no more work to be done for the source.
    */
-  AnalysisContextImpl_TaskData _getNextAnalysisTaskForSource(Source source,
-      SourceEntry sourceEntry, bool isPriority, bool hintsEnabled,
+  AnalysisContextImpl_TaskData _getNextAnalysisTaskForSource(
+      Source source,
+      SourceEntry sourceEntry,
+      bool isPriority,
+      bool hintsEnabled,
       bool lintsEnabled) {
     // Refuse to generate tasks for html based files that are above 1500 KB
     if (_isTooBigHtmlSourceEntry(source, sourceEntry)) {
@@ -3914,7 +4008,8 @@
       DartEntry dartEntry = sourceEntry;
       if (dartEntry.getStateInLibrary(DartEntry.RESOLVED_UNIT, librarySource) ==
           CacheState.VALID) {
-        return new TimestampedData<CompilationUnit>(dartEntry.modificationTime,
+        return new TimestampedData<CompilationUnit>(
+            dartEntry.modificationTime,
             dartEntry.getValueInLibrary(
                 DartEntry.RESOLVED_UNIT, librarySource));
       }
@@ -3944,8 +4039,12 @@
    * [_getNextAnalysisTaskForSource]. This method is intended to be used for
    * testing purposes only.
    */
-  void _getSourcesNeedingProcessing(Source source, SourceEntry sourceEntry,
-      bool isPriority, bool hintsEnabled, bool lintsEnabled,
+  void _getSourcesNeedingProcessing(
+      Source source,
+      SourceEntry sourceEntry,
+      bool isPriority,
+      bool hintsEnabled,
+      bool lintsEnabled,
       HashSet<Source> sources) {
     if (sourceEntry is DartEntry) {
       DartEntry dartEntry = sourceEntry;
@@ -4132,23 +4231,6 @@
   bool _isTooBigHtmlSourceEntry(Source source, SourceEntry sourceEntry) =>
       false;
 
-  /**
-   * Log the given debugging [message].
-   */
-  void _logInformation(String message) {
-    AnalysisEngine.instance.logger.logInformation(message);
-  }
-
-  /**
-   * Notify all of the analysis listeners that a task is about to be performed.
-   */
-  void _notifyAboutToPerformTask(String taskDescription) {
-    int count = _listeners.length;
-    for (int i = 0; i < count; i++) {
-      _listeners[i].aboutToPerformTask(this, taskDescription);
-    }
-  }
-
 //  /**
 //   * Notify all of the analysis listeners that the given source is no longer included in the set of
 //   * sources that are being analyzed.
@@ -4228,6 +4310,23 @@
 //  }
 
   /**
+   * Log the given debugging [message].
+   */
+  void _logInformation(String message) {
+    AnalysisEngine.instance.logger.logInformation(message);
+  }
+
+  /**
+   * Notify all of the analysis listeners that a task is about to be performed.
+   */
+  void _notifyAboutToPerformTask(String taskDescription) {
+    int count = _listeners.length;
+    for (int i = 0; i < count; i++) {
+      _listeners[i].aboutToPerformTask(this, taskDescription);
+    }
+  }
+
+  /**
    * Notify all of the analysis listeners that the errors associated with the
    * given [source] has been updated to the given [errors].
    */
@@ -4799,11 +4898,17 @@
       // do resolution
       Stopwatch perfCounter = new Stopwatch()..start();
       PoorMansIncrementalResolver resolver = new PoorMansIncrementalResolver(
-          typeProvider, unitSource, getReadableSourceEntryOrNull(unitSource),
-          null, null, oldUnit, analysisOptions.incrementalApi, analysisOptions);
+          typeProvider,
+          unitSource,
+          getReadableSourceEntryOrNull(unitSource),
+          null,
+          null,
+          oldUnit,
+          analysisOptions.incrementalApi);
       bool success = resolver.resolve(newCode);
       AnalysisEngine.instance.instrumentationService.logPerformance(
-          AnalysisPerformanceKind.INCREMENTAL, perfCounter,
+          AnalysisPerformanceKind.INCREMENTAL,
+          perfCounter,
           'success=$success,context_id=$_id,code_length=${newCode.length}');
       if (!success) {
         return false;
@@ -5023,8 +5128,8 @@
       // library.
       AnalysisTask task = _taskData.task;
       if (task is ResolveDartLibraryTask) {
-        AnalysisContextImpl_this._workManager.addFirst(
-            task.librarySource, SourcePriority.LIBRARY);
+        AnalysisContextImpl_this._workManager
+            .addFirst(task.librarySource, SourcePriority.LIBRARY);
       }
       return;
     }
@@ -5252,8 +5357,8 @@
         AnalysisContextImpl_this._getReadableDartEntry(librarySource);
     if (libraryEntry != null &&
         libraryEntry.getState(DartEntry.PARSED_UNIT) != CacheState.ERROR) {
-      AnalysisContextImpl_this._workManager.addFirst(
-          librarySource, SourcePriority.LIBRARY);
+      AnalysisContextImpl_this._workManager
+          .addFirst(librarySource, SourcePriority.LIBRARY);
       if (_taskData == null) {
         _taskData = AnalysisContextImpl_this._createResolveDartLibraryTask(
             librarySource, libraryEntry);
@@ -5771,6 +5876,11 @@
   static const String SUFFIX_HTML = "html";
 
   /**
+   * The file name used for analysis options files.
+   */
+  static const String ANALYSIS_OPTIONS_FILE = '.analysis_options';
+
+  /**
    * The unique instance of this class.
    */
   static final AnalysisEngine instance = new AnalysisEngine._();
@@ -5826,7 +5936,7 @@
    * A flag indicating whether the (new) task model should be used to perform
    * analysis.
    */
-  bool useTaskModel = false;
+  bool useTaskModel = true;
 
   /**
    * A flag indicating whether the task model should attempt to limit
@@ -5835,6 +5945,11 @@
   bool limitInvalidationInTaskModel = false;
 
   /**
+   * The plugins that are defined outside the `analyzer` package.
+   */
+  List<Plugin> _userDefinedPlugins = <Plugin>[];
+
+  /**
    * The task manager used to manage the tasks used to analyze code.
    */
   TaskManager _taskManager;
@@ -5883,6 +5998,7 @@
         commandLinePlugin,
         optionsPlugin
       ];
+      _supportedPlugins.addAll(_userDefinedPlugins);
     }
     return _supportedPlugins;
   }
@@ -5892,10 +6008,7 @@
    */
   TaskManager get taskManager {
     if (_taskManager == null) {
-      if (enginePlugin.taskExtensionPoint == null) {
-        // The plugin wasn't used, so tasks are not registered.
-        new ExtensionManager().processPlugins([enginePlugin]);
-      }
+      new ExtensionManager().processPlugins(supportedPlugins);
       _taskManager = new TaskManager();
       _taskManager.addTaskDescriptors(enginePlugin.taskDescriptors);
       // TODO(brianwilkerson) Create a way to associate different results with
@@ -5906,6 +6019,18 @@
   }
 
   /**
+   * Set plugins that are defined outside the `analyzer` package.
+   */
+  void set userDefinedPlugins(List<Plugin> plugins) {
+    if (plugins == null) {
+      plugins = <Plugin>[];
+    }
+    _userDefinedPlugins = plugins;
+    _supportedPlugins = null;
+    _taskManager = null;
+  }
+
+  /**
    * Clear any caches holding on to analysis results so that a full re-analysis
    * will be performed the next time an analysis context is created.
    */
@@ -5924,6 +6049,18 @@
   }
 
   /**
+   * Return `true` if the given [fileName] is an analysis options file.
+   */
+  static bool isAnalysisOptionsFileName(String fileName,
+      [pathos.Context context]) {
+    if (fileName == null) {
+      return false;
+    }
+    return (context ?? pathos.posix).basename(fileName) ==
+        ANALYSIS_OPTIONS_FILE;
+  }
+
+  /**
    * Return `true` if the given [fileName] is assumed to contain Dart source
    * code.
    */
@@ -6247,7 +6384,7 @@
    * A flag indicating whether analysis is to generate dart2js related hint
    * results.
    */
-  bool dart2jsHint = true;
+  bool dart2jsHint = false;
 
   /**
    * A flag indicating whether generic methods are to be supported (DEP 22).
@@ -6570,8 +6707,8 @@
       if (contextName == null) {
         contextName = 'unnamed';
       }
-      AnalysisEngine.instance.instrumentationService.logAnalysisTask(
-          contextName, taskDescription);
+      AnalysisEngine.instance.instrumentationService
+          .logAnalysisTask(contextName, taskDescription);
       internalPerform();
     } on AnalysisException {
       rethrow;
@@ -8405,8 +8542,11 @@
       //
       // Use the ErrorVerifier to compute the rest of the errors.
       //
-      ErrorVerifier errorVerifier = new ErrorVerifier(errorReporter,
-          libraryElement, typeProvider, new InheritanceManager(libraryElement),
+      ErrorVerifier errorVerifier = new ErrorVerifier(
+          errorReporter,
+          libraryElement,
+          typeProvider,
+          new InheritanceManager(libraryElement),
           context.analysisOptions.enableSuperMixins);
       _unit.accept(errorVerifier);
       _errors = errorListener.getErrorsForSource(source);
@@ -8441,8 +8581,10 @@
    * @param directive the directive to be verified
    * @param errorListener the error listener to which errors should be reported
    */
-  static void validateReferencedSource(AnalysisContext context,
-      Source librarySource, UriBasedDirective directive,
+  static void validateReferencedSource(
+      AnalysisContext context,
+      Source librarySource,
+      UriBasedDirective directive,
       AnalysisErrorListener errorListener) {
     Source source = directive.source;
     if (source != null) {
@@ -8456,8 +8598,11 @@
       }
     }
     StringLiteral uriLiteral = directive.uri;
-    errorListener.onError(new AnalysisError(librarySource, uriLiteral.offset,
-        uriLiteral.length, CompileTimeErrorCode.URI_DOES_NOT_EXIST,
+    errorListener.onError(new AnalysisError(
+        librarySource,
+        uriLiteral.offset,
+        uriLiteral.length,
+        CompileTimeErrorCode.URI_DOES_NOT_EXIST,
         [directive.uriContent]));
   }
 }
@@ -8549,7 +8694,6 @@
 
 /// Generates lint feedback for a single Dart library.
 class GenerateDartLintsTask extends AnalysisTask {
-
   ///The compilation units that comprise the library, with the defining
   ///compilation unit appearing first in the list.
   final List<TimestampedData<CompilationUnit>> _units;
@@ -8679,11 +8823,13 @@
       TimestampedData<String> data = context.getContents(source);
       _content = data.data;
       _modificationTime = data.modificationTime;
-      AnalysisEngine.instance.instrumentationService.logFileRead(
-          source.fullName, _modificationTime, _content);
+      AnalysisEngine.instance.instrumentationService
+          .logFileRead(source.fullName, _modificationTime, _content);
     } catch (exception, stackTrace) {
-      errors.add(new AnalysisError(
-          source, 0, 0, ScannerErrorCode.UNABLE_GET_CONTENT, [exception]));
+      if (source.exists()) {
+        errors.add(new AnalysisError(
+            source, 0, 0, ScannerErrorCode.UNABLE_GET_CONTENT, [exception]));
+      }
       throw new AnalysisException("Could not get contents of $source",
           new CaughtException(exception, stackTrace));
     }
@@ -8965,8 +9111,14 @@
 
   int _newLength = 0;
 
-  IncrementalAnalysisCache(this.librarySource, this.source, this.resolvedUnit,
-      this.oldContents, this._newContents, this._offset, this._oldLength,
+  IncrementalAnalysisCache(
+      this.librarySource,
+      this.source,
+      this.resolvedUnit,
+      this.oldContents,
+      this._newContents,
+      this._offset,
+      this._oldLength,
       this._newLength);
 
   /**
@@ -9051,9 +9203,15 @@
    * @return the cache used for incremental analysis or `null` if incremental analysis cannot
    *         be performed
    */
-  static IncrementalAnalysisCache update(IncrementalAnalysisCache cache,
-      Source source, String oldContents, String newContents, int offset,
-      int oldLength, int newLength, SourceEntry sourceEntry) {
+  static IncrementalAnalysisCache update(
+      IncrementalAnalysisCache cache,
+      Source source,
+      String oldContents,
+      String newContents,
+      int offset,
+      int oldLength,
+      int newLength,
+      SourceEntry sourceEntry) {
     // Determine the cache resolved unit
     Source librarySource = null;
     CompilationUnit unit = null;
@@ -9290,6 +9448,11 @@
   TypeResolverVisitorFactory get typeResolverVisitorFactory;
 
   /**
+   * A list of all [WorkManager]s used by this context.
+   */
+  List<newContext.WorkManager> get workManagers;
+
+  /**
    * Return a list containing the sources of the libraries that are exported by
    * the library with the given [source]. The list will be empty if the given
    * source is invalid, if the given source does not represent a library, or if
@@ -9479,8 +9642,9 @@
    * Initialize a newly created exception to represent the removal of the given
    * [source].
    */
-  ObsoleteSourceAnalysisException(Source source) : super(
-          "The source '${source.fullName}' was removed while it was being analyzed") {
+  ObsoleteSourceAnalysisException(Source source)
+      : super(
+            "The source '${source.fullName}' was removed while it was being analyzed") {
     this._source = source;
   }
 
@@ -10204,6 +10368,12 @@
  * used to visit that structure.
  */
 class ResolutionEraser extends GeneralizingAstVisitor<Object> {
+  /**
+   * A flag indicating whether the elements associated with declarations should
+   * be erased.
+   */
+  bool eraseDeclarations = true;
+
   @override
   Object visitAssignmentExpression(AssignmentExpression node) {
     node.staticElement = null;
@@ -10226,13 +10396,17 @@
 
   @override
   Object visitCompilationUnit(CompilationUnit node) {
-    node.element = null;
+    if (eraseDeclarations) {
+      node.element = null;
+    }
     return super.visitCompilationUnit(node);
   }
 
   @override
   Object visitConstructorDeclaration(ConstructorDeclaration node) {
-    node.element = null;
+    if (eraseDeclarations) {
+      node.element = null;
+    }
     return super.visitConstructorDeclaration(node);
   }
 
@@ -10250,7 +10424,9 @@
 
   @override
   Object visitDirective(Directive node) {
-    node.element = null;
+    if (eraseDeclarations) {
+      node.element = null;
+    }
     return super.visitDirective(node);
   }
 
@@ -10263,7 +10439,9 @@
 
   @override
   Object visitFunctionExpression(FunctionExpression node) {
-    node.element = null;
+    if (eraseDeclarations) {
+      node.element = null;
+    }
     return super.visitFunctionExpression(node);
   }
 
@@ -10310,7 +10488,9 @@
 
   @override
   Object visitSimpleIdentifier(SimpleIdentifier node) {
-    node.staticElement = null;
+    if (eraseDeclarations || !node.inDeclarationContext()) {
+      node.staticElement = null;
+    }
     node.propagatedElement = null;
     return super.visitSimpleIdentifier(node);
   }
@@ -10324,8 +10504,10 @@
   /**
    * Remove any resolution information from the given AST structure.
    */
-  static void erase(AstNode node) {
-    node.accept(new ResolutionEraser());
+  static void erase(AstNode node, {bool eraseDeclarations: true}) {
+    ResolutionEraser eraser = new ResolutionEraser();
+    eraser.eraseDeclarations = eraseDeclarations;
+    node.accept(eraser);
   }
 }
 
@@ -10837,8 +11019,11 @@
     //
     PerformanceStatistics.errors.makeCurrentWhile(() {
       ErrorReporter errorReporter = new ErrorReporter(errorListener, source);
-      ErrorVerifier errorVerifier = new ErrorVerifier(errorReporter,
-          _libraryElement, typeProvider, inheritanceManager,
+      ErrorVerifier errorVerifier = new ErrorVerifier(
+          errorReporter,
+          _libraryElement,
+          typeProvider,
+          inheritanceManager,
           context.analysisOptions.enableSuperMixins);
       unit.accept(errorVerifier);
       // TODO(paulberry): as a temporary workaround for issue 21572,
diff --git a/pkg/analyzer/lib/src/generated/error.dart b/pkg/analyzer/lib/src/generated/error.dart
index 0964a8c..af45572 100644
--- a/pkg/analyzer/lib/src/generated/error.dart
+++ b/pkg/analyzer/lib/src/generated/error.dart
@@ -6,6 +6,8 @@
 
 import 'dart:collection';
 
+import 'package:source_span/source_span.dart';
+
 import 'ast.dart' show AstNode;
 import 'element.dart';
 import 'java_core.dart';
@@ -28,14 +30,15 @@
    * was found.
    */
   static Comparator<AnalysisError> FILE_COMPARATOR = (AnalysisError o1,
-      AnalysisError o2) => o1.source.shortName.compareTo(o2.source.shortName);
+          AnalysisError o2) =>
+      o1.source.shortName.compareTo(o2.source.shortName);
 
   /**
    * A [Comparator] that sorts error codes first by their severity (errors
    * first, warnings second), and then by the the error code type.
    */
-  static Comparator<AnalysisError> ERROR_CODE_COMPARATOR = (AnalysisError o1,
-      AnalysisError o2) {
+  static Comparator<AnalysisError> ERROR_CODE_COMPARATOR =
+      (AnalysisError o1, AnalysisError o2) {
     ErrorCode errorCode1 = o1.errorCode;
     ErrorCode errorCode2 = o2.errorCode;
     ErrorSeverity errorSeverity1 = errorCode1.errorSeverity;
@@ -293,6 +296,69 @@
 }
 
 /**
+ * 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.
+   *
+   * Parameters:
+   * 0: the plugin name
+   * 1: the unsupported option key
+   */
+  static const AnalysisOptionsWarningCode UNSUPPORTED_OPTION =
+      const AnalysisOptionsWarningCode('UNSUPPORTED_OPTION_ERROR',
+          "The option '{1}' is not supported by {0}");
+
+  /**
+   * 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;
+}
+
+/**
  * An [AnalysisErrorListener] that keeps track of whether any error has been
  * reported to it.
  */
@@ -601,7 +667,7 @@
    */
   static const CompileTimeErrorCode CONFLICTING_TYPE_VARIABLE_AND_CLASS =
       const CompileTimeErrorCode('CONFLICTING_TYPE_VARIABLE_AND_CLASS',
-          "'{0}' cannot be used to name a type varaible in a class with the same name");
+          "'{0}' cannot be used to name a type variable in a class with the same name");
 
   /**
    * 7. Classes: It is a compile time error if a generic class declares a type
@@ -610,7 +676,7 @@
    */
   static const CompileTimeErrorCode CONFLICTING_TYPE_VARIABLE_AND_MEMBER =
       const CompileTimeErrorCode('CONFLICTING_TYPE_VARIABLE_AND_MEMBER',
-          "'{0}' cannot be used to name a type varaible and member in this class");
+          "'{0}' cannot be used to name a type variable and member in this class");
 
   /**
    * 12.11.2 Const: It is a compile-time error if evaluation of a constant
@@ -1560,7 +1626,8 @@
    * 0: the name of the constant that is missing
    */
   static const CompileTimeErrorCode MISSING_ENUM_CONSTANT_IN_SWITCH =
-      const CompileTimeErrorCode('MISSING_ENUM_CONSTANT_IN_SWITCH',
+      const CompileTimeErrorCode(
+          'MISSING_ENUM_CONSTANT_IN_SWITCH',
           "Missing case clause for '{0}'",
           "Add a case clause for the missing constant or add a default clause.");
 
@@ -1596,7 +1663,8 @@
    * https://code.google.com/p/dart/issues/detail?id=15101#c4
    */
   static const CompileTimeErrorCode MIXIN_HAS_NO_CONSTRUCTORS =
-      const CompileTimeErrorCode('MIXIN_HAS_NO_CONSTRUCTORS',
+      const CompileTimeErrorCode(
+          'MIXIN_HAS_NO_CONSTRUCTORS',
           "This mixin application is invalid because all of the constructors "
           "in the base class '{0}' have optional parameters.");
 
@@ -2353,6 +2421,62 @@
 }
 
 /**
+ * An error listener that can be enabled or disabled while executing a function.
+ */
+class DisablableErrorListener implements AnalysisErrorListener {
+  /**
+   * The listener to which errors will be reported if this listener is enabled.
+   */
+  final AnalysisErrorListener baseListener;
+
+  /**
+   * A flag indicating whether this listener is currently enabled.
+   */
+  bool enabled = true;
+
+  /**
+   * Initialize a newly created listener to report errors to the given
+   * [baseListener].
+   */
+  DisablableErrorListener(this.baseListener);
+
+  /**
+   * Disable the processing of errors while evaluating the given [function].
+   * Return the value returned by the function.
+   */
+  dynamic disableWhile(dynamic function()) {
+    bool wasEnabled = enabled;
+    try {
+      enabled = false;
+      return function();
+    } finally {
+      enabled = wasEnabled;
+    }
+  }
+
+  /**
+   * Disable the processing of errors while evaluating the given [function].
+   * Return the value returned by the function.
+   */
+  dynamic enableWhile(dynamic function()) {
+    bool wasEnabled = enabled;
+    try {
+      enabled = true;
+      return function();
+    } finally {
+      enabled = wasEnabled;
+    }
+  }
+
+  @override
+  void onError(AnalysisError error) {
+    if (enabled) {
+      baseListener.onError(error);
+    }
+  }
+}
+
+/**
  * An error code associated with an [AnalysisError].
  *
  * Generally, we want to provide messages that consist of three sentences. From
@@ -2510,16 +2634,15 @@
    * Report an error with the given [errorCode] and [arguments]. The [element]
    * is used to compute the location of the error.
    */
-  void reportErrorForElement(
-      ErrorCode errorCode, Element element, List<Object> arguments) {
-    String displayName = element.displayName;
+  void reportErrorForElement(ErrorCode errorCode, Element element,
+      [List<Object> arguments]) {
     int length = 0;
-    if (displayName != null) {
-      length = displayName.length;
-    } else if (element is ImportElement) {
+    if (element is ImportElement) {
       length = 6; // 'import'.length
     } else if (element is ExportElement) {
       length = 6; // 'export'.length
+    } else {
+      length = element.nameLength;
     }
     reportErrorForOffset(errorCode, element.nameOffset, length, arguments);
   }
@@ -2548,6 +2671,15 @@
   }
 
   /**
+   * Report an error with the given [errorCode] and [arguments]. The location of
+   * the error is specified by the given [span].
+   */
+  void reportErrorForSpan(ErrorCode errorCode, SourceSpan span,
+      [List<Object> arguments]) {
+    reportErrorForOffset(errorCode, span.start.offset, span.length, arguments);
+  }
+
+  /**
    * Report an error with the given [errorCode] and [arguments]. The [token] is
    * used to compute the location of the error.
    */
@@ -2885,7 +3017,8 @@
    * Parameters:
    * 0: the name of the declared return type
    */
-  static const HintCode MISSING_RETURN = const HintCode('MISSING_RETURN',
+  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'");
 
@@ -3037,7 +3170,7 @@
       "The stack trace variable '{0}' is not used and can be removed");
 
   /**
-   * Unused local variables are local varaibles which are never read.
+   * Unused local variables are local variables which are never read.
    */
   static const HintCode UNUSED_LOCAL_VARIABLE = const HintCode(
       'UNUSED_LOCAL_VARIABLE',
@@ -3728,7 +3861,8 @@
    * 2: the name of the second library that the type is found
    */
   static const StaticWarningCode AMBIGUOUS_IMPORT = const StaticWarningCode(
-      'AMBIGUOUS_IMPORT', "The name '{0}' is defined in the libraries {1}",
+      '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.");
 
@@ -3952,18 +4086,6 @@
           "The exported libraries '{0}' and '{1}' cannot have the same name '{2}'");
 
   /**
-   * 14.2 Exports: It is a static warning to export two different libraries with
-   * the same name.
-   *
-   * Parameters:
-   * 0: the uri pointing to a first library
-   * 1: the uri pointing to a second library
-   */
-  static const StaticWarningCode EXPORT_DUPLICATED_LIBRARY_UNNAMED =
-      const StaticWarningCode('EXPORT_DUPLICATED_LIBRARY_UNNAMED',
-          "The exported libraries '{0}' and '{1}' cannot both be unnamed");
-
-  /**
    * 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>.
    *
@@ -4119,18 +4241,6 @@
           "The imported libraries '{0}' and '{1}' cannot have the same name '{2}'");
 
   /**
-   * 14.1 Imports: It is a static warning to import two different libraries with
-   * the same name.
-   *
-   * Parameters:
-   * 0: the uri pointing to a first library
-   * 1: the uri pointing to a second library
-   */
-  static const StaticWarningCode IMPORT_DUPLICATED_LIBRARY_UNNAMED =
-      const StaticWarningCode('IMPORT_DUPLICATED_LIBRARY_UNNAMED',
-          "The imported libraries '{0}' and '{1}' cannot both be unnamed");
-
-  /**
    * 14.1 Imports: It is a static warning if the specified URI of a deferred
    * import does not refer to a library declaration.
    *
diff --git a/pkg/analyzer/lib/src/generated/error_verifier.dart b/pkg/analyzer/lib/src/generated/error_verifier.dart
index 9e25a85..ec9559a 100644
--- a/pkg/analyzer/lib/src/generated/error_verifier.dart
+++ b/pkg/analyzer/lib/src/generated/error_verifier.dart
@@ -70,6 +70,11 @@
   final TypeProvider _typeProvider;
 
   /**
+   * The type system primitives
+   */
+  TypeSystem _typeSystem;
+
+  /**
    * The manager for the inheritance mappings.
    */
   final InheritanceManager _inheritanceManager;
@@ -277,6 +282,7 @@
     _boolType = _typeProvider.boolType;
     _intType = _typeProvider.intType;
     _DISALLOWED_TYPES_TO_EXTEND_OR_IMPLEMENT = _typeProvider.nonSubtypableTypes;
+    _typeSystem = _currentLibrary.context.typeSystem;
   }
 
   @override
@@ -584,6 +590,18 @@
   }
 
   @override
+  Object visitEnumDeclaration(EnumDeclaration node) {
+    ClassElement outerClass = _enclosingClass;
+    try {
+      _isInNativeClass = false;
+      _enclosingClass = node.element;
+      return super.visitEnumDeclaration(node);
+    } finally {
+      _enclosingClass = outerClass;
+    }
+  }
+
+  @override
   Object visitExportDirective(ExportDirective node) {
     ExportElement exportElement = node.element;
     if (exportElement != null) {
@@ -925,7 +943,6 @@
 
   @override
   Object visitPropertyAccess(PropertyAccess node) {
-    bool isConditional = node.operator.type == sc.TokenType.QUESTION_PERIOD;
     ClassElement typeReference =
         ElementResolver.getTypeReference(node.realTarget);
     SimpleIdentifier propertyName = node.propertyName;
@@ -1113,7 +1130,8 @@
     }
     // report problem
     _errorReporter.reportErrorForNode(
-        StaticTypeWarningCode.EXPECTED_TWO_MAP_TYPE_ARGUMENTS, typeArguments,
+        StaticTypeWarningCode.EXPECTED_TWO_MAP_TYPE_ARGUMENTS,
+        typeArguments,
         [num]);
     return true;
   }
@@ -1159,14 +1177,16 @@
           if (fieldElement.isFinal || fieldElement.isConst) {
             _errorReporter.reportErrorForNode(
                 StaticWarningCode.FINAL_INITIALIZED_IN_DECLARATION_AND_CONSTRUCTOR,
-                formalParameter.identifier, [fieldElement.displayName]);
+                formalParameter.identifier,
+                [fieldElement.displayName]);
             foundError = true;
           }
         } else if (state == INIT_STATE.INIT_IN_FIELD_FORMAL) {
           if (fieldElement.isFinal || fieldElement.isConst) {
             _errorReporter.reportErrorForNode(
                 CompileTimeErrorCode.FINAL_INITIALIZED_MULTIPLE_TIMES,
-                formalParameter.identifier, [fieldElement.displayName]);
+                formalParameter.identifier,
+                [fieldElement.displayName]);
             foundError = true;
           }
         }
@@ -1203,7 +1223,8 @@
           } else if (state == INIT_STATE.INIT_IN_INITIALIZERS) {
             _errorReporter.reportErrorForNode(
                 CompileTimeErrorCode.FIELD_INITIALIZED_BY_MULTIPLE_INITIALIZERS,
-                fieldName, [fieldElement.displayName]);
+                fieldName,
+                [fieldElement.displayName]);
             foundError = true;
           }
         }
@@ -1225,7 +1246,8 @@
         if (fieldElement.isConst) {
           _errorReporter.reportErrorForNode(
               CompileTimeErrorCode.CONST_NOT_INITIALIZED,
-              constructor.returnType, [fieldElement.name]);
+              constructor.returnType,
+              [fieldElement.name]);
           foundError = true;
         }
       }
@@ -1236,14 +1258,13 @@
       if (notInitFinalFields.length == 1) {
         analysisError = _errorReporter.newErrorWithProperties(
             StaticWarningCode.FINAL_NOT_INITIALIZED_CONSTRUCTOR_1,
-            constructor.returnType, [notInitFinalFields[0].name]);
+            constructor.returnType,
+            [notInitFinalFields[0].name]);
       } else if (notInitFinalFields.length == 2) {
         analysisError = _errorReporter.newErrorWithProperties(
             StaticWarningCode.FINAL_NOT_INITIALIZED_CONSTRUCTOR_2,
-            constructor.returnType, [
-          notInitFinalFields[0].name,
-          notInitFinalFields[1].name
-        ]);
+            constructor.returnType,
+            [notInitFinalFields[0].name, notInitFinalFields[1].name]);
       } else {
         analysisError = _errorReporter.newErrorWithProperties(
             StaticWarningCode.FINAL_NOT_INITIALIZED_CONSTRUCTOR_3_PLUS,
@@ -1280,8 +1301,10 @@
    */
   bool _checkForAllInvalidOverrideErrorCodes(
       ExecutableElement executableElement,
-      ExecutableElement overriddenExecutable, List<ParameterElement> parameters,
-      List<AstNode> parameterLocations, SimpleIdentifier errorNameTarget) {
+      ExecutableElement overriddenExecutable,
+      List<ParameterElement> parameters,
+      List<AstNode> parameterLocations,
+      SimpleIdentifier errorNameTarget) {
     bool isGetter = false;
     bool isSetter = false;
     if (executableElement is PropertyAccessorElement) {
@@ -1342,11 +1365,14 @@
     }
     // SWC.INVALID_METHOD_OVERRIDE_RETURN_TYPE
     if (overriddenFTReturnType != VoidTypeImpl.instance &&
-        !overridingFTReturnType.isAssignableTo(overriddenFTReturnType)) {
-      _errorReporter.reportTypeErrorForNode(!isGetter
+        !_typeSystem.isAssignableTo(
+            overridingFTReturnType, overriddenFTReturnType)) {
+      _errorReporter.reportTypeErrorForNode(
+          !isGetter
               ? StaticWarningCode.INVALID_METHOD_OVERRIDE_RETURN_TYPE
               : StaticWarningCode.INVALID_GETTER_OVERRIDE_RETURN_TYPE,
-          errorNameTarget, [
+          errorNameTarget,
+          [
         overridingFTReturnType,
         overriddenFTReturnType,
         overriddenExecutable.enclosingElement.displayName
@@ -1359,11 +1385,14 @@
     }
     int parameterIndex = 0;
     for (int i = 0; i < overridingNormalPT.length; i++) {
-      if (!overridingNormalPT[i].isAssignableTo(overriddenNormalPT[i])) {
-        _errorReporter.reportTypeErrorForNode(!isSetter
+      if (!_typeSystem.isAssignableTo(
+          overridingNormalPT[i], overriddenNormalPT[i])) {
+        _errorReporter.reportTypeErrorForNode(
+            !isSetter
                 ? StaticWarningCode.INVALID_METHOD_OVERRIDE_NORMAL_PARAM_TYPE
                 : StaticWarningCode.INVALID_SETTER_OVERRIDE_NORMAL_PARAM_TYPE,
-            parameterLocations[parameterIndex], [
+            parameterLocations[parameterIndex],
+            [
           overridingNormalPT[i],
           overriddenNormalPT[i],
           overriddenExecutable.enclosingElement.displayName
@@ -1374,8 +1403,8 @@
     }
     // SWC.INVALID_METHOD_OVERRIDE_OPTIONAL_PARAM_TYPE
     for (int i = 0; i < overriddenPositionalPT.length; i++) {
-      if (!overridingPositionalPT[i]
-          .isAssignableTo(overriddenPositionalPT[i])) {
+      if (!_typeSystem.isAssignableTo(
+          overridingPositionalPT[i], overriddenPositionalPT[i])) {
         _errorReporter.reportTypeErrorForNode(
             StaticWarningCode.INVALID_METHOD_OVERRIDE_OPTIONAL_PARAM_TYPE,
             parameterLocations[parameterIndex], [
@@ -1397,7 +1426,7 @@
         continue;
       }
       DartType overriddenType = overriddenNamedPT[overriddenName];
-      if (!overriddenType.isAssignableTo(overridingType)) {
+      if (!_typeSystem.isAssignableTo(overriddenType, overridingType)) {
         // lookup the parameter for the error to select
         ParameterElement parameterToSelect = null;
         AstNode parameterLocationToSelect = null;
@@ -1543,8 +1572,10 @@
    * to report problems on.
    */
   bool _checkForAllInvalidOverrideErrorCodesForExecutable(
-      ExecutableElement executableElement, List<ParameterElement> parameters,
-      List<AstNode> parameterLocations, SimpleIdentifier errorNameTarget) {
+      ExecutableElement executableElement,
+      List<ParameterElement> parameters,
+      List<AstNode> parameterLocations,
+      SimpleIdentifier errorNameTarget) {
     //
     // Compute the overridden executable from the InheritanceManager
     //
@@ -1709,10 +1740,8 @@
         ErrorCode errorCode = (declaration.constKeyword != null
             ? CompileTimeErrorCode.REDIRECT_TO_MISSING_CONSTRUCTOR
             : StaticWarningCode.REDIRECT_TO_MISSING_CONSTRUCTOR);
-        _errorReporter.reportErrorForNode(errorCode, redirectedConstructor, [
-          constructorStrName,
-          redirectedType.displayName
-        ]);
+        _errorReporter.reportErrorForNode(errorCode, redirectedConstructor,
+            [constructorStrName, redirectedType.displayName]);
         return true;
       }
       return false;
@@ -1724,19 +1753,22 @@
     //
     FunctionType constructorType = declaration.element.type;
     DartType constructorReturnType = constructorType.returnType;
-    if (!redirectedReturnType.isAssignableTo(constructorReturnType)) {
+    if (!_typeSystem.isAssignableTo(
+        redirectedReturnType, constructorReturnType)) {
       _errorReporter.reportErrorForNode(
           StaticWarningCode.REDIRECT_TO_INVALID_RETURN_TYPE,
-          redirectedConstructor, [redirectedReturnType, constructorReturnType]);
+          redirectedConstructor,
+          [redirectedReturnType, constructorReturnType]);
       return true;
     }
     //
     // Check parameters
     //
-    if (!redirectedType.isSubtypeOf(constructorType)) {
+    if (!_typeSystem.isSubtypeOf(redirectedType, constructorType)) {
       _errorReporter.reportErrorForNode(
           StaticWarningCode.REDIRECT_TO_INVALID_FUNCTION_TYPE,
-          redirectedConstructor, [redirectedType, constructorType]);
+          redirectedConstructor,
+          [redirectedType, constructorType]);
       return true;
     }
     return false;
@@ -1779,8 +1811,8 @@
     // RETURN_WITHOUT_VALUE
     if (returnExpression == null) {
       if (_inGenerator ||
-          _computeReturnTypeForMethod(null)
-              .isAssignableTo(expectedReturnType)) {
+          _typeSystem.isAssignableTo(
+              _computeReturnTypeForMethod(null), expectedReturnType)) {
         return false;
       }
       _hasReturnWithoutValue = true;
@@ -1818,8 +1850,8 @@
       Element element = definedNames[name];
       Element prevElement = _exportedElements[name];
       if (element != null && prevElement != null && prevElement != element) {
-        _errorReporter.reportErrorForNode(CompileTimeErrorCode.AMBIGUOUS_EXPORT,
-            directive, [
+        _errorReporter.reportErrorForNode(
+            CompileTimeErrorCode.AMBIGUOUS_EXPORT, directive, [
           name,
           prevElement.library.definingCompilationUnit.displayName,
           element.library.definingCompilationUnit.displayName
@@ -1849,14 +1881,16 @@
    * [StaticWarningCode.MAP_KEY_TYPE_NOT_ASSIGNABLE], and
    * [StaticWarningCode.MAP_VALUE_TYPE_NOT_ASSIGNABLE].
    */
-  bool _checkForArgumentTypeNotAssignable(Expression expression,
-      DartType expectedStaticType, DartType actualStaticType,
+  bool _checkForArgumentTypeNotAssignable(
+      Expression expression,
+      DartType expectedStaticType,
+      DartType actualStaticType,
       ErrorCode errorCode) {
     //
     // Warning case: test static type information
     //
     if (actualStaticType != null && expectedStaticType != null) {
-      if (!actualStaticType.isAssignableTo(expectedStaticType)) {
+      if (!_typeSystem.isAssignableTo(actualStaticType, expectedStaticType)) {
         _errorReporter.reportTypeErrorForNode(
             errorCode, expression, [actualStaticType, expectedStaticType]);
         return true;
@@ -1901,8 +1935,10 @@
    * [StaticWarningCode.MAP_VALUE_TYPE_NOT_ASSIGNABLE].
    */
   bool _checkForArgumentTypeNotAssignableWithExpectedTypes(
-      Expression expression, DartType expectedStaticType,
-      ErrorCode errorCode) => _checkForArgumentTypeNotAssignable(
+          Expression expression,
+          DartType expectedStaticType,
+          ErrorCode errorCode) =>
+      _checkForArgumentTypeNotAssignable(
           expression, expectedStaticType, getStaticType(expression), errorCode);
 
   /**
@@ -1943,7 +1979,7 @@
     if (expressionType == null) {
       return false;
     }
-    if (expressionType.isAssignableTo(type)) {
+    if (_typeSystem.isAssignableTo(expressionType, type)) {
       return false;
     }
     _errorReporter.reportErrorForNode(errorCode, expression, arguments);
@@ -1987,7 +2023,8 @@
             element.setter == null &&
             element.isSynthetic) {
           _errorReporter.reportErrorForNode(
-              StaticWarningCode.ASSIGNMENT_TO_FINAL_NO_SETTER, highlightedNode,
+              StaticWarningCode.ASSIGNMENT_TO_FINAL_NO_SETTER,
+              highlightedNode,
               [element.name, element.enclosingElement.displayName]);
           return true;
         }
@@ -2120,12 +2157,11 @@
         overriddenMember = _enclosingClass.lookUpInheritedConcreteMethod(
             memberName, _currentLibrary);
       }
-      if (overriddenMember == null) {
+      if (overriddenMember == null && !_hasNoSuchMethod(_enclosingClass)) {
         _errorReporter.reportErrorForNode(
-            StaticWarningCode.CONCRETE_CLASS_WITH_ABSTRACT_MEMBER, nameNode, [
-          memberName,
-          _enclosingClass.displayName
-        ]);
+            StaticWarningCode.CONCRETE_CLASS_WITH_ABSTRACT_MEMBER,
+            nameNode,
+            [memberName, _enclosingClass.displayName]);
         return true;
       }
     }
@@ -2160,7 +2196,8 @@
               CompileTimeErrorCode.DUPLICATE_CONSTRUCTOR_DEFAULT, constructor);
         } else {
           _errorReporter.reportErrorForNode(
-              CompileTimeErrorCode.DUPLICATE_CONSTRUCTOR_NAME, constructor,
+              CompileTimeErrorCode.DUPLICATE_CONSTRUCTOR_NAME,
+              constructor,
               [name]);
         }
         return true;
@@ -2175,7 +2212,8 @@
       if (field != null) {
         _errorReporter.reportErrorForNode(
             CompileTimeErrorCode.CONFLICTING_CONSTRUCTOR_NAME_AND_FIELD,
-            constructor, [name]);
+            constructor,
+            [name]);
         return true;
       }
       // methods
@@ -2183,7 +2221,8 @@
       if (method != null) {
         _errorReporter.reportErrorForNode(
             CompileTimeErrorCode.CONFLICTING_CONSTRUCTOR_NAME_AND_METHOD,
-            constructor, [name]);
+            constructor,
+            [name]);
         return true;
       }
     }
@@ -2213,9 +2252,8 @@
       }
       // report problem
       hasProblem = true;
-      _errorReporter.reportErrorForOffset(
-          CompileTimeErrorCode.CONFLICTING_GETTER_AND_METHOD, method.nameOffset,
-          name.length, [
+      _errorReporter.reportErrorForElement(
+          CompileTimeErrorCode.CONFLICTING_GETTER_AND_METHOD, method, [
         _enclosingClass.displayName,
         inherited.enclosingElement.displayName,
         name
@@ -2235,9 +2273,8 @@
       }
       // report problem
       hasProblem = true;
-      _errorReporter.reportErrorForOffset(
-          CompileTimeErrorCode.CONFLICTING_METHOD_AND_GETTER,
-          accessor.nameOffset, name.length, [
+      _errorReporter.reportErrorForElement(
+          CompileTimeErrorCode.CONFLICTING_METHOD_AND_GETTER, accessor, [
         _enclosingClass.displayName,
         inherited.enclosingElement.displayName,
         name
@@ -2303,11 +2340,13 @@
       if (getter) {
         _errorReporter.reportErrorForElement(
             StaticWarningCode.CONFLICTING_INSTANCE_GETTER_AND_SUPERCLASS_MEMBER,
-            accessor, [superElementType.displayName]);
+            accessor,
+            [superElementType.displayName]);
       } else {
         _errorReporter.reportErrorForElement(
             StaticWarningCode.CONFLICTING_INSTANCE_SETTER_AND_SUPERCLASS_MEMBER,
-            accessor, [superElementType.displayName]);
+            accessor,
+            [superElementType.displayName]);
       }
     }
     // done
@@ -2389,10 +2428,9 @@
               !conflictingMethod.isGetter) {
             // report problem
             _errorReporter.reportErrorForNode(
-                StaticWarningCode.CONFLICTING_INSTANCE_METHOD_SETTER2, name, [
-              _enclosingClass.displayName,
-              name.name
-            ]);
+                StaticWarningCode.CONFLICTING_INSTANCE_METHOD_SETTER2,
+                name,
+                [_enclosingClass.displayName, name.name]);
             foundError = true;
             addThisMemberToTheMap = false;
           }
@@ -2448,7 +2486,8 @@
     // report problem
     _errorReporter.reportErrorForNode(
         StaticWarningCode.CONFLICTING_STATIC_GETTER_AND_INSTANCE_SETTER,
-        nameNode, [setterType.displayName]);
+        nameNode,
+        [setterType.displayName]);
     return true;
   }
 
@@ -2496,7 +2535,8 @@
     // report problem
     _errorReporter.reportErrorForNode(
         StaticWarningCode.CONFLICTING_STATIC_SETTER_AND_INSTANCE_MEMBER,
-        nameNode, [memberType.displayName]);
+        nameNode,
+        [memberType.displayName]);
     return true;
   }
 
@@ -2514,18 +2554,20 @@
       String name = typeParameter.name;
       // name is same as the name of the enclosing class
       if (_enclosingClass.name == name) {
-        _errorReporter.reportErrorForOffset(
+        _errorReporter.reportErrorForElement(
             CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_CLASS,
-            typeParameter.nameOffset, name.length, [name]);
+            typeParameter,
+            [name]);
         problemReported = true;
       }
       // check members
       if (_enclosingClass.getMethod(name) != null ||
           _enclosingClass.getGetter(name) != null ||
           _enclosingClass.getSetter(name) != null) {
-        _errorReporter.reportErrorForOffset(
+        _errorReporter.reportErrorForElement(
             CompileTimeErrorCode.CONFLICTING_TYPE_VARIABLE_AND_MEMBER,
-            typeParameter.nameOffset, name.length, [name]);
+            typeParameter,
+            [name]);
         problemReported = true;
       }
     }
@@ -2564,7 +2606,8 @@
         }
         _errorReporter.reportErrorForNode(
             CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER,
-            superInvocation, [element.enclosingElement.displayName]);
+            superInvocation,
+            [element.enclosingElement.displayName]);
         return true;
       }
     }
@@ -2587,7 +2630,8 @@
     // default constructor is not 'const', report problem
     _errorReporter.reportErrorForNode(
         CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER,
-        constructor.returnType, [supertype.displayName]);
+        constructor.returnType,
+        [supertype.displayName]);
     return true;
   }
 
@@ -2628,7 +2672,8 @@
       ConstructorName constructorName, TypeName typeName) {
     if (typeName.isDeferred) {
       _errorReporter.reportErrorForNode(
-          CompileTimeErrorCode.CONST_DEFERRED_CLASS, constructorName,
+          CompileTimeErrorCode.CONST_DEFERRED_CLASS,
+          constructorName,
           [typeName.name.name]);
       return true;
     }
@@ -2675,7 +2720,8 @@
    * [StaticWarningCode.NEW_WITH_ABSTRACT_CLASS].
    */
   bool _checkForConstOrNewWithAbstractClass(
-      InstanceCreationExpression expression, TypeName typeName,
+      InstanceCreationExpression expression,
+      TypeName typeName,
       InterfaceType type) {
     if (type.element.isAbstract) {
       ConstructorElement element = expression.staticElement;
@@ -2779,7 +2825,8 @@
    * [CompileTimeErrorCode.CONST_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT].
    */
   bool _checkForConstWithUndefinedConstructor(
-      InstanceCreationExpression expression, ConstructorName constructorName,
+      InstanceCreationExpression expression,
+      ConstructorName constructorName,
       TypeName typeName) {
     // OK if resolved
     if (expression.staticElement != null) {
@@ -2798,14 +2845,14 @@
     SimpleIdentifier name = constructorName.name;
     if (name != null) {
       _errorReporter.reportErrorForNode(
-          CompileTimeErrorCode.CONST_WITH_UNDEFINED_CONSTRUCTOR, name, [
-        className,
-        name
-      ]);
+          CompileTimeErrorCode.CONST_WITH_UNDEFINED_CONSTRUCTOR,
+          name,
+          [className, name]);
     } else {
       _errorReporter.reportErrorForNode(
           CompileTimeErrorCode.CONST_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT,
-          constructorName, [className]);
+          constructorName,
+          [className]);
     }
     return true;
   }
@@ -2954,9 +3001,10 @@
       displayName = enclosingElement.getExtendedDisplayName(null);
     }
     // report problem
-    _errorReporter.reportErrorForOffset(
+    _errorReporter.reportErrorForElement(
         CompileTimeErrorCode.DUPLICATE_DEFINITION_INHERITANCE,
-        staticMember.nameOffset, name.length, [name, displayName]);
+        staticMember,
+        [name, displayName]);
     return true;
   }
 
@@ -2975,7 +3023,8 @@
     }
     // report problem
     _errorReporter.reportErrorForNode(
-        StaticTypeWarningCode.EXPECTED_ONE_LIST_TYPE_ARGUMENTS, typeArguments,
+        StaticTypeWarningCode.EXPECTED_ONE_LIST_TYPE_ARGUMENTS,
+        typeArguments,
         [num]);
     return true;
   }
@@ -2999,13 +3048,7 @@
     LibraryElement prevLibrary = _nameToExportElement[name];
     if (prevLibrary != null) {
       if (prevLibrary != exportedLibrary) {
-        if (name.isEmpty) {
-          _errorReporter.reportErrorForNode(
-              StaticWarningCode.EXPORT_DUPLICATED_LIBRARY_UNNAMED, directive, [
-            prevLibrary.definingCompilationUnit.displayName,
-            exportedLibrary.definingCompilationUnit.displayName
-          ]);
-        } else {
+        if (!name.isEmpty) {
           _errorReporter.reportErrorForNode(
               StaticWarningCode.EXPORT_DUPLICATED_LIBRARY_NAMED, directive, [
             prevLibrary.definingCompilationUnit.displayName,
@@ -3047,7 +3090,8 @@
     }
     // report problem
     _errorReporter.reportErrorForNode(
-        CompileTimeErrorCode.EXPORT_INTERNAL_LIBRARY, directive,
+        CompileTimeErrorCode.EXPORT_INTERNAL_LIBRARY,
+        directive,
         [directive.uri]);
     return true;
   }
@@ -3148,6 +3192,11 @@
     if (typeName.isSynthetic) {
       return false;
     }
+    // The SDK implementation may implement disallowed types. For example,
+    // JSNumber in dart2js and _Smi in Dart VM both implement int.
+    if (_currentLibrary.source.isInSystemLibrary) {
+      return false;
+    }
     DartType superType = typeName.type;
     for (InterfaceType disallowedType
         in _DISALLOWED_TYPES_TO_EXTEND_OR_IMPLEMENT) {
@@ -3207,7 +3256,7 @@
     if (staticType == null) {
       return false;
     }
-    if (staticType.isAssignableTo(fieldType)) {
+    if (_typeSystem.isAssignableTo(staticType, fieldType)) {
       return false;
     }
     // report problem
@@ -3216,13 +3265,13 @@
       // constant, not the static type.  See dartbug.com/21119.
       _errorReporter.reportTypeErrorForNode(
           CheckedModeCompileTimeErrorCode.CONST_FIELD_INITIALIZER_NOT_ASSIGNABLE,
-          expression, [staticType, fieldType]);
+          expression,
+          [staticType, fieldType]);
     }
     _errorReporter.reportTypeErrorForNode(
-        StaticWarningCode.FIELD_INITIALIZER_NOT_ASSIGNABLE, expression, [
-      staticType,
-      fieldType
-    ]);
+        StaticWarningCode.FIELD_INITIALIZER_NOT_ASSIGNABLE,
+        expression,
+        [staticType, fieldType]);
     return true;
     // TODO(brianwilkerson) Define a hint corresponding to these errors and
     // report it if appropriate.
@@ -3302,11 +3351,13 @@
         if (variable.initializer == null) {
           if (list.isConst) {
             _errorReporter.reportErrorForNode(
-                CompileTimeErrorCode.CONST_NOT_INITIALIZED, variable.name,
+                CompileTimeErrorCode.CONST_NOT_INITIALIZED,
+                variable.name,
                 [variable.name.name]);
           } else if (list.isFinal) {
             _errorReporter.reportErrorForNode(
-                StaticWarningCode.FINAL_NOT_INITIALIZED, variable.name,
+                StaticWarningCode.FINAL_NOT_INITIALIZED,
+                variable.name,
                 [variable.name.name]);
           }
           foundError = true;
@@ -3355,22 +3406,22 @@
     }
     if (_enclosingFunction.isAsynchronous) {
       if (_enclosingFunction.isGenerator) {
-        if (!_enclosingFunction.returnType
-            .isAssignableTo(_typeProvider.streamDynamicType)) {
+        if (!_typeSystem.isAssignableTo(
+            _enclosingFunction.returnType, _typeProvider.streamDynamicType)) {
           _errorReporter.reportErrorForNode(
               StaticTypeWarningCode.ILLEGAL_ASYNC_GENERATOR_RETURN_TYPE,
               returnType);
         }
       } else {
-        if (!_enclosingFunction.returnType
-            .isAssignableTo(_typeProvider.futureDynamicType)) {
+        if (!_typeSystem.isAssignableTo(
+            _enclosingFunction.returnType, _typeProvider.futureDynamicType)) {
           _errorReporter.reportErrorForNode(
               StaticTypeWarningCode.ILLEGAL_ASYNC_RETURN_TYPE, returnType);
         }
       }
     } else if (_enclosingFunction.isGenerator) {
-      if (!_enclosingFunction.returnType
-          .isAssignableTo(_typeProvider.iterableDynamicType)) {
+      if (!_typeSystem.isAssignableTo(
+          _enclosingFunction.returnType, _typeProvider.iterableDynamicType)) {
         _errorReporter.reportErrorForNode(
             StaticTypeWarningCode.ILLEGAL_SYNC_GENERATOR_RETURN_TYPE,
             returnType);
@@ -3512,13 +3563,7 @@
     LibraryElement prevLibrary = _nameToImportElement[name];
     if (prevLibrary != null) {
       if (prevLibrary != nodeLibrary) {
-        if (name.isEmpty) {
-          _errorReporter.reportErrorForNode(
-              StaticWarningCode.IMPORT_DUPLICATED_LIBRARY_UNNAMED, directive, [
-            prevLibrary.definingCompilationUnit.displayName,
-            nodeLibrary.definingCompilationUnit.displayName
-          ]);
-        } else {
+        if (!name.isEmpty) {
           _errorReporter.reportErrorForNode(
               StaticWarningCode.IMPORT_DUPLICATED_LIBRARY_NAMED, directive, [
             prevLibrary.definingCompilationUnit.displayName,
@@ -3560,7 +3605,8 @@
     }
     // report problem
     _errorReporter.reportErrorForNode(
-        CompileTimeErrorCode.IMPORT_INTERNAL_LIBRARY, directive,
+        CompileTimeErrorCode.IMPORT_INTERNAL_LIBRARY,
+        directive,
         [directive.uri]);
     return true;
   }
@@ -3619,7 +3665,8 @@
     }
     // report problem
     _errorReporter.reportErrorForNode(
-        StaticTypeWarningCode.INSTANCE_ACCESS_TO_STATIC_MEMBER, name,
+        StaticTypeWarningCode.INSTANCE_ACCESS_TO_STATIC_MEMBER,
+        name,
         [name.name]);
     return true;
   }
@@ -3660,10 +3707,8 @@
           if (fieldElt.isStatic) {
             _errorReporter.reportErrorForNode(
                 StaticWarningCode.INSTANCE_METHOD_NAME_COLLIDES_WITH_SUPERCLASS_STATIC,
-                errorNameTarget, [
-              executableElementName,
-              fieldElt.enclosingElement.displayName
-            ]);
+                errorNameTarget,
+                [executableElementName, fieldElt.enclosingElement.displayName]);
             return true;
           }
         }
@@ -3749,12 +3794,11 @@
         ? getStaticType(lhs)
         : leftVariableElement.type;
     DartType staticRightType = getStaticType(rhs);
-    if (!staticRightType.isAssignableTo(leftType)) {
+    if (!_typeSystem.isAssignableTo(staticRightType, leftType)) {
       _errorReporter.reportTypeErrorForNode(
-          StaticTypeWarningCode.INVALID_ASSIGNMENT, rhs, [
-        staticRightType,
-        leftType
-      ]);
+          StaticTypeWarningCode.INVALID_ASSIGNMENT,
+          rhs,
+          [staticRightType, leftType]);
       return true;
     }
     return false;
@@ -3784,7 +3828,7 @@
     if (leftType == null || rightType == null) {
       return false;
     }
-    if (!rightType.isAssignableTo(leftType)) {
+    if (!_typeSystem.isAssignableTo(rightType, leftType)) {
       _errorReporter.reportTypeErrorForNode(
           StaticTypeWarningCode.INVALID_ASSIGNMENT, rhs, [rightType, leftType]);
       return true;
@@ -3805,15 +3849,18 @@
       if (fieldElement.isSynthetic) {
         _errorReporter.reportErrorForNode(
             CompileTimeErrorCode.INITIALIZER_FOR_NON_EXISTENT_FIELD,
-            initializer, [fieldName]);
+            initializer,
+            [fieldName]);
       } else if (fieldElement.isStatic) {
         _errorReporter.reportErrorForNode(
-            CompileTimeErrorCode.INITIALIZER_FOR_STATIC_FIELD, initializer,
+            CompileTimeErrorCode.INITIALIZER_FOR_STATIC_FIELD,
+            initializer,
             [fieldName]);
       }
     } else {
       _errorReporter.reportErrorForNode(
-          CompileTimeErrorCode.INITIALIZER_FOR_NON_EXISTENT_FIELD, initializer,
+          CompileTimeErrorCode.INITIALIZER_FOR_NON_EXISTENT_FIELD,
+          initializer,
           [fieldName]);
       return;
     }
@@ -3885,13 +3932,15 @@
       if (literal.constKeyword != null) {
         // TODO(paulberry): this error should be based on the actual type of the
         // list element, not the static type.  See dartbug.com/21119.
-        if (_checkForArgumentTypeNotAssignableWithExpectedTypes(element,
+        if (_checkForArgumentTypeNotAssignableWithExpectedTypes(
+            element,
             listElementType,
             CheckedModeCompileTimeErrorCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE)) {
           hasProblems = true;
         }
       }
-      if (_checkForArgumentTypeNotAssignableWithExpectedTypes(element,
+      if (_checkForArgumentTypeNotAssignableWithExpectedTypes(
+          element,
           listElementType,
           StaticWarningCode.LIST_ELEMENT_TYPE_NOT_ASSIGNABLE)) {
         hasProblems = true;
@@ -3932,7 +3981,8 @@
             CheckedModeCompileTimeErrorCode.MAP_KEY_TYPE_NOT_ASSIGNABLE)) {
           hasProblems = true;
         }
-        if (_checkForArgumentTypeNotAssignableWithExpectedTypes(value,
+        if (_checkForArgumentTypeNotAssignableWithExpectedTypes(
+            value,
             valueType,
             CheckedModeCompileTimeErrorCode.MAP_VALUE_TYPE_NOT_ASSIGNABLE)) {
           hasProblems = true;
@@ -3968,9 +4018,8 @@
     // check accessors
     for (PropertyAccessorElement accessor in _enclosingClass.accessors) {
       if (className == accessor.name) {
-        _errorReporter.reportErrorForOffset(
-            CompileTimeErrorCode.MEMBER_WITH_CLASS_NAME, accessor.nameOffset,
-            className.length);
+        _errorReporter.reportErrorForElement(
+            CompileTimeErrorCode.MEMBER_WITH_CLASS_NAME, accessor);
         problemReported = true;
       }
     }
@@ -4051,11 +4100,12 @@
     // (if the getter is null, it is dynamic which is assignable to everything).
     if (setterType != null &&
         getterType != null &&
-        !getterType.isAssignableTo(setterType)) {
+        !_typeSystem.isAssignableTo(getterType, setterType)) {
       if (enclosingClassForCounterpart == null) {
         _errorReporter.reportTypeErrorForNode(
             StaticWarningCode.MISMATCHED_GETTER_AND_SETTER_TYPES,
-            accessorDeclaration, [accessorTextName, setterType, getterType]);
+            accessorDeclaration,
+            [accessorTextName, setterType, getterType]);
         return true;
       } else {
         _errorReporter.reportTypeErrorForNode(
@@ -4121,8 +4171,10 @@
       int offset = statement.offset;
       int end = statement.rightParenthesis.end;
       _errorReporter.reportErrorForOffset(
-          CompileTimeErrorCode.MISSING_ENUM_CONSTANT_IN_SWITCH, offset,
-          end - offset, [constantNames[i]]);
+          CompileTimeErrorCode.MISSING_ENUM_CONSTANT_IN_SWITCH,
+          offset,
+          end - offset,
+          [constantNames[i]]);
     }
     return true;
   }
@@ -4165,7 +4217,8 @@
     for (ConstructorElement constructor in mixinElement.constructors) {
       if (!constructor.isSynthetic && !constructor.isFactory) {
         _errorReporter.reportErrorForNode(
-            CompileTimeErrorCode.MIXIN_DECLARES_CONSTRUCTOR, mixinName,
+            CompileTimeErrorCode.MIXIN_DECLARES_CONSTRUCTOR,
+            mixinName,
             [mixinElement.name]);
         return true;
       }
@@ -4199,7 +4252,8 @@
       if (!mixinSupertype.isObject ||
           !mixinElement.isMixinApplication && mixinElement.mixins.length != 0) {
         _errorReporter.reportErrorForNode(
-            CompileTimeErrorCode.MIXIN_INHERITS_FROM_NOT_OBJECT, mixinName,
+            CompileTimeErrorCode.MIXIN_INHERITS_FROM_NOT_OBJECT,
+            mixinName,
             [mixinElement.name]);
         return true;
       }
@@ -4218,7 +4272,8 @@
       TypeName mixinName, ClassElement mixinElement) {
     if (!enableSuperMixins && mixinElement.hasReferenceToSuper) {
       _errorReporter.reportErrorForNode(
-          CompileTimeErrorCode.MIXIN_REFERENCES_SUPER, mixinName,
+          CompileTimeErrorCode.MIXIN_REFERENCES_SUPER,
+          mixinName,
           [mixinElement.name]);
     }
     return false;
@@ -4268,7 +4323,8 @@
    * See [StaticWarningCode.NEW_WITH_UNDEFINED_CONSTRUCTOR].
    */
   bool _checkForNewWithUndefinedConstructor(
-      InstanceCreationExpression expression, ConstructorName constructorName,
+      InstanceCreationExpression expression,
+      ConstructorName constructorName,
       TypeName typeName) {
     // OK if resolved
     if (expression.staticElement != null) {
@@ -4288,14 +4344,14 @@
     SimpleIdentifier name = constructorName.name;
     if (name != null) {
       _errorReporter.reportErrorForNode(
-          StaticWarningCode.NEW_WITH_UNDEFINED_CONSTRUCTOR, name, [
-        className,
-        name
-      ]);
+          StaticWarningCode.NEW_WITH_UNDEFINED_CONSTRUCTOR,
+          name,
+          [className, name]);
     } else {
       _errorReporter.reportErrorForNode(
           StaticWarningCode.NEW_WITH_UNDEFINED_CONSTRUCTOR_DEFAULT,
-          constructorName, [className]);
+          constructorName,
+          [className]);
     }
     return true;
   }
@@ -4331,7 +4387,8 @@
     if (superUnnamedConstructor != null) {
       if (superUnnamedConstructor.isFactory) {
         _errorReporter.reportErrorForNode(
-            CompileTimeErrorCode.NON_GENERATIVE_CONSTRUCTOR, declaration.name,
+            CompileTimeErrorCode.NON_GENERATIVE_CONSTRUCTOR,
+            declaration.name,
             [superUnnamedConstructor]);
         return true;
       }
@@ -4344,7 +4401,8 @@
     // report problem
     _errorReporter.reportErrorForNode(
         CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_IMPLICIT,
-        declaration.name, [superType.displayName]);
+        declaration.name,
+        [superType.displayName]);
     return true;
   }
 
@@ -4364,19 +4422,12 @@
       SimpleIdentifier classNameNode) {
     if (_enclosingClass.isAbstract) {
       return false;
+    } else if (_hasNoSuchMethod(_enclosingClass)) {
+      return false;
     }
     //
     // Store in local sets the set of all method and accessor names
     //
-    MethodElement method =
-        _enclosingClass.getMethod(FunctionElement.NO_SUCH_METHOD_METHOD_NAME);
-    if (method != null) {
-      // If the enclosing class declares the method noSuchMethod(), then return.
-      // From Spec:  It is a static warning if a concrete class does not have an
-      // implementation for a method in any of its superinterfaces unless it
-      // declares its own noSuchMethod method (7.10).
-      return false;
-    }
     HashSet<ExecutableElement> missingOverrides =
         new HashSet<ExecutableElement>();
     //
@@ -4440,7 +4491,7 @@
           FunctionType requiredMemberFT = _inheritanceManager
               .substituteTypeArgumentsInMemberFromInheritance(
                   requiredMemberType, memberName, enclosingType);
-          if (foundConcreteFT.isSubtypeOf(requiredMemberFT)) {
+          if (_typeSystem.isSubtypeOf(foundConcreteFT, requiredMemberFT)) {
             continue;
           }
         }
@@ -4486,11 +4537,13 @@
     if (stringMembersArray.length == 1) {
       analysisError = _errorReporter.newErrorWithProperties(
           StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE,
-          classNameNode, [stringMembersArray[0]]);
+          classNameNode,
+          [stringMembersArray[0]]);
     } else if (stringMembersArray.length == 2) {
       analysisError = _errorReporter.newErrorWithProperties(
           StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_TWO,
-          classNameNode, [stringMembersArray[0], stringMembersArray[1]]);
+          classNameNode,
+          [stringMembersArray[0], stringMembersArray[1]]);
     } else if (stringMembersArray.length == 3) {
       analysisError = _errorReporter.newErrorWithProperties(
           StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_THREE,
@@ -4533,7 +4586,8 @@
    */
   bool _checkForNonBoolCondition(Expression condition) {
     DartType conditionType = getStaticType(condition);
-    if (conditionType != null && !conditionType.isAssignableTo(_boolType)) {
+    if (conditionType != null &&
+        !_typeSystem.isAssignableTo(conditionType, _boolType)) {
       _errorReporter.reportErrorForNode(
           StaticTypeWarningCode.NON_BOOL_CONDITION, condition);
       return true;
@@ -4551,7 +4605,7 @@
     Expression expression = statement.condition;
     DartType type = getStaticType(expression);
     if (type is InterfaceType) {
-      if (!type.isAssignableTo(_boolType)) {
+      if (!_typeSystem.isAssignableTo(type, _boolType)) {
         _errorReporter.reportErrorForNode(
             StaticTypeWarningCode.NON_BOOL_EXPRESSION, expression);
         return true;
@@ -4559,7 +4613,7 @@
     } else if (type is FunctionType) {
       FunctionType functionType = type;
       if (functionType.typeArguments.length == 0 &&
-          !functionType.returnType.isAssignableTo(_boolType)) {
+          !_typeSystem.isAssignableTo(functionType.returnType, _boolType)) {
         _errorReporter.reportErrorForNode(
             StaticTypeWarningCode.NON_BOOL_EXPRESSION, expression);
         return true;
@@ -4575,7 +4629,8 @@
    */
   bool _checkForNonBoolNegationExpression(Expression expression) {
     DartType conditionType = getStaticType(expression);
-    if (conditionType != null && !conditionType.isAssignableTo(_boolType)) {
+    if (conditionType != null &&
+        !_typeSystem.isAssignableTo(conditionType, _boolType)) {
       _errorReporter.reportErrorForNode(
           StaticTypeWarningCode.NON_BOOL_NEGATION_EXPRESSION, expression);
       return true;
@@ -4826,7 +4881,8 @@
             }
             _errorReporter.reportErrorForNode(
                 CompileTimeErrorCode.REDIRECT_GENERATIVE_TO_MISSING_CONSTRUCTOR,
-                invocation, [constructorStrName, enclosingTypeName]);
+                invocation,
+                [constructorStrName, enclosingTypeName]);
           } else {
             if (redirectingElement.isFactory) {
               _errorReporter.reportErrorForNode(
@@ -4970,15 +5026,13 @@
       ]);
       return true;
     }
-    if (staticReturnType.isAssignableTo(expectedReturnType)) {
+    if (_typeSystem.isAssignableTo(staticReturnType, expectedReturnType)) {
       return false;
     }
     _errorReporter.reportTypeErrorForNode(
-        StaticTypeWarningCode.RETURN_OF_INVALID_TYPE, returnExpression, [
-      staticReturnType,
-      expectedReturnType,
-      _enclosingFunction.displayName
-    ]);
+        StaticTypeWarningCode.RETURN_OF_INVALID_TYPE,
+        returnExpression,
+        [staticReturnType, expectedReturnType, _enclosingFunction.displayName]);
     return true;
     // TODO(brianwilkerson) Define a hint corresponding to the warning and
     // report it if appropriate.
@@ -5048,15 +5102,14 @@
       Expression caseExpression = switchCase.expression;
       DartType caseType = getStaticType(caseExpression);
       // check types
-      if (expressionType.isAssignableTo(caseType)) {
+      if (_typeSystem.isAssignableTo(expressionType, caseType)) {
         return false;
       }
       // report problem
       _errorReporter.reportErrorForNode(
-          StaticWarningCode.SWITCH_EXPRESSION_NOT_ASSIGNABLE, expression, [
-        expressionType,
-        caseType
-      ]);
+          StaticWarningCode.SWITCH_EXPRESSION_NOT_ASSIGNABLE,
+          expression,
+          [expressionType, caseType]);
       return true;
     }
     return false;
@@ -5131,7 +5184,7 @@
             typeArguments.length == typeParameters.length) {
           boundType = boundType.substitute2(typeArguments, typeParameters);
         }
-        if (!argType.isSubtypeOf(boundType)) {
+        if (!_typeSystem.isSubtypeOf(argType, boundType)) {
           ErrorCode errorCode;
           if (_isInConstInstanceCreation) {
             errorCode = CompileTimeErrorCode.TYPE_ARGUMENT_NOT_MATCHING_BOUNDS;
@@ -5183,7 +5236,8 @@
     }
     // report problem
     _errorReporter.reportErrorForNode(
-        StaticTypeWarningCode.TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND, parameter,
+        StaticTypeWarningCode.TYPE_PARAMETER_SUPERTYPE_OF_ITS_BOUND,
+        parameter,
         [element.displayName]);
     return true;
   }
@@ -5239,7 +5293,8 @@
       if (superUnnamedConstructor.isFactory) {
         _errorReporter.reportErrorForNode(
             CompileTimeErrorCode.NON_GENERATIVE_CONSTRUCTOR,
-            constructor.returnType, [superUnnamedConstructor]);
+            constructor.returnType,
+            [superUnnamedConstructor]);
         return true;
       }
       if (!superUnnamedConstructor.isDefaultConstructor ||
@@ -5254,14 +5309,17 @@
           length = (name != null ? name.end : returnType.end) - offset;
         }
         _errorReporter.reportErrorForOffset(
-            CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT, offset,
-            length, [superType.displayName]);
+            CompileTimeErrorCode.NO_DEFAULT_SUPER_CONSTRUCTOR_EXPLICIT,
+            offset,
+            length,
+            [superType.displayName]);
       }
       return false;
     }
     _errorReporter.reportErrorForNode(
         CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT,
-        constructor.returnType, [superElement.name]);
+        constructor.returnType,
+        [superElement.name]);
     return true;
   }
 
@@ -5290,7 +5348,8 @@
     }
     _errorReporter.reportErrorForNode(
         StaticTypeWarningCode.UNQUALIFIED_REFERENCE_TO_NON_LOCAL_STATIC_MEMBER,
-        name, [name.name]);
+        name,
+        [name.name]);
     return true;
   }
 
@@ -5301,7 +5360,8 @@
       if (fieldElement == null || fieldElement.isSynthetic) {
         _errorReporter.reportErrorForNode(
             CompileTimeErrorCode.INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD,
-            parameter, [parameter.identifier.name]);
+            parameter,
+            [parameter.identifier.name]);
       } else {
         ParameterElement parameterElement = parameter.element;
         if (parameterElement is FieldFormalParameterElementImpl) {
@@ -5311,27 +5371,32 @@
           if (fieldElement.isSynthetic) {
             _errorReporter.reportErrorForNode(
                 CompileTimeErrorCode.INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD,
-                parameter, [parameter.identifier.name]);
+                parameter,
+                [parameter.identifier.name]);
           } else if (fieldElement.isStatic) {
             _errorReporter.reportErrorForNode(
                 CompileTimeErrorCode.INITIALIZING_FORMAL_FOR_STATIC_FIELD,
-                parameter, [parameter.identifier.name]);
+                parameter,
+                [parameter.identifier.name]);
           } else if (declaredType != null &&
               fieldType != null &&
-              !declaredType.isAssignableTo(fieldType)) {
+              !_typeSystem.isAssignableTo(declaredType, fieldType)) {
             _errorReporter.reportTypeErrorForNode(
                 StaticWarningCode.FIELD_INITIALIZING_FORMAL_NOT_ASSIGNABLE,
-                parameter, [declaredType, fieldType]);
+                parameter,
+                [declaredType, fieldType]);
           }
         } else {
           if (fieldElement.isSynthetic) {
             _errorReporter.reportErrorForNode(
                 CompileTimeErrorCode.INITIALIZING_FORMAL_FOR_NON_EXISTENT_FIELD,
-                parameter, [parameter.identifier.name]);
+                parameter,
+                [parameter.identifier.name]);
           } else if (fieldElement.isStatic) {
             _errorReporter.reportErrorForNode(
                 CompileTimeErrorCode.INITIALIZING_FORMAL_FOR_STATIC_FIELD,
-                parameter, [parameter.identifier.name]);
+                parameter,
+                [parameter.identifier.name]);
           }
         }
       }
@@ -5407,14 +5472,16 @@
     if (expected != -1 && numParameters != expected) {
       _errorReporter.reportErrorForNode(
           CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR,
-          nameNode, [name, expected, numParameters]);
+          nameNode,
+          [name, expected, numParameters]);
       return true;
     }
     // check for operator "-"
     if ("-" == name && numParameters > 1) {
       _errorReporter.reportErrorForNode(
           CompileTimeErrorCode.WRONG_NUMBER_OF_PARAMETERS_FOR_OPERATOR_MINUS,
-          nameNode, [numParameters]);
+          nameNode,
+          [numParameters]);
       return true;
     }
     // OK
@@ -5474,12 +5541,11 @@
       impliedReturnType =
           _typeProvider.iterableType.substitute4(<DartType>[staticYieldedType]);
     }
-    if (!impliedReturnType.isAssignableTo(declaredReturnType)) {
+    if (!_typeSystem.isAssignableTo(impliedReturnType, declaredReturnType)) {
       _errorReporter.reportTypeErrorForNode(
-          StaticTypeWarningCode.YIELD_OF_INVALID_TYPE, yieldExpression, [
-        impliedReturnType,
-        declaredReturnType
-      ]);
+          StaticTypeWarningCode.YIELD_OF_INVALID_TYPE,
+          yieldExpression,
+          [impliedReturnType, declaredReturnType]);
       return true;
     }
     if (isYieldEach) {
@@ -5492,12 +5558,11 @@
       } else {
         requiredReturnType = _typeProvider.iterableDynamicType;
       }
-      if (!impliedReturnType.isAssignableTo(requiredReturnType)) {
+      if (!_typeSystem.isAssignableTo(impliedReturnType, requiredReturnType)) {
         _errorReporter.reportTypeErrorForNode(
-            StaticTypeWarningCode.YIELD_OF_INVALID_TYPE, yieldExpression, [
-          impliedReturnType,
-          requiredReturnType
-        ]);
+            StaticTypeWarningCode.YIELD_OF_INVALID_TYPE,
+            yieldExpression,
+            [impliedReturnType, requiredReturnType]);
         return true;
       }
     }
@@ -5518,13 +5583,13 @@
     if (classElement == null) {
       return false;
     }
-    if (!classElement.type.isSubtypeOf(_typeProvider.functionType)) {
+    if (!_typeSystem.isSubtypeOf(
+        classElement.type, _typeProvider.functionType)) {
       return false;
     }
     // If there is a noSuchMethod method, then don't report the warning,
     // see dartbug.com/16078
-    if (classElement.getMethod(FunctionElement.NO_SUCH_METHOD_METHOD_NAME) !=
-        null) {
+    if (_hasNoSuchMethod(classElement)) {
       return false;
     }
     ExecutableElement callMethod = _inheritanceManager.lookupMember(
@@ -5562,7 +5627,8 @@
       if (interfaceNode.type == superType) {
         hasProblem = true;
         _errorReporter.reportErrorForNode(
-            CompileTimeErrorCode.IMPLEMENTS_SUPER_CLASS, interfaceNode,
+            CompileTimeErrorCode.IMPLEMENTS_SUPER_CLASS,
+            interfaceNode,
             [superType.displayName]);
       }
     }
@@ -5673,6 +5739,22 @@
   }
 
   /**
+   * Return `true` if the given [classElement] has a noSuchMethod() method
+   * distinct from the one declared in class Object, as per the Dart Language
+   * Specification (section 10.4).
+   */
+  bool _hasNoSuchMethod(ClassElement classElement) {
+    MethodElement method = classElement.lookUpMethod(
+        FunctionElement.NO_SUCH_METHOD_METHOD_NAME, classElement.library);
+    if (method == null) {
+      return false;
+    }
+    ClassElement definingClass =
+        method.getAncestor((Element element) => element is ClassElement);
+    return definingClass != null && !definingClass.type.isObject;
+  }
+
+  /**
    * Return `true` if the given [constructor] redirects to itself, directly or
    * indirectly.
    */
@@ -5881,20 +5963,17 @@
           buffer.write(separator);
         }
         buffer.write(element.displayName);
-        _errorReporter.reportErrorForOffset(
+        _errorReporter.reportErrorForElement(
             CompileTimeErrorCode.RECURSIVE_INTERFACE_INHERITANCE,
-            _enclosingClass.nameOffset, enclosingClassName.length, [
-          enclosingClassName,
-          buffer.toString()
-        ]);
+            _enclosingClass,
+            [enclosingClassName, buffer.toString()]);
         return true;
       } else {
         // RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_EXTENDS or
         // RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_IMPLEMENTS or
         // RECURSIVE_INTERFACE_INHERITANCE_BASE_CASE_WITH
-        _errorReporter.reportErrorForOffset(_getBaseCaseErrorCode(element),
-            _enclosingClass.nameOffset, enclosingClassName.length,
-            [enclosingClassName]);
+        _errorReporter.reportErrorForElement(_getBaseCaseErrorCode(element),
+            _enclosingClass, [enclosingClassName]);
         return true;
       }
     }
diff --git a/pkg/analyzer/lib/src/generated/html.dart b/pkg/analyzer/lib/src/generated/html.dart
index 3bccaab..c0012c5 100644
--- a/pkg/analyzer/lib/src/generated/html.dart
+++ b/pkg/analyzer/lib/src/generated/html.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.
 
-// This code was auto-generated, is not intended to be edited, and is subject to
-// significant change. Please see the README file for more information.
-
 library engine.html;
 
 import 'dart:collection';
@@ -404,9 +401,14 @@
       new XmlAttributeNode(name, equals, value);
 
   @override
-  XmlTagNode createTagNode(Token nodeStart, Token tag,
-      List<XmlAttributeNode> attributes, Token attributeEnd,
-      List<XmlTagNode> tagNodes, Token contentEnd, Token closingTag,
+  XmlTagNode createTagNode(
+      Token nodeStart,
+      Token tag,
+      List<XmlAttributeNode> attributes,
+      Token attributeEnd,
+      List<XmlTagNode> tagNodes,
+      Token contentEnd,
+      Token closingTag,
       Token nodeEnd) {
     if (_isScriptNode(tag, attributes, tagNodes)) {
       HtmlScriptTagNode tagNode = new HtmlScriptTagNode(nodeStart, tag,
@@ -532,12 +534,17 @@
    * @param closingTag the name of the tag that occurs in the closing tag
    * @param nodeEnd the last token in the tag
    */
-  HtmlScriptTagNode(Token nodeStart, Token tag,
-      List<XmlAttributeNode> attributes, Token attributeEnd,
-      List<XmlTagNode> tagNodes, Token contentEnd, Token closingTag,
+  HtmlScriptTagNode(
+      Token nodeStart,
+      Token tag,
+      List<XmlAttributeNode> attributes,
+      Token attributeEnd,
+      List<XmlTagNode> tagNodes,
+      Token contentEnd,
+      Token closingTag,
       Token nodeEnd)
       : super(nodeStart, tag, attributes, attributeEnd, tagNodes, contentEnd,
-          closingTag, nodeEnd);
+            closingTag, nodeEnd);
 
   /**
    * Return the AST structure representing the Dart code within this tag, or `null` if this
@@ -1424,11 +1431,17 @@
    * @param nodeEnd the last token in the tag
    * @return the node that was created
    */
-  XmlTagNode createTagNode(Token nodeStart, Token tag,
-      List<XmlAttributeNode> attributes, Token attributeEnd,
-      List<XmlTagNode> tagNodes, Token contentEnd, Token closingTag,
-      Token nodeEnd) => new XmlTagNode(nodeStart, tag, attributes, attributeEnd,
-      tagNodes, contentEnd, closingTag, nodeEnd);
+  XmlTagNode createTagNode(
+          Token nodeStart,
+          Token tag,
+          List<XmlAttributeNode> attributes,
+          Token attributeEnd,
+          List<XmlTagNode> tagNodes,
+          Token contentEnd,
+          Token closingTag,
+          Token nodeEnd) =>
+      new XmlTagNode(nodeStart, tag, attributes, attributeEnd, tagNodes,
+          contentEnd, closingTag, nodeEnd);
 
   /**
    * Answer `true` if the specified tag is self closing and thus should never have content or
@@ -1739,9 +1752,15 @@
    * @param nodeEnd the ending [TokenType.GT] or [TokenType.SLASH_GT] token (not
    *          `null`)
    */
-  XmlTagNode(this.nodeStart, this._tag, List<XmlAttributeNode> attributes,
-      this.attributeEnd, List<XmlTagNode> tagNodes, this.contentEnd,
-      this.closingTag, this.nodeEnd) {
+  XmlTagNode(
+      this.nodeStart,
+      this._tag,
+      List<XmlAttributeNode> attributes,
+      this.attributeEnd,
+      List<XmlTagNode> tagNodes,
+      this.contentEnd,
+      this.closingTag,
+      this.nodeEnd) {
     this._attributes = becomeParentOfAll(attributes, ifEmpty: NO_ATTRIBUTES);
     this._tagNodes = becomeParentOfAll(tagNodes, ifEmpty: NO_TAG_NODES);
   }
diff --git a/pkg/analyzer/lib/src/generated/incremental_resolver.dart b/pkg/analyzer/lib/src/generated/incremental_resolver.dart
index 2fcef7b..c15f247 100644
--- a/pkg/analyzer/lib/src/generated/incremental_resolver.dart
+++ b/pkg/analyzer/lib/src/generated/incremental_resolver.dart
@@ -8,27 +8,26 @@
 import 'dart:math' as math;
 
 import 'package:analyzer/src/context/cache.dart'
-    show CacheEntry, TargetedResult;
+    show CacheEntry, Delta, DeltaResult;
 import 'package:analyzer/src/generated/constant.dart';
-import 'package:analyzer/src/task/dart.dart'
-    show
-        HINTS,
-        PARSE_ERRORS,
-        RESOLVE_REFERENCES_ERRORS,
-        RESOLVE_TYPE_NAMES_ERRORS,
-        SCAN_ERRORS,
-        USED_IMPORTED_ELEMENTS,
-        USED_LOCAL_ELEMENTS,
-        VARIABLE_REFERENCE_ERRORS,
-        VERIFY_ERRORS;
-import 'package:analyzer/task/dart.dart'
-    show DART_ERRORS, LibrarySpecificUnit, PARSED_UNIT, TOKEN_STREAM;
+import 'package:analyzer/src/task/dart.dart';
+import 'package:analyzer/task/dart.dart';
 import 'package:analyzer/task/general.dart' show CONTENT, LINE_INFO;
-import 'package:analyzer/task/model.dart' show ResultDescriptor;
+import 'package:analyzer/task/model.dart'
+    show AnalysisTarget, ResultDescriptor, TargetedResult, TaskDescriptor;
 
 import 'ast.dart';
 import 'element.dart';
-import 'engine.dart';
+import 'engine.dart'
+    show
+        AnalysisContext,
+        AnalysisOptions,
+        CacheState,
+        DartEntry,
+        DataDescriptor,
+        InternalAnalysisContext,
+        RecordingErrorListener,
+        SourceEntry;
 import 'error.dart';
 import 'error_verifier.dart';
 import 'incremental_logger.dart' show logger, LoggingTimer;
@@ -494,6 +493,24 @@
       _assertCompatibleParameter(node.parameter, element);
     } else if (node is FieldFormalParameter) {
       _assertTrue(element.isInitializingFormal);
+      DartType parameterType = element.type;
+      if (node.type == null && node.parameters == null) {
+        FieldFormalParameterElement parameterElement = element;
+        if (!parameterElement.hasImplicitType) {
+          _assertTrue(parameterType == null || parameterType.isDynamic);
+        }
+        if (parameterElement.field != null) {
+          _assertEquals(node.identifier.name, element.name);
+        }
+      } else {
+        if (node.parameters != null) {
+          _assertTrue(parameterType is FunctionType);
+          FunctionType parameterFunctionType = parameterType;
+          _assertSameType(node.type, parameterFunctionType.returnType);
+        } else {
+          _assertSameType(node.type, parameterType);
+        }
+      }
       _assertCompatibleParameters(node.parameters, element.parameters);
     } else if (node is FunctionTypedFormalParameter) {
       _assertFalse(element.isInitializingFormal);
@@ -827,6 +844,97 @@
 }
 
 /**
+ * The [Delta] implementation used by incremental resolver.
+ * It keeps Dart results that are either don't change or are updated.
+ */
+class IncrementalBodyDelta extends Delta {
+  /**
+   * The offset of the changed contents.
+   */
+  final int updateOffset;
+
+  /**
+   * The end of the changed contents in the old unit.
+   */
+  final int updateEndOld;
+
+  /**
+   * The end of the changed contents in the new unit.
+   */
+  final int updateEndNew;
+
+  /**
+   * The delta between [updateEndNew] and [updateEndOld].
+   */
+  final int updateDelta;
+
+  IncrementalBodyDelta(Source source, this.updateOffset, this.updateEndOld,
+      this.updateEndNew, this.updateDelta)
+      : super(source);
+
+  @override
+  DeltaResult validate(InternalAnalysisContext context, AnalysisTarget target,
+      ResultDescriptor descriptor) {
+    // A body change delta should never leak outside its source.
+    // It can cause invalidation of results (e.g. hints) in other sources,
+    // but only when a result in the updated source is INVALIDATE_NO_DELTA.
+    if (target.source != source) {
+      return DeltaResult.STOP;
+    }
+    // don't invalidate results of standard Dart tasks
+    bool isByTask(TaskDescriptor taskDescriptor) {
+      return taskDescriptor.results.contains(descriptor);
+    }
+    if (descriptor == CONTENT) {
+      return DeltaResult.KEEP_CONTINUE;
+    }
+    if (target is LibrarySpecificUnit && target.unit != source) {
+      if (isByTask(GatherUsedLocalElementsTask.DESCRIPTOR) ||
+          isByTask(GatherUsedImportedElementsTask.DESCRIPTOR)) {
+        return DeltaResult.KEEP_CONTINUE;
+      }
+    }
+    if (isByTask(BuildCompilationUnitElementTask.DESCRIPTOR) ||
+        isByTask(BuildDirectiveElementsTask.DESCRIPTOR) ||
+        isByTask(BuildEnumMemberElementsTask.DESCRIPTOR) ||
+        isByTask(BuildExportNamespaceTask.DESCRIPTOR) ||
+        isByTask(BuildLibraryElementTask.DESCRIPTOR) ||
+        isByTask(BuildPublicNamespaceTask.DESCRIPTOR) ||
+        isByTask(BuildSourceExportClosureTask.DESCRIPTOR) ||
+        isByTask(ComputeConstantDependenciesTask.DESCRIPTOR) ||
+        isByTask(ComputeConstantValueTask.DESCRIPTOR) ||
+        isByTask(ComputeLibraryCycleTask.DESCRIPTOR) ||
+        isByTask(DartErrorsTask.DESCRIPTOR) ||
+        isByTask(ReadyLibraryElement2Task.DESCRIPTOR) ||
+        isByTask(ReadyLibraryElement5Task.DESCRIPTOR) ||
+        isByTask(ReadyResolvedUnitTask.DESCRIPTOR) ||
+        isByTask(ReadyResolvedUnit9Task.DESCRIPTOR) ||
+        isByTask(ReadyResolvedUnit10Task.DESCRIPTOR) ||
+        isByTask(EvaluateUnitConstantsTask.DESCRIPTOR) ||
+        isByTask(GenerateHintsTask.DESCRIPTOR) ||
+        isByTask(InferInstanceMembersInUnitTask.DESCRIPTOR) ||
+        isByTask(InferStaticVariableTypesInUnitTask.DESCRIPTOR) ||
+        isByTask(LibraryErrorsReadyTask.DESCRIPTOR) ||
+        isByTask(LibraryUnitErrorsTask.DESCRIPTOR) ||
+        isByTask(ParseDartTask.DESCRIPTOR) ||
+        isByTask(PartiallyResolveUnitReferencesTask.DESCRIPTOR) ||
+        isByTask(ScanDartTask.DESCRIPTOR) ||
+        isByTask(ResolveInstanceFieldsInUnitTask.DESCRIPTOR) ||
+        isByTask(ResolveLibraryReferencesTask.DESCRIPTOR) ||
+        isByTask(ResolveLibraryTypeNamesTask.DESCRIPTOR) ||
+        isByTask(ResolveUnitTask.DESCRIPTOR) ||
+        isByTask(ResolveUnitTypeNamesTask.DESCRIPTOR) ||
+        isByTask(ResolveVariableReferencesTask.DESCRIPTOR) ||
+        isByTask(StrongModeVerifyUnitTask.DESCRIPTOR) ||
+        isByTask(VerifyUnitTask.DESCRIPTOR)) {
+      return DeltaResult.KEEP_CONTINUE;
+    }
+    // invalidate all the other results
+    return DeltaResult.INVALIDATE_NO_DELTA;
+  }
+}
+
+/**
  * Instances of the class [IncrementalResolver] resolve the smallest portion of
  * an AST structure that we currently know how to resolve.
  */
@@ -847,6 +955,11 @@
   TypeProvider _typeProvider;
 
   /**
+   * The type system primitives.
+   */
+  TypeSystem _typeSystem;
+
+  /**
    * The element for the library containing the compilation unit being resolved.
    */
   LibraryElementImpl _definingLibrary;
@@ -891,8 +1004,16 @@
    */
   final int _updateEndNew;
 
+  /**
+   * The delta between [_updateEndNew] and [_updateEndOld].
+   */
   int _updateDelta;
 
+  /**
+   * The set of [AnalysisError]s that have been already shifted.
+   */
+  Set<AnalysisError> _alreadyShiftedErrors = new HashSet.identity();
+
   RecordingErrorListener errorListener = new RecordingErrorListener();
   ResolutionContext _resolutionContext;
 
@@ -903,8 +1024,13 @@
    * Initialize a newly created incremental resolver to resolve a node in the
    * given source in the given library.
    */
-  IncrementalResolver(this.oldEntry, this.newSourceEntry, this.newUnitEntry,
-      this._definingUnit, this._updateOffset, this._updateEndOld,
+  IncrementalResolver(
+      this.oldEntry,
+      this.newSourceEntry,
+      this.newUnitEntry,
+      this._definingUnit,
+      this._updateOffset,
+      this._updateEndOld,
       this._updateEndNew) {
     _updateDelta = _updateEndNew - _updateEndOld;
     _definingLibrary = _definingUnit.library;
@@ -912,6 +1038,7 @@
     _source = _definingUnit.source;
     _context = _definingUnit.context;
     _typeProvider = _context.typeProvider;
+    _typeSystem = _context.typeSystem;
   }
 
   /**
@@ -927,6 +1054,7 @@
       AstNode rootNode = _findResolutionRoot(node);
       _prepareResolutionContext(rootNode);
       // update elements
+      _updateCache();
       _updateElementNameOffsets();
       _buildElements(rootNode);
       if (!_canBeIncrementallyResolved(rootNode)) {
@@ -941,8 +1069,6 @@
       _context.invalidateLibraryHints(_librarySource);
       // update entry errors
       _updateEntry();
-      // notify unit
-      _definingUnit.afterIncrementalResolution();
       // OK
       return true;
     } finally {
@@ -1018,8 +1144,8 @@
     // compute values
     {
       CompilationUnit unit = node.getAncestor((n) => n is CompilationUnit);
-      ConstantValueComputer computer = new ConstantValueComputer(
-          _context, _typeProvider, _context.declaredVariables);
+      ConstantValueComputer computer = new ConstantValueComputer(_context,
+          _typeProvider, _context.declaredVariables, null, _typeSystem);
       computer.add(unit, _source, _librarySource);
       computer.computeValues();
     }
@@ -1120,8 +1246,11 @@
 
   void _shiftEntryErrors_NEW() {
     _shiftErrors_NEW(HINTS);
-    _shiftErrors_NEW(RESOLVE_REFERENCES_ERRORS);
+    _shiftErrors_NEW(LINTS);
+    _shiftErrors_NEW(LIBRARY_UNIT_ERRORS);
     _shiftErrors_NEW(RESOLVE_TYPE_NAMES_ERRORS);
+    _shiftErrors_NEW(RESOLVE_UNIT_ERRORS);
+    _shiftErrors_NEW(STRONG_MODE_ERRORS);
     _shiftErrors_NEW(VARIABLE_REFERENCE_ERRORS);
     _shiftErrors_NEW(VERIFY_ERRORS);
   }
@@ -1135,9 +1264,11 @@
 
   void _shiftErrors(List<AnalysisError> errors) {
     for (AnalysisError error in errors) {
-      int errorOffset = error.offset;
-      if (errorOffset > _updateOffset) {
-        error.offset += _updateDelta;
+      if (_alreadyShiftedErrors.add(error)) {
+        int errorOffset = error.offset;
+        if (errorOffset > _updateOffset) {
+          error.offset += _updateDelta;
+        }
       }
     }
   }
@@ -1153,11 +1284,25 @@
     _shiftErrors(errors);
   }
 
+  void _updateCache() {
+    if (newSourceEntry != null) {
+      LoggingTimer timer = logger.startTimer();
+      try {
+        newSourceEntry.setState(CONTENT, CacheState.INVALID,
+            delta: new IncrementalBodyDelta(_source, _updateOffset,
+                _updateEndOld, _updateEndNew, _updateDelta));
+      } finally {
+        timer.stop('invalidate cache with delta');
+      }
+    }
+  }
+
   void _updateElementNameOffsets() {
     LoggingTimer timer = logger.startTimer();
     try {
       _definingUnit
           .accept(new _ElementNameOffsetUpdater(_updateOffset, _updateDelta));
+      _definingUnit.afterIncrementalResolution();
     } finally {
       timer.stop('update element offsets');
     }
@@ -1172,14 +1317,16 @@
   }
 
   void _updateEntry_NEW() {
-    _updateErrors_NEW(RESOLVE_REFERENCES_ERRORS, _resolveErrors);
     _updateErrors_NEW(RESOLVE_TYPE_NAMES_ERRORS, []);
+    _updateErrors_NEW(RESOLVE_UNIT_ERRORS, _resolveErrors);
     _updateErrors_NEW(VARIABLE_REFERENCE_ERRORS, []);
     _updateErrors_NEW(VERIFY_ERRORS, _verifyErrors);
     // invalidate results we don't update incrementally
+    newUnitEntry.setState(STRONG_MODE_ERRORS, CacheState.INVALID);
     newUnitEntry.setState(USED_IMPORTED_ELEMENTS, CacheState.INVALID);
     newUnitEntry.setState(USED_LOCAL_ELEMENTS, CacheState.INVALID);
     newUnitEntry.setState(HINTS, CacheState.INVALID);
+    newUnitEntry.setState(LINTS, CacheState.INVALID);
   }
 
   void _updateEntry_OLD() {
@@ -1215,7 +1362,7 @@
       List<AnalysisError> newErrors) {
     List<AnalysisError> oldErrors = newUnitEntry.getValue(descriptor);
     List<AnalysisError> errors = _updateErrors(oldErrors, newErrors);
-    newUnitEntry.setValueIncremental(descriptor, errors);
+    newUnitEntry.setValueIncremental(descriptor, errors, true);
   }
 
   void _updateErrors_OLD(DataDescriptor<List<AnalysisError>> descriptor,
@@ -1231,8 +1378,10 @@
     try {
       RecordingErrorListener errorListener = new RecordingErrorListener();
       ErrorReporter errorReporter = new ErrorReporter(errorListener, _source);
-      ErrorVerifier errorVerifier = new ErrorVerifier(errorReporter,
-          _definingLibrary, _typeProvider,
+      ErrorVerifier errorVerifier = new ErrorVerifier(
+          errorReporter,
+          _definingLibrary,
+          _typeProvider,
           new InheritanceManager(_definingLibrary),
           _context.analysisOptions.enableSuperMixins);
       if (_resolutionContext.enclosingClassDeclaration != null) {
@@ -1267,7 +1416,6 @@
   CacheEntry _newUnitEntry;
 
   final CompilationUnit _oldUnit;
-  final AnalysisOptions _options;
   CompilationUnitElement _unitElement;
 
   int _updateOffset;
@@ -1279,9 +1427,14 @@
   List<AnalysisError> _newScanErrors = <AnalysisError>[];
   List<AnalysisError> _newParseErrors = <AnalysisError>[];
 
-  PoorMansIncrementalResolver(this._typeProvider, this._unitSource,
-      this._oldEntry, this._newSourceEntry, this._newUnitEntry, this._oldUnit,
-      bool resolveApiChanges, this._options) {
+  PoorMansIncrementalResolver(
+      this._typeProvider,
+      this._unitSource,
+      this._oldEntry,
+      this._newSourceEntry,
+      this._newUnitEntry,
+      this._oldUnit,
+      bool resolveApiChanges) {
     _resolveApiChanges = resolveApiChanges;
   }
 
@@ -1338,8 +1491,14 @@
             _shiftTokens(firstPair.oldToken);
             {
               IncrementalResolver incrementalResolver = new IncrementalResolver(
-                  _oldEntry, _newSourceEntry, _newUnitEntry, _unitElement,
-                  _updateOffset, _updateEndOld, _updateEndNew);
+                  _oldEntry,
+                  _newSourceEntry,
+                  _newUnitEntry,
+                  _unitElement,
+                  _updateOffset,
+                  _updateEndOld,
+                  _updateEndNew);
+              incrementalResolver._updateCache();
               incrementalResolver._updateElementNameOffsets();
               incrementalResolver._shiftEntryErrors();
             }
@@ -1385,7 +1544,8 @@
                 found = true;
               }
             }
-            if (oldParent is FunctionBody && newParent is FunctionBody) {
+            if (oldParent is BlockFunctionBody &&
+                newParent is BlockFunctionBody) {
               oldNode = oldParent;
               newNode = newParent;
               found = true;
@@ -1428,8 +1588,13 @@
         }
         // perform incremental resolution
         IncrementalResolver incrementalResolver = new IncrementalResolver(
-            _oldEntry, _newSourceEntry, _newUnitEntry, _unitElement,
-            _updateOffset, _updateEndOld, _updateEndNew);
+            _oldEntry,
+            _newSourceEntry,
+            _newUnitEntry,
+            _unitElement,
+            _updateOffset,
+            _updateEndOld,
+            _updateEndNew);
         bool success = incrementalResolver.resolve(newNode);
         // check if success
         if (!success) {
@@ -1493,9 +1658,15 @@
     // replace node
     NodeReplacer.replace(oldComment, newComment);
     // update elements
-    IncrementalResolver incrementalResolver = new IncrementalResolver(_oldEntry,
-        _newSourceEntry, _newUnitEntry, _unitElement, _updateOffset,
-        _updateEndOld, _updateEndNew);
+    IncrementalResolver incrementalResolver = new IncrementalResolver(
+        _oldEntry,
+        _newSourceEntry,
+        _newUnitEntry,
+        _unitElement,
+        _updateOffset,
+        _updateEndOld,
+        _updateEndNew);
+    incrementalResolver._updateCache();
     incrementalResolver._updateElementNameOffsets();
     incrementalResolver._shiftEntryErrors();
     _updateEntry();
@@ -1562,19 +1733,12 @@
   }
 
   void _updateEntry_NEW() {
-    _newSourceEntry.setState(DART_ERRORS, CacheState.INVALID);
     // scan results
-    _newSourceEntry.setState(SCAN_ERRORS, CacheState.INVALID);
-    List<TargetedResult> scanDeps =
-        <TargetedResult>[new TargetedResult(_unitSource, CONTENT)];
-    _newSourceEntry.setValue(LINE_INFO, _newLineInfo, scanDeps);
-    _newSourceEntry.setValue(SCAN_ERRORS, _newScanErrors, scanDeps);
+    _newSourceEntry.setValueIncremental(SCAN_ERRORS, _newScanErrors, true);
+    _newSourceEntry.setValueIncremental(LINE_INFO, _newLineInfo, false);
     // parse results
-    List<TargetedResult> parseDeps =
-        <TargetedResult>[new TargetedResult(_unitSource, TOKEN_STREAM)];
-    _newSourceEntry.setState(PARSE_ERRORS, CacheState.INVALID);
-    _newSourceEntry.setValue(PARSE_ERRORS, _newParseErrors, parseDeps);
-    _newSourceEntry.setValue(PARSED_UNIT, _oldUnit, parseDeps);
+    _newSourceEntry.setValueIncremental(PARSE_ERRORS, _newParseErrors, true);
+    _newSourceEntry.setValueIncremental(PARSED_UNIT, _oldUnit, false);
   }
 
   void _updateEntry_OLD() {
diff --git a/pkg/analyzer/lib/src/generated/java_core.dart b/pkg/analyzer/lib/src/generated/java_core.dart
index 9a0185a..8c96357 100644
--- a/pkg/analyzer/lib/src/generated/java_core.dart
+++ b/pkg/analyzer/lib/src/generated/java_core.dart
@@ -141,24 +141,31 @@
     }
     return -1;
   }
+
   static bool isDigit(int c) {
     return c >= 0x30 && c <= 0x39;
   }
+
   static bool isLetter(int c) {
     return c >= 0x41 && c <= 0x5A || c >= 0x61 && c <= 0x7A;
   }
+
   static bool isLetterOrDigit(int c) {
     return isLetter(c) || isDigit(c);
   }
+
   static bool isLowerCase(int c) {
     return c >= 0x61 && c <= 0x7A;
   }
+
   static bool isUpperCase(int c) {
     return c >= 0x41 && c <= 0x5A;
   }
+
   static bool isWhitespace(int c) {
     return c == 0x09 || c == 0x20 || c == 0x0A || c == 0x0D;
   }
+
   static String toChars(int codePoint) {
     if (codePoint < 0 || codePoint > MAX_CODE_POINT) {
       throw new IllegalArgumentException();
@@ -171,12 +178,14 @@
     int c1 = (offset & 0x3ff) + MIN_LOW_SURROGATE;
     return new String.fromCharCodes([c0, c1]);
   }
+
   static int toLowerCase(int c) {
     if (c >= 0x41 && c <= 0x5A) {
       return 0x61 + (c - 0x41);
     }
     return c;
   }
+
   static int toUpperCase(int c) {
     if (c >= 0x61 && c <= 0x7A) {
       return 0x41 + (c - 0x61);
@@ -188,6 +197,7 @@
 abstract class Enum<E extends Enum> implements Comparable<E> {
   /// The name of this enum constant, as declared in the enum declaration.
   final String name;
+
   /// The position in the enum declaration.
   final int ordinal;
   const Enum(this.name, this.ordinal);
@@ -221,6 +231,7 @@
     }
     return true;
   }
+
   static int makeHashCode(List a) {
     if (a == null) {
       return 0;
@@ -259,6 +270,7 @@
     _match = _matches.current;
     return true;
   }
+
   String group(int i) => _match[i];
   bool matches() => find();
   int start() => _match.start;
@@ -270,11 +282,13 @@
     if (fromIndex < 0) fromIndex = 0;
     return target.indexOf(str, fromIndex);
   }
+
   static int lastIndexOf(String target, String str, int fromIndex) {
     if (fromIndex > target.length) return -1;
     if (fromIndex < 0) fromIndex = 0;
     return target.lastIndexOf(str, fromIndex);
   }
+
   static bool startsWithBefore(String s, String other, int start) {
     return s.indexOf(other, start) != -1;
   }
diff --git a/pkg/analyzer/lib/src/generated/java_engine.dart b/pkg/analyzer/lib/src/generated/java_engine.dart
index 98ff8e4..d0fb62b 100644
--- a/pkg/analyzer/lib/src/generated/java_engine.dart
+++ b/pkg/analyzer/lib/src/generated/java_engine.dart
@@ -128,10 +128,12 @@
         str.codeUnitAt(length - 2) == c2 &&
         str.codeUnitAt(length - 1) == c3;
   }
+
   static endsWithChar(String str, int c) {
     int length = str.length;
     return length > 0 && str.codeUnitAt(length - 1) == c;
   }
+
   static int indexOf1(String str, int start, int c) {
     int index = start;
     int last = str.length;
@@ -143,6 +145,7 @@
     }
     return -1;
   }
+
   static int indexOf2(String str, int start, int c1, int c2) {
     int index = start;
     int last = str.length - 1;
@@ -154,6 +157,7 @@
     }
     return -1;
   }
+
   static int indexOf4(
       String string, int start, int c1, int c2, int c3, int c4) {
     int index = start;
@@ -169,6 +173,7 @@
     }
     return -1;
   }
+
   static int indexOf5(
       String str, int start, int c1, int c2, int c3, int c4, int c5) {
     int index = start;
@@ -203,10 +208,12 @@
     }
     return last;
   }
+
   static String intern(String string) => INTERNER.intern(string);
   static bool isEmpty(String s) {
     return s == null || s.isEmpty;
   }
+
   static bool isTagName(String s) {
     if (s == null || s.length == 0) {
       return false;
@@ -225,6 +232,7 @@
     }
     return true;
   }
+
   /**
    * Produce a string containing all of the names in the given array, surrounded by single quotes,
    * and separated by commas. The list must contain at least two elements.
@@ -255,17 +263,20 @@
     buffer.write("'");
     return buffer.toString();
   }
+
   static startsWith2(String str, int start, int c1, int c2) {
     return str.length - start >= 2 &&
         str.codeUnitAt(start) == c1 &&
         str.codeUnitAt(start + 1) == c2;
   }
+
   static 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;
   }
+
   static startsWith4(String str, int start, int c1, int c2, int c3, int c4) {
     return str.length - start >= 4 &&
         str.codeUnitAt(start) == c1 &&
@@ -273,6 +284,7 @@
         str.codeUnitAt(start + 2) == c3 &&
         str.codeUnitAt(start + 3) == c4;
   }
+
   static startsWith5(
       String str, int start, int c1, int c2, int c3, int c4, int c5) {
     return str.length - start >= 5 &&
@@ -282,6 +294,7 @@
         str.codeUnitAt(start + 3) == c4 &&
         str.codeUnitAt(start + 4) == c5;
   }
+
   static startsWith6(
       String str, int start, int c1, int c2, int c3, int c4, int c5, int c6) {
     return str.length - start >= 6 &&
@@ -292,6 +305,7 @@
         str.codeUnitAt(start + 4) == c5 &&
         str.codeUnitAt(start + 5) == c6;
   }
+
   static startsWithChar(String str, int c) {
     return str.length != 0 && str.codeUnitAt(0) == c;
   }
diff --git a/pkg/analyzer/lib/src/generated/java_io.dart b/pkg/analyzer/lib/src/generated/java_io.dart
index e947d80a..000746f 100644
--- a/pkg/analyzer/lib/src/generated/java_io.dart
+++ b/pkg/analyzer/lib/src/generated/java_io.dart
@@ -2,29 +2,31 @@
 
 import "dart:io";
 
-import 'package:path/path.dart' as pathos;
+import 'package:path/path.dart' as path;
 
 import 'java_core.dart' show JavaIOException;
 
 class JavaFile {
+  static path.Context pathContext = path.context;
   static final String separator = Platform.pathSeparator;
   static final int separatorChar = Platform.pathSeparator.codeUnitAt(0);
   String _path;
   JavaFile(String path) {
     _path = path;
   }
-  JavaFile.fromUri(Uri uri) : this(pathos.fromUri(uri));
+  JavaFile.fromUri(Uri uri) : this(pathContext.fromUri(uri));
   JavaFile.relative(JavaFile base, String child) {
     if (child.isEmpty) {
       this._path = base._path;
     } else {
-      this._path = pathos.join(base._path, child);
+      this._path = pathContext.join(base._path, child);
     }
   }
   int get hashCode => _path.hashCode;
   bool operator ==(other) {
     return other is JavaFile && other._path == _path;
   }
+
   bool exists() {
     if (_newFile().existsSync()) {
       return true;
@@ -34,12 +36,14 @@
     }
     return false;
   }
+
   JavaFile getAbsoluteFile() => new JavaFile(getAbsolutePath());
   String getAbsolutePath() {
-    String path = pathos.absolute(_path);
-    path = pathos.normalize(path);
+    String path = pathContext.absolute(_path);
+    path = pathContext.normalize(path);
     return path;
   }
+
   JavaFile getCanonicalFile() => new JavaFile(getCanonicalPath());
   String getCanonicalPath() {
     try {
@@ -48,28 +52,34 @@
       throw new JavaIOException('IOException', e);
     }
   }
-  String getName() => pathos.basename(_path);
+
+  String getName() => pathContext.basename(_path);
   String getParent() {
-    var result = pathos.dirname(_path);
+    var result = pathContext.dirname(_path);
     // "." or  "/" or  "C:\"
     if (result.length < 4) return null;
     return result;
   }
+
   JavaFile getParentFile() {
     var parent = getParent();
     if (parent == null) return null;
     return new JavaFile(parent);
   }
+
   String getPath() => _path;
   bool isDirectory() {
     return _newDirectory().existsSync();
   }
+
   bool isExecutable() {
     return _newFile().statSync().mode & 0x111 != 0;
   }
+
   bool isFile() {
     return _newFile().existsSync();
   }
+
   int lastModified() {
     try {
       return _newFile().lastModifiedSync().millisecondsSinceEpoch;
@@ -77,6 +87,7 @@
       return -1;
     }
   }
+
   List<JavaFile> listFiles() {
     var files = <JavaFile>[];
     var entities = _newDirectory().listSync();
@@ -85,12 +96,14 @@
     }
     return files;
   }
+
   String readAsStringSync() => _newFile().readAsStringSync();
   String toString() => _path.toString();
   Uri toURI() {
     String path = getAbsolutePath();
-    return pathos.toUri(path);
+    return pathContext.toUri(path);
   }
+
   Directory _newDirectory() => new Directory(_path);
   File _newFile() => new File(_path);
 }
@@ -120,21 +133,25 @@
         String sdkPath;
         // may be "xcodebuild/ReleaseIA32/dart" with "sdk" sibling
         {
-          var outDir = pathos.dirname(pathos.dirname(exec));
-          sdkPath = pathos.join(pathos.dirname(outDir), "sdk");
+          var outDir =
+              JavaFile.pathContext.dirname(JavaFile.pathContext.dirname(exec));
+          sdkPath = JavaFile.pathContext
+              .join(JavaFile.pathContext.dirname(outDir), "sdk");
           if (new Directory(sdkPath).existsSync()) {
             _properties[name] = sdkPath;
             return sdkPath;
           }
         }
         // probably be "dart-sdk/bin/dart"
-        sdkPath = pathos.dirname(pathos.dirname(exec));
+        sdkPath =
+            JavaFile.pathContext.dirname(JavaFile.pathContext.dirname(exec));
         _properties[name] = sdkPath;
         return sdkPath;
       }
     }
     return null;
   }
+
   static String setProperty(String name, String value) {
     String oldValue = _properties[name];
     _properties[name] = value;
diff --git a/pkg/analyzer/lib/src/generated/parser.dart b/pkg/analyzer/lib/src/generated/parser.dart
index df3187b..76f9dc7 100644
--- a/pkg/analyzer/lib/src/generated/parser.dart
+++ b/pkg/analyzer/lib/src/generated/parser.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.
 
-// This code was auto-generated, is not intended to be edited, and is subject to
-// significant change. Please see the README file for more information.
-
 library engine.parser;
 
 import 'dart:collection';
@@ -92,11 +89,14 @@
   'parseWithClause_0':
       new MethodTrampoline(0, (Parser target) => target.parseWithClause()),
   'advance_0': new MethodTrampoline(0, (Parser target) => target._advance()),
-  'appendScalarValue_5': new MethodTrampoline(5, (Parser target, arg0, arg1,
-      arg2, arg3,
-      arg4) => target._appendScalarValue(arg0, arg1, arg2, arg3, arg4)),
-  'computeStringValue_3': new MethodTrampoline(3, (Parser target, arg0, arg1,
-      arg2) => target._computeStringValue(arg0, arg1, arg2)),
+  'appendScalarValue_5': new MethodTrampoline(
+      5,
+      (Parser target, arg0, arg1, arg2, arg3, arg4) =>
+          target._appendScalarValue(arg0, arg1, arg2, arg3, arg4)),
+  'computeStringValue_3': new MethodTrampoline(
+      3,
+      (Parser target, arg0, arg1, arg2) =>
+          target._computeStringValue(arg0, arg1, arg2)),
   'convertToFunctionDeclaration_1': new MethodTrampoline(
       1, (Parser target, arg0) => target._convertToFunctionDeclaration(arg0)),
   'couldBeStartOfCompilationUnitMember_0': new MethodTrampoline(
@@ -162,8 +162,10 @@
       0, (Parser target) => target._parseAssertStatement()),
   'parseAssignableExpression_1': new MethodTrampoline(
       1, (Parser target, arg0) => target._parseAssignableExpression(arg0)),
-  'parseAssignableSelector_2': new MethodTrampoline(2, (Parser target, arg0,
-      arg1) => target._parseAssignableSelector(arg0, arg1)),
+  'parseAssignableSelector_2': new MethodTrampoline(
+      2,
+      (Parser target, arg0, arg1) =>
+          target._parseAssignableSelector(arg0, arg1)),
   'parseAwaitExpression_0': new MethodTrampoline(
       0, (Parser target) => target._parseAwaitExpression()),
   'parseBitwiseAndExpression_0': new MethodTrampoline(
@@ -178,8 +180,10 @@
       (Parser target, arg0, arg1) => target._parseClassDeclaration(arg0, arg1)),
   'parseClassMembers_2': new MethodTrampoline(
       2, (Parser target, arg0, arg1) => target._parseClassMembers(arg0, arg1)),
-  'parseClassTypeAlias_3': new MethodTrampoline(3, (Parser target, arg0, arg1,
-      arg2) => target._parseClassTypeAlias(arg0, arg1, arg2)),
+  'parseClassTypeAlias_3': new MethodTrampoline(
+      3,
+      (Parser target, arg0, arg1, arg2) =>
+          target._parseClassTypeAlias(arg0, arg1, arg2)),
   'parseCombinator_0':
       new MethodTrampoline(0, (Parser target) => target.parseCombinator()),
   'parseCombinators_0':
@@ -194,9 +198,10 @@
       1, (Parser target, arg0) => target._parseCompilationUnitMember(arg0)),
   'parseConstExpression_0': new MethodTrampoline(
       0, (Parser target) => target._parseConstExpression()),
-  'parseConstructor_8': new MethodTrampoline(8, (Parser target, arg0, arg1,
-          arg2, arg3, arg4, arg5, arg6, arg7) =>
-      target._parseConstructor(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7)),
+  'parseConstructor_8': new MethodTrampoline(
+      8,
+      (Parser target, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) => target
+          ._parseConstructor(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7)),
   'parseConstructorFieldInitializer_0': new MethodTrampoline(
       0, (Parser target) => target._parseConstructorFieldInitializer()),
   'parseContinueStatement_0': new MethodTrampoline(
@@ -227,26 +232,36 @@
       1, (Parser target, arg0) => target._parseFormalParameter(arg0)),
   'parseForStatement_0':
       new MethodTrampoline(0, (Parser target) => target._parseForStatement()),
-  'parseFunctionBody_3': new MethodTrampoline(3, (Parser target, arg0, arg1,
-      arg2) => target._parseFunctionBody(arg0, arg1, arg2)),
-  'parseFunctionDeclaration_3': new MethodTrampoline(3, (Parser target, arg0,
-      arg1, arg2) => target._parseFunctionDeclaration(arg0, arg1, arg2)),
+  'parseFunctionBody_3': new MethodTrampoline(
+      3,
+      (Parser target, arg0, arg1, arg2) =>
+          target._parseFunctionBody(arg0, arg1, arg2)),
+  'parseFunctionDeclaration_3': new MethodTrampoline(
+      3,
+      (Parser target, arg0, arg1, arg2) =>
+          target._parseFunctionDeclaration(arg0, arg1, arg2)),
   'parseFunctionDeclarationStatement_0': new MethodTrampoline(
       0, (Parser target) => target._parseFunctionDeclarationStatement()),
-  'parseFunctionDeclarationStatementAfterReturnType_2': new MethodTrampoline(2,
+  'parseFunctionDeclarationStatementAfterReturnType_2': new MethodTrampoline(
+      2,
       (Parser target, arg0, arg1) =>
           target._parseFunctionDeclarationStatementAfterReturnType(arg0, arg1)),
-  'parseFunctionTypeAlias_2': new MethodTrampoline(2, (Parser target, arg0,
-      arg1) => target._parseFunctionTypeAlias(arg0, arg1)),
-  'parseGetter_4': new MethodTrampoline(4, (Parser target, arg0, arg1, arg2,
-      arg3) => target._parseGetter(arg0, arg1, arg2, arg3)),
+  'parseFunctionTypeAlias_2': new MethodTrampoline(
+      2,
+      (Parser target, arg0, arg1) =>
+          target._parseFunctionTypeAlias(arg0, arg1)),
+  'parseGetter_4': new MethodTrampoline(
+      4,
+      (Parser target, arg0, arg1, arg2, arg3) =>
+          target._parseGetter(arg0, arg1, arg2, arg3)),
   'parseIdentifierList_0':
       new MethodTrampoline(0, (Parser target) => target._parseIdentifierList()),
   'parseIfStatement_0':
       new MethodTrampoline(0, (Parser target) => target._parseIfStatement()),
   'parseImportDirective_1': new MethodTrampoline(
       1, (Parser target, arg0) => target._parseImportDirective(arg0)),
-  'parseInitializedIdentifierList_4': new MethodTrampoline(4,
+  'parseInitializedIdentifierList_4': new MethodTrampoline(
+      4,
       (Parser target, arg0, arg1, arg2, arg3) =>
           target._parseInitializedIdentifierList(arg0, arg1, arg2, arg3)),
   'parseInstanceCreationExpression_1': new MethodTrampoline(1,
@@ -263,11 +278,13 @@
       0, (Parser target) => target._parseLogicalAndExpression()),
   'parseMapLiteral_2': new MethodTrampoline(
       2, (Parser target, arg0, arg1) => target._parseMapLiteral(arg0, arg1)),
-  'parseMethodDeclarationAfterParameters_7': new MethodTrampoline(7,
-      (Parser target, arg0, arg1, arg2, arg3, arg4, arg5, arg6) => target
-          ._parseMethodDeclarationAfterParameters(
+  'parseMethodDeclarationAfterParameters_7': new MethodTrampoline(
+      7,
+      (Parser target, arg0, arg1, arg2, arg3, arg4, arg5, arg6) =>
+          target._parseMethodDeclarationAfterParameters(
               arg0, arg1, arg2, arg3, arg4, arg5, arg6)),
-  'parseMethodDeclarationAfterReturnType_4': new MethodTrampoline(4,
+  'parseMethodDeclarationAfterReturnType_4': new MethodTrampoline(
+      4,
       (Parser target, arg0, arg1, arg2, arg3) => target
           ._parseMethodDeclarationAfterReturnType(arg0, arg1, arg2, arg3)),
   'parseModifiers_0':
@@ -280,8 +297,10 @@
       new MethodTrampoline(0, (Parser target) => target._parseNewExpression()),
   'parseNonLabeledStatement_0': new MethodTrampoline(
       0, (Parser target) => target._parseNonLabeledStatement()),
-  'parseOperator_3': new MethodTrampoline(3, (Parser target, arg0, arg1,
-      arg2) => target._parseOperator(arg0, arg1, arg2)),
+  'parseOperator_3': new MethodTrampoline(
+      3,
+      (Parser target, arg0, arg1, arg2) =>
+          target._parseOperator(arg0, arg1, arg2)),
   'parseOptionalReturnType_0': new MethodTrampoline(
       0, (Parser target) => target._parseOptionalReturnType()),
   'parsePartDirective_1': new MethodTrampoline(
@@ -298,8 +317,10 @@
       0, (Parser target) => target._parseRethrowExpression()),
   'parseReturnStatement_0': new MethodTrampoline(
       0, (Parser target) => target._parseReturnStatement()),
-  'parseSetter_4': new MethodTrampoline(4, (Parser target, arg0, arg1, arg2,
-      arg3) => target._parseSetter(arg0, arg1, arg2, arg3)),
+  'parseSetter_4': new MethodTrampoline(
+      4,
+      (Parser target, arg0, arg1, arg2, arg3) =>
+          target._parseSetter(arg0, arg1, arg2, arg3)),
   'parseShiftExpression_0': new MethodTrampoline(
       0, (Parser target) => target._parseShiftExpression()),
   'parseStatementList_0':
@@ -324,16 +345,20 @@
       0, (Parser target) => target._parseUnaryExpression()),
   'parseVariableDeclaration_0': new MethodTrampoline(
       0, (Parser target) => target._parseVariableDeclaration()),
-  'parseVariableDeclarationListAfterMetadata_1': new MethodTrampoline(1,
+  'parseVariableDeclarationListAfterMetadata_1': new MethodTrampoline(
+      1,
       (Parser target, arg0) =>
           target._parseVariableDeclarationListAfterMetadata(arg0)),
-  'parseVariableDeclarationListAfterType_3': new MethodTrampoline(3,
+  'parseVariableDeclarationListAfterType_3': new MethodTrampoline(
+      3,
       (Parser target, arg0, arg1, arg2) =>
           target._parseVariableDeclarationListAfterType(arg0, arg1, arg2)),
-  'parseVariableDeclarationStatementAfterMetadata_1': new MethodTrampoline(1,
+  'parseVariableDeclarationStatementAfterMetadata_1': new MethodTrampoline(
+      1,
       (Parser target, arg0) =>
           target._parseVariableDeclarationStatementAfterMetadata(arg0)),
-  'parseVariableDeclarationStatementAfterType_3': new MethodTrampoline(3,
+  'parseVariableDeclarationStatementAfterType_3': new MethodTrampoline(
+      3,
       (Parser target, arg0, arg1, arg2) =>
           target._parseVariableDeclarationStatementAfterType(arg0, arg1, arg2)),
   'parseWhileStatement_0':
@@ -345,12 +370,18 @@
       new MethodTrampoline(1, (Parser target, arg0) => target._peekAt(arg0)),
   'reportError_1': new MethodTrampoline(
       1, (Parser target, arg0) => target._reportError(arg0)),
-  'reportErrorForCurrentToken_2': new MethodTrampoline(2, (Parser target, arg0,
-      arg1) => target._reportErrorForCurrentToken(arg0, arg1)),
-  'reportErrorForNode_3': new MethodTrampoline(3, (Parser target, arg0, arg1,
-      arg2) => target._reportErrorForNode(arg0, arg1, arg2)),
-  'reportErrorForToken_3': new MethodTrampoline(3, (Parser target, arg0, arg1,
-      arg2) => target._reportErrorForToken(arg0, arg1, arg2)),
+  'reportErrorForCurrentToken_2': new MethodTrampoline(
+      2,
+      (Parser target, arg0, arg1) =>
+          target._reportErrorForCurrentToken(arg0, arg1)),
+  'reportErrorForNode_3': new MethodTrampoline(
+      3,
+      (Parser target, arg0, arg1, arg2) =>
+          target._reportErrorForNode(arg0, arg1, arg2)),
+  'reportErrorForToken_3': new MethodTrampoline(
+      3,
+      (Parser target, arg0, arg1, arg2) =>
+          target._reportErrorForToken(arg0, arg1, arg2)),
   'skipBlock_0':
       new MethodTrampoline(0, (Parser target) => target._skipBlock()),
   'skipFinalConstVarOrType_1': new MethodTrampoline(
@@ -383,8 +414,10 @@
       (Parser target, arg0, arg1) => target._tokenMatchesKeyword(arg0, arg1)),
   'tokenMatchesString_2': new MethodTrampoline(
       2, (Parser target, arg0, arg1) => target._tokenMatchesString(arg0, arg1)),
-  'translateCharacter_3': new MethodTrampoline(3, (Parser target, arg0, arg1,
-      arg2) => target._translateCharacter(arg0, arg1, arg2)),
+  'translateCharacter_3': new MethodTrampoline(
+      3,
+      (Parser target, arg0, arg1, arg2) =>
+          target._translateCharacter(arg0, arg1, arg2)),
   'unlockErrorListener_0':
       new MethodTrampoline(0, (Parser target) => target._unlockErrorListener()),
   'validateFormalParameterList_1': new MethodTrampoline(
@@ -397,21 +430,26 @@
       1, (Parser target, arg0) => target._validateModifiersForEnum(arg0)),
   'validateModifiersForField_1': new MethodTrampoline(
       1, (Parser target, arg0) => target._validateModifiersForField(arg0)),
-  'validateModifiersForFunctionDeclarationStatement_1': new MethodTrampoline(1,
+  'validateModifiersForFunctionDeclarationStatement_1': new MethodTrampoline(
+      1,
       (Parser target, arg0) =>
           target._validateModifiersForFunctionDeclarationStatement(arg0)),
-  'validateModifiersForGetterOrSetterOrMethod_1': new MethodTrampoline(1,
+  'validateModifiersForGetterOrSetterOrMethod_1': new MethodTrampoline(
+      1,
       (Parser target, arg0) =>
           target._validateModifiersForGetterOrSetterOrMethod(arg0)),
   'validateModifiersForOperator_1': new MethodTrampoline(
       1, (Parser target, arg0) => target._validateModifiersForOperator(arg0)),
-  'validateModifiersForTopLevelDeclaration_1': new MethodTrampoline(1,
+  'validateModifiersForTopLevelDeclaration_1': new MethodTrampoline(
+      1,
       (Parser target, arg0) =>
           target._validateModifiersForTopLevelDeclaration(arg0)),
-  'validateModifiersForTopLevelFunction_1': new MethodTrampoline(1,
+  'validateModifiersForTopLevelFunction_1': new MethodTrampoline(
+      1,
       (Parser target, arg0) =>
           target._validateModifiersForTopLevelFunction(arg0)),
-  'validateModifiersForTopLevelVariable_1': new MethodTrampoline(1,
+  'validateModifiersForTopLevelVariable_1': new MethodTrampoline(
+      1,
       (Parser target, arg0) =>
           target._validateModifiersForTopLevelVariable(arg0)),
   'validateModifiersForTypedef_1': new MethodTrampoline(
@@ -2331,11 +2369,11 @@
             commentAndMetadata, modifiers.externalKeyword, returnType);
       } else if (_matchesIdentifier() &&
           _peek().matchesAny([
-        TokenType.OPEN_PAREN,
-        TokenType.OPEN_CURLY_BRACKET,
-        TokenType.FUNCTION,
-        TokenType.LT
-      ])) {
+            TokenType.OPEN_PAREN,
+            TokenType.OPEN_CURLY_BRACKET,
+            TokenType.FUNCTION,
+            TokenType.LT
+          ])) {
         _validateModifiersForGetterOrSetterOrMethod(modifiers);
         return _parseMethodDeclarationAfterReturnType(commentAndMetadata,
             modifiers.externalKeyword, modifiers.staticKeyword, returnType);
@@ -2350,8 +2388,10 @@
             // We appear to have a variable declaration with a type of "void".
             //
             _reportErrorForNode(ParserErrorCode.VOID_VARIABLE, returnType);
-            return _parseInitializedIdentifierList(commentAndMetadata,
-                modifiers.staticKeyword, _validateModifiersForField(modifiers),
+            return _parseInitializedIdentifierList(
+                commentAndMetadata,
+                modifiers.staticKeyword,
+                _validateModifiersForField(modifiers),
                 returnType);
           }
         }
@@ -2429,8 +2469,10 @@
         List<VariableDeclaration> variables = new List<VariableDeclaration>();
         variables.add(
             new VariableDeclaration(_createSyntheticIdentifier(), null, null));
-        return new FieldDeclaration(commentAndMetadata.comment,
-            commentAndMetadata.metadata, null,
+        return new FieldDeclaration(
+            commentAndMetadata.comment,
+            commentAndMetadata.metadata,
+            null,
             new VariableDeclarationList(null, null, keyword, null, variables),
             _expectSemicolon());
       }
@@ -2444,9 +2486,17 @@
         // to loose, so we'll treat it as a method declaration with a missing
         // name, parameters and empty body.
         //
-        return new MethodDeclaration(commentAndMetadata.comment,
-            commentAndMetadata.metadata, null, null, null, null, null,
-            _createSyntheticIdentifier(), null, new FormalParameterList(
+        return new MethodDeclaration(
+            commentAndMetadata.comment,
+            commentAndMetadata.metadata,
+            null,
+            null,
+            null,
+            null,
+            null,
+            _createSyntheticIdentifier(),
+            null,
+            new FormalParameterList(
                 null, new List<FormalParameter>(), null, null, null),
             new EmptyFunctionBody(_createSyntheticToken(TokenType.SEMICOLON)));
       }
@@ -2454,9 +2504,14 @@
     } else if (_tokenMatches(_peek(), TokenType.PERIOD) &&
         _tokenMatchesIdentifier(_peekAt(2)) &&
         _tokenMatches(_peekAt(3), TokenType.OPEN_PAREN)) {
-      return _parseConstructor(commentAndMetadata, modifiers.externalKeyword,
-          _validateModifiersForConstructor(modifiers), modifiers.factoryKeyword,
-          parseSimpleIdentifier(), getAndAdvance(), parseSimpleIdentifier(),
+      return _parseConstructor(
+          commentAndMetadata,
+          modifiers.externalKeyword,
+          _validateModifiersForConstructor(modifiers),
+          modifiers.factoryKeyword,
+          parseSimpleIdentifier(),
+          getAndAdvance(),
+          parseSimpleIdentifier(),
           parseFormalParameterList());
     } else if (_tokenMatches(_peek(), TokenType.OPEN_PAREN)) {
       SimpleIdentifier methodName = parseSimpleIdentifier();
@@ -2464,15 +2519,26 @@
       if (_matches(TokenType.COLON) ||
           modifiers.factoryKeyword != null ||
           methodName.name == className) {
-        return _parseConstructor(commentAndMetadata, modifiers.externalKeyword,
+        return _parseConstructor(
+            commentAndMetadata,
+            modifiers.externalKeyword,
             _validateModifiersForConstructor(modifiers),
-            modifiers.factoryKeyword, methodName, null, null, parameters);
+            modifiers.factoryKeyword,
+            methodName,
+            null,
+            null,
+            parameters);
       }
       _validateModifiersForGetterOrSetterOrMethod(modifiers);
       _validateFormalParameterList(parameters);
-      return _parseMethodDeclarationAfterParameters(commentAndMetadata,
-          modifiers.externalKeyword, modifiers.staticKeyword, null, methodName,
-          null, parameters);
+      return _parseMethodDeclarationAfterParameters(
+          commentAndMetadata,
+          modifiers.externalKeyword,
+          modifiers.staticKeyword,
+          null,
+          methodName,
+          null,
+          parameters);
     } else if (_peek()
         .matchesAny([TokenType.EQ, TokenType.COMMA, TokenType.SEMICOLON])) {
       if (modifiers.constKeyword == null &&
@@ -2517,8 +2583,10 @@
         // class. At this point it consists of a type name, so we'll treat it as
         // a field declaration with a missing field name and semicolon.
         //
-        return _parseInitializedIdentifierList(commentAndMetadata,
-            modifiers.staticKeyword, _validateModifiersForField(modifiers),
+        return _parseInitializedIdentifierList(
+            commentAndMetadata,
+            modifiers.staticKeyword,
+            _validateModifiersForField(modifiers),
             type);
       }
       if (_isOperator(_currentToken)) {
@@ -2539,8 +2607,10 @@
           ParserErrorCode.EXPECTED_CLASS_MEMBER, _currentToken);
       try {
         _lockErrorListener();
-        return _parseInitializedIdentifierList(commentAndMetadata,
-            modifiers.staticKeyword, _validateModifiersForField(modifiers),
+        return _parseInitializedIdentifierList(
+            commentAndMetadata,
+            modifiers.staticKeyword,
+            _validateModifiersForField(modifiers),
             type);
       } finally {
         _unlockErrorListener();
@@ -2550,15 +2620,26 @@
       FormalParameterList parameters = parseFormalParameterList();
       if (methodName.name == className) {
         _reportErrorForNode(ParserErrorCode.CONSTRUCTOR_WITH_RETURN_TYPE, type);
-        return _parseConstructor(commentAndMetadata, modifiers.externalKeyword,
+        return _parseConstructor(
+            commentAndMetadata,
+            modifiers.externalKeyword,
             _validateModifiersForConstructor(modifiers),
-            modifiers.factoryKeyword, methodName, null, null, parameters);
+            modifiers.factoryKeyword,
+            methodName,
+            null,
+            null,
+            parameters);
       }
       _validateModifiersForGetterOrSetterOrMethod(modifiers);
       _validateFormalParameterList(parameters);
-      return _parseMethodDeclarationAfterParameters(commentAndMetadata,
-          modifiers.externalKeyword, modifiers.staticKeyword, type, methodName,
-          null, parameters);
+      return _parseMethodDeclarationAfterParameters(
+          commentAndMetadata,
+          modifiers.externalKeyword,
+          modifiers.staticKeyword,
+          type,
+          methodName,
+          null,
+          parameters);
     } else if (parseGenericMethods && _tokenMatches(_peek(), TokenType.LT)) {
       return _parseMethodDeclarationAfterReturnType(commentAndMetadata,
           modifiers.externalKeyword, modifiers.staticKeyword, type);
@@ -3195,13 +3276,24 @@
           _reportErrorForToken(
               ParserErrorCode.FUNCTION_TYPED_PARAMETER_VAR, holder.keyword);
         }
-        return new FunctionTypedFormalParameter(commentAndMetadata.comment,
-            commentAndMetadata.metadata, holder.type, identifier,
-            typeParameters, parameters);
+        return new FunctionTypedFormalParameter(
+            commentAndMetadata.comment,
+            commentAndMetadata.metadata,
+            holder.type,
+            identifier,
+            typeParameters,
+            parameters);
       } else {
-        return new FieldFormalParameter(commentAndMetadata.comment,
-            commentAndMetadata.metadata, holder.keyword, holder.type,
-            thisKeyword, period, identifier, typeParameters, parameters);
+        return new FieldFormalParameter(
+            commentAndMetadata.comment,
+            commentAndMetadata.metadata,
+            holder.keyword,
+            holder.type,
+            thisKeyword,
+            period,
+            identifier,
+            typeParameters,
+            parameters);
       }
     } else if (typeParameters != null) {
       // TODO(brianwilkerson) Report an error. It looks like a function-typed
@@ -3222,9 +3314,16 @@
       // TODO(brianwilkerson) If there are type parameters but no parameters,
       // should we create a synthetic empty parameter list here so we can
       // capture the type parameters?
-      return new FieldFormalParameter(commentAndMetadata.comment,
-          commentAndMetadata.metadata, holder.keyword, holder.type, thisKeyword,
-          period, identifier, null, null);
+      return new FieldFormalParameter(
+          commentAndMetadata.comment,
+          commentAndMetadata.metadata,
+          holder.keyword,
+          holder.type,
+          thisKeyword,
+          period,
+          identifier,
+          null,
+          null);
     }
     return new SimpleFormalParameter(commentAndMetadata.comment,
         commentAndMetadata.metadata, holder.keyword, holder.type, identifier);
@@ -3511,9 +3610,14 @@
    * captures the components of the given method declaration).
    */
   FunctionDeclaration _convertToFunctionDeclaration(MethodDeclaration method) =>
-      new FunctionDeclaration(method.documentationComment, method.metadata,
-          method.externalKeyword, method.returnType, method.propertyKeyword,
-          method.name, new FunctionExpression(
+      new FunctionDeclaration(
+          method.documentationComment,
+          method.metadata,
+          method.externalKeyword,
+          method.returnType,
+          method.propertyKeyword,
+          method.name,
+          new FunctionExpression(
               method.typeParameters, method.parameters, method.body));
 
   /**
@@ -3934,22 +4038,52 @@
         TokenType.INDEX
       ]);
     }
+    bool allowAdditionalTokens = true;
     // We know that we have an identifier, and need to see whether it might be
     // a type name.
+    if (_currentToken.type != TokenType.IDENTIFIER) {
+      allowAdditionalTokens = false;
+    }
     Token token = _skipTypeName(_currentToken);
     if (token == null) {
       // There was no type name, so this can't be a declaration.
       return false;
     }
+    if (token.type != TokenType.IDENTIFIER) {
+      allowAdditionalTokens = false;
+    }
     token = _skipSimpleIdentifier(token);
     if (token == null) {
       return false;
     }
     TokenType type = token.type;
-    return type == TokenType.EQ ||
+    // Usual cases in valid code:
+    //     String v = '';
+    //     String v, v2;
+    //     String v;
+    //     for (String item in items) {}
+    if (type == TokenType.EQ ||
         type == TokenType.COMMA ||
         type == TokenType.SEMICOLON ||
-        _tokenMatchesKeyword(token, Keyword.IN);
+        _tokenMatchesKeyword(token, Keyword.IN)) {
+      return true;
+    }
+    // It is OK to parse as a variable declaration in these cases:
+    //     String v }
+    //     String v if (true) print('OK');
+    //     String v { print(42); }
+    // ...but not in these cases:
+    //     get getterName {
+    //     String get getterName
+    if (allowAdditionalTokens) {
+      if (type == TokenType.CLOSE_CURLY_BRACKET ||
+          type == TokenType.KEYWORD ||
+          type == TokenType.IDENTIFIER ||
+          type == TokenType.OPEN_CURLY_BRACKET) {
+        return true;
+      }
+    }
+    return false;
   }
 
   bool _isLikelyParameterList() {
@@ -4215,7 +4349,8 @@
   Expression _parseAssignableExpression(bool primaryAllowed) {
     if (_matchesKeyword(Keyword.SUPER)) {
       return _parseAssignableSelector(
-          new SuperExpression(getAndAdvance()), false, allowConditional: false);
+          new SuperExpression(getAndAdvance()), false,
+          allowConditional: false);
     }
     //
     // A primary expression can start with an identifier. We resolve the
@@ -4236,8 +4371,11 @@
               expression as SimpleIdentifier, typeArguments, argumentList);
         } else if (expression is PrefixedIdentifier) {
           PrefixedIdentifier identifier = expression as PrefixedIdentifier;
-          expression = new MethodInvocation(identifier.prefix,
-              identifier.period, identifier.identifier, typeArguments,
+          expression = new MethodInvocation(
+              identifier.prefix,
+              identifier.period,
+              identifier.identifier,
+              typeArguments,
               argumentList);
         } else if (expression is PropertyAccess) {
           PropertyAccess access = expression as PropertyAccess;
@@ -4472,9 +4610,12 @@
           }
           if (expression is PropertyAccess) {
             PropertyAccess propertyAccess = expression as PropertyAccess;
-            expression = new MethodInvocation(propertyAccess.target,
-                propertyAccess.operator, propertyAccess.propertyName,
-                typeArguments, parseArgumentList());
+            expression = new MethodInvocation(
+                propertyAccess.target,
+                propertyAccess.operator,
+                propertyAccess.propertyName,
+                typeArguments,
+                parseArgumentList());
           } else {
             expression = new FunctionExpressionInvocation(
                 expression, typeArguments, parseArgumentList());
@@ -4603,9 +4744,18 @@
       _reportErrorForCurrentToken(ParserErrorCode.MISSING_CLASS_BODY);
     }
     ClassDeclaration classDeclaration = new ClassDeclaration(
-        commentAndMetadata.comment, commentAndMetadata.metadata,
-        abstractKeyword, keyword, name, typeParameters, extendsClause,
-        withClause, implementsClause, leftBracket, members, rightBracket);
+        commentAndMetadata.comment,
+        commentAndMetadata.metadata,
+        abstractKeyword,
+        keyword,
+        name,
+        typeParameters,
+        extendsClause,
+        withClause,
+        implementsClause,
+        leftBracket,
+        members,
+        rightBracket);
     classDeclaration.nativeClause = nativeClause;
     return classDeclaration;
   }
@@ -4695,9 +4845,17 @@
       }
       semicolon = _createSyntheticToken(TokenType.SEMICOLON);
     }
-    return new ClassTypeAlias(commentAndMetadata.comment,
-        commentAndMetadata.metadata, classKeyword, className, typeParameters,
-        equals, abstractKeyword, superclass, withClause, implementsClause,
+    return new ClassTypeAlias(
+        commentAndMetadata.comment,
+        commentAndMetadata.metadata,
+        classKeyword,
+        className,
+        typeParameters,
+        equals,
+        abstractKeyword,
+        superclass,
+        withClause,
+        implementsClause,
         semicolon);
   }
 
@@ -4927,10 +5085,10 @@
             commentAndMetadata, modifiers.externalKeyword, returnType));
       } else if (_matchesIdentifier() &&
           _peek().matchesAny([
-        TokenType.OPEN_PAREN,
-        TokenType.OPEN_CURLY_BRACKET,
-        TokenType.FUNCTION
-      ])) {
+            TokenType.OPEN_PAREN,
+            TokenType.OPEN_CURLY_BRACKET,
+            TokenType.FUNCTION
+          ])) {
         _validateModifiersForTopLevelFunction(modifiers);
         return _parseFunctionDeclaration(
             commentAndMetadata, modifiers.externalKeyword, returnType);
@@ -4945,7 +5103,8 @@
             // We appear to have a variable declaration with a type of "void".
             //
             _reportErrorForNode(ParserErrorCode.VOID_VARIABLE, returnType);
-            return new TopLevelVariableDeclaration(commentAndMetadata.comment,
+            return new TopLevelVariableDeclaration(
+                commentAndMetadata.comment,
                 commentAndMetadata.metadata,
                 _parseVariableDeclarationListAfterType(null,
                     _validateModifiersForTopLevelVariable(modifiers), null),
@@ -4981,7 +5140,8 @@
         List<VariableDeclaration> variables = new List<VariableDeclaration>();
         variables.add(
             new VariableDeclaration(_createSyntheticIdentifier(), null, null));
-        return new TopLevelVariableDeclaration(commentAndMetadata.comment,
+        return new TopLevelVariableDeclaration(
+            commentAndMetadata.comment,
             commentAndMetadata.metadata,
             new VariableDeclarationList(null, null, keyword, null, variables),
             _expectSemicolon());
@@ -5000,8 +5160,10 @@
         _reportErrorForCurrentToken(
             ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE);
       }
-      return new TopLevelVariableDeclaration(commentAndMetadata.comment,
-          commentAndMetadata.metadata, _parseVariableDeclarationListAfterType(
+      return new TopLevelVariableDeclaration(
+          commentAndMetadata.comment,
+          commentAndMetadata.metadata,
+          _parseVariableDeclarationListAfterType(
               null, _validateModifiersForTopLevelVariable(modifiers), null),
           _expect(TokenType.SEMICOLON));
     }
@@ -5016,10 +5178,12 @@
       return _convertToFunctionDeclaration(_parseOperator(
           commentAndMetadata, modifiers.externalKeyword, returnType));
     } else if (_matches(TokenType.AT)) {
-      return new TopLevelVariableDeclaration(commentAndMetadata.comment,
-          commentAndMetadata.metadata, _parseVariableDeclarationListAfterType(
-              null, _validateModifiersForTopLevelVariable(modifiers),
-              returnType), _expect(TokenType.SEMICOLON));
+      return new TopLevelVariableDeclaration(
+          commentAndMetadata.comment,
+          commentAndMetadata.metadata,
+          _parseVariableDeclarationListAfterType(null,
+              _validateModifiersForTopLevelVariable(modifiers), returnType),
+          _expect(TokenType.SEMICOLON));
     } else if (!_matchesIdentifier()) {
       // TODO(brianwilkerson) Generalize this error. We could also be parsing a
       // top-level variable at this point.
@@ -5033,7 +5197,8 @@
       List<VariableDeclaration> variables = new List<VariableDeclaration>();
       variables.add(
           new VariableDeclaration(_createSyntheticIdentifier(), null, null));
-      return new TopLevelVariableDeclaration(commentAndMetadata.comment,
+      return new TopLevelVariableDeclaration(
+          commentAndMetadata.comment,
           commentAndMetadata.metadata,
           new VariableDeclarationList(null, null, null, returnType, variables),
           semicolon);
@@ -5047,8 +5212,10 @@
       return _parseFunctionDeclaration(
           commentAndMetadata, modifiers.externalKeyword, returnType);
     }
-    return new TopLevelVariableDeclaration(commentAndMetadata.comment,
-        commentAndMetadata.metadata, _parseVariableDeclarationListAfterType(
+    return new TopLevelVariableDeclaration(
+        commentAndMetadata.comment,
+        commentAndMetadata.metadata,
+        _parseVariableDeclarationListAfterType(
             null, _validateModifiersForTopLevelVariable(modifiers), returnType),
         _expect(TokenType.SEMICOLON));
   }
@@ -5074,9 +5241,14 @@
   }
 
   ConstructorDeclaration _parseConstructor(
-      CommentAndMetadata commentAndMetadata, Token externalKeyword,
-      Token constKeyword, Token factoryKeyword, SimpleIdentifier returnType,
-      Token period, SimpleIdentifier name, FormalParameterList parameters) {
+      CommentAndMetadata commentAndMetadata,
+      Token externalKeyword,
+      Token constKeyword,
+      Token factoryKeyword,
+      SimpleIdentifier returnType,
+      Token period,
+      SimpleIdentifier name,
+      FormalParameterList parameters) {
     bool bodyAllowed = externalKeyword == null;
     Token separator = null;
     List<ConstructorInitializer> initializers = null;
@@ -5144,10 +5316,20 @@
         }
       }
     }
-    return new ConstructorDeclaration(commentAndMetadata.comment,
-        commentAndMetadata.metadata, externalKeyword, constKeyword,
-        factoryKeyword, returnType, period, name, parameters, separator,
-        initializers, redirectedConstructor, body);
+    return new ConstructorDeclaration(
+        commentAndMetadata.comment,
+        commentAndMetadata.metadata,
+        externalKeyword,
+        constKeyword,
+        factoryKeyword,
+        returnType,
+        period,
+        name,
+        parameters,
+        separator,
+        initializers,
+        redirectedConstructor,
+        body);
   }
 
   /**
@@ -5415,8 +5597,13 @@
       rightBracket = _createSyntheticToken(TokenType.CLOSE_CURLY_BRACKET);
       _reportErrorForCurrentToken(ParserErrorCode.MISSING_ENUM_BODY);
     }
-    return new EnumDeclaration(commentAndMetadata.comment,
-        commentAndMetadata.metadata, keyword, name, leftBracket, constants,
+    return new EnumDeclaration(
+        commentAndMetadata.comment,
+        commentAndMetadata.metadata,
+        keyword,
+        name,
+        leftBracket,
+        constants,
         rightBracket);
   }
 
@@ -5462,8 +5649,12 @@
     StringLiteral libraryUri = _parseUri();
     List<Combinator> combinators = _parseCombinators();
     Token semicolon = _expectSemicolon();
-    return new ExportDirective(commentAndMetadata.comment,
-        commentAndMetadata.metadata, exportKeyword, libraryUri, combinators,
+    return new ExportDirective(
+        commentAndMetadata.comment,
+        commentAndMetadata.metadata,
+        exportKeyword,
+        libraryUri,
+        combinators,
         semicolon);
   }
 
@@ -5643,34 +5834,54 @@
           Token rightParenthesis = _expect(TokenType.CLOSE_PAREN);
           Statement body = parseStatement2();
           if (loopVariable == null) {
-            return new ForEachStatement.withReference(awaitKeyword, forKeyword,
-                leftParenthesis, identifier, inKeyword, iterator,
-                rightParenthesis, body);
+            return new ForEachStatement.withReference(
+                awaitKeyword,
+                forKeyword,
+                leftParenthesis,
+                identifier,
+                inKeyword,
+                iterator,
+                rightParenthesis,
+                body);
           }
-          return new ForEachStatement.withDeclaration(awaitKeyword, forKeyword,
-              leftParenthesis, loopVariable, inKeyword, iterator,
-              rightParenthesis, body);
+          return new ForEachStatement.withDeclaration(
+              awaitKeyword,
+              forKeyword,
+              leftParenthesis,
+              loopVariable,
+              inKeyword,
+              iterator,
+              rightParenthesis,
+              body);
         }
       }
       if (awaitKeyword != null) {
         _reportErrorForToken(
             ParserErrorCode.INVALID_AWAIT_IN_FOR, awaitKeyword);
       }
-      Token leftSeparator = _expect(TokenType.SEMICOLON);
+      Token leftSeparator = _expectSemicolon();
       Expression condition = null;
       if (!_matches(TokenType.SEMICOLON)) {
         condition = parseExpression2();
       }
-      Token rightSeparator = _expect(TokenType.SEMICOLON);
+      Token rightSeparator = _expectSemicolon();
       List<Expression> updaters = null;
       if (!_matches(TokenType.CLOSE_PAREN)) {
         updaters = _parseExpressionList();
       }
       Token rightParenthesis = _expect(TokenType.CLOSE_PAREN);
       Statement body = parseStatement2();
-      return new ForStatement(forKeyword, leftParenthesis, variableList,
-          initialization, leftSeparator, condition, rightSeparator, updaters,
-          rightParenthesis, body);
+      return new ForStatement(
+          forKeyword,
+          leftParenthesis,
+          variableList,
+          initialization,
+          leftSeparator,
+          condition,
+          rightSeparator,
+          updaters,
+          rightParenthesis,
+          body);
     } finally {
       _inLoop = wasInLoop;
     }
@@ -5800,7 +6011,8 @@
    *       | returnType? getOrSet identifier formalParameterList functionBody
    */
   FunctionDeclaration _parseFunctionDeclaration(
-      CommentAndMetadata commentAndMetadata, Token externalKeyword,
+      CommentAndMetadata commentAndMetadata,
+      Token externalKeyword,
       TypeName returnType) {
     Token keyword = null;
     bool isGetter = false;
@@ -5826,7 +6038,10 @@
         _reportErrorForCurrentToken(
             ParserErrorCode.MISSING_FUNCTION_PARAMETERS);
         parameters = new FormalParameterList(
-            _createSyntheticToken(TokenType.OPEN_PAREN), null, null, null,
+            _createSyntheticToken(TokenType.OPEN_PAREN),
+            null,
+            null,
+            null,
             _createSyntheticToken(TokenType.CLOSE_PAREN));
       }
     } else if (_matches(TokenType.OPEN_PAREN)) {
@@ -5845,8 +6060,13 @@
 //          reportError(ParserErrorCode.UNEXPECTED_TOKEN, currentToken.getLexeme());
 //          advance();
 //        }
-    return new FunctionDeclaration(commentAndMetadata.comment,
-        commentAndMetadata.metadata, externalKeyword, returnType, keyword, name,
+    return new FunctionDeclaration(
+        commentAndMetadata.comment,
+        commentAndMetadata.metadata,
+        externalKeyword,
+        returnType,
+        keyword,
+        name,
         new FunctionExpression(typeParameters, parameters, body));
   }
 
@@ -5915,31 +6135,50 @@
     if (_matches(TokenType.SEMICOLON) || _matches(TokenType.EOF)) {
       _reportErrorForCurrentToken(ParserErrorCode.MISSING_TYPEDEF_PARAMETERS);
       FormalParameterList parameters = new FormalParameterList(
-          _createSyntheticToken(TokenType.OPEN_PAREN), null, null, null,
+          _createSyntheticToken(TokenType.OPEN_PAREN),
+          null,
+          null,
+          null,
           _createSyntheticToken(TokenType.CLOSE_PAREN));
       Token semicolon = _expect(TokenType.SEMICOLON);
-      return new FunctionTypeAlias(commentAndMetadata.comment,
-          commentAndMetadata.metadata, keyword, returnType, name,
-          typeParameters, parameters, semicolon);
+      return new FunctionTypeAlias(
+          commentAndMetadata.comment,
+          commentAndMetadata.metadata,
+          keyword,
+          returnType,
+          name,
+          typeParameters,
+          parameters,
+          semicolon);
     } else if (!_matches(TokenType.OPEN_PAREN)) {
       _reportErrorForCurrentToken(ParserErrorCode.MISSING_TYPEDEF_PARAMETERS);
       // TODO(brianwilkerson) Recover from this error. At the very least we
       // should skip to the start of the next valid compilation unit member,
       // allowing for the possibility of finding the typedef parameters before
       // that point.
-      return new FunctionTypeAlias(commentAndMetadata.comment,
-          commentAndMetadata.metadata, keyword, returnType, name,
-          typeParameters, new FormalParameterList(
-              _createSyntheticToken(TokenType.OPEN_PAREN), null, null, null,
-              _createSyntheticToken(TokenType.CLOSE_PAREN)),
+      return new FunctionTypeAlias(
+          commentAndMetadata.comment,
+          commentAndMetadata.metadata,
+          keyword,
+          returnType,
+          name,
+          typeParameters,
+          new FormalParameterList(_createSyntheticToken(TokenType.OPEN_PAREN),
+              null, null, null, _createSyntheticToken(TokenType.CLOSE_PAREN)),
           _createSyntheticToken(TokenType.SEMICOLON));
     }
     FormalParameterList parameters = parseFormalParameterList();
     _validateFormalParameterList(parameters);
     Token semicolon = _expect(TokenType.SEMICOLON);
-    return new FunctionTypeAlias(commentAndMetadata.comment,
-        commentAndMetadata.metadata, keyword, returnType, name, typeParameters,
-        parameters, semicolon);
+    return new FunctionTypeAlias(
+        commentAndMetadata.comment,
+        commentAndMetadata.metadata,
+        keyword,
+        returnType,
+        name,
+        typeParameters,
+        parameters,
+        semicolon);
   }
 
   /**
@@ -5968,13 +6207,23 @@
     }
     FunctionBody body = _parseFunctionBody(
         externalKeyword != null || staticKeyword == null,
-        ParserErrorCode.STATIC_GETTER_WITHOUT_BODY, false);
+        ParserErrorCode.STATIC_GETTER_WITHOUT_BODY,
+        false);
     if (externalKeyword != null && body is! EmptyFunctionBody) {
       _reportErrorForCurrentToken(ParserErrorCode.EXTERNAL_GETTER_WITH_BODY);
     }
-    return new MethodDeclaration(commentAndMetadata.comment,
-        commentAndMetadata.metadata, externalKeyword, staticKeyword, returnType,
-        propertyKeyword, null, name, null, null, body);
+    return new MethodDeclaration(
+        commentAndMetadata.comment,
+        commentAndMetadata.metadata,
+        externalKeyword,
+        staticKeyword,
+        returnType,
+        propertyKeyword,
+        null,
+        name,
+        null,
+        null,
+        body);
   }
 
   /**
@@ -6056,9 +6305,16 @@
     }
     List<Combinator> combinators = _parseCombinators();
     Token semicolon = _expectSemicolon();
-    return new ImportDirective(commentAndMetadata.comment,
-        commentAndMetadata.metadata, importKeyword, libraryUri, deferredToken,
-        asToken, prefix, combinators, semicolon);
+    return new ImportDirective(
+        commentAndMetadata.comment,
+        commentAndMetadata.metadata,
+        importKeyword,
+        libraryUri,
+        deferredToken,
+        asToken,
+        prefix,
+        combinators,
+        semicolon);
   }
 
   /**
@@ -6081,12 +6337,17 @@
    *         identifier ('=' expression)?
    */
   FieldDeclaration _parseInitializedIdentifierList(
-      CommentAndMetadata commentAndMetadata, Token staticKeyword, Token keyword,
+      CommentAndMetadata commentAndMetadata,
+      Token staticKeyword,
+      Token keyword,
       TypeName type) {
     VariableDeclarationList fieldList =
         _parseVariableDeclarationListAfterType(null, keyword, type);
-    return new FieldDeclaration(commentAndMetadata.comment,
-        commentAndMetadata.metadata, staticKeyword, fieldList,
+    return new FieldDeclaration(
+        commentAndMetadata.comment,
+        commentAndMetadata.metadata,
+        staticKeyword,
+        fieldList,
         _expect(TokenType.SEMICOLON));
   }
 
@@ -6164,7 +6425,8 @@
     // may be empty list literal
     if (_matches(TokenType.INDEX)) {
       BeginToken leftBracket = _createToken(
-          _currentToken, TokenType.OPEN_SQUARE_BRACKET, isBegin: true);
+          _currentToken, TokenType.OPEN_SQUARE_BRACKET,
+          isBegin: true);
       Token rightBracket =
           new Token(TokenType.CLOSE_SQUARE_BRACKET, _currentToken.offset + 1);
       leftBracket.endToken = rightBracket;
@@ -6222,8 +6484,11 @@
       return _parseListLiteral(modifier, typeArguments);
     }
     _reportErrorForCurrentToken(ParserErrorCode.EXPECTED_LIST_OR_MAP_LITERAL);
-    return new ListLiteral(modifier, typeArguments,
-        _createSyntheticToken(TokenType.OPEN_SQUARE_BRACKET), null,
+    return new ListLiteral(
+        modifier,
+        typeArguments,
+        _createSyntheticToken(TokenType.OPEN_SQUARE_BRACKET),
+        null,
         _createSyntheticToken(TokenType.CLOSE_SQUARE_BRACKET));
   }
 
@@ -6293,12 +6558,17 @@
    *       | 'external'? functionSignature ';'
    */
   MethodDeclaration _parseMethodDeclarationAfterParameters(
-      CommentAndMetadata commentAndMetadata, Token externalKeyword,
-      Token staticKeyword, TypeName returnType, SimpleIdentifier name,
-      TypeParameterList typeParameters, FormalParameterList parameters) {
+      CommentAndMetadata commentAndMetadata,
+      Token externalKeyword,
+      Token staticKeyword,
+      TypeName returnType,
+      SimpleIdentifier name,
+      TypeParameterList typeParameters,
+      FormalParameterList parameters) {
     FunctionBody body = _parseFunctionBody(
         externalKeyword != null || staticKeyword == null,
-        ParserErrorCode.MISSING_FUNCTION_BODY, false);
+        ParserErrorCode.MISSING_FUNCTION_BODY,
+        false);
     if (externalKeyword != null) {
       if (body is! EmptyFunctionBody) {
         _reportErrorForNode(ParserErrorCode.EXTERNAL_METHOD_WITH_BODY, body);
@@ -6308,9 +6578,18 @@
         _reportErrorForNode(ParserErrorCode.ABSTRACT_STATIC_METHOD, body);
       }
     }
-    return new MethodDeclaration(commentAndMetadata.comment,
-        commentAndMetadata.metadata, externalKeyword, staticKeyword, returnType,
-        null, null, name, typeParameters, parameters, body);
+    return new MethodDeclaration(
+        commentAndMetadata.comment,
+        commentAndMetadata.metadata,
+        externalKeyword,
+        staticKeyword,
+        returnType,
+        null,
+        null,
+        name,
+        typeParameters,
+        parameters,
+        body);
   }
 
   /**
@@ -6326,8 +6605,10 @@
    *       | 'external'? functionSignature ';'
    */
   MethodDeclaration _parseMethodDeclarationAfterReturnType(
-      CommentAndMetadata commentAndMetadata, Token externalKeyword,
-      Token staticKeyword, TypeName returnType) {
+      CommentAndMetadata commentAndMetadata,
+      Token externalKeyword,
+      Token staticKeyword,
+      TypeName returnType) {
     SimpleIdentifier methodName = parseSimpleIdentifier();
     TypeParameterList typeParameters = null;
     if (parseGenericMethods && _matches(TokenType.LT)) {
@@ -6340,14 +6621,22 @@
       _reportErrorForToken(
           ParserErrorCode.MISSING_METHOD_PARAMETERS, _currentToken.previous);
       parameters = new FormalParameterList(
-          _createSyntheticToken(TokenType.OPEN_PAREN), null, null, null,
+          _createSyntheticToken(TokenType.OPEN_PAREN),
+          null,
+          null,
+          null,
           _createSyntheticToken(TokenType.CLOSE_PAREN));
     } else {
       parameters = parseFormalParameterList();
     }
     _validateFormalParameterList(parameters);
-    return _parseMethodDeclarationAfterParameters(commentAndMetadata,
-        externalKeyword, staticKeyword, returnType, methodName, typeParameters,
+    return _parseMethodDeclarationAfterParameters(
+        commentAndMetadata,
+        externalKeyword,
+        staticKeyword,
+        returnType,
+        methodName,
+        typeParameters,
         parameters);
   }
 
@@ -6555,10 +6844,10 @@
         TypeName returnType = parseReturnType();
         if (_matchesIdentifier() &&
             _peek().matchesAny([
-          TokenType.OPEN_PAREN,
-          TokenType.OPEN_CURLY_BRACKET,
-          TokenType.FUNCTION
-        ])) {
+              TokenType.OPEN_PAREN,
+              TokenType.OPEN_CURLY_BRACKET,
+              TokenType.FUNCTION
+            ])) {
           return _parseFunctionDeclarationStatementAfterReturnType(
               commentAndMetadata, returnType);
         } else {
@@ -6702,9 +6991,18 @@
     if (externalKeyword != null && body is! EmptyFunctionBody) {
       _reportErrorForCurrentToken(ParserErrorCode.EXTERNAL_OPERATOR_WITH_BODY);
     }
-    return new MethodDeclaration(commentAndMetadata.comment,
-        commentAndMetadata.metadata, externalKeyword, null, returnType, null,
-        operatorKeyword, name, null, parameters, body);
+    return new MethodDeclaration(
+        commentAndMetadata.comment,
+        commentAndMetadata.metadata,
+        externalKeyword,
+        null,
+        returnType,
+        null,
+        operatorKeyword,
+        name,
+        null,
+        parameters,
+        body);
   }
 
   /**
@@ -6749,8 +7047,12 @@
       LibraryIdentifier libraryName = _parseLibraryName(
           ParserErrorCode.MISSING_NAME_IN_PART_OF_DIRECTIVE, ofKeyword);
       Token semicolon = _expect(TokenType.SEMICOLON);
-      return new PartOfDirective(commentAndMetadata.comment,
-          commentAndMetadata.metadata, partKeyword, ofKeyword, libraryName,
+      return new PartOfDirective(
+          commentAndMetadata.comment,
+          commentAndMetadata.metadata,
+          partKeyword,
+          ofKeyword,
+          libraryName,
           semicolon);
     }
     StringLiteral partUri = _parseUri();
@@ -6839,7 +7141,8 @@
       // TODO(paulberry): verify with Gilad that "super" must be followed by
       // unconditionalAssignableSelector in this case.
       return _parseAssignableSelector(
-          new SuperExpression(getAndAdvance()), false, allowConditional: false);
+          new SuperExpression(getAndAdvance()), false,
+          allowConditional: false);
     } else if (_matchesKeyword(Keyword.NULL)) {
       return new NullLiteral(getAndAdvance());
     } else if (_matchesKeyword(Keyword.FALSE)) {
@@ -7042,13 +7345,23 @@
     _validateFormalParameterList(parameters);
     FunctionBody body = _parseFunctionBody(
         externalKeyword != null || staticKeyword == null,
-        ParserErrorCode.STATIC_SETTER_WITHOUT_BODY, false);
+        ParserErrorCode.STATIC_SETTER_WITHOUT_BODY,
+        false);
     if (externalKeyword != null && body is! EmptyFunctionBody) {
       _reportErrorForCurrentToken(ParserErrorCode.EXTERNAL_SETTER_WITH_BODY);
     }
-    return new MethodDeclaration(commentAndMetadata.comment,
-        commentAndMetadata.metadata, externalKeyword, staticKeyword, returnType,
-        propertyKeyword, null, name, null, parameters, body);
+    return new MethodDeclaration(
+        commentAndMetadata.comment,
+        commentAndMetadata.metadata,
+        externalKeyword,
+        staticKeyword,
+        returnType,
+        propertyKeyword,
+        null,
+        name,
+        null,
+        parameters,
+        body);
   }
 
   /**
@@ -7198,7 +7511,8 @@
           if (definedLabels.contains(label)) {
             _reportErrorForToken(
                 ParserErrorCode.DUPLICATE_LABEL_IN_SWITCH_STATEMENT,
-                identifier.token, [label]);
+                identifier.token,
+                [label]);
           } else {
             definedLabels.add(label);
           }
@@ -7356,9 +7670,16 @@
         rightParenthesis = _expect(TokenType.CLOSE_PAREN);
       }
       Block catchBody = parseBlock();
-      catchClauses.add(new CatchClause(onKeyword, exceptionType, catchKeyword,
-          leftParenthesis, exceptionParameter, comma, stackTraceParameter,
-          rightParenthesis, catchBody));
+      catchClauses.add(new CatchClause(
+          onKeyword,
+          exceptionType,
+          catchKeyword,
+          leftParenthesis,
+          exceptionParameter,
+          comma,
+          stackTraceParameter,
+          rightParenthesis,
+          catchBody));
     }
     Token finallyKeyword = null;
     if (_matchesKeyword(Keyword.FINALLY)) {
@@ -7471,8 +7792,10 @@
           secondOperator.setNext(_currentToken);
           firstOperator.setNext(secondOperator);
           operator.previous.setNext(firstOperator);
-          return new PrefixExpression(firstOperator, new PrefixExpression(
-              secondOperator, new SuperExpression(getAndAdvance())));
+          return new PrefixExpression(
+              firstOperator,
+              new PrefixExpression(
+                  secondOperator, new SuperExpression(getAndAdvance())));
         } else {
           // Invalid operator before 'super'
           _reportErrorForCurrentToken(
@@ -7611,7 +7934,9 @@
     return new VariableDeclarationList(
         commentAndMetadata != null ? commentAndMetadata.comment : null,
         commentAndMetadata != null ? commentAndMetadata.metadata : null,
-        keyword, type, variables);
+        keyword,
+        type,
+        variables);
   }
 
   /**
@@ -7870,10 +8195,10 @@
     // that should only occur at the beginning of a parameter list.
     //
     if (next.matchesAny([
-      TokenType.AT,
-      TokenType.OPEN_SQUARE_BRACKET,
-      TokenType.OPEN_CURLY_BRACKET
-    ]) ||
+          TokenType.AT,
+          TokenType.OPEN_SQUARE_BRACKET,
+          TokenType.OPEN_CURLY_BRACKET
+        ]) ||
         _tokenMatchesKeyword(next, Keyword.VOID) ||
         (_tokenMatchesIdentifier(next) &&
             (next.next.matchesAny([TokenType.COMMA, TokenType.CLOSE_PAREN])))) {
@@ -7986,8 +8311,7 @@
    */
   Token _skipSimpleIdentifier(Token startToken) {
     if (_tokenMatches(startToken, TokenType.IDENTIFIER) ||
-        (_tokenMatches(startToken, TokenType.KEYWORD) &&
-            (startToken as KeywordToken).keyword.isPseudoKeyword)) {
+        _tokenMatchesPseudoKeyword(startToken)) {
       return startToken.next;
     }
     return null;
@@ -8211,8 +8535,7 @@
    */
   bool _tokenMatchesIdentifier(Token token) =>
       _tokenMatches(token, TokenType.IDENTIFIER) ||
-          (_tokenMatches(token, TokenType.KEYWORD) &&
-              (token as KeywordToken).keyword.isPseudoKeyword);
+          _tokenMatchesPseudoKeyword(token);
 
   /**
    * Return `true` if the given [token] matches the given [keyword].
@@ -8222,6 +8545,13 @@
           (token as KeywordToken).keyword == keyword;
 
   /**
+   * Return `true` if the given [token] matches a pseudo keyword.
+   */
+  bool _tokenMatchesPseudoKeyword(Token token) =>
+      _tokenMatches(token, TokenType.KEYWORD) &&
+          (token as KeywordToken).keyword.isPseudoKeyword;
+
+  /**
    * Return `true` if the given [token] matches the given [identifier].
    */
   bool _tokenMatchesString(Token token, String identifier) =>
@@ -8353,20 +8683,15 @@
         } else {
           _appendScalarValue(
               buffer,
-              lexeme
-                  .substring(
-                      index,
-                      currentIndex + 1),
+              lexeme.substring(index, currentIndex + 1),
               (((((Character.digit(firstDigit, 16) << 4) +
                                   Character.digit(secondDigit, 16)) <<
                               4) +
                           Character.digit(thirdDigit, 16)) <<
                       4) +
-                  Character
-                      .digit(fourthDigit, 16),
+                  Character.digit(fourthDigit, 16),
               index,
-              currentIndex +
-                  3);
+              currentIndex + 3);
         }
         return currentIndex + 4;
       }
@@ -8708,6 +9033,7 @@
     }
   }
 }
+
 /**
  * A synthetic keyword token.
  */
@@ -8936,7 +9262,8 @@
           "Top-level declarations cannot be declared to be 'factory'");
 
   static const ParserErrorCode FACTORY_WITH_INITIALIZERS =
-      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.");
@@ -9205,7 +9532,8 @@
           "The part-of directive must be the only directive in a part");
 
   static const ParserErrorCode NON_STRING_LITERAL_AS_URI =
-      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.");
 
@@ -9368,7 +9696,8 @@
   @override
   bool visitAnnotation(Annotation node) {
     Annotation toNode = this._toNode as Annotation;
-    if (_and(_isEqualTokens(node.atSign, toNode.atSign),
+    if (_and(
+        _isEqualTokens(node.atSign, toNode.atSign),
         _isEqualNodes(node.name, toNode.name),
         _isEqualTokens(node.period, toNode.period),
         _isEqualNodes(node.constructorName, toNode.constructorName),
@@ -9382,7 +9711,8 @@
   @override
   bool visitArgumentList(ArgumentList node) {
     ArgumentList toNode = this._toNode as ArgumentList;
-    return _and(_isEqualTokens(node.leftParenthesis, toNode.leftParenthesis),
+    return _and(
+        _isEqualTokens(node.leftParenthesis, toNode.leftParenthesis),
         _isEqualNodeLists(node.arguments, toNode.arguments),
         _isEqualTokens(node.rightParenthesis, toNode.rightParenthesis));
   }
@@ -9390,7 +9720,8 @@
   @override
   bool visitAsExpression(AsExpression node) {
     AsExpression toNode = this._toNode as AsExpression;
-    if (_and(_isEqualNodes(node.expression, toNode.expression),
+    if (_and(
+        _isEqualNodes(node.expression, toNode.expression),
         _isEqualTokens(node.asOperator, toNode.asOperator),
         _isEqualNodes(node.type, toNode.type))) {
       toNode.propagatedType = node.propagatedType;
@@ -9403,7 +9734,8 @@
   @override
   bool visitAssertStatement(AssertStatement node) {
     AssertStatement toNode = this._toNode as AssertStatement;
-    return _and(_isEqualTokens(node.assertKeyword, toNode.assertKeyword),
+    return _and(
+        _isEqualTokens(node.assertKeyword, toNode.assertKeyword),
         _isEqualTokens(node.leftParenthesis, toNode.leftParenthesis),
         _isEqualNodes(node.condition, toNode.condition),
         _isEqualTokens(node.rightParenthesis, toNode.rightParenthesis),
@@ -9413,7 +9745,8 @@
   @override
   bool visitAssignmentExpression(AssignmentExpression node) {
     AssignmentExpression toNode = this._toNode as AssignmentExpression;
-    if (_and(_isEqualNodes(node.leftHandSide, toNode.leftHandSide),
+    if (_and(
+        _isEqualNodes(node.leftHandSide, toNode.leftHandSide),
         _isEqualTokens(node.operator, toNode.operator),
         _isEqualNodes(node.rightHandSide, toNode.rightHandSide))) {
       toNode.propagatedElement = node.propagatedElement;
@@ -9440,7 +9773,8 @@
   @override
   bool visitBinaryExpression(BinaryExpression node) {
     BinaryExpression toNode = this._toNode as BinaryExpression;
-    if (_and(_isEqualNodes(node.leftOperand, toNode.leftOperand),
+    if (_and(
+        _isEqualNodes(node.leftOperand, toNode.leftOperand),
         _isEqualTokens(node.operator, toNode.operator),
         _isEqualNodes(node.rightOperand, toNode.rightOperand))) {
       toNode.propagatedElement = node.propagatedElement;
@@ -9455,7 +9789,8 @@
   @override
   bool visitBlock(Block node) {
     Block toNode = this._toNode as Block;
-    return _and(_isEqualTokens(node.leftBracket, toNode.leftBracket),
+    return _and(
+        _isEqualTokens(node.leftBracket, toNode.leftBracket),
         _isEqualNodeLists(node.statements, toNode.statements),
         _isEqualTokens(node.rightBracket, toNode.rightBracket));
   }
@@ -9481,7 +9816,8 @@
   @override
   bool visitBreakStatement(BreakStatement node) {
     BreakStatement toNode = this._toNode as BreakStatement;
-    if (_and(_isEqualTokens(node.breakKeyword, toNode.breakKeyword),
+    if (_and(
+        _isEqualTokens(node.breakKeyword, toNode.breakKeyword),
         _isEqualNodes(node.label, toNode.label),
         _isEqualTokens(node.semicolon, toNode.semicolon))) {
       // TODO(paulberry): map node.target to toNode.target.
@@ -9505,7 +9841,8 @@
   @override
   bool visitCatchClause(CatchClause node) {
     CatchClause toNode = this._toNode as CatchClause;
-    return _and(_isEqualTokens(node.onKeyword, toNode.onKeyword),
+    return _and(
+        _isEqualTokens(node.onKeyword, toNode.onKeyword),
         _isEqualNodes(node.exceptionType, toNode.exceptionType),
         _isEqualTokens(node.catchKeyword, toNode.catchKeyword),
         _isEqualTokens(node.leftParenthesis, toNode.leftParenthesis),
@@ -9567,7 +9904,8 @@
   @override
   bool visitCompilationUnit(CompilationUnit node) {
     CompilationUnit toNode = this._toNode as CompilationUnit;
-    if (_and(_isEqualTokens(node.beginToken, toNode.beginToken),
+    if (_and(
+        _isEqualTokens(node.beginToken, toNode.beginToken),
         _isEqualNodes(node.scriptTag, toNode.scriptTag),
         _isEqualNodeLists(node.directives, toNode.directives),
         _isEqualNodeLists(node.declarations, toNode.declarations),
@@ -9581,7 +9919,8 @@
   @override
   bool visitConditionalExpression(ConditionalExpression node) {
     ConditionalExpression toNode = this._toNode as ConditionalExpression;
-    if (_and(_isEqualNodes(node.condition, toNode.condition),
+    if (_and(
+        _isEqualNodes(node.condition, toNode.condition),
         _isEqualTokens(node.question, toNode.question),
         _isEqualNodes(node.thenExpression, toNode.thenExpression),
         _isEqualTokens(node.colon, toNode.colon),
@@ -9620,7 +9959,8 @@
   bool visitConstructorFieldInitializer(ConstructorFieldInitializer node) {
     ConstructorFieldInitializer toNode =
         this._toNode as ConstructorFieldInitializer;
-    return _and(_isEqualTokens(node.thisKeyword, toNode.thisKeyword),
+    return _and(
+        _isEqualTokens(node.thisKeyword, toNode.thisKeyword),
         _isEqualTokens(node.period, toNode.period),
         _isEqualNodes(node.fieldName, toNode.fieldName),
         _isEqualTokens(node.equals, toNode.equals),
@@ -9630,7 +9970,8 @@
   @override
   bool visitConstructorName(ConstructorName node) {
     ConstructorName toNode = this._toNode as ConstructorName;
-    if (_and(_isEqualNodes(node.type, toNode.type),
+    if (_and(
+        _isEqualNodes(node.type, toNode.type),
         _isEqualTokens(node.period, toNode.period),
         _isEqualNodes(node.name, toNode.name))) {
       toNode.staticElement = node.staticElement;
@@ -9642,7 +9983,8 @@
   @override
   bool visitContinueStatement(ContinueStatement node) {
     ContinueStatement toNode = this._toNode as ContinueStatement;
-    if (_and(_isEqualTokens(node.continueKeyword, toNode.continueKeyword),
+    if (_and(
+        _isEqualTokens(node.continueKeyword, toNode.continueKeyword),
         _isEqualNodes(node.label, toNode.label),
         _isEqualTokens(node.semicolon, toNode.semicolon))) {
       // TODO(paulberry): map node.target to toNode.target.
@@ -9665,7 +10007,8 @@
   @override
   bool visitDefaultFormalParameter(DefaultFormalParameter node) {
     DefaultFormalParameter toNode = this._toNode as DefaultFormalParameter;
-    return _and(_isEqualNodes(node.parameter, toNode.parameter),
+    return _and(
+        _isEqualNodes(node.parameter, toNode.parameter),
         node.kind == toNode.kind,
         _isEqualTokens(node.separator, toNode.separator),
         _isEqualNodes(node.defaultValue, toNode.defaultValue));
@@ -9674,7 +10017,8 @@
   @override
   bool visitDoStatement(DoStatement node) {
     DoStatement toNode = this._toNode as DoStatement;
-    return _and(_isEqualTokens(node.doKeyword, toNode.doKeyword),
+    return _and(
+        _isEqualTokens(node.doKeyword, toNode.doKeyword),
         _isEqualNodes(node.body, toNode.body),
         _isEqualTokens(node.whileKeyword, toNode.whileKeyword),
         _isEqualTokens(node.leftParenthesis, toNode.leftParenthesis),
@@ -9795,7 +10139,8 @@
   @override
   bool visitForEachStatement(ForEachStatement node) {
     ForEachStatement toNode = this._toNode as ForEachStatement;
-    return _and(_isEqualTokens(node.forKeyword, toNode.forKeyword),
+    return _and(
+        _isEqualTokens(node.forKeyword, toNode.forKeyword),
         _isEqualTokens(node.leftParenthesis, toNode.leftParenthesis),
         _isEqualNodes(node.loopVariable, toNode.loopVariable),
         _isEqualTokens(node.inKeyword, toNode.inKeyword),
@@ -9807,7 +10152,8 @@
   @override
   bool visitFormalParameterList(FormalParameterList node) {
     FormalParameterList toNode = this._toNode as FormalParameterList;
-    return _and(_isEqualTokens(node.leftParenthesis, toNode.leftParenthesis),
+    return _and(
+        _isEqualTokens(node.leftParenthesis, toNode.leftParenthesis),
         _isEqualNodeLists(node.parameters, toNode.parameters),
         _isEqualTokens(node.leftDelimiter, toNode.leftDelimiter),
         _isEqualTokens(node.rightDelimiter, toNode.rightDelimiter),
@@ -9817,7 +10163,8 @@
   @override
   bool visitForStatement(ForStatement node) {
     ForStatement toNode = this._toNode as ForStatement;
-    return _and(_isEqualTokens(node.forKeyword, toNode.forKeyword),
+    return _and(
+        _isEqualTokens(node.forKeyword, toNode.forKeyword),
         _isEqualTokens(node.leftParenthesis, toNode.leftParenthesis),
         _isEqualNodes(node.variables, toNode.variables),
         _isEqualNodes(node.initialization, toNode.initialization),
@@ -9913,7 +10260,8 @@
   @override
   bool visitIfStatement(IfStatement node) {
     IfStatement toNode = this._toNode as IfStatement;
-    return _and(_isEqualTokens(node.ifKeyword, toNode.ifKeyword),
+    return _and(
+        _isEqualTokens(node.ifKeyword, toNode.ifKeyword),
         _isEqualTokens(node.leftParenthesis, toNode.leftParenthesis),
         _isEqualNodes(node.condition, toNode.condition),
         _isEqualTokens(node.rightParenthesis, toNode.rightParenthesis),
@@ -9951,7 +10299,8 @@
   @override
   bool visitIndexExpression(IndexExpression node) {
     IndexExpression toNode = this._toNode as IndexExpression;
-    if (_and(_isEqualNodes(node.target, toNode.target),
+    if (_and(
+        _isEqualNodes(node.target, toNode.target),
         _isEqualTokens(node.leftBracket, toNode.leftBracket),
         _isEqualNodes(node.index, toNode.index),
         _isEqualTokens(node.rightBracket, toNode.rightBracket))) {
@@ -9969,7 +10318,8 @@
   bool visitInstanceCreationExpression(InstanceCreationExpression node) {
     InstanceCreationExpression toNode =
         this._toNode as InstanceCreationExpression;
-    if (_and(_isEqualTokens(node.keyword, toNode.keyword),
+    if (_and(
+        _isEqualTokens(node.keyword, toNode.keyword),
         _isEqualNodes(node.constructorName, toNode.constructorName),
         _isEqualNodes(node.argumentList, toNode.argumentList))) {
       toNode.propagatedType = node.propagatedType;
@@ -9995,7 +10345,8 @@
   @override
   bool visitInterpolationExpression(InterpolationExpression node) {
     InterpolationExpression toNode = this._toNode as InterpolationExpression;
-    return _and(_isEqualTokens(node.leftBracket, toNode.leftBracket),
+    return _and(
+        _isEqualTokens(node.leftBracket, toNode.leftBracket),
         _isEqualNodes(node.expression, toNode.expression),
         _isEqualTokens(node.rightBracket, toNode.rightBracket));
   }
@@ -10010,7 +10361,8 @@
   @override
   bool visitIsExpression(IsExpression node) {
     IsExpression toNode = this._toNode as IsExpression;
-    if (_and(_isEqualNodes(node.expression, toNode.expression),
+    if (_and(
+        _isEqualNodes(node.expression, toNode.expression),
         _isEqualTokens(node.isOperator, toNode.isOperator),
         _isEqualTokens(node.notOperator, toNode.notOperator),
         _isEqualNodes(node.type, toNode.type))) {
@@ -10064,7 +10416,8 @@
   @override
   bool visitListLiteral(ListLiteral node) {
     ListLiteral toNode = this._toNode as ListLiteral;
-    if (_and(_isEqualTokens(node.constKeyword, toNode.constKeyword),
+    if (_and(
+        _isEqualTokens(node.constKeyword, toNode.constKeyword),
         _isEqualNodes(node.typeArguments, toNode.typeArguments),
         _isEqualTokens(node.leftBracket, toNode.leftBracket),
         _isEqualNodeLists(node.elements, toNode.elements),
@@ -10079,7 +10432,8 @@
   @override
   bool visitMapLiteral(MapLiteral node) {
     MapLiteral toNode = this._toNode as MapLiteral;
-    if (_and(_isEqualTokens(node.constKeyword, toNode.constKeyword),
+    if (_and(
+        _isEqualTokens(node.constKeyword, toNode.constKeyword),
         _isEqualNodes(node.typeArguments, toNode.typeArguments),
         _isEqualTokens(node.leftBracket, toNode.leftBracket),
         _isEqualNodeLists(node.entries, toNode.entries),
@@ -10094,7 +10448,8 @@
   @override
   bool visitMapLiteralEntry(MapLiteralEntry node) {
     MapLiteralEntry toNode = this._toNode as MapLiteralEntry;
-    return _and(_isEqualNodes(node.key, toNode.key),
+    return _and(
+        _isEqualNodes(node.key, toNode.key),
         _isEqualTokens(node.separator, toNode.separator),
         _isEqualNodes(node.value, toNode.value));
   }
@@ -10118,7 +10473,8 @@
   @override
   bool visitMethodInvocation(MethodInvocation node) {
     MethodInvocation toNode = this._toNode as MethodInvocation;
-    if (_and(_isEqualNodes(node.target, toNode.target),
+    if (_and(
+        _isEqualNodes(node.target, toNode.target),
         _isEqualTokens(node.operator, toNode.operator),
         _isEqualNodes(node.methodName, toNode.methodName),
         _isEqualNodes(node.argumentList, toNode.argumentList))) {
@@ -10151,7 +10507,8 @@
   @override
   bool visitNativeFunctionBody(NativeFunctionBody node) {
     NativeFunctionBody toNode = this._toNode as NativeFunctionBody;
-    return _and(_isEqualTokens(node.nativeKeyword, toNode.nativeKeyword),
+    return _and(
+        _isEqualTokens(node.nativeKeyword, toNode.nativeKeyword),
         _isEqualNodes(node.stringLiteral, toNode.stringLiteral),
         _isEqualTokens(node.semicolon, toNode.semicolon));
   }
@@ -10170,7 +10527,8 @@
   @override
   bool visitParenthesizedExpression(ParenthesizedExpression node) {
     ParenthesizedExpression toNode = this._toNode as ParenthesizedExpression;
-    if (_and(_isEqualTokens(node.leftParenthesis, toNode.leftParenthesis),
+    if (_and(
+        _isEqualTokens(node.leftParenthesis, toNode.leftParenthesis),
         _isEqualNodes(node.expression, toNode.expression),
         _isEqualTokens(node.rightParenthesis, toNode.rightParenthesis))) {
       toNode.propagatedType = node.propagatedType;
@@ -10228,7 +10586,8 @@
   @override
   bool visitPrefixedIdentifier(PrefixedIdentifier node) {
     PrefixedIdentifier toNode = this._toNode as PrefixedIdentifier;
-    if (_and(_isEqualNodes(node.prefix, toNode.prefix),
+    if (_and(
+        _isEqualNodes(node.prefix, toNode.prefix),
         _isEqualTokens(node.period, toNode.period),
         _isEqualNodes(node.identifier, toNode.identifier))) {
       toNode.propagatedType = node.propagatedType;
@@ -10255,7 +10614,8 @@
   @override
   bool visitPropertyAccess(PropertyAccess node) {
     PropertyAccess toNode = this._toNode as PropertyAccess;
-    if (_and(_isEqualNodes(node.target, toNode.target),
+    if (_and(
+        _isEqualNodes(node.target, toNode.target),
         _isEqualTokens(node.operator, toNode.operator),
         _isEqualNodes(node.propertyName, toNode.propertyName))) {
       toNode.propagatedType = node.propagatedType;
@@ -10270,7 +10630,8 @@
       RedirectingConstructorInvocation node) {
     RedirectingConstructorInvocation toNode =
         this._toNode as RedirectingConstructorInvocation;
-    if (_and(_isEqualTokens(node.thisKeyword, toNode.thisKeyword),
+    if (_and(
+        _isEqualTokens(node.thisKeyword, toNode.thisKeyword),
         _isEqualTokens(node.period, toNode.period),
         _isEqualNodes(node.constructorName, toNode.constructorName),
         _isEqualNodes(node.argumentList, toNode.argumentList))) {
@@ -10294,7 +10655,8 @@
   @override
   bool visitReturnStatement(ReturnStatement node) {
     ReturnStatement toNode = this._toNode as ReturnStatement;
-    return _and(_isEqualTokens(node.returnKeyword, toNode.returnKeyword),
+    return _and(
+        _isEqualTokens(node.returnKeyword, toNode.returnKeyword),
         _isEqualNodes(node.expression, toNode.expression),
         _isEqualTokens(node.semicolon, toNode.semicolon));
   }
@@ -10364,7 +10726,8 @@
   bool visitSuperConstructorInvocation(SuperConstructorInvocation node) {
     SuperConstructorInvocation toNode =
         this._toNode as SuperConstructorInvocation;
-    if (_and(_isEqualTokens(node.superKeyword, toNode.superKeyword),
+    if (_and(
+        _isEqualTokens(node.superKeyword, toNode.superKeyword),
         _isEqualTokens(node.period, toNode.period),
         _isEqualNodes(node.constructorName, toNode.constructorName),
         _isEqualNodes(node.argumentList, toNode.argumentList))) {
@@ -10388,7 +10751,8 @@
   @override
   bool visitSwitchCase(SwitchCase node) {
     SwitchCase toNode = this._toNode as SwitchCase;
-    return _and(_isEqualNodeLists(node.labels, toNode.labels),
+    return _and(
+        _isEqualNodeLists(node.labels, toNode.labels),
         _isEqualTokens(node.keyword, toNode.keyword),
         _isEqualNodes(node.expression, toNode.expression),
         _isEqualTokens(node.colon, toNode.colon),
@@ -10398,7 +10762,8 @@
   @override
   bool visitSwitchDefault(SwitchDefault node) {
     SwitchDefault toNode = this._toNode as SwitchDefault;
-    return _and(_isEqualNodeLists(node.labels, toNode.labels),
+    return _and(
+        _isEqualNodeLists(node.labels, toNode.labels),
         _isEqualTokens(node.keyword, toNode.keyword),
         _isEqualTokens(node.colon, toNode.colon),
         _isEqualNodeLists(node.statements, toNode.statements));
@@ -10407,7 +10772,8 @@
   @override
   bool visitSwitchStatement(SwitchStatement node) {
     SwitchStatement toNode = this._toNode as SwitchStatement;
-    return _and(_isEqualTokens(node.switchKeyword, toNode.switchKeyword),
+    return _and(
+        _isEqualTokens(node.switchKeyword, toNode.switchKeyword),
         _isEqualTokens(node.leftParenthesis, toNode.leftParenthesis),
         _isEqualNodes(node.expression, toNode.expression),
         _isEqualTokens(node.rightParenthesis, toNode.rightParenthesis),
@@ -10465,7 +10831,8 @@
   @override
   bool visitTryStatement(TryStatement node) {
     TryStatement toNode = this._toNode as TryStatement;
-    return _and(_isEqualTokens(node.tryKeyword, toNode.tryKeyword),
+    return _and(
+        _isEqualTokens(node.tryKeyword, toNode.tryKeyword),
         _isEqualNodes(node.body, toNode.body),
         _isEqualNodeLists(node.catchClauses, toNode.catchClauses),
         _isEqualTokens(node.finallyKeyword, toNode.finallyKeyword),
@@ -10475,7 +10842,8 @@
   @override
   bool visitTypeArgumentList(TypeArgumentList node) {
     TypeArgumentList toNode = this._toNode as TypeArgumentList;
-    return _and(_isEqualTokens(node.leftBracket, toNode.leftBracket),
+    return _and(
+        _isEqualTokens(node.leftBracket, toNode.leftBracket),
         _isEqualNodeLists(node.arguments, toNode.arguments),
         _isEqualTokens(node.rightBracket, toNode.rightBracket));
   }
@@ -10505,7 +10873,8 @@
   @override
   bool visitTypeParameterList(TypeParameterList node) {
     TypeParameterList toNode = this._toNode as TypeParameterList;
-    return _and(_isEqualTokens(node.leftBracket, toNode.leftBracket),
+    return _and(
+        _isEqualTokens(node.leftBracket, toNode.leftBracket),
         _isEqualNodeLists(node.typeParameters, toNode.typeParameters),
         _isEqualTokens(node.rightBracket, toNode.rightBracket));
   }
@@ -10543,7 +10912,8 @@
   @override
   bool visitWhileStatement(WhileStatement node) {
     WhileStatement toNode = this._toNode as WhileStatement;
-    return _and(_isEqualTokens(node.whileKeyword, toNode.whileKeyword),
+    return _and(
+        _isEqualTokens(node.whileKeyword, toNode.whileKeyword),
         _isEqualTokens(node.leftParenthesis, toNode.leftParenthesis),
         _isEqualNodes(node.condition, toNode.condition),
         _isEqualTokens(node.rightParenthesis, toNode.rightParenthesis),
@@ -10560,7 +10930,8 @@
   @override
   bool visitYieldStatement(YieldStatement node) {
     YieldStatement toNode = this._toNode as YieldStatement;
-    return _and(_isEqualTokens(node.yieldKeyword, toNode.yieldKeyword),
+    return _and(
+        _isEqualTokens(node.yieldKeyword, toNode.yieldKeyword),
         _isEqualNodes(node.expression, toNode.expression),
         _isEqualTokens(node.semicolon, toNode.semicolon));
   }
@@ -10568,9 +10939,18 @@
   /**
    * Return `true` if all of the parameters are `true`.
    */
-  bool _and(bool b1, bool b2, [bool b3 = true, bool b4 = true, bool b5 = true,
-      bool b6 = true, bool b7 = true, bool b8 = true, bool b9 = true,
-      bool b10 = true, bool b11 = true, bool b12 = true, bool b13 = true]) {
+  bool _and(bool b1, bool b2,
+      [bool b3 = true,
+      bool b4 = true,
+      bool b5 = true,
+      bool b6 = true,
+      bool b7 = true,
+      bool b8 = true,
+      bool b9 = true,
+      bool b10 = true,
+      bool b11 = true,
+      bool b12 = true,
+      bool b13 = true]) {
     // TODO(brianwilkerson) Inline this method.
     return b1 &&
         b2 &&
diff --git a/pkg/analyzer/lib/src/generated/resolver.dart b/pkg/analyzer/lib/src/generated/resolver.dart
index 6792538..40a2162 100644
--- a/pkg/analyzer/lib/src/generated/resolver.dart
+++ b/pkg/analyzer/lib/src/generated/resolver.dart
@@ -44,6 +44,10 @@
 
 typedef void VoidFunction();
 
+typedef bool _GuardedSubtypeChecker<T>(T t1, T t2, Set<Element> visited);
+
+typedef bool _SubtypeChecker<T>(T t1, T t2);
+
 /**
  * Instances of the class `BestPracticesVerifier` traverse an AST structure looking for
  * violations of Dart best practices.
@@ -73,12 +77,19 @@
   final InterfaceType _futureNullType;
 
   /**
+   * The type system primitives
+   */
+  TypeSystem _typeSystem;
+
+  /**
    * Create a new instance of the [BestPracticesVerifier].
    *
    * @param errorReporter the error reporter
    */
-  BestPracticesVerifier(this._errorReporter, TypeProvider typeProvider)
-      : _futureNullType = typeProvider.futureNullType;
+  BestPracticesVerifier(this._errorReporter, TypeProvider typeProvider,
+      {TypeSystem typeSystem})
+      : _futureNullType = typeProvider.futureNullType,
+        _typeSystem = (typeSystem != null) ? typeSystem : new TypeSystemImpl();
 
   @override
   Object visitArgumentList(ArgumentList node) {
@@ -304,7 +315,7 @@
     // Warning case: test static type information
     //
     if (actualStaticType != null && expectedStaticType != null) {
-      if (!actualStaticType.isAssignableTo(expectedStaticType)) {
+      if (!_typeSystem.isAssignableTo(actualStaticType, expectedStaticType)) {
         // A warning was created in the ErrorVerifier, return false, don't
         // create a hint when a warning has already been created.
         return false;
@@ -320,7 +331,7 @@
     DartType actualBestType =
         actualPropagatedType != null ? actualPropagatedType : actualStaticType;
     if (actualBestType != null && expectedBestType != null) {
-      if (!actualBestType.isAssignableTo(expectedBestType)) {
+      if (!_typeSystem.isAssignableTo(actualBestType, expectedBestType)) {
         _errorReporter.reportTypeErrorForNode(
             hintCode, expression, [actualBestType, expectedBestType]);
         return true;
@@ -519,14 +530,14 @@
         ? ErrorVerifier.getStaticType(lhs)
         : leftVariableElement.type;
     DartType staticRightType = ErrorVerifier.getStaticType(rhs);
-    if (!staticRightType.isAssignableTo(leftType)) {
+    if (!_typeSystem.isAssignableTo(staticRightType, leftType)) {
       // The warning was generated on this rhs
       return false;
     }
     // Test for, and then generate the hint
     DartType bestRightType = rhs.bestType;
     if (leftType != null && bestRightType != null) {
-      if (!bestRightType.isAssignableTo(leftType)) {
+      if (!_typeSystem.isAssignableTo(bestRightType, leftType)) {
         _errorReporter.reportTypeErrorForNode(
             HintCode.INVALID_ASSIGNMENT, rhs, [bestRightType, leftType]);
         return true;
@@ -593,7 +604,8 @@
     }
     // For async, give no hint if Future<Null> is assignable to the return
     // type.
-    if (body.isAsynchronous && _futureNullType.isAssignableTo(returnTypeType)) {
+    if (body.isAsynchronous &&
+        _typeSystem.isAssignableTo(_futureNullType, returnTypeType)) {
       return false;
     }
     // Check the block for a return statement, if not, create the hint
@@ -755,14 +767,14 @@
         return new AnalysisError(
             duplicate.source,
             duplicate.nameOffset,
-            duplicate.displayName.length,
+            duplicate.nameLength,
             CompileTimeErrorCode.METHOD_AND_GETTER_WITH_SAME_NAME,
             [existing.displayName]);
       } else {
         return new AnalysisError(
             existing.source,
             existing.nameOffset,
-            existing.displayName.length,
+            existing.nameLength,
             CompileTimeErrorCode.GETTER_AND_METHOD_WITH_SAME_NAME,
             [existing.displayName]);
       }
@@ -839,6 +851,11 @@
   final TypeProvider _typeProvider;
 
   /**
+   * The type system in use.
+   */
+  final TypeSystem _typeSystem;
+
+  /**
    * The set of variables declared using '-D' on the command line.
    */
   final DeclaredVariables declaredVariables;
@@ -873,8 +890,10 @@
    *
    * @param errorReporter the error reporter by which errors will be reported
    */
-  ConstantVerifier(this._errorReporter, this._currentLibrary,
-      this._typeProvider, this.declaredVariables) {
+  ConstantVerifier(this._errorReporter, LibraryElement currentLibrary,
+      this._typeProvider, this.declaredVariables)
+      : _currentLibrary = currentLibrary,
+        _typeSystem = currentLibrary.context.typeSystem {
     this._boolType = _typeProvider.boolType;
     this._intType = _typeProvider.intType;
     this._numType = _typeProvider.numType;
@@ -932,7 +951,8 @@
       ConstructorElement constructor = node.staticElement;
       if (constructor != null) {
         ConstantEvaluationEngine evaluationEngine =
-            new ConstantEvaluationEngine(_typeProvider, declaredVariables);
+            new ConstantEvaluationEngine(_typeProvider, declaredVariables,
+                typeSystem: _typeSystem);
         ConstantVisitor constantVisitor =
             new ConstantVisitor(evaluationEngine, _errorReporter);
         evaluationEngine.evaluateConstructorCall(
@@ -1006,7 +1026,8 @@
         ErrorReporter subErrorReporter =
             new ErrorReporter(errorListener, _errorReporter.source);
         DartObjectImpl result = key.accept(new ConstantVisitor(
-            new ConstantEvaluationEngine(_typeProvider, declaredVariables),
+            new ConstantEvaluationEngine(_typeProvider, declaredVariables,
+                typeSystem: _typeSystem),
             subErrorReporter));
         if (result != null) {
           if (keys.contains(result)) {
@@ -1212,7 +1233,8 @@
     ErrorReporter subErrorReporter =
         new ErrorReporter(errorListener, _errorReporter.source);
     DartObjectImpl result = expression.accept(new ConstantVisitor(
-        new ConstantEvaluationEngine(_typeProvider, declaredVariables),
+        new ConstantEvaluationEngine(_typeProvider, declaredVariables,
+            typeSystem: _typeSystem),
         subErrorReporter));
     _reportErrors(errorListener.errors, errorCode);
     return result;
@@ -1320,8 +1342,8 @@
               ErrorReporter subErrorReporter =
                   new ErrorReporter(errorListener, _errorReporter.source);
               DartObjectImpl result = initializer.accept(new ConstantVisitor(
-                  new ConstantEvaluationEngine(
-                      _typeProvider, declaredVariables),
+                  new ConstantEvaluationEngine(_typeProvider, declaredVariables,
+                      typeSystem: _typeSystem),
                   subErrorReporter));
               if (result == null) {
                 _errorReporter.reportErrorForNode(
@@ -1350,7 +1372,8 @@
         new ErrorReporter(errorListener, _errorReporter.source);
     DartObjectImpl result = expression.accept(
         new _ConstantVerifier_validateInitializerExpression(_typeProvider,
-            subErrorReporter, this, parameterElements, declaredVariables));
+            subErrorReporter, this, parameterElements, declaredVariables,
+            typeSystem: _typeSystem));
     _reportErrors(errorListener.errors,
         CompileTimeErrorCode.NON_CONSTANT_VALUE_IN_INITIALIZER);
     if (result != null) {
@@ -1475,11 +1498,18 @@
   final ErrorReporter _errorReporter;
 
   /**
+   *  The type system for this visitor
+   */
+  final TypeSystem _typeSystem;
+
+  /**
    * Create a new instance of the [DeadCodeVerifier].
    *
    * @param errorReporter the error reporter
    */
-  DeadCodeVerifier(this._errorReporter);
+  DeadCodeVerifier(this._errorReporter, {TypeSystem typeSystem})
+      : this._typeSystem =
+            (typeSystem != null) ? typeSystem : new TypeSystemImpl();
 
   @override
   Object visitBinaryExpression(BinaryExpression node) {
@@ -1491,14 +1521,14 @@
       if (!_isDebugConstant(lhsCondition)) {
         EvaluationResultImpl lhsResult = _getConstantBooleanValue(lhsCondition);
         if (lhsResult != null) {
-          if (lhsResult.value.isTrue && isBarBar) {
+          if (lhsResult.value.toBoolValue() == true && isBarBar) {
             // report error on else block: true || !e!
             _errorReporter.reportErrorForNode(
                 HintCode.DEAD_CODE, node.rightOperand);
             // only visit the LHS:
             _safelyVisit(lhsCondition);
             return null;
-          } else if (lhsResult.value.isFalse && isAmpAmp) {
+          } else if (lhsResult.value.toBoolValue() == false && isAmpAmp) {
             // report error on if block: false && !e!
             _errorReporter.reportErrorForNode(
                 HintCode.DEAD_CODE, node.rightOperand);
@@ -1552,7 +1582,7 @@
       EvaluationResultImpl result =
           _getConstantBooleanValue(conditionExpression);
       if (result != null) {
-        if (result.value.isTrue) {
+        if (result.value.toBoolValue() == true) {
           // report error on else block: true ? 1 : !2!
           _errorReporter.reportErrorForNode(
               HintCode.DEAD_CODE, node.elseExpression);
@@ -1578,7 +1608,7 @@
       EvaluationResultImpl result =
           _getConstantBooleanValue(conditionExpression);
       if (result != null) {
-        if (result.value.isTrue) {
+        if (result.value.toBoolValue() == true) {
           // report error on else block: if(true) {} else {!}
           Statement elseStatement = node.elseStatement;
           if (elseStatement != null) {
@@ -1644,7 +1674,7 @@
             }
           }
           for (DartType type in visitedTypes) {
-            if (currentType.isSubtypeOf(type)) {
+            if (_typeSystem.isSubtypeOf(currentType, type)) {
               CatchClause lastCatchClause = catchClauses[numOfCatchClauses - 1];
               int offset = catchClause.offset;
               int length = lastCatchClause.end - offset;
@@ -1687,7 +1717,7 @@
       EvaluationResultImpl result =
           _getConstantBooleanValue(conditionExpression);
       if (result != null) {
-        if (result.value.isFalse) {
+        if (result.value.toBoolValue() == false) {
           // report error on if block: while (false) {!}
           _errorReporter.reportErrorForNode(HintCode.DEAD_CODE, node.body);
           return null;
@@ -2431,6 +2461,9 @@
       // exception
       LocalVariableElementImpl exception =
           new LocalVariableElementImpl.forNode(exceptionParameter);
+      if (node.exceptionType == null) {
+        exception.hasImplicitType = true;
+      }
       _currentHolder.addLocalVariable(exception);
       exceptionParameter.staticElement = exception;
       // stack trace
@@ -2482,6 +2515,7 @@
       //
       constructors = _createDefaultConstructors(interfaceType);
     }
+    _setDocRange(element, node);
     element.abstract = node.isAbstract;
     element.accessors = holder.accessors;
     element.constructors = constructors;
@@ -2555,6 +2589,7 @@
     SimpleIdentifier constructorName = node.name;
     ConstructorElementImpl element =
         new ConstructorElementImpl.forNode(constructorName);
+    _setDocRange(element, node);
     if (node.externalKeyword != null) {
       element.external = true;
     }
@@ -2600,6 +2635,9 @@
     element.setVisibleRange(declarationEnd, statementEnd - declarationEnd - 1);
     element.const3 = node.isConst;
     element.final2 = node.isFinal;
+    if (node.type == null) {
+      element.hasImplicitType = true;
+    }
     _currentHolder.addLocalVariable(element);
     variableName.staticElement = element;
     return super.visitDeclaredIdentifier(node);
@@ -2640,6 +2678,10 @@
     }
     // visible range
     _setParameterVisibleRange(node, parameter);
+    if (normalParameter is SimpleFormalParameter &&
+        normalParameter.type == null) {
+      parameter.hasImplicitType = true;
+    }
     _currentHolder.addParameter(parameter);
     parameterName.staticElement = parameter;
     normalParameter.accept(this);
@@ -2652,6 +2694,7 @@
     SimpleIdentifier enumName = node.name;
     ClassElementImpl enumElement = new ClassElementImpl.forNode(enumName);
     enumElement.enum2 = true;
+    _setDocRange(enumElement, node);
     InterfaceTypeImpl enumType = new InterfaceTypeImpl(enumElement);
     enumElement.type = enumType;
     // The equivalent code for enums in the spec shows a single constructor,
@@ -2724,6 +2767,7 @@
         SimpleIdentifier functionName = node.name;
         FunctionElementImpl element =
             new FunctionElementImpl.forNode(functionName);
+        _setDocRange(element, node);
         if (node.externalKeyword != null) {
           element.external = true;
         }
@@ -2746,6 +2790,9 @@
             element.setVisibleRange(functionEnd, blockEnd - functionEnd - 1);
           }
         }
+        if (node.returnType == null) {
+          element.hasImplicitReturnType = true;
+        }
         _currentHolder.addFunction(element);
         expression.element = element;
         functionName.staticElement = element;
@@ -2767,6 +2814,7 @@
         if (node.isGetter) {
           PropertyAccessorElementImpl getter =
               new PropertyAccessorElementImpl.forNode(propertyNameNode);
+          _setDocRange(getter, node);
           if (node.externalKeyword != null) {
             getter.external = true;
           }
@@ -2783,12 +2831,16 @@
           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);
+          _setDocRange(setter, node);
           if (node.externalKeyword != null) {
             setter.external = true;
           }
@@ -2859,6 +2911,7 @@
       _functionTypesToFix.add(type);
     }
     element.type = type;
+    element.hasImplicitReturnType = true;
     _currentHolder.addFunction(element);
     node.element = element;
     holder.validate();
@@ -2874,6 +2927,7 @@
     List<TypeParameterElement> typeParameters = holder.typeParameters;
     FunctionTypeAliasElementImpl element =
         new FunctionTypeAliasElementImpl.forNode(aliasName);
+    _setDocRange(element, node);
     element.parameters = parameters;
     element.typeParameters = typeParameters;
     FunctionTypeImpl type = new FunctionTypeImpl.forTypedef(element);
@@ -2945,6 +2999,7 @@
         }
         MethodElementImpl element =
             new MethodElementImpl(nameOfMethod, methodName.offset);
+        _setDocRange(element, node);
         element.abstract = node.isAbstract;
         if (node.externalKeyword != null) {
           element.external = true;
@@ -2961,6 +3016,9 @@
         if (body.isGenerator) {
           element.generator = true;
         }
+        if (node.returnType == null) {
+          element.hasImplicitReturnType = true;
+        }
         _currentHolder.addMethod(element);
         methodName.staticElement = element;
       } else {
@@ -2978,6 +3036,7 @@
         if (node.isGetter) {
           PropertyAccessorElementImpl getter =
               new PropertyAccessorElementImpl.forNode(propertyNameNode);
+          _setDocRange(getter, node);
           if (node.externalKeyword != null) {
             getter.external = true;
           }
@@ -2995,11 +3054,15 @@
           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);
+          _setDocRange(setter, node);
           if (node.externalKeyword != null) {
             setter.external = true;
           }
@@ -3071,6 +3134,9 @@
       parameter.final2 = node.isFinal;
       parameter.parameterKind = node.kind;
       _setParameterVisibleRange(node, parameter);
+      if (node.type == null) {
+        parameter.hasImplicitType = true;
+      }
       _currentHolder.addParameter(parameter);
       parameterName.staticElement = parameter;
     }
@@ -3133,6 +3199,12 @@
         field = new FieldElementImpl.forNode(fieldName);
       }
       element = field;
+      if (node.parent.parent is FieldDeclaration) {
+        _setDocRange(element, node.parent.parent);
+      }
+      if ((node.parent as VariableDeclarationList).type == null) {
+        field.hasImplicitType = true;
+      }
       _currentHolder.addField(field);
       fieldName.staticElement = field;
     } else if (_inFunction) {
@@ -3148,6 +3220,9 @@
       // TODO(brianwilkerson) This isn't right for variables declared in a for
       // loop.
       variable.setVisibleRange(enclosingBlock.offset, enclosingBlock.length);
+      if ((node.parent as VariableDeclarationList).type == null) {
+        variable.hasImplicitType = true;
+      }
       _currentHolder.addLocalVariable(variable);
       variableName.staticElement = element;
     } else {
@@ -3159,6 +3234,12 @@
         variable = new TopLevelVariableElementImpl.forNode(variableName);
       }
       element = variable;
+      if (node.parent.parent is TopLevelVariableDeclaration) {
+        _setDocRange(element, node.parent.parent);
+      }
+      if ((node.parent as VariableDeclarationList).type == null) {
+        variable.hasImplicitType = true;
+      }
       _currentHolder.addTopLevelVariable(variable);
       variableName.staticElement = element;
     }
@@ -3190,6 +3271,9 @@
       PropertyAccessorElementImpl getter =
           new PropertyAccessorElementImpl.forVariable(element);
       getter.getter = true;
+      if (element.hasImplicitType) {
+        getter.hasImplicitReturnType = true;
+      }
       _currentHolder.addAccessor(getter);
       element.getter = getter;
       if (!isConst && !isFinal) {
@@ -3286,6 +3370,17 @@
   }
 
   /**
+   * If the given [node] has a documentation comment, remember its range
+   * into the given [element].
+   */
+  void _setDocRange(ElementImpl element, AnnotatedNode node) {
+    Comment comment = node.documentationComment;
+    if (comment != null && comment.isDocumentation) {
+      element.setDocRange(comment.offset, comment.length);
+    }
+  }
+
+  /**
    * Sets the visible source range for formal parameter.
    */
   void _setParameterVisibleRange(
@@ -3892,11 +3987,23 @@
   bool visitAsExpression(AsExpression node) => _nodeExits(node.expression);
 
   @override
-  bool visitAssertStatement(AssertStatement node) => _nodeExits(node.condition);
+  bool visitAssertStatement(AssertStatement node) => false;
 
   @override
-  bool visitAssignmentExpression(AssignmentExpression node) =>
-      _nodeExits(node.leftHandSide) || _nodeExits(node.rightHandSide);
+  bool visitAssignmentExpression(AssignmentExpression node) {
+    Expression leftHandSide = node.leftHandSide;
+    if (_nodeExits(leftHandSide)) {
+      return true;
+    }
+    if (node.operator.type == sc.TokenType.QUESTION_QUESTION_EQ) {
+      return false;
+    }
+    if (leftHandSide is PropertyAccess &&
+        leftHandSide.operator.type == sc.TokenType.QUESTION_PERIOD) {
+      return false;
+    }
+    return _nodeExits(node.rightHandSide);
+  }
 
   @override
   bool visitAwaitExpression(AwaitExpression node) =>
@@ -3905,9 +4012,10 @@
   @override
   bool visitBinaryExpression(BinaryExpression node) {
     Expression lhsExpression = node.leftOperand;
+    Expression rhsExpression = node.rightOperand;
     sc.TokenType operatorType = node.operator.type;
-    // If the operator is || and the left hand side is false literal, don't
-    // consider the RHS of the binary expression.
+    // If the operator is ||, then only consider the RHS of the binary
+    // expression if the left hand side is the false literal.
     // TODO(jwren) Do we want to take constant expressions into account,
     // evaluate if(false) {} differently than if(<condition>), when <condition>
     // evaluates to a constant false value?
@@ -3915,21 +4023,27 @@
       if (lhsExpression is BooleanLiteral) {
         BooleanLiteral booleanLiteral = lhsExpression;
         if (!booleanLiteral.value) {
-          return false;
+          return _nodeExits(rhsExpression);
         }
       }
+      return _nodeExits(lhsExpression);
     }
-    // If the operator is && and the left hand side is true literal, don't
-    // consider the RHS of the binary expression.
+    // If the operator is &&, then only consider the RHS of the binary
+    // expression if the left hand side is the true literal.
     if (operatorType == sc.TokenType.AMPERSAND_AMPERSAND) {
       if (lhsExpression is BooleanLiteral) {
         BooleanLiteral booleanLiteral = lhsExpression;
         if (booleanLiteral.value) {
-          return false;
+          return _nodeExits(rhsExpression);
         }
       }
+      return _nodeExits(lhsExpression);
     }
-    Expression rhsExpression = node.rightOperand;
+    // If the operator is ??, then don't consider the RHS of the binary
+    // expression.
+    if (operatorType == sc.TokenType.QUESTION_QUESTION) {
+      return _nodeExits(lhsExpression);
+    }
     return _nodeExits(lhsExpression) || _nodeExits(rhsExpression);
   }
 
@@ -4124,8 +4238,13 @@
   @override
   bool visitMethodInvocation(MethodInvocation node) {
     Expression target = node.realTarget;
-    if (target != null && target.accept(this)) {
-      return true;
+    if (target != null) {
+      if (target.accept(this)) {
+        return true;
+      }
+      if (node.operator.type == sc.TokenType.QUESTION_PERIOD) {
+        return false;
+      }
     }
     return _nodeExits(node.argumentList);
   }
@@ -4737,15 +4856,16 @@
     ErrorReporter errorReporter = new ErrorReporter(_errorListener, source);
     unit.accept(_usedImportedElementsVisitor);
     // dead code analysis
-    unit.accept(new DeadCodeVerifier(errorReporter));
+    unit.accept(
+        new DeadCodeVerifier(errorReporter, typeSystem: _context.typeSystem));
     unit.accept(_usedLocalElementsVisitor);
     // dart2js analysis
     if (_enableDart2JSHints) {
       unit.accept(new Dart2JSVerifier(errorReporter));
     }
     // Dart best practices
-    unit.accept(
-        new BestPracticesVerifier(errorReporter, _context.typeProvider));
+    unit.accept(new BestPracticesVerifier(errorReporter, _context.typeProvider,
+        typeSystem: _context.typeSystem));
     unit.accept(new OverrideVerifier(errorReporter, _manager));
     // Find to-do comments
     new ToDoFinder(errorReporter).findIn(unit);
@@ -6206,11 +6326,13 @@
               continue;
             }
             bool subtypeOfAllTypes = true;
+            TypeSystem typeSystem = _library.context.typeSystem;
             for (int j = 0;
                 j < numOfEltsWithMatchingNames && subtypeOfAllTypes;
                 j++) {
               if (i != j) {
-                if (!subtype.isSubtypeOf(executableElementTypes[j])) {
+                if (!typeSystem.isSubtypeOf(
+                    subtype, executableElementTypes[j])) {
                   subtypeOfAllTypes = false;
                   break;
                 }
@@ -6264,7 +6386,7 @@
                 _reportError(
                     classElt,
                     classElt.nameOffset,
-                    classElt.displayName.length,
+                    classElt.nameLength,
                     StaticTypeWarningCode.INCONSISTENT_METHOD_INHERITANCE,
                     [key, firstTwoFuntionTypesStr]);
               }
@@ -6293,7 +6415,7 @@
           _reportError(
               classElt,
               classElt.nameOffset,
-              classElt.displayName.length,
+              classElt.nameLength,
               StaticWarningCode.INCONSISTENT_METHOD_INHERITANCE_GETTER_AND_METHOD,
               [key]);
         }
@@ -6969,6 +7091,7 @@
         .buildCompilationUnit(
             librarySource, definingCompilationUnit, librarySource);
     NodeList<Directive> directives = definingCompilationUnit.directives;
+    LibraryDirective libraryDirective = null;
     LibraryIdentifier libraryNameNode = null;
     bool hasPartDirective = false;
     FunctionElement entryPoint =
@@ -6986,6 +7109,7 @@
       //
       if (directive is LibraryDirective) {
         if (libraryNameNode == null) {
+          libraryDirective = directive;
           libraryNameNode = directive.name;
           directivesToResolve.add(directive);
         }
@@ -7044,6 +7168,7 @@
     //
     LibraryElementImpl libraryElement = new LibraryElementImpl.forNode(
         _analysisContext.getContextFor(librarySource), libraryNameNode);
+    _setDocRange(libraryElement, libraryDirective);
     libraryElement.definingCompilationUnit = definingCompilationUnitElement;
     if (entryPoint != null) {
       libraryElement.entryPoint = entryPoint;
@@ -7075,6 +7200,7 @@
         .buildCompilationUnit(
             librarySource, definingCompilationUnit, librarySource);
     NodeList<Directive> directives = definingCompilationUnit.directives;
+    LibraryDirective libraryDirective = null;
     LibraryIdentifier libraryNameNode = null;
     bool hasPartDirective = false;
     FunctionElement entryPoint =
@@ -7092,6 +7218,7 @@
       //
       if (directive is LibraryDirective) {
         if (libraryNameNode == null) {
+          libraryDirective = directive;
           libraryNameNode = directive.name;
           directivesToResolve.add(directive);
         }
@@ -7152,6 +7279,7 @@
     //
     LibraryElementImpl libraryElement = new LibraryElementImpl.forNode(
         _analysisContext.getContextFor(librarySource), libraryNameNode);
+    _setDocRange(libraryElement, libraryDirective);
     libraryElement.definingCompilationUnit = definingCompilationUnitElement;
     if (entryPoint != null) {
       libraryElement.entryPoint = entryPoint;
@@ -7255,6 +7383,19 @@
       }
     }
   }
+
+  /**
+   * If the given [node] has a documentation comment, remember its range
+   * into the given [element].
+   */
+  void _setDocRange(ElementImpl element, LibraryDirective node) {
+    if (node != null) {
+      Comment comment = node.documentationComment;
+      if (comment != null && comment.isDocumentation) {
+        element.setDocRange(comment.offset, comment.length);
+      }
+    }
+  }
 }
 
 /**
@@ -7508,6 +7649,11 @@
   TypeProvider _typeProvider;
 
   /**
+   * The type system in use for the library
+   */
+  TypeSystem _typeSystem;
+
+  /**
    * A table mapping library sources to the information being maintained for those libraries.
    */
   HashMap<Source, Library> _libraryMap = new HashMap<Source, Library>();
@@ -7550,6 +7696,11 @@
   TypeProvider get typeProvider => _typeProvider;
 
   /**
+   * The type system in use.
+   */
+  TypeSystem get typeSystem => _typeSystem;
+
+  /**
    * Create an object to represent the information about the library defined by the compilation unit
    * with the given source.
    *
@@ -7634,6 +7785,7 @@
     }
     _buildDirectiveModels();
     _typeProvider = new TypeProviderImpl(coreElement, asyncElement);
+    _typeSystem = TypeSystem.create(analysisContext);
     _buildTypeHierarchies();
     //
     // Perform resolution and type analysis.
@@ -7712,6 +7864,7 @@
     }
     _buildDirectiveModels();
     _typeProvider = new TypeProviderImpl(coreElement, asyncElement);
+    _typeSystem = TypeSystem.create(analysisContext);
     _buildEnumMembers();
     _buildTypeHierarchies();
     //
@@ -8018,6 +8171,7 @@
               : typeResolverVisitorFactory(library, source, _typeProvider);
           library.getAST(source).accept(visitor);
         }
+        library.libraryElement.createLoadLibraryFunction(_typeProvider);
       }
     });
   }
@@ -8224,7 +8378,11 @@
   void _performConstantEvaluation() {
     PerformanceStatistics.resolve.makeCurrentWhile(() {
       ConstantValueComputer computer = new ConstantValueComputer(
-          analysisContext, _typeProvider, analysisContext.declaredVariables);
+          analysisContext,
+          _typeProvider,
+          analysisContext.declaredVariables,
+          null,
+          _typeSystem);
       for (Library library in _librariesInCycles) {
         for (Source source in library.compilationUnitSources) {
           try {
@@ -8357,6 +8515,11 @@
   TypeProvider _typeProvider;
 
   /**
+   * The type system in use for the library
+   */
+  TypeSystem _typeSystem;
+
+  /**
    * A table mapping library sources to the information being maintained for those libraries.
    */
   HashMap<Source, ResolvableLibrary> _libraryMap =
@@ -8446,6 +8609,7 @@
     }
     _buildDirectiveModels();
     _typeProvider = new TypeProviderImpl(coreElement, asyncElement);
+    _typeSystem = TypeSystem.create(analysisContext);
     _buildEnumMembers();
     _buildTypeHierarchies();
     //
@@ -8694,6 +8858,7 @@
               nameScope: library.libraryScope);
           ast.accept(visitor);
         }
+        library.libraryElement.createLoadLibraryFunction(_typeProvider);
       }
     });
   }
@@ -8719,7 +8884,11 @@
   void _performConstantEvaluation() {
     PerformanceStatistics.resolve.makeCurrentWhile(() {
       ConstantValueComputer computer = new ConstantValueComputer(
-          analysisContext, _typeProvider, analysisContext.declaredVariables);
+          analysisContext,
+          _typeProvider,
+          analysisContext.declaredVariables,
+          null,
+          _typeSystem);
       for (ResolvableLibrary library in _librariesInCycle) {
         for (ResolvableCompilationUnit unit
             in library.resolvableCompilationUnits) {
@@ -8811,46 +8980,6 @@
 }
 
 /**
- * Instances of the class `TypeAliasInfo` hold information about a [TypeAlias].
- */
-class LibraryResolver2_TypeAliasInfo {
-  final ResolvableLibrary _library;
-
-  final Source _source;
-
-  final FunctionTypeAlias _typeAlias;
-
-  /**
-   * Initialize a newly created information holder with the given information.
-   *
-   * @param library the library containing the type alias
-   * @param source the source of the file containing the type alias
-   * @param typeAlias the type alias being remembered
-   */
-  LibraryResolver2_TypeAliasInfo(this._library, this._source, this._typeAlias);
-}
-
-/**
- * Instances of the class `TypeAliasInfo` hold information about a [TypeAlias].
- */
-class LibraryResolver_TypeAliasInfo {
-  final Library _library;
-
-  final Source _source;
-
-  final FunctionTypeAlias _typeAlias;
-
-  /**
-   * Initialize a newly created information holder with the given information.
-   *
-   * @param library the library containing the type alias
-   * @param source the source of the file containing the type alias
-   * @param typeAlias the type alias being remembered
-   */
-  LibraryResolver_TypeAliasInfo(this._library, this._source, this._typeAlias);
-}
-
-/**
  * Instances of the class `LibraryScope` implement a scope containing all of the names defined
  * in a given library.
  */
@@ -8882,7 +9011,7 @@
       return new AnalysisError(
           duplicate.source,
           offset,
-          duplicate.displayName.length,
+          duplicate.nameLength,
           CompileTimeErrorCode.PREFIX_COLLIDES_WITH_TOP_LEVEL_MEMBER,
           [existing.displayName]);
     }
@@ -9144,8 +9273,7 @@
    *
    * @return a table containing the same mappings as those defined by this namespace
    */
-  Map<String, Element> get definedNames =>
-      new HashMap<String, Element>.from(_definedNames);
+  Map<String, Element> get definedNames => _definedNames;
 
   /**
    * Return the element in this namespace that is available to the containing scope using the given
@@ -9295,7 +9423,7 @@
       List<NamespaceCombinator> combinators) {
     for (NamespaceCombinator combinator in combinators) {
       if (combinator is HideElementCombinator) {
-        _hide(definedNames, combinator.hiddenNames);
+        definedNames = _hide(definedNames, combinator.hiddenNames);
       } else if (combinator is ShowElementCombinator) {
         definedNames = _show(definedNames, combinator.shownNames);
       } else {
@@ -9374,24 +9502,22 @@
   }
 
   /**
-   * Hide all of the given names by removing them from the given collection of defined names.
-   *
-   * @param definedNames the names that were defined before this operation
-   * @param hiddenNames the names to be hidden
+   * Return a new map of names which has all the names from [definedNames]
+   * with exception of [hiddenNames].
    */
-  void _hide(HashMap<String, Element> definedNames, List<String> hiddenNames) {
+  Map<String, Element> _hide(
+      HashMap<String, Element> definedNames, List<String> hiddenNames) {
+    HashMap<String, Element> newNames =
+        new HashMap<String, Element>.from(definedNames);
     for (String name in hiddenNames) {
-      definedNames.remove(name);
-      definedNames.remove("$name=");
+      newNames.remove(name);
+      newNames.remove("$name=");
     }
+    return newNames;
   }
 
   /**
-   * Show only the given names by removing all other names from the given collection of defined
-   * names.
-   *
-   * @param definedNames the names that were defined before this operation
-   * @param shownNames the names to be shown
+   * Return a new map of names which has only [shownNames] from [definedNames].
    */
   HashMap<String, Element> _show(
       HashMap<String, Element> definedNames, List<String> shownNames) {
@@ -9485,6 +9611,155 @@
 }
 
 /**
+ * An AST visitor that is used to resolve the some of the nodes within a single
+ * compilation unit. The nodes that are skipped are those that are within
+ * function bodies.
+ */
+class PartialResolverVisitor extends ResolverVisitor {
+  /**
+   * A flag indicating whether the resolver is being run in strong mode.
+   */
+  final bool strongMode;
+
+  /**
+   * The static variables and fields that have an initializer. These are the
+   * variables that need to be re-resolved after static variables have their
+   * types inferred. A subset of these variables are those whose types should
+   * be inferred. The list will be empty unless the resolver is being run in
+   * strong mode.
+   */
+  final List<VariableElement> variablesAndFields = <VariableElement>[];
+
+  /**
+   * A flag indicating whether we should discard errors while resolving the
+   * initializer for variable declarations. We do this for top-level variables
+   * and fields because their initializer will be re-resolved at a later time.
+   */
+  bool discardErrorsInInitializer = false;
+
+  /**
+   * Initialize a newly created visitor to resolve the nodes in an AST node.
+   *
+   * The [definingLibrary] is the element for the library containing the node
+   * being visited. The [source] is the source representing the compilation unit
+   * containing the node being visited. The [typeProvider] is the object used to
+   * access the types from the core library. The [errorListener] is the error
+   * listener that will be informed of any errors that are found during
+   * resolution. The [nameScope] is the scope used to resolve identifiers in the
+   * node that will first be visited.  If `null` or unspecified, a new
+   * [LibraryScope] will be created based on [definingLibrary] and
+   * [typeProvider]. The [inheritanceManager] is used to perform inheritance
+   * lookups.  If `null` or unspecified, a new [InheritanceManager] will be
+   * created based on [definingLibrary]. The [typeAnalyzerFactory] is used to
+   * create the type analyzer.  If `null` or unspecified, a type analyzer of
+   * type [StaticTypeAnalyzer] will be created.
+   */
+  PartialResolverVisitor(LibraryElement definingLibrary, Source source,
+      TypeProvider typeProvider, AnalysisErrorListener errorListener,
+      {Scope nameScope,
+      InheritanceManager inheritanceManager,
+      StaticTypeAnalyzerFactory typeAnalyzerFactory})
+      : strongMode = definingLibrary.context.analysisOptions.strongMode,
+        super(definingLibrary, source, typeProvider,
+            new DisablableErrorListener(errorListener));
+
+  @override
+  Object visitBlockFunctionBody(BlockFunctionBody node) {
+    if (_shouldBeSkipped(node)) {
+      return null;
+    }
+    return super.visitBlockFunctionBody(node);
+  }
+
+  @override
+  Object visitExpressionFunctionBody(ExpressionFunctionBody node) {
+    if (_shouldBeSkipped(node)) {
+      return null;
+    }
+    return super.visitExpressionFunctionBody(node);
+  }
+
+  @override
+  Object visitFieldDeclaration(FieldDeclaration node) {
+    if (strongMode && node.isStatic) {
+      _addVariables(node.fields.variables);
+      bool wasDiscarding = discardErrorsInInitializer;
+      discardErrorsInInitializer = true;
+      try {
+        return super.visitFieldDeclaration(node);
+      } finally {
+        discardErrorsInInitializer = wasDiscarding;
+      }
+    }
+    return super.visitFieldDeclaration(node);
+  }
+
+  @override
+  Object visitNode(AstNode node) {
+    if (discardErrorsInInitializer) {
+      AstNode parent = node.parent;
+      if (parent is VariableDeclaration && parent.initializer == node) {
+        DisablableErrorListener listener = errorListener;
+        return listener.disableWhile(() => super.visitNode(node));
+      }
+    }
+    return super.visitNode(node);
+  }
+
+  @override
+  Object visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) {
+    if (strongMode) {
+      _addVariables(node.variables.variables);
+      bool wasDiscarding = discardErrorsInInitializer;
+      discardErrorsInInitializer = true;
+      try {
+        return super.visitTopLevelVariableDeclaration(node);
+      } finally {
+        discardErrorsInInitializer = wasDiscarding;
+      }
+    }
+    return super.visitTopLevelVariableDeclaration(node);
+  }
+
+  /**
+   * Add all of the [variables] with initializers to the list of variables whose
+   * type can be inferred. Technically, we only infer the types of variables
+   * that do not have a static type, but all variables with initializers
+   * potentially need to be re-resolved after inference because they might
+   * refer to a field whose type was inferred.
+   */
+  void _addVariables(NodeList<VariableDeclaration> variables) {
+    for (VariableDeclaration variable in variables) {
+      if (variable.initializer != null) {
+        variablesAndFields.add(variable.element);
+      }
+    }
+  }
+
+  /**
+   * Return `true` if the given function body should be skipped because it is
+   * the body of a top-level function, method or constructor.
+   */
+  bool _shouldBeSkipped(FunctionBody body) {
+    AstNode parent = body.parent;
+    if (parent is MethodDeclaration) {
+      return parent.body == body;
+    }
+    if (parent is ConstructorDeclaration) {
+      return parent.body == body;
+    }
+    if (parent is FunctionExpression) {
+      AstNode parent2 = parent.parent;
+      if (parent2 is FunctionDeclaration &&
+          parent2.parent is! FunctionDeclarationStatement) {
+        return parent.body == body;
+      }
+    }
+    return false;
+  }
+}
+
+/**
  * Instances of the class `PubVerifier` traverse an AST structure looking for deviations from
  * pub best practices.
  */
@@ -10017,6 +10292,11 @@
    */
   StaticTypeAnalyzer typeAnalyzer;
 
+  /*
+  * The type system in use during resolution.
+  */
+  TypeSystem typeSystem;
+
   /**
    * The class element representing the class containing the current node,
    * or `null` if the current node is not contained in a class.
@@ -10070,21 +10350,19 @@
   /**
    * Initialize a newly created visitor to resolve the nodes in an AST node.
    *
-   * [definingLibrary] is the element for the library containing the node being
-   * visited.
-   * [source] is the source representing the compilation unit containing the
-   * node being visited.
-   * [typeProvider] the object used to access the types from the core library.
-   * [errorListener] the error listener that will be informed of any errors
-   * that are found during resolution.
-   * [nameScope] is the scope used to resolve identifiers in the node that will
-   * first be visited.  If `null` or unspecified, a new [LibraryScope] will be
-   * created based on [definingLibrary] and [typeProvider].
-   * [inheritanceManager] is used to perform inheritance lookups.  If `null` or
-   * unspecified, a new [InheritanceManager] will be created based on
-   * [definingLibrary].
-   * [typeAnalyzerFactory] is used to create the type analyzer.  If `null` or
-   * unspecified, a type analyzer of type [StaticTypeAnalyzer] will be created.
+   * The [definingLibrary] is the element for the library containing the node
+   * being visited. The [source] is the source representing the compilation unit
+   * containing the node being visited. The [typeProvider] is the object used to
+   * access the types from the core library. The [errorListener] is the error
+   * listener that will be informed of any errors that are found during
+   * resolution. The [nameScope] is the scope used to resolve identifiers in the
+   * node that will first be visited.  If `null` or unspecified, a new
+   * [LibraryScope] will be created based on [definingLibrary] and
+   * [typeProvider]. The [inheritanceManager] is used to perform inheritance
+   * lookups.  If `null` or unspecified, a new [InheritanceManager] will be
+   * created based on [definingLibrary]. The [typeAnalyzerFactory] is used to
+   * create the type analyzer.  If `null` or unspecified, a type analyzer of
+   * type [StaticTypeAnalyzer] will be created.
    */
   ResolverVisitor(LibraryElement definingLibrary, Source source,
       TypeProvider typeProvider, AnalysisErrorListener errorListener,
@@ -10099,6 +10377,7 @@
       this._inheritanceManager = inheritanceManager;
     }
     this.elementResolver = new ElementResolver(this);
+    this.typeSystem = definingLibrary.context.typeSystem;
     if (typeAnalyzerFactory == null) {
       this.typeAnalyzer = new StaticTypeAnalyzer(this);
     } else {
@@ -10223,7 +10502,14 @@
   /**
    * Prepares this [ResolverVisitor] to using it for incremental resolution.
    */
-  void initForIncrementalResolution() {
+  void initForIncrementalResolution([Declaration declaration = null]) {
+    if (declaration != null) {
+      Element element = declaration.element;
+      if (element is ExecutableElement) {
+        _enclosingFunction = element;
+      }
+      _commentBeforeFunction = declaration.documentationComment;
+    }
     _overrideManager.enterScope();
   }
 
@@ -10267,6 +10553,14 @@
    */
   DartType overrideVariable(VariableElement element, DartType potentialType,
       bool allowPrecisionLoss) {
+    // TODO(scheglov) type propagation for instance/top-level fields
+    // was disabled because it depends on the order or visiting.
+    // If both field and its client are in the same unit, and we visit
+    // the client before the field, then propagated type is not set yet.
+    if (element is PropertyInducingElement) {
+      return null;
+    }
+
     if (potentialType == null || potentialType.isBottom) {
       return null;
     }
@@ -10299,18 +10593,6 @@
         allowPrecisionLoss ||
         !currentType.isMoreSpecificThan(potentialType) ||
         potentialType.isMoreSpecificThan(currentType)) {
-      // TODO(scheglov) type propagation for instance/top-level fields
-      // was disabled because it depends on the order or visiting.
-      // If both field and its client are in the same unit, and we visit
-      // the client before the field, then propagated type is not set yet.
-//      if (element is PropertyInducingElement) {
-//        PropertyInducingElement variable = element;
-//        if (!variable.isConst && !variable.isFinal) {
-//          return;
-//        }
-//        (variable as PropertyInducingElementImpl).propagatedType =
-//            potentialType;
-//      }
       _overrideManager.setType(element, potentialType);
       return potentialType;
     }
@@ -10318,6 +10600,15 @@
   }
 
   /**
+   * A client is about to resolve a member in the given class declaration.
+   */
+  void prepareToResolveMembersInClass(ClassDeclaration node) {
+    _enclosingClassDeclaration = node;
+    enclosingClass = node.element;
+    typeAnalyzer.thisType = enclosingClass == null ? null : enclosingClass.type;
+  }
+
+  /**
    * If the given [type] is valid, strongly more specific than the
    * existing static type of the given [expression], record it as a propagated
    * type of the given [expression]. Otherwise, reset it to `null`.
@@ -10668,6 +10959,11 @@
   @override
   Object visitDefaultFormalParameter(DefaultFormalParameter node) {
     super.visitDefaultFormalParameter(node);
+    ParameterElement element = node.element;
+    if (element.initializer != null && node.defaultValue != null) {
+      (element.initializer as FunctionElementImpl).returnType =
+          node.defaultValue.staticType;
+    }
     FormalParameterList parent = node.parent;
     AstNode grandparent = parent.parent;
     if (grandparent is ConstructorDeclaration &&
@@ -10714,9 +11010,21 @@
       ElementResolver.setMetadata(node.element, node);
     }
     //
-    // There is nothing else to do because everything else was resolved by the
-    // element builder.
+    // Continue the enum resolution.
     //
+    ClassElement outerType = enclosingClass;
+    try {
+      enclosingClass = node.element;
+      typeAnalyzer.thisType =
+          enclosingClass == null ? null : enclosingClass.type;
+      super.visitEnumDeclaration(node);
+      node.accept(elementResolver);
+      node.accept(typeAnalyzer);
+    } finally {
+      typeAnalyzer.thisType = outerType == null ? null : outerType.type;
+      enclosingClass = outerType;
+      _enclosingClassDeclaration = null;
+    }
     return null;
   }
 
@@ -10787,7 +11095,8 @@
             }
             if (propagatedType != null) {
               overrideVariable(loopElement, propagatedType, true);
-              _recordPropagatedType(loopVariable.identifier, propagatedType);
+              recordPropagatedTypeIfBetter(
+                  loopVariable.identifier, propagatedType);
             }
           }
         } else if (identifier != null && iterable != null) {
@@ -10795,7 +11104,7 @@
           if (identifierElement is VariableElement) {
             DartType iteratorElementType = _getIteratorElementType(iterable);
             overrideVariable(identifierElement, iteratorElementType, true);
-            _recordPropagatedType(identifier, iteratorElementType);
+            recordPropagatedTypeIfBetter(identifier, iteratorElementType);
           }
         }
         visitStatementInScope(body);
@@ -11093,6 +11402,10 @@
   Object visitVariableDeclaration(VariableDeclaration node) {
     super.visitVariableDeclaration(node);
     VariableElement element = node.element;
+    if (element.initializer != null && node.initializer != null) {
+      (element.initializer as FunctionElementImpl).returnType =
+          node.initializer.staticType;
+    }
     // Note: in addition to cloning the initializers for const variables, we
     // have to clone the initializers for non-static final fields (because if
     // they occur in a class with a const constructor, they will be needed to
@@ -11531,18 +11844,6 @@
       _propagateTrueState(condition.expression);
     }
   }
-
-  /**
-   * Record that the propagated type of the given node is the given type.
-   *
-   * @param expression the node whose type is to be recorded
-   * @param type the propagated type of the node
-   */
-  void _recordPropagatedType(Expression expression, DartType type) {
-    if (type != null && !type.isDynamic) {
-      expression.propagatedType = type;
-    }
-  }
 }
 
 /**
@@ -11648,12 +11949,8 @@
     // TODO(jwren) There are 4 error codes for duplicate, but only 1 is being
     // generated.
     Source source = duplicate.source;
-    return new AnalysisError(
-        source,
-        duplicate.nameOffset,
-        duplicate.displayName.length,
-        CompileTimeErrorCode.DUPLICATE_DEFINITION,
-        [existing.displayName]);
+    return new AnalysisError(source, duplicate.nameOffset, duplicate.nameLength,
+        CompileTimeErrorCode.DUPLICATE_DEFINITION, [existing.displayName]);
   }
 
   /**
@@ -12049,6 +12346,38 @@
   }
 
   @override
+  Object visitEnumDeclaration(EnumDeclaration node) {
+    ClassElement classElement = node.element;
+    Scope outerScope = nameScope;
+    try {
+      if (classElement == null) {
+        AnalysisEngine.instance.logger.logInformation(
+            "Missing element for enum declaration ${node.name.name} in ${definingLibrary.source.fullName}",
+            new CaughtException(new AnalysisException(), null));
+        super.visitEnumDeclaration(node);
+      } else {
+        ClassElement outerClass = enclosingClass;
+        try {
+          enclosingClass = node.element;
+          nameScope = new ClassScope(nameScope, classElement);
+          visitEnumMembersInScope(node);
+        } finally {
+          enclosingClass = outerClass;
+        }
+      }
+    } finally {
+      nameScope = outerScope;
+    }
+    return null;
+  }
+
+  void visitEnumMembersInScope(EnumDeclaration node) {
+    safelyVisit(node.documentationComment);
+    node.metadata.accept(this);
+    node.constants.accept(this);
+  }
+
+  @override
   Object visitForEachStatement(ForEachStatement node) {
     Scope outerNameScope = nameScope;
     ImplicitLabelScope outerImplicitScope = _implicitLabelScope;
@@ -12399,6 +12728,310 @@
 }
 
 /**
+ * Implementation of [TypeSystem] using the strong mode rules.
+ * https://github.com/dart-lang/dev_compiler/blob/master/STRONG_MODE.md
+ */
+class StrongTypeSystemImpl implements TypeSystem {
+  final _specTypeSystem = new TypeSystemImpl();
+
+  StrongTypeSystemImpl();
+
+  @override
+  DartType getLeastUpperBound(
+      TypeProvider typeProvider, DartType type1, DartType type2) {
+    // TODO(leafp): Implement a strong mode version of this.
+    return _specTypeSystem.getLeastUpperBound(typeProvider, type1, type2);
+  }
+
+  // TODO(leafp): Document the rules in play here
+  @override
+  bool isAssignableTo(DartType fromType, DartType toType) {
+    // An actual subtype
+    if (isSubtypeOf(fromType, toType)) {
+      return true;
+    }
+
+    // Don't allow implicit downcasts between function types
+    // and call method objects, as these will almost always fail.
+    if ((fromType is FunctionType && _getCallMethodType(toType) != null) ||
+        (toType is FunctionType && _getCallMethodType(fromType) != null)) {
+      return false;
+    }
+
+    // If the subtype relation goes the other way, allow the implicit downcast.
+    // TODO(leafp): Emit warnings and hints for these in some way.
+    // TODO(leafp): Consider adding a flag to disable these?  Or just rely on
+    //   --warnings-as-errors?
+    if (isSubtypeOf(toType, fromType) ||
+        _specTypeSystem.isAssignableTo(toType, fromType)) {
+      // TODO(leafp): error if type is known to be exact (literal,
+      //  instance creation).
+      // TODO(leafp): Warn on composite downcast.
+      // TODO(leafp): hint on object/dynamic downcast.
+      // TODO(leafp): Consider allowing assignment casts.
+      return true;
+    }
+
+    return false;
+  }
+
+  @override
+  bool isSubtypeOf(DartType leftType, DartType rightType) {
+    return _isSubtypeOf(leftType, rightType, null);
+  }
+
+  FunctionType _getCallMethodType(DartType t) {
+    if (t is InterfaceType) {
+      ClassElement element = t.element;
+      InheritanceManager manager = new InheritanceManager(element.library);
+      FunctionType callType = manager.lookupMemberType(t, "call");
+      return callType;
+    }
+    return null;
+  }
+
+  // Given a type t, if t is an interface type with a call method
+  // defined, return the function type for the call method, otherwise
+  // return null.
+  _GuardedSubtypeChecker<DartType> _guard(
+      _GuardedSubtypeChecker<DartType> check) {
+    return (DartType t1, DartType t2, Set<Element> visited) {
+      Element element = t1.element;
+      if (visited == null) {
+        visited = new HashSet<Element>();
+      }
+      if (element == null || !visited.add(element)) {
+        return false;
+      }
+      try {
+        return check(t1, t2, visited);
+      } finally {
+        visited.remove(element);
+      }
+    };
+  }
+
+  bool _isBottom(DartType t, {bool dynamicIsBottom: false}) {
+    return (t.isDynamic && dynamicIsBottom) || t.isBottom;
+  }
+
+  // Guard against loops in the class hierarchy
+  /**
+   * Check that [f1] is a subtype of [f2].
+   * [fuzzyArrows] indicates whether or not the f1 and f2 should be
+   * treated as fuzzy arrow types (and hence dynamic parameters to f2 treated
+   * as bottom).
+   */
+  bool _isFunctionSubtypeOf(FunctionType f1, FunctionType f2,
+      {bool fuzzyArrows: true}) {
+    final r1s = f1.normalParameterTypes;
+    final o1s = f1.optionalParameterTypes;
+    final n1s = f1.namedParameterTypes;
+    final r2s = f2.normalParameterTypes;
+    final o2s = f2.optionalParameterTypes;
+    final n2s = f2.namedParameterTypes;
+    final ret1 = f1.returnType;
+    final ret2 = f2.returnType;
+
+    // A -> B <: C -> D if C <: A and
+    // either D is void or B <: D
+    if (!ret2.isVoid && !isSubtypeOf(ret1, ret2)) {
+      return false;
+    }
+
+    // Reject if one has named and the other has optional
+    if (n1s.length > 0 && o2s.length > 0) {
+      return false;
+    }
+    if (n2s.length > 0 && o1s.length > 0) {
+      return false;
+    }
+
+    // Rebind _isSubtypeOf for convenience
+    _SubtypeChecker<DartType> parameterSubtype = (DartType t1, DartType t2) =>
+        _isSubtypeOf(t1, t2, null, dynamicIsBottom: fuzzyArrows);
+
+    // f2 has named parameters
+    if (n2s.length > 0) {
+      // Check that every named parameter in f2 has a match in f1
+      for (String k2 in n2s.keys) {
+        if (!n1s.containsKey(k2)) {
+          return false;
+        }
+        if (!parameterSubtype(n2s[k2], n1s[k2])) {
+          return false;
+        }
+      }
+    }
+    // If we get here, we either have no named parameters,
+    // or else the named parameters match and we have no optional
+    // parameters
+
+    // If f1 has more required parameters, reject
+    if (r1s.length > r2s.length) {
+      return false;
+    }
+
+    // If f2 has more required + optional parameters, reject
+    if (r2s.length + o2s.length > r1s.length + o1s.length) {
+      return false;
+    }
+
+    // The parameter lists must look like the following at this point
+    // where rrr is a region of required, and ooo is a region of optionals.
+    // f1: rrr ooo ooo ooo
+    // f2: rrr rrr ooo
+    int rr = r1s.length; // required in both
+    int or = r2s.length - r1s.length; // optional in f1, required in f2
+    int oo = o2s.length; // optional in both
+
+    for (int i = 0; i < rr; ++i) {
+      if (!parameterSubtype(r2s[i], r1s[i])) {
+        return false;
+      }
+    }
+    for (int i = 0, j = rr; i < or; ++i, ++j) {
+      if (!parameterSubtype(r2s[j], o1s[i])) {
+        return false;
+      }
+    }
+    for (int i = or, j = 0; i < oo; ++i, ++j) {
+      if (!parameterSubtype(o2s[j], o1s[i])) {
+        return false;
+      }
+    }
+    return true;
+  }
+
+  bool _isInterfaceSubtypeOf(
+      InterfaceType i1, InterfaceType i2, Set<Element> visited) {
+    // Guard recursive calls
+    _GuardedSubtypeChecker<InterfaceType> guardedInterfaceSubtype =
+        _guard(_isInterfaceSubtypeOf);
+
+    if (i1 == i2) {
+      return true;
+    }
+
+    if (i1.element == i2.element) {
+      List<DartType> tArgs1 = i1.typeArguments;
+      List<DartType> tArgs2 = i2.typeArguments;
+
+      assert(tArgs1.length == tArgs2.length);
+
+      for (int i = 0; i < tArgs1.length; i++) {
+        DartType t1 = tArgs1[i];
+        DartType t2 = tArgs2[i];
+        if (!isSubtypeOf(t1, t2)) {
+          return false;
+        }
+      }
+      return true;
+    }
+
+    if (i2.isDartCoreFunction && i1.element.getMethod("call") != null) {
+      return true;
+    }
+
+    if (i1.isObject) {
+      return false;
+    }
+
+    if (guardedInterfaceSubtype(i1.superclass, i2, visited)) {
+      return true;
+    }
+
+    for (final parent in i1.interfaces) {
+      if (guardedInterfaceSubtype(parent, i2, visited)) {
+        return true;
+      }
+    }
+
+    for (final parent in i1.mixins) {
+      if (guardedInterfaceSubtype(parent, i2, visited)) {
+        return true;
+      }
+    }
+
+    return false;
+  }
+
+  bool _isSubtypeOf(DartType t1, DartType t2, Set<Element> visited,
+      {bool dynamicIsBottom: false}) {
+    // Guard recursive calls
+    _GuardedSubtypeChecker<DartType> guardedSubtype = _guard(_isSubtypeOf);
+
+    if (t1 == t2) {
+      return true;
+    }
+
+    // The types are void, dynamic, bottom, interface types, function types
+    // and type parameters.  We proceed by eliminating these different classes
+    // from consideration.
+
+    // Trivially true.
+    if (_isTop(t2, dynamicIsBottom: dynamicIsBottom) ||
+        _isBottom(t1, dynamicIsBottom: dynamicIsBottom)) {
+      return true;
+    }
+
+    // Trivially false.
+    if (_isTop(t1, dynamicIsBottom: dynamicIsBottom) ||
+        _isBottom(t2, dynamicIsBottom: dynamicIsBottom)) {
+      return false;
+    }
+
+    // S <: T where S is a type variable
+    //  T is not dynamic or object (handled above)
+    //  S != T (handled above)
+    //  So only true if bound of S is S' and
+    //  S' <: T
+    if (t1 is TypeParameterType) {
+      DartType bound = t1.element.bound;
+      if (bound == null) return false;
+      return guardedSubtype(bound, t2, visited);
+    }
+
+    if (t2 is TypeParameterType) {
+      return false;
+    }
+
+    if (t1.isVoid || t2.isVoid) {
+      return false;
+    }
+
+    // We've eliminated void, dynamic, bottom, and type parameters.  The only
+    // cases are the combinations of interface type and function type.
+
+    // A function type can only subtype an interface type if
+    // the interface type is Function
+    if (t1 is FunctionType && t2 is InterfaceType) {
+      return t2.isDartCoreFunction;
+    }
+
+    // An interface type can only subtype a function type if
+    // the interface type declares a call method with a type
+    // which is a super type of the function type.
+    if (t1 is InterfaceType && t2 is FunctionType) {
+      var callType = _getCallMethodType(t1);
+      return (callType != null) && _isFunctionSubtypeOf(callType, t2);
+    }
+
+    // Two interface types
+    if (t1 is InterfaceType && t2 is InterfaceType) {
+      return _isInterfaceSubtypeOf(t1, t2, visited);
+    }
+
+    return _isFunctionSubtypeOf(t1 as FunctionType, t2 as FunctionType);
+  }
+
+  // TODO(leafp): Document the rules in play here
+  bool _isTop(DartType t, {bool dynamicIsBottom: false}) {
+    return (t.isDynamic && !dynamicIsBottom) || t.isObject;
+  }
+}
+
+/**
  * Instances of this class manage the knowledge of what the set of subtypes are for a given type.
  */
 class SubtypeManager {
@@ -13688,6 +14321,7 @@
         DartType type;
         TypeName typeName = node.type;
         if (typeName == null) {
+          element.hasImplicitType = true;
           type = _dynamicType;
           if (parameter is FieldFormalParameterElement) {
             FieldElement fieldElement =
@@ -13790,11 +14424,11 @@
       PropertyInducingElementImpl variable =
           accessor.variable as PropertyInducingElementImpl;
       if (accessor.isGetter) {
-        variable.type = type.returnType;
+        variable.type = type.baseReturnType;
       } else if (variable.type == null) {
-        List<DartType> parameterTypes = type.normalParameterTypes;
-        if (parameterTypes != null && parameterTypes.length > 0) {
-          variable.type = parameterTypes[0];
+        List<ParameterElement> parameters = type.baseParameters;
+        if (parameters != null && parameters.length > 0) {
+          variable.type = parameters[0].type;
         }
       }
     }
@@ -14631,27 +15265,42 @@
  */
 abstract class TypeSystem {
   /**
-   * Return the [TypeProvider] associated with this [TypeSystem].
-   */
-  TypeProvider get typeProvider;
-
-  /**
    * Compute the least upper bound of two types.
    */
-  DartType getLeastUpperBound(DartType type1, DartType type2);
+  DartType getLeastUpperBound(
+      TypeProvider typeProvider, DartType type1, DartType type2);
+
+  /**
+   * Return `true` if the [leftType] is assignable to the [rightType] (that is,
+   * if leftType <==> rightType).
+   */
+  bool isAssignableTo(DartType leftType, DartType rightType);
+
+  /**
+   * Return `true` if the [leftType] is a subtype of the [rightType] (that is,
+   * if leftType <: rightType).
+   */
+  bool isSubtypeOf(DartType leftType, DartType rightType);
+
+  /**
+   * Create either a strong mode or regular type system based on context.
+   */
+  static TypeSystem create(AnalysisContext context) {
+    return (context.analysisOptions.strongMode)
+        ? new StrongTypeSystemImpl()
+        : new TypeSystemImpl();
+  }
 }
 
 /**
  * Implementation of [TypeSystem] using the rules in the Dart specification.
  */
 class TypeSystemImpl implements TypeSystem {
-  @override
-  final TypeProvider typeProvider;
-
-  TypeSystemImpl(this.typeProvider);
+  TypeSystemImpl();
 
   @override
-  DartType getLeastUpperBound(DartType type1, DartType type2) {
+  DartType getLeastUpperBound(
+      TypeProvider typeProvider, DartType type1, DartType type2) {
     // The least upper bound relation is reflexive.
     if (identical(type1, type2)) {
       return type1;
@@ -14728,6 +15377,16 @@
       return typeProvider.dynamicType;
     }
   }
+
+  @override
+  bool isAssignableTo(DartType leftType, DartType rightType) {
+    return leftType.isAssignableTo(rightType);
+  }
+
+  @override
+  bool isSubtypeOf(DartType leftType, DartType rightType) {
+    return leftType.isSubtypeOf(rightType);
+  }
 }
 
 /**
@@ -14875,12 +15534,8 @@
   void _reportErrorForElement(
       ErrorCode errorCode, Element element, List<Object> arguments) {
     if (element != null) {
-      _errorListener.onError(new AnalysisError(
-          element.source,
-          element.nameOffset,
-          element.displayName.length,
-          errorCode,
-          arguments));
+      _errorListener.onError(new AnalysisError(element.source,
+          element.nameOffset, element.nameLength, errorCode, arguments));
     }
   }
 }
@@ -15071,11 +15726,20 @@
   @override
   Object visitSimpleIdentifier(SimpleIdentifier node) {
     // Ignore if already resolved - declaration or type.
-    if (node.staticElement != null) {
+    if (node.inDeclarationContext()) {
+      return null;
+    }
+    // Ignore if it cannot be a reference to a local variable.
+    AstNode parent = node.parent;
+    if (parent is FieldFormalParameter) {
+      return null;
+    } else if (parent is ConstructorDeclaration && parent.returnType == node) {
+      return null;
+    } else if (parent is ConstructorFieldInitializer &&
+        parent.fieldName == node) {
       return null;
     }
     // Ignore if qualified.
-    AstNode parent = node.parent;
     if (parent is PrefixedIdentifier && identical(parent.identifier, node)) {
       return null;
     }
@@ -15125,6 +15789,11 @@
     }
     return null;
   }
+
+  @override
+  Object visitTypeName(TypeName node) {
+    return null;
+  }
 }
 
 class _ConstantVerifier_validateInitializerExpression extends ConstantVisitor {
@@ -15132,13 +15801,19 @@
 
   List<ParameterElement> parameterElements;
 
+  TypeSystem _typeSystem;
+
   _ConstantVerifier_validateInitializerExpression(
       TypeProvider typeProvider,
       ErrorReporter errorReporter,
       this.verifier,
       this.parameterElements,
-      DeclaredVariables declaredVariables)
-      : super(new ConstantEvaluationEngine(typeProvider, declaredVariables),
+      DeclaredVariables declaredVariables,
+      {TypeSystem typeSystem})
+      : _typeSystem = (typeSystem != null) ? typeSystem : new TypeSystemImpl(),
+        super(
+            new ConstantEvaluationEngine(typeProvider, declaredVariables,
+                typeSystem: typeSystem),
             errorReporter);
 
   @override
@@ -15151,19 +15826,20 @@
           if (type.isDynamic) {
             return new DartObjectImpl(
                 verifier._typeProvider.objectType, DynamicState.DYNAMIC_STATE);
-          } else if (type.isSubtypeOf(verifier._boolType)) {
+          } else if (_typeSystem.isSubtypeOf(type, verifier._boolType)) {
             return new DartObjectImpl(
                 verifier._typeProvider.boolType, BoolState.UNKNOWN_VALUE);
-          } else if (type.isSubtypeOf(verifier._typeProvider.doubleType)) {
+          } else if (_typeSystem.isSubtypeOf(
+              type, verifier._typeProvider.doubleType)) {
             return new DartObjectImpl(
                 verifier._typeProvider.doubleType, DoubleState.UNKNOWN_VALUE);
-          } else if (type.isSubtypeOf(verifier._intType)) {
+          } else if (_typeSystem.isSubtypeOf(type, verifier._intType)) {
             return new DartObjectImpl(
                 verifier._typeProvider.intType, IntState.UNKNOWN_VALUE);
-          } else if (type.isSubtypeOf(verifier._numType)) {
+          } else if (_typeSystem.isSubtypeOf(type, verifier._numType)) {
             return new DartObjectImpl(
                 verifier._typeProvider.numType, NumState.UNKNOWN_VALUE);
-          } else if (type.isSubtypeOf(verifier._stringType)) {
+          } else if (_typeSystem.isSubtypeOf(type, verifier._stringType)) {
             return new DartObjectImpl(
                 verifier._typeProvider.stringType, StringState.UNKNOWN_VALUE);
           }
diff --git a/pkg/analyzer/lib/src/generated/sdk.dart b/pkg/analyzer/lib/src/generated/sdk.dart
index 2b4fc6e..c4f034f 100644
--- a/pkg/analyzer/lib/src/generated/sdk.dart
+++ b/pkg/analyzer/lib/src/generated/sdk.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.
 
-// This code was auto-generated, is not intended to be edited, and is subject to
-// significant change. Please see the README file for more information.
-
 library engine.sdk;
 
 import 'dart:collection';
@@ -148,7 +145,7 @@
    * The name of the optional parameter used to specify the category of the
    * library.
    */
-  static String _CATEGORY = "category";
+  static String _CATEGORIES = "categories";
 
   /**
    * The name of the optional parameter used to specify the platforms on which
@@ -186,6 +183,20 @@
    */
   LibraryMap get librariesMap => _librariesMap;
 
+
+  // To be backwards-compatible the new categories field is translated to
+  // an old approximation.
+  String convertCategories(String categories) {
+    switch (categories) {
+      case "": return "Internal";
+      case "Client": return "Client";
+      case "Server": return "Server";
+      case "Client,Server": return "Shared";
+      case "Client,Server,Embedded": return "Shared";
+    }
+    return "Shared";
+  }
+
   @override
   Object visitMapLiteralEntry(MapLiteralEntry node) {
     String libraryName = null;
@@ -203,8 +214,9 @@
         } else if (argument is NamedExpression) {
           String name = argument.name.label.name;
           Expression expression = argument.expression;
-          if (name == _CATEGORY) {
-            library.category = (expression as SimpleStringLiteral).value;
+          if (name == _CATEGORIES) {
+            library.category =
+                convertCategories((expression as StringLiteral).stringValue);
           } else if (name == _IMPLEMENTATION) {
             library.implementation = (expression as BooleanLiteral).value;
           } else if (name == _DOCUMENTED) {
diff --git a/pkg/analyzer/lib/src/generated/sdk_io.dart b/pkg/analyzer/lib/src/generated/sdk_io.dart
index bcdb33d..b155b9a 100644
--- a/pkg/analyzer/lib/src/generated/sdk_io.dart
+++ b/pkg/analyzer/lib/src/generated/sdk_io.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.
 
-// This code was auto-generated, is not intended to be edited, and is subject to
-// significant change. Please see the README file for more information.
-
 library engine.sdk.io;
 
 import 'dart:io';
@@ -342,8 +339,10 @@
   JavaFile get pubExecutable {
     if (_pubExecutable == null) {
       _pubExecutable = _verifyExecutable(new JavaFile.relative(
-          new JavaFile.relative(_sdkDirectory, _BIN_DIRECTORY_NAME), OSUtilities
-              .isWindows() ? _PUB_EXECUTABLE_NAME_WIN : _PUB_EXECUTABLE_NAME));
+          new JavaFile.relative(_sdkDirectory, _BIN_DIRECTORY_NAME),
+          OSUtilities.isWindows()
+              ? _PUB_EXECUTABLE_NAME_WIN
+              : _PUB_EXECUTABLE_NAME));
     }
     return _pubExecutable;
   }
@@ -400,6 +399,22 @@
     return _vmExecutable;
   }
 
+  /**
+   * Determine the search order for trying to locate the [_LIBRARIES_FILE].
+   */
+  Iterable<JavaFile> get _libraryMapLocations sync* {
+    yield new JavaFile.relative(
+        new JavaFile.relative(
+            new JavaFile.relative(
+                new JavaFile.relative(libraryDirectory, _INTERNAL_DIR),
+                _SDK_LIBRARY_METADATA_DIR),
+            _SDK_LIBRARY_METADATA_LIB_DIR),
+        _LIBRARIES_FILE);
+    yield new JavaFile.relative(
+        new JavaFile.relative(libraryDirectory, _INTERNAL_DIR),
+        _LIBRARIES_FILE);
+  }
+
   @override
   Source fromFileUri(Uri uri) {
     JavaFile file = new JavaFile.fromUri(uri);
@@ -474,23 +489,24 @@
    * is available. Return the initialized library map.
    */
   LibraryMap initialLibraryMap(bool useDart2jsPaths) {
-    JavaFile librariesFile = new JavaFile.relative(
-        new JavaFile.relative(
-          new JavaFile.relative(
-            new JavaFile.relative(libraryDirectory, _INTERNAL_DIR),
-            _SDK_LIBRARY_METADATA_DIR),
-          _SDK_LIBRARY_METADATA_LIB_DIR),
-        _LIBRARIES_FILE);
-    try {
-      String contents = librariesFile.readAsStringSync();
-      return new SdkLibrariesReader(useDart2jsPaths).readFromFile(
-          librariesFile, contents);
-    } catch (exception, stackTrace) {
-      AnalysisEngine.instance.logger.logError(
-          "Could not initialize the library map from ${librariesFile.getAbsolutePath()}",
-          new CaughtException(exception, stackTrace));
-      return new LibraryMap();
+    List<String> searchedPaths = <String>[];
+    var lastStackTrace = null;
+    var lastException = null;
+    for (JavaFile librariesFile in _libraryMapLocations) {
+      try {
+        String contents = librariesFile.readAsStringSync();
+        return new SdkLibrariesReader(useDart2jsPaths)
+            .readFromFile(librariesFile, contents);
+      } catch (exception, stackTrace) {
+        searchedPaths.add(librariesFile.getAbsolutePath());
+        lastException = exception;
+        lastStackTrace = stackTrace;
+      }
     }
+    AnalysisEngine.instance.logger.logError(
+        "Could not initialize the library map from $searchedPaths",
+        new CaughtException(lastException, lastStackTrace));
+    return new LibraryMap();
   }
 
   @override
diff --git a/pkg/analyzer/lib/src/generated/source.dart b/pkg/analyzer/lib/src/generated/source.dart
index 7db8cbe..1a47516 100644
--- a/pkg/analyzer/lib/src/generated/source.dart
+++ b/pkg/analyzer/lib/src/generated/source.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.
 
-// This code was auto-generated, is not intended to be edited, and is subject to
-// significant change. Please see the README file for more information.
-
 library engine.source;
 
 import 'dart:collection';
@@ -275,6 +272,9 @@
    * @param columnNumber the one-based index of the column containing the character
    */
   LineInfo_Location(this.lineNumber, this.columnNumber);
+
+  @override
+  String toString() => '$lineNumber:$columnNumber';
 }
 
 /**
@@ -605,8 +605,8 @@
   SourceFactory(this._resolvers,
       [this._packages, ResourceProvider resourceProvider])
       : _resourceProvider = resourceProvider != null
-          ? resourceProvider
-          : PhysicalResourceProvider.INSTANCE;
+            ? resourceProvider
+            : PhysicalResourceProvider.INSTANCE;
 
   /**
    * Return the [DartSdk] associated with this [SourceFactory], or `null` if there
@@ -642,16 +642,17 @@
       Map<String, List<Folder>> packageMap = <String, List<Folder>>{};
       _packages.asMap().forEach((String name, Uri uri) {
         if (uri.scheme == 'file' || uri.scheme == '' /* unspecified */) {
-          packageMap[name] =
-              <Folder>[_resourceProvider.getFolder(uri.toFilePath())];
+          packageMap[name] = <Folder>[
+            _resourceProvider.getFolder(uri.toFilePath())
+          ];
         }
       });
       return packageMap;
     }
 
     // Default to the PackageMapUriResolver.
-    PackageMapUriResolver resolver = _resolvers.firstWhere(
-        (r) => r is PackageMapUriResolver, orElse: () => null);
+    PackageMapUriResolver resolver = _resolvers
+        .firstWhere((r) => r is PackageMapUriResolver, orElse: () => null);
     return resolver != null ? resolver.packageMap : null;
   }
 
@@ -1076,11 +1077,10 @@
   Source resolveAbsolute(Uri uri, [Uri actualUri]);
 
   /**
-   * Return an absolute URI that represents the given source, or `null` if a valid URI cannot
-   * be computed.
+   * Return an absolute URI that represents the given [source], or `null` if a
+   * valid URI cannot be computed.
    *
-   * @param source the source to get URI for
-   * @return the absolute URI representing the given source
+   * The computation should be based solely on [source.fullName].
    */
   Uri restoreAbsolute(Source source) => null;
 }
diff --git a/pkg/analyzer/lib/src/generated/source_io.dart b/pkg/analyzer/lib/src/generated/source_io.dart
index fa32b4b..0c5d9e8 100644
--- a/pkg/analyzer/lib/src/generated/source_io.dart
+++ b/pkg/analyzer/lib/src/generated/source_io.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.
 
-// This code was auto-generated, is not intended to be edited, and is subject to
-// significant change. Please see the README file for more information.
-
 library engine.source.io;
 
 import 'dart:collection';
@@ -286,10 +283,7 @@
 
   @override
   Uri restoreAbsolute(Source source) {
-    if (source is FileBasedSource) {
-      return new Uri.file(source.fullName);
-    }
-    return null;
+    return new Uri.file(source.fullName);
   }
 
   /**
@@ -421,8 +415,10 @@
             new CaughtException(exception, stackTrace));
       }
     }
-    return new JavaFile.relative(pkgDir, relPath.replaceAll(
-        '/', new String.fromCharCode(JavaFile.separatorChar)));
+    return new JavaFile.relative(
+        pkgDir,
+        relPath.replaceAll(
+            '/', new String.fromCharCode(JavaFile.separatorChar)));
   }
 
   @override
@@ -471,15 +467,15 @@
 
   @override
   Uri restoreAbsolute(Source source) {
-    String sourcePath = source.fullName;
+    String sourceUri = _toFileUri(source.fullName);
     for (JavaFile packagesDirectory in _packagesDirectories) {
       List<JavaFile> pkgFolders = packagesDirectory.listFiles();
       if (pkgFolders != null) {
         for (JavaFile pkgFolder in pkgFolders) {
           try {
-            String pkgCanonicalPath = pkgFolder.getCanonicalPath();
-            if (sourcePath.startsWith(pkgCanonicalPath)) {
-              String relPath = sourcePath.substring(pkgCanonicalPath.length);
+            String pkgCanonicalUri = _toFileUri(pkgFolder.getCanonicalPath());
+            if (sourceUri.startsWith(pkgCanonicalUri)) {
+              String relPath = sourceUri.substring(pkgCanonicalUri.length);
               return parseUriWithException(
                   "$PACKAGE_SCHEME:${pkgFolder.getName()}$relPath");
             }
@@ -505,6 +501,13 @@
   }
 
   /**
+   * 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();
+
+  /**
    * Return `true` if the given URI is a `package` URI.
    *
    * @param uri the URI being tested
diff --git a/pkg/analyzer/lib/src/generated/static_type_analyzer.dart b/pkg/analyzer/lib/src/generated/static_type_analyzer.dart
index 096c14b..3f8c0ef 100644
--- a/pkg/analyzer/lib/src/generated/static_type_analyzer.dart
+++ b/pkg/analyzer/lib/src/generated/static_type_analyzer.dart
@@ -58,6 +58,11 @@
   InterfaceType thisType;
 
   /**
+   * Are we running in strong mode or not.
+   */
+  bool _strongMode;
+
+  /**
    * The object keeping track of which elements have had their types overridden.
    */
   TypeOverrideManager _overrideManager;
@@ -80,10 +85,11 @@
    */
   StaticTypeAnalyzer(this._resolver) {
     _typeProvider = _resolver.typeProvider;
+    _typeSystem = _resolver.typeSystem;
     _dynamicType = _typeProvider.dynamicType;
     _overrideManager = _resolver.overrideManager;
     _promoteManager = _resolver.promoteManager;
-    _typeSystem = new TypeSystemImpl(_typeProvider);
+    _strongMode = _resolver.definingLibrary.context.analysisOptions.strongMode;
   }
 
   /**
@@ -303,6 +309,15 @@
     return null;
   }
 
+  @override
+  Object visitDeclaredIdentifier(DeclaredIdentifier node) {
+    super.visitDeclaredIdentifier(node);
+    if (_strongMode) {
+      _inferForEachLoopVariableType(node);
+    }
+    return null;
+  }
+
   /**
    * The Dart Language Specification, 12.3: <blockquote>The static type of a literal double is
    * double.</blockquote>
@@ -320,7 +335,9 @@
         node.element as ExecutableElementImpl;
     functionElement.returnType =
         _computeStaticReturnTypeOfFunctionDeclaration(node);
-    _recordPropagatedTypeOfFunction(functionElement, function.body);
+    if (node.parent is FunctionDeclarationStatement) {
+      _recordPropagatedTypeOfFunction(functionElement, function.body);
+    }
     _recordStaticType(function, functionElement.type);
     return null;
   }
@@ -543,8 +560,10 @@
         }
       }
     }
-    _recordStaticType(node, _typeProvider.mapType
-        .substitute4(<DartType>[staticKeyType, staticValueType]));
+    _recordStaticType(
+        node,
+        _typeProvider.mapType
+            .substitute4(<DartType>[staticKeyType, staticValueType]));
     return null;
   }
 
@@ -606,6 +625,15 @@
     // Check for special cases.
     bool needPropagatedType = true;
     String methodName = methodNameNode.name;
+    if (_strongMode) {
+      // TODO(leafp): Revisit this.  It's here to associate a type with the
+      // method name, which is important to the DDC backend (but apparently
+      // no-one else).  Not sure that there's a problem having this here, but
+      // it's a little ad hoc.
+      visitSimpleIdentifier(methodNameNode);
+
+      _inferMethodInvocation(node);
+    }
     if (methodName == "then") {
       Expression target = node.realTarget;
       if (target != null) {
@@ -860,7 +888,7 @@
     } else if (staticElement is MethodElement) {
       staticType = staticElement.type;
     } else if (staticElement is PropertyAccessorElement) {
-      staticType = _getTypeOfProperty(staticElement, node.prefix.staticType);
+      staticType = _getTypeOfProperty(staticElement);
       propagatedType =
           _getPropertyPropagatedType(staticElement, propagatedType);
     } else if (staticElement is ExecutableElement) {
@@ -870,8 +898,11 @@
     } else if (staticElement is VariableElement) {
       staticType = staticElement.type;
     }
-    _recordStaticType(prefixedIdentifier, staticType);
-    _recordStaticType(node, staticType);
+    if (!(_strongMode &&
+        _inferObjectAccess(node, staticType, prefixedIdentifier))) {
+      _recordStaticType(prefixedIdentifier, staticType);
+      _recordStaticType(node, staticType);
+    }
     Element propagatedElement = prefixedIdentifier.propagatedElement;
     // HACK: special case for object getters ([hashCode] and [runtimeType]) on
     // dynamic expressions. More special cases in [visitMethodInvocation].
@@ -890,8 +921,7 @@
     } else if (propagatedElement is MethodElement) {
       propagatedType = propagatedElement.type;
     } else if (propagatedElement is PropertyAccessorElement) {
-      propagatedType =
-          _getTypeOfProperty(propagatedElement, node.prefix.staticType);
+      propagatedType = _getTypeOfProperty(propagatedElement);
       propagatedType =
           _getPropertyPropagatedType(propagatedElement, propagatedType);
     } else if (propagatedElement is ExecutableElement) {
@@ -993,22 +1023,21 @@
     if (staticElement is MethodElement) {
       staticType = staticElement.type;
     } else if (staticElement is PropertyAccessorElement) {
-      Expression realTarget = node.realTarget;
-      staticType = _getTypeOfProperty(staticElement,
-          realTarget != null ? _getStaticType(realTarget) : null);
+      staticType = _getTypeOfProperty(staticElement);
     } else {
       // TODO(brianwilkerson) Report this internal error.
     }
-    _recordStaticType(propertyName, staticType);
-    _recordStaticType(node, staticType);
+    if (!(_strongMode && _inferObjectAccess(node, staticType, propertyName))) {
+      _recordStaticType(propertyName, staticType);
+      _recordStaticType(node, staticType);
+    }
     Element propagatedElement = propertyName.propagatedElement;
     DartType propagatedType = _overrideManager.getType(propagatedElement);
     if (propagatedElement is MethodElement) {
       propagatedType = propagatedElement.type;
     } else if (propagatedElement is PropertyAccessorElement) {
       Expression realTarget = node.realTarget;
-      propagatedType = _getTypeOfProperty(
-          propagatedElement, realTarget != null ? realTarget.bestType : null);
+      propagatedType = _getTypeOfProperty(propagatedElement);
     } else {
       // TODO(brianwilkerson) Report this internal error.
     }
@@ -1084,7 +1113,7 @@
     } else if (element is MethodElement) {
       staticType = element.type;
     } else if (element is PropertyAccessorElement) {
-      staticType = _getTypeOfProperty(element, null);
+      staticType = _getTypeOfProperty(element);
     } else if (element is ExecutableElement) {
       staticType = element.type;
     } else if (element is TypeParameterElement) {
@@ -1182,6 +1211,9 @@
   @override
   Object visitVariableDeclaration(VariableDeclaration node) {
     Expression initializer = node.initializer;
+    if (_strongMode) {
+      _inferLocalVariableType(node, initializer);
+    }
     if (initializer != null) {
       DartType rightType = initializer.bestType;
       SimpleIdentifier name = node.name;
@@ -1211,7 +1243,7 @@
       staticType2 = _dynamicType;
     }
     DartType staticType =
-        _typeSystem.getLeastUpperBound(staticType1, staticType2);
+        _typeSystem.getLeastUpperBound(_typeProvider, staticType1, staticType2);
     if (staticType == null) {
       staticType = _dynamicType;
     }
@@ -1225,8 +1257,8 @@
       if (propagatedType2 == null) {
         propagatedType2 = staticType2;
       }
-      DartType propagatedType =
-          _typeSystem.getLeastUpperBound(propagatedType1, propagatedType2);
+      DartType propagatedType = _typeSystem.getLeastUpperBound(
+          _typeProvider, propagatedType1, propagatedType2);
       _resolver.recordPropagatedTypeIfBetter(node, propagatedType);
     }
   }
@@ -1276,7 +1308,7 @@
     if (body is BlockFunctionBody) {
       _StaticTypeAnalyzer_computePropagatedReturnTypeOfFunction visitor =
           new _StaticTypeAnalyzer_computePropagatedReturnTypeOfFunction(
-              _typeSystem);
+              _typeProvider, _typeSystem);
       body.accept(visitor);
       return visitor.result;
     }
@@ -1382,6 +1414,50 @@
     }
   }
 
+  // TODO(vsm): Use leafp's matchType here?
+  DartType _findIteratedType(DartType type, DartType targetType) {
+    // Set by _find if match is found
+    DartType result = null;
+    // Elements we've already visited on a given inheritance path.
+    HashSet<ClassElement> visitedClasses = null;
+
+    while (type is TypeParameterType) {
+      TypeParameterElement element = type.element;
+      type = element.bound;
+    }
+
+    bool _find(InterfaceType type) {
+      ClassElement element = type.element;
+      if (type == _typeProvider.objectType || element == null) {
+        return false;
+      }
+      if (element == targetType.element) {
+        List<DartType> typeArguments = type.typeArguments;
+        assert(typeArguments.length == 1);
+        result = typeArguments[0];
+        return true;
+      }
+      if (visitedClasses == null) {
+        visitedClasses = new HashSet<ClassElement>();
+      }
+      // Already visited this class along this path
+      if (!visitedClasses.add(element)) {
+        return false;
+      }
+      try {
+        return _find(type.superclass) ||
+            type.interfaces.any(_find) ||
+            type.mixins.any(_find);
+      } finally {
+        visitedClasses.remove(element);
+      }
+    }
+    if (type is InterfaceType) {
+      _find(type);
+    }
+    return result;
+  }
+
   /**
    * Return the best type of the given [expression].
    */
@@ -1548,14 +1624,9 @@
    * Return the type that should be recorded for a node that resolved to the given accessor.
    *
    * @param accessor the accessor that the node resolved to
-   * @param context if the accessor element has context [by being the RHS of a
-   *          [PrefixedIdentifier] or [PropertyAccess]], and the return type of the
-   *          accessor is a parameter type, then the type of the LHS can be used to get more
-   *          specific type information
    * @return the type that should be recorded for a node that resolved to the given accessor
    */
-  DartType _getTypeOfProperty(
-      PropertyAccessorElement accessor, DartType context) {
+  DartType _getTypeOfProperty(PropertyAccessorElement accessor) {
     FunctionType functionType = accessor.type;
     if (functionType == null) {
       // TODO(brianwilkerson) Report this internal error. This happens when we
@@ -1578,29 +1649,173 @@
       }
       return _dynamicType;
     }
-    DartType returnType = functionType.returnType;
-    if (returnType is TypeParameterType && context is InterfaceType) {
-      // if the return type is a TypeParameter, we try to use the context [that
-      // the function is being called on] to get a more accurate returnType type
-      InterfaceType interfaceTypeContext = context;
-      //      Type[] argumentTypes = interfaceTypeContext.getTypeArguments();
-      List<TypeParameterElement> typeParameterElements =
-          interfaceTypeContext.element != null
-              ? interfaceTypeContext.element.typeParameters
-              : null;
-      if (typeParameterElements != null) {
-        for (int i = 0; i < typeParameterElements.length; i++) {
-          TypeParameterElement typeParameterElement = typeParameterElements[i];
-          if (returnType.name == typeParameterElement.name) {
-            return interfaceTypeContext.typeArguments[i];
-          }
+    return functionType.returnType;
+  }
+
+  /**
+   * Given a declared identifier from a foreach loop, attempt to infer
+   * a type for it if one is not already present.  Inference is based
+   * on the type of the iterator or stream over which the foreach loop
+   * is defined.
+   */
+  void _inferForEachLoopVariableType(DeclaredIdentifier loopVariable) {
+    if (loopVariable != null &&
+        loopVariable.type == null &&
+        loopVariable.parent is ForEachStatement) {
+      ForEachStatement loop = loopVariable.parent;
+      if (loop.iterable != null) {
+        Expression expr = loop.iterable;
+        LocalVariableElementImpl element = loopVariable.element;
+        DartType exprType = expr.staticType;
+        DartType targetType = (loop.awaitKeyword == null)
+            ? _typeProvider.iterableType
+            : _typeProvider.streamType;
+        DartType iteratedType = _findIteratedType(exprType, targetType);
+        if (element != null && iteratedType != null) {
+          element.type = iteratedType;
+          loopVariable.identifier.staticType = iteratedType;
         }
-        // TODO(jwren) troubleshoot why call to substitute doesn't work
-//        Type[] parameterTypes = TypeParameterTypeImpl.getTypes(parameterElements);
-//        return returnType.substitute(argumentTypes, parameterTypes);
       }
     }
-    return returnType;
+  }
+
+  /**
+   * Given a method invocation [node], attempt to infer a better
+   * type for the result.
+   */
+  bool _inferMethodInvocation(MethodInvocation node) {
+    return _inferMethodInvocationObject(node) ||
+        _inferMethodInvocationGeneric(node) ||
+        _inferMethodInvocationInlineJS(node);
+  }
+
+  /**
+   * Given a method invocation [node], attempt to infer a better
+   * type for the result using an ad-hoc list of psuedo-generic methods.
+   */
+  bool _inferMethodInvocationGeneric(MethodInvocation node) {
+    DartType inferredType = _matchGeneric(node);
+    // TODO(vsm): If the inferred type is not a subtype,
+    // should we use a GLB instead?
+    if (inferredType != null &&
+        _typeSystem.isSubtypeOf(inferredType, node.staticType)) {
+      _recordStaticType(node, inferredType);
+      return true;
+    }
+    return false;
+  }
+
+  /**
+   * Given a method invocation [node], attempt to infer a better
+   * type for the result if it is an inline JS invocation
+   */
+  bool _inferMethodInvocationInlineJS(MethodInvocation node) {
+    Element e = node.methodName.staticElement;
+    if (e is FunctionElement &&
+        e.library.source.uri.toString() == 'dart:_foreign_helper' &&
+        e.name == 'JS') {
+      String typeStr = _getFirstArgumentAsString(node.argumentList);
+      DartType returnType = null;
+      if (typeStr == '-dynamic') {
+        returnType = _typeProvider.bottomType;
+      } else {
+        returnType = _getElementNameAsType(
+            _typeProvider.objectType.element.library, typeStr, null);
+      }
+      if (returnType != null) {
+        _recordStaticType(node, returnType);
+        return true;
+      }
+    }
+    return false;
+  }
+
+  /**
+   * Given a method invocation [node], attempt to infer a better
+   * type for the result if the target is dynamic and the method
+   * being called is one of the object methods.
+   */
+  bool _inferMethodInvocationObject(MethodInvocation node) {
+    // If we have a call like `toString()` or `libraryPrefix.toString()` don't
+    // infer it.
+    Expression target = node.realTarget;
+    if (target == null ||
+        target is SimpleIdentifier && target.staticElement is PrefixElement) {
+      return false;
+    }
+
+    // Object methods called on dynamic targets can have their types improved.
+    String name = node.methodName.name;
+    MethodElement inferredElement =
+        _typeProvider.objectType.element.getMethod(name);
+    if (inferredElement == null || inferredElement.isStatic) {
+      return false;
+    }
+    DartType inferredType = inferredElement.type;
+    DartType nodeType = node.staticType;
+    if (nodeType != null &&
+        nodeType.isDynamic &&
+        inferredType is FunctionType &&
+        inferredType.parameters.isEmpty &&
+        node.argumentList.arguments.isEmpty &&
+        _typeProvider.nonSubtypableTypes.contains(inferredType.returnType)) {
+      _recordStaticType(node.methodName, inferredType);
+      _recordStaticType(node, inferredType.returnType);
+      return true;
+    }
+    return false;
+  }
+
+  /**
+   * Given a local variable declaration and its initializer, attempt to infer
+   * a type for the local variable declaration based on the initializer.
+   * Inference is only done if an explicit type is not present, and if
+   * inferring a type improves the type.
+   */
+  void _inferLocalVariableType(
+      VariableDeclaration node, Expression initializer) {
+    if (initializer != null &&
+        (node.parent as VariableDeclarationList).type == null &&
+        (node.element is LocalVariableElementImpl) &&
+        (initializer.staticType != null) &&
+        (!initializer.staticType.isBottom)) {
+      LocalVariableElementImpl element = node.element;
+      element.type = initializer.staticType;
+      node.name.staticType = initializer.staticType;
+    }
+  }
+
+  /**
+   * Given a property access [node] with static type [nodeType],
+   * and [id] is the property name being accessed, infer a type for the
+   * access itself and its constituent components if the access is to one of the
+   * methods or getters of the built in 'Object' type, and if the result type is
+   * a sealed type. Returns true if inference succeeded.
+   */
+  bool _inferObjectAccess(
+      Expression node, DartType nodeType, SimpleIdentifier id) {
+    // If we have an access like `libraryPrefix.hashCode` don't infer it.
+    if (node is PrefixedIdentifier &&
+        node.prefix.staticElement is PrefixElement) {
+      return false;
+    }
+    // Search for Object accesses.
+    String name = id.name;
+    PropertyAccessorElement inferredElement =
+        _typeProvider.objectType.element.getGetter(name);
+    if (inferredElement == null || inferredElement.isStatic) {
+      return false;
+    }
+    DartType inferredType = inferredElement.type.returnType;
+    if (nodeType != null &&
+        nodeType.isDynamic &&
+        inferredType != null &&
+        _typeProvider.nonSubtypableTypes.contains(inferredType)) {
+      _recordStaticType(id, inferredType);
+      _recordStaticType(node, inferredType);
+      return true;
+    }
+    return false;
   }
 
   /**
@@ -1648,6 +1863,91 @@
   }
 
   /**
+   * Return a more specialized type for a method invocation based on
+   * an ad-hoc list of pseudo-generic methods.
+   */
+  DartType _matchGeneric(MethodInvocation node) {
+    Element e = node.methodName.staticElement;
+
+    if (e == null || e.name == null) {
+      return null;
+    }
+
+    List<DartType> arguments =
+        node.argumentList.arguments.map((arg) => arg.staticType).toList();
+
+    bool matchInvocation(DartType t, int c) {
+      return (node.realTarget != null) &&
+          node.realTarget.staticType.isSubtypeOf(t) &&
+          arguments.length == c;
+    }
+
+    switch (e.name) {
+      case 'max':
+      case 'min':
+        if (e.library.source.uri.toString() == 'dart:math' &&
+            arguments.length == 2) {
+          DartType tx = arguments[0];
+          DartType ty = arguments[1];
+          if (tx == ty &&
+              (tx == _typeProvider.intType || tx == _typeProvider.doubleType)) {
+            return tx;
+          }
+        }
+        return null;
+      case 'wait':
+        if (matchInvocation(_typeProvider.futureType, 1)) {
+          DartType tx = arguments[0];
+          // Iterable<Future<T>> -> Future<List<T>>
+          DartType futureType =
+              _findIteratedType(tx, _typeProvider.iterableType);
+          if (futureType.element != _typeProvider.futureType.element) {
+            return null;
+          }
+          List<DartType> typeArguments =
+              (futureType as InterfaceType).typeArguments;
+          if (typeArguments.length != 1) {
+            return null;
+          }
+          DartType baseType = typeArguments[0];
+          if (baseType.isDynamic) {
+            return null;
+          }
+          return _typeProvider.futureType.substitute4([
+            _typeProvider.listType.substitute4([baseType])
+          ]);
+        }
+        return null;
+      case 'map':
+        if (matchInvocation(_typeProvider.iterableDynamicType, 1)) {
+          DartType tx = arguments[0];
+          return (tx is FunctionType)
+              ? _typeProvider.iterableType.substitute4([tx.returnType])
+              : null;
+        }
+        return null;
+      case 'fold':
+        if (matchInvocation(_typeProvider.iterableDynamicType, 2)) {
+          DartType tx = arguments[0];
+          DartType ty = arguments[1];
+          // TODO(vsm): LUB?
+          return (ty is FunctionType && tx == ty.returnType) ? tx : null;
+        }
+        return null;
+      case 'then':
+        if (matchInvocation(_typeProvider.futureDynamicType, 1)) {
+          DartType tx = arguments[0];
+          return (tx is FunctionType)
+              ? _typeProvider.futureType.substitute4([tx.returnType])
+              : null;
+        }
+        return null;
+      default:
+        return null;
+    }
+  }
+
+  /**
    * Record that the propagated type of the given node is the given type.
    *
    * @param expression the node whose type is to be recorded
@@ -1941,10 +2241,12 @@
 
 class _StaticTypeAnalyzer_computePropagatedReturnTypeOfFunction
     extends GeneralizingAstVisitor<Object> {
-  final TypeSystem typeSystem;
+  final TypeSystem _typeSystem;
+  final TypeProvider _typeProvider;
   DartType result = null;
 
-  _StaticTypeAnalyzer_computePropagatedReturnTypeOfFunction(this.typeSystem);
+  _StaticTypeAnalyzer_computePropagatedReturnTypeOfFunction(
+      this._typeProvider, this._typeSystem);
 
   @override
   Object visitExpression(Expression node) => null;
@@ -1963,7 +2265,7 @@
     if (result == null) {
       result = type;
     } else {
-      result = typeSystem.getLeastUpperBound(result, type);
+      result = _typeSystem.getLeastUpperBound(_typeProvider, result, type);
     }
     return null;
   }
diff --git a/pkg/analyzer/lib/src/generated/testing/ast_factory.dart b/pkg/analyzer/lib/src/generated/testing/ast_factory.dart
index b0702c7..bb758b3 100644
--- a/pkg/analyzer/lib/src/generated/testing/ast_factory.dart
+++ b/pkg/analyzer/lib/src/generated/testing/ast_factory.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.
 
-// This code was auto-generated, is not intended to be edited, and is subject to
-// significant change. Please see the README file for more information.
-
 library engine.testing.ast_factory;
 
 import 'package:analyzer/src/generated/ast.dart';
@@ -34,8 +31,11 @@
 
   static Annotation annotation2(Identifier name,
           SimpleIdentifier constructorName, ArgumentList arguments) =>
-      new Annotation(TokenFactory.tokenFromType(TokenType.AT), name,
-          TokenFactory.tokenFromType(TokenType.PERIOD), constructorName,
+      new Annotation(
+          TokenFactory.tokenFromType(TokenType.AT),
+          name,
+          TokenFactory.tokenFromType(TokenType.PERIOD),
+          constructorName,
           arguments);
 
   static ArgumentList argumentList([List<Expression> arguments]) =>
@@ -47,30 +47,39 @@
           expression, TokenFactory.tokenFromKeyword(Keyword.AS), type);
 
   static AssertStatement assertStatement(Expression condition) =>
-      new AssertStatement(TokenFactory.tokenFromKeyword(Keyword.ASSERT),
-          TokenFactory.tokenFromType(TokenType.OPEN_PAREN), condition,
+      new AssertStatement(
+          TokenFactory.tokenFromKeyword(Keyword.ASSERT),
+          TokenFactory.tokenFromType(TokenType.OPEN_PAREN),
+          condition,
           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);
+          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));
+          [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));
+          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));
+          [List<Statement> statements]) =>
+      new BlockFunctionBody(
+          TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, "async"),
+          TokenFactory.tokenFromType(TokenType.STAR),
+          block(statements));
 
   static AwaitExpression awaitExpression(Expression expression) =>
       new AwaitExpression(
@@ -78,11 +87,13 @@
           expression);
 
   static BinaryExpression binaryExpression(Expression leftOperand,
-      TokenType operator, Expression rightOperand) => new BinaryExpression(
-      leftOperand, TokenFactory.tokenFromType(operator), rightOperand);
+          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.OPEN_CURLY_BRACKET),
+      statements,
       TokenFactory.tokenFromType(TokenType.CLOSE_CURLY_BRACKET));
 
   static BlockFunctionBody blockFunctionBody(Block block) =>
@@ -91,31 +102,41 @@
   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 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.tokenFromKeyword(Keyword.BREAK),
+      null,
       TokenFactory.tokenFromType(TokenType.SEMICOLON));
 
   static BreakStatement breakStatement2(String label) => new BreakStatement(
-      TokenFactory.tokenFromKeyword(Keyword.BREAK), identifier3(label),
+      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.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));
+          [List<Expression> arguments]) =>
+      new MethodInvocation(
+          null,
+          TokenFactory.tokenFromType(TokenType.PERIOD_PERIOD),
+          identifier3(methodName),
+          null,
+          argumentList(arguments));
 
   static PropertyAccess cascadedPropertyAccess(String propertyName) =>
-      new PropertyAccess(null,
+      new PropertyAccess(
+          null,
           TokenFactory.tokenFromType(TokenType.PERIOD_PERIOD),
           identifier3(propertyName));
 
@@ -142,47 +163,74 @@
       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));
+          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 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 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);
@@ -209,49 +257,82 @@
           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 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);
+      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 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 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) =>
@@ -259,16 +340,20 @@
           prefixedWithThis ? TokenFactory.tokenFromKeyword(Keyword.THIS) : null,
           prefixedWithThis
               ? TokenFactory.tokenFromType(TokenType.PERIOD)
-              : null, identifier3(fieldName),
-          TokenFactory.tokenFromType(TokenType.EQ), expression);
+              : null,
+          identifier3(fieldName),
+          TokenFactory.tokenFromType(TokenType.EQ),
+          expression);
 
   static ConstructorName constructorName(TypeName type, String name) =>
-      new ConstructorName(type,
+      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),
+      new ContinueStatement(
+          TokenFactory.tokenFromKeyword(Keyword.CONTINUE),
           label == null ? null : identifier3(label),
           TokenFactory.tokenFromType(TokenType.SEMICOLON));
 
@@ -278,21 +363,32 @@
 
   static DeclaredIdentifier declaredIdentifier2(
           Keyword keyword, TypeName type, String identifier) =>
-      new DeclaredIdentifier(null, null,
-          keyword == null ? null : TokenFactory.tokenFromKeyword(keyword), type,
+      new DeclaredIdentifier(
+          null,
+          null,
+          keyword == null ? null : TokenFactory.tokenFromKeyword(keyword),
+          type,
           identifier3(identifier));
 
   static DeclaredIdentifier declaredIdentifier3(String identifier) =>
-      declaredIdentifier2(null, null, 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,
+      new DoStatement(
+          TokenFactory.tokenFromKeyword(Keyword.DO),
+          body,
           TokenFactory.tokenFromKeyword(Keyword.WHILE),
-          TokenFactory.tokenFromType(TokenType.OPEN_PAREN), condition,
+          TokenFactory.tokenFromType(TokenType.OPEN_PAREN),
+          condition,
           TokenFactory.tokenFromType(TokenType.CLOSE_PAREN),
           TokenFactory.tokenFromType(TokenType.SEMICOLON));
 
@@ -307,9 +403,13 @@
 
   static EnumDeclaration enumDeclaration(
           SimpleIdentifier name, List<EnumConstantDeclaration> constants) =>
-      new EnumDeclaration(null, null,
-          TokenFactory.tokenFromKeyword(Keyword.ENUM), name,
-          TokenFactory.tokenFromType(TokenType.OPEN_CURLY_BRACKET), 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(
@@ -325,17 +425,24 @@
   }
 
   static ExportDirective exportDirective(List<Annotation> metadata, String uri,
-      [List<Combinator> combinators]) => new ExportDirective(null, metadata,
-      TokenFactory.tokenFromKeyword(Keyword.EXPORT), string2(uri), combinators,
-      TokenFactory.tokenFromType(TokenType.SEMICOLON));
+          [List<Combinator> combinators]) =>
+      new ExportDirective(
+          null,
+          metadata,
+          TokenFactory.tokenFromKeyword(Keyword.EXPORT),
+          string2(uri),
+          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,
+      new ExpressionFunctionBody(
+          null,
+          TokenFactory.tokenFromType(TokenType.FUNCTION),
+          expression,
           TokenFactory.tokenFromType(TokenType.SEMICOLON));
 
   static ExpressionStatement expressionStatement(Expression expression) =>
@@ -347,7 +454,9 @@
 
   static FieldDeclaration fieldDeclaration(bool isStatic, Keyword keyword,
           TypeName type, List<VariableDeclaration> variables) =>
-      new FieldDeclaration(null, null,
+      new FieldDeclaration(
+          null,
+          null,
           isStatic ? TokenFactory.tokenFromKeyword(Keyword.STATIC) : null,
           variableDeclarationList(keyword, type, variables),
           TokenFactory.tokenFromType(TokenType.SEMICOLON));
@@ -357,61 +466,98 @@
       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);
+          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,
+      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);
+          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,
+      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);
+          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));
+          [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);
+      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);
+      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,
+      new FunctionDeclaration(
+          null,
+          null,
+          null,
+          type,
           keyword == null ? null : TokenFactory.tokenFromKeyword(keyword),
-          identifier3(name), functionExpression);
+          identifier3(name),
+          functionExpression);
 
   static FunctionDeclarationStatement functionDeclarationStatement(
-          TypeName type, Keyword keyword, String name,
+          TypeName type,
+          Keyword keyword,
+          String name,
           FunctionExpression functionExpression) =>
       new FunctionDeclarationStatement(
           functionDeclaration(type, keyword, name, functionExpression));
@@ -424,25 +570,28 @@
       new FunctionExpression(null, parameters, body);
 
   static FunctionExpression functionExpression3(
-          TypeParameterList typeParameters, FormalParameterList parameters,
+          TypeParameterList typeParameters,
+          FormalParameterList parameters,
           FunctionBody body) =>
       new FunctionExpression(typeParameters, parameters, body);
 
   static FunctionExpressionInvocation functionExpressionInvocation(
-          Expression function, [List<Expression> arguments]) =>
+          Expression function,
+          [List<Expression> arguments]) =>
       functionExpressionInvocation2(function, null, arguments);
 
   static FunctionExpressionInvocation functionExpressionInvocation2(
           Expression function,
-          [TypeArgumentList typeArguments, List<Expression> arguments]) =>
+          [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));
+          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);
@@ -460,12 +609,13 @@
       TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, lexeme));
 
   static PrefixedIdentifier identifier4(
-      String prefix, SimpleIdentifier identifier) => new PrefixedIdentifier(
-      identifier3(prefix), TokenFactory.tokenFromType(TokenType.PERIOD),
-      identifier);
+          String prefix, SimpleIdentifier identifier) =>
+      new PrefixedIdentifier(identifier3(prefix),
+          TokenFactory.tokenFromType(TokenType.PERIOD), identifier);
 
   static PrefixedIdentifier identifier5(String prefix, String identifier) =>
-      new PrefixedIdentifier(identifier3(prefix),
+      new PrefixedIdentifier(
+          identifier3(prefix),
           TokenFactory.tokenFromType(TokenType.PERIOD),
           identifier3(identifier));
 
@@ -483,26 +633,35 @@
       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);
+          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),
-      !isDeferred ? null : TokenFactory.tokenFromKeyword(Keyword.DEFERRED),
-      prefix == null ? null : TokenFactory.tokenFromKeyword(Keyword.AS),
-      prefix == null ? null : identifier3(prefix), combinators,
-      TokenFactory.tokenFromType(TokenType.SEMICOLON));
+          List<Annotation> metadata, String uri, bool isDeferred, String prefix,
+          [List<Combinator> combinators]) =>
+      new ImportDirective(
+          null,
+          metadata,
+          TokenFactory.tokenFromKeyword(Keyword.IMPORT),
+          string2(uri),
+          !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,
@@ -514,50 +673,63 @@
       importDirective(null, uri, false, prefix, combinators);
 
   static IndexExpression indexExpression(Expression array, Expression index) =>
-      new IndexExpression.forTarget(array,
-          TokenFactory.tokenFromType(TokenType.OPEN_SQUARE_BRACKET), 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));
+          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]) =>
+          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
+          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);
+              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));
+          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);
+          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);
+          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));
@@ -570,8 +742,11 @@
 
   static LibraryDirective libraryDirective(
           List<Annotation> metadata, LibraryIdentifier libraryName) =>
-      new LibraryDirective(null, metadata,
-          TokenFactory.tokenFromKeyword(Keyword.LIBRARY), libraryName,
+      new LibraryDirective(
+          null,
+          metadata,
+          TokenFactory.tokenFromKeyword(Keyword.LIBRARY),
+          libraryName,
           TokenFactory.tokenFromType(TokenType.SEMICOLON));
 
   static LibraryDirective libraryDirective2(String libraryName) =>
@@ -579,7 +754,8 @@
           new List<Annotation>(), libraryIdentifier2([libraryName]));
 
   static LibraryIdentifier libraryIdentifier(
-      List<SimpleIdentifier> components) => new LibraryIdentifier(components);
+          List<SimpleIdentifier> components) =>
+      new LibraryIdentifier(components);
 
   static LibraryIdentifier libraryIdentifier2(List<String> components) {
     return new LibraryIdentifier(identifierList(components));
@@ -593,17 +769,23 @@
       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));
+          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));
+          [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);
@@ -612,54 +794,93 @@
       new MapLiteralEntry(
           string2(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 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 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 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 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));
+          [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));
+          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);
@@ -670,16 +891,20 @@
 
   static DefaultFormalParameter namedFormalParameter(
           NormalFormalParameter parameter, Expression expression) =>
-      new DefaultFormalParameter(parameter, ParameterKind.NAMED,
+      new DefaultFormalParameter(
+          parameter,
+          ParameterKind.NAMED,
           expression == null
               ? null
-              : TokenFactory.tokenFromType(TokenType.COLON), expression);
+              : 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"),
+      new NativeFunctionBody(
+          TokenFactory.tokenFromString("native"),
           string2(nativeMethodName),
           TokenFactory.tokenFromType(TokenType.SEMICOLON));
 
@@ -687,13 +912,18 @@
       new NullLiteral(TokenFactory.tokenFromKeyword(Keyword.NULL));
 
   static ParenthesizedExpression parenthesizedExpression(
-      Expression expression) => new ParenthesizedExpression(
-      TokenFactory.tokenFromType(TokenType.OPEN_PAREN), expression,
-      TokenFactory.tokenFromType(TokenType.CLOSE_PAREN));
+          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),
+      new PartDirective(
+          null,
+          metadata,
+          TokenFactory.tokenFromKeyword(Keyword.PART),
+          string2(url),
           TokenFactory.tokenFromType(TokenType.SEMICOLON));
 
   static PartDirective partDirective2(String url) =>
@@ -704,14 +934,19 @@
 
   static PartOfDirective partOfDirective2(
           List<Annotation> metadata, LibraryIdentifier libraryName) =>
-      new PartOfDirective(null, metadata,
+      new PartOfDirective(
+          null,
+          metadata,
           TokenFactory.tokenFromKeyword(Keyword.PART),
-          TokenFactory.tokenFromString("of"), libraryName,
+          TokenFactory.tokenFromString("of"),
+          libraryName,
           TokenFactory.tokenFromType(TokenType.SEMICOLON));
 
   static DefaultFormalParameter positionalFormalParameter(
           NormalFormalParameter parameter, Expression expression) =>
-      new DefaultFormalParameter(parameter, ParameterKind.POSITIONAL,
+      new DefaultFormalParameter(
+          parameter,
+          ParameterKind.POSITIONAL,
           expression == null ? null : TokenFactory.tokenFromType(TokenType.EQ),
           expression);
 
@@ -724,21 +959,25 @@
       new PrefixExpression(TokenFactory.tokenFromType(operator), expression);
 
   static PropertyAccess propertyAccess(
-      Expression target, SimpleIdentifier propertyName) => new PropertyAccess(
-      target, TokenFactory.tokenFromType(TokenType.PERIOD), propertyName);
+          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));
+          [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]) =>
+          String constructorName,
+          [List<Expression> arguments]) =>
       new RedirectingConstructorInvocation(
-          TokenFactory.tokenFromKeyword(Keyword.THIS), constructorName == null
+          TokenFactory.tokenFromKeyword(Keyword.THIS),
+          constructorName == null
               ? null
               : TokenFactory.tokenFromType(TokenType.PERIOD),
           constructorName == null ? null : identifier3(constructorName),
@@ -769,8 +1008,11 @@
 
   static SimpleFormalParameter simpleFormalParameter2(
           Keyword keyword, TypeName type, String parameterName) =>
-      new SimpleFormalParameter(null, null,
-          keyword == null ? null : TokenFactory.tokenFromKeyword(keyword), type,
+      new SimpleFormalParameter(
+          null,
+          null,
+          keyword == null ? null : TokenFactory.tokenFromKeyword(keyword),
+          type,
           identifier3(parameterName));
 
   static SimpleFormalParameter simpleFormalParameter3(String parameterName) =>
@@ -791,10 +1033,12 @@
       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));
+          [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));
@@ -804,25 +1048,28 @@
       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);
+          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);
+          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));
+          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>();
@@ -835,14 +1082,18 @@
   }
 
   static BlockFunctionBody syncBlockFunctionBody(
-      [List<Statement> statements]) => new BlockFunctionBody(
-      TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, "sync"), null,
-      block(statements));
+          [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));
+          [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));
@@ -854,14 +1105,20 @@
           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));
+          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,
+      new TopLevelVariableDeclaration(
+          null,
+          null,
           variableDeclarationList(keyword, null, variables),
           TokenFactory.tokenFromType(TokenType.SEMICOLON));
 
@@ -874,16 +1131,25 @@
 
   static TryStatement tryStatement3(
           Block body, List<CatchClause> catchClauses, Block finallyClause) =>
-      new TryStatement(TokenFactory.tokenFromKeyword(Keyword.TRY), body,
-          catchClauses, finallyClause == null
+      new TryStatement(
+          TokenFactory.tokenFromKeyword(Keyword.TRY),
+          body,
+          catchClauses,
+          finallyClause == null
               ? null
-              : TokenFactory.tokenFromKeyword(Keyword.FINALLY), finallyClause);
+              : 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,
+      new FunctionTypeAlias(
+          null,
+          null,
+          TokenFactory.tokenFromKeyword(Keyword.TYPEDEF),
+          returnType,
+          identifier3(name),
+          typeParameters,
+          parameters,
           TokenFactory.tokenFromType(TokenType.SEMICOLON));
 
   static TypeArgumentList typeArgumentList(List<TypeName> typeNames) {
@@ -938,13 +1204,17 @@
       new VariableDeclaration(identifier3(name), null, null);
 
   static VariableDeclaration variableDeclaration2(
-      String name, Expression initializer) => new VariableDeclaration(
-      identifier3(name), TokenFactory.tokenFromType(TokenType.EQ), initializer);
+          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,
+      new VariableDeclarationList(
+          null,
+          null,
+          keyword == null ? null : TokenFactory.tokenFromKeyword(keyword),
+          type,
           variables);
 
   static VariableDeclarationList variableDeclarationList2(
@@ -952,19 +1222,24 @@
       variableDeclarationList(keyword, null, variables);
 
   static VariableDeclarationStatement variableDeclarationStatement(
-      Keyword keyword, TypeName type,
-      List<VariableDeclaration> variables) => new VariableDeclarationStatement(
-      variableDeclarationList(keyword, type, variables),
-      TokenFactory.tokenFromType(TokenType.SEMICOLON));
+          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);
+      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);
@@ -972,11 +1247,14 @@
   static YieldStatement yieldEachStatement(Expression expression) =>
       new YieldStatement(
           TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, "yield"),
-          TokenFactory.tokenFromType(TokenType.STAR), expression,
+          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));
+  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 d6a4c78..736fa0d 100644
--- a/pkg/analyzer/lib/src/generated/testing/element_factory.dart
+++ b/pkg/analyzer/lib/src/generated/testing/element_factory.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.
 
-// This code was auto-generated, is not intended to be edited, and is subject to
-// significant change. Please see the README file for more information.
-
 library engine.testing.element_factory;
 
 import 'dart:collection';
@@ -349,6 +346,40 @@
       functionElement4(
           functionName, null, normalParameters, names, namedParameters);
 
+  static FunctionElementImpl functionElement8(
+      List<DartType> parameters, DartType returnType,
+      {List<DartType> optional, Map<String, DartType> named}) {
+    List<ParameterElement> parameterElements = new List<ParameterElement>();
+    for (int i = 0; i < parameters.length; i++) {
+      ParameterElementImpl parameterElement =
+          new ParameterElementImpl("a$i", i);
+      parameterElement.type = parameters[i];
+      parameterElement.parameterKind = ParameterKind.REQUIRED;
+      parameterElements.add(parameterElement);
+    }
+    if (optional != null) {
+      int j = parameters.length;
+      for (int i = 0; i < optional.length; i++) {
+        ParameterElementImpl parameterElement =
+            new ParameterElementImpl("o$i", j);
+        parameterElement.type = optional[i];
+        parameterElement.parameterKind = ParameterKind.POSITIONAL;
+        parameterElements.add(parameterElement);
+        j++;
+      }
+    } else if (named != null) {
+      int j = parameters.length;
+      for (String s in named.keys) {
+        ParameterElementImpl parameterElement = new ParameterElementImpl(s, j);
+        parameterElement.type = named[s];
+        parameterElement.parameterKind = ParameterKind.NAMED;
+        parameterElements.add(parameterElement);
+      }
+    }
+
+    return functionElementWithParameters("f", returnType, parameterElements);
+  }
+
   static FunctionElementImpl functionElementWithParameters(String functionName,
       DartType returnType, List<ParameterElement> parameters) {
     FunctionElementImpl functionElement =
@@ -411,7 +442,7 @@
     String fileName = "/$libraryName.dart";
     CompilationUnitElementImpl unit = compilationUnit(fileName);
     LibraryElementImpl library =
-        new LibraryElementImpl(context, libraryName, 0);
+        new LibraryElementImpl(context, libraryName, 0, libraryName.length);
     library.definingCompilationUnit = unit;
     return library;
   }
diff --git a/pkg/analyzer/lib/src/generated/testing/html_factory.dart b/pkg/analyzer/lib/src/generated/testing/html_factory.dart
index 5006c02..a9ac412 100644
--- a/pkg/analyzer/lib/src/generated/testing/html_factory.dart
+++ b/pkg/analyzer/lib/src/generated/testing/html_factory.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.
 
-// This code was auto-generated, is not intended to be edited, and is subject to
-// significant change. Please see the README file for more information.
-
 library engine.testing.html_factory;
 
 import 'package:analyzer/src/generated/html.dart';
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 217a0d8..5b5204a 100644
--- a/pkg/analyzer/lib/src/generated/testing/test_type_provider.dart
+++ b/pkg/analyzer/lib/src/generated/testing/test_type_provider.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.
 
-// This code was auto-generated, is not intended to be edited, and is subject to
-// significant change. Please see the README file for more information.
-
 library engine.testing.test_type_provider;
 
 import 'package:analyzer/src/generated/ast.dart';
@@ -340,13 +337,13 @@
 
   @override
   List<InterfaceType> get nonSubtypableTypes => <InterfaceType>[
-    nullType,
-    numType,
-    intType,
-    doubleType,
-    boolType,
-    stringType
-  ];
+        nullType,
+        numType,
+        intType,
+        doubleType,
+        boolType,
+        stringType
+      ];
 
   @override
   DartObjectImpl get nullObject {
diff --git a/pkg/analyzer/lib/src/generated/testing/token_factory.dart b/pkg/analyzer/lib/src/generated/testing/token_factory.dart
index e9324be..1b9a828 100644
--- a/pkg/analyzer/lib/src/generated/testing/token_factory.dart
+++ b/pkg/analyzer/lib/src/generated/testing/token_factory.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.
 
-// This code was auto-generated, is not intended to be edited, and is subject to
-// significant change. Please see the README file for more information.
-
 library engine.testing.token_factory;
 
 import 'package:analyzer/src/generated/scanner.dart';
diff --git a/pkg/analyzer/lib/src/generated/utilities_collection.dart b/pkg/analyzer/lib/src/generated/utilities_collection.dart
index e8abbbd..0d2afe8 100644
--- a/pkg/analyzer/lib/src/generated/utilities_collection.dart
+++ b/pkg/analyzer/lib/src/generated/utilities_collection.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.
 
-// This code was auto-generated, is not intended to be edited, and is subject to
-// significant change. Please see the README file for more information.
-
 library engine.utilities.collection;
 
 import "dart:math" as math;
diff --git a/pkg/analyzer/lib/src/generated/utilities_dart.dart b/pkg/analyzer/lib/src/generated/utilities_dart.dart
index 888cc11..882d182 100644
--- a/pkg/analyzer/lib/src/generated/utilities_dart.dart
+++ b/pkg/analyzer/lib/src/generated/utilities_dart.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.
 
-// This code was auto-generated, is not intended to be edited, and is subject to
-// significant change. Please see the README file for more information.
-
 library engine.utilities.dart;
 
 import 'java_core.dart';
diff --git a/pkg/analyzer/lib/src/generated/utilities_general.dart b/pkg/analyzer/lib/src/generated/utilities_general.dart
index 62f4029..d000b54 100644
--- a/pkg/analyzer/lib/src/generated/utilities_general.dart
+++ b/pkg/analyzer/lib/src/generated/utilities_general.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.
 
-// This code was auto-generated, is not intended to be edited, and is subject to
-// significant change. Please see the README file for more information.
-
 library engine.utilities.general;
 
-import 'dart:profiler';
+import 'dart:collection';
+import 'dart:developer' show UserTag;
 
 /**
  * Jenkins hash function, optimized for small integers.
@@ -35,8 +33,28 @@
 }
 
 /**
+ * A simple limited queue.
+ */
+class LimitedQueue<E> extends ListQueue<E> {
+  final int limit;
+
+  /**
+   * Create a queue with [limit] items.
+   */
+  LimitedQueue(this.limit);
+
+  @override
+  void add(E o) {
+    super.add(o);
+    while (length > limit) {
+      remove(first);
+    }
+  }
+}
+
+/**
  * Helper class for gathering performance statistics.  This class is modeled on
- * the UserTag class in dart:profiler so that it can interoperate easily with
+ * the UserTag class in dart:developer so that it can interoperate easily with
  * it.
  */
 abstract class PerformanceTag {
diff --git a/pkg/analyzer/lib/src/generated/visitors.dart b/pkg/analyzer/lib/src/generated/visitors.dart
index defb317..59e644f 100644
--- a/pkg/analyzer/lib/src/generated/visitors.dart
+++ b/pkg/analyzer/lib/src/generated/visitors.dart
@@ -303,6 +303,7 @@
     node.visitChildren(this);
     return null;
   }
+
   @override
   T visitFunctionDeclaration(FunctionDeclaration node) {
     _delegates.forEach((delegate) => delegate.visitFunctionDeclaration(node));
@@ -475,6 +476,7 @@
     node.visitChildren(this);
     return null;
   }
+
   @override
   T visitMethodInvocation(MethodInvocation node) {
     _delegates.forEach((delegate) => delegate.visitMethodInvocation(node));
@@ -545,6 +547,7 @@
     node.visitChildren(this);
     return null;
   }
+
   @override
   T visitPrefixedIdentifier(PrefixedIdentifier node) {
     _delegates.forEach((delegate) => delegate.visitPrefixedIdentifier(node));
diff --git a/pkg/analyzer/lib/src/plugin/engine_plugin.dart b/pkg/analyzer/lib/src/plugin/engine_plugin.dart
index eb516de..a067dcc 100644
--- a/pkg/analyzer/lib/src/plugin/engine_plugin.dart
+++ b/pkg/analyzer/lib/src/plugin/engine_plugin.dart
@@ -5,9 +5,15 @@
 library analyzer.src.plugin.engine_plugin;
 
 import 'package:analyzer/plugin/task.dart';
+import 'package:analyzer/src/generated/engine.dart'
+    show InternalAnalysisContext;
+import 'package:analyzer/src/generated/error.dart' show AnalysisError;
 import 'package:analyzer/src/task/dart.dart';
+import 'package:analyzer/src/task/dart_work_manager.dart';
 import 'package:analyzer/src/task/general.dart';
 import 'package:analyzer/src/task/html.dart';
+import 'package:analyzer/src/task/html_work_manager.dart';
+import 'package:analyzer/src/task/options_work_manager.dart';
 import 'package:analyzer/task/model.dart';
 import 'package:plugin/plugin.dart';
 
@@ -18,27 +24,102 @@
 class EnginePlugin implements Plugin {
   /**
    * The simple identifier of the extension point that allows plugins to
+   * register new analysis error results to compute for a Dart source.
+   */
+  static const String DART_ERRORS_FOR_SOURCE_EXTENSION_POINT =
+      'dartErrorsForSource';
+
+  /**
+   * The simple identifier of the extension point that allows plugins to
+   * register new analysis error results to compute for a Dart library
+   * specific unit.
+   */
+  static const String DART_ERRORS_FOR_UNIT_EXTENSION_POINT =
+      'dartErrorsForUnit';
+
+  /**
+   * The simple identifier of the extension point that allows plugins to
+   * register new analysis error results to compute for an HTML source.
+   */
+  static const String HTML_ERRORS_EXTENSION_POINT = 'htmlErrors';
+
+  /**
+   * The simple identifier of the extension point that allows plugins to
    * register new analysis tasks with the analysis engine.
    */
   static const String TASK_EXTENSION_POINT = 'task';
 
   /**
+   * The simple identifier of the extension point that allows plugins to
+   * register new work manager factories with the analysis engine.
+   */
+  static const String WORK_MANAGER_FACTORY_EXTENSION_POINT =
+      'workManagerFactory';
+
+  /**
    * The unique identifier of this plugin.
    */
   static const String UNIQUE_IDENTIFIER = 'analysis_engine.core';
 
   /**
+   * The extension point that allows plugins to register new analysis error
+   * results for a Dart source.
+   */
+  ExtensionPoint dartErrorsForSourceExtensionPoint;
+
+  /**
+   * The extension point that allows plugins to register new analysis error
+   * results for a Dart library specific unit.
+   */
+  ExtensionPoint dartErrorsForUnitExtensionPoint;
+
+  /**
+   * The extension point that allows plugins to register new analysis error
+   * results for an HTML source.
+   */
+  ExtensionPoint htmlErrorsExtensionPoint;
+
+  /**
    * The extension point that allows plugins to register new analysis tasks with
    * the analysis engine.
    */
   ExtensionPoint taskExtensionPoint;
 
   /**
+   * The extension point that allows plugins to register new work manager
+   * factories with the analysis engine.
+   */
+  ExtensionPoint workManagerFactoryExtensionPoint;
+
+  /**
    * Initialize a newly created plugin.
    */
   EnginePlugin();
 
   /**
+   * Return a list containing all of the contributed analysis error result
+   * descriptors for Dart sources.
+   */
+  @ExtensionPointId('DART_ERRORS_FOR_SOURCE_EXTENSION_POINT_ID')
+  List<ResultDescriptor> get dartErrorsForSource =>
+      dartErrorsForSourceExtensionPoint.extensions;
+
+  /**
+   * Return a list containing all of the contributed analysis error result
+   * descriptors for Dart library specific units.
+   */
+  @ExtensionPointId('DART_ERRORS_FOR_UNIT_EXTENSION_POINT_ID')
+  List<ResultDescriptor> get dartErrorsForUnit =>
+      dartErrorsForUnitExtensionPoint.extensions;
+
+  /**
+   * Return a list containing all of the contributed analysis error result
+   * descriptors for HTML sources.
+   */
+  @ExtensionPointId('HTML_ERRORS_EXTENSION_POINT_ID')
+  List<ResultDescriptor> get htmlErrors => htmlErrorsExtensionPoint.extensions;
+
+  /**
    * Return a list containing all of the task descriptors that were contributed.
    */
   List<TaskDescriptor> get taskDescriptors => taskExtensionPoint.extensions;
@@ -46,14 +127,55 @@
   @override
   String get uniqueIdentifier => UNIQUE_IDENTIFIER;
 
+  /**
+   * Return a list containing all of the work manager factories that were
+   * contributed.
+   */
+  List<WorkManagerFactory> get workManagerFactories =>
+      workManagerFactoryExtensionPoint.extensions;
+
   @override
   void registerExtensionPoints(RegisterExtensionPoint registerExtensionPoint) {
+    dartErrorsForSourceExtensionPoint = registerExtensionPoint(
+        DART_ERRORS_FOR_SOURCE_EXTENSION_POINT,
+        _validateAnalysisErrorListResultDescriptor);
+    dartErrorsForUnitExtensionPoint = registerExtensionPoint(
+        DART_ERRORS_FOR_UNIT_EXTENSION_POINT,
+        _validateAnalysisErrorListResultDescriptor);
+    htmlErrorsExtensionPoint = registerExtensionPoint(
+        HTML_ERRORS_EXTENSION_POINT,
+        _validateAnalysisErrorListResultDescriptor);
     taskExtensionPoint =
         registerExtensionPoint(TASK_EXTENSION_POINT, _validateTaskExtension);
+    workManagerFactoryExtensionPoint = registerExtensionPoint(
+        WORK_MANAGER_FACTORY_EXTENSION_POINT,
+        _validateWorkManagerFactoryExtension);
   }
 
   @override
   void registerExtensions(RegisterExtension registerExtension) {
+    _registerTaskExtensions(registerExtension);
+    _registerWorkManagerFactoryExtensions(registerExtension);
+    _registerDartErrorsForSource(registerExtension);
+    _registerDartErrorsForUnit(registerExtension);
+    _registerHtmlErrors(registerExtension);
+  }
+
+  void _registerDartErrorsForSource(RegisterExtension registerExtension) {
+    registerExtension(DART_ERRORS_FOR_SOURCE_EXTENSION_POINT_ID, PARSE_ERRORS);
+    registerExtension(DART_ERRORS_FOR_SOURCE_EXTENSION_POINT_ID, SCAN_ERRORS);
+  }
+
+  void _registerDartErrorsForUnit(RegisterExtension registerExtension) {
+    registerExtension(
+        DART_ERRORS_FOR_UNIT_EXTENSION_POINT_ID, LIBRARY_UNIT_ERRORS);
+  }
+
+  void _registerHtmlErrors(RegisterExtension registerExtension) {
+    registerExtension(HTML_ERRORS_EXTENSION_POINT_ID, HTML_DOCUMENT_ERRORS);
+  }
+
+  void _registerTaskExtensions(RegisterExtension registerExtension) {
     String taskId = TASK_EXTENSION_POINT_ID;
     //
     // Register general tasks.
@@ -69,25 +191,39 @@
     registerExtension(taskId, BuildLibraryElementTask.DESCRIPTOR);
     registerExtension(taskId, BuildPublicNamespaceTask.DESCRIPTOR);
     registerExtension(taskId, BuildSourceExportClosureTask.DESCRIPTOR);
-    registerExtension(taskId, BuildSourceImportExportClosureTask.DESCRIPTOR);
     registerExtension(taskId, BuildTypeProviderTask.DESCRIPTOR);
     registerExtension(taskId, ComputeConstantDependenciesTask.DESCRIPTOR);
     registerExtension(taskId, ComputeConstantValueTask.DESCRIPTOR);
+    registerExtension(
+        taskId, ComputeInferableStaticVariableDependenciesTask.DESCRIPTOR);
+    registerExtension(taskId, ComputeLibraryCycleTask.DESCRIPTOR);
     registerExtension(taskId, ContainingLibrariesTask.DESCRIPTOR);
     registerExtension(taskId, DartErrorsTask.DESCRIPTOR);
     registerExtension(taskId, EvaluateUnitConstantsTask.DESCRIPTOR);
     registerExtension(taskId, GatherUsedImportedElementsTask.DESCRIPTOR);
     registerExtension(taskId, GatherUsedLocalElementsTask.DESCRIPTOR);
     registerExtension(taskId, GenerateHintsTask.DESCRIPTOR);
+    registerExtension(taskId, GenerateLintsTask.DESCRIPTOR);
+    registerExtension(taskId, InferInstanceMembersInUnitTask.DESCRIPTOR);
+    registerExtension(taskId, InferStaticVariableTypesInUnitTask.DESCRIPTOR);
+    registerExtension(taskId, InferStaticVariableTypeTask.DESCRIPTOR);
     registerExtension(taskId, LibraryErrorsReadyTask.DESCRIPTOR);
     registerExtension(taskId, LibraryUnitErrorsTask.DESCRIPTOR);
     registerExtension(taskId, ParseDartTask.DESCRIPTOR);
+    registerExtension(taskId, PartiallyResolveUnitReferencesTask.DESCRIPTOR);
+    registerExtension(taskId, ReadyLibraryElement2Task.DESCRIPTOR);
+    registerExtension(taskId, ReadyLibraryElement5Task.DESCRIPTOR);
+    registerExtension(taskId, ReadyResolvedUnitTask.DESCRIPTOR);
+    registerExtension(taskId, ReadyResolvedUnit9Task.DESCRIPTOR);
+    registerExtension(taskId, ReadyResolvedUnit10Task.DESCRIPTOR);
+    registerExtension(taskId, ResolveInstanceFieldsInUnitTask.DESCRIPTOR);
     registerExtension(taskId, ResolveLibraryReferencesTask.DESCRIPTOR);
     registerExtension(taskId, ResolveLibraryTypeNamesTask.DESCRIPTOR);
-    registerExtension(taskId, ResolveUnitReferencesTask.DESCRIPTOR);
+    registerExtension(taskId, ResolveUnitTask.DESCRIPTOR);
     registerExtension(taskId, ResolveUnitTypeNamesTask.DESCRIPTOR);
     registerExtension(taskId, ResolveVariableReferencesTask.DESCRIPTOR);
     registerExtension(taskId, ScanDartTask.DESCRIPTOR);
+    registerExtension(taskId, StrongModeVerifyUnitTask.DESCRIPTOR);
     registerExtension(taskId, VerifyUnitTask.DESCRIPTOR);
     //
     // Register HTML tasks.
@@ -97,9 +233,32 @@
     registerExtension(taskId, ParseHtmlTask.DESCRIPTOR);
   }
 
+  void _registerWorkManagerFactoryExtensions(
+      RegisterExtension registerExtension) {
+    String taskId = WORK_MANAGER_EXTENSION_POINT_ID;
+    registerExtension(taskId,
+        (InternalAnalysisContext context) => new DartWorkManager(context));
+    registerExtension(taskId,
+        (InternalAnalysisContext context) => new HtmlWorkManager(context));
+    registerExtension(taskId,
+        (InternalAnalysisContext context) => new OptionsWorkManager(context));
+  }
+
   /**
-   * Validate the given extension by throwing an [ExtensionError] if it is not a
-   * valid domain.
+   * Validate the given extension by throwing an [ExtensionError] if it is not
+   * a [ListResultDescriptor] of [AnalysisError]s.
+   */
+  void _validateAnalysisErrorListResultDescriptor(Object extension) {
+    if (extension is! ListResultDescriptor<AnalysisError>) {
+      String id = taskExtensionPoint.uniqueIdentifier;
+      throw new ExtensionError(
+          'Extensions to $id must be a ListResultDescriptor<AnalysisError>');
+    }
+  }
+
+  /**
+   * Validate the given extension by throwing an [ExtensionError] if it is not
+   * a [TaskDescriptor].
    */
   void _validateTaskExtension(Object extension) {
     if (extension is! TaskDescriptor) {
@@ -107,4 +266,30 @@
       throw new ExtensionError('Extensions to $id must be a TaskDescriptor');
     }
   }
+
+  /**
+   * Validate the given extension by throwing an [ExtensionError] if it is not
+   * a [WorkManagerFactory].
+   */
+  void _validateWorkManagerFactoryExtension(Object extension) {
+    if (extension is! WorkManagerFactory) {
+      String id = taskExtensionPoint.uniqueIdentifier;
+      throw new ExtensionError(
+          'Extensions to $id must be a WorkManagerFactory');
+    }
+  }
+}
+
+/**
+ * Annotation describing the relationship between a getter in [EnginePlugin]
+ * and the associated identifier (in '../../plugin/task.dart') which can be
+ * passed to the extension manager to populate it.
+ *
+ * This annotation is not used at runtime; it is used to aid in static analysis
+ * of the task model during development.
+ */
+class ExtensionPointId {
+  final String extensionPointId;
+
+  const ExtensionPointId(this.extensionPointId);
 }
diff --git a/pkg/analyzer/lib/src/plugin/options_plugin.dart b/pkg/analyzer/lib/src/plugin/options_plugin.dart
index 1dea284..6e0ebd6 100644
--- a/pkg/analyzer/lib/src/plugin/options_plugin.dart
+++ b/pkg/analyzer/lib/src/plugin/options_plugin.dart
@@ -5,26 +5,40 @@
 library analyzer.src.plugin.options;
 
 import 'package:analyzer/plugin/options.dart';
+import 'package:analyzer/plugin/task.dart';
+import 'package:analyzer/src/task/options.dart';
 import 'package:plugin/plugin.dart';
 
 /// A plugin that defines the extension points and extensions that are defined
 /// by applications that want to consume options defined in the analysis
 /// options file.
 class OptionsPlugin implements Plugin {
-
   /// The simple identifier of the extension point that allows plugins to
   /// register new options processors.
   static const String OPTIONS_PROCESSOR_EXTENSION_POINT = 'optionsProcessor';
 
+  /// The simple identifier of the extension point that allows plugins to
+  /// register new options validators.
+  static const String OPTIONS_VALIDATOR_EXTENSION_POINT = 'optionsValidator';
+
   /// The unique identifier of this plugin.
   static const String UNIQUE_IDENTIFIER = 'options.core';
 
-  /// The extension point that allows plugins to register new options processors.
+  /// The extension point that allows plugins to register new options
+  /// processors.
   ExtensionPoint optionsProcessorExtensionPoint;
 
+  /// The extension point that allows plugins to register new options
+  /// validators.
+  ExtensionPoint optionsValidatorExtensionPoint;
+
   /// All contributed options processors.
   List<OptionsProcessor> get optionsProcessors =>
-      optionsProcessorExtensionPoint.extensions;
+      optionsProcessorExtensionPoint?.extensions ?? const [];
+
+  /// All contributed options validators.
+  List<OptionsValidator> get optionsValidators =>
+      optionsValidatorExtensionPoint?.extensions ?? const [];
 
   @override
   String get uniqueIdentifier => UNIQUE_IDENTIFIER;
@@ -33,19 +47,35 @@
   void registerExtensionPoints(RegisterExtensionPoint registerExtensionPoint) {
     optionsProcessorExtensionPoint = registerExtensionPoint(
         OPTIONS_PROCESSOR_EXTENSION_POINT, _validateOptionsProcessorExtension);
+    optionsValidatorExtensionPoint = registerExtensionPoint(
+        OPTIONS_VALIDATOR_EXTENSION_POINT, _validateOptionsValidatorExtension);
   }
 
   @override
   void registerExtensions(RegisterExtension registerExtension) {
-    // There are no default extensions.
+    // Analyze options files.
+    registerExtension(
+        TASK_EXTENSION_POINT_ID, GenerateOptionsErrorsTask.DESCRIPTOR);
+    // Validate analyzer analysis options.
+    registerExtension(
+        OPTIONS_VALIDATOR_EXTENSION_POINT_ID, new AnalyzerOptionsValidator());
   }
 
-  /// Validate the given extension by throwing an [ExtensionError] if it is not a
-  /// valid options processor.
+  /// Validate the given extension by throwing an [ExtensionError] if it is not
+  /// a valid options processor.
   void _validateOptionsProcessorExtension(Object extension) {
     if (extension is! OptionsProcessor) {
       String id = optionsProcessorExtensionPoint.uniqueIdentifier;
       throw new ExtensionError('Extensions to $id must be an OptionsProcessor');
     }
   }
+
+  /// Validate the given extension by throwing an [ExtensionError] if it is not
+  /// a valid options validator.
+  void _validateOptionsValidatorExtension(Object extension) {
+    if (extension is! OptionsValidator) {
+      String id = optionsValidatorExtensionPoint.uniqueIdentifier;
+      throw new ExtensionError('Extensions to $id must be an OptionsValidator');
+    }
+  }
 }
diff --git a/pkg/analyzer/lib/src/plugin/plugin_configuration.dart b/pkg/analyzer/lib/src/plugin/plugin_configuration.dart
new file mode 100644
index 0000000..9365a3c
--- /dev/null
+++ b/pkg/analyzer/lib/src/plugin/plugin_configuration.dart
@@ -0,0 +1,198 @@
+// 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.src.plugin.plugin_configuration;
+
+import 'package:analyzer/plugin/options.dart';
+import 'package:analyzer/src/generated/engine.dart';
+import 'package:yaml/yaml.dart';
+
+const _analyzerOptionScope = 'analyzer';
+
+const _pluginOptionScope = 'plugins';
+
+/// Parse the given string into a plugin manifest.
+PluginManifest parsePluginManifestString(String manifestSource) {
+  var yaml = loadYaml(manifestSource);
+  if (yaml == null) {
+    return null;
+  }
+  _verifyMap(yaml, 'plugin manifest');
+  Iterable<String> pluginHost = _parseHosts(yaml['contributes_to']);
+  PluginInfo plugin = _parsePlugin(yaml);
+  return new PluginManifest(contributesTo: pluginHost, plugin: plugin);
+}
+
+String _asString(dynamic yaml) {
+  if (yaml != null && yaml is! String) {
+    throw new PluginConfigFormatException(
+        'Unable to parse pugin manifest, '
+        'expected `String`, got `${yaml.runtimeType}`',
+        yaml);
+  }
+  return yaml;
+}
+
+Iterable<String> _parseHosts(dynamic yaml) {
+  List<String> hosts = <String>[];
+  if (yaml is String) {
+    hosts.add(yaml);
+  } else if (yaml is YamlList) {
+    yaml.forEach((h) => hosts.add(_asString(h)));
+  }
+  return hosts;
+}
+
+PluginInfo _parsePlugin(dynamic yaml) {
+  if (yaml != null) {
+    _verifyMap(yaml, 'plugin manifest');
+    return new PluginInfo._fromYaml(details: yaml);
+  }
+  return null;
+}
+
+PluginInfo _processPluginMapping(dynamic name, dynamic details) {
+  if (name is String) {
+    if (details is String) {
+      return new PluginInfo(name: name, version: details);
+    }
+    if (details is YamlMap) {
+      return new PluginInfo._fromYaml(name: name, details: details);
+    }
+  }
+
+  return null;
+}
+
+_verifyMap(dynamic yaml, String context) {
+  if (yaml is! YamlMap) {
+    throw new PluginConfigFormatException(
+        'Unable to parse $context, '
+        'expected `YamlMap`, got `${yaml.runtimeType}`',
+        yaml);
+  }
+}
+
+/// A callback for error handling.
+typedef ErrorHandler(Exception e);
+
+/// Describes plugin configuration information as extracted from an
+/// analysis options map or plugin manifest.
+class PluginConfig {
+  final Iterable<PluginInfo> plugins;
+  PluginConfig(this.plugins);
+
+  /// Create a plugin configuration from an options map.
+  factory PluginConfig.fromOptions(Map<String, YamlNode> options) {
+    List<PluginInfo> plugins = [];
+    var analyzerOptions = options[_analyzerOptionScope];
+    if (analyzerOptions != null) {
+      if (analyzerOptions is YamlMap) {
+        var pluginConfig = analyzerOptions[_pluginOptionScope];
+        if (pluginConfig is YamlMap) {
+          pluginConfig.forEach((name, details) {
+            var plugin = _processPluginMapping(name, details);
+            if (plugin != null) {
+              plugins.add(plugin);
+            }
+          });
+        } else {
+          // Anything but an empty list of plugins is treated as a format error.
+          if (pluginConfig != null) {
+            throw new PluginConfigFormatException(
+                'Unrecognized plugin config format, expected `YamlMap`, '
+                'got `${pluginConfig.runtimeType}`',
+                pluginConfig);
+          }
+        }
+      }
+    }
+
+    return new PluginConfig(plugins);
+  }
+}
+
+/// Thrown on bad plugin config format.
+class PluginConfigFormatException implements Exception {
+  /// Descriptive message.
+  final message;
+
+  /// The `plugin:` yaml node for generating detailed error feedback.
+  final yamlNode;
+  PluginConfigFormatException(this.message, this.yamlNode);
+}
+
+/// Extracts plugin config details from analysis options.
+class PluginConfigOptionsProcessor extends OptionsProcessor {
+  final ErrorHandler _errorHandler;
+
+  PluginConfig _config;
+
+  PluginConfigOptionsProcessor([this._errorHandler]);
+
+  /// The processed plugin config.
+  PluginConfig get config => _config;
+
+  @override
+  void onError(Exception exception) {
+    if (_errorHandler != null) {
+      _errorHandler(exception);
+    }
+  }
+
+  @override
+  void optionsProcessed(
+      AnalysisContext context, Map<String, YamlNode> options) {
+    _config = new PluginConfig.fromOptions(options);
+  }
+}
+
+/// Describes plugin information.
+class PluginInfo {
+  final String name;
+  final String className;
+  final String version;
+  final String libraryUri;
+  final String packageName;
+  final String path;
+  PluginInfo(
+      {this.name,
+      this.version,
+      this.className,
+      this.libraryUri,
+      this.packageName,
+      this.path});
+
+  factory PluginInfo._fromYaml({String name, YamlMap details}) =>
+      new PluginInfo(
+          name: name,
+          version: _asString(details['version']),
+          className: _asString(details['class_name']),
+          libraryUri: _asString(details['library_uri']),
+          packageName: _asString(details['package_name']),
+          path: _asString(details['path']));
+}
+
+/// Plugin manifests accompany plugin packages, providing
+/// configuration information for published plugins.
+///
+/// Provisionally, plugin manifests live in a file `plugin.yaml`
+/// at the root of the plugin package.
+///
+///     my_plugin/
+///       bin/
+///       lib/
+///       plugin.yaml
+///       pubspec.yaml
+///
+/// Provisional manifest file format:
+///
+///     class_name: MyAnalyzerPlugin
+///     library_uri: 'my_plugin/my_analyzer_plugin.dart'
+///     contributes_to: analyzer
+class PluginManifest {
+  PluginInfo plugin;
+  Iterable<String> contributesTo;
+  PluginManifest({this.plugin, this.contributesTo});
+}
diff --git a/pkg/analyzer/lib/src/services/lint.dart b/pkg/analyzer/lib/src/services/lint.dart
index 9dd51a0..a6b55cc 100644
--- a/pkg/analyzer/lib/src/services/lint.dart
+++ b/pkg/analyzer/lib/src/services/lint.dart
@@ -9,6 +9,25 @@
 import 'package:analyzer/src/generated/error.dart';
 import 'package:analyzer/src/generated/source.dart';
 import 'package:analyzer/src/generated/visitors.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);
+
+/// 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;
+
+/// Associate these [lints] with the given [context].
+void setLints(AnalysisContext context, List<Linter> lints) {
+  context.setConfigurationData(CONFIGURED_LINTS_KEY, lints);
+}
 
 /// Implementers contribute lint warnings via the provided error [reporter].
 abstract class Linter {
@@ -27,9 +46,7 @@
 ///
 /// See [LintCode].
 class LintGenerator {
-
-  /// A global container for contributed linters.
-  static final List<Linter> LINTERS = <Linter>[];
+  static const List<Linter> _noLints = const <Linter>[];
 
   final Iterable<CompilationUnit> _compilationUnits;
   final AnalysisErrorListener _errorListener;
@@ -37,7 +54,7 @@
 
   LintGenerator(this._compilationUnits, this._errorListener,
       [Iterable<Linter> linters])
-      : _linters = linters != null ? linters : LINTERS;
+      : _linters = linters ?? _noLints;
 
   void generate() {
     PerformanceStatistics.lint.makeCurrentWhile(() {
diff --git a/pkg/analyzer/lib/src/task/dart.dart b/pkg/analyzer/lib/src/task/dart.dart
index 6e3f7a4..9eca05f 100644
--- a/pkg/analyzer/lib/src/task/dart.dart
+++ b/pkg/analyzer/lib/src/task/dart.dart
@@ -14,17 +14,24 @@
     hide AnalysisCache, AnalysisTask;
 import 'package:analyzer/src/generated/error.dart';
 import 'package:analyzer/src/generated/error_verifier.dart';
+import 'package:analyzer/src/generated/incremental_resolver.dart';
 import 'package:analyzer/src/generated/java_engine.dart';
 import 'package:analyzer/src/generated/parser.dart';
 import 'package:analyzer/src/generated/resolver.dart';
 import 'package:analyzer/src/generated/scanner.dart';
 import 'package:analyzer/src/generated/sdk.dart';
 import 'package:analyzer/src/generated/source.dart';
+import 'package:analyzer/src/generated/visitors.dart';
+import 'package:analyzer/src/plugin/engine_plugin.dart';
+import 'package:analyzer/src/services/lint.dart';
 import 'package:analyzer/src/task/driver.dart';
 import 'package:analyzer/src/task/general.dart';
 import 'package:analyzer/src/task/html.dart';
 import 'package:analyzer/src/task/inputs.dart';
 import 'package:analyzer/src/task/model.dart';
+import 'package:analyzer/src/task/strong/checker.dart';
+import 'package:analyzer/src/task/strong/rules.dart';
+import 'package:analyzer/src/task/strong_mode.dart';
 import 'package:analyzer/task/dart.dart';
 import 'package:analyzer/task/general.dart';
 import 'package:analyzer/task/model.dart';
@@ -36,6 +43,18 @@
     const SimpleResultCachingPolicy(8192, 8192);
 
 /**
+ * The [ResultCachingPolicy] for [Element]s.
+ */
+const ResultCachingPolicy ELEMENT_CACHING_POLICY =
+    const SimpleResultCachingPolicy(-1, -1);
+
+/**
+ * The [ResultCachingPolicy] for [TOKEN_STREAM].
+ */
+const ResultCachingPolicy TOKEN_STREAM_CACHING_POLICY =
+    const SimpleResultCachingPolicy(1, 1);
+
+/**
  * The errors produced while resolving a library directives.
  *
  * The list will be empty if there were no errors, but will not be `null`.
@@ -62,8 +81,11 @@
  * constants defined at top level, statically inside classes, and local to
  * functions, as well as constant constructors, annotations, and default values
  * of parameters to constant constructors.
+ *
+ * The result is only available for [LibrarySpecificUnit]s.
  */
-final ListResultDescriptor<ConstantEvaluationTarget> COMPILATION_UNIT_CONSTANTS =
+final ListResultDescriptor<
+        ConstantEvaluationTarget> COMPILATION_UNIT_CONSTANTS =
     new ListResultDescriptor<ConstantEvaluationTarget>(
         'COMPILATION_UNIT_CONSTANTS', null,
         cachingPolicy: ELEMENT_CACHING_POLICY);
@@ -94,6 +116,9 @@
  * A [ConstantEvaluationTarget] that has been successfully constant-evaluated.
  *
  * TODO(paulberry): is ELEMENT_CACHING_POLICY the correct caching policy?
+ *
+ * The result is only available for [ConstantEvaluationTarget]s.
+ *
  */
 final ResultDescriptor<ConstantEvaluationTarget> CONSTANT_VALUE =
     new ResultDescriptor<ConstantEvaluationTarget>('CONSTANT_VALUE', null,
@@ -108,12 +133,6 @@
     new ListResultDescriptor<Source>('CONTAINING_LIBRARIES', Source.EMPTY_LIST);
 
 /**
- * The [ResultCachingPolicy] for [Element]s.
- */
-const ResultCachingPolicy ELEMENT_CACHING_POLICY =
-    const SimpleResultCachingPolicy(-1, -1);
-
-/**
  * The sources representing the export closure of a library.
  * The [Source]s include only library sources, not their units.
  *
@@ -134,13 +153,76 @@
         'HINT_ERRORS', AnalysisError.NO_ERRORS);
 
 /**
- * The sources representing the combined import/export closure of a library.
- * The [Source]s include only library sources, not their units.
+ * A list of the [VariableElement]s whose type should be inferred that another
+ * inferable static variable (the target) depends on.
  *
- * The result is only available for [Source]s representing a library.
+ * The result is only available for [VariableElement]s, and only when strong
+ * mode is enabled.
  */
-final ListResultDescriptor<Source> IMPORT_EXPORT_SOURCE_CLOSURE =
-    new ListResultDescriptor<Source>('IMPORT_EXPORT_SOURCE_CLOSURE', null);
+final ListResultDescriptor<
+        VariableElement> INFERABLE_STATIC_VARIABLE_DEPENDENCIES =
+    new ListResultDescriptor<VariableElement>(
+        'INFERABLE_STATIC_VARIABLE_DEPENDENCIES', null);
+
+/**
+ * A list of the [VariableElement]s defined in a unit whose type should be
+ * inferred. This includes variables defined at the library level as well as
+ * static members inside classes.
+ *
+ * The result is only available for [LibrarySpecificUnit]s, and only when strong
+ * mode is enabled.
+ */
+final ListResultDescriptor<VariableElement> INFERABLE_STATIC_VARIABLES_IN_UNIT =
+    new ListResultDescriptor<VariableElement>(
+        'INFERABLE_STATIC_VARIABLES_IN_UNIT', null);
+
+/**
+ * An inferable static variable ([VariableElement]) whose type has been
+ * inferred.
+ *
+ * The result is only available for [VariableElement]s, and only when strong
+ * mode is enabled.
+ */
+final ResultDescriptor<VariableElement> INFERRED_STATIC_VARIABLE =
+    new ResultDescriptor<VariableElement>('INFERRED_STATIC_VARIABLE', null,
+        cachingPolicy: ELEMENT_CACHING_POLICY);
+
+/**
+ * A list of the [LibraryElement]s that make up the strongly connected
+ * component in the import/export graph in which the target resides.
+ *
+ * Only non-empty in strongMode.
+ *
+ * The result is only available for [LibrarySpecificUnit]s.
+ */
+final ListResultDescriptor<LibraryElement> LIBRARY_CYCLE =
+    new ListResultDescriptor<LibraryElement>('LIBRARY_CYCLE', null);
+
+/**
+ * A list of the [CompilationUnitElement]s that comprise all of the parts and
+ * libraries in the direct import/export dependencies of the library cycle
+ * of the target, with the intra-component dependencies excluded.
+ *
+ * Only non-empty in strongMode.
+ *
+ * The result is only available for [LibrarySpecificUnit]s.
+ */
+final ListResultDescriptor<CompilationUnitElement> LIBRARY_CYCLE_DEPENDENCIES =
+    new ListResultDescriptor<CompilationUnitElement>(
+        'LIBRARY_CYCLE_DEPENDENCIES', null);
+
+/**
+ * A list of the [CompilationUnitElement]s (including all parts) that make up
+ * the strongly connected component in the import/export graph in which the
+ * target resides.
+ *
+ * Only non-empty in strongMode.
+ *
+ * The result is only available for [LibrarySpecificUnit]s.
+ */
+final ListResultDescriptor<CompilationUnitElement> LIBRARY_CYCLE_UNITS =
+    new ListResultDescriptor<CompilationUnitElement>(
+        'LIBRARY_CYCLE_UNITS', null);
 
 /**
  * The partial [LibraryElement] associated with a library.
@@ -213,6 +295,18 @@
     new ResultDescriptor<bool>('LIBRARY_ERRORS_READY', false);
 
 /**
+ * The [LibrarySpecificUnit]s that a library consists of.
+ *
+ * The list will include the defining unit and units for [INCLUDED_PARTS].
+ * So, it is never empty or `null`.
+ *
+ * The result is only available for [Source]s representing a library.
+ */
+final ListResultDescriptor<LibrarySpecificUnit> LIBRARY_SPECIFIC_UNITS =
+    new ListResultDescriptor<LibrarySpecificUnit>(
+        'LIBRARY_SPECIFIC_UNITS', LibrarySpecificUnit.EMPTY_LIST);
+
+/**
  * The analysis errors associated with a compilation unit in a specific library.
  *
  * The result is only available for [LibrarySpecificUnit]s.
@@ -222,6 +316,17 @@
         'LIBRARY_UNIT_ERRORS', AnalysisError.NO_ERRORS);
 
 /**
+ * The errors produced while generating lints for a compilation unit.
+ *
+ * The list will be empty if there were no errors, but will not be `null`.
+ *
+ * The result is only available for [LibrarySpecificUnit]s.
+ */
+final ListResultDescriptor<AnalysisError> LINTS =
+    new ListResultDescriptor<AnalysisError>(
+        'LINT_ERRORS', AnalysisError.NO_ERRORS);
+
+/**
  * The errors produced while parsing a compilation unit.
  *
  * The list will be empty if there were no errors, but will not be `null`.
@@ -233,6 +338,51 @@
         'PARSE_ERRORS', AnalysisError.NO_ERRORS);
 
 /**
+ * The flag specifying that [LIBRARY_ELEMENT2] is ready for a library and its
+ * import/export closure.
+ *
+ * The result is only available for [Source]s representing a library.
+ */
+final ResultDescriptor<bool> READY_LIBRARY_ELEMENT2 =
+    new ResultDescriptor<bool>('READY_LIBRARY_ELEMENT2', false);
+
+/**
+ * The flag specifying that [LIBRARY_ELEMENT5] is ready for a library and its
+ * import/export closure.
+ *
+ * The result is only available for [Source]s representing a library.
+ */
+final ResultDescriptor<bool> READY_LIBRARY_ELEMENT5 =
+    new ResultDescriptor<bool>('READY_LIBRARY_ELEMENT5', false);
+
+/**
+ * The flag specifying that [RESOLVED_UNIT] is ready for all of the units of a
+ * library and its import/export closure.
+ *
+ * The result is only available for [Source]s representing a library.
+ */
+final ResultDescriptor<bool> READY_RESOLVED_UNIT =
+    new ResultDescriptor<bool>('READY_RESOLVED_UNIT', false);
+
+/**
+ * The flag specifying that [RESOLVED_UNIT10] is ready for all of the units of a
+ * library and its import/export closure.
+ *
+ * The result is only available for [Source]s representing a library.
+ */
+final ResultDescriptor<bool> READY_RESOLVED_UNIT10 =
+    new ResultDescriptor<bool>('READY_RESOLVED_UNIT10', false);
+
+/**
+ * The flag specifying that [RESOLVED_UNIT9] is ready for all of the units of a
+ * library and its import/export closure.
+ *
+ * The result is only available for [Source]s representing a library.
+ */
+final ResultDescriptor<bool> READY_RESOLVED_UNIT9 =
+    new ResultDescriptor<bool>('READY_RESOLVED_UNIT9', false);
+
+/**
  * The names (resolved and not) referenced by a unit.
  *
  * The result is only available for [Source]s representing a compilation unit.
@@ -241,17 +391,6 @@
     new ResultDescriptor<ReferencedNames>('REFERENCED_NAMES', null);
 
 /**
- * The errors produced while resolving references.
- *
- * The list will be empty if there were no errors, but will not be `null`.
- *
- * The result is only available for [LibrarySpecificUnit]s.
- */
-final ListResultDescriptor<AnalysisError> RESOLVE_REFERENCES_ERRORS =
-    new ListResultDescriptor<AnalysisError>(
-        'RESOLVE_REFERENCES_ERRORS', AnalysisError.NO_ERRORS);
-
-/**
  * The errors produced while resolving type names.
  *
  * The list will be empty if there were no errors, but will not be `null`.
@@ -263,9 +402,22 @@
         'RESOLVE_TYPE_NAMES_ERRORS', AnalysisError.NO_ERRORS);
 
 /**
- * The partially resolved [CompilationUnit] associated with a unit.
+ * The errors produced while resolving a full compilation unit.
  *
- * All declarations bound to the element defined by the declaration.
+ * The list will be empty if there were no errors, but will not be `null`.
+ *
+ * The result is only available for [LibrarySpecificUnit]s.
+ */
+final ListResultDescriptor<AnalysisError> RESOLVE_UNIT_ERRORS =
+    new ListResultDescriptor<AnalysisError>(
+        'RESOLVE_UNIT_ERRORS', AnalysisError.NO_ERRORS);
+
+/**
+ * The partially resolved [CompilationUnit] associated with a compilation unit.
+ *
+ * Tasks that use this value as an input can assume that the [SimpleIdentifier]s
+ * at all declaration sites have been bound to the element defined by the
+ * declaration, except for the constants defined in an 'enum' declaration.
  *
  * The result is only available for [LibrarySpecificUnit]s.
  */
@@ -274,9 +426,21 @@
         cachingPolicy: AST_CACHING_POLICY);
 
 /**
- * The partially resolved [CompilationUnit] associated with a unit.
+ * The resolved [CompilationUnit] associated with a compilation unit, with
+ * constants resolved.
  *
- * All the enum member elements are built.
+ * The result is only available for [LibrarySpecificUnit]s.
+ */
+final ResultDescriptor<CompilationUnit> RESOLVED_UNIT10 =
+    new ResultDescriptor<CompilationUnit>('RESOLVED_UNIT10', null,
+        cachingPolicy: AST_CACHING_POLICY);
+
+/**
+ * The partially resolved [CompilationUnit] associated with a compilation unit.
+ *
+ * Tasks that use this value as an input can assume that the [SimpleIdentifier]s
+ * at all declaration sites have been bound to the element defined by the
+ * declaration, including the constants defined in an 'enum' declaration.
  *
  * The result is only available for [LibrarySpecificUnit]s.
  */
@@ -285,9 +449,12 @@
         cachingPolicy: AST_CACHING_POLICY);
 
 /**
- * The partially resolved [CompilationUnit] associated with a unit.
+ * The partially resolved [CompilationUnit] associated with a compilation unit.
  *
- * [RESOLVED_UNIT2] with resolved type names.
+ * In addition to what is true of a [RESOLVED_UNIT2], tasks that use this value
+ * as an input can assume that the types associated with declarations have been
+ * resolved. This includes the types of superclasses, mixins, interfaces,
+ * fields, return types, parameters, and local variables.
  *
  * The result is only available for [LibrarySpecificUnit]s.
  */
@@ -296,9 +463,11 @@
         cachingPolicy: AST_CACHING_POLICY);
 
 /**
- * The partially resolved [CompilationUnit] associated with a unit.
+ * The partially resolved [CompilationUnit] associated with a compilation unit.
  *
- * [RESOLVED_UNIT3] plus resolved local variables and formal parameters.
+ * In addition to what is true of a [RESOLVED_UNIT3], tasks that use this value
+ * as an input can assume that references to local variables and formal
+ * parameters have been resolved.
  *
  * The result is only available for [LibrarySpecificUnit]s.
  */
@@ -307,8 +476,12 @@
         cachingPolicy: AST_CACHING_POLICY);
 
 /**
- * The resolved [CompilationUnit] associated with a compilation unit, with
- * constants not yet resolved.
+ * The partially resolved [CompilationUnit] associated with a compilation unit.
+ *
+ * In addition to what is true of a [RESOLVED_UNIT4], tasks that use this value
+ * as an input can assume that elements and types associated with expressions
+ * outside of method bodies (essentially initializers) have been initially
+ * resolved.
  *
  * The result is only available for [LibrarySpecificUnit]s.
  */
@@ -317,6 +490,52 @@
         cachingPolicy: AST_CACHING_POLICY);
 
 /**
+ * The partially resolved [CompilationUnit] associated with a compilation unit.
+ *
+ * In addition to what is true of a [RESOLVED_UNIT5], tasks that use this value
+ * as an input can assume that the types of static variables have been inferred.
+ *
+ * The result is only available for [LibrarySpecificUnit]s.
+ */
+final ResultDescriptor<CompilationUnit> RESOLVED_UNIT6 =
+    new ResultDescriptor<CompilationUnit>('RESOLVED_UNIT6', null,
+        cachingPolicy: AST_CACHING_POLICY);
+
+/**
+ * The partially resolved [CompilationUnit] associated with a compilation unit.
+ *
+ * In addition to what is true of a [RESOLVED_UNIT6], tasks that use this value
+ * as an input can assume that the initializers of instance variables have been
+ * re-resolved.
+ *
+ * The result is only available for [LibrarySpecificUnit]s.
+ */
+final ResultDescriptor<CompilationUnit> RESOLVED_UNIT7 =
+    new ResultDescriptor<CompilationUnit>('RESOLVED_UNIT7', null,
+        cachingPolicy: AST_CACHING_POLICY);
+
+/**
+ * The resolved [CompilationUnit] associated with a compilation unit in which
+ * the types of class members have been inferred in addition to everything that
+ * is true of a [RESOLVED_UNIT7].
+ *
+ * The result is only available for [LibrarySpecificUnit]s.
+ */
+final ResultDescriptor<CompilationUnit> RESOLVED_UNIT8 =
+    new ResultDescriptor<CompilationUnit>('RESOLVED_UNIT8', null,
+        cachingPolicy: AST_CACHING_POLICY);
+
+/**
+ * The resolved [CompilationUnit] associated with a compilation unit, with
+ * constants not yet resolved.
+ *
+ * The result is only available for [LibrarySpecificUnit]s.
+ */
+final ResultDescriptor<CompilationUnit> RESOLVED_UNIT9 =
+    new ResultDescriptor<CompilationUnit>('RESOLVED_UNIT9', null,
+        cachingPolicy: AST_CACHING_POLICY);
+
+/**
  * The errors produced while scanning a compilation unit.
  *
  * The list will be empty if there were no errors, but will not be `null`.
@@ -328,10 +547,18 @@
         'SCAN_ERRORS', AnalysisError.NO_ERRORS);
 
 /**
- * The [ResultCachingPolicy] for [TOKEN_STREAM].
+ * The additional strong mode errors produced while verifying a
+ * compilation unit.
+ *
+ * The list will be empty if there were no errors, but will not be `null`.
+ *
+ * The result is only available for [LibrarySpecificUnits]s representing a
+ * compilation unit.
+ *
  */
-const ResultCachingPolicy TOKEN_STREAM_CACHING_POLICY =
-    const SimpleResultCachingPolicy(1, 1);
+final ListResultDescriptor<AnalysisError> STRONG_MODE_ERRORS =
+    new ListResultDescriptor<AnalysisError>(
+        'STRONG_MODE_ERRORS', AnalysisError.NO_ERRORS);
 
 /**
  * The [TypeProvider] of the [AnalysisContext].
@@ -399,11 +626,12 @@
    * The task descriptor describing this kind of task.
    */
   static final TaskDescriptor DESCRIPTOR = new TaskDescriptor(
-      'BuildCompilationUnitElementTask', createTask, buildInputs,
-      <ResultDescriptor>[
+      'BuildCompilationUnitElementTask',
+      createTask,
+      buildInputs, <ResultDescriptor>[
+    COMPILATION_UNIT_CONSTANTS,
     COMPILATION_UNIT_ELEMENT,
-    RESOLVED_UNIT1,
-    COMPILATION_UNIT_CONSTANTS
+    RESOLVED_UNIT1
   ]);
 
   /**
@@ -428,7 +656,7 @@
     //
     // Build or reuse CompilationUnitElement.
     //
-    unit = AstCloner.clone(unit);
+//    unit = AstCloner.clone(unit);
     AnalysisCache analysisCache =
         (context as InternalAnalysisContext).analysisCache;
     CompilationUnitElement element =
@@ -446,15 +674,14 @@
     ConstantFinder constantFinder =
         new ConstantFinder(context, source, librarySpecificUnit.library);
     unit.accept(constantFinder);
-    List<ConstantEvaluationTarget> constants =
-        new List<ConstantEvaluationTarget>.from(
-            constantFinder.constantsToCompute);
+    List<ConstantEvaluationTarget> constants = new List<
+        ConstantEvaluationTarget>.from(constantFinder.constantsToCompute);
     //
     // Record outputs.
     //
+    outputs[COMPILATION_UNIT_CONSTANTS] = constants;
     outputs[COMPILATION_UNIT_ELEMENT] = element;
     outputs[RESOLVED_UNIT1] = unit;
-    outputs[COMPILATION_UNIT_CONSTANTS] = constants;
   }
 
   /**
@@ -465,7 +692,7 @@
   static Map<String, TaskInput> buildInputs(AnalysisTarget target) {
     LibrarySpecificUnit unit = target;
     return <String, TaskInput>{
-      PARSED_UNIT_INPUT_NAME: PARSED_UNIT.of(unit.unit)
+      PARSED_UNIT_INPUT_NAME: PARSED_UNIT.of(unit.unit, flushOnAccess: true)
     };
   }
 
@@ -521,10 +748,10 @@
    * The task descriptor describing this kind of task.
    */
   static final TaskDescriptor DESCRIPTOR = new TaskDescriptor(
-      'BuildDirectiveElementsTask', createTask, buildInputs, <ResultDescriptor>[
-    LIBRARY_ELEMENT2,
-    BUILD_DIRECTIVES_ERRORS
-  ]);
+      'BuildDirectiveElementsTask',
+      createTask,
+      buildInputs,
+      <ResultDescriptor>[LIBRARY_ELEMENT2, BUILD_DIRECTIVES_ERRORS]);
 
   BuildDirectiveElementsTask(
       InternalAnalysisContext context, AnalysisTarget target)
@@ -585,6 +812,7 @@
             importElement.deferred = importDirective.deferredKeyword != null;
             importElement.combinators = _buildCombinators(importDirective);
             importElement.importedLibrary = importedLibrary;
+            _setDocRange(importElement, importDirective);
             SimpleIdentifier prefixNode = directive.prefix;
             if (prefixNode != null) {
               importElement.prefixOffset = prefixNode.offset;
@@ -626,11 +854,15 @@
             exportElement.uri = exportDirective.uriContent;
             exportElement.combinators = _buildCombinators(exportDirective);
             exportElement.exportedLibrary = exportedLibrary;
+            _setDocRange(exportElement, exportDirective);
             directive.element = exportElement;
             exports.add(exportElement);
             if (exportSourceKindMap[exportedSource] != SourceKind.LIBRARY) {
-              errors.add(new AnalysisError(exportedSource, uriLiteral.offset,
-                  uriLiteral.length, CompileTimeErrorCode.EXPORT_OF_NON_LIBRARY,
+              errors.add(new AnalysisError(
+                  exportedSource,
+                  uriLiteral.offset,
+                  uriLiteral.length,
+                  CompileTimeErrorCode.EXPORT_OF_NON_LIBRARY,
                   [uriLiteral.toSource()]));
             }
           }
@@ -652,6 +884,9 @@
     //
     libraryElement.imports = imports;
     libraryElement.exports = exports;
+    // See commentary in the computation of the LIBRARY_CYCLE result
+    // for details on library cycle invalidation.
+    libraryElement.invalidateLibraryCycles();
     //
     // Record outputs.
     //
@@ -660,6 +895,17 @@
   }
 
   /**
+   * If the given [node] has a documentation comment, remember its range
+   * into the given [element].
+   */
+  void _setDocRange(ElementImpl element, AnnotatedNode node) {
+    Comment comment = node.documentationComment;
+    if (comment != null && comment.isDocumentation) {
+      element.setDocRange(comment.offset, comment.length);
+    }
+  }
+
+  /**
    * 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 library [libSource].
@@ -740,7 +986,9 @@
    * The task descriptor describing this kind of task.
    */
   static final TaskDescriptor DESCRIPTOR = new TaskDescriptor(
-      'BuildEnumMemberElementsTask', createTask, buildInputs,
+      'BuildEnumMemberElementsTask',
+      createTask,
+      buildInputs,
       <ResultDescriptor>[RESOLVED_UNIT2]);
 
   BuildEnumMemberElementsTask(
@@ -801,7 +1049,9 @@
    * The task descriptor describing this kind of task.
    */
   static final TaskDescriptor DESCRIPTOR = new TaskDescriptor(
-      'BuildExportNamespaceTask', createTask, buildInputs,
+      'BuildExportNamespaceTask',
+      createTask,
+      buildInputs,
       <ResultDescriptor>[LIBRARY_ELEMENT4]);
 
   BuildExportNamespaceTask(
@@ -924,6 +1174,7 @@
     //
     // Update "part" directives.
     //
+    LibraryDirective libraryDirective = null;
     LibraryIdentifier libraryNameNode = null;
     String partsLibraryName = _UNKNOWN_LIBRARY_NAME;
     bool hasPartDirective = false;
@@ -934,7 +1185,8 @@
         <CompilationUnitElementImpl>[];
     for (Directive directive in definingCompilationUnit.directives) {
       if (directive is LibraryDirective) {
-        if (libraryNameNode == null) {
+        if (libraryDirective == null) {
+          libraryDirective = directive;
           libraryNameNode = directive.name;
           directivesToResolve.add(directive);
         }
@@ -957,8 +1209,11 @@
             String partLibraryName =
                 _getPartLibraryName(partSource, partUnit, directivesToResolve);
             if (partLibraryName == null) {
-              errors.add(new AnalysisError(librarySource, partUri.offset,
-                  partUri.length, CompileTimeErrorCode.PART_OF_NON_PART,
+              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) {
@@ -967,11 +1222,12 @@
                 partsLibraryName = null;
               }
             } else if (libraryNameNode.name != partLibraryName) {
-              errors.add(new AnalysisError(librarySource, partUri.offset,
-                  partUri.length, StaticWarningCode.PART_OF_DIFFERENT_LIBRARY, [
-                libraryNameNode.name,
-                partLibraryName
-              ]));
+              errors.add(new AnalysisError(
+                  librarySource,
+                  partUri.offset,
+                  partUri.length,
+                  StaticWarningCode.PART_OF_DIFFERENT_LIBRARY,
+                  [libraryNameNode.name, partLibraryName]));
             }
           }
           if (entryPoint == null) {
@@ -1014,6 +1270,9 @@
     if (sourcedCompilationUnits.isNotEmpty) {
       _patchTopLevelAccessors(libraryElement);
     }
+    if (libraryDirective != null) {
+      _setDocRange(libraryElement, libraryDirective);
+    }
     //
     // Record outputs.
     //
@@ -1100,6 +1359,17 @@
   }
 
   /**
+   * If the given [node] has a documentation comment, remember its range
+   * into the given [element].
+   */
+  void _setDocRange(ElementImpl element, AnnotatedNode node) {
+    Comment comment = node.documentationComment;
+    if (comment != null && comment.isDocumentation) {
+      element.setDocRange(comment.offset, comment.length);
+    }
+  }
+
+  /**
    * 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
    * [libSource].
@@ -1138,7 +1408,9 @@
    * The task descriptor describing this kind of task.
    */
   static final TaskDescriptor DESCRIPTOR = new TaskDescriptor(
-      'BuildPublicNamespaceTask', createTask, buildInputs,
+      'BuildPublicNamespaceTask',
+      createTask,
+      buildInputs,
       <ResultDescriptor>[LIBRARY_ELEMENT3]);
 
   BuildPublicNamespaceTask(
@@ -1188,7 +1460,9 @@
    * The task descriptor describing this kind of task.
    */
   static final TaskDescriptor DESCRIPTOR = new TaskDescriptor(
-      'BuildSourceExportClosureTask', createTask, buildInputs,
+      'BuildSourceExportClosureTask',
+      createTask,
+      buildInputs,
       <ResultDescriptor>[EXPORT_SOURCE_CLOSURE]);
 
   BuildSourceExportClosureTask(
@@ -1230,64 +1504,6 @@
 }
 
 /**
- * A task that builds [IMPORT_EXPORT_SOURCE_CLOSURE] of a library, and also
- * sets [IS_CLIENT].
- */
-class BuildSourceImportExportClosureTask extends SourceBasedAnalysisTask {
-  /**
-   * The name of the import/export closure.
-   */
-  static const String IMPORT_EXPORT_INPUT = 'IMPORT_EXPORT_INPUT';
-
-  /**
-   * The task descriptor describing this kind of task.
-   */
-  static final TaskDescriptor DESCRIPTOR = new TaskDescriptor(
-      'BuildSourceImportExportClosureTask', createTask, buildInputs,
-      <ResultDescriptor>[IMPORT_EXPORT_SOURCE_CLOSURE, IS_CLIENT]);
-
-  BuildSourceImportExportClosureTask(
-      InternalAnalysisContext context, AnalysisTarget target)
-      : super(context, target);
-
-  @override
-  TaskDescriptor get descriptor => DESCRIPTOR;
-
-  @override
-  void internalPerform() {
-    List<Source> importExportClosure = getRequiredInput(IMPORT_EXPORT_INPUT);
-    Source htmlSource = context.sourceFactory.forUri(DartSdk.DART_HTML);
-    //
-    // Record outputs.
-    //
-    outputs[IMPORT_EXPORT_SOURCE_CLOSURE] = importExportClosure;
-    outputs[IS_CLIENT] = importExportClosure.contains(htmlSource);
-  }
-
-  /**
-   * 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 library [libSource].
-   */
-  static Map<String, TaskInput> buildInputs(AnalysisTarget target) {
-    Source source = target;
-    return <String, TaskInput>{
-      IMPORT_EXPORT_INPUT:
-          new _ImportExportSourceClosureTaskInput(source, LIBRARY_ELEMENT2)
-    };
-  }
-
-  /**
-   * Create a [BuildSourceImportExportClosureTask] based on the given [target]
-   * in the given [context].
-   */
-  static BuildSourceImportExportClosureTask createTask(
-      AnalysisContext context, AnalysisTarget target) {
-    return new BuildSourceImportExportClosureTask(context, target);
-  }
-}
-
-/**
  * A task that builds [TYPE_PROVIDER] for a context.
  */
 class BuildTypeProviderTask extends SourceBasedAnalysisTask {
@@ -1305,7 +1521,9 @@
    * The task descriptor describing this kind of task.
    */
   static final TaskDescriptor DESCRIPTOR = new TaskDescriptor(
-      'BuildTypeProviderTask', createTask, buildInputs,
+      'BuildTypeProviderTask',
+      createTask,
+      buildInputs,
       <ResultDescriptor>[TYPE_PROVIDER]);
 
   BuildTypeProviderTask(
@@ -1355,17 +1573,14 @@
  */
 class ComputeConstantDependenciesTask extends ConstantEvaluationAnalysisTask {
   /**
-   * The name of the [RESOLVED_UNIT5] input.
-   */
-  static const String UNIT_INPUT = 'UNIT_INPUT';
-
-  /**
    * The name of the [TYPE_PROVIDER] input.
    */
   static const String TYPE_PROVIDER_INPUT = 'TYPE_PROVIDER_INPUT';
 
   static final TaskDescriptor DESCRIPTOR = new TaskDescriptor(
-      'ComputeConstantDependenciesTask', createTask, buildInputs,
+      'ComputeConstantDependenciesTask',
+      createTask,
+      buildInputs,
       <ResultDescriptor>[CONSTANT_DEPENDENCIES]);
 
   ComputeConstantDependenciesTask(
@@ -1380,18 +1595,14 @@
     //
     // Prepare inputs.
     //
-    // Note: UNIT_INPUT is not needed.  It is merely a bookkeeping dependency
-    // to ensure that resolution has occurred before we attempt to determine
-    // constant dependencies.
-    //
     ConstantEvaluationTarget constant = target;
-    AnalysisContext context = constant.context;
     TypeProvider typeProvider = getRequiredInput(TYPE_PROVIDER_INPUT);
     //
     // Compute dependencies.
     //
     List<ConstantEvaluationTarget> dependencies = <ConstantEvaluationTarget>[];
-    new ConstantEvaluationEngine(typeProvider, context.declaredVariables)
+    new ConstantEvaluationEngine(typeProvider, context.declaredVariables,
+            typeSystem: context.typeSystem)
         .computeDependencies(constant, dependencies.add);
     //
     // Record outputs.
@@ -1405,27 +1616,36 @@
    * given [target].
    */
   static Map<String, TaskInput> buildInputs(AnalysisTarget target) {
+    //
+    // TODO(brianwilkerson) I believe that this does not properly guarantee that
+    // all of the constructor initializers that we might encounter have been
+    // copied into the element model. We tried forcing the computation of the
+    // RESOLVED_UNIT9 for each unit reachable from the target's library, but
+    // that had too big a performance impact. We could potentially mitigate the
+    // impact by computing a more accurate list of the sources containing
+    // constructors that are actually referenced, but other approaches should
+    // be considered.
+    //
+    Source librarySource;
     if (target is Element) {
       CompilationUnitElementImpl unit = target
           .getAncestor((Element element) => element is CompilationUnitElement);
-      return <String, TaskInput>{
-        UNIT_INPUT: RESOLVED_UNIT5
-            .of(new LibrarySpecificUnit(unit.librarySource, target.source)),
-        TYPE_PROVIDER_INPUT: TYPE_PROVIDER.of(AnalysisContextTarget.request)
-      };
+      librarySource = unit.librarySource;
     } else if (target is ConstantEvaluationTarget_Annotation) {
-      return <String, TaskInput>{
-        UNIT_INPUT: RESOLVED_UNIT5
-            .of(new LibrarySpecificUnit(target.librarySource, target.source)),
-        TYPE_PROVIDER_INPUT: TYPE_PROVIDER.of(AnalysisContextTarget.request)
-      };
+      librarySource = target.librarySource;
+    } else {
+      throw new AnalysisException(
+          'Cannot build inputs for a ${target.runtimeType}');
     }
-    throw new AnalysisException(
-        'Cannot build inputs for a ${target.runtimeType}');
+    return <String, TaskInput>{
+      'resolvedUnit': RESOLVED_UNIT9
+          .of(new LibrarySpecificUnit(librarySource, target.source)),
+      TYPE_PROVIDER_INPUT: TYPE_PROVIDER.of(AnalysisContextTarget.request)
+    };
   }
 
   /**
-   * Create a [ResolveUnitReferencesTask] based on the given [target] in
+   * Create a [ComputeConstantDependenciesTask] based on the given [target] in
    * the given [context].
    */
   static ComputeConstantDependenciesTask createTask(
@@ -1451,7 +1671,9 @@
   static const String TYPE_PROVIDER_INPUT = 'TYPE_PROVIDER_INPUT';
 
   static final TaskDescriptor DESCRIPTOR = new TaskDescriptor(
-      'ComputeConstantValueTask', createTask, buildInputs,
+      'ComputeConstantValueTask',
+      createTask,
+      buildInputs,
       <ResultDescriptor>[CONSTANT_VALUE]);
 
   ComputeConstantValueTask(
@@ -1480,7 +1702,8 @@
     // cycle.
     //
     ConstantEvaluationEngine constantEvaluationEngine =
-        new ConstantEvaluationEngine(typeProvider, context.declaredVariables);
+        new ConstantEvaluationEngine(typeProvider, context.declaredVariables,
+            typeSystem: context.typeSystem);
     if (dependencyCycle == null) {
       constantEvaluationEngine.computeConstantValue(constant);
     } else {
@@ -1525,6 +1748,198 @@
 }
 
 /**
+ * A task that computes the [INFERABLE_STATIC_VARIABLE_DEPENDENCIES] for a
+ * static variable whose type should be inferred.
+ */
+class ComputeInferableStaticVariableDependenciesTask
+    extends ConstantEvaluationAnalysisTask {
+  /**
+   * The name of the [RESOLVED_UNIT5] input.
+   */
+  static const String UNIT_INPUT = 'UNIT_INPUT';
+
+  static final TaskDescriptor DESCRIPTOR = new TaskDescriptor(
+      'ComputeInferableStaticVariableDependenciesTask',
+      createTask,
+      buildInputs,
+      <ResultDescriptor>[INFERABLE_STATIC_VARIABLE_DEPENDENCIES]);
+
+  ComputeInferableStaticVariableDependenciesTask(
+      InternalAnalysisContext context, VariableElement variable)
+      : super(context, variable);
+
+  @override
+  TaskDescriptor get descriptor => DESCRIPTOR;
+
+  @override
+  void internalPerform() {
+    //
+    // Prepare inputs.
+    //
+    VariableElement variable = target;
+    CompilationUnit unit = getRequiredInput(UNIT_INPUT);
+    //
+    // Compute dependencies.
+    //
+    NodeLocator locator = new NodeLocator(variable.nameOffset);
+    AstNode node = locator.searchWithin(unit);
+    VariableDeclaration declaration =
+        node.getAncestor((AstNode ancestor) => ancestor is VariableDeclaration);
+    if (declaration == null || declaration.name != node) {
+      throw new AnalysisException(
+          "NodeLocator failed to find a variable's declaration");
+    }
+    VariableGatherer gatherer = new VariableGatherer(_isInferableStatic);
+    declaration.initializer.accept(gatherer);
+    //
+    // Record outputs.
+    //
+    outputs[INFERABLE_STATIC_VARIABLE_DEPENDENCIES] = gatherer.results.toList();
+  }
+
+  /**
+   * Return `true` if the given [variable] is a static variable whose type
+   * should be inferred.
+   */
+  bool _isInferableStatic(VariableElement variable) => variable.isStatic &&
+      variable.hasImplicitType &&
+      variable.initializer != null;
+
+  /**
+   * 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].
+   */
+  static Map<String, TaskInput> buildInputs(AnalysisTarget target) {
+    if (target is VariableElement) {
+      CompilationUnitElementImpl unit = target
+          .getAncestor((Element element) => element is CompilationUnitElement);
+      return <String, TaskInput>{
+        UNIT_INPUT: RESOLVED_UNIT5
+            .of(new LibrarySpecificUnit(unit.librarySource, unit.source))
+      };
+    }
+    throw new AnalysisException(
+        'Cannot build inputs for a ${target.runtimeType}');
+  }
+
+  /**
+   * Create a [ComputeInferableStaticVariableDependenciesTask] based on the
+   * given [target] in the given [context].
+   */
+  static ComputeInferableStaticVariableDependenciesTask createTask(
+      AnalysisContext context, AnalysisTarget target) {
+    return new ComputeInferableStaticVariableDependenciesTask(context, target);
+  }
+}
+
+/**
+ * A task that computes the [LIBRARY_CYCLE] for a
+ * library element.  Also computes the [LIBRARY_CYCLE_UNITS] and the
+ * [LIBRARY_CYCLE_DEPENDENCIES].
+ */
+class ComputeLibraryCycleTask extends SourceBasedAnalysisTask {
+  /**
+   * The name of the [LIBRARY_ELEMENT2] input.
+   */
+  static const String LIBRARY_ELEMENT_INPUT = 'LIBRARY_ELEMENT_INPUT';
+
+  static final TaskDescriptor DESCRIPTOR = new TaskDescriptor(
+      'ComputeLibraryCycleForUnitTask',
+      createTask,
+      buildInputs, <ResultDescriptor>[
+    LIBRARY_CYCLE,
+    LIBRARY_CYCLE_UNITS,
+    LIBRARY_CYCLE_DEPENDENCIES
+  ]);
+
+  ComputeLibraryCycleTask(
+      InternalAnalysisContext context, AnalysisTarget target)
+      : super(context, target);
+
+  @override
+  TaskDescriptor get descriptor => DESCRIPTOR;
+
+  @override
+  void internalPerform() {
+    // The computation of library cycles is necessarily non-local, since we
+    // in general have to look at all of the reachable libraries
+    // in order to find the strongly connected components.  Repeating this
+    // computation for every node would be quadratic.  The libraryCycle getter
+    // will avoid this by computing the library cycles for every reachable
+    // library and recording it in the element model.  This means that this
+    // task implicitly produces the output for many other targets.  This
+    // can't be expressed in the task model right now: instead, we just
+    // run tasks for those other targets, and they pick up the recorded
+    // version off of the element model.  Unfortunately, this means that
+    // the task model will not handle the invalidation of the recorded
+    // results for us.  Instead, we must explicitly invalidate the recorded
+    // library cycle information when we add or subtract edges from the
+    // import/export graph.  Any update that changes the
+    // import/export graph will induce a recomputation of the LIBRARY_ELEMENT2
+    // result for the changed node. This recomputation is responsible for
+    // conservatively invalidating the library cycle information recorded
+    // in the element model.  The LIBRARY_CYCLE results that have been cached
+    // by the task model are conservatively invalidated by the
+    // IMPORT_EXPORT_SOURCE_CLOSURE dependency below.  If anything reachable
+    // from a node is changed, its LIBRARY_CYCLE results will be re-computed
+    // here (possibly re-using the result from the element model if invalidation
+    // did not cause it to be erased).  In summary, task model dependencies
+    // on the import/export source closure ensure that this method will be
+    // 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) {
+      LibraryElementImpl library = getRequiredInput(LIBRARY_ELEMENT_INPUT);
+      List<LibraryElement> component = library.libraryCycle;
+      Set<LibraryElement> filter = new Set<LibraryElement>.from(component);
+      Set<CompilationUnitElement> deps = new Set<CompilationUnitElement>();
+      void addLibrary(l) {
+        if (!filter.contains(l)) {
+          deps.addAll(l.units);
+        }
+      }
+      for (LibraryElement l in component) {
+        l.importedLibraries.forEach(addLibrary);
+        l.exportedLibraries.forEach(addLibrary);
+      }
+      //
+      // Record outputs.
+      //
+      outputs[LIBRARY_CYCLE] = component;
+      outputs[LIBRARY_CYCLE_UNITS] = component.expand((l) => l.units).toList();
+      outputs[LIBRARY_CYCLE_DEPENDENCIES] = deps.toList();
+    } else {
+      outputs[LIBRARY_CYCLE] = [];
+      outputs[LIBRARY_CYCLE_UNITS] = [];
+      outputs[LIBRARY_CYCLE_DEPENDENCIES] = [];
+    }
+  }
+
+  /**
+   * 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].
+   */
+  static Map<String, TaskInput> buildInputs(AnalysisTarget target) {
+    LibrarySpecificUnit unit = target;
+    return <String, TaskInput>{
+      LIBRARY_ELEMENT_INPUT: LIBRARY_ELEMENT2.of(unit.library),
+      'resolveReachableLibraries': READY_LIBRARY_ELEMENT2.of(unit.library),
+    };
+  }
+
+  /**
+   * Create a [ComputeLibraryCycleTask] based on the
+   * given [target] in the given [context].
+   */
+  static ComputeLibraryCycleTask createTask(
+      AnalysisContext context, AnalysisTarget target) {
+    return new ComputeLibraryCycleTask(context, target);
+  }
+}
+
+/**
  * A base class for analysis tasks whose target is expected to be a
  * [ConstantEvaluationTarget].
  */
@@ -1565,7 +1980,9 @@
    * The task descriptor describing this kind of task.
    */
   static final TaskDescriptor DESCRIPTOR = new TaskDescriptor(
-      'ContainingLibrariesTask', createTask, buildInputs,
+      'ContainingLibrariesTask',
+      createTask,
+      buildInputs,
       <ResultDescriptor>[CONTAINING_LIBRARIES]);
 
   ContainingLibrariesTask(
@@ -1705,31 +2122,6 @@
  */
 class DartErrorsTask extends SourceBasedAnalysisTask {
   /**
-   * The name of the [BUILD_DIRECTIVES_ERRORS] input.
-   */
-  static const String BUILD_DIRECTIVES_ERRORS_INPUT = 'BUILD_DIRECTIVES_ERRORS';
-
-  /**
-   * The name of the [BUILD_LIBRARY_ERRORS] input.
-   */
-  static const String BUILD_LIBRARY_ERRORS_INPUT = 'BUILD_LIBRARY_ERRORS';
-
-  /**
-   * The name of the [LIBRARY_UNIT_ERRORS] input.
-   */
-  static const String LIBRARY_UNIT_ERRORS_INPUT = 'LIBRARY_UNIT_ERRORS';
-
-  /**
-   * The name of the [PARSE_ERRORS] input.
-   */
-  static const String PARSE_ERRORS_INPUT = 'PARSE_ERRORS';
-
-  /**
-   * The name of the [SCAN_ERRORS] input.
-   */
-  static const String SCAN_ERRORS_INPUT = 'SCAN_ERRORS';
-
-  /**
    * The task descriptor describing this kind of task.
    */
   static final TaskDescriptor DESCRIPTOR = new TaskDescriptor('DartErrorsTask',
@@ -1743,18 +2135,21 @@
 
   @override
   void internalPerform() {
+    List<List<AnalysisError>> errorLists = <List<AnalysisError>>[];
     //
     // Prepare inputs.
     //
-    List<List<AnalysisError>> errorLists = <List<AnalysisError>>[];
-    errorLists.add(getRequiredInput(BUILD_DIRECTIVES_ERRORS_INPUT));
-    errorLists.add(getRequiredInput(BUILD_LIBRARY_ERRORS_INPUT));
-    errorLists.add(getRequiredInput(PARSE_ERRORS_INPUT));
-    errorLists.add(getRequiredInput(SCAN_ERRORS_INPUT));
-    Map<Source, List<AnalysisError>> unitErrors =
-        getRequiredInput(LIBRARY_UNIT_ERRORS_INPUT);
-    for (List<AnalysisError> errors in unitErrors.values) {
-      errorLists.add(errors);
+    EnginePlugin enginePlugin = AnalysisEngine.instance.enginePlugin;
+    for (ResultDescriptor result in enginePlugin.dartErrorsForSource) {
+      String inputName = result.name + '_input';
+      errorLists.add(getRequiredInput(inputName));
+    }
+    for (ResultDescriptor result in enginePlugin.dartErrorsForUnit) {
+      String inputName = result.name + '_input';
+      Map<Source, List<AnalysisError>> errorMap = getRequiredInput(inputName);
+      for (List<AnalysisError> errors in errorMap.values) {
+        errorLists.add(errors);
+      }
     }
     //
     // Record outputs.
@@ -1769,18 +2164,23 @@
    */
   static Map<String, TaskInput> buildInputs(AnalysisTarget target) {
     Source source = target;
-    return <String, TaskInput>{
-      BUILD_DIRECTIVES_ERRORS_INPUT: BUILD_DIRECTIVES_ERRORS.of(source),
-      BUILD_LIBRARY_ERRORS_INPUT: BUILD_LIBRARY_ERRORS.of(source),
-      PARSE_ERRORS_INPUT: PARSE_ERRORS.of(source),
-      SCAN_ERRORS_INPUT: SCAN_ERRORS.of(source),
-      LIBRARY_UNIT_ERRORS_INPUT: CONTAINING_LIBRARIES
-          .of(source)
-          .toMap((Source library) {
+    Map<String, TaskInput> inputs = <String, TaskInput>{};
+    EnginePlugin enginePlugin = AnalysisEngine.instance.enginePlugin;
+    // for Source
+    for (ResultDescriptor result in enginePlugin.dartErrorsForSource) {
+      String inputName = result.name + '_input';
+      inputs[inputName] = result.of(source);
+    }
+    // for LibrarySpecificUnit
+    for (ResultDescriptor result in enginePlugin.dartErrorsForUnit) {
+      String inputName = result.name + '_input';
+      inputs[inputName] =
+          CONTAINING_LIBRARIES.of(source).toMap((Source library) {
         LibrarySpecificUnit unit = new LibrarySpecificUnit(library, source);
-        return LIBRARY_UNIT_ERRORS.of(unit);
-      })
-    };
+        return result.of(unit);
+      });
+    }
+    return inputs;
   }
 
   /**
@@ -1794,11 +2194,11 @@
 }
 
 /**
- * A task that builds [RESOLVED_UNIT] for a unit.
+ * A task that builds [RESOLVED_UNIT10] for a unit.
  */
 class EvaluateUnitConstantsTask extends SourceBasedAnalysisTask {
   /**
-   * The name of the [RESOLVED_UNIT5] input.
+   * The name of the [RESOLVED_UNIT9] input.
    */
   static const String UNIT_INPUT = 'UNIT_INPUT';
 
@@ -1811,8 +2211,10 @@
    * The task descriptor describing this kind of task.
    */
   static final TaskDescriptor DESCRIPTOR = new TaskDescriptor(
-      'EvaluateUnitConstantsTask', createTask, buildInputs,
-      <ResultDescriptor>[RESOLVED_UNIT]);
+      'EvaluateUnitConstantsTask',
+      createTask,
+      buildInputs,
+      <ResultDescriptor>[RESOLVED_UNIT10]);
 
   EvaluateUnitConstantsTask(AnalysisContext context, LibrarySpecificUnit target)
       : super(context, target);
@@ -1825,7 +2227,7 @@
     // No actual work needs to be performed; the task manager will ensure that
     // all constants are evaluated before this method is called.
     CompilationUnit unit = getRequiredInput(UNIT_INPUT);
-    outputs[RESOLVED_UNIT] = unit;
+    outputs[RESOLVED_UNIT10] = unit;
   }
 
   /**
@@ -1837,7 +2239,7 @@
     LibrarySpecificUnit unit = target;
     return <String, TaskInput>{
       'libraryElement': LIBRARY_ELEMENT.of(unit.library),
-      UNIT_INPUT: RESOLVED_UNIT5.of(unit),
+      UNIT_INPUT: RESOLVED_UNIT9.of(unit),
       CONSTANT_VALUES:
           COMPILATION_UNIT_CONSTANTS.of(unit).toListOf(CONSTANT_VALUE)
     };
@@ -1961,7 +2363,7 @@
  */
 class GatherUsedImportedElementsTask extends SourceBasedAnalysisTask {
   /**
-   * The name of the [RESOLVED_UNIT5] input.
+   * The name of the [RESOLVED_UNIT9] input.
    */
   static const String UNIT_INPUT = 'UNIT_INPUT';
 
@@ -1969,7 +2371,9 @@
    * The task descriptor describing this kind of task.
    */
   static final TaskDescriptor DESCRIPTOR = new TaskDescriptor(
-      'GatherUsedImportedElementsTask', createTask, buildInputs,
+      'GatherUsedImportedElementsTask',
+      createTask,
+      buildInputs,
       <ResultDescriptor>[USED_IMPORTED_ELEMENTS]);
 
   GatherUsedImportedElementsTask(
@@ -2003,7 +2407,7 @@
    */
   static Map<String, TaskInput> buildInputs(AnalysisTarget target) {
     LibrarySpecificUnit unit = target;
-    return <String, TaskInput>{UNIT_INPUT: RESOLVED_UNIT5.of(unit)};
+    return <String, TaskInput>{UNIT_INPUT: RESOLVED_UNIT9.of(unit)};
   }
 
   /**
@@ -2021,7 +2425,7 @@
  */
 class GatherUsedLocalElementsTask extends SourceBasedAnalysisTask {
   /**
-   * The name of the [RESOLVED_UNIT5] input.
+   * The name of the [RESOLVED_UNIT9] input.
    */
   static const String UNIT_INPUT = 'UNIT_INPUT';
 
@@ -2029,7 +2433,9 @@
    * The task descriptor describing this kind of task.
    */
   static final TaskDescriptor DESCRIPTOR = new TaskDescriptor(
-      'GatherUsedLocalElementsTask', createTask, buildInputs,
+      'GatherUsedLocalElementsTask',
+      createTask,
+      buildInputs,
       <ResultDescriptor>[USED_LOCAL_ELEMENTS]);
 
   GatherUsedLocalElementsTask(
@@ -2063,7 +2469,7 @@
    */
   static Map<String, TaskInput> buildInputs(AnalysisTarget target) {
     LibrarySpecificUnit unit = target;
-    return <String, TaskInput>{UNIT_INPUT: RESOLVED_UNIT5.of(unit)};
+    return <String, TaskInput>{UNIT_INPUT: RESOLVED_UNIT9.of(unit)};
   }
 
   /**
@@ -2081,7 +2487,7 @@
  */
 class GenerateHintsTask extends SourceBasedAnalysisTask {
   /**
-   * The name of the [RESOLVED_UNIT5] input.
+   * The name of the [RESOLVED_UNIT9] input.
    */
   static const String RESOLVED_UNIT_INPUT = 'RESOLVED_UNIT';
 
@@ -2135,10 +2541,12 @@
         getRequiredInput(USED_LOCAL_ELEMENTS_INPUT);
     CompilationUnitElement unitElement = unit.element;
     LibraryElement libraryElement = unitElement.library;
+    TypeSystem typeSystem = context.typeSystem;
+
     //
     // Generate errors.
     //
-    unit.accept(new DeadCodeVerifier(errorReporter));
+    unit.accept(new DeadCodeVerifier(errorReporter, typeSystem: typeSystem));
     // Verify imports.
     {
       ImportsVerifier verifier = new ImportsVerifier();
@@ -2163,7 +2571,9 @@
     InheritanceManager inheritanceManager =
         new InheritanceManager(libraryElement);
     TypeProvider typeProvider = getRequiredInput(TYPE_PROVIDER_INPUT);
-    unit.accept(new BestPracticesVerifier(errorReporter, typeProvider));
+
+    unit.accept(new BestPracticesVerifier(errorReporter, typeProvider,
+        typeSystem: typeSystem));
     unit.accept(new OverrideVerifier(errorReporter, inheritanceManager));
     // Find to-do comments.
     new ToDoFinder(errorReporter).findIn(unit);
@@ -2183,14 +2593,10 @@
     Source libSource = unit.library;
     return <String, TaskInput>{
       RESOLVED_UNIT_INPUT: RESOLVED_UNIT.of(unit),
-      USED_LOCAL_ELEMENTS_INPUT: UNITS.of(libSource).toList((unit) {
-        LibrarySpecificUnit target = new LibrarySpecificUnit(libSource, unit);
-        return USED_LOCAL_ELEMENTS.of(target);
-      }),
-      USED_IMPORTED_ELEMENTS_INPUT: UNITS.of(libSource).toList((unit) {
-        LibrarySpecificUnit target = new LibrarySpecificUnit(libSource, unit);
-        return USED_IMPORTED_ELEMENTS.of(target);
-      }),
+      USED_LOCAL_ELEMENTS_INPUT:
+          LIBRARY_SPECIFIC_UNITS.of(libSource).toListOf(USED_LOCAL_ELEMENTS),
+      USED_IMPORTED_ELEMENTS_INPUT:
+          LIBRARY_SPECIFIC_UNITS.of(libSource).toListOf(USED_IMPORTED_ELEMENTS),
       TYPE_PROVIDER_INPUT: TYPE_PROVIDER.of(AnalysisContextTarget.request)
     };
   }
@@ -2206,6 +2612,410 @@
 }
 
 /**
+ * A task that generates [LINTS] for a unit.
+ */
+class GenerateLintsTask extends SourceBasedAnalysisTask {
+  /**
+   * The name of the [RESOLVED_UNIT] input.
+   */
+  static const String RESOLVED_UNIT_INPUT = 'RESOLVED_UNIT';
+
+  /**
+   * The task descriptor describing this kind of task.
+   */
+  static final TaskDescriptor DESCRIPTOR = new TaskDescriptor(
+      'GenerateLintsTask', createTask, buildInputs, <ResultDescriptor>[LINTS]);
+
+  GenerateLintsTask(InternalAnalysisContext context, AnalysisTarget target)
+      : super(context, target);
+
+  @override
+  TaskDescriptor get descriptor => DESCRIPTOR;
+
+  @override
+  void internalPerform() {
+    AnalysisOptions analysisOptions = context.analysisOptions;
+    if (!analysisOptions.lint) {
+      outputs[LINTS] = AnalysisError.NO_ERRORS;
+      return;
+    }
+    //
+    // Prepare collectors.
+    //
+    RecordingErrorListener errorListener = new RecordingErrorListener();
+    Source source = getRequiredSource();
+    ErrorReporter errorReporter = new ErrorReporter(errorListener, source);
+    //
+    // Prepare inputs.
+    //
+    CompilationUnit unit = getRequiredInput(RESOLVED_UNIT_INPUT);
+
+    //
+    // Generate lints.
+    //
+    List<Linter> linters = getLints(context);
+    linters.forEach((l) => l.reporter = errorReporter);
+    Iterable<AstVisitor> visitors = linters.map((l) => l.getVisitor()).toList();
+    unit.accept(new DelegatingAstVisitor(visitors.where((v) => v != null)));
+
+    //
+    // Record outputs.
+    //
+    outputs[LINTS] = errorListener.errors;
+  }
+
+  /**
+   * 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].
+   */
+  static Map<String, TaskInput> buildInputs(AnalysisTarget target) =>
+      <String, TaskInput>{RESOLVED_UNIT_INPUT: RESOLVED_UNIT.of(target)};
+
+  /**
+   * Create a [GenerateLintsTask] based on the given [target] in
+   * the given [context].
+   */
+  static GenerateLintsTask createTask(
+      AnalysisContext context, AnalysisTarget target) {
+    return new GenerateLintsTask(context, target);
+  }
+}
+
+/**
+ * A task that ensures that all of the inferable instance members in a
+ * compilation unit have had their type inferred.
+ */
+class InferInstanceMembersInUnitTask extends SourceBasedAnalysisTask {
+  /**
+   * The name of the [TYPE_PROVIDER] input.
+   */
+  static const String TYPE_PROVIDER_INPUT = 'TYPE_PROVIDER_INPUT';
+
+  /**
+   * The name of the input whose value is the [RESOLVED_UNIT6] for the
+   * compilation unit.
+   */
+  static const String UNIT_INPUT = 'UNIT_INPUT';
+
+  /**
+   * The task descriptor describing this kind of task.
+   */
+  static final TaskDescriptor DESCRIPTOR = new TaskDescriptor(
+      'InferInstanceMembersInUnitTask',
+      createTask,
+      buildInputs,
+      <ResultDescriptor>[RESOLVED_UNIT8]);
+
+  /**
+   * Initialize a newly created task to build a library element for the given
+   * [unit] in the given [context].
+   */
+  InferInstanceMembersInUnitTask(
+      InternalAnalysisContext context, LibrarySpecificUnit unit)
+      : super(context, unit);
+
+  @override
+  TaskDescriptor get descriptor => DESCRIPTOR;
+
+  @override
+  void internalPerform() {
+    //
+    // Prepare inputs.
+    //
+    CompilationUnit unit = getRequiredInput(UNIT_INPUT);
+    TypeProvider typeProvider = getRequiredInput(TYPE_PROVIDER_INPUT);
+    //
+    // Infer instance members.
+    //
+    if (context.analysisOptions.strongMode) {
+      InstanceMemberInferrer inferrer = new InstanceMemberInferrer(typeProvider,
+          typeSystem: context.typeSystem);
+      inferrer.inferCompilationUnit(unit.element);
+    }
+    //
+    // Record outputs.
+    //
+    outputs[RESOLVED_UNIT8] = unit;
+  }
+
+  /**
+   * 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
+   * [libSource].
+   */
+  static Map<String, TaskInput> buildInputs(AnalysisTarget target) {
+    LibrarySpecificUnit unit = target;
+    return <String, TaskInput>{
+      UNIT_INPUT: RESOLVED_UNIT7.of(unit),
+      TYPE_PROVIDER_INPUT: TYPE_PROVIDER.of(AnalysisContextTarget.request),
+      // In strong mode, add additional dependencies to enforce inference
+      // ordering.
+
+      // Require that field re-resolution be complete for all units in the
+      // current library cycle.
+      'orderLibraryCycleTasks': LIBRARY_CYCLE_UNITS.of(unit).toList(
+          (CompilationUnitElementImpl unit) => RESOLVED_UNIT7
+              .of(new LibrarySpecificUnit(unit.librarySource, unit.source))),
+      // Require that full inference be complete for all dependencies of the
+      // current library cycle.
+      'orderLibraryCycles': LIBRARY_CYCLE_DEPENDENCIES.of(unit).toList(
+          (CompilationUnitElementImpl unit) => RESOLVED_UNIT8
+              .of(new LibrarySpecificUnit(unit.librarySource, unit.source)))
+    };
+  }
+
+  /**
+   * Create a [InferInstanceMembersInUnitTask] based on the given [target] in
+   * the given [context].
+   */
+  static InferInstanceMembersInUnitTask createTask(
+      AnalysisContext context, AnalysisTarget target) {
+    return new InferInstanceMembersInUnitTask(context, target);
+  }
+}
+
+/**
+ * An abstract class that defines utility methods that are useful for tasks
+ * operating on static variables.
+ */
+abstract class InferStaticVariableTask extends ConstantEvaluationAnalysisTask {
+  InferStaticVariableTask(
+      InternalAnalysisContext context, VariableElement variable)
+      : super(context, variable);
+
+  /**
+   * Return the declaration of the target within the given compilation [unit].
+   * Throw an exception if the declaration cannot be found.
+   */
+  VariableDeclaration getDeclaration(CompilationUnit unit) {
+    VariableElement variable = target;
+    NodeLocator locator = new NodeLocator(variable.nameOffset);
+    AstNode node = locator.searchWithin(unit);
+    VariableDeclaration declaration =
+        node.getAncestor((AstNode ancestor) => ancestor is VariableDeclaration);
+    if (declaration == null || declaration.name != node) {
+      throw new AnalysisException(
+          "Failed to find the declaration of the variable ${variable.displayName} in ${variable.source}");
+    }
+    return declaration;
+  }
+}
+
+/**
+ * A task that ensures that all of the inferable static variables in a
+ * compilation unit have had their type inferred.
+ */
+class InferStaticVariableTypesInUnitTask extends SourceBasedAnalysisTask {
+  /**
+   * The name of the input whose value is the [RESOLVED_UNIT5] for the
+   * compilation unit.
+   */
+  static const String UNIT_INPUT = 'UNIT_INPUT';
+
+  /**
+   * The name of the input whose value is a list of the inferable static
+   * variables whose types have been computed.
+   */
+  static const String INFERRED_VARIABLES_INPUT = 'INFERRED_VARIABLES_INPUT';
+
+  /**
+   * The task descriptor describing this kind of task.
+   */
+  static final TaskDescriptor DESCRIPTOR = new TaskDescriptor(
+      'InferStaticVariableTypesInUnitTask',
+      createTask,
+      buildInputs,
+      <ResultDescriptor>[RESOLVED_UNIT6]);
+
+  /**
+   * Initialize a newly created task to build a library element for the given
+   * [unit] in the given [context].
+   */
+  InferStaticVariableTypesInUnitTask(
+      InternalAnalysisContext context, LibrarySpecificUnit unit)
+      : super(context, unit);
+
+  @override
+  TaskDescriptor get descriptor => DESCRIPTOR;
+
+  @override
+  void internalPerform() {
+    //
+    // Prepare inputs.
+    //
+    CompilationUnit unit = getRequiredInput(UNIT_INPUT);
+    //
+    // Record outputs. There is no additional work to be done at this time
+    // because the work has implicitly been done by virtue of the task model
+    // preparing all of the inputs.
+    //
+    outputs[RESOLVED_UNIT6] = unit;
+  }
+
+  /**
+   * 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
+   * [libSource].
+   */
+  static Map<String, TaskInput> buildInputs(AnalysisTarget target) {
+    LibrarySpecificUnit unit = target;
+    return <String, TaskInput>{
+      INFERRED_VARIABLES_INPUT: INFERABLE_STATIC_VARIABLES_IN_UNIT
+          .of(unit)
+          .toListOf(INFERRED_STATIC_VARIABLE),
+      UNIT_INPUT: RESOLVED_UNIT5.of(unit)
+    };
+  }
+
+  /**
+   * Create a [InferStaticVariableTypesInUnitTask] based on the given [target]
+   * in the given [context].
+   */
+  static InferStaticVariableTypesInUnitTask createTask(
+      AnalysisContext context, AnalysisTarget target) {
+    return new InferStaticVariableTypesInUnitTask(context, target);
+  }
+}
+
+/**
+ * A task that computes the type of an inferable static variable and
+ * stores it in the element model.
+ */
+class InferStaticVariableTypeTask extends InferStaticVariableTask {
+  /**
+   * The name of the input which ensures that dependent values have their type
+   * inferred before the target.
+   */
+  static const String DEPENDENCIES_INPUT = 'DEPENDENCIES_INPUT';
+
+  /**
+   * The name of the [TYPE_PROVIDER] input.
+   */
+  static const String TYPE_PROVIDER_INPUT = 'TYPE_PROVIDER_INPUT';
+
+  /**
+   * The name of the [RESOLVED_UNIT5] input.
+   */
+  static const String UNIT_INPUT = 'UNIT_INPUT';
+
+  static final TaskDescriptor DESCRIPTOR = new TaskDescriptor(
+      'InferStaticVariableTypeTask',
+      createTask,
+      buildInputs,
+      <ResultDescriptor>[INFERRED_STATIC_VARIABLE]);
+
+  InferStaticVariableTypeTask(
+      InternalAnalysisContext context, VariableElement variable)
+      : super(context, variable);
+
+  @override
+  TaskDescriptor get descriptor => DESCRIPTOR;
+
+  @override
+  bool get handlesDependencyCycles => true;
+
+  @override
+  void internalPerform() {
+    //
+    // Prepare inputs.
+    //
+    // Note: DEPENDENCIES_INPUT is not needed.  It is merely a bookkeeping
+    // dependency to ensure that the variables that this variable references
+    // have types inferred before inferring the type of this variable.
+    //
+    VariableElementImpl variable = target;
+
+    CompilationUnit unit = getRequiredInput(UNIT_INPUT);
+    TypeProvider typeProvider = getRequiredInput(TYPE_PROVIDER_INPUT);
+
+    // If we're not in a dependency cycle, and we have no type annotation,
+    // re-resolve the right hand side and do inference.
+    if (dependencyCycle == null && variable.hasImplicitType) {
+      VariableDeclaration declaration = getDeclaration(unit);
+      //
+      // Re-resolve the variable's initializer so that the inferred types
+      // of other variables will be propagated.
+      //
+      Expression initializer = declaration.initializer;
+      ResolutionContext resolutionContext = ResolutionContextBuilder.contextFor(
+          initializer, AnalysisErrorListener.NULL_LISTENER);
+      ResolverVisitor visitor = new ResolverVisitor(variable.library,
+          variable.source, typeProvider, AnalysisErrorListener.NULL_LISTENER,
+          nameScope: resolutionContext.scope);
+      if (resolutionContext.enclosingClassDeclaration != null) {
+        visitor.prepareToResolveMembersInClass(
+            resolutionContext.enclosingClassDeclaration);
+      }
+      visitor.initForIncrementalResolution();
+      initializer.accept(visitor);
+
+      //
+      // Record the type of the variable.
+      //
+      DartType newType = initializer.staticType;
+      if (newType == null || newType.isBottom) {
+        newType = typeProvider.dynamicType;
+      }
+      variable.type = newType;
+      (variable.initializer as ExecutableElementImpl).returnType = newType;
+      if (variable is PropertyInducingElementImpl) {
+        setReturnType(variable.getter, newType);
+        if (!variable.isFinal && !variable.isConst) {
+          setParameterType(variable.setter, newType);
+        }
+      }
+    } else {
+      // TODO(brianwilkerson) For now we simply don't infer any type for
+      // variables or fields involved in a cycle. We could try to be smarter
+      // by re-resolving the initializer in a context in which the types of all
+      // of the variables in the cycle are assumed to be `null`, but it isn't
+      // clear to me that this would produce better results often enough to
+      // warrant the extra effort.
+    }
+    //
+    // Record outputs.
+    //
+    outputs[INFERRED_STATIC_VARIABLE] = variable;
+  }
+
+  /**
+   * 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].
+   */
+  static Map<String, TaskInput> buildInputs(AnalysisTarget target) {
+    VariableElement variable = target;
+    LibrarySpecificUnit unit =
+        new LibrarySpecificUnit(variable.library.source, variable.source);
+    return <String, TaskInput>{
+      DEPENDENCIES_INPUT: INFERABLE_STATIC_VARIABLE_DEPENDENCIES
+          .of(variable)
+          .toListOf(INFERRED_STATIC_VARIABLE),
+      TYPE_PROVIDER_INPUT: TYPE_PROVIDER.of(AnalysisContextTarget.request),
+      UNIT_INPUT: RESOLVED_UNIT5.of(unit),
+      // In strong mode, add additional dependencies to enforce inference
+      // ordering.
+
+      // Require that full inference be complete for all dependencies of the
+      // current library cycle.
+      'orderLibraryCycles': LIBRARY_CYCLE_DEPENDENCIES.of(unit).toList(
+          (CompilationUnitElementImpl unit) => RESOLVED_UNIT8
+              .of(new LibrarySpecificUnit(unit.librarySource, unit.source)))
+    };
+  }
+
+  /**
+   * Create a [InferStaticVariableTypeTask] based on the given [target] in the
+   * given [context].
+   */
+  static InferStaticVariableTypeTask createTask(
+      AnalysisContext context, AnalysisTarget target) {
+    return new InferStaticVariableTypeTask(context, target);
+  }
+}
+
+/**
  * A task computes all of the errors of all of the units for a single
  * library source and sets the [LIBRARY_ERRORS_READY] flag.
  */
@@ -2214,7 +3024,9 @@
    * The task descriptor describing this kind of task.
    */
   static final TaskDescriptor DESCRIPTOR = new TaskDescriptor(
-      'LibraryErrorsReadyTask', createTask, buildInputs,
+      'LibraryErrorsReadyTask',
+      createTask,
+      buildInputs,
       <ResultDescriptor>[LIBRARY_ERRORS_READY]);
 
   LibraryErrorsReadyTask(InternalAnalysisContext context, AnalysisTarget target)
@@ -2231,7 +3043,7 @@
   /**
    * 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 [library].
+   * given [target].
    */
   static Map<String, TaskInput> buildInputs(AnalysisTarget target) {
     Source source = target;
@@ -2256,15 +3068,29 @@
  */
 class LibraryUnitErrorsTask extends SourceBasedAnalysisTask {
   /**
+   * The name of the [BUILD_DIRECTIVES_ERRORS] input.
+   */
+  static const String BUILD_DIRECTIVES_ERRORS_INPUT = 'BUILD_DIRECTIVES_ERRORS';
+
+  /**
+   * The name of the [BUILD_LIBRARY_ERRORS] input.
+   */
+  static const String BUILD_LIBRARY_ERRORS_INPUT = 'BUILD_LIBRARY_ERRORS';
+
+  /**
    * The name of the [HINTS] input.
    */
   static const String HINTS_INPUT = 'HINTS';
 
   /**
-   * The name of the [RESOLVE_REFERENCES_ERRORS] input.
+   * The name of the [LINTS] input.
    */
-  static const String RESOLVE_REFERENCES_ERRORS_INPUT =
-      'RESOLVE_REFERENCES_ERRORS';
+  static const String LINTS_INPUT = 'LINTS';
+
+  /**
+   * The name of the [STRONG_MODE_ERRORS] input.
+   */
+  static const String STRONG_MODE_ERRORS_INPUT = 'STRONG_MODE_ERRORS';
 
   /**
    * The name of the [RESOLVE_TYPE_NAMES_ERRORS] input.
@@ -2273,6 +3099,11 @@
       'RESOLVE_TYPE_NAMES_ERRORS';
 
   /**
+   * The name of the [RESOLVE_UNIT_ERRORS] input.
+   */
+  static const String RESOLVE_UNIT_ERRORS_INPUT = 'RESOLVE_UNIT_ERRORS';
+
+  /**
    * The name of the [VARIABLE_REFERENCE_ERRORS] input.
    */
   static const String VARIABLE_REFERENCE_ERRORS_INPUT =
@@ -2287,7 +3118,9 @@
    * The task descriptor describing this kind of task.
    */
   static final TaskDescriptor DESCRIPTOR = new TaskDescriptor(
-      'LibraryUnitErrorsTask', createTask, buildInputs,
+      'LibraryUnitErrorsTask',
+      createTask,
+      buildInputs,
       <ResultDescriptor>[LIBRARY_UNIT_ERRORS]);
 
   LibraryUnitErrorsTask(InternalAnalysisContext context, AnalysisTarget target)
@@ -2302,9 +3135,13 @@
     // Prepare inputs.
     //
     List<List<AnalysisError>> errorLists = <List<AnalysisError>>[];
+    errorLists.add(getRequiredInput(BUILD_DIRECTIVES_ERRORS_INPUT));
+    errorLists.add(getRequiredInput(BUILD_LIBRARY_ERRORS_INPUT));
     errorLists.add(getRequiredInput(HINTS_INPUT));
-    errorLists.add(getRequiredInput(RESOLVE_REFERENCES_ERRORS_INPUT));
+    errorLists.add(getRequiredInput(LINTS_INPUT));
     errorLists.add(getRequiredInput(RESOLVE_TYPE_NAMES_ERRORS_INPUT));
+    errorLists.add(getRequiredInput(RESOLVE_UNIT_ERRORS_INPUT));
+    errorLists.add(getRequiredInput(STRONG_MODE_ERRORS_INPUT));
     errorLists.add(getRequiredInput(VARIABLE_REFERENCE_ERRORS_INPUT));
     errorLists.add(getRequiredInput(VERIFY_ERRORS_INPUT));
     //
@@ -2320,13 +3157,27 @@
    */
   static Map<String, TaskInput> buildInputs(AnalysisTarget target) {
     LibrarySpecificUnit unit = target;
-    return <String, TaskInput>{
+    Map<String, TaskInput> inputs = <String, TaskInput>{
       HINTS_INPUT: HINTS.of(unit),
-      RESOLVE_REFERENCES_ERRORS_INPUT: RESOLVE_REFERENCES_ERRORS.of(unit),
+      LINTS_INPUT: LINTS.of(unit),
       RESOLVE_TYPE_NAMES_ERRORS_INPUT: RESOLVE_TYPE_NAMES_ERRORS.of(unit),
+      RESOLVE_UNIT_ERRORS_INPUT: RESOLVE_UNIT_ERRORS.of(unit),
+      STRONG_MODE_ERRORS_INPUT: STRONG_MODE_ERRORS.of(unit),
       VARIABLE_REFERENCE_ERRORS_INPUT: VARIABLE_REFERENCE_ERRORS.of(unit),
       VERIFY_ERRORS_INPUT: VERIFY_ERRORS.of(unit)
     };
+    Source source = unit.source;
+    if (unit.library == source) {
+      inputs[BUILD_DIRECTIVES_ERRORS_INPUT] =
+          BUILD_DIRECTIVES_ERRORS.of(source);
+      inputs[BUILD_LIBRARY_ERRORS_INPUT] = BUILD_LIBRARY_ERRORS.of(source);
+    } else {
+      inputs[BUILD_DIRECTIVES_ERRORS_INPUT] =
+          new ConstantTaskInput(AnalysisError.NO_ERRORS);
+      inputs[BUILD_LIBRARY_ERRORS_INPUT] =
+          new ConstantTaskInput(AnalysisError.NO_ERRORS);
+    }
+    return inputs;
   }
 
   /**
@@ -2340,7 +3191,9 @@
 }
 
 /**
- * A task that parses the content of a Dart file, producing an AST structure.
+ * A task that parses the content of a Dart file, producing an AST structure,
+ * any lexical errors found in the process, the kind of the file (library or
+ * part), and several lists based on the AST.
  */
 class ParseDartTask extends SourceBasedAnalysisTask {
   /**
@@ -2363,12 +3216,13 @@
   /**
    * The task descriptor describing this kind of task.
    */
-  static final TaskDescriptor DESCRIPTOR = new TaskDescriptor('ParseDartTask',
-      createTask, buildInputs, <ResultDescriptor>[
+  static final TaskDescriptor DESCRIPTOR = new TaskDescriptor(
+      'ParseDartTask', createTask, buildInputs, <ResultDescriptor>[
     EXPLICITLY_IMPORTED_LIBRARIES,
     EXPORTED_LIBRARIES,
     IMPORTED_LIBRARIES,
     INCLUDED_PARTS,
+    LIBRARY_SPECIFIC_UNITS,
     PARSE_ERRORS,
     PARSED_UNIT,
     SOURCE_KIND,
@@ -2455,10 +3309,13 @@
     List<AnalysisError> parseErrors =
         removeDuplicateErrors(errorListener.errors);
     List<Source> unitSources = <Source>[source]..addAll(includedSourceSet);
+    List<LibrarySpecificUnit> librarySpecificUnits =
+        unitSources.map((s) => new LibrarySpecificUnit(source, s)).toList();
     outputs[EXPLICITLY_IMPORTED_LIBRARIES] = explicitlyImportedSources;
     outputs[EXPORTED_LIBRARIES] = exportedSources;
     outputs[IMPORTED_LIBRARIES] = importedSources;
     outputs[INCLUDED_PARTS] = includedSources;
+    outputs[LIBRARY_SPECIFIC_UNITS] = librarySpecificUnits;
     outputs[PARSE_ERRORS] = parseErrors;
     outputs[PARSED_UNIT] = unit;
     outputs[SOURCE_KIND] = sourceKind;
@@ -2528,6 +3385,104 @@
 }
 
 /**
+ * A task that builds [RESOLVED_UNIT5] for a unit.
+ */
+class PartiallyResolveUnitReferencesTask extends SourceBasedAnalysisTask {
+  /**
+   * The name of the [LIBRARY_ELEMENT5] input.
+   */
+  static const String LIBRARY_INPUT = 'LIBRARY_INPUT';
+
+  /**
+   * The name of the [RESOLVED_UNIT4] input.
+   */
+  static const String UNIT_INPUT = 'UNIT_INPUT';
+
+  /**
+   * The name of the [TYPE_PROVIDER] input.
+   */
+  static const String TYPE_PROVIDER_INPUT = 'TYPE_PROVIDER_INPUT';
+
+  /**
+   * The task descriptor describing this kind of task.
+   */
+  static final TaskDescriptor DESCRIPTOR = new TaskDescriptor(
+      'PartiallyResolveUnitReferencesTask',
+      createTask,
+      buildInputs,
+      <ResultDescriptor>[INFERABLE_STATIC_VARIABLES_IN_UNIT, RESOLVED_UNIT5]);
+
+  PartiallyResolveUnitReferencesTask(
+      InternalAnalysisContext context, AnalysisTarget target)
+      : super(context, target);
+
+  @override
+  TaskDescriptor get descriptor => DESCRIPTOR;
+
+  @override
+  void internalPerform() {
+    //
+    // Prepare inputs.
+    //
+    LibraryElement libraryElement = getRequiredInput(LIBRARY_INPUT);
+    CompilationUnit unit = getRequiredInput(UNIT_INPUT);
+    CompilationUnitElement unitElement = unit.element;
+    TypeProvider typeProvider = getRequiredInput(TYPE_PROVIDER_INPUT);
+    //
+    // Resolve references and record outputs.
+    //
+    if (context.analysisOptions.strongMode) {
+      InheritanceManager inheritanceManager =
+          new InheritanceManager(libraryElement);
+      PartialResolverVisitor visitor = new PartialResolverVisitor(
+          libraryElement,
+          unitElement.source,
+          typeProvider,
+          AnalysisErrorListener.NULL_LISTENER,
+          inheritanceManager: inheritanceManager);
+      unit.accept(visitor);
+
+      outputs[INFERABLE_STATIC_VARIABLES_IN_UNIT] = visitor.variablesAndFields;
+    } else {
+      outputs[INFERABLE_STATIC_VARIABLES_IN_UNIT] = [];
+    }
+    outputs[RESOLVED_UNIT5] = unit;
+  }
+
+  /**
+   * 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].
+   */
+  static Map<String, TaskInput> buildInputs(AnalysisTarget target) {
+    LibrarySpecificUnit unit = target;
+    return <String, TaskInput>{
+      'fullyBuiltLibraryElements': READY_LIBRARY_ELEMENT5.of(unit.library),
+      LIBRARY_INPUT: LIBRARY_ELEMENT5.of(unit.library),
+      UNIT_INPUT: RESOLVED_UNIT4.of(unit),
+      TYPE_PROVIDER_INPUT: TYPE_PROVIDER.of(AnalysisContextTarget.request),
+      // In strong mode, add additional dependencies to enforce inference
+      // ordering.
+
+      // Require that full inference be complete for all dependencies of the
+      // current library cycle.
+      'orderLibraryCycles': LIBRARY_CYCLE_DEPENDENCIES.of(unit).toList(
+          (CompilationUnitElementImpl unit) => RESOLVED_UNIT8
+              .of(new LibrarySpecificUnit(unit.librarySource, unit.source)))
+    };
+  }
+
+  /**
+   * Create a [PartiallyResolveUnitReferencesTask] based on the given [target]
+   * in the given [context].
+   */
+  static PartiallyResolveUnitReferencesTask createTask(
+      AnalysisContext context, AnalysisTarget target) {
+    return new PartiallyResolveUnitReferencesTask(context, target);
+  }
+}
+
+/**
  * The helper for building the public [Namespace] of a [LibraryElement].
  */
 class PublicNamespaceBuilder {
@@ -2567,6 +3522,222 @@
 }
 
 /**
+ * A task that ensures that [LIBRARY_ELEMENT2] is ready for the target library
+ * source and its import/export closure.
+ */
+class ReadyLibraryElement2Task extends SourceBasedAnalysisTask {
+  static final TaskDescriptor DESCRIPTOR = new TaskDescriptor(
+      'ReadyLibraryElement2Task',
+      createTask,
+      buildInputs,
+      <ResultDescriptor>[READY_LIBRARY_ELEMENT2]);
+
+  ReadyLibraryElement2Task(
+      InternalAnalysisContext context, AnalysisTarget target)
+      : super(context, target);
+
+  @override
+  TaskDescriptor get descriptor => DESCRIPTOR;
+
+  @override
+  bool get handlesDependencyCycles => true;
+
+  @override
+  void internalPerform() {
+    outputs[READY_LIBRARY_ELEMENT2] = true;
+  }
+
+  static Map<String, TaskInput> buildInputs(AnalysisTarget target) {
+    Source source = target;
+    return <String, TaskInput>{
+      'thisLibraryElementReady': LIBRARY_ELEMENT2.of(source),
+      'directlyImportedLibrariesReady':
+          IMPORTED_LIBRARIES.of(source).toListOf(READY_LIBRARY_ELEMENT2),
+      'directlyExportedLibrariesReady':
+          EXPORTED_LIBRARIES.of(source).toListOf(READY_LIBRARY_ELEMENT2),
+    };
+  }
+
+  static ReadyLibraryElement2Task createTask(
+      AnalysisContext context, AnalysisTarget target) {
+    return new ReadyLibraryElement2Task(context, target);
+  }
+}
+
+/**
+ * A task that ensures that [LIBRARY_ELEMENT5] is ready for the target library
+ * source and its import/export closure.
+ */
+class ReadyLibraryElement5Task extends SourceBasedAnalysisTask {
+  static final TaskDescriptor DESCRIPTOR = new TaskDescriptor(
+      'ReadyLibraryElement5Task',
+      createTask,
+      buildInputs,
+      <ResultDescriptor>[READY_LIBRARY_ELEMENT5]);
+
+  ReadyLibraryElement5Task(
+      InternalAnalysisContext context, AnalysisTarget target)
+      : super(context, target);
+
+  @override
+  TaskDescriptor get descriptor => DESCRIPTOR;
+
+  @override
+  bool get handlesDependencyCycles => true;
+
+  @override
+  void internalPerform() {
+    outputs[READY_LIBRARY_ELEMENT5] = true;
+  }
+
+  static Map<String, TaskInput> buildInputs(AnalysisTarget target) {
+    Source source = target;
+    return <String, TaskInput>{
+      'thisLibraryElementReady': LIBRARY_ELEMENT5.of(source),
+      'directlyImportedLibrariesReady':
+          IMPORTED_LIBRARIES.of(source).toListOf(READY_LIBRARY_ELEMENT5),
+      'directlyExportedLibrariesReady':
+          EXPORTED_LIBRARIES.of(source).toListOf(READY_LIBRARY_ELEMENT5),
+    };
+  }
+
+  static ReadyLibraryElement5Task createTask(
+      AnalysisContext context, AnalysisTarget target) {
+    return new ReadyLibraryElement5Task(context, target);
+  }
+}
+
+/**
+ * A task that ensures that [RESOLVED_UNIT10] is ready for every unit of the
+ * target library source and its import/export closure.
+ */
+class ReadyResolvedUnit10Task extends SourceBasedAnalysisTask {
+  static final TaskDescriptor DESCRIPTOR = new TaskDescriptor(
+      'ReadyResolvedUnit10Task',
+      createTask,
+      buildInputs,
+      <ResultDescriptor>[READY_RESOLVED_UNIT10]);
+
+  ReadyResolvedUnit10Task(
+      InternalAnalysisContext context, AnalysisTarget target)
+      : super(context, target);
+
+  @override
+  TaskDescriptor get descriptor => DESCRIPTOR;
+
+  @override
+  bool get handlesDependencyCycles => true;
+
+  @override
+  void internalPerform() {
+    outputs[READY_RESOLVED_UNIT10] = true;
+  }
+
+  static Map<String, TaskInput> buildInputs(AnalysisTarget target) {
+    Source source = target;
+    return <String, TaskInput>{
+      'thisLibraryUnitsReady':
+          LIBRARY_SPECIFIC_UNITS.of(source).toListOf(RESOLVED_UNIT10),
+      'directlyImportedLibrariesReady':
+          IMPORTED_LIBRARIES.of(source).toListOf(READY_RESOLVED_UNIT10),
+      'directlyExportedLibrariesReady':
+          EXPORTED_LIBRARIES.of(source).toListOf(READY_RESOLVED_UNIT10),
+    };
+  }
+
+  static ReadyResolvedUnit10Task createTask(
+      AnalysisContext context, AnalysisTarget target) {
+    return new ReadyResolvedUnit10Task(context, target);
+  }
+}
+
+/**
+ * A task that ensures that [RESOLVED_UNIT9] is ready for every unit of the
+ * target library source and its import/export closure.
+ */
+class ReadyResolvedUnit9Task extends SourceBasedAnalysisTask {
+  static final TaskDescriptor DESCRIPTOR = new TaskDescriptor(
+      'ReadyResolvedUnit9Task',
+      createTask,
+      buildInputs,
+      <ResultDescriptor>[READY_RESOLVED_UNIT9]);
+
+  ReadyResolvedUnit9Task(InternalAnalysisContext context, AnalysisTarget target)
+      : super(context, target);
+
+  @override
+  TaskDescriptor get descriptor => DESCRIPTOR;
+
+  @override
+  bool get handlesDependencyCycles => true;
+
+  @override
+  void internalPerform() {
+    outputs[READY_RESOLVED_UNIT9] = true;
+  }
+
+  static Map<String, TaskInput> buildInputs(AnalysisTarget target) {
+    Source source = target;
+    return <String, TaskInput>{
+      'thisLibraryUnitsReady':
+          LIBRARY_SPECIFIC_UNITS.of(source).toListOf(RESOLVED_UNIT9),
+      'directlyImportedLibrariesReady':
+          IMPORTED_LIBRARIES.of(source).toListOf(READY_RESOLVED_UNIT9),
+      'directlyExportedLibrariesReady':
+          EXPORTED_LIBRARIES.of(source).toListOf(READY_RESOLVED_UNIT9),
+    };
+  }
+
+  static ReadyResolvedUnit9Task createTask(
+      AnalysisContext context, AnalysisTarget target) {
+    return new ReadyResolvedUnit9Task(context, target);
+  }
+}
+
+/**
+ * A task that ensures that [RESOLVED_UNIT] is ready for every unit of the
+ * target library source and its import/export closure.
+ */
+class ReadyResolvedUnitTask extends SourceBasedAnalysisTask {
+  static final TaskDescriptor DESCRIPTOR = new TaskDescriptor(
+      'ReadyResolvedUnitTask',
+      createTask,
+      buildInputs,
+      <ResultDescriptor>[READY_RESOLVED_UNIT]);
+
+  ReadyResolvedUnitTask(InternalAnalysisContext context, AnalysisTarget target)
+      : super(context, target);
+
+  @override
+  TaskDescriptor get descriptor => DESCRIPTOR;
+
+  @override
+  bool get handlesDependencyCycles => true;
+
+  @override
+  void internalPerform() {
+    outputs[READY_RESOLVED_UNIT] = true;
+  }
+
+  static Map<String, TaskInput> buildInputs(AnalysisTarget target) {
+    Source source = target;
+    return <String, TaskInput>{
+      'thisLibraryUnitsReady':
+          LIBRARY_SPECIFIC_UNITS.of(source).toListOf(RESOLVED_UNIT),
+      'directlyImportedLibrariesReady':
+          IMPORTED_LIBRARIES.of(source).toListOf(READY_RESOLVED_UNIT),
+      'directlyExportedLibrariesReady':
+          EXPORTED_LIBRARIES.of(source).toListOf(READY_RESOLVED_UNIT),
+    };
+  }
+
+  static ReadyResolvedUnitTask createTask(
+      AnalysisContext context, AnalysisTarget target) {
+    return new ReadyResolvedUnitTask(context, target);
+  }
+}
+
+/**
  * Information about a library - which names it uses, which names it defines
  * with their externally visible dependencies.
  */
@@ -2665,7 +3836,123 @@
 }
 
 /**
- * A task that finishes resolution by requesting [RESOLVED_UNIT_NO_CONSTANTS] for every
+ * A task that ensures that all of the inferable instance members in a
+ * compilation unit have had their right hand sides re-resolved
+ */
+class ResolveInstanceFieldsInUnitTask extends SourceBasedAnalysisTask {
+  /**
+   * The name of the [LIBRARY_ELEMENT5] input.
+   */
+  static const String LIBRARY_INPUT = 'LIBRARY_INPUT';
+
+  /**
+   * The name of the [TYPE_PROVIDER] input.
+   */
+  static const String TYPE_PROVIDER_INPUT = 'TYPE_PROVIDER_INPUT';
+
+  /**
+   * The name of the input whose value is the [RESOLVED_UNIT6] for the
+   * compilation unit.
+   */
+  static const String UNIT_INPUT = 'UNIT_INPUT';
+
+  /**
+   * The task descriptor describing this kind of task.
+   */
+  static final TaskDescriptor DESCRIPTOR = new TaskDescriptor(
+      'ResolveInstanceFieldsInUnitTask',
+      createTask,
+      buildInputs,
+      <ResultDescriptor>[RESOLVED_UNIT7]);
+
+  /**
+   * Initialize a newly created task to build a library element for the given
+   * [unit] in the given [context].
+   */
+  ResolveInstanceFieldsInUnitTask(
+      InternalAnalysisContext context, LibrarySpecificUnit unit)
+      : super(context, unit);
+
+  @override
+  TaskDescriptor get descriptor => DESCRIPTOR;
+
+  @override
+  void internalPerform() {
+    //
+    // Prepare inputs.
+    //
+    LibraryElement libraryElement = getRequiredInput(LIBRARY_INPUT);
+    CompilationUnit unit = getRequiredInput(UNIT_INPUT);
+    TypeProvider typeProvider = getRequiredInput(TYPE_PROVIDER_INPUT);
+
+    CompilationUnitElement unitElement = unit.element;
+    if (context.analysisOptions.strongMode) {
+      //
+      // Resolve references.
+      //
+      // TODO(leafp): This code only needs to re-resolve the right hand sides of
+      // instance fields.  We could do incremental resolution on each field
+      // only using the incremental resolver.  However, this caused a massive
+      // performance degredation on the large_class_declaration_test.dart test.
+      // I would hypothesize that incremental resolution of field is linear in
+      // the size of the enclosing class, and hence incrementally resolving each
+      // field was quadratic.  We may wish to revisit this if we can resolve
+      // this performance issue.
+      InheritanceManager inheritanceManager =
+          new InheritanceManager(libraryElement);
+      PartialResolverVisitor visitor = new PartialResolverVisitor(
+          libraryElement,
+          unitElement.source,
+          typeProvider,
+          AnalysisErrorListener.NULL_LISTENER,
+          inheritanceManager: inheritanceManager);
+      unit.accept(visitor);
+    }
+    //
+    // Record outputs.
+    //
+    outputs[RESOLVED_UNIT7] = unit;
+  }
+
+  /**
+   * 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
+   * [libSource].
+   */
+  static Map<String, TaskInput> buildInputs(AnalysisTarget target) {
+    LibrarySpecificUnit unit = target;
+    return <String, TaskInput>{
+      UNIT_INPUT: RESOLVED_UNIT6.of(unit),
+      LIBRARY_INPUT: LIBRARY_ELEMENT5.of(unit.library),
+      TYPE_PROVIDER_INPUT: TYPE_PROVIDER.of(AnalysisContextTarget.request),
+      // In strong mode, add additional dependencies to enforce inference
+      // ordering.
+
+      // Require that static variable inference  be complete for all units in
+      // the current library cycle.
+      'orderLibraryCycleTasks': LIBRARY_CYCLE_UNITS.of(unit).toList(
+          (CompilationUnitElementImpl unit) => RESOLVED_UNIT6
+              .of(new LibrarySpecificUnit(unit.librarySource, unit.source))),
+      // Require that full inference be complete for all dependencies of the
+      // current library cycle.
+      'orderLibraryCycles': LIBRARY_CYCLE_DEPENDENCIES.of(unit).toList(
+          (CompilationUnitElementImpl unit) => RESOLVED_UNIT8
+              .of(new LibrarySpecificUnit(unit.librarySource, unit.source)))
+    };
+  }
+
+  /**
+   * Create a [ResolveInstanceFieldsInUnitTask] based on the given [target] in
+   * the given [context].
+   */
+  static ResolveInstanceFieldsInUnitTask createTask(
+      AnalysisContext context, AnalysisTarget target) {
+    return new ResolveInstanceFieldsInUnitTask(context, target);
+  }
+}
+
+/**
+ * A task that finishes resolution by requesting [RESOLVED_UNIT9] for every
  * unit in the libraries closure and produces [LIBRARY_ELEMENT].
  */
 class ResolveLibraryReferencesTask extends SourceBasedAnalysisTask {
@@ -2675,7 +3962,7 @@
   static const String LIBRARY_INPUT = 'LIBRARY_INPUT';
 
   /**
-   * The name of the list of [RESOLVED_UNIT5] input.
+   * The name of the list of [RESOLVED_UNIT9] input.
    */
   static const String UNITS_INPUT = 'UNITS_INPUT';
 
@@ -2683,7 +3970,9 @@
    * The task descriptor describing this kind of task.
    */
   static final TaskDescriptor DESCRIPTOR = new TaskDescriptor(
-      'ResolveLibraryReferencesTask', createTask, buildInputs,
+      'ResolveLibraryReferencesTask',
+      createTask,
+      buildInputs,
       <ResultDescriptor>[LIBRARY_ELEMENT, REFERENCED_NAMES]);
 
   ResolveLibraryReferencesTask(
@@ -2721,13 +4010,8 @@
     Source source = target;
     return <String, TaskInput>{
       LIBRARY_INPUT: LIBRARY_ELEMENT5.of(source),
-      UNITS_INPUT: UNITS.of(source).toList((Source unit) =>
-          RESOLVED_UNIT5.of(new LibrarySpecificUnit(source, unit))),
-      'resolvedUnits': IMPORT_EXPORT_SOURCE_CLOSURE
-          .of(source)
-          .toMapOf(UNITS)
-          .toFlattenList((Source library, Source unit) =>
-              RESOLVED_UNIT5.of(new LibrarySpecificUnit(library, unit))),
+      UNITS_INPUT: LIBRARY_SPECIFIC_UNITS.of(source).toListOf(RESOLVED_UNIT9),
+      'thisLibraryClosureIsReady': READY_RESOLVED_UNIT9.of(source),
     };
   }
 
@@ -2742,7 +4026,7 @@
 }
 
 /**
- * An artifitial task that does nothing except to force type names resolution
+ * An artificial task that does nothing except to force type names resolution
  * for the defining and part units of a library.
  */
 class ResolveLibraryTypeNamesTask extends SourceBasedAnalysisTask {
@@ -2752,10 +4036,17 @@
   static const String LIBRARY_INPUT = 'LIBRARY_INPUT';
 
   /**
+   * The name of the [TYPE_PROVIDER] input.
+   */
+  static const String TYPE_PROVIDER_INPUT = 'TYPE_PROVIDER_INPUT';
+
+  /**
    * The task descriptor describing this kind of task.
    */
   static final TaskDescriptor DESCRIPTOR = new TaskDescriptor(
-      'ResolveLibraryTypeNamesTask', createTask, buildInputs,
+      'ResolveLibraryTypeNamesTask',
+      createTask,
+      buildInputs,
       <ResultDescriptor>[LIBRARY_ELEMENT5]);
 
   ResolveLibraryTypeNamesTask(
@@ -2767,7 +4058,18 @@
 
   @override
   void internalPerform() {
+    //
+    // Prepare inputs.
+    //
     LibraryElement library = getRequiredInput(LIBRARY_INPUT);
+    TypeProvider typeProvider = getRequiredInput(TYPE_PROVIDER_INPUT);
+    //
+    // Create the synthetic element for `loadLibrary`.
+    //
+    (library as LibraryElementImpl).createLoadLibraryFunction(typeProvider);
+    //
+    // Record outputs.
+    //
     outputs[LIBRARY_ELEMENT5] = library;
   }
 
@@ -2779,9 +4081,10 @@
   static Map<String, TaskInput> buildInputs(AnalysisTarget target) {
     Source source = target;
     return <String, TaskInput>{
-      'resolvedUnit': UNITS.of(source).toList((Source unit) =>
-          RESOLVED_UNIT3.of(new LibrarySpecificUnit(source, unit))),
-      LIBRARY_INPUT: LIBRARY_ELEMENT4.of(source)
+      'resolvedUnit':
+          LIBRARY_SPECIFIC_UNITS.of(source).toListOf(RESOLVED_UNIT3),
+      LIBRARY_INPUT: LIBRARY_ELEMENT4.of(source),
+      TYPE_PROVIDER_INPUT: TYPE_PROVIDER.of(AnalysisContextTarget.request)
     };
   }
 
@@ -2796,91 +4099,94 @@
 }
 
 /**
- * A task that builds [RESOLVED_UNIT5] for a unit.
+ * A task that resolves the bodies of top-level functions, constructors, and
+ * methods within a single compilation unit.
  */
-class ResolveUnitReferencesTask extends SourceBasedAnalysisTask {
+class ResolveUnitTask extends SourceBasedAnalysisTask {
   /**
-   * The name of the [LIBRARY_ELEMENT5] input.
+   * The name of the input whose value is the defining [LIBRARY_ELEMENT5].
    */
   static const String LIBRARY_INPUT = 'LIBRARY_INPUT';
 
   /**
-   * The name of the [RESOLVED_UNIT4] input.
-   */
-  static const String UNIT_INPUT = 'UNIT_INPUT';
-
-  /**
    * The name of the [TYPE_PROVIDER] input.
    */
   static const String TYPE_PROVIDER_INPUT = 'TYPE_PROVIDER_INPUT';
 
   /**
-   * The task descriptor describing this kind of task.
+   * The name of the [RESOLVED_UNIT8] input.
    */
-  static final TaskDescriptor DESCRIPTOR = new TaskDescriptor(
-      'ResolveUnitReferencesTask', createTask, buildInputs, <ResultDescriptor>[
-    RESOLVE_REFERENCES_ERRORS,
-    RESOLVED_UNIT5
-  ]);
+  static const String UNIT_INPUT = 'UNIT_INPUT';
 
-  ResolveUnitReferencesTask(
-      InternalAnalysisContext context, AnalysisTarget target)
-      : super(context, target);
+  static final TaskDescriptor DESCRIPTOR = new TaskDescriptor(
+      'ResolveUnitTask',
+      createTask,
+      buildInputs,
+      <ResultDescriptor>[RESOLVE_UNIT_ERRORS, RESOLVED_UNIT9]);
+
+  ResolveUnitTask(
+      InternalAnalysisContext context, LibrarySpecificUnit compilationUnit)
+      : super(context, compilationUnit);
 
   @override
   TaskDescriptor get descriptor => DESCRIPTOR;
 
   @override
   void internalPerform() {
-    RecordingErrorListener errorListener = new RecordingErrorListener();
     //
     // Prepare inputs.
     //
     LibraryElement libraryElement = getRequiredInput(LIBRARY_INPUT);
     CompilationUnit unit = getRequiredInput(UNIT_INPUT);
-    CompilationUnitElement unitElement = unit.element;
     TypeProvider typeProvider = getRequiredInput(TYPE_PROVIDER_INPUT);
     //
-    // Resolve references.
+    // Resolve everything.
     //
-    InheritanceManager inheritanceManager =
-        new InheritanceManager(libraryElement);
-    AstVisitor visitor = new ResolverVisitor(
-        libraryElement, unitElement.source, typeProvider, errorListener,
-        inheritanceManager: inheritanceManager);
+    CompilationUnitElement unitElement = unit.element;
+    RecordingErrorListener errorListener = new RecordingErrorListener();
+    ResolverVisitor visitor = new ResolverVisitor(
+        libraryElement, unitElement.source, typeProvider, errorListener);
     unit.accept(visitor);
     //
     // Record outputs.
     //
-    outputs[RESOLVE_REFERENCES_ERRORS] =
-        removeDuplicateErrors(errorListener.errors);
-    outputs[RESOLVED_UNIT5] = unit;
+    // TODO(brianwilkerson) This task modifies the element model (by copying the
+    // AST's for constructor initializers into it) but does not produce an
+    // updated version of the element model.
+    //
+    outputs[RESOLVE_UNIT_ERRORS] = errorListener.errors;
+    outputs[RESOLVED_UNIT9] = unit;
   }
 
   /**
    * 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].
+   * input descriptors describing those inputs for a task with the given
+   * [target].
    */
   static Map<String, TaskInput> buildInputs(AnalysisTarget target) {
     LibrarySpecificUnit unit = target;
     return <String, TaskInput>{
-      'fullyBuiltLibraryElements': IMPORT_EXPORT_SOURCE_CLOSURE
-          .of(unit.library)
-          .toListOf(LIBRARY_ELEMENT5),
       LIBRARY_INPUT: LIBRARY_ELEMENT5.of(unit.library),
-      UNIT_INPUT: RESOLVED_UNIT4.of(unit),
-      TYPE_PROVIDER_INPUT: TYPE_PROVIDER.of(AnalysisContextTarget.request)
+      TYPE_PROVIDER_INPUT: TYPE_PROVIDER.of(AnalysisContextTarget.request),
+      UNIT_INPUT: RESOLVED_UNIT8.of(unit),
+      // In strong mode, add additional dependencies to enforce inference
+      // ordering.
+
+      // Require that inference be complete for all units in the
+      // current library cycle.
+      'orderLibraryCycleTasks': LIBRARY_CYCLE_UNITS.of(unit).toList(
+          (CompilationUnitElementImpl unit) => RESOLVED_UNIT8
+              .of(new LibrarySpecificUnit(unit.librarySource, unit.source)))
     };
   }
 
   /**
-   * Create a [ResolveUnitReferencesTask] based on the given [target] in
+   * Create a [ResolveUnitTask] based on the given [target] in
    * the given [context].
    */
-  static ResolveUnitReferencesTask createTask(
+  static ResolveUnitTask createTask(
       AnalysisContext context, AnalysisTarget target) {
-    return new ResolveUnitReferencesTask(context, target);
+    return new ResolveUnitTask(context, target);
   }
 }
 
@@ -2907,10 +4213,10 @@
    * The task descriptor describing this kind of task.
    */
   static final TaskDescriptor DESCRIPTOR = new TaskDescriptor(
-      'ResolveUnitTypeNamesTask', createTask, buildInputs, <ResultDescriptor>[
-    RESOLVE_TYPE_NAMES_ERRORS,
-    RESOLVED_UNIT3
-  ]);
+      'ResolveUnitTypeNamesTask',
+      createTask,
+      buildInputs,
+      <ResultDescriptor>[RESOLVE_TYPE_NAMES_ERRORS, RESOLVED_UNIT3]);
 
   ResolveUnitTypeNamesTask(
       InternalAnalysisContext context, AnalysisTarget target)
@@ -2921,7 +4227,6 @@
 
   @override
   void internalPerform() {
-    RecordingErrorListener errorListener = new RecordingErrorListener();
     //
     // Prepare inputs.
     //
@@ -2932,6 +4237,7 @@
     //
     // Resolve TypeName nodes.
     //
+    RecordingErrorListener errorListener = new RecordingErrorListener();
     TypeResolverVisitor visitor = new TypeResolverVisitor(
         library, unitElement.source, typeProvider, errorListener);
     unit.accept(visitor);
@@ -2949,6 +4255,9 @@
    * given [target].
    */
   static Map<String, TaskInput> buildInputs(AnalysisTarget target) {
+    // TODO(brianwilkerson) This task updates the element model to have type
+    // information and updates the class hierarchy. It should produce a new
+    // version of the element model in order to record those changes.
     LibrarySpecificUnit unit = target;
     return <String, TaskInput>{
       'importsExportNamespace':
@@ -2992,7 +4301,9 @@
    * The task descriptor describing this kind of task.
    */
   static final TaskDescriptor DESCRIPTOR = new TaskDescriptor(
-      'ResolveVariableReferencesTask', createTask, buildInputs,
+      'ResolveVariableReferencesTask',
+      createTask,
+      buildInputs,
       <ResultDescriptor>[RESOLVED_UNIT4, VARIABLE_REFERENCE_ERRORS]);
 
   ResolveVariableReferencesTask(
@@ -3004,19 +4315,19 @@
 
   @override
   void internalPerform() {
-    RecordingErrorListener errorListener = new RecordingErrorListener();
     //
     // Prepare inputs.
     //
     LibraryElement libraryElement = getRequiredInput(LIBRARY_INPUT);
     CompilationUnit unit = getRequiredInput(UNIT_INPUT);
     CompilationUnitElement unitElement = unit.element;
+    TypeProvider typeProvider = getRequiredInput(TYPE_PROVIDER_INPUT);
     //
     // Resolve local variables.
     //
-    TypeProvider typeProvider = getRequiredInput(TYPE_PROVIDER_INPUT);
+    RecordingErrorListener errorListener = new RecordingErrorListener();
     Scope nameScope = new LibraryScope(libraryElement, errorListener);
-    AstVisitor visitor = new VariableResolverVisitor(
+    VariableResolverVisitor visitor = new VariableResolverVisitor(
         libraryElement, unitElement.source, typeProvider, errorListener,
         nameScope: nameScope);
     unit.accept(visitor);
@@ -3037,7 +4348,7 @@
     LibrarySpecificUnit unit = target;
     return <String, TaskInput>{
       LIBRARY_INPUT: LIBRARY_ELEMENT1.of(unit.library),
-      UNIT_INPUT: RESOLVED_UNIT1.of(unit),
+      UNIT_INPUT: RESOLVED_UNIT3.of(unit),
       TYPE_PROVIDER_INPUT: TYPE_PROVIDER.of(AnalysisContextTarget.request)
     };
   }
@@ -3053,7 +4364,8 @@
 }
 
 /**
- * A task that scans the content of a file, producing a set of Dart tokens.
+ * A task that scans the content of a Dart file, producing a stream of Dart
+ * tokens, line information, and any lexical errors encountered in the process.
  */
 class ScanDartTask extends SourceBasedAnalysisTask {
   /**
@@ -3064,12 +4376,11 @@
   /**
    * The task descriptor describing this kind of task.
    */
-  static final TaskDescriptor DESCRIPTOR = new TaskDescriptor('ScanDartTask',
-      createTask, buildInputs, <ResultDescriptor>[
-    LINE_INFO,
-    SCAN_ERRORS,
-    TOKEN_STREAM
-  ]);
+  static final TaskDescriptor DESCRIPTOR = new TaskDescriptor(
+      'ScanDartTask',
+      createTask,
+      buildInputs,
+      <ResultDescriptor>[LINE_INFO, SCAN_ERRORS, TOKEN_STREAM]);
 
   /**
    * Initialize a newly created task to access the content of the source
@@ -3096,8 +4407,10 @@
           message = exception.toString();
         }
       }
-      errorListener.onError(new AnalysisError(
-          source, 0, 0, ScannerErrorCode.UNABLE_GET_CONTENT, [message]));
+      if (source.exists()) {
+        errorListener.onError(new AnalysisError(
+            source, 0, 0, ScannerErrorCode.UNABLE_GET_CONTENT, [message]));
+      }
     }
     if (target is DartScript) {
       DartScript script = target;
@@ -3110,7 +4423,8 @@
       }
       ScriptFragment fragment = fragments[0];
 
-      Scanner scanner = new Scanner(source,
+      Scanner scanner = new Scanner(
+          source,
           new SubSequenceReader(fragment.content, fragment.offset),
           errorListener);
       scanner.setSourceStart(fragment.line, fragment.column);
@@ -3163,6 +4477,80 @@
 }
 
 /**
+ * A task that builds [STRONG_MODE_ERRORS] for a unit.  Also builds
+ * [RESOLVED_UNIT] for a unit.
+ */
+class StrongModeVerifyUnitTask extends SourceBasedAnalysisTask {
+  /**
+   * The name of the [RESOLVED_UNIT10] input.
+   */
+  static const String UNIT_INPUT = 'UNIT_INPUT';
+
+  /**
+   * The name of the [TYPE_PROVIDER] input.
+   */
+  static const String TYPE_PROVIDER_INPUT = 'TYPE_PROVIDER_INPUT';
+
+  /**
+   * The task descriptor describing this kind of task.
+   */
+  static final TaskDescriptor DESCRIPTOR = new TaskDescriptor(
+      'StrongModeVerifyUnitTask',
+      createTask,
+      buildInputs,
+      <ResultDescriptor>[STRONG_MODE_ERRORS, RESOLVED_UNIT]);
+
+  StrongModeVerifyUnitTask(
+      InternalAnalysisContext context, AnalysisTarget target)
+      : super(context, target);
+
+  @override
+  TaskDescriptor get descriptor => DESCRIPTOR;
+
+  @override
+  void internalPerform() {
+    RecordingErrorListener errorListener = new RecordingErrorListener();
+    //
+    // Prepare inputs.
+    //
+    TypeProvider typeProvider = getRequiredInput(TYPE_PROVIDER_INPUT);
+    CompilationUnit unit = getRequiredInput(UNIT_INPUT);
+    if (context.analysisOptions.strongMode) {
+      unit.accept(new CodeChecker(new TypeRules(typeProvider), errorListener));
+    }
+
+    //
+    // Record outputs.
+    //
+    outputs[STRONG_MODE_ERRORS] = removeDuplicateErrors(errorListener.errors);
+    outputs[RESOLVED_UNIT] = unit;
+  }
+
+  /**
+   * 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].
+   */
+  static Map<String, TaskInput> buildInputs(AnalysisTarget target) {
+    LibrarySpecificUnit unit = target;
+    return <String, TaskInput>{
+      UNIT_INPUT: RESOLVED_UNIT10.of(unit),
+      TYPE_PROVIDER_INPUT: TYPE_PROVIDER.of(AnalysisContextTarget.request),
+      'thisLibraryClosureIsReady': READY_RESOLVED_UNIT10.of(unit.library),
+    };
+  }
+
+  /**
+   * Create a [StrongModeVerifyUnitTask] based on the given [target] in
+   * the given [context].
+   */
+  static StrongModeVerifyUnitTask createTask(
+      AnalysisContext context, AnalysisTarget target) {
+    return new StrongModeVerifyUnitTask(context, target);
+  }
+}
+
+/**
  * A task that builds [VERIFY_ERRORS] for a unit.
  */
 class VerifyUnitTask extends SourceBasedAnalysisTask {
@@ -3218,10 +4606,14 @@
     //
     // Use the ErrorVerifier to compute errors.
     //
-    ErrorVerifier errorVerifier = new ErrorVerifier(errorReporter,
-        libraryElement, typeProvider, new InheritanceManager(libraryElement),
+    ErrorVerifier errorVerifier = new ErrorVerifier(
+        errorReporter,
+        libraryElement,
+        typeProvider,
+        new InheritanceManager(libraryElement),
         context.analysisOptions.enableSuperMixins);
     unit.accept(errorVerifier);
+
     //
     // Record outputs.
     //
@@ -3269,11 +4661,7 @@
   static Map<String, TaskInput> buildInputs(AnalysisTarget target) {
     LibrarySpecificUnit unit = target;
     return <String, TaskInput>{
-      'resolvedUnits': IMPORT_EXPORT_SOURCE_CLOSURE
-          .of(unit.library)
-          .toMapOf(UNITS)
-          .toFlattenList((Source library, Source unit) =>
-              RESOLVED_UNIT.of(new LibrarySpecificUnit(library, unit))),
+      'thisLibraryClosureIsReady': READY_RESOLVED_UNIT.of(unit.library),
       UNIT_INPUT: RESOLVED_UNIT.of(unit),
       TYPE_PROVIDER_INPUT: TYPE_PROVIDER.of(AnalysisContextTarget.request)
     };
@@ -3309,25 +4697,6 @@
 }
 
 /**
- * A [TaskInput] whose value is a list of library sources imported or exported,
- * directly or indirectly by the target [Source].
- *
- * [resultDescriptor] is the type of result which should be produced for each
- * target [Source].
- */
-class _ImportExportSourceClosureTaskInput extends TaskInputImpl<List<Source>> {
-  final Source target;
-  final ResultDescriptor resultDescriptor;
-
-  _ImportExportSourceClosureTaskInput(this.target, this.resultDescriptor);
-
-  @override
-  TaskInputBuilder<List<Source>> createBuilder() =>
-      new _SourceClosureTaskInputBuilder(
-          target, _SourceClosureKind.IMPORT_EXPORT, resultDescriptor);
-}
-
-/**
  * A [TaskInput] whose value is a list of library sources imported directly
  * or indirectly by the target [Source].
  *
@@ -3391,6 +4760,9 @@
   }
 
   @override
+  bool get flushOnAccess => false;
+
+  @override
   List<Source> get inputValue {
     return _libraries.map((LibraryElement library) => library.source).toList();
   }
diff --git a/pkg/analyzer/lib/src/task/dart_work_manager.dart b/pkg/analyzer/lib/src/task/dart_work_manager.dart
index c02d594..793d9ce 100644
--- a/pkg/analyzer/lib/src/task/dart_work_manager.dart
+++ b/pkg/analyzer/lib/src/task/dart_work_manager.dart
@@ -19,9 +19,8 @@
 import 'package:analyzer/src/generated/source.dart';
 import 'package:analyzer/src/generated/utilities_collection.dart';
 import 'package:analyzer/src/task/dart.dart';
-import 'package:analyzer/src/task/driver.dart';
+import 'package:analyzer/src/task/html.dart';
 import 'package:analyzer/task/dart.dart';
-import 'package:analyzer/task/general.dart';
 import 'package:analyzer/task/model.dart';
 
 /**
@@ -43,8 +42,11 @@
    */
   static final List<ResultDescriptor> _UNIT_ERRORS = <ResultDescriptor>[
     HINTS,
-    RESOLVE_REFERENCES_ERRORS,
+    LINTS,
+    LIBRARY_UNIT_ERRORS,
     RESOLVE_TYPE_NAMES_ERRORS,
+    RESOLVE_UNIT_ERRORS,
+    STRONG_MODE_ERRORS,
     VARIABLE_REFERENCE_ERRORS,
     VERIFY_ERRORS
   ];
@@ -86,7 +88,8 @@
     analysisCache.onResultInvalidated.listen((InvalidatedResult event) {
       if (event.descriptor == LIBRARY_ERRORS_READY) {
         CacheEntry entry = event.entry;
-        if (entry.getValue(SOURCE_KIND) == SourceKind.LIBRARY) {
+        if (entry.explicitlyAdded &&
+            entry.getValue(SOURCE_KIND) == SourceKind.LIBRARY) {
           librarySourceQueue.add(entry.target);
         }
       }
@@ -113,9 +116,7 @@
     priorityResultQueue.add(new TargetedResult(target, result));
   }
 
-  /**
-   * Notifies the manager about changes in the explicit source list.
-   */
+  @override
   void applyChange(List<Source> addedSources, List<Source> changedSources,
       List<Source> removedSources) {
     addedSources = addedSources.where(_isDartSource).toList();
@@ -166,18 +167,16 @@
     }
   }
 
-  /**
-   * Return an [AnalysisErrorInfo] containing the list of all of the errors and
-   * the line info associated with the given [source]. The list of errors will
-   * be empty if the source is not known to the context or if there are no
-   * errors in the source. The errors contained in the list can be incomplete.
-   */
-  AnalysisErrorInfo getErrors(Source source) {
-    if (analysisCache.getState(source, DART_ERRORS) == CacheState.VALID) {
-      List<AnalysisError> errors = analysisCache.getValue(source, DART_ERRORS);
-      LineInfo lineInfo = analysisCache.getValue(source, LINE_INFO);
-      return new AnalysisErrorInfoImpl(errors, lineInfo);
+  @override
+  List<AnalysisError> getErrors(Source source) {
+    if (!_isDartSource(source) && source is! DartScript) {
+      return AnalysisError.NO_ERRORS;
     }
+    // If analysis is finished, use all the errors.
+    if (analysisCache.getState(source, DART_ERRORS) == CacheState.VALID) {
+      return analysisCache.getValue(source, DART_ERRORS);
+    }
+    // If analysis is in progress, combine all known partial results.
     List<AnalysisError> errors = <AnalysisError>[];
     for (ResultDescriptor descriptor in _SOURCE_ERRORS) {
       errors.addAll(analysisCache.getValue(source, descriptor));
@@ -188,8 +187,7 @@
         errors.addAll(analysisCache.getValue(unit, descriptor));
       }
     }
-    LineInfo lineInfo = analysisCache.getValue(source, LINE_INFO);
-    return new AnalysisErrorInfoImpl(errors, lineInfo);
+    return errors;
   }
 
   /**
@@ -197,6 +195,12 @@
    * Maybe empty, but not null.
    */
   List<Source> getLibrariesContainingPart(Source part) {
+    if (part.isInSystemLibrary) {
+      DartWorkManager sdkDartWorkManager = _getSdkDartWorkManager();
+      if (sdkDartWorkManager != this) {
+        return sdkDartWorkManager.getLibrariesContainingPart(part);
+      }
+    }
     List<Source> libraries = partLibrariesMap[part];
     return libraries != null ? libraries : Source.EMPTY_LIST;
   }
@@ -268,13 +272,24 @@
   @override
   void resultsComputed(
       AnalysisTarget target, Map<ResultDescriptor, dynamic> outputs) {
+    bool isDartSource = _isDartSource(target);
+    // Route SDK outputs to the SDK WorkManager.
+    if (isDartSource && target.source.isInSystemLibrary) {
+      DartWorkManager sdkWorkManager = _getSdkDartWorkManager();
+      if (sdkWorkManager != this) {
+        sdkWorkManager.resultsComputed(target, outputs);
+        return;
+      }
+    }
     // Organize sources.
-    if (_isDartSource(target)) {
+    bool isDartLibrarySource = false;
+    if (isDartSource) {
       Source source = target;
       SourceKind kind = outputs[SOURCE_KIND];
       if (kind != null) {
         unknownSourceQueue.remove(source);
         if (kind == SourceKind.LIBRARY) {
+          isDartLibrarySource = true;
           if (context.prioritySources.contains(source)) {
             _schedulePriorityLibrarySourceAnalysis(source);
           } else {
@@ -287,7 +302,7 @@
       }
     }
     // Update parts in libraries.
-    if (_isDartSource(target)) {
+    if (isDartLibrarySource) {
       Source library = target;
       List<Source> includedParts = outputs[INCLUDED_PARTS];
       if (includedParts != null) {
@@ -303,7 +318,7 @@
       }
     }
     // Update notice.
-    if (_isDartSource(target)) {
+    if (isDartSource) {
       bool shouldSetErrors = false;
       outputs.forEach((ResultDescriptor descriptor, value) {
         if (descriptor == PARSED_UNIT && value != null) {
@@ -315,7 +330,7 @@
         }
       });
       if (shouldSetErrors) {
-        AnalysisErrorInfo info = getErrors(target);
+        AnalysisErrorInfo info = context.getErrors(target);
         context.getNotice(target).setErrors(info.errors, info.lineInfo);
       }
     }
@@ -329,7 +344,7 @@
         }
       });
       if (shouldSetErrors) {
-        AnalysisErrorInfo info = getErrors(source);
+        AnalysisErrorInfo info = context.getErrors(source);
         context.getNotice(source).setErrors(info.errors, info.lineInfo);
       }
     }
@@ -340,6 +355,22 @@
   }
 
   /**
+   * Return the SDK [DartWorkManager] or this one.
+   */
+  DartWorkManager _getSdkDartWorkManager() {
+    SourceFactory sourceFactory = context.sourceFactory;
+    InternalAnalysisContext sdkContext = sourceFactory.dartSdk.context;
+    if (sdkContext != context) {
+      for (WorkManager workManager in sdkContext.workManagers) {
+        if (workManager is DartWorkManager) {
+          return workManager;
+        }
+      }
+    }
+    return this;
+  }
+
+  /**
    * Invalidate all of the resolution results computed by this context. The flag
    * [invalidateUris] should be `true` if the cached results of converting URIs
    * to source files should also be invalidated.
@@ -362,7 +393,10 @@
         unitTargets.add(target);
         Source library = target.library;
         if (context.exists(library)) {
-          librarySourceQueue.add(library);
+          CacheEntry entry = iterator.value;
+          if (entry.explicitlyAdded) {
+            librarySourceQueue.add(library);
+          }
         }
       }
     }
@@ -370,7 +404,7 @@
     unitTargets.forEach(partition.remove);
     for (Source dartSource in dartSources) {
       CacheEntry entry = partition.get(dartSource);
-      if (dartSource != null) {
+      if (entry != null) {
         // TODO(scheglov) we invalidate too much.
         // Would be nice to invalidate just URLs resolution.
         entry.setState(PARSED_UNIT, CacheState.INVALID);
@@ -378,6 +412,8 @@
         entry.setState(EXPLICITLY_IMPORTED_LIBRARIES, CacheState.INVALID);
         entry.setState(EXPORTED_LIBRARIES, CacheState.INVALID);
         entry.setState(INCLUDED_PARTS, CacheState.INVALID);
+        entry.setState(LIBRARY_SPECIFIC_UNITS, CacheState.INVALID);
+        entry.setState(UNITS, CacheState.INVALID);
       }
     }
   }
diff --git a/pkg/analyzer/lib/src/task/driver.dart b/pkg/analyzer/lib/src/task/driver.dart
index ff5767d..c6abda8 100644
--- a/pkg/analyzer/lib/src/task/driver.dart
+++ b/pkg/analyzer/lib/src/task/driver.dart
@@ -9,7 +9,7 @@
 
 import 'package:analyzer/src/context/cache.dart';
 import 'package:analyzer/src/generated/engine.dart'
-    hide AnalysisTask, AnalysisContextImpl;
+    hide AnalysisTask, AnalysisContextImpl, WorkManager;
 import 'package:analyzer/src/generated/java_engine.dart';
 import 'package:analyzer/src/generated/resolver.dart';
 import 'package:analyzer/src/generated/utilities_general.dart';
@@ -17,7 +17,10 @@
 import 'package:analyzer/src/task/manager.dart';
 import 'package:analyzer/task/model.dart';
 
-final PerformanceTag workOrderMoveNextPerfTag =
+final PerformanceTag analysisDriverProcessOutputs =
+    new PerformanceTag('AnalysisDriver.processOutputs');
+
+final PerformanceTag workOrderMoveNextPerformanceTag =
     new PerformanceTag('WorkOrder.moveNext');
 
 /**
@@ -44,7 +47,8 @@
   /**
    * The map of [ComputedResult] controllers.
    */
-  final Map<ResultDescriptor, StreamController<ComputedResult>> resultComputedControllers =
+  final Map<ResultDescriptor,
+          StreamController<ComputedResult>> resultComputedControllers =
       <ResultDescriptor, StreamController<ComputedResult>>{};
 
   /**
@@ -101,7 +105,12 @@
       WorkOrder workOrder = createWorkOrderForResult(target, result);
       if (workOrder != null) {
         while (workOrder.moveNext()) {
+//          AnalysisTask previousTask = task;
+//          String message = workOrder.current.toString();
           task = performWorkItem(workOrder.current);
+//          if (task == null) {
+//            throw new AnalysisException(message, previousTask.caughtException);
+//          }
         }
       }
       return task;
@@ -197,8 +206,10 @@
    * [descriptor] is computed.
    */
   Stream<ComputedResult> onResultComputed(ResultDescriptor descriptor) {
-    return resultComputedControllers.putIfAbsent(descriptor, () =>
-        new StreamController<ComputedResult>.broadcast(sync: true)).stream;
+    return resultComputedControllers
+        .putIfAbsent(descriptor,
+            () => new StreamController<ComputedResult>.broadcast(sync: true))
+        .stream;
   }
 
   /**
@@ -258,31 +269,33 @@
     AnalysisTask task = item.buildTask();
     _onTaskStartedController.add(task);
     task.perform();
-    AnalysisTarget target = task.target;
-    CacheEntry entry = context.getCacheEntry(target);
-    if (task.caughtException == null) {
-      List<TargetedResult> dependedOn = item.inputTargetedResults.toList();
-      Map<ResultDescriptor, dynamic> outputs = task.outputs;
-      for (ResultDescriptor result in task.descriptor.results) {
-        // TODO(brianwilkerson) We could check here that a value was produced
-        // and throw an exception if not (unless we want to allow null values).
-        entry.setValue(result, outputs[result], dependedOn);
-      }
-      outputs.forEach((ResultDescriptor descriptor, value) {
-        StreamController<ComputedResult> controller =
-            resultComputedControllers[descriptor];
-        if (controller != null) {
-          ComputedResult event =
-              new ComputedResult(context, descriptor, target, value);
-          controller.add(event);
+    analysisDriverProcessOutputs.makeCurrentWhile(() {
+      AnalysisTarget target = task.target;
+      CacheEntry entry = context.getCacheEntry(target);
+      if (task.caughtException == null) {
+        List<TargetedResult> dependedOn = item.inputTargetedResults.toList();
+        Map<ResultDescriptor, dynamic> outputs = task.outputs;
+        for (ResultDescriptor result in task.descriptor.results) {
+          // TODO(brianwilkerson) We could check here that a value was produced
+          // and throw an exception if not (unless we want to allow null values).
+          entry.setValue(result, outputs[result], dependedOn);
         }
-      });
-      for (WorkManager manager in workManagers) {
-        manager.resultsComputed(target, outputs);
+        outputs.forEach((ResultDescriptor descriptor, value) {
+          StreamController<ComputedResult> controller =
+              resultComputedControllers[descriptor];
+          if (controller != null) {
+            ComputedResult event =
+                new ComputedResult(context, descriptor, target, value);
+            controller.add(event);
+          }
+        });
+        for (WorkManager manager in workManagers) {
+          manager.resultsComputed(target, outputs);
+        }
+      } else {
+        entry.setErrorState(task.caughtException, item.descriptor.results);
       }
-    } else {
-      entry.setErrorState(task.caughtException, item.descriptor.results);
-    }
+    });
     _onTaskCompletedController.add(task);
     return task;
   }
@@ -465,6 +478,14 @@
  */
 class InfiniteTaskLoopException extends AnalysisException {
   /**
+   * A concrete cyclic path of [TargetedResults] within the [dependencyCycle],
+   * `null` if no such path exists.  All nodes in the path are in the
+   * dependencyCycle, but the path is not guaranteed to cover the
+   * entire cycle.
+   */
+  final List<TargetedResult> cyclicPath;
+
+  /**
    * If a dependency cycle was found while computing the inputs for the task,
    * the set of [WorkItem]s contained in the cycle (if there are overlapping
    * cycles, this is the set of all [WorkItem]s in the entire strongly
@@ -476,8 +497,10 @@
    * Initialize a newly created exception to represent a failed attempt to
    * perform the given [task] due to the given [dependencyCycle].
    */
-  InfiniteTaskLoopException(AnalysisTask task, this.dependencyCycle) : super(
-          'Infinite loop while performing task ${task.descriptor.name} for ${task.target}');
+  InfiniteTaskLoopException(AnalysisTask task, this.dependencyCycle,
+      [this.cyclicPath])
+      : super(
+            'Infinite loop while performing task ${task.descriptor.name} for ${task.target}');
 }
 
 /**
@@ -502,11 +525,26 @@
 }
 
 /**
- * A description of a single anaysis task that can be performed to advance
+ * A description of a single analysis task that can be performed to advance
  * analysis.
  */
 class WorkItem {
   /**
+   * A table mapping the names of analysis tasks to the number of times each
+   * kind of task has been performed.
+   */
+  static final Map<TaskDescriptor, int> countMap =
+      new HashMap<TaskDescriptor, int>();
+
+  /**
+   * A table mapping the names of analysis tasks to stopwatches used to compute
+   * how much time was spent between creating an item and creating (for
+   * performing) of each kind of task
+   */
+  static final Map<TaskDescriptor, Stopwatch> stopwatchMap =
+      new HashMap<TaskDescriptor, Stopwatch>();
+
+  /**
    * The context in which the task will be performed.
    */
   final InternalAnalysisContext context;
@@ -527,6 +565,11 @@
   final ResultDescriptor spawningResult;
 
   /**
+   * The current inputs computing stopwatch.
+   */
+  Stopwatch stopwatch;
+
+  /**
    * An iterator used to iterate over the descriptors of the inputs to the task,
    * or `null` if all of the inputs have been collected and the task can be
    * created.
@@ -565,10 +608,10 @@
    * described by the given descriptor.
    */
   WorkItem(this.context, this.target, this.descriptor, this.spawningResult) {
-    AnalysisTarget actualTarget = identical(
-            target, AnalysisContextTarget.request)
-        ? new AnalysisContextTarget(context)
-        : target;
+    AnalysisTarget actualTarget =
+        identical(target, AnalysisContextTarget.request)
+            ? new AnalysisContextTarget(context)
+            : target;
     Map<String, TaskInput> inputDescriptors =
         descriptor.createTaskInputs(actualTarget);
     builder = new TopLevelTaskInputBuilder(inputDescriptors);
@@ -576,6 +619,19 @@
       builder = null;
     }
     inputs = new HashMap<String, dynamic>();
+    // Update performance counters.
+    {
+      stopwatch = stopwatchMap[descriptor];
+      if (stopwatch == null) {
+        stopwatch = new Stopwatch();
+        stopwatchMap[descriptor] = stopwatch;
+      }
+      stopwatch.start();
+    }
+    {
+      int count = countMap[descriptor];
+      countMap[descriptor] = count == null ? 1 : count + 1;
+    }
   }
 
   @override
@@ -595,6 +651,7 @@
    * Build the task represented by this work item.
    */
   AnalysisTask buildTask() {
+    stopwatch.stop();
     if (builder != null) {
       throw new StateError("some inputs have not been computed");
     }
@@ -658,6 +715,9 @@
         }
       } else {
         builder.currentValue = inputEntry.getValue(inputResult);
+        if (builder.flushOnAccess) {
+          inputEntry.setState(inputResult, CacheState.FLUSHED);
+        }
       }
       if (!builder.moveNext()) {
         inputs = builder.inputValue;
@@ -672,42 +732,6 @@
 }
 
 /**
- * [AnalysisDriver] uses [WorkManager]s to select results to compute.
- *
- * They know specific of the targets and results they care about,
- * so they can request analysis results in optimal order.
- */
-abstract class WorkManager {
-  /**
-   * Notifies the managers that the given set of priority [targets] was set.
-   */
-  void applyPriorityTargets(List<AnalysisTarget> targets);
-
-  /**
-   * Return the next [TargetedResult] that this work manager wants to be
-   * computed, or `null` if this manager doesn't need any new results.
-   */
-  TargetedResult getNextResult();
-
-  /**
-   * Return the priority if the next work order this work manager want to be
-   * computed. The [AnalysisDriver] will perform the work order with
-   * the highest priority.
-   *
-   * Even if the returned value is [WorkOrderPriority.NONE], it still does not
-   * guarantee that [getNextResult] will return not `null`.
-   */
-  WorkOrderPriority getNextResultPriority();
-
-  /**
-   * Notifies the manager that the given [outputs] were produced for
-   * the given [target].
-   */
-  void resultsComputed(
-      AnalysisTarget target, Map<ResultDescriptor, dynamic> outputs);
-}
-
-/**
  * A description of the work to be done to compute a desired analysis result.
  * The class implements a lazy depth-first traversal of the work item's input.
  */
@@ -743,9 +767,11 @@
     }
   }
 
+  List<WorkItem> get workItems => _dependencyWalker._path;
+
   @override
   bool moveNext() {
-    return workOrderMoveNextPerfTag.makeCurrentWhile(() {
+    return workOrderMoveNextPerformanceTag.makeCurrentWhile(() {
       if (currentItems != null && currentItems.length > 1) {
         // Yield more items.
         currentItems.removeLast();
@@ -774,32 +800,7 @@
 }
 
 /**
- * The priorities of work orders returned by [WorkManager]s.
- */
-enum WorkOrderPriority {
-  /**
-   * Responding to an user's action.
-   */
-  INTERACTIVE,
-
-  /**
-   * Computing information for priority sources.
-   */
-  PRIORITY,
-
-  /**
-   * A work should be done, but without any special urgency.
-   */
-  NORMAL,
-
-  /**
-   * Nothing to do.
-   */
-  NONE
-}
-
-/**
- * Specilaization of [CycleAwareDependencyWalker] for use by [WorkOrder].
+ * Specialization of [CycleAwareDependencyWalker] for use by [WorkOrder].
  */
 class _WorkOrderDependencyWalker extends CycleAwareDependencyWalker<WorkItem> {
   /**
diff --git a/pkg/analyzer/lib/src/task/html.dart b/pkg/analyzer/lib/src/task/html.dart
index 0722ed4..b603f1f 100644
--- a/pkg/analyzer/lib/src/task/html.dart
+++ b/pkg/analyzer/lib/src/task/html.dart
@@ -6,10 +6,13 @@
 
 import 'dart:collection';
 
+import 'package:analyzer/src/context/cache.dart';
 import 'package:analyzer/src/generated/engine.dart' hide AnalysisTask;
 import 'package:analyzer/src/generated/error.dart';
+import 'package:analyzer/src/generated/java_engine.dart';
+import 'package:analyzer/src/generated/scanner.dart';
 import 'package:analyzer/src/generated/source.dart';
-import 'package:analyzer/src/task/dart.dart';
+import 'package:analyzer/src/plugin/engine_plugin.dart';
 import 'package:analyzer/src/task/general.dart';
 import 'package:analyzer/task/dart.dart';
 import 'package:analyzer/task/general.dart';
@@ -18,9 +21,6 @@
 import 'package:html/dom.dart';
 import 'package:html/parser.dart';
 import 'package:source_span/source_span.dart';
-import 'package:analyzer/src/context/cache.dart';
-import 'package:analyzer/src/generated/java_engine.dart';
-import 'package:analyzer/src/generated/scanner.dart';
 
 /**
  * The Dart scripts that are embedded in an HTML file.
@@ -107,11 +107,11 @@
   /**
    * The task descriptor describing this kind of task.
    */
-  static final TaskDescriptor DESCRIPTOR = new TaskDescriptor('DartScriptsTask',
-      createTask, buildInputs, <ResultDescriptor>[
-    DART_SCRIPTS,
-    REFERENCED_LIBRARIES
-  ]);
+  static final TaskDescriptor DESCRIPTOR = new TaskDescriptor(
+      'DartScriptsTask',
+      createTask,
+      buildInputs,
+      <ResultDescriptor>[DART_SCRIPTS, REFERENCED_LIBRARIES]);
 
   DartScriptsTask(InternalAnalysisContext context, AnalysisTarget target)
       : super(context, target);
@@ -190,17 +190,17 @@
  */
 class HtmlErrorsTask extends SourceBasedAnalysisTask {
   /**
+   * The suffix to add to the names of contributed error results.
+   */
+  static const String INPUT_SUFFIX = '_input';
+
+  /**
    * The name of the input that is a list of errors from each of the embedded
    * Dart scripts.
    */
   static const String DART_ERRORS_INPUT = 'DART_ERRORS';
 
   /**
-   * The name of the [HTML_DOCUMENT_ERRORS] input.
-   */
-  static const String DOCUMENT_ERRORS_INPUT = 'DOCUMENT_ERRORS';
-
-  /**
    * The task descriptor describing this kind of task.
    */
   static final TaskDescriptor DESCRIPTOR = new TaskDescriptor('HtmlErrorsTask',
@@ -214,24 +214,26 @@
 
   @override
   void internalPerform() {
+    EnginePlugin enginePlugin = AnalysisEngine.instance.enginePlugin;
     //
     // Prepare inputs.
     //
     List<List<AnalysisError>> dartErrors = getRequiredInput(DART_ERRORS_INPUT);
-    List<AnalysisError> documentErrors =
-        getRequiredInput(DOCUMENT_ERRORS_INPUT);
+    List<List<AnalysisError>> htmlErrors = <List<AnalysisError>>[];
+    for (ResultDescriptor result in enginePlugin.htmlErrors) {
+      String inputName = result.name + INPUT_SUFFIX;
+      htmlErrors.add(getRequiredInput(inputName));
+    }
     //
     // Compute the error list.
     //
-    List<AnalysisError> errors = <AnalysisError>[];
-    errors.addAll(documentErrors);
-    for (List<AnalysisError> scriptErrors in dartErrors) {
-      errors.addAll(scriptErrors);
-    }
+    List<List<AnalysisError>> errorLists = <List<AnalysisError>>[];
+    errorLists.addAll(dartErrors);
+    errorLists.addAll(htmlErrors);
     //
     // Record outputs.
     //
-    outputs[HTML_ERRORS] = removeDuplicateErrors(errors);
+    outputs[HTML_ERRORS] = AnalysisError.mergeLists(errorLists);
   }
 
   /**
@@ -240,10 +242,15 @@
    * given [target].
    */
   static Map<String, TaskInput> buildInputs(Source target) {
-    return <String, TaskInput>{
-      DOCUMENT_ERRORS_INPUT: HTML_DOCUMENT_ERRORS.of(target),
+    EnginePlugin enginePlugin = AnalysisEngine.instance.enginePlugin;
+    Map<String, TaskInput> inputs = <String, TaskInput>{
       DART_ERRORS_INPUT: DART_SCRIPTS.of(target).toListOf(DART_ERRORS)
     };
+    for (ResultDescriptor result in enginePlugin.htmlErrors) {
+      String inputName = result.name + INPUT_SUFFIX;
+      inputs[inputName] = result.of(target);
+    }
+    return inputs;
   }
 
   /**
@@ -268,11 +275,11 @@
   /**
    * The task descriptor describing this kind of task.
    */
-  static final TaskDescriptor DESCRIPTOR = new TaskDescriptor('ParseHtmlTask',
-      createTask, buildInputs, <ResultDescriptor>[
-    HTML_DOCUMENT,
-    HTML_DOCUMENT_ERRORS
-  ]);
+  static final TaskDescriptor DESCRIPTOR = new TaskDescriptor(
+      'ParseHtmlTask',
+      createTask,
+      buildInputs,
+      <ResultDescriptor>[HTML_DOCUMENT, HTML_DOCUMENT_ERRORS, LINE_INFO]);
 
   /**
    * Initialize a newly created task to access the content of the source
@@ -291,7 +298,8 @@
     if (context.getModificationStamp(target.source) < 0) {
       String message = 'Content could not be read';
       if (context is InternalAnalysisContext) {
-        CacheEntry entry = (context as InternalAnalysisContext).getCacheEntry(target);
+        CacheEntry entry =
+            (context as InternalAnalysisContext).getCacheEntry(target);
         CaughtException exception = entry.exception;
         if (exception != null) {
           message = exception.toString();
@@ -299,22 +307,35 @@
       }
 
       outputs[HTML_DOCUMENT] = new Document();
-      outputs[HTML_DOCUMENT_ERRORS] = <AnalysisError>[new AnalysisError(
-          target.source, 0, 0, ScannerErrorCode.UNABLE_GET_CONTENT, [message])];
+      outputs[HTML_DOCUMENT_ERRORS] = <AnalysisError>[
+        new AnalysisError(
+            target.source, 0, 0, ScannerErrorCode.UNABLE_GET_CONTENT, [message])
+      ];
+      outputs[LINE_INFO] = new LineInfo(<int>[0]);
     } else {
       HtmlParser parser = new HtmlParser(content, generateSpans: true);
       parser.compatMode = 'quirks';
       Document document = parser.parse();
-      List<ParseError> parseErrors = parser.errors;
+      //
+      // Convert errors.
+      //
       List<AnalysisError> errors = <AnalysisError>[];
-      for (ParseError parseError in parseErrors) {
-        SourceSpan span = parseError.span;
-        errors.add(new AnalysisError(target.source, span.start.offset,
-            span.length, HtmlErrorCode.PARSE_ERROR, [parseError.message]));
-      }
-
+      // TODO(scheglov) https://github.com/dart-lang/sdk/issues/24643
+//      List<ParseError> parseErrors = parser.errors;
+//      for (ParseError parseError in parseErrors) {
+//        if (parseError.errorCode == 'expected-doctype-but-got-start-tag') {
+//          continue;
+//        }
+//        SourceSpan span = parseError.span;
+//        errors.add(new AnalysisError(target.source, span.start.offset,
+//            span.length, HtmlErrorCode.PARSE_ERROR, [parseError.message]));
+//      }
+      //
+      // Record outputs.
+      //
       outputs[HTML_DOCUMENT] = document;
       outputs[HTML_DOCUMENT_ERRORS] = errors;
+      outputs[LINE_INFO] = _computeLineInfo(content);
     }
   }
 
@@ -334,6 +355,19 @@
       AnalysisContext context, AnalysisTarget target) {
     return new ParseHtmlTask(context, target);
   }
+
+  /**
+   * Compute [LineInfo] for the given [content].
+   */
+  static LineInfo _computeLineInfo(String content) {
+    List<int> lineStarts = <int>[0];
+    for (int index = 0; index < content.length; index++) {
+      if (content.codeUnitAt(index) == 0x0A) {
+        lineStarts.add(index + 1);
+      }
+    }
+    return new LineInfo(lineStarts);
+  }
 }
 
 /**
diff --git a/pkg/analyzer/lib/src/task/html_work_manager.dart b/pkg/analyzer/lib/src/task/html_work_manager.dart
index d438d51..b0e52bb 100644
--- a/pkg/analyzer/lib/src/task/html_work_manager.dart
+++ b/pkg/analyzer/lib/src/task/html_work_manager.dart
@@ -18,9 +18,7 @@
 import 'package:analyzer/src/generated/error.dart';
 import 'package:analyzer/src/generated/source.dart';
 import 'package:analyzer/src/generated/utilities_collection.dart';
-import 'package:analyzer/src/task/driver.dart';
 import 'package:analyzer/src/task/html.dart';
-import 'package:analyzer/task/general.dart';
 import 'package:analyzer/task/html.dart';
 import 'package:analyzer/task/model.dart';
 
@@ -71,9 +69,7 @@
     priorityResultQueue.add(new TargetedResult(target, result));
   }
 
-  /**
-   * Notifies the manager about changes in the explicit source list.
-   */
+  @override
   void applyChange(List<Source> addedSources, List<Source> changedSources,
       List<Source> removedSources) {
     addedSources = addedSources.where(_isHtmlSource).toList();
@@ -103,26 +99,23 @@
     }
   }
 
-  /**
-   * Return an [AnalysisErrorInfo] containing the list of all of the errors and
-   * the line info associated with the given [source]. The list of errors will
-   * be empty if the source is not known to the context or if there are no
-   * errors in the source. The errors contained in the list can be incomplete.
-   */
-  AnalysisErrorInfo getErrors(Source source) {
-    if (analysisCache.getState(source, HTML_ERRORS) == CacheState.VALID) {
-      List<AnalysisError> errors = analysisCache.getValue(source, HTML_ERRORS);
-      LineInfo lineInfo = analysisCache.getValue(source, LINE_INFO);
-      return new AnalysisErrorInfoImpl(errors, lineInfo);
+  @override
+  List<AnalysisError> getErrors(Source source) {
+    if (!_isHtmlSource(source)) {
+      return AnalysisError.NO_ERRORS;
     }
+    // If analysis is finished, use all the errors.
+    if (analysisCache.getState(source, HTML_ERRORS) == CacheState.VALID) {
+      return analysisCache.getValue(source, HTML_ERRORS);
+    }
+    // If analysis is in progress, combine all known partial results.
     List<AnalysisError> errors = <AnalysisError>[];
     errors.addAll(analysisCache.getValue(source, HTML_DOCUMENT_ERRORS));
     List<DartScript> scripts = analysisCache.getValue(source, DART_SCRIPTS);
     for (DartScript script in scripts) {
       errors.addAll(context.getErrors(script).errors);
     }
-    LineInfo lineInfo = analysisCache.getValue(source, LINE_INFO);
-    return new AnalysisErrorInfoImpl(errors, lineInfo);
+    return errors;
   }
 
   @override
@@ -139,12 +132,10 @@
     // Try to find a new HTML file to analyze.
     while (sourceQueue.isNotEmpty) {
       Source htmlSource = sourceQueue.first;
-      // Maybe done with this library.
       if (!_needsComputing(htmlSource, HTML_ERRORS)) {
         sourceQueue.remove(htmlSource);
         continue;
       }
-      // Analyze this library.
       return new TargetedResult(htmlSource, HTML_ERRORS);
     }
     // No results to compute.
@@ -210,7 +201,7 @@
         }
       });
       if (shouldSetErrors) {
-        AnalysisErrorInfo info = getErrors(target);
+        AnalysisErrorInfo info = context.getErrors(target);
         context.getNotice(target).setErrors(info.errors, info.lineInfo);
       }
     }
@@ -240,7 +231,7 @@
     scriptTargets.forEach(partition.remove);
     for (Source htmlSource in htmlSources) {
       CacheEntry entry = partition.get(htmlSource);
-      if (htmlSource != null) {
+      if (entry != null) {
         entry.setState(HTML_ERRORS, CacheState.INVALID);
         if (invalidateUris) {
           entry.setState(REFERENCED_LIBRARIES, CacheState.INVALID);
diff --git a/pkg/analyzer/lib/src/task/incremental_element_builder.dart b/pkg/analyzer/lib/src/task/incremental_element_builder.dart
index bc562a7..d6a0c14 100644
--- a/pkg/analyzer/lib/src/task/incremental_element_builder.dart
+++ b/pkg/analyzer/lib/src/task/incremental_element_builder.dart
@@ -69,8 +69,8 @@
    * Fills [unitDelta] with added/remove elements.
    */
   void build() {
-    new CompilationUnitBuilder().buildCompilationUnit(
-        unitSource, newUnit, librarySource);
+    new CompilationUnitBuilder()
+        .buildCompilationUnit(unitSource, newUnit, librarySource);
     _processDirectives();
     _processUnitMembers();
     newUnit.element = unitElement;
diff --git a/pkg/analyzer/lib/src/task/inputs.dart b/pkg/analyzer/lib/src/task/inputs.dart
index 308b06a..2236ca0 100644
--- a/pkg/analyzer/lib/src/task/inputs.dart
+++ b/pkg/analyzer/lib/src/task/inputs.dart
@@ -24,26 +24,83 @@
  * An input to an [AnalysisTask] that is computed by accessing a single result
  * defined on a single target.
  */
+class ConstantTaskInput<V> extends TaskInputImpl<V> {
+  final V value;
+
+  ConstantTaskInput(this.value);
+
+  @override
+  TaskInputBuilder<V> createBuilder() {
+    return new ConstantTaskInputBuilder<V>(this);
+  }
+}
+
+/**
+ * A [TaskInputBuilder] used to build an input based on a [ConstantTaskInput].
+ */
+class ConstantTaskInputBuilder<V> implements TaskInputBuilder<V> {
+  final ConstantTaskInput input;
+
+  ConstantTaskInputBuilder(this.input);
+
+  @override
+  ResultDescriptor get currentResult => null;
+
+  @override
+  AnalysisTarget get currentTarget => null;
+
+  @override
+  void set currentValue(Object value) {
+    throw new StateError('Only supported after moveNext() returns true');
+  }
+
+  @override
+  bool get flushOnAccess => false;
+
+  @override
+  V get inputValue => input.value;
+
+  @override
+  void currentValueNotAvailable() {
+    throw new StateError('Only supported after moveNext() returns true');
+  }
+
+  @override
+  bool moveNext() => false;
+}
+
+/**
+ * An input to an [AnalysisTask] that is computed by accessing a single result
+ * defined on a single target.
+ */
 class ListTaskInputImpl<E> extends SimpleTaskInput<List<E>>
-    with ListTaskInputMixin<E> implements ListTaskInput<E> {
+    with ListTaskInputMixin<E>
+    implements ListTaskInput<E> {
   /**
    * Initialize a newly created task input that computes the input by accessing
    * the given [result] associated with the given [target].
    */
   ListTaskInputImpl(AnalysisTarget target, ResultDescriptor<List<E>> result)
-      : super(target, result);
+      : super._unflushable(target, result);
 }
 
 /**
  * A mixin-ready implementation of [ListTaskInput].
  */
 abstract class ListTaskInputMixin<E> implements ListTaskInput<E> {
+  @override
+  ListTaskInput /*<V>*/ toFlattenListOf(
+      ListResultDescriptor /*<V>*/ subListResult) {
+    return new ListToFlattenListTaskInput<E, dynamic /*V*/ >(
+        this, subListResult.of as dynamic);
+  }
+
   ListTaskInput /*<V>*/ toList(UnaryFunction<E, dynamic /*<V>*/ > mapper) {
     return new ListToListTaskInput<E, dynamic /*V*/ >(this, mapper);
   }
 
   ListTaskInput /*<V>*/ toListOf(ResultDescriptor /*<V>*/ valueResult) {
-    return (this as ListTaskInputImpl<AnalysisTarget>).toList(valueResult.of);
+    return (this as ListTaskInput<AnalysisTarget>).toList(valueResult.of);
   }
 
   MapTaskInput<E, dynamic /*V*/ > toMap(
@@ -64,6 +121,60 @@
  * input. Finally, each of the task inputs are used to access analysis results,
  * and the list of the analysis results is used as the input to the task.
  */
+class ListToFlattenListTaskInput<B, E>
+    extends _ListToCollectionTaskInput<B, E, List<E>>
+    with ListTaskInputMixin<E>
+    implements ListTaskInput<E> {
+  /**
+   * Initialize a result accessor to use the given [baseAccessor] to access a
+   * list of values that can be passed to the given [generateTaskInputs] to
+   * generate a list of task inputs that can be used to access the elements of
+   * the input being accessed.
+   */
+  ListToFlattenListTaskInput(TaskInput<List<B>> baseAccessor,
+      GenerateTaskInputs<B, E> generateTaskInputs)
+      : super(baseAccessor, generateTaskInputs);
+
+  @override
+  TaskInputBuilder<List<E>> createBuilder() =>
+      new ListToFlattenListTaskInputBuilder<B, E>(this);
+}
+
+/**
+ * A [TaskInputBuilder] used to build an input based on a [ListToFlattenListTaskInput].
+ */
+class ListToFlattenListTaskInputBuilder<B, E>
+    extends _ListToCollectionTaskInputBuilder<B, E, List<E>> {
+  /**
+   * The list of values being built.
+   */
+  List<E> _resultValue;
+
+  /**
+   * Initialize a newly created task input builder that computes the result
+   * specified by the given [input].
+   */
+  ListToFlattenListTaskInputBuilder(ListToFlattenListTaskInput<B, E> input)
+      : super(input);
+
+  @override
+  void _addResultElement(B baseElement, E resultElement) {
+    _resultValue.addAll(resultElement as Iterable);
+  }
+
+  @override
+  void _initResultValue() {
+    _resultValue = <E>[];
+  }
+}
+
+/**
+ * An input to an [AnalysisTask] that is computed by the following steps. First
+ * another (base) task input is used to compute a [List]-valued result. An input
+ * generator function is then used to map each element of that list to a task
+ * input. Finally, each of the task inputs are used to access analysis results,
+ * and the list of the analysis results is used as the input to the task.
+ */
 class ListToListTaskInput<B, E>
     extends _ListToCollectionTaskInput<B, E, List<E>>
     with ListTaskInputMixin<E> {
@@ -168,7 +279,8 @@
 abstract class MapTaskInputMixin<K, V> implements MapTaskInput<K, V> {
   TaskInput<List /*<E>*/ > toFlattenList(
       BinaryFunction<K, dynamic /*element of V*/, dynamic /*<E>*/ > mapper) {
-    return new MapToFlattenListTaskInput<K, dynamic /*element of V*/, dynamic /*E*/ >(
+    return new MapToFlattenListTaskInput<K, dynamic /*element of V*/,
+        dynamic /*E*/ >(
         this as MapTaskInput<K, List /*<element of V>*/ >, mapper);
   }
 }
@@ -241,6 +353,9 @@
   }
 
   @override
+  bool get flushOnAccess => currentBuilder.flushOnAccess;
+
+  @override
   void currentValueNotAvailable() {
     if (currentBuilder == null) {
       throw new StateError(
@@ -301,7 +416,8 @@
  * An input to an [AnalysisTask] that is computed by mapping the value of
  * another task input to a list of values.
  */
-class ObjectToListTaskInput<E> extends TaskInputImpl<List<E>> with ListTaskInputMixin<E>
+class ObjectToListTaskInput<E> extends TaskInputImpl<List<E>>
+    with ListTaskInputMixin<E>
     implements ListTaskInput<E> {
   /**
    * The input used to compute the value to be mapped.
@@ -324,6 +440,13 @@
       new ObjectToListTaskInputBuilder<E>(this);
 
   @override
+  ListTaskInput /*<V>*/ toFlattenListOf(
+      ListResultDescriptor /*<V>*/ subListResult) {
+    return new ListToFlattenListTaskInput<E, dynamic /*V*/ >(
+        this, subListResult.of as dynamic);
+  }
+
+  @override
   ListTaskInput /*<V>*/ toListOf(ResultDescriptor /*<V>*/ valueResult) {
     return new ListToListTaskInput<E, dynamic /*V*/ >(
         this, valueResult.of as dynamic);
@@ -391,6 +514,9 @@
   }
 
   @override
+  bool get flushOnAccess => builder.flushOnAccess;
+
+  @override
   List<E> get inputValue {
     if (builder != null) {
       throw new StateError('Result value has not been created');
@@ -442,10 +568,23 @@
   final ResultDescriptor<V> result;
 
   /**
+   * Return `true` if the value accessed by this input builder should be flushed
+   * from the cache at the time it is retrieved.
+   */
+  final bool flushOnAccess;
+
+  /**
    * Initialize a newly created task input that computes the input by accessing
    * the given [result] associated with the given [target].
    */
-  SimpleTaskInput(this.target, this.result);
+  SimpleTaskInput(this.target, this.result, {this.flushOnAccess: false});
+
+  /**
+   * Initialize a newly created task input that computes the input by accessing
+   * the given [result] associated with the given [target].
+   */
+  SimpleTaskInput._unflushable(this.target, this.result)
+      : flushOnAccess = false;
 
   @override
   TaskInputBuilder<V> createBuilder() => new SimpleTaskInputBuilder<V>(this);
@@ -517,6 +656,9 @@
   }
 
   @override
+  bool get flushOnAccess => input.flushOnAccess;
+
+  @override
   V get inputValue {
     if (_state != _AFTER) {
       throw new StateError('Result value has not been created');
@@ -625,6 +767,9 @@
   }
 
   @override
+  bool get flushOnAccess => currentBuilder.flushOnAccess;
+
+  @override
   Map<String, Object> get inputValue {
     if (nameIndex < inputNames.length) {
       throw new StateError('Result value has not been created');
@@ -672,11 +817,18 @@
       return false;
     }
     currentBuilder = inputDescriptors[_currentName].createBuilder();
-    // NOTE: This assumes that every builder will require at least one result
-    // value to be created. If that assumption is every broken, this method will
-    // need to be changed to advance until we find a builder that does require
-    // a result to be computed (or run out of builders).
-    return currentBuilder.moveNext();
+    while (!currentBuilder.moveNext()) {
+      if (currentBuilder.inputValue != null) {
+        inputs[_currentName] = currentBuilder.inputValue;
+      }
+      nameIndex++;
+      if (nameIndex >= inputNames.length) {
+        // There is no next value, so we're done.
+        return false;
+      }
+      currentBuilder = inputDescriptors[_currentName].createBuilder();
+    }
+    return true;
   }
 }
 
@@ -771,6 +923,9 @@
   }
 
   @override
+  bool get flushOnAccess => currentBuilder.flushOnAccess;
+
+  @override
   C get inputValue {
     if (currentBuilder != null || _resultValue == null) {
       throw new StateError('Result value has not been created');
diff --git a/pkg/analyzer/lib/src/task/model.dart b/pkg/analyzer/lib/src/task/model.dart
index 9ef568e..50c05ee 100644
--- a/pkg/analyzer/lib/src/task/model.dart
+++ b/pkg/analyzer/lib/src/task/model.dart
@@ -29,8 +29,12 @@
       : super(name, defaultValue, cachingPolicy: cachingPolicy);
 
   @override
-  ListTaskInput<E> of(AnalysisTarget target) =>
-      new ListTaskInputImpl<E>(target, this);
+  ListTaskInput<E> of(AnalysisTarget target, {bool flushOnAccess: false}) {
+    if (flushOnAccess) {
+      throw new StateError('Cannot flush a list of values');
+    }
+    return new ListTaskInputImpl<E>(target, this);
+  }
 }
 
 /**
@@ -71,8 +75,8 @@
   }
 
   @override
-  TaskInput<V> of(AnalysisTarget target) =>
-      new SimpleTaskInput<V>(target, this);
+  TaskInput<V> of(AnalysisTarget target, {bool flushOnAccess: false}) =>
+      new SimpleTaskInput<V>(target, this, flushOnAccess: flushOnAccess);
 
   @override
   String toString() => name;
diff --git a/pkg/analyzer/lib/src/task/options.dart b/pkg/analyzer/lib/src/task/options.dart
new file mode 100644
index 0000000..9f22f7f
--- /dev/null
+++ b/pkg/analyzer/lib/src/task/options.dart
@@ -0,0 +1,165 @@
+// 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.src.task.options;
+
+import 'package:analyzer/analyzer.dart';
+import 'package:analyzer/plugin/options.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:analyzer/src/task/general.dart';
+import 'package:analyzer/task/general.dart';
+import 'package:analyzer/task/model.dart';
+import 'package:source_span/source_span.dart';
+import 'package:yaml/yaml.dart';
+
+/// The errors produced while parsing `.analysis_options` files.
+///
+/// The list will be empty if there were no errors, but will not be `null`.
+final ListResultDescriptor<AnalysisError> ANALYSIS_OPTIONS_ERRORS =
+    new ListResultDescriptor<AnalysisError>(
+        'ANALYSIS_OPTIONS_ERRORS', AnalysisError.NO_ERRORS);
+
+/// Validates `analyzer` top-level options.
+class AnalyzerOptionsValidator extends TopLevelOptionValidator {
+  AnalyzerOptionsValidator()
+      : super('analyzer', const ['exclude', 'plugins', 'strong-mode']);
+}
+
+/// Convenience class for composing validators.
+class CompositeValidator extends OptionsValidator {
+  final List<OptionsValidator> validators;
+  CompositeValidator(this.validators);
+
+  @override
+  void validate(ErrorReporter reporter, Map<String, YamlNode> options) =>
+      validators.forEach((v) => v.validate(reporter, options));
+}
+
+/// A task that generates errors for an `.analysis_options` file.
+class GenerateOptionsErrorsTask extends SourceBasedAnalysisTask {
+  /// The name of the input whose value is the content of the file.
+  static const String CONTENT_INPUT_NAME = 'CONTENT_INPUT_NAME';
+
+  /// The task descriptor describing this kind of task.
+  static final TaskDescriptor DESCRIPTOR = new TaskDescriptor(
+      'GenerateOptionsErrorsTask',
+      createTask,
+      buildInputs,
+      <ResultDescriptor>[ANALYSIS_OPTIONS_ERRORS, LINE_INFO]);
+
+  final AnalysisOptionsProvider optionsProvider = new AnalysisOptionsProvider();
+
+  GenerateOptionsErrorsTask(AnalysisContext context, AnalysisTarget target)
+      : super(context, target);
+
+  @override
+  TaskDescriptor get descriptor => DESCRIPTOR;
+
+  Source get source => target.source;
+
+  @override
+  void internalPerform() {
+    String content = getRequiredInput(CONTENT_INPUT_NAME);
+
+    List<AnalysisError> errors = <AnalysisError>[];
+
+    try {
+      Map<String, YamlNode> options =
+          optionsProvider.getOptionsFromString(content);
+      errors.addAll(_validate(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);
+    }
+
+    //
+    // Record outputs.
+    //
+    outputs[ANALYSIS_OPTIONS_ERRORS] = errors;
+    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].
+  static Map<String, TaskInput> buildInputs(Source source) =>
+      <String, TaskInput>{CONTENT_INPUT_NAME: CONTENT.of(source)};
+
+  /// Create a task based on the given [target] in the given [context].
+  static GenerateOptionsErrorsTask createTask(
+          AnalysisContext context, AnalysisTarget target) =>
+      new GenerateOptionsErrorsTask(context, target);
+
+  /// Compute [LineInfo] for the given [content].
+  static LineInfo _computeLineInfo(String content) {
+    List<int> lineStarts = <int>[0];
+    for (int index = 0; index < content.length; index++) {
+      if (content.codeUnitAt(index) == 0x0A) {
+        lineStarts.add(index + 1);
+      }
+    }
+    return new LineInfo(lineStarts);
+  }
+}
+
+/// Validates `linter` top-level options.
+/// TODO(pq): move into `linter` package and plugin.
+class LinterOptionsValidator extends TopLevelOptionValidator {
+  LinterOptionsValidator() : super('linter', const ['rules']);
+}
+
+/// Validates options defined in an `.analysis_options` file.
+class OptionsFileValidator {
+  // TODO(pq): move to an extension point.
+  final List<OptionsValidator> _validators = [
+    new AnalyzerOptionsValidator(),
+    new LinterOptionsValidator()
+  ];
+
+  final Source source;
+  OptionsFileValidator(this.source) {
+    _validators.addAll(AnalysisEngine.instance.optionsPlugin.optionsValidators);
+  }
+
+  List<AnalysisError> validate(Map<String, YamlNode> options) {
+    RecordingErrorListener recorder = new RecordingErrorListener();
+    ErrorReporter reporter = new ErrorReporter(recorder, source);
+    _validators.forEach((OptionsValidator v) => v.validate(reporter, options));
+    return recorder.errors;
+  }
+}
+
+/// Validates top-level options. For example,
+///     plugin:
+///       top-level-option: true
+class TopLevelOptionValidator extends OptionsValidator {
+  final String pluginName;
+  final List<String> supportedOptions;
+
+  TopLevelOptionValidator(this.pluginName, this.supportedOptions);
+  @override
+  void validate(ErrorReporter reporter, Map<String, YamlNode> options) {
+    YamlNode node = options[pluginName];
+    if (node is YamlMap) {
+      node.nodes.forEach((k, v) {
+        if (k is YamlScalar) {
+          if (!supportedOptions.contains(k.value)) {
+            reporter.reportErrorForSpan(
+                AnalysisOptionsWarningCode.UNSUPPORTED_OPTION,
+                k.span,
+                [pluginName, k.value]);
+          }
+        }
+        //TODO(pq): consider an error if the node is not a Scalar.
+      });
+    }
+  }
+}
diff --git a/pkg/analyzer/lib/src/task/options_work_manager.dart b/pkg/analyzer/lib/src/task/options_work_manager.dart
new file mode 100644
index 0000000..4447f30
--- /dev/null
+++ b/pkg/analyzer/lib/src/task/options_work_manager.dart
@@ -0,0 +1,174 @@
+// 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.src.task.options_work_manager;
+
+import 'dart:collection';
+
+import 'package:analyzer/src/context/cache.dart';
+import 'package:analyzer/src/generated/engine.dart'
+    show
+        AnalysisEngine,
+        AnalysisErrorInfo,
+        AnalysisErrorInfoImpl,
+        AnalysisOptions,
+        CacheState,
+        InternalAnalysisContext;
+import 'package:analyzer/src/generated/error.dart';
+import 'package:analyzer/src/generated/source.dart';
+import 'package:analyzer/src/task/options.dart';
+import 'package:analyzer/task/model.dart';
+
+/// The manager for `.analysis_options` specific analysis.
+class OptionsWorkManager implements WorkManager {
+  /// The context for which work is being managed.
+  final InternalAnalysisContext context;
+
+  /// The options file sources.
+  final LinkedHashSet<Source> sourceQueue = new LinkedHashSet<Source>();
+
+  /// The [TargetedResult]s that should be computed with priority.
+  final LinkedHashSet<TargetedResult> priorityResultQueue =
+      new LinkedHashSet<TargetedResult>();
+
+  /// Initialize a newly created manager.
+  OptionsWorkManager(this.context) {
+    analysisCache.onResultInvalidated.listen(onResultInvalidated);
+  }
+
+  /// Returns the correctly typed result of `context.analysisCache`.
+  AnalysisCache get analysisCache => context.analysisCache;
+
+  /// Specifies that the client wants the given [result] of the given [target]
+  /// to be computed with priority.
+  void addPriorityResult(AnalysisTarget target, ResultDescriptor result) {
+    priorityResultQueue.add(new TargetedResult(target, result));
+  }
+
+  @override
+  void applyChange(List<Source> addedSources, List<Source> changedSources,
+      List<Source> removedSources) {
+    addedSources = addedSources.where(_isOptionsSource).toList();
+    changedSources = changedSources.where(_isOptionsSource).toList();
+    removedSources = removedSources.where(_isOptionsSource).toList();
+    // source queue
+    sourceQueue.addAll(addedSources);
+    sourceQueue.addAll(changedSources);
+    sourceQueue.removeAll(removedSources);
+  }
+
+  @override
+  void applyPriorityTargets(List<AnalysisTarget> targets) {
+    // Unschedule the old targets.
+    List<TargetedResult> resultsToUnschedule = <TargetedResult>[];
+    for (TargetedResult result in priorityResultQueue) {
+      if (result.result == ANALYSIS_OPTIONS_ERRORS) {
+        resultsToUnschedule.add(result);
+      }
+    }
+    priorityResultQueue.removeAll(resultsToUnschedule);
+    // Schedule new targets.
+    for (AnalysisTarget target in targets) {
+      if (_isOptionsSource(target)) {
+        addPriorityResult(target, ANALYSIS_OPTIONS_ERRORS);
+      }
+    }
+  }
+
+  @override
+  List<AnalysisError> getErrors(Source source) {
+    if (!_isOptionsSource(source)) {
+      return AnalysisError.NO_ERRORS;
+    }
+    // If analysis is finished, use all the errors.
+    if (analysisCache.getState(source, ANALYSIS_OPTIONS_ERRORS) ==
+        CacheState.VALID) {
+      return analysisCache.getValue(source, ANALYSIS_OPTIONS_ERRORS);
+    }
+    // No partial results.
+    return AnalysisError.NO_ERRORS;
+  }
+
+  @override
+  TargetedResult getNextResult() {
+    // Try to find a priority result to compute.
+    while (priorityResultQueue.isNotEmpty) {
+      TargetedResult result = priorityResultQueue.first;
+      if (!_needsComputing(result.target, result.result)) {
+        priorityResultQueue.remove(result);
+        continue;
+      }
+      return result;
+    }
+    // Try to find a new options file to analyze.
+    while (sourceQueue.isNotEmpty) {
+      Source optionsSource = sourceQueue.first;
+      if (!_needsComputing(optionsSource, ANALYSIS_OPTIONS_ERRORS)) {
+        sourceQueue.remove(optionsSource);
+        continue;
+      }
+      return new TargetedResult(optionsSource, ANALYSIS_OPTIONS_ERRORS);
+    }
+    // No results to compute.
+    return null;
+  }
+
+  @override
+  WorkOrderPriority getNextResultPriority() {
+    if (priorityResultQueue.isNotEmpty) {
+      return WorkOrderPriority.PRIORITY;
+    }
+    if (sourceQueue.isNotEmpty) {
+      return WorkOrderPriority.NORMAL;
+    }
+    return WorkOrderPriority.NONE;
+  }
+
+  @override
+  void onAnalysisOptionsChanged() {
+    // Do nothing.
+  }
+
+  /// Notifies the manager that a result has been invalidated.
+  void onResultInvalidated(InvalidatedResult event) {
+    ResultDescriptor descriptor = event.descriptor;
+    if (descriptor == ANALYSIS_OPTIONS_ERRORS) {
+      sourceQueue.add(event.entry.target);
+    }
+  }
+
+  @override
+  void onSourceFactoryChanged() {
+    // Do nothing.
+  }
+
+  @override
+  void resultsComputed(
+      AnalysisTarget target, Map<ResultDescriptor, dynamic> outputs) {
+    // Update notice.
+    if (_isOptionsSource(target)) {
+      bool shouldSetErrors = false;
+      outputs.forEach((ResultDescriptor descriptor, value) {
+        if (descriptor == ANALYSIS_OPTIONS_ERRORS) {
+          shouldSetErrors = true;
+        }
+      });
+      if (shouldSetErrors) {
+        AnalysisErrorInfo info = context.getErrors(target);
+        context.getNotice(target).setErrors(info.errors, info.lineInfo);
+      }
+    }
+  }
+
+  /// Returns `true` if the given [result] of the given [target] needs
+  /// computing, i.e. it is not in the valid and not in the error state.
+  bool _needsComputing(AnalysisTarget target, ResultDescriptor result) {
+    CacheState state = analysisCache.getState(target, result);
+    return state != CacheState.VALID && state != CacheState.ERROR;
+  }
+
+  /// Return `true` if the given target is an `.analysis_options` source.
+  static bool _isOptionsSource(AnalysisTarget target) => target is Source &&
+      AnalysisEngine.isAnalysisOptionsFileName(target.fullName);
+}
diff --git a/pkg/analyzer/lib/src/task/strong/checker.dart b/pkg/analyzer/lib/src/task/strong/checker.dart
new file mode 100644
index 0000000..9cfefe8
--- /dev/null
+++ b/pkg/analyzer/lib/src/task/strong/checker.dart
@@ -0,0 +1,985 @@
+// 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.
+
+// TODO(jmesserly): this was ported from package:dev_compiler, and needs to be
+// refactored to fit into analyzer.
+library analyzer.src.task.strong.checker;
+
+import 'package:analyzer/analyzer.dart';
+import 'package:analyzer/src/generated/ast.dart';
+import 'package:analyzer/src/generated/element.dart';
+import 'package:analyzer/src/generated/scanner.dart' show Token, TokenType;
+
+import 'info.dart';
+import 'rules.dart';
+
+/// Checks for overriding declarations of fields and methods. This is used to
+/// check overrides between classes and superclasses, interfaces, and mixin
+/// applications.
+class _OverrideChecker {
+  bool _failure = false;
+  final TypeRules _rules;
+  final AnalysisErrorListener _reporter;
+
+  _OverrideChecker(this._rules, this._reporter);
+
+  void check(ClassDeclaration node) {
+    if (node.element.type.isObject) return;
+    _checkSuperOverrides(node);
+    _checkMixinApplicationOverrides(node);
+    _checkAllInterfaceOverrides(node);
+  }
+
+  /// Check overrides from mixin applications themselves. For example, in:
+  ///
+  ///      A extends B with E, F
+  ///
+  ///  we check:
+  ///
+  ///      B & E against B (equivalently how E overrides B)
+  ///      B & E & F against B & E (equivalently how F overrides both B and E)
+  void _checkMixinApplicationOverrides(ClassDeclaration node) {
+    var type = node.element.type;
+    var parent = type.superclass;
+    var mixins = type.mixins;
+
+    // Check overrides from applying mixins
+    for (int i = 0; i < mixins.length; i++) {
+      var seen = new Set<String>();
+      var current = mixins[i];
+      var errorLocation = node.withClause.mixinTypes[i];
+      for (int j = i - 1; j >= 0; j--) {
+        _checkIndividualOverridesFromType(
+            current, mixins[j], errorLocation, seen);
+      }
+      _checkIndividualOverridesFromType(current, parent, errorLocation, seen);
+    }
+  }
+
+  /// Check overrides between a class and its superclasses and mixins. For
+  /// example, in:
+  ///
+  ///      A extends B with E, F
+  ///
+  /// we check A against B, B super classes, E, and F.
+  ///
+  /// Internally we avoid reporting errors twice and we visit classes bottom up
+  /// to ensure we report the most immediate invalid override first. For
+  /// example, in the following code we'll report that `Test` has an invalid
+  /// override with respect to `Parent` (as opposed to an invalid override with
+  /// respect to `Grandparent`):
+  ///
+  ///     class Grandparent {
+  ///         m(A a) {}
+  ///     }
+  ///     class Parent extends Grandparent {
+  ///         m(A a) {}
+  ///     }
+  ///     class Test extends Parent {
+  ///         m(B a) {} // invalid override
+  ///     }
+  void _checkSuperOverrides(ClassDeclaration node) {
+    var seen = new Set<String>();
+    var current = node.element.type;
+    var visited = new Set<InterfaceType>();
+    do {
+      visited.add(current);
+      current.mixins.reversed
+          .forEach((m) => _checkIndividualOverridesFromClass(node, m, seen));
+      _checkIndividualOverridesFromClass(node, current.superclass, seen);
+      current = current.superclass;
+    } while (!current.isObject && !visited.contains(current));
+  }
+
+  /// Checks that implementations correctly override all reachable interfaces.
+  /// In particular, we need to check these overrides for the definitions in
+  /// the class itself and each its superclasses. If a superclass is not
+  /// abstract, then we can skip its transitive interfaces. For example, in:
+  ///
+  ///     B extends C implements G
+  ///     A extends B with E, F implements H, I
+  ///
+  /// we check:
+  ///
+  ///     C against G, H, and I
+  ///     B against G, H, and I
+  ///     E against H and I // no check against G because B is a concrete class
+  ///     F against H and I
+  ///     A against H and I
+  void _checkAllInterfaceOverrides(ClassDeclaration node) {
+    var seen = new Set<String>();
+    // Helper function to collect all reachable interfaces.
+    find(InterfaceType interfaceType, Set result) {
+      if (interfaceType == null || interfaceType.isObject) return;
+      if (result.contains(interfaceType)) return;
+      result.add(interfaceType);
+      find(interfaceType.superclass, result);
+      interfaceType.mixins.forEach((i) => find(i, result));
+      interfaceType.interfaces.forEach((i) => find(i, result));
+    }
+
+    // Check all interfaces reachable from the `implements` clause in the
+    // current class against definitions here and in superclasses.
+    var localInterfaces = new Set<InterfaceType>();
+    var type = node.element.type;
+    type.interfaces.forEach((i) => find(i, localInterfaces));
+    _checkInterfacesOverrides(node, localInterfaces, seen,
+        includeParents: true);
+
+    // Check also how we override locally the interfaces from parent classes if
+    // the parent class is abstract. Otherwise, these will be checked as
+    // overrides on the concrete superclass.
+    var superInterfaces = new Set<InterfaceType>();
+    var parent = type.superclass;
+    // TODO(sigmund): we don't seem to be reporting the analyzer error that a
+    // non-abstract class is not implementing an interface. See
+    // https://github.com/dart-lang/dart-dev-compiler/issues/25
+    while (parent != null && parent.element.isAbstract) {
+      parent.interfaces.forEach((i) => find(i, superInterfaces));
+      parent = parent.superclass;
+    }
+    _checkInterfacesOverrides(node, superInterfaces, seen,
+        includeParents: false);
+  }
+
+  /// Checks that [cls] and its super classes (including mixins) correctly
+  /// overrides each interface in [interfaces]. If [includeParents] is false,
+  /// then mixins are still checked, but the base type and it's transitive
+  /// supertypes are not.
+  ///
+  /// [cls] can be either a [ClassDeclaration] or a [InterfaceType]. For
+  /// [ClassDeclaration]s errors are reported on the member that contains the
+  /// invalid override, for [InterfaceType]s we use [errorLocation] instead.
+  void _checkInterfacesOverrides(
+      cls, Iterable<InterfaceType> interfaces, Set<String> seen,
+      {Set<InterfaceType> visited,
+      bool includeParents: true,
+      AstNode errorLocation}) {
+    var node = cls is ClassDeclaration ? cls : null;
+    var type = cls is InterfaceType ? cls : node.element.type;
+
+    if (visited == null) {
+      visited = new Set<InterfaceType>();
+    } else if (visited.contains(type)) {
+      // Malformed type.
+      return;
+    } else {
+      visited.add(type);
+    }
+
+    // Check direct overrides on [type]
+    for (var interfaceType in interfaces) {
+      if (node != null) {
+        _checkIndividualOverridesFromClass(node, interfaceType, seen);
+      } else {
+        _checkIndividualOverridesFromType(
+            type, interfaceType, errorLocation, seen);
+      }
+    }
+
+    // Check overrides from its mixins
+    for (int i = 0; i < type.mixins.length; i++) {
+      var loc =
+          errorLocation != null ? errorLocation : node.withClause.mixinTypes[i];
+      for (var interfaceType in interfaces) {
+        // We copy [seen] so we can report separately if more than one mixin or
+        // the base class have an invalid override.
+        _checkIndividualOverridesFromType(
+            type.mixins[i], interfaceType, loc, new Set.from(seen));
+      }
+    }
+
+    // Check overrides from its superclasses
+    if (includeParents) {
+      var parent = type.superclass;
+      if (parent.isObject) return;
+      var loc = errorLocation != null ? errorLocation : node.extendsClause;
+      // No need to copy [seen] here because we made copies above when reporting
+      // errors on mixins.
+      _checkInterfacesOverrides(parent, interfaces, seen,
+          visited: visited, includeParents: true, errorLocation: loc);
+    }
+  }
+
+  /// Check that individual methods and fields in [subType] correctly override
+  /// the declarations in [baseType].
+  ///
+  /// The [errorLocation] node indicates where errors are reported, see
+  /// [_checkSingleOverride] for more details.
+  ///
+  /// The set [seen] is used to avoid reporting overrides more than once. It
+  /// is used when invoking this function multiple times when checking several
+  /// types in a class hierarchy. Errors are reported only the first time an
+  /// invalid override involving a specific member is encountered.
+  _checkIndividualOverridesFromType(InterfaceType subType,
+      InterfaceType baseType, AstNode errorLocation, Set<String> seen) {
+    void checkHelper(ExecutableElement e) {
+      if (e.isStatic) return;
+      if (seen.contains(e.name)) return;
+      if (_checkSingleOverride(e, baseType, null, errorLocation)) {
+        seen.add(e.name);
+      }
+    }
+    subType.methods.forEach(checkHelper);
+    subType.accessors.forEach(checkHelper);
+  }
+
+  /// Check that individual methods and fields in [subType] correctly override
+  /// the declarations in [baseType].
+  ///
+  /// The [errorLocation] node indicates where errors are reported, see
+  /// [_checkSingleOverride] for more details.
+  _checkIndividualOverridesFromClass(
+      ClassDeclaration node, InterfaceType baseType, Set<String> seen) {
+    for (var member in node.members) {
+      if (member is ConstructorDeclaration) continue;
+      if (member is FieldDeclaration) {
+        if (member.isStatic) continue;
+        for (var variable in member.fields.variables) {
+          var element = variable.element as PropertyInducingElement;
+          var name = element.name;
+          if (seen.contains(name)) continue;
+          var getter = element.getter;
+          var setter = element.setter;
+          bool found = _checkSingleOverride(getter, baseType, variable, member);
+          if (!variable.isFinal &&
+              !variable.isConst &&
+              _checkSingleOverride(setter, baseType, variable, member)) {
+            found = true;
+          }
+          if (found) seen.add(name);
+        }
+      } else {
+        if ((member as MethodDeclaration).isStatic) continue;
+        var method = (member as MethodDeclaration).element;
+        if (seen.contains(method.name)) continue;
+        if (_checkSingleOverride(method, baseType, member, member)) {
+          seen.add(method.name);
+        }
+      }
+    }
+  }
+
+  /// Checks that [element] correctly overrides its corresponding member in
+  /// [type]. Returns `true` if an override was found, that is, if [element] has
+  /// a corresponding member in [type] that it overrides.
+  ///
+  /// The [errorLocation] is a node where the error is reported. For example, a
+  /// bad override of a method in a class with respect to its superclass is
+  /// reported directly at the method declaration. However, invalid overrides
+  /// from base classes to interfaces, mixins to the base they are applied to,
+  /// or mixins to interfaces are reported at the class declaration, since the
+  /// base class or members on their own were not incorrect, only combining them
+  /// with the interface was problematic. For example, these are example error
+  /// locations in these cases:
+  ///
+  ///     error: base class introduces an invalid override. The type of B.foo is
+  ///     not a subtype of E.foo:
+  ///       class A extends B implements E { ... }
+  ///               ^^^^^^^^^
+  ///
+  ///     error: mixin introduces an invalid override. The type of C.foo is not
+  ///     a subtype of E.foo:
+  ///       class A extends B with C implements E { ... }
+  ///                              ^
+  ///
+  /// When checking for overrides from a type and it's super types, [node] is
+  /// the AST node that defines [element]. This is used to determine whether the
+  /// type of the element could be inferred from the types in the super classes.
+  bool _checkSingleOverride(ExecutableElement element, InterfaceType type,
+      AstNode node, AstNode errorLocation) {
+    assert(!element.isStatic);
+
+    FunctionType subType = _rules.elementType(element);
+    // TODO(vsm): Test for generic
+    FunctionType baseType = _getMemberType(type, element);
+
+    if (baseType == null) return false;
+    if (!_rules.isAssignable(subType, baseType)) {
+      // See whether non-assignable cases fit one of our common patterns:
+      //
+      // Common pattern 1: Inferable return type (on getters and methods)
+      //   class A {
+      //     int get foo => ...;
+      //     String toString() { ... }
+      //   }
+      //   class B extends A {
+      //     get foo => e; // no type specified.
+      //     toString() { ... } // no return type specified.
+      //   }
+      _recordMessage(new InvalidMethodOverride(
+          errorLocation, element, type, subType, baseType));
+    }
+    return true;
+  }
+
+  void _recordMessage(StaticInfo info) {
+    if (info == null) return;
+    var error = info.toAnalysisError();
+    if (error.errorCode.errorSeverity == ErrorSeverity.ERROR) _failure = true;
+    _reporter.onError(error);
+  }
+}
+
+/// Checks the body of functions and properties.
+class CodeChecker extends RecursiveAstVisitor {
+  final TypeRules rules;
+  final AnalysisErrorListener reporter;
+  final _OverrideChecker _overrideChecker;
+  final bool _hints;
+
+  bool _failure = false;
+  bool get failure => _failure || _overrideChecker._failure;
+
+  void reset() {
+    _failure = false;
+    _overrideChecker._failure = false;
+  }
+
+  CodeChecker(TypeRules rules, AnalysisErrorListener reporter,
+      {bool hints: false})
+      : rules = rules,
+        reporter = reporter,
+        _hints = hints,
+        _overrideChecker = new _OverrideChecker(rules, reporter);
+
+  @override
+  void visitComment(Comment node) {
+    // skip, no need to do typechecking inside comments (they may contain
+    // comment references which would require resolution).
+  }
+
+  @override
+  void visitClassDeclaration(ClassDeclaration node) {
+    _overrideChecker.check(node);
+    super.visitClassDeclaration(node);
+  }
+
+  @override
+  void visitAssignmentExpression(AssignmentExpression node) {
+    var token = node.operator;
+    if (token.type != TokenType.EQ) {
+      _checkCompoundAssignment(node);
+    } else {
+      DartType staticType = _getStaticType(node.leftHandSide);
+      checkAssignment(node.rightHandSide, staticType);
+    }
+    node.visitChildren(this);
+  }
+
+  /// Check constructor declaration to ensure correct super call placement.
+  @override
+  void visitConstructorDeclaration(ConstructorDeclaration node) {
+    node.visitChildren(this);
+
+    final init = node.initializers;
+    for (int i = 0, last = init.length - 1; i < last; i++) {
+      final node = init[i];
+      if (node is SuperConstructorInvocation) {
+        _recordMessage(new InvalidSuperInvocation(node));
+      }
+    }
+  }
+
+  @override
+  void visitConstructorFieldInitializer(ConstructorFieldInitializer node) {
+    var field = node.fieldName;
+    var element = field.staticElement;
+    DartType staticType = rules.elementType(element);
+    checkAssignment(node.expression, staticType);
+    node.visitChildren(this);
+  }
+
+  @override
+  void visitForEachStatement(ForEachStatement node) {
+    // Check that the expression is an Iterable.
+    var expr = node.iterable;
+    var iterableType = node.awaitKeyword != null
+        ? rules.provider.streamType
+        : rules.provider.iterableType;
+    var loopVariable = node.identifier != null
+        ? node.identifier
+        : node.loopVariable?.identifier;
+    if (loopVariable != null) {
+      var iteratorType = loopVariable.staticType;
+      var checkedType = iterableType.substitute4([iteratorType]);
+      checkAssignment(expr, checkedType);
+    }
+    node.visitChildren(this);
+  }
+
+  @override
+  void visitForStatement(ForStatement node) {
+    if (node.condition != null) {
+      checkBoolean(node.condition);
+    }
+    node.visitChildren(this);
+  }
+
+  @override
+  void visitIfStatement(IfStatement node) {
+    checkBoolean(node.condition);
+    node.visitChildren(this);
+  }
+
+  @override
+  void visitDoStatement(DoStatement node) {
+    checkBoolean(node.condition);
+    node.visitChildren(this);
+  }
+
+  @override
+  void visitWhileStatement(WhileStatement node) {
+    checkBoolean(node.condition);
+    node.visitChildren(this);
+  }
+
+  @override
+  void visitSwitchStatement(SwitchStatement node) {
+    // SwitchStatement defines a boolean conversion to check the result of the
+    // case value == the switch value, but in dev_compiler we require a boolean
+    // return type from an overridden == operator (because Object.==), so
+    // checking in SwitchStatement shouldn't be necessary.
+    node.visitChildren(this);
+  }
+
+  @override
+  void visitListLiteral(ListLiteral node) {
+    var type = rules.provider.dynamicType;
+    if (node.typeArguments != null) {
+      var targs = node.typeArguments.arguments;
+      if (targs.length > 0) type = targs[0].type;
+    }
+    var elements = node.elements;
+    for (int i = 0; i < elements.length; i++) {
+      checkArgument(elements[i], type);
+    }
+    super.visitListLiteral(node);
+  }
+
+  @override
+  void visitMapLiteral(MapLiteral node) {
+    var ktype = rules.provider.dynamicType;
+    var vtype = rules.provider.dynamicType;
+    if (node.typeArguments != null) {
+      var targs = node.typeArguments.arguments;
+      if (targs.length > 0) ktype = targs[0].type;
+      if (targs.length > 1) vtype = targs[1].type;
+    }
+    var entries = node.entries;
+    for (int i = 0; i < entries.length; i++) {
+      var entry = entries[i];
+      checkArgument(entry.key, ktype);
+      checkArgument(entry.value, vtype);
+    }
+    super.visitMapLiteral(node);
+  }
+
+  // Check invocations
+  void checkArgumentList(ArgumentList node, FunctionType type) {
+    NodeList<Expression> list = node.arguments;
+    int len = list.length;
+    for (int i = 0; i < len; ++i) {
+      Expression arg = list[i];
+      ParameterElement element = arg.staticParameterElement;
+      if (element == null) {
+        if (type.parameters.length < len) {
+          // We found an argument mismatch, the analyzer will report this too,
+          // so no need to insert an error for this here.
+          continue;
+        }
+        element = type.parameters[i];
+        // TODO(vsm): When can this happen?
+        assert(element != null);
+      }
+      DartType expectedType = rules.elementType(element);
+      if (expectedType == null) expectedType = rules.provider.dynamicType;
+      checkArgument(arg, expectedType);
+    }
+  }
+
+  void checkArgument(Expression arg, DartType expectedType) {
+    // Preserve named argument structure, so their immediate parent is the
+    // method invocation.
+    if (arg is NamedExpression) {
+      arg = (arg as NamedExpression).expression;
+    }
+    checkAssignment(arg, expectedType);
+  }
+
+  void checkFunctionApplication(
+      Expression node, Expression f, ArgumentList list) {
+    if (rules.isDynamicCall(f)) {
+      // If f is Function and this is a method invocation, we should have
+      // gotten an analyzer error, so no need to issue another error.
+      _recordDynamicInvoke(node, f);
+    } else {
+      checkArgumentList(list, rules.getTypeAsCaller(f));
+    }
+  }
+
+  @override
+  visitMethodInvocation(MethodInvocation node) {
+    var target = node.realTarget;
+    if (rules.isDynamicTarget(target) &&
+        !_isObjectMethod(node, node.methodName)) {
+      _recordDynamicInvoke(node, target);
+
+      // Mark the tear-off as being dynamic, too. This lets us distinguish
+      // cases like:
+      //
+      //     dynamic d;
+      //     d.someMethod(...); // the whole method call must be a dynamic send.
+      //
+      // ... from case like:
+      //
+      //     SomeType s;
+      //     s.someDynamicField(...); // static get, followed by dynamic call.
+      //
+      // The first case is handled here, the second case is handled below when
+      // we call [checkFunctionApplication].
+      DynamicInvoke.set(node.methodName, true);
+    } else {
+      checkFunctionApplication(node, node.methodName, node.argumentList);
+    }
+    node.visitChildren(this);
+  }
+
+  @override
+  void visitFunctionExpressionInvocation(FunctionExpressionInvocation node) {
+    checkFunctionApplication(node, node.function, node.argumentList);
+    node.visitChildren(this);
+  }
+
+  @override
+  void visitRedirectingConstructorInvocation(
+      RedirectingConstructorInvocation node) {
+    var type = node.staticElement.type;
+    checkArgumentList(node.argumentList, type);
+    node.visitChildren(this);
+  }
+
+  @override
+  void visitSuperConstructorInvocation(SuperConstructorInvocation node) {
+    var element = node.staticElement;
+    if (element != null) {
+      var type = node.staticElement.type;
+      checkArgumentList(node.argumentList, type);
+    }
+    node.visitChildren(this);
+  }
+
+  void _checkReturnOrYield(Expression expression, AstNode node,
+      {bool yieldStar: false}) {
+    var body = node.getAncestor((n) => n is FunctionBody);
+    var type = rules.getExpectedReturnType(body, yieldStar: yieldStar);
+    if (type == null) {
+      // We have a type mismatch: the async/async*/sync* modifier does
+      // not match the return or yield type.  We should have already gotten an
+      // analyzer error in this case.
+      return;
+    }
+    // TODO(vsm): Enforce void or dynamic (to void?) when expression is null.
+    if (expression != null) checkAssignment(expression, type);
+  }
+
+  @override
+  void visitExpressionFunctionBody(ExpressionFunctionBody node) {
+    _checkReturnOrYield(node.expression, node);
+    node.visitChildren(this);
+  }
+
+  @override
+  void visitReturnStatement(ReturnStatement node) {
+    _checkReturnOrYield(node.expression, node);
+    node.visitChildren(this);
+  }
+
+  @override
+  void visitYieldStatement(YieldStatement node) {
+    _checkReturnOrYield(node.expression, node, yieldStar: node.star != null);
+    node.visitChildren(this);
+  }
+
+  @override
+  void visitPropertyAccess(PropertyAccess node) {
+    var target = node.realTarget;
+    if (rules.isDynamicTarget(target) &&
+        !_isObjectProperty(target, node.propertyName)) {
+      _recordDynamicInvoke(node, target);
+    }
+    node.visitChildren(this);
+  }
+
+  @override
+  void visitPrefixedIdentifier(PrefixedIdentifier node) {
+    final target = node.prefix;
+    if (rules.isDynamicTarget(target) &&
+        !_isObjectProperty(target, node.identifier)) {
+      _recordDynamicInvoke(node, target);
+    }
+    node.visitChildren(this);
+  }
+
+  @override
+  void visitDefaultFormalParameter(DefaultFormalParameter node) {
+    // Check that defaults have the proper subtype.
+    var parameter = node.parameter;
+    var parameterType = rules.elementType(parameter.element);
+    assert(parameterType != null);
+    var defaultValue = node.defaultValue;
+    if (defaultValue != null) {
+      checkAssignment(defaultValue, parameterType);
+    }
+
+    node.visitChildren(this);
+  }
+
+  @override
+  void visitFieldFormalParameter(FieldFormalParameter node) {
+    var element = node.element;
+    var typeName = node.type;
+    if (typeName != null) {
+      var type = rules.elementType(element);
+      var fieldElement =
+          node.identifier.staticElement as FieldFormalParameterElement;
+      var fieldType = rules.elementType(fieldElement.field);
+      if (!rules.isSubTypeOf(type, fieldType)) {
+        var staticInfo =
+            new InvalidParameterDeclaration(rules, node, fieldType);
+        _recordMessage(staticInfo);
+      }
+    }
+    node.visitChildren(this);
+  }
+
+  @override
+  void visitInstanceCreationExpression(InstanceCreationExpression node) {
+    var arguments = node.argumentList;
+    var element = node.staticElement;
+    if (element != null) {
+      var type = rules.elementType(node.staticElement);
+      checkArgumentList(arguments, type);
+    }
+    node.visitChildren(this);
+  }
+
+  @override
+  void visitVariableDeclarationList(VariableDeclarationList node) {
+    TypeName type = node.type;
+    if (type == null) {
+      // No checks are needed when the type is var. Although internally the
+      // typing rules may have inferred a more precise type for the variable
+      // based on the initializer.
+    } else {
+      var dartType = getType(type);
+      for (VariableDeclaration variable in node.variables) {
+        var initializer = variable.initializer;
+        if (initializer != null) {
+          checkAssignment(initializer, dartType);
+        }
+      }
+    }
+    node.visitChildren(this);
+  }
+
+  void _checkRuntimeTypeCheck(AstNode node, TypeName typeName) {
+    var type = getType(typeName);
+    if (!rules.isGroundType(type)) {
+      _recordMessage(new NonGroundTypeCheckInfo(node, type));
+    }
+  }
+
+  @override
+  void visitAsExpression(AsExpression node) {
+    // We could do the same check as the IsExpression below, but that is
+    // potentially too conservative.  Instead, at runtime, we must fail hard
+    // if the Dart as and the DDC as would return different values.
+    node.visitChildren(this);
+  }
+
+  @override
+  void visitIsExpression(IsExpression node) {
+    _checkRuntimeTypeCheck(node, node.type);
+    node.visitChildren(this);
+  }
+
+  @override
+  void visitPrefixExpression(PrefixExpression node) {
+    if (node.operator.type == TokenType.BANG) {
+      checkBoolean(node.operand);
+    } else {
+      _checkUnary(node);
+    }
+    node.visitChildren(this);
+  }
+
+  @override
+  void visitPostfixExpression(PostfixExpression node) {
+    _checkUnary(node);
+    node.visitChildren(this);
+  }
+
+  void _checkUnary(/*PrefixExpression|PostfixExpression*/ node) {
+    var op = node.operator;
+    if (op.isUserDefinableOperator ||
+        op.type == TokenType.PLUS_PLUS ||
+        op.type == TokenType.MINUS_MINUS) {
+      if (rules.isDynamicTarget(node.operand)) {
+        _recordDynamicInvoke(node, node.operand);
+      }
+      // For ++ and --, even if it is not dynamic, we still need to check
+      // that the user defined method accepts an `int` as the RHS.
+      // We assume Analyzer has done this already.
+    }
+  }
+
+  @override
+  void visitBinaryExpression(BinaryExpression node) {
+    var op = node.operator;
+    if (op.isUserDefinableOperator) {
+      if (rules.isDynamicTarget(node.leftOperand)) {
+        // Dynamic invocation
+        // TODO(vsm): Move this logic to the resolver?
+        if (op.type != TokenType.EQ_EQ && op.type != TokenType.BANG_EQ) {
+          _recordDynamicInvoke(node, node.leftOperand);
+        }
+      } else {
+        var element = node.staticElement;
+        // Method invocation.
+        if (element is MethodElement) {
+          var type = element.type;
+          // Analyzer should enforce number of parameter types, but check in
+          // case we have erroneous input.
+          if (type.normalParameterTypes.isNotEmpty) {
+            checkArgument(node.rightOperand, type.normalParameterTypes[0]);
+          }
+        } else {
+          // TODO(vsm): Assert that the analyzer found an error here?
+        }
+      }
+    } else {
+      // Non-method operator.
+      switch (op.type) {
+        case TokenType.AMPERSAND_AMPERSAND:
+        case TokenType.BAR_BAR:
+          checkBoolean(node.leftOperand);
+          checkBoolean(node.rightOperand);
+          break;
+        case TokenType.BANG_EQ:
+          break;
+        case TokenType.QUESTION_QUESTION:
+          break;
+        default:
+          assert(false);
+      }
+    }
+    node.visitChildren(this);
+  }
+
+  @override
+  void visitConditionalExpression(ConditionalExpression node) {
+    checkBoolean(node.condition);
+    node.visitChildren(this);
+  }
+
+  @override
+  void visitIndexExpression(IndexExpression node) {
+    var target = node.realTarget;
+    if (rules.isDynamicTarget(target)) {
+      _recordDynamicInvoke(node, target);
+    } else {
+      var element = node.staticElement;
+      if (element is MethodElement) {
+        var type = element.type;
+        // Analyzer should enforce number of parameter types, but check in
+        // case we have erroneous input.
+        if (type.normalParameterTypes.isNotEmpty) {
+          checkArgument(node.index, type.normalParameterTypes[0]);
+        }
+      } else {
+        // TODO(vsm): Assert that the analyzer found an error here?
+      }
+    }
+    node.visitChildren(this);
+  }
+
+  DartType getType(TypeName name) {
+    return (name == null) ? rules.provider.dynamicType : name.type;
+  }
+
+  /// Analyzer checks boolean conversions, but we need to check too, because
+  /// it uses the default assignability rules that allow `dynamic` and `Object`
+  /// to be assigned to bool with no message.
+  void checkBoolean(Expression expr) =>
+      checkAssignment(expr, rules.provider.boolType);
+
+  void checkAssignment(Expression expr, DartType type) {
+    if (expr is ParenthesizedExpression) {
+      checkAssignment(expr.expression, type);
+    } else {
+      _recordMessage(rules.checkAssignment(expr, type));
+    }
+  }
+
+  DartType _specializedBinaryReturnType(
+      TokenType op, DartType t1, DartType t2, DartType normalReturnType) {
+    // This special cases binary return types as per 16.26 and 16.27 of the
+    // Dart language spec.
+    switch (op) {
+      case TokenType.PLUS:
+      case TokenType.MINUS:
+      case TokenType.STAR:
+      case TokenType.TILDE_SLASH:
+      case TokenType.PERCENT:
+      case TokenType.PLUS_EQ:
+      case TokenType.MINUS_EQ:
+      case TokenType.STAR_EQ:
+      case TokenType.TILDE_SLASH_EQ:
+      case TokenType.PERCENT_EQ:
+        if (t1 == rules.provider.intType &&
+            t2 == rules.provider.intType) return t1;
+        if (t1 == rules.provider.doubleType &&
+            t2 == rules.provider.doubleType) return t1;
+        // This particular combo is not spelled out in the spec, but all
+        // implementations and analyzer seem to follow this.
+        if (t1 == rules.provider.doubleType &&
+            t2 == rules.provider.intType) return t1;
+    }
+    return normalReturnType;
+  }
+
+  void _checkCompoundAssignment(AssignmentExpression expr) {
+    var op = expr.operator.type;
+    assert(op.isAssignmentOperator && op != TokenType.EQ);
+    var methodElement = expr.staticElement;
+    if (methodElement == null) {
+      // Dynamic invocation
+      _recordDynamicInvoke(expr, expr.leftHandSide);
+    } else {
+      // Sanity check the operator
+      assert(methodElement.isOperator);
+      var functionType = methodElement.type;
+      var paramTypes = functionType.normalParameterTypes;
+      assert(paramTypes.length == 1);
+      assert(functionType.namedParameterTypes.isEmpty);
+      assert(functionType.optionalParameterTypes.isEmpty);
+
+      // Check the lhs type
+      var staticInfo;
+      var rhsType = _getStaticType(expr.rightHandSide);
+      var lhsType = _getStaticType(expr.leftHandSide);
+      var returnType = _specializedBinaryReturnType(
+          op, lhsType, rhsType, functionType.returnType);
+
+      if (!rules.isSubTypeOf(returnType, lhsType)) {
+        final numType = rules.provider.numType;
+        // Try to fix up the numerical case if possible.
+        if (rules.isSubTypeOf(lhsType, numType) &&
+            rules.isSubTypeOf(lhsType, rhsType)) {
+          // This is also slightly different from spec, but allows us to keep
+          // compound operators in the int += num and num += dynamic cases.
+          staticInfo = DownCast.create(
+              rules, expr.rightHandSide, Coercion.cast(rhsType, lhsType));
+          rhsType = lhsType;
+        } else {
+          // Static type error
+          staticInfo = new StaticTypeError(rules, expr, lhsType);
+        }
+        _recordMessage(staticInfo);
+      }
+
+      // Check the rhs type
+      if (staticInfo is! CoercionInfo) {
+        var paramType = paramTypes.first;
+        staticInfo = rules.checkAssignment(expr.rightHandSide, paramType);
+        _recordMessage(staticInfo);
+      }
+    }
+  }
+
+  bool _isObjectGetter(Expression target, SimpleIdentifier id) {
+    PropertyAccessorElement element =
+        rules.provider.objectType.element.getGetter(id.name);
+    return (element != null && !element.isStatic);
+  }
+
+  bool _isObjectMethod(Expression target, SimpleIdentifier id) {
+    MethodElement element =
+        rules.provider.objectType.element.getMethod(id.name);
+    return (element != null && !element.isStatic);
+  }
+
+  bool _isObjectProperty(Expression target, SimpleIdentifier id) {
+    return _isObjectGetter(target, id) || _isObjectMethod(target, id);
+  }
+
+  DartType _getStaticType(Expression expr) {
+    return expr.staticType ?? rules.provider.dynamicType;
+  }
+
+  void _recordDynamicInvoke(AstNode node, AstNode target) {
+    if (_hints) {
+      reporter.onError(new DynamicInvoke(rules, node).toAnalysisError());
+    }
+    // TODO(jmesserly): we may eventually want to record if the whole operation
+    // (node) was dynamic, rather than the target, but this is an easier fit
+    // with what we used to do.
+    DynamicInvoke.set(target, true);
+  }
+
+  void _recordMessage(StaticInfo info) {
+    if (info == null) return;
+    var error = info.toAnalysisError();
+
+    var severity = error.errorCode.errorSeverity;
+    if (severity == ErrorSeverity.ERROR) _failure = true;
+    if (severity != ErrorSeverity.INFO || _hints) {
+      reporter.onError(error);
+    }
+
+    if (info is CoercionInfo) {
+      // TODO(jmesserly): if we're run again on the same AST, we'll produce the
+      // same annotations. This should be harmless. This might go away once
+      // CodeChecker is integrated better with analyzer, as it will know that
+      // checking has already been performed.
+      // assert(CoercionInfo.get(info.node) == null);
+      CoercionInfo.set(info.node, info);
+    }
+  }
+}
+
+/// Looks up the declaration that matches [member] in [type] and returns it's
+/// declared type.
+FunctionType _getMemberType(InterfaceType type, ExecutableElement member) =>
+    _memberTypeGetter(member)(type);
+
+typedef FunctionType _MemberTypeGetter(InterfaceType type);
+
+_MemberTypeGetter _memberTypeGetter(ExecutableElement member) {
+  String memberName = member.name;
+  final isGetter = member is PropertyAccessorElement && member.isGetter;
+  final isSetter = member is PropertyAccessorElement && member.isSetter;
+
+  FunctionType f(InterfaceType type) {
+    ExecutableElement baseMethod;
+    try {
+      if (isGetter) {
+        assert(!isSetter);
+        // Look for getter or field.
+        baseMethod = type.getGetter(memberName);
+      } else if (isSetter) {
+        baseMethod = type.getSetter(memberName);
+      } else {
+        baseMethod = type.getMethod(memberName);
+      }
+    } catch (e) {
+      // TODO(sigmund): remove this try-catch block (see issue #48).
+    }
+    if (baseMethod == null || baseMethod.isStatic) return null;
+    return baseMethod.type;
+  }
+  ;
+  return f;
+}
diff --git a/pkg/analyzer/lib/src/task/strong/info.dart b/pkg/analyzer/lib/src/task/strong/info.dart
new file mode 100644
index 0000000..1aa42b2
--- /dev/null
+++ b/pkg/analyzer/lib/src/task/strong/info.dart
@@ -0,0 +1,489 @@
+// 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.
+
+/// Defines static information collected by the type checker and used later by
+/// emitters to generate code.
+// TODO(jmesserly): this was ported from package:dev_compiler, and needs to be
+// refactored to fit into analyzer.
+library analyzer.src.task.strong.info;
+
+import 'package:analyzer/src/generated/ast.dart';
+import 'package:analyzer/src/generated/element.dart';
+import 'package:analyzer/src/generated/error.dart';
+
+import 'rules.dart';
+
+// The abstract type of coercions mapping one type to another.
+// This class also exposes static builder functions which
+// check for errors and reduce redundant coercions to the identity.
+abstract class Coercion {
+  final DartType fromType;
+  final DartType toType;
+  Coercion(this.fromType, this.toType);
+  static Coercion cast(DartType fromT, DartType toT) => new Cast(fromT, toT);
+  static Coercion identity(DartType type) => new Identity(type);
+  static Coercion error() => new CoercionError();
+}
+
+// Coercion which casts one type to another
+class Cast extends Coercion {
+  Cast(DartType fromType, DartType toType) : super(fromType, toType);
+}
+
+// The identity coercion
+class Identity extends Coercion {
+  Identity(DartType fromType) : super(fromType, fromType);
+}
+
+// The error coercion.  This coercion signals that a coercion
+// could not be generated.  The code generator should not see
+// these.
+class CoercionError extends Coercion {
+  CoercionError() : super(null, null);
+}
+
+// TODO(jmesserly): this could use some refactoring. These are essentially
+// like ErrorCodes in analyzer, but we're including some details in our message.
+// Analyzer instead has template strings, and replaces '{0}' with the first
+// argument.
+abstract class StaticInfo {
+  /// AST Node this info is attached to.
+  AstNode get node;
+
+  // TODO(jmesserly): review the usage of error codes. We probably want our own,
+  // as well as some DDC specific [ErrorType]s.
+  ErrorCode toErrorCode();
+
+  // TODO(jmesserly): what convention to use here?
+  String get name => 'dev_compiler.$runtimeType';
+
+  List<Object> get arguments => [node];
+
+  AnalysisError toAnalysisError() {
+    int begin = node is AnnotatedNode
+        ? (node as AnnotatedNode).firstTokenAfterCommentAndMetadata.offset
+        : node.offset;
+    int length = node.end - begin;
+    var source = (node.root as CompilationUnit).element.source;
+    return new AnalysisError(source, begin, length, toErrorCode(), arguments);
+  }
+}
+
+/// Implicitly injected expression conversion.
+abstract class CoercionInfo extends StaticInfo {
+  final TypeRules rules;
+
+  final Expression node;
+
+  DartType get convertedType;
+
+  CoercionInfo(this.rules, this.node);
+
+  DartType get baseType => rules.getStaticType(node);
+  DartType get staticType => convertedType;
+
+  String get message;
+  toErrorCode() => new HintCode(name, message);
+
+  static const String _propertyName = 'dev_compiler.src.info.CoercionInfo';
+
+  /// Gets the coercion info associated with this node.
+  static CoercionInfo get(AstNode node) => node.getProperty(_propertyName);
+
+  /// Sets the coercion info associated with this node.
+  static CoercionInfo set(AstNode node, CoercionInfo info) {
+    node.setProperty(_propertyName, info);
+    return info;
+  }
+}
+
+// Base class for all casts from base type to sub type.
+abstract class DownCast extends CoercionInfo {
+  Cast _cast;
+
+  DownCast._internal(TypeRules rules, Expression expression, this._cast)
+      : super(rules, expression) {
+    assert(_cast.toType != baseType &&
+        _cast.fromType == baseType &&
+        (baseType.isDynamic ||
+            // Call methods make the following non-redundant
+            _cast.toType.isSubtypeOf(baseType) ||
+            baseType.isAssignableTo(_cast.toType)));
+  }
+
+  Cast get cast => _cast;
+
+  DartType get convertedType => _cast.toType;
+
+  @override List<Object> get arguments => [node, baseType, convertedType];
+  @override String get message => '{0} ({1}) will need runtime check '
+      'to cast to type {2}';
+
+  // Factory to create correct DownCast variant.
+  static StaticInfo create(TypeRules rules, Expression expression, Cast cast,
+      {String reason}) {
+    final fromT = cast.fromType;
+    final toT = cast.toType;
+
+    // toT <:_R fromT => to <: fromT
+    // NB: classes with call methods are subtypes of function
+    // types, but the function type is not assignable to the class
+    assert(toT.isSubtypeOf(fromT) || fromT.isAssignableTo(toT));
+
+    // Handle null call specially.
+    if (expression is NullLiteral) {
+      // TODO(vsm): Create a NullCast for this once we revisit nonnullability.
+      return new DownCastImplicit(rules, expression, cast);
+    }
+
+    // Inference "casts":
+    if (expression is Literal) {
+      // fromT should be an exact type - this will almost certainly fail at
+      // runtime.
+      return new StaticTypeError(rules, expression, toT, reason: reason);
+    }
+    if (expression is FunctionExpression) {
+      // fromT should be an exact type - this will almost certainly fail at
+      // runtime.
+      return new UninferredClosure(rules, expression, cast);
+    }
+    if (expression is InstanceCreationExpression) {
+      // fromT should be an exact type - this will almost certainly fail at
+      // runtime.
+      return new StaticTypeError(rules, expression, toT, reason: reason);
+    }
+
+    // TODO(vsm): Change this to an assert when we have generic methods and
+    // fix TypeRules._coerceTo to disallow implicit sideways casts.
+    if (!rules.isSubTypeOf(toT, fromT)) {
+      assert(toT.isSubtypeOf(fromT) || fromT.isAssignableTo(toT));
+      return new DownCastComposite(rules, expression, cast);
+    }
+
+    // Composite cast: these are more likely to fail.
+    if (!rules.isGroundType(toT)) {
+      // This cast is (probably) due to our different treatment of dynamic.
+      // It may be more likely to fail at runtime.
+      if (fromT is InterfaceType) {
+        // For class types, we'd like to allow non-generic down casts, e.g.,
+        // Iterable<T> to List<T>.  The intuition here is that raw (generic)
+        // casts are problematic, and we should complain about those.
+        var typeArgs = fromT.typeArguments;
+        if (typeArgs.isEmpty || typeArgs.any((t) => t.isDynamic)) {
+          return new DownCastComposite(rules, expression, cast);
+        }
+      } else {
+        return new DownCastComposite(rules, expression, cast);
+      }
+    }
+
+    // Dynamic cast
+    if (fromT.isDynamic) {
+      return new DynamicCast(rules, expression, cast);
+    }
+
+    // Assignment cast
+    var parent = expression.parent;
+    if (parent is VariableDeclaration && (parent.initializer == expression)) {
+      return new AssignmentCast(rules, expression, cast);
+    }
+
+    // Other casts
+    return new DownCastImplicit(rules, expression, cast);
+  }
+}
+
+//
+// Standard down casts.  These casts are implicitly injected by the compiler.
+//
+
+// A down cast from dynamic to T.
+class DynamicCast extends DownCast {
+  DynamicCast(TypeRules rules, Expression expression, Cast cast)
+      : super._internal(rules, expression, cast);
+
+  toErrorCode() => new HintCode(name, message);
+}
+
+// A down cast due to a variable declaration to a ground type.  E.g.,
+//   T x = expr;
+// where T is ground.  We exclude non-ground types as these behave differently
+// compared to standard Dart.
+class AssignmentCast extends DownCast {
+  AssignmentCast(TypeRules rules, Expression expression, Cast cast)
+      : super._internal(rules, expression, cast);
+
+  toErrorCode() => new HintCode(name, message);
+}
+
+//
+// Temporary "casts" of allocation sites - literals, constructor invocations,
+// and closures.  These should be handled by contextual inference.  In most
+// cases, inference will be sufficient, though in some it may unmask an actual
+// error: e.g.,
+//   List<int> l = [1, 2, 3]; // Inference succeeds
+//   List<String> l = [1, 2, 3]; // Inference reveals static type error
+// We're marking all as warnings for now.
+//
+// TODO(vsm,leafp): Remove this.
+class UninferredClosure extends DownCast {
+  UninferredClosure(TypeRules rules, FunctionExpression expression, Cast cast)
+      : super._internal(rules, expression, cast);
+
+  toErrorCode() => new StaticTypeWarningCode(name, message);
+}
+
+//
+// Implicit down casts.  These are only injected by the compiler by flag.
+//
+
+// A down cast to a non-ground type.  These behave differently from standard
+// Dart and may be more likely to fail at runtime.
+class DownCastComposite extends DownCast {
+  DownCastComposite(TypeRules rules, Expression expression, Cast cast)
+      : super._internal(rules, expression, cast);
+
+  toErrorCode() => new StaticTypeWarningCode(name, message);
+}
+
+// A down cast to a non-ground type.  These behave differently from standard
+// Dart and may be more likely to fail at runtime.
+class DownCastImplicit extends DownCast {
+  DownCastImplicit(TypeRules rules, Expression expression, Cast cast)
+      : super._internal(rules, expression, cast);
+
+  toErrorCode() => new HintCode(name, message);
+}
+
+// An inferred type for the wrapped expression, which may need to be
+// reified into the term
+abstract class InferredTypeBase extends CoercionInfo {
+  final DartType _type;
+
+  InferredTypeBase._internal(TypeRules rules, Expression expression, this._type)
+      : super(rules, expression);
+
+  DartType get type => _type;
+  DartType get convertedType => type;
+  @override String get message => '{0} has inferred type {1}';
+  @override List get arguments => [node, type];
+
+  toErrorCode() => new HintCode(name, message);
+}
+
+// Standard / unspecialized inferred type
+class InferredType extends InferredTypeBase {
+  InferredType(TypeRules rules, Expression expression, DartType type)
+      : super._internal(rules, expression, type);
+
+  // Factory to create correct InferredType variant.
+  static InferredTypeBase create(
+      TypeRules rules, Expression expression, DartType type) {
+    // Specialized inference:
+    if (expression is Literal) {
+      return new InferredTypeLiteral(rules, expression, type);
+    }
+    if (expression is InstanceCreationExpression) {
+      return new InferredTypeAllocation(rules, expression, type);
+    }
+    if (expression is FunctionExpression) {
+      return new InferredTypeClosure(rules, expression, type);
+    }
+    return new InferredType(rules, expression, type);
+  }
+}
+
+// An infered type for a literal expression.
+class InferredTypeLiteral extends InferredTypeBase {
+  InferredTypeLiteral(TypeRules rules, Expression expression, DartType type)
+      : super._internal(rules, expression, type);
+}
+
+// An inferred type for a non-literal allocation site.
+class InferredTypeAllocation extends InferredTypeBase {
+  InferredTypeAllocation(TypeRules rules, Expression expression, DartType type)
+      : super._internal(rules, expression, type);
+}
+
+// An inferred type for a closure expression
+class InferredTypeClosure extends InferredTypeBase {
+  InferredTypeClosure(TypeRules rules, Expression expression, DartType type)
+      : super._internal(rules, expression, type);
+}
+
+class DynamicInvoke extends CoercionInfo {
+  DynamicInvoke(TypeRules rules, Expression expression)
+      : super(rules, expression);
+
+  DartType get convertedType => rules.provider.dynamicType;
+  String get message => '{0} requires dynamic invoke';
+  toErrorCode() => new HintCode(name, message);
+
+  static const String _propertyName = 'dev_compiler.src.info.DynamicInvoke';
+
+  /// Whether this [node] is the target of a dynamic operation.
+  static bool get(AstNode node) {
+    var value = node.getProperty(_propertyName);
+    return value != null ? value : false;
+  }
+
+  /// Sets whether this node is the target of a dynamic operation.
+  static bool set(AstNode node, bool value) {
+    // Free the storage for things that aren't dynamic.
+    if (value == false) value = null;
+    node.setProperty(_propertyName, value);
+    return value;
+  }
+}
+
+abstract class StaticError extends StaticInfo {
+  final AstNode node;
+
+  StaticError(this.node);
+
+  String get message;
+
+  toErrorCode() => new CompileTimeErrorCode(name, message);
+}
+
+class StaticTypeError extends StaticError {
+  final DartType baseType;
+  final DartType expectedType;
+  String reason = null;
+
+  StaticTypeError(TypeRules rules, Expression expression, this.expectedType,
+      {this.reason})
+      : baseType = rules.getStaticType(expression),
+        super(expression);
+
+  @override List<Object> get arguments => [node, baseType, expectedType];
+  @override String get message =>
+      'Type check failed: {0} ({1}) is not of type {2}' +
+          ((reason == null) ? '' : ' because $reason');
+}
+
+class InvalidVariableDeclaration extends StaticError {
+  final DartType expectedType;
+
+  InvalidVariableDeclaration(
+      TypeRules rules, AstNode declaration, this.expectedType)
+      : super(declaration);
+
+  @override List<Object> get arguments => [expectedType];
+  @override String get message => 'Type check failed: null is not of type {0}';
+}
+
+class InvalidParameterDeclaration extends StaticError {
+  final DartType expectedType;
+
+  InvalidParameterDeclaration(
+      TypeRules rules, FormalParameter declaration, this.expectedType)
+      : super(declaration);
+
+  @override List<Object> get arguments => [node, expectedType];
+  @override String get message => 'Type check failed: {0} is not of type {1}';
+}
+
+class NonGroundTypeCheckInfo extends StaticInfo {
+  final DartType type;
+  final AstNode node;
+
+  NonGroundTypeCheckInfo(this.node, this.type) {
+    assert(node is IsExpression || node is AsExpression);
+  }
+
+  @override List<Object> get arguments => [type];
+  String get message =>
+      "Runtime check on non-ground type {0} may throw StrongModeError";
+
+  toErrorCode() => new HintCode(name, message);
+}
+
+// Invalid override of an instance member of a class.
+abstract class InvalidOverride extends StaticError {
+  /// Member declaration with the invalid override.
+  final ExecutableElement element;
+
+  /// Type (class or interface) that provides the base declaration.
+  final InterfaceType base;
+
+  /// Actual type of the overridden member.
+  final DartType subType;
+
+  /// Actual type of the base member.
+  final DartType baseType;
+
+  /// Whether the error comes from combining a base class and an interface
+  final bool fromBaseClass;
+
+  /// Whether the error comes from a mixin (either overriding a base class or an
+  /// interface declaration).
+  final bool fromMixin;
+
+  InvalidOverride(
+      AstNode node, this.element, this.base, this.subType, this.baseType)
+      : fromBaseClass = node is ExtendsClause,
+        fromMixin = node.parent is WithClause,
+        super(node);
+
+  ClassElement get parent => element.enclosingElement;
+
+  @override List<Object> get arguments =>
+      [parent.name, element.name, subType, base, baseType];
+
+  String _messageHelper(String errorName) {
+    var lcErrorName = errorName.toLowerCase();
+    var intro = fromBaseClass
+        ? 'Base class introduces an $lcErrorName'
+        : (fromMixin ? 'Mixin introduces an $lcErrorName' : errorName);
+    return '$intro. The type of {0}.{1} ({2}) is not a '
+        'subtype of {3}.{1} ({4}).';
+  }
+}
+
+// Invalid override due to incompatible type.  I.e., the overridden signature
+// is not compatible with the original.
+class InvalidMethodOverride extends InvalidOverride {
+  InvalidMethodOverride(AstNode node, ExecutableElement element,
+      InterfaceType base, FunctionType subType, FunctionType baseType)
+      : super(node, element, base, subType, baseType);
+
+  String get message => _messageHelper('Invalid override');
+}
+
+/// Dart constructors have one weird quirk, illustrated with this example:
+///
+///     class Base {
+///       var x;
+///       Base() : x = print('Base.1') {
+///         print('Base.2');
+///       }
+///     }
+///
+///     class Derived extends Base {
+///       var y, z;
+///       Derived()
+///           : y = print('Derived.1'),
+///             super(),
+///             z = print('Derived.2') {
+///         print('Derived.3');
+///       }
+///     }
+///
+/// The order will be Derived.1, Base.1, Derived.2, Base.2, Derived.3; this
+/// ordering preserves the invariant that code can't observe uninitialized
+/// state, however it results in super constructor body not being run
+/// immediately after super initializers. Normally this isn't observable, but it
+/// could be if initializers have side effects.
+///
+/// Better to have `super` at the end, as required by the Dart style guide:
+/// <http://goo.gl/q1T4BB>
+///
+/// For now this is the only pattern we support.
+class InvalidSuperInvocation extends StaticError {
+  InvalidSuperInvocation(SuperConstructorInvocation node) : super(node);
+
+  @override String get message => "super call must be last in an initializer "
+      "list (see http://goo.gl/q1T4BB): {0}";
+}
diff --git a/pkg/analyzer/lib/src/task/strong/rules.dart b/pkg/analyzer/lib/src/task/strong/rules.dart
new file mode 100644
index 0000000..3cd6db2
--- /dev/null
+++ b/pkg/analyzer/lib/src/task/strong/rules.dart
@@ -0,0 +1,774 @@
+// 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.
+
+// TODO(jmesserly): this was ported from package:dev_compiler, and needs to be
+// refactored to fit into analyzer.
+library analyzer.src.task.strong.rules;
+
+import 'package:analyzer/src/generated/ast.dart';
+import 'package:analyzer/src/generated/element.dart';
+import 'package:analyzer/src/generated/resolver.dart';
+
+import 'info.dart';
+
+// TODO(jmesserly): this entire file needs to be removed in favor of TypeSystem.
+
+final _objectMap = new Expando('providerToObjectMap');
+Map<String, DartType> getObjectMemberMap(TypeProvider typeProvider) {
+  var map = _objectMap[typeProvider] as Map<String, DartType>;
+  if (map == null) {
+    map = <String, DartType>{};
+    _objectMap[typeProvider] = map;
+    var objectType = typeProvider.objectType;
+    var element = objectType.element;
+    // Only record methods (including getters) with no parameters.  As parameters are contravariant wrt
+    // type, using Object's version may be too strict.
+    // Add instance methods.
+    element.methods.where((method) => !method.isStatic).forEach((method) {
+      map[method.name] = method.type;
+    });
+    // Add getters.
+    element.accessors
+        .where((member) => !member.isStatic && member.isGetter)
+        .forEach((member) {
+      map[member.name] = member.type.returnType;
+    });
+  }
+  return map;
+}
+
+class TypeRules {
+  final TypeProvider provider;
+
+  /// Map of fields / properties / methods on Object.
+  final Map<String, DartType> objectMembers;
+
+  DownwardsInference inferrer;
+
+  TypeRules(TypeProvider provider)
+      : provider = provider,
+        objectMembers = getObjectMemberMap(provider) {
+    inferrer = new DownwardsInference(this);
+  }
+
+  /// Given a type t, if t is an interface type with a call method
+  /// defined, return the function type for the call method, otherwise
+  /// return null.
+  FunctionType getCallMethodType(DartType t) {
+    if (t is InterfaceType) {
+      ClassElement element = t.element;
+      InheritanceManager manager = new InheritanceManager(element.library);
+      FunctionType callType = manager.lookupMemberType(t, "call");
+      return callType;
+    }
+    return null;
+  }
+
+  /// Given an expression, return its type assuming it is
+  /// in the caller position of a call (that is, accounting
+  /// for the possibility of a call method).  Returns null
+  /// if expression is not statically callable.
+  FunctionType getTypeAsCaller(Expression applicand) {
+    var t = getStaticType(applicand);
+    if (t is InterfaceType) {
+      return getCallMethodType(t);
+    }
+    if (t is FunctionType) return t;
+    return null;
+  }
+
+  /// Gets the expected return type of the given function [body], either from
+  /// a normal return/yield, or from a yield*.
+  DartType getExpectedReturnType(FunctionBody body, {bool yieldStar: false}) {
+    FunctionType functionType;
+    var parent = body.parent;
+    if (parent is Declaration) {
+      functionType = elementType(parent.element);
+    } else {
+      assert(parent is FunctionExpression);
+      functionType = getStaticType(parent);
+    }
+
+    var type = functionType.returnType;
+
+    InterfaceType expectedType = null;
+    if (body.isAsynchronous) {
+      if (body.isGenerator) {
+        // Stream<T> -> T
+        expectedType = provider.streamType;
+      } else {
+        // Future<T> -> T
+        // TODO(vsm): Revisit with issue #228.
+        expectedType = provider.futureType;
+      }
+    } else {
+      if (body.isGenerator) {
+        // Iterable<T> -> T
+        expectedType = provider.iterableType;
+      } else {
+        // T -> T
+        return type;
+      }
+    }
+    if (yieldStar) {
+      if (type.isDynamic) {
+        // Ensure it's at least a Stream / Iterable.
+        return expectedType.substitute4([provider.dynamicType]);
+      } else {
+        // Analyzer will provide a separate error if expected type
+        // is not compatible with type.
+        return type;
+      }
+    }
+    if (type.isDynamic) {
+      return type;
+    } else if (type is InterfaceType && type.element == expectedType.element) {
+      return type.typeArguments[0];
+    } else {
+      // Malformed type - fallback on analyzer error.
+      return null;
+    }
+  }
+
+  DartType getStaticType(Expression expr) {
+    return expr.staticType ?? provider.dynamicType;
+  }
+
+  bool _isBottom(DartType t, {bool dynamicIsBottom: false}) {
+    if (t.isDynamic && dynamicIsBottom) return true;
+    // TODO(vsm): We need direct support for non-nullability in DartType.
+    // This should check on "true/nonnullable" Bottom
+    if (t.isBottom) return true;
+    return false;
+  }
+
+  bool _isTop(DartType t, {bool dynamicIsBottom: false}) {
+    if (t.isDynamic && !dynamicIsBottom) return true;
+    if (t.isObject) return true;
+    return false;
+  }
+
+  bool _anyParameterType(FunctionType ft, bool predicate(DartType t)) {
+    return ft.normalParameterTypes.any(predicate) ||
+        ft.optionalParameterTypes.any(predicate) ||
+        ft.namedParameterTypes.values.any(predicate);
+  }
+
+  // TODO(leafp): Revisit this.
+  bool isGroundType(DartType t) {
+    if (t is TypeParameterType) return false;
+    if (_isTop(t)) return true;
+
+    if (t is FunctionType) {
+      if (!_isTop(t.returnType) ||
+          _anyParameterType(t, (pt) => !_isBottom(pt, dynamicIsBottom: true))) {
+        return false;
+      } else {
+        return true;
+      }
+    }
+
+    if (t is InterfaceType) {
+      var typeArguments = t.typeArguments;
+      for (var typeArgument in typeArguments) {
+        if (!_isTop(typeArgument)) return false;
+      }
+      return true;
+    }
+
+    // We should not see any other type aside from malformed code.
+    return false;
+  }
+
+  /// Check that f1 is a subtype of f2. [ignoreReturn] is used in the DDC
+  /// checker to determine whether f1 would be a subtype of f2 if the return
+  /// type of f1 is set to match f2's return type.
+  // [fuzzyArrows] indicates whether or not the f1 and f2 should be
+  // treated as fuzzy arrow types (and hence dynamic parameters to f2 treated as
+  // bottom).
+  bool isFunctionSubTypeOf(FunctionType f1, FunctionType f2,
+      {bool fuzzyArrows: true, bool ignoreReturn: false}) {
+    final r1s = f1.normalParameterTypes;
+    final o1s = f1.optionalParameterTypes;
+    final n1s = f1.namedParameterTypes;
+    final r2s = f2.normalParameterTypes;
+    final o2s = f2.optionalParameterTypes;
+    final n2s = f2.namedParameterTypes;
+    final ret1 = ignoreReturn ? f2.returnType : f1.returnType;
+    final ret2 = f2.returnType;
+
+    // A -> B <: C -> D if C <: A and
+    // either D is void or B <: D
+    if (!ret2.isVoid && !isSubTypeOf(ret1, ret2)) return false;
+
+    // Reject if one has named and the other has optional
+    if (n1s.length > 0 && o2s.length > 0) return false;
+    if (n2s.length > 0 && o1s.length > 0) return false;
+
+    // f2 has named parameters
+    if (n2s.length > 0) {
+      // Check that every named parameter in f2 has a match in f1
+      for (String k2 in n2s.keys) {
+        if (!n1s.containsKey(k2)) return false;
+        if (!isSubTypeOf(n2s[k2], n1s[k2],
+            dynamicIsBottom: fuzzyArrows)) return false;
+      }
+    }
+    // If we get here, we either have no named parameters,
+    // or else the named parameters match and we have no optional
+    // parameters
+
+    // If f1 has more required parameters, reject
+    if (r1s.length > r2s.length) return false;
+
+    // If f2 has more required + optional parameters, reject
+    if (r2s.length + o2s.length > r1s.length + o1s.length) return false;
+
+    // The parameter lists must look like the following at this point
+    // where rrr is a region of required, and ooo is a region of optionals.
+    // f1: rrr ooo ooo ooo
+    // f2: rrr rrr ooo
+    int rr = r1s.length; // required in both
+    int or = r2s.length - r1s.length; // optional in f1, required in f2
+    int oo = o2s.length; // optional in both
+
+    for (int i = 0; i < rr; ++i) {
+      if (!isSubTypeOf(r2s[i], r1s[i],
+          dynamicIsBottom: fuzzyArrows)) return false;
+    }
+    for (int i = 0, j = rr; i < or; ++i, ++j) {
+      if (!isSubTypeOf(r2s[j], o1s[i],
+          dynamicIsBottom: fuzzyArrows)) return false;
+    }
+    for (int i = or, j = 0; i < oo; ++i, ++j) {
+      if (!isSubTypeOf(o2s[j], o1s[i],
+          dynamicIsBottom: fuzzyArrows)) return false;
+    }
+    return true;
+  }
+
+  bool _isInterfaceSubTypeOf(InterfaceType i1, InterfaceType i2) {
+    if (i1 == i2) return true;
+
+    if (i1.element == i2.element) {
+      List<DartType> tArgs1 = i1.typeArguments;
+      List<DartType> tArgs2 = i2.typeArguments;
+
+      // TODO(leafp): Verify that this is always true
+      // Do raw types get filled in?
+      assert(tArgs1.length == tArgs2.length);
+
+      for (int i = 0; i < tArgs1.length; i++) {
+        DartType t1 = tArgs1[i];
+        DartType t2 = tArgs2[i];
+        if (!isSubTypeOf(t1, t2)) return false;
+      }
+      return true;
+    }
+
+    if (i2.isDartCoreFunction) {
+      if (i1.element.getMethod("call") != null) return true;
+    }
+
+    if (i1 == provider.objectType) return false;
+
+    if (_isInterfaceSubTypeOf(i1.superclass, i2)) return true;
+
+    for (final parent in i1.interfaces) {
+      if (_isInterfaceSubTypeOf(parent, i2)) return true;
+    }
+
+    for (final parent in i1.mixins) {
+      if (_isInterfaceSubTypeOf(parent, i2)) return true;
+    }
+
+    return false;
+  }
+
+  bool isSubTypeOf(DartType t1, DartType t2, {bool dynamicIsBottom: false}) {
+    if (t1 == t2) return true;
+
+    // Trivially true.
+    if (_isTop(t2, dynamicIsBottom: dynamicIsBottom) ||
+        _isBottom(t1, dynamicIsBottom: dynamicIsBottom)) {
+      return true;
+    }
+
+    // Trivially false.
+    if (_isTop(t1, dynamicIsBottom: dynamicIsBottom) ||
+        _isBottom(t2, dynamicIsBottom: dynamicIsBottom)) {
+      return false;
+    }
+
+    // The null type is a subtype of any nullable type, which is all Dart types.
+    // TODO(vsm): Note, t1.isBottom still allows for null confusingly.
+    // _isBottom(t1) does not necessarily imply t1.isBottom if there are
+    // nonnullable types in the system.
+    if (t1.isBottom) {
+      return true;
+    }
+
+    // S <: T where S is a type variable
+    //  T is not dynamic or object (handled above)
+    //  S != T (handled above)
+    //  So only true if bound of S is S' and
+    //  S' <: T
+    if (t1 is TypeParameterType) {
+      DartType bound = t1.element.bound;
+      if (bound == null) return false;
+      return isSubTypeOf(bound, t2);
+    }
+
+    if (t2 is TypeParameterType) {
+      return false;
+    }
+
+    if (t2.isDartCoreFunction) {
+      if (t1 is FunctionType) return true;
+      if (t1.element is ClassElement) {
+        if ((t1.element as ClassElement).getMethod("call") != null) return true;
+      }
+    }
+
+    // "Traditional" name-based subtype check.
+    if (t1 is InterfaceType && t2 is InterfaceType) {
+      return _isInterfaceSubTypeOf(t1, t2);
+    }
+
+    if (t1 is! FunctionType && t2 is! FunctionType) return false;
+
+    if (t1 is InterfaceType && t2 is FunctionType) {
+      var callType = getCallMethodType(t1);
+      if (callType == null) return false;
+      return isFunctionSubTypeOf(callType, t2);
+    }
+
+    if (t1 is FunctionType && t2 is InterfaceType) {
+      return false;
+    }
+
+    // Functions
+    // Note: it appears under the hood all Dart functions map to a class /
+    // hidden type that:
+    //  (a) subtypes Object (an internal _FunctionImpl in the VM)
+    //  (b) implements Function
+    //  (c) provides standard Object members (hashCode, toString)
+    //  (d) contains private members (corresponding to _FunctionImpl?)
+    //  (e) provides a call method to handle the actual function invocation
+    //
+    // The standard Dart subtyping rules are structural in nature.  I.e.,
+    // bivariant on arguments and return type.
+    //
+    // The below tries for a more traditional subtyping rule:
+    // - covariant on return type
+    // - contravariant on parameters
+    // - 'sensible' (?) rules on optional and/or named params
+    // but doesn't properly mix with class subtyping.  I suspect Java 8 lambdas
+    // essentially map to dynamic (and rely on invokedynamic) due to similar
+    // issues.
+    return isFunctionSubTypeOf(t1 as FunctionType, t2 as FunctionType);
+  }
+
+  bool isAssignable(DartType t1, DartType t2) {
+    return isSubTypeOf(t1, t2);
+  }
+
+  // Produce a coercion which coerces something of type fromT
+  // to something of type toT.
+  // Returns the error coercion if the types cannot be coerced
+  // according to our current criteria.
+  Coercion _coerceTo(DartType fromT, DartType toT) {
+    // We can use anything as void
+    if (toT.isVoid) return Coercion.identity(toT);
+
+    // fromT <: toT, no coercion needed
+    if (isSubTypeOf(fromT, toT)) return Coercion.identity(toT);
+
+    // TODO(vsm): We can get rid of the second clause if we disallow
+    // all sideways casts - see TODO below.
+    // -------
+    // Note: a function type is never assignable to a class per the Dart
+    // spec - even if it has a compatible call method.  We disallow as
+    // well for consistency.
+    if ((fromT is FunctionType && getCallMethodType(toT) != null) ||
+        (toT is FunctionType && getCallMethodType(fromT) != null)) {
+      return Coercion.error();
+    }
+
+    // Downcast if toT <: fromT
+    if (isSubTypeOf(toT, fromT)) return Coercion.cast(fromT, toT);
+
+    // TODO(vsm): Once we have generic methods, we should delete this
+    // workaround.  These sideways casts are always ones we warn about
+    // - i.e., we think they are likely to fail at runtime.
+    // -------
+    // Downcast if toT <===> fromT
+    // The intention here is to allow casts that are sideways in the restricted
+    // type system, but allowed in the regular dart type system, since these
+    // are likely to succeed.  The canonical example is List<dynamic> and
+    // Iterable<T> for some concrete T (e.g. Object).  These are unrelated
+    // in the restricted system, but List<dynamic> <: Iterable<T> in dart.
+    if (fromT.isAssignableTo(toT)) {
+      return Coercion.cast(fromT, toT);
+    }
+
+    return Coercion.error();
+  }
+
+  StaticInfo checkAssignment(Expression expr, DartType toT) {
+    final fromT = getStaticType(expr);
+    final Coercion c = _coerceTo(fromT, toT);
+    if (c is Identity) return null;
+    if (c is CoercionError) return new StaticTypeError(this, expr, toT);
+    var reason = null;
+
+    var errors = <String>[];
+    var ok = inferrer.inferExpression(expr, toT, errors);
+    if (ok) return InferredType.create(this, expr, toT);
+    reason = (errors.isNotEmpty) ? errors.first : null;
+
+    if (c is Cast) return DownCast.create(this, expr, c, reason: reason);
+    assert(false);
+    return null;
+  }
+
+  DartType elementType(Element e) {
+    if (e == null) {
+      // Malformed code - just return dynamic.
+      return provider.dynamicType;
+    }
+    return (e as dynamic).type;
+  }
+
+  bool _isLibraryPrefix(Expression node) =>
+      node is SimpleIdentifier && node.staticElement is PrefixElement;
+
+  /// Returns `true` if the target expression is dynamic.
+  bool isDynamicTarget(Expression node) {
+    if (node == null) return false;
+
+    if (_isLibraryPrefix(node)) return false;
+
+    // Null type happens when we have unknown identifiers, like a dart: import
+    // that doesn't resolve.
+    var type = node.staticType;
+    return type == null || type.isDynamic;
+  }
+
+  /// Returns `true` if the expression is a dynamic function call or method
+  /// invocation.
+  bool isDynamicCall(Expression call) {
+    var ft = getTypeAsCaller(call);
+    // TODO(leafp): This will currently return true if t is Function
+    // This is probably the most correct thing to do for now, since
+    // this code is also used by the back end.  Maybe revisit at some
+    // point?
+    if (ft == null) return true;
+    // Dynamic as the parameter type is treated as bottom.  A function with
+    // a dynamic parameter type requires a dynamic call in general.
+    // However, as an optimization, if we have an original definition, we know
+    // dynamic is reified as Object - in this case a regular call is fine.
+    if (call is SimpleIdentifier) {
+      var element = call.staticElement;
+      if (element is FunctionElement || element is MethodElement) {
+        // An original declaration.
+        return false;
+      }
+    }
+
+    return _anyParameterType(ft, (pt) => pt.isDynamic);
+  }
+}
+
+class DownwardsInference {
+  final TypeRules rules;
+
+  DownwardsInference(this.rules);
+
+  /// Called for each list literal which gets inferred
+  void annotateListLiteral(ListLiteral e, List<DartType> targs) {}
+
+  /// Called for each map literal which gets inferred
+  void annotateMapLiteral(MapLiteral e, List<DartType> targs) {}
+
+  /// Called for each new/const which gets inferred
+  void annotateInstanceCreationExpression(
+      InstanceCreationExpression e, List<DartType> targs) {}
+
+  /// Called for cast from dynamic required for inference to succeed
+  void annotateCastFromDynamic(Expression e, DartType t) {}
+
+  /// Called for each function expression return type inferred
+  void annotateFunctionExpression(FunctionExpression e, DartType returnType) {}
+
+  /// Downward inference
+  bool inferExpression(Expression e, DartType t, List<String> errors) {
+    // Don't cast top level expressions, only sub-expressions
+    return _inferExpression(e, t, errors, cast: false);
+  }
+
+  /// Downward inference
+  bool _inferExpression(Expression e, DartType t, List<String> errors,
+      {cast: true}) {
+    if (e is ConditionalExpression) {
+      return _inferConditionalExpression(e, t, errors);
+    }
+    if (e is ParenthesizedExpression) {
+      return _inferParenthesizedExpression(e, t, errors);
+    }
+    if (rules.isSubTypeOf(rules.getStaticType(e), t)) return true;
+    if (cast && rules.getStaticType(e).isDynamic) {
+      annotateCastFromDynamic(e, t);
+      return true;
+    }
+    if (e is FunctionExpression) return _inferFunctionExpression(e, t, errors);
+    if (e is ListLiteral) return _inferListLiteral(e, t, errors);
+    if (e is MapLiteral) return _inferMapLiteral(e, t, errors);
+    if (e is NamedExpression) return _inferNamedExpression(e, t, errors);
+    if (e is InstanceCreationExpression) {
+      return _inferInstanceCreationExpression(e, t, errors);
+    }
+    errors.add("$e cannot be typed as $t");
+    return false;
+  }
+
+  /// If t1 = I<dynamic, ..., dynamic>, then look for a supertype
+  /// of t1 of the form K<S0, ..., Sm> where t2 = K<S0', ..., Sm'>
+  /// If the supertype exists, use the constraints S0 <: S0', ... Sm <: Sm'
+  /// to derive a concrete instantation for I of the form <T0, ..., Tn>,
+  /// such that I<T0, .., Tn> <: t2
+  List<DartType> _matchTypes(InterfaceType t1, InterfaceType t2) {
+    if (t1 == t2) return t2.typeArguments;
+    var tArgs1 = t1.typeArguments;
+    var tArgs2 = t2.typeArguments;
+    // If t1 isn't a raw type, bail out
+    if (tArgs1 != null && tArgs1.any((t) => !t.isDynamic)) return null;
+
+    // This is our inferred type argument list.  We start at all dynamic,
+    // and fill in with inferred types when we reach a match.
+    var actuals =
+        new List<DartType>.filled(tArgs1.length, rules.provider.dynamicType);
+
+    // When we find the supertype of t1 with the same
+    // classname as t2 (see below), we have the following:
+    // If t1 is an instantiation of a class T1<X0, ..., Xn>
+    // and t2 is an instantiation of a class T2<Y0, ...., Ym>
+    // of the form t2 = T2<S0, ..., Sm>
+    // then we want to choose instantiations for the Xi
+    // T0, ..., Tn such that T1<T0, ..., Tn> <: t2 .
+    // To find this, we simply instantate T1 with
+    // X0, ..., Xn, and then find its superclass
+    // T2<T0', ..., Tn'>.  We then solve the constraint
+    // set T0' <: S0, ..., Tn' <: Sn for the Xi.
+    // Currently, we only handle constraints where
+    // the Ti' is one of the Xi'.  If there are multiple
+    // constraints on some Xi, we choose the lower of the
+    // two (if it exists).
+    bool permute(List<DartType> permutedArgs) {
+      if (permutedArgs == null) return false;
+      var ps = t1.typeParameters;
+      var ts = ps.map((p) => p.type).toList();
+      for (int i = 0; i < permutedArgs.length; i++) {
+        var tVar = permutedArgs[i];
+        var tActual = tArgs2[i];
+        var index = ts.indexOf(tVar);
+        if (index >= 0 && rules.isSubTypeOf(tActual, actuals[index])) {
+          actuals[index] = tActual;
+        }
+      }
+      return actuals.any((x) => !x.isDynamic);
+    }
+
+    // Look for the first supertype of t1 with the same class name as t2.
+    bool match(InterfaceType t1) {
+      if (t1.element == t2.element) {
+        return permute(t1.typeArguments);
+      }
+
+      if (t1 == rules.provider.objectType) return false;
+
+      if (match(t1.superclass)) return true;
+
+      for (final parent in t1.interfaces) {
+        if (match(parent)) return true;
+      }
+
+      for (final parent in t1.mixins) {
+        if (match(parent)) return true;
+      }
+      return false;
+    }
+
+    // We have that t1 = T1<dynamic, ..., dynamic>.
+    // To match t1 against t2, we use the uninstantiated version
+    // of t1, essentially treating it as an instantiation with
+    // fresh variables, and solve for the variables.
+    // t1.element.type will be of the form T1<X0, ..., Xn>
+    if (!match(t1.element.type)) return null;
+    var newT1 = t1.element.type.substitute4(actuals);
+    // If we found a solution, return it.
+    if (rules.isSubTypeOf(newT1, t2)) return actuals;
+    return null;
+  }
+
+  /// These assume that e is not already a subtype of t
+
+  bool _inferConditionalExpression(
+      ConditionalExpression e, DartType t, errors) {
+    return _inferExpression(e.thenExpression, t, errors) &&
+        _inferExpression(e.elseExpression, t, errors);
+  }
+
+  bool _inferParenthesizedExpression(
+      ParenthesizedExpression e, DartType t, errors) {
+    return _inferExpression(e.expression, t, errors);
+  }
+
+  bool _inferInstanceCreationExpression(
+      InstanceCreationExpression e, DartType t, errors) {
+    var arguments = e.argumentList.arguments;
+    var rawType = rules.getStaticType(e);
+    // rawType is the instantiated type of the instance
+    if (rawType is! InterfaceType) return false;
+    var type = (rawType as InterfaceType);
+    if (type.typeParameters == null ||
+        type.typeParameters.length == 0) return false;
+    if (e.constructorName.type == null) return false;
+    // classTypeName is the type name of the class being instantiated
+    var classTypeName = e.constructorName.type;
+    // Check that we were not passed any type arguments
+    if (classTypeName.typeArguments != null) return false;
+    // Infer type arguments
+    if (t is! InterfaceType) return false;
+    var targs = _matchTypes(type, t);
+    if (targs == null) return false;
+    if (e.staticElement == null) return false;
+    var constructorElement = e.staticElement;
+    // From the constructor element get:
+    //  the instantiated type of the constructor, then
+    //     the uninstantiated element for the constructor, then
+    //        the uninstantiated type for the constructor
+    var rawConstructorElement =
+        constructorElement.type.element as ConstructorElement;
+    var baseType = rawConstructorElement.type;
+    if (baseType == null) return false;
+    // From the interface type (instantiated), get:
+    //  the uninstantiated element, then
+    //    the uninstantiated type, then
+    //      the type arguments (aka the type parameters)
+    var tparams = type.element.type.typeArguments;
+    // Take the uninstantiated constructor type, and replace the type
+    // parameters with the inferred arguments.
+    var fType = baseType.substitute2(targs, tparams);
+    {
+      var rTypes = fType.normalParameterTypes;
+      var oTypes = fType.optionalParameterTypes;
+      var pTypes = new List.from(rTypes)..addAll(oTypes);
+      var pArgs = arguments.where((x) => x is! NamedExpression);
+      var pi = 0;
+      for (var arg in pArgs) {
+        if (pi >= pTypes.length) return false;
+        var argType = pTypes[pi];
+        if (!_inferExpression(arg, argType, errors)) return false;
+        pi++;
+      }
+      var nTypes = fType.namedParameterTypes;
+      for (var arg0 in arguments) {
+        if (arg0 is! NamedExpression) continue;
+        var arg = arg0 as NamedExpression;
+        SimpleIdentifier nameNode = arg.name.label;
+        String name = nameNode.name;
+        var argType = nTypes[name];
+        if (argType == null) return false;
+        if (!_inferExpression(arg, argType, errors)) return false;
+      }
+    }
+    annotateInstanceCreationExpression(e, targs);
+    return true;
+  }
+
+  bool _inferNamedExpression(NamedExpression e, DartType t, errors) {
+    return _inferExpression(e.expression, t, errors);
+  }
+
+  bool _inferFunctionExpression(FunctionExpression e, DartType t, errors) {
+    if (t is! FunctionType) return false;
+    var fType = t as FunctionType;
+    var eType = e.staticType as FunctionType;
+    if (eType is! FunctionType) return false;
+
+    // We have a function literal, so we can treat the arrow type
+    // as non-fuzzy.  Since we're not improving on parameter types
+    // currently, if this check fails then we cannot succeed, so
+    // bail out.  Otherwise, we never need to check the parameter types
+    // again.
+    if (!rules.isFunctionSubTypeOf(eType, fType,
+        fuzzyArrows: false, ignoreReturn: true)) return false;
+
+    // This only entered inference because of fuzzy typing.
+    // The function type is already specific enough, we can just
+    // succeed and treat it as a successful inference
+    if (rules.isSubTypeOf(eType.returnType, fType.returnType)) return true;
+
+    // Fuzzy typing again, handle the void case (not caught by the previous)
+    if (fType.returnType.isVoid) return true;
+
+    if (e.body is! ExpressionFunctionBody) return false;
+    var body = (e.body as ExpressionFunctionBody).expression;
+    if (!_inferExpression(body, fType.returnType, errors)) return false;
+
+    // TODO(leafp): Try narrowing the argument types if possible
+    // to get better code in the function body.  This requires checking
+    // that the body is well-typed at the more specific type.
+
+    // At this point, we know that the parameter types are in the appropriate subtype
+    // relation, and we have checked that we can type the body at the appropriate return
+    // type, so we can are done.
+    annotateFunctionExpression(e, fType.returnType);
+    return true;
+  }
+
+  bool _inferListLiteral(ListLiteral e, DartType t, errors) {
+    var dyn = rules.provider.dynamicType;
+    var listT = rules.provider.listType.substitute4([dyn]);
+    // List <: t (using dart rules) must be true
+    if (!listT.isSubtypeOf(t)) return false;
+    // The list literal must have no type arguments
+    if (e.typeArguments != null) return false;
+    if (t is! InterfaceType) return false;
+    var targs = _matchTypes(listT, t);
+    if (targs == null) return false;
+    assert(targs.length == 1);
+    var etype = targs[0];
+    assert(!etype.isDynamic);
+    var elements = e.elements;
+    var b = elements.every((e) => _inferExpression(e, etype, errors));
+    if (b) annotateListLiteral(e, targs);
+    return b;
+  }
+
+  bool _inferMapLiteral(MapLiteral e, DartType t, errors) {
+    var dyn = rules.provider.dynamicType;
+    var mapT = rules.provider.mapType.substitute4([dyn, dyn]);
+    // Map <: t (using dart rules) must be true
+    if (!mapT.isSubtypeOf(t)) return false;
+    // The map literal must have no type arguments
+    if (e.typeArguments != null) return false;
+    if (t is! InterfaceType) return false;
+    var targs = _matchTypes(mapT, t);
+    if (targs == null) return false;
+    assert(targs.length == 2);
+    var kType = targs[0];
+    var vType = targs[1];
+    assert(!(kType.isDynamic && vType.isDynamic));
+    var entries = e.entries;
+    bool inferEntry(MapLiteralEntry entry) {
+      return _inferExpression(entry.key, kType, errors) &&
+          _inferExpression(entry.value, vType, errors);
+    }
+    var b = entries.every(inferEntry);
+    if (b) annotateMapLiteral(e, targs);
+    return b;
+  }
+}
diff --git a/pkg/analyzer/lib/src/task/strong_mode.dart b/pkg/analyzer/lib/src/task/strong_mode.dart
new file mode 100644
index 0000000..ea3559d
--- /dev/null
+++ b/pkg/analyzer/lib/src/task/strong_mode.dart
@@ -0,0 +1,506 @@
+// 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.src.task.strong_mode;
+
+import 'dart:collection';
+
+import 'package:analyzer/src/generated/ast.dart';
+import 'package:analyzer/src/generated/element.dart';
+import 'package:analyzer/src/generated/resolver.dart';
+import 'package:analyzer/src/generated/utilities_dart.dart';
+
+/**
+ * Set the type of the sole parameter of the given [element] to the given [type].
+ */
+void setParameterType(PropertyAccessorElement element, DartType type) {
+  if (element is PropertyAccessorElementImpl) {
+    ParameterElement parameter = _getParameter(element);
+    if (parameter is ParameterElementImpl) {
+      //
+      // Update the type of the parameter.
+      //
+      parameter.type = type;
+      //
+      // Update the type of the setter to reflect the new parameter type.
+      //
+      FunctionType functionType = element.type;
+      if (functionType is FunctionTypeImpl) {
+        element.type =
+            new FunctionTypeImpl(element, functionType.prunedTypedefs)
+              ..typeArguments = functionType.typeArguments;
+      } else {
+        assert(false);
+      }
+    } else {
+      assert(false);
+    }
+  } else {
+    throw new StateError('element is an instance of ${element.runtimeType}');
+    assert(false);
+  }
+}
+
+/**
+ * Set the return type of the given [element] to the given [type].
+ */
+void setReturnType(ExecutableElement element, DartType type) {
+  if (element is ExecutableElementImpl) {
+    //
+    // Update the return type of the element, which is stored in two places:
+    // directly in the element and indirectly in the type of the element.
+    //
+    element.returnType = type;
+    FunctionType functionType = element.type;
+    if (functionType is FunctionTypeImpl) {
+      element.type = new FunctionTypeImpl(element, functionType.prunedTypedefs)
+        ..typeArguments = functionType.typeArguments;
+    } else {
+      assert(false);
+    }
+  } else {
+    assert(false);
+  }
+}
+
+/**
+ * Return the element for the single parameter of the given [setter], or `null`
+ * if the executable element is not a setter or does not have a single
+ * parameter.
+ */
+ParameterElement _getParameter(ExecutableElement setter) {
+  if (setter is PropertyAccessorElement && setter.isSetter) {
+    List<ParameterElement> parameters = setter.parameters;
+    if (parameters.length == 1) {
+      return parameters[0];
+    }
+  }
+  return null;
+}
+
+/**
+ * A function that returns `true` if the given [variable] passes the filter.
+ */
+typedef bool VariableFilter(VariableElement element);
+
+/**
+ * An object used to infer the type of instance fields and the return types of
+ * instance methods within a single compilation unit.
+ */
+class InstanceMemberInferrer {
+  /**
+   * The type provider used to look up types.
+   */
+  final TypeProvider typeProvider;
+
+  /**
+   * The type system used to compute the least upper bound of types.
+   */
+  TypeSystem typeSystem;
+
+  /**
+   * The inheritance manager used to find overridden method.
+   */
+  InheritanceManager inheritanceManager;
+
+  /**
+   * The classes that have been visited while attempting to infer the types of
+   * instance members of some base class.
+   */
+  HashSet<ClassElementImpl> elementsBeingInferred =
+      new HashSet<ClassElementImpl>();
+
+  /**
+   * Initialize a newly create inferrer.
+   */
+  InstanceMemberInferrer(this.typeProvider, {TypeSystem typeSystem})
+      : typeSystem = (typeSystem != null) ? typeSystem : new TypeSystemImpl();
+
+  /**
+   * Infer type information for all of the instance members in the given
+   * compilation [unit].
+   */
+  void inferCompilationUnit(CompilationUnitElement unit) {
+    inheritanceManager = new InheritanceManager(unit.library);
+    unit.types.forEach((ClassElement classElement) {
+      try {
+        _inferClass(classElement);
+      } on _CycleException {
+        // This is a short circuit return to prevent types that inherit from
+        // types containing a circular reference from being inferred.
+      }
+    });
+  }
+
+  /**
+   * Compute the best type for the [parameter] at the given [index] that must be
+   * compatible with the types of the corresponding parameters of the given
+   * [overriddenMethods].
+   *
+   * At the moment, this method will only return a type other than 'dynamic' if
+   * the types of all of the parameters are the same. In the future we might
+   * want to be smarter about it, such as by returning the least upper bound of
+   * the parameter types.
+   */
+  DartType _computeParameterType(ParameterElement parameter, int index,
+      List<ExecutableElement> overriddenMethods) {
+    DartType parameterType = null;
+    int length = overriddenMethods.length;
+    for (int i = 0; i < length; i++) {
+      DartType type = _getTypeOfCorrespondingParameter(
+          parameter, index, overriddenMethods[i]);
+      if (parameterType == null) {
+        parameterType = type;
+      } else if (parameterType != type) {
+        return typeProvider.dynamicType;
+      }
+    }
+    return parameterType == null ? typeProvider.dynamicType : parameterType;
+  }
+
+  /**
+   * Compute the best return type for a method that must be compatible with the
+   * return types of each of the given [overriddenMethods].
+   *
+   * At the moment, this method will only return a type other than 'dynamic' if
+   * the return types of all of the methods are the same. In the future we might
+   * want to be smarter about it.
+   */
+  DartType _computeReturnType(List<ExecutableElement> overriddenMethods) {
+    DartType returnType = null;
+    int length = overriddenMethods.length;
+    for (int i = 0; i < length; i++) {
+      DartType type = _getReturnType(overriddenMethods[i]);
+      if (returnType == null) {
+        returnType = type;
+      } else if (returnType != type) {
+        return typeProvider.dynamicType;
+      }
+    }
+    return returnType == null ? typeProvider.dynamicType : returnType;
+  }
+
+  DartType _getReturnType(ExecutableElement element) {
+    DartType returnType = element.returnType;
+    if (returnType == null) {
+      return typeProvider.dynamicType;
+    }
+    return returnType;
+  }
+
+  /**
+   * Given a [method], return the type of the parameter in the method that
+   * corresponds to the given [parameter]. If the parameter is positional, then
+   * it appears at the given [index] in its enclosing element's list of
+   * parameters.
+   */
+  DartType _getTypeOfCorrespondingParameter(
+      ParameterElement parameter, int index, ExecutableElement method) {
+    //
+    // Find the corresponding parameter.
+    //
+    List<ParameterElement> methodParameters = method.parameters;
+    ParameterElement matchingParameter = null;
+    if (parameter.parameterKind == ParameterKind.NAMED) {
+      //
+      // If we're looking for a named parameter, only a named parameter with
+      // the same name will be matched.
+      //
+      matchingParameter = methodParameters.lastWhere(
+          (ParameterElement methodParameter) =>
+              methodParameter.parameterKind == ParameterKind.NAMED &&
+                  methodParameter.name == parameter.name,
+          orElse: () => null);
+    } else {
+      //
+      // If we're looking for a positional parameter we ignore the difference
+      // between required and optional parameters.
+      //
+      if (index < methodParameters.length) {
+        matchingParameter = methodParameters[index];
+        if (matchingParameter.parameterKind == ParameterKind.NAMED) {
+          matchingParameter = null;
+        }
+      }
+    }
+    //
+    // Then return the type of the parameter.
+    //
+    return matchingParameter == null
+        ? typeProvider.dynamicType
+        : matchingParameter.type;
+  }
+
+  /**
+   * Infer type information for all of the instance members in the given
+   * [classElement].
+   */
+  void _inferClass(ClassElement classElement) {
+    if (classElement is ClassElementImpl) {
+      if (classElement.hasBeenInferred) {
+        return;
+      }
+      if (!elementsBeingInferred.add(classElement)) {
+        // We have found a circularity in the class hierarchy. For now we just
+        // stop trying to infer any type information for any classes that
+        // inherit from any class in the cycle. We could potentially limit the
+        // algorithm to only not inferring types in the classes in the cycle,
+        // but it isn't clear that the results would be significantly better.
+        throw new _CycleException();
+      }
+      try {
+        //
+        // Ensure that all of instance members in the supertypes have had types
+        // inferred for them.
+        //
+        _inferType(classElement.supertype);
+        classElement.mixins.forEach(_inferType);
+        classElement.interfaces.forEach(_inferType);
+        //
+        // Then infer the types for the members.
+        //
+        classElement.fields.forEach(_inferField);
+        classElement.accessors.forEach(_inferExecutable);
+        classElement.methods.forEach(_inferExecutable);
+        //
+        // Infer initializing formal parameter types. This must happen after
+        // field types are inferred.
+        //
+        classElement.constructors.forEach(_inferConstructorFieldFormals);
+        classElement.hasBeenInferred = true;
+      } finally {
+        elementsBeingInferred.remove(classElement);
+      }
+    }
+  }
+
+  /**
+   * If the given [fieldElement] represents a non-synthetic instance field for
+   * which no type was provided, infer the type of the field.
+   */
+  void _inferField(FieldElement fieldElement) {
+    if (!fieldElement.isSynthetic &&
+        !fieldElement.isStatic &&
+        fieldElement.hasImplicitType) {
+      //
+      // First look for overridden getters with the same name as the field.
+      //
+      List<ExecutableElement> overriddenGetters = inheritanceManager
+          .lookupOverrides(fieldElement.enclosingElement, fieldElement.name);
+      DartType newType = null;
+      if (overriddenGetters.isNotEmpty && _onlyGetters(overriddenGetters)) {
+        newType = _computeReturnType(overriddenGetters);
+        List<ExecutableElement> overriddenSetters = inheritanceManager
+            .lookupOverrides(
+                fieldElement.enclosingElement, fieldElement.name + '=');
+        if (!_isCompatible(newType, overriddenSetters)) {
+          newType = null;
+        }
+      }
+      //
+      // If there is no overridden getter or if the overridden getter's type is
+      // dynamic, then we can infer the type from the initialization expression
+      // without breaking subtype rules. We could potentially infer a consistent
+      // return type even if the overridden getter's type was not dynamic, but
+      // choose not to for simplicity. The field is required to be final to
+      // prevent choosing a type that is inconsistent with assignments we cannot
+      // analyze.
+      //
+      if (newType == null || newType.isDynamic) {
+        if (fieldElement.initializer != null &&
+            (fieldElement.isFinal || overriddenGetters.isEmpty)) {
+          newType = fieldElement.initializer.returnType;
+        }
+      }
+      if (newType == null || newType.isBottom) {
+        newType = typeProvider.dynamicType;
+      }
+      (fieldElement as FieldElementImpl).type = newType;
+      setReturnType(fieldElement.getter, newType);
+      if (!fieldElement.isFinal && !fieldElement.isConst) {
+        setParameterType(fieldElement.setter, newType);
+      }
+    }
+  }
+
+  /**
+   * If the given [element] represents a non-synthetic instance method,
+   * getter or setter, infer the return type and any parameter type(s) where
+   * they were not provided.
+   */
+  void _inferExecutable(ExecutableElement element) {
+    if (element.isSynthetic || element.isStatic) {
+      return;
+    }
+    List<ExecutableElement> overriddenMethods = null;
+    //
+    // Infer the return type.
+    //
+    if (element.hasImplicitReturnType) {
+      overriddenMethods = inheritanceManager.lookupOverrides(
+          element.enclosingElement, element.name);
+      if (overriddenMethods.isEmpty ||
+          !_allSameElementKind(element, overriddenMethods)) {
+        return;
+      }
+      setReturnType(element, _computeReturnType(overriddenMethods));
+      if (element is PropertyAccessorElement) {
+        _updateSyntheticVariableType(element);
+      }
+    }
+    //
+    // Infer the parameter types.
+    //
+    List<ParameterElement> parameters = element.parameters;
+    int length = parameters.length;
+    for (int i = 0; i < length; ++i) {
+      ParameterElement parameter = parameters[i];
+      if (parameter is ParameterElementImpl && parameter.hasImplicitType) {
+        if (overriddenMethods == null) {
+          overriddenMethods = inheritanceManager.lookupOverrides(
+              element.enclosingElement, element.name);
+        }
+        if (overriddenMethods.isEmpty ||
+            !_allSameElementKind(element, overriddenMethods)) {
+          return;
+        }
+        parameter.type = _computeParameterType(parameter, i, overriddenMethods);
+        if (element is PropertyAccessorElement) {
+          _updateSyntheticVariableType(element);
+        }
+      }
+    }
+  }
+
+  /**
+   * If the given [element] is a non-synthetic getter or setter, update its
+   * synthetic variable's type to match the getter's return type, or if no
+   * corresponding getter exists, use the setter's parameter type.
+   *
+   * In general, the type of the synthetic variable should not be used, because
+   * getters and setters are independent methods. But this logic matches what
+   * `TypeResolverVisitor.visitMethodDeclaration` would fill in there.
+   */
+  void _updateSyntheticVariableType(PropertyAccessorElement element) {
+    assert(!element.isSynthetic);
+    PropertyAccessorElement getter = element;
+    if (element.isSetter) {
+      // See if we can find any getter.
+      getter = element.correspondingGetter;
+    }
+    DartType newType;
+    if (getter != null) {
+      newType = getter.returnType;
+    } else if (element.isSetter && element.parameters.isNotEmpty) {
+      newType = element.parameters[0].type;
+    }
+    if (newType != null) {
+      (element.variable as VariableElementImpl).type = newType;
+    }
+  }
+
+  /**
+   * Infer type information for all of the instance members in the given
+   * interface [type].
+   */
+  void _inferType(InterfaceType type) {
+    if (type != null) {
+      ClassElement element = type.element;
+      if (element != null) {
+        _inferClass(element);
+      }
+    }
+  }
+
+  /**
+   * Return `true` if the given [type] is compatible with the argument types of
+   * all of the given [setters].
+   */
+  bool _isCompatible(DartType type, List<ExecutableElement> setters) {
+    for (ExecutableElement setter in setters) {
+      ParameterElement parameter = _getParameter(setter);
+      if (parameter != null && !typeSystem.isSubtypeOf(parameter.type, type)) {
+        return false;
+      }
+    }
+    return true;
+  }
+
+  /**
+   * Return `true` if the list of [elements] contains only getters.
+   */
+  bool _onlyGetters(List<ExecutableElement> elements) {
+    for (ExecutableElement element in elements) {
+      if (!(element is PropertyAccessorElement && element.isGetter)) {
+        return false;
+      }
+    }
+    return true;
+  }
+
+  /**
+   * Return `true` if the list of [elements] contains only methods.
+   */
+  bool _allSameElementKind(
+      ExecutableElement element, List<ExecutableElement> elements) {
+    return elements.every((e) => e.kind == element.kind);
+  }
+
+  void _inferConstructorFieldFormals(ConstructorElement element) {
+    for (ParameterElement p in element.parameters) {
+      if (p is FieldFormalParameterElement) {
+        _inferFieldFormalParameter(p);
+      }
+    }
+  }
+
+  void _inferFieldFormalParameter(FieldFormalParameterElement element) {
+    FieldElement field = element.field;
+    if (field != null && element.hasImplicitType) {
+      (element as FieldFormalParameterElementImpl).type = field.type;
+    }
+  }
+}
+
+/**
+ * A visitor that will gather all of the variables referenced within a given
+ * AST structure. The collection can be restricted to contain only those
+ * variables that pass a specified filter.
+ */
+class VariableGatherer extends RecursiveAstVisitor {
+  /**
+   * The filter used to limit which variables are gathered, or `null` if no
+   * filtering is to be performed.
+   */
+  final VariableFilter filter;
+
+  /**
+   * The variables that were found.
+   */
+  final Set<VariableElement> results = new HashSet<VariableElement>();
+
+  /**
+   * Initialize a newly created gatherer to gather all of the variables that
+   * pass the given [filter] (or all variables if no filter is provided).
+   */
+  VariableGatherer([this.filter = null]);
+
+  @override
+  void visitSimpleIdentifier(SimpleIdentifier node) {
+    if (!node.inDeclarationContext()) {
+      Element element = node.staticElement;
+      if (element is PropertyAccessorElement && element.isSynthetic) {
+        element = (element as PropertyAccessorElement).variable;
+      }
+      if (element is VariableElement && (filter == null || filter(element))) {
+        results.add(element);
+      }
+    }
+  }
+}
+
+/**
+ * A class of exception that is not used anywhere else.
+ */
+class _CycleException implements Exception {}
diff --git a/pkg/analyzer/lib/task/dart.dart b/pkg/analyzer/lib/task/dart.dart
index a0e309e..45fcb56 100644
--- a/pkg/analyzer/lib/task/dart.dart
+++ b/pkg/analyzer/lib/task/dart.dart
@@ -68,15 +68,6 @@
     new ListResultDescriptor<Source>('INCLUDED_PARTS', Source.EMPTY_LIST);
 
 /**
- * A flag specifying whether a library is dependent on code that is only
- * available in a client.
- *
- * The result is only available for [Source]s representing a library.
- */
-final ResultDescriptor<bool> IS_CLIENT =
-    new ResultDescriptor<bool>('IS_CLIENT', false);
-
-/**
  * A flag specifying whether a library is launchable.
  *
  * The result is only available for [Source]s representing a library.
@@ -128,7 +119,8 @@
  * The result is only available for [Source]s representing a compilation unit.
  */
 final ResultDescriptor<Token> TOKEN_STREAM = new ResultDescriptor<Token>(
-    'TOKEN_STREAM', null, cachingPolicy: TOKEN_STREAM_CACHING_POLICY);
+    'TOKEN_STREAM', null,
+    cachingPolicy: TOKEN_STREAM_CACHING_POLICY);
 
 /**
  * The sources of the Dart files that a library consists of.
@@ -150,6 +142,9 @@
  * change if a single part is included in more than one library.
  */
 class LibrarySpecificUnit implements AnalysisTarget {
+  static const List<LibrarySpecificUnit> EMPTY_LIST =
+      const <LibrarySpecificUnit>[];
+
   /**
    * The defining compilation unit of the library in which the [unit]
    * is analyzed.
diff --git a/pkg/analyzer/lib/task/model.dart b/pkg/analyzer/lib/task/model.dart
index 0a45766..af67453 100644
--- a/pkg/analyzer/lib/task/model.dart
+++ b/pkg/analyzer/lib/task/model.dart
@@ -5,10 +5,13 @@
 library analyzer.task.model;
 
 import 'dart:collection';
+import 'dart:developer';
 
 import 'package:analyzer/src/generated/engine.dart' hide AnalysisTask;
+import 'package:analyzer/src/generated/error.dart' show AnalysisError;
 import 'package:analyzer/src/generated/java_engine.dart';
 import 'package:analyzer/src/generated/source.dart';
+import 'package:analyzer/src/generated/utilities_general.dart';
 import 'package:analyzer/src/task/driver.dart';
 import 'package:analyzer/src/task/model.dart';
 
@@ -56,7 +59,7 @@
 /**
  * An object with which an analysis result can be associated.
  *
- * Clients are allowed to subtype this class when creating new kinds of targets.
+ * 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].
  */
@@ -72,16 +75,27 @@
  * An object used to compute one or more analysis results associated with a
  * single target.
  *
- * Clients are expected to extend this class when creating new tasks.
+ * Clients must extend this class when creating new tasks.
  */
 abstract class AnalysisTask {
   /**
+   * A queue storing the last 10 task descriptions for diagnostic purposes.
+   */
+  static final LimitedQueue<String> LAST_TASKS = new LimitedQueue<String>(10);
+
+  /**
    * A table mapping the types of analysis tasks to the number of times each
    * kind of task has been performed.
    */
   static final Map<Type, int> countMap = new HashMap<Type, int>();
 
   /**
+   * A table mapping the types of analysis tasks to user tags used to collect
+   * timing data for the Observatory.
+   */
+  static Map<Type, UserTag> tagMap = new HashMap<Type, UserTag>();
+
+  /**
    * A table mapping the types of analysis tasks to stopwatches used to compute
    * how much time was spent executing each kind of task.
    */
@@ -189,15 +203,15 @@
    * map should be fully populated (have a key/value pair for each result that
    * this task is expected to produce) or the [caughtException] should be set.
    *
-   * Clients should not override this method.
+   * Clients may not override this method.
    */
   void perform() {
     try {
       _safelyPerform();
     } on AnalysisException catch (exception, stackTrace) {
       caughtException = new CaughtException(exception, stackTrace);
-      AnalysisEngine.instance.logger.logInformation(
-          "Task failed: ${description}", caughtException);
+      AnalysisEngine.instance.logger
+          .logError("Task failed: ${description}", caughtException);
     }
   }
 
@@ -205,44 +219,101 @@
   String toString() => description;
 
   /**
+   * Given a strongly connected component, find and return a list of
+   * [TargetedResult]s that describes a cyclic path within the cycle.  Returns
+   * null if no cyclic path is found.
+   */
+  List<TargetedResult> _findCyclicPath(List<WorkItem> cycle) {
+    WorkItem findInCycle(AnalysisTarget target, ResultDescriptor descriptor) {
+      for (WorkItem item in cycle) {
+        if (target == item.target && descriptor == item.spawningResult) {
+          return item;
+        }
+      }
+      return null;
+    }
+
+    HashSet<WorkItem> active = new HashSet<WorkItem>();
+    List<TargetedResult> path = null;
+    bool traverse(WorkItem item) {
+      if (!active.add(item)) {
+        // We've found a cycle
+        path = <TargetedResult>[];
+        return true;
+      }
+      for (TargetedResult result in item.inputTargetedResults) {
+        WorkItem item = findInCycle(result.target, result.result);
+        // Ignore edges that leave the cycle.
+        if (item != null) {
+          if (traverse(item)) {
+            // This edge is in a cycle (or leads to a cycle) so add it to the
+            // path
+            path.add(result);
+            return true;
+          }
+        }
+      }
+      // There was no cycle.
+      return false;
+    }
+    if (cycle.length > 0) {
+      traverse(cycle[0]);
+    }
+    return path;
+  }
+
+  /**
    * Perform this analysis task, ensuring that all exceptions are wrapped in an
    * [AnalysisException].
    *
-   * Clients should not override this method.
+   * Clients may not override this method.
    */
   void _safelyPerform() {
     try {
       //
+      // Store task description for diagnostics.
+      //
+      LAST_TASKS.add(description);
+
+      //
       // Report that this task is being performed.
       //
       String contextName = context.name;
       if (contextName == null) {
         contextName = 'unnamed';
       }
-      AnalysisEngine.instance.instrumentationService.logAnalysisTask(
-          contextName, this);
+      AnalysisEngine.instance.instrumentationService
+          .logAnalysisTask(contextName, this);
       //
       // Gather statistics on the performance of the task.
       //
       int count = countMap[runtimeType];
       countMap[runtimeType] = count == null ? 1 : count + 1;
+//      UserTag tag = tagMap.putIfAbsent(
+//          runtimeType, () => new UserTag(runtimeType.toString()));
       Stopwatch stopwatch = stopwatchMap[runtimeType];
       if (stopwatch == null) {
         stopwatch = new Stopwatch();
         stopwatchMap[runtimeType] = stopwatch;
       }
+//      UserTag previousTag = tag.makeCurrent();
+//      try {
       stopwatch.start();
       //
       // Actually perform the task.
       //
       try {
         if (dependencyCycle != null && !handlesDependencyCycles) {
-          throw new InfiniteTaskLoopException(this, dependencyCycle);
+          throw new InfiniteTaskLoopException(
+              this, dependencyCycle, _findCyclicPath(dependencyCycle));
         }
         internalPerform();
       } finally {
         stopwatch.stop();
       }
+//      } finally {
+//        previousTag.makeCurrent();
+//      }
     } on AnalysisException {
       rethrow;
     } catch (exception, stackTrace) {
@@ -257,7 +328,7 @@
  * A description of a [List]-based analysis result that can be computed by an
  * [AnalysisTask].
  *
- * Clients are not expected to subtype this class.
+ * Clients may not extend, implement or mix-in this class.
  */
 abstract class ListResultDescriptor<E> implements ResultDescriptor<List<E>> {
   /**
@@ -266,20 +337,28 @@
    * values associated with this result will remain in the cache.
    */
   factory ListResultDescriptor(String name, List<E> defaultValue,
-      {ResultCachingPolicy<List<E>> cachingPolicy}) = ListResultDescriptorImpl<E>;
+      {ResultCachingPolicy<List<E>> cachingPolicy}) = ListResultDescriptorImpl<
+      E>;
 
   @override
-  ListTaskInput<E> of(AnalysisTarget target);
+  ListTaskInput<E> of(AnalysisTarget target, {bool flushOnAccess: false});
 }
 
 /**
  * A description of an input to an [AnalysisTask] that can be used to compute
  * that input.
  *
- * Clients are not expected to subtype this class.
+ * Clients may not extend, implement or mix-in this class.
  */
 abstract class ListTaskInput<E> extends TaskInput<List<E>> {
   /**
+   * Return a task input that can be used to compute a flatten list whose
+   * elements are combined [subListResult]'s associated with those elements.
+   */
+  ListTaskInput /*<V>*/ toFlattenListOf(
+      ListResultDescriptor /*<V>*/ subListResult);
+
+  /**
    * Return a task input that can be used to compute a list whose elements are
    * the result of passing the elements of this input to the [mapper] function.
    */
@@ -311,7 +390,7 @@
 /**
  * A description of an input with a [Map] based values.
  *
- * Clients are not expected to subtype this class.
+ * Clients may not extend, implement or mix-in this class.
  */
 abstract class MapTaskInput<K, V> extends TaskInput<Map<K, V>> {
   /**
@@ -330,6 +409,8 @@
  *
  * All the [ResultDescriptor]s with the same [ResultCachingPolicy] instance
  * share the same total size in a cache.
+ *
+ * Clients may implement this class when implementing plugins.
  */
 abstract class ResultCachingPolicy<T> {
   /**
@@ -353,7 +434,7 @@
 /**
  * A description of an analysis result that can be computed by an [AnalysisTask].
  *
- * Clients are not expected to subtype this class.
+ * Clients may not extend, implement or mix-in this class.
  */
 abstract class ResultDescriptor<V> {
   /**
@@ -384,13 +465,58 @@
 
   /**
    * Return a task input that can be used to compute this result for the given
-   * [target].
+   * [target]. If [flushOnAccess] is `true` then the value of this result that
+   * is associated with the [target] will be flushed when it is accessed.
    */
-  TaskInput<V> of(AnalysisTarget target);
+  TaskInput<V> of(AnalysisTarget target, {bool flushOnAccess: false});
+}
+
+/**
+ * A specification of the given [result] for the given [target].
+ *
+ * Clients may not extend, implement or mix-in this class.
+ */
+class TargetedResult {
+  /**
+   * An empty list of results.
+   */
+  static final List<TargetedResult> EMPTY_LIST = const <TargetedResult>[];
+
+  /**
+   * The target with which the result is associated.
+   */
+  final AnalysisTarget target;
+
+  /**
+   * The result associated with the target.
+   */
+  final ResultDescriptor result;
+
+  /**
+   * Initialize a new targeted result.
+   */
+  TargetedResult(this.target, this.result);
+
+  @override
+  int get hashCode {
+    return JenkinsSmiHash.combine(target.hashCode, result.hashCode);
+  }
+
+  @override
+  bool operator ==(other) {
+    return other is TargetedResult &&
+        other.target == target &&
+        other.result == result;
+  }
+
+  @override
+  String toString() => '$result for $target';
 }
 
 /**
  * A description of an [AnalysisTask].
+ *
+ * Clients may not extend, implement or mix-in this class.
  */
 abstract class TaskDescriptor {
   /**
@@ -399,7 +525,9 @@
    * and produces the given [results]. The [buildTask] will be used to create
    * the instance of [AnalysisTask] thusly described.
    */
-  factory TaskDescriptor(String name, BuildTask buildTask,
+  factory TaskDescriptor(
+      String name,
+      BuildTask buildTask,
       CreateTaskInputs inputBuilder,
       List<ResultDescriptor> results) = TaskDescriptorImpl;
 
@@ -430,7 +558,7 @@
  * A description of an input to an [AnalysisTask] that can be used to compute
  * that input.
  *
- * Clients are not expected to subtype this class.
+ * Clients may not extend, implement or mix-in this class.
  */
 abstract class TaskInput<V> {
   /**
@@ -458,7 +586,7 @@
  * indicating that there are no more requests, the method [inputValue] can be
  * used to access the value of the input that was built.
  *
- * Clients are not expected to subtype this class.
+ * Clients may not extend, implement or mix-in this class.
  */
 abstract class TaskInputBuilder<V> {
   /**
@@ -483,6 +611,12 @@
   void set currentValue(Object value);
 
   /**
+   * Return `true` if the value accessed by this input builder should be flushed
+   * from the cache at the time it is retrieved.
+   */
+  bool get flushOnAccess;
+
+  /**
    * Return the [value] that was computed by this builder.
    *
    * Throws a [StateError] if [moveNext] has not been invoked or if the last
@@ -514,3 +648,97 @@
    */
   bool moveNext();
 }
+
+/**
+ * [WorkManager]s are used to drive analysis.
+ *
+ * They know specific of the targets and results they care about,
+ * so they can request analysis results in optimal order.
+ *
+ * Clients may implement this class when implementing plugins.
+ */
+abstract class WorkManager {
+  /**
+   * Notifies the manager about changes in the explicit source list.
+   */
+  void applyChange(List<Source> addedSources, List<Source> changedSources,
+      List<Source> removedSources);
+
+  /**
+   * Notifies the managers that the given set of priority [targets] was set.
+   */
+  void applyPriorityTargets(List<AnalysisTarget> targets);
+
+  /**
+   * Return a list of all of the errors associated with the given [source].
+   * The list of errors will be empty if the source is not known to the context
+   * or if there are no errors in the source. The errors contained in the list
+   * can be incomplete.
+   */
+  List<AnalysisError> getErrors(Source source);
+
+  /**
+   * Return the next [TargetedResult] that this work manager wants to be
+   * computed, or `null` if this manager doesn't need any new results.
+   *
+   * Note, that it is not guaranteed that this result will be computed, it is
+   * up to the work manager to check whether the result is already computed
+   * (for example during the next [getNextResult] invocation) or computation
+   * of the same result should be requested again.
+   */
+  TargetedResult getNextResult();
+
+  /**
+   * Return the priority if the next work order this work manager want to be
+   * computed. The [AnalysisDriver] will perform the work order with
+   * the highest priority.
+   *
+   * Even if the returned value is [WorkOrderPriority.NONE], it still does not
+   * guarantee that [getNextResult] will return not `null`.
+   */
+  WorkOrderPriority getNextResultPriority();
+
+  /**
+   * Notifies the manager about analysis options changes.
+   */
+  void onAnalysisOptionsChanged();
+
+  /**
+   * Notifies the manager about [SourceFactory] changes.
+   */
+  void onSourceFactoryChanged();
+
+  /**
+   * Notifies the manager that the given [outputs] were produced for
+   * the given [target].
+   */
+  void resultsComputed(
+      AnalysisTarget target, Map<ResultDescriptor, dynamic> outputs);
+}
+
+/**
+ * The priorities of work orders returned by [WorkManager]s.
+ *
+ * New priorities may be added with time, clients need to tolerate this.
+ */
+enum WorkOrderPriority {
+  /**
+   * Responding to an user's action.
+   */
+  INTERACTIVE,
+
+  /**
+   * Computing information for priority sources.
+   */
+  PRIORITY,
+
+  /**
+   * A work should be done, but without any special urgency.
+   */
+  NORMAL,
+
+  /**
+   * Nothing to do.
+   */
+  NONE
+}
diff --git a/pkg/analyzer/pubspec.yaml b/pkg/analyzer/pubspec.yaml
index 77b064e..d30df1f 100644
--- a/pkg/analyzer/pubspec.yaml
+++ b/pkg/analyzer/pubspec.yaml
@@ -1,10 +1,10 @@
 name: analyzer
-version: 0.26.0
+version: 0.26.1+16
 author: Dart Team <misc@dartlang.org>
 description: Static analyzer for Dart.
 homepage: http://www.dartlang.org
 environment:
-  sdk: '>=1.12.0-dev.1.0 <2.0.0'
+  sdk: '>=1.12.0 <2.0.0'
 dependencies:
   args: '>=0.12.1 <0.14.0'
   glob: ^1.0.3
diff --git a/pkg/analyzer/test/cancelable_future_test.dart b/pkg/analyzer/test/cancelable_future_test.dart
index c9d88f2..b28c0f9 100644
--- a/pkg/analyzer/test/cancelable_future_test.dart
+++ b/pkg/analyzer/test/cancelable_future_test.dart
@@ -4,24 +4,293 @@
 
 library test.cancelable_future;
 
-import 'reflective_tests.dart';
-import 'package:analyzer/src/cancelable_future.dart';
 import 'dart:async';
+
+import 'package:analyzer/src/cancelable_future.dart';
 import 'package:unittest/unittest.dart';
 import 'package:watcher/src/utils.dart';
 
+import 'reflective_tests.dart';
+import 'utils.dart';
+
 void main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   runReflectiveTests(CancelableCompleterTests);
   runReflectiveTests(CancelableFutureTests);
 }
 
 @reflectiveTest
-class CancelableFutureTests {
-  Future test_defaultConstructor_returnValue() {
+class CancelableCompleterTests {
+  CancelableCompleter<Object> completer;
+  int cancelCount = 0;
+
+  void setUp() {
+    completer = new CancelableCompleter<Object>(() {
+      cancelCount++;
+    });
+  }
+
+  Future test_cancel_after_cancel() {
+    // It is permissible to cancel multiple times, but only the first
+    // cancellation has any effect.
+    expect(cancelCount, 0);
+    completer.future.cancel();
+    expect(cancelCount, 1);
+    completer.future.cancel();
+    expect(cancelCount, 1);
+    // Make sure the future still completes with error.
+    return completer.future.then((_) {
+      fail('Expected error completion');
+    }, onError: (error) {
+      expect(error, new isInstanceOf<FutureCanceledError>());
+      // And make sure nothing else happens.
+    }).then((_) => pumpEventQueue()).then((_) {
+      expect(completer.isCompleted, isFalse);
+      expect(cancelCount, 1);
+    });
+  }
+
+  Future test_cancel_after_chaining() {
+    bool callbackInvoked = false;
+    completer.future.then((_) {
+      fail('Expected error completion');
+    }, onError: (error) {
+      expect(callbackInvoked, isFalse);
+      expect(error, new isInstanceOf<FutureCanceledError>());
+      callbackInvoked = true;
+    });
+    expect(cancelCount, 0);
+    completer.future.cancel();
+    // The cancel callback should have been invoked immediately.
+    expect(cancelCount, 1);
+    // But the completer should remain in the "not completed" state.
+    expect(completer.isCompleted, isFalse);
+    // The callback should be deferred to a microtask.
+    expect(callbackInvoked, isFalse);
+    return pumpEventQueue().then((_) {
+      expect(callbackInvoked, isTrue);
+      expect(completer.isCompleted, isFalse);
+      expect(cancelCount, 1);
+    });
+  }
+
+  Future test_cancel_after_complete() {
+    Object obj = new Object();
+    completer.complete(obj);
+    completer.future.cancel();
+    // The cancel callback should not have been invoked, because it was too
+    // late to cancel.
+    expect(cancelCount, 0);
+    // Make sure the future still completes with the object.
+    return completer.future.then((result) {
+      expect(result, same(obj));
+      // And make sure nothing else happens.
+    }).then((_) => pumpEventQueue()).then((_) {
+      expect(completer.isCompleted, isTrue);
+      expect(cancelCount, 0);
+    });
+  }
+
+  Future test_cancel_before_chaining() {
+    completer.future.cancel();
+    // The cancel callback should have been invoked immediately.
+    expect(cancelCount, 1);
+    // But the completer should remain in the "not completed" state.
+    expect(completer.isCompleted, isFalse);
+    bool callbackInvoked = false;
+    completer.future.then((_) {
+      fail('Expected error completion');
+    }, onError: (error) {
+      expect(callbackInvoked, isFalse);
+      expect(error, new isInstanceOf<FutureCanceledError>());
+      callbackInvoked = true;
+    });
+    // The callback should be deferred to a microtask.
+    expect(callbackInvoked, isFalse);
+    expect(completer.isCompleted, isFalse);
+    return pumpEventQueue().then((_) {
+      expect(callbackInvoked, isTrue);
+      expect(completer.isCompleted, isFalse);
+      expect(cancelCount, 1);
+    });
+  }
+
+  Future test_complete_after_cancel() {
+    completer.future.cancel();
+    // The cancel callback should have been invoked immediately.
+    expect(cancelCount, 1);
+    // Completing should have no effect other than to set the isCompleted
+    // flag.
+    expect(completer.isCompleted, isFalse);
+    Object obj = new Object();
+    completer.complete(obj);
+    expect(completer.isCompleted, isTrue);
+    // Make sure the future still completer with error.
+    return completer.future.then((_) {
+      fail('Expected error completion');
+    }, onError: (error) {
+      expect(error, new isInstanceOf<FutureCanceledError>());
+      // And make sure nothing else happens.
+    }).then((_) => pumpEventQueue()).then((_) {
+      expect(completer.isCompleted, isTrue);
+      expect(cancelCount, 1);
+    });
+  }
+
+  Future test_complete_after_chaining() {
     Object obj = new Object();
     bool callbackInvoked = false;
-    new CancelableFuture(() => obj).then((result) {
+    completer.future.then((result) {
+      expect(callbackInvoked, isFalse);
+      expect(result, same(obj));
+      callbackInvoked = true;
+    }, onError: (error) {
+      fail('Expected successful completion');
+    });
+    expect(completer.isCompleted, isFalse);
+    // Running the event loop should have no effect since the completer hasn't
+    // been completed yet.
+    return pumpEventQueue().then((_) {
+      completer.complete(obj);
+      expect(completer.isCompleted, isTrue);
+      // The callback should be deferred to a microtask.
+      expect(callbackInvoked, isFalse);
+    }).then((_) => pumpEventQueue()).then((_) {
+      expect(callbackInvoked, isTrue);
+      expect(completer.isCompleted, isTrue);
+      expect(cancelCount, 0);
+    });
+  }
+
+  void test_complete_after_complete() {
+    // As with an ordinary Completer, calling complete() (or completeError)
+    // after calling complete() should throw an exception.
+    completer.complete();
+    expect(() {
+      completer.complete();
+    }, throws);
+    expect(() {
+      completer.completeError(new Object());
+    }, throws);
+  }
+
+  void test_complete_after_completeError() {
+    // As with an ordinary Completer, calling complete() (or completeError)
+    // after calling completeError() should throw an exception.
+    completer.completeError(new Object());
+    expect(() {
+      completer.complete();
+    }, throws);
+    expect(() {
+      completer.completeError(new Object());
+    }, throws);
+    // Now absorb the error that's in the completer's future.
+    completer.future.catchError((_) => null);
+  }
+
+  Future test_complete_before_chaining() {
+    Object obj = new Object();
+    completer.complete(obj);
+    expect(completer.isCompleted, isTrue);
+    bool callbackInvoked = false;
+    completer.future.then((result) {
+      expect(callbackInvoked, isFalse);
+      expect(result, same(obj));
+      callbackInvoked = true;
+    }, onError: (error) {
+      fail('Expected successful completion');
+    });
+    // The callback should be deferred to a microtask.
+    expect(callbackInvoked, isFalse);
+    expect(completer.isCompleted, isTrue);
+    return pumpEventQueue().then((_) {
+      expect(callbackInvoked, isTrue);
+      expect(completer.isCompleted, isTrue);
+      expect(cancelCount, 0);
+    });
+  }
+
+  Future test_completeError_after_cancel() {
+    completer.future.cancel();
+    // The cancel callback should have been invoked immediately.
+    expect(cancelCount, 1);
+    // Completing should have no effect other than to set the isCompleted
+    // flag.
+    expect(completer.isCompleted, isFalse);
+    Object obj = new Object();
+    completer.completeError(obj);
+    expect(completer.isCompleted, isTrue);
+    // Make sure the future still completes with error.
+    return completer.future.then((_) {
+      fail('Expected error completion');
+    }, onError: (error) {
+      expect(error, new isInstanceOf<FutureCanceledError>());
+      // And make sure nothing else happens.
+    }).then((_) => pumpEventQueue()).then((_) {
+      expect(completer.isCompleted, isTrue);
+      expect(cancelCount, 1);
+    });
+  }
+
+  Future test_completeError_after_chaining() {
+    Object obj = new Object();
+    bool callbackInvoked = false;
+    completer.future.then((_) {
+      fail('Expected error completion');
+    }, onError: (error) {
+      expect(callbackInvoked, isFalse);
+      expect(error, same(obj));
+      callbackInvoked = true;
+    });
+    expect(completer.isCompleted, isFalse);
+    // Running the event loop should have no effect since the completer hasn't
+    // been completed yet.
+    return pumpEventQueue().then((_) {
+      completer.completeError(obj);
+      expect(completer.isCompleted, isTrue);
+      // The callback should be deferred to a microtask.
+      expect(callbackInvoked, isFalse);
+    }).then((_) => pumpEventQueue()).then((_) {
+      expect(callbackInvoked, isTrue);
+      expect(completer.isCompleted, isTrue);
+      expect(cancelCount, 0);
+    });
+  }
+
+  Future test_completeError_before_chaining() {
+    Object obj = new Object();
+    completer.completeError(obj);
+    expect(completer.isCompleted, isTrue);
+    bool callbackInvoked = false;
+    completer.future.then((_) {
+      fail('Expected error completion');
+    }, onError: (error) {
+      expect(callbackInvoked, isFalse);
+      expect(error, same(obj));
+      callbackInvoked = true;
+    });
+    // The callback should be deferred to a microtask.
+    expect(callbackInvoked, isFalse);
+    expect(completer.isCompleted, isTrue);
+    return pumpEventQueue().then((_) {
+      expect(callbackInvoked, isTrue);
+      expect(completer.isCompleted, isTrue);
+      expect(cancelCount, 0);
+    });
+  }
+
+  void test_initialState() {
+    expect(completer.isCompleted, isFalse);
+    expect(cancelCount, 0);
+  }
+}
+
+@reflectiveTest
+class CancelableFutureTests {
+  Future test_defaultConstructor_returnFuture() {
+    Object obj = new Object();
+    bool callbackInvoked = false;
+    new CancelableFuture(() => new Future(() => obj)).then((result) {
       expect(callbackInvoked, isFalse);
       expect(result, same(obj));
       callbackInvoked = true;
@@ -34,10 +303,10 @@
     });
   }
 
-  Future test_defaultConstructor_returnFuture() {
+  Future test_defaultConstructor_returnValue() {
     Object obj = new Object();
     bool callbackInvoked = false;
-    new CancelableFuture(() => new Future(() => obj)).then((result) {
+    new CancelableFuture(() => obj).then((result) {
       expect(callbackInvoked, isFalse);
       expect(result, same(obj));
       callbackInvoked = true;
@@ -70,8 +339,8 @@
 
   Future test_delayed_noCallback() {
     DateTime start = new DateTime.now();
-    return new CancelableFuture.delayed(new Duration(seconds: 1)).then(
-        (result) {
+    return new CancelableFuture.delayed(new Duration(seconds: 1))
+        .then((result) {
       DateTime end = new DateTime.now();
       expect(result, isNull);
       expect(end.difference(start).inMilliseconds > 900, isTrue);
@@ -140,269 +409,3 @@
     });
   }
 }
-
-@reflectiveTest
-class CancelableCompleterTests {
-  CancelableCompleter<Object> completer;
-  int cancelCount = 0;
-
-  void setUp() {
-    completer = new CancelableCompleter<Object>(() {
-      cancelCount++;
-    });
-  }
-
-  void test_initialState() {
-    expect(completer.isCompleted, isFalse);
-    expect(cancelCount, 0);
-  }
-
-  void test_complete_after_complete() {
-    // As with an ordinary Completer, calling complete() (or completeError)
-    // after calling complete() should throw an exception.
-    completer.complete();
-    expect(() {
-      completer.complete();
-    }, throws);
-    expect(() {
-      completer.completeError(new Object());
-    }, throws);
-  }
-
-  void test_complete_after_completeError() {
-    // As with an ordinary Completer, calling complete() (or completeError)
-    // after calling completeError() should throw an exception.
-    completer.completeError(new Object());
-    expect(() {
-      completer.complete();
-    }, throws);
-    expect(() {
-      completer.completeError(new Object());
-    }, throws);
-    // Now absorb the error that's in the completer's future.
-    completer.future.catchError((_) => null);
-  }
-
-  Future test_complete_before_chaining() {
-    Object obj = new Object();
-    completer.complete(obj);
-    expect(completer.isCompleted, isTrue);
-    bool callbackInvoked = false;
-    completer.future.then((result) {
-      expect(callbackInvoked, isFalse);
-      expect(result, same(obj));
-      callbackInvoked = true;
-    }, onError: (error) {
-      fail('Expected successful completion');
-    });
-    // The callback should be deferred to a microtask.
-    expect(callbackInvoked, isFalse);
-    expect(completer.isCompleted, isTrue);
-    return pumpEventQueue().then((_) {
-      expect(callbackInvoked, isTrue);
-      expect(completer.isCompleted, isTrue);
-      expect(cancelCount, 0);
-    });
-  }
-
-  Future test_completeError_before_chaining() {
-    Object obj = new Object();
-    completer.completeError(obj);
-    expect(completer.isCompleted, isTrue);
-    bool callbackInvoked = false;
-    completer.future.then((_) {
-      fail('Expected error completion');
-    }, onError: (error) {
-      expect(callbackInvoked, isFalse);
-      expect(error, same(obj));
-      callbackInvoked = true;
-    });
-    // The callback should be deferred to a microtask.
-    expect(callbackInvoked, isFalse);
-    expect(completer.isCompleted, isTrue);
-    return pumpEventQueue().then((_) {
-      expect(callbackInvoked, isTrue);
-      expect(completer.isCompleted, isTrue);
-      expect(cancelCount, 0);
-    });
-  }
-
-  Future test_complete_after_chaining() {
-    Object obj = new Object();
-    bool callbackInvoked = false;
-    completer.future.then((result) {
-      expect(callbackInvoked, isFalse);
-      expect(result, same(obj));
-      callbackInvoked = true;
-    }, onError: (error) {
-      fail('Expected successful completion');
-    });
-    expect(completer.isCompleted, isFalse);
-    // Running the event loop should have no effect since the completer hasn't
-    // been completed yet.
-    return pumpEventQueue().then((_) {
-      completer.complete(obj);
-      expect(completer.isCompleted, isTrue);
-      // The callback should be deferred to a microtask.
-      expect(callbackInvoked, isFalse);
-    }).then((_) => pumpEventQueue()).then((_) {
-      expect(callbackInvoked, isTrue);
-      expect(completer.isCompleted, isTrue);
-      expect(cancelCount, 0);
-    });
-  }
-
-  Future test_completeError_after_chaining() {
-    Object obj = new Object();
-    bool callbackInvoked = false;
-    completer.future.then((_) {
-      fail('Expected error completion');
-    }, onError: (error) {
-      expect(callbackInvoked, isFalse);
-      expect(error, same(obj));
-      callbackInvoked = true;
-    });
-    expect(completer.isCompleted, isFalse);
-    // Running the event loop should have no effect since the completer hasn't
-    // been completed yet.
-    return pumpEventQueue().then((_) {
-      completer.completeError(obj);
-      expect(completer.isCompleted, isTrue);
-      // The callback should be deferred to a microtask.
-      expect(callbackInvoked, isFalse);
-    }).then((_) => pumpEventQueue()).then((_) {
-      expect(callbackInvoked, isTrue);
-      expect(completer.isCompleted, isTrue);
-      expect(cancelCount, 0);
-    });
-  }
-
-  Future test_cancel_before_chaining() {
-    completer.future.cancel();
-    // The cancel callback should have been invoked immediately.
-    expect(cancelCount, 1);
-    // But the completer should remain in the "not completed" state.
-    expect(completer.isCompleted, isFalse);
-    bool callbackInvoked = false;
-    completer.future.then((_) {
-      fail('Expected error completion');
-    }, onError: (error) {
-      expect(callbackInvoked, isFalse);
-      expect(error, new isInstanceOf<FutureCanceledError>());
-      callbackInvoked = true;
-    });
-    // The callback should be deferred to a microtask.
-    expect(callbackInvoked, isFalse);
-    expect(completer.isCompleted, isFalse);
-    return pumpEventQueue().then((_) {
-      expect(callbackInvoked, isTrue);
-      expect(completer.isCompleted, isFalse);
-      expect(cancelCount, 1);
-    });
-  }
-
-  Future test_cancel_after_chaining() {
-    bool callbackInvoked = false;
-    completer.future.then((_) {
-      fail('Expected error completion');
-    }, onError: (error) {
-      expect(callbackInvoked, isFalse);
-      expect(error, new isInstanceOf<FutureCanceledError>());
-      callbackInvoked = true;
-    });
-    expect(cancelCount, 0);
-    completer.future.cancel();
-    // The cancel callback should have been invoked immediately.
-    expect(cancelCount, 1);
-    // But the completer should remain in the "not completed" state.
-    expect(completer.isCompleted, isFalse);
-    // The callback should be deferred to a microtask.
-    expect(callbackInvoked, isFalse);
-    return pumpEventQueue().then((_) {
-      expect(callbackInvoked, isTrue);
-      expect(completer.isCompleted, isFalse);
-      expect(cancelCount, 1);
-    });
-  }
-
-  Future test_cancel_after_complete() {
-    Object obj = new Object();
-    completer.complete(obj);
-    completer.future.cancel();
-    // The cancel callback should not have been invoked, because it was too
-    // late to cancel.
-    expect(cancelCount, 0);
-    // Make sure the future still completes with the object.
-    return completer.future.then((result) {
-      expect(result, same(obj));
-      // And make sure nothing else happens.
-    }).then((_) => pumpEventQueue()).then((_) {
-      expect(completer.isCompleted, isTrue);
-      expect(cancelCount, 0);
-    });
-  }
-
-  Future test_complete_after_cancel() {
-    completer.future.cancel();
-    // The cancel callback should have been invoked immediately.
-    expect(cancelCount, 1);
-    // Completing should have no effect other than to set the isCompleted
-    // flag.
-    expect(completer.isCompleted, isFalse);
-    Object obj = new Object();
-    completer.complete(obj);
-    expect(completer.isCompleted, isTrue);
-    // Make sure the future still completer with error.
-    return completer.future.then((_) {
-      fail('Expected error completion');
-    }, onError: (error) {
-      expect(error, new isInstanceOf<FutureCanceledError>());
-      // And make sure nothing else happens.
-    }).then((_) => pumpEventQueue()).then((_) {
-      expect(completer.isCompleted, isTrue);
-      expect(cancelCount, 1);
-    });
-  }
-
-  Future test_completeError_after_cancel() {
-    completer.future.cancel();
-    // The cancel callback should have been invoked immediately.
-    expect(cancelCount, 1);
-    // Completing should have no effect other than to set the isCompleted
-    // flag.
-    expect(completer.isCompleted, isFalse);
-    Object obj = new Object();
-    completer.completeError(obj);
-    expect(completer.isCompleted, isTrue);
-    // Make sure the future still completes with error.
-    return completer.future.then((_) {
-      fail('Expected error completion');
-    }, onError: (error) {
-      expect(error, new isInstanceOf<FutureCanceledError>());
-      // And make sure nothing else happens.
-    }).then((_) => pumpEventQueue()).then((_) {
-      expect(completer.isCompleted, isTrue);
-      expect(cancelCount, 1);
-    });
-  }
-
-  Future test_cancel_after_cancel() {
-    // It is permissible to cancel multiple times, but only the first
-    // cancellation has any effect.
-    expect(cancelCount, 0);
-    completer.future.cancel();
-    expect(cancelCount, 1);
-    completer.future.cancel();
-    expect(cancelCount, 1);
-    // Make sure the future still completes with error.
-    return completer.future.then((_) {
-      fail('Expected error completion');
-    }, onError: (error) {
-      expect(error, new isInstanceOf<FutureCanceledError>());
-      // And make sure nothing else happens.
-    }).then((_) => pumpEventQueue()).then((_) {
-      expect(completer.isCompleted, isFalse);
-      expect(cancelCount, 1);
-    });
-  }
-}
diff --git a/pkg/analyzer/test/enum_test.dart b/pkg/analyzer/test/enum_test.dart
index 854f217b..706737f 100644
--- a/pkg/analyzer/test/enum_test.dart
+++ b/pkg/analyzer/test/enum_test.dart
@@ -18,9 +18,10 @@
 
 import 'generated/ast_test.dart';
 import 'reflective_tests.dart';
+import 'utils.dart';
 
 void main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   runReflectiveTests(EnumTest);
 }
 
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 8b072fe..d0d3e55 100644
--- a/pkg/analyzer/test/file_system/memory_file_system_test.dart
+++ b/pkg/analyzer/test/file_system/memory_file_system_test.dart
@@ -16,9 +16,10 @@
 import 'package:watcher/watcher.dart';
 
 import '../reflective_tests.dart';
+import '../utils.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   runReflectiveTests(FileSystemExceptionTest);
   runReflectiveTests(FileTest);
   runReflectiveTests(FolderTest);
@@ -338,6 +339,13 @@
     expect(relative.path, '/foo/bar/baz.dart');
   }
 
+  void test_resolveRelative_dart() {
+    File file = provider.newFile('/sdk/lib/core/core.dart', '');
+    Source source = file.createSource(Uri.parse('dart:core'));
+    Uri resolved = source.resolveRelativeUri(Uri.parse('int.dart'));
+    expect(resolved.toString(), 'dart:core/int.dart');
+  }
+
   void test_shortName() {
     expect(source.shortName, 'test.dart');
   }
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 7898bb9..87d976a 100644
--- a/pkg/analyzer/test/file_system/physical_resource_provider_test.dart
+++ b/pkg/analyzer/test/file_system/physical_resource_provider_test.dart
@@ -16,9 +16,10 @@
 import 'package:watcher/watcher.dart';
 
 import '../reflective_tests.dart';
+import '../utils.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   runReflectiveTests(PhysicalResourceProviderTest);
   runReflectiveTests(FileTest);
   runReflectiveTests(FolderTest);
@@ -297,10 +298,12 @@
       return _delayed(() {
         expect(changesReceived, hasLength(1));
         if (io.Platform.isWindows) {
-          // TODO(danrubel) https://github.com/dart-lang/sdk/issues/23762
-          // This test fails on Windows but a similar test in the underlying
-          // watcher package passes on Windows.
-          expect(changesReceived[0].type, equals(ChangeType.MODIFY));
+          // See https://github.com/dart-lang/sdk/issues/23762
+          // Not sure why this breaks under Windows, but testing to see whether
+          // we are running Windows causes the type to change. For now we print
+          // the type out of curriosity.
+          print(
+              'PhysicalResourceProviderTest:test_watchFile_delete received an event with type = ${changesReceived[0].type}');
         } else {
           expect(changesReceived[0].type, equals(ChangeType.REMOVE));
         }
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 b888c56..8d91d24 100644
--- a/pkg/analyzer/test/file_system/resource_uri_resolver_test.dart
+++ b/pkg/analyzer/test/file_system/resource_uri_resolver_test.dart
@@ -10,9 +10,10 @@
 import 'package:unittest/unittest.dart';
 
 import '../reflective_tests.dart';
+import '../utils.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   runReflectiveTests(ResourceUriResolverTest);
 }
 
@@ -53,5 +54,9 @@
     Source source = resolver.resolveAbsolute(uri);
     expect(source, isNotNull);
     expect(resolver.restoreAbsolute(source), uri);
+    expect(
+        resolver.restoreAbsolute(
+            new NonExistingSource(source.fullName, null, null)),
+        uri);
   }
 }
diff --git a/pkg/analyzer/test/file_system/test_all.dart b/pkg/analyzer/test/file_system/test_all.dart
index 3bacc6c..303df09 100644
--- a/pkg/analyzer/test/file_system/test_all.dart
+++ b/pkg/analyzer/test/file_system/test_all.dart
@@ -6,6 +6,7 @@
 
 import 'package:unittest/unittest.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;
@@ -13,7 +14,7 @@
 
 /// Utility for manually running all tests.
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   group('file_system', () {
     memory_file_system_test.main();
     physical_resource_provider_test.main();
diff --git a/pkg/analyzer/test/generated/all_the_rest_test.dart b/pkg/analyzer/test/generated/all_the_rest_test.dart
index 1b13295..dc07ef9 100644
--- a/pkg/analyzer/test/generated/all_the_rest_test.dart
+++ b/pkg/analyzer/test/generated/all_the_rest_test.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.
 
-// This code was auto-generated, is not intended to be edited, and is subject to
-// significant change. Please see the README file for more information.
-
 library engine.all_the_rest_test;
 
 import 'package:analyzer/file_system/physical_file_system.dart';
@@ -33,16 +30,18 @@
 import 'package:analyzer/src/generated/utilities_dart.dart';
 import 'package:analyzer/src/task/dart.dart';
 import 'package:path/path.dart';
+import 'package:source_span/source_span.dart';
 import 'package:unittest/unittest.dart';
 
 import '../reflective_tests.dart';
+import '../utils.dart';
 import 'engine_test.dart';
 import 'parser_test.dart';
 import 'resolver_test.dart';
 import 'test_support.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   runReflectiveTests(ConstantEvaluatorTest);
   runReflectiveTests(ConstantFinderTest);
   runReflectiveTests(ConstantValueComputerTest);
@@ -103,21 +102,13 @@
   }
 
   void test_tokenize_declaration() {
-    _tokenize("<! foo ><html>", <Object>[
-      "<! foo >",
-      ht.TokenType.LT,
-      "html",
-      ht.TokenType.GT
-    ]);
+    _tokenize("<! foo ><html>",
+        <Object>["<! foo >", ht.TokenType.LT, "html", ht.TokenType.GT]);
   }
 
   void test_tokenize_declaration_malformed() {
-    _tokenize("<! foo /><html>", <Object>[
-      "<! foo />",
-      ht.TokenType.LT,
-      "html",
-      ht.TokenType.GT
-    ]);
+    _tokenize("<! foo /><html>",
+        <Object>["<! foo />", ht.TokenType.LT, "html", ht.TokenType.GT]);
   }
 
   void test_tokenize_directive_incomplete() {
@@ -178,30 +169,18 @@
   }
 
   void test_tokenize_script_partial() {
-    _tokenize("<script> <p> ", <Object>[
-      ht.TokenType.LT,
-      "script",
-      ht.TokenType.GT,
-      " <p> "
-    ]);
+    _tokenize("<script> <p> ",
+        <Object>[ht.TokenType.LT, "script", ht.TokenType.GT, " <p> "]);
   }
 
   void test_tokenize_script_partial2() {
-    _tokenize("<script> <p> <", <Object>[
-      ht.TokenType.LT,
-      "script",
-      ht.TokenType.GT,
-      " <p> <"
-    ]);
+    _tokenize("<script> <p> <",
+        <Object>[ht.TokenType.LT, "script", ht.TokenType.GT, " <p> <"]);
   }
 
   void test_tokenize_script_partial3() {
-    _tokenize("<script> <p> </", <Object>[
-      ht.TokenType.LT,
-      "script",
-      ht.TokenType.GT,
-      " <p> </"
-    ]);
+    _tokenize("<script> <p> </",
+        <Object>[ht.TokenType.LT, "script", ht.TokenType.GT, " <p> </"]);
   }
 
   void test_tokenize_script_ref() {
@@ -228,7 +207,10 @@
       ht.TokenType.LT_SLASH,
       "script",
       ht.TokenType.GT
-    ], <int>[0, 13]);
+    ], <int>[
+      0,
+      13
+    ]);
   }
 
   void test_tokenize_spaces_and_newlines() {
@@ -257,7 +239,16 @@
       "html",
       ht.TokenType.GT,
       " "
-    ], <int>[0, 9, 21, 25, 28, 38, 49]);
+    ],
+        <int>[
+      0,
+      9,
+      21,
+      25,
+      28,
+      38,
+      49
+    ]);
     token = token.next;
     expect(token.offset, 1);
     token = token.next;
@@ -278,13 +269,8 @@
   }
 
   void test_tokenize_string_partial() {
-    _tokenize("<p bob=\"foo", <Object>[
-      ht.TokenType.LT,
-      "p",
-      "bob",
-      ht.TokenType.EQ,
-      "\"foo"
-    ]);
+    _tokenize("<p bob=\"foo",
+        <Object>[ht.TokenType.LT, "p", "bob", ht.TokenType.EQ, "\"foo"]);
   }
 
   void test_tokenize_string_single_quote() {
@@ -299,13 +285,8 @@
   }
 
   void test_tokenize_string_single_quote_partial() {
-    _tokenize("<p bob='foo", <Object>[
-      ht.TokenType.LT,
-      "p",
-      "bob",
-      ht.TokenType.EQ,
-      "'foo"
-    ]);
+    _tokenize("<p bob='foo",
+        <Object>[ht.TokenType.LT, "p", "bob", ht.TokenType.EQ, "'foo"]);
   }
 
   void test_tokenize_tag_begin_end() {
@@ -629,12 +610,13 @@
     expect(result.isValid, isTrue);
     DartObject value = result.value;
     expect(value.type.name, "double");
-    expect(value.doubleValue.isInfinite, isTrue);
+    expect(value.toDoubleValue().isInfinite, isTrue);
   }
 
   void test_divide_int_int() {
     _assertValue2(1.5, "3 / 2");
   }
+
   void test_divide_int_int_byZero() {
     EvaluationResult result = _getExpressionValue("3 / 0");
     expect(result.isValid, isTrue);
@@ -685,6 +667,7 @@
   void test_literal_boolean_false() {
     _assertValue(false, "false");
   }
+
   void test_literal_boolean_true() {
     _assertValue(true, "true");
   }
@@ -843,7 +826,7 @@
     EvaluationResult result = _getExpressionValue(contents);
     DartObject value = result.value;
     expect(value.type.name, "bool");
-    expect(value.boolValue, expectedValue);
+    expect(value.toBoolValue(), expectedValue);
   }
 
   void _assertValue2(double expectedValue, String contents) {
@@ -851,7 +834,7 @@
     expect(result.isValid, isTrue);
     DartObject value = result.value;
     expect(value.type.name, "double");
-    expect(value.doubleValue, expectedValue);
+    expect(value.toDoubleValue(), expectedValue);
   }
 
   void _assertValue3(int expectedValue, String contents) {
@@ -859,7 +842,7 @@
     expect(result.isValid, isTrue);
     DartObject value = result.value;
     expect(value.type.name, "int");
-    expect(value.intValue, expectedValue);
+    expect(value.toIntValue(), expectedValue);
   }
 
   void _assertValue4(String expectedValue, String contents) {
@@ -869,7 +852,7 @@
     ParameterizedType type = value.type;
     expect(type, isNotNull);
     expect(type.name, "String");
-    expect(value.stringValue, expectedValue);
+    expect(value.toStringValue(), expectedValue);
   }
 
   EvaluationResult _getExpressionValue(String contents) {
@@ -886,8 +869,9 @@
     NodeList<VariableDeclaration> variables =
         (declaration as TopLevelVariableDeclaration).variables.variables;
     expect(variables, hasLength(1));
-    ConstantEvaluator evaluator =
-        new ConstantEvaluator(source, analysisContext.typeProvider);
+    ConstantEvaluator evaluator = new ConstantEvaluator(
+        source, analysisContext.typeProvider,
+        typeSystem: analysisContext.typeSystem);
     return evaluator.evaluate(variables[0].initializer);
   }
 }
@@ -902,7 +886,7 @@
   void setUp() {
     super.setUp();
     _typeProvider = new TestTypeProvider();
-    _context = new TestAnalysisContext();
+    _context = new TestAnalysisContext_ConstantFinderTest();
     _source = new TestSource();
   }
 
@@ -1019,8 +1003,13 @@
   ConstructorElement _setupConstructorDeclaration(String name, bool isConst) {
     Keyword constKeyword = isConst ? Keyword.CONST : null;
     ConstructorDeclaration constructorDeclaration = AstFactory
-        .constructorDeclaration2(constKeyword, null, null, name,
-            AstFactory.formalParameterList(), null,
+        .constructorDeclaration2(
+            constKeyword,
+            null,
+            null,
+            name,
+            AstFactory.formalParameterList(),
+            null,
             AstFactory.blockFunctionBody2());
     ClassElement classElement = ElementFactory.classElement2(name);
     ConstructorElement element =
@@ -1032,13 +1021,17 @@
 
   VariableDeclaration _setupFieldDeclaration(
       String className, String fieldName, Keyword keyword,
-      {bool isInitialized: true, bool isStatic: false,
+      {bool isInitialized: true,
+      bool isStatic: false,
       bool hasConstConstructor: false}) {
     VariableDeclaration variableDeclaration = isInitialized
         ? AstFactory.variableDeclaration2(fieldName, AstFactory.integer(0))
         : AstFactory.variableDeclaration(fieldName);
-    VariableElement fieldElement = ElementFactory.fieldElement(fieldName,
-        isStatic, keyword == Keyword.FINAL, keyword == Keyword.CONST,
+    VariableElement fieldElement = ElementFactory.fieldElement(
+        fieldName,
+        isStatic,
+        keyword == Keyword.FINAL,
+        keyword == Keyword.CONST,
         _typeProvider.intType);
     variableDeclaration.name.staticElement = fieldElement;
     FieldDeclaration fieldDeclaration = AstFactory.fieldDeclaration2(
@@ -1052,9 +1045,13 @@
     classDeclaration.name.staticElement = classElement;
     if (hasConstConstructor) {
       ConstructorDeclaration constructorDeclaration = AstFactory
-          .constructorDeclaration2(Keyword.CONST, null,
-              AstFactory.identifier3(className), null,
-              AstFactory.formalParameterList(), null,
+          .constructorDeclaration2(
+              Keyword.CONST,
+              null,
+              AstFactory.identifier3(className),
+              null,
+              AstFactory.formalParameterList(),
+              null,
               AstFactory.blockFunctionBody2());
       classDeclaration.members.add(constructorDeclaration);
       ConstructorElement constructorElement =
@@ -1068,7 +1065,8 @@
   }
 
   VariableElement _setupVariableDeclaration(
-      String name, bool isConst, bool isInitialized, {isFinal: false}) {
+      String name, bool isConst, bool isInitialized,
+      {isFinal: false}) {
     VariableDeclaration variableDeclaration = isInitialized
         ? AstFactory.variableDeclaration2(name, AstFactory.integer(0))
         : AstFactory.variableDeclaration(name);
@@ -1302,12 +1300,16 @@
   }
 
   void test_computeValues_multipleSources() {
-    Source librarySource = addNamedSource("/lib.dart", r'''
+    Source librarySource = addNamedSource(
+        "/lib.dart",
+        r'''
 library lib;
 part 'part.dart';
 const int c = b;
 const int a = 0;''');
-    Source partSource = addNamedSource("/part.dart", r'''
+    Source partSource = addNamedSource(
+        "/part.dart",
+        r'''
 part of lib;
 const int b = a;
 const int d = c;''');
@@ -1387,7 +1389,8 @@
 
   void test_dependencyOnConstructorArgument_unresolvedConstructor() {
     // "const A.a(x)" depends on x even if the constructor A.a can't be found.
-    _assertProperDependencies(r'''
+    _assertProperDependencies(
+        r'''
 class A {
 }
 const int x = 1;
@@ -1484,13 +1487,15 @@
     // Even though non-static consts are not allowed by the language, we need
     // to handle them for error recovery purposes.
     // a depends on A() depends on A.x
-    _assertProperDependencies('''
+    _assertProperDependencies(
+        '''
 class A {
   const A();
   const int x = 1;
 }
 const A a = const A();
-''', [CompileTimeErrorCode.CONST_INSTANCE_FIELD]);
+''',
+        [CompileTimeErrorCode.CONST_INSTANCE_FIELD]);
   }
 
   void test_dependencyOnNonFactoryRedirect() {
@@ -1530,11 +1535,13 @@
   void test_dependencyOnNonFactoryRedirect_toMissing() {
     // a depends on A.foo() which depends on nothing, since A.bar() is
     // missing.
-    _assertProperDependencies(r'''
+    _assertProperDependencies(
+        r'''
 const A a = const A.foo();
 class A {
   const A.foo() : this.bar();
-}''', [CompileTimeErrorCode.REDIRECT_GENERATIVE_TO_MISSING_CONSTRUCTOR]);
+}''',
+        [CompileTimeErrorCode.REDIRECT_GENERATIVE_TO_MISSING_CONSTRUCTOR]);
   }
 
   void test_dependencyOnNonFactoryRedirect_toNonConst() {
@@ -2147,7 +2154,8 @@
   }
 
   Map<String, DartObjectImpl> _assertFieldType(
-      Map<String, DartObjectImpl> fields, String fieldName,
+      Map<String, DartObjectImpl> fields,
+      String fieldName,
       String expectedType) {
     DartObjectImpl field = fields[fieldName];
     expect(field.type.displayName, expectedType);
@@ -2158,7 +2166,7 @@
       Map<String, DartObjectImpl> fields, String fieldName, int expectedValue) {
     DartObjectImpl field = fields[fieldName];
     expect(field.type.name, "int");
-    expect(field.intValue, expectedValue);
+    expect(field.toIntValue(), expectedValue);
   }
 
   void _assertNullField(Map<String, DartObjectImpl> fields, String fieldName) {
@@ -2191,7 +2199,7 @@
     expect(result.value, isNotNull);
     DartObjectImpl value = result.value;
     expect(value.type, typeProvider.boolType);
-    bool boolValue = value.boolValue;
+    bool boolValue = value.toBoolValue();
     expect(boolValue, isNotNull);
     return boolValue;
   }
@@ -2200,7 +2208,7 @@
     expect(result.value, isNotNull);
     DartObjectImpl value = result.value;
     expect(value.type, typeProvider.intType);
-    return value.intValue;
+    return value.toIntValue();
   }
 
   void _assertValidNull(EvaluationResultImpl result) {
@@ -2352,9 +2360,12 @@
   ConstantValueComputer _makeConstantValueComputer() {
     ConstantEvaluationValidator_ForTest validator =
         new ConstantEvaluationValidator_ForTest();
-    validator.computer = new ConstantValueComputer(analysisContext2,
-        analysisContext2.typeProvider, analysisContext2.declaredVariables,
-        validator);
+    validator.computer = new ConstantValueComputer(
+        analysisContext2,
+        analysisContext2.typeProvider,
+        analysisContext2.declaredVariables,
+        validator,
+        analysisContext2.typeSystem);
     return validator.computer;
   }
 
@@ -2382,9 +2393,13 @@
     GatheringErrorListener errorListener = new GatheringErrorListener();
     ErrorReporter errorReporter =
         new ErrorReporter(errorListener, _dummySource());
-    _assertValue(0, expression.accept(new ConstantVisitor(
-        new ConstantEvaluationEngine(
-            new TestTypeProvider(), new DeclaredVariables()), errorReporter)));
+    _assertValue(
+        0,
+        expression.accept(new ConstantVisitor(
+            new ConstantEvaluationEngine(
+                new TestTypeProvider(), new DeclaredVariables(),
+                typeSystem: new TypeSystemImpl()),
+            errorReporter)));
     errorListener.assertNoErrors();
   }
 
@@ -2399,7 +2414,9 @@
         new ErrorReporter(errorListener, _dummySource());
     DartObjectImpl result = expression.accept(new ConstantVisitor(
         new ConstantEvaluationEngine(
-            new TestTypeProvider(), new DeclaredVariables()), errorReporter));
+            new TestTypeProvider(), new DeclaredVariables(),
+            typeSystem: new TypeSystemImpl()),
+        errorReporter));
     expect(result, isNull);
     errorListener
         .assertErrorsWithCodes([CompileTimeErrorCode.CONST_EVAL_TYPE_BOOL]);
@@ -2415,7 +2432,9 @@
         new ErrorReporter(errorListener, _dummySource());
     DartObjectImpl result = expression.accept(new ConstantVisitor(
         new ConstantEvaluationEngine(
-            new TestTypeProvider(), new DeclaredVariables()), errorReporter));
+            new TestTypeProvider(), new DeclaredVariables(),
+            typeSystem: new TypeSystemImpl()),
+        errorReporter));
     expect(result, isNull);
     errorListener
         .assertErrorsWithCodes([CompileTimeErrorCode.INVALID_CONSTANT]);
@@ -2431,7 +2450,9 @@
         new ErrorReporter(errorListener, _dummySource());
     DartObjectImpl result = expression.accept(new ConstantVisitor(
         new ConstantEvaluationEngine(
-            new TestTypeProvider(), new DeclaredVariables()), errorReporter));
+            new TestTypeProvider(), new DeclaredVariables(),
+            typeSystem: new TypeSystemImpl()),
+        errorReporter));
     expect(result, isNull);
     errorListener
         .assertErrorsWithCodes([CompileTimeErrorCode.INVALID_CONSTANT]);
@@ -2445,9 +2466,13 @@
     GatheringErrorListener errorListener = new GatheringErrorListener();
     ErrorReporter errorReporter =
         new ErrorReporter(errorListener, _dummySource());
-    _assertValue(1, expression.accept(new ConstantVisitor(
-        new ConstantEvaluationEngine(
-            new TestTypeProvider(), new DeclaredVariables()), errorReporter)));
+    _assertValue(
+        1,
+        expression.accept(new ConstantVisitor(
+            new ConstantEvaluationEngine(
+                new TestTypeProvider(), new DeclaredVariables(),
+                typeSystem: new TypeSystemImpl()),
+            errorReporter)));
     errorListener.assertNoErrors();
   }
 
@@ -2503,7 +2528,7 @@
   void _assertValue(int expectedValue, DartObjectImpl result) {
     expect(result, isNotNull);
     expect(result.type.name, "int");
-    expect(result.intValue, expectedValue);
+    expect(result.toIntValue(), expectedValue);
   }
 
   NonExistingSource _dummySource() {
@@ -2519,8 +2544,10 @@
     GatheringErrorListener errorListener = new GatheringErrorListener();
     ErrorReporter errorReporter = new ErrorReporter(errorListener, source);
     DartObjectImpl result = expression.accept(new ConstantVisitor(
-        new ConstantEvaluationEngine(typeProvider, new DeclaredVariables()),
-        errorReporter, lexicalEnvironment: lexicalEnvironment));
+        new ConstantEvaluationEngine(typeProvider, new DeclaredVariables(),
+            typeSystem: typeSystem),
+        errorReporter,
+        lexicalEnvironment: lexicalEnvironment));
     errorListener.assertNoErrors();
     return result;
   }
@@ -2641,6 +2668,7 @@
   void test_add_unknownString_unknownString() {
     _assertAdd(_stringValue(null), _stringValue(null), _stringValue(null));
   }
+
   void test_bitAnd_knownInt_knownInt() {
     _assertBitAnd(_intValue(2), _intValue(6), _intValue(3));
   }
@@ -2872,8 +2900,10 @@
   }
 
   void test_equals_list_false_differentSizes() {
-    expect(_listValue([_boolValue(true)]) ==
-        _listValue([_boolValue(true), _boolValue(false)]), isFalse);
+    expect(
+        _listValue([_boolValue(true)]) ==
+            _listValue([_boolValue(true), _boolValue(false)]),
+        isFalse);
   }
 
   void test_equals_list_false_sameSize() {
@@ -3111,84 +3141,84 @@
     _assertGreaterThanOrEqual(_boolValue(null), _intValue(null), _intValue(2));
   }
 
-  void test_hasExactValue_bool_false() {
-    expect(_boolValue(false).hasExactValue, isTrue);
+  void test_hasKnownValue_bool_false() {
+    expect(_boolValue(false).hasKnownValue, isTrue);
   }
 
-  void test_hasExactValue_bool_true() {
-    expect(_boolValue(true).hasExactValue, isTrue);
+  void test_hasKnownValue_bool_true() {
+    expect(_boolValue(true).hasKnownValue, isTrue);
   }
 
-  void test_hasExactValue_bool_unknown() {
-    expect(_boolValue(null).hasExactValue, isTrue);
+  void test_hasKnownValue_bool_unknown() {
+    expect(_boolValue(null).hasKnownValue, isFalse);
   }
 
-  void test_hasExactValue_double_known() {
-    expect(_doubleValue(2.3).hasExactValue, isTrue);
+  void test_hasKnownValue_double_known() {
+    expect(_doubleValue(2.3).hasKnownValue, isTrue);
   }
 
-  void test_hasExactValue_double_unknown() {
-    expect(_doubleValue(null).hasExactValue, isTrue);
+  void test_hasKnownValue_double_unknown() {
+    expect(_doubleValue(null).hasKnownValue, isFalse);
   }
 
-  void test_hasExactValue_dynamic() {
-    expect(_dynamicValue().hasExactValue, isFalse);
+  void test_hasKnownValue_dynamic() {
+    expect(_dynamicValue().hasKnownValue, isTrue);
   }
 
-  void test_hasExactValue_int_known() {
-    expect(_intValue(23).hasExactValue, isTrue);
+  void test_hasKnownValue_int_known() {
+    expect(_intValue(23).hasKnownValue, isTrue);
   }
 
-  void test_hasExactValue_int_unknown() {
-    expect(_intValue(null).hasExactValue, isTrue);
+  void test_hasKnownValue_int_unknown() {
+    expect(_intValue(null).hasKnownValue, isFalse);
   }
 
-  void test_hasExactValue_list_empty() {
-    expect(_listValue().hasExactValue, isTrue);
+  void test_hasKnownValue_list_empty() {
+    expect(_listValue().hasKnownValue, isTrue);
   }
 
-  void test_hasExactValue_list_invalid() {
-    expect(_dynamicValue().hasExactValue, isFalse);
+  void test_hasKnownValue_list_invalidElement() {
+    expect(_listValue([_dynamicValue]).hasKnownValue, isTrue);
   }
 
-  void test_hasExactValue_list_valid() {
-    expect(_listValue([_intValue(23)]).hasExactValue, isTrue);
+  void test_hasKnownValue_list_valid() {
+    expect(_listValue([_intValue(23)]).hasKnownValue, isTrue);
   }
 
-  void test_hasExactValue_map_empty() {
-    expect(_mapValue().hasExactValue, isTrue);
+  void test_hasKnownValue_map_empty() {
+    expect(_mapValue().hasKnownValue, isTrue);
   }
 
-  void test_hasExactValue_map_invalidKey() {
-    expect(_mapValue([_dynamicValue(), _stringValue("value")]).hasExactValue,
-        isFalse);
-  }
-
-  void test_hasExactValue_map_invalidValue() {
-    expect(_mapValue([_stringValue("key"), _dynamicValue()]).hasExactValue,
-        isFalse);
-  }
-
-  void test_hasExactValue_map_valid() {
-    expect(
-        _mapValue([_stringValue("key"), _stringValue("value")]).hasExactValue,
+  void test_hasKnownValue_map_invalidKey() {
+    expect(_mapValue([_dynamicValue(), _stringValue("value")]).hasKnownValue,
         isTrue);
   }
 
-  void test_hasExactValue_null() {
-    expect(_nullValue().hasExactValue, isTrue);
+  void test_hasKnownValue_map_invalidValue() {
+    expect(_mapValue([_stringValue("key"), _dynamicValue()]).hasKnownValue,
+        isTrue);
   }
 
-  void test_hasExactValue_num() {
-    expect(_numValue().hasExactValue, isFalse);
+  void test_hasKnownValue_map_valid() {
+    expect(
+        _mapValue([_stringValue("key"), _stringValue("value")]).hasKnownValue,
+        isTrue);
   }
 
-  void test_hasExactValue_string_known() {
-    expect(_stringValue("twenty-three").hasExactValue, isTrue);
+  void test_hasKnownValue_null() {
+    expect(_nullValue().hasKnownValue, isTrue);
   }
 
-  void test_hasExactValue_string_unknown() {
-    expect(_stringValue(null).hasExactValue, isTrue);
+  void test_hasKnownValue_num() {
+    expect(_numValue().hasKnownValue, isFalse);
+  }
+
+  void test_hasKnownValue_string_known() {
+    expect(_stringValue("twenty-three").hasKnownValue, isTrue);
+  }
+
+  void test_hasKnownValue_string_unknown() {
+    expect(_stringValue(null).hasKnownValue, isFalse);
   }
 
   void test_identical_bool_false() {
@@ -3898,8 +3928,11 @@
   }
 
   void test_shiftLeft_knownInt_tooLarge() {
-    _assertShiftLeft(_intValue(null), _intValue(6), new DartObjectImpl(
-        _typeProvider.intType, new IntState(LONG_MAX_VALUE)));
+    _assertShiftLeft(
+        _intValue(null),
+        _intValue(6),
+        new DartObjectImpl(
+            _typeProvider.intType, new IntState(LONG_MAX_VALUE)));
   }
 
   void test_shiftLeft_knownInt_unknownInt() {
@@ -3927,8 +3960,11 @@
   }
 
   void test_shiftRight_knownInt_tooLarge() {
-    _assertShiftRight(_intValue(null), _intValue(48), new DartObjectImpl(
-        _typeProvider.intType, new IntState(LONG_MAX_VALUE)));
+    _assertShiftRight(
+        _intValue(null),
+        _intValue(48),
+        new DartObjectImpl(
+            _typeProvider.intType, new IntState(LONG_MAX_VALUE)));
   }
 
   void test_shiftRight_knownInt_unknownInt() {
@@ -4739,7 +4775,7 @@
     variables.define(variableName, "false");
     DartObject object = variables.getBool(typeProvider, variableName);
     expect(object, isNotNull);
-    expect(object.boolValue, false);
+    expect(object.toBoolValue(), false);
   }
 
   void test_getBool_invalid() {
@@ -4758,7 +4794,7 @@
     variables.define(variableName, "true");
     DartObject object = variables.getBool(typeProvider, variableName);
     expect(object, isNotNull);
-    expect(object.boolValue, true);
+    expect(object.toBoolValue(), true);
   }
 
   void test_getBool_undefined() {
@@ -4793,7 +4829,7 @@
     variables.define(variableName, "23");
     DartObject object = variables.getInt(typeProvider, variableName);
     expect(object, isNotNull);
-    expect(object.intValue, 23);
+    expect(object.toIntValue(), 23);
   }
 
   void test_getString_defined() {
@@ -4804,7 +4840,7 @@
     variables.define(variableName, value);
     DartObject object = variables.getString(typeProvider, variableName);
     expect(object, isNotNull);
-    expect(object.stringValue, value);
+    expect(object.toStringValue(), value);
   }
 
   void test_getString_undefined() {
@@ -4919,7 +4955,8 @@
   DirectoryBasedDartSdk _createDartSdk() {
     JavaFile sdkDirectory = DirectoryBasedDartSdk.defaultSdkDirectory;
     expect(sdkDirectory, isNotNull,
-        reason: "No SDK configured; set the property 'com.google.dart.sdk' on the command line");
+        reason:
+            "No SDK configured; set the property 'com.google.dart.sdk' on the command line");
     return new DirectoryBasedDartSdk(sdkDirectory);
   }
 }
@@ -4946,6 +4983,7 @@
 @reflectiveTest
 class ElementBuilderTest extends EngineTestCase {
   void test_visitCatchClause() {
+    // } catch (e, s) {
     ElementHolder holder = new ElementHolder();
     ElementBuilder builder = new ElementBuilder(holder);
     String exceptionParameterName = "e";
@@ -4953,11 +4991,13 @@
     CatchClause clause =
         AstFactory.catchClause2(exceptionParameterName, stackParameterName);
     clause.accept(builder);
+
     List<LocalVariableElement> variables = holder.localVariables;
     expect(variables, hasLength(2));
     VariableElement 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);
@@ -4971,6 +5011,23 @@
     expect(stackVariable.initializer, isNull);
   }
 
+  void test_visitCatchClause_withType() {
+    // } on E catch (e) {
+    ElementHolder holder = new ElementHolder();
+    ElementBuilder builder = new ElementBuilder(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 = new ElementBuilder(holder);
@@ -4996,6 +5053,8 @@
     String className = "C";
     ClassDeclaration classDeclaration =
         AstFactory.classDeclaration(null, className, null, null, null, null);
+    classDeclaration.documentationComment = AstFactory.documentationComment(
+        [TokenFactory.tokenFromString('/// aaa')..offset = 50], []);
     classDeclaration.accept(builder);
     List<ClassElement> types = holder.types;
     expect(types, hasLength(1));
@@ -5007,6 +5066,7 @@
     expect(type.isAbstract, isFalse);
     expect(type.isMixinApplication, isFalse);
     expect(type.isSynthetic, isFalse);
+    _assertHasDocRange(type, 50, 7);
   }
 
   void test_visitClassDeclaration_parameterized() {
@@ -5015,10 +5075,13 @@
     String className = "C";
     String firstVariableName = "E";
     String secondVariableName = "F";
-    ClassDeclaration classDeclaration = AstFactory.classDeclaration(null,
+    ClassDeclaration classDeclaration = AstFactory.classDeclaration(
+        null,
         className,
         AstFactory.typeParameterList([firstVariableName, secondVariableName]),
-        null, null, null);
+        null,
+        null,
+        null);
     classDeclaration.accept(builder);
     List<ClassElement> types = holder.types;
     expect(types, hasLength(1));
@@ -5041,13 +5104,22 @@
     String typeParameterName = "E";
     String fieldName = "f";
     String methodName = "m";
-    ClassDeclaration classDeclaration = AstFactory.classDeclaration(null,
-        className, AstFactory.typeParameterList([typeParameterName]), null,
-        null, null, [
+    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.methodDeclaration2(
+          null,
+          null,
+          null,
+          null,
+          AstFactory.identifier3(methodName),
+          AstFactory.formalParameterList(),
           AstFactory.blockFunctionBody2())
     ]);
     classDeclaration.accept(builder);
@@ -5144,9 +5216,13 @@
     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);
+    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));
@@ -5160,8 +5236,13 @@
     ElementBuilder builder = new ElementBuilder(holder);
     String className = "A";
     ConstructorDeclaration constructorDeclaration = AstFactory
-        .constructorDeclaration2(null, null, AstFactory.identifier3(className),
-            null, AstFactory.formalParameterList(), null,
+        .constructorDeclaration2(
+            null,
+            null,
+            AstFactory.identifier3(className),
+            null,
+            AstFactory.formalParameterList(),
+            null,
             AstFactory.blockFunctionBody2());
     constructorDeclaration.externalKeyword =
         TokenFactory.tokenFromKeyword(Keyword.EXTERNAL);
@@ -5184,9 +5265,13 @@
     ElementBuilder builder = new ElementBuilder(holder);
     String className = "A";
     ConstructorDeclaration constructorDeclaration = AstFactory
-        .constructorDeclaration2(null, Keyword.FACTORY,
-            AstFactory.identifier3(className), null,
-            AstFactory.formalParameterList(), null,
+        .constructorDeclaration2(
+            null,
+            Keyword.FACTORY,
+            AstFactory.identifier3(className),
+            null,
+            AstFactory.formalParameterList(),
+            null,
             AstFactory.blockFunctionBody2());
     constructorDeclaration.accept(builder);
     List<ConstructorElement> constructors = holder.constructors;
@@ -5207,14 +5292,24 @@
     ElementBuilder builder = new ElementBuilder(holder);
     String className = "A";
     ConstructorDeclaration constructorDeclaration = AstFactory
-        .constructorDeclaration2(null, null, AstFactory.identifier3(className),
-            null, AstFactory.formalParameterList(), null,
+        .constructorDeclaration2(
+            null,
+            null,
+            AstFactory.identifier3(className),
+            null,
+            AstFactory.formalParameterList(),
+            null,
             AstFactory.blockFunctionBody2());
+    constructorDeclaration.documentationComment = AstFactory
+        .documentationComment(
+            [TokenFactory.tokenFromString('/// aaa')..offset = 50], []);
     constructorDeclaration.accept(builder);
+
     List<ConstructorElement> constructors = holder.constructors;
     expect(constructors, hasLength(1));
     ConstructorElement constructor = constructors[0];
     expect(constructor, isNotNull);
+    _assertHasDocRange(constructor, 50, 7);
     expect(constructor.isExternal, isFalse);
     expect(constructor.isFactory, isFalse);
     expect(constructor.name, "");
@@ -5230,8 +5325,13 @@
     String className = "A";
     String constructorName = "c";
     ConstructorDeclaration constructorDeclaration = AstFactory
-        .constructorDeclaration2(null, null, AstFactory.identifier3(className),
-            constructorName, AstFactory.formalParameterList(), null,
+        .constructorDeclaration2(
+            null,
+            null,
+            AstFactory.identifier3(className),
+            constructorName,
+            AstFactory.formalParameterList(),
+            null,
             AstFactory.blockFunctionBody2());
     constructorDeclaration.accept(builder);
     List<ConstructorElement> constructors = holder.constructors;
@@ -5254,8 +5354,13 @@
     ElementBuilder builder = new ElementBuilder(holder);
     String className = "A";
     ConstructorDeclaration constructorDeclaration = AstFactory
-        .constructorDeclaration2(null, null, AstFactory.identifier3(className),
-            null, AstFactory.formalParameterList(), null,
+        .constructorDeclaration2(
+            null,
+            null,
+            AstFactory.identifier3(className),
+            null,
+            AstFactory.formalParameterList(),
+            null,
             AstFactory.blockFunctionBody2());
     constructorDeclaration.accept(builder);
     List<ConstructorElement> constructors = holder.constructors;
@@ -5272,17 +5377,124 @@
     expect(constructorDeclaration.element, same(constructor));
   }
 
+  void test_visitDeclaredIdentifier_noType() {
+    // var i
+    ElementHolder holder = new ElementHolder();
+    ElementBuilder builder = new ElementBuilder(holder);
+    var variableName = 'i';
+    DeclaredIdentifier identifier =
+        AstFactory.declaredIdentifier3(variableName);
+    AstFactory.forEachStatement(
+        identifier, AstFactory.nullLiteral(), AstFactory.emptyStatement());
+    identifier.accept(builder);
+
+    List<LocalVariableElement> variables = holder.localVariables;
+    expect(variables, hasLength(1));
+    LocalVariableElement variable = variables[0];
+    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 = new ElementBuilder(holder);
+    var variableName = 'i';
+    DeclaredIdentifier identifier =
+        AstFactory.declaredIdentifier4(AstFactory.typeName4('E'), variableName);
+    AstFactory.forEachStatement(
+        identifier, AstFactory.nullLiteral(), AstFactory.emptyStatement());
+    identifier.accept(builder);
+
+    List<LocalVariableElement> variables = holder.localVariables;
+    expect(variables, hasLength(1));
+    LocalVariableElement variable = variables[0];
+    expect(variable, isNotNull);
+    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 = new ElementBuilder(holder);
+    String parameterName = 'p';
+    DefaultFormalParameter formalParameter = AstFactory
+        .positionalFormalParameter(
+            AstFactory.simpleFormalParameter3(parameterName),
+            AstFactory.integer(0));
+    formalParameter.accept(builder);
+
+    List<ParameterElement> parameters = holder.parameters;
+    expect(parameters, hasLength(1));
+    ParameterElement parameter = parameters[0];
+    expect(parameter.hasImplicitType, 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 = new ElementBuilder(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.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 = new ElementBuilder(holder);
     String enumName = "E";
     EnumDeclaration enumDeclaration =
         AstFactory.enumDeclaration2(enumName, ["ONE"]);
+    enumDeclaration.documentationComment = AstFactory.documentationComment(
+        [TokenFactory.tokenFromString('/// aaa')..offset = 50], []);
     enumDeclaration.accept(builder);
     List<ClassElement> enums = holder.enums;
     expect(enums, hasLength(1));
     ClassElement enumElement = enums[0];
     expect(enumElement, isNotNull);
+    _assertHasDocRange(enumElement, 50, 7);
     expect(enumElement.name, enumName);
   }
 
@@ -5291,23 +5503,30 @@
     ElementBuilder builder = new ElementBuilder(holder);
     String firstFieldName = "x";
     String secondFieldName = "y";
-    FieldDeclaration fieldDeclaration = AstFactory.fieldDeclaration2(false,
-        null, [
+    FieldDeclaration fieldDeclaration =
+        AstFactory.fieldDeclaration2(false, null, [
       AstFactory.variableDeclaration(firstFieldName),
       AstFactory.variableDeclaration(secondFieldName)
     ]);
+    fieldDeclaration.documentationComment = AstFactory.documentationComment(
+        [TokenFactory.tokenFromString('/// aaa')..offset = 50], []);
     fieldDeclaration.accept(builder);
+
     List<FieldElement> fields = holder.fields;
     expect(fields, hasLength(2));
+
     FieldElement firstField = fields[0];
     expect(firstField, isNotNull);
+    _assertHasDocRange(firstField, 50, 7);
     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);
+    _assertHasDocRange(secondField, 50, 7);
     expect(secondField.name, secondFieldName);
     expect(secondField.initializer, isNull);
     expect(secondField.isConst, isFalse);
@@ -5339,8 +5558,11 @@
     ElementHolder holder = new ElementHolder();
     ElementBuilder builder = new ElementBuilder(holder);
     String parameterName = "p";
-    FieldFormalParameter formalParameter = AstFactory.fieldFormalParameter(null,
-        null, parameterName, AstFactory
+    FieldFormalParameter formalParameter = AstFactory.fieldFormalParameter(
+        null,
+        null,
+        parameterName,
+        AstFactory
             .formalParameterList([AstFactory.simpleFormalParameter3("a")]));
     formalParameter.accept(builder);
     List<ParameterElement> parameters = holder.parameters;
@@ -5373,15 +5595,20 @@
   }
 
   void test_visitFunctionDeclaration_external() {
+    // external f();
     ElementHolder holder = new ElementHolder();
     ElementBuilder builder = new ElementBuilder(holder);
     String functionName = "f";
-    FunctionDeclaration declaration = AstFactory.functionDeclaration(null, null,
-        functionName, AstFactory.functionExpression2(
-            AstFactory.formalParameterList(), AstFactory.blockFunctionBody2()));
+    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];
@@ -5389,26 +5616,36 @@
     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 = new ElementBuilder(holder);
     String functionName = "f";
-    FunctionDeclaration declaration = AstFactory.functionDeclaration(null,
-        Keyword.GET, functionName, AstFactory.functionExpression2(
+    FunctionDeclaration declaration = AstFactory.functionDeclaration(
+        null,
+        Keyword.GET,
+        functionName,
+        AstFactory.functionExpression2(
             AstFactory.formalParameterList(), AstFactory.blockFunctionBody2()));
+    declaration.documentationComment = AstFactory.documentationComment(
+        [TokenFactory.tokenFromString('/// aaa')..offset = 50], []);
     declaration.accept(builder);
+
     List<PropertyAccessorElement> accessors = holder.accessors;
     expect(accessors, hasLength(1));
     PropertyAccessorElement accessor = accessors[0];
     expect(accessor, isNotNull);
+    _assertHasDocRange(accessor, 50, 7);
     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);
@@ -5421,17 +5658,26 @@
   }
 
   void test_visitFunctionDeclaration_plain() {
+    // T f() {}
     ElementHolder holder = new ElementHolder();
     ElementBuilder builder = new ElementBuilder(holder);
     String functionName = "f";
-    FunctionDeclaration declaration = AstFactory.functionDeclaration(null, null,
-        functionName, AstFactory.functionExpression2(
+    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.accept(builder);
+
     List<FunctionElement> functions = holder.functions;
     expect(functions, hasLength(1));
     FunctionElement function = functions[0];
     expect(function, isNotNull);
+    _assertHasDocRange(function, 50, 7);
+    expect(function.hasImplicitReturnType, isFalse);
     expect(function.name, functionName);
     expect(declaration.element, same(function));
     expect(declaration.functionExpression.element, same(function));
@@ -5441,17 +5687,26 @@
   }
 
   void test_visitFunctionDeclaration_setter() {
+    // set f() {}
     ElementHolder holder = new ElementHolder();
     ElementBuilder builder = new ElementBuilder(holder);
     String functionName = "f";
-    FunctionDeclaration declaration = AstFactory.functionDeclaration(null,
-        Keyword.SET, functionName, AstFactory.functionExpression2(
+    FunctionDeclaration declaration = AstFactory.functionDeclaration(
+        null,
+        Keyword.SET,
+        functionName,
+        AstFactory.functionExpression2(
             AstFactory.formalParameterList(), AstFactory.blockFunctionBody2()));
+    declaration.documentationComment = AstFactory.documentationComment(
+        [TokenFactory.tokenFromString('/// aaa')..offset = 50], []);
     declaration.accept(builder);
+
     List<PropertyAccessorElement> accessors = holder.accessors;
     expect(accessors, hasLength(1));
     PropertyAccessorElement accessor = accessors[0];
     expect(accessor, isNotNull);
+    _assertHasDocRange(accessor, 50, 7);
+    expect(accessor.hasImplicitReturnType, isFalse);
     expect(accessor.name, "$functionName=");
     expect(declaration.element, same(accessor));
     expect(declaration.functionExpression.element, same(accessor));
@@ -5467,20 +5722,24 @@
   }
 
   void test_visitFunctionDeclaration_typeParameters() {
+    // f<E>() {}
     ElementHolder holder = new ElementHolder();
     ElementBuilder builder = new ElementBuilder(holder);
     String functionName = 'f';
     String typeParameterName = 'E';
     FunctionExpression expression = AstFactory.functionExpression3(
         AstFactory.typeParameterList([typeParameterName]),
-        AstFactory.formalParameterList(), AstFactory.blockFunctionBody2());
+        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);
@@ -5504,6 +5763,7 @@
     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));
   }
@@ -5515,11 +5775,15 @@
     String parameterName = "E";
     FunctionTypeAlias aliasNode = AstFactory.typeAlias(
         null, aliasName, AstFactory.typeParameterList([parameterName]), null);
+    aliasNode.documentationComment = AstFactory.documentationComment(
+        [TokenFactory.tokenFromString('/// aaa')..offset = 50], []);
     aliasNode.accept(builder);
+
     List<FunctionTypeAliasElement> aliases = holder.typeAliases;
     expect(aliases, hasLength(1));
     FunctionTypeAliasElement alias = aliases[0];
     expect(alias, isNotNull);
+    _assertHasDocRange(alias, 50, 7);
     expect(alias.name, aliasName);
     expect(alias.parameters, hasLength(0));
     List<TypeParameterElement> typeParameters = alias.typeParameters;
@@ -5593,17 +5857,25 @@
   }
 
   void test_visitMethodDeclaration_abstract() {
+    // m();
     ElementHolder holder = new ElementHolder();
     ElementBuilder builder = new ElementBuilder(holder);
     String methodName = "m";
-    MethodDeclaration methodDeclaration = AstFactory.methodDeclaration2(null,
-        null, null, null, AstFactory.identifier3(methodName),
-        AstFactory.formalParameterList(), AstFactory.emptyFunctionBody());
+    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));
@@ -5617,19 +5889,27 @@
   }
 
   void test_visitMethodDeclaration_external() {
+    // external m();
     ElementHolder holder = new ElementHolder();
     ElementBuilder builder = new ElementBuilder(holder);
     String methodName = "m";
-    MethodDeclaration methodDeclaration = AstFactory.methodDeclaration2(null,
-        null, null, null, AstFactory.identifier3(methodName),
-        AstFactory.formalParameterList(), AstFactory.emptyFunctionBody());
+    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));
@@ -5643,13 +5923,22 @@
   }
 
   void test_visitMethodDeclaration_getter() {
+    // get m() {}
     ElementHolder holder = new ElementHolder();
     ElementBuilder builder = new ElementBuilder(holder);
     String methodName = "m";
-    MethodDeclaration methodDeclaration = AstFactory.methodDeclaration2(null,
-        null, Keyword.GET, null, AstFactory.identifier3(methodName),
-        AstFactory.formalParameterList(), AstFactory.blockFunctionBody2());
+    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.accept(builder);
+
     List<FieldElement> fields = holder.fields;
     expect(fields, hasLength(1));
     FieldElement field = fields[0];
@@ -5659,6 +5948,8 @@
     expect(field.setter, isNull);
     PropertyAccessorElement getter = field.getter;
     expect(getter, isNotNull);
+    _assertHasDocRange(getter, 50, 7);
+    expect(getter.hasImplicitReturnType, isTrue);
     expect(getter.isAbstract, isFalse);
     expect(getter.isExternal, isFalse);
     expect(getter.isGetter, isTrue);
@@ -5672,13 +5963,20 @@
   }
 
   void test_visitMethodDeclaration_getter_abstract() {
+    // get m();
     ElementHolder holder = new ElementHolder();
     ElementBuilder builder = new ElementBuilder(holder);
     String methodName = "m";
-    MethodDeclaration methodDeclaration = AstFactory.methodDeclaration2(null,
-        null, Keyword.GET, null, AstFactory.identifier3(methodName),
-        AstFactory.formalParameterList(), AstFactory.emptyFunctionBody());
+    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];
@@ -5688,6 +5986,7 @@
     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);
@@ -5701,15 +6000,21 @@
   }
 
   void test_visitMethodDeclaration_getter_external() {
+    // external get m();
     ElementHolder holder = new ElementHolder();
     ElementBuilder builder = new ElementBuilder(holder);
     String methodName = "m";
-    MethodDeclaration methodDeclaration = AstFactory.methodDeclaration(null,
-        null, Keyword.GET, null, AstFactory.identifier3(methodName),
+    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];
@@ -5719,6 +6024,7 @@
     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);
@@ -5732,17 +6038,28 @@
   }
 
   void test_visitMethodDeclaration_minimal() {
+    // T m() {}
     ElementHolder holder = new ElementHolder();
     ElementBuilder builder = new ElementBuilder(holder);
     String methodName = "m";
-    MethodDeclaration methodDeclaration = AstFactory.methodDeclaration2(null,
-        null, null, null, AstFactory.identifier3(methodName),
-        AstFactory.formalParameterList(), AstFactory.blockFunctionBody2());
+    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.accept(builder);
+
     List<MethodElement> methods = holder.methods;
     expect(methods, hasLength(1));
     MethodElement method = methods[0];
     expect(method, isNotNull);
+    _assertHasDocRange(method, 50, 7);
+    expect(method.hasImplicitReturnType, isFalse);
     expect(method.name, methodName);
     expect(method.functions, hasLength(0));
     expect(method.labels, hasLength(0));
@@ -5756,19 +6073,26 @@
   }
 
   void test_visitMethodDeclaration_operator() {
+    // operator +(addend) {}
     ElementHolder holder = new ElementHolder();
     ElementBuilder builder = new ElementBuilder(holder);
     String methodName = "+";
-    MethodDeclaration methodDeclaration = AstFactory.methodDeclaration2(null,
-        null, null, Keyword.OPERATOR, AstFactory.identifier3(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));
@@ -5782,13 +6106,22 @@
   }
 
   void test_visitMethodDeclaration_setter() {
+    // set m() {}
     ElementHolder holder = new ElementHolder();
     ElementBuilder builder = new ElementBuilder(holder);
     String methodName = "m";
-    MethodDeclaration methodDeclaration = AstFactory.methodDeclaration2(null,
-        null, Keyword.SET, null, AstFactory.identifier3(methodName),
-        AstFactory.formalParameterList(), AstFactory.blockFunctionBody2());
+    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.accept(builder);
+
     List<FieldElement> fields = holder.fields;
     expect(fields, hasLength(1));
     FieldElement field = fields[0];
@@ -5796,8 +6129,11 @@
     expect(field.name, methodName);
     expect(field.isSynthetic, isTrue);
     expect(field.getter, isNull);
+
     PropertyAccessorElement setter = field.setter;
     expect(setter, isNotNull);
+    _assertHasDocRange(setter, 50, 7);
+    expect(setter.hasImplicitReturnType, isFalse);
     expect(setter.isAbstract, isFalse);
     expect(setter.isExternal, isFalse);
     expect(setter.isSetter, isTrue);
@@ -5812,13 +6148,20 @@
   }
 
   void test_visitMethodDeclaration_setter_abstract() {
+    // set m();
     ElementHolder holder = new ElementHolder();
     ElementBuilder builder = new ElementBuilder(holder);
     String methodName = "m";
-    MethodDeclaration methodDeclaration = AstFactory.methodDeclaration2(null,
-        null, Keyword.SET, null, AstFactory.identifier3(methodName),
-        AstFactory.formalParameterList(), AstFactory.emptyFunctionBody());
+    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];
@@ -5828,6 +6171,7 @@
     expect(field.getter, isNull);
     PropertyAccessorElement setter = field.setter;
     expect(setter, isNotNull);
+    expect(setter.hasImplicitReturnType, isFalse);
     expect(setter.isAbstract, isTrue);
     expect(setter.isExternal, isFalse);
     expect(setter.isSetter, isTrue);
@@ -5842,15 +6186,21 @@
   }
 
   void test_visitMethodDeclaration_setter_external() {
+    // external m();
     ElementHolder holder = new ElementHolder();
     ElementBuilder builder = new ElementBuilder(holder);
     String methodName = "m";
-    MethodDeclaration methodDeclaration = AstFactory.methodDeclaration(null,
-        null, Keyword.SET, null, AstFactory.identifier3(methodName),
+    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];
@@ -5860,6 +6210,7 @@
     expect(field.getter, isNull);
     PropertyAccessorElement setter = field.setter;
     expect(setter, isNotNull);
+    expect(setter.hasImplicitReturnType, isFalse);
     expect(setter.isAbstract, isFalse);
     expect(setter.isExternal, isTrue);
     expect(setter.isSetter, isTrue);
@@ -5874,17 +6225,24 @@
   }
 
   void test_visitMethodDeclaration_static() {
+    // static m() {}
     ElementHolder holder = new ElementHolder();
     ElementBuilder builder = new ElementBuilder(holder);
     String methodName = "m";
     MethodDeclaration methodDeclaration = AstFactory.methodDeclaration2(
-        Keyword.STATIC, null, null, null, AstFactory.identifier3(methodName),
-        AstFactory.formalParameterList(), AstFactory.blockFunctionBody2());
+        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));
@@ -5898,18 +6256,26 @@
   }
 
   void test_visitMethodDeclaration_typeParameters() {
+    // m<E>() {}
     ElementHolder holder = new ElementHolder();
     ElementBuilder builder = new ElementBuilder(holder);
     String methodName = "m";
-    MethodDeclaration methodDeclaration = AstFactory.methodDeclaration2(null,
-        null, null, null, AstFactory.identifier3(methodName),
-        AstFactory.formalParameterList(), AstFactory.blockFunctionBody2());
+    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));
@@ -5923,6 +6289,7 @@
   }
 
   void test_visitMethodDeclaration_withMembers() {
+    // m(p) { var v; try { l: return; } catch (e) {} }
     ElementHolder holder = new ElementHolder();
     ElementBuilder builder = new ElementBuilder(holder);
     String methodName = "m";
@@ -5930,23 +6297,31 @@
     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 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);
@@ -5964,10 +6339,12 @@
     VariableElement secondVariable = localVariables[1];
     expect(firstVariable, isNotNull);
     expect(secondVariable, isNotNull);
-    expect((firstVariable.name == localVariableName &&
-            secondVariable.name == exceptionParameterName) ||
-        (firstVariable.name == exceptionParameterName &&
-            secondVariable.name == localVariableName), isTrue);
+    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];
@@ -6004,7 +6381,8 @@
     expect(initializer.isSynthetic, isTrue);
   }
 
-  void test_visitSimpleFormalParameter() {
+  void test_visitSimpleFormalParameter_noType() {
+    // p
     ElementHolder holder = new ElementHolder();
     ElementBuilder builder = new ElementBuilder(holder);
     String parameterName = "p";
@@ -6016,11 +6394,39 @@
     expect(parameters, hasLength(1));
     ParameterElement parameter = parameters[0];
     expect(parameter, isNotNull);
-    expect(parameter.name, parameterName);
+    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);
+    {
+      SourceRange visibleRange = parameter.visibleRange;
+      expect(100, visibleRange.offset);
+      expect(110, visibleRange.end);
+    }
+  }
+
+  void test_visitSimpleFormalParameter_type() {
+    // T p
+    ElementHolder holder = new ElementHolder();
+    ElementBuilder builder = new ElementBuilder(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);
     {
       SourceRange visibleRange = parameter.visibleRange;
@@ -6050,11 +6456,14 @@
     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 typeAlias = AstFactory.typeAlias(
+        null,
+        aliasName,
+        AstFactory.typeParameterList(),
+        AstFactory.formalParameterList([
+          AstFactory.simpleFormalParameter3(firstParameterName),
+          AstFactory.simpleFormalParameter3(secondParameterName)
+        ]));
     typeAlias.accept(builder);
     List<FunctionTypeAliasElement> aliases = holder.typeAliases;
     expect(aliases, hasLength(1));
@@ -6078,9 +6487,11 @@
     String aliasName = "F";
     String firstTypeParameterName = "A";
     String secondTypeParameterName = "B";
-    TypeAlias typeAlias = AstFactory.typeAlias(null, aliasName, AstFactory
-            .typeParameterList(
-                [firstTypeParameterName, secondTypeParameterName]),
+    TypeAlias typeAlias = AstFactory.typeAlias(
+        null,
+        aliasName,
+        AstFactory.typeParameterList(
+            [firstTypeParameterName, secondTypeParameterName]),
         AstFactory.formalParameterList());
     typeAlias.accept(builder);
     List<FunctionTypeAliasElement> aliases = holder.typeAliases;
@@ -6126,16 +6537,22 @@
     Statement statement =
         AstFactory.variableDeclarationStatement2(null, [variable]);
     ConstructorDeclaration constructor = AstFactory.constructorDeclaration2(
-        null, null, AstFactory.identifier3("C"), "C",
-        AstFactory.formalParameterList(), null,
+        null,
+        null,
+        AstFactory.identifier3("C"),
+        "C",
+        AstFactory.formalParameterList(),
+        null,
         AstFactory.blockFunctionBody2([statement]));
     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];
+    expect(variableElement.hasImplicitType, isTrue);
     expect(variableElement.name, variableName);
   }
 
@@ -6143,31 +6560,37 @@
     ElementHolder holder = new ElementHolder();
     ElementBuilder builder = new ElementBuilder(holder);
     //
-    // m() {var v;}
+    // m() {T v;}
     //
     String variableName = "v";
     VariableDeclaration variable =
         AstFactory.variableDeclaration2(variableName, null);
-    Statement statement =
-        AstFactory.variableDeclarationStatement2(null, [variable]);
-    MethodDeclaration constructor = AstFactory.methodDeclaration2(null, null,
-        null, null, AstFactory.identifier3("m"),
+    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]));
-    constructor.accept(builder);
+    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);
   }
 
-  void test_visitVariableDeclaration_localNestedInField() {
+  void test_visitVariableDeclaration_localNestedInFunction() {
     ElementHolder holder = new ElementHolder();
     ElementBuilder builder = new ElementBuilder(holder);
     //
-    // var f = () {var v;}
+    // var f = () {var v;};
     //
     String variableName = "v";
     VariableDeclaration variable =
@@ -6183,6 +6606,7 @@
     FieldDeclaration fieldDeclaration =
         AstFactory.fieldDeclaration2(false, null, [field]);
     fieldDeclaration.accept(builder);
+
     List<FieldElement> variables = holder.fields;
     expect(variables, hasLength(1));
     FieldElement fieldElement = variables[0];
@@ -6195,13 +6619,15 @@
         functionElements[0].localVariables;
     expect(variableElements, hasLength(1));
     LocalVariableElement variableElement = variableElements[0];
-    expect(variableElement.name, variableName);
+    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 = new ElementBuilder(holder);
     String variableName = "v";
@@ -6209,10 +6635,12 @@
         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);
@@ -6223,6 +6651,7 @@
   }
 
   void test_visitVariableDeclaration_top_const_hasInitializer() {
+    // const v = 42;
     ElementHolder holder = new ElementHolder();
     ElementBuilder builder = new ElementBuilder(holder);
     String variableName = "v";
@@ -6230,12 +6659,14 @@
         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.name, variableName);
+    expect(variable.hasImplicitType, isTrue);
     expect(variable.isConst, isTrue);
     expect(variable.isFinal, isFalse);
     expect(variable.isSynthetic, isFalse);
@@ -6243,7 +6674,36 @@
     expect(variable.setter, isNull);
   }
 
+  void test_visitVariableDeclaration_top_docRange() {
+    // final a, b;
+    ElementHolder holder = new ElementHolder();
+    ElementBuilder builder = new ElementBuilder(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);
+    _assertHasDocRange(variable1, 50, 7);
+
+    TopLevelVariableElement variable2 = variables[1];
+    expect(variable2, isNotNull);
+    _assertHasDocRange(variable2, 50, 7);
+  }
+
   void test_visitVariableDeclaration_top_final() {
+    // final v;
     ElementHolder holder = new ElementHolder();
     ElementBuilder builder = new ElementBuilder(holder);
     String variableName = "v";
@@ -6255,6 +6715,7 @@
     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);
@@ -6264,15 +6725,28 @@
     expect(variable.setter, isNull);
   }
 
+  void _assertHasDocRange(
+      Element element, int expectedOffset, int expectedLength) {
+    SourceRange docRange = element.docRange;
+    expect(docRange, isNotNull);
+    expect(docRange.offset, expectedOffset);
+    expect(docRange.length, expectedLength);
+  }
+
   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.methodDeclaration2(
+        null,
+        null,
+        null,
+        null,
         AstFactory.identifier3("main"),
-        AstFactory.formalParameterList([formalParameter]), body);
+        AstFactory.formalParameterList([formalParameter]),
+        body);
   }
 }
 
@@ -6308,7 +6782,9 @@
   }
 
   void test_locate_AssignmentExpression() {
-    AstNode id = _findNodeIn("+=", r'''
+    AstNode id = _findNodeIn(
+        "+=",
+        r'''
 int x = 0;
 void main() {
   x += 1;
@@ -6340,7 +6816,10 @@
   }
 
   void test_locate_ConstructorDeclaration() {
-    AstNode id = _findNodeIndexedIn("bar", 0, r'''
+    AstNode id = _findNodeIndexedIn(
+        "bar",
+        0,
+        r'''
 class A {
   A.bar() {}
 }''');
@@ -6361,7 +6840,10 @@
   }
 
   void test_locate_Identifier_annotationClass_namedConstructor_forSimpleFormalParameter() {
-    AstNode id = _findNodeIndexedIn("Class", 2, r'''
+    AstNode id = _findNodeIndexedIn(
+        "Class",
+        2,
+        r'''
 class Class {
   const Class.name();
 }
@@ -6373,7 +6855,10 @@
   }
 
   void test_locate_Identifier_annotationClass_unnamedConstructor_forSimpleFormalParameter() {
-    AstNode id = _findNodeIndexedIn("Class", 2, r'''
+    AstNode id = _findNodeIndexedIn(
+        "Class",
+        2,
+        r'''
 class Class {
   const Class();
 }
@@ -6392,7 +6877,10 @@
   }
 
   void test_locate_Identifier_constructor_named() {
-    AstNode id = _findNodeIndexedIn("bar", 0, r'''
+    AstNode id = _findNodeIndexedIn(
+        "bar",
+        0,
+        r'''
 class A {
   A.bar() {}
 }''');
@@ -6402,7 +6890,10 @@
   }
 
   void test_locate_Identifier_constructor_unnamed() {
-    AstNode id = _findNodeIndexedIn("A", 1, r'''
+    AstNode id = _findNodeIndexedIn(
+        "A",
+        1,
+        r'''
 class A {
   A() {}
 }''');
@@ -6419,7 +6910,9 @@
   }
 
   void test_locate_Identifier_propertAccess() {
-    AstNode id = _findNodeIn("length", r'''
+    AstNode id = _findNodeIn(
+        "length",
+        r'''
 void main() {
  int x = 'foo'.length;
 }''');
@@ -6436,7 +6929,10 @@
   }
 
   void test_locate_IndexExpression() {
-    AstNode id = _findNodeIndexedIn("\\[", 1, r'''
+    AstNode id = _findNodeIndexedIn(
+        "\\[",
+        1,
+        r'''
 void main() {
   List x = [1, 2];
   var y = x[0];
@@ -6447,7 +6943,10 @@
   }
 
   void test_locate_InstanceCreationExpression() {
-    AstNode node = _findNodeIndexedIn("A(", 0, r'''
+    AstNode node = _findNodeIndexedIn(
+        "A(",
+        0,
+        r'''
 class A {}
 void main() {
  new A();
@@ -6503,7 +7002,9 @@
   }
 
   void test_locate_MethodDeclaration() {
-    AstNode id = _findNodeIn("m", r'''
+    AstNode id = _findNodeIn(
+        "m",
+        r'''
 class A {
   void m() {}
 }''');
@@ -6515,7 +7016,10 @@
   }
 
   void test_locate_MethodInvocation_method() {
-    AstNode id = _findNodeIndexedIn("bar", 1, r'''
+    AstNode id = _findNodeIndexedIn(
+        "bar",
+        1,
+        r'''
 class A {
   int bar() => 42;
 }
@@ -6543,6 +7047,26 @@
         (obj) => obj is FunctionElement, FunctionElement, element);
   }
 
+  void test_locate_PartOfDirective() {
+    Source librarySource = addNamedSource(
+        '/lib.dart',
+        '''
+library my.lib;
+part 'part.dart';
+''');
+    Source unitSource = addNamedSource(
+        '/part.dart',
+        '''
+part of my.lib;
+''');
+    CompilationUnit unit =
+        analysisContext.resolveCompilationUnit2(unitSource, librarySource);
+    PartOfDirective partOf = unit.directives.first;
+    Element element = ElementLocator.locate(partOf);
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is LibraryElement, LibraryElement, element);
+  }
+
   void test_locate_PostfixExpression() {
     AstNode id = _findNodeIn("++", "int addOne(int x) => x++;");
     Element element = ElementLocator.locate(id);
@@ -6551,7 +7075,9 @@
   }
 
   void test_locate_PrefixedIdentifier() {
-    AstNode id = _findNodeIn("int", r'''
+    AstNode id = _findNodeIn(
+        "int",
+        r'''
 import 'dart:core' as core;
 core.int value;''');
     PrefixedIdentifier identifier =
@@ -6608,19 +7134,6 @@
         TopLevelVariableElement, element);
   }
 
-  void test_locateWithOffset_BinaryExpression() {
-    AstNode id = _findNodeIn("+", "var x = 3 + 4;");
-    Element element = ElementLocator.locateWithOffset(id, 0);
-    EngineTestCase.assertInstanceOf(
-        (obj) => obj is MethodElement, MethodElement, element);
-  }
-
-  void test_locateWithOffset_StringLiteral() {
-    AstNode id = _findNodeIn("abc", "var x = 'abc';");
-    Element element = ElementLocator.locateWithOffset(id, 1);
-    expect(element, isNull);
-  }
-
   /**
    * Find the first AST node matching a pattern in the resolved AST for the given source.
    *
@@ -6800,7 +7313,8 @@
     ErrorReporter reporter = new ErrorReporter(listener, element.source);
     reporter.reportErrorForElement(
         StaticWarningCode.CONFLICTING_INSTANCE_GETTER_AND_SUPERCLASS_MEMBER,
-        element, ['A']);
+        element,
+        ['A']);
     AnalysisError error = listener.errors[0];
     expect(error.offset, element.nameOffset);
   }
@@ -6809,15 +7323,39 @@
     ImportElementImpl element =
         ElementFactory.importFor(ElementFactory.library(null, ''), null);
     GatheringErrorListener listener = new GatheringErrorListener();
-    ErrorReporter reporter = new ErrorReporter(listener, new NonExistingSource(
-        '/test.dart', toUri('/test.dart'), UriKind.FILE_URI));
+    ErrorReporter reporter = new ErrorReporter(
+        listener,
+        new NonExistingSource(
+            '/test.dart', toUri('/test.dart'), UriKind.FILE_URI));
     reporter.reportErrorForElement(
         StaticWarningCode.CONFLICTING_INSTANCE_GETTER_AND_SUPERCLASS_MEMBER,
-        element, ['A']);
+        element,
+        ['A']);
     AnalysisError error = listener.errors[0];
     expect(error.offset, element.nameOffset);
   }
 
+  void test_reportErrorForSpan() {
+    GatheringErrorListener listener = new GatheringErrorListener();
+    ErrorReporter reporter = new ErrorReporter(listener, new TestSource());
+
+    var src = '''
+foo: bar
+zap: baz
+''';
+
+    int offset = src.indexOf('baz');
+    int length = 'baz'.length;
+
+    SourceSpan span = new SourceFile(src).span(offset, offset + length);
+
+    reporter.reportErrorForSpan(
+        AnalysisOptionsWarningCode.UNSUPPORTED_OPTION, span, ['test', 'zap']);
+    expect(listener.errors, hasLength(1));
+    expect(listener.errors.first.offset, offset);
+    expect(listener.errors.first.length, length);
+  }
+
   void test_reportTypeErrorForNode_differentNames() {
     DartType firstType = createType("/test1.dart", "A");
     DartType secondType = createType("/test2.dart", "B");
@@ -6826,7 +7364,8 @@
         new ErrorReporter(listener, firstType.element.source);
     reporter.reportTypeErrorForNode(
         StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE,
-        AstFactory.identifier3("x"), [firstType, secondType]);
+        AstFactory.identifier3("x"),
+        [firstType, secondType]);
     AnalysisError error = listener.errors[0];
     expect(error.message.indexOf("(") < 0, isTrue);
   }
@@ -6840,7 +7379,8 @@
         new ErrorReporter(listener, firstType.element.source);
     reporter.reportTypeErrorForNode(
         StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE,
-        AstFactory.identifier3("x"), [firstType, secondType]);
+        AstFactory.identifier3("x"),
+        [firstType, secondType]);
     AnalysisError error = listener.errors[0];
     expect(error.message.indexOf("(") >= 0, isTrue);
   }
@@ -6926,7 +7466,7 @@
   }
 
   void test_assertStatement_throw() {
-    _assertTrue("assert((throw 0));");
+    _assertFalse("assert((throw 0));");
   }
 
   void test_assignmentExpression() {
@@ -6958,15 +7498,31 @@
   }
 
   void test_binaryExpression_and_rhs() {
-    _assertTrue("a && (throw '');");
+    _assertFalse("a && (throw '');");
   }
 
   void test_binaryExpression_and_rhs2() {
-    _assertTrue("false && (throw '');");
+    _assertFalse("false && (throw '');");
   }
 
   void test_binaryExpression_and_rhs3() {
-    _assertFalse("true && (throw '');");
+    _assertTrue("true && (throw '');");
+  }
+
+  void test_binaryExpression_ifNull() {
+    _assertFalse("a ?? b;");
+  }
+
+  void test_binaryExpression_ifNull_lhs() {
+    _assertTrue("throw '' ?? b;");
+  }
+
+  void test_binaryExpression_ifNull_rhs() {
+    _assertFalse("a ?? (throw '');");
+  }
+
+  void test_binaryExpression_ifNull_rhs2() {
+    _assertFalse("null ?? (throw '');");
   }
 
   void test_binaryExpression_or() {
@@ -6978,15 +7534,15 @@
   }
 
   void test_binaryExpression_or_rhs() {
-    _assertTrue("a || (throw '');");
+    _assertFalse("a || (throw '');");
   }
 
   void test_binaryExpression_or_rhs2() {
-    _assertTrue("true || (throw '');");
+    _assertFalse("true || (throw '');");
   }
 
   void test_binaryExpression_or_rhs3() {
-    _assertFalse("false || (throw '');");
+    _assertTrue("false || (throw '');");
   }
 
   void test_block_empty() {
@@ -7037,6 +7593,62 @@
     _assertFalse("c ? throw '' : j;");
   }
 
+  void test_conditionalAccess() {
+    _assertFalse("a?.b;");
+  }
+
+  void test_conditionalAccess_lhs() {
+    _assertTrue("(throw '')?.b;");
+  }
+
+  void test_conditionalAccessAssign() {
+    _assertFalse("a?.b = c;");
+  }
+
+  void test_conditionalAccessAssign_lhs() {
+    _assertTrue("(throw '')?.b = c;");
+  }
+
+  void test_conditionalAccessAssign_rhs() {
+    _assertFalse("a?.b = throw '';");
+  }
+
+  void test_conditionalAccessAssign_rhs2() {
+    _assertFalse("null?.b = throw '';");
+  }
+
+  void test_conditionalAccessIfNullAssign() {
+    _assertFalse("a?.b ??= c;");
+  }
+
+  void test_conditionalAccessIfNullAssign_lhs() {
+    _assertTrue("(throw '')?.b ??= c;");
+  }
+
+  void test_conditionalAccessIfNullAssign_rhs() {
+    _assertFalse("a?.b ??= throw '';");
+  }
+
+  void test_conditionalAccessIfNullAssign_rhs2() {
+    _assertFalse("null?.b ??= throw '';");
+  }
+
+  void test_conditionalCall() {
+    _assertFalse("a?.b(c);");
+  }
+
+  void test_conditionalCall_lhs() {
+    _assertTrue("(throw '')?.b(c);");
+  }
+
+  void test_conditionalCall_rhs() {
+    _assertFalse("a?.b(throw '');");
+  }
+
+  void test_conditionalCall_rhs2() {
+    _assertFalse("null?.b(throw '');");
+  }
+
   void test_creation() {
     expect(new ExitDetector(), isNotNull);
   }
@@ -7193,6 +7805,14 @@
     _assertFalse("if (c) return 0; else j++;");
   }
 
+  void test_ifNullAssign() {
+    _assertFalse("a ??= b;");
+  }
+
+  void test_ifNullAssign_rhs() {
+    _assertFalse("a ??= throw '';");
+  }
+
   void test_indexExpression() {
     _assertFalse("a[b];");
   }
@@ -7766,6 +8386,18 @@
         resolver.resolveAbsolute(parseUriWithException("dart:core"));
     expect(result, isNull);
   }
+
+  void test_restore() {
+    UriResolver resolver = new FileUriResolver();
+    Uri uri = parseUriWithException('file:///foo/bar.dart');
+    Source source = resolver.resolveAbsolute(uri);
+    expect(source, isNotNull);
+    expect(resolver.restoreAbsolute(source), uri);
+    expect(
+        resolver.restoreAbsolute(
+            new NonExistingSource(source.fullName, null, null)),
+        uri);
+  }
 }
 
 @reflectiveTest
@@ -7791,11 +8423,13 @@
 </html>""");
     _validate(htmlUnit, [
       _t4("html", [
-        _t4("body",
-            [_t("script", _a(["type", "'application/dart'"]), scriptBody)])
+        _t4("body", [
+          _t("script", _a(["type", "'application/dart'"]), scriptBody)
+        ])
       ])
     ]);
   }
+
   ht.HtmlUnit parse(String contents) {
 //    TestSource source =
 //        new TestSource.con1(FileUtilities2.createFile("/test.dart"), contents);
@@ -7810,74 +8444,108 @@
     errorListener.assertNoErrors();
     return unit;
   }
+
   void test_parse_attribute() {
     ht.HtmlUnit htmlUnit = parse("<html><body foo=\"sdfsdf\"></body></html>");
-    _validate(
-        htmlUnit, [_t4("html", [_t("body", _a(["foo", "\"sdfsdf\""]), "")])]);
+    _validate(htmlUnit, [
+      _t4("html", [
+        _t("body", _a(["foo", "\"sdfsdf\""]), "")
+      ])
+    ]);
     ht.XmlTagNode htmlNode = htmlUnit.tagNodes[0];
     ht.XmlTagNode bodyNode = htmlNode.tagNodes[0];
     expect(bodyNode.attributes[0].text, "sdfsdf");
   }
+
   void test_parse_attribute_EOF() {
     ht.HtmlUnit htmlUnit = parse("<html><body foo=\"sdfsdf\"");
-    _validate(
-        htmlUnit, [_t4("html", [_t("body", _a(["foo", "\"sdfsdf\""]), "")])]);
+    _validate(htmlUnit, [
+      _t4("html", [
+        _t("body", _a(["foo", "\"sdfsdf\""]), "")
+      ])
+    ]);
   }
+
   void test_parse_attribute_EOF_missing_quote() {
     ht.HtmlUnit htmlUnit = parse("<html><body foo=\"sdfsd");
-    _validate(
-        htmlUnit, [_t4("html", [_t("body", _a(["foo", "\"sdfsd"]), "")])]);
+    _validate(htmlUnit, [
+      _t4("html", [
+        _t("body", _a(["foo", "\"sdfsd"]), "")
+      ])
+    ]);
     ht.XmlTagNode htmlNode = htmlUnit.tagNodes[0];
     ht.XmlTagNode bodyNode = htmlNode.tagNodes[0];
     expect(bodyNode.attributes[0].text, "sdfsd");
   }
+
   void test_parse_attribute_extra_quote() {
     ht.HtmlUnit htmlUnit = parse("<html><body foo=\"sdfsdf\"\"></body></html>");
-    _validate(
-        htmlUnit, [_t4("html", [_t("body", _a(["foo", "\"sdfsdf\""]), "")])]);
+    _validate(htmlUnit, [
+      _t4("html", [
+        _t("body", _a(["foo", "\"sdfsdf\""]), "")
+      ])
+    ]);
   }
+
   void test_parse_attribute_single_quote() {
     ht.HtmlUnit htmlUnit = parse("<html><body foo='sdfsdf'></body></html>");
-    _validate(
-        htmlUnit, [_t4("html", [_t("body", _a(["foo", "'sdfsdf'"]), "")])]);
+    _validate(htmlUnit, [
+      _t4("html", [
+        _t("body", _a(["foo", "'sdfsdf'"]), "")
+      ])
+    ]);
     ht.XmlTagNode htmlNode = htmlUnit.tagNodes[0];
     ht.XmlTagNode bodyNode = htmlNode.tagNodes[0];
     expect(bodyNode.attributes[0].text, "sdfsdf");
   }
+
   void test_parse_comment_embedded() {
     ht.HtmlUnit htmlUnit = parse("<html <!-- comment -->></html>");
     _validate(htmlUnit, [_t3("html", "")]);
   }
+
   void test_parse_comment_first() {
     ht.HtmlUnit htmlUnit = parse("<!-- comment --><html></html>");
     _validate(htmlUnit, [_t3("html", "")]);
   }
+
   void test_parse_comment_in_content() {
     ht.HtmlUnit htmlUnit = parse("<html><!-- comment --></html>");
     _validate(htmlUnit, [_t3("html", "<!-- comment -->")]);
   }
+
   void test_parse_content() {
     ht.HtmlUnit htmlUnit = parse("<html>\n<p a=\"b\">blat \n </p>\n</html>");
     // ht.XmlTagNode.getContent() does not include whitespace
     // between '<' and '>' at this time
     _validate(htmlUnit, [
-      _t3("html", "\n<pa=\"b\">blat \n </p>\n",
-          [_t("p", _a(["a", "\"b\""]), "blat \n ")])
+      _t3("html", "\n<pa=\"b\">blat \n </p>\n", [
+        _t("p", _a(["a", "\"b\""]), "blat \n ")
+      ])
     ]);
   }
+
   void test_parse_content_none() {
     ht.HtmlUnit htmlUnit = parse("<html><p/>blat<p/></html>");
-    _validate(
-        htmlUnit, [_t3("html", "<p/>blat<p/>", [_t3("p", ""), _t3("p", "")])]);
+    _validate(htmlUnit, [
+      _t3("html", "<p/>blat<p/>", [_t3("p", ""), _t3("p", "")])
+    ]);
   }
+
   void test_parse_declaration() {
     ht.HtmlUnit htmlUnit = parse("<!DOCTYPE html>\n\n<html><p></p></html>");
-    _validate(htmlUnit, [_t4("html", [_t3("p", "")])]);
+    _validate(htmlUnit, [
+      _t4("html", [_t3("p", "")])
+    ]);
   }
+
   void test_parse_directive() {
     ht.HtmlUnit htmlUnit = parse("<?xml ?>\n\n<html><p></p></html>");
-    _validate(htmlUnit, [_t4("html", [_t3("p", "")])]);
+    _validate(htmlUnit, [
+      _t4("html", [_t3("p", "")])
+    ]);
   }
+
   void test_parse_getAttribute() {
     ht.HtmlUnit htmlUnit = parse("<html><body foo=\"sdfsdf\"></body></html>");
     ht.XmlTagNode htmlNode = htmlUnit.tagNodes[0];
@@ -7886,6 +8554,7 @@
     expect(bodyNode.getAttribute("bar"), null);
     expect(bodyNode.getAttribute(null), null);
   }
+
   void test_parse_getAttributeText() {
     ht.HtmlUnit htmlUnit = parse("<html><body foo=\"sdfsdf\"></body></html>");
     ht.XmlTagNode htmlNode = htmlUnit.tagNodes[0];
@@ -7894,6 +8563,7 @@
     expect(bodyNode.getAttributeText("bar"), null);
     expect(bodyNode.getAttributeText(null), null);
   }
+
   void test_parse_headers() {
     String code = r'''
 <html>
@@ -7905,22 +8575,33 @@
   </body>
 </html>''';
     ht.HtmlUnit htmlUnit = parse(code);
-    _validate(
-        htmlUnit, [_t4("html", [_t4("body", [_t3("h2", "000"), _t4("div")])])]);
+    _validate(htmlUnit, [
+      _t4("html", [
+        _t4("body", [_t3("h2", "000"), _t4("div")])
+      ])
+    ]);
   }
+
   void test_parse_script() {
     ht.HtmlUnit htmlUnit =
         parse("<html><script >here is <p> some</script></html>");
-    _validate(htmlUnit, [_t4("html", [_t3("script", "here is <p> some")])]);
+    _validate(htmlUnit, [
+      _t4("html", [_t3("script", "here is <p> some")])
+    ]);
   }
+
   void test_parse_self_closing() {
     ht.HtmlUnit htmlUnit = parse("<html>foo<br>bar</html>");
-    _validate(htmlUnit, [_t3("html", "foo<br>bar", [_t3("br", "")])]);
+    _validate(htmlUnit, [
+      _t3("html", "foo<br>bar", [_t3("br", "")])
+    ]);
   }
+
   void test_parse_self_closing_declaration() {
     ht.HtmlUnit htmlUnit = parse("<!DOCTYPE html><html>foo</html>");
     _validate(htmlUnit, [_t3("html", "foo")]);
   }
+
   XmlValidator_Attributes _a(List<String> keyValuePairs) =>
       new XmlValidator_Attributes(keyValuePairs);
   XmlValidator_Tag _t(
@@ -7972,18 +8653,23 @@
   void setUp() {
     _context = AnalysisContextFactory.contextWithCore();
   }
+
   @override
   void tearDown() {
     _context = null;
     super.tearDown();
   }
+
   void test_embedded_script() {
     HtmlElementImpl element = _build(r'''
 <html>
 <script type="application/dart">foo=2;</script>
 </html>''');
-    _validate(element, [_s(_l([_v("foo")]))]);
+    _validate(element, [
+      _s(_l([_v("foo")]))
+    ]);
   }
+
   void test_embedded_script_no_content() {
     HtmlElementImpl element = _build(r'''
 <html>
@@ -7991,6 +8677,7 @@
 </html>''');
     _validate(element, [_s(_l())]);
   }
+
   void test_external_script() {
     HtmlElementImpl element = _build(r'''
 <html>
@@ -7998,6 +8685,7 @@
 </html>''');
     _validate(element, [_s2("other.dart")]);
   }
+
   void test_external_script_no_source() {
     HtmlElementImpl element = _build(r'''
 <html>
@@ -8005,6 +8693,7 @@
 </html>''');
     _validate(element, [_s2(null)]);
   }
+
   void test_external_script_with_content() {
     HtmlElementImpl element = _build(r'''
 <html>
@@ -8012,12 +8701,14 @@
 </html>''');
     _validate(element, [_s2("other.dart")]);
   }
+
   void test_no_scripts() {
     HtmlElementImpl element = _build(r'''
 <!DOCTYPE html>
 <html><p></p></html>''');
     _validate(element, []);
   }
+
   void test_two_dart_scripts() {
     HtmlElementImpl element = _build(r'''
 <html>
@@ -8025,8 +8716,12 @@
 <script type="application/dart" src="other.dart"/>
 <script src="dart.js"/>
 </html>''');
-    _validate(element, [_s(_l([_v("bar")])), _s2("other.dart")]);
+    _validate(element, [
+      _s(_l([_v("bar")])),
+      _s2("other.dart")
+    ]);
   }
+
   HtmlElementImpl _build(String contents) {
     TestSource source = new TestSource(
         FileUtilities2.createFile("/test.html").getAbsolutePath(), contents);
@@ -8036,8 +8731,10 @@
     HtmlUnitBuilder builder = new HtmlUnitBuilder(_context);
     return builder.buildHtmlElement(source, _context.parseHtmlUnit(source));
   }
+
   HtmlUnitBuilderTest_ExpectedLibrary _l(
-          [List<HtmlUnitBuilderTest_ExpectedVariable> expectedVariables = HtmlUnitBuilderTest_ExpectedVariable.EMPTY_LIST]) =>
+          [List<HtmlUnitBuilderTest_ExpectedVariable> expectedVariables =
+              HtmlUnitBuilderTest_ExpectedVariable.EMPTY_LIST]) =>
       new HtmlUnitBuilderTest_ExpectedLibrary(this, expectedVariables);
   _ExpectedScript _s(HtmlUnitBuilderTest_ExpectedLibrary expectedLibrary) =>
       new _ExpectedScript.con1(expectedLibrary);
@@ -8061,7 +8758,8 @@
   final HtmlUnitBuilderTest HtmlUnitBuilderTest_this;
   final List<HtmlUnitBuilderTest_ExpectedVariable> _expectedVariables;
   HtmlUnitBuilderTest_ExpectedLibrary(this.HtmlUnitBuilderTest_this,
-      [this._expectedVariables = HtmlUnitBuilderTest_ExpectedVariable.EMPTY_LIST]);
+      [this._expectedVariables =
+          HtmlUnitBuilderTest_ExpectedVariable.EMPTY_LIST]);
   void _validate(int scriptIndex, EmbeddedHtmlScriptElementImpl script) {
     LibraryElement library = script.scriptLibrary;
     expect(library, isNotNull, reason: "script $scriptIndex");
@@ -8123,18 +8821,22 @@
   }
 
   void test_invalidUri() {
-    _verify(r'''
+    _verify(
+        r'''
 <html>
 <script type='application/dart' src='ht:'/>
-</html>''', [HtmlWarningCode.INVALID_URI]);
+</html>''',
+        [HtmlWarningCode.INVALID_URI]);
     _assertErrorLocation2(_errors[0], "ht:");
   }
 
   void test_uriDoesNotExist() {
-    _verify(r'''
+    _verify(
+        r'''
 <html>
 <script type='application/dart' src='other.dart'/>
-</html>''', [HtmlWarningCode.URI_DOES_NOT_EXIST]);
+</html>''',
+        [HtmlWarningCode.URI_DOES_NOT_EXIST]);
     _assertErrorLocation2(_errors[0], "other.dart");
   }
 
@@ -8201,41 +8903,49 @@
     _referenceGraph = new DirectedGraph<ConstantEvaluationTarget>();
     _head = ElementFactory.topLevelVariableElement2("v1");
   }
+
   void test_visitSimpleIdentifier_const() {
     _visitNode(_makeTailVariable("v2", true));
     _assertOneArc(_tail);
   }
+
   void test_visitSimpleIdentifier_nonConst() {
     _visitNode(_makeTailVariable("v2", false));
     _assertOneArc(_tail);
   }
+
   void test_visitSuperConstructorInvocation_const() {
     _visitNode(_makeTailSuperConstructorInvocation("A", true));
     _assertOneArc(_tail);
   }
+
   void test_visitSuperConstructorInvocation_nonConst() {
     _visitNode(_makeTailSuperConstructorInvocation("A", false));
     _assertOneArc(_tail);
   }
+
   void test_visitSuperConstructorInvocation_unresolved() {
     SuperConstructorInvocation superConstructorInvocation =
         AstFactory.superConstructorInvocation();
     _visitNode(superConstructorInvocation);
     _assertNoArcs();
   }
+
   void _assertNoArcs() {
     Set<ConstantEvaluationTarget> tails = _referenceGraph.getTails(_head);
     expect(tails, hasLength(0));
   }
+
   void _assertOneArc(Element tail) {
     Set<ConstantEvaluationTarget> tails = _referenceGraph.getTails(_head);
     expect(tails, hasLength(1));
     expect(tails.first, same(tail));
   }
+
   ReferenceFinder _createReferenceFinder(ConstantEvaluationTarget source) =>
       new ReferenceFinder((ConstantEvaluationTarget dependency) {
-    _referenceGraph.addEdge(source, dependency);
-  });
+        _referenceGraph.addEdge(source, dependency);
+      });
   SuperConstructorInvocation _makeTailSuperConstructorInvocation(
       String name, bool isConst) {
     List<ConstructorInitializer> initializers =
@@ -8255,6 +8965,7 @@
     superConstructorInvocation.staticElement = constructorElement;
     return superConstructorInvocation;
   }
+
   SimpleIdentifier _makeTailVariable(String name, bool isConst) {
     VariableDeclaration variableDeclaration =
         AstFactory.variableDeclaration(name);
@@ -8268,6 +8979,7 @@
     identifier.staticElement = variableElement;
     return identifier;
   }
+
   void _visitNode(AstNode node) {
     node.accept(_createReferenceFinder(_head));
   }
@@ -8277,11 +8989,12 @@
 class SDKLibrariesReaderTest extends EngineTestCase {
   void test_readFrom_dart2js() {
     LibraryMap libraryMap = new SdkLibrariesReader(true).readFromFile(
-        FileUtilities2.createFile("/libs.dart"), r'''
+        FileUtilities2.createFile("/libs.dart"),
+        r'''
 final Map<String, LibraryInfo> LIBRARIES = const <String, LibraryInfo> {
   'first' : const LibraryInfo(
     'first/first.dart',
-    category: 'First',
+    categories: 'Client',
     documented: true,
     platforms: VM_PLATFORM,
     dart2jsPath: 'first/first_dart2js.dart'),
@@ -8290,7 +9003,7 @@
     expect(libraryMap.size(), 1);
     SdkLibrary first = libraryMap.getLibrary("dart:first");
     expect(first, isNotNull);
-    expect(first.category, "First");
+    expect(first.category, "Client");
     expect(first.path, "first/first_dart2js.dart");
     expect(first.shortName, "dart:first");
     expect(first.isDart2JsLibrary, false);
@@ -8298,25 +9011,28 @@
     expect(first.isImplementation, false);
     expect(first.isVmLibrary, true);
   }
+
   void test_readFrom_empty() {
-    LibraryMap libraryMap = new SdkLibrariesReader(false).readFromFile(
-        FileUtilities2.createFile("/libs.dart"), "");
+    LibraryMap libraryMap = new SdkLibrariesReader(false)
+        .readFromFile(FileUtilities2.createFile("/libs.dart"), "");
     expect(libraryMap, isNotNull);
     expect(libraryMap.size(), 0);
   }
+
   void test_readFrom_normal() {
     LibraryMap libraryMap = new SdkLibrariesReader(false).readFromFile(
-        FileUtilities2.createFile("/libs.dart"), r'''
+        FileUtilities2.createFile("/libs.dart"),
+        r'''
 final Map<String, LibraryInfo> LIBRARIES = const <String, LibraryInfo> {
   'first' : const LibraryInfo(
     'first/first.dart',
-    category: 'First',
+    categories: 'Client',
     documented: true,
     platforms: VM_PLATFORM),
 
   'second' : const LibraryInfo(
     'second/second.dart',
-    category: 'Second',
+    categories: 'Server',
     documented: false,
     implementation: true,
     platforms: 0),
@@ -8325,7 +9041,7 @@
     expect(libraryMap.size(), 2);
     SdkLibrary first = libraryMap.getLibrary("dart:first");
     expect(first, isNotNull);
-    expect(first.category, "First");
+    expect(first.category, "Client");
     expect(first.path, "first/first.dart");
     expect(first.shortName, "dart:first");
     expect(first.isDart2JsLibrary, false);
@@ -8334,7 +9050,7 @@
     expect(first.isVmLibrary, true);
     SdkLibrary second = libraryMap.getLibrary("dart:second");
     expect(second, isNotNull);
-    expect(second.category, "Second");
+    expect(second.category, "Server");
     expect(second.path, "second/second.dart");
     expect(second.shortName, "dart:second");
     expect(second.isDart2JsLibrary, false);
@@ -8352,14 +9068,25 @@
   }
 }
 
+class TestAnalysisContext_ConstantFinderTest extends TestAnalysisContext {
+  bool invoked = false;
+  TestAnalysisContext_ConstantFinderTest();
+
+  @override
+  InternalAnalysisContext getContextFor(Source source) {
+    return this;
+  }
+}
+
 /**
  * Instances of the class `ToSourceVisitorTest`
  */
 @reflectiveTest
 class ToSourceVisitorTest extends EngineTestCase {
   void fail_visitHtmlScriptTagNode_attributes_content() {
-    _assertSource("<script type='application/dart'>f() {}</script>", HtmlFactory
-        .scriptTagWithContent(
+    _assertSource(
+        "<script type='application/dart'>f() {}</script>",
+        HtmlFactory.scriptTagWithContent(
             "f() {}", [HtmlFactory.attribute("type", "'application/dart'")]));
   }
 
@@ -8369,8 +9096,10 @@
   }
 
   void test_visitHtmlScriptTagNode_attributes_noContent() {
-    _assertSource("<script type='application/dart'/>", HtmlFactory
-        .scriptTag([HtmlFactory.attribute("type", "'application/dart'")]));
+    _assertSource(
+        "<script type='application/dart'/>",
+        HtmlFactory
+            .scriptTag([HtmlFactory.attribute("type", "'application/dart'")]));
   }
 
   void test_visitHtmlScriptTagNode_noAttributes_noContent() {
@@ -8467,6 +9196,7 @@
       fail(buffer.toString());
     }
   }
+
   /**
    * Set the tags to be expected when visiting
    *
@@ -8478,6 +9208,7 @@
     _expectTags(expected, expectedTags);
     this._expectedTagsInOrderVisited = expected;
   }
+
   @override
   Object visitHtmlUnit(ht.HtmlUnit node) {
     if (node.parent != null) {
@@ -8489,6 +9220,7 @@
     _validateNode(node);
     return super.visitHtmlUnit(node);
   }
+
   @override
   Object visitXmlAttributeNode(ht.XmlAttributeNode actual) {
     if (actual.parent is! ht.XmlTagNode) {
@@ -8518,6 +9250,7 @@
     _validateNode(actual);
     return super.visitXmlAttributeNode(actual);
   }
+
   @override
   Object visitXmlTagNode(ht.XmlTagNode actual) {
     if (!(actual.parent is ht.HtmlUnit || actual.parent is ht.XmlTagNode)) {
@@ -8591,6 +9324,7 @@
     _validateNode(actual);
     return super.visitXmlTagNode(actual);
   }
+
   /**
    * Append the specified tags to the array in depth first order
    *
@@ -8604,6 +9338,7 @@
       _expectTags(expected, tag._children);
     }
   }
+
   void _validateNode(ht.XmlNode node) {
     if (node.beginToken == null) {
       _errors.add("No begin token for ${node.runtimeType}");
@@ -8666,6 +9401,7 @@
       _validateExternal(scriptIndex, script);
     }
   }
+
   void _validateEmbedded(int scriptIndex, HtmlScriptElement script) {
     if (script is! EmbeddedHtmlScriptElementImpl) {
       fail(
@@ -8675,6 +9411,7 @@
         script as EmbeddedHtmlScriptElementImpl;
     _expectedLibrary._validate(scriptIndex, embeddedScript);
   }
+
   void _validateExternal(int scriptIndex, HtmlScriptElement script) {
     if (script is! ExternalHtmlScriptElementImpl) {
       fail(
diff --git a/pkg/analyzer/test/generated/ast_test.dart b/pkg/analyzer/test/generated/ast_test.dart
index 115a514..e25c253 100644
--- a/pkg/analyzer/test/generated/ast_test.dart
+++ b/pkg/analyzer/test/generated/ast_test.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.
 
-// This code was auto-generated, is not intended to be edited, and is subject to
-// significant change. Please see the README file for more information.
-
 library engine.ast_test;
 
 import 'package:analyzer/src/generated/ast.dart';
@@ -17,11 +14,12 @@
 import 'package:unittest/unittest.dart';
 
 import '../reflective_tests.dart';
+import '../utils.dart';
 import 'parser_test.dart' show ParserTestCase;
 import 'test_support.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   runReflectiveTests(BreadthFirstVisitorTest);
   runReflectiveTests(ClassDeclarationTest);
   runReflectiveTests(ClassTypeAliasTest);
@@ -132,7 +130,8 @@
         (obj) => obj is FunctionDeclaration, FunctionDeclaration, nodes[3]);
     EngineTestCase.assertInstanceOf(
         (obj) => obj is FunctionDeclarationStatement,
-        FunctionDeclarationStatement, nodes[27]);
+        FunctionDeclarationStatement,
+        nodes[27]);
     EngineTestCase.assertInstanceOf(
         (obj) => obj is IntegerLiteral, IntegerLiteral, nodes[58]);
     //3
@@ -148,10 +147,14 @@
         .constructorDeclaration(AstFactory.identifier3("Test"), null,
             AstFactory.formalParameterList(), initializers);
     ConstructorDeclaration aConstructor = AstFactory.constructorDeclaration(
-        AstFactory.identifier3("Test"), "a", AstFactory.formalParameterList(),
+        AstFactory.identifier3("Test"),
+        "a",
+        AstFactory.formalParameterList(),
         initializers);
     ConstructorDeclaration bConstructor = AstFactory.constructorDeclaration(
-        AstFactory.identifier3("Test"), "b", AstFactory.formalParameterList(),
+        AstFactory.identifier3("Test"),
+        "b",
+        AstFactory.formalParameterList(),
         initializers);
     ClassDeclaration clazz = AstFactory.classDeclaration(null, "Test", null,
         null, null, null, [defaultConstructor, aConstructor, bConstructor]);
@@ -165,8 +168,8 @@
     VariableDeclaration aVar = AstFactory.variableDeclaration("a");
     VariableDeclaration bVar = AstFactory.variableDeclaration("b");
     VariableDeclaration cVar = AstFactory.variableDeclaration("c");
-    ClassDeclaration clazz = AstFactory.classDeclaration(null, "Test", null,
-        null, null, null, [
+    ClassDeclaration clazz =
+        AstFactory.classDeclaration(null, "Test", null, null, null, null, [
       AstFactory.fieldDeclaration2(false, null, [aVar]),
       AstFactory.fieldDeclaration2(false, null, [bVar, cVar])
     ]);
@@ -189,10 +192,16 @@
   }
 
   void test_isAbstract() {
-    expect(AstFactory.classDeclaration(
-        null, "A", null, null, null, null).isAbstract, isFalse);
-    expect(AstFactory.classDeclaration(
-        Keyword.ABSTRACT, "B", null, null, null, null).isAbstract, isTrue);
+    expect(
+        AstFactory
+            .classDeclaration(null, "A", null, null, null, null)
+            .isAbstract,
+        isFalse);
+    expect(
+        AstFactory
+            .classDeclaration(Keyword.ABSTRACT, "B", null, null, null, null)
+            .isAbstract,
+        isTrue);
   }
 }
 
@@ -202,8 +211,11 @@
     expect(
         AstFactory.classTypeAlias("A", null, null, null, null, null).isAbstract,
         isFalse);
-    expect(AstFactory.classTypeAlias(
-        "B", null, Keyword.ABSTRACT, null, null, null).isAbstract, isTrue);
+    expect(
+        AstFactory
+            .classTypeAlias("B", null, Keyword.ABSTRACT, null, null, null)
+            .isAbstract,
+        isTrue);
   }
 }
 
@@ -517,8 +529,13 @@
     Token externalKeyword = TokenFactory.tokenFromKeyword(Keyword.EXTERNAL);
     externalKeyword.offset = 14;
     ConstructorDeclaration declaration = AstFactory.constructorDeclaration2(
-        Keyword.CONST, Keyword.FACTORY, AstFactory.identifier3('int'), null,
-        null, null, null);
+        Keyword.CONST,
+        Keyword.FACTORY,
+        AstFactory.identifier3('int'),
+        null,
+        null,
+        null,
+        null);
     declaration.externalKeyword = externalKeyword;
     declaration.constKeyword.offset = 8;
     Token factoryKeyword = declaration.factoryKeyword;
@@ -530,8 +547,13 @@
     Token token = TokenFactory.tokenFromKeyword(Keyword.EXTERNAL);
     token.offset = 0;
     ConstructorDeclaration declaration = AstFactory.constructorDeclaration2(
-        Keyword.CONST, Keyword.FACTORY, AstFactory.identifier3('int'), null,
-        null, null, null);
+        Keyword.CONST,
+        Keyword.FACTORY,
+        AstFactory.identifier3('int'),
+        null,
+        null,
+        null,
+        null);
     declaration.externalKeyword = token;
     declaration.constKeyword.offset = 9;
     declaration.factoryKeyword.offset = 15;
@@ -540,7 +562,12 @@
 
   void test_firstTokenAfterCommentAndMetadata_constOnly() {
     ConstructorDeclaration declaration = AstFactory.constructorDeclaration2(
-        Keyword.CONST, null, AstFactory.identifier3('int'), null, null, null,
+        Keyword.CONST,
+        null,
+        AstFactory.identifier3('int'),
+        null,
+        null,
+        null,
         null);
     expect(declaration.firstTokenAfterCommentAndMetadata,
         declaration.constKeyword);
@@ -556,7 +583,12 @@
 
   void test_firstTokenAfterCommentAndMetadata_factoryOnly() {
     ConstructorDeclaration declaration = AstFactory.constructorDeclaration2(
-        null, Keyword.FACTORY, AstFactory.identifier3('int'), null, null, null,
+        null,
+        Keyword.FACTORY,
+        AstFactory.identifier3('int'),
+        null,
+        null,
+        null,
         null);
     expect(declaration.firstTokenAfterCommentAndMetadata,
         declaration.factoryKeyword);
@@ -991,8 +1023,9 @@
   }
 
   void test_inDeclarationContext_constructorDeclaration() {
-    SimpleIdentifier identifier = AstFactory.constructorDeclaration(
-        AstFactory.identifier3("C"), "c", null, null).name;
+    SimpleIdentifier identifier = AstFactory
+        .constructorDeclaration(AstFactory.identifier3("C"), "c", null, null)
+        .name;
     expect(identifier.inDeclarationContext(), isTrue);
   }
 
@@ -1158,7 +1191,8 @@
 
   void test_isQualified_inMethodInvocation_withTarget() {
     MethodInvocation invocation = AstFactory.methodInvocation(
-        AstFactory.identifier3("target"), "test",
+        AstFactory.identifier3("target"),
+        "test",
         [AstFactory.identifier3("arg0")]);
     SimpleIdentifier identifier = invocation.methodName;
     expect(identifier.isQualified, isTrue);
@@ -1263,72 +1297,126 @@
 @reflectiveTest
 class SimpleStringLiteralTest extends ParserTestCase {
   void test_contentsEnd() {
-    expect(new SimpleStringLiteral(
-        TokenFactory.tokenFromString("'X'"), "X").contentsEnd, 2);
-    expect(new SimpleStringLiteral(
-        TokenFactory.tokenFromString('"X"'), "X").contentsEnd, 2);
+    expect(
+        new SimpleStringLiteral(TokenFactory.tokenFromString("'X'"), "X")
+            .contentsEnd,
+        2);
+    expect(
+        new SimpleStringLiteral(TokenFactory.tokenFromString('"X"'), "X")
+            .contentsEnd,
+        2);
 
-    expect(new SimpleStringLiteral(
-        TokenFactory.tokenFromString('"""X"""'), "X").contentsEnd, 4);
-    expect(new SimpleStringLiteral(
-        TokenFactory.tokenFromString("'''X'''"), "X").contentsEnd, 4);
-    expect(new SimpleStringLiteral(
-        TokenFactory.tokenFromString("'''  \nX'''"), "X").contentsEnd, 7);
+    expect(
+        new SimpleStringLiteral(TokenFactory.tokenFromString('"""X"""'), "X")
+            .contentsEnd,
+        4);
+    expect(
+        new SimpleStringLiteral(TokenFactory.tokenFromString("'''X'''"), "X")
+            .contentsEnd,
+        4);
+    expect(
+        new SimpleStringLiteral(
+            TokenFactory.tokenFromString("'''  \nX'''"), "X").contentsEnd,
+        7);
 
-    expect(new SimpleStringLiteral(
-        TokenFactory.tokenFromString("r'X'"), "X").contentsEnd, 3);
-    expect(new SimpleStringLiteral(
-        TokenFactory.tokenFromString('r"X"'), "X").contentsEnd, 3);
+    expect(
+        new SimpleStringLiteral(TokenFactory.tokenFromString("r'X'"), "X")
+            .contentsEnd,
+        3);
+    expect(
+        new SimpleStringLiteral(TokenFactory.tokenFromString('r"X"'), "X")
+            .contentsEnd,
+        3);
 
-    expect(new SimpleStringLiteral(
-        TokenFactory.tokenFromString('r"""X"""'), "X").contentsEnd, 5);
-    expect(new SimpleStringLiteral(
-        TokenFactory.tokenFromString("r'''X'''"), "X").contentsEnd, 5);
-    expect(new SimpleStringLiteral(
-        TokenFactory.tokenFromString("r'''  \nX'''"), "X").contentsEnd, 8);
+    expect(
+        new SimpleStringLiteral(TokenFactory.tokenFromString('r"""X"""'), "X")
+            .contentsEnd,
+        5);
+    expect(
+        new SimpleStringLiteral(TokenFactory.tokenFromString("r'''X'''"), "X")
+            .contentsEnd,
+        5);
+    expect(
+        new SimpleStringLiteral(
+            TokenFactory.tokenFromString("r'''  \nX'''"), "X").contentsEnd,
+        8);
   }
 
   void test_contentsOffset() {
-    expect(new SimpleStringLiteral(
-        TokenFactory.tokenFromString("'X'"), "X").contentsOffset, 1);
-    expect(new SimpleStringLiteral(
-        TokenFactory.tokenFromString("\"X\""), "X").contentsOffset, 1);
-    expect(new SimpleStringLiteral(
-        TokenFactory.tokenFromString("\"\"\"X\"\"\""), "X").contentsOffset, 3);
-    expect(new SimpleStringLiteral(
-        TokenFactory.tokenFromString("'''X'''"), "X").contentsOffset, 3);
-    expect(new SimpleStringLiteral(
-        TokenFactory.tokenFromString("r'X'"), "X").contentsOffset, 2);
-    expect(new SimpleStringLiteral(
-        TokenFactory.tokenFromString("r\"X\""), "X").contentsOffset, 2);
-    expect(new SimpleStringLiteral(
-        TokenFactory.tokenFromString("r\"\"\"X\"\"\""), "X").contentsOffset, 4);
-    expect(new SimpleStringLiteral(
-        TokenFactory.tokenFromString("r'''X'''"), "X").contentsOffset, 4);
+    expect(
+        new SimpleStringLiteral(TokenFactory.tokenFromString("'X'"), "X")
+            .contentsOffset,
+        1);
+    expect(
+        new SimpleStringLiteral(TokenFactory.tokenFromString("\"X\""), "X")
+            .contentsOffset,
+        1);
+    expect(
+        new SimpleStringLiteral(
+            TokenFactory.tokenFromString("\"\"\"X\"\"\""), "X").contentsOffset,
+        3);
+    expect(
+        new SimpleStringLiteral(TokenFactory.tokenFromString("'''X'''"), "X")
+            .contentsOffset,
+        3);
+    expect(
+        new SimpleStringLiteral(TokenFactory.tokenFromString("r'X'"), "X")
+            .contentsOffset,
+        2);
+    expect(
+        new SimpleStringLiteral(TokenFactory.tokenFromString("r\"X\""), "X")
+            .contentsOffset,
+        2);
+    expect(
+        new SimpleStringLiteral(
+            TokenFactory.tokenFromString("r\"\"\"X\"\"\""), "X").contentsOffset,
+        4);
+    expect(
+        new SimpleStringLiteral(TokenFactory.tokenFromString("r'''X'''"), "X")
+            .contentsOffset,
+        4);
     // leading whitespace
-    expect(new SimpleStringLiteral(
-        TokenFactory.tokenFromString("''' \ \nX''"), "X").contentsOffset, 6);
-    expect(new SimpleStringLiteral(
-        TokenFactory.tokenFromString('r""" \ \nX"""'), "X").contentsOffset, 7);
+    expect(
+        new SimpleStringLiteral(
+            TokenFactory.tokenFromString("''' \ \nX''"), "X").contentsOffset,
+        6);
+    expect(
+        new SimpleStringLiteral(
+            TokenFactory.tokenFromString('r""" \ \nX"""'), "X").contentsOffset,
+        7);
   }
 
   void test_isMultiline() {
-    expect(new SimpleStringLiteral(
-        TokenFactory.tokenFromString("'X'"), "X").isMultiline, isFalse);
-    expect(new SimpleStringLiteral(
-        TokenFactory.tokenFromString("r'X'"), "X").isMultiline, isFalse);
-    expect(new SimpleStringLiteral(
-        TokenFactory.tokenFromString("\"X\""), "X").isMultiline, isFalse);
-    expect(new SimpleStringLiteral(
-        TokenFactory.tokenFromString("r\"X\""), "X").isMultiline, isFalse);
-    expect(new SimpleStringLiteral(
-        TokenFactory.tokenFromString("'''X'''"), "X").isMultiline, isTrue);
-    expect(new SimpleStringLiteral(
-        TokenFactory.tokenFromString("r'''X'''"), "X").isMultiline, isTrue);
-    expect(new SimpleStringLiteral(
+    expect(
+        new SimpleStringLiteral(TokenFactory.tokenFromString("'X'"), "X")
+            .isMultiline,
+        isFalse);
+    expect(
+        new SimpleStringLiteral(TokenFactory.tokenFromString("r'X'"), "X")
+            .isMultiline,
+        isFalse);
+    expect(
+        new SimpleStringLiteral(TokenFactory.tokenFromString("\"X\""), "X")
+            .isMultiline,
+        isFalse);
+    expect(
+        new SimpleStringLiteral(TokenFactory.tokenFromString("r\"X\""), "X")
+            .isMultiline,
+        isFalse);
+    expect(
+        new SimpleStringLiteral(TokenFactory.tokenFromString("'''X'''"), "X")
+            .isMultiline,
+        isTrue);
+    expect(
+        new SimpleStringLiteral(TokenFactory.tokenFromString("r'''X'''"), "X")
+            .isMultiline,
+        isTrue);
+    expect(
+        new SimpleStringLiteral(
             TokenFactory.tokenFromString("\"\"\"X\"\"\""), "X").isMultiline,
         isTrue);
-    expect(new SimpleStringLiteral(
+    expect(
+        new SimpleStringLiteral(
             TokenFactory.tokenFromString("r\"\"\"X\"\"\""), "X").isMultiline,
         isTrue);
   }
@@ -1337,20 +1425,34 @@
     expect(
         new SimpleStringLiteral(TokenFactory.tokenFromString("'X'"), "X").isRaw,
         isFalse);
-    expect(new SimpleStringLiteral(
-        TokenFactory.tokenFromString("\"X\""), "X").isRaw, isFalse);
-    expect(new SimpleStringLiteral(
-        TokenFactory.tokenFromString("\"\"\"X\"\"\""), "X").isRaw, isFalse);
-    expect(new SimpleStringLiteral(
-        TokenFactory.tokenFromString("'''X'''"), "X").isRaw, isFalse);
-    expect(new SimpleStringLiteral(
-        TokenFactory.tokenFromString("r'X'"), "X").isRaw, isTrue);
-    expect(new SimpleStringLiteral(
-        TokenFactory.tokenFromString("r\"X\""), "X").isRaw, isTrue);
-    expect(new SimpleStringLiteral(
-        TokenFactory.tokenFromString("r\"\"\"X\"\"\""), "X").isRaw, isTrue);
-    expect(new SimpleStringLiteral(
-        TokenFactory.tokenFromString("r'''X'''"), "X").isRaw, isTrue);
+    expect(
+        new SimpleStringLiteral(TokenFactory.tokenFromString("\"X\""), "X")
+            .isRaw,
+        isFalse);
+    expect(
+        new SimpleStringLiteral(
+            TokenFactory.tokenFromString("\"\"\"X\"\"\""), "X").isRaw,
+        isFalse);
+    expect(
+        new SimpleStringLiteral(TokenFactory.tokenFromString("'''X'''"), "X")
+            .isRaw,
+        isFalse);
+    expect(
+        new SimpleStringLiteral(TokenFactory.tokenFromString("r'X'"), "X")
+            .isRaw,
+        isTrue);
+    expect(
+        new SimpleStringLiteral(TokenFactory.tokenFromString("r\"X\""), "X")
+            .isRaw,
+        isTrue);
+    expect(
+        new SimpleStringLiteral(
+            TokenFactory.tokenFromString("r\"\"\"X\"\"\""), "X").isRaw,
+        isTrue);
+    expect(
+        new SimpleStringLiteral(TokenFactory.tokenFromString("r'''X'''"), "X")
+            .isRaw,
+        isTrue);
   }
 
   void test_isSingleQuoted() {
@@ -1550,8 +1652,10 @@
 @reflectiveTest
 class ToSourceVisitorTest extends EngineTestCase {
   void test_visitAdjacentStrings() {
-    _assertSource("'a' 'b'", AstFactory
-        .adjacentStrings([AstFactory.string2("a"), AstFactory.string2("b")]));
+    _assertSource(
+        "'a' 'b'",
+        AstFactory.adjacentStrings(
+            [AstFactory.string2("a"), AstFactory.string2("b")]));
   }
 
   void test_visitAnnotation_constant() {
@@ -1559,18 +1663,24 @@
   }
 
   void test_visitAnnotation_constructor() {
-    _assertSource("@A.c()", AstFactory.annotation2(AstFactory.identifier3("A"),
-        AstFactory.identifier3("c"), AstFactory.argumentList()));
+    _assertSource(
+        "@A.c()",
+        AstFactory.annotation2(AstFactory.identifier3("A"),
+            AstFactory.identifier3("c"), AstFactory.argumentList()));
   }
 
   void test_visitArgumentList() {
-    _assertSource("(a, b)", AstFactory.argumentList(
-        [AstFactory.identifier3("a"), AstFactory.identifier3("b")]));
+    _assertSource(
+        "(a, b)",
+        AstFactory.argumentList(
+            [AstFactory.identifier3("a"), AstFactory.identifier3("b")]));
   }
 
   void test_visitAsExpression() {
-    _assertSource("e as T", AstFactory.asExpression(
-        AstFactory.identifier3("e"), AstFactory.typeName4("T")));
+    _assertSource(
+        "e as T",
+        AstFactory.asExpression(
+            AstFactory.identifier3("e"), AstFactory.typeName4("T")));
   }
 
   void test_visitAssertStatement() {
@@ -1579,20 +1689,22 @@
   }
 
   void test_visitAssignmentExpression() {
-    _assertSource("a = b", AstFactory.assignmentExpression(
-        AstFactory.identifier3("a"), TokenType.EQ,
-        AstFactory.identifier3("b")));
+    _assertSource(
+        "a = b",
+        AstFactory.assignmentExpression(AstFactory.identifier3("a"),
+            TokenType.EQ, AstFactory.identifier3("b")));
   }
 
   void test_visitAwaitExpression() {
     _assertSource(
-        "await e;", AstFactory.awaitExpression(AstFactory.identifier3("e")));
+        "await e", AstFactory.awaitExpression(AstFactory.identifier3("e")));
   }
 
   void test_visitBinaryExpression() {
-    _assertSource("a + b", AstFactory.binaryExpression(
-        AstFactory.identifier3("a"), TokenType.PLUS,
-        AstFactory.identifier3("b")));
+    _assertSource(
+        "a + b",
+        AstFactory.binaryExpression(AstFactory.identifier3("a"), TokenType.PLUS,
+            AstFactory.identifier3("b")));
   }
 
   void test_visitBlock_empty() {
@@ -1600,8 +1712,10 @@
   }
 
   void test_visitBlock_nonEmpty() {
-    _assertSource("{break; break;}", AstFactory
-        .block([AstFactory.breakStatement(), AstFactory.breakStatement()]));
+    _assertSource(
+        "{break; break;}",
+        AstFactory
+            .block([AstFactory.breakStatement(), AstFactory.breakStatement()]));
   }
 
   void test_visitBlockFunctionBody_async() {
@@ -1641,27 +1755,30 @@
   }
 
   void test_visitCascadeExpression_field() {
-    _assertSource("a..b..c", AstFactory.cascadeExpression(
-        AstFactory.identifier3("a"), [
-      AstFactory.cascadedPropertyAccess("b"),
-      AstFactory.cascadedPropertyAccess("c")
-    ]));
+    _assertSource(
+        "a..b..c",
+        AstFactory.cascadeExpression(AstFactory.identifier3("a"), [
+          AstFactory.cascadedPropertyAccess("b"),
+          AstFactory.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))
-    ]));
+    _assertSource(
+        "a..[0]..[1]",
+        AstFactory.cascadeExpression(AstFactory.identifier3("a"), [
+          AstFactory.cascadedIndexExpression(AstFactory.integer(0)),
+          AstFactory.cascadedIndexExpression(AstFactory.integer(1))
+        ]));
   }
 
   void test_visitCascadeExpression_method() {
-    _assertSource("a..b()..c()", AstFactory.cascadeExpression(
-        AstFactory.identifier3("a"), [
-      AstFactory.cascadedMethodInvocation("b"),
-      AstFactory.cascadedMethodInvocation("c")
-    ]));
+    _assertSource(
+        "a..b()..c()",
+        AstFactory.cascadeExpression(AstFactory.identifier3("a"), [
+          AstFactory.cascadedMethodInvocation("b"),
+          AstFactory.cascadedMethodInvocation("c")
+        ]));
   }
 
   void test_visitCatchClause_catch_noStack() {
@@ -1683,8 +1800,10 @@
   }
 
   void test_visitClassDeclaration_abstract() {
-    _assertSource("abstract class C {}", AstFactory.classDeclaration(
-        Keyword.ABSTRACT, "C", null, null, null, null));
+    _assertSource(
+        "abstract class C {}",
+        AstFactory.classDeclaration(
+            Keyword.ABSTRACT, "C", null, null, null, null));
   }
 
   void test_visitClassDeclaration_empty() {
@@ -1693,92 +1812,140 @@
   }
 
   void test_visitClassDeclaration_extends() {
-    _assertSource("class C extends A {}", AstFactory.classDeclaration(null, "C",
-        null, AstFactory.extendsClause(AstFactory.typeName4("A")), null, null));
+    _assertSource(
+        "class C extends A {}",
+        AstFactory.classDeclaration(null, "C", null,
+            AstFactory.extendsClause(AstFactory.typeName4("A")), null, null));
   }
 
   void test_visitClassDeclaration_extends_implements() {
-    _assertSource("class C extends A implements B {}", AstFactory
-        .classDeclaration(null, "C", null,
-            AstFactory.extendsClause(AstFactory.typeName4("A")), null,
+    _assertSource(
+        "class C extends A implements B {}",
+        AstFactory.classDeclaration(
+            null,
+            "C",
+            null,
+            AstFactory.extendsClause(AstFactory.typeName4("A")),
+            null,
             AstFactory.implementsClause([AstFactory.typeName4("B")])));
   }
 
   void test_visitClassDeclaration_extends_with() {
-    _assertSource("class C extends A with M {}", AstFactory.classDeclaration(
-        null, "C", null, AstFactory.extendsClause(AstFactory.typeName4("A")),
-        AstFactory.withClause([AstFactory.typeName4("M")]), null));
+    _assertSource(
+        "class C extends A with M {}",
+        AstFactory.classDeclaration(
+            null,
+            "C",
+            null,
+            AstFactory.extendsClause(AstFactory.typeName4("A")),
+            AstFactory.withClause([AstFactory.typeName4("M")]),
+            null));
   }
 
   void test_visitClassDeclaration_extends_with_implements() {
-    _assertSource("class C extends A with M implements B {}", AstFactory
-        .classDeclaration(null, "C", null,
+    _assertSource(
+        "class C extends A with M implements B {}",
+        AstFactory.classDeclaration(
+            null,
+            "C",
+            null,
             AstFactory.extendsClause(AstFactory.typeName4("A")),
             AstFactory.withClause([AstFactory.typeName4("M")]),
             AstFactory.implementsClause([AstFactory.typeName4("B")])));
   }
 
   void test_visitClassDeclaration_implements() {
-    _assertSource("class C implements B {}", AstFactory.classDeclaration(null,
-        "C", null, null, null,
-        AstFactory.implementsClause([AstFactory.typeName4("B")])));
+    _assertSource(
+        "class C implements B {}",
+        AstFactory.classDeclaration(null, "C", null, null, null,
+            AstFactory.implementsClause([AstFactory.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")])
-    ]));
+    _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")])
+        ]));
   }
 
   void test_visitClassDeclaration_parameters() {
-    _assertSource("class C<E> {}", AstFactory.classDeclaration(
-        null, "C", AstFactory.typeParameterList(["E"]), null, null, null));
+    _assertSource(
+        "class C<E> {}",
+        AstFactory.classDeclaration(
+            null, "C", AstFactory.typeParameterList(["E"]), null, null, null));
   }
 
   void test_visitClassDeclaration_parameters_extends() {
-    _assertSource("class C<E> extends A {}", AstFactory.classDeclaration(null,
-        "C", AstFactory.typeParameterList(["E"]),
-        AstFactory.extendsClause(AstFactory.typeName4("A")), null, null));
+    _assertSource(
+        "class C<E> extends A {}",
+        AstFactory.classDeclaration(
+            null,
+            "C",
+            AstFactory.typeParameterList(["E"]),
+            AstFactory.extendsClause(AstFactory.typeName4("A")),
+            null,
+            null));
   }
 
   void test_visitClassDeclaration_parameters_extends_implements() {
-    _assertSource("class C<E> extends A implements B {}", AstFactory
-        .classDeclaration(null, "C", AstFactory.typeParameterList(["E"]),
-            AstFactory.extendsClause(AstFactory.typeName4("A")), null,
+    _assertSource(
+        "class C<E> extends A implements B {}",
+        AstFactory.classDeclaration(
+            null,
+            "C",
+            AstFactory.typeParameterList(["E"]),
+            AstFactory.extendsClause(AstFactory.typeName4("A")),
+            null,
             AstFactory.implementsClause([AstFactory.typeName4("B")])));
   }
 
   void test_visitClassDeclaration_parameters_extends_with() {
-    _assertSource("class C<E> extends A with M {}", AstFactory.classDeclaration(
-        null, "C", AstFactory.typeParameterList(["E"]),
-        AstFactory.extendsClause(AstFactory.typeName4("A")),
-        AstFactory.withClause([AstFactory.typeName4("M")]), null));
+    _assertSource(
+        "class C<E> extends A with M {}",
+        AstFactory.classDeclaration(
+            null,
+            "C",
+            AstFactory.typeParameterList(["E"]),
+            AstFactory.extendsClause(AstFactory.typeName4("A")),
+            AstFactory.withClause([AstFactory.typeName4("M")]),
+            null));
   }
 
   void test_visitClassDeclaration_parameters_extends_with_implements() {
-    _assertSource("class C<E> extends A with M implements B {}", AstFactory
-        .classDeclaration(null, "C", AstFactory.typeParameterList(["E"]),
+    _assertSource(
+        "class C<E> extends A with M implements B {}",
+        AstFactory.classDeclaration(
+            null,
+            "C",
+            AstFactory.typeParameterList(["E"]),
             AstFactory.extendsClause(AstFactory.typeName4("A")),
             AstFactory.withClause([AstFactory.typeName4("M")]),
             AstFactory.implementsClause([AstFactory.typeName4("B")])));
   }
 
   void test_visitClassDeclaration_parameters_implements() {
-    _assertSource("class C<E> implements B {}", AstFactory.classDeclaration(
-        null, "C", AstFactory.typeParameterList(["E"]), null, null,
-        AstFactory.implementsClause([AstFactory.typeName4("B")])));
+    _assertSource(
+        "class C<E> implements B {}",
+        AstFactory.classDeclaration(
+            null,
+            "C",
+            AstFactory.typeParameterList(["E"]),
+            null,
+            null,
+            AstFactory.implementsClause([AstFactory.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")])
-    ]));
+    _assertSource(
+        "class C {var a;}",
+        AstFactory.classDeclaration(null, "C", null, null, null, null, [
+          AstFactory.fieldDeclaration2(
+              false, Keyword.VAR, [AstFactory.variableDeclaration("a")])
+        ]));
   }
 
   void test_visitClassDeclaration_withMetadata() {
@@ -1790,74 +1957,116 @@
   }
 
   void test_visitClassTypeAlias_abstract() {
-    _assertSource("abstract class C = S with M1;", AstFactory.classTypeAlias(
-        "C", null, Keyword.ABSTRACT, AstFactory.typeName4("S"),
-        AstFactory.withClause([AstFactory.typeName4("M1")]), null));
+    _assertSource(
+        "abstract class C = S with M1;",
+        AstFactory.classTypeAlias(
+            "C",
+            null,
+            Keyword.ABSTRACT,
+            AstFactory.typeName4("S"),
+            AstFactory.withClause([AstFactory.typeName4("M1")]),
+            null));
   }
 
   void test_visitClassTypeAlias_abstract_implements() {
-    _assertSource("abstract class C = S with M1 implements I;", AstFactory
-        .classTypeAlias("C", null, Keyword.ABSTRACT, AstFactory.typeName4("S"),
+    _assertSource(
+        "abstract class C = S with M1 implements I;",
+        AstFactory.classTypeAlias(
+            "C",
+            null,
+            Keyword.ABSTRACT,
+            AstFactory.typeName4("S"),
             AstFactory.withClause([AstFactory.typeName4("M1")]),
             AstFactory.implementsClause([AstFactory.typeName4("I")])));
   }
 
   void test_visitClassTypeAlias_generic() {
-    _assertSource("class C<E> = S<E> with M1<E>;", AstFactory.classTypeAlias(
-        "C", AstFactory.typeParameterList(["E"]), null,
-        AstFactory.typeName4("S", [AstFactory.typeName4("E")]),
-        AstFactory.withClause(
-            [AstFactory.typeName4("M1", [AstFactory.typeName4("E")])]), null));
+    _assertSource(
+        "class C<E> = S<E> with M1<E>;",
+        AstFactory.classTypeAlias(
+            "C",
+            AstFactory.typeParameterList(["E"]),
+            null,
+            AstFactory.typeName4("S", [AstFactory.typeName4("E")]),
+            AstFactory.withClause([
+              AstFactory.typeName4("M1", [AstFactory.typeName4("E")])
+            ]),
+            null));
   }
 
   void test_visitClassTypeAlias_implements() {
-    _assertSource("class C = S with M1 implements I;", AstFactory
-        .classTypeAlias("C", null, null, AstFactory.typeName4("S"),
+    _assertSource(
+        "class C = S with M1 implements I;",
+        AstFactory.classTypeAlias(
+            "C",
+            null,
+            null,
+            AstFactory.typeName4("S"),
             AstFactory.withClause([AstFactory.typeName4("M1")]),
             AstFactory.implementsClause([AstFactory.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));
+    _assertSource(
+        "class C = S with M1;",
+        AstFactory.classTypeAlias("C", null, null, AstFactory.typeName4("S"),
+            AstFactory.withClause([AstFactory.typeName4("M1")]), null));
   }
 
   void test_visitClassTypeAlias_parameters_abstract() {
-    _assertSource("abstract class C<E> = S with M1;", AstFactory.classTypeAlias(
-        "C", AstFactory.typeParameterList(["E"]), Keyword.ABSTRACT,
-        AstFactory.typeName4("S"),
-        AstFactory.withClause([AstFactory.typeName4("M1")]), null));
+    _assertSource(
+        "abstract class C<E> = S with M1;",
+        AstFactory.classTypeAlias(
+            "C",
+            AstFactory.typeParameterList(["E"]),
+            Keyword.ABSTRACT,
+            AstFactory.typeName4("S"),
+            AstFactory.withClause([AstFactory.typeName4("M1")]),
+            null));
   }
 
   void test_visitClassTypeAlias_parameters_abstract_implements() {
-    _assertSource("abstract class C<E> = S with M1 implements I;", AstFactory
-        .classTypeAlias("C", AstFactory.typeParameterList(["E"]),
-            Keyword.ABSTRACT, AstFactory.typeName4("S"),
+    _assertSource(
+        "abstract class C<E> = S with M1 implements I;",
+        AstFactory.classTypeAlias(
+            "C",
+            AstFactory.typeParameterList(["E"]),
+            Keyword.ABSTRACT,
+            AstFactory.typeName4("S"),
             AstFactory.withClause([AstFactory.typeName4("M1")]),
             AstFactory.implementsClause([AstFactory.typeName4("I")])));
   }
 
   void test_visitClassTypeAlias_parameters_implements() {
-    _assertSource("class C<E> = S with M1 implements I;", AstFactory
-        .classTypeAlias("C", AstFactory.typeParameterList(["E"]), null,
+    _assertSource(
+        "class C<E> = S with M1 implements I;",
+        AstFactory.classTypeAlias(
+            "C",
+            AstFactory.typeParameterList(["E"]),
+            null,
             AstFactory.typeName4("S"),
             AstFactory.withClause([AstFactory.typeName4("M1")]),
             AstFactory.implementsClause([AstFactory.typeName4("I")])));
   }
 
   void test_visitClassTypeAlias_withMetadata() {
-    ClassTypeAlias declaration = AstFactory.classTypeAlias("C", null, null,
+    ClassTypeAlias declaration = AstFactory.classTypeAlias(
+        "C",
+        null,
+        null,
         AstFactory.typeName4("S"),
-        AstFactory.withClause([AstFactory.typeName4("M1")]), null);
+        AstFactory.withClause([AstFactory.typeName4("M1")]),
+        null);
     declaration.metadata
         .add(AstFactory.annotation(AstFactory.identifier3("deprecated")));
     _assertSource("@deprecated class C = S with M1;", declaration);
   }
 
   void test_visitComment() {
-    _assertSource("", Comment.createBlockComment(
-        <Token>[TokenFactory.tokenFromString("/* comment */")]));
+    _assertSource(
+        "",
+        Comment.createBlockComment(
+            <Token>[TokenFactory.tokenFromString("/* comment */")]));
   }
 
   void test_visitCommentReference() {
@@ -1865,10 +2074,12 @@
   }
 
   void test_visitCompilationUnit_declaration() {
-    _assertSource("var a;", AstFactory.compilationUnit2([
-      AstFactory.topLevelVariableDeclaration2(
-          Keyword.VAR, [AstFactory.variableDeclaration("a")])
-    ]));
+    _assertSource(
+        "var a;",
+        AstFactory.compilationUnit2([
+          AstFactory.topLevelVariableDeclaration2(
+              Keyword.VAR, [AstFactory.variableDeclaration("a")])
+        ]));
   }
 
   void test_visitCompilationUnit_directive() {
@@ -1877,11 +2088,14 @@
   }
 
   void test_visitCompilationUnit_directive_declaration() {
-    _assertSource("library l; var a;", AstFactory.compilationUnit4(
-        [AstFactory.libraryDirective2("l")], [
-      AstFactory.topLevelVariableDeclaration2(
-          Keyword.VAR, [AstFactory.variableDeclaration("a")])
-    ]));
+    _assertSource(
+        "library l; var a;",
+        AstFactory.compilationUnit4([
+          AstFactory.libraryDirective2("l")
+        ], [
+          AstFactory.topLevelVariableDeclaration2(
+              Keyword.VAR, [AstFactory.variableDeclaration("a")])
+        ]));
   }
 
   void test_visitCompilationUnit_empty() {
@@ -1894,91 +2108,143 @@
   }
 
   void test_visitCompilationUnit_script_declaration() {
-    _assertSource("!#/bin/dartvm var a;", AstFactory.compilationUnit6(
-        "!#/bin/dartvm", [
-      AstFactory.topLevelVariableDeclaration2(
-          Keyword.VAR, [AstFactory.variableDeclaration("a")])
-    ]));
+    _assertSource(
+        "!#/bin/dartvm var a;",
+        AstFactory.compilationUnit6("!#/bin/dartvm", [
+          AstFactory.topLevelVariableDeclaration2(
+              Keyword.VAR, [AstFactory.variableDeclaration("a")])
+        ]));
   }
 
   void test_visitCompilationUnit_script_directive() {
-    _assertSource("!#/bin/dartvm library l;", AstFactory.compilationUnit7(
-        "!#/bin/dartvm", [AstFactory.libraryDirective2("l")]));
+    _assertSource(
+        "!#/bin/dartvm library l;",
+        AstFactory.compilationUnit7(
+            "!#/bin/dartvm", [AstFactory.libraryDirective2("l")]));
   }
 
   void test_visitCompilationUnit_script_directives_declarations() {
-    _assertSource("!#/bin/dartvm library l; var a;", AstFactory
-        .compilationUnit8("!#/bin/dartvm", [AstFactory.libraryDirective2("l")],
-            [
-      AstFactory.topLevelVariableDeclaration2(
-          Keyword.VAR, [AstFactory.variableDeclaration("a")])
-    ]));
+    _assertSource(
+        "!#/bin/dartvm library l; var a;",
+        AstFactory.compilationUnit8("!#/bin/dartvm", [
+          AstFactory.libraryDirective2("l")
+        ], [
+          AstFactory.topLevelVariableDeclaration2(
+              Keyword.VAR, [AstFactory.variableDeclaration("a")])
+        ]));
   }
 
   void test_visitConditionalExpression() {
-    _assertSource("a ? b : c", AstFactory.conditionalExpression(
-        AstFactory.identifier3("a"), AstFactory.identifier3("b"),
-        AstFactory.identifier3("c")));
+    _assertSource(
+        "a ? b : c",
+        AstFactory.conditionalExpression(AstFactory.identifier3("a"),
+            AstFactory.identifier3("b"), AstFactory.identifier3("c")));
   }
 
   void test_visitConstructorDeclaration_const() {
-    _assertSource("const C() {}", AstFactory.constructorDeclaration2(
-        Keyword.CONST, null, AstFactory.identifier3("C"), null,
-        AstFactory.formalParameterList(), null,
-        AstFactory.blockFunctionBody2()));
+    _assertSource(
+        "const C() {}",
+        AstFactory.constructorDeclaration2(
+            Keyword.CONST,
+            null,
+            AstFactory.identifier3("C"),
+            null,
+            AstFactory.formalParameterList(),
+            null,
+            AstFactory.blockFunctionBody2()));
   }
 
   void test_visitConstructorDeclaration_external() {
-    _assertSource("external C();", AstFactory.constructorDeclaration(
-        AstFactory.identifier3("C"), null, AstFactory.formalParameterList(),
-        null));
+    _assertSource(
+        "external C();",
+        AstFactory.constructorDeclaration(AstFactory.identifier3("C"), null,
+            AstFactory.formalParameterList(), null));
   }
 
   void test_visitConstructorDeclaration_minimal() {
-    _assertSource("C() {}", AstFactory.constructorDeclaration2(null, null,
-        AstFactory.identifier3("C"), null, AstFactory.formalParameterList(),
-        null, AstFactory.blockFunctionBody2()));
+    _assertSource(
+        "C() {}",
+        AstFactory.constructorDeclaration2(
+            null,
+            null,
+            AstFactory.identifier3("C"),
+            null,
+            AstFactory.formalParameterList(),
+            null,
+            AstFactory.blockFunctionBody2()));
   }
 
   void test_visitConstructorDeclaration_multipleInitializers() {
-    _assertSource("C() : a = b, c = d {}", AstFactory.constructorDeclaration2(
-        null, null, AstFactory.identifier3("C"), null,
-        AstFactory.formalParameterList(), [
-      AstFactory.constructorFieldInitializer(
-          false, "a", AstFactory.identifier3("b")),
-      AstFactory.constructorFieldInitializer(
-          false, "c", AstFactory.identifier3("d"))
-    ], AstFactory.blockFunctionBody2()));
+    _assertSource(
+        "C() : a = b, c = d {}",
+        AstFactory.constructorDeclaration2(
+            null,
+            null,
+            AstFactory.identifier3("C"),
+            null,
+            AstFactory.formalParameterList(),
+            [
+              AstFactory.constructorFieldInitializer(
+                  false, "a", AstFactory.identifier3("b")),
+              AstFactory.constructorFieldInitializer(
+                  false, "c", AstFactory.identifier3("d"))
+            ],
+            AstFactory.blockFunctionBody2()));
   }
 
   void test_visitConstructorDeclaration_multipleParameters() {
-    _assertSource("C(var a, var b) {}", AstFactory.constructorDeclaration2(null,
-        null, AstFactory.identifier3("C"), null, AstFactory.formalParameterList(
-            [
-      AstFactory.simpleFormalParameter(Keyword.VAR, "a"),
-      AstFactory.simpleFormalParameter(Keyword.VAR, "b")
-    ]), null, AstFactory.blockFunctionBody2()));
+    _assertSource(
+        "C(var a, var b) {}",
+        AstFactory.constructorDeclaration2(
+            null,
+            null,
+            AstFactory.identifier3("C"),
+            null,
+            AstFactory.formalParameterList([
+              AstFactory.simpleFormalParameter(Keyword.VAR, "a"),
+              AstFactory.simpleFormalParameter(Keyword.VAR, "b")
+            ]),
+            null,
+            AstFactory.blockFunctionBody2()));
   }
 
   void test_visitConstructorDeclaration_named() {
-    _assertSource("C.m() {}", AstFactory.constructorDeclaration2(null, null,
-        AstFactory.identifier3("C"), "m", AstFactory.formalParameterList(),
-        null, AstFactory.blockFunctionBody2()));
+    _assertSource(
+        "C.m() {}",
+        AstFactory.constructorDeclaration2(
+            null,
+            null,
+            AstFactory.identifier3("C"),
+            "m",
+            AstFactory.formalParameterList(),
+            null,
+            AstFactory.blockFunctionBody2()));
   }
 
   void test_visitConstructorDeclaration_singleInitializer() {
-    _assertSource("C() : a = b {}", AstFactory.constructorDeclaration2(null,
-        null, AstFactory.identifier3("C"), null,
-        AstFactory.formalParameterList(), [
-      AstFactory.constructorFieldInitializer(
-          false, "a", AstFactory.identifier3("b"))
-    ], AstFactory.blockFunctionBody2()));
+    _assertSource(
+        "C() : a = b {}",
+        AstFactory.constructorDeclaration2(
+            null,
+            null,
+            AstFactory.identifier3("C"),
+            null,
+            AstFactory.formalParameterList(),
+            [
+              AstFactory.constructorFieldInitializer(
+                  false, "a", AstFactory.identifier3("b"))
+            ],
+            AstFactory.blockFunctionBody2()));
   }
 
   void test_visitConstructorDeclaration_withMetadata() {
     ConstructorDeclaration declaration = AstFactory.constructorDeclaration2(
-        null, null, AstFactory.identifier3("C"), null,
-        AstFactory.formalParameterList(), null,
+        null,
+        null,
+        AstFactory.identifier3("C"),
+        null,
+        AstFactory.formalParameterList(),
+        null,
         AstFactory.blockFunctionBody2());
     declaration.metadata
         .add(AstFactory.annotation(AstFactory.identifier3("deprecated")));
@@ -1986,13 +2252,17 @@
   }
 
   void test_visitConstructorFieldInitializer_withoutThis() {
-    _assertSource("a = b", AstFactory.constructorFieldInitializer(
-        false, "a", AstFactory.identifier3("b")));
+    _assertSource(
+        "a = b",
+        AstFactory.constructorFieldInitializer(
+            false, "a", AstFactory.identifier3("b")));
   }
 
   void test_visitConstructorFieldInitializer_withThis() {
-    _assertSource("this.a = b", AstFactory.constructorFieldInitializer(
-        true, "a", AstFactory.identifier3("b")));
+    _assertSource(
+        "this.a = b",
+        AstFactory.constructorFieldInitializer(
+            true, "a", AstFactory.identifier3("b")));
   }
 
   void test_visitConstructorName_named_prefix() {
@@ -2006,8 +2276,10 @@
   }
 
   void test_visitConstructorName_unnamed_prefix() {
-    _assertSource("p.C", AstFactory.constructorName(
-        AstFactory.typeName3(AstFactory.identifier5("p", "C")), null));
+    _assertSource(
+        "p.C",
+        AstFactory.constructorName(
+            AstFactory.typeName3(AstFactory.identifier5("p", "C")), null));
   }
 
   void test_visitContinueStatement_label() {
@@ -2019,28 +2291,45 @@
   }
 
   void test_visitDefaultFormalParameter_named_noValue() {
-    _assertSource("p", AstFactory.namedFormalParameter(
-        AstFactory.simpleFormalParameter3("p"), null));
+    _assertSource(
+        "p",
+        AstFactory.namedFormalParameter(
+            AstFactory.simpleFormalParameter3("p"), null));
   }
 
   void test_visitDefaultFormalParameter_named_value() {
-    _assertSource("p : 0", AstFactory.namedFormalParameter(
-        AstFactory.simpleFormalParameter3("p"), AstFactory.integer(0)));
+    _assertSource(
+        "p : 0",
+        AstFactory.namedFormalParameter(
+            AstFactory.simpleFormalParameter3("p"), AstFactory.integer(0)));
   }
 
   void test_visitDefaultFormalParameter_positional_noValue() {
-    _assertSource("p", AstFactory.positionalFormalParameter(
-        AstFactory.simpleFormalParameter3("p"), null));
+    _assertSource(
+        "p",
+        AstFactory.positionalFormalParameter(
+            AstFactory.simpleFormalParameter3("p"), null));
   }
 
   void test_visitDefaultFormalParameter_positional_value() {
-    _assertSource("p = 0", AstFactory.positionalFormalParameter(
-        AstFactory.simpleFormalParameter3("p"), AstFactory.integer(0)));
+    _assertSource(
+        "p = 0",
+        AstFactory.positionalFormalParameter(
+            AstFactory.simpleFormalParameter3("p"), AstFactory.integer(0)));
+  }
+
+  void test_visitDefaultFormalParameter_annotation() {
+    DefaultFormalParameter parameter = AstFactory.positionalFormalParameter(
+        AstFactory.simpleFormalParameter3("p"), AstFactory.integer(0));
+    parameter.metadata.add(AstFactory.annotation(AstFactory.identifier3("A")));
+    _assertSource('@A p = 0', parameter);
   }
 
   void test_visitDoStatement() {
-    _assertSource("do {} while (c);", AstFactory.doStatement(
-        AstFactory.block(), AstFactory.identifier3("c")));
+    _assertSource(
+        "do {} while (c);",
+        AstFactory.doStatement(
+            AstFactory.block(), AstFactory.identifier3("c")));
   }
 
   void test_visitDoubleLiteral() {
@@ -2065,16 +2354,20 @@
   }
 
   void test_visitExportDirective_combinator() {
-    _assertSource("export 'a.dart' show A;", AstFactory.exportDirective2(
-        "a.dart", [AstFactory.showCombinator([AstFactory.identifier3("A")])]));
+    _assertSource(
+        "export 'a.dart' show A;",
+        AstFactory.exportDirective2("a.dart", [
+          AstFactory.showCombinator([AstFactory.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")])
-    ]));
+    _assertSource(
+        "export 'a.dart' show A hide B;",
+        AstFactory.exportDirective2("a.dart", [
+          AstFactory.showCombinator([AstFactory.identifier3("A")]),
+          AstFactory.hideCombinator([AstFactory.identifier3("B")])
+        ]));
   }
 
   void test_visitExportDirective_minimal() {
@@ -2109,13 +2402,17 @@
   }
 
   void test_visitFieldDeclaration_instance() {
-    _assertSource("var a;", AstFactory.fieldDeclaration2(
-        false, Keyword.VAR, [AstFactory.variableDeclaration("a")]));
+    _assertSource(
+        "var a;",
+        AstFactory.fieldDeclaration2(
+            false, Keyword.VAR, [AstFactory.variableDeclaration("a")]));
   }
 
   void test_visitFieldDeclaration_static() {
-    _assertSource("static var a;", AstFactory.fieldDeclaration2(
-        true, Keyword.VAR, [AstFactory.variableDeclaration("a")]));
+    _assertSource(
+        "static var a;",
+        AstFactory.fieldDeclaration2(
+            true, Keyword.VAR, [AstFactory.variableDeclaration("a")]));
   }
 
   void test_visitFieldDeclaration_withMetadata() {
@@ -2127,19 +2424,30 @@
   }
 
   void test_visitFieldFormalParameter_functionTyped() {
-    _assertSource("A this.a(b)", AstFactory.fieldFormalParameter(null,
-        AstFactory.typeName4("A"), "a", AstFactory
-            .formalParameterList([AstFactory.simpleFormalParameter3("b")])));
+    _assertSource(
+        "A this.a(b)",
+        AstFactory.fieldFormalParameter(
+            null,
+            AstFactory.typeName4("A"),
+            "a",
+            AstFactory.formalParameterList(
+                [AstFactory.simpleFormalParameter3("b")])));
   }
 
   void test_visitFieldFormalParameter_functionTyped_typeParameters() {
-    _assertSource("A this.a<E, F>(b)", new FieldFormalParameter(null, null,
-        null, AstFactory.typeName4('A'),
-        TokenFactory.tokenFromKeyword(Keyword.THIS),
-        TokenFactory.tokenFromType(TokenType.PERIOD),
-        AstFactory.identifier3('a'), AstFactory.typeParameterList(['E', 'F']),
-        AstFactory
-            .formalParameterList([AstFactory.simpleFormalParameter3("b")])));
+    _assertSource(
+        "A this.a<E, F>(b)",
+        new FieldFormalParameter(
+            null,
+            null,
+            null,
+            AstFactory.typeName4('A'),
+            TokenFactory.tokenFromKeyword(Keyword.THIS),
+            TokenFactory.tokenFromType(TokenType.PERIOD),
+            AstFactory.identifier3('a'),
+            AstFactory.typeParameterList(['E', 'F']),
+            AstFactory.formalParameterList(
+                [AstFactory.simpleFormalParameter3("b")])));
   }
 
   void test_visitFieldFormalParameter_keyword() {
@@ -2148,8 +2456,10 @@
   }
 
   void test_visitFieldFormalParameter_keywordAndType() {
-    _assertSource("final A this.a", AstFactory.fieldFormalParameter(
-        Keyword.FINAL, AstFactory.typeName4("A"), "a"));
+    _assertSource(
+        "final A this.a",
+        AstFactory.fieldFormalParameter(
+            Keyword.FINAL, AstFactory.typeName4("A"), "a"));
   }
 
   void test_visitFieldFormalParameter_type() {
@@ -2157,29 +2467,45 @@
         AstFactory.fieldFormalParameter(null, AstFactory.typeName4("A"), "a"));
   }
 
+  void test_visitFieldFormalParameter_annotation() {
+    FieldFormalParameter parameter = AstFactory.fieldFormalParameter2('f');
+    parameter.metadata.add(AstFactory.annotation(AstFactory.identifier3("A")));
+    _assertSource('@A this.f', parameter);
+  }
+
   void test_visitForEachStatement_declared() {
-    _assertSource("for (a in b) {}", AstFactory.forEachStatement(
-        AstFactory.declaredIdentifier3("a"), AstFactory.identifier3("b"),
-        AstFactory.block()));
+    _assertSource(
+        "for (var a in b) {}",
+        AstFactory.forEachStatement(AstFactory.declaredIdentifier3("a"),
+            AstFactory.identifier3("b"), AstFactory.block()));
   }
 
   void test_visitForEachStatement_variable() {
-    _assertSource("for (a in b) {}", new ForEachStatement.withReference(null,
-        TokenFactory.tokenFromKeyword(Keyword.FOR),
-        TokenFactory.tokenFromType(TokenType.OPEN_PAREN),
-        AstFactory.identifier3("a"), TokenFactory.tokenFromKeyword(Keyword.IN),
-        AstFactory.identifier3("b"),
-        TokenFactory.tokenFromType(TokenType.CLOSE_PAREN), AstFactory.block()));
+    _assertSource(
+        "for (a in b) {}",
+        new ForEachStatement.withReference(
+            null,
+            TokenFactory.tokenFromKeyword(Keyword.FOR),
+            TokenFactory.tokenFromType(TokenType.OPEN_PAREN),
+            AstFactory.identifier3("a"),
+            TokenFactory.tokenFromKeyword(Keyword.IN),
+            AstFactory.identifier3("b"),
+            TokenFactory.tokenFromType(TokenType.CLOSE_PAREN),
+            AstFactory.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),
-        AstFactory.identifier3("a"), TokenFactory.tokenFromKeyword(Keyword.IN),
-        AstFactory.identifier3("b"),
-        TokenFactory.tokenFromType(TokenType.CLOSE_PAREN), AstFactory.block()));
+    _assertSource(
+        "await for (a in b) {}",
+        new ForEachStatement.withReference(
+            TokenFactory.tokenFromString("await"),
+            TokenFactory.tokenFromKeyword(Keyword.FOR),
+            TokenFactory.tokenFromType(TokenType.OPEN_PAREN),
+            AstFactory.identifier3("a"),
+            TokenFactory.tokenFromKeyword(Keyword.IN),
+            AstFactory.identifier3("b"),
+            TokenFactory.tokenFromType(TokenType.CLOSE_PAREN),
+            AstFactory.block()));
   }
 
   void test_visitFormalParameterList_empty() {
@@ -2187,196 +2513,266 @@
   }
 
   void test_visitFormalParameterList_n() {
-    _assertSource("({a : 0})", AstFactory.formalParameterList([
-      AstFactory.namedFormalParameter(
-          AstFactory.simpleFormalParameter3("a"), AstFactory.integer(0))
-    ]));
+    _assertSource(
+        "({a : 0})",
+        AstFactory.formalParameterList([
+          AstFactory.namedFormalParameter(
+              AstFactory.simpleFormalParameter3("a"), AstFactory.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))
-    ]));
+    _assertSource(
+        "({a : 0, b : 1})",
+        AstFactory.formalParameterList([
+          AstFactory.namedFormalParameter(
+              AstFactory.simpleFormalParameter3("a"), AstFactory.integer(0)),
+          AstFactory.namedFormalParameter(
+              AstFactory.simpleFormalParameter3("b"), AstFactory.integer(1))
+        ]));
   }
 
   void test_visitFormalParameterList_p() {
-    _assertSource("([a = 0])", AstFactory.formalParameterList([
-      AstFactory.positionalFormalParameter(
-          AstFactory.simpleFormalParameter3("a"), AstFactory.integer(0))
-    ]));
+    _assertSource(
+        "([a = 0])",
+        AstFactory.formalParameterList([
+          AstFactory.positionalFormalParameter(
+              AstFactory.simpleFormalParameter3("a"), AstFactory.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))
-    ]));
+    _assertSource(
+        "([a = 0, b = 1])",
+        AstFactory.formalParameterList([
+          AstFactory.positionalFormalParameter(
+              AstFactory.simpleFormalParameter3("a"), AstFactory.integer(0)),
+          AstFactory.positionalFormalParameter(
+              AstFactory.simpleFormalParameter3("b"), AstFactory.integer(1))
+        ]));
   }
 
   void test_visitFormalParameterList_r() {
-    _assertSource("(a)", AstFactory
-        .formalParameterList([AstFactory.simpleFormalParameter3("a")]));
+    _assertSource(
+        "(a)",
+        AstFactory
+            .formalParameterList([AstFactory.simpleFormalParameter3("a")]));
   }
 
   void test_visitFormalParameterList_rn() {
-    _assertSource("(a, {b : 1})", AstFactory.formalParameterList([
-      AstFactory.simpleFormalParameter3("a"),
-      AstFactory.namedFormalParameter(
-          AstFactory.simpleFormalParameter3("b"), AstFactory.integer(1))
-    ]));
+    _assertSource(
+        "(a, {b : 1})",
+        AstFactory.formalParameterList([
+          AstFactory.simpleFormalParameter3("a"),
+          AstFactory.namedFormalParameter(
+              AstFactory.simpleFormalParameter3("b"), AstFactory.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))
-    ]));
+    _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))
+        ]));
   }
 
   void test_visitFormalParameterList_rp() {
-    _assertSource("(a, [b = 1])", AstFactory.formalParameterList([
-      AstFactory.simpleFormalParameter3("a"),
-      AstFactory.positionalFormalParameter(
-          AstFactory.simpleFormalParameter3("b"), AstFactory.integer(1))
-    ]));
+    _assertSource(
+        "(a, [b = 1])",
+        AstFactory.formalParameterList([
+          AstFactory.simpleFormalParameter3("a"),
+          AstFactory.positionalFormalParameter(
+              AstFactory.simpleFormalParameter3("b"), AstFactory.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))
-    ]));
+    _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))
+        ]));
   }
 
   void test_visitFormalParameterList_rr() {
-    _assertSource("(a, b)", AstFactory.formalParameterList([
-      AstFactory.simpleFormalParameter3("a"),
-      AstFactory.simpleFormalParameter3("b")
-    ]));
+    _assertSource(
+        "(a, b)",
+        AstFactory.formalParameterList([
+          AstFactory.simpleFormalParameter3("a"),
+          AstFactory.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))
-    ]));
+    _assertSource(
+        "(a, b, {c : 3})",
+        AstFactory.formalParameterList([
+          AstFactory.simpleFormalParameter3("a"),
+          AstFactory.simpleFormalParameter3("b"),
+          AstFactory.namedFormalParameter(
+              AstFactory.simpleFormalParameter3("c"), AstFactory.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))
-    ]));
+    _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))
+        ]));
   }
 
   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))
-    ]));
+    _assertSource(
+        "(a, b, [c = 3])",
+        AstFactory.formalParameterList([
+          AstFactory.simpleFormalParameter3("a"),
+          AstFactory.simpleFormalParameter3("b"),
+          AstFactory.positionalFormalParameter(
+              AstFactory.simpleFormalParameter3("c"), AstFactory.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))
-    ]));
+    _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))
+        ]));
   }
 
   void test_visitForStatement_c() {
-    _assertSource("for (; c;) {}", AstFactory.forStatement(
-        null, AstFactory.identifier3("c"), null, AstFactory.block()));
+    _assertSource(
+        "for (; c;) {}",
+        AstFactory.forStatement(
+            null, AstFactory.identifier3("c"), null, AstFactory.block()));
   }
 
   void test_visitForStatement_cu() {
-    _assertSource("for (; c; u) {}", AstFactory.forStatement(null,
-        AstFactory.identifier3("c"), [AstFactory.identifier3("u")],
-        AstFactory.block()));
+    _assertSource(
+        "for (; c; u) {}",
+        AstFactory.forStatement(null, AstFactory.identifier3("c"),
+            [AstFactory.identifier3("u")], AstFactory.block()));
   }
 
   void test_visitForStatement_e() {
-    _assertSource("for (e;;) {}", AstFactory.forStatement(
-        AstFactory.identifier3("e"), null, null, AstFactory.block()));
+    _assertSource(
+        "for (e;;) {}",
+        AstFactory.forStatement(
+            AstFactory.identifier3("e"), null, null, AstFactory.block()));
   }
 
   void test_visitForStatement_ec() {
-    _assertSource("for (e; c;) {}", AstFactory.forStatement(
-        AstFactory.identifier3("e"), AstFactory.identifier3("c"), null,
-        AstFactory.block()));
+    _assertSource(
+        "for (e; c;) {}",
+        AstFactory.forStatement(AstFactory.identifier3("e"),
+            AstFactory.identifier3("c"), null, AstFactory.block()));
   }
 
   void test_visitForStatement_ecu() {
-    _assertSource("for (e; c; u) {}", AstFactory.forStatement(
-        AstFactory.identifier3("e"), AstFactory.identifier3("c"),
-        [AstFactory.identifier3("u")], AstFactory.block()));
+    _assertSource(
+        "for (e; c; u) {}",
+        AstFactory.forStatement(
+            AstFactory.identifier3("e"),
+            AstFactory.identifier3("c"),
+            [AstFactory.identifier3("u")],
+            AstFactory.block()));
   }
 
   void test_visitForStatement_eu() {
-    _assertSource("for (e;; u) {}", AstFactory.forStatement(
-        AstFactory.identifier3("e"), null, [AstFactory.identifier3("u")],
-        AstFactory.block()));
+    _assertSource(
+        "for (e;; u) {}",
+        AstFactory.forStatement(AstFactory.identifier3("e"), null,
+            [AstFactory.identifier3("u")], AstFactory.block()));
   }
 
   void test_visitForStatement_i() {
-    _assertSource("for (var i;;) {}", AstFactory.forStatement2(AstFactory
-            .variableDeclarationList2(
-                Keyword.VAR, [AstFactory.variableDeclaration("i")]), null, null,
-        AstFactory.block()));
+    _assertSource(
+        "for (var i;;) {}",
+        AstFactory.forStatement2(
+            AstFactory.variableDeclarationList2(
+                Keyword.VAR, [AstFactory.variableDeclaration("i")]),
+            null,
+            null,
+            AstFactory.block()));
   }
 
   void test_visitForStatement_ic() {
-    _assertSource("for (var i; c;) {}", AstFactory.forStatement2(AstFactory
-            .variableDeclarationList2(
+    _assertSource(
+        "for (var i; c;) {}",
+        AstFactory.forStatement2(
+            AstFactory.variableDeclarationList2(
                 Keyword.VAR, [AstFactory.variableDeclaration("i")]),
-        AstFactory.identifier3("c"), null, AstFactory.block()));
+            AstFactory.identifier3("c"),
+            null,
+            AstFactory.block()));
   }
 
   void test_visitForStatement_icu() {
-    _assertSource("for (var i; c; u) {}", AstFactory.forStatement2(AstFactory
-            .variableDeclarationList2(
+    _assertSource(
+        "for (var i; c; u) {}",
+        AstFactory.forStatement2(
+            AstFactory.variableDeclarationList2(
                 Keyword.VAR, [AstFactory.variableDeclaration("i")]),
-        AstFactory.identifier3("c"), [AstFactory.identifier3("u")],
-        AstFactory.block()));
+            AstFactory.identifier3("c"),
+            [AstFactory.identifier3("u")],
+            AstFactory.block()));
   }
 
   void test_visitForStatement_iu() {
-    _assertSource("for (var i;; u) {}", AstFactory.forStatement2(AstFactory
-            .variableDeclarationList2(
-                Keyword.VAR, [AstFactory.variableDeclaration("i")]), null,
-        [AstFactory.identifier3("u")], AstFactory.block()));
+    _assertSource(
+        "for (var i;; u) {}",
+        AstFactory.forStatement2(
+            AstFactory.variableDeclarationList2(
+                Keyword.VAR, [AstFactory.variableDeclaration("i")]),
+            null,
+            [AstFactory.identifier3("u")],
+            AstFactory.block()));
   }
 
   void test_visitForStatement_u() {
-    _assertSource("for (;; u) {}", AstFactory.forStatement(
-        null, null, [AstFactory.identifier3("u")], AstFactory.block()));
+    _assertSource(
+        "for (;; u) {}",
+        AstFactory.forStatement(
+            null, null, [AstFactory.identifier3("u")], AstFactory.block()));
+  }
+
+  void test_visitFunctionDeclaration_external() {
+    FunctionDeclaration functionDeclaration = AstFactory.functionDeclaration(
+        null,
+        null,
+        "f",
+        AstFactory.functionExpression2(
+            AstFactory.formalParameterList(), AstFactory.emptyFunctionBody()));
+    functionDeclaration.externalKeyword =
+        TokenFactory.tokenFromKeyword(Keyword.EXTERNAL);
+    _assertSource("external f();", functionDeclaration);
   }
 
   void test_visitFunctionDeclaration_getter() {
-    _assertSource("get f() {}", AstFactory.functionDeclaration(
-        null, Keyword.GET, "f", AstFactory.functionExpression()));
+    _assertSource(
+        "get f() {}",
+        AstFactory.functionDeclaration(
+            null, Keyword.GET, "f", AstFactory.functionExpression()));
   }
 
   void test_visitFunctionDeclaration_local_blockBody() {
@@ -2384,43 +2780,68 @@
         null, null, "f", AstFactory.functionExpression());
     FunctionDeclarationStatement fStatement =
         new FunctionDeclarationStatement(f);
-    _assertSource("main() {f() {} 42;}", AstFactory.functionDeclaration(null,
-        null, "main", AstFactory.functionExpression2(
-            AstFactory.formalParameterList(), AstFactory.blockFunctionBody2([
-      fStatement,
-      AstFactory.expressionStatement(AstFactory.integer(42))
-    ]))));
+    _assertSource(
+        "main() {f() {} 42;}",
+        AstFactory.functionDeclaration(
+            null,
+            null,
+            "main",
+            AstFactory.functionExpression2(
+                AstFactory.formalParameterList(),
+                AstFactory.blockFunctionBody2([
+                  fStatement,
+                  AstFactory.expressionStatement(AstFactory.integer(42))
+                ]))));
   }
 
   void test_visitFunctionDeclaration_local_expressionBody() {
-    FunctionDeclaration f = AstFactory.functionDeclaration(null, null, "f",
+    FunctionDeclaration f = AstFactory.functionDeclaration(
+        null,
+        null,
+        "f",
         AstFactory.functionExpression2(AstFactory.formalParameterList(),
             AstFactory.expressionFunctionBody(AstFactory.integer(1))));
     FunctionDeclarationStatement fStatement =
         new FunctionDeclarationStatement(f);
-    _assertSource("main() {f() => 1; 2;}", AstFactory.functionDeclaration(null,
-        null, "main", AstFactory.functionExpression2(
-            AstFactory.formalParameterList(), AstFactory.blockFunctionBody2([
-      fStatement,
-      AstFactory.expressionStatement(AstFactory.integer(2))
-    ]))));
+    _assertSource(
+        "main() {f() => 1; 2;}",
+        AstFactory.functionDeclaration(
+            null,
+            null,
+            "main",
+            AstFactory.functionExpression2(
+                AstFactory.formalParameterList(),
+                AstFactory.blockFunctionBody2([
+                  fStatement,
+                  AstFactory.expressionStatement(AstFactory.integer(2))
+                ]))));
   }
 
   void test_visitFunctionDeclaration_normal() {
-    _assertSource("f() {}", AstFactory.functionDeclaration(
-        null, null, "f", AstFactory.functionExpression()));
+    _assertSource(
+        "f() {}",
+        AstFactory.functionDeclaration(
+            null, null, "f", AstFactory.functionExpression()));
   }
 
   void test_visitFunctionDeclaration_setter() {
-    _assertSource("set f() {}", AstFactory.functionDeclaration(
-        null, Keyword.SET, "f", AstFactory.functionExpression()));
+    _assertSource(
+        "set f() {}",
+        AstFactory.functionDeclaration(
+            null, Keyword.SET, "f", AstFactory.functionExpression()));
   }
 
   void test_visitFunctionDeclaration_typeParameters() {
-    _assertSource("f<E>() {}", AstFactory.functionDeclaration(null, null, "f",
-        AstFactory.functionExpression3(AstFactory.typeParameterList(['E']),
-            AstFactory.formalParameterList(),
-            AstFactory.blockFunctionBody2())));
+    _assertSource(
+        "f<E>() {}",
+        AstFactory.functionDeclaration(
+            null,
+            null,
+            "f",
+            AstFactory.functionExpression3(
+                AstFactory.typeParameterList(['E']),
+                AstFactory.formalParameterList(),
+                AstFactory.blockFunctionBody2())));
   }
 
   void test_visitFunctionDeclaration_withMetadata() {
@@ -2432,8 +2853,10 @@
   }
 
   void test_visitFunctionDeclarationStatement() {
-    _assertSource("f() {}", AstFactory.functionDeclarationStatement(
-        null, null, "f", AstFactory.functionExpression()));
+    _assertSource(
+        "f() {}",
+        AstFactory.functionDeclarationStatement(
+            null, null, "f", AstFactory.functionExpression()));
   }
 
   void test_visitFunctionExpression() {
@@ -2441,9 +2864,10 @@
   }
 
   void test_visitFunctionExpression_typeParameters() {
-    _assertSource("<E>() {}", AstFactory.functionExpression3(
-        AstFactory.typeParameterList(['E']), AstFactory.formalParameterList(),
-        AstFactory.blockFunctionBody2()));
+    _assertSource(
+        "<E>() {}",
+        AstFactory.functionExpression3(AstFactory.typeParameterList(['E']),
+            AstFactory.formalParameterList(), AstFactory.blockFunctionBody2()));
   }
 
   void test_visitFunctionExpressionInvocation_minimal() {
@@ -2452,21 +2876,27 @@
   }
 
   void test_visitFunctionExpressionInvocation_typeArguments() {
-    _assertSource("f<A>()", AstFactory.functionExpressionInvocation2(
-        AstFactory.identifier3("f"),
-        AstFactory.typeArgumentList([AstFactory.typeName4('A')])));
+    _assertSource(
+        "f<A>()",
+        AstFactory.functionExpressionInvocation2(AstFactory.identifier3("f"),
+            AstFactory.typeArgumentList([AstFactory.typeName4('A')])));
   }
 
   void test_visitFunctionTypeAlias_generic() {
-    _assertSource("typedef A F<B>();", AstFactory.typeAlias(
-        AstFactory.typeName4("A"), "F", AstFactory.typeParameterList(["B"]),
-        AstFactory.formalParameterList()));
+    _assertSource(
+        "typedef A F<B>();",
+        AstFactory.typeAlias(
+            AstFactory.typeName4("A"),
+            "F",
+            AstFactory.typeParameterList(["B"]),
+            AstFactory.formalParameterList()));
   }
 
   void test_visitFunctionTypeAlias_nonGeneric() {
-    _assertSource("typedef A F();", AstFactory.typeAlias(
-        AstFactory.typeName4("A"), "F", null,
-        AstFactory.formalParameterList()));
+    _assertSource(
+        "typedef A F();",
+        AstFactory.typeAlias(AstFactory.typeName4("A"), "F", null,
+            AstFactory.formalParameterList()));
   }
 
   void test_visitFunctionTypeAlias_withMetadata() {
@@ -2481,31 +2911,50 @@
     _assertSource("f()", AstFactory.functionTypedFormalParameter(null, "f"));
   }
 
+  void test_visitFunctionTypedFormalParameter_annotation() {
+    FunctionTypedFormalParameter parameter = AstFactory.functionTypedFormalParameter(null, "f");
+    parameter.metadata.add(AstFactory.annotation(AstFactory.identifier3("A")));
+    _assertSource('@A f()', parameter);
+  }
+
   void test_visitFunctionTypedFormalParameter_type() {
-    _assertSource("T f()", AstFactory.functionTypedFormalParameter(
-        AstFactory.typeName4("T"), "f"));
+    _assertSource(
+        "T f()",
+        AstFactory.functionTypedFormalParameter(
+            AstFactory.typeName4("T"), "f"));
   }
 
   void test_visitFunctionTypedFormalParameter_typeParameters() {
-    _assertSource("T f<E>()", new FunctionTypedFormalParameter(null, null,
-        AstFactory.typeName4("T"), AstFactory.identifier3('f'),
-        AstFactory.typeParameterList(['E']),
-        AstFactory.formalParameterList([])));
+    _assertSource(
+        "T f<E>()",
+        new FunctionTypedFormalParameter(
+            null,
+            null,
+            AstFactory.typeName4("T"),
+            AstFactory.identifier3('f'),
+            AstFactory.typeParameterList(['E']),
+            AstFactory.formalParameterList([])));
   }
 
   void test_visitIfStatement_withElse() {
-    _assertSource("if (c) {} else {}", AstFactory.ifStatement2(
-        AstFactory.identifier3("c"), AstFactory.block(), AstFactory.block()));
+    _assertSource(
+        "if (c) {} else {}",
+        AstFactory.ifStatement2(AstFactory.identifier3("c"), AstFactory.block(),
+            AstFactory.block()));
   }
 
   void test_visitIfStatement_withoutElse() {
-    _assertSource("if (c) {}", AstFactory.ifStatement(
-        AstFactory.identifier3("c"), AstFactory.block()));
+    _assertSource(
+        "if (c) {}",
+        AstFactory.ifStatement(
+            AstFactory.identifier3("c"), AstFactory.block()));
   }
 
   void test_visitImplementsClause_multiple() {
-    _assertSource("implements A, B", AstFactory.implementsClause(
-        [AstFactory.typeName4("A"), AstFactory.typeName4("B")]));
+    _assertSource(
+        "implements A, B",
+        AstFactory.implementsClause(
+            [AstFactory.typeName4("A"), AstFactory.typeName4("B")]));
   }
 
   void test_visitImplementsClause_single() {
@@ -2514,17 +2963,20 @@
   }
 
   void test_visitImportDirective_combinator() {
-    _assertSource("import 'a.dart' show A;", AstFactory.importDirective3(
-        "a.dart", null,
-        [AstFactory.showCombinator([AstFactory.identifier3("A")])]));
+    _assertSource(
+        "import 'a.dart' show A;",
+        AstFactory.importDirective3("a.dart", null, [
+          AstFactory.showCombinator([AstFactory.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")])
-    ]));
+    _assertSource(
+        "import 'a.dart' show A hide B;",
+        AstFactory.importDirective3("a.dart", null, [
+          AstFactory.showCombinator([AstFactory.identifier3("A")]),
+          AstFactory.hideCombinator([AstFactory.identifier3("B")])
+        ]));
   }
 
   void test_visitImportDirective_deferred() {
@@ -2543,17 +2995,20 @@
   }
 
   void test_visitImportDirective_prefix_combinator() {
-    _assertSource("import 'a.dart' as p show A;", AstFactory.importDirective3(
-        "a.dart", "p",
-        [AstFactory.showCombinator([AstFactory.identifier3("A")])]));
+    _assertSource(
+        "import 'a.dart' as p show A;",
+        AstFactory.importDirective3("a.dart", "p", [
+          AstFactory.showCombinator([AstFactory.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")])
-    ]));
+    _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")])
+        ]));
   }
 
   void test_visitImportDirective_withMetadata() {
@@ -2564,8 +3019,10 @@
   }
 
   void test_visitImportHideCombinator_multiple() {
-    _assertSource("hide a, b", AstFactory.hideCombinator(
-        [AstFactory.identifier3("a"), AstFactory.identifier3("b")]));
+    _assertSource(
+        "hide a, b",
+        AstFactory.hideCombinator(
+            [AstFactory.identifier3("a"), AstFactory.identifier3("b")]));
   }
 
   void test_visitImportHideCombinator_single() {
@@ -2574,8 +3031,10 @@
   }
 
   void test_visitImportShowCombinator_multiple() {
-    _assertSource("show a, b", AstFactory.showCombinator(
-        [AstFactory.identifier3("a"), AstFactory.identifier3("b")]));
+    _assertSource(
+        "show a, b",
+        AstFactory.showCombinator(
+            [AstFactory.identifier3("a"), AstFactory.identifier3("b")]));
   }
 
   void test_visitImportShowCombinator_single() {
@@ -2584,23 +3043,31 @@
   }
 
   void test_visitIndexExpression() {
-    _assertSource("a[i]", AstFactory.indexExpression(
-        AstFactory.identifier3("a"), AstFactory.identifier3("i")));
+    _assertSource(
+        "a[i]",
+        AstFactory.indexExpression(
+            AstFactory.identifier3("a"), AstFactory.identifier3("i")));
   }
 
   void test_visitInstanceCreationExpression_const() {
-    _assertSource("const C()", AstFactory.instanceCreationExpression2(
-        Keyword.CONST, AstFactory.typeName4("C")));
+    _assertSource(
+        "const C()",
+        AstFactory.instanceCreationExpression2(
+            Keyword.CONST, AstFactory.typeName4("C")));
   }
 
   void test_visitInstanceCreationExpression_named() {
-    _assertSource("new C.c()", AstFactory.instanceCreationExpression3(
-        Keyword.NEW, AstFactory.typeName4("C"), "c"));
+    _assertSource(
+        "new C.c()",
+        AstFactory.instanceCreationExpression3(
+            Keyword.NEW, AstFactory.typeName4("C"), "c"));
   }
 
   void test_visitInstanceCreationExpression_unnamed() {
-    _assertSource("new C()", AstFactory.instanceCreationExpression2(
-        Keyword.NEW, AstFactory.typeName4("C")));
+    _assertSource(
+        "new C()",
+        AstFactory.instanceCreationExpression2(
+            Keyword.NEW, AstFactory.typeName4("C")));
   }
 
   void test_visitIntegerLiteral() {
@@ -2621,13 +3088,17 @@
   }
 
   void test_visitIsExpression_negated() {
-    _assertSource("a is! C", AstFactory.isExpression(
-        AstFactory.identifier3("a"), true, AstFactory.typeName4("C")));
+    _assertSource(
+        "a is! C",
+        AstFactory.isExpression(
+            AstFactory.identifier3("a"), true, AstFactory.typeName4("C")));
   }
 
   void test_visitIsExpression_normal() {
-    _assertSource("a is C", AstFactory.isExpression(
-        AstFactory.identifier3("a"), false, AstFactory.typeName4("C")));
+    _assertSource(
+        "a is C",
+        AstFactory.isExpression(
+            AstFactory.identifier3("a"), false, AstFactory.typeName4("C")));
   }
 
   void test_visitLabel() {
@@ -2635,15 +3106,18 @@
   }
 
   void test_visitLabeledStatement_multiple() {
-    _assertSource("a: b: return;", AstFactory.labeledStatement([
-      AstFactory.label2("a"),
-      AstFactory.label2("b")
-    ], AstFactory.returnStatement()));
+    _assertSource(
+        "a: b: return;",
+        AstFactory.labeledStatement(
+            [AstFactory.label2("a"), AstFactory.label2("b")],
+            AstFactory.returnStatement()));
   }
 
   void test_visitLabeledStatement_single() {
-    _assertSource("a: return;", AstFactory.labeledStatement(
-        [AstFactory.label2("a")], AstFactory.returnStatement()));
+    _assertSource(
+        "a: return;",
+        AstFactory.labeledStatement(
+            [AstFactory.label2("a")], AstFactory.returnStatement()));
   }
 
   void test_visitLibraryDirective() {
@@ -2658,11 +3132,13 @@
   }
 
   void test_visitLibraryIdentifier_multiple() {
-    _assertSource("a.b.c", AstFactory.libraryIdentifier([
-      AstFactory.identifier3("a"),
-      AstFactory.identifier3("b"),
-      AstFactory.identifier3("c")
-    ]));
+    _assertSource(
+        "a.b.c",
+        AstFactory.libraryIdentifier([
+          AstFactory.identifier3("a"),
+          AstFactory.identifier3("b"),
+          AstFactory.identifier3("c")
+        ]));
   }
 
   void test_visitLibraryIdentifier_single() {
@@ -2679,11 +3155,13 @@
   }
 
   void test_visitListLiteral_nonEmpty() {
-    _assertSource("[a, b, c]", AstFactory.listLiteral([
-      AstFactory.identifier3("a"),
-      AstFactory.identifier3("b"),
-      AstFactory.identifier3("c")
-    ]));
+    _assertSource(
+        "[a, b, c]",
+        AstFactory.listLiteral([
+          AstFactory.identifier3("a"),
+          AstFactory.identifier3("b"),
+          AstFactory.identifier3("c")
+        ]));
   }
 
   void test_visitMapLiteral_const() {
@@ -2695,11 +3173,13 @@
   }
 
   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"))
-    ]));
+    _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"))
+        ]));
   }
 
   void test_visitMapLiteralEntry() {
@@ -2708,110 +3188,205 @@
   }
 
   void test_visitMethodDeclaration_external() {
-    _assertSource("external m();", AstFactory.methodDeclaration(null, null,
-        null, null, AstFactory.identifier3("m"),
-        AstFactory.formalParameterList()));
+    _assertSource(
+        "external m();",
+        AstFactory.methodDeclaration(null, null, null, null,
+            AstFactory.identifier3("m"), AstFactory.formalParameterList()));
   }
 
   void test_visitMethodDeclaration_external_returnType() {
-    _assertSource("external T m();", AstFactory.methodDeclaration(null,
-        AstFactory.typeName4("T"), null, null, AstFactory.identifier3("m"),
-        AstFactory.formalParameterList()));
+    _assertSource(
+        "external T m();",
+        AstFactory.methodDeclaration(
+            null,
+            AstFactory.typeName4("T"),
+            null,
+            null,
+            AstFactory.identifier3("m"),
+            AstFactory.formalParameterList()));
   }
 
   void test_visitMethodDeclaration_getter() {
-    _assertSource("get m {}", AstFactory.methodDeclaration2(null, null,
-        Keyword.GET, null, AstFactory.identifier3("m"), null,
-        AstFactory.blockFunctionBody2()));
+    _assertSource(
+        "get m {}",
+        AstFactory.methodDeclaration2(
+            null,
+            null,
+            Keyword.GET,
+            null,
+            AstFactory.identifier3("m"),
+            null,
+            AstFactory.blockFunctionBody2()));
   }
 
   void test_visitMethodDeclaration_getter_returnType() {
-    _assertSource("T get m {}", AstFactory.methodDeclaration2(null,
-        AstFactory.typeName4("T"), Keyword.GET, null,
-        AstFactory.identifier3("m"), null, AstFactory.blockFunctionBody2()));
+    _assertSource(
+        "T get m {}",
+        AstFactory.methodDeclaration2(
+            null,
+            AstFactory.typeName4("T"),
+            Keyword.GET,
+            null,
+            AstFactory.identifier3("m"),
+            null,
+            AstFactory.blockFunctionBody2()));
   }
 
   void test_visitMethodDeclaration_getter_seturnType() {
-    _assertSource("T set m(var v) {}", AstFactory.methodDeclaration2(null,
-        AstFactory.typeName4("T"), Keyword.SET, null,
-        AstFactory.identifier3("m"), AstFactory.formalParameterList(
-            [AstFactory.simpleFormalParameter(Keyword.VAR, "v")]),
-        AstFactory.blockFunctionBody2()));
+    _assertSource(
+        "T set m(var v) {}",
+        AstFactory.methodDeclaration2(
+            null,
+            AstFactory.typeName4("T"),
+            Keyword.SET,
+            null,
+            AstFactory.identifier3("m"),
+            AstFactory.formalParameterList(
+                [AstFactory.simpleFormalParameter(Keyword.VAR, "v")]),
+            AstFactory.blockFunctionBody2()));
   }
 
   void test_visitMethodDeclaration_minimal() {
-    _assertSource("m() {}", AstFactory.methodDeclaration2(null, null, null,
-        null, AstFactory.identifier3("m"), AstFactory.formalParameterList(),
-        AstFactory.blockFunctionBody2()));
+    _assertSource(
+        "m() {}",
+        AstFactory.methodDeclaration2(
+            null,
+            null,
+            null,
+            null,
+            AstFactory.identifier3("m"),
+            AstFactory.formalParameterList(),
+            AstFactory.blockFunctionBody2()));
   }
 
   void test_visitMethodDeclaration_multipleParameters() {
-    _assertSource("m(var a, var b) {}", AstFactory.methodDeclaration2(null,
-        null, null, null, AstFactory.identifier3("m"), AstFactory
-            .formalParameterList([
-      AstFactory.simpleFormalParameter(Keyword.VAR, "a"),
-      AstFactory.simpleFormalParameter(Keyword.VAR, "b")
-    ]), AstFactory.blockFunctionBody2()));
+    _assertSource(
+        "m(var a, var b) {}",
+        AstFactory.methodDeclaration2(
+            null,
+            null,
+            null,
+            null,
+            AstFactory.identifier3("m"),
+            AstFactory.formalParameterList([
+              AstFactory.simpleFormalParameter(Keyword.VAR, "a"),
+              AstFactory.simpleFormalParameter(Keyword.VAR, "b")
+            ]),
+            AstFactory.blockFunctionBody2()));
   }
 
   void test_visitMethodDeclaration_operator() {
-    _assertSource("operator +() {}", AstFactory.methodDeclaration2(null, null,
-        null, Keyword.OPERATOR, AstFactory.identifier3("+"),
-        AstFactory.formalParameterList(), AstFactory.blockFunctionBody2()));
+    _assertSource(
+        "operator +() {}",
+        AstFactory.methodDeclaration2(
+            null,
+            null,
+            null,
+            Keyword.OPERATOR,
+            AstFactory.identifier3("+"),
+            AstFactory.formalParameterList(),
+            AstFactory.blockFunctionBody2()));
   }
 
   void test_visitMethodDeclaration_operator_returnType() {
-    _assertSource("T operator +() {}", AstFactory.methodDeclaration2(null,
-        AstFactory.typeName4("T"), null, Keyword.OPERATOR,
-        AstFactory.identifier3("+"), AstFactory.formalParameterList(),
-        AstFactory.blockFunctionBody2()));
+    _assertSource(
+        "T operator +() {}",
+        AstFactory.methodDeclaration2(
+            null,
+            AstFactory.typeName4("T"),
+            null,
+            Keyword.OPERATOR,
+            AstFactory.identifier3("+"),
+            AstFactory.formalParameterList(),
+            AstFactory.blockFunctionBody2()));
   }
 
   void test_visitMethodDeclaration_returnType() {
-    _assertSource("T m() {}", AstFactory.methodDeclaration2(null,
-        AstFactory.typeName4("T"), null, null, AstFactory.identifier3("m"),
-        AstFactory.formalParameterList(), AstFactory.blockFunctionBody2()));
+    _assertSource(
+        "T m() {}",
+        AstFactory.methodDeclaration2(
+            null,
+            AstFactory.typeName4("T"),
+            null,
+            null,
+            AstFactory.identifier3("m"),
+            AstFactory.formalParameterList(),
+            AstFactory.blockFunctionBody2()));
   }
 
   void test_visitMethodDeclaration_setter() {
-    _assertSource("set m(var v) {}", AstFactory.methodDeclaration2(null, null,
-        Keyword.SET, null, AstFactory.identifier3("m"), AstFactory
-            .formalParameterList(
+    _assertSource(
+        "set m(var v) {}",
+        AstFactory.methodDeclaration2(
+            null,
+            null,
+            Keyword.SET,
+            null,
+            AstFactory.identifier3("m"),
+            AstFactory.formalParameterList(
                 [AstFactory.simpleFormalParameter(Keyword.VAR, "v")]),
-        AstFactory.blockFunctionBody2()));
+            AstFactory.blockFunctionBody2()));
   }
 
   void test_visitMethodDeclaration_static() {
-    _assertSource("static m() {}", AstFactory.methodDeclaration2(Keyword.STATIC,
-        null, null, null, AstFactory.identifier3("m"),
-        AstFactory.formalParameterList(), AstFactory.blockFunctionBody2()));
+    _assertSource(
+        "static m() {}",
+        AstFactory.methodDeclaration2(
+            Keyword.STATIC,
+            null,
+            null,
+            null,
+            AstFactory.identifier3("m"),
+            AstFactory.formalParameterList(),
+            AstFactory.blockFunctionBody2()));
   }
 
   void test_visitMethodDeclaration_static_returnType() {
-    _assertSource("static T m() {}", AstFactory.methodDeclaration2(
-        Keyword.STATIC, AstFactory.typeName4("T"), null, null,
-        AstFactory.identifier3("m"), AstFactory.formalParameterList(),
-        AstFactory.blockFunctionBody2()));
+    _assertSource(
+        "static T m() {}",
+        AstFactory.methodDeclaration2(
+            Keyword.STATIC,
+            AstFactory.typeName4("T"),
+            null,
+            null,
+            AstFactory.identifier3("m"),
+            AstFactory.formalParameterList(),
+            AstFactory.blockFunctionBody2()));
   }
 
   void test_visitMethodDeclaration_typeParameters() {
-    _assertSource("m<E>() {}", AstFactory.methodDeclaration3(null, null, null,
-        null, AstFactory.identifier3("m"), AstFactory.typeParameterList(['E']),
-        AstFactory.formalParameterList(), AstFactory.blockFunctionBody2()));
+    _assertSource(
+        "m<E>() {}",
+        AstFactory.methodDeclaration3(
+            null,
+            null,
+            null,
+            null,
+            AstFactory.identifier3("m"),
+            AstFactory.typeParameterList(['E']),
+            AstFactory.formalParameterList(),
+            AstFactory.blockFunctionBody2()));
   }
 
   void test_visitMethodDeclaration_withMetadata() {
-    MethodDeclaration declaration = AstFactory.methodDeclaration2(null, null,
-        null, null, AstFactory.identifier3("m"),
-        AstFactory.formalParameterList(), AstFactory.blockFunctionBody2());
+    MethodDeclaration declaration = AstFactory.methodDeclaration2(
+        null,
+        null,
+        null,
+        null,
+        AstFactory.identifier3("m"),
+        AstFactory.formalParameterList(),
+        AstFactory.blockFunctionBody2());
     declaration.metadata
         .add(AstFactory.annotation(AstFactory.identifier3("deprecated")));
     _assertSource("@deprecated m() {}", declaration);
   }
 
   void test_visitMethodInvocation_conditional() {
-    _assertSource("t?.m()", AstFactory.methodInvocation(
-        AstFactory.identifier3("t"), "m", null, TokenType.QUESTION_PERIOD));
+    _assertSource(
+        "t?.m()",
+        AstFactory.methodInvocation(
+            AstFactory.identifier3("t"), "m", null, TokenType.QUESTION_PERIOD));
   }
 
   void test_visitMethodInvocation_noTarget() {
@@ -2824,8 +3399,10 @@
   }
 
   void test_visitMethodInvocation_typeArguments() {
-    _assertSource("m<A>()", AstFactory.methodInvocation3(
-        null, "m", AstFactory.typeArgumentList([AstFactory.typeName4('A')])));
+    _assertSource(
+        "m<A>()",
+        AstFactory.methodInvocation3(null, "m",
+            AstFactory.typeArgumentList([AstFactory.typeName4('A')])));
   }
 
   void test_visitNamedExpression() {
@@ -2834,9 +3411,11 @@
   }
 
   void test_visitNamedFormalParameter() {
-    _assertSource("var a : 0", AstFactory.namedFormalParameter(
-        AstFactory.simpleFormalParameter(Keyword.VAR, "a"),
-        AstFactory.integer(0)));
+    _assertSource(
+        "var a : 0",
+        AstFactory.namedFormalParameter(
+            AstFactory.simpleFormalParameter(Keyword.VAR, "a"),
+            AstFactory.integer(0)));
   }
 
   void test_visitNativeClause() {
@@ -2881,14 +3460,18 @@
   }
 
   void test_visitPositionalFormalParameter() {
-    _assertSource("var a = 0", AstFactory.positionalFormalParameter(
-        AstFactory.simpleFormalParameter(Keyword.VAR, "a"),
-        AstFactory.integer(0)));
+    _assertSource(
+        "var a = 0",
+        AstFactory.positionalFormalParameter(
+            AstFactory.simpleFormalParameter(Keyword.VAR, "a"),
+            AstFactory.integer(0)));
   }
 
   void test_visitPostfixExpression() {
-    _assertSource("a++", AstFactory.postfixExpression(
-        AstFactory.identifier3("a"), TokenType.PLUS_PLUS));
+    _assertSource(
+        "a++",
+        AstFactory.postfixExpression(
+            AstFactory.identifier3("a"), TokenType.PLUS_PLUS));
   }
 
   void test_visitPrefixedIdentifier() {
@@ -2896,8 +3479,10 @@
   }
 
   void test_visitPrefixExpression() {
-    _assertSource("-a", AstFactory.prefixExpression(
-        TokenType.MINUS, AstFactory.identifier3("a")));
+    _assertSource(
+        "-a",
+        AstFactory.prefixExpression(
+            TokenType.MINUS, AstFactory.identifier3("a")));
   }
 
   void test_visitPropertyAccess() {
@@ -2906,8 +3491,10 @@
   }
 
   void test_visitPropertyAccess_conditional() {
-    _assertSource("a?.b", AstFactory.propertyAccess2(
-        AstFactory.identifier3("a"), "b", TokenType.QUESTION_PERIOD));
+    _assertSource(
+        "a?.b",
+        AstFactory.propertyAccess2(
+            AstFactory.identifier3("a"), "b", TokenType.QUESTION_PERIOD));
   }
 
   void test_visitRedirectingConstructorInvocation_named() {
@@ -2942,8 +3529,10 @@
   }
 
   void test_visitSimpleFormalParameter_keyword_type() {
-    _assertSource("final A a", AstFactory.simpleFormalParameter2(
-        Keyword.FINAL, AstFactory.typeName4("A"), "a"));
+    _assertSource(
+        "final A a",
+        AstFactory.simpleFormalParameter2(
+            Keyword.FINAL, AstFactory.typeName4("A"), "a"));
   }
 
   void test_visitSimpleFormalParameter_type() {
@@ -2951,6 +3540,12 @@
         AstFactory.simpleFormalParameter4(AstFactory.typeName4("A"), "a"));
   }
 
+  void test_visitSimpleFormalParameter_annotation() {
+    SimpleFormalParameter parameter = AstFactory.simpleFormalParameter3('x');
+    parameter.metadata.add(AstFactory.annotation(AstFactory.identifier3("A")));
+    _assertSource('@A x', parameter);
+  }
+
   void test_visitSimpleIdentifier() {
     _assertSource("a", AstFactory.identifier3("a"));
   }
@@ -2960,11 +3555,13 @@
   }
 
   void test_visitStringInterpolation() {
-    _assertSource("'a\${e}b'", AstFactory.string([
-      AstFactory.interpolationString("'a", "a"),
-      AstFactory.interpolationExpression(AstFactory.identifier3("e")),
-      AstFactory.interpolationString("b'", "b")
-    ]));
+    _assertSource(
+        "'a\${e}b'",
+        AstFactory.string([
+          AstFactory.interpolationString("'a", "a"),
+          AstFactory.interpolationExpression(AstFactory.identifier3("e")),
+          AstFactory.interpolationString("b'", "b")
+        ]));
   }
 
   void test_visitSuperConstructorInvocation() {
@@ -2980,33 +3577,41 @@
   }
 
   void test_visitSwitchCase_multipleLabels() {
-    _assertSource("l1: l2: case a: {}", AstFactory.switchCase2([
-      AstFactory.label2("l1"),
-      AstFactory.label2("l2")
-    ], AstFactory.identifier3("a"), [AstFactory.block()]));
+    _assertSource(
+        "l1: l2: case a: {}",
+        AstFactory.switchCase2(
+            [AstFactory.label2("l1"), AstFactory.label2("l2")],
+            AstFactory.identifier3("a"),
+            [AstFactory.block()]));
   }
 
   void test_visitSwitchCase_multipleStatements() {
-    _assertSource("case a: {} {}", AstFactory.switchCase(
-        AstFactory.identifier3("a"), [AstFactory.block(), AstFactory.block()]));
+    _assertSource(
+        "case a: {} {}",
+        AstFactory.switchCase(AstFactory.identifier3("a"),
+            [AstFactory.block(), AstFactory.block()]));
   }
 
   void test_visitSwitchCase_noLabels() {
-    _assertSource("case a: {}", AstFactory.switchCase(
-        AstFactory.identifier3("a"), [AstFactory.block()]));
+    _assertSource(
+        "case a: {}",
+        AstFactory.switchCase(
+            AstFactory.identifier3("a"), [AstFactory.block()]));
   }
 
   void test_visitSwitchCase_singleLabel() {
-    _assertSource("l1: case a: {}", AstFactory.switchCase2(
-        [AstFactory.label2("l1")], AstFactory.identifier3("a"),
-        [AstFactory.block()]));
+    _assertSource(
+        "l1: case a: {}",
+        AstFactory.switchCase2([AstFactory.label2("l1")],
+            AstFactory.identifier3("a"), [AstFactory.block()]));
   }
 
   void test_visitSwitchDefault_multipleLabels() {
-    _assertSource("l1: l2: default: {}", AstFactory.switchDefault([
-      AstFactory.label2("l1"),
-      AstFactory.label2("l2")
-    ], [AstFactory.block()]));
+    _assertSource(
+        "l1: l2: default: {}",
+        AstFactory.switchDefault(
+            [AstFactory.label2("l1"), AstFactory.label2("l2")],
+            [AstFactory.block()]));
   }
 
   void test_visitSwitchDefault_multipleStatements() {
@@ -3020,16 +3625,19 @@
   }
 
   void test_visitSwitchDefault_singleLabel() {
-    _assertSource("l1: default: {}", AstFactory.switchDefault(
-        [AstFactory.label2("l1")], [AstFactory.block()]));
+    _assertSource(
+        "l1: default: {}",
+        AstFactory.switchDefault(
+            [AstFactory.label2("l1")], [AstFactory.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()])
-    ]));
+    _assertSource(
+        "switch (a) {case 'b': {} default: {}}",
+        AstFactory.switchStatement(AstFactory.identifier3("a"), [
+          AstFactory.switchCase(AstFactory.string2("b"), [AstFactory.block()]),
+          AstFactory.switchDefault2([AstFactory.block()])
+        ]));
   }
 
   void test_visitSymbolLiteral_multiple() {
@@ -3050,36 +3658,44 @@
   }
 
   void test_visitTopLevelVariableDeclaration_multiple() {
-    _assertSource("var a;", AstFactory.topLevelVariableDeclaration2(
-        Keyword.VAR, [AstFactory.variableDeclaration("a")]));
+    _assertSource(
+        "var a;",
+        AstFactory.topLevelVariableDeclaration2(
+            Keyword.VAR, [AstFactory.variableDeclaration("a")]));
   }
 
   void test_visitTopLevelVariableDeclaration_single() {
-    _assertSource("var a, b;", AstFactory.topLevelVariableDeclaration2(
-        Keyword.VAR, [
-      AstFactory.variableDeclaration("a"),
-      AstFactory.variableDeclaration("b")
-    ]));
+    _assertSource(
+        "var a, b;",
+        AstFactory.topLevelVariableDeclaration2(Keyword.VAR, [
+          AstFactory.variableDeclaration("a"),
+          AstFactory.variableDeclaration("b")
+        ]));
   }
 
   void test_visitTryStatement_catch() {
-    _assertSource("try {} on E {}", AstFactory.tryStatement2(AstFactory.block(),
-        [AstFactory.catchClause3(AstFactory.typeName4("E"))]));
+    _assertSource(
+        "try {} on E {}",
+        AstFactory.tryStatement2(AstFactory.block(),
+            [AstFactory.catchClause3(AstFactory.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"))
-    ]));
+    _assertSource(
+        "try {} on E {} on F {}",
+        AstFactory.tryStatement2(AstFactory.block(), [
+          AstFactory.catchClause3(AstFactory.typeName4("E")),
+          AstFactory.catchClause3(AstFactory.typeName4("F"))
+        ]));
   }
 
   void test_visitTryStatement_catchFinally() {
-    _assertSource("try {} on E {} finally {}", AstFactory.tryStatement3(
-        AstFactory.block(),
-        [AstFactory.catchClause3(AstFactory.typeName4("E"))],
-        AstFactory.block()));
+    _assertSource(
+        "try {} on E {} finally {}",
+        AstFactory.tryStatement3(
+            AstFactory.block(),
+            [AstFactory.catchClause3(AstFactory.typeName4("E"))],
+            AstFactory.block()));
   }
 
   void test_visitTryStatement_finally() {
@@ -3088,8 +3704,10 @@
   }
 
   void test_visitTypeArgumentList_multiple() {
-    _assertSource("<E, F>", AstFactory.typeArgumentList(
-        [AstFactory.typeName4("E"), AstFactory.typeName4("F")]));
+    _assertSource(
+        "<E, F>",
+        AstFactory.typeArgumentList(
+            [AstFactory.typeName4("E"), AstFactory.typeName4("F")]));
   }
 
   void test_visitTypeArgumentList_single() {
@@ -3098,13 +3716,18 @@
   }
 
   void test_visitTypeName_multipleArgs() {
-    _assertSource("C<D, E>", AstFactory.typeName4(
-        "C", [AstFactory.typeName4("D"), AstFactory.typeName4("E")]));
+    _assertSource(
+        "C<D, E>",
+        AstFactory.typeName4(
+            "C", [AstFactory.typeName4("D"), AstFactory.typeName4("E")]));
   }
 
   void test_visitTypeName_nestedArg() {
-    _assertSource("C<D<E>>", AstFactory.typeName4(
-        "C", [AstFactory.typeName4("D", [AstFactory.typeName4("E")])]));
+    _assertSource(
+        "C<D<E>>",
+        AstFactory.typeName4("C", [
+          AstFactory.typeName4("D", [AstFactory.typeName4("E")])
+        ]));
   }
 
   void test_visitTypeName_noArgs() {
@@ -3157,19 +3780,22 @@
   }
 
   void test_visitVariableDeclarationList_const_type() {
-    _assertSource("const C a, b", AstFactory.variableDeclarationList(
-        Keyword.CONST, AstFactory.typeName4("C"), [
-      AstFactory.variableDeclaration("a"),
-      AstFactory.variableDeclaration("b")
-    ]));
+    _assertSource(
+        "const C a, b",
+        AstFactory.variableDeclarationList(
+            Keyword.CONST, AstFactory.typeName4("C"), [
+          AstFactory.variableDeclaration("a"),
+          AstFactory.variableDeclaration("b")
+        ]));
   }
 
   void test_visitVariableDeclarationList_final_noType() {
-    _assertSource("final a, b", AstFactory.variableDeclarationList2(
-        Keyword.FINAL, [
-      AstFactory.variableDeclaration("a"),
-      AstFactory.variableDeclaration("b")
-    ]));
+    _assertSource(
+        "final a, b",
+        AstFactory.variableDeclarationList2(Keyword.FINAL, [
+          AstFactory.variableDeclaration("a"),
+          AstFactory.variableDeclaration("b")
+        ]));
   }
 
   void test_visitVariableDeclarationList_final_withMetadata() {
@@ -3184,36 +3810,45 @@
   }
 
   void test_visitVariableDeclarationList_type() {
-    _assertSource("C a, b", AstFactory.variableDeclarationList(null,
-        AstFactory.typeName4("C"), [
-      AstFactory.variableDeclaration("a"),
-      AstFactory.variableDeclaration("b")
-    ]));
+    _assertSource(
+        "C a, b",
+        AstFactory.variableDeclarationList(null, AstFactory.typeName4("C"), [
+          AstFactory.variableDeclaration("a"),
+          AstFactory.variableDeclaration("b")
+        ]));
   }
 
   void test_visitVariableDeclarationList_var() {
-    _assertSource("var a, b", AstFactory.variableDeclarationList2(Keyword.VAR, [
-      AstFactory.variableDeclaration("a"),
-      AstFactory.variableDeclaration("b")
-    ]));
+    _assertSource(
+        "var a, b",
+        AstFactory.variableDeclarationList2(Keyword.VAR, [
+          AstFactory.variableDeclaration("a"),
+          AstFactory.variableDeclaration("b")
+        ]));
   }
 
   void test_visitVariableDeclarationStatement() {
-    _assertSource("C c;", AstFactory.variableDeclarationStatement(null,
-        AstFactory.typeName4("C"), [AstFactory.variableDeclaration("c")]));
+    _assertSource(
+        "C c;",
+        AstFactory.variableDeclarationStatement(null, AstFactory.typeName4("C"),
+            [AstFactory.variableDeclaration("c")]));
   }
 
   void test_visitWhileStatement() {
-    _assertSource("while (c) {}", AstFactory.whileStatement(
-        AstFactory.identifier3("c"), AstFactory.block()));
+    _assertSource(
+        "while (c) {}",
+        AstFactory.whileStatement(
+            AstFactory.identifier3("c"), AstFactory.block()));
   }
 
   void test_visitWithClause_multiple() {
-    _assertSource("with A, B, C", AstFactory.withClause([
-      AstFactory.typeName4("A"),
-      AstFactory.typeName4("B"),
-      AstFactory.typeName4("C")
-    ]));
+    _assertSource(
+        "with A, B, C",
+        AstFactory.withClause([
+          AstFactory.typeName4("A"),
+          AstFactory.typeName4("B"),
+          AstFactory.typeName4("C")
+        ]));
   }
 
   void test_visitWithClause_single() {
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 29e0b67..743399e 100644
--- a/pkg/analyzer/test/generated/compile_time_error_code_test.dart
+++ b/pkg/analyzer/test/generated/compile_time_error_code_test.dart
@@ -7,13 +7,13 @@
 import 'package:analyzer/src/generated/error.dart';
 import 'package:analyzer/src/generated/parser.dart' show ParserErrorCode;
 import 'package:analyzer/src/generated/source_io.dart';
-import 'package:unittest/unittest.dart' as _ut;
 
 import '../reflective_tests.dart';
+import '../utils.dart';
 import 'resolver_test.dart';
 
 main() {
-  _ut.groupSep = ' | ';
+  initializeTestEnvironment();
   runReflectiveTests(CompileTimeErrorCodeTest);
 }
 
@@ -207,10 +207,14 @@
 library L;
 export 'lib1.dart';
 export 'lib2.dart';''');
-    addNamedSource("/lib1.dart", r'''
+    addNamedSource(
+        "/lib1.dart",
+        r'''
 library lib1;
 class N {}''');
-    addNamedSource("/lib2.dart", r'''
+    addNamedSource(
+        "/lib2.dart",
+        r'''
 library lib2;
 class N {}''');
     computeLibrarySourceErrors(source);
@@ -471,7 +475,9 @@
   }
 
   void test_async_used_as_identifier_in_suffix() {
-    addNamedSource("/lib1.dart", r'''
+    addNamedSource(
+        "/lib1.dart",
+        r'''
 library lib1;
 int async;
 ''');
@@ -955,7 +961,9 @@
 main() {
   const a.A();
 }'''
-    ], <ErrorCode>[CompileTimeErrorCode.CONST_DEFERRED_CLASS]);
+    ], <ErrorCode>[
+      CompileTimeErrorCode.CONST_DEFERRED_CLASS
+    ]);
   }
 
   void test_constDeferredClass_namedConstructor() {
@@ -971,7 +979,9 @@
 main() {
   const a.A.b();
 }'''
-    ], <ErrorCode>[CompileTimeErrorCode.CONST_DEFERRED_CLASS]);
+    ], <ErrorCode>[
+      CompileTimeErrorCode.CONST_DEFERRED_CLASS
+    ]);
   }
 
   void test_constEval_newInstance_constConstructor() {
@@ -999,6 +1009,20 @@
     verify([source]);
   }
 
+  void test_constEval_nonStaticField_inGenericClass() {
+    Source source = addSource('''
+class C<T> {
+  const C();
+  T get t => null;
+}
+
+const x = const C().t;''');
+    computeLibrarySourceErrors(source);
+    assertErrors(source,
+        [CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE]);
+    verify([source]);
+  }
+
   void test_constEval_propertyExtraction_targetNotConst() {
     Source source = addSource(r'''
 class A {
@@ -1411,8 +1435,10 @@
   }
 
   void test_constWithNonType_fromLibrary() {
-    Source source1 = addNamedSource("lib.dart", "");
-    Source source2 = addNamedSource("lib2.dart", r'''
+    Source source1 = addNamedSource("/lib.dart", "");
+    Source source2 = addNamedSource(
+        "/lib2.dart",
+        r'''
 import 'lib.dart' as lib;
 void f() {
   const lib.A();
@@ -1548,16 +1574,22 @@
   }
 
   void test_duplicateDefinition_acrossLibraries() {
-    Source librarySource = addNamedSource("/lib.dart", r'''
+    Source librarySource = addNamedSource(
+        "/lib.dart",
+        r'''
 library lib;
 
 part 'a.dart';
 part 'b.dart';''');
-    Source sourceA = addNamedSource("/a.dart", r'''
+    Source sourceA = addNamedSource(
+        "/a.dart",
+        r'''
 part of lib;
 
 class A {}''');
-    Source sourceB = addNamedSource("/b.dart", r'''
+    Source sourceB = addNamedSource(
+        "/b.dart",
+        r'''
 part of lib;
 
 class A {}''');
@@ -1830,7 +1862,9 @@
 library root;
 import 'lib1.dart' deferred as a;
 class B extends a.A {}'''
-    ], <ErrorCode>[CompileTimeErrorCode.EXTENDS_DEFERRED_CLASS]);
+    ], <ErrorCode>[
+      CompileTimeErrorCode.EXTENDS_DEFERRED_CLASS
+    ]);
   }
 
   void test_extendsDeferredClass_classTypeAlias() {
@@ -1843,7 +1877,9 @@
 import 'lib1.dart' deferred as a;
 class M {}
 class C = a.A with M;'''
-    ], <ErrorCode>[CompileTimeErrorCode.EXTENDS_DEFERRED_CLASS]);
+    ], <ErrorCode>[
+      CompileTimeErrorCode.EXTENDS_DEFERRED_CLASS
+    ]);
   }
 
   void test_extendsDisallowedClass_class_bool() {
@@ -2262,7 +2298,9 @@
 library root;
 import 'lib1.dart' deferred as a;
 class B implements a.A {}'''
-    ], <ErrorCode>[CompileTimeErrorCode.IMPLEMENTS_DEFERRED_CLASS]);
+    ], <ErrorCode>[
+      CompileTimeErrorCode.IMPLEMENTS_DEFERRED_CLASS
+    ]);
   }
 
   void test_implementsDeferredClass_classTypeAlias() {
@@ -2276,7 +2314,9 @@
 class B {}
 class M {}
 class C = B with M implements a.A;'''
-    ], <ErrorCode>[CompileTimeErrorCode.IMPLEMENTS_DEFERRED_CLASS]);
+    ], <ErrorCode>[
+      CompileTimeErrorCode.IMPLEMENTS_DEFERRED_CLASS
+    ]);
   }
 
   void test_implementsDisallowedClass_class_bool() {
@@ -2564,10 +2604,8 @@
     // directive for the error, this is such a minor corner case that we don't
     // think we should add the additional computation time to figure out such
     // cases.
-    assertErrors(source, [
-      CompileTimeErrorCode.IMPORT_INTERNAL_LIBRARY,
-      HintCode.UNUSED_IMPORT
-    ]);
+    assertErrors(source,
+        [CompileTimeErrorCode.IMPORT_INTERNAL_LIBRARY, HintCode.UNUSED_IMPORT]);
     verify([source]);
   }
 
@@ -2579,10 +2617,8 @@
     // directive for the error, this is such a minor corner case that we don't
     // think we should add the additional computation time to figure out such
     // cases.
-    assertErrors(source, [
-      CompileTimeErrorCode.IMPORT_INTERNAL_LIBRARY,
-      HintCode.UNUSED_IMPORT
-    ]);
+    assertErrors(source,
+        [CompileTimeErrorCode.IMPORT_INTERNAL_LIBRARY, HintCode.UNUSED_IMPORT]);
     verify([source]);
   }
 
@@ -2591,7 +2627,9 @@
 library lib;
 import 'part.dart';
 A a;''');
-    addNamedSource("/part.dart", r'''
+    addNamedSource(
+        "/part.dart",
+        r'''
 part of lib;
 class A{}''');
     computeLibrarySourceErrors(source);
@@ -2865,7 +2903,9 @@
   }
 
   void test_invalidAnnotation_importWithPrefix_getter() {
-    addNamedSource("/lib.dart", r'''
+    addNamedSource(
+        "/lib.dart",
+        r'''
 library lib;
 get V => 0;''');
     Source source = addSource(r'''
@@ -2879,7 +2919,9 @@
   }
 
   void test_invalidAnnotation_importWithPrefix_notConstantVariable() {
-    addNamedSource("/lib.dart", r'''
+    addNamedSource(
+        "/lib.dart",
+        r'''
 library lib;
 final V = 0;''');
     Source source = addSource(r'''
@@ -2893,7 +2935,9 @@
   }
 
   void test_invalidAnnotation_importWithPrefix_notVariableOrConstructorInvocation() {
-    addNamedSource("/lib.dart", r'''
+    addNamedSource(
+        "/lib.dart",
+        r'''
 library lib;
 typedef V();''');
     Source source = addSource(r'''
@@ -3464,7 +3508,9 @@
 library root;
 import 'lib1.dart' deferred as a;
 class B extends Object with a.A {}'''
-    ], <ErrorCode>[CompileTimeErrorCode.MIXIN_DEFERRED_CLASS]);
+    ], <ErrorCode>[
+      CompileTimeErrorCode.MIXIN_DEFERRED_CLASS
+    ]);
   }
 
   void test_mixinDeferredClass_classTypeAlias() {
@@ -3477,7 +3523,9 @@
 import 'lib1.dart' deferred as a;
 class B {}
 class C = B with a.A;'''
-    ], <ErrorCode>[CompileTimeErrorCode.MIXIN_DEFERRED_CLASS]);
+    ], <ErrorCode>[
+      CompileTimeErrorCode.MIXIN_DEFERRED_CLASS
+    ]);
   }
 
   void test_mixinHasNoConstructors_mixinApp() {
@@ -4756,7 +4804,9 @@
   }
 
   void test_prefix_conditionalPropertyAccess_call() {
-    addNamedSource('/lib.dart', '''
+    addNamedSource(
+        '/lib.dart',
+        '''
 library lib;
 g() {}
 ''');
@@ -4773,7 +4823,9 @@
   }
 
   void test_prefix_conditionalPropertyAccess_call_loadLibrary() {
-    addNamedSource('/lib.dart', '''
+    addNamedSource(
+        '/lib.dart',
+        '''
 library lib;
 ''');
     Source source = addSource('''
@@ -4789,7 +4841,9 @@
   }
 
   void test_prefix_conditionalPropertyAccess_get() {
-    addNamedSource('/lib.dart', '''
+    addNamedSource(
+        '/lib.dart',
+        '''
 library lib;
 var x;
 ''');
@@ -4806,7 +4860,9 @@
   }
 
   void test_prefix_conditionalPropertyAccess_get_loadLibrary() {
-    addNamedSource('/lib.dart', '''
+    addNamedSource(
+        '/lib.dart',
+        '''
 library lib;
 ''');
     Source source = addSource('''
@@ -4822,7 +4878,9 @@
   }
 
   void test_prefix_conditionalPropertyAccess_set() {
-    addNamedSource('/lib.dart', '''
+    addNamedSource(
+        '/lib.dart',
+        '''
 library lib;
 var x;
 ''');
@@ -4839,7 +4897,9 @@
   }
 
   void test_prefix_conditionalPropertyAccess_set_loadLibrary() {
-    addNamedSource('/lib.dart', '''
+    addNamedSource(
+        '/lib.dart',
+        '''
 library lib;
 ''');
     Source source = addSource('''
@@ -4885,7 +4945,9 @@
   }
 
   void test_prefixCollidesWithTopLevelMembers_functionTypeAlias() {
-    addNamedSource("/lib.dart", r'''
+    addNamedSource(
+        "/lib.dart",
+        r'''
 library lib;
 class A{}''');
     Source source = addSource(r'''
@@ -4899,7 +4961,9 @@
   }
 
   void test_prefixCollidesWithTopLevelMembers_topLevelFunction() {
-    addNamedSource("/lib.dart", r'''
+    addNamedSource(
+        "/lib.dart",
+        r'''
 library lib;
 class A{}''');
     Source source = addSource(r'''
@@ -4913,7 +4977,9 @@
   }
 
   void test_prefixCollidesWithTopLevelMembers_topLevelVariable() {
-    addNamedSource("/lib.dart", r'''
+    addNamedSource(
+        "/lib.dart",
+        r'''
 library lib;
 class A{}''');
     Source source = addSource(r'''
@@ -4927,7 +4993,9 @@
   }
 
   void test_prefixCollidesWithTopLevelMembers_type() {
-    addNamedSource("/lib.dart", r'''
+    addNamedSource(
+        "/lib.dart",
+        r'''
 library lib;
 class A{}''');
     Source source = addSource(r'''
@@ -4969,7 +5037,9 @@
   }
 
   void test_prefixNotFollowedByDot_conditionalMethodInvocation() {
-    addNamedSource('/lib.dart', '''
+    addNamedSource(
+        '/lib.dart',
+        '''
 library lib;
 g() {}
 ''');
@@ -5547,7 +5617,9 @@
 import 'lib1.dart' deferred as lib;
 import 'lib2.dart' as lib;
 main() { lib.f1(); lib.f2(); }'''
-    ], <ErrorCode>[CompileTimeErrorCode.SHARED_DEFERRED_PREFIX]);
+    ], <ErrorCode>[
+      CompileTimeErrorCode.SHARED_DEFERRED_PREFIX
+    ]);
   }
 
   void test_superInInvalidContext_binaryExpression() {
diff --git a/pkg/analyzer/test/generated/element_test.dart b/pkg/analyzer/test/generated/element_test.dart
index d5f9ffb..14485e2 100644
--- a/pkg/analyzer/test/generated/element_test.dart
+++ b/pkg/analyzer/test/generated/element_test.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.
 
-// This code was auto-generated, is not intended to be edited, and is subject to
-// significant change. Please see the README file for more information.
-
 library engine.element_test;
 
 import 'package:analyzer/src/generated/ast.dart';
@@ -19,11 +16,12 @@
 import 'package:unittest/unittest.dart';
 
 import '../reflective_tests.dart';
+import '../utils.dart';
 import 'resolver_test.dart' show TestTypeProvider, AnalysisContextHelper;
 import 'test_support.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   runReflectiveTests(ElementKindTest);
   runReflectiveTests(FieldElementImplTest);
   runReflectiveTests(FunctionTypeImplTest);
@@ -46,7 +44,9 @@
   void test_computeNode_ClassDeclaration() {
     AnalysisContextHelper contextHelper = new AnalysisContextHelper();
     AnalysisContext context = contextHelper.context;
-    Source source = contextHelper.addSource("/test.dart", r'''
+    Source source = contextHelper.addSource(
+        "/test.dart",
+        r'''
 class A {}
 @deprecated class B {}
 enum C {C1, C2, C3}
@@ -99,7 +99,9 @@
   void test_computeNode_ClassTypeAlias() {
     AnalysisContextHelper contextHelper = new AnalysisContextHelper();
     AnalysisContext context = contextHelper.context;
-    Source source = contextHelper.addSource("/test.dart", r'''
+    Source source = contextHelper.addSource(
+        "/test.dart",
+        r'''
 abstract class A<K, V> = Object with MapMixin<K, V>;
 ''');
     // prepare CompilationUnitElement
@@ -990,7 +992,9 @@
   void test_getElementAt_multipleUnitsInLibrary() {
     AnalysisContextHelper contextHelper = new AnalysisContextHelper();
     AnalysisContext context = contextHelper.context;
-    Source libSource = contextHelper.addSource("/my_lib.dart", r'''
+    Source libSource = contextHelper.addSource(
+        "/my_lib.dart",
+        r'''
 library my_lib;
 part 'unit_a.dart';
 part 'unit_b.dart';
@@ -1241,7 +1245,9 @@
   void test_computeNode() {
     AnalysisContextHelper contextHelper = new AnalysisContextHelper();
     AnalysisContext context = contextHelper.context;
-    Source source = contextHelper.addSource("/test.dart", r'''
+    Source source = contextHelper.addSource(
+        "/test.dart",
+        r'''
 class A {
   int a;
 }
@@ -1271,7 +1277,8 @@
 @reflectiveTest
 class FunctionTypeImplTest extends EngineTestCase {
   void test_creation() {
-    expect(new FunctionTypeImpl(
+    expect(
+        new FunctionTypeImpl(
             new FunctionElementImpl.forNode(AstFactory.identifier3("f"))),
         isNotNull);
   }
@@ -1415,10 +1422,16 @@
 
   void test_isSubtypeOf_namedParameters_isNotAssignable() {
     // ! ({name: A}) -> void <: ({name: B}) -> void
-    FunctionType t = ElementFactory.functionElement4("t", null, null,
+    FunctionType t = ElementFactory.functionElement4(
+        "t",
+        null,
+        null,
         <String>["name"],
         <ClassElement>[ElementFactory.classElement2("A")]).type;
-    FunctionType s = ElementFactory.functionElement4("s", null, null,
+    FunctionType s = ElementFactory.functionElement4(
+        "s",
+        null,
+        null,
         <String>["name"],
         <ClassElement>[ElementFactory.classElement2("B")]).type;
     expect(t.isSubtypeOf(s), isFalse);
@@ -1514,8 +1527,8 @@
   void test_isSubtypeOf_normalAndPositionalArgs_2() {
     // (a, [a]) -> void <: (a) -> void
     ClassElement a = ElementFactory.classElement2("A");
-    FunctionType t = ElementFactory.functionElement6(
-        "t", <ClassElement>[a], <ClassElement>[a]).type;
+    FunctionType t = ElementFactory
+        .functionElement6("t", <ClassElement>[a], <ClassElement>[a]).type;
     FunctionType s =
         ElementFactory.functionElement5("s", <ClassElement>[a]).type;
     expect(t.isSubtypeOf(s), isTrue);
@@ -1541,8 +1554,8 @@
     ClassElement e = ElementFactory.classElement2("E");
     FunctionType t = ElementFactory.functionElement6(
         "t", <ClassElement>[a, b], <ClassElement>[c, d, e]).type;
-    FunctionType s = ElementFactory.functionElement6(
-        "s", <ClassElement>[a, b, c], <ClassElement>[d]).type;
+    FunctionType s = ElementFactory
+        .functionElement6("s", <ClassElement>[a, b, c], <ClassElement>[d]).type;
     expect(t.isSubtypeOf(s), isTrue);
     expect(s.isSubtypeOf(t), isFalse);
   }
@@ -1674,10 +1687,12 @@
 
   void test_isSubtypeOf_returnType_tNotAssignableToS() {
     // ! () -> A <: () -> B
-    FunctionType t = ElementFactory.functionElement2(
-        "t", ElementFactory.classElement2("A")).type;
-    FunctionType s = ElementFactory.functionElement2(
-        "s", ElementFactory.classElement2("B")).type;
+    FunctionType t = ElementFactory
+        .functionElement2("t", ElementFactory.classElement2("A"))
+        .type;
+    FunctionType s = ElementFactory
+        .functionElement2("s", ElementFactory.classElement2("B"))
+        .type;
     expect(t.isSubtypeOf(s), isFalse);
   }
 
@@ -1721,8 +1736,8 @@
     ClassElement a = ElementFactory.classElement2("A");
     FunctionType t =
         ElementFactory.functionElement5("t", <ClassElement>[a]).type;
-    FunctionType s = ElementFactory.functionElement7(
-        "s", null, <String>["name"], <ClassElement>[a]).type;
+    FunctionType s = ElementFactory
+        .functionElement7("s", null, <String>["name"], <ClassElement>[a]).type;
     expect(t.isSubtypeOf(s), isFalse);
     expect(s.isSubtypeOf(t), isFalse);
   }
@@ -1733,8 +1748,8 @@
     ClassElement a = ElementFactory.classElement2("A");
     FunctionType t =
         ElementFactory.functionElement6("t", null, <ClassElement>[a]).type;
-    FunctionType s = ElementFactory.functionElement7(
-        "s", null, <String>["name"], <ClassElement>[a]).type;
+    FunctionType s = ElementFactory
+        .functionElement7("s", null, <String>["name"], <ClassElement>[a]).type;
     expect(t.isSubtypeOf(s), isFalse);
     expect(s.isSubtypeOf(t), isFalse);
   }
@@ -3139,8 +3154,8 @@
     classA.methods = <MethodElement>[
       ElementFactory.methodElement("call", VoidTypeImpl.instance, [stringType])
     ];
-    FunctionType functionType = ElementFactory.functionElement5(
-        "f", <ClassElement>[stringType.element]).type;
+    FunctionType functionType = ElementFactory
+        .functionElement5("f", <ClassElement>[stringType.element]).type;
     expect(classA.type.isSubtypeOf(functionType), isTrue);
   }
 
@@ -3717,7 +3732,8 @@
 @reflectiveTest
 class LibraryElementImplTest extends EngineTestCase {
   void test_creation() {
-    expect(new LibraryElementImpl.forNode(
+    expect(
+        new LibraryElementImpl.forNode(
             createAnalysisContext(), AstFactory.libraryIdentifier2(["l"])),
         isNotNull);
   }
@@ -3788,10 +3804,12 @@
     AnalysisContext context = createAnalysisContext();
     LibraryElementImpl library = ElementFactory.library(context, "app");
     LibraryElementImpl libraryA = ElementFactory.library(context, "A");
-    libraryA.imports =
-        <ImportElementImpl>[ElementFactory.importFor(library, null)];
-    library.imports =
-        <ImportElementImpl>[ElementFactory.importFor(libraryA, null)];
+    libraryA.imports = <ImportElementImpl>[
+      ElementFactory.importFor(library, null)
+    ];
+    library.imports = <ImportElementImpl>[
+      ElementFactory.importFor(libraryA, null)
+    ];
     List<LibraryElement> libraries = library.visibleLibraries;
     expect(libraries, unorderedEquals(<LibraryElement>[library, libraryA]));
   }
@@ -3809,8 +3827,9 @@
     AnalysisContext context = createAnalysisContext();
     LibraryElementImpl library = ElementFactory.library(context, "app");
     LibraryElementImpl libraryA = ElementFactory.library(context, "A");
-    library.imports =
-        <ImportElementImpl>[ElementFactory.importFor(libraryA, null)];
+    library.imports = <ImportElementImpl>[
+      ElementFactory.importFor(libraryA, null)
+    ];
     List<LibraryElement> libraries = library.visibleLibraries;
     expect(libraries, unorderedEquals(<LibraryElement>[library, libraryA]));
   }
@@ -3821,8 +3840,9 @@
     LibraryElementImpl libraryA = ElementFactory.library(context, "A");
     LibraryElementImpl libraryAA = ElementFactory.library(context, "AA");
     libraryA.exports = <ExportElementImpl>[ElementFactory.exportFor(libraryAA)];
-    library.imports =
-        <ImportElementImpl>[ElementFactory.importFor(libraryA, null)];
+    library.imports = <ImportElementImpl>[
+      ElementFactory.importFor(libraryA, null)
+    ];
     List<LibraryElement> libraries = library.visibleLibraries;
     expect(libraries,
         unorderedEquals(<LibraryElement>[library, libraryA, libraryAA]));
@@ -3834,15 +3854,18 @@
     LibraryElementImpl libraryA = ElementFactory.library(context, "A");
     LibraryElementImpl libraryAA = ElementFactory.library(context, "AA");
     LibraryElementImpl libraryB = ElementFactory.library(context, "B");
-    libraryA.imports =
-        <ImportElementImpl>[ElementFactory.importFor(libraryAA, null)];
+    libraryA.imports = <ImportElementImpl>[
+      ElementFactory.importFor(libraryAA, null)
+    ];
     library.imports = <ImportElementImpl>[
       ElementFactory.importFor(libraryA, null),
       ElementFactory.importFor(libraryB, null)
     ];
     List<LibraryElement> libraries = library.visibleLibraries;
-    expect(libraries, unorderedEquals(
-        <LibraryElement>[library, libraryA, libraryAA, libraryB]));
+    expect(
+        libraries,
+        unorderedEquals(
+            <LibraryElement>[library, libraryA, libraryAA, libraryB]));
   }
 
   void test_getVisibleLibraries_noImports() {
@@ -3886,7 +3909,9 @@
   void test_computeNode() {
     AnalysisContextHelper contextHelper = new AnalysisContextHelper();
     AnalysisContext context = contextHelper.context;
-    Source source = contextHelper.addSource("/test.dart", r'''
+    Source source = contextHelper.addSource(
+        "/test.dart",
+        r'''
 abstract class A {
   String m1() => null;
   m2();
@@ -3918,7 +3943,9 @@
     options.analyzeFunctionBodies = false;
     AnalysisContextHelper contextHelper = new AnalysisContextHelper(options);
     AnalysisContext context = contextHelper.context;
-    Source source = contextHelper.addSource("/test.dart", r'''
+    Source source = contextHelper.addSource(
+        "/test.dart",
+        r'''
 abstract class A {
   String m1() => null;
   m2();
@@ -3968,9 +3995,11 @@
     Element firstElement = ElementFactory.localVariableElement2("xx");
     Element secondElement = ElementFactory.localVariableElement2("yy");
     Element thirdElement = ElementFactory.localVariableElement2("zz");
-    Element result = MultiplyDefinedElementImpl.fromElements(null,
+    Element result = MultiplyDefinedElementImpl.fromElements(
+        null,
         MultiplyDefinedElementImpl.fromElements(
-            null, firstElement, secondElement), thirdElement);
+            null, firstElement, secondElement),
+        thirdElement);
     EngineTestCase.assertInstanceOf(
         (obj) => obj is MultiplyDefinedElement, MultiplyDefinedElement, result);
     List<Element> elements =
@@ -3994,7 +4023,9 @@
   void test_computeNode_DefaultFormalParameter() {
     AnalysisContextHelper contextHelper = new AnalysisContextHelper();
     AnalysisContext context = contextHelper.context;
-    Source source = contextHelper.addSource("/test.dart", r'''
+    Source source = contextHelper.addSource(
+        "/test.dart",
+        r'''
 main([int p = 42]) {
 }''');
     // prepare CompilationUnitElement
@@ -4013,7 +4044,9 @@
   void test_computeNode_FieldFormalParameter() {
     AnalysisContextHelper contextHelper = new AnalysisContextHelper();
     AnalysisContext context = contextHelper.context;
-    Source source = contextHelper.addSource("/test.dart", r'''
+    Source source = contextHelper.addSource(
+        "/test.dart",
+        r'''
 class A {
   int p;
   A(this.p) {
@@ -4037,7 +4070,9 @@
   void test_computeNode_FunctionTypedFormalParameter() {
     AnalysisContextHelper contextHelper = new AnalysisContextHelper();
     AnalysisContext context = contextHelper.context;
-    Source source = contextHelper.addSource("/test.dart", r'''
+    Source source = contextHelper.addSource(
+        "/test.dart",
+        r'''
 main(p(int a, int b)) {
 }''');
     // prepare CompilationUnitElement
@@ -4056,7 +4091,9 @@
   void test_computeNode_SimpleFormalParameter() {
     AnalysisContextHelper contextHelper = new AnalysisContextHelper();
     AnalysisContext context = contextHelper.context;
-    Source source = contextHelper.addSource("/test.dart", r'''
+    Source source = contextHelper.addSource(
+        "/test.dart",
+        r'''
 main(int p) {
 }''');
     // prepare CompilationUnitElement
@@ -4076,7 +4113,8 @@
 @reflectiveTest
 class TypeParameterTypeImplTest extends EngineTestCase {
   void test_creation() {
-    expect(new TypeParameterTypeImpl(
+    expect(
+        new TypeParameterTypeImpl(
             new TypeParameterElementImpl.forNode(AstFactory.identifier3("E"))),
         isNotNull);
   }
diff --git a/pkg/analyzer/test/generated/engine_test.dart b/pkg/analyzer/test/generated/engine_test.dart
index 13c0b66..7224060 100644
--- a/pkg/analyzer/test/generated/engine_test.dart
+++ b/pkg/analyzer/test/generated/engine_test.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.
 
-// This code was auto-generated, is not intended to be edited, and is subject to
-// significant change. Please see the README file for more information.
-
 library engine.engine_test;
 
 import 'dart:async';
@@ -34,7 +31,7 @@
 import 'package:analyzer/src/generated/utilities_collection.dart';
 import 'package:analyzer/src/services/lint.dart';
 import 'package:analyzer/src/string_source.dart';
-import 'package:analyzer/task/model.dart' hide AnalysisTask;
+import 'package:analyzer/task/model.dart' as newContext;
 import 'package:html/dom.dart' show Document;
 import 'package:path/path.dart' as pathos;
 import 'package:typed_mock/typed_mock.dart';
@@ -42,12 +39,13 @@
 import 'package:watcher/src/utils.dart';
 
 import '../reflective_tests.dart';
+import '../utils.dart';
 import 'all_the_rest_test.dart';
 import 'resolver_test.dart';
 import 'test_support.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   // Tests for the classes used in both old and new analysis implementations.
   runReflectiveTests(SourcesChangedEventTest);
   // Tests for the classes used in the old analysis implementation.
@@ -196,7 +194,9 @@
   SourceFactory _sourceFactory;
 
   void fail_performAnalysisTask_importedLibraryDelete_html() {
-    Source htmlSource = _addSource("/page.html", r'''
+    Source htmlSource = _addSource(
+        "/page.html",
+        r'''
 <html><body><script type="application/dart">
   import 'libB.dart';
   main() {print('hello dart');}
@@ -209,7 +209,8 @@
         _context.getResolvedCompilationUnit2(libBSource, libBSource), isNotNull,
         reason: "libB resolved 1");
     expect(!_hasAnalysisErrorWithErrorSeverity(_context.getErrors(htmlSource)),
-        isTrue, reason: "htmlSource doesn't have errors");
+        isTrue,
+        reason: "htmlSource doesn't have errors");
     // remove libB.dart content and analyze
     _context.setContents(libBSource, null);
     _analyzeAll_assertFinished();
@@ -310,11 +311,15 @@
   void test_applyChanges_change_flush_element() {
     _context = AnalysisContextFactory.oldContextWithCore();
     _sourceFactory = _context.sourceFactory;
-    Source librarySource = _addSource("/lib.dart", r'''
+    Source librarySource = _addSource(
+        "/lib.dart",
+        r'''
 library lib;
 int a = 0;''');
     expect(_context.computeLibraryElement(librarySource), isNotNull);
-    _context.setContents(librarySource, r'''
+    _context.setContents(
+        librarySource,
+        r'''
 library lib;
 int aa = 0;''');
     expect(_context.getLibraryElement(librarySource), isNull);
@@ -354,8 +359,8 @@
     Element declarationElement = declaration.variables.variables[0].element;
     TopLevelVariableDeclaration use =
         partUnit.declarations[0] as TopLevelVariableDeclaration;
-    Element useElement = (use.variables.variables[
-        0].initializer as SimpleIdentifier).staticElement;
+    Element useElement = (use.variables.variables[0].initializer
+        as SimpleIdentifier).staticElement;
     expect((useElement as PropertyAccessorElement).variable,
         same(declarationElement));
     return pumpEventQueue().then((_) {
@@ -458,11 +463,15 @@
    */
   void test_applyChanges_remove_incremental() {
     MemoryResourceProvider resourceProvider = new MemoryResourceProvider();
-    Source source = resourceProvider.newFile('/test.dart', r'''
+    Source source = resourceProvider
+        .newFile(
+            '/test.dart',
+            r'''
 main() {
   print(1);
 }
-''').createSource();
+''')
+        .createSource();
     _context = AnalysisContextFactory.oldContextWithCore();
     _context.analysisOptions = new AnalysisOptionsImpl()..incremental = true;
     _context.applyChanges(new ChangeSet()..addedSource(source));
@@ -470,7 +479,9 @@
     _analyzeAll_assertFinished();
     CompilationUnit unit = _context.getResolvedCompilationUnit2(source, source);
     // add overlay
-    _context.setContents(source, r'''
+    _context.setContents(
+        source,
+        r'''
 main() {
   print(12);
 }
@@ -521,7 +532,9 @@
     _context = AnalysisContextFactory.oldContextWithCore();
     _sourceFactory = _context.sourceFactory;
     String comment = "/** Comment */";
-    Source source = _addSource("/test.dart", """
+    Source source = _addSource(
+        "/test.dart",
+        """
 $comment
 class A {}""");
     LibraryElement libraryElement = _context.computeLibraryElement(source);
@@ -668,7 +681,9 @@
   }
 
   void test_computeLineInfo_dart() {
-    Source source = _addSource("/test.dart", r'''
+    Source source = _addSource(
+        "/test.dart",
+        r'''
 library lib;
 
 main() {}''');
@@ -677,7 +692,9 @@
   }
 
   void test_computeLineInfo_html() {
-    Source source = _addSource("/test.html", r'''
+    Source source = _addSource(
+        "/test.html",
+        r'''
 <html>
   <body>
     <h1>A</h1>
@@ -848,6 +865,15 @@
     });
   }
 
+  void test_configurationData() {
+    var key = new newContext.ResultDescriptor('test_key', '');
+    var testData = ['test', 'data'];
+    _context.setConfigurationData(key, testData);
+    expect(_context.getConfigurationData(key), testData);
+    var unusedKey = new newContext.ResultDescriptor('unused_key', '');
+    expect(_context.getConfigurationData(unusedKey), null);
+  }
+
   void test_dispose() {
     expect(_context.isDisposed, isFalse);
     _context.dispose();
@@ -923,7 +949,9 @@
   }
 
   void test_getElement_constructor_named() {
-    Source source = _addSource("/lib.dart", r'''
+    Source source = _addSource(
+        "/lib.dart",
+        r'''
 class A {
   A.named() {}
 }''');
@@ -937,7 +965,9 @@
   }
 
   void test_getElement_constructor_unnamed() {
-    Source source = _addSource("/lib.dart", r'''
+    Source source = _addSource(
+        "/lib.dart",
+        r'''
 class A {
   A() {}
 }''');
@@ -988,7 +1018,9 @@
   }
 
   void test_getErrors_html_some() {
-    Source source = _addSource("/test.html", r'''
+    Source source = _addSource(
+        "/test.html",
+        r'''
 <html><head>
 <script type='application/dart' src='test.dart'/>
 </head></html>''');
@@ -1018,7 +1050,9 @@
   void test_getHtmlFilesReferencing_html() {
     _context = AnalysisContextFactory.oldContextWithCore();
     _sourceFactory = _context.sourceFactory;
-    Source htmlSource = _addSource("/test.html", r'''
+    Source htmlSource = _addSource(
+        "/test.html",
+        r'''
 <html><head>
 <script type='application/dart' src='test.dart'/>
 <script type='application/dart' src='test.js'/>
@@ -1034,7 +1068,9 @@
   }
 
   void test_getHtmlFilesReferencing_library() {
-    Source htmlSource = _addSource("/test.html", r'''
+    Source htmlSource = _addSource(
+        "/test.html",
+        r'''
 <html><head>
 <script type='application/dart' src='test.dart'/>
 <script type='application/dart' src='test.js'/>
@@ -1051,7 +1087,9 @@
   void test_getHtmlFilesReferencing_part() {
     _context = AnalysisContextFactory.oldContextWithCore();
     _sourceFactory = _context.sourceFactory;
-    Source htmlSource = _addSource("/test.html", r'''
+    Source htmlSource = _addSource(
+        "/test.html",
+        r'''
 <html><head>
 <script type='application/dart' src='test.dart'/>
 <script type='application/dart' src='test.js'/>
@@ -1107,7 +1145,9 @@
     _sourceFactory = _context.sourceFactory;
     List<Source> sources = _context.launchableClientLibrarySources;
     expect(sources, hasLength(0));
-    Source source = _addSource("/test.dart", r'''
+    Source source = _addSource(
+        "/test.dart",
+        r'''
 import 'dart:html';
 main() {}''');
     _context.computeLibraryElement(source);
@@ -1129,7 +1169,9 @@
   void test_getLibrariesContaining() {
     _context = AnalysisContextFactory.oldContextWithCore();
     _sourceFactory = _context.sourceFactory;
-    Source librarySource = _addSource("/lib.dart", r'''
+    Source librarySource = _addSource(
+        "/lib.dart",
+        r'''
 library lib;
 part 'part.dart';''');
     Source partSource = _addSource("/part.dart", "part of lib;");
@@ -1147,11 +1189,15 @@
     _sourceFactory = _context.sourceFactory;
     Source libASource = _addSource("/libA.dart", "library libA;");
     _addSource("/libB.dart", "library libB;");
-    Source lib1Source = _addSource("/lib1.dart", r'''
+    Source lib1Source = _addSource(
+        "/lib1.dart",
+        r'''
 library lib1;
 import 'libA.dart';
 export 'libB.dart';''');
-    Source lib2Source = _addSource("/lib2.dart", r'''
+    Source lib2Source = _addSource(
+        "/lib2.dart",
+        r'''
 library lib2;
 import 'libB.dart';
 export 'libA.dart';''');
@@ -1164,7 +1210,9 @@
   void test_getLibrariesReferencedFromHtml() {
     _context = AnalysisContextFactory.oldContextWithCore();
     _sourceFactory = _context.sourceFactory;
-    Source htmlSource = _addSource("/test.html", r'''
+    Source htmlSource = _addSource(
+        "/test.html",
+        r'''
 <html><head>
 <script type='application/dart' src='test.dart'/>
 <script type='application/dart' src='test.js'/>
@@ -1180,7 +1228,9 @@
   void test_getLibrariesReferencedFromHtml_no() {
     _context = AnalysisContextFactory.oldContextWithCore();
     _sourceFactory = _context.sourceFactory;
-    Source htmlSource = _addSource("/test.html", r'''
+    Source htmlSource = _addSource(
+        "/test.html",
+        r'''
 <html><head>
 <script type='application/dart' src='test.js'/>
 </head></html>''');
@@ -1217,7 +1267,9 @@
   }
 
   void test_getLineInfo() {
-    Source source = _addSource("/test.dart", r'''
+    Source source = _addSource(
+        "/test.dart",
+        r'''
 library lib;
 
 main() {}''');
@@ -1230,9 +1282,11 @@
 
   void test_getModificationStamp_fromSource() {
     int stamp = 42;
-    expect(_context.getModificationStamp(
-        new AnalysisContextImplTest_Source_getModificationStamp_fromSource(
-            stamp)), stamp);
+    expect(
+        _context.getModificationStamp(
+            new AnalysisContextImplTest_Source_getModificationStamp_fromSource(
+                stamp)),
+        stamp);
   }
 
   void test_getModificationStamp_overridden() {
@@ -1351,7 +1405,9 @@
   void test_isClientLibrary_dart() {
     _context = AnalysisContextFactory.oldContextWithCore();
     _sourceFactory = _context.sourceFactory;
-    Source source = _addSource("/test.dart", r'''
+    Source source = _addSource(
+        "/test.dart",
+        r'''
 import 'dart:html';
 
 main() {}''');
@@ -1370,7 +1426,9 @@
   void test_isServerLibrary_dart() {
     _context = AnalysisContextFactory.oldContextWithCore();
     _sourceFactory = _context.sourceFactory;
-    Source source = _addSource("/test.dart", r'''
+    Source source = _addSource(
+        "/test.dart",
+        r'''
 library lib;
 
 main() {}''');
@@ -1435,10 +1493,14 @@
   }
 
   void test_parseHtmlUnit_resolveDirectives() {
-    Source libSource = _addSource("/lib.dart", r'''
+    Source libSource = _addSource(
+        "/lib.dart",
+        r'''
 library lib;
 class ClassA {}''');
-    Source source = _addSource("/lib.html", r'''
+    Source source = _addSource(
+        "/lib.html",
+        r'''
 <html>
 <head>
   <script type='application/dart'>
@@ -1461,13 +1523,17 @@
   }
 
   void test_performAnalysisTask_addPart() {
-    Source libSource = _addSource("/lib.dart", r'''
+    Source libSource = _addSource(
+        "/lib.dart",
+        r'''
 library lib;
 part 'part.dart';''');
     // run all tasks without part
     _analyzeAll_assertFinished();
     // add part and run all tasks
-    Source partSource = _addSource("/part.dart", r'''
+    Source partSource = _addSource(
+        "/part.dart",
+        r'''
 part of lib;
 ''');
     _analyzeAll_assertFinished();
@@ -1556,7 +1622,9 @@
   }
 
   void test_performAnalysisTask_changePartContents_makeItAPart() {
-    Source libSource = _addSource("/lib.dart", r'''
+    Source libSource = _addSource(
+        "/lib.dart",
+        r'''
 library lib;
 part 'part.dart';
 void f(x) {}''');
@@ -1569,7 +1637,9 @@
         _context.getResolvedCompilationUnit2(partSource, libSource), isNotNull,
         reason: "part resolved 1");
     // update and analyze
-    _context.setContents(partSource, r'''
+    _context.setContents(
+        partSource,
+        r'''
 part of lib;
 void g() { f(null); }''');
     expect(_context.getResolvedCompilationUnit2(libSource, libSource), isNull,
@@ -1591,18 +1661,24 @@
    * https://code.google.com/p/dart/issues/detail?id=12424
    */
   void test_performAnalysisTask_changePartContents_makeItNotPart() {
-    Source libSource = _addSource("/lib.dart", r'''
+    Source libSource = _addSource(
+        "/lib.dart",
+        r'''
 library lib;
 part 'part.dart';
 void f(x) {}''');
-    Source partSource = _addSource("/part.dart", r'''
+    Source partSource = _addSource(
+        "/part.dart",
+        r'''
 part of lib;
 void g() { f(null); }''');
     _analyzeAll_assertFinished();
     expect(_context.getErrors(libSource).errors, hasLength(0));
     expect(_context.getErrors(partSource).errors, hasLength(0));
     // Remove 'part' directive, which should make "f(null)" an error.
-    _context.setContents(partSource, r'''
+    _context.setContents(
+        partSource,
+        r'''
 //part of lib;
 void g() { f(null); }''');
     _analyzeAll_assertFinished();
@@ -1692,7 +1768,8 @@
         _context.getResolvedCompilationUnit2(libASource, libASource), isNotNull,
         reason: "libA resolved 1");
     expect(_hasAnalysisErrorWithErrorSeverity(_context.getErrors(libASource)),
-        isTrue, reason: "libA has an error");
+        isTrue,
+        reason: "libA has an error");
     // add libB.dart and analyze
     Source libBSource = _addSource("/libB.dart", "library libB;");
     _analyzeAll_assertFinished();
@@ -1703,11 +1780,14 @@
         _context.getResolvedCompilationUnit2(libBSource, libBSource), isNotNull,
         reason: "libB resolved 2");
     expect(!_hasAnalysisErrorWithErrorSeverity(_context.getErrors(libASource)),
-        isTrue, reason: "libA doesn't have errors");
+        isTrue,
+        reason: "libA doesn't have errors");
   }
 
   void test_performAnalysisTask_importedLibraryAdd_html() {
-    Source htmlSource = _addSource("/page.html", r'''
+    Source htmlSource = _addSource(
+        "/page.html",
+        r'''
 <html><body><script type="application/dart">
   import '/libB.dart';
   main() {print('hello dart');}
@@ -1716,7 +1796,8 @@
     expect(_context.getResolvedHtmlUnit(htmlSource), isNotNull,
         reason: "htmlUnit resolved 1");
     expect(_hasAnalysisErrorWithErrorSeverity(_context.getErrors(htmlSource)),
-        isTrue, reason: "htmlSource has an error");
+        isTrue,
+        reason: "htmlSource has an error");
     // add libB.dart and analyze
     Source libBSource = _addSource("/libB.dart", "library libB;");
     _analyzeAll_assertFinished();
@@ -1745,7 +1826,8 @@
         _context.getResolvedCompilationUnit2(libBSource, libBSource), isNotNull,
         reason: "libB resolved 1");
     expect(!_hasAnalysisErrorWithErrorSeverity(_context.getErrors(libASource)),
-        isTrue, reason: "libA doesn't have errors");
+        isTrue,
+        reason: "libA doesn't have errors");
     // remove libB.dart content and analyze
     _context.setContents(libBSource, null);
     _analyzeAll_assertFinished();
@@ -1753,7 +1835,8 @@
         _context.getResolvedCompilationUnit2(libASource, libASource), isNotNull,
         reason: "libA resolved 2");
     expect(_hasAnalysisErrorWithErrorSeverity(_context.getErrors(libASource)),
-        isTrue, reason: "libA has an error");
+        isTrue,
+        reason: "libA has an error");
   }
 
   void test_performAnalysisTask_IOException() {
@@ -2014,7 +2097,9 @@
   void test_setContents_null() {
     _context = AnalysisContextFactory.oldContextWithCore();
     _sourceFactory = _context.sourceFactory;
-    Source librarySource = _addSource("/lib.dart", r'''
+    Source librarySource = _addSource(
+        "/lib.dart",
+        r'''
 library lib;
 int a = 0;''');
     _context.computeLibraryElement(librarySource);
@@ -2055,10 +2140,14 @@
   void test_unreadableSource() {
     _context = AnalysisContextFactory.oldContextWithCore();
     _sourceFactory = _context.sourceFactory;
-    Source test1 = _addSource("/test1.dart", r'''
+    Source test1 = _addSource(
+        "/test1.dart",
+        r'''
 import 'test2.dart';
 library test1;''');
-    Source test2 = _addSource("/test2.dart", r'''
+    Source test2 = _addSource(
+        "/test2.dart",
+        r'''
 import 'test1.dart';
 import 'test3.dart';
 library test2;''');
@@ -2367,6 +2456,7 @@
     expect(exception, isNotNull);
     return null;
   }
+
   @override
   void internalPerform() {
     throw new AnalysisException("Forced exception");
@@ -2445,13 +2535,13 @@
     entry.setValue(DartEntry.PARSE_ERRORS, <AnalysisError>[
       new AnalysisError(source, 0, 0, ParserErrorCode.ABSTRACT_CLASS_MEMBER)
     ]);
-    entry.setValueInLibrary(DartEntry.RESOLUTION_ERRORS, source,
-        <AnalysisError>[
+    entry.setValueInLibrary(
+        DartEntry.RESOLUTION_ERRORS, source, <AnalysisError>[
       new AnalysisError(
           source, 0, 0, CompileTimeErrorCode.CONST_CONSTRUCTOR_THROWS_EXCEPTION)
     ]);
-    entry.setValueInLibrary(DartEntry.VERIFICATION_ERRORS, source,
-        <AnalysisError>[
+    entry.setValueInLibrary(
+        DartEntry.VERIFICATION_ERRORS, source, <AnalysisError>[
       new AnalysisError(
           source, 0, 0, StaticWarningCode.CASE_BLOCK_NOT_TERMINATED)
     ]);
@@ -3487,8 +3577,10 @@
   }
 
   void test_setValue_element() {
-    _setValue(DartEntry.ELEMENT, new LibraryElementImpl.forNode(
-        null, AstFactory.libraryIdentifier2(["lib"])));
+    _setValue(
+        DartEntry.ELEMENT,
+        new LibraryElementImpl.forNode(
+            null, AstFactory.libraryIdentifier2(["lib"])));
   }
 
   void test_setValue_exportedLibraries() {
@@ -3733,7 +3825,9 @@
     ChangeSet changeSet = new ChangeSet();
     changeSet.addedSource(source);
     context.applyChanges(changeSet);
-    context.setContents(source, r'''
+    context.setContents(
+        source,
+        r'''
 library lib;
 class A {
   int f = new A();
@@ -3761,7 +3855,9 @@
 //        "export '\${a}lib3.dart';",
 //        "part '/does/not/exist.dart';",
 //        "class A {}"]));
-    context.setContents(source, r'''
+    context.setContents(
+        source,
+        r'''
 library lib;
 part '/does/not/exist.dart';
 class A {}''');
@@ -3825,14 +3921,17 @@
     GenerateDartHintsTask task = new GenerateDartHintsTask(null, null, null);
     expect(task.accept(new GenerateDartHintsTaskTestTV_accept()), isTrue);
   }
+
   void test_getException() {
     GenerateDartHintsTask task = new GenerateDartHintsTask(null, null, null);
     expect(task.exception, isNull);
   }
+
   void test_getHintMap() {
     GenerateDartHintsTask task = new GenerateDartHintsTask(null, null, null);
     expect(task.hintMap, isNull);
   }
+
   void test_getLibraryElement() {
     InternalAnalysisContext context = AnalysisContextFactory.contextWithCore();
     LibraryElement element = ElementFactory.library(context, "lib");
@@ -3840,6 +3939,7 @@
         new GenerateDartHintsTask(context, null, element);
     expect(task.libraryElement, same(element));
   }
+
   void test_perform() {
     InternalAnalysisContext context = AnalysisContextFactory.contextWithCore();
     ChangeSet changeSet = new ChangeSet();
@@ -3853,7 +3953,9 @@
         new FileBasedSource(FileUtilities2.createFile("/part.dart"));
     changeSet.addedSource(partSource);
     context.applyChanges(changeSet);
-    context.setContents(librarySource, r'''
+    context.setContents(
+        librarySource,
+        r'''
 library lib;
 import 'unused.dart';
 part 'part.dart';''');
@@ -3903,10 +4005,12 @@
     GenerateDartLintsTask task = new GenerateDartLintsTask(null, null, null);
     expect(task.accept(new GenerateDartLintsTaskTestTV_accept()), isTrue);
   }
+
   void test_exception() {
     GenerateDartLintsTask task = new GenerateDartLintsTask(null, null, null);
     expect(task.exception, isNull);
   }
+
   void test_libraryElement() {
     InternalAnalysisContext context = AnalysisContextFactory.contextWithCore();
     LibraryElement element = ElementFactory.library(context, "lib");
@@ -3914,6 +4018,7 @@
         new GenerateDartLintsTask(context, null, element);
     expect(task.libraryElement, same(element));
   }
+
   void test_lintMap() {
     GenerateDartLintsTask task = new GenerateDartLintsTask(null, null, null);
     expect(task.lintMap, isNull);
@@ -3926,7 +4031,9 @@
         new FileBasedSource(FileUtilities2.createFile("/test.dart"));
     changeSet.addedSource(librarySource);
     context.applyChanges(changeSet);
-    context.setContents(librarySource, r'''
+    context.setContents(
+        librarySource,
+        r'''
 library lib;
 ''');
     List<TimestampedData<CompilationUnit>> units = new List<TimestampedData>(1);
@@ -4195,6 +4302,7 @@
   void setUp() {
     _entry.setValueInLibrary(DartEntry.RESOLVED_UNIT, _source, _unit);
   }
+
   void test_cacheResult() {
     IncrementalAnalysisCache cache = IncrementalAnalysisCache.update(
         null, _source, "hello", "hbazlo", 1, 2, 3, _entry);
@@ -4209,18 +4317,21 @@
     expect(_result.oldLength, 0);
     expect(_result.newLength, 0);
   }
+
   void test_cacheResult_noCache() {
     IncrementalAnalysisCache cache = null;
     CompilationUnit newUnit = new CompilationUnitMock();
     _result = IncrementalAnalysisCache.cacheResult(cache, newUnit);
     expect(_result, isNull);
   }
+
   void test_cacheResult_noCacheNoResult() {
     IncrementalAnalysisCache cache = null;
     CompilationUnit newUnit = null;
     _result = IncrementalAnalysisCache.cacheResult(cache, newUnit);
     expect(_result, isNull);
   }
+
   void test_cacheResult_noResult() {
     IncrementalAnalysisCache cache = IncrementalAnalysisCache.update(
         null, _source, "hello", "hbazlo", 1, 2, 3, _entry);
@@ -4228,6 +4339,7 @@
     _result = IncrementalAnalysisCache.cacheResult(cache, newUnit);
     expect(_result, isNull);
   }
+
   void test_clear_differentSource() {
     IncrementalAnalysisCache cache = IncrementalAnalysisCache.update(
         null, _source, "hello", "hbazlo", 1, 2, 3, _entry);
@@ -4235,17 +4347,20 @@
     _result = IncrementalAnalysisCache.clear(cache, otherSource);
     expect(_result, same(cache));
   }
+
   void test_clear_nullCache() {
     IncrementalAnalysisCache cache = null;
     _result = IncrementalAnalysisCache.clear(cache, _source);
     expect(_result, isNull);
   }
+
   void test_clear_sameSource() {
     IncrementalAnalysisCache cache = IncrementalAnalysisCache.update(
         null, _source, "hello", "hbazlo", 1, 2, 3, _entry);
     _result = IncrementalAnalysisCache.clear(cache, _source);
     expect(_result, isNull);
   }
+
   void test_update_append() {
     IncrementalAnalysisCache cache = IncrementalAnalysisCache.update(
         null, _source, "hello", "hbazlo", 1, 2, 3, _entry);
@@ -4261,6 +4376,7 @@
     expect(_result.oldLength, 2);
     expect(_result.newLength, 4);
   }
+
   void test_update_appendToCachedResult() {
     IncrementalAnalysisCache cache = IncrementalAnalysisCache.update(
         null, _source, "hello", "hbazlo", 1, 2, 3, _entry);
@@ -4279,6 +4395,7 @@
     expect(_result.oldLength, 0);
     expect(_result.newLength, 1);
   }
+
   void test_update_appendWithNewResolvedUnit() {
     IncrementalAnalysisCache cache = IncrementalAnalysisCache.update(
         null, _source, "hello", "hbazlo", 1, 2, 3, _entry);
@@ -4296,6 +4413,7 @@
     expect(_result.oldLength, 0);
     expect(_result.newLength, 1);
   }
+
   void test_update_appendWithNoNewResolvedUnit() {
     IncrementalAnalysisCache cache = IncrementalAnalysisCache.update(
         null, _source, "hello", "hbazlo", 1, 2, 3, _entry);
@@ -4311,6 +4429,7 @@
     expect(_result.oldLength, 2);
     expect(_result.newLength, 4);
   }
+
   void test_update_delete() {
     IncrementalAnalysisCache cache = IncrementalAnalysisCache.update(
         null, _source, "hello", "hbazlo", 1, 2, 3, _entry);
@@ -4326,6 +4445,7 @@
     expect(_result.oldLength, 2);
     expect(_result.newLength, 1);
   }
+
   void test_update_insert_nonContiguous_after() {
     IncrementalAnalysisCache cache = IncrementalAnalysisCache.update(
         null, _source, "hello", "hbazlo", 1, 2, 3, _entry);
@@ -4334,6 +4454,7 @@
         cache, _source, "hbazlo", "hbazlox", 6, 0, 1, newEntry);
     expect(_result, isNull);
   }
+
   void test_update_insert_nonContiguous_before() {
     IncrementalAnalysisCache cache = IncrementalAnalysisCache.update(
         null, _source, "hello", "hbazlo", 1, 2, 3, _entry);
@@ -4342,6 +4463,7 @@
         cache, _source, "hbazlo", "xhbazlo", 0, 0, 1, newEntry);
     expect(_result, isNull);
   }
+
   void test_update_newSource_entry() {
     Source oldSource = new TestSource("blat.dart", "blat");
     DartEntry oldEntry = new DartEntry();
@@ -4362,6 +4484,7 @@
     expect(_result.oldLength, 0);
     expect(_result.newLength, 2);
   }
+
   void test_update_newSource_noEntry() {
     Source oldSource = new TestSource("blat.dart", "blat");
     DartEntry oldEntry = new DartEntry();
@@ -4375,6 +4498,7 @@
         cache, _source, "foo", "foobar", 3, 0, 3, null);
     expect(_result, isNull);
   }
+
   void test_update_noCache_entry() {
     _result = IncrementalAnalysisCache.update(
         null, _source, "hello", "hbazlo", 1, 2, 3, _entry);
@@ -4388,6 +4512,7 @@
     expect(_result.newLength, 3);
     expect(_result.hasWork, isTrue);
   }
+
   void test_update_noCache_entry_noOldSource_append() {
     _result = IncrementalAnalysisCache.update(
         null, _source, null, "hellxo", 4, 0, 1, _entry);
@@ -4401,21 +4526,25 @@
     expect(_result.newLength, 1);
     expect(_result.hasWork, isTrue);
   }
+
   void test_update_noCache_entry_noOldSource_delete() {
     _result = IncrementalAnalysisCache.update(
         null, _source, null, "helo", 4, 1, 0, _entry);
     expect(_result, isNull);
   }
+
   void test_update_noCache_entry_noOldSource_replace() {
     _result = IncrementalAnalysisCache.update(
         null, _source, null, "helxo", 4, 1, 1, _entry);
     expect(_result, isNull);
   }
+
   void test_update_noCache_noEntry() {
     _result = IncrementalAnalysisCache.update(
         null, _source, "hello", "hbazlo", 1, 2, 3, null);
     expect(_result, isNull);
   }
+
   void test_update_replace() {
     IncrementalAnalysisCache cache = IncrementalAnalysisCache.update(
         null, _source, "hello", "hbazlo", 1, 2, 3, _entry);
@@ -4430,6 +4559,7 @@
     expect(_result.oldLength, 2);
     expect(_result.newLength, 4);
   }
+
   void test_verifyStructure_invalidUnit() {
     String oldCode = "main() {foo;}";
     String newCode = "main() {boo;}";
@@ -4441,18 +4571,21 @@
     _result = IncrementalAnalysisCache.verifyStructure(cache, _source, newUnit);
     expect(_result, isNull);
   }
+
   void test_verifyStructure_noCache() {
     IncrementalAnalysisCache cache = null;
     CompilationUnit newUnit = new CompilationUnitMock();
     _result = IncrementalAnalysisCache.verifyStructure(cache, _source, newUnit);
     expect(_result, isNull);
   }
+
   void test_verifyStructure_noCacheNoUnit() {
     IncrementalAnalysisCache cache = null;
     CompilationUnit newUnit = null;
     _result = IncrementalAnalysisCache.verifyStructure(cache, _source, newUnit);
     expect(_result, isNull);
   }
+
   void test_verifyStructure_noUnit() {
     IncrementalAnalysisCache cache = IncrementalAnalysisCache.update(
         null, _source, "hello", "hbazlo", 1, 2, 3, _entry);
@@ -4461,6 +4594,7 @@
     expect(_result, same(cache));
     expect(_result.resolvedUnit, same(_unit));
   }
+
   void test_verifyStructure_otherSource() {
     IncrementalAnalysisCache cache = IncrementalAnalysisCache.update(
         null, _source, "hello", "hbazlo", 1, 2, 3, _entry);
@@ -4471,6 +4605,7 @@
     expect(_result, same(cache));
     expect(_result.resolvedUnit, same(_unit));
   }
+
   void test_verifyStructure_validUnit() {
     String oldCode = "main() {foo;}";
     String newCode = "main() {boo;}";
@@ -4483,6 +4618,7 @@
     expect(_result, same(cache));
     expect(_result.resolvedUnit, same(goodUnit));
   }
+
   CompilationUnit _parse(String code) {
     Scanner scanner = new Scanner(_source, new CharSequenceReader(code),
         AnalysisErrorListener.NULL_LISTENER);
@@ -4531,8 +4667,14 @@
     CompilationUnit oldUnit = context.resolveCompilationUnit2(source, source);
     expect(oldUnit, isNotNull);
     entry.setValueInLibrary(DartEntry.RESOLVED_UNIT, source, oldUnit);
-    IncrementalAnalysisCache cache = IncrementalAnalysisCache.update(null,
-        source, oldCode, newCode, prefix.length, removed.length, added.length,
+    IncrementalAnalysisCache cache = IncrementalAnalysisCache.update(
+        null,
+        source,
+        oldCode,
+        newCode,
+        prefix.length,
+        removed.length,
+        added.length,
         entry);
     expect(cache, isNotNull);
     IncrementalAnalysisTask task = new IncrementalAnalysisTask(context, cache);
@@ -4554,7 +4696,8 @@
   IncrementalAnalysisTaskTestTV_assertTask(this.task);
   @override
   CompilationUnit visitIncrementalAnalysisTask(
-      IncrementalAnalysisTask incrementalAnalysisTask) => task.compilationUnit;
+          IncrementalAnalysisTask incrementalAnalysisTask) =>
+      task.compilationUnit;
 }
 
 @reflectiveTest
@@ -4566,7 +4709,9 @@
         new FileBasedSource(FileUtilities2.createFile("/test.dart"));
     changeSet.addedSource(librarySource);
     context.applyChanges(changeSet);
-    context.setContents(librarySource, r'''
+    context.setContents(
+        librarySource,
+        r'''
 library lib;
 ''');
 
@@ -4593,7 +4738,9 @@
         new FileBasedSource(FileUtilities2.createFile("/test.dart"));
     changeSet.addedSource(librarySource);
     context.applyChanges(changeSet);
-    context.setContents(librarySource, r'''
+    context.setContents(
+        librarySource,
+        r'''
 library lib;
 ''');
 
@@ -4964,7 +5111,8 @@
 </html>''';
     TestLogger testLogger = new TestLogger();
     ParseHtmlTask task = parseSource(
-        new ParseHtmlTaskTest_non_existing_source(contents), contents,
+        new ParseHtmlTaskTest_non_existing_source(contents),
+        contents,
         testLogger);
     expect(task.referencedLibraries, hasLength(0));
     expect(testLogger.errorCount, 0);
@@ -5061,26 +5209,31 @@
     ResolveDartLibraryTask task = new ResolveDartLibraryTask(null, null, null);
     expect(task.accept(new ResolveDartLibraryTaskTestTV_accept()), isTrue);
   }
+
   void test_getException() {
     ResolveDartLibraryTask task = new ResolveDartLibraryTask(null, null, null);
     expect(task.exception, isNull);
   }
+
   void test_getLibraryResolver() {
     ResolveDartLibraryTask task = new ResolveDartLibraryTask(null, null, null);
     expect(task.libraryResolver, isNull);
   }
+
   void test_getLibrarySource() {
     Source source = new TestSource('/test.dart');
     ResolveDartLibraryTask task =
         new ResolveDartLibraryTask(null, null, source);
     expect(task.librarySource, same(source));
   }
+
   void test_getUnitSource() {
     Source source = new TestSource('/test.dart');
     ResolveDartLibraryTask task =
         new ResolveDartLibraryTask(null, source, null);
     expect(task.unitSource, same(source));
   }
+
   void test_perform_exception() {
     TestSource source = new TestSource();
     source.generateExceptionOnRead = true;
@@ -5089,8 +5242,11 @@
         new ResolveDartLibraryTask(context, source, source);
     task.perform(new ResolveDartLibraryTaskTestTV_perform_exception());
   }
+
   void test_perform_library() {
-    Source source = new TestSource('/test.dart', r'''
+    Source source = new TestSource(
+        '/test.dart',
+        r'''
 library lib;
 class A {}''');
     InternalAnalysisContext context = AnalysisContextFactory.contextWithCore();
@@ -5187,7 +5343,9 @@
     classElement.constructors = <ConstructorElement>[constructorElement];
     unitElement.types = <ClassElement>[classElement];
     Source source = unitElement.source;
-    context.setContents(source, r'''
+    context.setContents(
+        source,
+        r'''
 library lib;
 class A {}''');
     ResolveDartUnitTask task =
@@ -5484,7 +5642,8 @@
 class SourcesChangedListener {
   List<SourcesChangedEvent> actualEvents = [];
 
-  void assertEvent({bool wereSourcesAdded: false,
+  void assertEvent(
+      {bool wereSourcesAdded: false,
       List<Source> changedSources: Source.EMPTY_LIST,
       bool wereSourcesRemovedOrDeleted: false}) {
     if (actualEvents.isEmpty) {
@@ -5516,82 +5675,99 @@
     fail("Unexpected invocation of analysisCache");
     return null;
   }
+
   @override
   AnalysisOptions get analysisOptions {
     fail("Unexpected invocation of getAnalysisOptions");
     return null;
   }
+
   @override
   void set analysisOptions(AnalysisOptions options) {
     fail("Unexpected invocation of setAnalysisOptions");
   }
+
   @override
   void set analysisPriorityOrder(List<Source> sources) {
     fail("Unexpected invocation of setAnalysisPriorityOrder");
   }
+
   @override
   set contentCache(ContentCache value) {
     fail("Unexpected invocation of setContentCache");
   }
+
   @override
   DeclaredVariables get declaredVariables {
     fail("Unexpected invocation of getDeclaredVariables");
     return null;
   }
+
   @override
-  List<AnalysisTarget> get explicitTargets {
+  List<newContext.AnalysisTarget> get explicitTargets {
     fail("Unexpected invocation of visitCacheItems");
     return null;
   }
+
   @override
   List<Source> get htmlSources {
     fail("Unexpected invocation of getHtmlSources");
     return null;
   }
+
   @override
   Stream<ImplicitAnalysisEvent> get implicitAnalysisEvents {
     fail("Unexpected invocation of analyzedSources");
     return null;
   }
+
   @override
   bool get isDisposed {
     fail("Unexpected invocation of isDisposed");
     return false;
   }
+
   @override
   List<Source> get launchableClientLibrarySources {
     fail("Unexpected invocation of getLaunchableClientLibrarySources");
     return null;
   }
+
   @override
   List<Source> get launchableServerLibrarySources {
     fail("Unexpected invocation of getLaunchableServerLibrarySources");
     return null;
   }
+
   @override
   LibraryResolverFactory get libraryResolverFactory {
     fail("Unexpected invocation of getLibraryResolverFactory");
     return null;
   }
+
   @override
   List<Source> get librarySources {
     fail("Unexpected invocation of getLibrarySources");
     return null;
   }
+
   @override
   String get name {
     fail("Unexpected invocation of name");
     return null;
   }
+
   @override
   set name(String value) {
     fail("Unexpected invocation of name");
   }
+
   @override
   Stream<SourcesChangedEvent> get onSourcesChanged {
     fail("Unexpected invocation of onSourcesChanged");
     return null;
   }
+
   @override
   List<Source> get prioritySources {
     fail("Unexpected invocation of getPrioritySources");
@@ -5599,7 +5775,7 @@
   }
 
   @override
-  List<AnalysisTarget> get priorityTargets {
+  List<newContext.AnalysisTarget> get priorityTargets {
     fail("Unexpected invocation of visitCacheItems");
     return null;
   }
@@ -5615,262 +5791,345 @@
     fail("Unexpected invocation of getResolverVisitorFactory");
     return null;
   }
+
   @override
   SourceFactory get sourceFactory {
     fail("Unexpected invocation of getSourceFactory");
     return null;
   }
+
   @override
   void set sourceFactory(SourceFactory factory) {
     fail("Unexpected invocation of setSourceFactory");
   }
+
   @override
   List<Source> get sources {
     fail("Unexpected invocation of sources");
     return null;
   }
+
   @override
   AnalysisContextStatistics get statistics {
     fail("Unexpected invocation of getStatistics");
     return null;
   }
+
   @override
   TypeProvider get typeProvider {
     fail("Unexpected invocation of getTypeProvider");
     return null;
   }
+
   @override
   void set typeProvider(TypeProvider typeProvider) {
     fail("Unexpected invocation of set typeProvider");
   }
+
   @override
   TypeResolverVisitorFactory get typeResolverVisitorFactory {
     fail("Unexpected invocation of getTypeResolverVisitorFactory");
     return null;
   }
+
+  @override
+  TypeSystem get typeSystem {
+    fail("Unexpected invocation of getTypeSystem");
+    return null;
+  }
+
+  @override
+  List<newContext.WorkManager> get workManagers {
+    fail("Unexpected invocation of workManagers");
+  }
+
   @override
   void addListener(AnalysisListener listener) {
     fail("Unexpected invocation of addListener");
   }
+
   @override
   void applyAnalysisDelta(AnalysisDelta delta) {
     fail("Unexpected invocation of applyAnalysisDelta");
   }
+
   @override
   void applyChanges(ChangeSet changeSet) {
     fail("Unexpected invocation of applyChanges");
   }
+
   @override
   String computeDocumentationComment(Element element) {
     fail("Unexpected invocation of computeDocumentationComment");
     return null;
   }
+
   @override
   List<AnalysisError> computeErrors(Source source) {
     fail("Unexpected invocation of computeErrors");
     return null;
   }
+
   @override
   List<Source> computeExportedLibraries(Source source) {
     fail("Unexpected invocation of computeExportedLibraries");
     return null;
   }
+
   @override
   @deprecated
   HtmlElement computeHtmlElement(Source source) {
     fail("Unexpected invocation of computeHtmlElement");
     return null;
   }
+
   @override
   List<Source> computeImportedLibraries(Source source) {
     fail("Unexpected invocation of computeImportedLibraries");
     return null;
   }
+
   @override
   SourceKind computeKindOf(Source source) {
     fail("Unexpected invocation of computeKindOf");
     return null;
   }
+
   @override
   LibraryElement computeLibraryElement(Source source) {
     fail("Unexpected invocation of computeLibraryElement");
     return null;
   }
+
   @override
   LineInfo computeLineInfo(Source source) {
     fail("Unexpected invocation of computeLineInfo");
     return null;
   }
+
   @override
   CompilationUnit computeResolvableCompilationUnit(Source source) {
     fail("Unexpected invocation of computeResolvableCompilationUnit");
     return null;
   }
+
   @override
   Future<CompilationUnit> computeResolvedCompilationUnitAsync(
       Source source, Source librarySource) {
     fail("Unexpected invocation of getResolvedCompilationUnitFuture");
     return null;
   }
+
+  @override
+  Object computeResult(
+      newContext.AnalysisTarget target, newContext.ResultDescriptor result) {
+    fail("Unexpected invocation of computeResult");
+    return null;
+  }
+
   @override
   void dispose() {
     fail("Unexpected invocation of dispose");
   }
+
   @override
   List<CompilationUnit> ensureResolvedDartUnits(Source source) {
     fail("Unexpected invocation of ensureResolvedDartUnits");
     return null;
   }
+
   @override
   bool exists(Source source) {
     fail("Unexpected invocation of exists");
     return false;
   }
+
   @override
-  CacheEntry getCacheEntry(AnalysisTarget target) {
+  CacheEntry getCacheEntry(newContext.AnalysisTarget target) {
     fail("Unexpected invocation of visitCacheItems");
     return null;
   }
+
   @override
   CompilationUnitElement getCompilationUnitElement(
       Source unitSource, Source librarySource) {
     fail("Unexpected invocation of getCompilationUnitElement");
     return null;
   }
+
+  @override
+  Object getConfigurationData(newContext.ResultDescriptor key) {
+    fail("Unexpected invocation of getConfigurationData");
+  }
+
   @override
   TimestampedData<String> getContents(Source source) {
     fail("Unexpected invocation of getContents");
     return null;
   }
+
   @override
   InternalAnalysisContext getContextFor(Source source) {
     fail("Unexpected invocation of getContextFor");
     return null;
   }
+
   @override
   Element getElement(ElementLocation location) {
     fail("Unexpected invocation of getElement");
     return null;
   }
+
   @override
   AnalysisErrorInfo getErrors(Source source) {
     fail("Unexpected invocation of getErrors");
     return null;
   }
+
   @override
   @deprecated
   HtmlElement getHtmlElement(Source source) {
     fail("Unexpected invocation of getHtmlElement");
     return null;
   }
+
   @override
   List<Source> getHtmlFilesReferencing(Source source) {
     fail("Unexpected invocation of getHtmlFilesReferencing");
     return null;
   }
+
   @override
   SourceKind getKindOf(Source source) {
     fail("Unexpected invocation of getKindOf");
     return null;
   }
+
   @override
   List<Source> getLibrariesContaining(Source source) {
     fail("Unexpected invocation of getLibrariesContaining");
     return null;
   }
+
   @override
   List<Source> getLibrariesDependingOn(Source librarySource) {
     fail("Unexpected invocation of getLibrariesDependingOn");
     return null;
   }
+
   @override
   List<Source> getLibrariesReferencedFromHtml(Source htmlSource) {
     fail("Unexpected invocation of getLibrariesReferencedFromHtml");
     return null;
   }
+
   @override
   LibraryElement getLibraryElement(Source source) {
     fail("Unexpected invocation of getLibraryElement");
     return null;
   }
+
   @override
   LineInfo getLineInfo(Source source) {
     fail("Unexpected invocation of getLineInfo");
     return null;
   }
+
   @override
   int getModificationStamp(Source source) {
     fail("Unexpected invocation of getModificationStamp");
     return 0;
   }
+
   @override
   ChangeNoticeImpl getNotice(Source source) {
     fail("Unexpected invocation of getNotice");
     return null;
   }
+
   @override
   Namespace getPublicNamespace(LibraryElement library) {
     fail("Unexpected invocation of getPublicNamespace");
     return null;
   }
+
   @override
   CompilationUnit getResolvedCompilationUnit(
       Source unitSource, LibraryElement library) {
     fail("Unexpected invocation of getResolvedCompilationUnit");
     return null;
   }
+
   @override
   CompilationUnit getResolvedCompilationUnit2(
       Source unitSource, Source librarySource) {
     fail("Unexpected invocation of getResolvedCompilationUnit");
     return null;
   }
+
   @override
   @deprecated
   ht.HtmlUnit getResolvedHtmlUnit(Source htmlSource) {
     fail("Unexpected invocation of getResolvedHtmlUnit");
     return null;
   }
+
+  @override
+  Object getResult(
+      newContext.AnalysisTarget target, newContext.ResultDescriptor result) {
+    fail("Unexpected invocation of getResult");
+    return null;
+  }
+
   @override
   List<Source> getSourcesWithFullName(String path) {
     fail("Unexpected invocation of getSourcesWithFullName");
     return null;
   }
+
   @override
   bool handleContentsChanged(
       Source source, String originalContents, String newContents, bool notify) {
     fail("Unexpected invocation of handleContentsChanged");
     return false;
   }
+
   @override
   void invalidateLibraryHints(Source librarySource) {
     fail("Unexpected invocation of invalidateLibraryHints");
   }
+
   @override
   bool isClientLibrary(Source librarySource) {
     fail("Unexpected invocation of isClientLibrary");
     return false;
   }
+
   @override
   bool isServerLibrary(Source librarySource) {
     fail("Unexpected invocation of isServerLibrary");
     return false;
   }
+
   @override
-  Stream<ComputedResult> onResultComputed(ResultDescriptor descriptor) {
+  Stream<ComputedResult> onResultComputed(
+      newContext.ResultDescriptor descriptor) {
     fail("Unexpected invocation of onResultComputed");
     return null;
   }
+
   @override
   CompilationUnit parseCompilationUnit(Source source) {
     fail("Unexpected invocation of parseCompilationUnit");
     return null;
   }
+
   @override
   Document parseHtmlDocument(Source source) {
     fail("Unexpected invocation of parseHtmlDocument");
     return null;
   }
+
   @override
   ht.HtmlUnit parseHtmlUnit(Source source) {
     fail("Unexpected invocation of parseHtmlUnit");
@@ -5919,6 +6178,12 @@
       int oldLength, int newLength) {
     fail("Unexpected invocation of setChangedContents");
   }
+
+  @override
+  void setConfigurationData(newContext.ResultDescriptor key, Object data) {
+    fail("Unexpected invocation of setConfigurationData");
+  }
+
   @override
   void setContents(Source source, String contents) {
     fail("Unexpected invocation of setContents");
@@ -6507,52 +6772,62 @@
     fail("Unexpectedly invoked visitGenerateDartErrorsTask");
     return null;
   }
+
   @override
   E visitGenerateDartHintsTask(GenerateDartHintsTask task) {
     fail("Unexpectedly invoked visitGenerateDartHintsTask");
     return null;
   }
+
   @override
   E visitGenerateDartLintsTask(GenerateDartLintsTask task) {
     fail("Unexpectedly invoked visitGenerateDartLintsTask");
     return null;
   }
+
   @override
   E visitGetContentTask(GetContentTask task) {
     fail("Unexpectedly invoked visitGetContentsTask");
     return null;
   }
+
   @override
   E visitIncrementalAnalysisTask(
       IncrementalAnalysisTask incrementalAnalysisTask) {
     fail("Unexpectedly invoked visitIncrementalAnalysisTask");
     return null;
   }
+
   @override
   E visitParseDartTask(ParseDartTask task) {
     fail("Unexpectedly invoked visitParseDartTask");
     return null;
   }
+
   @override
   E visitParseHtmlTask(ParseHtmlTask task) {
     fail("Unexpectedly invoked visitParseHtmlTask");
     return null;
   }
+
   @override
   E visitResolveDartLibraryCycleTask(ResolveDartLibraryCycleTask task) {
     fail("Unexpectedly invoked visitResolveDartLibraryCycleTask");
     return null;
   }
+
   @override
   E visitResolveDartLibraryTask(ResolveDartLibraryTask task) {
     fail("Unexpectedly invoked visitResolveDartLibraryTask");
     return null;
   }
+
   @override
   E visitResolveDartUnitTask(ResolveDartUnitTask task) {
     fail("Unexpectedly invoked visitResolveDartUnitTask");
     return null;
   }
+
   @override
   E visitResolveHtmlTask(ResolveHtmlTask task) {
     fail("Unexpectedly invoked visitResolveHtmlTask");
@@ -6574,9 +6849,11 @@
     TestSource source = new TestSource();
     expect(partition.contains(source), isTrue);
   }
+
   void test_creation() {
     expect(new UniversalCachePartition(null, 8, null), isNotNull);
   }
+
   void test_entrySet() {
     UniversalCachePartition partition =
         new UniversalCachePartition(null, 8, null);
@@ -6589,12 +6866,14 @@
     expect(entryKey, same(source));
     expect(entryMap[entryKey], same(entry));
   }
+
   void test_get() {
     UniversalCachePartition partition =
         new UniversalCachePartition(null, 8, null);
     TestSource source = new TestSource();
     expect(partition.get(source), isNull);
   }
+
   void test_put_noFlush() {
     UniversalCachePartition partition =
         new UniversalCachePartition(null, 8, null);
@@ -6603,6 +6882,7 @@
     partition.put(source, entry);
     expect(partition.get(source), same(entry));
   }
+
   void test_remove() {
     UniversalCachePartition partition =
         new UniversalCachePartition(null, 8, null);
@@ -6613,6 +6893,7 @@
     partition.remove(source);
     expect(partition.get(source), isNull);
   }
+
   void test_setMaxCacheSize() {
     UniversalCachePartition partition = new UniversalCachePartition(
         null, 8, new _UniversalCachePartitionTest_test_setMaxCacheSize());
@@ -6629,6 +6910,7 @@
     partition.maxCacheSize = newSize;
     _assertNonFlushedCount(newSize, partition);
   }
+
   void test_size() {
     UniversalCachePartition partition =
         new UniversalCachePartition(null, 8, null);
@@ -6640,6 +6922,7 @@
     }
     expect(partition.size(), size);
   }
+
   void _assertNonFlushedCount(
       int expectedCount, UniversalCachePartition partition) {
     int nonFlushedCount = 0;
@@ -6665,9 +6948,11 @@
     expect(iterator.next(), same(source2));
     expect(iterator.next(), same(source1));
   }
+
   void test_creation() {
     expect(new WorkManager(), isNotNull);
   }
+
   void test_iterator_empty() {
     WorkManager manager = new WorkManager();
     WorkManager_WorkIterator iterator = manager.iterator();
@@ -6677,6 +6962,7 @@
       fail("Expected NoSuchElementException");
     } on NoSuchElementException {}
   }
+
   void test_iterator_nonEmpty() {
     TestSource source = new TestSource();
     WorkManager manager = new WorkManager();
@@ -6685,6 +6971,7 @@
     expect(iterator.hasNext, isTrue);
     expect(iterator.next(), same(source));
   }
+
   void test_remove() {
     TestSource source1 = new TestSource("/f1.dart");
     TestSource source2 = new TestSource("/f2.dart");
@@ -6698,10 +6985,12 @@
     expect(iterator.next(), same(source1));
     expect(iterator.next(), same(source3));
   }
+
   void test_toString_empty() {
     WorkManager manager = new WorkManager();
     expect(manager.toString(), isNotNull);
   }
+
   void test_toString_nonEmpty() {
     WorkManager manager = new WorkManager();
     manager.add(new TestSource(), SourcePriority.HTML);
diff --git a/pkg/analyzer/test/generated/incremental_resolver_test.dart b/pkg/analyzer/test/generated/incremental_resolver_test.dart
index 7af5e3ab..eaef165 100644
--- a/pkg/analyzer/test/generated/incremental_resolver_test.dart
+++ b/pkg/analyzer/test/generated/incremental_resolver_test.dart
@@ -28,19 +28,74 @@
 import 'test_support.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   runReflectiveTests(DeclarationMatcherTest);
   runReflectiveTests(IncrementalResolverTest);
   runReflectiveTests(PoorMansIncrementalResolutionTest);
   runReflectiveTests(ResolutionContextBuilderTest);
 }
 
+void initializeTestEnvironment() {}
+
 void _assertEqualError(AnalysisError incrError, AnalysisError fullError) {
-  expect(incrError.errorCode, same(fullError.errorCode));
-  expect(incrError.source, fullError.source);
-  expect(incrError.offset, fullError.offset);
-  expect(incrError.length, fullError.length);
-  expect(incrError.message, fullError.message);
+  if (incrError.errorCode != fullError.errorCode ||
+      incrError.source != fullError.source ||
+      incrError.offset != fullError.offset ||
+      incrError.length != fullError.length ||
+      incrError.message != fullError.message) {
+    StringBuffer buffer = new StringBuffer();
+    buffer.writeln('Found error does not match expected error:');
+    if (incrError.errorCode == fullError.errorCode) {
+      buffer.write('  errorCode = ');
+      buffer.write(fullError.errorCode.uniqueName);
+    } else {
+      buffer.write('  Expected errorCode = ');
+      buffer.write(fullError.errorCode.uniqueName);
+      buffer.write(' found ');
+      buffer.write(incrError.errorCode.uniqueName);
+    }
+    buffer.writeln();
+    if (incrError.source == fullError.source) {
+      buffer.write('  source = ');
+      buffer.write(fullError.source);
+    } else {
+      buffer.write('  Expected source = ');
+      buffer.write(fullError.source);
+      buffer.write(' found ');
+      buffer.write(incrError.source);
+    }
+    buffer.writeln();
+    if (incrError.offset == fullError.offset) {
+      buffer.write('  offset = ');
+      buffer.write(fullError.offset);
+    } else {
+      buffer.write('  Expected offset = ');
+      buffer.write(fullError.offset);
+      buffer.write(' found ');
+      buffer.write(incrError.offset);
+    }
+    buffer.writeln();
+    if (incrError.length == fullError.length) {
+      buffer.write('  length = ');
+      buffer.write(fullError.length);
+    } else {
+      buffer.write('  Expected length = ');
+      buffer.write(fullError.length);
+      buffer.write(' found ');
+      buffer.write(incrError.length);
+    }
+    buffer.writeln();
+    if (incrError.message == fullError.message) {
+      buffer.write('  message = ');
+      buffer.write(fullError.message);
+    } else {
+      buffer.write('  Expected message = ');
+      buffer.write(fullError.message);
+      buffer.write(' found ');
+      buffer.write(incrError.message);
+    }
+    fail(buffer.toString());
+  }
 }
 
 void _assertEqualErrors(
@@ -68,13 +123,15 @@
   }
 
   void test_false_class_annotation_accessor_edit() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 const my_annotationA = const Object();
 const my_annotationB = const Object();
 @my_annotationA
 class A {
 }
-''', r'''
+''',
+        r'''
 const my_annotationA = const Object();
 const my_annotationB = const Object();
 @my_annotationB
@@ -84,7 +141,8 @@
   }
 
   void test_false_class_annotation_constructor_edit() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 class MyAnnotationA {
   const MyAnnotationA();
 }
@@ -94,7 +152,8 @@
 @MyAnnotationA()
 class A {
 }
-''', r'''
+''',
+        r'''
 class MyAnnotationA {
   const MyAnnotationA();
 }
@@ -108,11 +167,13 @@
   }
 
   void test_false_class_annotations_add() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 const my_annotation = const Object();
 class A {
 }
-''', r'''
+''',
+        r'''
 const my_annotation = const Object();
 @my_annotation
 class A {
@@ -121,12 +182,14 @@
   }
 
   void test_false_class_annotations_remove() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 const my_annotation = const Object();
 @my_annotation
 class A {
 }
-''', r'''
+''',
+        r'''
 const my_annotation = const Object();
 class A {
 }
@@ -134,10 +197,12 @@
   }
 
   void test_false_class_list_add() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 class A {}
 class B {}
-''', r'''
+''',
+        r'''
 class A {}
 class B {}
 class C {}
@@ -145,23 +210,27 @@
   }
 
   void test_false_class_list_remove() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 class A {}
 class B {}
 class C {}
-''', r'''
+''',
+        r'''
 class A {}
 class B {}
 ''');
   }
 
   void test_false_class_typeParameters_bounds_add() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 class A {}
 class B<T> {
   T f;
 }
-''', r'''
+''',
+        r'''
 class A {}
 class B<T extends A> {
   T f;
@@ -170,12 +239,14 @@
   }
 
   void test_false_class_typeParameters_bounds_remove() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 class A {}
 class B<T extends A> {
   T f;
 }
-''', r'''
+''',
+        r'''
 class A {}
 class B<T> {
   T f;
@@ -184,12 +255,14 @@
   }
 
   void test_false_classMemberAccessor_list_add() {
-    _assertDoesNotMatchOK(r'''
+    _assertDoesNotMatchOK(
+        r'''
 class A {
   get a => 1;
   get b => 2;
 }
-''', r'''
+''',
+        r'''
 class A {
   get a => 1;
   get b => 2;
@@ -199,13 +272,15 @@
   }
 
   void test_false_classMemberAccessor_list_remove() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 class A {
   get a => 1;
   get b => 2;
   get c => 3;
 }
-''', r'''
+''',
+        r'''
 class A {
   get a => 1;
   get b => 2;
@@ -214,11 +289,13 @@
   }
 
   void test_false_classMemberAccessor_wasGetter() {
-    _assertDoesNotMatchOK(r'''
+    _assertDoesNotMatchOK(
+        r'''
 class A {
   get a => 1;
 }
-''', r'''
+''',
+        r'''
 class A {
   set a(x) {}
 }
@@ -226,11 +303,13 @@
   }
 
   void test_false_classMemberAccessor_wasInstance() {
-    _assertDoesNotMatchOK(r'''
+    _assertDoesNotMatchOK(
+        r'''
 class A {
   get a => 1;
 }
-''', r'''
+''',
+        r'''
 class A {
   static get a => 1;
 }
@@ -238,11 +317,13 @@
   }
 
   void test_false_classMemberAccessor_wasSetter() {
-    _assertDoesNotMatchOK(r'''
+    _assertDoesNotMatchOK(
+        r'''
 class A {
   set a(x) {}
 }
-''', r'''
+''',
+        r'''
 class A {
   get a => 1;
 }
@@ -250,11 +331,13 @@
   }
 
   void test_false_classMemberAccessor_wasStatic() {
-    _assertDoesNotMatchOK(r'''
+    _assertDoesNotMatchOK(
+        r'''
 class A {
   static get a => 1;
 }
-''', r'''
+''',
+        r'''
 class A {
   get a => 1;
 }
@@ -262,10 +345,12 @@
   }
 
   void test_false_classTypeAlias_list_add() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 class M {}
 class A = Object with M;
-''', r'''
+''',
+        r'''
 class M {}
 class A = Object with M;
 class B = Object with M;
@@ -273,22 +358,26 @@
   }
 
   void test_false_classTypeAlias_list_remove() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 class M {}
 class A = Object with M;
 class B = Object with M;
-''', r'''
+''',
+        r'''
 class M {}
 class A = Object with M;
 ''');
   }
 
   void test_false_classTypeAlias_typeParameters_bounds_add() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 class M<T> {}
 class A {}
 class B<T> = Object with M<T>;
-''', r'''
+''',
+        r'''
 class M<T> {}
 class A {}
 class B<T extends A> = Object with M<T>;
@@ -296,11 +385,13 @@
   }
 
   void test_false_classTypeAlias_typeParameters_bounds_remove() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 class M<T> {}
 class A {}
 class B<T extends A> = Object with M<T>;
-''', r'''
+''',
+        r'''
 class M<T> {}
 class A {}
 class B<T> = Object with M<T>;
@@ -308,11 +399,13 @@
   }
 
   void test_false_constructor_keywordConst_add() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 class A {
   A();
 }
-''', r'''
+''',
+        r'''
 class A {
   const A();
 }
@@ -320,11 +413,13 @@
   }
 
   void test_false_constructor_keywordConst_remove() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 class A {
   const A();
 }
-''', r'''
+''',
+        r'''
 class A {
   A();
 }
@@ -332,14 +427,16 @@
   }
 
   void test_false_constructor_keywordFactory_add() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 class A {
   A();
   A.foo() {
     return new A();
   }
 }
-''', r'''
+''',
+        r'''
 class A {
   A();
   factory A.foo() {
@@ -350,14 +447,16 @@
   }
 
   void test_false_constructor_keywordFactory_remove() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 class A {
   A();
   factory A.foo() {
     return new A();
   }
 }
-''', r'''
+''',
+        r'''
 class A {
   A();
   A.foo() {
@@ -368,11 +467,13 @@
   }
 
   void test_false_constructor_parameters_list_add() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 class A {
   A();
 }
-''', r'''
+''',
+        r'''
 class A {
   A(int p);
 }
@@ -380,11 +481,13 @@
   }
 
   void test_false_constructor_parameters_list_remove() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 class A {
   A(int p);
 }
-''', r'''
+''',
+        r'''
 class A {
   A();
 }
@@ -392,11 +495,13 @@
   }
 
   void test_false_constructor_parameters_type_edit() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 class A {
   A(int p);
 }
-''', r'''
+''',
+        r'''
 class A {
   A(String p);
 }
@@ -404,10 +509,12 @@
   }
 
   void test_false_constructor_unnamed_add_hadParameters() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 class A {
 }
-''', r'''
+''',
+        r'''
 class A {
   A(int p) {}
 }
@@ -415,23 +522,27 @@
   }
 
   void test_false_constructor_unnamed_remove_hadParameters() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 class A {
   A(int p) {}
 }
-''', r'''
+''',
+        r'''
 class A {
 }
 ''');
   }
 
   void test_false_defaultFieldFormalParameterElement_wasSimple() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 class A {
   int field;
   A(int field);
 }
-''', r'''
+''',
+        r'''
 class A {
   int field;
   A([this.field = 0]);
@@ -440,87 +551,107 @@
   }
 
   void test_false_enum_constants_add() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 enum E {A, B}
-''', r'''
+''',
+        r'''
 enum E {A, B, C}
 ''');
   }
 
   void test_false_enum_constants_remove() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 enum E {A, B, C}
-''', r'''
+''',
+        r'''
 enum E {A, B}
 ''');
   }
 
   void test_false_export_hide_add() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 export 'dart:async' hide Future;
-''', r'''
+''',
+        r'''
 export 'dart:async' hide Future, Stream;
 ''');
   }
 
   void test_false_export_hide_remove() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 export 'dart:async' hide Future, Stream;
-''', r'''
+''',
+        r'''
 export 'dart:async' hide Future;
 ''');
   }
 
   void test_false_export_list_add() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 export 'dart:async';
-''', r'''
+''',
+        r'''
 export 'dart:async';
 export 'dart:math';
 ''');
   }
 
   void test_false_export_list_remove() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 export 'dart:async';
 export 'dart:math';
-''', r'''
+''',
+        r'''
 export 'dart:async';
 ''');
   }
 
   void test_false_export_show_add() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 export 'dart:async' show Future;
-''', r'''
+''',
+        r'''
 export 'dart:async' show Future, Stream;
 ''');
   }
 
   void test_false_export_show_remove() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 export 'dart:async' show Future, Stream;
-''', r'''
+''',
+        r'''
 export 'dart:async' show Future;
 ''');
   }
 
   void test_false_extendsClause_add() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 class A {}
 class B {}
-''', r'''
+''',
+        r'''
 class A {}
 class B extends A {}
 ''');
   }
 
   void test_false_extendsClause_different() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 class A {}
 class B {}
 class C extends A {}
-''', r'''
+''',
+        r'''
 class A {}
 class B {}
 class C extends B {}
@@ -528,22 +659,26 @@
   }
 
   void test_false_extendsClause_remove() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 class A {}
 class B extends A{}
-''', r'''
+''',
+        r'''
 class A {}
 class B {}
 ''');
   }
 
   void test_false_field_list_add() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 class T {
   int A = 1;
   int C = 3;
 }
-''', r'''
+''',
+        r'''
 class T {
   int A = 1;
   int B = 2;
@@ -553,13 +688,15 @@
   }
 
   void test_false_field_list_remove() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 class T {
   int A = 1;
   int B = 2;
   int C = 3;
 }
-''', r'''
+''',
+        r'''
 class T {
   int A = 1;
   int C = 3;
@@ -568,11 +705,13 @@
   }
 
   void test_false_field_modifier_isConst() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 class T {
   static final A = 1;
 }
-''', r'''
+''',
+        r'''
 class T {
   static const A = 1;
 }
@@ -580,11 +719,13 @@
   }
 
   void test_false_field_modifier_isFinal() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 class T {
   int A = 1;
 }
-''', r'''
+''',
+        r'''
 class T {
   final int A = 1;
 }
@@ -592,11 +733,13 @@
   }
 
   void test_false_field_modifier_isStatic() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 class T {
   int A = 1;
 }
-''', r'''
+''',
+        r'''
 class T {
   static int A = 1;
 }
@@ -604,11 +747,13 @@
   }
 
   void test_false_field_modifier_wasConst() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 class T {
   static const A = 1;
 }
-''', r'''
+''',
+        r'''
 class T {
   static final A = 1;
 }
@@ -616,11 +761,13 @@
   }
 
   void test_false_field_modifier_wasFinal() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 class T {
   final int A = 1;
 }
-''', r'''
+''',
+        r'''
 class T {
   int A = 1;
 }
@@ -628,11 +775,13 @@
   }
 
   void test_false_field_modifier_wasStatic() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 class T {
   static int A = 1;
 }
-''', r'''
+''',
+        r'''
 class T {
   int A = 1;
 }
@@ -640,11 +789,13 @@
   }
 
   void test_false_field_type_differentArgs() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 class T {
   List<int> A;
 }
-''', r'''
+''',
+        r'''
 class T {
   List<String> A;
 }
@@ -652,12 +803,14 @@
   }
 
   void test_false_fieldFormalParameter_add() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 class A {
   final field;
   A(field);
 }
-''', r'''
+''',
+        r'''
 class A {
   final field;
   A(this.field);
@@ -666,12 +819,14 @@
   }
 
   void test_false_fieldFormalParameter_add_function() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 class A {
   final field;
   A(field(a));
 }
-''', r'''
+''',
+        r'''
 class A {
   final field;
   A(this.field(a));
@@ -679,13 +834,33 @@
 ''');
   }
 
+  void test_false_fieldFormalParameter_differentField() {
+    _assertDoesNotMatch(
+        r'''
+class A {
+  final aaa;
+  final bbb;
+  A(this.aaa, this.bbb);
+}
+''',
+        r'''
+class A {
+  final aaa;
+  final bbb;
+  A(this.bbb, this.aaa);
+}
+''');
+  }
+
   void test_false_fieldFormalParameter_parameters_add() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 class A {
   final field;
   A(this.field(a));
 }
-''', r'''
+''',
+        r'''
 class A {
   final field;
   A(this.field(a, b));
@@ -694,12 +869,14 @@
   }
 
   void test_false_fieldFormalParameter_parameters_remove() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 class A {
   final field;
   A(this.field(a, b));
 }
-''', r'''
+''',
+        r'''
 class A {
   final field;
   A(this.field(a));
@@ -708,12 +885,14 @@
   }
 
   void test_false_fieldFormalParameter_parameters_typeEdit() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 class A {
   final field;
   A(this.field(int p));
 }
-''', r'''
+''',
+        r'''
 class A {
   final field;
   A(this.field(String p));
@@ -722,12 +901,14 @@
   }
 
   void test_false_fieldFormalParameter_remove_default() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 class A {
   final field;
   A([this.field = 0]);
 }
-''', r'''
+''',
+        r'''
 class A {
   final field;
   A([field = 0]);
@@ -736,12 +917,14 @@
   }
 
   void test_false_fieldFormalParameter_remove_function() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 class A {
   final field;
   A(this.field(a));
 }
-''', r'''
+''',
+        r'''
 class A {
   final field;
   A(field(a));
@@ -750,12 +933,14 @@
   }
 
   void test_false_fieldFormalParameter_remove_normal() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 class A {
   final field;
   A(this.field);
 }
-''', r'''
+''',
+        r'''
 class A {
   final field;
   A(field);
@@ -763,13 +948,63 @@
 ''');
   }
 
+  void test_false_fieldFormalParameter_typeAdd() {
+    _assertDoesNotMatch(
+        r'''
+class A {
+  final fff;
+  A(this.fff);
+}
+''',
+        r'''
+class A {
+  final fff;
+  A(int this.fff);
+}
+''');
+  }
+
+  void test_false_fieldFormalParameter_typeEdit() {
+    _assertDoesNotMatch(
+        r'''
+class A {
+  final fff;
+  A(int this.fff);
+}
+''',
+        r'''
+class A {
+  final fff;
+  A(String this.fff);
+}
+''');
+  }
+
+  void test_false_fieldFormalParameter_typeRemove() {
+    _assertDoesNotMatch(
+        r'''
+class A {
+  final fff;
+  A(int this.fff);
+}
+''',
+        r'''
+class A {
+  final fff;
+  A(this.fff);
+}
+''');
+  }
+
   void test_false_fieldFormalParameterElement_wasSimple() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 class A {
   int field;
   A(int field);
 }
-''', r'''
+''',
+        r'''
 class A {
   int field;
   A(this.field);
@@ -778,11 +1013,13 @@
   }
 
   void test_false_final_type_different() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 class T {
   int A;
 }
-''', r'''
+''',
+        r'''
 class T {
   String A;
 }
@@ -790,42 +1027,52 @@
   }
 
   void test_false_function_async_add() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 main() {}
-''', r'''
+''',
+        r'''
 main() async {}
 ''');
   }
 
   void test_false_function_async_remove() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 main() async {}
-''', r'''
+''',
+        r'''
 main() {}
 ''');
   }
 
   void test_false_function_generator_add() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 main() async {}
-''', r'''
+''',
+        r'''
 main() async* {}
 ''');
   }
 
   void test_false_function_generator_remove() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 main() async* {}
-''', r'''
+''',
+        r'''
 main() async {}
 ''');
   }
 
   void test_false_functionTypeAlias_list_add() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 typedef A(int pa);
 typedef B(String pb);
-''', r'''
+''',
+        r'''
 typedef A(int pa);
 typedef B(String pb);
 typedef C(pc);
@@ -833,151 +1080,183 @@
   }
 
   void test_false_functionTypeAlias_list_remove() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 typedef A(int pa);
 typedef B(String pb);
 typedef C(pc);
-''', r'''
+''',
+        r'''
 typedef A(int pa);
 typedef B(String pb);
 ''');
   }
 
   void test_false_functionTypeAlias_parameters_list_add() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 typedef A(a);
-''', r'''
+''',
+        r'''
 typedef A(a, b);
 ''');
   }
 
   void test_false_functionTypeAlias_parameters_list_remove() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 typedef A(a, b);
-''', r'''
+''',
+        r'''
 typedef A(a);
 ''');
   }
 
   void test_false_functionTypeAlias_parameters_type_edit() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 typedef A(int p);
-''', r'''
+''',
+        r'''
 typedef A(String p);
 ''');
   }
 
   void test_false_functionTypeAlias_returnType_edit() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 typedef int A();
-''', r'''
+''',
+        r'''
 typedef String A();
 ''');
   }
 
   void test_false_functionTypeAlias_typeParameters_bounds_add() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 class A {}
 typedef F<T>();
-''', r'''
+''',
+        r'''
 class A {}
 typedef F<T extends A>();
 ''');
   }
 
   void test_false_functionTypeAlias_typeParameters_bounds_edit() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 class A {}
 class B {}
 typedef F<T extends A>();
-''', r'''
+''',
+        r'''
 class A {}
 typedef F<T extends B>();
 ''');
   }
 
   void test_false_functionTypeAlias_typeParameters_bounds_remove() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 class A {}
 typedef F<T extends A>();
-''', r'''
+''',
+        r'''
 class A {}
 typedef F<T>();
 ''');
   }
 
   void test_false_functionTypeAlias_typeParameters_list_add() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 typedef F<A>();
-''', r'''
+''',
+        r'''
 typedef F<A, B>();
 ''');
   }
 
   void test_false_functionTypeAlias_typeParameters_list_remove() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 typedef F<A, B>();
-''', r'''
+''',
+        r'''
 typedef F<A>();
 ''');
   }
 
   void test_false_FunctionTypedFormalParameter_parameters_list_add() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 main(int callback(int a)) {
 }
-''', r'''
+''',
+        r'''
 main(int callback(int a, String b)) {
 }
 ''');
   }
 
   void test_false_FunctionTypedFormalParameter_parameters_list_remove() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 main(int callback(int a, String b)) {
 }
-''', r'''
+''',
+        r'''
 main(int callback(int a)) {
 }
 ''');
   }
 
   void test_false_FunctionTypedFormalParameter_parameterType() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 main(int callback(int p)) {
 }
-''', r'''
+''',
+        r'''
 main(int callback(String p)) {
 }
 ''');
   }
 
   void test_false_FunctionTypedFormalParameter_returnType() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 main(int callback()) {
 }
-''', r'''
+''',
+        r'''
 main(String callback()) {
 }
 ''');
   }
 
   void test_false_FunctionTypedFormalParameter_wasSimple() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 main(int callback) {
 }
-''', r'''
+''',
+        r'''
 main(int callback(int a, String b)) {
 }
 ''');
   }
 
   void test_false_getter_body_add() {
-    _assertDoesNotMatchOK(r'''
+    _assertDoesNotMatchOK(
+        r'''
 class A {
   int get foo;
 }
-''', r'''
+''',
+        r'''
 class A {
   int get foo => 0;
 }
@@ -985,11 +1264,13 @@
   }
 
   void test_false_getter_body_remove() {
-    _assertDoesNotMatchOK(r'''
+    _assertDoesNotMatchOK(
+        r'''
 class A {
   int get foo => 0;
 }
-''', r'''
+''',
+        r'''
 class A {
   int get foo;
 }
@@ -997,31 +1278,37 @@
   }
 
   void test_false_implementsClause_add() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 class A {}
 class B {}
-''', r'''
+''',
+        r'''
 class A {}
 class B implements A {}
 ''');
   }
 
   void test_false_implementsClause_remove() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 class A {}
 class B implements A {}
-''', r'''
+''',
+        r'''
 class A {}
 class B {}
 ''');
   }
 
   void test_false_implementsClause_reorder() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 class A {}
 class B {}
 class C implements A, B {}
-''', r'''
+''',
+        r'''
 class A {}
 class B {}
 class C implements B, A {}
@@ -1029,88 +1316,108 @@
   }
 
   void test_false_import_hide_add() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 import 'dart:async' hide Future;
-''', r'''
+''',
+        r'''
 import 'dart:async' hide Future, Stream;
 ''');
   }
 
   void test_false_import_hide_remove() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 import 'dart:async' hide Future, Stream;
-''', r'''
+''',
+        r'''
 import 'dart:async' hide Future;
 ''');
   }
 
   void test_false_import_list_add() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 import 'dart:async';
-''', r'''
+''',
+        r'''
 import 'dart:async';
 import 'dart:math';
 ''');
   }
 
   void test_false_import_list_remove() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 import 'dart:async';
 import 'dart:math';
-''', r'''
+''',
+        r'''
 import 'dart:async';
 ''');
   }
 
   void test_false_import_prefix_add() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 import 'dart:async';
-''', r'''
+''',
+        r'''
 import 'dart:async' as async;
 ''');
   }
 
   void test_false_import_prefix_edit() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 import 'dart:async' as oldPrefix;
-''', r'''
+''',
+        r'''
 import 'dart:async' as newPrefix;
 ''');
   }
 
   void test_false_import_prefix_remove() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 import 'dart:async' as async;
-''', r'''
+''',
+        r'''
 import 'dart:async';
 ''');
   }
 
   void test_false_import_show_add() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 import 'dart:async' show Future;
-''', r'''
+''',
+        r'''
 import 'dart:async' show Future, Stream;
 ''');
   }
 
   void test_false_import_show_remove() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 import 'dart:async' show Future, Stream;
-''', r'''
+''',
+        r'''
 import 'dart:async' show Future;
 ''');
   }
 
   void test_false_method_annotation_edit() {
-    _assertDoesNotMatchOK(r'''
+    _assertDoesNotMatchOK(
+        r'''
 const my_annotationA = const Object();
 const my_annotationB = const Object();
 class A {
   @my_annotationA
   void m() {}
 }
-''', r'''
+''',
+        r'''
 const my_annotationA = const Object();
 const my_annotationB = const Object();
 class A {
@@ -1121,12 +1428,14 @@
   }
 
   void test_false_method_annotations_add() {
-    _assertDoesNotMatchOK(r'''
+    _assertDoesNotMatchOK(
+        r'''
 const my_annotation = const Object();
 class A {
   void m() {}
 }
-''', r'''
+''',
+        r'''
 const my_annotation = const Object();
 class A {
   @my_annotation
@@ -1136,13 +1445,15 @@
   }
 
   void test_false_method_annotations_remove() {
-    _assertDoesNotMatchOK(r'''
+    _assertDoesNotMatchOK(
+        r'''
 const my_annotation = const Object();
 class A {
   @my_annotation
   void m() {}
 }
-''', r'''
+''',
+        r'''
 const my_annotation = const Object();
 class A {
   void m() {}
@@ -1151,11 +1462,13 @@
   }
 
   void test_false_method_async_add() {
-    _assertDoesNotMatchOK(r'''
+    _assertDoesNotMatchOK(
+        r'''
 class A {
   m() {}
 }
-''', r'''
+''',
+        r'''
 class A {
   m() async {}
 }
@@ -1163,11 +1476,13 @@
   }
 
   void test_false_method_async_remove() {
-    _assertDoesNotMatchOK(r'''
+    _assertDoesNotMatchOK(
+        r'''
 class A {
   m() async {}
 }
-''', r'''
+''',
+        r'''
 class A {
   m() {}
 }
@@ -1175,11 +1490,13 @@
   }
 
   void test_false_method_body_add() {
-    _assertDoesNotMatchOK(r'''
+    _assertDoesNotMatchOK(
+        r'''
 class A {
   void foo();
 }
-''', r'''
+''',
+        r'''
 class A {
   void foo() {}
 }
@@ -1187,11 +1504,13 @@
   }
 
   void test_false_method_body_remove() {
-    _assertDoesNotMatchOK(r'''
+    _assertDoesNotMatchOK(
+        r'''
 class A {
   void foo() {}
 }
-''', r'''
+''',
+        r'''
 class A {
   void foo();
 }
@@ -1199,11 +1518,13 @@
   }
 
   void test_false_method_generator_add() {
-    _assertDoesNotMatchOK(r'''
+    _assertDoesNotMatchOK(
+        r'''
 class A {
   m() async {}
 }
-''', r'''
+''',
+        r'''
 class A {
   m() async* {}
 }
@@ -1211,11 +1532,13 @@
   }
 
   void test_false_method_generator_remove() {
-    _assertDoesNotMatchOK(r'''
+    _assertDoesNotMatchOK(
+        r'''
 class A {
   m() async* {}
 }
-''', r'''
+''',
+        r'''
 class A {
   m() async {}
 }
@@ -1223,12 +1546,14 @@
   }
 
   void test_false_method_list_add() {
-    _assertDoesNotMatchOK(r'''
+    _assertDoesNotMatchOK(
+        r'''
 class A {
   a() {}
   b() {}
 }
-''', r'''
+''',
+        r'''
 class A {
   a() {}
   b() {}
@@ -1238,13 +1563,15 @@
   }
 
   void test_false_method_list_remove() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 class A {
   a() {}
   b() {}
   c() {}
 }
-''', r'''
+''',
+        r'''
 class A {
   a() {}
   b() {}
@@ -1253,12 +1580,14 @@
   }
 
   void test_false_method_parameters_type_edit() {
-    _assertDoesNotMatchOK(r'''
+    _assertDoesNotMatchOK(
+        r'''
 class A {
   m(int p) {
   }
 }
-''', r'''
+''',
+        r'''
 class A {
   m(String p) {
   }
@@ -1267,7 +1596,8 @@
   }
 
   void test_false_method_parameters_type_edit_insertImportPrefix() {
-    _assertDoesNotMatchOK(r'''
+    _assertDoesNotMatchOK(
+        r'''
 import 'dart:async' as a;
 
 class C {
@@ -1279,7 +1609,8 @@
 bar(C c, a.Future f) {
   c.foo(f);
 }
-''', r'''
+''',
+        r'''
 import 'dart:async' as a;
 
 class C {
@@ -1295,11 +1626,13 @@
   }
 
   void test_false_method_returnType_edit() {
-    _assertDoesNotMatchOK(r'''
+    _assertDoesNotMatchOK(
+        r'''
 class A {
   int m() {}
 }
-''', r'''
+''',
+        r'''
 class A {
   String m() {}
 }
@@ -1309,10 +1642,12 @@
   void test_false_part_list_add() {
     addNamedSource('/unitA.dart', 'part of lib; class A {}');
     addNamedSource('/unitB.dart', 'part of lib; class B {}');
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 library lib;
 part 'unitA.dart';
-''', r'''
+''',
+        r'''
 library lib;
 part 'unitA.dart';
 part 'unitB.dart';
@@ -1322,91 +1657,109 @@
   void test_false_part_list_remove() {
     addNamedSource('/unitA.dart', 'part of lib; class A {}');
     addNamedSource('/unitB.dart', 'part of lib; class B {}');
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 library lib;
 part 'unitA.dart';
 part 'unitB.dart';
-''', r'''
+''',
+        r'''
 library lib;
 part 'unitA.dart';
 ''');
   }
 
   void test_false_SimpleFormalParameter_named_differentName() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 main({int oldName}) {
 }
-''', r'''
+''',
+        r'''
 main({int newName}) {
 }
 ''');
   }
 
   void test_false_SimpleFormalParameter_namedDefault_addValue() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 main({int p}) {
 }
-''', r'''
+''',
+        r'''
 main({int p: 2}) {
 }
 ''');
   }
 
   void test_false_SimpleFormalParameter_namedDefault_differentValue() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 main({int p: 1}) {
 }
-''', r'''
+''',
+        r'''
 main({int p: 2}) {
 }
 ''');
   }
 
   void test_false_SimpleFormalParameter_namedDefault_removeValue() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 main({int p: 1}) {
 }
-''', r'''
+''',
+        r'''
 main({int p}) {
 }
 ''');
   }
 
   void test_false_SimpleFormalParameter_optionalDefault_addValue() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 main([int p]) {
 }
-''', r'''
+''',
+        r'''
 main([int p = 2]) {
 }
 ''');
   }
 
   void test_false_SimpleFormalParameter_optionalDefault_differentValue() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 main([int p = 1]) {
 }
-''', r'''
+''',
+        r'''
 main([int p = 2]) {
 }
 ''');
   }
 
   void test_false_SimpleFormalParameter_optionalDefault_removeValue() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 main([int p = 1]) {
 }
-''', r'''
+''',
+        r'''
 main([int p]) {
 }
 ''');
   }
 
   void test_false_topLevelAccessor_list_add() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 get a => 1;
 get b => 2;
-''', r'''
+''',
+        r'''
 get a => 1;
 get b => 2;
 get c => 3;
@@ -1414,37 +1767,45 @@
   }
 
   void test_false_topLevelAccessor_list_remove() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 get a => 1;
 get b => 2;
 get c => 3;
-''', r'''
+''',
+        r'''
 get a => 1;
 get b => 2;
 ''');
   }
 
   void test_false_topLevelAccessor_wasGetter() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 get a => 1;
-''', r'''
+''',
+        r'''
 set a(x) {}
 ''');
   }
 
   void test_false_topLevelAccessor_wasSetter() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 set a(x) {}
-''', r'''
+''',
+        r'''
 get a => 1;
 ''');
   }
 
   void test_false_topLevelFunction_list_add() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 a() {}
 b() {}
-''', r'''
+''',
+        r'''
 a() {}
 b() {}
 c() {}
@@ -1452,59 +1813,71 @@
   }
 
   void test_false_topLevelFunction_list_remove() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 a() {}
 b() {}
 c() {}
-''', r'''
+''',
+        r'''
 a() {}
 b() {}
 ''');
   }
 
   void test_false_topLevelFunction_parameters_list_add() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 main(int a, int b) {
 }
-''', r'''
+''',
+        r'''
 main(int a, int b, int c) {
 }
 ''');
   }
 
   void test_false_topLevelFunction_parameters_list_remove() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 main(int a, int b, int c) {
 }
-''', r'''
+''',
+        r'''
 main(int a, int b) {
 }
 ''');
   }
 
   void test_false_topLevelFunction_parameters_type_edit() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 main(int a, int b, int c) {
 }
-''', r'''
+''',
+        r'''
 main(int a, String b, int c) {
 }
 ''');
   }
 
   void test_false_topLevelFunction_returnType_edit() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 int a() {}
-''', r'''
+''',
+        r'''
 String a() {}
 ''');
   }
 
   void test_false_topLevelVariable_list_add() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 const int A = 1;
 const int C = 3;
-''', r'''
+''',
+        r'''
 const int A = 1;
 const int B = 2;
 const int C = 3;
@@ -1512,78 +1885,96 @@
   }
 
   void test_false_topLevelVariable_list_remove() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 const int A = 1;
 const int B = 2;
 const int C = 3;
-''', r'''
+''',
+        r'''
 const int A = 1;
 const int C = 3;
 ''');
   }
 
   void test_false_topLevelVariable_modifier_isConst() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 final int A = 1;
-''', r'''
+''',
+        r'''
 const int A = 1;
 ''');
   }
 
   void test_false_topLevelVariable_modifier_isFinal() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 int A = 1;
-''', r'''
+''',
+        r'''
 final int A = 1;
 ''');
   }
 
   void test_false_topLevelVariable_modifier_wasConst() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 const int A = 1;
-''', r'''
+''',
+        r'''
 final int A = 1;
 ''');
   }
 
   void test_false_topLevelVariable_modifier_wasFinal() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 final int A = 1;
-''', r'''
+''',
+        r'''
 int A = 1;
 ''');
   }
 
   void test_false_topLevelVariable_synthetic_wasGetter() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 int get A => 1;
-''', r'''
+''',
+        r'''
 final int A = 1;
 ''');
   }
 
   void test_false_topLevelVariable_type_different() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 int A;
-''', r'''
+''',
+        r'''
 String A;
 ''');
   }
 
   void test_false_topLevelVariable_type_differentArgs() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 List<int> A;
-''', r'''
+''',
+        r'''
 List<String> A;
 ''');
   }
 
   void test_false_type_noTypeArguments_hadTypeArguments() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 class A<T> {}
 A<int> main() {
 }
-''', r'''
+''',
+        r'''
 class A<T> {}
 A main() {
 }
@@ -1591,31 +1982,37 @@
   }
 
   void test_false_withClause_add() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 class A {}
 class B {}
-''', r'''
+''',
+        r'''
 class A {}
 class B extends Object with A {}
 ''');
   }
 
   void test_false_withClause_remove() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 class A {}
 class B extends Object with A {}
-''', r'''
+''',
+        r'''
 class A {}
 class B {}
 ''');
   }
 
   void test_false_withClause_reorder() {
-    _assertDoesNotMatch(r'''
+    _assertDoesNotMatch(
+        r'''
 class A {}
 class B {}
 class C extends Object with A, B {}
-''', r'''
+''',
+        r'''
 class A {}
 class B {}
 class C extends Object with B, A {}
@@ -1623,12 +2020,14 @@
   }
 
   void test_true_class_annotations_same() {
-    _assertMatches(r'''
+    _assertMatches(
+        r'''
 const my_annotation = const Object();
 @my_annotation
 class A {
 }
-''', r'''
+''',
+        r'''
 const my_annotation = const Object();
 @my_annotation
 class A {
@@ -1637,11 +2036,13 @@
   }
 
   void test_true_class_list_reorder() {
-    _assertMatches(r'''
+    _assertMatches(
+        r'''
 class A {}
 class B {}
 class C {}
-''', r'''
+''',
+        r'''
 class C {}
 class A {}
 class B {}
@@ -1649,11 +2050,13 @@
   }
 
   void test_true_class_list_same() {
-    _assertMatches(r'''
+    _assertMatches(
+        r'''
 class A {}
 class B {}
 class C {}
-''', r'''
+''',
+        r'''
 class A {}
 class B {}
 class C {}
@@ -1661,15 +2064,18 @@
   }
 
   void test_true_class_typeParameters_same() {
-    _assertMatches(r'''
+    _assertMatches(
+        r'''
 class A<T> {}
-''', r'''
+''',
+        r'''
 class A<T> {}
 ''');
   }
 
   void test_true_classMemberAccessor_getterSetter() {
-    _assertMatches(r'''
+    _assertMatches(
+        r'''
 class A {
   int _test;
   get test => _test;
@@ -1677,7 +2083,8 @@
     _test = v;
   }
 }
-''', r'''
+''',
+        r'''
 class A {
   int _test;
   get test => _test;
@@ -1689,13 +2096,15 @@
   }
 
   void test_true_classMemberAccessor_list_reorder() {
-    _assertMatches(r'''
+    _assertMatches(
+        r'''
 class A {
   get a => 1;
   get b => 2;
   get c => 3;
 }
-''', r'''
+''',
+        r'''
 class A {
   get c => 3;
   get a => 1;
@@ -1705,13 +2114,15 @@
   }
 
   void test_true_classMemberAccessor_list_same() {
-    _assertMatches(r'''
+    _assertMatches(
+        r'''
 class A {
   get a => 1;
   get b => 2;
   get c => 3;
 }
-''', r'''
+''',
+        r'''
 class A {
   get a => 1;
   get b => 2;
@@ -1721,12 +2132,14 @@
   }
 
   void test_true_classTypeAlias_list_reorder() {
-    _assertMatches(r'''
+    _assertMatches(
+        r'''
 class M {}
 class A = Object with M;
 class B = Object with M;
 class C = Object with M;
-''', r'''
+''',
+        r'''
 class M {}
 class C = Object with M;
 class A = Object with M;
@@ -1735,12 +2148,14 @@
   }
 
   void test_true_classTypeAlias_list_same() {
-    _assertMatches(r'''
+    _assertMatches(
+        r'''
 class M {}
 class A = Object with M;
 class B = Object with M;
 class C = Object with M;
-''', r'''
+''',
+        r'''
 class M {}
 class A = Object with M;
 class B = Object with M;
@@ -1749,11 +2164,13 @@
   }
 
   void test_true_classTypeAlias_typeParameters_same() {
-    _assertMatches(r'''
+    _assertMatches(
+        r'''
 class M<T> {}
 class A<T> {}
 class B<T> = A<T> with M<T>;
-''', r'''
+''',
+        r'''
 class M<T> {}
 class A<T> {}
 class B<T> = A<T> with M<T>;
@@ -1761,11 +2178,13 @@
   }
 
   void test_true_constructor_body_add() {
-    _assertMatches(r'''
+    _assertMatches(
+        r'''
 class A {
   A(int p);
 }
-''', r'''
+''',
+        r'''
 class A {
   A(int p) {}
 }
@@ -1773,11 +2192,13 @@
   }
 
   void test_true_constructor_body_remove() {
-    _assertMatches(r'''
+    _assertMatches(
+        r'''
 class A {
   A(int p) {}
 }
-''', r'''
+''',
+        r'''
 class A {
   A(int p);
 }
@@ -1785,11 +2206,13 @@
   }
 
   void test_true_constructor_named_same() {
-    _assertMatches(r'''
+    _assertMatches(
+        r'''
 class A {
   A.name(int p);
 }
-''', r'''
+''',
+        r'''
 class A {
   A.name(int p);
 }
@@ -1797,10 +2220,12 @@
   }
 
   void test_true_constructor_unnamed_add_noParameters() {
-    _assertMatches(r'''
+    _assertMatches(
+        r'''
 class A {
 }
-''', r'''
+''',
+        r'''
 class A {
   A() {}
 }
@@ -1808,22 +2233,26 @@
   }
 
   void test_true_constructor_unnamed_remove_noParameters() {
-    _assertMatches(r'''
+    _assertMatches(
+        r'''
 class A {
   A() {}
 }
-''', r'''
+''',
+        r'''
 class A {
 }
 ''');
   }
 
   void test_true_constructor_unnamed_same() {
-    _assertMatches(r'''
+    _assertMatches(
+        r'''
 class A {
   A(int p);
 }
-''', r'''
+''',
+        r'''
 class A {
   A(int p);
 }
@@ -1831,12 +2260,14 @@
   }
 
   void test_true_defaultFieldFormalParameterElement() {
-    _assertMatches(r'''
+    _assertMatches(
+        r'''
 class A {
   int field;
   A([this.field = 0]);
 }
-''', r'''
+''',
+        r'''
 class A {
   int field;
   A([this.field = 0]);
@@ -1845,19 +2276,23 @@
   }
 
   void test_true_enum_constants_reorder() {
-    _assertMatches(r'''
+    _assertMatches(
+        r'''
 enum E {A, B, C}
-''', r'''
+''',
+        r'''
 enum E {C, A, B}
 ''');
   }
 
   void test_true_enum_list_reorder() {
-    _assertMatches(r'''
+    _assertMatches(
+        r'''
 enum A {A1, A2, A3}
 enum B {B1, B2, B3}
 enum C {C1, C2, C3}
-''', r'''
+''',
+        r'''
 enum C {C1, C2, C3}
 enum A {A1, A2, A3}
 enum B {B1, B2, B3}
@@ -1865,11 +2300,13 @@
   }
 
   void test_true_enum_list_same() {
-    _assertMatches(r'''
+    _assertMatches(
+        r'''
 enum A {A1, A2, A3}
 enum B {B1, B2, B3}
 enum C {C1, C2, C3}
-''', r'''
+''',
+        r'''
 enum A {A1, A2, A3}
 enum B {B1, B2, B3}
 enum C {C1, C2, C3}
@@ -1877,11 +2314,13 @@
   }
 
   void test_true_executable_same_hasLabel() {
-    _assertMatches(r'''
+    _assertMatches(
+        r'''
 main() {
   label: return 42;
 }
-''', r'''
+''',
+        r'''
 main() {
   label: return 42;
 }
@@ -1889,11 +2328,13 @@
   }
 
   void test_true_executable_same_hasLocalVariable() {
-    _assertMatches(r'''
+    _assertMatches(
+        r'''
 main() {
   int a = 42;
 }
-''', r'''
+''',
+        r'''
 main() {
   int a = 42;
 }
@@ -1901,59 +2342,71 @@
   }
 
   void test_true_export_hide_reorder() {
-    _assertMatches(r'''
+    _assertMatches(
+        r'''
 export 'dart:async' hide Future, Stream;
-''', r'''
+''',
+        r'''
 export 'dart:async' hide Stream, Future;
 ''');
   }
 
   void test_true_export_list_reorder() {
-    _assertMatches(r'''
+    _assertMatches(
+        r'''
 export 'dart:async';
 export 'dart:math';
-''', r'''
+''',
+        r'''
 export 'dart:math';
 export 'dart:async';
 ''');
   }
 
   void test_true_export_list_same() {
-    _assertMatches(r'''
+    _assertMatches(
+        r'''
 export 'dart:async';
 export 'dart:math';
-''', r'''
+''',
+        r'''
 export 'dart:async';
 export 'dart:math';
 ''');
   }
 
   void test_true_export_show_reorder() {
-    _assertMatches(r'''
+    _assertMatches(
+        r'''
 export 'dart:async' show Future, Stream;
-''', r'''
+''',
+        r'''
 export 'dart:async' show Stream, Future;
 ''');
   }
 
   void test_true_extendsClause_same() {
-    _assertMatches(r'''
+    _assertMatches(
+        r'''
 class A {}
 class B extends A {}
-''', r'''
+''',
+        r'''
 class A {}
 class B extends A {}
 ''');
   }
 
   void test_true_field_list_reorder() {
-    _assertMatches(r'''
+    _assertMatches(
+        r'''
 class T {
   int A = 1;
   int B = 2;
   int C = 3;
 }
-''', r'''
+''',
+        r'''
 class T {
   int C = 3;
   int A = 1;
@@ -1963,13 +2416,15 @@
   }
 
   void test_true_field_list_same() {
-    _assertMatches(r'''
+    _assertMatches(
+        r'''
 class T {
   int A = 1;
   int B = 2;
   int C = 3;
 }
-''', r'''
+''',
+        r'''
 class T {
   int A = 1;
   int B = 2;
@@ -1979,12 +2434,14 @@
   }
 
   void test_true_fieldFormalParameter() {
-    _assertMatches(r'''
+    _assertMatches(
+        r'''
 class A {
   int field;
   A(this.field);
 }
-''', r'''
+''',
+        r'''
 class A {
   int field;
   A(this.field);
@@ -1992,13 +2449,31 @@
 ''');
   }
 
+  void test_true_fieldFormalParameter_changeName_wasUnresolvedField() {
+    _assertMatches(
+        r'''
+class A {
+  final fff;
+  A(this.unresolved);
+}
+''',
+        r'''
+class A {
+  final fff;
+  A(this.fff);
+}
+''');
+  }
+
   void test_true_fieldFormalParameter_function() {
-    _assertMatches(r'''
+    _assertMatches(
+        r'''
 class A {
   final field;
   A(this.field(int a, String b));
 }
-''', r'''
+''',
+        r'''
 class A {
   final field;
   A(this.field(int a, String b));
@@ -2007,11 +2482,13 @@
   }
 
   void test_true_functionTypeAlias_list_reorder() {
-    _assertMatches(r'''
+    _assertMatches(
+        r'''
 typedef A(int pa);
 typedef B(String pb);
 typedef C(pc);
-''', r'''
+''',
+        r'''
 typedef C(pc);
 typedef A(int pa);
 typedef B(String pb);
@@ -2019,11 +2496,13 @@
   }
 
   void test_true_functionTypeAlias_list_same() {
-    _assertMatches(r'''
+    _assertMatches(
+        r'''
 typedef String A(int pa);
 typedef int B(String pb);
 typedef C(pc);
-''', r'''
+''',
+        r'''
 typedef String A(int pa);
 typedef int B(String pb);
 typedef C(pc);
@@ -2031,85 +2510,103 @@
   }
 
   void test_true_functionTypeAlias_typeParameters_list_same() {
-    _assertMatches(r'''
+    _assertMatches(
+        r'''
 typedef F<A, B, C>();
-''', r'''
+''',
+        r'''
 typedef F<A, B, C>();
 ''');
   }
 
   void test_true_FunctionTypedFormalParameter() {
-    _assertMatches(r'''
+    _assertMatches(
+        r'''
 main(int callback(int a, String b)) {
 }
-''', r'''
+''',
+        r'''
 main(int callback(int a, String b)) {
 }
 ''');
   }
 
   void test_true_implementsClause_same() {
-    _assertMatches(r'''
+    _assertMatches(
+        r'''
 class A {}
 class B implements A {}
-''', r'''
+''',
+        r'''
 class A {}
 class B implements A {}
 ''');
   }
 
   void test_true_import_hide_reorder() {
-    _assertMatches(r'''
+    _assertMatches(
+        r'''
 import 'dart:async' hide Future, Stream;
-''', r'''
+''',
+        r'''
 import 'dart:async' hide Stream, Future;
 ''');
   }
 
   void test_true_import_list_reorder() {
-    _assertMatches(r'''
+    _assertMatches(
+        r'''
 import 'dart:async';
 import 'dart:math';
-''', r'''
+''',
+        r'''
 import 'dart:math';
 import 'dart:async';
 ''');
   }
 
   void test_true_import_list_same() {
-    _assertMatches(r'''
+    _assertMatches(
+        r'''
 import 'dart:async';
 import 'dart:math';
-''', r'''
+''',
+        r'''
 import 'dart:async';
 import 'dart:math';
 ''');
   }
 
   void test_true_import_prefix() {
-    _assertMatches(r'''
+    _assertMatches(
+        r'''
 import 'dart:async' as async;
-''', r'''
+''',
+        r'''
 import 'dart:async' as async;
 ''');
   }
 
   void test_true_import_show_reorder() {
-    _assertMatches(r'''
+    _assertMatches(
+        r'''
 import 'dart:async' show Future, Stream;
-''', r'''
+''',
+        r'''
 import 'dart:async' show Stream, Future;
 ''');
   }
 
   void test_true_method_annotation_accessor_same() {
-    _assertMatches(r'''
+    _assertMatches(
+        r'''
 const my_annotation = const Object();
 class A {
   @my_annotation
   void m() {}
 }
-''', r'''
+''',
+        r'''
 const my_annotation = const Object();
 class A {
   @my_annotation
@@ -2119,7 +2616,8 @@
   }
 
   void test_true_method_annotation_constructor_same() {
-    _assertMatches(r'''
+    _assertMatches(
+        r'''
 class MyAnnotation {
   const MyAnnotation();
 }
@@ -2127,7 +2625,8 @@
   @MyAnnotation()
   void m() {}
 }
-''', r'''
+''',
+        r'''
 class MyAnnotation {
   const MyAnnotation();
 }
@@ -2139,11 +2638,13 @@
   }
 
   void test_true_method_async() {
-    _assertMatches(r'''
+    _assertMatches(
+        r'''
 class A {
   m() async {}
 }
-''', r'''
+''',
+        r'''
 class A {
   m() async {}
 }
@@ -2151,13 +2652,15 @@
   }
 
   void test_true_method_list_reorder() {
-    _assertMatches(r'''
+    _assertMatches(
+        r'''
 class A {
   a() {}
   b() {}
   c() {}
 }
-''', r'''
+''',
+        r'''
 class A {
   c() {}
   a() {}
@@ -2167,13 +2670,15 @@
   }
 
   void test_true_method_list_same() {
-    _assertMatches(r'''
+    _assertMatches(
+        r'''
 class A {
   a() {}
   b() {}
   c() {}
 }
-''', r'''
+''',
+        r'''
 class A {
   a() {}
   b() {}
@@ -2183,11 +2688,13 @@
   }
 
   void test_true_method_operator_minus() {
-    _assertMatches(r'''
+    _assertMatches(
+        r'''
 class A {
   operator -(other) {}
 }
-''', r'''
+''',
+        r'''
 class A {
   operator -(other) {}
 }
@@ -2195,11 +2702,13 @@
   }
 
   void test_true_method_operator_minusUnary() {
-    _assertMatches(r'''
+    _assertMatches(
+        r'''
 class A {
   operator -() {}
 }
-''', r'''
+''',
+        r'''
 class A {
   operator -() {}
 }
@@ -2207,11 +2716,13 @@
   }
 
   void test_true_method_operator_plus() {
-    _assertMatches(r'''
+    _assertMatches(
+        r'''
 class A {
   operator +(other) {}
 }
-''', r'''
+''',
+        r'''
 class A {
   operator +(other) {}
 }
@@ -2219,12 +2730,14 @@
   }
 
   void test_true_method_parameters_type_functionType() {
-    _assertMatches(r'''
+    _assertMatches(
+        r'''
 typedef F();
 class A {
   m(F p) {}
 }
-''', r'''
+''',
+        r'''
 typedef F();
 class A {
   m(F p) {}
@@ -2233,13 +2746,15 @@
   }
 
   void test_true_method_parameters_type_sameImportPrefix() {
-    _assertMatches(r'''
+    _assertMatches(
+        r'''
 import 'dart:async' as a;
 
 bar(a.Future f) {
   print(f);
 }
-''', r'''
+''',
+        r'''
 import 'dart:async' as a;
 
 bar(a.Future ff) {
@@ -2251,11 +2766,13 @@
   void test_true_part_list_reorder() {
     addNamedSource('/unitA.dart', 'part of lib; class A {}');
     addNamedSource('/unitB.dart', 'part of lib; class B {}');
-    _assertMatches(r'''
+    _assertMatches(
+        r'''
 library lib;
 part 'unitA.dart';
 part 'unitB.dart';
-''', r'''
+''',
+        r'''
 library lib;
 part 'unitB.dart';
 part 'unitA.dart';
@@ -2265,11 +2782,13 @@
   void test_true_part_list_same() {
     addNamedSource('/unitA.dart', 'part of lib; class A {}');
     addNamedSource('/unitB.dart', 'part of lib; class B {}');
-    _assertMatches(r'''
+    _assertMatches(
+        r'''
 library lib;
 part 'unitA.dart';
 part 'unitB.dart';
-''', r'''
+''',
+        r'''
 library lib;
 part 'unitA.dart';
 part 'unitB.dart';
@@ -2277,41 +2796,49 @@
   }
 
   void test_true_SimpleFormalParameter_optional_differentName() {
-    _assertMatches(r'''
+    _assertMatches(
+        r'''
 main([int oldName]) {
 }
-''', r'''
+''',
+        r'''
 main([int newName]) {
 }
 ''');
   }
 
   void test_true_SimpleFormalParameter_optionalDefault_differentName() {
-    _assertMatches(r'''
+    _assertMatches(
+        r'''
 main([int oldName = 1]) {
 }
-''', r'''
+''',
+        r'''
 main([int newName = 1]) {
 }
 ''');
   }
 
   void test_true_SimpleFormalParameter_required_differentName() {
-    _assertMatches(r'''
+    _assertMatches(
+        r'''
 main(int oldName) {
 }
-''', r'''
+''',
+        r'''
 main(int newName) {
 }
 ''');
   }
 
   void test_true_topLevelAccessor_list_reorder() {
-    _assertMatches(r'''
+    _assertMatches(
+        r'''
 set a(x) {}
 set b(x) {}
 set c(x) {}
-''', r'''
+''',
+        r'''
 set c(x) {}
 set a(x) {}
 set b(x) {}
@@ -2319,11 +2846,13 @@
   }
 
   void test_true_topLevelAccessor_list_same() {
-    _assertMatches(r'''
+    _assertMatches(
+        r'''
 get a => 1;
 get b => 2;
 get c => 3;
-''', r'''
+''',
+        r'''
 get a => 1;
 get b => 2;
 get c => 3;
@@ -2331,11 +2860,13 @@
   }
 
   void test_true_topLevelFunction_list_reorder() {
-    _assertMatches(r'''
+    _assertMatches(
+        r'''
 a() {}
 b() {}
 c() {}
-''', r'''
+''',
+        r'''
 c() {}
 a() {}
 b() {}
@@ -2343,11 +2874,13 @@
   }
 
   void test_true_topLevelFunction_list_same() {
-    _assertMatches(r'''
+    _assertMatches(
+        r'''
 a() {}
 b() {}
 c() {}
-''', r'''
+''',
+        r'''
 a() {}
 b() {}
 c() {}
@@ -2355,11 +2888,13 @@
   }
 
   void test_true_topLevelVariable_list_reorder() {
-    _assertMatches(r'''
+    _assertMatches(
+        r'''
 const int A = 1;
 const int B = 2;
 const int C = 3;
-''', r'''
+''',
+        r'''
 const int C = 3;
 const int A = 1;
 const int B = 2;
@@ -2367,11 +2902,13 @@
   }
 
   void test_true_topLevelVariable_list_same() {
-    _assertMatches(r'''
+    _assertMatches(
+        r'''
 const int A = 1;
 const int B = 2;
 const int C = 3;
-''', r'''
+''',
+        r'''
 const int A = 1;
 const int B = 2;
 const int C = 3;
@@ -2379,37 +2916,45 @@
   }
 
   void test_true_topLevelVariable_type_sameArgs() {
-    _assertMatches(r'''
+    _assertMatches(
+        r'''
 Map<int, String> A;
-''', r'''
+''',
+        r'''
 Map<int, String> A;
 ''');
   }
 
   void test_true_type_dynamic() {
-    _assertMatches(r'''
+    _assertMatches(
+        r'''
 dynamic a() {}
-''', r'''
+''',
+        r'''
 dynamic a() {}
 ''');
   }
 
   void test_true_type_hasImportPrefix() {
-    _assertMatches(r'''
+    _assertMatches(
+        r'''
 import 'dart:async' as async;
 async.Future F;
-''', r'''
+''',
+        r'''
 import 'dart:async' as async;
 async.Future F;
 ''');
   }
 
   void test_true_type_noTypeArguments_implyAllDynamic() {
-    _assertMatches(r'''
+    _assertMatches(
+        r'''
 class A<T> {}
 A main() {
 }
-''', r'''
+''',
+        r'''
 class A<T> {}
 A main() {
 }
@@ -2417,18 +2962,22 @@
   }
 
   void test_true_type_void() {
-    _assertMatches(r'''
+    _assertMatches(
+        r'''
 void a() {}
-''', r'''
+''',
+        r'''
 void a() {}
 ''');
   }
 
   void test_true_withClause_same() {
-    _assertMatches(r'''
+    _assertMatches(
+        r'''
 class A {}
 class B extends Object with A {}
-''', r'''
+''',
+        r'''
 class A {}
 class B extends Object with A {}
 ''');
@@ -2520,15 +3069,6 @@
     _resolve(_editString('+', '*'), _isFunctionBody);
   }
 
-  void test_constructor_fieldFormalParameter() {
-    _resolveUnit(r'''
-class A {
-  int xy;
-  A(this.x);
-}''');
-    _resolve(_editString('this.x', 'this.xy'), _isDeclaration);
-  }
-
   void test_constructor_fieldInitializer_add() {
     _resolveUnit(r'''
 class A {
@@ -2583,6 +3123,15 @@
     _resolve(_editString('+', '*'), _isExpression);
   }
 
+  void test_fieldFormalParameter() {
+    _resolveUnit(r'''
+class A {
+  int xy;
+  A(this.x);
+}''');
+    _resolve(_editString('this.x', 'this.xy'), _isDeclaration);
+  }
+
   void test_function_localFunction_add() {
     _resolveUnit(r'''
 int main() {
@@ -2657,10 +3206,14 @@
   }
 }
 ''');
-    _resolve(_editString('    return a + b;', r'''
+    _resolve(
+        _editString(
+            '    return a + b;',
+            r'''
     int res = a + b;
     return res;
-'''), _isBlock);
+'''),
+        _isBlock);
   }
 
   void test_method_parameter_rename() {
@@ -2671,9 +3224,13 @@
   }
 }
 ''');
-    _resolve(_editString(r'''(int a, int b, int c) {
-    return a + b + c;''', r'''(int a, int second, int c) {
-    return a + second + c;'''), _isDeclaration);
+    _resolve(
+        _editString(
+            r'''(int a, int b, int c) {
+    return a + b + c;''',
+            r'''(int a, int second, int c) {
+    return a + second + c;'''),
+        _isDeclaration);
   }
 
   void test_superInvocation() {
@@ -2721,10 +3278,14 @@
   return a + b;
 }
 ''');
-    _resolve(_editString('  return a + b;', r'''
+    _resolve(
+        _editString(
+            '  return a + b;',
+            r'''
   int res = a + b;
   return res;
-'''), _isBlock);
+'''),
+        _isBlock);
   }
 
   void test_topLevelFunction_localVariable_remove() {
@@ -2751,9 +3312,13 @@
   return a + b;
 }
 ''');
-    _resolve(_editString(r'''(int a, int b) {
-  return a + b;''', r'''(int first, int b) {
-  return first + b;'''), _isDeclaration);
+    _resolve(
+        _editString(
+            r'''(int a, int b) {
+  return a + b;''',
+            r'''(int first, int b) {
+  return first + b;'''),
+        _isDeclaration);
   }
 
   void test_topLevelVariable_initializer() {
@@ -2827,14 +3392,24 @@
     if (AnalysisEngine.instance.useTaskModel) {
       LibrarySpecificUnit lsu = new LibrarySpecificUnit(source, source);
       task.AnalysisCache cache = analysisContext2.analysisCache;
-      resolver = new IncrementalResolver(null, cache.get(source),
-          cache.get(lsu), unit.element, updateOffset, updateEndOld,
+      resolver = new IncrementalResolver(
+          null,
+          cache.get(source),
+          cache.get(lsu),
+          unit.element,
+          updateOffset,
+          updateEndOld,
           updateOldNew);
     } else {
       resolver = new IncrementalResolver(
           (analysisContext2 as AnalysisContextImpl)
-              .getReadableSourceEntryOrNull(source), null, null, unit.element,
-          updateOffset, updateEndOld, updateOldNew);
+              .getReadableSourceEntryOrNull(source),
+          null,
+          null,
+          unit.element,
+          updateOffset,
+          updateEndOld,
+          updateOldNew);
     }
     bool success = resolver.resolve(newNode);
     expect(success, isTrue);
@@ -2942,11 +3517,19 @@
 ''');
   }
 
+  @override
   void setUp() {
+    AnalysisEngine.instance.useTaskModel = true;
     super.setUp();
     _resetWithIncremental(true);
   }
 
+  @override
+  void tearDown() {
+    super.tearDown();
+    AnalysisEngine.instance.useTaskModel = false;
+  }
+
   void test_computeConstants() {
     _resolveUnit(r'''
 int f() => 0;
@@ -3219,13 +3802,15 @@
   x.foo();
 }
 ''');
-    _updateAndValidate(r'''
+    _updateAndValidate(
+        r'''
 // 000
 main() {
   Object x;
   x.foo();
 }
-''', expectedSuccess: false);
+''',
+        expectedSuccess: false);
   }
 
   void test_endOfLineComment_outBody_remove() {
@@ -3236,12 +3821,14 @@
   x.foo();
 }
 ''');
-    _updateAndValidate(r'''
+    _updateAndValidate(
+        r'''
 main() {
   Object x;
   x.foo();
 }
-''', expectedSuccess: false);
+''',
+        expectedSuccess: false);
   }
 
   void test_endOfLineComment_outBody_update() {
@@ -3252,13 +3839,15 @@
   x.foo();
 }
 ''');
-    _updateAndValidate(r'''
+    _updateAndValidate(
+        r'''
 // 10
 main() {
   Object x;
   x.foo();
 }
-''', expectedSuccess: false);
+''',
+        expectedSuccess: false);
   }
 
   void test_endOfLineComment_remove() {
@@ -3286,7 +3875,8 @@
   const {const C(0): 0, const C.foo(): 1};
 }
 ''');
-    _updateAndValidate(r'''
+    _updateAndValidate(
+        r'''
 class C {
   final int x;
   const C(this.x);
@@ -3295,7 +3885,23 @@
 main() {
   const {const C(0): 0, const C.foo(): 1};
 }
-''', expectedSuccess: false);
+''',
+        expectedSuccess: false);
+  }
+
+  void test_false_expressionBody() {
+    _resolveUnit(r'''
+class A {
+  final f = (() => 1)();
+}
+''');
+    _updateAndValidate(
+        r'''
+class A {
+  final f = (() => 2)();
+}
+''',
+        expectedSuccess: false);
   }
 
   void test_false_topLevelFunction_name() {
@@ -3303,10 +3909,12 @@
 a() {}
 b() {}
 ''');
-    _updateAndValidate(r'''
+    _updateAndValidate(
+        r'''
 a() {}
 bb() {}
-''', expectedSuccess: false);
+''',
+        expectedSuccess: false);
   }
 
   void test_false_unbalancedCurlyBrackets_inNew() {
@@ -3322,7 +3930,8 @@
     print(0123456789);
   }
 }''');
-    _updateAndValidate(r'''
+    _updateAndValidate(
+        r'''
 class A {
   aaa() {
       1;
@@ -3332,7 +3941,8 @@
   bbb() {
     print(0123456789);
   }
-}''', expectedSuccess: false);
+}''',
+        expectedSuccess: false);
   }
 
   void test_false_unbalancedCurlyBrackets_inOld() {
@@ -3347,7 +3957,8 @@
     print(0123456789);
   }
 }''');
-    _updateAndValidate(r'''
+    _updateAndValidate(
+        r'''
 class A {
   aaa() {
     if (true) {
@@ -3358,7 +3969,8 @@
   bbb() {
     print(0123456789);
   }
-}''', expectedSuccess: false);
+}''',
+        expectedSuccess: false);
   }
 
   void test_fieldClassField_propagatedType() {
@@ -3449,20 +4061,24 @@
 }''');
     for (int i = 0; i < 6; i++) {
       if (i.isEven) {
-        _updateAndValidate(r'''
+        _updateAndValidate(
+            r'''
 class A {
   m() {
     return true;
 
   }
-}''', compareWithFull: false);
+}''',
+            compareWithFull: false);
       } else {
-        _updateAndValidate(r'''
+        _updateAndValidate(
+            r'''
 class A {
   m() {
     return true;
   }
-}''', compareWithFull: false);
+}''',
+            compareWithFull: false);
       }
     }
   }
@@ -3474,15 +4090,19 @@
 }''');
     for (int i = 0; i < 6; i++) {
       if (i.isEven) {
-        _updateAndValidate(r'''
+        _updateAndValidate(
+            r'''
 main() {
   print(12);
-}''', compareWithFull: false);
+}''',
+            compareWithFull: false);
       } else {
-        _updateAndValidate(r'''
+        _updateAndValidate(
+            r'''
 main() {
   print(1);
-}''', compareWithFull: false);
+}''',
+            compareWithFull: false);
       }
     }
   }
@@ -3553,6 +4173,28 @@
 ''');
   }
 
+  void test_true_todoHint() {
+    _resolveUnit(r'''
+main() {
+  print(1);
+}
+foo() {
+ // TODO
+}
+''');
+    List<AnalysisError> oldErrors = analysisContext.computeErrors(source);
+    _updateAndValidate(r'''
+main() {
+  print(2);
+}
+foo() {
+ // TODO
+}
+''');
+    List<AnalysisError> newErrors = analysisContext.computeErrors(source);
+    _assertEqualErrors(newErrors, oldErrors);
+  }
+
   void test_true_wholeConstructor() {
     _resolveUnit(r'''
 class A {
@@ -3631,7 +4273,9 @@
   }
 
   void test_unusedHint_add_wasUsedOnlyInPart() {
-    Source partSource = addNamedSource('/my_unit.dart', r'''
+    Source partSource = addNamedSource(
+        '/my_unit.dart',
+        r'''
 part of lib;
 
 f(A a) {
@@ -3650,7 +4294,9 @@
     _runTasks();
     // perform incremental resolution
     _resetWithIncremental(true);
-    analysisContext2.setContents(partSource, r'''
+    analysisContext2.setContents(
+        partSource,
+        r'''
 part of lib;
 
 f(A a) {
@@ -3679,7 +4325,9 @@
   }
 
   void test_unusedHint_false_stillUsedInPart() {
-    addNamedSource('/my_unit.dart', r'''
+    addNamedSource(
+        '/my_unit.dart',
+        r'''
 part of lib;
 
 f(A a) {
@@ -3697,7 +4345,9 @@
 ''');
     // perform incremental resolution
     _resetWithIncremental(true);
-    analysisContext2.setContents(source, r'''
+    analysisContext2.setContents(
+        source,
+        r'''
 library lib;
 part 'my_unit.dart';
 class A {
@@ -3872,6 +4522,36 @@
 ''');
   }
 
+  void test_whitespace_getElementAt() {
+    _resolveUnit(r'''
+class A {}
+class B extends A {}
+''');
+    {
+      ClassElement typeA = oldUnitElement.getType('A');
+      expect(oldUnitElement.getElementAt(typeA.nameOffset), typeA);
+    }
+    {
+      ClassElement typeB = oldUnitElement.getType('B');
+      expect(oldUnitElement.getElementAt(typeB.nameOffset), typeB);
+    }
+    _updateAndValidate(r'''
+class A {}
+
+class B extends A {}
+''');
+    // getElementAt() caches results, it should be notified when offset
+    // are changed.
+    {
+      ClassElement typeA = oldUnitElement.getType('A');
+      expect(oldUnitElement.getElementAt(typeA.nameOffset), typeA);
+    }
+    {
+      ClassElement typeB = oldUnitElement.getType('B');
+      expect(oldUnitElement.getElementAt(typeB.nameOffset), typeB);
+    }
+  }
+
   void _assertEqualLineInfo(LineInfo incrLineInfo, LineInfo fullLineInfo) {
     for (int offset = 0; offset < 1000; offset++) {
       LineInfo_Location incrLocation = incrLineInfo.getLocation(offset);
@@ -3930,8 +4610,10 @@
       expect(newUnit.element, isNot(same(oldUnitElement)));
       return;
     }
-    // The existing CompilationUnitElement should be updated.
+    // The existing CompilationUnit[Element] should be updated.
+    expect(newUnit, same(oldUnit));
     expect(newUnit.element, same(oldUnitElement));
+    expect(analysisContext.parseCompilationUnit(source), same(oldUnit));
     // The only expected pending task should return the same resolved
     // "newUnit", so all clients will get it using the usual way.
     AnalysisResult analysisResult = analysisContext.performAnalysisTask();
@@ -3940,8 +4622,7 @@
     // Resolve "newCode" from scratch.
     if (compareWithFull) {
       _resetWithIncremental(false);
-      source = addSource(newCode + ' ');
-      source = addSource(newCode);
+      changeSource(source, newCode);
       _runTasks();
       LibraryElement library = resolve2(source);
       CompilationUnit fullNewUnit = resolveCompilationUnit(source, library);
@@ -4103,8 +4784,9 @@
     unit.declarations.add(classNode);
     ClassElement classElement = ElementFactory.classElement2(className);
     classNode.name.staticElement = classElement;
-    (unit.element as CompilationUnitElementImpl).types =
-        <ClassElement>[classElement];
+    (unit.element as CompilationUnitElementImpl).types = <ClassElement>[
+      classElement
+    ];
     return classNode;
   }
 
@@ -4116,8 +4798,9 @@
     unit.declarations.add(classNode);
     ClassElement classElement = ElementFactory.classElement2(className);
     classNode.name.staticElement = classElement;
-    (unit.element as CompilationUnitElementImpl).types =
-        <ClassElement>[classElement];
+    (unit.element as CompilationUnitElementImpl).types = <ClassElement>[
+      classElement
+    ];
     return classNode;
   }
 
@@ -4133,14 +4816,17 @@
     ClassDeclaration classNode = _createResolvedClassDeclaration();
     String constructorName = "f";
     ConstructorDeclaration constructorNode = AstFactory.constructorDeclaration(
-        AstFactory.identifier3(constructorName), null,
-        AstFactory.formalParameterList(), null);
+        AstFactory.identifier3(constructorName),
+        null,
+        AstFactory.formalParameterList(),
+        null);
     classNode.members.add(constructorNode);
     ConstructorElement constructorElement =
         ElementFactory.constructorElement2(classNode.element, null);
     constructorNode.element = constructorElement;
-    (classNode.element as ClassElementImpl).constructors =
-        <ConstructorElement>[constructorElement];
+    (classNode.element as ClassElementImpl).constructors = <ConstructorElement>[
+      constructorElement
+    ];
     return constructorNode;
   }
 
@@ -4153,15 +4839,18 @@
     FunctionElement functionElement =
         ElementFactory.functionElement(functionName);
     functionNode.name.staticElement = functionElement;
-    (unit.element as CompilationUnitElementImpl).functions =
-        <FunctionElement>[functionElement];
+    (unit.element as CompilationUnitElementImpl).functions = <FunctionElement>[
+      functionElement
+    ];
     return functionNode;
   }
 
   FunctionTypeAlias _createResolvedFunctionTypeAlias() {
     CompilationUnit unit = _createResolvedCompilationUnit();
     FunctionTypeAlias aliasNode = AstFactory.typeAlias(
-        AstFactory.typeName4("A"), "F", AstFactory.typeParameterList(),
+        AstFactory.typeName4("A"),
+        "F",
+        AstFactory.typeParameterList(),
         AstFactory.formalParameterList());
     unit.declarations.add(aliasNode);
     SimpleIdentifier aliasName = aliasNode.name;
@@ -4176,15 +4865,20 @@
   MethodDeclaration _createResolvedMethodDeclaration() {
     ClassDeclaration classNode = _createResolvedClassDeclaration();
     String methodName = "f";
-    MethodDeclaration methodNode = AstFactory.methodDeclaration(null, null,
-        null, null, AstFactory.identifier3(methodName),
+    MethodDeclaration methodNode = AstFactory.methodDeclaration(
+        null,
+        null,
+        null,
+        null,
+        AstFactory.identifier3(methodName),
         AstFactory.formalParameterList());
     classNode.members.add(methodNode);
     MethodElement methodElement =
         ElementFactory.methodElement(methodName, null);
     methodNode.name.staticElement = methodElement;
-    (classNode.element as ClassElementImpl).methods =
-        <MethodElement>[methodElement];
+    (classNode.element as ClassElementImpl).methods = <MethodElement>[
+      methodElement
+    ];
     return methodNode;
   }
 
diff --git a/pkg/analyzer/test/generated/incremental_scanner_test.dart b/pkg/analyzer/test/generated/incremental_scanner_test.dart
index 7307dfb..6b72aa6 100644
--- a/pkg/analyzer/test/generated/incremental_scanner_test.dart
+++ b/pkg/analyzer/test/generated/incremental_scanner_test.dart
@@ -11,10 +11,11 @@
 import 'package:unittest/unittest.dart';
 
 import '../reflective_tests.dart';
+import '../utils.dart';
 import 'test_support.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   runReflectiveTests(IncrementalScannerTest);
 }
 
@@ -317,10 +318,14 @@
   void test_insert_whitespace_withMultipleComments() {
     // "//comment1", "//comment2", "a + b;"
     // "//comment1", "//comment2", "a  + b;"
-    _scan(r'''
+    _scan(
+        r'''
 //comment1
 //comment2
-a''', "", " ", " + b;");
+a''',
+        "",
+        " ",
+        " + b;");
     _assertTokens(1, 2, ["a", "+", "b", ";"]);
     expect(_incrementalScanner.hasNonWhitespaceChange, isFalse);
   }
@@ -413,9 +418,11 @@
     expect(actual.type, same(expected.type), reason: "Wrong type for token");
     expect(actual.lexeme, expected.lexeme, reason: "Wrong lexeme for token");
     expect(actual.offset, expected.offset,
-        reason: "Wrong offset for token ('${actual.lexeme}' != '${expected.lexeme}')");
+        reason:
+            "Wrong offset for token ('${actual.lexeme}' != '${expected.lexeme}')");
     expect(actual.length, expected.length,
-        reason: "Wrong length for token ('${actual.lexeme}' != '${expected.lexeme}')");
+        reason:
+            "Wrong length for token ('${actual.lexeme}' != '${expected.lexeme}')");
   }
 
   /**
@@ -521,9 +528,11 @@
         modifiedComment = modifiedComment.next;
       }
       expect(incrementalComment, isNull,
-          reason: "Too many comment tokens preceeding '${incrementalToken.lexeme}'");
+          reason:
+              "Too many comment tokens preceeding '${incrementalToken.lexeme}'");
       expect(modifiedComment, isNull,
-          reason: "Not enough comment tokens preceeding '${incrementalToken.lexeme}'");
+          reason:
+              "Not enough comment tokens preceeding '${incrementalToken.lexeme}'");
       incrementalToken = incrementalToken.next;
       modifiedTokens = modifiedTokens.next;
     }
diff --git a/pkg/analyzer/test/generated/java_core_test.dart b/pkg/analyzer/test/generated/java_core_test.dart
index 7efb77d..e60e9c1 100644
--- a/pkg/analyzer/test/generated/java_core_test.dart
+++ b/pkg/analyzer/test/generated/java_core_test.dart
@@ -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.
 
-// This code was auto-generated, is not intended to be edited, and is subject to
-// significant change. Please see the README file for more information.
-
 library engine.java_core_test;
 
 import 'package:analyzer/src/generated/java_core.dart';
 import 'package:unittest/unittest.dart';
 
+import '../utils.dart';
+
 main() {
+  initializeTestEnvironment();
   group('Character', () {
     group('isDigit', () {
       test('digits', () {
diff --git a/pkg/analyzer/test/generated/java_io_test.dart b/pkg/analyzer/test/generated/java_io_test.dart
index fcce915..2bd611d 100644
--- a/pkg/analyzer/test/generated/java_io_test.dart
+++ b/pkg/analyzer/test/generated/java_io_test.dart
@@ -2,52 +2,41 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-// This code was auto-generated, is not intended to be edited, and is subject to
-// significant change. Please see the README file for more information.
-
 library engine.java_io_test;
 
-import 'dart:io';
-
 import 'package:analyzer/src/generated/java_io.dart';
-import 'package:path/path.dart';
 import 'package:unittest/unittest.dart';
 
+import '../utils.dart';
+
 main() {
+  initializeTestEnvironment();
   group('JavaFile', () {
     group('toURI', () {
       test('forAbsolute', () {
-        var tempDir = Directory.systemTemp.createTempSync('java_io_test');
-        try {
-          String tempPath = normalize(absolute(tempDir.path));
-          String path = join(tempPath, 'foo.dart');
-          // we use an absolute path
-          expect(isAbsolute(path), isTrue);
-          // test that toURI() returns an absolute URI
-          Uri uri = new JavaFile(path).toURI();
-          expect(uri.isAbsolute, isTrue);
-          expect(uri.scheme, 'file');
-        } finally {
-          tempDir.deleteSync(recursive: true);
-        }
+        String tempPath = '/temp';
+        String path = JavaFile.pathContext.join(tempPath, 'foo.dart');
+        // we use an absolute path
+        expect(JavaFile.pathContext.isAbsolute(path), isTrue,
+            reason: '"$path" is not absolute');
+        // test that toURI() returns an absolute URI
+        Uri uri = new JavaFile(path).toURI();
+        expect(uri.isAbsolute, isTrue);
+        expect(uri.scheme, 'file');
       });
       test('forRelative', () {
-        var tempDir = Directory.systemTemp.createTempSync('java_io_test');
-        try {
-          String tempPath = normalize(absolute(tempDir.path));
-          String path = join(tempPath, 'foo.dart');
-          expect(isAbsolute(path), isTrue);
-          // 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 = relative(path);
-          // test that toURI() returns an absolute URI
-          Uri uri = new JavaFile(relPath).toURI();
-          expect(uri.isAbsolute, isTrue);
-          expect(uri.scheme, 'file');
-        } finally {
-          tempDir.deleteSync(recursive: true);
-        }
+        String tempPath = '/temp';
+        String path = JavaFile.pathContext.join(tempPath, 'foo.dart');
+        expect(JavaFile.pathContext.isAbsolute(path), isTrue,
+            reason: '"$path" 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);
+        // test that toURI() returns an absolute URI
+        Uri uri = new JavaFile(relPath).toURI();
+        expect(uri.isAbsolute, isTrue);
+        expect(uri.scheme, 'file');
       });
     });
   });
diff --git a/pkg/analyzer/test/generated/non_error_resolver_test.dart b/pkg/analyzer/test/generated/non_error_resolver_test.dart
index 9b057a7..56aa853 100644
--- a/pkg/analyzer/test/generated/non_error_resolver_test.dart
+++ b/pkg/analyzer/test/generated/non_error_resolver_test.dart
@@ -10,14 +10,15 @@
 import 'package:analyzer/src/generated/error.dart';
 import 'package:analyzer/src/generated/parser.dart' show ParserErrorCode;
 import 'package:analyzer/src/generated/source_io.dart';
-import 'package:unittest/unittest.dart' as _ut;
+import 'package:unittest/unittest.dart';
 
 import '../reflective_tests.dart';
+import '../utils.dart';
 import 'resolver_test.dart';
 import 'test_support.dart';
 
 main() {
-  _ut.groupSep = ' | ';
+  initializeTestEnvironment();
   runReflectiveTests(NonErrorResolverTest);
 }
 
@@ -39,10 +40,14 @@
 library L;
 export 'lib1.dart';
 export 'lib2.dart';''');
-    addNamedSource("/lib1.dart", r'''
+    addNamedSource(
+        "/lib1.dart",
+        r'''
 library lib1;
 class M {}''');
-    addNamedSource("/lib2.dart", r'''
+    addNamedSource(
+        "/lib2.dart",
+        r'''
 library lib2;
 class N {}''');
     computeLibrarySourceErrors(source);
@@ -55,11 +60,15 @@
 library L;
 export 'lib1.dart';
 export 'lib2.dart' hide B;''');
-    addNamedSource("/lib1.dart", r'''
+    addNamedSource(
+        "/lib1.dart",
+        r'''
 library L1;
 class A {}
 class B {}''');
-    addNamedSource("/lib2.dart", r'''
+    addNamedSource(
+        "/lib2.dart",
+        r'''
 library L2;
 class B {}
 class C {}''');
@@ -73,11 +82,15 @@
 library L;
 export 'lib1.dart';
 export 'lib2.dart' show C;''');
-    addNamedSource("/lib1.dart", r'''
+    addNamedSource(
+        "/lib1.dart",
+        r'''
 library L1;
 class A {}
 class B {}''');
-    addNamedSource("/lib2.dart", r'''
+    addNamedSource(
+        "/lib2.dart",
+        r'''
 library L2;
 class B {}
 class C {}''');
@@ -91,7 +104,9 @@
 library L;
 export 'lib.dart';
 export 'lib.dart';''');
-    addNamedSource("/lib.dart", r'''
+    addNamedSource(
+        "/lib.dart",
+        r'''
 library lib;
 class N {}''');
     computeLibrarySourceErrors(source);
@@ -109,15 +124,21 @@
   new N2();
   new N3();
 }''');
-    addNamedSource("/lib1.dart", r'''
+    addNamedSource(
+        "/lib1.dart",
+        r'''
 library lib1;
 class N {}
 class N1 {}''');
-    addNamedSource("/lib2.dart", r'''
+    addNamedSource(
+        "/lib2.dart",
+        r'''
 library lib2;
 class N {}
 class N2 {}''');
-    addNamedSource("/lib3.dart", r'''
+    addNamedSource(
+        "/lib3.dart",
+        r'''
 library lib3;
 class N {}
 class N3 {}''');
@@ -133,11 +154,15 @@
   new N1();
   new N2();
 }''');
-    addNamedSource("/lib1.dart", r'''
+    addNamedSource(
+        "/lib1.dart",
+        r'''
 library lib1;
 class N {}
 class N1 {}''');
-    addNamedSource("/lib2.dart", r'''
+    addNamedSource(
+        "/lib2.dart",
+        r'''
 library lib2;
 class N {}
 class N2 {}''');
@@ -321,7 +346,9 @@
 main() {
   foo.x = true;
 }''');
-    addNamedSource("/lib1.dart", r'''
+    addNamedSource(
+        "/lib1.dart",
+        r'''
 library lib1;
 bool x = false;''');
     computeLibrarySourceErrors(source);
@@ -664,6 +691,32 @@
     verify([source]);
   }
 
+  void test_bug_24539_getter() {
+    Source source = addSource('''
+class C<T> {
+  List<Foo> get x => null;
+}
+
+typedef Foo(param);
+''');
+    computeLibrarySourceErrors(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  void test_bug_24539_setter() {
+    Source source = addSource('''
+class C<T> {
+  void set x(List<Foo> value) {}
+}
+
+typedef Foo(param);
+''');
+    computeLibrarySourceErrors(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
   void test_builtInIdentifierAsType_dynamic() {
     Source source = addSource(r'''
 f() {
@@ -804,6 +857,43 @@
     }
   }
 
+  void test_commentReference_beforeEnum() {
+    String code = r'''
+/// This is the [Samurai] kind.
+enum Samurai {
+  /// Use [int].
+  WITH_SWORD,
+  /// Like [WITH_SWORD], but only without one.
+  WITHOUT_SWORD
+}''';
+    Source source = addSource(code);
+    computeLibrarySourceErrors(source);
+    assertNoErrors(source);
+    verify([source]);
+    CompilationUnit unit = _getResolvedLibraryUnit(source);
+    {
+      SimpleIdentifier ref = EngineTestCase.findNode(
+          unit, code, "Samurai]", (node) => node is SimpleIdentifier);
+      ClassElement refElement = ref.staticElement;
+      expect(refElement, isNotNull);
+      expect(refElement.name, 'Samurai');
+    }
+    {
+      SimpleIdentifier ref = EngineTestCase.findNode(
+          unit, code, "int]", (node) => node is SimpleIdentifier);
+      ClassElement refElement = ref.staticElement;
+      expect(refElement, isNotNull);
+      expect(refElement.name, 'int');
+    }
+    {
+      SimpleIdentifier ref = EngineTestCase.findNode(
+          unit, code, "WITH_SWORD]", (node) => node is SimpleIdentifier);
+      PropertyAccessorElement refElement = ref.staticElement;
+      expect(refElement, isNotNull);
+      expect(refElement.name, 'WITH_SWORD');
+    }
+  }
+
   void test_commentReference_beforeFunction_blockBody() {
     String code = r'''
 /// [p]
@@ -1105,7 +1195,9 @@
   }
 
   void test_constEval_propertyExtraction_fieldStatic_targetType() {
-    addNamedSource("/math.dart", r'''
+    addNamedSource(
+        "/math.dart",
+        r'''
 library math;
 const PI = 3.14;''');
     Source source = addSource(r'''
@@ -1129,7 +1221,9 @@
   }
 
   void test_constEval_symbol() {
-    addNamedSource("/math.dart", r'''
+    addNamedSource(
+        "/math.dart",
+        r'''
 library math;
 const PI = 3.14;''');
     Source source = addSource(r'''
@@ -1336,7 +1430,9 @@
 library lib;
 import 'lib1.dart' hide B;
 A a = new A();''');
-    addNamedSource("/lib1.dart", r'''
+    addNamedSource(
+        "/lib1.dart",
+        r'''
 library lib1;
 class A {}
 @deprecated
@@ -1418,6 +1514,18 @@
     verify([source]);
   }
 
+  void test_exportDuplicatedLibraryUnnamed() {
+    Source source = addSource(r'''
+library test;
+export 'lib1.dart';
+export 'lib2.dart';''');
+    addNamedSource("/lib1.dart", "");
+    addNamedSource("/lib2.dart", "");
+    computeLibrarySourceErrors(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
   void test_exportOfNonLibrary_libraryDeclared() {
     Source source = addSource(r'''
 library L;
@@ -1748,6 +1856,30 @@
     verify([source]);
   }
 
+  void test_functionWithoutCall_withNoSuchMethod_mixin() {
+    Source source = addSource(r'''
+class A {
+  noSuchMethod(inv) {}
+}
+class B extends Object with A implements Function {
+}''');
+    computeLibrarySourceErrors(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  void test_functionWithoutCall_withNoSuchMethod_superclass() {
+    Source source = addSource(r'''
+class A {
+  noSuchMethod(inv) {}
+}
+class B extends A implements Function {
+}''');
+    computeLibrarySourceErrors(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
   void test_implicitConstructorDependencies() {
     // No warning should be generated for the code below; this requires that
     // implicit constructors are generated for C1 before C2, even though C1
@@ -1936,12 +2068,30 @@
     verify([source]);
   }
 
+  void test_importDuplicatedLibraryUnnamed() {
+    Source source = addSource(r'''
+library test;
+import 'lib1.dart';
+import 'lib2.dart';''');
+    addNamedSource("/lib1.dart", "");
+    addNamedSource("/lib2.dart", "");
+    computeLibrarySourceErrors(source);
+    assertErrors(source, [
+      // No warning on duplicate import (https://github.com/dart-lang/sdk/issues/24156)
+      HintCode.UNUSED_IMPORT,
+      HintCode.UNUSED_IMPORT
+    ]);
+    verify([source]);
+  }
+
   void test_importOfNonLibrary_libraryDeclared() {
     Source source = addSource(r'''
 library lib;
 import 'part.dart';
 A a;''');
-    addNamedSource("/part.dart", r'''
+    addNamedSource(
+        "/part.dart",
+        r'''
 library lib1;
 class A {}''');
     computeLibrarySourceErrors(source);
@@ -1969,10 +2119,14 @@
   math.test1();
   path.test2();
 }''');
-    addNamedSource("/lib1.dart", r'''
+    addNamedSource(
+        "/lib1.dart",
+        r'''
 library lib1;
 test1() {}''');
-    addNamedSource("/lib2.dart", r'''
+    addNamedSource(
+        "/lib2.dart",
+        r'''
 library lib2;
 test2() {}''');
     computeLibrarySourceErrors(source);
@@ -2214,7 +2368,9 @@
 class B extends A {
   _m() {}
 }''');
-    addNamedSource("/lib.dart", r'''
+    addNamedSource(
+        "/lib.dart",
+        r'''
 library L;
 class A {
   static var _m;
@@ -2230,7 +2386,9 @@
 class B extends A {
   _m() {}
 }''');
-    addNamedSource("/lib.dart", r'''
+    addNamedSource(
+        "/lib.dart",
+        r'''
 library L;
 class A {
   static _m() {}
@@ -2252,7 +2410,9 @@
   }
 
   void test_invalidAnnotation_constantVariable_field_importWithPrefix() {
-    addNamedSource("/lib.dart", r'''
+    addNamedSource(
+        "/lib.dart",
+        r'''
 library lib;
 class A {
   static const C = 0;
@@ -2279,7 +2439,9 @@
   }
 
   void test_invalidAnnotation_constantVariable_topLevel_importWithPrefix() {
-    addNamedSource("/lib.dart", r'''
+    addNamedSource(
+        "/lib.dart",
+        r'''
 library lib;
 const C = 0;''');
     Source source = addSource(r'''
@@ -2293,7 +2455,9 @@
   }
 
   void test_invalidAnnotation_constConstructor_importWithPrefix() {
-    addNamedSource("/lib.dart", r'''
+    addNamedSource(
+        "/lib.dart",
+        r'''
 library lib;
 class A {
   const A(int p);
@@ -2309,7 +2473,9 @@
   }
 
   void test_invalidAnnotation_constConstructor_named_importWithPrefix() {
-    addNamedSource("/lib.dart", r'''
+    addNamedSource(
+        "/lib.dart",
+        r'''
 library lib;
 class A {
   const A.named(int p);
@@ -2637,7 +2803,9 @@
   }
 
   void test_invalidOverrideReturnType_returnType_interface() {
-    Source source = addNamedSource("/test.dart", r'''
+    Source source = addNamedSource(
+        "/test.dart",
+        r'''
 abstract class A {
   num m();
 }
@@ -2650,7 +2818,9 @@
   }
 
   void test_invalidOverrideReturnType_returnType_interface2() {
-    Source source = addNamedSource("/test.dart", r'''
+    Source source = addNamedSource(
+        "/test.dart",
+        r'''
 abstract class A {
   num m();
 }
@@ -2665,7 +2835,9 @@
   }
 
   void test_invalidOverrideReturnType_returnType_mixin() {
-    Source source = addNamedSource("/test.dart", r'''
+    Source source = addNamedSource(
+        "/test.dart",
+        r'''
 class A {
   num m() { return 0; }
 }
@@ -2691,7 +2863,9 @@
   }
 
   void test_invalidOverrideReturnType_returnType_sameType() {
-    Source source = addNamedSource("/test.dart", r'''
+    Source source = addNamedSource(
+        "/test.dart",
+        r'''
 class A {
   int m() { return 0; }
 }
@@ -2704,7 +2878,9 @@
   }
 
   void test_invalidOverrideReturnType_returnType_superclass() {
-    Source source = addNamedSource("/test.dart", r'''
+    Source source = addNamedSource(
+        "/test.dart",
+        r'''
 class A {
   num m() { return 0; }
 }
@@ -2717,7 +2893,9 @@
   }
 
   void test_invalidOverrideReturnType_returnType_superclass2() {
-    Source source = addNamedSource("/test.dart", r'''
+    Source source = addNamedSource(
+        "/test.dart",
+        r'''
 class A {
   num m() { return 0; }
 }
@@ -3469,6 +3647,32 @@
     verify([source]);
   }
 
+  void test_nonAbstractClassInheritsAbstractMemberOne_noSuchMethod_mixin() {
+    Source source = addSource(r'''
+class A {
+  noSuchMethod(v) => '';
+}
+class B extends Object with A {
+  m(p);
+}''');
+    computeLibrarySourceErrors(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
+  void test_nonAbstractClassInheritsAbstractMemberOne_noSuchMethod_superclass() {
+    Source source = addSource(r'''
+class A {
+  noSuchMethod(v) => '';
+}
+class B extends A {
+  m(p);
+}''');
+    computeLibrarySourceErrors(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
   void test_nonAbstractClassInheritsAbstractMemberOne_overridesMethodInObject() {
     Source source = addSource(r'''
 class A {
@@ -4016,7 +4220,9 @@
   }
 
   void test_prefixCollidesWithTopLevelMembers() {
-    addNamedSource("/lib.dart", r'''
+    addNamedSource(
+        "/lib.dart",
+        r'''
 library lib;
 class A {}''');
     Source source = addSource(r'''
@@ -4965,7 +5171,9 @@
   }
 
   void test_typeType_class_prefixed() {
-    addNamedSource("/lib.dart", r'''
+    addNamedSource(
+        "/lib.dart",
+        r'''
 library lib;
 class C {}''');
     Source source = addSource(r'''
@@ -4992,7 +5200,9 @@
   }
 
   void test_typeType_functionTypeAlias_prefixed() {
-    addNamedSource("/lib.dart", r'''
+    addNamedSource(
+        "/lib.dart",
+        r'''
 library lib;
 typedef F();''');
     Source source = addSource(r'''
@@ -5212,7 +5422,9 @@
   }
 
   void test_undefinedSetter_importWithPrefix() {
-    addNamedSource("/lib.dart", r'''
+    addNamedSource(
+        "/lib.dart",
+        r'''
 library lib;
 set y(int value) {}''');
     Source source = addSource(r'''
diff --git a/pkg/analyzer/test/generated/parser_test.dart b/pkg/analyzer/test/generated/parser_test.dart
index b85a20e..51e4941 100644
--- a/pkg/analyzer/test/generated/parser_test.dart
+++ b/pkg/analyzer/test/generated/parser_test.dart
@@ -19,10 +19,11 @@
 import 'package:unittest/unittest.dart';
 
 import '../reflective_tests.dart';
+import '../utils.dart';
 import 'test_support.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   runReflectiveTests(ComplexParserTest);
   runReflectiveTests(ErrorParserTest);
   runReflectiveTests(IncrementalParserTest);
@@ -170,7 +171,8 @@
     // a(b)(c).d(e)
     //
     MethodInvocation invocation2 = EngineTestCase.assertInstanceOf(
-        (obj) => obj is MethodInvocation, MethodInvocation,
+        (obj) => obj is MethodInvocation,
+        MethodInvocation,
         propertyAccess1.target);
     expect(invocation2.methodName.name, "d");
     expect(invocation2.typeArguments, isNull);
@@ -182,7 +184,8 @@
     //
     FunctionExpressionInvocation invocation3 = EngineTestCase.assertInstanceOf(
         (obj) => obj is FunctionExpressionInvocation,
-        FunctionExpressionInvocation, invocation2.target);
+        FunctionExpressionInvocation,
+        invocation2.target);
     expect(invocation3.typeArguments, isNull);
     ArgumentList argumentList3 = invocation3.argumentList;
     expect(argumentList3, isNotNull);
@@ -191,7 +194,8 @@
     // a(b)
     //
     MethodInvocation invocation4 = EngineTestCase.assertInstanceOf(
-        (obj) => obj is MethodInvocation, MethodInvocation,
+        (obj) => obj is MethodInvocation,
+        MethodInvocation,
         invocation3.function);
     expect(invocation4.methodName.name, "a");
     expect(invocation4.typeArguments, isNull);
@@ -208,7 +212,8 @@
     // a<E>(b)<F>(c).d>G?(e)
     //
     MethodInvocation invocation2 = EngineTestCase.assertInstanceOf(
-        (obj) => obj is MethodInvocation, MethodInvocation,
+        (obj) => obj is MethodInvocation,
+        MethodInvocation,
         propertyAccess1.target);
     expect(invocation2.methodName.name, "d");
     expect(invocation2.typeArguments, isNotNull);
@@ -220,7 +225,8 @@
     //
     FunctionExpressionInvocation invocation3 = EngineTestCase.assertInstanceOf(
         (obj) => obj is FunctionExpressionInvocation,
-        FunctionExpressionInvocation, invocation2.target);
+        FunctionExpressionInvocation,
+        invocation2.target);
     expect(invocation3.typeArguments, isNotNull);
     ArgumentList argumentList3 = invocation3.argumentList;
     expect(argumentList3, isNotNull);
@@ -229,7 +235,8 @@
     // a(b)
     //
     MethodInvocation invocation4 = EngineTestCase.assertInstanceOf(
-        (obj) => obj is MethodInvocation, MethodInvocation,
+        (obj) => obj is MethodInvocation,
+        MethodInvocation,
         invocation3.function);
     expect(invocation4.methodName.name, "a");
     expect(invocation4.typeArguments, isNotNull);
@@ -551,32 +558,24 @@
 
   void fail_invalidCommentReference__new_nonIdentifier() {
     // This test fails because the method parseCommentReference returns null.
-    parse3("parseCommentReference", <Object>[
-      "new 42",
-      0
-    ], "", [ParserErrorCode.INVALID_COMMENT_REFERENCE]);
+    parse3("parseCommentReference", <Object>["new 42", 0], "",
+        [ParserErrorCode.INVALID_COMMENT_REFERENCE]);
   }
 
   void fail_invalidCommentReference__new_tooMuch() {
-    parse3("parseCommentReference", <Object>[
-      "new a.b.c.d",
-      0
-    ], "", [ParserErrorCode.INVALID_COMMENT_REFERENCE]);
+    parse3("parseCommentReference", <Object>["new a.b.c.d", 0], "",
+        [ParserErrorCode.INVALID_COMMENT_REFERENCE]);
   }
 
   void fail_invalidCommentReference__nonNew_nonIdentifier() {
     // This test fails because the method parseCommentReference returns null.
-    parse3("parseCommentReference", <Object>[
-      "42",
-      0
-    ], "", [ParserErrorCode.INVALID_COMMENT_REFERENCE]);
+    parse3("parseCommentReference", <Object>["42", 0], "",
+        [ParserErrorCode.INVALID_COMMENT_REFERENCE]);
   }
 
   void fail_invalidCommentReference__nonNew_tooMuch() {
-    parse3("parseCommentReference", <Object>[
-      "a.b.c.d",
-      0
-    ], "", [ParserErrorCode.INVALID_COMMENT_REFERENCE]);
+    parse3("parseCommentReference", <Object>["a.b.c.d", 0], "",
+        [ParserErrorCode.INVALID_COMMENT_REFERENCE]);
   }
 
   void fail_missingClosingParenthesis() {
@@ -757,11 +756,11 @@
   void test_classTypeAlias_abstractAfterEq() {
     // This syntax has been removed from the language in favor of
     // "abstract class A = B with C;" (issue 18098).
-    parse3("parseCompilationUnitMember", <Object>[emptyCommentAndMetadata()],
-        "class A = abstract B with C;", [
-      ParserErrorCode.EXPECTED_TOKEN,
-      ParserErrorCode.EXPECTED_TOKEN
-    ]);
+    parse3(
+        "parseCompilationUnitMember",
+        <Object>[emptyCommentAndMetadata()],
+        "class A = abstract B with C;",
+        [ParserErrorCode.EXPECTED_TOKEN, ParserErrorCode.EXPECTED_TOKEN]);
   }
 
   void test_colonInPlaceOfIn() {
@@ -918,7 +917,8 @@
   }
 
   void test_duplicateLabelInSwitchStatement() {
-    parse4("parseSwitchStatement",
+    parse4(
+        "parseSwitchStatement",
         "switch (e) {l1: case 0: break; l1: case 1: break;}",
         [ParserErrorCode.DUPLICATE_LABEL_IN_SWITCH_STATEMENT]);
   }
@@ -929,13 +929,15 @@
   }
 
   void test_enumInClass() {
-    ParserTestCase.parseCompilationUnit(r'''
+    ParserTestCase.parseCompilationUnit(
+        r'''
 class Foo {
   enum Bar {
     Bar1, Bar2, Bar3
   }
 }
-''', [ParserErrorCode.ENUM_IN_CLASS]);
+''',
+        [ParserErrorCode.ENUM_IN_CLASS]);
   }
 
   void test_equalityCannotBeEqualityOperand_eq_eq() {
@@ -989,7 +991,9 @@
   }
 
   void test_expectedExecutable_topLevel_eof() {
-    parse2("parseCompilationUnitMember", <Object>[emptyCommentAndMetadata()],
+    parse2(
+        "parseCompilationUnitMember",
+        <Object>[emptyCommentAndMetadata()],
         "x",
         [new AnalysisError(null, 0, 1, ParserErrorCode.EXPECTED_EXECUTABLE)]);
   }
@@ -1018,19 +1022,17 @@
   }
 
   void test_expectedToken_parseStatement_afterVoid() {
-    ParserTestCase.parseStatement("void}", [
-      ParserErrorCode.EXPECTED_TOKEN,
-      ParserErrorCode.MISSING_IDENTIFIER
-    ]);
+    ParserTestCase.parseStatement("void}",
+        [ParserErrorCode.EXPECTED_TOKEN, ParserErrorCode.MISSING_IDENTIFIER]);
   }
 
   void test_expectedToken_semicolonAfterClass() {
     Token token = TokenFactory.tokenFromKeyword(Keyword.CLASS);
-    parse3("parseClassTypeAlias", <Object>[
-      emptyCommentAndMetadata(),
-      null,
-      token
-    ], "A = B with C", [ParserErrorCode.EXPECTED_TOKEN]);
+    parse3(
+        "parseClassTypeAlias",
+        <Object>[emptyCommentAndMetadata(), null, token],
+        "A = B with C",
+        [ParserErrorCode.EXPECTED_TOKEN]);
   }
 
   void test_expectedToken_semicolonMissingAfterExport() {
@@ -1140,7 +1142,9 @@
   }
 
   void test_externalOperatorWithBody() {
-    parse3("parseClassMember", <Object>["C"],
+    parse3(
+        "parseClassMember",
+        <Object>["C"],
         "external operator +(int value) {}",
         [ParserErrorCode.EXTERNAL_OPERATOR_WITH_BODY]);
   }
@@ -1349,19 +1353,13 @@
   }
 
   void test_invalidStarAfterAsync() {
-    parse3("parseFunctionBody", <Object>[
-      false,
-      null,
-      false
-    ], "async* => 0;", [ParserErrorCode.INVALID_STAR_AFTER_ASYNC]);
+    parse3("parseFunctionBody", <Object>[false, null, false], "async* => 0;",
+        [ParserErrorCode.INVALID_STAR_AFTER_ASYNC]);
   }
 
   void test_invalidSync() {
-    parse3("parseFunctionBody", <Object>[
-      false,
-      null,
-      false
-    ], "sync* => 0;", [ParserErrorCode.INVALID_SYNC]);
+    parse3("parseFunctionBody", <Object>[false, null, false], "sync* => 0;",
+        [ParserErrorCode.INVALID_SYNC]);
   }
 
   void test_invalidUnicodeEscape_incomplete_noDigits() {
@@ -1491,19 +1489,19 @@
   }
 
   void test_missingFunctionBody_emptyNotAllowed() {
-    parse3("parseFunctionBody", <Object>[
-      false,
-      ParserErrorCode.MISSING_FUNCTION_BODY,
-      false
-    ], ";", [ParserErrorCode.MISSING_FUNCTION_BODY]);
+    parse3(
+        "parseFunctionBody",
+        <Object>[false, ParserErrorCode.MISSING_FUNCTION_BODY, false],
+        ";",
+        [ParserErrorCode.MISSING_FUNCTION_BODY]);
   }
 
   void test_missingFunctionBody_invalid() {
-    parse3("parseFunctionBody", <Object>[
-      false,
-      ParserErrorCode.MISSING_FUNCTION_BODY,
-      false
-    ], "return 0;", [ParserErrorCode.MISSING_FUNCTION_BODY]);
+    parse3(
+        "parseFunctionBody",
+        <Object>[false, ParserErrorCode.MISSING_FUNCTION_BODY, false],
+        "return 0;",
+        [ParserErrorCode.MISSING_FUNCTION_BODY]);
   }
 
   void test_missingFunctionParameters_local_void_block() {
@@ -1546,10 +1544,8 @@
   }
 
   void test_missingIdentifier_beforeClosingCurly() {
-    parse3("parseClassMember", <Object>["C"], "int}", [
-      ParserErrorCode.MISSING_IDENTIFIER,
-      ParserErrorCode.EXPECTED_TOKEN
-    ]);
+    parse3("parseClassMember", <Object>["C"], "int}",
+        [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.EXPECTED_TOKEN]);
   }
 
   void test_missingIdentifier_functionDeclaration_returnTypeWithoutName() {
@@ -1577,11 +1573,8 @@
   }
 
   void test_missingKeywordOperator() {
-    parse3("parseOperator", <Object>[
-      emptyCommentAndMetadata(),
-      null,
-      null
-    ], "+(x) {}", [ParserErrorCode.MISSING_KEYWORD_OPERATOR]);
+    parse3("parseOperator", <Object>[emptyCommentAndMetadata(), null, null],
+        "+(x) {}", [ParserErrorCode.MISSING_KEYWORD_OPERATOR]);
   }
 
   void test_missingKeywordOperator_parseClassMember() {
@@ -1628,11 +1621,8 @@
   }
 
   void test_missingStartAfterSync() {
-    parse3("parseFunctionBody", <Object>[
-      false,
-      null,
-      false
-    ], "sync {}", [ParserErrorCode.MISSING_STAR_AFTER_SYNC]);
+    parse3("parseFunctionBody", <Object>[false, null, false], "sync {}",
+        [ParserErrorCode.MISSING_STAR_AFTER_SYNC]);
   }
 
   void test_missingStatement() {
@@ -1850,13 +1840,17 @@
   }
 
   void test_staticOperator_noReturnType() {
-    parse3("parseClassMember", <Object>["C"],
+    parse3(
+        "parseClassMember",
+        <Object>["C"],
         "static operator +(int x) => x + 1;",
         [ParserErrorCode.STATIC_OPERATOR]);
   }
 
   void test_staticOperator_returnType() {
-    parse3("parseClassMember", <Object>["C"],
+    parse3(
+        "parseClassMember",
+        <Object>["C"],
         "static int operator +(int x) => x + 1;",
         [ParserErrorCode.STATIC_OPERATOR]);
   }
@@ -1887,7 +1881,8 @@
   }
 
   void test_switchHasCaseAfterDefaultCase() {
-    parse4("parseSwitchStatement",
+    parse4(
+        "parseSwitchStatement",
         "switch (a) {default: return 0; case 1: return 1;}",
         [ParserErrorCode.SWITCH_HAS_CASE_AFTER_DEFAULT_CASE]);
   }
@@ -1901,13 +1896,15 @@
   }
 
   void test_switchHasMultipleDefaultCases() {
-    parse4("parseSwitchStatement",
+    parse4(
+        "parseSwitchStatement",
         "switch (a) {default: return 0; default: return 1;}",
         [ParserErrorCode.SWITCH_HAS_MULTIPLE_DEFAULT_CASES]);
   }
 
   void test_switchHasMultipleDefaultCases_repeated() {
-    parse4("parseSwitchStatement",
+    parse4(
+        "parseSwitchStatement",
         "switch (a) {default: return 0; default: return 1; default: return 2;}",
         [
       ParserErrorCode.SWITCH_HAS_MULTIPLE_DEFAULT_CASES,
@@ -1922,19 +1919,25 @@
   }
 
   void test_topLevelOperator_withoutType() {
-    parse3("parseCompilationUnitMember", <Object>[emptyCommentAndMetadata()],
+    parse3(
+        "parseCompilationUnitMember",
+        <Object>[emptyCommentAndMetadata()],
         "operator +(bool x, bool y) => x | y;",
         [ParserErrorCode.TOP_LEVEL_OPERATOR]);
   }
 
   void test_topLevelOperator_withType() {
-    parse3("parseCompilationUnitMember", <Object>[emptyCommentAndMetadata()],
+    parse3(
+        "parseCompilationUnitMember",
+        <Object>[emptyCommentAndMetadata()],
         "bool operator +(bool x, bool y) => x | y;",
         [ParserErrorCode.TOP_LEVEL_OPERATOR]);
   }
 
   void test_topLevelOperator_withVoid() {
-    parse3("parseCompilationUnitMember", <Object>[emptyCommentAndMetadata()],
+    parse3(
+        "parseCompilationUnitMember",
+        <Object>[emptyCommentAndMetadata()],
         "void operator +(bool x, bool y) => x | y;",
         [ParserErrorCode.TOP_LEVEL_OPERATOR]);
   }
@@ -1978,10 +1981,8 @@
   }
 
   void test_unexpectedToken_semicolonBetweenClassMembers() {
-    parse3("parseClassDeclaration", <Object>[
-      emptyCommentAndMetadata(),
-      null
-    ], "class C { int x; ; int y;}", [ParserErrorCode.UNEXPECTED_TOKEN]);
+    parse3("parseClassDeclaration", <Object>[emptyCommentAndMetadata(), null],
+        "class C { int x; ; int y;}", [ParserErrorCode.UNEXPECTED_TOKEN]);
   }
 
   void test_unexpectedToken_semicolonBetweenCompilationUnitMembers() {
@@ -1993,9 +1994,11 @@
     // Although the "unterminated string" error message is produced by the
     // scanner, we need to verify that the parser can handle the tokens
     // produced by the scanner when an unterminated string is encountered.
-    ParserTestCase.parseCompilationUnit(r'''
+    ParserTestCase.parseCompilationUnit(
+        r'''
 void main() {
-  var x = "''', [
+  var x = "''',
+        [
       ScannerErrorCode.UNTERMINATED_STRING_LITERAL,
       ParserErrorCode.EXPECTED_TOKEN,
       ParserErrorCode.EXPECTED_TOKEN
@@ -2006,21 +2009,25 @@
     // Although the "unterminated string" error message is produced by the
     // scanner, we need to verify that the parser can handle the tokens
     // produced by the scanner when an unterminated string is encountered.
-    ParserTestCase.parseCompilationUnit(r'''
+    ParserTestCase.parseCompilationUnit(
+        r'''
 void main() {
   var x = "
 ;
 }
-''', [ScannerErrorCode.UNTERMINATED_STRING_LITERAL]);
+''',
+        [ScannerErrorCode.UNTERMINATED_STRING_LITERAL]);
   }
 
   void test_unterminatedString_multiline_at_eof_3_quotes() {
     // Although the "unterminated string" error message is produced by the
     // scanner, we need to verify that the parser can handle the tokens
     // produced by the scanner when an unterminated string is encountered.
-    ParserTestCase.parseCompilationUnit(r'''
+    ParserTestCase.parseCompilationUnit(
+        r'''
 void main() {
-  var x = """''', [
+  var x = """''',
+        [
       ScannerErrorCode.UNTERMINATED_STRING_LITERAL,
       ParserErrorCode.EXPECTED_TOKEN,
       ParserErrorCode.EXPECTED_TOKEN
@@ -2031,9 +2038,11 @@
     // Although the "unterminated string" error message is produced by the
     // scanner, we need to verify that the parser can handle the tokens
     // produced by the scanner when an unterminated string is encountered.
-    ParserTestCase.parseCompilationUnit(r'''
+    ParserTestCase.parseCompilationUnit(
+        r'''
 void main() {
-  var x = """"''', [
+  var x = """"''',
+        [
       ScannerErrorCode.UNTERMINATED_STRING_LITERAL,
       ParserErrorCode.EXPECTED_TOKEN,
       ParserErrorCode.EXPECTED_TOKEN
@@ -2044,9 +2053,11 @@
     // Although the "unterminated string" error message is produced by the
     // scanner, we need to verify that the parser can handle the tokens
     // produced by the scanner when an unterminated string is encountered.
-    ParserTestCase.parseCompilationUnit(r'''
+    ParserTestCase.parseCompilationUnit(
+        r'''
 void main() {
-  var x = """""''', [
+  var x = """""''',
+        [
       ScannerErrorCode.UNTERMINATED_STRING_LITERAL,
       ParserErrorCode.EXPECTED_TOKEN,
       ParserErrorCode.EXPECTED_TOKEN
@@ -2150,10 +2161,8 @@
   }
 
   void test_withWithoutExtends() {
-    parse3("parseClassDeclaration", <Object>[
-      emptyCommentAndMetadata(),
-      null
-    ], "class A with B, C {}", [ParserErrorCode.WITH_WITHOUT_EXTENDS]);
+    parse3("parseClassDeclaration", <Object>[emptyCommentAndMetadata(), null],
+        "class A with B, C {}", [ParserErrorCode.WITH_WITHOUT_EXTENDS]);
   }
 
   void test_wrongSeparatorForNamedParameter() {
@@ -2349,10 +2358,14 @@
   }
 
   void test_insert_statement_in_method_with_mismatched_braces() {
-    _assertParse('''
+    _assertParse(
+        '''
 class C {
   void f() {
-''', '', 'g();', '''
+''',
+        '',
+        'g();',
+        '''
     if (b) {
 
 
@@ -2533,9 +2546,12 @@
     expect(incrementalTokens, isNotNull);
     IncrementalParser incrementalParser = new IncrementalParser(
         source, incrementalScanner.tokenMap, incrementalListener);
-    CompilationUnit incrementalUnit = incrementalParser.reparse(originalUnit,
-        incrementalScanner.leftToken, incrementalScanner.rightToken,
-        replaceStart, prefix.length + removed.length);
+    CompilationUnit incrementalUnit = incrementalParser.reparse(
+        originalUnit,
+        incrementalScanner.leftToken,
+        incrementalScanner.rightToken,
+        replaceStart,
+        prefix.length + removed.length);
     expect(incrementalUnit, isNotNull);
     //
     // Validate that the results of the incremental parse are the same as the
@@ -3182,9 +3198,11 @@
   }
 
   void test_classTypeAlias_withBody() {
-    ParserTestCase.parseCompilationUnit(r'''
+    ParserTestCase.parseCompilationUnit(
+        r'''
 class A {}
-class B = Object with A {}''', [ParserErrorCode.EXPECTED_TOKEN]);
+class B = Object with A {}''',
+        [ParserErrorCode.EXPECTED_TOKEN]);
   }
 
   void test_conditionalExpression_missingElse() {
@@ -3203,6 +3221,17 @@
     expect(expression.thenExpression.isSynthetic, isTrue);
   }
 
+  void test_declarationBeforeDirective() {
+    CompilationUnit unit = ParserTestCase.parseCompilationUnit(
+        "class foo { } import 'bar.dart';",
+        [ParserErrorCode.DIRECTIVE_AFTER_DECLARATION]);
+    expect(unit.directives, hasLength(1));
+    expect(unit.declarations, hasLength(1));
+    ClassDeclaration classDecl = unit.childEntities.first;
+    expect(classDecl, isNotNull);
+    expect(classDecl.name.name, 'foo');
+  }
+
   void test_equalityExpression_missing_LHS() {
     BinaryExpression expression =
         parseExpression("== y", [ParserErrorCode.MISSING_IDENTIFIER]);
@@ -3302,10 +3331,8 @@
 
   void test_functionExpression_in_ConstructorFieldInitializer() {
     CompilationUnit unit = ParserTestCase.parseCompilationUnit(
-        "class A { A() : a = (){}; var v; }", [
-      ParserErrorCode.MISSING_IDENTIFIER,
-      ParserErrorCode.UNEXPECTED_TOKEN
-    ]);
+        "class A { A() : a = (){}; var v; }",
+        [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.UNEXPECTED_TOKEN]);
     // Make sure we recovered and parsed "var v" correctly
     ClassDeclaration declaration = unit.declarations[0] as ClassDeclaration;
     NodeList<ClassMember> members = declaration.members;
@@ -3350,10 +3377,8 @@
   }
 
   void test_incomplete_conditionalExpression() {
-    parseExpression("x ? 0", [
-      ParserErrorCode.EXPECTED_TOKEN,
-      ParserErrorCode.MISSING_IDENTIFIER
-    ]);
+    parseExpression("x ? 0",
+        [ParserErrorCode.EXPECTED_TOKEN, ParserErrorCode.MISSING_IDENTIFIER]);
   }
 
   void test_incomplete_constructorInitializers_empty() {
@@ -3402,10 +3427,8 @@
   }
 
   void test_incomplete_topLevelVariable_const() {
-    CompilationUnit unit = ParserTestCase.parseCompilationUnit("const ", [
-      ParserErrorCode.MISSING_IDENTIFIER,
-      ParserErrorCode.EXPECTED_TOKEN
-    ]);
+    CompilationUnit unit = ParserTestCase.parseCompilationUnit("const ",
+        [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.EXPECTED_TOKEN]);
     NodeList<CompilationUnitMember> declarations = unit.declarations;
     expect(declarations, hasLength(1));
     CompilationUnitMember member = declarations[0];
@@ -3419,10 +3442,8 @@
   }
 
   void test_incomplete_topLevelVariable_final() {
-    CompilationUnit unit = ParserTestCase.parseCompilationUnit("final ", [
-      ParserErrorCode.MISSING_IDENTIFIER,
-      ParserErrorCode.EXPECTED_TOKEN
-    ]);
+    CompilationUnit unit = ParserTestCase.parseCompilationUnit("final ",
+        [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.EXPECTED_TOKEN]);
     NodeList<CompilationUnitMember> declarations = unit.declarations;
     expect(declarations, hasLength(1));
     CompilationUnitMember member = declarations[0];
@@ -3436,10 +3457,8 @@
   }
 
   void test_incomplete_topLevelVariable_var() {
-    CompilationUnit unit = ParserTestCase.parseCompilationUnit("var ", [
-      ParserErrorCode.MISSING_IDENTIFIER,
-      ParserErrorCode.EXPECTED_TOKEN
-    ]);
+    CompilationUnit unit = ParserTestCase.parseCompilationUnit("var ",
+        [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.EXPECTED_TOKEN]);
     NodeList<CompilationUnitMember> declarations = unit.declarations;
     expect(declarations, hasLength(1));
     CompilationUnitMember member = declarations[0];
@@ -3453,10 +3472,12 @@
   }
 
   void test_incompleteField_const() {
-    CompilationUnit unit = ParserTestCase.parseCompilationUnit(r'''
+    CompilationUnit unit = ParserTestCase.parseCompilationUnit(
+        r'''
 class C {
   const
-}''', [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.EXPECTED_TOKEN]);
+}''',
+        [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.EXPECTED_TOKEN]);
     NodeList<CompilationUnitMember> declarations = unit.declarations;
     expect(declarations, hasLength(1));
     CompilationUnitMember unitMember = declarations[0];
@@ -3477,10 +3498,12 @@
   }
 
   void test_incompleteField_final() {
-    CompilationUnit unit = ParserTestCase.parseCompilationUnit(r'''
+    CompilationUnit unit = ParserTestCase.parseCompilationUnit(
+        r'''
 class C {
   final
-}''', [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.EXPECTED_TOKEN]);
+}''',
+        [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.EXPECTED_TOKEN]);
     NodeList<CompilationUnitMember> declarations = unit.declarations;
     expect(declarations, hasLength(1));
     CompilationUnitMember unitMember = declarations[0];
@@ -3501,10 +3524,12 @@
   }
 
   void test_incompleteField_var() {
-    CompilationUnit unit = ParserTestCase.parseCompilationUnit(r'''
+    CompilationUnit unit = ParserTestCase.parseCompilationUnit(
+        r'''
 class C {
   var
-}''', [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.EXPECTED_TOKEN]);
+}''',
+        [ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.EXPECTED_TOKEN]);
     NodeList<CompilationUnitMember> declarations = unit.declarations;
     expect(declarations, hasLength(1));
     CompilationUnitMember unitMember = declarations[0];
@@ -3524,6 +3549,53 @@
     expect(field.name.isSynthetic, isTrue);
   }
 
+  void test_incompleteForEach() {
+    ForStatement statement = ParserTestCase.parseStatement(
+        'for (String item i) {}',
+        [ParserErrorCode.EXPECTED_TOKEN, ParserErrorCode.EXPECTED_TOKEN]);
+    expect(statement, new isInstanceOf<ForStatement>());
+    expect(statement.toSource(), 'for (String item; i;) {}');
+    expect(statement.leftSeparator, isNotNull);
+    expect(statement.leftSeparator.type, TokenType.SEMICOLON);
+    expect(statement.rightSeparator, isNotNull);
+    expect(statement.rightSeparator.type, TokenType.SEMICOLON);
+  }
+
+  void test_incompleteLocalVariable_atTheEndOfBlock() {
+    Statement statement = ParserTestCase.parseStatement(
+        'String v }', [ParserErrorCode.EXPECTED_TOKEN]);
+    expect(statement, new isInstanceOf<VariableDeclarationStatement>());
+    expect(statement.toSource(), 'String v;');
+  }
+
+  void test_incompleteLocalVariable_beforeIdentifier() {
+    Statement statement = ParserTestCase.parseStatement(
+        'String v String v2;', [ParserErrorCode.EXPECTED_TOKEN]);
+    expect(statement, new isInstanceOf<VariableDeclarationStatement>());
+    expect(statement.toSource(), 'String v;');
+  }
+
+  void test_incompleteLocalVariable_beforeKeyword() {
+    Statement statement = ParserTestCase.parseStatement(
+        'String v if (true) {}', [ParserErrorCode.EXPECTED_TOKEN]);
+    expect(statement, new isInstanceOf<VariableDeclarationStatement>());
+    expect(statement.toSource(), 'String v;');
+  }
+
+  void test_incompleteLocalVariable_beforeNextBlock() {
+    Statement statement = ParserTestCase.parseStatement(
+        'String v {}', [ParserErrorCode.EXPECTED_TOKEN]);
+    expect(statement, new isInstanceOf<VariableDeclarationStatement>());
+    expect(statement.toSource(), 'String v;');
+  }
+
+  void test_incompleteLocalVariable_parameterizedType() {
+    Statement statement = ParserTestCase.parseStatement(
+        'List<String> v {}', [ParserErrorCode.EXPECTED_TOKEN]);
+    expect(statement, new isInstanceOf<VariableDeclarationStatement>());
+    expect(statement.toSource(), 'List<String> v;');
+  }
+
   void test_invalidFunctionBodyModifier() {
     ParserTestCase.parseCompilationUnit(
         "f() sync {}", [ParserErrorCode.MISSING_STAR_AFTER_SYNC]);
@@ -3662,11 +3734,13 @@
   }
 
   void test_missingGet() {
-    CompilationUnit unit = ParserTestCase.parseCompilationUnit(r'''
+    CompilationUnit unit = ParserTestCase.parseCompilationUnit(
+        r'''
 class C {
   int length {}
   void foo() {}
-}''', [ParserErrorCode.MISSING_GET]);
+}''',
+        [ParserErrorCode.MISSING_GET]);
     expect(unit, isNotNull);
     ClassDeclaration classDeclaration =
         unit.declarations[0] as ClassDeclaration;
@@ -3923,7 +3997,8 @@
 
   void test_visitAssignmentExpression() {
     AssignmentExpression fromNode = AstFactory.assignmentExpression(
-        AstFactory.identifier3("a"), TokenType.PLUS_EQ,
+        AstFactory.identifier3("a"),
+        TokenType.PLUS_EQ,
         AstFactory.identifier3("b"));
     DartType propagatedType = ElementFactory.classElement2("C").type;
     MethodElement propagatedElement =
@@ -3935,7 +4010,8 @@
     fromNode.staticElement = staticElement;
     fromNode.staticType = staticType;
     AssignmentExpression toNode = AstFactory.assignmentExpression(
-        AstFactory.identifier3("a"), TokenType.PLUS_EQ,
+        AstFactory.identifier3("a"),
+        TokenType.PLUS_EQ,
         AstFactory.identifier3("b"));
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.propagatedElement, same(propagatedElement));
@@ -3946,7 +4022,8 @@
 
   void test_visitBinaryExpression() {
     BinaryExpression fromNode = AstFactory.binaryExpression(
-        AstFactory.identifier3("a"), TokenType.PLUS,
+        AstFactory.identifier3("a"),
+        TokenType.PLUS,
         AstFactory.identifier3("b"));
     DartType propagatedType = ElementFactory.classElement2("C").type;
     MethodElement propagatedElement =
@@ -3958,7 +4035,8 @@
     fromNode.staticElement = staticElement;
     fromNode.staticType = staticType;
     BinaryExpression toNode = AstFactory.binaryExpression(
-        AstFactory.identifier3("a"), TokenType.PLUS,
+        AstFactory.identifier3("a"),
+        TokenType.PLUS,
         AstFactory.identifier3("b"));
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.propagatedElement, same(propagatedElement));
@@ -4005,14 +4083,16 @@
 
   void test_visitConditionalExpression() {
     ConditionalExpression fromNode = AstFactory.conditionalExpression(
-        AstFactory.identifier3("c"), AstFactory.identifier3("a"),
+        AstFactory.identifier3("c"),
+        AstFactory.identifier3("a"),
         AstFactory.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("c"),
+        AstFactory.identifier3("a"),
         AstFactory.identifier3("b"));
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.propagatedType, same(propagatedType));
@@ -4023,14 +4103,18 @@
     String className = "A";
     String constructorName = "c";
     ConstructorDeclaration fromNode = AstFactory.constructorDeclaration(
-        AstFactory.identifier3(className), constructorName,
-        AstFactory.formalParameterList(), null);
+        AstFactory.identifier3(className),
+        constructorName,
+        AstFactory.formalParameterList(),
+        null);
     ConstructorElement element = ElementFactory.constructorElement2(
         ElementFactory.classElement2(className), constructorName);
     fromNode.element = element;
     ConstructorDeclaration toNode = AstFactory.constructorDeclaration(
-        AstFactory.identifier3(className), constructorName,
-        AstFactory.formalParameterList(), null);
+        AstFactory.identifier3(className),
+        constructorName,
+        AstFactory.formalParameterList(),
+        null);
     ResolutionCopier.copyResolutionData(fromNode, toNode);
     expect(toNode.element, same(element));
   }
@@ -4549,7 +4633,8 @@
     CommentReference reference =
         parse("parseCommentReference", <Object>["this", 5], "");
     SimpleIdentifier identifier = EngineTestCase.assertInstanceOf(
-        (obj) => obj is SimpleIdentifier, SimpleIdentifier,
+        (obj) => obj is SimpleIdentifier,
+        SimpleIdentifier,
         reference.identifier);
     expect(identifier.token, isNotNull);
     expect(identifier.name, "a");
@@ -5159,10 +5244,8 @@
   }
 
   void test_parseAssignableSelector_none() {
-    SimpleIdentifier selector = parse("parseAssignableSelector", <Object>[
-      new SimpleIdentifier(null),
-      true
-    ], ";");
+    SimpleIdentifier selector = parse("parseAssignableSelector",
+        <Object>[new SimpleIdentifier(null), true], ";");
     expect(selector, isNotNull);
   }
 
@@ -5204,7 +5287,8 @@
     Statement statement = (body as BlockFunctionBody).block.statements[0];
     EngineTestCase.assertInstanceOf(
         (obj) => obj is VariableDeclarationStatement,
-        VariableDeclarationStatement, statement);
+        VariableDeclarationStatement,
+        statement);
   }
 
   void test_parseBitwiseAndExpression_normal() {
@@ -5463,10 +5547,13 @@
   }
 
   void test_parseClassDeclaration_abstract() {
-    ClassDeclaration declaration = parse("parseClassDeclaration", <Object>[
-      emptyCommentAndMetadata(),
-      TokenFactory.tokenFromKeyword(Keyword.ABSTRACT)
-    ], "class A {}");
+    ClassDeclaration declaration = parse(
+        "parseClassDeclaration",
+        <Object>[
+          emptyCommentAndMetadata(),
+          TokenFactory.tokenFromKeyword(Keyword.ABSTRACT)
+        ],
+        "class A {}");
     expect(declaration.documentationComment, isNull);
     expect(declaration.abstractKeyword, isNotNull);
     expect(declaration.extendsClause, isNull);
@@ -5480,10 +5567,8 @@
   }
 
   void test_parseClassDeclaration_empty() {
-    ClassDeclaration declaration = parse("parseClassDeclaration", <Object>[
-      emptyCommentAndMetadata(),
-      null
-    ], "class A {}");
+    ClassDeclaration declaration = parse("parseClassDeclaration",
+        <Object>[emptyCommentAndMetadata(), null], "class A {}");
     expect(declaration.documentationComment, isNull);
     expect(declaration.abstractKeyword, isNull);
     expect(declaration.extendsClause, isNull);
@@ -5497,10 +5582,8 @@
   }
 
   void test_parseClassDeclaration_extends() {
-    ClassDeclaration declaration = parse("parseClassDeclaration", <Object>[
-      emptyCommentAndMetadata(),
-      null
-    ], "class A extends B {}");
+    ClassDeclaration declaration = parse("parseClassDeclaration",
+        <Object>[emptyCommentAndMetadata(), null], "class A extends B {}");
     expect(declaration.documentationComment, isNull);
     expect(declaration.abstractKeyword, isNull);
     expect(declaration.extendsClause, isNotNull);
@@ -5514,10 +5597,10 @@
   }
 
   void test_parseClassDeclaration_extendsAndImplements() {
-    ClassDeclaration declaration = parse("parseClassDeclaration", <Object>[
-      emptyCommentAndMetadata(),
-      null
-    ], "class A extends B implements C {}");
+    ClassDeclaration declaration = parse(
+        "parseClassDeclaration",
+        <Object>[emptyCommentAndMetadata(), null],
+        "class A extends B implements C {}");
     expect(declaration.documentationComment, isNull);
     expect(declaration.abstractKeyword, isNull);
     expect(declaration.extendsClause, isNotNull);
@@ -5531,10 +5614,10 @@
   }
 
   void test_parseClassDeclaration_extendsAndWith() {
-    ClassDeclaration declaration = parse("parseClassDeclaration", <Object>[
-      emptyCommentAndMetadata(),
-      null
-    ], "class A extends B with C {}");
+    ClassDeclaration declaration = parse(
+        "parseClassDeclaration",
+        <Object>[emptyCommentAndMetadata(), null],
+        "class A extends B with C {}");
     expect(declaration.documentationComment, isNull);
     expect(declaration.abstractKeyword, isNull);
     expect(declaration.classKeyword, isNotNull);
@@ -5549,10 +5632,10 @@
   }
 
   void test_parseClassDeclaration_extendsAndWithAndImplements() {
-    ClassDeclaration declaration = parse("parseClassDeclaration", <Object>[
-      emptyCommentAndMetadata(),
-      null
-    ], "class A extends B with C implements D {}");
+    ClassDeclaration declaration = parse(
+        "parseClassDeclaration",
+        <Object>[emptyCommentAndMetadata(), null],
+        "class A extends B with C implements D {}");
     expect(declaration.documentationComment, isNull);
     expect(declaration.abstractKeyword, isNull);
     expect(declaration.classKeyword, isNotNull);
@@ -5567,10 +5650,8 @@
   }
 
   void test_parseClassDeclaration_implements() {
-    ClassDeclaration declaration = parse("parseClassDeclaration", <Object>[
-      emptyCommentAndMetadata(),
-      null
-    ], "class A implements C {}");
+    ClassDeclaration declaration = parse("parseClassDeclaration",
+        <Object>[emptyCommentAndMetadata(), null], "class A implements C {}");
     expect(declaration.documentationComment, isNull);
     expect(declaration.abstractKeyword, isNull);
     expect(declaration.extendsClause, isNull);
@@ -5584,10 +5665,10 @@
   }
 
   void test_parseClassDeclaration_native() {
-    ClassDeclaration declaration = parse("parseClassDeclaration", <Object>[
-      emptyCommentAndMetadata(),
-      null
-    ], "class A native 'nativeValue' {}");
+    ClassDeclaration declaration = parse(
+        "parseClassDeclaration",
+        <Object>[emptyCommentAndMetadata(), null],
+        "class A native 'nativeValue' {}");
     NativeClause nativeClause = declaration.nativeClause;
     expect(nativeClause, isNotNull);
     expect(nativeClause.nativeKeyword, isNotNull);
@@ -5597,10 +5678,8 @@
   }
 
   void test_parseClassDeclaration_nonEmpty() {
-    ClassDeclaration declaration = parse("parseClassDeclaration", <Object>[
-      emptyCommentAndMetadata(),
-      null
-    ], "class A {var f;}");
+    ClassDeclaration declaration = parse("parseClassDeclaration",
+        <Object>[emptyCommentAndMetadata(), null], "class A {var f;}");
     expect(declaration.documentationComment, isNull);
     expect(declaration.abstractKeyword, isNull);
     expect(declaration.extendsClause, isNull);
@@ -5614,10 +5693,10 @@
   }
 
   void test_parseClassDeclaration_typeAlias_implementsC() {
-    ClassTypeAlias typeAlias = parse("parseClassDeclaration", <Object>[
-      emptyCommentAndMetadata(),
-      null
-    ], "class A = Object with B implements C;");
+    ClassTypeAlias typeAlias = parse(
+        "parseClassDeclaration",
+        <Object>[emptyCommentAndMetadata(), null],
+        "class A = Object with B implements C;");
     expect(typeAlias.typedefKeyword, isNotNull);
     expect(typeAlias.name, isNotNull);
     expect(typeAlias.typeParameters, isNull);
@@ -5629,10 +5708,8 @@
   }
 
   void test_parseClassDeclaration_typeAlias_withB() {
-    ClassTypeAlias typeAlias = parse("parseClassDeclaration", <Object>[
-      emptyCommentAndMetadata(),
-      null
-    ], "class A = Object with B;");
+    ClassTypeAlias typeAlias = parse("parseClassDeclaration",
+        <Object>[emptyCommentAndMetadata(), null], "class A = Object with B;");
     expect(typeAlias.typedefKeyword, isNotNull);
     expect(typeAlias.name, isNotNull);
     expect(typeAlias.typeParameters, isNull);
@@ -5644,10 +5721,8 @@
   }
 
   void test_parseClassDeclaration_typeParameters() {
-    ClassDeclaration declaration = parse("parseClassDeclaration", <Object>[
-      emptyCommentAndMetadata(),
-      null
-    ], "class A<B> {}");
+    ClassDeclaration declaration = parse("parseClassDeclaration",
+        <Object>[emptyCommentAndMetadata(), null], "class A<B> {}");
     expect(declaration.documentationComment, isNull);
     expect(declaration.abstractKeyword, isNull);
     expect(declaration.extendsClause, isNull);
@@ -6055,11 +6130,10 @@
   void test_parseClassTypeAlias_abstract() {
     Token classToken = TokenFactory.tokenFromKeyword(Keyword.CLASS);
     Token abstractToken = TokenFactory.tokenFromKeyword(Keyword.ABSTRACT);
-    ClassTypeAlias classTypeAlias = parse("parseClassTypeAlias", <Object>[
-      emptyCommentAndMetadata(),
-      abstractToken,
-      classToken
-    ], "A = B with C;");
+    ClassTypeAlias classTypeAlias = parse(
+        "parseClassTypeAlias",
+        <Object>[emptyCommentAndMetadata(), abstractToken, classToken],
+        "A = B with C;");
     expect(classTypeAlias.typedefKeyword, isNotNull);
     expect(classTypeAlias.name.name, "A");
     expect(classTypeAlias.equals, isNotNull);
@@ -6072,11 +6146,10 @@
 
   void test_parseClassTypeAlias_implements() {
     Token token = TokenFactory.tokenFromKeyword(Keyword.CLASS);
-    ClassTypeAlias classTypeAlias = parse("parseClassTypeAlias", <Object>[
-      emptyCommentAndMetadata(),
-      null,
-      token
-    ], "A = B with C implements D;");
+    ClassTypeAlias classTypeAlias = parse(
+        "parseClassTypeAlias",
+        <Object>[emptyCommentAndMetadata(), null, token],
+        "A = B with C implements D;");
     expect(classTypeAlias.typedefKeyword, isNotNull);
     expect(classTypeAlias.name.name, "A");
     expect(classTypeAlias.equals, isNotNull);
@@ -6089,11 +6162,8 @@
 
   void test_parseClassTypeAlias_with() {
     Token token = TokenFactory.tokenFromKeyword(Keyword.CLASS);
-    ClassTypeAlias classTypeAlias = parse("parseClassTypeAlias", <Object>[
-      emptyCommentAndMetadata(),
-      null,
-      token
-    ], "A = B with C;");
+    ClassTypeAlias classTypeAlias = parse("parseClassTypeAlias",
+        <Object>[emptyCommentAndMetadata(), null, token], "A = B with C;");
     expect(classTypeAlias.typedefKeyword, isNotNull);
     expect(classTypeAlias.name.name, "A");
     expect(classTypeAlias.equals, isNotNull);
@@ -6106,11 +6176,10 @@
 
   void test_parseClassTypeAlias_with_implements() {
     Token token = TokenFactory.tokenFromKeyword(Keyword.CLASS);
-    ClassTypeAlias classTypeAlias = parse("parseClassTypeAlias", <Object>[
-      emptyCommentAndMetadata(),
-      null,
-      token
-    ], "A = B with C implements D;");
+    ClassTypeAlias classTypeAlias = parse(
+        "parseClassTypeAlias",
+        <Object>[emptyCommentAndMetadata(), null, token],
+        "A = B with C implements D;");
     expect(classTypeAlias.typedefKeyword, isNotNull);
     expect(classTypeAlias.name.name, "A");
     expect(classTypeAlias.equals, isNotNull);
@@ -6236,7 +6305,8 @@
   }
 
   void test_parseCommentAndMetadata_singleLine() {
-    CommentAndMetadata commentAndMetadata = parse4("parseCommentAndMetadata",
+    CommentAndMetadata commentAndMetadata = parse4(
+        "parseCommentAndMetadata",
         r'''
 /// 1
 /// 2
@@ -6249,7 +6319,8 @@
     CommentReference reference =
         parse("parseCommentReference", <Object>["new a.b", 7], "");
     PrefixedIdentifier prefixedIdentifier = EngineTestCase.assertInstanceOf(
-        (obj) => obj is PrefixedIdentifier, PrefixedIdentifier,
+        (obj) => obj is PrefixedIdentifier,
+        PrefixedIdentifier,
         reference.identifier);
     SimpleIdentifier prefix = prefixedIdentifier.prefix;
     expect(prefix.token, isNotNull);
@@ -6266,7 +6337,8 @@
     CommentReference reference =
         parse("parseCommentReference", <Object>["new a", 5], "");
     SimpleIdentifier identifier = EngineTestCase.assertInstanceOf(
-        (obj) => obj is SimpleIdentifier, SimpleIdentifier,
+        (obj) => obj is SimpleIdentifier,
+        SimpleIdentifier,
         reference.identifier);
     expect(identifier.token, isNotNull);
     expect(identifier.name, "a");
@@ -6277,7 +6349,8 @@
     CommentReference reference =
         parse("parseCommentReference", <Object>["a.b", 7], "");
     PrefixedIdentifier prefixedIdentifier = EngineTestCase.assertInstanceOf(
-        (obj) => obj is PrefixedIdentifier, PrefixedIdentifier,
+        (obj) => obj is PrefixedIdentifier,
+        PrefixedIdentifier,
         reference.identifier);
     SimpleIdentifier prefix = prefixedIdentifier.prefix;
     expect(prefix.token, isNotNull);
@@ -6294,7 +6367,8 @@
     CommentReference reference =
         parse("parseCommentReference", <Object>["a", 5], "");
     SimpleIdentifier identifier = EngineTestCase.assertInstanceOf(
-        (obj) => obj is SimpleIdentifier, SimpleIdentifier,
+        (obj) => obj is SimpleIdentifier,
+        SimpleIdentifier,
         reference.identifier);
     expect(identifier.token, isNotNull);
     expect(identifier.name, "a");
@@ -6305,7 +6379,8 @@
     CommentReference reference =
         parse("parseCommentReference", <Object>["", 5], "");
     SimpleIdentifier identifier = EngineTestCase.assertInstanceOf(
-        (obj) => obj is SimpleIdentifier, SimpleIdentifier,
+        (obj) => obj is SimpleIdentifier,
+        SimpleIdentifier,
         reference.identifier);
     expect(identifier, isNotNull);
     expect(identifier.isSynthetic, isTrue);
@@ -6572,7 +6647,8 @@
 
   void test_parseCompilationUnitMember_abstractAsPrefix() {
     TopLevelVariableDeclaration declaration = parse(
-        "parseCompilationUnitMember", <Object>[emptyCommentAndMetadata()],
+        "parseCompilationUnitMember",
+        <Object>[emptyCommentAndMetadata()],
         "abstract.A _abstract = new abstract.A();");
     expect(declaration.semicolon, isNotNull);
     expect(declaration.variables, isNotNull);
@@ -6594,7 +6670,8 @@
 
   void test_parseCompilationUnitMember_constVariable() {
     TopLevelVariableDeclaration declaration = parse(
-        "parseCompilationUnitMember", <Object>[emptyCommentAndMetadata()],
+        "parseCompilationUnitMember",
+        <Object>[emptyCommentAndMetadata()],
         "const int x = 0;");
     expect(declaration.semicolon, isNotNull);
     expect(declaration.variables, isNotNull);
@@ -6602,7 +6679,8 @@
 
   void test_parseCompilationUnitMember_finalVariable() {
     TopLevelVariableDeclaration declaration = parse(
-        "parseCompilationUnitMember", <Object>[emptyCommentAndMetadata()],
+        "parseCompilationUnitMember",
+        <Object>[emptyCommentAndMetadata()],
         "final x = 0;");
     expect(declaration.semicolon, isNotNull);
     expect(declaration.variables, isNotNull);
@@ -6720,7 +6798,8 @@
   }
 
   void test_parseCompilationUnitMember_typeAlias_generic() {
-    ClassTypeAlias typeAlias = parse("parseCompilationUnitMember",
+    ClassTypeAlias typeAlias = parse(
+        "parseCompilationUnitMember",
         <Object>[emptyCommentAndMetadata()],
         "class C<E> = S<E> with M<E> implements I<E>;");
     expect(typeAlias.typedefKeyword, isNotNull);
@@ -6735,7 +6814,8 @@
   }
 
   void test_parseCompilationUnitMember_typeAlias_implements() {
-    ClassTypeAlias typeAlias = parse("parseCompilationUnitMember",
+    ClassTypeAlias typeAlias = parse(
+        "parseCompilationUnitMember",
         <Object>[emptyCommentAndMetadata()],
         "class C = S with M implements I;");
     expect(typeAlias.typedefKeyword, isNotNull);
@@ -6772,7 +6852,8 @@
 
   void test_parseCompilationUnitMember_variable() {
     TopLevelVariableDeclaration declaration = parse(
-        "parseCompilationUnitMember", <Object>[emptyCommentAndMetadata()],
+        "parseCompilationUnitMember",
+        <Object>[emptyCommentAndMetadata()],
         "var x = 0;");
     expect(declaration.semicolon, isNotNull);
     expect(declaration.variables, isNotNull);
@@ -6780,7 +6861,8 @@
 
   void test_parseCompilationUnitMember_variableGet() {
     TopLevelVariableDeclaration declaration = parse(
-        "parseCompilationUnitMember", <Object>[emptyCommentAndMetadata()],
+        "parseCompilationUnitMember",
+        <Object>[emptyCommentAndMetadata()],
         "String get = null;");
     expect(declaration.semicolon, isNotNull);
     expect(declaration.variables, isNotNull);
@@ -6788,7 +6870,8 @@
 
   void test_parseCompilationUnitMember_variableSet() {
     TopLevelVariableDeclaration declaration = parse(
-        "parseCompilationUnitMember", <Object>[emptyCommentAndMetadata()],
+        "parseCompilationUnitMember",
+        <Object>[emptyCommentAndMetadata()],
         "String set = null;");
     expect(declaration.semicolon, isNotNull);
     expect(declaration.variables, isNotNull);
@@ -6871,7 +6954,8 @@
     ConstructorInitializer initializer = initializers[0];
     EngineTestCase.assertInstanceOf((obj) => obj is ConstructorFieldInitializer,
         ConstructorFieldInitializer, initializer);
-    EngineTestCase.assertInstanceOf((obj) => obj is ParenthesizedExpression,
+    EngineTestCase.assertInstanceOf(
+        (obj) => obj is ParenthesizedExpression,
         ParenthesizedExpression,
         (initializer as ConstructorFieldInitializer).expression);
     EngineTestCase.assertInstanceOf(
@@ -7125,7 +7209,8 @@
   }
 
   void test_parseExportDirective_hide() {
-    ExportDirective directive = parse("parseExportDirective",
+    ExportDirective directive = parse(
+        "parseExportDirective",
         <Object>[emptyCommentAndMetadata()],
         "export 'lib/lib.dart' hide A, B;");
     expect(directive.keyword, isNotNull);
@@ -7135,7 +7220,8 @@
   }
 
   void test_parseExportDirective_hide_show() {
-    ExportDirective directive = parse("parseExportDirective",
+    ExportDirective directive = parse(
+        "parseExportDirective",
         <Object>[emptyCommentAndMetadata()],
         "export 'lib/lib.dart' hide A show B;");
     expect(directive.keyword, isNotNull);
@@ -7154,7 +7240,8 @@
   }
 
   void test_parseExportDirective_show() {
-    ExportDirective directive = parse("parseExportDirective",
+    ExportDirective directive = parse(
+        "parseExportDirective",
         <Object>[emptyCommentAndMetadata()],
         "export 'lib/lib.dart' show A, B;");
     expect(directive.keyword, isNotNull);
@@ -7164,7 +7251,8 @@
   }
 
   void test_parseExportDirective_show_hide() {
-    ExportDirective directive = parse("parseExportDirective",
+    ExportDirective directive = parse(
+        "parseExportDirective",
         <Object>[emptyCommentAndMetadata()],
         "export 'lib/lib.dart' show B hide A;");
     expect(directive.keyword, isNotNull);
@@ -7647,8 +7735,8 @@
   }
 
   void test_parseFormalParameterList_prefixedType_partial() {
-    FormalParameterList parameterList = parse4("parseFormalParameterList",
-        "(io.)", [
+    FormalParameterList parameterList = parse4(
+        "parseFormalParameterList", "(io.)", [
       ParserErrorCode.MISSING_IDENTIFIER,
       ParserErrorCode.MISSING_IDENTIFIER
     ]);
@@ -7661,8 +7749,8 @@
   }
 
   void test_parseFormalParameterList_prefixedType_partial2() {
-    FormalParameterList parameterList = parse4("parseFormalParameterList",
-        "(io.,a)", [
+    FormalParameterList parameterList = parse4(
+        "parseFormalParameterList", "(io.,a)", [
       ParserErrorCode.MISSING_IDENTIFIER,
       ParserErrorCode.MISSING_IDENTIFIER
     ]);
@@ -8005,11 +8093,8 @@
 
   void test_parseFunctionBody_skip_block_invalid() {
     ParserTestCase.parseFunctionBodies = false;
-    FunctionBody functionBody = parse3("parseFunctionBody", <Object>[
-      false,
-      null,
-      false
-    ], "{", [ParserErrorCode.EXPECTED_TOKEN]);
+    FunctionBody functionBody = parse3("parseFunctionBody",
+        <Object>[false, null, false], "{", [ParserErrorCode.EXPECTED_TOKEN]);
     EngineTestCase.assertInstanceOf(
         (obj) => obj is EmptyFunctionBody, EmptyFunctionBody, functionBody);
   }
@@ -8130,12 +8215,10 @@
   void test_parseGetter_nonStatic() {
     Comment comment = Comment.createDocumentationComment(new List<Token>(0));
     TypeName returnType = new TypeName(new SimpleIdentifier(null), null);
-    MethodDeclaration method = parse("parseGetter", <Object>[
-      commentAndMetadata(comment),
-      null,
-      null,
-      returnType
-    ], "get a;");
+    MethodDeclaration method = parse(
+        "parseGetter",
+        <Object>[commentAndMetadata(comment), null, null, returnType],
+        "get a;");
     expect(method.body, isNotNull);
     expect(method.documentationComment, comment);
     expect(method.externalKeyword, isNull);
@@ -8151,12 +8234,10 @@
     Comment comment = Comment.createDocumentationComment(new List<Token>(0));
     Token staticKeyword = TokenFactory.tokenFromKeyword(Keyword.STATIC);
     TypeName returnType = new TypeName(new SimpleIdentifier(null), null);
-    MethodDeclaration method = parse("parseGetter", <Object>[
-      commentAndMetadata(comment),
-      null,
-      staticKeyword,
-      returnType
-    ], "get a => 42;");
+    MethodDeclaration method = parse(
+        "parseGetter",
+        <Object>[commentAndMetadata(comment), null, staticKeyword, returnType],
+        "get a => 42;");
     expect(method.body, isNotNull);
     expect(method.documentationComment, comment);
     expect(method.externalKeyword, isNull);
@@ -8238,7 +8319,8 @@
   }
 
   void test_parseImportDirective_deferred() {
-    ImportDirective directive = parse("parseImportDirective",
+    ImportDirective directive = parse(
+        "parseImportDirective",
         <Object>[emptyCommentAndMetadata()],
         "import 'lib/lib.dart' deferred as a;");
     expect(directive.keyword, isNotNull);
@@ -8251,7 +8333,8 @@
   }
 
   void test_parseImportDirective_hide() {
-    ImportDirective directive = parse("parseImportDirective",
+    ImportDirective directive = parse(
+        "parseImportDirective",
         <Object>[emptyCommentAndMetadata()],
         "import 'lib/lib.dart' hide A, B;");
     expect(directive.keyword, isNotNull);
@@ -8288,7 +8371,8 @@
   }
 
   void test_parseImportDirective_prefix_hide_show() {
-    ImportDirective directive = parse("parseImportDirective",
+    ImportDirective directive = parse(
+        "parseImportDirective",
         <Object>[emptyCommentAndMetadata()],
         "import 'lib/lib.dart' as a hide A show B;");
     expect(directive.keyword, isNotNull);
@@ -8301,7 +8385,8 @@
   }
 
   void test_parseImportDirective_prefix_show_hide() {
-    ImportDirective directive = parse("parseImportDirective",
+    ImportDirective directive = parse(
+        "parseImportDirective",
         <Object>[emptyCommentAndMetadata()],
         "import 'lib/lib.dart' as a show B hide A;");
     expect(directive.keyword, isNotNull);
@@ -8314,7 +8399,8 @@
   }
 
   void test_parseImportDirective_show() {
-    ImportDirective directive = parse("parseImportDirective",
+    ImportDirective directive = parse(
+        "parseImportDirective",
         <Object>[emptyCommentAndMetadata()],
         "import 'lib/lib.dart' show A, B;");
     expect(directive.keyword, isNotNull);
@@ -8330,13 +8416,10 @@
     Comment comment = Comment.createDocumentationComment(new List<Token>(0));
     Token staticKeyword = TokenFactory.tokenFromKeyword(Keyword.STATIC);
     TypeName type = new TypeName(new SimpleIdentifier(null), null);
-    FieldDeclaration declaration = parse("parseInitializedIdentifierList",
-        <Object>[
-      commentAndMetadata(comment),
-      staticKeyword,
-      null,
-      type
-    ], "a = 1, b, c = 3;");
+    FieldDeclaration declaration = parse(
+        "parseInitializedIdentifierList",
+        <Object>[commentAndMetadata(comment), staticKeyword, null, type],
+        "a = 1, b, c = 3;");
     expect(declaration.documentationComment, comment);
     VariableDeclarationList fields = declaration.fields;
     expect(fields, isNotNull);
@@ -8351,13 +8434,10 @@
     Comment comment = Comment.createDocumentationComment(new List<Token>(0));
     Token staticKeyword = TokenFactory.tokenFromKeyword(Keyword.STATIC);
     Token varKeyword = TokenFactory.tokenFromKeyword(Keyword.VAR);
-    FieldDeclaration declaration = parse("parseInitializedIdentifierList",
-        <Object>[
-      commentAndMetadata(comment),
-      staticKeyword,
-      varKeyword,
-      null
-    ], "a = 1, b, c = 3;");
+    FieldDeclaration declaration = parse(
+        "parseInitializedIdentifierList",
+        <Object>[commentAndMetadata(comment), staticKeyword, varKeyword, null],
+        "a = 1, b, c = 3;");
     expect(declaration.documentationComment, comment);
     VariableDeclarationList fields = declaration.fields;
     expect(fields, isNotNull);
@@ -8740,7 +8820,8 @@
         parse4("parseNonLabeledStatement", "(a) {return a + a;} (3);");
     EngineTestCase.assertInstanceOf(
         (obj) => obj is FunctionExpressionInvocation,
-        FunctionExpressionInvocation, statement.expression);
+        FunctionExpressionInvocation,
+        statement.expression);
     FunctionExpressionInvocation invocation =
         statement.expression as FunctionExpressionInvocation;
     EngineTestCase.assertInstanceOf((obj) => obj is FunctionExpression,
@@ -8969,11 +9050,10 @@
   void test_parseOperator() {
     Comment comment = Comment.createDocumentationComment(new List<Token>(0));
     TypeName returnType = new TypeName(new SimpleIdentifier(null), null);
-    MethodDeclaration method = parse("parseOperator", <Object>[
-      commentAndMetadata(comment),
-      null,
-      returnType
-    ], "operator +(A a);");
+    MethodDeclaration method = parse(
+        "parseOperator",
+        <Object>[commentAndMetadata(comment), null, returnType],
+        "operator +(A a);");
     expect(method.body, isNotNull);
     expect(method.documentationComment, comment);
     expect(method.externalKeyword, isNull);
@@ -9320,12 +9400,10 @@
   void test_parseSetter_nonStatic() {
     Comment comment = Comment.createDocumentationComment(new List<Token>(0));
     TypeName returnType = new TypeName(new SimpleIdentifier(null), null);
-    MethodDeclaration method = parse("parseSetter", <Object>[
-      commentAndMetadata(comment),
-      null,
-      null,
-      returnType
-    ], "set a(var x);");
+    MethodDeclaration method = parse(
+        "parseSetter",
+        <Object>[commentAndMetadata(comment), null, null, returnType],
+        "set a(var x);");
     expect(method.body, isNotNull);
     expect(method.documentationComment, comment);
     expect(method.externalKeyword, isNull);
@@ -9342,12 +9420,10 @@
     Comment comment = Comment.createDocumentationComment(new List<Token>(0));
     Token staticKeyword = TokenFactory.tokenFromKeyword(Keyword.STATIC);
     TypeName returnType = new TypeName(new SimpleIdentifier(null), null);
-    MethodDeclaration method = parse("parseSetter", <Object>[
-      commentAndMetadata(comment),
-      null,
-      staticKeyword,
-      returnType
-    ], "set a(var x) {}");
+    MethodDeclaration method = parse(
+        "parseSetter",
+        <Object>[commentAndMetadata(comment), null, staticKeyword, returnType],
+        "set a(var x) {}");
     expect(method.body, isNotNull);
     expect(method.documentationComment, comment);
     expect(method.externalKeyword, isNull);
@@ -9394,7 +9470,7 @@
     expect(identifier.name, lexeme);
   }
 
-  void test_parseStatement_emptyTypeArgumentListt() {
+  void test_parseStatement_emptyTypeArgumentList() {
     VariableDeclarationStatement statement = parse4(
         "parseStatement", "C<> c;", [ParserErrorCode.EXPECTED_TYPE_NAME]);
     VariableDeclarationList variables = statement.variables;
@@ -10237,7 +10313,8 @@
   void test_parseVariableDeclarationListAfterMetadata_const_noType() {
     VariableDeclarationList declarationList = parse(
         "parseVariableDeclarationListAfterMetadata",
-        <Object>[emptyCommentAndMetadata()], "const a");
+        <Object>[emptyCommentAndMetadata()],
+        "const a");
     expect(declarationList.keyword, isNotNull);
     expect(declarationList.type, isNull);
     expect(declarationList.variables, hasLength(1));
@@ -10246,7 +10323,8 @@
   void test_parseVariableDeclarationListAfterMetadata_const_type() {
     VariableDeclarationList declarationList = parse(
         "parseVariableDeclarationListAfterMetadata",
-        <Object>[emptyCommentAndMetadata()], "const A a");
+        <Object>[emptyCommentAndMetadata()],
+        "const A a");
     expect(declarationList.keyword, isNotNull);
     expect(declarationList.type, isNotNull);
     expect(declarationList.variables, hasLength(1));
@@ -10255,7 +10333,8 @@
   void test_parseVariableDeclarationListAfterMetadata_final_noType() {
     VariableDeclarationList declarationList = parse(
         "parseVariableDeclarationListAfterMetadata",
-        <Object>[emptyCommentAndMetadata()], "final a");
+        <Object>[emptyCommentAndMetadata()],
+        "final a");
     expect(declarationList.keyword, isNotNull);
     expect(declarationList.type, isNull);
     expect(declarationList.variables, hasLength(1));
@@ -10264,7 +10343,8 @@
   void test_parseVariableDeclarationListAfterMetadata_final_type() {
     VariableDeclarationList declarationList = parse(
         "parseVariableDeclarationListAfterMetadata",
-        <Object>[emptyCommentAndMetadata()], "final A a");
+        <Object>[emptyCommentAndMetadata()],
+        "final A a");
     expect(declarationList.keyword, isNotNull);
     expect(declarationList.type, isNotNull);
     expect(declarationList.variables, hasLength(1));
@@ -10273,7 +10353,8 @@
   void test_parseVariableDeclarationListAfterMetadata_type_multiple() {
     VariableDeclarationList declarationList = parse(
         "parseVariableDeclarationListAfterMetadata",
-        <Object>[emptyCommentAndMetadata()], "A a, b, c");
+        <Object>[emptyCommentAndMetadata()],
+        "A a, b, c");
     expect(declarationList.keyword, isNull);
     expect(declarationList.type, isNotNull);
     expect(declarationList.variables, hasLength(3));
@@ -10282,7 +10363,8 @@
   void test_parseVariableDeclarationListAfterMetadata_type_single() {
     VariableDeclarationList declarationList = parse(
         "parseVariableDeclarationListAfterMetadata",
-        <Object>[emptyCommentAndMetadata()], "A a");
+        <Object>[emptyCommentAndMetadata()],
+        "A a");
     expect(declarationList.keyword, isNull);
     expect(declarationList.type, isNotNull);
     expect(declarationList.variables, hasLength(1));
@@ -10291,7 +10373,8 @@
   void test_parseVariableDeclarationListAfterMetadata_var_multiple() {
     VariableDeclarationList declarationList = parse(
         "parseVariableDeclarationListAfterMetadata",
-        <Object>[emptyCommentAndMetadata()], "var a, b, c");
+        <Object>[emptyCommentAndMetadata()],
+        "var a, b, c");
     expect(declarationList.keyword, isNotNull);
     expect(declarationList.type, isNull);
     expect(declarationList.variables, hasLength(3));
@@ -10300,7 +10383,8 @@
   void test_parseVariableDeclarationListAfterMetadata_var_single() {
     VariableDeclarationList declarationList = parse(
         "parseVariableDeclarationListAfterMetadata",
-        <Object>[emptyCommentAndMetadata()], "var a");
+        <Object>[emptyCommentAndMetadata()],
+        "var a");
     expect(declarationList.keyword, isNotNull);
     expect(declarationList.type, isNull);
     expect(declarationList.variables, hasLength(1));
@@ -10309,11 +10393,9 @@
   void test_parseVariableDeclarationListAfterType_type() {
     TypeName type = new TypeName(new SimpleIdentifier(null), null);
     VariableDeclarationList declarationList = parse(
-        "parseVariableDeclarationListAfterType", <Object>[
-      emptyCommentAndMetadata(),
-      null,
-      type
-    ], "a");
+        "parseVariableDeclarationListAfterType",
+        <Object>[emptyCommentAndMetadata(), null, type],
+        "a");
     expect(declarationList.keyword, isNull);
     expect(declarationList.type, type);
     expect(declarationList.variables, hasLength(1));
@@ -10322,11 +10404,9 @@
   void test_parseVariableDeclarationListAfterType_var() {
     Token keyword = TokenFactory.tokenFromKeyword(Keyword.VAR);
     VariableDeclarationList declarationList = parse(
-        "parseVariableDeclarationListAfterType", <Object>[
-      emptyCommentAndMetadata(),
-      keyword,
-      null
-    ], "a, b, c");
+        "parseVariableDeclarationListAfterType",
+        <Object>[emptyCommentAndMetadata(), keyword, null],
+        "a, b, c");
     expect(declarationList.keyword, keyword);
     expect(declarationList.type, isNull);
     expect(declarationList.variables, hasLength(3));
@@ -10335,7 +10415,8 @@
   void test_parseVariableDeclarationStatementAfterMetadata_multiple() {
     VariableDeclarationStatement statement = parse(
         "parseVariableDeclarationStatementAfterMetadata",
-        <Object>[emptyCommentAndMetadata()], "var x, y, z;");
+        <Object>[emptyCommentAndMetadata()],
+        "var x, y, z;");
     expect(statement.semicolon, isNotNull);
     VariableDeclarationList variableList = statement.variables;
     expect(variableList, isNotNull);
@@ -10345,7 +10426,8 @@
   void test_parseVariableDeclarationStatementAfterMetadata_single() {
     VariableDeclarationStatement statement = parse(
         "parseVariableDeclarationStatementAfterMetadata",
-        <Object>[emptyCommentAndMetadata()], "var x;");
+        <Object>[emptyCommentAndMetadata()],
+        "var x;");
     expect(statement.semicolon, isNotNull);
     VariableDeclarationList variableList = statement.variables;
     expect(variableList, isNotNull);
@@ -10510,11 +10592,9 @@
     AnalysisErrorListener listener =
         new AnalysisErrorListener_SimpleParserTest_computeStringValue();
     Parser parser = new Parser(null, listener);
-    return invokeParserMethodImpl(parser, "computeStringValue", <Object>[
-      lexeme,
-      first,
-      last
-    ], null) as String;
+    return invokeParserMethodImpl(
+            parser, "computeStringValue", <Object>[lexeme, first, last], null)
+        as String;
   }
 
   /**
@@ -10553,8 +10633,8 @@
    */
   bool _isFunctionDeclaration(String source) {
     GatheringErrorListener listener = new GatheringErrorListener();
-    return invokeParserMethod2(
-        "isFunctionDeclaration", source, listener) as bool;
+    return invokeParserMethod2("isFunctionDeclaration", source, listener)
+        as bool;
   }
 
   /**
@@ -10577,8 +10657,9 @@
     // Parse the source.
     //
     Parser parser = new Parser(null, listener);
-    return invokeParserMethodImpl(parser, "isFunctionExpression",
-        <Object>[tokenStream], tokenStream) as bool;
+    return invokeParserMethodImpl(
+            parser, "isFunctionExpression", <Object>[tokenStream], tokenStream)
+        as bool;
   }
 
   /**
diff --git a/pkg/analyzer/test/generated/resolver_test.dart b/pkg/analyzer/test/generated/resolver_test.dart
index 5963b56..1339162 100644
--- a/pkg/analyzer/test/generated/resolver_test.dart
+++ b/pkg/analyzer/test/generated/resolver_test.dart
@@ -31,10 +31,11 @@
 import 'package:unittest/unittest.dart';
 
 import '../reflective_tests.dart';
+import '../utils.dart';
 import 'test_support.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   runReflectiveTests(AnalysisDeltaTest);
   runReflectiveTests(ChangeSetTest);
   runReflectiveTests(EnclosedScopeTest);
@@ -67,6 +68,8 @@
   runReflectiveTests(SimpleResolverTest);
   runReflectiveTests(StrictModeTest);
   runReflectiveTests(TypePropagationTest);
+  runReflectiveTests(StrongModeStaticTypeAnalyzer2Test);
+  runReflectiveTests(StrongModeTypePropagationTest);
 }
 
 /**
@@ -191,7 +194,6 @@
     // Future
     ClassElementImpl futureElement =
         ElementFactory.classElement2("Future", ["T"]);
-    InterfaceType futureType = futureElement.type;
     //   factory Future.value([value])
     ConstructorElementImpl futureConstructor =
         ElementFactory.constructorElement2(futureElement, "value");
@@ -216,8 +218,10 @@
     FunctionTypeImpl aliasType = new FunctionTypeImpl.forTypedef(aliasElement);
     aliasElement.shareTypeParameters(futureElement.typeParameters);
     aliasType.typeArguments = futureElement.type.typeArguments;
+    DartType futureDynamicType =
+        futureElement.type.substitute4([provider.dynamicType]);
     MethodElement thenMethod = ElementFactory.methodElementWithParameters(
-        "then", futureElement.type.typeArguments, futureType, [
+        "then", futureElement.type.typeArguments, futureDynamicType, [
       ElementFactory.requiredParameter2("onValue", aliasType),
       ElementFactory.namedParameter2("onError", provider.functionType)
     ]);
@@ -336,6 +340,11 @@
         ClassElement.EMPTY_LIST);
     TopLevelVariableElement ln10Element = ElementFactory
         .topLevelVariableElement3("LN10", true, false, provider.doubleType);
+    FunctionElement maxElement = ElementFactory.functionElement3(
+        "max",
+        provider.numType.element,
+        <ClassElement>[provider.numType.element, provider.numType.element],
+        ClassElement.EMPTY_LIST);
     TopLevelVariableElement piElement = ElementFactory.topLevelVariableElement3(
         "PI", true, false, provider.doubleType);
     ClassElementImpl randomElement = ElementFactory.classElement2("Random");
@@ -362,7 +371,12 @@
       ln10Element.getter,
       piElement.getter
     ];
-    mathUnit.functions = <FunctionElement>[cosElement, sinElement, sqrtElement];
+    mathUnit.functions = <FunctionElement>[
+      cosElement,
+      maxElement,
+      sinElement,
+      sqrtElement
+    ];
     mathUnit.topLevelVariables = <TopLevelVariableElement>[
       ln10Element,
       piElement
@@ -981,13 +995,13 @@
   final T x = y;
   const C();
 }
-const y = 1;
+const int y = 1;
 var v = const C<String>();
 ''');
     computeLibrarySourceErrors(source);
     assertErrors(source, [
       CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_FIELD_TYPE_MISMATCH,
-      HintCode.INVALID_ASSIGNMENT
+      StaticTypeWarningCode.INVALID_ASSIGNMENT
     ]);
     verify([source]);
   }
@@ -1013,11 +1027,11 @@
   final T x = y;
   const C();
 }
-const y = 1;
+const int y = 1;
 var v = const C<int>();
 ''');
     computeLibrarySourceErrors(source);
-    assertErrors(source, [HintCode.INVALID_ASSIGNMENT]);
+    assertErrors(source, [StaticTypeWarningCode.INVALID_ASSIGNMENT]);
     verify([source]);
   }
 
@@ -3093,6 +3107,9 @@
   }
 
   void test_isDouble() {
+    AnalysisOptionsImpl options = new AnalysisOptionsImpl();
+    options.dart2jsHint = true;
+    resetWithOptions(options);
     Source source = addSource("var v = 1 is double;");
     computeLibrarySourceErrors(source);
     assertErrors(source, [HintCode.IS_DOUBLE]);
@@ -3100,6 +3117,9 @@
   }
 
   void test_isNotDouble() {
+    AnalysisOptionsImpl options = new AnalysisOptionsImpl();
+    options.dart2jsHint = true;
+    resetWithOptions(options);
     Source source = addSource("var v = 1 is! double;");
     computeLibrarySourceErrors(source);
     assertErrors(source, [HintCode.IS_NOT_DOUBLE]);
@@ -5911,6 +5931,21 @@
     expect(unit.topLevelVariables, hasLength(0));
   }
 
+  void test_libraryElement_docRange() {
+    String code = r'''
+/// My dart doc.
+library lib;
+
+class A {}''';
+    Source librarySource = addSource("/lib.dart", code);
+    LibraryElement element = _buildLibrary(librarySource);
+    expect(element, isNotNull);
+    SourceRange docRange = element.docRange;
+    expect(docRange, isNotNull);
+    expect(docRange.offset, code.indexOf('/// My dart doc.'));
+    expect(docRange.length, '/// My dart doc.'.length);
+  }
+
   void test_missingLibraryDirectiveWithPart() {
     addSource("/a.dart", "part of lib;");
     Source librarySource = addSource("/lib.dart", "part 'a.dart';");
@@ -5969,6 +6004,7 @@
     Source librarySource = addSource(
         "/lib.dart",
         r'''
+/// My dart doc.
 library lib;
 
 class A {}''');
@@ -7886,6 +7922,13 @@
   TypeProvider get typeProvider => analysisContext2.typeProvider;
 
   /**
+   * Return a type system that can be used to test the results of resolution.
+   *
+   * @return a type system
+   */
+  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
@@ -7966,6 +8009,16 @@
   }
 
   /**
+   * Change the contents of the given [source] to the given [contents].
+   */
+  void changeSource(Source source, String contents) {
+    analysisContext2.setContents(source, contents);
+    ChangeSet changeSet = new ChangeSet();
+    changeSet.changedSource(source);
+    analysisContext2.applyChanges(changeSet);
+  }
+
+  /**
    * Computes errors for the given [librarySource].
    * This assumes that the given [librarySource] and its parts have already
    * been added to the content provider using the method [addNamedSource].
@@ -8164,6 +8217,45 @@
   }
 
   /**
+   * @param code the code that assigns the value to the variable "v", no matter how. We check that
+   *          "v" has expected static and propagated type.
+   */
+  void _assertPropagatedAssignedType(String code, DartType expectedStaticType,
+      DartType expectedPropagatedType) {
+    SimpleIdentifier identifier = _findMarkedIdentifier(code, "v = ");
+    expect(identifier.staticType, same(expectedStaticType));
+    expect(identifier.propagatedType, same(expectedPropagatedType));
+  }
+
+  /**
+   * @param code the code that iterates using variable "v". We check that
+   *          "v" has expected static and propagated type.
+   */
+  void _assertPropagatedIterationType(String code, DartType expectedStaticType,
+      DartType expectedPropagatedType) {
+    SimpleIdentifier identifier = _findMarkedIdentifier(code, "v in ");
+    expect(identifier.staticType, same(expectedStaticType));
+    expect(identifier.propagatedType, same(expectedPropagatedType));
+  }
+
+  /**
+   * Check the static and propagated types of the expression marked with "; // marker" comment.
+   *
+   * @param code source code to analyze, with the expression to check marked with "// marker".
+   * @param expectedStaticType if non-null, check actual static type is equal to this.
+   * @param expectedPropagatedType if non-null, check actual static type is equal to this.
+   * @throws Exception
+   */
+  void _assertTypeOfMarkedExpression(String code, DartType expectedStaticType,
+      DartType expectedPropagatedType) {
+    SimpleIdentifier identifier = _findMarkedIdentifier(code, "; // marker");
+    if (expectedStaticType != null) {
+      expect(identifier.staticType, expectedStaticType);
+    }
+    expect(identifier.propagatedType, expectedPropagatedType);
+  }
+
+  /**
    * Create a source object representing a file with the given [fileName] and
    * give it an empty content. Return the source that was created.
    */
@@ -8173,6 +8265,36 @@
     analysisContext2.setContents(source, "");
     return source;
   }
+
+  /**
+   * Return the `SimpleIdentifier` marked by `marker`. The source code must have no
+   * errors and be verifiable.
+   *
+   * @param code source code to analyze.
+   * @param marker marker identifying sought after expression in source code.
+   * @return expression marked by the marker.
+   * @throws Exception
+   */
+  SimpleIdentifier _findMarkedIdentifier(String code, String marker) {
+    try {
+      Source source = addSource(code);
+      LibraryElement library = resolve2(source);
+      assertNoErrors(source);
+      verify([source]);
+      CompilationUnit unit = resolveCompilationUnit(source, library);
+      // Could generalize this further by making [SimpleIdentifier.class] a
+      // parameter.
+      return EngineTestCase.findNode(
+          unit, code, marker, (node) => node is SimpleIdentifier);
+    } catch (exception) {
+      // Is there a better exception to throw here? The point is that an
+      // assertion failure here should be a failure, in both "test_*" and
+      // "fail_*" tests. However, an assertion failure is success for the
+      // purpose of "fail_*" tests, so without catching them here "fail_*" tests
+      // can succeed by failing for the wrong reason.
+      throw new JavaException("Unexexpected assertion failure: $exception");
+    }
+  }
 }
 
 class Scope_EnclosedScopeTest_test_define_duplicate extends Scope {
@@ -9117,18 +9239,18 @@
 
   void test_import_hide() {
     addNamedSource(
-        "lib1.dart",
+        "/lib1.dart",
         r'''
 library lib1;
 set foo(value) {}
 class A {}''');
     addNamedSource(
-        "lib2.dart",
+        "/lib2.dart",
         r'''
 library lib2;
 set foo(value) {}''');
     Source source = addNamedSource(
-        "lib3.dart",
+        "/lib3.dart",
         r'''
 import 'lib1.dart' hide foo;
 import 'lib2.dart';
@@ -9165,12 +9287,12 @@
 
   void test_import_spaceInUri() {
     addNamedSource(
-        "sub folder/lib.dart",
+        "/sub folder/lib.dart",
         r'''
 library lib;
 foo() {}''');
     Source source = addNamedSource(
-        "app.dart",
+        "/app.dart",
         r'''
 import 'sub folder/lib.dart';
 
@@ -9871,11 +9993,7 @@
  * Like [StaticTypeAnalyzerTest], but as end-to-end tests.
  */
 @reflectiveTest
-class StaticTypeAnalyzer2Test extends ResolverTestCase {
-  String testCode;
-  Source testSource;
-  CompilationUnit testUnit;
-
+class StaticTypeAnalyzer2Test extends _StaticTypeAnalyzer2TestShared {
   void test_FunctionExpressionInvocation_block() {
     String code = r'''
 main() {
@@ -9967,21 +10085,6 @@
       expect(type.name, 'Foo');
     }
   }
-
-  SimpleIdentifier _findIdentifier(String search) {
-    SimpleIdentifier identifier = EngineTestCase.findNode(
-        testUnit, testCode, search, (node) => node is SimpleIdentifier);
-    return identifier;
-  }
-
-  void _resolveTestUnit(String code) {
-    testCode = code;
-    testSource = addSource(testCode);
-    LibraryElement library = resolve2(testSource);
-    assertNoErrors(testSource);
-    verify([testSource]);
-    testUnit = resolveCompilationUnit(testSource, library);
-  }
 }
 
 @reflectiveTest
@@ -11792,6 +11895,430 @@
   }
 }
 
+/**
+ * Strong mode static analyzer end to end tests
+ */
+@reflectiveTest
+class StrongModeStaticTypeAnalyzer2Test extends _StaticTypeAnalyzer2TestShared {
+  void setUp() {
+    AnalysisOptionsImpl options = new AnalysisOptionsImpl();
+    options.strongMode = true;
+    resetWithOptions(options);
+  }
+
+  void test_dynamicObjectGetter_hashCode() {
+    String code = r'''
+main() {
+  dynamic a = null;
+  var foo = a.hashCode;
+}
+''';
+    _resolveTestUnit(code);
+
+    SimpleIdentifier identifier = _findIdentifier('foo');
+    VariableDeclaration declaration =
+        identifier.getAncestor((node) => node is VariableDeclaration);
+    expect(declaration.initializer.staticType.name, 'int');
+    expect(declaration.initializer.propagatedType, isNull);
+  }
+
+  void test_dynamicObjectMethod_toString() {
+    String code = r'''
+main() {
+  dynamic a = null;
+  var foo = a.toString();
+}
+''';
+    _resolveTestUnit(code);
+
+    SimpleIdentifier identifier = _findIdentifier('foo');
+    VariableDeclaration declaration =
+        identifier.getAncestor((node) => node is VariableDeclaration);
+    expect(declaration.initializer.staticType.name, 'String');
+    expect(declaration.initializer.propagatedType, isNull);
+  }
+
+  void test_pseudoGeneric_max_doubleDouble() {
+    String code = r'''
+import 'dart:math';
+main() {
+  var foo = max(1.0, 2.0);
+}
+''';
+    _resolveTestUnit(code);
+
+    SimpleIdentifier identifier = _findIdentifier('foo');
+    VariableDeclaration declaration =
+        identifier.getAncestor((node) => node is VariableDeclaration);
+    expect(declaration.initializer.staticType.name, 'double');
+    expect(declaration.initializer.propagatedType, isNull);
+  }
+
+  void test_pseudoGeneric_max_doubleInt() {
+    String code = r'''
+import 'dart:math';
+main() {
+  var foo = max(1.0, 2);
+}
+''';
+    _resolveTestUnit(code);
+
+    SimpleIdentifier identifier = _findIdentifier('foo');
+    VariableDeclaration declaration =
+        identifier.getAncestor((node) => node is VariableDeclaration);
+    expect(declaration.initializer.staticType.name, 'num');
+    expect(declaration.initializer.propagatedType, isNull);
+  }
+
+  void test_pseudoGeneric_max_intDouble() {
+    String code = r'''
+import 'dart:math';
+main() {
+  var foo = max(1, 2.0);
+}
+''';
+    _resolveTestUnit(code);
+
+    SimpleIdentifier identifier = _findIdentifier('foo');
+    VariableDeclaration declaration =
+        identifier.getAncestor((node) => node is VariableDeclaration);
+    expect(declaration.initializer.staticType.name, 'num');
+    expect(declaration.initializer.propagatedType, isNull);
+  }
+
+  void test_pseudoGeneric_max_intInt() {
+    String code = r'''
+import 'dart:math';
+main() {
+  var foo = max(1, 2);
+}
+''';
+    _resolveTestUnit(code);
+
+    SimpleIdentifier identifier = _findIdentifier('foo');
+    VariableDeclaration declaration =
+        identifier.getAncestor((node) => node is VariableDeclaration);
+    expect(declaration.initializer.staticType.name, 'int');
+    expect(declaration.initializer.propagatedType, isNull);
+  }
+
+  void test_pseudoGeneric_then() {
+    String code = r'''
+import 'dart:async';
+String toString(int x) => x.toString();
+main() {
+  Future<int> bar = null;
+  var foo = bar.then(toString);
+}
+''';
+    _resolveTestUnit(code);
+
+    SimpleIdentifier identifier = _findIdentifier('foo');
+    VariableDeclaration declaration =
+        identifier.getAncestor((node) => node is VariableDeclaration);
+
+    expect(declaration.initializer.staticType.toString(), "Future<String>");
+    expect(declaration.initializer.propagatedType, isNull);
+  }
+
+  void test_ternaryOperator_null_left() {
+    String code = r'''
+main() {
+  var foo = (true) ? null : 3;
+}
+''';
+    _resolveTestUnit(code);
+
+    SimpleIdentifier identifier = _findIdentifier('foo');
+    VariableDeclaration declaration =
+        identifier.getAncestor((node) => node is VariableDeclaration);
+    expect(declaration.initializer.staticType.name, 'int');
+    expect(declaration.initializer.propagatedType, isNull);
+  }
+
+  void test_ternaryOperator_null_right() {
+    String code = r'''
+main() {
+  var foo = (true) ? 3 : null;
+}
+''';
+    _resolveTestUnit(code);
+
+    SimpleIdentifier identifier = _findIdentifier('foo');
+    VariableDeclaration declaration =
+        identifier.getAncestor((node) => node is VariableDeclaration);
+    expect(declaration.initializer.staticType.name, 'int');
+    expect(declaration.initializer.propagatedType, isNull);
+  }
+}
+
+@reflectiveTest
+class StrongModeTypePropagationTest extends ResolverTestCase {
+  @override
+  void setUp() {
+    AnalysisOptionsImpl options = new AnalysisOptionsImpl();
+    options.strongMode = true;
+    resetWithOptions(options);
+  }
+
+  void test_foreachInference_dynamic_disabled() {
+    String code = r'''
+main() {
+  var list = <int>[];
+  for (dynamic v in list) {
+    v; // marker
+  }
+}''';
+    _assertPropagatedIterationType(
+        code, typeProvider.dynamicType, typeProvider.intType);
+    _assertTypeOfMarkedExpression(
+        code, typeProvider.dynamicType, typeProvider.intType);
+  }
+
+  void test_foreachInference_reusedVar_disabled() {
+    String code = r'''
+main() {
+  var list = <int>[];
+  var v;
+  for (v in list) {
+    v; // marker
+  }
+}''';
+    _assertPropagatedIterationType(
+        code, typeProvider.dynamicType, typeProvider.intType);
+    _assertTypeOfMarkedExpression(
+        code, typeProvider.dynamicType, typeProvider.intType);
+  }
+
+  void test_foreachInference_var() {
+    String code = r'''
+main() {
+  var list = <int>[];
+  for (var v in list) {
+    v; // marker
+  }
+}''';
+    _assertPropagatedIterationType(code, typeProvider.intType, null);
+    _assertTypeOfMarkedExpression(code, typeProvider.intType, null);
+  }
+
+  void test_foreachInference_var_iterable() {
+    String code = r'''
+main() {
+  Iterable<int> list = <int>[];
+  for (var v in list) {
+    v; // marker
+  }
+}''';
+    _assertPropagatedIterationType(code, typeProvider.intType, null);
+    _assertTypeOfMarkedExpression(code, typeProvider.intType, null);
+  }
+
+  void test_foreachInference_var_stream() {
+    String code = r'''
+import 'dart:async';
+main() async {
+  Stream<int> stream = null;
+  await for (var v in stream) {
+    v; // marker
+  }
+}''';
+    _assertPropagatedIterationType(code, typeProvider.intType, null);
+    _assertTypeOfMarkedExpression(code, typeProvider.intType, null);
+  }
+
+  void test_localVariableInference_bottom_disabled() {
+    String code = r'''
+main() {
+  var v = null;
+  v; // marker
+}''';
+    _assertPropagatedAssignedType(code, typeProvider.dynamicType, null);
+    _assertTypeOfMarkedExpression(code, typeProvider.dynamicType, null);
+  }
+
+  void test_localVariableInference_constant() {
+    String code = r'''
+main() {
+  var v = 3;
+  v; // marker
+}''';
+    _assertPropagatedAssignedType(code, typeProvider.intType, null);
+    _assertTypeOfMarkedExpression(code, typeProvider.intType, null);
+  }
+
+  void test_localVariableInference_declaredType_disabled() {
+    String code = r'''
+main() {
+  dynamic v = 3;
+  v; // marker
+}''';
+    _assertPropagatedAssignedType(
+        code, typeProvider.dynamicType, typeProvider.intType);
+    _assertTypeOfMarkedExpression(
+        code, typeProvider.dynamicType, typeProvider.intType);
+  }
+
+  void test_localVariableInference_noInitializer_disabled() {
+    String code = r'''
+main() {
+  var v;
+  v = 3;
+  v; // marker
+}''';
+    _assertPropagatedAssignedType(
+        code, typeProvider.dynamicType, typeProvider.intType);
+    _assertTypeOfMarkedExpression(
+        code, typeProvider.dynamicType, typeProvider.intType);
+  }
+
+  void test_localVariableInference_transitive_field_inferred_lexical() {
+    if (!AnalysisEngine.instance.useTaskModel) {
+      return;
+    }
+    String code = r'''
+class A {
+  final x = 3;
+  f() {
+    var v = x;
+    return v; // marker
+  }
+}
+main() {
+}
+''';
+    _assertPropagatedAssignedType(code, typeProvider.intType, null);
+    _assertTypeOfMarkedExpression(code, typeProvider.intType, null);
+  }
+
+  void test_localVariableInference_transitive_field_inferred_reversed() {
+    if (!AnalysisEngine.instance.useTaskModel) {
+      return;
+    }
+    String code = r'''
+class A {
+  f() {
+    var v = x;
+    return v; // marker
+  }
+  final x = 3;
+}
+main() {
+}
+''';
+    _assertPropagatedAssignedType(code, typeProvider.intType, null);
+    _assertTypeOfMarkedExpression(code, typeProvider.intType, null);
+  }
+
+  void test_localVariableInference_transitive_field_lexical() {
+    String code = r'''
+class A {
+  int x = 3;
+  f() {
+    var v = x;
+    return v; // marker
+  }
+}
+main() {
+}
+''';
+    _assertPropagatedAssignedType(code, typeProvider.intType, null);
+    _assertTypeOfMarkedExpression(code, typeProvider.intType, null);
+  }
+
+  void test_localVariableInference_transitive_field_reversed() {
+    String code = r'''
+class A {
+  f() {
+    var v = x;
+    return v; // marker
+  }
+  int x = 3;
+}
+main() {
+}
+''';
+    _assertPropagatedAssignedType(code, typeProvider.intType, null);
+    _assertTypeOfMarkedExpression(code, typeProvider.intType, null);
+  }
+
+  void test_localVariableInference_transitive_list_local() {
+    String code = r'''
+main() {
+  var x = <int>[3];
+  var v = x[0];
+  v; // marker
+}''';
+    _assertPropagatedAssignedType(code, typeProvider.intType, null);
+    _assertTypeOfMarkedExpression(code, typeProvider.intType, null);
+  }
+
+  void test_localVariableInference_transitive_local() {
+    String code = r'''
+main() {
+  var x = 3;
+  var v = x;
+  v; // marker
+}''';
+    _assertPropagatedAssignedType(code, typeProvider.intType, null);
+    _assertTypeOfMarkedExpression(code, typeProvider.intType, null);
+  }
+
+  void test_localVariableInference_transitive_toplevel_inferred_lexical() {
+    if (!AnalysisEngine.instance.useTaskModel) {
+      return;
+    }
+    String code = r'''
+final x = 3;
+main() {
+  var v = x;
+  v; // marker
+}
+''';
+    _assertPropagatedAssignedType(code, typeProvider.intType, null);
+    _assertTypeOfMarkedExpression(code, typeProvider.intType, null);
+  }
+
+  void test_localVariableInference_transitive_toplevel_inferred_reversed() {
+    if (!AnalysisEngine.instance.useTaskModel) {
+      return;
+    }
+    String code = r'''
+main() {
+  var v = x;
+  v; // marker
+}
+final x = 3;
+''';
+    _assertPropagatedAssignedType(code, typeProvider.intType, null);
+    _assertTypeOfMarkedExpression(code, typeProvider.intType, null);
+  }
+
+  void test_localVariableInference_transitive_toplevel_lexical() {
+    String code = r'''
+int x = 3;
+main() {
+  var v = x;
+  v; // marker
+}
+''';
+    _assertPropagatedAssignedType(code, typeProvider.intType, null);
+    _assertTypeOfMarkedExpression(code, typeProvider.intType, null);
+  }
+
+  void test_localVariableInference_transitive_toplevel_reversed() {
+    String code = r'''
+main() {
+  var v = x;
+  v; // marker
+}
+int x = 3;
+''';
+    _assertPropagatedAssignedType(code, typeProvider.intType, null);
+    _assertTypeOfMarkedExpression(code, typeProvider.intType, null);
+  }
+}
+
 @reflectiveTest
 class SubtypeManagerTest extends EngineTestCase {
   /**
@@ -12019,6 +12546,18 @@
         code, typeProvider.dynamicType, typeProvider.intType);
   }
 
+  void fail_finalPropertyInducingVariable_classMember_instance_unprefixed() {
+    String code = r'''
+class A {
+  final v = 0;
+  m() {
+    v; // marker
+  }
+}''';
+    _assertTypeOfMarkedExpression(
+        code, typeProvider.dynamicType, typeProvider.intType);
+  }
+
   void fail_finalPropertyInducingVariable_classMember_static() {
     addNamedSource(
         "/lib.dart",
@@ -12199,7 +12738,7 @@
 main() {
   var v = (() {return 42;})();
 }''';
-    _assertPropagatedReturnType(
+    _assertPropagatedAssignedType(
         code, typeProvider.dynamicType, typeProvider.intType);
   }
 
@@ -13313,6 +13852,99 @@
     assertNoErrors(source);
   }
 
+  void test_objectAccessInference_disabled_for_library_prefix() {
+    String name = 'hashCode';
+    addNamedSource(
+        '/helper.dart',
+        '''
+library helper;
+dynamic get $name => 42;
+''');
+    String code = '''
+import 'helper.dart' as helper;
+main() {
+  helper.$name; // marker
+}''';
+
+    SimpleIdentifier id = _findMarkedIdentifier(code, "; // marker");
+    PrefixedIdentifier prefixedId = id.parent;
+    expect(id.staticType, typeProvider.dynamicType);
+    expect(prefixedId.staticType, typeProvider.dynamicType);
+  }
+
+  void test_objectAccessInference_disabled_for_local_getter() {
+    String name = 'hashCode';
+    String code = '''
+dynamic get $name => null;
+main() {
+  $name; // marker
+}''';
+
+    SimpleIdentifier getter = _findMarkedIdentifier(code, "; // marker");
+    expect(getter.staticType, typeProvider.dynamicType);
+  }
+
+  void test_objectAccessInference_enabled_for_cascades() {
+    String name = 'hashCode';
+    String code = '''
+main() {
+  dynamic obj;
+  obj..$name..$name; // marker
+}''';
+    PropertyAccess access = _findMarkedIdentifier(code, "; // marker").parent;
+    expect(access.staticType, typeProvider.dynamicType);
+    expect(access.realTarget.staticType, typeProvider.dynamicType);
+  }
+
+  void test_objectMethodInference_disabled_for_library_prefix() {
+    String name = 'toString';
+    addNamedSource(
+        '/helper.dart',
+        '''
+library helper;
+dynamic $name = (int x) => x + 42');
+''');
+    String code = '''
+import 'helper.dart' as helper;
+main() {
+  helper.$name(); // marker
+}''';
+    SimpleIdentifier methodName = _findMarkedIdentifier(code, "(); // marker");
+    MethodInvocation methodInvoke = methodName.parent;
+    expect(methodName.staticType, null, reason: 'library prefix has no type');
+    expect(methodInvoke.staticType, typeProvider.dynamicType);
+  }
+
+  void test_objectMethodInference_disabled_for_local_function() {
+    String name = 'toString';
+    String code = '''
+main() {
+  dynamic $name = () => null;
+  $name(); // marker
+}''';
+    SimpleIdentifier identifier = _findMarkedIdentifier(code, "$name = ");
+    expect(identifier.staticType, typeProvider.dynamicType);
+
+    SimpleIdentifier methodName = _findMarkedIdentifier(code, "(); // marker");
+    MethodInvocation methodInvoke = methodName.parent;
+    expect(methodName.staticType, typeProvider.dynamicType);
+    expect(methodInvoke.staticType, typeProvider.dynamicType);
+  }
+
+  void test_objectMethodInference_enabled_for_cascades() {
+    String name = 'toString';
+    String code = '''
+main() {
+  dynamic obj;
+  obj..$name()..$name(); // marker
+}''';
+    SimpleIdentifier methodName = _findMarkedIdentifier(code, "(); // marker");
+    MethodInvocation methodInvoke = methodName.parent;
+
+    expect(methodInvoke.staticType, typeProvider.dynamicType);
+    expect(methodInvoke.realTarget.staticType, typeProvider.dynamicType);
+  }
+
   void test_objectMethodOnDynamicExpression_doubleEquals() {
     // https://code.google.com/p/dart/issues/detail?id=20342
     //
@@ -13366,79 +13998,13 @@
         typeProvider.stringType);
   }
 
-  void test_propagatedReturnType_function_hasReturnType_returnsNull() {
-    String code = r'''
-String f() => null;
-main() {
-  var v = f();
-}''';
-    _assertPropagatedReturnType(
-        code, typeProvider.dynamicType, typeProvider.stringType);
-  }
-
-  void test_propagatedReturnType_function_lessSpecificStaticReturnType() {
-    String code = r'''
-Object f() => 42;
-main() {
-  var v = f();
-}''';
-    _assertPropagatedReturnType(
-        code, typeProvider.dynamicType, typeProvider.intType);
-  }
-
-  void test_propagatedReturnType_function_moreSpecificStaticReturnType() {
-    String code = r'''
-int f(v) => (v as num);
-main() {
-  var v = f(3);
-}''';
-    _assertPropagatedReturnType(
-        code, typeProvider.dynamicType, typeProvider.intType);
-  }
-
-  void test_propagatedReturnType_function_noReturnTypeName_blockBody_multipleReturns() {
-    String code = r'''
-f() {
-  if (true) return 0;
-  return 1.0;
-}
-main() {
-  var v = f();
-}''';
-    _assertPropagatedReturnType(
-        code, typeProvider.dynamicType, typeProvider.numType);
-  }
-
-  void test_propagatedReturnType_function_noReturnTypeName_blockBody_oneReturn() {
-    String code = r'''
-f() {
-  var z = 42;
-  return z;
-}
-main() {
-  var v = f();
-}''';
-    _assertPropagatedReturnType(
-        code, typeProvider.dynamicType, typeProvider.intType);
-  }
-
-  void test_propagatedReturnType_function_noReturnTypeName_expressionBody() {
-    String code = r'''
-f() => 42;
-main() {
-  var v = f();
-}''';
-    _assertPropagatedReturnType(
-        code, typeProvider.dynamicType, typeProvider.intType);
-  }
-
   void test_propagatedReturnType_localFunction() {
     String code = r'''
 main() {
   f() => 42;
   var v = f();
 }''';
-    _assertPropagatedReturnType(
+    _assertPropagatedAssignedType(
         code, typeProvider.dynamicType, typeProvider.intType);
   }
 
@@ -13483,64 +14049,6 @@
     expect(elements[9].propagatedType.name, "Element");
     expect(elements[10].propagatedType.name, "Element");
   }
-
-  /**
-   * @param code the code that assigns the value to the variable "v", no matter how. We check that
-   *          "v" has expected static and propagated type.
-   */
-  void _assertPropagatedReturnType(String code, DartType expectedStaticType,
-      DartType expectedPropagatedType) {
-    SimpleIdentifier identifier = _findMarkedIdentifier(code, "v = ");
-    expect(identifier.staticType, same(expectedStaticType));
-    expect(identifier.propagatedType, same(expectedPropagatedType));
-  }
-
-  /**
-   * Check the static and propagated types of the expression marked with "; // marker" comment.
-   *
-   * @param code source code to analyze, with the expression to check marked with "// marker".
-   * @param expectedStaticType if non-null, check actual static type is equal to this.
-   * @param expectedPropagatedType if non-null, check actual static type is equal to this.
-   * @throws Exception
-   */
-  void _assertTypeOfMarkedExpression(String code, DartType expectedStaticType,
-      DartType expectedPropagatedType) {
-    SimpleIdentifier identifier = _findMarkedIdentifier(code, "; // marker");
-    if (expectedStaticType != null) {
-      expect(identifier.staticType, expectedStaticType);
-    }
-    expect(identifier.propagatedType, expectedPropagatedType);
-  }
-
-  /**
-   * Return the `SimpleIdentifier` marked by `marker`. The source code must have no
-   * errors and be verifiable.
-   *
-   * @param code source code to analyze.
-   * @param marker marker identifying sought after expression in source code.
-   * @return expression marked by the marker.
-   * @throws Exception
-   */
-  SimpleIdentifier _findMarkedIdentifier(String code, String marker) {
-    try {
-      Source source = addSource(code);
-      LibraryElement library = resolve2(source);
-      assertNoErrors(source);
-      verify([source]);
-      CompilationUnit unit = resolveCompilationUnit(source, library);
-      // Could generalize this further by making [SimpleIdentifier.class] a
-      // parameter.
-      return EngineTestCase.findNode(
-          unit, code, marker, (node) => node is SimpleIdentifier);
-    } catch (exception) {
-      // Is there a better exception to throw here? The point is that an
-      // assertion failure here should be a failure, in both "test_*" and
-      // "fail_*" tests. However, an assertion failure is success for the
-      // purpose of "fail_*" tests, so without catching them here "fail_*" tests
-      // can succeed by failing for the wrong reason.
-      throw new JavaException("Unexexpected assertion failure: $exception");
-    }
-  }
 }
 
 @reflectiveTest
@@ -14327,3 +14835,28 @@
     return null;
   }
 }
+
+/**
+ * Shared infrastructure for [StaticTypeAnalyzer2Test] and
+ * [StrongModeStaticTypeAnalyzer2Test].
+ */
+class _StaticTypeAnalyzer2TestShared extends ResolverTestCase {
+  String testCode;
+  Source testSource;
+  CompilationUnit testUnit;
+
+  SimpleIdentifier _findIdentifier(String search) {
+    SimpleIdentifier identifier = EngineTestCase.findNode(
+        testUnit, testCode, search, (node) => node is SimpleIdentifier);
+    return identifier;
+  }
+
+  void _resolveTestUnit(String code) {
+    testCode = code;
+    testSource = addSource(testCode);
+    LibraryElement library = resolve2(testSource);
+    assertNoErrors(testSource);
+    verify([testSource]);
+    testUnit = resolveCompilationUnit(testSource, library);
+  }
+}
diff --git a/pkg/analyzer/test/generated/scanner_test.dart b/pkg/analyzer/test/generated/scanner_test.dart
index 296be46..119d4aa 100644
--- a/pkg/analyzer/test/generated/scanner_test.dart
+++ b/pkg/analyzer/test/generated/scanner_test.dart
@@ -10,10 +10,11 @@
 import 'package:unittest/unittest.dart';
 
 import '../reflective_tests.dart';
+import '../utils.dart';
 import 'test_support.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   runReflectiveTests(CharSequenceReaderTest);
   runReflectiveTests(KeywordStateTest);
   runReflectiveTests(ScannerTest);
@@ -172,8 +173,8 @@
 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", [
+    _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)
@@ -253,7 +254,8 @@
   }
 
   void test_comment_disabled_multi() {
-    Scanner scanner = new Scanner(null,
+    Scanner scanner = new Scanner(
+        null,
         new CharSequenceReader("/* comment */ "),
         AnalysisErrorListener.NULL_LISTENER);
     scanner.preserveComments = false;
@@ -276,13 +278,15 @@
     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(' */')
-    ]));
+    expect(
+        scanner.lineStarts,
+        equals(<int>[
+          code.indexOf('/**'),
+          code.indexOf(' * aa'),
+          code.indexOf(' * bbb'),
+          code.indexOf(' * c'),
+          code.indexOf(' */')
+        ]));
   }
 
   void test_comment_multi_unterminated() {
@@ -851,8 +855,8 @@
   }
 
   void test_string_multi_unterminated_interpolation_block() {
-    _assertErrorAndTokens(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, 8,
-        "'''\${name", [
+    _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),
@@ -861,8 +865,8 @@
   }
 
   void test_string_multi_unterminated_interpolation_identifier() {
-    _assertErrorAndTokens(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, 7,
-        "'''\$name", [
+    _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),
@@ -1008,8 +1012,8 @@
   }
 
   void test_string_simple_unterminated_interpolation_block() {
-    _assertErrorAndTokens(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, 6,
-        "'\${name", [
+    _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),
@@ -1018,8 +1022,8 @@
   }
 
   void test_string_simple_unterminated_interpolation_identifier() {
-    _assertErrorAndTokens(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, 5,
-        "'\$name", [
+    _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),
diff --git a/pkg/analyzer/test/generated/source_factory_test.dart b/pkg/analyzer/test/generated/source_factory_test.dart
index b3788b4..c16f1f8 100644
--- a/pkg/analyzer/test/generated/source_factory_test.dart
+++ b/pkg/analyzer/test/generated/source_factory_test.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.
 
-// This code was auto-generated, is not intended to be edited, and is subject to
-// significant change. Please see the README file for more information.
-
 library analyzer.test.generated.source_factory;
 
 import 'dart:convert';
@@ -25,10 +22,11 @@
 import 'package:unittest/unittest.dart';
 
 import '../reflective_tests.dart';
+import '../utils.dart';
 import 'test_support.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   runReflectiveTests(SourceFactoryTest);
   runPackageMapTests();
 }
@@ -55,7 +53,10 @@
     return factory.packageMap;
   }
 
-  String resolvePackageUri({String uri, String config, Source containingSource,
+  String resolvePackageUri(
+      {String uri,
+      String config,
+      Source containingSource,
       UriResolver customResolver}) {
     Packages packages = createPackageMap(baseUri, config);
     List<UriResolver> resolvers = testResolvers.toList();
@@ -82,22 +83,30 @@
     group('package mapping', () {
       group('resolveUri', () {
         test('URI in mapping', () {
-          String uri = resolvePackageUri(config: '''
+          String uri = resolvePackageUri(
+              config: '''
 unittest:file:///home/somebody/.pub/cache/unittest-0.9.9/lib/
 async:file:///home/somebody/.pub/cache/async-1.1.0/lib/
 quiver:file:///home/somebody/.pub/cache/quiver-1.2.1/lib
-''', uri: 'package:unittest/unittest.dart');
-          expect(uri, equals(
-              '/home/somebody/.pub/cache/unittest-0.9.9/lib/unittest.dart'));
+''',
+              uri: 'package:unittest/unittest.dart');
+          expect(
+              uri,
+              equals(
+                  '/home/somebody/.pub/cache/unittest-0.9.9/lib/unittest.dart'));
         });
         test('URI in mapping (no scheme)', () {
-          String uri = resolvePackageUri(config: '''
+          String uri = resolvePackageUri(
+              config: '''
 unittest:/home/somebody/.pub/cache/unittest-0.9.9/lib/
 async:/home/somebody/.pub/cache/async-1.1.0/lib/
 quiver:/home/somebody/.pub/cache/quiver-1.2.1/lib
-''', uri: 'package:unittest/unittest.dart');
-          expect(uri, equals(
-              '/home/somebody/.pub/cache/unittest-0.9.9/lib/unittest.dart'));
+''',
+              uri: 'package:unittest/unittest.dart');
+          expect(
+              uri,
+              equals(
+                  '/home/somebody/.pub/cache/unittest-0.9.9/lib/unittest.dart'));
         });
         test('URI not in mapping', () {
           String uri = resolvePackageUri(
@@ -117,7 +126,8 @@
           // TODO(pquitslund): fix clients to handle errors appropriately
           //   CLI: print message 'invalid package file format'
           //   SERVER: best case tell user somehow and recover...
-          expect(() => resolvePackageUri(
+          expect(
+              () => resolvePackageUri(
                   config: 'foo:<:&%>', uri: 'package:foo/bar.dart'),
               throwsA(new isInstanceOf('FormatException')));
         });
@@ -139,7 +149,8 @@
       });
       group('restoreUri', () {
         test('URI in mapping', () {
-          Uri uri = restorePackageUri(config: '''
+          Uri uri = restorePackageUri(
+              config: '''
 unittest:/home/somebody/.pub/cache/unittest-0.9.9/lib/
 async:/home/somebody/.pub/cache/async-1.1.0/lib/
 quiver:/home/somebody/.pub/cache/quiver-1.2.1/lib
@@ -257,8 +268,9 @@
     File firstFile = provider.newFile(firstPath, '');
     provider.newFile(secondPath, '');
 
-    PackageMapUriResolver resolver =
-        new PackageMapUriResolver(provider, {'package': [libFolder]});
+    PackageMapUriResolver resolver = new PackageMapUriResolver(provider, {
+      'package': [libFolder]
+    });
     SourceFactory factory = new SourceFactory([resolver]);
     Source librarySource =
         firstFile.createSource(Uri.parse('package:package/dir/first.dart'));
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 b49a115..99ab84c 100644
--- a/pkg/analyzer/test/generated/static_type_warning_code_test.dart
+++ b/pkg/analyzer/test/generated/static_type_warning_code_test.dart
@@ -7,13 +7,13 @@
 import 'package:analyzer/src/generated/engine.dart';
 import 'package:analyzer/src/generated/error.dart';
 import 'package:analyzer/src/generated/source_io.dart';
-import 'package:unittest/unittest.dart';
 
 import '../reflective_tests.dart';
+import '../utils.dart';
 import 'resolver_test.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   runReflectiveTests(StaticTypeWarningCodeTest);
 }
 
@@ -44,10 +44,14 @@
 import 'lib1.dart';
 import 'lib2.dart';
 g() { return f(); }''');
-    addNamedSource("/lib1.dart", r'''
+    addNamedSource(
+        "/lib1.dart",
+        r'''
 library lib1;
 f() {}''');
-    addNamedSource("/lib2.dart", r'''
+    addNamedSource(
+        "/lib2.dart",
+        r'''
 library lib2;
 f() {}''');
     computeLibrarySourceErrors(source);
@@ -828,6 +832,27 @@
     verify([source]);
   }
 
+  // https://github.com/dart-lang/sdk/issues/24713
+  void test_returnOfInvalidType_not_issued_for_valid_generic_return() {
+    Source source = addSource(r'''
+abstract class F<T, U>  {
+  U get value;
+}
+
+abstract class G<T> {
+  T test(F<int, T> arg) => arg.value;
+}
+
+abstract class H<S> {
+  S test(F<int, S> arg) => arg.value;
+}
+
+void main() { }''');
+    computeLibrarySourceErrors(source);
+    assertNoErrors(source);
+    verify([source]);
+  }
+
   void test_returnOfInvalidType_void() {
     Source source = addSource("void f() { return 42; }");
     computeLibrarySourceErrors(source);
@@ -1324,7 +1349,9 @@
     Source source = addSource(r'''
 import 'lib.dart' as f;
 main() { return f.g(); }''');
-    addNamedSource("/lib.dart", r'''
+    addNamedSource(
+        "/lib.dart",
+        r'''
 library lib;
 h() {}''');
     computeLibrarySourceErrors(source);
@@ -1529,7 +1556,9 @@
   }
 
   void test_undefinedMethod_private() {
-    addNamedSource("/lib.dart", r'''
+    addNamedSource(
+        "/lib.dart",
+        r'''
 library lib;
 class A {
   _foo() {}
diff --git a/pkg/analyzer/test/generated/static_warning_code_test.dart b/pkg/analyzer/test/generated/static_warning_code_test.dart
index c5bede5..f48528e 100644
--- a/pkg/analyzer/test/generated/static_warning_code_test.dart
+++ b/pkg/analyzer/test/generated/static_warning_code_test.dart
@@ -9,10 +9,11 @@
 import 'package:unittest/unittest.dart';
 
 import '../reflective_tests.dart';
+import '../utils.dart';
 import 'resolver_test.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   runReflectiveTests(StaticWarningCodeTest);
 }
 
@@ -54,10 +55,14 @@
 import 'lib1.dart';
 import 'lib2.dart';
 f(p) {p as N;}''');
-    addNamedSource("/lib1.dart", r'''
+    addNamedSource(
+        "/lib1.dart",
+        r'''
 library lib1;
 class N {}''');
-    addNamedSource("/lib2.dart", r'''
+    addNamedSource(
+        "/lib2.dart",
+        r'''
 library lib2;
 class N {}''');
     computeLibrarySourceErrors(source);
@@ -69,10 +74,14 @@
 import 'lib1.dart';
 import 'lib2.dart';
 class A extends N {}''');
-    addNamedSource("/lib1.dart", r'''
+    addNamedSource(
+        "/lib1.dart",
+        r'''
 library lib1;
 class N {}''');
-    addNamedSource("/lib2.dart", r'''
+    addNamedSource(
+        "/lib2.dart",
+        r'''
 library lib2;
 class N {}''');
     computeLibrarySourceErrors(source);
@@ -87,10 +96,14 @@
 import 'lib1.dart';
 import 'lib2.dart';
 class A implements N {}''');
-    addNamedSource("/lib1.dart", r'''
+    addNamedSource(
+        "/lib1.dart",
+        r'''
 library lib1;
 class N {}''');
-    addNamedSource("/lib2.dart", r'''
+    addNamedSource(
+        "/lib2.dart",
+        r'''
 library lib2;
 class N {}''');
     computeLibrarySourceErrors(source);
@@ -106,13 +119,19 @@
 import 'lib1.dart';
 import 'lib2.dart';
 part 'part.dart';''');
-    addNamedSource("/lib1.dart", r'''
+    addNamedSource(
+        "/lib1.dart",
+        r'''
 library lib1;
 class N {}''');
-    addNamedSource("/lib2.dart", r'''
+    addNamedSource(
+        "/lib2.dart",
+        r'''
 library lib2;
 class N {}''');
-    Source partSource = addNamedSource("/part.dart", r'''
+    Source partSource = addNamedSource(
+        "/part.dart",
+        r'''
 part of lib;
 class A extends N {}''');
     computeLibrarySourceErrors(source);
@@ -128,10 +147,14 @@
 import 'lib1.dart';
 import 'lib2.dart';
 f() {new N();}''');
-    addNamedSource("/lib1.dart", r'''
+    addNamedSource(
+        "/lib1.dart",
+        r'''
 library lib1;
 class N {}''');
-    addNamedSource("/lib2.dart", r'''
+    addNamedSource(
+        "/lib2.dart",
+        r'''
 library lib2;
 class N {}''');
     computeLibrarySourceErrors(source);
@@ -143,10 +166,14 @@
 import 'lib1.dart';
 import 'lib2.dart';
 f(p) {p is N;}''');
-    addNamedSource("/lib1.dart", r'''
+    addNamedSource(
+        "/lib1.dart",
+        r'''
 library lib1;
 class N {}''');
-    addNamedSource("/lib2.dart", r'''
+    addNamedSource(
+        "/lib2.dart",
+        r'''
 library lib2;
 class N {}''');
     computeLibrarySourceErrors(source);
@@ -158,10 +185,14 @@
 import 'lib1.dart';
 import 'lib2.dart';
 g() { N.FOO; }''');
-    addNamedSource("/lib1.dart", r'''
+    addNamedSource(
+        "/lib1.dart",
+        r'''
 library lib1;
 class N {}''');
-    addNamedSource("/lib2.dart", r'''
+    addNamedSource(
+        "/lib2.dart",
+        r'''
 library lib2;
 class N {}''');
     computeLibrarySourceErrors(source);
@@ -181,10 +212,14 @@
   N m() { return null; }
 }
 class B<T extends N> {}''');
-    addNamedSource("/lib1.dart", r'''
+    addNamedSource(
+        "/lib1.dart",
+        r'''
 library lib1;
 class N {}''');
-    addNamedSource("/lib2.dart", r'''
+    addNamedSource(
+        "/lib2.dart",
+        r'''
 library lib2;
 class N {}''');
     computeLibrarySourceErrors(source);
@@ -205,10 +240,14 @@
 import 'lib2.dart';
 class A<T> {}
 A<N> f() { return null; }''');
-    addNamedSource("/lib1.dart", r'''
+    addNamedSource(
+        "/lib1.dart",
+        r'''
 library lib1;
 class N {}''');
-    addNamedSource("/lib2.dart", r'''
+    addNamedSource(
+        "/lib2.dart",
+        r'''
 library lib2;
 class N {}''');
     computeLibrarySourceErrors(source);
@@ -221,10 +260,14 @@
 import 'lib2.dart';
 class A<T> {}
 f() {new A<N>();}''');
-    addNamedSource("/lib1.dart", r'''
+    addNamedSource(
+        "/lib1.dart",
+        r'''
 library lib1;
 class N {}''');
-    addNamedSource("/lib2.dart", r'''
+    addNamedSource(
+        "/lib2.dart",
+        r'''
 library lib2;
 class N {}''');
     computeLibrarySourceErrors(source);
@@ -237,10 +280,14 @@
 import 'lib2.dart';
 f() { g(v); }
 g(p) {}''');
-    addNamedSource("/lib1.dart", r'''
+    addNamedSource(
+        "/lib1.dart",
+        r'''
 library lib1;
 var v;''');
-    addNamedSource("/lib2.dart", r'''
+    addNamedSource(
+        "/lib2.dart",
+        r'''
 library lib2;
 var v;''');
     computeLibrarySourceErrors(source);
@@ -252,10 +299,14 @@
 import 'lib1.dart';
 import 'lib2.dart';
 f() { v = 0; }''');
-    addNamedSource("/lib1.dart", r'''
+    addNamedSource(
+        "/lib1.dart",
+        r'''
 library lib1;
 var v;''');
-    addNamedSource("/lib2.dart", r'''
+    addNamedSource(
+        "/lib2.dart",
+        r'''
 library lib2;
 var v;''');
     computeLibrarySourceErrors(source);
@@ -270,10 +321,14 @@
 main() {
   p.f();
 }''');
-    addNamedSource("/lib1.dart", r'''
+    addNamedSource(
+        "/lib1.dart",
+        r'''
 library lib1;
 f() {}''');
-    addNamedSource("/lib2.dart", r'''
+    addNamedSource(
+        "/lib2.dart",
+        r'''
 library lib2;
 f() {}''');
     computeLibrarySourceErrors(source);
@@ -282,14 +337,18 @@
 
   void test_argumentTypeNotAssignable_ambiguousClassName() {
     // See dartbug.com/19624
-    Source source = addNamedSource("/lib1.dart", r'''
+    Source source = addNamedSource(
+        "/lib1.dart",
+        r'''
 library lib1;
 import 'lib2.dart';
 class _A {}
 f() {
   g((_A a) {});
 }''');
-    addNamedSource("/lib2.dart", r'''
+    addNamedSource(
+        "/lib2.dart",
+        r'''
 library lib2;
 class _A {}
 g(h(_A a)) {}''');
@@ -905,13 +964,29 @@
     verify([source]);
   }
 
+  void test_concreteClassWithAbstractMember_noSuchMethod_interface() {
+    Source source = addSource(r'''
+class I {
+  noSuchMethod(v) => '';
+}
+class A implements I {
+  m();
+}''');
+    computeLibrarySourceErrors(source);
+    assertErrors(
+        source, [StaticWarningCode.CONCRETE_CLASS_WITH_ABSTRACT_MEMBER]);
+    verify([source]);
+  }
+
   void test_conflictingDartImport() {
     Source source = addSource(r'''
 import 'lib.dart';
 import 'dart:async';
 Future f = null;
 Stream s;''');
-    addNamedSource("/lib.dart", r'''
+    addNamedSource(
+        "/lib.dart",
+        r'''
 library lib;
 class Future {}''');
     computeLibrarySourceErrors(source);
@@ -1203,18 +1278,6 @@
     verify([source]);
   }
 
-  void test_exportDuplicatedLibraryUnnamed() {
-    Source source = addSource(r'''
-library test;
-export 'lib1.dart';
-export 'lib2.dart';''');
-    addNamedSource("/lib1.dart", "");
-    addNamedSource("/lib2.dart", "");
-    computeLibrarySourceErrors(source);
-    assertErrors(source, [StaticWarningCode.EXPORT_DUPLICATED_LIBRARY_UNNAMED]);
-    verify([source]);
-  }
-
   void test_extraPositionalArguments() {
     Source source = addSource(r'''
 f() {}
@@ -1427,22 +1490,6 @@
     verify([source]);
   }
 
-  void test_importDuplicatedLibraryUnnamed() {
-    Source source = addSource(r'''
-library test;
-import 'lib1.dart';
-import 'lib2.dart';''');
-    addNamedSource("/lib1.dart", "");
-    addNamedSource("/lib2.dart", "");
-    computeLibrarySourceErrors(source);
-    assertErrors(source, [
-      StaticWarningCode.IMPORT_DUPLICATED_LIBRARY_UNNAMED,
-      HintCode.UNUSED_IMPORT,
-      HintCode.UNUSED_IMPORT
-    ]);
-    verify([source]);
-  }
-
   void test_importOfNonLibrary() {
     resolveWithErrors(<String>[
       r'''
@@ -1452,7 +1499,9 @@
 library lib;
 import 'lib1.dart' deferred as p;
 var a = new p.A();'''
-    ], <ErrorCode>[StaticWarningCode.IMPORT_OF_NON_LIBRARY]);
+    ], <ErrorCode>[
+      StaticWarningCode.IMPORT_OF_NON_LIBRARY
+    ]);
   }
 
   void test_inconsistentMethodInheritanceGetterAndMethod() {
@@ -2380,8 +2429,10 @@
   }
 
   void test_newWithNonType_fromLibrary() {
-    Source source1 = addNamedSource("lib.dart", "class B {}");
-    Source source2 = addNamedSource("lib2.dart", r'''
+    Source source1 = addNamedSource("/lib.dart", "class B {}");
+    Source source2 = addNamedSource(
+        "/lib2.dart",
+        r'''
 import 'lib.dart' as lib;
 void f() {
   var a = new lib.A();
@@ -2615,6 +2666,23 @@
         [StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE]);
   }
 
+  void test_nonAbstractClassInheritsAbstractMemberOne_noSuchMethod_interface() {
+    // 15979
+    Source source = addSource(r'''
+class I {
+  noSuchMethod(v) => '';
+}
+abstract class A {
+  m();
+}
+class B extends A implements I {
+}''');
+    computeLibrarySourceErrors(source);
+    assertErrors(source,
+        [StaticWarningCode.NON_ABSTRACT_CLASS_INHERITS_ABSTRACT_MEMBER_ONE]);
+    verify([source]);
+  }
+
   void test_nonAbstractClassInheritsAbstractMemberOne_setter_and_implicitSetter() {
     // test from language/override_inheritance_abstract_test_14.dart
     Source source = addSource(r'''
@@ -3067,7 +3135,9 @@
 f(var v) {
   v as a.A;
 }'''
-    ], <ErrorCode>[StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS]);
+    ], <ErrorCode>[
+      StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS
+    ]);
   }
 
   void test_typeAnnotationDeferredClass_catchClause() {
@@ -3083,7 +3153,9 @@
   } on a.A {
   }
 }'''
-    ], <ErrorCode>[StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS]);
+    ], <ErrorCode>[
+      StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS
+    ]);
   }
 
   void test_typeAnnotationDeferredClass_fieldFormalParameter() {
@@ -3098,7 +3170,9 @@
   var v;
   C(a.A this.v);
 }'''
-    ], <ErrorCode>[StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS]);
+    ], <ErrorCode>[
+      StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS
+    ]);
   }
 
   void test_typeAnnotationDeferredClass_functionDeclaration_returnType() {
@@ -3110,7 +3184,9 @@
 library root;
 import 'lib1.dart' deferred as a;
 a.A f() { return null; }'''
-    ], <ErrorCode>[StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS]);
+    ], <ErrorCode>[
+      StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS
+    ]);
   }
 
   void test_typeAnnotationDeferredClass_functionTypedFormalParameter_returnType() {
@@ -3122,7 +3198,9 @@
 library root;
 import 'lib1.dart' deferred as a;
 f(a.A g()) {}'''
-    ], <ErrorCode>[StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS]);
+    ], <ErrorCode>[
+      StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS
+    ]);
   }
 
   void test_typeAnnotationDeferredClass_isExpression() {
@@ -3136,7 +3214,9 @@
 f(var v) {
   bool b = v is a.A;
 }'''
-    ], <ErrorCode>[StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS]);
+    ], <ErrorCode>[
+      StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS
+    ]);
   }
 
   void test_typeAnnotationDeferredClass_methodDeclaration_returnType() {
@@ -3150,7 +3230,9 @@
 class C {
   a.A m() { return null; }
 }'''
-    ], <ErrorCode>[StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS]);
+    ], <ErrorCode>[
+      StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS
+    ]);
   }
 
   void test_typeAnnotationDeferredClass_simpleFormalParameter() {
@@ -3162,7 +3244,9 @@
 library root;
 import 'lib1.dart' deferred as a;
 f(a.A v) {}'''
-    ], <ErrorCode>[StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS]);
+    ], <ErrorCode>[
+      StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS
+    ]);
   }
 
   void test_typeAnnotationDeferredClass_typeArgumentList() {
@@ -3175,7 +3259,9 @@
 import 'lib1.dart' deferred as a;
 class C<E> {}
 C<a.A> c;'''
-    ], <ErrorCode>[StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS]);
+    ], <ErrorCode>[
+      StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS
+    ]);
   }
 
   void test_typeAnnotationDeferredClass_typeArgumentList2() {
@@ -3203,7 +3289,9 @@
 library root;
 import 'lib1.dart' deferred as a;
 class C<E extends a.A> {}'''
-    ], <ErrorCode>[StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS]);
+    ], <ErrorCode>[
+      StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS
+    ]);
   }
 
   void test_typeAnnotationDeferredClass_variableDeclarationList() {
@@ -3215,7 +3303,9 @@
 library root;
 import 'lib1.dart' deferred as a;
 a.A v;'''
-    ], <ErrorCode>[StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS]);
+    ], <ErrorCode>[
+      StaticWarningCode.TYPE_ANNOTATION_DEFERRED_CLASS
+    ]);
   }
 
   void test_typeParameterReferencedByStatic_field() {
@@ -3343,8 +3433,10 @@
   }
 
   void test_undefinedGetter_fromLibrary() {
-    Source source1 = addNamedSource("lib.dart", "");
-    Source source2 = addNamedSource("lib2.dart", r'''
+    Source source1 = addNamedSource("/lib.dart", "");
+    Source source2 = addNamedSource(
+        "/lib2.dart",
+        r'''
 import 'lib.dart' as lib;
 void f() {
   var g = lib.gg;
@@ -3395,7 +3487,9 @@
   }
 
   void test_undefinedIdentifier_private_getter() {
-    addNamedSource("/lib.dart", r'''
+    addNamedSource(
+        "/lib.dart",
+        r'''
 library lib;
 class A {
   var _foo;
@@ -3412,7 +3506,9 @@
   }
 
   void test_undefinedIdentifier_private_setter() {
-    addNamedSource("/lib.dart", r'''
+    addNamedSource(
+        "/lib.dart",
+        r'''
 library lib;
 class A {
   var _foo;
@@ -3440,8 +3536,10 @@
   }
 
   void test_undefinedSetter() {
-    Source source1 = addNamedSource("lib.dart", "");
-    Source source2 = addNamedSource("lib2.dart", r'''
+    Source source1 = addNamedSource("/lib.dart", "");
+    Source source2 = addNamedSource(
+        "/lib2.dart",
+        r'''
 import 'lib.dart' as lib;
 void f() {
   lib.gg = null;
diff --git a/pkg/analyzer/test/generated/test_all.dart b/pkg/analyzer/test/generated/test_all.dart
index 33435d4..fb84d46 100644
--- a/pkg/analyzer/test/generated/test_all.dart
+++ b/pkg/analyzer/test/generated/test_all.dart
@@ -6,6 +6,7 @@
 
 import 'package:unittest/unittest.dart';
 
+import '../utils.dart';
 import 'all_the_rest_test.dart' as all_the_rest;
 import 'ast_test.dart' as ast_test;
 import 'compile_time_error_code_test.dart' as compile_time_error_code_test;
@@ -27,7 +28,7 @@
 
 /// Utility for manually running all tests.
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   group('generated tests', () {
     all_the_rest.main();
     ast_test.main();
diff --git a/pkg/analyzer/test/generated/test_support.dart b/pkg/analyzer/test/generated/test_support.dart
index 666b233..20cc0e2 100644
--- a/pkg/analyzer/test/generated/test_support.dart
+++ b/pkg/analyzer/test/generated/test_support.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.
 
-// This code was auto-generated, is not intended to be edited, and is subject to
-// significant change. Please see the README file for more information.
-
 library engine.test_support;
 
 import 'dart:collection';
@@ -561,7 +558,8 @@
   bool generateExceptionOnRead = false;
 
   @override
-  int get modificationStamp => generateExceptionOnRead ? -1 : _modificationStamp;
+  int get modificationStamp =>
+      generateExceptionOnRead ? -1 : _modificationStamp;
 
   /**
    * The number of times that the contents of this source have been requested.
@@ -578,46 +576,58 @@
     }
     return new TimestampedData<String>(0, _contents);
   }
+
   String get encoding {
     throw new UnsupportedOperationException();
   }
+
   String get fullName {
     return _name;
   }
+
   int get hashCode => 0;
   bool get isInSystemLibrary {
     return false;
   }
+
   String get shortName {
     return _name;
   }
+
   Uri get uri {
     throw new UnsupportedOperationException();
   }
+
   UriKind get uriKind {
     throw new UnsupportedOperationException();
   }
+
   bool operator ==(Object other) {
     if (other is TestSource) {
       return other._name == _name;
     }
     return false;
   }
+
   bool exists() => exists2;
   void getContentsToReceiver(Source_ContentReceiver receiver) {
     throw new UnsupportedOperationException();
   }
+
   Source resolve(String uri) {
     throw new UnsupportedOperationException();
   }
+
   Uri resolveRelativeUri(Uri uri) {
     return new Uri(scheme: 'file', path: _name).resolveUri(uri);
   }
+
   void setContents(String value) {
     generateExceptionOnRead = false;
     _modificationStamp = new DateTime.now().millisecondsSinceEpoch;
     _contents = value;
   }
+
   @override
   String toString() => '$_name';
 }
diff --git a/pkg/analyzer/test/generated/type_system_test.dart b/pkg/analyzer/test/generated/type_system_test.dart
index 5077871..d49c75c 100644
--- a/pkg/analyzer/test/generated/type_system_test.dart
+++ b/pkg/analyzer/test/generated/type_system_test.dart
@@ -13,10 +13,13 @@
 import 'package:unittest/unittest.dart';
 
 import '../reflective_tests.dart';
+import '../utils.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   runReflectiveTests(TypeSystemTest);
+  runReflectiveTests(StrongSubtypingTest);
+  runReflectiveTests(StrongAssignabilityTest);
 }
 
 @reflectiveTest
@@ -38,7 +41,7 @@
 
   void setUp() {
     typeProvider = new TestTypeProvider();
-    typeSystem = new TypeSystemImpl(typeProvider);
+    typeSystem = new TypeSystemImpl();
     FunctionTypeAliasElementImpl typeAlias =
         ElementFactory.functionTypeAliasElement('A');
     typeAlias.parameters = [];
@@ -159,14 +162,21 @@
     DartType typeParam = ElementFactory.typeParameterElement('T').type;
     DartType interfaceType = ElementFactory.classElement2('A', []).type;
     expect(
-        typeSystem.getLeastUpperBound(dynamicType, dynamicType), dynamicType);
-    expect(typeSystem.getLeastUpperBound(voidType, voidType), voidType);
-    expect(typeSystem.getLeastUpperBound(bottomType, bottomType), bottomType);
-    expect(typeSystem.getLeastUpperBound(typeParam, typeParam), typeParam);
-    expect(typeSystem.getLeastUpperBound(interfaceType, interfaceType),
+        typeSystem.getLeastUpperBound(typeProvider, dynamicType, dynamicType),
+        dynamicType);
+    expect(typeSystem.getLeastUpperBound(typeProvider, voidType, voidType),
+        voidType);
+    expect(typeSystem.getLeastUpperBound(typeProvider, bottomType, bottomType),
+        bottomType);
+    expect(typeSystem.getLeastUpperBound(typeProvider, typeParam, typeParam),
+        typeParam);
+    expect(
+        typeSystem.getLeastUpperBound(
+            typeProvider, interfaceType, interfaceType),
         interfaceType);
     expect(
-        typeSystem.getLeastUpperBound(simpleFunctionType, simpleFunctionType),
+        typeSystem.getLeastUpperBound(
+            typeProvider, simpleFunctionType, simpleFunctionType),
         simpleFunctionType);
   }
 
@@ -328,7 +338,9 @@
     // List<int>
     //
     InterfaceType listOfIntType = listType.substitute4(<DartType>[intType]);
-    expect(typeSystem.getLeastUpperBound(listOfIntType, listOfIntType),
+    expect(
+        typeSystem.getLeastUpperBound(
+            typeProvider, listOfIntType, listOfIntType),
         listOfIntType);
   }
 
@@ -352,6 +364,565 @@
 
   void _checkLeastUpperBound(
       DartType type1, DartType type2, DartType expectedResult) {
-    expect(typeSystem.getLeastUpperBound(type1, type2), expectedResult);
+    expect(typeSystem.getLeastUpperBound(typeProvider, type1, type2),
+        expectedResult);
+  }
+}
+
+class TypeBuilder {
+  static FunctionType functionType(
+      List<DartType> parameters, DartType returnType,
+      {List<DartType> optional, Map<String, DartType> named}) {
+    return ElementFactory
+        .functionElement8(parameters, returnType,
+            optional: optional, named: named)
+        .type;
+  }
+}
+
+@reflectiveTest
+class StrongSubtypingTest {
+  TypeProvider typeProvider;
+  TypeSystem typeSystem;
+
+  DartType get bottomType => typeProvider.bottomType;
+  InterfaceType get doubleType => typeProvider.doubleType;
+  DartType get dynamicType => typeProvider.dynamicType;
+  InterfaceType get functionType => typeProvider.functionType;
+  InterfaceType get intType => typeProvider.intType;
+  InterfaceType get listType => typeProvider.listType;
+  InterfaceType get numType => typeProvider.numType;
+  InterfaceType get objectType => typeProvider.objectType;
+  InterfaceType get stringType => typeProvider.stringType;
+  DartType get voidType => VoidTypeImpl.instance;
+
+  void setUp() {
+    typeProvider = new TestTypeProvider();
+    typeSystem = new StrongTypeSystemImpl();
+  }
+
+  void test_isSubtypeOf_dynamic_isTop() {
+    DartType interfaceType = ElementFactory.classElement2('A', []).type;
+    List<DartType> equivalents = <DartType>[dynamicType, objectType];
+    List<DartType> subtypes = <DartType>[
+      intType,
+      doubleType,
+      numType,
+      stringType,
+      functionType,
+      interfaceType,
+      bottomType
+    ];
+    _checkGroups(dynamicType, equivalents: equivalents, subtypes: subtypes);
+  }
+
+  void test_isSubtypeOf_bottom_isBottom() {
+    DartType interfaceType = ElementFactory.classElement2('A', []).type;
+    List<DartType> equivalents = <DartType>[bottomType];
+    List<DartType> supertypes = <DartType>[
+      dynamicType,
+      objectType,
+      intType,
+      doubleType,
+      numType,
+      stringType,
+      functionType,
+      interfaceType
+    ];
+    _checkGroups(bottomType, equivalents: equivalents, supertypes: supertypes);
+  }
+
+  void test_isSubtypeOf_int() {
+    List<DartType> equivalents = <DartType>[intType];
+    List<DartType> supertypes = <DartType>[numType];
+    List<DartType> unrelated = <DartType>[doubleType];
+    _checkGroups(intType,
+        equivalents: equivalents, supertypes: supertypes, unrelated: unrelated);
+  }
+
+  void test_isSubtypeOf_double() {
+    List<DartType> equivalents = <DartType>[doubleType];
+    List<DartType> supertypes = <DartType>[numType];
+    List<DartType> unrelated = <DartType>[intType];
+    _checkGroups(doubleType,
+        equivalents: equivalents, supertypes: supertypes, unrelated: unrelated);
+  }
+
+  void test_isSubtypeOf_num() {
+    List<DartType> equivalents = <DartType>[numType];
+    List<DartType> supertypes = <DartType>[];
+    List<DartType> unrelated = <DartType>[stringType];
+    List<DartType> subtypes = <DartType>[intType, doubleType];
+    _checkGroups(numType,
+        equivalents: equivalents,
+        supertypes: supertypes,
+        unrelated: unrelated,
+        subtypes: subtypes);
+  }
+
+  void test_isSubtypeOf_classes() {
+    ClassElement classTop = ElementFactory.classElement2("A");
+    ClassElement classLeft = ElementFactory.classElement("B", classTop.type);
+    ClassElement classRight = ElementFactory.classElement("C", classTop.type);
+    ClassElement classBottom = ElementFactory.classElement("D", classLeft.type)
+      ..interfaces = <InterfaceType>[classRight.type];
+    InterfaceType top = classTop.type;
+    InterfaceType left = classLeft.type;
+    InterfaceType right = classRight.type;
+    InterfaceType bottom = classBottom.type;
+
+    _checkLattice(top, left, right, bottom);
+  }
+
+  void test_isSubtypeOf_simple_function() {
+    FunctionType top =
+        TypeBuilder.functionType(<DartType>[intType], objectType);
+    FunctionType left = TypeBuilder.functionType(<DartType>[intType], intType);
+    FunctionType right =
+        TypeBuilder.functionType(<DartType>[objectType], objectType);
+    FunctionType bottom =
+        TypeBuilder.functionType(<DartType>[objectType], intType);
+
+    _checkLattice(top, left, right, bottom);
+  }
+
+  void test_isSubtypeOf_call_method() {
+    ClassElementImpl classBottom = ElementFactory.classElement2("Bottom");
+    MethodElement methodBottom =
+        ElementFactory.methodElement("call", objectType, <DartType>[intType]);
+    classBottom.methods = <MethodElement>[methodBottom];
+
+    DartType top = TypeBuilder.functionType(<DartType>[intType], objectType);
+    InterfaceType bottom = classBottom.type;
+
+    _checkIsStrictSubtypeOf(bottom, top);
+  }
+
+  void test_isSubtypeOf_fuzzy_arrows() {
+    FunctionType top =
+        TypeBuilder.functionType(<DartType>[dynamicType], objectType);
+    FunctionType left =
+        TypeBuilder.functionType(<DartType>[objectType], objectType);
+    FunctionType right =
+        TypeBuilder.functionType(<DartType>[dynamicType], bottomType);
+    FunctionType bottom =
+        TypeBuilder.functionType(<DartType>[objectType], bottomType);
+
+    _checkLattice(top, left, right, bottom);
+  }
+
+  void test_isSubtypeOf_void_functions() {
+    FunctionType top = TypeBuilder.functionType(<DartType>[intType], voidType);
+    FunctionType bottom =
+        TypeBuilder.functionType(<DartType>[objectType], intType);
+
+    _checkIsStrictSubtypeOf(bottom, top);
+  }
+
+  void test_isSubtypeOf_named_optional() {
+    DartType r = TypeBuilder.functionType(<DartType>[intType], intType);
+    DartType o = TypeBuilder.functionType(<DartType>[], intType,
+        optional: <DartType>[intType]);
+    DartType n = TypeBuilder.functionType(<DartType>[], intType,
+        named: <String, DartType>{'x': intType});
+    DartType rr =
+        TypeBuilder.functionType(<DartType>[intType, intType], intType);
+    DartType ro = TypeBuilder.functionType(<DartType>[intType], intType,
+        optional: <DartType>[intType]);
+    DartType rn = TypeBuilder.functionType(<DartType>[intType], intType,
+        named: <String, DartType>{'x': intType});
+    DartType oo = TypeBuilder.functionType(<DartType>[], intType,
+        optional: <DartType>[intType, intType]);
+    DartType nn = TypeBuilder.functionType(<DartType>[], intType,
+        named: <String, DartType>{'x': intType, 'y': intType});
+    DartType nnn = TypeBuilder.functionType(<DartType>[], intType,
+        named: <String, DartType>{'x': intType, 'y': intType, 'z': intType});
+
+    _checkGroups(r,
+        equivalents: [r],
+        subtypes: [o, ro, rn, oo],
+        unrelated: [n, rr, nn, nnn]);
+    _checkGroups(o,
+        equivalents: [o], subtypes: [oo], unrelated: [n, rr, ro, rn, nn, nnn]);
+    _checkGroups(n,
+        equivalents: [n],
+        subtypes: [nn, nnn],
+        unrelated: [r, o, rr, ro, rn, oo]);
+    _checkGroups(rr,
+        equivalents: [rr],
+        subtypes: [ro, oo],
+        unrelated: [r, o, n, rn, nn, nnn]);
+    _checkGroups(ro,
+        equivalents: [ro], subtypes: [oo], unrelated: [o, n, rn, nn, nnn]);
+    _checkGroups(rn,
+        equivalents: [rn],
+        subtypes: [],
+        unrelated: [o, n, rr, ro, oo, nn, nnn]);
+    _checkGroups(oo,
+        equivalents: [oo], subtypes: [], unrelated: [n, rn, nn, nnn]);
+    _checkGroups(nn,
+        equivalents: [nn], subtypes: [nnn], unrelated: [r, o, rr, ro, rn, oo]);
+    _checkGroups(nnn,
+        equivalents: [nnn], subtypes: [], unrelated: [r, o, rr, ro, rn, oo]);
+  }
+
+  void test_isSubtypeOf_generics() {
+    ClassElementImpl LClass = ElementFactory.classElement2('L', ["T"]);
+    InterfaceType LType = LClass.type;
+    ClassElementImpl MClass = ElementFactory.classElement2('M', ["T"]);
+    DartType typeParam = MClass.typeParameters[0].type;
+    InterfaceType superType = LType.substitute4(<DartType>[typeParam]);
+    MClass.interfaces = <InterfaceType>[superType];
+    InterfaceType MType = MClass.type;
+
+    InterfaceType top = LType.substitute4(<DartType>[dynamicType]);
+    InterfaceType left = MType.substitute4(<DartType>[dynamicType]);
+    InterfaceType right = LType.substitute4(<DartType>[intType]);
+    InterfaceType bottom = MType.substitute4(<DartType>[intType]);
+
+    _checkLattice(top, left, right, bottom);
+  }
+
+  void _checkLattice(
+      DartType top, DartType left, DartType right, DartType bottom) {
+    _checkGroups(top,
+        equivalents: <DartType>[top],
+        subtypes: <DartType>[left, right, bottom]);
+    _checkGroups(left,
+        equivalents: <DartType>[left],
+        subtypes: <DartType>[bottom],
+        unrelated: <DartType>[right],
+        supertypes: <DartType>[top]);
+    _checkGroups(right,
+        equivalents: <DartType>[right],
+        subtypes: <DartType>[bottom],
+        unrelated: <DartType>[left],
+        supertypes: <DartType>[top]);
+    _checkGroups(bottom,
+        equivalents: <DartType>[bottom],
+        supertypes: <DartType>[top, left, right]);
+  }
+
+  void _checkGroups(DartType t1,
+      {List<DartType> equivalents,
+      List<DartType> unrelated,
+      List<DartType> subtypes,
+      List<DartType> supertypes}) {
+    if (equivalents != null) {
+      for (DartType t2 in equivalents) {
+        _checkEquivalent(t1, t2);
+      }
+    }
+    if (unrelated != null) {
+      for (DartType t2 in unrelated) {
+        _checkUnrelated(t1, t2);
+      }
+    }
+    if (subtypes != null) {
+      for (DartType t2 in subtypes) {
+        _checkIsStrictSubtypeOf(t2, t1);
+      }
+    }
+    if (supertypes != null) {
+      for (DartType t2 in supertypes) {
+        _checkIsStrictSubtypeOf(t1, t2);
+      }
+    }
+  }
+
+  void _checkUnrelated(DartType type1, DartType type2) {
+    _checkIsNotSubtypeOf(type1, type2);
+    _checkIsNotSubtypeOf(type2, type1);
+  }
+
+  void _checkEquivalent(DartType type1, DartType type2) {
+    _checkIsSubtypeOf(type1, type2);
+    _checkIsSubtypeOf(type2, type1);
+  }
+
+  void _checkIsStrictSubtypeOf(DartType type1, DartType type2) {
+    _checkIsSubtypeOf(type1, type2);
+    _checkIsNotSubtypeOf(type2, type1);
+  }
+
+  void _checkIsSubtypeOf(DartType type1, DartType type2) {
+    expect(typeSystem.isSubtypeOf(type1, type2), true);
+  }
+
+  void _checkIsNotSubtypeOf(DartType type1, DartType type2) {
+    expect(typeSystem.isSubtypeOf(type1, type2), false);
+  }
+}
+
+@reflectiveTest
+class StrongAssignabilityTest {
+  TypeProvider typeProvider;
+  TypeSystem typeSystem;
+
+  DartType get bottomType => typeProvider.bottomType;
+  InterfaceType get doubleType => typeProvider.doubleType;
+  DartType get dynamicType => typeProvider.dynamicType;
+  InterfaceType get functionType => typeProvider.functionType;
+  InterfaceType get intType => typeProvider.intType;
+  InterfaceType get listType => typeProvider.listType;
+  InterfaceType get numType => typeProvider.numType;
+  InterfaceType get objectType => typeProvider.objectType;
+  InterfaceType get stringType => typeProvider.stringType;
+  DartType get voidType => VoidTypeImpl.instance;
+
+  void setUp() {
+    typeProvider = new TestTypeProvider();
+    typeSystem = new StrongTypeSystemImpl();
+  }
+
+  void test_isAssignableTo_dynamic_isTop() {
+    DartType interfaceType = ElementFactory.classElement2('A', []).type;
+    List<DartType> interassignable = <DartType>[
+      dynamicType,
+      objectType,
+      intType,
+      doubleType,
+      numType,
+      stringType,
+      interfaceType,
+      bottomType
+    ];
+    _checkGroups(dynamicType, interassignable: interassignable);
+  }
+
+  void test_isAssignableTo_bottom_isBottom() {
+    DartType interfaceType = ElementFactory.classElement2('A', []).type;
+    List<DartType> interassignable = <DartType>[
+      dynamicType,
+      objectType,
+      intType,
+      doubleType,
+      numType,
+      stringType,
+      interfaceType,
+      bottomType
+    ];
+
+    _checkGroups(bottomType, interassignable: interassignable);
+  }
+
+  void test_isAssignableTo_int() {
+    DartType interfaceType = ElementFactory.classElement2('A', []).type;
+    List<DartType> interassignable = <DartType>[
+      dynamicType,
+      objectType,
+      intType,
+      numType,
+      bottomType
+    ];
+    List<DartType> unrelated = <DartType>[
+      doubleType,
+      stringType,
+      interfaceType,
+    ];
+
+    _checkGroups(intType,
+        interassignable: interassignable, unrelated: unrelated);
+  }
+
+  void test_isAssignableTo_double() {
+    DartType interfaceType = ElementFactory.classElement2('A', []).type;
+    List<DartType> interassignable = <DartType>[
+      dynamicType,
+      objectType,
+      doubleType,
+      numType,
+      bottomType
+    ];
+    List<DartType> unrelated = <DartType>[intType, stringType, interfaceType,];
+
+    _checkGroups(doubleType,
+        interassignable: interassignable, unrelated: unrelated);
+  }
+
+  void test_isAssignableTo_num() {
+    DartType interfaceType = ElementFactory.classElement2('A', []).type;
+    List<DartType> interassignable = <DartType>[
+      dynamicType,
+      objectType,
+      numType,
+      intType,
+      doubleType,
+      bottomType
+    ];
+    List<DartType> unrelated = <DartType>[stringType, interfaceType,];
+
+    _checkGroups(numType,
+        interassignable: interassignable, unrelated: unrelated);
+  }
+
+  void test_isAssignableTo_classes() {
+    ClassElement classTop = ElementFactory.classElement2("A");
+    ClassElement classLeft = ElementFactory.classElement("B", classTop.type);
+    ClassElement classRight = ElementFactory.classElement("C", classTop.type);
+    ClassElement classBottom = ElementFactory.classElement("D", classLeft.type)
+      ..interfaces = <InterfaceType>[classRight.type];
+    InterfaceType top = classTop.type;
+    InterfaceType left = classLeft.type;
+    InterfaceType right = classRight.type;
+    InterfaceType bottom = classBottom.type;
+
+    _checkLattice(top, left, right, bottom);
+  }
+
+  void test_isAssignableTo_simple_function() {
+    FunctionType top =
+        TypeBuilder.functionType(<DartType>[intType], objectType);
+    FunctionType left = TypeBuilder.functionType(<DartType>[intType], intType);
+    FunctionType right =
+        TypeBuilder.functionType(<DartType>[objectType], objectType);
+    FunctionType bottom =
+        TypeBuilder.functionType(<DartType>[objectType], intType);
+
+    _checkCrossLattice(top, left, right, bottom);
+  }
+
+  void test_isAssignableTo_call_method() {
+    ClassElementImpl classBottom = ElementFactory.classElement2("B");
+    MethodElement methodBottom =
+        ElementFactory.methodElement("call", objectType, <DartType>[intType]);
+    classBottom.methods = <MethodElement>[methodBottom];
+
+    DartType top = TypeBuilder.functionType(<DartType>[intType], objectType);
+    InterfaceType bottom = classBottom.type;
+
+    _checkIsStrictAssignableTo(bottom, top);
+  }
+
+  void test_isAssignableTo_fuzzy_arrows() {
+    FunctionType top =
+        TypeBuilder.functionType(<DartType>[dynamicType], objectType);
+    FunctionType left =
+        TypeBuilder.functionType(<DartType>[objectType], objectType);
+    FunctionType right =
+        TypeBuilder.functionType(<DartType>[dynamicType], bottomType);
+    FunctionType bottom =
+        TypeBuilder.functionType(<DartType>[objectType], bottomType);
+
+    _checkCrossLattice(top, left, right, bottom);
+  }
+
+  void test_isAssignableTo_void_functions() {
+    FunctionType top = TypeBuilder.functionType(<DartType>[intType], voidType);
+    FunctionType bottom =
+        TypeBuilder.functionType(<DartType>[objectType], intType);
+
+    _checkEquivalent(bottom, top);
+  }
+
+  void test_isAssignableTo_named_optional() {
+    DartType r = TypeBuilder.functionType(<DartType>[intType], intType);
+    DartType o = TypeBuilder.functionType(<DartType>[], intType,
+        optional: <DartType>[intType]);
+    DartType n = TypeBuilder.functionType(<DartType>[], intType,
+        named: <String, DartType>{'x': intType});
+    DartType rr =
+        TypeBuilder.functionType(<DartType>[intType, intType], intType);
+    DartType ro = TypeBuilder.functionType(<DartType>[intType], intType,
+        optional: <DartType>[intType]);
+    DartType rn = TypeBuilder.functionType(<DartType>[intType], intType,
+        named: <String, DartType>{'x': intType});
+    DartType oo = TypeBuilder.functionType(<DartType>[], intType,
+        optional: <DartType>[intType, intType]);
+    DartType nn = TypeBuilder.functionType(<DartType>[], intType,
+        named: <String, DartType>{'x': intType, 'y': intType});
+    DartType nnn = TypeBuilder.functionType(<DartType>[], intType,
+        named: <String, DartType>{'x': intType, 'y': intType, 'z': intType});
+
+    _checkGroups(r,
+        interassignable: [r, o, ro, rn, oo], unrelated: [n, rr, nn, nnn]);
+    _checkGroups(o,
+        interassignable: [o, oo], unrelated: [n, rr, ro, rn, nn, nnn]);
+    _checkGroups(n,
+        interassignable: [n, nn, nnn], unrelated: [r, o, rr, ro, rn, oo]);
+    _checkGroups(rr,
+        interassignable: [rr, ro, oo], unrelated: [r, o, n, rn, nn, nnn]);
+    _checkGroups(ro, interassignable: [ro, oo], unrelated: [o, n, rn, nn, nnn]);
+    _checkGroups(rn,
+        interassignable: [rn], unrelated: [o, n, rr, ro, oo, nn, nnn]);
+    _checkGroups(oo, interassignable: [oo], unrelated: [n, rn, nn, nnn]);
+    _checkGroups(nn,
+        interassignable: [nn, nnn], unrelated: [r, o, rr, ro, rn, oo]);
+    _checkGroups(nnn,
+        interassignable: [nnn], unrelated: [r, o, rr, ro, rn, oo]);
+  }
+
+  void test_isAssignableTo_generics() {
+    ClassElementImpl LClass = ElementFactory.classElement2('L', ["T"]);
+    InterfaceType LType = LClass.type;
+    ClassElementImpl MClass = ElementFactory.classElement2('M', ["T"]);
+    DartType typeParam = MClass.typeParameters[0].type;
+    InterfaceType superType = LType.substitute4(<DartType>[typeParam]);
+    MClass.interfaces = <InterfaceType>[superType];
+    InterfaceType MType = MClass.type;
+
+    InterfaceType top = LType.substitute4(<DartType>[dynamicType]);
+    InterfaceType left = MType.substitute4(<DartType>[dynamicType]);
+    InterfaceType right = LType.substitute4(<DartType>[intType]);
+    InterfaceType bottom = MType.substitute4(<DartType>[intType]);
+
+    _checkCrossLattice(top, left, right, bottom);
+  }
+
+  void _checkCrossLattice(
+      DartType top, DartType left, DartType right, DartType bottom) {
+    _checkGroups(top, interassignable: <DartType>[top, left, right, bottom]);
+    _checkGroups(left, interassignable: <DartType>[top, left, right, bottom]);
+    _checkGroups(right, interassignable: <DartType>[top, left, right, bottom]);
+    _checkGroups(bottom, interassignable: <DartType>[top, left, right, bottom]);
+  }
+
+  void _checkLattice(
+      DartType top, DartType left, DartType right, DartType bottom) {
+    _checkGroups(top, interassignable: <DartType>[top, left, right, bottom]);
+    _checkGroups(left,
+        interassignable: <DartType>[top, left, bottom],
+        unrelated: <DartType>[right]);
+    _checkGroups(right,
+        interassignable: <DartType>[top, right, bottom],
+        unrelated: <DartType>[left]);
+    _checkGroups(bottom, interassignable: <DartType>[top, left, right, bottom]);
+  }
+
+  void _checkGroups(DartType t1,
+      {List<DartType> interassignable, List<DartType> unrelated}) {
+    if (interassignable != null) {
+      for (DartType t2 in interassignable) {
+        _checkEquivalent(t1, t2);
+      }
+    }
+    if (unrelated != null) {
+      for (DartType t2 in unrelated) {
+        _checkUnrelated(t1, t2);
+      }
+    }
+  }
+
+  void _checkUnrelated(DartType type1, DartType type2) {
+    _checkIsNotAssignableTo(type1, type2);
+    _checkIsNotAssignableTo(type2, type1);
+  }
+
+  void _checkEquivalent(DartType type1, DartType type2) {
+    _checkIsAssignableTo(type1, type2);
+    _checkIsAssignableTo(type2, type1);
+  }
+
+  void _checkIsStrictAssignableTo(DartType type1, DartType type2) {
+    _checkIsAssignableTo(type1, type2);
+    _checkIsNotAssignableTo(type2, type1);
+  }
+
+  void _checkIsAssignableTo(DartType type1, DartType type2) {
+    expect(typeSystem.isAssignableTo(type1, type2), true);
+  }
+
+  void _checkIsNotAssignableTo(DartType type1, DartType type2) {
+    expect(typeSystem.isAssignableTo(type1, type2), false);
   }
 }
diff --git a/pkg/analyzer/test/generated/utilities_test.dart b/pkg/analyzer/test/generated/utilities_test.dart
index 3219e90..24263e7 100644
--- a/pkg/analyzer/test/generated/utilities_test.dart
+++ b/pkg/analyzer/test/generated/utilities_test.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.
 
-// This code was auto-generated, is not intended to be edited, and is subject to
-// significant change. Please see the README file for more information.
-
 library engine.utilities_test;
 
 import 'dart:collection';
@@ -20,10 +17,11 @@
 import 'package:unittest/unittest.dart';
 
 import '../reflective_tests.dart';
+import '../utils.dart';
 import 'test_support.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   runReflectiveTests(AstClonerTest);
   runReflectiveTests(NodeReplacerTest);
   runReflectiveTests(LineInfoTest);
@@ -187,19 +185,30 @@
   }
 
   void test_visitClassDeclaration_extends_implements() {
-    _assertClone(AstFactory.classDeclaration(null, "C", null,
-        AstFactory.extendsClause(AstFactory.typeName4("A")), null,
+    _assertClone(AstFactory.classDeclaration(
+        null,
+        "C",
+        null,
+        AstFactory.extendsClause(AstFactory.typeName4("A")),
+        null,
         AstFactory.implementsClause([AstFactory.typeName4("B")])));
   }
 
   void test_visitClassDeclaration_extends_with() {
-    _assertClone(AstFactory.classDeclaration(null, "C", null,
+    _assertClone(AstFactory.classDeclaration(
+        null,
+        "C",
+        null,
         AstFactory.extendsClause(AstFactory.typeName4("A")),
-        AstFactory.withClause([AstFactory.typeName4("M")]), null));
+        AstFactory.withClause([AstFactory.typeName4("M")]),
+        null));
   }
 
   void test_visitClassDeclaration_extends_with_implements() {
-    _assertClone(AstFactory.classDeclaration(null, "C", null,
+    _assertClone(AstFactory.classDeclaration(
+        null,
+        "C",
+        null,
         AstFactory.extendsClause(AstFactory.typeName4("A")),
         AstFactory.withClause([AstFactory.typeName4("M")]),
         AstFactory.implementsClause([AstFactory.typeName4("B")])));
@@ -211,8 +220,8 @@
   }
 
   void test_visitClassDeclaration_multipleMember() {
-    _assertClone(AstFactory.classDeclaration(null, "C", null, null, null, null,
-        [
+    _assertClone(
+        AstFactory.classDeclaration(null, "C", null, null, null, null, [
       AstFactory.fieldDeclaration2(
           false, Keyword.VAR, [AstFactory.variableDeclaration("a")]),
       AstFactory.fieldDeclaration2(
@@ -226,27 +235,39 @@
   }
 
   void test_visitClassDeclaration_parameters_extends() {
-    _assertClone(AstFactory.classDeclaration(null, "C",
+    _assertClone(AstFactory.classDeclaration(
+        null,
+        "C",
         AstFactory.typeParameterList(["E"]),
-        AstFactory.extendsClause(AstFactory.typeName4("A")), null, null));
+        AstFactory.extendsClause(AstFactory.typeName4("A")),
+        null,
+        null));
   }
 
   void test_visitClassDeclaration_parameters_extends_implements() {
-    _assertClone(AstFactory.classDeclaration(null, "C",
+    _assertClone(AstFactory.classDeclaration(
+        null,
+        "C",
         AstFactory.typeParameterList(["E"]),
-        AstFactory.extendsClause(AstFactory.typeName4("A")), null,
+        AstFactory.extendsClause(AstFactory.typeName4("A")),
+        null,
         AstFactory.implementsClause([AstFactory.typeName4("B")])));
   }
 
   void test_visitClassDeclaration_parameters_extends_with() {
-    _assertClone(AstFactory.classDeclaration(null, "C",
+    _assertClone(AstFactory.classDeclaration(
+        null,
+        "C",
         AstFactory.typeParameterList(["E"]),
         AstFactory.extendsClause(AstFactory.typeName4("A")),
-        AstFactory.withClause([AstFactory.typeName4("M")]), null));
+        AstFactory.withClause([AstFactory.typeName4("M")]),
+        null));
   }
 
   void test_visitClassDeclaration_parameters_extends_with_implements() {
-    _assertClone(AstFactory.classDeclaration(null, "C",
+    _assertClone(AstFactory.classDeclaration(
+        null,
+        "C",
         AstFactory.typeParameterList(["E"]),
         AstFactory.extendsClause(AstFactory.typeName4("A")),
         AstFactory.withClause([AstFactory.typeName4("M")]),
@@ -254,14 +275,18 @@
   }
 
   void test_visitClassDeclaration_parameters_implements() {
-    _assertClone(AstFactory.classDeclaration(null, "C",
-        AstFactory.typeParameterList(["E"]), null, null,
+    _assertClone(AstFactory.classDeclaration(
+        null,
+        "C",
+        AstFactory.typeParameterList(["E"]),
+        null,
+        null,
         AstFactory.implementsClause([AstFactory.typeName4("B")])));
   }
 
   void test_visitClassDeclaration_singleMember() {
-    _assertClone(AstFactory.classDeclaration(null, "C", null, null, null, null,
-        [
+    _assertClone(
+        AstFactory.classDeclaration(null, "C", null, null, null, null, [
       AstFactory.fieldDeclaration2(
           false, Keyword.VAR, [AstFactory.variableDeclaration("a")])
     ]));
@@ -276,65 +301,95 @@
   }
 
   void test_visitClassTypeAlias_abstract() {
-    _assertClone(AstFactory.classTypeAlias("C", null, Keyword.ABSTRACT,
+    _assertClone(AstFactory.classTypeAlias(
+        "C",
+        null,
+        Keyword.ABSTRACT,
         AstFactory.typeName4("S"),
-        AstFactory.withClause([AstFactory.typeName4("M1")]), null));
+        AstFactory.withClause([AstFactory.typeName4("M1")]),
+        null));
   }
 
   void test_visitClassTypeAlias_abstract_implements() {
-    _assertClone(AstFactory.classTypeAlias("C", null, Keyword.ABSTRACT,
+    _assertClone(AstFactory.classTypeAlias(
+        "C",
+        null,
+        Keyword.ABSTRACT,
         AstFactory.typeName4("S"),
         AstFactory.withClause([AstFactory.typeName4("M1")]),
         AstFactory.implementsClause([AstFactory.typeName4("I")])));
   }
 
   void test_visitClassTypeAlias_generic() {
-    _assertClone(AstFactory.classTypeAlias("C",
-        AstFactory.typeParameterList(["E"]), null,
+    _assertClone(AstFactory.classTypeAlias(
+        "C",
+        AstFactory.typeParameterList(["E"]),
+        null,
         AstFactory.typeName4("S", [AstFactory.typeName4("E")]),
-        AstFactory.withClause(
-            [AstFactory.typeName4("M1", [AstFactory.typeName4("E")])]), null));
+        AstFactory.withClause([
+          AstFactory.typeName4("M1", [AstFactory.typeName4("E")])
+        ]),
+        null));
   }
 
   void test_visitClassTypeAlias_implements() {
-    _assertClone(AstFactory.classTypeAlias("C", null, null,
+    _assertClone(AstFactory.classTypeAlias(
+        "C",
+        null,
+        null,
         AstFactory.typeName4("S"),
         AstFactory.withClause([AstFactory.typeName4("M1")]),
         AstFactory.implementsClause([AstFactory.typeName4("I")])));
   }
 
   void test_visitClassTypeAlias_minimal() {
-    _assertClone(AstFactory.classTypeAlias("C", null, null,
+    _assertClone(AstFactory.classTypeAlias(
+        "C",
+        null,
+        null,
         AstFactory.typeName4("S"),
-        AstFactory.withClause([AstFactory.typeName4("M1")]), null));
+        AstFactory.withClause([AstFactory.typeName4("M1")]),
+        null));
   }
 
   void test_visitClassTypeAlias_parameters_abstract() {
-    _assertClone(AstFactory.classTypeAlias("C",
-        AstFactory.typeParameterList(["E"]), Keyword.ABSTRACT,
+    _assertClone(AstFactory.classTypeAlias(
+        "C",
+        AstFactory.typeParameterList(["E"]),
+        Keyword.ABSTRACT,
         AstFactory.typeName4("S"),
-        AstFactory.withClause([AstFactory.typeName4("M1")]), null));
+        AstFactory.withClause([AstFactory.typeName4("M1")]),
+        null));
   }
 
   void test_visitClassTypeAlias_parameters_abstract_implements() {
-    _assertClone(AstFactory.classTypeAlias("C",
-        AstFactory.typeParameterList(["E"]), Keyword.ABSTRACT,
+    _assertClone(AstFactory.classTypeAlias(
+        "C",
+        AstFactory.typeParameterList(["E"]),
+        Keyword.ABSTRACT,
         AstFactory.typeName4("S"),
         AstFactory.withClause([AstFactory.typeName4("M1")]),
         AstFactory.implementsClause([AstFactory.typeName4("I")])));
   }
 
   void test_visitClassTypeAlias_parameters_implements() {
-    _assertClone(AstFactory.classTypeAlias("C",
-        AstFactory.typeParameterList(["E"]), null, AstFactory.typeName4("S"),
+    _assertClone(AstFactory.classTypeAlias(
+        "C",
+        AstFactory.typeParameterList(["E"]),
+        null,
+        AstFactory.typeName4("S"),
         AstFactory.withClause([AstFactory.typeName4("M1")]),
         AstFactory.implementsClause([AstFactory.typeName4("I")])));
   }
 
   void test_visitClassTypeAlias_withMetadata() {
-    ClassTypeAlias declaration = AstFactory.classTypeAlias("C", null, null,
+    ClassTypeAlias declaration = AstFactory.classTypeAlias(
+        "C",
+        null,
+        null,
         AstFactory.typeName4("S"),
-        AstFactory.withClause([AstFactory.typeName4("M1")]), null);
+        AstFactory.withClause([AstFactory.typeName4("M1")]),
+        null);
     declaration.metadata
         .add(AstFactory.annotation(AstFactory.identifier3("deprecated")));
     _assertClone(declaration);
@@ -362,8 +417,9 @@
   }
 
   void test_visitCompilationUnit_directive_declaration() {
-    _assertClone(AstFactory.compilationUnit4(
-        [AstFactory.libraryDirective2("l")], [
+    _assertClone(AstFactory.compilationUnit4([
+      AstFactory.libraryDirective2("l")
+    ], [
       AstFactory.topLevelVariableDeclaration2(
           Keyword.VAR, [AstFactory.variableDeclaration("a")])
     ]));
@@ -390,8 +446,9 @@
   }
 
   void test_visitCompilationUnit_script_directives_declarations() {
-    _assertClone(AstFactory.compilationUnit8("!#/bin/dartvm",
-        [AstFactory.libraryDirective2("l")], [
+    _assertClone(AstFactory.compilationUnit8("!#/bin/dartvm", [
+      AstFactory.libraryDirective2("l")
+    ], [
       AstFactory.topLevelVariableDeclaration2(
           Keyword.VAR, [AstFactory.variableDeclaration("a")])
     ]));
@@ -403,9 +460,14 @@
   }
 
   void test_visitConstructorDeclaration_const() {
-    _assertClone(AstFactory.constructorDeclaration2(Keyword.CONST, null,
-        AstFactory.identifier3("C"), null, AstFactory.formalParameterList(),
-        null, AstFactory.blockFunctionBody2()));
+    _assertClone(AstFactory.constructorDeclaration2(
+        Keyword.CONST,
+        null,
+        AstFactory.identifier3("C"),
+        null,
+        AstFactory.formalParameterList(),
+        null,
+        AstFactory.blockFunctionBody2()));
   }
 
   void test_visitConstructorDeclaration_external() {
@@ -414,47 +476,79 @@
   }
 
   void test_visitConstructorDeclaration_minimal() {
-    _assertClone(AstFactory.constructorDeclaration2(null, null,
-        AstFactory.identifier3("C"), null, AstFactory.formalParameterList(),
-        null, AstFactory.blockFunctionBody2()));
+    _assertClone(AstFactory.constructorDeclaration2(
+        null,
+        null,
+        AstFactory.identifier3("C"),
+        null,
+        AstFactory.formalParameterList(),
+        null,
+        AstFactory.blockFunctionBody2()));
   }
 
   void test_visitConstructorDeclaration_multipleInitializers() {
-    _assertClone(AstFactory.constructorDeclaration2(null, null,
-        AstFactory.identifier3("C"), null, AstFactory.formalParameterList(), [
-      AstFactory.constructorFieldInitializer(
-          false, "a", AstFactory.identifier3("b")),
-      AstFactory.constructorFieldInitializer(
-          false, "c", AstFactory.identifier3("d"))
-    ], AstFactory.blockFunctionBody2()));
+    _assertClone(AstFactory.constructorDeclaration2(
+        null,
+        null,
+        AstFactory.identifier3("C"),
+        null,
+        AstFactory.formalParameterList(),
+        [
+          AstFactory.constructorFieldInitializer(
+              false, "a", AstFactory.identifier3("b")),
+          AstFactory.constructorFieldInitializer(
+              false, "c", AstFactory.identifier3("d"))
+        ],
+        AstFactory.blockFunctionBody2()));
   }
 
   void test_visitConstructorDeclaration_multipleParameters() {
-    _assertClone(AstFactory.constructorDeclaration2(null, null,
-        AstFactory.identifier3("C"), null, AstFactory.formalParameterList([
-      AstFactory.simpleFormalParameter(Keyword.VAR, "a"),
-      AstFactory.simpleFormalParameter(Keyword.VAR, "b")
-    ]), null, AstFactory.blockFunctionBody2()));
+    _assertClone(AstFactory.constructorDeclaration2(
+        null,
+        null,
+        AstFactory.identifier3("C"),
+        null,
+        AstFactory.formalParameterList([
+          AstFactory.simpleFormalParameter(Keyword.VAR, "a"),
+          AstFactory.simpleFormalParameter(Keyword.VAR, "b")
+        ]),
+        null,
+        AstFactory.blockFunctionBody2()));
   }
 
   void test_visitConstructorDeclaration_named() {
-    _assertClone(AstFactory.constructorDeclaration2(null, null,
-        AstFactory.identifier3("C"), "m", AstFactory.formalParameterList(),
-        null, AstFactory.blockFunctionBody2()));
+    _assertClone(AstFactory.constructorDeclaration2(
+        null,
+        null,
+        AstFactory.identifier3("C"),
+        "m",
+        AstFactory.formalParameterList(),
+        null,
+        AstFactory.blockFunctionBody2()));
   }
 
   void test_visitConstructorDeclaration_singleInitializer() {
-    _assertClone(AstFactory.constructorDeclaration2(null, null,
-        AstFactory.identifier3("C"), null, AstFactory.formalParameterList(), [
-      AstFactory.constructorFieldInitializer(
-          false, "a", AstFactory.identifier3("b"))
-    ], AstFactory.blockFunctionBody2()));
+    _assertClone(AstFactory.constructorDeclaration2(
+        null,
+        null,
+        AstFactory.identifier3("C"),
+        null,
+        AstFactory.formalParameterList(),
+        [
+          AstFactory.constructorFieldInitializer(
+              false, "a", AstFactory.identifier3("b"))
+        ],
+        AstFactory.blockFunctionBody2()));
   }
 
   void test_visitConstructorDeclaration_withMetadata() {
     ConstructorDeclaration declaration = AstFactory.constructorDeclaration2(
-        null, null, AstFactory.identifier3("C"), null,
-        AstFactory.formalParameterList(), null,
+        null,
+        null,
+        AstFactory.identifier3("C"),
+        null,
+        AstFactory.formalParameterList(),
+        null,
         AstFactory.blockFunctionBody2());
     declaration.metadata
         .add(AstFactory.annotation(AstFactory.identifier3("deprecated")));
@@ -531,8 +625,9 @@
   }
 
   void test_visitExportDirective_combinator() {
-    _assertClone(AstFactory.exportDirective2(
-        "a.dart", [AstFactory.showCombinator([AstFactory.identifier3("A")])]));
+    _assertClone(AstFactory.exportDirective2("a.dart", [
+      AstFactory.showCombinator([AstFactory.identifier3("A")])
+    ]));
   }
 
   void test_visitExportDirective_combinators() {
@@ -585,8 +680,11 @@
   }
 
   void test_visitFieldFormalParameter_functionTyped() {
-    _assertClone(AstFactory.fieldFormalParameter(null,
-        AstFactory.typeName4("A"), "a", AstFactory
+    _assertClone(AstFactory.fieldFormalParameter(
+        null,
+        AstFactory.typeName4("A"),
+        "a",
+        AstFactory
             .formalParameterList([AstFactory.simpleFormalParameter3("b")])));
   }
 
@@ -606,17 +704,21 @@
 
   void test_visitForEachStatement_declared() {
     _assertClone(AstFactory.forEachStatement(
-        AstFactory.declaredIdentifier3("a"), AstFactory.identifier3("b"),
+        AstFactory.declaredIdentifier3("a"),
+        AstFactory.identifier3("b"),
         AstFactory.block()));
   }
 
   void test_visitForEachStatement_variable() {
-    _assertClone(new ForEachStatement.withReference(null,
+    _assertClone(new ForEachStatement.withReference(
+        null,
         TokenFactory.tokenFromKeyword(Keyword.FOR),
         TokenFactory.tokenFromType(TokenType.OPEN_PAREN),
-        AstFactory.identifier3("a"), TokenFactory.tokenFromKeyword(Keyword.IN),
+        AstFactory.identifier3("a"),
+        TokenFactory.tokenFromKeyword(Keyword.IN),
         AstFactory.identifier3("b"),
-        TokenFactory.tokenFromType(TokenType.CLOSE_PAREN), AstFactory.block()));
+        TokenFactory.tokenFromType(TokenType.CLOSE_PAREN),
+        AstFactory.block()));
   }
 
   void test_visitForEachStatement_variable_await() {
@@ -624,9 +726,11 @@
         TokenFactory.tokenFromString("await"),
         TokenFactory.tokenFromKeyword(Keyword.FOR),
         TokenFactory.tokenFromType(TokenType.OPEN_PAREN),
-        AstFactory.identifier3("a"), TokenFactory.tokenFromKeyword(Keyword.IN),
+        AstFactory.identifier3("a"),
+        TokenFactory.tokenFromKeyword(Keyword.IN),
         AstFactory.identifier3("b"),
-        TokenFactory.tokenFromType(TokenType.CLOSE_PAREN), AstFactory.block()));
+        TokenFactory.tokenFromType(TokenType.CLOSE_PAREN),
+        AstFactory.block()));
   }
 
   void test_visitFormalParameterList_empty() {
@@ -774,8 +878,10 @@
   }
 
   void test_visitForStatement_ecu() {
-    _assertClone(AstFactory.forStatement(AstFactory.identifier3("e"),
-        AstFactory.identifier3("c"), [AstFactory.identifier3("u")],
+    _assertClone(AstFactory.forStatement(
+        AstFactory.identifier3("e"),
+        AstFactory.identifier3("c"),
+        [AstFactory.identifier3("u")],
         AstFactory.block()));
   }
 
@@ -785,28 +891,39 @@
   }
 
   void test_visitForStatement_i() {
-    _assertClone(AstFactory.forStatement2(AstFactory.variableDeclarationList2(
-            Keyword.VAR, [AstFactory.variableDeclaration("i")]), null, null,
+    _assertClone(AstFactory.forStatement2(
+        AstFactory.variableDeclarationList2(
+            Keyword.VAR, [AstFactory.variableDeclaration("i")]),
+        null,
+        null,
         AstFactory.block()));
   }
 
   void test_visitForStatement_ic() {
-    _assertClone(AstFactory.forStatement2(AstFactory.variableDeclarationList2(
+    _assertClone(AstFactory.forStatement2(
+        AstFactory.variableDeclarationList2(
             Keyword.VAR, [AstFactory.variableDeclaration("i")]),
-        AstFactory.identifier3("c"), null, AstFactory.block()));
+        AstFactory.identifier3("c"),
+        null,
+        AstFactory.block()));
   }
 
   void test_visitForStatement_icu() {
-    _assertClone(AstFactory.forStatement2(AstFactory.variableDeclarationList2(
+    _assertClone(AstFactory.forStatement2(
+        AstFactory.variableDeclarationList2(
             Keyword.VAR, [AstFactory.variableDeclaration("i")]),
-        AstFactory.identifier3("c"), [AstFactory.identifier3("u")],
+        AstFactory.identifier3("c"),
+        [AstFactory.identifier3("u")],
         AstFactory.block()));
   }
 
   void test_visitForStatement_iu() {
-    _assertClone(AstFactory.forStatement2(AstFactory.variableDeclarationList2(
-            Keyword.VAR, [AstFactory.variableDeclaration("i")]), null,
-        [AstFactory.identifier3("u")], AstFactory.block()));
+    _assertClone(AstFactory.forStatement2(
+        AstFactory.variableDeclarationList2(
+            Keyword.VAR, [AstFactory.variableDeclaration("i")]),
+        null,
+        [AstFactory.identifier3("u")],
+        AstFactory.block()));
   }
 
   void test_visitForStatement_u() {
@@ -898,8 +1015,9 @@
   }
 
   void test_visitImportDirective_combinator() {
-    _assertClone(AstFactory.importDirective3("a.dart", null,
-        [AstFactory.showCombinator([AstFactory.identifier3("A")])]));
+    _assertClone(AstFactory.importDirective3("a.dart", null, [
+      AstFactory.showCombinator([AstFactory.identifier3("A")])
+    ]));
   }
 
   void test_visitImportDirective_combinators() {
@@ -918,8 +1036,9 @@
   }
 
   void test_visitImportDirective_prefix_combinator() {
-    _assertClone(AstFactory.importDirective3("a.dart", "p",
-        [AstFactory.showCombinator([AstFactory.identifier3("A")])]));
+    _assertClone(AstFactory.importDirective3("a.dart", "p", [
+      AstFactory.showCombinator([AstFactory.identifier3("A")])
+    ]));
   }
 
   void test_visitImportDirective_prefix_combinators() {
@@ -1006,10 +1125,9 @@
   }
 
   void test_visitLabeledStatement_multiple() {
-    _assertClone(AstFactory.labeledStatement([
-      AstFactory.label2("a"),
-      AstFactory.label2("b")
-    ], AstFactory.returnStatement()));
+    _assertClone(AstFactory.labeledStatement(
+        [AstFactory.label2("a"), AstFactory.label2("b")],
+        AstFactory.returnStatement()));
   }
 
   void test_visitLabeledStatement_single() {
@@ -1082,8 +1200,12 @@
   }
 
   void test_visitMethodDeclaration_external_returnType() {
-    _assertClone(AstFactory.methodDeclaration(null, AstFactory.typeName4("T"),
-        null, null, AstFactory.identifier3("m"),
+    _assertClone(AstFactory.methodDeclaration(
+        null,
+        AstFactory.typeName4("T"),
+        null,
+        null,
+        AstFactory.identifier3("m"),
         AstFactory.formalParameterList()));
   }
 
@@ -1093,74 +1215,129 @@
   }
 
   void test_visitMethodDeclaration_getter_returnType() {
-    _assertClone(AstFactory.methodDeclaration2(null, AstFactory.typeName4("T"),
-        Keyword.GET, null, AstFactory.identifier3("m"), null,
+    _assertClone(AstFactory.methodDeclaration2(
+        null,
+        AstFactory.typeName4("T"),
+        Keyword.GET,
+        null,
+        AstFactory.identifier3("m"),
+        null,
         AstFactory.blockFunctionBody2()));
   }
 
   void test_visitMethodDeclaration_getter_seturnType() {
-    _assertClone(AstFactory.methodDeclaration2(null, AstFactory.typeName4("T"),
-        Keyword.SET, null, AstFactory.identifier3("m"), AstFactory
-            .formalParameterList(
-                [AstFactory.simpleFormalParameter(Keyword.VAR, "v")]),
+    _assertClone(AstFactory.methodDeclaration2(
+        null,
+        AstFactory.typeName4("T"),
+        Keyword.SET,
+        null,
+        AstFactory.identifier3("m"),
+        AstFactory.formalParameterList(
+            [AstFactory.simpleFormalParameter(Keyword.VAR, "v")]),
         AstFactory.blockFunctionBody2()));
   }
 
   void test_visitMethodDeclaration_minimal() {
-    _assertClone(AstFactory.methodDeclaration2(null, null, null, null,
-        AstFactory.identifier3("m"), AstFactory.formalParameterList(),
+    _assertClone(AstFactory.methodDeclaration2(
+        null,
+        null,
+        null,
+        null,
+        AstFactory.identifier3("m"),
+        AstFactory.formalParameterList(),
         AstFactory.blockFunctionBody2()));
   }
 
   void test_visitMethodDeclaration_multipleParameters() {
-    _assertClone(AstFactory.methodDeclaration2(null, null, null, null,
-        AstFactory.identifier3("m"), AstFactory.formalParameterList([
-      AstFactory.simpleFormalParameter(Keyword.VAR, "a"),
-      AstFactory.simpleFormalParameter(Keyword.VAR, "b")
-    ]), AstFactory.blockFunctionBody2()));
+    _assertClone(AstFactory.methodDeclaration2(
+        null,
+        null,
+        null,
+        null,
+        AstFactory.identifier3("m"),
+        AstFactory.formalParameterList([
+          AstFactory.simpleFormalParameter(Keyword.VAR, "a"),
+          AstFactory.simpleFormalParameter(Keyword.VAR, "b")
+        ]),
+        AstFactory.blockFunctionBody2()));
   }
 
   void test_visitMethodDeclaration_operator() {
-    _assertClone(AstFactory.methodDeclaration2(null, null, null,
-        Keyword.OPERATOR, AstFactory.identifier3("+"),
-        AstFactory.formalParameterList(), AstFactory.blockFunctionBody2()));
+    _assertClone(AstFactory.methodDeclaration2(
+        null,
+        null,
+        null,
+        Keyword.OPERATOR,
+        AstFactory.identifier3("+"),
+        AstFactory.formalParameterList(),
+        AstFactory.blockFunctionBody2()));
   }
 
   void test_visitMethodDeclaration_operator_returnType() {
-    _assertClone(AstFactory.methodDeclaration2(null, AstFactory.typeName4("T"),
-        null, Keyword.OPERATOR, AstFactory.identifier3("+"),
-        AstFactory.formalParameterList(), AstFactory.blockFunctionBody2()));
+    _assertClone(AstFactory.methodDeclaration2(
+        null,
+        AstFactory.typeName4("T"),
+        null,
+        Keyword.OPERATOR,
+        AstFactory.identifier3("+"),
+        AstFactory.formalParameterList(),
+        AstFactory.blockFunctionBody2()));
   }
 
   void test_visitMethodDeclaration_returnType() {
-    _assertClone(AstFactory.methodDeclaration2(null, AstFactory.typeName4("T"),
-        null, null, AstFactory.identifier3("m"),
-        AstFactory.formalParameterList(), AstFactory.blockFunctionBody2()));
+    _assertClone(AstFactory.methodDeclaration2(
+        null,
+        AstFactory.typeName4("T"),
+        null,
+        null,
+        AstFactory.identifier3("m"),
+        AstFactory.formalParameterList(),
+        AstFactory.blockFunctionBody2()));
   }
 
   void test_visitMethodDeclaration_setter() {
-    _assertClone(AstFactory.methodDeclaration2(null, null, Keyword.SET, null,
-        AstFactory.identifier3("m"), AstFactory.formalParameterList(
+    _assertClone(AstFactory.methodDeclaration2(
+        null,
+        null,
+        Keyword.SET,
+        null,
+        AstFactory.identifier3("m"),
+        AstFactory.formalParameterList(
             [AstFactory.simpleFormalParameter(Keyword.VAR, "v")]),
         AstFactory.blockFunctionBody2()));
   }
 
   void test_visitMethodDeclaration_static() {
-    _assertClone(AstFactory.methodDeclaration2(Keyword.STATIC, null, null, null,
-        AstFactory.identifier3("m"), AstFactory.formalParameterList(),
+    _assertClone(AstFactory.methodDeclaration2(
+        Keyword.STATIC,
+        null,
+        null,
+        null,
+        AstFactory.identifier3("m"),
+        AstFactory.formalParameterList(),
         AstFactory.blockFunctionBody2()));
   }
 
   void test_visitMethodDeclaration_static_returnType() {
-    _assertClone(AstFactory.methodDeclaration2(Keyword.STATIC,
-        AstFactory.typeName4("T"), null, null, AstFactory.identifier3("m"),
-        AstFactory.formalParameterList(), AstFactory.blockFunctionBody2()));
+    _assertClone(AstFactory.methodDeclaration2(
+        Keyword.STATIC,
+        AstFactory.typeName4("T"),
+        null,
+        null,
+        AstFactory.identifier3("m"),
+        AstFactory.formalParameterList(),
+        AstFactory.blockFunctionBody2()));
   }
 
   void test_visitMethodDeclaration_withMetadata() {
-    MethodDeclaration declaration = AstFactory.methodDeclaration2(null, null,
-        null, null, AstFactory.identifier3("m"),
-        AstFactory.formalParameterList(), AstFactory.blockFunctionBody2());
+    MethodDeclaration declaration = AstFactory.methodDeclaration2(
+        null,
+        null,
+        null,
+        null,
+        AstFactory.identifier3("m"),
+        AstFactory.formalParameterList(),
+        AstFactory.blockFunctionBody2());
     declaration.metadata
         .add(AstFactory.annotation(AstFactory.identifier3("deprecated")));
     _assertClone(declaration);
@@ -1317,10 +1494,10 @@
   }
 
   void test_visitSwitchCase_multipleLabels() {
-    _assertClone(AstFactory.switchCase2([
-      AstFactory.label2("l1"),
-      AstFactory.label2("l2")
-    ], AstFactory.identifier3("a"), [AstFactory.block()]));
+    _assertClone(AstFactory.switchCase2(
+        [AstFactory.label2("l1"), AstFactory.label2("l2")],
+        AstFactory.identifier3("a"),
+        [AstFactory.block()]));
   }
 
   void test_visitSwitchCase_multipleStatements() {
@@ -1339,10 +1516,9 @@
   }
 
   void test_visitSwitchDefault_multipleLabels() {
-    _assertClone(AstFactory.switchDefault([
-      AstFactory.label2("l1"),
-      AstFactory.label2("l2")
-    ], [AstFactory.block()]));
+    _assertClone(AstFactory.switchDefault(
+        [AstFactory.label2("l1"), AstFactory.label2("l2")],
+        [AstFactory.block()]));
   }
 
   void test_visitSwitchDefault_multipleStatements() {
@@ -1407,7 +1583,8 @@
   }
 
   void test_visitTryStatement_catchFinally() {
-    _assertClone(AstFactory.tryStatement3(AstFactory.block(),
+    _assertClone(AstFactory.tryStatement3(
+        AstFactory.block(),
         [AstFactory.catchClause3(AstFactory.typeName4("E"))],
         AstFactory.block()));
   }
@@ -1432,8 +1609,9 @@
   }
 
   void test_visitTypeName_nestedArg() {
-    _assertClone(AstFactory.typeName4(
-        "C", [AstFactory.typeName4("D", [AstFactory.typeName4("E")])]));
+    _assertClone(AstFactory.typeName4("C", [
+      AstFactory.typeName4("D", [AstFactory.typeName4("E")])
+    ]));
   }
 
   void test_visitTypeName_noArgs() {
@@ -1477,8 +1655,8 @@
   }
 
   void test_visitVariableDeclarationList_const_type() {
-    _assertClone(AstFactory.variableDeclarationList(Keyword.CONST,
-        AstFactory.typeName4("C"), [
+    _assertClone(AstFactory.variableDeclarationList(
+        Keyword.CONST, AstFactory.typeName4("C"), [
       AstFactory.variableDeclaration("a"),
       AstFactory.variableDeclaration("b")
     ]));
@@ -1503,8 +1681,8 @@
   }
 
   void test_visitVariableDeclarationList_type() {
-    _assertClone(AstFactory.variableDeclarationList(null,
-        AstFactory.typeName4("C"), [
+    _assertClone(AstFactory.variableDeclarationList(
+        null, AstFactory.typeName4("C"), [
       AstFactory.variableDeclaration("a"),
       AstFactory.variableDeclaration("b")
     ]));
@@ -2738,6 +2916,12 @@
   Statement get(WhileStatement node) => node.body;
 }
 
+class Getter_NodeReplacerTest_test_yieldStatement
+    implements NodeReplacerTest_Getter {
+  @override
+  Expression get(YieldStatement node) => node.expression;
+}
+
 class Getter_NodeReplacerTest_testAnnotatedNode
     implements NodeReplacerTest_Getter {
   @override
@@ -2768,12 +2952,6 @@
   StringLiteral get(UriBasedDirective node) => node.uri;
 }
 
-class Getter_NodeReplacerTest_test_yieldStatement
-    implements NodeReplacerTest_Getter {
-  @override
-  Expression get(YieldStatement node) => node.expression;
-}
-
 @reflectiveTest
 class LineInfoTest {
   void test_creation() {
@@ -2885,7 +3063,8 @@
 }
 
 class ListGetter_NodeReplacerTest_test_compilationUnit_2
-    extends NodeReplacerTest_ListGetter<CompilationUnit, CompilationUnitMember> {
+    extends NodeReplacerTest_ListGetter<CompilationUnit,
+        CompilationUnitMember> {
   ListGetter_NodeReplacerTest_test_compilationUnit_2(int arg0) : super(arg0);
 
   @override
@@ -2894,7 +3073,8 @@
 }
 
 class ListGetter_NodeReplacerTest_test_constructorDeclaration
-    extends NodeReplacerTest_ListGetter<ConstructorDeclaration, ConstructorInitializer> {
+    extends NodeReplacerTest_ListGetter<ConstructorDeclaration,
+        ConstructorInitializer> {
   ListGetter_NodeReplacerTest_test_constructorDeclaration(int arg0)
       : super(arg0);
 
@@ -2987,7 +3167,8 @@
 }
 
 class ListGetter_NodeReplacerTest_test_stringInterpolation
-    extends NodeReplacerTest_ListGetter<StringInterpolation, InterpolationElement> {
+    extends NodeReplacerTest_ListGetter<StringInterpolation,
+        InterpolationElement> {
   ListGetter_NodeReplacerTest_test_stringInterpolation(int arg0) : super(arg0);
 
   @override
@@ -3029,7 +3210,8 @@
 }
 
 class ListGetter_NodeReplacerTest_test_variableDeclarationList
-    extends NodeReplacerTest_ListGetter<VariableDeclarationList, VariableDeclaration> {
+    extends NodeReplacerTest_ListGetter<VariableDeclarationList,
+        VariableDeclaration> {
   ListGetter_NodeReplacerTest_test_variableDeclarationList(int arg0)
       : super(arg0);
 
@@ -3254,7 +3436,8 @@
   }
 
   void test_annotation() {
-    Annotation node = AstFactory.annotation2(AstFactory.identifier3("C"),
+    Annotation node = AstFactory.annotation2(
+        AstFactory.identifier3("C"),
         AstFactory.identifier3("c"),
         AstFactory.argumentList([AstFactory.integer(0)]));
     _assertReplace(node, new Getter_NodeReplacerTest_test_annotation());
@@ -3268,7 +3451,8 @@
   }
 
   void test_asExpression() {
-    AsExpression node = AstFactory.asExpression(AstFactory.integer(0),
+    AsExpression node = AstFactory.asExpression(
+        AstFactory.integer(0),
         AstFactory.typeName3(
             AstFactory.identifier3("a"), [AstFactory.typeName4("C")]));
     _assertReplace(node, new Getter_NodeReplacerTest_test_asExpression_2());
@@ -3297,7 +3481,8 @@
 
   void test_binaryExpression() {
     BinaryExpression node = AstFactory.binaryExpression(
-        AstFactory.identifier3("l"), TokenType.PLUS,
+        AstFactory.identifier3("l"),
+        TokenType.PLUS,
         AstFactory.identifier3("r"));
     _assertReplace(node, new Getter_NodeReplacerTest_test_binaryExpression());
     _assertReplace(node, new Getter_NodeReplacerTest_test_binaryExpression_2());
@@ -3335,7 +3520,9 @@
   }
 
   void test_classDeclaration() {
-    ClassDeclaration node = AstFactory.classDeclaration(null, "A",
+    ClassDeclaration node = AstFactory.classDeclaration(
+        null,
+        "A",
         AstFactory.typeParameterList(["E"]),
         AstFactory.extendsClause(AstFactory.typeName4("B")),
         AstFactory.withClause([AstFactory.typeName4("C")]),
@@ -3359,8 +3546,11 @@
   }
 
   void test_classTypeAlias() {
-    ClassTypeAlias node = AstFactory.classTypeAlias("A",
-        AstFactory.typeParameterList(["E"]), null, AstFactory.typeName4("B"),
+    ClassTypeAlias node = AstFactory.classTypeAlias(
+        "A",
+        AstFactory.typeParameterList(["E"]),
+        null,
+        AstFactory.typeName4("B"),
         AstFactory.withClause([AstFactory.typeName4("C")]),
         AstFactory.implementsClause([AstFactory.typeName4("D")]));
     node.documentationComment =
@@ -3388,8 +3578,9 @@
   }
 
   void test_compilationUnit() {
-    CompilationUnit node = AstFactory.compilationUnit8("",
-        [AstFactory.libraryDirective2("lib")], [
+    CompilationUnit node = AstFactory.compilationUnit8("", [
+      AstFactory.libraryDirective2("lib")
+    ], [
       AstFactory.topLevelVariableDeclaration2(
           null, [AstFactory.variableDeclaration("X")])
     ]);
@@ -3402,7 +3593,8 @@
 
   void test_conditionalExpression() {
     ConditionalExpression node = AstFactory.conditionalExpression(
-        AstFactory.booleanLiteral(true), AstFactory.integer(0),
+        AstFactory.booleanLiteral(true),
+        AstFactory.integer(0),
         AstFactory.integer(1));
     _assertReplace(
         node, new Getter_NodeReplacerTest_test_conditionalExpression_3());
@@ -3413,10 +3605,17 @@
   }
 
   void test_constructorDeclaration() {
-    ConstructorDeclaration node = AstFactory.constructorDeclaration2(null, null,
-        AstFactory.identifier3("C"), "d", AstFactory.formalParameterList(), [
-      AstFactory.constructorFieldInitializer(false, "x", AstFactory.integer(0))
-    ], AstFactory.emptyFunctionBody());
+    ConstructorDeclaration node = AstFactory.constructorDeclaration2(
+        null,
+        null,
+        AstFactory.identifier3("C"),
+        "d",
+        AstFactory.formalParameterList(),
+        [
+          AstFactory.constructorFieldInitializer(
+              false, "x", AstFactory.integer(0))
+        ],
+        AstFactory.emptyFunctionBody());
     node.documentationComment =
         Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
     node.metadata.add(AstFactory.annotation(AstFactory.identifier3("a")));
@@ -3506,8 +3705,9 @@
   }
 
   void test_exportDirective() {
-    ExportDirective node =
-        AstFactory.exportDirective2("", [AstFactory.hideCombinator2(["C"])]);
+    ExportDirective node = AstFactory.exportDirective2("", [
+      AstFactory.hideCombinator2(["C"])
+    ]);
     node.documentationComment =
         Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
     node.metadata.add(AstFactory.annotation(AstFactory.identifier3("a")));
@@ -3558,7 +3758,8 @@
 
   void test_forEachStatement_withIdentifier() {
     ForEachStatement node = AstFactory.forEachStatement2(
-        AstFactory.identifier3("i"), AstFactory.identifier3("l"),
+        AstFactory.identifier3("i"),
+        AstFactory.identifier3("l"),
         AstFactory.block());
     _assertReplace(node,
         new Getter_NodeReplacerTest_test_forEachStatement_withIdentifier_2());
@@ -3570,7 +3771,8 @@
 
   void test_forEachStatement_withLoopVariable() {
     ForEachStatement node = AstFactory.forEachStatement(
-        AstFactory.declaredIdentifier3("e"), AstFactory.identifier3("l"),
+        AstFactory.declaredIdentifier3("e"),
+        AstFactory.identifier3("l"),
         AstFactory.block());
     _assertReplace(node,
         new Getter_NodeReplacerTest_test_forEachStatement_withLoopVariable_2());
@@ -3588,8 +3790,10 @@
   }
 
   void test_forStatement_withInitialization() {
-    ForStatement node = AstFactory.forStatement(AstFactory.identifier3("a"),
-        AstFactory.booleanLiteral(true), [AstFactory.integer(0)],
+    ForStatement node = AstFactory.forStatement(
+        AstFactory.identifier3("a"),
+        AstFactory.booleanLiteral(true),
+        [AstFactory.integer(0)],
         AstFactory.block());
     _assertReplace(node,
         new Getter_NodeReplacerTest_test_forStatement_withInitialization_3());
@@ -3597,16 +3801,18 @@
         new Getter_NodeReplacerTest_test_forStatement_withInitialization_2());
     _assertReplace(node,
         new Getter_NodeReplacerTest_test_forStatement_withInitialization());
-    _assertReplace(node,
+    _assertReplace(
+        node,
         new ListGetter_NodeReplacerTest_test_forStatement_withInitialization(
             0));
   }
 
   void test_forStatement_withVariables() {
-    ForStatement node = AstFactory.forStatement2(AstFactory
-            .variableDeclarationList2(
-                null, [AstFactory.variableDeclaration("i")]),
-        AstFactory.booleanLiteral(true), [AstFactory.integer(0)],
+    ForStatement node = AstFactory.forStatement2(
+        AstFactory.variableDeclarationList2(
+            null, [AstFactory.variableDeclaration("i")]),
+        AstFactory.booleanLiteral(true),
+        [AstFactory.integer(0)],
         AstFactory.block());
     _assertReplace(
         node, new Getter_NodeReplacerTest_test_forStatement_withVariables_2());
@@ -3620,8 +3826,10 @@
 
   void test_functionDeclaration() {
     FunctionDeclaration node = AstFactory.functionDeclaration(
-        AstFactory.typeName4("R"), null, "f", AstFactory.functionExpression2(
-            AstFactory.formalParameterList(),
+        AstFactory.typeName4("R"),
+        null,
+        "f",
+        AstFactory.functionExpression2(AstFactory.formalParameterList(),
             AstFactory.blockFunctionBody(AstFactory.block())));
     node.documentationComment =
         Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
@@ -3637,8 +3845,10 @@
 
   void test_functionDeclarationStatement() {
     FunctionDeclarationStatement node = AstFactory.functionDeclarationStatement(
-        AstFactory.typeName4("R"), null, "f", AstFactory.functionExpression2(
-            AstFactory.formalParameterList(),
+        AstFactory.typeName4("R"),
+        null,
+        "f",
+        AstFactory.functionExpression2(AstFactory.formalParameterList(),
             AstFactory.blockFunctionBody(AstFactory.block())));
     _assertReplace(
         node, new Getter_NodeReplacerTest_test_functionDeclarationStatement());
@@ -3663,8 +3873,10 @@
   }
 
   void test_functionTypeAlias() {
-    FunctionTypeAlias node = AstFactory.typeAlias(AstFactory.typeName4("R"),
-        "F", AstFactory.typeParameterList(["E"]),
+    FunctionTypeAlias node = AstFactory.typeAlias(
+        AstFactory.typeName4("R"),
+        "F",
+        AstFactory.typeParameterList(["E"]),
         AstFactory.formalParameterList());
     node.documentationComment =
         Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
@@ -3681,7 +3893,8 @@
 
   void test_functionTypedFormalParameter() {
     FunctionTypedFormalParameter node = AstFactory.functionTypedFormalParameter(
-        AstFactory.typeName4("R"), "f",
+        AstFactory.typeName4("R"),
+        "f",
         [AstFactory.simpleFormalParameter3("p")]);
     node.documentationComment =
         Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
@@ -3784,7 +3997,8 @@
   }
 
   void test_listLiteral() {
-    ListLiteral node = AstFactory.listLiteral2(null,
+    ListLiteral node = AstFactory.listLiteral2(
+        null,
         AstFactory.typeArgumentList([AstFactory.typeName4("E")]),
         [AstFactory.identifier3("e")]);
     _assertReplace(node, new ListGetter_NodeReplacerTest_test_listLiteral(0));
@@ -3792,7 +4006,8 @@
   }
 
   void test_mapLiteral() {
-    MapLiteral node = AstFactory.mapLiteral(null,
+    MapLiteral node = AstFactory.mapLiteral(
+        null,
         AstFactory.typeArgumentList([AstFactory.typeName4("E")]),
         [AstFactory.mapLiteralEntry("k", AstFactory.identifier3("v"))]);
     _assertReplace(node, new ListGetter_NodeReplacerTest_test_mapLiteral(0));
@@ -3807,8 +4022,12 @@
   }
 
   void test_methodDeclaration() {
-    MethodDeclaration node = AstFactory.methodDeclaration2(null,
-        AstFactory.typeName4("A"), null, null, AstFactory.identifier3("m"),
+    MethodDeclaration node = AstFactory.methodDeclaration2(
+        null,
+        AstFactory.typeName4("A"),
+        null,
+        null,
+        AstFactory.identifier3("m"),
         AstFactory.formalParameterList(),
         AstFactory.blockFunctionBody(AstFactory.block()));
     node.documentationComment =
@@ -3961,8 +4180,8 @@
   }
 
   void test_switchStatement() {
-    SwitchStatement node = AstFactory.switchStatement(
-        AstFactory.identifier3("x"), [
+    SwitchStatement node =
+        AstFactory.switchStatement(AstFactory.identifier3("x"), [
       AstFactory.switchCase2([AstFactory.label2("l")], AstFactory.integer(0),
           [AstFactory.block()]),
       AstFactory.switchDefault([AstFactory.label2("l")], [AstFactory.block()])
@@ -3990,8 +4209,11 @@
   }
 
   void test_tryStatement() {
-    TryStatement node = AstFactory.tryStatement3(AstFactory.block(),
-        [AstFactory.catchClause("e", [AstFactory.block()])],
+    TryStatement node = AstFactory.tryStatement3(
+        AstFactory.block(),
+        [
+          AstFactory.catchClause("e", [AstFactory.block()])
+        ],
         AstFactory.block());
     _assertReplace(node, new Getter_NodeReplacerTest_test_tryStatement_2());
     _assertReplace(node, new Getter_NodeReplacerTest_test_tryStatement());
@@ -4066,6 +4288,11 @@
     _assertReplace(node, new ListGetter_NodeReplacerTest_test_withClause(0));
   }
 
+  void test_yieldStatement() {
+    var node = AstFactory.yieldStatement(AstFactory.identifier3("A"));
+    _assertReplace(node, new Getter_NodeReplacerTest_test_yieldStatement());
+  }
+
   void _assertReplace(AstNode parent, NodeReplacerTest_Getter getter) {
     AstNode child = getter.get(parent);
     if (child != null) {
@@ -4109,11 +4336,6 @@
     _assertReplace(node, new Getter_NodeReplacerTest_testUriBasedDirective());
     _testAnnotatedNode(node);
   }
-
-  void test_yieldStatement() {
-    var node = AstFactory.yieldStatement(AstFactory.identifier3("A"));
-    _assertReplace(node, new Getter_NodeReplacerTest_test_yieldStatement());
-  }
 }
 
 abstract class NodeReplacerTest_Getter<P, C> {
@@ -4449,7 +4671,8 @@
   }
 
   void test_printListOfQuotedNames_five() {
-    expect(StringUtilities
+    expect(
+        StringUtilities
             .printListOfQuotedNames(<String>["a", "b", "c", "d", "e"]),
         "'a', 'b', 'c', 'd' and 'e'");
   }
@@ -4522,28 +4745,46 @@
     expect(
         StringUtilities.startsWith5("abcde", 0, 0x61, 0x62, 0x63, 0x64, 0x65),
         isTrue);
-    expect(StringUtilities.startsWith5(
-        "abcdefghi", 0, 0x61, 0x62, 0x63, 0x64, 0x65), isTrue);
-    expect(StringUtilities.startsWith5(
-        "abcdefghi", 2, 0x63, 0x64, 0x65, 0x66, 0x67), isTrue);
-    expect(StringUtilities.startsWith5(
-        "abcdefghi", 4, 0x65, 0x66, 0x67, 0x68, 0x69), isTrue);
-    expect(StringUtilities.startsWith5(
-        "abcdefghi", 0, 0x61, 0x62, 0x63, 0x62, 0x61), isFalse);
+    expect(
+        StringUtilities.startsWith5(
+            "abcdefghi", 0, 0x61, 0x62, 0x63, 0x64, 0x65),
+        isTrue);
+    expect(
+        StringUtilities.startsWith5(
+            "abcdefghi", 2, 0x63, 0x64, 0x65, 0x66, 0x67),
+        isTrue);
+    expect(
+        StringUtilities.startsWith5(
+            "abcdefghi", 4, 0x65, 0x66, 0x67, 0x68, 0x69),
+        isTrue);
+    expect(
+        StringUtilities.startsWith5(
+            "abcdefghi", 0, 0x61, 0x62, 0x63, 0x62, 0x61),
+        isFalse);
     // missing
   }
 
   void test_startsWith6() {
-    expect(StringUtilities.startsWith6(
-        "abcdef", 0, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66), isTrue);
-    expect(StringUtilities.startsWith6(
-        "abcdefghi", 0, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66), isTrue);
-    expect(StringUtilities.startsWith6(
-        "abcdefghi", 2, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68), isTrue);
-    expect(StringUtilities.startsWith6(
-        "abcdefghi", 3, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69), isTrue);
-    expect(StringUtilities.startsWith6(
-        "abcdefghi", 0, 0x61, 0x62, 0x63, 0x64, 0x65, 0x67), isFalse);
+    expect(
+        StringUtilities.startsWith6(
+            "abcdef", 0, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66),
+        isTrue);
+    expect(
+        StringUtilities.startsWith6(
+            "abcdefghi", 0, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66),
+        isTrue);
+    expect(
+        StringUtilities.startsWith6(
+            "abcdefghi", 2, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68),
+        isTrue);
+    expect(
+        StringUtilities.startsWith6(
+            "abcdefghi", 3, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69),
+        isTrue);
+    expect(
+        StringUtilities.startsWith6(
+            "abcdefghi", 0, 0x61, 0x62, 0x63, 0x64, 0x65, 0x67),
+        isFalse);
     // missing
   }
 
diff --git a/pkg/analyzer/test/instrumentation/instrumentation_test.dart b/pkg/analyzer/test/instrumentation/instrumentation_test.dart
index b1c263d..290b71a 100644
--- a/pkg/analyzer/test/instrumentation/instrumentation_test.dart
+++ b/pkg/analyzer/test/instrumentation/instrumentation_test.dart
@@ -73,9 +73,12 @@
     String level = 'level';
     DateTime time = new DateTime(2001);
     String message = 'message';
-    service.logLogEntry(level, time, message);
+    String exception = 'exception';
+    String stackTraceText = 'stackTrace';
+    StackTrace stackTrace = new StackTrace.fromString(stackTraceText);
+    service.logLogEntry(level, time, message, exception, stackTrace);
     assertNormal(server, InstrumentationService.TAG_LOG_ENTRY,
-        '$level:${time.millisecondsSinceEpoch}:$message');
+        '$level:${time.millisecondsSinceEpoch}:$message:$exception:$stackTraceText');
   }
 
   void test_logNotification() {
@@ -108,8 +111,10 @@
     service.logVersion('myUuid', 'someClientId', 'someClientVersion',
         'aServerVersion', 'anSdkVersion');
     expect(server.normalChannel.toString(), '');
-    expect(server.priorityChannel.toString(), endsWith(
-        ':myUuid:someClientId:someClientVersion:aServerVersion:anSdkVersion\n'));
+    expect(
+        server.priorityChannel.toString(),
+        endsWith(
+            ':myUuid:someClientId:someClientVersion:aServerVersion:anSdkVersion\n'));
   }
 }
 
diff --git a/pkg/analyzer/test/parse_compilation_unit_test.dart b/pkg/analyzer/test/parse_compilation_unit_test.dart
index 0e2d3de..71e4838 100644
--- a/pkg/analyzer/test/parse_compilation_unit_test.dart
+++ b/pkg/analyzer/test/parse_compilation_unit_test.dart
@@ -7,7 +7,10 @@
 import 'package:analyzer/analyzer.dart';
 import 'package:unittest/unittest.dart';
 
+import 'utils.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!');"));
@@ -37,6 +40,6 @@
   test("allows you to specify whether or not to parse function bodies", () {
     var unit = parseCompilationUnit("void main() => print('Hello, world!');",
         parseFunctionBodies: false);
-    expect(unit.toString(), equals("void main() ;"));
+    expect(unit.toString(), equals("void main();"));
   });
 }
diff --git a/pkg/analyzer/test/source/analysis_options_provider_test.dart b/pkg/analyzer/test/source/analysis_options_provider_test.dart
index 9033c8c..4cf41fd 100644
--- a/pkg/analyzer/test/source/analysis_options_provider_test.dart
+++ b/pkg/analyzer/test/source/analysis_options_provider_test.dart
@@ -9,8 +9,10 @@
 import 'package:unittest/unittest.dart';
 import 'package:yaml/yaml.dart';
 
+import '../utils.dart';
+
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   group('AnalysisOptionsProvider', () {
     setUp(() {
       buildResourceProvider();
@@ -39,20 +41,63 @@
       expect(options.length, equals(0));
     });
   });
+  group('AnalysisOptionsProvider', () {
+    setUp(() {
+      buildResourceProvider(emptyAnalysisOptions: true);
+    });
+    tearDown(() {
+      clearResourceProvider();
+    });
+    test('test_empty', () {
+      var optionsProvider = new AnalysisOptionsProvider();
+      Map<String, YamlNode> options =
+          optionsProvider.getOptions(resourceProvider.getFolder('/'));
+      expect(options, isNotNull);
+    });
+  });
+  group('AnalysisOptionsProvider', () {
+    setUp(() {
+      buildResourceProvider(badAnalysisOptions: true);
+    });
+    tearDown(() {
+      clearResourceProvider();
+    });
+    test('test_invalid', () {
+      var optionsProvider = new AnalysisOptionsProvider();
+      bool exceptionCaught = false;
+      try {
+        Map<String, YamlNode> options =
+            optionsProvider.getOptions(resourceProvider.getFolder('/'));
+        expect(options, isNotNull);
+      } catch (e) {
+        exceptionCaught = true;
+      }
+      expect(exceptionCaught, isTrue);
+    });
+  });
 }
 
 MemoryResourceProvider resourceProvider;
 
-buildResourceProvider() {
+buildResourceProvider({bool emptyAnalysisOptions : false,
+                       bool badAnalysisOptions : false}) {
   resourceProvider = new MemoryResourceProvider();
   resourceProvider.newFolder('/empty');
   resourceProvider.newFolder('/tmp');
-  resourceProvider.newFile('/.analysis_options', r'''
+  if (badAnalysisOptions) {
+    resourceProvider.newFile('/.analysis_options', r''':''');
+  } else if (emptyAnalysisOptions) {
+    resourceProvider.newFile('/.analysis_options', r'''#empty''');
+  } else {
+    resourceProvider.newFile(
+      '/.analysis_options',
+      r'''
 analyzer:
   ignore:
     - ignoreme.dart
     - 'sdk_ext/**'
 ''');
+  }
 }
 
 clearResourceProvider() {
diff --git a/pkg/analyzer/test/source/package_map_provider_test.dart b/pkg/analyzer/test/source/package_map_provider_test.dart
index ea7987b..af5bedf 100644
--- a/pkg/analyzer/test/source/package_map_provider_test.dart
+++ b/pkg/analyzer/test/source/package_map_provider_test.dart
@@ -11,8 +11,10 @@
 import 'package:analyzer/src/generated/sdk_io.dart';
 import 'package:unittest/unittest.dart';
 
+import '../utils.dart';
+
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
 
   group('PubPackageMapProvider', () {
     group('parsePackageMap', () {
@@ -36,8 +38,9 @@
         String packageName = 'foo';
         String folderPath = '/path/to/folder';
         resourceProvider.newFolder(folderPath);
-        Map<String, List<Folder>> result =
-            parsePackageMap({'packages': {packageName: folderPath}}).packageMap;
+        Map<String, List<Folder>> result = parsePackageMap({
+          'packages': {packageName: folderPath}
+        }).packageMap;
         expect(result, hasLength(1));
         expect(result.keys, contains(packageName));
         expect(result[packageName], hasLength(1));
@@ -48,8 +51,9 @@
       test("don't ignore nonexistent folder", () {
         String packageName = 'foo';
         String folderPath = '/path/to/folder';
-        Map<String, List<Folder>> result =
-            parsePackageMap({'packages': {packageName: folderPath}}).packageMap;
+        Map<String, List<Folder>> result = parsePackageMap({
+          'packages': {packageName: folderPath}
+        }).packageMap;
         expect(result, hasLength(1));
         expect(result.keys, contains(packageName));
         expect(result[packageName], hasLength(1));
@@ -63,8 +67,11 @@
         String folderPath2 = '/path/to/folder2';
         resourceProvider.newFolder(folderPath1);
         resourceProvider.newFolder(folderPath2);
-        Map<String, List<Folder>> result = parsePackageMap(
-            {'packages': {packageName: [folderPath1, folderPath2]}}).packageMap;
+        Map<String, List<Folder>> result = parsePackageMap({
+          'packages': {
+            packageName: [folderPath1, folderPath2]
+          }
+        }).packageMap;
         expect(result, hasLength(1));
         expect(result.keys, contains(packageName));
         expect(result[packageName], hasLength(2));
@@ -79,8 +86,10 @@
         String path2 = '/path/to/folder2/pubspec.lock';
         resourceProvider.newFile(path1, '...');
         resourceProvider.newFile(path2, '...');
-        Set<String> dependencies = parsePackageMap(
-            {'packages': {}, 'input_files': [path1, path2]}).dependencies;
+        Set<String> dependencies = parsePackageMap({
+          'packages': {},
+          'input_files': [path1, path2]
+        }).dependencies;
         expect(dependencies, hasLength(2));
         expect(dependencies, contains(path1));
         expect(dependencies, contains(path2));
@@ -92,8 +101,11 @@
         String packageName = 'foo';
         resourceProvider.newFolder(projectPath);
         resourceProvider.newFolder(packagePath);
-        Map<String, List<Folder>> result = parsePackageMap(
-            {'packages': {packageName: [relativePackagePath]}}).packageMap;
+        Map<String, List<Folder>> result = parsePackageMap({
+          'packages': {
+            packageName: [relativePackagePath]
+          }
+        }).packageMap;
         expect(result[packageName][0].path, equals(packagePath));
       });
 
diff --git a/pkg/analyzer/test/source/package_map_resolver_test.dart b/pkg/analyzer/test/source/package_map_resolver_test.dart
index c892947..caf88da 100644
--- a/pkg/analyzer/test/source/package_map_resolver_test.dart
+++ b/pkg/analyzer/test/source/package_map_resolver_test.dart
@@ -12,9 +12,10 @@
 import 'package:unittest/unittest.dart';
 
 import '../reflective_tests.dart';
+import '../utils.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   runReflectiveTests(_PackageMapUriResolverTest);
 }
 
@@ -58,8 +59,8 @@
     const pkgFileB = '/part2/lib/libB.dart';
     provider.newFile(pkgFileA, 'library lib_a');
     provider.newFile(pkgFileB, 'library lib_b');
-    PackageMapUriResolver resolver = new PackageMapUriResolver(provider,
-        <String, List<Folder>>{
+    PackageMapUriResolver resolver =
+        new PackageMapUriResolver(provider, <String, List<Folder>>{
       'pkg': [
         provider.getResource('/part1/lib/'),
         provider.getResource('/part2/lib/')
@@ -95,8 +96,8 @@
     const pkgFileB = '/pkgB/lib/libB.dart';
     provider.newFile(pkgFileA, 'library lib_a;');
     provider.newFile(pkgFileB, 'library lib_b;');
-    PackageMapUriResolver resolver = new PackageMapUriResolver(provider,
-        <String, List<Folder>>{
+    PackageMapUriResolver resolver =
+        new PackageMapUriResolver(provider, <String, List<Folder>>{
       'pkgA': [provider.getResource('/pkgA/lib/')],
       'pkgB': [provider.getResource('/pkgB/lib/')]
     });
@@ -154,8 +155,8 @@
     const pkgFileB = '/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>>{
+    PackageMapUriResolver resolver =
+        new PackageMapUriResolver(provider, <String, List<Folder>>{
       'pkgA': [provider.getResource('/pkgA/lib/')],
       'pkgB': [provider.getResource('/pkgB/lib/')]
     });
@@ -183,8 +184,8 @@
     const file2 = '/foo2/lib/bar.dart';
     provider.newFile(file1, 'library bar');
     provider.newFile(file2, 'library bar');
-    PackageMapUriResolver resolver = new PackageMapUriResolver(provider,
-        <String, List<Folder>>{
+    PackageMapUriResolver resolver =
+        new PackageMapUriResolver(provider, <String, List<Folder>>{
       'foo': [
         provider.getResource('/foo1/lib'),
         provider.getResource('/foo2/lib')
@@ -207,8 +208,8 @@
     const file2 = '/foo2/bar2/lib.dart';
     provider.newFile(file1, 'library lib');
     provider.newFile(file2, 'library lib');
-    PackageMapUriResolver resolver = new PackageMapUriResolver(provider,
-        <String, List<Folder>>{
+    PackageMapUriResolver resolver =
+        new PackageMapUriResolver(provider, <String, List<Folder>>{
       'pkg1': [
         provider.getResource('/foo1'),
         provider.getResource('/foo2/bar2')
diff --git a/pkg/analyzer/test/source/path_filter_test.dart b/pkg/analyzer/test/source/path_filter_test.dart
index 4542e99..a7e58fb 100644
--- a/pkg/analyzer/test/source/path_filter_test.dart
+++ b/pkg/analyzer/test/source/path_filter_test.dart
@@ -8,43 +8,46 @@
 import 'package:path/path.dart';
 import 'package:unittest/unittest.dart';
 
+import '../utils.dart';
+
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
+  String root(String path) => context.absolute(context.normalize(path));
   group('PathFilterTest', () {
     setUp(() {});
     tearDown(() {});
     test('test_ignoreEverything', () {
-      var filter = new PathFilter(context, '/', ['*']);
+      var filter = new PathFilter(root('/'), ['*'], context);
       expect(filter.ignored('a'), isTrue);
     });
     test('test_ignoreFile', () {
-      var filter = new PathFilter(context, '/', ['apple']);
+      var filter = new PathFilter(root('/'), ['apple'], context);
       expect(filter.ignored('apple'), isTrue);
       expect(filter.ignored('banana'), isFalse);
     });
     test('test_ignoreMultipleFiles', () {
-      var filter = new PathFilter(context, '/', ['apple', 'banana']);
+      var filter = new PathFilter(root('/'), ['apple', 'banana'], context);
       expect(filter.ignored('apple'), isTrue);
       expect(filter.ignored('banana'), isTrue);
     });
     test('test_ignoreSubDir', () {
-      var filter = new PathFilter(context, '/', ['apple/*']);
+      var filter = new PathFilter(root('/'), ['apple/*'], context);
       expect(filter.ignored('apple/banana'), isTrue);
       expect(filter.ignored('apple/banana/cantaloupe'), isFalse);
     });
     test('test_ignoreTree', () {
-      var filter = new PathFilter(context, '/', ['apple/**']);
+      var filter = new PathFilter(root('/'), ['apple/**'], context);
       expect(filter.ignored('apple/banana'), isTrue);
       expect(filter.ignored('apple/banana/cantaloupe'), isTrue);
     });
     test('test_ignoreSdkExt', () {
-      var filter = new PathFilter(context, '/', ['sdk_ext/**']);
+      var filter = new PathFilter(root('/'), ['sdk_ext/**'], context);
       expect(filter.ignored('sdk_ext/entry.dart'), isTrue);
       expect(filter.ignored('sdk_ext/lib/src/part.dart'), isTrue);
     });
     test('test_outsideRoot', () {
       var filter =
-          new PathFilter(context, '/workspace/dart/sdk', ['sdk_ext/**']);
+          new PathFilter(root('/workspace/dart/sdk'), ['sdk_ext/**'], context);
       expect(filter.ignored('/'), isTrue);
       expect(filter.ignored('/workspace'), isTrue);
       expect(filter.ignored('/workspace/dart'), isTrue);
@@ -53,7 +56,7 @@
     });
     test('test_relativePaths', () {
       var filter =
-          new PathFilter(context, '/workspace/dart/sdk', ['sdk_ext/**']);
+          new PathFilter(root('/workspace/dart/sdk'), ['sdk_ext/**'], context);
       expect(filter.ignored('../apple'), isTrue);
       expect(filter.ignored('../sdk/main.dart'), isFalse);
       expect(filter.ignored('../sdk/sdk_ext/entry.dart'), isTrue);
diff --git a/pkg/analyzer/test/source/sdk_ext_test.dart b/pkg/analyzer/test/source/sdk_ext_test.dart
index 288fe37..01416af 100644
--- a/pkg/analyzer/test/source/sdk_ext_test.dart
+++ b/pkg/analyzer/test/source/sdk_ext_test.dart
@@ -8,8 +8,10 @@
 import 'package:analyzer/source/sdk_ext.dart';
 import 'package:unittest/unittest.dart';
 
+import '../utils.dart';
+
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   group('SdkExtUriResolverTest', () {
     setUp(() {
       buildResourceProvider();
@@ -58,20 +60,6 @@
       expect(restoreUri.scheme, equals('dart'));
       expect(restoreUri.path, equals('fox'));
     });
-    test('test_resolvePart', () {
-      var resolver = new SdkExtUriResolver({
-        'fox': [resourceProvider.getResource('/tmp')]
-      });
-      var source = resolver.resolveAbsolute(Uri.parse('dart:fox/foo.dart'));
-      expect(source, isNotNull);
-      // Restore source's uri.
-      var restoreUri = resolver.restoreAbsolute(source);
-      expect(restoreUri, isNotNull);
-      // Verify that it is 'dart:fox/foo.dart'.
-      expect(restoreUri.toString(), equals('dart:fox/foo.dart'));
-      expect(restoreUri.scheme, equals('dart'));
-      expect(restoreUri.path, equals('fox/foo.dart'));
-    });
   });
 }
 
@@ -81,7 +69,9 @@
   resourceProvider = new MemoryResourceProvider();
   resourceProvider.newFolder('/empty');
   resourceProvider.newFolder('/tmp');
-  resourceProvider.newFile('/tmp/_sdkext', r'''
+  resourceProvider.newFile(
+      '/tmp/_sdkext',
+      r'''
   {
     "dart:fox": "slippy.dart",
     "dart:bear": "grizzly.dart",
diff --git a/pkg/analyzer/test/source/test_all.dart b/pkg/analyzer/test/source/test_all.dart
index 8530b7b4..6930bce 100644
--- a/pkg/analyzer/test/source/test_all.dart
+++ b/pkg/analyzer/test/source/test_all.dart
@@ -6,16 +6,16 @@
 
 import 'package:unittest/unittest.dart';
 
+import '../utils.dart';
 import 'analysis_options_provider_test.dart' as analysis_options_provider_test;
 import 'package_map_provider_test.dart' as package_map_provider_test;
 import 'package_map_resolver_test.dart' as package_map_resolver_test;
 import 'path_filter_test.dart' as path_filter_test;
 import 'sdk_ext_test.dart' as sdk_ext_test;
 
-
 /// Utility for manually running all tests.
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   group('source', () {
     analysis_options_provider_test.main();
     package_map_provider_test.main();
diff --git a/pkg/analyzer/test/src/context/abstract_context.dart b/pkg/analyzer/test/src/context/abstract_context.dart
index 4c8f4a2..135fd42 100644
--- a/pkg/analyzer/test/src/context/abstract_context.dart
+++ b/pkg/analyzer/test/src/context/abstract_context.dart
@@ -28,6 +28,9 @@
   AnalysisCache analysisCache;
   AnalysisDriver analysisDriver;
 
+  UriResolver sdkResolver;
+  UriResolver resourceResolver;
+
   AnalysisTask task;
   Map<ResultDescriptor<dynamic>, dynamic> oldOutputs;
   Map<ResultDescriptor<dynamic>, dynamic> outputs;
@@ -72,12 +75,20 @@
   /**
    * Compute the given [result] for the given [target].
    */
-  void computeResult(AnalysisTarget target, ResultDescriptor result) {
+  void computeResult(AnalysisTarget target, ResultDescriptor result,
+      {isInstanceOf matcher: null}) {
     oldOutputs = outputs;
     task = analysisDriver.computeResult(target, result);
-    expect(task, isNotNull);
+    if (matcher == null) {
+      expect(task, isNotNull);
+    } else {
+      expect(task, matcher);
+    }
     expect(task.caughtException, isNull);
     outputs = task.outputs;
+    for (ResultDescriptor descriptor in task.descriptor.results) {
+      expect(outputs, contains(descriptor));
+    }
   }
 
   AnalysisContextImpl createAnalysisContext() {
@@ -98,17 +109,23 @@
     return sources;
   }
 
-  void setUp() {
-    // prepare AnalysisContext
-    sourceFactory = new SourceFactory(<UriResolver>[
-      new DartUriResolver(sdk),
-      new ResourceUriResolver(resourceProvider)
-    ]);
+  void prepareAnalysisContext([AnalysisOptions options]) {
+    sdkResolver = new DartUriResolver(sdk);
+    resourceResolver = new ResourceUriResolver(resourceProvider);
+    sourceFactory =
+        new SourceFactory(<UriResolver>[sdkResolver, resourceResolver]);
     context = createAnalysisContext();
+    if (options != null) {
+      context.analysisOptions = options;
+    }
     context.sourceFactory = sourceFactory;
     analysisCache = context.analysisCache;
     analysisDriver = context.driver;
   }
 
+  void setUp() {
+    prepareAnalysisContext();
+  }
+
   void tearDown() {}
 }
diff --git a/pkg/analyzer/test/src/context/cache_test.dart b/pkg/analyzer/test/src/context/cache_test.dart
index d5a31c4..75c156a 100644
--- a/pkg/analyzer/test/src/context/cache_test.dart
+++ b/pkg/analyzer/test/src/context/cache_test.dart
@@ -22,9 +22,10 @@
 
 import '../../generated/test_support.dart';
 import '../../reflective_tests.dart';
+import '../../utils.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   runReflectiveTests(AnalysisCacheTest);
   runReflectiveTests(CacheEntryTest);
   runReflectiveTests(CacheFlushManagerTest);
@@ -33,7 +34,8 @@
   runReflectiveTests(ResultDataTest);
 }
 
-AnalysisCache createCache({AnalysisContext context,
+AnalysisCache createCache(
+    {AnalysisContext context,
     RetentionPriority policy: RetentionPriority.LOW}) {
   CachePartition partition = new UniversalCachePartition(context);
   return new AnalysisCache(<CachePartition>[partition]);
@@ -594,6 +596,21 @@
     expect(cache.get(target), entry);
   }
 
+  test_setState_invalid_keepEmpty_ifExplicitlyAdded() {
+    AnalysisTarget target = new TestSource('/a.dart');
+    CacheEntry entry = new CacheEntry(target);
+    entry.explicitlyAdded = true;
+    cache.put(entry);
+    ResultDescriptor result = new ResultDescriptor('result1', -1);
+    // set results, all of them are VALID
+    entry.setValue(result, 111, TargetedResult.EMPTY_LIST);
+    expect(entry.getState(result), CacheState.VALID);
+    expect(entry.getValue(result), 111);
+    // invalidate result, keep entry
+    entry.setState(result, CacheState.INVALID);
+    expect(cache.get(target), isNotNull);
+  }
+
   test_setState_invalid_removeEmptyEntry() {
     AnalysisTarget target1 = new TestSource('/a.dart');
     AnalysisTarget target2 = new TestSource('/b.dart');
@@ -620,6 +637,38 @@
     expect(cache.get(target2), isNull);
   }
 
+  test_setState_invalid_withDelta_keepDependency() {
+    Source target = new TestSource('/test.dart');
+    CacheEntry entry = new CacheEntry(target);
+    cache.put(entry);
+    ResultDescriptor result1 = new ResultDescriptor('result1', -1);
+    ResultDescriptor result2 = new ResultDescriptor('result2', -2);
+    ResultDescriptor result3 = new ResultDescriptor('result3', -3);
+    // set results, all of them are VALID
+    entry.setValue(result1, 111, TargetedResult.EMPTY_LIST);
+    entry.setValue(result2, 222, [new TargetedResult(target, result1)]);
+    entry.setValue(result3, 333, [new TargetedResult(target, result2)]);
+    expect(entry.getState(result1), CacheState.VALID);
+    expect(entry.getState(result2), CacheState.VALID);
+    expect(entry.getState(result3), CacheState.VALID);
+    // result2 depends on result1
+    expect(entry.getResultData(result1).dependentResults,
+        unorderedEquals([new TargetedResult(target, result2)]));
+    expect(entry.getResultData(result2).dependedOnResults,
+        unorderedEquals([new TargetedResult(target, result1)]));
+    // invalidate result2 with Delta: keep result2, invalidate result3
+    entry.setState(result2, CacheState.INVALID,
+        delta: new _KeepContinueDelta(target, result2));
+    expect(entry.getState(result1), CacheState.VALID);
+    expect(entry.getState(result2), CacheState.VALID);
+    expect(entry.getState(result3), CacheState.INVALID);
+    // result2 still depends on result1
+    expect(entry.getResultData(result1).dependentResults,
+        unorderedEquals([new TargetedResult(target, result2)]));
+    expect(entry.getResultData(result2).dependedOnResults,
+        unorderedEquals([new TargetedResult(target, result1)]));
+  }
+
   test_setState_valid() {
     AnalysisTarget target = new TestSource();
     ResultDescriptor result = new ResultDescriptor('test', null);
@@ -704,13 +753,15 @@
     expect(entry.getValue(result2), 222);
     expect(entry.getValue(result3), 333);
     // replace result1, keep "dependedOn", invalidate result3
-    entry.setValueIncremental(result2, 2222);
+    entry.setValueIncremental(result2, 2222, true);
     expect(entry.getState(result1), CacheState.VALID);
     expect(entry.getState(result2), CacheState.VALID);
     expect(entry.getState(result3), CacheState.INVALID);
     expect(entry.getValue(result1), 111);
     expect(entry.getValue(result2), 2222);
     expect(entry.getValue(result3), -3);
+    expect(entry.getResultData(result1).dependentResults,
+        unorderedEquals([new TargetedResult(target, result2)]));
     expect(entry.getResultData(result2).dependedOnResults,
         unorderedEquals([new TargetedResult(target, result1)]));
   }
@@ -1055,6 +1106,25 @@
   noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
 }
 
+/**
+ * Keep the given [keepDescriptor], invalidate all the other results.
+ */
+class _KeepContinueDelta implements Delta {
+  final Source source;
+  final ResultDescriptor keepDescriptor;
+
+  _KeepContinueDelta(this.source, this.keepDescriptor);
+
+  @override
+  DeltaResult validate(InternalAnalysisContext context, AnalysisTarget target,
+      ResultDescriptor descriptor) {
+    if (descriptor == keepDescriptor) {
+      return DeltaResult.KEEP_CONTINUE;
+    }
+    return DeltaResult.INVALIDATE;
+  }
+}
+
 class _TestAnalysisTarget implements AnalysisTarget {
   @override
   Source get source => null;
diff --git a/pkg/analyzer/test/src/context/context_test.dart b/pkg/analyzer/test/src/context/context_test.dart
index 908f08e..4d68fd3 100644
--- a/pkg/analyzer/test/src/context/context_test.dart
+++ b/pkg/analyzer/test/src/context/context_test.dart
@@ -7,6 +7,7 @@
 import 'dart:async';
 
 import 'package:analyzer/file_system/memory_file_system.dart';
+import 'package:analyzer/source/package_map_resolver.dart';
 import 'package:analyzer/src/cancelable_future.dart';
 import 'package:analyzer/src/context/cache.dart';
 import 'package:analyzer/src/context/context.dart';
@@ -34,6 +35,7 @@
 import 'package:analyzer/src/generated/resolver.dart';
 import 'package:analyzer/src/generated/scanner.dart';
 import 'package:analyzer/src/generated/source.dart';
+import 'package:analyzer/src/generated/utilities_collection.dart';
 import 'package:analyzer/src/task/dart.dart';
 import 'package:analyzer/src/task/html.dart';
 import 'package:analyzer/task/dart.dart';
@@ -45,16 +47,32 @@
 import '../../generated/engine_test.dart';
 import '../../generated/test_support.dart';
 import '../../reflective_tests.dart';
+import '../../utils.dart';
 import 'abstract_context.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   runReflectiveTests(AnalysisContextImplTest);
   runReflectiveTests(LimitedInvalidateTest);
 }
 
 @reflectiveTest
 class AnalysisContextImplTest extends AbstractContextTest {
+  void fail_getErrors_html_some() {
+    Source source = addSource(
+        "/test.html",
+        r'''
+<html><head>
+<script type='application/dart' src='test.dart'/>
+</head></html>''');
+    AnalysisErrorInfo errorInfo = context.getErrors(source);
+    expect(errorInfo, isNotNull);
+    List<AnalysisError> errors = errorInfo.errors;
+    expect(errors, hasLength(0));
+    errors = context.computeErrors(source);
+    expect(errors, hasLength(2));
+  }
+
   Future fail_implicitAnalysisEvents_removed() async {
     AnalyzedSourcesListener listener = new AnalyzedSourcesListener();
     context.implicitAnalysisEvents.listen(listener.onData);
@@ -83,7 +101,9 @@
 
   void fail_performAnalysisTask_importedLibraryDelete_html() {
     // NOTE: This was failing before converting to the new task model.
-    Source htmlSource = addSource("/page.html", r'''
+    Source htmlSource = addSource(
+        "/page.html",
+        r'''
 <html><body><script type="application/dart">
   import 'libB.dart';
   main() {print('hello dart');}
@@ -95,7 +115,8 @@
         context.getResolvedCompilationUnit2(libBSource, libBSource), isNotNull,
         reason: "libB resolved 1");
     expect(!_hasAnalysisErrorWithErrorSeverity(context.getErrors(htmlSource)),
-        isTrue, reason: "htmlSource doesn't have errors");
+        isTrue,
+        reason: "htmlSource doesn't have errors");
     // remove libB.dart content and analyze
     context.setContents(libBSource, null);
     _analyzeAll_assertFinished();
@@ -174,11 +195,15 @@
   }
 
   void test_applyChanges_change_flush_element() {
-    Source librarySource = addSource("/lib.dart", r'''
+    Source librarySource = addSource(
+        "/lib.dart",
+        r'''
 library lib;
 int a = 0;''');
     expect(context.computeLibraryElement(librarySource), isNotNull);
-    context.setContents(librarySource, r'''
+    context.setContents(
+        librarySource,
+        r'''
 library lib;
 int aa = 0;''');
     expect(context.getLibraryElement(librarySource), isNull);
@@ -218,8 +243,8 @@
     Element declarationElement = declaration.variables.variables[0].element;
     TopLevelVariableDeclaration use =
         partUnit.declarations[0] as TopLevelVariableDeclaration;
-    Element useElement = (use.variables.variables[
-        0].initializer as SimpleIdentifier).staticElement;
+    Element useElement = (use.variables.variables[0].initializer
+        as SimpleIdentifier).staticElement;
     expect((useElement as PropertyAccessorElement).variable,
         same(declarationElement));
     return pumpEventQueue().then((_) {
@@ -314,18 +339,24 @@
    */
   void test_applyChanges_remove_incremental() {
     MemoryResourceProvider resourceProvider = new MemoryResourceProvider();
-    Source source = resourceProvider.newFile('/test.dart', r'''
+    Source source = resourceProvider
+        .newFile(
+            '/test.dart',
+            r'''
 main() {
   print(1);
 }
-''').createSource();
+''')
+        .createSource();
     context.analysisOptions = new AnalysisOptionsImpl()..incremental = true;
     context.applyChanges(new ChangeSet()..addedSource(source));
     // remember compilation unit
     _analyzeAll_assertFinished();
     CompilationUnit unit = context.getResolvedCompilationUnit2(source, source);
     // add overlay
-    context.setContents(source, r'''
+    context.setContents(
+        source,
+        r'''
 main() {
   print(12);
 }
@@ -368,9 +399,11 @@
     });
   }
 
-  void test_computeDocumentationComment_block() {
+  void test_computeDocumentationComment_class_block() {
     String comment = "/** Comment */";
-    Source source = addSource("/test.dart", """
+    Source source = addSource(
+        "/test.dart",
+        """
 $comment
 class A {}""");
     LibraryElement libraryElement = context.computeLibraryElement(source);
@@ -380,7 +413,7 @@
     expect(context.computeDocumentationComment(classElement), comment);
   }
 
-  void test_computeDocumentationComment_none() {
+  void test_computeDocumentationComment_class_none() {
     Source source = addSource("/test.dart", "class A {}");
     LibraryElement libraryElement = context.computeLibraryElement(source);
     expect(libraryElement, isNotNull);
@@ -389,11 +422,7 @@
     expect(context.computeDocumentationComment(classElement), isNull);
   }
 
-  void test_computeDocumentationComment_null() {
-    expect(context.computeDocumentationComment(null), isNull);
-  }
-
-  void test_computeDocumentationComment_singleLine_multiple_EOL_n() {
+  void test_computeDocumentationComment_class_singleLine_multiple_EOL_n() {
     String comment = "/// line 1\n/// line 2\n/// line 3\n";
     Source source = addSource("/test.dart", "${comment}class A {}");
     LibraryElement libraryElement = context.computeLibraryElement(source);
@@ -404,7 +433,7 @@
     expect(actual, "/// line 1\n/// line 2\n/// line 3");
   }
 
-  void test_computeDocumentationComment_singleLine_multiple_EOL_rn() {
+  void test_computeDocumentationComment_class_singleLine_multiple_EOL_rn() {
     String comment = "/// line 1\r\n/// line 2\r\n/// line 3\r\n";
     Source source = addSource("/test.dart", "${comment}class A {}");
     LibraryElement libraryElement = context.computeLibraryElement(source);
@@ -415,6 +444,51 @@
     expect(actual, "/// line 1\n/// line 2\n/// line 3");
   }
 
+  void test_computeDocumentationComment_exportDirective_block() {
+    String comment = '/** Comment */';
+    Source source = addSource(
+        "/test.dart",
+        '''
+$comment
+export 'dart:async';
+''');
+    LibraryElement libraryElement = context.computeLibraryElement(source);
+    expect(libraryElement, isNotNull);
+    ExportElement exportElement = libraryElement.exports[0];
+    expect(context.computeDocumentationComment(exportElement), comment);
+  }
+
+  void test_computeDocumentationComment_importDirective_block() {
+    String comment = '/** Comment */';
+    Source source = addSource(
+        "/test.dart",
+        '''
+$comment
+import 'dart:async';
+''');
+    LibraryElement libraryElement = context.computeLibraryElement(source);
+    expect(libraryElement, isNotNull);
+    ImportElement importElement = libraryElement.imports[0];
+    expect(context.computeDocumentationComment(importElement), comment);
+  }
+
+  void test_computeDocumentationComment_libraryDirective_block() {
+    String comment = '/** Comment */';
+    Source source = addSource(
+        "/test.dart",
+        '''
+$comment
+library lib;
+''');
+    LibraryElement libraryElement = context.computeLibraryElement(source);
+    expect(libraryElement, isNotNull);
+    expect(context.computeDocumentationComment(libraryElement), comment);
+  }
+
+  void test_computeDocumentationComment_null() {
+    expect(context.computeDocumentationComment(null), isNull);
+  }
+
   void test_computeErrors_dart_none() {
     Source source = addSource("/lib.dart", "library lib;");
     List<AnalysisError> errors = context.computeErrors(source);
@@ -495,7 +569,9 @@
   }
 
   void test_computeLineInfo_dart() {
-    Source source = addSource("/test.dart", r'''
+    Source source = addSource(
+        "/test.dart",
+        r'''
 library lib;
 
 main() {}''');
@@ -504,7 +580,9 @@
   }
 
   void test_computeLineInfo_html() {
-    Source source = addSource("/test.html", r'''
+    Source source = addSource(
+        "/test.html",
+        r'''
 <html>
   <body>
     <h1>A</h1>
@@ -629,6 +707,15 @@
     });
   }
 
+  void test_configurationData() {
+    var key = new ResultDescriptor('test_key', '');
+    var testData = ['test', 'data'];
+    context.setConfigurationData(key, testData);
+    expect(context.getConfigurationData(key), testData);
+    var unusedKey = new ResultDescriptor('unused_key', '');
+    expect(context.getConfigurationData(unusedKey), null);
+  }
+
   void test_dispose() {
     expect(context.isDisposed, isFalse);
     context.dispose();
@@ -650,8 +737,9 @@
     LibrarySpecificUnit libTarget = new LibrarySpecificUnit(source, source);
     analysisDriver.computeResult(libTarget, RESOLVED_UNIT);
     // flush
-    context.getCacheEntry(libTarget).setState(
-        RESOLVED_UNIT, CacheState.FLUSHED);
+    context
+        .getCacheEntry(libTarget)
+        .setState(RESOLVED_UNIT, CacheState.FLUSHED);
     // schedule recomputing
     List<CompilationUnit> units = context.ensureResolvedDartUnits(source);
     expect(units, isNull);
@@ -662,15 +750,21 @@
   }
 
   void test_ensureResolvedDartUnits_partUnit_hasResolved() {
-    Source libSource1 = addSource('/lib1.dart', r'''
+    Source libSource1 = addSource(
+        '/lib1.dart',
+        r'''
 library lib;
 part 'part.dart';
 ''');
-    Source libSource2 = addSource('/lib2.dart', r'''
+    Source libSource2 = addSource(
+        '/lib2.dart',
+        r'''
 library lib;
 part 'part.dart';
 ''');
-    Source partSource = addSource('/part.dart', r'''
+    Source partSource = addSource(
+        '/part.dart',
+        r'''
 part of lib;
 ''');
     LibrarySpecificUnit partTarget1 =
@@ -688,15 +782,21 @@
   }
 
   void test_ensureResolvedDartUnits_partUnit_notResolved() {
-    Source libSource1 = addSource('/lib1.dart', r'''
+    Source libSource1 = addSource(
+        '/lib1.dart',
+        r'''
 library lib;
 part 'part.dart';
 ''');
-    Source libSource2 = addSource('/lib2.dart', r'''
+    Source libSource2 = addSource(
+        '/lib2.dart',
+        r'''
 library lib;
 part 'part.dart';
 ''');
-    Source partSource = addSource('/part.dart', r'''
+    Source partSource = addSource(
+        '/part.dart',
+        r'''
 part of lib;
 ''');
     LibrarySpecificUnit partTarget1 =
@@ -706,10 +806,12 @@
     analysisDriver.computeResult(partTarget1, RESOLVED_UNIT);
     analysisDriver.computeResult(partTarget2, RESOLVED_UNIT);
     // flush
-    context.getCacheEntry(partTarget1).setState(
-        RESOLVED_UNIT, CacheState.FLUSHED);
-    context.getCacheEntry(partTarget2).setState(
-        RESOLVED_UNIT, CacheState.FLUSHED);
+    context
+        .getCacheEntry(partTarget1)
+        .setState(RESOLVED_UNIT, CacheState.FLUSHED);
+    context
+        .getCacheEntry(partTarget2)
+        .setState(RESOLVED_UNIT, CacheState.FLUSHED);
     // schedule recomputing
     List<CompilationUnit> units = context.ensureResolvedDartUnits(partSource);
     expect(units, isNull);
@@ -751,15 +853,7 @@
     expect(contents.data.toString(), content);
   }
 
-  void test_getContents_overridden() {
-    String content = "library lib;";
-    Source source = new TestSource();
-    context.setContents(source, content);
-    TimestampedData<String> contents = context.getContents(source);
-    expect(contents.data.toString(), content);
-  }
-
-  void test_getContents_unoverridden() {
+  void test_getContents_notOverridden() {
     String content = "library lib;";
     Source source = new TestSource('/test.dart', content);
     context.setContents(source, "part of lib;");
@@ -768,6 +862,14 @@
     expect(contents.data.toString(), content);
   }
 
+  void test_getContents_overridden() {
+    String content = "library lib;";
+    Source source = new TestSource();
+    context.setContents(source, content);
+    TimestampedData<String> contents = context.getContents(source);
+    expect(contents.data.toString(), content);
+  }
+
   void test_getDeclaredVariables() {
     expect(context.declaredVariables, isNotNull);
   }
@@ -785,7 +887,9 @@
   }
 
   void test_getElement_constructor_named() {
-    Source source = addSource("/lib.dart", r'''
+    Source source = addSource(
+        "/lib.dart",
+        r'''
 class A {
   A.named() {}
 }''');
@@ -799,7 +903,9 @@
   }
 
   void test_getElement_constructor_unnamed() {
-    Source source = addSource("/lib.dart", r'''
+    Source source = addSource(
+        "/lib.dart",
+        r'''
 class A {
   A() {}
 }''');
@@ -854,21 +960,10 @@
     expect(errors, hasLength(0));
   }
 
-  void test_getErrors_html_some() {
-    Source source = addSource("/test.html", r'''
-<html><head>
-<script type='application/dart' src='test.dart'/>
-</head></html>''');
-    AnalysisErrorInfo errorInfo = context.getErrors(source);
-    expect(errorInfo, isNotNull);
-    List<AnalysisError> errors = errorInfo.errors;
-    expect(errors, hasLength(0));
-    errors = context.computeErrors(source);
-    expect(errors, hasLength(3));
-  }
-
   void test_getHtmlFilesReferencing_html() {
-    Source htmlSource = addSource("/test.html", r'''
+    Source htmlSource = addSource(
+        "/test.html",
+        r'''
 <html><head>
 <script type='application/dart' src='test.dart'/>
 <script type='application/dart' src='test.js'/>
@@ -884,7 +979,9 @@
   }
 
   void test_getHtmlFilesReferencing_library() {
-    Source htmlSource = addSource("/test.html", r'''
+    Source htmlSource = addSource(
+        "/test.html",
+        r'''
 <!DOCTYPE html>
 <html><head>
 <script type='application/dart' src='test.dart'/>
@@ -902,7 +999,9 @@
   }
 
   void test_getHtmlFilesReferencing_part() {
-    Source htmlSource = addSource("/test.html", r'''
+    Source htmlSource = addSource(
+        "/test.html",
+        r'''
 <!DOCTYPE html>
 <html><head>
 <script type='application/dart' src='test.dart'/>
@@ -955,7 +1054,9 @@
   }
 
   void test_getLaunchableClientLibrarySources_doesNotImportHtml() {
-    Source source = addSource("/test.dart", r'''
+    Source source = addSource(
+        "/test.dart",
+        r'''
 main() {}''');
     context.computeLibraryElement(source);
     List<Source> sources = context.launchableClientLibrarySources;
@@ -965,7 +1066,9 @@
   void test_getLaunchableClientLibrarySources_importsHtml_explicitly() {
     List<Source> sources = context.launchableClientLibrarySources;
     expect(sources, isEmpty);
-    Source source = addSource("/test.dart", r'''
+    Source source = addSource(
+        "/test.dart",
+        r'''
 import 'dart:html';
 main() {}''');
     context.computeLibraryElement(source);
@@ -976,13 +1079,17 @@
   void test_getLaunchableClientLibrarySources_importsHtml_implicitly() {
     List<Source> sources = context.launchableClientLibrarySources;
     expect(sources, isEmpty);
-    addSource("/a.dart", r'''
+    addSource(
+        "/a.dart",
+        r'''
 import 'dart:html';
 ''');
-    Source source = addSource("/test.dart", r'''
+    Source source = addSource(
+        "/test.dart",
+        r'''
 import 'a.dart';
 main() {}''');
-    context.computeLibraryElement(source);
+    _analyzeAll_assertFinished();
     sources = context.launchableClientLibrarySources;
     expect(sources, unorderedEquals([source]));
   }
@@ -990,13 +1097,17 @@
   void test_getLaunchableClientLibrarySources_importsHtml_implicitly2() {
     List<Source> sources = context.launchableClientLibrarySources;
     expect(sources, isEmpty);
-    addSource("/a.dart", r'''
+    addSource(
+        "/a.dart",
+        r'''
 export 'dart:html';
 ''');
-    Source source = addSource("/test.dart", r'''
+    Source source = addSource(
+        "/test.dart",
+        r'''
 import 'a.dart';
 main() {}''');
-    context.computeLibraryElement(source);
+    _analyzeAll_assertFinished();
     sources = context.launchableClientLibrarySources;
     expect(sources, unorderedEquals([source]));
   }
@@ -1009,7 +1120,9 @@
   }
 
   void test_getLaunchableServerLibrarySources_importsHtml_explicitly() {
-    Source source = addSource("/test.dart", r'''
+    Source source = addSource(
+        "/test.dart",
+        r'''
 import 'dart:html';
 main() {}
 ''');
@@ -1018,13 +1131,17 @@
   }
 
   void test_getLaunchableServerLibrarySources_importsHtml_implicitly() {
-    addSource("/imports_html.dart", r'''
+    addSource(
+        "/imports_html.dart",
+        r'''
 import 'dart:html';
 ''');
-    Source source = addSource("/test.dart", r'''
+    addSource(
+        "/test.dart",
+        r'''
 import 'imports_html.dart';
 main() {}''');
-    context.computeLibraryElement(source);
+    _analyzeAll_assertFinished();
     expect(context.launchableServerLibrarySources, isEmpty);
   }
 
@@ -1035,7 +1152,9 @@
   }
 
   void test_getLibrariesContaining() {
-    Source librarySource = addSource("/lib.dart", r'''
+    Source librarySource = addSource(
+        "/lib.dart",
+        r'''
 library lib;
 part 'part.dart';''');
     Source partSource = addSource("/part.dart", "part of lib;");
@@ -1051,11 +1170,15 @@
   void test_getLibrariesDependingOn() {
     Source libASource = addSource("/libA.dart", "library libA;");
     addSource("/libB.dart", "library libB;");
-    Source lib1Source = addSource("/lib1.dart", r'''
+    Source lib1Source = addSource(
+        "/lib1.dart",
+        r'''
 library lib1;
 import 'libA.dart';
 export 'libB.dart';''');
-    Source lib2Source = addSource("/lib2.dart", r'''
+    Source lib2Source = addSource(
+        "/lib2.dart",
+        r'''
 library lib2;
 import 'libB.dart';
 export 'libA.dart';''');
@@ -1066,7 +1189,9 @@
   }
 
   void test_getLibrariesReferencedFromHtml() {
-    Source htmlSource = addSource("/test.html", r'''
+    Source htmlSource = addSource(
+        "/test.html",
+        r'''
 <!DOCTYPE html>
 <html><head>
 <script type='application/dart' src='test.dart'/>
@@ -1082,7 +1207,9 @@
   }
 
   void test_getLibrariesReferencedFromHtml_none() {
-    Source htmlSource = addSource("/test.html", r'''
+    Source htmlSource = addSource(
+        "/test.html",
+        r'''
 <html><head>
 <script type='application/dart' src='test.js'/>
 </head></html>''');
@@ -1116,8 +1243,47 @@
     fail("The added source was not in the list of library sources");
   }
 
+  void test_getLibrarySources_inSDK() {
+    Source source = addSource(
+        '/test.dart',
+        r'''
+import 'dart:async';
+Stream S = null;
+''');
+    LibraryElement testLibrary = context.computeLibraryElement(source);
+    // prepare "Stream" ClassElement
+    ClassElement streamElement;
+    {
+      CompilationUnitElement testUnit = testLibrary.definingCompilationUnit;
+      InterfaceType streamType = testUnit.topLevelVariables[0].type;
+      streamElement = streamType.element;
+    }
+    // must be from SDK context
+    AnalysisContext sdkContext = context.sourceFactory.dartSdk.context;
+    expect(sdkContext, streamElement.context);
+    Source intSource = streamElement.source;
+    // must be in the "async" library - SDK context
+    {
+      List<Source> coreLibraries = sdkContext.getLibrariesContaining(intSource);
+      expect(coreLibraries, hasLength(1));
+      Source coreSource = coreLibraries[0];
+      expect(coreSource.isInSystemLibrary, isTrue);
+      expect(coreSource.shortName, 'async.dart');
+    }
+    // must be in the "async" library - main context
+    {
+      List<Source> coreLibraries = context.getLibrariesContaining(intSource);
+      expect(coreLibraries, hasLength(1));
+      Source coreSource = coreLibraries[0];
+      expect(coreSource.isInSystemLibrary, isTrue);
+      expect(coreSource.shortName, 'async.dart');
+    }
+  }
+
   void test_getLineInfo() {
-    Source source = addSource("/test.dart", r'''
+    Source source = addSource(
+        "/test.dart",
+        r'''
 library lib;
 
 main() {}''');
@@ -1130,9 +1296,11 @@
 
   void test_getModificationStamp_fromSource() {
     int stamp = 42;
-    expect(context.getModificationStamp(
-        new AnalysisContextImplTest_Source_getModificationStamp_fromSource(
-            stamp)), stamp);
+    expect(
+        context.getModificationStamp(
+            new AnalysisContextImplTest_Source_getModificationStamp_fromSource(
+                stamp)),
+        stamp);
   }
 
   void test_getModificationStamp_overridden() {
@@ -1175,13 +1343,6 @@
     expect(context.getResolvedCompilationUnit2(source, source), isNotNull);
   }
 
-  void test_getResolvedCompilationUnit_source_html() {
-    Source source = addSource("/test.html", "<html></html>");
-    expect(context.getResolvedCompilationUnit2(source, source), isNull);
-    expect(context.resolveCompilationUnit2(source, source), isNull);
-    expect(context.getResolvedCompilationUnit2(source, source), isNull);
-  }
-
   void test_getSourceFactory() {
     expect(context.sourceFactory, same(sourceFactory));
   }
@@ -1251,7 +1412,9 @@
   }
 
   void test_isClientLibrary_dart() {
-    Source source = addSource("/test.dart", r'''
+    Source source = addSource(
+        "/test.dart",
+        r'''
 import 'dart:html';
 
 main() {}''');
@@ -1267,8 +1430,15 @@
     expect(context.isClientLibrary(source), isFalse);
   }
 
+  void test_isClientLibrary_unknown() {
+    Source source = newSource("/test.dart");
+    expect(context.isClientLibrary(source), isFalse);
+  }
+
   void test_isServerLibrary_dart() {
-    Source source = addSource("/test.dart", r'''
+    Source source = addSource(
+        "/test.dart",
+        r'''
 library lib;
 
 main() {}''');
@@ -1284,6 +1454,11 @@
     expect(context.isServerLibrary(source), isFalse);
   }
 
+  void test_isServerLibrary_unknown() {
+    Source source = newSource("/test.dart");
+    expect(context.isServerLibrary(source), isFalse);
+  }
+
   void test_parseCompilationUnit_errors() {
     Source source = addSource("/lib.dart", "library {");
     CompilationUnit compilationUnit = context.parseCompilationUnit(source);
@@ -1337,10 +1512,14 @@
   }
 
   void test_parseHtmlUnit_resolveDirectives() {
-    Source libSource = addSource("/lib.dart", r'''
+    Source libSource = addSource(
+        "/lib.dart",
+        r'''
 library lib;
 class ClassA {}''');
-    Source source = addSource("/lib.html", r'''
+    Source source = addSource(
+        "/lib.html",
+        r'''
 <!DOCTYPE html>
 <html>
 <head>
@@ -1363,15 +1542,20 @@
   }
 
   void test_performAnalysisTask_addPart() {
-    Source libSource = addSource("/lib.dart", r'''
+    Source libSource = addSource(
+        "/lib.dart",
+        r'''
 library lib;
 part 'part.dart';''');
     // run all tasks without part
     _analyzeAll_assertFinished();
     expect(_hasAnalysisErrorWithErrorSeverity(context.getErrors(libSource)),
-        isTrue, reason: "lib has errors");
+        isTrue,
+        reason: "lib has errors");
     // add part and run all tasks
-    Source partSource = addSource("/part.dart", r'''
+    Source partSource = addSource(
+        "/part.dart",
+        r'''
 part of lib;
 ''');
     _analyzeAll_assertFinished();
@@ -1379,7 +1563,8 @@
     List<Source> librariesWithPart = context.getLibrariesContaining(partSource);
     expect(librariesWithPart, unorderedEquals([libSource]));
     expect(_hasAnalysisErrorWithErrorSeverity(context.getErrors(libSource)),
-        isFalse, reason: "lib doesn't have errors");
+        isFalse,
+        reason: "lib doesn't have errors");
     expect(
         context.getResolvedCompilationUnit2(partSource, libSource), isNotNull,
         reason: "part resolved");
@@ -1414,7 +1599,7 @@
         reason: "part changed 3");
     _analyzeAll_assertFinished();
     expect(context.getResolvedCompilationUnit2(libSource, libSource), isNotNull,
-        reason: "library resolved 2");
+        reason: "library resolved 3");
     expect(
         context.getResolvedCompilationUnit2(partSource, libSource), isNotNull,
         reason: "part resolved 3");
@@ -1457,7 +1642,9 @@
   }
 
   void test_performAnalysisTask_changePartContents_makeItAPart() {
-    Source libSource = addSource("/lib.dart", r'''
+    Source libSource = addSource(
+        "/lib.dart",
+        r'''
 library lib;
 part 'part.dart';
 void f(x) {}''');
@@ -1469,7 +1656,9 @@
         context.getResolvedCompilationUnit2(partSource, partSource), isNotNull,
         reason: "part resolved 1");
     // update and analyze
-    context.setContents(partSource, r'''
+    context.setContents(
+        partSource,
+        r'''
 part of lib;
 void g() { f(null); }''');
     expect(context.getResolvedCompilationUnit2(libSource, libSource), isNull,
@@ -1490,18 +1679,24 @@
    * https://code.google.com/p/dart/issues/detail?id=12424
    */
   void test_performAnalysisTask_changePartContents_makeItNotPart() {
-    Source libSource = addSource("/lib.dart", r'''
+    Source libSource = addSource(
+        "/lib.dart",
+        r'''
 library lib;
 part 'part.dart';
 void f(x) {}''');
-    Source partSource = addSource("/part.dart", r'''
+    Source partSource = addSource(
+        "/part.dart",
+        r'''
 part of lib;
 void g() { f(null); }''');
     _analyzeAll_assertFinished();
     expect(context.getErrors(libSource).errors, hasLength(0));
     expect(context.getErrors(partSource).errors, hasLength(0));
     // Remove 'part' directive, which should make "f(null)" an error.
-    context.setContents(partSource, r'''
+    context.setContents(
+        partSource,
+        r'''
 //part of lib;
 void g() { f(null); }''');
     _analyzeAll_assertFinished();
@@ -1596,7 +1791,8 @@
         context.getResolvedCompilationUnit2(libASource, libASource), isNotNull,
         reason: "libA resolved 1");
     expect(_hasAnalysisErrorWithErrorSeverity(context.getErrors(libASource)),
-        isTrue, reason: "libA has an error");
+        isTrue,
+        reason: "libA has an error");
     // add libB.dart and analyze
     Source libBSource = addSource("/libB.dart", "library libB;");
     _analyzeAll_assertFinished();
@@ -1607,19 +1803,23 @@
         context.getResolvedCompilationUnit2(libBSource, libBSource), isNotNull,
         reason: "libB resolved 2");
     expect(_hasAnalysisErrorWithErrorSeverity(context.getErrors(libASource)),
-        isFalse, reason: "libA doesn't have errors");
+        isFalse,
+        reason: "libA doesn't have errors");
   }
 
   void test_performAnalysisTask_importedLibraryAdd_html() {
-    Source htmlSource = addSource("/page.html", r'''
+    Source htmlSource = addSource(
+        "/page.html",
+        r'''
 <html><body><script type="application/dart">
   import '/libB.dart';
   main() {print('hello dart');}
 </script></body></html>''');
     _analyzeAll_assertFinished();
     context.computeErrors(htmlSource);
-    expect(_hasAnalysisErrorWithErrorSeverity(context.getErrors(htmlSource)),
-        isTrue, reason: "htmlSource has an error");
+//    expect(_hasAnalysisErrorWithErrorSeverity(context.getErrors(htmlSource)),
+//        isTrue,
+//        reason: "htmlSource has an error");
     // add libB.dart and analyze
     Source libBSource = addSource("/libB.dart", "library libB;");
     _analyzeAll_assertFinished();
@@ -1647,7 +1847,8 @@
         context.getResolvedCompilationUnit2(libBSource, libBSource), isNotNull,
         reason: "libB resolved 1");
     expect(!_hasAnalysisErrorWithErrorSeverity(context.getErrors(libASource)),
-        isTrue, reason: "libA doesn't have errors");
+        isTrue,
+        reason: "libA doesn't have errors");
     // remove libB.dart and analyze
     _removeSource(libBSource);
     _analyzeAll_assertFinished();
@@ -1655,21 +1856,47 @@
         context.getResolvedCompilationUnit2(libASource, libASource), isNotNull,
         reason: "libA resolved 2");
     expect(_hasAnalysisErrorWithErrorSeverity(context.getErrors(libASource)),
-        isTrue, reason: "libA has an error");
+        isTrue,
+        reason: "libA has an error");
+  }
+
+  void test_performAnalysisTask_interruptBy_setContents() {
+    Source sourceA = addSource(
+        "/a.dart",
+        r'''
+library expectedToFindSemicolon
+''');
+    // Analyze to the point where some of the results stop depending on
+    // the source content.
+    LibrarySpecificUnit unitA = new LibrarySpecificUnit(sourceA, sourceA);
+    for (int i = 0; i < 10000; i++) {
+      context.performAnalysisTask();
+      if (context.getResult(unitA, RESOLVED_UNIT2) != null) {
+        break;
+      }
+    }
+    // Update the source.
+    // This should invalidate all the results and also reset the driver.
+    context.setContents(sourceA, "library semicolonWasAdded;");
+    expect(context.getResult(unitA, RESOLVED_UNIT2), isNull);
+    expect(analysisDriver.currentWorkOrder, isNull);
+    // Continue analysis.
+    _analyzeAll_assertFinished();
+    expect(context.getErrors(sourceA).errors, isEmpty);
   }
 
   void test_performAnalysisTask_IOException() {
     TestSource source = _addSourceWithException2("/test.dart", "library test;");
     source.generateExceptionOnRead = false;
     _analyzeAll_assertFinished();
-    expect(source.readCount, 1);
+    expect(source.readCount, 2);
     _changeSource(source, "");
     source.generateExceptionOnRead = true;
     _analyzeAll_assertFinished();
     if (AnalysisEngine.instance.limitInvalidationInTaskModel) {
-      expect(source.readCount, 5);
+      expect(source.readCount, 7);
     } else {
-      expect(source.readCount, 3);
+      expect(source.readCount, 5);
     }
   }
 
@@ -1685,7 +1912,7 @@
     // TODO(scheglov) no threads in Dart
 //    Source source = _addSource("/test.dart", "library lib;");
 //    int initialTime = _context.getModificationStamp(source);
-//    List<Source> sources = new List<Source>();
+//    List<Source> sources = <Source>[];
 //    sources.add(source);
 //    _context.analysisPriorityOrder = sources;
 //    _context.parseCompilationUnit(source);
@@ -1729,6 +1956,60 @@
     expect(resolvedUnitUris, contains('file:///test.dart'));
   }
 
+  void test_performAnalysisTask_switchPackageVersion() {
+    // version 1
+    resourceProvider.newFile(
+        '/pkgs/crypto-1/lib/crypto.dart',
+        r'''
+library crypto;
+part 'src/hash_utils.dart';
+''');
+    resourceProvider.newFile(
+        '/pkgs/crypto-1/lib/src/hash_utils.dart',
+        r'''
+part of crypto;
+const _MASK_8 = 0xff;
+''');
+    // version 2
+    resourceProvider.newFile(
+        '/pkgs/crypto-2/lib/crypto.dart',
+        r'''
+library crypto;
+part 'src/hash_utils.dart';
+''');
+    resourceProvider.newFile(
+        '/pkgs/crypto-2/lib/src/hash_utils.dart',
+        r'''
+part of crypto;
+const _MASK_8 = 0xff;
+''');
+    // use version 1
+    context.sourceFactory = new SourceFactory(<UriResolver>[
+      sdkResolver,
+      resourceResolver,
+      new PackageMapUriResolver(resourceProvider, {
+        'crypto': [resourceProvider.getFolder('/pkgs/crypto-1/lib')]
+      })
+    ]);
+    // analyze
+    addSource(
+        "/test.dart",
+        r'''
+import 'package:crypto/crypto.dart';
+''');
+    _analyzeAll_assertFinished();
+    // use version 2
+    context.sourceFactory = new SourceFactory(<UriResolver>[
+      sdkResolver,
+      resourceResolver,
+      new PackageMapUriResolver(resourceProvider, {
+        'crypto': [resourceProvider.getFolder('/pkgs/crypto-2/lib')]
+      })
+    ]);
+    _analyzeAll_assertFinished();
+    _assertNoExceptions();
+  }
+
   void test_resolveCompilationUnit_import_relative() {
     Source sourceA =
         addSource("/libA.dart", "library libA; import 'libB.dart'; class A{}");
@@ -1740,13 +2021,8 @@
     List<LibraryElement> importedLibraries = library.importedLibraries;
     assertNamedElements(importedLibraries, ["dart.core", "libB"]);
     List<LibraryElement> visibleLibraries = library.visibleLibraries;
-    assertNamedElements(visibleLibraries, [
-      "dart.core",
-      "dart.async",
-      "dart.math",
-      "libA",
-      "libB"
-    ]);
+    assertNamedElements(visibleLibraries,
+        ["dart.core", "dart.async", "dart.math", "libA", "libB"]);
   }
 
   void test_resolveCompilationUnit_import_relative_cyclic() {
@@ -1760,26 +2036,10 @@
     List<LibraryElement> importedLibraries = library.importedLibraries;
     assertNamedElements(importedLibraries, ["dart.core", "libB"]);
     List<LibraryElement> visibleLibraries = library.visibleLibraries;
-    assertNamedElements(visibleLibraries, [
-      "dart.core",
-      "dart.async",
-      "dart.math",
-      "libA",
-      "libB"
-    ]);
+    assertNamedElements(visibleLibraries,
+        ["dart.core", "dart.async", "dart.math", "libA", "libB"]);
   }
 
-//  void test_resolveCompilationUnit_sourceChangeDuringResolution() {
-//    _context = new _AnalysisContext_sourceChangeDuringResolution();
-//    AnalysisContextFactory.initContextWithCore(_context);
-//    _sourceFactory = _context.sourceFactory;
-//    Source source = _addSource("/lib.dart", "library lib;");
-//    CompilationUnit compilationUnit =
-//        _context.resolveCompilationUnit2(source, source);
-//    expect(compilationUnit, isNotNull);
-//    expect(_context.getLineInfo(source), isNotNull);
-//  }
-
   void test_resolveCompilationUnit_library() {
     Source source = addSource("/lib.dart", "library lib;");
     LibraryElement library = context.computeLibraryElement(source);
@@ -1796,6 +2056,17 @@
     expect(compilationUnit, isNotNull);
   }
 
+//  void test_resolveCompilationUnit_sourceChangeDuringResolution() {
+//    _context = new _AnalysisContext_sourceChangeDuringResolution();
+//    AnalysisContextFactory.initContextWithCore(_context);
+//    _sourceFactory = _context.sourceFactory;
+//    Source source = _addSource("/lib.dart", "library lib;");
+//    CompilationUnit compilationUnit =
+//        _context.resolveCompilationUnit2(source, source);
+//    expect(compilationUnit, isNotNull);
+//    expect(_context.getLineInfo(source), isNotNull);
+//  }
+
   void test_setAnalysisOptions() {
     AnalysisOptionsImpl options = new AnalysisOptionsImpl();
     options.cacheSize = 42;
@@ -1810,7 +2081,7 @@
 
   void test_setAnalysisPriorityOrder() {
     int priorityCount = 4;
-    List<Source> sources = new List<Source>();
+    List<Source> sources = <Source>[];
     for (int index = 0; index < priorityCount; index++) {
       sources.add(addSource("/lib.dart$index", ""));
     }
@@ -1819,15 +2090,28 @@
   }
 
   void test_setAnalysisPriorityOrder_empty() {
-    context.analysisPriorityOrder = new List<Source>();
+    context.analysisPriorityOrder = <Source>[];
   }
 
   void test_setAnalysisPriorityOrder_nonEmpty() {
-    List<Source> sources = new List<Source>();
+    List<Source> sources = <Source>[];
     sources.add(addSource("/lib.dart", "library lib;"));
     context.analysisPriorityOrder = sources;
   }
 
+  void test_setAnalysisPriorityOrder_resetAnalysisDriver() {
+    Source source = addSource('/lib.dart', 'library lib;');
+    // start analysis
+    context.performAnalysisTask();
+    expect(context.driver.currentWorkOrder, isNotNull);
+    // set priority sources, AnalysisDriver is reset
+    context.analysisPriorityOrder = <Source>[source];
+    expect(context.driver.currentWorkOrder, isNull);
+    // analysis continues
+    context.performAnalysisTask();
+    expect(context.driver.currentWorkOrder, isNotNull);
+  }
+
   Future test_setChangedContents_libraryWithPart() {
     AnalysisOptionsImpl options = new AnalysisOptionsImpl();
     options.incremental = true;
@@ -1910,7 +2194,9 @@
   }
 
   void test_setContents_null() {
-    Source librarySource = addSource("/lib.dart", r'''
+    Source librarySource = addSource(
+        "/lib.dart",
+        r'''
 library lib;
 int a = 0;''');
     context.setContents(librarySource, '// different');
@@ -1958,6 +2244,22 @@
     expect(context.sourcesNeedingProcessing.contains(source), isFalse);
   }
 
+  void test_validateCacheConsistency_deletedSource() {
+    MemoryResourceProvider resourceProvider = new MemoryResourceProvider();
+    var fileA = resourceProvider.newFile('/a.dart', "");
+    var fileB = resourceProvider.newFile('/b.dart', "import 'a.dart';");
+    Source sourceA = fileA.createSource();
+    Source sourceB = fileB.createSource();
+    context.applyChanges(
+        new ChangeSet()..addedSource(sourceA)..addedSource(sourceB));
+    // analyze everything
+    _analyzeAll_assertFinished();
+    // delete a.dart
+    resourceProvider.deleteFile('/a.dart');
+    // analysis should eventually stop
+    _analyzeAll_assertFinished();
+  }
+
   void xtest_performAnalysisTask_stress() {
     int maxCacheSize = 4;
     AnalysisOptionsImpl options =
@@ -1965,7 +2267,7 @@
     options.cacheSize = maxCacheSize;
     context.analysisOptions = options;
     int sourceCount = maxCacheSize + 2;
-    List<Source> sources = new List<Source>();
+    List<Source> sources = <Source>[];
     ChangeSet changeSet = new ChangeSet();
     for (int i = 0; i < sourceCount; i++) {
       Source source = addSource("/lib$i.dart", "library lib$i;");
@@ -2008,12 +2310,33 @@
     for (int i = 0; i < maxIterations; i++) {
       List<ChangeNotice> notice = context.performAnalysisTask().changeNotices;
       if (notice == null) {
-        return;
+        bool inconsistent = context.validateCacheConsistency();
+        if (!inconsistent) {
+          return;
+        }
       }
     }
     fail("performAnalysisTask failed to terminate after analyzing all sources");
   }
 
+  void _assertNoExceptions() {
+    MapIterator<AnalysisTarget, CacheEntry> iterator = analysisCache.iterator();
+    String exceptionsStr = '';
+    while (iterator.moveNext()) {
+      CaughtException exception = iterator.value.exception;
+      if (exception != null) {
+        AnalysisTarget target = iterator.key;
+        exceptionsStr +=
+            '============= key: $target   source: ${target.source}\n';
+        exceptionsStr += exception.toString();
+        exceptionsStr += '\n';
+      }
+    }
+    if (exceptionsStr.isNotEmpty) {
+      fail(exceptionsStr);
+    }
+  }
+
   void _changeSource(TestSource source, String contents) {
     source.setContents(contents);
     ChangeSet changeSet = new ChangeSet();
@@ -2044,8 +2367,8 @@
     entry.setState(RESOLVED_UNIT, CacheState.FLUSHED);
   }
 
-  List<Source> _getPriorityOrder(AnalysisContextImpl context2) {
-    return context2.test_priorityOrder;
+  List<Source> _getPriorityOrder(AnalysisContextImpl context) {
+    return context.test_priorityOrder;
   }
 
   void _performPendingAnalysisTasks([int maxTasks = 512]) {
@@ -2097,7 +2420,9 @@
   }
 
   void test_noChange_thenChange() {
-    Source sourceA = addSource("/a.dart", r'''
+    Source sourceA = addSource(
+        "/a.dart",
+        r'''
 library lib_a;
 
 class A {
@@ -2107,7 +2432,9 @@
   B();
 }
 ''');
-    Source sourceB = addSource("/b.dart", r'''
+    Source sourceB = addSource(
+        "/b.dart",
+        r'''
 library lib_b;
 import 'a.dart';
 main() {
@@ -2121,7 +2448,9 @@
     var unitElementA = unitA.element;
     var libraryElementA = unitElementA.library;
     // Update a.dart, no declaration changes.
-    context.setContents(sourceA, r'''
+    context.setContents(
+        sourceA,
+        r'''
 library lib_a;
 class A {
   A();
@@ -2131,7 +2460,7 @@
 }
 ''');
     _assertInvalid(sourceA, LIBRARY_ERRORS_READY);
-    _assertValid(sourceB, LIBRARY_ERRORS_READY);
+    _assertValid(sourceB, LIBRARY_ELEMENT);
     // The a.dart's unit and element are updated incrementally.
     // They are the same instances as initially.
     // So, all the references from other units are still valid.
@@ -2154,7 +2483,9 @@
     }
     // Update a.dart, rename A to A2, invalidates b.dart, so
     // we know that the previous update did not damage dependencies.
-    context.setContents(sourceA, r'''
+    context.setContents(
+        sourceA,
+        r'''
 library lib_a;
 class A {
   A();
@@ -2165,7 +2496,7 @@
 }
 ''');
     _assertInvalid(sourceA, LIBRARY_ERRORS_READY);
-    _assertInvalid(sourceB, LIBRARY_ERRORS_READY);
+    _assertInvalid(sourceB, LIBRARY_ELEMENT);
     // The a.dart's unit and element are the same.
     {
       LibrarySpecificUnit target = new LibrarySpecificUnit(sourceA, sourceA);
@@ -2180,13 +2511,17 @@
   }
 
   void test_unusedName() {
-    Source sourceA = addSource("/a.dart", r'''
+    Source sourceA = addSource(
+        "/a.dart",
+        r'''
 library lib_a;
 class A {}
 class B {}
 class C {}
 ''');
-    Source sourceB = addSource("/b.dart", r'''
+    Source sourceB = addSource(
+        "/b.dart",
+        r'''
 library lib_b;
 import 'a.dart';
 main() {
@@ -2196,7 +2531,9 @@
 ''');
     _performPendingAnalysisTasks();
     // Update A.
-    context.setContents(sourceA, r'''
+    context.setContents(
+        sourceA,
+        r'''
 library lib_a;
 class A {}
 class B2 {}
@@ -2209,13 +2546,17 @@
   }
 
   void test_usedName_directUser() {
-    Source sourceA = addSource("/a.dart", r'''
+    Source sourceA = addSource(
+        "/a.dart",
+        r'''
 library lib_a;
 class A {}
 class B {}
 class C {}
 ''');
-    Source sourceB = addSource("/b.dart", r'''
+    Source sourceB = addSource(
+        "/b.dart",
+        r'''
 library lib_b;
 import 'a.dart';
 main() {
@@ -2226,7 +2567,9 @@
     _performPendingAnalysisTasks();
     expect(context.getErrors(sourceB).errors, hasLength(1));
     // Update a.dart, invalidates b.dart because it references "C2".
-    context.setContents(sourceA, r'''
+    context.setContents(
+        sourceA,
+        r'''
 library lib_a;
 class A {}
 class B {}
@@ -2238,7 +2581,9 @@
     _performPendingAnalysisTasks();
     expect(context.getErrors(sourceB).errors, hasLength(0));
     // Update a.dart, invalidates b.dart because it references "C".
-    context.setContents(sourceA, r'''
+    context.setContents(
+        sourceA,
+        r'''
 library lib_a;
 class A {}
 class B {}
@@ -2252,13 +2597,17 @@
   }
 
   void test_usedName_directUser_withIncremental() {
-    Source sourceA = addSource("/a.dart", r'''
+    Source sourceA = addSource(
+        "/a.dart",
+        r'''
 library lib_a;
 class A {
   m() {}
 }
 ''');
-    Source sourceB = addSource("/b.dart", r'''
+    Source sourceB = addSource(
+        "/b.dart",
+        r'''
 library lib_b;
 import 'a.dart';
 main() {
@@ -2268,7 +2617,9 @@
 ''');
     _performPendingAnalysisTasks();
     // Update A.
-    context.setContents(sourceA, r'''
+    context.setContents(
+        sourceA,
+        r'''
 library lib_a;
 class A {
   m2() {}
@@ -2279,18 +2630,24 @@
   }
 
   void test_usedName_indirectUser() {
-    Source sourceA = addSource("/a.dart", r'''
+    Source sourceA = addSource(
+        "/a.dart",
+        r'''
 library lib_a;
 class A {
   m() {}
 }
 ''');
-    Source sourceB = addSource("/b.dart", r'''
+    Source sourceB = addSource(
+        "/b.dart",
+        r'''
 library lib_b;
 import 'a.dart';
 class B extends A {}
 ''');
-    Source sourceC = addSource("/c.dart", r'''
+    Source sourceC = addSource(
+        "/c.dart",
+        r'''
 library lib_c;
 import 'b.dart';
 class C extends B {
@@ -2303,7 +2660,9 @@
     _performPendingAnalysisTasks();
     expect(context.getErrors(sourceC).errors, hasLength(0));
     // Replace "A.m" with "A.m2", invalidate both b.dart and c.dart files.
-    context.setContents(sourceA, r'''
+    context.setContents(
+        sourceA,
+        r'''
 library lib_a;
 class A {
   m2() {}
@@ -2317,7 +2676,9 @@
     expect(context.getErrors(sourceB).errors, hasLength(0));
     expect(context.getErrors(sourceC).errors, hasLength(1));
     // Restore "A.m", invalidate both b.dart and c.dart files.
-    context.setContents(sourceA, r'''
+    context.setContents(
+        sourceA,
+        r'''
 library lib_a;
 class A {
   m() {}
diff --git a/pkg/analyzer/test/src/context/mock_sdk.dart b/pkg/analyzer/test/src/context/mock_sdk.dart
index e5b7bcb..121fb5d 100644
--- a/pkg/analyzer/test/src/context/mock_sdk.dart
+++ b/pkg/analyzer/test/src/context/mock_sdk.dart
@@ -14,8 +14,10 @@
 import 'package:analyzer/src/generated/source.dart';
 
 class MockSdk implements DartSdk {
-  static const _MockSdkLibrary LIB_CORE = const _MockSdkLibrary('dart:core',
-      '/lib/core/core.dart', '''
+  static const _MockSdkLibrary LIB_CORE = const _MockSdkLibrary(
+      'dart:core',
+      '/lib/core/core.dart',
+      '''
 library dart.core;
 
 import 'dart:async';
@@ -108,31 +110,45 @@
 const Object override = const _Override();
 ''');
 
-  static const _MockSdkLibrary LIB_ASYNC = const _MockSdkLibrary('dart:async',
-      '/lib/async/async.dart', '''
+  static const _MockSdkLibrary LIB_ASYNC = const _MockSdkLibrary(
+      'dart:async',
+      '/lib/async/async.dart',
+      '''
 library dart.async;
 
 import 'dart:math';
 
+part 'stream.dart';
+
 class Future<T> {
   factory Future.delayed(Duration duration, [T computation()]) => null;
   factory Future.value([value]) => null;
   static Future wait(List<Future> futures) => null;
 }
-
+''',
+      const <_MockSdkFile>[
+    const _MockSdkFile(
+        '/lib/async/stream.dart',
+        r'''
+part of dart.async;
 class Stream<T> {}
 abstract class StreamTransformer<S, T> {}
-''');
+''')
+  ]);
 
   static const _MockSdkLibrary LIB_COLLECTION = const _MockSdkLibrary(
-      'dart:collection', '/lib/collection/collection.dart', '''
+      'dart:collection',
+      '/lib/collection/collection.dart',
+      '''
 library dart.collection;
 
 abstract class HashMap<K, V> implements Map<K, V> {}
 ''');
 
   static const _MockSdkLibrary LIB_CONVERT = const _MockSdkLibrary(
-      'dart:convert', '/lib/convert/convert.dart', '''
+      'dart:convert',
+      '/lib/convert/convert.dart',
+      '''
 library dart.convert;
 
 import 'dart:async';
@@ -141,8 +157,10 @@
 class JsonDecoder extends Converter<String, Object> {}
 ''');
 
-  static const _MockSdkLibrary LIB_MATH = const _MockSdkLibrary('dart:math',
-      '/lib/math/math.dart', '''
+  static const _MockSdkLibrary LIB_MATH = const _MockSdkLibrary(
+      'dart:math',
+      '/lib/math/math.dart',
+      '''
 library dart.math;
 const double E = 2.718281828459045;
 const double PI = 3.1415926535897932;
@@ -159,8 +177,10 @@
 }
 ''');
 
-  static const _MockSdkLibrary LIB_HTML = const _MockSdkLibrary('dart:html',
-      '/lib/html/dartium/html_dartium.dart', '''
+  static const _MockSdkLibrary LIB_HTML = const _MockSdkLibrary(
+      'dart:html',
+      '/lib/html/dartium/html_dartium.dart',
+      '''
 library dart.html;
 class HtmlElement {}
 ''');
@@ -185,6 +205,9 @@
   MockSdk() {
     LIBRARIES.forEach((_MockSdkLibrary library) {
       provider.newFile(library.path, library.content);
+      library.parts.forEach((file) {
+        provider.newFile(file.path, file.content);
+      });
     });
   }
 
@@ -268,6 +291,7 @@
       "dart:core": "/lib/core/core.dart",
       "dart:html": "/lib/html/dartium/html_dartium.dart",
       "dart:async": "/lib/async/async.dart",
+      "dart:async/stream.dart": "/lib/async/stream.dart",
       "dart:collection": "/lib/collection/collection.dart",
       "dart:convert": "/lib/convert/convert.dart",
       "dart:math": "/lib/math/math.dart"
@@ -290,8 +314,10 @@
   final String shortName;
   final String path;
   final String content;
+  final List<_MockSdkFile> parts;
 
-  const _MockSdkLibrary(this.shortName, this.path, this.content);
+  const _MockSdkLibrary(this.shortName, this.path, this.content,
+      [this.parts = const <_MockSdkFile>[]]);
 
   @override
   String get category => throw unimplemented;
@@ -317,6 +343,13 @@
   UnimplementedError get unimplemented => new UnimplementedError();
 }
 
+class _MockSdkFile {
+  final String path;
+  final String content;
+
+  const _MockSdkFile(this.path, this.content);
+}
+
 /**
  * An [AnalysisContextImpl] that only contains sources for a Dart SDK.
  */
diff --git a/pkg/analyzer/test/src/context/test_all.dart b/pkg/analyzer/test/src/context/test_all.dart
index d3e5f76..bbd021d 100644
--- a/pkg/analyzer/test/src/context/test_all.dart
+++ b/pkg/analyzer/test/src/context/test_all.dart
@@ -6,12 +6,13 @@
 
 import 'package:unittest/unittest.dart';
 
+import '../../utils.dart';
 import 'cache_test.dart' as cache_test;
 import 'context_test.dart' as context_test;
 
 /// Utility for manually running all tests.
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   group('context tests', () {
     cache_test.main();
     context_test.main();
diff --git a/pkg/analyzer/test/src/mock_sdk.dart b/pkg/analyzer/test/src/mock_sdk.dart
index 1487f4a..d4f6ac1 100644
--- a/pkg/analyzer/test/src/mock_sdk.dart
+++ b/pkg/analyzer/test/src/mock_sdk.dart
@@ -12,8 +12,10 @@
 import 'package:analyzer/src/generated/source.dart';
 
 class MockSdk implements DartSdk {
-  static const _MockSdkLibrary LIB_CORE = const _MockSdkLibrary('dart:core',
-      '/lib/core/core.dart', '''
+  static const _MockSdkLibrary LIB_CORE = const _MockSdkLibrary(
+      'dart:core',
+      '/lib/core/core.dart',
+      '''
 library dart.core;
 
 import 'dart:async';
@@ -106,8 +108,10 @@
 const Object override = const _Override();
 ''');
 
-  static const _MockSdkLibrary LIB_ASYNC = const _MockSdkLibrary('dart:async',
-      '/lib/async/async.dart', '''
+  static const _MockSdkLibrary LIB_ASYNC = const _MockSdkLibrary(
+      'dart:async',
+      '/lib/async/async.dart',
+      '''
 library dart.async;
 
 import 'dart:math';
@@ -123,14 +127,18 @@
 ''');
 
   static const _MockSdkLibrary LIB_COLLECTION = const _MockSdkLibrary(
-      'dart:collection', '/lib/collection/collection.dart', '''
+      'dart:collection',
+      '/lib/collection/collection.dart',
+      '''
 library dart.collection;
 
 abstract class HashMap<K, V> implements Map<K, V> {}
 ''');
 
   static const _MockSdkLibrary LIB_CONVERT = const _MockSdkLibrary(
-      'dart:convert', '/lib/convert/convert.dart', '''
+      'dart:convert',
+      '/lib/convert/convert.dart',
+      '''
 library dart.convert;
 
 import 'dart:async';
@@ -139,8 +147,10 @@
 class JsonDecoder extends Converter<String, Object> {}
 ''');
 
-  static const _MockSdkLibrary LIB_MATH = const _MockSdkLibrary('dart:math',
-      '/lib/math/math.dart', '''
+  static const _MockSdkLibrary LIB_MATH = const _MockSdkLibrary(
+      'dart:math',
+      '/lib/math/math.dart',
+      '''
 library dart.math;
 const double E = 2.718281828459045;
 const double PI = 3.1415926535897932;
@@ -157,8 +167,10 @@
 }
 ''');
 
-  static const _MockSdkLibrary LIB_HTML = const _MockSdkLibrary('dart:html',
-      '/lib/html/dartium/html_dartium.dart', '''
+  static const _MockSdkLibrary LIB_HTML = const _MockSdkLibrary(
+      'dart:html',
+      '/lib/html/dartium/html_dartium.dart',
+      '''
 library dart.html;
 class HtmlElement {}
 ''');
diff --git a/pkg/analyzer/test/src/plugin/plugin_config_test.dart b/pkg/analyzer/test/src/plugin/plugin_config_test.dart
new file mode 100644
index 0000000..cc06b96
--- /dev/null
+++ b/pkg/analyzer/test/src/plugin/plugin_config_test.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.
+
+library test.src.plugin.plugin_config_test;
+
+import 'package:analyzer/source/analysis_options_provider.dart';
+import 'package:analyzer/src/plugin/plugin_configuration.dart';
+import 'package:unittest/unittest.dart';
+import 'package:yaml/yaml.dart';
+
+main() {
+  group('plugin config tests', () {
+    group('parsing', () {
+      test('plugin map', () {
+        const optionsSrc = '''
+analyzer:
+  plugins:
+    my_plugin1: ^0.1.0 #shorthand 
+    my_plugin2:
+      version: ^0.2.0
+    my_plugin3:
+      class_name: MyPlugin
+      library_uri: myplugin/myplugin.dart
+      path: '/u/disk/src/'
+''';
+        var config = parseConfig(optionsSrc);
+        var plugins = pluginsSortedByName(config.plugins);
+        expect(plugins, hasLength(3));
+        expect(plugins[0].name, equals('my_plugin1'));
+        expect(plugins[0].version, equals('^0.1.0'));
+        expect(plugins[1].name, equals('my_plugin2'));
+        expect(plugins[1].version, equals('^0.2.0'));
+        expect(plugins[2].name, equals('my_plugin3'));
+        expect(plugins[2].version, isNull);
+        expect(plugins[2].path, equals('/u/disk/src/'));
+        expect(plugins[2].libraryUri, equals('myplugin/myplugin.dart'));
+        expect(plugins[2].className, equals('MyPlugin'));
+      });
+
+      test('plugin map (empty)', () {
+        const optionsSrc = '''
+analyzer:
+  plugins:
+    # my_plugin1: ^0.1.0 #shorthand 
+''';
+        var config = parseConfig(optionsSrc);
+        // Commented out plugins shouldn't cause a parse failure.
+        expect(config.plugins, hasLength(0));
+      });
+
+      test('plugin manifest', () {
+        const manifestSrc = '''
+class_name: AnalyzerPlugin
+library_uri: myplugin/analyzer_plugin.dart
+contributes_to: analyzer  
+''';
+        var manifest = parsePluginManifestString(manifestSrc);
+        var plugin = manifest.plugin;
+        expect(plugin.libraryUri, equals('myplugin/analyzer_plugin.dart'));
+        expect(plugin.className, equals('AnalyzerPlugin'));
+        expect(manifest.contributesTo, unorderedEquals(['analyzer']));
+      });
+
+      test('plugin manifest (contributes_to list)', () {
+        const manifestSrc = '''
+class_name: AnalyzerPlugin
+library_uri: myplugin/analyzer_plugin.dart
+contributes_to: 
+  - analyzer
+  - analysis_server  
+''';
+        var manifest = parsePluginManifestString(manifestSrc);
+        var plugin = manifest.plugin;
+        expect(plugin.libraryUri, equals('myplugin/analyzer_plugin.dart'));
+        expect(plugin.className, equals('AnalyzerPlugin'));
+        expect(manifest.contributesTo,
+            unorderedEquals(['analyzer', 'analysis_server']));
+      });
+
+      group('errors', () {
+        test('bad config format', () {
+          const optionsSrc = '''
+analyzer:
+  plugins:
+    - my_plugin1
+    - my_plugin2
+''';
+          try {
+            parseConfig(optionsSrc);
+            fail('expected PluginConfigFormatException');
+          } on PluginConfigFormatException catch (e) {
+            expect(
+                e.message,
+                equals(
+                    'Unrecognized plugin config format, expected `YamlMap`, got `YamlList`'));
+            expect(e.yamlNode, new isInstanceOf<YamlList>());
+          }
+        });
+        test('bad manifest format', () {
+          const manifestSource = '''
+library_uri:
+ - should be a scalar uri
+''';
+          try {
+            parsePluginManifestString(manifestSource);
+            fail('expected PluginConfigFormatException');
+          } on PluginConfigFormatException catch (e) {
+            expect(
+                e.message,
+                equals(
+                    'Unable to parse pugin manifest, expected `String`, got `YamlList`'));
+            expect(e.yamlNode, new isInstanceOf<YamlList>());
+          }
+        });
+      });
+    });
+  });
+}
+
+PluginConfig parseConfig(String optionsSrc) {
+  var options = new AnalysisOptionsProvider().getOptionsFromString(optionsSrc);
+  return new PluginConfig.fromOptions(options);
+}
+
+List<PluginInfo> pluginsSortedByName(Iterable<PluginInfo> plugins) =>
+    plugins.toList()..sort((p1, p2) => p1.name.compareTo(p2.name));
diff --git a/pkg/analyzer/test/src/task/dart_test.dart b/pkg/analyzer/test/src/task/dart_test.dart
index 77db010..a60b879 100644
--- a/pkg/analyzer/test/src/task/dart_test.dart
+++ b/pkg/analyzer/test/src/task/dart_test.dart
@@ -15,89 +15,125 @@
 import 'package:analyzer/src/generated/scanner.dart';
 import 'package:analyzer/src/generated/sdk.dart';
 import 'package:analyzer/src/generated/source.dart';
+import 'package:analyzer/src/services/lint.dart';
 import 'package:analyzer/src/task/dart.dart';
 import 'package:analyzer/src/task/html.dart';
+import 'package:analyzer/src/task/strong/info.dart';
 import 'package:analyzer/task/dart.dart';
 import 'package:analyzer/task/general.dart';
 import 'package:analyzer/task/model.dart';
 import 'package:unittest/unittest.dart';
 
+import '../../generated/resolver_test.dart';
 import '../../generated/test_support.dart';
 import '../../reflective_tests.dart';
+import '../../utils.dart';
 import '../context/abstract_context.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   runReflectiveTests(BuildCompilationUnitElementTaskTest);
   runReflectiveTests(BuildDirectiveElementsTaskTest);
   runReflectiveTests(BuildEnumMemberElementsTaskTest);
-  runReflectiveTests(BuildSourceExportClosureTaskTest);
-  runReflectiveTests(BuildSourceImportExportClosureTaskTest);
   runReflectiveTests(BuildExportNamespaceTaskTest);
   runReflectiveTests(BuildLibraryElementTaskTest);
   runReflectiveTests(BuildPublicNamespaceTaskTest);
+  runReflectiveTests(BuildSourceExportClosureTaskTest);
   runReflectiveTests(BuildTypeProviderTaskTest);
   runReflectiveTests(ComputeConstantDependenciesTaskTest);
   runReflectiveTests(ComputeConstantValueTaskTest);
+  runReflectiveTests(ComputeInferableStaticVariableDependenciesTaskTest);
+  runReflectiveTests(ComputeLibraryCycleTaskTest);
   runReflectiveTests(ContainingLibrariesTaskTest);
   runReflectiveTests(DartErrorsTaskTest);
   runReflectiveTests(EvaluateUnitConstantsTaskTest);
   runReflectiveTests(GatherUsedImportedElementsTaskTest);
   runReflectiveTests(GatherUsedLocalElementsTaskTest);
   runReflectiveTests(GenerateHintsTaskTest);
+  runReflectiveTests(GenerateLintsTaskTest);
+  runReflectiveTests(InferInstanceMembersInUnitTaskTest);
+  runReflectiveTests(InferStaticVariableTypesInUnitTaskTest);
+  runReflectiveTests(InferStaticVariableTypeTaskTest);
   runReflectiveTests(LibraryErrorsReadyTaskTest);
   runReflectiveTests(LibraryUnitErrorsTaskTest);
   runReflectiveTests(ParseDartTaskTest);
-  runReflectiveTests(ResolveUnitTypeNamesTaskTest);
+  runReflectiveTests(PartiallyResolveUnitReferencesTaskTest);
+  runReflectiveTests(ResolveInstanceFieldsInUnitTaskTest);
   runReflectiveTests(ResolveLibraryTypeNamesTaskTest);
-  runReflectiveTests(ResolveReferencesTaskTest);
+  runReflectiveTests(ResolveUnitTaskTest);
+  runReflectiveTests(ResolveUnitTypeNamesTaskTest);
   runReflectiveTests(ResolveVariableReferencesTaskTest);
   runReflectiveTests(ScanDartTaskTest);
+  runReflectiveTests(StrongModeInferenceTest);
+  runReflectiveTests(StrongModeVerifyUnitTaskTest);
   runReflectiveTests(VerifyUnitTaskTest);
 }
 
+isInstanceOf isBuildCompilationUnitElementTask =
+    new isInstanceOf<BuildCompilationUnitElementTask>();
+isInstanceOf isBuildDirectiveElementsTask =
+    new isInstanceOf<BuildDirectiveElementsTask>();
+isInstanceOf isBuildEnumMemberElementsTask =
+    new isInstanceOf<BuildEnumMemberElementsTask>();
+isInstanceOf isBuildExportNamespaceTask =
+    new isInstanceOf<BuildExportNamespaceTask>();
+isInstanceOf isBuildLibraryElementTask =
+    new isInstanceOf<BuildLibraryElementTask>();
+isInstanceOf isBuildPublicNamespaceTask =
+    new isInstanceOf<BuildPublicNamespaceTask>();
+isInstanceOf isBuildSourceExportClosureTask =
+    new isInstanceOf<BuildSourceExportClosureTask>();
+isInstanceOf isBuildTypeProviderTask =
+    new isInstanceOf<BuildTypeProviderTask>();
+isInstanceOf isComputeConstantDependenciesTask =
+    new isInstanceOf<ComputeConstantDependenciesTask>();
+isInstanceOf isComputeConstantValueTask =
+    new isInstanceOf<ComputeConstantValueTask>();
+isInstanceOf isComputeInferableStaticVariableDependenciesTask =
+    new isInstanceOf<ComputeInferableStaticVariableDependenciesTask>();
+isInstanceOf isContainingLibrariesTask =
+    new isInstanceOf<ContainingLibrariesTask>();
+isInstanceOf isDartErrorsTask = new isInstanceOf<DartErrorsTask>();
+isInstanceOf isEvaluateUnitConstantsTask =
+    new isInstanceOf<EvaluateUnitConstantsTask>();
+isInstanceOf isGatherUsedImportedElementsTask =
+    new isInstanceOf<GatherUsedImportedElementsTask>();
+isInstanceOf isGatherUsedLocalElementsTask =
+    new isInstanceOf<GatherUsedLocalElementsTask>();
+isInstanceOf isGenerateHintsTask = new isInstanceOf<GenerateHintsTask>();
+isInstanceOf isGenerateLintsTask = new isInstanceOf<GenerateLintsTask>();
+isInstanceOf isInferInstanceMembersInUnitTask =
+    new isInstanceOf<InferInstanceMembersInUnitTask>();
+isInstanceOf isInferStaticVariableTypesInUnitTask =
+    new isInstanceOf<InferStaticVariableTypesInUnitTask>();
+isInstanceOf isInferStaticVariableTypeTask =
+    new isInstanceOf<InferStaticVariableTypeTask>();
+isInstanceOf isLibraryErrorsReadyTask =
+    new isInstanceOf<LibraryErrorsReadyTask>();
+isInstanceOf isLibraryUnitErrorsTask =
+    new isInstanceOf<LibraryUnitErrorsTask>();
+isInstanceOf isParseDartTask = new isInstanceOf<ParseDartTask>();
+isInstanceOf isPartiallyResolveUnitReferencesTask =
+    new isInstanceOf<PartiallyResolveUnitReferencesTask>();
+isInstanceOf isResolveLibraryTypeNamesTask =
+    new isInstanceOf<ResolveLibraryTypeNamesTask>();
+isInstanceOf isResolveUnitTask = new isInstanceOf<ResolveUnitTask>();
+isInstanceOf isResolveUnitTypeNamesTask =
+    new isInstanceOf<ResolveUnitTypeNamesTask>();
+isInstanceOf isResolveVariableReferencesTask =
+    new isInstanceOf<ResolveVariableReferencesTask>();
+isInstanceOf isScanDartTask = new isInstanceOf<ScanDartTask>();
+isInstanceOf isStrongModeVerifyUnitTask =
+    new isInstanceOf<StrongModeVerifyUnitTask>();
+isInstanceOf isVerifyUnitTask = new isInstanceOf<VerifyUnitTask>();
+
+final LintCode _testLintCode = new LintCode('test lint', 'test lint code');
+
 @reflectiveTest
 class BuildCompilationUnitElementTaskTest extends _AbstractDartTaskTest {
   Source source;
   LibrarySpecificUnit target;
 
-  test_buildInputs() {
-    LibrarySpecificUnit target =
-        new LibrarySpecificUnit(emptySource, emptySource);
-    Map<String, TaskInput> inputs =
-        BuildCompilationUnitElementTask.buildInputs(target);
-    expect(inputs, isNotNull);
-    expect(inputs.keys, unorderedEquals(
-        [BuildCompilationUnitElementTask.PARSED_UNIT_INPUT_NAME]));
-  }
-
-  test_constructor() {
-    BuildCompilationUnitElementTask task =
-        new BuildCompilationUnitElementTask(context, emptySource);
-    expect(task, isNotNull);
-    expect(task.context, context);
-    expect(task.target, emptySource);
-  }
-
-  test_createTask() {
-    BuildCompilationUnitElementTask task =
-        BuildCompilationUnitElementTask.createTask(context, emptySource);
-    expect(task, isNotNull);
-    expect(task.context, context);
-    expect(task.target, emptySource);
-  }
-
-  test_description() {
-    BuildCompilationUnitElementTask task =
-        new BuildCompilationUnitElementTask(null, emptySource);
-    expect(task.description, isNotNull);
-  }
-
-  test_descriptor() {
-    TaskDescriptor descriptor = BuildCompilationUnitElementTask.DESCRIPTOR;
-    expect(descriptor, isNotNull);
-  }
-
   test_perform_find_constants() {
     _performBuildTask('''
 const x = 1;
@@ -113,7 +149,8 @@
     CompilationUnit unit = outputs[RESOLVED_UNIT1];
     CompilationUnitElement unitElement = outputs[COMPILATION_UNIT_ELEMENT];
     Annotation annotation = unit.declarations
-        .firstWhere((m) => m is FunctionDeclaration).metadata[0];
+        .firstWhere((m) => m is FunctionDeclaration)
+        .metadata[0];
     List<ConstantEvaluationTarget> expectedConstants = [
       unitElement.accessors.firstWhere((e) => e.isGetter).variable,
       unitElement.types[0].fields[0],
@@ -133,13 +170,16 @@
 import 'lib2.dart';
 export 'lib3.dart';
 part 'part.dart';
-class A {}
+final x = '';
+class A {
+  static final y = 0;
+}
 class B = Object with A;
 ''');
     expect(outputs, hasLength(3));
+    expect(outputs[COMPILATION_UNIT_CONSTANTS], isNotNull);
     expect(outputs[COMPILATION_UNIT_ELEMENT], isNotNull);
     expect(outputs[RESOLVED_UNIT1], isNotNull);
-    expect(outputs[COMPILATION_UNIT_CONSTANTS], isNotNull);
   }
 
   test_perform_reuseElement() {
@@ -156,7 +196,8 @@
     CacheEntry cacheEntry = analysisCache.get(target);
     cacheEntry.setState(RESOLVED_UNIT1, CacheState.INVALID);
     // compute again
-    computeResult(target, RESOLVED_UNIT1);
+    computeResult(target, RESOLVED_UNIT1,
+        matcher: isBuildCompilationUnitElementTask);
     expect(outputs[COMPILATION_UNIT_ELEMENT], same(unitElement));
     expect(outputs[RESOLVED_UNIT1], isNot(same(unit)));
   }
@@ -164,40 +205,13 @@
   void _performBuildTask(String content) {
     source = newSource('/test.dart', content);
     target = new LibrarySpecificUnit(source, source);
-    computeResult(target, RESOLVED_UNIT1);
-    expect(task, new isInstanceOf<BuildCompilationUnitElementTask>());
+    computeResult(target, RESOLVED_UNIT1,
+        matcher: isBuildCompilationUnitElementTask);
   }
 }
 
 @reflectiveTest
 class BuildDirectiveElementsTaskTest extends _AbstractDartTaskTest {
-  test_constructor() {
-    BuildDirectiveElementsTask task =
-        new BuildDirectiveElementsTask(context, emptySource);
-    expect(task, isNotNull);
-    expect(task.context, context);
-    expect(task.target, emptySource);
-  }
-
-  test_createTask() {
-    BuildDirectiveElementsTask task =
-        BuildDirectiveElementsTask.createTask(context, emptySource);
-    expect(task, isNotNull);
-    expect(task.context, context);
-    expect(task.target, emptySource);
-  }
-
-  test_description() {
-    BuildDirectiveElementsTask task =
-        new BuildDirectiveElementsTask(null, emptySource);
-    expect(task.description, isNotNull);
-  }
-
-  test_descriptor() {
-    TaskDescriptor descriptor = BuildDirectiveElementsTask.DESCRIPTOR;
-    expect(descriptor, isNotNull);
-  }
-
   test_perform() {
     List<Source> sources = newSources({
       '/libA.dart': '''
@@ -216,8 +230,8 @@
     Source sourceB = sources[1];
     Source sourceC = sources[2];
     // perform task
-    computeResult(sourceA, LIBRARY_ELEMENT2);
-    expect(task, new isInstanceOf<BuildDirectiveElementsTask>());
+    computeResult(sourceA, LIBRARY_ELEMENT2,
+        matcher: isBuildDirectiveElementsTask);
     // prepare outputs
     LibraryElement libraryElementA = outputs[LIBRARY_ELEMENT2];
     LibraryElement libraryElementB = _getImportLibraryInput(sourceB);
@@ -270,8 +284,8 @@
     });
     Source sourceA = sources[0];
     // perform task
-    computeResult(sourceA, LIBRARY_ELEMENT2);
-    expect(task, new isInstanceOf<BuildDirectiveElementsTask>());
+    computeResult(sourceA, LIBRARY_ELEMENT2,
+        matcher: isBuildDirectiveElementsTask);
     // prepare outputs
     CompilationUnit libraryUnitA = context
         .getCacheEntry(new LibrarySpecificUnit(sourceA, sourceA))
@@ -299,8 +313,8 @@
     List<Source> sources = newSources({'/libA.dart': ''});
     Source source = sources[0];
     // perform task
-    computeResult(source, LIBRARY_ELEMENT2);
-    expect(task, new isInstanceOf<BuildDirectiveElementsTask>());
+    computeResult(source, LIBRARY_ELEMENT2,
+        matcher: isBuildDirectiveElementsTask);
     // prepare outputs
     LibraryElement libraryElement = outputs[LIBRARY_ELEMENT2];
     // verify that dart:core has SDK context
@@ -323,8 +337,8 @@
     });
     Source sourceA = sources[0];
     // perform task
-    computeResult(sourceA, LIBRARY_ELEMENT2);
-    expect(task, new isInstanceOf<BuildDirectiveElementsTask>());
+    computeResult(sourceA, LIBRARY_ELEMENT2,
+        matcher: isBuildDirectiveElementsTask);
     // validate errors
     _assertErrorsWithCodes([CompileTimeErrorCode.EXPORT_OF_NON_LIBRARY]);
   }
@@ -341,8 +355,8 @@
     });
     Source sourceA = sources[0];
     // perform task
-    computeResult(sourceA, LIBRARY_ELEMENT2);
-    expect(task, new isInstanceOf<BuildDirectiveElementsTask>());
+    computeResult(sourceA, LIBRARY_ELEMENT2,
+        matcher: isBuildDirectiveElementsTask);
     // validate errors
     _assertErrorsWithCodes([CompileTimeErrorCode.IMPORT_OF_NON_LIBRARY]);
   }
@@ -356,8 +370,8 @@
     });
     Source source = sources[0];
     // perform task
-    computeResult(source, LIBRARY_ELEMENT2);
-    expect(task, new isInstanceOf<BuildDirectiveElementsTask>());
+    computeResult(source, LIBRARY_ELEMENT2,
+        matcher: isBuildDirectiveElementsTask);
     // prepare outputs
     LibraryElement libraryElement = outputs[LIBRARY_ELEMENT2];
     // has an explicit "dart:core" import
@@ -377,8 +391,8 @@
     });
     Source source = sources[0];
     // perform task
-    computeResult(source, LIBRARY_ELEMENT2);
-    expect(task, new isInstanceOf<BuildDirectiveElementsTask>());
+    computeResult(source, LIBRARY_ELEMENT2,
+        matcher: isBuildDirectiveElementsTask);
     // prepare outputs
     LibraryElement libraryElement = outputs[LIBRARY_ELEMENT2];
     expect(libraryElement.hasExtUri, isTrue);
@@ -401,30 +415,28 @@
     Source sourceA = sources[0];
     Source sourceB = sources[1];
     // perform task
-    computeResult(sourceA, LIBRARY_ELEMENT2);
-    expect(task, new isInstanceOf<BuildDirectiveElementsTask>());
+    computeResult(sourceA, LIBRARY_ELEMENT2,
+        matcher: isBuildDirectiveElementsTask);
     // prepare outputs
     CompilationUnit libraryUnitA = context
         .getCacheEntry(new LibrarySpecificUnit(sourceA, sourceA))
         .getValue(RESOLVED_UNIT1);
     // validate directives
-    {
-      ImportDirective importNodeB = libraryUnitA.directives[1];
-      SimpleIdentifier prefixNodeB = importNodeB.prefix;
-      ImportElement importElementB = importNodeB.element;
-      PrefixElement prefixElement = importElementB.prefix;
-      expect(importElementB, isNotNull);
-      expect(importElementB.importedLibrary, _getImportLibraryInput(sourceB));
-      expect(prefixElement, isNotNull);
-      expect(importElementB.prefixOffset, prefixElement.nameOffset);
-      expect(prefixNodeB.staticElement, prefixElement);
-      // PrefixElement "pref" is shared
-      ImportDirective importNodeC = libraryUnitA.directives[2];
-      SimpleIdentifier prefixNodeC = importNodeC.prefix;
-      ImportElement importElementC = importNodeC.element;
-      expect(prefixNodeC.staticElement, prefixElement);
-      expect(importElementC.prefix, prefixElement);
-    }
+    ImportDirective importNodeB = libraryUnitA.directives[1];
+    SimpleIdentifier prefixNodeB = importNodeB.prefix;
+    ImportElement importElementB = importNodeB.element;
+    PrefixElement prefixElement = importElementB.prefix;
+    expect(importElementB, isNotNull);
+    expect(importElementB.importedLibrary, _getImportLibraryInput(sourceB));
+    expect(prefixElement, isNotNull);
+    expect(importElementB.prefixOffset, prefixElement.nameOffset);
+    expect(prefixNodeB.staticElement, prefixElement);
+    // PrefixElement "pref" is shared
+    ImportDirective importNodeC = libraryUnitA.directives[2];
+    SimpleIdentifier prefixNodeC = importNodeC.prefix;
+    ImportElement importElementC = importNodeC.element;
+    expect(prefixNodeC.staticElement, prefixElement);
+    expect(importElementC.prefix, prefixElement);
   }
 
   void _assertErrorsWithCodes(List<ErrorCode> expectedErrorCodes) {
@@ -446,13 +458,15 @@
 @reflectiveTest
 class BuildEnumMemberElementsTaskTest extends _AbstractDartTaskTest {
   test_perform() {
-    Source source = newSource('/test.dart', '''
+    Source source = newSource(
+        '/test.dart',
+        '''
 enum MyEnum {
   A, B
 }
 ''');
-    computeResult(new LibrarySpecificUnit(source, source), RESOLVED_UNIT2);
-    expect(task, new isInstanceOf<BuildEnumMemberElementsTask>());
+    computeResult(new LibrarySpecificUnit(source, source), RESOLVED_UNIT2,
+        matcher: isBuildEnumMemberElementsTask);
     CompilationUnit unit = outputs[RESOLVED_UNIT2];
     // validate Element
     ClassElement enumElement = unit.element.getEnum('MyEnum');
@@ -508,101 +522,111 @@
 @reflectiveTest
 class BuildExportNamespaceTaskTest extends _AbstractDartTaskTest {
   test_perform_entryPoint() {
-    Source sourceA = newSource('/a.dart', '''
+    Source sourceA = newSource(
+        '/a.dart',
+        '''
 library lib_a;
 export 'b.dart';
 ''');
-    Source sourceB = newSource('/b.dart', '''
+    Source sourceB = newSource(
+        '/b.dart',
+        '''
 library lib_b;
 main() {}
 ''');
-    computeResult(sourceA, LIBRARY_ELEMENT4);
-    expect(task, new isInstanceOf<BuildExportNamespaceTask>());
+    computeResult(sourceA, LIBRARY_ELEMENT4,
+        matcher: isBuildExportNamespaceTask);
     // validate
-    {
-      LibraryElement library = outputs[LIBRARY_ELEMENT4];
-      FunctionElement entryPoint = library.entryPoint;
-      expect(entryPoint, isNotNull);
-      expect(entryPoint.source, sourceB);
-    }
+    LibraryElement library = outputs[LIBRARY_ELEMENT4];
+    FunctionElement entryPoint = library.entryPoint;
+    expect(entryPoint, isNotNull);
+    expect(entryPoint.source, sourceB);
   }
 
   test_perform_hideCombinator() {
-    Source sourceA = newSource('/a.dart', '''
+    Source sourceA = newSource(
+        '/a.dart',
+        '''
 library lib_a;
 export 'b.dart' hide B1;
 class A1 {}
 class A2 {}
 class _A3 {}
 ''');
-    newSource('/b.dart', '''
+    newSource(
+        '/b.dart',
+        '''
 library lib_b;
 class B1 {}
 class B2 {}
 class B3 {}
 class _B4 {}
 ''');
-    newSource('/c.dart', '''
+    newSource(
+        '/c.dart',
+        '''
 library lib_c;
 class C1 {}
 class C2 {}
 class C3 {}
 ''');
-    computeResult(sourceA, LIBRARY_ELEMENT4);
-    expect(task, new isInstanceOf<BuildExportNamespaceTask>());
+    computeResult(sourceA, LIBRARY_ELEMENT4,
+        matcher: isBuildExportNamespaceTask);
     // validate
-    {
-      LibraryElement library = outputs[LIBRARY_ELEMENT4];
-      Namespace namespace = library.exportNamespace;
-      Iterable<String> definedKeys = namespace.definedNames.keys;
-      expect(definedKeys, unorderedEquals(['A1', 'A2', 'B2', 'B3']));
-    }
+    LibraryElement library = outputs[LIBRARY_ELEMENT4];
+    Namespace namespace = library.exportNamespace;
+    Iterable<String> definedKeys = namespace.definedNames.keys;
+    expect(definedKeys, unorderedEquals(['A1', 'A2', 'B2', 'B3']));
   }
 
   test_perform_showCombinator() {
-    Source sourceA = newSource('/a.dart', '''
+    Source sourceA = newSource(
+        '/a.dart',
+        '''
 library lib_a;
 export 'b.dart' show B1;
 class A1 {}
 class A2 {}
 class _A3 {}
 ''');
-    newSource('/b.dart', '''
+    newSource(
+        '/b.dart',
+        '''
 library lib_b;
 class B1 {}
 class B2 {}
 class _B3 {}
 ''');
-    computeResult(sourceA, LIBRARY_ELEMENT4);
-    expect(task, new isInstanceOf<BuildExportNamespaceTask>());
+    computeResult(sourceA, LIBRARY_ELEMENT4,
+        matcher: isBuildExportNamespaceTask);
     // validate
-    {
-      LibraryElement library = outputs[LIBRARY_ELEMENT4];
-      Namespace namespace = library.exportNamespace;
-      Iterable<String> definedKeys = namespace.definedNames.keys;
-      expect(definedKeys, unorderedEquals(['A1', 'A2', 'B1']));
-    }
+    LibraryElement library = outputs[LIBRARY_ELEMENT4];
+    Namespace namespace = library.exportNamespace;
+    Iterable<String> definedKeys = namespace.definedNames.keys;
+    expect(definedKeys, unorderedEquals(['A1', 'A2', 'B1']));
   }
 
   test_perform_showCombinator_setter() {
-    Source sourceA = newSource('/a.dart', '''
+    Source sourceA = newSource(
+        '/a.dart',
+        '''
 library lib_a;
 export 'b.dart' show topLevelB;
 class A {}
 ''');
-    newSource('/b.dart', '''
+    newSource(
+        '/b.dart',
+        '''
 library lib_b;
 int topLevelB;
 ''');
-    computeResult(sourceA, LIBRARY_ELEMENT4);
-    expect(task, new isInstanceOf<BuildExportNamespaceTask>());
+    computeResult(sourceA, LIBRARY_ELEMENT4,
+        matcher: isBuildExportNamespaceTask);
     // validate
-    {
-      LibraryElement library = outputs[LIBRARY_ELEMENT4];
-      Namespace namespace = library.exportNamespace;
-      Iterable<String> definedKeys = namespace.definedNames.keys;
-      expect(definedKeys, unorderedEquals(['A', 'topLevelB', 'topLevelB=']));
-    }
+    LibraryElement library = outputs[LIBRARY_ELEMENT4];
+    Namespace namespace = library.exportNamespace;
+    Iterable<String> definedKeys = namespace.definedNames.keys;
+    expect(definedKeys, unorderedEquals(['A', 'topLevelB', 'topLevelB=']));
   }
 }
 
@@ -615,33 +639,6 @@
 
   LibraryElement libraryElement;
 
-  test_constructor() {
-    BuildLibraryElementTask task =
-        new BuildLibraryElementTask(context, emptySource);
-    expect(task, isNotNull);
-    expect(task.context, context);
-    expect(task.target, emptySource);
-  }
-
-  test_createTask() {
-    BuildLibraryElementTask task =
-        BuildLibraryElementTask.createTask(context, emptySource);
-    expect(task, isNotNull);
-    expect(task.context, context);
-    expect(task.target, emptySource);
-  }
-
-  test_description() {
-    BuildLibraryElementTask task =
-        new BuildLibraryElementTask(null, emptySource);
-    expect(task.description, isNotNull);
-  }
-
-  test_descriptor() {
-    TaskDescriptor descriptor = BuildLibraryElementTask.DESCRIPTOR;
-    expect(descriptor, isNotNull);
-  }
-
   test_perform() {
     _performBuildTask({
       '/lib.dart': '''
@@ -841,8 +838,12 @@
 void set test(_) {}
 '''
     });
-    CompilationUnitElement unitElement1 = partUnits[0].element;
-    CompilationUnitElement unitElement2 = partUnits[1].element;
+    CompilationUnitElement unitElement1 = partUnits
+        .singleWhere((u) => u.element.name.endsWith('part1.dart'))
+        .element;
+    CompilationUnitElement unitElement2 = partUnits
+        .singleWhere((u) => u.element.name.endsWith('part2.dart'))
+        .element;
     PropertyAccessorElement getter = unitElement1.accessors[0];
     PropertyAccessorElement setter = unitElement2.accessors[0];
     PropertyInducingElement variable = getter.variable;
@@ -862,8 +863,8 @@
   void _performBuildTask(Map<String, String> sourceMap) {
     List<Source> sources = newSources(sourceMap);
     Source libSource = sources.first;
-    computeResult(libSource, LIBRARY_ELEMENT1);
-    expect(task, new isInstanceOf<BuildLibraryElementTask>());
+    computeResult(libSource, LIBRARY_ELEMENT1,
+        matcher: isBuildLibraryElementTask);
     libraryUnit = context
         .getCacheEntry(new LibrarySpecificUnit(libSource, libSource))
         .getValue(RESOLVED_UNIT1);
@@ -876,41 +877,6 @@
 
 @reflectiveTest
 class BuildPublicNamespaceTaskTest extends _AbstractDartTaskTest {
-  test_buildInputs() {
-    Map<String, TaskInput> inputs =
-        BuildPublicNamespaceTask.buildInputs(emptySource);
-    expect(inputs, isNotNull);
-    expect(
-        inputs.keys, unorderedEquals([BuildPublicNamespaceTask.LIBRARY_INPUT]));
-  }
-
-  test_constructor() {
-    BuildPublicNamespaceTask task =
-        new BuildPublicNamespaceTask(context, emptySource);
-    expect(task, isNotNull);
-    expect(task.context, context);
-    expect(task.target, emptySource);
-  }
-
-  test_createTask() {
-    BuildPublicNamespaceTask task =
-        BuildPublicNamespaceTask.createTask(context, emptySource);
-    expect(task, isNotNull);
-    expect(task.context, context);
-    expect(task.target, emptySource);
-  }
-
-  test_description() {
-    BuildPublicNamespaceTask task =
-        new BuildPublicNamespaceTask(null, emptySource);
-    expect(task.description, isNotNull);
-  }
-
-  test_descriptor() {
-    TaskDescriptor descriptor = BuildPublicNamespaceTask.DESCRIPTOR;
-    expect(descriptor, isNotNull);
-  }
-
   test_perform() {
     List<Source> sources = newSources({
       '/lib.dart': '''
@@ -925,8 +891,8 @@
 d() {}
 '''
     });
-    computeResult(sources.first, LIBRARY_ELEMENT3);
-    expect(task, new isInstanceOf<BuildPublicNamespaceTask>());
+    computeResult(sources.first, LIBRARY_ELEMENT3,
+        matcher: isBuildPublicNamespaceTask);
     // validate
     LibraryElement library = outputs[LIBRARY_ELEMENT3];
     Namespace namespace = library.publicNamespace;
@@ -937,39 +903,47 @@
 @reflectiveTest
 class BuildSourceExportClosureTaskTest extends _AbstractDartTaskTest {
   test_perform_exportClosure() {
-    Source sourceA = newSource('/a.dart', '''
+    Source sourceA = newSource(
+        '/a.dart',
+        '''
 library lib_a;
 export 'b.dart';
 ''');
-    Source sourceB = newSource('/b.dart', '''
+    Source sourceB = newSource(
+        '/b.dart',
+        '''
 library lib_b;
 export 'c.dart';
 ''');
-    Source sourceC = newSource('/c.dart', '''
+    Source sourceC = newSource(
+        '/c.dart',
+        '''
 library lib_c;
 export 'a.dart';
 ''');
-    Source sourceD = newSource('/d.dart', '''
+    Source sourceD = newSource(
+        '/d.dart',
+        '''
 library lib_d;
 ''');
     // a.dart
     {
-      computeResult(sourceA, EXPORT_SOURCE_CLOSURE);
-      expect(task, new isInstanceOf<BuildSourceExportClosureTask>());
+      computeResult(sourceA, EXPORT_SOURCE_CLOSURE,
+          matcher: isBuildSourceExportClosureTask);
       List<Source> closure = outputs[EXPORT_SOURCE_CLOSURE];
       expect(closure, unorderedEquals([sourceA, sourceB, sourceC]));
     }
     // c.dart
     {
-      computeResult(sourceC, EXPORT_SOURCE_CLOSURE);
-      expect(task, new isInstanceOf<BuildSourceExportClosureTask>());
+      computeResult(sourceC, EXPORT_SOURCE_CLOSURE,
+          matcher: isBuildSourceExportClosureTask);
       List<Source> closure = outputs[EXPORT_SOURCE_CLOSURE];
       expect(closure, unorderedEquals([sourceA, sourceB, sourceC]));
     }
     // d.dart
     {
-      computeResult(sourceD, EXPORT_SOURCE_CLOSURE);
-      expect(task, new isInstanceOf<BuildSourceExportClosureTask>());
+      computeResult(sourceD, EXPORT_SOURCE_CLOSURE,
+          matcher: isBuildSourceExportClosureTask);
       List<Source> closure = outputs[EXPORT_SOURCE_CLOSURE];
       expect(closure, unorderedEquals([sourceD]));
     }
@@ -977,97 +951,10 @@
 }
 
 @reflectiveTest
-class BuildSourceImportExportClosureTaskTest extends _AbstractDartTaskTest {
-  test_perform_importExportClosure() {
-    Source sourceA = newSource('/a.dart', '''
-library lib_a;
-''');
-    Source sourceB = newSource('/b.dart', '''
-library lib_b;
-export 'a.dart';
-''');
-    Source sourceC = newSource('/c.dart', '''
-library lib_c;
-import 'b.dart';
-''');
-    Source coreSource = context.sourceFactory.resolveUri(null, 'dart:core');
-    // c.dart
-    {
-      computeResult(sourceC, IMPORT_EXPORT_SOURCE_CLOSURE);
-      expect(task, new isInstanceOf<BuildSourceImportExportClosureTask>());
-      List<Source> closure = outputs[IMPORT_EXPORT_SOURCE_CLOSURE];
-      expect(closure, contains(sourceA));
-      expect(closure, contains(sourceB));
-      expect(closure, contains(sourceC));
-      expect(closure, contains(coreSource));
-    }
-    // b.dart
-    {
-      computeResult(sourceB, IMPORT_EXPORT_SOURCE_CLOSURE);
-      expect(task, new isInstanceOf<BuildSourceImportExportClosureTask>());
-      List<Source> closure = outputs[IMPORT_EXPORT_SOURCE_CLOSURE];
-      expect(closure, contains(sourceA));
-      expect(closure, contains(sourceB));
-      expect(closure, contains(coreSource));
-    }
-  }
-
-  test_perform_isClient_false() {
-    Source sourceA = newSource('/a.dart', '''
-library lib_a;
-import 'b.dart';
-''');
-    newSource('/b.dart', '''
-library lib_b;
-''');
-    computeResult(sourceA, IS_CLIENT);
-    expect(task, new isInstanceOf<BuildSourceImportExportClosureTask>());
-    expect(outputs[IS_CLIENT], isFalse);
-  }
-
-  test_perform_isClient_true_export_indirect() {
-    newSource('/exports_html.dart', '''
-library lib_exports_html;
-export 'dart:html';
-''');
-    Source source = newSource('/test.dart', '''
-import 'exports_html.dart';
-''');
-    computeResult(source, IS_CLIENT);
-    expect(task, new isInstanceOf<BuildSourceImportExportClosureTask>());
-    expect(outputs[IS_CLIENT], isTrue);
-  }
-
-  test_perform_isClient_true_import_direct() {
-    Source sourceA = newSource('/a.dart', '''
-library lib_a;
-import 'dart:html';
-''');
-    computeResult(sourceA, IS_CLIENT);
-    expect(task, new isInstanceOf<BuildSourceImportExportClosureTask>());
-    expect(outputs[IS_CLIENT], isTrue);
-  }
-
-  test_perform_isClient_true_import_indirect() {
-    Source sourceA = newSource('/a.dart', '''
-library lib_a;
-import 'b.dart';
-''');
-    newSource('/b.dart', '''
-library lib_b;
-import 'dart:html';
-''');
-    computeResult(sourceA, IS_CLIENT);
-    expect(task, new isInstanceOf<BuildSourceImportExportClosureTask>());
-    expect(outputs[IS_CLIENT], isTrue);
-  }
-}
-
-@reflectiveTest
 class BuildTypeProviderTaskTest extends _AbstractDartTaskTest {
   test_perform() {
-    computeResult(AnalysisContextTarget.request, TYPE_PROVIDER);
-    expect(task, new isInstanceOf<BuildTypeProviderTask>());
+    computeResult(AnalysisContextTarget.request, TYPE_PROVIDER,
+        matcher: isBuildTypeProviderTask);
     // validate
     TypeProvider typeProvider = outputs[TYPE_PROVIDER];
     expect(typeProvider, isNotNull);
@@ -1091,7 +978,9 @@
   }
 
   test_annotation_with_args() {
-    Source source = newSource('/test.dart', '''
+    Source source = newSource(
+        '/test.dart',
+        '''
 const x = 1;
 @D(x) class C {}
 class D { const D(value); }
@@ -1103,8 +992,10 @@
     CompilationUnit unit = outputs[RESOLVED_UNIT1];
     // Find the elements for x and D's constructor, and the annotation on C.
     List<PropertyAccessorElement> accessors = unit.element.accessors;
-    Element x = accessors.firstWhere((PropertyAccessorElement accessor) =>
-        accessor.isGetter && accessor.name == 'x').variable;
+    Element x = accessors
+        .firstWhere((PropertyAccessorElement accessor) =>
+            accessor.isGetter && accessor.name == 'x')
+        .variable;
     List<ClassElement> types = unit.element.types;
     Element constructorForD =
         types.firstWhere((ClassElement cls) => cls.name == 'D').constructors[0];
@@ -1112,14 +1003,19 @@
     // Now compute the dependencies for the annotation, and check that it is
     // the set [x, constructorForD].
     // TODO(paulberry): test librarySource != source
-    computeResult(new ConstantEvaluationTarget_Annotation(
-        context, source, source, annotation), CONSTANT_DEPENDENCIES);
+    computeResult(
+        new ConstantEvaluationTarget_Annotation(
+            context, source, source, annotation),
+        CONSTANT_DEPENDENCIES,
+        matcher: isComputeConstantDependenciesTask);
     expect(
         outputs[CONSTANT_DEPENDENCIES].toSet(), [x, constructorForD].toSet());
   }
 
   test_annotation_without_args() {
-    Source source = newSource('/test.dart', '''
+    Source source = newSource(
+        '/test.dart',
+        '''
 const x = 1;
 @x class C {}
 ''');
@@ -1130,18 +1026,25 @@
     CompilationUnit unit = outputs[RESOLVED_UNIT1];
     // Find the element for x and the annotation on C.
     List<PropertyAccessorElement> accessors = unit.element.accessors;
-    Element x = accessors.firstWhere((PropertyAccessorElement accessor) =>
-        accessor.isGetter && accessor.name == 'x').variable;
+    Element x = accessors
+        .firstWhere((PropertyAccessorElement accessor) =>
+            accessor.isGetter && accessor.name == 'x')
+        .variable;
     Annotation annotation = findClassAnnotation(unit, 'C');
     // Now compute the dependencies for the annotation, and check that it is
     // the list [x].
-    computeResult(new ConstantEvaluationTarget_Annotation(
-        context, source, source, annotation), CONSTANT_DEPENDENCIES);
+    computeResult(
+        new ConstantEvaluationTarget_Annotation(
+            context, source, source, annotation),
+        CONSTANT_DEPENDENCIES,
+        matcher: isComputeConstantDependenciesTask);
     expect(outputs[CONSTANT_DEPENDENCIES], [x]);
   }
 
   test_enumConstant() {
-    Source source = newSource('/test.dart', '''
+    Source source = newSource(
+        '/test.dart',
+        '''
 enum E {A, B, C}
 ''');
     // First compute the resolved unit for the source.
@@ -1155,12 +1058,15 @@
     FieldElement constantElement = constantDeclaration.element;
     // Now compute the dependencies for the constant and check that there are
     // none.
-    computeResult(constantElement, CONSTANT_DEPENDENCIES);
+    computeResult(constantElement, CONSTANT_DEPENDENCIES,
+        matcher: isComputeConstantDependenciesTask);
     expect(outputs[CONSTANT_DEPENDENCIES], isEmpty);
   }
 
   test_perform() {
-    Source source = newSource('/test.dart', '''
+    Source source = newSource(
+        '/test.dart',
+        '''
 const x = y;
 const y = 1;
 ''');
@@ -1171,12 +1077,17 @@
     CompilationUnit unit = outputs[RESOLVED_UNIT1];
     // Find the elements for the constants x and y.
     List<PropertyAccessorElement> accessors = unit.element.accessors;
-    Element x = accessors.firstWhere((PropertyAccessorElement accessor) =>
-        accessor.isGetter && accessor.name == 'x').variable;
-    Element y = accessors.firstWhere((PropertyAccessorElement accessor) =>
-        accessor.isGetter && accessor.name == 'y').variable;
+    Element x = accessors
+        .firstWhere((PropertyAccessorElement accessor) =>
+            accessor.isGetter && accessor.name == 'x')
+        .variable;
+    Element y = accessors
+        .firstWhere((PropertyAccessorElement accessor) =>
+            accessor.isGetter && accessor.name == 'y')
+        .variable;
     // Now compute the dependencies for x, and check that it is the list [y].
-    computeResult(x, CONSTANT_DEPENDENCIES);
+    computeResult(x, CONSTANT_DEPENDENCIES,
+        matcher: isComputeConstantDependenciesTask);
     expect(outputs[CONSTANT_DEPENDENCIES], [y]);
   }
 }
@@ -1192,10 +1103,11 @@
         ConstantEvaluationTarget_Annotation target =
             new ConstantEvaluationTarget_Annotation(
                 context, source, source, annotation);
-        computeResult(target, CONSTANT_VALUE);
+        computeResult(target, CONSTANT_VALUE,
+            matcher: isComputeConstantValueTask);
         expect(outputs[CONSTANT_VALUE], same(target));
-        EvaluationResultImpl evaluationResult =
-            (annotation.elementAnnotation as ElementAnnotationImpl).evaluationResult;
+        EvaluationResultImpl evaluationResult = (annotation.elementAnnotation
+            as ElementAnnotationImpl).evaluationResult;
         return evaluationResult;
       }
     }
@@ -1206,7 +1118,9 @@
   test_annotation_non_const_constructor() {
     // Calling a non-const constructor from an annotation that is illegal, but
     // shouldn't crash analysis.
-    Source source = newSource('/test.dart', '''
+    Source source = newSource(
+        '/test.dart',
+        '''
 class A {
   final int i;
   A(this.i);
@@ -1226,7 +1140,9 @@
   }
 
   test_annotation_with_args() {
-    Source source = newSource('/test.dart', '''
+    Source source = newSource(
+        '/test.dart',
+        '''
 const x = 1;
 @D(x) class C {}
 class D {
@@ -1245,11 +1161,13 @@
     expect(evaluationResult.value.type, isNotNull);
     expect(evaluationResult.value.type.name, 'D');
     expect(evaluationResult.value.fields, contains('value'));
-    expect(evaluationResult.value.fields['value'].intValue, 1);
+    expect(evaluationResult.value.fields['value'].toIntValue(), 1);
   }
 
   test_annotation_without_args() {
-    Source source = newSource('/test.dart', '''
+    Source source = newSource(
+        '/test.dart',
+        '''
 const x = 1;
 @x class C {}
 ''');
@@ -1261,11 +1179,14 @@
     // And check that it has the expected value.
     expect(evaluationResult, isNotNull);
     expect(evaluationResult.value, isNotNull);
-    expect(evaluationResult.value.intValue, 1);
+    expect(evaluationResult.value.toIntValue(), 1);
   }
 
   test_circular_reference() {
-    _checkCircularities('x', ['y'], '''
+    _checkCircularities(
+        'x',
+        ['y'],
+        '''
 const x = y + 1;
 const y = x + 1;
 ''');
@@ -1279,7 +1200,10 @@
   test_circular_reference_strongly_connected_component() {
     // When there is a circularity, all elements in the strongly connected
     // component should be marked as having an error.
-    _checkCircularities('a', ['b', 'c', 'd'], '''
+    _checkCircularities(
+        'a',
+        ['b', 'c', 'd'],
+        '''
 const a = b;
 const b = c + d;
 const c = a;
@@ -1292,7 +1216,8 @@
     // constructor for Base is non-const), but we need to handle it without
     // throwing an exception.
     EvaluationResultImpl evaluationResult = _computeTopLevelVariableConstValue(
-        'x', '''
+        'x',
+        '''
 class Base {}
 class Derived extends Base {
   const Derived();
@@ -1304,18 +1229,20 @@
 
   test_dependency() {
     EvaluationResultImpl evaluationResult = _computeTopLevelVariableConstValue(
-        'x', '''
+        'x',
+        '''
 const x = y + 1;
 const y = 1;
 ''');
     expect(evaluationResult, isNotNull);
     expect(evaluationResult.value, isNotNull);
-    expect(evaluationResult.value.intValue, 2);
+    expect(evaluationResult.value.toIntValue(), 2);
   }
 
   test_external_const_factory() {
     EvaluationResultImpl evaluationResult = _computeTopLevelVariableConstValue(
-        'x', '''
+        'x',
+        '''
 const x = const C.foo();
 
 class C extends B {
@@ -1329,12 +1256,13 @@
 
   test_simple_constant() {
     EvaluationResultImpl evaluationResult = _computeTopLevelVariableConstValue(
-        'x', '''
+        'x',
+        '''
 const x = 1;
 ''');
     expect(evaluationResult, isNotNull);
     expect(evaluationResult.value, isNotNull);
-    expect(evaluationResult.value.intValue, 1);
+    expect(evaluationResult.value.toIntValue(), 1);
   }
 
   void _checkCircularities(
@@ -1347,8 +1275,8 @@
     for (String otherVariableName in otherVariables) {
       PropertyInducingElement otherVariableElement =
           _findVariable(unit, otherVariableName);
-      _expectCircularityError(
-          (otherVariableElement as TopLevelVariableElementImpl).evaluationResult);
+      _expectCircularityError((otherVariableElement
+          as TopLevelVariableElementImpl).evaluationResult);
     }
   }
 
@@ -1362,7 +1290,8 @@
     // Find the element for the given constant.
     PropertyInducingElement variableElement = _findVariable(unit, variableName);
     // Now compute the value of the constant.
-    computeResult(variableElement, CONSTANT_VALUE);
+    computeResult(variableElement, CONSTANT_VALUE,
+        matcher: isComputeConstantValueTask);
     expect(outputs[CONSTANT_VALUE], same(variableElement));
     EvaluationResultImpl evaluationResult =
         (variableElement as TopLevelVariableElementImpl).evaluationResult;
@@ -1397,46 +1326,446 @@
 }
 
 @reflectiveTest
+class ComputeInferableStaticVariableDependenciesTaskTest
+    extends _AbstractDartTaskTest {
+  @override
+  void setUp() {
+    super.setUp();
+    // Variable dependencies are only available in strong mode.
+    enableStrongMode();
+  }
+
+  test_perform() {
+    AnalysisTarget source = newSource(
+        '/test.dart',
+        '''
+const a = b;
+const b = 0;
+''');
+    LibrarySpecificUnit target = new LibrarySpecificUnit(source, source);
+    computeResult(target, RESOLVED_UNIT5);
+    CompilationUnit unit = outputs[RESOLVED_UNIT5];
+    TopLevelVariableElement elementA = unit.element.topLevelVariables[0];
+    TopLevelVariableElement elementB = unit.element.topLevelVariables[1];
+
+    computeResult(elementA, INFERABLE_STATIC_VARIABLE_DEPENDENCIES,
+        matcher: isComputeInferableStaticVariableDependenciesTask);
+    expect(outputs, hasLength(1));
+    List<VariableElement> dependencies =
+        outputs[INFERABLE_STATIC_VARIABLE_DEPENDENCIES];
+    expect(dependencies, unorderedEquals([elementB]));
+  }
+}
+
+@reflectiveTest
+class ComputeLibraryCycleTaskTest extends _AbstractDartTaskTest {
+  @override
+  void setUp() {
+    super.setUp();
+    enableStrongMode();
+  }
+
+  void test_library_cycle_incremental() {
+    enableStrongMode();
+    Source lib1Source = newSource(
+        '/my_lib1.dart',
+        '''
+library my_lib1;
+''');
+    Source lib2Source = newSource(
+        '/my_lib2.dart',
+        '''
+library my_lib2;
+import 'my_lib1.dart';
+''');
+    Source lib3Source = newSource(
+        '/my_lib3.dart',
+        '''
+library my_lib3;
+import 'my_lib2.dart';
+''');
+    AnalysisTarget lib1Target = new LibrarySpecificUnit(lib1Source, lib1Source);
+    AnalysisTarget lib2Target = new LibrarySpecificUnit(lib2Source, lib2Source);
+    AnalysisTarget lib3Target = new LibrarySpecificUnit(lib3Source, lib3Source);
+    computeResult(lib1Target, LIBRARY_CYCLE);
+    expect(outputs[LIBRARY_CYCLE], hasLength(1));
+    computeResult(lib2Target, LIBRARY_CYCLE);
+    expect(outputs[LIBRARY_CYCLE], hasLength(1));
+    computeResult(lib3Target, LIBRARY_CYCLE);
+    expect(outputs[LIBRARY_CYCLE], hasLength(1));
+
+    // complete the cycle
+    context.setContents(
+        lib1Source,
+        '''
+library my_lib1;
+import 'my_lib3.dart';
+''');
+    computeResult(lib1Target, LIBRARY_CYCLE);
+    expect(outputs[LIBRARY_CYCLE], hasLength(3));
+    computeResult(lib2Target, LIBRARY_CYCLE);
+    expect(outputs[LIBRARY_CYCLE], hasLength(3));
+    computeResult(lib3Target, LIBRARY_CYCLE);
+    expect(outputs[LIBRARY_CYCLE], hasLength(3));
+
+    // break the cycle again
+    context.setContents(
+        lib1Source,
+        '''
+library my_lib1;
+''');
+    computeResult(lib1Target, LIBRARY_CYCLE);
+    expect(outputs[LIBRARY_CYCLE], hasLength(1));
+    computeResult(lib2Target, LIBRARY_CYCLE);
+    expect(outputs[LIBRARY_CYCLE], hasLength(1));
+    computeResult(lib3Target, LIBRARY_CYCLE);
+    expect(outputs[LIBRARY_CYCLE], hasLength(1));
+  }
+
+  void test_library_cycle_incremental_partial() {
+    enableStrongMode();
+    Source lib1Source = newSource(
+        '/my_lib1.dart',
+        '''
+library my_lib1;
+''');
+    Source lib2Source = newSource(
+        '/my_lib2.dart',
+        '''
+library my_lib2;
+import 'my_lib1.dart';
+''');
+    Source lib3Source = newSource(
+        '/my_lib3.dart',
+        '''
+library my_lib3;
+import 'my_lib2.dart';
+''');
+    AnalysisTarget lib1Target = new LibrarySpecificUnit(lib1Source, lib1Source);
+    AnalysisTarget lib2Target = new LibrarySpecificUnit(lib2Source, lib2Source);
+    AnalysisTarget lib3Target = new LibrarySpecificUnit(lib3Source, lib3Source);
+    computeResult(lib1Target, LIBRARY_CYCLE);
+    expect(outputs[LIBRARY_CYCLE], hasLength(1));
+    computeResult(lib2Target, LIBRARY_CYCLE);
+    expect(outputs[LIBRARY_CYCLE], hasLength(1));
+    // lib3 is not reachable, so we have not yet computed its library
+    // cycles
+
+    // complete the cycle, via lib3
+    context.setContents(
+        lib1Source,
+        '''
+library my_lib1;
+import 'my_lib3.dart';
+''');
+    // Ensure that invalidation correctly invalidated everything reachable
+    // through lib3
+    computeResult(lib1Target, LIBRARY_CYCLE);
+    expect(outputs[LIBRARY_CYCLE], hasLength(3));
+    computeResult(lib2Target, LIBRARY_CYCLE);
+    expect(outputs[LIBRARY_CYCLE], hasLength(3));
+    computeResult(lib3Target, LIBRARY_CYCLE);
+    expect(outputs[LIBRARY_CYCLE], hasLength(3));
+  }
+
+  void test_library_cycle_linear() {
+    List<Source> sources = newSources({
+      '/a.dart': '''
+''',
+      '/b.dart': '''
+import 'a.dart';
+  '''
+    });
+    List<Map<ResultDescriptor, dynamic>> results =
+        computeLibraryResultsMap(sources, LIBRARY_CYCLE);
+    List<LibraryElement> component0 = results[0][LIBRARY_CYCLE];
+    List<LibraryElement> component1 = results[1][LIBRARY_CYCLE];
+    expect(component0, hasLength(1));
+    expect(component1, hasLength(1));
+
+    List<CompilationUnitElement> units0 = results[0][LIBRARY_CYCLE_UNITS];
+    List<CompilationUnitElement> units1 = results[1][LIBRARY_CYCLE_UNITS];
+    expect(units0, hasLength(1));
+    expect(units1, hasLength(1));
+
+    List<CompilationUnitElement> dep0 = results[0][LIBRARY_CYCLE_DEPENDENCIES];
+    List<CompilationUnitElement> dep1 = results[1][LIBRARY_CYCLE_DEPENDENCIES];
+    expect(dep0, hasLength(1)); // dart:core
+    expect(dep1, hasLength(2)); // dart:core, a.dart
+  }
+
+  void test_library_cycle_loop() {
+    List<Source> sources = newSources({
+      '/a.dart': '''
+  import 'c.dart';
+''',
+      '/b.dart': '''
+  import 'a.dart';
+  ''',
+      '/c.dart': '''
+  import 'b.dart';
+  '''
+    });
+    List<Map<ResultDescriptor, dynamic>> results =
+        computeLibraryResultsMap(sources, LIBRARY_CYCLE).toList();
+    List<LibraryElement> component0 = results[0][LIBRARY_CYCLE];
+    List<LibraryElement> component1 = results[1][LIBRARY_CYCLE];
+    List<LibraryElement> component2 = results[2][LIBRARY_CYCLE];
+
+    expect(component0, hasLength(3));
+    expect(component1, hasLength(3));
+    expect(component2, hasLength(3));
+
+    List<CompilationUnitElement> units0 = results[0][LIBRARY_CYCLE_UNITS];
+    List<CompilationUnitElement> units1 = results[1][LIBRARY_CYCLE_UNITS];
+    List<CompilationUnitElement> units2 = results[2][LIBRARY_CYCLE_UNITS];
+    expect(units0, hasLength(3));
+    expect(units1, hasLength(3));
+    expect(units2, hasLength(3));
+
+    List<CompilationUnitElement> dep0 = results[0][LIBRARY_CYCLE_DEPENDENCIES];
+    List<CompilationUnitElement> dep1 = results[1][LIBRARY_CYCLE_DEPENDENCIES];
+    List<CompilationUnitElement> dep2 = results[2][LIBRARY_CYCLE_DEPENDENCIES];
+    expect(dep0, hasLength(1)); // dart:core
+    expect(dep1, hasLength(1)); // dart:core
+    expect(dep2, hasLength(1)); // dart:core
+  }
+
+  void test_library_cycle_self_loop() {
+    List<Source> sources = newSources({
+      '/a.dart': '''
+  import 'a.dart';
+'''
+    });
+    List<Map<ResultDescriptor, dynamic>> results =
+        computeLibraryResultsMap(sources, LIBRARY_CYCLE).toList();
+    List<LibraryElement> component0 = results[0][LIBRARY_CYCLE];
+    expect(component0, hasLength(1));
+
+    List<CompilationUnitElement> units0 = results[0][LIBRARY_CYCLE_UNITS];
+    expect(units0, hasLength(1));
+
+    List<CompilationUnitElement> dep0 = results[0][LIBRARY_CYCLE_DEPENDENCIES];
+    expect(dep0, hasLength(1)); // dart:core
+  }
+
+  void test_library_cycle_singleton() {
+    Source source = newSource(
+        '/test.dart',
+        '''
+import 'dart:core';
+''');
+    computeResult(new LibrarySpecificUnit(source, source), LIBRARY_CYCLE);
+    List<LibraryElement> component = outputs[LIBRARY_CYCLE];
+    List<CompilationUnitElement> units = outputs[LIBRARY_CYCLE_UNITS];
+    List<CompilationUnitElement> deps = outputs[LIBRARY_CYCLE_DEPENDENCIES];
+    expect(component, hasLength(1));
+    expect(units, hasLength(1));
+    expect(deps, hasLength(1));
+  }
+
+  void test_library_cycle_tree() {
+    List<Source> sources = newSources({
+      '/a.dart': '''
+''',
+      '/b.dart': '''
+  ''',
+      '/c.dart': '''
+  import 'a.dart';
+  import 'b.dart';
+  '''
+    });
+    List<Map<ResultDescriptor, dynamic>> results =
+        computeLibraryResultsMap(sources, LIBRARY_CYCLE);
+    List<LibraryElement> component0 = results[0][LIBRARY_CYCLE];
+    List<LibraryElement> component1 = results[1][LIBRARY_CYCLE];
+    List<LibraryElement> component2 = results[2][LIBRARY_CYCLE];
+    expect(component0, hasLength(1));
+    expect(component1, hasLength(1));
+    expect(component2, hasLength(1));
+
+    List<CompilationUnitElement> units0 = results[0][LIBRARY_CYCLE_UNITS];
+    List<CompilationUnitElement> units1 = results[1][LIBRARY_CYCLE_UNITS];
+    List<CompilationUnitElement> units2 = results[2][LIBRARY_CYCLE_UNITS];
+    expect(units0, hasLength(1));
+    expect(units1, hasLength(1));
+    expect(units2, hasLength(1));
+
+    List<CompilationUnitElement> dep0 = results[0][LIBRARY_CYCLE_DEPENDENCIES];
+    List<CompilationUnitElement> dep1 = results[1][LIBRARY_CYCLE_DEPENDENCIES];
+    List<CompilationUnitElement> dep2 = results[2][LIBRARY_CYCLE_DEPENDENCIES];
+    expect(dep0, hasLength(1)); // dart:core
+    expect(dep1, hasLength(1)); // dart:core,
+    expect(dep2, hasLength(3)); // dart:core, a.dart, b.dart
+  }
+
+  void test_library_double_loop() {
+    List<Source> sources = newSources({
+      '/a.dart': '''
+  import 'b.dart';
+''',
+      '/b.dart': '''
+  import 'a.dart';
+  ''',
+      '/c.dart': '''
+  import 'd.dart' as foo;
+  import 'a.dart' as bar;
+  export 'b.dart';
+  ''',
+      '/d.dart': '''
+  import 'c.dart' as foo;
+  import 'b.dart' as bar;
+  export 'a.dart';
+  '''
+    });
+    List<Map<ResultDescriptor, dynamic>> results =
+        computeLibraryResultsMap(sources, LIBRARY_CYCLE).toList();
+    List<LibraryElement> component0 = results[0][LIBRARY_CYCLE];
+    List<LibraryElement> component1 = results[1][LIBRARY_CYCLE];
+    List<LibraryElement> component2 = results[2][LIBRARY_CYCLE];
+    List<LibraryElement> component3 = results[3][LIBRARY_CYCLE];
+
+    expect(component0, hasLength(2));
+    expect(component1, hasLength(2));
+    expect(component2, hasLength(2));
+    expect(component3, hasLength(2));
+
+    List<CompilationUnitElement> units0 = results[0][LIBRARY_CYCLE_UNITS];
+    List<CompilationUnitElement> units1 = results[1][LIBRARY_CYCLE_UNITS];
+    List<CompilationUnitElement> units2 = results[2][LIBRARY_CYCLE_UNITS];
+    List<CompilationUnitElement> units3 = results[3][LIBRARY_CYCLE_UNITS];
+    expect(units0, hasLength(2));
+    expect(units1, hasLength(2));
+    expect(units2, hasLength(2));
+    expect(units3, hasLength(2));
+
+    List<CompilationUnitElement> dep0 = results[0][LIBRARY_CYCLE_DEPENDENCIES];
+    List<CompilationUnitElement> dep1 = results[1][LIBRARY_CYCLE_DEPENDENCIES];
+    List<CompilationUnitElement> dep2 = results[2][LIBRARY_CYCLE_DEPENDENCIES];
+    List<CompilationUnitElement> dep3 = results[3][LIBRARY_CYCLE_DEPENDENCIES];
+    expect(dep0, hasLength(1)); // dart:core
+    expect(dep1, hasLength(1)); // dart:core
+    expect(dep3, hasLength(3)); // dart:core, a.dart, b.dart
+    expect(dep3, hasLength(3)); // dart:core, a.dart, b.dart
+  }
+
+  void test_library_double_loop_parts() {
+    List<Source> sources = newSources({
+      '/a.dart': '''
+  import 'b.dart';
+  part 'aa.dart';
+  part 'ab.dart';
+''',
+      '/b.dart': '''
+  import 'a.dart';
+''',
+      '/aa.dart': '''
+''',
+      '/ab.dart': '''
+''',
+      '/c.dart': '''
+  import 'd.dart' as foo;
+  import 'a.dart' as bar;
+  export 'b.dart';
+''',
+      '/d.dart': '''
+  import 'c.dart' as foo;
+  import 'b.dart' as bar;
+  export 'a.dart';
+  part 'da.dart';
+  part 'db.dart';
+''',
+      '/da.dart': '''
+''',
+      '/db.dart': '''
+'''
+    });
+    computeResult(
+        new LibrarySpecificUnit(sources[0], sources[0]), LIBRARY_CYCLE);
+    Map<ResultDescriptor, dynamic> results0 = outputs;
+    computeResult(
+        new LibrarySpecificUnit(sources[1], sources[1]), LIBRARY_CYCLE);
+    Map<ResultDescriptor, dynamic> results1 = outputs;
+    computeResult(
+        new LibrarySpecificUnit(sources[0], sources[2]), LIBRARY_CYCLE);
+    Map<ResultDescriptor, dynamic> results2 = outputs;
+    computeResult(
+        new LibrarySpecificUnit(sources[0], sources[3]), LIBRARY_CYCLE);
+    Map<ResultDescriptor, dynamic> results3 = outputs;
+    computeResult(
+        new LibrarySpecificUnit(sources[4], sources[4]), LIBRARY_CYCLE);
+    Map<ResultDescriptor, dynamic> results4 = outputs;
+    computeResult(
+        new LibrarySpecificUnit(sources[5], sources[5]), LIBRARY_CYCLE);
+    Map<ResultDescriptor, dynamic> results5 = outputs;
+    computeResult(
+        new LibrarySpecificUnit(sources[5], sources[6]), LIBRARY_CYCLE);
+    Map<ResultDescriptor, dynamic> results6 = outputs;
+    computeResult(
+        new LibrarySpecificUnit(sources[5], sources[7]), LIBRARY_CYCLE);
+    Map<ResultDescriptor, dynamic> results7 = outputs;
+
+    List<LibraryElement> component0 = results0[LIBRARY_CYCLE];
+    List<LibraryElement> component1 = results1[LIBRARY_CYCLE];
+    List<LibraryElement> component2 = results2[LIBRARY_CYCLE];
+    List<LibraryElement> component3 = results3[LIBRARY_CYCLE];
+    List<LibraryElement> component4 = results4[LIBRARY_CYCLE];
+    List<LibraryElement> component5 = results5[LIBRARY_CYCLE];
+    List<LibraryElement> component6 = results6[LIBRARY_CYCLE];
+    List<LibraryElement> component7 = results7[LIBRARY_CYCLE];
+
+    expect(component0, hasLength(2));
+    expect(component1, hasLength(2));
+    expect(component2, hasLength(2));
+    expect(component3, hasLength(2));
+    expect(component4, hasLength(2));
+    expect(component5, hasLength(2));
+    expect(component6, hasLength(2));
+    expect(component7, hasLength(2));
+
+    List<CompilationUnitElement> units0 = results0[LIBRARY_CYCLE_UNITS];
+    List<CompilationUnitElement> units1 = results1[LIBRARY_CYCLE_UNITS];
+    List<CompilationUnitElement> units2 = results2[LIBRARY_CYCLE_UNITS];
+    List<CompilationUnitElement> units3 = results3[LIBRARY_CYCLE_UNITS];
+    List<CompilationUnitElement> units4 = results4[LIBRARY_CYCLE_UNITS];
+    List<CompilationUnitElement> units5 = results5[LIBRARY_CYCLE_UNITS];
+    List<CompilationUnitElement> units6 = results6[LIBRARY_CYCLE_UNITS];
+    List<CompilationUnitElement> units7 = results7[LIBRARY_CYCLE_UNITS];
+    expect(units0, hasLength(4));
+    expect(units1, hasLength(4));
+    expect(units2, hasLength(4));
+    expect(units3, hasLength(4));
+    expect(units4, hasLength(4));
+    expect(units5, hasLength(4));
+    expect(units6, hasLength(4));
+    expect(units7, hasLength(4));
+
+    List<CompilationUnitElement> dep0 = results0[LIBRARY_CYCLE_DEPENDENCIES];
+    List<CompilationUnitElement> dep1 = results1[LIBRARY_CYCLE_DEPENDENCIES];
+    List<CompilationUnitElement> dep2 = results2[LIBRARY_CYCLE_DEPENDENCIES];
+    List<CompilationUnitElement> dep3 = results3[LIBRARY_CYCLE_DEPENDENCIES];
+    List<CompilationUnitElement> dep4 = results4[LIBRARY_CYCLE_DEPENDENCIES];
+    List<CompilationUnitElement> dep5 = results5[LIBRARY_CYCLE_DEPENDENCIES];
+    List<CompilationUnitElement> dep6 = results6[LIBRARY_CYCLE_DEPENDENCIES];
+    List<CompilationUnitElement> dep7 = results7[LIBRARY_CYCLE_DEPENDENCIES];
+    expect(dep0, hasLength(1)); // dart:core
+    expect(dep1, hasLength(1)); // dart:core
+    expect(dep2, hasLength(1)); // dart:core
+    expect(dep3, hasLength(1)); // dart:core
+    expect(dep4, hasLength(5)); // dart:core, a.dart, aa.dart, ab.dart, b.dart
+    expect(dep5, hasLength(5)); // dart:core, a.dart, aa.dart, ab.dart, b.dart
+    expect(dep6, hasLength(5)); // dart:core, a.dart, aa.dart, ab.dart, b.dart
+    expect(dep7, hasLength(5)); // dart:core, a.dart, aa.dart, ab.dart, b.dart
+  }
+}
+
+@reflectiveTest
 class ContainingLibrariesTaskTest extends _AbstractDartTaskTest {
-  test_buildInputs() {
-    Map<String, TaskInput> inputs =
-        ContainingLibrariesTask.buildInputs(emptySource);
-    expect(inputs, isNotNull);
-    expect(inputs, isEmpty);
-  }
-
-  test_constructor() {
-    ContainingLibrariesTask task =
-        new ContainingLibrariesTask(context, emptySource);
-    expect(task, isNotNull);
-    expect(task.context, context);
-    expect(task.target, emptySource);
-  }
-
-  test_createTask() {
-    ContainingLibrariesTask task =
-        ContainingLibrariesTask.createTask(context, emptySource);
-    expect(task, isNotNull);
-    expect(task.context, context);
-    expect(task.target, emptySource);
-  }
-
-  test_description() {
-    ContainingLibrariesTask task =
-        new ContainingLibrariesTask(null, emptySource);
-    expect(task.description, isNotNull);
-  }
-
-  test_descriptor() {
-    TaskDescriptor descriptor = ContainingLibrariesTask.DESCRIPTOR;
-    expect(descriptor, isNotNull);
-  }
-
   test_perform_definingCompilationUnit() {
     AnalysisTarget library = newSource('/test.dart', 'library test;');
     computeResult(library, INCLUDED_PARTS);
-    computeResult(library, CONTAINING_LIBRARIES);
-    expect(task, new isInstanceOf<ContainingLibrariesTask>());
+    computeResult(library, CONTAINING_LIBRARIES,
+        matcher: isContainingLibrariesTask);
     expect(outputs, hasLength(1));
     List<Source> containingLibraries = outputs[CONTAINING_LIBRARIES];
     expect(containingLibraries, unorderedEquals([library]));
@@ -1451,8 +1780,8 @@
     computeResult(library1, INCLUDED_PARTS);
     computeResult(library2, INCLUDED_PARTS);
     computeResult(part, SOURCE_KIND);
-    computeResult(part, CONTAINING_LIBRARIES);
-    expect(task, new isInstanceOf<ContainingLibrariesTask>());
+    computeResult(part, CONTAINING_LIBRARIES,
+        matcher: isContainingLibrariesTask);
     expect(outputs, hasLength(1));
     List<Source> containingLibraries = outputs[CONTAINING_LIBRARIES];
     expect(containingLibraries, unorderedEquals([library1, library2]));
@@ -1464,8 +1793,8 @@
     AnalysisTarget part = newSource('/part.dart', 'part of test;');
     computeResult(library, INCLUDED_PARTS);
     computeResult(part, SOURCE_KIND);
-    computeResult(part, CONTAINING_LIBRARIES);
-    expect(task, new isInstanceOf<ContainingLibrariesTask>());
+    computeResult(part, CONTAINING_LIBRARIES,
+        matcher: isContainingLibrariesTask);
     expect(outputs, hasLength(1));
     List<Source> containingLibraries = outputs[CONTAINING_LIBRARIES];
     expect(containingLibraries, unorderedEquals([library]));
@@ -1474,48 +1803,11 @@
 
 @reflectiveTest
 class DartErrorsTaskTest extends _AbstractDartTaskTest {
-  test_buildInputs() {
-    Map<String, TaskInput> inputs = DartErrorsTask.buildInputs(emptySource);
-    expect(inputs, isNotNull);
-    expect(inputs.keys, unorderedEquals([
-      DartErrorsTask.BUILD_DIRECTIVES_ERRORS_INPUT,
-      DartErrorsTask.BUILD_LIBRARY_ERRORS_INPUT,
-      DartErrorsTask.PARSE_ERRORS_INPUT,
-      DartErrorsTask.SCAN_ERRORS_INPUT,
-      DartErrorsTask.LIBRARY_UNIT_ERRORS_INPUT
-    ]));
-  }
-
-  test_constructor() {
-    DartErrorsTask task = new DartErrorsTask(context, emptySource);
-    expect(task, isNotNull);
-    expect(task.context, context);
-    expect(task.target, emptySource);
-  }
-
-  test_createTask() {
-    DartErrorsTask task = DartErrorsTask.createTask(context, emptySource);
-    expect(task, isNotNull);
-    expect(task.context, context);
-    expect(task.target, emptySource);
-  }
-
-  test_description() {
-    DartErrorsTask task = new DartErrorsTask(null, emptySource);
-    expect(task.description, isNotNull);
-  }
-
-  test_descriptor() {
-    TaskDescriptor descriptor = DartErrorsTask.DESCRIPTOR;
-    expect(descriptor, isNotNull);
-  }
-
   test_perform_definingCompilationUnit() {
     AnalysisTarget library =
         newSource('/test.dart', 'library test; import "dart:math";');
     computeResult(library, INCLUDED_PARTS);
-    computeResult(library, DART_ERRORS);
-    expect(task, new isInstanceOf<DartErrorsTask>());
+    computeResult(library, DART_ERRORS, matcher: isDartErrorsTask);
     expect(outputs, hasLength(1));
     List<AnalysisError> errors = outputs[DART_ERRORS];
     expect(errors, hasLength(1));
@@ -1528,8 +1820,7 @@
         newSource('/part.dart', 'part of test; class A extends A {}');
     computeResult(library, INCLUDED_PARTS);
     computeResult(library, DART_ERRORS);
-    computeResult(part, DART_ERRORS);
-    expect(task, new isInstanceOf<DartErrorsTask>());
+    computeResult(part, DART_ERRORS, matcher: isDartErrorsTask);
     expect(outputs, hasLength(1));
     List<AnalysisError> errors = outputs[DART_ERRORS];
     // This should contain only the errors in the part file, not the ones in the
@@ -1541,7 +1832,9 @@
 @reflectiveTest
 class EvaluateUnitConstantsTaskTest extends _AbstractDartTaskTest {
   test_perform() {
-    Source source = newSource('/test.dart', '''
+    Source source = newSource(
+        '/test.dart',
+        '''
 class C {
   const C();
 }
@@ -1552,16 +1845,22 @@
 const x = const C();
 ''');
     LibrarySpecificUnit target = new LibrarySpecificUnit(source, source);
-    computeResult(target, RESOLVED_UNIT);
-    expect(task, new isInstanceOf<EvaluateUnitConstantsTask>());
-    CompilationUnit unit = outputs[RESOLVED_UNIT];
+    computeResult(target, RESOLVED_UNIT10,
+        matcher: isEvaluateUnitConstantsTask);
+    CompilationUnit unit = outputs[RESOLVED_UNIT10];
     CompilationUnitElement unitElement = unit.element;
-    expect((unitElement.types[0].constructors[
-        0] as ConstructorElementImpl).isCycleFree, isTrue);
-    expect((unitElement.functions[0].metadata[
-        0] as ElementAnnotationImpl).evaluationResult, isNotNull);
-    expect((unitElement.topLevelVariables[
-        0] as TopLevelVariableElementImpl).evaluationResult, isNotNull);
+    expect(
+        (unitElement.types[0].constructors[0] as ConstructorElementImpl)
+            .isCycleFree,
+        isTrue);
+    expect(
+        (unitElement.functions[0].metadata[0] as ElementAnnotationImpl)
+            .evaluationResult,
+        isNotNull);
+    expect(
+        (unitElement.topLevelVariables[0] as TopLevelVariableElementImpl)
+            .evaluationResult,
+        isNotNull);
   }
 }
 
@@ -1571,15 +1870,21 @@
   Set<String> usedElementNames;
 
   test_perform() {
-    newSource('/a.dart', r'''
+    newSource(
+        '/a.dart',
+        r'''
 library lib_a;
 class A {}
 ''');
-    newSource('/b.dart', r'''
+    newSource(
+        '/b.dart',
+        r'''
 library lib_b;
 class B {}
 ''');
-    Source source = newSource('/test.dart', r'''
+    Source source = newSource(
+        '/test.dart',
+        r'''
 import 'a.dart';
 import 'b.dart';
 main() {
@@ -1592,8 +1897,8 @@
 
   void _computeUsedElements(Source source) {
     LibrarySpecificUnit target = new LibrarySpecificUnit(source, source);
-    computeResult(target, USED_IMPORTED_ELEMENTS);
-    expect(task, new isInstanceOf<GatherUsedImportedElementsTask>());
+    computeResult(target, USED_IMPORTED_ELEMENTS,
+        matcher: isGatherUsedImportedElementsTask);
     usedElements = outputs[USED_IMPORTED_ELEMENTS];
     usedElementNames = usedElements.elements.map((e) => e.name).toSet();
   }
@@ -1604,8 +1909,60 @@
   UsedLocalElements usedElements;
   Set<String> usedElementNames;
 
+  test_perform_forPart_afterLibraryUpdate() {
+    Source libSource = newSource(
+        '/my_lib.dart',
+        '''
+library my_lib;
+part 'my_part.dart';
+foo() => null;
+class _LocalClass {}
+''');
+    Source partSource = newSource(
+        '/my_part.dart',
+        '''
+part of my_lib;
+bar() {
+  print(_LocalClass);
+}
+''');
+    AnalysisTarget libTarget = new LibrarySpecificUnit(libSource, libSource);
+    AnalysisTarget partTarget = new LibrarySpecificUnit(libSource, partSource);
+    computeResult(libTarget, USED_LOCAL_ELEMENTS);
+    computeResult(partTarget, USED_LOCAL_ELEMENTS);
+    // _LocalClass is used in my_part.dart
+    {
+      UsedLocalElements usedElements =
+          analysisCache.getValue(partTarget, USED_LOCAL_ELEMENTS);
+      expect(usedElements.elements, contains(predicate((Element e) {
+        return e.displayName == '_LocalClass';
+      })));
+    }
+    // change my_lib.dart and recompute
+    context.setContents(
+        libSource,
+        '''
+library my_lib;
+part 'my_part.dart';
+String foo() => null;
+class _LocalClass {}
+''');
+    computeResult(libTarget, USED_LOCAL_ELEMENTS);
+    computeResult(partTarget, USED_LOCAL_ELEMENTS);
+    // _LocalClass should still be used in my_part.dart
+    {
+      UsedLocalElements usedElements =
+          analysisCache.getValue(partTarget, USED_LOCAL_ELEMENTS);
+      expect(usedElements.elements, contains(predicate((Element e) {
+        return e.displayName == '_LocalClass';
+      })));
+    }
+  }
+
   test_perform_localVariable() {
-    Source source = newSource('/test.dart', r'''
+    Source source = newSource(
+        '/test.dart',
+        r'''
 main() {
   var v1 = 1;
   var v2 = 2;
@@ -1617,7 +1974,9 @@
   }
 
   test_perform_method() {
-    Source source = newSource('/test.dart', r'''
+    Source source = newSource(
+        '/test.dart',
+        r'''
 class A {
   _m1() {}
   _m2() {}
@@ -1636,8 +1995,8 @@
 
   void _computeUsedElements(Source source) {
     LibrarySpecificUnit target = new LibrarySpecificUnit(source, source);
-    computeResult(target, USED_LOCAL_ELEMENTS);
-    expect(task, new isInstanceOf<GatherUsedLocalElementsTask>());
+    computeResult(target, USED_LOCAL_ELEMENTS,
+        matcher: isGatherUsedLocalElementsTask);
     usedElements = outputs[USED_LOCAL_ELEMENTS];
     usedElementNames = usedElements.elements.map((e) => e.name).toSet();
   }
@@ -1646,20 +2005,26 @@
 @reflectiveTest
 class GenerateHintsTaskTest extends _AbstractDartTaskTest {
   test_perform_bestPractices_missingReturn() {
-    Source source = newSource('/test.dart', '''
+    Source source = newSource(
+        '/test.dart',
+        '''
 int main() {
 }
 ''');
     LibrarySpecificUnit target = new LibrarySpecificUnit(source, source);
-    computeResult(target, HINTS);
-    expect(task, new isInstanceOf<GenerateHintsTask>());
+    computeResult(target, HINTS, matcher: isGenerateHintsTask);
     // validate
     _fillErrorListener(HINTS);
     errorListener.assertErrorsWithCodes(<ErrorCode>[HintCode.MISSING_RETURN]);
   }
 
   test_perform_dart2js() {
-    Source source = newSource('/test.dart', '''
+    AnalysisOptionsImpl options = new AnalysisOptionsImpl();
+    options.dart2jsHint = true;
+    prepareAnalysisContext(options);
+    Source source = newSource(
+        '/test.dart',
+        '''
 main(p) {
   if (p is double) {
     print('double');
@@ -1667,15 +2032,16 @@
 }
 ''');
     LibrarySpecificUnit target = new LibrarySpecificUnit(source, source);
-    computeResult(target, HINTS);
-    expect(task, new isInstanceOf<GenerateHintsTask>());
+    computeResult(target, HINTS, matcher: isGenerateHintsTask);
     // validate
     _fillErrorListener(HINTS);
     errorListener.assertErrorsWithCodes(<ErrorCode>[HintCode.IS_DOUBLE]);
   }
 
   test_perform_deadCode() {
-    Source source = newSource('/test.dart', '''
+    Source source = newSource(
+        '/test.dart',
+        '''
 main() {
   if (false) {
     print('how?');
@@ -1683,8 +2049,7 @@
 }
 ''');
     LibrarySpecificUnit target = new LibrarySpecificUnit(source, source);
-    computeResult(target, HINTS);
-    expect(task, new isInstanceOf<GenerateHintsTask>());
+    computeResult(target, HINTS, matcher: isGenerateHintsTask);
     // validate
     _fillErrorListener(HINTS);
     errorListener.assertErrorsWithCodes(<ErrorCode>[HintCode.DEAD_CODE]);
@@ -1693,24 +2058,29 @@
   test_perform_disabled() {
     context.analysisOptions =
         new AnalysisOptionsImpl.from(context.analysisOptions)..hint = false;
-    Source source = newSource('/test.dart', '''
+    Source source = newSource(
+        '/test.dart',
+        '''
 int main() {
 }
 ''');
     LibrarySpecificUnit target = new LibrarySpecificUnit(source, source);
-    computeResult(target, HINTS);
-    expect(task, new isInstanceOf<GenerateHintsTask>());
+    computeResult(target, HINTS, matcher: isGenerateHintsTask);
     // validate
     _fillErrorListener(HINTS);
     errorListener.assertNoErrors();
   }
 
   test_perform_imports_duplicateImport() {
-    newSource('/a.dart', r'''
+    newSource(
+        '/a.dart',
+        r'''
 library lib_a;
 class A {}
 ''');
-    Source source = newSource('/test.dart', r'''
+    Source source = newSource(
+        '/test.dart',
+        r'''
 import 'a.dart';
 import 'a.dart';
 main() {
@@ -1718,56 +2088,65 @@
 }
 ''');
     LibrarySpecificUnit target = new LibrarySpecificUnit(source, source);
-    computeResult(target, HINTS);
-    expect(task, new isInstanceOf<GenerateHintsTask>());
+    computeResult(target, HINTS, matcher: isGenerateHintsTask);
     // validate
     _fillErrorListener(HINTS);
     errorListener.assertErrorsWithCodes(<ErrorCode>[HintCode.DUPLICATE_IMPORT]);
   }
 
   test_perform_imports_unusedImport_one() {
-    newSource('/a.dart', r'''
+    newSource(
+        '/a.dart',
+        r'''
 library lib_a;
 class A {}
 ''');
-    newSource('/b.dart', r'''
+    newSource(
+        '/b.dart',
+        r'''
 library lib_b;
 class B {}
 ''');
-    Source source = newSource('/test.dart', r'''
+    Source source = newSource(
+        '/test.dart',
+        r'''
 import 'a.dart';
 import 'b.dart';
 main() {
   new A();
 }''');
     LibrarySpecificUnit target = new LibrarySpecificUnit(source, source);
-    computeResult(target, HINTS);
-    expect(task, new isInstanceOf<GenerateHintsTask>());
+    computeResult(target, HINTS, matcher: isGenerateHintsTask);
     // validate
     _fillErrorListener(HINTS);
     errorListener.assertErrorsWithCodes(<ErrorCode>[HintCode.UNUSED_IMPORT]);
   }
 
   test_perform_imports_unusedImport_zero() {
-    newSource('/a.dart', r'''
+    newSource(
+        '/a.dart',
+        r'''
 library lib_a;
 class A {}
 ''');
-    Source source = newSource('/test.dart', r'''
+    Source source = newSource(
+        '/test.dart',
+        r'''
 import 'a.dart';
 main() {
   new A();
 }''');
     LibrarySpecificUnit target = new LibrarySpecificUnit(source, source);
-    computeResult(target, HINTS);
-    expect(task, new isInstanceOf<GenerateHintsTask>());
+    computeResult(target, HINTS, matcher: isGenerateHintsTask);
     // validate
     _fillErrorListener(HINTS);
     errorListener.assertNoErrors();
   }
 
   test_perform_overrideVerifier() {
-    Source source = newSource('/test.dart', '''
+    Source source = newSource(
+        '/test.dart',
+        '''
 class A {}
 class B {
   @override
@@ -1775,8 +2154,7 @@
 }
 ''');
     LibrarySpecificUnit target = new LibrarySpecificUnit(source, source);
-    computeResult(target, HINTS);
-    expect(task, new isInstanceOf<GenerateHintsTask>());
+    computeResult(target, HINTS, matcher: isGenerateHintsTask);
     // validate
     _fillErrorListener(HINTS);
     errorListener.assertErrorsWithCodes(
@@ -1784,21 +2162,24 @@
   }
 
   test_perform_todo() {
-    Source source = newSource('/test.dart', '''
+    Source source = newSource(
+        '/test.dart',
+        '''
 main() {
   // TODO(developer) foo bar
 }
 ''');
     LibrarySpecificUnit target = new LibrarySpecificUnit(source, source);
-    computeResult(target, HINTS);
-    expect(task, new isInstanceOf<GenerateHintsTask>());
+    computeResult(target, HINTS, matcher: isGenerateHintsTask);
     // validate
     _fillErrorListener(HINTS);
     errorListener.assertErrorsWithCodes(<ErrorCode>[TodoCode.TODO]);
   }
 
   test_perform_unusedLocalElements_class() {
-    Source source = newSource('/test.dart', '''
+    Source source = newSource(
+        '/test.dart',
+        '''
 class _A {}
 class _B {}
 main() {
@@ -1806,22 +2187,22 @@
 }
 ''');
     LibrarySpecificUnit target = new LibrarySpecificUnit(source, source);
-    computeResult(target, HINTS);
-    expect(task, new isInstanceOf<GenerateHintsTask>());
+    computeResult(target, HINTS, matcher: isGenerateHintsTask);
     // validate
     _fillErrorListener(HINTS);
     errorListener.assertErrorsWithCodes(<ErrorCode>[HintCode.UNUSED_ELEMENT]);
   }
 
   test_perform_unusedLocalElements_localVariable() {
-    Source source = newSource('/test.dart', '''
+    Source source = newSource(
+        '/test.dart',
+        '''
 main() {
   var v = 42;
 }
 ''');
     LibrarySpecificUnit target = new LibrarySpecificUnit(source, source);
-    computeResult(target, HINTS);
-    expect(task, new isInstanceOf<GenerateHintsTask>());
+    computeResult(target, HINTS, matcher: isGenerateHintsTask);
     // validate
     _fillErrorListener(HINTS);
     errorListener
@@ -1829,7 +2210,9 @@
   }
 
   test_perform_unusedLocalElements_method() {
-    Source source = newSource('/my_lib.dart', '''
+    Source source = newSource(
+        '/my_lib.dart',
+        '''
 library my_lib;
 part 'my_part.dart';
 class A {
@@ -1838,7 +2221,9 @@
   _mc() {}
 }
 ''');
-    newSource('/my_part.dart', '''
+    newSource(
+        '/my_part.dart',
+        '''
 part of my_lib;
 
 f(A a) {
@@ -1846,8 +2231,7 @@
 }
 ''');
     LibrarySpecificUnit target = new LibrarySpecificUnit(source, source);
-    computeResult(target, HINTS);
-    expect(task, new isInstanceOf<GenerateHintsTask>());
+    computeResult(target, HINTS, matcher: isGenerateHintsTask);
     // validate
     _fillErrorListener(HINTS);
     errorListener.assertErrorsWithCodes(
@@ -1856,24 +2240,417 @@
 }
 
 @reflectiveTest
+class GenerateLintsTaskTest extends _AbstractDartTaskTest {
+  void enableLints() {
+    AnalysisOptionsImpl options = context.analysisOptions;
+    options.lint = true;
+    context.analysisOptions = options;
+  }
+
+  @override
+  void setUp() {
+    super.setUp();
+    enableLints();
+    setLints(context, [new GenerateLintsTaskTest_TestLinter()]);
+  }
+
+  @override
+  void tearDown() {
+    setLints(context, []);
+    super.tearDown();
+  }
+
+  test_camel_case_types() {
+    Source source = newSource(
+        '/test.dart',
+        '''
+class a { }
+''');
+
+    LibrarySpecificUnit target = new LibrarySpecificUnit(source, source);
+    computeResult(target, LINTS, matcher: isGenerateLintsTask);
+    // validate
+    _fillErrorListener(LINTS);
+    errorListener.assertErrorsWithCodes(<ErrorCode>[_testLintCode]);
+  }
+}
+
+class GenerateLintsTaskTest_AstVisitor extends SimpleAstVisitor {
+  Linter linter;
+  GenerateLintsTaskTest_AstVisitor(this.linter);
+
+  @override
+  visitClassDeclaration(ClassDeclaration node) {
+    if (!new RegExp(r'^([_]*)([A-Z]+[a-z0-9]*)+$')
+        .hasMatch(node.name.toString())) {
+      linter.reporter.reportErrorForNode(_testLintCode, node, []);
+    }
+  }
+}
+
+class GenerateLintsTaskTest_TestLinter extends Linter {
+  @override
+  AstVisitor getVisitor() => new GenerateLintsTaskTest_AstVisitor(this);
+}
+
+@reflectiveTest
+class InferInstanceMembersInUnitTaskTest extends _AbstractDartTaskTest {
+  void test_perform() {
+    enableStrongMode();
+    AnalysisTarget source = newSource(
+        '/test.dart',
+        '''
+class A {
+  X f;
+  Y m(Z x) {}
+}
+class B extends A {
+  var f;
+  m(x) {}
+}
+class X {}
+class Y {}
+class Z {}
+''');
+    computeResult(new LibrarySpecificUnit(source, source), RESOLVED_UNIT8,
+        matcher: isInferInstanceMembersInUnitTask);
+    CompilationUnit unit = outputs[RESOLVED_UNIT8];
+    VariableDeclaration field = getFieldInClass(unit, 'B', 'f');
+    MethodDeclaration method = getMethodInClass(unit, 'B', 'm');
+    DartType typeX = getClass(unit, 'X').element.type;
+    DartType typeY = getClass(unit, 'Y').element.type;
+    DartType typeZ = getClass(unit, 'Z').element.type;
+
+    expect(field.element.type, typeX);
+    expect(method.element.returnType, typeY);
+    expect(method.element.parameters[0].type, typeZ);
+  }
+
+  void test_perform_cross_library_const() {
+    enableStrongMode();
+    AnalysisTarget firstSource = newSource(
+        '/first.dart',
+        '''
+library first;
+
+const a = 'hello';
+''');
+    AnalysisTarget secondSource = newSource(
+        '/second.dart',
+        '''
+import 'first.dart';
+
+const b = a;
+class M {
+   String c = a;
+}
+''');
+    computeResult(
+        new LibrarySpecificUnit(firstSource, firstSource), RESOLVED_UNIT8,
+        matcher: isInferInstanceMembersInUnitTask);
+    CompilationUnit firstUnit = outputs[RESOLVED_UNIT8];
+    computeResult(
+        new LibrarySpecificUnit(secondSource, secondSource), RESOLVED_UNIT8);
+    CompilationUnit secondUnit = outputs[RESOLVED_UNIT8];
+
+    VariableDeclaration variableA = getTopLevelVariable(firstUnit, 'a');
+    VariableDeclaration variableB = getTopLevelVariable(secondUnit, 'b');
+    VariableDeclaration variableC = getFieldInClass(secondUnit, 'M', 'c');
+    InterfaceType stringType = context.typeProvider.stringType;
+
+    expect(variableA.element.type, stringType);
+    expect(variableB.element.type, stringType);
+    expect(variableB.initializer.staticType, stringType);
+    expect(variableC.element.type, stringType);
+    expect(variableC.initializer.staticType, stringType);
+  }
+
+  void test_perform_reresolution() {
+    enableStrongMode();
+    AnalysisTarget source = newSource(
+        '/test.dart',
+        '''
+const topLevel = '';
+class C {
+  String field = topLevel;
+}
+''');
+    computeResult(new LibrarySpecificUnit(source, source), RESOLVED_UNIT8);
+    CompilationUnit unit = outputs[RESOLVED_UNIT8];
+    VariableDeclaration topLevelDecl = getTopLevelVariable(unit, 'topLevel');
+    VariableDeclaration fieldDecl = getFieldInClass(unit, 'C', 'field');
+    VariableElement topLevel = topLevelDecl.name.staticElement;
+    VariableElement field = fieldDecl.name.staticElement;
+
+    InterfaceType stringType = context.typeProvider.stringType;
+    expect(topLevel.type, stringType);
+    expect(field.type, stringType);
+    expect(fieldDecl.initializer.staticType, stringType);
+  }
+}
+
+@reflectiveTest
+class InferStaticVariableTypesInUnitTaskTest extends _AbstractDartTaskTest {
+  void test_perform_const_field() {
+    enableStrongMode();
+    AnalysisTarget source = newSource(
+        '/test.dart',
+        '''
+class M {
+  static const X = "";
+}
+''');
+    computeResult(new LibrarySpecificUnit(source, source), RESOLVED_UNIT6,
+        matcher: isInferStaticVariableTypesInUnitTask);
+    CompilationUnit unit = outputs[RESOLVED_UNIT6];
+    VariableDeclaration declaration = getFieldInClass(unit, 'M', 'X');
+    InterfaceType stringType = context.typeProvider.stringType;
+    expect(declaration.element.type, stringType);
+  }
+
+  void test_perform_nestedDeclarations() {
+    enableStrongMode();
+    AnalysisTarget source = newSource(
+        '/test.dart',
+        '''
+var f = (int x) {
+  int squared(int value) => value * value;
+  var xSquared = squared(x);
+  return xSquared;
+};
+''');
+    computeResult(new LibrarySpecificUnit(source, source), RESOLVED_UNIT6,
+        matcher: isInferStaticVariableTypesInUnitTask);
+  }
+
+  void test_perform_recursive() {
+    enableStrongMode();
+    AnalysisTarget firstSource = newSource(
+        '/first.dart',
+        '''
+import 'second.dart';
+
+var a = new M();
+var c = b;
+''');
+    AnalysisTarget secondSource = newSource(
+        '/second.dart',
+        '''
+import 'first.dart';
+
+var b = a;
+class M {}
+''');
+    computeResult(
+        new LibrarySpecificUnit(firstSource, firstSource), RESOLVED_UNIT6,
+        matcher: isInferStaticVariableTypesInUnitTask);
+    CompilationUnit firstUnit = outputs[RESOLVED_UNIT6];
+    computeResult(
+        new LibrarySpecificUnit(secondSource, secondSource), RESOLVED_UNIT6);
+    CompilationUnit secondUnit = outputs[RESOLVED_UNIT6];
+
+    VariableDeclaration variableA = getTopLevelVariable(firstUnit, 'a');
+    VariableDeclaration variableB = getTopLevelVariable(secondUnit, 'b');
+    VariableDeclaration variableC = getTopLevelVariable(firstUnit, 'c');
+    ClassDeclaration classM = getClass(secondUnit, 'M');
+    DartType typeM = classM.element.type;
+
+    expect(variableA.element.type, typeM);
+    expect(variableB.element.type, typeM);
+    expect(variableB.initializer.staticType, typeM);
+    expect(variableC.element.type, typeM);
+    expect(variableC.initializer.staticType, typeM);
+  }
+
+  void test_perform_simple() {
+    enableStrongMode();
+    AnalysisTarget source = newSource(
+        '/test.dart',
+        '''
+var X = 1;
+
+var Y = () {
+  return 1 + X;
+};
+''');
+    computeResult(new LibrarySpecificUnit(source, source), RESOLVED_UNIT6,
+        matcher: isInferStaticVariableTypesInUnitTask);
+    CompilationUnit unit = outputs[RESOLVED_UNIT6];
+    TopLevelVariableDeclaration declaration = unit.declarations[1];
+    FunctionExpression function =
+        declaration.variables.variables[0].initializer;
+    BlockFunctionBody body = function.body;
+    ReturnStatement statement = body.block.statements[0];
+    Expression expression = statement.expression;
+    InterfaceType intType = context.typeProvider.intType;
+    expect(expression.staticType, intType);
+  }
+}
+
+@reflectiveTest
+class InferStaticVariableTypeTaskTest extends _AbstractDartTaskTest {
+  void test_getDeclaration_staticField() {
+    AnalysisTarget source = newSource(
+        '/test.dart',
+        '''
+class C {
+  var field = '';
+}
+''');
+    computeResult(new LibrarySpecificUnit(source, source), RESOLVED_UNIT5);
+    CompilationUnit unit = outputs[RESOLVED_UNIT5];
+    VariableDeclaration declaration = getFieldInClass(unit, 'C', 'field');
+    VariableElement variable = declaration.name.staticElement;
+    InferStaticVariableTypeTask inferTask =
+        new InferStaticVariableTypeTask(task.context, variable);
+    expect(inferTask.getDeclaration(unit), declaration);
+  }
+
+  void test_getDeclaration_topLevel() {
+    AnalysisTarget source = newSource(
+        '/test.dart',
+        '''
+var topLevel = '';
+''');
+    computeResult(new LibrarySpecificUnit(source, source), RESOLVED_UNIT5);
+    CompilationUnit unit = outputs[RESOLVED_UNIT5];
+    VariableDeclaration declaration = getTopLevelVariable(unit, 'topLevel');
+    VariableElement variable = declaration.name.staticElement;
+    InferStaticVariableTypeTask inferTask =
+        new InferStaticVariableTypeTask(task.context, variable);
+    expect(inferTask.getDeclaration(unit), declaration);
+  }
+
+  void test_perform() {
+    enableStrongMode();
+    AnalysisTarget source = newSource(
+        '/test3.dart',
+        '''
+var topLevel3 = '';
+class C {
+  var field3 = topLevel3;
+}
+''');
+    computeResult(new LibrarySpecificUnit(source, source), RESOLVED_UNIT5);
+    CompilationUnit unit = outputs[RESOLVED_UNIT5];
+    VariableDeclaration topLevelDecl = getTopLevelVariable(unit, 'topLevel3');
+    VariableDeclaration fieldDecl = getFieldInClass(unit, 'C', 'field3');
+    VariableElement topLevel = topLevelDecl.name.staticElement;
+    VariableElement field = fieldDecl.name.staticElement;
+
+    computeResult(field, INFERRED_STATIC_VARIABLE,
+        matcher: isInferStaticVariableTypeTask);
+    InterfaceType stringType = context.typeProvider.stringType;
+    expect(topLevel.type, stringType);
+    expect(field.type, stringType);
+    expect(fieldDecl.initializer.staticType, stringType);
+  }
+
+  void test_perform_const() {
+    enableStrongMode();
+    AnalysisTarget source = newSource(
+        '/test.dart',
+        '''
+const topLevel = "hello";
+class C {
+  var field = topLevel;
+}
+''');
+    computeResult(new LibrarySpecificUnit(source, source), RESOLVED_UNIT5);
+    CompilationUnit unit = outputs[RESOLVED_UNIT5];
+    VariableElement topLevel =
+        getTopLevelVariable(unit, 'topLevel').name.staticElement;
+    VariableElement field =
+        getFieldInClass(unit, 'C', 'field').name.staticElement;
+
+    computeResult(field, INFERRED_STATIC_VARIABLE,
+        matcher: isInferStaticVariableTypeTask);
+    InterfaceType stringType = context.typeProvider.stringType;
+    expect(topLevel.type, stringType);
+    expect(field.type, stringType);
+  }
+
+  void test_perform_cycle() {
+    enableStrongMode();
+    AnalysisTarget source = newSource(
+        '/test.dart',
+        '''
+var piFirst = true;
+var pi = piFirst ? 3.14 : tau / 2;
+var tau = piFirst ? pi * 2 : 6.28;
+''');
+    computeResult(new LibrarySpecificUnit(source, source), RESOLVED_UNIT5);
+    CompilationUnit unit = outputs[RESOLVED_UNIT5];
+    VariableElement piFirst =
+        getTopLevelVariable(unit, 'piFirst').name.staticElement;
+    VariableElement pi = getTopLevelVariable(unit, 'pi').name.staticElement;
+    VariableElement tau = getTopLevelVariable(unit, 'tau').name.staticElement;
+
+    computeResult(piFirst, INFERRED_STATIC_VARIABLE,
+        matcher: isInferStaticVariableTypeTask);
+    expect(piFirst.type, context.typeProvider.boolType);
+    expect(pi.type.isDynamic, isTrue);
+    expect(tau.type.isDynamic, isTrue);
+  }
+
+  void test_perform_error() {
+    enableStrongMode();
+    AnalysisTarget source = newSource(
+        '/test.dart',
+        '''
+var a = '' / null;
+''');
+    computeResult(new LibrarySpecificUnit(source, source), RESOLVED_UNIT5);
+    CompilationUnit unit = outputs[RESOLVED_UNIT5];
+    VariableElement a = getTopLevelVariable(unit, 'a').name.staticElement;
+
+    computeResult(a, INFERRED_STATIC_VARIABLE,
+        matcher: isInferStaticVariableTypeTask);
+    expect(a.type.isDynamic, isTrue);
+  }
+
+  void test_perform_null() {
+    enableStrongMode();
+    AnalysisTarget source = newSource(
+        '/test.dart',
+        '''
+var a = null;
+''');
+    computeResult(new LibrarySpecificUnit(source, source), RESOLVED_UNIT5);
+    CompilationUnit unit = outputs[RESOLVED_UNIT5];
+    VariableElement a = getTopLevelVariable(unit, 'a').name.staticElement;
+
+    computeResult(a, INFERRED_STATIC_VARIABLE,
+        matcher: isInferStaticVariableTypeTask);
+    expect(a.type.isDynamic, isTrue);
+  }
+}
+
+@reflectiveTest
 class LibraryErrorsReadyTaskTest extends _AbstractDartTaskTest {
   test_perform() {
-    Source library = newSource('/lib.dart', r'''
+    Source library = newSource(
+        '/lib.dart',
+        r'''
 library lib;
 part 'part1.dart';
 part 'part2.dart';
 X v1;
 ''');
-    Source part1 = newSource('/part1.dart', r'''
+    Source part1 = newSource(
+        '/part1.dart',
+        r'''
 part of lib;
 X v2;
 ''');
-    Source part2 = newSource('/part2.dart', r'''
+    Source part2 = newSource(
+        '/part2.dart',
+        r'''
 part of lib;
 X v3;
 ''');
-    computeResult(library, LIBRARY_ERRORS_READY);
-    expect(task, new isInstanceOf<LibraryErrorsReadyTask>());
+    computeResult(library, LIBRARY_ERRORS_READY,
+        matcher: isLibraryErrorsReadyTask);
     expect(outputs, hasLength(1));
     bool ready = outputs[LIBRARY_ERRORS_READY];
     expect(ready, isTrue);
@@ -1885,51 +2662,12 @@
 
 @reflectiveTest
 class LibraryUnitErrorsTaskTest extends _AbstractDartTaskTest {
-  test_buildInputs() {
-    Map<String, TaskInput> inputs = LibraryUnitErrorsTask
-        .buildInputs(new LibrarySpecificUnit(emptySource, emptySource));
-    expect(inputs, isNotNull);
-    expect(inputs.keys, unorderedEquals([
-      LibraryUnitErrorsTask.HINTS_INPUT,
-      LibraryUnitErrorsTask.RESOLVE_REFERENCES_ERRORS_INPUT,
-      LibraryUnitErrorsTask.RESOLVE_TYPE_NAMES_ERRORS_INPUT,
-      LibraryUnitErrorsTask.VARIABLE_REFERENCE_ERRORS_INPUT,
-      LibraryUnitErrorsTask.VERIFY_ERRORS_INPUT
-    ]));
-  }
-
-  test_constructor() {
-    LibraryUnitErrorsTask task =
-        new LibraryUnitErrorsTask(context, emptySource);
-    expect(task, isNotNull);
-    expect(task.context, context);
-    expect(task.target, emptySource);
-  }
-
-  test_createTask() {
-    LibraryUnitErrorsTask task =
-        LibraryUnitErrorsTask.createTask(context, emptySource);
-    expect(task, isNotNull);
-    expect(task.context, context);
-    expect(task.target, emptySource);
-  }
-
-  test_description() {
-    LibraryUnitErrorsTask task = new LibraryUnitErrorsTask(null, emptySource);
-    expect(task.description, isNotNull);
-  }
-
-  test_descriptor() {
-    TaskDescriptor descriptor = LibraryUnitErrorsTask.DESCRIPTOR;
-    expect(descriptor, isNotNull);
-  }
-
   test_perform_definingCompilationUnit() {
     AnalysisTarget library =
         newSource('/test.dart', 'library test; import "dart:math";');
     computeResult(
-        new LibrarySpecificUnit(library, library), LIBRARY_UNIT_ERRORS);
-    expect(task, new isInstanceOf<LibraryUnitErrorsTask>());
+        new LibrarySpecificUnit(library, library), LIBRARY_UNIT_ERRORS,
+        matcher: isLibraryUnitErrorsTask);
     expect(outputs, hasLength(1));
     List<AnalysisError> errors = outputs[LIBRARY_UNIT_ERRORS];
     expect(errors, hasLength(1));
@@ -1939,8 +2677,8 @@
     AnalysisTarget library =
         newSource('/lib.dart', 'library test; part "part.dart";');
     AnalysisTarget part = newSource('/part.dart', 'part of test;');
-    computeResult(new LibrarySpecificUnit(library, part), LIBRARY_UNIT_ERRORS);
-    expect(task, new isInstanceOf<LibraryUnitErrorsTask>());
+    computeResult(new LibrarySpecificUnit(library, part), LIBRARY_UNIT_ERRORS,
+        matcher: isLibraryUnitErrorsTask);
     expect(outputs, hasLength(1));
     List<AnalysisError> errors = outputs[LIBRARY_UNIT_ERRORS];
     expect(errors, hasLength(0));
@@ -1951,49 +2689,16 @@
 class ParseDartTaskTest extends _AbstractDartTaskTest {
   Source source;
 
-  test_buildInputs() {
-    Map<String, TaskInput> inputs = ParseDartTask.buildInputs(emptySource);
-    expect(inputs, isNotNull);
-    expect(inputs.keys, unorderedEquals([
-      ParseDartTask.LINE_INFO_INPUT_NAME,
-      ParseDartTask.MODIFICATION_TIME_INPUT_NAME,
-      ParseDartTask.TOKEN_STREAM_INPUT_NAME
-    ]));
-  }
-
-  test_constructor() {
-    ParseDartTask task = new ParseDartTask(context, emptySource);
-    expect(task, isNotNull);
-    expect(task.context, context);
-    expect(task.target, emptySource);
-  }
-
-  test_createTask() {
-    ParseDartTask task = ParseDartTask.createTask(context, emptySource);
-    expect(task, isNotNull);
-    expect(task.context, context);
-    expect(task.target, emptySource);
-  }
-
-  test_description() {
-    ParseDartTask task = new ParseDartTask(null, emptySource);
-    expect(task.description, isNotNull);
-  }
-
-  test_descriptor() {
-    TaskDescriptor descriptor = ParseDartTask.DESCRIPTOR;
-    expect(descriptor, isNotNull);
-  }
-
   test_perform() {
     _performParseTask(r'''
 part of lib;
 class B {}''');
-    expect(outputs, hasLength(8));
+    expect(outputs, hasLength(9));
     expect(outputs[EXPLICITLY_IMPORTED_LIBRARIES], hasLength(0));
     expect(outputs[EXPORTED_LIBRARIES], hasLength(0));
     _assertHasCore(outputs[IMPORTED_LIBRARIES], 1);
     expect(outputs[INCLUDED_PARTS], hasLength(0));
+    expect(outputs[LIBRARY_SPECIFIC_UNITS], hasLength(1));
     expect(outputs[PARSE_ERRORS], hasLength(0));
     expect(outputs[PARSED_UNIT], isNotNull);
     expect(outputs[SOURCE_KIND], SourceKind.PART);
@@ -2002,10 +2707,14 @@
 
   test_perform_computeSourceKind_noDirectives_hasContainingLibrary() {
     // Parse "lib.dart" to let the context know that "test.dart" is included.
-    computeResult(newSource('/lib.dart', r'''
+    computeResult(
+        newSource(
+            '/lib.dart',
+            r'''
 library lib;
 part 'test.dart';
-'''), PARSED_UNIT);
+'''),
+        PARSED_UNIT);
     // If there are no the "part of" directive, then it is not a part.
     _performParseTask('');
     expect(outputs[SOURCE_KIND], SourceKind.LIBRARY);
@@ -2018,11 +2727,12 @@
 
   test_perform_doesNotExist() {
     _performParseTask(null);
-    expect(outputs, hasLength(8));
+    expect(outputs, hasLength(9));
     expect(outputs[EXPLICITLY_IMPORTED_LIBRARIES], hasLength(0));
     expect(outputs[EXPORTED_LIBRARIES], hasLength(0));
     _assertHasCore(outputs[IMPORTED_LIBRARIES], 1);
     expect(outputs[INCLUDED_PARTS], hasLength(0));
+    expect(outputs[LIBRARY_SPECIFIC_UNITS], hasLength(1));
     expect(outputs[PARSE_ERRORS], hasLength(0));
     expect(outputs[PARSED_UNIT], isNotNull);
     expect(outputs[SOURCE_KIND], SourceKind.UNKNOWN);
@@ -2037,11 +2747,12 @@
 export '${a}lib3.dart';
 part 'part.dart';
 class A {}''');
-    expect(outputs, hasLength(8));
+    expect(outputs, hasLength(9));
     expect(outputs[EXPLICITLY_IMPORTED_LIBRARIES], hasLength(1));
     expect(outputs[EXPORTED_LIBRARIES], hasLength(0));
     _assertHasCore(outputs[IMPORTED_LIBRARIES], 2);
     expect(outputs[INCLUDED_PARTS], hasLength(1));
+    expect(outputs[LIBRARY_SPECIFIC_UNITS], hasLength(2));
     expect(outputs[PARSE_ERRORS], hasLength(2));
     expect(outputs[PARSED_UNIT], isNotNull);
     expect(outputs[SOURCE_KIND], SourceKind.LIBRARY);
@@ -2055,11 +2766,12 @@
 export 'lib3.dart';
 part 'part.dart';
 class A {''');
-    expect(outputs, hasLength(8));
+    expect(outputs, hasLength(9));
     expect(outputs[EXPLICITLY_IMPORTED_LIBRARIES], hasLength(1));
     expect(outputs[EXPORTED_LIBRARIES], hasLength(1));
     _assertHasCore(outputs[IMPORTED_LIBRARIES], 2);
     expect(outputs[INCLUDED_PARTS], hasLength(1));
+    expect(outputs[LIBRARY_SPECIFIC_UNITS], hasLength(2));
     expect(outputs[PARSE_ERRORS], hasLength(1));
     expect(outputs[PARSED_UNIT], isNotNull);
     expect(outputs[SOURCE_KIND], SourceKind.LIBRARY);
@@ -2078,11 +2790,12 @@
     _performParseTask(r'''
 part of lib;
 class B {}''');
-    expect(outputs, hasLength(8));
+    expect(outputs, hasLength(9));
     expect(outputs[EXPLICITLY_IMPORTED_LIBRARIES], hasLength(0));
     expect(outputs[EXPORTED_LIBRARIES], hasLength(0));
     _assertHasCore(outputs[IMPORTED_LIBRARIES], 1);
     expect(outputs[INCLUDED_PARTS], hasLength(0));
+    expect(outputs[LIBRARY_SPECIFIC_UNITS], hasLength(1));
     expect(outputs[PARSE_ERRORS], hasLength(0));
     expect(outputs[PARSED_UNIT], isNotNull);
     expect(outputs[SOURCE_KIND], SourceKind.PART);
@@ -2091,8 +2804,7 @@
 
   void _performParseTask(String content) {
     source = newSource('/test.dart', content);
-    computeResult(source, PARSED_UNIT);
-    expect(task, new isInstanceOf<ParseDartTask>());
+    computeResult(source, PARSED_UNIT, matcher: isParseDartTask);
   }
 
   static void _assertHasCore(List<Source> sources, int lenght) {
@@ -2104,20 +2816,390 @@
 }
 
 @reflectiveTest
+class PartiallyResolveUnitReferencesTaskTest extends _AbstractDartTaskTest {
+  test_perform() {
+    enableStrongMode();
+    Source source = newSource(
+        '/test.dart',
+        '''
+int a = b;
+int b = c;
+var d = 0;
+class A {}
+class C {
+  static final f = '';
+  var g = 0;
+}
+''');
+    LibrarySpecificUnit target = new LibrarySpecificUnit(source, source);
+    computeResult(target, RESOLVED_UNIT5,
+        matcher: isPartiallyResolveUnitReferencesTask);
+    // Test the outputs
+    expect(outputs[INFERABLE_STATIC_VARIABLES_IN_UNIT], hasLength(4));
+    CompilationUnit unit = outputs[RESOLVED_UNIT5];
+    expect(unit, same(outputs[RESOLVED_UNIT5]));
+    // Test the state of the AST
+    TopLevelVariableDeclaration a = unit.declarations[0];
+    VariableDeclaration variableA = a.variables.variables[0];
+    SimpleIdentifier initializer = variableA.initializer;
+    expect(initializer.staticElement, isNotNull);
+  }
+
+  test_perform_importExport() {
+    newSource(
+        '/a.dart',
+        '''
+library a;
+class A<T> {
+  T m() {}
+}
+''');
+    newSource(
+        '/b.dart',
+        '''
+library b;
+export 'a.dart';
+''');
+    Source sourceC = newSource(
+        '/c.dart',
+        '''
+library c;
+import 'b.dart';
+main() {
+  new A<int>().m();
+}
+''');
+    computeResult(new LibrarySpecificUnit(sourceC, sourceC), RESOLVED_UNIT5,
+        matcher: isPartiallyResolveUnitReferencesTask);
+    // validate
+    expect(outputs[INFERABLE_STATIC_VARIABLES_IN_UNIT], hasLength(0));
+    CompilationUnit unit = outputs[RESOLVED_UNIT5];
+    expect(unit, isNotNull);
+
+    FunctionDeclaration mainFunction = unit.declarations[0];
+    expect(mainFunction.element, isNotNull);
+    BlockFunctionBody body = mainFunction.functionExpression.body;
+    List<Statement> statements = body.block.statements;
+    ExpressionStatement statement = statements[0];
+    MethodInvocation invocation = statement.expression;
+    MethodElement methodElement = invocation.methodName.staticElement;
+    expect(methodElement, isNull);
+  }
+
+  test_perform_notResolved() {
+    enableStrongMode();
+    Source source = newSource(
+        '/test.dart',
+        '''
+int A;
+f1() {
+  A;
+}
+var f2 = () {
+  A;
+  void f3() {
+    A;
+  }
+}
+class C {
+  C() {
+    A;
+  }
+  m() {
+    A;
+  }
+}
+''');
+    LibrarySpecificUnit target = new LibrarySpecificUnit(source, source);
+    computeResult(target, RESOLVED_UNIT5,
+        matcher: isPartiallyResolveUnitReferencesTask);
+    CompilationUnit unit = outputs[RESOLVED_UNIT5];
+    NodeList<CompilationUnitMember> declarations = unit.declarations;
+
+    void expectReference(BlockFunctionBody body, bool isResolved) {
+      ExpressionStatement statement = body.block.statements[0];
+      SimpleIdentifier reference = statement.expression;
+      expect(reference.staticElement, isResolved ? isNotNull : isNull);
+    }
+    //
+    // The reference to 'A' in 'f1' should not be resolved.
+    //
+    FunctionDeclaration f1 = declarations[1];
+    expectReference(f1.functionExpression.body, false);
+    //
+    // The references to 'A' in 'f2' should be resolved.
+    //
+    TopLevelVariableDeclaration f2 = declarations[2];
+    FunctionExpression expression2 = f2.variables.variables[0].initializer;
+    BlockFunctionBody body2 = expression2.body;
+    expectReference(body2, true);
+
+    FunctionDeclarationStatement statement2 = body2.block.statements[1];
+    BlockFunctionBody innerBody =
+        statement2.functionDeclaration.functionExpression.body;
+    expectReference(innerBody, true);
+    //
+    // The references to 'A' in 'C' should not be resolved.
+    //
+    ClassDeclaration c = declarations[3];
+    NodeList<ClassMember> members = c.members;
+
+    ConstructorDeclaration constructor = members[0];
+    expectReference(constructor.body, false);
+
+    MethodDeclaration method = members[1];
+    expectReference(method.body, false);
+  }
+}
+
+@reflectiveTest
+class ResolveInstanceFieldsInUnitTaskTest extends _AbstractDartTaskTest {
+  @override
+  void setUp() {
+    super.setUp();
+    enableStrongMode();
+  }
+
+  // Test inference of instance fields across units
+  void test_perform_inference_cross_unit_instance() {
+    List<Source> sources = newSources({
+      '/a.dart': '''
+          import 'b.dart';
+          class A {
+            final a2 = new B().b2;
+          }
+      ''',
+      '/b.dart': '''
+          class B {
+            final b2 = 1;
+          }
+      ''',
+      '/main.dart': '''
+          import "a.dart";
+
+          test1() {
+            int x = 0;
+            x = new A().a2;
+          }
+    '''
+    });
+    InterfaceType intType = context.typeProvider.intType;
+    DartType dynamicType = context.typeProvider.dynamicType;
+
+    computeResult(
+        new LibrarySpecificUnit(sources[1], sources[1]), RESOLVED_UNIT7);
+    CompilationUnit unit1 = outputs[RESOLVED_UNIT7];
+
+    // B.b2 shoud be resolved on the rhs, but not yet inferred.
+    assertVariableDeclarationTypes(
+        getFieldInClass(unit1, "B", "b2"), dynamicType, intType);
+
+    computeResult(
+        new LibrarySpecificUnit(sources[0], sources[0]), RESOLVED_UNIT7);
+    CompilationUnit unit0 = outputs[RESOLVED_UNIT7];
+
+    // B.b2 should now be fully resolved and inferred.
+    assertVariableDeclarationTypes(
+        getFieldInClass(unit1, "B", "b2"), intType, intType);
+
+    // A.a2 should now be resolved on the rhs, but not yet inferred.
+    assertVariableDeclarationTypes(
+        getFieldInClass(unit0, "A", "a2"), dynamicType, intType);
+
+    computeResult(
+        new LibrarySpecificUnit(sources[2], sources[2]), RESOLVED_UNIT7);
+    CompilationUnit unit2 = outputs[RESOLVED_UNIT7];
+
+    // A.a2 should now be fully resolved and inferred.
+    assertVariableDeclarationTypes(
+        getFieldInClass(unit0, "A", "a2"), intType, intType);
+
+    assertVariableDeclarationTypes(
+        getFieldInClass(unit1, "B", "b2"), intType, intType);
+  }
+
+  // Test inference of instance fields across units
+  void test_perform_inference_cross_unit_instance_cyclic() {
+    List<Source> sources = newSources({
+      '/a.dart': '''
+          import 'b.dart';
+          class A {
+            final a2 = new B().b2;
+          }
+      ''',
+      '/b.dart': '''
+          import 'a.dart';
+          class B {
+            final b2 = 1;
+          }
+      ''',
+      '/main.dart': '''
+          import "a.dart";
+
+          test1() {
+            int x = 0;
+            x = new A().a2;
+          }
+    '''
+    });
+    InterfaceType intType = context.typeProvider.intType;
+    DartType dynamicType = context.typeProvider.dynamicType;
+
+    computeResult(
+        new LibrarySpecificUnit(sources[0], sources[0]), RESOLVED_UNIT7);
+    CompilationUnit unit0 = outputs[RESOLVED_UNIT7];
+
+    // A.a2 should now be resolved on the rhs, but not yet inferred.
+    assertVariableDeclarationTypes(
+        getFieldInClass(unit0, "A", "a2"), dynamicType, dynamicType);
+
+    computeResult(
+        new LibrarySpecificUnit(sources[2], sources[2]), RESOLVED_UNIT7);
+    CompilationUnit unit2 = outputs[RESOLVED_UNIT7];
+
+    // A.a2 should now be fully resolved and inferred.
+    assertVariableDeclarationTypes(
+        getFieldInClass(unit0, "A", "a2"), dynamicType, dynamicType);
+  }
+
+  // Test inference of instance fields across units with cycles
+  void test_perform_inference_cross_unit_static_instance() {
+    List<Source> sources = newSources({
+      '/a.dart': '''
+          import 'b.dart';
+          class A {
+            static final a1 = B.b1;
+            final a2 = new B().b2;
+          }
+      ''',
+      '/b.dart': '''
+          class B {
+            static final b1 = 1;
+            final b2 = 1;
+          }
+      ''',
+      '/main.dart': '''
+          import "a.dart";
+
+          test1() {
+            int x = 0;
+            // inference in A now works.
+            x = A.a1;
+            x = new A().a2;
+          }
+    '''
+    });
+    InterfaceType intType = context.typeProvider.intType;
+    DartType dynamicType = context.typeProvider.dynamicType;
+
+    computeResult(
+        new LibrarySpecificUnit(sources[1], sources[1]), RESOLVED_UNIT7);
+    CompilationUnit unit1 = outputs[RESOLVED_UNIT7];
+
+    assertVariableDeclarationTypes(
+        getFieldInClass(unit1, "B", "b1"), intType, intType);
+    assertVariableDeclarationTypes(
+        getFieldInClass(unit1, "B", "b2"), dynamicType, intType);
+
+    computeResult(
+        new LibrarySpecificUnit(sources[0], sources[0]), RESOLVED_UNIT7);
+    CompilationUnit unit0 = outputs[RESOLVED_UNIT7];
+
+    assertVariableDeclarationTypes(
+        getFieldInClass(unit0, "A", "a1"), intType, intType);
+    assertVariableDeclarationTypes(
+        getFieldInClass(unit0, "A", "a2"), dynamicType, intType);
+
+    assertVariableDeclarationTypes(
+        getFieldInClass(unit1, "B", "b1"), intType, intType);
+    assertVariableDeclarationTypes(
+        getFieldInClass(unit1, "B", "b2"), intType, intType);
+
+    computeResult(
+        new LibrarySpecificUnit(sources[2], sources[2]), RESOLVED_UNIT7);
+    CompilationUnit unit2 = outputs[RESOLVED_UNIT7];
+
+    assertVariableDeclarationTypes(
+        getFieldInClass(unit0, "A", "a1"), intType, intType);
+    assertVariableDeclarationTypes(
+        getFieldInClass(unit0, "A", "a2"), intType, intType);
+
+    assertVariableDeclarationTypes(
+        getFieldInClass(unit1, "B", "b1"), intType, intType);
+    assertVariableDeclarationTypes(
+        getFieldInClass(unit1, "B", "b2"), intType, intType);
+  }
+
+  // Test inference between static and instance fields
+  void test_perform_inference_instance() {
+    List<Source> sources = newSources({
+      '/a.dart': '''
+          import 'b.dart';
+          class A {
+            final a2 = new B().b2;
+          }
+
+          class B {
+            final b2 = 1;
+          }
+      ''',
+      '/main.dart': '''
+          import "a.dart";
+
+          test1() {
+            int x = 0;
+            x = new A().a2;
+          }
+    '''
+    });
+    InterfaceType intType = context.typeProvider.intType;
+    DartType dynamicType = context.typeProvider.dynamicType;
+
+    computeResult(
+        new LibrarySpecificUnit(sources[0], sources[0]), RESOLVED_UNIT7);
+    CompilationUnit unit0 = outputs[RESOLVED_UNIT7];
+
+    // A.a2 should now be resolved on the rhs, but not yet inferred.
+    assertVariableDeclarationTypes(
+        getFieldInClass(unit0, "A", "a2"), dynamicType, dynamicType);
+
+    // B.b2 shoud be resolved on the rhs, but not yet inferred.
+    assertVariableDeclarationTypes(
+        getFieldInClass(unit0, "B", "b2"), dynamicType, intType);
+
+    computeResult(
+        new LibrarySpecificUnit(sources[1], sources[1]), RESOLVED_UNIT7);
+    CompilationUnit unit1 = outputs[RESOLVED_UNIT7];
+
+    // A.a2 should now be fully resolved and inferred.
+    assertVariableDeclarationTypes(
+        getFieldInClass(unit0, "A", "a2"), dynamicType, dynamicType);
+
+    // B.b2 should now be fully resolved and inferred.
+    assertVariableDeclarationTypes(
+        getFieldInClass(unit0, "B", "b2"), intType, intType);
+  }
+}
+
+@reflectiveTest
 class ResolveLibraryTypeNamesTaskTest extends _AbstractDartTaskTest {
   test_perform() {
-    Source sourceLib = newSource('/my_lib.dart', '''
+    Source sourceLib = newSource(
+        '/my_lib.dart',
+        '''
 library my_lib;
 part 'my_part.dart';
 class A {}
 class B extends A {}
 ''');
-    newSource('/my_part.dart', '''
+    newSource(
+        '/my_part.dart',
+        '''
 part of my_lib;
 class C extends A {}
 ''');
-    computeResult(sourceLib, LIBRARY_ELEMENT5);
-    expect(task, new isInstanceOf<ResolveLibraryTypeNamesTask>());
+    computeResult(sourceLib, LIBRARY_ELEMENT5,
+        matcher: isResolveLibraryTypeNamesTask);
     // validate
     LibraryElement library = outputs[LIBRARY_ELEMENT5];
     {
@@ -2128,22 +3210,27 @@
       ClassElement classC = library.getType('C');
       expect(classC.supertype.displayName, 'A');
     }
+    expect(library.loadLibraryFunction, isNotNull);
   }
 
   test_perform_external() {
-    Source sourceA = newSource('/a.dart', '''
+    Source sourceA = newSource(
+        '/a.dart',
+        '''
 library a;
 import 'b.dart';
 class A extends B {}
 ''');
-    newSource('/b.dart', '''
+    newSource(
+        '/b.dart',
+        '''
 library b;
 class B {}
 ''');
     // The reference A to B should be resolved, but there's no requirement that
     // the full class hierarchy be resolved.
-    computeResult(sourceA, LIBRARY_ELEMENT5);
-    expect(task, new isInstanceOf<ResolveLibraryTypeNamesTask>());
+    computeResult(sourceA, LIBRARY_ELEMENT5,
+        matcher: isResolveLibraryTypeNamesTask);
     // validate
     LibraryElement library = outputs[LIBRARY_ELEMENT5];
     {
@@ -2156,96 +3243,53 @@
 }
 
 @reflectiveTest
-class ResolveReferencesTaskTest extends _AbstractDartTaskTest {
-  test_perform() {
-    Source source = newSource('/test.dart', '''
-class A {
-  m() {}
+class ResolveUnitTaskTest extends _AbstractDartTaskTest {
+  void test_perform() {
+    AnalysisTarget source = newSource(
+        '/test.dart',
+        '''
+void f() {
+  var c = new C();
+  c.m();
 }
-main(A a) {
-  a.m();
+class C {
+  void m() {
+    f();
+  }
 }
 ''');
-    LibrarySpecificUnit target = new LibrarySpecificUnit(source, source);
-    // prepare unit and "a.m()" invocation
-    computeResult(target, RESOLVED_UNIT5);
-    CompilationUnit unit = outputs[RESOLVED_UNIT5];
-    // walk the AST
-    FunctionDeclaration function = unit.declarations[1];
-    BlockFunctionBody body = function.functionExpression.body;
-    ExpressionStatement statement = body.block.statements[0];
-    MethodInvocation invocation = statement.expression;
-    expect(task, new isInstanceOf<ResolveUnitReferencesTask>());
-    expect(unit, same(outputs[RESOLVED_UNIT5]));
-    // a.m() is resolved now
-    expect(invocation.methodName.staticElement, isNotNull);
+    computeResult(new LibrarySpecificUnit(source, source), RESOLVED_UNIT9,
+        matcher: isResolveUnitTask);
+    CompilationUnit unit = outputs[RESOLVED_UNIT9];
+
+    FunctionDeclaration f = unit.declarations[0];
+    _assertResolved(f.functionExpression.body);
+
+    MethodDeclaration m = (unit.declarations[1] as ClassDeclaration).members[0];
+    _assertResolved(m.body);
+
+    expect(outputs[RESOLVE_UNIT_ERRORS], hasLength(0));
   }
 
-  test_perform_errors() {
-    Source source = newSource('/test.dart', '''
-class A {
-}
-main(A a) {
-  a.unknownMethod();
-}
-''');
-    LibrarySpecificUnit target = new LibrarySpecificUnit(source, source);
-    computeResult(target, RESOLVED_UNIT5);
-    expect(task, new isInstanceOf<ResolveUnitReferencesTask>());
-    // validate
-    _fillErrorListener(RESOLVE_REFERENCES_ERRORS);
-    errorListener.assertErrorsWithCodes(
-        <ErrorCode>[StaticTypeWarningCode.UNDEFINED_METHOD]);
-  }
-
-  test_perform_importExport() {
-    newSource('/a.dart', '''
-library a;
-class A<T> {
-  T m() {}
-}
-''');
-    newSource('/b.dart', '''
-library b;
-export 'a.dart';
-''');
-    Source sourceC = newSource('/c.dart', '''
-library c;
-import 'b.dart';
-main() {
-  new A<int>().m();
-}
-''');
-    computeResult(new LibrarySpecificUnit(sourceC, sourceC), RESOLVED_UNIT5);
-    expect(task, new isInstanceOf<ResolveUnitReferencesTask>());
-    // validate
-    CompilationUnit unit = outputs[RESOLVED_UNIT5];
-    expect(unit, isNotNull);
-    {
-      FunctionDeclaration functionDeclaration = unit.declarations[0];
-      BlockFunctionBody body = functionDeclaration.functionExpression.body;
-      List<Statement> statements = body.block.statements;
-      ExpressionStatement statement = statements[0];
-      MethodInvocation invocation = statement.expression;
-      MethodElement methodElement = invocation.methodName.staticElement;
-      expect(methodElement, isNotNull);
-      expect(methodElement.type, isNotNull);
-      expect(methodElement.returnType.toString(), 'int');
-    }
+  void _assertResolved(FunctionBody body) {
+    ResolutionVerifier verifier = new ResolutionVerifier();
+    body.accept(verifier);
+    verifier.assertResolved();
   }
 }
 
 @reflectiveTest
 class ResolveUnitTypeNamesTaskTest extends _AbstractDartTaskTest {
   test_perform() {
-    Source source = newSource('/test.dart', '''
+    Source source = newSource(
+        '/test.dart',
+        '''
 class A {}
 class B extends A {}
 int f(String p) => p.length;
 ''');
     LibrarySpecificUnit target = new LibrarySpecificUnit(source, source);
-    computeResult(target, RESOLVED_UNIT3);
-    expect(task, new isInstanceOf<ResolveUnitTypeNamesTask>());
+    computeResult(target, RESOLVED_UNIT3, matcher: isResolveUnitTypeNamesTask);
     // validate
     CompilationUnit unit = outputs[RESOLVED_UNIT3];
     {
@@ -2265,12 +3309,14 @@
   }
 
   test_perform_errors() {
-    Source source = newSource('/test.dart', '''
+    Source source = newSource(
+        '/test.dart',
+        '''
 NoSuchClass f() => null;
 ''');
     LibrarySpecificUnit target = new LibrarySpecificUnit(source, source);
-    computeResult(target, RESOLVE_TYPE_NAMES_ERRORS);
-    expect(task, new isInstanceOf<ResolveUnitTypeNamesTask>());
+    computeResult(target, RESOLVE_TYPE_NAMES_ERRORS,
+        matcher: isResolveUnitTypeNamesTask);
     // validate
     _fillErrorListener(RESOLVE_TYPE_NAMES_ERRORS);
     errorListener
@@ -2278,13 +3324,14 @@
   }
 
   test_perform_typedef() {
-    Source source = newSource('/test.dart', '''
+    Source source = newSource(
+        '/test.dart',
+        '''
 typedef int F(G g);
 typedef String G(int p);
 ''');
     LibrarySpecificUnit target = new LibrarySpecificUnit(source, source);
-    computeResult(target, RESOLVED_UNIT3);
-    expect(task, new isInstanceOf<ResolveUnitTypeNamesTask>());
+    computeResult(target, RESOLVED_UNIT3, matcher: isResolveUnitTypeNamesTask);
     // validate
     CompilationUnit unit = outputs[RESOLVED_UNIT3];
     FunctionTypeAlias nodeF = unit.declarations[0];
@@ -2305,12 +3352,14 @@
   }
 
   test_perform_typedef_errors() {
-    Source source = newSource('/test.dart', '''
+    Source source = newSource(
+        '/test.dart',
+        '''
 typedef int F(NoSuchType p);
 ''');
     LibrarySpecificUnit target = new LibrarySpecificUnit(source, source);
-    computeResult(target, RESOLVE_TYPE_NAMES_ERRORS);
-    expect(task, new isInstanceOf<ResolveUnitTypeNamesTask>());
+    computeResult(target, RESOLVE_TYPE_NAMES_ERRORS,
+        matcher: isResolveUnitTypeNamesTask);
     // validate
     _fillErrorListener(RESOLVE_TYPE_NAMES_ERRORS);
     errorListener
@@ -2331,17 +3380,21 @@
   }
 
   test_perform_buildClosureLibraryElements() {
-    Source source = newSource('/test.dart', '''
+    Source source = newSource(
+        '/test.dart',
+        '''
 main() {
 }
 ''');
     LibrarySpecificUnit target = new LibrarySpecificUnit(source, source);
-    computeResult(target, RESOLVED_UNIT4);
-    expect(task, new isInstanceOf<ResolveVariableReferencesTask>());
+    computeResult(target, RESOLVED_UNIT4,
+        matcher: isResolveVariableReferencesTask);
   }
 
   test_perform_local() {
-    Source source = newSource('/test.dart', '''
+    Source source = newSource(
+        '/test.dart',
+        '''
 main() {
   var v1 = 1;
   var v2 = 1;
@@ -2356,8 +3409,8 @@
 }
 ''');
     LibrarySpecificUnit target = new LibrarySpecificUnit(source, source);
-    computeResult(target, RESOLVED_UNIT4);
-    expect(task, new isInstanceOf<ResolveVariableReferencesTask>());
+    computeResult(target, RESOLVED_UNIT4,
+        matcher: isResolveVariableReferencesTask);
     // validate
     CompilationUnit unit = outputs[RESOLVED_UNIT4];
     FunctionElement main = unit.element.functions[0];
@@ -2368,7 +3421,9 @@
   }
 
   test_perform_parameter() {
-    Source source = newSource('/test.dart', '''
+    Source source = newSource(
+        '/test.dart',
+        '''
 main(p1, p2, p3, p4) {
   p2 = 2;
   p4 = 2;
@@ -2379,8 +3434,8 @@
 }
 ''');
     LibrarySpecificUnit target = new LibrarySpecificUnit(source, source);
-    computeResult(target, RESOLVED_UNIT4);
-    expect(task, new isInstanceOf<ResolveVariableReferencesTask>());
+    computeResult(target, RESOLVED_UNIT4,
+        matcher: isResolveVariableReferencesTask);
     // validate
     CompilationUnit unit = outputs[RESOLVED_UNIT4];
     FunctionElement main = unit.element.functions[0];
@@ -2393,36 +3448,6 @@
 
 @reflectiveTest
 class ScanDartTaskTest extends _AbstractDartTaskTest {
-  test_buildInputs() {
-    Map<String, TaskInput> inputs = ScanDartTask.buildInputs(emptySource);
-    expect(inputs, isNotNull);
-    expect(inputs.keys, unorderedEquals([ScanDartTask.CONTENT_INPUT_NAME]));
-  }
-
-  test_constructor() {
-    ScanDartTask task = new ScanDartTask(context, emptySource);
-    expect(task, isNotNull);
-    expect(task.context, context);
-    expect(task.target, emptySource);
-  }
-
-  test_createTask() {
-    ScanDartTask task = ScanDartTask.createTask(context, emptySource);
-    expect(task, isNotNull);
-    expect(task.context, context);
-    expect(task.target, emptySource);
-  }
-
-  test_description() {
-    ScanDartTask task = new ScanDartTask(null, emptySource);
-    expect(task.description, isNotNull);
-  }
-
-  test_descriptor() {
-    TaskDescriptor descriptor = ScanDartTask.DESCRIPTOR;
-    expect(descriptor, isNotNull);
-  }
-
   test_perform_errors() {
     _performScanTask('import "');
     expect(outputs, hasLength(3));
@@ -2457,8 +3482,7 @@
     DartScript script =
         new DartScript(source, [new ScriptFragment(97, 5, 36, scriptContent)]);
 
-    computeResult(script, TOKEN_STREAM);
-    expect(task, new isInstanceOf<ScanDartTask>());
+    computeResult(script, TOKEN_STREAM, matcher: isScanDartTask);
     expect(outputs[LINE_INFO], isNotNull);
     expect(outputs[SCAN_ERRORS], isEmpty);
     Token tokenStream = outputs[TOKEN_STREAM];
@@ -2468,22 +3492,556 @@
 
   void _performScanTask(String content) {
     AnalysisTarget target = newSource('/test.dart', content);
-    computeResult(target, TOKEN_STREAM);
-    expect(task, new isInstanceOf<ScanDartTask>());
+    computeResult(target, TOKEN_STREAM, matcher: isScanDartTask);
+  }
+}
+
+@reflectiveTest
+class StrongModeInferenceTest extends _AbstractDartTaskTest {
+  @override
+  void setUp() {
+    super.setUp();
+    enableStrongMode();
+  }
+
+  // Check that even within a static variable cycle, inferred
+  // types get propagated to the members of the cycle.
+  void test_perform_cycle() {
+    AnalysisTarget source = newSource(
+        '/test.dart',
+        '''
+var piFirst = true;
+var pi = piFirst ? 3.14 : tau / 2;
+var tau = piFirst ? pi * 2 : 6.28;
+''');
+    computeResult(new LibrarySpecificUnit(source, source), RESOLVED_UNIT9);
+    CompilationUnit unit = outputs[RESOLVED_UNIT9];
+    VariableElement piFirst =
+        getTopLevelVariable(unit, 'piFirst').name.staticElement;
+    VariableElement pi = getTopLevelVariable(unit, 'pi').name.staticElement;
+    VariableElement tau = getTopLevelVariable(unit, 'tau').name.staticElement;
+    Expression piFirstUse = (getTopLevelVariable(unit, 'tau').initializer
+        as ConditionalExpression).condition;
+
+    expect(piFirstUse.staticType, context.typeProvider.boolType);
+    expect(piFirst.type, context.typeProvider.boolType);
+    expect(pi.type.isDynamic, isTrue);
+    expect(tau.type.isDynamic, isTrue);
+  }
+
+  void test_perform_inference_cross_unit_cyclic() {
+    AnalysisTarget firstSource = newSource(
+        '/a.dart',
+        '''
+          import 'test.dart';
+          var x = 2;
+          class A { static var x = 2; }
+''');
+    AnalysisTarget secondSource = newSource(
+        '/test.dart',
+        '''
+          import 'a.dart';
+          var y = x;
+          class B { static var y = A.x; }
+
+          test1() {
+            int t = 3;
+            t = x;
+            t = y;
+            t = A.x;
+            t = B.y;
+          }
+''');
+    computeResult(
+        new LibrarySpecificUnit(firstSource, firstSource), RESOLVED_UNIT9);
+    CompilationUnit unit1 = outputs[RESOLVED_UNIT9];
+    computeResult(
+        new LibrarySpecificUnit(secondSource, secondSource), RESOLVED_UNIT9);
+    CompilationUnit unit2 = outputs[RESOLVED_UNIT9];
+
+    InterfaceType intType = context.typeProvider.intType;
+
+    assertVariableDeclarationTypes(
+        getTopLevelVariable(unit1, "x"), intType, intType);
+    assertVariableDeclarationTypes(
+        getFieldInClass(unit1, "A", "x"), intType, intType);
+
+    assertVariableDeclarationTypes(
+        getTopLevelVariable(unit2, "y"), intType, intType);
+    assertVariableDeclarationTypes(
+        getFieldInClass(unit2, "B", "y"), intType, intType);
+
+    List<Statement> statements =
+        getStatementsInTopLevelFunction(unit2, "test1");
+
+    assertAssignmentStatementTypes(statements[1], intType, intType);
+    assertAssignmentStatementTypes(statements[2], intType, intType);
+    assertAssignmentStatementTypes(statements[3], intType, intType);
+    assertAssignmentStatementTypes(statements[4], intType, intType);
+  }
+
+  // Test that local variables in method bodies are inferred appropriately
+  void test_perform_inference_cross_unit_instance() {
+    List<Source> sources = newSources({
+      '/a.dart': '''
+          import 'b.dart';
+          class A {
+            final a2 = new B().b2;
+          }
+      ''',
+      '/b.dart': '''
+          class B {
+            final b2 = 1;
+          }
+      ''',
+      '/main.dart': '''
+          import "a.dart";
+
+          test1() {
+            int x = 0;
+            x = new A().a2;
+          }
+    '''
+    });
+    List<dynamic> units =
+        computeLibraryResults(sources, RESOLVED_UNIT9).toList();
+    CompilationUnit unit0 = units[0];
+    CompilationUnit unit1 = units[1];
+    CompilationUnit unit2 = units[2];
+
+    InterfaceType intType = context.typeProvider.intType;
+
+    assertVariableDeclarationTypes(
+        getFieldInClass(unit0, "A", "a2"), intType, intType);
+
+    assertVariableDeclarationTypes(
+        getFieldInClass(unit1, "B", "b2"), intType, intType);
+
+    List<Statement> statements =
+        getStatementsInTopLevelFunction(unit2, "test1");
+
+    assertAssignmentStatementTypes(statements[1], intType, intType);
+  }
+
+  // Test inference interactions between local variables and fields
+  void test_perform_inference_cross_unit_instance_member() {
+    List<Source> sources = newSources({
+      '/a.dart': '''
+          import 'b.dart';
+            var bar = new B();
+            void foo() {
+              String x = bar.f.z;
+            }
+      ''',
+      '/b.dart': '''
+        class C {
+          var z = 3;
+        }
+
+        class B {
+          var f = new C();
+        }
+      ''',
+      '/c.dart': '''
+          import 'b.dart';
+            var bar = new B();
+            void foo() {
+              String x = bar.f.z;
+            }
+    '''
+    });
+    List<dynamic> units =
+        computeLibraryResults(sources, RESOLVED_UNIT9).toList();
+    CompilationUnit unit0 = units[0];
+    CompilationUnit unit1 = units[1];
+    CompilationUnit unit2 = units[2];
+
+    InterfaceType intType = context.typeProvider.intType;
+    InterfaceType stringType = context.typeProvider.stringType;
+
+    assertVariableDeclarationStatementTypes(
+        getStatementsInTopLevelFunction(unit0, "foo")[0], stringType, intType);
+    assertVariableDeclarationStatementTypes(
+        getStatementsInTopLevelFunction(unit2, "foo")[0], stringType, intType);
+  }
+
+  // Test inference interactions between local variables and top level
+  // variables
+  void test_perform_inference_cross_unit_non_cyclic() {
+    AnalysisTarget firstSource = newSource(
+        '/a.dart',
+        '''
+          var x = 2;
+          class A { static var x = 2; }
+''');
+    AnalysisTarget secondSource = newSource(
+        '/test.dart',
+        '''
+          import 'a.dart';
+          var y = x;
+          class B { static var y = A.x; }
+
+          test1() {
+            x = /*severe:StaticTypeError*/"hi";
+            y = /*severe:StaticTypeError*/"hi";
+            A.x = /*severe:StaticTypeError*/"hi";
+            B.y = /*severe:StaticTypeError*/"hi";
+          }
+''');
+    computeResult(
+        new LibrarySpecificUnit(firstSource, firstSource), RESOLVED_UNIT9);
+    CompilationUnit unit1 = outputs[RESOLVED_UNIT9];
+    computeResult(
+        new LibrarySpecificUnit(secondSource, secondSource), RESOLVED_UNIT9);
+    CompilationUnit unit2 = outputs[RESOLVED_UNIT9];
+
+    InterfaceType intType = context.typeProvider.intType;
+    InterfaceType stringType = context.typeProvider.stringType;
+
+    assertVariableDeclarationTypes(
+        getTopLevelVariable(unit1, "x"), intType, intType);
+    assertVariableDeclarationTypes(
+        getFieldInClass(unit1, "A", "x"), intType, intType);
+
+    assertVariableDeclarationTypes(
+        getTopLevelVariable(unit2, "y"), intType, intType);
+    assertVariableDeclarationTypes(
+        getFieldInClass(unit2, "B", "y"), intType, intType);
+
+    List<Statement> statements =
+        getStatementsInTopLevelFunction(unit2, "test1");
+
+    assertAssignmentStatementTypes(statements[0], intType, stringType);
+    assertAssignmentStatementTypes(statements[1], intType, stringType);
+  }
+
+  // Test that inference does not propagate from null
+  void test_perform_inference_cross_unit_static_instance() {
+    List<Source> sources = newSources({
+      '/a.dart': '''
+          import 'b.dart';
+          class A {
+            static final a1 = B.b1;
+            final a2 = new B().b2;
+          }
+      ''',
+      '/b.dart': '''
+          class B {
+            static final b1 = 1;
+            final b2 = 1;
+          }
+      ''',
+      '/main.dart': '''
+          import "a.dart";
+
+          test1() {
+            int x = 0;
+            // inference in A now works.
+            x = A.a1;
+            x = new A().a2;
+          }
+    '''
+    });
+    List<dynamic> units =
+        computeLibraryResults(sources, RESOLVED_UNIT9).toList();
+    CompilationUnit unit0 = units[0];
+    CompilationUnit unit1 = units[1];
+    CompilationUnit unit2 = units[2];
+
+    InterfaceType intType = context.typeProvider.intType;
+
+    assertVariableDeclarationTypes(
+        getFieldInClass(unit0, "A", "a1"), intType, intType);
+    assertVariableDeclarationTypes(
+        getFieldInClass(unit0, "A", "a2"), intType, intType);
+
+    assertVariableDeclarationTypes(
+        getFieldInClass(unit1, "B", "b1"), intType, intType);
+    assertVariableDeclarationTypes(
+        getFieldInClass(unit1, "B", "b2"), intType, intType);
+
+    List<Statement> statements =
+        getStatementsInTopLevelFunction(unit2, "test1");
+
+    assertAssignmentStatementTypes(statements[1], intType, intType);
+    assertAssignmentStatementTypes(statements[2], intType, intType);
+  }
+
+  // Test inference across units (non-cyclic)
+  void test_perform_inference_local_variables() {
+    AnalysisTarget source = newSource(
+        '/test.dart',
+        '''
+      test() {
+        int x = 3;
+        x = "hi";
+        var y = 3;
+        y = "hi";
+      }
+''');
+    computeResult(new LibrarySpecificUnit(source, source), RESOLVED_UNIT9);
+    CompilationUnit unit = outputs[RESOLVED_UNIT9];
+
+    InterfaceType intType = context.typeProvider.intType;
+    InterfaceType stringType = context.typeProvider.stringType;
+
+    List<Statement> statements = getStatementsInTopLevelFunction(unit, "test");
+
+    assertVariableDeclarationStatementTypes(statements[0], intType, intType);
+    assertAssignmentStatementTypes(statements[1], intType, stringType);
+    assertVariableDeclarationStatementTypes(statements[2], intType, intType);
+    assertAssignmentStatementTypes(statements[3], intType, stringType);
+  }
+
+  // Test inference across units (cyclic)
+  void test_perform_inference_local_variables_fields() {
+    AnalysisTarget source = newSource(
+        '/test.dart',
+        '''
+      class A {
+        int x = 0;
+
+        test1() {
+          var a = x;
+          a = "hi";
+          a = 3;
+          var b = y;
+          b = "hi";
+          b = 4;
+          var c = z;
+          c = "hi";
+          c = 4;
+        }
+
+        int y; // field def after use
+        final z = 42; // should infer `int`
+      }
+''');
+    computeResult(new LibrarySpecificUnit(source, source), RESOLVED_UNIT9);
+    CompilationUnit unit = outputs[RESOLVED_UNIT9];
+
+    InterfaceType intType = context.typeProvider.intType;
+    InterfaceType stringType = context.typeProvider.stringType;
+
+    List<Statement> statements = getStatementsInMethod(unit, "A", "test1");
+
+    assertVariableDeclarationStatementTypes(statements[0], intType, intType);
+    assertAssignmentStatementTypes(statements[1], intType, stringType);
+    assertAssignmentStatementTypes(statements[2], intType, intType);
+
+    assertVariableDeclarationStatementTypes(statements[3], intType, intType);
+    assertAssignmentStatementTypes(statements[4], intType, stringType);
+    assertAssignmentStatementTypes(statements[5], intType, intType);
+
+    assertVariableDeclarationStatementTypes(statements[6], intType, intType);
+    assertAssignmentStatementTypes(statements[7], intType, stringType);
+    assertAssignmentStatementTypes(statements[8], intType, intType);
+
+    assertVariableDeclarationTypes(
+        getFieldInClass(unit, "A", "x"), intType, intType);
+    assertVariableDeclarationTypes(
+        getFieldInClass(unit, "A", "z"), intType, intType);
+  }
+
+  // Test inference of instance fields across units
+  void test_perform_inference_local_variables_topLevel() {
+    AnalysisTarget source = newSource(
+        '/test.dart',
+        '''
+      int x = 0;
+
+      test1() {
+        var a = x;
+        a = /*severe:StaticTypeError*/"hi";
+        a = 3;
+        var b = y;
+        b = /*severe:StaticTypeError*/"hi";
+        b = 4;
+        var c = z;
+        c = /*severe:StaticTypeError*/"hi";
+        c = 4;
+      }
+
+      int y = 0; // field def after use
+      final z = 42; // should infer `int`
+''');
+    computeResult(new LibrarySpecificUnit(source, source), RESOLVED_UNIT9);
+    CompilationUnit unit = outputs[RESOLVED_UNIT9];
+
+    InterfaceType intType = context.typeProvider.intType;
+    InterfaceType stringType = context.typeProvider.stringType;
+
+    List<Statement> statements = getStatementsInTopLevelFunction(unit, "test1");
+
+    assertVariableDeclarationStatementTypes(statements[0], intType, intType);
+    assertAssignmentStatementTypes(statements[1], intType, stringType);
+    assertAssignmentStatementTypes(statements[2], intType, intType);
+
+    assertVariableDeclarationStatementTypes(statements[3], intType, intType);
+    assertAssignmentStatementTypes(statements[4], intType, stringType);
+    assertAssignmentStatementTypes(statements[5], intType, intType);
+
+    assertVariableDeclarationStatementTypes(statements[6], intType, intType);
+    assertAssignmentStatementTypes(statements[7], intType, stringType);
+    assertAssignmentStatementTypes(statements[8], intType, intType);
+
+    assertVariableDeclarationTypes(
+        getTopLevelVariable(unit, "x"), intType, intType);
+    assertVariableDeclarationTypes(
+        getTopLevelVariable(unit, "y"), intType, intType);
+    assertVariableDeclarationTypes(
+        getTopLevelVariable(unit, "z"), intType, intType);
+  }
+
+  // Test inference between static and instance fields
+  void test_perform_inference_null() {
+    AnalysisTarget source = newSource(
+        '/test.dart',
+        '''
+      var x = null;
+      var y = 3;
+      class A {
+        static var x = null;
+        static var y = 3;
+
+        var x2 = null;
+        var y2 = 3;
+      }
+
+      test() {
+        x = "hi";
+        y = /*severe:StaticTypeError*/"hi";
+        A.x = "hi";
+        A.y = /*severe:StaticTypeError*/"hi";
+        new A().x2 = "hi";
+        new A().y2 = /*severe:StaticTypeError*/"hi";
+      }
+''');
+    computeResult(new LibrarySpecificUnit(source, source), RESOLVED_UNIT9);
+    CompilationUnit unit = outputs[RESOLVED_UNIT9];
+
+    InterfaceType intType = context.typeProvider.intType;
+    InterfaceType stringType = context.typeProvider.stringType;
+    DartType bottomType = context.typeProvider.bottomType;
+    DartType dynamicType = context.typeProvider.dynamicType;
+
+    assertVariableDeclarationTypes(
+        getTopLevelVariable(unit, "x"), dynamicType, bottomType);
+    assertVariableDeclarationTypes(
+        getTopLevelVariable(unit, "y"), intType, intType);
+    assertVariableDeclarationTypes(
+        getFieldInClass(unit, "A", "x"), dynamicType, bottomType);
+    assertVariableDeclarationTypes(
+        getFieldInClass(unit, "A", "y"), intType, intType);
+    assertVariableDeclarationTypes(
+        getFieldInClass(unit, "A", "x2"), dynamicType, bottomType);
+    assertVariableDeclarationTypes(
+        getFieldInClass(unit, "A", "y2"), intType, intType);
+
+    List<Statement> statements = getStatementsInTopLevelFunction(unit, "test");
+
+    assertAssignmentStatementTypes(statements[0], dynamicType, stringType);
+    assertAssignmentStatementTypes(statements[1], intType, stringType);
+    assertAssignmentStatementTypes(statements[2], dynamicType, stringType);
+    assertAssignmentStatementTypes(statements[3], intType, stringType);
+    assertAssignmentStatementTypes(statements[4], dynamicType, stringType);
+    assertAssignmentStatementTypes(statements[5], intType, stringType);
+  }
+
+  // Test inference between fields and method bodies
+  void test_perform_local_explicit_disabled() {
+    AnalysisTarget source = newSource(
+        '/test.dart',
+        '''
+      test() {
+        int x = 3;
+        x = "hi";
+      }
+''');
+    computeResult(new LibrarySpecificUnit(source, source), RESOLVED_UNIT9);
+    CompilationUnit unit = outputs[RESOLVED_UNIT9];
+
+    InterfaceType intType = context.typeProvider.intType;
+    InterfaceType stringType = context.typeProvider.stringType;
+
+    List<Statement> statements = getStatementsInTopLevelFunction(unit, "test");
+    VariableDeclaration decl =
+        (statements[0] as VariableDeclarationStatement).variables.variables[0];
+    expect(decl.element.type, intType);
+    expect(decl.initializer.staticType, intType);
+
+    ExpressionStatement statement = statements[1];
+    AssignmentExpression assgn = statement.expression;
+    expect(assgn.leftHandSide.staticType, intType);
+    expect(assgn.rightHandSide.staticType, stringType);
+  }
+}
+
+@reflectiveTest
+class StrongModeVerifyUnitTaskTest extends _AbstractDartTaskTest {
+  @override
+  void setUp() {
+    super.setUp();
+    enableStrongMode();
+  }
+
+  void test_perform_recordDynamicInvoke() {
+    enableStrongMode();
+    AnalysisTarget source = newSource(
+        '/test.dart',
+        '''
+void main() {
+  dynamic a = [];
+  a[0];
+}
+''');
+    computeResult(new LibrarySpecificUnit(source, source), STRONG_MODE_ERRORS);
+    CompilationUnit unit = outputs[RESOLVED_UNIT];
+
+    // validate
+    _fillErrorListener(STRONG_MODE_ERRORS);
+    expect(errorListener.errors, isEmpty);
+
+    List<Statement> statements = getStatementsInTopLevelFunction(unit, "main");
+    ExpressionStatement statement = statements[1];
+    IndexExpression idx = statement.expression;
+    expect(DynamicInvoke.get(idx.target), isNotNull);
+    expect(DynamicInvoke.get(idx.target), isNotNull);
+    expect(DynamicInvoke.get(idx.target), isTrue);
+  }
+
+  void test_perform_verifyError() {
+    enableStrongMode();
+    AnalysisTarget source = newSource(
+        '/test.dart',
+        '''
+int topLevel = 3;
+class C {
+  String field = topLevel;
+}
+''');
+    computeResult(new LibrarySpecificUnit(source, source), STRONG_MODE_ERRORS);
+    // validate
+    _fillErrorListener(STRONG_MODE_ERRORS);
+
+    var errors = errorListener.errors;
+    expect(errors.length, 1);
+    expect(errors[0].errorCode.name, "dev_compiler.StaticTypeError");
   }
 }
 
 @reflectiveTest
 class VerifyUnitTaskTest extends _AbstractDartTaskTest {
   test_perform_constantError() {
-    Source source = newSource('/test.dart', '''
+    Source source = newSource(
+        '/test.dart',
+        '''
 main(int p) {
   const v = p;
 }
 ''');
     LibrarySpecificUnit target = new LibrarySpecificUnit(source, source);
-    computeResult(target, VERIFY_ERRORS);
-    expect(task, new isInstanceOf<VerifyUnitTask>());
+    computeResult(target, VERIFY_ERRORS, matcher: isVerifyUnitTask);
     // validate
     _fillErrorListener(VERIFY_ERRORS);
     errorListener.assertErrorsWithCodes(<ErrorCode>[
@@ -2492,20 +4050,42 @@
   }
 
   test_perform_directiveError() {
-    Source source = newSource('/test.dart', '''
+    Source source = newSource(
+        '/test.dart',
+        '''
 import 'no-such-file.dart';
 ''');
     LibrarySpecificUnit target = new LibrarySpecificUnit(source, source);
-    computeResult(target, VERIFY_ERRORS);
-    expect(task, new isInstanceOf<VerifyUnitTask>());
+    computeResult(target, VERIFY_ERRORS, matcher: isVerifyUnitTask);
     // validate
     _fillErrorListener(VERIFY_ERRORS);
     errorListener.assertErrorsWithCodes(
         <ErrorCode>[CompileTimeErrorCode.URI_DOES_NOT_EXIST]);
   }
 
+  void test_perform_reresolution() {
+    enableStrongMode();
+    AnalysisTarget source = newSource(
+        '/test.dart',
+        '''
+const topLevel = 3;
+class C {
+  String field = topLevel;
+}
+''');
+    computeResult(new LibrarySpecificUnit(source, source), VERIFY_ERRORS);
+    // validate
+    _fillErrorListener(VERIFY_ERRORS);
+
+    var errors = errorListener.errors;
+    expect(errors.length, 1);
+    expect(errors[0].errorCode, StaticTypeWarningCode.INVALID_ASSIGNMENT);
+  }
+
   test_perform_verifyError() {
-    Source source = newSource('/test.dart', '''
+    Source source = newSource(
+        '/test.dart',
+        '''
 main() {
   if (42) {
     print('Not bool!');
@@ -2513,8 +4093,7 @@
 }
 ''');
     LibrarySpecificUnit target = new LibrarySpecificUnit(source, source);
-    computeResult(target, VERIFY_ERRORS);
-    expect(task, new isInstanceOf<VerifyUnitTask>());
+    computeResult(target, VERIFY_ERRORS, matcher: isVerifyUnitTask);
     // validate
     _fillErrorListener(VERIFY_ERRORS);
     errorListener.assertErrorsWithCodes(
@@ -2527,6 +4106,13 @@
 
   GatheringErrorListener errorListener = new GatheringErrorListener();
 
+  void assertAssignmentStatementTypes(
+      Statement stmt, DartType leftType, DartType rightType) {
+    AssignmentExpression assgn = (stmt as ExpressionStatement).expression;
+    expect(assgn.leftHandSide.staticType, leftType);
+    expect(assgn.rightHandSide.staticType, rightType);
+  }
+
   void assertIsInvalid(AnalysisTarget target, ResultDescriptor descriptor) {
     CacheEntry entry = context.getCacheEntry(target);
     expect(entry.isInvalid(descriptor), isTrue);
@@ -2545,6 +4131,41 @@
     });
   }
 
+  void assertVariableDeclarationStatementTypes(
+      Statement stmt, DartType varType, DartType initializerType) {
+    VariableDeclaration decl =
+        (stmt as VariableDeclarationStatement).variables.variables[0];
+    assertVariableDeclarationTypes(decl, varType, initializerType);
+  }
+
+  void assertVariableDeclarationTypes(
+      VariableDeclaration decl, DartType varType, DartType initializerType) {
+    expect(decl.element.type, varType);
+    expect(decl.initializer.staticType, initializerType);
+  }
+
+  List<dynamic> computeLibraryResults(
+      List<Source> sources, ResultDescriptor result,
+      {isInstanceOf matcher: null}) {
+    dynamic compute(Source source) {
+      computeResult(new LibrarySpecificUnit(source, source), result,
+          matcher: matcher);
+      return outputs[result];
+    }
+    return sources.map(compute).toList();
+  }
+
+  List<Map<ResultDescriptor, dynamic>> computeLibraryResultsMap(
+      List<Source> sources, ResultDescriptor result,
+      {isInstanceOf matcher: null}) {
+    Map<ResultDescriptor, dynamic> compute(Source source) {
+      computeResult(new LibrarySpecificUnit(source, source), result,
+          matcher: matcher);
+      return outputs;
+    }
+    return sources.map(compute).toList();
+  }
+
   /**
    * Create a script object with a single fragment containing the given
    * [scriptContent].
@@ -2565,6 +4186,123 @@
         source, [new ScriptFragment(97, 5, 36, scriptContent)]);
   }
 
+  /**
+   * Enable strong mode in the current analysis context.
+   */
+  void enableStrongMode() {
+    AnalysisOptionsImpl options = context.analysisOptions;
+    options.strongMode = true;
+    context.analysisOptions = options;
+  }
+
+  /**
+   * Return the declaration of the class with the given [className] in the given
+   * compilation [unit].
+   */
+  ClassDeclaration getClass(CompilationUnit unit, String className) {
+    NodeList<CompilationUnitMember> unitMembers = unit.declarations;
+    for (CompilationUnitMember unitMember in unitMembers) {
+      if (unitMember is ClassDeclaration && unitMember.name.name == className) {
+        return unitMember;
+      }
+    }
+    fail('No class named $className in ${unit.element.source}');
+    return null;
+  }
+
+  /**
+   * Return the declaration of the field with the given [fieldName] in the class
+   * with the given [className] in the given compilation [unit].
+   */
+  VariableDeclaration getFieldInClass(
+      CompilationUnit unit, String className, String fieldName) {
+    ClassDeclaration unitMember = getClass(unit, className);
+    NodeList<ClassMember> classMembers = unitMember.members;
+    for (ClassMember classMember in classMembers) {
+      if (classMember is FieldDeclaration) {
+        NodeList<VariableDeclaration> fields = classMember.fields.variables;
+        for (VariableDeclaration field in fields) {
+          if (field.name.name == fieldName) {
+            return field;
+          }
+        }
+      }
+    }
+    fail('No field named $fieldName in $className');
+    return null;
+  }
+
+  /**
+   * Return the declaration of the method with the given [methodName] in the
+   * class with the given [className] in the given compilation [unit].
+   */
+  MethodDeclaration getMethodInClass(
+      CompilationUnit unit, String className, String methodName) {
+    ClassDeclaration unitMember = getClass(unit, className);
+    NodeList<ClassMember> classMembers = unitMember.members;
+    for (ClassMember classMember in classMembers) {
+      if (classMember is MethodDeclaration) {
+        if (classMember.name.name == methodName) {
+          return classMember;
+        }
+      }
+    }
+    fail('No method named $methodName in $className');
+    return null;
+  }
+
+  List<Statement> getStatementsInMethod(
+      CompilationUnit unit, String className, String methodName) {
+    MethodDeclaration method = getMethodInClass(unit, className, methodName);
+    BlockFunctionBody body = method.body;
+    return body.block.statements;
+  }
+
+  List<Statement> getStatementsInTopLevelFunction(
+      CompilationUnit unit, String functionName) {
+    FunctionDeclaration function = getTopLevelFunction(unit, functionName);
+    BlockFunctionBody body = function.functionExpression.body;
+    return body.block.statements;
+  }
+
+  /**
+   * Return the declaration of the top-level function with the given
+   * [functionName] in the given compilation [unit].
+   */
+  FunctionDeclaration getTopLevelFunction(
+      CompilationUnit unit, String functionName) {
+    NodeList<CompilationUnitMember> unitMembers = unit.declarations;
+    for (CompilationUnitMember unitMember in unitMembers) {
+      if (unitMember is FunctionDeclaration) {
+        if (unitMember.name.name == functionName) {
+          return unitMember;
+        }
+      }
+    }
+    return null;
+  }
+
+  /**
+   * Return the declaration of the top-level variable with the given
+   * [variableName] in the given compilation [unit].
+   */
+  VariableDeclaration getTopLevelVariable(
+      CompilationUnit unit, String variableName) {
+    NodeList<CompilationUnitMember> unitMembers = unit.declarations;
+    for (CompilationUnitMember unitMember in unitMembers) {
+      if (unitMember is TopLevelVariableDeclaration) {
+        NodeList<VariableDeclaration> variables =
+            unitMember.variables.variables;
+        for (VariableDeclaration variable in variables) {
+          if (variable.name.name == variableName) {
+            return variable;
+          }
+        }
+      }
+    }
+    return null;
+  }
+
   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 9119cee..a10cfef 100644
--- a/pkg/analyzer/test/src/task/dart_work_manager_test.dart
+++ b/pkg/analyzer/test/src/task/dart_work_manager_test.dart
@@ -9,17 +9,18 @@
 import 'package:analyzer/src/generated/engine.dart'
     show
         AnalysisErrorInfo,
+        AnalysisErrorInfoImpl,
         CacheState,
         ChangeNoticeImpl,
         InternalAnalysisContext;
 import 'package:analyzer/src/generated/error.dart' show AnalysisError;
 import 'package:analyzer/src/generated/java_engine.dart' show CaughtException;
 import 'package:analyzer/src/generated/scanner.dart' show ScannerErrorCode;
+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/task/dart.dart';
 import 'package:analyzer/src/task/dart_work_manager.dart';
-import 'package:analyzer/src/task/driver.dart';
 import 'package:analyzer/task/dart.dart';
 import 'package:analyzer/task/general.dart';
 import 'package:analyzer/task/model.dart';
@@ -28,9 +29,10 @@
 
 import '../../generated/test_support.dart';
 import '../../reflective_tests.dart';
+import '../../utils.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   runReflectiveTests(DartWorkManagerTest);
 }
 
@@ -62,10 +64,10 @@
   void setUp() {
     cache = context.analysisCache;
     manager = new DartWorkManager(context);
-    entry1 = context.getCacheEntry(source1);
-    entry2 = context.getCacheEntry(source2);
-    entry3 = context.getCacheEntry(source3);
-    entry4 = context.getCacheEntry(source4);
+    entry1 = _getOrCreateEntry(source1);
+    entry2 = _getOrCreateEntry(source2);
+    entry3 = _getOrCreateEntry(source3);
+    entry4 = _getOrCreateEntry(source4);
   }
 
   void test_applyChange_add() {
@@ -219,10 +221,12 @@
         .add(new TargetedResult(source2, LIBRARY_ERRORS_READY));
     // -source1 +source3
     manager.applyPriorityTargets([source2, source3]);
-    expect(manager.priorityResultQueue, unorderedEquals([
-      new TargetedResult(source2, LIBRARY_ERRORS_READY),
-      new TargetedResult(source3, LIBRARY_ERRORS_READY)
-    ]));
+    expect(
+        manager.priorityResultQueue,
+        unorderedEquals([
+          new TargetedResult(source2, LIBRARY_ERRORS_READY),
+          new TargetedResult(source3, LIBRARY_ERRORS_READY)
+        ]));
     // get next request
     TargetedResult request = manager.getNextResult();
     expect(request.target, source2);
@@ -241,12 +245,14 @@
         .add(new TargetedResult(source2, LIBRARY_ERRORS_READY));
     // -source1 +source3
     manager.applyPriorityTargets([source2, source3]);
-    expect(manager.priorityResultQueue, unorderedEquals([
-      new TargetedResult(
-          new LibrarySpecificUnit(source2, source2), RESOLVED_UNIT),
-      new TargetedResult(
-          new LibrarySpecificUnit(source3, source3), RESOLVED_UNIT),
-    ]));
+    expect(
+        manager.priorityResultQueue,
+        unorderedEquals([
+          new TargetedResult(
+              new LibrarySpecificUnit(source2, source2), RESOLVED_UNIT),
+          new TargetedResult(
+              new LibrarySpecificUnit(source3, source3), RESOLVED_UNIT),
+        ]));
   }
 
   void test_applyPriorityTargets_isPart() {
@@ -257,10 +263,12 @@
     when(context.getLibrariesContaining(source1))
         .thenReturn([source2, source3]);
     manager.applyPriorityTargets([source1]);
-    expect(manager.priorityResultQueue, unorderedEquals([
-      new TargetedResult(source2, LIBRARY_ERRORS_READY),
-      new TargetedResult(source3, LIBRARY_ERRORS_READY)
-    ]));
+    expect(
+        manager.priorityResultQueue,
+        unorderedEquals([
+          new TargetedResult(source2, LIBRARY_ERRORS_READY),
+          new TargetedResult(source3, LIBRARY_ERRORS_READY)
+        ]));
     // get next request
     TargetedResult request = manager.getNextResult();
     expect(request.target, source2);
@@ -269,10 +277,12 @@
 
   void test_applyPriorityTargets_isUnknown() {
     manager.applyPriorityTargets([source2, source3]);
-    expect(manager.priorityResultQueue, unorderedEquals([
-      new TargetedResult(source2, SOURCE_KIND),
-      new TargetedResult(source3, SOURCE_KIND)
-    ]));
+    expect(
+        manager.priorityResultQueue,
+        unorderedEquals([
+          new TargetedResult(source2, SOURCE_KIND),
+          new TargetedResult(source3, SOURCE_KIND)
+        ]));
     // get next request
     TargetedResult request = manager.getNextResult();
     expect(request.target, source2);
@@ -285,14 +295,12 @@
     AnalysisError error2 =
         new AnalysisError(source1, 2, 0, ScannerErrorCode.MISSING_DIGIT);
     when(context.getLibrariesContaining(source1)).thenReturn([source2]);
-    LineInfo lineInfo = new LineInfo([0]);
-    entry1.setValue(LINE_INFO, lineInfo, []);
     entry1.setValue(SCAN_ERRORS, <AnalysisError>[error1], []);
-    context.getCacheEntry(new LibrarySpecificUnit(source2, source1)).setValue(
-        VERIFY_ERRORS, <AnalysisError>[error2], []);
-    AnalysisErrorInfo errorInfo = manager.getErrors(source1);
-    expect(errorInfo.errors, unorderedEquals([error1, error2]));
-    expect(errorInfo.lineInfo, lineInfo);
+    context
+        .getCacheEntry(new LibrarySpecificUnit(source2, source1))
+        .setValue(VERIFY_ERRORS, <AnalysisError>[error2], []);
+    List<AnalysisError> errors = manager.getErrors(source1);
+    expect(errors, unorderedEquals([error1, error2]));
   }
 
   void test_getErrors_hasFullList() {
@@ -301,12 +309,9 @@
     AnalysisError error2 =
         new AnalysisError(source1, 2, 0, ScannerErrorCode.MISSING_DIGIT);
     when(context.getLibrariesContaining(source1)).thenReturn([source2]);
-    LineInfo lineInfo = new LineInfo([0]);
-    entry1.setValue(LINE_INFO, lineInfo, []);
     entry1.setValue(DART_ERRORS, <AnalysisError>[error1, error2], []);
-    AnalysisErrorInfo errorInfo = manager.getErrors(source1);
-    expect(errorInfo.errors, unorderedEquals([error1, error2]));
-    expect(errorInfo.lineInfo, lineInfo);
+    List<AnalysisError> errors = manager.getErrors(source1);
+    expect(errors, unorderedEquals([error1, error2]));
   }
 
   void test_getLibrariesContainingPart() {
@@ -327,6 +332,32 @@
     expect(manager.getLibrariesContainingPart(part3), isEmpty);
   }
 
+  void test_getLibrariesContainingPart_inSDK() {
+    Source part = new _SourceMock('part.dart');
+    when(part.isInSystemLibrary).thenReturn(true);
+    // SDK work manager
+    DartWorkManager sdkDartWorkManagerMock = new _DartWorkManagerMock();
+    when(sdkDartWorkManagerMock.getLibrariesContainingPart(part))
+        .thenReturn([source2, source3]);
+    // SDK context mock
+    InternalAnalysisContext sdkContextMock = new _InternalAnalysisContextMock();
+    when(sdkContextMock.workManagers).thenReturn([sdkDartWorkManagerMock]);
+    // SDK mock
+    DartSdk sdkMock = new _DartSdkMock();
+    when(sdkMock.context).thenReturn(sdkContextMock);
+    // SourceFactory mock
+    SourceFactory sourceFactory = new _SourceFactoryMock();
+    when(sourceFactory.dartSdk).thenReturn(sdkMock);
+    when(context.sourceFactory).thenReturn(sourceFactory);
+    // SDK source mock
+    Source source = new _SourceMock('test.dart');
+    when(source.source).thenReturn(source);
+    when(source.isInSystemLibrary).thenReturn(true);
+    // validate
+    expect(manager.getLibrariesContainingPart(part),
+        unorderedEquals([source2, source3]));
+  }
+
   void test_getNextResult_hasLibraries_firstIsError() {
     entry1.setErrorState(caughtException, [LIBRARY_ERRORS_READY]);
     manager.librarySourceQueue.addAll([source1, source2]);
@@ -360,10 +391,12 @@
   void test_getNextResult_hasPriority_firstIsError() {
     manager.addPriorityResult(source1, SOURCE_KIND);
     manager.addPriorityResult(source2, SOURCE_KIND);
-    expect(manager.priorityResultQueue, unorderedEquals([
-      new TargetedResult(source1, SOURCE_KIND),
-      new TargetedResult(source2, SOURCE_KIND)
-    ]));
+    expect(
+        manager.priorityResultQueue,
+        unorderedEquals([
+          new TargetedResult(source1, SOURCE_KIND),
+          new TargetedResult(source2, SOURCE_KIND)
+        ]));
     // configure state and get next result
     entry1.setErrorState(caughtException, [SOURCE_KIND]);
     TargetedResult request = manager.getNextResult();
@@ -377,10 +410,12 @@
   void test_getNextResult_hasPriority_firstIsValid() {
     manager.addPriorityResult(source1, SOURCE_KIND);
     manager.addPriorityResult(source2, SOURCE_KIND);
-    expect(manager.priorityResultQueue, unorderedEquals([
-      new TargetedResult(source1, SOURCE_KIND),
-      new TargetedResult(source2, SOURCE_KIND)
-    ]));
+    expect(
+        manager.priorityResultQueue,
+        unorderedEquals([
+          new TargetedResult(source1, SOURCE_KIND),
+          new TargetedResult(source2, SOURCE_KIND)
+        ]));
     // configure state and get next result
     entry1.setValue(SOURCE_KIND, SourceKind.LIBRARY, []);
     TargetedResult request = manager.getNextResult();
@@ -474,6 +509,8 @@
   }
 
   void test_onResultInvalidated_scheduleInvalidatedLibraries() {
+    // make source3 implicit
+    entry3.explicitlyAdded = false;
     // set SOURCE_KIND
     entry1.setValue(SOURCE_KIND, SourceKind.LIBRARY, []);
     entry2.setValue(SOURCE_KIND, SourceKind.PART, []);
@@ -484,9 +521,9 @@
     // invalidate LIBRARY_ERRORS_READY for source1, schedule it
     entry1.setState(LIBRARY_ERRORS_READY, CacheState.INVALID);
     expect_librarySourceQueue([source1]);
-    // invalidate LIBRARY_ERRORS_READY for source3, schedule it
+    // invalidate LIBRARY_ERRORS_READY for source3, implicit, not scheduled
     entry3.setState(LIBRARY_ERRORS_READY, CacheState.INVALID);
-    expect_librarySourceQueue([source1, source3]);
+    expect_librarySourceQueue([source1]);
   }
 
   void test_onSourceFactoryChanged() {
@@ -497,6 +534,8 @@
     entry1.setValue(EXPLICITLY_IMPORTED_LIBRARIES, <Source>[], []);
     entry1.setValue(EXPORTED_LIBRARIES, <Source>[], []);
     entry1.setValue(INCLUDED_PARTS, <Source>[], []);
+    entry1.setValue(LIBRARY_SPECIFIC_UNITS, <LibrarySpecificUnit>[], []);
+    entry1.setValue(UNITS, <Source>[], []);
     // configure LibrarySpecificUnit
     LibrarySpecificUnit unitTarget = new LibrarySpecificUnit(source2, source3);
     CacheEntry unitEntry = new CacheEntry(unitTarget);
@@ -513,20 +552,25 @@
     expect(entry1.getState(EXPLICITLY_IMPORTED_LIBRARIES), CacheState.INVALID);
     expect(entry1.getState(EXPORTED_LIBRARIES), CacheState.INVALID);
     expect(entry1.getState(INCLUDED_PARTS), CacheState.INVALID);
+    expect(entry1.getState(LIBRARY_SPECIFIC_UNITS), CacheState.INVALID);
+    expect(entry1.getState(UNITS), CacheState.INVALID);
   }
 
   void test_resultsComputed_errors_forLibrarySpecificUnit() {
+    LineInfo lineInfo = new LineInfo([0]);
     AnalysisError error1 =
         new AnalysisError(source1, 1, 0, ScannerErrorCode.MISSING_DIGIT);
     AnalysisError error2 =
         new AnalysisError(source1, 2, 0, ScannerErrorCode.MISSING_DIGIT);
     when(context.getLibrariesContaining(source1)).thenReturn([source2]);
-    LineInfo lineInfo = new LineInfo([0]);
+    when(context.getErrors(source1))
+        .thenReturn(new AnalysisErrorInfoImpl([error1, error2], lineInfo));
     entry1.setValue(LINE_INFO, lineInfo, []);
     entry1.setValue(SCAN_ERRORS, <AnalysisError>[error1], []);
     AnalysisTarget unitTarget = new LibrarySpecificUnit(source2, source1);
-    context.getCacheEntry(unitTarget).setValue(
-        VERIFY_ERRORS, <AnalysisError>[error2], []);
+    context
+        .getCacheEntry(unitTarget)
+        .setValue(VERIFY_ERRORS, <AnalysisError>[error2], []);
     // RESOLVED_UNIT is ready, set errors
     manager.resultsComputed(
         unitTarget, {RESOLVED_UNIT: AstFactory.compilationUnit()});
@@ -537,12 +581,14 @@
   }
 
   void test_resultsComputed_errors_forSource() {
+    LineInfo lineInfo = new LineInfo([0]);
     AnalysisError error1 =
         new AnalysisError(source1, 1, 0, ScannerErrorCode.MISSING_DIGIT);
     AnalysisError error2 =
         new AnalysisError(source1, 2, 0, ScannerErrorCode.MISSING_DIGIT);
     when(context.getLibrariesContaining(source1)).thenReturn([source2]);
-    LineInfo lineInfo = new LineInfo([0]);
+    when(context.getErrors(source1))
+        .thenReturn(new AnalysisErrorInfoImpl([error1, error2], lineInfo));
     entry1.setValue(LINE_INFO, lineInfo, []);
     entry1.setValue(SCAN_ERRORS, <AnalysisError>[error1], []);
     entry1.setValue(PARSE_ERRORS, <AnalysisError>[error2], []);
@@ -563,15 +609,25 @@
     Source library2 = new TestSource('library2.dart');
     _getOrCreateEntry(part1).setValue(CONTAINING_LIBRARIES, [], []);
     expect(cache.getState(part1, CONTAINING_LIBRARIES), CacheState.VALID);
+    // configure AnalysisContext mock
+    when(context.prioritySources).thenReturn(<Source>[]);
+    when(context.shouldErrorsBeAnalyzed(anyObject, anyObject))
+        .thenReturn(false);
     // library1 parts
-    manager.resultsComputed(library1, {INCLUDED_PARTS: [part1, part2]});
+    manager.resultsComputed(library1, {
+      INCLUDED_PARTS: [part1, part2],
+      SOURCE_KIND: SourceKind.LIBRARY
+    });
     expect(manager.partLibrariesMap[part1], [library1]);
     expect(manager.partLibrariesMap[part2], [library1]);
     expect(manager.partLibrariesMap[part3], isNull);
     expect(manager.libraryPartsMap[library1], [part1, part2]);
     expect(manager.libraryPartsMap[library2], isNull);
     // library2 parts
-    manager.resultsComputed(library2, {INCLUDED_PARTS: [part2, part3]});
+    manager.resultsComputed(library2, {
+      INCLUDED_PARTS: [part2, part3],
+      SOURCE_KIND: SourceKind.LIBRARY
+    });
     expect(manager.partLibrariesMap[part1], [library1]);
     expect(manager.partLibrariesMap[part2], [library1, library2]);
     expect(manager.partLibrariesMap[part3], [library2]);
@@ -581,6 +637,28 @@
     expect(cache.getState(part1, CONTAINING_LIBRARIES), CacheState.INVALID);
   }
 
+  void test_resultsComputed_inSDK() {
+    DartWorkManager sdkDartWorkManagerMock = new _DartWorkManagerMock();
+    // SDK context mock
+    InternalAnalysisContext sdkContextMock = new _InternalAnalysisContextMock();
+    when(sdkContextMock.workManagers).thenReturn([sdkDartWorkManagerMock]);
+    // SDK mock
+    DartSdk sdkMock = new _DartSdkMock();
+    when(sdkMock.context).thenReturn(sdkContextMock);
+    // SourceFactory mock
+    SourceFactory sourceFactory = new _SourceFactoryMock();
+    when(sourceFactory.dartSdk).thenReturn(sdkMock);
+    when(context.sourceFactory).thenReturn(sourceFactory);
+    // SDK source mock
+    Source source = new _SourceMock('test.dart');
+    when(source.source).thenReturn(source);
+    when(source.isInSystemLibrary).thenReturn(true);
+    // notify and validate
+    Map<ResultDescriptor, dynamic> outputs = <ResultDescriptor, dynamic>{};
+    manager.resultsComputed(source, outputs);
+    verify(sdkDartWorkManagerMock.resultsComputed(source, outputs)).once();
+  }
+
   void test_resultsComputed_noSourceKind() {
     manager.unknownSourceQueue.addAll([source1, source2]);
     manager.resultsComputed(source1, {});
@@ -596,8 +674,10 @@
   }
 
   void test_resultsComputed_parsedUnit() {
-    when(context.getLibrariesContaining(source1)).thenReturn([]);
     LineInfo lineInfo = new LineInfo([0]);
+    when(context.getLibrariesContaining(source1)).thenReturn([]);
+    when(context.getErrors(source1))
+        .thenReturn(new AnalysisErrorInfoImpl([], lineInfo));
     entry1.setValue(LINE_INFO, lineInfo, []);
     CompilationUnit unit = AstFactory.compilationUnit();
     manager.resultsComputed(source1, {PARSED_UNIT: unit});
@@ -608,8 +688,10 @@
   }
 
   void test_resultsComputed_resolvedUnit() {
-    when(context.getLibrariesContaining(source2)).thenReturn([]);
     LineInfo lineInfo = new LineInfo([0]);
+    when(context.getLibrariesContaining(source2)).thenReturn([]);
+    when(context.getErrors(source2))
+        .thenReturn(new AnalysisErrorInfoImpl([], lineInfo));
     entry2.setValue(LINE_INFO, lineInfo, []);
     CompilationUnit unit = AstFactory.compilationUnit();
     manager.resultsComputed(
@@ -645,10 +727,12 @@
     when(context.shouldErrorsBeAnalyzed(source2, null)).thenReturn(false);
     manager.resultsComputed(source2, {SOURCE_KIND: SourceKind.LIBRARY});
     expect_unknownSourceQueue([source1, source3]);
-    expect(manager.priorityResultQueue, unorderedEquals([
-      new TargetedResult(
-          new LibrarySpecificUnit(source2, source2), RESOLVED_UNIT)
-    ]));
+    expect(
+        manager.priorityResultQueue,
+        unorderedEquals([
+          new TargetedResult(
+              new LibrarySpecificUnit(source2, source2), RESOLVED_UNIT)
+        ]));
   }
 
   void test_resultsComputed_sourceKind_isPart() {
@@ -658,16 +742,34 @@
     expect_unknownSourceQueue([source1, source3]);
   }
 
-  CacheEntry _getOrCreateEntry(Source source) {
+  void test_resultsComputed_updatePartsLibraries_partParsed() {
+    Source part = new TestSource('part.dart');
+    expect(manager.libraryPartsMap, isEmpty);
+    // part.dart parsed, no changes is the map of libraries
+    manager.resultsComputed(
+        part, {SOURCE_KIND: SourceKind.PART, INCLUDED_PARTS: <Source>[]});
+    expect(manager.libraryPartsMap, isEmpty);
+  }
+
+  CacheEntry _getOrCreateEntry(Source source, [bool explicit = true]) {
     CacheEntry entry = cache.get(source);
     if (entry == null) {
       entry = new CacheEntry(source);
+      entry.explicitlyAdded = explicit;
       cache.put(entry);
     }
     return entry;
   }
 }
 
+class _DartSdkMock extends TypedMock implements DartSdk {
+  noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
+}
+
+class _DartWorkManagerMock extends TypedMock implements DartWorkManager {
+  noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
+}
+
 class _InternalAnalysisContextMock extends TypedMock
     implements InternalAnalysisContext {
   @override
@@ -701,3 +803,17 @@
 
   noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
 }
+
+class _SourceFactoryMock extends TypedMock implements SourceFactory {
+  noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
+}
+
+class _SourceMock extends TypedMock implements Source {
+  final String shortName;
+  _SourceMock(this.shortName);
+  @override
+  String get fullName => '/' + shortName;
+  noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
+  @override
+  String toString() => fullName;
+}
diff --git a/pkg/analyzer/test/src/task/driver_test.dart b/pkg/analyzer/test/src/task/driver_test.dart
index 1053691..aed091c 100644
--- a/pkg/analyzer/test/src/task/driver_test.dart
+++ b/pkg/analyzer/test/src/task/driver_test.dart
@@ -22,10 +22,11 @@
 
 import '../../generated/test_support.dart';
 import '../../reflective_tests.dart';
+import '../../utils.dart';
 import 'test_support.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   runReflectiveTests(AnalysisDriverTest);
   runReflectiveTests(CycleAwareDependencyWalkerTest);
   runReflectiveTests(WorkItemTest);
@@ -132,8 +133,9 @@
     AnalysisTarget target = new TestSource();
     ResultDescriptor result = new ResultDescriptor('result', null);
     CaughtException exception = new CaughtException(null, null);
-    context.getCacheEntry(target).setErrorState(
-        exception, <ResultDescriptor>[result]);
+    context
+        .getCacheEntry(target)
+        .setErrorState(exception, <ResultDescriptor>[result]);
 
     expect(analysisDriver.createWorkOrderForResult(target, result), isNull);
   }
@@ -149,9 +151,11 @@
   test_createWorkOrderForResult_invalid() {
     AnalysisTarget target = new TestSource();
     ResultDescriptor result = new ResultDescriptor('result', null);
-    TaskDescriptor descriptor = new TaskDescriptor('task',
+    TaskDescriptor descriptor = new TaskDescriptor(
+        'task',
         (context, target) => new TestAnalysisTask(context, target),
-        (target) => {}, [result]);
+        (target) => {},
+        [result]);
     taskManager.addTaskDescriptor(descriptor);
     context.getCacheEntry(target).setState(result, CacheState.INVALID);
 
@@ -163,8 +167,9 @@
   test_createWorkOrderForResult_valid() {
     AnalysisTarget target = new TestSource();
     ResultDescriptor result = new ResultDescriptor('result', null);
-    context.getCacheEntry(target).setValue(
-        result, '', TargetedResult.EMPTY_LIST);
+    context
+        .getCacheEntry(target)
+        .setValue(result, '', TargetedResult.EMPTY_LIST);
 
     expect(analysisDriver.createWorkOrderForResult(target, result), isNull);
   }
@@ -220,14 +225,16 @@
     // configure tasks
     TestAnalysisTask task1;
     TestAnalysisTask task2;
-    TaskDescriptor descriptor1 = new TaskDescriptor('task1',
-        (context, target) => task1, (target) => {
-      'inputB': new SimpleTaskInput<int>(target, resultB)
-    }, [resultA]);
-    TaskDescriptor descriptor2 = new TaskDescriptor('task2',
-        (context, target) => task2, (target) => {
-      'inputA': new SimpleTaskInput<int>(target, resultA)
-    }, [resultB]);
+    TaskDescriptor descriptor1 = new TaskDescriptor(
+        'task1',
+        (context, target) => task1,
+        (target) => {'inputB': new SimpleTaskInput<int>(target, resultB)},
+        [resultA]);
+    TaskDescriptor descriptor2 = new TaskDescriptor(
+        'task2',
+        (context, target) => task2,
+        (target) => {'inputA': new SimpleTaskInput<int>(target, resultA)},
+        [resultB]);
     task1 = new TestAnalysisTask(context, target,
         descriptor: descriptor1,
         results: [resultA],
@@ -267,14 +274,16 @@
     // configure tasks
     TestAnalysisTask task1;
     TestAnalysisTask task2;
-    TaskDescriptor descriptor1 = new TaskDescriptor('task1',
-        (context, target) => task1, (target) => {
-      'inputB': new SimpleTaskInput<int>(target, resultB)
-    }, [resultA]);
-    TaskDescriptor descriptor2 = new TaskDescriptor('task2',
-        (context, target) => task2, (target) => {
-      'inputA': new SimpleTaskInput<int>(target, resultA)
-    }, [resultB]);
+    TaskDescriptor descriptor1 = new TaskDescriptor(
+        'task1',
+        (context, target) => task1,
+        (target) => {'inputB': new SimpleTaskInput<int>(target, resultB)},
+        [resultA]);
+    TaskDescriptor descriptor2 = new TaskDescriptor(
+        'task2',
+        (context, target) => task2,
+        (target) => {'inputA': new SimpleTaskInput<int>(target, resultA)},
+        [resultB]);
     task1 = new TestAnalysisTask(context, target, descriptor: descriptor1);
     task2 = new TestAnalysisTask(context, target, descriptor: descriptor2);
     taskManager.addTaskDescriptor(descriptor1);
@@ -301,10 +310,11 @@
     TestAnalysisTask task2;
     TaskDescriptor descriptor1 = new TaskDescriptor(
         'task1', (context, target) => task1, (target) => {}, [resultA]);
-    TaskDescriptor descriptor2 = new TaskDescriptor('task2',
-        (context, target) => task2, (target) => {
-      'inputA': new SimpleTaskInput<int>(target, resultA)
-    }, [resultB]);
+    TaskDescriptor descriptor2 = new TaskDescriptor(
+        'task2',
+        (context, target) => task2,
+        (target) => {'inputA': new SimpleTaskInput<int>(target, resultA)},
+        [resultB]);
     task1 = new TestAnalysisTask(context, target,
         descriptor: descriptor1, results: [resultA], value: 10);
     task2 = new TestAnalysisTask(context, target,
@@ -390,9 +400,11 @@
   test_performWorkItem_preExistingException() {
     AnalysisTarget target = new TestSource();
     ResultDescriptor result = new ResultDescriptor('result', null);
-    TaskDescriptor descriptor = new TaskDescriptor('task',
+    TaskDescriptor descriptor = new TaskDescriptor(
+        'task',
         (context, target) => new TestAnalysisTask(context, target),
-        (target) => {}, [result]);
+        (target) => {},
+        [result]);
     CaughtException exception =
         new CaughtException(new AnalysisException(), null);
     WorkItem item = new WorkItem(context, target, descriptor, null);
@@ -406,7 +418,8 @@
 
   test_reset() {
     ResultDescriptor inputResult = new ResultDescriptor('input', null);
-    TaskDescriptor descriptor = new TaskDescriptor('task',
+    TaskDescriptor descriptor = new TaskDescriptor(
+        'task',
         (context, target) => new TestAnalysisTask(context, target),
         (target) => {'one': inputResult.of(target)},
         [new ResultDescriptor('output', null)]);
@@ -418,14 +431,20 @@
   }
 
   void _configureDescriptors12() {
-    descriptor1 = new TaskDescriptor('task1', (context, target) =>
+    descriptor1 = new TaskDescriptor(
+        'task1',
+        (context, target) =>
             new TestAnalysisTask(context, target, descriptor: descriptor1),
-        (target) => {}, [result1]);
+        (target) => {},
+        [result1]);
     taskManager.addTaskDescriptor(descriptor1);
 
-    descriptor2 = new TaskDescriptor('task2', (context, target) =>
+    descriptor2 = new TaskDescriptor(
+        'task2',
+        (context, target) =>
             new TestAnalysisTask(context, target, descriptor: descriptor1),
-        (target) => {}, [result2]);
+        (target) => {},
+        [result2]);
     taskManager.addTaskDescriptor(descriptor2);
   }
 
@@ -440,9 +459,11 @@
       bool complete, bool priorityTarget, bool priorityResult) {
     AnalysisTarget target = new TestSource();
     ResultDescriptor result = new ResultDescriptor('result', null);
-    TaskDescriptor descriptor = new TaskDescriptor('task',
+    TaskDescriptor descriptor = new TaskDescriptor(
+        'task',
         (context, target) => new TestAnalysisTask(context, target),
-        (target) => {}, [result]);
+        (target) => {},
+        [result]);
     if (priorityResult) {
       taskManager.addPriorityResult(result);
     } else {
@@ -455,8 +476,9 @@
       context.explicitTargets.add(target);
     }
     if (complete) {
-      context.getCacheEntry(target).setValue(
-          result, '', TargetedResult.EMPTY_LIST);
+      context
+          .getCacheEntry(target)
+          .setValue(result, '', TargetedResult.EMPTY_LIST);
     } else {
       context.getCacheEntry(target).setState(result, CacheState.INVALID);
     }
@@ -506,34 +528,73 @@
       new StronglyConnectedComponent(<int>[node], false);
 
   void test_complex_graph() {
-    checkGraph({
-      1: [2, 3],
-      2: [3, 4],
-      3: [],
-      4: [3, 5],
-      5: [2, 6],
-      6: [3, 4]
-    }, 1, [singleton(3), cycle([2, 4, 5, 6]), singleton(1)]);
+    checkGraph(
+        {
+          1: [2, 3],
+          2: [3, 4],
+          3: [],
+          4: [3, 5],
+          5: [2, 6],
+          6: [3, 4]
+        },
+        1,
+        [
+          singleton(3),
+          cycle([2, 4, 5, 6]),
+          singleton(1)
+        ]);
   }
 
   void test_cycle_depends_on_other_nodes() {
-    checkGraph({1: [2, 3], 2: [4, 1], 3: [], 4: []}, 1, [
-      singleton(4),
-      singleton(3),
-      cycle([1, 2])
-    ]);
+    checkGraph(
+        {
+          1: [2, 3],
+          2: [4, 1],
+          3: [],
+          4: []
+        },
+        1,
+        [
+          singleton(4),
+          singleton(3),
+          cycle([1, 2])
+        ]);
   }
 
   void test_initial_node_depends_on_cycle() {
-    checkGraph({1: [2], 2: [3], 3: [2]}, 1, [cycle([2, 3]), singleton(1)]);
+    checkGraph(
+        {
+          1: [2],
+          2: [3],
+          3: [2]
+        },
+        1,
+        [
+          cycle([2, 3]),
+          singleton(1)
+        ]);
   }
 
   void test_simple_cycle() {
-    checkGraph({1: [2], 2: [1]}, 1, [cycle([1, 2])]);
+    checkGraph(
+        {
+          1: [2],
+          2: [1]
+        },
+        1,
+        [
+          cycle([1, 2])
+        ]);
   }
 
   void test_simple_dependency_chain() {
-    checkGraph({1: [2], 2: []}, 1, [singleton(2), singleton(1)]);
+    checkGraph(
+        {
+          1: [2],
+          2: []
+        },
+        1,
+        [singleton(2), singleton(1)]);
   }
 
   void test_single_node() {
@@ -541,7 +602,14 @@
   }
 
   void test_single_node_cycle() {
-    checkGraph({1: [1]}, 1, [cycle([1])]);
+    checkGraph(
+        {
+          1: [1]
+        },
+        1,
+        [
+          cycle([1])
+        ]);
   }
 }
 
@@ -549,9 +617,11 @@
 class WorkItemTest extends AbstractDriverTest {
   test_buildTask_complete() {
     AnalysisTarget target = new TestSource();
-    TaskDescriptor descriptor = new TaskDescriptor('task',
+    TaskDescriptor descriptor = new TaskDescriptor(
+        'task',
         (context, target) => new TestAnalysisTask(context, target),
-        (target) => {}, [new ResultDescriptor('output', null)]);
+        (target) => {},
+        [new ResultDescriptor('output', null)]);
     WorkItem item = new WorkItem(context, target, descriptor, null);
     AnalysisTask task = item.buildTask();
     expect(task, isNotNull);
@@ -560,11 +630,15 @@
   test_buildTask_incomplete() {
     AnalysisTarget target = new TestSource();
     ResultDescriptor inputResult = new ResultDescriptor('input', null);
-    List<ResultDescriptor> outputResults =
-        <ResultDescriptor>[new ResultDescriptor('output', null)];
-    TaskDescriptor descriptor = new TaskDescriptor('task', (context, target) =>
+    List<ResultDescriptor> outputResults = <ResultDescriptor>[
+      new ResultDescriptor('output', null)
+    ];
+    TaskDescriptor descriptor = new TaskDescriptor(
+        'task',
+        (context, target) =>
             new TestAnalysisTask(context, target, results: outputResults),
-        (target) => {'one': inputResult.of(target)}, outputResults);
+        (target) => {'one': inputResult.of(target)},
+        outputResults);
     WorkItem item = new WorkItem(context, target, descriptor, null);
     expect(() => item.buildTask(), throwsStateError);
   }
@@ -582,9 +656,11 @@
 
   test_gatherInputs_complete() {
     AnalysisTarget target = new TestSource();
-    TaskDescriptor descriptor = new TaskDescriptor('task',
+    TaskDescriptor descriptor = new TaskDescriptor(
+        'task',
         (context, target) => new TestAnalysisTask(context, target),
-        (target) => {}, [new ResultDescriptor('output', null)]);
+        (target) => {},
+        [new ResultDescriptor('output', null)]);
     WorkItem item = new WorkItem(context, target, descriptor, null);
     WorkItem result = item.gatherInputs(taskManager, []);
     expect(result, isNull);
@@ -596,12 +672,17 @@
     ResultDescriptor resultA = new ResultDescriptor('resultA', null);
     ResultDescriptor resultB = new ResultDescriptor('resultB', null);
     // prepare tasks
-    TaskDescriptor task1 = new TaskDescriptor('task', (context, target) =>
+    TaskDescriptor task1 = new TaskDescriptor(
+        'task',
+        (context, target) =>
             new TestAnalysisTask(context, target, results: [resultA]),
-        (target) => {}, [resultA]);
-    TaskDescriptor task2 = new TaskDescriptor('task',
+        (target) => {},
+        [resultA]);
+    TaskDescriptor task2 = new TaskDescriptor(
+        'task',
         (context, target) => new TestAnalysisTask(context, target),
-        (target) => {'one': resultA.of(target)}, [resultB]);
+        (target) => {'one': resultA.of(target)},
+        [resultB]);
     taskManager.addTaskDescriptor(task1);
     taskManager.addTaskDescriptor(task2);
     // gather inputs
@@ -613,7 +694,8 @@
   test_gatherInputs_invalid() {
     AnalysisTarget target = new TestSource();
     ResultDescriptor inputResult = new ResultDescriptor('input', null);
-    TaskDescriptor descriptor = new TaskDescriptor('task',
+    TaskDescriptor descriptor = new TaskDescriptor(
+        'task',
         (context, target) => new TestAnalysisTask(context, target),
         (target) => {'one': inputResult.of(target)},
         [new ResultDescriptor('output', null)]);
diff --git a/pkg/analyzer/test/src/task/general_test.dart b/pkg/analyzer/test/src/task/general_test.dart
index e7b6e92..b335664 100644
--- a/pkg/analyzer/test/src/task/general_test.dart
+++ b/pkg/analyzer/test/src/task/general_test.dart
@@ -15,9 +15,10 @@
 
 import '../../generated/test_support.dart';
 import '../../reflective_tests.dart';
+import '../../utils.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   runReflectiveTests(GetContentTaskTest);
 }
 
diff --git a/pkg/analyzer/test/src/task/html_test.dart b/pkg/analyzer/test/src/task/html_test.dart
index e3413b7..0806e90 100644
--- a/pkg/analyzer/test/src/task/html_test.dart
+++ b/pkg/analyzer/test/src/task/html_test.dart
@@ -6,20 +6,27 @@
 
 import 'package:analyzer/src/generated/source.dart';
 import 'package:analyzer/src/task/html.dart';
+import 'package:analyzer/task/general.dart';
 import 'package:analyzer/task/html.dart';
 import 'package:analyzer/task/model.dart';
+import 'package:html/dom.dart';
 import 'package:unittest/unittest.dart';
 
 import '../../reflective_tests.dart';
+import '../../utils.dart';
 import '../context/abstract_context.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   runReflectiveTests(DartScriptsTaskTest);
   runReflectiveTests(HtmlErrorsTaskTest);
   runReflectiveTests(ParseHtmlTaskTest);
 }
 
+isInstanceOf isDartScriptsTask = new isInstanceOf<DartScriptsTask>();
+isInstanceOf isHtmlErrorsTask = new isInstanceOf<HtmlErrorsTask>();
+isInstanceOf isParseHtmlTask = new isInstanceOf<ParseHtmlTask>();
+
 @reflectiveTest
 class DartScriptsTaskTest extends AbstractContextTest {
   test_buildInputs() {
@@ -60,7 +67,9 @@
     String content = r'''
     void buttonPressed() {}
   ''';
-    AnalysisTarget target = newSource('/test.html', '''
+    AnalysisTarget target = newSource(
+        '/test.html',
+        '''
 <!DOCTYPE html>
 <html>
 <head>
@@ -69,8 +78,7 @@
 <body>
 </body>
 </html>''');
-    computeResult(target, REFERENCED_LIBRARIES);
-    expect(task, new isInstanceOf<DartScriptsTask>());
+    computeResult(target, REFERENCED_LIBRARIES, matcher: isDartScriptsTask);
     expect(outputs[REFERENCED_LIBRARIES], hasLength(0));
     expect(outputs[DART_SCRIPTS], hasLength(1));
     DartScript script = outputs[DART_SCRIPTS][0];
@@ -80,7 +88,9 @@
   }
 
   void test_perform_empty_source_reference() {
-    AnalysisTarget target = newSource('/test.html', r'''
+    AnalysisTarget target = newSource(
+        '/test.html',
+        r'''
 <!DOCTYPE html>
 <html>
 <head>
@@ -89,14 +99,15 @@
 <body>
 </body>
 </html>''');
-    computeResult(target, REFERENCED_LIBRARIES);
-    expect(task, new isInstanceOf<DartScriptsTask>());
+    computeResult(target, REFERENCED_LIBRARIES, matcher: isDartScriptsTask);
     expect(outputs[REFERENCED_LIBRARIES], hasLength(0));
     expect(outputs[DART_SCRIPTS], hasLength(0));
   }
 
   void test_perform_invalid_source_reference() {
-    AnalysisTarget target = newSource('/test.html', r'''
+    AnalysisTarget target = newSource(
+        '/test.html',
+        r'''
 <!DOCTYPE html>
 <html>
 <head>
@@ -105,14 +116,15 @@
 <body>
 </body>
 </html>''');
-    computeResult(target, REFERENCED_LIBRARIES);
-    expect(task, new isInstanceOf<DartScriptsTask>());
+    computeResult(target, REFERENCED_LIBRARIES, matcher: isDartScriptsTask);
     expect(outputs[REFERENCED_LIBRARIES], hasLength(0));
     expect(outputs[DART_SCRIPTS], hasLength(0));
   }
 
   void test_perform_non_existing_source_reference() {
-    AnalysisTarget target = newSource('/test.html', r'''
+    AnalysisTarget target = newSource(
+        '/test.html',
+        r'''
 <!DOCTYPE html>
 <html>
 <head>
@@ -121,14 +133,15 @@
 <body>
 </body>
 </html>''');
-    computeResult(target, REFERENCED_LIBRARIES);
-    expect(task, new isInstanceOf<DartScriptsTask>());
+    computeResult(target, REFERENCED_LIBRARIES, matcher: isDartScriptsTask);
     expect(outputs[REFERENCED_LIBRARIES], hasLength(1));
     expect(outputs[DART_SCRIPTS], hasLength(0));
   }
 
   test_perform_none() {
-    AnalysisTarget target = newSource('/test.html', r'''
+    AnalysisTarget target = newSource(
+        '/test.html',
+        r'''
 <!DOCTYPE html>
 <html>
   <head>
@@ -139,14 +152,15 @@
   </body>
 </html>
 ''');
-    computeResult(target, REFERENCED_LIBRARIES);
-    expect(task, new isInstanceOf<DartScriptsTask>());
+    computeResult(target, REFERENCED_LIBRARIES, matcher: isDartScriptsTask);
     expect(outputs[REFERENCED_LIBRARIES], hasLength(0));
     expect(outputs[DART_SCRIPTS], hasLength(0));
   }
 
   void test_perform_referenced_source() {
-    AnalysisTarget target = newSource('/test.html', r'''
+    AnalysisTarget target = newSource(
+        '/test.html',
+        r'''
 <!DOCTYPE html>
 <html>
 <head>
@@ -155,8 +169,7 @@
 <body>
 </body>
 </html>''');
-    computeResult(target, REFERENCED_LIBRARIES);
-    expect(task, new isInstanceOf<DartScriptsTask>());
+    computeResult(target, REFERENCED_LIBRARIES, matcher: isDartScriptsTask);
     expect(outputs[REFERENCED_LIBRARIES], hasLength(1));
     expect(outputs[DART_SCRIPTS], hasLength(0));
   }
@@ -164,14 +177,21 @@
 
 @reflectiveTest
 class HtmlErrorsTaskTest extends AbstractContextTest {
-  test_buildInputs() {
-    Source source = newSource('/test.html');
-    Map<String, TaskInput> inputs = HtmlErrorsTask.buildInputs(source);
-    expect(inputs, isNotNull);
-    expect(inputs.keys, unorderedEquals([
-      HtmlErrorsTask.DART_ERRORS_INPUT,
-      HtmlErrorsTask.DOCUMENT_ERRORS_INPUT
-    ]));
+  fail_perform_htmlErrors() {
+    AnalysisTarget target = newSource(
+        '/test.html',
+        r'''
+<html>
+  <head>
+    <title>test page</not-title>
+  </head>
+  <body>
+    Test
+  </body>
+</html>
+''');
+    computeResult(target, HTML_ERRORS, matcher: isHtmlErrorsTask);
+    expect(outputs[HTML_ERRORS], hasLength(1));
   }
 
   test_constructor() {
@@ -202,7 +222,9 @@
   }
 
   test_perform_dartErrors() {
-    AnalysisTarget target = newSource('/test.html', r'''
+    AnalysisTarget target = newSource(
+        '/test.html',
+        r'''
 <!DOCTYPE html>
 <html>
   <head>
@@ -214,29 +236,14 @@
   <body>Test</body>
 </html>
 ''');
-    computeResult(target, HTML_ERRORS);
-    expect(task, new isInstanceOf<HtmlErrorsTask>());
-    expect(outputs[HTML_ERRORS], hasLength(1));
-  }
-
-  test_perform_htmlErrors() {
-    AnalysisTarget target = newSource('/test.html', r'''
-<html>
-  <head>
-    <title>test page</title>
-  </head>
-  <body>
-    Test
-  </body>
-</html>
-''');
-    computeResult(target, HTML_ERRORS);
-    expect(task, new isInstanceOf<HtmlErrorsTask>());
+    computeResult(target, HTML_ERRORS, matcher: isHtmlErrorsTask);
     expect(outputs[HTML_ERRORS], hasLength(1));
   }
 
   test_perform_noErrors() {
-    AnalysisTarget target = newSource('/test.html', r'''
+    AnalysisTarget target = newSource(
+        '/test.html',
+        r'''
 <!DOCTYPE html>
 <html>
   <head>
@@ -247,8 +254,7 @@
   </body>
 </html>
 ''');
-    computeResult(target, HTML_ERRORS);
-    expect(task, new isInstanceOf<HtmlErrorsTask>());
+    computeResult(target, HTML_ERRORS, matcher: isHtmlErrorsTask);
     expect(outputs[HTML_ERRORS], isEmpty);
   }
 }
@@ -290,20 +296,73 @@
   }
 
   test_perform() {
-    AnalysisTarget target = newSource('/test.html', r'''
+    String code = r'''
 <!DOCTYPE html>
 <html>
   <head>
     <title>test page</title>
   </head>
   <body>
-    <h1 Test>
+    <h1>Test</h1>
   </body>
 </html>
-''');
+''';
+    AnalysisTarget target = newSource('/test.html', code);
     computeResult(target, HTML_DOCUMENT);
-    expect(task, new isInstanceOf<ParseHtmlTask>());
+    expect(task, isParseHtmlTask);
     expect(outputs[HTML_DOCUMENT], isNotNull);
-    expect(outputs[HTML_DOCUMENT_ERRORS], isNotEmpty);
+    expect(outputs[HTML_DOCUMENT_ERRORS], isEmpty);
+    // LINE_INFO
+    {
+      LineInfo lineInfo = outputs[LINE_INFO];
+      expect(lineInfo, isNotNull);
+      {
+        int offset = code.indexOf('<!DOCTYPE');
+        LineInfo_Location location = lineInfo.getLocation(offset);
+        expect(location.lineNumber, 1);
+        expect(location.columnNumber, 1);
+      }
+      {
+        int offset = code.indexOf('<html>');
+        LineInfo_Location location = lineInfo.getLocation(offset);
+        expect(location.lineNumber, 2);
+        expect(location.columnNumber, 1);
+      }
+      {
+        int offset = code.indexOf('<title>');
+        LineInfo_Location location = lineInfo.getLocation(offset);
+        expect(location.lineNumber, 4);
+        expect(location.columnNumber, 5);
+      }
+    }
+  }
+
+  test_perform_noDocType() {
+    String code = r'''
+<div>AAA</div>
+<span>BBB</span>
+''';
+    AnalysisTarget target = newSource('/test.html', code);
+    computeResult(target, HTML_DOCUMENT);
+    expect(task, isParseHtmlTask);
+    // validate Document
+    {
+      Document document = outputs[HTML_DOCUMENT];
+      expect(document, isNotNull);
+      // artificial <html>
+      expect(document.nodes, hasLength(1));
+      Element htmlElement = document.nodes[0];
+      expect(htmlElement.localName, 'html');
+      // artificial <body>
+      expect(htmlElement.nodes, hasLength(2));
+      Element bodyElement = htmlElement.nodes[1];
+      expect(bodyElement.localName, 'body');
+      // actual nodes
+      expect(bodyElement.nodes, hasLength(4));
+      expect((bodyElement.nodes[0] as Element).localName, 'div');
+      expect((bodyElement.nodes[2] as Element).localName, 'span');
+    }
+    // it's OK to don't have DOCTYPE
+    expect(outputs[HTML_DOCUMENT_ERRORS], isEmpty);
   }
 }
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 ad1027c..0785f97 100644
--- a/pkg/analyzer/test/src/task/html_work_manager_test.dart
+++ b/pkg/analyzer/test/src/task/html_work_manager_test.dart
@@ -17,7 +17,6 @@
     show AnalysisError, HtmlErrorCode;
 import 'package:analyzer/src/generated/java_engine.dart' show CaughtException;
 import 'package:analyzer/src/generated/source.dart';
-import 'package:analyzer/src/task/driver.dart';
 import 'package:analyzer/src/task/html.dart';
 import 'package:analyzer/src/task/html_work_manager.dart';
 import 'package:analyzer/task/dart.dart';
@@ -29,9 +28,10 @@
 
 import '../../generated/test_support.dart';
 import '../../reflective_tests.dart';
+import '../../utils.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   runReflectiveTests(HtmlWorkManagerTest);
 }
 
@@ -116,10 +116,12 @@
     manager.priorityResultQueue.add(new TargetedResult(source2, HTML_ERRORS));
     // -source1 +source3
     manager.applyPriorityTargets([source2, source3]);
-    expect(manager.priorityResultQueue, unorderedEquals([
-      new TargetedResult(source2, HTML_ERRORS),
-      new TargetedResult(source3, HTML_ERRORS)
-    ]));
+    expect(
+        manager.priorityResultQueue,
+        unorderedEquals([
+          new TargetedResult(source2, HTML_ERRORS),
+          new TargetedResult(source3, HTML_ERRORS)
+        ]));
     // get next request
     TargetedResult request = manager.getNextResult();
     expect(request.target, source2);
@@ -131,18 +133,15 @@
         new AnalysisError(source1, 1, 0, HtmlErrorCode.PARSE_ERROR, ['']);
     AnalysisError error2 =
         new AnalysisError(source1, 2, 0, HtmlErrorCode.PARSE_ERROR, ['']);
-    LineInfo lineInfo = new LineInfo([0]);
     entry1.setValue(HTML_DOCUMENT_ERRORS, <AnalysisError>[error1], []);
-    entry1.setValue(LINE_INFO, lineInfo, []);
 
     DartScript script = new DartScript(source1, []);
     entry1.setValue(DART_SCRIPTS, [script], []);
     CacheEntry scriptEntry = context.getCacheEntry(script);
     scriptEntry.setValue(DART_ERRORS, [error2], []);
 
-    AnalysisErrorInfo errorInfo = manager.getErrors(source1);
-    expect(errorInfo.errors, unorderedEquals([error1, error2]));
-    expect(errorInfo.lineInfo, lineInfo);
+    List<AnalysisError> errors = manager.getErrors(source1);
+    expect(errors, unorderedEquals([error1, error2]));
   }
 
   void test_getErrors_partialList() {
@@ -150,13 +149,10 @@
         new AnalysisError(source1, 1, 0, HtmlErrorCode.PARSE_ERROR, ['']);
     AnalysisError error2 =
         new AnalysisError(source1, 2, 0, HtmlErrorCode.PARSE_ERROR, ['']);
-    LineInfo lineInfo = new LineInfo([0]);
     entry1.setValue(HTML_DOCUMENT_ERRORS, <AnalysisError>[error1, error2], []);
-    entry1.setValue(LINE_INFO, lineInfo, []);
 
-    AnalysisErrorInfo errorInfo = manager.getErrors(source1);
-    expect(errorInfo.errors, unorderedEquals([error1, error2]));
-    expect(errorInfo.lineInfo, lineInfo);
+    List<AnalysisError> errors = manager.getErrors(source1);
+    expect(errors, unorderedEquals([error1, error2]));
   }
 
   void test_getNextResult_hasNormal_firstIsError() {
@@ -204,19 +200,23 @@
   void test_getNextResult_hasPriority() {
     manager.addPriorityResult(source1, HTML_ERRORS);
     manager.addPriorityResult(source2, HTML_ERRORS);
-    expect(manager.priorityResultQueue, unorderedEquals([
-      new TargetedResult(source1, HTML_ERRORS),
-      new TargetedResult(source2, HTML_ERRORS)
-    ]));
+    expect(
+        manager.priorityResultQueue,
+        unorderedEquals([
+          new TargetedResult(source1, HTML_ERRORS),
+          new TargetedResult(source2, HTML_ERRORS)
+        ]));
 
     TargetedResult request = manager.getNextResult();
     expect(request.target, source1);
     expect(request.result, HTML_ERRORS);
     // no changes until computed
-    expect(manager.priorityResultQueue, unorderedEquals([
-      new TargetedResult(source1, HTML_ERRORS),
-      new TargetedResult(source2, HTML_ERRORS)
-    ]));
+    expect(
+        manager.priorityResultQueue,
+        unorderedEquals([
+          new TargetedResult(source1, HTML_ERRORS),
+          new TargetedResult(source2, HTML_ERRORS)
+        ]));
   }
 
   void test_getNextResult_nothingToDo() {
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 cc6e95b..b495be7 100644
--- a/pkg/analyzer/test/src/task/incremental_element_builder_test.dart
+++ b/pkg/analyzer/test/src/task/incremental_element_builder_test.dart
@@ -11,10 +11,11 @@
 import 'package:unittest/unittest.dart';
 
 import '../../reflective_tests.dart';
+import '../../utils.dart';
 import '../context/abstract_context.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   runReflectiveTests(IncrementalCompilationUnitElementBuilderTest);
 }
 
@@ -79,10 +80,12 @@
 part 'test.dart';
 ''';
     Source libSource = newSource('/lib.dart', libCode);
-    _buildOldUnit(r'''
+    _buildOldUnit(
+        r'''
 part of my_lib;
 class A {}
-''', libSource);
+''',
+        libSource);
     List<Directive> oldDirectives = oldUnit.directives.toList();
     _buildNewUnit(r'''
 part of my_lib;
@@ -330,7 +333,9 @@
     {
       CompilationUnitMember newNode = newNodes[0];
       expect(newNode, same(oldNodes[2]));
-      expect(getNodeText(newNode), r'''
+      expect(
+          getNodeText(newNode),
+          r'''
 /// reference [double] and [B] types.
 class C {}''');
       ClassElement element = newNode.element;
@@ -349,7 +354,9 @@
     {
       CompilationUnitMember newNode = newNodes[1];
       expect(newNode, same(oldNodes[0]));
-      expect(getNodeText(newNode), r'''
+      expect(
+          getNodeText(newNode),
+          r'''
 /// reference [bool] type.
 class A {}''');
       ClassElement element = newNode.element;
@@ -366,7 +373,9 @@
     {
       CompilationUnitMember newNode = newNodes[2];
       expect(newNode, same(oldNodes[1]));
-      expect(getNodeText(newNode), r'''
+      expect(
+          getNodeText(newNode),
+          r'''
 /// reference [int] type.
 class B {}''');
       ClassElement element = newNode.element;
@@ -621,16 +630,18 @@
     // 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
-    ]));
+    expect(
+        unitElement.accessors,
+        unorderedEquals([
+          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 625f916..3943a99 100644
--- a/pkg/analyzer/test/src/task/inputs_test.dart
+++ b/pkg/analyzer/test/src/task/inputs_test.dart
@@ -11,9 +11,12 @@
 
 import '../../generated/test_support.dart';
 import '../../reflective_tests.dart';
+import '../../utils.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
+  runReflectiveTests(ConstantTaskInputBuilderTest);
+  runReflectiveTests(ConstantTaskInputTest);
   runReflectiveTests(ListTaskInputImplTest);
   runReflectiveTests(ListToListTaskInputTest);
   runReflectiveTests(ListToListTaskInputBuilderTest);
@@ -27,6 +30,96 @@
 }
 
 @reflectiveTest
+class ConstantTaskInputBuilderTest extends EngineTestCase {
+  static final int value = 7;
+  static final ConstantTaskInput<int> input = new ConstantTaskInput<int>(value);
+
+  ConstantTaskInputBuilder builder;
+
+  void setUp() {
+    builder = new ConstantTaskInputBuilder(input);
+  }
+
+  test_create() {
+    expect(builder, isNotNull);
+    expect(builder.input, input);
+  }
+
+  test_currentResult_afterOneMoveNext() {
+    builder.moveNext();
+    expect(builder.currentResult, null);
+  }
+
+  test_currentResult_beforeMoveNext() {
+    expect(builder.currentResult, null);
+  }
+
+  test_currentTarget_afterOneMoveNext() {
+    builder.moveNext();
+    expect(builder.currentTarget, null);
+  }
+
+  test_currentTarget_beforeMoveNext() {
+    expect(builder.currentTarget, null);
+  }
+
+  test_currentValue_afterOneMoveNext() {
+    builder.moveNext();
+    expect(() {
+      builder.currentValue = 'value';
+    }, throwsStateError);
+  }
+
+  test_currentValue_beforeMoveNext() {
+    expect(() {
+      builder.currentValue = 'value';
+    }, throwsStateError);
+  }
+
+  test_currentValueNotAvailable_afterOneMoveNext() {
+    builder.moveNext();
+    expect(() {
+      builder.currentValueNotAvailable();
+    }, throwsStateError);
+  }
+
+  test_currentValueNotAvailable_beforeMoveNext() {
+    expect(() {
+      builder.currentValueNotAvailable();
+    }, throwsStateError);
+  }
+
+  test_inputValue_afterOneMoveNext() {
+    builder.moveNext();
+    expect(builder.inputValue, value);
+  }
+
+  test_inputValue_beforeMoveNext() {
+    expect(builder.inputValue, value);
+  }
+
+  test_moveNext() {
+    expect(builder.moveNext(), false);
+    expect(builder.moveNext(), false);
+  }
+}
+
+@reflectiveTest
+class ConstantTaskInputTest extends EngineTestCase {
+  test_create() {
+    int value = 3;
+    ConstantTaskInput<int> input = new ConstantTaskInput<int>(value);
+    expect(input, isNotNull);
+    expect(input.value, value);
+  }
+
+  test_createBuilder() {
+    ConstantTaskInput<int> input = new ConstantTaskInput<int>(5);
+    expect(input.createBuilder(), new isInstanceOf<ConstantTaskInputBuilder>());
+  }
+}
+
+@reflectiveTest
 class ListTaskInputImplTest extends EngineTestCase {
   static final AnalysisTarget target = new TestSource();
   static final result1 =
@@ -799,6 +892,21 @@
     expect(builder.currentResult, result1);
   }
 
+  test_currentResult_afterTwoMoveNext_withConstantInput() {
+    ConstantTaskInput<int> constantInput = new ConstantTaskInput<int>(11);
+    Map<String, TaskInput> inputDescriptors = {
+      'one': input1,
+      'constant': constantInput,
+      'two': input2
+    };
+    TopLevelTaskInputBuilder builder =
+        new TopLevelTaskInputBuilder(inputDescriptors);
+    builder.moveNext();
+    builder.currentValue = 'value1';
+    builder.moveNext();
+    expect(builder.currentResult, result2);
+  }
+
   test_currentResult_beforeMoveNext() {
     Map<String, TaskInput> inputDescriptors = {};
     TopLevelTaskInputBuilder builder =
@@ -834,6 +942,21 @@
     expect(builder.currentTarget, target);
   }
 
+  test_currentTarget_afterTwoMoveNext_withConstantInput() {
+    ConstantTaskInput<int> constantInput = new ConstantTaskInput<int>(11);
+    Map<String, TaskInput> inputDescriptors = {
+      'one': input1,
+      'constant': constantInput,
+      'two': input2
+    };
+    TopLevelTaskInputBuilder builder =
+        new TopLevelTaskInputBuilder(inputDescriptors);
+    builder.moveNext();
+    builder.currentValue = 'value1';
+    builder.moveNext();
+    expect(builder.currentTarget, target);
+  }
+
   test_currentTarget_beforeMoveNext() {
     Map<String, TaskInput> inputDescriptors = {};
     TopLevelTaskInputBuilder builder =
diff --git a/pkg/analyzer/test/src/task/manager_test.dart b/pkg/analyzer/test/src/task/manager_test.dart
index e4aa6de..783c015 100644
--- a/pkg/analyzer/test/src/task/manager_test.dart
+++ b/pkg/analyzer/test/src/task/manager_test.dart
@@ -11,9 +11,10 @@
 
 import '../../generated/test_support.dart';
 import '../../reflective_tests.dart';
+import '../../utils.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   runReflectiveTests(TaskManagerTest);
 }
 
diff --git a/pkg/analyzer/test/src/task/model_test.dart b/pkg/analyzer/test/src/task/model_test.dart
index b75afd6..00cdcfa 100644
--- a/pkg/analyzer/test/src/task/model_test.dart
+++ b/pkg/analyzer/test/src/task/model_test.dart
@@ -12,10 +12,11 @@
 
 import '../../generated/test_support.dart';
 import '../../reflective_tests.dart';
+import '../../utils.dart';
 import 'test_support.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   runReflectiveTests(AnalysisTaskTest);
   runReflectiveTests(ResultDescriptorImplTest);
   runReflectiveTests(SimpleResultCachingPolicyTest);
@@ -117,8 +118,8 @@
   }
 
   test_createTask() {
-    BuildTask buildTask =
-        (context, target) => new TestAnalysisTask(context, target);
+    BuildTask buildTask = (context, target) =>
+        new TestAnalysisTask(context, target);
     CreateTaskInputs createTaskInputs = (target) {};
     List<ResultDescriptor> results = <ResultDescriptor>[];
     TaskDescriptorImpl descriptor =
diff --git a/pkg/analyzer/test/src/task/options_test.dart b/pkg/analyzer/test/src/task/options_test.dart
new file mode 100644
index 0000000..5dddc25
--- /dev/null
+++ b/pkg/analyzer/test/src/task/options_test.dart
@@ -0,0 +1,178 @@
+// 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 test.src.task.options_test;
+
+import 'package:analyzer/analyzer.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:analyzer/src/task/options.dart';
+import 'package:analyzer/task/general.dart';
+import 'package:analyzer/task/model.dart';
+import 'package:unittest/unittest.dart';
+
+import '../../generated/test_support.dart';
+import '../../reflective_tests.dart';
+import '../../utils.dart';
+import '../context/abstract_context.dart';
+
+main() {
+  initializeTestEnvironment();
+  runReflectiveTests(GenerateOptionsErrorsTaskTest);
+  runReflectiveTests(OptionsFileValidatorTest);
+}
+
+isInstanceOf isGenerateOptionsErrorsTask =
+    new isInstanceOf<GenerateOptionsErrorsTask>();
+
+@reflectiveTest
+class GenerateOptionsErrorsTaskTest extends AbstractContextTest {
+  final optionsFilePath = '/${AnalysisEngine.ANALYSIS_OPTIONS_FILE}';
+
+  Source source;
+  @override
+  setUp() {
+    super.setUp();
+    source = newSource(optionsFilePath);
+  }
+
+  test_buildInputs() {
+    Map<String, TaskInput> inputs =
+        GenerateOptionsErrorsTask.buildInputs(source);
+    expect(inputs, isNotNull);
+    expect(inputs.keys,
+        unorderedEquals([GenerateOptionsErrorsTask.CONTENT_INPUT_NAME]));
+  }
+
+  test_constructor() {
+    GenerateOptionsErrorsTask task =
+        new GenerateOptionsErrorsTask(context, source);
+    expect(task, isNotNull);
+    expect(task.context, context);
+    expect(task.target, source);
+  }
+
+  test_createTask() {
+    GenerateOptionsErrorsTask task =
+        GenerateOptionsErrorsTask.createTask(context, source);
+    expect(task, isNotNull);
+    expect(task.context, context);
+    expect(task.target, source);
+  }
+
+  test_description() {
+    GenerateOptionsErrorsTask task =
+        new GenerateOptionsErrorsTask(null, source);
+    expect(task.description, isNotNull);
+  }
+
+  test_descriptor() {
+    TaskDescriptor descriptor = GenerateOptionsErrorsTask.DESCRIPTOR;
+    expect(descriptor, isNotNull);
+  }
+
+  test_perform_bad_yaml() {
+    String code = r'''
+:
+''';
+    AnalysisTarget target = newSource(optionsFilePath, code);
+    computeResult(target, ANALYSIS_OPTIONS_ERRORS);
+    expect(task, isGenerateOptionsErrorsTask);
+    List<AnalysisError> errors = outputs[ANALYSIS_OPTIONS_ERRORS];
+    expect(errors, hasLength(1));
+    expect(errors[0].errorCode, AnalysisOptionsErrorCode.PARSE_ERROR);
+  }
+
+  test_perform_OK() {
+    String code = r'''
+analyzer:
+  strong-mode: true
+''';
+    AnalysisTarget target = newSource(optionsFilePath, code);
+    computeResult(target, ANALYSIS_OPTIONS_ERRORS);
+    expect(task, isGenerateOptionsErrorsTask);
+    expect(outputs[ANALYSIS_OPTIONS_ERRORS], isEmpty);
+    LineInfo lineInfo = outputs[LINE_INFO];
+    expect(lineInfo, isNotNull);
+    expect(lineInfo.getLocation(1).lineNumber, 1);
+    expect(lineInfo.getLocation(10).lineNumber, 2);
+  }
+
+  test_perform_unsupported_analyzer_option() {
+    String code = r'''
+analyzer:
+  not_supported: true
+''';
+    AnalysisTarget target = newSource(optionsFilePath, code);
+    computeResult(target, ANALYSIS_OPTIONS_ERRORS);
+    expect(task, isGenerateOptionsErrorsTask);
+    List<AnalysisError> errors = outputs[ANALYSIS_OPTIONS_ERRORS];
+    expect(errors, hasLength(1));
+    expect(errors[0].errorCode, AnalysisOptionsWarningCode.UNSUPPORTED_OPTION);
+    expect(errors[0].message,
+        "The option 'not_supported' is not supported by analyzer");
+  }
+}
+
+@reflectiveTest
+class OptionsFileValidatorTest {
+  final OptionsFileValidator validator =
+      new OptionsFileValidator(new TestSource());
+  final AnalysisOptionsProvider optionsProvider = new AnalysisOptionsProvider();
+
+  test_analyzer_supported_exclude() {
+    validate(
+        '''
+analyzer:
+  exclude:
+    - test/_data/p4/lib/lib1.dart
+    ''',
+        []);
+  }
+
+  test_analyzer_supported_strong_mode() {
+    validate(
+        '''
+analyzer:
+  strong-mode: true
+    ''',
+        []);
+  }
+
+  test_analyzer_unsupported_option() {
+    validate(
+        '''
+analyzer:
+  not_supported: true
+    ''',
+        [AnalysisOptionsWarningCode.UNSUPPORTED_OPTION]);
+  }
+
+  test_linter_supported_rules() {
+    validate(
+        '''
+linter:
+  rules:
+    - camel_case_types
+    ''',
+        []);
+  }
+
+  test_linter_unsupported_option() {
+    validate(
+        '''
+linter:
+  unsupported: true
+    ''',
+        [AnalysisOptionsWarningCode.UNSUPPORTED_OPTION]);
+  }
+
+  void validate(String source, List<AnalysisOptionsErrorCode> expected) {
+    var options = optionsProvider.getOptionsFromString(source);
+    var errors = validator.validate(options);
+    expect(errors.map((AnalysisError e) => e.errorCode),
+        unorderedEquals(expected));
+  }
+}
diff --git a/pkg/analyzer/test/src/task/options_work_manager_test.dart b/pkg/analyzer/test/src/task/options_work_manager_test.dart
new file mode 100644
index 0000000..424a729
--- /dev/null
+++ b/pkg/analyzer/test/src/task/options_work_manager_test.dart
@@ -0,0 +1,287 @@
+// 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 test.src.task.options_work_manager_test;
+
+import 'package:analyzer/src/context/cache.dart';
+import 'package:analyzer/src/generated/engine.dart'
+    show
+        AnalysisEngine,
+        AnalysisErrorInfo,
+        AnalysisErrorInfoImpl,
+        CacheState,
+        ChangeNoticeImpl,
+        InternalAnalysisContext;
+import 'package:analyzer/src/generated/error.dart'
+    show AnalysisError, AnalysisOptionsErrorCode;
+import 'package:analyzer/src/generated/java_engine.dart';
+import 'package:analyzer/src/generated/source.dart';
+import 'package:analyzer/src/task/options.dart';
+import 'package:analyzer/src/task/options_work_manager.dart';
+import 'package:analyzer/task/dart.dart';
+import 'package:analyzer/task/general.dart';
+import 'package:analyzer/task/model.dart';
+import 'package:typed_mock/typed_mock.dart';
+import 'package:unittest/unittest.dart';
+
+import '../../generated/test_support.dart';
+import '../../reflective_tests.dart';
+import '../../utils.dart';
+
+main() {
+  initializeTestEnvironment();
+  runReflectiveTests(OptionsWorkManagerTest);
+}
+
+@reflectiveTest
+class OptionsWorkManagerTest {
+  static final optionsFile = AnalysisEngine.ANALYSIS_OPTIONS_FILE;
+  InternalAnalysisContext context = new _InternalAnalysisContextMock();
+  AnalysisCache cache;
+
+  OptionsWorkManager manager;
+
+  CaughtException caughtException = new CaughtException(null, null);
+
+  Source source1 = new TestSource('test1/$optionsFile');
+  Source source2 = new TestSource('test2/$optionsFile');
+  Source source3 = new TestSource('test3/$optionsFile');
+  Source source4 = new TestSource('test4/$optionsFile');
+  CacheEntry entry1;
+  CacheEntry entry2;
+  CacheEntry entry3;
+  CacheEntry entry4;
+
+  void expect_sourceQueue(List<Source> sources) {
+    expect(manager.sourceQueue, unorderedEquals(sources));
+  }
+
+  void setUp() {
+    cache = context.analysisCache;
+    manager = new OptionsWorkManager(context);
+    entry1 = context.getCacheEntry(source1);
+    entry2 = context.getCacheEntry(source2);
+    entry3 = context.getCacheEntry(source3);
+    entry4 = context.getCacheEntry(source4);
+  }
+
+  void test_applyChange_add() {
+    // add source1
+    manager.applyChange([source1], [], []);
+    expect_sourceQueue([source1]);
+    // add source2
+    manager.applyChange([source2], [], []);
+    expect_sourceQueue([source1, source2]);
+  }
+
+  void test_applyChange_add_duplicate() {
+    // add source1
+    manager.applyChange([source1], [], []);
+    expect_sourceQueue([source1]);
+    // add source1 again
+    manager.applyChange([source1], [], []);
+    expect_sourceQueue([source1]);
+  }
+
+  void test_applyChange_change() {
+    // change source1
+    manager.applyChange([], [source1], []);
+    expect_sourceQueue([source1]);
+  }
+
+  void test_applyChange_change_afterAdd() {
+    manager.applyChange([source1, source2], [], []);
+    // change source1
+    manager.applyChange([], [source1], []);
+    expect_sourceQueue([source1, source2]);
+  }
+
+  void test_applyChange_remove() {
+    manager.applyChange([source1, source2], [], []);
+    // remove source1
+    manager.applyChange([], [], [source1]);
+    expect_sourceQueue([source2]);
+    // remove source2
+    manager.applyChange([], [], [source2]);
+    expect_sourceQueue([]);
+    // remove source3
+    manager.applyChange([], [], [source3]);
+    expect_sourceQueue([]);
+  }
+
+  void test_applyPriorityTargets() {
+    when(context.shouldErrorsBeAnalyzed(source2, null)).thenReturn(true);
+    when(context.shouldErrorsBeAnalyzed(source3, null)).thenReturn(true);
+    manager.priorityResultQueue
+        .add(new TargetedResult(source1, ANALYSIS_OPTIONS_ERRORS));
+    manager.priorityResultQueue
+        .add(new TargetedResult(source2, ANALYSIS_OPTIONS_ERRORS));
+    // -source1 +source3
+    manager.applyPriorityTargets([source2, source3]);
+    expect(
+        manager.priorityResultQueue,
+        unorderedEquals([
+          new TargetedResult(source2, ANALYSIS_OPTIONS_ERRORS),
+          new TargetedResult(source3, ANALYSIS_OPTIONS_ERRORS)
+        ]));
+    // get next request
+    TargetedResult request = manager.getNextResult();
+    expect(request.target, source2);
+    expect(request.result, ANALYSIS_OPTIONS_ERRORS);
+  }
+
+  void test_getErrors() {
+    AnalysisError error1 = new AnalysisError(
+        source1, 1, 0, AnalysisOptionsErrorCode.PARSE_ERROR, ['']);
+    AnalysisError error2 = new AnalysisError(
+        source1, 2, 0, AnalysisOptionsErrorCode.PARSE_ERROR, ['']);
+    entry1.setValue(
+        ANALYSIS_OPTIONS_ERRORS, <AnalysisError>[error1, error2], []);
+
+    List<AnalysisError> errors = manager.getErrors(source1);
+    expect(errors, unorderedEquals([error1, error2]));
+  }
+
+  void test_getNextResult_hasNormal_firstIsError() {
+    entry1.setErrorState(caughtException, [ANALYSIS_OPTIONS_ERRORS]);
+    manager.sourceQueue.addAll([source1, source2]);
+    TargetedResult request = manager.getNextResult();
+    expect(request.target, source2);
+    expect(request.result, ANALYSIS_OPTIONS_ERRORS);
+    // source1 is out, source2 is waiting
+    expect_sourceQueue([source2]);
+  }
+
+  void test_getNextResult_hasNormal_firstIsInvalid() {
+    entry1.setState(ANALYSIS_OPTIONS_ERRORS, CacheState.INVALID);
+    manager.sourceQueue.addAll([source1, source2]);
+    TargetedResult request = manager.getNextResult();
+    expect(request.target, source1);
+    expect(request.result, ANALYSIS_OPTIONS_ERRORS);
+    // no changes until computed
+    expect_sourceQueue([source1, source2]);
+  }
+
+  void test_getNextResult_hasNormal_firstIsValid() {
+    entry1.setValue(ANALYSIS_OPTIONS_ERRORS, [], []);
+    manager.sourceQueue.addAll([source1, source2]);
+    TargetedResult request = manager.getNextResult();
+    expect(request.target, source2);
+    expect(request.result, ANALYSIS_OPTIONS_ERRORS);
+    // source1 is out, source2 is waiting
+    expect_sourceQueue([source2]);
+  }
+
+  void test_getNextResult_hasNormalAndPriority() {
+    entry1.setState(ANALYSIS_OPTIONS_ERRORS, CacheState.INVALID);
+    manager.sourceQueue.addAll([source1, source2]);
+    manager.addPriorityResult(source3, ANALYSIS_OPTIONS_ERRORS);
+
+    TargetedResult request = manager.getNextResult();
+    expect(request.target, source3);
+    expect(request.result, ANALYSIS_OPTIONS_ERRORS);
+    // no changes until computed
+    expect_sourceQueue([source1, source2]);
+  }
+
+  void test_getNextResult_hasPriority() {
+    manager.addPriorityResult(source1, ANALYSIS_OPTIONS_ERRORS);
+    manager.addPriorityResult(source2, ANALYSIS_OPTIONS_ERRORS);
+    expect(
+        manager.priorityResultQueue,
+        unorderedEquals([
+          new TargetedResult(source1, ANALYSIS_OPTIONS_ERRORS),
+          new TargetedResult(source2, ANALYSIS_OPTIONS_ERRORS)
+        ]));
+
+    TargetedResult request = manager.getNextResult();
+    expect(request.target, source1);
+    expect(request.result, ANALYSIS_OPTIONS_ERRORS);
+    // no changes until computed
+    expect(
+        manager.priorityResultQueue,
+        unorderedEquals([
+          new TargetedResult(source1, ANALYSIS_OPTIONS_ERRORS),
+          new TargetedResult(source2, ANALYSIS_OPTIONS_ERRORS)
+        ]));
+  }
+
+  void test_getNextResult_nothingToDo() {
+    TargetedResult request = manager.getNextResult();
+    expect(request, isNull);
+  }
+
+  void test_getNextResultPriority_hasPriority() {
+    manager.addPriorityResult(source1, SOURCE_KIND);
+    expect(manager.getNextResultPriority(), WorkOrderPriority.PRIORITY);
+  }
+
+  void test_getNextResultPriority_hasSource() {
+    manager.sourceQueue.addAll([source1]);
+    expect(manager.getNextResultPriority(), WorkOrderPriority.NORMAL);
+  }
+
+  void test_getNextResultPriority_nothingToDo() {
+    expect(manager.getNextResultPriority(), WorkOrderPriority.NONE);
+  }
+
+  void test_resultsComputed_errors() {
+    AnalysisError error1 = new AnalysisError(
+        source1, 1, 0, AnalysisOptionsErrorCode.PARSE_ERROR, ['']);
+    AnalysisError error2 = new AnalysisError(
+        source1, 2, 0, AnalysisOptionsErrorCode.PARSE_ERROR, ['']);
+    LineInfo lineInfo = new LineInfo([0]);
+    entry1.setValue(LINE_INFO, lineInfo, []);
+    entry1.setValue(
+        ANALYSIS_OPTIONS_ERRORS, <AnalysisError>[error1, error2], []);
+    // RESOLVED_UNIT is ready, set errors
+    manager.resultsComputed(source1, {ANALYSIS_OPTIONS_ERRORS: null});
+    // all of the errors are included
+    ChangeNoticeImpl notice = context.getNotice(source1);
+    expect(notice.errors, unorderedEquals([error1, error2]));
+    expect(notice.lineInfo, lineInfo);
+  }
+}
+
+class _InternalAnalysisContextMock extends TypedMock
+    implements InternalAnalysisContext {
+  @override
+  CachePartition privateAnalysisCachePartition;
+
+  @override
+  AnalysisCache analysisCache;
+
+  Map<Source, ChangeNoticeImpl> _pendingNotices = <Source, ChangeNoticeImpl>{};
+
+  _InternalAnalysisContextMock() {
+    privateAnalysisCachePartition = new UniversalCachePartition(this);
+    analysisCache = new AnalysisCache([privateAnalysisCachePartition]);
+  }
+
+  @override
+  CacheEntry getCacheEntry(AnalysisTarget target) {
+    CacheEntry entry = analysisCache.get(target);
+    if (entry == null) {
+      entry = new CacheEntry(target);
+      analysisCache.put(entry);
+    }
+    return entry;
+  }
+
+  @override
+  AnalysisErrorInfo getErrors(Source source) {
+    List<AnalysisError> errors = AnalysisError.NO_ERRORS;
+    if (AnalysisEngine.isAnalysisOptionsFileName(source.shortName)) {
+      errors = getCacheEntry(source).getValue(ANALYSIS_OPTIONS_ERRORS);
+    }
+    return new AnalysisErrorInfoImpl(
+        errors, getCacheEntry(source).getValue(LINE_INFO));
+  }
+
+  @override
+  ChangeNoticeImpl getNotice(Source source) =>
+      _pendingNotices.putIfAbsent(source, () => new ChangeNoticeImpl(source));
+
+  noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
+}
diff --git a/pkg/analyzer/test/src/task/strong/checker_test.dart b/pkg/analyzer/test/src/task/strong/checker_test.dart
new file mode 100644
index 0000000..aa51b50
--- /dev/null
+++ b/pkg/analyzer/test/src/task/strong/checker_test.dart
@@ -0,0 +1,2311 @@
+// 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.
+
+// TODO(jmesserly): this file needs to be refactored, it's a port from
+// package:dev_compiler's tests
+/// General type checking tests
+library test.src.task.strong.checker_test;
+
+import 'package:unittest/unittest.dart';
+
+import 'strong_test_helper.dart';
+
+void main() {
+  testChecker('ternary operator', {
+    '/main.dart': '''
+        abstract class Comparable<T> {
+          int compareTo(T other);
+          static int compare(Comparable a, Comparable b) => a.compareTo(b);
+        }
+        typedef int Comparator<T>(T a, T b);
+
+        typedef bool _Predicate<T>(T value);
+
+        class SplayTreeMap<K, V> {
+          Comparator<K> _comparator;
+          _Predicate _validKey;
+
+          // Initializing _comparator needs a cast, since K may not always be
+          // Comparable.
+          // Initializing _validKey shouldn't need a cast.  Currently
+          // it requires inference to work because of dartbug.com/23381
+          SplayTreeMap([int compare(K key1, K key2),
+                        bool isValidKey(potentialKey)]) {
+            : _comparator = /*warning:DownCastComposite*/(compare == null) ? Comparable.compare : compare,
+              _validKey = /*info:InferredType should be pass*/(isValidKey != null) ? isValidKey : ((v) => true);
+              _Predicate<Object> _v = /*warning:DownCastComposite*/(isValidKey != null) ? isValidKey : ((v) => true);
+              _v = /*info:InferredType should be pass*/(isValidKey != null) ? _v : ((v) => true);
+          }
+        }
+        void main() {
+          Object obj = 42;
+          dynamic dyn = 42;
+          int i = 42;
+
+          // Check the boolean conversion of the condition.
+          print((/*severe:StaticTypeError*/i) ? false : true);
+          print((/*info:DownCastImplicit*/obj) ? false : true);
+          print((/*info:DynamicCast*/dyn) ? false : true);
+        }
+      '''
+  });
+
+  testChecker('if/for/do/while statements use boolean conversion', {
+    '/main.dart': '''
+      main() {
+        dynamic d = 42;
+        Object obj = 42;
+        int i = 42;
+        bool b = false;
+
+        if (b) {}
+        if (/*info:DynamicCast*/dyn) {}
+        if (/*info:DownCastImplicit*/obj) {}
+        if (/*severe:StaticTypeError*/i) {}
+
+        while (b) {}
+        while (/*info:DynamicCast*/dyn) {}
+        while (/*info:DownCastImplicit*/obj) {}
+        while (/*severe:StaticTypeError*/i) {}
+
+        do {} while (b);
+        do {} while (/*info:DynamicCast*/dyn);
+        do {} while (/*info:DownCastImplicit*/obj);
+        do {} while (/*severe:StaticTypeError*/i);
+
+        for (;b;) {}
+        for (;/*info:DynamicCast*/dyn;) {}
+        for (;/*info:DownCastImplicit*/obj;) {}
+        for (;/*severe:StaticTypeError*/i;) {}
+      }
+    '''
+  });
+
+  testChecker('dynamic invocation', {
+    '/main.dart': '''
+
+      class A {
+        dynamic call(dynamic x) => x;
+      }
+      class B extends A {
+        int call(int x) => x;
+        double col(double x) => x;
+      }
+      void main() {
+        {
+          B f = new B();
+          int x;
+          double y;
+          // The analyzer has what I believe is a bug (dartbug.com/23252) which
+          // causes the return type of calls to f to be treated as dynamic.
+          x = /*info:DynamicCast should be pass*/f(3);
+          x = /*severe:StaticTypeError*/f.col(3.0);
+          y = /*info:DynamicCast should be severe:StaticTypeError*/f(3);
+          y = f.col(3.0);
+          f(/*severe:StaticTypeError*/3.0);
+          f.col(/*severe:StaticTypeError*/3);
+        }
+        {
+          Function f = new B();
+          int x;
+          double y;
+          x = /*info:DynamicCast, info:DynamicInvoke*/f(3);
+          x = /*info:DynamicCast, info:DynamicInvoke*/f.col(3.0);
+          y = /*info:DynamicCast, info:DynamicInvoke*/f(3);
+          y = /*info:DynamicCast, info:DynamicInvoke*/f.col(3.0);
+          (/*info:DynamicInvoke*/f(3.0));
+          (/*info:DynamicInvoke*/f.col(3));
+        }
+        {
+          A f = new B();
+          int x;
+          double y;
+          x = /*info:DynamicCast, info:DynamicInvoke*/f(3);
+          y = /*info:DynamicCast, info:DynamicInvoke*/f(3);
+          (/*info:DynamicInvoke*/f(3.0));
+        }
+      }
+    '''
+  });
+
+  testChecker('conversion and dynamic invoke', {
+    '/helper.dart': '''
+      dynamic toString = (int x) => x + 42;
+      dynamic hashCode = "hello";
+      ''',
+    '/main.dart': '''
+      import 'helper.dart' as helper;
+
+      class A {
+        String x = "hello world";
+
+        void baz1(y) => x + /*info:DynamicCast*/y;
+        static baz2(y) => /*info:DynamicInvoke*/y + y;
+      }
+
+      void foo(String str) {
+        print(str);
+      }
+
+      class B {
+        String toString([int arg]) => arg.toString();
+      }
+
+      void bar(a) {
+        foo(/*info:DynamicCast,info:DynamicInvoke*/a.x);
+      }
+
+      baz() => new B();
+
+      typedef DynFun(x);
+      typedef StrFun(String x);
+
+      var bar1 = bar;
+
+      void main() {
+        var a = new A();
+        bar(a);
+        (/*info:DynamicInvoke*/bar1(a));
+        var b = bar;
+        (/*info:DynamicInvoke*/b(a));
+        var f1 = foo;
+        f1("hello");
+        dynamic f2 = foo;
+        (/*info:DynamicInvoke*/f2("hello"));
+        DynFun f3 = foo;
+        (/*info:DynamicInvoke*/f3("hello"));
+        (/*info:DynamicInvoke*/f3(42));
+        StrFun f4 = foo;
+        f4("hello");
+        a.baz1("hello");
+        var b1 = a.baz1;
+        (/*info:DynamicInvoke*/b1("hello"));
+        A.baz2("hello");
+        var b2 = A.baz2;
+        (/*info:DynamicInvoke*/b2("hello"));
+
+        dynamic a1 = new B();
+        (/*info:DynamicInvoke*/a1.x);
+        a1.toString();
+        (/*info:DynamicInvoke*/a1.toString(42));
+        var toStringClosure = a1.toString;
+        (/*info:DynamicInvoke*/a1.toStringClosure());
+        (/*info:DynamicInvoke*/a1.toStringClosure(42));
+        (/*info:DynamicInvoke*/a1.toStringClosure("hello"));
+        a1.hashCode;
+
+        dynamic toString = () => null;
+        (/*info:DynamicInvoke*/toString());
+
+        (/*info:DynamicInvoke*/helper.toString());
+        var toStringClosure2 = helper.toString;
+        (/*info:DynamicInvoke*/toStringClosure2());
+        int hashCode = /*info:DynamicCast*/helper.hashCode;
+
+        baz().toString();
+        baz().hashCode;
+      }
+    '''
+  });
+
+  testChecker('Constructors', {
+    '/main.dart': '''
+      const num z = 25;
+      Object obj = "world";
+
+      class A {
+        int x;
+        String y;
+
+        A(this.x) : this.y = /*severe:StaticTypeError*/42;
+
+        A.c1(p): this.x = /*info:DownCastImplicit*/z, this.y = /*info:DynamicCast*/p;
+
+        A.c2(this.x, this.y);
+
+        A.c3(/*severe:InvalidParameterDeclaration*/num this.x, String this.y);
+      }
+
+      class B extends A {
+        B() : super(/*severe:StaticTypeError*/"hello");
+
+        B.c2(int x, String y) : super.c2(/*severe:StaticTypeError*/y, 
+                                         /*severe:StaticTypeError*/x);
+
+        B.c3(num x, Object y) : super.c3(x, /*info:DownCastImplicit*/y);
+      }
+
+      void main() {
+         A a = new A.c2(/*info:DownCastImplicit*/z, /*severe:StaticTypeError*/z);
+         var b = new B.c2(/*severe:StaticTypeError*/"hello", /*info:DownCastImplicit*/obj);
+      }
+   '''
+  });
+
+  testChecker('Unbound variable', {
+    '/main.dart': '''
+      void main() {
+         dynamic y = /*pass should be severe:StaticTypeError*/unboundVariable;
+      }
+   '''
+  });
+
+  testChecker('Unbound type name', {
+    '/main.dart': '''
+      void main() {
+         /*pass should be severe:StaticTypeError*/AToB y;
+      }
+   '''
+  });
+
+  testChecker('Ground type subtyping: dynamic is top', {
+    '/main.dart': '''
+
+      class A {}
+      class B extends A {}
+
+      void main() {
+         dynamic y;
+         Object o;
+         int i = 0;
+         double d = 0.0;
+         num n;
+         A a;
+         B b;
+         y = o;
+         y = i;
+         y = d;
+         y = n;
+         y = a;
+         y = b;
+      }
+   '''
+  });
+
+  testChecker('Ground type subtyping: dynamic downcasts', {
+    '/main.dart': '''
+
+      class A {}
+      class B extends A {}
+
+      void main() {
+         dynamic y;
+         Object o;
+         int i = 0;
+         double d = 0.0;
+         num n;
+         A a;
+         B b;
+         o = y;
+         i = /*info:DynamicCast*/y;
+         d = /*info:DynamicCast*/y;
+         n = /*info:DynamicCast*/y;
+         a = /*info:DynamicCast*/y;
+         b = /*info:DynamicCast*/y;
+      }
+   '''
+  });
+
+  testChecker('Ground type subtyping: assigning a class', {
+    '/main.dart': '''
+
+      class A {}
+      class B extends A {}
+
+      void main() {
+         dynamic y;
+         Object o;
+         int i = 0;
+         double d = 0.0;
+         num n;
+         A a;
+         B b;
+         y = a;
+         o = a;
+         i = /*severe:StaticTypeError*/a;
+         d = /*severe:StaticTypeError*/a;
+         n = /*severe:StaticTypeError*/a;
+         a = a;
+         b = /*info:DownCastImplicit*/a;
+      }
+   '''
+  });
+
+  testChecker('Ground type subtyping: assigning a subclass', {
+    '/main.dart': '''
+
+      class A {}
+      class B extends A {}
+      class C extends A {}
+
+      void main() {
+         dynamic y;
+         Object o;
+         int i = 0;
+         double d = 0.0;
+         num n;
+         A a;
+         B b;
+         C c;
+         y = b;
+         o = b;
+         i = /*severe:StaticTypeError*/b;
+         d = /*severe:StaticTypeError*/b;
+         n = /*severe:StaticTypeError*/b;
+         a = b;
+         b = b;
+         c = /*severe:StaticTypeError*/b;
+      }
+   '''
+  });
+
+  testChecker('Ground type subtyping: interfaces', {
+    '/main.dart': '''
+
+      class A {}
+      class B extends A {}
+      class C extends A {}
+      class D extends B implements C {}
+
+      void main() {
+         A top;
+         B left;
+         C right;
+         D bot;
+         {
+           top = top;
+           top = left;
+           top = right;
+           top = bot;
+         }
+         {
+           left = /*info:DownCastImplicit*/top;
+           left = left;
+           left = /*severe:StaticTypeError*/right;
+           left = bot;
+         }
+         {
+           right = /*info:DownCastImplicit*/top;
+           right = /*severe:StaticTypeError*/left;
+           right = right;
+           right = bot;
+         }
+         {
+           bot = /*info:DownCastImplicit*/top;
+           bot = /*info:DownCastImplicit*/left;
+           bot = /*info:DownCastImplicit*/right;
+           bot = bot;
+         }
+      }
+   '''
+  });
+
+  testChecker('Function typing and subtyping: int and object', {
+    '/main.dart': '''
+
+      typedef Object Top(int x);      // Top of the lattice
+      typedef int Left(int x);        // Left branch
+      typedef int Left2(int x);       // Left branch
+      typedef Object Right(Object x); // Right branch
+      typedef int Bot(Object x);      // Bottom of the lattice
+
+      Object top(int x) => x;
+      int left(int x) => x;
+      Object right(Object x) => x;
+      int _bot(Object x) => /*info:DownCastImplicit*/x;
+      int bot(Object x) => x as int;
+
+      void main() {
+        { // Check typedef equality
+          Left f = left;
+          Left2 g = f;
+        }
+        {
+          Top f;
+          f = top;
+          f = left;
+          f = right;
+          f = bot;
+        }
+        {
+          Left f;
+          f = /*warning:DownCastComposite*/top;
+          f = left;
+          f = /*warning:DownCastComposite*/right; // Should we reject this?
+          f = bot;
+        }
+        {
+          Right f;
+          f = /*warning:DownCastComposite*/top;
+          f = /*warning:DownCastComposite*/left; // Should we reject this?
+          f = right;
+          f = bot;
+        }
+        {
+          Bot f;
+          f = /*warning:DownCastComposite*/top;
+          f = /*warning:DownCastComposite*/left;
+          f = /*warning:DownCastComposite*/right;
+          f = bot;
+        }
+      }
+   '''
+  });
+
+  testChecker('Function typing and subtyping: classes', {
+    '/main.dart': '''
+
+      class A {}
+      class B extends A {}
+
+      typedef A Top(B x);   // Top of the lattice
+      typedef B Left(B x);  // Left branch
+      typedef B Left2(B x); // Left branch
+      typedef A Right(A x); // Right branch
+      typedef B Bot(A x);   // Bottom of the lattice
+
+      B left(B x) => x;
+      B _bot(A x) => /*info:DownCastImplicit*/x;
+      B bot(A x) => x as B;
+      A top(B x) => x;
+      A right(A x) => x;
+
+      void main() {
+        { // Check typedef equality
+          Left f = left;
+          Left2 g = f;
+        }
+        {
+          Top f;
+          f = top;
+          f = left;
+          f = right;
+          f = bot;
+        }
+        {
+          Left f;
+          f = /*warning:DownCastComposite*/top;
+          f = left;
+          f = /*warning:DownCastComposite*/right; // Should we reject this?
+          f = bot;
+        }
+        {
+          Right f;
+          f = /*warning:DownCastComposite*/top;
+          f = /*warning:DownCastComposite*/left; // Should we reject this?
+          f = right;
+          f = bot;
+        }
+        {
+          Bot f;
+          f = /*warning:DownCastComposite*/top;
+          f = /*warning:DownCastComposite*/left;
+          f = /*warning:DownCastComposite*/right;
+          f = bot;
+        }
+      }
+   '''
+  });
+
+  testChecker('Function typing and subtyping: dynamic', {
+    '/main.dart': '''
+
+      class A {}
+
+      typedef dynamic Top(dynamic x);     // Top of the lattice
+      typedef dynamic Left(A x);          // Left branch
+      typedef A Right(dynamic x);         // Right branch
+      typedef A Bottom(A x);              // Bottom of the lattice
+
+      dynamic left(A x) => x;
+      A bot(A x) => x;
+      dynamic top(dynamic x) => x;
+      A right(dynamic x) => /*info:DynamicCast*/x;
+
+      void main() {
+        {
+          Top f;
+          f = top;
+          f = left;
+          f = right;
+          f = bot;
+        }
+        {
+          Left f;
+          f = /*warning:DownCastComposite*/top;
+          f = left;
+          f = /*warning:DownCastComposite*/right;
+          f = bot;
+        }
+        {
+          Right f;
+          f = /*warning:DownCastComposite*/top;
+          f = /*warning:DownCastComposite*/left;
+          f = right;
+          f = bot;
+        }
+        {
+          Bottom f;
+          f = /*warning:DownCastComposite*/top;
+          f = /*warning:DownCastComposite*/left;
+          f = /*warning:DownCastComposite*/right;
+          f = bot;
+        }
+      }
+   '''
+  });
+
+  testChecker('Function typing and subtyping: function literal variance', {
+    '/main.dart': '''
+
+      class A {}
+      class B extends A {}
+
+      typedef T Function2<S, T>(S z);
+
+      A top(B x) => x;
+      B left(B x) => x;
+      A right(A x) => x;
+      B bot(A x) => x as B;
+
+      void main() {
+        {
+          Function2<B, A> f;
+          f = top;
+          f = left;
+          f = right;
+          f = bot;
+        }
+        {
+          Function2<B, B> f;
+          f = /*warning:DownCastComposite*/top;
+          f = left;
+          f = /*warning:DownCastComposite*/right; // Should we reject this?
+          f = bot;
+        }
+        {
+          Function2<A, A> f;
+          f = /*warning:DownCastComposite*/top;
+          f = /*warning:DownCastComposite*/left; // Should we reject this?
+          f = right;
+          f = bot;
+        }
+        {
+          Function2<A, B> f;
+          f = /*warning:DownCastComposite*/top;
+          f = /*warning:DownCastComposite*/left;
+          f = /*warning:DownCastComposite*/right;
+          f = bot;
+        }
+      }
+   '''
+  });
+
+  testChecker('Function typing and subtyping: function variable variance', {
+    '/main.dart': '''
+
+      class A {}
+      class B extends A {}
+
+      typedef T Function2<S, T>(S z);
+
+      void main() {
+        {
+          Function2<B, A> top;
+          Function2<B, B> left;
+          Function2<A, A> right;
+          Function2<A, B> bot;
+
+          top = right;
+          top = bot;
+          top = top;
+          top = left;
+
+          left = /*warning:DownCastComposite*/top;
+          left = left;
+          left = /*warning:DownCastComposite*/right; // Should we reject this?
+          left = bot;
+
+          right = /*warning:DownCastComposite*/top;
+          right = /*warning:DownCastComposite*/left; // Should we reject this?
+          right = right;
+          right = bot;
+
+          bot = /*warning:DownCastComposite*/top;
+          bot = /*warning:DownCastComposite*/left;
+          bot = /*warning:DownCastComposite*/right;
+          bot = bot;
+        }
+      }
+   '''
+  });
+
+  testChecker('Function typing and subtyping: higher order function literals', {
+    '/main.dart': '''
+
+      class A {}
+      class B extends A {}
+
+      typedef T Function2<S, T>(S z);
+
+      typedef A BToA(B x);  // Top of the base lattice
+      typedef B AToB(A x);  // Bot of the base lattice
+
+      BToA top(AToB f) => f;
+      AToB left(AToB f) => f;
+      BToA right(BToA f) => f;
+      AToB _bot(BToA f) => /*warning:DownCastComposite*/f;
+      AToB bot(BToA f) => f as AToB;
+
+      Function2<B, A> top(AToB f) => f;
+      Function2<A, B> left(AToB f) => f;
+      Function2<B, A> right(BToA f) => f;
+      Function2<A, B> _bot(BToA f) => /*warning:DownCastComposite*/f;
+      Function2<A, B> bot(BToA f) => f as Function2<A, B>;
+
+
+      BToA top(Function2<A, B> f) => f;
+      AToB left(Function2<A, B> f) => f;
+      BToA right(Function2<B, A> f) => f;
+      AToB _bot(Function2<B, A> f) => /*warning:DownCastComposite*/f;
+      AToB bot(Function2<B, A> f) => f as AToB;
+
+      void main() {
+        {
+          Function2<AToB, BToA> f; // Top
+          f = top;
+          f = left;
+          f = right;
+          f = bot;
+        }
+        {
+          Function2<AToB, AToB> f; // Left
+          f = /*warning:DownCastComposite*/top;
+          f = left;
+          f = /*warning:DownCastComposite*/right; // Should we reject this?
+          f = bot;
+        }
+        {
+          Function2<BToA, BToA> f; // Right
+          f = /*warning:DownCastComposite*/top;
+          f = /*warning:DownCastComposite*/left; // Should we reject this?
+          f = right;
+          f = bot;
+        }
+        {
+          Function2<BToA, AToB> f; // Bot
+          f = bot;
+          f = /*warning:DownCastComposite*/left;
+          f = /*warning:DownCastComposite*/top;
+          f = /*warning:DownCastComposite*/left;
+        }
+      }
+   '''
+  });
+
+  testChecker(
+      'Function typing and subtyping: higher order function variables', {
+    '/main.dart': '''
+
+    class A {}
+    class B extends A {}
+
+    typedef T Function2<S, T>(S z);
+
+    void main() {
+      {
+        Function2<Function2<A, B>, Function2<B, A>> top;
+        Function2<Function2<B, A>, Function2<B, A>> right;
+        Function2<Function2<A, B>, Function2<A, B>> left;
+        Function2<Function2<B, A>, Function2<A, B>> bot;
+
+        top = right;
+        top = bot;
+        top = top;
+        top = left;
+
+        left = /*warning:DownCastComposite*/top;
+        left = left;
+        left =
+            /*warning:DownCastComposite should be severe:StaticTypeError*/right;
+        left = bot;
+
+        right = /*warning:DownCastComposite*/top;
+        right =
+            /*warning:DownCastComposite should be severe:StaticTypeError*/left;
+        right = right;
+        right = bot;
+
+        bot = /*warning:DownCastComposite*/top;
+        bot = /*warning:DownCastComposite*/left;
+        bot = /*warning:DownCastComposite*/right;
+        bot = bot;
+      }
+    }
+   '''
+  });
+
+  testChecker('Function typing and subtyping: named and optional parameters', {
+    '/main.dart': '''
+
+      class A {}
+
+      typedef A FR(A x);
+      typedef A FO([A x]);
+      typedef A FN({A x});
+      typedef A FRR(A x, A y);
+      typedef A FRO(A x, [A y]);
+      typedef A FRN(A x, {A n});
+      typedef A FOO([A x, A y]);
+      typedef A FNN({A x, A y});
+      typedef A FNNN({A z, A y, A x});
+
+      void main() {
+         FR r;
+         FO o;
+         FN n;
+         FRR rr;
+         FRO ro;
+         FRN rn;
+         FOO oo;
+         FNN nn;
+         FNNN nnn;
+
+         r = r;
+         r = o;
+         r = /*severe:StaticTypeError*/n;
+         r = /*severe:StaticTypeError*/rr;
+         r = ro;
+         r = rn;
+         r = oo;
+         r = /*severe:StaticTypeError*/nn;
+         r = /*severe:StaticTypeError*/nnn;
+
+         o = /*warning:DownCastComposite*/r;
+         o = o;
+         o = /*severe:StaticTypeError*/n;
+         o = /*severe:StaticTypeError*/rr;
+         o = /*severe:StaticTypeError*/ro;
+         o = /*severe:StaticTypeError*/rn;
+         o = oo;
+         o = /*severe:StaticTypeError*/nn
+         o = /*severe:StaticTypeError*/nnn;
+
+         n = /*severe:StaticTypeError*/r;
+         n = /*severe:StaticTypeError*/o;
+         n = n;
+         n = /*severe:StaticTypeError*/rr;
+         n = /*severe:StaticTypeError*/ro;
+         n = /*severe:StaticTypeError*/rn;
+         n = /*severe:StaticTypeError*/oo;
+         n = nn;
+         n = nnn;
+
+         rr = /*severe:StaticTypeError*/r;
+         rr = /*severe:StaticTypeError*/o;
+         rr = /*severe:StaticTypeError*/n;
+         rr = rr;
+         rr = ro;
+         rr = /*severe:StaticTypeError*/rn;
+         rr = oo;
+         rr = /*severe:StaticTypeError*/nn;
+         rr = /*severe:StaticTypeError*/nnn;
+
+         ro = /*warning:DownCastComposite*/r;
+         ro = /*severe:StaticTypeError*/o;
+         ro = /*severe:StaticTypeError*/n;
+         ro = /*warning:DownCastComposite*/rr;
+         ro = ro;
+         ro = /*severe:StaticTypeError*/rn;
+         ro = oo;
+         ro = /*severe:StaticTypeError*/nn;
+         ro = /*severe:StaticTypeError*/nnn;
+
+         rn = /*warning:DownCastComposite*/r;
+         rn = /*severe:StaticTypeError*/o;
+         rn = /*severe:StaticTypeError*/n;
+         rn = /*severe:StaticTypeError*/rr;
+         rn = /*severe:StaticTypeError*/ro;
+         rn = rn;
+         rn = /*severe:StaticTypeError*/oo;
+         rn = /*severe:StaticTypeError*/nn;
+         rn = /*severe:StaticTypeError*/nnn;
+
+         oo = /*warning:DownCastComposite*/r;
+         oo = /*warning:DownCastComposite*/o;
+         oo = /*severe:StaticTypeError*/n;
+         oo = /*warning:DownCastComposite*/rr;
+         oo = /*warning:DownCastComposite*/ro;
+         oo = /*severe:StaticTypeError*/rn;
+         oo = oo;
+         oo = /*severe:StaticTypeError*/nn;
+         oo = /*severe:StaticTypeError*/nnn;
+
+         nn = /*severe:StaticTypeError*/r;
+         nn = /*severe:StaticTypeError*/o;
+         nn = /*warning:DownCastComposite*/n;
+         nn = /*severe:StaticTypeError*/rr;
+         nn = /*severe:StaticTypeError*/ro;
+         nn = /*severe:StaticTypeError*/rn;
+         nn = /*severe:StaticTypeError*/oo;
+         nn = nn;
+         nn = nnn;
+
+         nnn = /*severe:StaticTypeError*/r;
+         nnn = /*severe:StaticTypeError*/o;
+         nnn = /*warning:DownCastComposite*/n;
+         nnn = /*severe:StaticTypeError*/rr;
+         nnn = /*severe:StaticTypeError*/ro;
+         nnn = /*severe:StaticTypeError*/rn;
+         nnn = /*severe:StaticTypeError*/oo;
+         nnn = /*warning:DownCastComposite*/nn;
+         nnn = nnn;
+      }
+   '''
+  });
+
+  testChecker('Function subtyping: objects with call methods', {
+    '/main.dart': '''
+
+      typedef int I2I(int x);
+      typedef num N2N(num x);
+      class A {
+         int call(int x) => x;
+      }
+      class B {
+         num call(num x) => x;
+      }
+      int i2i(int x) => x;
+      num n2n(num x) => x;
+      void main() {
+         {
+           I2I f;
+           f = new A();
+           f = /*severe:StaticTypeError*/new B();
+           f = i2i;
+           f = /*warning:DownCastComposite*/n2n;
+           f = /*warning:DownCastComposite*/i2i as Object;
+           f = /*warning:DownCastComposite*/n2n as Function;
+         }
+         {
+           N2N f;
+           f = /*severe:StaticTypeError*/new A();
+           f = new B();
+           f = /*warning:DownCastComposite*/i2i;
+           f = n2n;
+           f = /*warning:DownCastComposite*/i2i as Object;
+           f = /*warning:DownCastComposite*/n2n as Function;
+         }
+         {
+           A f;
+           f = new A();
+           f = /*severe:StaticTypeError*/new B();
+           f = /*severe:StaticTypeError*/i2i;
+           f = /*severe:StaticTypeError*/n2n;
+           f = /*info:DownCastImplicit*/i2i as Object;
+           f = /*info:DownCastImplicit*/n2n as Function;
+         }
+         {
+           B f;
+           f = /*severe:StaticTypeError*/new A();
+           f = new B();
+           f = /*severe:StaticTypeError*/i2i;
+           f = /*severe:StaticTypeError*/n2n;
+           f = /*info:DownCastImplicit*/i2i as Object;
+           f = /*info:DownCastImplicit*/n2n as Function;
+         }
+         {
+           Function f;
+           f = new A();
+           f = new B();
+           f = i2i;
+           f = n2n;
+           f = /*info:DownCastImplicit*/i2i as Object;
+           f = (n2n as Function);
+         }
+      }
+   '''
+  });
+
+  testChecker('Function typing and subtyping: void', {
+    '/main.dart': '''
+
+      class A {
+        void bar() => null;
+        void foo() => bar; // allowed
+      }
+   '''
+  });
+
+  testChecker('Relaxed casts', {
+    '/main.dart': '''
+
+      class A {}
+
+      class L<T> {}
+      class M<T> extends L<T> {}
+      //     L<dynamic|Object>
+      //    /              \
+      // M<dynamic|Object>  L<A>
+      //    \              /
+      //          M<A>
+      // In normal Dart, there are additional edges
+      //  from M<A> to M<dynamic>
+      //  from L<A> to M<dynamic>
+      //  from L<A> to L<dynamic>
+      void main() {
+        L lOfDs;
+        L<Object> lOfOs;
+        L<A> lOfAs;
+
+        M mOfDs;
+        M<Object> mOfOs;
+        M<A> mOfAs;
+
+        {
+          lOfDs = mOfDs;
+          lOfDs = mOfOs;
+          lOfDs = mOfAs;
+          lOfDs = lOfDs;
+          lOfDs = lOfOs;
+          lOfDs = lOfAs;
+        }
+        {
+          lOfOs = mOfDs;
+          lOfOs = mOfOs;
+          lOfOs = mOfAs;
+          lOfOs = lOfDs;
+          lOfOs = lOfOs;
+          lOfOs = lOfAs;
+        }
+        {
+          lOfAs = /*warning:DownCastComposite*/mOfDs;
+          lOfAs = /*severe:StaticTypeError*/mOfOs;
+          lOfAs = mOfAs;
+          lOfAs = /*warning:DownCastComposite*/lOfDs;
+          lOfAs = /*info:DownCastImplicit*/lOfOs;
+          lOfAs = lOfAs;
+        }
+        {
+          mOfDs = mOfDs;
+          mOfDs = mOfOs;
+          mOfDs = mOfAs;
+          mOfDs = /*info:DownCastImplicit*/lOfDs;
+          mOfDs = /*info:DownCastImplicit*/lOfOs;
+          mOfDs = /*warning:DownCastComposite*/lOfAs;
+        }
+        {
+          mOfOs = mOfDs;
+          mOfOs = mOfOs;
+          mOfOs = mOfAs;
+          mOfOs = /*info:DownCastImplicit*/lOfDs;
+          mOfOs = /*info:DownCastImplicit*/lOfOs;
+          mOfOs = /*severe:StaticTypeError*/lOfAs;
+        }
+        {
+          mOfAs = /*warning:DownCastComposite*/mOfDs;
+          mOfAs = /*info:DownCastImplicit*/mOfOs;
+          mOfAs = mOfAs;
+          mOfAs = /*warning:DownCastComposite*/lOfDs;
+          mOfAs = /*info:DownCastImplicit*/lOfOs;
+          mOfAs = /*info:DownCastImplicit*/lOfAs;
+        }
+
+      }
+   '''
+  });
+
+  testChecker('Type checking literals', {
+    '/main.dart': '''
+          test() {
+            num n = 3;
+            int i = 3;
+            String s = "hello";
+            {
+               List<int> l = <int>[i];
+               l = <int>[/*severe:StaticTypeError*/s];
+               l = <int>[/*info:DownCastImplicit*/n];
+               l = <int>[i, /*info:DownCastImplicit*/n, /*severe:StaticTypeError*/s];
+            }
+            {
+               List l = [i];
+               l = [s];
+               l = [n];
+               l = [i, n, s];
+            }
+            {
+               Map<String, int> m = <String, int>{s: i};
+               m = <String, int>{s: /*severe:StaticTypeError*/s};
+               m = <String, int>{s: /*info:DownCastImplicit*/n};
+               m = <String, int>{s: i,
+                                 s: /*info:DownCastImplicit*/n,
+                                 s: /*severe:StaticTypeError*/s};
+            }
+           // TODO(leafp): We can't currently test for key errors since the
+           // error marker binds to the entire entry.
+            {
+               Map m = {s: i};
+               m = {s: s};
+               m = {s: n};
+               m = {s: i,
+                    s: n,
+                    s: s};
+               m = {i: s,
+                    n: s,
+                    s: s};
+            }
+          }
+   '''
+  });
+
+  testChecker('casts in constant contexts', {
+    '/main.dart': '''
+          class A {
+            static const num n = 3.0;
+            static const int i = /*info:AssignmentCast*/n;
+            final int fi;
+            const A(num a) : this.fi = /*info:DownCastImplicit*/a;
+          }
+          class B extends A {
+            const B(Object a) : super(/*info:DownCastImplicit*/a);
+          }
+          void foo(Object o) {
+            var a = const A(/*info:DownCastImplicit*/o);
+          }
+     '''
+  });
+
+  testChecker('casts in conditionals', {
+    '/main.dart': '''
+          main() {
+            bool b = true;
+            num x = b ? 1 : 2.3;
+            int y = /*info:AssignmentCast*/b ? 1 : 2.3;
+            String z = !b ? "hello" : null;
+            z = b ? null : "hello";
+          }
+      '''
+  });
+
+  testChecker('redirecting constructor', {
+    '/main.dart': '''
+          class A {
+            A(A x) {}
+            A.two() : this(/*severe:StaticTypeError*/3);
+          }
+       '''
+  });
+
+  testChecker('super constructor', {
+    '/main.dart': '''
+          class A { A(A x) {} }
+          class B extends A {
+            B() : super(/*severe:StaticTypeError*/3);
+          }
+       '''
+  });
+
+  testChecker('field/field override', {
+    '/main.dart': '''
+          class A {}
+          class B extends A {}
+          class C extends B {}
+
+          class Base {
+            B f1;
+            B f2;
+            B f3;
+            B f4;
+          }
+
+          class Child extends Base {
+            /*severe:InvalidMethodOverride*/A f1; // invalid for getter
+            /*severe:InvalidMethodOverride*/C f2; // invalid for setter
+            var f3;
+            /*severe:InvalidMethodOverride,severe:InvalidMethodOverride*/dynamic f4;
+          }
+       '''
+  });
+
+  testChecker('getter/getter override', {
+    '/main.dart': '''
+          class A {}
+          class B extends A {}
+          class C extends B {}
+
+          abstract class Base {
+            B get f1;
+            B get f2;
+            B get f3;
+            B get f4;
+          }
+
+          class Child extends Base {
+            /*severe:InvalidMethodOverride*/A get f1 => null;
+            C get f2 => null;
+            get f3 => null;
+            /*severe:InvalidMethodOverride*/dynamic get f4 => null;
+          }
+       '''
+  });
+
+  testChecker('field/getter override', {
+    '/main.dart': '''
+          class A {}
+          class B extends A {}
+          class C extends B {}
+
+          abstract class Base {
+            B f1;
+            B f2;
+            B f3;
+            B f4;
+          }
+
+          class Child extends Base {
+            /*severe:InvalidMethodOverride*/A get f1 => null;
+            C get f2 => null;
+            get f3 => null;
+            /*severe:InvalidMethodOverride*/dynamic get f4 => null;
+          }
+       '''
+  });
+
+  testChecker('setter/setter override', {
+    '/main.dart': '''
+          class A {}
+          class B extends A {}
+          class C extends B {}
+
+          abstract class Base {
+            void set f1(B value);
+            void set f2(B value);
+            void set f3(B value);
+            void set f4(B value);
+            void set f5(B value);
+          }
+
+          class Child extends Base {
+            void set f1(A value) {}
+            /*severe:InvalidMethodOverride*/void set f2(C value) {}
+            void set f3(value) {}
+            /*severe:InvalidMethodOverride*/void set f4(dynamic value) {}
+            set f5(B value) {}
+          }
+       '''
+  });
+
+  testChecker('field/setter override', {
+    '/main.dart': '''
+          class A {}
+          class B extends A {}
+          class C extends B {}
+
+          class Base {
+            B f1;
+            B f2;
+            B f3;
+            B f4;
+            B f5;
+          }
+
+          class Child extends Base {
+            B get f1 => null;
+            B get f2 => null;
+            B get f3 => null;
+            B get f4 => null;
+            B get f5 => null;
+
+            void set f1(A value) {}
+            /*severe:InvalidMethodOverride*/void set f2(C value) {}
+            void set f3(value) {}
+            /*severe:InvalidMethodOverride*/void set f4(dynamic value) {}
+            set f5(B value) {}
+          }
+       '''
+  });
+
+  testChecker('method override', {
+    '/main.dart': '''
+          class A {}
+          class B extends A {}
+          class C extends B {}
+
+          class Base {
+            B m1(B a);
+            B m2(B a);
+            B m3(B a);
+            B m4(B a);
+            B m5(B a);
+            B m6(B a);
+          }
+
+          class Child extends Base {
+            /*severe:InvalidMethodOverride*/A m1(A value) {}
+            /*severe:InvalidMethodOverride*/C m2(C value) {}
+            /*severe:InvalidMethodOverride*/A m3(C value) {}
+            C m4(A value) {}
+            m5(value) {}
+            /*severe:InvalidMethodOverride*/dynamic m6(dynamic value) {}
+          }
+       '''
+  });
+
+  testChecker('unary operators', {
+    '/main.dart': '''
+      class A {
+        A operator ~() {}
+        A operator +(int x) {}
+        A operator -(int x) {}
+        A operator -() {}
+      }
+
+      foo() => new A();
+
+      test() {
+        A a = new A();
+        var c = foo();
+
+        ~a;
+        (/*info:DynamicInvoke*/~d);
+
+        !/*severe:StaticTypeError*/a;
+        !/*info:DynamicCast*/d;
+
+        -a;
+        (/*info:DynamicInvoke*/-d);
+
+        ++a;
+        --a;
+        (/*info:DynamicInvoke*/++d);
+        (/*info:DynamicInvoke*/--d);
+
+        a++;
+        a--;
+        (/*info:DynamicInvoke*/d++);
+        (/*info:DynamicInvoke*/d--);
+      }'''
+  });
+
+  testChecker('binary and index operators', {
+    '/main.dart': '''
+          class A {
+            A operator *(B b) {}
+            A operator /(B b) {}
+            A operator ~/(B b) {}
+            A operator %(B b) {}
+            A operator +(B b) {}
+            A operator -(B b) {}
+            A operator <<(B b) {}
+            A operator >>(B b) {}
+            A operator &(B b) {}
+            A operator ^(B b) {}
+            A operator |(B b) {}
+            A operator[](B b) {}
+          }
+
+          class B {
+            A operator -(B b) {}
+          }
+
+          foo() => new A();
+
+          test() {
+            A a = new A();
+            B b = new B();
+            var c = foo();
+            a = a * b;
+            a = a * /*info:DynamicCast*/c;
+            a = a / b;
+            a = a ~/ b;
+            a = a % b;
+            a = a + b;
+            a = a + /*severe:StaticTypeError*/a;
+            a = a - b;
+            b = /*severe:StaticTypeError*/b - b;
+            a = a << b;
+            a = a >> b;
+            a = a & b;
+            a = a ^ b;
+            a = a | b;
+            c = (/*info:DynamicInvoke*/c + b);
+
+            String x = 'hello';
+            int y = 42;
+            x = x + x;
+            x = x + /*info:DynamicCast*/c;
+            x = x + /*severe:StaticTypeError*/y;
+
+            bool p = true;
+            p = p && p;
+            p = p && /*info:DynamicCast*/c;
+            p = (/*info:DynamicCast*/c) && p;
+            p = (/*info:DynamicCast*/c) && /*info:DynamicCast*/c;
+            p = (/*severe:StaticTypeError*/y) && p;
+            p = c == y;
+
+            a = a[b];
+            a = a[/*info:DynamicCast*/c];
+            c = (/*info:DynamicInvoke*/c[b]);
+            a[/*severe:StaticTypeError*/y];
+          }
+       '''
+  });
+
+  testChecker('compound assignments', {
+    '/main.dart': '''
+          class A {
+            A operator *(B b) {}
+            A operator /(B b) {}
+            A operator ~/(B b) {}
+            A operator %(B b) {}
+            A operator +(B b) {}
+            A operator -(B b) {}
+            A operator <<(B b) {}
+            A operator >>(B b) {}
+            A operator &(B b) {}
+            A operator ^(B b) {}
+            A operator |(B b) {}
+            D operator [](B index) {}
+            void operator []=(B index, D value) {}
+          }
+
+          class B {
+            A operator -(B b) {}
+          }
+
+          class D {
+            D operator +(D d) {}
+          }
+
+          foo() => new A();
+
+          test() {
+            int x = 0;
+            x += 5;
+            (/*severe:StaticTypeError*/x += 3.14);
+
+            double y = 0.0;
+            y += 5;
+            y += 3.14;
+
+            num z = 0;
+            z += 5;
+            z += 3.14;
+
+            x = /*info:DownCastImplicit*/x + z;
+            x += /*info:DownCastImplicit*/z;
+            y = /*info:DownCastImplicit*/y + z;
+            y += /*info:DownCastImplicit*/z;
+
+            dynamic w = 42;
+            x += /*info:DynamicCast*/w;
+            y += /*info:DynamicCast*/w;
+            z += /*info:DynamicCast*/w;
+
+            A a = new A();
+            B b = new B();
+            var c = foo();
+            a = a * b;
+            a *= b;
+            a *= /*info:DynamicCast*/c;
+            a /= b;
+            a ~/= b;
+            a %= b;
+            a += b;
+            a += /*severe:StaticTypeError*/a;
+            a -= b;
+            (/*severe:StaticTypeError*/b -= b);
+            a <<= b;
+            a >>= b;
+            a &= b;
+            a ^= b;
+            a |= b;
+            (/*info:DynamicInvoke*/c += b);
+
+            var d = new D();
+            a[b] += d;
+            a[/*info:DynamicCast*/c] += d;
+            a[/*severe:StaticTypeError*/z] += d;
+            a[b] += /*info:DynamicCast*/c;
+            a[b] += /*severe:StaticTypeError*/z;
+            (/*info:DynamicInvoke*/(/*info:DynamicInvoke*/c[b]) += d);
+          }
+       '''
+  });
+
+  testChecker('super call placement', {
+    '/main.dart': '''
+          class Base {
+            var x;
+            Base() : x = print('Base.1') { print('Base.2'); }
+          }
+
+          class Derived extends Base {
+            var y, z;
+            Derived()
+                : y = print('Derived.1'),
+                  /*severe:InvalidSuperInvocation*/super(),
+                  z = print('Derived.2') {
+              print('Derived.3');
+            }
+          }
+
+          class Valid extends Base {
+            var y, z;
+            Valid()
+                : y = print('Valid.1'),
+                  z = print('Valid.2'),
+                  super() {
+              print('Valid.3');
+            }
+          }
+
+          class AlsoValid extends Base {
+            AlsoValid() : super();
+          }
+
+          main() => new Derived();
+       '''
+  });
+
+  testChecker('for loop variable', {
+    '/main.dart': '''
+          foo() {
+            for (int i = 0; i < 10; i++) {
+              i = /*severe:StaticTypeError*/"hi";
+            }
+          }
+          bar() {
+            for (var i = 0; i < 10; i++) {
+              int j = i + 1;
+            }
+          }
+        '''
+  });
+
+  group('invalid overrides', () {
+    testChecker('child override', {
+      '/main.dart': '''
+            class A {}
+            class B {}
+
+            class Base {
+                A f;
+            }
+
+            class T1 extends Base {
+              /*severe:InvalidMethodOverride*/B get f => null;
+            }
+
+            class T2 extends Base {
+              /*severe:InvalidMethodOverride*/set f(B b) => null;
+            }
+
+            class T3 extends Base {
+              /*severe:InvalidMethodOverride*/final B f;
+            }
+            class T4 extends Base {
+              // two: one for the getter one for the setter.
+              /*severe:InvalidMethodOverride,severe:InvalidMethodOverride*/B f;
+            }
+         '''
+    });
+
+    testChecker('child override 2', {
+      '/main.dart': '''
+            class A {}
+            class B {}
+
+            class Base {
+                m(A a) {}
+            }
+
+            class Test extends Base {
+                /*severe:InvalidMethodOverride*/m(B a) {}
+            }
+         '''
+    });
+    testChecker('grandchild override', {
+      '/main.dart': '''
+            class A {}
+            class B {}
+
+            class Grandparent {
+                m(A a) {}
+            }
+            class Parent extends Grandparent {
+            }
+
+            class Test extends Parent {
+                /*severe:InvalidMethodOverride*/m(B a) {}
+            }
+         '''
+    });
+
+    testChecker('double override', {
+      '/main.dart': '''
+            class A {}
+            class B {}
+
+            class Grandparent {
+                m(A a) {}
+            }
+            class Parent extends Grandparent {
+                m(A a) {}
+            }
+
+            class Test extends Parent {
+                // Reported only once
+                /*severe:InvalidMethodOverride*/m(B a) {}
+            }
+         '''
+    });
+
+    testChecker('double override 2', {
+      '/main.dart': '''
+            class A {}
+            class B {}
+
+            class Grandparent {
+                m(A a) {}
+            }
+            class Parent extends Grandparent {
+                /*severe:InvalidMethodOverride*/m(B a) {}
+            }
+
+            class Test extends Parent {
+                m(B a) {}
+            }
+         '''
+    });
+
+    testChecker('mixin override to base', {
+      '/main.dart': '''
+            class A {}
+            class B {}
+
+            class Base {
+                m(A a) {}
+            }
+
+            class M1 {
+                m(B a) {}
+            }
+
+            class M2 {}
+
+            class T1 extends Base with /*severe:InvalidMethodOverride*/M1 {}
+            class T2 extends Base with /*severe:InvalidMethodOverride*/M1, M2 {}
+            class T3 extends Base with M2, /*severe:InvalidMethodOverride*/M1 {}
+         '''
+    });
+
+    testChecker('mixin override to mixin', {
+      '/main.dart': '''
+            class A {}
+            class B {}
+
+            class Base {
+            }
+
+            class M1 {
+                m(B a) {}
+            }
+
+            class M2 {
+                m(A a) {}
+            }
+
+            class T1 extends Base with M1, /*severe:InvalidMethodOverride*/M2 {}
+         '''
+    });
+
+    // This is a regression test for a bug in an earlier implementation were
+    // names were hiding errors if the first mixin override looked correct,
+    // but subsequent ones did not.
+    testChecker('no duplicate mixin override', {
+      '/main.dart': '''
+            class A {}
+            class B {}
+
+            class Base {
+                m(A a) {}
+            }
+
+            class M1 {
+                m(A a) {}
+            }
+
+            class M2 {
+                m(B a) {}
+            }
+
+            class M3 {
+                m(B a) {}
+            }
+
+            class T1 extends Base
+                with M1, /*severe:InvalidMethodOverride*/M2, M3 {}
+         '''
+    });
+
+    testChecker('class override of interface', {
+      '/main.dart': '''
+            class A {}
+            class B {}
+
+            abstract class I {
+                m(A a);
+            }
+
+            class T1 implements I {
+                /*severe:InvalidMethodOverride*/m(B a) {}
+            }
+         '''
+    });
+
+    testChecker('base class override to child interface', {
+      '/main.dart': '''
+            class A {}
+            class B {}
+
+            abstract class I {
+                m(A a);
+            }
+
+            class Base {
+                m(B a) {}
+            }
+
+
+            class T1 /*severe:InvalidMethodOverride*/extends Base implements I {
+            }
+         '''
+    });
+
+    testChecker('mixin override of interface', {
+      '/main.dart': '''
+            class A {}
+            class B {}
+
+            abstract class I {
+                m(A a);
+            }
+
+            class M {
+                m(B a) {}
+            }
+
+            class T1 extends Object with /*severe:InvalidMethodOverride*/M
+               implements I {}
+         '''
+    });
+
+    // This is a case were it is incorrect to say that the base class
+    // incorrectly overrides the interface.
+    testChecker(
+        'no errors if subclass correctly overrides base and interface', {
+      '/main.dart': '''
+            class A {}
+            class B {}
+
+            class Base {
+                m(A a) {}
+            }
+
+            class I1 {
+                m(B a) {}
+            }
+
+            class T1 /*severe:InvalidMethodOverride*/extends Base
+                implements I1 {}
+
+            class T2 extends Base implements I1 {
+                /*severe:InvalidMethodOverride,severe:InvalidMethodOverride*/m(a) {}
+            }
+
+            class T3 extends Object with /*severe:InvalidMethodOverride*/Base
+                implements I1 {}
+
+            class T4 extends Object with Base implements I1 {
+                /*severe:InvalidMethodOverride,severe:InvalidMethodOverride*/m(a) {}
+            }
+         '''
+    });
+  });
+
+  group('class override of grand interface', () {
+    testChecker('interface of interface of child', {
+      '/main.dart': '''
+              class A {}
+              class B {}
+
+              abstract class I1 {
+                  m(A a);
+              }
+              abstract class I2 implements I1 {}
+
+              class T1 implements I2 {
+                  /*severe:InvalidMethodOverride*/m(B a) {}
+              }
+           '''
+    });
+    testChecker('superclass of interface of child', {
+      '/main.dart': '''
+              class A {}
+              class B {}
+
+              abstract class I1 {
+                  m(A a);
+              }
+              abstract class I2 extends I1 {}
+
+              class T1 implements I2 {
+                  /*severe:InvalidMethodOverride*/m(B a) {}
+              }
+           '''
+    });
+    testChecker('mixin of interface of child', {
+      '/main.dart': '''
+              class A {}
+              class B {}
+
+              abstract class M1 {
+                  m(A a);
+              }
+              abstract class I2 extends Object with M1 {}
+
+              class T1 implements I2 {
+                  /*severe:InvalidMethodOverride*/m(B a) {}
+              }
+           '''
+    });
+    testChecker('interface of abstract superclass', {
+      '/main.dart': '''
+              class A {}
+              class B {}
+
+              abstract class I1 {
+                  m(A a);
+              }
+              abstract class Base implements I1 {}
+
+              class T1 extends Base {
+                  /*severe:InvalidMethodOverride*/m(B a) {}
+              }
+           '''
+    });
+    testChecker('interface of concrete superclass', {
+      '/main.dart': '''
+              class A {}
+              class B {}
+
+              abstract class I1 {
+                  m(A a);
+              }
+
+              // See issue #25
+              /*pass should be warning:AnalyzerError*/class Base implements I1 {
+              }
+
+              class T1 extends Base {
+                  // not reported technically because if the class is concrete,
+                  // it should implement all its interfaces and hence it is
+                  // sufficient to check overrides against it.
+                  m(B a) {}
+              }
+           '''
+    });
+  });
+
+  group('mixin override of grand interface', () {
+    testChecker('interface of interface of child', {
+      '/main.dart': '''
+              class A {}
+              class B {}
+
+              abstract class I1 {
+                  m(A a);
+              }
+              abstract class I2 implements I1 {}
+
+              class M {
+                  m(B a) {}
+              }
+
+              class T1 extends Object with /*severe:InvalidMethodOverride*/M
+                  implements I2 {
+              }
+           '''
+    });
+    testChecker('superclass of interface of child', {
+      '/main.dart': '''
+              class A {}
+              class B {}
+
+              abstract class I1 {
+                  m(A a);
+              }
+              abstract class I2 extends I1 {}
+
+              class M {
+                  m(B a) {}
+              }
+
+              class T1 extends Object with /*severe:InvalidMethodOverride*/M
+                  implements I2 {
+              }
+           '''
+    });
+    testChecker('mixin of interface of child', {
+      '/main.dart': '''
+              class A {}
+              class B {}
+
+              abstract class M1 {
+                  m(A a);
+              }
+              abstract class I2 extends Object with M1 {}
+
+              class M {
+                  m(B a) {}
+              }
+
+              class T1 extends Object with /*severe:InvalidMethodOverride*/M
+                  implements I2 {
+              }
+           '''
+    });
+    testChecker('interface of abstract superclass', {
+      '/main.dart': '''
+              class A {}
+              class B {}
+
+              abstract class I1 {
+                  m(A a);
+              }
+              abstract class Base implements I1 {}
+
+              class M {
+                  m(B a) {}
+              }
+
+              class T1 extends Base with /*severe:InvalidMethodOverride*/M {
+              }
+           '''
+    });
+    testChecker('interface of concrete superclass', {
+      '/main.dart': '''
+              class A {}
+              class B {}
+
+              abstract class I1 {
+                  m(A a);
+              }
+
+              // See issue #25
+              /*pass should be warning:AnalyzerError*/class Base implements I1 {
+              }
+
+              class M {
+                  m(B a) {}
+              }
+
+              class T1 extends Base with M {
+              }
+           '''
+    });
+  });
+
+  group('superclass override of grand interface', () {
+    testChecker('interface of interface of child', {
+      '/main.dart': '''
+              class A {}
+              class B {}
+
+              abstract class I1 {
+                  m(A a);
+              }
+              abstract class I2 implements I1 {}
+
+              class Base {
+                  m(B a) {}
+              }
+
+              class T1 /*severe:InvalidMethodOverride*/extends Base
+                  implements I2 {
+              }
+           '''
+    });
+    testChecker('superclass of interface of child', {
+      '/main.dart': '''
+              class A {}
+              class B {}
+
+              abstract class I1 {
+                  m(A a);
+              }
+              abstract class I2 extends I1 {}
+
+              class Base {
+                  m(B a) {}
+              }
+
+              class T1 /*severe:InvalidMethodOverride*/extends Base
+                  implements I2 {
+              }
+           '''
+    });
+    testChecker('mixin of interface of child', {
+      '/main.dart': '''
+              class A {}
+              class B {}
+
+              abstract class M1 {
+                  m(A a);
+              }
+              abstract class I2 extends Object with M1 {}
+
+              class Base {
+                  m(B a) {}
+              }
+
+              class T1 /*severe:InvalidMethodOverride*/extends Base
+                  implements I2 {
+              }
+           '''
+    });
+    testChecker('interface of abstract superclass', {
+      '/main.dart': '''
+              class A {}
+              class B {}
+
+              abstract class I1 {
+                  m(A a);
+              }
+
+              abstract class Base implements I1 {
+                  /*severe:InvalidMethodOverride*/m(B a) {}
+              }
+
+              class T1 extends Base {
+                  // we consider the base class incomplete because it is
+                  // abstract, so we report the error here too.
+                  // TODO(sigmund): consider tracking overrides in a fine-grain
+                  // manner, then this and the double-overrides would not be
+                  // reported.
+                  /*severe:InvalidMethodOverride*/m(B a) {}
+              }
+           '''
+    });
+    testChecker('interface of concrete superclass', {
+      '/main.dart': '''
+              class A {}
+              class B {}
+
+              abstract class I1 {
+                  m(A a);
+              }
+
+              class Base implements I1 {
+                  /*severe:InvalidMethodOverride*/m(B a) {}
+              }
+
+              class T1 extends Base {
+                  m(B a) {}
+              }
+           '''
+    });
+  });
+
+  group('no duplicate reports from overriding interfaces', () {
+    testChecker('type overrides same method in multiple interfaces', {
+      '/main.dart': '''
+              class A {}
+              class B {}
+
+              abstract class I1 {
+                  m(A a);
+              }
+              abstract class I2 implements I1 {
+                  m(A a);
+              }
+
+              class Base {
+              }
+
+              class T1 implements I2 {
+                /*severe:InvalidMethodOverride*/m(B a) {}
+              }
+           '''
+    });
+
+    testChecker('type and base type override same method in interface', {
+      '/main.dart': '''
+              class A {}
+              class B {}
+
+              abstract class I1 {
+                  m(A a);
+              }
+
+              class Base {
+                  m(B a);
+              }
+
+              // Note: no error reported in `extends Base` to avoid duplicating
+              // the error in T1.
+              class T1 extends Base implements I1 {
+                /*severe:InvalidMethodOverride*/m(B a) {}
+              }
+
+              // If there is no error in the class, we do report the error at
+              // the base class:
+              class T2 /*severe:InvalidMethodOverride*/extends Base
+                  implements I1 {
+              }
+           '''
+    });
+
+    testChecker('type and mixin override same method in interface', {
+      '/main.dart': '''
+              class A {}
+              class B {}
+
+              abstract class I1 {
+                  m(A a);
+              }
+
+              class M {
+                  m(B a);
+              }
+
+              class T1 extends Object with M implements I1 {
+                /*severe:InvalidMethodOverride*/m(B a) {}
+              }
+
+              class T2 extends Object with /*severe:InvalidMethodOverride*/M
+                  implements I1 {
+              }
+           '''
+    });
+
+    testChecker('two grand types override same method in interface', {
+      '/main.dart': '''
+              class A {}
+              class B {}
+
+              abstract class I1 {
+                  m(A a);
+              }
+
+              class Grandparent {
+                  m(B a) {}
+              }
+
+              class Parent1 extends Grandparent {
+                  m(B a) {}
+              }
+              class Parent2 extends Grandparent {
+              }
+
+              // Note: otherwise both errors would be reported on this line
+              class T1 /*severe:InvalidMethodOverride*/extends Parent1
+                  implements I1 {
+              }
+              class T2 /*severe:InvalidMethodOverride*/extends Parent2
+                  implements I1 {
+              }
+           '''
+    });
+
+    testChecker('two mixins override same method in interface', {
+      '/main.dart': '''
+              class A {}
+              class B {}
+
+              abstract class I1 {
+                  m(A a);
+              }
+
+              class M1 {
+                  m(B a) {}
+              }
+
+              class M2 {
+                  m(B a) {}
+              }
+
+              // Here we want to report both, because the error location is
+              // different.
+              // TODO(sigmund): should we merge these as well?
+              class T1 extends Object
+                  with /*severe:InvalidMethodOverride*/M1
+                  with /*severe:InvalidMethodOverride*/M2
+                  implements I1 {
+              }
+           '''
+    });
+
+    testChecker('base type and mixin override same method in interface', {
+      '/main.dart': '''
+              class A {}
+              class B {}
+
+              abstract class I1 {
+                  m(A a);
+              }
+
+              class Base {
+                  m(B a) {}
+              }
+
+              class M {
+                  m(B a) {}
+              }
+
+              // Here we want to report both, because the error location is
+              // different.
+              // TODO(sigmund): should we merge these as well?
+              class T1 /*severe:InvalidMethodOverride*/extends Base
+                  with /*severe:InvalidMethodOverride*/M
+                  implements I1 {
+              }
+           '''
+    });
+  });
+
+  testChecker('invalid runtime checks', {
+    '/main.dart': '''
+          typedef int I2I(int x);
+          typedef int D2I(x);
+          typedef int II2I(int x, int y);
+          typedef int DI2I(x, int y);
+          typedef int ID2I(int x, y);
+          typedef int DD2I(x, y);
+
+          typedef I2D(int x);
+          typedef D2D(x);
+          typedef II2D(int x, int y);
+          typedef DI2D(x, int y);
+          typedef ID2D(int x, y);
+          typedef DD2D(x, y);
+
+          int foo(int x) => x;
+          int bar(int x, int y) => x + y;
+
+          void main() {
+            bool b;
+            b = /*info:NonGroundTypeCheckInfo*/foo is I2I;
+            b = /*info:NonGroundTypeCheckInfo*/foo is D2I;
+            b = /*info:NonGroundTypeCheckInfo*/foo is I2D;
+            b = foo is D2D;
+
+            b = /*info:NonGroundTypeCheckInfo*/bar is II2I;
+            b = /*info:NonGroundTypeCheckInfo*/bar is DI2I;
+            b = /*info:NonGroundTypeCheckInfo*/bar is ID2I;
+            b = /*info:NonGroundTypeCheckInfo*/bar is II2D;
+            b = /*info:NonGroundTypeCheckInfo*/bar is DD2I;
+            b = /*info:NonGroundTypeCheckInfo*/bar is DI2D;
+            b = /*info:NonGroundTypeCheckInfo*/bar is ID2D;
+            b = bar is DD2D;
+
+            // For as, the validity of checks is deferred to runtime.
+            Function f;
+            f = foo as I2I;
+            f = foo as D2I;
+            f = foo as I2D;
+            f = foo as D2D;
+
+            f = bar as II2I;
+            f = bar as DI2I;
+            f = bar as ID2I;
+            f = bar as II2D;
+            f = bar as DD2I;
+            f = bar as DI2D;
+            f = bar as ID2D;
+            f = bar as DD2D;
+          }
+      '''
+  });
+
+  group('function modifiers', () {
+    testChecker('async', {
+      '/main.dart': '''
+        import 'dart:async';
+        import 'dart:math' show Random;
+
+        dynamic x;
+
+        foo1() async => x;
+        Future foo2() async => x;
+        Future<int> foo3() async => (/*info:DynamicCast*/x);
+        Future<int> foo4() async => (/*severe:StaticTypeError*/new Future<int>.value(/*info:DynamicCast*/x));
+
+        bar1() async { return x; }
+        Future bar2() async { return x; }
+        Future<int> bar3() async { return (/*info:DynamicCast*/x); }
+        Future<int> bar4() async { return (/*severe:StaticTypeError*/new Future<int>.value(/*info:DynamicCast*/x)); }
+
+        int y;
+        Future<int> z;
+
+        void baz() async {
+          int a = /*info:DynamicCast*/await x;
+          int b = await y;
+          int c = await z;
+          String d = /*severe:StaticTypeError*/await z;
+        }
+
+        Future<bool> get issue_264 async {
+          await 42;
+          if (new Random().nextBool()) {
+            return true;
+          } else {
+            return /*severe:StaticTypeError*/new Future<bool>.value(false);
+          }
+        }
+    '''
+    });
+
+    testChecker('async*', {
+      '/main.dart': '''
+        import 'dart:async';
+
+        dynamic x;
+
+        bar1() async* { yield x; }
+        Stream bar2() async* { yield x; }
+        Stream<int> bar3() async* { yield (/*info:DynamicCast*/x); }
+        Stream<int> bar4() async* { yield (/*severe:StaticTypeError*/new Stream<int>()); }
+
+        baz1() async* { yield* (/*info:DynamicCast*/x); }
+        Stream baz2() async* { yield* (/*info:DynamicCast*/x); }
+        Stream<int> baz3() async* { yield* (/*warning:DownCastComposite*/x); }
+        Stream<int> baz4() async* { yield* new Stream<int>(); }
+        Stream<int> baz5() async* { yield* (/*info:InferredTypeAllocation*/new Stream()); }
+    '''
+    });
+
+    testChecker('sync*', {
+      '/main.dart': '''
+        import 'dart:async';
+
+        dynamic x;
+
+        bar1() sync* { yield x; }
+        Iterable bar2() sync* { yield x; }
+        Iterable<int> bar3() sync* { yield (/*info:DynamicCast*/x); }
+        Iterable<int> bar4() sync* { yield (/*severe:StaticTypeError*/new Iterable<int>()); }
+
+        baz1() sync* { yield* (/*info:DynamicCast*/x); }
+        Iterable baz2() sync* { yield* (/*info:DynamicCast*/x); }
+        Iterable<int> baz3() sync* { yield* (/*warning:DownCastComposite*/x); }
+        Iterable<int> baz4() sync* { yield* new Iterable<int>(); }
+        Iterable<int> baz5() sync* { yield* (/*info:InferredTypeAllocation*/new Iterable()); }
+    '''
+    });
+  });
+}
diff --git a/pkg/analyzer/test/src/task/strong/inferred_type_test.dart b/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
new file mode 100644
index 0000000..125b356
--- /dev/null
+++ b/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
@@ -0,0 +1,1310 @@
+// 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.
+
+// TODO(jmesserly): this file needs to be refactored, it's a port from
+// package:dev_compiler's tests
+/// Tests for type inference.
+library test.src.task.strong.inferred_type_test;
+
+import 'package:unittest/unittest.dart';
+
+import 'strong_test_helper.dart';
+
+void main() {
+  // Error also expected when declared type is `int`.
+  testChecker('infer type on var', {
+    '/main.dart': '''
+      test1() {
+        int x = 3;
+        x = /*severe:StaticTypeError*/"hi";
+      }
+    '''
+  });
+
+  // If inferred type is `int`, error is also reported
+  testChecker('infer type on var 2', {
+    '/main.dart': '''
+      test2() {
+        var x = 3;
+        x = /*severe:StaticTypeError*/"hi";
+      }
+    '''
+  });
+
+  testChecker('No error when declared type is `num` and assigned null.', {
+    '/main.dart': '''
+        test1() {
+          num x = 3;
+          x = null;
+        }
+      '''
+  });
+
+  testChecker('do not infer type on dynamic', {
+    '/main.dart': '''
+      test() {
+        dynamic x = 3;
+        x = "hi";
+      }
+    '''
+  });
+
+  testChecker('do not infer type when initializer is null', {
+    '/main.dart': '''
+      test() {
+        var x = null;
+        x = "hi";
+        x = 3;
+      }
+    '''
+  });
+
+  testChecker('infer type on var from field', {
+    '/main.dart': '''
+      class A {
+        int x = 0;
+
+        test1() {
+          var a = x;
+          a = /*severe:StaticTypeError*/"hi";
+          a = 3;
+          var b = y;
+          b = /*severe:StaticTypeError*/"hi";
+          b = 4;
+          var c = z;
+          c = /*severe:StaticTypeError*/"hi";
+          c = 4;
+        }
+
+        int y; // field def after use
+        final z = 42; // should infer `int`
+      }
+    '''
+  });
+
+  testChecker('infer type on var from top-level', {
+    '/main.dart': '''
+      int x = 0;
+
+      test1() {
+        var a = x;
+        a = /*severe:StaticTypeError*/"hi";
+        a = 3;
+        var b = y;
+        b = /*severe:StaticTypeError*/"hi";
+        b = 4;
+        var c = z;
+        c = /*severe:StaticTypeError*/"hi";
+        c = 4;
+      }
+
+      int y = 0; // field def after use
+      final z = 42; // should infer `int`
+    '''
+  });
+
+  testChecker('do not infer field type when initializer is null', {
+    '/main.dart': '''
+      var x = null;
+      var y = 3;
+      class A {
+        static var x = null;
+        static var y = 3;
+
+        var x2 = null;
+        var y2 = 3;
+      }
+
+      test() {
+        x = "hi";
+        y = /*severe:StaticTypeError*/"hi";
+        A.x = "hi";
+        A.y = /*severe:StaticTypeError*/"hi";
+        new A().x2 = "hi";
+        new A().y2 = /*severe:StaticTypeError*/"hi";
+      }
+    '''
+  });
+
+  testChecker('infer from variables in non-cycle imports with flag', {
+    '/a.dart': '''
+          var x = 2;
+      ''',
+    '/main.dart': '''
+          import 'a.dart';
+          var y = x;
+
+          test1() {
+            x = /*severe:StaticTypeError*/"hi";
+            y = /*severe:StaticTypeError*/"hi";
+          }
+    '''
+  });
+
+  testChecker('infer from variables in non-cycle imports with flag 2', {
+    '/a.dart': '''
+          class A { static var x = 2; }
+      ''',
+    '/main.dart': '''
+          import 'a.dart';
+          class B { static var y = A.x; }
+
+          test1() {
+            A.x = /*severe:StaticTypeError*/"hi";
+            B.y = /*severe:StaticTypeError*/"hi";
+          }
+    '''
+  });
+
+  testChecker('infer from variables in cycle libs when flag is on', {
+    '/a.dart': '''
+          import 'main.dart';
+          var x = 2; // ok to infer
+      ''',
+    '/main.dart': '''
+          import 'a.dart';
+          var y = x; // now ok :)
+
+          test1() {
+            int t = 3;
+            t = x;
+            t = y;
+          }
+    '''
+  });
+
+  testChecker('infer from variables in cycle libs when flag is on 2', {
+    '/a.dart': '''
+          import 'main.dart';
+          class A { static var x = 2; }
+      ''',
+    '/main.dart': '''
+          import 'a.dart';
+          class B { static var y = A.x; }
+
+          test1() {
+            int t = 3;
+            t = A.x;
+            t = B.y;
+          }
+    '''
+  });
+
+  testChecker('can infer also from static and instance fields (flag on)', {
+    '/a.dart': '''
+          import 'b.dart';
+          class A {
+            static final a1 = B.b1;
+            final a2 = new B().b2;
+          }
+      ''',
+    '/b.dart': '''
+          class B {
+            static final b1 = 1;
+            final b2 = 1;
+          }
+      ''',
+    '/main.dart': '''
+          import "a.dart";
+
+          test1() {
+            int x = 0;
+            // inference in A now works.
+            x = A.a1;
+            x = new A().a2;
+          }
+    '''
+  });
+
+  testChecker('inference in cycles is deterministic', {
+    '/a.dart': '''
+          import 'b.dart';
+          class A {
+            static final a1 = B.b1;
+            final a2 = new B().b2;
+          }
+      ''',
+    '/b.dart': '''
+          class B {
+            static final b1 = 1;
+            final b2 = 1;
+          }
+      ''',
+    '/c.dart': '''
+          import "main.dart"; // creates a cycle
+
+          class C {
+            static final c1 = 1;
+            final c2 = 1;
+          }
+      ''',
+    '/e.dart': '''
+          import 'a.dart';
+          part 'e2.dart';
+
+          class E {
+            static final e1 = 1;
+            static final e2 = F.f1;
+            static final e3 = A.a1;
+            final e4 = 1;
+            final e5 = new F().f2;
+            final e6 = new A().a2;
+          }
+      ''',
+    '/f.dart': '''
+          part 'f2.dart';
+      ''',
+    '/e2.dart': '''
+          class F {
+            static final f1 = 1;
+            final f2 = 1;
+          }
+      ''',
+    '/main.dart': '''
+          import "a.dart";
+          import "c.dart";
+          import "e.dart";
+
+          class D {
+            static final d1 = A.a1 + 1;
+            static final d2 = C.c1 + 1;
+            final d3 = new A().a2;
+            final d4 = new C().c2;
+          }
+
+          test1() {
+            int x = 0;
+            // inference in A works, it's not in a cycle
+            x = A.a1;
+            x = new A().a2;
+
+            // Within a cycle we allow inference when the RHS is well known, but
+            // not when it depends on other fields within the cycle
+            x = C.c1;
+            x = D.d1;
+            x = D.d2;
+            x = new C().c2;
+            x = new D().d3;
+            x = /*info:DynamicCast*/new D().d4;
+
+
+            // Similarly if the library contains parts.
+            x = E.e1;
+            x = E.e2;
+            x = E.e3;
+            x = new E().e4;
+            x = /*info:DynamicCast*/new E().e5;
+            x = new E().e6;
+            x = F.f1;
+            x = new F().f2;
+          }
+    '''
+  });
+
+  testChecker(
+      'infer from complex expressions if the outer-most value is precise', {
+    '/main.dart': '''
+        class A { int x; B operator+(other) {} }
+        class B extends A { B(ignore); }
+        var a = new A();
+        // Note: it doesn't matter that some of these refer to 'x'.
+        var b = new B(x);       // allocations
+        var c1 = [x];           // list literals
+        var c2 = const [];
+        var d = {'a': 'b'};     // map literals
+        var e = new A()..x = 3; // cascades
+        var f = 2 + 3;          // binary expressions are OK if the left operand
+                                // is from a library in a different strongest
+                                // conected component.
+        var g = -3;
+        var h = new A() + 3;
+        var i = - new A();
+        var j = null as B;
+
+        test1() {
+          a = /*severe:StaticTypeError*/"hi";
+          a = new B(3);
+          b = /*severe:StaticTypeError*/"hi";
+          b = new B(3);
+          c1 = [];
+          c1 = /*severe:StaticTypeError*/{};
+          c2 = [];
+          c2 = /*severe:StaticTypeError*/{};
+          d = {};
+          d = /*severe:StaticTypeError*/3;
+          e = new A();
+          e = /*severe:StaticTypeError*/{};
+          f = 3;
+          f = /*severe:StaticTypeError*/false;
+          g = 1;
+          g = /*severe:StaticTypeError*/false;
+          h = /*severe:StaticTypeError*/false;
+          h = new B();
+          i = false;
+          j = new B();
+          j = /*severe:StaticTypeError*/false;
+          j = /*severe:StaticTypeError*/[];
+        }
+    '''
+  });
+
+  // but flags can enable this behavior.
+  testChecker('infer if complex expressions read possibly inferred field', {
+    '/a.dart': '''
+        class A {
+          var x = 3;
+        }
+      ''',
+    '/main.dart': '''
+        import 'a.dart';
+        class B {
+          var y = 3;
+        }
+        final t1 = new A();
+        final t2 = new A().x;
+        final t3 = new B();
+        final t4 = new B().y;
+
+        test1() {
+          int i = 0;
+          A a;
+          B b;
+          a = t1;
+          i = t2;
+          b = t3;
+          i = /*info:DynamicCast*/t4;
+          i = new B().y; // B.y was inferred though
+        }
+    '''
+  });
+
+  group('infer types on loop indices', () {
+    testChecker('foreach loop', {
+      '/main.dart': '''
+      class Foo {
+        int bar = 42;
+      }
+
+      class Bar<T extends Iterable<String>> {
+        void foo(T t) {
+          for (var i in t) {
+            int x = /*severe:StaticTypeError*/i;
+          }
+        }
+      }
+
+      class Baz<T, E extends Iterable<T>, S extends E> {
+        void foo(S t) {
+          for (var i in t) {
+            int x = /*severe:StaticTypeError*/i;
+            T y = i;
+          }
+        }
+      }
+
+      test() {
+        var list = <Foo>[];
+        for (var x in list) {
+          String y = /*severe:StaticTypeError*/x;
+        }
+
+        for (dynamic x in list) {
+          String y = /*info:DynamicCast*/x;
+        }
+
+        for (String x in /*severe:StaticTypeError*/list) {
+          String y = x;
+        }
+
+        var z;
+        for(z in list) {
+          String y = /*info:DynamicCast*/z;
+        }
+
+        Iterable iter = list;
+        for (Foo x in /*warning:DownCastComposite*/iter) {
+          var y = x;
+        }
+
+        dynamic iter2 = list;
+        for (Foo x in /*warning:DownCastComposite*/iter2) {
+          var y = x;
+        }
+
+        var map = <String, Foo>{};
+        // Error: map must be an Iterable.
+        for (var x in /*severe:StaticTypeError*/map) {
+          String y = /*info:DynamicCast*/x;
+        }
+
+        // We're not properly inferring that map.keys is an Iterable<String>
+        // and that x is a String.
+        for (var x in map.keys) {
+          String y = x;
+        }
+      }
+      '''
+    });
+
+    testChecker('for loop, with inference', {
+      '/main.dart': '''
+      test() {
+        for (var i = 0; i < 10; i++) {
+          int j = i + 1;
+        }
+      }
+      '''
+    });
+  });
+
+  testChecker('propagate inference to field in class', {
+    '/main.dart': '''
+      class A {
+        int x = 2;
+      }
+
+      test() {
+        var a = new A();
+        A b = a;                      // doesn't require down cast
+        print(a.x);     // doesn't require dynamic invoke
+        print(a.x + 2); // ok to use in bigger expression
+      }
+    '''
+  });
+
+  testChecker('propagate inference to field in class dynamic warnings', {
+    '/main.dart': '''
+      class A {
+        int x = 2;
+      }
+
+      test() {
+        dynamic a = new A();
+        A b = /*info:DynamicCast*/a;
+        print(/*info:DynamicInvoke*/a.x);
+        print(/*info:DynamicInvoke*/(/*info:DynamicInvoke*/a.x) + 2);
+      }
+    '''
+  });
+
+  testChecker('propagate inference transitively', {
+    '/main.dart': '''
+      class A {
+        int x = 2;
+      }
+
+      test5() {
+        var a1 = new A();
+        a1.x = /*severe:StaticTypeError*/"hi";
+
+        A a2 = new A();
+        a2.x = /*severe:StaticTypeError*/"hi";
+      }
+    '''
+  });
+
+  testChecker('propagate inference transitively 2', {
+    '/main.dart': '''
+      class A {
+        int x = 42;
+      }
+
+      class B {
+        A a = new A();
+      }
+
+      class C {
+        B b = new B();
+      }
+
+      class D {
+        C c = new C();
+      }
+
+      void main() {
+        var d1 = new D();
+        print(d1.c.b.a.x);
+
+        D d2 = new D();
+        print(d2.c.b.a.x);
+      }
+    '''
+  });
+
+  group('infer type on overridden fields', () {
+    testChecker('2', {
+      '/main.dart': '''
+        class A {
+          int x = 2;
+        }
+
+        class B extends A {
+          get x => 3;
+        }
+
+        foo() {
+          String y = /*severe:StaticTypeError*/new B().x;
+          int z = new B().x;
+        }
+    '''
+    });
+
+    testChecker('4', {
+      '/main.dart': '''
+        class A {
+          int x = 2;
+        }
+
+        class B implements A {
+          get x => 3;
+        }
+
+        foo() {
+          String y = /*severe:StaticTypeError*/new B().x;
+          int z = new B().x;
+        }
+    '''
+    });
+  });
+
+  group('infer types on generic instantiations', () {
+    testChecker('infer', {
+      '/main.dart': '''
+        class A<T> {
+          T x;
+        }
+
+        class B implements A<int> {
+          /*severe:InvalidMethodOverride*/dynamic get x => 3;
+        }
+
+        foo() {
+          String y = /*info:DynamicCast*/new B().x;
+          int z = /*info:DynamicCast*/new B().x;
+        }
+    '''
+    });
+
+    testChecker('3', {
+      '/main.dart': '''
+        class A<T> {
+          T x;
+          T w;
+        }
+
+        class B implements A<int> {
+          get x => 3;
+          get w => /*severe:StaticTypeError*/"hello";
+        }
+
+        foo() {
+          String y = /*severe:StaticTypeError*/new B().x;
+          int z = new B().x;
+        }
+    '''
+    });
+
+    testChecker('4', {
+      '/main.dart': '''
+        class A<T> {
+          T x;
+        }
+
+        class B<E> extends A<E> {
+          E y;
+          get x => y;
+        }
+
+        foo() {
+          int y = /*severe:StaticTypeError*/new B<String>().x;
+          String z = new B<String>().x;
+        }
+    '''
+    });
+
+    testChecker('5', {
+      '/main.dart': '''
+        abstract class I<E> {
+          String m(a, String f(v, T e));
+        }
+
+        abstract class A<E> implements I<E> {
+          const A();
+          String m(a, String f(v, T e));
+        }
+
+        abstract class M {
+          int y;
+        }
+
+        class B<E> extends A<E> implements M {
+          const B();
+          int get y => 0;
+
+          m(a, f(v, T e)) {}
+        }
+
+        foo () {
+          int y = /*severe:StaticTypeError*/new B().m(null, null);
+          String z = new B().m(null, null);
+        }
+    '''
+    });
+  });
+
+  testChecker('infer type regardless of declaration order or cycles', {
+    '/b.dart': '''
+        import 'main.dart';
+
+        class B extends A { }
+      ''',
+    '/main.dart': '''
+        import 'b.dart';
+        class C extends B {
+          get x;
+        }
+        class A {
+          int get x;
+        }
+        foo () {
+          int y = new C().x;
+          String y = /*severe:StaticTypeError*/new C().x;
+        }
+    '''
+  });
+
+  // Note: this is a regression test for a non-deterministic behavior we used to
+  // have with inference in library cycles. If you see this test flake out,
+  // change `test` to `skip_test` and reopen bug #48.
+  testChecker('infer types on generic instantiations in library cycle', {
+    '/a.dart': '''
+          import 'main.dart';
+        abstract class I<E> {
+          A<E> m(a, String f(v, int e));
+        }
+      ''',
+    '/main.dart': '''
+          import 'a.dart';
+
+        abstract class A<E> implements I<E> {
+          const A();
+
+          E value;
+        }
+
+        abstract class M {
+          int y;
+        }
+
+        class B<E> extends A<E> implements M {
+          const B();
+          int get y => 0;
+
+          m(a, f(v, int e)) {}
+        }
+
+        foo () {
+          int y = /*severe:StaticTypeError*/new B<String>().m(null, null).value;
+          String z = new B<String>().m(null, null).value;
+        }
+    '''
+  });
+
+  group('do not infer overridden fields that explicitly say dynamic', () {
+    testChecker('infer', {
+      '/main.dart': '''
+          class A {
+            int x = 2;
+          }
+
+          class B implements A {
+            /*severe:InvalidMethodOverride*/dynamic get x => 3;
+          }
+
+          foo() {
+            String y = /*info:DynamicCast*/new B().x;
+            int z = /*info:DynamicCast*/new B().x;
+          }
+      '''
+    });
+  });
+
+  testChecker('conflicts can happen', {
+    '/main.dart': '''
+        class I1 {
+          int x;
+        }
+        class I2 extends I1 {
+          int y;
+        }
+
+        class A {
+          final I1 a;
+        }
+
+        class B {
+          final I2 a;
+        }
+
+        class C1 extends A implements B {
+          /*severe:InvalidMethodOverride,severe:InvalidMethodOverride*/get a => null;
+        }
+
+        // Still ambiguous
+        class C2 extends B implements A {
+          /*severe:InvalidMethodOverride,severe:InvalidMethodOverride*/get a => null;
+        }
+    '''
+  });
+
+  testChecker('conflicts can happen 2', {
+    '/main.dart': '''
+        class I1 {
+          int x;
+        }
+        class I2 {
+          int y;
+        }
+
+        class I3 implements I1, I2 {
+          int x;
+          int y;
+        }
+
+        class A {
+          final I1 a;
+        }
+
+        class B {
+          final I2 a;
+        }
+
+        class C1 extends A implements B {
+          I3 get a => null;
+        }
+
+        class C2 extends A implements B {
+          /*severe:InvalidMethodOverride,severe:InvalidMethodOverride*/get a => null;
+        }
+    '''
+  });
+
+  testChecker(
+      'infer from RHS only if it wont conflict with overridden fields', {
+    '/main.dart': '''
+        class A {
+          var x;
+        }
+
+        class B extends A {
+          var x = 2;
+        }
+
+        foo() {
+          String y = /*info:DynamicCast*/new B().x;
+          int z = /*info:DynamicCast*/new B().x;
+        }
+    '''
+  });
+
+  testChecker(
+      'infer from RHS only if it wont conflict with overridden fields 2', {
+    '/main.dart': '''
+        class A {
+          final x;
+        }
+
+        class B extends A {
+          final x = 2;
+        }
+
+        foo() {
+          String y = /*severe:StaticTypeError*/new B().x;
+          int z = new B().x;
+        }
+    '''
+  });
+
+  testChecker('infer correctly on multiple variables declared together', {
+    '/main.dart': '''
+        class A {
+          var x, y = 2, z = "hi";
+        }
+
+        class B extends A {
+          var x = 2, y = 3, z, w = 2;
+        }
+
+        foo() {
+          String s;
+          int i;
+
+          s = /*info:DynamicCast*/new B().x;
+          s = /*severe:StaticTypeError*/new B().y;
+          s = new B().z;
+          s = /*severe:StaticTypeError*/new B().w;
+
+          i = /*info:DynamicCast*/new B().x;
+          i = new B().y;
+          i = /*severe:StaticTypeError*/new B().z;
+          i = new B().w;
+        }
+    '''
+  });
+
+  testChecker('infer consts transitively', {
+    '/b.dart': '''
+        const b1 = 2;
+      ''',
+    '/a.dart': '''
+        import 'main.dart';
+        import 'b.dart';
+        const a1 = m2;
+        const a2 = b1;
+      ''',
+    '/main.dart': '''
+        import 'a.dart';
+        const m1 = a1;
+        const m2 = a2;
+
+        foo() {
+          int i;
+          i = m1;
+        }
+    '''
+  });
+
+  testChecker('infer statics transitively', {
+    '/b.dart': '''
+        final b1 = 2;
+      ''',
+    '/a.dart': '''
+        import 'main.dart';
+        import 'b.dart';
+        final a1 = m2;
+        class A {
+          static final a2 = b1;
+        }
+      ''',
+    '/main.dart': '''
+        import 'a.dart';
+        final m1 = a1;
+        final m2 = A.a2;
+
+        foo() {
+          int i;
+          i = m1;
+        }
+    '''
+  });
+
+  testChecker('infer statics transitively 2', {
+    '/main.dart': '''
+        const x1 = 1;
+        final x2 = 1;
+        final y1 = x1;
+        final y2 = x2;
+
+        foo() {
+          int i;
+          i = y1;
+          i = y2;
+        }
+    '''
+  });
+
+  testChecker('infer statics transitively 3', {
+    '/a.dart': '''
+        const a1 = 3;
+        const a2 = 4;
+        class A {
+          a3;
+        }
+      ''',
+    '/main.dart': '''
+        import 'a.dart' show a1, A;
+        import 'a.dart' as p show a2, A;
+        const t1 = 1;
+        const t2 = t1;
+        const t3 = a1;
+        const t4 = p.a2;
+        const t5 = A.a3;
+        const t6 = p.A.a3;
+
+        foo() {
+          int i;
+          i = t1;
+          i = t2;
+          i = t3;
+          i = t4;
+        }
+    '''
+  });
+
+  testChecker('infer statics with method invocations', {
+    '/a.dart': '''
+        m3(String a, String b, [a1,a2]) {}
+      ''',
+    '/main.dart': '''
+        import 'a.dart';
+        class T {
+          static final T foo = m1(m2(m3('', '')));
+          static T m1(String m) { return null; }
+          static String m2(e) { return ''; }
+        }
+
+
+    '''
+  });
+
+  testChecker('downwards inference: miscellaneous', {
+    '/main.dart': '''
+      typedef (T x);
+      class A<T> {
+        Function2<T> x;
+        A(this.x);
+      }
+      void main() {
+          {  // Variables, nested literals
+            var x = "hello";
+            var y = 3;
+            void f(List<Map<int, String>> l) {};
+            f(/*info:InferredTypeLiteral*/[{y: x}]);
+          }
+          {
+            int f(int x) {};
+            A<int> a = /*info:InferredTypeAllocation*/new A(f);
+          }
+      }
+      '''
+  });
+
+  group('downwards inference on instance creations', () {
+    String info = 'info:InferredTypeAllocation';
+    String code = '''
+      class A<S, T> {
+        S x;
+        T y;
+        A(this.x, this.y);
+        A.named(this.x, this.y);
+      }
+
+      class B<S, T> extends A<T, S> {
+        B(S y, T x) : super(x, y);
+        B.named(S y, T x) : super.named(x, y);
+      }
+
+      class C<S> extends B<S, S> {
+        C(S a) : super(a, a);
+        C.named(S a) : super.named(a, a);
+      }
+
+      class D<S, T> extends B<T, int> {
+        D(T a) : super(a, 3);
+        D.named(T a) : super.named(a, 3);
+      }
+
+      class E<S, T> extends A<C<S>, T> {
+        E(T a) : super(null, a);
+      }
+
+      class F<S, T> extends A<S, T> {
+        F(S x, T y, {List<S> a, List<T> b}) : super(x, y);
+        F.named(S x, T y, [S a, T b]) : super(a, b);
+      }
+
+      void main() {
+        {
+          A<int, String> a0 = /*$info*/new A(3, "hello");
+          A<int, String> a1 = /*$info*/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 = /*severe:StaticTypeError*/new A<int, dynamic>(3, "hello");
+          A<int, String> a5 = /*severe:StaticTypeError*/new A<dynamic, dynamic>.named(3, "hello");
+        }
+        {
+          A<int, String> a0 = /*severe:StaticTypeError*/new A("hello", 3);
+          A<int, String> a1 = /*severe:StaticTypeError*/new A.named("hello", 3);
+        }
+        {
+          A<int, String> a0 = /*$info*/new B("hello", 3);
+          A<int, String> a1 = /*$info*/new B.named("hello", 3);
+          A<int, String> a2 = new B<String, int>("hello", 3);
+          A<int, String> a3 = new B<String, int>.named("hello", 3);
+          A<int, String> a4 = /*severe:StaticTypeError*/new B<String, dynamic>("hello", 3);
+          A<int, String> a5 = /*severe:StaticTypeError*/new B<dynamic, dynamic>.named("hello", 3);
+        }
+        {
+          A<int, String> a0 = /*severe:StaticTypeError*/new B(3, "hello");
+          A<int, String> a1 = /*severe:StaticTypeError*/new B.named(3, "hello");
+        }
+        {
+          A<int, int> a0 = /*$info*/new C(3);
+          A<int, int> a1 = /*$info*/new C.named(3);
+          A<int, int> a2 = new C<int>(3);
+          A<int, int> a3 = new C<int>.named(3);
+          A<int, int> a4 = /*severe:StaticTypeError*/new C<dynamic>(3);
+          A<int, int> a5 = /*severe:StaticTypeError*/new C<dynamic>.named(3);
+        }
+        {
+          A<int, int> a0 = /*severe:StaticTypeError*/new C("hello");
+          A<int, int> a1 = /*severe:StaticTypeError*/new C.named("hello");
+        }
+        {
+          A<int, String> a0 = /*$info*/new D("hello");
+          A<int, String> a1 = /*$info*/new D.named("hello");
+          A<int, String> a2 = new D<int, String>("hello");
+          A<int, String> a3 = new D<String, String>.named("hello");
+          A<int, String> a4 = /*severe:StaticTypeError*/new D<num, dynamic>("hello");
+          A<int, String> a5 = /*severe:StaticTypeError*/new D<dynamic, dynamic>.named("hello");
+        }
+        {
+          A<int, String> a0 = /*severe:StaticTypeError*/new D(3);
+          A<int, String> a1 = /*severe:StaticTypeError*/new D.named(3);
+        }
+        { // Currently we only allow variable constraints.  Test that we reject.
+          A<C<int>, String> a0 = /*severe:StaticTypeError*/new E("hello");
+        }
+        { // Check named and optional arguments
+          A<int, String> a0 = /*$info*/new F(3, "hello", a: [3], b: ["hello"]);
+          A<int, String> a1 = /*severe:StaticTypeError*/new F(3, "hello", a: ["hello"], b:[3]);
+          A<int, String> a2 = /*$info*/new F.named(3, "hello", 3, "hello");
+          A<int, String> a3 = /*$info*/new F.named(3, "hello");
+          A<int, String> a4 = /*severe:StaticTypeError*/new F.named(3, "hello", "hello", 3);
+          A<int, String> a5 = /*severe:StaticTypeError*/new F.named(3, "hello", "hello");
+        }
+      }
+        ''';
+    testChecker('infer downwards', {'/main.dart': code});
+  });
+
+  group('downwards inference on list literals', () {
+    String info = "info:InferredTypeLiteral";
+    String code = '''
+      void foo([List<String> list1 = /*$info*/const [],
+                List<String> list2 = /*severe:StaticTypeError*/const [42]]) {
+      }
+
+      void main() {
+        {
+          List<int> l0 = /*$info*/[];
+          List<int> l1 = /*$info*/[3];
+          List<int> l2 = /*severe:StaticTypeError*/["hello"];
+          List<int> l3 = /*severe:StaticTypeError*/["hello", 3];
+        }
+        {
+          List<dynamic> l0 = [];
+          List<dynamic> l1 = [3];
+          List<dynamic> l2 = ["hello"];
+          List<dynamic> l3 = ["hello", 3];
+        }
+        {
+          List<int> l0 = /*severe:StaticTypeError*/<num>[];
+          List<int> l1 = /*severe:StaticTypeError*/<num>[3];
+          List<int> l2 = /*severe:StaticTypeError*/<num>[/*severe:StaticTypeError*/"hello"];
+          List<int> l3 = /*severe:StaticTypeError*/<num>[/*severe:StaticTypeError*/"hello", 3];
+        }
+        {
+          Iterable<int> i0 = /*$info*/[];
+          Iterable<int> i1 = /*$info*/[3];
+          Iterable<int> i2 = /*severe:StaticTypeError*/["hello"];
+          Iterable<int> i3 = /*severe:StaticTypeError*/["hello", 3];
+        }
+        {
+          const List<int> c0 = /*$info*/const [];
+          const List<int> c1 = /*$info*/const [3];
+          const List<int> c2 = /*severe:StaticTypeError*/const ["hello"];
+          const List<int> c3 = /*severe:StaticTypeError*/const ["hello", 3];
+        }
+      }
+      ''';
+    testChecker('infer downwards', {'/main.dart': code});
+  });
+
+  group('downwards inference on function arguments', () {
+    String info = "info:InferredTypeLiteral";
+    String code = '''
+      void f0(List<int> a) {};
+      void f1({List<int> a}) {};
+      void f2(Iterable<int> a) {};
+      void f3(Iterable<Iterable<int>> a) {};
+      void f4({Iterable<Iterable<int>> a}) {};
+      void main() {
+        f0(/*$info*/[]);
+        f0(/*$info*/[3]);
+        f0(/*severe:StaticTypeError*/["hello"]);
+        f0(/*severe:StaticTypeError*/["hello", 3]);
+
+        f1(a: /*$info*/[]);
+        f1(a: /*$info*/[3]);
+        f1(a: /*severe:StaticTypeError*/["hello"]);
+        f1(a: /*severe:StaticTypeError*/["hello", 3]);
+
+        f2(/*$info*/[]);
+        f2(/*$info*/[3]);
+        f2(/*severe:StaticTypeError*/["hello"]);
+        f2(/*severe:StaticTypeError*/["hello", 3]);
+
+        f3(/*$info*/[]);
+        f3(/*$info*/[[3]]);
+        f3(/*severe:StaticTypeError*/[["hello"]]);
+        f3(/*severe:StaticTypeError*/[["hello"], [3]]);
+
+        f4(a: /*$info*/[]);
+        f4(a: /*$info*/[[3]]);
+        f4(a: /*severe:StaticTypeError*/[["hello"]]);
+        f4(a: /*severe:StaticTypeError*/[["hello"], [3]]);
+      }
+      ''';
+    testChecker('infer downwards', {'/main.dart': code});
+  });
+
+  group('downwards inference on map literals', () {
+    String info = "info:InferredTypeLiteral";
+    String code = '''
+      void foo([Map<int, String> m1 = /*$info*/const {1: "hello"},
+                Map<int, String> m1 = /*severe:StaticTypeError*/const {"hello": "world"}]) {
+      }
+      void main() {
+        {
+          Map<int, String> l0 = /*$info*/{};
+          Map<int, String> l1 = /*$info*/{3: "hello"};
+          Map<int, String> l2 = /*severe:StaticTypeError*/{"hello": "hello"};
+          Map<int, String> l3 = /*severe:StaticTypeError*/{3: 3};
+          Map<int, String> l4 = /*severe:StaticTypeError*/{3:"hello", "hello": 3};
+        }
+        {
+          Map<dynamic, dynamic> l0 = {};
+          Map<dynamic, dynamic> l1 = {3: "hello"};
+          Map<dynamic, dynamic> l2 = {"hello": "hello"};
+          Map<dynamic, dynamic> l3 = {3: 3};
+          Map<dynamic, dynamic> l4 = {3:"hello", "hello": 3};
+        }
+        {
+          Map<dynamic, String> l0 = /*$info*/{};
+          Map<dynamic, String> l1 = /*$info*/{3: "hello"};
+          Map<dynamic, String> l2 = /*$info*/{"hello": "hello"};
+          Map<dynamic, String> l3 = /*severe:StaticTypeError*/{3: 3};
+          Map<dynamic, String> l4 = /*severe:StaticTypeError*/{3:"hello", "hello": 3};
+        }
+        {
+          Map<int, dynamic> l0 = /*$info*/{};
+          Map<int, dynamic> l1 = /*$info*/{3: "hello"};
+          Map<int, dynamic> l2 = /*severe:StaticTypeError*/{"hello": "hello"};
+          Map<int, dynamic> l3 = /*$info*/{3: 3};
+          Map<int, dynamic> l3 = /*severe:StaticTypeError*/{3:"hello", "hello": 3};
+        }
+        {
+          Map<int, String> l0 = /*severe:StaticTypeError*/<num, dynamic>{};
+          Map<int, String> l1 = /*severe:StaticTypeError*/<num, dynamic>{3: "hello"};
+          Map<int, String> l3 = /*severe:StaticTypeError*/<num, dynamic>{3: 3};
+        }
+        {
+          const Map<int, String> l0 = /*$info*/const {};
+          const Map<int, String> l1 = /*$info*/const {3: "hello"};
+          const Map<int, String> l2 = /*severe:StaticTypeError*/const {"hello": "hello"};
+          const Map<int, String> l3 = /*severe:StaticTypeError*/const {3: 3};
+          const Map<int, String> l4 = /*severe:StaticTypeError*/const {3:"hello", "hello": 3};
+        }
+      }
+      ''';
+    testChecker('infer downwards', {'/main.dart': code});
+  });
+
+  testChecker('downwards inference on function expressions', {
+    '/main.dart': '''
+      typedef T Function2<S, T>(S x);
+
+      void main () {
+        {
+          Function2<int, String> l0 = (int x) => null;
+          Function2<int, String> l1 = (int x) => "hello";
+          Function2<int, String> l2 = /*severe:StaticTypeError*/(String x) => "hello";
+          Function2<int, String> l3 = /*severe:StaticTypeError*/(int x) => 3;
+          Function2<int, String> l4 = /*warning:UninferredClosure should be severe:StaticTypeError*/(int x) {return 3};
+        }
+        {
+          Function2<int, String> l0 = /*info:InferredTypeClosure*/(x) => null;
+          Function2<int, String> l1 = /*info:InferredTypeClosure*/(x) => "hello";
+          Function2<int, String> l2 = /*severe:StaticTypeError*/(x) => 3;
+          Function2<int, String> l3 = /*warning:UninferredClosure should be severe:StaticTypeError*/(x) {return 3};
+        }
+        {
+          Function2<int, List<String>> l0 = (int x) => null;
+          Function2<int, List<String>> l1 = /*info:InferredTypeClosure*/(int x) => ["hello"];
+          Function2<int, List<String>> l2 = /*severe:StaticTypeError*/(String x) => ["hello"];
+          Function2<int, List<String>> l3 = /*warning:UninferredClosure should be severe:StaticTypeError*/(int x) => [3];
+          Function2<int, List<String>> l4 = /*warning:UninferredClosure should be severe:StaticTypeError*/(int x) {return [3]};
+        }
+        {
+          Function2<int, int> l0 = /*info:InferredTypeClosure*/(x) => x;
+          Function2<int, int> l1 = /*info:InferredTypeClosure*/(x) => /*info:DynamicInvoke should be pass*/x+1;
+          Function2<int, String> l2 = /*info:InferredTypeClosure should be severe:StaticTypeError*/(x) => x;
+          Function2<int, String> l3 = /*info:InferredTypeClosure should be severe:StaticTypeError*/(x) => /*info:DynamicInvoke should be pass*/x.substring(3);
+          Function2<String, String> l4 = /*info:InferredTypeClosure*/(x) => /*info:DynamicInvoke should be pass*/x.substring(3);
+        }
+      }
+      '''
+  });
+
+  testChecker('inferred initializing formal checks default value', {
+    '/main.dart': '''
+      class Foo {
+        var x = 1;
+        Foo([this.x = /*severe:StaticTypeError*/"1"]);
+      }'''
+  });
+
+  group('quasi-generics', () {
+    testChecker('dart:math min/max', {
+      '/main.dart': '''
+        import 'dart:math';
+
+        void printInt(int x) => print(x);
+        void printDouble(double x) => print(x);
+
+        num myMax(num x, num y) => max(x, y);
+
+        main() {
+          // Okay if static types match.
+          printInt(max(1, 2));
+          printInt(min(1, 2));
+          printDouble(max(1.0, 2.0));
+          printDouble(min(1.0, 2.0));
+
+          // No help for user-defined functions from num->num->num.
+          printInt(/*info:DownCastImplicit*/myMax(1, 2));
+          printInt(myMax(1, 2) as int);
+
+          // Mixing int and double means return type is num.
+          printInt(/*info:DownCastImplicit*/max(1, 2.0));
+          printInt(/*info:DownCastImplicit*/min(1, 2.0));
+          printDouble(/*info:DownCastImplicit*/max(1, 2.0));
+          printDouble(/*info:DownCastImplicit*/min(1, 2.0));
+
+          // Types other than int and double are not accepted.
+          printInt(
+              /*info:DownCastImplicit*/min(
+                  /*severe:StaticTypeError*/"hi",
+                  /*severe:StaticTypeError*/"there"));
+        }
+    '''
+    });
+
+    testChecker('Iterable and Future', {
+      '/main.dart': '''
+        import 'dart:async';
+
+        Future<int> make(int x) => (/*info:InferredTypeAllocation*/new Future(() => x));
+
+        main() {
+          Iterable<Future<int>> list = <int>[1, 2, 3].map(make);
+          Future<List<int>> results = Future.wait(list);
+          Future<String> results2 = results.then((List<int> list) 
+            => list.fold('', (String x, int y) => x + y.toString()));
+        }
+    '''
+    });
+  });
+}
diff --git a/pkg/analyzer/test/src/task/strong/strong_test_helper.dart b/pkg/analyzer/test/src/task/strong/strong_test_helper.dart
new file mode 100644
index 0000000..330801f
--- /dev/null
+++ b/pkg/analyzer/test/src/task/strong/strong_test_helper.dart
@@ -0,0 +1,500 @@
+// 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.
+
+// TODO(jmesserly): this file needs to be refactored, it's a port from
+// package:dev_compiler's tests
+library test.src.task.strong.strong_test_helper;
+
+import 'package:analyzer/file_system/file_system.dart';
+import 'package:analyzer/file_system/memory_file_system.dart';
+import 'package:analyzer/src/context/context.dart' show SdkAnalysisContext;
+import 'package:analyzer/src/generated/ast.dart';
+import 'package:analyzer/src/generated/element.dart';
+import 'package:analyzer/src/generated/engine.dart' hide SdkAnalysisContext;
+import 'package:analyzer/src/generated/error.dart';
+import 'package:analyzer/src/generated/sdk.dart';
+import 'package:analyzer/src/generated/source.dart';
+import 'package:analyzer/src/task/strong/checker.dart';
+import 'package:analyzer/src/task/strong/rules.dart';
+import 'package:logging/logging.dart'; // TODO(jmesserly): remove
+import 'package:source_span/source_span.dart'; // TODO(jmesserly): remove
+import 'package:unittest/unittest.dart';
+
+/// Run the checker on a program with files contents as indicated in
+/// [testFiles].
+///
+/// This function makes several assumptions to make it easier to describe error
+/// expectations:
+///
+///   * a file named `/main.dart` exists in [testFiles].
+///   * all expected failures are listed in the source code using comments
+///   immediately in front of the AST node that should contain the error.
+///   * errors are formatted as a token `level:Type`, where `level` is the
+///   logging level were the error would be reported at, and `Type` is the
+///   concrete subclass of [StaticInfo] that denotes the error.
+///
+/// For example, to check that an assignment produces a warning about a boxing
+/// conversion, you can describe the test as follows:
+///
+///     testChecker({
+///       '/main.dart': '''
+///           testMethod() {
+///             dynamic x = /*warning:Box*/3;
+///           }
+///       '''
+///     });
+///
+void testChecker(String name, Map<String, String> testFiles) {
+  test(name, () {
+    expect(testFiles.containsKey('/main.dart'), isTrue,
+        reason: '`/main.dart` is missing in testFiles');
+
+    var provider = new MemoryResourceProvider();
+    testFiles.forEach((key, value) {
+      var scheme = 'package:';
+      if (key.startsWith(scheme)) {
+        key = '/packages/${key.substring(scheme.length)}';
+      }
+      provider.newFile(key, value);
+    });
+    var uriResolver = new TestUriResolver(provider);
+    // Enable task model strong mode
+    AnalysisEngine.instance.useTaskModel = true;
+    var context = AnalysisEngine.instance.createAnalysisContext();
+    context.analysisOptions.strongMode = true;
+
+    context.sourceFactory = new SourceFactory([
+      new MockDartSdk(mockSdkSources, reportMissing: true).resolver,
+      uriResolver
+    ]);
+
+    // Run the checker on /main.dart.
+    Source mainSource = uriResolver.resolveAbsolute(new Uri.file('/main.dart'));
+    var initialLibrary =
+        context.resolveCompilationUnit2(mainSource, mainSource);
+
+    var collector = new _ErrorCollector();
+    var checker = new CodeChecker(
+        new TypeRules(context.typeProvider), collector,
+        hints: true);
+
+    // Extract expectations from the comments in the test files, and
+    // check that all errors we emit are included in the expected map.
+    var allLibraries = reachableLibraries(initialLibrary.element.library);
+    for (var lib in allLibraries) {
+      for (var unit in lib.units) {
+        var errors = <AnalysisError>[];
+        collector.errors = errors;
+
+        var source = unit.source;
+        if (source.uri.scheme == 'dart') continue;
+
+        var librarySource = context.getLibrariesContaining(source).single;
+        var resolved = context.resolveCompilationUnit2(source, librarySource);
+        checker.visitCompilationUnit(resolved);
+
+        new _ExpectedErrorVisitor(errors).validate(resolved);
+      }
+    }
+  });
+}
+
+class _ErrorCollector implements AnalysisErrorListener {
+  List<AnalysisError> errors;
+  final bool hints;
+  _ErrorCollector({this.hints: true});
+
+  void onError(AnalysisError error) {
+    // Unless DDC hints are requested, filter them out.
+    var HINT = ErrorSeverity.INFO.ordinal;
+    if (hints || error.errorCode.errorSeverity.ordinal > HINT) {
+      errors.add(error);
+    }
+  }
+}
+
+class TestUriResolver extends ResourceUriResolver {
+  final MemoryResourceProvider provider;
+  TestUriResolver(provider)
+      : provider = provider,
+        super(provider);
+
+  @override
+  Source resolveAbsolute(Uri uri, [Uri actualUri]) {
+    if (uri.scheme == 'package') {
+      return (provider.getResource('/packages/' + uri.path) as File)
+          .createSource(uri);
+    }
+    return super.resolveAbsolute(uri, actualUri);
+  }
+}
+
+class _ExpectedErrorVisitor extends UnifyingAstVisitor {
+  final Set<AnalysisError> _actualErrors;
+  CompilationUnit _unit;
+  String _unitSourceCode;
+
+  _ExpectedErrorVisitor(List<AnalysisError> actualErrors)
+      : _actualErrors = new Set.from(actualErrors);
+
+  validate(CompilationUnit unit) {
+    _unit = unit;
+    // This reads the file. Only safe because tests use MemoryFileSystem.
+    _unitSourceCode = unit.element.source.contents.data;
+
+    // Visit the compilation unit.
+    unit.accept(this);
+
+    if (_actualErrors.isNotEmpty) {
+      var actualMsgs = _actualErrors.map(_formatActualError).join('\n');
+      fail('Unexpected errors reported by checker:\n\n$actualMsgs');
+    }
+  }
+
+  visitNode(AstNode node) {
+    var token = node.beginToken;
+    var comment = token.precedingComments;
+    // Use error marker found in an immediately preceding comment,
+    // and attach it to the outermost expression that starts at that token.
+    if (comment != null) {
+      while (comment.next != null) {
+        comment = comment.next;
+      }
+      if (comment.end == token.offset && node.parent.beginToken != token) {
+        var commentText = '$comment';
+        var start = commentText.lastIndexOf('/*');
+        var end = commentText.lastIndexOf('*/');
+        if (start != -1 && end != -1) {
+          expect(start, lessThan(end));
+          var errors = commentText.substring(start + 2, end).split(',');
+          var expectations =
+              errors.map(_ErrorExpectation.parse).where((x) => x != null);
+
+          for (var e in expectations) _expectError(node, e);
+        }
+      }
+    }
+    return super.visitNode(node);
+  }
+
+  void _expectError(AstNode node, _ErrorExpectation expected) {
+    // See if we can find the expected error in our actual errors
+    for (var actual in _actualErrors) {
+      if (actual.offset == node.offset && actual.length == node.length) {
+        var actualMsg = _formatActualError(actual);
+        expect(_actualErrorLevel(actual), expected.level,
+            reason: 'expected different error code at:\n\n$actualMsg');
+        expect(errorCodeName(actual.errorCode), expected.typeName,
+            reason: 'expected different error type at:\n\n$actualMsg');
+
+        // We found it. Stop the search.
+        _actualErrors.remove(actual);
+        return;
+      }
+    }
+
+    var span = _createSpan(node.offset, node.length);
+    var levelName = expected.level.name.toLowerCase();
+    var msg = span.message(expected.typeName, color: colorOf(levelName));
+    fail('expected error was not reported at:\n\n$levelName: $msg');
+  }
+
+  Level _actualErrorLevel(AnalysisError actual) {
+    return const <ErrorSeverity, Level>{
+      ErrorSeverity.ERROR: Level.SEVERE,
+      ErrorSeverity.WARNING: Level.WARNING,
+      ErrorSeverity.INFO: Level.INFO
+    }[actual.errorCode.errorSeverity];
+  }
+
+  String _formatActualError(AnalysisError actual) {
+    var span = _createSpan(actual.offset, actual.length);
+    var levelName = _actualErrorLevel(actual).name.toLowerCase();
+    var msg = span.message(actual.message, color: colorOf(levelName));
+    return '$levelName: [${errorCodeName(actual.errorCode)}] $msg';
+  }
+
+  SourceSpan _createSpan(int offset, int len) {
+    return createSpanHelper(_unit.lineInfo, offset, offset + len,
+        _unit.element.source, _unitSourceCode);
+  }
+}
+
+SourceLocation locationForOffset(LineInfo lineInfo, Uri uri, int offset) {
+  var loc = lineInfo.getLocation(offset);
+  return new SourceLocation(offset,
+      sourceUrl: uri, line: loc.lineNumber - 1, column: loc.columnNumber - 1);
+}
+
+SourceSpanWithContext createSpanHelper(
+    LineInfo lineInfo, int start, int end, Source source, String content) {
+  var startLoc = locationForOffset(lineInfo, source.uri, start);
+  var endLoc = locationForOffset(lineInfo, source.uri, end);
+
+  var lineStart = startLoc.offset - startLoc.column;
+  // Find the end of the line. This is not exposed directly on LineInfo, but
+  // we can find it pretty easily.
+  // TODO(jmesserly): for now we do the simple linear scan. Ideally we can get
+  // some help from the LineInfo API.
+  int lineEnd = endLoc.offset;
+  int lineNum = lineInfo.getLocation(lineEnd).lineNumber;
+  while (lineEnd < content.length &&
+      lineInfo.getLocation(++lineEnd).lineNumber == lineNum);
+
+  var text = content.substring(start, end);
+  var lineText = content.substring(lineStart, lineEnd);
+  return new SourceSpanWithContext(startLoc, endLoc, text, lineText);
+}
+
+/// Describes an expected message that should be produced by the checker.
+class _ErrorExpectation {
+  final Level level;
+  final String typeName;
+  _ErrorExpectation(this.level, this.typeName);
+
+  static _ErrorExpectation _parse(String descriptor) {
+    var tokens = descriptor.split(':');
+    expect(tokens.length, 2, reason: 'invalid error descriptor');
+    var name = tokens[0].toUpperCase();
+    var typeName = tokens[1];
+
+    var level =
+        Level.LEVELS.firstWhere((l) => l.name == name, orElse: () => null);
+    expect(level, isNotNull,
+        reason: 'invalid level in error descriptor: `${tokens[0]}`');
+    expect(typeName, isNotNull,
+        reason: 'invalid type in error descriptor: ${tokens[1]}');
+    return new _ErrorExpectation(level, typeName);
+  }
+
+  static _ErrorExpectation parse(String descriptor) {
+    descriptor = descriptor.trim();
+    var tokens = descriptor.split(' ');
+    if (tokens.length == 1) return _parse(tokens[0]);
+    expect(tokens.length, 4, reason: 'invalid error descriptor');
+    expect(tokens[1], "should", reason: 'invalid error descriptor');
+    expect(tokens[2], "be", reason: 'invalid error descriptor');
+    if (tokens[0] == "pass") return null;
+    // TODO(leafp) For now, we just use whatever the current expectation is,
+    // eventually we could do more automated reporting here.
+    return _parse(tokens[0]);
+  }
+
+  String toString() => '$level $typeName';
+}
+
+/// Dart SDK which contains a mock implementation of the SDK libraries. May be
+/// used to speed up execution when most of the core libraries is not needed.
+class MockDartSdk implements DartSdk {
+  final Map<Uri, _MockSdkSource> _sources = {};
+  final bool reportMissing;
+  final Map<String, SdkLibrary> _libs = {};
+  final String sdkVersion = '0';
+  List<String> get uris => _sources.keys.map((uri) => '$uri').toList();
+  final AnalysisContext context = new SdkAnalysisContext();
+  DartUriResolver _resolver;
+  DartUriResolver get resolver => _resolver;
+
+  MockDartSdk(Map<String, String> sources, {this.reportMissing}) {
+    sources.forEach((uriString, contents) {
+      var uri = Uri.parse(uriString);
+      _sources[uri] = new _MockSdkSource(uri, contents);
+      _libs[uriString] = new SdkLibraryImpl(uri.path)
+        ..setDart2JsLibrary()
+        ..setVmLibrary();
+    });
+    _resolver = new DartUriResolver(this);
+    context.sourceFactory = new SourceFactory([_resolver]);
+  }
+
+  List<SdkLibrary> get sdkLibraries => _libs.values.toList();
+  SdkLibrary getSdkLibrary(String dartUri) => _libs[dartUri];
+  Source mapDartUri(String dartUri) => _getSource(Uri.parse(dartUri));
+
+  Source fromEncoding(UriKind kind, Uri uri) {
+    if (kind != UriKind.DART_URI) {
+      throw new UnsupportedError('expected dart: uri kind, got $kind.');
+    }
+    return _getSource(uri);
+  }
+
+  Source _getSource(Uri uri) {
+    var src = _sources[uri];
+    if (src == null) {
+      if (reportMissing) print('warning: missing mock for $uri.');
+      _sources[uri] =
+          src = new _MockSdkSource(uri, 'library dart.${uri.path};');
+    }
+    return src;
+  }
+
+  @override
+  Source fromFileUri(Uri uri) {
+    throw new UnsupportedError('MockDartSdk.fromFileUri');
+  }
+}
+
+class _MockSdkSource implements Source {
+  /// Absolute URI which this source can be imported from.
+  final Uri uri;
+  final String _contents;
+
+  _MockSdkSource(this.uri, this._contents);
+
+  bool exists() => true;
+
+  int get hashCode => uri.hashCode;
+
+  final int modificationStamp = 1;
+
+  TimestampedData<String> get contents =>
+      new TimestampedData(modificationStamp, _contents);
+
+  String get encoding => "${uriKind.encoding}$uri";
+
+  Source get source => this;
+
+  String get fullName => shortName;
+
+  String get shortName => uri.path;
+
+  UriKind get uriKind => UriKind.DART_URI;
+
+  bool get isInSystemLibrary => true;
+
+  Source resolveRelative(Uri relativeUri) =>
+      throw new UnsupportedError('not expecting relative urls in dart: mocks');
+
+  Uri resolveRelativeUri(Uri relativeUri) =>
+      throw new UnsupportedError('not expecting relative urls in dart: mocks');
+}
+
+/// Sample mock SDK sources.
+final Map<String, String> mockSdkSources = {
+  // The list of types below is derived from:
+  //   * types we use via our smoke queries, including HtmlElement and
+  //     types from `_typeHandlers` (deserialize.dart)
+  //   * types that are used internally by the resolver (see
+  //   _initializeFrom in resolver.dart).
+  'dart:core': '''
+        library dart.core;
+
+        void print(Object o) {}
+
+        class Object {
+          int get hashCode {}
+          Type get runtimeType {}
+          String toString(){}
+          bool ==(other){}
+        }
+        class Function {}
+        class StackTrace {}
+        class Symbol {}
+        class Type {}
+
+        class String {
+          String operator +(String other) {}
+        }
+        class bool {}
+        class num {
+          num operator +(num other) {}
+        }
+        class int extends num {
+          bool operator<(num other) {}
+          int operator-() {}
+        }
+        class double extends num {}
+        class DateTime {}
+        class Null {}
+
+        class Deprecated {
+          final String expires;
+          const Deprecated(this.expires);
+        }
+        const Object deprecated = const Deprecated("next release");
+        class _Override { const _Override(); }
+        const Object override = const _Override();
+        class _Proxy { const _Proxy(); }
+        const Object proxy = const _Proxy();
+
+        class Iterable<E> {
+          fold(initialValue, combine(previousValue, E element)) {}
+          Iterable map(f(E element)) {}
+        }
+        class List<E> implements Iterable<E> {
+          List([int length]);
+          List.filled(int length, E fill);
+        }
+        class Map<K, V> {
+          Iterable<K> get keys {}
+        }
+        ''',
+  'dart:async': '''
+        class Future<T> {
+          Future(computation()) {}
+          Future.value(T t) {}
+          Future then(onValue(T value)) {}
+          static Future<List> wait(Iterable<Future> futures) {}
+        }
+        class Stream<T> {}
+  ''',
+  'dart:html': '''
+        library dart.html;
+        class HtmlElement {}
+        ''',
+  'dart:math': '''
+        library dart.math;
+        class Random {
+          bool nextBool() {}
+        }
+        num min(num x, num y) {}
+        num max(num x, num y) {}
+        ''',
+};
+
+/// Returns all libraries transitively imported or exported from [start].
+List<LibraryElement> reachableLibraries(LibraryElement start) {
+  var results = <LibraryElement>[];
+  var seen = new Set();
+  void find(LibraryElement lib) {
+    if (seen.contains(lib)) return;
+    seen.add(lib);
+    results.add(lib);
+    lib.importedLibraries.forEach(find);
+    lib.exportedLibraries.forEach(find);
+  }
+  find(start);
+  return results;
+}
+
+String errorCodeName(ErrorCode errorCode) {
+  var name = errorCode.name;
+  final prefix = 'dev_compiler.';
+  if (name.startsWith(prefix)) {
+    return name.substring(prefix.length);
+  } else {
+    // TODO(jmesserly): this is for backwards compat, but not sure it's very
+    // useful to log this.
+    return 'AnalyzerMessage';
+  }
+}
+
+/// Returns an ANSII color escape sequence corresponding to [levelName]. Colors
+/// are defined for: severe, error, warning, or info. Returns null if the level
+/// name is not recognized.
+String colorOf(String levelName) {
+  levelName = levelName.toLowerCase();
+  if (levelName == 'shout' || levelName == 'severe' || levelName == 'error') {
+    return _RED_COLOR;
+  }
+  if (levelName == 'warning') return _MAGENTA_COLOR;
+  if (levelName == 'info') return _CYAN_COLOR;
+  return null;
+}
+
+const String _RED_COLOR = '\u001b[31m';
+const String _MAGENTA_COLOR = '\u001b[35m';
+const String _CYAN_COLOR = '\u001b[36m';
+const String GREEN_COLOR = '\u001b[32m';
+const String NO_COLOR = '\u001b[0m';
diff --git a/pkg/analyzer/test/src/task/strong_mode_test.dart b/pkg/analyzer/test/src/task/strong_mode_test.dart
new file mode 100644
index 0000000..ff87d92
--- /dev/null
+++ b/pkg/analyzer/test/src/task/strong_mode_test.dart
@@ -0,0 +1,1049 @@
+// 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 test.src.task.strong_mode_test;
+
+import 'package:analyzer/src/generated/ast.dart';
+import 'package:analyzer/src/generated/element.dart';
+import 'package:analyzer/src/generated/source.dart';
+import 'package:analyzer/src/task/strong_mode.dart';
+import 'package:unittest/unittest.dart';
+
+import '../../reflective_tests.dart';
+import '../../utils.dart';
+import '../context/abstract_context.dart';
+
+main() {
+  initializeTestEnvironment();
+  runReflectiveTests(InstanceMemberInferrerTest);
+  runReflectiveTests(VariableGathererTest);
+}
+
+@reflectiveTest
+class InstanceMemberInferrerTest extends AbstractContextTest {
+  InstanceMemberInferrer get createInferrer =>
+      new InstanceMemberInferrer(context.typeProvider,
+          typeSystem: context.typeSystem);
+
+  /**
+   * Add a source with the given [content] and return the result of resolving
+   * the source.
+   */
+  CompilationUnitElement resolve(String content) {
+    Source source = addSource('/test.dart', content);
+    return context.resolveCompilationUnit2(source, source).element;
+  }
+
+  void test_creation() {
+    InstanceMemberInferrer inferrer = createInferrer;
+    expect(inferrer, isNotNull);
+    expect(inferrer.typeSystem, isNotNull);
+  }
+
+  void test_inferCompilationUnit_field_multiple_different() {
+    InstanceMemberInferrer inferrer = createInferrer;
+    String fieldName = 'f';
+    CompilationUnitElement unit = resolve('''
+class A {
+  int $fieldName;
+}
+class B {
+  double $fieldName;
+}
+class C implements A, B {
+  var $fieldName;
+}
+''');
+    ClassElement classC = unit.getType('C');
+    FieldElement fieldC = classC.getField(fieldName);
+    PropertyAccessorElement getterC = classC.getGetter(fieldName);
+    expect(fieldC.type.isDynamic, isTrue);
+    expect(getterC.returnType.isDynamic, isTrue);
+
+    inferrer.inferCompilationUnit(unit);
+
+    expect(fieldC.type.isDynamic, isTrue);
+    expect(getterC.returnType.isDynamic, isTrue);
+  }
+
+  void test_inferCompilationUnit_field_multiple_different_generic() {
+    InstanceMemberInferrer inferrer = createInferrer;
+    String fieldName = 'f';
+    CompilationUnitElement unit = resolve('''
+class A<E> {
+  E $fieldName;
+}
+class B<E> {
+  E $fieldName;
+}
+class C implements A<int>, B<double> {
+  var $fieldName;
+}
+''');
+    ClassElement classC = unit.getType('C');
+    FieldElement fieldC = classC.getField(fieldName);
+    PropertyAccessorElement getterC = classC.getGetter(fieldName);
+    expect(fieldC.type.isDynamic, isTrue);
+    expect(getterC.returnType.isDynamic, isTrue);
+
+    inferrer.inferCompilationUnit(unit);
+
+    expect(fieldC.type.isDynamic, isTrue);
+    expect(getterC.returnType.isDynamic, isTrue);
+  }
+
+  void test_inferCompilationUnit_field_multiple_dynamic() {
+    InstanceMemberInferrer inferrer = createInferrer;
+    String fieldName = 'f';
+    CompilationUnitElement unit = resolve('''
+class A {
+  int $fieldName;
+}
+class B {
+  var $fieldName;
+}
+class C implements A, B {
+  var $fieldName;
+}
+''');
+    ClassElement classC = unit.getType('C');
+    FieldElement fieldC = classC.getField(fieldName);
+    PropertyAccessorElement getterC = classC.getGetter(fieldName);
+    expect(fieldC.type.isDynamic, isTrue);
+    expect(getterC.returnType.isDynamic, isTrue);
+
+    inferrer.inferCompilationUnit(unit);
+
+    expect(fieldC.type.isDynamic, isTrue);
+    expect(getterC.returnType.isDynamic, isTrue);
+  }
+
+  void test_inferCompilationUnit_field_multiple_same() {
+    InstanceMemberInferrer inferrer = createInferrer;
+    String fieldName = 'f';
+    CompilationUnitElement unit = resolve('''
+class A {
+  int $fieldName;
+}
+class B {
+  int $fieldName;
+}
+class C implements A, B {
+  var $fieldName;
+}
+''');
+    ClassElement classA = unit.getType('A');
+    FieldElement fieldA = classA.getField(fieldName);
+    DartType expectedType = fieldA.type;
+    ClassElement classC = unit.getType('C');
+    FieldElement fieldC = classC.getField(fieldName);
+    PropertyAccessorElement getterC = classC.getGetter(fieldName);
+    expect(fieldC.type.isDynamic, isTrue);
+    expect(getterC.returnType.isDynamic, isTrue);
+
+    inferrer.inferCompilationUnit(unit);
+
+    expect(fieldC.type, expectedType);
+    expect(getterC.returnType, expectedType);
+  }
+
+  void test_inferCompilationUnit_field_noOverride() {
+    InstanceMemberInferrer inferrer = createInferrer;
+    String fieldName = 'f';
+    CompilationUnitElement unit = resolve('''
+class A {
+  final $fieldName = 0;
+}
+''');
+    ClassElement classA = unit.getType('A');
+    FieldElement fieldA = classA.getField(fieldName);
+    PropertyAccessorElement getterA = classA.getGetter(fieldName);
+    expect(fieldA.type.isDynamic, isTrue);
+    expect(getterA.returnType.isDynamic, isTrue);
+
+    inferrer.inferCompilationUnit(unit);
+
+    DartType intType = inferrer.typeProvider.intType;
+    expect(fieldA.type, intType);
+    expect(getterA.returnType, intType);
+  }
+
+  void test_inferCompilationUnit_field_noOverride_bottom() {
+    InstanceMemberInferrer inferrer = createInferrer;
+    String fieldName = 'f';
+    CompilationUnitElement unit = resolve('''
+class A {
+  var $fieldName = null;
+}
+''');
+    ClassElement classA = unit.getType('A');
+    FieldElement fieldA = classA.getField(fieldName);
+    PropertyAccessorElement getterA = classA.getGetter(fieldName);
+    expect(fieldA.type.isDynamic, isTrue);
+    expect(getterA.returnType.isDynamic, isTrue);
+
+    inferrer.inferCompilationUnit(unit);
+
+    expect(fieldA.type.isDynamic, isTrue);
+    expect(getterA.returnType.isDynamic, isTrue);
+  }
+
+  void test_inferCompilationUnit_field_single_explicitlyDynamic() {
+    InstanceMemberInferrer inferrer = createInferrer;
+    String fieldName = 'f';
+    CompilationUnitElement unit = resolve('''
+class A {
+  dynamic $fieldName;
+}
+class B extends A {
+  var $fieldName = 0;
+}
+''');
+    ClassElement classA = unit.getType('A');
+    FieldElement fieldA = classA.getField(fieldName);
+    PropertyAccessorElement getterA = classA.getGetter(fieldName);
+    ClassElement classB = unit.getType('B');
+    FieldElement fieldB = classB.getField(fieldName);
+    PropertyAccessorElement getterB = classB.getGetter(fieldName);
+    expect(fieldB.type.isDynamic, isTrue);
+    expect(getterB.returnType.isDynamic, isTrue);
+
+    inferrer.inferCompilationUnit(unit);
+
+    expect(fieldB.type, fieldA.type);
+    expect(getterB.returnType, getterA.returnType);
+  }
+
+  void test_inferCompilationUnit_field_single_final() {
+    InstanceMemberInferrer inferrer = createInferrer;
+    String fieldName = 'f';
+    CompilationUnitElement unit = resolve('''
+class A {
+  final int $fieldName;
+}
+class B extends A {
+  final $fieldName;
+}
+''');
+    ClassElement classA = unit.getType('A');
+    FieldElement fieldA = classA.getField(fieldName);
+    PropertyAccessorElement getterA = classA.getGetter(fieldName);
+    ClassElement classB = unit.getType('B');
+    FieldElement fieldB = classB.getField(fieldName);
+    PropertyAccessorElement getterB = classB.getGetter(fieldName);
+    expect(fieldB.type.isDynamic, isTrue);
+    expect(getterB.returnType.isDynamic, isTrue);
+
+    inferrer.inferCompilationUnit(unit);
+
+    expect(fieldB.type, fieldA.type);
+    expect(getterB.returnType, getterA.returnType);
+  }
+
+  void test_inferCompilationUnit_field_single_final_narrowType() {
+    InstanceMemberInferrer inferrer = createInferrer;
+    String fieldName = 'f';
+    CompilationUnitElement unit = resolve('''
+class A {
+  final $fieldName;
+}
+class B extends A {
+  final $fieldName = 0;
+}
+''');
+    ClassElement classB = unit.getType('B');
+    FieldElement fieldB = classB.getField(fieldName);
+    PropertyAccessorElement getterB = classB.getGetter(fieldName);
+    expect(fieldB.type.isDynamic, isTrue);
+    expect(getterB.returnType.isDynamic, isTrue);
+
+    inferrer.inferCompilationUnit(unit);
+
+    expect(fieldB.type, inferrer.typeProvider.intType);
+    expect(getterB.returnType, fieldB.type);
+  }
+
+  void test_inferCompilationUnit_field_single_generic() {
+    InstanceMemberInferrer inferrer = createInferrer;
+    String fieldName = 'f';
+    CompilationUnitElement unit = resolve('''
+class A<E> {
+  E $fieldName;
+}
+class B<E> extends A<E> {
+  var $fieldName;
+}
+''');
+    ClassElement classB = unit.getType('B');
+    DartType typeBE = classB.typeParameters[0].type;
+    FieldElement fieldB = classB.getField(fieldName);
+    PropertyAccessorElement getterB = classB.getGetter(fieldName);
+    expect(fieldB.type.isDynamic, isTrue);
+    expect(getterB.returnType.isDynamic, isTrue);
+
+    inferrer.inferCompilationUnit(unit);
+
+    expect(fieldB.type, typeBE);
+    expect(getterB.returnType, typeBE);
+  }
+
+  void test_inferCompilationUnit_field_single_inconsistentAccessors() {
+    InstanceMemberInferrer inferrer = createInferrer;
+    String fieldName = 'f';
+    CompilationUnitElement unit = resolve('''
+class A {
+  int get $fieldName => 0;
+  set $fieldName(String value) {}
+}
+class B extends A {
+  var $fieldName;
+}
+''');
+    ClassElement classB = unit.getType('B');
+    FieldElement fieldB = classB.getField(fieldName);
+    PropertyAccessorElement getterB = classB.getGetter(fieldName);
+    expect(fieldB.type.isDynamic, isTrue);
+    expect(getterB.returnType.isDynamic, isTrue);
+
+    inferrer.inferCompilationUnit(unit);
+
+    expect(fieldB.type.isDynamic, isTrue);
+    expect(getterB.returnType.isDynamic, isTrue);
+  }
+
+  void test_inferCompilationUnit_field_single_noModifiers() {
+    InstanceMemberInferrer inferrer = createInferrer;
+    String fieldName = 'f';
+    CompilationUnitElement unit = resolve('''
+class A {
+  int $fieldName;
+}
+class B extends A {
+  var $fieldName;
+}
+''');
+    ClassElement classA = unit.getType('A');
+    FieldElement fieldA = classA.getField(fieldName);
+    PropertyAccessorElement getterA = classA.getGetter(fieldName);
+    ClassElement classB = unit.getType('B');
+    FieldElement fieldB = classB.getField(fieldName);
+    PropertyAccessorElement getterB = classB.getGetter(fieldName);
+    expect(fieldB.type.isDynamic, isTrue);
+    expect(getterB.returnType.isDynamic, isTrue);
+
+    inferrer.inferCompilationUnit(unit);
+
+    expect(fieldB.type, fieldA.type);
+    expect(getterB.returnType, getterA.returnType);
+  }
+
+  void test_inferCompilationUnit_getter_multiple_different() {
+    InstanceMemberInferrer inferrer = createInferrer;
+    String getterName = 'g';
+    CompilationUnitElement unit = resolve('''
+class A {
+  int get $getterName => 0;
+}
+class B {
+  double get $getterName => 0.0;
+}
+class C implements A, B {
+  get $getterName => 0;
+}
+''');
+    ClassElement classC = unit.getType('C');
+    FieldElement fieldC = classC.getField(getterName);
+    PropertyAccessorElement getterC = classC.getGetter(getterName);
+    expect(fieldC.type.isDynamic, isTrue);
+    expect(getterC.returnType.isDynamic, isTrue);
+
+    inferrer.inferCompilationUnit(unit);
+
+    expect(fieldC.type.isDynamic, isTrue);
+    expect(getterC.returnType.isDynamic, isTrue);
+  }
+
+  void test_inferCompilationUnit_getter_multiple_dynamic() {
+    InstanceMemberInferrer inferrer = createInferrer;
+    String getterName = 'g';
+    CompilationUnitElement unit = resolve('''
+class A {
+  int get $getterName => 0;
+}
+class B {
+  get $getterName => 0;
+}
+class C implements A, B {
+  get $getterName => 0;
+}
+''');
+    ClassElement classC = unit.getType('C');
+    FieldElement fieldC = classC.getField(getterName);
+    PropertyAccessorElement getterC = classC.getGetter(getterName);
+    expect(fieldC.type.isDynamic, isTrue);
+    expect(getterC.returnType.isDynamic, isTrue);
+
+    inferrer.inferCompilationUnit(unit);
+
+    expect(fieldC.type.isDynamic, isTrue);
+    expect(getterC.returnType.isDynamic, isTrue);
+  }
+
+  void test_inferCompilationUnit_getter_multiple_same() {
+    InstanceMemberInferrer inferrer = createInferrer;
+    String getterName = 'g';
+    CompilationUnitElement unit = resolve('''
+class A {
+  String get $getterName => '';
+}
+class B {
+  String get $getterName => '';
+}
+class C implements A, B {
+  get $getterName => '';
+}
+''');
+    ClassElement classA = unit.getType('A');
+    PropertyAccessorElement getterA = classA.getGetter(getterName);
+    DartType expectedType = getterA.returnType;
+    ClassElement classC = unit.getType('C');
+    FieldElement fieldC = classC.getField(getterName);
+    PropertyAccessorElement getterC = classC.getGetter(getterName);
+    expect(fieldC.type.isDynamic, isTrue);
+    expect(getterC.returnType.isDynamic, isTrue);
+
+    inferrer.inferCompilationUnit(unit);
+
+    expect(fieldC.type, expectedType);
+    expect(getterC.returnType, expectedType);
+  }
+
+  void test_inferCompilationUnit_getter_single() {
+    InstanceMemberInferrer inferrer = createInferrer;
+    String getterName = 'g';
+    CompilationUnitElement unit = resolve('''
+class A {
+  int get $getterName => 0;
+}
+class B extends A {
+  get $getterName => 0;
+}
+''');
+    ClassElement classA = unit.getType('A');
+    FieldElement fieldA = classA.getField(getterName);
+    PropertyAccessorElement getterA = classA.getGetter(getterName);
+    ClassElement classB = unit.getType('B');
+    FieldElement fieldB = classB.getField(getterName);
+    PropertyAccessorElement getterB = classB.getGetter(getterName);
+    expect(fieldB.type.isDynamic, isTrue);
+    expect(getterB.returnType.isDynamic, isTrue);
+
+    inferrer.inferCompilationUnit(unit);
+
+    expect(fieldB.type, fieldA.type);
+    expect(getterB.returnType, getterA.returnType);
+  }
+
+  void test_inferCompilationUnit_getter_single_generic() {
+    InstanceMemberInferrer inferrer = createInferrer;
+    String getterName = 'g';
+    CompilationUnitElement unit = resolve('''
+class A<E> {
+  E get $getterName => 0;
+}
+class B<E> extends A<E> {
+  get $getterName => 0;
+}
+''');
+    ClassElement classB = unit.getType('B');
+    DartType typeBE = classB.typeParameters[0].type;
+    FieldElement fieldB = classB.getField(getterName);
+    PropertyAccessorElement getterB = classB.getGetter(getterName);
+    expect(fieldB.type.isDynamic, isTrue);
+    expect(getterB.returnType.isDynamic, isTrue);
+
+    inferrer.inferCompilationUnit(unit);
+
+    expect(fieldB.type, typeBE);
+    expect(getterB.returnType, typeBE);
+  }
+
+  void test_inferCompilationUnit_getter_single_inconsistentAccessors() {
+    InstanceMemberInferrer inferrer = createInferrer;
+    String getterName = 'g';
+    CompilationUnitElement unit = resolve('''
+class A {
+  int get $getterName => 0;
+  set $getterName(String value) {}
+}
+class B extends A {
+  var get $getterName => 1;
+}
+''');
+    ClassElement classA = unit.getType('A');
+    FieldElement fieldA = classA.getField(getterName);
+    PropertyAccessorElement getterA = classA.getGetter(getterName);
+    ClassElement classB = unit.getType('B');
+    FieldElement fieldB = classB.getField(getterName);
+    PropertyAccessorElement getterB = classB.getGetter(getterName);
+    expect(fieldB.type.isDynamic, isTrue);
+    expect(getterB.returnType.isDynamic, isTrue);
+
+    inferrer.inferCompilationUnit(unit);
+
+    // Expected behavior is that the getter is inferred: getters and setters
+    // are treated as independent methods.
+    expect(fieldB.type, fieldA.type);
+    expect(getterB.returnType, getterA.returnType);
+  }
+
+  void test_inferCompilationUnit_setter_single() {
+    InstanceMemberInferrer inferrer = createInferrer;
+    String setterName = 'g';
+    CompilationUnitElement unit = resolve('''
+class A {
+  set $setterName(int x) {}
+}
+class B extends A {
+  set $setterName(x) {}
+}
+''');
+    ClassElement classA = unit.getType('A');
+    FieldElement fieldA = classA.getField(setterName);
+    PropertyAccessorElement setterA = classA.getSetter(setterName);
+    ClassElement classB = unit.getType('B');
+    FieldElement fieldB = classB.getField(setterName);
+    PropertyAccessorElement setterB = classB.getSetter(setterName);
+    expect(fieldB.type.isDynamic, isTrue);
+    expect(setterB.parameters[0].type.isDynamic, isTrue);
+
+    inferrer.inferCompilationUnit(unit);
+
+    expect(fieldB.type, fieldA.type);
+    expect(setterB.parameters[0].type, setterA.parameters[0].type);
+  }
+
+  void test_inferCompilationUnit_setter_single_generic() {
+    InstanceMemberInferrer inferrer = createInferrer;
+    String setterName = 'g';
+    CompilationUnitElement unit = resolve('''
+class A<E> {
+  set $setterName(E x) {}
+}
+class B<E> extends A<E> {
+  set $setterName(x) {}
+}
+''');
+    ClassElement classB = unit.getType('B');
+    DartType typeBE = classB.typeParameters[0].type;
+    FieldElement fieldB = classB.getField(setterName);
+    PropertyAccessorElement setterB = classB.getSetter(setterName);
+    expect(fieldB.type.isDynamic, isTrue);
+    expect(setterB.parameters[0].type.isDynamic, isTrue);
+
+    inferrer.inferCompilationUnit(unit);
+
+    expect(fieldB.type, typeBE);
+    expect(setterB.parameters[0].type, typeBE);
+  }
+
+  void test_inferCompilationUnit_setter_single_inconsistentAccessors() {
+    InstanceMemberInferrer inferrer = createInferrer;
+    String getterName = 'g';
+    CompilationUnitElement unit = resolve('''
+class A {
+  int get $getterName => 0;
+  set $getterName(String value) {}
+}
+class B extends A {
+  set $getterName(x) {}
+}
+''');
+    ClassElement classA = unit.getType('A');
+    PropertyAccessorElement setterA = classA.getSetter(getterName);
+    ClassElement classB = unit.getType('B');
+    FieldElement fieldB = classB.getField(getterName);
+    PropertyAccessorElement setterB = classB.getSetter(getterName);
+    expect(fieldB.type.isDynamic, isTrue);
+    expect(setterB.parameters[0].type.isDynamic, isTrue);
+
+    inferrer.inferCompilationUnit(unit);
+
+    // Expected behavior is that the getter is inferred: getters and setters
+    // are treated as independent methods.
+    expect(setterB.parameters[0].type, setterA.parameters[0].type);
+
+    // Note that B's synthetic field type will be String. This matches what
+    // resolver would do if we explicitly typed the parameter as 'String'
+    expect(fieldB.type, setterB.parameters[0].type);
+  }
+
+  void test_inferCompilationUnit_invalid_inheritanceCycle() {
+    InstanceMemberInferrer inferrer = createInferrer;
+    CompilationUnitElement unit = resolve('''
+class A extends C {}
+class B extends A {}
+class C extends B {}
+''');
+    inferrer.inferCompilationUnit(unit);
+  }
+
+  void test_inferCompilationUnit_method_parameter_multiple_different() {
+    InstanceMemberInferrer inferrer = createInferrer;
+    String methodName = 'm';
+    CompilationUnitElement unit = resolve('''
+class A {
+  $methodName(int p) => 0;
+}
+class B {
+  $methodName(double p) => 0;
+}
+class C implements A, B {
+  $methodName(p) => 0;
+}
+''');
+    ClassElement classC = unit.getType('C');
+    MethodElement methodC = classC.getMethod(methodName);
+    ParameterElement parameterC = methodC.parameters[0];
+    expect(parameterC.type.isDynamic, isTrue);
+
+    inferrer.inferCompilationUnit(unit);
+
+    expect(parameterC.type.isDynamic, isTrue);
+  }
+
+  void test_inferCompilationUnit_method_parameter_multiple_named_different() {
+    InstanceMemberInferrer inferrer = createInferrer;
+    String methodName = 'm';
+    CompilationUnitElement unit = resolve('''
+class A {
+  $methodName({int p}) => 0;
+}
+class B {
+  $methodName({int q}) => 0;
+}
+class C implements A, B {
+  $methodName({p}) => 0;
+}
+''');
+    ClassElement classC = unit.getType('C');
+    MethodElement methodC = classC.getMethod(methodName);
+    ParameterElement parameterC = methodC.parameters[0];
+    expect(parameterC.type.isDynamic, isTrue);
+
+    inferrer.inferCompilationUnit(unit);
+
+    expect(parameterC.type.isDynamic, isTrue);
+  }
+
+  void test_inferCompilationUnit_method_parameter_multiple_named_same() {
+    InstanceMemberInferrer inferrer = createInferrer;
+    String methodName = 'm';
+    CompilationUnitElement unit = resolve('''
+class A {
+  $methodName({int p}) => 0;
+}
+class B {
+  $methodName({int p}) => 0;
+}
+class C implements A, B {
+  $methodName({p}) => 0;
+}
+''');
+    ClassElement classA = unit.getType('A');
+    MethodElement methodA = classA.getMethod(methodName);
+    ParameterElement parameterA = methodA.parameters[0];
+    DartType expectedType = parameterA.type;
+    ClassElement classC = unit.getType('C');
+    MethodElement methodC = classC.getMethod(methodName);
+    ParameterElement parameterC = methodC.parameters[0];
+    expect(parameterC.type.isDynamic, isTrue);
+
+    inferrer.inferCompilationUnit(unit);
+
+    expect(parameterC.type, expectedType);
+  }
+
+  void test_inferCompilationUnit_method_parameter_multiple_namedAndRequired() {
+    InstanceMemberInferrer inferrer = createInferrer;
+    String methodName = 'm';
+    CompilationUnitElement unit = resolve('''
+class A {
+  $methodName({int p}) => 0;
+}
+class B {
+  $methodName(int p) => 0;
+}
+class C implements A, B {
+  $methodName(p) => 0;
+}
+''');
+    ClassElement classC = unit.getType('C');
+    MethodElement methodC = classC.getMethod(methodName);
+    ParameterElement parameterC = methodC.parameters[0];
+    expect(parameterC.type.isDynamic, isTrue);
+
+    inferrer.inferCompilationUnit(unit);
+
+    expect(parameterC.type.isDynamic, isTrue);
+  }
+
+  void test_inferCompilationUnit_method_parameter_multiple_optionalAndRequired() {
+    InstanceMemberInferrer inferrer = createInferrer;
+    String methodName = 'm';
+    CompilationUnitElement unit = resolve('''
+class A {
+  $methodName(int p) => 0;
+}
+class B {
+  $methodName([int p]) => 0;
+}
+class C implements A, B {
+  $methodName(p) => 0;
+}
+''');
+    ClassElement classA = unit.getType('A');
+    MethodElement methodA = classA.getMethod(methodName);
+    ParameterElement parameterA = methodA.parameters[0];
+    DartType expectedType = parameterA.type;
+    ClassElement classC = unit.getType('C');
+    MethodElement methodC = classC.getMethod(methodName);
+    ParameterElement parameterC = methodC.parameters[0];
+    expect(parameterC.type.isDynamic, isTrue);
+
+    inferrer.inferCompilationUnit(unit);
+
+    expect(parameterC.type, expectedType);
+  }
+
+  void test_inferCompilationUnit_method_parameter_single_generic() {
+    InstanceMemberInferrer inferrer = createInferrer;
+    String methodName = 'm';
+    CompilationUnitElement unit = resolve('''
+class A<E> {
+  $methodName(E p) => 0;
+}
+class C<E> implements A<E> {
+  $methodName(p) => 0;
+}
+''');
+    ClassElement classC = unit.getType('C');
+    DartType typeCE = classC.typeParameters[0].type;
+    MethodElement methodC = classC.getMethod(methodName);
+    ParameterElement parameterC = methodC.parameters[0];
+    expect(parameterC.type.isDynamic, isTrue);
+    expect(methodC.type.typeArguments, [typeCE]);
+
+    inferrer.inferCompilationUnit(unit);
+
+    expect(parameterC.type, classC.typeParameters[0].type);
+    expect(methodC.type.typeArguments, [typeCE],
+        reason: 'function type should still have type arguments');
+  }
+
+  void test_inferCompilationUnit_method_return_multiple_different() {
+    InstanceMemberInferrer inferrer = createInferrer;
+    String methodName = 'm';
+    CompilationUnitElement unit = resolve('''
+class A {
+  int $methodName() => 0;
+}
+class B {
+  double $methodName() => 0.0;
+}
+class C implements A, B {
+  $methodName() => 0;
+}
+''');
+    ClassElement classC = unit.getType('C');
+    MethodElement methodC = classC.getMethod(methodName);
+    expect(methodC.returnType.isDynamic, isTrue);
+
+    inferrer.inferCompilationUnit(unit);
+
+    expect(methodC.returnType.isDynamic, isTrue);
+  }
+
+  void test_inferCompilationUnit_method_return_multiple_different_generic() {
+    InstanceMemberInferrer inferrer = createInferrer;
+    String methodName = 'm';
+    CompilationUnitElement unit = resolve('''
+class A<E> {
+  E $methodName() => null;
+}
+class B<E> {
+  E $methodName() => null;
+}
+class C implements A<int>, B<double> {
+  $methodName() => null;
+}
+''');
+    ClassElement classC = unit.getType('C');
+    MethodElement methodC = classC.getMethod(methodName);
+    expect(methodC.returnType.isDynamic, isTrue);
+
+    inferrer.inferCompilationUnit(unit);
+
+    expect(methodC.returnType.isDynamic, isTrue);
+  }
+
+  void test_inferCompilationUnit_method_return_multiple_dynamic() {
+    InstanceMemberInferrer inferrer = createInferrer;
+    String methodName = 'm';
+    CompilationUnitElement unit = resolve('''
+class A {
+  int $methodName() => 0;
+}
+class B {
+  $methodName() => 0;
+}
+class C implements A, B {
+  $methodName() => 0;
+}
+''');
+    ClassElement classC = unit.getType('C');
+    MethodElement methodC = classC.getMethod(methodName);
+    expect(methodC.returnType.isDynamic, isTrue);
+
+    inferrer.inferCompilationUnit(unit);
+
+    expect(methodC.returnType.isDynamic, isTrue);
+  }
+
+  void test_inferCompilationUnit_method_return_multiple_same_generic() {
+    InstanceMemberInferrer inferrer = createInferrer;
+    String methodName = 'm';
+    CompilationUnitElement unit = resolve('''
+class A<E> {
+  E $methodName() => 0;
+}
+class B<E> {
+  E $methodName() => 0;
+}
+class C<E> implements A<E>, B<E> {
+  $methodName() => 0;
+}
+''');
+    ClassElement classC = unit.getType('C');
+    MethodElement methodC = classC.getMethod(methodName);
+    expect(methodC.returnType.isDynamic, isTrue);
+
+    inferrer.inferCompilationUnit(unit);
+
+    expect(methodC.returnType, classC.typeParameters[0].type);
+  }
+
+  void test_inferCompilationUnit_method_return_multiple_same_nonVoid() {
+    InstanceMemberInferrer inferrer = createInferrer;
+    String methodName = 'm';
+    CompilationUnitElement unit = resolve('''
+class A {
+  int $methodName() => 0;
+}
+class B {
+  int $methodName() => 0;
+}
+class C implements A, B {
+  $methodName() => 0;
+}
+''');
+    ClassElement classA = unit.getType('A');
+    MethodElement methodA = classA.getMethod(methodName);
+    DartType expectedType = methodA.returnType;
+    ClassElement classC = unit.getType('C');
+    MethodElement methodC = classC.getMethod(methodName);
+    expect(methodC.returnType.isDynamic, isTrue);
+
+    inferrer.inferCompilationUnit(unit);
+
+    expect(methodC.returnType, expectedType);
+  }
+
+  void test_inferCompilationUnit_method_return_multiple_same_void() {
+    InstanceMemberInferrer inferrer = createInferrer;
+    String methodName = 'm';
+    CompilationUnitElement unit = resolve('''
+class A {
+  void $methodName() {};
+}
+class B {
+  void $methodName() {};
+}
+class C implements A, B {
+  $methodName() {};
+}
+''');
+    ClassElement classA = unit.getType('A');
+    MethodElement methodA = classA.getMethod(methodName);
+    DartType expectedType = methodA.returnType;
+    ClassElement classC = unit.getType('C');
+    MethodElement methodC = classC.getMethod(methodName);
+    expect(methodC.returnType.isDynamic, isTrue);
+
+    inferrer.inferCompilationUnit(unit);
+
+    expect(methodC.returnType, expectedType);
+  }
+
+  void test_inferCompilationUnit_method_return_multiple_void() {
+    InstanceMemberInferrer inferrer = createInferrer;
+    String methodName = 'm';
+    CompilationUnitElement unit = resolve('''
+class A {
+  int $methodName() => 0;
+}
+class B {
+  void $methodName() => 0;
+}
+class C implements A, B {
+  $methodName() => 0;
+}
+''');
+    ClassElement classC = unit.getType('C');
+    MethodElement methodC = classC.getMethod(methodName);
+    expect(methodC.returnType.isDynamic, isTrue);
+
+    inferrer.inferCompilationUnit(unit);
+
+    expect(methodC.returnType.isDynamic, isTrue);
+  }
+
+  void test_inferCompilationUnit_method_return_single() {
+    InstanceMemberInferrer inferrer = createInferrer;
+    String methodName = 'm';
+    CompilationUnitElement unit = resolve('''
+class A {
+  int $methodName() => 0;
+}
+class B extends A {
+  $methodName() => 0;
+}
+''');
+    ClassElement classA = unit.getType('A');
+    MethodElement methodA = classA.getMethod(methodName);
+    ClassElement classB = unit.getType('B');
+    MethodElement methodB = classB.getMethod(methodName);
+    expect(methodB.returnType.isDynamic, isTrue);
+
+    inferrer.inferCompilationUnit(unit);
+
+    expect(methodB.returnType, methodA.returnType);
+  }
+
+  void test_inferCompilationUnit_method_return_single_generic() {
+    InstanceMemberInferrer inferrer = createInferrer;
+    String methodName = 'm';
+    CompilationUnitElement unit = resolve('''
+class A<E> {
+  E $methodName() => 0;
+}
+class B<E> extends A<E> {
+  $methodName() => 0;
+}
+''');
+    ClassElement classB = unit.getType('B');
+    DartType typeBE = classB.typeParameters[0].type;
+    MethodElement methodB = classB.getMethod(methodName);
+    expect(methodB.returnType.isDynamic, isTrue);
+    expect(methodB.type.typeArguments, [typeBE]);
+
+    inferrer.inferCompilationUnit(unit);
+
+    expect(methodB.returnType, classB.typeParameters[0].type);
+    expect(methodB.type.typeArguments, [typeBE],
+        reason: 'function type should still have type arguments');
+  }
+
+  void test_inferCompilationUnit_fieldFormal() {
+    InstanceMemberInferrer inferrer = createInferrer;
+    String fieldName = 'f';
+    CompilationUnitElement unit = resolve('''
+class A {
+  final $fieldName = 0;
+  A([this.$fieldName = 'hello']);
+}
+''');
+    ClassElement classA = unit.getType('A');
+    FieldElement fieldA = classA.getField(fieldName);
+    FieldFormalParameterElement paramA =
+        classA.unnamedConstructor.parameters[0];
+    expect(fieldA.type.isDynamic, isTrue);
+    expect(paramA.type.isDynamic, isTrue);
+
+    inferrer.inferCompilationUnit(unit);
+
+    DartType intType = inferrer.typeProvider.intType;
+    expect(fieldA.type, intType);
+    expect(paramA.type, intType);
+  }
+}
+
+@reflectiveTest
+class VariableGathererTest extends AbstractContextTest {
+  void test_creation_withFilter() {
+    VariableFilter filter = (variable) => true;
+    VariableGatherer gatherer = new VariableGatherer(filter);
+    expect(gatherer, isNotNull);
+    expect(gatherer.filter, filter);
+  }
+
+  void test_creation_withoutFilter() {
+    VariableGatherer gatherer = new VariableGatherer();
+    expect(gatherer, isNotNull);
+    expect(gatherer.filter, isNull);
+  }
+
+  void test_visit_noReferences() {
+    Source source = addSource(
+        '/test.dart',
+        '''
+library lib;
+import 'dart:math';
+int zero = 0;
+class C {
+  void m() => null;
+}
+typedef void F();
+''');
+    CompilationUnit unit = context.resolveCompilationUnit2(source, source);
+    VariableGatherer gatherer = new VariableGatherer();
+    unit.accept(gatherer);
+    expect(gatherer.results, hasLength(0));
+  }
+
+  void test_visit_withFilter() {
+    VariableFilter filter = (VariableElement variable) => variable.isStatic;
+    expect(_gather(filter), hasLength(1));
+  }
+
+  void test_visit_withoutFilter() {
+    expect(_gather(), hasLength(4));
+  }
+
+  Set<VariableElement> _gather([VariableFilter filter = null]) {
+    Source source = addSource(
+        '/test.dart',
+        '''
+const int zero = 0;
+class Counter {
+  int value = zero;
+  void inc() {
+    value++;
+  }
+  void dec() {
+    value = value - 1;
+  }
+  void fromZero(f(int index)) {
+    for (int i = zero; i < value; i++) {
+      f(i);
+    }
+  }
+}
+''');
+    CompilationUnit unit = context.resolveCompilationUnit2(source, source);
+    VariableGatherer gatherer = new VariableGatherer(filter);
+    unit.accept(gatherer);
+    return gatherer.results;
+  }
+}
diff --git a/pkg/analyzer/test/src/task/test_all.dart b/pkg/analyzer/test/src/task/test_all.dart
index 44d4eef..ffe976c 100644
--- a/pkg/analyzer/test/src/task/test_all.dart
+++ b/pkg/analyzer/test/src/task/test_all.dart
@@ -6,6 +6,7 @@
 
 import 'package:unittest/unittest.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;
@@ -17,10 +18,13 @@
 import 'inputs_test.dart' as inputs_test;
 import 'manager_test.dart' as manager_test;
 import 'model_test.dart' as model_test;
+import 'options_test.dart' as options_test;
+import 'options_work_manager_test.dart' as options_work_manager_test;
+import 'strong_mode_test.dart' as strong_mode_test;
 
 /// Utility for manually running all tests.
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   group('task tests', () {
     dart_test.main();
     dart_work_manager_test.main();
@@ -32,5 +36,8 @@
     inputs_test.main();
     manager_test.main();
     model_test.main();
+    options_test.main();
+    options_work_manager_test.main();
+    strong_mode_test.main();
   });
 }
diff --git a/pkg/analyzer/test/src/task/test_support.dart b/pkg/analyzer/test/src/task/test_support.dart
index 2173ba2..e68952b 100644
--- a/pkg/analyzer/test/src/task/test_support.dart
+++ b/pkg/analyzer/test/src/task/test_support.dart
@@ -36,8 +36,11 @@
   final bool handlesDependencyCycles;
 
   TestAnalysisTask(AnalysisContext context, AnalysisTarget target,
-      {this.descriptor, this.exception, this.handlesDependencyCycles: false,
-      this.results, this.value: 1})
+      {this.descriptor,
+      this.exception,
+      this.handlesDependencyCycles: false,
+      this.results,
+      this.value: 1})
       : super(context, target);
 
   @override
diff --git a/pkg/analyzer/test/src/test_all.dart b/pkg/analyzer/test/src/test_all.dart
index 0608083..f9ad08a 100644
--- a/pkg/analyzer/test/src/test_all.dart
+++ b/pkg/analyzer/test/src/test_all.dart
@@ -6,15 +6,18 @@
 
 import 'package:unittest/unittest.dart';
 
+import '../utils.dart';
 import 'context/test_all.dart' as context;
+import 'plugin/plugin_config_test.dart' as plugin;
 import 'task/test_all.dart' as task;
 import 'util/test_all.dart' as util;
 
 /// Utility for manually running all tests.
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   group('src tests', () {
     context.main();
+    plugin.main();
     task.main();
     util.main();
   });
diff --git a/pkg/analyzer/test/src/util/asserts_test.dart b/pkg/analyzer/test/src/util/asserts_test.dart
index bb4c032..a504e43 100644
--- a/pkg/analyzer/test/src/util/asserts_test.dart
+++ b/pkg/analyzer/test/src/util/asserts_test.dart
@@ -8,9 +8,10 @@
 import 'package:unittest/unittest.dart';
 
 import '../../reflective_tests.dart';
+import '../../utils.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   runReflectiveTests(AnalysisTaskTest);
 }
 
diff --git a/pkg/analyzer/test/src/util/lru_map_test.dart b/pkg/analyzer/test/src/util/lru_map_test.dart
index da82568..ef580a0 100644
--- a/pkg/analyzer/test/src/util/lru_map_test.dart
+++ b/pkg/analyzer/test/src/util/lru_map_test.dart
@@ -8,9 +8,10 @@
 import 'package:unittest/unittest.dart';
 
 import '../../reflective_tests.dart';
+import '../../utils.dart';
 
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   runReflectiveTests(_LRUCacheTest);
 }
 
diff --git a/pkg/analyzer/test/src/util/test_all.dart b/pkg/analyzer/test/src/util/test_all.dart
index 4b60777..f611c58 100644
--- a/pkg/analyzer/test/src/util/test_all.dart
+++ b/pkg/analyzer/test/src/util/test_all.dart
@@ -6,12 +6,13 @@
 
 import 'package:unittest/unittest.dart';
 
+import '../../utils.dart';
 import 'asserts_test.dart' as asserts_test;
 import 'lru_map_test.dart' as lru_map_test;
 
 /// Utility for manually running all tests.
 main() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   group('task tests', () {
     asserts_test.main();
     lru_map_test.main();
diff --git a/pkg/analyzer/test/test_all.dart b/pkg/analyzer/test/test_all.dart
index cde1f38..c21cc3f 100644
--- a/pkg/analyzer/test/test_all.dart
+++ b/pkg/analyzer/test/test_all.dart
@@ -14,10 +14,11 @@
 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() {
-  groupSep = ' | ';
+  initializeTestEnvironment();
   group('analysis engine', () {
     cancelable_future_test.main();
     enum_test.main();
diff --git a/pkg/analyzer/test/utils.dart b/pkg/analyzer/test/utils.dart
index 2a9ba81..7c9fbe0 100644
--- a/pkg/analyzer/test/utils.dart
+++ b/pkg/analyzer/test/utils.dart
@@ -2,46 +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 utils;
+library analyzer.test.utils;
 
-import 'dart:io';
+import 'package:analyzer/src/generated/java_io.dart';
+import 'package:path/path.dart' as path;
+import 'package:unittest/unittest.dart';
 
-import 'package:analyzer/analyzer.dart';
-import 'package:path/path.dart' as pathos;
-
-/// Returns the string representation of the [AnalyzerErrorGroup] thrown when
-/// parsing [contents] as a Dart file. If [contents] doesn't throw any errors,
-/// this will return null.
-///
-/// This replaces the filename in the error string with its basename, since the
-/// full path will vary from machine to machine. It also replaces the exception
-/// message with "..." to decouple these tests from the specific exception
-/// messages.
-String errorsForFile(String contents) {
-  return withTempDir((temp) {
-    var path = pathos.join(temp, 'test.dart');
-    new File(path).writeAsStringSync(contents);
-    try {
-      parseDartFile(path);
-    } on AnalyzerErrorGroup catch (e) {
-      return e.toString().replaceAllMapped(new RegExp(
-              r"^(Error on line \d+ of )((?:[A-Z]+:)?[^:]+): .*$",
-              multiLine: true),
-          (match) => match[1] + pathos.basename(match[2]) + ': ...');
-    }
-    return null;
-  });
-}
-
-/// Creates a temporary directory and passes its path to [fn]. Once [fn]
-/// completes, the temporary directory and all its contents will be deleted.
-///
-/// Returns the return value of [fn].
-dynamic withTempDir(fn(String path)) {
-  var tempDir = Directory.systemTemp.createTempSync('analyzer_').path;
-  try {
-    return fn(tempDir);
-  } finally {
-    new Directory(tempDir).deleteSync(recursive: true);
-  }
+void initializeTestEnvironment() {
+  groupSep = ' | ';
+  JavaFile.pathContext = path.posix;
 }
diff --git a/pkg/analyzer/tool/generate_files b/pkg/analyzer/tool/generate_files
new file mode 100755
index 0000000..4d0b220
--- /dev/null
+++ b/pkg/analyzer/tool/generate_files
@@ -0,0 +1,50 @@
+#!/bin/bash
+# Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+# for details. All rights reserved. Use of this source code is governed by a
+# BSD-style license that can be found in the LICENSE file.
+#
+# This script executes code generation tools found in the analyzer
+# "tool" directory.
+
+set -e
+
+function follow_links() {
+  file="$1"
+  while [ -h "$file" ]; do
+    # On Mac OS, readlink -f doesn't work.
+    file="$(readlink "$file")"
+  done
+  echo "$file"
+}
+
+# Unlike $0, $BASH_SOURCE points to the absolute path of this file.
+PROG_NAME="$(follow_links "$BASH_SOURCE")"
+
+SCRIPT_DIR="$(cd "${PROG_NAME%/*}" ; pwd -P)"
+
+ROOT_DIR="$(cd "${SCRIPT_DIR}/../../.." ; pwd -P)"
+
+BIN_DIR="${ROOT_DIR}/sdk/bin"
+
+if [ -z "$DART_CONFIGURATION" ];
+then
+  DART_CONFIGURATION="ReleaseIA32"
+fi
+
+if [[ `uname` == 'Darwin' ]];
+then
+  BUILD_DIR="${ROOT_DIR}/xcodebuild/$DART_CONFIGURATION"
+else
+  BUILD_DIR="${ROOT_DIR}/out/$DART_CONFIGURATION"
+fi
+
+PKG_DIR="${BUILD_DIR}/packages"
+
+DART="${BIN_DIR}/dart"
+
+declare -a VM_OPTIONS
+VM_OPTIONS+=("--checked")
+VM_OPTIONS+=("--package-root=${PKG_DIR}")
+
+cd "${SCRIPT_DIR}"
+"${DART}" "${VM_OPTIONS[@]}" "task_dependency_graph/generate.dart"
diff --git a/pkg/analyzer/tool/summary/idl.dart b/pkg/analyzer/tool/summary/idl.dart
new file mode 100644
index 0000000..b450499
--- /dev/null
+++ b/pkg/analyzer/tool/summary/idl.dart
@@ -0,0 +1,692 @@
+// 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.
+
+/**
+ * This file is an "idl" style description of the summary format.  It is not
+ * executed directly; instead it is parsed and transformed into code that
+ * implements the summary format.
+ *
+ * The code generation process introduces the following non-typical semantics:
+ * - Fields of type List are never null, and have a default value of the empty
+ *   list.
+ * - Fields of type int are never null, and have a default value of zero.
+ * - Fields of type String are never null, and have a default value of ''.
+ * - Fields of type bool are never null, and have a default value of false.
+ * - Fields whose type is an enum are never null, and have a default value of
+ *   the first value declared in the enum.
+ *
+ * Terminology used in this document:
+ * - "Unlinked" refers to information that can be determined from reading the
+ *   .dart file for the library itself (including all parts) and no other
+ *   files.
+ * - "Prelinked" refers to information that can be determined from reading the
+ *   unlinked information for the library itself and the unlinked information
+ *   for all direct imports (plus the transitive closure of exports reachable
+ *   from those direct imports).
+ * - "Linked" refers to information that can be determined only from reading
+ *   the unlinked and prelinked information for the library itself and the
+ *   transitive closure of its imports.
+ *
+ * TODO(paulberry): currently the summary format only contains unlinked and
+ * prelinked information.
+ *
+ * Except as otherwise noted, synthetic elements are not stored in the summary;
+ * they are re-synthesized at the time the summary is read.
+ */
+library analyzer.tool.summary.idl;
+
+/**
+ * Annotation describing information which is not part of Dart semantics; in
+ * other words, if this information (or any information it refers to) changes,
+ * static analysis and runtime behavior of the library are unaffected.
+ *
+ * TODO(paulberry): some informative information is currently missing from the
+ * summary format.
+ */
+const informative = null;
+
+/**
+ * Annotation describing information which is not part of the public API to a
+ * library; in other words, if this information (or any information it refers
+ * to) changes, libraries outside this one are unaffected.
+ *
+ * TODO(paulberry): currently the summary format does not contain private
+ * information.
+ */
+const private = null;
+
+/**
+ * Information about a dependency that exists between one library and another
+ * due to an "import" declaration.
+ */
+class PrelinkedDependency {
+  /**
+   * The relative URI used to import one library from the other.
+   */
+  String uri;
+}
+
+/**
+ * Pre-linked summary of a library.
+ */
+class PrelinkedLibrary {
+  /**
+   * The unlinked library summary.
+   */
+  UnlinkedLibrary unlinked;
+
+  /**
+   * The libraries that this library depends on (either via an explicit import
+   * statement or via the implicit dependencies on `dart:core` and
+   * `dart:async`).  The first element of this array is a pseudo-dependency
+   * representing the library itself (it is also used for "dynamic").
+   *
+   * TODO(paulberry): consider removing this entirely and just using
+   * [UnlinkedLibrary.imports].
+   */
+  List<PrelinkedDependency> dependencies;
+
+  /**
+   * For each import in [UnlinkedLibrary.imports], an index into [dependencies]
+   * of the library being imported.
+   *
+   * TODO(paulberry): if [dependencies] is removed, this can be removed as
+   * well, since there will effectively be a one-to-one mapping.
+   */
+  List<int> importDependencies;
+
+  /**
+   * For each reference in [UnlinkedLibrary.references], information about how
+   * that reference is resolved.
+   */
+  List<PrelinkedReference> references;
+}
+
+/**
+ * Enum used to indicate the kind of entity referred to by a
+ * [PrelinkedReference].
+ */
+enum PrelinkedReferenceKind {
+  /**
+   * The entity is a class or enum.
+   */
+  classOrEnum,
+
+  /**
+   * The entity is a typedef.
+   */
+  typedef,
+
+  /**
+   * The entity is a variable or executable.
+   */
+  other,
+
+  /**
+   * The entity being referred to does not exist.
+   */
+  unresolved
+}
+
+/**
+ * Information about the resolution of an [UnlinkedReference].
+ */
+class PrelinkedReference {
+  /**
+   * Index into [UnlinkedLibrary.dependencies] indicating which imported library
+   * declares the entity being referred to.
+   */
+  int dependency;
+
+  /**
+   * The kind of the entity being referred to.
+   */
+  PrelinkedReferenceKind kind;
+}
+
+/**
+ * Unlinked summary information about a class declaration.
+ */
+class UnlinkedClass {
+  /**
+   * Name of the class.
+   */
+  String name;
+
+  /**
+   * Index into [UnlinkedLibrary.units] indicating which compilation unit the
+   * class is declared in.
+   */
+  @informative
+  int unit;
+
+  /**
+   * Type parameters of the class, if any.
+   */
+  List<UnlinkedTypeParam> typeParameters;
+
+  /**
+   * Supertype of the class, or `null` if either (a) the class doesn't
+   * explicitly declare a supertype (and hence has supertype `Object`), or (b)
+   * the class *is* `Object` (and hence has no supertype).
+   */
+  UnlinkedTypeRef supertype;
+
+  /**
+   * Mixins appering in a `with` clause, if any.
+   */
+  List<UnlinkedTypeRef> mixins;
+
+  /**
+   * Interfaces appearing in an `implements` clause, if any.
+   */
+  List<UnlinkedTypeRef> interfaces;
+
+  /**
+   * Field declarations contained in the class.
+   */
+  List<UnlinkedVariable> fields;
+
+  /**
+   * Executable objects (methods, getters, and setters) contained in the class.
+   */
+  List<UnlinkedExecutable> executables;
+
+  /**
+   * Indicates whether the class is declared with the `abstract` keyword.
+   */
+  bool isAbstract;
+
+  /**
+   * Indicates whether the class is declared using mixin application syntax.
+   */
+  bool isMixinApplication;
+}
+
+/**
+ * Unlinked summary information about a `show` or `hide` combinator in an
+ * import or export declaration.
+ */
+class UnlinkedCombinator {
+  /**
+   * List of names which are shown.  Empty if this is a `hide` combinator.
+   */
+  List<String> shows;
+
+  /**
+   * List of names which are hidden.  Empty if this is a `show` combinator.
+   */
+  List<String> hides;
+}
+
+/**
+ * Unlinked summary information about an enum declaration.
+ */
+class UnlinkedEnum {
+  /**
+   * Name of the enum type.
+   */
+  String name;
+
+  /**
+   * Values listed in the enum declaration, in declaration order.
+   */
+  List<UnlinkedEnumValue> values;
+
+  /**
+   * Index into [UnlinkedLibrary.units] indicating which compilation unit the
+   * enum is declared in.
+   */
+  @informative
+  int unit;
+}
+
+/**
+ * Unlinked summary information about a single enumerated value in an enum
+ * declaration.
+ */
+class UnlinkedEnumValue {
+  /**
+   * Name of the enumerated value.
+   */
+  String name;
+}
+
+/**
+ * Enum used to indicate the kind of an executable.
+ */
+enum UnlinkedExecutableKind {
+  /**
+   * Executable is a function or method.
+   */
+  functionOrMethod,
+
+  /**
+   * Executable is a getter.
+   */
+  getter,
+
+  /**
+   * Executable is a setter.
+   */
+  setter,
+
+  /**
+   * Executable is a constructor.
+   */
+  constructor
+}
+
+/**
+ * Unlinked summary information about a function, method, getter, or setter
+ * declaration.
+ */
+class UnlinkedExecutable {
+  /**
+   * Name of the executable.  For setters, this includes the trailing "=".  For
+   * named constructors, this excludes the class name and excludes the ".".
+   * For unnamed constructors, this is the empty string.
+   */
+  String name;
+
+  /**
+   * Index into [UnlinkedLibrary.units] indicating which compilation unit the
+   * executable is declared in.  Zero for executables which are nested inside
+   * another declaration (i.e. local functions and method declarations).
+   */
+  @informative
+  int unit;
+
+  /**
+   * Type parameters of the executable, if any.  Empty if support for generic
+   * method syntax is disabled.
+   */
+  List<UnlinkedTypeParam> typeParameters;
+
+  /**
+   * Declared return type of the executable.  Absent if the return type is
+   * `void`.  Note that when strong mode is enabled, the actual return type may
+   * be different due to type inference.
+   */
+  UnlinkedTypeRef returnType;
+
+  /**
+   * Parameters of the executable, if any.  Note that getters have no
+   * parameters (hence this will be the empty list), and setters have a single
+   * parameter.
+   */
+  List<UnlinkedParam> parameters;
+
+  /**
+   * The kind of the executable (function/method, getter, setter, or
+   * constructor).
+   */
+  UnlinkedExecutableKind kind;
+
+  /**
+   * Indicates whether the executable is declared using the `abstract` keyword.
+   */
+  bool isAbstract;
+
+  /**
+   * Indicates whether the executable is declared using the `static` keyword.
+   *
+   * Note that for top level executables, this flag is false, since they are
+   * not declared using the `static` keyword (even though they are considered
+   * static for semantic purposes).
+   */
+  bool isStatic;
+
+  /**
+   * Indicates whether the executable is declared using the `const` keyword.
+   */
+  bool isConst;
+
+  /**
+   * Indicates whether the executable is declared using the `factory` keyword.
+   */
+  bool isFactory;
+}
+
+/**
+ * Unlinked summary information about an export declaration.
+ */
+class UnlinkedExport {
+  /**
+   * URI used in the source code to reference the exported library.
+   */
+  String uri;
+
+  /**
+   * Combinators contained in this import declaration.
+   */
+  List<UnlinkedCombinator> combinators;
+}
+
+/**
+ * Unlinked summary information about an import declaration.
+ */
+class UnlinkedImport {
+  /**
+   * URI used in the source code to reference the imported library.
+   */
+  String uri;
+
+  /**
+   * If [isImplicit] is false, offset of the "import" keyword.  If [isImplicit]
+   * is true, zero.
+   */
+  @informative
+  int offset;
+
+  /**
+   * Index into [UnlinkedLibrary.prefixes] of the prefix declared by this
+   * import declaration, or zero if this import declaration declares no prefix.
+   *
+   * Note that multiple imports can declare the same prefix.
+   */
+  int prefix;
+
+  /**
+   * Combinators contained in this import declaration.
+   */
+  List<UnlinkedCombinator> combinators;
+
+  /**
+   * Indicates whether the import declaration uses the `deferred` keyword.
+   */
+  bool isDeferred;
+
+  /**
+   * Indicates whether the import declaration is implicit.
+   */
+  bool isImplicit;
+}
+
+/**
+ * Unlinked summary of an entire library.
+ */
+class UnlinkedLibrary {
+  /**
+   * Top level and prefixed names referred to by this library.
+   */
+  List<UnlinkedReference> references;
+
+  /**
+   * Information about the units constituting this library.  The first unit
+   * listed is always the defining compilation unit.
+   */
+  List<UnlinkedUnit> units;
+
+  /**
+   * Name of the library (from a "library" declaration, if present).
+   */
+  String name;
+
+  /**
+   * Classes declared in the library.
+   */
+  List<UnlinkedClass> classes;
+
+  /**
+   * Enums declared in the library.
+   */
+  List<UnlinkedEnum> enums;
+
+  /**
+   * Top level executable objects (functions, getters, and setters) declared in
+   * the library.
+   */
+  List<UnlinkedExecutable> executables;
+
+  /**
+   * Export declarations in the library.
+   */
+  List<UnlinkedExport> exports;
+
+  /**
+   * Import declarations in the library.
+   */
+  List<UnlinkedImport> imports;
+
+  /**
+   * Typedefs declared in the library.
+   */
+  List<UnlinkedTypedef> typedefs;
+
+  /**
+   * Top level variables declared in the library.
+   */
+  List<UnlinkedVariable> variables;
+
+  /**
+   * Prefixes introduced by import declarations.  The first element in this
+   * array is a pseudo-prefix used by references made with no prefix.
+   */
+  List<UnlinkedPrefix> prefixes;
+}
+
+/**
+ * Enum used to indicate the kind of a parameter.
+ */
+enum UnlinkedParamKind {
+  /**
+   * Parameter is required.
+   */
+  required,
+
+  /**
+   * Parameter is positional optional (enclosed in `[]`)
+   */
+  positional,
+
+  /**
+   * Parameter is named optional (enclosed in `{}`)
+   */
+  named
+}
+
+/**
+ * Unlinked summary information about a function parameter.
+ */
+class UnlinkedParam {
+  /**
+   * Name of the parameter.
+   */
+  String name;
+
+  /**
+   * If [isFunctionTyped] is `true`, the declared return type.  If
+   * [isFunctionTyped] is `false`, the declared type.  Absent if
+   * [isFunctionTyped] is `true` and the declared return type is `void`.  Note
+   * that when strong mode is enabled, the actual type may be different due to
+   * type inference.
+   */
+  UnlinkedTypeRef type;
+
+  /**
+   * If [isFunctionTyped] is `true`, the parameters of the function type.
+   */
+  List<UnlinkedParam> parameters;
+
+  /**
+   * Kind of the parameter.
+   */
+  UnlinkedParamKind kind;
+
+  /**
+   * Indicates whether this is a function-typed parameter.
+   */
+  bool isFunctionTyped;
+
+  /**
+   * Indicates whether this is an initializing formal parameter (i.e. it is
+   * declared using `this.` syntax).
+   */
+  bool isInitializingFormal;
+}
+
+class UnlinkedPrefix {
+  /**
+   * The name of the prefix, or the empty string in the case of the
+   * pseudo-prefix which represents "no prefix".
+   */
+  String name;
+}
+
+/**
+ * Unlinked summary information about a name referred to in one library that
+ * might be defined in another.
+ */
+class UnlinkedReference {
+  /**
+   * Name of the entity being referred to.
+   */
+  String name;
+
+  /**
+   * Prefix used to refer to the entity.  This is an index into
+   * [UnlinkedLibrary.prefixes].
+   */
+  int prefix;
+}
+
+/**
+ * Unlinked summary information about a typedef declaration.
+ */
+class UnlinkedTypedef {
+  /**
+   * Name of the typedef.
+   */
+  String name;
+
+  /**
+   * Index into [UnlinkedLibrary.units] indicating which compilation unit the
+   * typedef is declared in.
+   */
+  @informative
+  int unit;
+
+  /**
+   * Type parameters of the typedef, if any.
+   */
+  List<UnlinkedTypeParam> typeParameters;
+
+  /**
+   * Return type of the typedef.  Absent if the return type is `void`.
+   */
+  UnlinkedTypeRef returnType;
+
+  /**
+   * Parameters of the executable, if any.
+   */
+  List<UnlinkedParam> parameters;
+}
+
+/**
+ * Unlinked summary information about a type parameter declaration.
+ */
+class UnlinkedTypeParam {
+  /**
+   * Name of the type parameter.
+   */
+  String name;
+
+  /**
+   * Bound of the type parameter, if a bound is explicitly declared.  Otherwise
+   * null.
+   */
+  UnlinkedTypeRef bound;
+}
+
+/**
+ * Unlinked summary information about a reference to a type.
+ */
+class UnlinkedTypeRef {
+  /**
+   * Index into [UnlinkedLibrary.references] for the type being referred to, or
+   * zero if this is a reference to a type parameter.
+   */
+  int reference;
+
+  /**
+   * If this is a reference to a type parameter, one-based index into
+   * [UnlinkedClass.typeParameters] or [UnlinkedTypedef.typeParameters] for the
+   * parameter being referenced.  Otherwise zero.
+   *
+   * If generic method syntax is enabled, this may also be a one-based index
+   * into [UnlinkedExecutable.typeParameters].  Note that this creates an
+   * ambiguity since it allows executables with type parameters to be nested
+   * inside other declarations with type parameters (which might themselves be
+   * executables).  The ambiguity is resolved by considering this to be a
+   * one-based index into a list that concatenates all type parameters that are
+   * in scope, listing the outermost type parameters first.
+   */
+  int paramReference;
+
+  /**
+   * If this is an instantiation of a generic type, the type arguments used to
+   * instantiate it.  Trailing type arguments of type `dynamic` are omitted.
+   */
+  List<UnlinkedTypeRef> typeArguments;
+}
+
+/**
+ * Unlinked summary information about a compilation unit ("part file").  Note
+ * that since a declaration can be moved from one part file to another without
+ * changing semantics, the declarations themselves aren't stored here; they are
+ * stored in [UnlinkedLibrary] and they refer to [UnlinkedUnit]s via an index
+ * into [UnlinkedLibrary.units].
+ */
+class UnlinkedUnit {
+  /**
+   * String used in the defining compilation unit to reference the part file.
+   * Empty for the defining compilation unit itself.
+   */
+  String uri;
+}
+
+/**
+ * Unlinked summary information about a top level variable, local variable, or
+ * a field.
+ */
+class UnlinkedVariable {
+  /**
+   * Name of the variable.
+   */
+  String name;
+
+  /**
+   * Index into [UnlinkedLibrary.units] indicating which compilation unit the
+   * variable is declared in.  Zero for variables which are nested inside
+   * another declaration (i.e. local variables and fields).
+   */
+  @informative
+  int unit;
+
+  /**
+   * Declared type of the variable.  Note that when strong mode is enabled, the
+   * actual type of the variable may be different due to type inference.
+   */
+  UnlinkedTypeRef type;
+
+  /**
+   * Indicates whether the variable is declared using the `static` keyword.
+   *
+   * Note that for top level variables, this flag is false, since they are not
+   * declared using the `static` keyword (even though they are considered
+   * static for semantic purposes).
+   */
+  bool isStatic;
+
+  /**
+   * Indicates whether the variable is declared using the `final` keyword.
+   */
+  bool isFinal;
+
+  /**
+   * Indicates whether the variable is declared using the `const` keyword.
+   */
+  bool isConst;
+}
diff --git a/pkg/analyzer/tool/task_dependency_graph.dart b/pkg/analyzer/tool/task_dependency_graph.dart
deleted file mode 100644
index 79e6d50..0000000
--- a/pkg/analyzer/tool/task_dependency_graph.dart
+++ /dev/null
@@ -1,151 +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.
-
-/**
- * This file contains code to output a description of tasks and their
- * dependencies in ".dot" format.  Prior to running, the user should run "pub
- * get" in the analyzer directory to ensure that a "packages" folder exists.
- *
- * The ".dot" file is output to standard out.  To convert it to a pdf, store it
- * in a file (e.g. "tasks.dot"), and post-process it with
- * "dot tasks.dart -Tpdf -O".
- *
- * TODO(paulberry):
- * - Add general.dart and html.dart for completeness.
- * - Use Graphviz's "record" feature to produce more compact output
- *   (http://www.graphviz.org/content/node-shapes#record)
- * - Produce a warning if a result descriptor is found which isn't the output
- *   of exactly one task.
- * - Convert this tool to use package_config to find the package map.
- */
-library task_dependency_graph;
-
-import 'dart:io' hide File;
-
-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/src/generated/element.dart';
-import 'package:analyzer/src/generated/engine.dart';
-import 'package:analyzer/src/generated/java_io.dart';
-import 'package:analyzer/src/generated/sdk.dart';
-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:path/path.dart' as path;
-
-main() {
-  new Driver().run();
-}
-
-typedef void ResultDescriptorFinderCallback(PropertyAccessorElement element);
-
-class Driver {
-  PhysicalResourceProvider resourceProvider;
-  AnalysisContext context;
-  InterfaceType resultDescriptorType;
-  String rootDir;
-
-  void findResultDescriptors(
-      AstNode node, void callback(String descriptorName)) {
-    Set<PropertyAccessorElement> resultDescriptors =
-        new Set<PropertyAccessorElement>();
-    node.accept(new ResultDescriptorFinder(
-        resultDescriptorType, resultDescriptors.add));
-    for (PropertyAccessorElement resultDescriptor in resultDescriptors) {
-      callback(resultDescriptor.name);
-    }
-  }
-
-  /**
-   * Find the root directory of the analyzer package by proceeding
-   * upward to the 'tool' dir, and then going up one more directory.
-   */
-  String findRoot(String pathname) {
-    while (path.basename(pathname) != 'tool') {
-      String parent = path.dirname(pathname);
-      if (parent.length >= pathname.length) {
-        throw new Exception("Can't find root directory");
-      }
-      pathname = parent;
-    }
-    return path.dirname(pathname);
-  }
-
-  CompilationUnit getUnit(Source source) =>
-      context.resolveCompilationUnit2(source, source);
-
-  void run() {
-    rootDir = findRoot(Platform.script.toFilePath(windows: Platform.isWindows));
-    resourceProvider = PhysicalResourceProvider.INSTANCE;
-    DartSdk sdk = DirectoryBasedDartSdk.defaultSdk;
-    context = AnalysisEngine.instance.createAnalysisContext();
-    JavaFile packagesDir = new JavaFile(path.join(rootDir, 'packages'));
-    List<UriResolver> uriResolvers = [
-      new FileUriResolver(),
-      new DartUriResolver(sdk),
-      new PackageUriResolver(<JavaFile>[packagesDir])
-    ];
-    context.sourceFactory = new SourceFactory(uriResolvers);
-    Source taskSource =
-        setupSource(path.join('lib', 'src', 'task', 'dart.dart'));
-    Source modelSource = setupSource(path.join('lib', 'task', 'model.dart'));
-    CompilationUnitElement modelElement = getUnit(modelSource).element;
-    InterfaceType analysisTaskType = modelElement.getType('AnalysisTask').type;
-    DartType dynamicType = context.typeProvider.dynamicType;
-    resultDescriptorType = modelElement.getType('ResultDescriptor').type
-        .substitute4([dynamicType]);
-    CompilationUnit taskUnit = getUnit(taskSource);
-    CompilationUnitElement taskUnitElement = taskUnit.element;
-    print('digraph G {');
-    Set<String> results = new Set<String>();
-    for (ClassElement cls in taskUnitElement.types) {
-      if (!cls.isAbstract && cls.type.isSubtypeOf(analysisTaskType)) {
-        String task = cls.name;
-        // TODO(paulberry): node is deprecated.  What am I supposed to do
-        // instead?
-        findResultDescriptors(cls.getMethod('buildInputs').node,
-            (String input) {
-          results.add(input);
-          print('  $input -> $task');
-        });
-        findResultDescriptors(cls.getField('DESCRIPTOR').node, (String output) {
-          results.add(output);
-          print('  $task -> $output');
-        });
-      }
-    }
-    for (String result in results) {
-      print('  $result [shape=box]');
-    }
-    print('}');
-  }
-
-  Source setupSource(String filename) {
-    String filePath = path.join(rootDir, filename);
-    File file = resourceProvider.getResource(filePath);
-    Source source = file.createSource();
-    ChangeSet changeSet = new ChangeSet();
-    changeSet.addedSource(source);
-    context.applyChanges(changeSet);
-    return source;
-  }
-}
-
-class ResultDescriptorFinder extends GeneralizingAstVisitor {
-  final InterfaceType resultDescriptorType;
-  final ResultDescriptorFinderCallback callback;
-
-  ResultDescriptorFinder(this.resultDescriptorType, this.callback);
-
-  @override
-  visitIdentifier(Identifier node) {
-    Element element = node.staticElement;
-    if (element is PropertyAccessorElement &&
-        element.isGetter &&
-        element.returnType.isSubtypeOf(resultDescriptorType)) {
-      callback(element);
-    }
-  }
-}
diff --git a/pkg/analyzer/tool/task_dependency_graph/check_test.dart b/pkg/analyzer/tool/task_dependency_graph/check_test.dart
new file mode 100644
index 0000000..a2d1118
--- /dev/null
+++ b/pkg/analyzer/tool/task_dependency_graph/check_test.dart
@@ -0,0 +1,34 @@
+// 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 task_dependency_graph.check_test;
+
+import 'dart:io';
+
+import 'package:path/path.dart';
+
+import 'generate.dart';
+
+/**
+ * Check that the target file has been code generated.  If it hasn't tell the
+ * user to run generate.dart.
+ */
+main() {
+  String script = Platform.script.toFilePath(windows: Platform.isWindows);
+  Driver driver = new Driver();
+  if (!driver.checkFile()) {
+    print('${driver.file.absolute} does not have expected contents.');
+    print('Please regenerate using:');
+    String executable = Platform.executable;
+    String packageRoot = '';
+    if (Platform.packageRoot.isNotEmpty) {
+      packageRoot = ' --package-root=${Platform.packageRoot}';
+    }
+    String generateScript = join(dirname(script), 'generate.dart');
+    print('  $executable$packageRoot $generateScript');
+    exit(1);
+  } else {
+    print('Generated file is up to date.');
+  }
+}
diff --git a/pkg/analyzer/tool/task_dependency_graph/generate.dart b/pkg/analyzer/tool/task_dependency_graph/generate.dart
new file mode 100644
index 0000000..a98eaba
--- /dev/null
+++ b/pkg/analyzer/tool/task_dependency_graph/generate.dart
@@ -0,0 +1,347 @@
+// 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.
+
+/**
+ * This file contains code to output a description of tasks and their
+ * dependencies in ".dot" format.  Prior to running, the user should run "pub
+ * get" in the analyzer directory to ensure that a "packages" folder exists.
+ *
+ * TODO(paulberry):
+ * - Add general.dart and html.dart for completeness.
+ * - Use Graphviz's "record" feature to produce more compact output
+ *   (http://www.graphviz.org/content/node-shapes#record)
+ * - Produce a warning if a result descriptor is found which isn't the output
+ *   of exactly one task.
+ * - Convert this tool to use package_config to find the package map.
+ */
+library task_dependency_graph.generate;
+
+import 'dart:io' hide File;
+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/src/generated/constant.dart';
+import 'package:analyzer/src/generated/element.dart';
+import 'package:analyzer/src/generated/engine.dart';
+import 'package:analyzer/src/generated/java_io.dart';
+import 'package:analyzer/src/generated/sdk.dart';
+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:path/path.dart' as path;
+
+/**
+ * Generate the target .dot file.
+ */
+main() {
+  new Driver().generateFile();
+}
+
+typedef void GetterFinderCallback(PropertyAccessorElement element);
+
+class Driver {
+  PhysicalResourceProvider resourceProvider;
+  AnalysisContext context;
+  InterfaceType resultDescriptorType;
+  InterfaceType listOfResultDescriptorType;
+  ClassElement enginePluginClass;
+  CompilationUnitElement taskUnitElement;
+  InterfaceType extensionPointIdType;
+  final String rootDir;
+
+  Driver()
+      : rootDir =
+            findRoot(Platform.script.toFilePath(windows: Platform.isWindows));
+
+  /**
+   * Get an [io.File] object corresponding to the file in which the generated
+   * graph should be output.
+   */
+  io.File get file => new io.File(
+      path.join(rootDir, 'tool', 'task_dependency_graph', 'tasks.dot'));
+
+  /**
+   * Determine if the output [file] contains the expected contents.
+   */
+  bool checkFile() {
+    String expectedContents = generateFileContents();
+    String actualContents = file.readAsStringSync();
+    // Normalize Windows line endings to Unix line endings so that the
+    // comparison doesn't fail on Windows.
+    actualContents = actualContents.replaceAll('\r\n', '\n');
+    return expectedContents == actualContents;
+  }
+
+  /**
+   * Starting at [node], find all calls to registerExtension() which refer to
+   * the given [extensionIdVariable], and execute [callback] for the associated
+   * result descriptors.
+   */
+  void findExtensions(AstNode node, TopLevelVariableElement extensionIdVariable,
+      void callback(descriptorName)) {
+    Set<PropertyAccessorElement> resultDescriptors =
+        new Set<PropertyAccessorElement>();
+    node.accept(new ExtensionFinder(
+        resultDescriptorType, extensionIdVariable, resultDescriptors.add));
+    for (PropertyAccessorElement resultDescriptor in resultDescriptors) {
+      callback(resultDescriptor.name);
+    }
+  }
+
+  /**
+   * Starting at [node], find all references to a getter of type
+   * `List<ResultDescriptor>`, and execute [callback] on the getter names.
+   */
+  void findResultDescriptorLists(
+      AstNode node, void callback(String descriptorListName)) {
+    Set<PropertyAccessorElement> resultDescriptorLists =
+        new Set<PropertyAccessorElement>();
+    node.accept(new GetterFinder(
+        listOfResultDescriptorType, resultDescriptorLists.add));
+    for (PropertyAccessorElement resultDescriptorList
+        in resultDescriptorLists) {
+      // We only care about result descriptor lists associated with getters in
+      // the engine plugin class.
+      if (resultDescriptorList.enclosingElement != enginePluginClass) {
+        continue;
+      }
+      callback(resultDescriptorList.name);
+    }
+  }
+
+  void findResultDescriptors(
+      AstNode node, void callback(String descriptorName)) {
+    Set<PropertyAccessorElement> resultDescriptors =
+        new Set<PropertyAccessorElement>();
+    node.accept(new GetterFinder(resultDescriptorType, resultDescriptors.add));
+    for (PropertyAccessorElement resultDescriptor in resultDescriptors) {
+      callback(resultDescriptor.name);
+    }
+  }
+
+  /**
+   * Generate the task dependency graph and write it to the output [file].
+   */
+  void generateFile() {
+    String fileContents = generateFileContents();
+    file.writeAsStringSync(fileContents);
+  }
+
+  /**
+   * Generate the task dependency graph and return it as a [String].
+   */
+  String generateFileContents() {
+    List<String> lines = <String>[];
+    resourceProvider = PhysicalResourceProvider.INSTANCE;
+    DartSdk sdk = DirectoryBasedDartSdk.defaultSdk;
+    context = AnalysisEngine.instance.createAnalysisContext();
+    String packageRootPath;
+    if (Platform.packageRoot.isNotEmpty) {
+      packageRootPath = Platform.packageRoot;
+    } else {
+      packageRootPath = path.join(rootDir, 'packages');
+    }
+    JavaFile packagesDir = new JavaFile(packageRootPath);
+    List<UriResolver> uriResolvers = [
+      new DartUriResolver(sdk),
+      new PackageUriResolver(<JavaFile>[packagesDir]),
+      new FileUriResolver()
+    ];
+    context.sourceFactory = new SourceFactory(uriResolvers);
+    Source dartDartSource =
+        setupSource(path.join('lib', 'src', 'task', 'dart.dart'));
+    Source taskSource = setupSource(path.join('lib', 'plugin', 'task.dart'));
+    Source modelSource = setupSource(path.join('lib', 'task', 'model.dart'));
+    Source enginePluginSource =
+        setupSource(path.join('lib', 'src', 'plugin', 'engine_plugin.dart'));
+    CompilationUnitElement modelElement = getUnit(modelSource).element;
+    InterfaceType analysisTaskType = modelElement.getType('AnalysisTask').type;
+    DartType dynamicType = context.typeProvider.dynamicType;
+    resultDescriptorType = modelElement
+        .getType('ResultDescriptor')
+        .type
+        .substitute4([dynamicType]);
+    listOfResultDescriptorType =
+        context.typeProvider.listType.substitute4([resultDescriptorType]);
+    CompilationUnitElement enginePluginUnitElement =
+        getUnit(enginePluginSource).element;
+    enginePluginClass = enginePluginUnitElement.getType('EnginePlugin');
+    extensionPointIdType =
+        enginePluginUnitElement.getType('ExtensionPointId').type;
+    CompilationUnit dartDartUnit = getUnit(dartDartSource);
+    CompilationUnitElement dartDartUnitElement = dartDartUnit.element;
+    CompilationUnit taskUnit = getUnit(taskSource);
+    taskUnitElement = taskUnit.element;
+    Set<String> results = new Set<String>();
+    Set<String> resultLists = new Set<String>();
+    for (ClassElement cls in dartDartUnitElement.types) {
+      if (!cls.isAbstract && cls.type.isSubtypeOf(analysisTaskType)) {
+        String task = cls.name;
+        AstNode buildInputsAst = cls.getMethod('buildInputs').computeNode();
+        findResultDescriptors(buildInputsAst, (String input) {
+          results.add(input);
+          lines.add('  $input -> $task');
+        });
+        findResultDescriptorLists(buildInputsAst, (String input) {
+          resultLists.add(input);
+          lines.add('  $input -> $task');
+        });
+        findResultDescriptors(cls.getField('DESCRIPTOR').computeNode(),
+            (String out) {
+          results.add(out);
+          lines.add('  $task -> $out');
+        });
+      }
+    }
+    AstNode enginePluginAst = enginePluginUnitElement.computeNode();
+    for (String resultList in resultLists) {
+      lines.add('  $resultList [shape=hexagon]');
+      TopLevelVariableElement extensionIdVariable = _getExtensionId(resultList);
+      findExtensions(enginePluginAst, extensionIdVariable, (String extension) {
+        results.add(extension);
+        lines.add('  $extension -> $resultList');
+      });
+    }
+    for (String result in results) {
+      lines.add('  $result [shape=box]');
+    }
+    lines.sort();
+    return '''
+// 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.
+//
+// This file has been automatically generated.  Please do not edit it manually.
+// To regenerate the file, use the script
+// "pkg/analyzer/tool/task_dependency_graph/generate.dart".
+//
+// To render this graph using Graphviz (www.graphviz.org) use the command:
+// "dot tasks.dot -Tpdf -O".
+digraph G {
+${lines.join('\n')}
+}
+''';
+  }
+
+  CompilationUnit getUnit(Source source) =>
+      context.resolveCompilationUnit2(source, source);
+
+  Source setupSource(String filename) {
+    String filePath = path.join(rootDir, filename);
+    File file = resourceProvider.getResource(filePath);
+    Source source = file.createSource();
+    Uri restoredUri = context.sourceFactory.restoreUri(source);
+    if (restoredUri != null) {
+      source = file.createSource(restoredUri);
+    }
+    ChangeSet changeSet = new ChangeSet();
+    changeSet.addedSource(source);
+    context.applyChanges(changeSet);
+    return source;
+  }
+
+  /**
+   * Find the result list getter having name [resultListGetterName] in the
+   * [EnginePlugin] class, and use the [ExtensionPointId] annotation on that
+   * getter to find the associated [TopLevelVariableElement] which can be used
+   * to register extensions for that getter.
+   */
+  TopLevelVariableElement _getExtensionId(String resultListGetterName) {
+    PropertyAccessorElement getter =
+        enginePluginClass.getGetter(resultListGetterName);
+    for (ElementAnnotation annotation in getter.metadata) {
+      DartObjectImpl annotationValue = annotation.constantValue;
+      if (annotationValue.type.isSubtypeOf(extensionPointIdType)) {
+        String extensionPointId =
+            annotationValue.fields['extensionPointId'].toStringValue();
+        for (TopLevelVariableElement variable
+            in taskUnitElement.topLevelVariables) {
+          if (variable.name == extensionPointId) {
+            return variable;
+          }
+        }
+      }
+    }
+    throw new Exception(
+        'Could not find extension ID corresponding to $resultListGetterName');
+  }
+
+  /**
+   * Find the root directory of the analyzer package by proceeding
+   * upward to the 'tool' dir, and then going up one more directory.
+   */
+  static String findRoot(String pathname) {
+    while (path.basename(pathname) != 'tool') {
+      String parent = path.dirname(pathname);
+      if (parent.length >= pathname.length) {
+        throw new Exception("Can't find root directory");
+      }
+      pathname = parent;
+    }
+    return path.dirname(pathname);
+  }
+}
+
+/**
+ * Visitor that finds calls that register extension points.  Specifically, we
+ * look for calls of the form `method(extensionIdVariable, resultDescriptor)`,
+ * where `resultDescriptor` has type [resultDescriptorType], and we pass the
+ * corresponding result descriptor names to [callback].
+ */
+class ExtensionFinder extends GeneralizingAstVisitor {
+  final InterfaceType resultDescriptorType;
+  final TopLevelVariableElement extensionIdVariable;
+  final GetterFinderCallback callback;
+
+  ExtensionFinder(
+      this.resultDescriptorType, this.extensionIdVariable, this.callback);
+
+  @override
+  visitIdentifier(Identifier node) {
+    Element element = node.staticElement;
+    if (element is PropertyAccessorElement &&
+        element.isGetter &&
+        element.variable == extensionIdVariable) {
+      AstNode parent = node.parent;
+      if (parent is ArgumentList &&
+          parent.arguments.length == 2 &&
+          parent.arguments[0] == node) {
+        Expression extension = parent.arguments[1];
+        if (extension is Identifier) {
+          Element element = extension.staticElement;
+          if (element is PropertyAccessorElement &&
+              element.isGetter &&
+              element.returnType.isSubtypeOf(resultDescriptorType)) {
+            callback(element);
+            return;
+          }
+        }
+      }
+      throw new Exception('Could not decode extension setup: $parent');
+    }
+  }
+}
+
+/**
+ * Visitor that finds references to getters having a specific type (or a
+ * subtype of that type)
+ */
+class GetterFinder extends GeneralizingAstVisitor {
+  final InterfaceType type;
+  final GetterFinderCallback callback;
+
+  GetterFinder(this.type, this.callback);
+
+  @override
+  visitIdentifier(Identifier node) {
+    Element element = node.staticElement;
+    if (element is PropertyAccessorElement &&
+        element.isGetter &&
+        element.returnType.isSubtypeOf(type)) {
+      callback(element);
+    }
+  }
+}
diff --git a/pkg/analyzer/tool/task_dependency_graph/tasks.dot b/pkg/analyzer/tool/task_dependency_graph/tasks.dot
new file mode 100644
index 0000000..4e915c8
--- /dev/null
+++ b/pkg/analyzer/tool/task_dependency_graph/tasks.dot
@@ -0,0 +1,274 @@
+// 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.
+//
+// This file has been automatically generated.  Please do not edit it manually.
+// To regenerate the file, use the script
+// "pkg/analyzer/tool/task_dependency_graph/generate.dart".
+//
+// To render this graph using Graphviz (www.graphviz.org) use the command:
+// "dot tasks.dot -Tpdf -O".
+digraph G {
+  BUILD_DIRECTIVES_ERRORS -> LibraryUnitErrorsTask
+  BUILD_DIRECTIVES_ERRORS [shape=box]
+  BUILD_LIBRARY_ERRORS -> LibraryUnitErrorsTask
+  BUILD_LIBRARY_ERRORS [shape=box]
+  BuildCompilationUnitElementTask -> COMPILATION_UNIT_CONSTANTS
+  BuildCompilationUnitElementTask -> COMPILATION_UNIT_ELEMENT
+  BuildCompilationUnitElementTask -> RESOLVED_UNIT1
+  BuildDirectiveElementsTask -> BUILD_DIRECTIVES_ERRORS
+  BuildDirectiveElementsTask -> LIBRARY_ELEMENT2
+  BuildEnumMemberElementsTask -> RESOLVED_UNIT2
+  BuildExportNamespaceTask -> LIBRARY_ELEMENT4
+  BuildLibraryElementTask -> BUILD_LIBRARY_ERRORS
+  BuildLibraryElementTask -> IS_LAUNCHABLE
+  BuildLibraryElementTask -> LIBRARY_ELEMENT1
+  BuildPublicNamespaceTask -> LIBRARY_ELEMENT3
+  BuildSourceExportClosureTask -> EXPORT_SOURCE_CLOSURE
+  BuildTypeProviderTask -> TYPE_PROVIDER
+  COMPILATION_UNIT_CONSTANTS -> EvaluateUnitConstantsTask
+  COMPILATION_UNIT_CONSTANTS [shape=box]
+  COMPILATION_UNIT_ELEMENT [shape=box]
+  CONSTANT_DEPENDENCIES -> ComputeConstantValueTask
+  CONSTANT_DEPENDENCIES [shape=box]
+  CONSTANT_VALUE -> ComputeConstantValueTask
+  CONSTANT_VALUE -> EvaluateUnitConstantsTask
+  CONSTANT_VALUE [shape=box]
+  CONTAINING_LIBRARIES -> DartErrorsTask
+  CONTAINING_LIBRARIES [shape=box]
+  CONTENT -> ScanDartTask
+  CONTENT [shape=box]
+  ComputeConstantDependenciesTask -> CONSTANT_DEPENDENCIES
+  ComputeConstantValueTask -> CONSTANT_VALUE
+  ComputeInferableStaticVariableDependenciesTask -> INFERABLE_STATIC_VARIABLE_DEPENDENCIES
+  ComputeLibraryCycleTask -> LIBRARY_CYCLE
+  ComputeLibraryCycleTask -> LIBRARY_CYCLE_DEPENDENCIES
+  ComputeLibraryCycleTask -> LIBRARY_CYCLE_UNITS
+  ContainingLibrariesTask -> CONTAINING_LIBRARIES
+  DART_ERRORS -> LibraryErrorsReadyTask
+  DART_ERRORS [shape=box]
+  DART_SCRIPTS -> ScanDartTask
+  DART_SCRIPTS [shape=box]
+  DartErrorsTask -> DART_ERRORS
+  EXPLICITLY_IMPORTED_LIBRARIES [shape=box]
+  EXPORTED_LIBRARIES -> BuildDirectiveElementsTask
+  EXPORTED_LIBRARIES -> ReadyLibraryElement2Task
+  EXPORTED_LIBRARIES -> ReadyLibraryElement5Task
+  EXPORTED_LIBRARIES -> ReadyResolvedUnit10Task
+  EXPORTED_LIBRARIES -> ReadyResolvedUnit9Task
+  EXPORTED_LIBRARIES -> ReadyResolvedUnitTask
+  EXPORTED_LIBRARIES [shape=box]
+  EXPORT_SOURCE_CLOSURE -> BuildExportNamespaceTask
+  EXPORT_SOURCE_CLOSURE [shape=box]
+  EvaluateUnitConstantsTask -> RESOLVED_UNIT10
+  GatherUsedImportedElementsTask -> USED_IMPORTED_ELEMENTS
+  GatherUsedLocalElementsTask -> USED_LOCAL_ELEMENTS
+  GenerateHintsTask -> HINTS
+  GenerateLintsTask -> LINTS
+  HINTS -> LibraryUnitErrorsTask
+  HINTS [shape=box]
+  IMPORTED_LIBRARIES -> BuildDirectiveElementsTask
+  IMPORTED_LIBRARIES -> ReadyLibraryElement2Task
+  IMPORTED_LIBRARIES -> ReadyLibraryElement5Task
+  IMPORTED_LIBRARIES -> ReadyResolvedUnit10Task
+  IMPORTED_LIBRARIES -> ReadyResolvedUnit9Task
+  IMPORTED_LIBRARIES -> ReadyResolvedUnitTask
+  IMPORTED_LIBRARIES -> ResolveUnitTypeNamesTask
+  IMPORTED_LIBRARIES [shape=box]
+  INCLUDED_PARTS -> BuildLibraryElementTask
+  INCLUDED_PARTS [shape=box]
+  INFERABLE_STATIC_VARIABLES_IN_UNIT -> InferStaticVariableTypesInUnitTask
+  INFERABLE_STATIC_VARIABLES_IN_UNIT [shape=box]
+  INFERABLE_STATIC_VARIABLE_DEPENDENCIES -> InferStaticVariableTypeTask
+  INFERABLE_STATIC_VARIABLE_DEPENDENCIES [shape=box]
+  INFERRED_STATIC_VARIABLE -> InferStaticVariableTypeTask
+  INFERRED_STATIC_VARIABLE -> InferStaticVariableTypesInUnitTask
+  INFERRED_STATIC_VARIABLE [shape=box]
+  IS_LAUNCHABLE [shape=box]
+  InferInstanceMembersInUnitTask -> RESOLVED_UNIT8
+  InferStaticVariableTypeTask -> INFERRED_STATIC_VARIABLE
+  InferStaticVariableTypesInUnitTask -> RESOLVED_UNIT6
+  LIBRARY_CYCLE [shape=box]
+  LIBRARY_CYCLE_DEPENDENCIES -> InferInstanceMembersInUnitTask
+  LIBRARY_CYCLE_DEPENDENCIES -> InferStaticVariableTypeTask
+  LIBRARY_CYCLE_DEPENDENCIES -> PartiallyResolveUnitReferencesTask
+  LIBRARY_CYCLE_DEPENDENCIES -> ResolveInstanceFieldsInUnitTask
+  LIBRARY_CYCLE_DEPENDENCIES [shape=box]
+  LIBRARY_CYCLE_UNITS -> InferInstanceMembersInUnitTask
+  LIBRARY_CYCLE_UNITS -> ResolveInstanceFieldsInUnitTask
+  LIBRARY_CYCLE_UNITS -> ResolveUnitTask
+  LIBRARY_CYCLE_UNITS [shape=box]
+  LIBRARY_ELEMENT -> EvaluateUnitConstantsTask
+  LIBRARY_ELEMENT [shape=box]
+  LIBRARY_ELEMENT1 -> BuildDirectiveElementsTask
+  LIBRARY_ELEMENT1 -> ResolveVariableReferencesTask
+  LIBRARY_ELEMENT1 [shape=box]
+  LIBRARY_ELEMENT2 -> BuildPublicNamespaceTask
+  LIBRARY_ELEMENT2 -> BuildSourceExportClosureTask
+  LIBRARY_ELEMENT2 -> ComputeLibraryCycleTask
+  LIBRARY_ELEMENT2 -> ReadyLibraryElement2Task
+  LIBRARY_ELEMENT2 [shape=box]
+  LIBRARY_ELEMENT3 -> BuildExportNamespaceTask
+  LIBRARY_ELEMENT3 -> BuildTypeProviderTask
+  LIBRARY_ELEMENT3 [shape=box]
+  LIBRARY_ELEMENT4 -> ResolveLibraryTypeNamesTask
+  LIBRARY_ELEMENT4 -> ResolveUnitTypeNamesTask
+  LIBRARY_ELEMENT4 [shape=box]
+  LIBRARY_ELEMENT5 -> PartiallyResolveUnitReferencesTask
+  LIBRARY_ELEMENT5 -> ReadyLibraryElement5Task
+  LIBRARY_ELEMENT5 -> ResolveInstanceFieldsInUnitTask
+  LIBRARY_ELEMENT5 -> ResolveLibraryReferencesTask
+  LIBRARY_ELEMENT5 -> ResolveUnitTask
+  LIBRARY_ELEMENT5 [shape=box]
+  LIBRARY_ERRORS_READY [shape=box]
+  LIBRARY_SPECIFIC_UNITS -> GenerateHintsTask
+  LIBRARY_SPECIFIC_UNITS -> ReadyResolvedUnit10Task
+  LIBRARY_SPECIFIC_UNITS -> ReadyResolvedUnit9Task
+  LIBRARY_SPECIFIC_UNITS -> ReadyResolvedUnitTask
+  LIBRARY_SPECIFIC_UNITS -> ResolveLibraryReferencesTask
+  LIBRARY_SPECIFIC_UNITS -> ResolveLibraryTypeNamesTask
+  LIBRARY_SPECIFIC_UNITS [shape=box]
+  LIBRARY_UNIT_ERRORS -> dartErrorsForUnit
+  LIBRARY_UNIT_ERRORS [shape=box]
+  LINE_INFO -> ParseDartTask
+  LINE_INFO [shape=box]
+  LINTS -> LibraryUnitErrorsTask
+  LINTS [shape=box]
+  LibraryErrorsReadyTask -> LIBRARY_ERRORS_READY
+  LibraryUnitErrorsTask -> LIBRARY_UNIT_ERRORS
+  MODIFICATION_TIME -> ParseDartTask
+  MODIFICATION_TIME [shape=box]
+  PARSED_UNIT -> BuildCompilationUnitElementTask
+  PARSED_UNIT [shape=box]
+  PARSE_ERRORS -> dartErrorsForSource
+  PARSE_ERRORS [shape=box]
+  ParseDartTask -> EXPLICITLY_IMPORTED_LIBRARIES
+  ParseDartTask -> EXPORTED_LIBRARIES
+  ParseDartTask -> IMPORTED_LIBRARIES
+  ParseDartTask -> INCLUDED_PARTS
+  ParseDartTask -> LIBRARY_SPECIFIC_UNITS
+  ParseDartTask -> PARSED_UNIT
+  ParseDartTask -> PARSE_ERRORS
+  ParseDartTask -> SOURCE_KIND
+  ParseDartTask -> UNITS
+  PartiallyResolveUnitReferencesTask -> INFERABLE_STATIC_VARIABLES_IN_UNIT
+  PartiallyResolveUnitReferencesTask -> RESOLVED_UNIT5
+  READY_LIBRARY_ELEMENT2 -> ComputeLibraryCycleTask
+  READY_LIBRARY_ELEMENT2 -> ReadyLibraryElement2Task
+  READY_LIBRARY_ELEMENT2 [shape=box]
+  READY_LIBRARY_ELEMENT5 -> PartiallyResolveUnitReferencesTask
+  READY_LIBRARY_ELEMENT5 -> ReadyLibraryElement5Task
+  READY_LIBRARY_ELEMENT5 [shape=box]
+  READY_RESOLVED_UNIT -> ReadyResolvedUnitTask
+  READY_RESOLVED_UNIT -> VerifyUnitTask
+  READY_RESOLVED_UNIT [shape=box]
+  READY_RESOLVED_UNIT10 -> ReadyResolvedUnit10Task
+  READY_RESOLVED_UNIT10 -> StrongModeVerifyUnitTask
+  READY_RESOLVED_UNIT10 [shape=box]
+  READY_RESOLVED_UNIT9 -> ReadyResolvedUnit9Task
+  READY_RESOLVED_UNIT9 -> ResolveLibraryReferencesTask
+  READY_RESOLVED_UNIT9 [shape=box]
+  REFERENCED_NAMES [shape=box]
+  RESOLVED_UNIT -> GenerateHintsTask
+  RESOLVED_UNIT -> GenerateLintsTask
+  RESOLVED_UNIT -> ReadyResolvedUnitTask
+  RESOLVED_UNIT -> VerifyUnitTask
+  RESOLVED_UNIT [shape=box]
+  RESOLVED_UNIT1 -> BuildDirectiveElementsTask
+  RESOLVED_UNIT1 -> BuildEnumMemberElementsTask
+  RESOLVED_UNIT1 -> BuildLibraryElementTask
+  RESOLVED_UNIT1 [shape=box]
+  RESOLVED_UNIT10 -> ReadyResolvedUnit10Task
+  RESOLVED_UNIT10 -> StrongModeVerifyUnitTask
+  RESOLVED_UNIT10 [shape=box]
+  RESOLVED_UNIT2 -> ResolveUnitTypeNamesTask
+  RESOLVED_UNIT2 [shape=box]
+  RESOLVED_UNIT3 -> ResolveLibraryTypeNamesTask
+  RESOLVED_UNIT3 -> ResolveVariableReferencesTask
+  RESOLVED_UNIT3 [shape=box]
+  RESOLVED_UNIT4 -> PartiallyResolveUnitReferencesTask
+  RESOLVED_UNIT4 [shape=box]
+  RESOLVED_UNIT5 -> ComputeInferableStaticVariableDependenciesTask
+  RESOLVED_UNIT5 -> InferStaticVariableTypeTask
+  RESOLVED_UNIT5 -> InferStaticVariableTypesInUnitTask
+  RESOLVED_UNIT5 [shape=box]
+  RESOLVED_UNIT6 -> ResolveInstanceFieldsInUnitTask
+  RESOLVED_UNIT6 [shape=box]
+  RESOLVED_UNIT7 -> InferInstanceMembersInUnitTask
+  RESOLVED_UNIT7 [shape=box]
+  RESOLVED_UNIT8 -> InferInstanceMembersInUnitTask
+  RESOLVED_UNIT8 -> InferStaticVariableTypeTask
+  RESOLVED_UNIT8 -> PartiallyResolveUnitReferencesTask
+  RESOLVED_UNIT8 -> ResolveInstanceFieldsInUnitTask
+  RESOLVED_UNIT8 -> ResolveUnitTask
+  RESOLVED_UNIT8 [shape=box]
+  RESOLVED_UNIT9 -> ComputeConstantDependenciesTask
+  RESOLVED_UNIT9 -> EvaluateUnitConstantsTask
+  RESOLVED_UNIT9 -> GatherUsedImportedElementsTask
+  RESOLVED_UNIT9 -> GatherUsedLocalElementsTask
+  RESOLVED_UNIT9 -> ReadyResolvedUnit9Task
+  RESOLVED_UNIT9 -> ResolveLibraryReferencesTask
+  RESOLVED_UNIT9 [shape=box]
+  RESOLVE_TYPE_NAMES_ERRORS -> LibraryUnitErrorsTask
+  RESOLVE_TYPE_NAMES_ERRORS [shape=box]
+  RESOLVE_UNIT_ERRORS -> LibraryUnitErrorsTask
+  RESOLVE_UNIT_ERRORS [shape=box]
+  ReadyLibraryElement2Task -> READY_LIBRARY_ELEMENT2
+  ReadyLibraryElement5Task -> READY_LIBRARY_ELEMENT5
+  ReadyResolvedUnit10Task -> READY_RESOLVED_UNIT10
+  ReadyResolvedUnit9Task -> READY_RESOLVED_UNIT9
+  ReadyResolvedUnitTask -> READY_RESOLVED_UNIT
+  ResolveInstanceFieldsInUnitTask -> RESOLVED_UNIT7
+  ResolveLibraryReferencesTask -> LIBRARY_ELEMENT
+  ResolveLibraryReferencesTask -> REFERENCED_NAMES
+  ResolveLibraryTypeNamesTask -> LIBRARY_ELEMENT5
+  ResolveUnitTask -> RESOLVED_UNIT9
+  ResolveUnitTask -> RESOLVE_UNIT_ERRORS
+  ResolveUnitTypeNamesTask -> RESOLVED_UNIT3
+  ResolveUnitTypeNamesTask -> RESOLVE_TYPE_NAMES_ERRORS
+  ResolveVariableReferencesTask -> RESOLVED_UNIT4
+  ResolveVariableReferencesTask -> VARIABLE_REFERENCE_ERRORS
+  SCAN_ERRORS -> dartErrorsForSource
+  SCAN_ERRORS [shape=box]
+  SOURCE_KIND -> BuildDirectiveElementsTask
+  SOURCE_KIND [shape=box]
+  STRONG_MODE_ERRORS -> LibraryUnitErrorsTask
+  STRONG_MODE_ERRORS [shape=box]
+  ScanDartTask -> LINE_INFO
+  ScanDartTask -> SCAN_ERRORS
+  ScanDartTask -> TOKEN_STREAM
+  StrongModeVerifyUnitTask -> RESOLVED_UNIT
+  StrongModeVerifyUnitTask -> STRONG_MODE_ERRORS
+  TOKEN_STREAM -> ParseDartTask
+  TOKEN_STREAM [shape=box]
+  TYPE_PROVIDER -> BuildEnumMemberElementsTask
+  TYPE_PROVIDER -> ComputeConstantDependenciesTask
+  TYPE_PROVIDER -> ComputeConstantValueTask
+  TYPE_PROVIDER -> GenerateHintsTask
+  TYPE_PROVIDER -> InferInstanceMembersInUnitTask
+  TYPE_PROVIDER -> InferStaticVariableTypeTask
+  TYPE_PROVIDER -> PartiallyResolveUnitReferencesTask
+  TYPE_PROVIDER -> ResolveInstanceFieldsInUnitTask
+  TYPE_PROVIDER -> ResolveLibraryTypeNamesTask
+  TYPE_PROVIDER -> ResolveUnitTask
+  TYPE_PROVIDER -> ResolveUnitTypeNamesTask
+  TYPE_PROVIDER -> ResolveVariableReferencesTask
+  TYPE_PROVIDER -> StrongModeVerifyUnitTask
+  TYPE_PROVIDER -> VerifyUnitTask
+  TYPE_PROVIDER [shape=box]
+  UNITS -> LibraryErrorsReadyTask
+  UNITS [shape=box]
+  USED_IMPORTED_ELEMENTS -> GenerateHintsTask
+  USED_IMPORTED_ELEMENTS [shape=box]
+  USED_LOCAL_ELEMENTS -> GenerateHintsTask
+  USED_LOCAL_ELEMENTS [shape=box]
+  VARIABLE_REFERENCE_ERRORS -> LibraryUnitErrorsTask
+  VARIABLE_REFERENCE_ERRORS [shape=box]
+  VERIFY_ERRORS -> LibraryUnitErrorsTask
+  VERIFY_ERRORS [shape=box]
+  VerifyUnitTask -> VERIFY_ERRORS
+  dartErrorsForSource -> DartErrorsTask
+  dartErrorsForSource [shape=hexagon]
+  dartErrorsForUnit -> DartErrorsTask
+  dartErrorsForUnit [shape=hexagon]
+}
diff --git a/pkg/compiler/bin/dart2js.dart b/pkg/compiler/bin/dart2js.dart
new file mode 100644
index 0000000..8f26efa
--- /dev/null
+++ b/pkg/compiler/bin/dart2js.dart
@@ -0,0 +1,13 @@
+// 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.
+
+/// Entrypoint to run the compiler. This entrypoint is currently only used by
+/// dart2js developers. To run the compiler you now can:
+///   * call `pub get` in the pkg/compiler folder.
+///   * simply call `dart path-to-pkg/compiler/bin/dart2js.dart foo.dart`
+// TODO(sigmund): move `main` here, and change our sdk build tools to just use
+// this entrypoint instead.
+library compiler.bin.dart2js;
+
+export 'package:compiler/src/dart2js.dart';
diff --git a/pkg/compiler/lib/src/apiimpl.dart b/pkg/compiler/lib/src/apiimpl.dart
index 18b3ec3..fdcbd37 100644
--- a/pkg/compiler/lib/src/apiimpl.dart
+++ b/pkg/compiler/lib/src/apiimpl.dart
@@ -7,18 +7,28 @@
 import 'dart:async';
 import 'dart:convert';
 
-import '../compiler_new.dart' as api;
-import 'dart2jslib.dart' as leg;
-import 'tree/tree.dart' as tree;
-import 'elements/elements.dart' as elements;
-import 'package:sdk_library_metadata/libraries.dart' hide LIBRARIES;
-import 'package:sdk_library_metadata/libraries.dart' as library_info show LIBRARIES;
-import 'io/source_file.dart';
 import 'package:package_config/packages.dart';
 import 'package:package_config/packages_file.dart' as pkgs;
-import 'package:package_config/src/packages_impl.dart'
-    show NonFilePackagesDirectoryPackages, MapPackages;
-import 'package:package_config/src/util.dart' show checkValidPackageUri;
+import 'package:package_config/src/packages_impl.dart' show
+    MapPackages,
+    NonFilePackagesDirectoryPackages;
+import 'package:package_config/src/util.dart' show
+    checkValidPackageUri;
+import 'package:sdk_library_metadata/libraries.dart' as library_info;
+
+import '../compiler_new.dart' as api;
+import 'commandline_options.dart';
+import 'common.dart';
+import 'common/tasks.dart' show
+    GenericTask;
+import 'compiler.dart' as leg;
+import 'diagnostics/diagnostic_listener.dart' show
+    DiagnosticOptions;
+import 'diagnostics/messages.dart' show
+    Message;
+import 'elements/elements.dart' as elements;
+import 'io/source_file.dart';
+import 'script.dart';
 
 const bool forceIncrementalSupport =
     const bool.fromEnvironment('DART2JS_EXPERIMENTAL_INCREMENTAL_SUPPORT');
@@ -34,11 +44,11 @@
   List<String> options;
   Map<String, dynamic> environment;
   bool mockableLibraryUsed = false;
-  final Set<String> allowedLibraryCategories;
+  final Set<library_info.Category> allowedLibraryCategories;
 
-  leg.GenericTask userHandlerTask;
-  leg.GenericTask userProviderTask;
-  leg.GenericTask userPackagesDiscoveryTask;
+  GenericTask userHandlerTask;
+  GenericTask userProviderTask;
+  GenericTask userPackagesDiscoveryTask;
 
   Compiler(this.provider,
            api.CompilerOutput outputProvider,
@@ -53,64 +63,67 @@
         this.allowedLibraryCategories = getAllowedLibraryCategories(options),
         super(
             outputProvider: outputProvider,
-            enableTypeAssertions: hasOption(options, '--enable-checked-mode'),
-            enableUserAssertions: hasOption(options, '--enable-checked-mode'),
+            enableTypeAssertions: hasOption(options, Flags.enableCheckedMode),
+            enableUserAssertions: hasOption(options, Flags.enableCheckedMode),
             trustTypeAnnotations:
-                hasOption(options, '--trust-type-annotations'),
+                hasOption(options, Flags.trustTypeAnnotations),
             trustPrimitives:
-                hasOption(options, '--trust-primitives'),
-            enableMinification: hasOption(options, '--minify'),
+                hasOption(options, Flags.trustPrimitives),
+            enableMinification: hasOption(options, Flags.minify),
             useFrequencyNamer:
-                !hasOption(options, "--no-frequency-based-minification"),
-            preserveUris: hasOption(options, '--preserve-uris'),
+                !hasOption(options, Flags.noFrequencyBasedMinification),
+            preserveUris: hasOption(options, Flags.preserveUris),
             enableNativeLiveTypeAnalysis:
-                !hasOption(options, '--disable-native-live-type-analysis'),
+                !hasOption(options, Flags.disableNativeLiveTypeAnalysis),
             emitJavaScript: !(hasOption(options, '--output-type=dart') ||
                               hasOption(options, '--output-type=dart-multi')),
             dart2dartMultiFile: hasOption(options, '--output-type=dart-multi'),
-            generateSourceMap: !hasOption(options, '--no-source-maps'),
-            analyzeAllFlag: hasOption(options, '--analyze-all'),
-            analyzeOnly: hasOption(options, '--analyze-only'),
-            analyzeMain: hasOption(options, '--analyze-main'),
+            generateSourceMap: !hasOption(options, Flags.noSourceMaps),
+            analyzeAllFlag: hasOption(options, Flags.analyzeAll),
+            analyzeOnly: hasOption(options, Flags.analyzeOnly),
+            analyzeMain: hasOption(options, Flags.analyzeMain),
             analyzeSignaturesOnly:
-                hasOption(options, '--analyze-signatures-only'),
+                hasOption(options, Flags.analyzeSignaturesOnly),
             strips: extractCsvOption(options, '--force-strip='),
-            enableConcreteTypeInference:
-                hasOption(options, '--enable-concrete-type-inference'),
             disableTypeInferenceFlag:
-                hasOption(options, '--disable-type-inference'),
-            preserveComments: hasOption(options, '--preserve-comments'),
-            useCpsIr: hasOption(options, '--use-cps-ir'),
-            verbose: hasOption(options, '--verbose'),
+                hasOption(options, Flags.disableTypeInference),
+            preserveComments: hasOption(options, Flags.preserveComments),
+            useCpsIr: hasOption(options, Flags.useCpsIr),
+            verbose: hasOption(options, Flags.verbose),
             sourceMapUri: extractUriOption(options, '--source-map='),
             outputUri: extractUriOption(options, '--out='),
-            terseDiagnostics: hasOption(options, '--terse'),
             deferredMapUri: extractUriOption(options, '--deferred-map='),
-            dumpInfo: hasOption(options, '--dump-info'),
+            dumpInfo: hasOption(options, Flags.dumpInfo),
             buildId: extractStringOption(
                 options, '--build-id=',
                 "build number could not be determined"),
-            showPackageWarnings:
-                hasOption(options, '--show-package-warnings'),
-            useContentSecurityPolicy: hasOption(options, '--csp'),
-            useStartupEmitter: hasOption(options, '--fast-startup'),
+            useContentSecurityPolicy:
+              hasOption(options, Flags.useContentSecurityPolicy),
+            useStartupEmitter: hasOption(options, Flags.fastStartup),
             hasIncrementalSupport:
                 forceIncrementalSupport ||
-                hasOption(options, '--incremental-support'),
-            suppressWarnings: hasOption(options, '--suppress-warnings'),
-            fatalWarnings: hasOption(options, '--fatal-warnings'),
+                hasOption(options, Flags.incrementalSupport),
+            diagnosticOptions: new DiagnosticOptions(
+                suppressWarnings: hasOption(options, Flags.suppressWarnings),
+                fatalWarnings: hasOption(options, Flags.fatalWarnings),
+                suppressHints: hasOption(options, Flags.suppressHints),
+                terseDiagnostics: hasOption(options, Flags.terse),
+                showPackageWarnings:
+                    hasOption(options, Flags.showPackageWarnings)),
             enableExperimentalMirrors:
-                hasOption(options, '--enable-experimental-mirrors'),
+                hasOption(options, Flags.enableExperimentalMirrors),
+            enableAssertMessage:
+                hasOption(options, Flags.enableAssertMessage),
             generateCodeWithCompileTimeErrors:
-                hasOption(options, '--generate-code-with-compile-time-errors'),
-            testMode: hasOption(options, '--test-mode'),
+                hasOption(options, Flags.generateCodeWithCompileTimeErrors),
+            testMode: hasOption(options, Flags.testMode),
             allowNativeExtensions:
-                hasOption(options, '--allow-native-extensions')) {
+                hasOption(options, Flags.allowNativeExtensions)) {
     tasks.addAll([
-        userHandlerTask = new leg.GenericTask('Diagnostic handler', this),
-        userProviderTask = new leg.GenericTask('Input provider', this),
+        userHandlerTask = new GenericTask('Diagnostic handler', this),
+        userProviderTask = new GenericTask('Input provider', this),
         userPackagesDiscoveryTask =
-            new leg.GenericTask('Package discovery', this),
+            new GenericTask('Package discovery', this),
     ]);
     if (libraryRoot == null) {
       throw new ArgumentError("[libraryRoot] is null.");
@@ -128,8 +141,8 @@
     if (!analyzeOnly) {
       if (allowNativeExtensions) {
         throw new ArgumentError(
-            "--allow-native-extensions is only supported in combination with "
-            "--analyze-only");
+            "${Flags.allowNativeExtensions} is only supported in combination "
+            "with ${Flags.analyzeOnly}");
       }
     }
   }
@@ -160,35 +173,24 @@
     return const <String>[];
   }
 
-  static Set<String> getAllowedLibraryCategories(List<String> options) {
-    var result = extractCsvOption(options, '--categories=');
-    if (result.isEmpty) {
-      result = ['Client'];
+  static Set<library_info.Category> getAllowedLibraryCategories(
+      List<String> options) {
+    Iterable<library_info.Category> categories =
+      extractCsvOption(options, '--categories=')
+          .map(library_info.parseCategory)
+          .where((x) => x != null);
+    if (categories.isEmpty) {
+      return new Set.from([library_info.Category.client]);
     }
-    result.add('Shared');
-    result.add('Internal');
-    return new Set<String>.from(result);
+    return new Set.from(categories);
   }
 
   static bool hasOption(List<String> options, String option) {
     return options.indexOf(option) >= 0;
   }
 
-  // TODO(johnniwinther): Merge better with [translateDartUri] when
-  // [scanBuiltinLibrary] is removed.
-  String lookupLibraryPath(LibraryInfo info) {
-    if (info == null) return null;
-    if (!info.isDart2jsLibrary) return null;
-    if (!allowedLibraryCategories.contains(info.category)) return null;
-    String path = info.dart2jsPath;
-    if (path == null) {
-      path = info.path;
-    }
-    return "lib/$path";
-  }
-
   String lookupPatchPath(String dartLibraryName) {
-    LibraryInfo info = lookupLibraryInfo(dartLibraryName);
+    library_info.LibraryInfo info = lookupLibraryInfo(dartLibraryName);
     if (info == null) return null;
     if (!info.isDart2jsLibrary) return null;
     String path = info.dart2jsPatchPath;
@@ -203,9 +205,9 @@
 
   /// See [leg.Compiler.translateResolvedUri].
   Uri translateResolvedUri(elements.LibraryElement importingLibrary,
-                           Uri resolvedUri, tree.Node node) {
+                           Uri resolvedUri, Spannable spannable) {
     if (resolvedUri.scheme == 'dart') {
-      return translateDartUri(importingLibrary, resolvedUri, node);
+      return translateDartUri(importingLibrary, resolvedUri, spannable);
     }
     return resolvedUri;
   }
@@ -213,10 +215,10 @@
   /**
    * Reads the script designated by [readableUri].
    */
-  Future<leg.Script> readScript(leg.Spannable node, Uri readableUri) {
+  Future<Script> readScript(Spannable node, Uri readableUri) {
     if (!readableUri.isAbsolute) {
-      if (node == null) node = leg.NO_LOCATION_SPANNABLE;
-      internalError(node,
+      if (node == null) node = NO_LOCATION_SPANNABLE;
+      reporter.internalError(node,
           'Relative uri $readableUri provided to readScript(Uri).');
     }
 
@@ -226,15 +228,15 @@
     elements.Element element = currentElement;
     void reportReadError(exception) {
       if (element == null || node == null) {
-        reportError(
-            new leg.SourceSpan(readableUri, 0, 0),
-            leg.MessageKind.READ_SELF_ERROR,
+        reporter.reportErrorMessage(
+            new SourceSpan(readableUri, 0, 0),
+            MessageKind.READ_SELF_ERROR,
             {'uri': readableUri, 'exception': exception});
       } else {
-        withCurrentElement(element, () {
-          reportError(
+        reporter.withCurrentElement(element, () {
+          reporter.reportErrorMessage(
               node,
-              leg.MessageKind.READ_SCRIPT_ERROR,
+              MessageKind.READ_SCRIPT_ERROR,
               {'uri': readableUri, 'exception': exception});
         });
       }
@@ -244,8 +246,9 @@
     if (resourceUri == null) return synthesizeScript(node, readableUri);
     if (resourceUri.scheme == 'dart-ext') {
       if (!allowNativeExtensions) {
-        withCurrentElement(element, () {
-          reportError(node, leg.MessageKind.DART_EXT_NOT_SUPPORTED);
+        reporter.withCurrentElement(element, () {
+          reporter.reportErrorMessage(
+              node, MessageKind.DART_EXT_NOT_SUPPORTED);
         });
       }
       return synthesizeScript(node, readableUri);
@@ -269,16 +272,16 @@
       // the scheme in the script because [Script.uri] is used for resolving
       // relative URIs mentioned in the script. See the comment on
       // [LibraryLoader] for more details.
-      return new leg.Script(readableUri, resourceUri, sourceFile);
+      return new Script(readableUri, resourceUri, sourceFile);
     }).catchError((error) {
       reportReadError(error);
       return synthesizeScript(node, readableUri);
     });
   }
 
-  Future<leg.Script> synthesizeScript(leg.Spannable node, Uri readableUri) {
+  Future<Script> synthesizeScript(Spannable node, Uri readableUri) {
     return new Future.value(
-        new leg.Script(
+        new Script(
             readableUri, readableUri,
             new StringSourceFile.fromUri(
                 readableUri,
@@ -291,55 +294,99 @@
    *
    * See [LibraryLoader] for terminology on URIs.
    */
-  Uri translateUri(leg.Spannable node, Uri readableUri) {
+  Uri translateUri(Spannable node, Uri readableUri) {
     switch (readableUri.scheme) {
       case 'package': return translatePackageUri(node, readableUri);
       default: return readableUri;
     }
   }
 
+  /// Translates "resolvedUri" with scheme "dart" to a [uri] resolved relative
+  /// to [libraryRoot] according to the information in [library_info.libraries].
+  ///
+  /// Returns null and emits an error if the library could not be found or
+  /// imported into [importingLibrary].
+  ///
+  /// If [importingLibrary] is a platform or patch library all dart2js libraries
+  /// can be resolved. Otherwise only libraries with categories in
+  /// [allowedLibraryCategories] can be resolved.
   Uri translateDartUri(elements.LibraryElement importingLibrary,
-                       Uri resolvedUri, tree.Node node) {
-    LibraryInfo libraryInfo = lookupLibraryInfo(resolvedUri.path);
-    String path = lookupLibraryPath(libraryInfo);
-    if (libraryInfo != null &&
-        libraryInfo.category == "Internal") {
-      bool allowInternalLibraryAccess = false;
-      if (importingLibrary != null) {
-        if (importingLibrary.isPlatformLibrary || importingLibrary.isPatch) {
-          allowInternalLibraryAccess = true;
-        } else if (importingLibrary.canonicalUri.path.contains(
-                       'sdk/tests/compiler/dart2js_native')) {
-          allowInternalLibraryAccess = true;
-        }
+                       Uri resolvedUri, Spannable spannable) {
+
+    library_info.LibraryInfo libraryInfo = lookupLibraryInfo(resolvedUri.path);
+
+    bool allowInternalLibraryAccess = false;
+    if (importingLibrary != null) {
+      if (importingLibrary.isPlatformLibrary || importingLibrary.isPatch) {
+        allowInternalLibraryAccess = true;
+      } else if (importingLibrary.canonicalUri.path.contains(
+          'sdk/tests/compiler/dart2js_native')) {
+        allowInternalLibraryAccess = true;
       }
-      if (!allowInternalLibraryAccess) {
-        if (importingLibrary != null) {
-          reportError(
-              node,
-              leg.MessageKind.INTERNAL_LIBRARY_FROM,
-              {'resolvedUri': resolvedUri,
-               'importingUri': importingLibrary.canonicalUri});
+    }
+
+    String computePath() {
+      if (libraryInfo == null) {
+        return null;
+      } else if (!libraryInfo.isDart2jsLibrary) {
+        return null;
+      } else {
+        if (libraryInfo.isInternal &&
+            !allowInternalLibraryAccess) {
+          if (importingLibrary != null) {
+            reporter.reportErrorMessage(
+                spannable,
+                MessageKind.INTERNAL_LIBRARY_FROM,
+                {'resolvedUri': resolvedUri,
+                  'importingUri': importingLibrary.canonicalUri});
+          } else {
+            reporter.reportErrorMessage(
+                spannable,
+                MessageKind.INTERNAL_LIBRARY,
+                {'resolvedUri': resolvedUri});
+            registerDisallowedLibraryUse(resolvedUri);
+          }
+          return null;
+        } else if (!allowInternalLibraryAccess &&
+            !allowedLibraryCategories.any(libraryInfo.categories.contains)) {
+          registerDisallowedLibraryUse(resolvedUri);
+          // TODO(sigurdm): Currently we allow the sdk libraries to import
+          // libraries from any category. We might want to revisit this.
+          return null;
         } else {
-          reportError(
-              node,
-              leg.MessageKind.INTERNAL_LIBRARY,
-              {'resolvedUri': resolvedUri});
+          return (libraryInfo.dart2jsPath != null)
+              ? libraryInfo.dart2jsPath
+              : libraryInfo.path;
         }
       }
     }
+
+    String path = computePath();
+
     if (path == null) {
-      reportError(node, leg.MessageKind.LIBRARY_NOT_FOUND,
-                  {'resolvedUri': resolvedUri});
+      if (libraryInfo == null) {
+        reporter.reportErrorMessage(
+            spannable,
+            MessageKind.LIBRARY_NOT_FOUND,
+            {'resolvedUri': resolvedUri});
+      } else {
+        reporter.reportErrorMessage(
+            spannable,
+            MessageKind.LIBRARY_NOT_SUPPORTED,
+            {'resolvedUri': resolvedUri});
+      }
+      // TODO(johnniwinther): Support signaling the error through the returned
+      // value.
       return null;
     }
+
     if (resolvedUri.path == 'html' ||
         resolvedUri.path == 'io') {
       // TODO(ahe): Get rid of mockableLibraryUsed when test.dart
       // supports this use case better.
       mockableLibraryUsed = true;
     }
-    return libraryRoot.resolve(path);
+    return libraryRoot.resolve("lib/$path");
   }
 
   Uri resolvePatchUri(String dartLibraryPath) {
@@ -348,27 +395,36 @@
     return libraryRoot.resolve(patchPath);
   }
 
-  Uri translatePackageUri(leg.Spannable node, Uri uri) {
+  Uri translatePackageUri(Spannable node, Uri uri) {
     try {
       checkValidPackageUri(uri);
     } on ArgumentError catch (e) {
-      reportError(
+      reporter.reportErrorMessage(
           node,
-          leg.MessageKind.INVALID_PACKAGE_URI,
+          MessageKind.INVALID_PACKAGE_URI,
           {'uri': uri, 'exception': e.message});
       return null;
     }
     return packages.resolve(uri,
         notFound: (Uri notFound) {
-          reportError(
+          reporter.reportErrorMessage(
               node,
-              leg.MessageKind.LIBRARY_NOT_FOUND,
-              {'resolvedUri': uri}
-          );
+              MessageKind.LIBRARY_NOT_FOUND,
+              {'resolvedUri': uri});
           return null;
         });
   }
 
+  Future<elements.LibraryElement> analyzeUri(
+      Uri uri,
+      {bool skipLibraryWithPartOfTag: true}) {
+    if (packages == null) {
+      return setupPackages(uri).then((_) => super.analyzeUri(uri));
+    }
+    return super.analyzeUri(
+        uri, skipLibraryWithPartOfTag: skipLibraryWithPartOfTag);
+  }
+
   Future setupPackages(Uri uri) {
     if (packageRoot != null) {
       // Use "non-file" packages because the file version requires a [Directory]
@@ -389,8 +445,9 @@
         packages =
             new MapPackages(pkgs.parse(packageConfigContents, packageConfig));
       }).catchError((error) {
-        reportError(leg.NO_LOCATION_SPANNABLE,
-            leg.MessageKind.INVALID_PACKAGE_CONFIG,
+        reporter.reportErrorMessage(
+            NO_LOCATION_SPANNABLE,
+            MessageKind.INVALID_PACKAGE_CONFIG,
             {'uri': packageConfig, 'exception': error});
         packages = Packages.noPackages;
       });
@@ -419,6 +476,10 @@
           if (elapsed != 0) {
             cumulated += elapsed;
             log('${task.name} took ${elapsed}msec');
+            for (String subtask in task.subtasks) {
+              int subtime = task.getSubtaskTime(subtask);
+              log('${task.name} > $subtask took ${subtime}msec');
+            }
           }
         }
         int total = totalCompileTime.elapsedMilliseconds;
@@ -429,17 +490,28 @@
     });
   }
 
-  void reportDiagnostic(leg.Spannable node,
-                        leg.Message message,
+  void reportDiagnostic(DiagnosticMessage message,
+                        List<DiagnosticMessage> infos,
                         api.Diagnostic kind) {
-    leg.SourceSpan span = spanFromSpannable(node);
-    if (identical(kind, api.Diagnostic.ERROR)
-        || identical(kind, api.Diagnostic.CRASH)
-        || (fatalWarnings && identical(kind, api.Diagnostic.WARNING))) {
+    // TODO(johnniwinther): Move this to the [DiagnosticReporter]?
+    if (kind == api.Diagnostic.ERROR ||
+        kind == api.Diagnostic.CRASH ||
+        (reporter.options.fatalWarnings &&
+         kind == api.Diagnostic.WARNING)) {
       compilationFailed = true;
     }
+    _reportDiagnosticMessage(message, kind);
+    for (DiagnosticMessage info in infos) {
+      _reportDiagnosticMessage(info, api.Diagnostic.INFO);
+    }
+  }
+
+  void _reportDiagnosticMessage(DiagnosticMessage diagnosticMessage,
+                                api.Diagnostic kind) {
     // [:span.uri:] might be [:null:] in case of a [Script] with no [uri]. For
     // instance in the [Types] constructor in typechecker.dart.
+    SourceSpan span = diagnosticMessage.sourceSpan;
+    Message message = diagnosticMessage.message;
     if (span == null || span.uri == null) {
       callUserHandler(message, null, null, null, '$message', kind);
     } else {
@@ -450,10 +522,10 @@
 
   bool get isMockCompilation {
     return mockableLibraryUsed
-      && (options.indexOf('--allow-mock-compilation') != -1);
+      && (options.indexOf(Flags.allowMockCompilation) != -1);
   }
 
-  void callUserHandler(leg.Message message, Uri uri, int begin, int end,
+  void callUserHandler(Message message, Uri uri, int begin, int end,
                        String text, api.Diagnostic kind) {
     try {
       userHandlerTask.measure(() {
@@ -485,15 +557,10 @@
     }
   }
 
-  void diagnoseCrashInUserCode(String message, exception, stackTrace) {
-    hasCrashed = true;
-    print('$message: ${tryToString(exception)}');
-    print(tryToString(stackTrace));
-  }
 
   fromEnvironment(String name) => environment[name];
 
-  LibraryInfo lookupLibraryInfo(String libraryName) {
-    return library_info.LIBRARIES[libraryName];
+  library_info.LibraryInfo lookupLibraryInfo(String libraryName) {
+    return library_info.libraries[libraryName];
   }
 }
diff --git a/pkg/compiler/lib/src/closure.dart b/pkg/compiler/lib/src/closure.dart
index 3beedab..da13773 100644
--- a/pkg/compiler/lib/src/closure.dart
+++ b/pkg/compiler/lib/src/closure.dart
@@ -4,18 +4,28 @@
 
 library closureToClassMapper;
 
+import 'common.dart';
+import 'common/names.dart' show
+    Identifiers;
+import 'common/resolution.dart' show
+    Parsing,
+    Resolution;
+import 'common/tasks.dart' show
+    CompilerTask;
+import 'compiler.dart' show
+    Compiler;
 import 'constants/expressions.dart';
-import 'dart2jslib.dart';
 import 'dart_types.dart';
 import 'elements/elements.dart';
-import 'elements/modelx.dart'
-    show BaseFunctionElementX,
-         ClassElementX,
-         ElementX,
-         LocalFunctionElementX;
+import 'elements/modelx.dart' show
+    BaseFunctionElementX,
+    ClassElementX,
+    ElementX,
+    LocalFunctionElementX;
 import 'elements/visitor.dart' show ElementVisitor;
 import 'js_backend/js_backend.dart' show JavaScriptBackend;
-import 'scanner/scannerlib.dart' show Token;
+import 'resolution/tree_elements.dart' show TreeElements;
+import 'tokens/token.dart' show Token;
 import 'tree/tree.dart';
 import 'util/util.dart';
 import 'universe/universe.dart' show
@@ -66,7 +76,7 @@
     return measure(() {
       ClosureClassMap nestedClosureData = closureMappingCache[node];
       if (nestedClosureData == null) {
-        compiler.internalError(node, "No closure cache.");
+        reporter.internalError(node, "No closure cache.");
       }
       return nestedClosureData;
     });
@@ -131,7 +141,7 @@
   bool get isInstanceMember => true;
   bool get isAssignable => false;
 
-  DartType computeType(Compiler compiler) => type;
+  DartType computeType(Resolution resolution) => type;
 
   DartType get type {
     if (local is LocalElement) {
@@ -188,7 +198,7 @@
     ClassElement superclass = methodElement.isInstanceMember
         ? backend.boundClosureClass
         : backend.closureClass;
-    superclass.ensureResolved(compiler);
+    superclass.ensureResolved(compiler.resolution);
     supertype = superclass.thisType;
     interfaces = const Link<DartType>();
     thisType = rawType = new InterfaceType(this);
@@ -199,7 +209,7 @@
 
   Iterable<ClosureFieldElement> get closureFields => _closureFields;
 
-  void addField(ClosureFieldElement field, DiagnosticListener listener) {
+  void addField(ClosureFieldElement field, DiagnosticReporter listener) {
     _closureFields.add(field);
     addMember(field, listener);
   }
@@ -210,7 +220,7 @@
 
   Token get position => node.getBeginToken();
 
-  Node parseNode(DiagnosticListener listener) => node;
+  Node parseNode(Parsing parsing) => node;
 
   // A [ClosureClassElement] is nested inside a function or initializer in terms
   // of [enclosingElement], but still has to be treated as a top-level
@@ -243,7 +253,7 @@
       : this.box = box,
         super(name, ElementKind.FIELD, box.executableContext);
 
-  DartType computeType(Compiler compiler) => type;
+  DartType computeType(Resolution resolution) => type;
 
   DartType get type => variableElement.type;
 
@@ -306,7 +316,7 @@
       : expression = other,
         super(name, other.kind, other.modifiers, enclosing) {
     asyncMarker = other.asyncMarker;
-    functionSignatureCache = other.functionSignature;
+    functionSignature = other.functionSignature;
   }
 
   /// Use [closureClass] instead.
@@ -323,7 +333,7 @@
 
   FunctionExpression get node => expression.node;
 
-  FunctionExpression parseNode(DiagnosticListener listener) => node;
+  FunctionExpression parseNode(Parsing parsing) => node;
 
   ResolvedAst get resolvedAst {
     return new ResolvedAst(this, node, treeElements);
@@ -498,6 +508,8 @@
                     this.elements,
                     this.closureMappingCache);
 
+  DiagnosticReporter get reporter => compiler.reporter;
+
   /// Generate a unique name for the [id]th closure field, with proposed name
   /// [name].
   ///
@@ -530,7 +542,7 @@
 
   void addCapturedVariable(Node node, Local variable) {
     if (_capturedVariableMapping[variable] != null) {
-      compiler.internalError(node, 'In closure analyzer.');
+      reporter.internalError(node, 'In closure analyzer.');
     }
     _capturedVariableMapping[variable] = null;
   }
@@ -600,7 +612,7 @@
       void addClosureField(Local local, String name) {
         ClosureFieldElement closureField =
             new ClosureFieldElement(name, local, closureClass);
-        closureClass.addField(closureField, compiler);
+        closureClass.addField(closureField, reporter);
         data.freeVariableMap[local] = closureField;
       }
 
@@ -777,8 +789,6 @@
     } else if (node.isTypeCast) {
       DartType type = elements.getType(node.arguments.head);
       analyzeType(type);
-    } else if (elements.isAssert(node) && !compiler.enableUserAssertions) {
-      return;
     }
     node.visitChildren(this);
   }
@@ -985,13 +995,14 @@
     ClosureClassElement globalizedElement = new ClosureClassElement(
         node, closureName, compiler, element);
     FunctionElement callElement =
-        new SynthesizedCallMethodElementX(Compiler.CALL_OPERATOR_NAME,
+        new SynthesizedCallMethodElementX(Identifiers.call,
                                           element,
                                           globalizedElement);
-    backend.maybeMarkClosureAsNeededForReflection(globalizedElement, callElement, element);
+    backend.maybeMarkClosureAsNeededForReflection(
+        globalizedElement, callElement, element);
     MemberElement enclosing = element.memberContext;
     enclosing.nestedClosures.add(callElement);
-    globalizedElement.addMember(callElement, compiler);
+    globalizedElement.addMember(callElement, reporter);
     globalizedElement.computeAllClassMembers(compiler);
     // The nested function's 'this' is the same as the one for the outer
     // function. It could be [null] if we are inside a static method.
diff --git a/pkg/compiler/lib/src/commandline_options.dart b/pkg/compiler/lib/src/commandline_options.dart
new file mode 100644
index 0000000..668cb28
--- /dev/null
+++ b/pkg/compiler/lib/src/commandline_options.dart
@@ -0,0 +1,47 @@
+// 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 dart2js.cmdline.options;
+
+/// Commandline flags used in `dart2js.dart` and/or `apiimpl.dart`.
+class Flags {
+  static const String allowMockCompilation = '--allow-mock-compilation';
+  static const String allowNativeExtensions = '--allow-native-extensions';
+  static const String analyzeAll = '--analyze-all';
+  static const String analyzeMain = '--analyze-main';
+  static const String analyzeOnly = '--analyze-only';
+  static const String analyzeSignaturesOnly = '--analyze-signatures-only';
+  static const String disableDiagnosticColors = '--disable-diagnostic-colors';
+  static const String disableNativeLiveTypeAnalysis =
+      '--disable-native-live-type-analysis';
+  static const String disableTypeInference = '--disable-type-inference';
+  static const String dumpInfo = '--dump-info';
+  static const String enableAssertMessage = '--assert-message';
+  static const String enableCheckedMode = '--enable-checked-mode';
+  static const String enableDiagnosticColors = '--enable-diagnostic-colors';
+  static const String enableExperimentalMirrors =
+      '--enable-experimental-mirrors';
+  static const String fastStartup = '--fast-startup';
+  static const String fatalWarnings = '--fatal-warnings';
+  static const String generateCodeWithCompileTimeErrors =
+      '--generate-code-with-compile-time-errors';
+  static const String incrementalSupport = '--incremental-support';
+  static const String minify = '--minify';
+  static const String noFrequencyBasedMinification =
+      '--no-frequency-based-minification';
+  static const String noSourceMaps = '--no-source-maps';
+  static const String preserveComments = '--preserve-comments';
+  static const String preserveUris = '--preserve-uris';
+  static const String showPackageWarnings = '--show-package-warnings';
+  static const String suppressHints = '--suppress-hints';
+  static const String suppressWarnings = '--suppress-warnings';
+  static const String terse = '--terse';
+  static const String testMode = '--test-mode';
+  static const String trustPrimitives = '--trust-primitives';
+  static const String trustTypeAnnotations = '--trust-type-annotations';
+  static const String useContentSecurityPolicy = '--csp';
+  static const String useCpsIr = '--use-cps-ir';
+  static const String verbose = '--verbose';
+  static const String version = '--version';
+}
diff --git a/pkg/compiler/lib/src/common.dart b/pkg/compiler/lib/src/common.dart
index 65debcd..df3ad46 100644
--- a/pkg/compiler/lib/src/common.dart
+++ b/pkg/compiler/lib/src/common.dart
@@ -2,54 +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.
 
+/// Library that re-exports libraries used throughout the compiler regardless
+/// of phase or subfunctionality.
 library dart2js.common;
 
-export 'constants/values.dart' show
-    ConstantValue,
-    InterceptorConstantValue,
-    NullConstantValue,
-    TypeConstantValue;
-
-export 'dart2jslib.dart' show
-    CallStructure,
-    CompilerTask,
-    Compiler,
-    ConstantEnvironment,
-    MessageKind,
-    Selector,
-    TreeElements,
+export 'diagnostics/diagnostic_listener.dart' show
+    DiagnosticMessage,
+    DiagnosticReporter;
+export 'diagnostics/invariant.dart' show
+    assertDebugMode,
+    InternalErrorFunction,
     invariant;
-
-export 'dart_types.dart' show
-    DartType,
-    FunctionType,
-    InterfaceType,
-    TypeVariableType,
-    Types;
-
-export 'elements/elements.dart' show
-    ClassElement,
-    ClosureFieldElement,
-    CompilationUnitElement,
-    Element,
-    Elements,
-    FunctionElement,
-    FunctionSignature,
-    LibraryElement,
-    MetadataAnnotation,
-    MixinApplicationElement,
-    TypedefElement,
-    VariableElement;
-
-export 'tree/tree.dart' show
-    Node;
-
-export 'types/types.dart' show
-    TypeMask;
-
-export 'universe/universe.dart' show
-    SelectorKind;
-
-export 'util/util.dart' show
-    Link,
+export 'diagnostics/messages.dart' show
+    MessageKind;
+export 'diagnostics/source_span.dart' show
+    SourceSpan;
+export 'diagnostics/spannable.dart' show
+    CURRENT_ELEMENT_SPANNABLE,
+    NO_LOCATION_SPANNABLE,
+    Spannable,
     SpannableAssertionFailure;
+export 'helpers/helpers.dart';
diff --git a/pkg/compiler/lib/src/common/backend_api.dart b/pkg/compiler/lib/src/common/backend_api.dart
new file mode 100644
index 0000000..4638207
--- /dev/null
+++ b/pkg/compiler/lib/src/common/backend_api.dart
@@ -0,0 +1,411 @@
+// Copyright (c) 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.backend_api;
+
+import 'dart:async' show Future;
+
+import '../common.dart';
+import '../compiler.dart' show
+    Compiler;
+import '../compile_time_constants.dart' show
+    BackendConstantEnvironment,
+    ConstantCompilerTask;
+import '../constants/expressions.dart' show
+    ConstantExpression;
+import '../constants/constant_system.dart' show
+    ConstantSystem;
+import '../constants/values.dart' show
+    ConstantValue;
+import '../dart_types.dart' show
+    DartType,
+    InterfaceType;
+import '../elements/elements.dart' show
+    ClassElement,
+    ConstructorElement,
+    Element,
+    FunctionElement,
+    LibraryElement,
+    MetadataAnnotation;
+import '../enqueue.dart' show
+    Enqueuer,
+    CodegenEnqueuer,
+    ResolutionEnqueuer,
+    WorldImpact;
+import '../io/code_output.dart' show
+    CodeBuffer;
+import '../io/source_information.dart' show
+    SourceInformationStrategy;
+import '../js_backend/js_backend.dart' as js_backend show
+    JavaScriptBackend;
+import '../library_loader.dart' show
+    LibraryLoader,
+    LoadedLibraries;
+import '../native/native.dart' as native show
+    NativeEnqueuer;
+import '../patch_parser.dart' show
+    checkNativeAnnotation, checkJsInteropAnnotation;
+import '../resolution/tree_elements.dart' show
+    TreeElements;
+import '../tree/tree.dart' show
+    Node,
+    Send;
+import '../universe/call_structure.dart' show
+    CallStructure;
+
+import 'codegen.dart' show
+    CodegenWorkItem;
+import 'registry.dart' show
+    Registry;
+import 'resolution.dart' show
+    ResolutionCallbacks;
+import 'tasks.dart' show
+    CompilerTask;
+import 'work.dart' show
+    ItemCompilationContext;
+
+
+abstract class Backend {
+  final Compiler compiler;
+
+  Backend(this.compiler);
+
+  /// Returns true if the backend supports reflection.
+  bool get supportsReflection;
+
+  /// The [ConstantSystem] used to interpret compile-time constants for this
+  /// backend.
+  ConstantSystem get constantSystem;
+
+  /// The constant environment for the backend interpretation of compile-time
+  /// constants.
+  BackendConstantEnvironment get constants;
+
+  /// The compiler task responsible for the compilation of constants for both
+  /// the frontend and the backend.
+  ConstantCompilerTask get constantCompilerTask;
+
+  /// Backend callback methods for the resolution phase.
+  ResolutionCallbacks get resolutionCallbacks;
+
+  /// The strategy used for collecting and emitting source information.
+  SourceInformationStrategy get sourceInformationStrategy {
+    return const SourceInformationStrategy();
+  }
+
+  // TODO(johnniwinther): Move this to the JavaScriptBackend.
+  String get patchVersion => null;
+
+  /// Set of classes that need to be considered for reflection although not
+  /// otherwise visible during resolution.
+  Iterable<ClassElement> classesRequiredForReflection = const [];
+
+  // Given a [FunctionElement], return a buffer with the code generated for it
+  // or null if no code was generated.
+  CodeBuffer codeOf(Element element) => null;
+
+  void initializeHelperClasses() {}
+
+  void enqueueHelpers(ResolutionEnqueuer world, Registry registry);
+  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) {
+    return new native.NativeEnqueuer();
+  }
+  native.NativeEnqueuer nativeCodegenEnqueuer(world) {
+    return new native.NativeEnqueuer();
+  }
+
+  /// Generates the output and returns the total size of the generated code.
+  int assembleProgram();
+
+  List<CompilerTask> get tasks;
+
+  void onResolutionComplete() {}
+  void onTypeInferenceComplete() {}
+
+  ItemCompilationContext createItemCompilationContext() {
+    return new ItemCompilationContext();
+  }
+
+  bool classNeedsRti(ClassElement cls);
+  bool methodNeedsRti(FunctionElement function);
+
+  /// Enable compilation of code with compile time errors. Returns `true` if
+  /// supported by the backend.
+  bool enableCodegenWithErrorsIfSupported(Spannable node);
+
+  /// Enable deferred loading. Returns `true` if the backend supports deferred
+  /// loading.
+  bool enableDeferredLoadingIfSupported(Spannable node, Registry registry);
+
+  /// Called during codegen when [constant] has been used.
+  void registerCompileTimeConstant(ConstantValue constant, Registry registry) {}
+
+  /// Called during resolution when a constant value for [metadata] on
+  /// [annotatedElement] has been evaluated.
+  void registerMetadataConstant(MetadataAnnotation metadata,
+                                Element annotatedElement,
+                                Registry registry) {}
+
+  /// 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 implemented by an
+  /// instantiated class.
+  void registerImplementedClass(ClassElement cls,
+                                Enqueuer enqueuer,
+                                Registry registry) {}
+
+  /// 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);
+  }
+
+  /// Register an is check to the backend.
+  void registerIsCheckForCodegen(DartType type,
+                                 Enqueuer enqueuer,
+                                 Registry registry) {}
+
+  /// 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 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) {
+    enqueuer.universe.closuresWithFreeTypeVariables.add(closure);
+  }
+
+  /// Call this to register that a member has been closurized.
+  void registerBoundClosure(Enqueuer enqueuer) {}
+
+  /// Call this to register that a static function has been closurized.
+  void registerGetOfStaticFunction(Enqueuer enqueuer) {}
+
+  /**
+   * Call this to register that the [:runtimeType:] property has been accessed.
+   */
+  void registerRuntimeType(Enqueuer enqueuer, Registry registry) {}
+
+  /// Call this to register a `noSuchMethod` implementation.
+  void registerNoSuchMethod(FunctionElement noSuchMethodElement) {}
+
+  /// Call this method to enable support for `noSuchMethod`.
+  void enableNoSuchMethod(Enqueuer enqueuer) {}
+
+  /// 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) {}
+
+  void registerRequiredType(DartType type) {}
+
+  void registerConstSymbol(String name) {}
+
+  bool isNullImplementation(ClassElement cls) {
+    return cls == compiler.nullClass;
+  }
+
+  ClassElement get intImplementation => compiler.intClass;
+  ClassElement get doubleImplementation => compiler.doubleClass;
+  ClassElement get numImplementation => compiler.numClass;
+  ClassElement get stringImplementation => compiler.stringClass;
+  ClassElement get listImplementation => compiler.listClass;
+  ClassElement get growableListImplementation => compiler.listClass;
+  ClassElement get fixedListImplementation => compiler.listClass;
+  ClassElement get constListImplementation => compiler.listClass;
+  ClassElement get mapImplementation => compiler.mapClass;
+  ClassElement get constMapImplementation => compiler.mapClass;
+  ClassElement get functionImplementation => compiler.functionClass;
+  ClassElement get typeImplementation => compiler.typeClass;
+  ClassElement get boolImplementation => compiler.boolClass;
+  ClassElement get nullImplementation => compiler.nullClass;
+  ClassElement get uint32Implementation => compiler.intClass;
+  ClassElement get uint31Implementation => compiler.intClass;
+  ClassElement get positiveIntImplementation => compiler.intClass;
+
+  ClassElement defaultSuperclass(ClassElement element) => compiler.objectClass;
+
+  bool isInterceptorClass(ClassElement element) => false;
+
+  /// Returns `true` if [element] is a foreign element, that is, that the
+  /// backend has specialized handling for the element.
+  bool isForeign(Element element) => false;
+
+  /// Processes [element] for resolution and returns the [FunctionElement] that
+  /// defines the implementation of [element].
+  FunctionElement resolveExternalFunction(FunctionElement element) => element;
+
+  /// Returns `true` if [library] is a backend specific library whose members
+  /// have special treatment, such as being allowed to extends blacklisted
+  /// classes or member being eagerly resolved.
+  bool isBackendLibrary(LibraryElement library) {
+    // TODO(johnniwinther): Remove this when patching is only done by the
+    // JavaScript backend.
+    Uri canonicalUri = library.canonicalUri;
+    if (canonicalUri == js_backend.JavaScriptBackend.DART_JS_HELPER ||
+        canonicalUri == js_backend.JavaScriptBackend.DART_INTERCEPTORS) {
+      return true;
+    }
+    return false;
+  }
+
+  void registerStaticUse(Element element, Enqueuer enqueuer) {}
+
+  /// This method is called immediately after the [LibraryElement] [library] has
+  /// been created.
+  void onLibraryCreated(LibraryElement library) {}
+
+  /// This method is called immediately after the [library] and its parts have
+  /// been scanned.
+  Future onLibraryScanned(LibraryElement library, LibraryLoader loader) {
+    if (library.canUseNative) {
+      library.forEachLocalMember((Element element) {
+        if (element.isClass) {
+          checkNativeAnnotation(compiler, element);
+        }
+      });
+    }
+    checkJsInteropAnnotation(compiler, library);
+    library.forEachLocalMember((Element element) {
+      checkJsInteropAnnotation(compiler, element);
+      if (element.isClass && element.isJsInterop) {
+        ClassElement classElement = element;
+        classElement.forEachMember((_, memberElement) {
+          checkJsInteropAnnotation(compiler, memberElement);
+        });
+      }
+    });
+    return new Future.value();
+  }
+
+  /// This method is called when all new libraries loaded through
+  /// [LibraryLoader.loadLibrary] has been loaded and their imports/exports
+  /// have been computed.
+  Future onLibrariesLoaded(LoadedLibraries loadedLibraries) {
+    return new Future.value();
+  }
+
+  /// Called by [MirrorUsageAnalyzerTask] after it has merged all @MirrorsUsed
+  /// annotations. The arguments corresponds to the unions of the corresponding
+  /// fields of the annotations.
+  void registerMirrorUsage(Set<String> symbols,
+                           Set<Element> targets,
+                           Set<Element> metaTargets) {}
+
+  /// Returns true if this element needs reflection information at runtime.
+  bool isAccessibleByReflection(Element element) => true;
+
+  /// Returns true if this element is covered by a mirrorsUsed annotation.
+  ///
+  /// Note that it might still be ok to tree shake the element away if no
+  /// reflection is used in the program (and thus [isTreeShakingDisabled] is
+  /// still false). Therefore _do not_ use this predicate to decide inclusion
+  /// in the tree, use [requiredByMirrorSystem] instead.
+  bool referencedFromMirrorSystem(Element element, [recursive]) => false;
+
+  /// Returns true if this element has to be enqueued due to
+  /// mirror usage. Might be a subset of [referencedFromMirrorSystem] if
+  /// normal tree shaking is still active ([isTreeShakingDisabled] is false).
+  bool requiredByMirrorSystem(Element element) => false;
+
+  /// Returns true if global optimizations such as type inferencing
+  /// can apply to this element. One category of elements that do not
+  /// apply is runtime helpers that the backend calls, but the
+  /// optimizations don't see those calls.
+  bool canBeUsedForGlobalOptimizations(Element element) => true;
+
+  /// Called when [enqueuer]'s queue is empty, but before it is closed.
+  /// This is used, for example, by the JS backend to enqueue additional
+  /// elements needed for reflection. [recentClasses] is a collection of
+  /// all classes seen for the first time by the [enqueuer] since the last call
+  /// to [onQueueEmpty].
+  ///
+  /// A return value of [:true:] indicates that [recentClasses] has been
+  /// processed and its elements do not need to be seen in the next round. When
+  /// [:false:] is returned, [onQueueEmpty] will be called again once the
+  /// resolution queue has drained and [recentClasses] will be a superset of the
+  /// current value.
+  ///
+  /// There is no guarantee that a class is only present once in
+  /// [recentClasses], but every class seen by the [enqueuer] will be present in
+  /// [recentClasses] at least once.
+  bool onQueueEmpty(Enqueuer enqueuer, Iterable<ClassElement> recentClasses) {
+    return true;
+  }
+
+  /// Called after the queue is closed. [onQueueEmpty] may be called multiple
+  /// times, but [onQueueClosed] is only called once.
+  void onQueueClosed() {}
+
+  /// Called when the compiler starts running the codegen enqueuer.
+  void onCodegenStart() {}
+
+  /// Called after [element] has been resolved.
+  // TODO(johnniwinther): Change [TreeElements] to [Registry] or a dependency
+  // node. [elements] is currently unused by the implementation.
+  void onElementResolved(Element element, TreeElements elements) {}
+
+  // Does this element belong in the output
+  bool shouldOutput(Element element) => true;
+
+  FunctionElement helperForBadMain() => null;
+
+  FunctionElement helperForMissingMain() => null;
+
+  FunctionElement helperForMainArity() => null;
+
+  void forgetElement(Element element) {}
+
+  void registerMainHasArguments(Enqueuer enqueuer) {}
+
+  void registerAsyncMarker(FunctionElement element,
+                           Enqueuer enqueuer,
+                           Registry registry) {}
+
+  /// Called when resolving a call to a foreign function.
+  void registerForeignCall(Send node,
+                           Element element,
+                           CallStructure callStructure,
+                           ForeignResolver resolver) {}
+}
+
+/// Interface for resolving calls to foreign functions.
+abstract class ForeignResolver {
+  /// Returns the constant expression of [node], or `null` if [node] is not
+  /// a constant expression.
+  ConstantExpression getConstant(Node node);
+
+  /// Registers [type] as instantiated.
+  void registerInstantiatedType(InterfaceType type);
+
+  /// Resolves [typeName] to a type in the context of [node].
+  DartType resolveTypeFromString(Node node, String typeName);
+}
diff --git a/pkg/compiler/lib/src/common/codegen.dart b/pkg/compiler/lib/src/common/codegen.dart
new file mode 100644
index 0000000..ab154f9
--- /dev/null
+++ b/pkg/compiler/lib/src/common/codegen.dart
@@ -0,0 +1,199 @@
+// Copyright (c) 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.codegen;
+
+import '../common.dart';
+import '../compiler.dart' show
+    Compiler;
+import '../constants/values.dart' show
+    ConstantValue;
+import '../dart_types.dart' show
+    DartType,
+    InterfaceType;
+import '../elements/elements.dart' show
+    AstElement,
+    ClassElement,
+    Element,
+    FunctionElement,
+    LocalFunctionElement;
+import '../enqueue.dart' show
+    CodegenEnqueuer,
+    WorldImpact;
+import '../js_backend/js_backend.dart' show
+    JavaScriptBackend;
+import '../resolution/tree_elements.dart' show
+    TreeElements;
+import '../universe/selector.dart' show
+    Selector;
+import '../universe/universe.dart' show
+    UniverseSelector;
+import '../util/util.dart' show
+    Setlet;
+import 'registry.dart' show
+    Registry;
+import 'work.dart' show
+    ItemCompilationContext,
+    WorkItem;
+
+// 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;
+  final TreeElements treeElements;
+
+  CodegenRegistry(this.compiler, this.treeElements);
+
+  bool get isForResolution => false;
+
+  Element get currentElement => treeElements.analyzedElement;
+
+  String toString() => 'CodegenRegistry for $currentElement';
+
+  CodegenEnqueuer get world => compiler.enqueuer.codegen;
+  JavaScriptBackend get backend => compiler.backend;
+
+  void registerAssert(bool hasMessage) {
+    // Codegen does not register asserts.  They have been lowered to calls.
+    assert(false);
+  }
+
+  void registerInstantiatedClass(ClassElement element) {
+    backend.registerInstantiatedType(element.rawType, world, this);
+  }
+
+  void registerInstantiatedType(InterfaceType type) {
+    backend.registerInstantiatedType(type, world, this);
+  }
+
+  void registerStaticUse(Element element) {
+    world.registerStaticUse(element);
+  }
+
+  void registerDynamicInvocation(UniverseSelector selector) {
+    world.registerDynamicInvocation(selector);
+    compiler.dumpInfoTask.elementUsesSelector(currentElement, selector);
+  }
+
+  void registerDynamicSetter(UniverseSelector selector) {
+    world.registerDynamicSetter(selector);
+    compiler.dumpInfoTask.elementUsesSelector(currentElement, selector);
+  }
+
+  void registerDynamicGetter(UniverseSelector selector) {
+    world.registerDynamicGetter(selector);
+    compiler.dumpInfoTask.elementUsesSelector(currentElement, selector);
+  }
+
+  void registerGetterForSuperMethod(Element element) {
+    world.registerGetterForSuperMethod(element);
+  }
+
+  void registerFieldGetter(Element element) {
+    world.registerFieldGetter(element);
+  }
+
+  void registerFieldSetter(Element element) {
+    world.registerFieldSetter(element);
+  }
+
+  void registerIsCheck(DartType type) {
+    world.registerIsCheck(type);
+    backend.registerIsCheckForCodegen(type, world, this);
+  }
+
+  void registerCompileTimeConstant(ConstantValue constant) {
+    backend.registerCompileTimeConstant(constant, this);
+  }
+
+  void registerTypeVariableBoundsSubtypeCheck(DartType subtype,
+                                              DartType supertype) {
+    backend.registerTypeVariableBoundsSubtypeCheck(subtype, supertype);
+  }
+
+  void registerInstantiatedClosure(LocalFunctionElement element) {
+    backend.registerInstantiatedClosure(element, this);
+  }
+
+  void registerGetOfStaticFunction(FunctionElement element) {
+    world.registerGetOfStaticFunction(element);
+  }
+
+  void registerSelectorUse(Selector selector) {
+    world.registerSelectorUse(new UniverseSelector(selector, null));
+  }
+
+  void registerConstSymbol(String name) {
+    backend.registerConstSymbol(name);
+  }
+
+  void registerSpecializedGetInterceptor(Set<ClassElement> classes) {
+    backend.registerSpecializedGetInterceptor(classes);
+  }
+
+  void registerUseInterceptor() {
+    backend.registerUseInterceptor(world);
+  }
+
+  void registerTypeConstant(ClassElement element) {
+    backend.customElementsAnalysis.registerTypeConstant(element, world);
+    backend.lookupMapAnalysis.registerTypeConstant(element);
+  }
+
+  void registerStaticInvocation(Element element) {
+    world.registerStaticUse(element);
+  }
+
+  void registerSuperInvocation(Element element) {
+    world.registerStaticUse(element);
+  }
+
+  void registerDirectInvocation(Element element) {
+    world.registerStaticUse(element);
+  }
+
+  void registerInstantiation(InterfaceType type) {
+    backend.registerInstantiatedType(type, world, this);
+  }
+
+  void registerAsyncMarker(FunctionElement element) {
+    backend.registerAsyncMarker(element, world, this);
+  }
+
+}
+
+/// [WorkItem] used exclusively by the [CodegenEnqueuer].
+class CodegenWorkItem extends WorkItem {
+  CodegenRegistry registry;
+
+  factory CodegenWorkItem(
+      Compiler compiler,
+      AstElement element,
+      ItemCompilationContext compilationContext) {
+    // 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
+    // don't need.
+    assert(invariant(element,
+        compiler.enqueuer.resolution.hasBeenProcessed(element),
+        message: "$element has not been resolved."));
+    assert(invariant(element, element.resolvedAst.elements != null,
+        message: 'Resolution tree is null for $element in codegen work item'));
+    return new CodegenWorkItem.internal(element, compilationContext);
+  }
+
+  CodegenWorkItem.internal(
+      AstElement element,
+      ItemCompilationContext compilationContext)
+      : super(element, compilationContext);
+
+  TreeElements get resolutionTree => element.resolvedAst.elements;
+
+  WorldImpact run(Compiler compiler, CodegenEnqueuer world) {
+    if (world.isProcessed(element)) return const WorldImpact();
+
+    registry = new CodegenRegistry(compiler, resolutionTree);
+    return compiler.codegen(this, world);
+  }
+}
diff --git a/pkg/compiler/lib/src/common/names.dart b/pkg/compiler/lib/src/common/names.dart
new file mode 100644
index 0000000..45c7b1f
--- /dev/null
+++ b/pkg/compiler/lib/src/common/names.dart
@@ -0,0 +1,126 @@
+// 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 containing identifier, names, and selectors commonly used through
+/// the compiler.
+library dart2js.common.names;
+
+import '../elements/elements.dart' show
+    Name,
+    PublicName;
+import '../universe/call_structure.dart' show
+    CallStructure;
+import '../universe/selector.dart' show
+    Selector;
+
+/// [String]s commonly used.
+class Identifiers {
+  /// The name of the call operator.
+  static const String call = 'call';
+
+  /// The name of the current element property used on iterators in for-each
+  /// loops.
+  static const String current = 'current';
+
+  /// The name of the from environment constructors on 'int', 'bool' and
+  /// 'String'.
+  static const String fromEnvironment = 'fromEnvironment';
+
+  /// The name of the iterator property used in for-each loops.
+  static const String iterator = 'iterator';
+
+  /// The name of the main method.
+  static const String main = 'main';
+
+  /// The name of the no such method handler on 'Object'.
+  static const String noSuchMethod_ = 'noSuchMethod';
+
+  /// The name of the runtime type property on 'Object'.
+  static const String runtimeType_ = 'runtimeType';
+}
+
+/// [Name]s commonly used.
+class Names {
+  /// The name of the call operator.
+  static const Name call = const PublicName(Identifiers.call);
+
+  /// The name of the current element property used on iterators in for-each
+  /// loops.
+  static const Name current = const PublicName(Identifiers.current);
+
+  /// The name of the dynamic type.
+  static const Name dynamic_ = const PublicName('dynamic');
+
+  /// The name of the iterator property used in for-each loops.
+  static const Name iterator = const PublicName(Identifiers.iterator);
+
+  /// The name of the move next method used on iterators in for-each loops.
+  static const Name moveNext = const PublicName('moveNext');
+
+  /// The name of the no such method handler on 'Object'.
+  static const Name noSuchMethod_ = const PublicName(Identifiers.noSuchMethod_);
+
+  /// The name of the to-string method on 'Object'.
+  static const Name toString_ = const PublicName('toString');
+
+  static const Name INDEX_NAME = const PublicName("[]");
+  static const Name INDEX_SET_NAME = const PublicName("[]=");
+  static const Name CALL_NAME = Names.call;
+}
+
+/// [Selector]s commonly used.
+class Selectors {
+  /// The selector for calling the cancel method on 'StreamIterator'.
+  static final Selector cancel =
+      new Selector.call(const PublicName('cancel'), CallStructure.NO_ARGS);
+
+  /// The selector for getting the current element property used in for-each
+  /// loops.
+  static final Selector current = new Selector.getter(Names.current);
+
+  /// The selector for getting the iterator property used in for-each loops.
+  static final Selector iterator = new Selector.getter(Names.iterator);
+
+  /// The selector for calling the move next method used in for-each loops.
+  static final Selector moveNext =
+      new Selector.call(Names.moveNext, CallStructure.NO_ARGS);
+
+  /// The selector for calling the no such method handler on 'Object'.
+  static final Selector noSuchMethod_ =
+      new Selector.call(Names.noSuchMethod_, CallStructure.ONE_ARG);
+
+  /// The selector for calling the to-string method on 'Object'.
+  static final Selector toString_ =
+      new Selector.call(Names.toString_, CallStructure.NO_ARGS);
+
+  static final Selector hashCode_ =
+      new Selector.getter(const PublicName('hashCode'));
+
+  static final Selector compareTo =
+      new Selector.call(const PublicName("compareTo"), CallStructure.ONE_ARG);
+
+  static final Selector equals = new Selector.binaryOperator('==');
+}
+
+/// [Uri]s commonly used.
+class Uris {
+  /// The URI for 'dart:async'.
+  static final Uri dart_async = new Uri(scheme: 'dart', path: 'async');
+
+  /// The URI for 'dart:core'.
+  static final Uri dart_core = new Uri(scheme: 'dart', path: 'core');
+
+  /// The URI for 'dart:html'.
+  static final Uri dart_html = new Uri(scheme: 'dart', path: 'html');
+
+  /// The URI for 'dart:mirrors'.
+  static final Uri dart_mirrors = new Uri(scheme: 'dart', path: 'mirrors');
+
+  /// The URI for 'dart:_internal'.
+  static final Uri dart__internal = new Uri(scheme: 'dart', path: '_internal');
+
+  /// The URI for 'dart:_native_typed_data'.
+  static final Uri dart__native_typed_data =
+      new Uri(scheme: 'dart', path: '_native_typed_data');
+}
\ No newline at end of file
diff --git a/pkg/compiler/lib/src/common/registry.dart b/pkg/compiler/lib/src/common/registry.dart
new file mode 100644
index 0000000..055a7c6
--- /dev/null
+++ b/pkg/compiler/lib/src/common/registry.dart
@@ -0,0 +1,33 @@
+// Copyright (c) 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 '../dart_types.dart' show
+  InterfaceType;
+import '../elements/elements.dart' show
+  Element,
+  FunctionElement;
+import '../universe/universe.dart' show
+  UniverseSelector;
+
+/// Interface for registration of element dependencies.
+abstract class Registry {
+  // TODO(johnniwinther): Remove this.
+  void registerDependency(Element element) {}
+
+  bool get isForResolution;
+
+  void registerDynamicInvocation(UniverseSelector selector);
+
+  void registerDynamicGetter(UniverseSelector selector);
+
+  void registerDynamicSetter(UniverseSelector selector);
+
+  void registerStaticInvocation(Element element);
+
+  void registerInstantiation(InterfaceType type);
+
+  void registerGetOfStaticFunction(FunctionElement element);
+}
diff --git a/pkg/compiler/lib/src/common/resolution.dart b/pkg/compiler/lib/src/common/resolution.dart
new file mode 100644
index 0000000..88cb4b9
--- /dev/null
+++ b/pkg/compiler/lib/src/common/resolution.dart
@@ -0,0 +1,331 @@
+
+// Copyright (c) 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.resolution;
+
+import '../common.dart';
+import '../compiler.dart' show
+    Compiler;
+import '../core_types.dart' show
+    CoreTypes;
+import '../dart_types.dart' show
+    DartType,
+    InterfaceType;
+import '../elements/elements.dart' show
+    AstElement,
+    ClassElement,
+    Element,
+    ErroneousElement,
+    FunctionElement,
+    FunctionSignature,
+    LocalFunctionElement,
+    MetadataAnnotation,
+    MethodElement,
+    TypedefElement,
+    TypeVariableElement;
+import '../enqueue.dart' show
+    ResolutionEnqueuer,
+    WorldImpact;
+import '../tree/tree.dart' show
+    AsyncForIn,
+    Send,
+    TypeAnnotation;
+import '../universe/universe.dart' show
+    UniverseSelector;
+import '../util/util.dart' show
+    Setlet;
+import 'registry.dart' show
+    Registry;
+import 'work.dart' show
+    ItemCompilationContext,
+    WorkItem;
+
+/// [WorkItem] used exclusively by the [ResolutionEnqueuer].
+class ResolutionWorkItem extends WorkItem {
+  bool _isAnalyzed = false;
+
+  ResolutionWorkItem(AstElement element,
+                     ItemCompilationContext compilationContext)
+      : super(element, compilationContext);
+
+  WorldImpact run(Compiler compiler, ResolutionEnqueuer world) {
+    WorldImpact impact = compiler.analyze(this, world);
+    _isAnalyzed = true;
+    return impact;
+  }
+
+  bool get isAnalyzed => _isAnalyzed;
+}
+
+// TODO(johnniwinther): Rename this to something like  `BackendResolutionApi`
+// and clean up the interface.
+/// Backend callbacks function specific to the resolution phase.
+class ResolutionCallbacks {
+  /// Transform the [ResolutionImpact] into a [WorldImpact] adding the
+  /// backend dependencies for features used in [worldImpact].
+  WorldImpact transformImpact(ResolutionImpact worldImpact) => worldImpact;
+}
+
+class ResolutionImpact extends WorldImpact {
+  const ResolutionImpact();
+
+  // TODO(johnniwinther): Remove this.
+  void registerDependency(Element element) {}
+
+  Iterable<Feature> get features => const <Feature>[];
+  Iterable<DartType> get requiredTypes => const <DartType>[];
+  Iterable<MapLiteralUse> get mapLiterals => const <MapLiteralUse>[];
+  Iterable<ListLiteralUse> get listLiterals => const <ListLiteralUse>[];
+  Iterable<DartType> get typeLiterals => const <DartType>[];
+  Iterable<String> get constSymbolNames => const <String>[];
+}
+
+/// A language feature seen during resolution.
+// TODO(johnniwinther): Should mirror usage be part of this?
+enum Feature {
+  /// Invocation of a generative construction on an abstract class.
+  ABSTRACT_CLASS_INSTANTIATION,
+  /// An assert statement with no message.
+  ASSERT,
+  /// An assert statement with a message.
+  ASSERT_WITH_MESSAGE,
+  /// A method with an `async` body modifier.
+  ASYNC,
+  /// An asynchronous for in statement like `await for (var e in i) {}`.
+  ASYNC_FOR_IN,
+  /// A method with an `async*` body modifier.
+  ASYNC_STAR,
+  /// A catch statement.
+  CATCH_STATEMENT,
+  /// A compile time error.
+  COMPILE_TIME_ERROR,
+  /// A fall through in a switch case.
+  FALL_THROUGH_ERROR,
+  /// A ++/-- operation.
+  INC_DEC_OPERATION,
+  /// A field whose initialization is not a constant.
+  LAZY_FIELD,
+  /// A catch clause with a variable for the stack trace.
+  STACK_TRACE_IN_CATCH,
+  /// String interpolation.
+  STRING_INTERPOLATION,
+  /// An implicit call to `super.noSuchMethod`, like calling an unresolved
+  /// super method.
+  SUPER_NO_SUCH_METHOD,
+  /// A redirection to the `Symbol` constructor.
+  SYMBOL_CONSTRUCTOR,
+  /// An synchronous for in statement, like `for (var e in i) {}`.
+  SYNC_FOR_IN,
+  /// A method with a `sync*` body modifier.
+  SYNC_STAR,
+  /// A throw expression.
+  THROW_EXPRESSION,
+  /// An implicit throw of a `NoSuchMethodError`, like calling an unresolved
+  /// static method.
+  THROW_NO_SUCH_METHOD,
+  /// An implicit throw of a runtime error, like
+  THROW_RUNTIME_ERROR,
+  /// The need for a type variable bound check, like instantiation of a generic
+  /// type whose type variable have non-trivial bounds.
+  TYPE_VARIABLE_BOUNDS_CHECK,
+}
+
+/// A use of a map literal seen during resolution.
+class MapLiteralUse {
+  final InterfaceType type;
+  final bool isConstant;
+  final bool isEmpty;
+
+  MapLiteralUse(this.type, {this.isConstant: false, this.isEmpty: false});
+
+  int get hashCode {
+    return
+        type.hashCode * 13 +
+        isConstant.hashCode * 17 +
+        isEmpty.hashCode * 19;
+  }
+
+  bool operator ==(other) {
+    if (identical(this, other)) return true;
+    if (other is! MapLiteralUse) return false;
+    return
+        type == other.type &&
+        isConstant == other.isConstant &&
+        isEmpty == other.isEmpty;
+  }
+}
+
+/// A use of a list literal seen during resolution.
+class ListLiteralUse {
+  final InterfaceType type;
+  final bool isConstant;
+  final bool isEmpty;
+
+  ListLiteralUse(this.type, {this.isConstant: false, this.isEmpty: false});
+
+  int get hashCode {
+    return
+        type.hashCode * 13 +
+        isConstant.hashCode * 17 +
+        isEmpty.hashCode * 19;
+  }
+
+  bool operator ==(other) {
+    if (identical(this, other)) return true;
+    if (other is! ListLiteralUse) return false;
+    return
+        type == other.type &&
+        isConstant == other.isConstant &&
+        isEmpty == other.isEmpty;
+  }
+}
+
+/// Mutable implementation of [WorldImpact] used to transform
+/// [ResolutionImpact] to [WorldImpact].
+// TODO(johnniwinther): Remove [Registry] when dependency is tracked directly
+// on [WorldImpact].
+class TransformedWorldImpact extends WorldImpact {
+  final ResolutionImpact worldImpact;
+
+  Setlet<Element> _staticUses;
+  Setlet<InterfaceType> _instantiatedTypes;
+  Setlet<UniverseSelector> _dynamicGetters;
+  Setlet<UniverseSelector> _dynamicInvocations;
+  Setlet<UniverseSelector> _dynamicSetters;
+
+  TransformedWorldImpact(this.worldImpact);
+
+  @override
+  Iterable<DartType> get asCasts => worldImpact.asCasts;
+
+  @override
+  Iterable<DartType> get checkedModeChecks => worldImpact.checkedModeChecks;
+
+  @override
+  Iterable<MethodElement> get closurizedFunctions {
+    return worldImpact.closurizedFunctions;
+  }
+
+  @override
+  Iterable<UniverseSelector> get dynamicGetters {
+    return _dynamicGetters != null
+        ? _dynamicGetters : worldImpact.dynamicGetters;
+  }
+
+  @override
+  Iterable<UniverseSelector> get dynamicInvocations {
+    return _dynamicInvocations != null
+        ? _dynamicInvocations : worldImpact.dynamicInvocations;
+  }
+
+  @override
+  Iterable<UniverseSelector> get dynamicSetters {
+    return _dynamicSetters != null
+        ? _dynamicSetters : worldImpact.dynamicSetters;
+  }
+
+  @override
+  Iterable<DartType> get isChecks => worldImpact.isChecks;
+
+  @override
+  Iterable<Element> get staticUses {
+    if (_staticUses == null) {
+      return worldImpact.staticUses;
+    }
+    return _staticUses;
+  }
+
+  _unsupported(String message) => throw new UnsupportedError(message);
+
+  void registerDynamicGetter(UniverseSelector selector) {
+    if (_dynamicGetters == null) {
+      _dynamicGetters = new Setlet<UniverseSelector>();
+      _dynamicGetters.addAll(worldImpact.dynamicGetters);
+    }
+    _dynamicGetters.add(selector);
+  }
+
+  void registerDynamicInvocation(UniverseSelector selector) {
+    if (_dynamicInvocations == null) {
+      _dynamicInvocations = new Setlet<UniverseSelector>();
+      _dynamicInvocations.addAll(worldImpact.dynamicInvocations);
+    }
+    _dynamicInvocations.add(selector);
+  }
+
+  void registerDynamicSetter(UniverseSelector selector) {
+    if (_dynamicSetters == null) {
+      _dynamicSetters = new Setlet<UniverseSelector>();
+      _dynamicSetters.addAll(worldImpact.dynamicSetters);
+    }
+    _dynamicSetters.add(selector);
+  }
+
+  void registerInstantiatedType(InterfaceType type) {
+    // TODO(johnniwinther): Remove this when dependency tracking is done on
+    // the world impact itself.
+    worldImpact.registerDependency(type.element);
+    if (_instantiatedTypes == null) {
+      _instantiatedTypes = new Setlet<InterfaceType>();
+    }
+    _instantiatedTypes.add(type);
+  }
+
+  @override
+  Iterable<InterfaceType> get instantiatedTypes {
+    return _instantiatedTypes != null
+        ? _instantiatedTypes : const <InterfaceType>[];
+  }
+
+  @override
+  Iterable<DartType> get typeLiterals {
+    return worldImpact.typeLiterals;
+  }
+
+  void registerStaticUse(Element element) {
+    // TODO(johnniwinther): Remove this when dependency tracking is done on
+    // the world impact itself.
+    worldImpact.registerDependency(element);
+    if (_staticUses == null) {
+      _staticUses = new Setlet<Element>();
+    }
+    _staticUses.add(element);
+  }
+
+  @override
+  Iterable<LocalFunctionElement> get closures => worldImpact.closures;
+
+  String toString() {
+    StringBuffer sb = new StringBuffer();
+    sb.write('TransformedWorldImpact($worldImpact)');
+    sb.write(super.toString());
+    return sb.toString();
+  }
+}
+
+// TODO(johnniwinther): Rename to `Resolver` or `ResolverContext`.
+abstract class Resolution {
+  Parsing get parsing;
+  DiagnosticReporter get reporter;
+  CoreTypes get coreTypes;
+
+  void resolveTypedef(TypedefElement typdef);
+  void resolveClass(ClassElement cls);
+  void registerClass(ClassElement cls);
+  void resolveMetadataAnnotation(MetadataAnnotation metadataAnnotation);
+  FunctionSignature resolveSignature(FunctionElement function);
+  DartType resolveTypeAnnotation(Element element, TypeAnnotation node);
+
+  bool hasBeenResolved(Element element);
+  WorldImpact getWorldImpact(Element element);
+  WorldImpact computeWorldImpact(Element element);
+}
+
+// TODO(johnniwinther): Rename to `Parser` or `ParsingContext`.
+abstract class Parsing {
+  DiagnosticReporter get reporter;
+  void parsePatchClass(ClassElement cls);
+  measure(f());
+}
\ No newline at end of file
diff --git a/pkg/compiler/lib/src/common/tasks.dart b/pkg/compiler/lib/src/common/tasks.dart
new file mode 100644
index 0000000..737c2a9
--- /dev/null
+++ b/pkg/compiler/lib/src/common/tasks.dart
@@ -0,0 +1,98 @@
+// Copyright (c) 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.tasks;
+
+import 'dart:developer' show
+    UserTag;
+
+import '../common.dart';
+import '../compiler.dart' show
+    Compiler;
+import '../elements/elements.dart' show
+    Element;
+
+typedef void DeferredAction();
+
+class DeferredTask {
+  final Element element;
+  final DeferredAction action;
+
+  DeferredTask(this.element, this.action);
+}
+
+class CompilerTask {
+  final Compiler compiler;
+  final Stopwatch watch;
+  UserTag profilerTag;
+  final Map<String, GenericTask> _subtasks = <String, GenericTask>{};
+
+  CompilerTask(Compiler compiler)
+      : this.compiler = compiler,
+        watch = (compiler.verbose) ? new Stopwatch() : null;
+
+  DiagnosticReporter get reporter => compiler.reporter;
+
+  String get name => "Unknown task '${this.runtimeType}'";
+
+  int get timing {
+    if (watch == null) return 0;
+    int total = watch.elapsedMilliseconds;
+    for (GenericTask subtask in _subtasks.values) {
+      total += subtask.timing;
+    }
+    return total;
+  }
+
+  UserTag getProfilerTag() {
+    if (profilerTag == null) profilerTag = new UserTag(name);
+    return profilerTag;
+  }
+
+  measure(action()) {
+    // In verbose mode when watch != null.
+    if (watch == null) return action();
+    CompilerTask previous = compiler.measuredTask;
+    if (identical(this, previous)) return action();
+    compiler.measuredTask = this;
+    if (previous != null) previous.watch.stop();
+    watch.start();
+    UserTag oldTag = getProfilerTag().makeCurrent();
+    try {
+      return action();
+    } finally {
+      watch.stop();
+      oldTag.makeCurrent();
+      if (previous != null) previous.watch.start();
+      compiler.measuredTask = previous;
+    }
+  }
+
+  measureElement(Element element, action()) {
+    reporter.withCurrentElement(element, () => measure(action));
+  }
+
+  /// Measure the time spent in [action] (if in verbose mode) and accumulate it
+  /// under a subtask with the given name.
+  measureSubtask(String name, action()) {
+    if (watch == null) return action();
+    // Use a nested CompilerTask for the measurement to ensure nested [measure]
+    // calls work correctly. The subtasks will never themselves have nested
+    // subtasks because they are not accessible outside.
+    GenericTask subtask = _subtasks.putIfAbsent(name,
+        () => new GenericTask(name, compiler));
+    return subtask.measure(action);
+  }
+
+  Iterable<String> get subtasks => _subtasks.keys;
+
+  int getSubtaskTime(String subtask) => _subtasks[subtask].timing;
+}
+
+class GenericTask extends CompilerTask {
+  final String name;
+
+  GenericTask(this.name, Compiler compiler)
+      : super(compiler);
+}
diff --git a/pkg/compiler/lib/src/common/work.dart b/pkg/compiler/lib/src/common/work.dart
new file mode 100644
index 0000000..49f23c0
--- /dev/null
+++ b/pkg/compiler/lib/src/common/work.dart
@@ -0,0 +1,38 @@
+// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library dart2js.common.work;
+
+import '../common.dart';
+import '../compiler.dart' show
+    Compiler;
+import '../elements/elements.dart' show
+    AstElement;
+import '../enqueue.dart' show
+    Enqueuer,
+    WorldImpact;
+
+
+/**
+ * Contains backend-specific data that is used throughout the compilation of
+ * one work item.
+ */
+class ItemCompilationContext {
+}
+
+abstract class WorkItem {
+  final ItemCompilationContext compilationContext;
+  /**
+   * Documentation wanted -- johnniwinther
+   *
+   * Invariant: [element] must be a declaration element.
+   */
+  final AstElement element;
+
+  WorkItem(this.element, this.compilationContext) {
+    assert(invariant(element, element.isDeclaration));
+  }
+
+  WorldImpact run(Compiler compiler, Enqueuer world);
+}
diff --git a/pkg/compiler/lib/src/compile_time_constants.dart b/pkg/compiler/lib/src/compile_time_constants.dart
index b203ec1..99672db 100644
--- a/pkg/compiler/lib/src/compile_time_constants.dart
+++ b/pkg/compiler/lib/src/compile_time_constants.dart
@@ -4,19 +4,31 @@
 
 library dart2js.compile_time_constant_evaluator;
 
+import 'common.dart';
+import 'common/resolution.dart' show
+    Resolution;
+import 'common/tasks.dart' show
+    CompilerTask;
+import 'compiler.dart' show
+    Compiler;
 import 'constant_system_dart.dart';
 import 'constants/constant_system.dart';
+import 'constants/evaluation.dart';
 import 'constants/expressions.dart';
 import 'constants/values.dart';
 import 'dart_types.dart';
-import 'dart2jslib.dart' show Compiler, CompilerTask, MessageKind, WorldImpact, invariant;
 import 'elements/elements.dart';
-import 'elements/modelx.dart' show FunctionElementX;
-import 'resolution/resolution.dart';
+import 'elements/modelx.dart' show
+    FunctionElementX;
+import 'helpers/helpers.dart';
+import 'resolution/tree_elements.dart' show
+    TreeElements;
 import 'resolution/operators.dart';
 import 'tree/tree.dart';
-import 'util/util.dart' show Link;
-import 'universe/universe.dart' show CallStructure;
+import 'util/util.dart' show
+    Link;
+import 'universe/call_structure.dart' show
+    CallStructure;
 
 /// A [ConstantEnvironment] provides access for constants compiled for variable
 /// initializers.
@@ -65,7 +77,7 @@
   ///
   /// The returned constant is always of the frontend interpretation.
   ConstantExpression compileNode(Node node, TreeElements elements,
-                                 {bool enforceConst: true});
+      {bool enforceConst: true});
 
   /// Compiles the compile-time constant for the value [metadata], or reports an
   /// error if the value is not a compile-time constant.
@@ -77,6 +89,10 @@
   ConstantExpression compileMetadata(MetadataAnnotation metadata,
                                      Node node,
                                      TreeElements elements);
+
+  /// Evaluates [constant] and caches the result.
+  // TODO(johnniwinther): Remove when all constants are evaluated.
+  void evaluate(ConstantExpression constant);
 }
 
 /// A [BackendConstantEnvironment] provides access to constants needed for
@@ -143,6 +159,8 @@
 
   ConstantCompilerBase(this.compiler, this.constantSystem);
 
+  DiagnosticReporter get reporter => compiler.reporter;
+
   @override
   ConstantValue getConstantValueForVariable(VariableElement element) {
     return getConstantValue(initialVariableValues[element.declaration]);
@@ -154,23 +172,39 @@
   }
 
   ConstantExpression compileConstant(VariableElement element) {
-    return compileVariable(element, isConst: true);
+    return internalCompileVariable(element, true, true);
   }
 
-  ConstantExpression compileVariable(VariableElement element,
-                                     {bool isConst: false}) {
+  @override
+  void evaluate(ConstantExpression constant) {
+    constantValueMap.putIfAbsent(constant, () {
+      return constant.evaluate(
+          new _CompilerEnvironment(compiler),
+          constantSystem);
+    });
+  }
 
+  ConstantExpression compileVariable(VariableElement element) {
+    return internalCompileVariable(element, false, true);
+  }
+
+  /// Compile [element] into a constant expression. If [isConst] is true,
+  /// then [element] is a constant variable. If [checkType] is true, then
+  /// report an error if [element] does not typecheck.
+  ConstantExpression internalCompileVariable(
+      VariableElement element, bool isConst, bool checkType) {
     if (initialVariableValues.containsKey(element.declaration)) {
       ConstantExpression result = initialVariableValues[element.declaration];
       return result;
     }
     AstElement currentElement = element.analyzableElement;
-    return compiler.withCurrentElement(currentElement, () {
+    return reporter.withCurrentElement(currentElement, () {
       // TODO(johnniwinther): Avoid this eager analysis.
       _analyzeElementEagerly(compiler, currentElement);
 
       ConstantExpression constant = compileVariableWithDefinitions(
-          element, currentElement.resolvedAst.elements, isConst: isConst);
+          element, currentElement.resolvedAst.elements,
+          isConst: isConst, checkType: checkType);
       return constant;
     });
   }
@@ -181,13 +215,13 @@
    * If the variable is `const` but cannot be compiled eagerly reports an
    * error.
    */
-  ConstantExpression compileVariableWithDefinitions(VariableElement element,
-                                                    TreeElements definitions,
-                                                    {bool isConst: false}) {
+  ConstantExpression compileVariableWithDefinitions(
+      VariableElement element, TreeElements definitions,
+      {bool isConst: false, bool checkType: true}) {
     Node node = element.node;
     if (pendingVariables.contains(element)) {
       if (isConst) {
-        compiler.reportError(
+        reporter.reportErrorMessage(
             node, MessageKind.CYCLIC_COMPILE_TIME_CONSTANTS);
         ConstantExpression expression = new ErroneousConstantExpression();
         constantValueMap[expression] = constantSystem.createNull();
@@ -204,9 +238,10 @@
       expression = new NullConstantExpression();
       constantValueMap[expression] = constantSystem.createNull();
     } else {
-      expression = compileNodeWithDefinitions(
-          initializer, definitions, isConst: isConst);
+      expression = compileNodeWithDefinitions(initializer, definitions,
+          isConst: isConst);
       if (compiler.enableTypeAssertions &&
+          checkType &&
           expression != null &&
           element.isField) {
         DartType elementType = element.type;
@@ -214,7 +249,7 @@
         if (elementType.isMalformed && !value.isNull) {
           if (isConst) {
             ErroneousElement element = elementType.element;
-            compiler.reportError(
+            reporter.reportErrorMessage(
                 node, element.messageKind, element.messageArguments);
           } else {
             // We need to throw an exception at runtime.
@@ -222,12 +257,14 @@
           }
         } else {
           DartType constantType = value.getType(compiler.coreTypes);
-          if (!constantSystem.isSubtype(compiler.types,
-                                        constantType, elementType)) {
+          if (!constantSystem.isSubtype(
+              compiler.types, constantType, elementType)) {
             if (isConst) {
-              compiler.reportError(
-                  node, MessageKind.NOT_ASSIGNABLE,
-                  {'fromType': constantType, 'toType': elementType});
+              reporter.reportErrorMessage(
+                  node,
+                  MessageKind.NOT_ASSIGNABLE,
+                  {'fromType': constantType,
+                   'toType': elementType});
             } else {
               // If the field cannot be lazily initialized, we will throw
               // the exception at runtime.
@@ -241,7 +278,7 @@
       initialVariableValues[element.declaration] = expression;
     } else {
       assert(invariant(element, !isConst,
-             message: "Variable $element does not compile to a constant."));
+          message: "Variable $element does not compile to a constant."));
     }
     pendingVariables.remove(element);
     return expression;
@@ -251,9 +288,8 @@
     constantValueMap[expression] = value;
   }
 
-  ConstantExpression compileNodeWithDefinitions(Node node,
-                                                TreeElements definitions,
-                                                {bool isConst: true}) {
+  ConstantExpression compileNodeWithDefinitions(
+      Node node, TreeElements definitions, {bool isConst: true}) {
     assert(node != null);
     CompileTimeConstantEvaluator evaluator = new CompileTimeConstantEvaluator(
         this, definitions, compiler, isConst: isConst);
@@ -270,13 +306,12 @@
   }
 
   ConstantExpression compileNode(Node node, TreeElements elements,
-                                 {bool enforceConst: true}) {
+      {bool enforceConst: true}) {
     return compileNodeWithDefinitions(node, elements, isConst: enforceConst);
   }
 
-  ConstantExpression compileMetadata(MetadataAnnotation metadata,
-                                     Node node,
-                                     TreeElements elements) {
+  ConstantExpression compileMetadata(
+      MetadataAnnotation metadata, Node node, TreeElements elements) {
     return compileNodeWithDefinitions(node, elements);
   }
 
@@ -301,9 +336,8 @@
     return definitions.getConstant(node);
   }
 
-  ConstantExpression compileNodeWithDefinitions(Node node,
-                                                TreeElements definitions,
-                                                {bool isConst: true}) {
+  ConstantExpression compileNodeWithDefinitions(
+      Node node, TreeElements definitions, {bool isConst: true}) {
     ConstantExpression constant = definitions.getConstant(node);
     if (constant != null && getConstantValue(constant) != null) {
       return constant;
@@ -327,13 +361,14 @@
 
   Element get context => elements.analyzedElement;
 
-  CompileTimeConstantEvaluator(this.handler,
-                               this.elements,
-                               this.compiler,
-                               {bool isConst: false})
+  CompileTimeConstantEvaluator(this.handler, this.elements, this.compiler,
+      {bool isConst: false})
       : this.isEvaluatingConstant = isConst;
 
   ConstantSystem get constantSystem => handler.constantSystem;
+  Resolution get resolution => compiler.resolution;
+
+  DiagnosticReporter get reporter => compiler.reporter;
 
   AstConstant evaluate(Node node) {
     // TODO(johnniwinther): should there be a visitErrorNode?
@@ -355,38 +390,31 @@
   }
 
   AstConstant visitLiteralBool(LiteralBool node) {
-    return new AstConstant(
-        context,
-        node,
+    return new AstConstant(context, node,
         new BoolConstantExpression(node.value),
         constantSystem.createBool(node.value));
   }
 
   AstConstant visitLiteralDouble(LiteralDouble node) {
-    return new AstConstant(
-        context,
-        node,
+    return new AstConstant(context, node,
         new DoubleConstantExpression(node.value),
         constantSystem.createDouble(node.value));
   }
 
   AstConstant visitLiteralInt(LiteralInt node) {
-    return new AstConstant(
-        context,
-        node,
-        new IntConstantExpression(node.value),
+    return new AstConstant(context, node, new IntConstantExpression(node.value),
         constantSystem.createInt(node.value));
   }
 
   AstConstant visitLiteralList(LiteralList node) {
-    if (!node.isConst)  {
+    if (!node.isConst) {
       return signalNotCompileTimeConstant(node);
     }
     List<ConstantExpression> argumentExpressions = <ConstantExpression>[];
     List<ConstantValue> argumentValues = <ConstantValue>[];
     for (Link<Node> link = node.elements.nodes;
-         !link.isEmpty;
-         link = link.tail) {
+        !link.isEmpty;
+        link = link.tail) {
       AstConstant argument = evaluateConstant(link.head);
       if (argument == null) {
         return null;
@@ -395,9 +423,7 @@
       argumentValues.add(argument.value);
     }
     DartType type = elements.getType(node);
-    return new AstConstant(
-        context,
-        node,
+    return new AstConstant(context, node,
         new ListConstantExpression(type, argumentExpressions),
         constantSystem.createList(type, argumentValues));
   }
@@ -411,8 +437,8 @@
     List<ConstantValue> keyValues = <ConstantValue>[];
     Map<ConstantValue, ConstantValue> map = <ConstantValue, ConstantValue>{};
     for (Link<Node> link = node.entries.nodes;
-         !link.isEmpty;
-         link = link.tail) {
+        !link.isEmpty;
+        link = link.tail) {
       LiteralMapEntry entry = link.head;
       AstConstant key = evaluateConstant(entry.key);
       if (key == null) {
@@ -425,36 +451,27 @@
       if (!map.containsKey(key.value)) {
         keyValues.add(key.value);
       } else {
-        compiler.reportWarning(entry.key, MessageKind.EQUAL_MAP_ENTRY_KEY);
+        reporter.reportWarningMessage(
+            entry.key, MessageKind.EQUAL_MAP_ENTRY_KEY);
       }
       keyExpressions.add(key.expression);
       valueExpressions.add(value.expression);
       map[key.value] = value.value;
     }
     InterfaceType type = elements.getType(node);
-    return new AstConstant(
-        context,
-        node,
-        new MapConstantExpression(
-            type,
-            keyExpressions,
-            valueExpressions),
+    return new AstConstant(context, node,
+        new MapConstantExpression(type, keyExpressions, valueExpressions),
         constantSystem.createMap(
             compiler, type, keyValues, map.values.toList()));
   }
 
   AstConstant visitLiteralNull(LiteralNull node) {
-    return new AstConstant(
-        context,
-        node,
-        new NullConstantExpression(),
+    return new AstConstant(context, node, new NullConstantExpression(),
         constantSystem.createNull());
   }
 
   AstConstant visitLiteralString(LiteralString node) {
-    return new AstConstant(
-        context,
-        node,
+    return new AstConstant(context, node,
         new StringConstantExpression(node.dartString.slowToString()),
         constantSystem.createString(node.dartString));
   }
@@ -465,13 +482,10 @@
     if (left == null || right == null) return null;
     StringConstantValue leftValue = left.value;
     StringConstantValue rightValue = right.value;
-    return new AstConstant(
-        context,
-        node,
+    return new AstConstant(context, node,
         new ConcatenateConstantExpression([left.expression, right.expression]),
-        constantSystem.createString(
-            new DartString.concat(
-                leftValue.primitiveValue, rightValue.primitiveValue)));
+        constantSystem.createString(new DartString.concat(
+            leftValue.primitiveValue, rightValue.primitiveValue)));
   }
 
   AstConstant visitStringInterpolation(StringInterpolation node) {
@@ -510,10 +524,9 @@
       StringConstantValue partStringValue = partString.value;
       accumulator =
           new DartString.concat(accumulator, partStringValue.primitiveValue);
-    };
-    return new AstConstant(
-        context,
-        node,
+    }
+    ;
+    return new AstConstant(context, node,
         new ConcatenateConstantExpression(subexpressions),
         constantSystem.createString(accumulator));
   }
@@ -521,12 +534,10 @@
   AstConstant visitLiteralSymbol(LiteralSymbol node) {
     InterfaceType type = compiler.symbolClass.rawType;
     String text = node.slowNameString;
-    List<AstConstant> arguments =
-        <AstConstant>[new AstConstant(
-            context,
-            node,
-            new StringConstantExpression(text),
-            constantSystem.createString(new LiteralDartString(text)))];
+    List<AstConstant> arguments = <AstConstant>[
+      new AstConstant(context, node, new StringConstantExpression(text),
+          constantSystem.createString(new LiteralDartString(text)))
+    ];
     ConstructorElement constructor = compiler.symbolConstructor;
     AstConstant constant = createConstructorInvocation(
         node, type, constructor, CallStructure.ONE_ARG,
@@ -543,8 +554,8 @@
   /// prefix.
   bool isDeferredUse(Send send) {
     if (send == null) return false;
-    return compiler.deferredLoadTask
-        .deferredPrefixElement(send, elements) != null;
+    return compiler.deferredLoadTask.deferredPrefixElement(send, elements) !=
+        null;
   }
 
   AstConstant visitIdentifier(Identifier node) {
@@ -552,8 +563,8 @@
     if (Elements.isClass(element) || Elements.isTypedef(element)) {
       TypeDeclarationElement typeDeclarationElement = element;
       DartType type = typeDeclarationElement.rawType;
-      return new AstConstant(element, node,
-          new TypeConstantExpression(type), makeTypeConstant(type));
+      return new AstConstant(element, node, new TypeConstantExpression(type),
+          makeTypeConstant(type));
     }
     return signalNotCompileTimeConstant(node);
   }
@@ -565,10 +576,8 @@
       AstConstant result;
       if (Elements.isStaticOrTopLevelFunction(element)) {
         FunctionElementX function = element;
-        function.computeType(compiler);
-        result = new AstConstant(
-            context,
-            send,
+        function.computeType(resolution);
+        result = new AstConstant(context, send,
             new FunctionConstantExpression(function),
             new FunctionConstantValue(function));
       } else if (Elements.isStaticOrTopLevelField(element)) {
@@ -579,18 +588,14 @@
           elementExpression = handler.compileVariable(element);
         }
         if (elementExpression != null) {
-          result = new AstConstant(
-              context,
-              send,
+          result = new AstConstant(context, send,
               new VariableConstantExpression(element),
               handler.getConstantValue(elementExpression));
         }
       } else if (Elements.isClass(element) || Elements.isTypedef(element)) {
         assert(elements.isTypeLiteral(send));
         DartType elementType = elements.getTypeLiteralType(send);
-        result = new AstConstant(
-            context,
-            send,
+        result = new AstConstant(context, send,
             new TypeConstantExpression(elementType),
             makeTypeConstant(elementType));
       } else if (send.receiver != null) {
@@ -600,23 +605,18 @@
             StringConstantValue stringConstantValue = left.value;
             DartString string = stringConstantValue.primitiveValue;
             IntConstantValue length = constantSystem.createInt(string.length);
-            result = new AstConstant(
-                context,
-                send,
-                new StringLengthConstantExpression(left.expression),
-                length);
+            result = new AstConstant(context, send,
+                new StringLengthConstantExpression(left.expression), length);
           }
         }
         // Fall through to error handling.
-      } else if (!Elements.isUnresolved(element)
-                 && element.isVariable
-                 && element.isConst) {
+      } else if (!Elements.isUnresolved(element) &&
+          element.isVariable &&
+          element.isConst) {
         ConstantExpression variableExpression =
             handler.compileConstant(element);
         if (variableExpression != null) {
-          result = new AstConstant(
-              context,
-              send,
+          result = new AstConstant(context, send,
               new VariableConstantExpression(element),
               handler.getConstantValue(variableExpression));
         }
@@ -626,24 +626,20 @@
       }
       if (isDeferredUse(send)) {
         if (isEvaluatingConstant) {
-          error(send, MessageKind.DEFERRED_COMPILE_TIME_CONSTANT);
+          reporter.reportErrorMessage(
+              send, MessageKind.DEFERRED_COMPILE_TIME_CONSTANT);
         }
-        PrefixElement prefix = compiler.deferredLoadTask
-            .deferredPrefixElement(send, elements);
-        result = new AstConstant(
-            context,
-            send,
-            new DeferredConstantExpression(
-                result.expression,
-                prefix),
+        PrefixElement prefix =
+            compiler.deferredLoadTask.deferredPrefixElement(send, elements);
+        result = new AstConstant(context, send,
+            new DeferredConstantExpression(result.expression, prefix),
             new DeferredConstantValue(result.value, prefix));
-        compiler.deferredLoadTask
-            .registerConstantDeferredUse(result.value, prefix);
+        compiler.deferredLoadTask.registerConstantDeferredUse(
+            result.value, prefix);
       }
       return result;
     } else if (send.isCall) {
-      if (element == compiler.identicalFunction
-          && send.argumentCount() == 2) {
+      if (element == compiler.identicalFunction && send.argumentCount() == 2) {
         AstConstant left = evaluate(send.argumentsNode.nodes.head);
         AstConstant right = evaluate(send.argumentsNode.nodes.tail.head);
         if (left == null || right == null) {
@@ -652,12 +648,8 @@
         ConstantValue result =
             constantSystem.identity.fold(left.value, right.value);
         if (result != null) {
-          return new AstConstant(
-              context,
-              send,
-              new IdenticalConstantExpression(
-                  left.expression, right.expression),
-              result);
+          return new AstConstant(context, send, new IdenticalConstantExpression(
+              left.expression, right.expression), result);
         }
       }
       return signalNotCompileTimeConstant(send);
@@ -671,17 +663,14 @@
       UnaryOperator operator = UnaryOperator.parse(node.source);
       UnaryOperation operation = constantSystem.lookupUnary(operator);
       if (operation == null) {
-        compiler.internalError(send.selector, "Unexpected operator.");
+        reporter.internalError(send.selector, "Unexpected operator.");
       }
       ConstantValue folded = operation.fold(receiverConstant.value);
       if (folded == null) {
         return signalNotCompileTimeConstant(send);
       }
-      return new AstConstant(
-          context,
-          send,
-          new UnaryConstantExpression(
-              operator, receiverConstant.expression),
+      return new AstConstant(context, send,
+          new UnaryConstantExpression(operator, receiverConstant.expression),
           folded);
     } else if (send.isOperator && !send.isPostfix) {
       assert(send.argumentCount() == 1);
@@ -724,12 +713,8 @@
       if (folded == null) {
         return signalNotCompileTimeConstant(send);
       }
-      return new AstConstant(
-          context,
-          send,
-          new BinaryConstantExpression(
-              left.expression, operator, right.expression),
-          folded);
+      return new AstConstant(context, send, new BinaryConstantExpression(
+          left.expression, operator, right.expression), folded);
     }
     return signalNotCompileTimeConstant(send);
   }
@@ -741,9 +726,11 @@
     } else if (!condition.value.isBool) {
       DartType conditionType = condition.value.getType(compiler.coreTypes);
       if (isEvaluatingConstant) {
-        compiler.reportError(
-            node.condition, MessageKind.NOT_ASSIGNABLE,
-            {'fromType': conditionType, 'toType': compiler.boolClass.rawType});
+        reporter.reportErrorMessage(
+            node.condition,
+            MessageKind.NOT_ASSIGNABLE,
+            {'fromType': conditionType,
+             'toType': compiler.boolClass.rawType});
         return new ErroneousAstConstant(context, node);
       }
       return null;
@@ -754,16 +741,11 @@
       return null;
     }
     BoolConstantValue boolCondition = condition.value;
-    return new AstConstant(
-        context,
-        node,
-        new ConditionalConstantExpression(
-            condition.expression,
-            thenExpression.expression,
-            elseExpression.expression),
-        boolCondition.primitiveValue
-            ? thenExpression.value
-            : elseExpression.value);
+    return new AstConstant(context, node, new ConditionalConstantExpression(
+        condition.expression, thenExpression.expression,
+        elseExpression.expression), boolCondition.primitiveValue
+        ? thenExpression.value
+        : elseExpression.value);
   }
 
   AstConstant visitSendSet(SendSet node) {
@@ -777,12 +759,9 @@
    *
    * Invariant: [target] must be an implementation element.
    */
-  List<AstConstant> evaluateArgumentsToConstructor(
-      Node node,
-      CallStructure callStructure,
-      Link<Node> arguments,
-      ConstructorElement target,
-      {AstConstant compileArgument(Node node)}) {
+  List<AstConstant> evaluateArgumentsToConstructor(Node node,
+      CallStructure callStructure, Link<Node> arguments,
+      ConstructorElement target, {AstConstant compileArgument(Node node)}) {
     assert(invariant(node, target.isImplementation));
 
     AstConstant compileDefaultValue(VariableElement element) {
@@ -790,15 +769,14 @@
       return new AstConstant.fromDefaultValue(
           element, constant, handler.getConstantValue(constant));
     }
-    target.computeType(compiler);
+    target.computeType(resolution);
 
     FunctionSignature signature = target.functionSignature;
     if (!callStructure.signatureApplies(signature)) {
       String name = Elements.constructorNameForDiagnostics(
           target.enclosingClass.name, target.name);
-      compiler.reportError(
-          node,
-          MessageKind.INVALID_CONSTRUCTOR_ARGUMENTS,
+      reporter.reportErrorMessage(
+          node, MessageKind.INVALID_CONSTRUCTOR_ARGUMENTS,
           {'constructorName': name});
 
       return new List<AstConstant>.filled(
@@ -806,10 +784,7 @@
           new ErroneousAstConstant(context, node));
     }
     return callStructure.makeArgumentsList(
-        arguments,
-        target,
-        compileArgument,
-        compileDefaultValue);
+        arguments, target, compileArgument, compileDefaultValue);
   }
 
   AstConstant visitNewExpression(NewExpression node) {
@@ -833,18 +808,13 @@
     InterfaceType type = elements.getType(node);
     CallStructure callStructure = elements.getSelector(send).callStructure;
 
-    return createConstructorInvocation(
-        node, type, constructor, callStructure,
+    return createConstructorInvocation(node, type, constructor, callStructure,
         arguments: node.send.arguments);
   }
 
-  AstConstant createConstructorInvocation(
-      Node node,
-      InterfaceType type,
-      ConstructorElement constructor,
-      CallStructure callStructure,
-      {Link<Node> arguments,
-       List<AstConstant> normalizedArguments}) {
+  AstConstant createConstructorInvocation(Node node, InterfaceType type,
+      ConstructorElement constructor, CallStructure callStructure,
+      {Link<Node> arguments, List<AstConstant> normalizedArguments}) {
     // TODO(ahe): This is nasty: we must eagerly analyze the
     // constructor to ensure the redirectionTarget has been computed
     // correctly.  Find a way to avoid this.
@@ -862,22 +832,15 @@
 
     if (implementation.isErroneous) {
       // TODO(johnniwinther): This should probably be an [ErroneousAstConstant].
-      return new AstConstant(
-          context,
-          node,
-          new ConstructedConstantExpression(
-              type,
-              constructor,
-              callStructure,
-              const <ConstantExpression>[]),
+      return new AstConstant(context, node, new ConstructedConstantExpression(
+              type, constructor, callStructure, const <ConstantExpression>[]),
           new ConstructedConstantValue(
               constructedType, const <FieldElement, ConstantValue>{}));
     }
 
     List<AstConstant> concreteArguments;
     if (arguments != null) {
-      Map<Node, AstConstant> concreteArgumentMap =
-          <Node, AstConstant>{};
+      Map<Node, AstConstant> concreteArgumentMap = <Node, AstConstant>{};
       for (Link<Node> link = arguments; !link.isEmpty; link = link.tail) {
         Node argument = link.head;
         NamedArgument namedArgument = argument.asNamedArgument();
@@ -896,80 +859,78 @@
       concreteArguments = normalizedArguments;
     }
 
-    if (target == compiler.intEnvironment ||
-        target == compiler.boolEnvironment ||
-        target == compiler.stringEnvironment) {
-      return createFromEnvironmentConstant(
-          node, constructedType, target,
+    if (constructor == compiler.intEnvironment ||
+        constructor == compiler.boolEnvironment ||
+        constructor == compiler.stringEnvironment) {
+      return createFromEnvironmentConstant(node, constructedType, constructor,
           callStructure, normalizedArguments, concreteArguments);
     } else {
-      return makeConstructedConstant(
-          compiler, handler, context, node,
-          type, constructor,
-          constructedType, implementation,
-          callStructure, concreteArguments, normalizedArguments);
+      return makeConstructedConstant(compiler, handler, context, node, type,
+          constructor, constructedType, implementation, callStructure,
+          concreteArguments, normalizedArguments);
     }
   }
 
-  AstConstant createFromEnvironmentConstant(
-      Node node,
-      InterfaceType type,
-      ConstructorElement constructor,
-      CallStructure callStructure,
+  AstConstant createFromEnvironmentConstant(Node node, InterfaceType type,
+      ConstructorElement constructor, CallStructure callStructure,
       List<AstConstant> normalizedArguments,
       List<AstConstant> concreteArguments) {
-
     var firstArgument = normalizedArguments[0].value;
     ConstantValue defaultValue = normalizedArguments[1].value;
 
     if (firstArgument.isNull) {
-      compiler.reportError(
+      reporter.reportErrorMessage(
           normalizedArguments[0].node, MessageKind.NULL_NOT_ALLOWED);
       return null;
     }
 
     if (!firstArgument.isString) {
       DartType type = defaultValue.getType(compiler.coreTypes);
-      compiler.reportError(
-          normalizedArguments[0].node, MessageKind.NOT_ASSIGNABLE,
-          {'fromType': type, 'toType': compiler.stringClass.rawType});
+      reporter.reportErrorMessage(
+          normalizedArguments[0].node,
+          MessageKind.NOT_ASSIGNABLE,
+          {'fromType': type,
+           'toType': compiler.stringClass.rawType});
       return null;
     }
 
     if (constructor == compiler.intEnvironment &&
         !(defaultValue.isNull || defaultValue.isInt)) {
       DartType type = defaultValue.getType(compiler.coreTypes);
-      compiler.reportError(
-          normalizedArguments[1].node, MessageKind.NOT_ASSIGNABLE,
-          {'fromType': type, 'toType': compiler.intClass.rawType});
+      reporter.reportErrorMessage(
+          normalizedArguments[1].node,
+          MessageKind.NOT_ASSIGNABLE,
+          {'fromType': type,
+           'toType': compiler.intClass.rawType});
       return null;
     }
 
     if (constructor == compiler.boolEnvironment &&
         !(defaultValue.isNull || defaultValue.isBool)) {
       DartType type = defaultValue.getType(compiler.coreTypes);
-      compiler.reportError(
-          normalizedArguments[1].node, MessageKind.NOT_ASSIGNABLE,
-          {'fromType': type, 'toType': compiler.boolClass.rawType});
+      reporter.reportErrorMessage(
+          normalizedArguments[1].node,
+          MessageKind.NOT_ASSIGNABLE,
+          {'fromType': type,
+           'toType': compiler.boolClass.rawType});
       return null;
     }
 
     if (constructor == compiler.stringEnvironment &&
         !(defaultValue.isNull || defaultValue.isString)) {
       DartType type = defaultValue.getType(compiler.coreTypes);
-      compiler.reportError(
-          normalizedArguments[1].node, MessageKind.NOT_ASSIGNABLE,
-          {'fromType': type, 'toType': compiler.stringClass.rawType});
+      reporter.reportErrorMessage(
+          normalizedArguments[1].node,
+          MessageKind.NOT_ASSIGNABLE,
+          {'fromType': type,
+           'toType': compiler.stringClass.rawType});
       return null;
     }
 
-    String name =
-        firstArgument.primitiveValue.slowToString();
-    String value =
-        compiler.fromEnvironment(name);
+    String name = firstArgument.primitiveValue.slowToString();
+    String value = compiler.fromEnvironment(name);
 
     AstConstant createEvaluatedConstant(ConstantValue value) {
-
       ConstantExpression expression;
       ConstantExpression name = concreteArguments[0].expression;
       ConstantExpression defaultValue;
@@ -977,15 +938,16 @@
         defaultValue = concreteArguments[1].expression;
       }
       if (constructor == compiler.intEnvironment) {
-        expression = new IntFromEnvironmentConstantExpression(
-            name, defaultValue);
+        expression =
+            new IntFromEnvironmentConstantExpression(name, defaultValue);
       } else if (constructor == compiler.boolEnvironment) {
-        expression = new BoolFromEnvironmentConstantExpression(
-            name, defaultValue);
+        expression =
+            new BoolFromEnvironmentConstantExpression(name, defaultValue);
       } else if (constructor == compiler.stringEnvironment) {
-        expression = new StringFromEnvironmentConstantExpression(
-            name, defaultValue);
+        expression =
+            new StringFromEnvironmentConstantExpression(name, defaultValue);
       }
+      assert(expression != null);
       return new AstConstant(context, node, expression, value);
     }
 
@@ -994,9 +956,7 @@
     } else if (constructor == compiler.intEnvironment) {
       int number = int.parse(value, onError: (_) => null);
       return createEvaluatedConstant(
-          (number == null)
-              ? defaultValue
-              : constantSystem.createInt(number));
+          (number == null) ? defaultValue : constantSystem.createInt(number));
     } else if (constructor == compiler.boolEnvironment) {
       if (value == 'true') {
         return createEvaluatedConstant(constantSystem.createBool(true));
@@ -1012,34 +972,27 @@
     }
   }
 
-  static AstConstant makeConstructedConstant(
-      Compiler compiler,
-      ConstantCompilerBase handler,
-      Element context,
-      Node node,
-      InterfaceType type,
-      ConstructorElement constructor,
-      InterfaceType constructedType,
-      ConstructorElement target,
-      CallStructure callStructure,
-      List<AstConstant> concreteArguments,
+  static AstConstant makeConstructedConstant(Compiler compiler,
+      ConstantCompilerBase handler, Element context, Node node,
+      InterfaceType type, ConstructorElement constructor,
+      InterfaceType constructedType, ConstructorElement target,
+      CallStructure callStructure, List<AstConstant> concreteArguments,
       List<AstConstant> normalizedArguments) {
     if (target.isRedirectingFactory) {
       // This happens is case of cyclic redirection.
       assert(invariant(node, compiler.compilationFailed,
           message: "makeConstructedConstant can only be called with the "
-                   "effective target: $constructor"));
+          "effective target: $constructor"));
       return new ErroneousAstConstant(context, node);
     }
-    assert(invariant(
-        node,
+    assert(invariant(node,
         callStructure.signatureApplies(constructor.functionSignature) ||
             compiler.compilationFailed,
         message: "Call structure $callStructure does not apply to constructor "
-                 "$constructor."));
+        "$constructor."));
 
-    ConstructorEvaluator evaluator = new ConstructorEvaluator(
-        constructedType, target, handler, compiler);
+    ConstructorEvaluator evaluator =
+        new ConstructorEvaluator(constructedType, target, handler, compiler);
     evaluator.evaluateConstructorFieldValues(normalizedArguments);
     Map<FieldElement, AstConstant> fieldConstants =
         evaluator.buildFieldConstants(target.enclosingClass);
@@ -1048,13 +1001,8 @@
     fieldConstants.forEach((FieldElement field, AstConstant astConstant) {
       fieldValues[field] = astConstant.value;
     });
-    return new AstConstant(
-        context,
-        node,
-        new ConstructedConstantExpression(
-            type,
-            constructor,
-            callStructure,
+    return new AstConstant(context, node, new ConstructedConstantExpression(
+            type, constructor, callStructure,
             concreteArguments.map((e) => e.expression).toList()),
         new ConstructedConstantValue(constructedType, fieldValues));
   }
@@ -1063,21 +1011,12 @@
     return node.expression.accept(this);
   }
 
-  error(Node node, MessageKind message) {
-    // TODO(floitsch): get the list of constants that are currently compiled
-    // and present some kind of stack-trace.
-    compiler.reportError(node, message);
-  }
-
   AstConstant signalNotCompileTimeConstant(Node node,
       {MessageKind message: MessageKind.NOT_A_COMPILE_TIME_CONSTANT}) {
     if (isEvaluatingConstant) {
-      error(node, message);
+      reporter.reportErrorMessage(node, message);
 
-      return new AstConstant(
-          context,
-          node,
-          new ErroneousConstantExpression(),
+      return new AstConstant(context, node, new ErroneousConstantExpression(),
           new NullConstantValue());
     }
     // Else we don't need to do anything. The final handler is only
@@ -1101,16 +1040,12 @@
    * Invariant: [constructor] must be an implementation element.
    */
   ConstructorEvaluator(InterfaceType this.constructedType,
-                       FunctionElement constructor,
-                       ConstantCompiler handler,
-                       Compiler compiler)
+      FunctionElement constructor, ConstantCompiler handler, Compiler compiler)
       : this.constructor = constructor,
         this.definitions = new Map<Element, AstConstant>(),
         this.fieldValues = new Map<Element, AstConstant>(),
-        super(handler,
-              _analyzeElementEagerly(compiler, constructor),
-              compiler,
-              isConst: true) {
+        super(handler, _analyzeElementEagerly(compiler, constructor), compiler,
+            isConst: true) {
     assert(invariant(constructor, constructor.isImplementation));
   }
 
@@ -1119,34 +1054,32 @@
     if (Elements.isLocal(element)) {
       AstConstant constant = definitions[element];
       if (constant == null) {
-        compiler.internalError(send, "Local variable without value.");
+        reporter.internalError(send, "Local variable without value.");
       }
       return constant;
     }
     return super.visitSend(send);
   }
 
-  void potentiallyCheckType(Node node,
-                            TypedElement element,
-                            AstConstant constant) {
+  void potentiallyCheckType(TypedElement element, AstConstant constant) {
     if (compiler.enableTypeAssertions) {
       DartType elementType = element.type.substByContext(constructedType);
       DartType constantType = constant.value.getType(compiler.coreTypes);
-      if (!constantSystem.isSubtype(compiler.types,
-                                    constantType, elementType)) {
-        compiler.withCurrentElement(constant.element, () {
-          compiler.reportError(
-              constant.node, MessageKind.NOT_ASSIGNABLE,
-              {'fromType': constantType, 'toType': elementType});
+      if (!constantSystem.isSubtype(
+          compiler.types, constantType, elementType)) {
+        reporter.withCurrentElement(constant.element, () {
+          reporter.reportErrorMessage(
+              constant.node,
+              MessageKind.NOT_ASSIGNABLE,
+              {'fromType': constantType,
+               'toType': elementType});
         });
       }
     }
   }
 
-  void updateFieldValue(Node node,
-                        TypedElement element,
-                        AstConstant constant) {
-    potentiallyCheckType(node, element, constant);
+  void updateFieldValue(Node node, TypedElement element, AstConstant constant) {
+    potentiallyCheckType(element, constant);
     fieldValues[element] = constant;
   }
 
@@ -1167,14 +1100,14 @@
         InitializingFormalElement initializingFormal = parameter;
         updateFieldValue(node, initializingFormal.fieldElement, argument);
       } else {
-        potentiallyCheckType(node, parameter, argument);
+        potentiallyCheckType(parameter, argument);
         definitions[parameter] = argument;
       }
     });
   }
 
-  void evaluateSuperOrRedirectSend(List<AstConstant> compiledArguments,
-                                   FunctionElement targetConstructor) {
+  void evaluateSuperOrRedirectSend(
+      List<AstConstant> compiledArguments, FunctionElement targetConstructor) {
     ConstructorEvaluator evaluator = new ConstructorEvaluator(
         constructedType.asInstanceOf(targetConstructor.enclosingClass),
         targetConstructor, handler, compiler);
@@ -1196,12 +1129,8 @@
       Function compileArgument = (element) => definitions[element];
       Function compileConstant = handler.compileConstant;
       FunctionElement target = constructor.definingConstructor.implementation;
-      CallStructure.addForwardingElementArgumentsToList(
-          constructor,
-          compiledArguments,
-          target,
-          compileArgument,
-          compileConstant);
+      CallStructure.addForwardingElementArgumentsToList(constructor,
+          compiledArguments, target, compileArgument, compileConstant);
       evaluateSuperOrRedirectSend(compiledArguments, target);
       return;
     }
@@ -1212,18 +1141,16 @@
 
     if (initializerList != null) {
       for (Link<Node> link = initializerList.nodes;
-           !link.isEmpty;
-           link = link.tail) {
+          !link.isEmpty;
+          link = link.tail) {
         assert(link.head is Send);
-        if (link.head is !SendSet) {
+        if (link.head is! SendSet) {
           // A super initializer or constructor redirection.
           Send call = link.head;
           FunctionElement target = elements[call];
-          List<AstConstant> compiledArguments =
-              evaluateArgumentsToConstructor(
-                  call, elements.getSelector(call).callStructure,
-                  call.arguments, target,
-                  compileArgument: evaluateConstant);
+          List<AstConstant> compiledArguments = evaluateArgumentsToConstructor(
+              call, elements.getSelector(call).callStructure, call.arguments,
+              target, compileArgument: evaluateConstant);
           evaluateSuperOrRedirectSend(compiledArguments, target);
           foundSuperOrRedirect = true;
         } else {
@@ -1252,8 +1179,8 @@
         // already and compilation will fail anyway. So just ignore that case.
         if (targetConstructor != null) {
           List<AstConstant> compiledArguments = evaluateArgumentsToConstructor(
-              functionNode, CallStructure.NO_ARGS,
-              const Link<Node>(), targetConstructor);
+              functionNode, CallStructure.NO_ARGS, const Link<Node>(),
+              targetConstructor);
           evaluateSuperOrRedirectSend(compiledArguments, targetConstructor);
         }
       }
@@ -1267,7 +1194,7 @@
    */
   void evaluateConstructorFieldValues(List<AstConstant> arguments) {
     if (constructor.isErroneous) return;
-    compiler.withCurrentElement(constructor, () {
+    reporter.withCurrentElement(constructor, () {
       assignArgumentsToParameters(arguments);
       evaluateConstructorInitializers();
     });
@@ -1277,22 +1204,24 @@
   /// inheritance chain of [classElement].
   Map<FieldElement, AstConstant> buildFieldConstants(
       ClassElement classElement) {
-    Map<FieldElement, AstConstant> fieldConstants =
-        <FieldElement, AstConstant>{};
-    classElement.implementation.forEachInstanceField(
-        (ClassElement enclosing, FieldElement field) {
-          AstConstant fieldValue = fieldValues[field];
-          if (fieldValue == null) {
-            // Use the default value.
-            ConstantExpression fieldExpression = handler.compileConstant(field);
-            fieldValue = new AstConstant.fromDefaultValue(
-                field,
-                fieldExpression,
-                handler.getConstantValue(fieldExpression));
-          }
-          fieldConstants[field] = fieldValue;
-        },
-        includeSuperAndInjectedMembers: true);
+    Map<FieldElement, AstConstant> fieldConstants = <FieldElement, AstConstant>{
+    };
+    classElement.implementation
+        .forEachInstanceField((ClassElement enclosing, FieldElement field) {
+      AstConstant fieldValue = fieldValues[field];
+      if (fieldValue == null) {
+        // Use the default value.
+        ConstantExpression fieldExpression =
+            handler.internalCompileVariable(field, true, false);
+        fieldValue = new AstConstant.fromDefaultValue(
+            field, fieldExpression, handler.getConstantValue(fieldExpression));
+        // TODO(het): If the field value doesn't typecheck due to the type
+        // variable in the constructor invocation, then report the error on the
+        // invocation rather than the field.
+        potentiallyCheckType(field, fieldValue);
+      }
+      fieldConstants[field] = fieldValue;
+    }, includeSuperAndInjectedMembers: true);
     return fieldConstants;
   }
 }
@@ -1314,15 +1243,11 @@
 
   AstConstant(this.element, this.node, this.expression, this.value);
 
-  factory AstConstant.fromDefaultValue(
-      VariableElement element,
-      ConstantExpression constant,
-      ConstantValue value) {
-    return new AstConstant(
-        element,
-        element.initializer != null ? element.initializer : element.node,
-        constant,
-        value);
+  factory AstConstant.fromDefaultValue(VariableElement element,
+      ConstantExpression constant, ConstantValue value) {
+    return new AstConstant(element, element.initializer != null
+        ? element.initializer
+        : element.node, constant, value);
   }
 
   String toString() => expression.toString();
@@ -1330,15 +1255,24 @@
 
 /// A synthetic constant used to recover from errors.
 class ErroneousAstConstant extends AstConstant {
-  ErroneousAstConstant(Element element, Node node)
-      : super(element, node,
+  ErroneousAstConstant(Element element, Node node) : super(element, node,
           // TODO(johnniwinther): Return a [NonConstantValue] instead.
           new ErroneousConstantExpression(), new NullConstantValue());
 }
 
-// TODO(johnniwinther): Avoid the need for this hack.
+// TODO(johnniwinther): Clean this up.
 TreeElements _analyzeElementEagerly(Compiler compiler, AstElement element) {
-  WorldImpact worldImpact = compiler.analyzeElement(element.declaration);
-  compiler.enqueuer.resolution.applyImpact(element.declaration, worldImpact);
+  compiler.resolution.computeWorldImpact(element.declaration);
   return element.resolvedAst.elements;
 }
+
+class _CompilerEnvironment implements Environment {
+  final Compiler compiler;
+
+  _CompilerEnvironment(this.compiler);
+
+  @override
+  String readFromEnvironment(String name) {
+    return compiler.fromEnvironment(name);
+  }
+}
diff --git a/pkg/compiler/lib/src/compiler.dart b/pkg/compiler/lib/src/compiler.dart
index f635379..8fab748 100644
--- a/pkg/compiler/lib/src/compiler.dart
+++ b/pkg/compiler/lib/src/compiler.dart
@@ -2,680 +2,147 @@
 // for 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 dart2js;
+library dart2js.compiler_base;
 
-/**
- * If true, print a warning for each method that was resolved, but not
- * compiled.
- */
-const bool REPORT_EXCESS_RESOLUTION = false;
+import 'dart:async' show
+    EventSink,
+    Future;
 
-/**
- * Contains backend-specific data that is used throughout the compilation of
- * one work item.
- */
-class ItemCompilationContext {
-}
+import '../compiler_new.dart' as api;
+import 'cache_strategy.dart' show
+    CacheStrategy;
+import 'closure.dart' as closureMapping show
+    ClosureTask;
+import 'common.dart';
+import 'common/backend_api.dart' show
+    Backend;
+import 'common/codegen.dart' show
+    CodegenRegistry,
+    CodegenWorkItem;
+import 'common/names.dart' show
+    Identifiers,
+    Uris;
+import 'common/registry.dart' show
+    Registry;
+import 'common/resolution.dart' show
+    Parsing,
+    Resolution,
+    ResolutionWorkItem,
+    ResolutionImpact;
+import 'common/tasks.dart' show
+    CompilerTask,
+    GenericTask;
+import 'common/work.dart' show
+    WorkItem;
+import 'compile_time_constants.dart';
+import 'constants/values.dart';
+import 'core_types.dart' show
+    CoreTypes;
+import 'dart_backend/dart_backend.dart' as dart_backend;
+import 'dart_types.dart' show
+    DartType,
+    DynamicType,
+    InterfaceType,
+    Types;
+import 'deferred_load.dart' show DeferredLoadTask, OutputUnit;
+import 'diagnostics/code_location.dart';
+import 'diagnostics/diagnostic_listener.dart' show
+    DiagnosticOptions;
+import 'diagnostics/invariant.dart' show
+    REPORT_EXCESS_RESOLUTION;
+import 'diagnostics/messages.dart' show
+    Message,
+    MessageTemplate;
+import 'dump_info.dart' show
+    DumpInfoTask;
+import 'elements/elements.dart';
+import 'elements/modelx.dart' show
+    ErroneousElementX,
+    ClassElementX,
+    CompilationUnitElementX,
+    DeferredLoaderGetterElementX,
+    MethodElementX,
+    LibraryElementX,
+    PrefixElementX;
+import 'enqueue.dart' show
+    CodegenEnqueuer,
+    Enqueuer,
+    EnqueueTask,
+    ResolutionEnqueuer,
+    QueueFilter,
+    WorldImpact;
+import 'io/source_information.dart' show
+    SourceInformation;
+import 'js_backend/js_backend.dart' as js_backend show
+    JavaScriptBackend;
+import 'library_loader.dart' show
+    LibraryLoader,
+    LibraryLoaderTask,
+    LoadedLibraries;
+import 'mirrors_used.dart' show
+    MirrorUsageAnalyzerTask;
+import 'null_compiler_output.dart' show
+    NullCompilerOutput,
+    NullSink;
+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 'scanner/scanner_task.dart' show
+    ScannerTask;
+import 'serialization/task.dart' show
+    SerializationTask;
+import 'script.dart' show
+    Script;
+import 'ssa/ssa.dart' show
+    HInstruction;
+import 'tracer.dart' show
+    Tracer;
+import 'tokens/token.dart' show
+    StringToken,
+    Token,
+    TokenPair;
+import 'tokens/token_constants.dart' as Tokens show
+    COMMENT_TOKEN,
+    EOF_TOKEN;
+import 'tokens/token_map.dart' show
+    TokenMap;
+import 'tree/tree.dart' show
+    Node,
+    TypeAnnotation;
+import 'typechecker.dart' show
+    TypeCheckerTask;
+import 'types/types.dart' as ti;
+import 'universe/call_structure.dart' show
+    CallStructure;
+import 'universe/selector.dart' show
+    Selector;
+import 'universe/universe.dart' show
+    Universe;
+import 'util/util.dart' show
+    Link,
+    Setlet;
+import 'world.dart' show
+    World;
 
-abstract class WorkItem {
-  final ItemCompilationContext compilationContext;
-  /**
-   * Documentation wanted -- johnniwinther
-   *
-   * Invariant: [element] must be a declaration element.
-   */
-  final AstElement element;
-
-  WorkItem(this.element, this.compilationContext) {
-    assert(invariant(element, element.isDeclaration));
-  }
-
-  WorldImpact run(Compiler compiler, Enqueuer world);
-}
-
-/// [WorkItem] used exclusively by the [ResolutionEnqueuer].
-class ResolutionWorkItem extends WorkItem {
-  bool _isAnalyzed = false;
-
-  ResolutionWorkItem(AstElement element,
-                     ItemCompilationContext compilationContext)
-      : super(element, compilationContext);
-
-  WorldImpact run(Compiler compiler, ResolutionEnqueuer world) {
-    WorldImpact impact = compiler.analyze(this, world);
-    _isAnalyzed = true;
-    return impact;
-  }
-
-  bool get isAnalyzed => _isAnalyzed;
-}
-
-// 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;
-  final TreeElements treeElements;
-
-  CodegenRegistry(this.compiler, this.treeElements);
-
-  bool get isForResolution => false;
-
-  Element get currentElement => treeElements.analyzedElement;
-
-  // TODO(johnniwinther): Remove this getter when [Registry] creates a
-  // dependency node.
-  Setlet<Element> get otherDependencies => treeElements.otherDependencies;
-
-  CodegenEnqueuer get world => compiler.enqueuer.codegen;
-  js_backend.JavaScriptBackend get backend => compiler.backend;
-
-  void registerDependency(Element element) {
-    treeElements.registerDependency(element);
-  }
-
-  void registerInlining(Element inlinedElement, Element context) {
-    if (compiler.dumpInfo) {
-      compiler.dumpInfoTask.registerInlined(inlinedElement, context);
-    }
-  }
-
-  void registerInstantiatedClass(ClassElement element) {
-    world.registerInstantiatedType(element.rawType, this);
-  }
-
-  void registerInstantiatedType(InterfaceType type) {
-    world.registerInstantiatedType(type, this);
-  }
-
-  void registerStaticUse(Element element) {
-    world.registerStaticUse(element);
-  }
-
-  void registerDynamicInvocation(UniverseSelector selector) {
-    world.registerDynamicInvocation(selector);
-    compiler.dumpInfoTask.elementUsesSelector(currentElement, selector);
-  }
-
-  void registerDynamicSetter(UniverseSelector selector) {
-    world.registerDynamicSetter(selector);
-    compiler.dumpInfoTask.elementUsesSelector(currentElement, selector);
-  }
-
-  void registerDynamicGetter(UniverseSelector selector) {
-    world.registerDynamicGetter(selector);
-    compiler.dumpInfoTask.elementUsesSelector(currentElement, selector);
-  }
-
-  void registerGetterForSuperMethod(Element element) {
-    world.registerGetterForSuperMethod(element);
-  }
-
-  void registerFieldGetter(Element element) {
-    world.registerFieldGetter(element);
-  }
-
-  void registerFieldSetter(Element element) {
-    world.registerFieldSetter(element);
-  }
-
-  void registerIsCheck(DartType type) {
-    world.registerIsCheck(type);
-    backend.registerIsCheckForCodegen(type, world, this);
-  }
-
-  void registerCompileTimeConstant(ConstantValue constant) {
-    backend.registerCompileTimeConstant(constant, this);
-    backend.constants.addCompileTimeConstantForEmission(constant);
-  }
-
-  void registerTypeVariableBoundsSubtypeCheck(DartType subtype,
-                                              DartType supertype) {
-    backend.registerTypeVariableBoundsSubtypeCheck(subtype, supertype);
-  }
-
-  void registerInstantiatedClosure(LocalFunctionElement element) {
-    backend.registerInstantiatedClosure(element, this);
-  }
-
-  void registerGetOfStaticFunction(FunctionElement element) {
-    world.registerGetOfStaticFunction(element);
-  }
-
-  void registerSelectorUse(Selector selector) {
-    world.registerSelectorUse(new UniverseSelector(selector, null));
-  }
-
-  void registerConstSymbol(String name) {
-    backend.registerConstSymbol(name, this);
-  }
-
-  void registerSpecializedGetInterceptor(Set<ClassElement> classes) {
-    backend.registerSpecializedGetInterceptor(classes);
-  }
-
-  void registerUseInterceptor() {
-    backend.registerUseInterceptor(world);
-  }
-
-  void registerTypeConstant(ClassElement element) {
-    backend.customElementsAnalysis.registerTypeConstant(element, world);
-  }
-
-  void registerStaticInvocation(Element element) {
-    world.registerStaticUse(element);
-  }
-
-  void registerSuperInvocation(Element element) {
-    world.registerStaticUse(element);
-  }
-
-  void registerDirectInvocation(Element element) {
-    world.registerStaticUse(element);
-  }
-
-  void registerInstantiation(InterfaceType type) {
-    world.registerInstantiatedType(type, this);
-  }
-
-  void registerAsyncMarker(FunctionElement element) {
-    backend.registerAsyncMarker(element, world, this);
-  }
-
-}
-
-/// [WorkItem] used exclusively by the [CodegenEnqueuer].
-class CodegenWorkItem extends WorkItem {
-  CodegenRegistry registry;
-
-  factory CodegenWorkItem(
-      Compiler compiler,
-      AstElement element,
-      ItemCompilationContext compilationContext) {
-    // 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
-    // don't need.
-    assert(invariant(element,
-        compiler.enqueuer.resolution.hasBeenResolved(element),
-        message: "$element has not been resolved."));
-    assert(invariant(element, element.resolvedAst.elements != null,
-        message: 'Resolution tree is null for $element in codegen work item'));
-    return new CodegenWorkItem.internal(element, compilationContext);
-  }
-
-  CodegenWorkItem.internal(
-      AstElement element,
-      ItemCompilationContext compilationContext)
-      : super(element, compilationContext);
-
-  TreeElements get resolutionTree => element.resolvedAst.elements;
-
-  WorldImpact run(Compiler compiler, CodegenEnqueuer world) {
-    if (world.isProcessed(element)) return const WorldImpact();
-
-    registry = new CodegenRegistry(compiler, resolutionTree);
-    return compiler.codegen(this, world);
-  }
-}
-
-typedef void DeferredAction();
-
-class DeferredTask {
-  final Element element;
-  final DeferredAction action;
-
-  DeferredTask(this.element, this.action);
-}
-
-/// Interface for registration of element dependencies.
-abstract class Registry {
-  // TODO(johnniwinther): Remove this getter when [Registry] creates a
-  // dependency node.
-  Iterable<Element> get otherDependencies;
-
-  void registerDependency(Element element);
-
-  bool get isForResolution;
-
-  void registerDynamicInvocation(UniverseSelector selector);
-
-  void registerDynamicGetter(UniverseSelector selector);
-
-  void registerDynamicSetter(UniverseSelector selector);
-
-  void registerStaticInvocation(Element element);
-
-  void registerInstantiation(InterfaceType type);
-
-  void registerGetOfStaticFunction(FunctionElement element);
-}
-
-abstract class Backend {
-  final Compiler compiler;
-
-  Backend(this.compiler);
-
-  /// Returns true if the backend supports reflection.
-  bool get supportsReflection;
-
-  /// The [ConstantSystem] used to interpret compile-time constants for this
-  /// backend.
-  ConstantSystem get constantSystem;
-
-  /// The constant environment for the backend interpretation of compile-time
-  /// constants.
-  BackendConstantEnvironment get constants;
-
-  /// The compiler task responsible for the compilation of constants for both
-  /// the frontend and the backend.
-  ConstantCompilerTask get constantCompilerTask;
-
-  /// Backend callback methods for the resolution phase.
-  ResolutionCallbacks get resolutionCallbacks;
-
-  /// The strategy used for collecting and emitting source information.
-  SourceInformationStrategy get sourceInformationStrategy {
-    return const SourceInformationStrategy();
-  }
-
-  // TODO(johnniwinther): Move this to the JavaScriptBackend.
-  String get patchVersion => null;
-
-  /// Set of classes that need to be considered for reflection although not
-  /// otherwise visible during resolution.
-  Iterable<ClassElement> classesRequiredForReflection = const [];
-
-  // Given a [FunctionElement], return a buffer with the code generated for it
-  // or null if no code was generated.
-  CodeBuffer codeOf(Element element) => null;
-
-  void initializeHelperClasses() {}
-
-  void enqueueHelpers(ResolutionEnqueuer world, Registry registry);
-  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) {
-    return new native.NativeEnqueuer();
-  }
-  native.NativeEnqueuer nativeCodegenEnqueuer(world) {
-    return new native.NativeEnqueuer();
-  }
-
-  /// Generates the output and returns the total size of the generated code.
-  int assembleProgram();
-
-  List<CompilerTask> get tasks;
-
-  void onResolutionComplete() {}
-  void onTypeInferenceComplete() {}
-
-  ItemCompilationContext createItemCompilationContext() {
-    return new ItemCompilationContext();
-  }
-
-  bool classNeedsRti(ClassElement cls);
-  bool methodNeedsRti(FunctionElement function);
-
-  /// Enable compilation of code with compile time errors. Returns `true` if
-  /// supported by the backend.
-  bool enableCodegenWithErrorsIfSupported(Spannable node);
-
-  /// Enable deferred loading. Returns `true` if the backend supports deferred
-  /// loading.
-  bool enableDeferredLoadingIfSupported(Spannable node, Registry registry);
-
-  /// Called during codegen when [constant] has been used.
-  void registerCompileTimeConstant(ConstantValue constant, Registry registry) {}
-
-  /// Called during resolution when a constant value for [metadata] on
-  /// [annotatedElement] has been evaluated.
-  void registerMetadataConstant(MetadataAnnotation metadata,
-                                Element annotatedElement,
-                                Registry registry) {}
-
-  /// 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 an interface type has been
-  /// instantiated.
-  void registerInstantiatedType(InterfaceType type, Registry registry) {}
-
-  /// Register an is check to the backend.
-  void registerIsCheckForCodegen(DartType type,
-                                 Enqueuer enqueuer,
-                                 Registry registry) {}
-
-  /// Register a runtime type variable bound tests between [typeArgument] and
-  /// [bound].
-  void registerTypeVariableBoundsSubtypeCheck(DartType typeArgument,
-                                              DartType bound) {}
-
-  /// Returns `true` if [element] represent the assert function.
-  bool isAssertMethod(Element element) => false;
-
-  /**
-   * Call this to register that an instantiated generic class has a call
-   * method.
-   */
-  void registerCallMethodWithFreeTypeVariables(
-      Element callMethod,
-      Enqueuer enqueuer,
-      Registry registry) {}
-
-  /**
-   * Call this to register that a getter exists for a function on an
-   * instantiated generic class.
-   */
-  void registerClosureWithFreeTypeVariables(
-      Element closure,
-      Enqueuer enqueuer,
-      Registry registry) {}
-
-  /// Call this to register that a member has been closurized.
-  void registerBoundClosure(Enqueuer enqueuer) {}
-
-  /// Call this to register that a static function has been closurized.
-  void registerGetOfStaticFunction(Enqueuer enqueuer) {}
-
-  /**
-   * Call this to register that the [:runtimeType:] property has been accessed.
-   */
-  void registerRuntimeType(Enqueuer enqueuer, Registry registry) {}
-
-  /// Call this to register a `noSuchMethod` implementation.
-  void registerNoSuchMethod(FunctionElement noSuchMethodElement) {}
-
-  /// Call this method to enable support for `noSuchMethod`.
-  void enableNoSuchMethod(Enqueuer enqueuer) {}
-
-  /// 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) {}
-
-  void registerRequiredType(DartType type, Element enclosingElement) {}
-  void registerClassUsingVariableExpression(ClassElement cls) {}
-
-  void registerConstSymbol(String name, Registry registry) {}
-  void registerNewSymbol(Registry registry) {}
-
-  bool isNullImplementation(ClassElement cls) {
-    return cls == compiler.nullClass;
-  }
-
-  ClassElement get intImplementation => compiler.intClass;
-  ClassElement get doubleImplementation => compiler.doubleClass;
-  ClassElement get numImplementation => compiler.numClass;
-  ClassElement get stringImplementation => compiler.stringClass;
-  ClassElement get listImplementation => compiler.listClass;
-  ClassElement get growableListImplementation => compiler.listClass;
-  ClassElement get fixedListImplementation => compiler.listClass;
-  ClassElement get constListImplementation => compiler.listClass;
-  ClassElement get mapImplementation => compiler.mapClass;
-  ClassElement get constMapImplementation => compiler.mapClass;
-  ClassElement get functionImplementation => compiler.functionClass;
-  ClassElement get typeImplementation => compiler.typeClass;
-  ClassElement get boolImplementation => compiler.boolClass;
-  ClassElement get nullImplementation => compiler.nullClass;
-  ClassElement get uint32Implementation => compiler.intClass;
-  ClassElement get uint31Implementation => compiler.intClass;
-  ClassElement get positiveIntImplementation => compiler.intClass;
-
-  ClassElement defaultSuperclass(ClassElement element) => compiler.objectClass;
-
-  bool isInterceptorClass(ClassElement element) => false;
-
-  /// Returns `true` if [element] is a foreign element, that is, that the
-  /// backend has specialized handling for the element.
-  bool isForeign(Element element) => false;
-
-  /// Processes [element] for resolution and returns the [FunctionElement] that
-  /// defines the implementation of [element].
-  FunctionElement resolveExternalFunction(FunctionElement element) => element;
-
-  /// Returns `true` if [library] is a backend specific library whose members
-  /// have special treatment, such as being allowed to extends blacklisted
-  /// classes or member being eagerly resolved.
-  bool isBackendLibrary(LibraryElement library) {
-    // TODO(johnniwinther): Remove this when patching is only done by the
-    // JavaScript backend.
-    Uri canonicalUri = library.canonicalUri;
-    if (canonicalUri == js_backend.JavaScriptBackend.DART_JS_HELPER ||
-        canonicalUri == js_backend.JavaScriptBackend.DART_INTERCEPTORS) {
-      return true;
-    }
-    return false;
-  }
-
-  void registerStaticUse(Element element, Enqueuer enqueuer) {}
-
-  /// This method is called immediately after the [LibraryElement] [library] has
-  /// been created.
-  void onLibraryCreated(LibraryElement library) {}
-
-  /// This method is called immediately after the [library] and its parts have
-  /// been scanned.
-  Future onLibraryScanned(LibraryElement library, LibraryLoader loader) {
-    if (library.canUseNative) {
-      library.forEachLocalMember((Element element) {
-        if (element.isClass) {
-          checkNativeAnnotation(compiler, element);
-        }
-      });
-    }
-    return new Future.value();
-  }
-
-  /// This method is called when all new libraries loaded through
-  /// [LibraryLoader.loadLibrary] has been loaded and their imports/exports
-  /// have been computed.
-  Future onLibrariesLoaded(LoadedLibraries loadedLibraries) {
-    return new Future.value();
-  }
-
-  /// Called by [MirrorUsageAnalyzerTask] after it has merged all @MirrorsUsed
-  /// annotations. The arguments corresponds to the unions of the corresponding
-  /// fields of the annotations.
-  void registerMirrorUsage(Set<String> symbols,
-                           Set<Element> targets,
-                           Set<Element> metaTargets) {}
-
-  /// Returns true if this element needs reflection information at runtime.
-  bool isAccessibleByReflection(Element element) => true;
-
-  /// Returns true if this element is covered by a mirrorsUsed annotation.
-  ///
-  /// Note that it might still be ok to tree shake the element away if no
-  /// reflection is used in the program (and thus [isTreeShakingDisabled] is
-  /// still false). Therefore _do not_ use this predicate to decide inclusion
-  /// in the tree, use [requiredByMirrorSystem] instead.
-  bool referencedFromMirrorSystem(Element element, [recursive]) => false;
-
-  /// Returns true if this element has to be enqueued due to
-  /// mirror usage. Might be a subset of [referencedFromMirrorSystem] if
-  /// normal tree shaking is still active ([isTreeShakingDisabled] is false).
-  bool requiredByMirrorSystem(Element element) => false;
-
-  /// Returns true if global optimizations such as type inferencing
-  /// can apply to this element. One category of elements that do not
-  /// apply is runtime helpers that the backend calls, but the
-  /// optimizations don't see those calls.
-  bool canBeUsedForGlobalOptimizations(Element element) => true;
-
-  /// Called when [enqueuer]'s queue is empty, but before it is closed.
-  /// This is used, for example, by the JS backend to enqueue additional
-  /// elements needed for reflection. [recentClasses] is a collection of
-  /// all classes seen for the first time by the [enqueuer] since the last call
-  /// to [onQueueEmpty].
-  ///
-  /// A return value of [:true:] indicates that [recentClasses] has been
-  /// processed and its elements do not need to be seen in the next round. When
-  /// [:false:] is returned, [onQueueEmpty] will be called again once the
-  /// resolution queue has drained and [recentClasses] will be a superset of the
-  /// current value.
-  ///
-  /// There is no guarantee that a class is only present once in
-  /// [recentClasses], but every class seen by the [enqueuer] will be present in
-  /// [recentClasses] at least once.
-  bool onQueueEmpty(Enqueuer enqueuer, Iterable<ClassElement> recentClasses) {
-    return true;
-  }
-
-  /// Called after [element] has been resolved.
-  // TODO(johnniwinther): Change [TreeElements] to [Registry] or a dependency
-  // node. [elements] is currently unused by the implementation.
-  void onElementResolved(Element element, TreeElements elements) {}
-
-  // Does this element belong in the output
-  bool shouldOutput(Element element) => true;
-
-  FunctionElement helperForBadMain() => null;
-
-  FunctionElement helperForMissingMain() => null;
-
-  FunctionElement helperForMainArity() => null;
-
-  void forgetElement(Element element) {}
-
-  void registerMainHasArguments(Enqueuer enqueuer) {}
-
-  void registerAsyncMarker(FunctionElement element,
-                             Enqueuer enqueuer,
-                             Registry registry) {}
-}
-
-/// Backend callbacks function specific to the resolution phase.
-class ResolutionCallbacks {
-  /// Register that [node] is a call to `assert`.
-  void onAssert(Send node, Registry registry) {}
-
-  /// Register that an 'await for' has been seen.
-  void onAsyncForIn(AsyncForIn node, Registry registry) {}
-
-  /// Called during resolution to notify to the backend that the
-  /// program uses string interpolation.
-  void onStringInterpolation(Registry registry) {}
-
-  /// Called during resolution to notify to the backend that the
-  /// program has a catch statement.
-  void onCatchStatement(Registry registry) {}
-
-  /// Called during resolution to notify to the backend that the
-  /// program explicitly throws an exception.
-  void onThrowExpression(Registry registry) {}
-
-  /// Called during resolution to notify to the backend that the
-  /// program has a global variable with a lazy initializer.
-  void onLazyField(Registry registry) {}
-
-  /// Called during resolution to notify to the backend that the
-  /// program uses a type variable as an expression.
-  void onTypeVariableExpression(Registry registry) {}
-
-  /// Called during resolution to notify to the backend that the
-  /// program uses a type literal.
-  void onTypeLiteral(DartType type, Registry registry) {}
-
-  /// Called during resolution to notify to the backend that the
-  /// program has a catch statement with a stack trace.
-  void onStackTraceInCatch(Registry registry) {}
-
-  /// Register an is check to the backend.
-  void onIsCheck(DartType type, Registry registry) {}
-
-  /// Called during resolution to notify to the backend that the
-  /// program has a for-in loop.
-  void onSyncForIn(Registry registry) {}
-
-  /// Register an as check to the backend.
-  void onAsCheck(DartType type, Registry registry) {}
-
-  /// Registers that a type variable bounds check might occur at runtime.
-  void onTypeVariableBoundCheck(Registry registry) {}
-
-  /// Register that the application may throw a [NoSuchMethodError].
-  void onThrowNoSuchMethod(Registry registry) {}
-
-  /// Register that the application may throw a [RuntimeError].
-  void onThrowRuntimeError(Registry registry) {}
-
-  /// Register that the application may throw an
-  /// [AbstractClassInstantiationError].
-  void onAbstractClassInstantiation(Registry registry) {}
-
-  /// Register that the application may throw a [FallThroughError].
-  void onFallThroughError(Registry registry) {}
-
-  /// Register that a super call will end up calling
-  /// [: super.noSuchMethod :].
-  void onSuperNoSuchMethod(Registry registry) {}
-
-  /// Register that the application creates a constant map.
-  void onMapLiteral(Registry registry, DartType type, bool isConstant) {}
-
-  /// Called when resolving the `Symbol` constructor.
-  void onSymbolConstructor(Registry registry) {}
-}
-
-/**
- * Key class used in [TokenMap] in which the hash code for a token is based
- * on the [charOffset].
- */
-class TokenKey {
-  final Token token;
-  TokenKey(this.token);
-  int get hashCode => token.charOffset;
-  operator==(other) => other is TokenKey && token == other.token;
-}
-
-/// Map of tokens and the first associated comment.
-/*
- * This implementation was chosen among several candidates for its space/time
- * efficiency by empirical tests of running dartdoc on dartdoc itself. Time
- * measurements for the use of [Compiler.commentMap]:
- *
- * 1) Using [TokenKey] as key (this class): ~80 msec
- * 2) Using [TokenKey] as key + storing a separate map in each script: ~120 msec
- * 3) Using [Token] as key in a [Map]: ~38000 msec
- * 4) Storing comments is new field in [Token]: ~20 msec
- *    (Abandoned due to the increased memory usage)
- * 5) Storing comments in an [Expando]: ~14000 msec
- * 6) Storing token/comments pairs in a linked list: ~5400 msec
- */
-class TokenMap {
-  Map<TokenKey,Token> comments = new Map<TokenKey,Token>();
-
-  Token operator[] (Token key) {
-    if (key == null) return null;
-    return comments[new TokenKey(key)];
-  }
-
-  void operator[]= (Token key, Token value) {
-    if (key == null) return;
-    comments[new TokenKey(key)] = value;
-  }
-}
-
-abstract class Compiler implements DiagnosticListener {
-  static final Uri DART_CORE = new Uri(scheme: 'dart', path: 'core');
-  static final Uri DART_MIRRORS = new Uri(scheme: 'dart', path: 'mirrors');
-  static final Uri DART_NATIVE_TYPED_DATA =
-      new Uri(scheme: 'dart', path: '_native_typed_data');
-  static final Uri DART_INTERNAL = new Uri(scheme: 'dart', path: '_internal');
-  static final Uri DART_ASYNC = new Uri(scheme: 'dart', path: 'async');
+abstract class Compiler {
 
   final Stopwatch totalCompileTime = new Stopwatch();
   int nextFreeClassId = 0;
   World world;
   Types types;
   _CompilerCoreTypes _coreTypes;
+  _CompilerDiagnosticReporter _reporter;
+  _CompilerResolution _resolution;
+  _CompilerParsing _parsing;
 
   final CacheStrategy cacheStrategy;
 
@@ -691,7 +158,7 @@
    * We should get rid of this and ensure that all dependencies are
    * associated with a particular element.
    */
-  Registry globalDependencies;
+  GlobalDependencyRegistry globalDependencies;
 
   /**
    * Dependencies that are only included due to mirrors.
@@ -701,7 +168,7 @@
    */
   // TODO(johnniwinther): This should not be a [ResolutionRegistry].
   final Registry mirrorDependencies =
-      new ResolutionRegistry.internal(null, new TreeElementMapping(null));
+      new ResolutionRegistry(null, new TreeElementMapping(null));
 
   final bool enableMinification;
 
@@ -714,12 +181,12 @@
   final bool enableUserAssertions;
   final bool trustTypeAnnotations;
   final bool trustPrimitives;
-  final bool enableConcreteTypeInference;
   final bool disableTypeInferenceFlag;
   final Uri deferredMapUri;
   final bool dumpInfo;
   final bool useContentSecurityPolicy;
   final bool enableExperimentalMirrors;
+  final bool enableAssertMessage;
 
   /**
    * The maximum size of a concrete type before it widens to dynamic during
@@ -770,23 +237,6 @@
    */
   final Uri outputUri;
 
-  /// Emit terse diagnostics without howToFix.
-  final bool terseDiagnostics;
-
-  /// If `true`, warnings and hints not from user code are reported.
-  final bool showPackageWarnings;
-
-  /// `true` if the last diagnostic was filtered, in which case the
-  /// accompanying info message should be filtered as well.
-  bool lastDiagnosticWasFiltered = false;
-
-  /// Map containing information about the warnings and hints that have been
-  /// suppressed for each library.
-  Map<Uri, SuppressionInfo> suppressedWarnings = <Uri, SuppressionInfo>{};
-
-  final bool suppressWarnings;
-  final bool fatalWarnings;
-
   /// If `true`, some values are cached for reuse in incremental compilation.
   /// Incremental compilation is basically calling [run] more than once.
   final bool hasIncrementalSupport;
@@ -807,10 +257,14 @@
 
   List<Uri> librariesToAnalyzeWhenRun;
 
+  /// The set of platform libraries reported as unsupported.
+  ///
+  /// For instance when importing 'dart:io' without '--categories=Server'.
+  Set<Uri> disallowedLibraryUris = new Setlet<Uri>();
+
   Tracer tracer;
 
   CompilerTask measuredTask;
-  Element _currentElement;
   LibraryElement coreLibrary;
   LibraryElement asyncLibrary;
 
@@ -828,6 +282,7 @@
   ClassElement get numClass => _coreTypes.numClass;
   ClassElement get intClass => _coreTypes.intClass;
   ClassElement get doubleClass => _coreTypes.doubleClass;
+  ClassElement get resourceClass => _coreTypes.resourceClass;
   ClassElement get stringClass => _coreTypes.stringClass;
   ClassElement get functionClass => _coreTypes.functionClass;
   ClassElement get nullClass => _coreTypes.nullClass;
@@ -840,7 +295,10 @@
   ClassElement get iterableClass => _coreTypes.iterableClass;
   ClassElement get streamClass => _coreTypes.streamClass;
 
+  DiagnosticReporter get reporter => _reporter;
   CoreTypes get coreTypes => _coreTypes;
+  Resolution get resolution => _resolution;
+  Parsing get parsing => _parsing;
 
   ClassElement typedDataClass;
 
@@ -898,49 +356,7 @@
 
   fromEnvironment(String name) => null;
 
-  Element get currentElement => _currentElement;
-
-  String tryToString(object) {
-    try {
-      return object.toString();
-    } catch (_) {
-      return '<exception in toString()>';
-    }
-  }
-
-  /**
-   * Perform an operation, [f], returning the return value from [f].  If an
-   * error occurs then report it as having occurred during compilation of
-   * [element].  Can be nested.
-   */
-  withCurrentElement(Element element, f()) {
-    Element old = currentElement;
-    _currentElement = element;
-    try {
-      return f();
-    } on SpannableAssertionFailure catch (ex) {
-      if (!hasCrashed) {
-        reportAssertionFailure(ex);
-        pleaseReportCrash();
-      }
-      hasCrashed = true;
-      rethrow;
-    } on StackOverflowError {
-      // We cannot report anything useful in this case, because we
-      // do not have enough stack space.
-      rethrow;
-    } catch (ex) {
-      if (hasCrashed) rethrow;
-      try {
-        unhandledExceptionOnElement(element);
-      } catch (doubleFault) {
-        // Ignoring exceptions in exception handling.
-      }
-      rethrow;
-    } finally {
-      _currentElement = old;
-    }
-  }
+  Element get currentElement => _reporter.currentElement;
 
   List<CompilerTask> tasks;
   ScannerTask scanner;
@@ -952,7 +368,6 @@
   ResolverTask resolver;
   closureMapping.ClosureTask closureToClassMapper;
   TypeCheckerTask checker;
-  IrBuilderTask irBuilder;
   ti.TypesTask typesTask;
   Backend backend;
 
@@ -971,35 +386,22 @@
   /// A customizable filter that is applied to enqueued work items.
   QueueFilter enqueuerFilter = new QueueFilter();
 
-  static const String MAIN = 'main';
-  static const String CALL_OPERATOR_NAME = 'call';
-  static const String NO_SUCH_METHOD = 'noSuchMethod';
-  static const int NO_SUCH_METHOD_ARG_COUNT = 1;
+  final Selector symbolValidatedConstructorSelector = new Selector.call(
+      const PublicName('validated'), CallStructure.ONE_ARG);
+
   static const String CREATE_INVOCATION_MIRROR =
       'createInvocationMirror';
-  static const String FROM_ENVIRONMENT = 'fromEnvironment';
-
-  static const String RUNTIME_TYPE = 'runtimeType';
 
   static const String UNDETERMINED_BUILD_ID =
       "build number could not be determined";
 
-  final Selector iteratorSelector =
-      new Selector.getter('iterator', null);
-  final Selector currentSelector =
-      new Selector.getter('current', null);
-  final Selector moveNextSelector =
-      new Selector.call('moveNext', null, 0);
-  final Selector noSuchMethodSelector = new Selector.call(
-      Compiler.NO_SUCH_METHOD, null, Compiler.NO_SUCH_METHOD_ARG_COUNT);
-  final Selector symbolValidatedConstructorSelector = new Selector.call(
-      'validated', null, 1);
-
   bool enabledRuntimeType = false;
   bool enabledFunctionApply = false;
   bool enabledInvokeOn = false;
   bool hasIsolateSupport = false;
 
+  bool get hasCrashed => _reporter.hasCrashed;
+
   Stopwatch progress;
 
   bool get shouldPrintProgress {
@@ -1023,8 +425,6 @@
     compilationFailedInternal = value;
   }
 
-  bool hasCrashed = false;
-
   /// Set by the backend if real reflection is detected in use of dart:mirrors.
   bool disableTypeInferenceForMirrors = false;
 
@@ -1032,7 +432,6 @@
             this.enableUserAssertions: false,
             this.trustTypeAnnotations: false,
             this.trustPrimitives: false,
-            this.enableConcreteTypeInference: false,
             bool disableTypeInferenceFlag: false,
             this.maxConcreteTypeSize: 5,
             this.enableMinification: false,
@@ -1052,19 +451,17 @@
             this.sourceMapUri: null,
             this.outputUri: null,
             this.buildId: UNDETERMINED_BUILD_ID,
-            this.terseDiagnostics: false,
             this.deferredMapUri: null,
             this.dumpInfo: false,
-            this.showPackageWarnings: false,
             bool useStartupEmitter: false,
             this.useContentSecurityPolicy: false,
-            this.suppressWarnings: false,
-            this.fatalWarnings: false,
             bool hasIncrementalSupport: false,
             this.enableExperimentalMirrors: false,
+            this.enableAssertMessage: false,
             this.allowNativeExtensions: false,
             this.generateCodeWithCompileTimeErrors: false,
             this.testMode: false,
+            DiagnosticOptions diagnosticOptions,
             api.CompilerOutput outputProvider,
             List<String> strips: const []})
       : this.disableTypeInferenceFlag =
@@ -1085,8 +482,11 @@
     world = new World(this);
     // TODO(johnniwinther): Initialize core types in [initializeCoreClasses] and
     // make its field final.
-    _coreTypes = new _CompilerCoreTypes(this);
-    types = new Types(this);
+    _reporter = new _CompilerDiagnosticReporter(this, diagnosticOptions);
+    _parsing = new _CompilerParsing(this);
+    _resolution = new _CompilerResolution(this);
+    _coreTypes = new _CompilerCoreTypes(_resolution);
+    types = new Types(_resolution);
     tracer = new Tracer(this, this.outputProvider);
 
     if (verbose) {
@@ -1095,8 +495,7 @@
 
     // TODO(johnniwinther): Separate the dependency tracking from the enqueuing
     // for global dependencies.
-    globalDependencies =
-        new CodegenRegistry(this, new TreeElementMapping(null));
+    globalDependencies = new GlobalDependencyRegistry(this);
 
     if (emitJavaScript) {
       js_backend.JavaScriptBackend jsBackend =
@@ -1122,7 +521,6 @@
       resolver = new ResolverTask(this, backend.constantCompilerTask),
       closureToClassMapper = new closureMapping.ClosureTask(this),
       checker = new TypeCheckerTask(this),
-      irBuilder = new IrBuilderTask(this, backend.sourceInformationStrategy),
       typesTask = new ti.TypesTask(this),
       constants = backend.constantCompilerTask,
       deferredLoadTask = new DeferredLoadTask(this),
@@ -1151,113 +549,15 @@
   int getNextFreeClassId() => nextFreeClassId++;
 
   void unimplemented(Spannable spannable, String methodName) {
-    internalError(spannable, "$methodName not implemented.");
-  }
-
-  void internalError(Spannable node, reason) {
-    String message = tryToString(reason);
-    reportDiagnosticInternal(
-        node, MessageKind.GENERIC, {'text': message}, api.Diagnostic.CRASH);
-    throw 'Internal Error: $message';
-  }
-
-  void unhandledExceptionOnElement(Element element) {
-    if (hasCrashed) return;
-    hasCrashed = true;
-    reportDiagnostic(
-        element,
-        MessageTemplate.TEMPLATES[MessageKind.COMPILER_CRASHED].message(),
-        api.Diagnostic.CRASH);
-    pleaseReportCrash();
-  }
-
-  void pleaseReportCrash() {
-    print(
-        MessageTemplate.TEMPLATES[MessageKind.PLEASE_REPORT_THE_CRASH]
-            .message({'buildId': buildId}));
-  }
-
-  SourceSpan spanFromSpannable(Spannable node) {
-    // TODO(johnniwinther): Disallow `node == null` ?
-    if (node == null) return null;
-    if (node == CURRENT_ELEMENT_SPANNABLE) {
-      node = currentElement;
-    } else if (node == NO_LOCATION_SPANNABLE) {
-      if (currentElement == null) return null;
-      node = currentElement;
-    }
-    if (node is SourceSpan) {
-      return node;
-    } else if (node is Node) {
-      return spanFromNode(node);
-    } else if (node is TokenPair) {
-      return spanFromTokens(node.begin, node.end);
-    } else if (node is Token) {
-      return spanFromTokens(node, node);
-    } else if (node is HInstruction) {
-      return spanFromHInstruction(node);
-    } else if (node is Element) {
-      return spanFromElement(node);
-    } else if (node is MetadataAnnotation) {
-      Uri uri = node.annotatedElement.compilationUnit.script.resourceUri;
-      return spanFromTokens(node.beginToken, node.endToken, uri);
-    } else if (node is Local) {
-      Local local = node;
-      return spanFromElement(local.executableContext);
-    } else {
-      throw 'No error location.';
-    }
-  }
-
-  Element _elementFromHInstruction(HInstruction instruction) {
-    return instruction.sourceElement is Element
-        ? instruction.sourceElement : null;
-  }
-
-  /// Finds the approximate [Element] for [node]. [currentElement] is used as
-  /// the default value.
-  Element elementFromSpannable(Spannable node) {
-    Element element;
-    if (node is Element) {
-      element = node;
-    } else if (node is HInstruction) {
-      element = _elementFromHInstruction(node);
-    } else if (node is MetadataAnnotation) {
-      element = node.annotatedElement;
-    }
-    return element != null ? element : currentElement;
-  }
-
-  void log(message) {
-    reportDiagnostic(null,
-        MessageTemplate.TEMPLATES[MessageKind.GENERIC]
-            .message({'text': '$message'}),
-        api.Diagnostic.VERBOSE_INFO);
+    reporter.internalError(spannable, "$methodName not implemented.");
   }
 
   Future<bool> run(Uri uri) {
     totalCompileTime.start();
 
-    return new Future.sync(() => runCompiler(uri)).catchError((error) {
-      try {
-        if (!hasCrashed) {
-          hasCrashed = true;
-          if (error is SpannableAssertionFailure) {
-            reportAssertionFailure(error);
-          } else {
-            reportDiagnostic(
-                new SourceSpan(uri, 0, 0),
-                MessageTemplate.TEMPLATES[MessageKind.COMPILER_CRASHED]
-                    .message(),
-                api.Diagnostic.CRASH);
-          }
-          pleaseReportCrash();
-        }
-      } catch (doubleFault) {
-        // Ignoring exceptions in exception handling.
-      }
-      throw error;
-    }).whenComplete(() {
+    return new Future.sync(() => runCompiler(uri))
+        .catchError((error) => _reporter.onError(uri, error))
+        .whenComplete(() {
       tracer.close();
       totalCompileTime.stop();
     }).then((_) {
@@ -1273,11 +573,11 @@
   /// been resolved.
   void onLibraryCreated(LibraryElement library) {
     Uri uri = library.canonicalUri;
-    if (uri == DART_CORE) {
+    if (uri == Uris.dart_core) {
       coreLibrary = library;
-    } else if (uri == DART_NATIVE_TYPED_DATA) {
+    } else if (uri == Uris.dart__native_typed_data) {
       typedDataLibrary = library;
-    } else if (uri == DART_MIRRORS) {
+    } else if (uri == Uris.dart_mirrors) {
       mirrorsLibrary = library;
     }
     backend.onLibraryCreated(library);
@@ -1294,20 +594,20 @@
   /// for [library].
   Future onLibraryScanned(LibraryElement library, LibraryLoader loader) {
     Uri uri = library.canonicalUri;
-    if (uri == DART_CORE) {
+    if (uri == Uris.dart_core) {
       initializeCoreClasses();
       identicalFunction = coreLibrary.find('identical');
-    } else if (uri == DART_INTERNAL) {
+    } else if (uri == Uris.dart__internal) {
       symbolImplementationClass = findRequiredElement(library, 'Symbol');
-    } else if (uri == DART_MIRRORS) {
+    } else if (uri == Uris.dart_mirrors) {
       mirrorSystemClass = findRequiredElement(library, 'MirrorSystem');
       mirrorsUsedClass = findRequiredElement(library, 'MirrorsUsed');
-    } else if (uri == DART_ASYNC) {
+    } else if (uri == Uris.dart_async) {
       asyncLibrary = library;
       deferredLibraryClass = findRequiredElement(library, 'DeferredLibrary');
       _coreTypes.futureClass = findRequiredElement(library, 'Future');
       _coreTypes.streamClass = findRequiredElement(library, 'Stream');
-    } else if (uri == DART_NATIVE_TYPED_DATA) {
+    } else if (uri == Uris.dart__native_typed_data) {
       typedDataClass = findRequiredElement(library, 'NativeTypedData');
     } else if (uri == js_backend.JavaScriptBackend.DART_JS_HELPER) {
       patchAnnotationClass = findRequiredElement(library, '_Patch');
@@ -1316,6 +616,72 @@
     return backend.onLibraryScanned(library, loader);
   }
 
+  /// Compute the set of distinct import chains to the library at [uri] within
+  /// [loadedLibraries].
+  ///
+  /// The chains are strings of the form
+  ///
+  ///       <main-uri> => <intermediate-uri1> => <intermediate-uri2> => <uri>
+  ///
+  Set<String> computeImportChainsFor(LoadedLibraries loadedLibraries, Uri uri) {
+    // TODO(johnniwinther): Move computation of dependencies to the library
+    // loader.
+    Uri rootUri = loadedLibraries.rootUri;
+    Set<String> importChains = new Set<String>();
+    // The maximum number of full imports chains to process.
+    final int chainLimit = 10000;
+    // The maximum number of imports chains to show.
+    final int compactChainLimit = verbose ? 20 : 10;
+    int chainCount = 0;
+    loadedLibraries.forEachImportChain(uri,
+        callback: (Link<Uri> importChainReversed) {
+      Link<CodeLocation> compactImportChain = const Link<CodeLocation>();
+      CodeLocation currentCodeLocation =
+          new UriLocation(importChainReversed.head);
+      compactImportChain = compactImportChain.prepend(currentCodeLocation);
+      for (Link<Uri> link = importChainReversed.tail;
+           !link.isEmpty;
+           link = link.tail) {
+        Uri uri = link.head;
+        if (!currentCodeLocation.inSameLocation(uri)) {
+          currentCodeLocation =
+              verbose ? new UriLocation(uri) : new CodeLocation(uri);
+          compactImportChain =
+              compactImportChain.prepend(currentCodeLocation);
+        }
+      }
+      String importChain =
+          compactImportChain.map((CodeLocation codeLocation) {
+            return codeLocation.relativize(rootUri);
+          }).join(' => ');
+
+      if (!importChains.contains(importChain)) {
+        if (importChains.length > compactChainLimit) {
+          importChains.add('...');
+          return false;
+        } else {
+          importChains.add(importChain);
+        }
+      }
+
+      chainCount++;
+      if (chainCount > chainLimit) {
+        // Assume there are more import chains.
+        importChains.add('...');
+        return false;
+      }
+      return true;
+    });
+    return importChains;
+  }
+
+  /// Register that [uri] was recognized but disallowed as a dependency.
+  ///
+  /// For instance import of 'dart:io' without '--categories=Server'.
+  void registerDisallowedLibraryUse(Uri uri) {
+    disallowedLibraryUris.add(uri);
+  }
+
   /// This method is called when all new libraries loaded through
   /// [LibraryLoader.loadLibrary] has been loaded and their imports/exports
   /// have been computed.
@@ -1326,81 +692,47 @@
   /// libraries.
   Future onLibrariesLoaded(LoadedLibraries loadedLibraries) {
     return new Future.sync(() {
-      if (!loadedLibraries.containsLibrary(DART_CORE)) {
-        return null;
-      }
-      if (!enableExperimentalMirrors &&
-          loadedLibraries.containsLibrary(DART_MIRRORS)) {
-        // TODO(johnniwinther): Move computation of dependencies to the library
-        // loader.
-        Uri rootUri = loadedLibraries.rootUri;
-        Set<String> importChains = new Set<String>();
-        // The maximum number of full imports chains to process.
-        final int chainLimit = 10000;
-        // The maximum number of imports chains to show.
-        final int compactChainLimit = verbose ? 20 : 10;
-        int chainCount = 0;
-        loadedLibraries.forEachImportChain(DART_MIRRORS,
-            callback: (Link<Uri> importChainReversed) {
-          Link<CodeLocation> compactImportChain = const Link<CodeLocation>();
-          CodeLocation currentCodeLocation =
-              new UriLocation(importChainReversed.head);
-          compactImportChain = compactImportChain.prepend(currentCodeLocation);
-          for (Link<Uri> link = importChainReversed.tail;
-               !link.isEmpty;
-               link = link.tail) {
-            Uri uri = link.head;
-            if (!currentCodeLocation.inSameLocation(uri)) {
-              currentCodeLocation =
-                  verbose ? new UriLocation(uri) : new CodeLocation(uri);
-              compactImportChain =
-                  compactImportChain.prepend(currentCodeLocation);
-            }
-          }
-          String importChain =
-              compactImportChain.map((CodeLocation codeLocation) {
-                return codeLocation.relativize(rootUri);
-              }).join(' => ');
-
-          if (!importChains.contains(importChain)) {
-            if (importChains.length > compactChainLimit) {
-              importChains.add('...');
-              return false;
-            } else {
-              importChains.add(importChain);
-            }
-          }
-
-          chainCount++;
-          if (chainCount > chainLimit) {
-            // Assume there are more import chains.
-            importChains.add('...');
-            return false;
-          }
-          return true;
-        });
-
-        if (!backend.supportsReflection) {
-          reportError(NO_LOCATION_SPANNABLE,
-                      MessageKind.MIRRORS_LIBRARY_NOT_SUPPORT_BY_BACKEND);
-        } else {
-          reportWarning(NO_LOCATION_SPANNABLE,
-             MessageKind.IMPORT_EXPERIMENTAL_MIRRORS,
-              {'importChain': importChains.join(
-                   MessageTemplate.IMPORT_EXPERIMENTAL_MIRRORS_PADDING)});
+      for (Uri uri in disallowedLibraryUris) {
+        if (loadedLibraries.containsLibrary(uri)) {
+          Set<String> importChains =
+              computeImportChainsFor(loadedLibraries, Uri.parse('dart:io'));
+          reporter.reportInfo(NO_LOCATION_SPANNABLE,
+             MessageKind.DISALLOWED_LIBRARY_IMPORT,
+              {'uri': uri,
+               'importChain': importChains.join(
+                   MessageTemplate.DISALLOWED_LIBRARY_IMPORT_PADDING)});
         }
       }
 
-      functionClass.ensureResolved(this);
+      if (!loadedLibraries.containsLibrary(Uris.dart_core)) {
+        return null;
+      }
+
+      bool importsMirrorsLibrary =
+          loadedLibraries.containsLibrary(Uris.dart_mirrors);
+      if (importsMirrorsLibrary && !backend.supportsReflection) {
+        Set<String> importChains =
+            computeImportChainsFor(loadedLibraries, Uris.dart_mirrors);
+        reporter.reportErrorMessage(
+            NO_LOCATION_SPANNABLE,
+            MessageKind.MIRRORS_LIBRARY_NOT_SUPPORT_BY_BACKEND,
+            {'importChain': importChains.join(
+                MessageTemplate.MIRRORS_NOT_SUPPORTED_BY_BACKEND_PADDING)});
+      } else if (importsMirrorsLibrary && !enableExperimentalMirrors) {
+        Set<String> importChains =
+            computeImportChainsFor(loadedLibraries, Uris.dart_mirrors);
+        reporter.reportWarningMessage(
+            NO_LOCATION_SPANNABLE,
+            MessageKind.IMPORT_EXPERIMENTAL_MIRRORS,
+            {'importChain': importChains.join(
+                 MessageTemplate.IMPORT_EXPERIMENTAL_MIRRORS_PADDING)});
+      }
+
+      functionClass.ensureResolved(resolution);
       functionApplyMethod = functionClass.lookupLocalMember('apply');
 
-      proxyConstant =
-          constants.getConstantValue(
-              resolver.constantCompiler.compileConstant(
-                  coreLibrary.find('proxy')));
-
       if (preserveComments) {
-        return libraryLoader.loadLibrary(DART_MIRRORS)
+        return libraryLoader.loadLibrary(Uris.dart_mirrors)
             .then((LibraryElement libraryElement) {
           documentClass = libraryElement.find('Comment');
         });
@@ -1408,13 +740,25 @@
     }).then((_) => backend.onLibrariesLoaded(loadedLibraries));
   }
 
+  bool isProxyConstant(ConstantValue value) {
+    FieldElement field = coreLibrary.find('proxy');
+    if (field == null) return false;
+    if (!resolution.hasBeenResolved(field)) return false;
+    if (proxyConstant == null) {
+      proxyConstant =
+          constants.getConstantValue(
+              resolver.constantCompiler.compileConstant(field));
+    }
+    return proxyConstant == value;
+  }
+
   Element findRequiredElement(LibraryElement library, String name) {
     var element = library.find(name);
     if (element == null) {
-      internalError(library,
+      reporter.internalError(library,
           "The library '${library.canonicalUri}' does not contain required "
           "element: '$name'.");
-      }
+    }
     return element;
   }
 
@@ -1434,13 +778,13 @@
     } else if (mirrorsUsedClass == cls) {
       mirrorsUsedConstructor = cls.constructors.head;
     } else if (intClass == cls) {
-      intEnvironment = intClass.lookupConstructor(FROM_ENVIRONMENT);
+      intEnvironment = intClass.lookupConstructor(Identifiers.fromEnvironment);
     } else if (stringClass == cls) {
       stringEnvironment =
-          stringClass.lookupConstructor(FROM_ENVIRONMENT);
+          stringClass.lookupConstructor(Identifiers.fromEnvironment);
     } else if (boolClass == cls) {
       boolEnvironment =
-          boolClass.lookupConstructor(FROM_ENVIRONMENT);
+          boolClass.lookupConstructor(Identifiers.fromEnvironment);
     }
   }
 
@@ -1458,6 +802,7 @@
     _coreTypes.numClass = lookupCoreClass('num');
     _coreTypes.intClass = lookupCoreClass('int');
     _coreTypes.doubleClass = lookupCoreClass('double');
+    _coreTypes.resourceClass = lookupCoreClass('Resource');
     _coreTypes.stringClass = lookupCoreClass('String');
     _coreTypes.functionClass = lookupCoreClass('Function');
     _coreTypes.listClass = lookupCoreClass('List');
@@ -1468,7 +813,7 @@
     _coreTypes.iterableClass = lookupCoreClass('Iterable');
     _coreTypes.symbolClass = lookupCoreClass('Symbol');
     if (!missingCoreClasses.isEmpty) {
-      internalError(
+      reporter.internalError(
           coreLibrary,
           'dart:core library does not contain required classes: '
           '$missingCoreClasses');
@@ -1505,16 +850,16 @@
     return new Future.sync(() {
       if (librariesToAnalyzeWhenRun != null) {
         return Future.forEach(librariesToAnalyzeWhenRun, (libraryUri) {
-          log('Analyzing $libraryUri ($buildId)');
+          reporter.log('Analyzing $libraryUri ($buildId)');
           return libraryLoader.loadLibrary(libraryUri);
         });
       }
     }).then((_) {
       if (uri != null) {
         if (analyzeOnly) {
-          log('Analyzing $uri ($buildId)');
+          reporter.log('Analyzing $uri ($buildId)');
         } else {
-          log('Compiling $uri ($buildId)');
+          reporter.log('Compiling $uri ($buildId)');
         }
         return libraryLoader.loadLibrary(uri).then((LibraryElement library) {
           mainApp = library;
@@ -1528,41 +873,45 @@
   void computeMain() {
     if (mainApp == null) return;
 
-    Element main = mainApp.findExported(MAIN);
+    Element main = mainApp.findExported(Identifiers.main);
     ErroneousElement errorElement = null;
     if (main == null) {
       if (analyzeOnly) {
         if (!analyzeAll) {
           errorElement = new ErroneousElementX(
-              MessageKind.CONSIDER_ANALYZE_ALL, {'main': MAIN}, MAIN, mainApp);
+              MessageKind.CONSIDER_ANALYZE_ALL, {'main': Identifiers.main},
+              Identifiers.main, mainApp);
         }
       } else {
         // Compilation requires a main method.
         errorElement = new ErroneousElementX(
-            MessageKind.MISSING_MAIN, {'main': MAIN}, MAIN, mainApp);
+            MessageKind.MISSING_MAIN, {'main': Identifiers.main},
+            Identifiers.main, mainApp);
       }
       mainFunction = backend.helperForMissingMain();
     } else if (main.isErroneous && main.isSynthesized) {
       if (main is ErroneousElement) {
         errorElement = main;
       } else {
-        internalError(main, 'Problem with $MAIN.');
+        reporter.internalError(main, 'Problem with ${Identifiers.main}.');
       }
       mainFunction = backend.helperForBadMain();
     } else if (!main.isFunction) {
       errorElement = new ErroneousElementX(
-          MessageKind.MAIN_NOT_A_FUNCTION, {'main': MAIN}, MAIN, main);
+          MessageKind.MAIN_NOT_A_FUNCTION, {'main': Identifiers.main},
+          Identifiers.main, main);
       mainFunction = backend.helperForBadMain();
     } else {
       mainFunction = main;
-      mainFunction.computeType(this);
+      mainFunction.computeType(resolution);
       FunctionSignature parameters = mainFunction.functionSignature;
       if (parameters.requiredParameterCount > 2) {
         int index = 0;
         parameters.orderedForEachParameter((Element parameter) {
           if (index++ < 2) return;
           errorElement = new ErroneousElementX(
-              MessageKind.MAIN_WITH_EXTRA_PARAMETER, {'main': MAIN}, MAIN,
+              MessageKind.MAIN_WITH_EXTRA_PARAMETER, {'main': Identifiers.main},
+              Identifiers.main,
               parameter);
           mainFunction = backend.helperForMainArity();
           // Don't warn about main not being used:
@@ -1572,7 +921,7 @@
     }
     if (mainFunction == null) {
       if (errorElement == null && !analyzeOnly && !analyzeAll) {
-        internalError(mainApp, "Problem with '$MAIN'.");
+        reporter.internalError(mainApp, "Problem with '${Identifiers.main}'.");
       } else {
         mainFunction = errorElement;
       }
@@ -1580,12 +929,36 @@
     if (errorElement != null &&
         errorElement.isSynthesized &&
         !mainApp.isSynthesized) {
-      reportWarning(
+      reporter.reportWarningMessage(
           errorElement, errorElement.messageKind,
           errorElement.messageArguments);
     }
   }
 
+  /// Analyze all member of the library in [libraryUri].
+  ///
+  /// If [skipLibraryWithPartOfTag] is `true`, member analysis is skipped if the
+  /// library has a `part of` tag, assuming it is a part and not a library.
+  ///
+  /// This operation assumes an unclosed resolution queue and is only supported
+  /// when the '--analyze-main' option is used.
+  Future<LibraryElement> analyzeUri(
+      Uri libraryUri,
+      {bool skipLibraryWithPartOfTag: true}) {
+    assert(analyzeMain);
+    reporter.log('Analyzing $libraryUri ($buildId)');
+    return libraryLoader.loadLibrary(libraryUri).then((LibraryElement library) {
+      var compilationUnit = library.compilationUnit;
+      if (skipLibraryWithPartOfTag && compilationUnit.partTag != null) {
+        return null;
+      }
+      fullyEnqueueLibrary(library, enqueuer.resolution);
+      emptyQueue(enqueuer.resolution);
+      enqueuer.resolution.logSummary(reporter.log);
+      return library;
+    });
+  }
+
   /// Performs the compilation when all libraries have been loaded.
   void compileLoadedLibraries() {
     computeMain();
@@ -1601,38 +974,29 @@
     phase = PHASE_RESOLVING;
     if (analyzeAll) {
       libraryLoader.libraries.forEach((LibraryElement library) {
-        log('Enqueuing ${library.canonicalUri}');
+      reporter.log('Enqueuing ${library.canonicalUri}');
         fullyEnqueueLibrary(library, enqueuer.resolution);
       });
-    } else if (analyzeMain && mainApp != null) {
-      fullyEnqueueLibrary(mainApp, enqueuer.resolution);
+    } else if (analyzeMain) {
+      if (mainApp != null) {
+        fullyEnqueueLibrary(mainApp, enqueuer.resolution);
+      }
+      if (librariesToAnalyzeWhenRun != null) {
+        for (Uri libraryUri in librariesToAnalyzeWhenRun) {
+          fullyEnqueueLibrary(libraryLoader.lookupLibrary(libraryUri),
+              enqueuer.resolution);
+        }
+      }
     }
     // Elements required by enqueueHelpers are global dependencies
     // that are not pulled in by a particular element.
     backend.enqueueHelpers(enqueuer.resolution, globalDependencies);
     resolveLibraryMetadata();
-    log('Resolving...');
+    reporter.log('Resolving...');
     processQueue(enqueuer.resolution, mainFunction);
-    enqueuer.resolution.logSummary(log);
+    enqueuer.resolution.logSummary(reporter.log);
 
-    if (!showPackageWarnings && !suppressWarnings) {
-      suppressedWarnings.forEach((Uri uri, SuppressionInfo info) {
-        MessageKind kind = MessageKind.HIDDEN_WARNINGS_HINTS;
-        if (info.warnings == 0) {
-          kind = MessageKind.HIDDEN_HINTS;
-        } else if (info.hints == 0) {
-          kind = MessageKind.HIDDEN_WARNINGS;
-        }
-        MessageTemplate template = MessageTemplate.TEMPLATES[kind];
-        reportDiagnostic(null,
-            template.message(
-                {'warnings': info.warnings,
-                 'hints': info.hints,
-                 'uri': uri},
-                terseDiagnostics),
-            api.Diagnostic.HINT);
-      });
-    }
+    _reporter.reportSuppressedMessagesSummary();
 
     if (compilationFailed){
       if (!generateCodeWithCompileTimeErrors) return;
@@ -1647,7 +1011,9 @@
         // code is artificially used.
         // If compilation failed, it is possible that the error prevents the
         // compiler from analyzing all the code.
-        reportUnusedCode();
+        // TODO(johnniwinther): Reenable this when the reporting is more
+        // precise.
+        //reportUnusedCode();
       }
       return;
     }
@@ -1661,15 +1027,16 @@
 
     deferredLoadTask.onResolutionComplete(mainFunction);
 
-    log('Inferring types...');
+    reporter.log('Inferring types...');
     typesTask.onResolutionComplete(mainFunction);
 
     if (stopAfterTypeInference) return;
 
     backend.onTypeInferenceComplete();
 
-    log('Compiling...');
+    reporter.log('Compiling...');
     phase = PHASE_COMPILING;
+    backend.onCodegenStart();
     // TODO(johnniwinther): Move these to [CodegenEnqueuer].
     if (hasIsolateSupport) {
       backend.enableIsolateSupport(enqueuer.codegen);
@@ -1680,7 +1047,7 @@
       });
     }
     processQueue(enqueuer.codegen, mainFunction);
-    enqueuer.codegen.logSummary(log);
+    enqueuer.codegen.logSummary(reporter.log);
 
     int programSize = backend.assembleProgram();
 
@@ -1702,9 +1069,10 @@
   void fullyEnqueueTopLevelElement(Element element, Enqueuer world) {
     if (element.isClass) {
       ClassElement cls = element;
-      cls.ensureResolved(this);
+      cls.ensureResolved(resolution);
       cls.forEachLocalMember(enqueuer.resolution.addToWorkList);
-      world.registerInstantiatedType(cls.rawType, globalDependencies);
+      backend.registerInstantiatedType(
+          cls.rawType, world, globalDependencies);
     } else {
       world.addToWorkList(element);
     }
@@ -1717,25 +1085,36 @@
     for (LibraryElement library in libraryLoader.libraries) {
       if (library.metadata != null) {
         for (MetadataAnnotation metadata in library.metadata) {
-          metadata.ensureResolved(this);
+          metadata.ensureResolved(resolution);
         }
       }
     }
   }
 
+  /**
+   * Empty the [world] queue.
+   */
+  void emptyQueue(Enqueuer world) {
+    world.forEach((WorkItem work) {
+    reporter.withCurrentElement(work.element, () {
+        world.applyImpact(work.element, work.run(this, world));
+      });
+    });
+  }
+
   void processQueue(Enqueuer world, Element main) {
     world.nativeEnqueuer.processNativeClasses(libraryLoader.libraries);
     if (main != null && !main.isErroneous) {
       FunctionElement mainMethod = main;
-      mainMethod.computeType(this);
+      mainMethod.computeType(resolution);
       if (mainMethod.functionSignature.parameterCount != 0) {
         // The first argument could be a list of strings.
-        backend.listImplementation.ensureResolved(this);
-        world.registerInstantiatedType(
-            backend.listImplementation.rawType, globalDependencies);
-        backend.stringImplementation.ensureResolved(this);
-        world.registerInstantiatedType(
-            backend.stringImplementation.rawType, globalDependencies);
+        backend.listImplementation.ensureResolved(resolution);
+        backend.registerInstantiatedType(
+            backend.listImplementation.rawType, world, globalDependencies);
+        backend.stringImplementation.ensureResolved(resolution);
+        backend.registerInstantiatedType(
+            backend.stringImplementation.rawType, world, globalDependencies);
 
         backend.registerMainHasArguments(world);
       }
@@ -1744,12 +1123,9 @@
     if (verbose) {
       progress.reset();
     }
-    world.forEach((WorkItem work) {
-      withCurrentElement(work.element, () {
-        world.applyImpact(work.element, work.run(this, world));
-      });
-    });
+    emptyQueue(world);
     world.queueIsClosed = true;
+    backend.onQueueClosed();
     assert(compilationFailed || world.checkNoEnqueuedInvokedInstanceMethods());
   }
 
@@ -1762,11 +1138,11 @@
   checkQueues() {
     for (Enqueuer world in [enqueuer.resolution, enqueuer.codegen]) {
       world.forEach((WorkItem work) {
-        internalError(work.element, "Work list is not empty.");
+        reporter.internalError(work.element, "Work list is not empty.");
       });
     }
     if (!REPORT_EXCESS_RESOLUTION) return;
-    var resolved = new Set.from(enqueuer.resolution.resolvedElements);
+    var resolved = new Set.from(enqueuer.resolution.processedElements);
     for (Element e in enqueuer.codegen.generatedCode.keys) {
       resolved.remove(e);
     }
@@ -1785,9 +1161,9 @@
         resolved.remove(e);
       }
     }
-    log('Excess resolution work: ${resolved.length}.');
+    reporter.log('Excess resolution work: ${resolved.length}.');
     for (Element e in resolved) {
-      reportWarning(e,
+      reporter.reportWarningMessage(e,
           MessageKind.GENERIC,
           {'text': 'Warning: $e resolved but not compiled.'});
     }
@@ -1805,23 +1181,11 @@
     assert(invariant(element, element is AnalyzableElement,
         message: 'Element $element is not analyzable.'));
     assert(invariant(element, element.isDeclaration));
-    ResolutionEnqueuer world = enqueuer.resolution;
-    if (world.hasBeenResolved(element)) {
-      return const WorldImpact();
-    }
-    assert(parser != null);
-    Node tree = parser.parse(element);
-    assert(invariant(element, !element.isSynthesized || tree == null));
-    WorldImpact worldImpact = resolver.resolve(element);
-    if (tree != null && !analyzeSignaturesOnly && !suppressWarnings) {
-      // Only analyze nodes with a corresponding [TreeElements].
-      checker.check(element);
-    }
-    world.registerResolvedElement(element);
-    return worldImpact;
+    return resolution.computeWorldImpact(element);
   }
 
-  WorldImpact analyze(ResolutionWorkItem work, ResolutionEnqueuer world) {
+  WorldImpact analyze(ResolutionWorkItem work,
+                      ResolutionEnqueuer world) {
     assert(invariant(work.element, identical(world, enqueuer.resolution)));
     assert(invariant(work.element, !work.isAnalyzed,
         message: 'Element ${work.element} has already been analyzed'));
@@ -1829,17 +1193,19 @@
       // TODO(ahe): Add structured diagnostics to the compiler API and
       // use it to separate this from the --verbose option.
       if (phase == PHASE_RESOLVING) {
-        log('Resolved ${enqueuer.resolution.resolvedElements.length} '
+        reporter.log(
+            'Resolved ${enqueuer.resolution.processedElements.length} '
             'elements.');
         progress.reset();
       }
     }
     AstElement element = work.element;
-    if (world.hasBeenResolved(element)) {
+    if (world.hasBeenProcessed(element)) {
       return const WorldImpact();
     }
     WorldImpact worldImpact = analyzeElement(element);
     backend.onElementResolved(element, element.resolvedAst.elements);
+    world.registerProcessedElement(element);
     return worldImpact;
   }
 
@@ -1848,143 +1214,19 @@
     if (shouldPrintProgress) {
       // TODO(ahe): Add structured diagnostics to the compiler API and
       // use it to separate this from the --verbose option.
-      log('Compiled ${enqueuer.codegen.generatedCode.length} methods.');
+      reporter.log(
+          'Compiled ${enqueuer.codegen.generatedCode.length} methods.');
       progress.reset();
     }
     return backend.codegen(work);
   }
 
-  void reportError(Spannable node,
-                   MessageKind messageKind,
-                   [Map arguments = const {}]) {
-    reportDiagnosticInternal(
-        node, messageKind, arguments, api.Diagnostic.ERROR);
-  }
-
-  void reportWarning(Spannable node, MessageKind messageKind,
-                     [Map arguments = const {}]) {
-    reportDiagnosticInternal(
-        node, messageKind, arguments, api.Diagnostic.WARNING);
-  }
-
-  void reportInfo(Spannable node, MessageKind messageKind,
-                  [Map arguments = const {}]) {
-    reportDiagnosticInternal(node, messageKind, arguments, api.Diagnostic.INFO);
-  }
-
-  void reportHint(Spannable node, MessageKind messageKind,
-                  [Map arguments = const {}]) {
-    reportDiagnosticInternal(node, messageKind, arguments, api.Diagnostic.HINT);
-  }
-
-  void reportDiagnosticInternal(Spannable node,
-                                MessageKind messageKind,
-                                Map arguments,
-                                api.Diagnostic kind) {
-    if (!showPackageWarnings && node != NO_LOCATION_SPANNABLE) {
-      switch (kind) {
-      case api.Diagnostic.WARNING:
-      case api.Diagnostic.HINT:
-        Element element = elementFromSpannable(node);
-        if (!inUserCode(element, assumeInUserCode: true)) {
-          Uri uri = getCanonicalUri(element);
-          SuppressionInfo info =
-              suppressedWarnings.putIfAbsent(uri, () => new SuppressionInfo());
-          if (kind == api.Diagnostic.WARNING) {
-            info.warnings++;
-          } else {
-            info.hints++;
-          }
-          lastDiagnosticWasFiltered = true;
-          return;
-        }
-        break;
-      case api.Diagnostic.INFO:
-        if (lastDiagnosticWasFiltered) {
-          return;
-        }
-        break;
-      }
-    }
-    lastDiagnosticWasFiltered = false;
-    MessageTemplate template = MessageTemplate.TEMPLATES[messageKind];
-    reportDiagnostic(
-        node,
-        template.message(arguments, terseDiagnostics),
-        kind);
-  }
-
-  void reportDiagnostic(Spannable span,
-                        Message message,
+  void reportDiagnostic(DiagnosticMessage message,
+                        List<DiagnosticMessage> infos,
                         api.Diagnostic kind);
 
-  void reportAssertionFailure(SpannableAssertionFailure ex) {
-    String message = (ex.message != null) ? tryToString(ex.message)
-                                          : tryToString(ex);
-    reportDiagnosticInternal(
-        ex.node, MessageKind.GENERIC, {'text': message}, api.Diagnostic.CRASH);
-  }
-
-  SourceSpan spanFromTokens(Token begin, Token end, [Uri uri]) {
-    if (begin == null || end == null) {
-      // TODO(ahe): We can almost always do better. Often it is only
-      // end that is null. Otherwise, we probably know the current
-      // URI.
-      throw 'Cannot find tokens to produce error message.';
-    }
-    if (uri == null && currentElement != null) {
-      uri = currentElement.compilationUnit.script.resourceUri;
-    }
-    return SourceSpan.withCharacterOffsets(begin, end,
-      (beginOffset, endOffset) => new SourceSpan(uri, beginOffset, endOffset));
-  }
-
-  SourceSpan spanFromNode(Node node) {
-    return spanFromTokens(node.getBeginToken(), node.getEndToken());
-  }
-
-  SourceSpan spanFromElement(Element element) {
-    if (element != null && element.sourcePosition != null) {
-      return element.sourcePosition;
-    }
-    while (element != null && element.isSynthesized) {
-      element = element.enclosingElement;
-    }
-    if (element != null &&
-        element.sourcePosition == null &&
-        !element.isLibrary &&
-        !element.isCompilationUnit) {
-      // Sometimes, the backend fakes up elements that have no
-      // position. So we use the enclosing element instead. It is
-      // not a good error location, but cancel really is "internal
-      // error" or "not implemented yet", so the vicinity is good
-      // enough for now.
-      element = element.enclosingElement;
-      // TODO(ahe): I plan to overhaul this infrastructure anyways.
-    }
-    if (element == null) {
-      element = currentElement;
-    }
-    if (element == null) {
-      return null;
-    }
-
-    if (element.sourcePosition != null) {
-      return element.sourcePosition;
-    }
-    Token position = element.position;
-    Uri uri = element.compilationUnit.script.resourceUri;
-    return (position == null)
-        ? new SourceSpan(uri, 0, 0)
-        : spanFromTokens(position, position, uri);
-  }
-
-  SourceSpan spanFromHInstruction(HInstruction instruction) {
-    Element element = _elementFromHInstruction(instruction);
-    if (element == null) element = currentElement;
-    SourceInformation position = instruction.sourceInformation;
-    if (position == null) return spanFromElement(element);
-    return position.sourceSpan;
+  void reportCrashInUserCode(String message, exception, stackTrace) {
+    _reporter.onCrashInUserCode(message, exception, stackTrace);
   }
 
   /**
@@ -2001,7 +1243,7 @@
    * See [LibraryLoader] for terminology on URIs.
    */
   Uri translateResolvedUri(LibraryElement importingLibrary,
-                           Uri resolvedUri, Node node) {
+                           Uri resolvedUri, Spannable spannable) {
     unimplemented(importingLibrary, 'Compiler.translateResolvedUri');
     return null;
   }
@@ -2036,10 +1278,10 @@
   Token processAndStripComments(Token currentToken) {
     Token firstToken = currentToken;
     Token prevToken;
-    while (currentToken.kind != EOF_TOKEN) {
-      if (identical(currentToken.kind, COMMENT_TOKEN)) {
+    while (currentToken.kind != Tokens.EOF_TOKEN) {
+      if (identical(currentToken.kind, Tokens.COMMENT_TOKEN)) {
         Token firstCommentToken = currentToken;
-        while (identical(currentToken.kind, COMMENT_TOKEN)) {
+        while (identical(currentToken.kind, Tokens.COMMENT_TOKEN)) {
           currentToken = currentToken.next;
         }
         commentMap[currentToken] = firstCommentToken;
@@ -2059,21 +1301,21 @@
     void checkLive(member) {
       if (member.isErroneous) return;
       if (member.isFunction) {
-        if (!enqueuer.resolution.hasBeenResolved(member)) {
-          reportHint(member, MessageKind.UNUSED_METHOD,
-                     {'name': member.name});
+        if (!enqueuer.resolution.hasBeenProcessed(member)) {
+          reporter.reportHintMessage(
+              member, MessageKind.UNUSED_METHOD, {'name': member.name});
         }
       } else if (member.isClass) {
         if (!member.isResolved) {
-          reportHint(member, MessageKind.UNUSED_CLASS,
-                     {'name': member.name});
+          reporter.reportHintMessage(
+              member, MessageKind.UNUSED_CLASS, {'name': member.name});
         } else {
           member.forEachLocalMember(checkLive);
         }
       } else if (member.isTypedef) {
         if (!member.isResolved) {
-          reportHint(member, MessageKind.UNUSED_TYPEDEF,
-                     {'name': member.name});
+          reporter.reportHintMessage(
+              member, MessageKind.UNUSED_TYPEDEF, {'name': member.name});
         }
       }
     }
@@ -2189,234 +1431,14 @@
   }
 }
 
-class CompilerTask {
-  final Compiler compiler;
-  final Stopwatch watch;
-  UserTag profilerTag;
-
-  CompilerTask(Compiler compiler)
-      : this.compiler = compiler,
-        watch = (compiler.verbose) ? new Stopwatch() : null;
-
-  String get name => "Unknown task '${this.runtimeType}'";
-  int get timing => (watch != null) ? watch.elapsedMilliseconds : 0;
-
-  int get timingMicroseconds => (watch != null) ? watch.elapsedMicroseconds : 0;
-
-  UserTag getProfilerTag() {
-    if (profilerTag == null) profilerTag = new UserTag(name);
-    return profilerTag;
-  }
-
-  measure(action()) {
-    // In verbose mode when watch != null.
-    if (watch == null) return action();
-    CompilerTask previous = compiler.measuredTask;
-    if (identical(this, previous)) return action();
-    compiler.measuredTask = this;
-    if (previous != null) previous.watch.stop();
-    watch.start();
-    UserTag oldTag = getProfilerTag().makeCurrent();
-    try {
-      return action();
-    } finally {
-      watch.stop();
-      oldTag.makeCurrent();
-      if (previous != null) previous.watch.start();
-      compiler.measuredTask = previous;
-    }
-  }
-
-  measureElement(Element element, action()) {
-    compiler.withCurrentElement(element, () => measure(action));
-  }
-}
-
-class SourceSpan implements Spannable {
-  final Uri uri;
-  final int begin;
-  final int end;
-
-  const SourceSpan(this.uri, this.begin, this.end);
-
-  static withCharacterOffsets(Token begin, Token end,
-                     f(int beginOffset, int endOffset)) {
-    final beginOffset = begin.charOffset;
-    final endOffset = end.charOffset + end.charCount;
-
-    // [begin] and [end] might be the same for the same empty token. This
-    // happens for instance when scanning '$$'.
-    assert(endOffset >= beginOffset);
-    return f(beginOffset, endOffset);
-  }
-
-  int get hashCode {
-    return 13 * uri.hashCode +
-           17 * begin.hashCode +
-           19 * end.hashCode;
-  }
-
-  bool operator ==(other) {
-    if (identical(this, other)) return true;
-    if (other is! SourceSpan) return false;
-    return uri == other.uri &&
-           begin == other.begin &&
-           end == other.end;
-  }
-
-  String toString() => 'SourceSpan($uri, $begin, $end)';
-}
-
-/// Flag that can be used in assertions to assert that a code path is only
-/// executed as part of development.
-///
-/// This flag is automatically set to true if helper methods like, [debugPrint],
-/// [debugWrapPrint], [trace], and [reportHere] are called.
-bool DEBUG_MODE = false;
-
-/// Assert that [DEBUG_MODE] is `true` and provide [message] as part of the
-/// error message.
-assertDebugMode(String message) {
-  assert(invariant(NO_LOCATION_SPANNABLE, DEBUG_MODE,
-      message: 'Debug mode is not enabled: $message'));
-}
-
-/**
- * Throws a [SpannableAssertionFailure] if [condition] is
- * [:false:]. [condition] must be either a [:bool:] or a no-arg
- * function returning a [:bool:].
- *
- * Use this method to provide better information for assertion by calling
- * [invariant] as the argument to an [:assert:] statement:
- *
- *     assert(invariant(position, isValid));
- *
- * [spannable] must be non-null and will be used to provide positional
- * information in the generated error message.
- */
-bool invariant(Spannable spannable, var condition, {var message: null}) {
-  // TODO(johnniwinther): Use [spannable] and [message] to provide better
-  // information on assertion errors.
-  if (spannable == null) {
-    throw new SpannableAssertionFailure(CURRENT_ELEMENT_SPANNABLE,
-        "Spannable was null for invariant. Use CURRENT_ELEMENT_SPANNABLE.");
-  }
-  if (condition is Function){
-    condition = condition();
-  }
-  if (!condition) {
-    if (message is Function) {
-      message = message();
-    }
-    throw new SpannableAssertionFailure(spannable, message);
-  }
-  return true;
-}
-
-/// Returns `true` when [s] is private if used as an identifier.
-bool isPrivateName(String s) => !s.isEmpty && s.codeUnitAt(0) == $_;
-
-/// Returns `true` when [s] is public if used as an identifier.
-bool isPublicName(String s) => !isPrivateName(s);
-
 /// Information about suppressed warnings and hints for a given library.
 class SuppressionInfo {
   int warnings = 0;
   int hints = 0;
 }
 
-class GenericTask extends CompilerTask {
-  final String name;
-
-  GenericTask(this.name, Compiler compiler)
-      : super(compiler);
-}
-
-/// [CodeLocation] divides uris into different classes.
-///
-/// These are used to group uris from user code, platform libraries and
-/// packages.
-abstract class CodeLocation {
-  /// Returns `true` if [uri] is in this code location.
-  bool inSameLocation(Uri uri);
-
-  /// Returns the uri of this location relative to [baseUri].
-  String relativize(Uri baseUri);
-
-  factory CodeLocation(Uri uri) {
-    if (uri.scheme == 'package') {
-      int slashPos = uri.path.indexOf('/');
-      if (slashPos != -1) {
-        String packageName = uri.path.substring(0, slashPos);
-        return new PackageLocation(packageName);
-      } else {
-        return new UriLocation(uri);
-      }
-    } else {
-      return new SchemeLocation(uri);
-    }
-  }
-}
-
-/// A code location defined by the scheme of the uri.
-///
-/// Used for non-package uris, such as 'dart', 'file', and 'http'.
-class SchemeLocation implements CodeLocation {
-  final Uri uri;
-
-  SchemeLocation(this.uri);
-
-  bool inSameLocation(Uri uri) {
-    return this.uri.scheme == uri.scheme;
-  }
-
-  String relativize(Uri baseUri) {
-    return uri_extras.relativize(baseUri, uri, false);
-  }
-}
-
-/// A code location defined by the package name.
-///
-/// Used for package uris, separated by their `package names`, that is, the
-/// 'foo' of 'package:foo/bar.dart'.
-class PackageLocation implements CodeLocation {
-  final String packageName;
-
-  PackageLocation(this.packageName);
-
-  bool inSameLocation(Uri uri) {
-    return uri.scheme == 'package' && uri.path.startsWith('$packageName/');
-  }
-
-  String relativize(Uri baseUri) => 'package:$packageName';
-}
-
-/// A code location defined by the whole uri.
-///
-/// Used for package uris with no package name. For instance 'package:foo.dart'.
-class UriLocation implements CodeLocation {
-  final Uri uri;
-
-  UriLocation(this.uri);
-
-  bool inSameLocation(Uri uri) => this.uri == uri;
-
-  String relativize(Uri baseUri) {
-    return uri_extras.relativize(baseUri, uri, false);
-  }
-}
-
-/// A code location that contains any uri.
-class AnyLocation implements CodeLocation {
-  const AnyLocation();
-
-  bool inSameLocation(Uri uri) => true;
-
-  String relativize(Uri baseUri) => '$baseUri';
-}
-
 class _CompilerCoreTypes implements CoreTypes {
-  final Compiler compiler;
+  final Resolution resolution;
 
   ClassElement objectClass;
   ClassElement boolClass;
@@ -2434,29 +1456,52 @@
   ClassElement futureClass;
   ClassElement iterableClass;
   ClassElement streamClass;
+  ClassElement resourceClass;
 
-  _CompilerCoreTypes(this.compiler);
+  _CompilerCoreTypes(this.resolution);
 
   @override
-  InterfaceType get objectType => objectClass.computeType(compiler);
+  InterfaceType get objectType {
+    objectClass.ensureResolved(resolution);
+    return objectClass.rawType;
+  }
 
   @override
-  InterfaceType get boolType => boolClass.computeType(compiler);
+  InterfaceType get boolType {
+    boolClass.ensureResolved(resolution);
+    return boolClass.rawType;
+  }
 
   @override
-  InterfaceType get doubleType => doubleClass.computeType(compiler);
+  InterfaceType get doubleType {
+    doubleClass.ensureResolved(resolution);
+    return doubleClass.rawType;
+  }
 
   @override
-  InterfaceType get functionType => functionClass.computeType(compiler);
+  InterfaceType get functionType {
+    functionClass.ensureResolved(resolution);
+    return functionClass.rawType;
+  }
 
   @override
-  InterfaceType get intType => intClass.computeType(compiler);
+  InterfaceType get intType {
+    intClass.ensureResolved(resolution);
+    return intClass.rawType;
+  }
+
+  @override
+  InterfaceType get resourceType {
+    resourceClass.ensureResolved(resolution);
+    return resourceClass.rawType;
+  }
 
   @override
   InterfaceType listType([DartType elementType]) {
-    InterfaceType type = listClass.computeType(compiler);
+    listClass.ensureResolved(resolution);
+    InterfaceType type = listClass.rawType;
     if (elementType == null) {
-      return listClass.rawType;
+      return type;
     }
     return type.createInstantiation([elementType]);
   }
@@ -2464,9 +1509,10 @@
   @override
   InterfaceType mapType([DartType keyType,
                          DartType valueType]) {
-    InterfaceType type = mapClass.computeType(compiler);
+    mapClass.ensureResolved(resolution);
+    InterfaceType type = mapClass.rawType;
     if (keyType == null && valueType == null) {
-      return mapClass.rawType;
+      return type;
     } else if (keyType == null) {
       keyType = const DynamicType();
     } else if (valueType == null) {
@@ -2476,46 +1522,529 @@
   }
 
   @override
-  InterfaceType get nullType => nullClass.computeType(compiler);
+  InterfaceType get nullType {
+    nullClass.ensureResolved(resolution);
+    return nullClass.rawType;
+  }
 
   @override
-  InterfaceType get numType => numClass.computeType(compiler);
+  InterfaceType get numType {
+    numClass.ensureResolved(resolution);
+    return numClass.rawType;
+  }
 
   @override
-  InterfaceType get stringType => stringClass.computeType(compiler);
+  InterfaceType get stringType {
+    stringClass.ensureResolved(resolution);
+    return stringClass.rawType;
+  }
 
   @override
-  InterfaceType get symbolType => symbolClass.computeType(compiler);
+  InterfaceType get symbolType {
+    symbolClass.ensureResolved(resolution);
+    return symbolClass.rawType;
+  }
 
   @override
-  InterfaceType get typeType => typeClass.computeType(compiler);
+  InterfaceType get typeType {
+    typeClass.ensureResolved(resolution);
+    return typeClass.rawType;
+  }
 
   @override
   InterfaceType iterableType([DartType elementType]) {
-    InterfaceType type = iterableClass.computeType(compiler);
+    iterableClass.ensureResolved(resolution);
+    InterfaceType type = iterableClass.rawType;
     if (elementType == null) {
-      return iterableClass.rawType;
+      return type;
     }
     return type.createInstantiation([elementType]);
   }
 
   @override
   InterfaceType futureType([DartType elementType]) {
-    InterfaceType type = futureClass.computeType(compiler);
+    futureClass.ensureResolved(resolution);
+    InterfaceType type = futureClass.rawType;
     if (elementType == null) {
-      return futureClass.rawType;
+      return type;
     }
     return type.createInstantiation([elementType]);
   }
 
   @override
   InterfaceType streamType([DartType elementType]) {
-    InterfaceType type = streamClass.computeType(compiler);
+    streamClass.ensureResolved(resolution);
+    InterfaceType type = streamClass.rawType;
     if (elementType == null) {
-      return streamClass.rawType;
+      return type;
     }
     return type.createInstantiation([elementType]);
   }
 }
 
-typedef void InternalErrorFunction(Spannable location, String message);
+class _CompilerDiagnosticReporter extends DiagnosticReporter {
+  final Compiler compiler;
+  final DiagnosticOptions options;
+
+  Element _currentElement;
+  bool hasCrashed = false;
+
+  /// `true` if the last diagnostic was filtered, in which case the
+  /// accompanying info message should be filtered as well.
+  bool lastDiagnosticWasFiltered = false;
+
+  /// Map containing information about the warnings and hints that have been
+  /// suppressed for each library.
+  Map<Uri, SuppressionInfo> suppressedWarnings = <Uri, SuppressionInfo>{};
+
+  _CompilerDiagnosticReporter(this.compiler, this.options);
+
+  Element get currentElement => _currentElement;
+
+  DiagnosticMessage createMessage(
+      Spannable spannable,
+      MessageKind messageKind,
+      [Map arguments = const {}]) {
+    SourceSpan span = spanFromSpannable(spannable);
+    MessageTemplate template = MessageTemplate.TEMPLATES[messageKind];
+    Message message = template.message(arguments, options.terseDiagnostics);
+    return new DiagnosticMessage(span, spannable, message);
+  }
+
+  void reportError(
+      DiagnosticMessage message,
+      [List<DiagnosticMessage> infos = const <DiagnosticMessage>[]]) {
+    reportDiagnosticInternal(message, infos, api.Diagnostic.ERROR);
+  }
+
+  void reportWarning(
+      DiagnosticMessage message,
+      [List<DiagnosticMessage> infos = const <DiagnosticMessage>[]]) {
+    reportDiagnosticInternal(message, infos, api.Diagnostic.WARNING);
+  }
+
+  void reportHint(
+      DiagnosticMessage message,
+      [List<DiagnosticMessage> infos = const <DiagnosticMessage>[]]) {
+    reportDiagnosticInternal(message, infos, api.Diagnostic.HINT);
+  }
+
+  @deprecated
+  void reportInfo(Spannable node, MessageKind messageKind,
+                  [Map arguments = const {}]) {
+    reportDiagnosticInternal(
+        createMessage(node, messageKind, arguments),
+        const <DiagnosticMessage>[],
+        api.Diagnostic.INFO);
+  }
+
+  void reportDiagnosticInternal(DiagnosticMessage message,
+                                List<DiagnosticMessage> infos,
+                                api.Diagnostic kind) {
+    if (!options.showPackageWarnings &&
+        message.spannable != NO_LOCATION_SPANNABLE) {
+      switch (kind) {
+      case api.Diagnostic.WARNING:
+      case api.Diagnostic.HINT:
+        Element element = elementFromSpannable(message.spannable);
+        if (!compiler.inUserCode(element, assumeInUserCode: true)) {
+          Uri uri = compiler.getCanonicalUri(element);
+          SuppressionInfo info =
+              suppressedWarnings.putIfAbsent(uri, () => new SuppressionInfo());
+          if (kind == api.Diagnostic.WARNING) {
+            info.warnings++;
+          } else {
+            info.hints++;
+          }
+          lastDiagnosticWasFiltered = true;
+          return;
+        }
+        break;
+      case api.Diagnostic.INFO:
+        if (lastDiagnosticWasFiltered) {
+          return;
+        }
+        break;
+      }
+    }
+    lastDiagnosticWasFiltered = false;
+    reportDiagnostic(message, infos, kind);
+  }
+
+  void reportDiagnostic(DiagnosticMessage message,
+                        List<DiagnosticMessage> infos,
+                        api.Diagnostic kind) {
+    compiler.reportDiagnostic(message, infos, kind);
+  }
+
+  /**
+   * Perform an operation, [f], returning the return value from [f].  If an
+   * error occurs then report it as having occurred during compilation of
+   * [element].  Can be nested.
+   */
+  withCurrentElement(Element element, f()) {
+    Element old = currentElement;
+    _currentElement = element;
+    try {
+      return f();
+    } on SpannableAssertionFailure catch (ex) {
+      if (!hasCrashed) {
+        reportAssertionFailure(ex);
+        pleaseReportCrash();
+      }
+      hasCrashed = true;
+      rethrow;
+    } on StackOverflowError {
+      // We cannot report anything useful in this case, because we
+      // do not have enough stack space.
+      rethrow;
+    } catch (ex) {
+      if (hasCrashed) rethrow;
+      try {
+        unhandledExceptionOnElement(element);
+      } catch (doubleFault) {
+        // Ignoring exceptions in exception handling.
+      }
+      rethrow;
+    } finally {
+      _currentElement = old;
+    }
+  }
+
+  void reportAssertionFailure(SpannableAssertionFailure ex) {
+    String message = (ex.message != null) ? tryToString(ex.message)
+                                          : tryToString(ex);
+    reportDiagnosticInternal(
+        createMessage(ex.node, MessageKind.GENERIC, {'text': message}),
+        const <DiagnosticMessage>[],
+        api.Diagnostic.CRASH);
+  }
+
+  SourceSpan spanFromTokens(Token begin, Token end, [Uri uri]) {
+    if (begin == null || end == null) {
+      // TODO(ahe): We can almost always do better. Often it is only
+      // end that is null. Otherwise, we probably know the current
+      // URI.
+      throw 'Cannot find tokens to produce error message.';
+    }
+    if (uri == null && currentElement != null) {
+      uri = currentElement.compilationUnit.script.resourceUri;
+    }
+    return new SourceSpan.fromTokens(uri, begin, end);
+  }
+
+  SourceSpan spanFromNode(Node node) {
+    return spanFromTokens(node.getBeginToken(), node.getEndToken());
+  }
+
+  SourceSpan spanFromElement(Element element) {
+    if (element != null && element.sourcePosition != null) {
+      return element.sourcePosition;
+    }
+    while (element != null && element.isSynthesized) {
+      element = element.enclosingElement;
+    }
+    if (element != null &&
+        element.sourcePosition == null &&
+        !element.isLibrary &&
+        !element.isCompilationUnit) {
+      // Sometimes, the backend fakes up elements that have no
+      // position. So we use the enclosing element instead. It is
+      // not a good error location, but cancel really is "internal
+      // error" or "not implemented yet", so the vicinity is good
+      // enough for now.
+      element = element.enclosingElement;
+      // TODO(ahe): I plan to overhaul this infrastructure anyways.
+    }
+    if (element == null) {
+      element = currentElement;
+    }
+    if (element == null) {
+      return null;
+    }
+
+    if (element.sourcePosition != null) {
+      return element.sourcePosition;
+    }
+    Token position = element.position;
+    Uri uri = element.compilationUnit.script.resourceUri;
+    return (position == null)
+        ? new SourceSpan(uri, 0, 0)
+        : spanFromTokens(position, position, uri);
+  }
+
+  SourceSpan spanFromHInstruction(HInstruction instruction) {
+    Element element = _elementFromHInstruction(instruction);
+    if (element == null) element = currentElement;
+    SourceInformation position = instruction.sourceInformation;
+    if (position == null) return spanFromElement(element);
+    return position.sourceSpan;
+  }
+
+  SourceSpan spanFromSpannable(Spannable node) {
+    // TODO(johnniwinther): Disallow `node == null` ?
+    if (node == null) return null;
+    if (node == CURRENT_ELEMENT_SPANNABLE) {
+      node = currentElement;
+    } else if (node == NO_LOCATION_SPANNABLE) {
+      if (currentElement == null) return null;
+      node = currentElement;
+    }
+    if (node is SourceSpan) {
+      return node;
+    } else if (node is Node) {
+      return spanFromNode(node);
+    } else if (node is TokenPair) {
+      return spanFromTokens(node.begin, node.end);
+    } else if (node is Token) {
+      return spanFromTokens(node, node);
+    } else if (node is HInstruction) {
+      return spanFromHInstruction(node);
+    } else if (node is Element) {
+      return spanFromElement(node);
+    } else if (node is MetadataAnnotation) {
+      Uri uri = node.annotatedElement.compilationUnit.script.resourceUri;
+      return spanFromTokens(node.beginToken, node.endToken, uri);
+    } else if (node is Local) {
+      Local local = node;
+      return spanFromElement(local.executableContext);
+    } else {
+      throw 'No error location.';
+    }
+  }
+
+  Element _elementFromHInstruction(HInstruction instruction) {
+    return instruction.sourceElement is Element
+        ? instruction.sourceElement : null;
+  }
+
+  internalError(Spannable node, reason) {
+    String message = tryToString(reason);
+    reportDiagnosticInternal(
+        createMessage(node, MessageKind.GENERIC, {'text': message}),
+        const <DiagnosticMessage>[],
+        api.Diagnostic.CRASH);
+    throw 'Internal Error: $message';
+  }
+
+  void unhandledExceptionOnElement(Element element) {
+    if (hasCrashed) return;
+    hasCrashed = true;
+    reportDiagnostic(
+        createMessage(element, MessageKind.COMPILER_CRASHED),
+        const <DiagnosticMessage>[],
+        api.Diagnostic.CRASH);
+    pleaseReportCrash();
+  }
+
+  void pleaseReportCrash() {
+    print(
+        MessageTemplate.TEMPLATES[MessageKind.PLEASE_REPORT_THE_CRASH]
+            .message({'buildId': compiler.buildId}));
+  }
+
+  /// Finds the approximate [Element] for [node]. [currentElement] is used as
+  /// the default value.
+  Element elementFromSpannable(Spannable node) {
+    Element element;
+    if (node is Element) {
+      element = node;
+    } else if (node is HInstruction) {
+      element = _elementFromHInstruction(node);
+    } else if (node is MetadataAnnotation) {
+      element = node.annotatedElement;
+    }
+    return element != null ? element : currentElement;
+  }
+
+  void log(message) {
+    Message msg = MessageTemplate.TEMPLATES[MessageKind.GENERIC]
+        .message({'text': '$message'});
+    reportDiagnostic(
+        new DiagnosticMessage(null, null, msg),
+        const <DiagnosticMessage>[],
+        api.Diagnostic.VERBOSE_INFO);
+  }
+
+  String tryToString(object) {
+    try {
+      return object.toString();
+    } catch (_) {
+      return '<exception in toString()>';
+    }
+  }
+
+  onError(Uri uri, error) {
+    try {
+      if (!hasCrashed) {
+        hasCrashed = true;
+        if (error is SpannableAssertionFailure) {
+          reportAssertionFailure(error);
+        } else {
+          reportDiagnostic(
+              createMessage(
+                  new SourceSpan(uri, 0, 0),
+                  MessageKind.COMPILER_CRASHED),
+              const <DiagnosticMessage>[],
+              api.Diagnostic.CRASH);
+        }
+        pleaseReportCrash();
+      }
+    } catch (doubleFault) {
+      // Ignoring exceptions in exception handling.
+    }
+    throw error;
+  }
+
+  void onCrashInUserCode(String message, exception, stackTrace) {
+    hasCrashed = true;
+    print('$message: ${tryToString(exception)}');
+    print(tryToString(stackTrace));
+  }
+
+  void reportSuppressedMessagesSummary() {
+    if (!options.showPackageWarnings && !options.suppressWarnings) {
+      suppressedWarnings.forEach((Uri uri, SuppressionInfo info) {
+        MessageKind kind = MessageKind.HIDDEN_WARNINGS_HINTS;
+        if (info.warnings == 0) {
+          kind = MessageKind.HIDDEN_HINTS;
+        } else if (info.hints == 0) {
+          kind = MessageKind.HIDDEN_WARNINGS;
+        }
+        MessageTemplate template = MessageTemplate.TEMPLATES[kind];
+        Message message = template.message(
+            {'warnings': info.warnings,
+             'hints': info.hints,
+             'uri': uri},
+             options.terseDiagnostics);
+        reportDiagnostic(
+            new DiagnosticMessage(null, null, message),
+            const <DiagnosticMessage>[],
+            api.Diagnostic.HINT);
+      });
+    }
+  }
+}
+
+// TODO(johnniwinther): Move [ResolverTask] here.
+class _CompilerResolution implements Resolution {
+  final Compiler compiler;
+  final Map<Element, WorldImpact> _worldImpactCache = <Element, WorldImpact>{};
+
+  _CompilerResolution(this.compiler);
+
+  @override
+  DiagnosticReporter get reporter => compiler.reporter;
+
+  @override
+  Parsing get parsing => compiler.parsing;
+
+  @override
+  CoreTypes get coreTypes => compiler.coreTypes;
+
+  @override
+  void registerClass(ClassElement cls) {
+    compiler.world.registerClass(cls);
+  }
+
+  @override
+  void resolveClass(ClassElement cls) {
+    compiler.resolver.resolveClass(cls);
+  }
+
+  @override
+  void resolveTypedef(TypedefElement typdef) {
+    compiler.resolver.resolve(typdef);
+  }
+
+  @override
+  void resolveMetadataAnnotation(MetadataAnnotation metadataAnnotation) {
+    compiler.resolver.resolveMetadataAnnotation(metadataAnnotation);
+  }
+
+  @override
+  FunctionSignature resolveSignature(FunctionElement function) {
+    return compiler.resolver.resolveSignature(function);
+  }
+
+  @override
+  DartType resolveTypeAnnotation(Element element, TypeAnnotation node) {
+    return compiler.resolver.resolveTypeAnnotation(element, node);
+  }
+
+  @override
+  WorldImpact getWorldImpact(Element element) {
+    WorldImpact worldImpact = _worldImpactCache[element];
+    assert(invariant(element, worldImpact != null,
+        message: "WorldImpact not computed for $element."));
+    return worldImpact;
+  }
+
+  @override
+  WorldImpact computeWorldImpact(Element element) {
+    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 (tree != null && !compiler.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);
+      }
+      WorldImpact worldImpact =
+          compiler.backend.resolutionCallbacks.transformImpact(
+              resolutionImpact);
+      return worldImpact;
+    });
+  }
+
+  @override
+  bool hasBeenResolved(Element element) {
+    return _worldImpactCache.containsKey(element);
+  }
+}
+
+// TODO(johnniwinther): Move [ParserTask], [PatchParserTask], [DietParserTask]
+// and [ScannerTask] here.
+class _CompilerParsing implements Parsing {
+  final Compiler compiler;
+
+  _CompilerParsing(this.compiler);
+
+  @override
+  DiagnosticReporter get reporter => compiler.reporter;
+
+  @override
+  measure(f()) => compiler.parser.measure(f);
+
+  @override
+  void parsePatchClass(ClassElement cls) {
+    compiler.patchParser.measure(() {
+      if (cls.isPatch) {
+        compiler.patchParser.parsePatchClassNode(cls);
+      }
+    });
+  }
+}
+
+class GlobalDependencyRegistry extends CodegenRegistry {
+  Setlet<Element> _otherDependencies;
+
+  GlobalDependencyRegistry(Compiler compiler)
+      : super(compiler, new TreeElementMapping(null));
+
+  void registerDependency(Element element) {
+    if (element == null) return;
+    if (_otherDependencies == null) {
+      _otherDependencies = new Setlet<Element>();
+    }
+    _otherDependencies.add(element.implementation);
+  }
+
+  Iterable<Element> get otherDependencies {
+    return _otherDependencies != null ? _otherDependencies : const <Element>[];
+  }
+}
\ No newline at end of file
diff --git a/pkg/compiler/lib/src/constant_system_dart.dart b/pkg/compiler/lib/src/constant_system_dart.dart
index f140cf5..4a15ac9 100644
--- a/pkg/compiler/lib/src/constant_system_dart.dart
+++ b/pkg/compiler/lib/src/constant_system_dart.dart
@@ -4,11 +4,13 @@
 
 library dart2js.constant_system.dart;
 
+import 'compiler.dart' show
+    Compiler;
 import 'constants/constant_system.dart';
 import 'constants/values.dart';
-import 'dart2jslib.dart' show Compiler;
 import 'dart_types.dart';
-import 'tree/tree.dart' show DartString;
+import 'tree/tree.dart' show
+    DartString;
 
 const DART_CONSTANT_SYSTEM = const DartConstantSystem();
 
@@ -432,7 +434,7 @@
     // `compiler.coreTypes.typeType` and check the backend specific value in
     // [checkConstMapKeysDontOverrideEquals] in 'members.dart'.
     return new TypeConstantValue(type,
-        compiler.backend.typeImplementation.computeType(compiler));
+        compiler.backend.typeImplementation.computeType(compiler.resolution));
   }
 
   bool isInt(ConstantValue constant) => constant.isInt;
diff --git a/pkg/compiler/lib/src/constants/constant_constructors.dart b/pkg/compiler/lib/src/constants/constant_constructors.dart
new file mode 100644
index 0000000..4cc77b3
--- /dev/null
+++ b/pkg/compiler/lib/src/constants/constant_constructors.dart
@@ -0,0 +1,386 @@
+// 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.
+
+// TODO(johnniwinther): Remove this library when all constant constructors are
+// computed during resolution.
+library dart2js.constants.constant_constructors;
+
+import '../common.dart';
+import '../dart_types.dart';
+import '../elements/elements.dart';
+import '../resolution/operators.dart';
+import '../resolution/semantic_visitor.dart';
+import '../resolution/send_resolver.dart' show
+    DeclarationResolverMixin;
+import '../resolution/send_structure.dart';
+import '../resolution/tree_elements.dart' show
+    TreeElements;
+import '../tree/tree.dart';
+import '../universe/call_structure.dart' show
+    CallStructure;
+
+import 'constructors.dart';
+import 'expressions.dart';
+
+ConstantConstructor computeConstantConstructor(ResolvedAst resolvedAst) {
+  ConstantConstructorComputer visitor =
+      new ConstantConstructorComputer(resolvedAst.elements);
+  return resolvedAst.node.accept(visitor);
+}
+
+class ConstantConstructorComputer extends SemanticVisitor
+    with SemanticDeclarationResolvedMixin,
+         DeclarationResolverMixin,
+         GetBulkMixin,
+         SetBulkMixin,
+         ErrorBulkMixin,
+         InvokeBulkMixin,
+         IndexSetBulkMixin,
+         CompoundBulkMixin,
+         SetIfNullBulkMixin,
+         UnaryBulkMixin,
+         BaseBulkMixin,
+         BinaryBulkMixin,
+         PrefixBulkMixin,
+         PostfixBulkMixin,
+         NewBulkMixin,
+         InitializerBulkMixin,
+         FunctionBulkMixin,
+         VariableBulkMixin
+    implements SemanticDeclarationVisitor, SemanticSendVisitor {
+  final Map<FieldElement, ConstantExpression> fieldMap =
+      <FieldElement, ConstantExpression>{};
+  final Map<dynamic/*int|String*/, ConstantExpression> defaultValues =
+      <dynamic/*int|String*/, ConstantExpression>{};
+
+  ConstantConstructorComputer(TreeElements elements)
+      : super(elements);
+
+  SemanticDeclarationVisitor get declVisitor => this;
+
+  SemanticSendVisitor get sendVisitor => this;
+
+  ClassElement get currentClass => currentConstructor.enclosingClass;
+
+  ConstructorElement get currentConstructor => elements.analyzedElement;
+
+  apply(Node node, [_]) => node.accept(this);
+
+  visitNode(Node node) {
+    internalError(node, 'Unhandled node $node: ${node.toDebugString()}');
+  }
+
+  @override
+  bulkHandleNode(Node node, String template, _) {
+    internalError(node, template.replaceFirst('#' , '$node'));
+  }
+
+  internalError(Node node, String message) {
+    throw new UnsupportedError(message);
+  }
+
+  ConstantConstructor visitGenerativeConstructorDeclaration(
+        FunctionExpression node,
+        ConstructorElement constructor,
+        NodeList parameters,
+        NodeList initializers,
+        Node body,
+        _) {
+    applyParameters(parameters, _);
+    ConstructedConstantExpression constructorInvocation =
+        applyInitializers(node, _);
+    return new GenerativeConstantConstructor(
+        currentClass.thisType, defaultValues, fieldMap, constructorInvocation);
+  }
+
+  ConstantConstructor visitRedirectingGenerativeConstructorDeclaration(
+      FunctionExpression node,
+      ConstructorElement constructor,
+      NodeList parameters,
+      NodeList initializers,
+      _) {
+    applyParameters(parameters, _);
+    ConstructedConstantExpression constructorInvocation =
+        applyInitializers(node, _);
+    return new RedirectingGenerativeConstantConstructor(
+        defaultValues, constructorInvocation);
+  }
+
+  ConstantConstructor visitRedirectingFactoryConstructorDeclaration(
+      FunctionExpression node,
+      ConstructorElement constructor,
+      NodeList parameters,
+      InterfaceType redirectionType,
+      ConstructorElement redirectionTarget,
+      _) {
+    List<String> argumentNames = [];
+    List<ConstantExpression> arguments = [];
+    int index = 0;
+    for (ParameterElement parameter in constructor.parameters) {
+      if (parameter.isNamed) {
+        String name = parameter.name;
+        argumentNames.add(name);
+        arguments.add(new NamedArgumentReference(name));
+      } else {
+        arguments.add(new PositionalArgumentReference(index));
+      }
+      index++;
+    }
+    CallStructure callStructure = new CallStructure(index, argumentNames);
+
+    return new RedirectingFactoryConstantConstructor(
+        new ConstructedConstantExpression(
+            redirectionType,
+            redirectionTarget,
+            callStructure,
+            arguments));
+  }
+
+  @override
+  visitFactoryConstructorDeclaration(
+      FunctionExpression node,
+      ConstructorElement constructor,
+      NodeList parameters,
+      Node body, _) {
+    // TODO(johnniwinther): Handle constant constructors with errors.
+    internalError(node, "Factory constructor cannot be constant: $node.");
+  }
+
+  applyParameters(NodeList parameters, _) {
+    computeParameterStructures(parameters).forEach((s) => s.dispatch(this, _));
+  }
+
+  visitParameterDeclaration(
+      VariableDefinitions node,
+      Node definition,
+      ParameterElement parameter,
+      int index,
+      _) {
+    // Do nothing.
+  }
+
+  visitOptionalParameterDeclaration(
+      VariableDefinitions node,
+      Node definition,
+      ParameterElement parameter,
+      ConstantExpression defaultValue,
+      int index,
+      _) {
+    assert(invariant(node, defaultValue != null));
+    defaultValues[index] = defaultValue;
+  }
+
+  visitNamedParameterDeclaration(
+      VariableDefinitions node,
+      Node definition,
+      ParameterElement parameter,
+      ConstantExpression defaultValue,
+      _) {
+    assert(invariant(node, defaultValue != null));
+    String name = parameter.name;
+    defaultValues[name] = defaultValue;
+  }
+
+  visitInitializingFormalDeclaration(
+      VariableDefinitions node,
+      Node definition,
+      InitializingFormalElement parameter,
+      int index,
+      _) {
+    fieldMap[parameter.fieldElement] = new PositionalArgumentReference(index);
+  }
+
+  visitOptionalInitializingFormalDeclaration(
+      VariableDefinitions node,
+      Node definition,
+      InitializingFormalElement parameter,
+      ConstantExpression defaultValue,
+      int index,
+      _) {
+    assert(invariant(node, defaultValue != null));
+    defaultValues[index] = defaultValue;
+    fieldMap[parameter.fieldElement] = new PositionalArgumentReference(index);
+  }
+
+  visitNamedInitializingFormalDeclaration(
+      VariableDefinitions node,
+      Node definition,
+      InitializingFormalElement parameter,
+      ConstantExpression defaultValue,
+      _) {
+    assert(invariant(node, defaultValue != null));
+    String name = parameter.name;
+    defaultValues[name] = defaultValue;
+    fieldMap[parameter.fieldElement] = new NamedArgumentReference(name);
+  }
+
+  /// Apply this visitor to the constructor [initializers].
+  ConstructedConstantExpression applyInitializers(
+      FunctionExpression constructor, _) {
+    ConstructedConstantExpression constructorInvocation;
+    InitializersStructure initializers =
+        computeInitializersStructure(constructor);
+    for (InitializerStructure structure in initializers.initializers) {
+      if (structure.isConstructorInvoke) {
+        constructorInvocation = structure.dispatch(this, _);
+      } else {
+        structure.dispatch(this, _);
+      }
+    }
+    return constructorInvocation;
+  }
+
+  visitFieldInitializer(
+      SendSet node,
+      FieldElement field,
+      Node initializer,
+      _) {
+    fieldMap[field] = apply(initializer);
+  }
+
+  visitParameterGet(
+      Send node,
+      ParameterElement parameter,
+      _) {
+    if (parameter.isNamed) {
+      return new NamedArgumentReference(parameter.name);
+    } else {
+      return new PositionalArgumentReference(
+          parameter.functionDeclaration.parameters.indexOf(parameter));
+    }
+  }
+
+  ConstructedConstantExpression visitSuperConstructorInvoke(
+      Send node,
+      ConstructorElement superConstructor,
+      InterfaceType type,
+      NodeList arguments,
+      CallStructure callStructure,
+      _) {
+    List<ConstantExpression> argumentExpression =
+        arguments.nodes.map((a) => apply(a)).toList();
+    return new ConstructedConstantExpression(
+        type,
+        superConstructor,
+        callStructure,
+        argumentExpression);
+  }
+
+  ConstructedConstantExpression visitImplicitSuperConstructorInvoke(
+      FunctionExpression node,
+      ConstructorElement superConstructor,
+      InterfaceType type,
+      _) {
+     return new ConstructedConstantExpression(
+         type,
+         superConstructor,
+         CallStructure.NO_ARGS,
+         const <ConstantExpression>[]);
+  }
+
+  ConstructedConstantExpression visitThisConstructorInvoke(
+      Send node,
+      ConstructorElement thisConstructor,
+      NodeList arguments,
+      CallStructure callStructure,
+      _) {
+    List<ConstantExpression> argumentExpression =
+        arguments.nodes.map((a) => apply(a)).toList();
+    return new ConstructedConstantExpression(
+        currentClass.thisType,
+        thisConstructor,
+        callStructure,
+        argumentExpression);
+  }
+
+  @override
+  ConstantExpression visitBinary(
+      Send node,
+      Node left,
+      BinaryOperator operator,
+      Node right,
+      _) {
+    return new BinaryConstantExpression(
+        apply(left), operator, apply(right));
+  }
+
+
+  @override
+  ConstantExpression visitUnary(
+      Send node,
+      UnaryOperator operator,
+      Node expression,
+      _) {
+    return new UnaryConstantExpression(
+        operator, apply(expression));
+  }
+
+  @override
+  ConstantExpression visitStaticFieldGet(
+      Send node,
+      FieldElement field,
+      _) {
+    return new VariableConstantExpression(field);
+  }
+
+  @override
+  ConstantExpression visitTopLevelFieldGet(
+      Send node,
+      FieldElement field,
+      _) {
+    return new VariableConstantExpression(field);
+  }
+
+  @override
+  ConstantExpression visitLiteralInt(LiteralInt node) {
+    return new IntConstantExpression(node.value);
+  }
+
+  @override
+  ConstantExpression visitLiteralBool(LiteralBool node) {
+    return new BoolConstantExpression(node.value);
+  }
+
+  @override
+  ConstantExpression visitLiteralNull(LiteralNull node) {
+    return new NullConstantExpression();
+  }
+
+  @override
+  ConstantExpression visitLiteralString(LiteralString node) {
+    return new StringConstantExpression(node.dartString.slowToString());
+  }
+
+  @override
+  ConstantExpression visitConditional(Conditional node) {
+    return new ConditionalConstantExpression(
+        apply(node.condition),
+        apply(node.thenExpression),
+        apply(node.elseExpression));
+  }
+
+  @override
+  ConstantExpression visitParenthesizedExpression(ParenthesizedExpression node) {
+    return apply(node.expression);
+  }
+
+  @override
+  ConstantExpression visitTopLevelFunctionInvoke(
+      Send node,
+      MethodElement function,
+      NodeList arguments,
+      CallStructure callStructure,
+      _) {
+    if (function.name != 'identical' || !function.library.isDartCore) {
+      throw new UnsupportedError("Unexpected function call: $function");
+    }
+    return new IdenticalConstantExpression(
+        apply(arguments.nodes.head), apply(arguments.nodes.tail.head));
+  }
+
+  @override
+  ConstantExpression visitNamedArgument(NamedArgument node) {
+    return apply(node.expression);
+  }
+}
\ No newline at end of file
diff --git a/pkg/compiler/lib/src/constants/constant_system.dart b/pkg/compiler/lib/src/constants/constant_system.dart
index 085fe29..d99d795 100644
--- a/pkg/compiler/lib/src/constants/constant_system.dart
+++ b/pkg/compiler/lib/src/constants/constant_system.dart
@@ -5,9 +5,11 @@
 library dart2js.constant_system;
 
 import '../dart_types.dart';
-import '../dart2jslib.dart' show Compiler;
+import '../compiler.dart' show
+    Compiler;
 import '../resolution/operators.dart';
-import '../tree/tree.dart' show DartString;
+import '../tree/tree.dart' show
+    DartString;
 import 'values.dart';
 
 abstract class Operation {
diff --git a/pkg/compiler/lib/src/constants/constructors.dart b/pkg/compiler/lib/src/constants/constructors.dart
index 1e588a8..7faf593 100644
--- a/pkg/compiler/lib/src/constants/constructors.dart
+++ b/pkg/compiler/lib/src/constants/constructors.dart
@@ -4,374 +4,252 @@
 
 library dart2js.constants.constructors;
 
-import '../dart2jslib.dart';
 import '../dart_types.dart';
-import '../elements/elements.dart';
-import '../resolution/resolution.dart';
-import '../resolution/operators.dart';
-import '../resolution/semantic_visitor.dart';
-import '../resolution/send_structure.dart';
-import '../tree/tree.dart';
-import '../universe/universe.dart' show CallStructure;
+import '../elements/elements.dart' show
+    ConstructorElement,
+    FieldElement;
+import '../universe/call_structure.dart' show
+    CallStructure;
+import '../util/util.dart';
+import 'evaluation.dart';
 import 'expressions.dart';
 
-ConstantConstructor computeConstantConstructor(ResolvedAst resolvedAst) {
-  ConstantConstructorComputer visitor =
-      new ConstantConstructorComputer(resolvedAst.elements);
-  return resolvedAst.node.accept(visitor);
+enum ConstantConstructorKind {
+  GENERATIVE,
+  REDIRECTING_GENERATIVE,
+  REDIRECTING_FACTORY,
 }
 
-class ConstantConstructorComputer extends SemanticVisitor
-    with SemanticDeclarationResolvedMixin,
-         DeclarationResolverMixin,
-         GetBulkMixin,
-         SetBulkMixin,
-         ErrorBulkMixin,
-         InvokeBulkMixin,
-         IndexSetBulkMixin,
-         CompoundBulkMixin,
-         UnaryBulkMixin,
-         BaseBulkMixin,
-         BinaryBulkMixin,
-         PrefixBulkMixin,
-         PostfixBulkMixin,
-         NewBulkMixin,
-         InitializerBulkMixin,
-         FunctionBulkMixin,
-         VariableBulkMixin
-    implements SemanticDeclarationVisitor, SemanticSendVisitor {
-  final Map<FieldElement, ConstantExpression> fieldMap =
-      <FieldElement, ConstantExpression>{};
-  final Map<dynamic/*int|String*/, ConstantExpression> defaultValues =
-      <dynamic/*int|String*/, ConstantExpression>{};
+/// Definition of a constant constructor.
+abstract class ConstantConstructor {
+  ConstantConstructorKind get kind;
 
-  ConstantConstructorComputer(TreeElements elements)
-      : super(elements);
+  /// Computes the type of the instance created in a const constructor
+  /// invocation with type [newType].
+  InterfaceType computeInstanceType(InterfaceType newType);
 
-  SemanticDeclarationVisitor get declVisitor => this;
+  /// Computes the constant expressions of the fields of the created instance
+  /// in a const constructor invocation with [arguments].
+  Map<FieldElement, ConstantExpression> computeInstanceFields(
+      List<ConstantExpression> arguments,
+      CallStructure callStructure);
 
-  SemanticSendVisitor get sendVisitor => this;
+  accept(ConstantConstructorVisitor visitor, arg);
+}
 
-  ClassElement get currentClass => currentConstructor.enclosingClass;
+abstract class ConstantConstructorVisitor<R, A> {
+  const ConstantConstructorVisitor();
 
-  ConstructorElement get currentConstructor => elements.analyzedElement;
-
-  apply(Node node, [_]) => node.accept(this);
-
-  visitNode(Node node) {
-    internalError(node, 'Unhandled node $node: ${node.toDebugString()}');
+  R visit(ConstantConstructor constantConstructor, A context) {
+    return constantConstructor.accept(this, context);
   }
 
-  @override
-  bulkHandleNode(Node node, String template, _) {
-    internalError(node, template.replaceFirst('#' , '$node'));
+  R visitGenerative(GenerativeConstantConstructor constructor, A arg);
+  R visitRedirectingGenerative(
+      RedirectingGenerativeConstantConstructor constructor, A arg);
+  R visitRedirectingFactory(
+      RedirectingFactoryConstantConstructor constructor, A arg);
+}
+
+/// A generative constant constructor.
+class GenerativeConstantConstructor implements ConstantConstructor{
+  final InterfaceType type;
+  final Map<dynamic/*int|String*/, ConstantExpression> defaultValues;
+  final Map<FieldElement, ConstantExpression> fieldMap;
+  final ConstructedConstantExpression superConstructorInvocation;
+
+  GenerativeConstantConstructor(
+      this.type,
+      this.defaultValues,
+      this.fieldMap,
+      this.superConstructorInvocation);
+
+  ConstantConstructorKind get kind => ConstantConstructorKind.GENERATIVE;
+
+  InterfaceType computeInstanceType(InterfaceType newType) {
+    return type.substByContext(newType);
   }
 
-  internalError(Node node, String message) {
-    throw new UnsupportedError(message);
+  Map<FieldElement, ConstantExpression> computeInstanceFields(
+      List<ConstantExpression> arguments,
+      CallStructure callStructure) {
+    NormalizedArguments args = new NormalizedArguments(
+        defaultValues, callStructure, arguments);
+    Map<FieldElement, ConstantExpression> appliedFieldMap =
+        applyFields(args, superConstructorInvocation);
+    fieldMap.forEach((FieldElement field, ConstantExpression constant) {
+     appliedFieldMap[field] = constant.apply(args);
+    });
+    return appliedFieldMap;
   }
 
-  ConstantConstructor visitGenerativeConstructorDeclaration(
-        FunctionExpression node,
-        ConstructorElement constructor,
-        NodeList parameters,
-        NodeList initializers,
-        Node body,
-        _) {
-    applyParameters(parameters, _);
-    ConstructedConstantExpression constructorInvocation =
-        applyInitializers(node, _);
-    return new GenerativeConstantConstructor(
-        currentClass.thisType, defaultValues, fieldMap, constructorInvocation);
+  accept(ConstantConstructorVisitor visitor, arg) {
+    return visitor.visitGenerative(this, arg);
   }
 
-  ConstantConstructor visitRedirectingGenerativeConstructorDeclaration(
-      FunctionExpression node,
-      ConstructorElement constructor,
-      NodeList parameters,
-      NodeList initializers,
-      _) {
-    applyParameters(parameters, _);
-    ConstructedConstantExpression constructorInvocation =
-        applyInitializers(node, _);
-    return new RedirectingGenerativeConstantConstructor(
-        defaultValues, constructorInvocation);
+  int get hashCode {
+    int hash = Hashing.objectHash(type);
+    hash = Hashing.mapHash(defaultValues, hash);
+    hash = Hashing.mapHash(fieldMap, hash);
+    return Hashing.objectHash(superConstructorInvocation, hash);
   }
 
-  ConstantConstructor visitRedirectingFactoryConstructorDeclaration(
-      FunctionExpression node,
-      ConstructorElement constructor,
-      NodeList parameters,
-      InterfaceType redirectionType,
-      ConstructorElement redirectionTarget,
-      _) {
-    List<String> argumentNames = [];
-    List<ConstantExpression> arguments = [];
-    int index = 0;
-    for (ParameterElement parameter in constructor.parameters) {
-      if (parameter.isNamed) {
-        String name = parameter.name;
-        argumentNames.add(name);
-        arguments.add(new NamedArgumentReference(name));
-      } else {
-        arguments.add(new PositionalArgumentReference(index));
-      }
-      index++;
+  bool operator ==(other) {
+    if (identical(this, other)) return true;
+    if (other is! GenerativeConstantConstructor) return false;
+    return
+        type == other.type &&
+        superConstructorInvocation == other.superConstructorInvocation &&
+        mapEquals(defaultValues, other.defaultValues) &&
+        mapEquals(fieldMap, other.fieldMap);
+  }
+
+  String toString() {
+    StringBuffer sb = new StringBuffer();
+    sb.write("{'type': $type");
+    defaultValues.forEach((key, ConstantExpression expression) {
+      sb.write(",\n 'default:${key}': ${expression.getText()}");
+    });
+    fieldMap.forEach((FieldElement field, ConstantExpression expression) {
+      sb.write(",\n 'field:${field}': ${expression.getText()}");
+    });
+    if (superConstructorInvocation != null) {
+      sb.write(",\n 'constructor: ${superConstructorInvocation.getText()}");
     }
-    CallStructure callStructure = new CallStructure(index, argumentNames);
-
-    return new RedirectingFactoryConstantConstructor(
-        new ConstructedConstantExpression(
-            redirectionType,
-            redirectionTarget,
-            callStructure,
-            arguments));
+    sb.write("}");
+    return sb.toString();
   }
 
-  @override
-  visitFactoryConstructorDeclaration(
-      FunctionExpression node,
-      ConstructorElement constructor,
-      NodeList parameters,
-      Node body, _) {
-    // TODO(johnniwinther): Handle constant constructors with errors.
-    internalError(node, "Factory constructor cannot be constant: $node.");
-  }
-
-  applyParameters(NodeList parameters, _) {
-    computeParameterStructures(parameters).forEach((s) => s.dispatch(this, _));
-  }
-
-  visitParameterDeclaration(
-      VariableDefinitions node,
-      Node definition,
-      ParameterElement parameter,
-      int index,
-      _) {
-    // Do nothing.
-  }
-
-  visitOptionalParameterDeclaration(
-      VariableDefinitions node,
-      Node definition,
-      ParameterElement parameter,
-      ConstantExpression defaultValue,
-      int index,
-      _) {
-    assert(invariant(node, defaultValue != null));
-    defaultValues[index] = defaultValue;
-  }
-
-  visitNamedParameterDeclaration(
-      VariableDefinitions node,
-      Node definition,
-      ParameterElement parameter,
-      ConstantExpression defaultValue,
-      _) {
-    assert(invariant(node, defaultValue != null));
-    String name = parameter.name;
-    defaultValues[name] = defaultValue;
-  }
-
-  visitInitializingFormalDeclaration(
-      VariableDefinitions node,
-      Node definition,
-      InitializingFormalElement parameter,
-      int index,
-      _) {
-    fieldMap[parameter.fieldElement] = new PositionalArgumentReference(index);
-  }
-
-  visitOptionalInitializingFormalDeclaration(
-      VariableDefinitions node,
-      Node definition,
-      InitializingFormalElement parameter,
-      ConstantExpression defaultValue,
-      int index,
-      _) {
-    assert(invariant(node, defaultValue != null));
-    defaultValues[index] = defaultValue;
-    fieldMap[parameter.fieldElement] = new PositionalArgumentReference(index);
-  }
-
-  visitNamedInitializingFormalDeclaration(
-      VariableDefinitions node,
-      Node definition,
-      InitializingFormalElement parameter,
-      ConstantExpression defaultValue,
-      _) {
-    assert(invariant(node, defaultValue != null));
-    String name = parameter.name;
-    defaultValues[name] = defaultValue;
-    fieldMap[parameter.fieldElement] = new NamedArgumentReference(name);
-  }
-
-  /// Apply this visitor to the constructor [initializers].
-  ConstructedConstantExpression applyInitializers(
-      FunctionExpression constructor, _) {
-    ConstructedConstantExpression constructorInvocation;
-    InitializersStructure initializers =
-        computeInitializersStructure(constructor);
-    for (InitializerStructure structure in initializers.initializers) {
-      if (structure.isConstructorInvoke) {
-        constructorInvocation = structure.dispatch(this, _);
-      } else {
-        structure.dispatch(this, _);
+  static bool mapEquals(Map map1, Map map2) {
+    if (map1.length != map1.length) return false;
+    for (var key in map1.keys) {
+      if (map1[key] != map2[key]) {
+        return false;
       }
     }
-    return constructorInvocation;
+    return true;
   }
 
-  visitFieldInitializer(
-      SendSet node,
-      FieldElement field,
-      Node initializer,
-      _) {
-    fieldMap[field] = apply(initializer);
-  }
-
-  visitParameterGet(
-      Send node,
-      ParameterElement parameter,
-      _) {
-    if (parameter.isNamed) {
-      return new NamedArgumentReference(parameter.name);
-    } else {
-      return new PositionalArgumentReference(
-          parameter.functionDeclaration.parameters.indexOf(parameter));
+  /// Creates the field-to-constant map from applying [args] to
+  /// [constructorInvocation]. If [constructorInvocation] is `null`, an empty
+  /// map is created.
+  static Map<FieldElement, ConstantExpression> applyFields(
+      NormalizedArguments args,
+      ConstructedConstantExpression constructorInvocation) {
+    Map<FieldElement, ConstantExpression> appliedFieldMap =
+        <FieldElement, ConstantExpression>{};
+    if (constructorInvocation != null) {
+      Map<FieldElement, ConstantExpression> fieldMap =
+          constructorInvocation.computeInstanceFields();
+      fieldMap.forEach((FieldElement field, ConstantExpression constant) {
+        appliedFieldMap[field] = constant.apply(args);
+      });
     }
+    return appliedFieldMap;
+  }
+}
+
+/// A redirecting generative constant constructor.
+class RedirectingGenerativeConstantConstructor implements ConstantConstructor {
+  final Map<dynamic/*int|String*/, ConstantExpression> defaultValues;
+  final ConstructedConstantExpression thisConstructorInvocation;
+
+  RedirectingGenerativeConstantConstructor(
+      this.defaultValues,
+      this.thisConstructorInvocation);
+
+  ConstantConstructorKind get kind {
+    return ConstantConstructorKind.REDIRECTING_GENERATIVE;
   }
 
-  ConstructedConstantExpression visitSuperConstructorInvoke(
-      Send node,
-      ConstructorElement superConstructor,
-      InterfaceType type,
-      NodeList arguments,
-      CallStructure callStructure,
-      _) {
-    List<ConstantExpression> argumentExpression =
-        arguments.nodes.map((a) => apply(a)).toList();
-    return new ConstructedConstantExpression(
-        type,
-        superConstructor,
-        callStructure,
-        argumentExpression);
+  InterfaceType computeInstanceType(InterfaceType newType) {
+    return thisConstructorInvocation.computeInstanceType()
+        .substByContext(newType);
   }
 
-  ConstructedConstantExpression visitImplicitSuperConstructorInvoke(
-      FunctionExpression node,
-      ConstructorElement superConstructor,
-      InterfaceType type,
-      _) {
-     return new ConstructedConstantExpression(
-         type,
-         superConstructor,
-         CallStructure.NO_ARGS,
-         const <ConstantExpression>[]);
+  Map<FieldElement, ConstantExpression> computeInstanceFields(
+      List<ConstantExpression> arguments,
+      CallStructure callStructure) {
+    NormalizedArguments args =
+        new NormalizedArguments(defaultValues, callStructure, arguments);
+    Map<FieldElement, ConstantExpression> appliedFieldMap =
+        GenerativeConstantConstructor.applyFields(
+            args, thisConstructorInvocation);
+    return appliedFieldMap;
   }
 
-  ConstructedConstantExpression visitThisConstructorInvoke(
-      Send node,
-      ConstructorElement thisConstructor,
-      NodeList arguments,
-      CallStructure callStructure,
-      _) {
-    List<ConstantExpression> argumentExpression =
-        arguments.nodes.map((a) => apply(a)).toList();
-    return new ConstructedConstantExpression(
-        currentClass.thisType,
-        thisConstructor,
-        callStructure,
-        argumentExpression);
+  accept(ConstantConstructorVisitor visitor, arg) {
+    return visitor.visitRedirectingGenerative(this, arg);
   }
 
-  @override
-  ConstantExpression visitBinary(
-      Send node,
-      Node left,
-      BinaryOperator operator,
-      Node right,
-      _) {
-    return new BinaryConstantExpression(
-        apply(left), operator, apply(right));
+  int get hashCode {
+    int hash = Hashing.objectHash(thisConstructorInvocation);
+    return Hashing.mapHash(defaultValues, hash);
   }
 
-
-  @override
-  ConstantExpression visitUnary(
-      Send node,
-      UnaryOperator operator,
-      Node expression,
-      _) {
-    return new UnaryConstantExpression(
-        operator, apply(expression));
+  bool operator ==(other) {
+    if (identical(this, other)) return true;
+    if (other is! RedirectingGenerativeConstantConstructor) return false;
+    return
+        thisConstructorInvocation == other.thisConstructorInvocation &&
+        GenerativeConstantConstructor.mapEquals(
+            defaultValues, other.defaultValues);
   }
 
-  @override
-  ConstantExpression visitStaticFieldGet(
-      Send node,
-      FieldElement field,
-      _) {
-    return new VariableConstantExpression(field);
+  String toString() {
+    StringBuffer sb = new StringBuffer();
+    sb.write("{'type': ${thisConstructorInvocation.type}");
+    defaultValues.forEach((key, ConstantExpression expression) {
+      sb.write(",\n 'default:${key}': ${expression.getText()}");
+    });
+    sb.write(",\n 'constructor': ${thisConstructorInvocation.getText()}");
+    sb.write("}");
+    return sb.toString();
+  }
+}
+
+/// A redirecting factory constant constructor.
+class RedirectingFactoryConstantConstructor implements ConstantConstructor {
+  final ConstructedConstantExpression targetConstructorInvocation;
+
+  RedirectingFactoryConstantConstructor(this.targetConstructorInvocation);
+
+  ConstantConstructorKind get kind {
+    return ConstantConstructorKind.REDIRECTING_FACTORY;
   }
 
-  @override
-  ConstantExpression visitTopLevelFieldGet(
-      Send node,
-      FieldElement field,
-      _) {
-    return new VariableConstantExpression(field);
+  InterfaceType computeInstanceType(InterfaceType newType) {
+    return targetConstructorInvocation.computeInstanceType()
+        .substByContext(newType);
   }
 
-  @override
-  ConstantExpression visitLiteralInt(LiteralInt node) {
-    return new IntConstantExpression(node.value);
+  Map<FieldElement, ConstantExpression> computeInstanceFields(
+      List<ConstantExpression> arguments,
+      CallStructure callStructure) {
+    ConstantConstructor constantConstructor =
+        targetConstructorInvocation.target.constantConstructor;
+    return constantConstructor.computeInstanceFields(arguments, callStructure);
   }
 
-  @override
-  ConstantExpression visitLiteralBool(LiteralBool node) {
-    return new BoolConstantExpression(node.value);
+  accept(ConstantConstructorVisitor visitor, arg) {
+    return visitor.visitRedirectingFactory(this, arg);
   }
 
-  @override
-  ConstantExpression visitLiteralNull(LiteralNull node) {
-    return new NullConstantExpression();
+  int get hashCode {
+    return Hashing.objectHash(targetConstructorInvocation);
   }
 
-  @override
-  ConstantExpression visitLiteralString(LiteralString node) {
-    return new StringConstantExpression(node.dartString.slowToString());
+  bool operator ==(other) {
+    if (identical(this, other)) return true;
+    if (other is! RedirectingFactoryConstantConstructor) return false;
+    return targetConstructorInvocation == other.targetConstructorInvocation;
   }
 
-  @override
-  ConstantExpression visitConditional(Conditional node) {
-    return new ConditionalConstantExpression(
-        apply(node.condition),
-        apply(node.thenExpression),
-        apply(node.elseExpression));
+  String toString() {
+    StringBuffer sb = new StringBuffer();
+    sb.write("{");
+    sb.write("'constructor': ${targetConstructorInvocation.getText()}");
+    sb.write("}");
+    return sb.toString();
   }
-
-  @override
-  ConstantExpression visitParenthesizedExpression(ParenthesizedExpression node) {
-    return apply(node.expression);
-  }
-
-  @override
-  ConstantExpression visitTopLevelFunctionInvoke(
-      Send node,
-      MethodElement function,
-      NodeList arguments,
-      CallStructure callStructure,
-      _) {
-    if (function.name != 'identical' || !function.library.isDartCore) {
-      throw new UnsupportedError("Unexpected function call: $function");
-    }
-    return new IdenticalConstantExpression(
-        apply(arguments.nodes.head), apply(arguments.nodes.tail.head));
-  }
-
-  @override
-  ConstantExpression visitNamedArgument(NamedArgument node) {
-    return apply(node.expression);
-  }
-}
\ No newline at end of file
+}
diff --git a/pkg/compiler/lib/src/constants/evaluation.dart b/pkg/compiler/lib/src/constants/evaluation.dart
new file mode 100644
index 0000000..176d736
--- /dev/null
+++ b/pkg/compiler/lib/src/constants/evaluation.dart
@@ -0,0 +1,49 @@
+// 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 dart2js.constants.evaluation;
+
+import '../compiler.dart' show
+    Compiler;
+import '../universe/call_structure.dart' show
+    CallStructure;
+import 'expressions.dart';
+
+/// Environment used for evaluating constant expressions.
+abstract class Environment {
+  // TODO(johnniwinther): Replace this with [CoreTypes] and maybe [Backend].
+  Compiler get compiler;
+
+  /// Read environments string passed in using the '-Dname=value' option.
+  String readFromEnvironment(String name);
+}
+
+/// The normalized arguments passed to a const constructor computed from the
+/// actual [arguments] and the [defaultValues] of the called construrctor.
+class NormalizedArguments {
+  final Map<dynamic/*int|String*/, ConstantExpression> defaultValues;
+  final CallStructure callStructure;
+  final List<ConstantExpression> arguments;
+
+  NormalizedArguments(this.defaultValues, this.callStructure, this.arguments);
+
+  /// Returns the normalized named argument [name].
+  ConstantExpression getNamedArgument(String name) {
+    int index = callStructure.namedArguments.indexOf(name);
+    if (index == -1) {
+      // The named argument is not provided.
+      return defaultValues[name];
+    }
+    return arguments[index + callStructure.positionalArgumentCount];
+  }
+
+  /// Returns the normalized [index]th positional argument.
+  ConstantExpression getPositionalArgument(int index) {
+    if (index >= callStructure.positionalArgumentCount) {
+      // The positional argument is not provided.
+      return defaultValues[index];
+    }
+    return arguments[index];
+  }
+}
diff --git a/pkg/compiler/lib/src/constants/expressions.dart b/pkg/compiler/lib/src/constants/expressions.dart
index 4b1060c..f1ad90b 100644
--- a/pkg/compiler/lib/src/constants/expressions.dart
+++ b/pkg/compiler/lib/src/constants/expressions.dart
@@ -4,9 +4,9 @@
 
 library dart2js.constants.expressions;
 
+import '../common.dart';
 import '../constants/constant_system.dart';
 import '../core_types.dart';
-import '../dart2jslib.dart' show assertDebugMode, Compiler;
 import '../dart_types.dart';
 import '../elements/elements.dart' show
     ConstructorElement,
@@ -16,9 +16,11 @@
     PrefixElement,
     VariableElement;
 import '../resolution/operators.dart';
-import '../tree/tree.dart' show DartString;
-import '../universe/universe.dart' show CallStructure;
-import '../util/util.dart';
+import '../tree/tree.dart' show
+    DartString;
+import '../universe/call_structure.dart' show
+    CallStructure;
+import 'evaluation.dart';
 import 'values.dart';
 
 enum ConstantExpressionKind {
@@ -51,284 +53,6 @@
   NAMED_REFERENCE,
 }
 
-/// Environment used for evaluating constant expressions.
-abstract class Environment {
-  // TODO(johnniwinther): Replace this with [CoreTypes] and maybe [Backend].
-  Compiler get compiler;
-
-  /// Read environments string passed in using the '-Dname=value' option.
-  String readFromEnvironment(String name);
-}
-
-/// The normalized arguments passed to a const constructor computed from the
-/// actual [arguments] and the [defaultValues] of the called construrctor.
-class NormalizedArguments {
-  final Map<dynamic/*int|String*/, ConstantExpression> defaultValues;
-  final CallStructure callStructure;
-  final List<ConstantExpression> arguments;
-
-  NormalizedArguments(this.defaultValues, this.callStructure, this.arguments);
-
-  /// Returns the normalized named argument [name].
-  ConstantExpression getNamedArgument(String name) {
-    int index = callStructure.namedArguments.indexOf(name);
-    if (index == -1) {
-      // The named argument is not provided.
-      return defaultValues[name];
-    }
-    return arguments[index + callStructure.positionalArgumentCount];
-  }
-
-  /// Returns the normalized [index]th positional argument.
-  ConstantExpression getPositionalArgument(int index) {
-    if (index >= callStructure.positionalArgumentCount) {
-      // The positional argument is not provided.
-      return defaultValues[index];
-    }
-    return arguments[index];
-  }
-}
-
-enum ConstantConstructorKind {
-  GENERATIVE,
-  REDIRECTING_GENERATIVE,
-  REDIRECTING_FACTORY,
-}
-
-/// Definition of a constant constructor.
-abstract class ConstantConstructor {
-  ConstantConstructorKind get kind;
-
-  /// Computes the type of the instance created in a const constructor
-  /// invocation with type [newType].
-  InterfaceType computeInstanceType(InterfaceType newType);
-
-  /// Computes the constant expressions of the fields of the created instance
-  /// in a const constructor invocation with [arguments].
-  Map<FieldElement, ConstantExpression> computeInstanceFields(
-      List<ConstantExpression> arguments,
-      CallStructure callStructure);
-
-  accept(ConstantConstructorVisitor visitor, arg);
-}
-
-abstract class ConstantConstructorVisitor<R, A> {
-  const ConstantConstructorVisitor();
-
-  R visit(ConstantConstructor constantConstructor, A context) {
-    return constantConstructor.accept(this, context);
-  }
-
-  R visitGenerative(GenerativeConstantConstructor constructor, A arg);
-  R visitRedirectingGenerative(
-      RedirectingGenerativeConstantConstructor constructor, A arg);
-  R visitRedirectingFactory(
-      RedirectingFactoryConstantConstructor constructor, A arg);
-}
-
-/// A generative constant constructor.
-class GenerativeConstantConstructor implements ConstantConstructor{
-  final InterfaceType type;
-  final Map<dynamic/*int|String*/, ConstantExpression> defaultValues;
-  final Map<FieldElement, ConstantExpression> fieldMap;
-  final ConstructedConstantExpression superConstructorInvocation;
-
-  GenerativeConstantConstructor(
-      this.type,
-      this.defaultValues,
-      this.fieldMap,
-      this.superConstructorInvocation);
-
-  ConstantConstructorKind get kind => ConstantConstructorKind.GENERATIVE;
-
-  InterfaceType computeInstanceType(InterfaceType newType) {
-    return type.substByContext(newType);
-  }
-
-  Map<FieldElement, ConstantExpression> computeInstanceFields(
-      List<ConstantExpression> arguments,
-      CallStructure callStructure) {
-    NormalizedArguments args = new NormalizedArguments(
-        defaultValues, callStructure, arguments);
-    Map<FieldElement, ConstantExpression> appliedFieldMap =
-        applyFields(args, superConstructorInvocation);
-    fieldMap.forEach((FieldElement field, ConstantExpression constant) {
-     appliedFieldMap[field] = constant.apply(args);
-    });
-    return appliedFieldMap;
-  }
-
-  accept(ConstantConstructorVisitor visitor, arg) {
-    return visitor.visitGenerative(this, arg);
-  }
-
-  int get hashCode {
-    int hash = Hashing.objectHash(type);
-    hash = Hashing.mapHash(defaultValues, hash);
-    hash = Hashing.mapHash(fieldMap, hash);
-    return Hashing.objectHash(superConstructorInvocation, hash);
-  }
-
-  bool operator ==(other) {
-    if (identical(this, other)) return true;
-    if (other is! GenerativeConstantConstructor) return false;
-    return
-        type == other.type &&
-        superConstructorInvocation == other.superConstructorInvocation &&
-        mapEquals(defaultValues, other.defaultValues) &&
-        mapEquals(fieldMap, other.fieldMap);
-  }
-
-  String toString() {
-    StringBuffer sb = new StringBuffer();
-    sb.write("{'type': $type");
-    defaultValues.forEach((key, ConstantExpression expression) {
-      sb.write(",\n 'default:${key}': ${expression.getText()}");
-    });
-    fieldMap.forEach((FieldElement field, ConstantExpression expression) {
-      sb.write(",\n 'field:${field}': ${expression.getText()}");
-    });
-    if (superConstructorInvocation != null) {
-      sb.write(",\n 'constructor: ${superConstructorInvocation.getText()}");
-    }
-    sb.write("}");
-    return sb.toString();
-  }
-
-  static bool mapEquals(Map map1, Map map2) {
-    if (map1.length != map1.length) return false;
-    for (var key in map1.keys) {
-      if (map1[key] != map2[key]) {
-        return false;
-      }
-    }
-    return true;
-  }
-
-  /// Creates the field-to-constant map from applying [args] to
-  /// [constructorInvocation]. If [constructorInvocation] is `null`, an empty
-  /// map is created.
-  static Map<FieldElement, ConstantExpression> applyFields(
-      NormalizedArguments args,
-      ConstructedConstantExpression constructorInvocation) {
-    Map<FieldElement, ConstantExpression> appliedFieldMap =
-        <FieldElement, ConstantExpression>{};
-    if (constructorInvocation != null) {
-      Map<FieldElement, ConstantExpression> fieldMap =
-          constructorInvocation.computeInstanceFields();
-      fieldMap.forEach((FieldElement field, ConstantExpression constant) {
-        appliedFieldMap[field] = constant.apply(args);
-      });
-    }
-    return appliedFieldMap;
-  }
-}
-
-/// A redirecting generative constant constructor.
-class RedirectingGenerativeConstantConstructor implements ConstantConstructor {
-  final Map<dynamic/*int|String*/, ConstantExpression> defaultValues;
-  final ConstructedConstantExpression thisConstructorInvocation;
-
-  RedirectingGenerativeConstantConstructor(
-      this.defaultValues,
-      this.thisConstructorInvocation);
-
-  ConstantConstructorKind get kind {
-    return ConstantConstructorKind.REDIRECTING_GENERATIVE;
-  }
-
-  InterfaceType computeInstanceType(InterfaceType newType) {
-    return thisConstructorInvocation.computeInstanceType()
-        .substByContext(newType);
-  }
-
-  Map<FieldElement, ConstantExpression> computeInstanceFields(
-      List<ConstantExpression> arguments,
-      CallStructure callStructure) {
-    NormalizedArguments args =
-        new NormalizedArguments(defaultValues, callStructure, arguments);
-    Map<FieldElement, ConstantExpression> appliedFieldMap =
-        GenerativeConstantConstructor.applyFields(
-            args, thisConstructorInvocation);
-    return appliedFieldMap;
-  }
-
-  accept(ConstantConstructorVisitor visitor, arg) {
-    return visitor.visitRedirectingGenerative(this, arg);
-  }
-
-  int get hashCode {
-    int hash = Hashing.objectHash(thisConstructorInvocation);
-    return Hashing.mapHash(defaultValues, hash);
-  }
-
-  bool operator ==(other) {
-    if (identical(this, other)) return true;
-    if (other is! RedirectingGenerativeConstantConstructor) return false;
-    return
-        thisConstructorInvocation == other.thisConstructorInvocation &&
-        GenerativeConstantConstructor.mapEquals(
-            defaultValues, other.defaultValues);
-  }
-
-  String toString() {
-    StringBuffer sb = new StringBuffer();
-    sb.write("{'type': ${thisConstructorInvocation.type}");
-    defaultValues.forEach((key, ConstantExpression expression) {
-      sb.write(",\n 'default:${key}': ${expression.getText()}");
-    });
-    sb.write(",\n 'constructor': ${thisConstructorInvocation.getText()}");
-    sb.write("}");
-    return sb.toString();
-  }
-}
-
-/// A redirecting factory constant constructor.
-class RedirectingFactoryConstantConstructor implements ConstantConstructor {
-  final ConstructedConstantExpression targetConstructorInvocation;
-
-  RedirectingFactoryConstantConstructor(this.targetConstructorInvocation);
-
-  ConstantConstructorKind get kind {
-    return ConstantConstructorKind.REDIRECTING_FACTORY;
-  }
-
-  InterfaceType computeInstanceType(InterfaceType newType) {
-    return targetConstructorInvocation.computeInstanceType()
-        .substByContext(newType);
-  }
-
-  Map<FieldElement, ConstantExpression> computeInstanceFields(
-      List<ConstantExpression> arguments,
-      CallStructure callStructure) {
-    ConstantConstructor constantConstructor =
-        targetConstructorInvocation.target.constantConstructor;
-    return constantConstructor.computeInstanceFields(arguments, callStructure);
-  }
-
-  accept(ConstantConstructorVisitor visitor, arg) {
-    return visitor.visitRedirectingFactory(this, arg);
-  }
-
-  int get hashCode {
-    return Hashing.objectHash(targetConstructorInvocation);
-  }
-
-  bool operator ==(other) {
-    if (identical(this, other)) return true;
-    if (other is! RedirectingFactoryConstantConstructor) return false;
-    return targetConstructorInvocation == other.targetConstructorInvocation;
-  }
-
-  String toString() {
-    StringBuffer sb = new StringBuffer();
-    sb.write("{");
-    sb.write("'constructor': ${targetConstructorInvocation.getText()}");
-    sb.write("}");
-    return sb.toString();
-  }
-}
-
 /// An expression that is a compile-time constant.
 ///
 /// Whereas [ConstantValue] represent a compile-time value, a
@@ -1840,7 +1564,7 @@
 
   @override
   void visitDeferred(DeferredConstantExpression exp, context) {
-    sb.write(exp.prefix.deferredImport.prefix.source);
+    sb.write(exp.prefix.name);
     sb.write('.');
     write(exp, exp.expression);
   }
diff --git a/pkg/compiler/lib/src/constants/values.dart b/pkg/compiler/lib/src/constants/values.dart
index 068a096..24b6370 100644
--- a/pkg/compiler/lib/src/constants/values.dart
+++ b/pkg/compiler/lib/src/constants/values.dart
@@ -4,10 +4,9 @@
 
 library dart2js.constants.values;
 
+import '../common.dart';
 import '../core_types.dart';
 import '../dart_types.dart';
-import '../dart2jslib.dart'
-    show assertDebugMode;
 import '../elements/elements.dart'
     show ClassElement,
          Element,
diff --git a/pkg/compiler/lib/src/core_types.dart b/pkg/compiler/lib/src/core_types.dart
index d8302be..1b71c2e 100644
--- a/pkg/compiler/lib/src/core_types.dart
+++ b/pkg/compiler/lib/src/core_types.dart
@@ -15,7 +15,7 @@
   /// The `bool` type defined in 'dart:core'.
   InterfaceType get boolType;
 
-  /// The `bool` type defined in 'dart:core'.
+  /// The `num` type defined in 'dart:core'.
   InterfaceType get numType;
 
   /// The `int` type defined in 'dart:core'.
@@ -24,6 +24,9 @@
   /// The `double` type defined in 'dart:core'.
   InterfaceType get doubleType;
 
+  /// The `Resource` type defined in 'dart:core'.
+  InterfaceType get resourceType;
+
   /// The `String` type defined in 'dart:core'.
   InterfaceType get stringType;
 
diff --git a/pkg/compiler/lib/src/cps_ir/bounds_checker.dart b/pkg/compiler/lib/src/cps_ir/bounds_checker.dart
new file mode 100644
index 0000000..1467745
--- /dev/null
+++ b/pkg/compiler/lib/src/cps_ir/bounds_checker.dart
@@ -0,0 +1,616 @@
+// 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 dart2js.cps_ir.bounds_checker;
+
+import 'cps_ir_nodes.dart';
+import 'optimizers.dart' show Pass;
+import 'octagon.dart';
+import '../constants/values.dart';
+import 'cps_fragment.dart';
+import 'type_mask_system.dart';
+import '../world.dart';
+import '../elements/elements.dart';
+
+/// Eliminates bounds checks when they can be proven safe.
+///
+/// In general, this pass will try to eliminate any branch with arithmetic
+/// in the condition, i.e. `x < y`, `x <= y`, `x == y` etc.
+///
+/// The analysis uses an [Octagon] abstract domain. Unlike traditional octagon
+/// analyzers, we do not use a closed matrix representation, but just maintain
+/// a bucket of constraints.  Constraints can therefore be added and removed
+/// on-the-fly without significant overhead.
+///
+/// We never copy the constraint system.  While traversing the IR, the
+/// constraint system is mutated to take into account the knowledge that is
+/// valid for the current location.  Constraints are added when entering a
+/// branch, for instance, and removed again after the branch has been processed.
+///
+/// Loops are analyzed in two passes. The first pass establishes monotonicity
+/// of loop variables, which the second pass uses to compute upper/lower bounds.
+/// The first pass also records whether any side effects occurred in the loop.
+///
+/// The two-pass scheme is suboptimal compared to a least fixed-point
+/// computation, but does not require repeated iteration.  Repeated iteration
+/// would be expensive, since we cannot perform a sparse analysis with our
+/// mutable octagon representation.
+class BoundsChecker extends TrampolineRecursiveVisitor implements Pass {
+  String get passName => 'Bounds checker';
+
+  static const int MAX_UINT32 = (1 << 32) - 1;
+
+  /// All integers of this magnitude or less are representable as JS numbers.
+  static const int MAX_SAFE_INT = (1 << 53) - 1;
+
+  /// Marker to indicate that a continuation should get a unique effect number.
+  static const int NEW_EFFECT = -1;
+
+  final TypeMaskSystem types;
+  final World world;
+
+  /// Fields for the constraint system and its variables.
+  final Octagon octagon = new Octagon();
+  final Map<Primitive, SignedVariable> valueOf = {};
+  final Map<Primitive, Map<int, SignedVariable>> lengthOf = {};
+
+  /// Fields for the two-pass handling of loops.
+  final Set<Continuation> loopsWithSideEffects = new Set<Continuation>();
+  final Map<Parameter, Monotonicity> monotonicity = <Parameter, Monotonicity>{};
+  bool isStrongLoopPass;
+  bool foundLoop = false;
+
+  /// Fields for tracking side effects.
+  ///
+  /// The IR is divided into regions wherein the lengths of indexable objects
+  /// are known not to change. Regions are identified by their "effect number".
+  final Map<Continuation, int> effectNumberAt = <Continuation, int>{};
+  int currentEffectNumber = 0;
+  int effectNumberCounter = 0;
+
+  BoundsChecker(this.types, this.world);
+
+  void rewrite(FunctionDefinition node) {
+    isStrongLoopPass = false;
+    visit(node);
+    if (foundLoop) {
+      isStrongLoopPass = true;
+      effectNumberAt.clear();
+      visit(node);
+    }
+  }
+
+  // ------------- VARIABLES -----------------
+
+  int makeNewEffect() => ++effectNumberCounter;
+
+  bool isInt(Primitive prim) {
+    return types.isDefinitelyInt(prim.type);
+  }
+
+  bool isUInt32(Primitive prim) {
+    return types.isDefinitelyUint32(prim.type);
+  }
+
+  bool isNonNegativeInt(Primitive prim) {
+    return types.isDefinitelyNonNegativeInt(prim.type);
+  }
+
+  /// Get a constraint variable representing the numeric value of [number].
+  SignedVariable getValue(Primitive number) {
+    number = number.effectiveDefinition;
+    int min, max;
+    if (isUInt32(number)) {
+      min = 0;
+      max = MAX_UINT32;
+    } else if (isNonNegativeInt(number)) {
+      min = 0;
+    }
+    return valueOf.putIfAbsent(number, () => octagon.makeVariable(min, max));
+  }
+
+  /// Get a constraint variable representing the length of [indexableObject] at
+  /// program locations with the given [effectCounter].
+  SignedVariable getLength(Primitive indexableObject, int effectCounter) {
+    indexableObject = indexableObject.effectiveDefinition;
+    if (indexableObject.type != null &&
+        types.isDefinitelyFixedLengthIndexable(indexableObject.type)) {
+      // Always use the same effect counter if the length is immutable.
+      effectCounter = 0;
+    }
+    return lengthOf
+        .putIfAbsent(indexableObject, () => <int, SignedVariable>{})
+        .putIfAbsent(effectCounter, () => octagon.makeVariable(0, MAX_UINT32));
+  }
+
+  // ------------- CONSTRAINT HELPERS -----------------
+
+  /// Puts the given constraint "in scope" by adding it to the octagon, and
+  /// pushing a stack action that will remove it again.
+  void applyConstraint(SignedVariable v1, SignedVariable v2, int k) {
+    Constraint constraint = new Constraint(v1, v2, k);
+    octagon.pushConstraint(constraint);
+    pushAction(() => octagon.popConstraint(constraint));
+  }
+
+  /// Return true if we can prove that `v1 + v2 <= k`.
+  bool testConstraint(SignedVariable v1, SignedVariable v2, int k) {
+    // Add the negated constraint and check for solvability.
+    // !(v1 + v2 <= k)   <==>   -v1 - v2 <= -k-1
+    Constraint constraint = new Constraint(v1.negated, v2.negated, -k - 1);
+    octagon.pushConstraint(constraint);
+    bool answer = octagon.isUnsolvable;
+    octagon.popConstraint(constraint);
+    return answer;
+  }
+
+  void makeLessThanOrEqual(SignedVariable v1, SignedVariable v2) {
+    // v1 <= v2   <==>   v1 - v2 <= 0
+    applyConstraint(v1, v2.negated, 0);
+  }
+
+  void makeLessThan(SignedVariable v1, SignedVariable v2) {
+    // v1 < v2   <==>   v1 - v2 <= -1
+    applyConstraint(v1, v2.negated, -1);
+  }
+
+  void makeGreaterThanOrEqual(SignedVariable v1, SignedVariable v2) {
+    // v1 >= v2   <==>   v2 - v1 <= 0
+    applyConstraint(v2, v1.negated, 0);
+  }
+
+  void makeGreaterThan(SignedVariable v1, SignedVariable v2) {
+    // v1 > v2   <==>    v2 - v1 <= -1
+    applyConstraint(v2, v1.negated, -1);
+  }
+
+  void makeConstant(SignedVariable v1, int k) {
+    // We model this using the constraints:
+    //    v1 + v1 <=  2k
+    //   -v1 - v1 <= -2k
+    applyConstraint(v1, v1, 2 * k);
+    applyConstraint(v1.negated, v1.negated, -2 * k);
+  }
+
+  /// Make `v1 = v2 + k`.
+  void makeExactSum(SignedVariable v1, SignedVariable v2, int k) {
+    applyConstraint(v1, v2.negated, k);
+    applyConstraint(v1.negated, v2, -k);
+  }
+
+  /// Make `v1 = v2 [+] k` where [+] represents floating-point addition.
+  void makeFloatingPointSum(SignedVariable v1, SignedVariable v2, int k) {
+    if (isDefinitelyLessThanOrEqualToConstant(v2, MAX_SAFE_INT - k) &&
+        isDefinitelyGreaterThanOrEqualToConstant(v2, -MAX_SAFE_INT + k)) {
+      // The result is known to be in the 53-bit range, so no rounding occurs.
+      makeExactSum(v1, v2, k);
+    } else {
+      // A rounding error may occur, so the result may not be exactly v2 + k.
+      // We can still add monotonicity constraints:
+      //   adding a positive number cannot return a lesser number
+      //   adding a negative number cannot return a greater number
+      if (k >= 0) {
+        // v1 >= v2   <==>   v2 - v1 <= 0   <==>   -v1 + v2 <= 0
+        applyConstraint(v1.negated, v2, 0);
+      } else {
+        // v1 <= v2   <==>   v1 - v2 <= 0
+        applyConstraint(v1, v2.negated, 0);
+      }
+    }
+  }
+
+  void makeEqual(SignedVariable v1, SignedVariable v2) {
+    // We model this using the constraints:
+    //    v1 <= v2   <==>   v1 - v2 <= 0
+    //    v1 >= v2   <==>   v2 - v1 <= 0
+    applyConstraint(v1, v2.negated, 0);
+    applyConstraint(v2, v1.negated, 0);
+  }
+
+  void makeNotEqual(SignedVariable v1, SignedVariable v2) {
+    // The octagon cannot represent non-equality, but we can sharpen a weak
+    // inequality to a sharp one. If v1 and v2 are already known to be equal,
+    // this will create a contradiction and eliminate a dead branch.
+    // This is necessary for eliminating concurrent modification checks.
+    if (isDefinitelyLessThanOrEqualTo(v1, v2)) {
+      makeLessThan(v1, v2);
+    } else if (isDefinitelyGreaterThanOrEqualTo(v1, v2)) {
+      makeGreaterThan(v1, v2);
+    }
+  }
+
+  /// Return true if we can prove that `v1 <= v2`.
+  bool isDefinitelyLessThanOrEqualTo(SignedVariable v1, SignedVariable v2) {
+    return testConstraint(v1, v2.negated, 0);
+  }
+
+  /// Return true if we can prove that `v1 >= v2`.
+  bool isDefinitelyGreaterThanOrEqualTo(SignedVariable v1, SignedVariable v2) {
+    return testConstraint(v2, v1.negated, 0);
+  }
+
+  bool isDefinitelyLessThanOrEqualToConstant(SignedVariable v1, int value) {
+    // v1 <= value   <==>   v1 + v1 <= 2 * value
+    return testConstraint(v1, v1, 2 * value);
+  }
+
+  bool isDefinitelyGreaterThanOrEqualToConstant(SignedVariable v1, int value) {
+    // v1 >= value   <==>   -v1 - v1 <= -2 * value
+    return testConstraint(v1.negated, v1.negated, -2 * value);
+  }
+
+  // ------------- TAIL EXPRESSIONS -----------------
+
+  @override
+  void visitBranch(Branch node) {
+    Primitive condition = node.condition.definition;
+    Continuation trueCont = node.trueContinuation.definition;
+    Continuation falseCont = node.falseContinuation.definition;
+    effectNumberAt[trueCont] = currentEffectNumber;
+    effectNumberAt[falseCont] = currentEffectNumber;
+    pushAction(() {
+      // If the branching condition is known statically, either or both of the
+      // branch continuations will be replaced by Unreachable. Clean up the
+      // branch afterwards.
+      if (trueCont.body is Unreachable && falseCont.body is Unreachable) {
+        destroyAndReplace(node, new Unreachable());
+      } else if (trueCont.body is Unreachable) {
+        destroyAndReplace(
+            node, new InvokeContinuation(falseCont, <Parameter>[]));
+      } else if (falseCont.body is Unreachable) {
+        destroyAndReplace(
+            node, new InvokeContinuation(trueCont, <Parameter>[]));
+      }
+    });
+    void pushTrue(makeConstraint()) {
+      pushAction(() {
+        makeConstraint();
+        push(trueCont);
+      });
+    }
+    void pushFalse(makeConstraint()) {
+      pushAction(() {
+        makeConstraint();
+        push(falseCont);
+      });
+    }
+    if (condition is ApplyBuiltinOperator &&
+        condition.arguments.length == 2 &&
+        isInt(condition.arguments[0].definition) &&
+        isInt(condition.arguments[1].definition)) {
+      SignedVariable v1 = getValue(condition.arguments[0].definition);
+      SignedVariable v2 = getValue(condition.arguments[1].definition);
+      switch (condition.operator) {
+        case BuiltinOperator.NumLe:
+          pushTrue(() => makeLessThanOrEqual(v1, v2));
+          pushFalse(() => makeGreaterThan(v1, v2));
+          return;
+        case BuiltinOperator.NumLt:
+          pushTrue(() => makeLessThan(v1, v2));
+          pushFalse(() => makeGreaterThanOrEqual(v1, v2));
+          return;
+        case BuiltinOperator.NumGe:
+          pushTrue(() => makeGreaterThanOrEqual(v1, v2));
+          pushFalse(() => makeLessThan(v1, v2));
+          return;
+        case BuiltinOperator.NumGt:
+          pushTrue(() => makeGreaterThan(v1, v2));
+          pushFalse(() => makeLessThanOrEqual(v1, v2));
+          return;
+        case BuiltinOperator.StrictEq:
+          pushTrue(() => makeEqual(v1, v2));
+          pushFalse(() => makeNotEqual(v1, v2));
+          return;
+        case BuiltinOperator.StrictNeq:
+          pushTrue(() => makeNotEqual(v1, v2));
+          pushFalse(() => makeEqual(v1, v2));
+          return;
+        default:
+      }
+    }
+
+    push(trueCont);
+    push(falseCont);
+  }
+
+  @override
+  void visitConstant(Constant node) {
+    // TODO(asgerf): It might be faster to inline the constant in the
+    //               constraints that reference it.
+    if (node.value.isInt) {
+      IntConstantValue constant = node.value;
+      makeConstant(getValue(node), constant.primitiveValue);
+    }
+  }
+
+  @override
+  void visitApplyBuiltinOperator(ApplyBuiltinOperator node) {
+    if (node.operator != BuiltinOperator.NumAdd &&
+        node.operator != BuiltinOperator.NumSubtract) {
+      return;
+    }
+    if (!isInt(node.arguments[0].definition) ||
+        !isInt(node.arguments[1].definition)) {
+      return;
+    }
+    if (!isInt(node)) {
+      // TODO(asgerf): The result of this operation should always be an integer,
+      // but currently type propagation does not always prove this.
+      return;
+    }
+    // We have `v1 = v2 +/- v3`, but the octagon cannot represent constraints
+    // involving more than two variables. Check if one operand is a constant.
+    int getConstantArgument(int n) {
+      Primitive prim = node.arguments[n].definition;
+      if (prim is Constant && prim.value.isInt) {
+        IntConstantValue constant = prim.value;
+        return constant.primitiveValue;
+      }
+      return null;
+    }
+    int constant = getConstantArgument(0);
+    int operandIndex = 1;
+    if (constant == null) {
+      constant = getConstantArgument(1);
+      operandIndex = 0;
+    }
+    if (constant == null) {
+      // Neither argument was a constant.
+      // Classical octagon-based analyzers would compute upper and lower bounds
+      // for the two operands and add constraints for the result based on
+      // those.  For performance reasons we omit that.
+      // TODO(asgerf): It seems expensive, but we should evaluate it.
+      return;
+    }
+    SignedVariable v1 = getValue(node);
+    SignedVariable v2 = getValue(node.arguments[operandIndex].definition);
+
+    if (node.operator == BuiltinOperator.NumAdd) {
+      // v1 = v2 + const
+      makeFloatingPointSum(v1, v2, constant);
+    } else if (operandIndex == 0) {
+      // v1 = v2 - const
+      makeFloatingPointSum(v1, v2, -constant);
+    } else {
+      // v1 = const - v2   <==>   v1 = (-v2) + const
+      makeFloatingPointSum(v1, v2.negated, constant);
+    }
+  }
+
+  @override
+  void visitGetLength(GetLength node) {
+    valueOf[node] = getLength(node.object.definition, currentEffectNumber);
+  }
+
+  void analyzeLoopEntry(InvokeContinuation node) {
+    foundLoop = true;
+    Continuation cont = node.continuation.definition;
+    if (isStrongLoopPass) {
+      for (int i = 0; i < node.arguments.length; ++i) {
+        Parameter param = cont.parameters[i];
+        if (!isInt(param)) continue;
+        Primitive initialValue = node.arguments[i].definition;
+        SignedVariable initialVariable = getValue(initialValue);
+        Monotonicity mono = monotonicity[param];
+        if (mono == null) {
+          // Value never changes. This is extremely uncommon.
+          initialValue.substituteFor(param);
+        } else if (mono == Monotonicity.Increasing) {
+          makeGreaterThanOrEqual(getValue(param), initialVariable);
+        } else if (mono == Monotonicity.Decreasing) {
+          makeLessThanOrEqual(getValue(param), initialVariable);
+        }
+      }
+      if (loopsWithSideEffects.contains(cont)) {
+        currentEffectNumber = makeNewEffect();
+      }
+    } else {
+      // During the weak pass, conservatively make a new effect number in the
+      // loop body. This may be strengthened during the strong pass.
+      currentEffectNumber = effectNumberAt[cont] = makeNewEffect();
+    }
+    push(cont);
+  }
+
+  void analyzeLoopContinue(InvokeContinuation node) {
+    Continuation cont = node.continuation.definition;
+
+    // During the strong loop phase, there is no need to compute monotonicity,
+    // and we already put bounds on the loop variables when we went into the
+    // loop.
+    if (isStrongLoopPass) return;
+
+    // For each loop parameter, try to prove that the new value is definitely
+    // less/greater than its old value. When we fail to prove this, update the
+    // monotonicity flag accordingly.
+    for (int i = 0; i < node.arguments.length; ++i) {
+      Parameter param = cont.parameters[i];
+      if (!isInt(param)) continue;
+      SignedVariable arg = getValue(node.arguments[i].definition);
+      SignedVariable paramVar = getValue(param);
+      if (!isDefinitelyLessThanOrEqualTo(arg, paramVar)) {
+        // We couldn't prove that the value does not increase, so assume
+        // henceforth that it might be increasing.
+        markMonotonicity(cont.parameters[i], Monotonicity.Increasing);
+      }
+      if (!isDefinitelyGreaterThanOrEqualTo(arg, paramVar)) {
+        // We couldn't prove that the value does not decrease, so assume
+        // henceforth that it might be decreasing.
+        markMonotonicity(cont.parameters[i], Monotonicity.Decreasing);
+      }
+    }
+
+    // If a side effect has occurred between the entry and continue, mark
+    // the loop as having side effects.
+    if (currentEffectNumber != effectNumberAt[cont]) {
+      loopsWithSideEffects.add(cont);
+    }
+  }
+
+  void markMonotonicity(Parameter param, Monotonicity mono) {
+    Monotonicity current = monotonicity[param];
+    if (current == null) {
+      monotonicity[param] = mono;
+    } else if (current != mono) {
+      monotonicity[param] = Monotonicity.NotMonotone;
+    }
+  }
+
+  @override
+  void visitInvokeContinuation(InvokeContinuation node) {
+    Continuation cont = node.continuation.definition;
+    if (node.isRecursive) {
+      analyzeLoopContinue(node);
+    } else if (cont.isRecursive) {
+      analyzeLoopEntry(node);
+    } else {
+      int effect = effectNumberAt[cont];
+      if (effect == null) {
+        effectNumberAt[cont] = currentEffectNumber;
+      } else if (effect != currentEffectNumber && effect != NEW_EFFECT) {
+        effectNumberAt[cont] = NEW_EFFECT;
+      }
+      // TODO(asgerf): Compute join for parameters to increase precision?
+    }
+  }
+
+  // ---------------- CALL EXPRESSIONS --------------------
+
+  @override
+  void visitInvokeMethod(InvokeMethod node) {
+    // TODO(asgerf): What we really need is a "changes length" side effect flag.
+    if (world
+        .getSideEffectsOfSelector(node.selector, node.mask)
+        .changesIndex()) {
+      currentEffectNumber = makeNewEffect();
+    }
+    push(node.continuation.definition);
+  }
+
+  @override
+  void visitInvokeStatic(InvokeStatic node) {
+    if (world.getSideEffectsOfElement(node.target).changesIndex()) {
+      currentEffectNumber = makeNewEffect();
+    }
+    push(node.continuation.definition);
+  }
+
+  @override
+  void visitInvokeMethodDirectly(InvokeMethodDirectly node) {
+    FunctionElement target = node.target;
+    if (target is ConstructorBodyElement) {
+      ConstructorBodyElement body = target;
+      target = body.constructor;
+    }
+    if (world.getSideEffectsOfElement(target).changesIndex()) {
+      currentEffectNumber = makeNewEffect();
+    }
+    push(node.continuation.definition);
+  }
+
+  @override
+  void visitInvokeConstructor(InvokeConstructor node) {
+    if (world.getSideEffectsOfElement(node.target).changesIndex()) {
+      currentEffectNumber = makeNewEffect();
+    }
+    push(node.continuation.definition);
+  }
+
+  @override
+  void visitTypeCast(TypeCast node) {
+    push(node.continuation.definition);
+  }
+
+  @override
+  void visitGetLazyStatic(GetLazyStatic node) {
+    // TODO(asgerf): How do we get the side effects of a lazy field initializer?
+    currentEffectNumber = makeNewEffect();
+    push(node.continuation.definition);
+  }
+
+  @override
+  void visitForeignCode(ForeignCode node) {
+    if (node.nativeBehavior.sideEffects.changesIndex()) {
+      currentEffectNumber = makeNewEffect();
+    }
+    push(node.continuation.definition);
+  }
+
+  @override
+  void visitAwait(Await node) {
+    currentEffectNumber = makeNewEffect();
+    push(node.continuation.definition);
+  }
+
+  @override
+  void visitYield(Yield node) {
+    currentEffectNumber = makeNewEffect();
+    push(node.continuation.definition);
+  }
+
+  // ---------------- PRIMITIVES --------------------
+
+  @override
+  void visitApplyBuiltinMethod(ApplyBuiltinMethod node) {
+    Primitive receiver = node.receiver.definition;
+    int effectBefore = currentEffectNumber;
+    currentEffectNumber = makeNewEffect();
+    int effectAfter = currentEffectNumber;
+    SignedVariable lengthBefore = getLength(receiver, effectBefore);
+    SignedVariable lengthAfter = getLength(receiver, effectAfter);
+    switch (node.method) {
+      case BuiltinMethod.Push:
+        // after = before + count
+        int count = node.arguments.length;
+        makeExactSum(lengthAfter, lengthBefore, count);
+        break;
+
+      case BuiltinMethod.Pop:
+        // after = before - 1
+        makeExactSum(lengthAfter, lengthBefore, -1);
+        break;
+    }
+  }
+
+  @override
+  void visitLiteralList(LiteralList node) {
+    makeConstant(getLength(node, currentEffectNumber), node.values.length);
+  }
+
+  // ---------------- INTERIOR EXPRESSIONS --------------------
+
+  @override
+  Expression traverseContinuation(Continuation cont) {
+    if (octagon.isUnsolvable) {
+      destroyAndReplace(cont.body, new Unreachable());
+    } else {
+      int effect = effectNumberAt[cont];
+      if (effect != null) {
+        currentEffectNumber = effect == NEW_EFFECT ? makeNewEffect() : effect;
+      }
+    }
+    return cont.body;
+  }
+
+  @override
+  Expression traverseLetCont(LetCont node) {
+    // Join continuations should be pushed at declaration-site, so all their
+    // call sites are seen before they are analyzed.
+    // Other continuations are pushed at the use site.
+    for (Continuation cont in node.continuations) {
+      if (cont.hasAtLeastOneUse &&
+          !cont.isRecursive &&
+          cont.firstRef.parent is InvokeContinuation) {
+        push(cont);
+      }
+    }
+    return node.body;
+  }
+}
+
+/// Lattice representing the known (weak) monotonicity of a loop variable.
+///
+/// The lattice bottom is represented by `null` and represents the case where
+/// the loop variable never changes value during the loop.
+enum Monotonicity { NotMonotone, Increasing, Decreasing, }
diff --git a/pkg/compiler/lib/src/cps_ir/builtin_operator.dart b/pkg/compiler/lib/src/cps_ir/builtin_operator.dart
index 9010bc2..31f815a 100644
--- a/pkg/compiler/lib/src/cps_ir/builtin_operator.dart
+++ b/pkg/compiler/lib/src/cps_ir/builtin_operator.dart
@@ -29,14 +29,32 @@
   NumAdd,
   NumSubtract,
   NumMultiply,
+  NumDivide,
   NumAnd,
   NumOr,
   NumXor,
+  NumShl,
   NumLt,
   NumLe,
   NumGt,
   NumGe,
 
+  /// NumShr behaves like JS '>>>' but is valid only when the left is in the
+  /// uint32 range and the right in the range [0, 31].
+  NumShr,
+
+  /// NumRemainder corresponds to JavaScript's `a % b`, and Dart's
+  /// `a.remainder(b)`, except at zero, since JavaScript `1 % 0` is `NaN`.
+  /// Dart's modulo (`%`) is the same as remainder only when if both arguments
+  /// are non-negative.
+  NumRemainder,
+
+  /// Corresponds to `a ~/ b` when b is non-zero and the result fits in a signed
+  /// 32 bit value.
+  ///
+  /// This case can be compiled to  `(a / b) | 0`.
+  NumTruncatingDivideToSigned32,
+
   /// Concatenates any number of strings.
   ///
   /// Takes any number of arguments, and each argument must be a string.
@@ -102,4 +120,50 @@
   ///
   /// Compiles to `typeof x === 'number' && Math.floor(x) === x`
   IsNumberAndFloor,
+
+  /// Returns true if the argument is a fixed length Array.
+  ///
+  /// Uses one argument.
+  ///
+  /// Precondition: Argument is a JavaScript Array.
+  IsFixedLengthJSArray,
+
+  // TODO(sra): Remove this and replace with IsFalsy(IsFixedLengthJSArray(x)).
+  IsExtendableJSArray,
+
+  /// Returns true if the argument is an unmodifiable Array.
+  ///
+  /// Uses one argument.
+  ///
+  /// Precondition: Argument is a JavaScript Array.
+  IsUnmodifiableJSArray,
+
+  // TODO(sra): Remove this and replace with IsFalsy(IsUnmodifiableArray(x)).
+  IsModifiableJSArray,
+}
+
+/// A method supported natively in the CPS and Tree IRs using the
+/// `ApplyBuiltinMethod` instructions.
+/// 
+/// These methods all operate on a distinguished 'object' argument, and
+/// take zero or more additional arguments.
+/// 
+/// These methods may mutate and depend on the state of the object argument,
+/// but may not depend on or mutate any other state. An exception is thrown
+/// if the object is null, but otherwise they cannot throw or diverge.
+enum BuiltinMethod {
+  /// Add an item to a native list.
+  /// 
+  /// Takes any number of arguments, each argument will be added to the
+  /// list on the order given (as per the JS `push` method).
+  /// 
+  /// Compiles to `object.push(x1, ..., xN)`.
+  Push,
+
+  /// Remove and return the last item from a native list.
+  /// 
+  /// Takes no arguments.
+  /// 
+  /// Compiles to `object.pop()`.
+  Pop,
 }
diff --git a/pkg/compiler/lib/src/cps_ir/cps_fragment.dart b/pkg/compiler/lib/src/cps_ir/cps_fragment.dart
index 0c8e027..7fc2ae3 100644
--- a/pkg/compiler/lib/src/cps_ir/cps_fragment.dart
+++ b/pkg/compiler/lib/src/cps_ir/cps_fragment.dart
@@ -6,7 +6,7 @@
 
 import 'cps_ir_nodes.dart';
 import '../constants/values.dart';
-import '../universe/universe.dart' show Selector;
+import '../universe/selector.dart' show Selector;
 import '../types/types.dart' show TypeMask;
 import '../io/source_information.dart';
 import '../elements/elements.dart';
@@ -33,19 +33,19 @@
 ///
 /// If `condition` is true then invoke `cont1`, else `cont2`.
 ///
-///   cps.ifTrue(condition).invokeContinuation(cont1, []);
+///   cps.ifTruthy(condition).invokeContinuation(cont1, []);
 ///   cps.invokeContinuation(cont2, []);
 ///
 /// If `condition` is true then invoke `cont` with a bound primitive:
 ///
-///   CpsFragment branch = cps.ifTrue(condition);
+///   CpsFragment branch = cps.ifTruthy(condition);
 ///   branch.invokeContinuation(cont, [branch.letPrim(arg)]);
 ///
 /// Loop and call a method until it returns false:
 ///
 ///   Continuation loop = cps.beginLoop();
 ///   var result = cps.invokeMethod(receiver, selector, ...);
-///   cps.ifFalse(result).invokeContinuation(exit, []);
+///   cps.ifFalsy(result).invokeContinuation(exit, []);
 ///   cps.continueLoop(loop);
 ///
 class CpsFragment {
@@ -83,6 +83,7 @@
     }
     if (context != null) {
       context.body = node;
+      node.parent = context;
     }
     context = null;
   }
@@ -112,6 +113,16 @@
     return letPrim(new ApplyBuiltinOperator(op, args, sourceInformation));
   }
 
+  Primitive invokeBuiltin(BuiltinMethod method,
+                          Primitive receiver,
+                          List<Primitive> arguments,
+                          {bool receiverIsNotNull: false}) {
+    ApplyBuiltinMethod apply =
+        new ApplyBuiltinMethod(method, receiver, arguments, sourceInformation);
+    apply.receiverIsNotNull = receiverIsNotNull;
+    return letPrim(apply);
+  }
+
   /// Inserts an invocation. binds its continuation, and returns the
   /// continuation parameter (i.e. the return value of the invocation).
   ///
@@ -188,11 +199,11 @@
   /// Returns a new fragment for the 'then' branch.
   ///
   /// The 'else' branch becomes the new hole.
-  CpsFragment ifTrue(Primitive condition) {
+  CpsFragment ifTruthy(Primitive condition) {
     Continuation trueCont = new Continuation(<Parameter>[]);
     Continuation falseCont = new Continuation(<Parameter>[]);
     put(new LetCont.two(trueCont, falseCont,
-            new Branch(new IsTrue(condition), trueCont, falseCont)));
+            new Branch.loose(condition, trueCont, falseCont)));
     context = falseCont;
     return new CpsFragment(sourceInformation, trueCont);
   }
@@ -202,11 +213,11 @@
   /// Returns a new fragment for the 'else' branch.
   ///
   /// The 'then' branch becomes the new hole.
-  CpsFragment ifFalse(Primitive condition) {
+  CpsFragment ifFalsy(Primitive condition) {
     Continuation trueCont = new Continuation(<Parameter>[]);
     Continuation falseCont = new Continuation(<Parameter>[]);
     put(new LetCont.two(trueCont, falseCont,
-            new Branch(new IsTrue(condition), trueCont, falseCont)));
+            new Branch.loose(condition, trueCont, falseCont)));
     context = trueCont;
     return new CpsFragment(sourceInformation, falseCont);
   }
@@ -287,4 +298,27 @@
     put(let);
     context = let;
   }
+
+  void insertBelow(InteriorNode node) {
+    assert(isOpen);
+    if (isEmpty) return;
+    Expression child = node.body;
+    node.body = root;
+    root.parent = node;
+    context.body = child;
+    child.parent = context;
+    root = context = null;
+  }
+
+  void insertAbove(InteriorExpression node) {
+    insertBelow(node.parent);
+  }
+}
+
+/// Removes [node], unlinking all its references and replaces it with [newNode].
+void destroyAndReplace(Expression node, Expression newNode) {
+  InteriorNode parent = node.parent;
+  RemovalVisitor.remove(node);
+  parent.body = newNode;
+  newNode.parent = parent;
 }
diff --git a/pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart b/pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart
index 4ec13ad..3f69cd0 100644
--- a/pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart
+++ b/pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart
@@ -4,24 +4,40 @@
 
 library dart2js.ir_builder;
 
-import '../compile_time_constants.dart' show BackendConstantEnvironment;
+import '../closure.dart' hide ClosureScope;
+import '../common.dart';
+import '../common/names.dart' show
+    Names,
+    Selectors;
+import '../compile_time_constants.dart' show
+    BackendConstantEnvironment;
 import '../constants/constant_system.dart';
-import '../constants/values.dart' show ConstantValue, PrimitiveConstantValue;
+import '../constants/values.dart' show
+    ConstantValue,
+    PrimitiveConstantValue;
 import '../dart_types.dart';
-import '../dart2jslib.dart';
 import '../elements/elements.dart';
 import '../io/source_information.dart';
+import '../js/js.dart' as js show
+    js,
+    LiteralStatement,
+    Template;
+import '../native/native.dart' show
+    NativeBehavior;
 import '../tree/tree.dart' as ast;
-import '../types/types.dart' show TypeMask;
-import '../closure.dart' hide ClosureScope;
-import '../universe/universe.dart' show SelectorKind;
-import 'cps_ir_nodes.dart' as ir;
-import 'cps_ir_builder_task.dart' show DartCapturedVariables,
-    GlobalProgramInformation;
+import '../types/types.dart' show
+    TypeMask;
+import '../universe/call_structure.dart' show
+    CallStructure;
+import '../universe/selector.dart' show
+    Selector,
+    SelectorKind;
 
-import '../common.dart' as types show TypeMask;
-import '../js/js.dart' as js show Template;
-import '../native/native.dart' show NativeBehavior;
+import 'cps_ir_builder_task.dart' show
+    DartCapturedVariables,
+    GlobalProgramInformation;
+import 'cps_ir_nodes.dart' as ir;
+
 
 /// A mapping from variable elements to their compile-time values.
 ///
@@ -759,9 +775,9 @@
     elseContinuation.body = elseBuilder._root;
     add(new ir.LetCont(join.continuation,
             new ir.LetCont.two(thenContinuation, elseContinuation,
-                new ir.Branch(new ir.IsTrue(condition),
-                              thenContinuation,
-                              elseContinuation))));
+                new ir.Branch.strict(condition,
+                                     thenContinuation,
+                                     elseContinuation))));
     environment = join.environment;
     return environment.discard(1);
   }
@@ -817,7 +833,7 @@
     // TODO(johnniwinther): This should have its own ir node.
     return _buildInvokeSuper(
         method,
-        new Selector.getter(method.name, method.library),
+        new Selector.getter(method.memberName),
         const <ir.Primitive>[],
         sourceInformation);
   }
@@ -828,7 +844,7 @@
     // TODO(johnniwinther): This should have its own ir node.
     return _buildInvokeSuper(
         getter,
-        new Selector.getter(getter.name, getter.library),
+        new Selector.getter(getter.memberName),
         const <ir.Primitive>[],
         sourceInformation);
   }
@@ -841,7 +857,7 @@
     // TODO(johnniwinther): This should have its own ir node.
     _buildInvokeSuper(
         setter,
-        new Selector.setter(setter.name, setter.library),
+        new Selector.setter(setter.memberName),
         <ir.Primitive>[value],
         sourceInformation);
     return value;
@@ -1002,7 +1018,7 @@
   /// Create a getter invocation of the static [getter].
   ir.Primitive buildStaticGetterGet(MethodElement getter,
                                     SourceInformation sourceInformation) {
-    Selector selector = new Selector.getter(getter.name, getter.library);
+    Selector selector = new Selector.getter(getter.memberName);
     return _buildInvokeStatic(
         getter, selector, const <ir.Primitive>[], sourceInformation);
   }
@@ -1026,7 +1042,7 @@
   ir.Primitive buildStaticSetterSet(MethodElement setter,
                                     ir.Primitive value,
                                     {SourceInformation sourceInformation}) {
-    Selector selector = new Selector.setter(setter.name, setter.library);
+    Selector selector = new Selector.setter(setter.memberName);
     _buildInvokeStatic(
         setter, selector, <ir.Primitive>[value], sourceInformation);
     return value;
@@ -1103,9 +1119,9 @@
 
     ir.Expression result =
         new ir.LetCont.many(arms,
-            new ir.Branch(new ir.IsTrue(condition),
-                          thenContinuation,
-                          elseContinuation));
+            new ir.Branch.strict(condition,
+                                 thenContinuation,
+                                 elseContinuation));
 
     JumpCollector join;  // Null if there is no join.
     if (thenBuilder.isOpen && elseBuilder.isOpen) {
@@ -1274,9 +1290,9 @@
     // be filled by LetCont.plug.
     ir.LetCont branch =
         new ir.LetCont.two(exitContinuation, bodyContinuation,
-            new ir.Branch(new ir.IsTrue(condition),
-                          bodyContinuation,
-                          exitContinuation));
+            new ir.Branch.strict(condition,
+                                 bodyContinuation,
+                                 exitContinuation));
     // If there are breaks in the body, then there must be a join-point
     // continuation for the normal exit and the breaks.  Otherwise, the
     // successor is translated in the hole in the exit continuation.
@@ -1344,7 +1360,7 @@
     ir.Continuation iteratorInvoked = new ir.Continuation([iterator]);
     add(new ir.LetCont(iteratorInvoked,
         new ir.InvokeMethod(expressionReceiver,
-            new Selector.getter("iterator", null),
+            Selectors.iterator,
             iteratorMask,
             emptyArguments,
             iteratorInvoked)));
@@ -1361,7 +1377,7 @@
     ir.Continuation moveNextInvoked = new ir.Continuation([condition]);
     add(new ir.LetCont(moveNextInvoked,
         new ir.InvokeMethod(iterator,
-            new Selector.call("moveNext", null, 0),
+            Selectors.moveNext,
             moveNextMask,
             emptyArguments,
             moveNextInvoked)));
@@ -1384,7 +1400,7 @@
     bodyBuilder.add(new ir.LetCont(currentInvoked,
         new ir.InvokeMethod(
             iterator,
-            new Selector.getter("current", null),
+            Selectors.current,
             currentMask,
             emptyArguments, currentInvoked)));
     // TODO(sra): Does this cover all cases? The general setter case include
@@ -1394,7 +1410,8 @@
       bodyBuilder.buildLocalVariableSet(variableElement, currentValue);
     } else if (Elements.isErroneous(variableElement)) {
       bodyBuilder.buildErroneousInvocation(variableElement,
-          new Selector.setter(variableElement.name, variableElement.library),
+          new Selector.setter(
+              new Name(variableElement.name, variableElement.library)),
           <ir.Primitive>[currentValue]);
     } else if (Elements.isStaticOrTopLevel(variableElement)) {
       if (variableElement.isField) {
@@ -1434,9 +1451,9 @@
     // be filled by LetCont.plug.
     ir.LetCont branch =
         new ir.LetCont.two(exitContinuation, bodyContinuation,
-            new ir.Branch(new ir.IsTrue(condition),
-                          bodyContinuation,
-                          exitContinuation));
+            new ir.Branch.strict(condition,
+                                 bodyContinuation,
+                                 exitContinuation));
     // If there are breaks in the body, then there must be a join-point
     // continuation for the normal exit and the breaks.  Otherwise, the
     // successor is translated in the hole in the exit continuation.
@@ -1509,9 +1526,9 @@
     // be filled by LetCont.plug.
     ir.LetCont branch =
         new ir.LetCont.two(exitContinuation, bodyContinuation,
-            new ir.Branch(new ir.IsTrue(condition),
-                          bodyContinuation,
-                          exitContinuation));
+            new ir.Branch.strict(condition,
+                                 bodyContinuation,
+                                 exitContinuation));
     // If there are breaks in the body, then there must be a join-point
     // continuation for the normal exit and the breaks.  Otherwise, the
     // successor is translated in the hole in the exit continuation.
@@ -1595,9 +1612,9 @@
 
     continueBuilder.add(
         new ir.LetCont.two(exitContinuation, repeatContinuation,
-            new ir.Branch(new ir.IsTrue(condition),
-                          repeatContinuation,
-                          exitContinuation)));
+            new ir.Branch.strict(condition,
+                                 repeatContinuation,
+                                 exitContinuation)));
     continueCollector.continuation.body = continueBuilder._root;
 
     // Construct the loop continuation (i.e., the body and condition).
@@ -1661,9 +1678,9 @@
       // else continuation first.
       casesBuilder.add(
           new ir.LetCont.two(elseContinuation, thenContinuation,
-              new ir.Branch(new ir.IsTrue(condition),
-                            thenContinuation,
-                            elseContinuation)));
+              new ir.Branch.strict(condition,
+                                   thenContinuation,
+                                   elseContinuation)));
     }
 
     if (defaultCase != null) {
@@ -1868,9 +1885,9 @@
                 clause.type,
                 isTypeTest: true);
         checkBuilder.add(new ir.LetCont.two(thenContinuation, elseContinuation,
-                new ir.Branch(new ir.IsTrue(typeMatches),
-                    thenContinuation,
-                    elseContinuation)));
+            new ir.Branch.strict(typeMatches,
+                                 thenContinuation,
+                                 elseContinuation)));
         catchBody = checkBuilder._root;
       }
       builder.add(catchBody);
@@ -2025,6 +2042,80 @@
     }
   }
 
+  /// Build a call to the closure conversion helper for the [Function] typed
+  /// value in [value].
+  ir.Primitive _convertDartClosure(ir.Primitive value, FunctionType type) {
+    ir.Constant arity = buildIntegerConstant(type.computeArity());
+    return buildStaticFunctionInvocation(
+        program.closureConverter,
+        CallStructure.TWO_ARGS,
+        <ir.Primitive>[value, arity]);
+  }
+
+  /// Generate the body for a native function [function] that is annotated with
+  /// an implementation in JavaScript (provided as string in [javaScriptCode]).
+  void buildNativeFunctionBody(FunctionElement function,
+                               String javaScriptCode) {
+    NativeBehavior behavior = new NativeBehavior();
+    behavior.sideEffects.setAllSideEffects();
+    // Generate a [ForeignCode] statement from the given native code.
+    buildForeignCode(
+        js.js.statementTemplateYielding(
+            new js.LiteralStatement(javaScriptCode)),
+        <ir.Primitive>[],
+        behavior);
+  }
+
+  /// Generate the body for a native function that redirects to a native
+  /// JavaScript function, getter, or setter.
+  ///
+  /// Generates a call to the real target, which is given by [functions]'s
+  /// `fixedBackendName`, passing all parameters as arguments.  The target can
+  /// be the JavaScript implementation of a function, getter, or setter.
+  void buildRedirectingNativeFunctionBody(FunctionElement function,
+                                          SourceInformation source) {
+    String name = function.fixedBackendName;
+    List<ir.Primitive> arguments = <ir.Primitive>[];
+    NativeBehavior behavior = new NativeBehavior();
+    behavior.sideEffects.setAllSideEffects();
+    program.addNativeMethod(function);
+    // Construct the access of the target element.
+    String code = function.isInstanceMember ? '#.$name' : name;
+    if (function.isInstanceMember) {
+      arguments.add(state.thisParameter);
+    }
+    // Collect all parameters of the function and templates for them to be
+    // inserted into the JavaScript code.
+    List<String> argumentTemplates = <String>[];
+    function.functionSignature.forEachParameter((ParameterElement parameter) {
+      ir.Primitive input = environment.lookup(parameter);
+      DartType type = program.unaliasType(parameter.type);
+      if (type is FunctionType) {
+        // The parameter type is a function type either directly or through
+        // typedef(s).
+        input = _convertDartClosure(input, type);
+      }
+      arguments.add(input);
+      argumentTemplates.add('#');
+    });
+    // Construct the application of parameters for functions and setters.
+    if (function.kind == ElementKind.FUNCTION) {
+      code = "$code(${argumentTemplates.join(', ')})";
+    } else if (function.kind == ElementKind.SETTER) {
+      code = "$code = ${argumentTemplates.single}";
+    } else {
+      assert(argumentTemplates.isEmpty);
+      assert(function.kind == ElementKind.GETTER);
+    }
+    // Generate the [ForeignCode] expression and a return statement to return
+    // its value.
+    ir.Primitive value = buildForeignCode(
+        js.js.uncachedExpressionTemplate(code),
+        arguments,
+        behavior);
+    buildReturn(value: value, sourceInformation: source);
+  }
+
   /// Create a blocks of [statements] by applying [build] to all reachable
   /// statements. The first statement is assumed to be reachable.
   // TODO(johnniwinther): Type [statements] as `Iterable` when `NodeList` uses
@@ -2143,9 +2234,9 @@
 
     add(new ir.LetCont(joinContinuation,
           new ir.LetCont.two(thenContinuation, elseContinuation,
-              new ir.Branch(new ir.IsTrue(condition),
-                            thenContinuation,
-                            elseContinuation))));
+              new ir.Branch.strict(condition,
+                                   thenContinuation,
+                                   elseContinuation))));
     return resultParameter;
   }
 
@@ -2203,9 +2294,9 @@
     // The right subexpression has two continuations.
     rightBuilder.add(
         new ir.LetCont.two(rightTrueContinuation, rightFalseContinuation,
-            new ir.Branch(new ir.IsTrue(rightValue),
-                          rightTrueContinuation,
-                          rightFalseContinuation)));
+            new ir.Branch.strict(rightValue,
+                                 rightTrueContinuation,
+                                 rightFalseContinuation)));
     // Depending on the operator, the left subexpression's continuations are
     // either the right subexpression or an invocation of the join-point
     // continuation.
@@ -2219,9 +2310,9 @@
 
     add(new ir.LetCont(join.continuation,
             new ir.LetCont.two(leftTrueContinuation, leftFalseContinuation,
-                new ir.Branch(new ir.IsTrue(leftValue),
-                              leftTrueContinuation,
-                              leftFalseContinuation))));
+                new ir.Branch.strict(leftValue,
+                                     leftTrueContinuation,
+                                     leftFalseContinuation))));
     environment = join.environment;
     return environment.discard(1);
   }
@@ -2356,11 +2447,17 @@
                                        SourceInformation sourceInformation) {
     List<ir.Primitive> arguments = <ir.Primitive>[];
     for (ClosureFieldElement field in classElement.closureFields) {
-      // Captured 'this' is not available as a local in the current environment,
-      // so treat that specially.
-      ir.Primitive value = field.local is ThisLocal
-          ? buildThis()
-          : environment.lookup(field.local);
+      // Captured 'this' and type variables are not always available as locals
+      // in the environment, so treat those specially.
+      ir.Primitive value;
+      if (field.local is ThisLocal) {
+        value = buildThis();
+      } else if (field.local is TypeVariableLocal) {
+        TypeVariableLocal variable = field.local;
+        value = buildTypeVariableAccess(variable.typeVariable);
+      } else {
+        value = environment.lookup(field.local);
+      }
       arguments.add(value);
     }
     return addPrimitive(new ir.CreateInstance(
@@ -2473,13 +2570,13 @@
     return value;
   }
 
-  ir.Primitive buildInvokeDirectly(FunctionElement target,
+  ir.Primitive buildInvokeDirectly(MethodElement target,
                                    ir.Primitive receiver,
                                    List<ir.Primitive> arguments,
                                    {SourceInformation sourceInformation}) {
     assert(isOpen);
     Selector selector =
-        new Selector.call(target.name, target.library, arguments.length);
+        new Selector.call(target.memberName, new CallStructure(arguments.length));
     return _continueWithExpression(
         (k) => new ir.InvokeMethodDirectly(
             receiver, target, selector, arguments, k, sourceInformation));
@@ -2599,7 +2696,8 @@
                                 List<ir.Primitive> arguments,
                                 NativeBehavior behavior,
                                 {Element dependency}) {
-    types.TypeMask type = program.getTypeMaskForForeign(behavior);
+    assert(behavior != null);
+    TypeMask type = program.getTypeMaskForForeign(behavior);
     ir.Primitive result = _continueWithExpression((k) => new ir.ForeignCode(
         codeTemplate,
         type,
@@ -2608,7 +2706,7 @@
         k,
         dependency: dependency));
     if (!codeTemplate.isExpression) {
-      // Close the term if this is a "throw" expression.
+      // Close the term if this is a "throw" expression or native body.
       add(new ir.Unreachable());
       _current = null;
     }
@@ -2705,8 +2803,17 @@
         new CallStructure.unnamed(1),
         <ir.Primitive>[value]);
   }
-}
 
+  ir.Node buildAwait(ir.Primitive value) {
+    return _continueWithExpression((k) => new ir.Await(value, k));
+  }
+
+  void buildYield(ir.Primitive value, bool hasStar) {
+    _continueWithExpression((k) {
+      return new ir.Yield(value, hasStar, k);
+    });
+  }
+}
 
 /// Location of a variable relative to a given closure.
 class ClosureLocation {
diff --git a/pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart b/pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart
index 238a3fc..9f2ad07 100644
--- a/pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart
+++ b/pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart
@@ -6,29 +6,48 @@
 
 import '../closure.dart' as closurelib;
 import '../closure.dart' hide ClosureScope;
+import '../common.dart';
+import '../common/names.dart' show
+    Names,
+    Selectors;
+import '../common/tasks.dart' show
+    CompilerTask;
+import '../compiler.dart' show
+    Compiler;
 import '../constants/expressions.dart';
 import '../dart_types.dart';
-import '../dart2jslib.dart';
 import '../elements/elements.dart';
-import '../elements/modelx.dart' show SynthesizedConstructorElementX,
-    ConstructorBodyElementX, FunctionSignatureX;
+import '../elements/modelx.dart' show
+    SynthesizedConstructorElementX,
+    ConstructorBodyElementX,
+    FunctionSignatureX;
 import '../io/source_information.dart';
-import '../js_backend/js_backend.dart' show JavaScriptBackend,
+import '../js_backend/js_backend.dart' show
+    JavaScriptBackend,
     SyntheticConstantKind;
+import '../resolution/tree_elements.dart' show
+    TreeElements;
 import '../resolution/semantic_visitor.dart';
+import '../resolution/send_resolver.dart' show
+    SendResolverMixin;
 import '../resolution/operators.dart' as op;
 import '../tree/tree.dart' as ast;
-import '../types/types.dart' show TypeMask;
-import '../universe/universe.dart' show SelectorKind, CallStructure;
-import '../constants/values.dart' show ConstantValue;
+import '../types/types.dart' show
+    TypeMask;
+import '../universe/call_structure.dart' show
+    CallStructure;
+import '../universe/selector.dart' show
+    Selector;
+import '../constants/values.dart' show
+    ConstantValue;
 import 'cps_ir_nodes.dart' as ir;
 import 'cps_ir_builder.dart';
-import '../native/native.dart' show NativeBehavior;
+import '../native/native.dart' show
+    NativeBehavior;
 
 // TODO(karlklose): remove.
 import '../js/js.dart' as js show js, Template, Expression, Name;
 import '../ssa/ssa.dart' show TypeMaskFactory;
-import '../types/types.dart' show TypeMask;
 import '../util/util.dart';
 
 import 'package:js_runtime/shared/embedded_names.dart'
@@ -55,7 +74,7 @@
       [this.builderCallback])
       : super(compiler);
 
-  String get name => 'IR builder';
+  String get name => 'CPS builder';
 
   ir.FunctionDefinition buildNode(AstElement element) {
     return measure(() {
@@ -63,7 +82,7 @@
 
       TreeElements elementsMapping = element.resolvedAst.elements;
       element = element.implementation;
-      return compiler.withCurrentElement(element, () {
+      return reporter.withCurrentElement(element, () {
         SourceInformationBuilder sourceInformationBuilder =
             sourceInformationStrategy.createBuilderForContext(element);
 
@@ -102,6 +121,7 @@
          BaseImplementationOfConstantsMixin<ir.Primitive, dynamic>,
          BaseImplementationOfNewMixin<ir.Primitive, dynamic>,
          BaseImplementationOfCompoundsMixin<ir.Primitive, dynamic>,
+         BaseImplementationOfSetIfNullsMixin<ir.Primitive, dynamic>,
          BaseImplementationOfIndexCompoundsMixin<ir.Primitive, dynamic>
     implements SemanticSendVisitor<ir.Primitive, dynamic> {
   final TreeElements elements;
@@ -139,6 +159,8 @@
                    this.compiler,
                    this.sourceInformationBuilder);
 
+  DiagnosticReporter get reporter => compiler.reporter;
+
   String bailoutMessage = null;
 
   @override
@@ -214,14 +236,14 @@
 
   ir.Primitive visitBreakStatement(ast.BreakStatement node) {
     if (!irBuilder.buildBreak(elements.getTargetOf(node))) {
-      compiler.internalError(node, "'break' target not found");
+      reporter.internalError(node, "'break' target not found");
     }
     return null;
   }
 
   ir.Primitive visitContinueStatement(ast.ContinueStatement node) {
     if (!irBuilder.buildContinue(elements.getTargetOf(node))) {
-      compiler.internalError(node, "'continue' target not found");
+      reporter.internalError(node, "'continue' target not found");
     }
     return null;
   }
@@ -353,6 +375,16 @@
     return giveup(node, 'await for');
   }
 
+  visitAwait(ast.Await node) {
+    ir.Primitive value = visit(node.expression);
+    return irBuilder.buildAwait(value);
+  }
+
+  visitYield(ast.Yield node) {
+    ir.Primitive value = visit(node.expression);
+    return irBuilder.buildYield(value, node.hasStar);
+  }
+
   visitSyncForIn(ast.SyncForIn node) {
     // [node.declaredIdentifier] can be either an [ast.VariableDefinitions]
     // (defining a new local variable) or a send designating some existing
@@ -396,17 +428,39 @@
     return null;
   }
 
+  static final RegExp nativeRedirectionRegExp =
+      new RegExp(r'^[a-zA-Z][a-zA-Z_$0-9]*$');
+
   // Build(Return(e), C) = C'[InvokeContinuation(return, x)]
   //   where (C', x) = Build(e, C)
   //
   // Return without a subexpression is translated as if it were return null.
-  ir.Primitive visitReturn(ast.Return node) {
+  visitReturn(ast.Return node) {
     assert(irBuilder.isOpen);
-    assert(invariant(node, node.beginToken.value != 'native'));
-    irBuilder.buildReturn(
-        value: build(node.expression),
-        sourceInformation: sourceInformationBuilder.buildReturn(node));
-    return null;
+    SourceInformation source = sourceInformationBuilder.buildReturn(node);
+    if (node.beginToken.value == 'native') {
+      FunctionElement function = irBuilder.state.currentElement;
+      assert(function.isNative);
+      ast.Node nativeBody = node.expression;
+      if (nativeBody != null) {
+        ast.LiteralString jsCode = nativeBody.asLiteralString();
+        String javaScriptCode = jsCode.dartString.slowToString();
+        assert(invariant(nativeBody,
+            !nativeRedirectionRegExp.hasMatch(javaScriptCode),
+          message: "Deprecated syntax, use @JSName('name') instead."));
+        assert(invariant(nativeBody,
+            function.functionSignature.parameterCount == 0,
+            message: 'native "..." syntax is restricted to '
+              'functions with zero parameters.'));
+        irBuilder.buildNativeFunctionBody(function, javaScriptCode);
+      } else {
+        irBuilder.buildRedirectingNativeFunctionBody(function, source);
+      }
+    } else {
+      irBuilder.buildReturn(
+          value: build(node.expression),
+          sourceInformation: source);
+    }
   }
 
   visitSwitchStatement(ast.SwitchStatement node) {
@@ -446,7 +500,7 @@
     ir.Primitive value = visit(node.expression);
     JumpTarget target = elements.getTargetDefinition(node);
     Element error =
-        (compiler.backend as JavaScriptBackend).getFallThroughError();
+        (compiler.backend as JavaScriptBackend).helpers.fallThroughError;
     irBuilder.buildSimpleSwitch(target, value, cases, defaultCase, error,
         sourceInformationBuilder.buildGeneric(node));
   }
@@ -600,9 +654,8 @@
     return receiver;
   }
 
-  // ## Sends ##
   @override
-  ir.Primitive visitAssert(ast.Send node, ast.Node condition, _) {
+  ir.Primitive visitAssert(ast.Assert node) {
     assert(irBuilder.isOpen);
     if (compiler.enableUserAssertions) {
       return giveup(node, 'assert in checked mode not implemented');
@@ -615,6 +668,7 @@
     }
   }
 
+  // ## Sends ##
   @override
   void previsitDeferredAccess(ast.Send node, PrefixElement prefix, _) {
     giveup(node, 'deferred access is not implemented');
@@ -629,12 +683,12 @@
   ir.Primitive visitExpressionInvoke(ast.Send node,
                                      ast.Node expression,
                                      ast.NodeList argumentsNode,
-                                     Selector selector, _) {
+                                     CallStructure callStructure, _) {
     ir.Primitive receiver = visit(expression);
     List<ir.Primitive> arguments = node.arguments.mapToList(visit);
-    arguments = normalizeDynamicArguments(selector.callStructure, arguments);
+    arguments = normalizeDynamicArguments(callStructure, arguments);
     return irBuilder.buildCallInvocation(
-        receiver, selector.callStructure, arguments,
+        receiver, callStructure, arguments,
         sourceInformation:
             sourceInformationBuilder.buildCall(node, argumentsNode));
   }
@@ -663,11 +717,11 @@
   ir.Primitive handleDynamicGet(
       ast.Send node,
       ast.Node receiver,
-      Selector selector,
+      Name name,
       _) {
     return irBuilder.buildDynamicGet(
         translateReceiver(receiver),
-        selector,
+        new Selector.getter(name),
         elements.getTypeMask(node),
         sourceInformationBuilder.buildGet(node));
   }
@@ -676,13 +730,15 @@
   ir.Primitive visitIfNotNullDynamicPropertyGet(
       ast.Send node,
       ast.Node receiver,
-      Selector selector,
+      Name name,
       _) {
     ir.Primitive target = visit(receiver);
     return irBuilder.buildIfNotNullSend(
         target,
         nested(() => irBuilder.buildDynamicGet(
-            target, selector, elements.getTypeMask(node),
+            target,
+            new Selector.getter(name),
+            elements.getTypeMask(node),
             sourceInformationBuilder.buildGet(node))));
   }
 
@@ -727,10 +783,6 @@
       ast.Send node,
       MethodElement function,
       _) {
-    // TODO(karlklose): support foreign functions.
-    if (compiler.backend.isForeign(function)) {
-      return giveup(node, 'handleStaticFunctionGet: foreign: $function');
-    }
     return irBuilder.buildStaticFunctionGet(function);
   }
 
@@ -1133,9 +1185,6 @@
       ast.NodeList arguments,
       CallStructure callStructure,
       _) {
-    if (compiler.backend.isForeign(getter)) {
-      return giveup(node, 'handleStaticGetterInvoke: foreign: $getter');
-    }
     ir.Primitive target = irBuilder.buildStaticGetterGet(
         getter, sourceInformationBuilder.buildGet(node));
     return irBuilder.buildCallInvocation(target,
@@ -1301,16 +1350,31 @@
     return rhs.kind == CompoundKind.POSTFIX ? value : result;
   }
 
+  ir.Primitive translateSetIfNull(
+      ast.SendSet node,
+      {ir.Primitive getValue(),
+       ast.Node rhs,
+       void setValue(ir.Primitive value)}) {
+    ir.Primitive value = getValue();
+    // Unlike other compound operators if-null conditionally will not do the
+    // assignment operation.
+    return irBuilder.buildIfNull(value, nested(() {
+      ir.Primitive newValue = build(rhs);
+      setValue(newValue);
+      return newValue;
+    }));
+  }
+
   @override
   ir.Primitive handleDynamicSet(
       ast.SendSet node,
       ast.Node receiver,
-      Selector selector,
+      Name name,
       ast.Node rhs,
       _) {
     return irBuilder.buildDynamicSet(
         translateReceiver(receiver),
-        selector,
+        new Selector.setter(name),
         elements.getTypeMask(node),
         visit(rhs));
   }
@@ -1319,14 +1383,17 @@
   ir.Primitive visitIfNotNullDynamicPropertySet(
       ast.SendSet node,
       ast.Node receiver,
-      Selector selector,
+      Name name,
       ast.Node rhs,
       _) {
     ir.Primitive target = visit(receiver);
     return irBuilder.buildIfNotNullSend(
         target,
         nested(() => irBuilder.buildDynamicSet(
-            target, selector, elements.getTypeMask(node), visit(rhs))));
+            target,
+            new Selector.setter(name),
+            elements.getTypeMask(node),
+            visit(rhs))));
   }
 
   @override
@@ -1401,12 +1468,22 @@
   }
 
   @override
+  ir.Primitive handleTypeLiteralConstantSetIfNulls(
+      ast.SendSet node,
+      ConstantExpression constant,
+      ast.Node rhs,
+      _) {
+    // The type literal is never `null`.
+    return buildConstantExpression(constant,
+        sourceInformationBuilder.buildGet(node));
+  }
+
+  @override
   ir.Primitive handleDynamicCompounds(
       ast.SendSet node,
       ast.Node receiver,
+      Name name,
       CompoundRhs rhs,
-      Selector getterSelector,
-      Selector setterSelector,
       arg) {
     ir.Primitive target = translateReceiver(receiver);
     ir.Primitive helper() {
@@ -1414,13 +1491,16 @@
           node,
           getValue: () => irBuilder.buildDynamicGet(
               target,
-              getterSelector,
+              new Selector.getter(name),
               elements.getGetterTypeMaskInComplexSendSet(node),
               sourceInformationBuilder.buildGet(node)),
           rhs: rhs,
           setValue: (ir.Primitive result) {
             irBuilder.buildDynamicSet(
-                target, setterSelector, elements.getTypeMask(node), result);
+                target,
+                new Selector.setter(name),
+                elements.getTypeMask(node),
+                result);
           });
     }
     return node.isConditional
@@ -1428,8 +1508,39 @@
         : helper();
   }
 
-  ir.Primitive buildLocalNoSuchSetter(Local local, ir.Primitive value) {
-    Selector selector = new Selector.setter(local.name, null);
+  @override
+  ir.Primitive handleDynamicSetIfNulls(
+      ast.Send node,
+      ast.Node receiver,
+      Name name,
+      ast.Node rhs,
+      _) {
+    ir.Primitive target = translateReceiver(receiver);
+    ir.Primitive helper() {
+      return translateSetIfNull(
+          node,
+          getValue: () => irBuilder.buildDynamicGet(
+              target,
+              new Selector.getter(name),
+              elements.getGetterTypeMaskInComplexSendSet(node),
+              sourceInformationBuilder.buildGet(node)),
+          rhs: rhs,
+          setValue: (ir.Primitive result) {
+            irBuilder.buildDynamicSet(
+                target,
+                new Selector.setter(name),
+                elements.getTypeMask(node),
+                result);
+          });
+    }
+    return node.isConditional
+        ? irBuilder.buildIfNotNullSend(target, nested(helper))
+        : helper();
+  }
+
+  ir.Primitive buildLocalNoSuchSetter(LocalElement local, ir.Primitive value) {
+    Selector selector = new Selector.setter(
+        new Name(local.name, local.library, isSetter: true));
     return buildStaticNoSuchMethod(selector, [value]);
   }
 
@@ -1459,15 +1570,41 @@
         });
   }
 
+  @override
+  ir.Primitive handleLocalSetIfNulls(
+      ast.SendSet node,
+      LocalElement local,
+      ast.Node rhs,
+      _,
+      {bool isSetterValid}) {
+    return translateSetIfNull(
+        node,
+        getValue: () {
+          if (local.isFunction) {
+            return irBuilder.buildLocalFunctionGet(local);
+          } else {
+            return irBuilder.buildLocalVariableGet(local);
+          }
+        },
+        rhs: rhs,
+        setValue: (ir.Primitive result) {
+          if (isSetterValid) {
+            irBuilder.buildLocalVariableSet(local, result);
+          } else {
+            return buildLocalNoSuchSetter(local, result);
+          }
+        });
+  }
+
   ir.Primitive buildStaticNoSuchGetter(Element element) {
     return buildStaticNoSuchMethod(
-        new Selector.getter(element.name, element.library),
+        new Selector.getter(new Name(element.name, element.library)),
         const <ir.Primitive>[]);
   }
 
   ir.Primitive buildStaticNoSuchSetter(Element element, ir.Primitive value) {
     return buildStaticNoSuchMethod(
-        new Selector.setter(element.name, element.library),
+        new Selector.setter(new Name(element.name, element.library)),
         <ir.Primitive>[value]);
   }
 
@@ -1504,16 +1641,52 @@
             case CompoundSetter.SETTER:
               return irBuilder.buildStaticSetterSet(setter, result);
             case CompoundSetter.INVALID:
-              // TODO(johnniwinther): Ensure [setter] is non null.
-              return buildStaticNoSuchSetter(
-                  setter != null ? setter : getter, result);
+              return buildStaticNoSuchSetter(setter, result);
+          }
+        });
+  }
+
+  @override
+  ir.Primitive handleStaticSetIfNulls(
+      ast.SendSet node,
+      Element getter,
+      CompoundGetter getterKind,
+      Element setter,
+      CompoundSetter setterKind,
+      ast.Node rhs,
+      _) {
+    return translateSetIfNull(
+        node,
+        getValue: () {
+          switch (getterKind) {
+            case CompoundGetter.FIELD:
+              SourceInformation src = sourceInformationBuilder.buildGet(node);
+              return irBuilder.buildStaticFieldGet(getter, src);
+            case CompoundGetter.GETTER:
+              return irBuilder.buildStaticGetterGet(
+                  getter, sourceInformationBuilder.buildGet(node));
+            case CompoundGetter.METHOD:
+              return irBuilder.buildStaticFunctionGet(getter);
+            case CompoundGetter.UNRESOLVED:
+              return buildStaticNoSuchGetter(getter);
+          }
+        },
+        rhs: rhs,
+        setValue: (ir.Primitive result) {
+          switch (setterKind) {
+            case CompoundSetter.FIELD:
+              return irBuilder.buildStaticFieldSet(setter, result);
+            case CompoundSetter.SETTER:
+              return irBuilder.buildStaticSetterSet(setter, result);
+            case CompoundSetter.INVALID:
+              return buildStaticNoSuchSetter(setter, result);
           }
         });
   }
 
   ir.Primitive buildSuperNoSuchGetter(Element element, TypeMask mask) {
     return buildInstanceNoSuchMethod(
-        new Selector.getter(element.name, element.library),
+        new Selector.getter(new Name(element.name, element.library)),
         mask,
         const <ir.Primitive>[]);
   }
@@ -1522,7 +1695,7 @@
                                       TypeMask mask,
                                       ir.Primitive value) {
     return buildInstanceNoSuchMethod(
-        new Selector.setter(element.name, element.library),
+        new Selector.setter(new Name(element.name, element.library)),
         mask,
         <ir.Primitive>[value]);
   }
@@ -1548,9 +1721,48 @@
             case CompoundGetter.METHOD:
               return irBuilder.buildSuperMethodGet(getter);
             case CompoundGetter.UNRESOLVED:
-              // TODO(johnniwinther): Ensure [getter] is not null.
               return buildSuperNoSuchGetter(
-                  getter != null ? getter : setter,
+                  getter,
+                  elements.getGetterTypeMaskInComplexSendSet(node));
+          }
+        },
+        rhs: rhs,
+        setValue: (ir.Primitive result) {
+          switch (setterKind) {
+            case CompoundSetter.FIELD:
+              return irBuilder.buildSuperFieldSet(setter, result);
+            case CompoundSetter.SETTER:
+              return irBuilder.buildSuperSetterSet(setter, result);
+            case CompoundSetter.INVALID:
+              return buildSuperNoSuchSetter(
+                  setter, elements.getTypeMask(node), result);
+          }
+        });
+  }
+
+  @override
+  ir.Primitive handleSuperSetIfNulls(
+      ast.SendSet node,
+      Element getter,
+      CompoundGetter getterKind,
+      Element setter,
+      CompoundSetter setterKind,
+      ast.Node rhs,
+      _) {
+    return translateSetIfNull(
+        node,
+        getValue: () {
+          switch (getterKind) {
+            case CompoundGetter.FIELD:
+              return irBuilder.buildSuperFieldGet(getter);
+            case CompoundGetter.GETTER:
+              return irBuilder.buildSuperGetterGet(
+                  getter, sourceInformationBuilder.buildGet(node));
+            case CompoundGetter.METHOD:
+              return irBuilder.buildSuperMethodGet(getter);
+            case CompoundGetter.UNRESOLVED:
+              return buildSuperNoSuchGetter(
+                  getter,
                   elements.getGetterTypeMaskInComplexSendSet(node));
           }
         },
@@ -1586,6 +1798,17 @@
   }
 
   @override
+  ir.Primitive visitTypeVariableTypeLiteralSetIfNull(
+      ast.Send node,
+      TypeVariableElement element,
+      ast.Node rhs,
+      _) {
+    // The type variable is never `null`.
+    return translateTypeVariableTypeLiteral(element,
+        sourceInformationBuilder.buildGet(node));
+  }
+
+  @override
   ir.Primitive handleIndexCompounds(
       ast.SendSet node,
       ast.Node receiver,
@@ -1794,7 +2017,7 @@
     String nameString = Elements.reconstructConstructorName(constructor);
     Name name = new Name(nameString, constructor.library);
     return buildStaticNoSuchMethod(
-        new Selector(SelectorKind.CALL, name, callStructure),
+        new Selector.call(name, callStructure),
         translateDynamicArguments(arguments, callStructure));
   }
 
@@ -1843,8 +2066,7 @@
   }
 
   @override
-  ir.Primitive bulkHandleError(ast.Send node, ErroneousElement error, _) {
-    assert(compiler.compilationFailed);
+  ir.Primitive bulkHandleError(ast.Node node, ErroneousElement error, _) {
     return irBuilder.buildNullConstant();
   }
 
@@ -1856,7 +2078,8 @@
     InterfaceType type = constant.type;
     ClassElement element = type.element;
     return buildStaticNoSuchMethod(
-        new Selector.setter(element.name, element.library), [visit(rhs)]);
+        new Selector.setter(element.memberName),
+        [visit(rhs)]);
   }
 
   @override
@@ -1867,7 +2090,8 @@
     TypedefType type = constant.type;
     TypedefElement element = type.element;
     return buildStaticNoSuchMethod(
-        new Selector.setter(element.name, element.library), [visit(rhs)]);
+        new Selector.setter(element.memberName),
+        [visit(rhs)]);
   }
 
   @override
@@ -1876,7 +2100,7 @@
       TypeVariableElement element,
       ast.Node rhs, _) {
     return buildStaticNoSuchMethod(
-        new Selector.setter(element.name, element.library), [visit(rhs)]);
+        new Selector.setter(element.memberName), [visit(rhs)]);
   }
 
   @override
@@ -1885,7 +2109,7 @@
       ConstantExpression constant,
       ast.Node rhs, _) {
     return buildStaticNoSuchMethod(
-        new Selector.setter('dynamic', null), [visit(rhs)]);
+        new Selector.setter(Names.dynamic_), [visit(rhs)]);
   }
 
   @override
@@ -1905,7 +2129,7 @@
       ast.Node rhs, _) {
     // TODO(asgerf): Include class name somehow for static class members?
     return buildStaticNoSuchMethod(
-        new Selector.setter(field.name, field.library),
+        new Selector.setter(field.memberName),
         [visit(rhs)]);
   }
 
@@ -1915,7 +2139,7 @@
       FieldElement field,
       ast.Node rhs, _) {
     return buildInstanceNoSuchMethod(
-        new Selector.setter(field.name, field.library),
+        new Selector.setter(field.memberName),
         elements.getTypeMask(node),
         [visit(rhs)]);
   }
@@ -1926,7 +2150,7 @@
       LocalElement local,
       ast.Node rhs, _) {
     return buildStaticNoSuchMethod(
-        new Selector.setter(local.name, null),
+        new Selector.setter(new Name(local.name, local.library)),
         [visit(rhs)]);
   }
 
@@ -1937,53 +2161,52 @@
       ast.Node rhs,
       _) {
     return buildStaticNoSuchMethod(
-        new Selector.setter(function.name, function.library),
+        new Selector.setter(function.memberName),
         [visit(rhs)]);
   }
 
   @override
   ir.Primitive handleStaticGetterSet(
       ast.SendSet node,
-      FunctionElement getter,
+      GetterElement getter,
       ast.Node rhs,
       _) {
     return buildStaticNoSuchMethod(
-        new Selector.setter(getter.name, getter.library),
+        new Selector.setter(getter.memberName),
         [visit(rhs)]);
   }
 
   @override
   ir.Primitive handleStaticSetterGet(
       ast.Send node,
-      FunctionElement setter,
+      SetterElement setter,
       _) {
     return buildStaticNoSuchMethod(
-        new Selector.getter(setter.name, setter.library),
+        new Selector.getter(setter.memberName),
         []);
   }
 
   @override
   ir.Primitive handleStaticSetterInvoke(
       ast.Send node,
-      FunctionElement setter,
+      SetterElement setter,
       ast.NodeList arguments,
       CallStructure callStructure, _) {
     // Translate as a method call.
     List<ir.Primitive> args = arguments.nodes.mapToList(visit);
-    Name name = new Name(setter.name, setter.library);
     return buildStaticNoSuchMethod(
-        new Selector(SelectorKind.CALL, name, callStructure),
+        new Selector.call(setter.memberName, callStructure),
         args);
   }
 
   @override
   ir.Primitive visitSuperGetterSet(
       ast.SendSet node,
-      FunctionElement getter,
+      GetterElement getter,
       ast.Node rhs,
       _) {
     return buildInstanceNoSuchMethod(
-        new Selector.setter(getter.name, getter.library),
+        new Selector.setter(getter.memberName),
         elements.getTypeMask(node),
         [visit(rhs)]);
   }
@@ -1995,7 +2218,7 @@
       ast.Node rhs,
       _) {
     return buildInstanceNoSuchMethod(
-        new Selector.setter(method.name, method.library),
+        new Selector.setter(method.memberName),
         elements.getTypeMask(node),
         [visit(rhs)]);
   }
@@ -2003,9 +2226,9 @@
   @override
   ir.Primitive visitSuperSetterGet(
       ast.Send node,
-      FunctionElement setter, _) {
+      SetterElement setter, _) {
     return buildInstanceNoSuchMethod(
-        new Selector.setter(setter.name, setter.library),
+        new Selector.setter(setter.memberName),
         elements.getTypeMask(node),
         []);
   }
@@ -2013,14 +2236,13 @@
   @override
   ir.Primitive visitSuperSetterInvoke(
       ast.Send node,
-      FunctionElement setter,
+      SetterElement setter,
       ast.NodeList arguments,
       CallStructure callStructure, _) {
     List<ir.Primitive> args =
         translateDynamicArguments(arguments, callStructure);
-    Name name = new Name(setter.name, setter.library);
     return buildInstanceNoSuchMethod(
-        new Selector(SelectorKind.CALL, name, callStructure),
+        new Selector.call(setter.memberName, callStructure),
         elements.getTypeMask(node),
         args);
   }
@@ -2037,12 +2259,12 @@
   }
 
   internalError(ast.Node node, String message) {
-    giveup(node, message);
+    reporter.internalError(node, message);
   }
 
   @override
   visitNode(ast.Node node) {
-    internalError(node, "Unhandled node");
+    giveup(node, "Unhandled node");
   }
 
   dynamic giveup(ast.Node node, [String reason]) {
@@ -2147,8 +2369,10 @@
     Element element = elements[node];
     if (Elements.isLocal(element)) {
       LocalElement local = element;
-      if (insideInitializer) {
-        assert(local.isParameter);
+      if (insideInitializer &&
+          local.isParameter &&
+          local.enclosingElement == currentFunction) {
+        assert(local.enclosingElement.isConstructor);
         // Initializers in an initializer-list can communicate via parameters.
         // If a parameter is stored in an initializer list we box it.
         // TODO(sigurdm): Fix this.
@@ -2176,18 +2400,24 @@
   }
 
   visitFunctionExpression(ast.FunctionExpression node) {
-    FunctionElement oldFunction = currentFunction;
+    FunctionElement savedFunction = currentFunction;
     currentFunction = elements[node];
-    if (currentFunction.asyncMarker != AsyncMarker.SYNC) {
-      giveup(node, "cannot handle async/sync*/async* functions");
+
+    if (currentFunction.asyncMarker != AsyncMarker.SYNC &&
+        currentFunction.asyncMarker != AsyncMarker.SYNC_STAR &&
+        currentFunction.asyncMarker != AsyncMarker.ASYNC) {
+      giveup(node, "cannot handle sync*/async* functions");
     }
+
+    bool savedInsideInitializer = insideInitializer;
     if (node.initializers != null) {
       insideInitializer = true;
       visit(node.initializers);
-      insideInitializer = false;
     }
+    insideInitializer = false;
     visit(node.body);
-    currentFunction = oldFunction;
+    currentFunction = savedFunction;
+    insideInitializer = savedInsideInitializer;
   }
 
   visitTryStatement(ast.TryStatement node) {
@@ -2259,22 +2489,33 @@
   }
 
   FunctionElement get stringifyFunction {
-    return _backend.getStringInterpolationHelper();
+    return _backend.helpers.stringInterpolationHelper;
   }
 
-  FunctionElement get throwTypeErrorHelper => _backend.getThrowTypeError();
+  FunctionElement get throwTypeErrorHelper => _backend.helpers.throwTypeError;
 
   ClassElement get nullClass => _compiler.nullClass;
 
-  DartType unaliasType(DartType type) => type.unalias(_compiler);
+  DartType unaliasType(DartType type) => type.unaliased;
 
   TypeMask getTypeMaskForForeign(NativeBehavior behavior) {
+    if (behavior == null) {
+      return _backend.dynamicType;
+    }
     return TypeMaskFactory.fromNativeBehavior(behavior, _compiler);
   }
 
   FieldElement locateSingleField(Selector selector, TypeMask type) {
     return _compiler.world.locateSingleField(selector, type);
   }
+
+  Element get closureConverter {
+    return _backend.helpers.closureConverter;
+  }
+
+  void addNativeMethod(FunctionElement function) {
+    _backend.emitter.nativeEmitter.nativeMethods.add(function);
+  }
 }
 
 /// IR builder specific to the JavaScript backend, coupled to the [JsIrBuilder].
@@ -2406,7 +2647,7 @@
           break;
 
         default:
-          compiler.internalError(element, "Unexpected element type $element");
+          reporter.internalError(element, "Unexpected element type $element");
       }
       return root;
     });
@@ -2665,7 +2906,7 @@
               fieldValues);
           hasConstructorCall = true;
         } else {
-          compiler.internalError(initializer,
+          reporter.internalError(initializer,
                                  "Unexpected initializer type $initializer");
         }
       }
@@ -2675,7 +2916,7 @@
       ClassElement superClass = enclosingClass.superclass;
       FunctionElement target = superClass.lookupDefaultConstructor();
       if (target == null) {
-        compiler.internalError(superClass, "No default constructor available.");
+        reporter.internalError(superClass, "No default constructor available.");
       }
       target = target.implementation;
       evaluateConstructorCallFromInitializer(
@@ -3044,7 +3285,7 @@
   @override
   ir.Primitive buildStaticNoSuchMethod(Selector selector,
                                        List<ir.Primitive> arguments) {
-    Element thrower = backend.getThrowNoSuchMethod();
+    Element thrower = backend.helpers.throwNoSuchMethod;
     ir.Primitive receiver = irBuilder.buildStringConstant('');
     ir.Primitive name = irBuilder.buildStringConstant(selector.name);
     ir.Primitive argumentList = irBuilder.buildListLiteral(null, arguments);
@@ -3061,7 +3302,7 @@
                                          List<ir.Primitive> arguments) {
     return irBuilder.buildDynamicInvocation(
         irBuilder.buildThis(),
-        compiler.noSuchMethodSelector,
+        Selectors.noSuchMethod_,
         mask,
         [irBuilder.buildInvocationMirror(selector, arguments)]);
   }
@@ -3069,7 +3310,7 @@
   @override
   ir.Primitive buildRuntimeError(String message) {
     return irBuilder.buildStaticFunctionInvocation(
-        backend.getThrowRuntimeError(),
+        backend.helpers.throwRuntimeError,
         new CallStructure.unnamed(1),
         [irBuilder.buildStringConstant(message)]);
   }
@@ -3077,7 +3318,7 @@
   @override
   ir.Primitive buildAbstractClassInstantiationError(ClassElement element) {
     return irBuilder.buildStaticFunctionInvocation(
-        backend.getThrowAbstractClassInstantiationError(),
+        backend.helpers.throwAbstractClassInstantiationError,
         new CallStructure.unnamed(1),
         [irBuilder.buildStringConstant(element.name)]);
   }
@@ -3131,13 +3372,13 @@
                                               CallStructure callStructure) {
       Element element = backend.isolateHelperLibrary.find(helperName);
       if (element == null) {
-        compiler.internalError(node,
+        reporter.internalError(node,
             'Isolate library and compiler mismatch.');
       }
       List<ir.Primitive> arguments = translateStaticArguments(argumentList,
-          element, CallStructure.TWO_ARGS);
+          element, callStructure);
       return irBuilder.buildStaticFunctionInvocation(element,
-          CallStructure.TWO_ARGS, arguments,
+          callStructure, arguments,
           sourceInformation:
                 sourceInformationBuilder.buildCall(node, node.selector));
     }
@@ -3286,12 +3527,12 @@
         if (!compiler.hasIsolateSupport) {
           // If the isolate library is not used, we just generate code
           // to fetch the current isolate.
-          continue GET_STATIC_STATE;
+          continue getStaticState;
         }
         return buildIsolateHelperInvocation('_currentIsolate',
             CallStructure.NO_ARGS);
 
-      GET_STATIC_STATE: case 'JS_GET_STATIC_STATE':
+      getStaticState: case 'JS_GET_STATIC_STATE':
         validateArgumentCount(exactly: 0);
 
         return irBuilder.buildForeignCode(
diff --git a/pkg/compiler/lib/src/cps_ir/cps_ir_integrity.dart b/pkg/compiler/lib/src/cps_ir/cps_ir_integrity.dart
index 88faa4d..dfc07a3 100644
--- a/pkg/compiler/lib/src/cps_ir/cps_ir_integrity.dart
+++ b/pkg/compiler/lib/src/cps_ir/cps_ir_integrity.dart
@@ -24,9 +24,10 @@
 /// - Each definition object occurs only once in the IR (no redeclaring).
 /// - Each reference object occurs only once in the IR (no sharing).
 ///
-class CheckCpsIntegrity extends RecursiveVisitor {
+class CheckCpsIntegrity extends TrampolineRecursiveVisitor {
 
   FunctionDefinition topLevelNode;
+  String previousPass;
 
   Set<Definition> seenDefinitions = new Set<Definition>();
   Map<Definition, Set<Reference>> seenReferences =
@@ -52,8 +53,10 @@
     pushAction(() => insideContinuations.remove(cont));
   }
 
-  void check(FunctionDefinition node) {
+  void check(FunctionDefinition node, String previousPass) {
     topLevelNode = node;
+    this.previousPass = previousPass;
+    ParentChecker.checkParents(node, this);
     visit(node);
     // Check for broken reference chains. We check this last, so out-of-scope
     // references are not classified as a broken reference chain.
@@ -181,16 +184,58 @@
       try {
         Decorator decorator = (n, String s) => n == node ? '**$s**' : s;
         sexpr = new SExpressionStringifier(decorator).visit(topLevelNode);
+        sexpr = 'SExpr dump (offending node marked with **):\n\n$sexpr';
       } catch (e) {
         sexpr = '(Exception thrown by SExpressionStringifier: $e)';
       }
     } else {
-      sexpr = '(Set DUMP_IR flag to enable)';
+      sexpr = '(Set DUMP_IR flag to enable SExpr dump)';
     }
-    throw 'CPS integrity violation in ${topLevelNode.element}:\n'
+    throw 'CPS integrity violation\n'
+          'After $previousPass on ${topLevelNode.element}\n'
           '$message\n\n'
-          'SExpr dump (offending node marked with **):\n\n'
           '$sexpr\n';
   }
+}
 
+/// Traverses the CPS term and checks that node.parent is correctly set
+/// for each visited node.
+class ParentChecker extends DeepRecursiveVisitor {
+  static void checkParents(Node node, CheckCpsIntegrity main) {
+    ParentChecker visitor = new ParentChecker._make(main);
+    visitor._worklist.add(node);
+    visitor.trampoline();
+  }
+
+  ParentChecker._make(this.main);
+
+  Node _parent;
+  final List<Node> _worklist = <Node>[];
+  final CheckCpsIntegrity main;
+
+  void trampoline() {
+    while (_worklist.isNotEmpty) {
+      _parent = _worklist.removeLast();
+      _parent.accept(this);
+    }
+  }
+
+  error(String message, node) => main.error(message, node);
+
+  @override
+  visit(Node node) {
+    _worklist.add(node);
+    if (node.parent != _parent) {
+      error('Parent pointer on $node is ${node.parent} but should be $_parent',
+            node);
+    }
+  }
+
+  @override
+  processReference(Reference node) {
+    if (node.parent != _parent) {
+      error('Parent pointer on $node is ${node.parent} but should be $_parent',
+            node);
+    }
+  }
 }
diff --git a/pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart b/pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart
index 53960b5..cbb45f0 100644
--- a/pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart
+++ b/pkg/compiler/lib/src/cps_ir/cps_ir_nodes.dart
@@ -3,12 +3,13 @@
 // BSD-style license that can be found in the LICENSE file.
 library dart2js.ir_nodes;
 
-import '../constants/values.dart' as values show ConstantValue;
+import 'dart:collection';
+import '../constants/values.dart' as values;
 import '../dart_types.dart' show DartType, InterfaceType, TypeVariableType;
 import '../elements/elements.dart';
 import '../io/source_information.dart' show SourceInformation;
 import '../types/types.dart' show TypeMask;
-import '../universe/universe.dart' show Selector;
+import '../universe/selector.dart' show Selector;
 
 import 'builtin_operator.dart';
 export 'builtin_operator.dart';
@@ -23,7 +24,20 @@
   /// A pointer to the parent node. Is null until set by optimization passes.
   Node parent;
 
+  /// Workaround for a slow Object.hashCode in the VM.
+  static int _usedHashCodes = 0;
+  final int hashCode = ++_usedHashCodes;
+
+  Node() {
+    setParentPointers();
+  }
+
   accept(Visitor visitor);
+
+  /// Updates the [parent] of the immediate children to refer to this node.
+  ///
+  /// All constructors call this method to initialize parent pointers.
+  void setParentPointers();
 }
 
 /// Expressions can be evaluated, and may diverge, throw, and/or have
@@ -71,6 +85,42 @@
 /// [LetMutable].
 abstract class InteriorExpression extends Expression implements InteriorNode {
   Expression get next => body;
+
+  /// Removes this expression from its current position in the IR.
+  ///
+  /// The node can be re-inserted elsewhere or remain orphaned.
+  ///
+  /// If orphaned, the caller is responsible for unlinking all references in
+  /// the orphaned node. Use [Reference.unlink] or [Primitive.destroy] for this.
+  void remove() {
+    assert(parent != null);
+    assert(parent.body == this);
+    assert(body.parent == this);
+    parent.body = body;
+    body.parent = parent;
+    parent = null;
+    body = null;
+  }
+
+  /// Inserts this above [node].
+  ///
+  /// This node must be orphaned first.
+  void insertAbove(Expression node) {
+    insertBelow(node.parent);
+  }
+
+  /// Inserts this below [node].
+  ///
+  /// This node must be orphaned first.
+  void insertBelow(InteriorNode newParent) {
+    assert(parent == null);
+    assert(body == null);
+    Expression child = newParent.body;
+    newParent.body = this;
+    this.body = child;
+    child.parent = this;
+    this.parent = newParent;
+  }
 }
 
 /// An expression that passes a continuation to a call.
@@ -81,7 +131,7 @@
 
 /// An expression without a continuation or a subexpression body.
 ///
-/// These break straight-line control flow and can be throught of as ending a
+/// These break straight-line control flow and can be thought of as ending a
 /// basic block.
 abstract class TailExpression extends Expression {
   Expression get next => null;
@@ -115,13 +165,48 @@
   }
 }
 
+class EffectiveUseIterator extends Iterator<Reference<Primitive>> {
+  Reference<Primitive> current;
+  Reference<Primitive> next;
+  final List<Refinement> stack = <Refinement>[];
+
+  EffectiveUseIterator(Primitive prim) : next = prim.firstRef;
+
+  bool moveNext() {
+    Reference<Primitive> ref = next;
+    while (true) {
+      if (ref == null) {
+        if (stack.isNotEmpty) {
+          ref = stack.removeLast().firstRef;
+        } else {
+          current = null;
+          return false;
+        }
+      } else if (ref.parent is Refinement) {
+        stack.add(ref.parent);
+        ref = ref.next;
+      } else {
+        current = ref;
+        next = current.next;
+        return true;
+      }
+    }
+  }
+}
+
+class EffectiveUseIterable extends IterableBase<Reference<Primitive>> {
+  Primitive primitive;
+  EffectiveUseIterable(this.primitive);
+  EffectiveUseIterator get iterator => new EffectiveUseIterator(primitive);
+}
+
 /// A named value.
 ///
 /// The identity of the [Primitive] object is the name of the value.
 /// The subclass describes how to compute the value.
 ///
 /// All primitives except [Parameter] must be bound by a [LetPrim].
-abstract class Primitive extends Definition<Primitive> {
+abstract class Primitive extends Variable<Primitive> {
   /// The [VariableElement] or [ParameterElement] from which the primitive
   /// binding originated.
   Entity hint;
@@ -149,6 +234,40 @@
   /// The source information associated with this primitive.
   // TODO(johnniwinther): Require source information for all primitives.
   SourceInformation get sourceInformation => null;
+
+  /// If this is a [Refinement] node, returns the value being refined.
+  Primitive get effectiveDefinition => this;
+
+  /// True if the two primitives are (refinements of) the same value.
+  bool sameValue(Primitive other) {
+    return effectiveDefinition == other.effectiveDefinition;
+  }
+
+  /// Iterates all non-refinement uses of the primitive and all uses of
+  /// a [Refinement] of this primitive (transitively).
+  ///
+  /// Notes regarding concurrent modification:
+  /// - The current reference may safely be unlinked.
+  /// - Yet unvisited references may not be unlinked.
+  /// - References to this primitive created during iteration will not be seen.
+  /// - References to a refinement of this primitive may not be created during
+  ///   iteration.
+  EffectiveUseIterable get effectiveUses => new EffectiveUseIterable(this);
+
+  bool get hasMultipleEffectiveUses {
+    Iterator it = effectiveUses.iterator;
+    return it.moveNext() && it.moveNext();
+  }
+
+  bool get hasNoEffectiveUses {
+    return effectiveUses.isEmpty;
+  }
+
+  /// Unlinks all references contained in this node.
+  void destroy() {
+    assert(hasNoUses);
+    RemovalVisitor.remove(this);
+  }
 }
 
 /// Operands to invocations and primitives are always variables.  They point to
@@ -208,8 +327,12 @@
   }
 
   accept(Visitor visitor) => visitor.visitLetPrim(this);
-}
 
+  void setParentPointers() {
+    primitive.parent = this;
+    if (body != null) body.parent = this;
+  }
+}
 
 /// Binding continuations.
 ///
@@ -244,6 +367,11 @@
   }
 
   accept(Visitor visitor) => visitor.visitLetCont(this);
+
+  void setParentPointers() {
+    _setParentsOnNodes(continuations, this);
+    if (body != null) body.parent = this;
+  }
 }
 
 // Binding an exception handler.
@@ -262,6 +390,11 @@
   LetHandler(this.handler, this.body);
 
   accept(Visitor visitor) => visitor.visitLetHandler(this);
+
+  void setParentPointers() {
+    handler.parent = this;
+    if (body != null) body.parent = this;
+  }
 }
 
 /// Binding mutable variables.
@@ -286,6 +419,12 @@
   }
 
   accept(Visitor visitor) => visitor.visitLetMutable(this);
+
+  void setParentPointers() {
+    variable.parent = this;
+    value.parent = this;
+    if (body != null) body.parent = this;
+  }
 }
 
 /// Invoke a static function.
@@ -318,6 +457,11 @@
                            [this.sourceInformation]);
 
   accept(Visitor visitor) => visitor.visitInvokeStatic(this);
+
+  void setParentPointers() {
+    _setParentsOnList(arguments, this);
+    continuation.parent = this;
+  }
 }
 
 /// Invoke a method on an object.
@@ -337,6 +481,17 @@
   final Reference<Continuation> continuation;
   final SourceInformation sourceInformation;
 
+  /// If true, the [receiver] is intercepted and the actual receiver is in
+  /// the first argument. Otherwise, the [receiver] is the actual receiver.
+  ///
+  /// This flag is always false for non-intercepted selectors, but it may also
+  /// be false for intercepted selectors after dummy receiver optimization
+  /// (in this case the first argument is a dummy value).
+  ///
+  /// It is always false before the unsugaring pass, where interceptors have
+  /// not yet been introduced.
+  bool receiverIsIntercepted = false;
+
   /// If true, it is known that the receiver cannot be `null`.
   bool receiverIsNotNull = false;
 
@@ -358,6 +513,12 @@
                            this.sourceInformation);
 
   accept(Visitor visitor) => visitor.visitInvokeMethod(this);
+
+  void setParentPointers() {
+    receiver.parent = this;
+    _setParentsOnList(arguments, this);
+    continuation.parent = this;
+  }
 }
 
 /// Invoke [target] on [receiver], bypassing dispatch and override semantics.
@@ -398,6 +559,12 @@
         this.continuation = new Reference<Continuation>(continuation);
 
   accept(Visitor visitor) => visitor.visitInvokeMethodDirectly(this);
+
+  void setParentPointers() {
+    receiver.parent = this;
+    _setParentsOnList(arguments, this);
+    continuation.parent = this;
+  }
 }
 
 /// Non-const call to a constructor.
@@ -416,14 +583,14 @@
 /// Note that [InvokeConstructor] does it itself allocate an object.
 /// The invoked constructor will do that using [CreateInstance].
 class InvokeConstructor extends CallExpression {
-  final DartType type;
+  final DartType dartType;
   final ConstructorElement target;
   final List<Reference<Primitive>> arguments;
   final Reference<Continuation> continuation;
   final Selector selector;
   final SourceInformation sourceInformation;
 
-  InvokeConstructor(this.type,
+  InvokeConstructor(this.dartType,
                     this.target,
                     this.selector,
                     List<Primitive> args,
@@ -433,6 +600,37 @@
         continuation = new Reference<Continuation>(cont);
 
   accept(Visitor visitor) => visitor.visitInvokeConstructor(this);
+
+  void setParentPointers() {
+    _setParentsOnList(arguments, this);
+    continuation.parent = this;
+  }
+}
+
+/// An alias for [value] in a context where the value is known to satisfy
+/// [type].
+///
+/// Refinement nodes are inserted before the type propagator pass and removed
+/// afterwards, so as not to complicate passes that don't reason about types,
+/// but need to reason about value references being identical (i.e. referring
+/// to the same primitive).
+class Refinement extends Primitive {
+  Reference<Primitive> value;
+  final TypeMask refineType;
+
+  Refinement(Primitive value, this.refineType)
+    : value = new Reference<Primitive>(value);
+
+  bool get isSafeForElimination => true;
+  bool get isSafeForReordering => false;
+
+  accept(Visitor visitor) => visitor.visitRefinement(this);
+
+  Primitive get effectiveDefinition => value.definition.effectiveDefinition;
+
+  void setParentPointers() {
+    value.parent = this;
+  }
 }
 
 /// An "is" type test.
@@ -444,31 +642,63 @@
 /// to simplify code generation for type tests.
 class TypeTest extends Primitive {
   Reference<Primitive> value;
-  final DartType type;
+  final DartType dartType;
 
-  /// If [type] is an [InterfaceType], this holds the internal representation of
-  /// the type arguments to [type]. Since these may reference type variables
-  /// from the enclosing class, they are not constant.
+  /// If [dartType] is an [InterfaceType], this holds the internal
+  /// representation of the type arguments to [dartType]. Since these may
+  /// reference type variables from the enclosing class, they are not constant.
   ///
-  /// If [type] is a [TypeVariableType], this is a singleton list with
-  /// the internal representation of the type held in that type variable.
+  /// If [dartType] is a [TypeVariableType], this is a singleton list with the
+  /// internal representation of the type held in that type variable.
   ///
-  /// If [type] is a [FunctionType], this is a singleton list with the
+  /// If [dartType] is a [FunctionType], this is a singleton list with the
   /// internal representation of that type,
   ///
   /// Otherwise the list is empty.
   final List<Reference<Primitive>> typeArguments;
 
+  /// The Interceptor for [value].  May be `null` if the test can be done
+  /// without an interceptor.  May be the same as [value] after self-interceptor
+  /// optimization.
+  // TODO(24523): Remove this field.
+  Reference<Primitive> interceptor;
+
   TypeTest(Primitive value,
-           this.type,
+           this.dartType,
            List<Primitive> typeArguments)
-  : this.value = new Reference<Primitive>(value),
-    this.typeArguments = _referenceList(typeArguments);
+      : this.value = new Reference<Primitive>(value),
+        this.typeArguments = _referenceList(typeArguments);
 
   accept(Visitor visitor) => visitor.visitTypeTest(this);
 
   bool get isSafeForElimination => true;
   bool get isSafeForReordering => true;
+
+  void setParentPointers() {
+    value.parent = this;
+    _setParentsOnList(typeArguments, this);
+    if (interceptor != null) interceptor.parent = this;
+  }
+}
+
+/// An "is" type test for a raw type, performed by testing a flag property.
+///
+/// Returns `true` if [interceptor] is for [dartType].
+class TypeTestViaFlag extends Primitive {
+  Reference<Primitive> interceptor;
+  final DartType dartType;
+
+  TypeTestViaFlag(Primitive interceptor, this.dartType)
+      : this.interceptor = new Reference<Primitive>(interceptor);
+
+  accept(Visitor visitor) => visitor.visitTypeTestViaFlag(this);
+
+  bool get isSafeForElimination => true;
+  bool get isSafeForReordering => true;
+
+  void setParentPointers() {
+    interceptor.parent = this;
+  }
 }
 
 /// An "as" type cast.
@@ -483,14 +713,14 @@
 /// continuation parameter without needing flow-sensitive analysis.
 class TypeCast extends CallExpression {
   Reference<Primitive> value;
-  final DartType type;
+  final DartType dartType;
 
   /// See the corresponding field on [TypeTest].
   final List<Reference<Primitive>> typeArguments;
   final Reference<Continuation> continuation;
 
   TypeCast(Primitive value,
-           this.type,
+           this.dartType,
            List<Primitive> typeArguments,
            Continuation cont)
       : this.value = new Reference<Primitive>(value),
@@ -498,6 +728,10 @@
         this.continuation = new Reference<Continuation>(cont);
 
   accept(Visitor visitor) => visitor.visitTypeCast(this);
+
+  void setParentPointers() {
+    value.parent = this;
+  }
 }
 
 /// Apply a built-in operator.
@@ -517,6 +751,40 @@
 
   bool get isSafeForElimination => true;
   bool get isSafeForReordering => true;
+
+  void setParentPointers() {
+    _setParentsOnList(arguments, this);
+  }
+}
+
+/// Apply a built-in method.
+///
+/// It must be known that the arguments have the proper types.
+class ApplyBuiltinMethod extends Primitive {
+  BuiltinMethod method;
+  Reference<Primitive> receiver;
+  List<Reference<Primitive>> arguments;
+  final SourceInformation sourceInformation;
+
+  bool receiverIsNotNull;
+
+  ApplyBuiltinMethod(this.method,
+                     Primitive receiver,
+                     List<Primitive> arguments,
+                     this.sourceInformation,
+                     {this.receiverIsNotNull: false})
+      : this.receiver = new Reference<Primitive>(receiver),
+        this.arguments = _referenceList(arguments);
+
+  accept(Visitor visitor) => visitor.visitApplyBuiltinMethod(this);
+
+  bool get isSafeForElimination => false;
+  bool get isSafeForReordering => false;
+
+  void setParentPointers() {
+    receiver.parent = this;
+    _setParentsOnList(arguments, this);
+  }
 }
 
 /// Throw a value.
@@ -529,6 +797,10 @@
   Throw(Primitive value) : value = new Reference<Primitive>(value);
 
   accept(Visitor visitor) => visitor.visitThrow(this);
+
+  void setParentPointers() {
+    value.parent = this;
+  }
 }
 
 /// Rethrow
@@ -538,6 +810,7 @@
 /// the same stack trace as the enclosing handler.
 class Rethrow extends TailExpression {
   accept(Visitor visitor) => visitor.visitRethrow(this);
+  void setParentPointers() {}
 }
 
 /// An expression that is known to be unreachable.
@@ -546,6 +819,7 @@
 /// known never to invoke it, e.g. because the calling expression always throws.
 class Unreachable extends TailExpression {
   accept(Visitor visitor) => visitor.visitUnreachable(this);
+  void setParentPointers() {}
 }
 
 /// Gets the value from a [MutableVariable].
@@ -565,6 +839,10 @@
 
   bool get isSafeForElimination => true;
   bool get isSafeForReordering => false;
+
+  void setParentPointers() {
+    variable.parent = this;
+  }
 }
 
 /// Assign a [MutableVariable].
@@ -585,6 +863,11 @@
 
   bool get isSafeForElimination => false;
   bool get isSafeForReordering => false;
+
+  void setParentPointers() {
+    variable.parent = this;
+    value.parent = this;
+  }
 }
 
 /// Invoke a continuation in tail position.
@@ -623,33 +906,51 @@
         sourceInformation = null;
 
   accept(Visitor visitor) => visitor.visitInvokeContinuation(this);
-}
 
-/// The base class of things which can be tested and branched on.
-abstract class Condition extends Node {
-}
-
-class IsTrue extends Condition {
-  final Reference<Primitive> value;
-
-  IsTrue(Primitive val) : value = new Reference<Primitive>(val);
-
-  accept(Visitor visitor) => visitor.visitIsTrue(this);
+  void setParentPointers() {
+    if (continuation != null) continuation.parent = this;
+    if (arguments != null) _setParentsOnList(arguments, this);
+  }
 }
 
 /// Choose between a pair of continuations based on a condition value.
 ///
 /// The two continuations must not declare any parameters.
 class Branch extends TailExpression {
-  final Condition condition;
+  final Reference<Primitive> condition;
   final Reference<Continuation> trueContinuation;
   final Reference<Continuation> falseContinuation;
 
-  Branch(this.condition, Continuation trueCont, Continuation falseCont)
-      : trueContinuation = new Reference<Continuation>(trueCont),
-        falseContinuation = new Reference<Continuation>(falseCont);
+  /// If true, only the value `true` satisfies the condition. Otherwise, any
+  /// truthy value satisfies the check.
+  ///
+  /// Non-strict checks are preferable when the condition is known to be a
+  /// boolean.
+  bool isStrictCheck;
+
+  Branch.strict(Primitive condition,
+                Continuation trueCont,
+                Continuation falseCont)
+      : this.condition = new Reference<Primitive>(condition),
+        trueContinuation = new Reference<Continuation>(trueCont),
+        falseContinuation = new Reference<Continuation>(falseCont),
+        isStrictCheck = true;
+
+  Branch.loose(Primitive condition,
+               Continuation trueCont,
+               Continuation falseCont)
+      : this.condition = new Reference<Primitive>(condition),
+        trueContinuation = new Reference<Continuation>(trueCont),
+        falseContinuation = new Reference<Continuation>(falseCont),
+        this.isStrictCheck = false;
 
   accept(Visitor visitor) => visitor.visitBranch(this);
+
+  void setParentPointers() {
+    condition.parent = this;
+    trueContinuation.parent = this;
+    falseContinuation.parent = this;
+  }
 }
 
 /// Directly assigns to a field on a given object.
@@ -666,6 +967,11 @@
 
   bool get isSafeForElimination => false;
   bool get isSafeForReordering => false;
+
+  void setParentPointers() {
+    object.parent = this;
+    value.parent = this;
+  }
 }
 
 /// Directly reads from a field on a given object.
@@ -686,10 +992,16 @@
   accept(Visitor visitor) => visitor.visitGetField(this);
 
   bool get isSafeForElimination => objectIsNotNull;
-  bool get isSafeForReordering => objectIsNotNull && field.isFinal;
+  bool get isSafeForReordering => false;
+
+  toString() => 'GetField($field)';
+
+  void setParentPointers() {
+    object.parent = this;
+  }
 }
 
-/// Get the length of a native list.
+/// Get the length of a string or native list.
 class GetLength extends Primitive {
   final Reference<Primitive> object;
 
@@ -702,11 +1014,16 @@
   bool get isSafeForReordering => false;
 
   accept(Visitor v) => v.visitGetLength(this);
+
+  void setParentPointers() {
+    object.parent = this;
+  }
 }
 
-/// Read an entry from a native list.
+/// Read an entry from a string or native list.
 ///
-/// [object] must be null or a native list, and [index] must be an integer.
+/// [object] must be null or a native list or a string, and [index] must be
+/// an integer.
 class GetIndex extends Primitive {
   final Reference<Primitive> object;
   final Reference<Primitive> index;
@@ -722,6 +1039,11 @@
   bool get isSafeForReordering => false;
 
   accept(Visitor v) => v.visitGetIndex(this);
+
+  void setParentPointers() {
+    object.parent = this;
+    index.parent = this;
+  }
 }
 
 /// Set an entry on a native list.
@@ -743,6 +1065,12 @@
   bool get isSafeForReordering => false;
 
   accept(Visitor v) => v.visitSetIndex(this);
+
+  void setParentPointers() {
+    object.parent = this;
+    index.parent = this;
+    value.parent = this;
+  }
 }
 
 /// Reads the value of a static field or tears off a static method.
@@ -763,6 +1091,8 @@
   bool get isSafeForReordering {
     return element is FunctionElement || element.isFinal;
   }
+
+  void setParentPointers() {}
 }
 
 /// Sets the value of a static field.
@@ -778,6 +1108,10 @@
 
   bool get isSafeForElimination => false;
   bool get isSafeForReordering => false;
+
+  void setParentPointers() {
+    value.parent = this;
+  }
 }
 
 /// Reads the value of a lazily initialized static field.
@@ -797,6 +1131,10 @@
       : continuation = new Reference<Continuation>(continuation);
 
   accept(Visitor visitor) => visitor.visitGetLazyStatic(this);
+
+  void setParentPointers() {
+    continuation.parent = this;
+  }
 }
 
 /// Creates an object for holding boxed variables captured by a closure.
@@ -805,6 +1143,8 @@
 
   bool get isSafeForElimination => true;
   bool get isSafeForReordering => true;
+
+  void setParentPointers() {}
 }
 
 /// Creates an instance of a class and initializes its fields and runtime type
@@ -835,6 +1175,13 @@
 
   bool get isSafeForElimination => true;
   bool get isSafeForReordering => true;
+
+  toString() => 'CreateInstance($classElement)';
+
+  void setParentPointers() {
+    _setParentsOnList(arguments, this);
+    if (typeInformation != null) _setParentsOnList(typeInformation, this);
+  }
 }
 
 class Interceptor extends Primitive {
@@ -842,6 +1189,18 @@
   final Set<ClassElement> interceptedClasses = new Set<ClassElement>();
   final SourceInformation sourceInformation;
 
+  /// If non-null, all uses of this the interceptor call are guaranteed to
+  /// see this value.
+  ///
+  /// The interceptor call is not immediately replaced by the constant, because
+  /// that might prevent the interceptor from being shared.
+  ///
+  /// The precise input type is not known when sharing interceptors, because
+  /// refinement nodes have been removed by then. So this field carries the
+  /// known constant until we know if it should be shared or replaced by
+  /// the constant.
+  values.InterceptorConstantValue constantValue;
+
   Interceptor(Primitive input, this.sourceInformation)
       : this.input = new Reference<Primitive>(input);
 
@@ -849,6 +1208,10 @@
 
   bool get isSafeForElimination => true;
   bool get isSafeForReordering => true;
+
+  void setParentPointers() {
+    input.parent = this;
+  }
 }
 
 /// Create an instance of [Invocation] for use in a call to `noSuchMethod`.
@@ -863,6 +1226,10 @@
 
   bool get isSafeForElimination => true;
   bool get isSafeForReordering => true;
+
+  void setParentPointers() {
+    _setParentsOnList(arguments, this);
+  }
 }
 
 class ForeignCode extends CallExpression {
@@ -879,32 +1246,45 @@
         this.continuation = new Reference<Continuation>(continuation);
 
   accept(Visitor visitor) => visitor.visitForeignCode(this);
+
+  void setParentPointers() {
+    _setParentsOnList(arguments, this);
+    continuation.parent = this;
+  }
 }
 
 class Constant extends Primitive {
   final values.ConstantValue value;
   final SourceInformation sourceInformation;
 
-  Constant(this.value, {this.sourceInformation});
+  Constant(this.value, {this.sourceInformation}) {
+    assert(value != null);
+  }
 
   accept(Visitor visitor) => visitor.visitConstant(this);
 
   bool get isSafeForElimination => true;
   bool get isSafeForReordering => true;
+
+  void setParentPointers() {}
 }
 
 class LiteralList extends Primitive {
   /// The List type being created; this is not the type argument.
-  final InterfaceType type;
+  final InterfaceType dartType;
   final List<Reference<Primitive>> values;
 
-  LiteralList(this.type, List<Primitive> values)
+  LiteralList(this.dartType, List<Primitive> values)
       : this.values = _referenceList(values);
 
   accept(Visitor visitor) => visitor.visitLiteralList(this);
 
   bool get isSafeForElimination => true;
   bool get isSafeForReordering => true;
+
+  void setParentPointers() {
+    _setParentsOnList(values, this);
+  }
 }
 
 class LiteralMapEntry {
@@ -917,15 +1297,22 @@
 }
 
 class LiteralMap extends Primitive {
-  final InterfaceType type;
+  final InterfaceType dartType;
   final List<LiteralMapEntry> entries;
 
-  LiteralMap(this.type, this.entries);
+  LiteralMap(this.dartType, this.entries);
 
   accept(Visitor visitor) => visitor.visitLiteralMap(this);
 
   bool get isSafeForElimination => true;
   bool get isSafeForReordering => true;
+
+  void setParentPointers() {
+    for (LiteralMapEntry entry in entries) {
+      entry.key.parent = this;
+      entry.value.parent = this;
+    }
+  }
 }
 
 /// Currently unused.
@@ -947,6 +1334,8 @@
 
   bool get isSafeForElimination => true;
   bool get isSafeForReordering => true;
+
+  void setParentPointers() {}
 }
 
 class Parameter extends Primitive {
@@ -954,18 +1343,14 @@
     super.hint = hint;
   }
 
-  // In addition to a parent pointer to the containing Continuation or
-  // FunctionDefinition, parameters have an index into the list of parameters
-  // bound by the parent.  This gives constant-time access to the continuation
-  // from the parent.
-  int parentIndex;
-
   accept(Visitor visitor) => visitor.visitParameter(this);
 
   String toString() => 'Parameter(${hint == null ? null : hint.name})';
 
   bool get isSafeForElimination => true;
   bool get isSafeForReordering => true;
+
+  void setParentPointers() {}
 }
 
 /// Continuations are normally bound by 'let cont'.  A continuation with one
@@ -975,11 +1360,6 @@
   final List<Parameter> parameters;
   Expression body = null;
 
-  // In addition to a parent pointer to the containing LetCont, continuations
-  // have an index into the list of continuations bound by the LetCont.  This
-  // gives constant-time access to the continuation from the parent.
-  int parent_index;
-
   // A continuation is recursive if it has any recursive invocations.
   bool isRecursive;
 
@@ -992,15 +1372,30 @@
       isRecursive = false;
 
   accept(Visitor visitor) => visitor.visitContinuation(this);
+
+  void setParentPointers() {
+    _setParentsOnNodes(parameters, this);
+    if (body != null) body.parent = this;
+  }
+}
+
+/// Common interface for [Primitive] and [MutableVariable].
+abstract class Variable<T extends Variable<T>> extends Definition<T> {
+  /// Type of value held in the variable.
+  ///
+  /// Is `null` until initialized by type propagation.
+  TypeMask type;
 }
 
 /// Identifies a mutable variable.
-class MutableVariable extends Definition {
+class MutableVariable extends Variable<MutableVariable> {
   Entity hint;
 
   MutableVariable(this.hint);
 
   accept(Visitor v) => v.visitMutableVariable(this);
+
+  void setParentPointers() {}
 }
 
 /// A function definition, consisting of parameters and a body.
@@ -1021,6 +1416,13 @@
       this.body);
 
   accept(Visitor visitor) => visitor.visitFunctionDefinition(this);
+
+  void setParentPointers() {
+    if (thisParameter != null) thisParameter.parent = this;
+    _setParentsOnNodes(parameters, this);
+    returnContinuation.parent = this;
+    if (body != null) body.parent = this;
+  }
 }
 
 /// Converts the internal representation of a type to a Dart object of type
@@ -1040,6 +1442,10 @@
 
   bool get isSafeForElimination => true;
   bool get isSafeForReordering => true;
+
+  void setParentPointers() {
+    value.parent = this;
+  }
 }
 
 /// Read the value the type variable [variable] from the target object.
@@ -1060,6 +1466,10 @@
 
   bool get isSafeForElimination => true;
   bool get isSafeForReordering => true;
+
+  void setParentPointers() {
+    target.parent = this;
+  }
 }
 
 /// Representation of a closed type (that is, a type without type variables).
@@ -1085,12 +1495,67 @@
 
   bool get isSafeForElimination => true;
   bool get isSafeForReordering => true;
+
+  void setParentPointers() {
+    _setParentsOnList(arguments, this);
+  }
+}
+
+class Await extends CallExpression {
+  final Reference<Primitive> input;
+  final Reference<Continuation> continuation;
+
+  Await(Primitive input, Continuation continuation)
+    : this.input = new Reference<Primitive>(input),
+      this.continuation = new Reference<Continuation>(continuation);
+
+  @override
+  accept(Visitor visitor) {
+    return visitor.visitAwait(this);
+  }
+
+  void setParentPointers() {
+    input.parent = this;
+    continuation.parent = this;
+  }
+}
+
+class Yield extends CallExpression {
+  final Reference<Primitive> input;
+  final Reference<Continuation> continuation;
+  final bool hasStar;
+
+  Yield(Primitive input, this.hasStar, Continuation continuation)
+    : this.input = new Reference<Primitive>(input),
+      this.continuation = new Reference<Continuation>(continuation);
+
+  @override
+  accept(Visitor visitor) {
+    return visitor.visitYield(this);
+  }
+
+  void setParentPointers() {
+    input.parent = this;
+    continuation.parent = this;
+  }
 }
 
 List<Reference<Primitive>> _referenceList(Iterable<Primitive> definitions) {
   return definitions.map((e) => new Reference<Primitive>(e)).toList();
 }
 
+void _setParentsOnNodes(List<Node> nodes, Node parent) {
+  for (Node node in nodes) {
+    node.parent = parent;
+  }
+}
+
+void _setParentsOnList(List<Reference> nodes, Node parent) {
+  for (Reference node in nodes) {
+    node.parent = parent;
+  }
+}
+
 abstract class Visitor<T> {
   const Visitor();
 
@@ -1118,6 +1583,8 @@
   T visitGetLazyStatic(GetLazyStatic node);
   T visitSetField(SetField node);
   T visitUnreachable(Unreachable node);
+  T visitAwait(Await node);
+  T visitYield(Yield node);
 
   // Definitions.
   T visitLiteralList(LiteralList node);
@@ -1138,28 +1605,32 @@
   T visitTypeExpression(TypeExpression node);
   T visitCreateInvocationMirror(CreateInvocationMirror node);
   T visitTypeTest(TypeTest node);
+  T visitTypeTestViaFlag(TypeTestViaFlag node);
   T visitApplyBuiltinOperator(ApplyBuiltinOperator node);
+  T visitApplyBuiltinMethod(ApplyBuiltinMethod node);
   T visitGetLength(GetLength node);
   T visitGetIndex(GetIndex node);
   T visitSetIndex(SetIndex node);
-
-  // Conditions.
-  T visitIsTrue(IsTrue node);
+  T visitRefinement(Refinement node);
 
   // Support for literal foreign code.
   T visitForeignCode(ForeignCode node);
 }
 
-/// Visits all non-recursive children of a CPS term, i.e. anything
-/// not of type [Expression] or [Continuation].
-/// 
-/// Note that the non-recursive nodes can contain other nodes inside of them,
-/// e.g. [Branch] contains an [IsTrue] which contains a [Reference].
-/// 
+/// Recursively visits all children of a CPS term.
+///
+/// The user of the class is responsible for avoiding stack overflows from
+/// deep recursion, e.g. by overriding methods to cut off recursion at certain
+/// points.
+///
+/// All recursive invocations occur through the [visit] method, which the
+/// subclass may override as a generic way to control the visitor without
+/// overriding all visitor methods.
+///
 /// The `process*` methods are called in pre-order for every node visited.
 /// These can be overridden without disrupting the visitor traversal.
-class LeafVisitor implements Visitor {
-  const LeafVisitor();
+class DeepRecursiveVisitor implements Visitor {
+  const DeepRecursiveVisitor();
 
   visit(Node node) => node.accept(this);
 
@@ -1171,25 +1642,36 @@
     if (node.thisParameter != null) visit(node.thisParameter);
     node.parameters.forEach(visit);
     visit(node.returnContinuation);
+    visit(node.body);
+  }
+
+  processContinuation(Continuation node) {}
+  visitContinuation(Continuation node) {
+    processContinuation(node);
+    node.parameters.forEach(visit);
+    if (node.body != null) visit(node.body);
   }
 
   // Expressions.
-
   processLetPrim(LetPrim node) {}
   visitLetPrim(LetPrim node) {
     processLetPrim(node);
     visit(node.primitive);
+    visit(node.body);
   }
 
   processLetCont(LetCont node) {}
   visitLetCont(LetCont node) {
     processLetCont(node);
     node.continuations.forEach(visit);
+    visit(node.body);
   }
 
   processLetHandler(LetHandler node) {}
   visitLetHandler(LetHandler node) {
     processLetHandler(node);
+    visit(node.handler);
+    visit(node.body);
   }
 
   processLetMutable(LetMutable node) {}
@@ -1197,6 +1679,7 @@
     processLetMutable(node);
     visit(node.variable);
     processReference(node.value);
+    visit(node.body);
   }
 
   processInvokeStatic(InvokeStatic node) {}
@@ -1252,7 +1735,7 @@
     processBranch(node);
     processReference(node.trueContinuation);
     processReference(node.falseContinuation);
-    visit(node.condition);
+    processReference(node.condition);
   }
 
   processTypeCast(TypeCast node) {}
@@ -1267,9 +1750,16 @@
   visitTypeTest(TypeTest node) {
     processTypeTest(node);
     processReference(node.value);
+    if (node.interceptor != null) processReference(node.interceptor);
     node.typeArguments.forEach(processReference);
   }
 
+  processTypeTestViaFlag(TypeTestViaFlag node) {}
+  visitTypeTestViaFlag(TypeTestViaFlag node) {
+    processTypeTestViaFlag(node);
+    processReference(node.interceptor);
+  }
+
   processSetMutable(SetMutable node) {}
   visitSetMutable(SetMutable node) {
     processSetMutable(node);
@@ -1325,18 +1815,6 @@
     processParameter(node);
   }
 
-  processContinuation(Continuation node) {}
-  visitContinuation(Continuation node) {
-    processContinuation(node);
-    node.parameters.forEach(visitParameter);
-  }
-
-  processIsTrue(IsTrue node) {}
-  visitIsTrue(IsTrue node) {
-    processIsTrue(node);
-    processReference(node.value);
-  }
-
   processInterceptor(Interceptor node) {}
   visitInterceptor(Interceptor node) {
     processInterceptor(node);
@@ -1409,6 +1887,13 @@
     node.arguments.forEach(processReference);
   }
 
+  processApplyBuiltinMethod(ApplyBuiltinMethod node) {}
+  visitApplyBuiltinMethod(ApplyBuiltinMethod node) {
+    processApplyBuiltinMethod(node);
+    processReference(node.receiver);
+    node.arguments.forEach(processReference);
+  }
+
   processForeignCode(ForeignCode node) {}
   visitForeignCode(ForeignCode node) {
     processForeignCode(node);
@@ -1423,6 +1908,20 @@
     processUnreachable(node);
   }
 
+  processAwait(Await node) {}
+  visitAwait(Await node) {
+    processAwait(node);
+    processReference(node.input);
+    processReference(node.continuation);
+  }
+
+  processYield(Yield node) {}
+  visitYield(Yield node) {
+    processYield(node);
+    processReference(node.input);
+    processReference(node.continuation);
+  }
+
   processGetLength(GetLength node) {}
   visitGetLength(GetLength node) {
     processGetLength(node);
@@ -1443,34 +1942,40 @@
     processReference(node.index);
     processReference(node.value);
   }
+
+  processRefinement(Refinement node) {}
+  visitRefinement(Refinement node) {
+    processRefinement(node);
+    processReference(node.value);
+  }
 }
 
 typedef void StackAction();
 
 /// Calls `process*` for all nodes in a tree.
 /// For simple usage, only override the `process*` methods.
-/// 
+///
 /// To avoid deep recursion, this class uses an "action stack" containing
 /// callbacks to be invoked after the processing of some term has finished.
-/// 
+///
 /// To avoid excessive overhead from the action stack, basic blocks of
 /// interior nodes are iterated in a loop without using the action stack.
-/// 
+///
 /// The iteration order can be controlled by overriding the `traverse*`
 /// methods for [LetCont], [LetPrim], [LetMutable], [LetHandler] and
 /// [Continuation].
-/// 
+///
 /// The `traverse*` methods return the expression to visit next, and may
 /// push other subterms onto the stack using [push] or [pushAction] to visit
 /// them later. Actions pushed onto the stack will be executed after the body
 /// has been processed (and the stack actions it pushed have been executed).
-/// 
-/// By default, the `traverse` methods visit all non-recursive subterms, 
+///
+/// By default, the `traverse` methods visit all non-recursive subterms,
 /// push all bound continuations on the stack, and return the body of the term.
-/// 
+///
 /// Subclasses should not override the `visit` methods for the nodes that have
 /// a `traverse` method.
-class RecursiveVisitor extends LeafVisitor {
+class TrampolineRecursiveVisitor extends DeepRecursiveVisitor {
   List<StackAction> _stack = <StackAction>[];
 
   void pushAction(StackAction callback) {
@@ -1565,7 +2070,7 @@
 }
 
 /// Visit a just-deleted subterm and unlink all [Reference]s in it.
-class RemovalVisitor extends RecursiveVisitor {
+class RemovalVisitor extends TrampolineRecursiveVisitor {
   processReference(Reference reference) {
     reference.unlink();
   }
diff --git a/pkg/compiler/lib/src/cps_ir/cps_ir_nodes_sexpr.dart b/pkg/compiler/lib/src/cps_ir/cps_ir_nodes_sexpr.dart
index 1a317c4..79164b5 100644
--- a/pkg/compiler/lib/src/cps_ir/cps_ir_nodes_sexpr.dart
+++ b/pkg/compiler/lib/src/cps_ir/cps_ir_nodes_sexpr.dart
@@ -7,7 +7,8 @@
 import '../constants/values.dart';
 import '../util/util.dart';
 import 'cps_ir_nodes.dart';
-import '../universe/universe.dart' show Selector, CallStructure;
+import '../universe/call_structure.dart' show
+    CallStructure;
 
 /// A [Decorator] is a function used by [SExpressionStringifier] to augment the
 /// output produced for a node or reference.  It can be provided to the
@@ -73,24 +74,14 @@
     String conts;
     bool first = true;
     for (Continuation continuation in node.continuations) {
-      String name = newContinuationName(continuation);
-      if (continuation.isRecursive) name = 'rec $name';
-      // TODO(karlklose): this should be changed to `.map(visit).join(' ')`  and
-      // should recurse to [visit].  Currently we can't do that, because the
-      // unstringifier_test produces [LetConts] with dummy arguments on them.
-      String parameters = continuation.parameters
-          .map((p) => '${decorator(p, newValueName(p))}')
-          .join(' ');
-      String body =
-          indentBlock(() => indentBlock(() => visit(continuation.body)));
       if (first) {
         first = false;
-        conts = '($name ($parameters)\n$body)';
+        conts = visit(continuation);
       } else {
         // Each subsequent line is indented additional spaces to align it
         // with the previous continuation.
         String indent = '$indentation${' ' * '(LetCont ('.length}';
-        conts = '$conts\n$indent($name ($parameters)\n$body)';
+        conts = '$conts\n$indent${visit(continuation)}';
       }
     }
     String body = indentBlock(() => visit(node.body));
@@ -117,10 +108,12 @@
   }
 
   String formatArguments(CallStructure call,
-                         List<Reference<Primitive>> arguments) {
+                         List<Reference<Primitive>> arguments,
+                         {bool isIntercepted: false}) {
     int positionalArgumentCount = call.positionalArgumentCount;
-    List<String> args = new List<String>();
-    args.addAll(arguments.getRange(0, positionalArgumentCount).map(access));
+    if (isIntercepted) ++positionalArgumentCount;
+    List<String> args =
+        arguments.getRange(0, positionalArgumentCount).map(access).toList();
     List<String> argumentNames = call.getOrderedNamedArguments();
     for (int i = 0; i < argumentNames.length; ++i) {
       String name = argumentNames[i];
@@ -141,7 +134,8 @@
     String name = node.selector.name;
     String rcv = access(node.receiver);
     String cont = access(node.continuation);
-    String args = formatArguments(node.selector.callStructure, node.arguments);
+    String args = formatArguments(node.selector.callStructure, node.arguments,
+        isIntercepted: node.receiverIsIntercepted);
     return '$indentation(InvokeMethod $rcv $name $args $cont)';
   }
 
@@ -159,8 +153,8 @@
     // constructor calls in the DartBackend, we get an element with no enclosing
     // class.  Clean this up by introducing a name field to the node and
     // removing [ErroneousElement]s from the IR.
-    if (node.type != null) {
-      className = node.type.toString();
+    if (node.dartType != null) {
+      className = node.dartType.toString();
     } else {
       className = node.target.enclosingClass.name;
     }
@@ -192,10 +186,11 @@
   }
 
   String visitBranch(Branch node) {
-    String condition = visit(node.condition);
+    String condition = access(node.condition);
     String trueCont = access(node.trueContinuation);
     String falseCont = access(node.falseContinuation);
-    return '$indentation(Branch $condition $trueCont $falseCont)';
+    String strict = node.isStrictCheck ? 'Strict' : 'NonStrict';
+    return '$indentation(Branch $condition $trueCont $falseCont $strict)';
   }
 
   String visitUnreachable(Unreachable node) {
@@ -214,8 +209,16 @@
   }
 
   String visitContinuation(Continuation node) {
-    // Continuations are visited directly in visitLetCont.
-    return '(Unexpected Continuation)';
+    String name = newContinuationName(node);
+    if (node.isRecursive) name = 'rec $name';
+    // TODO(karlklose): this should be changed to `.map(visit).join(' ')`  and
+    // should recurse to [visit].  Currently we can't do that, because the
+    // unstringifier_test produces [LetConts] with dummy arguments on them.
+    String parameters = node.parameters
+        .map((p) => '${decorator(p, newValueName(p))}')
+        .join(' ');
+    String body = indentBlock(() => indentBlock(() => visit(node.body)));
+    return '($name ($parameters)\n$body)';
   }
 
   String visitGetMutable(GetMutable node) {
@@ -231,13 +234,22 @@
     String value = access(node.value);
     String cont = access(node.continuation);
     String typeArguments = node.typeArguments.map(access).join(' ');
-    return '$indentation(TypeCast $value ${node.type} ($typeArguments) $cont)';
+    return '$indentation(TypeCast $value ${node.dartType}'
+                         ' ($typeArguments) $cont)';
   }
 
   String visitTypeTest(TypeTest node) {
     String value = access(node.value);
     String typeArguments = node.typeArguments.map(access).join(' ');
-    return '(TypeTest $value ${node.type} ($typeArguments))';
+    String interceptor = node.interceptor == null
+        ? ''
+        : access(node.interceptor);
+    return '(TypeTest $value ${node.dartType} ($typeArguments) ($interceptor))';
+  }
+
+  String visitTypeTestViaFlag(TypeTestViaFlag node) {
+    String interceptor = access(node.interceptor);
+    return '(TypeTestViaFlag $interceptor ${node.dartType})';
   }
 
   String visitLiteralList(LiteralList node) {
@@ -251,11 +263,6 @@
     return '(LiteralMap ($keys) ($values))';
   }
 
-  String visitIsTrue(IsTrue node) {
-    String value = access(node.value);
-    return '(IsTrue $value)';
-  }
-
   String visitSetField(SetField node) {
     String object = access(node.object);
     String field = node.field.name;
@@ -294,7 +301,7 @@
     String className = node.classElement.name;
     String arguments = node.arguments.map(access).join(' ');
     String typeInformation = node.typeInformation.map(access).join(' ');
-    return '(CreateInstance $className ($arguments)$typeInformation)';
+    return '(CreateInstance $className ($arguments) ($typeInformation))';
   }
 
   String visitInterceptor(Interceptor node) {
@@ -326,11 +333,19 @@
     return '(ApplyBuiltinOperator $operator ($args))';
   }
 
+  String visitApplyBuiltinMethod(ApplyBuiltinMethod node) {
+    String method = node.method.toString();
+    String receiver = access(node.receiver);
+    String args = node.arguments.map(access).join(' ');
+    return '(ApplyBuiltinMethod $method $receiver ($args))';
+  }
+
   String visitForeignCode(ForeignCode node) {
     String arguments = node.arguments.map(access).join(' ');
     String continuation = node.continuation == null ? ''
         : ' ${access(node.continuation)}';
-    return '(JS ${node.type} ${node.codeTemplate} ($arguments)$continuation)';
+    return '$indentation(JS "${node.codeTemplate.source}"'
+        ' ($arguments)$continuation)';
   }
 
   String visitGetLength(GetLength node) {
@@ -350,6 +365,25 @@
     String value = access(node.value);
     return '(SetIndex $object $index $value)';
   }
+
+  @override
+  String visitAwait(Await node) {
+    String value = access(node.input);
+    String continuation = access(node.continuation);
+    return '(Await $value $continuation)';
+  }
+
+  @override
+  String visitYield(Yield node) {
+    String value = access(node.input);
+    String continuation = access(node.continuation);
+    return '(Yield $value $continuation)';
+  }
+
+  String visitRefinement(Refinement node) {
+    String value = access(node.value);
+    return '(Refinement $value ${node.type})';
+  }
 }
 
 class ConstantStringifier extends ConstantValueVisitor<String, Null> {
@@ -412,11 +446,11 @@
   }
 
   String visitInterceptor(InterceptorConstantValue constant, _) {
-    return _failWith(constant);
+    return '(Interceptor "${constant.unparse()}")';
   }
 
   String visitSynthetic(SyntheticConstantValue constant, _) {
-    return _failWith(constant);
+    return '(Synthetic "${constant.unparse()}")';
   }
 
   String visitDeferred(DeferredConstantValue constant, _) {
diff --git a/pkg/compiler/lib/src/cps_ir/cps_ir_tracer.dart b/pkg/compiler/lib/src/cps_ir/cps_ir_tracer.dart
index ba67e95..1b4d2f4 100644
--- a/pkg/compiler/lib/src/cps_ir/cps_ir_tracer.dart
+++ b/pkg/compiler/lib/src/cps_ir/cps_ir_tracer.dart
@@ -5,7 +5,7 @@
 library dart2js.ir_tracer;
 
 import 'dart:async' show EventSink;
-import 'cps_ir_nodes.dart' as cps_ir hide Function;
+import 'cps_ir_nodes.dart' as cps_ir;
 import '../tracer.dart';
 
 /**
@@ -82,7 +82,10 @@
       });
       tag("HIR", () {
         if (entryPointParameters != null) {
-          String params = entryPointParameters.map(names.name).join(', ');
+          String formatParameter(cps_ir.Parameter param) {
+            return '${names.name(param)} ${param.type}';
+          }
+          String params = entryPointParameters.map(formatParameter).join(', ');
           printStmt('x0', 'Entry ($params)');
         }
         for (cps_ir.Parameter param in block.parameters) {
@@ -103,7 +106,8 @@
 
   visitLetPrim(cps_ir.LetPrim node) {
     String id = names.name(node.primitive);
-    printStmt(id, "LetPrim $id = ${formatPrimitive(node.primitive)}");
+    String primitive = visit(node.primitive);
+    printStmt(id, "LetPrim $id = $primitive [type=${node.primitive.type}]");
     visit(node.body);
   }
 
@@ -115,7 +119,7 @@
         String name = names.name(cont);
         return cont.isRecursive ? '$name*' : name;
       }
-      
+
       String ids = node.continuations.map(nameContinuation).join(', ');
       printStmt(dummy, "LetCont $ids");
     }
@@ -215,7 +219,7 @@
     String value = formatReference(node.value);
     String args = node.typeArguments.map(formatReference).join(', ');
     String kont = formatReference(node.continuation);
-    printStmt(dummy, "TypeCast ($value ${node.type} ($args)) $kont");
+    printStmt(dummy, "TypeCast ($value ${node.dartType} ($args)) $kont");
   }
 
   visitInvokeContinuation(cps_ir.InvokeContinuation node) {
@@ -227,10 +231,26 @@
 
   visitBranch(cps_ir.Branch node) {
     String dummy = names.name(node);
-    String condition = visit(node.condition);
+    String condition = formatReference(node.condition);
     String trueCont = formatReference(node.trueContinuation);
     String falseCont = formatReference(node.falseContinuation);
-    printStmt(dummy, "Branch $condition ($trueCont, $falseCont)");
+    String strict = node.isStrictCheck ? "Strict" : "NonStrict";
+    printStmt(dummy, "Branch $condition ($trueCont, $falseCont) $strict");
+  }
+
+  visitAwait(cps_ir.Await node) {
+    String dummy = names.name(node);
+    String value = formatReference(node.input);
+    String continuation = formatReference(node.continuation);
+    printStmt(dummy, 'Await $value $continuation');
+  }
+
+  visitYield(cps_ir.Yield node) {
+    String dummy = names.name(node);
+    String name = node.hasStar ? 'YieldStar' : 'Yield';
+    String value = formatReference(node.input);
+    String continuation = formatReference(node.continuation);
+    printStmt(dummy, '$name $value $continuation');
   }
 
   visitSetMutable(cps_ir.SetMutable node) {
@@ -248,8 +268,6 @@
     }
   }
 
-  String formatPrimitive(cps_ir.Primitive p) => visit(p);
-
   visitConstant(cps_ir.Constant node) {
     return "Constant ${node.value.toStructuredString()}";
   }
@@ -266,10 +284,6 @@
     return "Continuation ${names.name(node)}";
   }
 
-  visitIsTrue(cps_ir.IsTrue node) {
-    return "IsTrue(${names.name(node.value.definition)})";
-  }
-
   visitSetField(cps_ir.SetField node) {
     String object = formatReference(node.object);
     String field = node.field.name;
@@ -347,7 +361,15 @@
   visitTypeTest(cps_ir.TypeTest node) {
     String value = formatReference(node.value);
     String args = node.typeArguments.map(formatReference).join(', ');
-    return "TypeTest ($value ${node.type} ($args))";
+    String interceptor = node.interceptor == null
+        ? ''
+        : ' ${formatReference(node.interceptor)}';
+    return "TypeTest ($value ${node.dartType} ($args)$interceptor)";
+  }
+
+  visitTypeTestViaFlag(cps_ir.TypeTestViaFlag node) {
+    String interceptor = formatReference(node.interceptor);
+    return "TypeTestViaFlag ($interceptor ${node.dartType})";
   }
 
   visitApplyBuiltinOperator(cps_ir.ApplyBuiltinOperator node) {
@@ -356,6 +378,13 @@
     return 'ApplyBuiltinOperator $operator ($args)';
   }
 
+  visitApplyBuiltinMethod(cps_ir.ApplyBuiltinMethod node) {
+    String method = node.method.toString();
+    String receiver = formatReference(node.receiver);
+    String args = node.arguments.map(formatReference).join(', ');
+    return 'ApplyBuiltinMethod $method $receiver ($args)';
+  }
+
   @override
   visitForeignCode(cps_ir.ForeignCode node) {
     String id = names.name(node);
@@ -382,6 +411,12 @@
     String value = formatReference(node.value);
     return 'SetIndex $object $index $value';
   }
+
+  @override
+  visitRefinement(cps_ir.Refinement node) {
+    String value = formatReference(node.value);
+    return 'Refinement $value ${node.type}';
+  }
 }
 
 /**
@@ -593,10 +628,6 @@
     unexpectedNode(node);
   }
 
-  visitIsTrue(cps_ir.IsTrue node) {
-    unexpectedNode(node);
-  }
-
   visitInterceptor(cps_ir.Interceptor node) {
     unexpectedNode(node);
   }
@@ -621,10 +652,18 @@
     unexpectedNode(node);
   }
 
+  visitTypeTestViaFlag(cps_ir.TypeTestViaFlag node) {
+    unexpectedNode(node);
+  }
+
   visitApplyBuiltinOperator(cps_ir.ApplyBuiltinOperator node) {
     unexpectedNode(node);
   }
 
+  visitApplyBuiltinMethod(cps_ir.ApplyBuiltinMethod node) {
+    unexpectedNode(node);
+  }
+
   visitGetLength(cps_ir.GetLength node) {
     unexpectedNode(node);
   }
@@ -653,4 +692,19 @@
   visitForeignCode(cps_ir.ForeignCode node) {
     addEdgeToContinuation(node.continuation);
   }
+
+  @override
+  visitAwait(cps_ir.Await node) {
+    addEdgeToContinuation(node.continuation);
+  }
+
+  @override
+  visitYield(cps_ir.Yield node) {
+    addEdgeToContinuation(node.continuation);
+  }
+
+  @override
+  visitRefinement(cps_ir.Refinement node) {
+    unexpectedNode(node);
+  }
 }
diff --git a/pkg/compiler/lib/src/cps_ir/insert_refinements.dart b/pkg/compiler/lib/src/cps_ir/insert_refinements.dart
new file mode 100644
index 0000000..e9a0364
--- /dev/null
+++ b/pkg/compiler/lib/src/cps_ir/insert_refinements.dart
@@ -0,0 +1,219 @@
+// 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 cps_ir.optimization.insert_refinements;
+
+import 'optimizers.dart' show Pass;
+import 'cps_ir_nodes.dart';
+import '../common/names.dart';
+import '../types/types.dart' show TypeMask;
+import 'type_mask_system.dart';
+
+/// Inserts [Refinement] nodes in the IR to allow for sparse path-sensitive
+/// type analysis in the [TypePropagator] pass.
+///
+/// Refinement nodes are inserted at the arms of a [Branch] node with a
+/// condition of form `x is T` or `x == null`.
+///
+/// Refinement nodes are inserted after a method invocation to refine the
+/// receiver to the types that can respond to the given selector.
+class InsertRefinements extends TrampolineRecursiveVisitor implements Pass {
+  String get passName => 'Insert refinement nodes';
+
+  final TypeMaskSystem types;
+
+  /// Maps unrefined primitives to its refinement currently in scope (if any).
+  final Map<Primitive, Refinement> refinementFor = <Primitive, Refinement>{};
+
+  InsertRefinements(this.types);
+
+  void rewrite(FunctionDefinition node) {
+    visit(node.body);
+  }
+
+  /// Updates references to refer to the refinement currently in scope.
+  void processReference(Reference node) {
+    Refinement refined = refinementFor[node.definition];
+    if (refined != null) {
+      node.changeTo(refined);
+    }
+  }
+
+  /// Sinks the binding of [cont] to immediately above [use].
+  ///
+  /// This is used to ensure that everything in scope at [use] is also in scope
+  /// inside [cont], so refinements can be inserted inside [cont] without
+  /// accidentally referencing a primitive out of scope.
+  ///
+  /// It is always safe to do this for single-use continuations, because
+  /// strictly more things are in scope at the use site, and there can't be any
+  /// other use of [cont] that might fall out of scope since there is only
+  /// that single use.
+  void sinkContinuationToUse(Continuation cont, Expression use) {
+    assert(cont.hasExactlyOneUse && cont.firstRef.parent == use);
+    assert(!cont.isRecursive);
+    LetCont let = cont.parent;
+    InteriorNode useParent = use.parent;
+    if (useParent == let) return;
+    if (let.continuations.length > 1) {
+      // Create a new LetCont binding only this continuation.
+      let.continuations.remove(cont);
+      let = new LetCont(cont, null);
+      cont.parent = let;
+    } else {
+      let.remove(); // Reuse the existing LetCont.
+    }
+    let.insertAbove(use);
+  }
+
+  Primitive unfoldInterceptor(Primitive prim) {
+    return prim is Interceptor ? prim.input.definition : prim;
+  }
+
+  /// Enqueues [cont] for processing in a context where [refined] is the
+  /// current refinement for its value.
+  void pushRefinement(Continuation cont, Refinement refined) {
+    Primitive value = refined.effectiveDefinition;
+    Primitive currentRefinement = refinementFor[value];
+    pushAction(() {
+      refinementFor[value] = currentRefinement;
+      if (refined.hasNoUses) {
+        // Clean up refinements that are not used.
+        refined.destroy();
+      } else {
+        LetPrim let = new LetPrim(refined);
+        refined.parent = let;
+        let.insertBelow(cont);
+      }
+    });
+    push(cont);
+    pushAction(() {
+      refinementFor[value] = refined;
+    });
+  }
+
+  void visitInvokeMethod(InvokeMethod node) {
+    Continuation cont = node.continuation.definition;
+
+    // Update references to their current refined values.
+    processReference(node.receiver);
+    node.arguments.forEach(processReference);
+
+    // If the call is intercepted, we want to refine the actual receiver,
+    // not the interceptor.
+    Primitive receiver = unfoldInterceptor(node.receiver.definition);
+
+    // Sink the continuation to the call to ensure everything in scope
+    // here is also in scope inside the continuations.
+    sinkContinuationToUse(cont, node);
+
+    if (node.selector.isClosureCall) {
+      // Do not try to refine the receiver of closure calls; the class world
+      // does not know about closure classes.
+      push(cont);
+    } else {
+      // Filter away receivers that throw on this selector.
+      TypeMask type = types.receiverTypeFor(node.selector, node.mask);
+      Refinement refinement = new Refinement(receiver, type);
+      pushRefinement(cont, refinement);
+    }
+  }
+
+  CallExpression getCallWithResult(Primitive prim) {
+    if (prim is Parameter && prim.parent is Continuation) {
+      Continuation cont = prim.parent;
+      if (cont.hasExactlyOneUse && cont.firstRef.parent is CallExpression) {
+        return cont.firstRef.parent;
+      }
+    }
+    return null;
+  }
+
+  bool isTrue(Primitive prim) {
+    return prim is Constant && prim.value.isTrue;
+  }
+
+  void visitBranch(Branch node) {
+    processReference(node.condition);
+    Primitive condition = node.condition.definition;
+    CallExpression call = getCallWithResult(condition);
+
+    Continuation trueCont = node.trueContinuation.definition;
+    Continuation falseCont = node.falseContinuation.definition;
+
+    // Sink both continuations to the Branch to ensure everything in scope
+    // here is also in scope inside the continuations.
+    sinkContinuationToUse(trueCont, node);
+    sinkContinuationToUse(falseCont, node);
+
+    // If the condition is an 'is' check, promote the checked value.
+    if (condition is TypeTest) {
+      Primitive value = condition.value.definition;
+      TypeMask type = types.subtypesOf(condition.dartType);
+      Primitive refinedValue = new Refinement(value, type);
+      pushRefinement(trueCont, refinedValue);
+      push(falseCont);
+      return;
+    }
+
+    // If the condition is comparison with a constant, promote the other value.
+    // This can happen either for calls to `==` or `identical` calls, such
+    // as the ones inserted by the unsugaring pass.
+
+    void refineEquality(Primitive first,
+                        Primitive second,
+                        Continuation trueCont,
+                        Continuation falseCont) {
+      if (second is Constant && second.value.isNull) {
+        Refinement refinedTrue = new Refinement(first, types.nullType);
+        Refinement refinedFalse = new Refinement(first, types.nonNullType);
+        pushRefinement(trueCont, refinedTrue);
+        pushRefinement(falseCont, refinedFalse);
+      } else if (first is Constant && first.value.isNull) {
+        Refinement refinedTrue = new Refinement(second, types.nullType);
+        Refinement refinedFalse = new Refinement(second, types.nonNullType);
+        pushRefinement(trueCont, refinedTrue);
+        pushRefinement(falseCont, refinedFalse);
+      } else {
+        push(trueCont);
+        push(falseCont);
+      }
+    }
+
+    if (call is InvokeMethod && call.selector == Selectors.equals) {
+      refineEquality(call.arguments[0].definition,
+                     call.arguments[1].definition,
+                     trueCont,
+                     falseCont);
+      return;
+    }
+
+    if (condition is ApplyBuiltinOperator &&
+        condition.operator == BuiltinOperator.Identical) {
+      refineEquality(condition.arguments[0].definition,
+                     condition.arguments[1].definition,
+                     trueCont,
+                     falseCont);
+      return;
+    }
+
+    push(trueCont);
+    push(falseCont);
+  }
+
+  @override
+  Expression traverseLetCont(LetCont node) {
+    for (Continuation cont in node.continuations) {
+      if (cont.hasExactlyOneUse &&
+          (cont.firstRef.parent is InvokeMethod ||
+           cont.firstRef.parent is Branch)) {
+        // Do not push the continuation here.
+        // visitInvokeMethod and visitBranch will do that.
+      } else {
+        push(cont);
+      }
+    }
+    return node.body;
+  }
+}
diff --git a/pkg/compiler/lib/src/cps_ir/let_sinking.dart b/pkg/compiler/lib/src/cps_ir/let_sinking.dart
deleted file mode 100644
index 4c4736a..0000000
--- a/pkg/compiler/lib/src/cps_ir/let_sinking.dart
+++ /dev/null
@@ -1,257 +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.
-
-library dart2js.cps_ir.let_sinking;
-
-import 'cps_ir_nodes.dart';
-import 'optimizers.dart';
-
-/// Sinks single-use primitives to the use when this is safe and profitable.
-///
-/// To avoid sinking non-constant primitives into loops, this pass performs a
-/// control-flow analysis to determine the effective nesting of loops.
-///
-/// In the example below, the value 'p' can be sunk to its use site in the
-/// 'else' branch because that branch is not effectively part of a loop,
-/// despite being lexically nested in a recursive continuation.
-///
-///   let prim p = getInterceptor(<something>)
-///   let rec kont x =
-///     if (<loop condition>)
-///       <loop body>
-///       InvokeContinuation kont x'
-///     else
-///       <after loop>
-///       return p.foo()
-///
-class LetSinker extends RecursiveVisitor implements Pass {
-  String get passName => 'Let sinking';
-
-  LoopHierarchy loopHierarchy;
-  List<Continuation> stack = <Continuation>[];
-
-  /// Maps a sinkable primitive to its loop header.
-  Map<Primitive, Continuation> loopHeaderForPrimitive =
-      <Primitive, Continuation>{};
-
-  Continuation currentLoopHeader;
-
-  void rewrite(FunctionDefinition node) {
-    new ParentVisitor().visit(node);
-    loopHierarchy = new LoopHierarchy(node);
-    visit(node.body);
-  }
-
-  @override
-  Expression traverseLetPrim(LetPrim node) {
-    Primitive prim = node.primitive;
-    if (prim.hasExactlyOneUse && prim.isSafeForReordering) {
-      // This can potentially be sunk. Register the loop header, so when we
-      // find the use site, we can check if they are in the same loop.
-      loopHeaderForPrimitive[prim] = currentLoopHeader;
-      pushAction(() {
-        if (node.primitive != null) {
-          // The primitive could not be sunk. Try to sink dependencies here.
-          visit(node.primitive);
-        } else {
-          // The primitive was sunk. Destroy the old LetPrim.
-          InteriorNode parent = node.parent;
-          parent.body = node.body;
-          node.body.parent = parent;
-        }
-      });
-    } else {
-      visit(node.primitive);
-    }
-
-    // Visit the body, wherein this primitive may be sunk to its use site.
-    return node.body;
-  }
-
-  @override
-  Expression traverseContinuation(Continuation cont) {
-    Continuation oldLoopHeader = currentLoopHeader;
-    pushAction(() {
-      currentLoopHeader = oldLoopHeader;
-    });
-    currentLoopHeader = loopHierarchy.getLoopHeader(cont);
-    return cont.body;
-  }
-
-  void processReference(Reference ref) {
-    Definition definition = ref.definition;
-    if (definition is Primitive && 
-        definition is! Parameter &&
-        definition.hasExactlyOneUse &&
-        definition.isSafeForReordering) {
-      // Check if use is in the same loop.
-      Continuation bindingLoop = loopHeaderForPrimitive.remove(definition);
-      if (bindingLoop == currentLoopHeader || definition is Constant) {
-        // Sink the definition.
-
-        Expression use = getEnclosingExpression(ref.parent);
-        LetPrim binding = definition.parent;
-        binding.primitive = null;  // Mark old binding for deletion.
-        LetPrim newBinding = new LetPrim(definition);
-        definition.parent = newBinding;
-        InteriorNode useParent = use.parent;
-        useParent.body = newBinding;
-        newBinding.body = use;
-        use.parent = newBinding;
-        newBinding.parent = useParent;
-
-        // Now that the final binding location has been found, sink the
-        // dependencies of the definition down here as well.
-        visit(definition); 
-      }
-    }
-  }
-
-  Expression getEnclosingExpression(Node node) {
-    while (node is! Expression) {
-      node = node.parent;
-    }
-    return node;
-  }
-}
-
-/// Determines the effective nesting of loops.
-/// 
-/// The effective nesting of loops is different from the lexical nesting, since
-/// recursive continuations can generally contain all the code following 
-/// after the loop in addition to the looping code itself.
-/// 
-/// For example, the 'else' branch below is not effectively part of the loop:
-/// 
-///   let rec kont x = 
-///     if (<loop condition>) 
-///       <loop body>
-///       InvokeContinuation kont x'
-///     else 
-///       <after loop>
-///       return p.foo()
-/// 
-/// We use the term "loop" to mean recursive continuation.
-/// The `null` value is used to represent a context not part of any loop.
-class LoopHierarchy {
-  /// Nesting depth of the given loop.
-  Map<Continuation, int> loopDepth = <Continuation, int>{};
-
-  /// The innermost loop (other than itself) that may be invoked recursively
-  /// as a result of invoking the given continuation.
-  Map<Continuation, Continuation> loopTarget = <Continuation, Continuation>{};
-
-  /// Current nesting depth.
-  int currentDepth = 0;
-
-  /// Computes the loop hierarchy for the given function.
-  /// 
-  /// Parent pointers must be computed for [node].
-  LoopHierarchy(FunctionDefinition node) {
-    _processBlock(node.body, null);
-  }
-
-  /// Returns the innermost loop which [cont] is effectively part of.
-  Continuation getLoopHeader(Continuation cont) {
-    return cont.isRecursive ? cont : loopTarget[cont];
-  }
-
-  /// Marks the innermost loop as a subloop of the other loop.
-  /// 
-  /// Returns the innermost loop.
-  /// 
-  /// Both continuations, [c1] and [c2] may be null (i.e. no loop).
-  /// 
-  /// A loop is said to be a subloop of an enclosing loop if it can invoke
-  /// that loop recursively. This information is stored in [loopTarget].
-  /// 
-  /// This method is only invoked with two distinct loops if there is a
-  /// point that can reach a recursive invocation of both loops.
-  /// This implies that one loop is nested in the other, because they must
-  /// both be in scope at that point.
-  Continuation _markInnerLoop(Continuation c1, Continuation c2) {
-    assert(c1 == null || c1.isRecursive);
-    assert(c2 == null || c2.isRecursive);
-    if (c1 == null) return c2;
-    if (c2 == null) return c1;
-    if (c1 == c2) return c1;
-    if (loopDepth[c1] > loopDepth[c2]) {
-      loopTarget[c1] = _markInnerLoop(loopTarget[c1], c2);
-      return c1;
-    } else {
-      loopTarget[c2] = _markInnerLoop(loopTarget[c2], c1);
-      return c2;
-    }
-  }
-
-  /// Analyzes the body of [cont] and returns the innermost loop
-  /// that can be invoked recursively from [cont] (other than [cont] itself).
-  /// 
-  /// [catchLoop] is the innermost loop that can be invoked recursively
-  /// from the current exception handler.
-  Continuation _processContinuation(Continuation cont, Continuation catchLoop) {
-    if (cont.isRecursive) {
-      ++currentDepth;
-      loopDepth[cont] = currentDepth;
-      Continuation target = _processBlock(cont.body, catchLoop);
-      _markInnerLoop(loopTarget[cont], target);
-      --currentDepth;
-    } else {
-      loopTarget[cont] = _processBlock(cont.body, catchLoop);
-    }
-    return loopTarget[cont];
-  }
-
-  bool _isCallContinuation(Continuation cont) {
-    return cont.hasExactlyOneUse && cont.firstRef.parent is CallExpression;
-  }
-
-  /// Analyzes a basic block and returns the innermost loop that
-  /// can be invoked recursively from that block.
-  Continuation _processBlock(Expression node, Continuation catchLoop) {
-    List<Continuation> callContinuations = <Continuation>[];
-    for (; node is! TailExpression; node = node.next) {
-      if (node is LetCont) {
-        for (Continuation cont in node.continuations) {
-          if (!_isCallContinuation(cont)) {
-            // Process non-call continuations at the binding site, so they
-            // their loop target is known at all use sites.
-            _processContinuation(cont, catchLoop);
-          } else {
-            // To avoid deep recursion, do not analyze call continuations
-            // recursively. This basic block traversal steps into the
-            // call contiunation after visiting its use site. We store the
-            // continuations in a list so we can set the loop target once
-            // it is known.
-            callContinuations.add(cont);
-          }
-        }
-      } else if (node is LetHandler) {
-        catchLoop = _processContinuation(node.handler, catchLoop);
-      }
-    }
-    Continuation target;
-    if (node is InvokeContinuation) {
-      if (node.isRecursive) {
-        target = node.continuation.definition;
-      } else {
-        target = loopTarget[node.continuation.definition];
-      }
-    } else if (node is Branch) {
-      target = _markInnerLoop(
-          loopTarget[node.trueContinuation.definition],
-          loopTarget[node.falseContinuation.definition]);
-    } else {
-      assert(node is Unreachable || node is Throw);
-    }
-    target = _markInnerLoop(target, catchLoop);
-    for (Continuation cont in callContinuations) {
-      // Store the loop target on each call continuation in the basic block.
-      // Because we walk over call continuations as part of the basic block
-      // traversal, these do not get their loop target set otherwise.
-      loopTarget[cont] = target;
-    }
-    return target;
-  }
-}
diff --git a/pkg/compiler/lib/src/cps_ir/loop_hierarchy.dart b/pkg/compiler/lib/src/cps_ir/loop_hierarchy.dart
new file mode 100644
index 0000000..fc63944
--- /dev/null
+++ b/pkg/compiler/lib/src/cps_ir/loop_hierarchy.dart
@@ -0,0 +1,153 @@
+// 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 dart2js.cps_ir.loop_hierarchy;
+
+import 'cps_ir_nodes.dart';
+
+/// Determines the effective nesting of loops.
+/// 
+/// The effective nesting of loops is different from the lexical nesting, since
+/// recursive continuations can generally contain all the code following 
+/// after the loop in addition to the looping code itself.
+/// 
+/// For example, the 'else' branch below is not effectively part of the loop:
+/// 
+///   let rec kont x = 
+///     if (<loop condition>) 
+///       <loop body>
+///       InvokeContinuation kont x'
+///     else 
+///       <after loop>
+///       return p.foo()
+/// 
+/// We use the term "loop" to mean recursive continuation.
+/// The `null` value is used to represent a context not part of any loop.
+class LoopHierarchy {
+  /// Nesting depth of the given loop.
+  Map<Continuation, int> loopDepth = <Continuation, int>{};
+
+  /// The innermost loop (other than itself) that may be invoked recursively
+  /// as a result of invoking the given continuation.
+  Map<Continuation, Continuation> loopTarget = <Continuation, Continuation>{};
+
+  /// Current nesting depth.
+  int currentDepth = 0;
+
+  /// Computes the loop hierarchy for the given function.
+  /// 
+  /// Parent pointers must be computed for [node].
+  LoopHierarchy(FunctionDefinition node) {
+    _processBlock(node.body, null);
+  }
+
+  /// Returns the innermost loop which [cont] is effectively part of.
+  Continuation getLoopHeader(Continuation cont) {
+    return cont.isRecursive ? cont : loopTarget[cont];
+  }
+
+  /// Returns the innermost loop which the given loop is part of, other
+  /// than itself.
+  Continuation getEnclosingLoop(Continuation loop) {
+    return loopTarget[loop];
+  }
+
+  /// Marks the innermost loop as a subloop of the other loop.
+  /// 
+  /// Returns the innermost loop.
+  /// 
+  /// Both continuations, [c1] and [c2] may be null (i.e. no loop).
+  /// 
+  /// A loop is said to be a subloop of an enclosing loop if it can invoke
+  /// that loop recursively. This information is stored in [loopTarget].
+  /// 
+  /// This method is only invoked with two distinct loops if there is a
+  /// point that can reach a recursive invocation of both loops.
+  /// This implies that one loop is nested in the other, because they must
+  /// both be in scope at that point.
+  Continuation _markInnerLoop(Continuation c1, Continuation c2) {
+    assert(c1 == null || c1.isRecursive);
+    assert(c2 == null || c2.isRecursive);
+    if (c1 == null) return c2;
+    if (c2 == null) return c1;
+    if (c1 == c2) return c1;
+    if (loopDepth[c1] > loopDepth[c2]) {
+      loopTarget[c1] = _markInnerLoop(loopTarget[c1], c2);
+      return c1;
+    } else {
+      loopTarget[c2] = _markInnerLoop(loopTarget[c2], c1);
+      return c2;
+    }
+  }
+
+  /// Analyzes the body of [cont] and returns the innermost loop
+  /// that can be invoked recursively from [cont] (other than [cont] itself).
+  /// 
+  /// [catchLoop] is the innermost loop that can be invoked recursively
+  /// from the current exception handler.
+  Continuation _processContinuation(Continuation cont, Continuation catchLoop) {
+    if (cont.isRecursive) {
+      ++currentDepth;
+      loopDepth[cont] = currentDepth;
+      Continuation target = _processBlock(cont.body, catchLoop);
+      _markInnerLoop(loopTarget[cont], target);
+      --currentDepth;
+    } else {
+      loopTarget[cont] = _processBlock(cont.body, catchLoop);
+    }
+    return loopTarget[cont];
+  }
+
+  bool _isCallContinuation(Continuation cont) {
+    return cont.hasExactlyOneUse && cont.firstRef.parent is CallExpression;
+  }
+
+  /// Analyzes a basic block and returns the innermost loop that
+  /// can be invoked recursively from that block.
+  Continuation _processBlock(Expression node, Continuation catchLoop) {
+    List<Continuation> callContinuations = <Continuation>[];
+    for (; node is! TailExpression; node = node.next) {
+      if (node is LetCont) {
+        for (Continuation cont in node.continuations) {
+          if (!_isCallContinuation(cont)) {
+            // Process non-call continuations at the binding site, so they
+            // their loop target is known at all use sites.
+            _processContinuation(cont, catchLoop);
+          } else {
+            // To avoid deep recursion, do not analyze call continuations
+            // recursively. This basic block traversal steps into the
+            // call contiunation after visiting its use site. We store the
+            // continuations in a list so we can set the loop target once
+            // it is known.
+            callContinuations.add(cont);
+          }
+        }
+      } else if (node is LetHandler) {
+        catchLoop = _processContinuation(node.handler, catchLoop);
+      }
+    }
+    Continuation target;
+    if (node is InvokeContinuation) {
+      if (node.isRecursive) {
+        target = node.continuation.definition;
+      } else {
+        target = loopTarget[node.continuation.definition];
+      }
+    } else if (node is Branch) {
+      target = _markInnerLoop(
+          loopTarget[node.trueContinuation.definition],
+          loopTarget[node.falseContinuation.definition]);
+    } else {
+      assert(node is Unreachable || node is Throw);
+    }
+    target = _markInnerLoop(target, catchLoop);
+    for (Continuation cont in callContinuations) {
+      // Store the loop target on each call continuation in the basic block.
+      // Because we walk over call continuations as part of the basic block
+      // traversal, these do not get their loop target set otherwise.
+      loopTarget[cont] = target;
+    }
+    return target;
+  }
+}
diff --git a/pkg/compiler/lib/src/cps_ir/mutable_ssa.dart b/pkg/compiler/lib/src/cps_ir/mutable_ssa.dart
index d01c3f5..d4630b5 100644
--- a/pkg/compiler/lib/src/cps_ir/mutable_ssa.dart
+++ b/pkg/compiler/lib/src/cps_ir/mutable_ssa.dart
@@ -12,7 +12,7 @@
 ///
 /// We do not rewrite variables that have an assignment inside a try block that
 /// does not contain its declaration.
-class MutableVariablePreanalysis extends RecursiveVisitor {
+class MutableVariablePreanalysis extends TrampolineRecursiveVisitor {
   // Number of try blocks enclosing the current position.
   int currentDepth = 0;
 
@@ -114,12 +114,6 @@
            cont.firstRef.parent is InvokeContinuation;
   }
 
-  void removeNode(InteriorNode node) {
-    InteriorNode parent = node.parent;
-    parent.body = node.body;
-    node.body.parent = parent;
-  }
-
   /// If some useful source information is attached to exactly one of the
   /// two definitions, the information is copied onto the other.
   void mergeHints(MutableVariable variable, Primitive value) {
@@ -139,7 +133,8 @@
   /// Continuations to be processed are put on the stack for later processing.
   void processBlock(Expression node,
                     Map<MutableVariable, Primitive> environment) {
-    for (; node is! TailExpression; node = node.next) {
+    Expression next = node.next;
+    for (; node is! TailExpression; node = next, next = node.next) {
       if (node is LetMutable && shouldRewrite(node.variable)) {
         // Put the new mutable variable on the stack while processing the body,
         // and pop it off again when done with the body.
@@ -155,7 +150,7 @@
 
         // Remove the mutable variable binding.
         node.value.unlink();
-        removeNode(node);
+        node.remove();
       } else if (node is LetPrim && node.primitive is SetMutable) {
         SetMutable setter = node.primitive;
         MutableVariable variable = setter.variable.definition;
@@ -165,7 +160,7 @@
           environment[variable] = setter.value.definition;
           mergeHints(variable, setter.value.definition);
           setter.value.unlink();
-          removeNode(node);
+          node.remove();
         }
       } else if (node is LetPrim && node.primitive is GetMutable) {
         GetMutable getter = node.primitive;
@@ -175,7 +170,7 @@
           Primitive value = environment[variable];
           value.substituteFor(getter);
           mergeHints(variable, value);
-          removeNode(node);
+          node.remove();
         }
       } else if (node is LetCont) {
         // Create phi parameters for each join continuation bound here, and put
@@ -191,6 +186,7 @@
               <MutableVariable, Primitive>{};
           for (MutableVariable variable in mutableVariables) {
             Parameter phi = new Parameter(variable.hint);
+            phi.type = variable.type;
             cont.parameters.add(phi);
             phi.parent = cont;
             environment[variable] = phi;
diff --git a/pkg/compiler/lib/src/cps_ir/octagon.dart b/pkg/compiler/lib/src/cps_ir/octagon.dart
new file mode 100644
index 0000000..8dfd5f1
--- /dev/null
+++ b/pkg/compiler/lib/src/cps_ir/octagon.dart
@@ -0,0 +1,215 @@
+// 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 dart2js.cps_ir.octagon;
+
+/// For every variable in the constraint system, two [SignedVariable]s exist,
+/// representing the positive and negative uses of the variable.
+///
+/// For instance, `v1 - v2` is represented as `v1 + (-v2)`, with -v2 being
+/// a "negative use" of v2.
+class SignedVariable {
+  /// Negated version of this variable.
+  SignedVariable _negated;
+  SignedVariable get negated => _negated;
+
+  /// Constraints that mention this signed variable.
+  final List<Constraint> _constraints = <Constraint>[];
+
+  static int _hashCount = 0;
+  final int hashCode = (_hashCount = _hashCount + 1) & 0x0fffffff;
+
+  /// Temporary field used by the constraint solver's graph search.
+  bool _isBeingVisited = false;
+
+  SignedVariable._make() {
+    _negated = new SignedVariable._makeTwin(this);
+  }
+
+  SignedVariable._makeTwin(this._negated);
+}
+
+/// A constraint of form `v1 + v2 <= k`.
+class Constraint {
+  final SignedVariable v1, v2;
+  final int bound;
+
+  Constraint(this.v1, this.v2, this.bound);
+}
+
+/// A system of constraints of form `v1 + v2 <= k`.
+///
+/// Constraints can be added and removed in stack-order.  The octagon will
+/// always determine whether it is in a solvable state, but will otherwise
+/// not optimize its internal representation.
+///
+/// There is currently no support for querying the upper and lower bounds
+/// of a variable, (which can be used to approximate ternary constraints
+/// `v1 + v2 + v3 <= k`), but it is something we could consider adding.
+class Octagon {
+  /// Number of constraints that have been added since the constraint system
+  /// became unsolvable (including the constraint that made it unsolvable).
+  ///
+  /// This is well-defined because constraints are pushed/popped in stack order.
+  int _unsolvableCounter = 0;
+
+  /// True if the constraint system is unsolvable in its current state.
+  ///
+  /// It will remain unsolvable until a number of constraints have been popped.
+  bool get isUnsolvable => _unsolvableCounter > 0;
+
+  /// True if the constraint system is solvable in its current state.
+  bool get isSolvable => _unsolvableCounter == 0;
+
+  /// Make a new variable, optionally with known lower and upper bounds
+  /// (both inclusive).
+  ///
+  /// The constraints generated for [min] and [max] are also expressible using
+  /// [Constraint] objects, but the constraints added in [makeVariable] live
+  /// outside the stack discipline (i.e. the bounds are never popped), which is
+  /// useful when generating variables on-the-fly.
+  SignedVariable makeVariable([int min, int max]) {
+    SignedVariable v1 = new SignedVariable._make();
+    if (min != null) {
+      // v1 >= min   <==>   -v1 - v1 <= -2 * min
+      v1.negated._constraints.add(
+          new Constraint(v1.negated, v1.negated, -2 * min));
+    }
+    if (max != null) {
+      // v1 <= max   <==>   v1 + v1 <= 2 * max
+      v1._constraints.add(new Constraint(v1, v1, 2 * max));
+    }
+    return v1;
+  }
+
+  /// Add the constraint `v1 + v2 <= k`.
+  ///
+  /// The constraint should be removed again using [popConstraint].
+  void pushConstraint(Constraint constraint) {
+    if (_unsolvableCounter > 0) {
+      ++_unsolvableCounter;
+    }
+    constraint.v1._constraints.add(constraint);
+    if (constraint.v1 != constraint.v2) {
+      constraint.v2._constraints.add(constraint);
+    }
+    // Check if this constraint has made the system unsolvable.
+    if (_unsolvableCounter == 0 && _checkUnsolvable(constraint)) {
+      _unsolvableCounter = 1;
+    }
+  }
+
+  /// Remove a constraint that was previously added with [pushConstraint].
+  ///
+  /// Constraints must be added and removed in stack-order.
+  void popConstraint(Constraint constraint) {
+    assert(constraint.v1._constraints.last == constraint);
+    assert(constraint.v2._constraints.last == constraint);
+    constraint.v1._constraints.removeLast();
+    if (constraint.v1 != constraint.v2) {
+      constraint.v2._constraints.removeLast();
+    }
+    if (_unsolvableCounter > 0) {
+      --_unsolvableCounter;
+    }
+  }
+
+  // Temporaries using during path finding.
+  SignedVariable _goal;
+  Map<SignedVariable, int> _distanceToGoal;
+
+  /// Return true if the recently added [constraint] made the system unsolvable.
+  ///
+  /// This function assumes the system was solvable before adding [constraint].
+  bool _checkUnsolvable(Constraint constraint) {
+    // Constraints are transitively composed like so:
+    //    v1 - v2 <= k1
+    //    v2 - v3 <= k2
+    // implies:
+    //    v1 - v3 <= k1 + k2
+    //
+    // We construct a graph such that the tightest bound on `v1 - v3` is the
+    // weight of the shortest path from `v1` to `v3`.
+    //
+    // Ever constraint `v1 - v2 <= k` gives rise to two edges:
+    //     (v1)  --k--> (v2)
+    //     (-v2) --k--> (-v2)
+    //
+    // The system is unsolvable if and only if a negative-weight cycle exists
+    // in this graph (this corresponds to a variable being less than itself).
+
+    // We assume the system was solvable to begin with, so we only look for
+    // cycles that use the new edges.
+    //
+    // The new [constraint] `v1 + v2 <= k` just added the edges:
+    //     (v1)  --k--> (-v2)
+    //     (v2)  --k--> (-v1)
+    //
+    // Look for a path from (-v2) to (v1) with weight at most -k-1, as this
+    // will complete a negative-weight cycle.
+
+    // It suffices to do this once. We need not check for the converse path
+    // (-v1) to (v2) because of the symmetry in the graph.
+    //
+    // Note that the graph symmetry is not a redundancy. Some cycles include
+    // both of the new edges at once, so they must be added to the graph
+    // beforehand.
+    _goal = constraint.v2;
+    _distanceToGoal = <SignedVariable, int>{};
+    int targetWeight = -constraint.bound - 1;
+    int pathWeight = _search(constraint.v1.negated, targetWeight, 0);
+    return pathWeight != null && pathWeight <= targetWeight;
+  }
+
+  static const int MAX_DEPTH = 100;
+
+  /// Returns the shortest path from [v1] to [_goal] (or any path shorter than
+  /// [budget]), or `null` if no path exists.
+  int _search(SignedVariable v1, int budget, int depth) {
+    if (v1 == _goal && budget >= 0) return 0;
+
+    // Disregard paths that use a lot of edges.
+    // In extreme cases (e.g. hundreds of `push` calls or nested ifs) this can
+    // get slow and/or overflow the stack.  Most paths that matter are very
+    // short (1-5 edges) with some occasional 10-30 length paths in math code.
+    if (depth >= MAX_DEPTH) return null;
+
+    // We found a cycle, but not the one we're looking for. If the constraint
+    // system was solvable to being with, then this must be a positive-weight
+    // cycle, and no shortest path goes through a positive-weight cycle.
+    if (v1._isBeingVisited) return null;
+
+    // Check if we have previously searched from here.
+    if (_distanceToGoal.containsKey(v1)) {
+      // We have already searched this node, return the cached answer.
+      // Note that variables may explicitly map to null, so the double lookup
+      // is necessary.
+      return _distanceToGoal[v1];
+    }
+
+    v1._isBeingVisited = true;
+
+    int shortestDistance = v1 == _goal ? 0 : null;
+    for (Constraint c in v1._constraints) {
+      SignedVariable v2 = c.v1 == v1 ? c.v2 : c.v1;
+      int distance = _search(v2.negated, budget - c.bound, depth + 1);
+      if (distance != null) {
+        distance += c.bound; // Pay the cost of using the edge.
+         if (distance <= budget) {
+          // Success! We found a path that is short enough so return fast.
+          // All recursive calls will now return immediately, so there is no
+          // need to update distanceToGoal, but we need to clear the
+          // beingVisited flag for the next query.
+          v1._isBeingVisited = false;
+          return distance;
+        } else if (shortestDistance == null || distance < shortestDistance) {
+          shortestDistance = distance;
+        }
+      }
+    }
+    v1._isBeingVisited = false;
+    _distanceToGoal[v1] = shortestDistance;
+    return shortestDistance;
+  }
+}
diff --git a/pkg/compiler/lib/src/cps_ir/optimizers.dart b/pkg/compiler/lib/src/cps_ir/optimizers.dart
index 4371086..336806d 100644
--- a/pkg/compiler/lib/src/cps_ir/optimizers.dart
+++ b/pkg/compiler/lib/src/cps_ir/optimizers.dart
@@ -8,11 +8,16 @@
 import '../constants/values.dart';
 
 export 'type_propagation.dart' show TypePropagator;
+export 'scalar_replacement.dart' show ScalarReplacer;
 export 'redundant_phi.dart' show RedundantPhiEliminator;
 export 'redundant_join.dart' show RedundantJoinEliminator;
-export 'shrinking_reductions.dart' show ShrinkingReducer, ParentVisitor;
+export 'shrinking_reductions.dart' show ShrinkingReducer;
 export 'mutable_ssa.dart' show MutableVariableEliminator;
-export 'let_sinking.dart' show LetSinker;
+export 'insert_refinements.dart' show InsertRefinements;
+export 'remove_refinements.dart' show RemoveRefinements;
+export 'share_interceptors.dart' show ShareInterceptors;
+export 'bounds_checker.dart' show BoundsChecker;
+export 'parent_visitor.dart' show ParentVisitor;
 
 /// An optimization pass over the CPS IR.
 abstract class Pass {
@@ -33,3 +38,11 @@
       value.isNaN ||
       value is StringConstantValue && value.primitiveValue.isEmpty;
 }
+
+/// Returns true if [value] satisfies a branching condition with the
+/// given strictness.
+///
+/// For non-strict, this is the opposite of [isFalsyConstant].
+bool isTruthyConstant(ConstantValue value, {bool strict: false}) {
+  return strict ? value.isTrue : !isFalsyConstant(value);
+}
diff --git a/pkg/compiler/lib/src/cps_ir/parent_visitor.dart b/pkg/compiler/lib/src/cps_ir/parent_visitor.dart
new file mode 100644
index 0000000..33896e0
--- /dev/null
+++ b/pkg/compiler/lib/src/cps_ir/parent_visitor.dart
@@ -0,0 +1,43 @@
+// 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 cps_ir.parent_visitor;
+
+import 'cps_ir_nodes.dart';
+
+/// Traverses the CPS term and sets node.parent for each visited node.
+class ParentVisitor extends DeepRecursiveVisitor {
+  static void setParents(Node node) {
+    ParentVisitor visitor = new ParentVisitor._make();
+    visitor._worklist.add(node);
+    visitor.trampoline();
+  }
+
+  /// Private to avoid accidental `new ParentVisitor().visit(node)` calls.
+  ParentVisitor._make();
+
+  Node _parent;
+  final List<Node> _worklist = <Node>[];
+
+  void trampoline() {
+    while (_worklist.isNotEmpty) {
+      _parent = _worklist.removeLast();
+      _parent.accept(this);
+    }
+  }
+
+  @override
+  visit(Node node) {
+    _worklist.add(node);
+    assert(_parent != node);
+    assert(_parent != null);
+    node.parent = _parent;
+  }
+
+  @override
+  processReference(Reference node) {
+    node.parent = _parent;
+  }
+}
+
diff --git a/pkg/compiler/lib/src/cps_ir/redundant_join.dart b/pkg/compiler/lib/src/cps_ir/redundant_join.dart
index 2a1a584..92f64ae 100644
--- a/pkg/compiler/lib/src/cps_ir/redundant_join.dart
+++ b/pkg/compiler/lib/src/cps_ir/redundant_join.dart
@@ -19,7 +19,7 @@
 /// one continuation. The reference chains for parameters are therefore 
 /// meaningless during this pass, until repaired by [AlphaRenamer] at
 /// the end.
-class RedundantJoinEliminator extends RecursiveVisitor implements Pass {
+class RedundantJoinEliminator extends TrampolineRecursiveVisitor implements Pass {
   String get passName => 'Redundant join elimination';
 
   final Set<Branch> workSet = new Set<Branch>();
@@ -64,20 +64,6 @@
     }
   }
 
-  /// Removes [movedNode] from its current position and inserts it
-  /// before [target].
-  void moveToBefore(Expression target, LetCont movedNode) {
-    if (movedNode.parent != null) {
-      movedNode.parent.body = movedNode.body;
-      movedNode.body.parent = movedNode.parent;
-    }
-    InteriorNode parent = target.parent;
-    parent.body = movedNode;
-    movedNode.body = target;
-    target.parent = movedNode;
-    movedNode.parent = parent;
-  }
-
   void rewriteBranch(Branch branch) {
     InteriorNode parent = getEffectiveParent(branch);
     if (parent is! Continuation) return;
@@ -94,8 +80,7 @@
     // enclosing continuation.
     // Note: Do not use the parent pointer for this check, because parameters
     // are temporarily shared between different continuations during this pass.
-    IsTrue isTrue = branch.condition;
-    Primitive condition = isTrue.value.definition;
+    Primitive condition = branch.condition.definition;
     int parameterIndex = branchCont.parameters.indexOf(condition);
     if (parameterIndex == -1) return;
 
@@ -110,12 +95,12 @@
       Primitive argument = invoke.arguments[parameterIndex].definition;
       if (argument is! Constant) return; // Branching condition is unknown.
       Constant constant = argument;
-      if (isFalsyConstant(constant.value)) {
-        ++falseHits;
-        falseCall = invoke;
-      } else {
+      if (isTruthyConstant(constant.value, strict: branch.isStrictCheck)) {
         ++trueHits;
         trueCall = invoke;
+      } else {
+        ++falseHits;
+        falseCall = invoke;
       }
     }
 
@@ -154,7 +139,7 @@
           Expression use = ref.parent;
           if (use is InvokeContinuation) {
             for (Parameter param in branchCont.parameters) {
-              use.arguments.add(new Reference<Primitive>(param));
+              use.arguments.add(new Reference<Primitive>(param)..parent = use);
             }
           } else {
             // The branch will be eliminated, so don't worry about updating it.
@@ -162,7 +147,8 @@
           }
         }
       }
-      moveToBefore(outerLetCont, innerLetCont);
+      innerLetCont.remove();
+      innerLetCont.insertAbove(outerLetCont);
     }
 
     assert(branchCont.body == branch);
@@ -183,10 +169,10 @@
       Reference reference = branchCont.firstRef;
       InvokeContinuation invoke = branchCont.firstRef.parent;
       Constant condition = invoke.arguments[parameterIndex].definition;
-      if (isFalsyConstant(condition.value)) {
-        invoke.continuation.changeTo(falseCont);
-      } else {
+      if (isTruthyConstant(condition.value, strict: branch.isStrictCheck)) {
         invoke.continuation.changeTo(trueCont);
+      } else {
+        invoke.continuation.changeTo(falseCont);
       }
       assert(branchCont.firstRef != reference);
     }
@@ -197,9 +183,7 @@
     branch.falseContinuation.unlink();
     outerLetCont.continuations.remove(branchCont);
     if (outerLetCont.continuations.isEmpty) {
-      InteriorNode parent = outerLetCont.parent;
-      parent.body = outerLetCont.body;
-      outerLetCont.body.parent = parent;
+      outerLetCont.remove();
     }
 
     // We may have created new redundant join points in the two branches.
@@ -231,7 +215,7 @@
 /// 
 /// This returns the IR to its normal form after redundant joins have been
 /// eliminated.
-class AlphaRenamer extends RecursiveVisitor {
+class AlphaRenamer extends TrampolineRecursiveVisitor {
   Map<Parameter, Parameter> renaming = <Parameter, Parameter>{};
 
   processContinuation(Continuation cont) {
@@ -249,6 +233,7 @@
       // create a new parameter object for this continuation.
       if (param.parent != cont) {
         Parameter newParam = new Parameter(param.hint);
+        newParam.type = param.type;
         renaming[param] = newParam;
         cont.parameters[i] = newParam;
         newParam.parent = cont;
diff --git a/pkg/compiler/lib/src/cps_ir/redundant_phi.dart b/pkg/compiler/lib/src/cps_ir/redundant_phi.dart
index e678a96..183f8e3 100644
--- a/pkg/compiler/lib/src/cps_ir/redundant_phi.dart
+++ b/pkg/compiler/lib/src/cps_ir/redundant_phi.dart
@@ -15,16 +15,13 @@
 /// (except for feedback). Redundant parameters are removed from the
 /// continuation signature, all invocations, and replaced within the
 /// continuation body.
-class RedundantPhiEliminator extends RecursiveVisitor implements Pass {
+class RedundantPhiEliminator extends TrampolineRecursiveVisitor implements Pass {
   String get passName => 'Redundant phi elimination';
 
   final Set<Continuation> workSet = new Set<Continuation>();
 
   @override
   void rewrite(FunctionDefinition root) {
-    // Set all parent pointers.
-    new ParentVisitor().visit(root);
-
     // Traverse the tree once to build the work set.
     visit(root);
 
@@ -187,19 +184,9 @@
 void _moveIntoScopeOf(LetCont letCont, Definition definition) {
   if (_isInScopeOf(letCont, definition)) return;
 
-  // Remove the continuation binding from its current spot.
-  InteriorNode parent = letCont.parent;
-  parent.body = letCont.body;
-  letCont.body.parent = parent;
-
-  // Insert it just below the binding of definition.
   InteriorNode binding = definition.parent;
-
-  letCont.body = binding.body;
-  binding.body.parent = letCont;
-
-  binding.body = letCont;
-  letCont.parent = binding;
+  letCont.remove();
+  letCont.insertBelow(binding);
 }
 
 /// Ensures [continuation] has its own LetCont binding by creating
@@ -210,10 +197,8 @@
   LetCont letCont = continuation.parent;
   if (letCont.continuations.length == 1) return letCont;
   letCont.continuations.remove(continuation);
-  LetCont newBinding = new LetCont(continuation, letCont.body);
-  newBinding.body.parent = newBinding;
-  newBinding.parent = letCont;
-  letCont.body = newBinding;
+  LetCont newBinding = new LetCont(continuation, null);
   continuation.parent = newBinding;
+  newBinding.insertBelow(letCont);
   return newBinding;
 }
diff --git a/pkg/compiler/lib/src/cps_ir/remove_refinements.dart b/pkg/compiler/lib/src/cps_ir/remove_refinements.dart
new file mode 100644
index 0000000..98f1c17
--- /dev/null
+++ b/pkg/compiler/lib/src/cps_ir/remove_refinements.dart
@@ -0,0 +1,32 @@
+// 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 cps_ir.optimization.remove_refinements;
+
+import 'optimizers.dart' show Pass;
+import 'cps_ir_nodes.dart';
+
+/// Removes all [Refinement] nodes from the IR.
+///
+/// This simplifies subsequent passes that don't rely on path-sensitive
+/// type information but depend on equality between primitives.
+class RemoveRefinements extends TrampolineRecursiveVisitor implements Pass {
+  String get passName => 'Remove refinement nodes';
+
+  void rewrite(FunctionDefinition node) {
+    visit(node);
+  }
+
+  @override
+  Expression traverseLetPrim(LetPrim node) {
+    Expression next = node.body;
+    if (node.primitive is Refinement) {
+      Refinement refinement = node.primitive;
+      refinement.value.definition.substituteFor(refinement);
+      refinement.destroy();
+      node.remove();
+    }
+    return next;
+  }
+}
diff --git a/pkg/compiler/lib/src/cps_ir/scalar_replacement.dart b/pkg/compiler/lib/src/cps_ir/scalar_replacement.dart
new file mode 100644
index 0000000..0ff315c
--- /dev/null
+++ b/pkg/compiler/lib/src/cps_ir/scalar_replacement.dart
@@ -0,0 +1,228 @@
+// 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 dart2js.cps_ir.scalar_replacement;
+
+import 'optimizers.dart';
+
+import 'dart:collection' show Queue;
+
+import '../common.dart';
+import '../compiler.dart' as dart2js show
+    Compiler;
+import '../constants/values.dart';
+import '../elements/elements.dart';
+import '../types/types.dart';
+import '../world.dart' show World;
+import 'cps_ir_nodes.dart';
+
+/**
+ * Replaces aggregates with a set of local values.  Performs inlining of
+ * single-use closures to generate more replacable aggregates.
+ */
+class ScalarReplacer extends Pass {
+  String get passName => 'Scalar replacement';
+
+  final InternalErrorFunction _internalError;
+  final World _classWorld;
+
+  ScalarReplacer(dart2js.Compiler compiler)
+      : _internalError = compiler.reporter.internalError,
+        _classWorld = compiler.world;
+
+  @override
+  void rewrite(FunctionDefinition root) {
+    ScalarReplacementVisitor analyzer =
+        new ScalarReplacementVisitor(_internalError, _classWorld);
+    analyzer.analyze(root);
+    analyzer.process();
+  }
+}
+
+/**
+ * Do scalar replacement of aggregates on instances. Since scalar replacement
+ * can create new candidiates, iterate until all scalar replacements are done.
+ */
+class ScalarReplacementVisitor extends TrampolineRecursiveVisitor {
+
+  final InternalErrorFunction internalError;
+  final World classWorld;
+  ScalarReplacementRemovalVisitor removalVisitor;
+
+  Primitive _current = null;
+  Set<Primitive> _allocations = new Set<Primitive>();
+  Queue<Primitive> _queue = new Queue<Primitive>();
+
+  ScalarReplacementVisitor(this.internalError, this.classWorld) {
+    removalVisitor = new ScalarReplacementRemovalVisitor(this);
+  }
+
+  void analyze(FunctionDefinition root) {
+    visit(root);
+  }
+
+  void process() {
+    while (_queue.isNotEmpty) {
+      Primitive allocation = _queue.removeFirst();
+      _allocations.remove(allocation);
+      _current = allocation;
+      tryScalarReplacement(allocation);
+    }
+  }
+
+  void tryScalarReplacement(Primitive allocation) {
+
+    // We can do scalar replacement of an aggregate if all uses of an allocation
+    // are reads or writes.
+    for (Reference ref = allocation.firstRef; ref != null; ref = ref.next) {
+      Node use = ref.parent;
+      if (use is GetField) continue;
+      if (use is SetField && use.object == ref) continue;
+      return;
+    }
+
+    Set<FieldElement> reads = new Set<FieldElement>();
+    Set<FieldElement> writes = new Set<FieldElement>();
+    for (Reference ref = allocation.firstRef; ref != null; ref = ref.next) {
+      Node use = ref.parent;
+      if (use is GetField) {
+        reads.add(use.field);
+      } else if (use is SetField) {
+        writes.add(use.field);
+      } else {
+        assert(false);
+      }
+    }
+
+    // Find the initial values of the fields. A CreateBox has no initial
+    // values. CreateInstance has initial values in the order of the fields.
+    Map<FieldElement, Primitive> fieldInitialValues =
+        <FieldElement, Primitive>{};
+    if (allocation is CreateInstance) {
+      int i = 0;
+      allocation.classElement.forEachInstanceField(
+        (ClassElement enclosingClass, FieldElement field) {
+          Primitive argument = allocation.arguments[i++].definition;
+          fieldInitialValues[field] = argument;
+        });
+    }
+
+    // Create [MutableVariable]s for each written field. Initialize the
+    // MutableVariable with the value from the allocator, or initialize with a
+    // `null` constant if there is not initial value.
+    Map<FieldElement, MutableVariable> cells =
+        <FieldElement, MutableVariable>{};
+    InteriorNode insertionPoint = allocation.parent;  // LetPrim
+    for (FieldElement field in writes) {
+      MutableVariable variable = new MutableVariable(field);
+      variable.type = new TypeMask.nonNullEmpty();
+      cells[field] = variable;
+      Primitive initialValue = fieldInitialValues[field];
+      if (initialValue == null) {
+        assert(allocation is CreateBox);
+        initialValue = new Constant(new NullConstantValue());
+        LetPrim let = new LetPrim(initialValue);
+        let.primitive.parent = let;
+        insertionPoint = let..insertBelow(insertionPoint);
+      }
+      LetMutable let = new LetMutable(variable, initialValue);
+      let.value.parent = let;
+      insertionPoint = let..insertBelow(insertionPoint);
+    }
+
+    // Replace references with MutableVariable operations or references to the
+    // field's value.
+    for (Reference ref = allocation.firstRef; ref != null; ref = ref.next) {
+      Node use = ref.parent;
+      if (use is GetField) {
+        GetField getField = use;
+        MutableVariable variable = cells[getField.field];
+        if (variable != null) {
+          GetMutable getter = new GetMutable(variable);
+          getter.type = getField.type;
+          getter.variable.parent = getter;
+          getter.substituteFor(getField);
+          replacePrimitive(getField, getter);
+          deletePrimitive(getField);
+        } else {
+          Primitive value = fieldInitialValues[getField.field];
+          value.substituteFor(getField);
+          deleteLetPrimOf(getField);
+        }
+      } else if (use is SetField && use.object == ref) {
+        SetField setField = use;
+        MutableVariable variable = cells[setField.field];
+        Primitive value = setField.value.definition;
+        variable.type = variable.type.union(value.type, classWorld);
+        SetMutable setter = new SetMutable(variable, value);
+        setter.variable.parent = setter;
+        setter.value.parent = setter;
+        setter.substituteFor(setField);
+        replacePrimitive(setField, setter);
+        deletePrimitive(setField);
+      } else {
+        assert(false);
+      }
+    }
+
+    // Delete [allocation] since that might 'free' another scalar replacement
+    // candidate by deleting the last non-field-access.
+    deleteLetPrimOf(allocation);
+  }
+
+  /// Replaces [old] with [primitive] in [old]'s parent [LetPrim].
+  void replacePrimitive(Primitive old, Primitive primitive) {
+    LetPrim letPrim = old.parent;
+    letPrim.primitive = primitive;
+    primitive.parent = letPrim;
+  }
+
+  void deleteLetPrimOf(Primitive primitive) {
+    assert(primitive.hasNoUses);
+    LetPrim letPrim = primitive.parent;
+    letPrim.remove();
+    deletePrimitive(primitive);
+  }
+
+  void deletePrimitive(Primitive primitive) {
+    assert(primitive.hasNoUses);
+    removalVisitor.visit(primitive);
+  }
+
+  void reconsider(Definition node) {
+    if (node is CreateInstance || node is CreateBox) {
+      if (node == _current) return;
+      enqueue(node);
+    }
+  }
+
+  void enqueue(Primitive node) {
+    assert(node is CreateInstance || node is CreateBox);
+    if (_allocations.contains(node)) return;
+    _allocations.add(node);
+    _queue.add(node);
+  }
+
+  // -------------------------- Visitor overrides ------------------------------
+  void visitCreateInstance(CreateInstance node) {
+    enqueue(node);
+  }
+
+  void visitCreateBox(CreateBox node) {
+    enqueue(node);
+  }
+}
+
+
+/// Visit a just-deleted subterm and unlink all [Reference]s in it.  Reconsider
+/// allocations for scalar replacement.
+class ScalarReplacementRemovalVisitor extends TrampolineRecursiveVisitor {
+  ScalarReplacementVisitor process;
+
+  ScalarReplacementRemovalVisitor(this.process);
+
+  processReference(Reference reference) {
+    process.reconsider(reference.definition);
+    reference.unlink();
+  }
+}
diff --git a/pkg/compiler/lib/src/cps_ir/share_interceptors.dart b/pkg/compiler/lib/src/cps_ir/share_interceptors.dart
new file mode 100644
index 0000000..3706725
--- /dev/null
+++ b/pkg/compiler/lib/src/cps_ir/share_interceptors.dart
@@ -0,0 +1,196 @@
+// 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 dart2js.cps_ir.share_interceptors;
+
+import 'optimizers.dart';
+import 'cps_ir_nodes.dart';
+import 'loop_hierarchy.dart';
+import '../constants/values.dart';
+
+/// Removes redundant `getInterceptor` calls.
+/// 
+/// The pass performs three optimizations for interceptors:
+///- pull interceptors out of loops
+///- replace interceptors with constants
+///- share interceptors when one is in scope of the other
+class ShareInterceptors extends TrampolineRecursiveVisitor implements Pass {
+  String get passName => 'Share interceptors';
+
+  /// The innermost loop containing a given primitive.
+  final Map<Primitive, Continuation> loopHeaderFor =
+      <Primitive, Continuation>{};
+
+  /// An interceptor currently in scope for a given primitive.
+  final Map<Primitive, Primitive> interceptorFor =
+      <Primitive, Primitive>{};
+
+  /// A primitive currently in scope holding a given interceptor constant.
+  final Map<ConstantValue, Primitive> sharedConstantFor =
+      <ConstantValue, Primitive>{};
+
+  /// Interceptors to be hoisted out of the given loop.
+  final Map<Continuation, List<Primitive>> loopHoistedInterceptors =
+      <Continuation, List<Primitive>>{};
+
+  LoopHierarchy loopHierarchy;
+  Continuation currentLoopHeader;
+
+  void rewrite(FunctionDefinition node) {
+    loopHierarchy = new LoopHierarchy(node);
+    visit(node.body);
+  }
+
+  @override
+  Expression traverseContinuation(Continuation cont) {
+    Continuation oldLoopHeader = currentLoopHeader;
+    pushAction(() {
+      currentLoopHeader = oldLoopHeader;
+    });
+    currentLoopHeader = loopHierarchy.getLoopHeader(cont);
+    for (Parameter param in cont.parameters) {
+      loopHeaderFor[param] = currentLoopHeader;
+    }
+    if (cont.isRecursive) {
+      pushAction(() {
+        // After the loop body has been processed, all interceptors hoisted
+        // to this loop fall out of scope and should be removed from the
+        // environment.
+        List<Primitive> hoisted = loopHoistedInterceptors[cont];
+        if (hoisted != null) {
+          for (Primitive interceptor in hoisted) {
+            if (interceptor is Interceptor) {
+              Primitive input = interceptor.input.definition;
+              assert(interceptorFor[input] == interceptor);
+              interceptorFor.remove(input);
+            } else if (interceptor is Constant) {
+              assert(sharedConstantFor[interceptor.value] == interceptor);
+              sharedConstantFor.remove(interceptor.value);
+            } else {
+              throw "Unexpected interceptor: $interceptor";
+            }
+          }
+        }
+      });
+    }
+    return cont.body;
+  }
+
+  @override
+  Expression traverseLetPrim(LetPrim node) {
+    loopHeaderFor[node.primitive] = currentLoopHeader;
+    Expression next = node.body;
+    if (node.primitive is! Interceptor) {
+      return next;
+    }
+    Interceptor interceptor = node.primitive;
+    Primitive input = interceptor.input.definition;
+
+    // Try to reuse an existing interceptor for the same input.
+    Primitive existing = interceptorFor[input];
+    if (existing != null) {
+      if (existing is Interceptor) {
+        existing.interceptedClasses.addAll(interceptor.interceptedClasses);
+      }
+      existing.substituteFor(interceptor);
+      interceptor.destroy();
+      node.remove();
+      return next;
+    }
+
+    // There is no interceptor obtained from this particular input, but
+    // there might one obtained from another input that is known to
+    // have the same result, so try to reuse that.
+    InterceptorConstantValue constant = interceptor.constantValue;
+    if (constant != null) {
+      existing = sharedConstantFor[constant];
+      if (existing != null) {
+        existing.substituteFor(interceptor);
+        interceptor.destroy();
+        node.remove();
+        return next;
+      }
+
+      // The interceptor could not be shared. Replace it with a constant.
+      Constant constantPrim = new Constant(constant);
+      node.primitive = constantPrim;
+      constantPrim.parent = node;
+      constantPrim.hint = interceptor.hint;
+      constantPrim.type = interceptor.type;
+      constantPrim.substituteFor(interceptor);
+      interceptor.destroy();
+      sharedConstantFor[constant] = constantPrim;
+    } else {
+      interceptorFor[input] = interceptor;
+    }
+
+    // Determine the outermost loop where the input to the interceptor call
+    // is available.  Constant interceptors take no input and can thus be
+    // hoisted all way to the top-level.
+    Continuation referencedLoop = constant != null
+        ? null
+        : lowestCommonAncestor(loopHeaderFor[input], currentLoopHeader);
+    if (referencedLoop != currentLoopHeader) {
+      // [referencedLoop] contains the binding for [input], so we cannot hoist
+      // the interceptor outside that loop.  Find the loop nested one level
+      // inside referencedLoop, and hoist the interceptor just outside that one.
+      Continuation loop = currentLoopHeader;
+      Continuation enclosing = loopHierarchy.getEnclosingLoop(loop);
+      while (enclosing != referencedLoop) {
+        assert(loop != null);
+        loop = enclosing;
+        enclosing = loopHierarchy.getEnclosingLoop(loop);
+      }
+      assert(loop != null);
+
+      // Move the LetPrim above the loop binding.
+      LetCont loopBinding = loop.parent;
+      node.remove();
+      node.insertAbove(loopBinding);
+
+      // A different loop now contains the interceptor.
+      loopHeaderFor[node.primitive] = enclosing;
+
+      // Register the interceptor as hoisted to that loop, so it will be
+      // removed from the environment when it falls out of scope.
+      loopHoistedInterceptors
+          .putIfAbsent(loop, () => <Primitive>[])
+          .add(node.primitive);
+    } else if (constant != null) {
+      // The LetPrim was not hoisted. Remove the bound interceptor from the
+      // environment when leaving the LetPrim body.
+      pushAction(() {
+        assert(sharedConstantFor[constant] == node.primitive);
+        sharedConstantFor.remove(constant);
+      });
+    } else {
+      pushAction(() {
+        assert(interceptorFor[input] == node.primitive);
+        interceptorFor.remove(input);
+      });
+    }
+    return next;
+  }
+
+  /// Returns the the innermost loop that effectively encloses both
+  /// c1 and c2 (or `null` if there is no such loop).
+  Continuation lowestCommonAncestor(Continuation c1, Continuation c2) {
+    int d1 = getDepth(c1), d2 = getDepth(c2);
+    while (c1 != c2) {
+      if (d1 <= d2) {
+        c2 = loopHierarchy.getEnclosingLoop(c2);
+        d2 = getDepth(c2);
+      } else {
+        c1 = loopHierarchy.getEnclosingLoop(c1);
+        d1 = getDepth(c1);
+      }
+    }
+    return c1;
+  }
+
+  int getDepth(Continuation loop) {
+    if (loop == null) return -1;
+    return loopHierarchy.loopDepth[loop];
+  }
+}
diff --git a/pkg/compiler/lib/src/cps_ir/shrinking_reductions.dart b/pkg/compiler/lib/src/cps_ir/shrinking_reductions.dart
index ac1d143..a6017cb 100644
--- a/pkg/compiler/lib/src/cps_ir/shrinking_reductions.dart
+++ b/pkg/compiler/lib/src/cps_ir/shrinking_reductions.dart
@@ -24,9 +24,6 @@
     _worklist = new List<_ReductionTask>();
     _RedexVisitor redexVisitor = new _RedexVisitor(_worklist);
 
-    // Set all parent pointers.
-    new ParentVisitor().visit(root);
-
     // Sweep over the term, collecting redexes into the worklist.
     redexVisitor.visit(root);
 
@@ -54,16 +51,9 @@
   void _removeContinuation(Continuation cont) {
     LetCont parent = cont.parent;
     if (parent.continuations.length == 1) {
-      assert(cont.parent_index == 0);
       _removeNode(parent);
     } else {
-      List<Continuation> continuations = parent.continuations;
-      for (int i = cont.parent_index; i < continuations.length - 1; ++i) {
-        Continuation current = continuations[i + 1];
-        continuations[i] = current;
-        current.parent_index = i;
-      }
-      continuations.removeLast();
+      parent.continuations.remove(cont);
     }
     cont.parent = _DELETED;
   }
@@ -204,7 +194,8 @@
 
     Parameter parameter = task.node;
     Continuation continuation = parameter.parent;
-    int index = parameter.parentIndex;
+    int index = continuation.parameters.indexOf(parameter);
+    assert(index != -1);
 
     // Remove the index'th argument from each invocation.
     Reference<Continuation> current = continuation.firstRef;
@@ -229,14 +220,7 @@
       invoke.arguments.removeAt(index);
       current = current.next;
     }
-    // Copy the parameters above index down.
-    List<Parameter> parameters = continuation.parameters;
-    for (int i = index; i < parameters.length - 1; ++i) {
-      Parameter p = parameters[i + 1];
-      parameters[i] = p;
-      p.parentIndex = i;
-    }
-    parameters.removeLast();
+    continuation.parameters.removeAt(index);
 
     // Removing an unused parameter can create an eta-redex.
     if (_isEtaCont(continuation)) {
@@ -398,7 +382,7 @@
 }
 
 /// Traverses a term and adds any found redexes to the worklist.
-class _RedexVisitor extends RecursiveVisitor {
+class _RedexVisitor extends TrampolineRecursiveVisitor {
   final List<_ReductionTask> worklist;
 
   _RedexVisitor(this.worklist);
@@ -444,7 +428,7 @@
 /// Deleted nodes that might participate in a reduction task are marked so that
 /// any corresponding tasks can be skipped.  Nodes are marked so by setting
 /// their parent to the deleted sentinel.
-class _RemovalVisitor extends RecursiveVisitor {
+class _RemovalVisitor extends TrampolineRecursiveVisitor {
   final List<_ReductionTask> worklist;
 
   _RemovalVisitor(this.worklist);
@@ -490,204 +474,7 @@
   }
 }
 
-/// Traverses the CPS term and sets node.parent for each visited node.
-class ParentVisitor extends RecursiveVisitor {
-  processFunctionDefinition(FunctionDefinition node) {
-    node.body.parent = node;
-    if (node.thisParameter != null) node.thisParameter.parent = node;
-    int index = 0;
-    node.parameters.forEach((Definition parameter) {
-      parameter.parent = node;
-      if (parameter is Parameter) parameter.parentIndex = index++;
-    });
-    node.returnContinuation.parent = node;
-    node.body.parent = node;
-  }
 
-  processLetPrim(LetPrim node) {
-    node.primitive.parent = node;
-    node.body.parent = node;
-  }
-
-  processLetCont(LetCont node) {
-    int index = 0;
-    node.continuations.forEach((Continuation continuation) {
-      continuation.parent = node;
-      continuation.parent_index = index++;
-    });
-    node.body.parent = node;
-  }
-
-  processLetHandler(LetHandler node) {
-    node.handler.parent = node;
-    node.body.parent = node;
-  }
-
-  processLetMutable(LetMutable node) {
-    node.variable.parent = node;
-    node.value.parent = node;
-    node.body.parent = node;
-  }
-
-  processInvokeStatic(InvokeStatic node) {
-    node.arguments.forEach((Reference ref) => ref.parent = node);
-    node.continuation.parent = node;
-  }
-
-  processInvokeContinuation(InvokeContinuation node) {
-    node.continuation.parent = node;
-    node.arguments.forEach((Reference ref) => ref.parent = node);
-  }
-
-  processInvokeMethod(InvokeMethod node) {
-    node.receiver.parent = node;
-    node.continuation.parent = node;
-    node.arguments.forEach((Reference ref) => ref.parent = node);
-  }
-
-  processInvokeMethodDirectly(InvokeMethodDirectly node) {
-    node.receiver.parent = node;
-    node.continuation.parent = node;
-    node.arguments.forEach((Reference ref) => ref.parent = node);
-  }
-
-  processInvokeConstructor(InvokeConstructor node) {
-    node.continuation.parent = node;
-    node.arguments.forEach((Reference ref) => ref.parent = node);
-  }
-
-  processBranch(Branch node) {
-    node.condition.parent = node;
-    node.trueContinuation.parent = node;
-    node.falseContinuation.parent = node;
-  }
-
-  processTypeCast(TypeCast node) {
-    node.typeArguments.forEach((Reference ref) => ref.parent = node);
-    node.continuation.parent = node;
-    node.value.parent = node;
-  }
-
-  processTypeTest(TypeTest node) {
-    node.typeArguments.forEach((Reference ref) => ref.parent = node);
-    node.value.parent = node;
-  }
-
-  processSetMutable(SetMutable node) {
-    node.variable.parent = node;
-    node.value.parent = node;
-  }
-
-  processThrow(Throw node) {
-    node.value.parent = node;
-  }
-
-  processGetLazyStatic(GetLazyStatic node) {
-    node.continuation.parent = node;
-  }
-
-  processLiteralList(LiteralList node) {
-    node.values.forEach((Reference ref) => ref.parent = node);
-  }
-
-  processLiteralMap(LiteralMap node) {
-    node.entries.forEach((LiteralMapEntry entry) {
-      entry.key.parent = node;
-      entry.value.parent = node;
-    });
-  }
-
-  processCreateFunction(CreateFunction node) {
-    node.definition.parent = node;
-  }
-
-  processContinuation(Continuation node) {
-    if (node.body != null) node.body.parent = node;
-    int index = 0;
-    node.parameters.forEach((Parameter parameter) {
-      parameter.parent = node;
-      parameter.parentIndex = index++;
-    });
-  }
-
-  processIsTrue(IsTrue node) {
-    node.value.parent = node;
-  }
-
-  processInterceptor(Interceptor node) {
-    node.input.parent = node;
-  }
-
-  processSetField(SetField node) {
-    node.object.parent = node;
-    node.value.parent = node;
-  }
-
-  processGetField(GetField node) {
-    node.object.parent = node;
-  }
-
-  processGetStatic(GetStatic node) {
-  }
-
-  processSetStatic(SetStatic node) {
-    node.value.parent = node;
-  }
-
-  processGetMutable(GetMutable node) {
-    node.variable.parent = node;
-  }
-
-  processCreateInstance(CreateInstance node) {
-    node.arguments.forEach((Reference ref) => ref.parent = node);
-    node.typeInformation.forEach((Reference ref) => ref.parent = node);
-  }
-
-  processCreateBox(CreateBox node) {
-  }
-
-  processReifyRuntimeType(ReifyRuntimeType node) {
-    node.value.parent = node;
-  }
-
-  processReadTypeVariable(ReadTypeVariable node) {
-    node.target.parent = node;
-  }
-
-  processTypeExpression(TypeExpression node) {
-    node.arguments.forEach((Reference ref) => ref.parent = node);
-  }
-
-  processCreateInvocationMirror(CreateInvocationMirror node) {
-    node.arguments.forEach((Reference ref) => ref.parent = node);
-  }
-
-  processApplyBuiltinOperator(ApplyBuiltinOperator node) {
-    node.arguments.forEach((Reference ref) => ref.parent = node);
-  }
-
-  processForeignCode(ForeignCode node) {
-    if (node.continuation != null) {
-      node.continuation.parent = node;
-    }
-    node.arguments.forEach((Reference ref) => ref.parent = node);
-  }
-
-  processGetLength(GetLength node) {
-    node.object.parent = node;
-  }
-
-  processGetIndex(GetIndex node) {
-    node.object.parent = node;
-    node.index.parent = node;
-  }
-
-  processSetIndex(SetIndex node) {
-    node.object.parent = node;
-    node.index.parent = node;
-    node.value.parent = node;
-  }
-}
 
 class _ReductionKind {
   final String name;
@@ -731,5 +518,6 @@
 /// A dummy class used solely to mark nodes as deleted once they are removed
 /// from a term.
 class _DeletedNode extends Node {
-  accept(_) => null;
+  accept(_) {}
+  setParentPointers() {}
 }
diff --git a/pkg/compiler/lib/src/cps_ir/type_mask_system.dart b/pkg/compiler/lib/src/cps_ir/type_mask_system.dart
new file mode 100644
index 0000000..ba44ed1
--- /dev/null
+++ b/pkg/compiler/lib/src/cps_ir/type_mask_system.dart
@@ -0,0 +1,392 @@
+// 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 dart2js.type_mask_system;
+
+import '../common/names.dart' show Selectors, Identifiers;
+import '../compiler.dart' as dart2js show Compiler;
+import '../constants/values.dart';
+import '../dart_types.dart' as types;
+import '../elements/elements.dart';
+import '../js_backend/js_backend.dart' show JavaScriptBackend;
+import '../types/types.dart';
+import '../types/constants.dart' show computeTypeMask;
+import '../universe/selector.dart' show Selector;
+import '../world.dart' show World;
+
+enum AbstractBool {
+  True, False, Maybe, Nothing
+}
+
+class TypeMaskSystem {
+  final TypesTask inferrer;
+  final World classWorld;
+  final JavaScriptBackend backend;
+
+  TypeMask get dynamicType => inferrer.dynamicType;
+  TypeMask get typeType => inferrer.typeType;
+  TypeMask get functionType => inferrer.functionType;
+  TypeMask get boolType => inferrer.boolType;
+  TypeMask get intType => inferrer.intType;
+  TypeMask get doubleType => inferrer.doubleType;
+  TypeMask get numType => inferrer.numType;
+  TypeMask get stringType => inferrer.stringType;
+  TypeMask get listType => inferrer.listType;
+  TypeMask get mapType => inferrer.mapType;
+  TypeMask get nonNullType => inferrer.nonNullType;
+  TypeMask get nullType => inferrer.nullType;
+  TypeMask get extendableNativeListType => backend.extendableArrayType;
+
+  TypeMask get uint31Type => inferrer.uint31Type;
+  TypeMask get uint32Type => inferrer.uint32Type;
+  TypeMask get uintType => inferrer.positiveIntType;
+
+  TypeMask numStringBoolType;
+  TypeMask fixedLengthType;
+  TypeMask interceptorType;
+
+  ClassElement get jsNullClass => backend.jsNullClass;
+
+  // TODO(karlklose): remove compiler here.
+  TypeMaskSystem(dart2js.Compiler compiler)
+      : inferrer = compiler.typesTask,
+        classWorld = compiler.world,
+        backend = compiler.backend {
+
+    // Build the number+string+bool type. To make containment tests more
+    // inclusive, we use the num, String, bool types for this, not
+    // the JSNumber, JSString, JSBool subclasses.
+    TypeMask anyNum =
+        new TypeMask.nonNullSubtype(classWorld.numClass, classWorld);
+    TypeMask anyString =
+        new TypeMask.nonNullSubtype(classWorld.stringClass, classWorld);
+    TypeMask anyBool =
+        new TypeMask.nonNullSubtype(classWorld.boolClass, classWorld);
+    numStringBoolType =
+        new TypeMask.unionOf(<TypeMask>[anyNum, anyString, anyBool],
+            classWorld);
+    interceptorType =
+        new TypeMask.nonNullSubtype(backend.jsInterceptorClass, classWorld);
+
+    TypeMask typedArray = nonNullSubclass(backend.typedArrayClass);
+    fixedLengthType = new TypeMask.unionOf(
+            <TypeMask>[stringType, backend.fixedArrayType, typedArray],
+            classWorld);
+  }
+
+  bool methodUsesReceiverArgument(FunctionElement function) {
+    assert(backend.isInterceptedMethod(function));
+    ClassElement clazz = function.enclosingClass.declaration;
+    return clazz.isSubclassOf(backend.jsInterceptorClass) ||
+           classWorld.isUsedAsMixin(clazz);
+  }
+
+  Element locateSingleElement(TypeMask mask, Selector selector) {
+    return mask.locateSingleElement(selector, mask, classWorld.compiler);
+  }
+
+  ClassElement singleClass(TypeMask mask) {
+    return mask.singleClass(classWorld);
+  }
+
+  bool needsNoSuchMethodHandling(TypeMask mask, Selector selector) {
+    return mask.needsNoSuchMethodHandling(selector, classWorld);
+  }
+
+  TypeMask getReceiverType(MethodElement method) {
+    assert(method.isInstanceMember);
+    if (classWorld.isUsedAsMixin(method.enclosingClass.declaration)) {
+      // If used as a mixin, the receiver could be any of the classes that mix
+      // in the class, and these are not considered subclasses.
+      // TODO(asgerf): Exclude the subtypes that only `implement` the class.
+      return nonNullSubtype(method.enclosingClass);
+    } else {
+      return nonNullSubclass(method.enclosingClass);
+    }
+  }
+
+  TypeMask getParameterType(ParameterElement parameter) {
+    return inferrer.getGuaranteedTypeOfElement(parameter);
+  }
+
+  TypeMask getReturnType(FunctionElement function) {
+    return inferrer.getGuaranteedReturnTypeOfElement(function);
+  }
+
+  TypeMask getInvokeReturnType(Selector selector, TypeMask mask) {
+    TypeMask result = inferrer.getGuaranteedTypeOfSelector(selector, mask);
+    // Tearing off .call from a function returns the function itself.
+    if (selector.isGetter &&
+        selector.name == Identifiers.call &&
+        !areDisjoint(functionType, mask)) {
+      result = join(result, functionType);
+    }
+    return result;
+  }
+
+  TypeMask getFieldType(FieldElement field) {
+    return inferrer.getGuaranteedTypeOfElement(field);
+  }
+
+  TypeMask join(TypeMask a, TypeMask b) {
+    return a.union(b, classWorld);
+  }
+
+  TypeMask getTypeOf(ConstantValue constant) {
+    return computeTypeMask(inferrer.compiler, constant);
+  }
+
+  // Returns the constant value if a TypeMask represents a single value.
+  // Returns `null` if [mask] is not a constant.
+  ConstantValue getConstantOf(TypeMask mask) {
+    if (!mask.isValue) return null;
+    if (mask.isNullable) return null;  // e.g. 'true or null'.
+    ValueTypeMask valueMask = mask;
+    if (valueMask.value.isBool) return valueMask.value;
+    // TODO(sra): Consider other values. Be careful with large strings.
+    return null;
+  }
+
+  TypeMask nonNullExact(ClassElement element) {
+    // The class world does not know about classes created by
+    // closure conversion, so just treat those as a subtypes of Function.
+    // TODO(asgerf): Maybe closure conversion should create a new ClassWorld?
+    if (element.isClosure) return functionType;
+    return new TypeMask.nonNullExact(element.declaration, classWorld);
+  }
+
+  TypeMask nonNullSubclass(ClassElement element) {
+    if (element.isClosure) return functionType;
+    return new TypeMask.nonNullSubclass(element.declaration, classWorld);
+  }
+
+  TypeMask nonNullSubtype(ClassElement element) {
+    if (element.isClosure) return functionType;
+    return new TypeMask.nonNullSubtype(element.declaration, classWorld);
+  }
+
+  bool isDefinitelyBool(TypeMask t, {bool allowNull: false}) {
+    if (!allowNull && t.isNullable) return false;
+    return t.nonNullable().containsOnlyBool(classWorld);
+  }
+
+  bool isDefinitelyNum(TypeMask t, {bool allowNull: false}) {
+    if (!allowNull && t.isNullable) return false;
+    return t.nonNullable().containsOnlyNum(classWorld);
+  }
+
+  bool isDefinitelyString(TypeMask t, {bool allowNull: false}) {
+    if (!allowNull && t.isNullable) return false;
+    return t.nonNullable().containsOnlyString(classWorld);
+  }
+
+  bool isDefinitelyNumStringBool(TypeMask t, {bool allowNull: false}) {
+    if (!allowNull && t.isNullable) return false;
+    return numStringBoolType.containsMask(t.nonNullable(), classWorld);
+  }
+
+  bool isDefinitelyNotNumStringBool(TypeMask t) {
+    return areDisjoint(t, numStringBoolType);
+  }
+
+  /// True if all values of [t] are either integers or not numbers at all.
+  ///
+  /// This does not imply that the value is an integer, since most other values
+  /// such as null are also not a non-integer double.
+  bool isDefinitelyNotNonIntegerDouble(TypeMask t) {
+    // Even though int is a subclass of double in the JS type system, we can
+    // still check this with disjointness, because [doubleType] is the *exact*
+    // double class, so this excludes things that are known to be instances of a
+    // more specific class.
+    // We currently exploit that there are no subclasses of double that are
+    // not integers (e.g. there is no UnsignedDouble class or whatever).
+    return areDisjoint(t, doubleType);
+  }
+
+  bool isDefinitelyNonNegativeInt(TypeMask t, {bool allowNull: false}) {
+    if (!allowNull && t.isNullable) return false;
+    // The JSPositiveInt class includes zero, despite the name.
+    return t.satisfies(backend.jsPositiveIntClass, classWorld);
+  }
+
+  bool isDefinitelyInt(TypeMask t, {bool allowNull: false}) {
+    if (!allowNull && t.isNullable) return false;
+    return t.satisfies(backend.jsIntClass, classWorld);
+  }
+
+  bool isDefinitelyUint31(TypeMask t, {bool allowNull: false}) {
+    if (!allowNull && t.isNullable) return false;
+    return t.satisfies(backend.jsUInt31Class, classWorld);
+  }
+
+  bool isDefinitelyUint32(TypeMask t, {bool allowNull: false}) {
+    if (!allowNull && t.isNullable) return false;
+    return t.satisfies(backend.jsUInt32Class, classWorld);
+  }
+
+  bool isDefinitelyUint(TypeMask t, {bool allowNull: false}) {
+    if (!allowNull && t.isNullable) return false;
+    return t.satisfies(backend.jsPositiveIntClass, classWorld);
+  }
+
+  // TODO(sra): Find a better name.  'NativeList' is a bad name because there
+  // are many native classes in dart:html that implement List but are not (and
+  // should not be) included in this predicate.
+  bool isDefinitelyNativeList(TypeMask t, {bool allowNull: false}) {
+    if (!allowNull && t.isNullable) return false;
+    return t.nonNullable().satisfies(backend.jsArrayClass, classWorld);
+  }
+
+  bool isDefinitelyMutableNativeList(TypeMask t, {bool allowNull: false}) {
+    if (!allowNull && t.isNullable) return false;
+    return t.nonNullable().satisfies(backend.jsMutableArrayClass, classWorld);
+  }
+
+  bool isDefinitelyFixedNativeList(TypeMask t, {bool allowNull: false}) {
+    if (!allowNull && t.isNullable) return false;
+    return t.nonNullable().satisfies(backend.jsFixedArrayClass, classWorld);
+  }
+
+  bool isDefinitelyExtendableNativeList(TypeMask t, {bool allowNull: false}) {
+    if (!allowNull && t.isNullable) return false;
+    return t.nonNullable().satisfies(backend.jsExtendableArrayClass,
+                                     classWorld);
+  }
+
+  bool isDefinitelyIndexable(TypeMask t, {bool allowNull: false}) {
+    if (!allowNull && t.isNullable) return false;
+    return t.nonNullable().satisfies(backend.jsIndexableClass, classWorld);
+  }
+
+  bool isDefinitelyMutableIndexable(TypeMask t, {bool allowNull: false}) {
+    if (!allowNull && t.isNullable) return false;
+    return t.nonNullable().satisfies(backend.jsMutableIndexableClass,
+        classWorld);
+  }
+
+  bool isDefinitelyFixedLengthIndexable(TypeMask t, {bool allowNull: false}) {
+    if (!allowNull && t.isNullable) return false;
+    return fixedLengthType.containsMask(t.nonNullable(), classWorld);
+  }
+
+  bool areDisjoint(TypeMask leftType, TypeMask rightType) {
+    TypeMask intersection = leftType.intersection(rightType, classWorld);
+    return intersection.isEmpty && !intersection.isNullable;
+  }
+
+  AbstractBool isSubtypeOf(TypeMask value,
+                           types.DartType type,
+                           {bool allowNull}) {
+    assert(allowNull != null);
+    if (type is types.DynamicType) {
+      return AbstractBool.True;
+    }
+    if (type is types.InterfaceType) {
+      TypeMask typeAsMask = allowNull
+      ? new TypeMask.subtype(type.element, classWorld)
+      : new TypeMask.nonNullSubtype(type.element, classWorld);
+      if (areDisjoint(value, typeAsMask)) {
+        // Disprove the subtype relation based on the class alone.
+        return AbstractBool.False;
+      }
+      if (!type.treatAsRaw) {
+        // If there are type arguments, we cannot prove the subtype relation,
+        // because the type arguments are unknown on both the value and type.
+        return AbstractBool.Maybe;
+      }
+      if (typeAsMask.containsMask(value, classWorld)) {
+        // All possible values are contained in the set of allowed values.
+        // Note that we exploit the fact that [typeAsMask] is an exact
+        // representation of [type], not an approximation.
+        return AbstractBool.True;
+      }
+      // The value is neither contained in the type, nor disjoint from the type.
+      return AbstractBool.Maybe;
+    }
+    // TODO(asgerf): Support function types, and what else might be missing.
+    return AbstractBool.Maybe;
+  }
+
+  /// Returns whether [type] is one of the falsy values: false, 0, -0, NaN,
+  /// the empty string, or null.
+  AbstractBool boolify(TypeMask type) {
+    if (isDefinitelyNotNumStringBool(type) && !type.isNullable) {
+      return AbstractBool.True;
+    }
+    return AbstractBool.Maybe;
+  }
+
+  AbstractBool strictBoolify(TypeMask type) {
+    if (areDisjoint(type, boolType)) return AbstractBool.False;
+    return AbstractBool.Maybe;
+  }
+
+  /// Create a type mask containing at least all subtypes of [type].
+  TypeMask subtypesOf(types.DartType type) {
+    if (type is types.InterfaceType) {
+      ClassElement element = type.element;
+      if (element.isObject) {
+        return dynamicType;
+      }
+      if (element == classWorld.nullClass) {
+        return nullType;
+      }
+      if (element == classWorld.stringClass) {
+        return stringType;
+      }
+      if (element == classWorld.numClass ||
+          element == classWorld.doubleClass) {
+        return numType;
+      }
+      if (element == classWorld.intClass) {
+        return intType;
+      }
+      if (element == classWorld.boolClass) {
+        return boolType;
+      }
+      return new TypeMask.nonNullSubtype(element, classWorld);
+    }
+    if (type is types.FunctionType) {
+      return functionType;
+    }
+    return dynamicType;
+  }
+
+  /// Returns a subset of [mask] containing at least the types
+  /// that can respond to [selector] without throwing.
+  TypeMask receiverTypeFor(Selector selector, TypeMask mask) {
+    return classWorld.allFunctions.receiverType(selector, mask);
+  }
+
+  /// The result of an index operation on something of [type], or the dynamic
+  /// type if unknown.
+  TypeMask elementTypeOfIndexable(TypeMask type) {
+    if (type is UnionTypeMask) {
+      return new TypeMask.unionOf(
+          type.disjointMasks.map(elementTypeOfIndexable), classWorld);
+    }
+    if (type is ContainerTypeMask) {
+      return type.elementType;
+    }
+    if (isDefinitelyString(type)) {
+      return stringType;
+    }
+    if (type.satisfies(backend.typedArrayClass, classWorld)) {
+      if (type.satisfies(backend.typedArrayOfIntClass, classWorld)) {
+        return intType;
+      }
+      return numType;
+    }
+    return dynamicType;
+  }
+
+  /// The length of something of [type], or `null` if unknown.
+  int getContainerLength(TypeMask type) {
+    if (type is ContainerTypeMask) {
+      return type.length;
+    } else {
+      return null;
+    }
+  }
+}
diff --git a/pkg/compiler/lib/src/cps_ir/type_propagation.dart b/pkg/compiler/lib/src/cps_ir/type_propagation.dart
index 5784bba..5784d3d 100644
--- a/pkg/compiler/lib/src/cps_ir/type_propagation.dart
+++ b/pkg/compiler/lib/src/cps_ir/type_propagation.dart
@@ -1,228 +1,54 @@
 // 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.cps_ir.type_propagation;
 
 import 'optimizers.dart';
 
+import '../closure.dart' show
+    ClosureClassElement;
+import '../common.dart';
+import '../common/names.dart' show
+    Identifiers,
+    Selectors;
+import '../compiler.dart' as dart2js show
+    Compiler;
 import '../constants/constant_system.dart';
-import '../resolution/operators.dart';
 import '../constants/values.dart';
 import '../dart_types.dart' as types;
-import '../dart2jslib.dart' as dart2js;
-import '../tree/tree.dart' show DartString, ConsDartString, LiteralDartString;
-import 'cps_ir_nodes.dart';
-import '../types/types.dart';
-import '../types/constants.dart' show computeTypeMask;
 import '../elements/elements.dart';
-import '../dart2jslib.dart' show ClassWorld, World;
-import '../universe/universe.dart';
-import '../js_backend/js_backend.dart' show JavaScriptBackend;
-import '../io/source_information.dart' show SourceInformation;
+import '../io/source_information.dart' show
+    SourceInformation;
+import '../js_backend/js_backend.dart' show
+    JavaScriptBackend;
+import '../js_backend/codegen/task.dart' show
+    CpsFunctionCompiler;
+import '../resolution/access_semantics.dart';
+import '../resolution/operators.dart';
+import '../resolution/send_structure.dart';
+import '../tree/tree.dart' as ast;
+import '../types/types.dart';
+import '../universe/selector.dart' show
+    Selector;
+import '../world.dart' show World;
 import 'cps_fragment.dart';
-
-enum AbstractBool {
-  True, False, Maybe, Nothing
-}
-
-class TypeMaskSystem {
-  final TypesTask inferrer;
-  final World classWorld;
-  final JavaScriptBackend backend;
-
-  TypeMask get dynamicType => inferrer.dynamicType;
-  TypeMask get typeType => inferrer.typeType;
-  TypeMask get functionType => inferrer.functionType;
-  TypeMask get boolType => inferrer.boolType;
-  TypeMask get intType => inferrer.intType;
-  TypeMask get doubleType => inferrer.doubleType;
-  TypeMask get numType => inferrer.numType;
-  TypeMask get stringType => inferrer.stringType;
-  TypeMask get listType => inferrer.listType;
-  TypeMask get mapType => inferrer.mapType;
-  TypeMask get nonNullType => inferrer.nonNullType;
-  TypeMask get mutableNativeListType => backend.mutableArrayType;
-
-  TypeMask numStringBoolType;
-
-  ClassElement get jsNullClass => backend.jsNullClass;
-
-  // TODO(karlklose): remove compiler here.
-  TypeMaskSystem(dart2js.Compiler compiler)
-    : inferrer = compiler.typesTask,
-      classWorld = compiler.world,
-      backend = compiler.backend {
-    numStringBoolType =
-      new TypeMask.unionOf(<TypeMask>[numType, stringType, boolType],
-                           classWorld);
-  }
-
-  Element locateSingleElement(TypeMask mask, Selector selector) {
-    return mask.locateSingleElement(selector, mask, classWorld.compiler);
-  }
-
-  bool needsNoSuchMethodHandling(TypeMask mask, Selector selector) {
-    return mask.needsNoSuchMethodHandling(selector, classWorld);
-  }
-
-  TypeMask getReceiverType(MethodElement method) {
-    assert(method.isInstanceMember);
-    return nonNullSubclass(method.enclosingClass);
-  }
-
-  TypeMask getParameterType(ParameterElement parameter) {
-    return inferrer.getGuaranteedTypeOfElement(parameter);
-  }
-
-  TypeMask getReturnType(FunctionElement function) {
-    return inferrer.getGuaranteedReturnTypeOfElement(function);
-  }
-
-  TypeMask getInvokeReturnType(Selector selector, TypeMask mask) {
-    return inferrer.getGuaranteedTypeOfSelector(selector, mask);
-  }
-
-  TypeMask getFieldType(FieldElement field) {
-    return inferrer.getGuaranteedTypeOfElement(field);
-  }
-
-  TypeMask join(TypeMask a, TypeMask b) {
-    return a.union(b, classWorld);
-  }
-
-  TypeMask getTypeOf(ConstantValue constant) {
-    return computeTypeMask(inferrer.compiler, constant);
-  }
-
-  TypeMask nonNullExact(ClassElement element) {
-    // The class world does not know about classes created by
-    // closure conversion, so just treat those as a subtypes of Function.
-    // TODO(asgerf): Maybe closure conversion should create a new ClassWorld?
-    if (element.isClosure) return functionType;
-    return new TypeMask.nonNullExact(element.declaration, classWorld);
-  }
-
-  TypeMask nonNullSubclass(ClassElement element) {
-    if (element.isClosure) return functionType;
-    return new TypeMask.nonNullSubclass(element.declaration, classWorld);
-  }
-
-  bool isDefinitelyBool(TypeMask t, {bool allowNull: false}) {
-    if (!allowNull && t.isNullable) return false;
-    return t.containsOnlyBool(classWorld);
-  }
-
-  bool isDefinitelyNum(TypeMask t, {bool allowNull: false}) {
-    if (!allowNull && t.isNullable) return false;
-    return t.containsOnlyNum(classWorld);
-  }
-
-  bool isDefinitelyString(TypeMask t, {bool allowNull: false}) {
-    if (!allowNull && t.isNullable) return false;
-    return t.containsOnlyString(classWorld);
-  }
-
-  bool isDefinitelyNumStringBool(TypeMask t, {bool allowNull: false}) {
-    if (!allowNull && t.isNullable) return false;
-    return numStringBoolType.containsMask(t, classWorld);
-  }
-
-  bool isDefinitelyNotNumStringBool(TypeMask t) {
-    return areDisjoint(t, numStringBoolType);
-  }
-
-  /// True if all values of [t] are either integers or not numbers at all.
-  ///
-  /// This does not imply that the value is an integer, since most other values
-  /// such as null are also not a non-integer double.
-  bool isDefinitelyNotNonIntegerDouble(TypeMask t) {
-    // Even though int is a subclass of double in the JS type system, we can
-    // still check this with disjointness, because [doubleType] is the *exact*
-    // double class, so this excludes things that are known to be instances of a
-    // more specific class.
-    // We currently exploit that there are no subclasses of double that are
-    // not integers (e.g. there is no UnsignedDouble class or whatever).
-    return areDisjoint(t, doubleType);
-  }
-
-  bool isDefinitelyInt(TypeMask t, {bool allowNull: false}) {
-    if (!allowNull && t.isNullable) return false;
-    return t.satisfies(backend.jsIntClass, classWorld);
-  }
-
-  bool isDefinitelyNativeList(TypeMask t, {bool allowNull: false}) {
-    if (!allowNull && t.isNullable) return false;
-    return t.satisfies(backend.jsArrayClass, classWorld);
-  }
-
-  bool isDefinitelyMutableNativeList(TypeMask t, {bool allowNull: false}) {
-    if (!allowNull && t.isNullable) return false;
-    return t.satisfies(backend.jsMutableArrayClass, classWorld);
-  }
-
-  bool isDefinitelyFixedNativeList(TypeMask t, {bool allowNull: false}) {
-    if (!allowNull && t.isNullable) return false;
-    return t.satisfies(backend.jsFixedArrayClass, classWorld);
-  }
-
-  bool areDisjoint(TypeMask leftType, TypeMask rightType) {
-    TypeMask intersection = leftType.intersection(rightType, classWorld);
-    return intersection.isEmpty && !intersection.isNullable;
-  }
-
-  AbstractBool isSubtypeOf(TypeMask value,
-                           types.DartType type,
-                           {bool allowNull}) {
-    assert(allowNull != null);
-    if (type is types.DynamicType) {
-      return AbstractBool.True;
-    }
-    if (type is types.InterfaceType) {
-      TypeMask typeAsMask = allowNull
-          ? new TypeMask.subtype(type.element, classWorld)
-          : new TypeMask.nonNullSubtype(type.element, classWorld);
-      if (areDisjoint(value, typeAsMask)) {
-        // Disprove the subtype relation based on the class alone.
-        return AbstractBool.False;
-      }
-      if (!type.treatAsRaw) {
-        // If there are type arguments, we cannot prove the subtype relation,
-        // because the type arguments are unknown on both the value and type.
-        return AbstractBool.Maybe;
-      }
-      if (typeAsMask.containsMask(value, classWorld)) {
-        // All possible values are contained in the set of allowed values.
-        // Note that we exploit the fact that [typeAsMask] is an exact
-        // representation of [type], not an approximation.
-        return AbstractBool.True;
-      }
-      // The value is neither contained in the type, nor disjoint from the type.
-      return AbstractBool.Maybe;
-    }
-    // TODO(asgerf): Support function types, and what else might be missing.
-    return AbstractBool.Maybe;
-  }
-
-  /// Returns whether [type] is one of the falsy values: false, 0, -0, NaN,
-  /// the empty string, or null.
-  AbstractBool boolify(TypeMask type) {
-    if (isDefinitelyNotNumStringBool(type) && !type.isNullable) {
-      return AbstractBool.True;
-    }
-    return AbstractBool.Maybe;
-  }
-}
+import 'cps_ir_nodes.dart';
+import 'type_mask_system.dart';
 
 class ConstantPropagationLattice {
   final TypeMaskSystem typeSystem;
   final ConstantSystem constantSystem;
   final types.DartTypes dartTypes;
   final AbstractValue anything;
+  final AbstractValue nullValue;
 
   ConstantPropagationLattice(TypeMaskSystem typeSystem,
                              this.constantSystem,
                              this.dartTypes)
     : this.typeSystem = typeSystem,
-      anything = new AbstractValue.nonConstant(typeSystem.dynamicType);
+      anything = new AbstractValue.nonConstant(typeSystem.dynamicType),
+      nullValue = new AbstractValue.constantValue(
+          new NullConstantValue(), new TypeMask.empty());
 
   final AbstractValue nothing = new AbstractValue.nothing();
 
@@ -298,6 +124,24 @@
         typeSystem.isDefinitelyInt(value.type, allowNull: allowNull);
   }
 
+  bool isDefinitelyUint31(AbstractValue value,
+                       {bool allowNull: false}) {
+    return value.isNothing ||
+        typeSystem.isDefinitelyUint31(value.type, allowNull: allowNull);
+  }
+
+  bool isDefinitelyUint32(AbstractValue value,
+                       {bool allowNull: false}) {
+    return value.isNothing ||
+        typeSystem.isDefinitelyUint32(value.type, allowNull: allowNull);
+  }
+
+  bool isDefinitelyUint(AbstractValue value,
+                       {bool allowNull: false}) {
+    return value.isNothing ||
+        typeSystem.isDefinitelyUint(value.type, allowNull: allowNull);
+  }
+
   bool isDefinitelyNativeList(AbstractValue value,
                               {bool allowNull: false}) {
     return value.isNothing ||
@@ -318,6 +162,31 @@
                                                allowNull: allowNull);
   }
 
+  bool isDefinitelyExtendableNativeList(AbstractValue value,
+                                        {bool allowNull: false}) {
+    return value.isNothing ||
+        typeSystem.isDefinitelyExtendableNativeList(value.type,
+                                                    allowNull: allowNull);
+  }
+
+  bool isDefinitelyIndexable(AbstractValue value, {bool allowNull: false}) {
+    return value.isNothing ||
+        typeSystem.isDefinitelyIndexable(value.type, allowNull: allowNull);
+  }
+
+  /// Returns `true` if [value] represents an int value that must be in the
+  /// inclusive range.
+  bool isDefinitelyIntInRange(AbstractValue value, {int min, int max}) {
+    if (value.isNothing) return true;
+    if (!isDefinitelyInt(value)) return false;
+    PrimitiveConstantValue constant = value.constant;
+    if (constant == null) return false;
+    if (!constant.isInt) return false;
+    if (min != null && constant.primitiveValue < min) return false;
+    if (max != null && constant.primitiveValue > max) return false;
+    return true;
+  }
+
   /// Returns whether the given [value] is an instance of [type].
   ///
   /// Since [value] and [type] are not always known, [AbstractBool.Maybe] is
@@ -401,32 +270,231 @@
   AbstractValue binaryOp(BinaryOperator operator,
                          AbstractValue left,
                          AbstractValue right) {
+    switch (operator.kind) {
+      case BinaryOperatorKind.ADD:
+        return addSpecial(left, right);
+
+      case BinaryOperatorKind.SUB:
+        return subtractSpecial(left, right);
+
+      case BinaryOperatorKind.MUL:
+        return multiplySpecial(left, right);
+
+      case BinaryOperatorKind.DIV:
+        return divideSpecial(left, right);
+
+      case BinaryOperatorKind.IDIV:
+        return truncatingDivideSpecial(left, right);
+
+      case BinaryOperatorKind.MOD:
+        return moduloSpecial(left, right);
+
+      case BinaryOperatorKind.EQ:
+        return equalSpecial(left, right);
+
+      case BinaryOperatorKind.AND:
+        return andSpecial(left, right);
+
+      case BinaryOperatorKind.OR:
+        return orSpecial(left, right);
+
+      case BinaryOperatorKind.XOR:
+        return xorSpecial(left, right);
+
+      case BinaryOperatorKind.SHL:
+        return shiftLeftSpecial(left, right);
+
+      case BinaryOperatorKind.SHR:
+        return shiftRightSpecial(left, right);
+
+      case BinaryOperatorKind.LT:
+        return lessSpecial(left, right);
+
+      case BinaryOperatorKind.LTEQ:
+        return lessEqualSpecial(left, right);
+
+      case BinaryOperatorKind.GT:
+        return greaterSpecial(left, right);
+
+      case BinaryOperatorKind.GTEQ:
+        return greaterEqualSpecial(left, right);
+
+      default:
+        break;
+    }
+
     if (left.isNothing || right.isNothing) {
       return nothing;
     }
     if (left.isConstant && right.isConstant) {
       BinaryOperation operation = constantSystem.lookupBinary(operator);
       ConstantValue result = operation.fold(left.constant, right.constant);
-      if (result == null) return anything;
-      return constant(result);
+      if (result != null) return constant(result);
     }
-    // TODO(asgerf): Handle remaining operators and the UIntXX types.
-    switch (operator.kind) {
-      case BinaryOperatorKind.ADD:
-      case BinaryOperatorKind.SUB:
-      case BinaryOperatorKind.MUL:
-        if (isDefinitelyInt(left) && isDefinitelyInt(right)) {
-          return nonConstant(typeSystem.intType);
-        }
-        return null;
-
-      default:
-        return null; // The caller will use return type from type inference.
-    }
+    return null; // The caller will use return type from type inference.
   }
 
+  AbstractValue foldBinary(BinaryOperation operation,
+      AbstractValue left, AbstractValue right) {
+    if (left.isNothing || right.isNothing) return nothing;
+    if (left.isConstant && right.isConstant) {
+      ConstantValue result = operation.fold(left.constant, right.constant);
+      if (result != null) return constant(result);
+    }
+    return null;
+  }
+
+  AbstractValue closedOnInt(AbstractValue left, AbstractValue right) {
+    if (isDefinitelyInt(left) && isDefinitelyInt(right)) {
+      return nonConstant(typeSystem.intType);
+    }
+    return null;
+  }
+
+  AbstractValue closedOnUint(AbstractValue left, AbstractValue right) {
+    if (isDefinitelyUint(left) && isDefinitelyUint(right)) {
+      return nonConstant(typeSystem.uintType);
+    }
+    return null;
+  }
+
+  AbstractValue closedOnUint31(AbstractValue left, AbstractValue right) {
+    if (isDefinitelyUint31(left) && isDefinitelyUint31(right)) {
+      return nonConstant(typeSystem.uint31Type);
+    }
+    return null;
+  }
+
+  AbstractValue addSpecial(AbstractValue left, AbstractValue right) {
+    AbstractValue folded = foldBinary(constantSystem.add, left, right);
+    if (folded != null) return folded;
+    if (isDefinitelyNum(left)) {
+      if (isDefinitelyUint31(left) && isDefinitelyUint31(right)) {
+        return nonConstant(typeSystem.uint32Type);
+      }
+      return closedOnUint(left, right) ?? closedOnInt(left, right);
+    }
+    return null;
+  }
+
+  AbstractValue subtractSpecial(AbstractValue left, AbstractValue right) {
+    AbstractValue folded = foldBinary(constantSystem.subtract, left, right);
+    return folded ?? closedOnInt(left, right);
+  }
+
+  AbstractValue multiplySpecial(AbstractValue left, AbstractValue right) {
+    AbstractValue folded = foldBinary(constantSystem.multiply, left, right);
+    return folded ?? closedOnUint(left, right) ?? closedOnInt(left, right);
+  }
+
+  AbstractValue divideSpecial(AbstractValue left, AbstractValue right) {
+    return foldBinary(constantSystem.divide, left, right);
+  }
+
+  AbstractValue truncatingDivideSpecial(
+      AbstractValue left, AbstractValue right) {
+    AbstractValue folded =
+        foldBinary(constantSystem.truncatingDivide, left, right);
+    if (folded != null) return folded;
+    if (isDefinitelyNum(left)) {
+      if (isDefinitelyUint32(left) && isDefinitelyIntInRange(right, min: 2)) {
+        return nonConstant(typeSystem.uint31Type);
+      }
+      if (isDefinitelyUint(right)) {
+        // `0` will be an exception, other values will shrink the result.
+        if (isDefinitelyUint31(left)) return nonConstant(typeSystem.uint31Type);
+        if (isDefinitelyUint32(left)) return nonConstant(typeSystem.uint32Type);
+        if (isDefinitelyUint(left)) return nonConstant(typeSystem.uintType);
+      }
+      return nonConstant(typeSystem.intType);
+    }
+    return null;
+  }
+
+  AbstractValue moduloSpecial(AbstractValue left, AbstractValue right) {
+    AbstractValue folded = foldBinary(constantSystem.modulo, left, right);
+    return folded ?? closedOnUint(left, right) ?? closedOnInt(left, right);
+  }
+
+  AbstractValue remainderSpecial(AbstractValue left, AbstractValue right) {
+    if (left.isNothing || right.isNothing) return nothing;
+    AbstractValue folded = null;  // Remainder not in constant system.
+    return folded ?? closedOnUint(left, right) ?? closedOnInt(left, right);
+  }
+
+  AbstractValue equalSpecial(AbstractValue left, AbstractValue right) {
+    AbstractValue folded = foldBinary(constantSystem.equal, left, right);
+    if (folded != null) return folded;
+    bool behavesLikeIdentity =
+        isDefinitelyNumStringBool(left, allowNull: true) ||
+        right.isNullConstant;
+    if (behavesLikeIdentity &&
+        typeSystem.areDisjoint(left.type, right.type)) {
+      return constant(new FalseConstantValue());
+    }
+    return null;
+  }
+
+  AbstractValue andSpecial(AbstractValue left, AbstractValue right) {
+    AbstractValue folded = foldBinary(constantSystem.bitAnd, left, right);
+    if (folded != null) return folded;
+    if (isDefinitelyNum(left)) {
+      if (isDefinitelyUint31(left) || isDefinitelyUint31(right)) {
+        // Either 31-bit argument will truncate the other.
+        return nonConstant(typeSystem.uint31Type);
+      }
+    }
+    return null;
+  }
+
+  AbstractValue orSpecial(AbstractValue left, AbstractValue right) {
+    AbstractValue folded = foldBinary(constantSystem.bitOr, left, right);
+    return folded ?? closedOnUint31(left, right);
+  }
+
+  AbstractValue xorSpecial(AbstractValue left, AbstractValue right) {
+    AbstractValue folded = foldBinary(constantSystem.bitXor, left, right);
+    return folded ?? closedOnUint31(left, right);
+  }
+
+  AbstractValue shiftLeftSpecial(AbstractValue left, AbstractValue right) {
+    return foldBinary(constantSystem.shiftLeft, left, right);
+  }
+
+  AbstractValue shiftRightSpecial(AbstractValue left, AbstractValue right) {
+    AbstractValue folded = foldBinary(constantSystem.shiftRight, left, right);
+    if (folded != null) return folded;
+    if (isDefinitelyUint31(left)) {
+      return nonConstant(typeSystem.uint31Type);
+    } else if (isDefinitelyUint32(left)) {
+      if (isDefinitelyIntInRange(right, min: 1, max: 31)) {
+        // A zero will be shifted into the 'sign' bit.
+        return nonConstant(typeSystem.uint31Type);
+      }
+      return nonConstant(typeSystem.uint32Type);
+    }
+    return null;
+  }
+
+  AbstractValue lessSpecial(AbstractValue left, AbstractValue right) {
+    return foldBinary(constantSystem.less, left, right);
+  }
+
+  AbstractValue lessEqualSpecial(AbstractValue left, AbstractValue right) {
+    return foldBinary(constantSystem.lessEqual, left, right);
+  }
+
+  AbstractValue greaterSpecial(AbstractValue left, AbstractValue right) {
+    return foldBinary(constantSystem.greater, left, right);
+  }
+
+  AbstractValue greaterEqualSpecial(AbstractValue left, AbstractValue right) {
+    return foldBinary(constantSystem.greaterEqual, left, right);
+  }
+
+
   AbstractValue stringConstant(String value) {
-    return constant(new StringConstantValue(new DartString.literal(value)));
+    return constant(new StringConstantValue(new ast.DartString.literal(value)));
   }
 
   AbstractValue stringify(AbstractValue value) {
@@ -460,11 +528,26 @@
     return typeSystem.boolify(value.type);
   }
 
+  /// Returns whether [value] is the value `true`.
+  AbstractBool strictBoolify(AbstractValue value) {
+    if (value.isNothing) return AbstractBool.Nothing;
+    if (value.isConstant) {
+      return value.constant.isTrue ? AbstractBool.True : AbstractBool.False;
+    }
+    return typeSystem.strictBoolify(value.type);
+  }
+
   /// The possible return types of a method that may be targeted by
   /// [typedSelector]. If the given selector is not a [TypedSelector], any
   /// reachable method matching the selector may be targeted.
   AbstractValue getInvokeReturnType(Selector selector, TypeMask mask) {
-    return nonConstant(typeSystem.getInvokeReturnType(selector, mask));
+    return fromMask(typeSystem.getInvokeReturnType(selector, mask));
+  }
+
+  AbstractValue fromMask(TypeMask mask) {
+    ConstantValue constantValue = typeSystem.getConstantOf(mask);
+    if (constantValue != null) return constant(constantValue, mask);
+    return nonConstant(mask);
   }
 }
 
@@ -482,25 +565,25 @@
   String get passName => 'Sparse constant propagation';
 
   final dart2js.Compiler _compiler;
-  // The constant system is used for evaluation of expressions with constant
-  // arguments.
+  final CpsFunctionCompiler _functionCompiler;
   final ConstantPropagationLattice _lattice;
-  final dart2js.InternalErrorFunction _internalError;
-  final Map<Definition, AbstractValue> _values = <Definition, AbstractValue>{};
+  final InternalErrorFunction _internalError;
+  final Map<Variable, ConstantValue> _values = <Variable, ConstantValue>{};
+  final TypeMaskSystem _typeSystem;
 
-  TypePropagator(dart2js.Compiler compiler)
+  TypePropagator(dart2js.Compiler compiler,
+                 TypeMaskSystem typeSystem,
+                 this._functionCompiler)
       : _compiler = compiler,
-        _internalError = compiler.internalError,
+        _internalError = compiler.reporter.internalError,
+        _typeSystem = typeSystem,
         _lattice = new ConstantPropagationLattice(
-            new TypeMaskSystem(compiler),
+            typeSystem,
             compiler.backend.constantSystem,
             compiler.types);
 
   @override
   void rewrite(FunctionDefinition root) {
-    // Set all parent pointers.
-    new ParentVisitor().visit(root);
-
     Map<Expression, ConstantValue> replacements = <Expression, ConstantValue>{};
 
     // Analyze. In this phase, the entire term is analyzed for reachability
@@ -518,14 +601,13 @@
     // with constant results or existing values that are in scope.
     TransformingVisitor transformer = new TransformingVisitor(
         _compiler,
+        _functionCompiler,
         _lattice,
         analyzer,
         replacements,
         _internalError);
     transformer.transform(root);
   }
-
-  getType(Node node) => _values[node];
 }
 
 final Map<String, BuiltinOperator> NumBinaryBuiltins =
@@ -533,6 +615,7 @@
     '+':  BuiltinOperator.NumAdd,
     '-':  BuiltinOperator.NumSubtract,
     '*':  BuiltinOperator.NumMultiply,
+    '/':  BuiltinOperator.NumDivide,
     '&':  BuiltinOperator.NumAnd,
     '|':  BuiltinOperator.NumOr,
     '^':  BuiltinOperator.NumXor,
@@ -546,22 +629,24 @@
  * Uses the information from a preceding analysis pass in order to perform the
  * actual transformations on the CPS graph.
  */
-class TransformingVisitor extends LeafVisitor {
+class TransformingVisitor extends DeepRecursiveVisitor {
   final TypePropagationVisitor analyzer;
   final Map<Expression, ConstantValue> replacements;
   final ConstantPropagationLattice lattice;
   final dart2js.Compiler compiler;
+  final CpsFunctionCompiler functionCompiler;
 
   JavaScriptBackend get backend => compiler.backend;
   TypeMaskSystem get typeSystem => lattice.typeSystem;
   types.DartTypes get dartTypes => lattice.dartTypes;
-  Map<Node, AbstractValue> get values => analyzer.values;
+  Map<Variable, ConstantValue> get values => analyzer.values;
 
-  final dart2js.InternalErrorFunction internalError;
+  final InternalErrorFunction internalError;
 
   final List<Node> stack = <Node>[];
 
   TransformingVisitor(this.compiler,
+                      this.functionCompiler,
                       this.lattice,
                       this.analyzer,
                       this.replacements,
@@ -604,7 +689,10 @@
 
   void visitLetPrim(LetPrim node) {
     AbstractValue value = getValue(node.primitive);
-    if (node.primitive is! Constant && value.isConstant) {
+    if (node.primitive is! Constant &&
+        node.primitive is! Refinement &&
+        node.primitive.isSafeForElimination &&
+        value.isConstant) {
       // If the value is a known constant, compile it as a constant.
       Constant newPrim = makeConstantPrimitive(value.constant);
       newPrim.substituteFor(node.primitive);
@@ -635,6 +723,9 @@
 
   void visitContinuation(Continuation node) {
     if (node.isReturnContinuation) return;
+    if (!analyzer.reachableContinuations.contains(node)) {
+      replaceSubtree(node.body, new Unreachable());
+    }
     // Process the continuation body.
     // Note that the continuation body may have changed since the continuation
     // was put on the stack (e.g. [visitInvokeContinuation] may do this).
@@ -645,7 +736,7 @@
 
   /// Sets parent pointers and computes types for the given subtree.
   void reanalyze(Node node) {
-    new ParentVisitor().visit(node);
+    ParentVisitor.setParents(node);
     analyzer.reanalyzeSubtree(node);
   }
 
@@ -690,13 +781,12 @@
     // traversing the entire subtree of [node]. Temporarily close the
     // term with a dummy node while recomputing types.
     context.body = new Unreachable();
-    new ParentVisitor().visit(insertedCode.root);
     reanalyze(insertedCode.root);
 
     context.body = node;
     node.parent = context;
   }
-  
+
   /// Binds [prim] before [node].
   void insertLetPrim(Expression node, Primitive prim) {
     InteriorNode parent = node.parent;
@@ -710,8 +800,8 @@
   /// Make a constant primitive for [constant] and set its entry in [values].
   Constant makeConstantPrimitive(ConstantValue constant) {
     Constant primitive = new Constant(constant);
-    values[primitive] = new AbstractValue.constantValue(constant,
-        typeSystem.getTypeOf(constant));
+    primitive.type = typeSystem.getTypeOf(constant);
+    values[primitive] = constant;
     return primitive;
   }
 
@@ -742,19 +832,27 @@
   void visitBranch(Branch node) {
     Continuation trueCont = node.trueContinuation.definition;
     Continuation falseCont = node.falseContinuation.definition;
-    IsTrue conditionNode = node.condition;
-    Primitive condition = conditionNode.value.definition;
-
+    Primitive condition = node.condition.definition;
     AbstractValue conditionValue = getValue(condition);
-    AbstractBool boolifiedValue = lattice.boolify(conditionValue);
+
+    // Change to non-strict check if the condition is a boolean or null.
+    if (lattice.isDefinitelyBool(conditionValue, allowNull: true)) {
+      node.isStrictCheck = false;
+    }
+
+    AbstractBool boolifiedValue = node.isStrictCheck
+        ? lattice.strictBoolify(conditionValue)
+        : lattice.boolify(conditionValue);
 
     if (boolifiedValue == AbstractBool.True) {
+      replaceSubtree(falseCont.body, new Unreachable());
       InvokeContinuation invoke = new InvokeContinuation(trueCont, []);
       replaceSubtree(node, invoke);
       push(invoke);
       return;
     }
     if (boolifiedValue == AbstractBool.False) {
+      replaceSubtree(trueCont.body, new Unreachable());
       InvokeContinuation invoke = new InvokeContinuation(falseCont, []);
       replaceSubtree(node, invoke);
       push(invoke);
@@ -762,7 +860,8 @@
     }
 
     if (condition is ApplyBuiltinOperator &&
-        condition.operator == BuiltinOperator.LooseEq) {
+        (condition.operator == BuiltinOperator.LooseEq ||
+         condition.operator == BuiltinOperator.StrictEq)) {
       Primitive leftArg = condition.arguments[0].definition;
       Primitive rightArg = condition.arguments[1].definition;
       AbstractValue left = getValue(leftArg);
@@ -773,12 +872,26 @@
         //   if (x == null) S1 else S2
         //     =>
         //   if (x) S2 else S1   (note the swapped branches)
-        Branch branch = new Branch(new IsTrue(leftArg), falseCont, trueCont);
+        Branch branch = new Branch.loose(leftArg, falseCont, trueCont);
         replaceSubtree(node, branch);
         return;
       } else if (left.isNullConstant &&
                  lattice.isDefinitelyNotNumStringBool(right)) {
-        Branch branch = new Branch(new IsTrue(rightArg), falseCont, trueCont);
+        Branch branch = new Branch.loose(rightArg, falseCont, trueCont);
+        replaceSubtree(node, branch);
+        return;
+      } else if (right.isTrueConstant &&
+                 lattice.isDefinitelyBool(left, allowNull: true)) {
+        // Rewrite:
+        //   if (x == true) S1 else S2
+        //     =>
+        //   if (x) S1 else S2
+        Branch branch = new Branch.loose(leftArg, trueCont, falseCont);
+        replaceSubtree(node, branch);
+        return;
+      } else if (left.isTrueConstant &&
+                 lattice.isDefinitelyBool(right, allowNull: true)) {
+        Branch branch = new Branch.loose(rightArg, trueCont, falseCont);
         replaceSubtree(node, branch);
         return;
       }
@@ -812,6 +925,11 @@
     }
   }
 
+  /// Returns the possible targets of [selector] when invoked on a receiver
+  /// of type [receiverType].
+  Iterable<Element> getAllTargets(TypeMask receiverType, Selector selector) {
+    return compiler.world.allFunctions.filter(selector, receiverType);
+  }
 
   /************************* CALL EXPRESSIONS *************************/
 
@@ -833,52 +951,100 @@
     }
 
     if (node.selector.isOperator && node.arguments.length == 2) {
-      // The operators we specialize are are intercepted calls, so the operands
-      // are in the argument list.
-      Primitive leftArg = node.arguments[0].definition;
-      Primitive rightArg = node.arguments[1].definition;
+      Primitive leftArg = getDartReceiver(node);
+      Primitive rightArg = getDartArgument(node, 0);
       AbstractValue left = getValue(leftArg);
       AbstractValue right = getValue(rightArg);
 
-      if (node.selector.name == '==') {
+      String opname = node.selector.name;
+      if (opname == '==') {
         // Equality is special due to its treatment of null values and the
         // fact that Dart-null corresponds to both JS-null and JS-undefined.
         // Please see documentation for IsFalsy, StrictEq, and LooseEq.
         if (left.isNullConstant || right.isNullConstant) {
-          return replaceWithBinary(BuiltinOperator.LooseEq, leftArg, rightArg);
+          return replaceWithBinary(BuiltinOperator.Identical,
+                                   leftArg, rightArg);
         }
-        // Comparison of numbers, strings, and booleans.
-        if (lattice.isDefinitelyNumStringBool(left, allowNull: true) &&
-            lattice.isDefinitelyNumStringBool(right, allowNull: true) &&
-            !(left.isNullable && right.isNullable)) {
-          return replaceWithBinary(BuiltinOperator.StrictEq, leftArg, rightArg);
+        // There are several implementations of == that behave like identical.
+        // Specialize it if we definitely call one of those.
+        bool behavesLikeIdentical = true;
+        for (Element target in getAllTargets(left.type, node.selector)) {
+          ClassElement clazz = target.enclosingClass.declaration;
+          if (clazz != compiler.world.objectClass &&
+              clazz != backend.jsInterceptorClass &&
+              clazz != backend.jsNullClass) {
+            behavesLikeIdentical = false;
+            break;
+          }
         }
-        if (lattice.isDefinitelyNum(left, allowNull: true) &&
-            lattice.isDefinitelyNum(right, allowNull: true)) {
-          return replaceWithBinary(BuiltinOperator.LooseEq, leftArg, rightArg);
-        }
-        if (lattice.isDefinitelyString(left, allowNull: true) &&
-            lattice.isDefinitelyString(right, allowNull: true)) {
-          return replaceWithBinary(BuiltinOperator.LooseEq, leftArg, rightArg);
-        }
-        if (lattice.isDefinitelyBool(left, allowNull: true) &&
-            lattice.isDefinitelyBool(right, allowNull: true)) {
-          return replaceWithBinary(BuiltinOperator.LooseEq, leftArg, rightArg);
+        if (behavesLikeIdentical) {
+          return replaceWithBinary(BuiltinOperator.Identical,
+                                   leftArg, rightArg);
         }
       } else {
-        // Try to insert a numeric operator.
         if (lattice.isDefinitelyNum(left, allowNull: false) &&
             lattice.isDefinitelyNum(right, allowNull: false)) {
-          BuiltinOperator operator = NumBinaryBuiltins[node.selector.name];
+          // Try to insert a numeric operator.
+          BuiltinOperator operator = NumBinaryBuiltins[opname];
           if (operator != null) {
             return replaceWithBinary(operator, leftArg, rightArg);
           }
+          // Shift operators are not in [NumBinaryBuiltins] because Dart shifts
+          // behave different to JS shifts, especially in the handling of the
+          // shift count.
+          // Try to insert a shift-left operator.
+          if (opname == '<<' &&
+              lattice.isDefinitelyInt(left) &&
+              lattice.isDefinitelyIntInRange(right, min: 0, max: 31)) {
+            return replaceWithBinary(BuiltinOperator.NumShl, leftArg, rightArg);
+          }
+          // Try to insert a shift-right operator. JavaScript's right shift is
+          // consistent with Dart's only for left operands in the unsigned
+          // 32-bit range.
+          if (opname == '>>' &&
+              lattice.isDefinitelyUint32(left) &&
+              lattice.isDefinitelyIntInRange(right, min: 0, max: 31)) {
+            return replaceWithBinary(BuiltinOperator.NumShr, leftArg, rightArg);
+          }
+          // Try to use remainder for '%'. Both operands must be non-negative
+          // and the divisor must be non-zero.
+          if (opname == '%' &&
+              lattice.isDefinitelyUint(left) &&
+              lattice.isDefinitelyUint(right) &&
+              lattice.isDefinitelyIntInRange(right, min: 1)) {
+            return replaceWithBinary(
+                BuiltinOperator.NumRemainder, leftArg, rightArg);
+          }
+
+          if (opname == '~/' &&
+              lattice.isDefinitelyUint32(left) &&
+              lattice.isDefinitelyIntInRange(right, min: 2)) {
+            return replaceWithBinary(
+                BuiltinOperator.NumTruncatingDivideToSigned32,
+                leftArg, rightArg);
+          }
         }
-        else if (lattice.isDefinitelyString(left, allowNull: false) &&
-                 lattice.isDefinitelyString(right, allowNull: false)) {
-          if (node.selector.name == '+') {
-            return replaceWithBinary(BuiltinOperator.StringConcatenate,
-                                     leftArg, rightArg);
+        if (lattice.isDefinitelyString(left, allowNull: false) &&
+            lattice.isDefinitelyString(right, allowNull: false) &&
+            opname == '+') {
+          return replaceWithBinary(BuiltinOperator.StringConcatenate,
+                                   leftArg, rightArg);
+        }
+      }
+    }
+    if (node.selector.isCall) {
+      String name = node.selector.name;
+      Primitive receiver = getDartReceiver(node);
+      AbstractValue receiverValue = getValue(receiver);
+      if (name == 'remainder') {
+        if (node.arguments.length == 2) {
+          Primitive arg = getDartArgument(node, 0);
+          AbstractValue argValue = getValue(arg);
+          if (lattice.isDefinitelyInt(receiverValue) &&
+              lattice.isDefinitelyInt(argValue) &&
+              isIntNotZero(argValue)) {
+            return
+                replaceWithBinary(BuiltinOperator.NumRemainder, receiver, arg);
           }
         }
       }
@@ -888,12 +1054,18 @@
     return false;
   }
 
+  /// Returns `true` if [value] represents an int value that cannot be zero.
+  bool isIntNotZero(AbstractValue value) {
+    return lattice.isDefinitelyIntInRange(value, min: 1) ||
+        lattice.isDefinitelyIntInRange(value, max: -1);
+  }
+
   bool isInterceptedSelector(Selector selector) {
     return backend.isInterceptedSelector(selector);
   }
 
   Primitive getDartReceiver(InvokeMethod node) {
-    if (isInterceptedSelector(node.selector)) {
+    if (node.receiverIsIntercepted) {
       return node.arguments[0].definition;
     } else {
       return node.receiver.definition;
@@ -920,7 +1092,7 @@
     if (target is! FieldElement) return false;
     // TODO(asgerf): Inlining native fields will make some tests pass for the
     // wrong reason, so for testing reasons avoid inlining them.
-    if (target.isNative) return false;
+    if (target.isNative || target.isJsInterop) return false;
     Continuation cont = node.continuation.definition;
     if (node.selector.isGetter) {
       GetField get = new GetField(getDartReceiver(node), target);
@@ -957,13 +1129,13 @@
     Primitive isTooSmall = cps.applyBuiltin(
         BuiltinOperator.NumLt,
         <Primitive>[index, cps.makeZero()]);
-    cps.ifTrue(isTooSmall).invokeContinuation(fail);
+    cps.ifTruthy(isTooSmall).invokeContinuation(fail);
     Primitive isTooLarge = cps.applyBuiltin(
         BuiltinOperator.NumGe,
         <Primitive>[index, cps.letPrim(new GetLength(list))]);
-    cps.ifTrue(isTooLarge).invokeContinuation(fail);
+    cps.ifTruthy(isTooLarge).invokeContinuation(fail);
     cps.insideContinuation(fail).invokeStaticThrower(
-        backend.getThrowIndexOutOfBoundsError(),
+        backend.helpers.throwIndexOutOfBoundsError,
         <Primitive>[list, index]);
     return cps;
   }
@@ -980,33 +1152,63 @@
     Primitive lengthChanged = cps.applyBuiltin(
         BuiltinOperator.StrictNeq,
         <Primitive>[originalLength, cps.letPrim(new GetLength(list))]);
-    cps.ifTrue(lengthChanged).invokeStaticThrower(
-        backend.getThrowConcurrentModificationError(),
+    cps.ifTruthy(lengthChanged).invokeStaticThrower(
+        backend.helpers.throwConcurrentModificationError,
         <Primitive>[list]);
     return cps;
   }
 
-  /// Counts number of index accesses on [list] and determines based on
-  /// that number if we should try to inline them.
+  /// Tries to replace [node] with a direct `length` or index access.
   ///
-  /// This is a short-term solution to avoid inserting a lot of bounds checks,
-  /// since there is currently no optimization for eliminating them.
-  bool hasTooManyIndexAccesses(Primitive list) {
-    int count = 0;
-    for (Reference ref = list.firstRef; ref != null; ref = ref.next) {
-      Node use = ref.parent;
-      if (use is InvokeMethod &&
-          (use.selector.isIndex || use.selector.isIndexSet) &&
-          getDartReceiver(use) == list) {
-        ++count;
-      } else if (use is GetIndex && use.object.definition == list) {
-        ++count;
-      } else if (use is SetIndex && use.object.definition == list) {
-        ++count;
-      }
-      if (count > 2) return true;
+  /// Returns `true` if the node was replaced.
+  bool specializeIndexableAccess(InvokeMethod node) {
+    Primitive receiver = getDartReceiver(node);
+    AbstractValue receiverValue = getValue(receiver);
+    if (!typeSystem.isDefinitelyIndexable(receiverValue.type,
+            allowNull: true)) {
+      return false;
     }
-    return false;
+    SourceInformation sourceInfo = node.sourceInformation;
+    Continuation cont = node.continuation.definition;
+    switch (node.selector.name) {
+      case 'length':
+        if (!node.selector.isGetter) return false;
+        CpsFragment cps = new CpsFragment(sourceInfo);
+        cps.invokeContinuation(cont, [cps.letPrim(new GetLength(receiver))]);
+        replaceSubtree(node, cps.result);
+        push(cps.result);
+        return true;
+
+      case '[]':
+        Primitive index = getDartArgument(node, 0);
+        if (!lattice.isDefinitelyInt(getValue(index))) return false;
+        CpsFragment cps = makeBoundsCheck(receiver, index, sourceInfo);
+        GetIndex get = cps.letPrim(new GetIndex(receiver, index));
+        cps.invokeContinuation(cont, [get]);
+        replaceSubtree(node, cps.result);
+        push(cps.result);
+        return true;
+
+      case '[]=':
+        if (receiverValue.isNullable) return false;
+        if (!typeSystem.isDefinitelyMutableIndexable(receiverValue.type)) {
+          return false;
+        }
+        Primitive index = getDartArgument(node, 0);
+        Primitive value = getDartArgument(node, 1);
+        if (!lattice.isDefinitelyInt(getValue(index))) return false;
+        CpsFragment cps = makeBoundsCheck(receiver, index, sourceInfo);
+        cps.letPrim(new SetIndex(receiver, index, value));
+        assert(cont.parameters.single.hasNoUses);
+        cont.parameters.clear();
+        cps.invokeContinuation(cont, []);
+        replaceSubtree(node, cps.result);
+        push(cps.result);
+        return true;
+
+      default:
+        return false;
+    }
   }
 
   /// Tries to replace [node] with one or more direct array access operations.
@@ -1023,20 +1225,82 @@
         lattice.isDefinitelyFixedNativeList(listValue, allowNull: true);
     bool isMutable =
         lattice.isDefinitelyMutableNativeList(listValue, allowNull: true);
+    bool isExtendable =
+        lattice.isDefinitelyExtendableNativeList(listValue, allowNull: true);
     SourceInformation sourceInfo = node.sourceInformation;
     Continuation cont = node.continuation.definition;
     switch (node.selector.name) {
-      case 'length':
-        if (!node.selector.isGetter) return false;
+      case 'add':
+        if (!node.selector.isCall ||
+            node.selector.positionalArgumentCount != 1 ||
+            node.selector.namedArgumentCount != 0) {
+          return false;
+        }
+        if (!isExtendable) return false;
+        Primitive addedItem = getDartArgument(node, 0);
         CpsFragment cps = new CpsFragment(sourceInfo);
-        cps.invokeContinuation(cont, [cps.letPrim(new GetLength(list))]);
+        cps.invokeBuiltin(BuiltinMethod.Push,
+            list,
+            <Primitive>[addedItem]);
+        cps.invokeContinuation(cont, [cps.makeNull()]);
         replaceSubtree(node, cps.result);
         push(cps.result);
         return true;
 
-      case '[]':
+      case 'removeLast':
+        if (!node.selector.isCall ||
+            node.selector.argumentCount != 0) {
+          return false;
+        }
+        if (!isExtendable) return false;
+        CpsFragment cps = new CpsFragment(sourceInfo);
+        Primitive length = cps.letPrim(new GetLength(list));
+        Primitive isEmpty = cps.applyBuiltin(
+            BuiltinOperator.StrictEq,
+            [length, cps.makeZero()]);
+        CpsFragment fail = cps.ifTruthy(isEmpty);
+        fail.invokeStaticThrower(
+            backend.helpers.throwIndexOutOfBoundsError,
+            [list, fail.makeConstant(new IntConstantValue(-1))]);
+        Primitive removedItem = cps.invokeBuiltin(BuiltinMethod.Pop,
+            list,
+            <Primitive>[]);
+        cps.invokeContinuation(cont, [removedItem]);
+        replaceSubtree(node, cps.result);
+        push(cps.result);
+        return true;
+
+      case 'addAll':
+        if (!node.selector.isCall ||
+            node.selector.argumentCount != 1) {
+          return false;
+        }
+        if (!isExtendable) return false;
+        Primitive addedList = getDartArgument(node, 0);
+        // Rewrite addAll([x1, ..., xN]) to push(x1, ..., xN).
+        // Ensure that the list is not mutated between creation and use.
+        // We aim for the common case where this is the only use of the list,
+        // which also guarantees that this list is not mutated before use.
+        if (addedList is! LiteralList || !addedList.hasExactlyOneUse) {
+          return false;
+        }
+        LiteralList addedLiteral = addedList;
+        CpsFragment cps = new CpsFragment(sourceInfo);
+        cps.invokeBuiltin(BuiltinMethod.Push,
+            list,
+            addedLiteral.values.map((ref) => ref.definition).toList());
+        cps.invokeContinuation(cont, [cps.makeNull()]);
+        replaceSubtree(node, cps.result);
+        push(cps.result);
+        return true;
+
+      case 'elementAt':
+        if (!node.selector.isCall ||
+            node.selector.positionalArgumentCount != 1 ||
+            node.selector.namedArgumentCount != 0) {
+          return false;
+        }
         if (listValue.isNullable) return false;
-        if (hasTooManyIndexAccesses(list)) return false;
         Primitive index = getDartArgument(node, 0);
         if (!lattice.isDefinitelyInt(getValue(index))) return false;
         CpsFragment cps = makeBoundsCheck(list, index, sourceInfo);
@@ -1046,73 +1310,24 @@
         push(cps.result);
         return true;
 
-      case '[]=':
-        if (listValue.isNullable) return false;
-        if (hasTooManyIndexAccesses(list)) return false;
-        Primitive index = getDartArgument(node, 0);
-        Primitive value = getDartArgument(node, 1);
-        if (!isMutable) return false;
-        if (!lattice.isDefinitelyInt(getValue(index))) return false;
-        CpsFragment cps = makeBoundsCheck(list, index, sourceInfo);
-        cps.letPrim(new SetIndex(list, index, value));
-        assert(cont.parameters.single.hasNoUses);
-        cont.parameters.clear();
-        cps.invokeContinuation(cont, []);
-        replaceSubtree(node, cps.result);
-        push(cps.result);
-        return true;
-
       case 'forEach':
-        if (!node.selector.isCall ||
-            node.selector.positionalArgumentCount != 1 ||
-            node.selector.namedArgumentCount != 0) {
-          return false;
+        Element element =
+            compiler.world.locateSingleElement(node.selector, listValue.type);
+        if (element == null ||
+            !element.isFunction ||
+            !node.selector.isCall) return false;
+        assert(node.selector.positionalArgumentCount == 1);
+        assert(node.selector.namedArgumentCount == 0);
+        FunctionDefinition target = functionCompiler.compileToCpsIr(element);
+
+        node.receiver.definition.substituteFor(target.thisParameter);
+        for (int i = 0; i < node.arguments.length; ++i) {
+          node.arguments[i].definition.substituteFor(target.parameters[i]);
         }
-        Primitive callback = getDartArgument(node, 0);
-        // Rewrite to:
-        //   var originalLength = array.length, i = 0;
-        //   while (i < array.length) {
-        //     callback(array[i]);
-        //     if (array.length !== originalLength) throw;
-        //     i = i + 1;
-        //   }
-        CpsFragment cps = new CpsFragment(sourceInfo);
-        Primitive originalLength = cps.letPrim(new GetLength(list));
-        originalLength.hint = new OriginalLengthEntity();
+        node.continuation.definition.substituteFor(target.returnContinuation);
 
-        // Build a loop.
-        Parameter loopIndex = new Parameter(new LoopIndexEntity());
-        Continuation loop = cps.beginLoop(
-            <Parameter>[loopIndex], [cps.makeZero()]);
-
-        // Check for loop exit.
-        Primitive loopCondition = cps.applyBuiltin(
-            BuiltinOperator.NumLt,
-            [loopIndex, cps.letPrim(new GetLength(list))]);
-        CpsFragment exitBranch = cps.ifFalse(loopCondition);
-        exitBranch.invokeContinuation(cont, [exitBranch.makeNull()]);
-
-        // Invoke the callback.
-        Primitive arrayItem = cps.letPrim(new GetIndex(list, loopIndex));
-        cps.invokeMethod(callback,
-                         new Selector.callClosure(1),
-                         getValue(callback).type,
-                         [arrayItem]);
-
-        // Check for concurrent modification, unless the list is fixed-length.
-        if (!isFixedLength) {
-          cps.append(
-            makeConcurrentModificationCheck(list, originalLength, sourceInfo));
-        }
-
-        // Increment i and continue the loop.
-        Primitive addOne = cps.applyBuiltin(
-            BuiltinOperator.NumAdd,
-            [loopIndex, cps.makeOne()]);
-        cps.continueLoop(loop, [addOne]);
-
-        replaceSubtree(node, cps.result);
-        push(cps.result);
+        replaceSubtree(node, target.body);
+        push(target.body);
         return true;
 
       case 'iterator':
@@ -1121,16 +1336,14 @@
         Continuation iteratorCont = cont;
 
         // Check that all uses of the iterator are 'moveNext' and 'current'.
-        Selector moveNextSelector = new Selector.call('moveNext', null, 0);
-        Selector currentSelector = new Selector.getter('current', null);
-        assert(!isInterceptedSelector(moveNextSelector));
-        assert(!isInterceptedSelector(currentSelector));
-        for (Reference ref = iterator.firstRef; ref != null; ref = ref.next) {
+        assert(!isInterceptedSelector(Selectors.moveNext));
+        assert(!isInterceptedSelector(Selectors.current));
+        for (Reference ref in iterator.effectiveUses) {
           if (ref.parent is! InvokeMethod) return false;
           InvokeMethod use = ref.parent;
           if (ref != use.receiver) return false;
-          if (use.selector != moveNextSelector &&
-              use.selector != currentSelector) {
+          if (use.selector != Selectors.moveNext &&
+              use.selector != Selectors.current) {
             return false;
           }
         }
@@ -1142,10 +1355,10 @@
         MutableVariable current = new MutableVariable(new LoopItemEntity());
 
         // Rewrite all uses of the iterator.
-        while (iterator.firstRef != null) {
-          InvokeMethod use = iterator.firstRef.parent;
+        for (Reference ref in iterator.effectiveUses) {
+          InvokeMethod use = ref.parent;
           Continuation useCont = use.continuation.definition;
-          if (use.selector == currentSelector) {
+          if (use.selector == Selectors.current) {
             // Rewrite iterator.current to a use of the 'current' variable.
             Parameter result = useCont.parameters.single;
             if (result.hint != null) {
@@ -1156,7 +1369,7 @@
             LetPrim let = makeLetPrimInvoke(new GetMutable(current), useCont);
             replaceSubtree(use, let);
           } else {
-            assert (use.selector == moveNextSelector);
+            assert (use.selector == Selectors.moveNext);
             // Rewrite iterator.moveNext() to:
             //
             //   if (index < list.length) {
@@ -1231,7 +1444,7 @@
                 [cps.getMutable(index), cps.letPrim(new GetLength(list))]);
 
             // Return false if there are no more.
-            CpsFragment falseBranch = cps.ifFalse(hasMore);
+            CpsFragment falseBranch = cps.ifFalsy(hasMore);
             falseBranch
               ..setMutable(current, falseBranch.makeNull())
               ..invokeContinuation(useCont, [falseBranch.makeFalse()]);
@@ -1249,6 +1462,9 @@
           }
         }
 
+        // All effective uses have been rewritten.
+        destroyRefinementsOfDeadPrimitive(iterator);
+
         // Rewrite the iterator call to initializers for 'index' and 'current'.
         CpsFragment cps = new CpsFragment();
         cps.letMutable(index, cps.makeZero());
@@ -1266,8 +1482,6 @@
         push(invoke);
         return true;
 
-      // TODO(asgerf): Rewrite 'add', 'removeLast', ...
-
       default:
         return false;
     }
@@ -1293,7 +1507,8 @@
     while (true) {
       Node parent = node.parent;
       if (parent is LetCont ||
-          parent is LetPrim && parent.primitive.isSafeForReordering) {
+          parent is LetPrim && parent.primitive.isSafeForReordering ||
+          parent is LetPrim && parent.primitive is Refinement) {
         node = parent;
       } else {
         return parent;
@@ -1315,7 +1530,7 @@
     assert(!isInterceptedSelector(call));
     assert(call.argumentCount == node.arguments.length);
 
-    Primitive tearOff = node.receiver.definition;
+    Primitive tearOff = node.receiver.definition.effectiveDefinition;
     // Note: We don't know if [tearOff] is actually a tear-off.
     // We name variables based on the pattern we are trying to match.
 
@@ -1350,9 +1565,6 @@
 
       Continuation getterCont = tearOffInvoke.continuation.definition;
 
-      // TODO(asgerf): Support torn-off intercepted methods.
-      if (isInterceptedSelector(getter)) return false;
-
       Primitive object = tearOffInvoke.receiver.definition;
 
       // Ensure that the object actually has a foo member, since we might
@@ -1366,7 +1578,7 @@
 
       // If there are multiple uses, we cannot eliminate the getter call and
       // therefore risk duplicating its side effects.
-      if (!isPure && tearOff.hasMultipleUses) return false;
+      if (!isPure && tearOff.hasMultipleEffectiveUses) return false;
 
       // If the getter call is impure, we risk reordering side effects.
       if (!isPure && getEffectiveParent(node) != getterCont) {
@@ -1375,7 +1587,7 @@
 
       InvokeMethod invoke = new InvokeMethod.byReference(
         new Reference<Primitive>(object),
-        new Selector(SelectorKind.CALL, getter.memberName, call.callStructure),
+        new Selector.call(getter.memberName, call.callStructure),
         type,
         node.arguments,
         node.continuation,
@@ -1383,10 +1595,11 @@
       node.receiver.unlink();
       replaceSubtree(node, invoke, unlink: false);
 
-      if (tearOff.hasNoUses) {
+      if (tearOff.hasNoEffectiveUses) {
         // Eliminate the getter call if it has no more uses.
         // This cannot be delegated to other optimizations because we need to
         // avoid duplication of side effects.
+        destroyRefinementsOfDeadPrimitive(tearOff);
         getterCont.parameters.clear();
         replaceSubtree(tearOffInvoke, new InvokeContinuation(getterCont, []));
       } else {
@@ -1402,6 +1615,82 @@
     return false;
   }
 
+  void destroyRefinementsOfDeadPrimitive(Primitive prim) {
+    while (prim.firstRef != null) {
+      Refinement refine = prim.firstRef.parent;
+      destroyRefinementsOfDeadPrimitive(refine);
+      LetPrim letPrim = refine.parent;
+      InteriorNode parent = letPrim.parent;
+      parent.body = letPrim.body;
+      letPrim.body.parent = parent;
+      prim.firstRef.unlink();
+    }
+  }
+
+  /// Inlines a single-use closure if it leaves the closure object with only
+  /// field accesses.  This is optimized later by [ScalarReplacer].
+  bool specializeSingleUseClosureCall(InvokeMethod node) {
+    Selector call = node.selector;
+    if (!call.isClosureCall) return false;
+
+    assert(!isInterceptedSelector(call));
+    assert(call.argumentCount == node.arguments.length);
+
+    Primitive receiver = node.receiver.definition;
+    if (receiver is !CreateInstance) return false;
+    CreateInstance createInstance = receiver;
+    if (!createInstance.hasExactlyOneUse) return false;
+
+    // Inline only closures. This avoids inlining the 'call' method of a class
+    // that has many allocation sites.
+    if (createInstance.classElement is !ClosureClassElement) return false;
+
+    ClosureClassElement closureClassElement = createInstance.classElement;
+    Element element = closureClassElement.localLookup(Identifiers.call);
+
+    if (element == null || !element.isFunction) return false;
+    FunctionElement functionElement = element;
+    if (functionElement.asyncMarker != AsyncMarker.SYNC) return false;
+
+    if (!call.signatureApplies(functionElement)) return false;
+    // Inline only for exact match.
+    // TODO(sra): Handle call with defaulted arguments.
+    Selector targetSelector = new Selector.fromElement(functionElement);
+    if (call.callStructure != targetSelector.callStructure) return false;
+
+    // Don't inline if [target] contains try-catch or try-finally. JavaScript
+    // engines typically do poor optimization of the entire function containing
+    // the 'try'.
+    if (functionElement.resolvedAst.elements.containsTryStatement) return false;
+
+    FunctionDefinition target =
+        functionCompiler.compileToCpsIr(functionElement);
+
+    // Accesses to closed-over values are field access primitives.  We we don't
+    // inline if there are other uses of 'this' since that could be an escape or
+    // a recursive call.
+    for (Reference ref = target.thisParameter.firstRef;
+         ref != null;
+         ref = ref.next) {
+      Node use = ref.parent;
+      if (use is GetField) continue;
+      // Closures do not currently have writable fields, but closure conversion
+      // could esily be changed to allocate some cells in a closure object.
+      if (use is SetField && ref == use.object) continue;
+      return false;
+    }
+
+    node.receiver.definition.substituteFor(target.thisParameter);
+    for (int i = 0; i < node.arguments.length; ++i) {
+      node.arguments[i].definition.substituteFor(target.parameters[i]);
+    }
+    node.continuation.definition.substituteFor(target.returnContinuation);
+
+    replaceSubtree(node, target.body);
+    push(target.body);
+    return true;
+  }
+
   /// Side-effect free expressions with constant results are be replaced by:
   ///
   ///    (LetPrim p = constant (InvokeContinuation k p)).
@@ -1424,18 +1713,45 @@
     if (constifyExpression(node)) return;
     if (specializeOperatorCall(node)) return;
     if (specializeFieldAccess(node)) return;
+    if (specializeIndexableAccess(node)) return;
     if (specializeArrayAccess(node)) return;
+    if (specializeSingleUseClosureCall(node)) return;
     if (specializeClosureCall(node)) return;
 
     AbstractValue receiver = getValue(node.receiver.definition);
-    node.receiverIsNotNull = receiver.isDefinitelyNotNull;
+
+    if (node.receiverIsIntercepted &&
+        node.receiver.definition.sameValue(node.arguments[0].definition)) {
+      // The receiver and first argument are the same; that means we already
+      // determined in visitInterceptor that we are targeting a non-interceptor.
+
+      // Check if any of the possible targets depend on the extra receiver
+      // argument. Mixins do this, and tear-offs always needs the extra receiver
+      // argument because BoundClosure uses it for equality and hash code.
+      // TODO(15933): Make automatically generated property extraction
+      // closures work with the dummy receiver optimization.
+      bool needsReceiver(Element target) {
+        if (target is! FunctionElement) return false;
+        FunctionElement function = target;
+        return typeSystem.methodUsesReceiverArgument(function) ||
+               node.selector.isGetter && !function.isGetter;
+      }
+      if (!getAllTargets(receiver.type, node.selector).any(needsReceiver)) {
+        // Replace the extra receiver argument with a dummy value if the
+        // target definitely does not use it.
+        Constant dummy = makeConstantPrimitive(new IntConstantValue(0));
+        insertLetPrim(node, dummy);
+        node.arguments[0].changeTo(dummy);
+        node.receiverIsIntercepted = false;
+      }
+    }
   }
 
   void visitTypeCast(TypeCast node) {
     Continuation cont = node.continuation.definition;
 
     AbstractValue value = getValue(node.value.definition);
-    switch (lattice.isSubtypeOf(value, node.type, allowNull: true)) {
+    switch (lattice.isSubtypeOf(value, node.dartType, allowNull: true)) {
       case AbstractBool.Maybe:
       case AbstractBool.Nothing:
         break;
@@ -1464,6 +1780,19 @@
     Continuation cont = node.continuation.definition;
     Primitive arg(int n) => node.arguments[n].definition;
     AbstractValue argType(int n) => getValue(arg(n));
+
+    bool replaceWithBinary(BuiltinOperator operator,
+                           Primitive left,
+                           Primitive right) {
+      Primitive prim =
+          new ApplyBuiltinOperator(operator, <Primitive>[left, right],
+                                   node.sourceInformation);
+      LetPrim let = makeLetPrimInvoke(prim, cont);
+      replaceSubtree(node, let);
+      push(let);
+      return true; // So returning early is more convenient.
+    }
+
     if (node.target.library.isInternalLibrary) {
       switch(node.target.name) {
         case InternalMethod.Stringify:
@@ -1476,18 +1805,114 @@
           }
           break;
       }
+    } else if (node.target.library.isDartCore) {
+      switch(node.target.name) {
+        case CorelibMethod.Identical:
+          if (node.arguments.length == 2) {
+            return replaceWithBinary(BuiltinOperator.Identical, arg(0), arg(1));
+          }
+          break;
+      }
     }
     return false;
   }
 
+  /// Try to inline static invocations.
+  ///
+  /// Performs the inlining and returns true if the call was inlined.  Inlining
+  /// uses a fixed heuristic:
+  ///
+  /// * Inline functions with a single expression statement or return statement
+  /// provided that the subexpression is an invocation of foreign code.
+  bool inlineInvokeStatic(InvokeStatic node) {
+    // The target might not have an AST, for example if it deferred.
+    if (!node.target.hasNode) return false;
+
+    // True if an expression is non-expansive, in the sense defined by this
+    // predicate.
+    bool isNonExpansive(ast.Expression expr) {
+      if (expr is ast.LiteralNull ||
+          expr is ast.LiteralBool ||
+          expr is ast.LiteralInt ||
+          expr is ast.LiteralDouble) {
+        return true;
+      }
+      if (expr is ast.Send) {
+        SendStructure structure =
+            node.target.treeElements.getSendStructure(expr);
+        if (structure is InvokeStructure) {
+          // Calls to foreign functions.
+          return structure.semantics.kind == AccessKind.TOPLEVEL_METHOD &&
+              backend.isForeign(structure.semantics.element);
+        } else if (structure is IsStructure || structure is IsNotStructure) {
+          // is and is! checks on nonexpansive expressions.
+          return isNonExpansive(expr.receiver);
+        } else if (structure is EqualsStructure ||
+            structure is NotEqualsStructure) {
+          // == and != on nonexpansive expressions.
+          return isNonExpansive(expr.receiver) &&
+              isNonExpansive(expr.argumentsNode.nodes.head);
+        } else if (structure is GetStructure) {
+          // Parameters.
+          return structure.semantics.kind == AccessKind.PARAMETER;
+        }
+      }
+      return false;
+    }
+
+    ast.Statement body = node.target.node.body;
+    bool shouldInline() {
+      if (backend.annotations.noInline(node.target)) return false;
+      if (node.target.resolvedAst.elements.containsTryStatement) return false;
+
+      // Inline functions that are a single return statement, expression
+      // statement, or block containing a return statement or expression
+      // statement.
+      if (body is ast.Return) {
+        return isNonExpansive(body.expression);
+      } else if (body is ast.ExpressionStatement) {
+        return isNonExpansive(body.expression);
+      } else if (body is ast.Block) {
+        var link = body.statements.nodes;
+        if (link.isNotEmpty && link.tail.isEmpty) {
+          if (link.head is ast.Return) {
+            return isNonExpansive(link.head.expression);
+          } else if (link.head is ast.ExpressionStatement) {
+            return isNonExpansive(link.head.expression);
+          }
+        }
+      }
+      return false;
+    }
+
+    if (!shouldInline()) return false;
+
+    FunctionDefinition target = functionCompiler.compileToCpsIr(node.target);
+    for (int i = 0; i < node.arguments.length; ++i) {
+      node.arguments[i].definition.substituteFor(target.parameters[i]);
+    }
+    node.continuation.definition.substituteFor(target.returnContinuation);
+
+    replaceSubtree(node, target.body);
+    push(target.body);
+    return true;
+  }
+
   void visitInvokeStatic(InvokeStatic node) {
     if (constifyExpression(node)) return;
     if (specializeInternalMethodCall(node)) return;
+    if (inlineInvokeStatic(node)) return;
   }
 
-  AbstractValue getValue(Primitive primitive) {
-    AbstractValue value = values[primitive];
-    return value == null ? new AbstractValue.nothing() : value;
+  AbstractValue getValue(Variable node) {
+    ConstantValue constant = values[node];
+    if (constant != null) {
+      return new AbstractValue.constantValue(constant, node.type);
+    }
+    if (node.type != null) {
+      return new AbstractValue.nonConstant(node.type);
+    }
+    return lattice.nothing;
   }
 
 
@@ -1499,7 +1924,7 @@
   //
 
   void visitApplyBuiltinOperator(ApplyBuiltinOperator node) {
-    DartString getString(AbstractValue value) {
+    ast.DartString getString(AbstractValue value) {
       StringConstantValue constant = value.constant;
       return constant.primitiveValue;
     }
@@ -1515,15 +1940,16 @@
           AbstractValue secondValue = getValue(node.arguments[i++].definition);
           if (!secondValue.isConstant) continue;
 
-          DartString string =
-              new ConsDartString(getString(firstValue), getString(secondValue));
+          ast.DartString string =
+              new ast.ConsDartString(getString(firstValue),
+                                     getString(secondValue));
 
           // We found a sequence of at least two constants.
           // Look for the end of the sequence.
           while (i < node.arguments.length) {
             AbstractValue value = getValue(node.arguments[i].definition);
             if (!value.isConstant) break;
-            string = new ConsDartString(string, getString(value));
+            string = new ast.ConsDartString(string, getString(value));
             ++i;
           }
           Constant prim =
@@ -1545,15 +1971,41 @@
         break;
 
       case BuiltinOperator.Identical:
-        Primitive left = node.arguments[0].definition;
-        Primitive right = node.arguments[1].definition;
-        AbstractValue leftValue = getValue(left);
-        AbstractValue rightValue = getValue(right);
-        // Replace identical(x, true) by x when x is known to be a boolean.
-        if (lattice.isDefinitelyBool(leftValue) &&
-            rightValue.isConstant &&
-            rightValue.constant.isTrue) {
-          left.substituteFor(node);
+        Primitive leftArg = node.arguments[0].definition;
+        Primitive rightArg = node.arguments[1].definition;
+        AbstractValue left = getValue(leftArg);
+        AbstractValue right = getValue(rightArg);
+        if (lattice.isDefinitelyBool(left) &&
+            right.isConstant &&
+            right.constant.isTrue) {
+          // Replace identical(x, true) by x when x is known to be a boolean.
+          // Note that this is not safe if x is null, because the value might
+          // not be used as a condition. A rule for [IsTrue] handles that case.
+          leftArg.substituteFor(node);
+        } else if (lattice.isDefinitelyBool(right) &&
+            left.isConstant &&
+            left.constant.isTrue) {
+          rightArg.substituteFor(node);
+        } else if (left.isNullConstant || right.isNullConstant) {
+          // Use `==` for comparing against null, so JS undefined and JS null
+          // are considered equal.
+          node.operator = BuiltinOperator.LooseEq;
+        } else if (!left.isNullable || !right.isNullable) {
+          // If at most one operand can be Dart null, we can use `===`.
+          // This is not safe when we might compare JS null and JS undefined.
+          node.operator = BuiltinOperator.StrictEq;
+        } else if (lattice.isDefinitelyNum(left, allowNull: true) &&
+                   lattice.isDefinitelyNum(right, allowNull: true)) {
+          // If both operands can be null, but otherwise are of the same type,
+          // we can use `==` for comparison.
+          // This is not safe e.g. for comparing strings against numbers.
+          node.operator = BuiltinOperator.LooseEq;
+        } else if (lattice.isDefinitelyString(left, allowNull: true) &&
+                   lattice.isDefinitelyString(right, allowNull: true)) {
+          node.operator = BuiltinOperator.LooseEq;
+        } else if (lattice.isDefinitelyBool(left, allowNull: true) &&
+                   lattice.isDefinitelyBool(right, allowNull: true)) {
+          node.operator = BuiltinOperator.LooseEq;
         }
         break;
 
@@ -1561,10 +2013,57 @@
     }
   }
 
+  void visitApplyBuiltinMethod(ApplyBuiltinMethod node) {
+    if (node.method == BuiltinMethod.Push) {
+      // Convert consecutive pushes into a single push.
+      InteriorNode parent = getEffectiveParent(node.parent);
+      if (parent is LetPrim && parent.primitive is ApplyBuiltinMethod) {
+        ApplyBuiltinMethod previous = parent.primitive;
+        if (previous.method == BuiltinMethod.Push &&
+            previous.receiver.definition.sameValue(node.receiver.definition)) {
+          // We found two consecutive pushes.
+          // Move all arguments from the first push onto the second one.
+          List<Reference<Primitive>> arguments = previous.arguments;
+          for (Reference ref in arguments) {
+            ref.parent = node;
+          }
+          arguments.addAll(node.arguments);
+          node.arguments = arguments;
+          // Elimnate the old push.
+          previous.receiver.unlink();
+          assert(previous.hasNoUses);
+          parent.parent.body = parent.body;
+          parent.body.parent = parent.parent;
+        }
+      }
+    }
+  }
+
   Primitive visitTypeTest(TypeTest node) {
     Primitive prim = node.value.definition;
+
+    Primitive unaryBuiltinOperator(BuiltinOperator operator) =>
+        new ApplyBuiltinOperator(
+            operator, <Primitive>[prim], node.sourceInformation);
+
+    void unlinkInterceptor() {
+      if (node.interceptor != null) {
+        node.interceptor.unlink();
+        node.interceptor = null;
+      }
+    }
+
     AbstractValue value = getValue(prim);
-    if (node.type == dartTypes.coreTypes.intType) {
+    types.DartType dartType = node.dartType;
+
+    if (!(dartType.isInterfaceType && dartType.isRaw)) {
+      // TODO(23685): Efficient function arity check.
+      // TODO(sra): Pass interceptor to runtime subtype functions.
+      unlinkInterceptor();
+      return null;
+    }
+
+    if (dartType == dartTypes.coreTypes.intType) {
       // Compile as typeof x === 'number' && Math.floor(x) === x
       if (lattice.isDefinitelyNum(value, allowNull: true)) {
         // If value is null or a number, we can skip the typeof test.
@@ -1576,30 +2075,96 @@
       if (lattice.isDefinitelyNotNonIntegerDouble(value)) {
         // If the value cannot be a non-integer double, but might not be a
         // number at all, we can skip the Math.floor test.
-        return new ApplyBuiltinOperator(
-            BuiltinOperator.IsNumber,
-            <Primitive>[prim],
-            node.sourceInformation);
+        return unaryBuiltinOperator(BuiltinOperator.IsNumber);
       }
       return new ApplyBuiltinOperator(
           BuiltinOperator.IsNumberAndFloor,
           <Primitive>[prim, prim, prim],
           node.sourceInformation);
     }
+    if (node.dartType == dartTypes.coreTypes.numType ||
+        node.dartType == dartTypes.coreTypes.doubleType) {
+      return new ApplyBuiltinOperator(
+          BuiltinOperator.IsNumber,
+          <Primitive>[prim],
+          node.sourceInformation);
+    }
+
+    AbstractBool isNullableSubtype =
+        lattice.isSubtypeOf(value, node.dartType, allowNull: true);
+    AbstractBool isNullPassingTest =
+        lattice.isSubtypeOf(lattice.nullValue, node.dartType, allowNull: false);
+    if (isNullableSubtype == AbstractBool.True &&
+        isNullPassingTest == AbstractBool.False) {
+      // Null is the only value not satisfying the type test.
+      // Replace the type test with a null-check.
+      // This has lower priority than the 'typeof'-based tests because
+      // 'typeof' expressions might give the VM some more useful information.
+      Primitive nullConst = makeConstantPrimitive(new NullConstantValue());
+      insertLetPrim(node.parent, nullConst);
+      return new ApplyBuiltinOperator(
+          BuiltinOperator.LooseNeq,
+          <Primitive>[prim, nullConst],
+          node.sourceInformation);
+    }
+
+    if (dartType.element == functionCompiler.glue.jsFixedArrayClass) {
+      // TODO(sra): Check input is restricted to JSArray.
+      return unaryBuiltinOperator(BuiltinOperator.IsFixedLengthJSArray);
+    }
+
+    if (dartType.element == functionCompiler.glue.jsExtendableArrayClass) {
+      // TODO(sra): Check input is restricted to JSArray.
+      return unaryBuiltinOperator(BuiltinOperator.IsExtendableJSArray);
+    }
+
+    if (dartType.element == functionCompiler.glue.jsMutableArrayClass) {
+      // TODO(sra): Check input is restricted to JSArray.
+      return unaryBuiltinOperator(BuiltinOperator.IsModifiableJSArray);
+    }
+
+    if (dartType.element == functionCompiler.glue.jsUnmodifiableArrayClass) {
+      // TODO(sra): Check input is restricted to JSArray.
+      return unaryBuiltinOperator(BuiltinOperator.IsUnmodifiableJSArray);
+    }
+
+    if (dartType == dartTypes.coreTypes.stringType ||
+        dartType == dartTypes.coreTypes.boolType) {
+      // These types are recognized in tree_ir TypeOperator codegen.
+      unlinkInterceptor();
+      return null;
+    }
+
+    // TODO(sra): Propagate sourceInformation.
+    // TODO(sra): If getInterceptor(x) === x or JSNull, rewrite
+    //     getInterceptor(x).$isFoo ---> x != null && x.$isFoo
+    return new TypeTestViaFlag(node.interceptor.definition, dartType);
+  }
+
+  Primitive visitTypeTestViaFlag(TypeTestViaFlag node) {
     return null;
   }
 
-  void visitGetField(GetField node) {
-    node.objectIsNotNull = getValue(node.object.definition).isDefinitelyNotNull;
-  }
-
-  void visitGetLength(GetLength node) {
-    node.objectIsNotNull = getValue(node.object.definition).isDefinitelyNotNull;
-  }
-
-  void visitInterceptor(Interceptor node) {
-    // Filter out intercepted classes that do not match the input type.
+  Primitive visitInterceptor(Interceptor node) {
     AbstractValue value = getValue(node.input.definition);
+    // If the exact class of the input is known, replace with a constant
+    // or the input itself.
+    ClassElement singleClass;
+    if (lattice.isDefinitelyInt(value)) {
+      // Classes like JSUInt31 and JSUInt32 do not exist at runtime, so ensure
+      // all the int classes get mapped tor their runtime class.
+      singleClass = backend.jsIntClass;
+    } else if (lattice.isDefinitelyNativeList(value)) {
+      // Ensure all the array subclasses get mapped to the array class.
+      singleClass = backend.jsArrayClass;
+    } else {
+      singleClass = typeSystem.singleClass(value.type);
+    }
+    if (singleClass != null &&
+        singleClass.isSubclassOf(backend.jsInterceptorClass)) {
+      node.constantValue = new InterceptorConstantValue(singleClass.rawType);
+    }
+    // Filter out intercepted classes that do not match the input type.
     node.interceptedClasses.retainWhere((ClassElement clazz) {
       if (clazz == typeSystem.jsNullClass) {
         return value.isNullable;
@@ -1612,6 +2177,7 @@
     if (node.interceptedClasses.isEmpty) {
       node.input.definition.substituteFor(node);
     }
+    return null;
   }
 }
 
@@ -1638,10 +2204,14 @@
   final List<Definition> defWorklist = <Definition>[];
 
   final ConstantPropagationLattice lattice;
-  final dart2js.InternalErrorFunction internalError;
+  final InternalErrorFunction internalError;
 
   TypeMaskSystem get typeSystem => lattice.typeSystem;
 
+  JavaScriptBackend get backend => typeSystem.backend;
+
+  World get classWorld => typeSystem.classWorld;
+
   AbstractValue get nothing => lattice.nothing;
 
   AbstractValue nonConstant([TypeMask type]) => lattice.nonConstant(type);
@@ -1652,7 +2222,7 @@
 
   // Stores the current lattice value for primitives and mutable variables.
   // Access through [getValue] and [setValue].
-  final Map<Definition, AbstractValue> values;
+  final Map<Variable, ConstantValue> values;
 
   /// Expressions that invoke their call continuation with a constant value
   /// and without any side effects. These can be replaced by the constant.
@@ -1716,17 +2286,24 @@
   /// Returns the lattice value corresponding to [node], defaulting to nothing.
   ///
   /// Never returns null.
-  AbstractValue getValue(Definition node) {
-    AbstractValue value = values[node];
-    return (value == null) ? nothing : value;
+  AbstractValue getValue(Variable node) {
+    ConstantValue constant = values[node];
+    if (constant != null) {
+      return new AbstractValue.constantValue(constant, node.type);
+    }
+    if (node.type != null) {
+      return new AbstractValue.nonConstant(node.type);
+    }
+    return lattice.nothing;
   }
 
   /// Joins the passed lattice [updateValue] to the current value of [node],
   /// and adds it to the definition work set if it has changed and [node] is
   /// a definition.
-  void setValue(Definition node, AbstractValue updateValue) {
+  void setValue(Variable node, AbstractValue updateValue) {
     AbstractValue oldValue = getValue(node);
     AbstractValue newValue = lattice.join(oldValue, updateValue);
+    node.type = newValue.type; // Ensure type is initialized even if bottom.
     if (oldValue == newValue) {
       return;
     }
@@ -1734,19 +2311,75 @@
     // Values may only move in the direction NOTHING -> CONSTANT -> NONCONST.
     assert(newValue.kind >= oldValue.kind);
 
-    values[node] = newValue;
+    values[node] = newValue.isConstant ? newValue.constant : null;
     defWorklist.add(node);
   }
 
+  /// Updates the value of a [CallExpression]'s continuation parameter.
+  void setResult(CallExpression call,
+                 AbstractValue updateValue,
+                 {bool canReplace: false}) {
+    Continuation cont = call.continuation.definition;
+    setValue(cont.parameters.single, updateValue);
+    if (!updateValue.isNothing) {
+      setReachable(cont);
+
+      if (updateValue.isConstant && canReplace) {
+        replacements[call] = updateValue.constant;
+      } else {
+        // A replacement might have been set in a previous iteration.
+        replacements.remove(call);
+      }
+    }
+  }
+
+  bool isInterceptedSelector(Selector selector) {
+    return backend.isInterceptedSelector(selector);
+  }
+
+  Primitive getDartReceiver(InvokeMethod node) {
+    if (node.receiverIsIntercepted) {
+      return node.arguments[0].definition;
+    } else {
+      return node.receiver.definition;
+    }
+  }
+
+  Primitive getDartArgument(InvokeMethod node, int n) {
+    if (isInterceptedSelector(node.selector)) {
+      return node.arguments[n+1].definition;
+    } else {
+      return node.arguments[n].definition;
+    }
+  }
+
   // -------------------------- Visitor overrides ------------------------------
   void visit(Node node) { node.accept(this); }
 
   void visitFunctionDefinition(FunctionDefinition node) {
-    if (node.thisParameter != null) {
+    int firstActualParameter = 0;
+    if (backend.isInterceptedMethod(node.element)) {
+      if (typeSystem.methodUsesReceiverArgument(node.element)) {
+        setValue(node.thisParameter, nonConstant(typeSystem.nonNullType));
+        setValue(node.parameters[0],
+                 nonConstant(typeSystem.getReceiverType(node.element)));
+      } else {
+        setValue(node.thisParameter,
+              nonConstant(typeSystem.getReceiverType(node.element)));
+        setValue(node.parameters[0], nonConstant());
+      }
+      firstActualParameter = 1;
+    } else if (node.thisParameter != null) {
       setValue(node.thisParameter,
                nonConstant(typeSystem.getReceiverType(node.element)));
     }
-    node.parameters.forEach(visit);
+    for (Parameter param in node.parameters.skip(firstActualParameter)) {
+      // TODO(karlklose): remove reference to the element model.
+      TypeMask type = param.hint is ParameterElement
+          ? typeSystem.getParameterType(param.hint)
+          : typeSystem.dynamicType;
+      setValue(param, lattice.fromMask(type));
+    }
     push(node.body);
   }
 
@@ -1782,35 +2415,17 @@
   }
 
   void visitInvokeStatic(InvokeStatic node) {
-    Continuation cont = node.continuation.definition;
-    setReachable(cont);
-
-    assert(cont.parameters.length == 1);
-    Parameter returnValue = cont.parameters[0];
-
-    /// Sets the value of the target continuation parameter, and possibly
-    /// try to replace the whole invocation with a constant.
-    void setResult(AbstractValue updateValue, {bool canReplace: false}) {
-      setValue(returnValue, updateValue);
-      if (canReplace && updateValue.isConstant) {
-        replacements[node] = updateValue.constant;
-      } else {
-        // A previous iteration might have tried to replace this.
-        replacements.remove(node);
-      }
-    }
-
-    if (node.target.library.isInternalLibrary) {
+    if (node.target.library != null && node.target.library.isInternalLibrary) {
       switch (node.target.name) {
         case InternalMethod.Stringify:
           AbstractValue argValue = getValue(node.arguments[0].definition);
-          setResult(lattice.stringify(argValue), canReplace: true);
+          setResult(node, lattice.stringify(argValue), canReplace: true);
           return;
       }
     }
 
     TypeMask returnType = typeSystem.getReturnType(node.target);
-    setResult(nonConstant(returnType));
+    setResult(node, lattice.fromMask(returnType));
   }
 
   void visitInvokeContinuation(InvokeContinuation node) {
@@ -1820,45 +2435,29 @@
     // Forward the constant status of all continuation invokes to the
     // continuation. Note that this is effectively a phi node in SSA terms.
     for (int i = 0; i < node.arguments.length; i++) {
-      Definition def = node.arguments[i].definition;
+      Primitive def = node.arguments[i].definition;
       AbstractValue cell = getValue(def);
       setValue(cont.parameters[i], cell);
     }
   }
 
   void visitInvokeMethod(InvokeMethod node) {
-    Continuation cont = node.continuation.definition;
-    setReachable(cont);
-
-    /// Sets the value of the target continuation parameter, and possibly
-    /// try to replace the whole invocation with a constant.
-    void setResult(AbstractValue updateValue, {bool canReplace: false}) {
-      Parameter returnValue = cont.parameters[0];
-      setValue(returnValue, updateValue);
-      if (canReplace && updateValue.isConstant) {
-        replacements[node] = updateValue.constant;
-      } else {
-        // A previous iteration might have tried to replace this.
-        replacements.remove(node);
-      }
-    }
-
     AbstractValue receiver = getValue(node.receiver.definition);
+    node.receiverIsNotNull = receiver.isDefinitelyNotNull;
     if (receiver.isNothing) {
       return;  // And come back later.
     }
     if (!node.selector.isOperator) {
       // TODO(jgruber): Handle known methods on constants such as String.length.
-      setResult(lattice.getInvokeReturnType(node.selector, node.mask));
+      setResult(node, lattice.getInvokeReturnType(node.selector, node.mask));
       return;
     }
 
     // Calculate the resulting constant if possible.
-    // Operators are intercepted, so the operands are in the argument list.
     AbstractValue result;
     String opname = node.selector.name;
     if (node.arguments.length == 1) {
-      AbstractValue argument = getValue(node.arguments[0].definition);
+      AbstractValue argument = getValue(getDartReceiver(node));
       // Unary operator.
       if (opname == "unary-") {
         opname = "-";
@@ -1867,8 +2466,8 @@
       result = lattice.unaryOp(operator, argument);
     } else if (node.arguments.length == 2) {
       // Binary operator.
-      AbstractValue left = getValue(node.arguments[0].definition);
-      AbstractValue right = getValue(node.arguments[1].definition);
+      AbstractValue left = getValue(getDartReceiver(node));
+      AbstractValue right = getValue(getDartArgument(node, 0));
       BinaryOperator operator = BinaryOperator.parse(opname);
       result = lattice.binaryOp(operator, left, right);
     }
@@ -1876,16 +2475,40 @@
     // Update value of the continuation parameter. Again, this is effectively
     // a phi.
     if (result == null) {
-      setResult(lattice.getInvokeReturnType(node.selector, node.mask));
+      setResult(node, lattice.getInvokeReturnType(node.selector, node.mask));
     } else {
-      setResult(result, canReplace: true);
+      setResult(node, result, canReplace: true);
     }
   }
 
   void visitApplyBuiltinOperator(ApplyBuiltinOperator node) {
+
+    void binaryOp(
+        AbstractValue operation(AbstractValue left, AbstractValue right),
+        TypeMask defaultType) {
+      AbstractValue left = getValue(node.arguments[0].definition);
+      AbstractValue right = getValue(node.arguments[1].definition);
+      setValue(node, operation(left, right) ?? nonConstant(defaultType));
+    }
+
+    void binaryNumOp(
+        AbstractValue operation(AbstractValue left, AbstractValue right)) {
+      binaryOp(operation, typeSystem.numType);
+    }
+
+    void binaryUint32Op(
+        AbstractValue operation(AbstractValue left, AbstractValue right)) {
+      binaryOp(operation, typeSystem.uint32Type);
+    }
+
+    void binaryBoolOp(
+        AbstractValue operation(AbstractValue left, AbstractValue right)) {
+      binaryOp(operation, typeSystem.boolType);
+    }
+
     switch (node.operator) {
       case BuiltinOperator.StringConcatenate:
-        DartString stringValue = const LiteralDartString('');
+        ast.DartString stringValue = const ast.LiteralDartString('');
         for (Reference<Primitive> arg in node.arguments) {
           AbstractValue value = getValue(arg.definition);
           if (value.isNothing) {
@@ -1895,7 +2518,7 @@
                      stringValue != null) {
             StringConstantValue constant = value.constant;
             stringValue =
-                new ConsDartString(stringValue, constant.primitiveValue);
+                new ast.ConsDartString(stringValue, constant.primitiveValue);
           } else {
             stringValue = null;
             break;
@@ -1909,6 +2532,8 @@
         break;
 
       case BuiltinOperator.Identical:
+      case BuiltinOperator.StrictEq:
+      case BuiltinOperator.LooseEq:
         AbstractValue leftConst = getValue(node.arguments[0].definition);
         AbstractValue rightConst = getValue(node.arguments[1].definition);
         ConstantValue leftValue = leftConst.constant;
@@ -1930,6 +2555,7 @@
           assert(leftConst.isConstant && rightConst.isConstant);
           PrimitiveConstantValue left = leftValue;
           PrimitiveConstantValue right = rightValue;
+          // Should this be constantSystem.identity.fold(left, right)?
           ConstantValue result =
             new BoolConstantValue(left.primitiveValue == right.primitiveValue);
           setValue(node, constantValue(result, typeSystem.boolType));
@@ -1938,29 +2564,67 @@
         }
         break;
 
-      // TODO(asgerf): Implement constant propagation for builtins.
       case BuiltinOperator.NumAdd:
+        binaryNumOp(lattice.addSpecial);
+        break;
+
       case BuiltinOperator.NumSubtract:
+        binaryNumOp(lattice.subtractSpecial);
+        break;
+
       case BuiltinOperator.NumMultiply:
+        binaryNumOp(lattice.multiplySpecial);
+        break;
+
+      case BuiltinOperator.NumDivide:
+        binaryNumOp(lattice.divideSpecial);
+        break;
+
+      case BuiltinOperator.NumRemainder:
+        binaryNumOp(lattice.remainderSpecial);
+        break;
+
+      case BuiltinOperator.NumTruncatingDivideToSigned32:
+        binaryNumOp(lattice.truncatingDivideSpecial);
+        break;
+
       case BuiltinOperator.NumAnd:
+        binaryUint32Op(lattice.andSpecial);
+        break;
+
       case BuiltinOperator.NumOr:
+        binaryUint32Op(lattice.orSpecial);
+        break;
+
       case BuiltinOperator.NumXor:
-        AbstractValue left = getValue(node.arguments[0].definition);
-        AbstractValue right = getValue(node.arguments[1].definition);
-        if (lattice.isDefinitelyInt(left) && lattice.isDefinitelyInt(right)) {
-          setValue(node, nonConstant(typeSystem.intType));
-        } else {
-          setValue(node, nonConstant(typeSystem.numType));
-        }
+        binaryUint32Op(lattice.xorSpecial);
+        break;
+
+      case BuiltinOperator.NumShl:
+        binaryUint32Op(lattice.shiftLeftSpecial);
+        break;
+
+      case BuiltinOperator.NumShr:
+        binaryUint32Op(lattice.shiftRightSpecial);
         break;
 
       case BuiltinOperator.NumLt:
+        binaryBoolOp(lattice.lessSpecial);
+        break;
+
       case BuiltinOperator.NumLe:
+        binaryBoolOp(lattice.lessEqualSpecial);
+        break;
+
       case BuiltinOperator.NumGt:
+        binaryBoolOp(lattice.greaterSpecial);
+        break;
+
       case BuiltinOperator.NumGe:
-      case BuiltinOperator.StrictEq:
+        binaryBoolOp(lattice.greaterEqualSpecial);
+        break;
+
       case BuiltinOperator.StrictNeq:
-      case BuiltinOperator.LooseEq:
       case BuiltinOperator.LooseNeq:
       case BuiltinOperator.IsFalsy:
       case BuiltinOperator.IsNumber:
@@ -1969,26 +2633,33 @@
       case BuiltinOperator.IsNumberAndFloor:
         setValue(node, nonConstant(typeSystem.boolType));
         break;
+
+      case BuiltinOperator.IsFixedLengthJSArray:
+      case BuiltinOperator.IsExtendableJSArray:
+      case BuiltinOperator.IsUnmodifiableJSArray:
+      case BuiltinOperator.IsModifiableJSArray:
+        setValue(node, nonConstant(typeSystem.boolType));
+        break;
+    }
+  }
+
+  void visitApplyBuiltinMethod(ApplyBuiltinMethod node) {
+    AbstractValue receiver = getValue(node.receiver.definition);
+    if (node.method == BuiltinMethod.Pop) {
+      setValue(node, nonConstant(
+          typeSystem.elementTypeOfIndexable(receiver.type)));
+    } else {
+      setValue(node, nonConstant());
     }
   }
 
   void visitInvokeMethodDirectly(InvokeMethodDirectly node) {
-    Continuation cont = node.continuation.definition;
-    setReachable(cont);
-
-    assert(cont.parameters.length == 1);
-    Parameter returnValue = cont.parameters[0];
     // TODO(karlklose): lookup the function and get ites return type.
-    setValue(returnValue, nonConstant());
+    setResult(node, nonConstant());
   }
 
   void visitInvokeConstructor(InvokeConstructor node) {
-    Continuation cont = node.continuation.definition;
-    setReachable(cont);
-
-    assert(cont.parameters.length == 1);
-    Parameter returnValue = cont.parameters[0];
-    setValue(returnValue, nonConstant(typeSystem.getReturnType(node.target)));
+    setResult(node, nonConstant(typeSystem.getReturnType(node.target)));
   }
 
   void visitThrow(Throw node) {
@@ -2001,32 +2672,42 @@
   }
 
   void visitBranch(Branch node) {
-    IsTrue isTrue = node.condition;
-    AbstractValue conditionCell = getValue(isTrue.value.definition);
-
-    if (conditionCell.isNothing) {
-      return;  // And come back later.
-    } else if (conditionCell.isNonConst) {
-      setReachable(node.trueContinuation.definition);
-      setReachable(node.falseContinuation.definition);
-    } else if (conditionCell.isConstant && !conditionCell.constant.isBool) {
-      // Treat non-bool constants in condition as non-const since they result
-      // in type errors in checked mode.
-      // TODO(jgruber): Default to false in unchecked mode.
-      setReachable(node.trueContinuation.definition);
-      setReachable(node.falseContinuation.definition);
-      setValue(isTrue.value.definition, nonConstant(typeSystem.boolType));
-    } else if (conditionCell.isConstant && conditionCell.constant.isBool) {
-      BoolConstantValue boolConstant = conditionCell.constant;
-      setReachable((boolConstant.isTrue) ?
-          node.trueContinuation.definition : node.falseContinuation.definition);
+    AbstractValue conditionCell = getValue(node.condition.definition);
+    AbstractBool boolifiedValue = node.isStrictCheck
+        ? lattice.strictBoolify(conditionCell)
+        : lattice.boolify(conditionCell);
+    switch (boolifiedValue) {
+      case AbstractBool.Nothing:
+        break;
+      case AbstractBool.True:
+        setReachable(node.trueContinuation.definition);
+        break;
+      case AbstractBool.False:
+        setReachable(node.falseContinuation.definition);
+        break;
+      case AbstractBool.Maybe:
+        setReachable(node.trueContinuation.definition);
+        setReachable(node.falseContinuation.definition);
+        break;
     }
   }
 
   void visitTypeTest(TypeTest node) {
-    AbstractValue input = getValue(node.value.definition);
+    handleTypeTest(node, getValue(node.value.definition), node.dartType);
+  }
+
+  void visitTypeTestViaFlag(TypeTestViaFlag node) {
+    // TODO(sra): We could see if we can find the value in the interceptor
+    // expression. It would probably have no benefit - we only see
+    // TypeTestViaFlag after rewriting TypeTest and the rewrite of TypeTest
+    // would already have done the interesting optimizations.
+    setValue(node, nonConstant(typeSystem.boolType));
+  }
+
+  void handleTypeTest(
+      Primitive node, AbstractValue input, types.DartType dartType) {
     TypeMask boolType = typeSystem.boolType;
-    switch(lattice.isSubtypeOf(input, node.type, allowNull: false)) {
+    switch(lattice.isSubtypeOf(input, dartType, allowNull: false)) {
       case AbstractBool.Nothing:
         break; // And come back later.
 
@@ -2047,7 +2728,7 @@
   void visitTypeCast(TypeCast node) {
     Continuation cont = node.continuation.definition;
     AbstractValue input = getValue(node.value.definition);
-    switch (lattice.isSubtypeOf(input, node.type, allowNull: true)) {
+    switch (lattice.isSubtypeOf(input, node.dartType, allowNull: true)) {
       case AbstractBool.Nothing:
         break; // And come back later.
 
@@ -2060,9 +2741,12 @@
         break; // Cast fails. Continuation should remain unreachable.
 
       case AbstractBool.Maybe:
-        // TODO(asgerf): Narrow type of output to those that survive the cast.
         setReachable(cont);
-        setValue(cont.parameters.single, input);
+        // Narrow type of output to those that survive the cast.
+        TypeMask type = input.type.intersection(
+            typeSystem.subtypesOf(node.dartType),
+            classWorld);
+        setValue(cont.parameters.single, nonConstant(type));
         break;
     }
   }
@@ -2074,7 +2758,7 @@
   void visitLiteralList(LiteralList node) {
     // Constant lists are translated into (Constant ListConstant(...)) IR nodes,
     // and thus LiteralList nodes are NonConst.
-    setValue(node, nonConstant(typeSystem.mutableNativeListType));
+    setValue(node, nonConstant(typeSystem.extendableNativeListType));
   }
 
   void visitLiteralMap(LiteralMap node) {
@@ -2102,39 +2786,9 @@
   }
 
   void visitMutableVariable(MutableVariable node) {
-    // [MutableVariable]s are bound either as parameters to
-    // [FunctionDefinition]s, by [LetMutable].
-    if (node.parent is FunctionDefinition) {
-      // Just like immutable parameters, the values of mutable parameters are
-      // never constant.
-      // TODO(karlklose): remove reference to the element model.
-      Entity source = node.hint;
-      TypeMask type = (source is ParameterElement)
-          ? typeSystem.getParameterType(source)
-          : typeSystem.dynamicType;
-      setValue(node, nonConstant(type));
-    } else if (node.parent is LetMutable) {
-      // Mutable values bound by LetMutable could have known values.
-    } else {
-      internalError(node.hint, "Unexpected parent of MutableVariable");
-    }
   }
 
   void visitParameter(Parameter node) {
-    Entity source = node.hint;
-    // TODO(karlklose): remove reference to the element model.
-    TypeMask type = (source is ParameterElement)
-        ? typeSystem.getParameterType(source)
-        : typeSystem.dynamicType;
-    if (node.parent is FunctionDefinition) {
-      // Functions may escape and thus their parameters must be non-constant.
-      setValue(node, nonConstant(type));
-    } else if (node.parent is Continuation) {
-      // Continuations on the other hand are local, and parameters can have
-      // some other abstract value than non-constant.
-    } else {
-      internalError(node.hint, "Unexpected parent of Parameter: ${node.parent}");
-    }
   }
 
   void visitContinuation(Continuation node) {
@@ -2156,28 +2810,28 @@
   void visitSetStatic(SetStatic node) {}
 
   void visitGetLazyStatic(GetLazyStatic node) {
-    Continuation cont = node.continuation.definition;
-    setReachable(cont);
-
-    assert(cont.parameters.length == 1);
-    Parameter returnValue = cont.parameters[0];
-    setValue(returnValue, nonConstant(typeSystem.getFieldType(node.element)));
-  }
-
-  void visitIsTrue(IsTrue node) {
-    Branch branch = node.parent;
-    visitBranch(branch);
+    setResult(node, nonConstant(typeSystem.getFieldType(node.element)));
   }
 
   void visitInterceptor(Interceptor node) {
     push(node.input.definition);
     AbstractValue value = getValue(node.input.definition);
-    if (!value.isNothing) {
+    if (value.isNothing) {
+      setValue(node, nothing);
+    } else if (value.isNullable &&
+        !node.interceptedClasses.contains(backend.jsNullClass)) {
+      // If the input is null and null is not mapped to an interceptor then
+      // null gets returned.
+      // TODO(asgerf): Add the NullInterceptor when it enables us to
+      //               propagate an assignment.
+      setValue(node, nonConstant());
+    } else {
       setValue(node, nonConstant(typeSystem.nonNullType));
     }
   }
 
   void visitGetField(GetField node) {
+    node.objectIsNotNull = getValue(node.object.definition).isDefinitelyNotNull;
     setValue(node, nonConstant(typeSystem.getFieldType(node.field)));
   }
 
@@ -2202,7 +2856,7 @@
   }
 
   @override
-  visitTypeExpression(TypeExpression node) {
+  void visitTypeExpression(TypeExpression node) {
     // TODO(karlklose): come up with a type marker for JS entities or switch to
     // real constants of type [Type].
     setValue(node, nonConstant());
@@ -2214,31 +2868,60 @@
   }
 
   @override
-  visitForeignCode(ForeignCode node) {
+  void visitForeignCode(ForeignCode node) {
     if (node.continuation != null) {
-      Continuation continuation = node.continuation.definition;
-      setReachable(continuation);
-
-      assert(continuation.parameters.length == 1);
-      Parameter returnValue = continuation.parameters.first;
-      setValue(returnValue, nonConstant(node.type));
+      setResult(node, nonConstant(node.type));
     }
   }
 
   @override
   void visitGetLength(GetLength node) {
-    setValue(node, nonConstant(typeSystem.intType));
+    AbstractValue input = getValue(node.object.definition);
+    node.objectIsNotNull = getValue(node.object.definition).isDefinitelyNotNull;
+    int length = typeSystem.getContainerLength(input.type);
+    if (length != null) {
+      // TODO(asgerf): Constant-folding the length might degrade the VM's
+      // own bounds-check elimination?
+      setValue(node, constantValue(new IntConstantValue(length)));
+    } else {
+      setValue(node, nonConstant(typeSystem.intType));
+    }
   }
 
   @override
   void visitGetIndex(GetIndex node) {
-    setValue(node, nonConstant());
+    AbstractValue input = getValue(node.object.definition);
+    setValue(node, nonConstant(typeSystem.elementTypeOfIndexable(input.type)));
   }
 
   @override
   void visitSetIndex(SetIndex node) {
     setValue(node, nonConstant());
   }
+
+  @override
+  void visitAwait(Await node) {
+    setResult(node, nonConstant());
+  }
+
+  @override
+  visitYield(Yield node) {
+    setReachable(node.continuation.definition);
+  }
+
+  @override
+  void visitRefinement(Refinement node) {
+    AbstractValue value = getValue(node.value.definition);
+    if (value.isNothing ||
+        typeSystem.areDisjoint(value.type, node.refineType)) {
+      setValue(node, nothing);
+    } else if (value.isConstant) {
+      setValue(node, value);
+    } else {
+      setValue(node,
+          nonConstant(value.type.intersection(node.refineType, classWorld)));
+    }
+  }
 }
 
 /// Represents the abstract value of a primitive value at some point in the
@@ -2285,6 +2968,7 @@
   bool get isConstant => (kind == CONSTANT);
   bool get isNonConst => (kind == NONCONST);
   bool get isNullConstant => kind == CONSTANT && constant.isNull;
+  bool get isTrueConstant => kind == CONSTANT && constant.isTrue;
 
   bool get isNullable => kind != NOTHING && type.isNullable;
   bool get isDefinitelyNotNull => kind == NOTHING || !type.isNullable;
@@ -2316,6 +3000,11 @@
   static const String Stringify = 'S';
 }
 
+/// Enum-like class with the names of dart:core methods we care about.
+abstract class CorelibMethod {
+  static const String Identical = 'identical';
+}
+
 /// Suggested name for a synthesized loop index.
 class LoopIndexEntity extends Entity {
   String get name => 'i';
@@ -2332,9 +3021,9 @@
   String get name => 'length';
 }
 
-class ResetAnalysisInfo extends RecursiveVisitor {
+class ResetAnalysisInfo extends TrampolineRecursiveVisitor {
   Set<Continuation> reachableContinuations;
-  Map<Definition, AbstractValue> values;
+  Map<Variable, ConstantValue> values;
 
   ResetAnalysisInfo(this.reachableContinuations, this.values);
 
@@ -2344,10 +3033,12 @@
   }
 
   processLetPrim(LetPrim node) {
-    values.remove(node.primitive);
+    node.primitive.type = null;
+    values[node.primitive] = null;
   }
 
   processLetMutable(LetMutable node) {
-    values.remove(node.variable);
+    node.variable.type = null;
+    values[node.variable] = null;
   }
 }
diff --git a/pkg/compiler/lib/src/dart2js.dart b/pkg/compiler/lib/src/dart2js.dart
index a2f98b7..fa7aeb7 100644
--- a/pkg/compiler/lib/src/dart2js.dart
+++ b/pkg/compiler/lib/src/dart2js.dart
@@ -12,13 +12,13 @@
          stdin, stderr;
 
 import '../compiler.dart' as api;
+import 'commandline_options.dart';
 import 'io/source_file.dart';
 import 'source_file_provider.dart';
 import 'filenames.dart';
 import 'util/uri_extras.dart';
 import 'util/util.dart' show stackTraceFilePrefix;
 import 'util/command_line.dart';
-import 'package:sdk_library_metadata/libraries.dart';
 import 'package:package_config/discovery.dart' show findPackages;
 
 const String LIBRARY_ROOT = '../../../../../sdk';
@@ -245,21 +245,13 @@
 
   setCategories(String argument) {
     List<String> categories = extractParameter(argument).split(',');
-    Set<String> allowedCategories =
-        LIBRARIES.values.map((x) => x.category).toSet();
-    allowedCategories.remove('Shared');
-    allowedCategories.remove('Internal');
-    List<String> allowedCategoriesList =
-        new List<String>.from(allowedCategories);
-    allowedCategoriesList.sort();
     if (categories.contains('all')) {
-      categories = allowedCategoriesList;
+      categories = ["Client", "Server"];
     } else {
-      String allowedCategoriesString = allowedCategoriesList.join(', ');
       for (String category in categories) {
-        if (!allowedCategories.contains(category)) {
+        if (!["Client", "Server"].contains(category)) {
           fail('Unsupported library category "$category", '
-               'supported categories are: $allowedCategoriesString');
+               'supported categories are: Client, Server, all');
         }
       }
     }
@@ -286,10 +278,10 @@
           wantHelp = true;
           break;
         case 'c':
-          setCheckedMode('--enable-checked-mode');
+          setCheckedMode(Flags.enableCheckedMode);
           break;
         case 'm':
-          implyCompilation('--minify');
+          implyCompilation(Flags.minify);
           break;
         default:
           throw 'Internal error: "$shortOption" did not match';
@@ -301,60 +293,58 @@
   List<OptionHandler> handlers = <OptionHandler>[
     new OptionHandler('-[chvm?]+', handleShortOptions),
     new OptionHandler('--throw-on-error(?:=[0-9]+)?', handleThrowOnError),
-    new OptionHandler('--suppress-warnings', (_) {
+    new OptionHandler(Flags.suppressWarnings, (_) {
       diagnosticHandler.showWarnings = false;
-      passThrough('--suppress-warnings');
+      passThrough(Flags.suppressWarnings);
     }),
-    new OptionHandler('--fatal-warnings', passThrough),
-    new OptionHandler('--suppress-hints',
+    new OptionHandler(Flags.fatalWarnings, passThrough),
+    new OptionHandler(Flags.suppressHints,
                       (_) => diagnosticHandler.showHints = false),
     new OptionHandler(
         '--output-type=dart|--output-type=dart-multi|--output-type=js',
         setOutputType),
-    new OptionHandler('--use-cps-ir', passThrough),
-    new OptionHandler('--no-frequency-based-minification', passThrough),
-    new OptionHandler('--verbose', setVerbose),
-    new OptionHandler('--version', (_) => wantVersion = true),
+    new OptionHandler(Flags.useCpsIr, passThrough),
+    new OptionHandler(Flags.noFrequencyBasedMinification, passThrough),
+    new OptionHandler(Flags.verbose, setVerbose),
+    new OptionHandler(Flags.version, (_) => wantVersion = true),
     new OptionHandler('--library-root=.+', setLibraryRoot),
     new OptionHandler('--out=.+|-o.*', setOutput, multipleArguments: true),
-    new OptionHandler('--allow-mock-compilation', passThrough),
-    new OptionHandler('--fast-startup', passThrough),
-    new OptionHandler('--minify|-m', implyCompilation),
-    new OptionHandler('--preserve-uris', passThrough),
+    new OptionHandler(Flags.allowMockCompilation, passThrough),
+    new OptionHandler(Flags.fastStartup, passThrough),
+    new OptionHandler('${Flags.minify}|-m', implyCompilation),
+    new OptionHandler(Flags.preserveUris, passThrough),
     new OptionHandler('--force-strip=.*', setStrip),
-    new OptionHandler('--disable-diagnostic-colors',
+    new OptionHandler(Flags.disableDiagnosticColors,
                       (_) => diagnosticHandler.enableColors = false),
-    new OptionHandler('--enable-diagnostic-colors',
+    new OptionHandler(Flags.enableDiagnosticColors,
                       (_) => diagnosticHandler.enableColors = true),
     new OptionHandler('--enable[_-]checked[_-]mode|--checked',
-                      (_) => setCheckedMode('--enable-checked-mode')),
-    new OptionHandler('--enable-concrete-type-inference',
-                      (_) => implyCompilation(
-                          '--enable-concrete-type-inference')),
-    new OptionHandler('--trust-type-annotations',
+                      (_) => setCheckedMode(Flags.enableCheckedMode)),
+    new OptionHandler(Flags.trustTypeAnnotations,
                       (_) => setTrustTypeAnnotations(
-                          '--trust-type-annotations')),
-    new OptionHandler('--trust-primitives',
+                          Flags.trustTypeAnnotations)),
+    new OptionHandler(Flags.trustPrimitives,
                       (_) => setTrustPrimitives(
-                          '--trust-primitives')),
+                          Flags.trustPrimitives)),
     new OptionHandler(r'--help|/\?|/h', (_) => wantHelp = true),
     new OptionHandler('--packages=.+', setPackageConfig),
     new OptionHandler('--package-root=.+|-p.+', setPackageRoot),
-    new OptionHandler('--analyze-all', setAnalyzeAll),
-    new OptionHandler('--analyze-only', setAnalyzeOnly),
-    new OptionHandler('--no-source-maps', passThrough),
-    new OptionHandler('--analyze-signatures-only', setAnalyzeOnly),
-    new OptionHandler('--disable-native-live-type-analysis', passThrough),
+    new OptionHandler(Flags.analyzeAll, setAnalyzeAll),
+    new OptionHandler(Flags.analyzeOnly, setAnalyzeOnly),
+    new OptionHandler(Flags.noSourceMaps, passThrough),
+    new OptionHandler(Flags.analyzeSignaturesOnly, setAnalyzeOnly),
+    new OptionHandler(Flags.disableNativeLiveTypeAnalysis, passThrough),
     new OptionHandler('--categories=.*', setCategories),
-    new OptionHandler('--disable-type-inference', implyCompilation),
-    new OptionHandler('--terse', passThrough),
+    new OptionHandler(Flags.disableTypeInference, implyCompilation),
+    new OptionHandler(Flags.terse, passThrough),
     new OptionHandler('--deferred-map=.+', implyCompilation),
-    new OptionHandler('--dump-info', setDumpInfo),
+    new OptionHandler(Flags.dumpInfo, setDumpInfo),
     new OptionHandler('--disallow-unsafe-eval',
                       (_) => hasDisallowUnsafeEval = true),
-    new OptionHandler('--show-package-warnings', passThrough),
-    new OptionHandler('--csp', passThrough),
-    new OptionHandler('--enable-experimental-mirrors', passThrough),
+    new OptionHandler(Flags.showPackageWarnings, passThrough),
+    new OptionHandler(Flags.useContentSecurityPolicy, passThrough),
+    new OptionHandler(Flags.enableExperimentalMirrors, passThrough),
+    new OptionHandler(Flags.enableAssertMessage, passThrough),
     new OptionHandler('--enable-async', (_) {
       diagnosticHandler.info(
           "Option '--enable-async' is no longer needed. "
@@ -373,9 +363,9 @@
           "Enums are supported by default.",
           api.Diagnostic.HINT);
     }),
-    new OptionHandler('--allow-native-extensions', setAllowNativeExtensions),
-    new OptionHandler('--generate-code-with-compile-time-errors', passThrough),
-    new OptionHandler('--test-mode', passThrough),
+    new OptionHandler(Flags.allowNativeExtensions, setAllowNativeExtensions),
+    new OptionHandler(Flags.generateCodeWithCompileTimeErrors, passThrough),
+    new OptionHandler(Flags.testMode, passThrough),
 
     // The following three options must come last.
     new OptionHandler('-D.+=.*', addInEnvironment),
@@ -415,7 +405,7 @@
   }
 
   if (checkedMode && trustTypeAnnotations) {
-    helpAndFail("Option '--trust-type-annotations' may not be used in "
+    helpAndFail("Option '${Flags.trustTypeAnnotations}' may not be used in "
                 "checked mode.");
   }
 
@@ -426,23 +416,23 @@
   if ((analyzeOnly || analyzeAll) && !optionsImplyCompilation.isEmpty) {
     if (!analyzeOnly) {
       diagnosticHandler.info(
-          "Option '--analyze-all' implies '--analyze-only'.",
+          "Option '${Flags.analyzeAll}' implies '${Flags.analyzeOnly}'.",
           api.Diagnostic.INFO);
     }
     diagnosticHandler.info(
         "Options $optionsImplyCompilation indicate that output is expected, "
-        "but compilation is turned off by the option '--analyze-only'.",
+        "but compilation is turned off by the option '${Flags.analyzeOnly}'.",
         api.Diagnostic.INFO);
   }
   if (analyzeAll) analyzeOnly = true;
   if (!analyzeOnly) {
     if (allowNativeExtensions) {
-      helpAndFail("Option '--allow-native-extensions' is only supported in "
-                  "combination with the '--analyze-only' option.");
+      helpAndFail("Option '${Flags.allowNativeExtensions}' is only supported "
+                  "in combination with the '${Flags.analyzeOnly}' option.");
     }
   }
   if (dumpInfo && outputLanguage == OUTPUT_LANGUAGE_DART) {
-    helpAndFail("Option '--dump-info' is not supported in "
+    helpAndFail("Option '${Flags.dumpInfo}' is not supported in "
                 "combination with the '--output-type=dart' option.");
   }
 
diff --git a/pkg/compiler/lib/src/dart2jslib.dart b/pkg/compiler/lib/src/dart2jslib.dart
deleted file mode 100644
index e5c924d..0000000
--- a/pkg/compiler/lib/src/dart2jslib.dart
+++ /dev/null
@@ -1,89 +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;
-
-import 'dart:async';
-import 'dart:collection' show Queue;
-import 'dart:profiler' show
-    UserTag;
-
-import '../compiler_new.dart' as api;
-import 'cache_strategy.dart';
-import 'closure.dart' as closureMapping;
-import 'compile_time_constants.dart';
-import 'constants/constant_system.dart';
-import 'constants/expressions.dart';
-import 'constants/values.dart';
-import 'core_types.dart';
-import 'cps_ir/cps_ir_builder_task.dart' show IrBuilderTask;
-import 'dart_backend/dart_backend.dart' as dart_backend;
-import 'dart_types.dart';
-import 'deferred_load.dart' show DeferredLoadTask, OutputUnit;
-import 'dump_info.dart';
-import 'elements/elements.dart';
-import 'elements/modelx.dart'
-    show ErroneousElementX,
-         ClassElementX,
-         CompilationUnitElementX,
-         MethodElementX,
-         LibraryElementX,
-         PrefixElementX,
-         VoidElementX,
-         AnalyzableElement,
-         DeferredLoaderGetterElementX;
-import 'helpers/helpers.dart';  // Included for debug helpers.
-import 'io/code_output.dart' show CodeBuffer;
-import 'io/source_information.dart';
-import 'js/js.dart' as js;
-import 'js_backend/js_backend.dart' as js_backend;
-import 'library_loader.dart'
-    show LibraryLoader,
-         LibraryLoaderTask,
-         LoadedLibraries;
-import 'mirrors_used.dart' show MirrorUsageAnalyzerTask;
-import 'null_compiler_output.dart';
-import 'native/native.dart' as native;
-import 'ordered_typeset.dart';
-import 'patch_parser.dart';
-import 'resolution/class_members.dart' show MembersCreator;
-import 'resolution/resolution.dart';
-import 'resolution/semantic_visitor.dart';
-import 'resolution/send_structure.dart';
-import 'resolution/operators.dart' as op;
-import 'scanner/scannerlib.dart';
-import 'serialization/task.dart';
-import 'ssa/ssa.dart';
-import 'io/source_file.dart' show SourceFile;
-import 'tracer.dart' show Tracer;
-import 'tree/tree.dart';
-import 'types/types.dart' as ti;
-import 'universe/universe.dart';
-import 'universe/class_set.dart';
-import 'util/characters.dart' show $_;
-import 'util/uri_extras.dart' as uri_extras show relativize;
-import 'util/util.dart';
-import 'warnings.dart';
-
-export 'helpers/helpers.dart';
-export 'resolution/resolution.dart' show TreeElements, TreeElementMapping;
-export 'scanner/scannerlib.dart' show isUserDefinableOperator,
-                                      isUnaryOperator,
-                                      isBinaryOperator,
-                                      isTernaryOperator,
-                                      isMinusOperator;
-export 'universe/universe.dart' show CallStructure, Selector, TypedSelector;
-export 'util/util.dart'
-    show Spannable,
-         CURRENT_ELEMENT_SPANNABLE,
-         NO_LOCATION_SPANNABLE;
-export 'warnings.dart';
-
-part 'compiler.dart';
-part 'diagnostic_listener.dart';
-part 'enqueue.dart';
-part 'resolved_visitor.dart';
-part 'script.dart';
-part 'typechecker.dart';
-part 'world.dart';
diff --git a/pkg/compiler/lib/src/dart_backend/backend.dart b/pkg/compiler/lib/src/dart_backend/backend.dart
index 22b7e1e..5001b54 100644
--- a/pkg/compiler/lib/src/dart_backend/backend.dart
+++ b/pkg/compiler/lib/src/dart_backend/backend.dart
@@ -52,7 +52,8 @@
       new Set<ClassElement>();
 
   bool enableCodegenWithErrorsIfSupported(Spannable node) {
-    compiler.reportHint(node,
+    reporter.reportHintMessage(
+        node,
         MessageKind.GENERIC,
         {'text': "Generation of code with compile time errors is not "
                  "supported for dart2dart."});
@@ -107,7 +108,7 @@
         stripAsserts = strips.indexOf('asserts') != -1,
         constantCompilerTask = new DartConstantTask(compiler),
         outputter = new DartOutputter(
-            compiler, compiler.outputProvider,
+            compiler.reporter, compiler.outputProvider,
             forceStripTypes: strips.indexOf('types') != -1,
             multiFile: multiFile,
             enableMinification: compiler.enableMinification),
@@ -115,6 +116,11 @@
     resolutionCallbacks = new DartResolutionCallbacks(this);
   }
 
+
+  DiagnosticReporter get reporter => compiler.reporter;
+
+  Resolution get resolution => compiler.resolution;
+
   bool classNeedsRti(ClassElement cls) => false;
   bool methodNeedsRti(FunctionElement function) => false;
 
@@ -127,18 +133,17 @@
     final coreLibrary = compiler.coreLibrary;
     for (final name in LITERAL_TYPE_NAMES) {
       ClassElement classElement = coreLibrary.findLocal(name);
-      classElement.ensureResolved(compiler);
+      classElement.ensureResolved(resolution);
     }
     // Enqueue the methods that the VM might invoke on user objects because
     // we don't trust the resolution to always get these included.
-    world.registerInvocation(
-        new UniverseSelector(new Selector.call("toString", null, 0), null));
+    world.registerInvocation(new UniverseSelector(Selectors.toString_, null));
     world.registerInvokedGetter(
-        new UniverseSelector(new Selector.getter("hashCode", null), null));
+        new UniverseSelector(Selectors.hashCode_, null));
     world.registerInvocation(
-        new UniverseSelector(new Selector.binaryOperator("=="), null));
+        new UniverseSelector(new Selector.binaryOperator('=='), null));
     world.registerInvocation(
-        new UniverseSelector(new Selector.call("compareTo", null, 1), null));
+        new UniverseSelector(Selectors.compareTo, null));
   }
 
   WorldImpact codegen(CodegenWorkItem work) => const WorldImpact();
@@ -167,7 +172,7 @@
         newTypedefElementCallback,
         newClassElementCallback) {
       ReferencedElementCollector collector =
-          new ReferencedElementCollector(compiler,
+          new ReferencedElementCollector(reporter,
                                          element,
                                          elementAst,
                                          newTypedefElementCallback,
@@ -178,7 +183,7 @@
     int totalSize = outputter.assembleProgram(
         libraries: compiler.libraryLoader.libraries,
         instantiatedClasses: compiler.resolverWorld.directlyInstantiatedClasses,
-        resolvedElements: compiler.enqueuer.resolution.resolvedElements,
+        resolvedElements: compiler.enqueuer.resolution.processedElements,
         usedTypeLiterals: usedTypeLiterals,
         postProcessElementAst: postProcessElementAst,
         computeElementAst: computeElementAst,
@@ -214,7 +219,7 @@
         'Output total size: $totalOutputSize bytes (${percentage}%)');
   }
 
-  log(String message) => compiler.log('[DartBackend] $message');
+  log(String message) => reporter.log('[DartBackend] $message');
 
   @override
   Future onLibrariesLoaded(LoadedLibraries loadedLibraries) {
@@ -225,16 +230,16 @@
         library.forEachLocalMember((Element element) {
           if (element.isClass) {
             ClassElement classElement = element;
-            classElement.ensureResolved(compiler);
+            classElement.ensureResolved(resolution);
           }
         });
       }
     });
     if (useMirrorHelperLibrary &&
-        loadedLibraries.containsLibrary(Compiler.DART_MIRRORS)) {
+        loadedLibraries.containsLibrary(Uris.dart_mirrors)) {
       return compiler.libraryLoader.loadLibrary(
           compiler.translateResolvedUri(
-              loadedLibraries.getLibrary(Compiler.DART_MIRRORS),
+              loadedLibraries.getLibrary(Uris.dart_mirrors),
               MirrorRenamerImpl.DART_MIRROR_HELPER, null)).
           then((LibraryElement library) {
         mirrorRenamer = new MirrorRenamerImpl(compiler, this, library);
@@ -254,7 +259,26 @@
   }
 
   @override
-  void registerInstantiatedType(InterfaceType type, Registry registry) {
+  void registerInstantiatedType(InterfaceType type,
+                                Enqueuer enqueuer,
+                                Registry registry,
+                                {bool mirrorUsage: false}) {
+    registerPlatformMembers(type,
+        registerGetter: registry.registerDynamicGetter,
+        registerSetter: registry.registerDynamicSetter,
+        registerInvocation: registry.registerDynamicInvocation);
+    super.registerInstantiatedType(
+        type, enqueuer, registry, mirrorUsage: mirrorUsage);
+  }
+
+  /// Register dynamic access of members of [type] that implement members
+  /// of types defined in the platform libraries.
+  void registerPlatformMembers(
+      InterfaceType type,
+      {void registerGetter(UniverseSelector selector),
+       void registerSetter(UniverseSelector selector),
+       void registerInvocation(UniverseSelector selector)}) {
+
     // Without patching, dart2dart has no way of performing sound tree-shaking
     // in face external functions. Therefore we employ another scheme:
     //
@@ -303,16 +327,16 @@
               if (element.isConstructor || element.isStatic) return;
 
               FunctionElement function = element.asFunctionElement();
-              element.computeType(compiler);
+              element.computeType(resolution);
               Selector selector = new Selector.fromElement(element);
               if (selector.isGetter) {
-                registry.registerDynamicGetter(
+                registerGetter(
                     new UniverseSelector(selector, null));
               } else if (selector.isSetter) {
-                registry.registerDynamicSetter(
+                registerSetter(
                     new UniverseSelector(selector, null));
               } else {
-                registry.registerDynamicInvocation(
+                registerInvocation(
                     new UniverseSelector(selector, null));
               }
             });
@@ -320,13 +344,13 @@
         }
       }
     }
-
   }
 
   @override
   bool enableDeferredLoadingIfSupported(Spannable node, Registry registry) {
     // TODO(sigurdm): Implement deferred loading for dart2dart.
-    compiler.reportWarning(node, MessageKind.DEFERRED_LIBRARY_DART_2_DART);
+    reporter.reportWarningMessage(
+        node, MessageKind.DEFERRED_LIBRARY_DART_2_DART);
     return false;
   }
 }
@@ -336,10 +360,25 @@
 
   DartResolutionCallbacks(this.backend);
 
-  void onTypeLiteral(DartType type, Registry registry) {
-    if (type.isInterfaceType) {
-      backend.usedTypeLiterals.add(type.element);
+  @override
+  WorldImpact transformImpact(ResolutionImpact worldImpact) {
+    TransformedWorldImpact transformed =
+        new TransformedWorldImpact(worldImpact);
+    for (DartType typeLiteral in worldImpact.typeLiterals) {
+      if (typeLiteral.isInterfaceType) {
+        backend.usedTypeLiterals.add(typeLiteral.element);
+      }
     }
+    for (InterfaceType instantiatedType in worldImpact.instantiatedTypes) {
+      // TODO(johnniwinther): Remove this when dependency tracking is done on
+      // the world impact itself.
+      transformed.registerInstantiatedType(instantiatedType);
+      backend.registerPlatformMembers(instantiatedType,
+          registerGetter: transformed.registerDynamicGetter,
+          registerSetter: transformed.registerDynamicSetter,
+          registerInvocation: transformed.registerDynamicInvocation);
+    }
+    return transformed;
   }
 }
 
@@ -380,13 +419,13 @@
  * (just to name a few).  Retraverse AST to pick those up.
  */
 class ReferencedElementCollector extends Visitor {
-  final Compiler compiler;
+  final DiagnosticReporter reporter;
   final Element element;
   final ElementAst elementAst;
   final newTypedefElementCallback;
   final newClassElementCallback;
 
-  ReferencedElementCollector(this.compiler,
+  ReferencedElementCollector(this.reporter,
                              this.element,
                              this.elementAst,
                              this.newTypedefElementCallback,
@@ -407,7 +446,7 @@
   }
 
   void collect() {
-    compiler.withCurrentElement(element, () {
+    reporter.withCurrentElement(element, () {
       elementAst.ast.accept(this);
     });
   }
@@ -482,6 +521,13 @@
     });
   }
 
+  @override
+  void evaluate(ConstantExpression constant) {
+    return measure(() {
+      return constantCompiler.evaluate(constant);
+    });
+  }
+
   void compileVariable(VariableElement element) {
     measure(() {
       constantCompiler.compileVariable(element);
diff --git a/pkg/compiler/lib/src/dart_backend/backend_ast_to_frontend_ast.dart b/pkg/compiler/lib/src/dart_backend/backend_ast_to_frontend_ast.dart
index 0375bc3..2500c44 100644
--- a/pkg/compiler/lib/src/dart_backend/backend_ast_to_frontend_ast.dart
+++ b/pkg/compiler/lib/src/dart_backend/backend_ast_to_frontend_ast.dart
@@ -4,18 +4,23 @@
 
 library dart_tree_printer;
 
+import '../common.dart';
 import '../constants/values.dart' as values;
 import '../dart_types.dart' as types;
-import '../dart2jslib.dart' as dart2js;
 import '../elements/elements.dart' as elements;
+import '../resolution/tree_elements.dart' show
+    TreeElementMapping;
+import '../tokens/token.dart';
+import '../tokens/token_constants.dart';
+import '../tokens/precedence.dart';
+import '../tokens/precedence_constants.dart';
 import '../tree/tree.dart' as tree;
-import '../scanner/scannerlib.dart';
 import '../util/util.dart';
 import 'backend_ast_nodes.dart';
 import 'backend_ast_emitter.dart' show TypeGenerator;
 
 /// Translates the backend AST to Dart frontend AST.
-tree.Node emit(dart2js.TreeElementMapping treeElements,
+tree.Node emit(TreeElementMapping treeElements,
                RootNode root) {
   return new TreePrinter(treeElements).makeDefinition(root);
 }
@@ -28,7 +33,7 @@
 
 /// Converts backend ASTs to frontend ASTs.
 class TreePrinter {
-  dart2js.TreeElementMapping treeElements;
+  TreeElementMapping treeElements;
 
   TreePrinter([this.treeElements]);
 
@@ -1149,7 +1154,7 @@
   tree.NamedMixinApplication makeNamedMixinApplication(
        elements.MixinApplicationElement cls) {
 
-    assert(dart2js.invariant(cls, !cls.isUnnamedMixinApplication,
+    assert(invariant(cls, !cls.isUnnamedMixinApplication,
         message: "Cannot create ClassNode for unnamed mixin application "
                  "$cls."));
     tree.Modifiers modifiers = makeModifiers(isAbstract: cls.isAbstract);
@@ -1196,7 +1201,7 @@
 
   /// Creates a [tree.ClassNode] node for [cls].
   tree.ClassNode makeClassNode(elements.ClassElement cls) {
-    assert(dart2js.invariant(cls, !cls.isUnnamedMixinApplication,
+    assert(invariant(cls, !cls.isUnnamedMixinApplication,
         message: "Cannot create ClassNode for unnamed mixin application "
                  "$cls."));
     tree.Modifiers modifiers = makeModifiers(isAbstract: cls.isAbstract);
diff --git a/pkg/compiler/lib/src/dart_backend/dart_backend.dart b/pkg/compiler/lib/src/dart_backend/dart_backend.dart
index ab6f388..57b7af5 100644
--- a/pkg/compiler/lib/src/dart_backend/dart_backend.dart
+++ b/pkg/compiler/lib/src/dart_backend/dart_backend.dart
@@ -6,27 +6,53 @@
 
 import 'dart:async' show Future;
 import 'dart:math' show max;
-import '../elements/elements.dart';
-import '../dart2jslib.dart';
-import '../library_loader.dart' show LoadedLibraries;
-import '../dart_types.dart';
-import '../tree/tree.dart';
+
+import '../../compiler.dart' show
+    CompilerOutputProvider;
+import '../common.dart';
+import '../common/backend_api.dart' show
+    Backend;
+import '../common/codegen.dart' show
+    CodegenWorkItem;
+import '../common/names.dart' show
+    Selectors,
+    Uris;
+import '../common/registry.dart' show
+    Registry;
+import '../common/resolution.dart' show
+    Resolution,
+    ResolutionCallbacks,
+    ResolutionImpact,
+    TransformedWorldImpact;
+import '../common/tasks.dart' show
+    CompilerTask;
+import '../compiler.dart' show
+    Compiler;
 import '../compile_time_constants.dart';
 import '../constants/constant_system.dart';
 import '../constants/expressions.dart';
 import '../constants/values.dart';
-import '../universe/universe.dart' show UniverseSelector;
-import '../util/util.dart';
+import '../dart_types.dart';
+import '../elements/elements.dart';
+import '../enqueue.dart' show
+    Enqueuer,
+    ResolutionEnqueuer,
+    WorldImpact;
+import '../library_loader.dart' show
+    LoadedLibraries;
 import '../mirror_renamer/mirror_renamer.dart';
+import '../resolution/tree_elements.dart' show
+    TreeElements,
+    TreeElementMapping;
+import '../tokens/keyword.dart' show
+    Keyword;
+import '../tree/tree.dart';
+import '../universe/selector.dart' show
+    Selector;
+import '../universe/universe.dart' show
+    UniverseSelector;
+import '../util/util.dart';
 import 'backend_ast_to_frontend_ast.dart' as backend2frontend;
-import '../../compiler.dart' show CompilerOutputProvider;
-
-import '../scanner/scannerlib.dart' show StringToken,
-                                         Keyword,
-                                         OPEN_PAREN_INFO,
-                                         CLOSE_PAREN_INFO,
-                                         SEMICOLON_INFO,
-                                         IDENTIFIER_INFO;
 
 part 'backend.dart';
 part 'renamer.dart';
diff --git a/pkg/compiler/lib/src/dart_backend/outputter.dart b/pkg/compiler/lib/src/dart_backend/outputter.dart
index 07d5a4e..3e6f564 100644
--- a/pkg/compiler/lib/src/dart_backend/outputter.dart
+++ b/pkg/compiler/lib/src/dart_backend/outputter.dart
@@ -18,7 +18,7 @@
 /// Output engine for dart2dart that is shared between the dart2js and the
 /// analyzer implementations of dart2dart.
 class DartOutputter {
-  final DiagnosticListener listener;
+  final DiagnosticReporter reporter;
   final CompilerOutputProvider outputProvider;
   final bool forceStripTypes;
 
@@ -37,7 +37,7 @@
   ElementInfo elementInfo;
 
   // TODO(johnniwinther): Support recompilation.
-  DartOutputter(this.listener, this.outputProvider,
+  DartOutputter(this.reporter, this.outputProvider,
                 {bool this.forceStripTypes: false,
                  bool this.enableMinification: false,
                  bool this.multiFile: false});
@@ -97,7 +97,7 @@
     }
 
     libraryInfo = LibraryInfo.processLibraries(
-        listener, libraries, resolvedElements);
+        reporter, libraries, resolvedElements);
 
     elementInfo = ElementInfoProcessor.createElementInfo(
         instantiatedClasses,
@@ -109,7 +109,7 @@
         sortElements: sortElements);
 
     PlaceholderCollector collector = collectPlaceholders(
-        listener,
+        reporter,
         mirrorRenamer,
         mainFunction,
         libraryInfo,
@@ -124,7 +124,7 @@
         isSafeToRemoveTypeDeclarations: isSafeToRemoveTypeDeclarations);
 
     if (outputAst) {
-      String code = astOutput(listener, elementInfo);
+      String code = astOutput(reporter, elementInfo);
       outputProvider("", "dart")
                  ..add(code)
                  ..close();
@@ -147,14 +147,14 @@
   }
 
   static PlaceholderCollector collectPlaceholders(
-      DiagnosticListener listener,
+      DiagnosticReporter reporter,
       MirrorRenamer mirrorRenamer,
       FunctionElement mainFunction,
       LibraryInfo libraryInfo,
       ElementInfo elementInfo) {
     // Create all necessary placeholders.
     PlaceholderCollector collector = new PlaceholderCollector(
-        listener,
+        reporter,
         mirrorRenamer,
         libraryInfo.fixedDynamicNames,
         elementInfo.elementAsts,
@@ -194,13 +194,13 @@
     return placeholderRenamer;
   }
 
-  static String astOutput(DiagnosticListener listener,
+  static String astOutput(DiagnosticReporter reporter,
                           ElementInfo elementInfo) {
     // TODO(antonm): Ideally XML should be a separate backend.
     // TODO(antonm): obey renames and minification, at least as an option.
     StringBuffer sb = new StringBuffer();
     outputElement(element) {
-      sb.write(element.parseNode(listener).toDebugString());
+      sb.write(element.parseNode(reporter).toDebugString());
     }
 
     // Emit XML for AST instead of the program.
@@ -229,7 +229,7 @@
               this.userLibraries);
 
   static LibraryInfo processLibraries(
-      DiagnosticListener listener,
+      DiagnosticReporter reporter,
       Iterable<LibraryElement> libraries,
       Iterable<AstElement> resolvedElements) {
     Set<String> fixedStaticNames = new Set<String>();
@@ -267,7 +267,7 @@
         fixedStaticNames.add(element.name);
       });
 
-      for (Element export in library.exports) {
+      library.forEachExport((Element export) {
         if (!library.isInternalLibrary &&
             export.library.isInternalLibrary) {
           // If an element of an internal library is reexported by a platform
@@ -276,7 +276,7 @@
           // implementation detail of dart2js.
           reexportingLibraries[export] = library;
         }
-      }
+      });
     }
 
     // Map to keep track of names of enum classes. Since these cannot be renamed
@@ -299,10 +299,18 @@
         ClassElement existingEnumClass =
             enumClassMap.putIfAbsent(cls.name, () => cls);
         if (existingEnumClass != cls) {
-          listener.reportError(cls, MessageKind.GENERIC,
-              {'text': "Duplicate enum names are not supported in dart2dart."});
-          listener.reportInfo(existingEnumClass, MessageKind.GENERIC,
-              {'text': "This is the other declaration of '${cls.name}'."});
+          reporter.reportError(
+              reporter.createMessage(
+                  cls,
+                  MessageKind.GENERIC,
+                  {'text': "Duplicate enum names are not supported "
+                           "in dart2dart."}),
+          <DiagnosticMessage>[
+              reporter.createMessage(
+                  existingEnumClass,
+                  MessageKind.GENERIC,
+                  {'text': "This is the other declaration of '${cls.name}'."}),
+          ]);
         }
       }
     }
@@ -526,23 +534,22 @@
             stripTypes: forceStripTypes,
             minify: enableMinification);
         unparsers[outputLibrary] = unparser;
-        LibraryName libraryName = outputLibrary.libraryTag;
-        if (libraryName != null) {
-          unparser.visitLibraryName(libraryName);
+        if (outputLibrary.hasLibraryName) {
+          unparser.unparseLibraryName(outputLibrary.libraryName);
         }
-        for (LibraryTag tag in outputLibrary.tags) {
-          if (tag is! LibraryDependency) continue;
-          LibraryDependency dependency = tag;
-          LibraryElement libraryElement =
-              outputLibrary.getLibraryFromTag(dependency);
+        for (ImportElement import in outputLibrary.imports) {
+          LibraryElement libraryElement = import.importedLibrary;
           String uri = outputPaths.containsKey(libraryElement)
               ? "${outputPaths[libraryElement]}.dart"
               : libraryElement.canonicalUri.toString();
-          if (dependency is Import) {
-            unparser.unparseImportTag(uri);
-          } else {
-            unparser.unparseExportTag(uri);
-          }
+          unparser.unparseImportTag(uri);
+        }
+        for (ExportElement export in outputLibrary.exports) {
+          LibraryElement libraryElement = export.exportedLibrary;
+          String uri = outputPaths.containsKey(libraryElement)
+              ? "${outputPaths[libraryElement]}.dart"
+              : libraryElement.canonicalUri.toString();
+          unparser.unparseExportTag(uri);
         }
       }
     } else {
diff --git a/pkg/compiler/lib/src/dart_backend/placeholder_collector.dart b/pkg/compiler/lib/src/dart_backend/placeholder_collector.dart
index 12c70b3..42c15f9 100644
--- a/pkg/compiler/lib/src/dart_backend/placeholder_collector.dart
+++ b/pkg/compiler/lib/src/dart_backend/placeholder_collector.dart
@@ -45,9 +45,7 @@
 
   visitSend(Send node) {
     Element element = elements[node];
-    if (elements.isAssert(node)) {
-      return;
-    } else if (elements.isTypeLiteral(node)) {
+    if (elements.isTypeLiteral(node)) {
       DartType type = elements.getTypeLiteralType(node);
       if (!type.isDynamic) {
         if (type is TypeVariableType) {
@@ -139,7 +137,6 @@
         collector.currentElement, element, node);
 
     if (Elements.isUnresolved(element)
-        || elements.isAssert(node)
         || element.isDeferredLoaderGetter) {
       return;
     }
@@ -173,7 +170,7 @@
 }
 
 class PlaceholderCollector extends Visitor {
-  final DiagnosticListener listener;
+  final DiagnosticReporter reporter;
   final MirrorRenamer mirrorRenamer;
   final FunctionElement mainFunction;
   final Set<String> fixedMemberNames; // member names which cannot be renamed.
@@ -199,7 +196,7 @@
   get currentFunctionScope => functionScopes.putIfAbsent(
       topmostEnclosingFunction, () => new FunctionScope());
 
-  PlaceholderCollector(this.listener, this.mirrorRenamer,
+  PlaceholderCollector(this.reporter, this.mirrorRenamer,
                        this.fixedMemberNames, this.elementAsts,
                        this.mainFunction);
 
@@ -261,7 +258,7 @@
     currentLocalPlaceholders = new Map<String, LocalPlaceholder>();
     if (!(element is ConstructorElement && element.isRedirectingFactory)) {
       // Do not visit the body of redirecting factories.
-      listener.withCurrentElement(element, () {
+      reporter.withCurrentElement(element, () {
         elementNode.accept(this);
       });
     }
@@ -380,7 +377,7 @@
     if (node is Identifier &&
         !Elements.isStaticOrTopLevel(element) &&
         !Elements.isLocal(element) &&
-        isPrivateName(node.source)) {
+        Name.isPrivateName(node.source)) {
       privateNodes.putIfAbsent(
           currentElement.library, () => new Set<Identifier>()).add(node);
     }
@@ -478,7 +475,7 @@
   }
 
   void internalError(String reason, {Node node}) {
-    listener.internalError(node, reason);
+    reporter.internalError(node, reason);
   }
 
   visit(Node node) => (node == null) ? null : node.accept(this);
diff --git a/pkg/compiler/lib/src/dart_backend/renamer.dart b/pkg/compiler/lib/src/dart_backend/renamer.dart
index f13af6f..02f9365 100644
--- a/pkg/compiler/lib/src/dart_backend/renamer.dart
+++ b/pkg/compiler/lib/src/dart_backend/renamer.dart
@@ -146,7 +146,7 @@
       }
       if (library.isPlatformLibrary) {
         // TODO(johnniwinther): Handle prefixes for dart:core.
-        if (library.canonicalUri == Compiler.DART_CORE) return entity.name;
+        if (library.canonicalUri == Uris.dart_core) return entity.name;
         if (library.isInternalLibrary) {
           throw new SpannableAssertionFailure(entity,
               "Internal library $library should never have been imported from "
diff --git a/pkg/compiler/lib/src/dart_types.dart b/pkg/compiler/lib/src/dart_types.dart
index 17e6472..db02d23 100644
--- a/pkg/compiler/lib/src/dart_types.dart
+++ b/pkg/compiler/lib/src/dart_types.dart
@@ -6,15 +6,21 @@
 
 import 'dart:math' show min;
 
+import 'common.dart';
+import 'common/resolution.dart' show
+    Resolution;
+import 'compiler.dart' show
+    Compiler;
 import 'core_types.dart';
-import 'dart2jslib.dart' show Compiler, invariant, Script, Message;
-import 'elements/modelx.dart'
-    show LibraryElementX,
-         TypeDeclarationElementX,
-         TypedefElementX;
+import 'elements/modelx.dart' show
+    LibraryElementX,
+    TypeDeclarationElementX,
+    TypedefElementX;
 import 'elements/elements.dart';
-import 'ordered_typeset.dart' show OrderedTypeSet;
-import 'util/util.dart' show CURRENT_ELEMENT_SPANNABLE, equalElements;
+import 'ordered_typeset.dart' show
+    OrderedTypeSet;
+import 'util/util.dart' show
+    equalElements;
 
 enum TypeKind {
   FUNCTION,
@@ -64,17 +70,27 @@
     return subst(type.typeArguments, type.element.typeVariables);
   }
 
-  /**
-   * Returns the unaliased type of this type.
-   *
-   * The unaliased type of a typedef'd type is the unaliased type to which its
-   * name is bound. The unaliased version of any other type is the type itself.
-   *
-   * For example, the unaliased type of [: typedef A Func<A,B>(B b) :] is the
-   * function type [: (B) -> A :] and the unaliased type of
-   * [: Func<int,String> :] is the function type [: (String) -> int :].
-   */
-  DartType unalias(Compiler compiler);
+  /// Computes the unaliased type of this type.
+  ///
+  /// The unaliased type of a typedef'd type is the unaliased type to which its
+  /// name is bound. The unaliased version of any other type is the type itself.
+  ///
+  /// For example, the unaliased type of `typedef A Func<A,B>(B b)` is the
+  /// function type `(B) -> A` and the unaliased type of `Func<int,String>`
+  /// is the function type `(String) -> int`.
+  // TODO(johnniwinther): Maybe move this to [TypedefType].
+  void computeUnaliased(Resolution resolution) {}
+
+
+  /// Returns the unaliased type of this type.
+  ///
+  /// The unaliased type of a typedef'd type is the unaliased type to which its
+  /// name is bound. The unaliased version of any other type is the type itself.
+  ///
+  /// For example, the unaliased type of `typedef A Func<A,B>(B b)` is the
+  /// function type `(B) -> A` and the unaliased type of `Func<int,String>`
+  /// is the function type `(String) -> int`.
+  DartType get unaliased => this;
 
   /**
    * If this type is malformed or a generic type created with the wrong number
@@ -207,8 +223,6 @@
     return this;
   }
 
-  DartType unalias(Compiler compiler) => this;
-
   TypeVariableType get typeVariableOccurrence => this;
 
   void forEachTypeVariable(f(TypeVariableType variable)) {
@@ -241,8 +255,6 @@
 
   DartType subst(List<DartType> arguments, List<DartType> parameters) => this;
 
-  DartType unalias(Compiler compiler) => this;
-
   accept(DartTypeVisitor visitor, var argument) {
     return visitor.visitStatementType(this, argument);
   }
@@ -262,8 +274,6 @@
     return this;
   }
 
-  DartType unalias(Compiler compiler) => this;
-
   accept(DartTypeVisitor visitor, var argument) {
     return visitor.visitVoidType(this, argument);
   }
@@ -312,8 +322,6 @@
   // Malformed types are treated as dynamic.
   bool get treatAsDynamic => true;
 
-  DartType unalias(Compiler compiler) => this;
-
   accept(DartTypeVisitor visitor, var argument) {
     return visitor.visitMalformedType(this, argument);
   }
@@ -479,8 +487,6 @@
     return null;
   }
 
-  DartType unalias(Compiler compiler) => this;
-
   MemberSignature lookupInterfaceMember(Name name) {
     MemberSignature member = element.lookupInterfaceMember(name);
     if (member != null && isGeneric) {
@@ -605,8 +611,6 @@
     assert(namedParameters.length == namedParameterTypes.length);
   }
 
-
-
   TypeKind get kind => TypeKind.FUNCTION;
 
   DartType getNamedParameterType(String name) {
@@ -650,8 +654,6 @@
     return this;
   }
 
-  DartType unalias(Compiler compiler) => this;
-
   TypeVariableType get typeVariableOccurrence {
     TypeVariableType typeVariableType = returnType.typeVariableOccurrence;
     if (typeVariableType != null) return typeVariableType;
@@ -726,11 +728,7 @@
 
   String get name => 'Function';
 
-  int computeArity() {
-    int arity = 0;
-    parameterTypes.forEach((_) { arity++; });
-    return arity;
-  }
+  int computeArity() => parameterTypes.length;
 
   int get hashCode {
     int hash = 3 * returnType.hashCode;
@@ -760,6 +758,8 @@
 }
 
 class TypedefType extends GenericType {
+  DartType _unaliased;
+
   TypedefType(TypedefElement element,
               [List<DartType> typeArguments = const <DartType>[]])
       : super(element, typeArguments);
@@ -779,11 +779,21 @@
     return new TypedefType(element, newTypeArguments);
   }
 
-  DartType unalias(Compiler compiler) {
-    element.ensureResolved(compiler);
-    element.checkCyclicReference(compiler);
-    DartType definition = element.alias.unalias(compiler);
-    return definition.substByContext(this);
+  void computeUnaliased(Resolution resolution) {
+    if (_unaliased == null) {
+      element.ensureResolved(resolution);
+      element.checkCyclicReference(resolution);
+      element.alias.computeUnaliased(resolution);
+      _unaliased = element.alias.unaliased.substByContext(this);
+    }
+  }
+
+  DartType get unaliased {
+    if (_unaliased == null) {
+      DartType definition = element.alias.unaliased;
+      _unaliased = definition.substByContext(this);
+    }
+    return _unaliased;
   }
 
   int get hashCode => super.hashCode;
@@ -795,21 +805,6 @@
   }
 }
 
-/// A typedef which has already been resolved to its alias.
-class ResolvedTypedefType extends TypedefType {
-  FunctionType alias;
-
-  ResolvedTypedefType(TypedefElement element,
-                      List<DartType> typeArguments,
-                      this.alias)
-        : super(element, typeArguments) {
-    assert(invariant(element, alias != null,
-        message: 'Alias must be non-null on $element.'));
-  }
-
-  FunctionType unalias(Compiler compiler) => alias;
-}
-
 /**
  * Special type for the `dynamic` type.
  */
@@ -824,8 +819,6 @@
 
   TypeKind get kind => TypeKind.DYNAMIC;
 
-  DartType unalias(Compiler compiler) => this;
-
   DartType subst(List<DartType> arguments, List<DartType> parameters) => this;
 
   accept(DartTypeVisitor visitor, var argument) {
@@ -943,10 +936,11 @@
  */
 abstract class AbstractTypeRelation
     extends BaseDartTypeVisitor<bool, DartType> {
-  final Compiler compiler;
-  CoreTypes get coreTypes => compiler.coreTypes;
+  final Resolution resolution;
 
-  AbstractTypeRelation(this.compiler);
+  AbstractTypeRelation(this.resolution);
+
+  CoreTypes get coreTypes => resolution.coreTypes;
 
   bool visitType(DartType t, DartType s) {
     throw 'internal error: unknown type kind ${t.kind}';
@@ -973,7 +967,7 @@
 
     // TODO(johnniwinther): Currently needed since literal types like int,
     // double, bool etc. might not have been resolved yet.
-    t.element.ensureResolved(compiler);
+    t.element.ensureResolved(resolution);
 
     bool checkTypeArguments(InterfaceType instance, InterfaceType other) {
       List<DartType> tTypeArgs = instance.typeArguments;
@@ -1123,7 +1117,7 @@
 }
 
 class MoreSpecificVisitor extends AbstractTypeRelation {
-  MoreSpecificVisitor(Compiler compiler) : super(compiler);
+  MoreSpecificVisitor(Resolution resolution) : super(resolution);
 
   bool isMoreSpecific(DartType t, DartType s) {
     if (identical(t, s) || s.treatAsDynamic || t == coreTypes.nullType) {
@@ -1138,8 +1132,10 @@
     if (s == coreTypes.objectType) {
       return true;
     }
-    t = t.unalias(compiler);
-    s = s.unalias(compiler);
+    t.computeUnaliased(resolution);
+    t = t.unaliased;
+    s.computeUnaliased(resolution);
+    s = s.unaliased;
 
     return t.accept(this, s);
   }
@@ -1167,7 +1163,7 @@
  */
 class SubtypeVisitor extends MoreSpecificVisitor {
 
-  SubtypeVisitor(Compiler compiler) : super(compiler);
+  SubtypeVisitor(Resolution resolution) : super(resolution);
 
   bool isSubtype(DartType t, DartType s) {
     return t.treatAsDynamic || isMoreSpecific(t, s);
@@ -1230,22 +1226,23 @@
 }
 
 class Types implements DartTypes {
-  // TODO(johnniwinther): Replace by [CoreTypes].
-  final Compiler compiler;
+  final Resolution resolution;
   final MoreSpecificVisitor moreSpecificVisitor;
   final SubtypeVisitor subtypeVisitor;
   final PotentialSubtypeVisitor potentialSubtypeVisitor;
 
-  CoreTypes get coreTypes => compiler.coreTypes;
+  CoreTypes get coreTypes => resolution.coreTypes;
 
-  Types(Compiler compiler)
-      : this.compiler = compiler,
-        this.moreSpecificVisitor = new MoreSpecificVisitor(compiler),
-        this.subtypeVisitor = new SubtypeVisitor(compiler),
-        this.potentialSubtypeVisitor = new PotentialSubtypeVisitor(compiler);
+  DiagnosticReporter get reporter => resolution.reporter;
 
-  Types copy(Compiler compiler) {
-    return new Types(compiler);
+  Types(Resolution resolution)
+      : this.resolution = resolution,
+        this.moreSpecificVisitor = new MoreSpecificVisitor(resolution),
+        this.subtypeVisitor = new SubtypeVisitor(resolution),
+        this.potentialSubtypeVisitor = new PotentialSubtypeVisitor(resolution);
+
+  Types copy(Resolution resolution) {
+    return new Types(resolution);
   }
 
   /// Flatten [type] by recursively removing enclosing `Future` annotations.
@@ -1279,15 +1276,13 @@
     return type;
   }
 
-  /** Returns true if [t] is more specific than [s]. */
+  /// Returns true if [t] is more specific than [s].
   bool isMoreSpecific(DartType t, DartType s) {
     return moreSpecificVisitor.isMoreSpecific(t, s);
   }
 
-  /**
-   * Returns the most specific type of [t] and [s] or `null` if neither is more
-   * specific than the other.
-   */
+  /// Returns the most specific type of [t] and [s] or `null` if neither is more
+  /// specific than the other.
   DartType getMostSpecific(DartType t, DartType s) {
     if (isMoreSpecific(t, s)) {
       return t;
@@ -1537,7 +1532,7 @@
       }
     }
 
-    compiler.internalError(CURRENT_ELEMENT_SPANNABLE,
+    reporter.internalError(CURRENT_ELEMENT_SPANNABLE,
         'No least upper bound computed for $a and $b.');
     return null;
   }
@@ -1633,13 +1628,14 @@
   DartType computeLeastUpperBound(DartType a, DartType b) {
     if (a == b) return a;
 
-    if (a.isTypeVariable ||
-           b.isTypeVariable) {
+    if (a.isTypeVariable || b.isTypeVariable) {
       return computeLeastUpperBoundTypeVariableTypes(a, b);
     }
 
-    a = a.unalias(compiler);
-    b = b.unalias(compiler);
+    a.computeUnaliased(resolution);
+    a = a.unaliased;
+    b.computeUnaliased(resolution);
+    b = b.unaliased;
 
     if (a.treatAsDynamic || b.treatAsDynamic) return const DynamicType();
     if (a.isVoid || b.isVoid) return const VoidType();
@@ -1660,6 +1656,93 @@
     }
     return const DynamicType();
   }
+
+  /// Computes the unaliased type of the first non type variable bound of
+  /// [type].
+  ///
+  /// This is used to normalize malformed types, type variables and typedef
+  /// before use in typechecking.
+  ///
+  /// Malformed types are normalized to `dynamic`. Typedefs are normalized to
+  /// their alias, or `dynamic` if cyclic. Type variables are normalized to the
+  /// normalized type of their bound, or `Object` if cyclic.
+  ///
+  /// For instance for these types:
+  ///
+  ///     class Foo<T extends Bar, S extends T, U extends Baz> {}
+  ///     class Bar<X extends Y, Y extends X> {}
+  ///     typedef Baz();
+  ///
+  /// the unaliased bounds types are:
+  ///
+  ///     unaliasedBound(Foo) = Foo
+  ///     unaliasedBound(Bar) = Bar
+  ///     unaliasedBound(Unresolved) = `dynamic`
+  ///     unaliasedBound(Baz) = ()->dynamic
+  ///     unaliasedBound(T) = Bar
+  ///     unaliasedBound(S) = unaliasedBound(T) = Bar
+  ///     unaliasedBound(U) = unaliasedBound(Baz) = ()->dynamic
+  ///     unaliasedBound(X) = unaliasedBound(Y) = `Object`
+  ///
+  static DartType computeUnaliasedBound(
+      Resolution resolution,
+      DartType type) {
+    DartType originalType = type;
+    while (type.isTypeVariable) {
+      TypeVariableType variable = type;
+      type = variable.element.bound;
+      if (type == originalType) {
+        type = resolution.coreTypes.objectType;
+      }
+    }
+    if (type.isMalformed) {
+      return const DynamicType();
+    }
+    type.computeUnaliased(resolution);
+    return type.unaliased;
+  }
+
+  /// Computes the interface type of [type], which is the type that defines
+  /// the property of [type].
+  ///
+  /// For an interface type it is the type itself, for a type variable it is the
+  /// interface type of the bound, for function types and typedefs it is the
+  /// `Function` type. For other types, like `dynamic`, `void` and malformed
+  /// types, there is no interface type and `null` is returned.
+  ///
+  /// For instance for these types:
+  ///
+  ///     class Foo<T extends Bar, S extends T, U extends Baz> {}
+  ///     class Bar {}
+  ///     typedef Baz();
+  ///
+  /// the interface types are:
+  ///
+  ///     interfaceType(Foo) = Foo
+  ///     interfaceType(Bar) = Bar
+  ///     interfaceType(Baz) = interfaceType(()->dynamic) = Function
+  ///     interfaceType(T) = interfaceType(Bar) = Bar
+  ///     interfaceType(S) = interfaceType(T) = interfaceType(Bar) = Bar
+  ///     interfaceType(U) = interfaceType(Baz)
+  ///                      = intefaceType(()->dynamic) = Function
+  ///
+  /// When typechecking `o.foo` the interface type of the static type of `o` is
+  /// used to lookup the existence and type of `foo`.
+  ///
+  static InterfaceType computeInterfaceType(
+      Resolution resolution,
+      DartType type) {
+    type = computeUnaliasedBound(resolution, type);
+    if (type.treatAsDynamic) {
+      return null;
+    }
+    if (type.isFunctionType) {
+      type = resolution.coreTypes.functionType;
+    }
+    assert(invariant(NO_LOCATION_SPANNABLE, type.isInterfaceType,
+        message: "unexpected type kind ${type.kind}."));
+    return type;
+  }
 }
 
 /**
@@ -1668,7 +1751,7 @@
  * [:false:] only if we are sure no such substitution exists.
  */
 class PotentialSubtypeVisitor extends SubtypeVisitor {
-  PotentialSubtypeVisitor(Compiler compiler) : super(compiler);
+  PotentialSubtypeVisitor(Resolution resolution) : super(resolution);
 
   bool isSubtype(DartType t, DartType s) {
     if (t is TypeVariableType || s is TypeVariableType) {
@@ -1686,10 +1769,10 @@
 /// constraints are too complex or the two types are too different, `false`
 /// is returned. Otherwise, the [constraintMap] holds the valid constraints.
 class MoreSpecificSubtypeVisitor extends BaseDartTypeVisitor<bool, DartType> {
-  final Compiler compiler;
+  final Types types;
   Map<TypeVariableType, DartType> constraintMap;
 
-  MoreSpecificSubtypeVisitor(Compiler this.compiler);
+  MoreSpecificSubtypeVisitor(this.types);
 
   /// Compute an instance of [element] which is more specific than [supertype].
   /// If no instance is found, `null` is returned.
@@ -1716,7 +1799,7 @@
   }
 
   bool visitType(DartType type, DartType argument) {
-    return compiler.types.isMoreSpecific(type, argument);
+    return types.isMoreSpecific(type, argument);
   }
 
   bool visitTypes(List<DartType> a, List<DartType> b) {
@@ -1729,7 +1812,7 @@
 
   bool visitTypeVariableType(TypeVariableType type, DartType argument) {
     DartType constraint =
-        compiler.types.getMostSpecific(constraintMap[type], argument);
+        types.getMostSpecific(constraintMap[type], argument);
     constraintMap[type] = constraint;
     return constraint != null;
   }
diff --git a/pkg/compiler/lib/src/deferred_load.dart b/pkg/compiler/lib/src/deferred_load.dart
index 3ae1bae..4e095df 100644
--- a/pkg/compiler/lib/src/deferred_load.dart
+++ b/pkg/compiler/lib/src/deferred_load.dart
@@ -4,22 +4,19 @@
 
 library deferred_load;
 
+import 'common.dart';
+import 'common/backend_api.dart' show
+    Backend;
+import 'common/tasks.dart' show
+    CompilerTask;
+import 'compiler.dart' show
+    Compiler;
 import 'constants/values.dart' show
     ConstantValue,
     ConstructedConstantValue,
     DeferredConstantValue,
     StringConstantValue;
-
-import 'dart2jslib.dart' show
-    Backend,
-    Compiler,
-    CompilerTask,
-    invariant,
-    MessageKind;
-
-import 'js_backend/js_backend.dart' show
-    JavaScriptBackend;
-
+import 'dart_types.dart';
 import 'elements/elements.dart' show
     AccessorElement,
     AstElement,
@@ -27,23 +24,23 @@
     Element,
     ElementKind,
     Elements,
+    ExportElement,
     FunctionElement,
+    ImportElement,
     LibraryElement,
     MetadataAnnotation,
     PrefixElement,
     ScopeContainerElement,
-    TypedefElement,
-    VoidElement;
-
-import 'dart_types.dart';
-
-import 'util/util.dart' show
-    Link, makeUnique;
-import 'util/uri_extras.dart' as uri_extras;
-
-import 'util/setlet.dart' show
-    Setlet;
-
+    TypedefElement;
+import 'enqueue.dart' show
+    WorldImpact;
+import 'js_backend/js_backend.dart' show
+    JavaScriptBackend;
+import 'resolution/resolution.dart' show
+    AnalyzableElementX;
+import 'resolution/tree_elements.dart' show
+    TreeElements;
+import 'tree/tree.dart' as ast;
 import 'tree/tree.dart' show
     Import,
     LibraryTag,
@@ -52,12 +49,11 @@
     LiteralString,
     NewExpression,
     Node;
-
-import 'tree/tree.dart' as ast;
-
-import 'resolution/resolution.dart' show
-    AnalyzableElementX,
-    TreeElements;
+import 'util/setlet.dart' show
+    Setlet;
+import 'util/uri_extras.dart' as uri_extras;
+import 'util/util.dart' show
+    Link, makeUnique;
 
 /// A "hunk" of the program that will be loaded whenever one of its [imports]
 /// are loaded.
@@ -72,7 +68,7 @@
 class OutputUnit {
   /// The deferred imports that will load this output unit when one of them is
   /// loaded.
-  final Setlet<Import> imports = new Setlet<Import>();
+  final Setlet<_DeferredImport> imports = new Setlet<_DeferredImport>();
 
   /// `true` if this output unit is for the main output file.
   final bool isMainOutput;
@@ -92,7 +88,7 @@
 
   int get hashCode {
     int sum = 0;
-    for (Import import in imports) {
+    for (_DeferredImport import in imports) {
       sum = (sum + import.hashCode) & 0x3FFFFFFF;  // Stay in 30 bit range.
     }
     return sum;
@@ -111,8 +107,7 @@
 
   /// A synthetic [Import] representing the loading of the main
   /// program.
-  final Import _fakeMainImport = new Import(null, new LiteralString(null,
-      new LiteralDartString("main")), null, null, null);
+  final _DeferredImport _fakeMainImport = const _DeferredImport();
 
   /// The OutputUnit that will be loaded when the program starts.
   final OutputUnit mainOutputUnit = new OutputUnit(isMainOutput: true);
@@ -133,7 +128,8 @@
   /// can be loaded in parallel. And finally lib1 can be loaded.
   final Map<String, List<OutputUnit>> hunksToLoad =
       new Map<String, List<OutputUnit>>();
-  final Map<Import, String> importDeferName = new Map<Import, String>();
+  final Map<_DeferredImport, String> _importDeferName =
+      <_DeferredImport, String>{};
 
   /// A mapping from elements and constants to their output unit. Query this via
   /// [outputUnitForElement]
@@ -148,17 +144,18 @@
   /// All the imports with a [DeferredLibrary] annotation, mapped to the
   /// [LibraryElement] they import.
   /// The main library is included in this set for convenience.
-  final Map<Import, LibraryElement> _allDeferredImports =
-      new Map<Import, LibraryElement>();
+  final Map<_DeferredImport, LibraryElement> _allDeferredImports =
+      new Map<_DeferredImport, LibraryElement>();
 
   /// Because the token-stream is forgotten later in the program, we cache a
   /// description of each deferred import.
-  final _deferredImportDescriptions = new Map<Import, ImportDescription>();
+  final Map<_DeferredImport, ImportDescription>_deferredImportDescriptions =
+      <_DeferredImport, ImportDescription>{};
 
   // For each deferred import we want to know exactly what elements have to
   // be loaded.
-  Map<Import, Set<Element>> _importedDeferredBy = null;
-  Map<Import, Set<ConstantValue>> _constantsDeferredBy = null;
+  Map<_DeferredImport, Set<Element>> _importedDeferredBy = null;
+  Map<_DeferredImport, Set<ConstantValue>> _constantsDeferredBy = null;
 
   Set<Element> _mainElements = new Set<Element>();
 
@@ -198,6 +195,16 @@
     return outputUnitForElement(element) != mainOutputUnit;
   }
 
+  /// Returns the unique name for the deferred import of [prefix].
+  String getImportDeferName(Spannable node, PrefixElement prefix) {
+    String name =
+        _importDeferName[new _DeclaredDeferredImport(prefix.deferredImport)];
+    if (name == null) {
+      reporter.internalError(node, "No deferred name for $prefix.");
+    }
+    return name;
+  }
+
   /// Returns `true` if element [to] is reachable from element [from] without
   /// crossing a deferred import.
   ///
@@ -213,14 +220,14 @@
   void registerConstantDeferredUse(DeferredConstantValue constant,
                                    PrefixElement prefix) {
     OutputUnit outputUnit = new OutputUnit();
-    outputUnit.imports.add(prefix.deferredImport);
+    outputUnit.imports.add(new _DeclaredDeferredImport(prefix.deferredImport));
     _constantToOutputUnit[constant] = outputUnit;
   }
 
   /// Answers whether [element] is explicitly deferred when referred to from
   /// [library].
   bool _isExplicitlyDeferred(Element element, LibraryElement library) {
-    Link<Import> imports = _getImports(element, library);
+    Iterable<ImportElement> imports = _getImports(element, library);
     // If the element is not imported explicitly, it is implicitly imported
     // not deferred.
     if (imports.isEmpty) return false;
@@ -228,11 +235,11 @@
     // is explicitly deferred, we say the element is explicitly deferred.
     // TODO(sigurdm): We might want to give a warning if the imports do not
     // agree.
-    return imports.every((Import import) => import.isDeferred);
+    return imports.every((ImportElement import) => import.isDeferred);
   }
 
   /// Returns a [Link] of every [Import] that imports [element] into [library].
-  Link<Import> _getImports(Element element, LibraryElement library) {
+  Iterable<ImportElement> _getImports(Element element, LibraryElement library) {
     if (element.isClassMember) {
       element = element.enclosingClass;
     }
@@ -252,8 +259,15 @@
       Set<ConstantValue> constants,
       isMirrorUsage) {
 
+    if (element.isErroneous) {
+      // Erroneous elements are ignored.
+      return;
+    }
+
     /// Recursively collects all the dependencies of [type].
     void collectTypeDependencies(DartType type) {
+      // TODO(het): we would like to separate out types that are only needed for
+      // rti from types that are needed for their members.
       if (type is GenericType) {
         type.typeArguments.forEach(collectTypeDependencies);
       }
@@ -270,7 +284,7 @@
         collectTypeDependencies(type.returnType);
       } else if (type is TypedefType) {
         elements.add(type.element);
-        collectTypeDependencies(type.unalias(compiler));
+        collectTypeDependencies(type.unaliased);
       } else if (type is InterfaceType) {
         elements.add(type.element);
       }
@@ -284,42 +298,49 @@
       // TODO(johnniwinther): Remove this when [AbstractFieldElement] has been
       // removed.
       if (element is! AstElement) return;
-      AstElement astElement = element;
 
-      // TODO(sigurdm): We want to be more specific about this - need a better
-      // way to query "liveness".
-      if (astElement is! TypedefElement &&
-          !compiler.enqueuer.resolution.hasBeenResolved(astElement)) {
-        return;
-      }
-
-      TreeElements treeElements = astElement.resolvedAst.elements;
-
-      assert(treeElements != null);
-
-      for (Element dependency in treeElements.allElements) {
-        if (dependency.isLocal && !dependency.isFunction) continue;
-        if (dependency.isErroneous) continue;
-        if (dependency.isTypeVariable) continue;
-
-        elements.add(dependency);
-      }
-
-      for (DartType type in treeElements.requiredTypes) {
-        collectTypeDependencies(type);
-      }
-
-      treeElements.forEachConstantNode((Node node, _) {
-        // Explicitly depend on the backend constants.
-        ConstantValue value =
-            backend.constants.getConstantValueForNode(node, treeElements);
-        if (value != null) {
-          // TODO(johnniwinther): Assert that all constants have values when
-          // these are directly evaluated.
-          constants.add(value);
+      if (element.isTypedef) {
+        TypedefElement typdef = element;
+        collectTypeDependencies(typdef.thisType);
+      } else {
+        // TODO(sigurdm): We want to be more specific about this - need a better
+        // way to query "liveness".
+        AstElement analyzableElement = element.analyzableElement.declaration;
+        if (!compiler.enqueuer.resolution.hasBeenProcessed(analyzableElement)) {
+          return;
         }
-      });
-      elements.addAll(treeElements.otherDependencies);
+
+        WorldImpact worldImpact =
+            compiler.resolution.getWorldImpact(analyzableElement);
+        elements.addAll(worldImpact.staticUses);
+        elements.addAll(worldImpact.closures);
+        for (DartType type in worldImpact.typeLiterals) {
+          if (type.isTypedef || type.isInterfaceType) {
+            elements.add(type.element);
+          }
+        }
+        for (InterfaceType type in worldImpact.instantiatedTypes) {
+          elements.add(type.element);
+        }
+
+        TreeElements treeElements = analyzableElement.resolvedAst.elements;
+        assert(treeElements != null);
+
+        for (DartType type in treeElements.requiredTypes) {
+          collectTypeDependencies(type);
+        }
+
+        treeElements.forEachConstantNode((Node node, _) {
+          // Explicitly depend on the backend constants.
+          ConstantValue value =
+              backend.constants.getConstantValueForNode(node, treeElements);
+          if (value != null) {
+            // TODO(johnniwinther): Assert that all constants have values when
+            // these are directly evaluated.
+            constants.add(value);
+          }
+        });
+      }
     }
 
     // TODO(sigurdm): How is metadata on a patch-class handled?
@@ -331,8 +352,7 @@
       }
     }
 
-    if (element is FunctionElement &&
-        compiler.resolverWorld.closurizedMembers.contains(element)) {
+    if (element is FunctionElement) {
       collectTypeDependencies(element.type);
     }
 
@@ -341,9 +361,10 @@
       // to.  Static members are not relevant, unless we are processing
       // extra dependencies due to mirrors.
       void addLiveInstanceMember(Element element) {
-        if (!compiler.enqueuer.resolution.hasBeenResolved(element)) return;
+        if (!compiler.enqueuer.resolution.hasBeenProcessed(element)) return;
         if (!isMirrorUsage && !element.isInstanceMember) return;
-        collectDependencies(element.implementation);
+        elements.add(element);
+        collectDependencies(element);
       }
       ClassElement cls = element.declaration;
       cls.forEachLocalMember(addLiveInstanceMember);
@@ -357,6 +378,7 @@
       elements.add(cls.implementation);
     } else if (Elements.isStaticOrTopLevel(element) ||
                element.isConstructor) {
+      elements.add(element);
       collectDependencies(element);
     }
     if (element.isGenerativeConstructor) {
@@ -385,14 +407,16 @@
       iterateTags(LibraryElement library) {
         // TODO(sigurdm): Make helper getLibraryDependencyTags when tags is
         // changed to be a List instead of a Link.
-        for (LibraryTag tag in library.tags) {
-          if (tag is! LibraryDependency) continue;
-          LibraryDependency libraryDependency = tag;
-          if (!(libraryDependency is Import && libraryDependency.isDeferred)) {
-            LibraryElement importedLibrary = library.getLibraryFromTag(tag);
+        for (ImportElement import in library.imports) {
+          if (!import.isDeferred) {
+            LibraryElement importedLibrary = import.importedLibrary;
             traverseLibrary(importedLibrary);
           }
         }
+        for (ExportElement export in library.exports) {
+          LibraryElement exportedLibrary = export.exportedLibrary;
+          traverseLibrary(exportedLibrary);
+        }
       }
 
       iterateTags(library);
@@ -406,7 +430,8 @@
   }
 
   /// Add all dependencies of [constant] to the mapping of [import].
-  void _mapConstantDependencies(ConstantValue constant, Import import) {
+  void _mapConstantDependencies(ConstantValue constant,
+                                _DeferredImport import) {
     Set<ConstantValue> constants = _constantsDeferredBy.putIfAbsent(import,
         () => new Set<ConstantValue>());
     if (constants.contains(constant)) return;
@@ -424,7 +449,7 @@
   /// sets [_importedDeferredBy] and [_constantsDeferredBy].
   /// Only one of [element] and [constant] should be given.
   void _mapDependencies({Element element,
-                         Import import,
+                         _DeferredImport import,
                          isMirrorUsage: false}) {
 
     Set<Element> elements = _importedDeferredBy.putIfAbsent(import,
@@ -455,8 +480,9 @@
 
     for (Element dependency in dependentElements) {
       if (_isExplicitlyDeferred(dependency, library)) {
-        for (Import deferredImport in _getImports(dependency, library)) {
-          _mapDependencies(element: dependency, import: deferredImport);
+        for (ImportElement deferredImport in _getImports(dependency, library)) {
+          _mapDependencies(element: dependency,
+              import: new _DeclaredDeferredImport(deferredImport));
         }
       } else {
         _mapDependencies(element: dependency, import: import);
@@ -466,7 +492,7 @@
     for (ConstantValue dependency in dependentConstants) {
       if (dependency is DeferredConstantValue) {
         _mapConstantDependencies(dependency,
-                                 dependency.prefix.deferredImport);
+            new _DeclaredDeferredImport(dependency.prefix.deferredImport));
       } else {
         _mapConstantDependencies(dependency, import);
       }
@@ -477,7 +503,8 @@
   ///
   /// The elements are added with [_mapDependencies].
   void _addMirrorElements() {
-    void mapDependenciesIfResolved(Element element, Import deferredImport) {
+    void mapDependenciesIfResolved(Element element,
+                                   _DeferredImport deferredImport) {
       // If an element is the target of a MirrorsUsed annotation but never used
       // It will not be resolved, and we should not call isNeededForReflection.
       // TODO(sigurdm): Unresolved elements should just answer false when
@@ -485,27 +512,20 @@
       // So we have to filter them out here.
       if (element is AnalyzableElementX && !element.hasTreeElements) return;
       if (compiler.backend.isAccessibleByReflection(element)) {
-        _mapDependencies(element: element, import: deferredImport,
-                         isMirrorUsage: true);
+        _mapDependencies(
+            element: element, import: deferredImport, isMirrorUsage: true);
       }
     }
 
     // For each deferred import we analyze all elements reachable from the
     // imported library through non-deferred imports.
-    handleLibrary(LibraryElement library, Import deferredImport) {
+    void handleLibrary(LibraryElement library, _DeferredImport deferredImport) {
       library.implementation.forEachLocalMember((Element element) {
         mapDependenciesIfResolved(element, deferredImport);
       });
 
-      for (MetadataAnnotation metadata in library.metadata) {
-        ConstantValue constant =
-            backend.constants.getConstantValueForMetadata(metadata);
-        if (constant != null) {
-          _mapConstantDependencies(constant, deferredImport);
-        }
-      }
-      for (LibraryTag tag in library.tags) {
-        for (MetadataAnnotation metadata in tag.metadata) {
+      void processMetadata(Element element) {
+        for (MetadataAnnotation metadata in element.metadata) {
           ConstantValue constant =
               backend.constants.getConstantValueForMetadata(metadata);
           if (constant != null) {
@@ -513,9 +533,13 @@
           }
         }
       }
+
+      processMetadata(library);
+      library.imports.forEach(processMetadata);
+      library.exports.forEach(processMetadata);
     }
 
-    for (Import deferredImport in _allDeferredImports.keys) {
+    for (_DeferredImport deferredImport in _allDeferredImports.keys) {
       LibraryElement deferredLibrary = _allDeferredImports[deferredImport];
       for (LibraryElement library in
           _nonDeferredReachableLibraries(deferredLibrary)) {
@@ -530,36 +554,15 @@
   void _assignNamesToOutputUnits(Set<OutputUnit> allOutputUnits) {
     Set<String> usedImportNames = new Set<String>();
 
-    // Finds the first argument to the [DeferredLibrary] annotation
-    void computeImportDeferName(Import import) {
-      String result;
-      if (import == _fakeMainImport) {
-        result = "main";
-      } else if (import.isDeferred) {
-        result = import.prefix.toString();
-      } else {
-        Link<MetadataAnnotation> metadatas = import.metadata;
-        assert(metadatas != null);
-        for (MetadataAnnotation metadata in metadatas) {
-          metadata.ensureResolved(compiler);
-          ConstantValue value =
-              compiler.constants.getConstantValue(metadata.constant);
-          Element element = value.getType(compiler.coreTypes).element;
-          if (element == deferredLibraryClass) {
-            ConstructedConstantValue constant = value;
-            StringConstantValue s = constant.fields.values.single;
-            result = s.primitiveValue.slowToString();
-            break;
-          }
-        }
-      }
+    void computeImportDeferName(_DeferredImport import) {
+      String result = import.computeImportDeferName(compiler);
       assert(result != null);
-      importDeferName[import] = makeUnique(result, usedImportNames);;
+      _importDeferName[import] = makeUnique(result, usedImportNames);
     }
 
     int counter = 1;
 
-    for (Import import in _allDeferredImports.keys) {
+    for (_DeferredImport import in _allDeferredImports.keys) {
       computeImportDeferName(import);
     }
 
@@ -588,13 +591,13 @@
     sortedOutputUnits.sort((a, b) => b.imports.length - a.imports.length);
 
     // For each deferred import we find out which outputUnits to load.
-    for (Import import in _allDeferredImports.keys) {
+    for (_DeferredImport import in _allDeferredImports.keys) {
       if (import == _fakeMainImport) continue;
-      hunksToLoad[importDeferName[import]] = new List<OutputUnit>();
+      hunksToLoad[_importDeferName[import]] = new List<OutputUnit>();
       for (OutputUnit outputUnit in sortedOutputUnits) {
         if (outputUnit == mainOutputUnit) continue;
         if (outputUnit.imports.contains(import)) {
-          hunksToLoad[importDeferName[import]].add(outputUnit);
+          hunksToLoad[_importDeferName[import]].add(outputUnit);
         }
       }
     }
@@ -607,8 +610,8 @@
     }
     if (main == null) return;
     LibraryElement mainLibrary = main.library;
-    _importedDeferredBy = new Map<Import, Set<Element>>();
-    _constantsDeferredBy = new Map<Import, Set<ConstantValue>>();
+    _importedDeferredBy = new Map<_DeferredImport, Set<Element>>();
+    _constantsDeferredBy = new Map<_DeferredImport, Set<ConstantValue>>();
     _importedDeferredBy[_fakeMainImport] = _mainElements;
 
     measureElement(mainLibrary, () {
@@ -637,7 +640,7 @@
 
       // Reverse the mappings. For each element record an OutputUnit collecting
       // all deferred imports mapped to this element. Same for constants.
-      for (Import import in _importedDeferredBy.keys) {
+      for (_DeferredImport import in _importedDeferredBy.keys) {
         for (Element element in _importedDeferredBy[import]) {
           // Only one file should be loaded when the program starts, so make
           // sure that only one OutputUnit is created for [fakeMainImport].
@@ -650,7 +653,7 @@
           }
         }
       }
-      for (Import import in _constantsDeferredBy.keys) {
+      for (_DeferredImport import in _constantsDeferredBy.keys) {
         for (ConstantValue constant in _constantsDeferredBy[import]) {
           // Only one file should be loaded when the program starts, so make
           // sure that only one OutputUnit is created for [fakeMainImport].
@@ -717,47 +720,47 @@
     // The prefixes that have been used by any imports in this library.
     Setlet<String> usedPrefixes = new Setlet<String>();
     // The last deferred import we saw with a given prefix (if any).
-    Map<String, Import> prefixDeferredImport = new Map<String, Import>();
+    Map<String, ImportElement> prefixDeferredImport =
+        new Map<String, ImportElement>();
     for (LibraryElement library in compiler.libraryLoader.libraries) {
-      compiler.withCurrentElement(library, () {
+      reporter.withCurrentElement(library, () {
         prefixDeferredImport.clear();
         usedPrefixes.clear();
         // TODO(sigurdm): Make helper getLibraryImportTags when tags is a List
         // instead of a Link.
-        for (LibraryTag tag in library.tags) {
-          if (tag is! Import) continue;
-          Import import = tag;
-
+        for (ImportElement import in library.imports) {
           /// Give an error if the old annotation-based syntax has been used.
-          Link<MetadataAnnotation> metadataList = import.metadata;
+          List<MetadataAnnotation> metadataList = import.metadata;
           if (metadataList != null) {
             for (MetadataAnnotation metadata in metadataList) {
-              metadata.ensureResolved(compiler);
+              metadata.ensureResolved(compiler.resolution);
               ConstantValue value =
                   compiler.constants.getConstantValue(metadata.constant);
               Element element = value.getType(compiler.coreTypes).element;
               if (element == deferredLibraryClass) {
-                 compiler.reportError(
+                 reporter.reportErrorMessage(
                      import, MessageKind.DEFERRED_OLD_SYNTAX);
               }
             }
           }
 
           String prefix = (import.prefix != null)
-              ? import.prefix.toString()
+              ? import.prefix.name
               : null;
           // The last import we saw with the same prefix.
-          Import previousDeferredImport = prefixDeferredImport[prefix];
+          ImportElement previousDeferredImport = prefixDeferredImport[prefix];
           if (import.isDeferred) {
-            LibraryElement importedLibrary = library.getLibraryFromTag(import);
-            _allDeferredImports[import] = importedLibrary;
+            _DeferredImport key = new _DeclaredDeferredImport(import);
+            LibraryElement importedLibrary = import.importedLibrary;
+            _allDeferredImports[key] = importedLibrary;
 
             if (prefix == null) {
-              compiler.reportError(import,
+              reporter.reportErrorMessage(
+                  import,
                   MessageKind.DEFERRED_LIBRARY_WITHOUT_PREFIX);
             } else {
               prefixDeferredImport[prefix] = import;
-              _deferredImportDescriptions[import] =
+              _deferredImportDescriptions[key] =
                   new ImportDescription(import, library, compiler);
             }
             isProgramSplit = true;
@@ -766,10 +769,11 @@
           if (prefix != null) {
             if (previousDeferredImport != null ||
                 (import.isDeferred && usedPrefixes.contains(prefix))) {
-              Import failingImport = (previousDeferredImport != null)
+              ImportElement failingImport = (previousDeferredImport != null)
                   ? previousDeferredImport
                   : import;
-              compiler.reportError(failingImport.prefix,
+              reporter.reportErrorMessage(
+                  failingImport.prefix,
                   MessageKind.DEFERRED_LIBRARY_DUPLICATE_PREFIX);
             }
             usedPrefixes.add(prefix);
@@ -856,8 +860,8 @@
     JavaScriptBackend backend = compiler.backend;
     Map<String, Map<String, dynamic>> mapping =
         new Map<String, Map<String, dynamic>>();
-    _deferredImportDescriptions.keys.forEach((ast.Import import) {
-      List<OutputUnit> outputUnits = hunksToLoad[importDeferName[import]];
+    _deferredImportDescriptions.keys.forEach((_DeferredImport import) {
+      List<OutputUnit> outputUnits = hunksToLoad[_importDeferName[import]];
       ImportDescription description = _deferredImportDescriptions[import];
       Map<String, dynamic> libraryMap =
           mapping.putIfAbsent(description.importingUri,
@@ -871,6 +875,41 @@
     });
     return mapping;
   }
+
+  /// Creates a textual representation of the output unit content.
+  String dump() {
+    Map<OutputUnit, List<String>> elementMap = <OutputUnit, List<String>>{};
+    Map<OutputUnit, List<String>> constantMap =
+        <OutputUnit, List<String>>{};
+    _elementToOutputUnit.forEach((Element element, OutputUnit output) {
+      elementMap.putIfAbsent(output, () => <String>[]).add('$element');
+    });
+    _constantToOutputUnit.forEach((ConstantValue value, OutputUnit output) {
+      constantMap.putIfAbsent(output, () => <String>[])
+          .add(value.toStructuredString());
+    });
+
+    StringBuffer sb = new StringBuffer();
+    for (OutputUnit outputUnit in allOutputUnits) {
+      sb.write(outputUnit.name);
+      List<String> elements = elementMap[outputUnit];
+      if (elements != null) {
+        sb.write('\n elements:');
+        for (String element in elements..sort()) {
+          sb.write('\n  $element');
+        }
+      }
+      List<String> constants = constantMap[outputUnit];
+      if (constants != null) {
+        sb.write('\n constants:');
+        for (String value in constants..sort()) {
+          sb.write('\n  $value');
+        }
+      }
+    }
+    return sb.toString();
+  }
+
 }
 
 class ImportDescription {
@@ -880,20 +919,73 @@
   final String prefix;
   final LibraryElement _importingLibrary;
 
-  ImportDescription(Import import,
+  ImportDescription(ImportElement import,
                     LibraryElement importingLibrary,
                     Compiler compiler)
       : importingUri = uri_extras.relativize(
           compiler.mainApp.canonicalUri,
           importingLibrary.canonicalUri, false),
-        prefix = import.prefix.source,
+        prefix = import.prefix.name,
         _importingLibrary = importingLibrary;
 
   String get importingLibraryName {
-    String libraryName = _importingLibrary.getLibraryName();
-    return libraryName == ""
-      ? "<unnamed>"
-      : libraryName;
+    return _importingLibrary.hasLibraryName
+        ? _importingLibrary.libraryName : "<unnamed>";
+  }
+}
+
+/// A node in the deferred import graph.
+///
+/// This class serves as the root node; the 'import' of the main library.
+class _DeferredImport {
+  const _DeferredImport();
+
+  /// Computes a suggestive name for this import.
+  String computeImportDeferName(Compiler compiler) => 'main';
+}
+
+/// A node in the deferred import graph defined by a deferred import directive.
+class _DeclaredDeferredImport implements _DeferredImport {
+  final ImportElement declaration;
+
+  _DeclaredDeferredImport(this.declaration);
+
+  @override
+  String computeImportDeferName(Compiler compiler) {
+    String result;
+    if (declaration.isDeferred) {
+      if (declaration.prefix != null) {
+        result = declaration.prefix.name;
+      } else {
+        // This happens when the deferred import isn't declared with a prefix.
+        assert(compiler.compilationFailed);
+        result = '';
+      }
+    } else {
+      // Finds the first argument to the [DeferredLibrary] annotation
+      List<MetadataAnnotation> metadatas = declaration.metadata;
+      assert(metadatas != null);
+      for (MetadataAnnotation metadata in metadatas) {
+        metadata.ensureResolved(compiler.resolution);
+        ConstantValue value =
+            compiler.constants.getConstantValue(metadata.constant);
+        Element element = value.getType(compiler.coreTypes).element;
+        if (element == compiler.deferredLibraryClass) {
+          ConstructedConstantValue constant = value;
+          StringConstantValue s = constant.fields.values.single;
+          result = s.primitiveValue.slowToString();
+          break;
+        }
+      }
+    }
+    assert(result != null);
+    return result;
   }
 
+  bool operator ==(other) {
+    if (other is! _DeclaredDeferredImport) return false;
+    return declaration == other.declaration;
+  }
+
+  int get hashCode => declaration.hashCode * 17;
 }
diff --git a/pkg/compiler/lib/src/diagnostic_listener.dart b/pkg/compiler/lib/src/diagnostic_listener.dart
deleted file mode 100644
index d57b11d..0000000
--- a/pkg/compiler/lib/src/diagnostic_listener.dart
+++ /dev/null
@@ -1,32 +0,0 @@
-// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-part of dart2js;
-
-abstract class DiagnosticListener {
-  // TODO(karlklose): rename log to something like reportInfo.
-  void log(message);
-
-  void internalError(Spannable spannable, message);
-
-  SourceSpan spanFromSpannable(Spannable node);
-
-  void reportError(Spannable node, MessageKind errorCode,
-                   [Map arguments = const {}]);
-
-  void reportWarning(Spannable node, MessageKind errorCode,
-                     [Map arguments = const {}]);
-
-  void reportHint(Spannable node, MessageKind errorCode,
-                  [Map arguments = const {}]);
-
-  void reportInfo(Spannable node, MessageKind errorCode,
-                  [Map arguments = const {}]);
-
-  // TODO(ahe): We should not expose this here.  Perhaps a
-  // [SourceSpan] should implement [Spannable], and we should have a
-  // way to construct a [SourceSpan] from a [Spannable] and an
-  // [Element].
-  withCurrentElement(Element element, f());
-}
diff --git a/pkg/compiler/lib/src/diagnostics/code_location.dart b/pkg/compiler/lib/src/diagnostics/code_location.dart
new file mode 100644
index 0000000..63fee22
--- /dev/null
+++ b/pkg/compiler/lib/src/diagnostics/code_location.dart
@@ -0,0 +1,90 @@
+// Copyright (c) 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.diagnostics.code_location;
+
+import '../util/uri_extras.dart' as uri_extras show relativize;
+
+/// [CodeLocation] divides uris into different classes.
+///
+/// These are used to group uris from user code, platform libraries and
+/// packages.
+abstract class CodeLocation {
+  /// Returns `true` if [uri] is in this code location.
+  bool inSameLocation(Uri uri);
+
+  /// Returns the uri of this location relative to [baseUri].
+  String relativize(Uri baseUri);
+
+  factory CodeLocation(Uri uri) {
+    if (uri.scheme == 'package') {
+      int slashPos = uri.path.indexOf('/');
+      if (slashPos != -1) {
+        String packageName = uri.path.substring(0, slashPos);
+        return new PackageLocation(packageName);
+      } else {
+        return new UriLocation(uri);
+      }
+    } else {
+      return new SchemeLocation(uri);
+    }
+  }
+}
+
+/// A code location defined by the scheme of the uri.
+///
+/// Used for non-package uris, such as 'dart', 'file', and 'http'.
+class SchemeLocation implements CodeLocation {
+  final Uri uri;
+
+  SchemeLocation(this.uri);
+
+  bool inSameLocation(Uri uri) {
+    return this.uri.scheme == uri.scheme;
+  }
+
+  String relativize(Uri baseUri) {
+    return uri_extras.relativize(baseUri, uri, false);
+  }
+}
+
+/// A code location defined by the package name.
+///
+/// Used for package uris, separated by their `package names`, that is, the
+/// 'foo' of 'package:foo/bar.dart'.
+class PackageLocation implements CodeLocation {
+  final String packageName;
+
+  PackageLocation(this.packageName);
+
+  bool inSameLocation(Uri uri) {
+    return uri.scheme == 'package' && uri.path.startsWith('$packageName/');
+  }
+
+  String relativize(Uri baseUri) => 'package:$packageName';
+}
+
+/// A code location defined by the whole uri.
+///
+/// Used for package uris with no package name. For instance 'package:foo.dart'.
+class UriLocation implements CodeLocation {
+  final Uri uri;
+
+  UriLocation(this.uri);
+
+  bool inSameLocation(Uri uri) => this.uri == uri;
+
+  String relativize(Uri baseUri) {
+    return uri_extras.relativize(baseUri, uri, false);
+  }
+}
+
+/// A code location that contains any uri.
+class AnyLocation implements CodeLocation {
+  const AnyLocation();
+
+  bool inSameLocation(Uri uri) => true;
+
+  String relativize(Uri baseUri) => '$baseUri';
+}
diff --git a/pkg/compiler/lib/src/diagnostics/diagnostic_listener.dart b/pkg/compiler/lib/src/diagnostics/diagnostic_listener.dart
new file mode 100644
index 0000000..e4bd449
--- /dev/null
+++ b/pkg/compiler/lib/src/diagnostics/diagnostic_listener.dart
@@ -0,0 +1,106 @@
+// Copyright (c) 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.diagnostic_listener;
+
+import 'source_span.dart' show
+    SourceSpan;
+import 'spannable.dart' show
+    Spannable;
+import '../elements/elements.dart' show
+    Element;
+import 'messages.dart';
+
+class DiagnosticOptions {
+  /// Emit terse diagnostics without howToFix.
+  final bool terseDiagnostics;
+
+  /// If `true`, warnings and hints not from user code are reported.
+  final bool showPackageWarnings;
+
+  /// If `true`, warnings are not reported.
+  final bool suppressWarnings;
+
+  /// If `true`, warnings cause the compilation to fail.
+  final bool fatalWarnings;
+
+  /// If `true`, hints are not reported.
+  final bool suppressHints;
+
+  const DiagnosticOptions({
+    this.suppressWarnings: false,
+    this.fatalWarnings: false,
+    this.suppressHints: false,
+    this.terseDiagnostics: false,
+    this.showPackageWarnings: false});
+}
+
+// TODO(johnniwinther): Rename and cleanup this interface. Add severity enum.
+abstract class DiagnosticReporter {
+  DiagnosticOptions get options => const DiagnosticOptions();
+
+  // TODO(karlklose): rename log to something like reportInfo.
+  void log(message);
+
+  internalError(Spannable spannable, message);
+
+  SourceSpan spanFromSpannable(Spannable node);
+
+  void reportErrorMessage(
+      Spannable spannable,
+      MessageKind messageKind,
+      [Map arguments = const {}]) {
+    reportError(createMessage(spannable, messageKind, arguments));
+  }
+
+  void reportError(
+      DiagnosticMessage message,
+      [List<DiagnosticMessage> infos = const <DiagnosticMessage>[]]);
+
+  void reportWarningMessage(
+      Spannable spannable,
+      MessageKind messageKind,
+      [Map arguments = const {}]) {
+    reportWarning(createMessage(spannable, messageKind, arguments));
+  }
+
+  void reportWarning(
+      DiagnosticMessage message,
+      [List<DiagnosticMessage> infos = const <DiagnosticMessage>[]]);
+
+  void reportHintMessage(
+      Spannable spannable,
+      MessageKind messageKind,
+      [Map arguments = const {}]) {
+    reportHint(createMessage(spannable, messageKind, arguments));
+  }
+
+  void reportHint(
+      DiagnosticMessage message,
+      [List<DiagnosticMessage> infos = const <DiagnosticMessage>[]]);
+
+
+  @deprecated
+  void reportInfo(Spannable node, MessageKind errorCode,
+                  [Map arguments = const {}]);
+
+  // TODO(ahe): We should not expose this here.  Perhaps a
+  // [SourceSpan] should implement [Spannable], and we should have a
+  // way to construct a [SourceSpan] from a [Spannable] and an
+  // [Element].
+  withCurrentElement(Element element, f());
+
+  DiagnosticMessage createMessage(
+      Spannable spannable,
+      MessageKind messageKind,
+      [Map arguments = const {}]);
+}
+
+class DiagnosticMessage {
+  final SourceSpan sourceSpan;
+  final Spannable spannable;
+  final Message message;
+
+  DiagnosticMessage(this.sourceSpan, this.spannable, this.message);
+}
\ No newline at end of file
diff --git a/pkg/compiler/lib/src/diagnostics/invariant.dart b/pkg/compiler/lib/src/diagnostics/invariant.dart
new file mode 100644
index 0000000..b6d4d0f
--- /dev/null
+++ b/pkg/compiler/lib/src/diagnostics/invariant.dart
@@ -0,0 +1,61 @@
+// Copyright (c) 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.diagnostics.invariant;
+
+import 'spannable.dart';
+
+/**
+ * If true, print a warning for each method that was resolved, but not
+ * compiled.
+ */
+const bool REPORT_EXCESS_RESOLUTION = false;
+
+/// Flag that can be used in assertions to assert that a code path is only
+/// executed as part of development.
+///
+/// This flag is automatically set to true if helper methods like, [debugPrint],
+/// [debugWrapPrint], [trace], and [reportHere] are called.
+bool DEBUG_MODE = false;
+
+/// Assert that [DEBUG_MODE] is `true` and provide [message] as part of the
+/// error message.
+assertDebugMode(String message) {
+  assert(invariant(NO_LOCATION_SPANNABLE, DEBUG_MODE,
+      message: 'Debug mode is not enabled: $message'));
+}
+
+/**
+ * Throws a [SpannableAssertionFailure] if [condition] is
+ * [:false:]. [condition] must be either a [:bool:] or a no-arg
+ * function returning a [:bool:].
+ *
+ * Use this method to provide better information for assertion by calling
+ * [invariant] as the argument to an [:assert:] statement:
+ *
+ *     assert(invariant(position, isValid));
+ *
+ * [spannable] must be non-null and will be used to provide positional
+ * information in the generated error message.
+ */
+bool invariant(Spannable spannable, var condition, {var message: null}) {
+  // TODO(johnniwinther): Use [spannable] and [message] to provide better
+  // information on assertion errors.
+  if (spannable == null) {
+    throw new SpannableAssertionFailure(CURRENT_ELEMENT_SPANNABLE,
+        "Spannable was null for invariant. Use CURRENT_ELEMENT_SPANNABLE.");
+  }
+  if (condition is Function){
+    condition = condition();
+  }
+  if (!condition) {
+    if (message is Function) {
+      message = message();
+    }
+    throw new SpannableAssertionFailure(spannable, message);
+  }
+  return true;
+}
+
+typedef void InternalErrorFunction(Spannable location, String message);
diff --git a/pkg/compiler/lib/src/diagnostics/messages.dart b/pkg/compiler/lib/src/diagnostics/messages.dart
new file mode 100644
index 0000000..900ef01
--- /dev/null
+++ b/pkg/compiler/lib/src/diagnostics/messages.dart
@@ -0,0 +1,3558 @@
+// 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.
+
+
+/**
+ * The messages in this file should meet the following guide lines:
+ *
+ * 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 '#{className}' 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 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 for violating the specification.
+ *
+ * Other things to keep in mind:
+ *
+ * An INFO message should always be preceded by a non-INFO message, and the
+ * INFO messages are additional details about the preceding non-INFO
+ * message. For example, consider duplicated elements. First report a WARNING
+ * or ERROR about the duplicated element, and then report an INFO about the
+ * location of the existing element.
+ *
+ * Generally, we want to provide messages that consists of three sentences:
+ * 1. what is wrong, 2. why is it wrong, 3. how do I fix it. However, we
+ * combine the first two in [template] and the last in [howToFix].
+ */
+
+library dart2js.messages;
+
+import '../tokens/token.dart' show
+    ErrorToken,
+    Token;
+
+import 'invariant.dart' show
+    invariant;
+import 'spannable.dart' show
+    CURRENT_ELEMENT_SPANNABLE;
+
+const DONT_KNOW_HOW_TO_FIX = "Computer says no!";
+
+/// Keys for the [MessageTemplate]s.
+enum MessageKind {
+  ABSTRACT_CLASS_INSTANTIATION,
+  ABSTRACT_GETTER,
+  ABSTRACT_METHOD,
+  ABSTRACT_SETTER,
+  ACCESSED_IN_CLOSURE,
+  ACCESSED_IN_CLOSURE_HERE,
+  ADDITIONAL_ARGUMENT,
+  ADDITIONAL_TYPE_ARGUMENT,
+  ALREADY_INITIALIZED,
+  AMBIGUOUS_LOCATION,
+  AMBIGUOUS_REEXPORT,
+  ASSERT_IS_GIVEN_NAMED_ARGUMENTS,
+  ASSIGNING_FINAL_FIELD_IN_SUPER,
+  ASSIGNING_METHOD,
+  ASSIGNING_METHOD_IN_SUPER,
+  ASSIGNING_TYPE,
+  ASYNC_KEYWORD_AS_IDENTIFIER,
+  ASYNC_MODIFIER_ON_ABSTRACT_METHOD,
+  ASYNC_MODIFIER_ON_CONSTRUCTOR,
+  ASYNC_MODIFIER_ON_SETTER,
+  AWAIT_MEMBER_NOT_FOUND,
+  AWAIT_MEMBER_NOT_FOUND_IN_CLOSURE,
+  BAD_INPUT_CHARACTER,
+  BEFORE_TOP_LEVEL,
+  BINARY_OPERATOR_BAD_ARITY,
+  BODY_EXPECTED,
+  CALL_NOT_SUPPORTED_ON_NATIVE_CLASS,
+  CANNOT_EXTEND,
+  CANNOT_EXTEND_ENUM,
+  CANNOT_EXTEND_MALFORMED,
+  CANNOT_FIND_CONSTRUCTOR,
+  CANNOT_IMPLEMENT,
+  CANNOT_IMPLEMENT_ENUM,
+  CANNOT_IMPLEMENT_MALFORMED,
+  CANNOT_INSTANTIATE_ENUM,
+  CANNOT_INSTANTIATE_TYPE_VARIABLE,
+  CANNOT_INSTANTIATE_TYPEDEF,
+  CANNOT_MIXIN,
+  CANNOT_MIXIN_ENUM,
+  CANNOT_MIXIN_MALFORMED,
+  CANNOT_OVERRIDE_FIELD_WITH_METHOD,
+  CANNOT_OVERRIDE_FIELD_WITH_METHOD_CONT,
+  CANNOT_OVERRIDE_GETTER_WITH_METHOD,
+  CANNOT_OVERRIDE_GETTER_WITH_METHOD_CONT,
+  CANNOT_OVERRIDE_METHOD_WITH_FIELD,
+  CANNOT_OVERRIDE_METHOD_WITH_FIELD_CONT,
+  CANNOT_OVERRIDE_METHOD_WITH_GETTER,
+  CANNOT_OVERRIDE_METHOD_WITH_GETTER_CONT,
+  CANNOT_RESOLVE,
+  CANNOT_RESOLVE_AWAIT,
+  CANNOT_RESOLVE_AWAIT_IN_CLOSURE,
+  CANNOT_RESOLVE_CONSTRUCTOR,
+  CANNOT_RESOLVE_CONSTRUCTOR_FOR_IMPLICIT,
+  CANNOT_RESOLVE_GETTER,
+  CANNOT_RESOLVE_IN_INITIALIZER,
+  CANNOT_RESOLVE_SETTER,
+  CANNOT_RESOLVE_TYPE,
+  CANNOT_RETURN_FROM_CONSTRUCTOR,
+  CLASS_NAME_EXPECTED,
+  COMPILER_CRASHED,
+  COMPLEX_RETURNING_NSM,
+  COMPLEX_THROWING_NSM,
+  CONSIDER_ANALYZE_ALL,
+  CONST_CALLS_NON_CONST,
+  CONST_CALLS_NON_CONST_FOR_IMPLICIT,
+  CONST_CONSTRUCTOR_HAS_BODY,
+  CONST_CONSTRUCTOR_WITH_NONFINAL_FIELDS,
+  CONST_CONSTRUCTOR_WITH_NONFINAL_FIELDS_CONSTRUCTOR,
+  CONST_CONSTRUCTOR_WITH_NONFINAL_FIELDS_FIELD,
+  CONST_MAP_KEY_OVERRIDES_EQUALS,
+  CONST_WITHOUT_INITIALIZER,
+  CONSTRUCTOR_CALL_EXPECTED,
+  CONSTRUCTOR_IS_NOT_CONST,
+  CONSTRUCTOR_WITH_RETURN_TYPE,
+  CYCLIC_CLASS_HIERARCHY,
+  CYCLIC_COMPILE_TIME_CONSTANTS,
+  CYCLIC_REDIRECTING_FACTORY,
+  CYCLIC_TYPE_VARIABLE,
+  CYCLIC_TYPEDEF,
+  CYCLIC_TYPEDEF_ONE,
+  DART_EXT_NOT_SUPPORTED,
+  DEFERRED_COMPILE_TIME_CONSTANT,
+  DEFERRED_COMPILE_TIME_CONSTANT_CONSTRUCTION,
+  DEFERRED_LIBRARY_DART_2_DART,
+  DEFERRED_LIBRARY_DUPLICATE_PREFIX,
+  DEFERRED_LIBRARY_WITHOUT_PREFIX,
+  DEFERRED_OLD_SYNTAX,
+  DEFERRED_TYPE_ANNOTATION,
+  DEPRECATED_TYPEDEF_MIXIN_SYNTAX,
+  DIRECTLY_THROWING_NSM,
+  DISALLOWED_LIBRARY_IMPORT,
+  DUPLICATE_DEFINITION,
+  DUPLICATE_EXPORT,
+  DUPLICATE_EXPORT_CONT,
+  DUPLICATE_EXPORT_DECL,
+  DUPLICATE_EXTENDS_IMPLEMENTS,
+  DUPLICATE_IMPLEMENTS,
+  DUPLICATE_IMPORT,
+  DUPLICATE_INITIALIZER,
+  DUPLICATE_LABEL,
+  DUPLICATE_SUPER_INITIALIZER,
+  DUPLICATE_TYPE_VARIABLE_NAME,
+  DUPLICATED_LIBRARY_NAME,
+  DUPLICATED_LIBRARY_RESOURCE,
+  DUPLICATED_PART_OF,
+  DUPLICATED_RESOURCE,
+  EMPTY_CATCH_DECLARATION,
+  EMPTY_ENUM_DECLARATION,
+  EMPTY_HIDE,
+  EQUAL_MAP_ENTRY_KEY,
+  EMPTY_SHOW,
+  EXISTING_DEFINITION,
+  EXISTING_LABEL,
+  EXPECTED_IDENTIFIER_NOT_RESERVED_WORD,
+  EXPERIMENTAL_ASSERT_MESSAGE,
+  EXPONENT_MISSING,
+  EXPORT_BEFORE_PARTS,
+  EXTERNAL_WITH_BODY,
+  EXTRA_CATCH_DECLARATION,
+  EXTRA_FORMALS,
+  EXTRANEOUS_MODIFIER,
+  EXTRANEOUS_MODIFIER_REPLACE,
+  FACTORY_REDIRECTION_IN_NON_FACTORY,
+  FINAL_FUNCTION_TYPE_PARAMETER,
+  FINAL_WITHOUT_INITIALIZER,
+  FORIN_NOT_ASSIGNABLE,
+  FORMAL_DECLARED_CONST,
+  FORMAL_DECLARED_STATIC,
+  FUNCTION_TYPE_FORMAL_WITH_DEFAULT,
+  FUNCTION_WITH_INITIALIZER,
+  GENERIC,
+  GETTER_MISMATCH,
+  GETTER_NOT_FOUND,
+  HEX_DIGIT_EXPECTED,
+  HIDDEN_HINTS,
+  HIDDEN_IMPLICIT_IMPORT,
+  HIDDEN_IMPORT,
+  HIDDEN_WARNINGS,
+  HIDDEN_WARNINGS_HINTS,
+  IF_NULL_ASSIGNING_TYPE,
+  ILLEGAL_CONST_FIELD_MODIFIER,
+  ILLEGAL_CONSTRUCTOR_MODIFIERS,
+  ILLEGAL_FINAL_METHOD_MODIFIER,
+  ILLEGAL_MIXIN_APPLICATION_MODIFIERS,
+  ILLEGAL_MIXIN_CONSTRUCTOR,
+  ILLEGAL_MIXIN_CYCLE,
+  ILLEGAL_MIXIN_OBJECT,
+  ILLEGAL_MIXIN_SUPER_USE,
+  ILLEGAL_MIXIN_SUPERCLASS,
+  ILLEGAL_MIXIN_WITH_SUPER,
+  ILLEGAL_SETTER_FORMALS,
+  ILLEGAL_STATIC,
+  ILLEGAL_SUPER_SEND,
+  IMPORT_BEFORE_PARTS,
+  IMPORT_EXPERIMENTAL_MIRRORS,
+  IMPORT_PART_OF,
+  IMPORTED_HERE,
+  INHERIT_GETTER_AND_METHOD,
+  INHERITED_EXPLICIT_GETTER,
+  INHERITED_IMPLICIT_GETTER,
+  INHERITED_METHOD,
+  INIT_STATIC_FIELD,
+  INITIALIZING_FORMAL_NOT_ALLOWED,
+  INSTANCE_STATIC_SAME_NAME,
+  INSTANCE_STATIC_SAME_NAME_CONT,
+  INTERNAL_LIBRARY,
+  INTERNAL_LIBRARY_FROM,
+  INVALID_ARGUMENT_AFTER_NAMED,
+  INVALID_AWAIT_FOR,
+  INVALID_BREAK,
+  INVALID_CASE_DEFAULT,
+  INVALID_CONSTRUCTOR_ARGUMENTS,
+  INVALID_CONSTRUCTOR_NAME,
+  INVALID_CONTINUE,
+  INVALID_FOR_IN,
+  INVALID_INITIALIZER,
+  INVALID_OVERRIDDEN_FIELD,
+  INVALID_OVERRIDDEN_GETTER,
+  INVALID_OVERRIDDEN_METHOD,
+  INVALID_OVERRIDDEN_SETTER,
+  INVALID_OVERRIDE_FIELD,
+  INVALID_OVERRIDE_FIELD_WITH_GETTER,
+  INVALID_OVERRIDE_FIELD_WITH_SETTER,
+  INVALID_OVERRIDE_GETTER,
+  INVALID_OVERRIDE_GETTER_WITH_FIELD,
+  INVALID_OVERRIDE_METHOD,
+  INVALID_OVERRIDE_SETTER,
+  INVALID_OVERRIDE_SETTER_WITH_FIELD,
+  INVALID_PACKAGE_CONFIG,
+  INVALID_PACKAGE_URI,
+  INVALID_PARAMETER,
+  INVALID_RECEIVER_IN_INITIALIZER,
+  INVALID_SOURCE_FILE_LOCATION,
+  INVALID_SYMBOL,
+  INVALID_SYNC_MODIFIER,
+  INVALID_TYPE_VARIABLE_BOUND,
+  INVALID_UNNAMED_CONSTRUCTOR_NAME,
+  INVALID_URI,
+  INVALID_USE_OF_SUPER,
+  JS_INTEROP_CLASS_CANNOT_EXTEND_DART_CLASS,
+  JS_INTEROP_CLASS_NON_EXTERNAL_MEMBER,
+  JS_OBJECT_LITERAL_CONSTRUCTOR_WITH_POSITIONAL_ARGUMENTS,
+  JS_INTEROP_METHOD_WITH_NAMED_ARGUMENTS,
+  LIBRARY_NAME_MISMATCH,
+  LIBRARY_NOT_FOUND,
+  LIBRARY_NOT_SUPPORTED,
+  LIBRARY_TAG_MUST_BE_FIRST,
+  MAIN_NOT_A_FUNCTION,
+  MAIN_WITH_EXTRA_PARAMETER,
+  MALFORMED_STRING_LITERAL,
+  MEMBER_NOT_FOUND,
+  MEMBER_NOT_STATIC,
+  MEMBER_USES_CLASS_NAME,
+  METHOD_NOT_FOUND,
+  MINUS_OPERATOR_BAD_ARITY,
+  MIRROR_BLOAT,
+  MIRROR_IMPORT,
+  MIRROR_IMPORT_NO_USAGE,
+  MIRRORS_CANNOT_FIND_IN_ELEMENT,
+  MIRRORS_CANNOT_RESOLVE_IN_CURRENT_LIBRARY,
+  MIRRORS_CANNOT_RESOLVE_IN_LIBRARY,
+  MIRRORS_EXPECTED_STRING,
+  MIRRORS_EXPECTED_STRING_OR_LIST,
+  MIRRORS_EXPECTED_STRING_OR_TYPE,
+  MIRRORS_EXPECTED_STRING_TYPE_OR_LIST,
+  MIRRORS_LIBRARY_NOT_SUPPORT_BY_BACKEND,
+  MISSING_ARGUMENT,
+  MISSING_ENUM_CASES,
+  MISSING_FACTORY_KEYWORD,
+  MISSING_FORMALS,
+  MISSING_LIBRARY_NAME,
+  MISSING_MAIN,
+  MISSING_PART_OF_TAG,
+  MISSING_TOKEN_AFTER_THIS,
+  MISSING_TOKEN_BEFORE_THIS,
+  MISSING_TYPE_ARGUMENT,
+  MULTI_INHERITANCE,
+  NAMED_ARGUMENT_NOT_FOUND,
+  NAMED_FUNCTION_EXPRESSION,
+  NAMED_PARAMETER_WITH_EQUALS,
+  NATIVE_NOT_SUPPORTED,
+  NO_BREAK_TARGET,
+  NO_CATCH_NOR_FINALLY,
+  NO_COMMON_SUBTYPES,
+  NO_CONTINUE_TARGET,
+  NO_INSTANCE_AVAILABLE,
+  NO_MATCHING_CONSTRUCTOR,
+  NO_MATCHING_CONSTRUCTOR_FOR_IMPLICIT,
+  NO_STATIC_OVERRIDE,
+  NO_STATIC_OVERRIDE_CONT,
+  NO_SUCH_LIBRARY_MEMBER,
+  NO_SUCH_METHOD_IN_NATIVE,
+  NO_SUCH_SUPER_MEMBER,
+  NO_SUPER_IN_STATIC,
+  NO_THIS_AVAILABLE,
+  NON_CONST_BLOAT,
+  NOT_A_COMPILE_TIME_CONSTANT,
+  NOT_A_FIELD,
+  NOT_A_PREFIX,
+  NOT_A_TYPE,
+  NOT_ASSIGNABLE,
+  NOT_CALLABLE,
+  NOT_INSTANCE_FIELD,
+  NOT_MORE_SPECIFIC,
+  NOT_MORE_SPECIFIC_SUBTYPE,
+  NOT_MORE_SPECIFIC_SUGGESTION,
+  NULL_NOT_ALLOWED,
+  ONLY_ONE_LIBRARY_TAG,
+  OPERATOR_NAMED_PARAMETERS,
+  OPERATOR_NOT_FOUND,
+  OPERATOR_OPTIONAL_PARAMETERS,
+  OPTIONAL_PARAMETER_IN_CATCH,
+  OVERRIDE_EQUALS_NOT_HASH_CODE,
+  PARAMETER_NAME_EXPECTED,
+  PARAMETER_WITH_MODIFIER_IN_CATCH,
+  PARAMETER_WITH_TYPE_IN_CATCH,
+  PATCH_EXTERNAL_WITHOUT_IMPLEMENTATION,
+  PATCH_NO_GETTER,
+  PATCH_NO_SETTER,
+  PATCH_NON_CLASS,
+  PATCH_NON_CONSTRUCTOR,
+  PATCH_NON_EXISTING,
+  PATCH_NON_EXTERNAL,
+  PATCH_NON_FUNCTION,
+  PATCH_NON_GETTER,
+  PATCH_NON_SETTER,
+  PATCH_NONPATCHABLE,
+  PATCH_OPTIONAL_PARAMETER_COUNT_MISMATCH,
+  PATCH_OPTIONAL_PARAMETER_NAMED_MISMATCH,
+  PATCH_PARAMETER_MISMATCH,
+  PATCH_PARAMETER_TYPE_MISMATCH,
+  PATCH_POINT_TO_CLASS,
+  PATCH_POINT_TO_CONSTRUCTOR,
+  PATCH_POINT_TO_FUNCTION,
+  PATCH_POINT_TO_GETTER,
+  PATCH_POINT_TO_PARAMETER,
+  PATCH_POINT_TO_SETTER,
+  PATCH_REQUIRED_PARAMETER_COUNT_MISMATCH,
+  PATCH_RETURN_TYPE_MISMATCH,
+  PLEASE_REPORT_THE_CRASH,
+  POSITIONAL_PARAMETER_WITH_EQUALS,
+  POTENTIAL_MUTATION,
+  POTENTIAL_MUTATION_HERE,
+  POTENTIAL_MUTATION_IN_CLOSURE,
+  POTENTIAL_MUTATION_IN_CLOSURE_HERE,
+  PREAMBLE,
+  PREFIX_AS_EXPRESSION,
+  PRIVATE_ACCESS,
+  PRIVATE_IDENTIFIER,
+  PRIVATE_NAMED_PARAMETER,
+  READ_SCRIPT_ERROR,
+  READ_SELF_ERROR,
+  REDIRECTING_CONSTRUCTOR_CYCLE,
+  REDIRECTING_CONSTRUCTOR_HAS_BODY,
+  REDIRECTING_CONSTRUCTOR_HAS_INITIALIZER,
+  REDIRECTING_FACTORY_WITH_DEFAULT,
+  REFERENCE_IN_INITIALIZATION,
+  REQUIRED_PARAMETER_WITH_DEFAULT,
+  RETURN_IN_GENERATOR,
+  RETURN_NOTHING,
+  RETURN_VALUE_IN_VOID,
+  SETTER_MISMATCH,
+  SETTER_NOT_FOUND,
+  SETTER_NOT_FOUND_IN_SUPER,
+  STATIC_FUNCTION_BLOAT,
+  STRING_EXPECTED,
+  SUPER_INITIALIZER_IN_OBJECT,
+  SWITCH_CASE_FORBIDDEN,
+  SWITCH_CASE_TYPES_NOT_EQUAL,
+  SWITCH_CASE_TYPES_NOT_EQUAL_CASE,
+  SWITCH_CASE_VALUE_OVERRIDES_EQUALS,
+  TERNARY_OPERATOR_BAD_ARITY,
+  THIS_IS_THE_DECLARATION,
+  THIS_IS_THE_METHOD,
+  THIS_IS_THE_PART_OF_TAG,
+  THIS_PROPERTY,
+  THROW_WITHOUT_EXPRESSION,
+  TOP_LEVEL_VARIABLE_DECLARED_STATIC,
+  TYPE_ARGUMENT_COUNT_MISMATCH,
+  TYPE_VARIABLE_IN_CONSTANT,
+  TYPE_VARIABLE_WITHIN_STATIC_MEMBER,
+  TYPEDEF_FORMAL_WITH_DEFAULT,
+  UNARY_OPERATOR_BAD_ARITY,
+  UNBOUND_LABEL,
+  UNIMPLEMENTED_EXPLICIT_GETTER,
+  UNIMPLEMENTED_EXPLICIT_SETTER,
+  UNIMPLEMENTED_GETTER,
+  UNIMPLEMENTED_GETTER_ONE,
+  UNIMPLEMENTED_IMPLICIT_GETTER,
+  UNIMPLEMENTED_IMPLICIT_SETTER,
+  UNIMPLEMENTED_METHOD,
+  UNIMPLEMENTED_METHOD_CONT,
+  UNIMPLEMENTED_METHOD_ONE,
+  UNIMPLEMENTED_SETTER,
+  UNIMPLEMENTED_SETTER_ONE,
+  UNMATCHED_TOKEN,
+  UNRECOGNIZED_VERSION_OF_LOOKUP_MAP,
+  UNSUPPORTED_BANG_EQ_EQ,
+  UNSUPPORTED_EQ_EQ_EQ,
+  UNSUPPORTED_LITERAL_SYMBOL,
+  UNSUPPORTED_PREFIX_PLUS,
+  UNSUPPORTED_THROW_WITHOUT_EXP,
+  UNTERMINATED_COMMENT,
+  UNTERMINATED_STRING,
+  UNTERMINATED_TOKEN,
+  UNUSED_CLASS,
+  UNUSED_LABEL,
+  UNUSED_METHOD,
+  UNUSED_TYPEDEF,
+  VAR_FUNCTION_TYPE_PARAMETER,
+  VOID_EXPRESSION,
+  VOID_NOT_ALLOWED,
+  VOID_VARIABLE,
+  WRONG_ARGUMENT_FOR_JS_INTERCEPTOR_CONSTANT,
+  WRONG_NUMBER_OF_ARGUMENTS_FOR_ASSERT,
+  YIELDING_MODIFIER_ON_ARROW_BODY,
+}
+
+/// A message template for an error, warning, hint or info message generated
+/// by the compiler. Each template is associated with a [MessageKind] that
+/// uniquely identifies the message template.
+// TODO(johnnniwinther): For Infos, consider adding a reference to the
+// error/warning/hint that they belong to.
+class MessageTemplate {
+  final MessageKind kind;
+
+  /// Should describe what is wrong and why.
+  final String template;
+
+  /// Should describe how to fix the problem. Elided when using --terse option.
+  final String howToFix;
+
+  /**
+   *  Examples will be checked by
+   *  tests/compiler/dart2js/message_kind_test.dart.
+   *
+   *  An example is either a String containing the example source code or a Map
+   *  from filenames to source code. In the latter case, the filename for the
+   *  main library code must be 'main.dart'.
+   */
+  final List examples;
+
+  /// Additional options needed for the examples to work.
+  final List<String> options;
+
+  const MessageTemplate(
+      this.kind,
+      this.template,
+      {this.howToFix,
+       this.examples,
+       this.options: const <String>[]});
+
+  /// All templates used by the compiler.
+  ///
+  /// The map is complete mapping from [MessageKind] to their corresponding
+  /// [MessageTemplate].
+  static const Map<MessageKind, MessageTemplate> TEMPLATES =
+    const <MessageKind, MessageTemplate>{
+      /// Do not use this. It is here for legacy and debugging. It violates item
+      /// 4 of the guide lines for error messages in the beginning of the file.
+      MessageKind.GENERIC:
+        const MessageTemplate(MessageKind.GENERIC, '#{text}'),
+
+      MessageKind.NOT_ASSIGNABLE:
+        const MessageTemplate(MessageKind.NOT_ASSIGNABLE,
+          "'#{fromType}' is not assignable to '#{toType}'."),
+
+      MessageKind.FORIN_NOT_ASSIGNABLE:
+        const MessageTemplate(MessageKind.FORIN_NOT_ASSIGNABLE,
+          "The element type '#{currentType}' of '#{expressionType}' "
+          "is not assignable to '#{elementType}'."),
+
+      MessageKind.VOID_EXPRESSION:
+        const MessageTemplate(MessageKind.VOID_EXPRESSION,
+          "Expression does not yield a value."),
+
+      MessageKind.VOID_VARIABLE:
+        const MessageTemplate(MessageKind.VOID_VARIABLE,
+          "Variable cannot be of type void."),
+
+      MessageKind.RETURN_VALUE_IN_VOID:
+        const MessageTemplate(MessageKind.RETURN_VALUE_IN_VOID,
+          "Cannot return value from void function."),
+
+      MessageKind.RETURN_NOTHING:
+        const MessageTemplate(MessageKind.RETURN_NOTHING,
+          "Value of type '#{returnType}' expected."),
+
+      MessageKind.MISSING_ARGUMENT:
+        const MessageTemplate(MessageKind.MISSING_ARGUMENT,
+          "Missing argument of type '#{argumentType}'."),
+
+      MessageKind.ADDITIONAL_ARGUMENT:
+        const MessageTemplate(MessageKind.ADDITIONAL_ARGUMENT,
+          "Additional argument."),
+
+      MessageKind.NAMED_ARGUMENT_NOT_FOUND:
+        const MessageTemplate(MessageKind.NAMED_ARGUMENT_NOT_FOUND,
+          "No named argument '#{argumentName}' found on method."),
+
+      MessageKind.MEMBER_NOT_FOUND:
+        const MessageTemplate(MessageKind.MEMBER_NOT_FOUND,
+          "No member named '#{memberName}' in class '#{className}'."),
+
+      MessageKind.AWAIT_MEMBER_NOT_FOUND:
+        const MessageTemplate(MessageKind.AWAIT_MEMBER_NOT_FOUND,
+          "No member named 'await' in class '#{className}'.",
+          howToFix: "Did you mean to add the 'async' marker "
+                    "to '#{functionName}'?",
+          examples: const ["""
+class A {
+  m() => await -3;
+}
+main() => new A().m();
+"""]),
+
+      MessageKind.AWAIT_MEMBER_NOT_FOUND_IN_CLOSURE:
+        const MessageTemplate(MessageKind.AWAIT_MEMBER_NOT_FOUND_IN_CLOSURE,
+          "No member named 'await' in class '#{className}'.",
+          howToFix: "Did you mean to add the 'async' marker "
+                    "to the enclosing function?",
+          examples: const ["""
+class A {
+  m() => () => await -3;
+}
+main() => new A().m();
+"""]),
+
+      MessageKind.METHOD_NOT_FOUND:
+        const MessageTemplate(MessageKind.METHOD_NOT_FOUND,
+          "No method named '#{memberName}' in class '#{className}'."),
+
+      MessageKind.OPERATOR_NOT_FOUND:
+        const MessageTemplate(MessageKind.OPERATOR_NOT_FOUND,
+          "No operator '#{memberName}' in class '#{className}'."),
+
+      MessageKind.SETTER_NOT_FOUND:
+        const MessageTemplate(MessageKind.SETTER_NOT_FOUND,
+          "No setter named '#{memberName}' in class '#{className}'."),
+
+      MessageKind.SETTER_NOT_FOUND_IN_SUPER:
+        const MessageTemplate(MessageKind.SETTER_NOT_FOUND_IN_SUPER,
+          "No setter named '#{name}' in superclass of '#{className}'."),
+
+      MessageKind.GETTER_NOT_FOUND:
+        const MessageTemplate(MessageKind.GETTER_NOT_FOUND,
+          "No getter named '#{memberName}' in class '#{className}'."),
+
+      MessageKind.NOT_CALLABLE:
+        const MessageTemplate(MessageKind.NOT_CALLABLE,
+          "'#{elementName}' is not callable."),
+
+      MessageKind.MEMBER_NOT_STATIC:
+        const MessageTemplate(MessageKind.MEMBER_NOT_STATIC,
+          "'#{className}.#{memberName}' is not static."),
+
+      MessageKind.NO_INSTANCE_AVAILABLE:
+        const MessageTemplate(MessageKind.NO_INSTANCE_AVAILABLE,
+          "'#{name}' is only available in instance methods."),
+
+      MessageKind.NO_THIS_AVAILABLE:
+        const MessageTemplate(MessageKind.NO_THIS_AVAILABLE,
+          "'this' is only available in instance methods."),
+
+      MessageKind.PRIVATE_ACCESS:
+        const MessageTemplate(MessageKind.PRIVATE_ACCESS,
+          "'#{name}' is declared private within library "
+          "'#{libraryName}'."),
+
+      MessageKind.THIS_IS_THE_DECLARATION:
+        const MessageTemplate(MessageKind.THIS_IS_THE_DECLARATION,
+          "This is the declaration of '#{name}'."),
+
+      MessageKind.THIS_IS_THE_METHOD:
+        const MessageTemplate(MessageKind.THIS_IS_THE_METHOD,
+          "This is the method declaration."),
+
+      MessageKind.CANNOT_RESOLVE:
+        const MessageTemplate(MessageKind.CANNOT_RESOLVE,
+          "Cannot resolve '#{name}'."),
+
+      MessageKind.CANNOT_RESOLVE_AWAIT:
+        const MessageTemplate(MessageKind.CANNOT_RESOLVE_AWAIT,
+          "Cannot resolve '#{name}'.",
+          howToFix: "Did you mean to add the 'async' marker "
+                    "to '#{functionName}'?",
+          examples: const [
+              "main() => await -3;",
+              "foo() => await -3; main() => foo();"
+          ]),
+
+      MessageKind.CANNOT_RESOLVE_AWAIT_IN_CLOSURE:
+        const MessageTemplate(MessageKind.CANNOT_RESOLVE_AWAIT_IN_CLOSURE,
+          "Cannot resolve '#{name}'.",
+          howToFix: "Did you mean to add the 'async' marker "
+                    "to the enclosing function?",
+          examples: const [
+              "main() { (() => await -3)(); }",
+          ]),
+
+      MessageKind.CANNOT_RESOLVE_IN_INITIALIZER:
+        const MessageTemplate(MessageKind.CANNOT_RESOLVE_IN_INITIALIZER,
+          "Cannot resolve '#{name}'. It would be implicitly looked up on this "
+          "instance, but instances are not available in initializers.",
+          howToFix: "Try correcting the unresolved reference or move the "
+              "initialization to a constructor body.",
+          examples: const ["""
+class A {
+  var test = unresolvedName;
+}
+main() => new A();
+"""]),
+
+      MessageKind.CANNOT_RESOLVE_CONSTRUCTOR:
+        const MessageTemplate(MessageKind.CANNOT_RESOLVE_CONSTRUCTOR,
+          "Cannot resolve constructor '#{constructorName}'."),
+
+      MessageKind.CANNOT_RESOLVE_CONSTRUCTOR_FOR_IMPLICIT:
+        const MessageTemplate(
+          MessageKind.CANNOT_RESOLVE_CONSTRUCTOR_FOR_IMPLICIT,
+          "cannot resolve constructor '#{constructorName}' "
+          "for implicit super call.",
+          howToFix: "Try explicitly invoking a constructor of the super class",
+          examples: const ["""
+class A {
+  A.foo() {}
+}
+class B extends A {
+  B();
+}
+main() => new B();
+"""]),
+
+      MessageKind.INVALID_UNNAMED_CONSTRUCTOR_NAME:
+        const MessageTemplate(MessageKind.INVALID_UNNAMED_CONSTRUCTOR_NAME,
+          "Unnamed constructor name must be '#{name}'."),
+
+      MessageKind.INVALID_CONSTRUCTOR_NAME:
+        const MessageTemplate(MessageKind.INVALID_CONSTRUCTOR_NAME,
+          "Constructor name must start with '#{name}'."),
+
+      MessageKind.CANNOT_RESOLVE_TYPE:
+        const MessageTemplate(MessageKind.CANNOT_RESOLVE_TYPE,
+          "Cannot resolve type '#{typeName}'."),
+
+      MessageKind.DUPLICATE_DEFINITION:
+        const MessageTemplate(MessageKind.DUPLICATE_DEFINITION,
+          "Duplicate definition of '#{name}'.",
+          howToFix: "Try to rename or remove this definition.",
+          examples: const ["""
+class C {
+  void f() {}
+  int get f => 1;
+}
+
+main() {
+  new C();
+}
+
+"""]),
+
+      MessageKind.EXISTING_DEFINITION:
+        const MessageTemplate(MessageKind.EXISTING_DEFINITION,
+          "Existing definition of '#{name}'."),
+
+      MessageKind.DUPLICATE_IMPORT:
+        const MessageTemplate(MessageKind.DUPLICATE_IMPORT,
+          "Duplicate import of '#{name}'."),
+
+      MessageKind.HIDDEN_IMPORT:
+        const MessageTemplate(MessageKind.HIDDEN_IMPORT,
+          "'#{name}' from library '#{hiddenUri}' is hidden by '#{name}' "
+          "from library '#{hidingUri}'.",
+          howToFix:
+            "Try adding 'hide #{name}' to the import of '#{hiddenUri}'.",
+          examples: const [
+              const {
+'main.dart':
+"""
+import 'dart:async'; // This imports a class Future.
+import 'future.dart';
+
+void main() => new Future();""",
+
+'future.dart':
+"""
+library future;
+
+class Future {}"""},
+
+          const {
+'main.dart':
+"""
+import 'future.dart';
+import 'dart:async'; // This imports a class Future.
+
+void main() => new Future();""",
+
+'future.dart':
+"""
+library future;
+
+class Future {}"""},
+
+          const {
+'main.dart':
+"""
+import 'export.dart';
+import 'dart:async'; // This imports a class Future.
+
+void main() => new Future();""",
+
+'future.dart':
+"""
+library future;
+
+class Future {}""",
+
+'export.dart':
+"""
+library export;
+
+export 'future.dart';"""},
+
+         const {
+'main.dart':
+"""
+import 'future.dart' as prefix;
+import 'dart:async' as prefix; // This imports a class Future.
+
+void main() => new prefix.Future();""",
+
+'future.dart':
+"""
+library future;
+
+class Future {}"""}]),
+
+
+      MessageKind.HIDDEN_IMPLICIT_IMPORT:
+        const MessageTemplate(MessageKind.HIDDEN_IMPLICIT_IMPORT,
+          "'#{name}' from library '#{hiddenUri}' is hidden by '#{name}' "
+          "from library '#{hidingUri}'.",
+          howToFix: "Try adding an explicit "
+                    "'import \"#{hiddenUri}\" hide #{name}'.",
+          examples: const [
+              const {
+'main.dart':
+"""
+// This hides the implicit import of class Type from dart:core.
+import 'type.dart';
+
+void main() => new Type();""",
+
+'type.dart':
+"""
+library type;
+
+class Type {}"""},
+          const {
+'conflictsWithDart.dart':
+"""
+library conflictsWithDart;
+
+class Duration {
+  static var x = 100;
+}
+""",
+
+'conflictsWithDartAsWell.dart':
+"""
+library conflictsWithDartAsWell;
+
+class Duration {
+  static var x = 100;
+}
+""",
+
+'main.dart':
+r"""
+library testDartConflicts;
+
+import 'conflictsWithDart.dart';
+import 'conflictsWithDartAsWell.dart';
+
+main() {
+  print("Hail Caesar ${Duration.x}");
+}
+"""}]),
+
+      MessageKind.DUPLICATE_EXPORT:
+        const MessageTemplate(MessageKind.DUPLICATE_EXPORT,
+          "Duplicate export of '#{name}'.",
+          howToFix: "Try adding 'hide #{name}' to one of the exports.",
+          examples: const [const {
+'main.dart': """
+export 'decl1.dart';
+export 'decl2.dart';
+
+main() {}""",
+'decl1.dart': "class Class {}",
+'decl2.dart': "class Class {}"}]),
+
+      MessageKind.DUPLICATE_EXPORT_CONT:
+        const MessageTemplate(MessageKind.DUPLICATE_EXPORT_CONT,
+          "This is another export of '#{name}'."),
+
+      MessageKind.DUPLICATE_EXPORT_DECL:
+        const MessageTemplate(MessageKind.DUPLICATE_EXPORT_DECL,
+          "The exported '#{name}' from export #{uriString} is defined here."),
+
+      MessageKind.EMPTY_HIDE:
+        const MessageTemplate(MessageKind.EMPTY_HIDE,
+            "Library '#{uri}' doesn't export a '#{name}' declaration.",
+      howToFix: "Try removing '#{name}' the 'hide' clause.",
+      examples: const [
+        const {
+            'main.dart': """
+import 'dart:core' hide Foo;
+
+main() {}"""},
+        const {
+'main.dart': """
+export 'dart:core' hide Foo;
+
+main() {}"""},
+]),
+
+      MessageKind.EMPTY_SHOW:
+        const MessageTemplate(MessageKind.EMPTY_SHOW,
+            "Library '#{uri}' doesn't export a '#{name}' declaration.",
+      howToFix: "Try removing '#{name}' from the 'show' clause.",
+      examples: const [
+        const {
+            'main.dart': """
+import 'dart:core' show Foo;
+
+main() {}"""},
+        const {
+'main.dart': """
+export 'dart:core' show Foo;
+
+main() {}"""},
+]),
+
+      MessageKind.NOT_A_TYPE:
+        const MessageTemplate(MessageKind.NOT_A_TYPE,
+          "'#{node}' is not a type."),
+
+      MessageKind.NOT_A_PREFIX:
+        const MessageTemplate(MessageKind.NOT_A_PREFIX,
+          "'#{node}' is not a prefix."),
+
+      MessageKind.PREFIX_AS_EXPRESSION:
+        const MessageTemplate(MessageKind.PREFIX_AS_EXPRESSION,
+          "Library prefix '#{prefix}' is not a valid expression."),
+
+      MessageKind.CANNOT_FIND_CONSTRUCTOR:
+        const MessageTemplate(MessageKind.CANNOT_FIND_CONSTRUCTOR,
+          "Cannot find constructor '#{constructorName}'."),
+
+      MessageKind.CYCLIC_CLASS_HIERARCHY:
+        const MessageTemplate(MessageKind.CYCLIC_CLASS_HIERARCHY,
+          "'#{className}' creates a cycle in the class hierarchy."),
+
+      MessageKind.CYCLIC_REDIRECTING_FACTORY:
+        const MessageTemplate(MessageKind.CYCLIC_REDIRECTING_FACTORY,
+          'Redirecting factory leads to a cyclic redirection.'),
+
+      MessageKind.INVALID_RECEIVER_IN_INITIALIZER:
+        const MessageTemplate(MessageKind.INVALID_RECEIVER_IN_INITIALIZER,
+          "Field initializer expected."),
+
+      MessageKind.NO_SUPER_IN_STATIC:
+        const MessageTemplate(MessageKind.NO_SUPER_IN_STATIC,
+          "'super' is only available in instance methods."),
+
+      MessageKind.DUPLICATE_INITIALIZER:
+        const MessageTemplate(MessageKind.DUPLICATE_INITIALIZER,
+          "Field '#{fieldName}' is initialized more than once."),
+
+      MessageKind.ALREADY_INITIALIZED:
+        const MessageTemplate(MessageKind.ALREADY_INITIALIZED,
+          "'#{fieldName}' was already initialized here."),
+
+      MessageKind.INIT_STATIC_FIELD:
+        const MessageTemplate(MessageKind.INIT_STATIC_FIELD,
+          "Cannot initialize static field '#{fieldName}'."),
+
+      MessageKind.NOT_A_FIELD:
+        const MessageTemplate(MessageKind.NOT_A_FIELD,
+          "'#{fieldName}' is not a field."),
+
+      MessageKind.CONSTRUCTOR_CALL_EXPECTED:
+        const MessageTemplate(MessageKind.CONSTRUCTOR_CALL_EXPECTED,
+          "only call to 'this' or 'super' constructor allowed."),
+
+      MessageKind.INVALID_FOR_IN:
+        const MessageTemplate(MessageKind.INVALID_FOR_IN,
+          "Invalid for-in variable declaration."),
+
+      MessageKind.INVALID_INITIALIZER:
+        const MessageTemplate(MessageKind.INVALID_INITIALIZER,
+          "Invalid initializer."),
+
+      MessageKind.FUNCTION_WITH_INITIALIZER:
+        const MessageTemplate(MessageKind.FUNCTION_WITH_INITIALIZER,
+          "Only constructors can have initializers."),
+
+      MessageKind.REDIRECTING_CONSTRUCTOR_CYCLE:
+        const MessageTemplate(MessageKind.REDIRECTING_CONSTRUCTOR_CYCLE,
+          "Cyclic constructor redirection."),
+
+      MessageKind.REDIRECTING_CONSTRUCTOR_HAS_BODY:
+        const MessageTemplate(MessageKind.REDIRECTING_CONSTRUCTOR_HAS_BODY,
+          "Redirecting constructor can't have a body."),
+
+      MessageKind.CONST_CONSTRUCTOR_HAS_BODY:
+        const MessageTemplate(MessageKind.CONST_CONSTRUCTOR_HAS_BODY,
+          "Const constructor or factory can't have a body.",
+          howToFix: "Remove the 'const' keyword or the body",
+          examples: const ["""
+class C {
+  const C() {}
+}
+
+main() => new C();"""]),
+
+      MessageKind.REDIRECTING_CONSTRUCTOR_HAS_INITIALIZER:
+        const MessageTemplate(
+          MessageKind.REDIRECTING_CONSTRUCTOR_HAS_INITIALIZER,
+          "Redirecting constructor cannot have other initializers."),
+
+      MessageKind.SUPER_INITIALIZER_IN_OBJECT:
+        const MessageTemplate(MessageKind.SUPER_INITIALIZER_IN_OBJECT,
+          "'Object' cannot have a super initializer."),
+
+      MessageKind.DUPLICATE_SUPER_INITIALIZER:
+        const MessageTemplate(MessageKind.DUPLICATE_SUPER_INITIALIZER,
+          "Cannot have more than one super initializer."),
+
+      MessageKind.INVALID_CONSTRUCTOR_ARGUMENTS:
+        const MessageTemplate(MessageKind.INVALID_CONSTRUCTOR_ARGUMENTS,
+          "Arguments do not match the expected parameters of constructor "
+          "'#{constructorName}'."),
+
+      MessageKind.NO_MATCHING_CONSTRUCTOR:
+        const MessageTemplate(MessageKind.NO_MATCHING_CONSTRUCTOR,
+          "'super' call arguments and constructor parameters do not match."),
+
+      MessageKind.NO_MATCHING_CONSTRUCTOR_FOR_IMPLICIT:
+        const MessageTemplate(MessageKind.NO_MATCHING_CONSTRUCTOR_FOR_IMPLICIT,
+              "Implicit 'super' call arguments and constructor parameters "
+              "do not match."),
+
+      MessageKind.CONST_CALLS_NON_CONST:
+        const MessageTemplate(MessageKind.CONST_CALLS_NON_CONST,
+          "'const' constructor cannot call a non-const constructor."),
+
+      MessageKind.CONST_CALLS_NON_CONST_FOR_IMPLICIT:
+        const MessageTemplate(MessageKind.CONST_CALLS_NON_CONST_FOR_IMPLICIT,
+              "'const' constructor cannot call a non-const constructor. "
+              "This constructor has an implicit call to a "
+              "super non-const constructor.",
+              howToFix: "Try making the super constructor const.",
+              examples: const ["""
+class C {
+  C(); // missing const
+}
+class D extends C {
+  final d;
+  const D(this.d);
+}
+main() => new D(0);"""]),
+
+      MessageKind.CONST_CONSTRUCTOR_WITH_NONFINAL_FIELDS:
+        const MessageTemplate(
+          MessageKind.CONST_CONSTRUCTOR_WITH_NONFINAL_FIELDS,
+          "Can't declare constructor 'const' on class #{className} "
+          "because the class contains non-final instance fields.",
+          howToFix: "Try making all fields final.",
+          examples: const ["""
+class C {
+  // 'a' must be declared final to allow for the const constructor.
+  var a;
+  const C(this.a);
+}
+
+main() => new C(0);"""]),
+
+      MessageKind.CONST_CONSTRUCTOR_WITH_NONFINAL_FIELDS_FIELD:
+        const MessageTemplate(
+          MessageKind.CONST_CONSTRUCTOR_WITH_NONFINAL_FIELDS_FIELD,
+          "This non-final field prevents using const constructors."),
+
+      MessageKind.CONST_CONSTRUCTOR_WITH_NONFINAL_FIELDS_CONSTRUCTOR:
+        const MessageTemplate(
+          MessageKind.CONST_CONSTRUCTOR_WITH_NONFINAL_FIELDS_CONSTRUCTOR,
+          "This const constructor is not allowed due to "
+          "non-final fields."),
+
+
+      MessageKind.INITIALIZING_FORMAL_NOT_ALLOWED:
+        const MessageTemplate(MessageKind.INITIALIZING_FORMAL_NOT_ALLOWED,
+          "Initializing formal parameter only allowed in generative "
+          "constructor."),
+
+      MessageKind.INVALID_PARAMETER:
+        const MessageTemplate(MessageKind.INVALID_PARAMETER,
+          "Cannot resolve parameter."),
+
+      MessageKind.NOT_INSTANCE_FIELD:
+        const MessageTemplate(MessageKind.NOT_INSTANCE_FIELD,
+          "'#{fieldName}' is not an instance field."),
+
+      MessageKind.THIS_PROPERTY:
+        const MessageTemplate(MessageKind.THIS_PROPERTY,
+          "Expected an identifier."),
+
+      MessageKind.NO_CATCH_NOR_FINALLY:
+        const MessageTemplate(MessageKind.NO_CATCH_NOR_FINALLY,
+          "Expected 'catch' or 'finally'."),
+
+      MessageKind.EMPTY_CATCH_DECLARATION:
+        const MessageTemplate(MessageKind.EMPTY_CATCH_DECLARATION,
+          "Expected an identifier in catch declaration."),
+
+      MessageKind.EXTRA_CATCH_DECLARATION:
+        const MessageTemplate(MessageKind.EXTRA_CATCH_DECLARATION,
+          "Extra parameter in catch declaration."),
+
+      MessageKind.PARAMETER_WITH_TYPE_IN_CATCH:
+        const MessageTemplate(MessageKind.PARAMETER_WITH_TYPE_IN_CATCH,
+          "Cannot use type annotations in catch."),
+
+      MessageKind.PARAMETER_WITH_MODIFIER_IN_CATCH:
+        const MessageTemplate(MessageKind.PARAMETER_WITH_MODIFIER_IN_CATCH,
+          "Cannot use modifiers in catch."),
+
+      MessageKind.OPTIONAL_PARAMETER_IN_CATCH:
+        const MessageTemplate(MessageKind.OPTIONAL_PARAMETER_IN_CATCH,
+          "Cannot use optional parameters in catch."),
+
+      MessageKind.THROW_WITHOUT_EXPRESSION:
+        const MessageTemplate(MessageKind.THROW_WITHOUT_EXPRESSION,
+          "Cannot use re-throw outside of catch block "
+          "(expression expected after 'throw')."),
+
+      MessageKind.UNBOUND_LABEL:
+        const MessageTemplate(MessageKind.UNBOUND_LABEL,
+          "Cannot resolve label '#{labelName}'."),
+
+      MessageKind.NO_BREAK_TARGET:
+        const MessageTemplate(MessageKind.NO_BREAK_TARGET,
+          "'break' statement not inside switch or loop."),
+
+      MessageKind.NO_CONTINUE_TARGET:
+        const MessageTemplate(MessageKind.NO_CONTINUE_TARGET,
+          "'continue' statement not inside loop."),
+
+      MessageKind.EXISTING_LABEL:
+        const MessageTemplate(MessageKind.EXISTING_LABEL,
+          "Original declaration of duplicate label '#{labelName}'."),
+
+      MessageKind.DUPLICATE_LABEL:
+        const MessageTemplate(MessageKind.DUPLICATE_LABEL,
+          "Duplicate declaration of label '#{labelName}'."),
+
+      MessageKind.UNUSED_LABEL:
+        const MessageTemplate(MessageKind.UNUSED_LABEL,
+          "Unused label '#{labelName}'."),
+
+      MessageKind.INVALID_CONTINUE:
+        const MessageTemplate(MessageKind.INVALID_CONTINUE,
+          "Target of continue is not a loop or switch case."),
+
+      MessageKind.INVALID_BREAK:
+        const MessageTemplate(MessageKind.INVALID_BREAK,
+          "Target of break is not a statement."),
+
+      MessageKind.DUPLICATE_TYPE_VARIABLE_NAME:
+        const MessageTemplate(MessageKind.DUPLICATE_TYPE_VARIABLE_NAME,
+          "Type variable '#{typeVariableName}' already declared."),
+
+      MessageKind.TYPE_VARIABLE_WITHIN_STATIC_MEMBER:
+        const MessageTemplate(MessageKind.TYPE_VARIABLE_WITHIN_STATIC_MEMBER,
+              "Cannot refer to type variable '#{typeVariableName}' "
+              "within a static member."),
+
+      MessageKind.TYPE_VARIABLE_IN_CONSTANT:
+        const MessageTemplate(MessageKind.TYPE_VARIABLE_IN_CONSTANT,
+          "Constant expressions can't refer to type variables.",
+          howToFix: "Try removing the type variable or replacing it with a "
+                    "concrete type.",
+          examples: const ["""
+class C<T> {
+  const C();
+
+  m(T t) => const C<T>();
+}
+
+void main() => new C().m(null);
+"""
+]),
+
+      MessageKind.INVALID_TYPE_VARIABLE_BOUND:
+        const MessageTemplate(MessageKind.INVALID_TYPE_VARIABLE_BOUND,
+          "'#{typeArgument}' is not a subtype of bound '#{bound}' for "
+          "type variable '#{typeVariable}' of type '#{thisType}'.",
+          howToFix: "Try to change or remove the type argument.",
+          examples: const ["""
+class C<T extends num> {}
+
+// 'String' is not a valid instantiation of T with bound num.'.
+main() => new C<String>();
+"""]),
+
+      MessageKind.INVALID_USE_OF_SUPER:
+        const MessageTemplate(MessageKind.INVALID_USE_OF_SUPER,
+          "'super' not allowed here."),
+
+      MessageKind.INVALID_CASE_DEFAULT:
+        const MessageTemplate(MessageKind.INVALID_CASE_DEFAULT,
+          "'default' only allowed on last case of a switch."),
+
+      MessageKind.SWITCH_CASE_TYPES_NOT_EQUAL:
+        const MessageTemplate(MessageKind.SWITCH_CASE_TYPES_NOT_EQUAL,
+          "'case' expressions do not all have type '#{type}'."),
+
+      MessageKind.SWITCH_CASE_TYPES_NOT_EQUAL_CASE:
+        const MessageTemplate(MessageKind.SWITCH_CASE_TYPES_NOT_EQUAL_CASE,
+          "'case' expression of type '#{type}'."),
+
+      MessageKind.SWITCH_CASE_FORBIDDEN:
+        const MessageTemplate(MessageKind.SWITCH_CASE_FORBIDDEN,
+          "'case' expression may not be of type '#{type}'."),
+
+      MessageKind.SWITCH_CASE_VALUE_OVERRIDES_EQUALS:
+        const MessageTemplate(MessageKind.SWITCH_CASE_VALUE_OVERRIDES_EQUALS,
+              "'case' expression type '#{type}' overrides 'operator =='."),
+
+      MessageKind.INVALID_ARGUMENT_AFTER_NAMED:
+        const MessageTemplate(MessageKind.INVALID_ARGUMENT_AFTER_NAMED,
+          "Unnamed argument after named argument."),
+
+      MessageKind.NOT_A_COMPILE_TIME_CONSTANT:
+        const MessageTemplate(MessageKind.NOT_A_COMPILE_TIME_CONSTANT,
+          "Not a compile-time constant."),
+
+      MessageKind.DEFERRED_COMPILE_TIME_CONSTANT:
+        const MessageTemplate(MessageKind.DEFERRED_COMPILE_TIME_CONSTANT,
+          "A deferred value cannot be used as a compile-time constant."),
+
+      MessageKind.DEFERRED_COMPILE_TIME_CONSTANT_CONSTRUCTION:
+        const MessageTemplate(
+          MessageKind.DEFERRED_COMPILE_TIME_CONSTANT_CONSTRUCTION,
+          "A deferred class cannot be used to create a "
+          "compile-time constant."),
+
+      MessageKind.CYCLIC_COMPILE_TIME_CONSTANTS:
+        const MessageTemplate(MessageKind.CYCLIC_COMPILE_TIME_CONSTANTS,
+          "Cycle in the compile-time constant computation."),
+
+      MessageKind.CONSTRUCTOR_IS_NOT_CONST:
+        const MessageTemplate(MessageKind.CONSTRUCTOR_IS_NOT_CONST,
+          "Constructor is not a 'const' constructor."),
+
+      MessageKind.CONST_MAP_KEY_OVERRIDES_EQUALS:
+        const MessageTemplate(MessageKind.CONST_MAP_KEY_OVERRIDES_EQUALS,
+              "Const-map key type '#{type}' overrides 'operator =='."),
+
+      MessageKind.NO_SUCH_LIBRARY_MEMBER:
+        const MessageTemplate(MessageKind.NO_SUCH_LIBRARY_MEMBER,
+          "'#{libraryName}' has no member named '#{memberName}'."),
+
+      MessageKind.CANNOT_INSTANTIATE_TYPEDEF:
+        const MessageTemplate(MessageKind.CANNOT_INSTANTIATE_TYPEDEF,
+          "Cannot instantiate typedef '#{typedefName}'."),
+
+      MessageKind.REQUIRED_PARAMETER_WITH_DEFAULT:
+        const MessageTemplate(MessageKind.REQUIRED_PARAMETER_WITH_DEFAULT,
+          "Non-optional parameters can't have a default value.",
+          howToFix:
+            "Try removing the default value or making the parameter optional.",
+          examples: const ["""
+main() {
+  foo(a: 1) => print(a);
+  foo(2);
+}""", """
+main() {
+  foo(a = 1) => print(a);
+  foo(2);
+}"""]),
+
+      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 "
+          "default value.",
+          howToFix: "Try replacing ':' with '='.",
+          examples: const ["""
+main() {
+  foo([a: 1]) => print(a);
+  foo(2);
+}"""]),
+
+      MessageKind.TYPEDEF_FORMAL_WITH_DEFAULT:
+        const MessageTemplate(MessageKind.TYPEDEF_FORMAL_WITH_DEFAULT,
+          "A parameter of a typedef can't specify a default value.",
+          howToFix:
+            "Try removing the default value.",
+          examples: const ["""
+typedef void F([int arg = 0]);
+
+main() {
+  F f;
+}""", """
+typedef void F({int arg: 0});
+
+main() {
+  F f;
+}"""]),
+
+      MessageKind.FUNCTION_TYPE_FORMAL_WITH_DEFAULT:
+        const MessageTemplate(MessageKind.FUNCTION_TYPE_FORMAL_WITH_DEFAULT,
+          "A function type parameter can't specify a default value.",
+          howToFix:
+            "Try removing the default value.",
+          examples: const ["""
+foo(f(int i, [a = 1])) {}
+
+main() {
+  foo(1, 2);
+}""", """
+foo(f(int i, {a: 1})) {}
+
+main() {
+  foo(1, a: 2);
+}"""]),
+
+      MessageKind.REDIRECTING_FACTORY_WITH_DEFAULT:
+        const MessageTemplate(MessageKind.REDIRECTING_FACTORY_WITH_DEFAULT,
+          "A parameter of a redirecting factory constructor can't specify a "
+          "default value.",
+          howToFix:
+            "Try removing the default value.",
+          examples: const ["""
+class A {
+  A([a]);
+  factory A.foo([a = 1]) = A;
+}
+
+main() {
+  new A.foo(1);
+}""", """
+class A {
+  A({a});
+  factory A.foo({a: 1}) = A;
+}
+
+main() {
+  new A.foo(a: 1);
+}"""]),
+
+      MessageKind.FORMAL_DECLARED_CONST:
+        const MessageTemplate(MessageKind.FORMAL_DECLARED_CONST,
+          "A formal parameter can't be declared const.",
+          howToFix: "Try removing 'const'.",
+          examples: const ["""
+foo(const x) {}
+main() => foo(42);
+""", """
+foo({const x}) {}
+main() => foo(42);
+""", """
+foo([const x]) {}
+main() => foo(42);
+"""]),
+
+      MessageKind.FORMAL_DECLARED_STATIC:
+        const MessageTemplate(MessageKind.FORMAL_DECLARED_STATIC,
+          "A formal parameter can't be declared static.",
+          howToFix: "Try removing 'static'.",
+          examples: const ["""
+foo(static x) {}
+main() => foo(42);
+""", """
+foo({static x}) {}
+main() => foo(42);
+""", """
+foo([static x]) {}
+main() => foo(42);
+"""]),
+
+      MessageKind.FINAL_FUNCTION_TYPE_PARAMETER:
+        const MessageTemplate(MessageKind.FINAL_FUNCTION_TYPE_PARAMETER,
+          "A function type parameter can't be declared final.",
+          howToFix: "Try removing 'final'.",
+          examples: const ["""
+foo(final int x(int a)) {}
+main() => foo((y) => 42);
+""", """
+foo({final int x(int a)}) {}
+main() => foo((y) => 42);
+""", """
+foo([final int x(int a)]) {}
+main() => foo((y) => 42);
+"""]),
+
+      MessageKind.VAR_FUNCTION_TYPE_PARAMETER:
+        const MessageTemplate(MessageKind.VAR_FUNCTION_TYPE_PARAMETER,
+          "A function type parameter can't be declared with 'var'.",
+          howToFix: "Try removing 'var'.",
+          examples: const ["""
+foo(var int x(int a)) {}
+main() => foo((y) => 42);
+""", """
+foo({var int x(int a)}) {}
+main() => foo((y) => 42);
+""", """
+foo([var int x(int a)]) {}
+main() => foo((y) => 42);
+"""]),
+
+      MessageKind.CANNOT_INSTANTIATE_TYPE_VARIABLE:
+        const MessageTemplate(MessageKind.CANNOT_INSTANTIATE_TYPE_VARIABLE,
+          "Cannot instantiate type variable '#{typeVariableName}'."),
+
+      MessageKind.CYCLIC_TYPE_VARIABLE:
+        const MessageTemplate(MessageKind.CYCLIC_TYPE_VARIABLE,
+          "Type variable '#{typeVariableName}' is a supertype of itself."),
+
+      MessageKind.CYCLIC_TYPEDEF:
+        const MessageTemplate(MessageKind.CYCLIC_TYPEDEF,
+          "A typedef can't refer to itself.",
+          howToFix: "Try removing all references to '#{typedefName}' "
+                    "in the definition of '#{typedefName}'.",
+          examples: const ["""
+typedef F F(); // The return type 'F' is a self-reference.
+main() { F f = null; }"""]),
+
+      MessageKind.CYCLIC_TYPEDEF_ONE:
+        const MessageTemplate(MessageKind.CYCLIC_TYPEDEF_ONE,
+          "A typedef can't refer to itself through another typedef.",
+          howToFix:
+            "Try removing all references to "
+            "'#{otherTypedefName}' in the definition of '#{typedefName}'.",
+          examples: const ["""
+typedef G F(); // The return type 'G' is a self-reference through typedef 'G'.
+typedef F G(); // The return type 'F' is a self-reference through typedef 'F'.
+main() { F f = null; }""",
+"""
+typedef G F(); // The return type 'G' creates a self-reference.
+typedef H G(); // The return type 'H' creates a self-reference.
+typedef H(F f); // The argument type 'F' creates a self-reference.
+main() { F f = null; }"""]),
+
+      MessageKind.CLASS_NAME_EXPECTED:
+        const MessageTemplate(MessageKind.CLASS_NAME_EXPECTED,
+          "Class name expected."),
+
+      MessageKind.CANNOT_EXTEND:
+        const MessageTemplate(MessageKind.CANNOT_EXTEND,
+          "'#{type}' cannot be extended."),
+
+      MessageKind.CANNOT_IMPLEMENT:
+        const MessageTemplate(MessageKind.CANNOT_IMPLEMENT,
+          "'#{type}' cannot be implemented."),
+
+      // TODO(johnnwinther): Split messages into reasons for malformedness.
+      MessageKind.CANNOT_EXTEND_MALFORMED:
+        const MessageTemplate(MessageKind.CANNOT_EXTEND_MALFORMED,
+          "Class '#{className}' can't extend the type '#{malformedType}' "
+          "because it is malformed.",
+          howToFix:
+            "Try correcting the malformed type annotation or removing the "
+            "'extends' clause.",
+          examples: const ["""
+class A extends Malformed {}
+main() => new A();"""]),
+
+      MessageKind.CANNOT_IMPLEMENT_MALFORMED:
+        const MessageTemplate(MessageKind.CANNOT_IMPLEMENT_MALFORMED,
+          "Class '#{className}' can't implement the type '#{malformedType}' "
+          "because it is malformed.",
+          howToFix:
+            "Try correcting the malformed type annotation or removing the "
+            "type from the 'implements' clause.",
+          examples: const ["""
+class A implements Malformed {}
+main() => new A();"""]),
+
+      MessageKind.CANNOT_MIXIN_MALFORMED:
+        const MessageTemplate(MessageKind.CANNOT_MIXIN_MALFORMED,
+          "Class '#{className}' can't mixin the type '#{malformedType}' "
+          "because it is malformed.",
+          howToFix:
+            "Try correcting the malformed type annotation or removing the "
+            "type from the 'with' clause.",
+          examples: const ["""
+class A extends Object with Malformed {}
+main() => new A();"""]),
+
+      MessageKind.CANNOT_MIXIN:
+        const MessageTemplate(MessageKind.CANNOT_MIXIN,
+          "The type '#{type}' can't be mixed in.",
+          howToFix: "Try removing '#{type}' from the 'with' clause.",
+          examples: const ["""
+class C extends Object with String {}
+
+main() => new C();
+""", """
+typedef C = Object with String;
+
+main() => new C();
+"""]),
+
+      MessageKind.CANNOT_EXTEND_ENUM:
+        const MessageTemplate(MessageKind.CANNOT_EXTEND_ENUM,
+          "Class '#{className}' can't extend the type '#{enumType}' because "
+          "it is declared by an enum.",
+          howToFix: "Try making '#{enumType}' a normal class or removing the "
+            "'extends' clause.",
+          examples: const ["""
+enum Enum { A }
+class B extends Enum {}
+main() => new B();"""]),
+
+      MessageKind.CANNOT_IMPLEMENT_ENUM:
+        const MessageTemplate(MessageKind.CANNOT_IMPLEMENT_ENUM,
+          "Class '#{className}' can't implement the type '#{enumType}' "
+          "because it is declared by an enum.",
+          howToFix: "Try making '#{enumType}' a normal class or removing the "
+            "type from the 'implements' clause.",
+          examples: const ["""
+enum Enum { A }
+class B implements Enum {}
+main() => new B();"""]),
+
+      MessageKind.CANNOT_MIXIN_ENUM:
+        const MessageTemplate(MessageKind.CANNOT_MIXIN_ENUM,
+          "Class '#{className}' can't mixin the type '#{enumType}' because it "
+          "is declared by an enum.",
+          howToFix: "Try making '#{enumType}' a normal class or removing the "
+            "type from the 'with' clause.",
+          examples: const ["""
+enum Enum { A }
+class B extends Object with Enum {}
+main() => new B();"""]),
+
+      MessageKind.CANNOT_INSTANTIATE_ENUM:
+        const MessageTemplate(MessageKind.CANNOT_INSTANTIATE_ENUM,
+          "Enum type '#{enumName}' cannot be instantiated.",
+          howToFix: "Try making '#{enumType}' a normal class or use an enum "
+                    "constant.",
+          examples: const ["""
+enum Enum { A }
+main() => new Enum(0);""", """
+enum Enum { A }
+main() => const Enum(0);"""]),
+
+      MessageKind.EMPTY_ENUM_DECLARATION:
+        const MessageTemplate(MessageKind.EMPTY_ENUM_DECLARATION,
+          "Enum '#{enumName}' must contain at least one value.",
+          howToFix: "Try adding an enum constant or making #{enumName} a "
+                    "normal class.",
+          examples: const ["""
+enum Enum {}
+main() { Enum e; }"""]),
+
+      MessageKind.MISSING_ENUM_CASES:
+        const MessageTemplate(MessageKind.MISSING_ENUM_CASES,
+          "Missing enum constants in switch statement: #{enumValues}.",
+          howToFix: "Try adding the missing constants or a default case.",
+          examples: const ["""
+enum Enum { A, B }
+main() {
+  switch (Enum.A) {
+  case Enum.B: break;
+  }
+}""", """
+enum Enum { A, B, C }
+main() {
+  switch (Enum.A) {
+  case Enum.B: break;
+  }
+}"""]),
+
+      MessageKind.DUPLICATE_EXTENDS_IMPLEMENTS:
+        const MessageTemplate(MessageKind.DUPLICATE_EXTENDS_IMPLEMENTS,
+          "'#{type}' can not be both extended and implemented."),
+
+      MessageKind.DUPLICATE_IMPLEMENTS:
+        const MessageTemplate(MessageKind.DUPLICATE_IMPLEMENTS,
+          "'#{type}' must not occur more than once "
+          "in the implements clause."),
+
+      MessageKind.MULTI_INHERITANCE:
+        const MessageTemplate(MessageKind.MULTI_INHERITANCE,
+          "Dart2js does not currently support inheritance of the same class "
+          "with different type arguments: Both #{firstType} and #{secondType} "
+          "are supertypes of #{thisType}."),
+
+      MessageKind.ILLEGAL_SUPER_SEND:
+        const MessageTemplate(MessageKind.ILLEGAL_SUPER_SEND,
+          "'#{name}' cannot be called on super."),
+
+      MessageKind.NO_SUCH_SUPER_MEMBER:
+        const MessageTemplate(MessageKind.NO_SUCH_SUPER_MEMBER,
+          "Cannot resolve '#{memberName}' in a superclass of '#{className}'."),
+
+      MessageKind.ADDITIONAL_TYPE_ARGUMENT:
+        const MessageTemplate(MessageKind.ADDITIONAL_TYPE_ARGUMENT,
+          "Additional type argument."),
+
+      MessageKind.MISSING_TYPE_ARGUMENT:
+        const MessageTemplate(MessageKind.MISSING_TYPE_ARGUMENT,
+          "Missing type argument."),
+
+      // TODO(johnniwinther): Use ADDITIONAL_TYPE_ARGUMENT or
+      // MISSING_TYPE_ARGUMENT instead.
+      MessageKind.TYPE_ARGUMENT_COUNT_MISMATCH:
+        const MessageTemplate(MessageKind.TYPE_ARGUMENT_COUNT_MISMATCH,
+          "Incorrect number of type arguments on '#{type}'."),
+
+      MessageKind.GETTER_MISMATCH:
+        const MessageTemplate(MessageKind.GETTER_MISMATCH,
+          "Setter disagrees on: '#{modifiers}'."),
+
+      MessageKind.SETTER_MISMATCH:
+        const MessageTemplate(MessageKind.SETTER_MISMATCH,
+          "Getter disagrees on: '#{modifiers}'."),
+
+      MessageKind.ILLEGAL_SETTER_FORMALS:
+        const MessageTemplate(MessageKind.ILLEGAL_SETTER_FORMALS,
+          "A setter must have exactly one argument."),
+
+      MessageKind.NO_STATIC_OVERRIDE:
+        const MessageTemplate(MessageKind.NO_STATIC_OVERRIDE,
+          "Static member cannot override instance member '#{memberName}' of "
+          "'#{className}'."),
+
+      MessageKind.NO_STATIC_OVERRIDE_CONT:
+        const MessageTemplate(MessageKind.NO_STATIC_OVERRIDE_CONT,
+          "This is the instance member that cannot be overridden "
+          "by a static member."),
+
+      MessageKind.INSTANCE_STATIC_SAME_NAME:
+        const MessageTemplate(MessageKind.INSTANCE_STATIC_SAME_NAME,
+          "Instance member '#{memberName}' and static member of "
+          "superclass '#{className}' have the same name."),
+
+      MessageKind.INSTANCE_STATIC_SAME_NAME_CONT:
+        const MessageTemplate(MessageKind.INSTANCE_STATIC_SAME_NAME_CONT,
+          "This is the static member with the same name."),
+
+      MessageKind.INVALID_OVERRIDE_METHOD:
+        const MessageTemplate(MessageKind.INVALID_OVERRIDE_METHOD,
+          "The type '#{declaredType}' of method '#{name}' declared in "
+          "'#{class}' is not a subtype of the overridden method type "
+          "'#{inheritedType}' inherited from '#{inheritedClass}'."),
+
+      MessageKind.INVALID_OVERRIDDEN_METHOD:
+        const MessageTemplate(MessageKind.INVALID_OVERRIDDEN_METHOD,
+          "This is the overridden method '#{name}' declared in class "
+          "'#{class}'."),
+
+      MessageKind.INVALID_OVERRIDE_GETTER:
+        const MessageTemplate(MessageKind.INVALID_OVERRIDE_GETTER,
+          "The type '#{declaredType}' of getter '#{name}' declared in "
+          "'#{class}' is not assignable to the type '#{inheritedType}' of the "
+          "overridden getter inherited from '#{inheritedClass}'."),
+
+      MessageKind.INVALID_OVERRIDDEN_GETTER:
+        const MessageTemplate(MessageKind.INVALID_OVERRIDDEN_GETTER,
+          "This is the overridden getter '#{name}' declared in class "
+          "'#{class}'."),
+
+      MessageKind.INVALID_OVERRIDE_GETTER_WITH_FIELD:
+        const MessageTemplate(MessageKind.INVALID_OVERRIDE_GETTER_WITH_FIELD,
+          "The type '#{declaredType}' of field '#{name}' declared in "
+          "'#{class}' is not assignable to the type '#{inheritedType}' of the "
+          "overridden getter inherited from '#{inheritedClass}'."),
+
+      MessageKind.INVALID_OVERRIDE_FIELD_WITH_GETTER:
+        const MessageTemplate(MessageKind.INVALID_OVERRIDE_FIELD_WITH_GETTER,
+          "The type '#{declaredType}' of getter '#{name}' declared in "
+          "'#{class}' is not assignable to the type '#{inheritedType}' of the "
+          "overridden field inherited from '#{inheritedClass}'."),
+
+      MessageKind.INVALID_OVERRIDE_SETTER:
+        const MessageTemplate(MessageKind.INVALID_OVERRIDE_SETTER,
+          "The type '#{declaredType}' of setter '#{name}' declared in "
+          "'#{class}' is not assignable to the type '#{inheritedType}' of the "
+          "overridden setter inherited from '#{inheritedClass}'."),
+
+      MessageKind.INVALID_OVERRIDDEN_SETTER:
+        const MessageTemplate(MessageKind.INVALID_OVERRIDDEN_SETTER,
+          "This is the overridden setter '#{name}' declared in class "
+          "'#{class}'."),
+
+      MessageKind.INVALID_OVERRIDE_SETTER_WITH_FIELD:
+        const MessageTemplate(MessageKind.INVALID_OVERRIDE_SETTER_WITH_FIELD,
+          "The type '#{declaredType}' of field '#{name}' declared in "
+          "'#{class}' is not assignable to the type '#{inheritedType}' of the "
+          "overridden setter inherited from '#{inheritedClass}'."),
+
+      MessageKind.INVALID_OVERRIDE_FIELD_WITH_SETTER:
+        const MessageTemplate(MessageKind.INVALID_OVERRIDE_FIELD_WITH_SETTER,
+          "The type '#{declaredType}' of setter '#{name}' declared in "
+          "'#{class}' is not assignable to the type '#{inheritedType}' of the "
+          "overridden field inherited from '#{inheritedClass}'."),
+
+      MessageKind.INVALID_OVERRIDE_FIELD:
+        const MessageTemplate(MessageKind.INVALID_OVERRIDE_FIELD,
+          "The type '#{declaredType}' of field '#{name}' declared in "
+          "'#{class}' is not assignable to the type '#{inheritedType}' of the "
+          "overridden field inherited from '#{inheritedClass}'."),
+
+      MessageKind.INVALID_OVERRIDDEN_FIELD:
+        const MessageTemplate(MessageKind.INVALID_OVERRIDDEN_FIELD,
+          "This is the overridden field '#{name}' declared in class "
+          "'#{class}'."),
+
+      MessageKind.CANNOT_OVERRIDE_FIELD_WITH_METHOD:
+        const MessageTemplate(MessageKind.CANNOT_OVERRIDE_FIELD_WITH_METHOD,
+          "Method '#{name}' in '#{class}' can't override field from "
+          "'#{inheritedClass}'."),
+
+      MessageKind.CANNOT_OVERRIDE_FIELD_WITH_METHOD_CONT:
+        const MessageTemplate(
+          MessageKind.CANNOT_OVERRIDE_FIELD_WITH_METHOD_CONT,
+          "This is the field that cannot be overridden by a method."),
+
+      MessageKind.CANNOT_OVERRIDE_METHOD_WITH_FIELD:
+        const MessageTemplate(
+          MessageKind.CANNOT_OVERRIDE_METHOD_WITH_FIELD,
+          "Field '#{name}' in '#{class}' can't override method from "
+          "'#{inheritedClass}'."),
+
+      MessageKind.CANNOT_OVERRIDE_METHOD_WITH_FIELD_CONT:
+        const MessageTemplate(
+          MessageKind.CANNOT_OVERRIDE_METHOD_WITH_FIELD_CONT,
+          "This is the method that cannot be overridden by a field."),
+
+      MessageKind.CANNOT_OVERRIDE_GETTER_WITH_METHOD:
+        const MessageTemplate(MessageKind.CANNOT_OVERRIDE_GETTER_WITH_METHOD,
+              "Method '#{name}' in '#{class}' can't override getter from "
+              "'#{inheritedClass}'."),
+
+      MessageKind.CANNOT_OVERRIDE_GETTER_WITH_METHOD_CONT:
+        const MessageTemplate(
+          MessageKind.CANNOT_OVERRIDE_GETTER_WITH_METHOD_CONT,
+          "This is the getter that cannot be overridden by a method."),
+
+      MessageKind.CANNOT_OVERRIDE_METHOD_WITH_GETTER:
+        const MessageTemplate(MessageKind.CANNOT_OVERRIDE_METHOD_WITH_GETTER,
+          "Getter '#{name}' in '#{class}' can't override method from "
+          "'#{inheritedClass}'."),
+
+      MessageKind.CANNOT_OVERRIDE_METHOD_WITH_GETTER_CONT:
+        const MessageTemplate(
+          MessageKind.CANNOT_OVERRIDE_METHOD_WITH_GETTER_CONT,
+          "This is the method that cannot be overridden by a getter."),
+
+      MessageKind.MISSING_FORMALS:
+        const MessageTemplate(MessageKind.MISSING_FORMALS,
+          "Formal parameters are missing."),
+
+      MessageKind.EXTRA_FORMALS:
+        const MessageTemplate(MessageKind.EXTRA_FORMALS,
+          "Formal parameters are not allowed here."),
+
+      MessageKind.UNARY_OPERATOR_BAD_ARITY:
+        const MessageTemplate(MessageKind.UNARY_OPERATOR_BAD_ARITY,
+          "Operator '#{operatorName}' must have no parameters."),
+
+      MessageKind.MINUS_OPERATOR_BAD_ARITY:
+        const MessageTemplate(MessageKind.MINUS_OPERATOR_BAD_ARITY,
+          "Operator '-' must have 0 or 1 parameters."),
+
+      MessageKind.BINARY_OPERATOR_BAD_ARITY:
+        const MessageTemplate(MessageKind.BINARY_OPERATOR_BAD_ARITY,
+          "Operator '#{operatorName}' must have exactly 1 parameter."),
+
+      MessageKind.TERNARY_OPERATOR_BAD_ARITY:
+        const MessageTemplate(MessageKind.TERNARY_OPERATOR_BAD_ARITY,
+          "Operator '#{operatorName}' must have exactly 2 parameters."),
+
+      MessageKind.OPERATOR_OPTIONAL_PARAMETERS:
+        const MessageTemplate(MessageKind.OPERATOR_OPTIONAL_PARAMETERS,
+          "Operator '#{operatorName}' cannot have optional parameters."),
+
+      MessageKind.OPERATOR_NAMED_PARAMETERS:
+        const MessageTemplate(MessageKind.OPERATOR_NAMED_PARAMETERS,
+          "Operator '#{operatorName}' cannot have named parameters."),
+
+      MessageKind.CONSTRUCTOR_WITH_RETURN_TYPE:
+        const MessageTemplate(MessageKind.CONSTRUCTOR_WITH_RETURN_TYPE,
+          "Cannot have return type for constructor."),
+
+      MessageKind.CANNOT_RETURN_FROM_CONSTRUCTOR:
+        const MessageTemplate(MessageKind.CANNOT_RETURN_FROM_CONSTRUCTOR,
+          "Constructors can't return values.",
+          howToFix: "Remove the return statement or use a factory constructor.",
+          examples: const ["""
+class C {
+  C() {
+    return 1;
+  }
+}
+
+main() => new C();"""]),
+
+      MessageKind.ILLEGAL_FINAL_METHOD_MODIFIER:
+        const MessageTemplate(MessageKind.ILLEGAL_FINAL_METHOD_MODIFIER,
+          "Cannot have final modifier on method."),
+
+      MessageKind.ILLEGAL_CONST_FIELD_MODIFIER:
+        const MessageTemplate(MessageKind.ILLEGAL_CONST_FIELD_MODIFIER,
+          "Cannot have const modifier on non-static field.",
+          howToFix:
+            "Try adding a static modifier, or removing the const modifier.",
+          examples: const ["""
+class C {
+  const int a = 1;
+}
+
+main() => new C();"""]),
+
+      MessageKind.ILLEGAL_CONSTRUCTOR_MODIFIERS:
+        const MessageTemplate(MessageKind.ILLEGAL_CONSTRUCTOR_MODIFIERS,
+          "Illegal constructor modifiers: '#{modifiers}'."),
+
+      MessageKind.ILLEGAL_MIXIN_APPLICATION_MODIFIERS:
+        const MessageTemplate(MessageKind.ILLEGAL_MIXIN_APPLICATION_MODIFIERS,
+              "Illegal mixin application modifiers: '#{modifiers}'."),
+
+      MessageKind.ILLEGAL_MIXIN_SUPERCLASS:
+        const MessageTemplate(MessageKind.ILLEGAL_MIXIN_SUPERCLASS,
+          "Class used as mixin must have Object as superclass."),
+
+      MessageKind.ILLEGAL_MIXIN_OBJECT:
+        const MessageTemplate(MessageKind.ILLEGAL_MIXIN_OBJECT,
+          "Cannot use Object as mixin."),
+
+      MessageKind.ILLEGAL_MIXIN_CONSTRUCTOR:
+        const MessageTemplate(MessageKind.ILLEGAL_MIXIN_CONSTRUCTOR,
+          "Class used as mixin cannot have non-factory constructor."),
+
+      MessageKind.ILLEGAL_MIXIN_CYCLE:
+        const MessageTemplate(MessageKind.ILLEGAL_MIXIN_CYCLE,
+          "Class used as mixin introduces mixin cycle: "
+          "'#{mixinName1}' <-> '#{mixinName2}'."),
+
+      MessageKind.ILLEGAL_MIXIN_WITH_SUPER:
+        const MessageTemplate(MessageKind.ILLEGAL_MIXIN_WITH_SUPER,
+          "Cannot use class '#{className}' as a mixin because it uses "
+          "'super'."),
+
+      MessageKind.ILLEGAL_MIXIN_SUPER_USE:
+        const MessageTemplate(MessageKind.ILLEGAL_MIXIN_SUPER_USE,
+          "Use of 'super' in class used as mixin."),
+
+      MessageKind.PARAMETER_NAME_EXPECTED:
+        const MessageTemplate(MessageKind.PARAMETER_NAME_EXPECTED,
+          "parameter name expected."),
+
+      MessageKind.CANNOT_RESOLVE_GETTER:
+        const MessageTemplate(MessageKind.CANNOT_RESOLVE_GETTER,
+          "Cannot resolve getter."),
+
+      MessageKind.CANNOT_RESOLVE_SETTER:
+        const MessageTemplate(MessageKind.CANNOT_RESOLVE_SETTER,
+          "Cannot resolve setter."),
+
+      MessageKind.ASSIGNING_FINAL_FIELD_IN_SUPER:
+        const MessageTemplate(MessageKind.ASSIGNING_FINAL_FIELD_IN_SUPER,
+          "Cannot assign a value to final field '#{name}' "
+          "in superclass '#{superclassName}'."),
+
+      MessageKind.ASSIGNING_METHOD:
+        const MessageTemplate(MessageKind.ASSIGNING_METHOD,
+          "Cannot assign a value to a method."),
+
+      MessageKind.ASSIGNING_METHOD_IN_SUPER:
+        const MessageTemplate(MessageKind.ASSIGNING_METHOD_IN_SUPER,
+          "Cannot assign a value to method '#{name}' "
+          "in superclass '#{superclassName}'."),
+
+      MessageKind.ASSIGNING_TYPE:
+        const MessageTemplate(MessageKind.ASSIGNING_TYPE,
+          "Cannot assign a value to a type."),
+
+      MessageKind.IF_NULL_ASSIGNING_TYPE:
+        const MessageTemplate(MessageKind.IF_NULL_ASSIGNING_TYPE,
+          "Cannot assign a value to a type. Note that types are never null, "
+          "so this ??= assignment has no effect.",
+          howToFix: "Try removing the '??=' assignment.",
+          examples: const [
+              "class A {} main() { print(A ??= 3);}",
+          ]),
+
+      MessageKind.VOID_NOT_ALLOWED:
+        const MessageTemplate(MessageKind.VOID_NOT_ALLOWED,
+          "Type 'void' can't be used here because it isn't a return type.",
+          howToFix:
+            "Try removing 'void' keyword or replace it with 'var', 'final', "
+            "or a type.",
+          examples: const [
+              "void x; main() {}",
+              "foo(void x) {} main() { foo(null); }",
+          ]),
+
+      MessageKind.NULL_NOT_ALLOWED:
+        const MessageTemplate(MessageKind.NULL_NOT_ALLOWED,
+          "`null` can't be used here."),
+
+      MessageKind.BEFORE_TOP_LEVEL:
+        const MessageTemplate(MessageKind.BEFORE_TOP_LEVEL,
+          "Part header must come before top-level definitions."),
+
+      MessageKind.IMPORT_PART_OF:
+        const MessageTemplate(MessageKind.IMPORT_PART_OF,
+          "The imported library must not have a 'part-of' directive.",
+          howToFix: "Try removing the 'part-of' directive or replacing the "
+                    "import of the library with a 'part' directive.",
+          examples: const [const {
+'main.dart': """
+library library;
+
+import 'part.dart';
+
+main() {}
+""",
+
+'part.dart': """
+part of library;
+"""}]),
+
+      MessageKind.LIBRARY_NAME_MISMATCH:
+        const MessageTemplate(MessageKind.LIBRARY_NAME_MISMATCH,
+          "Expected part of library name '#{libraryName}'.",
+          howToFix: "Try changing the directive to 'part of #{libraryName};'.",
+          examples: const [const {
+'main.dart': """
+library lib.foo;
+
+part 'part.dart';
+
+main() {}
+""",
+
+'part.dart': """
+part of lib.bar;
+"""}]),
+
+      MessageKind.MISSING_LIBRARY_NAME:
+        const MessageTemplate(MessageKind.MISSING_LIBRARY_NAME,
+          "Library has no name. Part directive expected library name "
+          "to be '#{libraryName}'.",
+          howToFix: "Try adding 'library #{libraryName};' to the library.",
+          examples: const [const {
+'main.dart': """
+part 'part.dart';
+
+main() {}
+""",
+
+'part.dart': """
+part of lib.foo;
+"""}]),
+
+      MessageKind.THIS_IS_THE_PART_OF_TAG:
+        const MessageTemplate(MessageKind.THIS_IS_THE_PART_OF_TAG,
+          "This is the part of directive."),
+
+      MessageKind.MISSING_PART_OF_TAG:
+        const MessageTemplate(MessageKind.MISSING_PART_OF_TAG,
+          "This file has no part-of tag, but it is being used as a part."),
+
+      MessageKind.DUPLICATED_PART_OF:
+        const MessageTemplate(MessageKind.DUPLICATED_PART_OF,
+          "Duplicated part-of directive."),
+
+      MessageKind.DUPLICATED_LIBRARY_NAME:
+        const MessageTemplate(MessageKind.DUPLICATED_LIBRARY_NAME,
+          "Duplicated library name '#{libraryName}'."),
+
+      MessageKind.DUPLICATED_RESOURCE:
+        const MessageTemplate(MessageKind.DUPLICATED_RESOURCE,
+          "The resource '#{resourceUri}' is loaded through both "
+          "'#{canonicalUri1}' and '#{canonicalUri2}'."),
+
+      MessageKind.DUPLICATED_LIBRARY_RESOURCE:
+        const MessageTemplate(MessageKind.DUPLICATED_LIBRARY_RESOURCE,
+          "The library '#{libraryName}' in '#{resourceUri}' is loaded through "
+          "both '#{canonicalUri1}' and '#{canonicalUri2}'."),
+
+      // This is used as an exception.
+      MessageKind.INVALID_SOURCE_FILE_LOCATION:
+        const MessageTemplate(MessageKind.INVALID_SOURCE_FILE_LOCATION, '''
+Invalid offset (#{offset}) in source map.
+File: #{fileName}
+Length: #{length}'''),
+
+      MessageKind.TOP_LEVEL_VARIABLE_DECLARED_STATIC:
+        const MessageTemplate(MessageKind.TOP_LEVEL_VARIABLE_DECLARED_STATIC,
+              "Top-level variable cannot be declared static."),
+
+      MessageKind.REFERENCE_IN_INITIALIZATION:
+        const MessageTemplate(MessageKind.REFERENCE_IN_INITIALIZATION,
+           "Variable '#{variableName}' is referenced during its "
+           "initialization.",
+           howToFix:
+             "If you are trying to reference a shadowed variable, rename "
+             "one of the variables.",
+           examples: const ["""
+foo(t) {
+  var t = t;
+  return t;
+}
+
+main() => foo(1);
+"""]),
+
+      MessageKind.CONST_WITHOUT_INITIALIZER:
+        const MessageTemplate(MessageKind.CONST_WITHOUT_INITIALIZER,
+          "A constant variable must be initialized.",
+          howToFix: "Try adding an initializer or "
+                    "removing the 'const' modifier.",
+          examples: const ["""
+void main() {
+  const c; // This constant variable must be initialized.
+}"""]),
+
+      MessageKind.FINAL_WITHOUT_INITIALIZER:
+        const MessageTemplate(MessageKind.FINAL_WITHOUT_INITIALIZER,
+          "A final variable must be initialized.",
+          howToFix: "Try adding an initializer or "
+                    "removing the 'final' modifier.",
+          examples: const [
+              "class C { static final field; } main() => C.field;"]),
+
+      MessageKind.MEMBER_USES_CLASS_NAME:
+        const MessageTemplate(MessageKind.MEMBER_USES_CLASS_NAME,
+          "Member variable can't have the same name as the class it is "
+          "declared in.",
+          howToFix: "Try renaming the variable.",
+          examples: const ["""
+class A { var A; }
+main() {
+  var a = new A();
+  a.A = 1;
+}
+""", """
+class A { static var A; }
+main() => A.A = 1;
+"""]),
+
+      MessageKind.WRONG_NUMBER_OF_ARGUMENTS_FOR_ASSERT:
+        const MessageTemplate(
+          MessageKind.WRONG_NUMBER_OF_ARGUMENTS_FOR_ASSERT,
+          "Wrong number of arguments to assert. Should be 1, but given "
+          "#{argumentCount}."),
+
+      MessageKind.ASSERT_IS_GIVEN_NAMED_ARGUMENTS:
+        const MessageTemplate(MessageKind.ASSERT_IS_GIVEN_NAMED_ARGUMENTS,
+          "'assert' takes no named arguments, but given #{argumentCount}."),
+
+      MessageKind.FACTORY_REDIRECTION_IN_NON_FACTORY:
+        const MessageTemplate(MessageKind.FACTORY_REDIRECTION_IN_NON_FACTORY,
+          "Factory redirection only allowed in factories."),
+
+      MessageKind.MISSING_FACTORY_KEYWORD:
+        const MessageTemplate(MessageKind.MISSING_FACTORY_KEYWORD,
+          "Did you forget a factory keyword here?"),
+
+      MessageKind.NO_SUCH_METHOD_IN_NATIVE:
+        const MessageTemplate(MessageKind.NO_SUCH_METHOD_IN_NATIVE,
+          "'NoSuchMethod' is not supported for classes that extend native "
+          "classes."),
+
+      MessageKind.DEFERRED_LIBRARY_DART_2_DART:
+        const MessageTemplate(MessageKind.DEFERRED_LIBRARY_DART_2_DART,
+          "Deferred loading is not supported by the dart backend yet. "
+          "The output will not be split."),
+
+      MessageKind.DEFERRED_LIBRARY_WITHOUT_PREFIX:
+        const MessageTemplate(MessageKind.DEFERRED_LIBRARY_WITHOUT_PREFIX,
+          "This import is deferred but there is no prefix keyword.",
+          howToFix: "Try adding a prefix to the import."),
+
+      MessageKind.DEFERRED_OLD_SYNTAX:
+        const MessageTemplate(MessageKind.DEFERRED_OLD_SYNTAX,
+          "The DeferredLibrary annotation is obsolete.",
+          howToFix:
+            "Use the \"import 'lib.dart' deferred as prefix\" syntax instead."),
+
+      MessageKind.DEFERRED_LIBRARY_DUPLICATE_PREFIX:
+        const MessageTemplate(MessageKind.DEFERRED_LIBRARY_DUPLICATE_PREFIX,
+          "The prefix of this deferred import is not unique.",
+          howToFix: "Try changing the import prefix."),
+
+      MessageKind.DEFERRED_TYPE_ANNOTATION:
+        const MessageTemplate(MessageKind.DEFERRED_TYPE_ANNOTATION,
+          "The type #{node} is deferred. "
+          "Deferred types are not valid as type annotations.",
+          howToFix:
+            "Try using a non-deferred abstract class as an interface."),
+
+      MessageKind.ILLEGAL_STATIC:
+        const MessageTemplate(MessageKind.ILLEGAL_STATIC,
+          "Modifier static is only allowed on functions declared in "
+          "a class."),
+
+      MessageKind.STATIC_FUNCTION_BLOAT:
+        const MessageTemplate(MessageKind.STATIC_FUNCTION_BLOAT,
+          "Using '#{class}.#{name}' may lead to unnecessarily large "
+          "generated code.",
+          howToFix:
+              "Try adding '@MirrorsUsed(...)' as described at "
+              "https://goo.gl/Akrrog."),
+
+      MessageKind.NON_CONST_BLOAT:
+        const MessageTemplate(MessageKind.NON_CONST_BLOAT,
+          "Using 'new #{name}' may lead to unnecessarily large generated "
+          "code.",
+          howToFix:
+              "Try using 'const #{name}' or adding '@MirrorsUsed(...)' as "
+              "described at https://goo.gl/Akrrog."),
+
+      MessageKind.STRING_EXPECTED:
+        const MessageTemplate(MessageKind.STRING_EXPECTED,
+          "Expected a 'String', but got an instance of '#{type}'."),
+
+      MessageKind.PRIVATE_IDENTIFIER:
+        const MessageTemplate(MessageKind.PRIVATE_IDENTIFIER,
+          "'#{value}' is not a valid Symbol name because it starts with "
+          "'_'."),
+
+      MessageKind.PRIVATE_NAMED_PARAMETER:
+        const MessageTemplate(MessageKind.PRIVATE_NAMED_PARAMETER,
+          "Named optional parameter can't have a library private name.",
+          howToFix:
+            "Try removing the '_' or making the parameter positional or "
+            "required.",
+          examples: const ["""foo({int _p}) {} main() => foo();"""]),
+
+      MessageKind.UNSUPPORTED_LITERAL_SYMBOL:
+        const MessageTemplate(MessageKind.UNSUPPORTED_LITERAL_SYMBOL,
+          "Symbol literal '##{value}' is currently unsupported by dart2js."),
+
+      MessageKind.INVALID_SYMBOL:
+        const MessageTemplate(MessageKind.INVALID_SYMBOL, '''
+'#{value}' is not a valid Symbol name because is not:
+ * an empty String,
+ * a user defined operator,
+ * a qualified non-private identifier optionally followed by '=', or
+ * a qualified non-private identifier followed by '.' and a user-defined '''
+"operator."),
+
+      MessageKind.AMBIGUOUS_REEXPORT:
+        const MessageTemplate(MessageKind.AMBIGUOUS_REEXPORT,
+          "'#{name}' is (re)exported by multiple libraries."),
+
+      MessageKind.AMBIGUOUS_LOCATION:
+        const MessageTemplate(MessageKind.AMBIGUOUS_LOCATION,
+          "'#{name}' is defined here."),
+
+      MessageKind.IMPORTED_HERE:
+        const MessageTemplate(MessageKind.IMPORTED_HERE,
+          "'#{name}' is imported here."),
+
+      MessageKind.OVERRIDE_EQUALS_NOT_HASH_CODE:
+        const MessageTemplate(MessageKind.OVERRIDE_EQUALS_NOT_HASH_CODE,
+          "The class '#{class}' overrides 'operator==', "
+          "but not 'get hashCode'."),
+
+      MessageKind.INTERNAL_LIBRARY_FROM:
+        const MessageTemplate(MessageKind.INTERNAL_LIBRARY_FROM,
+          "Internal library '#{resolvedUri}' is not accessible from "
+          "'#{importingUri}'."),
+
+      MessageKind.INTERNAL_LIBRARY:
+        const MessageTemplate(MessageKind.INTERNAL_LIBRARY,
+          "Internal library '#{resolvedUri}' is not accessible."),
+
+      MessageKind.JS_INTEROP_CLASS_CANNOT_EXTEND_DART_CLASS:
+        const MessageTemplate(
+          MessageKind.JS_INTEROP_CLASS_CANNOT_EXTEND_DART_CLASS,
+          "Js-interop class '#{cls}' cannot extend from the non js-interop "
+          "class '#{superclass}'.",
+          howToFix: "Annotate the superclass with @JS.",
+          examples: const [
+              """
+              import 'package:js/js.dart';
+
+              class Foo { }
+
+              @JS()
+              class Bar extends Foo { }
+
+              main() {
+                new Bar();
+              }
+              """]),
+
+      MessageKind.JS_INTEROP_CLASS_NON_EXTERNAL_MEMBER:
+        const MessageTemplate(
+          MessageKind.JS_INTEROP_CLASS_NON_EXTERNAL_MEMBER,
+          "Member '#{member}' in js-interop class '#{cls}' is not external.",
+          howToFix: "Mark all interop methods external",
+          examples: const [
+              """
+              import 'package:js/js.dart';
+
+              @JS()
+              class Foo {
+                bar() {}
+              }
+
+              main() {
+                new Foo().bar();
+              }
+              """]),
+
+      MessageKind.JS_INTEROP_METHOD_WITH_NAMED_ARGUMENTS:
+        const MessageTemplate(
+          MessageKind.JS_INTEROP_METHOD_WITH_NAMED_ARGUMENTS,
+          "Js-interop method '#{method}' has named arguments but is not "
+          "a factory constructor of an @anonymous @JS class.",
+          howToFix: "Remove all named arguments from js-interop method or "
+                    "in the case of a factory constructor annotate the class "
+                    "as @anonymous.",
+          examples: const [
+              """
+              import 'package:js/js.dart';
+
+              @JS()
+              class Foo {
+                external bar(foo, {baz});
+              }
+
+              main() {
+                new Foo().bar(4, baz: 5);
+              }
+              """]),
+
+      MessageKind.JS_OBJECT_LITERAL_CONSTRUCTOR_WITH_POSITIONAL_ARGUMENTS:
+        const MessageTemplate(
+          MessageKind.JS_OBJECT_LITERAL_CONSTRUCTOR_WITH_POSITIONAL_ARGUMENTS,
+          "Parameter '#{parameter}' in anonymous js-interop class '#{cls}' "
+          "object literal constructor is positional instead of named."
+          ".",
+          howToFix: "Make all arguments in external factory object literal "
+                    "constructors named.",
+          examples: const [
+              """
+              import 'package:js/js.dart';
+
+              @anonymous
+              @JS()
+              class Foo {
+                external factory Foo(foo, {baz});
+              }
+
+              main() {
+                new Foo(5, baz: 5);
+              }
+              """]),
+
+      MessageKind.LIBRARY_NOT_FOUND:
+        const MessageTemplate(MessageKind.LIBRARY_NOT_FOUND,
+          "Library not found '#{resolvedUri}'."),
+
+      MessageKind.LIBRARY_NOT_SUPPORTED:
+        const MessageTemplate(MessageKind.LIBRARY_NOT_SUPPORTED,
+          "Library not supported '#{resolvedUri}'.",
+          howToFix: "Try removing the dependency or enabling support using "
+                    "the '--categories' option.",
+          examples: const [/*
+              """
+              import 'dart:io';
+              main() {}
+              """
+          */]),
+          // TODO(johnniwinther): Enable example when message_kind_test.dart
+          // supports library loader callbacks.
+
+      MessageKind.UNSUPPORTED_EQ_EQ_EQ:
+        const MessageTemplate(MessageKind.UNSUPPORTED_EQ_EQ_EQ,
+          "'===' is not an operator. "
+          "Did you mean '#{lhs} == #{rhs}' or 'identical(#{lhs}, #{rhs})'?"),
+
+      MessageKind.UNSUPPORTED_BANG_EQ_EQ:
+        const MessageTemplate(MessageKind.UNSUPPORTED_BANG_EQ_EQ,
+          "'!==' is not an operator. "
+          "Did you mean '#{lhs} != #{rhs}' or '!identical(#{lhs}, #{rhs})'?"),
+
+      MessageKind.UNSUPPORTED_PREFIX_PLUS:
+        const MessageTemplate(MessageKind.UNSUPPORTED_PREFIX_PLUS,
+          "'+' is not a prefix operator. ",
+          howToFix: "Try removing '+'.",
+          examples: const [
+              "main() => +2;  // No longer a valid way to write '2'"
+          ]),
+
+      MessageKind.UNSUPPORTED_THROW_WITHOUT_EXP:
+        const MessageTemplate(MessageKind.UNSUPPORTED_THROW_WITHOUT_EXP,
+          "No expression after 'throw'. "
+          "Did you mean 'rethrow'?"),
+
+      MessageKind.DEPRECATED_TYPEDEF_MIXIN_SYNTAX:
+        const MessageTemplate(MessageKind.DEPRECATED_TYPEDEF_MIXIN_SYNTAX,
+          "'typedef' not allowed here. ",
+          howToFix: "Try replacing 'typedef' with 'class'.",
+          examples: const [
+              """
+class B { }
+class M1 {  }
+typedef C = B with M1;  // Need to replace 'typedef' with 'class'.
+main() { new C(); }
+"""]),
+
+      MessageKind.MIRRORS_EXPECTED_STRING:
+        const MessageTemplate(MessageKind.MIRRORS_EXPECTED_STRING,
+          "Can't use '#{name}' here because it's an instance of '#{type}' "
+          "and a 'String' value is expected.",
+          howToFix: "Did you forget to add quotes?",
+          examples: const [
+              """
+// 'Foo' is a type literal, not a string.
+@MirrorsUsed(symbols: const [Foo])
+import 'dart:mirrors';
+
+class Foo {}
+
+main() {}
+"""]),
+
+      MessageKind.MIRRORS_EXPECTED_STRING_OR_TYPE:
+        const MessageTemplate(MessageKind.MIRRORS_EXPECTED_STRING_OR_TYPE,
+          "Can't use '#{name}' here because it's an instance of '#{type}' "
+          "and a 'String' or 'Type' value is expected.",
+          howToFix: "Did you forget to add quotes?",
+          examples: const [
+              """
+// 'main' is a method, not a class.
+@MirrorsUsed(targets: const [main])
+import 'dart:mirrors';
+
+main() {}
+"""]),
+
+      MessageKind.MIRRORS_EXPECTED_STRING_OR_LIST:
+        const MessageTemplate(MessageKind.MIRRORS_EXPECTED_STRING_OR_LIST,
+          "Can't use '#{name}' here because it's an instance of '#{type}' "
+          "and a 'String' or 'List' value is expected.",
+          howToFix: "Did you forget to add quotes?",
+          examples: const [
+              """
+// 'Foo' is not a string.
+@MirrorsUsed(symbols: Foo)
+import 'dart:mirrors';
+
+class Foo {}
+
+main() {}
+"""]),
+
+      MessageKind.MIRRORS_EXPECTED_STRING_TYPE_OR_LIST:
+        const MessageTemplate(MessageKind.MIRRORS_EXPECTED_STRING_TYPE_OR_LIST,
+          "Can't use '#{name}' here because it's an instance of '#{type}' "
+          "but a 'String', 'Type', or 'List' value is expected.",
+          howToFix: "Did you forget to add quotes?",
+          examples: const [
+              """
+// '1' is not a string.
+@MirrorsUsed(targets: 1)
+import 'dart:mirrors';
+
+main() {}
+"""]),
+
+      MessageKind.MIRRORS_CANNOT_RESOLVE_IN_CURRENT_LIBRARY:
+        const MessageTemplate(
+          MessageKind.MIRRORS_CANNOT_RESOLVE_IN_CURRENT_LIBRARY,
+          "Can't find '#{name}' in the current library.",
+          // TODO(ahe): The closest identifiers in edit distance would be nice.
+          howToFix: "Did you forget to add an import?",
+          examples: const [
+              """
+// 'window' is not in scope because dart:html isn't imported.
+@MirrorsUsed(targets: 'window')
+import 'dart:mirrors';
+
+main() {}
+"""]),
+
+      MessageKind.MIRRORS_CANNOT_RESOLVE_IN_LIBRARY:
+        const MessageTemplate(MessageKind.MIRRORS_CANNOT_RESOLVE_IN_LIBRARY,
+          "Can't find '#{name}' in the library '#{library}'.",
+          // TODO(ahe): The closest identifiers in edit distance would be nice.
+          howToFix: "Is '#{name}' spelled right?",
+          examples: const [
+              """
+// 'List' is misspelled.
+@MirrorsUsed(targets: 'dart.core.Lsit')
+import 'dart:mirrors';
+
+main() {}
+"""]),
+
+      MessageKind.MIRRORS_CANNOT_FIND_IN_ELEMENT:
+        const MessageTemplate(MessageKind.MIRRORS_CANNOT_FIND_IN_ELEMENT,
+          "Can't find '#{name}' in '#{element}'.",
+          // TODO(ahe): The closest identifiers in edit distance would be nice.
+          howToFix: "Is '#{name}' spelled right?",
+          examples: const [
+              """
+// 'addAll' is misspelled.
+@MirrorsUsed(targets: 'dart.core.List.addAl')
+import 'dart:mirrors';
+
+main() {}
+"""]),
+
+      MessageKind.INVALID_URI:
+        const MessageTemplate(MessageKind.INVALID_URI,
+          "'#{uri}' is not a valid URI.",
+          howToFix: DONT_KNOW_HOW_TO_FIX,
+          examples: const [
+            """
+// can't have a '[' in a URI
+import '../../Udyn[mic ils/expect.dart';
+
+main() {}
+"""]),
+
+      MessageKind.INVALID_PACKAGE_CONFIG:
+          const MessageTemplate(MessageKind.INVALID_PACKAGE_CONFIG,
+            """Package config file '#{uri}' is invalid.
+#{exception}""",
+            howToFix: DONT_KNOW_HOW_TO_FIX
+      ),
+
+      MessageKind.INVALID_PACKAGE_URI:
+        const MessageTemplate(MessageKind.INVALID_PACKAGE_URI,
+          "'#{uri}' is not a valid package URI (#{exception}).",
+          howToFix: DONT_KNOW_HOW_TO_FIX,
+          examples: const [
+            """
+// can't have a 'top level' package URI
+import 'package:foo.dart';
+
+main() {}
+""", """
+// can't have 2 slashes
+import 'package://foo/foo.dart';
+
+main() {}
+""", """
+// package name must be valid
+import 'package:not\valid/foo.dart';
+
+main() {}
+"""]),
+
+      MessageKind.READ_SCRIPT_ERROR:
+        const MessageTemplate(MessageKind.READ_SCRIPT_ERROR,
+          "Can't read '#{uri}' (#{exception}).",
+          // Don't know how to fix since the underlying error is unknown.
+          howToFix: DONT_KNOW_HOW_TO_FIX,
+          examples: const [
+              """
+// 'foo.dart' does not exist.
+import 'foo.dart';
+
+main() {}
+"""]),
+
+      MessageKind.READ_SELF_ERROR:
+        const MessageTemplate(MessageKind.READ_SELF_ERROR,
+          "#{exception}",
+          // Don't know how to fix since the underlying error is unknown.
+          howToFix: DONT_KNOW_HOW_TO_FIX),
+
+      MessageKind.EXTRANEOUS_MODIFIER:
+        const MessageTemplate(MessageKind.EXTRANEOUS_MODIFIER,
+          "Can't have modifier '#{modifier}' here.",
+          howToFix: "Try removing '#{modifier}'.",
+          examples: const [
+              "var String foo; main(){}",
+              // "var get foo; main(){}",
+              "var set foo; main(){}",
+              "var final foo; main(){}",
+              "var var foo; main(){}",
+              "var const foo; main(){}",
+              "var abstract foo; main(){}",
+              "var static foo; main(){}",
+              "var external foo; main(){}",
+              "get var foo; main(){}",
+              "set var foo; main(){}",
+              "final var foo; main(){}",
+              "var var foo; main(){}",
+              "const var foo; main(){}",
+              "abstract var foo; main(){}",
+              "static var foo; main(){}",
+              "external var foo; main(){}"]),
+
+      MessageKind.EXTRANEOUS_MODIFIER_REPLACE:
+        const MessageTemplate(MessageKind.EXTRANEOUS_MODIFIER_REPLACE,
+          "Can't have modifier '#{modifier}' here.",
+          howToFix:
+            "Try replacing modifier '#{modifier}' with 'var', 'final', "
+            "or a type.",
+          examples: const [
+              // "get foo; main(){}",
+              "set foo; main(){}",
+              "abstract foo; main(){}",
+              "static foo; main(){}",
+              "external foo; main(){}"]),
+
+      MessageKind.ABSTRACT_CLASS_INSTANTIATION:
+        const MessageTemplate(MessageKind.ABSTRACT_CLASS_INSTANTIATION,
+          "Can't instantiate abstract class.",
+          howToFix: DONT_KNOW_HOW_TO_FIX,
+          examples: const ["abstract class A {} main() { new A(); }"]),
+
+      MessageKind.BODY_EXPECTED:
+        const MessageTemplate(MessageKind.BODY_EXPECTED,
+          "Expected a function body or '=>'.",
+          // TODO(ahe): In some scenarios, we can suggest removing the 'static'
+          // keyword.
+          howToFix: "Try adding {}.",
+          examples: const [
+              "main();"]),
+
+      MessageKind.MIRROR_BLOAT:
+        const MessageTemplate(MessageKind.MIRROR_BLOAT,
+          "#{count} methods retained for use by dart:mirrors out of #{total}"
+          " total methods (#{percentage}%)."),
+
+      MessageKind.MIRROR_IMPORT:
+        const MessageTemplate(MessageKind.MIRROR_IMPORT,
+          "Import of 'dart:mirrors'."),
+
+      MessageKind.MIRROR_IMPORT_NO_USAGE:
+        const MessageTemplate(MessageKind.MIRROR_IMPORT_NO_USAGE,
+          "This import is not annotated with @MirrorsUsed, which may lead to "
+          "unnecessarily large generated code.",
+          howToFix:
+              "Try adding '@MirrorsUsed(...)' as described at "
+              "https://goo.gl/Akrrog."),
+
+      MessageKind.WRONG_ARGUMENT_FOR_JS_INTERCEPTOR_CONSTANT:
+        const MessageTemplate(
+          MessageKind.WRONG_ARGUMENT_FOR_JS_INTERCEPTOR_CONSTANT,
+          "Argument for 'JS_INTERCEPTOR_CONSTANT' must be a type constant."),
+
+      MessageKind.EXPECTED_IDENTIFIER_NOT_RESERVED_WORD:
+        const MessageTemplate(MessageKind.EXPECTED_IDENTIFIER_NOT_RESERVED_WORD,
+              "'#{keyword}' is a reserved word and can't be used here.",
+              howToFix: "Try using a different name.",
+              examples: const ["do() {} main() {}"]),
+
+      MessageKind. NAMED_FUNCTION_EXPRESSION:
+        const MessageTemplate(MessageKind.NAMED_FUNCTION_EXPRESSION,
+          "Function expression '#{name}' cannot be named.",
+          howToFix: "Try removing the name.",
+          examples: const ["main() { var f = func() {}; }"]),
+
+      MessageKind.UNUSED_METHOD:
+        const MessageTemplate(MessageKind.UNUSED_METHOD,
+          "The method '#{name}' is never called.",
+          howToFix: "Consider deleting it.",
+          examples: const ["deadCode() {} main() {}"]),
+
+      MessageKind.UNUSED_CLASS:
+        const MessageTemplate(MessageKind.UNUSED_CLASS,
+          "The class '#{name}' is never used.",
+          howToFix: "Consider deleting it.",
+          examples: const ["class DeadCode {} main() {}"]),
+
+      MessageKind.UNUSED_TYPEDEF:
+        const MessageTemplate(MessageKind.UNUSED_TYPEDEF,
+          "The typedef '#{name}' is never used.",
+          howToFix: "Consider deleting it.",
+          examples: const ["typedef DeadCode(); main() {}"]),
+
+      MessageKind.ABSTRACT_METHOD:
+        const MessageTemplate(MessageKind.ABSTRACT_METHOD,
+          "The method '#{name}' has no implementation in "
+          "class '#{class}'.",
+          howToFix: "Try adding a body to '#{name}' or declaring "
+                    "'#{class}' to be 'abstract'.",
+          examples: const ["""
+class Class {
+  method();
+}
+main() => new Class().method();
+"""]),
+
+      MessageKind.ABSTRACT_GETTER:
+        const MessageTemplate(MessageKind.ABSTRACT_GETTER,
+          "The getter '#{name}' has no implementation in "
+          "class '#{class}'.",
+          howToFix: "Try adding a body to '#{name}' or declaring "
+                    "'#{class}' to be 'abstract'.",
+          examples: const ["""
+class Class {
+  get getter;
+}
+main() => new Class();
+"""]),
+
+      MessageKind.ABSTRACT_SETTER:
+        const MessageTemplate(MessageKind.ABSTRACT_SETTER,
+          "The setter '#{name}' has no implementation in "
+          "class '#{class}'.",
+          howToFix: "Try adding a body to '#{name}' or declaring "
+                    "'#{class}' to be 'abstract'.",
+          examples: const ["""
+class Class {
+  set setter(_);
+}
+main() => new Class();
+"""]),
+
+      MessageKind.INHERIT_GETTER_AND_METHOD:
+        const MessageTemplate(MessageKind.INHERIT_GETTER_AND_METHOD,
+          "The class '#{class}' can't inherit both getters and methods "
+          "by the named '#{name}'.",
+          howToFix: DONT_KNOW_HOW_TO_FIX,
+          examples: const ["""
+class A {
+  get member => null;
+}
+class B {
+  member() {}
+}
+class Class implements A, B {
+}
+main() => new Class();
+"""]),
+
+      MessageKind.INHERITED_METHOD:
+        const MessageTemplate(MessageKind.INHERITED_METHOD,
+          "The inherited method '#{name}' is declared here in class "
+          "'#{class}'."),
+
+      MessageKind.INHERITED_EXPLICIT_GETTER:
+        const MessageTemplate(MessageKind.INHERITED_EXPLICIT_GETTER,
+          "The inherited getter '#{name}' is declared here in class "
+          "'#{class}'."),
+
+      MessageKind.INHERITED_IMPLICIT_GETTER:
+        const MessageTemplate(MessageKind.INHERITED_IMPLICIT_GETTER,
+          "The inherited getter '#{name}' is implicitly declared by this "
+          "field in class '#{class}'."),
+
+      MessageKind.UNIMPLEMENTED_METHOD_ONE:
+        const MessageTemplate(MessageKind.UNIMPLEMENTED_METHOD_ONE,
+          "'#{class}' doesn't implement '#{method}' "
+          "declared in '#{declarer}'.",
+          howToFix: "Try adding an implementation of '#{name}' or declaring "
+                    "'#{class}' to be 'abstract'.",
+          examples: const ["""
+abstract class I {
+  m();
+}
+class C implements I {}
+main() => new C();
+""", """
+abstract class I {
+  m();
+}
+class C extends I {}
+main() => new C();
+"""]),
+
+      MessageKind.UNIMPLEMENTED_METHOD:
+        const MessageTemplate(MessageKind.UNIMPLEMENTED_METHOD,
+          "'#{class}' doesn't implement '#{method}'.",
+          howToFix: "Try adding an implementation of '#{name}' or declaring "
+                    "'#{class}' to be 'abstract'.",
+          examples: const ["""
+abstract class I {
+  m();
+}
+
+abstract class J {
+  m();
+}
+
+class C implements I, J {}
+
+main() {
+ new C();
+}
+""", """
+abstract class I {
+  m();
+}
+
+abstract class J {
+  m();
+}
+
+class C extends I implements J {}
+
+main() {
+ new C();
+}
+"""]),
+
+      MessageKind.UNIMPLEMENTED_METHOD_CONT:
+        const MessageTemplate(MessageKind.UNIMPLEMENTED_METHOD_CONT,
+          "The method '#{name}' is declared here in class '#{class}'."),
+
+      MessageKind.UNIMPLEMENTED_SETTER_ONE:
+        const MessageTemplate(MessageKind.UNIMPLEMENTED_SETTER_ONE,
+          "'#{class}' doesn't implement the setter '#{name}' "
+          "declared in '#{declarer}'.",
+          howToFix: "Try adding an implementation of '#{name}' or declaring "
+                    "'#{class}' to be 'abstract'.",
+          examples: const ["""
+abstract class I {
+  set m(_);
+}
+class C implements I {}
+class D implements I {
+  set m(_) {}
+}
+main() {
+ new D().m = 0;
+ new C();
+}
+"""]),
+
+      MessageKind.UNIMPLEMENTED_SETTER:
+        const MessageTemplate(MessageKind.UNIMPLEMENTED_SETTER,
+          "'#{class}' doesn't implement the setter '#{name}'.",
+          howToFix: "Try adding an implementation of '#{name}' or declaring "
+                    "'#{class}' to be 'abstract'.",
+          examples: const ["""
+abstract class I {
+  set m(_);
+}
+abstract class J {
+  set m(_);
+}
+class C implements I, J {}
+main() => new C();
+""", """
+abstract class I {
+  set m(_);
+}
+abstract class J {
+  set m(_);
+}
+class C extends I implements J {}
+main() => new C();
+"""]),
+
+      MessageKind.UNIMPLEMENTED_EXPLICIT_SETTER:
+        const MessageTemplate(MessageKind.UNIMPLEMENTED_EXPLICIT_SETTER,
+          "The setter '#{name}' is declared here in class '#{class}'."),
+
+      MessageKind.UNIMPLEMENTED_IMPLICIT_SETTER:
+        const MessageTemplate(MessageKind.UNIMPLEMENTED_IMPLICIT_SETTER,
+          "The setter '#{name}' is implicitly declared by this field "
+          "in class '#{class}'."),
+
+      MessageKind.UNIMPLEMENTED_GETTER_ONE:
+        const MessageTemplate(MessageKind.UNIMPLEMENTED_GETTER_ONE,
+          "'#{class}' doesn't implement the getter '#{name}' "
+          "declared in '#{declarer}'.",
+          howToFix: "Try adding an implementation of '#{name}' or declaring "
+                    "'#{class}' to be 'abstract'.",
+          examples: const ["""
+abstract class I {
+  get m;
+}
+class C implements I {}
+main() => new C();
+""", """
+abstract class I {
+  get m;
+}
+class C extends I {}
+main() => new C();
+"""]),
+
+      MessageKind.UNIMPLEMENTED_GETTER:
+        const MessageTemplate(MessageKind.UNIMPLEMENTED_GETTER,
+          "'#{class}' doesn't implement the getter '#{name}'.",
+          howToFix: "Try adding an implementation of '#{name}' or declaring "
+                    "'#{class}' to be 'abstract'.",
+          examples: const ["""
+abstract class I {
+  get m;
+}
+abstract class J {
+  get m;
+}
+class C implements I, J {}
+main() => new C();
+""", """
+abstract class I {
+  get m;
+}
+abstract class J {
+  get m;
+}
+class C extends I implements J {}
+main() => new C();
+"""]),
+
+      MessageKind.UNIMPLEMENTED_EXPLICIT_GETTER:
+        const MessageTemplate(MessageKind.UNIMPLEMENTED_EXPLICIT_GETTER,
+          "The getter '#{name}' is declared here in class '#{class}'."),
+
+      MessageKind.UNIMPLEMENTED_IMPLICIT_GETTER:
+        const MessageTemplate(MessageKind.UNIMPLEMENTED_IMPLICIT_GETTER,
+          "The getter '#{name}' is implicitly declared by this field "
+          "in class '#{class}'."),
+
+      MessageKind.EQUAL_MAP_ENTRY_KEY:
+        const MessageTemplate(MessageKind.EQUAL_MAP_ENTRY_KEY,
+          "An entry with the same key already exists in the map.",
+          howToFix:
+            "Try removing the previous entry or changing the key in one "
+            "of the entries.",
+          examples: const ["""
+main() {
+  var m = const {'foo': 1, 'foo': 2};
+}"""]),
+
+      MessageKind.BAD_INPUT_CHARACTER:
+        const MessageTemplate(MessageKind.BAD_INPUT_CHARACTER,
+          "Character U+#{characterHex} isn't allowed here.",
+          howToFix: DONT_KNOW_HOW_TO_FIX,
+          examples: const ["""
+main() {
+  String x = ç;
+}
+"""]),
+
+      MessageKind.UNTERMINATED_STRING:
+        const MessageTemplate(MessageKind.UNTERMINATED_STRING,
+          "String must end with #{quote}.",
+          howToFix: DONT_KNOW_HOW_TO_FIX,
+          examples: const ["""
+main() {
+  return '
+;
+}
+""",
+"""
+main() {
+  return \"
+;
+}
+""",
+"""
+main() {
+  return r'
+;
+}
+""",
+"""
+main() {
+  return r\"
+;
+}
+""",
+"""
+main() => '''
+""",
+"""
+main() => \"\"\"
+""",
+"""
+main() => r'''
+""",
+"""
+main() => r\"\"\"
+"""]),
+
+      MessageKind.UNMATCHED_TOKEN:
+        const MessageTemplate(MessageKind.UNMATCHED_TOKEN,
+          "Can't find '#{end}' to match '#{begin}'.",
+          howToFix: DONT_KNOW_HOW_TO_FIX,
+          examples: const[
+              "main(",
+              "main(){",
+              "main(){]}",
+            ]),
+
+      MessageKind.UNTERMINATED_TOKEN:
+        const MessageTemplate(MessageKind.UNTERMINATED_TOKEN,
+          // This is a fall-back message that shouldn't happen.
+          "Incomplete token."),
+
+      MessageKind.EXPONENT_MISSING:
+        const MessageTemplate(MessageKind.EXPONENT_MISSING,
+          "Numbers in exponential notation should always contain an exponent"
+          " (an integer number with an optional sign).",
+          howToFix:
+            "Make sure there is an exponent, and remove any whitespace "
+            "before it.",
+          examples: const ["""
+main() {
+  var i = 1e;
+}
+"""]),
+
+      MessageKind.HEX_DIGIT_EXPECTED:
+        const MessageTemplate(MessageKind.HEX_DIGIT_EXPECTED,
+          "A hex digit (0-9 or A-F) must follow '0x'.",
+          howToFix:
+            DONT_KNOW_HOW_TO_FIX, // Seems obvious from the error message.
+          examples: const ["""
+main() {
+  var i = 0x;
+}
+"""]),
+
+      MessageKind.MALFORMED_STRING_LITERAL:
+        const MessageTemplate(MessageKind.MALFORMED_STRING_LITERAL,
+          r"A '$' has special meaning inside a string, and must be followed by "
+          "an identifier or an expression in curly braces ({}).",
+          howToFix: r"Try adding a backslash (\) to escape the '$'.",
+          examples: const [r"""
+main() {
+  return '$';
+}
+""",
+r'''
+main() {
+  return "$";
+}
+''',
+r"""
+main() {
+  return '''$''';
+}
+""",
+r'''
+main() {
+  return """$""";
+}
+''']),
+
+      MessageKind.UNTERMINATED_COMMENT:
+        const MessageTemplate(MessageKind.UNTERMINATED_COMMENT,
+          "Comment starting with '/*' must end with '*/'.",
+          howToFix: DONT_KNOW_HOW_TO_FIX,
+          examples: const [r"""
+main() {
+}
+/*"""]),
+
+      MessageKind.MISSING_TOKEN_BEFORE_THIS:
+        const MessageTemplate(MessageKind.MISSING_TOKEN_BEFORE_THIS,
+          "Expected '#{token}' before this.",
+          // Consider the second example below: the parser expects a ')' before
+          // 'y', but a ',' would also have worked. We don't have enough
+          // information to give a good suggestion.
+          howToFix: DONT_KNOW_HOW_TO_FIX,
+          examples: const [
+              "main() => true ? 1;",
+              "main() => foo(x: 1 y: 2);",
+            ]),
+
+      MessageKind.MISSING_TOKEN_AFTER_THIS:
+        const MessageTemplate(MessageKind.MISSING_TOKEN_AFTER_THIS,
+          "Expected '#{token}' after this.",
+          // See [MISSING_TOKEN_BEFORE_THIS], we don't have enough information
+          // to give a good suggestion.
+          howToFix: DONT_KNOW_HOW_TO_FIX,
+          examples: const [
+              "main(x) {x}",
+"""
+class S1 {}
+class S2 {}
+class S3 {}
+class A = S1 with S2, S3
+main() => new A();
+"""
+]),
+
+      MessageKind.CONSIDER_ANALYZE_ALL:
+        const MessageTemplate(MessageKind.CONSIDER_ANALYZE_ALL,
+          "Could not find '#{main}'.  Nothing will be analyzed.",
+          howToFix: "Try using '--analyze-all' to analyze everything.",
+          examples: const ['']),
+
+      MessageKind.MISSING_MAIN:
+        const MessageTemplate(MessageKind.MISSING_MAIN,
+          "Could not find '#{main}'.",
+          howToFix: "Try adding a method named '#{main}' to your program."
+          /* No example, test uses '--analyze-only' which will produce the above
+           * message [CONSIDER_ANALYZE_ALL].  An example for a human operator
+           * would be an empty file.*/),
+
+      MessageKind.MAIN_NOT_A_FUNCTION:
+        const MessageTemplate(MessageKind.MAIN_NOT_A_FUNCTION,
+          "'#{main}' is not a function.",
+          howToFix: DONT_KNOW_HOW_TO_FIX, /* Don't state the obvious. */
+          examples: const ['var main;']),
+
+      MessageKind.MAIN_WITH_EXTRA_PARAMETER:
+        const MessageTemplate(MessageKind.MAIN_WITH_EXTRA_PARAMETER,
+          "'#{main}' cannot have more than two parameters.",
+          howToFix: DONT_KNOW_HOW_TO_FIX, /* Don't state the obvious. */
+          examples: const ['main(a, b, c) {}']),
+
+      MessageKind.COMPILER_CRASHED:
+        const MessageTemplate(MessageKind.COMPILER_CRASHED,
+          "The compiler crashed when compiling this element."),
+
+      MessageKind.PLEASE_REPORT_THE_CRASH:
+        const MessageTemplate(MessageKind.PLEASE_REPORT_THE_CRASH, '''
+The compiler is broken.
+
+When compiling the above element, the compiler crashed. It is not
+possible to tell if this is caused by a problem in your program or
+not. Regardless, the compiler should not crash.
+
+The Dart team would greatly appreciate if you would take a moment to
+report this problem at http://dartbug.com/new.
+
+Please include the following information:
+
+* the name and version of your operating system,
+
+* the Dart SDK build number (#{buildId}), and
+
+* the entire message you see here (including the full stack trace
+  below as well as the source location above).
+'''),
+
+      MessageKind.POTENTIAL_MUTATION:
+        const MessageTemplate(MessageKind.POTENTIAL_MUTATION,
+          "Variable '#{variableName}' is not known to be of type "
+          "'#{shownType}' because it is potentially mutated in the scope for "
+          "promotion."),
+
+      MessageKind.POTENTIAL_MUTATION_HERE:
+        const MessageTemplate(MessageKind.POTENTIAL_MUTATION_HERE,
+          "Variable '#{variableName}' is potentially mutated here."),
+
+      MessageKind.POTENTIAL_MUTATION_IN_CLOSURE:
+        const MessageTemplate(MessageKind.POTENTIAL_MUTATION_IN_CLOSURE,
+          "Variable '#{variableName}' is not known to be of type "
+          "'#{shownType}' because it is potentially mutated within a closure."),
+
+      MessageKind.POTENTIAL_MUTATION_IN_CLOSURE_HERE:
+        const MessageTemplate(MessageKind.POTENTIAL_MUTATION_IN_CLOSURE_HERE,
+              "Variable '#{variableName}' is potentially mutated in a "
+              "closure here."),
+
+      MessageKind.ACCESSED_IN_CLOSURE:
+        const MessageTemplate(MessageKind.ACCESSED_IN_CLOSURE,
+          "Variable '#{variableName}' is not known to be of type "
+          "'#{shownType}' because it is accessed by a closure in the scope for "
+          "promotion and potentially mutated in the scope of "
+          "'#{variableName}'."),
+
+      MessageKind.ACCESSED_IN_CLOSURE_HERE:
+        const MessageTemplate(MessageKind.ACCESSED_IN_CLOSURE_HERE,
+          "Variable '#{variableName}' is accessed in a closure here."),
+
+      MessageKind.NOT_MORE_SPECIFIC:
+        const MessageTemplate(MessageKind.NOT_MORE_SPECIFIC,
+          "Variable '#{variableName}' is not shown to have type "
+          "'#{shownType}' because '#{shownType}' is not more specific than the "
+          "known type '#{knownType}' of '#{variableName}'."),
+
+      MessageKind.NOT_MORE_SPECIFIC_SUBTYPE:
+        const MessageTemplate(MessageKind.NOT_MORE_SPECIFIC_SUBTYPE,
+          "Variable '#{variableName}' is not shown to have type "
+          "'#{shownType}' because '#{shownType}' is not a subtype of the "
+          "known type '#{knownType}' of '#{variableName}'."),
+
+      MessageKind.NOT_MORE_SPECIFIC_SUGGESTION:
+        const MessageTemplate(MessageKind.NOT_MORE_SPECIFIC_SUGGESTION,
+          "Variable '#{variableName}' is not shown to have type "
+          "'#{shownType}' because '#{shownType}' is not more specific than the "
+          "known type '#{knownType}' of '#{variableName}'.",
+          howToFix:
+            "Try replacing '#{shownType}' with '#{shownTypeSuggestion}'."),
+
+      MessageKind.NO_COMMON_SUBTYPES:
+        const MessageTemplate(MessageKind.NO_COMMON_SUBTYPES,
+           "Types '#{left}' and '#{right}' have no common subtypes."),
+
+      MessageKind.HIDDEN_WARNINGS_HINTS:
+        const MessageTemplate(MessageKind.HIDDEN_WARNINGS_HINTS,
+          "#{warnings} warning(s) and #{hints} hint(s) suppressed in #{uri}."),
+
+      MessageKind.HIDDEN_WARNINGS:
+        const MessageTemplate(MessageKind.HIDDEN_WARNINGS,
+          "#{warnings} warning(s) suppressed in #{uri}."),
+
+      MessageKind.HIDDEN_HINTS:
+        const MessageTemplate(MessageKind.HIDDEN_HINTS,
+          "#{hints} hint(s) suppressed in #{uri}."),
+
+      MessageKind.PREAMBLE:
+        const MessageTemplate(MessageKind.PREAMBLE,
+        "When run on the command-line, the compiled output might"
+        " require a preamble file located in:\n"
+        "  <sdk>/lib/_internal/js_runtime/lib/preambles."),
+
+      MessageKind.INVALID_SYNC_MODIFIER:
+        const MessageTemplate(MessageKind.INVALID_SYNC_MODIFIER,
+          "Invalid modifier 'sync'.",
+          options: const ['--enable-async'],
+          howToFix: "Try replacing 'sync' with 'sync*'.",
+          examples: const [
+            "main() sync {}"
+          ]),
+
+      MessageKind.INVALID_AWAIT_FOR:
+        const MessageTemplate(MessageKind.INVALID_AWAIT_FOR,
+          "'await' is only supported on for-in loops.",
+          options: const ['--enable-async'],
+          howToFix: "Try rewriting the loop as a for-in loop or removing the "
+                    "'await' keyword.",
+          examples: const ["""
+main() async* {
+  await for (int i = 0; i < 10; i++) {}
+}
+"""]),
+
+      MessageKind.ASYNC_MODIFIER_ON_ABSTRACT_METHOD:
+        const MessageTemplate(MessageKind.ASYNC_MODIFIER_ON_ABSTRACT_METHOD,
+          "The modifier '#{modifier}' is not allowed on an abstract method.",
+          options: const ['--enable-async'],
+          howToFix: "Try removing the '#{modifier}' modifier or adding a "
+                    "body to the method.",
+          examples: const ["""
+abstract class A {
+  method() async;
+}
+class B extends A {
+  method() {}
+}
+main() {
+  A a = new B();
+  a.method();
+}
+"""]),
+
+      MessageKind.ASYNC_MODIFIER_ON_CONSTRUCTOR:
+        const MessageTemplate(MessageKind.ASYNC_MODIFIER_ON_CONSTRUCTOR,
+              "The modifier '#{modifier}' is not allowed on constructors.",
+              options: const ['--enable-async'],
+              howToFix: "Try removing the '#{modifier}' modifier.",
+              examples: const ["""
+class A {
+  A() async;
+}
+main() => new A();""",
+
+"""
+class A {
+  A();
+  factory A.a() async* {}
+}
+main() => new A.a();"""]),
+
+      MessageKind.ASYNC_MODIFIER_ON_SETTER:
+        const MessageTemplate(MessageKind.ASYNC_MODIFIER_ON_SETTER,
+              "The modifier '#{modifier}' is not allowed on setters.",
+              options: const ['--enable-async'],
+              howToFix: "Try removing the '#{modifier}' modifier.",
+              examples: const ["""
+class A {
+  set foo(v) async {}
+}
+main() => new A().foo = 0;"""]),
+
+      MessageKind.YIELDING_MODIFIER_ON_ARROW_BODY:
+        const MessageTemplate(MessageKind.YIELDING_MODIFIER_ON_ARROW_BODY,
+          "The modifier '#{modifier}' is not allowed on methods implemented "
+          "using '=>'.",
+          options: const ['--enable-async'],
+          howToFix: "Try removing the '#{modifier}' modifier or implementing "
+                    "the method body using a block: '{ ... }'.",
+          examples: const ["main() sync* => null;", "main() async* => null;"]),
+
+      // TODO(johnniwinther): Check for 'async' as identifier.
+      MessageKind.ASYNC_KEYWORD_AS_IDENTIFIER:
+        const MessageTemplate(MessageKind.ASYNC_KEYWORD_AS_IDENTIFIER,
+          "'#{keyword}' cannot be used as an identifier in a function body "
+          "marked with '#{modifier}'.",
+          options: const ['--enable-async'],
+          howToFix: "Try removing the '#{modifier}' modifier or renaming the "
+                    "identifier.",
+          examples: const ["""
+main() async {
+ var await;
+}""",
+"""
+main() async* {
+ var yield;
+}""",
+"""
+main() sync* {
+ var yield;
+}"""]),
+
+      MessageKind.RETURN_IN_GENERATOR:
+        const MessageTemplate(MessageKind.RETURN_IN_GENERATOR,
+          "'return' with a value is not allowed in a method body using the "
+          "'#{modifier}' modifier.",
+          howToFix: "Try removing the value, replacing 'return' with 'yield' "
+                    "or changing the method body modifier.",
+          examples: const [
+"""
+foo() async* { return 0; }
+main() => foo();
+""",
+
+"""
+foo() sync* { return 0; }
+main() => foo();
+"""]),
+
+      MessageKind.NATIVE_NOT_SUPPORTED:
+        const MessageTemplate(MessageKind.NATIVE_NOT_SUPPORTED,
+          "'native' modifier is not supported.",
+          howToFix: "Try removing the 'native' implementation or analyzing the "
+                    "code with the --allow-native-extensions option.",
+          examples: const ["""
+main() native "Main";
+"""]),
+
+      MessageKind.DART_EXT_NOT_SUPPORTED:
+        const MessageTemplate(MessageKind.DART_EXT_NOT_SUPPORTED,
+          "The 'dart-ext' scheme is not supported.",
+          howToFix: "Try analyzing the code with the --allow-native-extensions "
+                    "option.",
+          examples: const ["""
+import 'dart-ext:main';
+
+main() {}
+"""]),
+
+      MessageKind.LIBRARY_TAG_MUST_BE_FIRST:
+        const MessageTemplate(MessageKind.LIBRARY_TAG_MUST_BE_FIRST,
+          "The library declaration should come before other declarations.",
+          howToFix: "Try moving the declaration to the top of the file.",
+          examples: const [
+"""
+import 'dart:core';
+library foo;
+main() {}
+""",
+      ]),
+
+      MessageKind.ONLY_ONE_LIBRARY_TAG:
+        const MessageTemplate(MessageKind.ONLY_ONE_LIBRARY_TAG,
+          "There can only be one library declaration.",
+          howToFix: "Try removing all other library declarations.",
+          examples: const [
+"""
+library foo;
+library bar;
+main() {}
+""",
+"""
+library foo;
+import 'dart:core';
+library bar;
+main() {}
+""",
+      ]),
+
+      MessageKind.IMPORT_BEFORE_PARTS:
+        const MessageTemplate(MessageKind.IMPORT_BEFORE_PARTS,
+          "Import declarations should come before parts.",
+          howToFix: "Try moving this import further up in the file.",
+          examples: const [
+              const <String, String>{
+                'main.dart': """
+library test.main;
+part 'part.dart';
+import 'dart:core';
+main() {}
+""",
+                'part.dart': """
+part of test.main;
+""",
+          }]),
+
+      MessageKind.EXPORT_BEFORE_PARTS:
+        const MessageTemplate(MessageKind.EXPORT_BEFORE_PARTS,
+          "Export declarations should come before parts.",
+          howToFix: "Try moving this export further up in the file.",
+          examples: const [
+              const <String, String>{
+                'main.dart': """
+library test.main;
+part 'part.dart';
+export 'dart:core';
+main() {}
+""",
+               'part.dart': """
+part of test.main;
+""",
+          }]),
+
+  //////////////////////////////////////////////////////////////////////////////
+  // Patch errors start.
+  //////////////////////////////////////////////////////////////////////////////
+
+      MessageKind.PATCH_RETURN_TYPE_MISMATCH:
+        const MessageTemplate(MessageKind.PATCH_RETURN_TYPE_MISMATCH,
+          "Patch return type '#{patchReturnType}' does not match "
+          "'#{originReturnType}' on origin method '#{methodName}'."),
+
+      MessageKind.PATCH_REQUIRED_PARAMETER_COUNT_MISMATCH:
+        const MessageTemplate(
+          MessageKind.PATCH_REQUIRED_PARAMETER_COUNT_MISMATCH,
+          "Required parameter count of patch method "
+          "(#{patchParameterCount}) does not match parameter count on origin "
+          "method '#{methodName}' (#{originParameterCount})."),
+
+      MessageKind.PATCH_OPTIONAL_PARAMETER_COUNT_MISMATCH:
+        const MessageTemplate(
+          MessageKind.PATCH_OPTIONAL_PARAMETER_COUNT_MISMATCH,
+          "Optional parameter count of patch method "
+          "(#{patchParameterCount}) does not match parameter count on origin "
+          "method '#{methodName}' (#{originParameterCount})."),
+
+      MessageKind.PATCH_OPTIONAL_PARAMETER_NAMED_MISMATCH:
+        const MessageTemplate(
+          MessageKind.PATCH_OPTIONAL_PARAMETER_NAMED_MISMATCH,
+          "Optional parameters of origin and patch method "
+          "'#{methodName}' must both be either named or positional."),
+
+      MessageKind.PATCH_PARAMETER_MISMATCH:
+        const MessageTemplate(MessageKind.PATCH_PARAMETER_MISMATCH,
+          "Patch method parameter '#{patchParameter}' does not match "
+          "'#{originParameter}' on origin method '#{methodName}'."),
+
+      MessageKind.PATCH_PARAMETER_TYPE_MISMATCH:
+        const MessageTemplate(MessageKind.PATCH_PARAMETER_TYPE_MISMATCH,
+          "Patch method parameter '#{parameterName}' type "
+          "'#{patchParameterType}' does not match '#{originParameterType}' on "
+          "origin method '#{methodName}'."),
+
+      MessageKind.PATCH_EXTERNAL_WITHOUT_IMPLEMENTATION:
+        const MessageTemplate(MessageKind.PATCH_EXTERNAL_WITHOUT_IMPLEMENTATION,
+          "External method without an implementation."),
+
+      MessageKind.PATCH_POINT_TO_FUNCTION:
+        const MessageTemplate(MessageKind.PATCH_POINT_TO_FUNCTION,
+          "This is the function patch '#{functionName}'."),
+
+      MessageKind.PATCH_POINT_TO_CLASS:
+        const MessageTemplate(MessageKind.PATCH_POINT_TO_CLASS,
+          "This is the class patch '#{className}'."),
+
+      MessageKind.PATCH_POINT_TO_GETTER:
+        const MessageTemplate(MessageKind.PATCH_POINT_TO_GETTER,
+          "This is the getter patch '#{getterName}'."),
+
+      MessageKind.PATCH_POINT_TO_SETTER:
+        const MessageTemplate(MessageKind.PATCH_POINT_TO_SETTER,
+          "This is the setter patch '#{setterName}'."),
+
+      MessageKind.PATCH_POINT_TO_CONSTRUCTOR:
+        const MessageTemplate(MessageKind.PATCH_POINT_TO_CONSTRUCTOR,
+          "This is the constructor patch '#{constructorName}'."),
+
+      MessageKind.PATCH_POINT_TO_PARAMETER:
+        const MessageTemplate(MessageKind.PATCH_POINT_TO_PARAMETER,
+          "This is the patch parameter '#{parameterName}'."),
+
+      MessageKind.PATCH_NON_EXISTING:
+        const MessageTemplate(MessageKind.PATCH_NON_EXISTING,
+          "Origin does not exist for patch '#{name}'."),
+
+      // TODO(ahe): Eventually, this error should be removed as it will be
+      // handled by the regular parser.
+      MessageKind.PATCH_NONPATCHABLE:
+        const MessageTemplate(MessageKind.PATCH_NONPATCHABLE,
+          "Only classes and functions can be patched."),
+
+      MessageKind.PATCH_NON_EXTERNAL:
+        const MessageTemplate(MessageKind.PATCH_NON_EXTERNAL,
+          "Only external functions can be patched."),
+
+      MessageKind.PATCH_NON_CLASS:
+        const MessageTemplate(MessageKind.PATCH_NON_CLASS,
+          "Patching non-class with class patch '#{className}'."),
+
+      MessageKind.PATCH_NON_GETTER:
+        const MessageTemplate(MessageKind.PATCH_NON_GETTER,
+          "Cannot patch non-getter '#{name}' with getter patch."),
+
+      MessageKind.PATCH_NO_GETTER:
+        const MessageTemplate(MessageKind.PATCH_NO_GETTER,
+          "No getter found for getter patch '#{getterName}'."),
+
+      MessageKind.PATCH_NON_SETTER:
+        const MessageTemplate(MessageKind.PATCH_NON_SETTER,
+          "Cannot patch non-setter '#{name}' with setter patch."),
+
+      MessageKind.PATCH_NO_SETTER:
+        const MessageTemplate(MessageKind.PATCH_NO_SETTER,
+          "No setter found for setter patch '#{setterName}'."),
+
+      MessageKind.PATCH_NON_CONSTRUCTOR:
+        const MessageTemplate(MessageKind.PATCH_NON_CONSTRUCTOR,
+          "Cannot patch non-constructor with constructor patch "
+          "'#{constructorName}'."),
+
+      MessageKind.PATCH_NON_FUNCTION:
+        const MessageTemplate(MessageKind.PATCH_NON_FUNCTION,
+          "Cannot patch non-function with function patch "
+          "'#{functionName}'."),
+
+      MessageKind.EXTERNAL_WITH_BODY:
+        const MessageTemplate(MessageKind.EXTERNAL_WITH_BODY,
+          "External function '#{functionName}' cannot have a function body.",
+          options: const ["--output-type=dart"],
+          howToFix:
+            "Try removing the 'external' modifier or the function body.",
+          examples: const ["""
+external foo() => 0;
+main() => foo();
+""", """
+external foo() {}
+main() => foo();
+"""]),
+
+  //////////////////////////////////////////////////////////////////////////////
+  // Patch errors end.
+  //////////////////////////////////////////////////////////////////////////////
+
+      MessageKind.EXPERIMENTAL_ASSERT_MESSAGE:
+        const MessageTemplate(MessageKind.EXPERIMENTAL_ASSERT_MESSAGE,
+          "Experimental language feature 'assertion with message'"
+          " is not supported.",
+          howToFix:
+            "Use option '--assert-message' to use assertions with messages.",
+          examples: const [r'''
+main() {
+  int n = -7;
+  assert(n > 0, 'must be positive: $n');
+}
+''']),
+
+      MessageKind.IMPORT_EXPERIMENTAL_MIRRORS:
+        const MessageTemplate(MessageKind.IMPORT_EXPERIMENTAL_MIRRORS, r'''
+
+****************************************************************
+* WARNING: dart:mirrors support in dart2js is experimental,
+*          and not recommended.
+*          This implementation of mirrors is incomplete,
+*          and often greatly increases the size of the generated
+*          JavaScript code.
+*
+* Your app imports dart:mirrors via:''''''
+$IMPORT_EXPERIMENTAL_MIRRORS_PADDING#{importChain}
+*
+* You can disable this message by using the --enable-experimental-mirrors
+* command-line flag.
+*
+* To learn what to do next, please visit:
+*    http://dartlang.org/dart2js-reflection
+****************************************************************
+'''),
+
+      MessageKind.DISALLOWED_LIBRARY_IMPORT:
+        const MessageTemplate(MessageKind.DISALLOWED_LIBRARY_IMPORT, '''
+Your app imports the unsupported library '#{uri}' via:
+''''''
+$DISALLOWED_LIBRARY_IMPORT_PADDING#{importChain}
+
+Use the --categories option to support import of '#{uri}'.
+'''),
+
+      MessageKind.MIRRORS_LIBRARY_NOT_SUPPORT_BY_BACKEND:
+        const MessageTemplate(
+          MessageKind.MIRRORS_LIBRARY_NOT_SUPPORT_BY_BACKEND,
+          """
+dart:mirrors library is not supported when using this backend.
+
+Your app imports dart:mirrors via:""""""
+$MIRRORS_NOT_SUPPORTED_BY_BACKEND_PADDING#{importChain}"""),
+
+      MessageKind.CALL_NOT_SUPPORTED_ON_NATIVE_CLASS:
+        const MessageTemplate(MessageKind.CALL_NOT_SUPPORTED_ON_NATIVE_CLASS,
+          "Non-supported 'call' member on a native class, or a "
+          "subclass of a native class."),
+
+      MessageKind.DIRECTLY_THROWING_NSM:
+        const MessageTemplate(MessageKind.DIRECTLY_THROWING_NSM,
+          "This 'noSuchMethod' implementation is guaranteed to throw an "
+          "exception. The generated code will be smaller if it is "
+          "rewritten.",
+          howToFix: "Rewrite to "
+                    "'noSuchMethod(Invocation i) => super.noSuchMethod(i);'."),
+
+      MessageKind.COMPLEX_THROWING_NSM:
+        const MessageTemplate(MessageKind.COMPLEX_THROWING_NSM,
+          "This 'noSuchMethod' implementation is guaranteed to throw an "
+          "exception. The generated code will be smaller and the compiler "
+          "will be able to perform more optimizations if it is rewritten.",
+          howToFix: "Rewrite to "
+                    "'noSuchMethod(Invocation i) => super.noSuchMethod(i);'."),
+
+      MessageKind.COMPLEX_RETURNING_NSM:
+        const MessageTemplate(MessageKind.COMPLEX_RETURNING_NSM,
+          "Overriding 'noSuchMethod' causes the compiler to generate "
+          "more code and prevents the compiler from doing some optimizations.",
+          howToFix: "Consider removing this 'noSuchMethod' implementation."),
+
+      MessageKind.UNRECOGNIZED_VERSION_OF_LOOKUP_MAP:
+        const MessageTemplate(MessageKind.UNRECOGNIZED_VERSION_OF_LOOKUP_MAP,
+          "Unsupported version of package:lookup_map.",
+          howToFix: DONT_KNOW_HOW_TO_FIX),
+
+  }; // End of TEMPLATES.
+
+  /// Padding used before and between import chains in the message for
+  /// [MessageKind.IMPORT_EXPERIMENTAL_MIRRORS].
+  static const String IMPORT_EXPERIMENTAL_MIRRORS_PADDING = '\n*   ';
+
+  /// Padding used before and between import chains in the message for
+  /// [MessageKind.MIRRORS_LIBRARY_NOT_SUPPORT_BY_BACKEND].
+  static const String MIRRORS_NOT_SUPPORTED_BY_BACKEND_PADDING = '\n   ';
+
+  /// Padding used before and between import chains in the message for
+  /// [MessageKind.DISALLOWED_LIBRARY_IMPORT].
+  static const String DISALLOWED_LIBRARY_IMPORT_PADDING = '\n  ';
+
+  toString() => template;
+
+  Message message([Map arguments = const {}, bool terse = false]) {
+    return new Message(this, arguments, terse);
+  }
+
+  bool get hasHowToFix => howToFix != null && howToFix != DONT_KNOW_HOW_TO_FIX;
+}
+
+class Message {
+  final MessageTemplate template;
+  final Map arguments;
+  final bool terse;
+  String message;
+
+  Message(this.template, this.arguments, this.terse) {
+    assert(() { computeMessage(); return true; });
+  }
+
+  MessageKind get kind => template.kind;
+
+  String computeMessage() {
+    if (message == null) {
+      message = template.template;
+      arguments.forEach((key, value) {
+        message = message.replaceAll('#{${key}}', convertToString(value));
+      });
+      assert(invariant(
+          CURRENT_ELEMENT_SPANNABLE,
+          kind == MessageKind.GENERIC ||
+            !message.contains(new RegExp(r'#\{.+\}')),
+          message: 'Missing arguments in error message: "$message"'));
+      if (!terse && template.hasHowToFix) {
+        String howToFix = template.howToFix;
+        arguments.forEach((key, value) {
+          howToFix = howToFix.replaceAll('#{${key}}', convertToString(value));
+        });
+        message = '$message\n$howToFix';
+      }
+    }
+    return message;
+  }
+
+  String toString() {
+    return computeMessage();
+  }
+
+  bool operator==(other) {
+    if (other is !Message) return false;
+    return (template == other.template) && (toString() == other.toString());
+  }
+
+  int get hashCode => throw new UnsupportedError('Message.hashCode');
+
+  static String convertToString(value) {
+    if (value is ErrorToken) {
+      // Shouldn't happen.
+      return value.assertionMessage;
+    } else if (value is Token) {
+      value = value.value;
+    }
+    return '$value';
+  }
+}
diff --git a/pkg/compiler/lib/src/diagnostics/source_span.dart b/pkg/compiler/lib/src/diagnostics/source_span.dart
new file mode 100644
index 0000000..95c3c75
--- /dev/null
+++ b/pkg/compiler/lib/src/diagnostics/source_span.dart
@@ -0,0 +1,51 @@
+// Copyright (c) 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.diagnostics.source_span;
+
+import '../tokens/token.dart' show
+    Token;
+import '../tree/tree.dart' show
+    Node;
+import 'spannable.dart' show
+    Spannable;
+
+class SourceSpan implements Spannable {
+  final Uri uri;
+  final int begin;
+  final int end;
+
+  const SourceSpan(this.uri, this.begin, this.end);
+
+  factory SourceSpan.fromNode(Uri uri, Node node) {
+    return new SourceSpan.fromTokens(
+        uri, node.getBeginToken(), node.getEndToken());
+  }
+
+  factory SourceSpan.fromTokens(Uri uri, Token begin, Token end) {
+    final beginOffset = begin.charOffset;
+    final endOffset = end.charOffset + end.charCount;
+
+    // [begin] and [end] might be the same for the same empty token. This
+    // happens for instance when scanning '$$'.
+    assert(endOffset >= beginOffset);
+    return new SourceSpan(uri, beginOffset, endOffset);
+  }
+
+  int get hashCode {
+    return 13 * uri.hashCode +
+           17 * begin.hashCode +
+           19 * end.hashCode;
+  }
+
+  bool operator ==(other) {
+    if (identical(this, other)) return true;
+    if (other is! SourceSpan) return false;
+    return uri == other.uri &&
+           begin == other.begin &&
+           end == other.end;
+  }
+
+  String toString() => 'SourceSpan($uri, $begin, $end)';
+}
diff --git a/pkg/compiler/lib/src/diagnostics/spannable.dart b/pkg/compiler/lib/src/diagnostics/spannable.dart
new file mode 100644
index 0000000..ea9ae1f
--- /dev/null
+++ b/pkg/compiler/lib/src/diagnostics/spannable.dart
@@ -0,0 +1,41 @@
+// 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.
+
+library dart2js.diagnostics.spannable;
+
+/**
+ * Tagging interface for classes from which source spans can be generated.
+ */
+// TODO(johnniwinther): Find a better name.
+// TODO(ahe): How about "Bolt"?
+abstract class Spannable {}
+
+class _SpannableSentinel implements Spannable {
+  final String name;
+
+  const _SpannableSentinel(this.name);
+
+  String toString() => name;
+}
+
+/// Sentinel spannable used to mark that diagnostics should point to the
+/// current element. Note that the diagnostic reporting will fail if the current
+/// element is `null`.
+const Spannable CURRENT_ELEMENT_SPANNABLE =
+    const _SpannableSentinel("Current element");
+
+/// Sentinel spannable used to mark that there might be no location for the
+/// diagnostic. Use this only when it is not an error not to have a current
+/// element.
+const Spannable NO_LOCATION_SPANNABLE =
+    const _SpannableSentinel("No location");
+
+class SpannableAssertionFailure {
+  final Spannable node;
+  final String message;
+  SpannableAssertionFailure(this.node, this.message);
+
+  String toString() => 'Assertion failure'
+                       '${message != null ? ': $message' : ''}';
+}
diff --git a/pkg/compiler/lib/src/dump_info.dart b/pkg/compiler/lib/src/dump_info.dart
index 3b8f8bc..22fa2f0 100644
--- a/pkg/compiler/lib/src/dump_info.dart
+++ b/pkg/compiler/lib/src/dump_info.dart
@@ -4,387 +4,338 @@
 
 library dump_info;
 
-import 'dart:convert' show
-    HtmlEscape,
-    JsonEncoder,
-    StringConversionSink,
-    ChunkedConversionSink;
+import 'dart:convert'
+    show HtmlEscape, JsonEncoder, StringConversionSink, ChunkedConversionSink;
 
+import 'package:dart2js_info/info.dart';
+
+import 'common.dart';
+import 'common/tasks.dart' show
+    CompilerTask;
+import 'constants/values.dart' show ConstantValue;
+import 'compiler.dart' show
+    Compiler;
 import 'elements/elements.dart';
 import 'elements/visitor.dart';
-import 'dart2jslib.dart' show
-    Backend,
-    CodeBuffer,
-    Compiler,
-    CompilerTask,
-    MessageKind;
-import 'types/types.dart' show TypeMask;
-import 'deferred_load.dart' show OutputUnit;
-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 'deferred_load.dart' show
+    OutputUnit;
+import 'js_backend/js_backend.dart' show
+    JavaScriptBackend;
+import 'js_emitter/full_emitter/emitter.dart' as full show
+    Emitter;
 import 'js/js.dart' as jsAst;
-import 'universe/universe.dart' show Selector, UniverseSelector;
-import 'util/util.dart' show NO_LOCATION_SPANNABLE;
+import 'universe/universe.dart' show
+    UniverseSelector;
+import 'info/send_info.dart' show collectSendMeasurements;
 
-/// Maps objects to an id.  Supports lookups in
-/// both directions.
-class IdMapper<T>{
-  Map<int, T> _idToElement = {};
-  Map<T, int> _elementToId = {};
-  int _idCounter = 0;
-  final String name;
-
-  IdMapper(this.name);
-
-  Iterable<T> get elements => _elementToId.keys;
-
-  String add(T e) {
-    if (_elementToId.containsKey(e)) {
-      return name + "/${_elementToId[e]}";
-    }
-
-    _idToElement[_idCounter] = e;
-    _elementToId[e] = _idCounter;
-    _idCounter += 1;
-    return name + "/${_idCounter - 1}";
-  }
-}
-
-class GroupedIdMapper {
-  // Mappers for specific kinds of elements.
-  IdMapper<LibraryElement> _library = new IdMapper('library');
-  IdMapper<TypedefElement> _typedef = new IdMapper('typedef');
-  IdMapper<FieldElement> _field = new IdMapper('field');
-  IdMapper<ClassElement> _class = new IdMapper('class');
-  IdMapper<FunctionElement> _function = new IdMapper('function');
-  IdMapper<OutputUnit> _outputUnit = new IdMapper('outputUnit');
-
-  Iterable<Element> get functions => _function.elements;
-
-  // Convert this database of elements into JSON for rendering
-  Map<String, dynamic> _toJson(ElementToJsonVisitor elementToJson) {
-    Map<String, dynamic> json = {};
-    var m = [_library, _typedef, _field, _class, _function];
-    for (IdMapper mapper in m) {
-      Map<String, dynamic> innerMapper = {};
-      mapper._idToElement.forEach((k, v) {
-        // All these elements are already cached in the
-        // jsonCache, so this is just an access.
-        var elementJson = elementToJson.process(v);
-        if (elementJson != null) {
-          innerMapper["$k"] = elementJson;
-        }
-      });
-      json[mapper.name] = innerMapper;
-    }
-    return json;
-  }
-}
-
-class ElementToJsonVisitor
-    extends BaseElementVisitor<Map<String, dynamic>, dynamic> {
-  final GroupedIdMapper mapper = new GroupedIdMapper();
+class ElementInfoCollector extends BaseElementVisitor<Info, dynamic> {
   final Compiler compiler;
 
-  final Map<Element, Map<String, dynamic>> jsonCache = {};
+  final AllInfo result = new AllInfo();
+  final Map<Element, Info> _elementToInfo = <Element, Info>{};
+  final Map<ConstantValue, Info> _constantToInfo = <ConstantValue, Info>{};
+  final Map<OutputUnit, OutputUnitInfo> _outputToInfo = {};
 
-  String dart2jsVersion;
-
-  ElementToJsonVisitor(this.compiler);
+  ElementInfoCollector(this.compiler);
 
   void run() {
-    dart2jsVersion = compiler.hasBuildId ? compiler.buildId : null;
+    compiler.dumpInfoTask._constantToNode.forEach((constant, node) {
+      // TODO(sigmund): add dependencies on other constants
+      var size = compiler.dumpInfoTask._nodeToSize[node];
+      var code = jsAst.prettyPrint(node, compiler).getText();
+      var info = new ConstantInfo(size: size, code: code);
+      _constantToInfo[constant] = info;
+      result.constants.add(info);
 
-    for (LibraryElement library in compiler.libraryLoader.libraries.toList()) {
-      visit(library);
-    }
+    });
+    compiler.libraryLoader.libraries.forEach(visit);
   }
 
-  Map<String, dynamic> visit(Element e, [_]) => e.accept(this, null);
+  Info visit(Element e, [_]) => e.accept(this, null);
 
-  // If keeping the element is in question (like if a function has a size
-  // of zero), only keep it if it holds dependencies to elsewhere.
+  /// Whether to emit information about [element].
+  ///
+  /// By default we emit information for any element that contributes to the
+  /// output size. Either becuase the it is a function being emitted or inlined,
+  /// or because it is an element that holds dependencies to other elements.
   bool shouldKeep(Element element) {
-    return compiler.dumpInfoTask.selectorsFromElement.containsKey(element)
-        || compiler.dumpInfoTask.inlineCount.containsKey(element);
+    return compiler.dumpInfoTask.selectorsFromElement.containsKey(element) ||
+        compiler.dumpInfoTask.inlineCount.containsKey(element);
   }
 
-  Map<String, dynamic> toJson() {
-    return mapper._toJson(this);
+  /// Visits [element] and produces it's corresponding info.
+  Info process(Element element) {
+    // TODO(sigmund): change the visit order to eliminate the need to check
+    // whether or not an element has been processed.
+    return _elementToInfo.putIfAbsent(element, () => visit(element));
   }
 
-  // Memoization of the JSON creating process.
-  Map<String, dynamic> process(Element element) {
-    return jsonCache.putIfAbsent(element, () => visit(element));
-  }
+  Info visitElement(Element element, _) => null;
 
-  // Returns the id of an [element] if it has already been processed.
-  // If the element has not been processed, this function does not
-  // process it, and simply returns null instead.
-  String idOf(Element element) {
-    if (jsonCache.containsKey(element) && jsonCache[element] != null) {
-      return jsonCache[element]['id'];
-    } else {
-      return null;
-    }
-  }
-
-  Map<String, dynamic> visitElement(Element element, _) {
-    return null;
-  }
-
-  Map<String, dynamic> visitConstructorBodyElement(
-      ConstructorBodyElement e, _) {
+  FunctionInfo visitConstructorBodyElement(ConstructorBodyElement e, _) {
     return visitFunctionElement(e.constructor, _);
   }
 
-  Map<String, dynamic> visitLibraryElement(LibraryElement element, _) {
-    var id = mapper._library.add(element);
-    List<String> children = <String>[];
-
-    String libname = element.getLibraryName();
-    libname = libname == "" ? "<unnamed>" : libname;
-
+  LibraryInfo visitLibraryElement(LibraryElement element, _) {
+    String libname = element.hasLibraryName ? element.libraryName : "<unnamed>";
     int size = compiler.dumpInfoTask.sizeOf(element);
+    LibraryInfo info =
+      new LibraryInfo(libname, element.canonicalUri, null, size);
+    _elementToInfo[element] = info;
 
-    LibraryElement contentsOfLibrary = element.isPatched
-      ? element.patch : element;
-    contentsOfLibrary.forEachLocalMember((Element member) {
-      Map<String, dynamic> childJson = this.process(member);
-      if (childJson == null) return;
-      children.add(childJson['id']);
+    LibraryElement realElement = element.isPatched ? element.patch : element;
+    realElement.forEachLocalMember((Element member) {
+      Info child = this.process(member);
+      if (child is ClassInfo) {
+        info.classes.add(child);
+        child.parent = info;
+      } else if (child is FunctionInfo) {
+        info.topLevelFunctions.add(child);
+        child.parent = info;
+      } else if (child is FieldInfo) {
+        info.topLevelVariables.add(child);
+        child.parent = info;
+      } else if (child is TypedefInfo) {
+        info.typedefs.add(child);
+        child.parent = info;
+      } else if (child != null) {
+        print('unexpected child of $info: $child ==> ${child.runtimeType}');
+        assert(false);
+      }
     });
 
-    if (children.length == 0 && !shouldKeep(element)) {
-      return null;
-    }
-
-    return {
-      'kind': 'library',
-      'name': libname,
-      'size': size,
-      'id': id,
-      'children': children,
-      'canonicalUri': element.canonicalUri.toString()
-    };
+    if (info.isEmpty && !shouldKeep(element)) return null;
+    result.libraries.add(info);
+    return info;
   }
 
-  Map<String, dynamic> visitTypedefElement(TypedefElement element, _) {
-    String id = mapper._typedef.add(element);
-    return element.alias == null
-      ? null
-      : {
-        'id': id,
-        'type': element.alias.toString(),
-        'kind': 'typedef',
-        'name': element.name
-      };
+  TypedefInfo visitTypedefElement(TypedefElement element, _) {
+    if (!element.isResolved) return null;
+    TypedefInfo info = new TypedefInfo(element.name, '${element.alias}',
+        _unitInfoForElement(element));
+    _elementToInfo[element] = info;
+    result.typedefs.add(info);
+    return info;
   }
 
-  Map<String, dynamic> visitFieldElement(FieldElement element, _) {
-    String id = mapper._field.add(element);
-    List<String> children = [];
-    StringBuffer emittedCode = compiler.dumpInfoTask.codeOf(element);
-
+  FieldInfo visitFieldElement(FieldElement element, _) {
     TypeMask inferredType =
         compiler.typesTask.getGuaranteedTypeOfElement(element);
     // If a field has an empty inferred type it is never used.
-    if (inferredType == null || inferredType.isEmpty || element.isConst) {
-      return null;
-    }
+    if (inferredType == null || inferredType.isEmpty) return null;
 
     int size = compiler.dumpInfoTask.sizeOf(element);
-    String code;
+    String code = compiler.dumpInfoTask.codeOf(element);
+    if (code != null) size += code.length;
 
-    if (emittedCode != null) {
-      size += emittedCode.length;
-      code = emittedCode.toString();
-    }
-
-    for (Element closure in element.nestedClosures) {
-      var childJson = this.process(closure);
-      if (childJson != null) {
-        children.add(childJson['id']);
-        if (childJson.containsKey('size')) {
-          size += childJson['size'];
-        }
+    FieldInfo info = new FieldInfo(
+        name: element.name,
+        // We use element.hashCode because it is globally unique and it is
+        // available while we are doing codegen.
+        coverageId: '${element.hashCode}',
+        type: '${element.type}',
+        inferredType: '$inferredType',
+        size: size,
+        code: code,
+        outputUnit: _unitInfoForElement(element),
+        isConst: element.isConst);
+    _elementToInfo[element] = info;
+    if (element.isConst) {
+      var value = compiler.backend.constantCompilerTask
+          .getConstantValueForVariable(element);
+      if (value != null) {
+        info.initializer = _constantToInfo[value];
       }
     }
 
-    OutputUnit outputUnit =
-        compiler.deferredLoadTask.outputUnitForElement(element);
-
-    return {
-      'id': id,
-      'kind': 'field',
-      'type': element.type.toString(),
-      'inferredType': inferredType.toString(),
-      'name': element.name,
-      'children': children,
-      'size': size,
-      'code': code,
-      'outputUnit': mapper._outputUnit.add(outputUnit)
-    };
+    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;
+    result.fields.add(info);
+    return info;
   }
 
-  Map<String, dynamic> visitClassElement(ClassElement element, _) {
-    String id = mapper._class.add(element);
-    List<String> children = [];
+  ClassInfo visitClassElement(ClassElement element, _) {
+    ClassInfo classInfo = new ClassInfo(
+        name: element.name,
+        isAbstract: element.isAbstract,
+        outputUnit: _unitInfoForElement(element));
+    _elementToInfo[element] = classInfo;
 
     int size = compiler.dumpInfoTask.sizeOf(element);
-    JavaScriptBackend backend = compiler.backend;
-
-    Map<String, dynamic> modifiers = { 'abstract': element.isAbstract };
-
     element.forEachLocalMember((Element member) {
-      Map<String, dynamic> childJson = this.process(member);
-      if (childJson != null) {
-        children.add(childJson['id']);
+      Info info = this.process(member);
+      if (info == null) return;
+      if (info is FieldInfo) {
+        classInfo.fields.add(info);
+        info.parent = classInfo;
+      } 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) {
-            Map<String, dynamic> child = this.process(closure);
+      // 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;
 
-            // Look for the parent element of this closure which should
-            // be a class.  If it exists, set the display name to
-            // the name of the class + the name of the closure function.
-            Element parent = closure.enclosingElement;
-            Map<String, dynamic> processedParent = this.process(parent);
-            if (processedParent != null) {
-              child['name'] = "${processedParent['name']}.${child['name']}";
-            }
-
-            if (child != null) {
-              size += child['size'];
-            }
+          // 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}";
           }
+          size += closureInfo.size;
         }
       }
     });
 
+    classInfo.size = size;
+
     // Omit element if it is not needed.
+    JavaScriptBackend backend = compiler.backend;
     if (!backend.emitter.neededClasses.contains(element) &&
-        children.length == 0) {
+        classInfo.fields.isEmpty &&
+        classInfo.functions.isEmpty) {
       return null;
     }
-
-    OutputUnit outputUnit =
-        compiler.deferredLoadTask.outputUnitForElement(element);
-
-    return {
-      'name': element.name,
-      'size': size,
-      'kind': 'class',
-      'modifiers': modifiers,
-      'children': children,
-      'id': id,
-      'outputUnit': mapper._outputUnit.add(outputUnit)
-    };
+    result.classes.add(classInfo);
+    return classInfo;
   }
 
-  Map<String, dynamic> visitFunctionElement(FunctionElement element, _) {
-    String id = mapper._function.add(element);
-    String name = element.name;
-    String kind = "function";
-    List<String> children = [];
-    List<Map<String, dynamic>> parameters = [];
-    String inferredReturnType = null;
-    String returnType = null;
-    String sideEffects = null;
-
-    StringBuffer emittedCode = compiler.dumpInfoTask.codeOf(element);
+  FunctionInfo visitFunctionElement(FunctionElement element, _) {
     int size = compiler.dumpInfoTask.sizeOf(element);
+    // TODO(sigmund): consider adding a small info to represent unreachable
+    // code here.
+    if (size == 0 && !shouldKeep(element)) return null;
 
-    Map<String, dynamic> modifiers = {
-      'static': element.isStatic,
-      'const': element.isConst,
-      'factory': element.isFactoryConstructor,
-      'external': element.isPatched
-    };
-
+    String name = element.name;
+    int kind = FunctionInfo.TOP_LEVEL_FUNCTION_KIND;
     var enclosingElement = element.enclosingElement;
     if (enclosingElement.isField ||
         enclosingElement.isFunction ||
         element.isClosure ||
         enclosingElement.isConstructor) {
-      kind = "closure";
+      kind = FunctionInfo.CLOSURE_FUNCTION_KIND;
       name = "<unnamed>";
-    } else if (modifiers['static']) {
-      kind = 'function';
+    } else if (element.isStatic) {
+      kind = FunctionInfo.TOP_LEVEL_FUNCTION_KIND;
     } else if (enclosingElement.isClass) {
-      kind = 'method';
+      kind = FunctionInfo.METHOD_FUNCTION_KIND;
     }
 
     if (element.isConstructor) {
-      name == ""
-        ? "${element.enclosingElement.name}"
-        : "${element.enclosingElement.name}.${element.name}";
-      kind = "constructor";
+      name = name == ""
+          ? "${element.enclosingElement.name}"
+          : "${element.enclosingElement.name}.${element.name}";
+      kind = FunctionInfo.CONSTRUCTOR_FUNCTION_KIND;
     }
 
+    FunctionModifiers modifiers = new FunctionModifiers(
+        isStatic: element.isStatic,
+        isConst: element.isConst,
+        isFactory: element.isFactoryConstructor,
+        isExternal: element.isPatched);
+    String code = compiler.dumpInfoTask.codeOf(element);
+
+    List<ParameterInfo> parameters = <ParameterInfo>[];
     if (element.hasFunctionSignature) {
       FunctionSignature signature = element.functionSignature;
       signature.forEachParameter((parameter) {
-        parameters.add({
-          'name': parameter.name,
-          'type': '${compiler.typesTask.getGuaranteedTypeOfElement(parameter)}',
-          'declaredType': '${parameter.node.type}'
-        });
+        parameters.add(new ParameterInfo(
+            parameter.name,
+            '${compiler.typesTask.getGuaranteedTypeOfElement(parameter)}',
+            '${parameter.node.type}'));
       });
     }
 
-    if (element.isInstanceMember && !element.isAbstract &&
+    String returnType = null;
+    // TODO(sigmund): why all these checks?
+    if (element.isInstanceMember &&
+        !element.isAbstract &&
         compiler.world.allFunctions.contains(element)) {
       returnType = '${element.type.returnType}';
     }
-    inferredReturnType =
+    String inferredReturnType =
         '${compiler.typesTask.getGuaranteedReturnTypeOfElement(element)}';
-    sideEffects = compiler.world.getSideEffectsOfElement(element).toString();
+    String sideEffects = '${compiler.world.getSideEffectsOfElement(element)}';
 
+    int inlinedCount = compiler.dumpInfoTask.inlineCount[element];
+    if (inlinedCount == null) inlinedCount = 0;
+
+    FunctionInfo info = new FunctionInfo(
+        name: name,
+        // We use element.hashCode because it is globally unique and it is
+        // available while we are doing codegen.
+        coverageId: '${element.hashCode}',
+        modifiers: modifiers,
+        size: size,
+        returnType: returnType,
+        inferredReturnType: inferredReturnType,
+        parameters: parameters,
+        sideEffects: sideEffects,
+        inlinedCount: inlinedCount,
+        code: code,
+        type: element.type.toString(),
+        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) {
-        Map<String, dynamic> child = this.process(closure);
+        Info child = this.process(closure);
         if (child != null) {
-          child['kind'] = 'closure';
-          children.add(child['id']);
-          size += child['size'];
+          BasicInfo parent = this.process(closure.enclosingElement);
+          if (parent != null) {
+            child.name = "${parent.name}.${child.name}";
+          }
+          nestedClosures.add(child);
+          child.parent = parent;
+          size += child.size;
         }
       }
     }
-
-    if (size == 0 && !shouldKeep(element)) {
-      return null;
+    info.closures = nestedClosures;
+    result.functions.add(info);
+    if (const bool.fromEnvironment('send_stats')) {
+      info.measurements = collectSendMeasurements(element, compiler);
     }
+    return info;
+  }
 
-    int inlinedCount = compiler.dumpInfoTask.inlineCount[element];
-    if (inlinedCount == null) {
-      inlinedCount = 0;
-    }
-
+  OutputUnitInfo _unitInfoForElement(Element element) {
     OutputUnit outputUnit =
-        compiler.deferredLoadTask.outputUnitForElement(element);
-
-    return {
-      'kind': kind,
-      'name': name,
-      'id': id,
-      'modifiers': modifiers,
-      'children': children,
-      'size': size,
-      'returnType': returnType,
-      'inferredReturnType': inferredReturnType,
-      'parameters': parameters,
-      'sideEffects': sideEffects,
-      'inlinedCount': inlinedCount,
-      'code': emittedCode == null ? null : '$emittedCode',
-      'type': element.type.toString(),
-      'outputUnit': mapper._outputUnit.add(outputUnit)
-    };
+      compiler.deferredLoadTask.outputUnitForElement(element);
+    return _outputToInfo.putIfAbsent(outputUnit, () {
+      // Dump-info currently only works with the full emitter. If another
+      // emitter is used it will fail here.
+      JavaScriptBackend backend = compiler.backend;
+      full.Emitter emitter = backend.emitter.emitter;
+      OutputUnitInfo info = new OutputUnitInfo(
+          outputUnit.name, emitter.outputBuffers[outputUnit].length);
+      result.outputUnits.add(info);
+      return info;
+    });
   }
 }
 
@@ -394,13 +345,22 @@
   Selection(this.selectedElement, this.mask);
 }
 
-class DumpInfoTask extends CompilerTask {
-  DumpInfoTask(Compiler compiler)
-      : super(compiler);
+/// Interface used to record information from different parts of the compiler so
+/// we can emit them in the dump-info task.
+// TODO(sigmund,het): move more features here. Ideally the dump-info task
+// shouldn't reach into internals of other parts of the compiler. For example,
+// we currently reach into the full emitter and as a result we don't support
+// dump-info when using the startup-emitter (issue #24190).
+abstract class InfoReporter {
+  void reportInlined(Element element, Element inlinedFrom);
+}
+
+class DumpInfoTask extends CompilerTask implements InfoReporter {
+  DumpInfoTask(Compiler compiler) : super(compiler);
 
   String get name => "Dump Info";
 
-  ElementToJsonVisitor infoCollector;
+  ElementInfoCollector infoCollector;
 
   /// The size of the generated output.
   int _programSize;
@@ -411,7 +371,9 @@
   final Set<jsAst.Node> _tracking = new Set<jsAst.Node>();
   // A mapping from Dart Elements to Javascript AST Nodes.
   final Map<Element, List<jsAst.Node>> _elementToNodes =
-    <Element, List<jsAst.Node>>{};
+      <Element, List<jsAst.Node>>{};
+  final Map<ConstantValue, jsAst.Node> _constantToNode =
+      <ConstantValue, jsAst.Node>{};
   // A mapping from Javascript AST Nodes to the size of their
   // pretty-printed contents.
   final Map<jsAst.Node, int> _nodeToSize = <jsAst.Node, int>{};
@@ -427,7 +389,7 @@
     _programSize = programSize;
   }
 
-  void registerInlined(Element element, Element inlinedFrom) {
+  void reportInlined(Element element, Element inlinedFrom) {
     inlineCount.putIfAbsent(element, () => 0);
     inlineCount[element] += 1;
     inlineMap.putIfAbsent(inlinedFrom, () => new List<Element>());
@@ -446,6 +408,11 @@
     }
   }
 
+  final Map<Element, Set<Element>> _dependencies = {};
+  void registerDependency(Element source, Element target) {
+    _dependencies.putIfAbsent(source, () => new Set()).add(target);
+  }
+
   /**
    * Returns an iterable of [Selection]s that are used by
    * [element].  Each [Selection] contains an element that is
@@ -455,14 +422,13 @@
     if (!selectorsFromElement.containsKey(element)) {
       return const <Selection>[];
     } else {
-      return selectorsFromElement[element].expand(
-        (UniverseSelector selector) {
-          return compiler.world.allFunctions.filter(
-              selector.selector, selector.mask)
-              .map((element) {
-            return new Selection(element, selector.mask);
-          });
+      return selectorsFromElement[element].expand((UniverseSelector selector) {
+        return compiler.world.allFunctions
+            .filter(selector.selector, selector.mask)
+            .map((element) {
+          return new Selection(element, selector.mask);
         });
+      });
     }
   }
 
@@ -481,8 +447,17 @@
   void registerElementAst(Element element, jsAst.Node code) {
     if (compiler.dumpInfo) {
       _elementToNodes
-        .putIfAbsent(element, () => new List<jsAst.Node>())
-        .add(code);
+          .putIfAbsent(element, () => new List<jsAst.Node>())
+          .add(code);
+      _tracking.add(code);
+    }
+  }
+
+  void registerConstantAst(ConstantValue constant, jsAst.Node code) {
+    if (compiler.dumpInfo) {
+      assert(_constantToNode[constant] == null ||
+          _constantToNode[constant] == code);
+      _constantToNode[constant] = code;
       _tracking.add(code);
     }
   }
@@ -501,23 +476,19 @@
   // code was produced, return 0.
   int sizeOf(Element element) {
     if (_elementToNodes.containsKey(element)) {
-      return _elementToNodes[element]
-        .map(sizeOfNode)
-        .fold(0, (a, b) => a + b);
+      return _elementToNodes[element].map(sizeOfNode).fold(0, (a, b) => a + b);
     } else {
       return 0;
     }
   }
 
   int sizeOfNode(jsAst.Node node) {
-    if (_nodeToSize.containsKey(node)) {
-      return _nodeToSize[node];
-    } else {
-      return 0;
-    }
+    // TODO(sigmund): switch back to null aware operators (issue #24136)
+    var size = _nodeToSize[node];
+    return size == null ? 0 : size;
   }
 
-  StringBuffer codeOf(Element element) {
+  String codeOf(Element element) {
     List<jsAst.Node> code = _elementToNodes[element];
     if (code == null) return null;
     // Concatenate rendered ASTs.
@@ -525,19 +496,12 @@
     for (jsAst.Node ast in code) {
       sb.writeln(jsAst.prettyPrint(ast, compiler).getText());
     }
-    return sb;
-  }
-
-  void collectInfo() {
-    infoCollector = new ElementToJsonVisitor(compiler)..run();
+    return sb.toString();
   }
 
   void dumpInfo() {
     measure(() {
-      if (infoCollector == null) {
-        collectInfo();
-      }
-
+      infoCollector = new ElementInfoCollector(compiler)..run();
       StringBuffer jsonBuffer = new StringBuffer();
       dumpInfoJson(jsonBuffer);
       compiler.outputProvider('', 'info.json')
@@ -546,103 +510,67 @@
     });
   }
 
-
   void dumpInfoJson(StringSink buffer) {
     JsonEncoder encoder = const JsonEncoder.withIndent('  ');
     Stopwatch stopwatch = new Stopwatch();
     stopwatch.start();
 
-    Map<String, List<Map<String, String>>> holding =
-        <String, List<Map<String, String>>>{};
-    for (Element fn in infoCollector.mapper.functions) {
-      Iterable<Selection> pulling = getRetaining(fn);
+    // Recursively build links to function uses
+    Iterable<Element> functionElements =
+        infoCollector._elementToInfo.keys.where((k) => k is FunctionElement);
+    for (FunctionElement element in functionElements) {
+      FunctionInfo info = infoCollector._elementToInfo[element];
+      Iterable<Selection> uses = getRetaining(element);
       // Don't bother recording an empty list of dependencies.
-      if (pulling.length > 0) {
-        String fnId = infoCollector.idOf(fn);
-        // Some dart2js builtin functions are not
-        // recorded.  Don't register these.
-        if (fnId != null) {
-          holding[fnId] = pulling
-            .map((selection) {
-              return <String, String>{
-                "id": infoCollector.idOf(selection.selectedElement),
-                "mask": selection.mask.toString()
-              };
-            })
-            // Filter non-null ids for the same reason as above.
-            .where((a) => a['id'] != null)
-            .toList();
-        }
+      for (Selection selection in uses) {
+        // Don't register dart2js builtin functions that are not recorded.
+        Info useInfo = infoCollector._elementToInfo[selection.selectedElement];
+        if (useInfo == null) continue;
+        info.uses.add(new DependencyInfo(useInfo, '${selection.mask}'));
       }
     }
 
     // Track dependencies that come from inlining.
     for (Element element in inlineMap.keys) {
-      String keyId = infoCollector.idOf(element);
-      if (keyId != null) {
-        for (Element held in inlineMap[element]) {
-          String valueId = infoCollector.idOf(held);
-          if (valueId != null) {
-            holding.putIfAbsent(keyId, () => new List<Map<String, String>>())
-              .add(<String, String>{
-                "id": valueId,
-                "mask": "inlined"
-              });
-          }
-        }
+      CodeInfo outerInfo = infoCollector._elementToInfo[element];
+      if (outerInfo == null) continue;
+      for (Element inlined in inlineMap[element]) {
+        Info inlinedInfo = infoCollector._elementToInfo[inlined];
+        if (inlinedInfo == null) continue;
+        outerInfo.uses.add(new DependencyInfo(inlinedInfo, 'inlined'));
       }
     }
 
-    List<Map<String, dynamic>> outputUnits =
-        new List<Map<String, dynamic>>();
+    AllInfo result = infoCollector.result;
 
-    JavaScriptBackend backend = compiler.backend;
-    // Dump-info currently only works with the full emitter. If another
-    // emitter is used it will fail here.
-    full.Emitter fullEmitter = backend.emitter.emitter;
-
-    for (OutputUnit outputUnit in
-        infoCollector.mapper._outputUnit._elementToId.keys) {
-      String id = infoCollector.mapper._outputUnit.add(outputUnit);
-      outputUnits.add(<String, dynamic> {
-        'id': id,
-        'name': outputUnit.name,
-        'size': fullEmitter.outputBuffers[outputUnit].length,
-      });
+    for (Element element in _dependencies.keys) {
+      var a = infoCollector._elementToInfo[element];
+      if (a == null) continue;
+      result.dependencies[a] = _dependencies[element]
+        .map((o) => infoCollector._elementToInfo[o])
+        .where((o) => o != null)
+        .toList();
     }
 
-    Map<String, dynamic> outJson = {
-      'elements': infoCollector.toJson(),
-      'holding': holding,
-      'outputUnits': outputUnits,
-      'dump_version': 3,
-      'deferredFiles': compiler.deferredLoadTask.computeDeferredMap(),
-      // This increases when new information is added to the map, but the viewer
-      // still is compatible.
-      'dump_minor_version': '2'
-    };
+    result.deferredFiles = compiler.deferredLoadTask.computeDeferredMap();
+    stopwatch.stop();
+    result.program = new ProgramInfo(
+        entrypoint: infoCollector._elementToInfo[compiler.mainFunction],
+        size: _programSize,
+        dart2jsVersion: compiler.hasBuildId ? compiler.buildId : null,
+        compilationMoment: new DateTime.now(),
+        compilationDuration: compiler.totalCompileTime.elapsed,
+        toJsonDuration: stopwatch.elapsedMilliseconds,
+        dumpInfoDuration: this.timing,
+        noSuchMethodEnabled: compiler.backend.enabledNoSuchMethod,
+        minified: compiler.enableMinification);
 
-    Map<String, dynamic> generalProgramInfo = <String, dynamic> {
-      'size': _programSize,
-      'dart2jsVersion': infoCollector.dart2jsVersion,
-      'compilationMoment': new DateTime.now().toString(),
-      'compilationDuration': compiler.totalCompileTime.elapsed.toString(),
-      'toJsonDuration': stopwatch.elapsedMilliseconds,
-      'dumpInfoDuration': this.timing.toString(),
-      'noSuchMethodEnabled': backend.enabledNoSuchMethod,
-      'minified': compiler.enableMinification
-    };
-
-    outJson['program'] = generalProgramInfo;
-
-    ChunkedConversionSink<Object> sink =
-      encoder.startChunkedConversion(
-          new StringConversionSink.fromStringSink(buffer));
-    sink.add(outJson);
-    compiler.reportInfo(
-        NO_LOCATION_SPANNABLE,
-        MessageKind.GENERIC,
-        {'text': "View the dumped .info.json file at "
-                 "https://dart-lang.github.io/dump-info-visualizer"});
+    ChunkedConversionSink<Object> sink = encoder.startChunkedConversion(
+        new StringConversionSink.fromStringSink(buffer));
+    sink.add(result.toJson());
+    reporter.reportInfo(NO_LOCATION_SPANNABLE, MessageKind.GENERIC, {
+      'text': "View the dumped .info.json file at "
+          "https://dart-lang.github.io/dump-info-visualizer"
+    });
   }
 }
diff --git a/pkg/compiler/lib/src/elements/common.dart b/pkg/compiler/lib/src/elements/common.dart
index f9013c6..f9c4e59 100644
--- a/pkg/compiler/lib/src/elements/common.dart
+++ b/pkg/compiler/lib/src/elements/common.dart
@@ -6,9 +6,15 @@
 
 library elements.common;
 
-import '../dart2jslib.dart' show Compiler, isPrivateName;
-import '../dart_types.dart' show DartType, InterfaceType, FunctionType;
-import '../util/util.dart' show Link;
+import '../common/names.dart' show
+    Names,
+    Uris;
+import '../dart_types.dart' show
+    DartType,
+    InterfaceType,
+    FunctionType;
+import '../util/util.dart' show
+    Link;
 
 import 'elements.dart';
 
@@ -115,7 +121,7 @@
 
 abstract class LibraryElementCommon implements LibraryElement {
   @override
-  bool get isDartCore => canonicalUri == Compiler.DART_CORE;
+  bool get isDartCore => canonicalUri == Uris.dart_core;
 
   @override
   bool get isPlatformLibrary => canonicalUri.scheme == 'dart';
@@ -127,9 +133,9 @@
   bool get isInternalLibrary =>
       isPlatformLibrary && canonicalUri.path.startsWith('_');
 
-  String getLibraryOrScriptName() {
-    if (hasLibraryName()) {
-      return getLibraryName();
+  String get libraryOrScriptName {
+    if (hasLibraryName) {
+      return libraryName;
     } else {
       // Use the file name as script name.
       String path = canonicalUri.path;
@@ -139,7 +145,7 @@
 
   int compareTo(LibraryElement other) {
     if (this == other) return 0;
-    return getLibraryOrScriptName().compareTo(other.getLibraryOrScriptName());
+    return libraryOrScriptName.compareTo(other.libraryOrScriptName);
   }
 }
 
@@ -270,7 +276,7 @@
   @override
   Element lookupSuperMemberInLibrary(String memberName,
                                      LibraryElement library) {
-    bool isPrivate = isPrivateName(memberName);
+    bool isPrivate = Name.isPrivateName(memberName);
     for (ClassElement s = superclass; s != null; s = s.superclass) {
       // Private members from a different library are not visible.
       if (isPrivate && !identical(library, s.library)) continue;
@@ -379,7 +385,7 @@
   bool hasFieldShadowedBy(Element fieldMember) {
     assert(fieldMember.isField);
     String fieldName = fieldMember.name;
-    bool isPrivate = isPrivateName(fieldName);
+    bool isPrivate = Name.isPrivateName(fieldName);
     LibraryElement memberLibrary = fieldMember.library;
     ClassElement lookupClass = this.superclass;
     while (lookupClass != null) {
@@ -400,22 +406,11 @@
 
   @override
   bool implementsInterface(ClassElement intrface) {
-    for (DartType implementedInterfaceType in allSupertypes) {
-      ClassElement implementedInterface = implementedInterfaceType.element;
-      if (identical(implementedInterface, intrface)) {
-        return true;
-      }
-    }
-    return false;
+    return this != intrface &&
+        allSupertypesAndSelf.asInstanceOf(intrface) != null;
   }
 
-  /**
-   * Returns true if [this] is a subclass of [cls].
-   *
-   * This method is not to be used for checking type hierarchy and
-   * assignments, because it does not take parameterized types into
-   * account.
-   */
+  @override
   bool isSubclassOf(ClassElement cls) {
     // Use [declaration] for both [this] and [cls], because
     // declaration classes hold the superclass hierarchy.
@@ -427,10 +422,14 @@
   }
 
   FunctionType get callType {
-    MemberSignature member =
-        lookupInterfaceMember(const PublicName(Compiler.CALL_OPERATOR_NAME));
+    MemberSignature member = lookupInterfaceMember(Names.call);
     return member != null && member.isMethod ? member.type : null;
   }
+
+  @override
+  bool get isNamedMixinApplication {
+    return isMixinApplication && !isUnnamedMixinApplication;
+  }
 }
 
 abstract class FunctionSignatureCommon implements FunctionSignature {
diff --git a/pkg/compiler/lib/src/elements/elements.dart b/pkg/compiler/lib/src/elements/elements.dart
index 2f302b2..60fcb20 100644
--- a/pkg/compiler/lib/src/elements/elements.dart
+++ b/pkg/compiler/lib/src/elements/elements.dart
@@ -4,35 +4,27 @@
 
 library elements;
 
-
+import '../common.dart';
+import '../common/resolution.dart' show
+    Resolution;
+import '../compiler.dart' show
+    Compiler;
+import '../constants/constructors.dart';
 import '../constants/expressions.dart';
-import '../tree/tree.dart';
-import '../util/util.dart';
-import '../resolution/resolution.dart';
-
-import '../dart2jslib.dart' show InterfaceType,
-                                 DartType,
-                                 TypeVariableType,
-                                 TypedefType,
-                                 DualKind,
-                                 MessageKind,
-                                 DiagnosticListener,
-                                 Script,
-                                 FunctionType,
-                                 Selector,
-                                 SourceSpan,
-                                 Constant,
-                                 Compiler,
-                                 Backend,
-                                 isPrivateName;
-
 import '../dart_types.dart';
-
-import '../scanner/scannerlib.dart' show Token,
-                                         isUserDefinableOperator,
-                                         isMinusOperator;
-
+import '../resolution/scope.dart' show
+    Scope;
+import '../resolution/tree_elements.dart' show
+    TreeElements;
 import '../ordered_typeset.dart' show OrderedTypeSet;
+import '../script.dart';
+import '../tokens/token.dart' show
+    Token,
+    isUserDefinableOperator,
+    isMinusOperator;
+import '../tree/tree.dart';
+import '../util/characters.dart' show $_;
+import '../util/util.dart';
 
 import 'visitor.dart' show ElementVisitor;
 
@@ -110,6 +102,10 @@
       const ElementKind('abstract_field', ElementCategory.VARIABLE);
   static const ElementKind LIBRARY =
       const ElementKind('library', ElementCategory.NONE);
+  static const ElementKind IMPORT =
+      const ElementKind('import', ElementCategory.NONE);
+  static const ElementKind EXPORT =
+      const ElementKind('export', ElementCategory.NONE);
   static const ElementKind PREFIX =
       const ElementKind('prefix', ElementCategory.PREFIX);
   static const ElementKind TYPEDEF =
@@ -186,11 +182,17 @@
   String get name;
   ElementKind get kind;
   Element get enclosingElement;
-  Link<MetadataAnnotation> get metadata;
+  Iterable<MetadataAnnotation> get metadata;
 
   /// `true` if this element is a library.
   bool get isLibrary;
 
+  /// `true` if this element is an import declaration.
+  bool get isImport => kind == ElementKind.IMPORT;
+
+  /// `true` if this element is an export declaration.
+  bool get isExport => kind == ElementKind.EXPORT;
+
   /// `true` if this element is a compilation unit.
   bool get isCompilationUnit;
 
@@ -304,6 +306,8 @@
   bool get isTopLevel;
   bool get isAssignable;
   bool get isNative;
+  bool get isJsInterop;
+
   bool get isDeferredLoaderGetter;
 
   /// True if the element is declared in a patch library but has no
@@ -400,17 +404,20 @@
   bool get hasFixedBackendName;
   String get fixedBackendName;
 
+  String get jsInteropName;
+
   bool get isAbstract;
 
   Scope buildScope();
 
-  void diagnose(Element context, DiagnosticListener listener);
-
   // TODO(johnniwinther): Move this to [AstElement].
   /// Returns the [Element] that holds the [TreeElements] for this element.
   AnalyzableElement get analyzableElement;
 
   accept(ElementVisitor visitor, arg);
+
+  void setJsInteropName(String name);
+  void markAsJsInterop();
 }
 
 class Elements {
@@ -421,7 +428,7 @@
 
   /// Unwraps [element] reporting any warnings attached to it, if any.
   static Element unwrap(Element element,
-                        DiagnosticListener listener,
+                        DiagnosticReporter listener,
                         Spannable spannable) {
     if (element != null && element.isWarnOnUse) {
       WarnOnUseElement wrappedElement = element;
@@ -515,7 +522,7 @@
 
   static bool isNativeOrExtendsNative(ClassElement element) {
     if (element == null) return false;
-    if (element.isNative) return true;
+    if (element.isNative || element.isJsInterop) return true;
     assert(element.isResolved);
     return isNativeOrExtendsNative(element.superclass);
   }
@@ -525,7 +532,7 @@
     if (element == null) return !isClosureSend(send, element);
     return isInstanceMethod(element) ||
            isInstanceField(element) ||
-           send.isConditional;
+           (send.isConditional && !element.isStatic);
   }
 
   static bool isClosureSend(Send send, Element element) {
@@ -664,12 +671,6 @@
     return null;
   }
 
-  static String mapToUserOperator(String op) {
-    String userOperator = mapToUserOperatorOrNull(op);
-    if (userOperator == null) throw 'Unhandled operator: $op';
-    else return userOperator;
-  }
-
   static bool isNumberOrStringSupertype(Element element, Compiler compiler) {
     LibraryElement coreLibrary = compiler.coreLibrary;
     return (element == coreLibrary.find('Comparable'));
@@ -806,7 +807,7 @@
   /// Reports the attached warning and returns the wrapped element.
   /// [usageSpannable] is used to report messages on the reference of
   /// [wrappedElement].
-  Element unwrap(DiagnosticListener listener, Spannable usageSpannable);
+  Element unwrap(DiagnosticReporter listener, Spannable usageSpannable);
 }
 
 /// An ambiguous element represents multiple elements accessible by the same
@@ -820,6 +821,10 @@
   Map get messageArguments;
   Element get existingElement;
   Element get newElement;
+
+  /// Compute the info messages associated with an error/warning on [context].
+  List<DiagnosticMessage> computeInfos(
+      Element context, DiagnosticReporter listener);
 }
 
 // TODO(kasperl): This probably shouldn't be called an element. It's
@@ -842,6 +847,22 @@
   int compareTo(CompilationUnitElement other);
 }
 
+abstract class ImportElement extends Element {
+  Uri get uri;
+  LibraryElement get importedLibrary;
+  bool get isDeferred;
+  PrefixElement get prefix;
+  // TODO(johnniwinther): Remove this when no longer needed in source mirrors.
+  Import get node;
+}
+
+abstract class ExportElement extends Element {
+  Uri get uri;
+  LibraryElement get exportedLibrary;
+  // TODO(johnniwinther): Remove this when no longer needed in source mirrors.
+  Export get node;
+}
+
 abstract class LibraryElement extends Element
     implements ScopeContainerElement, AnalyzableElement {
   /**
@@ -857,9 +878,13 @@
 
   CompilationUnitElement get entryCompilationUnit;
   Link<CompilationUnitElement> get compilationUnits;
-  Iterable<LibraryTag> get tags;
-  LibraryName get libraryTag;
-  Link<Element> get exports;
+
+  /// The import declarations in this library, including the implicit import of
+  /// 'dart:core', if present.
+  Iterable<ImportElement> get imports;
+
+  /// The export declarations in this library.
+  Iterable<ExportElement> get exports;
 
   /**
    * [:true:] if this library is part of the platform, that is, its canonical
@@ -884,9 +909,6 @@
 
   LibraryElement get implementation;
 
-  /// Return the library element corresponding to an import or export.
-  LibraryElement getLibraryFromTag(LibraryDependency tag);
-
   Element find(String elementName);
   Element findLocal(String elementName);
   Element findExported(String elementName);
@@ -896,32 +918,35 @@
   void forEachImport(f(Element element));
 
   /// Returns the imports that import element into this library.
-  Link<Import> getImportsFor(Element element);
+  Iterable<ImportElement> getImportsFor(Element element);
 
-  bool hasLibraryName();
-  String getLibraryName();
+  /// `true` if this library has name as given through a library tag.
+  bool get hasLibraryName;
 
-  /**
-   * Returns the library name (as defined by the library tag) or for script
-   * (which have no library tag) the script file name. The latter case is used
-   * to provide a 'library name' for scripts to use for instance in dartdoc.
-   *
-   * Note: the returned filename is still escaped ("a%20b.dart" instead of
-   * "a b.dart").
-   */
-  String getLibraryOrScriptName();
+  /// The library name, which is either the name given in the library tag
+  /// or the empty string if there is no library tag.
+  String get libraryName;
+
+  /// Returns the library name (as defined by the library tag) or for script
+  /// (which have no library tag) the script file name. The latter case is used
+  /// to provide a 'library name' for scripts to use for instance in dartdoc.
+  ///
+  /// Note: the returned filename is still escaped ("a%20b.dart" instead of
+  /// "a b.dart").
+  String get libraryOrScriptName;
 
   int compareTo(LibraryElement other);
 }
 
 /// The implicit scope defined by a import declaration with a prefix clause.
 abstract class PrefixElement extends Element {
-  void addImport(Element element, Import import, DiagnosticListener listener);
   Element lookupLocalMember(String memberName);
+
   /// Is true if this prefix belongs to a deferred import.
   bool get isDeferred;
-  void markAsDeferred(Import import);
-  Import get deferredImport;
+
+  /// Import that declared this deferred prefix.
+  ImportElement get deferredImport;
 }
 
 /// A type alias definition.
@@ -945,7 +970,7 @@
   /// For instance `(int)->void` for `typedef void F(int)`.
   DartType get alias;
 
-  void checkCyclicReference(Compiler compiler);
+  void checkCyclicReference(Resolution resolution);
 }
 
 /// An executable element is an element that can hold code.
@@ -972,7 +997,7 @@
   /// The local functions defined within this member.
   List<FunctionElement> get nestedClosures;
 
-  /// The name of this member taking privacy into account.
+  /// The name of this member, taking privacy into account.
   Name get memberName;
 }
 
@@ -1266,7 +1291,8 @@
   /// `null` otherwise.
   ConstantConstructor get constantConstructor;
 
-  /// `true` if this constructor is either `bool.fromEnviroment`
+  /// `true` if this constructor is one of `bool.fromEnvironment`,
+  /// `int.fromEnvironment`, or `String.fromEnvironment`.
   bool get isFromEnvironmentConstructor;
 
   /// Use [enclosingClass] instead.
@@ -1283,6 +1309,9 @@
 /// [TypeDeclarationElement] defines the common interface for class/interface
 /// declarations and typedefs.
 abstract class TypeDeclarationElement extends Element implements AstElement {
+  /// The name of this type declaration, taking privacy into account.
+  Name get memberName;
+
   /// Do not use [computeType] outside of the resolver; instead retrieve the
   /// type from the [thisType] or [rawType], depending on the use case.
   ///
@@ -1290,7 +1319,7 @@
   /// error and calling [computeType] covers that error.
   /// This method will go away!
   @deprecated
-  GenericType computeType(Compiler compiler);
+  GenericType computeType(Resolution resolution);
 
   /**
    * The `this type` for this type declaration.
@@ -1330,7 +1359,7 @@
 
   bool get isResolved;
 
-  void ensureResolved(Compiler compiler);
+  void ensureResolved(Resolution resolution);
 }
 
 abstract class ClassElement extends TypeDeclarationElement
@@ -1369,8 +1398,23 @@
 
   /// `true` if this class is an enum declaration.
   bool get isEnumClass;
+
+  /// `true` if this class is a mixin application, either named or unnamed.
   bool get isMixinApplication;
+
+  /// `true` if this class is a named mixin application, e.g.
+  ///
+  ///     class NamedMixinApplication = SuperClass with MixinClass;
+  ///
+  bool get isNamedMixinApplication;
+
+  /// `true` if this class is an unnamed mixin application, e.g. the synthesized
+  /// `SuperClass+MixinClass` mixin application class in:
+  ///
+  ///     class Class extends SuperClass with MixinClass {}
+  ///
   bool get isUnnamedMixinApplication;
+
   bool get hasBackendMembers;
   bool get hasLocalScopeMembers;
 
@@ -1381,13 +1425,19 @@
   /// implementing the interface or by providing a [call] method.
   bool implementsFunction(Compiler compiler);
 
+  /// Returns `true` if this class extends [cls] directly or indirectly.
+  ///
+  /// This method is not to be used for checking type hierarchy and assignments,
+  /// because it does not take parameterized types into account.
   bool isSubclassOf(ClassElement cls);
-  /// Returns true if `this` explicitly/nominally implements [intrface].
+
+  /// Returns `true` if this class explicitly implements [intrface].
   ///
   /// Note that, if [intrface] is the `Function` class, this method returns
   /// false for a class that has a `call` method but does not explicitly
   /// implement `Function`.
   bool implementsInterface(ClassElement intrface);
+
   bool hasFieldShadowedBy(Element fieldMember);
 
   /// Returns `true` if this class has a @proxy annotation.
@@ -1492,6 +1542,8 @@
 /// The [Element] for a type variable declaration on a generic class or typedef.
 abstract class TypeVariableElement extends Element
     implements AstElement, TypedElement {
+  /// The name of this type variable, taking privacy into account.
+  Name get memberName;
 
   /// Use [typeDeclaration] instead.
   @deprecated
@@ -1522,7 +1574,7 @@
   bool get hasNode;
   Node get node;
 
-  MetadataAnnotation ensureResolved(Compiler compiler);
+  MetadataAnnotation ensureResolved(Resolution resolution);
 }
 
 /// An [Element] that has a type.
@@ -1534,7 +1586,7 @@
   /// error and calling [computeType] covers that error.
   /// This method will go away!
   @deprecated
-  DartType computeType(Compiler compiler);
+  DartType computeType(Resolution resolution);
 
   DartType get type;
 }
@@ -1581,6 +1633,8 @@
   final TreeElements elements;
 
   ResolvedAst(this.element, this.node, this.elements);
+
+  String toString() => '$element:$node';
 }
 
 /// A [MemberSignature] is a member of an interface.
diff --git a/pkg/compiler/lib/src/elements/modelx.dart b/pkg/compiler/lib/src/elements/modelx.dart
index 0f96bdb..6dfd751 100644
--- a/pkg/compiler/lib/src/elements/modelx.dart
+++ b/pkg/compiler/lib/src/elements/modelx.dart
@@ -4,45 +4,46 @@
 
 library elements.modelx;
 
-import 'common.dart';
-import 'elements.dart';
-import '../constants/expressions.dart';
+import '../common.dart';
+import '../common/resolution.dart' show
+    Resolution,
+    Parsing;
+import '../compiler.dart' show
+    Compiler;
+import '../constants/constant_constructors.dart';
 import '../constants/constructors.dart';
-import '../helpers/helpers.dart';
-import '../tree/tree.dart';
-import '../util/util.dart';
-import '../resolution/resolution.dart';
-import '../resolution/class_members.dart' show ClassMemberMixin;
-
-import '../dart2jslib.dart' show
-    Backend,
-    Compiler,
-    Constant,
-    DartType,
-    DiagnosticListener,
-    DualKind,
-    FunctionType,
-    InterfaceType,
-    MessageKind,
-    MessageTemplate,
-    Script,
-    Selector,
-    SourceSpan,
-    TypeVariableType,
-    TypedefType,
-    invariant,
-    isPrivateName;
-
+import '../constants/expressions.dart';
 import '../dart_types.dart';
-
-import '../scanner/scannerlib.dart' show
-    EOF_TOKEN,
+import '../diagnostics/messages.dart' show
+    MessageTemplate;
+import '../ordered_typeset.dart' show
+    OrderedTypeSet;
+import '../resolution/class_members.dart' show
+    ClassMemberMixin;
+import '../resolution/scope.dart' show
+    ClassScope,
+    LibraryScope,
+    Scope,
+    TypeDeclarationScope;
+import '../resolution/resolution.dart' show
+    AnalyzableElementX;
+import '../resolution/tree_elements.dart' show
+    TreeElements;
+import '../resolution/typedefs.dart' show
+    TypedefCyclicVisitor;
+import '../script.dart';
+import '../tokens/token.dart' show
     ErrorToken,
     Token;
+import '../tokens/token_constants.dart' as Tokens show
+    EOF_TOKEN;
+import '../tree/tree.dart';
+import '../util/util.dart';
 
-import '../ordered_typeset.dart' show OrderedTypeSet;
-
-import 'visitor.dart' show ElementVisitor;
+import 'common.dart';
+import 'elements.dart';
+import 'visitor.dart' show
+    ElementVisitor;
 
 abstract class DeclarationSite {
 }
@@ -54,7 +55,7 @@
   final ElementKind kind;
   final Element enclosingElement;
   final int hashCode = ++elementHashCode;
-  Link<MetadataAnnotation> metadata = const Link<MetadataAnnotation>();
+  List<MetadataAnnotation> metadataInternal;
 
   ElementX(this.name, this.kind, this.enclosingElement) {
     assert(isErroneous || implementationLibrary != null);
@@ -62,20 +63,33 @@
 
   Modifiers get modifiers => Modifiers.EMPTY;
 
-  Node parseNode(DiagnosticListener listener) {
-    listener.internalError(this,
+  Node parseNode(Parsing parsing) {
+    parsing.reporter.internalError(this,
         'parseNode not implemented on $this.');
     return null;
   }
 
-  void addMetadata(MetadataAnnotationX annotation) {
-    assert(annotation.annotatedElement == null);
-    annotation.annotatedElement = this;
-    addMetadataInternal(annotation);
+  void set metadata(List<MetadataAnnotation> metadata) {
+    assert(metadataInternal == null);
+    for (MetadataAnnotationX annotation in metadata) {
+      assert(annotation.annotatedElement == null);
+      annotation.annotatedElement = this;
+    }
+    metadataInternal = metadata;
   }
 
-  void addMetadataInternal(MetadataAnnotation annotation) {
-    metadata = metadata.prepend(annotation);
+  Iterable<MetadataAnnotation> get metadata {
+    if (isPatch && metadataInternal != null) {
+      if (origin.metadata.isEmpty) {
+        return metadataInternal;
+      } else {
+        return <MetadataAnnotation>[]
+            ..addAll(origin.metadata)
+            ..addAll(metadataInternal);
+      }
+    }
+    return metadataInternal != null
+        ? metadataInternal : const <MetadataAnnotation>[];
   }
 
   bool get isClosure => false;
@@ -134,7 +148,7 @@
     String needle = isConstructor ? enclosingClassName : name;
     // The unary '-' operator has a special element name (specified).
     if (needle == 'unary-') needle = '-';
-    for (Token t = token; EOF_TOKEN != t.kind; t = t.next) {
+    for (Token t = token; Tokens.EOF_TOKEN != t.kind; t = t.next) {
       if (t is !ErrorToken && needle == t.value) return t;
     }
     return token;
@@ -220,9 +234,54 @@
 
   String _fixedBackendName = null;
   bool _isNative = false;
-  bool get isNative => _isNative;
-  bool get hasFixedBackendName => _fixedBackendName != null;
-  String get fixedBackendName => _fixedBackendName;
+  String _jsInteropName = null;
+  bool _isJsInterop = false;
+
+  /// Whether the element is implemented via typed JavaScript interop.
+  bool get isJsInterop => _isJsInterop;
+  /// JavaScript name for the element if it is implemented via typed JavaScript
+  /// interop.
+  String get jsInteropName => _jsInteropName;
+
+  void markAsJsInterop() {
+    _isJsInterop = true;
+  }
+
+  void setJsInteropName(String name) {
+    assert(invariant(this,
+        _isJsInterop,
+        message: 'Element is not js interop but given a js interop name.'));
+    _jsInteropName = name;
+  }
+
+  /// Whether the element corresponds to a native JavaScript construct either
+  /// through the existing [setNative] mechanism which is only allowed
+  /// for internal libraries or via the new typed JavaScriptInterop mechanism
+  /// which is allowed for user libraries.
+  bool get isNative => _isNative || isJsInterop;
+  bool get hasFixedBackendName => fixedBackendName != null || isJsInterop;
+
+  String _jsNameHelper(Element e) {
+    assert(invariant(this,
+        !(_isJsInterop &&  _jsInteropName == null),
+        message:
+            'Element is js interop but js interop name has not yet been'
+            'computed.'));
+    if (e.jsInteropName != null && e.jsInteropName.isNotEmpty) {
+      return e.jsInteropName;
+    }
+    return e.isLibrary ? 'self' : e.name;
+  }
+
+  String get fixedBackendName {
+    if (_fixedBackendName == null && isJsInterop) {
+      // If an element isJsInterop but _isJsInterop is false that means it is
+      // considered interop as the parent class is interop.
+      _fixedBackendName =  _jsNameHelper(isConstructor ? enclosingClass : this);
+    }
+    return _fixedBackendName;
+  }
+
   // Marks this element as a native element.
   void setNative(String name) {
     _isNative = true;
@@ -233,8 +292,6 @@
 
   bool get isAbstract => modifiers.isAbstract;
 
-  void diagnose(Element context, DiagnosticListener listener) {}
-
   bool get hasTreeElements => analyzableElement.hasTreeElements;
 
   TreeElements get treeElements => analyzableElement.treeElements;
@@ -275,7 +332,7 @@
   }
 
   get asyncMarker => AsyncMarker.SYNC;
-  Link<MetadataAnnotation> get metadata => unsupported();
+  Iterable<MetadataAnnotation> get metadata => unsupported();
   bool get hasNode => false;
   get node => unsupported();
   get hasResolvedAst => false;
@@ -296,8 +353,7 @@
   bool get isRedirectingGenerative => unsupported();
   bool get isRedirectingFactory => unsupported();
 
-  computeSignature(compiler) => unsupported();
-  computeType(compiler) => unsupported();
+  computeType(Resolution resolution) => unsupported();
 
   bool get hasFunctionSignature => false;
 
@@ -377,6 +433,10 @@
     throw new UnsupportedError("effectiveTargetType=");
   }
 
+  void _computeSignature(Resolution resolution) {
+    throw new UnsupportedError("_computeSignature");
+  }
+
   get typeCache {
     throw new UnsupportedError("typeCache");
   }
@@ -393,14 +453,18 @@
     throw new UnsupportedError("immediateRedirectionTarget=");
   }
 
-  get functionSignatureCache {
+  get _functionSignatureCache {
     throw new UnsupportedError("functionSignatureCache");
   }
 
-  set functionSignatureCache(_) {
+  set _functionSignatureCache(_) {
     throw new UnsupportedError("functionSignatureCache=");
   }
 
+  set functionSignature(_) {
+    throw new UnsupportedError("functionSignature=");
+  }
+
   get nestedClosures {
     throw new UnsupportedError("nestedClosures");
   }
@@ -452,22 +516,24 @@
       : this.wrappedElement = wrappedElement,
         super(wrappedElement.name, ElementKind.WARN_ON_USE, enclosingElement);
 
-  Element unwrap(DiagnosticListener listener, Spannable usageSpannable) {
+  Element unwrap(DiagnosticReporter reporter, Spannable usageSpannable) {
     var unwrapped = wrappedElement;
     if (warning != null) {
       Spannable spannable = warning.spannable;
       if (spannable == null) spannable = usageSpannable;
-      listener.reportWarning(
+      DiagnosticMessage warningMessage = reporter.createMessage(
           spannable, warning.messageKind, warning.messageArguments);
-    }
-    if (info != null) {
-      Spannable spannable = info.spannable;
-      if (spannable == null) spannable = usageSpannable;
-      listener.reportInfo(
-          spannable, info.messageKind, info.messageArguments);
+      List<DiagnosticMessage> infos = <DiagnosticMessage>[];
+      if (info != null) {
+        Spannable spannable = info.spannable;
+        if (spannable == null) spannable = usageSpannable;
+        infos.add(reporter.createMessage(
+            spannable, info.messageKind, info.messageArguments));
+      }
+      reporter.reportWarning(warningMessage, infos);
     }
     if (unwrapped.isWarnOnUse) {
-      unwrapped = unwrapped.unwrap(listener, usageSpannable);
+      unwrapped = unwrapped.unwrap(reporter, usageSpannable);
     }
     return unwrapped;
   }
@@ -516,6 +582,11 @@
     return set;
   }
 
+  List<DiagnosticMessage> computeInfos(Element context,
+                                       DiagnosticReporter reporter) {
+    return const <DiagnosticMessage>[];
+  }
+
   accept(ElementVisitor visitor, arg) {
     return visitor.visitAmbiguousElement(this, arg);
   }
@@ -534,22 +605,25 @@
       : super(messageKind, messageArguments, enclosingElement, existingElement,
               newElement);
 
-  void diagnose(Element context, DiagnosticListener listener) {
+  List<DiagnosticMessage> computeInfos(
+      Element context,
+      DiagnosticReporter reporter) {
+    List<DiagnosticMessage> infos = <DiagnosticMessage>[];
     Setlet ambiguousElements = flatten();
     MessageKind code = (ambiguousElements.length == 1)
         ? MessageKind.AMBIGUOUS_REEXPORT : MessageKind.AMBIGUOUS_LOCATION;
     LibraryElementX importer = context.library;
     for (Element element in ambiguousElements) {
-      var arguments = {'name': element.name};
-      listener.reportInfo(element, code, arguments);
-      Link<Import> importers = importer.importers.getImports(element);
-      listener.withCurrentElement(importer, () {
-        for (; !importers.isEmpty; importers = importers.tail) {
-          listener.reportInfo(
-              importers.head, MessageKind.IMPORTED_HERE, arguments);
+      Map arguments = {'name': element.name};
+      infos.add(reporter.createMessage(element, code, arguments));
+      reporter.withCurrentElement(importer, () {
+        for (ImportElement import in importer.importers.getImports(element)) {
+          infos.add(reporter.createMessage(
+              import, MessageKind.IMPORTED_HERE, arguments));
         }
       });
     }
+    return infos;
   }
 }
 
@@ -575,17 +649,24 @@
     return contents[name];
   }
 
-  void add(Element element, DiagnosticListener listener) {
+  void add(Element element, DiagnosticReporter reporter) {
     String name = element.name;
     if (element.isAccessor) {
-      addAccessor(element, contents[name], listener);
+      addAccessor(element, contents[name], reporter);
     } else {
       Element existing = contents.putIfAbsent(name, () => element);
       if (!identical(existing, element)) {
-        listener.reportError(
-            element, MessageKind.DUPLICATE_DEFINITION, {'name': name});
-        listener.reportInfo(existing,
-            MessageKind.EXISTING_DEFINITION, {'name': name});
+        reporter.reportError(
+            reporter.createMessage(
+                element,
+                MessageKind.DUPLICATE_DEFINITION,
+                {'name': name}),
+            <DiagnosticMessage>[
+                reporter.createMessage(
+                    existing,
+                    MessageKind.EXISTING_DEFINITION,
+                    {'name': name}),
+            ]);
       }
     }
   }
@@ -605,13 +686,19 @@
    */
   void addAccessor(AccessorElementX accessor,
                    Element existing,
-                   DiagnosticListener listener) {
+                   DiagnosticReporter reporter) {
     void reportError(Element other) {
-      listener.reportError(accessor,
-                           MessageKind.DUPLICATE_DEFINITION,
-                           {'name': accessor.name});
-      listener.reportInfo(
-          other, MessageKind.EXISTING_DEFINITION, {'name': accessor.name});
+      reporter.reportError(
+          reporter.createMessage(
+              accessor,
+              MessageKind.DUPLICATE_DEFINITION,
+              {'name': accessor.name}),
+          <DiagnosticMessage>[
+              reporter.createMessage(
+                  other,
+                  MessageKind.EXISTING_DEFINITION,
+                  {'name': accessor.name}),
+          ]);
 
       contents[accessor.name] = new DuplicatedElementX(
           MessageKind.DUPLICATE_DEFINITION, {'name': accessor.name},
@@ -650,7 +737,7 @@
       } else {
         field.setter = accessor;
       }
-      add(field, listener);
+      add(field, reporter);
     }
   }
 }
@@ -673,33 +760,49 @@
   @override
   LibraryElementX get library => enclosingElement.declaration;
 
+  void set metadata(List<MetadataAnnotation> metadata) {
+    for (MetadataAnnotationX annotation in metadata) {
+      assert(annotation.annotatedElement == null);
+      annotation.annotatedElement = this;
+    }
+    // TODO(johnniwinther): Remove this work-around when import, export,
+    // part, and part-of declarations are elements.
+    if (metadataInternal == null) {
+      metadataInternal = <MetadataAnnotation>[];
+    }
+    metadataInternal.addAll(metadata);
+  }
+
   void forEachLocalMember(f(Element element)) {
     localMembers.forEach(f);
   }
 
-  void addMember(Element element, DiagnosticListener listener) {
+  void addMember(Element element, DiagnosticReporter reporter) {
     // Keep a list of top level members.
     localMembers = localMembers.prepend(element);
     // Provide the member to the library to build scope.
     if (enclosingElement.isPatch) {
-      implementationLibrary.addMember(element, listener);
+      implementationLibrary.addMember(element, reporter);
     } else {
-      library.addMember(element, listener);
+      library.addMember(element, reporter);
     }
   }
 
-  void setPartOf(PartOf tag, DiagnosticListener listener) {
+  void setPartOf(PartOf tag, DiagnosticReporter reporter) {
     LibraryElementX library = enclosingElement;
     if (library.entryCompilationUnit == this) {
-      listener.reportError(tag, MessageKind.IMPORT_PART_OF);
+      partTag = tag;
+      reporter.reportErrorMessage(
+          tag, MessageKind.IMPORT_PART_OF);
       return;
     }
     if (!localMembers.isEmpty) {
-      listener.reportError(tag, MessageKind.BEFORE_TOP_LEVEL);
+      reporter.reportErrorMessage(
+          tag, MessageKind.BEFORE_TOP_LEVEL);
       return;
     }
     if (partTag != null) {
-      listener.reportWarning(tag, MessageKind.DUPLICATED_PART_OF);
+      reporter.reportWarningMessage(tag, MessageKind.DUPLICATED_PART_OF);
       return;
     }
     partTag = tag;
@@ -708,16 +811,22 @@
     if (libraryTag != null) {
       String expectedName = libraryTag.name.toString();
       if (expectedName != actualName) {
-        listener.reportWarning(tag.name,
+        reporter.reportWarningMessage(
+            tag.name,
             MessageKind.LIBRARY_NAME_MISMATCH,
             {'libraryName': expectedName});
       }
     } else {
-      listener.reportWarning(library,
-          MessageKind.MISSING_LIBRARY_NAME,
-          {'libraryName': actualName});
-      listener.reportInfo(tag.name,
-          MessageKind.THIS_IS_THE_PART_OF_TAG);
+      reporter.reportWarning(
+          reporter.createMessage(
+              library,
+              MessageKind.MISSING_LIBRARY_NAME,
+              {'libraryName': actualName}),
+          <DiagnosticMessage>[
+              reporter.createMessage(
+                  tag.name,
+                  MessageKind.THIS_IS_THE_PART_OF_TAG),
+          ]);
     }
   }
 
@@ -730,22 +839,26 @@
   }
 }
 
+/// Map from [Element] to the [ImportElement]s throught which it was imported.
+///
+/// This is used for error reporting and deferred loading.
 class Importers {
-  Map<Element, Link<Import>> importers = new Map<Element, Link<Import>>();
+  Map<Element, List<ImportElement>> importers =
+      new Map<Element, List<ImportElement>>();
 
-  Link<Import> getImports(Element element) {
-    Link<Import> imports = importers[element];
-    return imports != null ? imports : const Link<Import>();
+  /// Returns the the list of [ImportElement]s through which [element] was
+  /// imported.
+  List<ImportElement> getImports(Element element) {
+    List<ImportElement> imports = importers[element];
+    return imports != null ? imports : const <ImportElement>[];
   }
 
-  Import getImport(Element element) => getImports(element).head;
+  /// Returns the first [ImportElement] through which [element] was imported.
+  ImportElement getImport(Element element) => getImports(element).first;
 
-  void registerImport(Element element, Import import) {
-    if (import == null) return;
-
-    importers[element] =
-        importers.putIfAbsent(element, () => const Link<Import>())
-          .prepend(import);
+  /// Register [element] as imported through [import];
+  void registerImport(Element element, ImportElement import) {
+    importers.putIfAbsent(element, () => <ImportElement>[]).add(import);
   }
 }
 
@@ -768,8 +881,8 @@
    */
   void addImport(Element enclosingElement,
                  Element element,
-                 Import import,
-                 DiagnosticListener listener) {
+                 ImportElement import,
+                 DiagnosticReporter reporter) {
     LibraryElementX library = enclosingElement.library;
     Importers importers = library.importers;
 
@@ -783,7 +896,7 @@
     Element existing = importScope.putIfAbsent(name, () => element);
     importers.registerImport(element, import);
 
-    void registerWarnOnUseElement(Import import,
+    void registerWarnOnUseElement(ImportElement import,
                                   MessageKind messageKind,
                                   Element hidingElement,
                                   Element hiddenElement) {
@@ -795,7 +908,7 @@
               messageKind,
               {'name': name, 'hiddenUri': hiddenUri, 'hidingUri': hidingUri}),
           new WrappedMessage(
-              listener.spanFromSpannable(import),
+              reporter.spanFromSpannable(import),
               MessageKind.IMPORTED_HERE,
               {'name': name}),
           enclosingElement, hidingElement);
@@ -804,7 +917,7 @@
     }
 
     if (existing != element) {
-      Import existingImport = importers.getImport(existing);
+      ImportElement existingImport = importers.getImport(existing);
       if (existing.library.isPlatformLibrary &&
           !element.library.isPlatformLibrary) {
         // [existing] is implicitly hidden.
@@ -813,7 +926,7 @@
       } else if (!existing.library.isPlatformLibrary &&
                  element.library.isPlatformLibrary) {
         // [element] is implicitly hidden.
-        if (import == null) {
+        if (import.isSynthesized) {
           // [element] is imported implicitly (probably through dart:core).
           registerWarnOnUseElement(
               existingImport, MessageKind.HIDDEN_IMPLICIT_IMPORT,
@@ -834,6 +947,94 @@
   }
 
   Element operator [](String name) => importScope[name];
+
+  void forEach(f(Element element)) => importScope.values.forEach(f);
+}
+
+abstract class LibraryDependencyElementX extends ElementX {
+  final LibraryDependency node;
+  final Uri uri;
+  LibraryElement libraryDependency;
+
+  LibraryDependencyElementX(CompilationUnitElement enclosingElement,
+                            ElementKind kind,
+                            this.node,
+                            this.uri)
+      : super('', kind, enclosingElement);
+
+  @override
+  List<MetadataAnnotation> get metadata => node.metadata;
+
+  void set metadata(value) {
+    // The metadata is stored on [libraryDependency].
+    throw new SpannableAssertionFailure(
+        this, 'Cannot set metadata on a import/export.');
+  }
+
+  @override
+  Token get position => node.getBeginToken();
+
+  SourceSpan get sourcePosition {
+    return new SourceSpan.fromNode(compilationUnit.script.resourceUri, node);
+  }
+
+  String toString() => '$kind($uri)';
+}
+
+class ImportElementX extends LibraryDependencyElementX
+    implements ImportElement {
+  PrefixElementX prefix;
+
+  ImportElementX(CompilationUnitElement enclosingElement, Import node, Uri uri)
+      : super(enclosingElement, ElementKind.IMPORT, node, uri);
+
+  @override
+  Import get node => super.node;
+
+  @override
+  LibraryElement get importedLibrary => libraryDependency;
+
+  @override
+  accept(ElementVisitor visitor, arg) => visitor.visitImportElement(this, arg);
+
+  @override
+  bool get isDeferred => node.isDeferred;
+}
+
+class SyntheticImportElement extends ImportElementX {
+  SyntheticImportElement(CompilationUnitElement enclosingElement, Uri uri)
+      : super(enclosingElement, null, uri);
+
+  @override
+  Token get position => library.position;
+
+  @override
+  bool get isSynthesized => true;
+
+  @override
+  bool get isDeferred => false;
+
+  @override
+  List<MetadataAnnotation> get metadata => const <MetadataAnnotation>[];
+
+  @override
+  SourceSpan get sourcePosition => library.sourcePosition;
+}
+
+
+class ExportElementX extends LibraryDependencyElementX
+    implements ExportElement {
+
+  ExportElementX(CompilationUnitElement enclosingElement, Export node, Uri uri)
+      : super(enclosingElement, ElementKind.EXPORT, node, uri);
+
+  Export get node => super.node;
+
+  @override
+  LibraryElement get exportedLibrary => libraryDependency;
+
+  @override
+  accept(ElementVisitor visitor, arg) => visitor.visitExportElement(this, arg);
 }
 
 class LibraryElementX
@@ -871,6 +1072,9 @@
    */
   Link<Element> slotForExports;
 
+  List<ImportElement> _imports = <ImportElement>[];
+  List<ExportElement> _exports = <ExportElement>[];
+
   final Map<LibraryDependency, LibraryElement> tagMapping =
       new Map<LibraryDependency, LibraryElement>();
 
@@ -886,11 +1090,14 @@
     }
   }
 
-  Link<MetadataAnnotation> get metadata {
-    return (libraryTag == null) ? super.metadata : libraryTag.metadata;
+  Iterable<MetadataAnnotation> get metadata {
+    if (libraryTag != null) {
+      return libraryTag.metadata;
+    }
+    return const <MetadataAnnotation>[];
   }
 
-  set metadata(value) {
+  void set metadata(value) {
     // The metadata is stored on [libraryTag].
     throw new SpannableAssertionFailure(this, 'Cannot set metadata on Library');
   }
@@ -903,9 +1110,9 @@
     compilationUnits = compilationUnits.prepend(element);
   }
 
-  void addTag(LibraryTag tag, DiagnosticListener listener) {
+  void addTag(LibraryTag tag, DiagnosticReporter reporter) {
     if (tagsCache != null) {
-      listener.internalError(tag,
+      reporter.internalError(tag,
           "Library tags for $this have already been computed.");
     }
     tagsBuilder.addLast(tag);
@@ -919,13 +1126,17 @@
     return tagsCache;
   }
 
-  /// Record which element an import or export tag resolved to.
-  void recordResolvedTag(LibraryDependency tag, LibraryElement library) {
-    assert(tagMapping[tag] == null);
-    tagMapping[tag] = library;
+  void addImportDeclaration(ImportElement import) {
+    _imports.add(import);
   }
 
-  LibraryElement getLibraryFromTag(LibraryDependency tag) => tagMapping[tag];
+  Iterable<ImportElement> get imports => _imports;
+
+  void addExportDeclaration(ExportElement export) {
+    _exports.add(export);
+  }
+
+  Iterable<ExportElement> get exports => _exports;
 
   /**
    * Adds [element] to the import scope of this library.
@@ -934,17 +1145,19 @@
    * [ErroneousElement] will be put in the imported scope, allowing for
    * detection of ambiguous uses of imported names.
    */
-  void addImport(Element element, Import import, DiagnosticListener listener) {
-    importScope.addImport(this, element, import, listener);
+  void addImport(Element element,
+                 ImportElement import,
+                 DiagnosticReporter reporter) {
+    importScope.addImport(this, element, import, reporter);
   }
 
-  void addMember(Element element, DiagnosticListener listener) {
+  void addMember(Element element, DiagnosticReporter reporter) {
     localMembers = localMembers.prepend(element);
-    addToScope(element, listener);
+    addToScope(element, reporter);
   }
 
-  void addToScope(Element element, DiagnosticListener listener) {
-    localScope.add(element, listener);
+  void addToScope(Element element, DiagnosticReporter reporter) {
+    localScope.add(element, reporter);
   }
 
   Element localLookup(String elementName) {
@@ -961,12 +1174,6 @@
    */
   bool get exportsHandled => slotForExports != null;
 
-  Link<Element> get exports {
-    assert(invariant(this, exportsHandled,
-                     message: 'Exports not handled on $this'));
-    return slotForExports;
-  }
-
   /**
    * Sets the export scope of this library. This method can only be called once.
    */
@@ -1008,15 +1215,19 @@
   /** Look up a top-level element in this library, but only look for
     * non-imported elements. Returns null if no such element exist. */
   Element findLocal(String elementName) {
-    // TODO(johnniwinther): How to handle injected elements in the patch
+    // TODO((johnniwinther): How to handle injected elements in the patch
     // library?
     Element result = localScope.lookup(elementName);
-    if (result == null || result.library != this) return null;
+    if (result == null && isPatch) {
+      return origin.findLocal(elementName);
+    }
     return result;
   }
 
   Element findExported(String elementName) {
-    for (Link link = exports; !link.isEmpty; link = link.tail) {
+    assert(invariant(this, exportsHandled,
+                     message: 'Exports not handled on $this'));
+    for (Link link = slotForExports; !link.isEmpty; link = link.tail) {
       Element element = link.head;
       if (element.name == elementName) return element;
     }
@@ -1024,16 +1235,17 @@
   }
 
   void forEachExport(f(Element element)) {
-    exports.forEach((Element e) => f(e));
+    assert(invariant(this, exportsHandled,
+                     message: 'Exports not handled on $this'));
+    slotForExports.forEach((Element e) => f(e));
   }
 
-  Link<Import> getImportsFor(Element element) => importers.getImports(element);
-
-  @override
-  void forEachImport(f(Element element)) {
-    importScope.importScope.values.forEach(f);
+  Iterable<ImportElement> getImportsFor(Element element) {
+    return importers.getImports(element);
   }
 
+  void forEachImport(f(Element element)) => importScope.forEach(f);
+
   void forEachLocalMember(f(Element element)) {
     if (isPatch) {
       // Patch libraries traverse both origin and injected members.
@@ -1055,21 +1267,27 @@
     return localScope.values.where((Element element) {
       // At this point [localScope] only contains members so we don't need
       // to check for foreign or prefix elements.
-      return !isPrivateName(element.name);
+      return !Name.isPrivateName(element.name);
     });
   }
 
-  bool hasLibraryName() => libraryTag != null;
+  bool get hasLibraryName => libraryTag != null;
 
-  /**
-   * Returns the library name, which is either the name given in the library tag
-   * or the empty string if there is no library tag.
-   */
-  String getLibraryName() {
+  String get libraryName {
     if (libraryTag == null) return '';
     return libraryTag.name.toString();
   }
 
+  String get libraryOrScriptName {
+    if (libraryTag != null) {
+      return libraryTag.name.toString();
+    } else {
+      // Use the file name as script name.
+      String path = canonicalUri.path;
+      return path.substring(path.lastIndexOf('/') + 1);
+    }
+  }
+
   Scope buildScope() => new LibraryScope(this);
 
   String toString() {
@@ -1096,35 +1314,35 @@
 
   final ImportScope importScope = new ImportScope();
 
-  bool get isDeferred => _deferredImport != null;
+  bool get isDeferred => deferredImport != null;
 
   // Only needed for deferred imports.
-  Import _deferredImport;
-  Import get deferredImport => _deferredImport;
+  final ImportElement deferredImport;
 
-  PrefixElementX(String prefix, Element enclosing, this.firstPosition)
+  PrefixElementX(String prefix,
+                 Element enclosing,
+                 this.firstPosition,
+                 this.deferredImport)
       : super(prefix, ElementKind.PREFIX, enclosing);
 
   bool get isTopLevel => false;
 
   Element lookupLocalMember(String memberName) => importScope[memberName];
 
-  DartType computeType(Compiler compiler) => const DynamicType();
+  DartType computeType(Resolution resolution) => const DynamicType();
 
   Token get position => firstPosition;
 
-  void addImport(Element element, Import import, DiagnosticListener listener) {
-    importScope.addImport(this, element, import, listener);
+  void addImport(Element element,
+                 ImportElement import,
+                 DiagnosticReporter reporter) {
+    importScope.addImport(this, element, import, reporter);
   }
 
   accept(ElementVisitor visitor, arg) {
     return visitor.visitPrefixElement(this, arg);
   }
 
-  void markAsDeferred(Import deferredImport) {
-    _deferredImport = deferredImport;
-  }
-
   String toString() => '$kind($name)';
 }
 
@@ -1138,7 +1356,13 @@
   /**
    * The type annotation which defines this typedef.
    */
-  DartType alias;
+  DartType aliasCache;
+
+  DartType get alias {
+    assert(invariant(this, hasBeenCheckedForCycles,
+        message: "$this has not been checked for cycles."));
+    return aliasCache;
+  }
 
   /// [:true:] if the typedef has been checked for cyclic reference.
   bool hasBeenCheckedForCycles = false;
@@ -1166,17 +1390,17 @@
    */
   FunctionSignature functionSignature;
 
-  TypedefType computeType(Compiler compiler) {
+  TypedefType computeType(Resolution resolution) {
     if (thisTypeCache != null) return thisTypeCache;
-    Typedef node = parseNode(compiler);
-    setThisAndRawTypes(compiler, createTypeVariables(node.typeParameters));
-    ensureResolved(compiler);
+    Typedef node = parseNode(resolution.parsing);
+    setThisAndRawTypes(createTypeVariables(node.typeParameters));
+    ensureResolved(resolution);
     return thisTypeCache;
   }
 
-  void ensureResolved(Compiler compiler) {
+  void ensureResolved(Resolution resolution) {
     if (resolutionState == STATE_NOT_STARTED) {
-      compiler.resolver.resolve(this);
+      resolution.resolveTypedef(this);
     }
   }
 
@@ -1188,10 +1412,11 @@
     return new TypeDeclarationScope(enclosingElement.buildScope(), this);
   }
 
-  void checkCyclicReference(Compiler compiler) {
+  void checkCyclicReference(Resolution resolution) {
     if (hasBeenCheckedForCycles) return;
-    var visitor = new TypedefCyclicVisitor(compiler, this);
-    computeType(compiler).accept(visitor, null);
+    TypedefCyclicVisitor visitor =
+        new TypedefCyclicVisitor(resolution.reporter, this);
+    computeType(resolution).accept(visitor, null);
     hasBeenCheckedForCycles = true;
   }
 
@@ -1210,7 +1435,7 @@
   VariableDefinitions definitions;
   DartType type;
   final Modifiers modifiers;
-  Link<MetadataAnnotation> metadata = const Link<MetadataAnnotation>();
+  List<MetadataAnnotation> metadataInternal;
 
   VariableList(Modifiers this.modifiers);
 
@@ -1220,11 +1445,30 @@
     assert(modifiers != null);
   }
 
-  VariableDefinitions parseNode(Element element, DiagnosticListener listener) {
+  Iterable<MetadataAnnotation> get metadata {
+    return metadataInternal != null
+        ? metadataInternal : const <MetadataAnnotation>[];
+  }
+
+  void set metadata(List<MetadataAnnotation> metadata) {
+    if (metadata.isEmpty) {
+      // For a multi declaration like:
+      //
+      //    @foo @bar var a, b, c
+      //
+      // the metadata list is reported through the declaration of `a`, and `b`
+      // and `c` report an empty list of metadata.
+      return;
+    }
+    assert(metadataInternal == null);
+    metadataInternal = metadata;
+  }
+
+  VariableDefinitions parseNode(Element element, Parsing parsing) {
     return definitions;
   }
 
-  DartType computeType(Element element, Compiler compiler) => type;
+  DartType computeType(Element element, Resolution resolution) => type;
 }
 
 abstract class ConstantVariableMixin implements VariableElement {
@@ -1244,7 +1488,7 @@
     if (isPatch) {
       ConstantVariableMixin originVariable = origin;
       originVariable.constant = value;
-      return null;
+      return;
     }
     assert(invariant(
         this, constantCache == null || constantCache == value,
@@ -1276,10 +1520,14 @@
 
   // TODO(johnniwinther): Ensure that the [TreeElements] for this variable hold
   // the mappings for all its metadata.
-  Link<MetadataAnnotation> get metadata => variables.metadata;
+  Iterable<MetadataAnnotation> get metadata => variables.metadata;
 
-  void addMetadataInternal(MetadataAnnotation annotation) {
-    variables.metadata = variables.metadata.prepend(annotation);
+  void set metadata(List<MetadataAnnotation> metadata) {
+    for (MetadataAnnotationX annotation in metadata) {
+      assert(annotation.annotatedElement == null);
+      annotation.annotatedElement = this;
+    }
+    variables.metadata = metadata;
   }
 
   // A variable cannot be patched therefore defines itself.
@@ -1299,10 +1547,10 @@
     return initializerCache;
   }
 
-  Node parseNode(DiagnosticListener listener) {
+  Node parseNode(Parsing parsing) {
     if (definitionsCache != null) return definitionsCache;
 
-    VariableDefinitions definitions = variables.parseNode(this, listener);
+    VariableDefinitions definitions = variables.parseNode(this, parsing);
     createDefinitions(definitions);
     return definitionsCache;
   }
@@ -1342,14 +1590,12 @@
     }
   }
 
-  DartType computeType(Compiler compiler) {
+  DartType computeType(Resolution resolution) {
     if (variables.type != null) return variables.type;
     // Call [parseNode] to ensure that [definitionsCache] and [initializerCache]
     // are set as a consequence of calling [computeType].
-    return compiler.withCurrentElement(this, () {
-      parseNode(compiler);
-      return variables.computeType(this, compiler);
-    });
+    parseNode(resolution.parsing);
+    return variables.computeType(this, resolution);
   }
 
   DartType get type {
@@ -1490,7 +1736,7 @@
     throw new UnsupportedError("copyWithEnclosing");
   }
 
-  DartType computeType(Compiler compiler) => type;
+  DartType computeType(Resolution resolution) => type;
 }
 
 /// [Element] for a parameter-like element.
@@ -1506,7 +1752,7 @@
    * kept to provide full information about parameter names through the mirror
    * system.
    */
-  FunctionSignature functionSignatureCache;
+  FunctionSignature _functionSignatureCache;
 
   FormalElementX(ElementKind elementKind,
                  FunctionTypedElement enclosingElement,
@@ -1521,9 +1767,9 @@
 
   Token get position => identifier.getBeginToken();
 
-  Node parseNode(DiagnosticListener listener) => definitions;
+  Node parseNode(Parsing parsing) => definitions;
 
-  DartType computeType(Compiler compiler) {
+  DartType computeType(Resolution resolution) {
     assert(invariant(this, type != null,
         message: "Parameter type has not been set for $this."));
     return type;
@@ -1536,9 +1782,16 @@
   }
 
   FunctionSignature get functionSignature {
-    assert(invariant(this, typeCache != null,
-            message: "Parameter signature has not been set for $this."));
-    return functionSignatureCache;
+    assert(invariant(this, _functionSignatureCache != null,
+        message: "Parameter signature has not been computed for $this."));
+    return _functionSignatureCache;
+  }
+
+  void set functionSignature(FunctionSignature value) {
+    assert(invariant(this, _functionSignatureCache == null,
+        message: "Parameter signature has already been computed for $this."));
+    _functionSignatureCache = value;
+    typeCache = _functionSignatureCache.type;
   }
 
   bool get hasNode => true;
@@ -1676,7 +1929,7 @@
     throw "internal error: AbstractFieldElement has no type";
   }
 
-  Node parseNode(DiagnosticListener listener) {
+  Node parseNode(Parsing parsing) {
     throw "internal error: AbstractFieldElement has no node";
   }
 
@@ -1758,7 +2011,7 @@
 
   List<FunctionElement> nestedClosures = new List<FunctionElement>();
 
-  FunctionSignature functionSignatureCache;
+  FunctionSignature _functionSignatureCache;
 
   AsyncMarker asyncMarker = AsyncMarker.SYNC;
 
@@ -1778,20 +2031,38 @@
            && !isStatic;
   }
 
-  bool get hasFunctionSignature => functionSignatureCache != null;
+  bool get hasFunctionSignature => _functionSignatureCache != null;
 
-  FunctionSignature computeSignature(Compiler compiler) {
-    if (functionSignatureCache != null) return functionSignatureCache;
-    compiler.withCurrentElement(this, () {
-      functionSignatureCache = compiler.resolver.resolveSignature(this);
-    });
-    return functionSignatureCache;
+  void _computeSignature(Resolution resolution) {
+    if (hasFunctionSignature) return;
+    functionSignature = resolution.resolveSignature(this);
   }
 
   FunctionSignature get functionSignature {
-    assert(invariant(this, functionSignatureCache != null,
+    assert(invariant(this, hasFunctionSignature,
         message: "Function signature has not been computed for $this."));
-    return functionSignatureCache;
+    return _functionSignatureCache;
+  }
+
+  void set functionSignature(FunctionSignature value) {
+    // TODO(johnniwinther): Strengthen the invariant to `!hasFunctionSignature`
+    // when checked mode checks are not enqueued eagerly.
+    assert(invariant(this, !hasFunctionSignature || type == value.type,
+        message: "Function signature has already been computed for $this."));
+    _functionSignatureCache = value;
+    typeCache = _functionSignatureCache.type;
+  }
+
+  /// An function is part of JsInterop in the following cases:
+  /// * It has a jsInteropName annotation
+  /// * It is external member of a class or library tagged as JsInterop.
+  bool get isJsInterop {
+    if (!isExternal) return false;
+
+    if (super.isJsInterop) return true;
+    if (isClassMember) return contextClass.isJsInterop;
+    if (isTopLevel) return library.isJsInterop;
+    return false;
   }
 
   List<ParameterElement> get parameters {
@@ -1802,9 +2073,11 @@
     return list;
   }
 
-  FunctionType computeType(Compiler compiler) {
+  FunctionType computeType(Resolution resolution) {
     if (typeCache != null) return typeCache;
-    typeCache = computeSignature(compiler).type;
+    _computeSignature(resolution);
+    assert(invariant(this, typeCache != null,
+        message: "Type cache expected to be set on $this."));
     return typeCache;
   }
 
@@ -1850,7 +2123,7 @@
   void reuseElement() {
     super.reuseElement();
     nestedClosures.clear();
-    functionSignatureCache = null;
+    _functionSignatureCache = null;
     typeCache = null;
   }
 }
@@ -1921,7 +2194,7 @@
 
   bool get hasNode => true;
 
-  FunctionExpression parseNode(DiagnosticListener listener) => node;
+  FunctionExpression parseNode(Parsing parsing) => node;
 
   Token get position {
     // Use the name as position if this is not an unnamed closure.
@@ -2011,7 +2284,11 @@
       return immediateRedirectionTarget;
     }
     assert(!isRedirectingFactory || internalEffectiveTarget != null);
-    return isRedirectingFactory ? internalEffectiveTarget : this;
+    if (isRedirectingFactory) return internalEffectiveTarget;
+    if (isPatched) {
+      return internalEffectiveTarget ?? this;
+    }
+    return this;
   }
 
   InterfaceType computeEffectiveTargetType(InterfaceType newType) {
@@ -2040,15 +2317,8 @@
         super("loadLibrary",
               Modifiers.EMPTY,
               prefix,
-              false);
-
-  FunctionSignature computeSignature(Compiler compiler) {
-    if (functionSignatureCache != null) return functionSignature;
-    compiler.withCurrentElement(this, () {
-      DartType inner = new FunctionType(this);
-      functionSignatureCache = new FunctionSignatureX(type: inner);
-    });
-    return functionSignatureCache;
+              false) {
+    functionSignature = new FunctionSignatureX(type: new FunctionType(this));
   }
 
   bool get isClassMember => false;
@@ -2062,7 +2332,7 @@
   // error messages.
   Token get position => null;
 
-  FunctionExpression parseNode(DiagnosticListener listener) => null;
+  FunctionExpression parseNode(Parsing parsing) => null;
 
   bool get hasNode => false;
 
@@ -2082,19 +2352,20 @@
               ElementKind.GENERATIVE_CONSTRUCTOR_BODY,
               Modifiers.EMPTY,
               constructor.enclosingElement) {
-    functionSignatureCache = constructor.functionSignature;
+    functionSignature = constructor.functionSignature;
   }
 
   bool get hasNode => constructor.hasNode;
 
   FunctionExpression get node => constructor.node;
 
-  Link<MetadataAnnotation> get metadata => constructor.metadata;
+  List<MetadataAnnotation> get metadata => constructor.metadata;
 
   bool get isInstanceMember => true;
 
-  FunctionType computeType(Compiler compiler) {
-    compiler.internalError(this, '$this.computeType.');
+  FunctionType computeType(Resolution resolution) {
+    DiagnosticReporter reporter = resolution.reporter;
+    reporter.internalError(this, '$this.computeType.');
     return null;
   }
 
@@ -2138,11 +2409,11 @@
               ElementKind.GENERATIVE_CONSTRUCTOR,
               Modifiers.EMPTY,
               enclosing) {
-    typeCache = new FunctionType.synthesized(enclosingClass.thisType);
-    functionSignatureCache = new FunctionSignatureX(type: type);
+    functionSignature = new FunctionSignatureX(
+        type: new FunctionType.synthesized(enclosingClass.thisType));
   }
 
-  FunctionExpression parseNode(DiagnosticListener listener) => null;
+  FunctionExpression parseNode(Parsing parsing) => null;
 
   bool get hasNode => false;
 
@@ -2162,18 +2433,16 @@
     }
   }
 
-  FunctionSignature computeSignature(compiler) {
-    if (functionSignatureCache != null) return functionSignatureCache;
+  void _computeSignature(Resolution resolution) {
+    if (hasFunctionSignature) return;
     if (definingConstructor.isErroneous) {
-      return functionSignatureCache =
-          compiler.objectClass.localLookup('').computeSignature(compiler);
+      functionSignature = new FunctionSignatureX(
+          type: new FunctionType.synthesized(enclosingClass.thisType));
     }
     // TODO(johnniwinther): Ensure that the function signature (and with it the
     // function type) substitutes type variables correctly.
-    definingConstructor.computeType(compiler);
-    functionSignatureCache = definingConstructor.functionSignature;
-    typeCache = definingConstructor.type;
-    return functionSignatureCache;
+    definingConstructor.computeType(resolution);
+    functionSignature = definingConstructor.functionSignature;
   }
 
   accept(ElementVisitor visitor, arg) {
@@ -2230,7 +2499,7 @@
 
   T createType(List<DartType> typeArguments);
 
-  void setThisAndRawTypes(Compiler compiler, List<DartType> typeParameters) {
+  void setThisAndRawTypes(List<DartType> typeParameters) {
     assert(invariant(this, thisTypeCache == null,
         message: "This type has already been set on $this."));
     assert(invariant(this, rawTypeCache == null,
@@ -2317,19 +2586,25 @@
   @override
   bool get isEnumClass => false;
 
-  InterfaceType computeType(Compiler compiler) {
-    if (thisTypeCache == null) {
-      computeThisAndRawType(compiler, computeTypeParameters(compiler));
+  InterfaceType computeType(Resolution resolution) {
+    if (isPatch) {
+      origin.computeType(resolution);
+      thisTypeCache = origin.thisType;
+      rawTypeCache = origin.rawType;
+    } else if (thisTypeCache == null) {
+      computeThisAndRawType(
+          resolution, computeTypeParameters(resolution.parsing));
     }
     return thisTypeCache;
   }
 
-  void computeThisAndRawType(Compiler compiler, List<DartType> typeVariables) {
+  void computeThisAndRawType(Resolution resolution,
+                             List<DartType> typeVariables) {
     if (thisTypeCache == null) {
       if (origin == null) {
-        setThisAndRawTypes(compiler, typeVariables);
+        setThisAndRawTypes(typeVariables);
       } else {
-        thisTypeCache = origin.computeType(compiler);
+        thisTypeCache = origin.computeType(resolution);
         rawTypeCache = origin.rawType;
       }
     }
@@ -2340,7 +2615,7 @@
     return new InterfaceType(this, typeArguments);
   }
 
-  List<DartType> computeTypeParameters(Compiler compiler);
+  List<DartType> computeTypeParameters(Parsing parsing);
 
   bool get isObject {
     assert(invariant(this, isResolved,
@@ -2348,13 +2623,15 @@
     return supertype == null;
   }
 
-  void ensureResolved(Compiler compiler) {
+  void ensureResolved(Resolution resolution) {
     if (resolutionState == STATE_NOT_STARTED) {
-      compiler.resolver.resolveClass(this);
+      resolution.resolveClass(this);
+      resolution.registerClass(this);
     }
   }
 
-  void setDefaultConstructor(FunctionElement constructor, Compiler compiler);
+  void setDefaultConstructor(FunctionElement constructor,
+                             DiagnosticReporter reporter);
 
   void addBackendMember(Element member) {
     // TODO(ngeoffray): Deprecate this method.
@@ -2395,7 +2672,8 @@
    * The returned element may not be resolved yet.
    */
   ClassElement get superclass {
-    assert(supertypeLoadState == STATE_DONE);
+    assert(invariant(this, supertypeLoadState == STATE_DONE,
+        message: "Superclass has not been computed for $this."));
     return supertype == null ? null : supertype.element;
   }
 
@@ -2407,7 +2685,7 @@
     return asInstanceOf(compiler.functionClass) != null || callType != null;
   }
 
-  bool get isNative => nativeTagInfo != null;
+  bool get isNative => nativeTagInfo != null || isJsInterop;
 
   void setNative(String name) {
     // TODO(johnniwinther): Assert that this is only called once. The memory
@@ -2447,17 +2725,18 @@
   bool get isMixinApplication => false;
   bool get hasLocalScopeMembers => !localScope.isEmpty;
 
-  void addMember(Element element, DiagnosticListener listener) {
+  void addMember(Element element, DiagnosticReporter reporter) {
     localMembersCache = null;
     localMembersReversed = localMembersReversed.prepend(element);
-    addToScope(element, listener);
+    addToScope(element, reporter);
   }
 
-  void addToScope(Element element, DiagnosticListener listener) {
+  void addToScope(Element element, DiagnosticReporter reporter) {
     if (element.isField && element.name == name) {
-      listener.reportError(element, MessageKind.MEMBER_USES_CLASS_NAME);
+      reporter.reportErrorMessage(
+          element, MessageKind.MEMBER_USES_CLASS_NAME);
     }
-    localScope.add(element, listener);
+    localScope.add(element, reporter);
   }
 
   Element localLookup(String elementName) {
@@ -2480,13 +2759,14 @@
     return false;
   }
 
-  void setDefaultConstructor(FunctionElement constructor, Compiler compiler) {
+  void setDefaultConstructor(FunctionElement constructor,
+                             DiagnosticReporter reporter) {
     // The default constructor, although synthetic, is part of a class' API.
-    addMember(constructor, compiler);
+    addMember(constructor, reporter);
   }
 
-  List<DartType> computeTypeParameters(Compiler compiler) {
-    ClassNode node = parseNode(compiler);
+  List<DartType> computeTypeParameters(Parsing parsing) {
+    ClassNode node = parseNode(parsing);
     return createTypeVariables(node.typeParameters);
   }
 
@@ -2520,14 +2800,14 @@
   bool get isEnumClass => true;
 
   @override
-  Node parseNode(Compiler compiler) => node;
+  Node parseNode(Parsing parsing) => node;
 
   @override
   accept(ElementVisitor visitor, arg) {
     return visitor.visitEnumClassElement(this, arg);
   }
 
-  List<DartType> computeTypeParameters(Compiler compiler) => const <DartType>[];
+  List<DartType> computeTypeParameters(Parsing parsing) => const <DartType>[];
 
   List<FieldElement> get enumValues {
     assert(invariant(this, _enumValues != null,
@@ -2557,7 +2837,7 @@
   bool get hasNode => true;
 
   @override
-  FunctionExpression parseNode(Compiler compiler) => node;
+  FunctionExpression parseNode(Parsing parsing) => node;
 }
 
 class EnumMethodElementX extends MethodElementX {
@@ -2573,7 +2853,7 @@
   bool get hasNode => true;
 
   @override
-  FunctionExpression parseNode(Compiler compiler) => node;
+  FunctionExpression parseNode(Parsing parsing) => node;
 }
 
 class EnumFormalElementX extends InitializingFormalElementX {
@@ -2605,7 +2885,7 @@
   final Node node;
   final Modifiers modifiers;
 
-  Link<FunctionElement> constructors = new Link<FunctionElement>();
+  Link<ConstructorElement> constructors = new Link<ConstructorElement>();
 
   InterfaceType mixinType;
 
@@ -2627,7 +2907,7 @@
 
   Token get position => node.getBeginToken();
 
-  Node parseNode(DiagnosticListener listener) => node;
+  Node parseNode(Parsing parsing) => node;
 
   FunctionElement lookupLocalConstructor(String name) {
     for (Link<Element> link = constructors;
@@ -2654,24 +2934,25 @@
     });
   }
 
-  void addMember(Element element, DiagnosticListener listener) {
+  void addMember(Element element, DiagnosticReporter reporter) {
     throw new UnsupportedError("Cannot add member to $this.");
   }
 
-  void addToScope(Element element, DiagnosticListener listener) {
-    listener.internalError(this, 'Cannot add to scope of $this.');
+  void addToScope(Element element, DiagnosticReporter reporter) {
+    reporter.internalError(this, 'Cannot add to scope of $this.');
   }
 
   void addConstructor(FunctionElement constructor) {
     constructors = constructors.prepend(constructor);
   }
 
-  void setDefaultConstructor(FunctionElement constructor, Compiler compiler) {
+  void setDefaultConstructor(FunctionElement constructor,
+                             DiagnosticReporter reporter) {
     assert(!hasConstructor);
     addConstructor(constructor);
   }
 
-  List<DartType> computeTypeParameters(Compiler compiler) {
+  List<DartType> computeTypeParameters(Parsing parsing) {
     NamedMixinApplication named = node.asNamedMixinApplication();
     if (named == null) {
       throw new SpannableAssertionFailure(node,
@@ -2756,7 +3037,7 @@
 
   TypeDeclarationElement get typeDeclaration => enclosingElement;
 
-  TypeVariableType computeType(compiler) => type;
+  TypeVariableType computeType(Resolution resolution) => type;
 
   TypeVariableType get type {
     assert(invariant(this, typeCache != null,
@@ -2772,7 +3053,7 @@
 
   bool get hasNode => true;
 
-  Node parseNode(compiler) => node;
+  Node parseNode(Parsing parsing) => node;
 
   Token get position => node.getBeginToken();
 
@@ -2824,18 +3105,18 @@
 
   MetadataAnnotationX([this.resolutionState = STATE_NOT_STARTED]);
 
-  MetadataAnnotation ensureResolved(Compiler compiler) {
+  MetadataAnnotation ensureResolved(Resolution resolution) {
     if (annotatedElement.isClass || annotatedElement.isTypedef) {
       TypeDeclarationElement typeDeclaration = annotatedElement;
-      typeDeclaration.ensureResolved(compiler);
+      typeDeclaration.ensureResolved(resolution);
     }
     if (resolutionState == STATE_NOT_STARTED) {
-      compiler.resolver.resolveMetadataAnnotation(this);
+      resolution.resolveMetadataAnnotation(this);
     }
     return this;
   }
 
-  Node parseNode(DiagnosticListener listener);
+  Node parseNode(Parsing parsing);
 
   String toString() => 'MetadataAnnotation($constant, $resolutionState)';
 }
@@ -2846,7 +3127,7 @@
 
   ParameterMetadataAnnotation(Metadata this.metadata);
 
-  Node parseNode(DiagnosticListener listener) => metadata.expression;
+  Node parseNode(Parsing parsing) => metadata.expression;
 
   Token get beginToken => metadata.getBeginToken();
 
diff --git a/pkg/compiler/lib/src/elements/names.dart b/pkg/compiler/lib/src/elements/names.dart
index 38e0945..314a94b 100644
--- a/pkg/compiler/lib/src/elements/names.dart
+++ b/pkg/compiler/lib/src/elements/names.dart
@@ -46,8 +46,15 @@
   /// privacy into account.
   bool isSimilarTo(Name other);
   int get similarHashCode;
-  
+
   LibraryElement get library;
+
+
+  /// Returns `true` when [s] is private if used as an identifier.
+  static bool isPrivateName(String s) => !s.isEmpty && s.codeUnitAt(0) == $_;
+
+  /// Returns `true` when [s] is public if used as an identifier.
+  static bool isPublicName(String s) => !isPrivateName(s);
 }
 
 class PublicName implements Name {
@@ -74,7 +81,7 @@
   bool isSimilarTo(Name other) =>
       text == other.text && isSetter == other.isSetter;
   int get similarHashCode => text.hashCode + 11 * isSetter.hashCode;
-  
+
   LibraryElement get library => null;
 
   String toString() => isSetter ? '$text=' : text;
@@ -103,5 +110,5 @@
     return super==(other) && library == other.library;
   }
 
-  String toString() => '${library.getLibraryName()}#${super.toString()}';
+  String toString() => '${library.libraryName}#${super.toString()}';
 }
diff --git a/pkg/compiler/lib/src/elements/visitor.dart b/pkg/compiler/lib/src/elements/visitor.dart
index 7769226..23d5263 100644
--- a/pkg/compiler/lib/src/elements/visitor.dart
+++ b/pkg/compiler/lib/src/elements/visitor.dart
@@ -20,6 +20,8 @@
   R visitAmbiguousElement(AmbiguousElement e, A arg) => null;
   R visitCompilationUnitElement(CompilationUnitElement e, A arg) => null;
   R visitLibraryElement(LibraryElement e, A arg) => null;
+  R visitImportElement(ImportElement e, A arg) => null;
+  R visitExportElement(ExportElement e, A arg) => null;
   R visitPrefixElement(PrefixElement e, A arg) => null;
   R visitTypedefElement(TypedefElement e, A arg) => null;
   R visitVariableElement(VariableElement e, A arg) => null;
@@ -76,6 +78,16 @@
   }
 
   @override
+  R visitImportElement(ImportElement e, A arg) {
+    return visitElement(e, arg);
+  }
+
+  @override
+  R visitExportElement(ExportElement e, A arg) {
+    return visitElement(e, arg);
+  }
+
+  @override
   R visitPrefixElement(PrefixElement e, A arg) {
     return visitElement(e, arg);
   }
diff --git a/pkg/compiler/lib/src/enqueue.dart b/pkg/compiler/lib/src/enqueue.dart
index 9325653..522bb29 100644
--- a/pkg/compiler/lib/src/enqueue.dart
+++ b/pkg/compiler/lib/src/enqueue.dart
@@ -2,7 +2,58 @@
 // for 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 dart2js;
+library dart2js.enqueue;
+
+import 'dart:collection' show
+    Queue;
+
+import 'common.dart';
+import 'common/names.dart' show
+    Identifiers;
+import 'common/resolution.dart' show
+    Resolution;
+import 'common/work.dart' show
+    ItemCompilationContext,
+    WorkItem;
+import 'common/tasks.dart' show
+    CompilerTask,
+    DeferredAction,
+    DeferredTask;
+import 'common/codegen.dart' show
+    CodegenWorkItem;
+import 'common/resolution.dart' show
+    ResolutionWorkItem;
+import 'compiler.dart' show
+    Compiler;
+import 'dart_types.dart' show
+    DartType,
+    InterfaceType;
+import 'elements/elements.dart' show
+    AnalyzableElement,
+    AstElement,
+    ClassElement,
+    ConstructorElement,
+    Element,
+    Elements,
+    FunctionElement,
+    LibraryElement,
+    LocalFunctionElement,
+    Member,
+    MemberElement,
+    MethodElement,
+    Name,
+    TypedElement,
+    TypedefElement;
+import 'js/js.dart' as js;
+import 'native/native.dart' as native;
+import 'types/types.dart' show
+    TypeMaskStrategy;
+import 'universe/selector.dart' show
+    Selector;
+import 'universe/universe.dart';
+import 'util/util.dart' show
+    Link,
+    Setlet;
 
 typedef ItemCompilationContext ItemCompilationContextCreator();
 
@@ -14,9 +65,12 @@
 
   EnqueueTask(Compiler compiler)
     : resolution = new ResolutionEnqueuer(
-          compiler, compiler.backend.createItemCompilationContext),
+          compiler, compiler.backend.createItemCompilationContext,
+          compiler.analyzeOnly && compiler.analyzeMain
+              ? const EnqueuerStrategy() : const TreeShakingEnqueuerStrategy()),
       codegen = new CodegenEnqueuer(
-          compiler, compiler.backend.createItemCompilationContext),
+          compiler, compiler.backend.createItemCompilationContext,
+          const TreeShakingEnqueuerStrategy()),
       super(compiler) {
     codegen.task = this;
     resolution.task = this;
@@ -49,14 +103,48 @@
 
   // TODO(johnniwinther): Collect checked types for checked mode separately to
   // support serialization.
-  Iterable<DartType> get checkedTypes => const <DartType>[];
+  Iterable<DartType> get isChecks => const <DartType>[];
+
+  Iterable<DartType> get checkedModeChecks => const <DartType>[];
+
+  Iterable<DartType> get asCasts => const <DartType>[];
 
   Iterable<MethodElement> get closurizedFunctions => const <MethodElement>[];
+
+  Iterable<LocalFunctionElement> get closures => const <LocalFunctionElement>[];
+
+  Iterable<DartType> get typeLiterals => const <DartType>[];
+
+  String toString() {
+    StringBuffer sb = new StringBuffer();
+
+    void add(String title, Iterable iterable) {
+      if (iterable.isNotEmpty) {
+        sb.write('\n $title:');
+        iterable.forEach((e) => sb.write('\n  $e'));
+      }
+    }
+
+    add('dynamic invocations', dynamicInvocations);
+    add('dynamic getters', dynamicGetters);
+    add('dynamic setters', dynamicSetters);
+    add('static uses', staticUses);
+    add('instantiated types', instantiatedTypes);
+    add('is-checks', isChecks);
+    add('checked-mode checks', checkedModeChecks);
+    add('as-casts', asCasts);
+    add('closurized functions', closurizedFunctions);
+    add('closures', closures);
+    add('type literals', typeLiterals);
+
+    return sb.toString();
+  }
 }
 
 abstract class Enqueuer {
   final String name;
   final Compiler compiler; // TODO(ahe): Remove this dependency.
+  final EnqueuerStrategy strategy;
   final ItemCompilationContextCreator itemCompilationContextCreator;
   final Map<String, Set<Element>> instanceMembersByName
       = new Map<String, Set<Element>>();
@@ -64,7 +152,7 @@
       = new Map<String, Set<Element>>();
   final Set<ClassElement> _processedClasses = new Set<ClassElement>();
   Set<ClassElement> recentClasses = new Setlet<ClassElement>();
-  final Universe universe = new Universe();
+  final Universe universe = new Universe(const TypeMaskStrategy());
 
   static final TRACE_MIRROR_ENQUEUING =
       const bool.fromEnvironment("TRACE_MIRROR_ENQUEUING");
@@ -76,7 +164,13 @@
   bool hasEnqueuedReflectiveElements = false;
   bool hasEnqueuedReflectiveStaticFields = false;
 
-  Enqueuer(this.name, this.compiler, this.itemCompilationContextCreator);
+  Enqueuer(this.name,
+           this.compiler,
+           this.itemCompilationContextCreator,
+           this.strategy);
+
+  // TODO(johnniwinther): Move this to [ResolutionEnqueuer].
+  Resolution get resolution => compiler.resolution;
 
   Queue<WorkItem> get queue;
   bool get queueIsEmpty => queue.isEmpty;
@@ -86,9 +180,15 @@
 
   QueueFilter get filter => compiler.enqueuerFilter;
 
+  DiagnosticReporter get reporter => compiler.reporter;
+
   /// Returns [:true:] if [member] has been processed by this enqueuer.
   bool isProcessed(Element member);
 
+  bool isClassProcessed(ClassElement cls) => _processedClasses.contains(cls);
+
+  Iterable<ClassElement> get processedClasses => _processedClasses;
+
   /**
    * Documentation wanted -- johnniwinther
    *
@@ -96,7 +196,12 @@
    */
   void addToWorkList(Element element) {
     assert(invariant(element, element.isDeclaration));
-    internalAddToWorkList(element);
+    if (internalAddToWorkList(element) && compiler.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);
+    }
   }
 
   /**
@@ -113,22 +218,30 @@
     worldImpact.dynamicGetters.forEach(registerDynamicGetter);
     worldImpact.dynamicSetters.forEach(registerDynamicSetter);
     worldImpact.staticUses.forEach(registerStaticUse);
-    // TODO(johnniwinther): Register [worldImpact.instantiatedTypes] when it
-    // doesn't require a [Registry].
-    worldImpact.checkedTypes.forEach(registerIsCheck);
+    worldImpact.instantiatedTypes.forEach(registerInstantiatedType);
+    worldImpact.isChecks.forEach(registerIsCheck);
+    worldImpact.asCasts.forEach(registerIsCheck);
+    if (compiler.enableTypeAssertions) {
+      worldImpact.checkedModeChecks.forEach(registerIsCheck);
+    }
     worldImpact.closurizedFunctions.forEach(registerGetOfStaticFunction);
+    worldImpact.closures.forEach(registerClosure);
   }
 
   // TODO(johnniwinther): Remove the need for passing the [registry].
-  void registerInstantiatedType(InterfaceType type, Registry registry,
+  void registerInstantiatedType(InterfaceType type,
                                 {bool mirrorUsage: false}) {
     task.measure(() {
       ClassElement cls = type.element;
-      registry.registerDependency(cls);
-      cls.ensureResolved(compiler);
-      universe.registerTypeInstantiation(type, byMirrors: mirrorUsage);
+      cls.ensureResolved(resolution);
+      universe.registerTypeInstantiation(
+          type,
+          byMirrors: mirrorUsage,
+          onImplemented: (ClassElement cls) {
+        compiler.backend.registerImplementedClass(
+                    cls, this, compiler.globalDependencies);
+      });
       processInstantiatedClass(cls);
-      compiler.backend.registerInstantiatedType(type, registry);
     });
   }
 
@@ -137,7 +250,7 @@
   }
 
   void processInstantiatedClassMembers(ClassElement cls) {
-    cls.implementation.forEachMember(processInstantiatedClassMember);
+    strategy.processInstantiatedClass(this, cls);
   }
 
   void processInstantiatedClassMember(ClassElement cls, Element member) {
@@ -146,7 +259,7 @@
     if (!member.isInstanceMember) return;
     String memberName = member.name;
 
-    if (member.kind == ElementKind.FIELD) {
+    if (member.isField) {
       // The obvious thing to test here would be "member.isNative",
       // however, that only works after metadata has been parsed/analyzed,
       // and that may not have happened yet.
@@ -187,21 +300,20 @@
         addToWorkList(member);
         return;
       }
-    } else if (member.kind == ElementKind.FUNCTION) {
+    } else if (member.isFunction) {
       FunctionElement function = member;
-      function.computeType(compiler);
-      if (function.name == Compiler.NO_SUCH_METHOD) {
+      function.computeType(resolution);
+      if (function.name == Identifiers.noSuchMethod_) {
         registerNoSuchMethod(function);
       }
-      if (function.name == Compiler.CALL_OPERATOR_NAME &&
+      if (function.name == Identifiers.call &&
           !cls.typeVariables.isEmpty) {
-        registerCallMethodWithFreeTypeVariables(
-            function, compiler.globalDependencies);
+        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.world)) {
-        registerClosurizedMember(function, compiler.globalDependencies);
+        registerClosurizedMember(function);
         addToWorkList(function);
         return;
       }
@@ -213,9 +325,9 @@
         addToWorkList(function);
         return;
       }
-    } else if (member.kind == ElementKind.GETTER) {
+    } else if (member.isGetter) {
       FunctionElement getter = member;
-      getter.computeType(compiler);
+      getter.computeType(resolution);
       if (universe.hasInvokedGetter(getter, compiler.world)) {
         addToWorkList(getter);
         return;
@@ -226,9 +338,9 @@
         addToWorkList(getter);
         return;
       }
-    } else if (member.kind == ElementKind.SETTER) {
+    } else if (member.isSetter) {
       FunctionElement setter = member;
-      setter.computeType(compiler);
+      setter.computeType(resolution);
       if (universe.hasInvokedSetter(setter, compiler.world)) {
         addToWorkList(setter);
         return;
@@ -250,28 +362,37 @@
       if (_processedClasses.contains(cls)) return;
       // The class must be resolved to compute the set of all
       // supertypes.
-      cls.ensureResolved(compiler);
+      cls.ensureResolved(resolution);
 
-      void processClass(ClassElement cls) {
-        if (_processedClasses.contains(cls)) return;
+      void processClass(ClassElement superclass) {
+        if (_processedClasses.contains(superclass)) return;
+        // TODO(johnniwinther): Re-insert this invariant when unittests don't
+        // fail. There is already a similar invariant on the members.
+        /*if (!isResolutionQueue) {
+          assert(invariant(superclass,
+              superclass.isClosure ||
+              compiler.enqueuer.resolution.isClassProcessed(superclass),
+              message: "Class $superclass has not been "
+                       "processed in resolution."));
+        }*/
 
-        _processedClasses.add(cls);
-        recentClasses.add(cls);
-        cls.ensureResolved(compiler);
-        cls.implementation.forEachMember(processInstantiatedClassMember);
-        if (isResolutionQueue && !cls.isSynthesized) {
-          compiler.resolver.checkClass(cls);
+        _processedClasses.add(superclass);
+        recentClasses.add(superclass);
+        superclass.ensureResolved(resolution);
+        superclass.implementation.forEachMember(processInstantiatedClassMember);
+        if (isResolutionQueue && !superclass.isSynthesized) {
+          compiler.resolver.checkClass(superclass);
         }
-        // We only tell the backend once that [cls] was instantiated, so
+        // We only tell the backend once that [superclass] was instantiated, so
         // any additional dependencies must be treated as global
         // dependencies.
         compiler.backend.registerInstantiatedClass(
-            cls, this, compiler.globalDependencies);
+            superclass, this, compiler.globalDependencies);
       }
-      processClass(cls);
-      for (Link<DartType> supertypes = cls.allSupertypes;
-           !supertypes.isEmpty; supertypes = supertypes.tail) {
-        processClass(supertypes.head.element);
+
+      while (cls != null) {
+        processClass(cls);
+        cls = cls.superclass;
       }
     });
   }
@@ -326,7 +447,10 @@
         includedEnclosing: enclosingWasIncluded)) {
       logEnqueueReflectiveAction(ctor);
       ClassElement cls = ctor.declaration.enclosingClass;
-      registerInstantiatedType(cls.rawType, compiler.mirrorDependencies,
+      compiler.backend.registerInstantiatedType(
+          cls.rawType,
+          this,
+          compiler.mirrorDependencies,
           mirrorUsage: true);
       registerStaticUse(ctor.declaration);
     }
@@ -342,7 +466,7 @@
       logEnqueueReflectiveAction(element);
       if (element.isTypedef) {
         TypedefElement typedef = element;
-        typedef.ensureResolved(compiler);
+        typedef.ensureResolved(resolution);
         compiler.world.allTypedefs.add(element);
       } else if (Elements.isStaticOrTopLevel(element)) {
         registerStaticUse(element.declaration);
@@ -355,7 +479,8 @@
         registerSelectorUse(selector);
         if (element.isField) {
           UniverseSelector selector = new UniverseSelector(
-              new Selector.setter(element.name, element.library), null);
+              new Selector.setter(new Name(
+                  element.name, element.library, isSetter: true)), null);
           registerInvokedSetter(selector);
         }
       }
@@ -375,8 +500,11 @@
     if (includeClass) {
       logEnqueueReflectiveAction(cls, "register");
       ClassElement decl = cls.declaration;
-      decl.ensureResolved(compiler);
-      registerInstantiatedType(decl.rawType, compiler.mirrorDependencies,
+      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
@@ -406,8 +534,11 @@
     for (ClassElement cls in classes) {
       if (compiler.backend.referencedFromMirrorSystem(cls)) {
         logEnqueueReflectiveAction(cls);
-        cls.ensureResolved(compiler);
-        registerInstantiatedType(cls.rawType, compiler.mirrorDependencies,
+        cls.ensureResolved(resolution);
+        compiler.backend.registerInstantiatedType(
+            cls.rawType,
+            this,
+            compiler.mirrorDependencies,
             mirrorUsage: true);
       }
     }
@@ -440,7 +571,7 @@
       // have run before tree shaking is disabled and thus everything is
       // enqueued.
       recents = _processedClasses.toSet();
-      compiler.log('Enqueuing everything');
+      reporter.log('Enqueuing everything');
       for (LibraryElement lib in compiler.libraryLoader.libraries) {
         enqueueReflectiveElementsInLibrary(lib, recents);
       }
@@ -496,12 +627,16 @@
   }
 
   void handleUnseenSelector(UniverseSelector universeSelector) {
+    strategy.processSelector(this, universeSelector);
+  }
+
+  void handleUnseenSelectorInternal(UniverseSelector universeSelector) {
     Selector selector = universeSelector.selector;
     String methodName = selector.name;
     processInstanceMembers(methodName, (Element member) {
       if (universeSelector.appliesUnnamed(member, compiler.world)) {
         if (member.isFunction && selector.isGetter) {
-          registerClosurizedMember(member, compiler.globalDependencies);
+          registerClosurizedMember(member);
         }
         if (member.isField && member.enclosingClass.isNative) {
           if (selector.isGetter || selector.isCall) {
@@ -529,7 +664,7 @@
     if (selector.isGetter) {
       processInstanceFunctions(methodName, (Element member) {
         if (universeSelector.appliesUnnamed(member, compiler.world)) {
-          registerClosurizedMember(member, compiler.globalDependencies);
+          registerClosurizedMember(member);
           return true;
         }
         return false;
@@ -544,6 +679,10 @@
    */
   void registerStaticUse(Element element) {
     if (element == null) return;
+    strategy.processStaticUse(this, element);
+  }
+
+  void registerStaticUseInternal(Element element) {
     assert(invariant(element, element.isDeclaration,
         message: "Element ${element} is not the declaration."));
     if (Elements.isStaticOrTopLevel(element) && element.isField) {
@@ -599,37 +738,28 @@
     // 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.kind != TypeKind.TYPE_VARIABLE ||
+    assert(!type.isTypeVariable ||
            !type.element.enclosingElement.isTypedef);
   }
 
-  void registerCallMethodWithFreeTypeVariables(
-      Element element,
-      Registry registry) {
+  void registerCallMethodWithFreeTypeVariables(Element element) {
     compiler.backend.registerCallMethodWithFreeTypeVariables(
-        element, this, registry);
+        element, this, compiler.globalDependencies);
     universe.callMethodsWithFreeTypeVariables.add(element);
   }
 
-  void registerClosurizedMember(TypedElement element, Registry registry) {
+  void registerClosurizedMember(TypedElement element) {
     assert(element.isInstanceMember);
-    registerClosureIfFreeTypeVariables(element, registry);
+    if (element.computeType(resolution).containsTypeVariables) {
+      compiler.backend.registerClosureWithFreeTypeVariables(
+          element, this, compiler.globalDependencies);
+    }
     compiler.backend.registerBoundClosure(this);
     universe.closurizedMembers.add(element);
   }
 
-  void registerClosureIfFreeTypeVariables(TypedElement element,
-                                          Registry registry) {
-    if (element.computeType(compiler).containsTypeVariables) {
-      compiler.backend.registerClosureWithFreeTypeVariables(
-          element, this, registry);
-      universe.closuresWithFreeTypeVariables.add(element);
-    }
-  }
-
-  void registerClosure(LocalFunctionElement element, Registry registry) {
+  void registerClosure(LocalFunctionElement element) {
     universe.allClosures.add(element);
-    registerClosureIfFreeTypeVariables(element, registry);
   }
 
   void forEach(void f(WorkItem work)) {
@@ -672,13 +802,8 @@
 
 /// [Enqueuer] which is specific to resolution.
 class ResolutionEnqueuer extends Enqueuer {
-  /**
-   * Map from declaration elements to the [TreeElements] object holding the
-   * resolution mapping for the element implementation.
-   *
-   * Invariant: Key elements are declaration elements.
-   */
-  final Set<AstElement> resolvedElements;
+  /// All declaration elements that have been processed by the resolver.
+  final Set<AstElement> processedElements;
 
   final Queue<ResolutionWorkItem> queue;
 
@@ -689,24 +814,28 @@
   final Queue<DeferredTask> deferredTaskQueue;
 
   ResolutionEnqueuer(Compiler compiler,
-                     ItemCompilationContext itemCompilationContextCreator())
-      : super('resolution enqueuer', compiler, itemCompilationContextCreator),
-        resolvedElements = new Set<AstElement>(),
+                     ItemCompilationContext itemCompilationContextCreator(),
+                     EnqueuerStrategy strategy)
+      : super('resolution enqueuer',
+              compiler,
+              itemCompilationContextCreator,
+              strategy),
+        processedElements = new Set<AstElement>(),
         queue = new Queue<ResolutionWorkItem>(),
         deferredTaskQueue = new Queue<DeferredTask>();
 
   bool get isResolutionQueue => true;
 
-  bool isProcessed(Element member) => resolvedElements.contains(member);
+  bool isProcessed(Element member) => processedElements.contains(member);
 
   /// Returns `true` if [element] has been processed by the resolution enqueuer.
-  bool hasBeenResolved(Element element) {
-    return resolvedElements.contains(element.analyzableElement.declaration);
+  bool hasBeenProcessed(Element element) {
+    return processedElements.contains(element.analyzableElement.declaration);
   }
 
-  /// Registers [element] as resolved for the resolution enqueuer.
-  void registerResolvedElement(AstElement element) {
-    resolvedElements.add(element);
+  /// Registers [element] as processed by the resolution enqueuer.
+  void registerProcessedElement(AstElement element) {
+    processedElements.add(element);
   }
 
   /**
@@ -727,7 +856,7 @@
 
     assert(invariant(element, element is AnalyzableElement,
         message: 'Element $element is not analyzable.'));
-    if (hasBeenResolved(element)) return false;
+    if (hasBeenProcessed(element)) return false;
     if (queueIsClosed) {
       throw new SpannableAssertionFailure(element,
           "Resolution work list is closed. Trying to add $element.");
@@ -764,7 +893,7 @@
       }
     }
 
-    if (element.isGetter && element.name == Compiler.RUNTIME_TYPE) {
+    if (element.isGetter && element.name == Identifiers.runtimeType_) {
       // Enable runtime type support if we discover a getter called runtimeType.
       // We have to enable runtime type before hitting the codegen, so
       // that constructors know whether they need to generate code for
@@ -814,29 +943,17 @@
   void emptyDeferredTaskQueue() {
     while (!deferredTaskQueue.isEmpty) {
       DeferredTask task = deferredTaskQueue.removeFirst();
-      compiler.withCurrentElement(task.element, task.action);
+      reporter.withCurrentElement(task.element, task.action);
     }
   }
 
-  void registerJsCall(Send node, ResolverVisitor resolver) {
-    nativeEnqueuer.registerJsCall(node, resolver);
-  }
-
-  void registerJsEmbeddedGlobalCall(Send node, ResolverVisitor resolver) {
-    nativeEnqueuer.registerJsEmbeddedGlobalCall(node, resolver);
-  }
-
-  void registerJsBuiltinCall(Send node, ResolverVisitor resolver) {
-    nativeEnqueuer.registerJsBuiltinCall(node, resolver);
-  }
-
   void _logSpecificSummary(log(message)) {
-    log('Resolved ${resolvedElements.length} elements.');
+    log('Resolved ${processedElements.length} elements.');
   }
 
   void forgetElement(Element element) {
     super.forgetElement(element);
-    resolvedElements.remove(element);
+    processedElements.remove(element);
   }
 }
 
@@ -853,11 +970,13 @@
   bool enabledNoSuchMethod = false;
 
   CodegenEnqueuer(Compiler compiler,
-                  ItemCompilationContext itemCompilationContextCreator())
+                  ItemCompilationContext itemCompilationContextCreator(),
+                  EnqueuerStrategy strategy)
       : queue = new Queue<CodegenWorkItem>(),
         newlyEnqueuedElements = compiler.cacheStrategy.newSet(),
         newlySeenSelectors = compiler.cacheStrategy.newSet(),
-        super('codegen enqueuer', compiler, itemCompilationContextCreator);
+        super('codegen enqueuer', compiler, itemCompilationContextCreator,
+              strategy);
 
   bool isProcessed(Element member) =>
       member.isAbstract || generatedCode.containsKey(member);
@@ -959,3 +1078,37 @@
   if (set == null) return;
   set.remove(element);
 }
+
+/// 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 an element statically accessed in live code.
+  void processStaticUse(Enqueuer enqueuer, Element element) {}
+
+  /// Process a selector for a call site in live code.
+  void processSelector(Enqueuer enqueuer, UniverseSelector selector) {}
+}
+
+class TreeShakingEnqueuerStrategy implements EnqueuerStrategy {
+  const TreeShakingEnqueuerStrategy();
+
+  @override
+  void processInstantiatedClass(Enqueuer enqueuer, ClassElement cls) {
+    cls.implementation.forEachMember(enqueuer.processInstantiatedClassMember);
+  }
+
+  @override
+  void processStaticUse(Enqueuer enqueuer, Element element) {
+    enqueuer.registerStaticUseInternal(element);
+  }
+
+  @override
+  void processSelector(Enqueuer enqueuer, UniverseSelector selector) {
+    enqueuer.handleUnseenSelectorInternal(selector);
+  }
+}
diff --git a/pkg/compiler/lib/src/helpers/debug_collection.dart b/pkg/compiler/lib/src/helpers/debug_collection.dart
index 42e28c0..8ff4be2 100644
--- a/pkg/compiler/lib/src/helpers/debug_collection.dart
+++ b/pkg/compiler/lib/src/helpers/debug_collection.dart
@@ -233,7 +233,9 @@
     return set.add(value);
   }
 
-  void addAll(Iterable<E> elements) => set.addAll(elements);
+  void addAll(Iterable<E> elements) {
+    elements.forEach(add);
+  }
 
   bool remove(Object value) => set.remove(value);
 
diff --git a/pkg/compiler/lib/src/helpers/helpers.dart b/pkg/compiler/lib/src/helpers/helpers.dart
index 9f7e284..f956850 100644
--- a/pkg/compiler/lib/src/helpers/helpers.dart
+++ b/pkg/compiler/lib/src/helpers/helpers.dart
@@ -7,12 +7,17 @@
 
 library dart2js.helpers;
 
-import 'dart:async' show EventSink;
+import 'dart:async' show
+    EventSink;
 import 'dart:collection';
 import 'dart:convert';
 
 import '../../compiler.dart';
-import '../dart2jslib.dart';
+import '../common.dart';
+import '../compiler.dart' show
+    Compiler;
+import '../diagnostics/invariant.dart' show
+    DEBUG_MODE;
 import '../util/util.dart';
 
 part 'debug_collection.dart';
@@ -80,7 +85,9 @@
 }
 
 /// Function signature of [reportHere].
-typedef ReportHere(Compiler compiler, Spannable node, String debugMessage);
+typedef ReportHere(DiagnosticReporter reporter,
+                   Spannable node,
+                   String debugMessage);
 
 /// Print a message with a source location.
 ReportHere get reportHere {
@@ -89,8 +96,8 @@
 }
 
 /// Implementation of [reportHere]
-_reportHere(Compiler compiler, Spannable node, String debugMessage) {
-  compiler.reportInfo(node,
+_reportHere(DiagnosticReporter reporter, Spannable node, String debugMessage) {
+  reporter.reportInfo(node,
       MessageKind.GENERIC, {'text': 'HERE: $debugMessage'});
 }
 
diff --git a/pkg/compiler/lib/src/helpers/stats.dart b/pkg/compiler/lib/src/helpers/stats.dart
index 13897c7..d7f6b5d 100644
--- a/pkg/compiler/lib/src/helpers/stats.dart
+++ b/pkg/compiler/lib/src/helpers/stats.dart
@@ -458,7 +458,7 @@
     indentation = ''.padLeft(countText.length, ' ');
     if (commonPrefix != null) {
       int index = 0;
-      for (String line in commonPrefix) {
+      for (StackTraceLine line in commonPrefix) {
         sb.write(indentation);
         if (index > 1) {
           sb.write('...\n');
diff --git a/pkg/compiler/lib/src/helpers/trace.dart b/pkg/compiler/lib/src/helpers/trace.dart
index f19b0d0..0889efd 100644
--- a/pkg/compiler/lib/src/helpers/trace.dart
+++ b/pkg/compiler/lib/src/helpers/trace.dart
@@ -60,8 +60,11 @@
 }
 
 /// Function signature of [traceAndReport].
-typedef void TraceAndReport(Compiler compiler, Spannable node, String message,
-                            {bool condition(String stackTrace), int limit,
+typedef void TraceAndReport(DiagnosticReporter reporter,
+                            Spannable node,
+                            String message,
+                            {bool condition(String stackTrace),
+                             int limit,
                              bool throwOnPrint});
 
 /// Calls [reportHere] and [trace] with the same message.
@@ -74,7 +77,9 @@
 TraceAndReport get reportAndTrace => traceAndReport;
 
 /// Implementation of [traceAndReport].
-void _traceAndReport(Compiler compiler, Spannable node, String message,
+void _traceAndReport(DiagnosticReporter reporter,
+                     Spannable node,
+                     String message,
                      {bool condition(String stackTrace), int limit,
                       bool throwOnPrint: false}) {
 
@@ -82,7 +87,7 @@
         condition: (String stackTrace) {
     bool result = condition != null ? condition(stackTrace) : true;
     if (result) {
-      reportHere(compiler, node, message);
+      reportHere(reporter, node, message);
     }
     return result;
   });
@@ -131,8 +136,9 @@
     // Dart VM are:
     //    #n     <method-name> (<uri>:<line-no>:<column-no>)
     //    #n     <method-name> (<uri>:<line-no>)
+    //    #n     <method-name> (<uri>)
     // in which '<anonymous closure>' is the name used for an (unnamed) function
-    // expression.
+    // expression. The last case is used for async bodies.
     for (String line in stackTrace.split('\n')) {
       try {
         index++;
@@ -154,16 +160,33 @@
           lineNo = line.substring(nextToLastColon+1, lastColon);
           columnNo = line.substring(lastColon+1, rightParenPos);
           try {
-            int.parse(lineNo);
+            int.parse(columnNo);
+            try {
+              int.parse(lineNo);
+            } on FormatException {
+              // Only line number.
+              lineNo = columnNo;
+              columnNo = '';
+              nextToLastColon = lastColon;
+            }
           } on FormatException {
-            lineNo = columnNo;
+            // No column number nor line number.
+            lineNo = '';
             columnNo = '';
-            nextToLastColon = lastColon;
+            nextToLastColon = rightParenPos;
           }
         } else {
           lineNo = line.substring(lastColon+1, rightParenPos);
           columnNo = '';
-          nextToLastColon = lastColon;
+          try {
+            int.parse(lineNo);
+            nextToLastColon = lastColon;
+          } on FormatException {
+            // No column number nor line number.
+            lineNo = columnNo;
+            columnNo = '';
+            nextToLastColon = rightParenPos;
+          }
         }
 
         if (lineNo.length > maxLineNoLength) {
diff --git a/pkg/compiler/lib/src/inferrer/closure_tracer.dart b/pkg/compiler/lib/src/inferrer/closure_tracer.dart
index 262f652..aa78001 100644
--- a/pkg/compiler/lib/src/inferrer/closure_tracer.dart
+++ b/pkg/compiler/lib/src/inferrer/closure_tracer.dart
@@ -101,7 +101,7 @@
         registerCallForLaterAnalysis(info);
       }
     } else if (info.selector.isGetter &&
-        info.selector.name == Compiler.CALL_OPERATOR_NAME) {
+        info.selector.memberName == Names.call) {
       // We are potentially tearing off ourself here
       addNewEscapeInformation(info);
     }
diff --git a/pkg/compiler/lib/src/inferrer/concrete_types_inferrer.dart b/pkg/compiler/lib/src/inferrer/concrete_types_inferrer.dart
deleted file mode 100644
index 19bcab4..0000000
--- a/pkg/compiler/lib/src/inferrer/concrete_types_inferrer.dart
+++ /dev/null
@@ -1,2380 +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 concrete_types_inferrer;
-
-import 'dart:collection' show Queue, IterableBase;
-import '../native/native.dart' as native;
-import '../closure.dart' show BoxFieldElement;
-import '../dart2jslib.dart' hide Selector, TypedSelector;
-import '../dart_types.dart' show DartType, TypeKind;
-import '../elements/elements.dart';
-import '../tree/tree.dart';
-import '../universe/universe.dart';
-import '../util/util.dart';
-
-import 'inferrer_visitor.dart';
-import '../types/types.dart' show TypeMask, FlatTypeMask, UnionTypeMask,
-                                  TypesInferrer;
-import 'simple_types_inferrer.dart';
-
-/**
- * A singleton concrete type. More precisely, a [BaseType] is one of the
- * following:
- *
- *   - a non-asbtract class like [:int:] or [:Uri:] (but not [:List:])
- *   - the null base type
- *   - the unknown base type
- */
-abstract class BaseType {
-  bool isClass();
-  bool isUnknown();
-  bool isNull();
-}
-
-/**
- * A non-asbtract class like [:int:] or [:Uri:] (but not [:List:]).
- */
-class ClassBaseType implements BaseType {
-  final ClassElement element;
-
-  ClassBaseType(this.element);
-
-  bool operator ==(var other) {
-    if (identical(this, other)) return true;
-    if (other is! ClassBaseType) return false;
-    return element == other.element;
-  }
-  int get hashCode => element.hashCode;
-  String toString() {
-    return element == null ? 'toplevel' : element.name;
-  }
-  bool isClass() => true;
-  bool isUnknown() => false;
-  bool isNull() => false;
-}
-
-/**
- * The unknown base type.
- */
-class UnknownBaseType implements BaseType {
-  const UnknownBaseType();
-  bool operator ==(BaseType other) => other is UnknownBaseType;
-  int get hashCode => 0;
-  bool isClass() => false;
-  bool isUnknown() => true;
-  bool isNull() => false;
-  toString() => "unknown";
-}
-
-/**
- * The null base type.
- */
-class NullBaseType implements BaseType {
-  const NullBaseType();
-  bool operator ==(BaseType other) => identical(other, this);
-  int get hashCode => 1;
-  bool isClass() => false;
-  bool isUnknown() => false;
-  bool isNull() => true;
-  toString() => "null";
-}
-
-/**
- * An immutable set of base types like [:{int, bool}:], or the unknown concrete
- * type.
- */
-abstract class ConcreteType {
-  ConcreteType();
-
-  factory ConcreteType.empty(int maxConcreteTypeSize,
-                             BaseTypes classBaseTypes) {
-    return new UnionType(maxConcreteTypeSize, classBaseTypes,
-                         new Set<BaseType>());
-  }
-
-  /**
-   * The singleton constituted of the unknown base type is the unknown concrete
-   * type.
-   */
-  factory ConcreteType.singleton(int maxConcreteTypeSize,
-                                 BaseTypes classBaseTypes,
-                                 BaseType baseType) {
-    if (baseType.isUnknown() || maxConcreteTypeSize < 1) {
-      return const UnknownConcreteType();
-    }
-    Set<BaseType> singletonSet = new Set<BaseType>();
-    singletonSet.add(baseType);
-    return new UnionType(maxConcreteTypeSize, classBaseTypes, singletonSet);
-  }
-
-  factory ConcreteType.unknown() {
-    return const UnknownConcreteType();
-  }
-
-  ConcreteType union(ConcreteType other);
-  ConcreteType intersection(ConcreteType other);
-  ConcreteType refine(Selector selector, Compiler compiler);
-  bool isUnknown();
-  bool isEmpty();
-  Set<BaseType> get baseTypes;
-
-  /**
-   * Returns the unique element of [:this:] if [:this:] is a singleton, null
-   * otherwise.
-   */
-  ClassElement getUniqueType();
-}
-
-/**
- * The unkown concrete type: it is absorbing for the union.
- */
-class UnknownConcreteType implements ConcreteType {
-  const UnknownConcreteType();
-  bool isUnknown() => true;
-  bool isEmpty() => false;
-  bool operator ==(ConcreteType other) => identical(this, other);
-  Set<BaseType> get baseTypes =>
-      new Set<BaseType>.from([const UnknownBaseType()]);
-  int get hashCode => 0;
-  ConcreteType union(ConcreteType other) => this;
-  ConcreteType intersection(ConcreteType other) => other;
-  ConcreteType refine(Selector selector, Compiler compiler) => this;
-  ClassElement getUniqueType() => null;
-  toString() => "unknown";
-}
-
-/**
- * An immutable set of base types, like [: {int, bool} :].
- */
-class UnionType implements ConcreteType {
-  final int maxConcreteTypeSize;
-  final BaseTypes classBaseTypes;
-
-  final Set<BaseType> baseTypes;
-
-  /**
-   * The argument should NOT be mutated later. Do not call directly, use
-   * ConcreteType.singleton instead.
-   */
-  UnionType(this.maxConcreteTypeSize, this.classBaseTypes, this.baseTypes);
-
-  bool isUnknown() => false;
-  bool isEmpty() => baseTypes.isEmpty;
-
-  bool operator ==(ConcreteType other) {
-    if (other is! UnionType) return false;
-    if (baseTypes.length != other.baseTypes.length) return false;
-    return baseTypes.containsAll(other.baseTypes);
-  }
-
-  int get hashCode {
-    int result = 1;
-    for (final baseType in baseTypes) {
-      result = 31 * result + baseType.hashCode;
-    }
-    return result;
-  }
-
-  ConcreteType _simplify(Set<BaseType> baseTypes) {
-    // normalize all flavors of ints to int
-    // TODO(polux): handle different ints better
-    if (baseTypes.contains(classBaseTypes.uint31Type)) {
-      baseTypes.remove(classBaseTypes.uint31Type);
-      baseTypes.add(classBaseTypes.intBaseType);
-    }
-    if (baseTypes.contains(classBaseTypes.uint32Type)) {
-      baseTypes.remove(classBaseTypes.uint32Type);
-      baseTypes.add(classBaseTypes.intBaseType);
-    }
-    if (baseTypes.contains(classBaseTypes.positiveIntType)) {
-      baseTypes.remove(classBaseTypes.positiveIntType);
-      baseTypes.add(classBaseTypes.intBaseType);
-    }
-    // normalize {int, float}, {int, num} or {float, num} into num
-    // TODO(polux): generalize this to all types when we extend the concept of
-    //     "concrete type" to other abstract classes than num
-    if (baseTypes.contains(classBaseTypes.numBaseType) ||
-        (baseTypes.contains(classBaseTypes.intBaseType)
-            && baseTypes.contains(classBaseTypes.doubleBaseType))) {
-      baseTypes.remove(classBaseTypes.intBaseType);
-      baseTypes.remove(classBaseTypes.doubleBaseType);
-      baseTypes.add(classBaseTypes.numBaseType);
-    }
-
-    // widen big types to dynamic
-    return baseTypes.length > maxConcreteTypeSize
-        ? const UnknownConcreteType()
-        : new UnionType(maxConcreteTypeSize, classBaseTypes, baseTypes);
-  }
-
-  ConcreteType union(ConcreteType other) {
-    if (other.isUnknown()) {
-      return const UnknownConcreteType();
-    }
-    UnionType otherUnion = other;  // cast
-    Set<BaseType> newBaseTypes = new Set<BaseType>.from(baseTypes);
-    newBaseTypes.addAll(otherUnion.baseTypes);
-    return _simplify(newBaseTypes);
-  }
-
-  ConcreteType intersection(ConcreteType other) {
-    if (other.isUnknown()) {
-      return this;
-    }
-    Set<BaseType> thisBaseTypes = new Set<BaseType>.from(baseTypes);
-    Set<BaseType> otherBaseTypes = new Set<BaseType>.from(other.baseTypes);
-    return _simplify(thisBaseTypes.intersection(otherBaseTypes));
-  }
-
-  ConcreteType refine(Selector selector, Compiler compiler) {
-    Set<BaseType> newBaseTypes = new Set<BaseType>();
-    for (BaseType baseType in baseTypes) {
-      if (baseType.isClass()) {
-        ClassBaseType classBaseType = baseType;
-        if (classBaseType.element.lookupByName(selector.memberName) != null) {
-          newBaseTypes.add(baseType);
-        }
-      } else {
-        newBaseTypes.add(baseType);
-      }
-    }
-    return _simplify(newBaseTypes);
-  }
-
-  ClassElement getUniqueType() {
-    if (baseTypes.length == 1) {
-      var iterator = baseTypes.iterator;
-      iterator.moveNext();
-      BaseType uniqueBaseType = iterator.current;
-      if (uniqueBaseType.isClass()) {
-        ClassBaseType uniqueClassType = uniqueBaseType;
-        return uniqueClassType.element;
-      }
-    }
-    return null;
-  }
-
-  String toString() => baseTypes.toString();
-}
-
-class ConcreteTypeSystem extends TypeSystem<ConcreteType> {
-  final Compiler compiler;
-  final ConcreteTypesInferrer inferrer;
-  final BaseTypes baseTypes;
-
-  final ConcreteType nullType;
-  final ConcreteType _intType;
-  final ConcreteType _uint31Type;
-  final ConcreteType _uint32Type;
-  final ConcreteType _positiveIntType;
-  final ConcreteType _doubleType;
-  final ConcreteType _numType;
-  final ConcreteType _boolType;
-  final ConcreteType _functionType;
-  final ConcreteType _listType;
-  final ConcreteType _constListType;
-  final ConcreteType _fixedListType;
-  final ConcreteType _growableListType;
-  final ConcreteType _mapType;
-  final ConcreteType _constMapType;
-  final ConcreteType _stringType;
-
-  final ConcreteType dynamicType;
-  final ConcreteType typeType;
-  final ConcreteType nonNullEmptyType;
-
-  ConcreteTypeSystem.internal(ConcreteTypesInferrer inferrer,
-                              BaseTypes baseTypes,
-                              ConcreteType singleton(BaseType baseType))
-      : this.compiler = inferrer.compiler
-      , this.inferrer = inferrer
-      , this.baseTypes = baseTypes
-      , this._constListType = singleton(baseTypes.constMapBaseType)
-      , this._constMapType = singleton(baseTypes.constMapBaseType)
-      , this._doubleType = singleton(baseTypes.doubleBaseType)
-      , this._fixedListType = singleton(baseTypes.fixedListBaseType)
-      , this._functionType = singleton(baseTypes.functionBaseType)
-      , this._growableListType = singleton(baseTypes.growableListBaseType)
-      , this._intType = singleton(baseTypes.intBaseType)
-      , this._listType = singleton(baseTypes.listBaseType)
-      , this._mapType = singleton(baseTypes.mapBaseType)
-      , this._numType = singleton(baseTypes.numBaseType)
-      , this._boolType = singleton(baseTypes.boolBaseType)
-      , this._stringType = singleton(baseTypes.stringBaseType)
-      , this.typeType = singleton(baseTypes.typeBaseType)
-      , this.dynamicType = const UnknownConcreteType()
-      , this.nullType = singleton(const NullBaseType())
-      , this.nonNullEmptyType = new ConcreteType.empty(
-          inferrer.compiler.maxConcreteTypeSize, baseTypes)
-      // TODO(polux): have better types here
-      , this._uint31Type = singleton(baseTypes.intBaseType)
-      , this._uint32Type = singleton(baseTypes.intBaseType)
-      , this._positiveIntType = singleton(baseTypes.intBaseType);
-
-  factory ConcreteTypeSystem(ConcreteTypesInferrer inferrer) {
-    Compiler compiler = inferrer.compiler;
-    BaseTypes baseTypes = new BaseTypes(compiler);
-    return new ConcreteTypeSystem.internal(
-        inferrer,
-        baseTypes,
-        (BaseType baseType) => new ConcreteType.singleton(
-            compiler.maxConcreteTypeSize, baseTypes, baseType));
-  }
-
-  @override
-  ConcreteType get intType {
-    inferrer.augmentSeenClasses(compiler.backend.intImplementation);
-    return _intType;
-  }
-
-  @override
-  ConcreteType get uint31Type {
-    inferrer.augmentSeenClasses(compiler.backend.uint31Implementation);
-    return _uint31Type;
-  }
-
-  @override
-  ConcreteType get uint32Type {
-    inferrer.augmentSeenClasses(compiler.backend.uint32Implementation);
-    return _uint32Type;
-  }
-
-  @override
-  ConcreteType get positiveIntType {
-    inferrer.augmentSeenClasses(compiler.backend.positiveIntImplementation);
-    return _positiveIntType;
-  }
-
-  @override
-  ConcreteType get doubleType {
-    inferrer.augmentSeenClasses(compiler.backend.doubleImplementation);
-    return _doubleType;
-  }
-
-  @override
-  ConcreteType get numType {
-    inferrer.augmentSeenClasses(compiler.backend.numImplementation);
-    return _numType;
-  }
-
-  @override
-  ConcreteType get boolType {
-    inferrer.augmentSeenClasses(compiler.backend.boolImplementation);
-    return _boolType;
-  }
-
-  @override
-  ConcreteType get functionType {
-    inferrer.augmentSeenClasses(compiler.backend.functionImplementation);
-    return _functionType;
-  }
-
-  @override
-  ConcreteType get listType {
-    inferrer.augmentSeenClasses(compiler.backend.listImplementation);
-    return _listType;
-  }
-
-  @override
-  ConcreteType get constListType {
-    inferrer.augmentSeenClasses(compiler.backend.constListImplementation);
-    return _constListType;
-  }
-
-  @override
-  ConcreteType get fixedListType {
-    inferrer.augmentSeenClasses(compiler.backend.fixedListImplementation);
-    return _fixedListType;
-  }
-
-  @override
-  ConcreteType get growableListType {
-    inferrer.augmentSeenClasses(compiler.backend.growableListImplementation);
-    return _growableListType;
-  }
-
-  @override
-  ConcreteType get mapType {
-    inferrer.augmentSeenClasses(compiler.backend.mapImplementation);
-    return _mapType;
-  }
-
-  @override
-  ConcreteType get constMapType {
-    inferrer.augmentSeenClasses(compiler.backend.constMapImplementation);
-    return _constMapType;
-  }
-
-  @override
-  ConcreteType get stringType {
-    inferrer.augmentSeenClasses(compiler.backend.stringImplementation);
-    return _stringType;
-  }
-
-  @override
-  ConcreteType stringLiteralType(_) {
-    inferrer.augmentSeenClasses(compiler.backend.stringImplementation);
-    return _stringType;
-  }
-
-  /**
-   * Returns the [TypeMask] representation of [baseType].
-   */
-  TypeMask baseTypeToTypeMask(BaseType baseType) {
-    if (baseType.isUnknown()) {
-      return const DynamicTypeMask();
-    } else if (baseType.isNull()) {
-      return new TypeMask.empty();
-    } else {
-      ClassBaseType classBaseType = baseType;
-      final element = classBaseType.element;
-      assert(element != null);
-      if (element == compiler.backend.numImplementation) {
-        return new TypeMask.nonNullSubclass(compiler.backend.numImplementation,
-                                            compiler.world);
-      } else if (element == compiler.backend.intImplementation) {
-        return new TypeMask.nonNullSubclass(compiler.backend.intImplementation,
-                                            compiler.world);
-      } else {
-        return new TypeMask.nonNullExact(element.declaration, compiler.world);
-      }
-    }
-  }
-
-  /**
-   * Returns the [TypeMask] representation of [concreteType].
-   */
-  TypeMask concreteTypeToTypeMask(ConcreteType concreteType) {
-    if (concreteType == null) return null;
-    TypeMask typeMask = new TypeMask.nonNullEmpty();
-    for (BaseType baseType in concreteType.baseTypes) {
-      TypeMask baseMask = baseTypeToTypeMask(baseType);
-      if (baseMask == const DynamicTypeMask()) return baseMask;
-      typeMask = typeMask.union(baseMask, compiler.world);
-    }
-    return typeMask;
-  }
-
-  @override
-  ConcreteType addPhiInput(Local variable,
-                           ConcreteType phiType,
-                           ConcreteType newType) {
-    return computeLUB(phiType, newType);
-  }
-
-  @override
-  ConcreteType allocateDiamondPhi(ConcreteType firstInput,
-                                  ConcreteType secondInput) {
-    return computeLUB(firstInput, secondInput);
-  }
-
-  @override
-  ConcreteType allocatePhi(Node node, Local variable, ConcreteType inputType) {
-    return inputType;
-  }
-
-  @override
-  ConcreteType allocateLoopPhi(Node node, Local variable,
-                               ConcreteType inputType) {
-    return inputType;
-  }
-
-  @override
-  ConcreteType computeLUB(ConcreteType firstType, ConcreteType secondType) {
-    if (firstType == null) {
-      return secondType;
-    } else if (secondType == null) {
-      return firstType;
-    } else {
-      return firstType.union(secondType);
-    }
-  }
-
-  // Implementation Inspired by
-  // type_graph_inferrer.TypeInformationSystem.narrowType
-  @override
-  ConcreteType narrowType(ConcreteType type,
-                          DartType annotation,
-                          {bool isNullable: true}) {
-    if (annotation.treatAsDynamic) return type;
-    if (annotation.isVoid) return nullType;
-    if (annotation.element == compiler.objectClass) return type;
-    ConcreteType otherType;
-    if (annotation.isTypedef || annotation.isFunctionType) {
-      otherType = functionType;
-    } else if (annotation.isTypeVariable) {
-      // TODO(polux): Narrow to bound.
-      return type;
-    } else {
-      assert(annotation.isInterfaceType);
-      otherType = nonNullSubtype(annotation.element);
-    }
-    if (isNullable) otherType = otherType.union(nullType);
-    if (type == null) return otherType;
-    return type.intersection(otherType);
-  }
-
-  @override
-  TypeMask newTypedSelector(ConcreteType receiver, TypeMask mask) {
-    return concreteTypeToTypeMask(receiver);
-  }
-
-  @override
-  ConcreteType nonNullEmpty() {
-    return nonNullEmptyType;
-  }
-
-  @override
-  ConcreteType nonNullExact(ClassElement cls) {
-    return nonNullSubtype(cls);
-  }
-
-  /**
-   * Helper method for [nonNullSubtype] and [nonNullSubclass].
-   */
-  ConcreteType nonNullSubX(ClassElement cls,
-                           Iterable<ClassElement> extractor(ClassElement cls)) {
-    if (cls == compiler.objectClass) {
-      return dynamicType;
-    }
-    ConcreteType result = nonNullEmptyType;
-    void registerClass(ClassElement element) {
-      if (!element.isAbstract) {
-        result = result.union(
-            new ConcreteType.singleton(compiler.maxConcreteTypeSize,
-                                       baseTypes,
-                                       new ClassBaseType(element)));
-        inferrer.augmentSeenClasses(element);
-      }
-    }
-    registerClass(cls);
-    Iterable<ClassElement> subtypes = extractor(cls);
-    subtypes.forEach(registerClass);
-    return result;
-  }
-
-  @override
-  ConcreteType nonNullSubclass(ClassElement cls) {
-    return nonNullSubX(cls, compiler.world.strictSubclassesOf);
-  }
-
-  @override
-  ConcreteType nonNullSubtype(ClassElement cls) {
-    return nonNullSubX(cls, compiler.world.strictSubtypesOf);
-  }
-
-  @override
-  ConcreteType simplifyPhi(Node node,
-                           Local variable,
-                           ConcreteType phiType) {
-    return phiType;
-  }
-
-  @override
-  bool selectorNeedsUpdate(ConcreteType type, TypeMask mask) {
-    return concreteTypeToTypeMask(type) != mask;
-  }
-
-  @override
-  ConcreteType refineReceiver(Selector selector,
-                              TypeMask mask,
-                              ConcreteType receiverType,
-      bool isConditional) {
-    if (isConditional) {
-      throw new UnimplementedError("isConditional in concrete type inferrer");
-    }
-    return receiverType.refine(selector, compiler);
-  }
-
-  @override
-  bool isNull(ConcreteType type) {
-    return (type.baseTypes.length == 1) && (type.baseTypes.first.isNull());
-  }
-
-  @override
-  ConcreteType allocateClosure(Node node, Element element) {
-    // TODO(polux): register closure here instead of in visitor?
-    return functionType;
-  }
-
-  @override
-  ConcreteType allocateList(ConcreteType type,
-                            Node node,
-                            Element enclosing,
-                            [ConcreteType elementType, int length]) {
-    if (elementType != null) {
-      inferrer.augmentListElementType(elementType);
-    }
-    return type;
-  }
-
-  @override
-  ConcreteType allocateMap(ConcreteType type,
-                           Node node,
-                           Element element,
-                           [List<ConcreteType> keyTypes,
-                            List<ConcreteType> valueTypes]) {
-    // TODO(polux): treat maps the same way we treat lists
-    return type;
-  }
-
-  @override
-  ConcreteType getConcreteTypeFor(TypeMask mask) {
-    if (mask.isUnion) {
-      UnionTypeMask union = mask;
-      return union.disjointMasks.fold(
-          nonNullEmptyType,
-          (type1, type2) => type1.union(getConcreteTypeFor(type2)));
-    } else {
-      FlatTypeMask flat = mask;
-      ConcreteType result;
-      if (flat.isEmpty) {
-        result = nonNullEmptyType;
-      } else if (flat.isExact) {
-        result = nonNullExact(flat.base);
-      } else if (flat.isSubclass) {
-        result = nonNullSubclass(flat.base);
-      } else if (flat.isSubtype) {
-        result = nonNullSubtype(flat.base);
-      } else {
-        throw new ArgumentError("unexpected mask");
-      }
-      return flat.isNullable ? result.union(nullType) : result;
-    }
-  }
-}
-
-/**
- * The cartesian product of concrete types: an iterable of
- * [ConcreteTypesEnvironment]s.
- */
-class ConcreteTypeCartesianProduct
-    extends IterableBase<ConcreteTypesEnvironment> {
-  final ConcreteTypesInferrer inferrer;
-  final ClassElement typeOfThis;
-  final Map<Element, ConcreteType> concreteTypes;
-  ConcreteTypeCartesianProduct(this.inferrer, this.typeOfThis,
-                               this.concreteTypes);
-  Iterator get iterator => concreteTypes.isEmpty
-      ? [new ConcreteTypesEnvironment(typeOfThis)].iterator
-      : new ConcreteTypeCartesianProductIterator(inferrer, typeOfThis,
-                                                 concreteTypes);
-  String toString() => this.toList().toString();
-}
-
-/**
- * An helper class for [ConcreteTypeCartesianProduct].
- */
-class ConcreteTypeCartesianProductIterator
-    implements Iterator<ConcreteTypesEnvironment> {
-  final ConcreteTypesInferrer inferrer;
-  final ClassElement classOfThis;
-  final Map<Element, ConcreteType> concreteTypes;
-  final Map<Element, BaseType> nextValues;
-  final Map<Element, Iterator> state;
-  int size = 1;
-  int counter = 0;
-  ConcreteTypesEnvironment _current;
-
-  ConcreteTypeCartesianProductIterator(this.inferrer, this.classOfThis,
-      Map<Element, ConcreteType> concreteTypes)
-      : this.concreteTypes = concreteTypes,
-        nextValues = new Map<Element, BaseType>(),
-        state = new Map<Element, Iterator>() {
-    if (concreteTypes.isEmpty) {
-      size = 0;
-      return;
-    }
-    for (final e in concreteTypes.keys) {
-      final baseTypes = concreteTypes[e].baseTypes;
-      size *= baseTypes.length;
-    }
-  }
-
-  ConcreteTypesEnvironment get current => _current;
-
-  ConcreteTypesEnvironment takeSnapshot() {
-    Map<Element, ConcreteType> result = new Map<Element, ConcreteType>();
-    nextValues.forEach((k, v) {
-      result[k] = inferrer.singletonConcreteType(v);
-    });
-    return new ConcreteTypesEnvironment.of(result, classOfThis);
-  }
-
-  bool moveNext() {
-    if (counter >= size) {
-      _current = null;
-      return false;
-    }
-    for (final key in concreteTypes.keys) {
-      final iterator = state[key];
-      if (iterator != null && iterator.moveNext()) {
-        nextValues[key] = state[key].current;
-        break;
-      }
-      Iterator newIterator = concreteTypes[key].baseTypes.iterator;
-      state[key] = newIterator;
-      newIterator.moveNext();
-      nextValues[key] = newIterator.current;
-    }
-    counter++;
-    _current = takeSnapshot();
-    return true;
-  }
-}
-
-/**
- * [BaseType] Constants.
- */
-class BaseTypes {
-  final ClassBaseType intBaseType;
-  final ClassBaseType doubleBaseType;
-  final ClassBaseType numBaseType;
-  final ClassBaseType boolBaseType;
-  final ClassBaseType stringBaseType;
-  final ClassBaseType listBaseType;
-  final ClassBaseType growableListBaseType;
-  final ClassBaseType fixedListBaseType;
-  final ClassBaseType constListBaseType;
-  final ClassBaseType mapBaseType;
-  final ClassBaseType constMapBaseType;
-  final ClassBaseType objectBaseType;
-  final ClassBaseType typeBaseType;
-  final ClassBaseType functionBaseType;
-  final ClassBaseType uint31Type;
-  final ClassBaseType uint32Type;
-  final ClassBaseType positiveIntType;
-
-  BaseTypes(Compiler compiler) :
-    intBaseType = new ClassBaseType(compiler.backend.intImplementation),
-    doubleBaseType = new ClassBaseType(compiler.backend.doubleImplementation),
-    numBaseType = new ClassBaseType(compiler.backend.numImplementation),
-    boolBaseType = new ClassBaseType(compiler.backend.boolImplementation),
-    stringBaseType = new ClassBaseType(compiler.backend.stringImplementation),
-    listBaseType = new ClassBaseType(compiler.backend.listImplementation),
-    growableListBaseType =
-        new ClassBaseType(compiler.backend.growableListImplementation),
-    fixedListBaseType =
-        new ClassBaseType(compiler.backend.fixedListImplementation),
-    constListBaseType =
-        new ClassBaseType(compiler.backend.constListImplementation),
-    mapBaseType = new ClassBaseType(compiler.backend.mapImplementation),
-    constMapBaseType =
-        new ClassBaseType(compiler.backend.constMapImplementation),
-    objectBaseType = new ClassBaseType(compiler.objectClass),
-    typeBaseType = new ClassBaseType(compiler.backend.typeImplementation),
-    functionBaseType =
-        new ClassBaseType(compiler.backend.functionImplementation),
-    uint31Type = new ClassBaseType(compiler.backend.uint31Implementation),
-    uint32Type = new ClassBaseType(compiler.backend.uint32Implementation),
-    positiveIntType =
-        new ClassBaseType(compiler.backend.positiveIntImplementation);
-}
-
-/**
- * An immutable mapping from method arguments to [ConcreteTypes].
- */
-class ConcreteTypesEnvironment {
-  final Map<Element, ConcreteType> environment;
-  final ClassElement classOfThis;
-
-  ConcreteTypesEnvironment([this.classOfThis]) :
-      environment = new Map<Element, ConcreteType>();
-  ConcreteTypesEnvironment.of(this.environment, this.classOfThis);
-
-  ConcreteType lookupType(Element element) => environment[element];
-
-  bool operator ==(ConcreteTypesEnvironment other) {
-    if (other is! ConcreteTypesEnvironment) return false;
-    if (classOfThis != other.classOfThis) return false;
-    if (environment.length != other.environment.length) return false;
-    for (Element key in environment.keys) {
-      if (!other.environment.containsKey(key)
-          || (environment[key] != other.environment[key])) {
-        return false;
-      }
-    }
-    return true;
-  }
-
-  int get hashCode {
-    int result = (classOfThis != null) ? classOfThis.hashCode : 1;
-    environment.forEach((element, concreteType) {
-      result = 31 * (31 * result + element.hashCode) + concreteType.hashCode;
-    });
-    return result;
-  }
-
-  String toString() => "{ this: $classOfThis, env: $environment }";
-}
-
-class ClosureEnvironment {
-  ConcreteType thisType;
-  final LocalsHandler locals;
-
-  ClosureEnvironment(this.thisType, this.locals);
-
-  bool mergeLocals(LocalsHandler newLocals) {
-    assert((locals == null) == (newLocals == null));
-    return (locals != null) ? locals.mergeAll([newLocals]) : false;
-  }
-
-  /// Returns true if changed.
-  bool merge(ConcreteType thisType, LocalsHandler locals) {
-    ConcreteType oldThisType = this.thisType;
-    if (this.thisType == null) {
-      this.thisType = thisType;
-    } else if (thisType != null) {
-      this.thisType = this.thisType.union(thisType);
-    }
-    return mergeLocals(locals) || (this.thisType != oldThisType);
-  }
-
-  toString() => "ClosureEnvironment { thisType = $thisType, locals = ... }";
-}
-
-/**
- * A set of encoutered closures.
- */
-class Closures {
-  final Compiler compiler;
-  final Map<FunctionElement, ClosureEnvironment> closures =
-      new Map<FunctionElement, ClosureEnvironment>();
-
-  Closures(this.compiler);
-
-  /// Returns true if the environment of the closure has changed.
-  bool put(FunctionElement closure,
-           ConcreteType typeOfThis,
-           LocalsHandler locals) {
-    ClosureEnvironment oldEnvironent = closures[closure];
-    if (oldEnvironent == null) {
-      closures[closure] = new ClosureEnvironment(typeOfThis, locals);
-      return true;
-    } else {
-      return oldEnvironent.merge(typeOfThis, locals);
-    }
-  }
-
-  ClosureEnvironment getEnvironmentOrNull(FunctionElement function) {
-    return closures[function];
-  }
-
-  Iterable<FunctionElement> get functionElements => closures.keys;
-
-  bool contains(FunctionElement function) => closures.containsKey(function);
-
-  String toString() => closures.toString();
-}
-
-/**
- * A work item for the type inference queue.
- */
-class InferenceWorkItem {
-  Element method;
-  ConcreteTypesEnvironment environment;
-  InferenceWorkItem(this.method, this.environment);
-
-  toString() => "{ method = $method, environment = $environment }";
-
-  bool operator ==(other) {
-    return (other is InferenceWorkItem)
-        && method == other.method
-        && environment == other.environment;
-  }
-
-  int get hashCode => 31 * method.hashCode + environment.hashCode;
-}
-
-/**
- * A sentinel type mask class representing the dynamicType. It is absorbing
- * for [:ConcreteTypesEnvironment.typeMaskUnion:].
- */
-class DynamicTypeMask implements TypeMask {
-  const DynamicTypeMask();
-
-  String toString() => 'sentinel type mask';
-
-  TypeMask nullable() {
-    throw new UnsupportedError("");
-  }
-
-  TypeMask nonNullable() {
-    throw new UnsupportedError("");
-  }
-
-  bool get isEmpty {
-    throw new UnsupportedError("");
-  }
-
-  bool get isNullable {
-    throw new UnsupportedError("");
-  }
-
-  bool get isExact {
-    throw new UnsupportedError("");
-  }
-
-  bool get isUnion {
-    throw new UnsupportedError("");
-  }
-
-  bool get isContainer {
-    throw new UnsupportedError("");
-  }
-
-  bool get isMap {
-    throw new UnsupportedError("");
-  }
-
-  bool get isDictionary {
-    throw new UnsupportedError("");
-  }
-
-  bool get isForwarding {
-    throw new UnsupportedError("");
-  }
-
-  bool get isValue {
-    throw new UnsupportedError("");
-  }
-
-  bool containsOnlyInt(ClassWorld classWorld) {
-    throw new UnsupportedError("");
-  }
-
-  bool containsOnlyDouble(ClassWorld classWorld) {
-    throw new UnsupportedError("");
-  }
-
-  bool containsOnlyNum(ClassWorld classWorld) {
-    throw new UnsupportedError("");
-  }
-
-  bool containsOnlyBool(ClassWorld classWorld) {
-    throw new UnsupportedError("");
-  }
-
-  bool containsOnlyString(ClassWorld classWorld) {
-    throw new UnsupportedError("");
-  }
-
-  bool containsOnly(ClassElement element) {
-    throw new UnsupportedError("");
-  }
-
-  bool satisfies(ClassElement cls, ClassWorld classWorld) {
-    throw new UnsupportedError("");
-  }
-
-  bool contains(ClassElement type, ClassWorld classWorld) {
-    throw new UnsupportedError("");
-  }
-
-  bool containsAll(ClassWorld classWorld) {
-    throw new UnsupportedError("");
-  }
-
-  ClassElement singleClass(ClassWorld classWorld) {
-    throw new UnsupportedError("");
-  }
-
-  TypeMask union(TypeMask other, ClassWorld classWorld) {
-    throw new UnsupportedError("");
-  }
-
-  TypeMask intersection(TypeMask other, ClassWorld classWorld) {
-    throw new UnsupportedError("");
-  }
-
-  bool canHit(Element element, Selector selector, ClassWorld classWorld) {
-    throw new UnsupportedError("");
-  }
-
-  Element locateSingleElement(Selector selector,
-                              TypeMask mask,
-                              Compiler compiler) {
-    throw new UnsupportedError("");
-  }
-
-  bool needsNoSuchMethodHandling(Selector selector, ClassWorld classWorld) {
-    throw new UnsupportedError("");
-  }
-
-  bool isInMask(TypeMask other, ClassWorld classWorld) {
-    throw new UnsupportedError("");
-  }
-
-  bool containsMask(TypeMask other, ClassWorld classWorld) {
-    throw new UnsupportedError("");
-  }
-}
-
-class WorkQueue {
-  final Queue<InferenceWorkItem> queue = new Queue<InferenceWorkItem>();
-
-  void add(InferenceWorkItem workItem) {
-    if (!queue.contains(workItem)) {
-      queue.addLast(workItem);
-    }
-  }
-
-  InferenceWorkItem remove() {
-    return queue.removeFirst();
-  }
-
-  bool get isEmpty => queue.isEmpty;
-}
-
-/**
- * A task which conservatively infers a [ConcreteType] for each sub expression
- * of the program. The entry point is [analyzeMain].
- */
-class ConcreteTypesInferrer
-    extends InferrerEngine<ConcreteType, ConcreteTypeSystem>
-    implements TypesInferrer {
-
-  final String name = "Type inferrer";
-
-  /**
-   * When true, the string literal [:"__dynamic_for_test":] is inferred to
-   * have the unknown type.
-   */
-  // TODO(polux): get rid of this hack once we have a natural way of inferring
-  // the unknown type.
-  bool testMode = false;
-
-  // --- constants ---
-
-  /**
-   * Constants representing builtin base types. Initialized by [initialize]
-   * and not by the constructor because the compiler elements are not yet
-   * populated.
-   */
-  BaseTypes baseTypes;
-
-  /** The associated type system */
-  ConcreteTypeSystem types;
-
-  /**
-   * Constant representing [:ConcreteList#[]:] where [:ConcreteList:] is the
-   * concrete implementation of lists for the selected backend.
-   */
-  FunctionElement listIndex;
-
-  /**
-   * Constant representing [:ConcreteList#[]=:] where [:ConcreteList:] is the
-   * concrete implementation of lists for the selected backend.
-   */
-  FunctionElement listIndexSet;
-
-  /**
-   * Constant representing [:ConcreteList#add:] where [:ConcreteList:] is the
-   * concrete implementation of lists for the selected backend.
-   */
-  FunctionElement listAdd;
-
-  /**
-   * Constant representing [:ConcreteList#removeAt:] where [:ConcreteList:] is
-   * the concrete implementation of lists for the selected backend.
-   */
-  FunctionElement listRemoveAt;
-
-  /**
-   * Constant representing [:ConcreteList#insert:] where [:ConcreteList:] is
-   * the concrete implementation of lists for the selected backend.
-   */
-  FunctionElement listInsert;
-
-  /**
-   * Constant representing [:ConcreteList#removeLast:] where [:ConcreteList:] is
-   * the concrete implementation of lists for the selected backend.
-   */
-  FunctionElement listRemoveLast;
-
-  /** Constant representing [:List():]. */
-  FunctionElement listConstructor;
-
-  /** The unknown concrete type */
-  final ConcreteType unknownConcreteType;
-
-  /** The empty concrete type */
-  ConcreteType emptyConcreteType;
-
-  /** The null concrete type */
-  ConcreteType nullConcreteType;
-
-  // --- state updated by the inference ---
-
-  /**
-   * A map from (function x argument base types) to their inferred concrete
-   * type. Another way of seeing [methodToTemplates] is as a map from
-   * [FunctionElement]s to "templates" in the sense of "The Cartesian Product
-   * Algorithm - Simple and Precise Type Inference of Parametric Polymorphism"
-   * by Ole Agesen.
-   */
-  // TODO(polux): build a better abstraction, like Closures
-  final Map<FunctionElement, Map<ConcreteTypesEnvironment, ConcreteType>>
-      methodToTemplates;
-
-  /** The set of encountered closures. */
-  final Closures closures;
-
-  /** A map from expressions to their inferred concrete types. */
-  final Map<Node, ConcreteType> inferredTypes;
-
-  /** A map from fields to their inferred concrete types. */
-  final Map<Element, ConcreteType> inferredFieldTypes;
-
-  /**
-   * [:callers[f]:] is the list of [:f:]'s possible callers or fields
-   * whose initialization is a call to [:f:].
-   */
-  final Map<FunctionElement, Set<Element>> callers;
-
-  /**
-   * [:readers[field]:] is the list of [:field:]'s possible readers or fields
-   * whose initialization is a read of [:field:].
-   */
-  final Map<Element, Set<Element>> fieldReaders;
-
-  /**
-   * [:readers[local]:] is the list of [:local:]'s possible readers.
-   */
-  final Map<Local, Set<FunctionElement>> capturedLocalsReaders;
-
-  /// The set of classes encountered so far.
-  final Set<ClassElement> seenClasses;
-
-  /**
-   * A map from selector names to callers of methods with this name on objects
-   * of unknown inferred type.
-   */
-  final Map<String, Set<FunctionElement>> dynamicCallers;
-
-  /** The inferred type of elements stored in Lists. */
-  ConcreteType listElementType;
-
-  /**
-   * A map from parameters to their inferred concrete types. It plays no role
-   * in the analysis, it is write only.
-   */
-  final Map<VariableElement, ConcreteType> inferredParameterTypes;
-
-  /**
-   * A map from selectors to their inferred type masks, indexed by the mask
-   * of the receiver. It plays no role in the analysis, it is write only.
-   */
-  final Map<Selector, Map<TypeMask, TypeMask>> inferredSelectorTypes;
-
-  /** The work queue consumed by [analyzeMain]. */
-  final WorkQueue workQueue;
-
-  /** The item being worked on. */
-  InferenceWorkItem currentWorkItem;
-
-  ConcreteTypesInferrer(Compiler compiler)
-      : methodToTemplates = new Map<FunctionElement,
-            Map<ConcreteTypesEnvironment, ConcreteType>>(),
-        closures = new Closures(compiler),
-        inferredTypes = new Map<Node, ConcreteType>(),
-        inferredFieldTypes = new Map<Element, ConcreteType>(),
-        inferredParameterTypes = new Map<VariableElement, ConcreteType>(),
-        workQueue = new WorkQueue(),
-        callers = new Map<FunctionElement, Set<Element>>(),
-        fieldReaders = new Map<Element, Set<Element>>(),
-        capturedLocalsReaders = new Map<Local, Set<FunctionElement>>(),
-        seenClasses = new Set<ClassElement>(),
-        dynamicCallers = new Map<String, Set<FunctionElement>>(),
-        inferredSelectorTypes = new Map<Selector, Map<TypeMask, TypeMask>>(),
-        unknownConcreteType = new ConcreteType.unknown(),
-        super(compiler, null);
-
-  /* Initialization code that cannot be run in the constructor because it
-   * requires the compiler's elements to be populated.
-   */
-  void initialize() {
-    baseTypes = new BaseTypes(compiler);
-    types = new ConcreteTypeSystem(this);
-    ClassElement jsArrayClass = baseTypes.listBaseType.element;
-    listIndex = jsArrayClass.lookupMember('[]');
-    listIndexSet = jsArrayClass.lookupMember('[]=');
-    listAdd = jsArrayClass.lookupMember('add');
-    listRemoveAt = jsArrayClass.lookupMember('removeAt');
-    listInsert = jsArrayClass.lookupMember('insert');
-    listRemoveLast =
-        jsArrayClass.lookupMember('removeLast');
-    listConstructor =
-        compiler.listClass.lookupDefaultConstructor();
-    if (listConstructor != null) {
-      listConstructor = listConstructor.implementation;
-    }
-    emptyConcreteType = new ConcreteType.empty(compiler.maxConcreteTypeSize,
-                                               baseTypes);
-    nullConcreteType = singletonConcreteType(const NullBaseType());
-    listElementType = emptyConcreteType;
-  }
-
-  // --- utility methods ---
-
-  /** Creates a singleton concrete type containing [baseType]. */
-  ConcreteType singletonConcreteType(BaseType baseType) {
-    return new ConcreteType.singleton(compiler.maxConcreteTypeSize, baseTypes,
-                                      baseType);
-  }
-
-  /**
-   * Computes the union of [mask1] and [mask2] where [mask1] and [mask2] are
-   * possibly equal to [: DynamicTypeMask.instance :].
-   */
-  TypeMask typeMaskUnion(TypeMask mask1, TypeMask mask2) {
-    if (mask1 == const DynamicTypeMask() || mask2 == const DynamicTypeMask()) {
-      return const DynamicTypeMask();
-    }
-    return mask1.union(mask2, compiler.world);
-  }
-
-  /**
-   * Returns all the members matching [selector].
-   */
-  Set<Element> getMembersBySelector(Selector selector) {
-    // TODO(polux): memoize?
-    Set<Element> result = new Set<Element>();
-    for (ClassElement cls in seenClasses) {
-      Element elem = cls.lookupByName(selector.memberName);
-      if (elem != null) {
-        result.add(elem.implementation);
-      }
-    }
-    return result;
-  }
-
-  /**
-   * Returns all the subtypes of [cls], [cls] included.
-   */
-  Set<ClassElement> getReflexiveSubtypesOf(ClassElement cls) {
-    // TODO(polux): memoize?
-    Set<ClassElement> result = new Set<ClassElement>()..add(cls);
-    for (ClassElement candidate in seenClasses) {
-      if (compiler.world.isSubtypeOf(candidate, cls)) {
-        result.add(candidate);
-      }
-    }
-    return result;
-  }
-
-  /**
-   * Sets the concrete type associated to [node] to the union of the inferred
-   * concrete type so far and of [type].
-   */
-  void augmentInferredType(Node node, ConcreteType type) {
-    ConcreteType currentType = inferredTypes[node];
-    inferredTypes[node] =
-        (currentType == null) ? type : currentType.union(type);
-  }
-
-  /**
-   * Sets the concrete type associated to [selector] to the union of the
-   * inferred concrete type so far and of [returnType].
-   *
-   * Precondition: [:(typeOfThis != null) && (returnType != null):]
-   */
-  void augmentInferredSelectorType(Selector selector,
-                                   TypeMask typeOfThis,
-                                   TypeMask returnType) {
-    assert(returnType != null);
-    assert(typeOfThis != null);
-
-    Map<TypeMask, TypeMask> currentMap = inferredSelectorTypes.putIfAbsent(
-        selector, () => new Map<TypeMask, TypeMask>());
-    TypeMask currentReturnType = currentMap[typeOfThis];
-    currentMap[typeOfThis] = (currentReturnType == null)
-        ? returnType
-        : typeMaskUnion(currentReturnType, returnType);
-  }
-
-  /**
-   * Returns the current inferred concrete type of [field].
-   */
-  ConcreteType getFieldType(Selector selector, Element field) {
-    ensureFieldInitialized(field);
-    ConcreteType result = inferredFieldTypes[field];
-    result = (result == null) ? emptyConcreteType : result;
-    if (selector != null) {
-      Element enclosing = field.enclosingElement;
-      if (enclosing.isClass) {
-        ClassElement cls = enclosing;
-        TypeMask receiverMask = new TypeMask.exact(cls.declaration, classWorld);
-        TypeMask resultMask = types.concreteTypeToTypeMask(result);
-        augmentInferredSelectorType(selector, receiverMask, resultMask);
-      }
-    }
-    return result;
-  }
-
-  /**
-   * Sets the concrete type associated to [field] to the union of the inferred
-   * concrete type so far and of [type].
-   */
-  void augmentFieldType(Element field, ConcreteType type) {
-    ensureFieldInitialized(field);
-    ConcreteType oldType = inferredFieldTypes[field];
-    ConcreteType newType = (oldType != null) ? oldType.union(type) : type;
-    if (oldType != newType) {
-      inferredFieldTypes[field] = newType;
-      invalidateReaders(field);
-    }
-  }
-
-  /** Augment the inferred type of elements stored in Lists. */
-  void augmentListElementType(ConcreteType type) {
-    ConcreteType newType = listElementType.union(type);
-    if (newType != listElementType) {
-      invalidateCallers(listIndex);
-      listElementType = newType;
-    }
-  }
-
-  /**
-   * Sets the concrete type associated to [parameter] to the union of the
-   * inferred concrete type so far and of [type].
-   */
-  void augmentParameterType(VariableElement parameter, ConcreteType type) {
-    ConcreteType oldType = inferredParameterTypes[parameter];
-    inferredParameterTypes[parameter] =
-        (oldType == null) ? type : oldType.union(type);
-  }
-
-  /** Augments the set of classes encountered so far. */
-  void augmentSeenClasses(ClassElement cls) {
-    if (!seenClasses.contains(cls)) {
-      seenClasses.add(cls);
-      cls.forEachMember((_, Element member) {
-        Set<FunctionElement> functions = dynamicCallers[member.name];
-        if (functions != null) {
-          functions.forEach(invalidate);
-        }
-      }, includeSuperAndInjectedMembers: true);
-    }
-  }
-
-  /**
-   * Add [caller] to the set of [callee]'s callers.
-   */
-  void addCaller(FunctionElement callee, Element caller) {
-    callers.putIfAbsent(callee, () => new Set<Element>())
-           .add(caller);
-  }
-
-  /**
-   * Add [caller] to the set of [callee]'s dynamic callers.
-   */
-  void addDynamicCaller(Selector callee, FunctionElement caller) {
-      dynamicCallers
-          .putIfAbsent(callee.name, () => new Set<FunctionElement>())
-          .add(caller);
-  }
-
-  /**
-   * Add [reader] to the set of [field]'s readers.
-   */
-  void addFieldReader(Element field, Element reader) {
-    fieldReaders.putIfAbsent(field, () => new Set<Element>())
-                .add(reader);
-  }
-
-  /**
-   * Add [reader] to the set of [local]'s readers.
-   */
-  void addCapturedLocalReader(Local local, FunctionElement reader) {
-    capturedLocalsReaders.putIfAbsent(local, () => new Set<FunctionElement>())
-                         .add(reader);
-  }
-
-  /**
-   * Add a closure to the set of seen closures. Invalidate callers if
-   * the set of locals has changed.
-   */
-  void addClosure(FunctionElement closure,
-                  ConcreteType typeOfThis,
-                  LocalsHandler locals) {
-    if (closures.put(closure, typeOfThis, locals)) {
-      invalidateCallers(closure);
-    }
-  }
-
-  /**
-   * Invalidate all callers of [function].
-   */
-  void invalidateCallers(FunctionElement function) {
-    Set<Element> methodCallers = callers[function];
-    if (methodCallers != null) {
-      methodCallers.forEach(invalidate);
-    }
-  }
-
-  /**
-   * Invalidate all reader of [field].
-   */
-  void invalidateReaders(Element field) {
-    Set<Element> readers = fieldReaders[field];
-    if (readers != null) {
-      readers.forEach(invalidate);
-    }
-  }
-
-  /**
-   * Add all templates of [methodOrField] to the workqueue.
-   */
-  void invalidate(Element methodOrField) {
-    if (methodOrField.isField) {
-      workQueue.add(new InferenceWorkItem(
-          methodOrField, new ConcreteTypesEnvironment()));
-    } else {
-      Map<ConcreteTypesEnvironment, ConcreteType> templates =
-          methodToTemplates[methodOrField];
-      if (templates != null) {
-        templates.forEach((environment, _) {
-          workQueue.add(
-              new InferenceWorkItem(methodOrField, environment));
-        });
-      }
-    }
-  }
-
-  /**
-   * Returns the template associated to [function] or create an empty template
-   * for [function] return it.
-   */
-  // TODO(polux): encapsulate this in an abstraction for templates
-  Map<ConcreteTypesEnvironment, ConcreteType>
-      getTemplatesOrEmpty(FunctionElement function) {
-    return methodToTemplates.putIfAbsent(
-        function,
-        () => new Map<ConcreteTypesEnvironment, ConcreteType>());
-  }
-
-  // -- methods of types.TypesInferrer (interface with the backend) --
-
-  /** Get the inferred concrete type of [node]. */
-  @override
-  TypeMask getTypeOfNode(Element owner, Node node) {
-    TypeMask result = types.concreteTypeToTypeMask(inferredTypes[node]);
-    return (result == const DynamicTypeMask()) ? null : result;
-  }
-
-  /** Get the inferred concrete type of [element]. */
-  @override
-  TypeMask getTypeOfElement(Element element) {
-    final result = types.concreteTypeToTypeMask(typeOfElement(element));
-    return (result == const DynamicTypeMask()) ? null : result;
-  }
-
-  /**
-   * Get the inferred concrete return type of [element]. A null return value
-   * means "I don't know".
-   */
-  @override
-  TypeMask getReturnTypeOfElement(Element element) {
-    assert(element is FunctionElement);
-    Map<ConcreteTypesEnvironment, ConcreteType> templates =
-        methodToTemplates[element];
-    if (templates == null) return null;
-    ConcreteType returnType = emptyConcreteType;
-    templates.forEach((_, concreteType) {
-      returnType = returnType.union(concreteType);
-    });
-    TypeMask result = types.concreteTypeToTypeMask(returnType);
-    return (result == const DynamicTypeMask()) ? null : result;
-  }
-
-  /**
-   * Get the inferred concrete type of [selector]. A null return value means
-   * "I don't know".
-   */
-  @override
-  TypeMask getTypeOfSelector(Selector selector, TypeMask mask) {
-    Map<TypeMask, TypeMask> candidates = inferredSelectorTypes[selector];
-    if (candidates == null) {
-      return null;
-    }
-    TypeMask result = new TypeMask.nonNullEmpty();
-    if (mask == null) {
-      candidates.forEach((TypeMask receiverType, TypeMask returnType) {
-        result = typeMaskUnion(result, returnType);
-      });
-    } else {
-      candidates.forEach((TypeMask receiverType, TypeMask returnType) {
-        TypeMask intersection = receiverType.intersection(mask, compiler.world);
-        if (!intersection.isEmpty || intersection.isNullable) {
-          result = typeMaskUnion(result, returnType);
-        }
-      });
-    }
-    return result == const DynamicTypeMask() ? null : result;
-  }
-
-  @override
-  void clear() {
-    throw new UnsupportedError("clearing is not yet implemented");
-  }
-
-  @override
-  bool isCalledOnce(Element element) {
-    // Never called by SimpleTypeInferrer.
-    throw new UnsupportedError("");
-  }
-
-  @override
-  bool isFixedArrayCheckedForGrowable(Node node) {
-    // Never called by SimpleTypeInferrer.
-    throw new UnsupportedError("");
-  }
-
-  // --- analysis ---
-
-  /**
-   * Returns the concrete type returned by [function] given arguments of
-   * concrete types [argumentsTypes]. If [function] is static then
-   * [receiverType] must be null, else [function] must be a member of
-   * [receiverType].
-   */
-  ConcreteType getSendReturnType(Selector selector,
-                                 FunctionElement function,
-                                 ClassElement receiverType,
-                                 ArgumentsTypes<ConcreteType> argumentsTypes) {
-    assert(function != null);
-
-    ConcreteType result = emptyConcreteType;
-    Map<Element, ConcreteType> argumentMap =
-        associateArguments(function, argumentsTypes);
-    // if the association failed, this send will never occur or will fail
-    if (argumentMap == null) {
-      return emptyConcreteType;
-    }
-
-    argumentMap.forEach(augmentParameterType);
-    ConcreteTypeCartesianProduct product =
-        new ConcreteTypeCartesianProduct(this, receiverType, argumentMap);
-    for (ConcreteTypesEnvironment environment in product) {
-      result = result.union(
-          getMonomorphicSendReturnType(function, environment));
-    }
-
-    if (selector != null && receiverType != null) {
-      // TODO(polux): generalize to any abstract class if we ever handle other
-      // abstract classes than num.
-      TypeMask receiverMask =
-          (receiverType == compiler.backend.numImplementation
-          || receiverType == compiler.backend.intImplementation)
-              ? new TypeMask.nonNullSubclass(receiverType.declaration,
-                  compiler.world)
-              : new TypeMask.nonNullExact(receiverType.declaration,
-                  compiler.world);
-      TypeMask resultMask = types.concreteTypeToTypeMask(result);
-      augmentInferredSelectorType(selector, receiverMask, resultMask);
-    }
-
-    return result;
-  }
-
-  /**
-   * Given a method signature and a list of concrete types, builds a map from
-   * formals to their corresponding concrete types. Returns null if the
-   * association is impossible (for instance: too many arguments).
-   */
-  Map<Element, ConcreteType> associateArguments(
-      FunctionElement function,
-      ArgumentsTypes<ConcreteType> argumentsTypes) {
-    final Map<Element, ConcreteType> result = new Map<Element, ConcreteType>();
-    final FunctionSignature signature = function.functionSignature;
-
-    // guard 1: too many arguments
-    if (argumentsTypes.length > signature.parameterCount) {
-      return null;
-    }
-    // guard 2: not enough arguments
-    if (argumentsTypes.positional.length < signature.requiredParameterCount) {
-      return null;
-    }
-    // guard 3: too many positional arguments
-    if (signature.optionalParametersAreNamed &&
-        argumentsTypes.positional.length > signature.requiredParameterCount) {
-      return null;
-    }
-
-    handleLeftoverOptionalParameter(ParameterElement parameter) {
-      Expression initializer = parameter.initializer;
-      result[parameter] = (initializer == null)
-          ? nullConcreteType
-          : analyzeDefaultValue(function, initializer);
-    }
-
-    final Iterator<ConcreteType> remainingPositionalArguments =
-        argumentsTypes.positional.iterator;
-    // we attach each positional parameter to its corresponding positional
-    // argument
-    for (Element requiredParameter in signature.requiredParameters) {
-      // we know moveNext() succeeds because of guard 2
-      remainingPositionalArguments.moveNext();
-      result[requiredParameter] = remainingPositionalArguments.current;
-    }
-    if (signature.optionalParametersAreNamed) {
-      // we build a map out of the remaining named parameters
-      final Map<String, Element> leftOverNamedParameters =
-          new Map<String, Element>();
-      for (Element namedParameter in signature.optionalParameters) {
-        leftOverNamedParameters[namedParameter.name] = namedParameter;
-      }
-      // we attach the named arguments to their corresponding optional
-      // parameters
-      for (String source in argumentsTypes.named.keys) {
-        final ConcreteType concreteType = argumentsTypes.named[source];
-        final Element namedParameter = leftOverNamedParameters[source];
-        // unexisting or already used named parameter
-        if (namedParameter == null) return null;
-        result[namedParameter] = concreteType;
-        leftOverNamedParameters.remove(source);
-      }
-      leftOverNamedParameters.forEach((_, Element parameter) {
-        handleLeftoverOptionalParameter(parameter);
-      });
-    } else { // optional parameters are positional
-      // we attach the remaining positional arguments to their corresponding
-      // optional parameters
-      Iterator<Element> remainingOptionalParameters =
-          signature.optionalParameters.iterator;
-      while (remainingPositionalArguments.moveNext()) {
-        // we know this is true because of guard 1
-        remainingOptionalParameters.moveNext();
-        final Element optionalParameter = remainingOptionalParameters.current;
-        result[optionalParameter] = remainingPositionalArguments.current;
-      }
-      while (remainingOptionalParameters.moveNext()) {
-        handleLeftoverOptionalParameter(remainingOptionalParameters.current);
-      }
-    }
-    return result;
-  }
-
-  ConcreteType getMonomorphicSendReturnType(
-      FunctionElement function,
-      ConcreteTypesEnvironment environment) {
-    Map<ConcreteTypesEnvironment, ConcreteType> template =
-        getTemplatesOrEmpty(function);
-    ConcreteType type = template[environment];
-    ConcreteType specialType = getSpecialCaseReturnType(function, environment);
-    if (type != null) {
-      return specialType != null ? specialType : type;
-    } else {
-      workQueue.add(new InferenceWorkItem(function, environment));
-      return specialType != null ? specialType : emptyConcreteType;
-    }
-  }
-
-  /**
-   * Handles external methods that cannot be cached because they depend on some
-   * other state of [ConcreteTypesInferrer] like [:List#[]:] and
-   * [:List#[]=:]. Returns null if [function] and [environment] don't form a
-   * special case
-   */
-  ConcreteType getSpecialCaseReturnType(FunctionElement function,
-                                        ConcreteTypesEnvironment environment) {
-    // Handles int + int, double + double, int - int, ...
-    // We cannot compare function to int#+, int#-, etc. because int and double
-    // don't override these methods. So for 1+2, getSpecialCaseReturnType will
-    // be invoked with function = num#+. We use environment.typeOfThis instead.
-    ClassElement cls = environment.classOfThis;
-    List<Element> parameters = function.parameters;
-    if (cls != null) {
-      String name = function.name;
-      if ((cls == baseTypes.intBaseType.element
-          || cls == baseTypes.doubleBaseType.element)
-          && (name == '+' || name == '-' || name == '*')) {
-        ConcreteType argumentType = environment.lookupType(parameters.single);
-        if (argumentType.getUniqueType() == cls) {
-          return singletonConcreteType(new ClassBaseType(cls));
-        }
-      }
-    }
-
-    if (function == listIndex || function == listRemoveAt) {
-      ConcreteType indexType = environment.lookupType(parameters.single);
-      if (!indexType.baseTypes.contains(baseTypes.intBaseType)) {
-        return emptyConcreteType;
-      }
-      return listElementType;
-    } else if (function == listIndexSet || function == listInsert) {
-      ConcreteType indexType = environment.lookupType(parameters[0]);
-      if (!indexType.baseTypes.contains(baseTypes.intBaseType)) {
-        return emptyConcreteType;
-      }
-      ConcreteType elementType = environment.lookupType(parameters[1]);
-      augmentListElementType(elementType);
-      return emptyConcreteType;
-    } else if (function == listAdd) {
-      ConcreteType elementType = environment.lookupType(parameters.single);
-      augmentListElementType(elementType);
-      return emptyConcreteType;
-    } else if (function == listRemoveLast) {
-      return listElementType;
-    }
-    return null;
-  }
-
-  ConcreteType analyzeMethodOrClosure(Element element,
-      ConcreteTypesEnvironment environment) {
-    ConcreteType specialResult = handleSpecialMethod(element, environment);
-    if (specialResult != null) return specialResult;
-    ClosureEnvironment closureEnv = closures.getEnvironmentOrNull(element);
-    return (closureEnv == null)
-        ? analyzeMethod(element, environment)
-        : analyzeClosure(element, closureEnv, environment);
-  }
-
-  ConcreteType analyzeMethod(Element element,
-                             ConcreteTypesEnvironment environment) {
-    TypeInferrerVisitor visitor = new TypeInferrerVisitor(
-        element,
-        this,
-        singletonConcreteType(new ClassBaseType(environment.classOfThis)),
-        environment.environment);
-    visitor.run();
-    return visitor.returnType;
-  }
-
-  ConcreteType analyzeClosure(Element element,
-                              ClosureEnvironment closureEnv,
-                              ConcreteTypesEnvironment environment) {
-    assert(environment.classOfThis == null);
-    LocalsHandler locals = (closureEnv.locals != null)
-        ? new LocalsHandler.deepCopyOf(closureEnv.locals)
-        : null;
-    TypeInferrerVisitor visitor = new TypeInferrerVisitor(element, this,
-        closureEnv.thisType, environment.environment, locals);
-    visitor.run();
-    return visitor.returnType;
-  }
-
-  /**
-   * Analyze the initializer of a field if it has not yet been done and update
-   * [inferredFieldTypes] accordingly. Invalidate the readers of the field if
-   * needed.
-   */
-  void ensureFieldInitialized(Element field) {
-    // This is test is needed for fitering out BoxFieldElements.
-    if (field is! BoxFieldElement && inferredFieldTypes[field] == null) {
-      analyzeFieldInitialization(field);
-    }
-  }
-
-  /**
-   * Analyze the initializer of a field and update [inferredFieldTypes]
-   * accordingly. Invalidate the readers of the field if needed.
-   */
-  ConcreteType analyzeFieldInitialization(VariableElement field) {
-    Visitor visitor = new TypeInferrerVisitor(field, this, null, new Map());
-    ConcreteType type;
-    if (field.initializer != null) {
-      type = field.initializer.accept(visitor);
-      inferredFieldTypes[field] = type;
-      invalidateReaders(field);
-    }
-    return type;
-  }
-
-  /**
-   * Analyze a default value.
-   */
-  ConcreteType analyzeDefaultValue(Element function, Node expression) {
-    assert((function != null) && (expression != null));
-    Visitor visitor = new TypeInferrerVisitor(function, this, null, {});
-    return expression.accept(visitor);
-  }
-
-  /**
-   * Hook that performs side effects on some special method calls (like
-   * [:List(length):]) and possibly returns a concrete type.
-   */
-  ConcreteType handleSpecialMethod(FunctionElement element,
-                                   ConcreteTypesEnvironment environment) {
-    // We trust the return type of native elements
-    if (isNativeElement(element)) {
-      var elementType = element.type;
-      assert(elementType.isFunctionType);
-      return typeOfNativeBehavior(
-          native.NativeBehavior.ofMethod(element, compiler));
-    }
-    // When List([length]) is called with some length, we must augment
-    // listElementType with {null}.
-    if (element == listConstructor) {
-      List<Element> parameters =
-          listConstructor.functionSignature.optionalParameters;
-      ConcreteType lengthType = environment.lookupType(parameters.first);
-      if (lengthType.baseTypes.contains(baseTypes.intBaseType)) {
-        augmentListElementType(nullConcreteType);
-      }
-    }
-    return null;
-  }
-
-  /**
-   * Performs concrete type inference of the code reachable from [element].
-   */
-  @override
-  bool analyzeMain(Element element) {
-    initialize();
-    workQueue.add(
-        new InferenceWorkItem(element, new ConcreteTypesEnvironment()));
-    while (!workQueue.isEmpty) {
-      currentWorkItem = workQueue.remove();
-      if (currentWorkItem.method.isField) {
-        analyzeFieldInitialization(currentWorkItem.method);
-      } else {
-        Map<ConcreteTypesEnvironment, ConcreteType> template =
-            getTemplatesOrEmpty(currentWorkItem.method);
-        template.putIfAbsent(
-            currentWorkItem.environment, () => emptyConcreteType);
-        recordReturnType(
-            currentWorkItem.method,
-            analyzeMethodOrClosure(currentWorkItem.method,
-                                   currentWorkItem.environment));
-      }
-    }
-    return true;
-  }
-
-  /**
-   * Dumps debugging information on the standard output.
-   */
-  void debug() {
-    print("queue:");
-    for (InferenceWorkItem workItem in workQueue.queue) {
-      print("  $workItem");
-    }
-    print("seen classes:");
-    for (ClassElement cls in seenClasses) {
-      print("  ${cls.name}");
-    }
-    print("callers:");
-    callers.forEach((k,v) {
-      print("  $k: $v");
-    });
-    print("dynamic callers:");
-    dynamicCallers.forEach((k,v) {
-      print("  $k: $v");
-    });
-    print("readers:");
-    fieldReaders.forEach((k,v) {
-      print("  $k: $v");
-    });
-    print("readers of captured locals:");
-    capturedLocalsReaders.forEach((k,v) {
-      print("  $k: $v");
-    });
-    print("inferredFieldTypes:");
-    inferredFieldTypes.forEach((k,v) {
-      print("  $k: $v");
-    });
-    print("listElementType:");
-    print("  $listElementType");
-    print("inferredParameterTypes:");
-    inferredParameterTypes.forEach((k,v) {
-      print("  $k: $v");
-    });
-    print("inferred selector types:");
-    inferredSelectorTypes.forEach((selector, map) {
-      print("  $selector:");
-      map.forEach((k, v) {
-        print("    $k: $v");
-      });
-    });
-    print("cache:");
-    methodToTemplates.forEach((k,v) {
-      print("  $k: $v");
-    });
-    print("closures:");
-    closures.closures.forEach((k, ClosureEnvironment v) {
-      print("  $k");
-      print("    this: ${v.thisType}");
-      if (v.locals != null) {
-        v.locals.locals.forEachLocal((local, type) {
-          print("    $local: $type");
-        });
-      }
-    });
-    print("inferred expression types:");
-    inferredTypes.forEach((k,v) {
-      print("  $k: $v");
-    });
-  }
-
-  @override
-  ConcreteType addReturnTypeFor(Element analyzedElement,
-                                ConcreteType currentType,
-                                ConcreteType newType) {
-    return (currentType == null) ? newType : currentType.union(newType);
-  }
-
-  @override
-  void forEachElementMatching(Selector selector,
-                              TypeMask mask,
-                              bool f(Element element)) {
-    getMembersBySelector(selector).forEach(f);
-  }
-
-  @override
-  void recordReturnType(Element element, ConcreteType type) {
-    assert((type != null) && (element == currentWorkItem.method));
-    Map<ConcreteTypesEnvironment, ConcreteType> template =
-        getTemplatesOrEmpty(element);
-    if (template[currentWorkItem.environment] != type) {
-      template[currentWorkItem.environment] = type;
-      invalidateCallers(element);
-    }
-  }
-
-  @override
-  void recordType(Element element, ConcreteType type) {
-    assert(element is FieldElement);
-    augmentFieldType(element, type);
-  }
-
-  @override
-  void recordTypeOfFinalField(Node node,
-                              Element nodeHolder,
-                              Element field,
-                              ConcreteType type) {
-    augmentFieldType(field, type);
-  }
-
-  @override
-  void recordTypeOfNonFinalField(Spannable node, Element field,
-                                 ConcreteType type) {
-    augmentFieldType(field, type);
-  }
-
-  @override
-  void recordCapturedLocalRead(Local local) {
-    addCapturedLocalReader(local, currentWorkItem.method);
-  }
-
-  @override
-  void recordLocalUpdate(Local local, ConcreteType type) {
-    Set<FunctionElement> localReaders = capturedLocalsReaders[local];
-    if (localReaders != null) {
-      localReaders.forEach(invalidate);
-    }
-  }
-
-  /**
-   * Returns the caller of the current analyzed element, given the alleged
-   * caller provided by SimpleTypeInferrer.
-   *
-   * SimpleTypeInferrer lies about the caller when it's a closure.
-   * Unfortunately we cannot always trust currentWorkItem.method either because
-   * it is wrong for fields initializers.
-   */
-  Element getRealCaller(Element allegedCaller) {
-    Element currentMethod = currentWorkItem.method;
-    if ((currentMethod != allegedCaller)
-        && currentMethod.isFunction
-        && closures.contains(currentMethod)) {
-      return currentMethod;
-    } else {
-      return allegedCaller;
-    }
-  }
-
-  @override
-  ConcreteType registerCalledElement(Spannable node,
-                                     Selector selector,
-                                     TypeMask mask,
-                                     Element caller,
-                                     Element callee,
-                                     ArgumentsTypes<ConcreteType> arguments,
-                                     SideEffects sideEffects,
-                                     bool inLoop) {
-    caller = getRealCaller(caller);
-    if ((selector == null) || (selector.kind == SelectorKind.CALL)) {
-      callee = callee.implementation;
-      if (selector != null && selector.name == 'JS') {
-        return null;
-      }
-      if (callee.isField) {  // toplevel closure call
-        getFieldType(selector, callee);  // trigger toplevel field analysis
-        addFieldReader(callee, caller);
-        ConcreteType result = emptyConcreteType;
-        for (FunctionElement function in closures.functionElements) {
-          addCaller(function, caller);
-          result = result.union(
-              getSendReturnType(selector, function, null, arguments));
-        }
-        return result;
-      } else {  // method or constructor call
-        addCaller(callee, caller);
-        ClassElement receiverClass = null;
-        if (callee.isGenerativeConstructor) {
-          receiverClass = callee.enclosingClass;
-        } else if (node is Send) {
-          Send send = node;
-          if (send.receiver != null) {
-            if (send.receiver.isSuper()) {
-              receiverClass =
-                  currentWorkItem.environment.classOfThis.superclass;
-            } else {
-              receiverClass = currentWorkItem.environment.classOfThis;
-            }
-          }
-        }
-        return getSendReturnType(selector, callee, receiverClass, arguments);
-      }
-    } else if (selector.kind == SelectorKind.GETTER) {
-      if (callee.isField) {
-        addFieldReader(callee, caller);
-        return getFieldType(selector, callee);
-      } else if (callee.isGetter) {
-        Element enclosing = callee.enclosingElement.isCompilationUnit
-            ? null : callee.enclosingElement;
-        addCaller(callee, caller);
-        ArgumentsTypes noArguments = new ArgumentsTypes([], new Map());
-        return getSendReturnType(selector, callee, enclosing, noArguments);
-      } else if (callee.isFunction) {
-        addClosure(callee, null, null);
-        return singletonConcreteType(baseTypes.functionBaseType);
-      }
-    } else if (selector.kind == SelectorKind.SETTER) {
-      ConcreteType argumentType = arguments.positional.first;
-      if (callee.isField) {
-        augmentFieldType(callee, argumentType);
-      } else if (callee.isSetter) {
-        FunctionElement setter = callee;
-        // TODO(polux): A setter always returns void so there's no need to
-        // invalidate its callers even if it is called with new arguments.
-        // However, if we start to record more than returned types, like
-        // exceptions for instance, we need to do it by uncommenting the
-        // following line.
-        // inferrer.addCaller(setter, currentMethod);
-        Element enclosing = callee.enclosingElement.isCompilationUnit
-            ? null : callee.enclosingElement;
-        return getSendReturnType(selector, setter, enclosing,
-            new ArgumentsTypes([argumentType], new Map()));
-      }
-    } else {
-      throw new ArgumentError("unexpected selector kind");
-    }
-    return null;
-  }
-
-  @override
-  ConcreteType registerCalledSelector(Node node,
-                                      Selector selector,
-                                      TypeMask mask,
-                                      ConcreteType receiverType,
-                                      Element caller,
-                                      ArgumentsTypes<ConcreteType> arguments,
-                                      SideEffects sideEffects,
-                                      bool inLoop) {
-    caller = getRealCaller(caller);
-    switch (selector.kind) {
-      case SelectorKind.GETTER:
-        return registerDynamicGetterSend(selector, receiverType, caller);
-      case SelectorKind.SETTER:
-        return registerDynamicSetterSend(
-            selector, receiverType, caller, arguments);
-      default:
-        return registerDynamicSend(selector, receiverType, caller, arguments);
-    }
-  }
-
-  ConcreteType registerDynamicGetterSend(Selector selector,
-                                         ConcreteType receiverType,
-                                         Element caller) {
-    caller = getRealCaller(caller);
-    ConcreteType result = emptyConcreteType;
-
-    void augmentResult(ClassElement baseReceiverType, Element member) {
-      if (member.isField) {
-        addFieldReader(member, caller);
-        result = result.union(getFieldType(selector, member));
-      } else if (member.isGetter) {
-        addCaller(member, caller);
-        ArgumentsTypes noArguments = new ArgumentsTypes([], new Map());
-        result = result.union(
-            getSendReturnType(selector, member, baseReceiverType, noArguments));
-      } else if (member.isFunction) {
-        addClosure(member, receiverType, null);
-        result = result.union(
-            singletonConcreteType(baseTypes.functionBaseType));
-      } else {
-        throw new ArgumentError("unexpected element type");
-      }
-    }
-
-    if (receiverType.isUnknown()) {
-      addDynamicCaller(selector, caller);
-      Set<Element> members = getMembersBySelector(selector);
-      for (Element member in members) {
-        if (!(member.isField || member.isGetter)) continue;
-        for (ClassElement cls in
-            getReflexiveSubtypesOf(member.enclosingElement)) {
-          augmentResult(cls, member);
-        }
-      }
-    } else {
-      for (BaseType baseReceiverType in receiverType.baseTypes) {
-        if (!baseReceiverType.isNull()) {
-          ClassBaseType classBaseType = baseReceiverType;
-          ClassElement cls = classBaseType.element;
-          Element getterOrField = cls.lookupByName(selector.memberName);
-          if (getterOrField != null) {
-            augmentResult(cls, getterOrField.implementation);
-          }
-        }
-      }
-    }
-    return result;
-  }
-
-  ConcreteType registerDynamicSetterSend(
-      Selector selector,
-      ConcreteType receiverType,
-      Element caller,
-      ArgumentsTypes<ConcreteType> arguments) {
-    caller = getRealCaller(caller);
-    ConcreteType argumentType = arguments.positional.first;
-
-    void augmentField(ClassElement receiverType, Element setterOrField) {
-      if (setterOrField.isField) {
-        augmentFieldType(setterOrField, argumentType);
-      } else if (setterOrField.isSetter) {
-        // A setter always returns void so there's no need to invalidate its
-        // callers even if it is called with new arguments. However, if we
-        // start to record more than returned types, like exceptions for
-        // instance, we need to do it by uncommenting the following line.
-        // inferrer.addCaller(setter, currentMethod);
-        getSendReturnType(selector, setterOrField, receiverType,
-            new ArgumentsTypes([argumentType], new Map()));
-      } else {
-        throw new ArgumentError("unexpected element type");
-      }
-    }
-
-    if (receiverType.isUnknown()) {
-      // Same remark as above
-      // addDynamicCaller(selector, caller);
-      for (Element member in getMembersBySelector(selector)) {
-        if (!(member.isField || member.isSetter)) continue;
-        Element cls = member.enclosingClass;
-        augmentField(cls, member);
-      }
-    } else {
-      for (BaseType baseReceiverType in receiverType.baseTypes) {
-        if (!baseReceiverType.isNull()) {
-          ClassBaseType classBaseType = baseReceiverType;
-          ClassElement cls = classBaseType.element;
-          Element setterOrField = cls.lookupByName(selector.memberName);
-          if (setterOrField != null) {
-            augmentField(cls, setterOrField.implementation);
-          }
-        }
-      }
-    }
-    return argumentType;
-  }
-
-  ConcreteType registerDynamicSend(Selector selector,
-                                   ConcreteType receiverType,
-                                   Element caller,
-                                   ArgumentsTypes<ConcreteType> arguments) {
-    caller = getRealCaller(caller);
-    ConcreteType result = emptyConcreteType;
-    if (receiverType.isUnknown()) {
-      addDynamicCaller(selector, caller);
-      Set<Element> elements = getMembersBySelector(selector);
-      for (Element element in elements) {
-        if (element.isFunction) {
-          FunctionElement method = element;
-          addCaller(method, caller);
-          for (ClassElement cls in
-              getReflexiveSubtypesOf(method.enclosingElement)) {
-            result = result.union(
-                getSendReturnType(selector, method, cls, arguments));
-          }
-        } else { // closure call
-          assert(element.isField);
-          for (FunctionElement function in closures.functionElements) {
-            addCaller(function, caller);
-            result = result.union(
-                getSendReturnType(selector, function, null, arguments));
-          }
-        }
-      }
-    } else {
-      for (BaseType baseReceiverType in receiverType.baseTypes) {
-        if (!baseReceiverType.isNull()) {
-          ClassBaseType classBaseReceiverType = baseReceiverType;
-          ClassElement cls = classBaseReceiverType.element;
-          Element method = cls.lookupByName(selector.memberName);
-          if (method != null) {
-            if (method.isFunction) {
-              assert(method is FunctionElement);
-              method = method.implementation;
-              addCaller(method, caller);
-              result = result.union(
-                  getSendReturnType(selector, method, cls, arguments));
-            } else { // closure call
-              for (FunctionElement function in closures.functionElements) {
-                addCaller(function, caller);
-                result = result.union(
-                    getSendReturnType(selector, function, null, arguments));
-              }
-            }
-          }
-        }
-      }
-    }
-    return result;
-  }
-
-  ConcreteType registerAwait(Node node, ConcreteType argumentType) {
-    // TODO(polux): Properly handle await expressions.
-    return types.dynamicType;
-  }
-
-  @override
-  void setDefaultTypeOfParameter(ParameterElement parameter,
-                                 ConcreteType type) {
-    // We handle default parameters our own way in associateArguments
-  }
-
-  /**
-   * TODO(johnniwinther): Remove once synthetic parameters get their own default
-   * values.
-   */
-  bool hasAlreadyComputedTypeOfParameterDefault(Element parameter) => false;
-
-  @override
-  ConcreteType registerCalledClosure(Node node,
-                                     Selector selector,
-                                     TypeMask mask,
-                                     ConcreteType closure,
-                                     Element caller,
-                                     ArgumentsTypes<ConcreteType> arguments,
-                                     SideEffects sideEffects,
-                                     bool inLoop) {
-    caller = getRealCaller(caller);
-    ConcreteType result = emptyConcreteType;
-    for (FunctionElement function in closures.functionElements) {
-      addCaller(function, caller);
-      result = result.union(
-          getSendReturnType(selector, function, null, arguments));
-    }
-    return result;
-  }
-
-  @override
-  ConcreteType returnTypeOfElement(Element element) {
-    // Never called by SimpleTypeInferrer.
-    throw new UnsupportedError("");
-  }
-
-  @override
-  ConcreteType typeOfElement(Element element) {
-    if (currentWorkItem != null) {
-      final result = currentWorkItem.environment.lookupType(element);
-      if (result != null) return result;
-    }
-    if (element.isParameter || element.isInitializingFormal) {
-      return inferredParameterTypes[element];
-    } else if (element.isField) {
-      return inferredFieldTypes[element];
-    }
-    throw new ArgumentError("unexpected element type");
-  }
-
-  @override
-  void analyze(Element element, ArgumentsTypes arguments) {
-    FunctionElement function = element;
-    getSendReturnType(
-        null, function, currentWorkItem.environment.classOfThis, arguments);
-  }
-}
-
-class TypeInferrerVisitor extends SimpleTypeInferrerVisitor<ConcreteType> {
-  final ConcreteType thisType;
-  ConcreteTypesInferrer get inferrer => super.inferrer;
-
-  TypeInferrerVisitor(Element element,
-                      ConcreteTypesInferrer inferrer,
-                      this.thisType,
-                      Map<Element, ConcreteType> environment,
-                      [LocalsHandler<ConcreteType> handler])
-      : super(element, inferrer.compiler, inferrer, handler);
-
-  @override
-  ConcreteType visitFunctionExpression(FunctionExpression node) {
-    Element element = elements[node];
-    // visitFunctionExpression should be only called for closures
-    assert(element != analyzedElement);
-    inferrer.addClosure(
-        element, thisType, new LocalsHandler.deepCopyOf(locals));
-    return types.functionType;
-  }
-
-  @override
-  ConcreteType visitLiteralString(LiteralString node) {
-    // TODO(polux): get rid of this hack once we have a natural way of inferring
-    // the unknown type.
-    if (inferrer.testMode
-        && (node.dartString.slowToString() == "__dynamic_for_test")) {
-      return inferrer.unknownConcreteType;
-    }
-    return super.visitLiteralString(node);
-  }
-
-  /**
-   * Same as super.visitLiteralList except it doesn't cache anything.
-   */
-  @override
-  ConcreteType visitLiteralList(LiteralList node) {
-    ConcreteType elementType;
-    int length = 0;
-    for (Node element in node.elements.nodes) {
-      ConcreteType type = visit(element);
-      elementType = elementType == null
-          ? types.allocatePhi(null, null, type)
-          : types.addPhiInput(null, elementType, type);
-      length++;
-    }
-    elementType = elementType == null
-        ? types.nonNullEmpty()
-        : types.simplifyPhi(null, null, elementType);
-    ConcreteType containerType = node.isConst
-        ? types.constListType
-        : types.growableListType;
-    return types.allocateList(
-        containerType,
-        node,
-        outermostElement,
-        elementType,
-        length);
-  }
-
-  /**
-   * Same as super.handleLocalGet except it records the type of nodes in test
-   * mode.
-   */
-  @override
-  ConcreteType handleLocalGet(Send node, LocalElement local) {
-    if (inferrer.testMode) {
-      ConcreteType type = locals.use(local);
-      if (type != null) {
-        inferrer.augmentInferredType(node, type);
-      }
-    }
-    return super.handleLocalGet(node, local);
-  }
-}
diff --git a/pkg/compiler/lib/src/inferrer/inferrer_visitor.dart b/pkg/compiler/lib/src/inferrer/inferrer_visitor.dart
index e4725b2..7daed4e 100644
--- a/pkg/compiler/lib/src/inferrer/inferrer_visitor.dart
+++ b/pkg/compiler/lib/src/inferrer/inferrer_visitor.dart
@@ -4,18 +4,34 @@
 
 library inferrer_visitor;
 
+import 'dart:collection' show
+    IterableMixin;
+
+import '../common.dart';
+import '../compiler.dart' show
+    Compiler;
 import '../constants/constant_system.dart';
 import '../constants/expressions.dart';
-import '../dart2jslib.dart' hide Selector, TypedSelector;
 import '../dart_types.dart';
 import '../elements/elements.dart';
 import '../resolution/operators.dart';
+import '../resolution/semantic_visitor.dart';
+import '../resolution/send_resolver.dart' show
+    SendResolverMixin;
+import '../resolution/tree_elements.dart' show
+    TreeElements;
 import '../tree/tree.dart';
-import '../universe/universe.dart';
+import '../types/types.dart' show
+    TypeMask;
+import '../types/constants.dart' show
+    computeTypeMask;
+import '../universe/call_structure.dart' show
+    CallStructure;
+import '../universe/selector.dart' show
+    Selector;
 import '../util/util.dart';
-import '../types/types.dart' show TypeMask;
-import '../types/constants.dart' show computeTypeMask;
-import 'dart:collection' show IterableMixin;
+import '../world.dart' show
+    ClassWorld;
 
 /**
  * The interface [InferrerVisitor] will use when working on types.
@@ -41,6 +57,7 @@
   T get typeType;
 
   T stringLiteralType(DartString value);
+  T boolLiteralType(LiteralBool value);
 
   T nonNullSubtype(ClassElement type);
   T nonNullSubclass(ClassElement type);
@@ -673,8 +690,18 @@
   }
 }
 
-abstract class InferrerVisitor
-    <T, E extends MinimalInferrerEngine<T>> extends NewResolvedVisitor<T> {
+abstract class InferrerVisitor<T, E extends MinimalInferrerEngine<T>>
+    extends Visitor<T>
+    with SendResolverMixin,
+         SemanticSendResolvedMixin<T, dynamic>,
+         CompoundBulkMixin<T, dynamic>,
+         SetIfNullBulkMixin<T, dynamic>,
+         PrefixBulkMixin<T, dynamic>,
+         PostfixBulkMixin<T, dynamic>,
+         ErrorBulkMixin<T, dynamic>,
+         NewBulkMixin<T, dynamic>,
+         SetBulkMixin<T, dynamic>
+    implements SemanticSendVisitor<T, dynamic> {
   final Compiler compiler;
   final AstElement analyzedElement;
   final TypeSystem<T> types;
@@ -685,6 +712,7 @@
       new Map<JumpTarget, List<LocalsHandler<T>>>();
   LocalsHandler<T> locals;
   final List<T> cascadeReceiverStack = new List<T>();
+  final TreeElements elements;
 
   bool accumulateIsChecks = false;
   bool conditionIsSimple = false;
@@ -710,7 +738,7 @@
                   [LocalsHandler<T> handler])
     : this.analyzedElement = analyzedElement,
       this.locals = handler,
-      super(analyzedElement.resolvedAst.elements) {
+      this.elements = analyzedElement.resolvedAst.elements {
     if (handler != null) return;
     Node node = analyzedElement.node;
     FieldInitializationScope<T> fieldScope =
@@ -720,10 +748,26 @@
     locals = new LocalsHandler<T>(inferrer, types, compiler, node, fieldScope);
   }
 
+  DiagnosticReporter get reporter => compiler.reporter;
+
+  @override
+  SemanticSendVisitor get sendVisitor => this;
+
+  @override
+  T apply(Node node, _) => visit(node);
+
   T handleSendSet(SendSet node);
 
   T handleDynamicInvoke(Send node);
 
+  T visitAssert(Assert node) {
+    // Avoid pollution from assert statement unless enabled.
+    if (compiler.enableUserAssertions) {
+      super.visitAssert(node);
+    }
+    return null;
+  }
+
   T visitAsyncForIn(AsyncForIn node);
 
   T visitSyncForIn(SyncForIn node);
@@ -733,15 +777,34 @@
   T visitFunctionExpression(FunctionExpression node);
 
   @override
-  T visitAssert(Send node, Node expression, _) {
-    if (!compiler.enableUserAssertions) {
-      return types.nullType;
-    }
-    return handleAssert(node, expression);
+  T bulkHandleSet(SendSet node, _) {
+    return handleSendSet(node);
   }
 
-  /// Handle an enabled assertion of [expression].
-  T handleAssert(Send node, Node expression);
+  @override
+  T bulkHandleCompound(SendSet node, _) {
+    return handleSendSet(node);
+  }
+
+  @override
+  T bulkHandleSetIfNull(SendSet node, _) {
+    return handleSendSet(node);
+  }
+
+  @override
+  T bulkHandlePrefix(SendSet node, _) {
+    return handleSendSet(node);
+  }
+
+  @override
+  T bulkHandlePostfix(SendSet node, _) {
+    return handleSendSet(node);
+  }
+
+  @override
+  T bulkHandleError(Node node, ErroneousElement error, _) {
+    return types.dynamicType;
+  }
 
   T visitNode(Node node) {
     return node.visitChildren(this);
@@ -771,7 +834,7 @@
   }
 
   T visitLiteralBool(LiteralBool node) {
-    return types.boolType;
+    return types.boolLiteralType(node);
   }
 
   T visitLiteralDouble(LiteralDouble node) {
@@ -811,11 +874,6 @@
     return types.nonNullSubtype(compiler.symbolClass);
   }
 
-  T visitTypePrefixSend(Send node) {
-    // TODO(johnniwinther): Remove the need for handling this node.
-    return types.dynamicType;
-  }
-
   @override
   void previsitDeferredAccess(Send node, PrefixElement prefix, _) {
     // Deferred access does not affect inference.
@@ -829,6 +887,30 @@
     return types.dynamicType;
   }
 
+
+  @override
+  T bulkHandleNode(Node node, String message, _) {
+    return internalError(node, message.replaceAll('#', '$node'));
+  }
+
+  @override
+  T visitConstantGet(
+      Send node,
+      ConstantExpression constant,
+      _) {
+    return bulkHandleNode(node, "Constant read `#` unhandled.", _);
+  }
+
+  @override
+  T visitConstantInvoke(
+      Send node,
+      ConstantExpression constant,
+      NodeList arguments,
+      CallStructure callStructure,
+      _) {
+    return bulkHandleNode(node, "Constant invoke `#` unhandled.", _);
+  }
+
   T visitClassTypeLiteralGet(
       Send node,
       ConstantExpression constant,
@@ -918,6 +1000,11 @@
         outermostElement.enclosingClass.superclass);
   }
 
+  @override
+  T visitThisGet(Identifier node, _) {
+    return thisType;
+  }
+
   T visitIdentifier(Identifier node) {
     if (node.isThis()) {
       return thisType;
@@ -1169,7 +1256,7 @@
         locals.update(elements[definition], types.nullType, node);
       } else {
         assert(definition.asSendSet() != null);
-        visit(definition);
+        handleSendSet(definition);
       }
     }
     return null;
@@ -1377,7 +1464,7 @@
   }
 
   internalError(Spannable node, String reason) {
-    compiler.internalError(node, reason);
+    reporter.internalError(node, reason);
   }
 
   T visitSwitchStatement(SwitchStatement node) {
diff --git a/pkg/compiler/lib/src/inferrer/node_tracer.dart b/pkg/compiler/lib/src/inferrer/node_tracer.dart
index 4bd3b4c..371adb5 100644
--- a/pkg/compiler/lib/src/inferrer/node_tracer.dart
+++ b/pkg/compiler/lib/src/inferrer/node_tracer.dart
@@ -179,6 +179,8 @@
 
   void visitStringLiteralTypeInformation(StringLiteralTypeInformation info) {}
 
+  void visitBoolLiteralTypeInformation(BoolLiteralTypeInformation info) {}
+
   void visitClosureTypeInformation(ClosureTypeInformation info) {}
 
   void visitClosureCallSiteTypeInformation(
@@ -355,7 +357,7 @@
     /// return false. Instead we catch that case here for now.
     // TODO(herhut): Handle creation of closures from instances of Function.
     if (element.isInstanceMember &&
-        element.name == Compiler.CALL_OPERATOR_NAME) {
+        element.name == Identifiers.call) {
       return true;
     }
     Element outermost = element.outermostEnclosingMemberOrTopLevel;
diff --git a/pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart b/pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart
index c54bebd..5e817af 100644
--- a/pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart
+++ b/pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart
@@ -4,28 +4,49 @@
 
 library simple_types_inferrer;
 
-import '../closure.dart' show ClosureClassMap, ClosureScope;
-import '../constants/values.dart' show ConstantValue, IntConstantValue;
-import '../cps_ir/cps_ir_nodes.dart' as cps_ir show Node;
-import '../dart_types.dart'
-    show DartType, InterfaceType, FunctionType, TypeKind;
+import '../closure.dart' show
+    ClosureClassMap,
+    ClosureScope;
+import '../common.dart';
+import '../common/names.dart' show
+    Selectors;
+import '../compiler.dart' show
+    Compiler;
+import '../constants/values.dart' show
+    ConstantValue,
+    IntConstantValue;
+import '../cps_ir/cps_ir_nodes.dart' as cps_ir show
+    Node;
+import '../dart_types.dart' show
+    DartType,
+    FunctionType,
+    InterfaceType,
+    TypeKind;
 import '../elements/elements.dart';
 import '../js_backend/js_backend.dart' as js;
 import '../native/native.dart' as native;
+import '../resolution/tree_elements.dart' show
+    TreeElements;
 import '../resolution/operators.dart' as op;
 import '../tree/tree.dart' as ast;
-import '../types/types.dart'
-    show TypesInferrer, FlatTypeMask, TypeMask, ContainerTypeMask,
-         ElementTypeMask, ValueTypeMask, TypeSystem, MinimalInferrerEngine;
-import '../util/util.dart' show Link, Spannable, Setlet;
-import 'inferrer_visitor.dart';
+import '../types/types.dart' show
+    TypesInferrer,
+    FlatTypeMask,
+    TypeMask,
+    ContainerTypeMask,
+    ValueTypeMask;
+import '../util/util.dart' show
+    Link,
+    Setlet;
+import '../universe/call_structure.dart' show
+    CallStructure;
+import '../universe/selector.dart' show
+    Selector;
+import '../universe/side_effects.dart' show
+    SideEffects;
+import '../world.dart' show ClassWorld;
 
-// BUG(8802): There's a bug in the analyzer that makes the re-export
-// of Selector from dart2jslib.dart fail. For now, we work around that
-// by importing universe.dart explicitly and disabling the re-export.
-import '../dart2jslib.dart' hide Selector, TypedSelector;
-import '../universe/universe.dart'
-    show Selector, SideEffects, TypedSelector, CallStructure;
+import 'inferrer_visitor.dart';
 
 /**
  * An implementation of [TypeSystem] for [TypeMask].
@@ -99,6 +120,7 @@
   bool isNull(TypeMask mask) => mask.isEmpty && mask.isNullable;
 
   TypeMask stringLiteralType(ast.DartString value) => stringType;
+  TypeMask boolLiteralType(ast.LiteralBool value) => boolType;
 
   TypeMask nonNullSubtype(ClassElement type)
       => new TypeMask.nonNullSubtype(type.declaration, classWorld);
@@ -371,9 +393,11 @@
         mappedType = types.stringType;
       } else if (type.element == compiler.intClass) {
         mappedType = types.intType;
-      } else if (type.element == compiler.doubleClass) {
-        mappedType = types.doubleType;
-      } else if (type.element == compiler.numClass) {
+      } else if (type.element == compiler.numClass ||
+                 type.element == compiler.doubleClass) {
+        // Note: the backend double class is specifically for non-integer
+        // doubles, and a native behavior returning 'double' does not guarantee
+        // a non-integer return type, so we return the number type for those.
         mappedType = types.numType;
       } else if (type.element == compiler.boolClass) {
         mappedType = types.boolType;
@@ -415,12 +439,12 @@
       elements.setTypeMask(node, mask);
     } else {
       assert(astNode.asForIn() != null);
-      if (selector == compiler.iteratorSelector) {
+      if (selector == Selectors.iterator) {
         elements.setIteratorTypeMask(node, mask);
-      } else if (selector == compiler.currentSelector) {
+      } else if (selector == Selectors.current) {
         elements.setCurrentTypeMask(node, mask);
       } else {
-        assert(selector == compiler.moveNextSelector);
+        assert(selector == Selectors.moveNext);
         elements.setMoveNextTypeMask(node, mask);
       }
     }
@@ -567,7 +591,17 @@
         synthesizeForwardingCall(spannable, constructor.definingConstructor);
       } else {
         visitingInitializers = true;
-        visit(node.initializers);
+        if (node.initializers != null) {
+          for (ast.Node initializer in node.initializers) {
+            ast.SendSet fieldInitializer = initializer.asSendSet();
+            if (fieldInitializer != null) {
+              handleSendSet(fieldInitializer);
+            } else {
+              Element element = elements[initializer];
+              handleConstructorSend(initializer, element);
+            }
+          }
+        }
         visitingInitializers = false;
         // For a generative constructor like: `Foo();`, we synthesize
         // a call to the default super constructor (the one that takes
@@ -815,7 +849,13 @@
         isCallOnThis = true;
       }
     } else {
-      receiverType = visit(node.receiver);
+      if (node.receiver != null) {
+        Element receiver = elements[node.receiver];
+        if (receiver is! PrefixElement && receiver is! ClassElement) {
+          // TODO(johnniwinther): Avoid blindly recursing on the receiver.
+          receiverType = visit(node.receiver);
+        }
+      }
       isCallOnThis = isThisOrSuper(node.receiver);
     }
 
@@ -1322,20 +1362,6 @@
         node, selector, mask, element, null);
   }
 
-  /// Handle super constructor invocation.
-  @override
-  T handleSuperConstructorInvoke(ast.Send node) {
-    Element element = elements[node];
-    ArgumentsTypes arguments = analyzeArguments(node.arguments);
-    assert(visitingInitializers);
-    seenSuperConstructorCall = true;
-    analyzeSuperConstructorCall(element, arguments);
-    Selector selector = elements.getSelector(node);
-    TypeMask mask = elements.getTypeMask(node);
-    return handleStaticSend(
-        node, selector, mask, element, arguments);
-  }
-
   @override
   T visitUnresolvedSuperIndex(
       ast.Send node,
@@ -1446,6 +1472,16 @@
   }
 
   @override
+  T visitSuperSetterInvoke(
+      ast.Send node,
+      FunctionElement setter,
+      ast.NodeList arguments,
+      CallStructure callStructure,
+      _) {
+    return handleErroneousSuperSend(node);
+  }
+
+  @override
   T visitSuperIndex(
       ast.Send node,
       MethodElement method,
@@ -1535,20 +1571,6 @@
   }
 
   @override
-  T handleAssert(ast.Send node, ast.Node expression) {
-    js.JavaScriptBackend backend = compiler.backend;
-    Element element = backend.assertMethod;
-    ArgumentsTypes<T> arguments =
-        new ArgumentsTypes<T>(<T>[expression.accept(this)], null);
-    return handleStaticSend(
-        node,
-        new Selector.fromElement(element),
-        null,
-        element,
-        arguments);
-  }
-
-  @override
   T handleTypeLiteralInvoke(ast.NodeList arguments) {
     // This is reached when users forget to put a `new` in front of a type
     // literal. The emitter will generate an actual call (even though it is
@@ -1558,12 +1580,6 @@
     return super.handleTypeLiteralInvoke(arguments);
   }
 
-  T visitStaticSend(ast.Send node) {
-    assert(!elements.isAssert(node));
-    Element element = elements[node];
-    return handleConstructorSend(node, element);
-  }
-
   /// Handle constructor invocation of [element].
   T handleConstructorSend(ast.Send node, ConstructorElement element) {
     ArgumentsTypes arguments = analyzeArguments(node.arguments);
@@ -1634,8 +1650,21 @@
     }
   }
 
-  T handleNewExpression(ast.NewExpression node) {
-    return visitStaticSend(node.send);
+  @override
+  T bulkHandleNew(ast.NewExpression node, _) {
+    Element element = elements[node.send];
+    return handleConstructorSend(node.send, element);
+  }
+
+  @override
+  T errorNonConstantConstructorInvoke(
+      ast.NewExpression node,
+      Element element,
+      DartType type,
+      ast.NodeList arguments,
+      CallStructure callStructure,
+      _) {
+    return bulkHandleNew(node, _);
   }
 
   /// Handle invocation of a top level or static field or getter [element].
@@ -1815,15 +1844,6 @@
     return new ArgumentsTypes<T>(positional, named);
   }
 
-  T visitGetterSend(ast.Send node) {
-    if (elements[node] is! PrefixElement) {
-      // TODO(johnniwinther): Remove this when no longer called from
-      // [handleSendSet].
-      internalError(node, "Unexpected visitGetterSend");
-    }
-    return null;
-  }
-
   /// Read a local variable, function or parameter.
   T handleLocalGet(ast.Send node, LocalElement local) {
     assert(locals.use(local) != null);
@@ -1855,7 +1875,7 @@
   T visitDynamicPropertyGet(
       ast.Send node,
       ast.Node receiver,
-      Selector selector,
+      Name name,
       _) {
     return handleDynamicGet(node);
   }
@@ -1864,7 +1884,7 @@
   T visitIfNotNullDynamicPropertyGet(
       ast.Send node,
       ast.Node receiver,
-      Selector selector,
+      Name name,
       _) {
     return handleDynamicGet(node);
   }
@@ -1920,7 +1940,7 @@
   @override
   T visitThisPropertyGet(
       ast.Send node,
-      Selector selector,
+      Name name,
       _) {
     return handleDynamicGet(node);
   }
@@ -1988,7 +2008,7 @@
       ast.Send node,
       ast.Node expression,
       ast.NodeList arguments,
-      Selector selector,
+      CallStructure callStructure,
       _) {
     return handleCallInvoke(node, expression.accept(this));
    }
@@ -2262,7 +2282,7 @@
     TypeMask moveNextMask = elements.getMoveNextTypeMask(node);
 
     js.JavaScriptBackend backend = compiler.backend;
-    Element ctor = backend.getStreamIteratorConstructor();
+    Element ctor = backend.helpers.streamIteratorConstructor;
 
     /// Synthesize a call to the [StreamIterator] constructor.
     T iteratorType = handleStaticSend(node, null, null, ctor,
diff --git a/pkg/compiler/lib/src/inferrer/type_graph_inferrer.dart b/pkg/compiler/lib/src/inferrer/type_graph_inferrer.dart
index 506985e..86551cb 100644
--- a/pkg/compiler/lib/src/inferrer/type_graph_inferrer.dart
+++ b/pkg/compiler/lib/src/inferrer/type_graph_inferrer.dart
@@ -4,53 +4,62 @@
 
 library type_graph_inferrer;
 
-import 'dart:collection' show Queue, IterableBase;
+import 'dart:collection' show
+    IterableBase,
+    Queue;
 
+import '../common.dart';
+import '../common/names.dart' show
+    Identifiers,
+    Names;
+import '../compiler.dart' show
+    Compiler;
 import '../constants/values.dart';
-import '../cps_ir/cps_ir_nodes.dart' as cps_ir
-    show Node;
-import '../dart_types.dart'
-    show DartType,
-         FunctionType,
-         InterfaceType,
-         TypeKind;
-import '../dart2jslib.dart'
-    show ClassWorld,
-         Compiler,
-         Constant,
-         FunctionConstant,
-         invariant,
-         TreeElementMapping;
+import '../cps_ir/cps_ir_nodes.dart' as cps_ir show
+    Node;
+import '../dart_types.dart' show
+    DartType,
+    FunctionType,
+    InterfaceType,
+    TypeKind;
 import '../elements/elements.dart';
+import '../js_backend/js_backend.dart' show
+    Annotations,
+    JavaScriptBackend;
 import '../native/native.dart' as native;
-import '../tree/tree.dart' as ast
-    show DartString,
-         Node,
-         Send,
-         SendSet,
-         TryStatement;
-import '../types/types.dart'
-    show ContainerTypeMask,
-         DictionaryTypeMask,
-         MapTypeMask,
-         TypeMask,
-         TypesInferrer,
-         ValueTypeMask;
-import '../types/constants.dart'
-    show computeTypeMask;
-import '../universe/universe.dart'
-    show Selector,
-         SideEffects,
-         TypedSelector;
-import '../util/util.dart'
-    show ImmutableEmptySet,
-         Setlet,
-         Spannable;
-import '../js_backend/js_backend.dart' show Annotations, JavaScriptBackend;
+import '../resolution/tree_elements.dart' show
+    TreeElementMapping;
+import '../tree/tree.dart' as ast show
+    DartString,
+    Node,
+    LiteralBool,
+    Send,
+    SendSet,
+    TryStatement;
+import '../types/types.dart' show
+    ContainerTypeMask,
+    DictionaryTypeMask,
+    MapTypeMask,
+    TypeMask,
+    TypesInferrer,
+    ValueTypeMask;
+import '../types/constants.dart' show
+    computeTypeMask;
+import '../universe/call_structure.dart' show
+    CallStructure;
+import '../universe/selector.dart' show
+    Selector;
+import '../universe/side_effects.dart' show
+    SideEffects;
+import '../util/util.dart' show
+    ImmutableEmptySet,
+    Setlet;
+import '../world.dart' show
+    ClassWorld;
 
-import 'inferrer_visitor.dart'
-    show ArgumentsTypes,
-         TypeSystem;
+import 'inferrer_visitor.dart' show
+    ArgumentsTypes,
+    TypeSystem;
 import 'simple_types_inferrer.dart';
 
 part 'closure_tracer.dart';
@@ -231,6 +240,10 @@
         value, compiler.typesTask.stringType);
   }
 
+  TypeInformation boolLiteralType(ast.LiteralBool value) {
+    return new BoolLiteralTypeInformation(value, compiler.typesTask.boolType);
+  }
+
   TypeInformation computeLUB(TypeInformation firstType,
                              TypeInformation secondType) {
     if (firstType == null) return secondType;
@@ -572,6 +585,7 @@
 
   JavaScriptBackend get backend => compiler.backend;
   Annotations get annotations => backend.annotations;
+  DiagnosticReporter get reporter => compiler.reporter;
 
   /**
    * A set of selector names that [List] implements, that we know return
@@ -579,14 +593,14 @@
    */
   final Set<Selector> _returnsListElementTypeSet = new Set<Selector>.from(
     <Selector>[
-      new Selector.getter('first', null),
-      new Selector.getter('last', null),
-      new Selector.getter('single', null),
-      new Selector.call('singleWhere', null, 1),
-      new Selector.call('elementAt', null, 1),
+      new Selector.getter(const PublicName('first')),
+      new Selector.getter(const PublicName('last')),
+      new Selector.getter(const PublicName('single')),
+      new Selector.call(const PublicName('singleWhere'), CallStructure.ONE_ARG),
+      new Selector.call(const PublicName('elementAt'), CallStructure.ONE_ARG),
       new Selector.index(),
-      new Selector.call('removeAt', null, 1),
-      new Selector.call('removeLast', null, 0)
+      new Selector.call(const PublicName('removeAt'), CallStructure.ONE_ARG),
+      new Selector.call(const PublicName('removeLast'), CallStructure.NO_ARGS)
     ]);
 
   bool returnsListElementType(Selector selector, TypeMask mask) {
@@ -652,15 +666,16 @@
       compiler.progress.reset();
     }
     sortResolvedElements().forEach((Element element) {
+      assert(compiler.enqueuer.resolution.hasBeenProcessed(element));
       if (compiler.shouldPrintProgress) {
-        compiler.log('Added $addedInGraph elements in inferencing graph.');
+        reporter.log('Added $addedInGraph elements in inferencing graph.');
         compiler.progress.reset();
       }
       // This also forces the creation of the [ElementTypeInformation] to ensure
       // it is in the graph.
       types.withMember(element, () => analyze(element, null));
     });
-    compiler.log('Added $addedInGraph elements in inferencing graph.');
+    reporter.log('Added $addedInGraph elements in inferencing graph.');
 
     buildWorkQueue();
     refine();
@@ -680,6 +695,7 @@
 
     // Trace closures to potentially infer argument types.
     types.allocatedClosures.forEach((info) {
+
       void trace(Iterable<FunctionElement> elements,
                  ClosureTracerVisitor tracer) {
         tracer.run();
@@ -713,16 +729,31 @@
           }
         });
       }
+
       if (info is ClosureTypeInformation) {
         Iterable<FunctionElement> elements = [info.element];
         trace(elements, new ClosureTracerVisitor(elements, info, this));
       } else if (info is CallSiteTypeInformation) {
-        // We only are interested in functions here, as other targets
-        // of this closure call are not a root to trace but an intermediate
-        // for some other function.
-        Iterable<FunctionElement> elements = info.callees
-            .where((e) => e.isFunction);
-        trace(elements, new ClosureTracerVisitor(elements, info, this));
+        if (info is StaticCallSiteTypeInformation &&
+            info.selector != null &&
+            info.selector.isCall) {
+          // This is a constructor call to a class with a call method. So we
+          // need to trace the call method here.
+          assert(info.calledElement.isConstructor);
+          ClassElement cls = info.calledElement.enclosingClass;
+          FunctionElement callMethod = cls.lookupMember(Identifiers.call);
+          assert(invariant(cls, callMethod != null));
+          Iterable<FunctionElement> elements = [callMethod];
+          trace(elements, new ClosureTracerVisitor(elements, info, this));
+        } else {
+          // We only are interested in functions here, as other targets
+          // of this closure call are not a root to trace but an intermediate
+          // for some other function.
+          Iterable<FunctionElement> elements =
+              new List<FunctionElement>.from(
+                  info.callees.where((e) => e.isFunction));
+          trace(elements, new ClosureTracerVisitor(elements, info, this));
+        }
       } else {
         assert(info is ElementTypeInformation);
         trace([info.element],
@@ -774,6 +805,10 @@
               print('${types.getInferredTypeOf(target).type} for ${target}');
             }
           }
+        } else if (info is StaticCallSiteTypeInformation) {
+          ClassElement cls = info.calledElement.enclosingClass;
+          FunctionElement callMethod = cls.lookupMember(Identifiers.call);
+          print('${types.getInferredSignatureOf(callMethod)} for ${cls}');
         } else {
           print('${info.type} for some unknown kind of closure');
         }
@@ -784,7 +819,7 @@
       });
     }
 
-    compiler.log('Inferred $overallRefineCount types.');
+    reporter.log('Inferred $overallRefineCount types.');
 
     processLoopInformation();
   }
@@ -797,7 +832,7 @@
     SimpleTypeInferrerVisitor visitor =
         new SimpleTypeInferrerVisitor(element, compiler, this);
     TypeInformation type;
-    compiler.withCurrentElement(element, () {
+    reporter.withCurrentElement(element, () {
       type = visitor.run();
     });
     addedInGraph++;
@@ -877,7 +912,7 @@
   void refine() {
     while (!workQueue.isEmpty) {
       if (compiler.shouldPrintProgress) {
-        compiler.log('Inferred $overallRefineCount types.');
+        reporter.log('Inferred $overallRefineCount types.');
         compiler.progress.reset();
       }
       TypeInformation info = workQueue.remove();
@@ -923,7 +958,7 @@
                                   Selector selector,
                                   TypeMask mask,
                                   {bool remove, bool addToQueue: true}) {
-    if (callee.name == Compiler.NO_SUCH_METHOD) return;
+    if (callee.name == Identifiers.noSuchMethod_) return;
     if (callee.isField) {
       if (selector.isSetter) {
         ElementTypeInformation info = types.getInferredTypeOf(callee);
@@ -1006,16 +1041,16 @@
       if (parameter.functionDeclaration.isInstanceMember) {
         ParameterAssignments assignments = info.assignments;
         assignments.replace(existing, type);
-        type.addUser(info);
       } else {
         List<TypeInformation> assignments = info.assignments;
         for (int i = 0; i < assignments.length; i++) {
           if (assignments[i] == existing) {
             assignments[i] = type;
-            type.addUser(info);
           }
         }
       }
+      // Also forward all users.
+      type.addUsersOf(existing);
     } else {
       assert(existing == null);
     }
@@ -1108,6 +1143,14 @@
     CallSiteTypeInformation info = new StaticCallSiteTypeInformation(
           types.currentMember, node, caller, callee, selector, mask, arguments,
           inLoop);
+    // If this class has a 'call' method then we have essentially created a
+    // closure here. Register it as such so that it is traced.
+    if (selector != null && selector.isCall && callee.isConstructor) {
+      ClassElement cls = callee.enclosingClass.declaration;
+      if (cls.callType != null) {
+        types.allocatedClosures.add(info);
+      }
+    }
     info.addToGraph(this);
     allocatedCalls.add(info);
     updateSideEffects(sideEffects, selector, callee);
@@ -1173,10 +1216,10 @@
   Iterable<Element> sortResolvedElements() {
     int max = 0;
     Map<int, Setlet<Element>> methodSizes = new Map<int, Setlet<Element>>();
-    compiler.enqueuer.resolution.resolvedElements.forEach((AstElement element) {
+    compiler.enqueuer.resolution.processedElements.forEach((AstElement element) {
         // TODO(ngeoffray): Not sure why the resolver would put a null
         // mapping.
-        if (!compiler.enqueuer.resolution.hasBeenResolved(element)) return;
+        if (!compiler.enqueuer.resolution.hasBeenProcessed(element)) return;
         TreeElementMapping mapping = element.resolvedAst.elements;
         element = element.implementation;
         if (element.impliesType) return;
@@ -1230,7 +1273,7 @@
    */
   TypeInformation typeOfElementWithSelector(Element element,
                                             Selector selector) {
-    if (element.name == Compiler.NO_SUCH_METHOD &&
+    if (element.name == Identifiers.noSuchMethod_ &&
         selector.name != element.name) {
       // An invocation can resolve to a [noSuchMethod], in which case
       // we get the return type of [noSuchMethod].
diff --git a/pkg/compiler/lib/src/inferrer/type_graph_nodes.dart b/pkg/compiler/lib/src/inferrer/type_graph_nodes.dart
index 51c39f5..dd50651 100644
--- a/pkg/compiler/lib/src/inferrer/type_graph_nodes.dart
+++ b/pkg/compiler/lib/src/inferrer/type_graph_nodes.dart
@@ -88,6 +88,10 @@
     users.add(user);
   }
 
+  void addUsersOf(TypeInformation other) {
+    users.addAll(other.users);
+  }
+
   void removeUser(TypeInformation user) {
     assert(!user.isConcrete);
     users.remove(user);
@@ -411,7 +415,8 @@
       } else {
         assert(element.isFunction ||
                element.isGetter ||
-               element.isSetter);
+               element.isSetter ||
+               element.isConstructor);
         TypedElement typedElement = element;
         var elementType = typedElement.type;
         if (elementType.kind != TypeKind.FUNCTION) {
@@ -524,6 +529,10 @@
   void tagAsTearOffClosureParameter(TypeGraphInferrerEngine inferrer) {
     assert(element.isParameter);
     isTearOffClosureParameter = true;
+    // We have to add a flow-edge for the default value (if it exists), as we
+    // might not see all call-sites and thus miss the use of it.
+    TypeInformation defaultType = inferrer.getDefaultTypeOfParameter(element);
+    if (defaultType != null) defaultType.addUser(this);
   }
 
   // TODO(herhut): Cleanup into one conditional.
@@ -540,8 +549,7 @@
     // initializing formals.
     if (element.isInitializingFormal) return null;
 
-    FunctionElement function = element.functionDeclaration;
-    if ((isTearOffClosureParameter || function.isLocal) &&
+    if ((isTearOffClosureParameter || declaration.isLocal) &&
         disableInferenceForClosures) {
       // Do not infer types for parameters of closures. We do not
       // clear the assignments in case the closure is successfully
@@ -549,16 +557,20 @@
       giveUp(inferrer, clearAssignments: false);
       return safeType(inferrer);
     }
-    if (function.isInstanceMember &&
-        (function.name == Compiler.NO_SUCH_METHOD ||
-        (function.name == Compiler.CALL_OPERATOR_NAME &&
+    if (declaration.isInstanceMember &&
+        (declaration.name == Identifiers.noSuchMethod_ ||
+        (declaration.name == Identifiers.call &&
          disableInferenceForClosures))) {
       // Do not infer types for parameters of [noSuchMethod] and
       // [call] instance methods.
       giveUp(inferrer);
       return safeType(inferrer);
     }
-    if (function == inferrer.mainElement) {
+    if (inferrer.compiler.world.getMightBePassedToApply(declaration)) {
+      giveUp(inferrer);
+      return safeType(inferrer);
+    }
+    if (declaration == inferrer.mainElement) {
       // The implicit call to main is not seen by the inferrer,
       // therefore we explicitly set the type of its parameters as
       // dynamic.
@@ -767,7 +779,7 @@
     return targets.any((Element e) {
       return e is FunctionElement &&
              e.isInstanceMember &&
-             e.name == Compiler.NO_SUCH_METHOD &&
+             e.name == Identifiers.noSuchMethod_ &&
              inferrer.backend.isComplexNoSuchMethod(e);
     });
   }
@@ -917,10 +929,11 @@
         return containerTypeMask.elementType;
       } else if (inferrer.returnsMapValueType(selector, typeMask)) {
         if (typeMask.isDictionary &&
-            arguments.positional[0].type.isValue) {
+            arguments.positional[0].type.isValue &&
+            arguments.positional[0].type.value.isString) {
           DictionaryTypeMask dictionaryTypeMask = typeMask;
           ValueTypeMask arg = arguments.positional[0].type;
-          String key = arg.value;
+          String key = arg.value.primitiveValue.slowToString();
           if (dictionaryTypeMask.typeMap.containsKey(key)) {
             if (_VERBOSE) {
               print("Dictionary lookup for $key yields "
@@ -1070,6 +1083,11 @@
     // needs to notify its users.
   }
 
+  void addUsersOf(TypeInformation other) {
+    // Nothing to do, a concrete type does not get updated so never
+    // needs to notify its users.
+  }
+
   void removeUser(TypeInformation user) {
   }
 
@@ -1100,7 +1118,7 @@
   final ast.DartString value;
 
   StringLiteralTypeInformation(value, TypeMask mask)
-      : super(new ValueTypeMask(mask, value.slowToString())),
+      : super(new ValueTypeMask(mask, new StringConstantValue(value))),
         this.value = value;
 
   String asString() => value.slowToString();
@@ -1111,6 +1129,21 @@
   }
 }
 
+class BoolLiteralTypeInformation extends ConcreteTypeInformation {
+  final ast.LiteralBool value;
+
+  BoolLiteralTypeInformation(value, TypeMask mask)
+      : super(new ValueTypeMask(mask,
+            value.value ? new TrueConstantValue() : new FalseConstantValue())),
+        this.value = value;
+
+  String toString() => 'Type $type value ${value.value}';
+
+  accept(TypeInformationVisitor visitor) {
+    return visitor.visitBoolLiteralTypeInformation(this);
+  }
+}
+
 /**
  * A [NarrowTypeInformation] narrows a [TypeInformation] to a type,
  * represented in [typeAnnotation].
@@ -1569,6 +1602,7 @@
   T visitMapTypeInformation(MapTypeInformation info);
   T visitConcreteTypeInformation(ConcreteTypeInformation info);
   T visitStringLiteralTypeInformation(StringLiteralTypeInformation info);
+  T visitBoolLiteralTypeInformation(BoolLiteralTypeInformation info);
   T visitClosureCallSiteTypeInformation(ClosureCallSiteTypeInformation info);
   T visitStaticCallSiteTypeInformation(StaticCallSiteTypeInformation info);
   T visitDynamicCallSiteTypeInformation(DynamicCallSiteTypeInformation info);
diff --git a/pkg/compiler/lib/src/info/analysis_result.dart b/pkg/compiler/lib/src/info/analysis_result.dart
new file mode 100644
index 0000000..5266a01
--- /dev/null
+++ b/pkg/compiler/lib/src/info/analysis_result.dart
@@ -0,0 +1,73 @@
+// 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.
+
+/// API to get results from a static analysis of the source program.
+library compiler.src.stats.analysis_result;
+
+import '../tree/tree.dart' show Node;
+import '../universe/selector.dart' show Selector;
+
+/// A three-value logic bool (yes, no, maybe). We say that `yes` and `maybe` are
+/// "truthy", while `no` and `maybe` are "falsy".
+// TODO(sigmund): is it worth using an enum? or switch to true/false/null?
+enum Boolish { yes, no, maybe }
+
+/// Specifies results of some kind of static analysis on a source program.
+abstract class AnalysisResult {
+  /// Information computed about a specific [receiver].
+  ReceiverInfo infoForReceiver(Node receiver);
+
+  /// Information computed about a specific [selector] applied to a specific
+  /// [receiver].
+  SelectorInfo infoForSelector(Node receiver, Selector selector);
+}
+
+/// Analysis information about a receiver of a send.
+abstract class ReceiverInfo {
+  /// Receiver node for which this information is computed.
+  Node get receiver;
+
+  /// Return whether [receiver] resolves to a value that implements no such
+  /// method. The answer is `yes` if all values that [receiver] could evaluate
+  /// to at runtime contain it, or `no` if none of them does. Maybe if it
+  /// depends on some context or we can't determine this information precisely.
+  Boolish get hasNoSuchMethod;
+
+  /// When [hasNoSuchMethod] is yes, the precise number of possible noSuchMethod
+  /// handlers for this receiver.
+  int get possibleNsmTargets;
+
+  /// Return whether [receiver] may ever be null.
+  Boolish get isNull;
+}
+
+/// Information about a specific selector applied to a specific receiver.
+abstract class SelectorInfo {
+  /// Receiver node of the [selector].
+  Node get receiver;
+
+  /// Specific selector on [receiver] for which this information is computed.
+  Selector get selector;
+
+  /// Whether a member matching [selector] exists in [receiver].
+  Boolish get exists;
+
+  /// Whether [receiver] needs an interceptor to implement [selector].
+  Boolish get usesInterceptor;
+
+  /// Possible total number of methods that could be the target of the selector.
+  /// This needs to be combined with [isAccurate] to correctly understand the
+  /// value. Some invariants:
+  ///
+  ///   * If [exists] is `no`, the value here should be 0, regardless of
+  ///   accuracy.
+  ///   * If [exists] is `yes`, the value is always considered 1 or more.
+  ///     If [isAccurate] is false, we treat it as there may be many possible
+  ///     targets.
+  ///   * If [exists] is `maybe`, the value is considered 0 or more.
+  int get possibleTargets;
+
+  /// Whether the information about [possibleTargets] is accurate.
+  bool get isAccurate;
+}
diff --git a/pkg/compiler/lib/src/info/naive_analysis_result.dart b/pkg/compiler/lib/src/info/naive_analysis_result.dart
new file mode 100644
index 0000000..0061be4
--- /dev/null
+++ b/pkg/compiler/lib/src/info/naive_analysis_result.dart
@@ -0,0 +1,44 @@
+// 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.
+
+/// API to get results from a static analysis of the source program.
+// TODO(sigmund): split out implementations out of this file.
+library compiler.src.stats.naive_analysis_result;
+
+import 'analysis_result.dart';
+import '../tree/tree.dart' show Node;
+import '../universe/selector.dart' show Selector;
+
+/// A naive [AnalysisResult] that tells us very little. This is the most
+/// conservative we can be when we only use information from the AST structure
+/// and from resolution, but no type information.
+class NaiveAnalysisResult implements AnalysisResult {
+  NaiveAnalysisResult();
+
+  ReceiverInfo infoForReceiver(Node receiver) =>
+    new NaiveReceiverInfo(receiver);
+  SelectorInfo infoForSelector(Node receiver, Selector selector) =>
+    new NaiveSelectorInfo(receiver, selector);
+}
+
+class NaiveReceiverInfo implements ReceiverInfo {
+  final Node receiver;
+
+  NaiveReceiverInfo(this.receiver);
+  Boolish get hasNoSuchMethod => Boolish.maybe;
+  Boolish get isNull => Boolish.maybe;
+  int get possibleNsmTargets => -1;
+}
+
+class NaiveSelectorInfo implements SelectorInfo {
+  final Node receiver;
+  final Selector selector;
+
+  NaiveSelectorInfo(this.receiver, this.selector);
+
+  Boolish get exists => Boolish.maybe;
+  Boolish get usesInterceptor => Boolish.maybe;
+  int get possibleTargets => -1;
+  bool get isAccurate => false;
+}
diff --git a/pkg/compiler/lib/src/info/send_info.dart b/pkg/compiler/lib/src/info/send_info.dart
new file mode 100644
index 0000000..b29fe96
--- /dev/null
+++ b/pkg/compiler/lib/src/info/send_info.dart
@@ -0,0 +1,2390 @@
+// 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.
+
+/// Computes measurements about sends in a function.
+library compiler.src.info.send_info;
+
+import 'dart:convert';
+
+import 'package:dart2js_info/src/measurements.dart';
+import 'package:dart2js_info/src/util.dart' show
+    recursiveDiagnosticString;
+
+import '../common.dart';
+import '../common/tasks.dart' show
+    CompilerTask;
+import '../compiler.dart' show
+    Compiler;
+import '../dart_types.dart';
+import '../closure.dart';
+import '../elements/elements.dart';
+import '../elements/visitor.dart' show
+    ElementVisitor;
+import '../resolution/operators.dart';
+import '../resolution/semantic_visitor.dart';
+import '../resolution/send_resolver.dart';
+import '../resolution/tree_elements.dart';
+import '../constants/expressions.dart';
+import '../parser/partial_elements.dart' show
+    PartialElement;
+import '../tree/tree.dart';
+import '../universe/call_structure.dart' show
+    CallStructure;
+import '../universe/selector.dart' show
+    Selector;
+
+import 'analysis_result.dart';
+import 'naive_analysis_result.dart';
+import 'trusted_types_analysis_result.dart';
+
+/// Collects a set of [Measurements] about send expressions in the function [f].
+// TODO(sigmund): collect information on initializers too.
+Measurements collectSendMeasurements(FunctionElement f,
+                                     Compiler compiler) {
+  DiagnosticReporter reporter = compiler.reporter;
+  return reporter.withCurrentElement(f, () {
+    // TODO(sigmund): enable for platform too.
+    if (f.library.isPlatformLibrary) return null;
+    var name = _qualifiedName(f);
+    if (!f.hasNode) {
+      if (f is PartialElement) return const Measurements.unreachableFunction();
+      assert (f is ConstructorElement && f.isSynthesized);
+      // TODO(sigmund): measure synthethic forwarding sends, measure
+      // initializers
+      return new Measurements.reachableFunction();
+    }
+    if (!f.hasResolvedAst) {
+      _debug('no resolved ast ${f.runtimeType}');
+      return null;
+    }
+    var resolvedAst = f.resolvedAst;
+    if (resolvedAst.node == null) {
+      _debug('no node ${f.runtimeType}');
+      return null;
+    }
+    var def = resolvedAst.elements.getFunctionDefinition(resolvedAst.node);
+    if (def == null) {
+      assert (f is PartialElement);
+      return const Measurements.unreachableFunction();
+    }
+
+    var visitor = new _StatsTraversalVisitor(
+        compiler, resolvedAst.elements,
+        reporter.spanFromSpannable(resolvedAst.node).uri);
+    resolvedAst.node.accept(visitor);
+    return visitor.measurements;
+  });
+}
+
+_qualifiedName(FunctionElement f) {
+  var cls = f.enclosingClass;
+  return (cls != null) ? '${cls.name}.${f.name}' : f.name;
+}
+
+/// Visitor that categorizes data about an individual send.
+class _StatsVisitor<T> extends Visitor
+    with SendResolverMixin, SemanticSendResolvedMixin<dynamic, T>
+    implements SemanticSendVisitor<dynamic, T> {
+
+  // TODO(sigmund): consider passing in several AnalysisResults at once, so we
+  // can compute the different metrics together.
+  /// Information we know about the program from static analysis.
+  final AnalysisResult info;
+
+  /// Results from this function.
+  final Measurements measurements;
+
+  final DiagnosticReporter reporter;
+  final TreeElements elements;
+
+  SemanticSendVisitor<dynamic, T> get sendVisitor => this;
+
+  _StatsVisitor(this.reporter, this.elements, this.info, Uri sourceUri)
+      : measurements = new Measurements.reachableFunction(sourceUri);
+
+  visitNode(Node node) => throw "unhandled ${node.runtimeType}: $node";
+  apply(Node node, T arg) => throw "missing apply ${node.runtimeType}: $node";
+  internalError(Node node, String arg) => throw "internal error on $node";
+
+  visitSend(Send node) {
+    _checkInvariant(node, 'before');
+    var span = reporter.spanFromSpannable(node);
+    measurements.record(Metric.send, span.begin, span.end);
+    if (node is SendSet) {
+      if ((node.assignmentOperator != null &&
+                node.assignmentOperator.source != '=') ||
+            node.isPrefix ||
+            node.isPostfix) {
+        assert(!node.isIfNullAssignment);
+        // We count get and set separately in case one of them is defined by the
+        // other could be a nSM error.
+        measurements.record(Metric.send, span.begin, span.end);
+        measurements.record(Metric.send, span.begin, span.end);
+      } else if (node.isIfNullAssignment) {
+        measurements.record(Metric.send, span.begin, span.end);
+      }
+    }
+    super.visitSend(node);
+    _checkInvariant(node, 'after ');
+  }
+
+  visitNewExpression(NewExpression node) {
+    _checkInvariant(node, 'before');
+    var span = reporter.spanFromSpannable(node);
+    measurements.record(Metric.send, span.begin, span.end);
+    super.visitNewExpression(node);
+    _checkInvariant(node, 'after ');
+  }
+
+  /// A monomorphic local variable read.
+  ///
+  /// See [Metric.send] for a full categorization of sends.
+  handleLocal(Node node) {
+    var span = reporter.spanFromSpannable(node);
+    measurements.record(Metric.monomorphicSend, span.begin, span.end);
+    measurements.record(Metric.localSend, span.begin, span.end);
+  }
+
+  /// A monomorphic virual call on [node], where we know which function is the
+  /// target of the call (for example, because only one type in a class
+  /// hierarchy implements a function with a given name).
+  ///
+  /// See [Metric.send] for a full categorization of sends.
+  handleSingleInstance(Node node) {
+    var span = reporter.spanFromSpannable(node);
+    measurements.record(Metric.monomorphicSend, span.begin, span.end);
+    measurements.record(Metric.instanceSend, span.begin, span.end);
+  }
+
+  /// A monomorphic call that goes through an interceptor. This is equivalent in
+  /// terms of what the compiler knows as we do with [handleSignleInstance], and
+  /// because we know the target of the call, we also know that it doesn't live
+  /// in the object instance, but on an interceptor on the side.
+  ///
+  /// See [Metric.send] for a full categorization of sends.
+  handleSingleInterceptor(Node node) {
+    var span = reporter.spanFromSpannable(node);
+    measurements.record(Metric.monomorphicSend, span.begin, span.end);
+    measurements.record(Metric.interceptorSend, span.begin, span.end);
+  }
+
+  /// A polymorphic call that goes through an interceptor.
+  ///
+  /// See [Metric.send] for a full categorization of sends.
+  handleMultiInterceptor(Node node) {
+    var span = reporter.spanFromSpannable(node);
+    measurements.record(Metric.polymorphicSend, span.begin, span.end);
+    measurements.record(Metric.multiInterceptorSend, span.begin, span.end);
+  }
+
+  handleConstructor(Node node) {
+    var span = reporter.spanFromSpannable(node);
+    measurements.record(Metric.monomorphicSend, span.begin, span.end);
+    measurements.record(Metric.constructorSend, span.begin, span.end);
+  }
+
+  handleDynamic(Node node) {
+    var span = reporter.spanFromSpannable(node);
+    measurements.record(Metric.polymorphicSend, span.begin, span.end);
+    measurements.record(Metric.dynamicSend, span.begin, span.end);
+  }
+
+  handleVirtual(Node node) {
+    var span = reporter.spanFromSpannable(node);
+    measurements.record(Metric.polymorphicSend, span.begin, span.end);
+    measurements.record(Metric.virtualSend, span.begin, span.end);
+  }
+
+  handleNSMError(Node node) {
+    var span = reporter.spanFromSpannable(node);
+    measurements.record(Metric.monomorphicSend, span.begin, span.end);
+    measurements.record(Metric.nsmErrorSend, span.begin, span.end);
+  }
+
+  handleNSMSingle(Node node) {
+    var span = reporter.spanFromSpannable(node);
+    measurements.record(Metric.monomorphicSend, span.begin, span.end);
+    measurements.record(Metric.singleNsmCallSend, span.begin, span.end);
+  }
+
+  handleNSMSuper(Node node, ClassElement type) {
+    var superclass = type.superclass;
+    var member = superclass.lookupMember('noSuchMethod');
+    if (!member.enclosingClass.isObject) {
+      handleNSMSingle(node);
+    } else {
+      handleNSMError(node);
+    }
+  }
+
+  handleNSMAny(Node node) {
+    var span = reporter.spanFromSpannable(node);
+    measurements.record(Metric.polymorphicSend, span.begin, span.end);
+    measurements.record(Metric.multiNsmCallSend, span.begin, span.end);
+  }
+
+  handleSuper(Node node) {
+    var span = reporter.spanFromSpannable(node);
+    measurements.record(Metric.monomorphicSend, span.begin, span.end);
+    measurements.record(Metric.superSend, span.begin, span.end);
+  }
+  handleTypeVariable(Node node) {
+    var span = reporter.spanFromSpannable(node);
+    measurements.record(Metric.monomorphicSend, span.begin, span.end);
+    measurements.record(Metric.typeVariableSend, span.begin, span.end);
+  }
+  handleStatic(Node node) {
+    var span = reporter.spanFromSpannable(node);
+    measurements.record(Metric.monomorphicSend, span.begin, span.end);
+    measurements.record(Metric.staticSend, span.begin, span.end);
+  }
+
+  handleNoSend(Node node) {
+    measurements.popLast(Metric.send);
+  }
+
+  void handleDynamicProperty(Node node, Node receiver, Selector selector) {
+    // staticSend: no (automatically)
+    // superSend: no (automatically)
+    // localSend: no (automatically)
+    // constructorSend: no (automatically)
+    // typeVariableSend: no (automatically)
+
+    // nsmErrorSend:      receiver has no `selector` nor nSM.
+    // singleNsmCallSend: receiver has no `selector`, but definitely has `nSM`
+    // instanceSend:      receiver has `selector`, no need to use an interceptor
+    // interceptorSend:   receiver has `selector`, but we know we need an
+    //                    interceptor to get it
+
+    // multiNsmCallSend:  receiver has no `selector`, not sure if receiver has
+    //                    nSM, or not sure which nSM is called (does this one
+    //                    matter, or does nSM is treated like an instance method
+    //                    call)?
+    // virtualSend:       receiver has `selector`, we know we do not need an
+    //                    interceptor, not sure which specific type implements
+    //                    the selector.
+    // multiInterceptorSend: multiple possible receiver types, all using an
+    //                       interceptor to get the `selector`, might be
+    //                       possbile to pick a special selector logic for this
+    //                       combination?
+    // dynamicSend: any combination of the above.
+
+    ReceiverInfo receiverInfo = info.infoForReceiver(receiver);
+    SelectorInfo selectorInfo = info.infoForSelector(receiver, selector);
+    Boolish hasSelector = selectorInfo.exists;
+    Boolish hasNsm = receiverInfo.hasNoSuchMethod;
+
+    if (hasSelector == Boolish.no) {
+      if (hasNsm == Boolish.no) {
+        handleNSMError(node);
+      } else if (hasNsm == Boolish.yes) {
+        if (receiverInfo.possibleNsmTargets == 1) {
+          handleNSMSingle(node);
+        } else {
+          handleNSMAny(node);
+        }
+      } else {
+        handleDynamic(node);
+      }
+      return;
+    }
+
+    Boolish usesInterceptor = selectorInfo.usesInterceptor;
+    if (hasSelector == Boolish.yes) {
+      if (selectorInfo.isAccurate && selectorInfo.possibleTargets == 1) {
+        assert (usesInterceptor != Boolish.maybe);
+        if (usesInterceptor == Boolish.yes) {
+          handleSingleInterceptor(node);
+        } else {
+          handleSingleInstance(node);
+        }
+      } else {
+        if (usesInterceptor == Boolish.no) {
+          handleVirtual(node);
+        } else if (usesInterceptor == Boolish.yes) {
+          handleMultiInterceptor(node);
+        } else {
+          handleDynamic(node);
+        }
+      }
+      return;
+    }
+    handleDynamic(node);
+  }
+
+  void handleThisProperty(Send node, Selector selector) {
+    handleDynamicProperty(node, node.receiver, selector);
+  }
+
+  void handleIndex(Node node) {
+    handleDynamic(node);
+  }
+
+  void handleOperator(Node node) {
+    handleDynamic(node);
+  }
+
+  void handleInvoke(Node node) {
+    handleDynamic(node);
+  }
+
+  void handleEquals(Node node) {
+    handleDynamic(node);
+  }
+
+  // Constructors
+
+  void visitAbstractClassConstructorInvoke(NewExpression node,
+      ConstructorElement element, InterfaceType type, NodeList arguments,
+      CallStructure callStructure, T arg) {
+    handleConstructor(node);
+  }
+
+  void visitBoolFromEnvironmentConstructorInvoke(NewExpression node,
+      BoolFromEnvironmentConstantExpression constant, T arg) {
+    handleConstructor(node);
+  }
+
+  void visitConstConstructorInvoke(
+      NewExpression node, ConstructedConstantExpression constant, T arg) {
+    handleConstructor(node);
+  }
+
+  void visitGenerativeConstructorInvoke(NewExpression node,
+      ConstructorElement constructor, InterfaceType type, NodeList arguments,
+      CallStructure callStructure, T arg) {
+    handleConstructor(node);
+  }
+
+  void visitIntFromEnvironmentConstructorInvoke(NewExpression node,
+      IntFromEnvironmentConstantExpression constant, T arg) {
+    handleConstructor(node);
+  }
+
+  void visitRedirectingFactoryConstructorInvoke(NewExpression node,
+      ConstructorElement constructor, InterfaceType type,
+      ConstructorElement effectiveTarget, InterfaceType effectiveTargetType,
+      NodeList arguments, CallStructure callStructure, T arg) {
+    handleConstructor(node);
+  }
+
+  void visitRedirectingGenerativeConstructorInvoke(NewExpression node,
+      ConstructorElement constructor, InterfaceType type, NodeList arguments,
+      CallStructure callStructure, T arg) {
+    handleConstructor(node);
+  }
+
+  void visitStringFromEnvironmentConstructorInvoke(NewExpression node,
+      StringFromEnvironmentConstantExpression constant, T arg) {
+    handleConstructor(node);
+  }
+
+  // Dynamic sends
+
+
+  // TODO(sigmund): many many things to add:
+  // -- support for operators, indexers, etc.
+  // -- logic about nullables
+  // -- int, JSArray
+  // -- all interceptors
+
+  void visitBinary(
+      Send node, Node left, BinaryOperator operator, Node right, T arg) {
+    handleOperator(node);
+  }
+
+  void visitCompoundIndexSet(SendSet node, Node receiver, Node index,
+      AssignmentOperator operator, Node rhs, T arg) {
+    handleIndex(node); // t1 = receiver[index]
+    handleOperator(node); // t2 = t1 op rhs
+    handleIndex(node); // receiver[index] = t2
+  }
+
+  void visitDynamicPropertyCompound(Send node, Node receiver,
+      Name name, AssignmentOperator operator, Node rhs, T arg) {
+    handleDynamicProperty(node, receiver, new Selector.getter(name));
+    handleOperator(node);
+    handleDynamicProperty(node, receiver, new Selector.setter(name));
+  }
+
+
+  void visitDynamicPropertyGet(
+      Send node, Node receiver, Name name, T arg) {
+    handleDynamicProperty(node, receiver, new Selector.getter(name));
+  }
+
+  void visitDynamicPropertyInvoke(
+      Send node, Node receiver, NodeList arguments, Selector selector, T arg) {
+    handleDynamicProperty(node, receiver, selector);
+  }
+
+  void visitDynamicPropertyPostfix(Send node, Node receiver,
+       Name name, IncDecOperator operator, T arg) {
+    handleDynamicProperty(node, receiver, new Selector.getter(name));
+    handleOperator(node);
+    handleDynamicProperty(node, receiver, new Selector.setter(name));
+  }
+
+  void visitDynamicPropertyPrefix(Send node, Node receiver, Name name,
+      IncDecOperator operator, T arg) {
+    handleDynamicProperty(node, receiver, new Selector.getter(name));
+    handleOperator(node);
+    handleDynamicProperty(node, receiver, new Selector.setter(name));
+  }
+
+  void visitDynamicPropertySet(
+      SendSet node, Node receiver, Name name, Node rhs, T arg) {
+    handleDynamicProperty(node, receiver, new Selector.setter(name));
+  }
+
+  void visitDynamicPropertySetIfNull(
+      Send node, Node receiver, Name name, Node rhs, T arg) {
+    // read to check for null?
+    handleDynamicProperty(node, receiver, new Selector.getter(name));
+    handleDynamicProperty(node, receiver, new Selector.setter(name));
+  }
+
+  void visitEquals(Send node, Node left, Node right, T arg) {
+    handleEquals(node);
+  }
+
+  void visitExpressionInvoke(Send node, Node expression, NodeList arguments,
+      CallStructure callStructure, T arg) {
+    handleInvoke(node);
+  }
+
+  void visitIfNotNullDynamicPropertyCompound(Send node, Node receiver,
+      Name name, AssignmentOperator operator, Node rhs, T arg) {
+    handleDynamicProperty(node, receiver, new Selector.getter(name));
+    handleOperator(node);
+    handleDynamicProperty(node, receiver, new Selector.setter(name));
+  }
+
+  void visitIfNotNullDynamicPropertyGet(
+      Send node, Node receiver, Name name, T arg) {
+    handleDynamicProperty(node, receiver, new Selector.getter(name));
+  }
+
+  void visitIfNotNullDynamicPropertyInvoke(
+      Send node, Node receiver, NodeList arguments, Selector selector, T arg) {
+    handleDynamicProperty(node, receiver, selector);
+  }
+
+  void visitIfNotNullDynamicPropertyPostfix(Send node, Node receiver, Name name,
+      IncDecOperator operator, T arg) {
+    handleDynamicProperty(node, receiver, new Selector.getter(name));
+    handleOperator(node);
+    handleDynamicProperty(node, receiver, new Selector.setter(name));
+  }
+
+  void visitIfNotNullDynamicPropertyPrefix(Send node, Node receiver, Name name,
+      IncDecOperator operator, T arg) {
+    handleDynamicProperty(node, receiver, new Selector.getter(name));
+    handleOperator(node);
+    handleDynamicProperty(node, receiver, new Selector.setter(name));
+  }
+
+  void visitIfNotNullDynamicPropertySet(
+      SendSet node, Node receiver, Name name, Node rhs, T arg) {
+    handleDynamicProperty(node, receiver, new Selector.setter(name));
+  }
+
+  void visitIfNotNullDynamicPropertySetIfNull(
+      Send node, Node receiver, Name name, Node rhs, T arg) {
+    handleDynamicProperty(node, receiver, new Selector.getter(name));
+    handleDynamicProperty(node, receiver, new Selector.setter(name));
+  }
+
+  void visitIndex(Send node, Node receiver, Node index, T arg) {
+    handleIndex(node);
+  }
+
+  void visitIndexPostfix(
+      Send node, Node receiver, Node index, IncDecOperator operator, T arg) {
+    handleIndex(node);
+    handleOperator(node);
+    handleIndex(node);
+  }
+
+  void visitIndexPrefix(
+      Send node, Node receiver, Node index, IncDecOperator operator, T arg) {
+    handleIndex(node);
+    handleOperator(node);
+    handleIndex(node);
+  }
+
+  void visitIndexSet(SendSet node, Node receiver, Node index, Node rhs, T arg) {
+    handleIndex(node);
+  }
+
+  void visitLocalVariableCompound(Send node, LocalVariableElement variable,
+      AssignmentOperator operator, Node rhs, T arg) {
+    handleLocal(node);
+    handleOperator(node);
+    handleLocal(node);
+  }
+
+  void visitLocalVariableInvoke(Send node, LocalVariableElement variable,
+      NodeList arguments, CallStructure callStructure, T arg) {
+    handleInvoke(node);
+  }
+
+  void visitLocalVariablePostfix(Send node, LocalVariableElement variable,
+      IncDecOperator operator, T arg) {
+    handleLocal(node);
+    handleOperator(node);
+    handleLocal(node);
+  }
+
+  void visitLocalVariablePrefix(Send node, LocalVariableElement variable,
+      IncDecOperator operator, T arg) {
+    handleLocal(node);
+    handleOperator(node);
+    handleLocal(node);
+  }
+
+  void visitNotEquals(Send node, Node left, Node right, T arg) {
+    handleEquals(node);
+  }
+
+  void visitParameterCompound(Send node, ParameterElement parameter,
+      AssignmentOperator operator, Node rhs, T arg) {
+    handleLocal(node);
+    handleOperator(node);
+    handleLocal(node);
+  }
+
+  void visitParameterInvoke(Send node, ParameterElement parameter,
+      NodeList arguments, CallStructure callStructure, T arg) {
+    handleInvoke(node);
+  }
+
+  void visitParameterPostfix(
+      Send node, ParameterElement parameter, IncDecOperator operator, T arg) {
+    handleLocal(node);
+    handleOperator(node);
+    handleLocal(node);
+  }
+
+  void visitParameterPrefix(
+      Send node, ParameterElement parameter, IncDecOperator operator, T arg) {
+    handleLocal(node);
+    handleOperator(node);
+    handleLocal(node);
+  }
+
+  void visitStaticFieldCompound(Send node, FieldElement field,
+      AssignmentOperator operator, Node rhs, T arg) {
+    handleStatic(node);
+    handleOperator(node);
+    handleStatic(node);
+  }
+
+  void visitStaticFieldInvoke(Send node, FieldElement field, NodeList arguments,
+      CallStructure callStructure, T arg) {
+    handleInvoke(node);
+  }
+
+  void visitStaticFieldPostfix(
+      Send node, FieldElement field, IncDecOperator operator, T arg) {
+    handleStatic(node);
+    handleOperator(node);
+    handleStatic(node);
+  }
+
+  void visitStaticFieldPrefix(
+      Send node, FieldElement field, IncDecOperator operator, T arg) {
+    handleStatic(node);
+    handleOperator(node);
+    handleStatic(node);
+  }
+
+  void visitStaticGetterInvoke(Send node, FunctionElement getter,
+      NodeList arguments, CallStructure callStructure, T arg) {
+    handleInvoke(node);
+  }
+
+  void visitStaticGetterSetterCompound(Send node, FunctionElement getter,
+      FunctionElement setter, AssignmentOperator operator, Node rhs, T arg) {
+    handleStatic(node);
+    handleOperator(node);
+    handleStatic(node);
+  }
+
+  void visitStaticGetterSetterPostfix(Send node, FunctionElement getter,
+      FunctionElement setter, IncDecOperator operator, T arg) {
+    handleStatic(node);
+    handleOperator(node);
+    handleStatic(node);
+  }
+
+  void visitStaticGetterSetterPrefix(Send node, FunctionElement getter,
+      FunctionElement setter, IncDecOperator operator, T arg) {
+    handleStatic(node);
+    handleOperator(node);
+    handleStatic(node);
+  }
+
+  void visitSuperFieldCompound(Send node, FieldElement field,
+      AssignmentOperator operator, Node rhs, T arg) {
+    handleSuper(node);
+    handleOperator(node);
+    handleSuper(node);
+  }
+
+  void visitSuperFieldFieldCompound(Send node, FieldElement readField,
+      FieldElement writtenField, AssignmentOperator operator, Node rhs, T arg) {
+    handleSuper(node);
+    handleOperator(node);
+    handleSuper(node);
+  }
+
+  void visitSuperFieldFieldPostfix(Send node, FieldElement readField,
+      FieldElement writtenField, IncDecOperator operator, T arg) {
+    handleSuper(node);
+    handleOperator(node);
+    handleSuper(node);
+  }
+
+  void visitSuperFieldFieldPrefix(Send node, FieldElement readField,
+      FieldElement writtenField, IncDecOperator operator, T arg) {
+    handleSuper(node);
+    handleOperator(node);
+    handleSuper(node);
+  }
+
+  void visitSuperFieldFieldSetIfNull(
+      Send node, FieldElement readField, FieldElement writtenField, Node rhs,
+      T arg) {
+    handleSuper(node);
+    handleNSMSuper(node, readField.enclosingClass);
+  }
+
+  void visitSuperFieldInvoke(Send node, FieldElement field, NodeList arguments,
+      CallStructure callStructure, T arg) {
+    handleInvoke(node);
+  }
+
+  void visitSuperFieldPostfix(
+      Send node, FieldElement field, IncDecOperator operator, T arg) {
+    handleSuper(node);
+    handleOperator(node);
+    handleSuper(node);
+  }
+
+  void visitSuperFieldPrefix(
+      Send node, FieldElement field, IncDecOperator operator, T arg) {
+    handleSuper(node);
+    handleOperator(node);
+    handleSuper(node);
+  }
+
+  void visitSuperFieldSetterCompound(Send node, FieldElement field,
+      FunctionElement setter, AssignmentOperator operator, Node rhs, T arg) {
+    handleSuper(node);
+    handleOperator(node);
+    handleSuper(node);
+  }
+
+  void visitSuperFieldSetterPostfix(Send node, FieldElement field,
+      FunctionElement setter, IncDecOperator operator, T arg) {
+    handleSuper(node);
+    handleOperator(node);
+    handleSuper(node);
+  }
+
+  void visitSuperFieldSetterPrefix(Send node, FieldElement field,
+      FunctionElement setter, IncDecOperator operator, T arg) {
+    handleSuper(node);
+    handleOperator(node);
+    handleSuper(node);
+  }
+
+  void visitSuperFieldSetterSetIfNull(Send node, FieldElement field,
+      FunctionElement setter, Node rhs, T arg) {
+    handleSuper(node);
+    handleSuper(node);
+  }
+
+  void visitSuperGetterFieldCompound(Send node, FunctionElement getter,
+      FieldElement field, AssignmentOperator operator, Node rhs, T arg) {
+    handleSuper(node);
+    handleOperator(node);
+    handleSuper(node);
+  }
+
+  void visitSuperGetterFieldPostfix(Send node, FunctionElement getter,
+      FieldElement field, IncDecOperator operator, T arg) {
+    handleSuper(node);
+    handleOperator(node);
+    handleSuper(node);
+  }
+
+  void visitSuperGetterFieldPrefix(Send node, FunctionElement getter,
+      FieldElement field, IncDecOperator operator, T arg) {
+    handleSuper(node);
+    handleOperator(node);
+    handleSuper(node);
+  }
+
+  void visitSuperGetterFieldSetIfNull(Send node, FunctionElement getter,
+      FieldElement field, Node rhs, T arg) {
+    handleSuper(node);
+    handleSuper(node);
+  }
+
+  void visitSuperGetterInvoke(Send node, FunctionElement getter,
+      NodeList arguments, CallStructure callStructure, T arg) {
+    handleInvoke(node);
+  }
+
+  void visitSuperGetterSetterCompound(Send node, FunctionElement getter,
+      FunctionElement setter, AssignmentOperator operator, Node rhs, T arg) {
+    handleSuper(node);
+    handleOperator(node);
+    handleSuper(node);
+  }
+
+  void visitSuperGetterSetterPostfix(Send node, FunctionElement getter,
+      FunctionElement setter, IncDecOperator operator, T arg) {
+    handleSuper(node);
+    handleOperator(node);
+    handleSuper(node);
+  }
+
+  void visitSuperGetterSetterPrefix(Send node, FunctionElement getter,
+      FunctionElement setter, IncDecOperator operator, T arg) {
+    handleSuper(node);
+    handleOperator(node);
+    handleSuper(node);
+  }
+
+  void visitSuperGetterSetterSetIfNull(Send node, FunctionElement getter,
+      FunctionElement setter, Node rhs, T arg) {
+    handleSuper(node);
+    handleSuper(node);
+  }
+
+  void visitSuperIndexPostfix(Send node, MethodElement indexFunction,
+      MethodElement indexSetFunction, Node index, IncDecOperator operator,
+      T arg) {
+    handleSuper(node);
+    handleOperator(node);
+    handleSuper(node);
+  }
+
+  void visitSuperIndexPrefix(Send node, MethodElement indexFunction,
+      MethodElement indexSetFunction, Node index, IncDecOperator operator,
+      T arg) {
+    handleSuper(node);
+    handleOperator(node);
+    handleSuper(node);
+  }
+
+  void visitSuperMethodSetterCompound(Send node, FunctionElement method,
+      FunctionElement setter, AssignmentOperator operator, Node rhs, T arg) {
+    handleSuper(node);
+    handleNSMSuper(node, method.enclosingClass);
+    handleSuper(node);
+  }
+
+  void visitSuperMethodSetterPostfix(Send node, FunctionElement method,
+      FunctionElement setter, IncDecOperator operator, T arg) {
+    handleSuper(node);
+    handleNSMSuper(node, method.enclosingClass);
+    handleSuper(node);
+  }
+
+  void visitSuperMethodSetterPrefix(Send node, FunctionElement method,
+      FunctionElement setter, IncDecOperator operator, T arg) {
+    handleSuper(node);
+    handleNSMSuper(node, method.enclosingClass);
+    handleSuper(node);
+  }
+
+  void visitSuperMethodSetterSetIfNull(Send node, FunctionElement method,
+      FunctionElement setter, Node rhs, T arg) {
+    handleSuper(node);
+    handleSuper(node);
+  }
+
+  void visitThisPropertyCompound(Send node, Name name,
+      AssignmentOperator operator, Node rhs, T arg) {
+    handleThisProperty(node, new Selector.getter(name));
+    handleOperator(node);
+    handleThisProperty(node, new Selector.setter(name));
+  }
+
+  void visitThisPropertyInvoke(
+      Send node, NodeList arguments, Selector selector, T arg) {
+    handleThisProperty(node, selector);
+  }
+
+  void visitThisPropertyPostfix(Send node, Name name, IncDecOperator operator,
+      T arg) {
+    handleThisProperty(node, new Selector.getter(name));
+    handleOperator(node);
+    handleThisProperty(node, new Selector.setter(name));
+  }
+
+  void visitThisPropertyPrefix(Send node, Name name, IncDecOperator operator,
+      T arg) {
+    handleThisProperty(node, new Selector.getter(name));
+    handleOperator(node);
+    handleThisProperty(node, new Selector.setter(name));
+  }
+
+  void visitTopLevelFieldCompound(Send node, FieldElement field,
+      AssignmentOperator operator, Node rhs, T arg) {
+    handleStatic(node);
+    handleOperator(node);
+    handleStatic(node);
+  }
+
+  void visitTopLevelFieldInvoke(Send node, FieldElement field,
+      NodeList arguments, CallStructure callStructure, T arg) {
+    handleInvoke(node);
+  }
+
+  void visitTopLevelFieldPostfix(
+      Send node, FieldElement field, IncDecOperator operator, T arg) {
+    handleStatic(node);
+    handleOperator(node);
+    handleStatic(node);
+  }
+
+  void visitTopLevelFieldPrefix(
+      Send node, FieldElement field, IncDecOperator operator, T arg) {
+    handleStatic(node);
+    handleOperator(node);
+    handleStatic(node);
+  }
+
+  void visitTopLevelGetterInvoke(Send node, FunctionElement getter,
+      NodeList arguments, CallStructure callStructure, T arg) {
+    handleInvoke(node);
+  }
+
+  void visitTopLevelGetterSetterCompound(Send node, FunctionElement getter,
+      FunctionElement setter, AssignmentOperator operator, Node rhs, T arg) {
+    handleStatic(node);
+    handleOperator(node);
+    handleStatic(node);
+  }
+
+  void visitTopLevelGetterSetterPostfix(Send node, FunctionElement getter,
+      FunctionElement setter, IncDecOperator operator, T arg) {
+    handleStatic(node);
+    handleOperator(node);
+    handleStatic(node);
+  }
+
+  void visitTopLevelGetterSetterPrefix(Send node, FunctionElement getter,
+      FunctionElement setter, IncDecOperator operator, T arg) {
+    handleStatic(node);
+    handleOperator(node);
+    handleStatic(node);
+  }
+
+  void visitUnary(Send node, UnaryOperator operator, Node expression, T arg) {
+    handleDynamic(node);
+  }
+
+  // Local variable sends
+
+  void visitLocalFunctionGet(Send node, LocalFunctionElement function, T arg) {
+    handleLocal(node);
+  }
+
+  void visitLocalFunctionInvoke(Send node, LocalFunctionElement function,
+      NodeList arguments, CallStructure callStructure, T arg) {
+    handleLocal(node);
+  }
+
+  void visitLocalVariableGet(Send node, LocalVariableElement variable, T arg) {
+    handleLocal(node);
+  }
+
+  void visitLocalVariableSet(
+      SendSet node, LocalVariableElement variable, Node rhs, T arg) {
+    handleLocal(node);
+  }
+
+  void visitLocalVariableSetIfNull(
+      SendSet node, LocalVariableElement variable, Node rhs, T arg) {
+    handleLocal(node);
+    handleLocal(node);
+  }
+
+  void visitParameterGet(Send node, ParameterElement parameter, T arg) {
+    handleLocal(node);
+  }
+
+  void visitParameterSet(
+      SendSet node, ParameterElement parameter, Node rhs, T arg) {
+    handleLocal(node);
+  }
+
+  void visitParameterSetIfNull(
+      Send node, ParameterElement parameter, Node rhs, T arg) {
+    handleLocal(node);
+    handleLocal(node);
+  }
+
+  // Super monomorphic sends
+
+  void visitSuperBinary(Send node, FunctionElement function,
+      BinaryOperator operator, Node argument, T arg) {
+    handleSuper(node);
+  }
+
+  void visitSuperEquals(
+      Send node, FunctionElement function, Node argument, T arg) {
+    handleSuper(node);
+  }
+
+  void visitSuperFieldGet(Send node, FieldElement field, T arg) {
+    handleSuper(node);
+  }
+
+  void visitSuperFieldSet(SendSet node, FieldElement field, Node rhs, T arg) {
+    handleSuper(node);
+  }
+
+  void visitSuperFieldSetIfNull(
+      SendSet node, FieldElement field, Node rhs, T arg) {
+    handleSuper(node);
+    handleSuper(node);
+  }
+
+  void visitSuperGetterGet(Send node, FunctionElement getter, T arg) {
+    handleSuper(node);
+  }
+
+  void visitSuperGetterSet(
+      SendSet node, FunctionElement getter, Node rhs, T arg) {
+    handleSuper(node);
+  }
+
+  void visitSuperIndex(Send node, FunctionElement function, Node index, T arg) {
+    handleSuper(node);
+  }
+
+  void visitSuperIndexSet(
+      SendSet node, FunctionElement function, Node index, Node rhs, T arg) {
+    handleSuper(node);
+  }
+
+  void visitSuperMethodGet(Send node, MethodElement method, T arg) {
+    handleSuper(node);
+  }
+
+  void visitSuperMethodInvoke(Send node, MethodElement method,
+      NodeList arguments, CallStructure callStructure, T arg) {
+    handleSuper(node);
+  }
+
+  void visitSuperNotEquals(
+      Send node, FunctionElement function, Node argument, T arg) {
+    handleSuper(node);
+  }
+
+  void visitSuperSetterSet(
+      SendSet node, FunctionElement setter, Node rhs, T arg) {
+    handleSuper(node);
+  }
+
+  void visitSuperUnary(
+      Send node, UnaryOperator operator, FunctionElement function, T arg) {
+    handleSuper(node);
+  }
+
+  // Statically known "no such method" sends
+
+  void visitConstructorIncompatibleInvoke(NewExpression node,
+      ConstructorElement constructor, InterfaceType type, NodeList arguments,
+      CallStructure callStructure, T arg) {
+    handleNSMError(node);
+  }
+
+  void visitFinalLocalVariableCompound(Send node, LocalVariableElement variable,
+      AssignmentOperator operator, Node rhs, T arg) {
+    handleLocal(node);
+    handleOperator(node);
+    handleNSMError(node);
+  }
+
+  void visitFinalLocalVariablePostfix(Send node, LocalVariableElement variable,
+      IncDecOperator operator, T arg) {
+    handleLocal(node);
+    handleOperator(node);
+    handleNSMError(node);
+  }
+
+  void visitFinalLocalVariablePrefix(Send node, LocalVariableElement variable,
+      IncDecOperator operator, T arg) {
+    handleLocal(node);
+    handleOperator(node);
+    handleNSMError(node);
+  }
+
+  void visitFinalLocalVariableSet(
+      SendSet node, LocalVariableElement variable, Node rhs, T arg) {
+    handleNSMError(node);
+  }
+
+  void visitFinalLocalVariableSetIfNull(
+      SendSet node, LocalVariableElement variable, Node rhs, T arg) {
+    handleLocal(node); // read for null
+    handleNSMError(node); // set fails
+  }
+
+  void visitFinalParameterCompound(Send node, ParameterElement parameter,
+      AssignmentOperator operator, Node rhs, T arg) {
+    handleLocal(node);
+    handleOperator(node);
+    handleNSMError(node);
+  }
+
+  void visitFinalParameterPostfix(
+      Send node, ParameterElement parameter, IncDecOperator operator, T arg) {
+    handleLocal(node);
+    handleOperator(node);
+    handleNSMError(node);
+  }
+
+  void visitFinalParameterPrefix(
+      Send node, ParameterElement parameter, IncDecOperator operator, T arg) {
+    handleLocal(node);
+    handleOperator(node);
+    handleNSMError(node);
+  }
+
+  void visitFinalParameterSet(
+      SendSet node, ParameterElement parameter, Node rhs, T arg) {
+    handleNSMError(node);
+  }
+
+  void visitFinalParameterSetIfNull(
+      SendSet node, ParameterElement parameter, Node rhs, T arg) {
+    handleLocal(node);
+    handleNSMError(node);
+  }
+
+  void visitFinalStaticFieldCompound(Send node, FieldElement field,
+      AssignmentOperator operator, Node rhs, T arg) {
+    handleStatic(node);
+    handleOperator(node);
+    handleNSMError(node);
+  }
+
+  void visitFinalStaticFieldPostfix(
+      Send node, FieldElement field, IncDecOperator operator, T arg) {
+    handleStatic(node);
+    handleOperator(node);
+    handleNSMError(node);
+  }
+
+  void visitFinalStaticFieldPrefix(
+      Send node, FieldElement field, IncDecOperator operator, T arg) {
+    handleStatic(node);
+    handleOperator(node);
+    handleNSMError(node);
+  }
+
+  void visitFinalStaticFieldSet(
+      SendSet node, FieldElement field, Node rhs, T arg) {
+    handleNSMError(node);
+  }
+
+  void visitFinalStaticFieldSetIfNull(
+      SendSet node, FieldElement field, Node rhs, T arg) {
+    handleStatic(node);
+    handleNSMError(node);
+  }
+
+  void visitFinalSuperFieldSetIfNull(Send node, FieldElement field,
+      Node rhs, T arg) {
+    handleSuper(node);
+    handleNSMSuper(node, field.enclosingClass);
+  }
+
+  void visitFinalSuperFieldCompound(Send node, FieldElement field,
+      AssignmentOperator operator, Node rhs, T arg) {
+    handleSuper(node);
+    handleOperator(node);
+    handleNSMSuper(node, field.enclosingClass);
+  }
+
+  void visitFinalSuperFieldPostfix(
+      Send node, FieldElement field, IncDecOperator operator, T arg) {
+    handleSuper(node);
+    handleOperator(node);
+    handleNSMSuper(node, field.enclosingClass);
+  }
+
+  void visitFinalSuperFieldPrefix(
+      Send node, FieldElement field, IncDecOperator operator, T arg) {
+    handleSuper(node);
+    handleOperator(node);
+    handleNSMSuper(node, field.enclosingClass);
+  }
+
+  void visitFinalSuperFieldSet(
+      SendSet node, FieldElement field, Node rhs, T arg) {
+    handleNSMSuper(node, field.enclosingClass);
+  }
+
+  void visitFinalTopLevelFieldCompound(Send node, FieldElement field,
+      AssignmentOperator operator, Node rhs, T arg) {
+    handleStatic(node);
+    handleOperator(node);
+    handleNSMError(node);
+  }
+
+  void visitFinalTopLevelFieldPostfix(
+      Send node, FieldElement field, IncDecOperator operator, T arg) {
+    handleStatic(node);
+    handleOperator(node);
+    handleNSMError(node);
+  }
+
+  void visitFinalTopLevelFieldPrefix(
+      Send node, FieldElement field, IncDecOperator operator, T arg) {
+    handleStatic(node);
+    handleOperator(node);
+    handleNSMError(node);
+  }
+
+  void visitFinalTopLevelFieldSet(
+      SendSet node, FieldElement field, Node rhs, T arg) {
+    handleNSMError(node);
+  }
+
+  void visitFinalTopLevelFieldSetIfNull(
+      SendSet node, FieldElement field, Node rhs, T arg) {
+    handleStatic(node);
+    handleNSMError(node);
+  }
+
+  void visitTopLevelGetterSetterSetIfNull(Send node, FunctionElement getter,
+      FunctionElement setter, Node rhs, T arg) {
+    handleStatic(node);
+    handleStatic(node);
+  }
+
+  void visitTopLevelMethodSetterSetIfNull(Send node, FunctionElement method,
+      FunctionElement setter, Node rhs, T arg) {
+    handleStatic(node);
+    handleStatic(node);
+  }
+
+  void visitTopLevelMethodSetIfNull(Send node, FunctionElement method,
+      Node rhs, T arg) {
+    handleStatic(node);
+    handleNSMError(node);
+  }
+
+  void visitLocalFunctionIncompatibleInvoke(Send node,
+      LocalFunctionElement function, NodeList arguments,
+      CallStructure callStructure, T arg) {
+    handleNSMError(node);
+  }
+
+  void visitLocalFunctionCompound(Send node, LocalFunctionElement function,
+      AssignmentOperator operator, Node rhs, T arg) {
+    handleLocal(node);
+    handleNSMError(node);
+    handleNoSend(node);
+  }
+
+  void visitLocalFunctionPostfix(Send node, LocalFunctionElement function,
+      IncDecOperator operator, T arg) {
+    handleLocal(node);
+    handleNSMError(node);
+    handleNoSend(node);
+  }
+
+  void visitLocalFunctionPrefix(Send node, LocalFunctionElement function,
+      IncDecOperator operator, T arg) {
+    handleLocal(node);
+    handleNSMError(node);
+    handleNoSend(node);
+  }
+
+  void visitLocalFunctionSet(
+      SendSet node, LocalFunctionElement function, Node rhs, T arg) {
+    handleNSMError(node);
+  }
+
+  void visitLocalFunctionSetIfNull(
+      SendSet node, LocalFunctionElement function, Node rhs, T arg) {
+    handleLocal(node);
+    handleNSMError(node);
+  }
+
+  void visitStaticFunctionIncompatibleInvoke(Send node, MethodElement function,
+      NodeList arguments, CallStructure callStructure, T arg) {
+    handleNSMError(node);
+  }
+
+  void visitStaticFunctionSet(
+      Send node, MethodElement function, Node rhs, T arg) {
+    handleNSMError(node);
+  }
+
+  void visitStaticMethodCompound(Send node, MethodElement method,
+      AssignmentOperator operator, Node rhs, T arg) {
+    handleStatic(node);
+    handleNSMError(node); // operator on a method closure yields nSM
+    handleNoSend(node); // setter is not invoked, don't count it.
+  }
+
+  void visitStaticMethodPostfix(
+      Send node, MethodElement method, IncDecOperator operator, T arg) {
+    handleStatic(node);
+    handleNSMError(node);
+    handleNoSend(node);
+  }
+
+  void visitStaticMethodPrefix(
+      Send node, MethodElement method, IncDecOperator operator, T arg) {
+    handleStatic(node);
+    handleNSMError(node);
+    handleNoSend(node);
+  }
+
+  void visitStaticMethodSetterCompound(Send node, MethodElement method,
+      MethodElement setter, AssignmentOperator operator, Node rhs, T arg) {
+    handleStatic(node);
+    handleNSMError(node); // operator on a method closure yields nSM
+    handleNoSend(node); // setter is not invoked, don't count it.
+  }
+
+  void visitStaticMethodSetterPostfix(Send node, FunctionElement getter,
+      FunctionElement setter, IncDecOperator operator, T arg) {
+    handleStatic(node);
+    handleNSMError(node);
+    handleNoSend(node);
+  }
+
+  void visitStaticMethodSetterPrefix(Send node, FunctionElement getter,
+      FunctionElement setter, IncDecOperator operator, T arg) {
+    handleStatic(node);
+    handleNSMError(node);
+    handleNoSend(node);
+  }
+
+  void visitStaticSetterGet(Send node, FunctionElement setter, T arg) {
+    handleNSMError(node);
+  }
+
+  void visitStaticSetterInvoke(Send node, FunctionElement setter,
+      NodeList arguments, CallStructure callStructure, T arg) {
+    handleNSMError(node);
+  }
+
+  void visitSuperMethodCompound(Send node, FunctionElement method,
+      AssignmentOperator operator, Node rhs, T arg) {
+    handleSuper(node);
+
+    // An operator send on a method closure yields nSM
+    handleNSMSuper(node, method.enclosingClass);
+
+    handleNoSend(node); // setter is not invoked, don't count it.
+  }
+
+  void visitSuperMethodIncompatibleInvoke(Send node, MethodElement method,
+      NodeList arguments, CallStructure callStructure, T arg) {
+    handleNSMSuper(node, method.enclosingClass);
+  }
+
+  void visitSuperMethodPostfix(
+      Send node, FunctionElement method, IncDecOperator operator, T arg) {
+    handleSuper(node);
+    handleNSMSuper(node, method.enclosingClass);
+    handleNoSend(node);
+  }
+
+  void visitSuperMethodPrefix(
+      Send node, FunctionElement method, IncDecOperator operator, T arg) {
+    handleSuper(node);
+    handleNSMSuper(node, method.enclosingClass);
+    handleNoSend(node);
+  }
+
+  void visitSuperMethodSet(Send node, MethodElement method, Node rhs, T arg) {
+    handleNSMSuper(node, method.enclosingClass);
+  }
+
+  void visitSuperMethodSetIfNull(
+      Send node, MethodElement method, Node rhs, T arg) {
+    handleNSMSuper(node, method.enclosingClass);
+  }
+
+  void visitSuperSetterGet(Send node, FunctionElement setter, T arg) {
+    handleNSMSuper(node, setter.enclosingClass);
+  }
+
+  void visitSuperSetterInvoke(Send node, FunctionElement setter,
+      NodeList arguments, CallStructure callStructure, T arg) {
+    handleNSMSuper(node, setter.enclosingClass);
+  }
+
+  void visitTopLevelFunctionIncompatibleInvoke(Send node,
+      MethodElement function, NodeList arguments, CallStructure callStructure,
+      T arg) {
+    handleNSMError(node);
+  }
+
+  void visitTopLevelFunctionSet(
+      Send node, MethodElement function, Node rhs, T arg) {
+    handleNSMError(node);
+  }
+
+  void visitTopLevelGetterSet(
+      SendSet node, FunctionElement getter, Node rhs, T arg) {
+    handleNSMError(node);
+  }
+
+  void visitTopLevelMethodCompound(Send node, FunctionElement method,
+      AssignmentOperator operator, Node rhs, T arg) {
+    handleStatic(node);
+    handleNSMError(node); // operator on a method closure yields nSM
+    handleNoSend(node); // setter is not invoked, don't count it.
+  }
+
+  void visitTopLevelMethodPostfix(
+      Send node, MethodElement method, IncDecOperator operator, T arg) {
+    handleStatic(node);
+    handleNSMError(node);
+    handleNoSend(node);
+  }
+
+  void visitTopLevelMethodPrefix(
+      Send node, MethodElement method, IncDecOperator operator, T arg) {
+    handleStatic(node);
+    handleNSMError(node);
+    handleNoSend(node);
+  }
+
+  void visitTopLevelMethodSetterCompound(Send node, FunctionElement method,
+      FunctionElement setter, AssignmentOperator operator, Node rhs, T arg) {
+    handleStatic(node);
+    handleNSMError(node); // operator on a method closure yields nSM
+    handleNoSend(node); // setter is not invoked, don't count it.
+  }
+
+  void visitTopLevelMethodSetterPostfix(Send node, FunctionElement method,
+      FunctionElement setter, IncDecOperator operator, T arg) {
+    handleStatic(node);
+    handleNSMError(node);
+    handleNoSend(node);
+  }
+
+  void visitTopLevelMethodSetterPrefix(Send node, FunctionElement method,
+      FunctionElement setter, IncDecOperator operator, T arg) {
+    handleStatic(node);
+    handleNSMError(node);
+    handleNoSend(node);
+  }
+
+  void visitTopLevelSetterGet(Send node, FunctionElement setter, T arg) {
+    handleNSMError(node);
+  }
+
+  void visitTopLevelSetterInvoke(Send node, FunctionElement setter,
+      NodeList arguments, CallStructure callStructure, T arg) {
+    handleNSMError(node);
+  }
+
+  void visitTypeVariableTypeLiteralCompound(Send node,
+      TypeVariableElement element, AssignmentOperator operator, Node rhs,
+      T arg) {
+    handleTypeVariable(node);
+    handleNSMError(node); // operator on a method closure yields nSM
+    handleNoSend(node); // setter is not invoked, don't count it.
+  }
+
+  void visitTypeVariableTypeLiteralGet(
+      Send node, TypeVariableElement element, T arg) {
+    handleTypeVariable(node);
+  }
+
+  void visitTypeVariableTypeLiteralInvoke(Send node,
+      TypeVariableElement element, NodeList arguments,
+      CallStructure callStructure, T arg) {
+    handleNSMError(node);
+  }
+
+  void visitTypeVariableTypeLiteralPostfix(
+      Send node, TypeVariableElement element, IncDecOperator operator, T arg) {
+    handleTypeVariable(node);
+    handleNSMError(node);
+    handleNoSend(node);
+  }
+
+  void visitTypeVariableTypeLiteralPrefix(
+      Send node, TypeVariableElement element, IncDecOperator operator, T arg) {
+    handleTypeVariable(node);
+    handleNSMError(node);
+    handleNoSend(node);
+  }
+
+  void visitTypeVariableTypeLiteralSet(
+      SendSet node, TypeVariableElement element, Node rhs, T arg) {
+    handleNSMError(node);
+  }
+
+  void visitTypeVariableTypeLiteralSetIfNull(
+      SendSet node, TypeVariableElement element, Node rhs, T arg) {
+    handleTypeVariable(node);
+    handleNSMError(node);
+  }
+
+  void visitTypedefTypeLiteralCompound(Send node, ConstantExpression constant,
+      AssignmentOperator operator, Node rhs, T arg) {
+    handleTypeVariable(node);
+    handleNSMError(node);
+    handleNoSend(node);
+  }
+
+  void visitTypedefTypeLiteralGet(
+      Send node, ConstantExpression constant, T arg) {
+    handleTypeVariable(node);
+  }
+
+  void visitTypedefTypeLiteralInvoke(Send node, ConstantExpression constant,
+      NodeList arguments, CallStructure callStructure, T arg) {
+    handleNSMError(node);
+  }
+
+  void visitTypedefTypeLiteralPostfix(
+      Send node, ConstantExpression constant, IncDecOperator operator, T arg) {
+    handleTypeVariable(node);
+    handleNSMError(node);
+    handleNoSend(node);
+  }
+
+  void visitTypedefTypeLiteralPrefix(
+      Send node, ConstantExpression constant, IncDecOperator operator, T arg) {
+    handleTypeVariable(node);
+    handleNSMError(node);
+    handleNoSend(node);
+  }
+
+  void visitTypedefTypeLiteralSet(
+      SendSet node, ConstantExpression constant, Node rhs, T arg) {
+    handleNSMError(node);
+  }
+
+  void visitTypedefTypeLiteralSetIfNull(
+      SendSet node, ConstantExpression constant, Node rhs, T arg) {
+    handleStatic(node);
+    handleNSMError(node);
+  }
+
+  void visitUnresolvedClassConstructorInvoke(NewExpression node,
+      Element element, DartType type, NodeList arguments, Selector selector,
+      T arg) {
+    handleNSMError(node);
+  }
+
+  void visitUnresolvedCompound(Send node, Element element,
+      AssignmentOperator operator, Node rhs, T arg) {
+    handleNSMError(node);
+    handleNoSend(node);
+    handleNoSend(node);
+  }
+
+  void visitUnresolvedConstructorInvoke(NewExpression node, Element constructor,
+      DartType type, NodeList arguments, Selector selector, T arg) {
+    handleNSMError(node);
+  }
+
+  void visitUnresolvedGet(Send node, Element element, T arg) {
+    handleNSMError(node);
+  }
+
+  void visitUnresolvedInvoke(Send node, Element element, NodeList arguments,
+      Selector selector, T arg) {
+    handleNSMError(node);
+  }
+
+  void visitUnresolvedPostfix(
+      Send node, Element element, IncDecOperator operator, T arg) {
+    handleNSMError(node);
+    handleNoSend(node);
+    handleNoSend(node);
+  }
+
+  void visitUnresolvedPrefix(
+      Send node, Element element, IncDecOperator operator, T arg) {
+    handleNSMError(node);
+    handleNoSend(node);
+    handleNoSend(node);
+  }
+
+  void visitUnresolvedRedirectingFactoryConstructorInvoke(NewExpression node,
+      ConstructorElement constructor, InterfaceType type, NodeList arguments,
+      CallStructure callStructure, T arg) {
+    handleNSMError(node);
+  }
+
+  void visitUnresolvedSet(Send node, Element element, Node rhs, T arg) {
+    handleNSMError(node);
+  }
+
+  void visitUnresolvedSetIfNull(Send node, Element element, Node rhs, T arg) {
+    handleNSMError(node);
+    handleNoSend(node);
+  }
+
+  void visitUnresolvedStaticGetterCompound(Send node, Element element,
+      MethodElement setter, AssignmentOperator operator, Node rhs, T arg) {
+    handleNSMError(node);
+    handleNoSend(node);
+    handleNoSend(node);
+  }
+
+  void visitUnresolvedStaticGetterPostfix(Send node, Element element,
+      MethodElement setter, IncDecOperator operator, T arg) {
+    handleNSMError(node);
+    handleNoSend(node);
+    handleNoSend(node);
+  }
+
+  void visitUnresolvedStaticGetterPrefix(Send node, Element element,
+      MethodElement setter, IncDecOperator operator, T arg) {
+    handleNSMError(node);
+    handleNoSend(node);
+    handleNoSend(node);
+  }
+
+  void visitUnresolvedStaticGetterSetIfNull(Send node, Element element,
+      MethodElement setter, Node rhs, T arg) {
+    handleNSMError(node);
+    handleNoSend(node);
+  }
+
+  void visitUnresolvedStaticSetterCompound(Send node, MethodElement getter,
+      Element element, AssignmentOperator operator, Node rhs, T arg) {
+    handleNSMError(node);
+    handleNoSend(node);
+    handleNoSend(node);
+  }
+
+  void visitUnresolvedStaticSetterPostfix(Send node, MethodElement getter,
+      Element element, IncDecOperator operator, T arg) {
+    handleNSMError(node);
+    handleNoSend(node);
+    handleNoSend(node);
+  }
+
+  void visitUnresolvedStaticSetterPrefix(Send node, MethodElement getter,
+      Element element, IncDecOperator operator, T arg) {
+    handleNSMError(node);
+    handleNoSend(node);
+    handleNoSend(node);
+  }
+
+  void visitUnresolvedStaticSetterSetIfNull(Send node, MethodElement getter,
+      Element element, Node rhs, T arg) {
+    handleNSMError(node);
+    handleNoSend(node);
+  }
+
+  void visitUnresolvedSuperBinary(Send node, Element element,
+      BinaryOperator operator, Node argument, T arg) {
+    handleNSMSuper(node, element.enclosingClass);
+  }
+
+  void visitUnresolvedSuperCompound(Send node, Element element,
+      AssignmentOperator operator, Node rhs, T arg) {
+    handleNSMSuper(node, element.enclosingClass);
+    // TODO(sigmund): we should only count the next 2 if we know that the
+    // superclass has a nSM method.
+    handleOperator(node);
+    handleNSMSuper(node, element.enclosingClass);
+  }
+
+  void visitUnresolvedSuperCompoundIndexSet(Send node, Element element,
+      Node index, AssignmentOperator operator, Node rhs, T arg) {
+    handleNSMSuper(node, element.enclosingClass);
+    handleNoSend(node);
+    handleNSMSuper(node, element.enclosingClass);
+  }
+
+  void visitUnresolvedSuperGet(Send node, Element element, T arg) {
+    handleNSMSuper(node, element.enclosingClass);
+  }
+
+  void visitUnresolvedSuperSetIfNull(
+      Send node, Element element, Node rhs, T arg) {
+    handleNSMSuper(node, element.enclosingClass);
+    handleNoSend(node);
+  }
+
+  void visitUnresolvedSuperGetterCompound(Send node, Element element,
+      MethodElement setter, AssignmentOperator operator, Node rhs, T arg) {
+    handleNSMSuper(node, element.enclosingClass);
+    handleOperator(node);
+    handleSuper(node);
+  }
+
+  void visitUnresolvedSuperGetterCompoundIndexSet(Send node, Element element,
+      MethodElement setter, Node index, AssignmentOperator operator, Node rhs,
+      T arg) {
+    handleNSMSuper(node, element.enclosingClass);
+    handleOperator(node);
+    handleSuper(node);
+  }
+
+  void visitUnresolvedSuperGetterIndexPostfix(Send node, Element element,
+      MethodElement setter, Node index, IncDecOperator operator, T arg) {
+    handleNSMSuper(node, element.enclosingClass);
+    handleOperator(node);
+    handleSuper(node);
+  }
+
+  void visitUnresolvedSuperGetterIndexPrefix(Send node, Element element,
+      MethodElement setter, Node index, IncDecOperator operator, T arg) {
+    handleNSMSuper(node, element.enclosingClass);
+    handleOperator(node);
+    handleSuper(node);
+  }
+
+  void visitUnresolvedSuperGetterPostfix(Send node, Element element,
+      MethodElement setter, IncDecOperator operator, T arg) {
+    handleNSMSuper(node, element.enclosingClass);
+    handleOperator(node);
+    handleSuper(node);
+  }
+
+  void visitUnresolvedSuperGetterPrefix(Send node, Element element,
+      MethodElement setter, IncDecOperator operator, T arg) {
+    handleNSMSuper(node, element.enclosingClass);
+    handleOperator(node);
+    handleSuper(node);
+  }
+
+  void visitUnresolvedSuperGetterSetIfNull(Send node, Element element,
+      MethodElement setter, Node rhs, T arg) {
+    handleNSMSuper(node, element.enclosingClass);
+    handleSuper(node);
+  }
+
+  void visitUnresolvedSuperIndex(
+      Send node, Element element, Node index, T arg) {
+    handleNSMSuper(node, element.enclosingClass);
+  }
+
+  void visitUnresolvedSuperIndexPostfix(
+      Send node, Element element, Node index, IncDecOperator operator, T arg) {
+    handleNSMSuper(node, element.enclosingClass);
+    handleOperator(node);
+    handleNSMSuper(node, element.enclosingClass);
+  }
+
+  void visitUnresolvedSuperIndexPrefix(
+      Send node, Element element, Node index, IncDecOperator operator, T arg) {
+    handleNSMSuper(node, element.enclosingClass);
+    handleOperator(node);
+    handleNSMSuper(node, element.enclosingClass);
+  }
+
+  void visitUnresolvedSuperIndexSet(
+      Send node, Element element, Node index, Node rhs, T arg) {
+    handleNSMSuper(node, element.enclosingClass);
+  }
+
+  void visitUnresolvedSuperInvoke(Send node, Element element,
+      NodeList arguments, Selector selector, T arg) {
+    handleNSMSuper(node, element.enclosingClass);
+  }
+
+  void visitUnresolvedSuperPostfix(
+      Send node, Element element, IncDecOperator operator, T arg) {
+    handleNSMSuper(node, element.enclosingClass);
+    handleOperator(node);
+    handleNSMSuper(node, element.enclosingClass);
+  }
+
+  void visitUnresolvedSuperPrefix(
+      Send node, Element element, IncDecOperator operator, T arg) {
+    handleNSMSuper(node, element.enclosingClass);
+    handleOperator(node);
+    handleNSMSuper(node, element.enclosingClass);
+  }
+
+  void visitUnresolvedSuperSetterCompound(Send node, MethodElement getter,
+      Element element, AssignmentOperator operator, Node rhs, T arg) {
+    handleSuper(node);
+    handleOperator(node);
+    handleNSMSuper(node, element.enclosingClass);
+  }
+
+  void visitUnresolvedSuperSetterCompoundIndexSet(Send node,
+      MethodElement getter, Element element, Node index,
+      AssignmentOperator operator, Node rhs, T arg) {
+    handleSuper(node);
+    handleOperator(node);
+    handleNSMSuper(node, element.enclosingClass);
+  }
+
+  void visitUnresolvedSuperSetterIndexPostfix(Send node,
+      MethodElement indexFunction, Element element, Node index,
+      IncDecOperator operator, T arg) {
+    handleSuper(node);
+    handleOperator(node);
+    handleNSMSuper(node, element.enclosingClass);
+  }
+
+  void visitUnresolvedSuperSetterIndexPrefix(Send node,
+      MethodElement indexFunction, Element element, Node index,
+      IncDecOperator operator, T arg) {
+    handleSuper(node);
+    handleOperator(node);
+    handleNSMSuper(node, element.enclosingClass);
+  }
+
+  void visitUnresolvedSuperSetterPostfix(Send node, MethodElement getter,
+      Element element, IncDecOperator operator, T arg) {
+    handleSuper(node);
+    handleOperator(node);
+    handleNSMSuper(node, element.enclosingClass);
+  }
+
+  void visitUnresolvedSuperSetterPrefix(Send node, MethodElement getter,
+      Element element, IncDecOperator operator, T arg) {
+    handleSuper(node);
+    handleOperator(node);
+    handleNSMSuper(node, element.enclosingClass);
+  }
+
+  void visitUnresolvedSuperSetterSetIfNull(Send node, MethodElement getter,
+      Element element, Node rhs, T arg) {
+    handleSuper(node);
+    handleNSMSuper(node, element.enclosingClass);
+  }
+
+  void visitUnresolvedSuperUnary(
+      Send node, UnaryOperator operator, Element element, T arg) {
+    handleNSMSuper(node, element.enclosingClass);
+  }
+
+  void visitUnresolvedTopLevelGetterCompound(Send node, Element element,
+      MethodElement setter, AssignmentOperator operator, Node rhs, T arg) {
+    handleNSMError(node);
+    handleNoSend(node);
+    handleNoSend(node);
+  }
+
+  void visitUnresolvedTopLevelGetterPostfix(Send node, Element element,
+      MethodElement setter, IncDecOperator operator, T arg) {
+    handleNSMError(node);
+    handleNoSend(node);
+    handleNoSend(node);
+  }
+
+  void visitUnresolvedTopLevelGetterPrefix(Send node, Element element,
+      MethodElement setter, IncDecOperator operator, T arg) {
+    handleNSMError(node);
+    handleNoSend(node);
+    handleNoSend(node);
+  }
+
+  void visitUnresolvedTopLevelGetterSetIfNull(Send node, Element element,
+      MethodElement setter, Node rhs, T arg) {
+    handleNSMError(node);
+    handleNoSend(node);
+  }
+
+  void visitUnresolvedTopLevelSetterCompound(Send node, MethodElement getter,
+      Element element, AssignmentOperator operator, Node rhs, T arg) {
+    handleNSMError(node);
+    handleNoSend(node);
+    handleNoSend(node);
+  }
+
+  void visitUnresolvedTopLevelSetterPostfix(Send node, MethodElement getter,
+      Element element, IncDecOperator operator, T arg) {
+    handleNSMError(node);
+    handleNoSend(node);
+    handleNoSend(node);
+  }
+
+  void visitUnresolvedTopLevelSetterPrefix(Send node, MethodElement getter,
+      Element element, IncDecOperator operator, T arg) {
+    handleNSMError(node);
+    handleNoSend(node);
+    handleNoSend(node);
+  }
+
+  void visitUnresolvedTopLevelSetterSetIfNull(Send node, MethodElement getter,
+      Element element, Node rhs, T arg) {
+    handleNSMError(node);
+    handleNoSend(node);
+  }
+
+  // Static
+
+  void visitConstantGet(Send node, ConstantExpression constant, T arg) {
+    handleStatic(node);
+  }
+
+  void visitConstantInvoke(Send node, ConstantExpression constant,
+      NodeList arguments, CallStructure callStreucture, T arg) {
+    handleStatic(node);
+  }
+
+  void visitFactoryConstructorInvoke(NewExpression node,
+      ConstructorElement constructor, InterfaceType type, NodeList arguments,
+      CallStructure callStructure, T arg) {
+    handleStatic(node);
+  }
+
+  void visitStaticFieldGet(Send node, FieldElement field, T arg) {
+    handleStatic(node);
+  }
+
+  void visitStaticFieldSet(SendSet node, FieldElement field, Node rhs, T arg) {
+    handleStatic(node);
+  }
+
+  void visitStaticFieldSetIfNull(
+      SendSet node, FieldElement field, Node rhs, T arg) {
+    handleStatic(node);
+    handleStatic(node);
+  }
+
+  void visitStaticFunctionGet(Send node, MethodElement function, T arg) {
+    handleStatic(node);
+  }
+
+  void visitStaticFunctionInvoke(Send node, MethodElement function,
+      NodeList arguments, CallStructure callStructure, T arg) {
+    handleStatic(node);
+  }
+
+  void visitStaticGetterGet(Send node, FunctionElement getter, T arg) {
+    handleStatic(node);
+  }
+
+  void visitStaticGetterSet(
+      SendSet node, FunctionElement getter, Node rhs, T arg) {
+    handleStatic(node);
+  }
+
+  void visitStaticSetterSet(
+      SendSet node, FunctionElement setter, Node rhs, T arg) {
+    handleStatic(node);
+  }
+
+  void visitStaticGetterSetterSetIfNull(
+      Send node,
+      FunctionElement getter,
+      FunctionElement setter,
+      Node rhs,
+      T arg) {
+    handleStatic(node);
+    handleStatic(node);
+  }
+
+  void visitStaticMethodSetterSetIfNull(
+      Send node,
+      MethodElement method,
+      MethodElement setter,
+      Node rhs,
+      T arg) {
+    handleStatic(node);
+    handleStatic(node);
+  }
+
+  void visitStaticMethodSetIfNull(
+      Send node,
+      FunctionElement method,
+      Node rhs,
+      T arg) {
+    handleStatic(node);
+    handleNSMError(node);
+  }
+
+  void visitTopLevelFieldGet(Send node, FieldElement field, T arg) {
+    handleStatic(node);
+  }
+
+  void visitTopLevelFieldSet(
+      SendSet node, FieldElement field, Node rhs, T arg) {
+    handleStatic(node);
+  }
+
+  void visitTopLevelFieldSetIfNull(
+      SendSet node, FieldElement field, Node rhs, T arg) {
+    handleStatic(node);
+    handleStatic(node);
+  }
+
+  void visitTopLevelFunctionGet(Send node, MethodElement function, T arg) {
+    handleStatic(node);
+  }
+
+  void visitTopLevelFunctionInvoke(Send node, MethodElement function,
+      NodeList arguments, CallStructure callStructure, T arg) {
+    handleStatic(node);
+  }
+
+  void visitTopLevelGetterGet(Send node, FunctionElement getter, T arg) {
+    handleStatic(node);
+  }
+
+  void visitTopLevelSetterSet(
+      SendSet node, FunctionElement setter, Node rhs, T arg) {
+    handleStatic(node);
+  }
+
+  // Virtual
+
+  void visitSuperCompoundIndexSet(SendSet node, MethodElement getter,
+      MethodElement setter, Node index, AssignmentOperator operator, Node rhs,
+      T arg) {
+    handleSuper(node);
+    handleOperator(node);
+    handleSuper(node);
+  }
+
+  void visitThisGet(Identifier node, T arg) {
+    handleLocal(node); // TODO(sigmund): should we add a metric for "this"?
+  }
+
+  void visitThisInvoke(
+      Send node, NodeList arguments, CallStructure callStructure, T arg) {
+    // TODO(sigmund): implement (treat like this.call())
+    handleDynamic(node);
+  }
+
+  void visitThisPropertyGet(Send node, Name name, T arg) {
+    handleThisProperty(node, new Selector.getter(name));
+  }
+
+  void visitThisPropertySet(SendSet node, Name name, Node rhs, T arg) {
+    handleThisProperty(node, new Selector.setter(name));
+  }
+
+  void visitThisPropertySetIfNull(Send node, Name name, Node rhs, T arg) {
+    handleThisProperty(node, new Selector.getter(name));
+    handleThisProperty(node, new Selector.setter(name));
+  }
+
+  // Not count
+
+  void errorNonConstantConstructorInvoke(NewExpression node, Element element,
+      DartType type, NodeList arguments, CallStructure callStructure, T arg) {
+    handleNoSend(node);
+  }
+
+  void errorUndefinedBinaryExpression(
+      Send node, Node left, Operator operator, Node right, T arg) {
+    handleNoSend(node);
+  }
+
+  void errorUndefinedUnaryExpression(
+      Send node, Operator operator, Node expression, T arg) {
+    handleNoSend(node);
+  }
+
+  void errorInvalidGet(
+      Send node,
+      ErroneousElement error,
+      T arg) {
+    handleNoSend(node);
+  }
+
+  void errorInvalidInvoke(
+      Send node,
+      ErroneousElement error,
+      NodeList arguments,
+      Selector selector,
+      T arg) {
+    handleNoSend(node);
+  }
+
+  void errorInvalidSet(
+      Send node,
+      ErroneousElement error,
+      Node rhs,
+      T arg) {
+    handleNoSend(node);
+  }
+
+  void errorInvalidSetIfNull(
+      Send node, ErroneousElement error, Node rhs, T arg) {
+    handleNoSend(node);
+    handleNoSend(node);
+  }
+
+
+  void errorInvalidPrefix(
+      Send node,
+      ErroneousElement error,
+      IncDecOperator operator,
+      T arg) {
+    handleNoSend(node);
+  }
+
+  void errorInvalidPostfix(
+      Send node,
+      ErroneousElement error,
+      IncDecOperator operator,
+      T arg) {
+    handleNoSend(node);
+  }
+
+  void errorInvalidCompound(
+      Send node,
+      ErroneousElement error,
+      AssignmentOperator operator,
+      Node rhs,
+      T arg) {
+    handleNoSend(node);
+  }
+
+  void errorInvalidUnary(
+      Send node,
+      UnaryOperator operator,
+      ErroneousElement error,
+      T arg) {
+    handleNoSend(node);
+  }
+
+  void errorInvalidEquals(
+      Send node,
+      ErroneousElement error,
+      Node right,
+      T arg) {
+    handleNoSend(node);
+  }
+
+  void errorInvalidNotEquals(
+      Send node,
+      ErroneousElement error,
+      Node right,
+      T arg) {
+    handleNoSend(node);
+  }
+
+  void errorInvalidBinary(
+      Send node,
+      ErroneousElement error,
+      BinaryOperator operator,
+      Node right,
+      T arg) {
+    handleNoSend(node);
+  }
+
+  void errorInvalidIndex(
+      Send node,
+      ErroneousElement error,
+      Node index,
+      T arg) {
+    handleNoSend(node);
+  }
+
+  void errorInvalidIndexSet(
+      Send node,
+      ErroneousElement error,
+      Node index,
+      Node rhs,
+      T arg) {
+    handleNoSend(node);
+  }
+
+  void errorInvalidCompoundIndexSet(
+      Send node,
+      ErroneousElement error,
+      Node index,
+      AssignmentOperator operator,
+      Node rhs,
+      T arg) {
+    handleNoSend(node);
+    handleNoSend(node);
+    handleNoSend(node);
+  }
+
+  void errorInvalidIndexPrefix(
+      Send node,
+      ErroneousElement error,
+      Node index,
+      IncDecOperator operator,
+      T arg) {
+    handleNoSend(node);
+    handleNoSend(node);
+  }
+
+  void errorInvalidIndexPostfix(
+      Send node,
+      ErroneousElement error,
+      Node index,
+      IncDecOperator operator,
+      T arg) {
+    handleNoSend(node);
+    handleNoSend(node);
+  }
+
+  void previsitDeferredAccess(
+      Send node,
+      PrefixElement prefix,
+      T arg) {
+  }
+
+
+  void visitAs(Send node, Node expression, DartType type, T arg) {
+    handleNoSend(node);
+  }
+
+  void visitClassTypeLiteralCompound(Send node, ConstantExpression constant,
+      AssignmentOperator operator, Node rhs, T arg) {
+    handleStatic(node);
+    handleNSMError(node);
+    handleNoSend(node);
+  }
+
+  void visitClassTypeLiteralGet(Send node, ConstantExpression constant, T arg) {
+    handleStatic(node);
+  }
+
+  void visitClassTypeLiteralInvoke(Send node, ConstantExpression constant,
+      NodeList arguments, CallStructure callStructure, T arg) {
+    handleNSMError(node);
+  }
+
+  void visitClassTypeLiteralPostfix(
+      Send node, ConstantExpression constant, IncDecOperator operator, T arg) {
+    handleStatic(node);
+    handleNSMError(node);
+    handleNoSend(node);
+  }
+
+  void visitClassTypeLiteralPrefix(
+      Send node, ConstantExpression constant, IncDecOperator operator, T arg) {
+    handleStatic(node);
+    handleNSMError(node);
+    handleNoSend(node);
+  }
+
+  void visitClassTypeLiteralSet(
+      SendSet node, ConstantExpression constant, Node rhs, T arg) {
+    handleNSMError(node);
+  }
+
+  void visitClassTypeLiteralSetIfNull(
+      SendSet node, ConstantExpression constant, Node rhs, T arg) {
+    handleStatic(node);
+    handleNSMError(node);
+  }
+
+  void visitDynamicTypeLiteralCompound(Send node, ConstantExpression constant,
+      AssignmentOperator operator, Node rhs, T arg) {
+    handleStatic(node);
+    handleNSMError(node);
+    handleNoSend(node);
+  }
+
+  void visitDynamicTypeLiteralGet(
+      Send node, ConstantExpression constant, T arg) {
+    handleNSMError(node);
+  }
+
+  void visitDynamicTypeLiteralInvoke(Send node, ConstantExpression constant,
+      NodeList arguments, CallStructure callStructure, T arg) {
+    handleNSMError(node);
+  }
+
+  void visitDynamicTypeLiteralPostfix(
+      Send node, ConstantExpression constant, IncDecOperator operator, T arg) {
+    handleStatic(node);
+    handleNSMError(node);
+    handleNoSend(node);
+  }
+
+  void visitDynamicTypeLiteralPrefix(
+      Send node, ConstantExpression constant, IncDecOperator operator, T arg) {
+    handleStatic(node);
+    handleNSMError(node);
+    handleNoSend(node);
+  }
+
+  void visitDynamicTypeLiteralSet(
+      SendSet node, ConstantExpression constant, Node rhs, T arg) {
+    handleNSMError(node);
+  }
+
+  void visitDynamicTypeLiteralSetIfNull(
+      SendSet node, ConstantExpression constant, Node rhs, T arg) {
+    handleStatic(node);
+    handleNSMError(node);
+  }
+
+  void visitIfNull(Send node, Node left, Node right, T arg) {
+    handleNoSend(node);
+  }
+
+  void visitIs(Send node, Node expression, DartType type, T arg) {
+    handleNoSend(node);
+  }
+
+  void visitIsNot(Send node, Node expression, DartType type, T arg) {
+    handleNoSend(node);
+  }
+
+  void visitLogicalAnd(Send node, Node left, Node right, T arg) {
+    handleNoSend(node);
+  }
+
+  void visitLogicalOr(Send node, Node left, Node right, T arg) {
+    handleNoSend(node);
+  }
+
+  void visitNot(Send node, Node expression, T arg) {
+    handleNoSend(node);
+  }
+
+  String last;
+  _checkInvariant(node, String msg) {
+    msg = '$msg ${recursiveDiagnosticString(measurements, Metric.send)}';
+    if (!measurements.checkInvariant(Metric.send) ||
+        !measurements.checkInvariant(Metric.monomorphicSend) ||
+        !measurements.checkInvariant(Metric.polymorphicSend)) {
+      reporter.reportErrorMessage(node,
+          MessageKind.GENERIC, {'text': 'bad\n-- $msg\nlast:\n-- $last\n'});
+      last = msg;
+    } else {
+      last = msg;
+    }
+  }
+}
+
+/// Visitor that collects statistics for a single function.
+class _StatsTraversalVisitor<T> extends TraversalVisitor<dynamic, T>
+    implements SemanticSendVisitor<dynamic, T> {
+  final DiagnosticReporter reporter;
+  final _StatsVisitor statsVisitor;
+  Measurements get measurements => statsVisitor.measurements;
+  _StatsTraversalVisitor(
+      Compiler compiler, TreeElements elements, Uri sourceUri)
+      : reporter = compiler.reporter,
+        statsVisitor = new _StatsVisitor(compiler.reporter, elements,
+            // TODO(sigmund): accept a list of analyses, so we can compare them
+            // together.
+            true
+            ? new TrustTypesAnalysisResult(elements, compiler.world)
+            : new NaiveAnalysisResult(),
+            sourceUri),
+        super(elements);
+
+  void visitSend(Send node) {
+    try {
+      node.accept(statsVisitor);
+    } catch (e, t) {
+      reporter.reportErrorMessage(
+          node, MessageKind.GENERIC, {'text': '$e\n$t'});
+    }
+    super.visitSend(node);
+  }
+
+  void visitNewExpression(NewExpression node) {
+    try {
+      node.accept(statsVisitor);
+    } catch (e, t) {
+      reporter.reportErrorMessage(
+          node, MessageKind.GENERIC, {'text': '$e\n$t'});
+    }
+    super.visitNewExpression(node);
+  }
+}
+
+/// Helper to visit elements recursively
+// TODO(sigmund): maybe generalize and move to elements/visitor.dart?
+abstract class RecursiveElementVisitor<R, A> extends ElementVisitor<R, A> {
+
+  @override
+  R visitWarnOnUseElement(WarnOnUseElement e, A arg) =>
+      e.wrappedElement.accept(this, arg);
+
+  R visitScopeContainerElement(ScopeContainerElement e, A arg) {
+    e.forEachLocalMember((l) => l.accept(this, arg));
+    return null;
+  }
+
+  @override
+  R visitCompilationUnitElement(CompilationUnitElement e, A arg) {
+    e.forEachLocalMember((l) => l.accept(this, arg));
+    return null;
+  }
+
+  @override
+  R visitLibraryElement(LibraryElement e, A arg) {
+    e.implementation.compilationUnits.forEach((u) => u.accept(this, arg));
+    return null;
+  }
+
+  @override
+  R visitVariableElement(VariableElement e, A arg) => null;
+
+  @override
+  R visitParameterElement(ParameterElement e, A arg) => null;
+
+  @override
+  R visitFormalElement(FormalElement e, A arg) => null;
+
+  @override
+  R visitFieldElement(FieldElement e, A arg) => null;
+
+  @override
+  R visitFieldParameterElement(InitializingFormalElement e, A arg) => null;
+
+  @override
+  R visitAbstractFieldElement(AbstractFieldElement e, A arg) => null;
+
+  @override
+  R visitFunctionElement(FunctionElement e, A arg) => null;
+
+  @override
+  R visitConstructorElement(ConstructorElement e, A arg) {
+    return visitFunctionElement(e, arg);
+  }
+
+  @override
+  R visitConstructorBodyElement(ConstructorBodyElement e, A arg) {
+    return visitFunctionElement(e.constructor, arg);
+  }
+
+  @override
+  R visitClassElement(ClassElement e, A arg) {
+    return visitScopeContainerElement(e, arg);
+  }
+
+  @override
+  R visitEnumClassElement(EnumClassElement e, A arg) {
+    return visitClassElement(e, arg);
+  }
+
+  @override
+  R visitBoxFieldElement(BoxFieldElement e, A arg) => null;
+
+  @override
+  R visitClosureClassElement(ClosureClassElement e, A arg) {
+    return visitClassElement(e, arg);
+  }
+
+  @override
+  R visitClosureFieldElement(ClosureFieldElement e, A arg) {
+    return visitVariableElement(e, arg);
+  }
+}
+
+// TODO(sigmund): get rid of debug messages.
+_debug(String message) {
+  print('debug: $message');
+}
diff --git a/pkg/compiler/lib/src/info/trusted_types_analysis_result.dart b/pkg/compiler/lib/src/info/trusted_types_analysis_result.dart
new file mode 100644
index 0000000..8de59ae
--- /dev/null
+++ b/pkg/compiler/lib/src/info/trusted_types_analysis_result.dart
@@ -0,0 +1,104 @@
+// 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.
+
+/// API to get results from a static analysis of the source program.
+// TODO(sigmund): split out implementations out of this file.
+library compiler.src.stats.trusted_types_analysis_result;
+
+import 'analysis_result.dart';
+import '../tree/tree.dart' show Node;
+import '../universe/selector.dart' show Selector;
+import '../resolution/tree_elements.dart' show TreeElements;
+import '../world.dart' show ClassWorld;
+import '../dart_types.dart' show InterfaceType;
+
+/// An [AnalysisResult] produced by using type-propagation based on
+/// trusted type annotations.
+class TrustTypesAnalysisResult implements AnalysisResult {
+  final ClassWorld world;
+  final TreeElements elements;
+
+  TrustTypesAnalysisResult(this.elements, this.world);
+
+  ReceiverInfo infoForReceiver(Node receiver) =>
+    new TrustTypesReceiverInfo(receiver, elements.typesCache[receiver], world);
+  SelectorInfo infoForSelector(Node receiver, Selector selector) =>
+    new TrustTypesSelectorInfo(
+        receiver, elements.typesCache[receiver], selector, world);
+}
+
+class _SelectorLookupResult {
+  final Boolish exists;
+  // TODO(sigmund): implement
+  final Boolish usesInterceptor = Boolish.no;
+  final int possibleTargets;
+
+  _SelectorLookupResult(this.exists, this.possibleTargets);
+
+  const _SelectorLookupResult.dontKnow()
+    : exists = Boolish.maybe, possibleTargets = -1;
+}
+
+_SelectorLookupResult _lookupSelector(
+    String selectorName, InterfaceType type, ClassWorld world) {
+  if (type == null) return const _SelectorLookupResult.dontKnow();
+  bool isNsm = selectorName == 'noSuchMethod';
+  bool notFound = false;
+  var uniqueTargets = new Set();
+  for (var cls in world.subtypesOf(type.element)) {
+    var member = cls.lookupMember(selectorName);
+    if (member != null && !member.isAbstract
+        // Don't match nsm in Object
+        && (!isNsm || !member.enclosingClass.isObject)) {
+      uniqueTargets.add(member);
+    } else {
+      notFound = true;
+    }
+  }
+  Boolish exists = uniqueTargets.length > 0
+        ? (notFound ? Boolish.maybe : Boolish.yes)
+        : Boolish.no;
+  return new _SelectorLookupResult(exists, uniqueTargets.length);
+}
+
+class TrustTypesReceiverInfo implements ReceiverInfo {
+  final Node receiver;
+  final Boolish hasNoSuchMethod;
+  final int possibleNsmTargets;
+  final Boolish isNull = Boolish.maybe;
+
+  factory TrustTypesReceiverInfo(
+      Node receiver, InterfaceType type, ClassWorld world) {
+    // TODO(sigmund): refactor, maybe just store nsm as a SelectorInfo
+    var res = _lookupSelector('noSuchMethod', type, world);
+    return new TrustTypesReceiverInfo._(receiver,
+        res.exists, res.possibleTargets);
+  }
+
+  TrustTypesReceiverInfo._(this.receiver, this.hasNoSuchMethod,
+      this.possibleNsmTargets);
+}
+
+class TrustTypesSelectorInfo implements SelectorInfo {
+  final Node receiver;
+  final Selector selector;
+
+  final Boolish exists;
+  final Boolish usesInterceptor;
+  final int possibleTargets;
+  final bool isAccurate;
+
+  factory TrustTypesSelectorInfo(Node receiver, InterfaceType type,
+      Selector selector, ClassWorld world) {
+    var res = _lookupSelector(
+        selector != null ? selector.name : null, type, world);
+    return new TrustTypesSelectorInfo._(receiver, selector, res.exists,
+        res.usesInterceptor, res.possibleTargets,
+        res.exists != Boolish.maybe);
+  }
+  TrustTypesSelectorInfo._(
+      this.receiver, this.selector, this.exists, this.usesInterceptor,
+      this.possibleTargets, this.isAccurate);
+}
+
diff --git a/pkg/compiler/lib/src/io/position_information.dart b/pkg/compiler/lib/src/io/position_information.dart
index 56b88d1..0e384c3 100644
--- a/pkg/compiler/lib/src/io/position_information.dart
+++ b/pkg/compiler/lib/src/io/position_information.dart
@@ -7,18 +7,16 @@
 
 library dart2js.source_information.position;
 
-import '../dart2jslib.dart' show
-    invariant,
-    MessageKind,
-    SourceSpan;
+import '../common.dart';
 import '../elements/elements.dart' show
     AstElement,
     LocalElement;
 import '../js/js.dart' as js;
 import '../js/js_source_mapping.dart';
 import '../js/js_debug.dart';
-import '../tree/tree.dart' show Node, Send;
-import '../util/util.dart' show NO_LOCATION_SPANNABLE;
+import '../tree/tree.dart' show
+    Node,
+    Send;
 
 import 'source_file.dart';
 import 'source_information.dart';
@@ -231,7 +229,8 @@
 
 /// Registry for mapping [js.Node]s to their [CodePosition].
 class CodePositionRecorder {
-  Map<js.Node, CodePosition> _codePositionMap = <js.Node, CodePosition>{};
+  Map<js.Node, CodePosition> _codePositionMap =
+      new Map<js.Node, CodePosition>.identity();
 
   void registerPositions(js.Node node,
                          int startPosition,
diff --git a/pkg/compiler/lib/src/io/source_information.dart b/pkg/compiler/lib/src/io/source_information.dart
index 7acf719..1855755 100644
--- a/pkg/compiler/lib/src/io/source_information.dart
+++ b/pkg/compiler/lib/src/io/source_information.dart
@@ -4,11 +4,13 @@
 
 library dart2js.source_information;
 
-import '../dart2jslib.dart' show SourceSpan, MessageKind;
+import '../common.dart';
 import '../elements/elements.dart' show
     AstElement,
     LocalElement;
-import '../tree/tree.dart' show Node, Send;
+import '../tree/tree.dart' show
+    Node,
+    Send;
 import '../js/js.dart' show
     JavaScriptNodeSourceInformation;
 import 'source_file.dart';
diff --git a/pkg/compiler/lib/src/io/start_end_information.dart b/pkg/compiler/lib/src/io/start_end_information.dart
index 68469eb..988c77d 100644
--- a/pkg/compiler/lib/src/io/start_end_information.dart
+++ b/pkg/compiler/lib/src/io/start_end_information.dart
@@ -7,16 +7,15 @@
 
 library dart2js.source_information.start_end;
 
-import '../dart2jslib.dart' show
-    MessageKind,
-    MessageTemplate,
-    SourceSpan;
+import '../common.dart';
+import '../diagnostics/messages.dart' show
+    MessageTemplate;
 import '../elements/elements.dart' show
     AstElement,
     LocalElement;
 import '../js/js.dart' as js;
 import '../js/js_source_mapping.dart';
-import '../scanner/scannerlib.dart' show Token;
+import '../tokens/token.dart' show Token;
 import '../tree/tree.dart' show Node, Send;
 
 import 'source_file.dart';
diff --git a/pkg/compiler/lib/src/js/js.dart b/pkg/compiler/lib/src/js/js.dart
index f609781..1a08cfb 100644
--- a/pkg/compiler/lib/src/js/js.dart
+++ b/pkg/compiler/lib/src/js/js.dart
@@ -7,15 +7,21 @@
 import 'package:js_ast/js_ast.dart';
 export 'package:js_ast/js_ast.dart';
 
-import '../io/code_output.dart' show CodeOutput, CodeBuffer;
-import '../js_emitter/js_emitter.dart' show USE_LAZY_EMITTER;
-import '../dart2jslib.dart' as leg;
-import '../util/util.dart' show NO_LOCATION_SPANNABLE, Indentation, Tagging;
-import '../dump_info.dart' show DumpInfoTask;
+import '../common.dart';
+import '../compiler.dart' show
+    Compiler;
+import '../dump_info.dart' show
+    DumpInfoTask;
+import '../io/code_output.dart' show
+    CodeBuffer,
+    CodeOutput;
+import '../js_emitter/js_emitter.dart' show
+    USE_LAZY_EMITTER;
+
 import 'js_source_mapping.dart';
 
 CodeBuffer prettyPrint(Node node,
-                       leg.Compiler compiler,
+                       Compiler compiler,
                        {DumpInfoTask monitor,
                         bool allowVariableMinification: true,
                         Renamer renamerForNames:
@@ -33,7 +39,7 @@
           new SourceLocationsMapper(outBuffer));
   Dart2JSJavaScriptPrintingContext context =
       new Dart2JSJavaScriptPrintingContext(
-          compiler, monitor, outBuffer, sourceInformationProcessor);
+          compiler.reporter, monitor, outBuffer, sourceInformationProcessor);
   Printer printer = new Printer(options, context);
   printer.visit(node);
   sourceInformationProcessor.process(node);
@@ -41,20 +47,20 @@
 }
 
 class Dart2JSJavaScriptPrintingContext implements JavaScriptPrintingContext {
-  final leg.Compiler compiler;
+  final DiagnosticReporter reporter;
   final DumpInfoTask monitor;
   final CodeBuffer outBuffer;
   final CodePositionListener codePositionListener;
 
   Dart2JSJavaScriptPrintingContext(
-      this.compiler,
+      this.reporter,
       this.monitor,
       this.outBuffer,
       this.codePositionListener);
 
   @override
   void error(String message) {
-    compiler.internalError(NO_LOCATION_SPANNABLE, message);
+    reporter.internalError(NO_LOCATION_SPANNABLE, message);
   }
 
   @override
@@ -122,7 +128,7 @@
                    implements AstContainer {
   @override
   final Node tree;
-  final leg.Compiler _compiler;
+  final Compiler _compiler;
   final bool _protectForEval;
   LiteralString _cachedLiteral;
 
diff --git a/pkg/compiler/lib/src/js/rewrite_async.dart b/pkg/compiler/lib/src/js/rewrite_async.dart
index 1282401..4be28d1 100644
--- a/pkg/compiler/lib/src/js/rewrite_async.dart
+++ b/pkg/compiler/lib/src/js/rewrite_async.dart
@@ -12,8 +12,9 @@
 
 import "js.dart" as js;
 
-import '../util/util.dart';
-import '../dart2jslib.dart' show DiagnosticListener;
+import '../common.dart';
+import '../util/util.dart' show
+    Pair;
 
 /// Rewrites a [js.Fun] with async/sync*/async* functions and await and yield
 /// (with dart-like semantics) to an equivalent function without these.
@@ -154,7 +155,7 @@
   js.VariableUse get self => new js.VariableUse(selfName);
   String selfName;
 
-  final DiagnosticListener diagnosticListener;
+  final DiagnosticReporter reporter;
   // For error reporting only.
   Spannable get spannable {
     return (_spannable == null) ? NO_LOCATION_SPANNABLE : _spannable;
@@ -174,11 +175,10 @@
   bool get isSyncStar => false;
   bool get isAsyncStar => false;
 
-  AsyncRewriterBase(this.diagnosticListener,
-                    spannable,
+  AsyncRewriterBase(this.reporter,
+                    this._spannable,
                     this.safeVariableName,
-                    this.bodyName)
-      : _spannable = spannable;
+                    this.bodyName);
 
   /// Initialize names used by the subClass.
   void initializeNames();
@@ -348,7 +348,7 @@
   }
 
   void unreachable(js.Node node) {
-    diagnosticListener.internalError(
+    reporter.internalError(
         spannable, "Internal error, trying to visit $node");
   }
 
@@ -1372,7 +1372,7 @@
           clauses.add(new js.Default(gotoAndBreak(labels[i])));
           hasDefault = true;
         } else {
-          diagnosticListener.internalError(
+          reporter.internalError(
               spannable, "Unknown clause type $clause");
         }
         i++;
@@ -1689,21 +1689,23 @@
   /// Specific to async methods.
   final js.Expression newCompleter;
 
+  final js.Expression wrapBody;
 
-  AsyncRewriter(DiagnosticListener diagnosticListener,
-                spannable,
+  AsyncRewriter(DiagnosticReporter reporter,
+                Spannable spannable,
                 {this.asyncHelper,
                  this.newCompleter,
+                 this.wrapBody,
                  String safeVariableName(String proposedName),
                  js.Name bodyName})
-        : super(diagnosticListener,
+        : super(reporter,
                 spannable,
                 safeVariableName,
                 bodyName);
 
   @override
   void addYield(js.DartYield node, js.Expression expression) {
-    diagnosticListener.internalError(spannable,
+    reporter.internalError(spannable,
         "Yield in non-generating async function");
   }
 
@@ -1774,13 +1776,13 @@
     return js.js("""
         function (#parameters) {
           #variableDeclarations;
-          function #bodyName(#errorCode, #result) {
+          var #bodyName = #wrapBody(function (#errorCode, #result) {
             if (#errorCode === #ERROR) {
                 #currentError = #result;
                 #goto = #handler;
             }
             #rewrittenBody;
-          }
+          });
           return #asyncHelper(null, #bodyName, #completer, null);
         }""", {
           "parameters": parameters,
@@ -1795,6 +1797,7 @@
           "result": resultName,
           "asyncHelper": asyncHelper,
           "completer": completer,
+          "wrapBody": wrapBody,
         });
   }
 }
@@ -1820,7 +1823,7 @@
   /// Used by sync* functions to throw exeptions.
   final js.Expression uncaughtErrorExpression;
 
-  SyncStarRewriter(DiagnosticListener diagnosticListener,
+  SyncStarRewriter(DiagnosticReporter diagnosticListener,
                 spannable,
                 {this.endOfIteration,
                  this.newIterable,
@@ -1930,7 +1933,7 @@
 
   @override
   js.Statement awaitStatement(js.Expression value) {
-    throw diagnosticListener.internalError(spannable,
+    throw reporter.internalError(spannable,
         "Sync* functions cannot contain await statements.");
   }
 
@@ -1989,16 +1992,19 @@
   /// Called with the stream to yield from.
   final js.Expression yieldStarExpression;
 
-  AsyncStarRewriter(DiagnosticListener diagnosticListener,
-                spannable,
-                {this.asyncStarHelper,
-                 this.streamOfController,
-                 this.newController,
-                 this.yieldExpression,
-                 this.yieldStarExpression,
-                 String safeVariableName(String proposedName),
-                 js.Name bodyName})
-        : super(diagnosticListener,
+  final js.Expression wrapBody;
+
+  AsyncStarRewriter(DiagnosticReporter reporter,
+                    Spannable spannable,
+                    {this.asyncStarHelper,
+                     this.streamOfController,
+                     this.newController,
+                     this.yieldExpression,
+                     this.yieldStarExpression,
+                     this.wrapBody,
+                     String safeVariableName(String proposedName),
+                     js.Name bodyName})
+        : super(reporter,
                 spannable,
                 safeVariableName,
                 bodyName);
@@ -2041,8 +2047,7 @@
                         js.VariableDeclarationList variableDeclarations) {
     return js.js("""
         function (#parameters) {
-          #variableDeclarations;
-          function #bodyName(#errorCode, #result) {
+          var #bodyName = #wrapBody(function (#errorCode, #result) {
             if (#hasYield) {
               switch (#errorCode) {
                 case #STREAM_WAS_CANCELED:
@@ -2060,7 +2065,8 @@
               }
             }
             #rewrittenBody;
-          }
+          });
+          #variableDeclarations;
           return #streamOfController(#controller);
         }""", {
           "parameters": parameters,
@@ -2079,6 +2085,7 @@
           "result": resultName,
           "streamOfController": streamOfController,
           "controller": controllerName,
+          "wrapBody": wrapBody,
         });
   }
 
@@ -2111,7 +2118,8 @@
     List<js.VariableInitialization> variables =
         new List<js.VariableInitialization>();
     variables.add(_makeVariableInitializer(controller,
-                         js.js('#(#)', [newController, bodyName])));
+                         js.js('#(#)',
+                               [newController, bodyName])));
     if (analysis.hasYield) {
       variables.add(_makeVariableInitializer(nextWhenCanceled, null));
     }
diff --git a/pkg/compiler/lib/src/js_backend/backend.dart b/pkg/compiler/lib/src/js_backend/backend.dart
index d17fffd..892f819 100644
--- a/pkg/compiler/lib/src/js_backend/backend.dart
+++ b/pkg/compiler/lib/src/js_backend/backend.dart
@@ -215,7 +215,7 @@
 enum SyntheticConstantKind {
   DUMMY_INTERCEPTOR,
   EMPTY_VALUE,
-  TYPEVARIABLE_REFERENCE,
+  TYPEVARIABLE_REFERENCE,  // Reference to a type in reflection data.
   NAME
 }
 
@@ -223,8 +223,6 @@
   static final Uri DART_JS_HELPER = new Uri(scheme: 'dart', path: '_js_helper');
   static final Uri DART_INTERCEPTORS =
       new Uri(scheme: 'dart', path: '_interceptors');
-  static final Uri DART_INTERNAL =
-      new Uri(scheme: 'dart', path: '_internal');
   static final Uri DART_FOREIGN_HELPER =
       new Uri(scheme: 'dart', path: '_foreign_helper');
   static final Uri DART_JS_MIRRORS =
@@ -235,15 +233,17 @@
       new Uri(scheme: 'dart', path: '_js_embedded_names');
   static final Uri DART_ISOLATE_HELPER =
       new Uri(scheme: 'dart', path: '_isolate_helper');
-  static final Uri DART_HTML =
-      new Uri(scheme: 'dart', path: 'html');
+  static final Uri PACKAGE_JS =
+         new Uri(scheme: 'package', path: 'js/js.dart');
+  static final Uri PACKAGE_LOOKUP_MAP =
+      new Uri(scheme: 'package', path: 'lookup_map/lookup_map.dart');
 
   static const String INVOKE_ON = '_getCachedInvocation';
   static const String START_ROOT_ISOLATE = 'startRootIsolate';
 
 
   String get patchVersion => emitter.patchVersion;
-  
+
   bool get supportsReflection => emitter.emitter.supportsReflection;
 
   final Annotations annotations;
@@ -273,13 +273,14 @@
   FunctionInlineCache inlineCache = new FunctionInlineCache();
 
   LibraryElement jsHelperLibrary;
+  LibraryElement asyncLibrary;
   LibraryElement interceptorsLibrary;
   LibraryElement foreignLibrary;
   LibraryElement isolateHelperLibrary;
 
   ClassElement closureClass;
   ClassElement boundClosureClass;
-  Element assertMethod;
+  Element assertUnreachableMethod;
   Element invokeOnMethod;
 
   ClassElement jsInterceptorClass;
@@ -292,6 +293,8 @@
   ClassElement jsBoolClass;
   ClassElement jsPlainJavaScriptObjectClass;
   ClassElement jsUnknownJavaScriptObjectClass;
+  ClassElement jsJavaScriptFunctionClass;
+  ClassElement jsJavaScriptObjectClass;
 
   ClassElement jsIndexableClass;
   ClassElement jsMutableIndexableClass;
@@ -312,7 +315,6 @@
   Element jsStringToString;
   Element jsStringOperatorAdd;
   Element objectEquals;
-  Element cachedCheckConcurrentModificationError;
 
   ClassElement typeLiteralClass;
   ClassElement mapLiteralClass;
@@ -329,14 +331,23 @@
   ClassElement forceInlineClass;
   ClassElement irRepresentationClass;
 
+  ClassElement jsAnnotationClass;
+  ClassElement jsAnonymousClass;
+
   Element getInterceptorMethod;
 
   ClassElement jsInvocationMirrorClass;
 
-  /// If [true], the compiler will emit code that writes the name of the current
-  /// method together with its class and library to the console the first time
-  /// the method is called.
-  static const bool TRACE_CALLS = false;
+  ClassElement typedArrayClass;
+  ClassElement typedArrayOfIntClass;
+
+  /// If [true], the compiler will emit code that logs whenever a method is
+  /// called. When TRACE_METHOD is 'console' this will be logged
+  /// directly in the JavaScript console. When TRACE_METHOD is 'post' the
+  /// information will be sent to a server via a POST request.
+  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.typesTask.stringType;
@@ -503,6 +514,7 @@
   }
 
   final RuntimeTypes rti;
+  final RuntimeTypesEncoder rtiEncoder;
 
   /// Holds the method "disableTreeShaking" in js_mirrors when
   /// dart:mirrors has been loaded.
@@ -608,6 +620,12 @@
   /// constructors for custom elements.
   CustomElementsAnalysis customElementsAnalysis;
 
+  /// Codegen support for tree-shaking entries of `LookupMap`.
+  LookupMapAnalysis lookupMapAnalysis;
+
+  /// Codegen support for typed JavaScript interop.
+  JsInteropAnalysis jsInteropAnalysis;
+
   /// Support for classifying `noSuchMethod` implementations.
   NoSuchMethodRegistry noSuchMethodRegistry;
 
@@ -621,13 +639,17 @@
 
   final SourceInformationStrategy sourceInformationStrategy;
 
+  final BackendHelpers helpers;
+  final BackendImpacts impacts;
+
   JavaScriptBackend(Compiler compiler,
                     {bool generateSourceMap: true,
                      bool useStartupEmitter: false})
       : namer = determineNamer(compiler),
         oneShotInterceptors = new Map<jsAst.Name, Selector>(),
         interceptedElements = new Map<String, Set<Element>>(),
-        rti = new RuntimeTypes(compiler),
+        rti = new _RuntimeTypes(compiler),
+        rtiEncoder = new _RuntimeTypesEncoder(compiler),
         specializedGetInterceptors = new Map<jsAst.Name, Set<ClassElement>>(),
         annotations = new Annotations(compiler),
         this.sourceInformationStrategy =
@@ -636,11 +658,16 @@
                      ? const PositionSourceInformationStrategy()
                      : const StartEndSourceInformationStrategy())
                 : const JavaScriptSourceInformationStrategy(),
+        helpers = new BackendHelpers(compiler),
+        impacts = new BackendImpacts(compiler),
         super(compiler) {
     emitter = new CodeEmitterTask(
         compiler, namer, generateSourceMap, useStartupEmitter);
     typeVariableHandler = new TypeVariableHandler(compiler);
     customElementsAnalysis = new CustomElementsAnalysis(this);
+    lookupMapAnalysis = new LookupMapAnalysis(this, reporter);
+    jsInteropAnalysis = new JsInteropAnalysis(this);
+
     noSuchMethodRegistry = new NoSuchMethodRegistry(this);
     constantCompilerTask = new JavaScriptConstantTask(compiler);
     resolutionCallbacks = new JavaScriptResolutionCallbacks(this);
@@ -653,6 +680,10 @@
 
   ConstantSystem get constantSystem => constants.constantSystem;
 
+  DiagnosticReporter get reporter => compiler.reporter;
+
+  Resolution get resolution => compiler.resolution;
+
   /// Returns constant environment for the JavaScript interpretation of the
   /// constants.
   JavaScriptConstantCompiler get constants {
@@ -660,7 +691,7 @@
   }
 
   FunctionElement resolveExternalFunction(FunctionElement element) {
-    if (isForeign(element)) return element;
+    if (isForeign(element) || element.isJsInterop) return element;
     return patchResolverTask.measure(() {
       return patchResolverTask.resolveExternalFunction(element);
     });
@@ -669,10 +700,11 @@
   // TODO(karlklose): Split into findHelperFunction and findHelperClass and
   // add a check that the element has the expected kind.
   Element findHelper(String name) => find(jsHelperLibrary, name);
+  Element findAsyncHelper(String name) => find(asyncLibrary, name);
   Element findInterceptor(String name) => find(interceptorsLibrary, name);
 
   Element find(LibraryElement library, String name) {
-    Element element = library.findLocal(name);
+    Element element = library.implementation.findLocal(name);
     assert(invariant(library, element != null,
         message: "Element '$name' not found in '${library.canonicalUri}'."));
     return element;
@@ -873,7 +905,7 @@
   void validateInterceptorImplementsAllObjectMethods(
       ClassElement interceptorClass) {
     if (interceptorClass == null) return;
-    interceptorClass.ensureResolved(compiler);
+    interceptorClass.ensureResolved(resolution);
     compiler.objectClass.forEachMember((_, Element member) {
       if (member.isGenerativeConstructor) return;
       Element interceptorMember = interceptorClass.lookupMember(member.name);
@@ -886,10 +918,10 @@
   void addInterceptorsForNativeClassMembers(
       ClassElement cls, Enqueuer enqueuer) {
     if (enqueuer.isResolutionQueue) {
-      cls.ensureResolved(compiler);
+      cls.ensureResolved(resolution);
       cls.forEachMember((ClassElement classElement, Element member) {
-        if (member.name == Compiler.CALL_OPERATOR_NAME) {
-          compiler.reportError(
+        if (member.name == Identifiers.call) {
+          reporter.reportErrorMessage(
               member,
               MessageKind.CALL_NOT_SUPPORTED_ON_NATIVE_CLASS);
           return;
@@ -919,7 +951,7 @@
     if (enqueuer.isResolutionQueue) {
       _interceptedClasses.add(jsInterceptorClass);
       _interceptedClasses.add(cls);
-      cls.ensureResolved(compiler);
+      cls.ensureResolved(resolution);
       cls.forEachMember((ClassElement classElement, Element member) {
           // All methods on [Object] are shadowed by [Interceptor].
           if (classElement == compiler.objectClass) return;
@@ -948,11 +980,23 @@
     }
   }
 
-  void registerCompileTimeConstant(ConstantValue constant, Registry registry) {
+  void registerCompileTimeConstant(ConstantValue constant, Registry registry,
+      {bool addForEmission: true}) {
     registerCompileTimeConstantInternal(constant, registry);
-    for (ConstantValue dependency in constant.getDependencies()) {
-      registerCompileTimeConstant(dependency, registry);
+
+    if (!registry.isForResolution &&
+        lookupMapAnalysis.isLookupMap(constant)) {
+      // Note: internally, this registration will temporarily remove the
+      // constant dependencies and add them later on-demand.
+      lookupMapAnalysis.registerLookupMapReference(constant);
     }
+
+    for (ConstantValue dependency in constant.getDependencies()) {
+      registerCompileTimeConstant(dependency, registry,
+          addForEmission: false);
+    }
+
+    if (addForEmission) constants.addCompileTimeConstantForEmission(constant);
   }
 
   void registerCompileTimeConstantInternal(ConstantValue constant,
@@ -968,9 +1012,10 @@
       InterceptorConstantValue interceptor = constant;
       registerInstantiatedConstantType(interceptor.dispatchedType, registry);
     } else if (constant.isType) {
-      enqueueInResolution(getCreateRuntimeType(), registry);
+      enqueueInResolution(helpers.createRuntimeType, registry);
       registry.registerInstantiation(typeImplementation.rawType);
     }
+    lookupMapAnalysis.registerConstantKey(constant);
   }
 
   void registerInstantiatedConstantType(DartType type, Registry registry) {
@@ -979,13 +1024,13 @@
     if (type is InterfaceType) {
       registry.registerInstantiation(instantiatedType);
       if (!type.treatAsRaw && classNeedsRti(type.element)) {
-        registry.registerStaticInvocation(getSetRuntimeTypeInfo());
+        registry.registerStaticInvocation(helpers.setRuntimeTypeInfo);
       }
       if (type.element == typeImplementation) {
         // If we use a type literal in a constant, the compile time
         // constant emitter will generate a call to the createRuntimeType
         // helper so we register a use of that.
-        registry.registerStaticInvocation(getCreateRuntimeType());
+        registry.registerStaticInvocation(helpers.createRuntimeType);
       }
     }
   }
@@ -995,13 +1040,25 @@
                                 Registry registry) {
     assert(registry.isForResolution);
     ConstantValue constant = constants.getConstantValueForMetadata(metadata);
-    registerCompileTimeConstant(constant, registry);
+    registerCompileTimeConstant(constant, registry, addForEmission: false);
     metadataConstants.add(new Dependency(constant, annotatedElement));
   }
 
   void registerInstantiatedClass(ClassElement cls,
                                  Enqueuer enqueuer,
                                  Registry registry) {
+    _processClass(cls, enqueuer, registry);
+  }
+
+  void registerImplementedClass(ClassElement cls,
+                                Enqueuer enqueuer,
+                                Registry registry) {
+    _processClass(cls, enqueuer, registry);
+  }
+
+  void _processClass(ClassElement cls,
+                     Enqueuer enqueuer,
+                     Registry registry) {
     if (!cls.typeVariables.isEmpty) {
       typeVariableHandler.registerClassWithTypeVariables(cls, enqueuer,
                                                          registry);
@@ -1037,7 +1094,9 @@
       } else if (Elements.isNativeOrExtendsNative(cls)) {
         enqueue(enqueuer, getNativeInterceptorMethod, registry);
         enqueueClass(enqueuer, jsInterceptorClass, compiler.globalDependencies);
+        enqueueClass(enqueuer, jsJavaScriptObjectClass, registry);
         enqueueClass(enqueuer, jsPlainJavaScriptObjectClass, registry);
+        enqueueClass(enqueuer, jsJavaScriptFunctionClass, registry);
       } else if (cls == mapLiteralClass) {
         // For map literals, the dependency between the implementation class
         // and [Map] is not visible, so we have to add it manually.
@@ -1047,9 +1106,9 @@
           ClassElement implementation = cls.patch != null ? cls.patch : cls;
           ConstructorElement ctor = implementation.lookupConstructor(name);
           if (ctor == null
-              || (isPrivateName(name)
+              || (Name.isPrivateName(name)
                   && ctor.library != mapLiteralClass.library)) {
-            compiler.internalError(mapLiteralClass,
+            reporter.internalError(mapLiteralClass,
                                    "Map literal class $mapLiteralClass missing "
                                    "'$name' constructor"
                                    "  ${mapLiteralClass.constructors}");
@@ -1062,7 +1121,7 @@
           ClassElement implementation = cls.patch != null ? cls.patch : cls;
           Element element = implementation.lookupLocalMember(name);
           if (element == null || !element.isFunction || !element.isStatic) {
-            compiler.internalError(mapLiteralClass,
+            reporter.internalError(mapLiteralClass,
                 "Map literal class $mapLiteralClass missing "
                 "'$name' static member function");
           }
@@ -1114,10 +1173,14 @@
       addInterceptors(jsUInt31Class, enqueuer, registry);
       addInterceptors(jsDoubleClass, enqueuer, registry);
       addInterceptors(jsNumberClass, enqueuer, registry);
+    } else if (cls == jsJavaScriptObjectClass) {
+      addInterceptors(jsJavaScriptObjectClass, enqueuer, registry);
     } else if (cls == jsPlainJavaScriptObjectClass) {
       addInterceptors(jsPlainJavaScriptObjectClass, enqueuer, registry);
     } else if (cls == jsUnknownJavaScriptObjectClass) {
       addInterceptors(jsUnknownJavaScriptObjectClass, enqueuer, registry);
+    } else if (cls == jsJavaScriptFunctionClass) {
+      addInterceptors(jsJavaScriptFunctionClass, enqueuer, registry);
     } else if (Elements.isNativeOrExtendsNative(cls)) {
       addInterceptorsForNativeClassMembers(cls, enqueuer);
     } else if (cls == jsIndexingBehaviorInterface) {
@@ -1128,6 +1191,18 @@
     }
 
     customElementsAnalysis.registerInstantiatedClass(cls, enqueuer);
+    if (!enqueuer.isResolutionQueue) {
+      lookupMapAnalysis.registerInstantiatedClass(cls);
+    }
+  }
+
+  void registerInstantiatedType(InterfaceType type,
+                                Enqueuer enqueuer,
+                                Registry registry,
+                                {bool mirrorUsage: false}) {
+    lookupMapAnalysis.registerInstantiatedType(type, registry);
+    super.registerInstantiatedType(
+        type, enqueuer, registry, mirrorUsage: mirrorUsage);
   }
 
   void registerUseInterceptor(Enqueuer enqueuer) {
@@ -1135,7 +1210,9 @@
     if (!enqueuer.nativeEnqueuer.hasInstantiatedNativeClasses()) return;
     Registry registry = compiler.globalDependencies;
     enqueue(enqueuer, getNativeInterceptorMethod, registry);
+    enqueueClass(enqueuer, jsJavaScriptObjectClass, registry);
     enqueueClass(enqueuer, jsPlainJavaScriptObjectClass, registry);
+    enqueueClass(enqueuer, jsJavaScriptFunctionClass, registry);
     needToInitializeIsolateAffinityTag = true;
     needToInitializeDispatchProperty = true;
   }
@@ -1160,10 +1237,12 @@
     }
 
     if (TRACE_CALLS) {
-      traceHelper = findHelper('traceHelper');
+      traceHelper = findHelper(
+          TRACE_METHOD == 'console' ? 'consoleTraceHelper' : 'postTraceHelper');
       assert(traceHelper != null);
       enqueueInResolution(traceHelper, registry);
     }
+    enqueueInResolution(assertUnreachableMethod, registry);
     registerCheckedModeHelpers(registry);
   }
 
@@ -1179,9 +1258,10 @@
   }
 
   void registerGetRuntimeTypeArgument(Registry registry) {
-    enqueueInResolution(getGetRuntimeTypeArgument(), registry);
-    enqueueInResolution(getGetTypeArgumentByIndex(), registry);
-    enqueueInResolution(getCopyTypeArguments(), registry);
+    enqueueImpact(
+        compiler.enqueuer.resolution,
+        impacts.getRuntimeTypeArgument,
+        registry);
   }
 
   void registerCallMethodWithFreeTypeVariables(
@@ -1200,6 +1280,7 @@
     if (enqueuer.isResolutionQueue || methodNeedsRti(closure)) {
       registerComputeSignature(enqueuer, registry);
     }
+    super.registerClosureWithFreeTypeVariables(closure, enqueuer, registry);
   }
 
   /// Call during codegen if an instance of [closure] is being created.
@@ -1211,35 +1292,34 @@
   }
 
   void registerBoundClosure(Enqueuer enqueuer) {
-    boundClosureClass.ensureResolved(compiler);
-    enqueuer.registerInstantiatedType(
+    boundClosureClass.ensureResolved(resolution);
+    registerInstantiatedType(
         boundClosureClass.rawType,
+        enqueuer,
         // Precise dependency is not important here.
         compiler.globalDependencies);
   }
 
   void registerGetOfStaticFunction(Enqueuer enqueuer) {
-    closureClass.ensureResolved(compiler);
-    enqueuer.registerInstantiatedType(
-        closureClass.rawType, compiler.globalDependencies);
+    closureClass.ensureResolved(resolution);
+    registerInstantiatedType(
+        closureClass.rawType,
+        enqueuer,
+        compiler.globalDependencies);
   }
 
   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.
-    enqueue(enqueuer, getSetRuntimeTypeInfo(), registry);
-    enqueue(enqueuer, getGetRuntimeTypeInfo(), registry);
-    enqueue(enqueuer, getComputeSignature(), registry);
-    enqueue(enqueuer, getGetRuntimeTypeArguments(), registry);
-    enqueueClass(enqueuer, compiler.listClass, registry);
+    enqueueImpact(enqueuer, impacts.computeSignature, registry);
   }
 
   void registerRuntimeType(Enqueuer enqueuer, Registry registry) {
     registerComputeSignature(enqueuer, registry);
-    enqueueInResolution(getSetRuntimeTypeInfo(), registry);
-    enqueueInResolution(getGetRuntimeTypeInfo(), registry);
+    enqueueInResolution(helpers.setRuntimeTypeInfo, registry);
     registerGetRuntimeTypeArgument(registry);
+    enqueueInResolution(helpers.getRuntimeTypeInfo, registry);
     enqueueClass(enqueuer, compiler.listClass, registry);
   }
 
@@ -1247,7 +1327,7 @@
                                  Enqueuer world,
                                  Registry registry) {
     assert(!registry.isForResolution);
-    type = type.unalias(compiler);
+    type = type.unaliased;
     enqueueClass(world, compiler.boolClass, registry);
     bool inCheckedMode = compiler.enableTypeAssertions;
     // [registerIsCheck] is also called for checked mode checks, so we
@@ -1284,7 +1364,7 @@
   }
 
   void registerCheckDeferredIsLoaded(Registry registry) {
-    enqueueInResolution(getCheckDeferredIsLoaded(), registry);
+    enqueueInResolution(helpers.checkDeferredIsLoaded, registry);
     // Also register the types of the arguments passed to this method.
     enqueueClass(compiler.enqueuer.resolution, compiler.stringClass, registry);
   }
@@ -1293,10 +1373,44 @@
     noSuchMethodRegistry.registerNoSuchMethod(noSuchMethod);
   }
 
+  /// Called when resolving a call to a foreign function.
+  void registerForeignCall(Send node,
+                           Element element,
+                           CallStructure callStructure,
+                           ForeignResolver resolver) {
+    native.NativeResolutionEnqueuer nativeEnqueuer =
+        compiler.enqueuer.resolution.nativeEnqueuer;
+    if (element.name == 'JS') {
+      nativeEnqueuer.registerJsCall(node, resolver);
+    } else if (element.name == 'JS_EMBEDDED_GLOBAL') {
+      nativeEnqueuer.registerJsEmbeddedGlobalCall(node, resolver);
+    } else if (element.name == 'JS_BUILTIN') {
+      nativeEnqueuer.registerJsBuiltinCall(node, resolver);
+    } else if (element.name == '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.
+      if (!node.argumentsNode.isEmpty) {
+        Node argument = node.argumentsNode.nodes.head;
+        ConstantExpression constant = resolver.getConstant(argument);
+        if (constant != null && constant.kind == ConstantExpressionKind.TYPE) {
+          TypeConstantExpression typeConstant = constant;
+          if (typeConstant.type is InterfaceType) {
+            resolver.registerInstantiatedType(typeConstant.type);
+            return;
+          }
+        }
+      }
+      reporter.reportErrorMessage(
+          node,
+          MessageKind.WRONG_ARGUMENT_FOR_JS_INTERCEPTOR_CONSTANT);
+    }
+  }
+
   void enableNoSuchMethod(Enqueuer world) {
-    enqueue(world, getCreateInvocationMirror(), compiler.globalDependencies);
+    enqueue(world, helpers.createInvocationMirror, compiler.globalDependencies);
     world.registerInvocation(
-        new UniverseSelector(compiler.noSuchMethodSelector, null));
+        new UniverseSelector(Selectors.noSuchMethod_, null));
   }
 
   void enableIsolateSupport(Enqueuer enqueuer) {
@@ -1319,15 +1433,14 @@
         Element element = find(isolateHelperLibrary, name);
         enqueuer.addToWorkList(element);
         compiler.globalDependencies.registerDependency(element);
+        helpersUsed.add(element.declaration);
       }
     } else {
       enqueuer.addToWorkList(find(isolateHelperLibrary, START_ROOT_ISOLATE));
     }
   }
 
-  bool isAssertMethod(Element element) => element == assertMethod;
-
-  void registerRequiredType(DartType type, Element enclosingElement) {
+  void registerRequiredType(DartType type) {
     // If [argument] has type variables or is a type variable, this method
     // registers a RTI dependency between the class where the type variable is
     // defined (that is the enclosing class of the current element being
@@ -1335,15 +1448,10 @@
     // then the class of the type variable does too.
     ClassElement contextClass = Types.getClassContext(type);
     if (contextClass != null) {
-      assert(contextClass == enclosingElement.enclosingClass.declaration);
       rti.registerRtiDependency(type.element, contextClass);
     }
   }
 
-  void registerClassUsingVariableExpression(ClassElement cls) {
-    rti.classesUsingTypeVariableExpression.add(cls);
-  }
-
   bool classNeedsRti(ClassElement cls) {
     return rti.classesNeedingRti.contains(cls.declaration) ||
         compiler.enabledRuntimeType;
@@ -1411,8 +1519,40 @@
     if (cls.declaration != cls.implementation) {
       helpersUsed.add(cls.implementation);
     }
-    cls.ensureResolved(compiler);
-    enqueuer.registerInstantiatedType(cls.rawType, registry);
+    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);
+    }
   }
 
   WorldImpact codegen(CodegenWorkItem work) {
@@ -1435,7 +1575,6 @@
           constants.getConstantValueForVariable(element);
       if (initialValue != null) {
         registerCompileTimeConstant(initialValue, work.registry);
-        constants.addCompileTimeConstantForEmission(initialValue);
         // We don't need to generate code for static or top-level
         // variables. For instance variables, we may need to generate
         // the checked setter.
@@ -1447,7 +1586,8 @@
         // 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(getCyclicThrowHelper());
+        compiler.enqueuer.codegen.registerStaticUse(
+            helpers.cyclicThrowHelper);
       }
     }
 
@@ -1464,6 +1604,7 @@
   }
 
   ClassElement defaultSuperclass(ClassElement element) {
+    if (element.isJsInterop) return jsJavaScriptObjectClass;
     // Native classes inherit from Interceptor.
     return element.isNative ? jsInterceptorClass : compiler.objectClass;
   }
@@ -1473,16 +1614,8 @@
    *
    * Invariant: [element] must be a declaration element.
    */
-  String assembleCode(Element element) {
+  String getGeneratedCode(Element element) {
     assert(invariant(element, element.isDeclaration));
-    var code = generatedCode[element];
-    if (namer is jsAst.TokenFinalizer) {
-      jsAst.TokenCounter counter = new jsAst.TokenCounter();
-      counter.countTokens(code);
-      // Avoid a warning.
-      var finalizer = namer;
-      finalizer.finalizeTokens();
-    }
     return jsAst.prettyPrint(generatedCode[element], compiler).getText();
   }
 
@@ -1493,27 +1626,28 @@
     if (totalMethodCount != preMirrorsMethodCount) {
       int mirrorCount = totalMethodCount - preMirrorsMethodCount;
       double percentage = (mirrorCount / totalMethodCount) * 100;
-      compiler.reportHint(
+      DiagnosticMessage hint = reporter.createMessage(
           compiler.mainApp, MessageKind.MIRROR_BLOAT,
           {'count': mirrorCount,
            'total': totalMethodCount,
            'percentage': percentage.round()});
+
+      List<DiagnosticMessage> infos = <DiagnosticMessage>[];
       for (LibraryElement library in compiler.libraryLoader.libraries) {
         if (library.isInternalLibrary) continue;
-        for (LibraryTag tag in library.tags) {
-          Import importTag = tag.asImport();
-          if (importTag == null) continue;
-          LibraryElement importedLibrary = library.getLibraryFromTag(tag);
+        for (ImportElement import in library.imports) {
+          LibraryElement importedLibrary = import.importedLibrary;
           if (importedLibrary != compiler.mirrorsLibrary) continue;
           MessageKind kind =
               compiler.mirrorUsageAnalyzerTask.hasMirrorUsage(library)
               ? MessageKind.MIRROR_IMPORT
               : MessageKind.MIRROR_IMPORT_NO_USAGE;
-          compiler.withCurrentElement(library, () {
-            compiler.reportInfo(importTag, kind);
+          reporter.withCurrentElement(library, () {
+            infos.add(reporter.createMessage(import, kind));
           });
         }
       }
+      reporter.reportHint(hint, infos);
     }
     return programSize;
   }
@@ -1713,213 +1847,6 @@
     return compiler.world.hasOnlySubclasses(classElement);
   }
 
-  Element getExceptionUnwrapper() {
-    return findHelper('unwrapException');
-  }
-
-  Element getThrowRuntimeError() {
-    return findHelper('throwRuntimeError');
-  }
-
-  Element getThrowTypeError() {
-    return findHelper('throwTypeError');
-  }
-
-  Element getThrowAbstractClassInstantiationError() {
-    return findHelper('throwAbstractClassInstantiationError');
-  }
-
-  Element getCheckConcurrentModificationError() {
-    if (cachedCheckConcurrentModificationError == null) {
-      cachedCheckConcurrentModificationError =
-          findHelper('checkConcurrentModificationError');
-    }
-    return cachedCheckConcurrentModificationError;
-  }
-
-  Element getThrowConcurrentModificationError() {
-    return findHelper('throwConcurrentModificationError');
-  }
-
-  Element getThrowIndexOutOfBoundsError() {
-    return findHelper('ioore');
-  }
-
-  Element getStringInterpolationHelper() {
-    return findHelper('S');
-  }
-
-  Element getWrapExceptionHelper() {
-    return findHelper(r'wrapException');
-  }
-
-  Element getThrowExpressionHelper() {
-    return findHelper('throwExpression');
-  }
-
-  Element getClosureConverter() {
-    return findHelper('convertDartClosureToJS');
-  }
-
-  Element getTraceFromException() {
-    return findHelper('getTraceFromException');
-  }
-
-  Element getSetRuntimeTypeInfo() {
-    return findHelper('setRuntimeTypeInfo');
-  }
-
-  Element getGetRuntimeTypeInfo() {
-    return findHelper('getRuntimeTypeInfo');
-  }
-
-  Element getGetTypeArgumentByIndex() {
-    return findHelper('getTypeArgumentByIndex');
-  }
-
-  Element getCopyTypeArguments() {
-    return findHelper('copyTypeArguments');
-  }
-
-  Element getComputeSignature() {
-    return findHelper('computeSignature');
-  }
-
-  Element getGetRuntimeTypeArguments() {
-    return findHelper('getRuntimeTypeArguments');
-  }
-
-  Element getGetRuntimeTypeArgument() {
-    return findHelper('getRuntimeTypeArgument');
-  }
-
-  Element getRuntimeTypeToString() {
-    return findHelper('runtimeTypeToString');
-  }
-
-  Element getAssertIsSubtype() {
-    return findHelper('assertIsSubtype');
-  }
-
-  Element getCheckSubtype() {
-    return findHelper('checkSubtype');
-  }
-
-  Element getAssertSubtype() {
-    return findHelper('assertSubtype');
-  }
-
-  Element getSubtypeCast() {
-    return findHelper('subtypeCast');
-  }
-
-  Element getCheckSubtypeOfRuntimeType() {
-    return findHelper('checkSubtypeOfRuntimeType');
-  }
-
-  Element getAssertSubtypeOfRuntimeType() {
-    return findHelper('assertSubtypeOfRuntimeType');
-  }
-
-  Element getSubtypeOfRuntimeTypeCast() {
-    return findHelper('subtypeOfRuntimeTypeCast');
-  }
-
-  Element getCheckDeferredIsLoaded() {
-    return findHelper('checkDeferredIsLoaded');
-  }
-
-  Element getThrowNoSuchMethod() {
-    return findHelper('throwNoSuchMethod');
-  }
-
-  Element getCreateRuntimeType() {
-    return findHelper('createRuntimeType');
-  }
-
-  Element getFallThroughError() {
-    return findHelper("getFallThroughError");
-  }
-
-  Element getCreateInvocationMirror() {
-    return findHelper(Compiler.CREATE_INVOCATION_MIRROR);
-  }
-
-  Element getCyclicThrowHelper() {
-    return findHelper("throwCyclicInit");
-  }
-
-  Element getAsyncHelper() {
-    return findHelper("asyncHelper");
-  }
-
-  Element getYieldStar() {
-    ClassElement classElement = findHelper("IterationMarker");
-    classElement.ensureResolved(compiler);
-    return classElement.lookupLocalMember("yieldStar");
-  }
-
-  Element getYieldSingle() {
-    ClassElement classElement = findHelper("IterationMarker");
-    classElement.ensureResolved(compiler);
-    return classElement.lookupLocalMember("yieldSingle");
-  }
-
-  Element getSyncStarUncaughtError() {
-    ClassElement classElement = findHelper("IterationMarker");
-    classElement.ensureResolved(compiler);
-    return classElement.lookupLocalMember("uncaughtError");
-  }
-
-  Element getAsyncStarHelper() {
-    return findHelper("asyncStarHelper");
-  }
-
-  Element getStreamOfController() {
-    return findHelper("streamOfController");
-  }
-
-  Element getEndOfIteration() {
-    ClassElement classElement = findHelper("IterationMarker");
-    classElement.ensureResolved(compiler);
-    return classElement.lookupLocalMember("endOfIteration");
-  }
-
-  Element getSyncStarIterable() {
-    ClassElement classElement = findHelper("SyncStarIterable");
-    classElement.ensureResolved(compiler);
-    return classElement;
-  }
-
-  Element getSyncStarIterableConstructor() {
-    ClassElement classElement = getSyncStarIterable();
-    classElement.ensureResolved(compiler);
-    return classElement.lookupConstructor("");
-  }
-
-  Element getCompleterConstructor() {
-    ClassElement classElement = find(compiler.asyncLibrary, "Completer");
-    classElement.ensureResolved(compiler);
-    return classElement.lookupConstructor("");
-  }
-
-  Element getASyncStarController() {
-    ClassElement classElement = findHelper("AsyncStarStreamController");
-    classElement.ensureResolved(compiler);
-    return classElement;
-  }
-
-  Element getASyncStarControllerConstructor() {
-    ClassElement classElement = getASyncStarController();
-    return classElement.lookupConstructor("");
-  }
-
-  Element getStreamIteratorConstructor() {
-    ClassElement classElement = find(compiler.asyncLibrary, "StreamIterator");
-    classElement.ensureResolved(compiler);
-    return classElement.lookupConstructor("");
-  }
-
   bool isNullImplementation(ClassElement cls) {
     return cls == jsNullClass;
   }
@@ -1970,7 +1897,7 @@
   }
 
   /// Called when [:const Symbol(name):] is seen.
-  void registerConstSymbol(String name, Registry registry) {
+  void registerConstSymbol(String name) {
     symbolsUsed.add(name);
     if (name.endsWith('=')) {
       symbolsUsed.add(name.substring(0, name.length - 1));
@@ -2004,7 +1931,7 @@
     if (mustRetainMetadata) hasRetainedMetadata = true;
     if (mustRetainMetadata && referencedFromMirrorSystem(element)) {
       for (MetadataAnnotation metadata in element.metadata) {
-        metadata.ensureResolved(compiler);
+        metadata.ensureResolved(resolution);
         ConstantValue constant =
             constants.getConstantValueForMetadata(metadata);
         constants.addCompileTimeConstantForEmission(constant);
@@ -2018,7 +1945,9 @@
     Uri uri = library.canonicalUri;
     if (uri == DART_JS_HELPER) {
       jsHelperLibrary = library;
-    } else if (uri == DART_INTERNAL) {
+    } else if (uri == Uris.dart_async) {
+      asyncLibrary = library;
+    } else if (uri == Uris.dart__internal) {
       internalLibrary = library;
     } else if (uri ==  DART_INTERCEPTORS) {
       interceptorsLibrary = library;
@@ -2042,7 +1971,7 @@
     boundClosureClass = lookupHelperClass('BoundClosure');
     closureClass = lookupHelperClass('Closure');
     if (!missingHelperClasses.isEmpty) {
-      compiler.internalError(jsHelperLibrary,
+      reporter.internalError(jsHelperLibrary,
           'dart:_js_helper library does not contain required classes: '
           '$missingHelperClasses');
     }
@@ -2050,7 +1979,10 @@
 
   Future onLibraryScanned(LibraryElement library, LibraryLoader loader) {
     return super.onLibraryScanned(library, loader).then((_) {
-      if (library.isPlatformLibrary && !library.isPatched) {
+      if (library.isPlatformLibrary &&
+          // Don't patch library currently disallowed.
+          !library.isSynthesized &&
+          !library.isPatched) {
         // Apply patch, if any.
         Uri patchUri = compiler.resolvePatchUri(library.canonicalUri.path);
         if (patchUri != null) {
@@ -2089,12 +2021,17 @@
         jsExtendableArrayClass = findClass('JSExtendableArray');
         jsUnmodifiableArrayClass = findClass('JSUnmodifiableArray');
         jsPlainJavaScriptObjectClass = findClass('PlainJavaScriptObject');
+        jsJavaScriptObjectClass = findClass('JavaScriptObject');
+        jsJavaScriptFunctionClass = findClass('JavaScriptFunction');
         jsUnknownJavaScriptObjectClass = findClass('UnknownJavaScriptObject');
         jsIndexableClass = findClass('JSIndexable');
         jsMutableIndexableClass = findClass('JSMutableIndexable');
       } else if (uri == DART_JS_HELPER) {
         initializeHelperClasses();
-        assertMethod = findHelper('assertHelper');
+        helpers.assertTest = findHelper('assertTest');
+        helpers.assertThrow = findHelper('assertThrow');
+        helpers.assertHelper = findHelper('assertHelper');
+        assertUnreachableMethod = findHelper('assertUnreachable');
 
         typeLiteralClass = findClass('TypeImpl');
         constMapLiteralClass = findClass('ConstantMap');
@@ -2121,24 +2058,32 @@
       } else if (uri == DART_EMBEDDED_NAMES) {
         jsGetNameEnum = find(library, 'JsGetName');
         jsBuiltinEnum = find(library, 'JsBuiltin');
-      } else if (uri == DART_HTML) {
+      } else if (uri == Uris.dart_html) {
         htmlLibraryIsLoaded = true;
+      } else if (uri == PACKAGE_LOOKUP_MAP) {
+        lookupMapAnalysis.init(library);
+      } else if (uri == Uris.dart__native_typed_data) {
+        typedArrayClass = findClass('NativeTypedArray');
+        typedArrayOfIntClass = findClass('NativeTypedArrayOfInt');
+      } else if (uri == PACKAGE_JS) {
+        jsAnnotationClass = find(library, 'JS');
+        jsAnonymousClass = find(library, '_Anonymous');
       }
       annotations.onLibraryScanned(library);
     });
   }
 
   Future onLibrariesLoaded(LoadedLibraries loadedLibraries) {
-    if (!loadedLibraries.containsLibrary(Compiler.DART_CORE)) {
+    if (!loadedLibraries.containsLibrary(Uris.dart_core)) {
       return new Future.value();
     }
 
-    assert(loadedLibraries.containsLibrary(Compiler.DART_CORE));
+    assert(loadedLibraries.containsLibrary(Uris.dart_core));
     assert(loadedLibraries.containsLibrary(DART_INTERCEPTORS));
     assert(loadedLibraries.containsLibrary(DART_JS_HELPER));
 
     if (jsInvocationMirrorClass != null) {
-      jsInvocationMirrorClass.ensureResolved(compiler);
+      jsInvocationMirrorClass.ensureResolved(resolution);
       invokeOnMethod = jsInvocationMirrorClass.lookupLocalMember(INVOKE_ON);
     }
 
@@ -2164,16 +2109,16 @@
     // subclasses, so we check to see if they are defined before
     // trying to resolve them.
     if (jsFixedArrayClass != null) {
-      jsFixedArrayClass.ensureResolved(compiler);
+      jsFixedArrayClass.ensureResolved(resolution);
     }
     if (jsExtendableArrayClass != null) {
-      jsExtendableArrayClass.ensureResolved(compiler);
+      jsExtendableArrayClass.ensureResolved(resolution);
     }
     if (jsUnmodifiableArrayClass != null) {
-      jsUnmodifiableArrayClass.ensureResolved(compiler);
+      jsUnmodifiableArrayClass.ensureResolved(resolution);
     }
 
-    jsIndexableClass.ensureResolved(compiler);
+    jsIndexableClass.ensureResolved(resolution);
     jsIndexableLength = compiler.lookupElementIn(
         jsIndexableClass, 'length');
     if (jsIndexableLength != null && jsIndexableLength.isAbstractField) {
@@ -2181,12 +2126,12 @@
       jsIndexableLength = element.getter;
     }
 
-    jsArrayClass.ensureResolved(compiler);
+    jsArrayClass.ensureResolved(resolution);
     jsArrayTypedConstructor = compiler.lookupElementIn(jsArrayClass, 'typed');
     jsArrayRemoveLast = compiler.lookupElementIn(jsArrayClass, 'removeLast');
     jsArrayAdd = compiler.lookupElementIn(jsArrayClass, 'add');
 
-    jsStringClass.ensureResolved(compiler);
+    jsStringClass.ensureResolved(resolution);
     jsStringSplit = compiler.lookupElementIn(jsStringClass, 'split');
     jsStringOperatorAdd = compiler.lookupElementIn(jsStringClass, '+');
     jsStringToString = compiler.lookupElementIn(jsStringClass, 'toString');
@@ -2276,12 +2221,11 @@
    */
   bool matchesMirrorsMetaTarget(Element element) {
     if (metaTargetsUsed.isEmpty) return false;
-    for (Link link = element.metadata; !link.isEmpty; link = link.tail) {
-      MetadataAnnotation metadata = link.head;
+    for (MetadataAnnotation metadata in element.metadata) {
       // TODO(kasperl): It would be nice if we didn't have to resolve
       // all metadata but only stuff that potentially would match one
       // of the used meta targets.
-      metadata.ensureResolved(compiler);
+      metadata.ensureResolved(resolution);
       ConstantValue value =
           compiler.constants.getConstantValue(metadata.constant);
       if (value == null) continue;
@@ -2329,13 +2273,13 @@
         reflectableMembers.add(cls);
         // 2) its constructors (if resolved)
         cls.constructors.forEach((Element constructor) {
-          if (resolution.hasBeenResolved(constructor)) {
+          if (resolution.hasBeenProcessed(constructor)) {
             reflectableMembers.add(constructor);
           }
         });
         // 3) all members, including fields via getter/setters (if resolved)
         cls.forEachClassMember((Member member) {
-          if (resolution.hasBeenResolved(member.element)) {
+          if (resolution.hasBeenProcessed(member.element)) {
             memberNames.add(member.name);
             reflectableMembers.add(member.element);
           }
@@ -2347,8 +2291,8 @@
               if (memberNames.contains(member.name)) {
                 // TODO(20993): find out why this assertion fails.
                 // assert(invariant(member.element,
-                //    resolution.hasBeenResolved(member.element)));
-                if (resolution.hasBeenResolved(member.element)) {
+                //    resolution.hasBeenProcessed(member.element)));
+                if (resolution.hasBeenProcessed(member.element)) {
                   reflectableMembers.add(member.element);
                 }
               }
@@ -2364,13 +2308,13 @@
       } else {
         // check members themselves
         cls.constructors.forEach((ConstructorElement element) {
-          if (!resolution.hasBeenResolved(element)) return;
+          if (!resolution.hasBeenProcessed(element)) return;
           if (referencedFromMirrorSystem(element, false)) {
             reflectableMembers.add(element);
           }
         });
         cls.forEachClassMember((Member member) {
-          if (!resolution.hasBeenResolved(member.element)) return;
+          if (!resolution.hasBeenProcessed(member.element)) return;
           if (referencedFromMirrorSystem(member.element, false)) {
             reflectableMembers.add(member.element);
           }
@@ -2395,7 +2339,7 @@
       if (lib.isInternalLibrary) continue;
       lib.forEachLocalMember((Element member) {
         if (!member.isClass &&
-            resolution.hasBeenResolved(member) &&
+            resolution.hasBeenProcessed(member) &&
             referencedFromMirrorSystem(member)) {
           reflectableMembers.add(member);
         }
@@ -2548,18 +2492,27 @@
       enqueuer.enqueueReflectiveStaticFields(_findStaticFieldTargets());
     }
 
-    if (mustPreserveNames) compiler.log('Preserving names.');
+    if (mustPreserveNames) reporter.log('Preserving names.');
 
     if (mustRetainMetadata) {
-      compiler.log('Retaining metadata.');
+      reporter.log('Retaining metadata.');
 
       compiler.libraryLoader.libraries.forEach(retainMetadataOf);
-      if (!enqueuer.isResolutionQueue) {
+      if (enqueuer.isResolutionQueue) {
+        for (Dependency dependency in metadataConstants) {
+          registerCompileTimeConstant(
+              dependency.constant,
+              new EagerRegistry(compiler,
+                  dependency.annotatedElement.analyzableElement.treeElements),
+              addForEmission: false);
+        }
+      } else {
         for (Dependency dependency in metadataConstants) {
           registerCompileTimeConstant(
               dependency.constant,
               new CodegenRegistry(compiler,
-                  dependency.annotatedElement.analyzableElement.treeElements));
+                  dependency.annotatedElement.analyzableElement.treeElements),
+              addForEmission: false);
         }
         metadataConstants.clear();
       }
@@ -2567,6 +2520,15 @@
     return true;
   }
 
+  void onQueueClosed() {
+    lookupMapAnalysis.onQueueClosed();
+    jsInteropAnalysis.onQueueClosed();
+  }
+
+  void onCodegenStart() {
+    lookupMapAnalysis.onCodegenStart();
+  }
+
   void onElementResolved(Element element, TreeElements elements) {
     if ((element.isFunction || element.isGenerativeConstructor) &&
         annotations.noInline(element)) {
@@ -2579,8 +2541,8 @@
     bool hasForceInline = false;
     bool hasNoThrows = false;
     bool hasNoSideEffects = false;
-    for (MetadataAnnotation metadata in element.metadata) {
-      metadata.ensureResolved(compiler);
+    for (MetadataAnnotation metadata in element.implementation.metadata) {
+      metadata.ensureResolved(resolution);
       ConstantValue constantValue =
           compiler.constants.getConstantValue(metadata.constant);
       if (!constantValue.isConstructedObject) continue;
@@ -2589,7 +2551,8 @@
       if (cls == forceInlineClass) {
         hasForceInline = true;
         if (VERBOSE_OPTIMIZER_HINTS) {
-          compiler.reportHint(element,
+          reporter.reportHintMessage(
+              element,
               MessageKind.GENERIC,
               {'text': "Must inline"});
         }
@@ -2597,7 +2560,8 @@
       } else if (cls == noInlineClass) {
         hasNoInline = true;
         if (VERBOSE_OPTIMIZER_HINTS) {
-          compiler.reportHint(element,
+          reporter.reportHintMessage(
+              element,
               MessageKind.GENERIC,
               {'text': "Cannot inline"});
         }
@@ -2605,12 +2569,13 @@
       } else if (cls == noThrowsClass) {
         hasNoThrows = true;
         if (!Elements.isStaticOrTopLevelFunction(element)) {
-          compiler.internalError(element,
+          reporter.internalError(element,
               "@NoThrows() is currently limited to top-level"
               " or static functions");
         }
         if (VERBOSE_OPTIMIZER_HINTS) {
-          compiler.reportHint(element,
+          reporter.reportHintMessage(
+              element,
               MessageKind.GENERIC,
               {'text': "Cannot throw"});
         }
@@ -2618,7 +2583,8 @@
       } else if (cls == noSideEffectsClass) {
         hasNoSideEffects = true;
         if (VERBOSE_OPTIMIZER_HINTS) {
-          compiler.reportHint(element,
+          reporter.reportHintMessage(
+              element,
               MessageKind.GENERIC,
               {'text': "Has no side effects"});
         }
@@ -2626,15 +2592,15 @@
       }
     }
     if (hasForceInline && hasNoInline) {
-      compiler.internalError(element,
+      reporter.internalError(element,
           "@ForceInline() must not be used with @NoInline.");
     }
     if (hasNoThrows && !hasNoInline) {
-      compiler.internalError(element,
+      reporter.internalError(element,
           "@NoThrows() should always be combined with @NoInline.");
     }
     if (hasNoSideEffects && !hasNoInline) {
-      compiler.internalError(element,
+      reporter.internalError(element,
           "@NoSideEffects() should always be combined with @NoInline.");
     }
     if (element == invokeOnMethod) {
@@ -2688,31 +2654,29 @@
                            Enqueuer enqueuer,
                            Registry registry) {
     if (element.asyncMarker == AsyncMarker.ASYNC) {
-      enqueue(enqueuer, getAsyncHelper(), registry);
-      enqueue(enqueuer, getCompleterConstructor(), registry);
-      enqueue(enqueuer, getStreamIteratorConstructor(), registry);
+      _registerAsync(enqueuer, registry);
     } else if (element.asyncMarker == AsyncMarker.SYNC_STAR) {
-      ClassElement clsSyncStarIterable = getSyncStarIterable();
-      clsSyncStarIterable.ensureResolved(compiler);
-      enqueuer.registerInstantiatedType(clsSyncStarIterable.rawType, registry);
-      enqueue(enqueuer, getSyncStarIterableConstructor(), registry);
-      enqueue(enqueuer, getEndOfIteration(), registry);
-      enqueue(enqueuer, getYieldStar(), registry);
-      enqueue(enqueuer, getSyncStarUncaughtError(), registry);
+      _registerSyncStar(enqueuer, registry);
     } else if (element.asyncMarker == AsyncMarker.ASYNC_STAR) {
-      ClassElement clsASyncStarController = getASyncStarController();
-      clsASyncStarController.ensureResolved(compiler);
-      enqueuer.registerInstantiatedType(
-          clsASyncStarController.rawType, registry);
-      enqueue(enqueuer, getAsyncStarHelper(), registry);
-      enqueue(enqueuer, getStreamOfController(), registry);
-      enqueue(enqueuer, getYieldSingle(), registry);
-      enqueue(enqueuer, getYieldStar(), registry);
-      enqueue(enqueuer, getASyncStarControllerConstructor(), registry);
-      enqueue(enqueuer, getStreamIteratorConstructor(), registry);
+      _registerAsyncStar(enqueuer, registry);
     }
   }
 
+  void _registerAsync(Enqueuer enqueuer,
+                      Registry registry) {
+    enqueueImpact(enqueuer, impacts.asyncBody, registry);
+  }
+
+  void _registerSyncStar(Enqueuer enqueuer,
+                         Registry registry) {
+    enqueueImpact(enqueuer, impacts.syncStarBody, registry);
+  }
+
+  void _registerAsyncStar(Enqueuer enqueuer,
+                          Registry registry) {
+    enqueueImpact(enqueuer, impacts.asyncStarBody, registry);
+  }
+
   @override
   bool enableDeferredLoadingIfSupported(Spannable node, Registry registry) {
     registerCheckDeferredIsLoaded(registry);
@@ -2722,7 +2686,7 @@
   @override
   bool enableCodegenWithErrorsIfSupported(Spannable node) {
     if (compiler.useCpsIr) {
-      compiler.reportHint(
+      reporter.reportHintMessage(
           node,
           MessageKind.GENERIC,
           {'text': "Generation of code with compile time errors is currently "
@@ -2731,6 +2695,65 @@
     }
     return true;
   }
+
+  jsAst.Expression rewriteAsync(FunctionElement element,
+                                jsAst.Expression code) {
+    AsyncRewriterBase rewriter = null;
+    jsAst.Name name = namer.methodPropertyName(element);
+    switch (element.asyncMarker) {
+      case AsyncMarker.ASYNC:
+        rewriter = new AsyncRewriter(
+            reporter,
+            element,
+            asyncHelper:
+                emitter.staticFunctionAccess(helpers.asyncHelper),
+            wrapBody:
+                emitter.staticFunctionAccess(helpers.wrapBody),
+            newCompleter: emitter.staticFunctionAccess(
+                helpers.syncCompleterConstructor),
+            safeVariableName: namer.safeVariablePrefixForAsyncRewrite,
+            bodyName: namer.deriveAsyncBodyName(name));
+        break;
+      case AsyncMarker.SYNC_STAR:
+        rewriter = new SyncStarRewriter(
+            reporter,
+            element,
+            endOfIteration: emitter.staticFunctionAccess(
+                helpers.endOfIteration),
+            newIterable: emitter.staticFunctionAccess(
+                helpers.syncStarIterableConstructor),
+            yieldStarExpression: emitter.staticFunctionAccess(
+                helpers.yieldStar),
+            uncaughtErrorExpression: emitter.staticFunctionAccess(
+                helpers.syncStarUncaughtError),
+            safeVariableName: namer.safeVariablePrefixForAsyncRewrite,
+            bodyName: namer.deriveAsyncBodyName(name));
+         break;
+      case AsyncMarker.ASYNC_STAR:
+        rewriter = new AsyncStarRewriter(
+            reporter,
+            element,
+            asyncStarHelper: emitter.staticFunctionAccess(
+                helpers.asyncStarHelper),
+            streamOfController: emitter.staticFunctionAccess(
+                helpers.streamOfController),
+            wrapBody:
+                emitter.staticFunctionAccess(helpers.wrapBody),
+            newController: emitter.staticFunctionAccess(
+                helpers.asyncStarControllerConstructor),
+            safeVariableName: namer.safeVariablePrefixForAsyncRewrite,
+            yieldExpression: emitter.staticFunctionAccess(
+                helpers.yieldSingle),
+            yieldStarExpression: emitter.staticFunctionAccess(
+                helpers.yieldStar),
+            bodyName: namer.deriveAsyncBodyName(name));
+        break;
+      default:
+        assert(element.asyncMarker == AsyncMarker.SYNC);
+        return code;
+    }
+    return rewriter.rewrite(code);
+  }
 }
 
 /// Handling of special annotations for tests.
@@ -2744,6 +2767,10 @@
   ClassElement expectTrustTypeAnnotationsClass;
   ClassElement expectAssumeDynamicClass;
 
+  JavaScriptBackend get backend => compiler.backend;
+
+  DiagnosticReporter get reporter => compiler.reporter;
+
   Annotations(this.compiler);
 
   void onLibraryScanned(LibraryElement library) {
@@ -2764,8 +2791,11 @@
 
   /// Returns `true` if inlining is disabled for [element].
   bool noInline(Element element) {
-    // TODO(floitsch): restrict to test directory.
-    return _hasAnnotation(element, expectNoInlineClass);
+    if (_hasAnnotation(element, expectNoInlineClass)) {
+      // TODO(floitsch): restrict to elements from the test directory.
+      return true;
+    }
+    return _hasAnnotation(element, backend.noInlineClass);
   }
 
   /// Returns `true` if parameter and returns types should be trusted for
@@ -2782,19 +2812,21 @@
   /// Returns `true` if [element] is annotated with [annotationClass].
   bool _hasAnnotation(Element element, ClassElement annotationClass) {
     if (annotationClass == null) return false;
-    for (Link<MetadataAnnotation> link = element.metadata;
-         !link.isEmpty;
-         link = link.tail) {
-      ConstantValue value =
-          compiler.constants.getConstantValue(link.head.constant);
-      if (value.isConstructedObject) {
-        ConstructedConstantValue constructedConstant = value;
-        if (constructedConstant.type.element == annotationClass) {
-          return true;
+    return reporter.withCurrentElement(element, () {
+      for (MetadataAnnotation metadata in element.metadata) {
+        assert(invariant(metadata, metadata.constant != null,
+            message: "Unevaluated metadata constant."));
+        ConstantValue value =
+            compiler.constants.getConstantValue(metadata.constant);
+        if (value.isConstructedObject) {
+          ConstructedConstantValue constructedConstant = value;
+          if (constructedConstant.type.element == annotationClass) {
+            return true;
+          }
         }
       }
-    }
-    return false;
+      return false;
+    });
   }
 }
 
@@ -2803,214 +2835,212 @@
 
   JavaScriptResolutionCallbacks(this.backend);
 
-  void registerBackendStaticInvocation(Element element, Registry registry) {
-    registry.registerStaticInvocation(backend.registerBackendUse(element));
-  }
+  BackendImpacts get impacts => backend.impacts;
 
-  void registerBackendInstantiation(ClassElement element, Registry registry) {
-    backend.registerBackendUse(element);
-    element.ensureResolved(backend.compiler);
-    registry.registerInstantiation(element.rawType);
-  }
-
-  void onAssert(Send node, Registry registry) {
-    registerBackendStaticInvocation(backend.assertMethod, registry);
-  }
-
-  void onAsyncForIn(AsyncForIn node, Registry registry) {
-    registerBackendStaticInvocation(backend.getStreamIteratorConstructor(),
-                                    registry);
-  }
-
-  void onStringInterpolation(Registry registry) {
-    assert(registry.isForResolution);
-    registerBackendStaticInvocation(
-        backend.getStringInterpolationHelper(), registry);
-  }
-
-  void onCatchStatement(Registry registry) {
-    assert(registry.isForResolution);
-    registerBackendStaticInvocation(backend.getExceptionUnwrapper(), registry);
-    registerBackendInstantiation(
-        backend.jsPlainJavaScriptObjectClass, registry);
-    registerBackendInstantiation(
-        backend.jsUnknownJavaScriptObjectClass, registry);
-  }
-
-  void onThrowExpression(Registry registry) {
-    assert(registry.isForResolution);
-    // 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.
-    registerBackendStaticInvocation(backend.getWrapExceptionHelper(), registry);
-    registerBackendStaticInvocation(
-        backend.getThrowExpressionHelper(), registry);
-  }
-
-  void onLazyField(Registry registry) {
-    assert(registry.isForResolution);
-    registerBackendStaticInvocation(backend.getCyclicThrowHelper(), registry);
-  }
-
-  void onTypeLiteral(DartType type, Registry registry) {
-    assert(registry.isForResolution);
-    registerBackendInstantiation(backend.typeImplementation, registry);
-    registerBackendStaticInvocation(backend.getCreateRuntimeType(), registry);
-    // TODO(ahe): Might want to register [element] as an instantiated class
-    // when reflection is used.  However, as long as we disable tree-shaking
-    // eagerly it doesn't matter.
-    if (type.isTypedef) {
-      backend.compiler.world.allTypedefs.add(type.element);
+  WorldImpact transformImpact(ResolutionImpact worldImpact) {
+    TransformedWorldImpact transformed =
+        new TransformedWorldImpact(worldImpact);
+    for (Feature feature in worldImpact.features) {
+      switch (feature) {
+        case Feature.ABSTRACT_CLASS_INSTANTIATION:
+          registerBackendImpact(
+              transformed, impacts.abstractClassInstantiation);
+          break;
+        case Feature.ASSERT:
+          registerBackendImpact(transformed, impacts.assertWithoutMessage);
+          break;
+        case Feature.ASSERT_WITH_MESSAGE:
+          registerBackendImpact(transformed, impacts.assertWithMessage);
+          break;
+        case Feature.ASYNC:
+          registerBackendImpact(transformed, impacts.asyncBody);
+          break;
+        case Feature.ASYNC_FOR_IN:
+          registerBackendImpact(transformed, impacts.asyncForIn);
+          break;
+        case Feature.ASYNC_STAR:
+          registerBackendImpact(transformed, impacts.asyncStarBody);
+          break;
+        case Feature.CATCH_STATEMENT:
+          registerBackendImpact(transformed, impacts.catchStatement);
+          break;
+        case Feature.COMPILE_TIME_ERROR:
+          if (backend.compiler.generateCodeWithCompileTimeErrors) {
+            // TODO(johnniwinther): This should have its own uncatchable error.
+            registerBackendImpact(transformed, impacts.throwRuntimeError);
+          }
+          break;
+        case Feature.FALL_THROUGH_ERROR:
+          registerBackendImpact(transformed, impacts.fallThroughError);
+          break;
+        case Feature.INC_DEC_OPERATION:
+          registerBackendImpact(transformed, impacts.incDecOperation);
+          break;
+        case Feature.LAZY_FIELD:
+          registerBackendImpact(transformed, impacts.lazyField);
+          break;
+        case Feature.STACK_TRACE_IN_CATCH:
+          registerBackendImpact(transformed, impacts.stackTraceInCatch);
+          break;
+        case Feature.STRING_INTERPOLATION:
+          registerBackendImpact(transformed, impacts.stringInterpolation);
+          break;
+        case Feature.SUPER_NO_SUCH_METHOD:
+          registerBackendImpact(transformed, impacts.superNoSuchMethod);
+          break;
+        case Feature.SYMBOL_CONSTRUCTOR:
+          registerBackendImpact(transformed, impacts.symbolConstructor);
+          break;
+        case Feature.SYNC_FOR_IN:
+          registerBackendImpact(transformed, impacts.syncForIn);
+          break;
+        case Feature.SYNC_STAR:
+          registerBackendImpact(transformed, impacts.syncStarBody);
+          break;
+        case Feature.THROW_EXPRESSION:
+          registerBackendImpact(transformed, impacts.throwExpression);
+          break;
+        case Feature.THROW_NO_SUCH_METHOD:
+          registerBackendImpact(transformed, impacts.throwNoSuchMethod);
+          break;
+        case Feature.THROW_RUNTIME_ERROR:
+          registerBackendImpact(transformed, impacts.throwRuntimeError);
+          break;
+        case Feature.TYPE_VARIABLE_BOUNDS_CHECK:
+          registerBackendImpact(transformed, impacts.typeVariableBoundCheck);
+          break;
+      }
     }
-    backend.customElementsAnalysis.registerTypeLiteral(type, registry);
+    for (DartType type in worldImpact.isChecks) {
+      onIsCheck(type, transformed);
+    }
+
+    if (worldImpact.asCasts.isNotEmpty) {
+      for (DartType type in worldImpact.asCasts) {
+        onIsCheck(type, transformed);
+      }
+      registerBackendImpact(transformed, impacts.asCheck);
+    }
+
+    if (backend.compiler.enableTypeAssertions) {
+      for (DartType type in worldImpact.checkedModeChecks) {
+        onIsCheck(type, transformed);
+      }
+    }
+
+    for (DartType requiredType in worldImpact.requiredTypes) {
+      backend.registerRequiredType(requiredType);
+    }
+
+    for (MapLiteralUse mapLiteralUse in worldImpact.mapLiterals) {
+      // TODO(johnniwinther): Use the [isEmpty] property when factory
+      // constructors are registered directly.
+      if (mapLiteralUse.isConstant) {
+        registerBackendImpact(transformed, impacts.constantMapLiteral);
+      } else {
+        transformed.registerInstantiatedType(mapLiteralUse.type);
+      }
+    }
+
+    for (ListLiteralUse listLiteralUse in worldImpact.listLiterals) {
+      // TODO(johnniwinther): Use the [isConstant] and [isEmpty] property when
+      // factory constructors are registered directly.
+      transformed.registerInstantiatedType(listLiteralUse.type);
+    }
+
+    if (worldImpact.typeLiterals.isNotEmpty) {
+      transformed.registerInstantiatedType(backend.compiler.coreTypes.typeType);
+      registerBackendImpact(transformed, impacts.typeLiteral);
+      for (DartType typeLiteral in worldImpact.typeLiterals) {
+        backend.customElementsAnalysis.registerTypeLiteral(typeLiteral);
+        if (typeLiteral.isTypedef) {
+          backend.compiler.world.allTypedefs.add(typeLiteral.element);
+        }
+        if (typeLiteral.isTypeVariable) {
+          ClassElement cls = typeLiteral.element.enclosingClass;
+          backend.rti.registerClassUsingTypeVariableExpression(cls);
+          registerBackendImpact(transformed, impacts.typeVariableExpression);
+        }
+      }
+    }
+
+    for (String constSymbolName in worldImpact.constSymbolNames) {
+      backend.registerConstSymbol(constSymbolName);
+    }
+
+    for (LocalFunctionElement closure in worldImpact.closures) {
+      if (closure.computeType(backend.resolution).containsTypeVariables) {
+        backend.compiler.enqueuer.resolution.universe
+            .closuresWithFreeTypeVariables.add(closure);
+        registerBackendImpact(transformed, impacts.computeSignature);
+      }
+    }
+    // TODO(johnniwinther): Remove this when dependency tracking is done on
+    // the world impact itself.
+    for (InterfaceType instantiatedType in worldImpact.instantiatedTypes) {
+      transformed.registerInstantiatedType(instantiatedType);
+    }
+    for (Element element in worldImpact.staticUses) {
+      transformed.registerStaticUse(element);
+    }
+
+    return transformed;
   }
 
-  void onStackTraceInCatch(Registry registry) {
-    assert(registry.isForResolution);
-    registerBackendStaticInvocation(backend.getTraceFromException(), registry);
-  }
-
-  void onSyncForIn(Registry registry) {
-    assert(registry.isForResolution);
-    // The SSA builder recognizes certain for-in loops and can generate calls to
-    // throwConcurrentModificationError.
-    registerBackendStaticInvocation(
-        backend.getCheckConcurrentModificationError(), registry);
-  }
-
-  void onTypeVariableExpression(Registry registry) {
-    assert(registry.isForResolution);
-    registerBackendStaticInvocation(backend.getSetRuntimeTypeInfo(), registry);
-    registerBackendStaticInvocation(backend.getGetRuntimeTypeInfo(), registry);
-    backend.registerGetRuntimeTypeArgument(registry);
-    registerBackendInstantiation(backend.compiler.listClass, registry);
-    registerBackendStaticInvocation(backend.getRuntimeTypeToString(), registry);
-    registerBackendStaticInvocation(backend.getCreateRuntimeType(), registry);
+  void registerBackendImpact(TransformedWorldImpact worldImpact,
+                             BackendImpact backendImpact) {
+    for (Element staticUse in backendImpact.staticUses) {
+      assert(staticUse != null);
+      backend.registerBackendUse(staticUse);
+      worldImpact.registerStaticUse(staticUse);
+    }
+    for (InterfaceType instantiatedType in backendImpact.instantiatedTypes) {
+      backend.registerBackendUse(instantiatedType.element);
+      worldImpact.registerInstantiatedType(instantiatedType);
+    }
+    for (ClassElement cls in backendImpact.instantiatedClasses) {
+      cls.ensureResolved(backend.resolution);
+      backend.registerBackendUse(cls);
+      worldImpact.registerInstantiatedType(cls.rawType);
+    }
+    for (BackendImpact otherImpact in backendImpact.otherImpacts) {
+      registerBackendImpact(worldImpact, otherImpact);
+    }
   }
 
   // TODO(johnniwinther): Maybe split this into [onAssertType] and [onTestType].
-  void onIsCheck(DartType type, Registry registry) {
-    assert(registry.isForResolution);
-    type = type.unalias(backend.compiler);
-    registerBackendInstantiation(backend.compiler.boolClass, registry);
+  void onIsCheck(DartType type, TransformedWorldImpact transformed) {
+    type.computeUnaliased(backend.resolution);
+    type = type.unaliased;
+    registerBackendImpact(transformed, impacts.typeCheck);
+
     bool inCheckedMode = backend.compiler.enableTypeAssertions;
     if (inCheckedMode) {
-      registerBackendStaticInvocation(backend.getThrowRuntimeError(), registry);
+      registerBackendImpact(transformed, impacts.checkedModeTypeCheck);
     }
     if (type.isMalformed) {
-      registerBackendStaticInvocation(backend.getThrowTypeError(), registry);
+      registerBackendImpact(transformed, impacts.malformedTypeCheck);
     }
     if (!type.treatAsRaw || type.containsTypeVariables || type.isFunctionType) {
-      // TODO(johnniwinther): Investigate why this is needed.
-      registerBackendStaticInvocation(
-          backend.getSetRuntimeTypeInfo(), registry);
-      registerBackendStaticInvocation(
-          backend.getGetRuntimeTypeInfo(), registry);
-      backend.registerGetRuntimeTypeArgument(registry);
+      registerBackendImpact(transformed, impacts.genericTypeCheck);
       if (inCheckedMode) {
-        registerBackendStaticInvocation(backend.getAssertSubtype(), registry);
+        registerBackendImpact(transformed, impacts.genericCheckedModeTypeCheck);
       }
-      registerBackendStaticInvocation(backend.getCheckSubtype(), registry);
       if (type.isTypeVariable) {
-        registerBackendStaticInvocation(
-            backend.getCheckSubtypeOfRuntimeType(), registry);
+        registerBackendImpact(transformed, impacts.typeVariableTypeCheck);
         if (inCheckedMode) {
-          registerBackendStaticInvocation(
-              backend.getAssertSubtypeOfRuntimeType(), registry);
+          registerBackendImpact(transformed,
+              impacts.typeVariableCheckedModeTypeCheck);
         }
       }
-      registerBackendInstantiation(backend.compiler.listClass, registry);
     }
     if (type is FunctionType) {
-      registerBackendStaticInvocation(
-          backend.find(backend.jsHelperLibrary, 'functionTypeTestMetaHelper'),
-          registry);
+      registerBackendImpact(transformed, impacts.functionTypeCheck);
     }
     if (type.element != null && type.element.isNative) {
-      // We will neeed to add the "$is" and "$as" properties on the
-      // JavaScript object prototype, so we make sure
-      // [:defineProperty:] is compiled.
-      registerBackendStaticInvocation(
-          backend.find(backend.jsHelperLibrary, 'defineProperty'), registry);
+      registerBackendImpact(transformed, impacts.nativeTypeCheck);
     }
   }
-
-  void onTypeVariableBoundCheck(Registry registry) {
-    assert(registry.isForResolution);
-    registerBackendStaticInvocation(backend.getThrowTypeError(), registry);
-    registerBackendStaticInvocation(backend.getAssertIsSubtype(), registry);
-  }
-
-  void onAbstractClassInstantiation(Registry registry) {
-    assert(registry.isForResolution);
-    registerBackendStaticInvocation(
-        backend.getThrowAbstractClassInstantiationError(), registry);
-    // Also register the types of the arguments passed to this method.
-    registerBackendInstantiation(backend.compiler.stringClass, registry);
-  }
-
-  void onFallThroughError(Registry registry) {
-    assert(registry.isForResolution);
-    registerBackendStaticInvocation(backend.getFallThroughError(), registry);
-  }
-
-  void onAsCheck(DartType type, Registry registry) {
-    assert(registry.isForResolution);
-    registerBackendStaticInvocation(backend.getThrowRuntimeError(), registry);
-  }
-
-  void onThrowNoSuchMethod(Registry registry) {
-    assert(registry.isForResolution);
-    registerBackendStaticInvocation(backend.getThrowNoSuchMethod(), registry);
-    // Also register the types of the arguments passed to this method.
-    registerBackendInstantiation(backend.compiler.listClass, registry);
-    registerBackendInstantiation(backend.compiler.stringClass, registry);
-  }
-
-  void onThrowRuntimeError(Registry registry) {
-    assert(registry.isForResolution);
-    registerBackendStaticInvocation(backend.getThrowRuntimeError(), registry);
-    // Also register the types of the arguments passed to this method.
-    registerBackendInstantiation(backend.compiler.stringClass, registry);
-  }
-
-  void onSuperNoSuchMethod(Registry registry) {
-    assert(registry.isForResolution);
-    registerBackendStaticInvocation(
-        backend.getCreateInvocationMirror(), registry);
-    registerBackendStaticInvocation(
-        backend.compiler.objectClass.lookupLocalMember(Compiler.NO_SUCH_METHOD),
-        registry);
-    registerBackendInstantiation(backend.compiler.listClass, registry);
-  }
-
-  void onMapLiteral(ResolutionRegistry registry,
-                    DartType type,
-                    bool isConstant) {
-    assert(registry.isForResolution);
-    void enqueue(String name) {
-      Element e = backend.find(backend.jsHelperLibrary, name);
-      registerBackendInstantiation(e, registry);
-    }
-
-    if (isConstant) {
-      enqueue(JavaScriptMapConstant.DART_CLASS);
-      enqueue(JavaScriptMapConstant.DART_PROTO_CLASS);
-      enqueue(JavaScriptMapConstant.DART_STRING_CLASS);
-      enqueue(JavaScriptMapConstant.DART_GENERAL_CLASS);
-    } else {
-      registry.registerInstantiatedType(type);
-    }
-  }
-
-  /// Called when resolving the `Symbol` constructor.
-  void onSymbolConstructor(Registry registry) {
-    assert(registry.isForResolution);
-    // Make sure that _internals.Symbol.validated is registered.
-    assert(backend.compiler.symbolValidatedConstructor != null);
-    registerBackendStaticInvocation(
-        backend.compiler.symbolValidatedConstructor, registry);
-  }
 }
 
 /// Records that [constant] is used by the element behind [registry].
@@ -3020,3 +3050,4 @@
 
   const Dependency(this.constant, this.annotatedElement);
 }
+
diff --git a/pkg/compiler/lib/src/js_backend/backend_helpers.dart b/pkg/compiler/lib/src/js_backend/backend_helpers.dart
new file mode 100644
index 0000000..3c59891
--- /dev/null
+++ b/pkg/compiler/lib/src/js_backend/backend_helpers.dart
@@ -0,0 +1,262 @@
+// 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 dart2js.js_backend.helpers;
+
+import '../common/resolution.dart' show
+    Resolution;
+import '../compiler.dart' show
+    Compiler;
+import '../elements/elements.dart' show
+    ClassElement,
+    Element,
+    LibraryElement,
+    MethodElement;
+
+import 'js_backend.dart';
+
+/// Helper classes and functions for the JavaScript backend.
+class BackendHelpers {
+  final Compiler compiler;
+
+  Element cachedCheckConcurrentModificationError;
+
+  BackendHelpers(this.compiler);
+
+  JavaScriptBackend get backend => compiler.backend;
+
+  Resolution get resolution => backend.resolution;
+
+  MethodElement assertTest;
+  MethodElement assertThrow;
+  MethodElement assertHelper;
+
+  Element findHelper(String name) => backend.findHelper(name);
+  Element findAsyncHelper(String name) => backend.findAsyncHelper(name);
+  Element findInterceptor(String name) => backend.findInterceptor(name);
+
+  Element find(LibraryElement library, String name) {
+    return backend.find(library, name);
+  }
+
+  Element get exceptionUnwrapper {
+    return findHelper('unwrapException');
+  }
+
+  Element get throwRuntimeError {
+    return findHelper('throwRuntimeError');
+  }
+
+  Element get throwTypeError {
+    return findHelper('throwTypeError');
+  }
+
+  Element get throwAbstractClassInstantiationError {
+    return findHelper('throwAbstractClassInstantiationError');
+  }
+
+  Element get checkConcurrentModificationError {
+    if (cachedCheckConcurrentModificationError == null) {
+      cachedCheckConcurrentModificationError =
+          findHelper('checkConcurrentModificationError');
+    }
+    return cachedCheckConcurrentModificationError;
+  }
+
+  Element get throwConcurrentModificationError {
+    return findHelper('throwConcurrentModificationError');
+  }
+
+  Element get throwIndexOutOfBoundsError {
+    return findHelper('ioore');
+  }
+
+  Element get stringInterpolationHelper {
+    return findHelper('S');
+  }
+
+  Element get wrapExceptionHelper {
+    return findHelper(r'wrapException');
+  }
+
+  Element get throwExpressionHelper {
+    return findHelper('throwExpression');
+  }
+
+  Element get closureConverter {
+    return findHelper('convertDartClosureToJS');
+  }
+
+  Element get traceFromException {
+    return findHelper('getTraceFromException');
+  }
+
+  Element get setRuntimeTypeInfo {
+    return findHelper('setRuntimeTypeInfo');
+  }
+
+  Element get getRuntimeTypeInfo {
+    return findHelper('getRuntimeTypeInfo');
+  }
+
+  Element get getTypeArgumentByIndex {
+    return findHelper('getTypeArgumentByIndex');
+  }
+
+  Element get copyTypeArguments {
+    return findHelper('copyTypeArguments');
+  }
+
+  Element get computeSignature {
+    return findHelper('computeSignature');
+  }
+
+  Element get getRuntimeTypeArguments {
+    return findHelper('getRuntimeTypeArguments');
+  }
+
+  Element get getRuntimeTypeArgument {
+    return findHelper('getRuntimeTypeArgument');
+  }
+
+  Element get runtimeTypeToString {
+    return findHelper('runtimeTypeToString');
+  }
+
+  Element get assertIsSubtype {
+    return findHelper('assertIsSubtype');
+  }
+
+  Element get checkSubtype {
+    return findHelper('checkSubtype');
+  }
+
+  Element get assertSubtype {
+    return findHelper('assertSubtype');
+  }
+
+  Element get subtypeCast {
+    return findHelper('subtypeCast');
+  }
+
+  Element get checkSubtypeOfRuntimeType {
+    return findHelper('checkSubtypeOfRuntimeType');
+  }
+
+  Element get assertSubtypeOfRuntimeType {
+    return findHelper('assertSubtypeOfRuntimeType');
+  }
+
+  Element get subtypeOfRuntimeTypeCast {
+    return findHelper('subtypeOfRuntimeTypeCast');
+  }
+
+  Element get checkDeferredIsLoaded {
+    return findHelper('checkDeferredIsLoaded');
+  }
+
+  Element get throwNoSuchMethod {
+    return findHelper('throwNoSuchMethod');
+  }
+
+  Element get createRuntimeType {
+    return findHelper('createRuntimeType');
+  }
+
+  Element get fallThroughError {
+    return findHelper("getFallThroughError");
+  }
+
+  Element get createInvocationMirror {
+    return findHelper(Compiler.CREATE_INVOCATION_MIRROR);
+  }
+
+  Element get cyclicThrowHelper {
+    return findHelper("throwCyclicInit");
+  }
+
+  Element get asyncHelper {
+    return findAsyncHelper("_asyncHelper");
+  }
+
+  Element get wrapBody {
+    return findAsyncHelper("_wrapJsFunctionForAsync");
+  }
+
+  Element get yieldStar {
+    ClassElement classElement = findAsyncHelper("_IterationMarker");
+    classElement.ensureResolved(resolution);
+    return classElement.lookupLocalMember("yieldStar");
+  }
+
+  Element get yieldSingle {
+    ClassElement classElement = findAsyncHelper("_IterationMarker");
+    classElement.ensureResolved(resolution);
+    return classElement.lookupLocalMember("yieldSingle");
+  }
+
+  Element get syncStarUncaughtError {
+    ClassElement classElement = findAsyncHelper("_IterationMarker");
+    classElement.ensureResolved(resolution);
+    return classElement.lookupLocalMember("uncaughtError");
+  }
+
+  Element get asyncStarHelper {
+    return findAsyncHelper("_asyncStarHelper");
+  }
+
+  Element get streamOfController {
+    return findAsyncHelper("_streamOfController");
+  }
+
+  Element get endOfIteration {
+    ClassElement classElement = findAsyncHelper("_IterationMarker");
+    classElement.ensureResolved(resolution);
+    return classElement.lookupLocalMember("endOfIteration");
+  }
+
+  Element get syncStarIterable {
+    ClassElement classElement = findAsyncHelper("_SyncStarIterable");
+    classElement.ensureResolved(resolution);
+    return classElement;
+  }
+
+  Element get syncStarIterableConstructor {
+    ClassElement classElement = syncStarIterable;
+    classElement.ensureResolved(resolution);
+    return classElement.lookupConstructor("");
+  }
+
+  Element get syncCompleterConstructor {
+    ClassElement classElement = find(compiler.asyncLibrary, "Completer");
+    classElement.ensureResolved(resolution);
+    return classElement.lookupConstructor("sync");
+  }
+
+  Element get asyncStarController {
+    ClassElement classElement =
+        findAsyncHelper("_AsyncStarStreamController");
+    classElement.ensureResolved(resolution);
+    return classElement;
+  }
+
+  Element get asyncStarControllerConstructor {
+    ClassElement classElement = asyncStarController;
+    return classElement.lookupConstructor("");
+  }
+
+  Element get streamIteratorConstructor {
+    ClassElement classElement = find(compiler.asyncLibrary, "StreamIterator");
+    classElement.ensureResolved(resolution);
+    return classElement.lookupConstructor("");
+  }
+
+  MethodElement get functionTypeTestMetaHelper {
+    return findHelper('functionTypeTestMetaHelper');
+  }
+
+  MethodElement get defineProperty {
+    return findHelper('defineProperty');
+  }
+}
\ No newline at end of file
diff --git a/pkg/compiler/lib/src/js_backend/backend_impact.dart b/pkg/compiler/lib/src/js_backend/backend_impact.dart
new file mode 100644
index 0000000..90dba81
--- /dev/null
+++ b/pkg/compiler/lib/src/js_backend/backend_impact.dart
@@ -0,0 +1,289 @@
+// 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 dart2js.js_helpers.impact;
+
+import '../common/names.dart' show
+    Identifiers;
+import '../compiler.dart' show
+    Compiler;
+import '../dart_types.dart' show
+    InterfaceType;
+import '../elements/elements.dart' show
+    ClassElement,
+    Element;
+
+import 'backend_helpers.dart';
+import 'constant_system_javascript.dart';
+import 'js_backend.dart';
+
+/// A set of JavaScript backend dependencies.
+class BackendImpact {
+  final List<Element> staticUses;
+  final List<InterfaceType> instantiatedTypes;
+  final List<ClassElement> instantiatedClasses;
+  final List<BackendImpact> otherImpacts;
+
+  BackendImpact({this.staticUses: const <Element>[],
+                 this.instantiatedTypes: const <InterfaceType>[],
+                 this.instantiatedClasses: const <ClassElement>[],
+                 this.otherImpacts: const <BackendImpact>[]});
+}
+
+/// The JavaScript backend dependencies for various features.
+class BackendImpacts {
+  final Compiler compiler;
+
+  BackendImpacts(this.compiler);
+
+  JavaScriptBackend get backend => compiler.backend;
+
+  BackendHelpers get helpers => backend.helpers;
+
+  BackendImpact get getRuntimeTypeArgument => new BackendImpact(
+      staticUses: [
+        helpers.getRuntimeTypeArgument,
+        helpers.getTypeArgumentByIndex,
+        helpers.copyTypeArguments]);
+
+  BackendImpact get computeSignature => new BackendImpact(
+      staticUses: [
+        helpers.setRuntimeTypeInfo,
+        helpers.getRuntimeTypeInfo,
+        helpers.computeSignature,
+        helpers.getRuntimeTypeArguments],
+      instantiatedClasses: [
+        compiler.listClass]);
+
+  BackendImpact get asyncBody => new BackendImpact(
+      staticUses: [
+        helpers.asyncHelper,
+        helpers.syncCompleterConstructor,
+        helpers.streamIteratorConstructor,
+        helpers.wrapBody]);
+
+  BackendImpact get syncStarBody => new BackendImpact(
+      staticUses: [
+        helpers.syncStarIterableConstructor,
+        helpers.endOfIteration,
+        helpers.yieldStar,
+        helpers.syncStarUncaughtError],
+      instantiatedClasses: [
+        helpers.syncStarIterable]);
+
+  BackendImpact get asyncStarBody => new BackendImpact(
+      staticUses: [
+        helpers.asyncStarHelper,
+        helpers.streamOfController,
+        helpers.yieldSingle,
+        helpers.yieldStar,
+        helpers.asyncStarControllerConstructor,
+        helpers.streamIteratorConstructor,
+        helpers.wrapBody],
+      instantiatedClasses: [
+        helpers.asyncStarController]);
+
+  BackendImpact get typeVariableBoundCheck => new BackendImpact(
+      staticUses: [
+        helpers.throwTypeError,
+        helpers.assertIsSubtype]);
+
+  BackendImpact get abstractClassInstantiation => new BackendImpact(
+      staticUses: [
+        helpers.throwAbstractClassInstantiationError],
+      otherImpacts: [
+        needsString('Needed to encode the message.')]);
+
+  BackendImpact get fallThroughError => new BackendImpact(
+      staticUses: [
+        helpers.fallThroughError]);
+
+  BackendImpact get asCheck => new BackendImpact(
+      staticUses: [
+        helpers.throwRuntimeError]);
+
+  BackendImpact get 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 get throwRuntimeError => new BackendImpact(
+      staticUses: [
+        helpers.throwRuntimeError],
+      // Also register the types of the arguments passed to this method.
+      instantiatedClasses: [
+        helpers.compiler.stringClass]);
+
+  BackendImpact get superNoSuchMethod => new BackendImpact(
+      staticUses: [
+        helpers.createInvocationMirror,
+        helpers.compiler.objectClass.lookupLocalMember(
+            Identifiers.noSuchMethod_)],
+      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 get constantMapLiteral {
+
+    ClassElement find(String name) {
+      return helpers.find(backend.jsHelperLibrary, name);
+    }
+
+    return new BackendImpact(
+      instantiatedClasses: [
+        find(JavaScriptMapConstant.DART_CLASS),
+        find(JavaScriptMapConstant.DART_PROTO_CLASS),
+        find(JavaScriptMapConstant.DART_STRING_CLASS),
+        find(JavaScriptMapConstant.DART_GENERAL_CLASS)]);
+  }
+
+  BackendImpact get symbolConstructor => new BackendImpact(
+      staticUses: [
+        helpers.compiler.symbolValidatedConstructor]);
+
+
+  BackendImpact get incDecOperation =>
+      needsInt('Needed for the `+ 1` or `- 1` operation of ++/--.');
+
+  /// Helper for registering that `int` is needed.
+  BackendImpact needsInt(String reason) {
+    // TODO(johnniwinther): Register [reason] for use in dump-info.
+    return new BackendImpact(
+        instantiatedClasses: [helpers.compiler.intClass]);
+  }
+
+  /// Helper for registering that `List` is needed.
+  BackendImpact needsList(String reason) {
+    // TODO(johnniwinther): Register [reason] for use in dump-info.
+    return new BackendImpact(
+        instantiatedClasses: [helpers.compiler.listClass]);
+  }
+
+  /// Helper for registering that `String` is needed.
+  BackendImpact needsString(String reason) {
+    // TODO(johnniwinther): Register [reason] for use in dump-info.
+    return new BackendImpact(
+        instantiatedClasses: [
+          helpers.compiler.stringClass]);
+  }
+
+  BackendImpact get assertWithoutMessage => new BackendImpact(
+      staticUses: [
+        helpers.assertHelper]);
+
+  BackendImpact get assertWithMessage => new BackendImpact(
+      staticUses: [
+        helpers.assertTest,
+        helpers.assertThrow]);
+
+  BackendImpact get asyncForIn => new BackendImpact(
+      staticUses: [
+        helpers.streamIteratorConstructor]);
+
+  BackendImpact get stringInterpolation => new BackendImpact(
+      staticUses: [
+        helpers.stringInterpolationHelper]);
+
+  BackendImpact get catchStatement => new BackendImpact(
+      staticUses: [
+        helpers.exceptionUnwrapper],
+      instantiatedClasses: [
+        backend.jsPlainJavaScriptObjectClass,
+        backend.jsUnknownJavaScriptObjectClass]);
+
+  BackendImpact get 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 get lazyField => new BackendImpact(
+      staticUses: [
+        helpers.cyclicThrowHelper]);
+
+  BackendImpact get typeLiteral => new BackendImpact(
+      instantiatedClasses: [
+        backend.typeImplementation],
+      staticUses: [
+        helpers.createRuntimeType]);
+
+  BackendImpact get stackTraceInCatch => new BackendImpact(
+      staticUses: [
+        helpers.traceFromException]);
+
+  BackendImpact get syncForIn => new BackendImpact(
+      // The SSA builder recognizes certain for-in loops and can generate calls
+      // to throwConcurrentModificationError.
+      staticUses: [
+        helpers.checkConcurrentModificationError]);
+
+  BackendImpact get typeVariableExpression => new BackendImpact(
+      staticUses: [
+        helpers.setRuntimeTypeInfo,
+        helpers.getRuntimeTypeInfo,
+        helpers.runtimeTypeToString,
+        helpers.createRuntimeType],
+      instantiatedClasses: [
+        helpers.compiler.listClass],
+      otherImpacts: [
+        getRuntimeTypeArgument,
+        needsInt('Needed for accessing a type variable literal on this.')]);
+
+  BackendImpact get typeCheck => new BackendImpact(
+      instantiatedClasses: [
+        helpers.compiler.boolClass]);
+
+  BackendImpact get checkedModeTypeCheck => new BackendImpact(
+      staticUses: [
+        helpers.throwRuntimeError]);
+
+  BackendImpact get malformedTypeCheck => new BackendImpact(
+      staticUses: [
+        helpers.throwTypeError]);
+
+  BackendImpact get genericTypeCheck => new BackendImpact(
+      staticUses: [
+        helpers.checkSubtype,
+        // TODO(johnniwinther): Investigate why this is needed.
+        helpers.setRuntimeTypeInfo,
+        helpers.getRuntimeTypeInfo],
+      instantiatedClasses: [
+        helpers.compiler.listClass],
+      otherImpacts: [
+        getRuntimeTypeArgument]);
+
+  BackendImpact get genericCheckedModeTypeCheck => new BackendImpact(
+      staticUses: [
+        helpers.assertSubtype]);
+
+  BackendImpact get typeVariableTypeCheck => new BackendImpact(
+      staticUses: [
+        helpers.checkSubtypeOfRuntimeType]);
+
+  BackendImpact get typeVariableCheckedModeTypeCheck => new BackendImpact(
+      staticUses: [
+        helpers.assertSubtypeOfRuntimeType]);
+
+  BackendImpact get functionTypeCheck => new BackendImpact(
+      staticUses: [
+        helpers.functionTypeTestMetaHelper]);
+
+  BackendImpact get 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]);
+}
\ No newline at end of file
diff --git a/pkg/compiler/lib/src/js_backend/codegen/codegen.dart b/pkg/compiler/lib/src/js_backend/codegen/codegen.dart
index f305c76..92852b7 100644
--- a/pkg/compiler/lib/src/js_backend/codegen/codegen.dart
+++ b/pkg/compiler/lib/src/js_backend/codegen/codegen.dart
@@ -6,18 +6,28 @@
 
 import 'glue.dart';
 
-import '../../tree_ir/tree_ir_nodes.dart' as tree_ir;
-import '../../tree_ir/tree_ir_nodes.dart' show BuiltinOperator;
-import '../../js/js.dart' as js;
-import '../../elements/elements.dart';
-import '../../io/source_information.dart' show SourceInformation;
-import '../../util/maplet.dart';
+import '../../closure.dart' show
+    ClosureClassElement;
+import '../../common.dart';
+import '../../common/codegen.dart' show
+    CodegenRegistry;
 import '../../constants/values.dart';
-import '../../dart2jslib.dart';
 import '../../dart_types.dart';
-import '../../types/types.dart' show TypeMask;
-import '../../universe/universe.dart' show UniverseSelector;
-import '../../closure.dart' show ClosureClassElement;
+import '../../elements/elements.dart';
+import '../../io/source_information.dart' show
+    SourceInformation;
+import '../../js/js.dart' as js;
+import '../../tree_ir/tree_ir_nodes.dart' as tree_ir;
+import '../../tree_ir/tree_ir_nodes.dart' show
+    BuiltinMethod,
+    BuiltinOperator;
+import '../../types/types.dart' show
+    TypeMask;
+import '../../universe/selector.dart' show
+    Selector;
+import '../../universe/universe.dart' show
+    UniverseSelector;
+import '../../util/maplet.dart';
 
 class CodegenBailout {
   final tree_ir.Node node;
@@ -104,6 +114,31 @@
       ++accumulatorIndex;
     }
 
+    // If the last statement is a for loop with an initializer expression, try
+    // to pull that expression into an initializer as well.
+    pullFromForLoop:
+    if (accumulatorIndex < accumulator.length &&
+        accumulator[accumulatorIndex] is js.For) {
+      js.For forLoop = accumulator[accumulatorIndex];
+      if (forLoop.init is! js.Assignment) break pullFromForLoop;
+      js.Assignment assign = forLoop.init;
+      if (assign.leftHandSide is! js.VariableUse) break pullFromForLoop;
+      if (assign.op != null) break pullFromForLoop; // Compound assignment.
+      js.VariableUse use = assign.leftHandSide;
+
+      // We cannot declare a variable more than once.
+      if (!declaredVariables.add(use.name)) break pullFromForLoop;
+
+      js.VariableInitialization jsVariable = new js.VariableInitialization(
+        new js.VariableDeclaration(use.name),
+        assign.value);
+      jsVariables.add(jsVariable);
+
+      // Remove the initializer from the for loop.
+      accumulator[accumulatorIndex] =
+          new js.For(null, forLoop.condition, forLoop.update, forLoop.body);
+    }
+
     // Discard the statements that were pulled in the initializer.
     if (accumulatorIndex > 0) {
       accumulator = accumulator.sublist(accumulatorIndex);
@@ -197,10 +232,6 @@
         sourceInformation: node.sourceInformation);
   }
 
-  js.Expression compileConstant(ParameterElement parameter) {
-    return buildConstant(glue.getConstantValueForVariable(parameter));
-  }
-
   js.Expression buildStaticInvoke(Element target,
                                   List<js.Expression> arguments,
                                   {SourceInformation sourceInformation}) {
@@ -331,12 +362,16 @@
       glue.registerIsCheck(type, registry);
       ClassElement clazz = type.element;
 
-      // Handle some special checks against classes that exist only in
-      // the compile-time class hierarchy, not at runtime.
-      if (clazz == glue.jsExtendableArrayClass) {
-        return js.js(r'!#.fixed$length', <js.Expression>[value]);
-      } else if (clazz == glue.jsMutableArrayClass) {
-        return js.js(r'!#.immutable$list', <js.Expression>[value]);
+      if (glue.isStringClass(clazz)) {
+        if (node.isTypeTest) {
+          return js.js(r'typeof # === "string"', <js.Expression>[value]);
+        }
+        // TODO(sra): Implement fast cast via calling 'stringTypeCast'.
+      } else if (glue.isBoolClass(clazz)) {
+        if (node.isTypeTest) {
+          return js.js(r'typeof # === "boolean"', <js.Expression>[value]);
+        }
+        // TODO(sra): Implement fast cast via calling 'boolTypeCast'.
       }
 
       // The helper we use needs the JSArray class to exist, but for some
@@ -386,6 +421,16 @@
   }
 
   @override
+  js.Expression visitGetTypeTestProperty(tree_ir.GetTypeTestProperty node) {
+    js.Expression object = visitExpression(node.object);
+    DartType dartType = node.dartType;
+    assert(dartType.isInterfaceType);
+    glue.registerIsCheck(dartType, registry);
+    js.Expression property = glue.getTypeTestTag(dartType);
+    return js.js(r'#.#', [object, property]);
+  }
+
+  @override
   js.Expression visitVariableUse(tree_ir.VariableUse node) {
     return buildVariableAccess(node.variable);
   }
@@ -512,17 +557,36 @@
     return result;
   }
 
+  js.Expression makeSequence(List<tree_ir.Expression> list) {
+    return list.map(visitExpression).reduce((x,y) => new js.Binary(',', x, y));
+  }
+
   @override
-  void visitWhileCondition(tree_ir.WhileCondition node) {
+  void visitFor(tree_ir.For node) {
     js.Expression condition = visitExpression(node.condition);
     shortBreak.push(node.next);
     shortContinue.push(node);
     fallthrough.push(node);
-    js.Statement jsBody = buildBodyStatement(node.body);
+    js.Statement body = buildBodyStatement(node.body);
     fallthrough.pop();
     shortContinue.pop();
     shortBreak.pop();
-    accumulator.add(insertLabel(node.label, new js.While(condition, jsBody)));
+    js.Statement loopNode;
+    if (node.updates.isEmpty) {
+      loopNode = new js.While(condition, body);
+    } else { // Compile as a for loop.
+      js.Expression init;
+      if (accumulator.isNotEmpty &&
+          accumulator.last is js.ExpressionStatement) {
+        // Take the preceding expression from the accumulator and use
+        // it as the initializer expression.
+        js.ExpressionStatement initStmt = accumulator.removeLast();
+        init = initStmt.expression;
+      }
+      js.Expression update = makeSequence(node.updates);
+      loopNode = new js.For(init, condition, update, body);
+    }
+    accumulator.add(insertLabel(node.label, loopNode));
     visitStatement(node.next);
   }
 
@@ -758,11 +822,13 @@
   @override
   js.Expression visitTypeExpression(tree_ir.TypeExpression node) {
     List<js.Expression> arguments = visitExpressionList(node.arguments);
-    return glue.generateTypeRepresentation(node.dartType, arguments);
+    return glue.generateTypeRepresentation(node.dartType, arguments, registry);
   }
 
   js.Node handleForeignCode(tree_ir.ForeignCode node) {
     registry.registerStaticUse(node.dependency);
+    // TODO(sra): Should this be in CodegenRegistry?
+    glue.registerNativeBehavior(node.nativeBehavior, node);
     return node.codeTemplate.instantiate(visitExpressionList(node.arguments));
   }
 
@@ -777,6 +843,12 @@
   }
 
   @override
+  void visitYield(tree_ir.Yield node) {
+    js.Expression value = visitExpression(node.input);
+    accumulator.add(new js.DartYield(value, node.hasStar));
+  }
+
+  @override
   js.Expression visitApplyBuiltinOperator(tree_ir.ApplyBuiltinOperator node) {
     List<js.Expression> args = visitExpressionList(node.arguments);
     switch (node.operator) {
@@ -786,12 +858,18 @@
         return new js.Binary('-', args[0], args[1]);
       case BuiltinOperator.NumMultiply:
         return new js.Binary('*', args[0], args[1]);
+      case BuiltinOperator.NumDivide:
+        return new js.Binary('/', args[0], args[1]);
+      case BuiltinOperator.NumRemainder:
+        return new js.Binary('%', args[0], args[1]);
+      case BuiltinOperator.NumTruncatingDivideToSigned32:
+        return js.js('(# / #) | 0', args);
       case BuiltinOperator.NumAnd:
-        return js.js('(# & #) >>> 0', args);
+        return normalizeBitOp(js.js('# & #', args), node);
       case BuiltinOperator.NumOr:
-        return js.js('(# | #) >>> 0', args);
+        return normalizeBitOp(js.js('# | #', args), node);
       case BuiltinOperator.NumXor:
-        return js.js('(# ^ #) >>> 0', args);
+        return normalizeBitOp(js.js('# ^ #', args), node);
       case BuiltinOperator.NumLt:
         return new js.Binary('<', args[0], args[1]);
       case BuiltinOperator.NumLe:
@@ -800,6 +878,11 @@
         return new js.Binary('>', args[0], args[1]);
       case BuiltinOperator.NumGe:
         return new js.Binary('>=', args[0], args[1]);
+      case BuiltinOperator.NumShl:
+        return normalizeBitOp(js.js('# << #', args), node);
+      case BuiltinOperator.NumShr:
+        // No normalization required since output is always uint32.
+        return js.js('# >>> #', args);
       case BuiltinOperator.StringConcatenate:
         if (args.isEmpty) return js.string('');
         return args.reduce((e1,e2) => new js.Binary('+', e1, e2));
@@ -817,16 +900,114 @@
       case BuiltinOperator.IsFalsy:
         return new js.Prefix('!', args[0]);
       case BuiltinOperator.IsNumber:
-        return js.js("typeof # === 'number'", args);
+        return js.js('typeof # === "number"', args);
       case BuiltinOperator.IsNotNumber:
-        return js.js("typeof # !== 'number'", args);
+        return js.js('typeof # !== "number"', args);
       case BuiltinOperator.IsFloor:
-        return js.js("Math.floor(#) === #", args);
+        return js.js('Math.floor(#) === #', args);
       case BuiltinOperator.IsNumberAndFloor:
-        return js.js("typeof # === 'number' && Math.floor(#) === #", args);
+        return js.js('typeof # === "number" && Math.floor(#) === #', args);
+      case BuiltinOperator.IsFixedLengthJSArray:
+        // TODO(sra): Remove boolify (i.e. !!).
+        return js.js(r'!!#.fixed$length', args);
+      case BuiltinOperator.IsExtendableJSArray:
+        return js.js(r'!#.fixed$length', args);
+      case BuiltinOperator.IsModifiableJSArray:
+        return js.js(r'!#.immutable$list', args);
+      case BuiltinOperator.IsUnmodifiableJSArray:
+        // TODO(sra): Remove boolify (i.e. !!).
+        return js.js(r'!!#.immutable$list', args);
     }
   }
 
+  /// Add a uint32 normalization `op >>> 0` to [op] if it is not in 31-bit
+  /// range.
+  js.Expression normalizeBitOp(js.Expression op,
+                               tree_ir.ApplyBuiltinOperator node) {
+    const MAX_UINT31 = 0x7fffffff;
+    const MAX_UINT32 = 0xffffffff;
+
+    int constantValue(tree_ir.Expression e) {
+      if (e is tree_ir.Constant) {
+        ConstantValue value = e.value;
+        if (!value.isInt) return null;
+        IntConstantValue intConstant = value;
+        if (intConstant.primitiveValue < 0) return null;
+        if (intConstant.primitiveValue > MAX_UINT32) return null;
+        return intConstant.primitiveValue;
+      }
+      return null;
+    }
+
+    /// Returns a value of the form 0b0001xxxx to represent the highest bit set
+    /// in the result.  This represents the range [0, 0b00011111], up to 32
+    /// bits.  `null` represents a result possibly outside the uint32 range.
+    int maxBitOf(tree_ir.Expression e) {
+      if (e is tree_ir.Constant) {
+        return constantValue(e);
+      }
+      if (e is tree_ir.ApplyBuiltinOperator) {
+        if (e.operator == BuiltinOperator.NumAnd) {
+          int left = maxBitOf(e.arguments[0]);
+          int right = maxBitOf(e.arguments[1]);
+          if (left == null && right == null) return MAX_UINT32;
+          if (left == null) return right;
+          if (right == null) return left;
+          return (left < right) ? left : right;
+        }
+        if (e.operator == BuiltinOperator.NumOr ||
+            e.operator == BuiltinOperator.NumXor) {
+          int left = maxBitOf(e.arguments[0]);
+          int right = maxBitOf(e.arguments[1]);
+          if (left == null || right == null) return MAX_UINT32;
+          return left | right;
+        }
+        if (e.operator == BuiltinOperator.NumShr) {
+          int right = constantValue(e.arguments[1]);
+          // NumShr is JavaScript '>>>' so always generates a uint32 result.
+          if (right == null || right <= 0 || right > 31) return MAX_UINT32;
+          int left = maxBitOf(e.arguments[0]);
+          if (left == null) return MAX_UINT32;
+          return left >> right;
+        }
+        if (e.operator == BuiltinOperator.NumShl) {
+          int right = constantValue(e.arguments[1]);
+          if (right == null || right <= 0 || right > 31) return MAX_UINT32;
+          int left = maxBitOf(e.arguments[0]);
+          if (left == null) return MAX_UINT32;
+          if (left.bitLength + right > 31) return MAX_UINT32;
+          return left << right;
+        }
+      }
+      return null;
+    }
+
+    int maxBit = maxBitOf(node);
+    if (maxBit != null && maxBit <= MAX_UINT31) return op;
+    return js.js('# >>> 0', [op]);
+  }
+
+
+  /// The JS name of a built-in method.
+  static final Map<BuiltinMethod, String> builtinMethodName =
+    const <BuiltinMethod, String>{
+      BuiltinMethod.Push: 'push',
+      BuiltinMethod.Pop: 'pop',
+  };
+
+  @override
+  js.Expression visitApplyBuiltinMethod(tree_ir.ApplyBuiltinMethod node) {
+    String name = builtinMethodName[node.method];
+    js.Expression receiver = visitExpression(node.receiver);
+    List<js.Expression> args = visitExpressionList(node.arguments);
+    return js.js('#.#(#)', [receiver, name, args]);
+  }
+
+  @override
+  js.Expression visitAwait(tree_ir.Await node) {
+    return new js.Await(visitExpression(node.input));
+  }
+
   visitFunctionExpression(tree_ir.FunctionExpression node) {
     // FunctionExpressions are currently unused.
     // We might need them if we want to emit raw JS nested functions.
diff --git a/pkg/compiler/lib/src/js_backend/codegen/glue.dart b/pkg/compiler/lib/src/js_backend/codegen/glue.dart
index 641660b..e6f5909 100644
--- a/pkg/compiler/lib/src/js_backend/codegen/glue.dart
+++ b/pkg/compiler/lib/src/js_backend/codegen/glue.dart
@@ -5,12 +5,30 @@
 library code_generator_dependencies;
 
 import '../js_backend.dart';
-import '../../dart2jslib.dart';
+
+import '../../common.dart';
+import '../../common/registry.dart' show
+    Registry;
+import '../../common/codegen.dart' show
+    CodegenRegistry;
+import '../../compiler.dart' show
+    Compiler;
+import '../../constants/values.dart';
+import '../../dart_types.dart' show
+    DartType,
+    TypeVariableType,
+    InterfaceType;
+import '../../enqueue.dart' show
+    CodegenEnqueuer;
+import '../../elements/elements.dart';
 import '../../js_emitter/js_emitter.dart';
 import '../../js/js.dart' as js;
-import '../../constants/values.dart';
-import '../../elements/elements.dart';
-import '../../dart_types.dart' show DartType, TypeVariableType, InterfaceType;
+import '../../native/native.dart' show NativeBehavior;
+import '../../universe/selector.dart' show
+    Selector;
+import '../../world.dart' show
+    ClassWorld;
+
 
 /// Encapsulates the dependencies of the function-compiler to the compiler,
 /// backend and emitter.
@@ -31,12 +49,20 @@
 
   Glue(this._compiler);
 
+  ClassWorld get classWorld => _compiler.world;
+
+  DiagnosticReporter get reporter => _compiler.reporter;
+
   js.Expression constantReference(ConstantValue value) {
     return _emitter.constantReference(value);
   }
 
   reportInternalError(String message) {
-    _compiler.internalError(_compiler.currentElement, message);
+    reporter.internalError(CURRENT_ELEMENT_SPANNABLE, message);
+  }
+
+  bool isUsedAsMixin(ClassElement classElement) {
+    return classWorld.isUsedAsMixin(classElement);
   }
 
   ConstantValue getConstantValueForVariable(VariableElement variable) {
@@ -84,7 +110,7 @@
   }
 
   FunctionElement get createInvocationMirrorMethod {
-    return _backend.getCreateInvocationMirror();
+    return _backend.helpers.createInvocationMirror;
   }
 
   void registerUseInterceptorInCodegen() {
@@ -99,10 +125,18 @@
     return _backend.isInterceptedMethod(element);
   }
 
+  bool isInterceptorClass(ClassElement element) {
+    return element.isSubclassOf(_backend.jsInterceptorClass);
+  }
+
   Set<ClassElement> getInterceptedClassesOn(Selector selector) {
     return _backend.getInterceptedClassesOn(selector.name);
   }
 
+  Set<ClassElement> get interceptedClasses {
+    return _backend.interceptedClasses;
+  }
+
   void registerSpecializedGetInterceptor(Set<ClassElement> classes) {
     _backend.registerSpecializedGetInterceptor(classes);
   }
@@ -135,55 +169,55 @@
   }
 
   FunctionElement getWrapExceptionHelper() {
-    return _backend.getWrapExceptionHelper();
+    return _backend.helpers.wrapExceptionHelper;
   }
 
   FunctionElement getExceptionUnwrapper() {
-    return _backend.getExceptionUnwrapper();
+    return _backend.helpers.exceptionUnwrapper;
   }
 
   FunctionElement getTraceFromException() {
-    return _backend.getTraceFromException();
+    return _backend.helpers.traceFromException;
   }
 
   FunctionElement getCreateRuntimeType() {
-    return _backend.getCreateRuntimeType();
+    return _backend.helpers.createRuntimeType;
   }
 
   FunctionElement getRuntimeTypeToString() {
-    return _backend.getRuntimeTypeToString();
+    return _backend.helpers.runtimeTypeToString;
   }
 
   FunctionElement getRuntimeTypeArgument() {
-    return _backend.getGetRuntimeTypeArgument();
+    return _backend.helpers.getRuntimeTypeArgument;
   }
 
   FunctionElement getTypeArgumentByIndex() {
-    return _backend.getGetTypeArgumentByIndex();
+    return _backend.helpers.getTypeArgumentByIndex;
   }
 
   FunctionElement getAddRuntimeTypeInformation() {
-    return _backend.getSetRuntimeTypeInfo();
+    return _backend.helpers.setRuntimeTypeInfo;
   }
 
   /// checkSubtype(value, $isT, typeArgs, $asT)
   FunctionElement getCheckSubtype() {
-    return _backend.getCheckSubtype();
+    return _backend.helpers.checkSubtype;
   }
 
   /// subtypeCast(value, $isT, typeArgs, $asT)
   FunctionElement getSubtypeCast() {
-    return _backend.getSubtypeCast();
+    return _backend.helpers.subtypeCast;
   }
 
   /// checkSubtypeOfRuntime(value, runtimeType)
   FunctionElement getCheckSubtypeOfRuntimeType() {
-    return _backend.getCheckSubtypeOfRuntimeType();
+    return _backend.helpers.checkSubtypeOfRuntimeType;
   }
 
   /// subtypeOfRuntimeTypeCast(value, runtimeType)
   FunctionElement getSubtypeOfRuntimeTypeCast() {
-    return _backend.getSubtypeOfRuntimeTypeCast();
+    return _backend.helpers.subtypeOfRuntimeTypeCast;
   }
 
   js.Expression getRuntimeTypeName(ClassElement cls) {
@@ -191,7 +225,7 @@
   }
 
   int getTypeVariableIndex(TypeVariableType variable) {
-    return RuntimeTypes.getTypeVariableIndex(variable.element);
+    return variable.element.index;
   }
 
   bool needsSubstitutionForTypeVariableAccess(ClassElement cls) {
@@ -205,12 +239,15 @@
   }
 
   js.Expression generateTypeRepresentation(DartType dartType,
-                                           List<js.Expression> arguments) {
+                                           List<js.Expression> arguments,
+                                           CodegenRegistry registry) {
     int variableIndex = 0;
-    js.Expression representation = _backend.rti.getTypeRepresentation(
+    js.Expression representation = _backend.rtiEncoder.getTypeRepresentation(
         dartType,
         (_) => arguments[variableIndex++]);
     assert(variableIndex == arguments.length);
+    // Representation contains JavaScript Arrays.
+    registry.registerInstantiatedClass(_backend.jsArrayClass);
     return representation;
   }
 
@@ -235,6 +272,23 @@
     return _compiler.world.hasAnyStrictSubtype(element);
   }
 
+  ClassElement get jsFixedArrayClass => _backend.jsFixedArrayClass;
   ClassElement get jsExtendableArrayClass => _backend.jsExtendableArrayClass;
+  ClassElement get jsUnmodifiableArrayClass =>
+      _backend.jsUnmodifiableArrayClass;
   ClassElement get jsMutableArrayClass => _backend.jsMutableArrayClass;
+
+  bool isStringClass(ClassElement classElement) =>
+      classElement == _backend.jsStringClass ||
+      classElement == _compiler.stringClass;
+
+  bool isBoolClass(ClassElement classElement) =>
+      classElement == _backend.jsBoolClass ||
+      classElement == _compiler.boolClass;
+
+  // TODO(sra): Should this be part of CodegenRegistry?
+  void registerNativeBehavior(NativeBehavior nativeBehavior, node) {
+    if (nativeBehavior == null) return;
+    _enqueuer.nativeEnqueuer.registerNativeBehavior(nativeBehavior, node);
+  }
 }
diff --git a/pkg/compiler/lib/src/js_backend/codegen/task.dart b/pkg/compiler/lib/src/js_backend/codegen/task.dart
index 14cc633..28beb1c 100644
--- a/pkg/compiler/lib/src/js_backend/codegen/task.dart
+++ b/pkg/compiler/lib/src/js_backend/codegen/task.dart
@@ -10,78 +10,105 @@
 import 'unsugar.dart';
 
 import '../js_backend.dart';
+
+import '../../common.dart';
+import '../../common/codegen.dart' show
+    CodegenWorkItem;
+import '../../common/tasks.dart' show
+    CompilerTask,
+    GenericTask;
+import '../../compiler.dart' show
+    Compiler;
 import '../../constants/constant_system.dart';
-import '../../dart2jslib.dart';
-import '../../cps_ir/cps_ir_nodes.dart' as cps;
-import '../../cps_ir/cps_ir_integrity.dart';
 import '../../cps_ir/cps_ir_builder_task.dart';
-import '../../tree_ir/tree_ir_nodes.dart' as tree_ir;
-import '../../types/types.dart' show TypeMask, UnionTypeMask, FlatTypeMask,
-    ForwardingTypeMask;
-import '../../elements/elements.dart';
-import '../../js/js.dart' as js;
-import '../../io/source_information.dart' show SourceInformationStrategy;
-import '../../tree_ir/tree_ir_builder.dart' as tree_builder;
+import '../../cps_ir/cps_ir_nodes.dart' as cps;
+import '../../cps_ir/cps_ir_nodes_sexpr.dart';
+import '../../cps_ir/cps_ir_integrity.dart';
 import '../../cps_ir/optimizers.dart';
 import '../../cps_ir/optimizers.dart' as cps_opt;
-import '../../tracer.dart';
+import '../../cps_ir/type_mask_system.dart';
+import '../../diagnostics/invariant.dart' show
+    DEBUG_MODE;
+import '../../elements/elements.dart';
+import '../../js/js.dart' as js;
 import '../../js_backend/codegen/codegen.dart';
+import '../../io/source_information.dart' show
+    SourceInformationStrategy;
+import '../../tree_ir/tree_ir_builder.dart' as tree_builder;
+import '../../tracer.dart';
 import '../../ssa/ssa.dart' as ssa;
 import '../../tree_ir/optimization/optimization.dart';
 import '../../tree_ir/optimization/optimization.dart' as tree_opt;
 import '../../tree_ir/tree_ir_integrity.dart';
-import '../../cps_ir/cps_ir_nodes_sexpr.dart';
+import '../../tree_ir/tree_ir_nodes.dart' as tree_ir;
+import '../../types/types.dart' show
+    FlatTypeMask,
+    ForwardingTypeMask,
+    TypeMask,
+    UnionTypeMask;
 
 class CpsFunctionCompiler implements FunctionCompiler {
   final ConstantSystem constantSystem;
+  // TODO(karlklose): remove the compiler.
   final Compiler compiler;
   final Glue glue;
   final SourceInformationStrategy sourceInformationFactory;
 
-  // TODO(karlklose,sigurm): remove and update dart-doc of [compile].
+  // TODO(karlklose,sigurdm): remove and update dart-doc of [compile].
   final FunctionCompiler fallbackCompiler;
+  TypeMaskSystem typeSystem;
 
   Tracer get tracer => compiler.tracer;
 
-  IrBuilderTask get irBuilderTask => compiler.irBuilder;
+  final IrBuilderTask cpsBuilderTask;
+  final GenericTask cpsOptimizationTask;
+  final GenericTask treeBuilderTask;
+  final GenericTask treeOptimizationTask;
 
   CpsFunctionCompiler(Compiler compiler, JavaScriptBackend backend,
                       SourceInformationStrategy sourceInformationFactory)
       : fallbackCompiler =
             new ssa.SsaFunctionCompiler(backend, sourceInformationFactory),
+        cpsBuilderTask = new IrBuilderTask(compiler, sourceInformationFactory),
         this.sourceInformationFactory = sourceInformationFactory,
         constantSystem = backend.constantSystem,
         compiler = compiler,
-        glue = new Glue(compiler);
+        glue = new Glue(compiler),
+        cpsOptimizationTask = new GenericTask('CPS optimization', compiler),
+        treeBuilderTask = new GenericTask('Tree builder', compiler),
+        treeOptimizationTask = new GenericTask('Tree optimization', compiler);
 
   String get name => 'CPS Ir pipeline';
 
+  JavaScriptBackend get backend => compiler.backend;
+
+  DiagnosticReporter get reporter => compiler.reporter;
+
   /// Generates JavaScript code for `work.element`.
   js.Fun compile(CodegenWorkItem work) {
     AstElement element = work.element;
-    JavaScriptBackend backend = compiler.backend;
-    return compiler.withCurrentElement(element, () {
+    return reporter.withCurrentElement(element, () {
+      typeSystem = new TypeMaskSystem(compiler);
       try {
-        // TODO(karlklose): remove this fallback.
-        // Fallback for a few functions that we know require try-finally and
-        // switch.
-        if (element.isNative) {
-          compiler.log('Using SSA compiler for platform element $element');
+        // TODO(karlklose): remove this fallback when we do not need it for
+        // testing anymore.
+        if (false) {
+          reporter.log('Using SSA compiler for platform element $element');
           return fallbackCompiler.compile(work);
         }
 
         if (tracer != null) {
           tracer.traceCompilation(element.name, null);
         }
-        cps.FunctionDefinition cpsFunction = compileToCpsIR(element);
-        cpsFunction = optimizeCpsIR(cpsFunction);
-        tree_ir.FunctionDefinition treeFunction = compileToTreeIR(cpsFunction);
-        treeFunction = optimizeTreeIR(treeFunction);
+        cps.FunctionDefinition cpsFunction = compileToCpsIr(element);
+        cpsFunction = optimizeCpsIr(cpsFunction);
+        tree_ir.FunctionDefinition treeFunction = compileToTreeIr(cpsFunction);
+        treeFunction = optimizeTreeIr(treeFunction);
         return compileToJavaScript(work, treeFunction);
       } on CodegenBailout catch (e) {
         String message = "Unable to compile $element with the new compiler.\n"
             "  Reason: ${e.message}";
-        compiler.internalError(element, message);
+        reporter.internalError(element, message);
       }
     });
   }
@@ -96,28 +123,32 @@
     }
   }
 
-  cps.FunctionDefinition compileToCpsIR(AstElement element) {
-    // TODO(sigurdm): Support these constructs.
-    if (element.isNative) {
-      giveUp('unsupported element kind: ${element.name}:${element.kind}');
-    }
+  void applyCpsPass(cps_opt.Pass pass, cps.FunctionDefinition cpsFunction) {
+    cpsOptimizationTask.measureSubtask(pass.passName, () {
+      pass.rewrite(cpsFunction);
+    });
+    traceGraph(pass.passName, cpsFunction);
+    dumpTypedIr(pass.passName, cpsFunction);
+    assert(checkCpsIntegrity(cpsFunction, pass.passName));
+  }
 
-    cps.FunctionDefinition cpsNode = irBuilderTask.buildNode(element);
-    if (cpsNode == null) {
-      if (irBuilderTask.bailoutMessage == null) {
+  cps.FunctionDefinition compileToCpsIr(AstElement element) {
+    cps.FunctionDefinition cpsFunction = cpsBuilderTask.buildNode(element);
+    if (cpsFunction == null) {
+      if (cpsBuilderTask.bailoutMessage == null) {
         giveUp('unable to build cps definition of $element');
       } else {
-        giveUp(irBuilderTask.bailoutMessage);
+        giveUp(cpsBuilderTask.bailoutMessage);
       }
     }
-    traceGraph("IR Builder", cpsNode);
+    ParentVisitor.setParents(cpsFunction);
+    traceGraph('IR Builder', cpsFunction);
+    dumpTypedIr('IR Builder', cpsFunction);
     // Eliminating redundant phis before the unsugaring pass will make it
     // insert fewer getInterceptor calls.
-    new RedundantPhiEliminator().rewrite(cpsNode);
-    traceGraph("Redundant phi elimination", cpsNode);
-    new UnsugarVisitor(glue).rewrite(cpsNode);
-    traceGraph("Unsugaring", cpsNode);
-    return cpsNode;
+    applyCpsPass(new RedundantPhiEliminator(), cpsFunction);
+    applyCpsPass(new UnsugarVisitor(glue), cpsFunction);
+    return cpsFunction;
   }
 
   static const Pattern PRINT_TYPED_IR_FILTER = null;
@@ -137,52 +168,54 @@
     throw 'unsupported: $type';
   }
 
-  void dumpTypedIR(cps.FunctionDefinition cpsNode,
-                   TypePropagator typePropagator) {
+  void dumpTypedIr(String passName, cps.FunctionDefinition cpsFunction) {
     if (PRINT_TYPED_IR_FILTER != null &&
-        PRINT_TYPED_IR_FILTER.matchAsPrefix(cpsNode.element.name) != null) {
+        PRINT_TYPED_IR_FILTER.matchAsPrefix(cpsFunction.element.name) != null) {
       String printType(nodeOrRef, String s) {
         cps.Node node = nodeOrRef is cps.Reference
             ? nodeOrRef.definition
             : nodeOrRef;
-        var type = typePropagator.getType(node);
-        return type == null ? s : "$s:${formatTypeMask(type.type)}";
+        return node is cps.Variable && node.type != null
+            ? '$s:${formatTypeMask(node.type)}'
+            : s;
       }
       DEBUG_MODE = true;
-      print(new SExpressionStringifier(printType).visit(cpsNode));
+      print(';;; ==== After $passName ====');
+      print(new SExpressionStringifier(printType).visit(cpsFunction));
     }
   }
 
-  static bool checkCpsIntegrity(cps.FunctionDefinition node) {
-    new CheckCpsIntegrity().check(node);
+  static bool checkCpsIntegrity(cps.FunctionDefinition node, String pass) {
+    new CheckCpsIntegrity().check(node, pass);
     return true; // So this can be used from assert().
   }
 
-  cps.FunctionDefinition optimizeCpsIR(cps.FunctionDefinition cpsNode) {
-    // Transformations on the CPS IR.
-    void applyCpsPass(cps_opt.Pass pass) {
-      pass.rewrite(cpsNode);
-      traceGraph(pass.passName, cpsNode);
-      assert(checkCpsIntegrity(cpsNode));
-    }
+  cps.FunctionDefinition optimizeCpsIr(cps.FunctionDefinition cpsFunction) {
+    TypeMaskSystem typeSystem = new TypeMaskSystem(compiler);
 
-    TypePropagator typePropagator = new TypePropagator(compiler);
-    applyCpsPass(typePropagator);
-    dumpTypedIR(cpsNode, typePropagator);
-    applyCpsPass(new ShrinkingReducer());
-    applyCpsPass(new MutableVariableEliminator());
-    applyCpsPass(new RedundantJoinEliminator());
-    applyCpsPass(new RedundantPhiEliminator());
-    applyCpsPass(new ShrinkingReducer());
-    applyCpsPass(new LetSinker());
+    applyCpsPass(new RedundantJoinEliminator(), cpsFunction);
+    applyCpsPass(new RedundantPhiEliminator(), cpsFunction);
+    applyCpsPass(new InsertRefinements(typeSystem), cpsFunction);
+    applyCpsPass(new TypePropagator(compiler, typeSystem, this), cpsFunction);
+    applyCpsPass(new RemoveRefinements(), cpsFunction);
+    applyCpsPass(new ShrinkingReducer(), cpsFunction);
+    applyCpsPass(new ScalarReplacer(compiler), cpsFunction);
+    applyCpsPass(new MutableVariableEliminator(), cpsFunction);
+    applyCpsPass(new RedundantJoinEliminator(), cpsFunction);
+    applyCpsPass(new RedundantPhiEliminator(), cpsFunction);
+    applyCpsPass(new BoundsChecker(typeSystem, compiler.world), cpsFunction);
+    applyCpsPass(new ShrinkingReducer(), cpsFunction);
+    applyCpsPass(new ShareInterceptors(), cpsFunction);
+    applyCpsPass(new ShrinkingReducer(), cpsFunction);
 
-    return cpsNode;
+    return cpsFunction;
   }
 
-  tree_ir.FunctionDefinition compileToTreeIR(cps.FunctionDefinition cpsNode) {
+  tree_ir.FunctionDefinition compileToTreeIr(cps.FunctionDefinition cpsNode) {
     tree_builder.Builder builder = new tree_builder.Builder(
-        compiler.internalError);
-    tree_ir.FunctionDefinition treeNode = builder.buildFunction(cpsNode);
+        reporter.internalError);
+    tree_ir.FunctionDefinition treeNode =
+        treeBuilderTask.measure(() => builder.buildFunction(cpsNode));
     assert(treeNode != null);
     traceGraph('Tree builder', treeNode);
     assert(checkTreeIntegrity(treeNode));
@@ -194,9 +227,11 @@
     return true; // So this can be used from assert().
   }
 
-  tree_ir.FunctionDefinition optimizeTreeIR(tree_ir.FunctionDefinition node) {
+  tree_ir.FunctionDefinition optimizeTreeIr(tree_ir.FunctionDefinition node) {
     void applyTreePass(tree_opt.Pass pass) {
-      pass.rewrite(node);
+      treeOptimizationTask.measureSubtask(pass.passName, () {
+        pass.rewrite(node);
+      });
       traceGraph(pass.passName, node);
       assert(checkTreeIntegrity(node));
     }
@@ -213,12 +248,22 @@
   js.Fun compileToJavaScript(CodegenWorkItem work,
                              tree_ir.FunctionDefinition definition) {
     CodeGenerator codeGen = new CodeGenerator(glue, work.registry);
-    return attachPosition(codeGen.buildFunction(definition), work.element);
+    Element element = work.element;
+    js.Fun code = codeGen.buildFunction(definition);
+    if (element is FunctionElement && element.asyncMarker != AsyncMarker.SYNC) {
+      code = backend.rewriteAsync(element, code);
+      work.registry.registerAsyncMarker(element);
+    }
+    return attachPosition(code, element);
   }
 
   Iterable<CompilerTask> get tasks {
-    // TODO(sigurdm): Make a better list of tasks.
-    return <CompilerTask>[irBuilderTask]..addAll(fallbackCompiler.tasks);
+    return <CompilerTask>[
+        cpsBuilderTask,
+        cpsOptimizationTask,
+        treeBuilderTask,
+        treeOptimizationTask]
+      ..addAll(fallbackCompiler.tasks);
   }
 
   js.Node attachPosition(js.Node node, AstElement element) {
diff --git a/pkg/compiler/lib/src/js_backend/codegen/unsugar.dart b/pkg/compiler/lib/src/js_backend/codegen/unsugar.dart
index 01ebde7..3fa6f18 100644
--- a/pkg/compiler/lib/src/js_backend/codegen/unsugar.dart
+++ b/pkg/compiler/lib/src/js_backend/codegen/unsugar.dart
@@ -2,13 +2,13 @@
 
 import '../../cps_ir/cps_ir_nodes.dart';
 
-import '../../cps_ir/optimizers.dart' show ParentVisitor;
+import '../../cps_ir/optimizers.dart' show ParentVisitor, Pass;
 import '../../constants/values.dart';
 import '../../elements/elements.dart';
-import '../../io/source_information.dart';
 import '../../js_backend/codegen/glue.dart';
-import '../../dart2jslib.dart' show Selector, World;
+import '../../universe/selector.dart' show Selector;
 import '../../cps_ir/cps_ir_builder.dart' show ThisParameterLocal;
+import '../../cps_ir/cps_fragment.dart';
 
 class ExplicitReceiverParameterEntity implements Local {
   String get name => 'receiver';
@@ -26,25 +26,20 @@
   String get name => interceptedVariable.name + '_';
 }
 
-
 /// Rewrites the initial CPS IR to make Dart semantics explicit and inserts
 /// special nodes that respect JavaScript behavior.
 ///
 /// Performs the following rewrites:
-///  - Rewrite [IsTrue] in a [Branch] to do boolean conversion.
 ///  - Add interceptors at call sites that use interceptor calling convention.
 ///  - Add explicit receiver argument for methods that are called in interceptor
 ///    calling convention.
 ///  - Convert two-parameter exception handlers to one-parameter ones.
-class UnsugarVisitor extends RecursiveVisitor {
+class UnsugarVisitor extends TrampolineRecursiveVisitor implements Pass {
   Glue _glue;
-  ParentVisitor _parentVisitor = new ParentVisitor();
 
   Parameter thisParameter;
   Parameter explicitReceiverParameter;
 
-  Map<Primitive, Interceptor> interceptors = <Primitive, Interceptor>{};
-
   // In a catch block, rethrow implicitly throws the block's exception
   // parameter.  This is the exception parameter when nested in a catch
   // block and null otherwise.
@@ -52,7 +47,17 @@
 
   UnsugarVisitor(this._glue);
 
+  String get passName => 'Unsugaring';
+
+  bool methodUsesReceiverArgument(FunctionElement function) {
+    assert(_glue.isInterceptedMethod(function));
+    ClassElement clazz = function.enclosingClass.declaration;
+    return _glue.isInterceptorClass(clazz) ||
+           _glue.isUsedAsMixin(clazz);
+  }
+
   void rewrite(FunctionDefinition function) {
+    thisParameter = function.thisParameter;
     bool inInterceptedMethod = _glue.isInterceptedMethod(function.element);
 
     if (function.element.name == '==' &&
@@ -64,18 +69,14 @@
     }
 
     if (inInterceptedMethod) {
-      thisParameter = function.thisParameter;
       ThisParameterLocal holder = thisParameter.hint;
       explicitReceiverParameter = new Parameter(
-          new ExplicitReceiverParameterEntity(
-              holder.executableContext));
+          new ExplicitReceiverParameterEntity(holder.executableContext));
+      explicitReceiverParameter.parent = function;
       function.parameters.insert(0, explicitReceiverParameter);
     }
 
-    // Set all parent pointers.
-    _parentVisitor.visit(function);
-
-    if (inInterceptedMethod) {
+    if (inInterceptedMethod && methodUsesReceiverArgument(function.element)) {
       explicitReceiverParameter.substituteFor(thisParameter);
     }
 
@@ -96,11 +97,7 @@
 
   void insertLetPrim(Primitive primitive, Expression node) {
     LetPrim let = new LetPrim(primitive);
-    InteriorNode parent = node.parent;
-    parent.body = let;
-    let.body = node;
-    node.parent = let;
-    let.parent = parent;
+    let.insertAbove(node);
   }
 
   void insertEqNullCheck(FunctionDefinition function) {
@@ -115,31 +112,14 @@
     //     else
     //       body;
     //
-    Continuation originalBody = new Continuation(<Parameter>[]);
-    originalBody.body = function.body;
-
-    Continuation returnFalse = new Continuation(<Parameter>[]);
-    Primitive falsePrimitive = falseConstant;
-    returnFalse.body =
-        new LetPrim(falsePrimitive,
-            new InvokeContinuation(
-                function.returnContinuation, <Primitive>[falsePrimitive]));
-
-    Primitive nullPrimitive = nullConstant;
-    Primitive test = new ApplyBuiltinOperator(
+    CpsFragment cps = new CpsFragment();
+    Primitive isNull = cps.applyBuiltin(
         BuiltinOperator.Identical,
-          <Primitive>[function.parameters.single, nullPrimitive],
-          function.parameters.single.sourceInformation);
-
-    Expression newBody =
-        new LetCont.many(<Continuation>[returnFalse, originalBody],
-            new LetPrim(nullPrimitive,
-                new LetPrim(test,
-                    new Branch(
-                        new IsTrue(test),
-                        returnFalse,
-                        originalBody))));
-    function.body = newBody;
+        <Primitive>[function.parameters.single, cps.makeNull()]);
+    CpsFragment trueBranch = cps.ifTruthy(isNull);
+    trueBranch.invokeContinuation(function.returnContinuation,
+        <Primitive>[trueBranch.makeFalse()]);
+    cps.insertAbove(function.body);
   }
 
   /// Insert a static call to [function] at the point of [node] with result
@@ -150,25 +130,22 @@
   /// let cont continuation(result) = node
   /// in invoke function arguments continuation
   void insertStaticCall(FunctionElement function, List<Primitive> arguments,
-      Parameter result,
-      Expression node) {
+      Parameter result, Expression node) {
     InteriorNode parent = node.parent;
     Continuation continuation = new Continuation([result]);
-    continuation.body = node;
-    _parentVisitor.processContinuation(continuation);
 
     Selector selector = new Selector.fromElement(function);
     // TODO(johnniwinther): Come up with an implementation of SourceInformation
     // for calls such as this one that don't appear in the original source.
     InvokeStatic invoke = new InvokeStatic(
         function, selector, arguments, continuation, null);
-    _parentVisitor.processInvokeStatic(invoke);
 
     LetCont letCont = new LetCont(continuation, invoke);
-    _parentVisitor.processLetCont(letCont);
 
     parent.body = letCont;
     letCont.parent = parent;
+    continuation.body = node;
+    node.parent = continuation;
   }
 
   @override
@@ -208,11 +185,10 @@
 
   processThrow(Throw node) {
     // The subexpression of throw is wrapped in the JavaScript output.
-    Parameter value = new Parameter(null);
+    Parameter wrappedException = new Parameter(null);
     insertStaticCall(_glue.getWrapExceptionHelper(), [node.value.definition],
-        value, node);
-    node.value.unlink();
-    node.value = new Reference<Primitive>(value);
+        wrappedException, node);
+    node.value.changeTo(wrappedException);
   }
 
   processRethrow(Rethrow node) {
@@ -226,32 +202,16 @@
     // worry about unlinking.
   }
 
-  /// Returns an interceptor for the given value, capable of responding to
-  /// [selector].
-  ///
-  /// A single getInterceptor call will be created per primitive, bound
-  /// immediately after the primitive is bound.
-  ///
-  /// The type propagation pass will later narrow the set of interceptors
-  /// based on the input type, and the let sinking pass will propagate the
-  /// getInterceptor call closer to its use when this is profitable.
-  Interceptor getInterceptorFor(Primitive prim, Selector selector,
-                                SourceInformation sourceInformation) {
-    assert(prim is! Interceptor);
-    Interceptor interceptor = interceptors[prim];
-    if (interceptor == null) {
-      interceptor = new Interceptor(prim, sourceInformation);
-      interceptors[prim] = interceptor;
-      InteriorNode parent = prim.parent;
-      insertLetPrim(interceptor, parent.body);
-      if (prim.hint != null) {
-        interceptor.hint = new InterceptorEntity(prim.hint);
-      }
-    }
-    // Add the interceptor classes that can respond to the given selector.
-    interceptor.interceptedClasses.addAll(
-        _glue.getInterceptedClassesOn(selector));
-    return interceptor;
+  // TODO(24523): Insert interceptor on demand when we discover we want to use
+  // one rather than on every check.
+  processTypeTest(TypeTest node) {
+    assert(node.interceptor == null);
+    Primitive receiver = node.value.definition;
+    Primitive interceptor = new Interceptor(receiver, node.sourceInformation)
+        ..interceptedClasses.addAll(_glue.interceptedClasses);
+    insertLetPrim(interceptor, node.parent);
+    node.interceptor = new Reference<Primitive>(interceptor);
+    node.interceptor.parent = node;
   }
 
   processInvokeMethod(InvokeMethod node) {
@@ -267,46 +227,42 @@
       //  Change 'receiver.foo()'  to  'this.foo(receiver)'.
       newReceiver = thisParameter;
     } else {
-      newReceiver = getInterceptorFor(
-          receiver, node.selector, node.sourceInformation);
+      LetCont contBinding = node.parent;
+      newReceiver = new Interceptor(receiver, node.sourceInformation)
+          ..interceptedClasses.addAll(_glue.getInterceptedClassesOn(selector));
+      if (receiver.hint != null) {
+        newReceiver.hint = new InterceptorEntity(receiver.hint);
+      }
+      insertLetPrim(newReceiver, contBinding);
     }
-
     node.arguments.insert(0, node.receiver);
-    node.receiver = new Reference<Primitive>(newReceiver);
+    node.receiver = new Reference<Primitive>(newReceiver)..parent = node;
+    node.receiverIsIntercepted = true;
   }
 
   processInvokeMethodDirectly(InvokeMethodDirectly node) {
-    if (_glue.isInterceptedMethod(node.target)) {
-      Primitive nullPrim = nullConstant;
-      insertLetPrim(nullPrim, node);
-      node.arguments.insert(0, node.receiver);
-      // TODO(sra): `null` is not adequate.  Interceptors project the class
-      // hierarchy onto an interceptor hierarchy.  A super call that does a
-      // method call will use the javascript 'this' parameter to avoid calling
-      // getInterceptor again, so the receiver must be the interceptor (likely
-      // `this`), not `null`.
-      node.receiver = new Reference<Primitive>(nullPrim);
-    }
-  }
+    if (!_glue.isInterceptedMethod(node.target)) return;
 
-  processBranch(Branch node) {
-    // TODO(karlklose): implement the checked mode part of boolean conversion.
-    InteriorNode parent = node.parent;
-    IsTrue condition = node.condition;
-    Primitive t = trueConstant;
-    Primitive i = new ApplyBuiltinOperator(
-        BuiltinOperator.Identical,
-        <Primitive>[condition.value.definition, t],
-        condition.value.definition.sourceInformation);
-    LetPrim newNode = new LetPrim(t,
-        new LetPrim(i,
-            new Branch(new IsTrue(i),
-                node.trueContinuation.definition,
-                node.falseContinuation.definition)));
-    condition.value.unlink();
-    node.trueContinuation.unlink();
-    node.falseContinuation.unlink();
-    parent.body = newNode;
+    Selector selector = node.selector;
+    Primitive receiver = node.receiver.definition;
+    Primitive newReceiver;
+
+    if (receiver == explicitReceiverParameter) {
+      // If the receiver is the explicit receiver, we are calling a method in
+      // the same interceptor:
+      //  Change 'receiver.foo()'  to  'this.foo(receiver)'.
+      newReceiver = thisParameter;
+    } else {
+      LetCont contBinding = node.parent;
+      newReceiver = new Interceptor(receiver, node.sourceInformation)
+        ..interceptedClasses.addAll(_glue.getInterceptedClassesOn(selector));
+      if (receiver.hint != null) {
+        newReceiver.hint = new InterceptorEntity(receiver.hint);
+      }
+      insertLetPrim(newReceiver, contBinding);
+    }
+    node.arguments.insert(0, node.receiver);
+    node.receiver = new Reference<Primitive>(newReceiver)..parent = node;
   }
 
   processInterceptor(Interceptor node) {
diff --git a/pkg/compiler/lib/src/js_backend/constant_emitter.dart b/pkg/compiler/lib/src/js_backend/constant_emitter.dart
index 3f38a28..5b87b15 100644
--- a/pkg/compiler/lib/src/js_backend/constant_emitter.dart
+++ b/pkg/compiler/lib/src/js_backend/constant_emitter.dart
@@ -39,6 +39,8 @@
       jsAst.Expression this.constantReferenceGenerator(ConstantValue constant),
       this.makeConstantList);
 
+  DiagnosticReporter get reporter => compiler.reporter;
+
   /**
    * Constructs a literal expression that evaluates to the constant. Uses a
    * canonical name unless the constant can be emitted multiple times (as for
@@ -54,7 +56,7 @@
 
   @override
   jsAst.Expression visitFunction(FunctionConstantValue constant, [_]) {
-    compiler.internalError(NO_LOCATION_SPANNABLE,
+    reporter.internalError(NO_LOCATION_SPANNABLE,
         "The function constant does not need specific JS code.");
     return null;
   }
@@ -220,7 +222,7 @@
           } else if (field.name == JavaScriptMapConstant.JS_DATA_NAME) {
             arguments.add(jsGeneralMap());
           } else {
-            compiler.internalError(field,
+            reporter.internalError(field,
                 "Compiler has unexpected field ${field.name} for "
                 "${className}.");
           }
@@ -233,7 +235,7 @@
          emittedArgumentCount != 4) ||
         (className == JavaScriptMapConstant.DART_GENERAL_CLASS &&
          emittedArgumentCount != 1)) {
-      compiler.internalError(classElement,
+      reporter.internalError(classElement,
           "Compiler and ${className} disagree on number of fields.");
     }
 
@@ -253,7 +255,7 @@
   jsAst.Expression visitType(TypeConstantValue constant, [_]) {
     DartType type = constant.representedType;
     jsAst.Name typeName = namer.runtimeTypeName(type.element);
-    return new jsAst.Call(getHelperProperty(backend.getCreateRuntimeType()),
+    return new jsAst.Call(getHelperProperty(backend.helpers.createRuntimeType),
                           [js.quoteName(typeName)]);
   }
 
@@ -273,7 +275,7 @@
       case SyntheticConstantKind.NAME:
         return constant.payload;
       default:
-        compiler.internalError(NO_LOCATION_SPANNABLE,
+        reporter.internalError(NO_LOCATION_SPANNABLE,
                                "Unexpected DummyConstantKind ${constant.kind}");
         return null;
     }
@@ -307,14 +309,15 @@
         !type.treatAsRaw &&
         backend.classNeedsRti(type.element)) {
       InterfaceType interface = type;
-      RuntimeTypes rti = backend.rti;
+      RuntimeTypesEncoder rtiEncoder = backend.rtiEncoder;
       Iterable<jsAst.Expression> arguments = interface.typeArguments
           .map((DartType type) =>
-              rti.getTypeRepresentationWithPlaceholders(type, (_){}));
+              rtiEncoder.getTypeRepresentationWithPlaceholders(type, (_){}));
       jsAst.Expression argumentList =
           new jsAst.ArrayInitializer(arguments.toList());
-      return new jsAst.Call(getHelperProperty(backend.getSetRuntimeTypeInfo()),
-                            [value, argumentList]);
+      return new jsAst.Call(
+          getHelperProperty(backend.helpers.setRuntimeTypeInfo),
+          [value, argumentList]);
     }
     return value;
   }
diff --git a/pkg/compiler/lib/src/js_backend/constant_handler_javascript.dart b/pkg/compiler/lib/src/js_backend/constant_handler_javascript.dart
index 57ae567..dcb5661 100644
--- a/pkg/compiler/lib/src/js_backend/constant_handler_javascript.dart
+++ b/pkg/compiler/lib/src/js_backend/constant_handler_javascript.dart
@@ -44,12 +44,21 @@
   @override
   ConstantExpression compileConstant(VariableElement element) {
     return measure(() {
+      // TODO(het): Only report errors from one of the constant compilers
       ConstantExpression result = dartConstantCompiler.compileConstant(element);
       jsConstantCompiler.compileConstant(element);
       return result;
     });
   }
 
+  @override
+  void evaluate(ConstantExpression constant) {
+    return measure(() {
+      dartConstantCompiler.evaluate(constant);
+      jsConstantCompiler.evaluate(constant);
+    });
+  }
+
   void compileVariable(VariableElement element) {
     measure(() {
       jsConstantCompiler.compileVariable(element);
@@ -118,12 +127,13 @@
 
   ConstantExpression compileVariableWithDefinitions(VariableElement element,
                                           TreeElements definitions,
-                                          {bool isConst: false}) {
+                                          {bool isConst: false,
+                                           bool checkType: true}) {
     if (!isConst && lazyStatics.contains(element)) {
       return null;
     }
     ConstantExpression value = super.compileVariableWithDefinitions(
-        element, definitions, isConst: isConst);
+        element, definitions, isConst: isConst, checkType: checkType);
     if (!isConst && value == null) {
       lazyStatics.add(element);
     }
@@ -186,7 +196,7 @@
     ConstantExpression initialValue =
         initialVariableValues[element.declaration];
     if (initialValue == null) {
-      compiler.internalError(element, "No initial value for given element.");
+      reporter.internalError(element, "No initial value for given element.");
     }
     return getConstantValue(initialValue);
   }
@@ -251,7 +261,7 @@
   const ForgetConstantElementVisitor();
 
   void visitElement(Element e, JavaScriptConstantCompiler constants) {
-    for (MetadataAnnotation data in e.metadata) {
+    for (MetadataAnnotation data in e.implementation.metadata) {
       constants.metadataConstantMap.remove(data);
       if (data.hasNode) {
         data.node.accept(new ForgetConstantNodeVisitor(constants));
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 c79c5b6..3dca32b 100644
--- a/pkg/compiler/lib/src/js_backend/constant_system_javascript.dart
+++ b/pkg/compiler/lib/src/js_backend/constant_system_javascript.dart
@@ -4,11 +4,11 @@
 
 library dart2js.constant_system.js;
 
+import '../compiler.dart' show Compiler;
 import '../constants/constant_system.dart';
 import '../constants/values.dart';
 import '../constant_system_dart.dart';
 import '../dart_types.dart';
-import '../dart2jslib.dart' show Compiler;
 import '../elements/elements.dart' show ClassElement;
 import '../tree/tree.dart' show DartString, LiteralDartString;
 import 'js_backend.dart';
@@ -263,7 +263,8 @@
   @override
   ConstantValue createType(Compiler compiler, DartType type) {
     return new TypeConstantValue(
-        type, compiler.backend.typeImplementation.computeType(compiler));
+        type,
+        compiler.backend.typeImplementation.computeType(compiler.resolution));
   }
 
   // Integer checks don't verify that the number is not -0.0.
@@ -321,7 +322,7 @@
                        : JavaScriptMapConstant.DART_STRING_CLASS)
         : JavaScriptMapConstant.DART_GENERAL_CLASS;
     ClassElement classElement = backend.jsHelperLibrary.find(className);
-    classElement.ensureResolved(compiler);
+    classElement.ensureResolved(compiler.resolution);
     List<DartType> typeArgument = sourceType.typeArguments;
     InterfaceType type;
     if (sourceType.treatAsRaw) {
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 a13db64..8ddbb43 100644
--- a/pkg/compiler/lib/src/js_backend/custom_elements_analysis.dart
+++ b/pkg/compiler/lib/src/js_backend/custom_elements_analysis.dart
@@ -67,18 +67,17 @@
       enqueuer.isResolutionQueue ? resolutionJoin : codegenJoin;
 
   void registerInstantiatedClass(ClassElement classElement, Enqueuer enqueuer) {
-    classElement.ensureResolved(compiler);
+    classElement.ensureResolved(compiler.resolution);
     if (!Elements.isNativeOrExtendsNative(classElement)) return;
     if (classElement.isMixinApplication) return;
     if (classElement.isAbstract) return;
+    // JsInterop classes are opaque interfaces without a concrete
+    // implementation.
+    if (classElement.isJsInterop) return;
     joinFor(enqueuer).instantiatedClasses.add(classElement);
   }
 
-  void registerTypeLiteral(DartType type, Registry registry) {
-    assert(registry.isForResolution);
-    // In codegen we see the TypeConstants instead.
-    if (!registry.isForResolution) return;
-
+  void registerTypeLiteral(DartType type) {
     if (type.isInterfaceType) {
       // TODO(sra): If we had a flow query from the type literal expression to
       // the Type argument of the metadata lookup, we could tell if this type
@@ -169,7 +168,6 @@
         ConstantValue constant = makeTypeConstant(classElement);
         backend.registerCompileTimeConstant(
             constant, compiler.globalDependencies);
-        backend.constants.addCompileTimeConstantForEmission(constant);
       }
     }
     activeClasses.addAll(newActiveClasses);
@@ -192,7 +190,7 @@
       if (member.isGenerativeConstructor) {
         // Ignore constructors that cannot be called with zero arguments.
         FunctionElement constructor = member;
-        constructor.computeType(compiler);
+        constructor.computeType(compiler.resolution);
         FunctionSignature parameters = constructor.functionSignature;
         if (parameters.requiredParameterCount == 0) {
           result.add(member);
diff --git a/pkg/compiler/lib/src/js_backend/js_backend.dart b/pkg/compiler/lib/src/js_backend/js_backend.dart
index 8608f00..3da429f 100644
--- a/pkg/compiler/lib/src/js_backend/js_backend.dart
+++ b/pkg/compiler/lib/src/js_backend/js_backend.dart
@@ -11,13 +11,46 @@
 import 'package:js_runtime/shared/embedded_names.dart' show JsGetName;
 
 import '../closure.dart';
+import '../common.dart';
+import '../common/backend_api.dart' show
+    Backend,
+    ForeignResolver;
+import '../common/codegen.dart' show
+    CodegenRegistry,
+    CodegenWorkItem;
+import '../common/names.dart' show
+    Identifiers,
+    Selectors,
+    Uris;
+import '../common/registry.dart' show
+    Registry;
+import '../common/tasks.dart' show
+    CompilerTask;
+import '../common/resolution.dart' show
+    Feature,
+    ListLiteralUse,
+    MapLiteralUse,
+    Resolution,
+    ResolutionCallbacks,
+    ResolutionImpact,
+    TransformedWorldImpact;
+import '../common/work.dart' show
+    ItemCompilationContext;
+import '../compiler.dart' show
+    Compiler;
 import '../compile_time_constants.dart';
 import '../constants/constant_system.dart';
 import '../constants/expressions.dart';
 import '../constants/values.dart';
-import '../dart2jslib.dart';
 import '../dart_types.dart';
 import '../elements/elements.dart';
+import '../elements/visitor.dart' show
+    BaseElementVisitor;
+import '../enqueue.dart' show
+    Enqueuer,
+    ResolutionEnqueuer,
+    WorldImpact;
+import '../helpers/helpers.dart';
 import '../io/code_output.dart';
 import '../io/source_information.dart' show
     SourceInformationStrategy,
@@ -30,27 +63,42 @@
 import '../js/js.dart' show js;
 import '../js/js_source_mapping.dart' show
     JavaScriptSourceInformationStrategy;
-import '../js_emitter/js_emitter.dart'
-    show ClassBuilder, CodeEmitterTask, Emitter, MetadataCollector, Placeholder,
-        TokenFinalizer, USE_LAZY_EMITTER;
-
+import '../js/rewrite_async.dart';
+import '../js_emitter/js_emitter.dart' show
+    CodeEmitterTask,
+    Emitter,
+    MetadataCollector,
+    Placeholder,
+    USE_LAZY_EMITTER;
 import '../library_loader.dart' show LibraryLoader, LoadedLibraries;
 import '../native/native.dart' as native;
+import '../patch_parser.dart' show
+    checkJsInteropAnnotation;
+import '../resolution/registry.dart' show
+    EagerRegistry;
+import '../resolution/tree_elements.dart' show
+    TreeElements;
 import '../ssa/ssa.dart';
 import '../tree/tree.dart';
 import '../types/types.dart';
+import '../universe/call_structure.dart' show
+    CallStructure;
+import '../universe/selector.dart' show
+    Selector,
+    SelectorKind;
 import '../universe/universe.dart';
 import '../util/characters.dart';
 import '../util/util.dart';
+import '../world.dart' show
+    ClassWorld;
 
-import '../elements/visitor.dart' show
-    BaseElementVisitor;
-
-import '../js_backend/codegen/task.dart';
-import '../resolution/resolution.dart' show ResolutionRegistry;
-
+import 'backend_helpers.dart';
+import 'backend_impact.dart';
+import 'codegen/task.dart';
 import 'constant_system_javascript.dart';
 import 'patch_resolver.dart';
+import 'js_interop_analysis.dart' show JsInteropAnalysis;
+import 'lookup_map_analysis.dart' show LookupMapAnalysis;
 
 part 'backend.dart';
 part 'checked_mode_helpers.dart';
diff --git a/pkg/compiler/lib/src/js_backend/js_interop_analysis.dart b/pkg/compiler/lib/src/js_backend/js_interop_analysis.dart
new file mode 100644
index 0000000..e6cce5b
--- /dev/null
+++ b/pkg/compiler/lib/src/js_backend/js_interop_analysis.dart
@@ -0,0 +1,189 @@
+// 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.
+
+/// Analysis to determine how to generate code for typed JavaScript interop.
+library compiler.src.js_backend.js_interop_analysis;
+
+import '../common/names.dart' show Identifiers;
+import '../compiler.dart' show Compiler;
+import '../diagnostics/messages.dart' show MessageKind;
+import '../constants/values.dart'
+    show
+        ConstantValue,
+        ConstructedConstantValue,
+        ListConstantValue,
+        NullConstantValue,
+        StringConstantValue,
+        TypeConstantValue;
+import '../elements/elements.dart'
+    show
+        ClassElement,
+        Element,
+        FieldElement,
+        FunctionElement,
+        LibraryElement,
+        ParameterElement,
+        MetadataAnnotation;
+
+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 'js_backend.dart' show JavaScriptBackend;
+
+class JsInteropAnalysis {
+  final JavaScriptBackend backend;
+
+  /// The resolved [FieldElement] for `Js.name`.
+  FieldElement nameField;
+  bool enabledJsInterop = false;
+
+  /// Whether the backend is currently processing the codegen queue.
+  bool _inCodegen = false;
+
+  JsInteropAnalysis(this.backend);
+
+  void onQueueClosed() {
+    if (_inCodegen) return;
+
+    if (backend.jsAnnotationClass != null) {
+      nameField = backend.jsAnnotationClass.lookupMember('name');
+      backend.compiler.libraryLoader.libraries
+          .forEach(processJsInteropAnnotationsInLibrary);
+    }
+  }
+
+  void onCodegenStart() {
+    _inCodegen = true;
+  }
+
+  void processJsInteropAnnotation(Element e) {
+    for (MetadataAnnotation annotation in e.implementation.metadata) {
+      ConstantValue constant = backend.compiler.constants.getConstantValue(
+          annotation.constant);
+      if (constant == null || constant is! ConstructedConstantValue) continue;
+      ConstructedConstantValue constructedConstant = constant;
+      if (constructedConstant.type.element == backend.jsAnnotationClass) {
+        ConstantValue value = constructedConstant.fields[nameField];
+        if (value.isString) {
+          StringConstantValue stringValue = value;
+          e.setJsInteropName(stringValue.primitiveValue.slowToString());
+        } else {
+          // TODO(jacobr): report a warning if the value is not a String.
+          e.setJsInteropName('');
+        }
+        enabledJsInterop = true;
+        return;
+      }
+    }
+  }
+
+  bool hasAnonymousAnnotation(Element element) {
+    if (backend.jsAnonymousClass == null) return false;
+    return element.metadata.any((MetadataAnnotation annotation) {
+      ConstantValue constant = backend.compiler.constants.getConstantValue(
+          annotation.constant);
+      if (constant == null ||
+          constant is! ConstructedConstantValue) return false;
+      ConstructedConstantValue constructedConstant = constant;
+      return constructedConstant.type.element ==
+          backend.jsAnonymousClass;
+    });
+  }
+
+  void _checkFunctionParameters(FunctionElement fn) {
+    if (fn.hasFunctionSignature &&
+        fn.functionSignature.optionalParametersAreNamed) {
+      backend.reporter.reportErrorMessage(fn,
+          MessageKind.JS_INTEROP_METHOD_WITH_NAMED_ARGUMENTS, {
+            'method': fn.name
+          });
+    }
+  }
+
+  void processJsInteropAnnotationsInLibrary(LibraryElement library) {
+    processJsInteropAnnotation(library);
+    library.implementation.forEachLocalMember((Element element) {
+      processJsInteropAnnotation(element);
+      if (!element.isJsInterop) return;
+      if (element is FunctionElement) {
+        _checkFunctionParameters(element);
+      }
+
+      if (!element.isClass) return;
+
+      ClassElement classElement = element;
+
+      if (!classElement
+          .implementsInterface(backend.jsJavaScriptObjectClass)) {
+        backend.reporter.reportErrorMessage(classElement,
+            MessageKind.JS_INTEROP_CLASS_CANNOT_EXTEND_DART_CLASS, {
+          'cls': classElement.name,
+          'superclass': classElement.superclass.name
+        });
+      }
+
+      classElement.forEachMember(
+          (ClassElement classElement, Element member) {
+        processJsInteropAnnotation(member);
+
+        if (!member.isSynthesized &&
+            classElement.isJsInterop &&
+            member is FunctionElement) {
+          FunctionElement fn = member;
+          if (!fn.isExternal && !fn.isAbstract && !fn.isConstructor &&
+              !fn.isStatic) {
+            backend.reporter.reportErrorMessage(
+                fn,
+                MessageKind.JS_INTEROP_CLASS_NON_EXTERNAL_MEMBER,
+                {'cls': classElement.name, 'member': member.name});
+          }
+
+          if (fn.isFactoryConstructor && hasAnonymousAnnotation(classElement)) {
+              fn.functionSignature.orderedForEachParameter(
+                  (ParameterElement parameter) {
+                if (!parameter.isNamed) {
+                  backend.reporter.reportErrorMessage(parameter,
+                    MessageKind
+                        .JS_OBJECT_LITERAL_CONSTRUCTOR_WITH_POSITIONAL_ARGUMENTS,
+                    {
+                      'parameter': parameter.name,
+                      'cls': classElement.name
+                    });
+              }
+            });
+          } else {
+            _checkFunctionParameters(fn);
+          }
+        }
+      });
+    });
+  }
+
+  jsAst.Statement buildJsInteropBootstrap() {
+    if (!enabledJsInterop) return null;
+    List<jsAst.Statement> statements = <jsAst.Statement>[];
+    backend.compiler.codegenWorld.forEachInvokedName(
+        (String name, Map<Selector, SelectorConstraints> selectors) {
+      selectors.forEach((Selector selector, SelectorConstraints constraints) {
+        if (selector.isClosureCall) {
+          // TODO(jacobr): support named arguments.
+          if (selector.namedArgumentCount > 0) return;
+          int argumentCount = selector.argumentCount;
+          var candidateParameterNames =
+              'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLOMOPQRSTUVWXYZ';
+          var parameters = new List<String>.generate(
+              argumentCount, (i) => candidateParameterNames[i]);
+
+          var name = backend.namer.invocationName(selector);
+          statements.add(js.statement(
+              'Function.prototype.# = function(#) { return this(#) }',
+              [name, parameters, parameters]));
+        }
+      });
+    });
+    return new jsAst.Block(statements);
+  }
+}
diff --git a/pkg/compiler/lib/src/js_backend/lookup_map_analysis.dart b/pkg/compiler/lib/src/js_backend/lookup_map_analysis.dart
new file mode 100644
index 0000000..a6c1990
--- /dev/null
+++ b/pkg/compiler/lib/src/js_backend/lookup_map_analysis.dart
@@ -0,0 +1,443 @@
+// 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.
+
+/// Analysis to determine how to generate code for `LookupMap`s.
+library compiler.src.js_backend.lookup_map_analysis;
+
+import '../common.dart';
+import '../common/registry.dart' show Registry;
+import '../compiler.dart' show Compiler;
+import '../constants/values.dart' show
+    ConstantValue,
+    ConstructedConstantValue,
+    ListConstantValue,
+    NullConstantValue,
+    StringConstantValue,
+    TypeConstantValue;
+import '../dart_types.dart' show DartType;
+import '../elements/elements.dart' show
+    ClassElement,
+    Element,
+    Elements,
+    FieldElement,
+    FunctionElement,
+    FunctionSignature,
+    LibraryElement,
+    VariableElement;
+import 'js_backend.dart' show JavaScriptBackend;
+import '../dart_types.dart' show DynamicType, InterfaceType;
+import 'package:pub_semver/pub_semver.dart';
+
+/// An analysis and optimization to remove unused entries from a `LookupMap`.
+///
+/// `LookupMaps` are defined in `package:lookup_map/lookup_map.dart`. They are
+/// simple maps that contain constant expressions as keys, and that only support
+/// the lookup operation.
+///
+/// This analysis and optimization will tree-shake the contents of the maps by
+/// looking at the program and finding which keys are clearly unused. Not all
+/// constants can be approximated statically, so this optimization is limited to
+/// the following keys:
+///
+///   * Const expressions that can only be created via const constructors. This
+///   excludes primitives, strings, and any const type that overrides the ==
+///   operator.
+///
+///   * Type literals.
+///
+/// Type literals are more complex than const expressions because they can be
+/// created in multiple ways. We can approximate the possible set of keys if we
+/// follow these rules:
+///
+///   * Include all type-literals used explicitly in the code (excluding
+///   obviously the uses that can be removed from LookupMaps)
+///
+///   * Include every reflectable type-literal if a mirror API is used to create
+///   types (e.g.  ClassMirror.reflectedType).
+///
+///   * Include all allocated types if the program contains `e.runtimeType`
+///   expressions.
+///
+///   * Include all generic-type arguments, if the program uses type
+///   variables in expressions such as `class A<T> { Type get extract => T }`.
+///
+// TODO(sigmund): add support for const expressions, currently this
+// implementation only supports Type literals. To support const expressions we
+// need to change some of the invariants below (e.g. we can no longer use the
+// ClassElement of a type to refer to keys we need to discover).
+// TODO(sigmund): detect uses of mirrors
+class LookupMapAnalysis {
+  /// Reference to [JavaScriptBackend] to be able to enqueue work when we
+  /// discover that a key in a map is potentially used.
+  final JavaScriptBackend backend;
+
+  /// Reference the diagnostic reporting system for logging and reporting issues
+  /// to the end-user.
+  final DiagnosticReporter reporter;
+
+  /// The resolved [VariableElement] associated with the top-level `_version`.
+  VariableElement lookupMapVersionVariable;
+
+  /// The resolved [LibraryElement] associated with
+  /// `package:lookup_map/lookup_map.dart`.
+  LibraryElement lookupMapLibrary;
+
+  /// The resolved [ClassElement] associated with `LookupMap`.
+  ClassElement typeLookupMapClass;
+
+  /// The resolved [FieldElement] for `LookupMap._entries`.
+  FieldElement entriesField;
+
+  /// The resolved [FieldElement] for `LookupMap._key`.
+  FieldElement keyField;
+
+  /// The resolved [FieldElement] for `LookupMap._value`.
+  FieldElement valueField;
+
+  /// Constant instances of `LookupMap` and information about them tracked by
+  /// this analysis.
+  final Map<ConstantValue, _LookupMapInfo> _lookupMaps = {};
+
+  /// Keys that we have discovered to be in use in the program.
+  final _inUse = new Set<ConstantValue>();
+
+  /// Internal helper to memoize the mapping between class elements and their
+  /// corresponding type constants.
+  final _typeConstants = <ClassElement, TypeConstantValue>{};
+
+  /// Internal helper to memoize which classes (ignoring Type) override equals.
+  ///
+  /// Const keys of these types will not be tree-shaken because we can't
+  /// statically guarantee that the program doesn't produce an equivalent key at
+  /// runtime. Technically if we limit lookup-maps to check for identical keys,
+  /// we could allow const instances of these types.  However, we internally use
+  /// a hash map within lookup-maps today, so we need this restriction.
+  final _typesWithEquals = <ClassElement, bool>{};
+
+  /// Pending work to do if we discover that a new key is in use. For each key
+  /// that we haven't seen, we record the list of lookup-maps that contain an
+  /// entry with that key.
+  final _pending = <ConstantValue, List<_LookupMapInfo>>{};
+
+  /// Whether the backend is currently processing the codegen queue.
+  bool _inCodegen = false;
+
+  LookupMapAnalysis(this.backend, this.reporter);
+
+  /// Whether this analysis and optimization is enabled.
+  bool get _isEnabled {
+    // `lookupMap==off` kept here to make it easy to test disabling this feature
+    if (const String.fromEnvironment('lookupMap') == 'off') return false;
+    return typeLookupMapClass != null;
+  }
+
+  /// Initializes this analysis by providing the resolved library. This is
+  /// invoked during resolution when the `lookup_map` library is discovered.
+  void init(LibraryElement library) {
+    lookupMapLibrary = library;
+    // We will enable the lookupMapAnalysis as long as we get a known version of
+    // the lookup_map package. We otherwise produce a warning.
+    lookupMapVersionVariable = library.implementation.findLocal('_version');
+    if (lookupMapVersionVariable == null) {
+      reporter.reportInfo(library,
+          MessageKind.UNRECOGNIZED_VERSION_OF_LOOKUP_MAP);
+    } else {
+      backend.compiler.enqueuer.resolution.addToWorkList(
+          lookupMapVersionVariable);
+    }
+  }
+
+  /// Checks if the version of lookup_map is valid, and if so, enable this
+  /// analysis during codegen.
+  void onCodegenStart() {
+    _inCodegen = true;
+    if (lookupMapVersionVariable == null) return;
+
+    // At this point, the lookupMapVersionVariable should be resolved and it's
+    // constant value should be available.
+    StringConstantValue value =
+        backend.constants.getConstantValueForVariable(lookupMapVersionVariable);
+    if (value == null) {
+      reporter.reportInfo(lookupMapVersionVariable,
+          MessageKind.UNRECOGNIZED_VERSION_OF_LOOKUP_MAP);
+      return;
+    }
+
+    // TODO(sigmund): add proper version resolution using the pub_semver package
+    // when we introduce the next version.
+    Version version;
+    try {
+      version = new Version.parse(value.primitiveValue.slowToString());
+    } catch (e) {}
+
+    if (version == null || !_validLookupMapVersionConstraint.allows(version)) {
+      reporter.reportInfo(lookupMapVersionVariable,
+          MessageKind.UNRECOGNIZED_VERSION_OF_LOOKUP_MAP);
+      return;
+    }
+
+    ClassElement cls = lookupMapLibrary.findLocal('LookupMap');
+    cls.computeType(backend.resolution);
+    entriesField = cls.lookupMember('_entries');
+    keyField = cls.lookupMember('_key');
+    valueField = cls.lookupMember('_value');
+    // TODO(sigmund): Maybe inline nested maps to make the output code smaller?
+    typeLookupMapClass = cls;
+  }
+
+  /// Whether [constant] is an instance of a `LookupMap`.
+  bool isLookupMap(ConstantValue constant) =>
+      _isEnabled &&
+      constant is ConstructedConstantValue &&
+      constant.type.asRaw().element.isSubclassOf(typeLookupMapClass);
+
+  /// Registers an instance of a lookup-map with the analysis.
+  void registerLookupMapReference(ConstantValue lookupMap) {
+    if (!_isEnabled || !_inCodegen) return;
+    assert(isLookupMap(lookupMap));
+    _lookupMaps.putIfAbsent(lookupMap,
+        () => new _LookupMapInfo(lookupMap, this).._updateUsed());
+  }
+
+  /// Whether [key] is a constant value whose type overrides equals.
+  bool _overridesEquals(ConstantValue key) {
+    if (key is ConstructedConstantValue) {
+      ClassElement element = key.type.element;
+      return _typesWithEquals.putIfAbsent(element, () =>
+          element.lookupMember('==').enclosingClass !=
+          backend.compiler.objectClass);
+    }
+    return false;
+  }
+
+  /// Whether we need to preserve [key]. This is true for keys that are not
+  /// candidates for tree-shaking in the first place (primitives and non-type
+  /// const values overriding equals) and keys that we have seen in the program.
+  bool _shouldKeep(ConstantValue key) =>
+      key.isPrimitive || _inUse.contains(key) || _overridesEquals(key);
+
+  void _addClassUse(ClassElement cls) {
+    ConstantValue key = _typeConstants.putIfAbsent(cls,
+        () => backend.constantSystem.createType(backend.compiler, cls.rawType));
+    _addUse(key);
+  }
+
+  /// Record that [key] is used and update every lookup map that contains it.
+  void _addUse(ConstantValue key) {
+    if (_inUse.add(key)) {
+      _pending[key]?.forEach((info) => info._markUsed(key));
+      _pending.remove(key);
+    }
+  }
+
+  /// If [key] is a type, cache it in [_typeConstants].
+  _registerTypeKey(ConstantValue key) {
+    if (key is TypeConstantValue) {
+      ClassElement cls = key.representedType.element;
+      if (cls == null || !cls.isClass) {
+        // TODO(sigmund): report error?
+        return;
+      }
+      _typeConstants[cls] = key;
+    }
+  }
+
+  /// Callback from the enqueuer, invoked when [element] is instantiated.
+  void registerInstantiatedClass(ClassElement element) {
+    if (!_isEnabled || !_inCodegen) return;
+    // TODO(sigmund): only add if .runtimeType is ever used
+    _addClassUse(element);
+  }
+
+  /// Callback from the enqueuer, invoked when [type] is instantiated.
+  void registerInstantiatedType(InterfaceType type, Registry registry) {
+    if (!_isEnabled || !_inCodegen) return;
+    // TODO(sigmund): only add if .runtimeType is ever used
+    _addClassUse(type.element);
+    // TODO(sigmund): only do this when type-argument expressions are used?
+    _addGenerics(type, registry);
+  }
+
+  /// Records generic type arguments in [type], in case they are retrieved and
+  /// returned using a type-argument expression.
+  void _addGenerics(InterfaceType type, Registry registry) {
+    if (!type.isGeneric) return;
+    for (var arg in type.typeArguments) {
+      if (arg is InterfaceType) {
+        _addClassUse(arg.element);
+        // Note: this call was needed to generate correct code for
+        // type_lookup_map/generic_type_test
+        // TODO(sigmund): can we get rid of this?
+        backend.registerInstantiatedConstantType(
+            backend.typeImplementation.rawType, registry);
+        _addGenerics(arg, registry);
+      }
+    }
+  }
+
+  /// Callback from the codegen enqueuer, invoked when a constant (which is
+  /// possibly a const key or a type literal) is used in the program.
+  void registerTypeConstant(ClassElement element) {
+    if (!_isEnabled || !_inCodegen) return;
+    _addClassUse(element);
+  }
+
+  void registerConstantKey(ConstantValue constant) {
+    if (!_isEnabled || !_inCodegen) return;
+    if (constant.isPrimitive || _overridesEquals(constant)) return;
+    _addUse(constant);
+  }
+
+  /// Callback from the backend, invoked when reaching the end of the enqueuing
+  /// process, but before emitting the code. At this moment we have discovered
+  /// all types used in the program and we can tree-shake anything that is
+  /// unused.
+  void onQueueClosed() {
+    if (!_isEnabled || !_inCodegen) return;
+
+    _lookupMaps.values.forEach((info) {
+      assert (!info.emitted);
+      info.emitted = true;
+      info._prepareForEmission();
+    });
+
+    // When --verbose is passed, we show the total number and set of keys that
+    // were tree-shaken from lookup maps.
+    Compiler compiler = backend.compiler;
+    if (compiler.verbose) {
+      var sb = new StringBuffer();
+      int count = 0;
+      for (var info in _lookupMaps.values) {
+        for (var key in info.unusedEntries.keys) {
+          if (count != 0) sb.write(',');
+          sb.write(key.unparse());
+          count++;
+        }
+      }
+      reporter.log(count == 0
+          ? 'lookup-map: nothing was tree-shaken'
+          : 'lookup-map: found $count unused keys ($sb)');
+    }
+
+    // Release resources.
+    _lookupMaps.clear();
+    _pending.clear();
+    _inUse.clear();
+  }
+}
+
+/// Internal information about the entries on a lookup-map.
+class _LookupMapInfo {
+  /// The original reference to the constant value.
+  ///
+  /// This reference will be mutated in place to remove it's entries when the
+  /// map is first seen during codegen, and to restore them (or a subset of
+  /// them) when we have finished discovering which entries are used. This has
+  /// the side-effect that `orignal.getDependencies()` will be empty during
+  /// most of codegen until we are ready to emit the constants. However,
+  /// restoring the entries before emitting code lets us keep the emitter logic
+  /// agnostic of this optimization.
+  final ConstructedConstantValue original;
+
+  /// Reference to the lookup map analysis to be able to refer to data shared
+  /// accross infos.
+  final LookupMapAnalysis analysis;
+
+  /// Whether we have already emitted this constant.
+  bool emitted = false;
+
+  /// Whether the `LookupMap` constant was built using the `LookupMap.pair`
+  /// constructor.
+  bool singlePair;
+
+  /// Entries in the lookup map whose keys have not been seen in the rest of the
+  /// program.
+  Map<ConstantValue, ConstantValue> unusedEntries =
+      <ConstantValue, ConstantValue> {};
+
+  /// Entries that have been used, and thus will be part of the generated code.
+  Map<ConstantValue, ConstantValue> usedEntries =
+      <ConstantValue, ConstantValue> {};
+
+  /// Creates and initializes the information containing all keys of the
+  /// original map marked as unused.
+  _LookupMapInfo(this.original, this.analysis) {
+    ConstantValue key = original.fields[analysis.keyField];
+    singlePair = !key.isNull;
+
+    if (singlePair) {
+      unusedEntries[key] = original.fields[analysis.valueField];
+
+      // Note: we modify the constant in-place, see comment in [original].
+      original.fields[analysis.keyField] = new NullConstantValue();
+      original.fields[analysis.valueField] = new NullConstantValue();
+    } else {
+      ListConstantValue list = original.fields[analysis.entriesField];
+      List<ConstantValue> keyValuePairs = list.entries;
+      for (int i = 0; i < keyValuePairs.length; i += 2) {
+        ConstantValue key = keyValuePairs[i];
+        unusedEntries[key] = keyValuePairs[i + 1];
+      }
+
+      // Note: we modify the constant in-place, see comment in [original].
+      original.fields[analysis.entriesField] =
+          new ListConstantValue(list.type, []);
+    }
+  }
+
+  /// Check every key in unusedEntries and mark it as used if the analysis has
+  /// already discovered them. This is meant to be called once to finalize
+  /// initialization after constructing an instance of this class. Afterwards,
+  /// we call [_markUsed] on each individual key as it gets discovered.
+  void _updateUsed() {
+    // Note: we call toList because `_markUsed` modifies the map.
+    for (ConstantValue key in unusedEntries.keys.toList()) {
+      analysis._registerTypeKey(key);
+      if (analysis._shouldKeep(key)) {
+        _markUsed(key);
+      } else {
+        analysis._pending.putIfAbsent(key, () => []).add(this);
+      }
+    }
+  }
+
+  /// Marks that [key] has been seen, and thus, the corresponding entry in this
+  /// map should be considered reachable.
+  _markUsed(ConstantValue key) {
+    assert(!emitted);
+    assert(unusedEntries.containsKey(key));
+    assert(!usedEntries.containsKey(key));
+    ConstantValue constant = unusedEntries.remove(key);
+    usedEntries[key] = constant;
+    analysis.backend.registerCompileTimeConstant(constant,
+        analysis.backend.compiler.globalDependencies,
+        addForEmission: false);
+  }
+
+  /// Restores [original] to contain all of the entries marked as possibly used.
+  void _prepareForEmission() {
+    ListConstantValue originalEntries = original.fields[analysis.entriesField];
+    DartType listType = originalEntries.type;
+    List<ConstantValue> keyValuePairs = <ConstantValue>[];
+    usedEntries.forEach((key, value) {
+      keyValuePairs.add(key);
+      keyValuePairs.add(value);
+    });
+
+    // Note: we are restoring the entries here, see comment in [original].
+    if (singlePair) {
+      assert (keyValuePairs.length == 0 || keyValuePairs.length == 2);
+      if (keyValuePairs.length == 2) {
+        original.fields[analysis.keyField] = keyValuePairs[0];
+        original.fields[analysis.valueField] = keyValuePairs[1];
+      }
+    } else {
+      original.fields[analysis.entriesField] =
+          new ListConstantValue(listType, keyValuePairs);
+    }
+  }
+}
+
+final _validLookupMapVersionConstraint =
+    new VersionConstraint.parse('^0.0.1');
diff --git a/pkg/compiler/lib/src/js_backend/namer.dart b/pkg/compiler/lib/src/js_backend/namer.dart
index ad7f725..783b518 100644
--- a/pkg/compiler/lib/src/js_backend/namer.dart
+++ b/pkg/compiler/lib/src/js_backend/namer.dart
@@ -457,17 +457,19 @@
 
   JavaScriptBackend get backend => compiler.backend;
 
+  DiagnosticReporter get reporter => compiler.reporter;
+
   String get deferredTypesName => 'deferredTypes';
   String get isolateName => 'Isolate';
   String get isolatePropertiesName => r'$isolateProperties';
-  jsAst.Name get noSuchMethodName => publicInstanceMethodNameByArity(
-      Compiler.NO_SUCH_METHOD, Compiler.NO_SUCH_METHOD_ARG_COUNT);
+  jsAst.Name get noSuchMethodName => invocationName(Selectors.noSuchMethod_);
+
   /**
    * Some closures must contain their name. The name is stored in
    * [STATIC_CLOSURE_NAME_NAME].
    */
   String get STATIC_CLOSURE_NAME_NAME => r'$name';
-  String get closureInvocationSelectorName => Compiler.CALL_OPERATOR_NAME;
+  String get closureInvocationSelectorName => Identifiers.call;
   bool get shouldMinify => false;
 
   /// Returns the string that is to be used as the result of a call to
@@ -513,13 +515,22 @@
       case JsGetName.FUNCTION_CLASS_TYPE_NAME:
         return runtimeTypeName(compiler.functionClass);
       default:
-        compiler.reportError(
-          node, MessageKind.GENERIC,
+        reporter.reportErrorMessage(
+          node,
+          MessageKind.GENERIC,
           {'text': 'Error: Namer has no name for "$name".'});
         return asName('BROKEN');
     }
   }
 
+  /// Return a reference to the given [name].
+  ///
+  /// This is used to ensure that every use site of a name has a unique node so
+  /// that we can properly attribute source information.
+  jsAst.Name _newReference(jsAst.Name name) {
+    return new _NameReference(name);
+  }
+
   /// Disambiguated name for [constant].
   ///
   /// Unique within the global-member namespace.
@@ -534,7 +545,7 @@
       result = getFreshName(NamingScope.constant, longName);
       constantNames[constant] = result;
     }
-    return result;
+    return _newReference(result);
   }
 
   /// Proposed name for [constant].
@@ -625,11 +636,30 @@
     return invocationName(new Selector.fromElement(method));
   }
 
-  /// Annotated name for a public method with the given [originalName]
-  /// and [arity] and no named parameters.
-  jsAst.Name publicInstanceMethodNameByArity(String originalName,
-                                             int arity) {
-    return invocationName(new Selector.call(originalName, null, arity));
+  String _jsNameHelper(Element e) {
+    if (e.jsInteropName != null && e.jsInteropName.isNotEmpty)
+      return e.jsInteropName;
+    return e.isLibrary ? 'self' : e.name;
+  }
+
+  /// Returns a JavaScript path specifying the context in which
+  /// [element.fixedBackendName] should be evaluated. Only applicable for
+  /// elements using typed JavaScript interop.
+  /// For example: fixedBackendPath for the static method createMap in the
+  /// Map class of the goog.map JavaScript library would have path
+  /// "goog.maps.Map".
+  String fixedBackendPath(Element element) {
+    if (!element.isJsInterop) return null;
+    if (element.isInstanceMember) return 'this';
+    if (element.isConstructor) return fixedBackendPath(element.enclosingClass);
+    if (element.isLibrary) return 'self';
+    var sb = new StringBuffer();
+    sb..write(_jsNameHelper(element.library));
+
+    if (element.enclosingClass != null && element.enclosingClass != element) {
+      sb..write('.')..write(_jsNameHelper(element.enclosingClass));
+    }
+    return sb.toString();
   }
 
   /// Returns the annotated name for a variant of `call`.
@@ -694,7 +724,7 @@
 
       case SelectorKind.CALL:
         List<String> suffix = callSuffixForStructure(selector.callStructure);
-        if (selector.name == Compiler.CALL_OPERATOR_NAME) {
+        if (selector.name == Identifiers.call) {
           // Derive the annotated name for this variant of 'call'.
           return deriveCallMethodName(suffix);
         }
@@ -703,7 +733,8 @@
         return disambiguatedName; // Methods other than call are not annotated.
 
       default:
-        compiler.internalError(compiler.currentElement,
+        reporter.internalError(
+            CURRENT_ELEMENT_SPANNABLE,
             'Unexpected selector kind: ${selector.kind}');
         return null;
     }
@@ -761,11 +792,6 @@
     ClassElement enclosingClass = element.enclosingClass;
 
     if (element.hasFixedBackendName) {
-      // Certain native fields must be given a specific name. Native names must
-      // not contain '$'. We rely on this to avoid clashes.
-      assert(enclosingClass.isNative &&
-             !element.fixedBackendName.contains(r'$'));
-
       return new StringBackedName(element.fixedBackendName);
     }
 
@@ -855,7 +881,7 @@
       newName = getFreshName(NamingScope.global, name);
       internalGlobals[name] = newName;
     }
-    return newName;
+    return _newReference(newName);
   }
 
   /// Returns the property name to use for a compiler-owner global variable,
@@ -902,7 +928,7 @@
       newName = getFreshName(NamingScope.global, proposedName);
       userGlobals[element] = newName;
     }
-    return newName;
+    return _newReference(newName);
   }
 
   /// Returns the disambiguated name for an instance method or field
@@ -943,7 +969,7 @@
                              sanitizeForAnnotations: true);
       userInstanceMembers[key] = newName;
     }
-    return newName;
+    return _newReference(newName);
   }
 
   /// Returns the disambiguated name for the instance member identified by
@@ -966,7 +992,7 @@
                              sanitizeForAnnotations: true);
       userInstanceMembers[key] = newName;
     }
-    return newName;
+    return _newReference(newName);
   }
 
   /// Forces the public instance member with [originalName] to have the given
@@ -1006,7 +1032,7 @@
                              sanitizeForNatives: mayClashNative);
       internalInstanceMembers[element] = newName;
     }
-    return newName;
+    return _newReference(newName);
   }
 
   /// Disambiguated name for the given operator.
@@ -1021,7 +1047,7 @@
       newName = getFreshName(NamingScope.instance, operatorIdentifier);
       userInstanceOperators[operatorIdentifier] = newName;
     }
-    return newName;
+    return _newReference(newName);
   }
 
   String _generateFreshStringForName(String proposedName,
@@ -1143,12 +1169,12 @@
       LibraryElement library = element;
       name = libraryLongNames[library];
       if (name != null) return name;
-      name = library.getLibraryOrScriptName();
+      name = library.libraryOrScriptName;
       if (name.contains('.')) {
         // For libraries that have a library tag, we use the last part
         // of the fully qualified name as their base name. For all other
         // libraries, we use the first part of their filename.
-        name = library.hasLibraryName()
+        name = library.hasLibraryName
             ? name.substring(name.lastIndexOf('.') + 1)
             : name.substring(0, name.indexOf('.'));
       }
@@ -1345,7 +1371,7 @@
       return 'P';
     }
     return userGlobalObjects[
-        library.getLibraryOrScriptName().hashCode % userGlobalObjects.length];
+        library.libraryOrScriptName.hashCode % userGlobalObjects.length];
   }
 
   jsAst.Name deriveLazyInitializerName(jsAst.Name name) {
@@ -1389,7 +1415,7 @@
 
   String get functionTypeTag => r'func';
 
-  String get functionTypeVoidReturnTag => r'void';
+  String get functionTypeVoidReturnTag => r'v';
 
   String get functionTypeReturnTypeTag => r'ret';
 
@@ -1579,6 +1605,8 @@
 
   ConstantNamingVisitor(this.compiler, this.hasher);
 
+  DiagnosticReporter get reporter => compiler.reporter;
+
   String getName(ConstantValue constant) {
     _visit(constant);
     if (root == null) return 'CONSTANT';
@@ -1709,11 +1737,17 @@
 
   @override
   void visitType(TypeConstantValue constant, [_]) {
+    // Generates something like 'Type_String_k8F', using the simple name of the
+    // type and a hash to disambiguate the same name in different libraries.
     addRoot('Type');
     DartType type = constant.representedType;
-    JavaScriptBackend backend = compiler.backend;
-    String name = backend.rti.getTypeRepresentationForTypeConstant(type);
+    String name = type.element?.name;
+    if (name == null) {  // e.g. DartType 'dynamic' has no element.
+      JavaScriptBackend backend = compiler.backend;
+      name = backend.rtiEncoder.getTypeRepresentationForTypeConstant(type);
+    }
     addIdentifier(name);
+    add(getHashTag(constant, 3));
   }
 
   @override
@@ -1729,13 +1763,13 @@
         add('dummy_receiver');
         break;
       case SyntheticConstantKind.TYPEVARIABLE_REFERENCE:
-        add('type_variable_reference');
+        // Omit. These are opaque deferred indexes with nothing helpful to add.
         break;
       case SyntheticConstantKind.NAME:
         add('name');
         break;
       default:
-        compiler.internalError(compiler.currentElement,
+        reporter.internalError(CURRENT_ELEMENT_SPANNABLE,
                                "Unexpected SyntheticConstantValue");
     }
   }
@@ -1765,6 +1799,8 @@
 
   ConstantCanonicalHasher(this.compiler);
 
+  DiagnosticReporter get reporter => compiler.reporter;
+
   int getHash(ConstantValue constant) => _visit(constant);
 
   int _visit(ConstantValue constant) {
@@ -1828,7 +1864,8 @@
   int visitType(TypeConstantValue constant, [_]) {
     DartType type = constant.representedType;
     JavaScriptBackend backend = compiler.backend;
-    String name = backend.rti.getTypeRepresentationForTypeConstant(type);
+    // This name includes the library name and type parameters.
+    String name = backend.rtiEncoder.getTypeRepresentationForTypeConstant(type);
     return _hashString(4, name);
   }
 
@@ -1839,15 +1876,19 @@
   }
 
   @override
-  visitSynthetic(SyntheticConstantValue constant, [_]) {
+  int visitSynthetic(SyntheticConstantValue constant, [_]) {
     switch (constant.kind) {
       case SyntheticConstantKind.TYPEVARIABLE_REFERENCE:
-        return constant.payload.hashCode;
+        // These contain a deferred opaque index into metadata. There is nothing
+        // we can access that is stable between compiles.  Luckily, since they
+        // resolve to integer indexes, they're always part of a larger constant.
+        return 0;
       default:
-        compiler.internalError(NO_LOCATION_SPANNABLE,
-                               'SyntheticConstantValue should never be named and '
-                               'never be subconstant');
-        return null;
+        reporter.internalError(
+            NO_LOCATION_SPANNABLE,
+            'SyntheticConstantValue should never be named and '
+            'never be subconstant');
+        return 0;
     }
   }
 
@@ -1950,7 +1991,7 @@
   }
 
   visitFunctionType(FunctionType type, _) {
-    if (backend.rti.isSimpleFunctionType(type)) {
+    if (backend.rtiEncoder.isSimpleFunctionType(type)) {
       sb.write('args${type.parameterTypes.length}');
       return;
     }
@@ -1987,4 +2028,4 @@
   global,
   instance,
   constant
-}
\ No newline at end of file
+}
diff --git a/pkg/compiler/lib/src/js_backend/namer_names.dart b/pkg/compiler/lib/src/js_backend/namer_names.dart
index 3d0e1f3..60e1597 100644
--- a/pkg/compiler/lib/src/js_backend/namer_names.dart
+++ b/pkg/compiler/lib/src/js_backend/namer_names.dart
@@ -6,6 +6,7 @@
 
 abstract class _NamerName extends jsAst.Name {
   int get _kind;
+  _NamerName get _target => this;
 
   toString() => throw new UnsupportedError("Cannot convert a name to a string");
 }
@@ -28,6 +29,7 @@
   String get key => name;
 
   operator==(other) {
+    if (other is _NameReference) other = other._target;
     if (identical(this, other)) return true;
     return (other is StringBackedName) && other.name == name;
   }
@@ -35,6 +37,7 @@
   int get hashCode => name.hashCode;
 
   int compareTo(_NamerName other) {
+    other = other._target;
     if (other._kind != _kind) return other._kind - _kind;
     return name.compareTo(other.name);
   }
@@ -54,6 +57,7 @@
   String get key => prefix.key + base.key;
 
   bool operator==(other) {
+    if (other is _NameReference) other = other._target;
     if (identical(this, other)) return true;
     if (other is! _PrefixedName) return false;
     return other.base == base && other.prefix == prefix;
@@ -62,6 +66,7 @@
   int get hashCode => base.hashCode * 13 + prefix.hashCode;
 
   int compareTo(_NamerName other) {
+    other = other._target;
     if (other._kind != _kind) return other._kind - _kind;
     _PrefixedName otherSameKind = other;
     int result = prefix.compareTo(otherSameKind.prefix);
@@ -116,6 +121,7 @@
   String get key => _parts.map((_NamerName name) => name.key).join();
 
   bool operator==(other) {
+    if (other is _NameReference) other = other._target;
     if (identical(this, other)) return true;
     if (other is! CompoundName) return false;
     if (other._parts.length != _parts.length) return false;
@@ -136,6 +142,7 @@
   }
 
   int compareTo(_NamerName other) {
+    other = other._target;
     if (other._kind != _kind) return other._kind - _kind;
     CompoundName otherSameKind = other;
     if (otherSameKind._parts.length != _parts.length) {
@@ -167,6 +174,7 @@
 
   @override
   int compareTo(_NamerName other) {
+    other = other._target;
     if (other._kind != _kind) return other._kind - _kind;
     TokenName otherToken = other;
     return key.compareTo(otherToken.key);
@@ -174,8 +182,41 @@
 
   markSeen(jsAst.TokenCounter counter) => _rc++;
 
+  @override
+  bool operator==(other) {
+    if (other is _NameReference) other = other._target;
+    if (identical(this, other)) return true;
+    return false;
+  }
+
+  @override
+  int get hashCode => super.hashCode;
+
   finalize() {
-    assert(!isFinalized);
+    assert(invariant(NO_LOCATION_SPANNABLE, !isFinalized,
+        message: "TokenName($key)=$_name has already been finalized."));
     _name = _scope.getNextName();
   }
+}
+
+class _NameReference extends _NamerName implements jsAst.AstContainer {
+  _NamerName _target;
+
+  int get _kind => _target._kind;
+  String get key => _target.key;
+
+  Iterable<jsAst.Node> get containedNodes => [_target];
+
+  _NameReference(this._target);
+
+  String get name => _target.name;
+
+  @override
+  int compareTo(_NamerName other) => _target.compareTo(other);
+
+  @override
+  bool operator==(other) => _target == other;
+
+  @override
+  int get hashCode => _target.hashCode;
 }
\ No newline at end of file
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 38d4704..3bb7e45 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
@@ -59,6 +59,8 @@
       : this._backend = backend,
         this._compiler = backend.compiler;
 
+  DiagnosticReporter get reporter => _compiler.reporter;
+
   bool get hasThrowingNoSuchMethod => throwingImpls.isNotEmpty;
   bool get hasComplexNoSuchMethod => otherImpls.isNotEmpty;
 
@@ -82,20 +84,20 @@
   void emitDiagnostic() {
     throwingImpls.forEach((e) {
         if (!_hasForwardingSyntax(e)) {
-          _compiler.reportHint(e,
-                               MessageKind.DIRECTLY_THROWING_NSM);
+          reporter.reportHintMessage(
+              e, MessageKind.DIRECTLY_THROWING_NSM);
         }
       });
     complexNoReturnImpls.forEach((e) {
         if (!_hasForwardingSyntax(e)) {
-          _compiler.reportHint(e,
-                               MessageKind.COMPLEX_THROWING_NSM);
+          reporter.reportHintMessage(
+              e, MessageKind.COMPLEX_THROWING_NSM);
         }
       });
     complexReturningImpls.forEach((e) {
         if (!_hasForwardingSyntax(e)) {
-          _compiler.reportHint(e,
-                               MessageKind.COMPLEX_RETURNING_NSM);
+          reporter.reportHintMessage(
+              e, MessageKind.COMPLEX_RETURNING_NSM);
         }
       });
   }
@@ -104,7 +106,7 @@
   /// implementation. An implementation is complex if it falls into
   /// category C, as described above.
   bool isComplex(FunctionElement element) {
-    assert(element.name == Compiler.NO_SUCH_METHOD);
+    assert(element.name == Identifiers.noSuchMethod_);
     return otherImpls.contains(element);
   }
 
@@ -119,7 +121,7 @@
   }
 
   NsmCategory _categorizeImpl(FunctionElement element) {
-    assert(element.name == Compiler.NO_SUCH_METHOD);
+    assert(element.name == Identifiers.noSuchMethod_);
     if (defaultImpls.contains(element)) {
       return NsmCategory.DEFAULT;
     }
@@ -129,7 +131,7 @@
     if (otherImpls.contains(element)) {
       return NsmCategory.OTHER;
     }
-    if (!_compiler.noSuchMethodSelector.signatureApplies(element)) {
+    if (!Selectors.noSuchMethod_.signatureApplies(element)) {
       otherImpls.add(element);
       return NsmCategory.OTHER;
     }
@@ -140,7 +142,7 @@
       // If the implementation is 'noSuchMethod(x) => super.noSuchMethod(x);'
       // then it is in the same category as the super call.
       Element superCall = element.enclosingClass
-          .lookupSuperByName(_compiler.noSuchMethodSelector.memberName);
+          .lookupSuperByName(Selectors.noSuchMethod_.memberName);
       NsmCategory category = _categorizeImpl(superCall);
       switch(category) {
         case NsmCategory.DEFAULT:
@@ -190,7 +192,7 @@
     if (expr is Send &&
         expr.isSuperCall &&
         expr.selector is Identifier &&
-        (expr.selector as Identifier).source == Compiler.NO_SUCH_METHOD) {
+        (expr.selector as Identifier).source == Identifiers.noSuchMethod_) {
       var arg = expr.arguments.head;
       if (expr.arguments.tail.isEmpty &&
           arg is Send &&
diff --git a/pkg/compiler/lib/src/js_backend/patch_resolver.dart b/pkg/compiler/lib/src/js_backend/patch_resolver.dart
index 166490f..c8e609d 100644
--- a/pkg/compiler/lib/src/js_backend/patch_resolver.dart
+++ b/pkg/compiler/lib/src/js_backend/patch_resolver.dart
@@ -4,7 +4,13 @@
 
 library dart2js.js_backend.patch_resolver;
 
-import '../dart2jslib.dart';
+import '../common.dart';
+import '../common/resolution.dart' show
+    Resolution;
+import '../common/tasks.dart' show
+    CompilerTask;
+import '../compiler.dart' show
+    Compiler;
 import '../dart_types.dart';
 import '../elements/elements.dart';
 import '../elements/modelx.dart';
@@ -13,19 +19,20 @@
 class PatchResolverTask extends CompilerTask {
   PatchResolverTask(Compiler compiler) : super(compiler);
 
+  Resolution get resolution => compiler.resolution;
+
   String get name => 'JavaScript patch resolver';
 
   FunctionElement resolveExternalFunction(FunctionElementX element) {
     if (element.isPatched) {
       FunctionElementX patch = element.patch;
-      compiler.withCurrentElement(patch, () {
-        patch.parseNode(compiler);
-        patch.computeType(compiler);
+      reporter.withCurrentElement(patch, () {
+        patch.computeType(resolution);
       });
       checkMatchingPatchSignatures(element, patch);
       element = patch;
-    } else {
-      compiler.reportError(
+    } else if (!element.isJsInterop) {
+      reporter.reportErrorMessage(
          element, MessageKind.PATCH_EXTERNAL_WITHOUT_IMPLEMENTATION);
     }
     return element;
@@ -47,19 +54,23 @@
         assert(invariant(origin, originParameter.patch == patchParameter,
                message: "Inconsistent repatch of $originParameter."));
       }
-      DartType originParameterType = originParameter.computeType(compiler);
-      DartType patchParameterType = patchParameter.computeType(compiler);
+      DartType originParameterType = originParameter.computeType(resolution);
+      DartType patchParameterType = patchParameter.computeType(resolution);
       if (originParameterType != patchParameterType) {
-        compiler.reportError(
-            originParameter.parseNode(compiler),
-            MessageKind.PATCH_PARAMETER_TYPE_MISMATCH,
-            {'methodName': origin.name,
-             'parameterName': originParameter.name,
-             'originParameterType': originParameterType,
-             'patchParameterType': patchParameterType});
-        compiler.reportInfo(patchParameter,
-            MessageKind.PATCH_POINT_TO_PARAMETER,
-            {'parameterName': patchParameter.name});
+        reporter.reportError(
+            reporter.createMessage(
+                originParameter,
+                MessageKind.PATCH_PARAMETER_TYPE_MISMATCH,
+                {'methodName': origin.name,
+                 'parameterName': originParameter.name,
+                 'originParameterType': originParameterType,
+                 'patchParameterType': patchParameterType}),
+            <DiagnosticMessage>[
+              reporter.createMessage(
+                  patchParameter,
+                  MessageKind.PATCH_POINT_TO_PARAMETER,
+                  {'parameterName': patchParameter.name}),
+            ]);
       } else {
         // Hack: Use unparser to test parameter equality. This only works
         // because we are restricting patch uses and the approach cannot be used
@@ -67,23 +78,26 @@
 
         // The node contains the type, so there is a potential overlap.
         // Therefore we only check the text if the types are identical.
-        String originParameterText =
-            originParameter.parseNode(compiler).toString();
-        String patchParameterText =
-            patchParameter.parseNode(compiler).toString();
+        String originParameterText = originParameter.node.toString();
+        String patchParameterText = patchParameter.node.toString();
         if (originParameterText != patchParameterText
             // We special case the list constructor because of the
             // optional parameter.
             && origin != compiler.unnamedListConstructor) {
-          compiler.reportError(
-              originParameter.parseNode(compiler),
-              MessageKind.PATCH_PARAMETER_MISMATCH,
-              {'methodName': origin.name,
-               'originParameter': originParameterText,
-               'patchParameter': patchParameterText});
-          compiler.reportInfo(patchParameter,
-              MessageKind.PATCH_POINT_TO_PARAMETER,
-              {'parameterName': patchParameter.name});
+          reporter.reportError(
+              reporter.createMessage(
+                  originParameter,
+                  MessageKind.PATCH_PARAMETER_MISMATCH,
+                  {'methodName': origin.name,
+                   'originParameter': originParameterText,
+                   'patchParameter': patchParameterText}),
+              <DiagnosticMessage>[
+                  reporter.createMessage(
+                      patchParameter,
+                      MessageKind.PATCH_POINT_TO_PARAMETER,
+                      {'parameterName': patchParameter.name}),
+              ]);
+
         }
       }
     }
@@ -97,10 +111,10 @@
     FunctionSignature patchSignature = patch.functionSignature;
 
     if (originSignature.type.returnType != patchSignature.type.returnType) {
-      compiler.withCurrentElement(patch, () {
+      reporter.withCurrentElement(patch, () {
         Node errorNode =
             patchTree.returnType != null ? patchTree.returnType : patchTree;
-        compiler.reportError(
+        reporter.reportErrorMessage(
             errorNode, MessageKind.PATCH_RETURN_TYPE_MISMATCH,
             {'methodName': origin.name,
              'originReturnType': originSignature.type.returnType,
@@ -109,8 +123,8 @@
     }
     if (originSignature.requiredParameterCount !=
         patchSignature.requiredParameterCount) {
-      compiler.withCurrentElement(patch, () {
-        compiler.reportError(
+      reporter.withCurrentElement(patch, () {
+        reporter.reportErrorMessage(
             patchTree,
             MessageKind.PATCH_REQUIRED_PARAMETER_COUNT_MISMATCH,
             {'methodName': origin.name,
@@ -126,8 +140,8 @@
         patchSignature.optionalParameterCount != 0) {
       if (originSignature.optionalParametersAreNamed !=
           patchSignature.optionalParametersAreNamed) {
-        compiler.withCurrentElement(patch, () {
-          compiler.reportError(
+        reporter.withCurrentElement(patch, () {
+          reporter.reportErrorMessage(
               patchTree,
               MessageKind.PATCH_OPTIONAL_PARAMETER_NAMED_MISMATCH,
               {'methodName': origin.name});
@@ -136,8 +150,8 @@
     }
     if (originSignature.optionalParameterCount !=
         patchSignature.optionalParameterCount) {
-      compiler.withCurrentElement(patch, () {
-        compiler.reportError(
+      reporter.withCurrentElement(patch, () {
+        reporter.reportErrorMessage(
             patchTree,
             MessageKind.PATCH_OPTIONAL_PARAMETER_COUNT_MISMATCH,
             {'methodName': origin.name,
diff --git a/pkg/compiler/lib/src/js_backend/runtime_types.dart b/pkg/compiler/lib/src/js_backend/runtime_types.dart
index d6f02eb..a5136ad 100644
--- a/pkg/compiler/lib/src/js_backend/runtime_types.dart
+++ b/pkg/compiler/lib/src/js_backend/runtime_types.dart
@@ -15,29 +15,122 @@
 typedef jsAst.Expression OnVariableCallback(TypeVariableType variable);
 typedef bool ShouldEncodeTypedefCallback(TypedefType variable);
 
-class RuntimeTypes {
+// TODO(johnniwinther): Rename to something like [RuntimeTypeUsageCollector]
+// we semantics is more clear.
+abstract class RuntimeTypes {
+  TypeChecks get requiredChecks;
+  Iterable<ClassElement> get classesNeedingRti;
+  Iterable<Element> get methodsNeedingRti;
+
+  /// The set of classes that use one of their type variables as expressions
+  /// to get the runtime type.
+  Iterable<ClassElement> get classesUsingTypeVariableExpression;
+
+  void registerClassUsingTypeVariableExpression(ClassElement cls);
+  void registerRtiDependency(Element element, Element dependency);
+  void registerTypeVariableBoundsSubtypeCheck(DartType typeArgument,
+                                              DartType bound);
+
+  Set<ClassElement> getClassesUsedInSubstitutions(JavaScriptBackend backend,
+                                                  TypeChecks checks);
+  void computeClassesNeedingRti();
+
+  /// Compute the required type checkes and substitutions for the given
+  /// instantitated and checked classes.
+  TypeChecks computeChecks(Set<ClassElement> instantiated,
+                           Set<ClassElement> checked);
+
+  /// Compute type arguments of classes that use one of their type variables in
+  /// is-checks and add the is-checks that they imply.
+  ///
+  /// This function must be called after all is-checks have been registered.
+  void addImplicitChecks(Universe 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.
+  Set<ClassElement> getReferencedClasses(FunctionType type);
+
+  /// Return all classes that are uses a type arguments.
+  Set<ClassElement> getRequiredArgumentClasses(JavaScriptBackend backend);
+
+  bool isTrivialSubstitution(ClassElement cls, ClassElement check);
+
+  Substitution getSubstitution(ClassElement cls, ClassElement other);
+
+  static bool hasTypeArguments(DartType type) {
+    if (type is InterfaceType) {
+      InterfaceType interfaceType = type;
+      return !interfaceType.treatAsRaw;
+    }
+    return false;
+  }
+}
+
+abstract class RuntimeTypesEncoder {
+  bool isSimpleFunctionType(FunctionType type);
+
+  jsAst.Expression getSignatureEncoding(DartType type, jsAst.Expression this_);
+
+  jsAst.Expression getSubstitutionRepresentation(
+        List<DartType> types,
+        OnVariableCallback onVariable);
+  jsAst.Expression getSubstitutionCode(Substitution substitution);
+  jsAst.Expression getSubstitutionCodeForVariable(
+      Substitution substitution, int index);
+
+  /// Returns the JavaScript template to determine at runtime if a type object
+  /// is a function type.
+  jsAst.Template get templateForIsFunctionType;
+
+  /// Returns the JavaScript template that creates at runtime a new function
+  /// type object.
+  jsAst.Template get templateForCreateFunctionType;
+  jsAst.Name get getFunctionThatReturnsNullName;
+
+  jsAst.Expression getTypeRepresentation(
+        DartType type,
+        OnVariableCallback onVariable,
+        [ShouldEncodeTypedefCallback shouldEncodeTypedef]);
+  /**
+   * Returns a [jsAst.Expression] representing the given [type]. Type
+   * variables are replaced by placeholders in the ast.
+   *
+   * [firstPlaceholderIndex] is the index to use for the first placeholder.
+   * This is useful if the returned [jsAst.Expression] is only part of a
+   * larger template. By default, indexing starts with 0.
+   */
+  jsAst.Expression getTypeRepresentationWithPlaceholders(DartType type,
+        OnVariableCallback onVariable, {int firstPlaceholderIndex : 0});
+
+  String getTypeRepresentationForTypeConstant(DartType type);
+}
+
+class _RuntimeTypes implements RuntimeTypes {
   final Compiler compiler;
-  final TypeRepresentationGenerator representationGenerator;
 
   final Map<ClassElement, Set<ClassElement>> rtiDependencies;
+
+  @override
   final Set<ClassElement> classesNeedingRti;
+
+  @override
   final Set<Element> methodsNeedingRti;
-  // The set of classes that use one of their type variables as expressions
-  // to get the runtime type.
+
+  @override
   final Set<ClassElement> classesUsingTypeVariableExpression;
+
   // The set of type arguments tested against type variable bounds.
   final Set<DartType> checkedTypeArguments;
   // The set of tested type variable bounds.
   final Set<DartType> checkedBounds;
 
+  TypeChecks cachedRequiredChecks;
+
   JavaScriptBackend get backend => compiler.backend;
 
-  jsAst.Name get getFunctionThatReturnsNullName
-      => backend.namer.internalGlobal('functionThatReturnsNull');
-
-  RuntimeTypes(Compiler compiler)
+  _RuntimeTypes(Compiler compiler)
       : this.compiler = compiler,
-        representationGenerator = new TypeRepresentationGenerator(compiler),
         classesNeedingRti = new Set<ClassElement>(),
         methodsNeedingRti = new Set<Element>(),
         rtiDependencies = new Map<ClassElement, Set<ClassElement>>(),
@@ -49,6 +142,12 @@
   Set<ClassElement> allInstantiatedArguments;
   Set<ClassElement> checkedArguments;
 
+  @override
+  void registerClassUsingTypeVariableExpression(ClassElement cls) {
+    classesUsingTypeVariableExpression.add(cls);
+  }
+
+  @override
   void registerRtiDependency(Element element, Element dependency) {
     // We're not dealing with typedef for now.
     if (!element.isClass || !dependency.isClass) return;
@@ -57,6 +156,7 @@
     classes.add(dependency);
   }
 
+  @override
   void registerTypeVariableBoundsSubtypeCheck(DartType typeArgument,
                                               DartType bound) {
     checkedTypeArguments.add(typeArgument);
@@ -77,6 +177,7 @@
    * TODO(karlklose): move these computations into a function producing an
    * immutable datastructure.
    */
+  @override
   void addImplicitChecks(Universe universe,
                          Iterable<ClassElement> classesUsingChecks) {
     // If there are no classes that use their variables in checks, there is
@@ -121,6 +222,7 @@
     }
   }
 
+  @override
   void computeClassesNeedingRti() {
     // Find the classes that need runtime type information. Such
     // classes are:
@@ -217,8 +319,7 @@
     classesUsingTypeVariableExpression.forEach(potentiallyAddForRti);
   }
 
-  TypeChecks cachedRequiredChecks;
-
+  @override
   TypeChecks get requiredChecks {
     if (cachedRequiredChecks == null) {
       computeRequiredChecks();
@@ -227,8 +328,7 @@
     return cachedRequiredChecks;
   }
 
-  /// Compute the required type checkes and substitutions for the given
-  /// instantitated and checked classes.
+  @override
   TypeChecks computeChecks(Set<ClassElement> instantiated,
                            Set<ClassElement> checked) {
     // Run through the combination of instantiated and checked
@@ -373,6 +473,7 @@
         collector.classes..addAll(functionArgumentCollector.classes);
   }
 
+  @override
   Set<ClassElement> getClassesUsedInSubstitutions(JavaScriptBackend backend,
                                                   TypeChecks checks) {
     Set<ClassElement> instantiated = new Set<ClassElement>();
@@ -389,6 +490,7 @@
     return instantiated..addAll(collector.classes);
   }
 
+  @override
   Set<ClassElement> getRequiredArgumentClasses(JavaScriptBackend backend) {
     Set<ClassElement> requiredArgumentClasses =
         new Set<ClassElement>.from(
@@ -398,26 +500,16 @@
         ..addAll(checkedArguments);
   }
 
-  String getTypeRepresentationForTypeConstant(DartType type) {
-    JavaScriptBackend backend = compiler.backend;
-    Namer namer = backend.namer;
-    if (type.isDynamic) return "dynamic";
-    String name = namer.uniqueNameForTypeConstantElement(type.element);
-    if (!type.element.isClass) return name;
-    InterfaceType interface = type;
-    List<DartType> variables = interface.element.typeVariables;
-    // Type constants can currently only be raw types, so there is no point
-    // adding ground-term type parameters, as they would just be 'dynamic'.
-    // TODO(sra): Since the result string is used only in constructing constant
-    // names, it would result in more readable names if the final string was a
-    // legal JavaScript identifer.
-    if (variables.isEmpty) return name;
-    String arguments =
-        new List.filled(variables.length, 'dynamic').join(', ');
-    return '$name<$arguments>';
+  @override
+  Set<ClassElement> getReferencedClasses(FunctionType type) {
+    FunctionArgumentCollector collector =
+        new FunctionArgumentCollector(backend);
+    collector.collect(type);
+    return collector.classes;
   }
 
   // TODO(karlklose): maybe precompute this value and store it in typeChecks?
+  @override
   bool isTrivialSubstitution(ClassElement cls, ClassElement check) {
     if (cls.isClosure) {
       // TODO(karlklose): handle closures.
@@ -452,31 +544,7 @@
     return true;
   }
 
-  /**
-   * Compute a JavaScript expression that describes the necessary substitution
-   * for type arguments in a subtype test.
-   *
-   * The result can be:
-   *  1) `null`, if no substituted check is necessary, because the
-   *     type variables are the same or there are no type variables in the class
-   *     that is checked for.
-   *  2) A list expression describing the type arguments to be used in the
-   *     subtype check, if the type arguments to be used in the check do not
-   *     depend on the type arguments of the object.
-   *  3) A function mapping the type variables of the object to be checked to
-   *     a list expression.
-   */
-  jsAst.Expression getSupertypeSubstitution(
-       ClassElement cls,
-       ClassElement check) {
-    Substitution substitution = getSubstitution(cls, check);
-    if (substitution != null) {
-      return substitution.getCode(this);
-    } else {
-      return null;
-    }
-  }
-
+  @override
   Substitution getSubstitution(ClassElement cls, ClassElement other) {
     // Look for a precomputed check.
     for (TypeCheck check in cachedRequiredChecks[cls]) {
@@ -505,7 +573,56 @@
       return new Substitution.function(target.typeArguments, typeVariables);
     }
   }
+}
 
+class _RuntimeTypesEncoder implements RuntimeTypesEncoder {
+  final Compiler compiler;
+  @override
+  final TypeRepresentationGenerator representationGenerator;
+
+  _RuntimeTypesEncoder(Compiler compiler)
+      : this.compiler = compiler,
+        representationGenerator = new TypeRepresentationGenerator(compiler);
+
+  JavaScriptBackend get backend => compiler.backend;
+
+  /// Returns the JavaScript template to determine at runtime if a type object
+  /// is a function type.
+  @override
+  jsAst.Template get templateForIsFunctionType {
+    return representationGenerator.templateForIsFunctionType;
+  }
+
+  /// Returns the JavaScript template that creates at runtime a new function
+  /// type object.
+  @override
+  jsAst.Template get templateForCreateFunctionType {
+    return representationGenerator.templateForCreateFunctionType;
+  }
+
+  @override
+  jsAst.Expression getTypeRepresentation(
+      DartType type,
+      OnVariableCallback onVariable,
+      [ShouldEncodeTypedefCallback shouldEncodeTypedef]) {
+    return representationGenerator.getTypeRepresentation(
+        type, onVariable, shouldEncodeTypedef);
+  }
+
+  @override
+  jsAst.Expression getTypeRepresentationWithPlaceholders(DartType type,
+      OnVariableCallback onVariable, {int firstPlaceholderIndex : 0}) {
+    // Create a type representation.  For type variables call the original
+    // callback for side effects and return a template placeholder.
+    int positions = firstPlaceholderIndex;
+    jsAst.Expression representation = getTypeRepresentation(type, (variable) {
+      onVariable(variable);
+      return new jsAst.InterpolatedExpression(positions++);
+    });
+    return representation;
+  }
+
+  @override
   jsAst.Expression getSubstitutionRepresentation(
       List<DartType> types,
       OnVariableCallback onVariable) {
@@ -535,6 +652,7 @@
     }
   }
 
+  @override
   jsAst.Expression getSignatureEncoding(DartType type, jsAst.Expression this_) {
     ClassElement contextClass = Types.getClassContext(type);
     jsAst.Expression encoding =
@@ -543,7 +661,8 @@
       JavaScriptBackend backend = compiler.backend;
       jsAst.Name contextName = backend.namer.className(contextClass);
       return js('function () { return #(#, #, #); }',
-          [ backend.emitter.staticFunctionAccess(backend.getComputeSignature()),
+          [ backend.emitter.staticFunctionAccess(
+                backend.helpers.computeSignature),
               encoding, this_, js.quoteName(contextName) ]);
     } else {
       return encoding;
@@ -551,33 +670,95 @@
   }
 
   /**
-   * Returns a [jsAst.Expression] representing the given [type]. Type
-   * variables are replaced by placeholders in the ast.
+   * Compute a JavaScript expression that describes the necessary substitution
+   * for type arguments in a subtype test.
    *
-   * [firstPlaceholderIndex] is the index to use for the first placeholder.
-   * This is useful if the returned [jsAst.Expression] is only part of a
-   * larger template. By default, indexing starts with 0.
+   * The result can be:
+   *  1) `null`, if no substituted check is necessary, because the
+   *     type variables are the same or there are no type variables in the class
+   *     that is checked for.
+   *  2) A list expression describing the type arguments to be used in the
+   *     subtype check, if the type arguments to be used in the check do not
+   *     depend on the type arguments of the object.
+   *  3) A function mapping the type variables of the object to be checked to
+   *     a list expression.
    */
-  jsAst.Expression getTypeRepresentationWithPlaceholders(DartType type,
-      OnVariableCallback onVariable, {int firstPlaceholderIndex : 0}) {
-    // Create a type representation.  For type variables call the original
-    // callback for side effects and return a template placeholder.
-    int positions = firstPlaceholderIndex;
-    jsAst.Expression representation = getTypeRepresentation(type, (variable) {
-      onVariable(variable);
-      return new jsAst.InterpolatedExpression(positions++);
-    });
-    return representation;
+  @override
+  jsAst.Expression getSubstitutionCode(Substitution substitution) {
+    jsAst.Expression declaration(TypeVariableType variable) {
+      return new jsAst.Parameter(getVariableName(variable.name));
+    }
+
+    jsAst.Expression use(TypeVariableType variable) {
+      return new jsAst.VariableUse(getVariableName(variable.name));
+    }
+
+    if (substitution.arguments.every((DartType type) => type.isDynamic)) {
+      return backend.emitter.emitter.generateFunctionThatReturnsNull();
+    } else {
+      jsAst.Expression value =
+          getSubstitutionRepresentation(substitution.arguments, use);
+      if (substitution.isFunction) {
+        Iterable<jsAst.Expression> formals =
+            substitution.parameters.map(declaration);
+        return js('function(#) { return # }', [formals, value]);
+      } else {
+        return js('function() { return # }', value);
+      }
+    }
   }
 
-  jsAst.Expression getTypeRepresentation(
-      DartType type,
-      OnVariableCallback onVariable,
-      [ShouldEncodeTypedefCallback shouldEncodeTypedef]) {
-    return representationGenerator.getTypeRepresentation(
-        type, onVariable, shouldEncodeTypedef);
+  @override
+  jsAst.Expression getSubstitutionCodeForVariable(Substitution substitution,
+                                                  int index) {
+    jsAst.Expression declaration(TypeVariableType variable) {
+      return new jsAst.Parameter(getVariableName(variable.name));
+    }
+
+    jsAst.Expression use(TypeVariableType variable) {
+      return new jsAst.VariableUse(getVariableName(variable.name));
+    }
+
+    if (substitution.arguments[index].isDynamic) {
+      return backend.emitter.emitter.generateFunctionThatReturnsNull();
+    } else {
+      jsAst.Expression value =
+          getTypeRepresentation(substitution.arguments[index], use);
+      Iterable<jsAst.Expression> formals =
+          substitution.parameters.map(declaration);
+      return js('function(#) { return # }', [formals, value]);
+    }
   }
 
+  String getVariableName(String name) {
+    return backend.namer.safeVariableName(name);
+  }
+
+  @override
+  jsAst.Name get getFunctionThatReturnsNullName
+      => backend.namer.internalGlobal('functionThatReturnsNull');
+
+  @override
+  String getTypeRepresentationForTypeConstant(DartType type) {
+    JavaScriptBackend backend = compiler.backend;
+    Namer namer = backend.namer;
+    if (type.isDynamic) return "dynamic";
+    String name = namer.uniqueNameForTypeConstantElement(type.element);
+    if (!type.element.isClass) return name;
+    InterfaceType interface = type;
+    List<DartType> variables = interface.element.typeVariables;
+    // Type constants can currently only be raw types, so there is no point
+    // adding ground-term type parameters, as they would just be 'dynamic'.
+    // TODO(sra): Since the result string is used only in constructing constant
+    // names, it would result in more readable names if the final string was a
+    // legal JavaScript identifer.
+    if (variables.isEmpty) return name;
+    String arguments =
+        new List.filled(variables.length, 'dynamic').join(', ');
+    return '$name<$arguments>';
+  }
+
+  @override
   bool isSimpleFunctionType(FunctionType type) {
     if (!type.returnType.isDynamic) return false;
     if (!type.optionalParameterTypes.isEmpty) return false;
@@ -587,33 +768,6 @@
     }
     return true;
   }
-
-  static bool hasTypeArguments(DartType type) {
-    if (type is InterfaceType) {
-      InterfaceType interfaceType = type;
-      return !interfaceType.treatAsRaw;
-    }
-    return false;
-  }
-
-  static int getTypeVariableIndex(TypeVariableElement variable) {
-    ClassElement classElement = variable.enclosingClass;
-    List<DartType> variables = classElement.typeVariables;
-    for (int index = 0; index < variables.length; index++) {
-      if (variables[index].element == variable) return index;
-    }
-    throw invariant(variable, false,
-                    message: "Couldn't find type-variable index");
-  }
-
-  /// Return all classes that are referenced in the type of the function, i.e.,
-  /// in the return type or the argument types.
-  Set<ClassElement> getReferencedClasses(FunctionType type) {
-    FunctionArgumentCollector collector =
-        new FunctionArgumentCollector(backend);
-    collector.collect(type);
-    return collector.classes;
-  }
 }
 
 class TypeRepresentationGenerator implements DartTypeVisitor {
@@ -623,6 +777,7 @@
 
   JavaScriptBackend get backend => compiler.backend;
   Namer get namer => backend.namer;
+  DiagnosticReporter get reporter => compiler.reporter;
 
   TypeRepresentationGenerator(Compiler this.compiler);
 
@@ -744,7 +899,7 @@
 
   visitTypedefType(TypedefType type, _) {
     bool shouldEncode = shouldEncodeTypedef(type);
-    DartType unaliasedType = type.unalias(compiler);
+    DartType unaliasedType = type.unaliased;
     if (shouldEncode) {
       jsAst.ObjectInitializer initializer = unaliasedType.accept(this, null);
       // We have to encode the aliased type.
@@ -762,7 +917,7 @@
   }
 
   visitStatementType(StatementType type, _) {
-    compiler.internalError(NO_LOCATION_SPANNABLE,
+    reporter.internalError(NO_LOCATION_SPANNABLE,
         'Unexpected type: $type (${type.kind}).');
   }
 }
@@ -814,7 +969,7 @@
   }
 
   visitTypedefType(TypedefType type, bool isTypeArgument) {
-    type.unalias(backend.compiler).accept(this, isTypeArgument);
+    type.unaliased.accept(this, isTypeArgument);
   }
 
   visitInterfaceType(InterfaceType type, bool isTypeArgument) {
@@ -846,7 +1001,7 @@
   }
 
   visitTypedefType(TypedefType type, bool inFunctionType) {
-    type.unalias(backend.compiler).accept(this, inFunctionType);
+    type.unaliased.accept(this, inFunctionType);
   }
 
   visitInterfaceType(InterfaceType type, bool inFunctionType) {
@@ -882,52 +1037,6 @@
 
   Substitution.function(this.arguments, this.parameters)
       : isFunction = true;
-
-  jsAst.Expression getCode(RuntimeTypes rti) {
-    jsAst.Expression declaration(TypeVariableType variable) {
-      return new jsAst.Parameter(
-          rti.backend.namer.safeVariableName(variable.name));
-    }
-
-    jsAst.Expression use(TypeVariableType variable) {
-      return new jsAst.VariableUse(
-          rti.backend.namer.safeVariableName(variable.name));
-    }
-
-    if (arguments.every((DartType type) => type.isDynamic)) {
-      return rti.backend.emitter.emitter.generateFunctionThatReturnsNull();
-    } else {
-      jsAst.Expression value =
-          rti.getSubstitutionRepresentation(arguments, use);
-      if (isFunction) {
-        Iterable<jsAst.Expression> formals = parameters.map(declaration);
-        return js('function(#) { return # }', [formals, value]);
-      } else {
-        return js('function() { return # }', value);
-      }
-    }
-  }
-
-  jsAst.Expression getCodeForVariable(int index, RuntimeTypes rti) {
-    jsAst.Expression declaration(TypeVariableType variable) {
-      return new jsAst.Parameter(
-          rti.backend.namer.safeVariableName(variable.name));
-    }
-
-    jsAst.Expression use(TypeVariableType variable) {
-      return new jsAst.VariableUse(
-          rti.backend.namer.safeVariableName(variable.name));
-    }
-
-    if (arguments[index].isDynamic) {
-      return rti.backend.emitter.emitter.generateFunctionThatReturnsNull();
-    } else {
-      jsAst.Expression value =
-          rti.getTypeRepresentation(arguments[index], use);
-      Iterable<jsAst.Expression> formals = parameters.map(declaration);
-      return js('function(#) { return # }', [formals, value]);
-    }
-  }
 }
 
 /**
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 5d779a0..2ebda27 100644
--- a/pkg/compiler/lib/src/js_backend/type_variable_handler.dart
+++ b/pkg/compiler/lib/src/js_backend/type_variable_handler.dart
@@ -36,6 +36,7 @@
   CodeEmitterTask get _task => _backend.emitter;
   MetadataCollector get _metadataCollector => _task.metadataCollector;
   JavaScriptBackend get _backend => _compiler.backend;
+  DiagnosticReporter get reporter => _compiler.reporter;
 
   void registerClassWithTypeVariables(ClassElement cls, Enqueuer enqueuer,
                                       Registry registry) {
@@ -43,19 +44,19 @@
       // On first encounter, we have to ensure that the support classes get
       // resolved.
       if (!_seenClassesWithTypeVariables) {
-        _backend.enqueueClass(
-            enqueuer, _typeVariableClass, registry);
-        _typeVariableClass.ensureResolved(_compiler);
+        _backend.enqueueClass(enqueuer, _typeVariableClass, registry);
+        _typeVariableClass.ensureResolved(_compiler.resolution);
         Link constructors = _typeVariableClass.constructors;
         if (constructors.isEmpty && constructors.tail.isEmpty) {
-          _compiler.internalError(_typeVariableClass,
+          reporter.internalError(_typeVariableClass,
               "Class '$_typeVariableClass' should only have one constructor");
         }
         _typeVariableConstructor = _typeVariableClass.constructors.head;
         _backend.enqueueInResolution(_typeVariableConstructor, registry);
-        enqueuer.registerInstantiatedType(_typeVariableClass.rawType,
-                                          registry);
-        enqueuer.registerStaticUse(_backend.getCreateRuntimeType());
+        _backend.registerInstantiatedType(
+            _typeVariableClass.rawType, enqueuer, registry);
+        enqueuer.registerStaticUse(
+            _backend.registerBackendUse(_backend.helpers.createRuntimeType));
         _seenClassesWithTypeVariables = true;
       }
     } else {
diff --git a/pkg/compiler/lib/src/js_emitter/class_stub_generator.dart b/pkg/compiler/lib/src/js_emitter/class_stub_generator.dart
index 53e1130..cdd676b 100644
--- a/pkg/compiler/lib/src/js_emitter/class_stub_generator.dart
+++ b/pkg/compiler/lib/src/js_emitter/class_stub_generator.dart
@@ -48,7 +48,7 @@
    * Invariant: [member] must be a declaration element.
    */
   Map<jsAst.Name, jsAst.Expression> generateCallStubsForGetter(
-      Element member, Map<Selector, TypeMaskSet> selectors) {
+      Element member, Map<Selector, SelectorConstraints> selectors) {
     assert(invariant(member, member.isDeclaration));
 
     // If the method is intercepted, the stub gets the
@@ -84,12 +84,7 @@
     for (Selector selector in selectors.keys) {
       if (generatedSelectors.contains(selector)) continue;
       if (!selector.appliesUnnamed(member, compiler.world)) continue;
-      for (TypeMask mask in selectors[selector].masks) {
-        if (mask != null &&
-            !mask.canHit(member, selector, compiler.world)) {
-          continue;
-        }
-
+      if (selectors[selector].applies(member, selector, compiler.world)) {
         generatedSelectors.add(selector);
 
         jsAst.Name invocationName = namer.invocationName(selector);
@@ -129,20 +124,12 @@
     }
 
     void addNoSuchMethodHandlers(String ignore,
-                                 Map<Selector, TypeMaskSet> selectors) {
-      TypeMask objectSubclassTypeMask =
-          new TypeMask.subclass(compiler.objectClass, compiler.world);
-
+                                 Map<Selector, SelectorConstraints> selectors) {
       for (Selector selector in selectors.keys) {
-        TypeMaskSet maskSet = selectors[selector];
-        for (TypeMask mask in maskSet.masks) {
-          if (mask == null) mask = objectSubclassTypeMask;
-
-          if (mask.needsNoSuchMethodHandling(selector, compiler.world)) {
-            jsAst.Name jsName = namer.invocationMirrorInternalName(selector);
-            jsNames[jsName] = selector;
-            break;
-          }
+        SelectorConstraints maskSet = selectors[selector];
+        if (maskSet.needsNoSuchMethodHandling(selector, compiler.world)) {
+          jsAst.Name jsName = namer.invocationMirrorInternalName(selector);
+          jsNames[jsName] = selector;
         }
       }
     }
@@ -167,7 +154,7 @@
     jsAst.Name methodName = namer.asName(selector.invocationMirrorMemberName);
     jsAst.Name internalName = namer.invocationMirrorInternalName(selector);
 
-    assert(backend.isInterceptedName(Compiler.NO_SUCH_METHOD));
+    assert(backend.isInterceptedName(Identifiers.noSuchMethod_));
     bool isIntercepted = backend.isInterceptedName(selector.name);
     jsAst.Expression expression =
         js('''this.#noSuchMethodName(#receiver,
@@ -180,7 +167,7 @@
             'noSuchMethodName': namer.noSuchMethodName,
             'createInvocationMirror':
                 backend.emitter.staticFunctionAccess(
-                    backend.getCreateInvocationMirror()),
+                    backend.helpers.createInvocationMirror),
             'methodName':
                 js.quoteName(compiler.enableMinification
                     ? internalName : methodName),
diff --git a/pkg/compiler/lib/src/js_emitter/full_emitter/class_emitter.dart b/pkg/compiler/lib/src/js_emitter/full_emitter/class_emitter.dart
index 10e27921..cb03c3e 100644
--- a/pkg/compiler/lib/src/js_emitter/full_emitter/class_emitter.dart
+++ b/pkg/compiler/lib/src/js_emitter/full_emitter/class_emitter.dart
@@ -49,7 +49,7 @@
       // We add a special getter here to allow for tearing off a closure from
       // itself.
       jsAst.Fun function = js('function() { return this; }');
-      jsAst.Name name = namer.getterForMember(Selector.CALL_NAME);
+      jsAst.Name name = namer.getterForMember(Names.call);
       builder.addProperty(name, function);
     }
 
@@ -156,7 +156,7 @@
 
           int code = field.getterFlags + (field.setterFlags << 2);
           if (code == 0) {
-            compiler.internalError(fieldElement,
+            reporter.internalError(fieldElement,
                 'Field code is 0 ($fieldElement).');
           }
           fieldNameParts.add(
@@ -212,7 +212,7 @@
 
     for (Field field in cls.fields) {
       Element member = field.element;
-      compiler.withCurrentElement(member, () {
+      reporter.withCurrentElement(member, () {
         if (field.needsGetter) {
           emitGetterForCSP(member, field.name, field.accessorName, builder);
         }
@@ -341,7 +341,7 @@
 
     String reflectionName = emitter.getReflectionName(classElement, className);
     if (reflectionName != null) {
-      if (!backend.isAccessibleByReflection(classElement)) {
+      if (!backend.isAccessibleByReflection(classElement) || cls.onlyForRti) {
         // TODO(herhut): Fix use of reflection name here.
         enclosingBuilder.addPropertyByName("+$reflectionName", js.number(0));
       } else {
@@ -422,8 +422,10 @@
                                                     ClassBuilder builder,
                                                     {bool isGetter}) {
     Selector selector = isGetter
-        ? new Selector.getter(member.name, member.library)
-        : new Selector.setter(member.name, member.library);
+        ? new Selector.getter(
+            new Name(member.name, member.library))
+        : new Selector.setter(
+            new Name(member.name, member.library, isSetter: true));
     String reflectionName = emitter.getReflectionName(selector, name);
     if (reflectionName != null) {
       var reflectable =
diff --git a/pkg/compiler/lib/src/js_emitter/full_emitter/code_emitter_helper.dart b/pkg/compiler/lib/src/js_emitter/full_emitter/code_emitter_helper.dart
index f777014..78c963d 100644
--- a/pkg/compiler/lib/src/js_emitter/full_emitter/code_emitter_helper.dart
+++ b/pkg/compiler/lib/src/js_emitter/full_emitter/code_emitter_helper.dart
@@ -15,6 +15,8 @@
 
   Compiler get compiler => emitter.compiler;
 
+  DiagnosticReporter get reporter => compiler.reporter;
+
   String get n => emitter.n;
 
   String get _ => emitter._;
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 319bc72..473766a 100644
--- a/pkg/compiler/lib/src/js_emitter/full_emitter/emitter.dart
+++ b/pkg/compiler/lib/src/js_emitter/full_emitter/emitter.dart
@@ -13,42 +13,47 @@
     JsGetName;
 
 import '../headers.dart';
-
 import '../js_emitter.dart' hide Emitter;
 import '../js_emitter.dart' as js_emitter show Emitter;
-
 import '../model.dart';
 import '../program_builder/program_builder.dart';
 
 import '../../common.dart';
-
+import '../../common/names.dart' show
+    Names;
+import '../../compiler.dart' show
+    Compiler;
 import '../../constants/values.dart';
-
+import '../../dart_types.dart' show
+    DartType;
 import '../../deferred_load.dart' show OutputUnit;
-
 import '../../elements/elements.dart' show
+    ClassElement,
     ConstructorBodyElement,
+    Element,
+    Elements,
     ElementKind,
     FieldElement,
-    ParameterElement,
-    TypeVariableElement,
+    FunctionElement,
+    FunctionSignature,
+    LibraryElement,
+    MetadataAnnotation,
     MethodElement,
-    MemberElement;
-
+    MemberElement,
+    Name,
+    ParameterElement,
+    TypedefElement,
+    TypeVariableElement,
+    VariableElement;
 import '../../hash/sha1.dart' show Hasher;
-
 import '../../io/code_output.dart';
-
 import '../../io/line_column_provider.dart' show
     LineColumnCollector,
     LineColumnProvider;
-
 import '../../io/source_map_builder.dart' show
     SourceMapBuilder;
-
 import '../../js/js.dart' as jsAst;
 import '../../js/js.dart' show js;
-
 import '../../js_backend/js_backend.dart' show
     CheckedModeHelper,
     CompoundName,
@@ -64,7 +69,10 @@
     TypeCheck,
     TypeChecks,
     TypeVariableHandler;
-
+import '../../universe/call_structure.dart' show
+    CallStructure;
+import '../../universe/selector.dart' show
+    Selector;
 import '../../util/characters.dart' show
     $$,
     $A,
@@ -73,12 +81,9 @@
     $Z,
     $a,
     $z;
-
 import '../../util/uri_extras.dart' show
     relativize;
-
 import '../../util/util.dart' show
-    NO_LOCATION_SPANNABLE,
     equalElements;
 
 part 'class_builder.dart';
@@ -187,6 +192,8 @@
     interceptorEmitter.emitter = this;
   }
 
+  DiagnosticReporter get reporter => compiler.reporter;
+
   List<jsAst.Node> cspPrecompiledFunctionFor(OutputUnit outputUnit) {
     return _cspPrecompiledFunctions.putIfAbsent(
         outputUnit,
@@ -370,7 +377,7 @@
         return jsAst.js.expressionTemplateFor('#.substring($isPrefixLength)');
 
       case JsBuiltin.isFunctionType:
-        return backend.rti.representationGenerator.templateForIsFunctionType;
+        return backend.rtiEncoder.templateForIsFunctionType;
 
       case JsBuiltin.rawRtiToJsConstructorName:
         return jsAst.js.expressionTemplateFor("#.$typeNameProperty");
@@ -379,8 +386,7 @@
         return jsAst.js.expressionTemplateFor("#.constructor");
 
       case JsBuiltin.createFunctionTypeRti:
-        return backend.rti.representationGenerator
-            .templateForCreateFunctionType;
+        return backend.rtiEncoder.templateForCreateFunctionType;
 
       case JsBuiltin.isSubtype:
         // TODO(floitsch): move this closer to where is-check properties are
@@ -410,7 +416,7 @@
         return jsAst.js.expressionTemplateFor("$functionGettersMap[#]()");
 
       default:
-        compiler.internalError(NO_LOCATION_SPANNABLE,
+        reporter.internalError(NO_LOCATION_SPANNABLE,
             "Unhandled Builtin: $builtin");
         return null;
     }
@@ -549,7 +555,7 @@
     } else if (element.isTypedef) {
       return element.name;
     }
-    throw compiler.internalError(element,
+    throw reporter.internalError(element,
         'Do not know how to reflect on this $element.');
   }
 
@@ -587,7 +593,7 @@
   void assembleClass(Class cls, ClassBuilder enclosingBuilder,
                      Fragment fragment) {
     ClassElement classElement = cls.element;
-    compiler.withCurrentElement(classElement, () {
+    reporter.withCurrentElement(classElement, () {
       if (compiler.hasIncrementalSupport) {
         ClassBuilder cachedBuilder =
             cachedClassBuilders.putIfAbsent(classElement, () {
@@ -640,7 +646,7 @@
     // [fields] is `null`.
     if (fields != null) {
       for (Element element in fields) {
-        compiler.withCurrentElement(element, () {
+        reporter.withCurrentElement(element, () {
           ConstantValue constant = handler.getInitialValueFor(element);
           parts.add(buildInitialization(element, constantReference(constant)));
         });
@@ -654,7 +660,7 @@
           (OutputUnit fieldsOutputUnit, Iterable<VariableElement> fields) {
         if (fieldsOutputUnit == outputUnit) return;  // Skip the main unit.
         for (Element element in fields) {
-          compiler.withCurrentElement(element, () {
+          reporter.withCurrentElement(element, () {
             parts.add(buildInitialization(element, jsAst.number(0)));
           });
         }
@@ -802,9 +808,11 @@
 
   jsAst.Statement buildConstantInitializer(ConstantValue constant) {
     jsAst.Name name = namer.constantName(constant);
-    return js.statement('#.# = #',
+    jsAst.Statement initializer = js.statement('#.# = #',
                         [namer.globalObjectForConstant(constant), name,
                          constantInitializerExpression(constant)]);
+    compiler.dumpInfoTask.registerConstantAst(constant, initializer);
+    return initializer;
   }
 
   jsAst.Expression constantListGenerator(jsAst.Expression array) {
@@ -832,12 +840,12 @@
   jsAst.Statement buildFunctionThatReturnsNull() {
     return js.statement('#.# = function() {}',
                         [namer.isolateName,
-                         backend.rti.getFunctionThatReturnsNullName]);
+                         backend.rtiEncoder.getFunctionThatReturnsNullName]);
   }
 
   jsAst.Expression generateFunctionThatReturnsNull() {
     return js("#.#", [namer.isolateName,
-                      backend.rti.getFunctionThatReturnsNullName]);
+                      backend.rtiEncoder.getFunctionThatReturnsNullName]);
   }
 
   buildMain(jsAst.Statement invokeMain) {
@@ -879,7 +887,7 @@
     jsAst.Expression finishedClassesAccess =
         generateEmbeddedGlobalAccess(embeddedNames.FINISHED_CLASSES);
     jsAst.Expression cyclicThrow =
-        staticFunctionAccess(backend.getCyclicThrowHelper());
+        staticFunctionAccess(backend.helpers.cyclicThrowHelper);
     jsAst.Expression laziesAccess =
         generateEmbeddedGlobalAccess(embeddedNames.LAZIES);
 
@@ -893,8 +901,8 @@
         #finishedClasses = map();
 
         if (#needsLazyInitializer) {
-          // [staticName] is only provided in non-minified mode. If missing, we 
-          // fall back to [fieldName]. Likewise, [prototype] is optional and 
+          // [staticName] is only provided in non-minified mode. If missing, we
+          // fall back to [fieldName]. Likewise, [prototype] is optional and
           // defaults to the isolateProperties object.
           $lazyInitializerName = function (fieldName, getterName, lazyValue,
                                            staticName, prototype) {
@@ -1004,7 +1012,7 @@
             'outputContainsConstantList': outputContainsConstantList,
             'makeConstListProperty': makeConstListProperty,
             'functionThatReturnsNullProperty':
-                backend.rti.getFunctionThatReturnsNullName,
+                backend.rtiEncoder.getFunctionThatReturnsNullName,
             'hasIncrementalSupport': compiler.hasIncrementalSupport,
             'lazyInitializerProperty': lazyInitializerProperty,});
   }
@@ -1082,7 +1090,7 @@
 
     String libraryName =
         (!compiler.enableMinification || backend.mustRetainLibraryNames) ?
-        library.getLibraryName() :
+        library.libraryName :
         "";
 
     jsAst.Fun metadata = task.metadataCollector.buildMetadataFunction(library);
@@ -1325,12 +1333,12 @@
           Elements.sortedByPosition(elements.where((e) => !e.isLibrary));
 
       pendingStatics.forEach((element) =>
-          compiler.reportInfo(
+          reporter.reportInfo(
               element, MessageKind.GENERIC, {'text': 'Pending statics.'}));
     }
 
     if (pendingStatics != null && !pendingStatics.isEmpty) {
-      compiler.internalError(pendingStatics.first,
+      reporter.internalError(pendingStatics.first,
           'Pending statics (see above).');
     }
   }
@@ -1805,7 +1813,8 @@
 
     if (backend.requiresPreamble &&
         !backend.htmlLibraryIsLoaded) {
-      compiler.reportHint(NO_LOCATION_SPANNABLE, MessageKind.PREAMBLE);
+      reporter.reportHintMessage(
+          NO_LOCATION_SPANNABLE, MessageKind.PREAMBLE);
     }
     // Return the total program size.
     return outputBuffers.values.fold(0, (a, b) => a + b.length);
@@ -1838,7 +1847,7 @@
       }
     }
     if (owner == null) {
-      compiler.internalError(element, 'Owner is null.');
+      reporter.internalError(element, 'Owner is null.');
     }
     return elementDescriptors
         .putIfAbsent(fragment, () => new Map<Element, ClassBuilder>())
@@ -1975,10 +1984,6 @@
           ..add(js.statement('${typesAccess}.push.apply(${typesAccess}, '
                              '${namer.deferredTypesName});'));
 
-      // Sets the static state variable to the state of the current isolate
-      // (which is provided as second argument).
-      body.add(js.statement("${namer.staticStateHolder} = arguments[1];"));
-
       body.add(buildCompileTimeConstants(fragment.constants,
                                          isMainFragment: false));
       body.add(buildStaticNonFinalFieldInitializations(outputUnit));
@@ -1988,7 +1993,7 @@
       statements
           ..add(buildGeneratedBy())
           ..add(js.statement('${deferredInitializers}.current = '
-                             """function (#) {
+                             """function (#, ${namer.staticStateHolder}) {
                                   #
                                 }
                              """, [globalsHolder, body]));
diff --git a/pkg/compiler/lib/src/js_emitter/full_emitter/nsm_emitter.dart b/pkg/compiler/lib/src/js_emitter/full_emitter/nsm_emitter.dart
index cf823c1..f14b9a3 100644
--- a/pkg/compiler/lib/src/js_emitter/full_emitter/nsm_emitter.dart
+++ b/pkg/compiler/lib/src/js_emitter/full_emitter/nsm_emitter.dart
@@ -162,7 +162,7 @@
     // Object class to catch noSuchMethod invocations.
     ClassElement objectClass = compiler.objectClass;
     jsAst.Expression createInvocationMirror = backend.emitter
-        .staticFunctionAccess(backend.getCreateInvocationMirror());
+        .staticFunctionAccess(backend.helpers.createInvocationMirror);
     if (useDiffEncoding) {
       statements.add(js.statement('''{
           var objectClassObject = processedClasses.collected[#objectClass],
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 309e121..e256e7b 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
@@ -127,6 +127,8 @@
      'finishedClassesAccess': finishedClassesAccess,
      'needsMixinSupport': emitter.needsMixinSupport,
      'needsNativeSupport': program.needsNativeSupport,
+     'enabledJsInterop': backend.jsInteropAnalysis.enabledJsInterop,
+     'jsInteropBoostrap':backend.jsInteropAnalysis.buildJsInteropBootstrap(),
      'isInterceptorClass': namer.operatorIs(backend.jsInterceptorClass),
      'isObject' : namer.operatorIs(compiler.objectClass),
      'specProperty': js.string(namer.nativeSpecProperty),
@@ -142,7 +144,6 @@
      'nativeInfoHandler': nativeInfoHandler,
      'operatorIsPrefix' : js.string(namer.operatorIsPrefix),
      'deferredActionString': js.string(namer.deferredAction)};
-
    String skeleton = '''
 function $setupProgramName(programData, typesOffset) {
   "use strict";
@@ -754,6 +755,9 @@
       }
     }
 
+    if (#enabledJsInterop) {
+      #jsInteropBoostrap
+    }
     #tearOffCode;
   }
 
diff --git a/pkg/compiler/lib/src/js_emitter/headers.dart b/pkg/compiler/lib/src/js_emitter/headers.dart
index 7906dd9..67fd4a2 100644
--- a/pkg/compiler/lib/src/js_emitter/headers.dart
+++ b/pkg/compiler/lib/src/js_emitter/headers.dart
@@ -3,7 +3,7 @@
 // BSD-style license that can be found in the LICENSE file.
 
 library dart2js.js_emitter.headers;
-import '../dart2jslib.dart' show Compiler;
+import '../compiler.dart' show Compiler;
 
 String generatedBy(Compiler compiler, {String flavor: ""}) {
   String suffix = '';
diff --git a/pkg/compiler/lib/src/js_emitter/interceptor_stub_generator.dart b/pkg/compiler/lib/src/js_emitter/interceptor_stub_generator.dart
index 1da1a03..886d3ed 100644
--- a/pkg/compiler/lib/src/js_emitter/interceptor_stub_generator.dart
+++ b/pkg/compiler/lib/src/js_emitter/interceptor_stub_generator.dart
@@ -140,10 +140,14 @@
 
     if (hasNative) {
       statements.add(js.statement(r'''{
-          if (typeof receiver != "object") return receiver;
+          if (typeof receiver != "object") {
+              if (typeof receiver == "function" ) return #;
+              return receiver;
+          }
           if (receiver instanceof #) return receiver;
           return #(receiver);
       }''', [
+          interceptorFor(backend.jsJavaScriptFunctionClass),
           backend.emitter.constructorAccess(compiler.objectClass),
           backend.emitter
               .staticFunctionAccess(backend.getNativeInterceptorMethod)]));
diff --git a/pkg/compiler/lib/src/js_emitter/js_emitter.dart b/pkg/compiler/lib/src/js_emitter/js_emitter.dart
index fff722e..540aad6 100644
--- a/pkg/compiler/lib/src/js_emitter/js_emitter.dart
+++ b/pkg/compiler/lib/src/js_emitter/js_emitter.dart
@@ -4,33 +4,50 @@
 
 library dart2js.js_emitter;
 
+import 'package:js_ast/src/precedence.dart' as js_precedence;
+import 'package:js_runtime/shared/embedded_names.dart' as embeddedNames;
+import 'package:js_runtime/shared/embedded_names.dart' show JsBuiltin;
+
+
 import '../common.dart';
-
+import '../common/names.dart' show
+    Identifiers;
+import '../common/tasks.dart' show
+    CompilerTask;
+import '../compiler.dart' show
+    Compiler;
 import '../constants/values.dart';
-
 import '../closure.dart' show
     ClosureClassElement,
     ClosureClassMap,
     ClosureFieldElement,
     CapturedVariable;
-
 import '../dart_types.dart' show
-    TypedefType;
-
+    DartType,
+    FunctionType,
+    InterfaceType,
+    TypedefType,
+    Types,
+    TypeVariableType;
+import '../deferred_load.dart' show
+    OutputUnit;
 import '../elements/elements.dart' show
+    ClassElement,
     ConstructorBodyElement,
+    Element,
+    Elements,
     ElementKind,
     FieldElement,
-    ParameterElement,
-    TypeVariableElement,
+    FunctionElement,
+    FunctionSignature,
+    MetadataAnnotation,
     MethodElement,
-    MemberElement;
-
+    MemberElement,
+    MixinApplicationElement,
+    ParameterElement,
+    TypeVariableElement;
 import '../js/js.dart' as jsAst;
 import '../js/js.dart' show js;
-
-import 'package:js_ast/src/precedence.dart' as js_precedence;
-
 import '../js_backend/js_backend.dart' show
     CheckedModeHelper,
     CompoundName,
@@ -41,35 +58,29 @@
     JavaScriptConstantCompiler,
     Namer,
     RuntimeTypes,
+    RuntimeTypesEncoder,
     SetterName,
     Substitution,
     TypeCheck,
     TypeChecks,
     TypeVariableHandler;
+import '../native/native.dart' as native;
+import '../universe/call_structure.dart' show
+    CallStructure;
+import '../universe/selector.dart' show
+    Selector;
+import '../universe/universe.dart' show
+    SelectorConstraints;
+import '../util/util.dart' show
+    Setlet;
 
-import 'model.dart';
-import 'program_builder/program_builder.dart';
 
 import 'full_emitter/emitter.dart' as full_js_emitter;
 import 'lazy_emitter/emitter.dart' as lazy_js_emitter;
+import 'model.dart';
+import 'program_builder/program_builder.dart';
 import 'startup_emitter/emitter.dart' as startup_js_emitter;
 
-import '../universe/universe.dart' show
-    TypeMaskSet,
-    TypedSelector;
-
-import '../util/util.dart' show
-    NO_LOCATION_SPANNABLE,
-    Setlet;
-
-import '../deferred_load.dart' show
-    OutputUnit;
-
-import 'package:js_runtime/shared/embedded_names.dart' as embeddedNames;
-import 'package:js_runtime/shared/embedded_names.dart' show JsBuiltin;
-
-import '../native/native.dart' as native;
-
 part 'class_stub_generator.dart';
 part 'code_emitter_task.dart';
 part 'helpers.dart';
diff --git a/pkg/compiler/lib/src/js_emitter/lazy_emitter/emitter.dart b/pkg/compiler/lib/src/js_emitter/lazy_emitter/emitter.dart
index 810b678..6a325ff 100644
--- a/pkg/compiler/lib/src/js_emitter/lazy_emitter/emitter.dart
+++ b/pkg/compiler/lib/src/js_emitter/lazy_emitter/emitter.dart
@@ -9,25 +9,30 @@
     METADATA,
     TYPES;
 
-import '../program_builder/program_builder.dart' show ProgramBuilder;
-import '../model.dart';
-import 'model_emitter.dart';
 import '../../common.dart';
-import '../../elements/elements.dart' show FieldElement;
+import '../../compiler.dart' show
+    Compiler;
+import '../../constants/values.dart' show
+    ConstantValue;
+import '../../elements/elements.dart' show
+    ClassElement,
+    Element,
+    FieldElement,
+    FunctionElement;
 import '../../js/js.dart' as js;
-
 import '../../js_backend/js_backend.dart' show
     JavaScriptBackend,
     Namer;
 
 import '../js_emitter.dart' show
     NativeEmitter;
-
 import '../js_emitter.dart' as emitterTask show
     Emitter;
+import '../model.dart';
+import '../program_builder/program_builder.dart' show
+    ProgramBuilder;
 
-import '../../util/util.dart' show
-    NO_LOCATION_SPANNABLE;
+import 'model_emitter.dart';
 
 class Emitter implements emitterTask.Emitter {
   final Compiler _compiler;
@@ -41,6 +46,8 @@
         this.namer = namer,
         _emitter = new ModelEmitter(compiler, namer, nativeEmitter);
 
+  DiagnosticReporter get reporter => _compiler.reporter;
+
   @override
   String get patchVersion => "lazy";
 
@@ -150,7 +157,7 @@
         return js.js.expressionTemplateFor('#.substring($isPrefixLength)');
 
       case JsBuiltin.isFunctionType:
-        return _backend.rti.representationGenerator.templateForIsFunctionType;
+        return _backend.rtiEncoder.templateForIsFunctionType;
 
       case JsBuiltin.rawRtiToJsConstructorName:
         return js.js.expressionTemplateFor("#.$typeNameProperty");
@@ -159,8 +166,7 @@
         return js.js.expressionTemplateFor("#.constructor");
 
       case JsBuiltin.createFunctionTypeRti:
-        return _backend.rti.representationGenerator
-            .templateForCreateFunctionType;
+        return _backend.rtiEncoder.templateForCreateFunctionType;
 
       case JsBuiltin.isSubtype:
         // TODO(floitsch): move this closer to where is-check properties are
@@ -181,7 +187,7 @@
         throw new UnsupportedError('createDartClosureFromNameOfStaticFunction');
 
       default:
-        _compiler.internalError(NO_LOCATION_SPANNABLE,
+        reporter.internalError(NO_LOCATION_SPANNABLE,
                                 "Unhandled Builtin: $builtin");
         return null;
     }
diff --git a/pkg/compiler/lib/src/js_emitter/lazy_emitter/model_emitter.dart b/pkg/compiler/lib/src/js_emitter/lazy_emitter/model_emitter.dart
index b97a47e..0545b57 100644
--- a/pkg/compiler/lib/src/js_emitter/lazy_emitter/model_emitter.dart
+++ b/pkg/compiler/lib/src/js_emitter/lazy_emitter/model_emitter.dart
@@ -4,16 +4,21 @@
 
 library dart2js.js_emitter.lazy_emitter.model_emitter;
 
-import '../../constants/values.dart' show ConstantValue, FunctionConstantValue;
-import '../../dart2jslib.dart' show Compiler;
-import '../../elements/elements.dart' show ClassElement, FunctionElement;
+import '../../compiler.dart' show
+    Compiler;
+import '../../constants/values.dart' show
+    ConstantValue,
+    FunctionConstantValue;
+import '../../elements/elements.dart' show
+    ClassElement,
+    FunctionElement;
 import '../../js/js.dart' as js;
 import '../../js_backend/js_backend.dart' show
     JavaScriptBackend,
     Namer,
     ConstantEmitter;
 
-import '../js_emitter.dart' show AstContainer, NativeEmitter;
+import '../js_emitter.dart' show NativeEmitter;
 
 import 'package:js_runtime/shared/embedded_names.dart' show
     CREATE_NEW_ISOLATE,
@@ -129,13 +134,14 @@
   int emitProgram(Program program) {
     List<Fragment> fragments = program.fragments;
     MainFragment mainFragment = fragments.first;
+    Iterable<Fragment> deferredFragments = program.deferredFragments;
 
     int totalSize = 0;
 
     // We have to emit the deferred fragments first, since we need their
     // deferred hash (which depends on the output) when emitting the main
     // fragment.
-    List<js.Expression> fragmentsCode = fragments.skip(1).map(
+    List<js.Expression> fragmentsCode = deferredFragments.map(
             (DeferredFragment deferredUnit) {
       js.Expression types =
           program.metadataTypesForOutputUnit(deferredUnit.outputUnit);
@@ -207,7 +213,8 @@
                 'callName': js.string(namer.callNameField)}),
 
        'cyclicThrow':
-           backend.emitter.staticFunctionAccess(backend.getCyclicThrowHelper()),
+           backend.emitter.staticFunctionAccess(
+               backend.helpers.cyclicThrowHelper),
        'outputContainsConstantList': program.outputContainsConstantList,
        'embeddedGlobals': emitEmbeddedGlobals(program),
        'readMetadataTypeFunction': readMetadataTypeFunction,
diff --git a/pkg/compiler/lib/src/js_emitter/metadata_collector.dart b/pkg/compiler/lib/src/js_emitter/metadata_collector.dart
index 8ffda24..43aa528 100644
--- a/pkg/compiler/lib/src/js_emitter/metadata_collector.dart
+++ b/pkg/compiler/lib/src/js_emitter/metadata_collector.dart
@@ -145,6 +145,7 @@
 
   JavaScriptBackend get _backend => _compiler.backend;
   TypeVariableHandler get _typeVariableHandler => _backend.typeVariableHandler;
+  DiagnosticReporter get reporter => _compiler.reporter;
 
   bool _mustEmitMetadataFor(Element element) {
     return _backend.mustRetainMetadata &&
@@ -159,20 +160,15 @@
   /// mirrors_patch to implement DeclarationMirror.metadata.
   jsAst.Fun buildMetadataFunction(Element element) {
     if (!_mustEmitMetadataFor(element)) return null;
-    return _compiler.withCurrentElement(element, () {
+    return reporter.withCurrentElement(element, () {
       List<jsAst.Expression> metadata = <jsAst.Expression>[];
-      Link link = element.metadata;
-      // TODO(ahe): Why is metadata sometimes null?
-      if (link != null) {
-        for (; !link.isEmpty; link = link.tail) {
-          MetadataAnnotation annotation = link.head;
-          ConstantValue constant =
-              _backend.constants.getConstantValueForMetadata(annotation);
-          if (constant == null) {
-            _compiler.internalError(annotation, 'Annotation value is null.');
-          } else {
-            metadata.add(_emitter.constantReference(constant));
-          }
+      for (MetadataAnnotation annotation in element.metadata) {
+        ConstantValue constant =
+            _backend.constants.getConstantValueForMetadata(annotation);
+        if (constant == null) {
+          reporter.internalError(annotation, 'Annotation value is null.');
+        } else {
+          metadata.add(_emitter.constantReference(constant));
         }
       }
       if (metadata.isEmpty) return null;
@@ -200,7 +196,7 @@
     ConstantValue constant =
         _backend.constants.getConstantValueForMetadata(annotation);
     if (constant == null) {
-      _compiler.internalError(annotation, 'Annotation value is null.');
+      reporter.internalError(annotation, 'Annotation value is null.');
       return null;
     }
     return _addGlobalMetadata(_emitter.constantReference(constant));
@@ -247,7 +243,7 @@
 
   jsAst.Expression _computeTypeRepresentation(DartType type,
                                               {ignoreTypeVariables: false}) {
-    jsAst.Expression representation = _backend.rti.getTypeRepresentation(
+    jsAst.Expression representation = _backend.rtiEncoder.getTypeRepresentation(
         type,
         (variable) {
           if (ignoreTypeVariables) return new jsAst.LiteralNull();
@@ -260,7 +256,7 @@
     if (representation is jsAst.LiteralString) {
       // We don't want the representation to be a string, since we use
       // strings as indicator for non-initialized types in the lazy emitter.
-      _compiler.internalError(
+      reporter.internalError(
           NO_LOCATION_SPANNABLE, 'reified types should not be strings.');
     }
 
@@ -286,15 +282,11 @@
   }
 
   List<jsAst.DeferredNumber> computeMetadata(FunctionElement element) {
-    return _compiler.withCurrentElement(element, () {
+    return reporter.withCurrentElement(element, () {
       if (!_mustEmitMetadataFor(element)) return const <jsAst.DeferredNumber>[];
       List<jsAst.DeferredNumber> metadata = <jsAst.DeferredNumber>[];
-      Link link = element.metadata;
-      // TODO(ahe): Why is metadata sometimes null?
-      if (link != null) {
-        for (; !link.isEmpty; link = link.tail) {
-          metadata.add(reifyMetadata(link.head));
-        }
+      for (MetadataAnnotation annotation in element.metadata) {
+        metadata.add(reifyMetadata(annotation));
       }
       return metadata;
     });
diff --git a/pkg/compiler/lib/src/js_emitter/model.dart b/pkg/compiler/lib/src/js_emitter/model.dart
index 7e4703e..29ad8ae 100644
--- a/pkg/compiler/lib/src/js_emitter/model.dart
+++ b/pkg/compiler/lib/src/js_emitter/model.dart
@@ -4,15 +4,21 @@
 
 library dart2js.new_js_emitter.model;
 
-import '../js/js.dart' as js show Expression, Statement, Name, Literal,
-    TokenFinalizer;
-import '../constants/values.dart' show ConstantValue;
-
-import '../deferred_load.dart' show OutputUnit;
-
-import 'js_emitter.dart' show MetadataCollector, TokenFinalizer;
-
 import '../common.dart';
+import '../constants/values.dart' show
+    ConstantValue;
+import '../deferred_load.dart' show
+    OutputUnit;
+import '../elements/elements.dart' show
+    Element;
+import '../js/js.dart' as js show
+    Expression,
+    Literal,
+    Name,
+    Statement,
+    TokenFinalizer;
+
+import 'js_emitter.dart' show MetadataCollector;
 
 class Program {
   final List<Fragment> fragments;
diff --git a/pkg/compiler/lib/src/js_emitter/native_emitter.dart b/pkg/compiler/lib/src/js_emitter/native_emitter.dart
index 0d90d2f..9f87335 100644
--- a/pkg/compiler/lib/src/js_emitter/native_emitter.dart
+++ b/pkg/compiler/lib/src/js_emitter/native_emitter.dart
@@ -134,8 +134,9 @@
       } else if (extensionPoints.containsKey(cls)) {
         needed = true;
       }
-      if (cls.isNative &&
-          native.nativeTagsForcedNonLeaf(classElement)) {
+      if (classElement.isJsInterop) {
+        needed = true;  // TODO(jacobr): we don't need all interop classes.
+      } else if (cls.isNative && native.nativeTagsForcedNonLeaf(classElement)) {
         needed = true;
         nonLeafClasses.add(cls);
       }
@@ -154,6 +155,7 @@
 
     for (Class cls in classes) {
       if (!cls.isNative) continue;
+      if (cls.element.isJsInterop) continue;
       List<String> nativeTags = native.nativeTagsOfClass(cls.element);
 
       if (nonLeafClasses.contains(cls) ||
@@ -268,7 +270,7 @@
       // parameter that was not provided for this stub.
       for (jsAst.Parameter stubParameter in stubParameters) {
         if (stubParameter.name == name) {
-          DartType type = parameter.type.unalias(compiler);
+          DartType type = parameter.type.unaliased;
           if (type is FunctionType) {
             // The parameter type is a function type either directly or through
             // typedef(s).
@@ -294,7 +296,7 @@
     // The target JS function may check arguments.length so we need to
     // make sure not to pass any unspecified optional arguments to it.
     // For example, for the following Dart method:
-    //   foo([x, y, z]);
+    //   foo({x, y, z});
     // The call:
     //   foo(y: 1)
     // must be turned into a JS call to:
@@ -319,9 +321,20 @@
     } else {
       // Native methods that are not intercepted must be static.
       assert(invariant(member, member.isStatic));
-      receiver = js('this');
       arguments = argumentsBuffer.sublist(0,
           indexOfLastOptionalArgumentInParameters + 1);
+      if (member.isJsInterop) {
+        // fixedBackendPath is allowed to have the form foo.bar.baz for
+        // interop. This template is uncached to avoid possibly running out of
+        // memory when Dart2Js is run in server mode. In reality the risk of
+        // caching these templates causing an issue  is very low as each class
+        // and library that uses typed JavaScript interop will create only 1
+        // unique template.
+        receiver = js.uncachedExpressionTemplate(
+            backend.namer.fixedBackendPath(member)).instantiate([]);
+      } else {
+        receiver = js('this');
+      }
     }
     statements.add(
         js.statement('return #.#(#)', [receiver, target, arguments]));
diff --git a/pkg/compiler/lib/src/js_emitter/parameter_stub_generator.dart b/pkg/compiler/lib/src/js_emitter/parameter_stub_generator.dart
index 44350b5..0d95278 100644
--- a/pkg/compiler/lib/src/js_emitter/parameter_stub_generator.dart
+++ b/pkg/compiler/lib/src/js_emitter/parameter_stub_generator.dart
@@ -15,6 +15,7 @@
 
   Emitter get emitter => backend.emitter.emitter;
   CodeEmitterTask get emitterTask => backend.emitter;
+  DiagnosticReporter get reporter => compiler.reporter;
 
   bool needsSuperGetter(FunctionElement element) =>
     compiler.codegenWorld.methodsNeedingSuperGetter.contains(element);
@@ -60,8 +61,8 @@
     // If the method is intercepted, we need to also pass the actual receiver.
     int extraArgumentCount = isInterceptedMethod ? 1 : 0;
     // Use '$receiver' to avoid clashes with other parameter names. Using
-    // '$receiver' works because namer.safeVariableName used for getting parameter
-    // names never returns a name beginning with a single '$'.
+    // '$receiver' works because namer.safeVariableName used for getting
+    // parameter names never returns a name beginning with a single '$'.
     String receiverArgumentName = r'$receiver';
 
     // The parameters that this stub takes.
@@ -190,24 +191,24 @@
     if (member.enclosingElement.isClosure) {
       ClosureClassElement cls = member.enclosingElement;
       if (cls.supertype.element == backend.boundClosureClass) {
-        compiler.internalError(cls.methodElement, 'Bound closure1.');
+        reporter.internalError(cls.methodElement, 'Bound closure1.');
       }
       if (cls.methodElement.isInstanceMember) {
-        compiler.internalError(cls.methodElement, 'Bound closure2.');
+        reporter.internalError(cls.methodElement, 'Bound closure2.');
       }
     }
 
     // The set of selectors that apply to `member`. For example, for
     // a member `foo(x, [y])` the following selectors may apply:
     // `foo(x)`, and `foo(x, y)`.
-    Map<Selector, TypeMaskSet> selectors;
+    Map<Selector, SelectorConstraints> selectors;
     // The set of selectors that apply to `member` if it's name was `call`.
     // This happens when a member is torn off. In that case calls to the
     // function use the name `call`, and we must be able to handle every
     // `call` invocation that matches the signature. For example, for
     // a member `foo(x, [y])` the following selectors would be possible
     // call-selectors: `call(x)`, and `call(x, y)`.
-    Map<Selector, TypeMaskSet> callSelectors;
+    Map<Selector, SelectorConstraints> callSelectors;
 
     // Only instance members (not static methods) need stubs.
     if (member.isInstanceMember) {
@@ -220,8 +221,9 @@
     }
 
     assert(emptySelectorSet.isEmpty);
-    if (selectors == null) selectors = const <Selector, TypeMaskSet>{};
-    if (callSelectors == null) callSelectors = const <Selector, TypeMaskSet>{};
+    if (selectors == null) selectors = const <Selector, SelectorConstraints>{};
+    if (callSelectors == null) callSelectors =
+        const <Selector, SelectorConstraints>{};
 
     List<ParameterStubMethod> stubs = <ParameterStubMethod>[];
 
@@ -242,8 +244,7 @@
     // Start with the callSelectors since they imply the generation of the
     // non-call version.
     for (Selector selector in callSelectors.keys) {
-      Selector renamedSelector = new Selector(
-          SelectorKind.CALL,
+      Selector renamedSelector = new Selector.call(
           member.memberName,
           selector.callStructure);
       renamedCallSelectors.add(renamedSelector);
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 1b9b6ef..8ac784a 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
@@ -4,34 +4,62 @@
 
 library dart2js.js_emitter.program_builder;
 
-import '../js_emitter.dart' show computeMixinClass, Emitter;
-import '../model.dart';
-
-import '../../common.dart';
-import '../../closure.dart' show ClosureFieldElement;
-import '../../js/js.dart' as js;
-
-import '../../js_backend/js_backend.dart' show
-    Namer,
-    JavaScriptBackend,
-    JavaScriptConstantCompiler;
-
 import '../js_emitter.dart' show
     ClassStubGenerator,
     CodeEmitterTask,
+    computeMixinClass,
+    Emitter,
     InterceptorStubGenerator,
     MainCallStubGenerator,
     ParameterStubGenerator,
     RuntimeTypeGenerator,
     TypeTestProperties;
+import '../model.dart';
 
+import '../../common.dart';
+import '../../common/names.dart' show
+    Names;
+import '../../compiler.dart' show
+    Compiler;
+import '../../constants/values.dart' show
+    ConstantValue,
+    InterceptorConstantValue;
+import '../../closure.dart' show
+    ClosureFieldElement;
+import '../../dart_types.dart' show
+    DartType,
+    FunctionType,
+    TypedefType;
 import '../../elements/elements.dart' show
+    ClassElement,
+    Element,
+    Elements,
     FieldElement,
+    FunctionElement,
+    FunctionSignature,
+    GetterElement,
+    LibraryElement,
     MethodElement,
-    ParameterElement;
-
-import '../../universe/universe.dart' show Universe, TypeMaskSet;
-import '../../deferred_load.dart' show DeferredLoadTask, OutputUnit;
+    Name,
+    ParameterElement,
+    TypedefElement,
+    VariableElement;
+import '../../js/js.dart' as js;
+import '../../js_backend/js_backend.dart' show
+    Namer,
+    JavaScriptBackend,
+    JavaScriptConstantCompiler,
+    StringBackedName;
+import '../../universe/call_structure.dart' show
+    CallStructure;
+import '../../universe/selector.dart' show
+    Selector;
+import '../../universe/universe.dart' show
+    Universe,
+    SelectorConstraints;
+import '../../deferred_load.dart' show
+    DeferredLoadTask,
+    OutputUnit;
 
 part 'collector.dart';
 part 'registry.dart';
@@ -142,6 +170,8 @@
         nativeClasses, interceptorClassesNeededByConstants,
         classesModifiedByEmitRTISupport);
 
+    _addJsInteropStubs(_registry.mainLibrariesMap);
+
     MainFragment mainFragment = _buildMainFragment(_registry.mainLibrariesMap);
     Iterable<Fragment> deferredFragments =
         _registry.deferredLibrariesMap.map(_buildDeferredFragment);
@@ -319,6 +349,146 @@
     return libraries;
   }
 
+  void _addJsInteropStubs(LibrariesMap librariesMap) {
+    if (_classes.containsKey(_compiler.objectClass)) {
+      var toStringInvocation = namer.invocationName(new Selector.call(
+          new Name("toString", _compiler.objectClass.library),
+          CallStructure.NO_ARGS));
+      // TODO(jacobr): register toString as used so that it is always accessible
+      // from JavaScript.
+      _classes[_compiler.objectClass].callStubs.add(_buildStubMethod(
+          new StringBackedName("toString"),
+          js.js('function() { return this.#(this) }', toStringInvocation)));
+    }
+
+    // We add all members from classes marked with isJsInterop to the base
+    // Interceptor class with implementations that directly call the
+    // corresponding JavaScript member. We do not attempt to bind this when
+    // tearing off JavaScript methods as we cannot distinguish between calling
+    // a regular getter that returns a JavaScript function and tearing off
+    // a method in the case where there exist multiple JavaScript classes
+    // that conflict on whether the member is a getter or a method.
+    var interceptorClass = _classes[backend.jsJavaScriptObjectClass];
+    var stubNames = new Set<String>();
+    librariesMap.forEach((LibraryElement library, List<Element> elements) {
+      for (Element e in elements) {
+        if (e is ClassElement && e.isJsInterop) {
+          e.declaration.forEachMember((_, Element member) {
+            if (!member.isInstanceMember) return;
+            if (member.isGetter || member.isField || member.isFunction) {
+              var selectors =
+                  _compiler.codegenWorld.getterInvocationsByName(member.name);
+              if (selectors != null && !selectors.isEmpty) {
+                for (var selector in selectors.keys) {
+                  var stubName = namer.invocationName(selector);
+                  if (stubNames.add(stubName.key)) {
+                    interceptorClass.callStubs.add(_buildStubMethod(
+                        stubName,
+                        js.js(
+                            'function(obj) { return obj.# }', [member.name]),
+                        element: member));
+                  }
+                }
+              }
+            }
+
+            if (member.isSetter || (member.isField && !member.isConst)) {
+              var selectors =
+                  _compiler.codegenWorld.setterInvocationsByName(member.name);
+              if (selectors != null && !selectors.isEmpty) {
+                var stubName = namer.setterForElement(member);
+                if (stubNames.add(stubName.key)) {
+                  interceptorClass.callStubs.add(_buildStubMethod(
+                      stubName,
+                      js.js('function(obj, v) { return obj.# = v }',
+                          [member.name]),
+                      element: member));
+                }
+              }
+            }
+
+            // Generating stubs for direct calls and stubs for call-through
+            // of getters that happen to be functions.
+            bool isFunctionLike = false;
+            FunctionType functionType = null;
+
+            if (member.isFunction) {
+              FunctionElement fn = member;
+              functionType = fn.type;
+            } else if (member.isGetter) {
+              if (_compiler.trustTypeAnnotations) {
+                GetterElement getter = member;
+                DartType returnType = getter.type.returnType;
+                if (returnType.isFunctionType) {
+                  functionType = returnType;
+                } else if (returnType.treatAsDynamic ||
+                    _compiler.types.isSubtype(returnType,
+                        backend.resolution.coreTypes.functionType)) {
+                  if (returnType.isTypedef) {
+                    TypedefType typedef = returnType;
+                    // TODO(jacobr): can we just use typdef.unaliased instead?
+                    functionType = typedef.element.functionSignature.type;
+                  } else {
+                    // Other misc function type such as coreTypes.Function.
+                    // Allow any number of arguments.
+                    isFunctionLike = true;
+                  }
+                }
+              } else {
+                isFunctionLike = true;
+              }
+            } // TODO(jacobr): handle field elements.
+
+            if (isFunctionLike || functionType != null) {
+              int minArgs;
+              int maxArgs;
+              if (functionType != null) {
+                minArgs = functionType.parameterTypes.length;
+                maxArgs = minArgs + functionType.optionalParameterTypes.length;
+              } else {
+                minArgs = 0;
+                maxArgs = 32767;
+              }
+              var selectors =
+                  _compiler.codegenWorld.invocationsByName(member.name);
+              // Named arguments are not yet supported. In the future we
+              // may want to map named arguments to an object literal containing
+              // all named arguments.
+              if (selectors != null && !selectors.isEmpty) {
+                for (var selector in selectors.keys) {
+                  // Check whether the arity matches this member.
+                  var argumentCount = selector.argumentCount;
+                  // JS interop does not support named arguments.
+                  if (selector.namedArgumentCount > 0) break;
+                  if (argumentCount < minArgs) break;
+                  if (argumentCount > maxArgs) break;
+                  var stubName = namer.invocationName(selector);
+                  if (!stubNames.add(stubName.key)) break;
+                  var parameters = new List<String>.generate(argumentCount,
+                      (i) => 'p$i');
+
+                  // We intentionally generate the same stub method for direct
+                  // calls and call-throughs of getters so that calling a
+                  // getter that returns a function behaves the same as calling
+                  // a method. This is helpful as many typed JavaScript APIs
+                  // specify member functions with getters that return
+                  // functions. The behavior of this solution matches JavaScript
+                  // behavior implicitly binding this only when JavaScript
+                  // would.
+                  interceptorClass.callStubs.add(_buildStubMethod(
+                      stubName,
+                      js.js('function(receiver, #) { return receiver.#(#) }',
+                          [parameters, member.name, parameters]),
+                      element: member));
+                }
+              }
+            }
+          });
+        }
+      }
+    });
+  }
+
   // Note that a library-element may have multiple [Library]s, if it is split
   // into multiple output units.
   Library _buildLibrary(LibraryElement library, List<Element> elements) {
@@ -366,6 +536,11 @@
 
   Class _buildClass(ClassElement element) {
     bool onlyForRti = collector.classesOnlyNeededForRti.contains(element);
+    if (element.isJsInterop) {
+      // TODO(jacobr): check whether the class has any active static fields
+      // if it does not we can suppress it completely.
+      onlyForRti = true;
+    }
 
     List<Method> methods = [];
     List<StubMethod> callStubs = <StubMethod>[];
@@ -385,7 +560,7 @@
         if (method != null) methods.add(method);
       }
       if (member.isGetter || member.isField) {
-        Map<Selector, TypeMaskSet> selectors =
+        Map<Selector, SelectorConstraints> selectors =
             _compiler.codegenWorld.invocationsByName(member.name);
         if (selectors != null && !selectors.isEmpty) {
 
@@ -422,7 +597,7 @@
     if (element == backend.closureClass) {
       // We add a special getter here to allow for tearing off a closure from
       // itself.
-      js.Name name = namer.getterForMember(Selector.CALL_NAME);
+      js.Name name = namer.getterForMember(Names.call);
       js.Fun function = js.js('function() { return this; }');
       callStubs.add(_buildStubMethod(name, function));
     }
@@ -446,28 +621,35 @@
             storeFunctionTypeInMetadata: _storeFunctionTypesInMetadata);
 
     List<StubMethod> checkedSetters = <StubMethod>[];
-    for (Field field in instanceFields) {
-      if (field.needsCheckedSetter) {
-        assert(!field.needsUncheckedSetter);
-        Element element = field.element;
-        js.Expression code = backend.generatedCode[element];
-        assert(code != null);
-        js.Name name = namer.deriveSetterName(field.accessorName);
-        checkedSetters.add(_buildStubMethod(name, code, element: element));
-      }
-    }
-
     List<StubMethod> isChecks = <StubMethod>[];
-    typeTests.properties.forEach((js.Name name, js.Node code) {
-      isChecks.add(_buildStubMethod(name, code));
-    });
+    if (element.isJsInterop) {
+      typeTests.properties.forEach((js.Name name, js.Node code) {
+        _classes[backend.jsInterceptorClass].isChecks.add(
+            _buildStubMethod(name, code));
+      });
+    } else {
+      for (Field field in instanceFields) {
+        if (field.needsCheckedSetter) {
+          assert(!field.needsUncheckedSetter);
+          Element element = field.element;
+          js.Expression code = backend.generatedCode[element];
+          assert(code != null);
+          js.Name name = namer.deriveSetterName(field.accessorName);
+          checkedSetters.add(_buildStubMethod(name, code, element: element));
+        }
+      }
+
+      typeTests.properties.forEach((js.Name name, js.Node code) {
+        isChecks.add(_buildStubMethod(name, code));
+      });
+    }
 
     js.Name name = namer.className(element);
     String holderName = namer.globalObjectFor(element);
     // TODO(floitsch): we shouldn't update the registry in the middle of
     // building a class.
     Holder holder = _registry.registerHolder(holderName);
-    bool isInstantiated =
+    bool isInstantiated = !element.isJsInterop &&
         _compiler.codegenWorld.directlyInstantiatedClasses.contains(element);
 
     Class result;
@@ -638,7 +820,7 @@
   js.Expression _generateFunctionType(DartType type, OutputUnit outputUnit) {
     if (type.containsTypeVariables) {
       js.Expression thisAccess = js.js(r'this.$receiver');
-      return backend.rti.getSignatureEncoding(type, thisAccess);
+      return backend.rtiEncoder.getSignatureEncoding(type, thisAccess);
     } else {
       return backend.emitter.metadataCollector
           .reifyTypeForOutputUnit(type, outputUnit);
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 b5e1a57..8b20e2d 100644
--- a/pkg/compiler/lib/src/js_emitter/runtime_type_generator.dart
+++ b/pkg/compiler/lib/src/js_emitter/runtime_type_generator.dart
@@ -68,7 +68,7 @@
     /// native classes.
     /// TODO(herhut): Generate tests for native classes dynamically, as well.
     void generateIsTest(Element other) {
-      if (classElement.isNative ||
+      if (classElement.isJsInterop || classElement.isNative ||
           !classElement.isSubclassOf(other)) {
         result.properties[namer.operatorIs(other)] = js('1');
       }
@@ -78,9 +78,8 @@
                                        FunctionType type) {
       assert(method.isImplementation);
       jsAst.Expression thisAccess = new jsAst.This();
-      Node node = method.node;
       ClosureClassMap closureData =
-          compiler.closureToClassMapper.closureMappingCache[node];
+          compiler.closureToClassMapper.closureMappingCache[method.node];
       if (closureData != null) {
         ClosureFieldElement thisLocal =
             closureData.freeVariableMap[closureData.thisLocal];
@@ -94,8 +93,9 @@
         result.functionTypeIndex =
             emitterTask.metadataCollector.reifyType(type);
       } else {
-        RuntimeTypes rti = backend.rti;
-        jsAst.Expression encoding = rti.getSignatureEncoding(type, thisAccess);
+        RuntimeTypesEncoder rtiEncoder = backend.rtiEncoder;
+        jsAst.Expression encoding =
+            rtiEncoder.getSignatureEncoding(type, thisAccess);
         jsAst.Name operatorSignature =
             namer.asName(namer.operatorSignature);
         result.properties[operatorSignature] = encoding;
@@ -105,10 +105,14 @@
     void generateSubstitution(ClassElement cls, {bool emitNull: false}) {
       if (cls.typeVariables.isEmpty) return;
       RuntimeTypes rti = backend.rti;
+      RuntimeTypesEncoder rtiEncoder = backend.rtiEncoder;
       jsAst.Expression expression;
       bool needsNativeCheck =
           emitterTask.nativeEmitter.requiresNativeIsCheck(cls);
-      expression = rti.getSupertypeSubstitution(classElement, cls);
+      Substitution substitution = rti.getSubstitution(classElement, cls);
+      if (substitution != null) {
+        expression = rtiEncoder.getSubstitutionCode(substitution);
+      }
       if (expression == null && (emitNull || needsNativeCheck)) {
         expression = new jsAst.LiteralNull();
       }
@@ -122,7 +126,8 @@
       generateIsTest(checkedClass);
       Substitution substitution = check.substitution;
       if (substitution != null) {
-        jsAst.Expression body = substitution.getCode(backend.rti);
+        jsAst.Expression body =
+            backend.rtiEncoder.getSubstitutionCode(substitution);
         result.properties[namer.substitutionName(checkedClass)] = body;
       }
     }
@@ -213,10 +218,10 @@
     // [Function] and needs checks for all typedefs that are used in is-checks.
     if (checkedClasses.contains(compiler.functionClass) ||
         checkedFunctionTypes.isNotEmpty) {
-      Element call = cls.lookupLocalMember(Compiler.CALL_OPERATOR_NAME);
+      Element call = cls.lookupLocalMember(Identifiers.call);
       if (call == null) {
         // If [cls] is a closure, it has a synthetic call operator method.
-        call = cls.lookupBackendMember(Compiler.CALL_OPERATOR_NAME);
+        call = cls.lookupBackendMember(Identifiers.call);
       }
       if (call != null && call.isFunction) {
         FunctionElement callFunction = call;
@@ -228,7 +233,7 @@
                                     generateSubstitution,
                                     generated);
         }
-        FunctionType callType = callFunction.computeType(compiler);
+        FunctionType callType = callFunction.computeType(compiler.resolution);
         generateFunctionTypeSignature(callFunction, callType);
       }
     }
@@ -291,16 +296,16 @@
   StubMethod _generateTypeVariableReader(ClassElement cls,
                                          TypeVariableElement element) {
     jsAst.Name name = namer.nameForReadTypeVariable(element);
-    int index = RuntimeTypes.getTypeVariableIndex(element);
+    int index = element.index;
     jsAst.Expression computeTypeVariable;
 
     Substitution substitution =
-        backend.rti.computeSubstitution(
-            cls, element.typeDeclaration, alwaysGenerateFunction: true);
+        backend.rti.getSubstitution(cls, element.typeDeclaration);
     if (substitution != null) {
       computeTypeVariable =
           js(r'#.apply(null, this.$builtinTypeInfo)',
-             substitution.getCodeForVariable(index, backend.rti));
+                 backend.rtiEncoder.getSubstitutionCodeForVariable(
+                     substitution, index));
     } else {
       // TODO(ahe): These can be generated dynamically.
       computeTypeVariable =
diff --git a/pkg/compiler/lib/src/js_emitter/startup_emitter/emitter.dart b/pkg/compiler/lib/src/js_emitter/startup_emitter/emitter.dart
index a3f2a13..7f8e845 100644
--- a/pkg/compiler/lib/src/js_emitter/startup_emitter/emitter.dart
+++ b/pkg/compiler/lib/src/js_emitter/startup_emitter/emitter.dart
@@ -10,25 +10,29 @@
     STATIC_FUNCTION_NAME_TO_CLOSURE,
     TYPES;
 
-import '../program_builder/program_builder.dart' show ProgramBuilder;
-import '../model.dart';
-import 'model_emitter.dart';
 import '../../common.dart';
-import '../../elements/elements.dart' show FieldElement;
+import '../../compiler.dart' show
+    Compiler;
+import '../../constants/values.dart' show
+    ConstantValue;
+import '../../elements/elements.dart' show
+    ClassElement,
+    Element,
+    FieldElement,
+    FunctionElement;
 import '../../js/js.dart' as js;
-
 import '../../js_backend/js_backend.dart' show
-JavaScriptBackend,
-Namer;
+    JavaScriptBackend,
+    Namer;
 
 import '../js_emitter.dart' show
     NativeEmitter;
-
 import '../js_emitter.dart' as emitterTask show
     Emitter;
+import '../program_builder/program_builder.dart' show ProgramBuilder;
+import '../model.dart';
 
-import '../../util/util.dart' show
-    NO_LOCATION_SPANNABLE;
+import 'model_emitter.dart';
 
 class Emitter implements emitterTask.Emitter {
   final Compiler _compiler;
@@ -44,6 +48,8 @@
         _emitter = new ModelEmitter(
             compiler, namer, nativeEmitter, shouldGenerateSourceMap);
 
+  DiagnosticReporter get reporter => _compiler.reporter;
+
   @override
   String get patchVersion => "startup";
 
@@ -147,7 +153,7 @@
         return js.js.expressionTemplateFor('#.substring($isPrefixLength)');
 
       case JsBuiltin.isFunctionType:
-        return _backend.rti.representationGenerator.templateForIsFunctionType;
+        return _backend.rtiEncoder.templateForIsFunctionType;
 
       case JsBuiltin.rawRtiToJsConstructorName:
         return js.js.expressionTemplateFor("#.$typeNameProperty");
@@ -156,8 +162,7 @@
         return js.js.expressionTemplateFor("#.constructor");
 
       case JsBuiltin.createFunctionTypeRti:
-        return _backend.rti.representationGenerator
-        .templateForCreateFunctionType;
+        return _backend.rtiEncoder.templateForCreateFunctionType;
 
       case JsBuiltin.isSubtype:
       // TODO(floitsch): move this closer to where is-check properties are
@@ -184,7 +189,7 @@
         return js.js.expressionTemplateFor("$functionAccess(#)");
 
       default:
-        _compiler.internalError(NO_LOCATION_SPANNABLE,
+        reporter.internalError(NO_LOCATION_SPANNABLE,
             "Unhandled Builtin: $builtin");
         return null;
     }
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 c4e0012..c8e6a75 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
@@ -52,7 +52,8 @@
 // The code relies on the fact that all Dart code is inside holders. As such
 // we can use "global" names however we want. As long as we don't shadow
 // JavaScript variables (like `Array`) we are free to chose whatever variable
-// names we want. Furthermore, the minifier reduces the names of the variables.
+// names we want. Furthermore, the pretty-printer minifies local variables, thus
+// reducing their size.
 const String mainBoilerplate = '''
 {
 // Declare deferred-initializer global, which is used to keep track of the
@@ -443,7 +444,7 @@
         {'deferredInitializer': emitDeferredInitializerGlobal(program.loadMap),
          'typeNameProperty': js.string(ModelEmitter.typeNameProperty),
          'cyclicThrow': backend.emitter.staticFunctionAccess(
-                 backend.getCyclicThrowHelper()),
+                 backend.helpers.cyclicThrowHelper),
          'operatorIsPrefix': js.string(namer.operatorIsPrefix),
          'tearOffCode': new js.Block(buildTearOffCode(backend)),
          'embeddedTypes': generateEmbeddedGlobalAccess(TYPES),
@@ -776,14 +777,27 @@
     List<js.Expression> inheritCalls = <js.Expression>[];
     List<js.Expression> mixinCalls = <js.Expression>[];
 
+    Set<Class> emittedClasses = new Set<Class>();
+
+    void emitInheritanceForClass(cls) {
+      if (cls == null || emittedClasses.contains(cls)) return;
+
+      Class superclass = cls.superclass;
+      emitInheritanceForClass(superclass);
+
+      js.Expression superclassReference = (superclass == null)
+          ? new js.LiteralNull()
+          : classReference(superclass);
+
+      inheritCalls.add(js.js('inherit(#, #)',
+          [classReference(cls), superclassReference]));
+
+      emittedClasses.add(cls);
+    }
+
     for (Library library in fragment.libraries) {
       for (Class cls in library.classes) {
-        js.Expression superclassReference = (cls.superclass == null)
-            ? new js.LiteralNull()
-            : classReference(cls.superclass);
-
-        inheritCalls.add(js.js('inherit(#, #)',
-            [classReference(cls), superclassReference]));
+        emitInheritanceForClass(cls);
 
         if (cls.isMixinApplication) {
           MixinApplication mixin = cls;
diff --git a/pkg/compiler/lib/src/js_emitter/startup_emitter/model_emitter.dart b/pkg/compiler/lib/src/js_emitter/startup_emitter/model_emitter.dart
index da22c61..2a06960 100644
--- a/pkg/compiler/lib/src/js_emitter/startup_emitter/model_emitter.dart
+++ b/pkg/compiler/lib/src/js_emitter/startup_emitter/model_emitter.dart
@@ -6,37 +6,6 @@
 
 import 'dart:convert' show JsonEncoder;
 
-import '../../common.dart';
-
-import '../../constants/values.dart' show ConstantValue, FunctionConstantValue;
-import '../../dart2jslib.dart' show Compiler;
-import '../../elements/elements.dart' show ClassElement, FunctionElement;
-import '../../hash/sha1.dart' show Hasher;
-
-import '../../io/code_output.dart';
-
-import '../../io/line_column_provider.dart' show
-    LineColumnCollector,
-    LineColumnProvider;
-
-import '../../io/source_map_builder.dart' show
-    SourceMapBuilder;
-
-import '../../js/js.dart' as js;
-import '../../js_backend/js_backend.dart' show
-    JavaScriptBackend,
-    Namer,
-    ConstantEmitter;
-
-import '../../util/util.dart' show
-    NO_LOCATION_SPANNABLE;
-
-import '../../util/uri_extras.dart' show
-    relativize;
-
-import '../headers.dart';
-import '../js_emitter.dart' show AstContainer, NativeEmitter;
-
 import 'package:js_runtime/shared/embedded_names.dart' show
     CLASS_FIELDS_EXTRACTOR,
     CLASS_ID_EXTRACTOR,
@@ -60,7 +29,38 @@
     TYPE_TO_INTERCEPTOR_MAP,
     TYPES;
 
-import '../js_emitter.dart' show NativeGenerator, buildTearOffCode;
+import '../../common.dart';
+import '../../constants/values.dart' show
+    ConstantValue,
+    FunctionConstantValue;
+import '../../compiler.dart' show
+    Compiler;
+import '../../elements/elements.dart' show
+    ClassElement,
+    FunctionElement;
+import '../../hash/sha1.dart' show
+    Hasher;
+import '../../io/code_output.dart';
+import '../../io/line_column_provider.dart' show
+    LineColumnCollector,
+    LineColumnProvider;
+import '../../io/source_map_builder.dart' show
+    SourceMapBuilder;
+import '../../js/js.dart' as js;
+import '../../js_backend/js_backend.dart' show
+    JavaScriptBackend,
+    Namer,
+    ConstantEmitter;
+import '../../util/uri_extras.dart' show
+    relativize;
+
+import '../headers.dart';
+import '../js_emitter.dart' show
+    NativeEmitter;
+
+import '../js_emitter.dart' show
+    buildTearOffCode,
+    NativeGenerator;
 import '../model.dart';
 
 part 'deferred_fragment_hash.dart';
@@ -97,6 +97,8 @@
         constantListGenerator);
   }
 
+  DiagnosticReporter get reporter => compiler.reporter;
+
   js.Expression constantListGenerator(js.Expression array) {
     // TODO(floitsch): remove hard-coded name.
     return js.js('makeConstList(#)', [array]);
@@ -164,7 +166,7 @@
   int emitProgram(Program program) {
     MainFragment mainFragment = program.fragments.first;
     List<DeferredFragment> deferredFragments =
-        new List<DeferredFragment>.from(program.fragments.skip(1));
+        new List<DeferredFragment>.from(program.deferredFragments);
 
     FragmentEmitter fragmentEmitter =
         new FragmentEmitter(compiler, namer, backend, constantEmitter, this);
@@ -208,13 +210,14 @@
 
     if (backend.requiresPreamble &&
         !backend.htmlLibraryIsLoaded) {
-      compiler.reportHint(NO_LOCATION_SPANNABLE, MessageKind.PREAMBLE);
+      reporter.reportHintMessage(
+          NO_LOCATION_SPANNABLE, MessageKind.PREAMBLE);
     }
 
     if (compiler.deferredMapUri != null) {
       writeDeferredMap();
     }
-    
+
     // Return the total program size.
     return outputBuffers.values.fold(0, (a, b) => a + b.length);
   }
diff --git a/pkg/compiler/lib/src/js_emitter/type_test_registry.dart b/pkg/compiler/lib/src/js_emitter/type_test_registry.dart
index ac333cc..f329cbf 100644
--- a/pkg/compiler/lib/src/js_emitter/type_test_registry.dart
+++ b/pkg/compiler/lib/src/js_emitter/type_test_registry.dart
@@ -129,7 +129,7 @@
     backend.generatedCode.keys.where((element) {
       return canBeReflectedAsFunction(element) && canBeReified(element);
     }).forEach((FunctionElement function) {
-      DartType type = function.computeType(compiler);
+      DartType type = function.type;
       for (ClassElement cls in backend.rti.getReferencedClasses(type)) {
         while (cls != null) {
           rtiNeededClasses.add(cls);
diff --git a/pkg/compiler/lib/src/library_loader.dart b/pkg/compiler/lib/src/library_loader.dart
index 9919cee..5759b52 100644
--- a/pkg/compiler/lib/src/library_loader.dart
+++ b/pkg/compiler/lib/src/library_loader.dart
@@ -6,31 +6,34 @@
 
 import 'dart:async';
 
-import 'dart2jslib.dart' show
-    Compiler,
-    CompilerTask,
-    DiagnosticListener,
-    MessageKind,
-    Script,
-    invariant;
-
+import 'common.dart';
+import 'common/names.dart' show
+    Uris;
+import 'common/tasks.dart' show
+    CompilerTask;
+import 'compiler.dart' show
+    Compiler;
 import 'elements/elements.dart' show
     CompilationUnitElement,
     Element,
+    ImportElement,
+    ExportElement,
     LibraryElement,
     PrefixElement;
-
 import 'elements/modelx.dart' show
     CompilationUnitElementX,
     DeferredLoaderGetterElementX,
     ErroneousElementX,
+    ExportElementX,
+    ImportElementX,
     LibraryElementX,
-    PrefixElementX;
+    LibraryDependencyElementX,
+    PrefixElementX,
+    SyntheticImportElement;
 
 import 'native/native.dart' as native;
-
+import 'script.dart';
 import 'tree/tree.dart';
-
 import 'util/util.dart' show
     Link,
     LinkBuilder;
@@ -337,7 +340,7 @@
     Uri resourceUri = library.entryCompilationUnit.script.resourceUri;
     libraryResourceUriMap[resourceUri] = library;
 
-    String name = library.getLibraryOrScriptName();
+    String name = library.libraryOrScriptName;
     libraryNames[name] = library;
   }
 
@@ -349,7 +352,7 @@
       currentHandler = new LibraryDependencyHandler(this);
       return createLibrary(currentHandler, null, resolvedUri)
           .then((LibraryElement library) {
-        return compiler.withCurrentElement(library, () {
+        return reporter.withCurrentElement(library, () {
           return measure(() {
             currentHandler.computeExports();
             LoadedLibraries loadedLibraries =
@@ -374,23 +377,54 @@
     TagState tagState = new TagState();
 
     bool importsDartCore = false;
-    var libraryDependencies = new LinkBuilder<LibraryDependency>();
+    LinkBuilder<LibraryDependencyElementX> libraryDependencies =
+        new LinkBuilder<LibraryDependencyElementX>();
     Uri base = library.entryCompilationUnit.script.readableUri;
 
     return Future.forEach(library.tags, (LibraryTag tag) {
-      return compiler.withCurrentElement(library, () {
+      return reporter.withCurrentElement(library, () {
+
+        Uri computeUri(LibraryDependency node) {
+          String tagUriString = node.uri.dartString.slowToString();
+          try {
+            return Uri.parse(tagUriString);
+          } on FormatException {
+            reporter.reportErrorMessage(
+                node.uri,
+                MessageKind.INVALID_URI, {'uri': tagUriString});
+            return null;
+          }
+        }
+
         if (tag.isImport) {
-          Import import = tag;
-          tagState.checkTag(TagState.IMPORT_OR_EXPORT, import, compiler);
-          if (import.uri.dartString.slowToString() == 'dart:core') {
+          Uri uri = computeUri(tag);
+          if (uri == null) {
+            // Skip this erroneous import.
+            return new Future.value();
+          }
+          // TODO(johnniwinther): Create imports during parsing.
+          ImportElementX import =
+              new ImportElementX(library.entryCompilationUnit, tag, uri);
+          tagState.checkTag(TagState.IMPORT_OR_EXPORT, import.node, reporter);
+          if (import.uri == Uris.dart_core) {
             importsDartCore = true;
           }
+          library.addImportDeclaration(import);
           libraryDependencies.addLast(import);
         } else if (tag.isExport) {
-          tagState.checkTag(TagState.IMPORT_OR_EXPORT, tag, compiler);
-          libraryDependencies.addLast(tag);
+          Uri uri = computeUri(tag);
+          if (uri == null) {
+            // Skip this erroneous export.
+            return new Future.value();
+          }
+          // TODO(johnniwinther): Create exports during parsing.
+          ExportElementX export =
+              new ExportElementX(library.entryCompilationUnit, tag, uri);
+          tagState.checkTag(TagState.IMPORT_OR_EXPORT, export.node, reporter);
+          library.addExportDeclaration(export);
+          libraryDependencies.addLast(export);
         } else if (tag.isLibraryName) {
-          tagState.checkTag(TagState.LIBRARY, tag, compiler);
+          tagState.checkTag(TagState.LIBRARY, tag, reporter);
           if (library.libraryTag == null) {
             // Use the first if there are multiple (which is reported as an
             // error in [TagState.checkTag]).
@@ -400,30 +434,35 @@
           Part part = tag;
           StringNode uri = part.uri;
           Uri resolvedUri = base.resolve(uri.dartString.slowToString());
-          tagState.checkTag(TagState.PART, part, compiler);
+          tagState.checkTag(TagState.PART, part, reporter);
           return scanPart(part, resolvedUri, library);
         } else {
-          compiler.internalError(tag, "Unhandled library tag.");
+          reporter.internalError(tag, "Unhandled library tag.");
         }
       });
     }).then((_) {
       return compiler.onLibraryScanned(library, handler);
     }).then((_) {
-      return compiler.withCurrentElement(library, () {
+      return reporter.withCurrentElement(library, () {
         checkDuplicatedLibraryName(library);
 
         // Import dart:core if not already imported.
-        if (!importsDartCore && library.canonicalUri != Compiler.DART_CORE) {
-          return createLibrary(handler, null, Compiler.DART_CORE)
+        if (!importsDartCore && library.canonicalUri != Uris.dart_core) {
+          return createLibrary(handler, null, Uris.dart_core)
               .then((LibraryElement coreLibrary) {
-            handler.registerDependency(library, null, coreLibrary);
+            handler.registerDependency(library,
+                new SyntheticImportElement(
+                    library.entryCompilationUnit, Uris.dart_core),
+                coreLibrary);
           });
         }
       });
     }).then((_) {
-      return Future.forEach(libraryDependencies.toList(), (tag) {
-        return compiler.withCurrentElement(library, () {
-          return registerLibraryFromTag(handler, library, tag);
+      return Future.forEach(libraryDependencies.toList(),
+          (LibraryDependencyElementX libraryDependency) {
+        return reporter.withCurrentElement(library, () {
+          return registerLibraryFromImportExport(
+              handler, library, libraryDependency);
         });
       });
     });
@@ -432,37 +471,40 @@
   void checkDuplicatedLibraryName(LibraryElement library) {
     if (library.isInternalLibrary) return;
     Uri resourceUri = library.entryCompilationUnit.script.resourceUri;
-    LibraryName tag = library.libraryTag;
     LibraryElement existing =
         libraryResourceUriMap.putIfAbsent(resourceUri, () => library);
     if (!identical(existing, library)) {
-      if (tag != null) {
-        compiler.withCurrentElement(library, () {
-          compiler.reportWarning(tag.name,
+      if (library.hasLibraryName) {
+        reporter.withCurrentElement(library, () {
+          reporter.reportWarningMessage(
+              library,
               MessageKind.DUPLICATED_LIBRARY_RESOURCE,
-              {'libraryName': tag.name,
+              {'libraryName': library.libraryName,
                'resourceUri': resourceUri,
                'canonicalUri1': library.canonicalUri,
                'canonicalUri2': existing.canonicalUri});
         });
       } else {
-        compiler.reportHint(library,
+        reporter.reportHintMessage(
+            library,
             MessageKind.DUPLICATED_RESOURCE,
             {'resourceUri': resourceUri,
              'canonicalUri1': library.canonicalUri,
              'canonicalUri2': existing.canonicalUri});
       }
-    } else if (tag != null) {
-      String name = library.getLibraryOrScriptName();
+    } else if (library.hasLibraryName) {
+      String name = library.libraryOrScriptName;
       existing = libraryNames.putIfAbsent(name, () => library);
       if (!identical(existing, library)) {
-        compiler.withCurrentElement(library, () {
-          compiler.reportWarning(tag.name,
+        reporter.withCurrentElement(library, () {
+          reporter.reportWarningMessage(
+              library,
               MessageKind.DUPLICATED_LIBRARY_NAME,
               {'libraryName': name});
         });
-        compiler.withCurrentElement(existing, () {
-          compiler.reportWarning(existing.libraryTag.name,
+        reporter.withCurrentElement(existing, () {
+          reporter.reportWarningMessage(
+              existing,
               MessageKind.DUPLICATED_LIBRARY_NAME,
               {'libraryName': name});
         });
@@ -478,17 +520,18 @@
     if (!resolvedUri.isAbsolute) throw new ArgumentError(resolvedUri);
     Uri readableUri = compiler.translateResolvedUri(library, resolvedUri, part);
     if (readableUri == null) return new Future.value();
-    return compiler.withCurrentElement(library, () {
+    return reporter.withCurrentElement(library, () {
       return compiler.readScript(part, readableUri).
           then((Script sourceScript) {
             if (sourceScript == null) return;
 
             CompilationUnitElementX unit =
                 new CompilationUnitElementX(sourceScript, library);
-            compiler.withCurrentElement(unit, () {
+            reporter.withCurrentElement(unit, () {
               compiler.scanner.scan(unit);
               if (unit.partTag == null && !sourceScript.isSynthesized) {
-                compiler.reportError(unit, MessageKind.MISSING_PART_OF_TAG);
+                reporter.reportErrorMessage(
+                    unit, MessageKind.MISSING_PART_OF_TAG);
               }
             });
           });
@@ -501,25 +544,19 @@
    * export scope. If the tag does not contain a valid URI, then its dependency
    * is not registered in [handler].
    */
-  Future<Null> registerLibraryFromTag(LibraryDependencyHandler handler,
-                                      LibraryElement library,
-                                      LibraryDependency tag) {
+  Future<Null> registerLibraryFromImportExport(
+      LibraryDependencyHandler handler,
+      LibraryElement library,
+      LibraryDependencyElementX libraryDependency) {
     Uri base = library.canonicalUri;
-    String tagUriString = tag.uri.dartString.slowToString();
-    Uri resolvedUri;
-    try {
-      resolvedUri = base.resolve(tagUriString);
-    } on FormatException {
-      compiler.reportError(
-          tag.uri, MessageKind.INVALID_URI, {'uri': tagUriString});
-      // 'reportError' does not stop necessarily stop compilation
-      return new Future.value();
-    }
-    return createLibrary(handler, library, resolvedUri, tag.uri)
+    Uri resolvedUri = base.resolveUri(libraryDependency.uri);
+    return createLibrary(handler, library, resolvedUri, libraryDependency)
         .then((LibraryElement loadedLibrary) {
           if (loadedLibrary == null) return;
-          compiler.withCurrentElement(library, () {
-            handler.registerDependency(library, tag, loadedLibrary);
+          reporter.withCurrentElement(library, () {
+            libraryDependency.libraryDependency = loadedLibrary;
+            handler.registerDependency(
+                library, libraryDependency, loadedLibrary);
           });
         });
   }
@@ -534,10 +571,13 @@
     compiler.onLibraryCreated(library);
     libraryCanonicalUriMap[library.canonicalUri] = library;
     return compiler.onLibraryScanned(library, handler).then((_) {
-      return Future.forEach(library.tags, (LibraryTag tag) {
-        LibraryElement dependency = library.getLibraryFromTag(tag);
-        return createLibrary(handler, library, dependency.canonicalUri);
-      }).then((_) => library);
+      return Future.forEach(library.imports, (ImportElement import) {
+        return createLibrary(handler, library, import.uri);
+      }).then((_) {
+        return Future.forEach(library.exports, (ExportElement export) {
+          return createLibrary(handler, library, export.uri);
+        }).then((_) => library);
+      });
     });
   }
 
@@ -550,7 +590,7 @@
   Future<LibraryElement> createLibrary(LibraryDependencyHandler handler,
                                        LibraryElement importingLibrary,
                                        Uri resolvedUri,
-                                       [Node node]) {
+                                       [Spannable node]) {
     Uri readableUri =
         compiler.translateResolvedUri(importingLibrary, resolvedUri, node);
     LibraryElement library = libraryCanonicalUriMap[resolvedUri];
@@ -566,13 +606,13 @@
       readableUri = resolvedUri;
       readScript = compiler.synthesizeScript;
     }
-    return compiler.withCurrentElement(importingLibrary, () {
+    return reporter.withCurrentElement(importingLibrary, () {
       return readScript(node, readableUri).then((Script script) {
         if (script == null) return null;
         LibraryElement element =
             createLibrarySync(handler, script, resolvedUri);
         return processLibraryTags(handler, element).then((_) {
-          compiler.withCurrentElement(element, () {
+          reporter.withCurrentElement(element, () {
             handler.registerLibraryExports(element);
           });
           return element;
@@ -586,7 +626,7 @@
       Script script,
       Uri resolvedUri) {
     LibraryElement element = new LibraryElementX(script, resolvedUri);
-    return compiler.withCurrentElement(element, () {
+    return reporter.withCurrentElement(element, () {
       if (handler != null) {
         handler.registerNewLibrary(element);
         libraryCanonicalUriMap[resolvedUri] = element;
@@ -633,7 +673,7 @@
 
   /// If [value] is less than [tagState] complain. Regardless, update
   /// [tagState] using transition function for state machine.
-  void checkTag(int value, LibraryTag tag, DiagnosticListener listener) {
+  void checkTag(int value, LibraryTag tag, DiagnosticReporter reporter) {
     if (tagState > value) {
       MessageKind kind;
       switch (value) {
@@ -651,14 +691,14 @@
           } else if (tag.isExport) {
             kind = MessageKind.EXPORT_BEFORE_PARTS;
           } else {
-            listener.internalError(tag, "Expected import or export.");
+            reporter.internalError(tag, "Expected import or export.");
           }
           break;
 
         default:
-          listener.internalError(tag, "Unexpected order of library tags.");
+          reporter.internalError(tag, "Unexpected order of library tags.");
       }
-      listener.reportError(tag, kind);
+      reporter.reportErrorMessage(tag, kind);
     }
     tagState = NEXT[value];
     if (value == LIBRARY) {
@@ -671,7 +711,7 @@
  * An [import] tag and the [importedLibrary] imported through [import].
  */
 class ImportLink {
-  final Import import;
+  final ImportElementX import;
   final LibraryElement importedLibrary;
 
   ImportLink(this.import, this.importedLibrary);
@@ -679,40 +719,43 @@
   /**
    * Imports the library into the [importingLibrary].
    */
-  void importLibrary(Compiler compiler, LibraryElementX importingLibrary) {
+  void importLibrary(DiagnosticReporter reporter,
+                     LibraryElementX importingLibrary) {
     assert(invariant(importingLibrary,
                      importedLibrary.exportsHandled,
                      message: 'Exports not handled on $importedLibrary'));
-    var combinatorFilter = new CombinatorFilter.fromTag(import);
-    if (import != null && import.prefix != null) {
-      String prefix = import.prefix.source;
+    Import tag = import.node;
+    CombinatorFilter combinatorFilter =
+        new CombinatorFilter.fromTag(tag);
+    if (tag != null && tag.prefix != null) {
+      String prefix = tag.prefix.source;
       Element existingElement = importingLibrary.find(prefix);
-      PrefixElement prefixElement;
+      PrefixElementX prefixElement;
       if (existingElement == null || !existingElement.isPrefix) {
-        prefixElement = new PrefixElementX(prefix,
-            importingLibrary.entryCompilationUnit, import.getBeginToken());
+        prefixElement = new PrefixElementX(
+            prefix,
+            importingLibrary.entryCompilationUnit,
+            tag.getBeginToken(),
+            tag.isDeferred ? import : null);
       } else {
         prefixElement = existingElement;
       }
-      importingLibrary.addToScope(prefixElement, compiler);
+      importingLibrary.addToScope(prefixElement, reporter);
       importedLibrary.forEachExport((Element element) {
         if (combinatorFilter.exclude(element)) return;
-        prefixElement.addImport(element, import, compiler);
+        prefixElement.addImport(element, import, reporter);
       });
-      if (import.isDeferred) {
+      import.prefix = prefixElement;
+      if (prefixElement.isDeferred) {
         prefixElement.addImport(
             new DeferredLoaderGetterElementX(prefixElement),
-            import, compiler);
-        // TODO(sigurdm): When we remove support for the annotation based
-        // syntax the [PrefixElement] constructor should receive this
-        // information.
-        prefixElement.markAsDeferred(import);
+            import, reporter);
       }
     } else {
       importedLibrary.forEachExport((Element element) {
-        compiler.withCurrentElement(importingLibrary, () {
+        reporter.withCurrentElement(importingLibrary, () {
           if (combinatorFilter.exclude(element)) return;
-          importingLibrary.addImport(element, import, compiler);
+          importingLibrary.addImport(element, import, reporter);
         });
       });
     }
@@ -725,13 +768,13 @@
  * the library dependency graph.
  */
 class ExportLink {
-  final Export export;
+  final ExportElementX export;
   final CombinatorFilter combinatorFilter;
   final LibraryDependencyNode exportNode;
 
-  ExportLink(Export export, LibraryDependencyNode this.exportNode)
+  ExportLink(ExportElementX export, LibraryDependencyNode this.exportNode)
       : this.export = export,
-        this.combinatorFilter = new CombinatorFilter.fromTag(export);
+        this.combinatorFilter = new CombinatorFilter.fromTag(export.node);
 
   /**
    * Exports [element] to the dependent library unless [element] is filtered by
@@ -780,11 +823,11 @@
    * The export scope for [library] which is gradually computed by the work-list
    * computation in [LibraryDependencyHandler.computeExports].
    */
-  Map<String, Element> exportScope =
-      new Map<String, Element>();
+  Map<String, Element> exportScope = <String, Element>{};
 
   /// Map from exported elements to the export directives that exported them.
-  Map<Element, Link<Export>> exporters = new Map<Element, Link<Export>>();
+  Map<Element, Link<ExportElement>> exporters =
+      <Element, Link<ExportElement>>{};
 
   /**
    * The set of exported elements that need to be propageted to dependent
@@ -792,8 +835,8 @@
    * [LibraryDependencyHandler.computeExports]. Each export element is mapped
    * to a list of exports directives that export it.
    */
-  Map<Element, Link<Export>> pendingExportMap =
-      new Map<Element, Link<Export>>();
+  Map<Element, Link<ExportElement>> pendingExportMap =
+      <Element, Link<ExportElement>>{};
 
   LibraryDependencyNode(this.library);
 
@@ -801,7 +844,7 @@
    * Registers that the library of this node imports [importLibrary] through the
    * [import] tag.
    */
-  void registerImportDependency(Import import,
+  void registerImportDependency(ImportElementX import,
                                 LibraryElement importedLibrary) {
     imports = imports.prepend(new ImportLink(import, importedLibrary));
   }
@@ -810,7 +853,7 @@
    * Registers that the library of this node is exported by
    * [exportingLibraryNode] through the [export] tag.
    */
-  void registerExportDependency(Export export,
+  void registerExportDependency(ExportElementX export,
                                 LibraryDependencyNode exportingLibraryNode) {
     // Register the exported library in the exporting library node.
     exportingLibraryNode.exports =
@@ -827,21 +870,33 @@
    */
   void registerInitialExports() {
     for (Element element in library.getNonPrivateElementsInScope()) {
-      pendingExportMap[element] = const Link<Export>();
+      pendingExportMap[element] = const Link<ExportElement>();
     }
   }
 
-  void registerHandledExports(LibraryElement exportedLibraryElement,
-                              Export export,
+  /// Register the already computed export scope of [exportedLibraryElement] to
+  /// export from the library of this node through the [export]  declaration
+  /// with the given combination [filter].
+  ///
+  /// Additionally, check that all names in the show/hide combinators are in the
+  /// export scope of [exportedLibraryElement].
+  void registerHandledExports(DiagnosticReporter reporter,
+                              LibraryElement exportedLibraryElement,
+                              ExportElementX export,
                               CombinatorFilter filter) {
     assert(invariant(library, exportedLibraryElement.exportsHandled));
-    for (Element exportedElement in exportedLibraryElement.exports) {
+    exportedLibraryElement.forEachExport((Element exportedElement) {
       if (!filter.exclude(exportedElement)) {
-        Link<Export> exports =
+        Link<ExportElement> exports =
             pendingExportMap.putIfAbsent(exportedElement,
-                                         () => const Link<Export>());
+                                         () => const Link<ExportElement>());
         pendingExportMap[exportedElement] = exports.prepend(export);
       }
+    });
+    if (!reporter.options.suppressHints) {
+      reporter.withCurrentElement(library, () {
+        checkLibraryDependency(reporter, export.node, exportedLibraryElement);
+      });
     }
   }
 
@@ -855,18 +910,18 @@
   /**
    * Registers the imports of the node library.
    */
-  void registerImports(Compiler compiler) {
+  void registerImports(DiagnosticReporter reporter) {
     for (ImportLink link in imports) {
-      link.importLibrary(compiler, library);
+      link.importLibrary(reporter, library);
     }
   }
 
   /**
    * Copies and clears pending export set for this node.
    */
-  Map<Element, Link<Export>> pullPendingExports() {
-    Map<Element, Link<Export>> pendingExports =
-        new Map<Element, Link<Export>>.from(pendingExportMap);
+  Map<Element, Link<ExportElement>> pullPendingExports() {
+    Map<Element, Link<ExportElement>> pendingExports =
+        new Map<Element, Link<ExportElement>>.from(pendingExportMap);
     pendingExportMap.clear();
     return pendingExports;
   }
@@ -875,44 +930,54 @@
    * Adds [element] to the export scope for this node. If the [element] name
    * is a duplicate, an error element is inserted into the export scope.
    */
-  Element addElementToExportScope(Compiler compiler, Element element,
-                                  Link<Export> exports) {
+  Element addElementToExportScope(
+      DiagnosticReporter reporter,
+      Element element,
+      Link<ExportElement> exports) {
     String name = element.name;
+    DiagnosticMessage error;
+    List<DiagnosticMessage> infos = <DiagnosticMessage>[];
 
-    void reportDuplicateExport(Element duplicate,
-                               Link<Export> duplicateExports,
-                               {bool reportError: true}) {
+    void createDuplicateExportMessage(
+        Element duplicate,
+        Link<ExportElement> duplicateExports) {
       assert(invariant(library, !duplicateExports.isEmpty,
           message: "No export for $duplicate from ${duplicate.library} "
                    "in $library."));
-      compiler.withCurrentElement(library, () {
-        for (Export export in duplicateExports) {
-          if (reportError) {
-            compiler.reportError(export,
-                MessageKind.DUPLICATE_EXPORT, {'name': name});
-            reportError = false;
+      reporter.withCurrentElement(library, () {
+        for (ExportElement export in duplicateExports) {
+          if (error == null) {
+            error = reporter.createMessage(
+                export,
+                MessageKind.DUPLICATE_EXPORT,
+                {'name': name});
           } else {
-            compiler.reportInfo(export,
-                MessageKind.DUPLICATE_EXPORT_CONT, {'name': name});
+            infos.add(reporter.createMessage(
+                export,
+                MessageKind.DUPLICATE_EXPORT_CONT,
+                {'name': name}));
           }
         }
       });
     }
 
-    void reportDuplicateExportDecl(Element duplicate,
-                                   Link<Export> duplicateExports) {
+    void createDuplicateExportDeclMessage(
+        Element duplicate,
+        Link<ExportElement> duplicateExports) {
       assert(invariant(library, !duplicateExports.isEmpty,
           message: "No export for $duplicate from ${duplicate.library} "
                    "in $library."));
-      compiler.reportInfo(duplicate, MessageKind.DUPLICATE_EXPORT_DECL,
-          {'name': name, 'uriString': duplicateExports.head.uri});
+      infos.add(reporter.createMessage(
+          duplicate,
+              MessageKind.DUPLICATE_EXPORT_DECL,
+          {'name': name, 'uriString': duplicateExports.head.uri}));
     }
 
     Element existingElement = exportScope[name];
     if (existingElement != null && existingElement != element) {
       if (existingElement.isErroneous) {
-        reportDuplicateExport(element, exports);
-        reportDuplicateExportDecl(element, exports);
+        createDuplicateExportMessage(element, exports);
+        createDuplicateExportDeclMessage(element, exports);
         element = existingElement;
       } else if (existingElement.library == library) {
         // Do nothing. [existingElement] hides [element].
@@ -922,11 +987,11 @@
         exporters[element] = exports;
       } else {
         // Declared elements hide exported elements.
-        Link<Export> existingExports = exporters[existingElement];
-        reportDuplicateExport(existingElement, existingExports);
-        reportDuplicateExport(element, exports, reportError: false);
-        reportDuplicateExportDecl(existingElement, existingExports);
-        reportDuplicateExportDecl(element, exports);
+        Link<ExportElement> existingExports = exporters[existingElement];
+        createDuplicateExportMessage(existingElement, existingExports);
+        createDuplicateExportMessage(element, exports);
+        createDuplicateExportDeclMessage(existingElement, existingExports);
+        createDuplicateExportDeclMessage(element, exports);
         element = exportScope[name] = new ErroneousElementX(
             MessageKind.DUPLICATE_EXPORT, {'name': name}, name, library);
       }
@@ -934,6 +999,9 @@
       exportScope[name] = element;
       exporters[element] = exports;
     }
+    if (error != null) {
+      reporter.reportError(error, infos);
+    }
     return element;
   }
 
@@ -957,17 +1025,71 @@
    * the pending export set was modified. The combinators of [export] are used
    * to filter the element.
    */
-  bool addElementToPendingExports(Element element, Export export) {
+  bool addElementToPendingExports(Element element, ExportElement export) {
     bool changed = false;
     if (!identical(exportScope[element.name], element)) {
-      Link<Export> exports = pendingExportMap.putIfAbsent(element, () {
+      Link<ExportElement> exports = pendingExportMap.putIfAbsent(element, () {
         changed = true;
-        return const Link<Export>();
+        return const Link<ExportElement>();
       });
       pendingExportMap[element] = exports.prepend(export);
     }
     return changed;
   }
+
+  /// Check that all names in the show/hide combinators of imports and exports
+  /// are in the export scope of the imported/exported libraries.
+  void checkCombinators(DiagnosticReporter reporter) {
+    reporter.withCurrentElement(library, () {
+      for (ImportLink importLink in imports) {
+        checkLibraryDependency(
+            reporter, importLink.import.node, importLink.importedLibrary);
+      }
+    });
+    for (ExportLink exportLink in dependencies) {
+      reporter.withCurrentElement(exportLink.exportNode.library, () {
+        checkLibraryDependency(reporter, exportLink.export.node, library);
+      });
+    }
+  }
+
+  /// Check that all names in the show/hide combinators of [tag] are in the
+  /// export scope of [library].
+  void checkLibraryDependency(
+      DiagnosticReporter reporter,
+      LibraryDependency tag,
+      LibraryElement library) {
+    if (tag == null || tag.combinators == null) return;
+    for (Combinator combinator in tag.combinators) {
+      for (Identifier identifier in combinator.identifiers) {
+        String name = identifier.source;
+        Element element = library.findExported(name);
+        if (element == null) {
+          if (combinator.isHide) {
+            if (library.isPackageLibrary &&
+                !reporter.options.showPackageWarnings) {
+              // Only report hide hint on packages if we show warnings on these:
+              // The hide may be non-empty in some versions of the package, in
+              // which case you shouldn't remove the combinator.
+              continue;
+            }
+            reporter.reportHintMessage(
+                identifier,
+                MessageKind.EMPTY_HIDE,
+                {'uri': library.canonicalUri,
+                 'name': name});
+          } else {
+            reporter.reportHintMessage(
+                identifier,
+                MessageKind.EMPTY_SHOW,
+                {'uri': library.canonicalUri,
+                 'name': name});
+          }
+        }
+      }
+    }
+  }
+
 }
 
 /**
@@ -994,6 +1116,8 @@
 
   Compiler get compiler => task.compiler;
 
+  DiagnosticReporter get reporter => task.reporter;
+
   /// The libraries loaded with this handler.
   Iterable<LibraryElement> get loadedLibraries => nodeMap.keys;
 
@@ -1006,8 +1130,8 @@
     bool changed = true;
     while (changed) {
       changed = false;
-      Map<LibraryDependencyNode, Map<Element, Link<Export>>> tasks =
-          new Map<LibraryDependencyNode, Map<Element, Link<Export>>>();
+      Map<LibraryDependencyNode, Map<Element, Link<ExportElement>>> tasks =
+          new Map<LibraryDependencyNode, Map<Element, Link<ExportElement>>>();
 
       // Locally defined elements take precedence over exported
       // elements.  So we must propagate local elements first.  We
@@ -1015,13 +1139,14 @@
       // propagating.  This enforces that we handle exports
       // breadth-first, with locally defined elements being level 0.
       nodeMap.forEach((_, LibraryDependencyNode node) {
-        Map<Element, Link<Export>> pendingExports = node.pullPendingExports();
+        Map<Element, Link<ExportElement>> pendingExports =
+            node.pullPendingExports();
         tasks[node] = pendingExports;
       });
       tasks.forEach((LibraryDependencyNode node,
-                     Map<Element, Link<Export>> pendingExports) {
-        pendingExports.forEach((Element element, Link<Export> exports) {
-          element = node.addElementToExportScope(compiler, element, exports);
+                     Map<Element, Link<ExportElement>> pendingExports) {
+        pendingExports.forEach((Element element, Link<ExportElement> exports) {
+          element = node.addElementToExportScope(reporter, element, exports);
           if (node.propagateElement(element)) {
             changed = true;
           }
@@ -1038,27 +1163,30 @@
 
     // Setup import scopes.
     nodeMap.forEach((LibraryElement library, LibraryDependencyNode node) {
-      node.registerImports(compiler);
+      node.registerImports(reporter);
     });
+
+    if (!reporter.options.suppressHints) {
+      nodeMap.forEach((LibraryElement library, LibraryDependencyNode node) {
+        node.checkCombinators(reporter);
+      });
+    }
   }
 
-  /**
-   * Registers that [library] depends on [loadedLibrary] through [tag].
-   */
+  /// Registers that [library] depends on [loadedLibrary] through
+  /// [libraryDependency].
   void registerDependency(LibraryElementX library,
-                          LibraryDependency tag,
+                          LibraryDependencyElementX libraryDependency,
                           LibraryElement loadedLibrary) {
-    if (tag != null) {
-      library.recordResolvedTag(tag, loadedLibrary);
-    }
-    if (tag is Export) {
+    if (libraryDependency.isExport) {
       // [loadedLibrary] is exported by [library].
       LibraryDependencyNode exportingNode = nodeMap[library];
       if (loadedLibrary.exportsHandled) {
         // Export scope already computed on [loadedLibrary].
-        var combinatorFilter = new CombinatorFilter.fromTag(tag);
+        CombinatorFilter combinatorFilter =
+            new CombinatorFilter.fromTag(libraryDependency.node);
         exportingNode.registerHandledExports(
-            loadedLibrary, tag, combinatorFilter);
+            reporter, loadedLibrary, libraryDependency, combinatorFilter);
         return;
       }
       LibraryDependencyNode exportedNode = nodeMap[loadedLibrary];
@@ -1066,13 +1194,13 @@
           message: "$loadedLibrary has not been registered"));
       assert(invariant(library, exportingNode != null,
           message: "$library has not been registered"));
-      exportedNode.registerExportDependency(tag, exportingNode);
-    } else if (tag == null || tag is Import) {
+      exportedNode.registerExportDependency(libraryDependency, exportingNode);
+    } else if (libraryDependency == null || libraryDependency.isImport) {
       // [loadedLibrary] is imported by [library].
       LibraryDependencyNode importingNode = nodeMap[library];
       assert(invariant(library, importingNode != null,
           message: "$library has not been registered"));
-      importingNode.registerImportDependency(tag, loadedLibrary);
+      importingNode.registerImportDependency(libraryDependency, loadedLibrary);
     }
   }
 
diff --git a/pkg/compiler/lib/src/mirror_renamer/mirror_renamer.dart b/pkg/compiler/lib/src/mirror_renamer/mirror_renamer.dart
index 7f89b3c..d157b74 100644
--- a/pkg/compiler/lib/src/mirror_renamer/mirror_renamer.dart
+++ b/pkg/compiler/lib/src/mirror_renamer/mirror_renamer.dart
@@ -4,12 +4,15 @@
 
 library mirror_renamer;
 
-import '../dart2jslib.dart' show Script, Compiler;
-import '../tree/tree.dart';
-import '../scanner/scannerlib.dart' show Token;
+import '../compiler.dart' show
+    Compiler;
+import '../dart_backend/dart_backend.dart' show
+    DartBackend,
+    PlaceholderCollector;
 import '../elements/elements.dart';
-import '../dart_backend/dart_backend.dart' show DartBackend,
-                                                PlaceholderCollector;
+import '../tokens/token.dart' show
+    Token;
+import '../tree/tree.dart';
 
 part 'renamer.dart';
 
diff --git a/pkg/compiler/lib/src/mirrors/analyze.dart b/pkg/compiler/lib/src/mirrors/analyze.dart
index 96dc594..733cbae 100644
--- a/pkg/compiler/lib/src/mirrors/analyze.dart
+++ b/pkg/compiler/lib/src/mirrors/analyze.dart
@@ -10,7 +10,7 @@
 import 'dart2js_mirrors.dart' show Dart2JsMirrorSystem;
 import '../../compiler.dart' as api;
 import '../apiimpl.dart' as apiimpl;
-import '../dart2jslib.dart' show Compiler;
+import '../compiler.dart' show Compiler;
 import '../old_to_new_api.dart';
 
 //------------------------------------------------------------------------------
diff --git a/pkg/compiler/lib/src/mirrors/dart2js_instance_mirrors.dart b/pkg/compiler/lib/src/mirrors/dart2js_instance_mirrors.dart
index 9a2cbe2..55d8789 100644
--- a/pkg/compiler/lib/src/mirrors/dart2js_instance_mirrors.dart
+++ b/pkg/compiler/lib/src/mirrors/dart2js_instance_mirrors.dart
@@ -56,7 +56,7 @@
   } else if (value.isConstructedObject) {
     return new Dart2JsConstructedConstantMirror(mirrorSystem, constant, value);
   }
-  mirrorSystem.compiler.internalError(NO_LOCATION_SPANNABLE,
+  mirrorSystem.compiler.reporter.internalError(NO_LOCATION_SPANNABLE,
       "Unexpected constant value $value");
   return null;
 }
diff --git a/pkg/compiler/lib/src/mirrors/dart2js_library_mirror.dart b/pkg/compiler/lib/src/mirrors/dart2js_library_mirror.dart
index 38925b5..feaf549 100644
--- a/pkg/compiler/lib/src/mirrors/dart2js_library_mirror.dart
+++ b/pkg/compiler/lib/src/mirrors/dart2js_library_mirror.dart
@@ -4,7 +4,6 @@
 
 part of dart2js.mirrors;
 
-
 class Dart2JsLibraryMirror
     extends Dart2JsElementMirror
     with ObjectMirrorMixin, ContainerMixin
@@ -18,7 +17,8 @@
     throw new UnsupportedError('LibraryMirror.operator [] unsupported.');
   }
 
-  LibraryElement get _element => super._element;
+  // TODO(johnniwinther): Avoid the need for [LibraryElementX].
+  LibraryElementX get _element => super._element;
 
   Uri get uri => _element.canonicalUri;
 
@@ -33,7 +33,7 @@
    * file name (for scripts without a library tag). The latter case is used to
    * provide a 'library name' for scripts, to use for instance in dartdoc.
    */
-  String get _simpleNameString => _element.getLibraryOrScriptName();
+  String get _simpleNameString => _element.libraryOrScriptName;
 
   Symbol get qualifiedName => simpleName;
 
@@ -75,17 +75,33 @@
 
   void _ensureLibraryDependenciesAnalyzed() {
     if (_libraryDependencies == null) {
+      // TODO(johnniwinther): Support order of declarations on [LibraryElement].
+      Map<LibraryDependency, Dart2JsLibraryDependencyMirror> mirrorMap =
+          <LibraryDependency, Dart2JsLibraryDependencyMirror>{};
+
+      void addLibraryDependency(LibraryDependency libraryDependency,
+                                LibraryElement targetLibraryElement) {
+        assert(targetLibraryElement != null);
+        LibraryMirror targetLibrary =
+            mirrorSystem._getLibrary(targetLibraryElement);
+        mirrorMap[libraryDependency] = new Dart2JsLibraryDependencyMirror(
+            libraryDependency, this, targetLibrary);
+      }
+      for (ImportElement import in _element.imports) {
+        addLibraryDependency(import.node, import.importedLibrary);
+      }
+      for (ExportElement export in _element.exports) {
+        addLibraryDependency(export.node, export.exportedLibrary);
+      }
+
       _libraryDependencies = <LibraryDependencySourceMirror>[];
+
       for (LibraryTag node in _element.tags) {
         LibraryDependency libraryDependency = node.asLibraryDependency();
         if (libraryDependency != null) {
-          LibraryElement targetLibraryElement =
-              _element.getLibraryFromTag(libraryDependency);
-          assert(targetLibraryElement != null);
-          LibraryMirror targetLibrary =
-              mirrorSystem._getLibrary(targetLibraryElement);
-          _libraryDependencies.add(new Dart2JsLibraryDependencyMirror(
-              libraryDependency, this, targetLibrary));
+          Dart2JsLibraryDependencyMirror mirror = mirrorMap[libraryDependency];
+          assert(mirror != null);
+          _libraryDependencies.add(mirror);
         }
       }
     }
@@ -110,7 +126,7 @@
   SourceLocation get location {
     return new Dart2JsSourceLocation(
       _sourceLibrary._element.entryCompilationUnit.script,
-      _sourceLibrary.mirrorSystem.compiler.spanFromNode(_node));
+      _sourceLibrary.mirrorSystem.compiler.reporter.spanFromSpannable(_node));
   }
 
   List<CombinatorMirror> get combinators {
diff --git a/pkg/compiler/lib/src/mirrors/dart2js_mirrors.dart b/pkg/compiler/lib/src/mirrors/dart2js_mirrors.dart
index 5bf4b1e..0e64cc3 100644
--- a/pkg/compiler/lib/src/mirrors/dart2js_mirrors.dart
+++ b/pkg/compiler/lib/src/mirrors/dart2js_mirrors.dart
@@ -6,13 +6,20 @@
 
 import 'dart:collection' show UnmodifiableListView, UnmodifiableMapView;
 
+import '../common.dart';
+import '../compiler.dart' show
+    Compiler;
 import '../constants/expressions.dart';
 import '../constants/values.dart';
-import '../elements/elements.dart';
-import '../scanner/scannerlib.dart';
-import '../resolution/resolution.dart' show Scope;
-import '../dart2jslib.dart';
 import '../dart_types.dart';
+import '../elements/elements.dart';
+import '../elements/modelx.dart' show
+    LibraryElementX;
+import '../resolution/scope.dart' show
+    Scope;
+import '../script.dart';
+import '../tokens/token.dart';
+import '../tokens/token_constants.dart' as Tokens;
 import '../tree/tree.dart';
 import '../util/util.dart'
     show Link,
@@ -123,7 +130,7 @@
       }
       return members;
     }
-    mirrorSystem.compiler.internalError(element,
+    mirrorSystem.compiler.reporter.internalError(element,
         "Unexpected member type $element ${element.kind}.");
     return null;
   }
@@ -196,8 +203,8 @@
       span = new SourceSpan(script.resourceUri, 0, 0);
     } else {
       Token endToken = getEndToken();
-      span = mirrorSystem.compiler.spanFromTokens(
-          beginToken, endToken, script.resourceUri);
+      span = new SourceSpan.fromTokens(
+          script.resourceUri, beginToken, endToken);
     }
     return new Dart2JsSourceLocation(script, span);
   }
@@ -205,7 +212,7 @@
   String toString() => _element.toString();
 
   void _appendCommentTokens(Token commentToken) {
-    while (commentToken != null && commentToken.kind == COMMENT_TOKEN) {
+    while (commentToken != null && commentToken.kind == Tokens.COMMENT_TOKEN) {
       _metadata.add(new Dart2JsCommentInstanceMirror(
           mirrorSystem, commentToken.value));
       commentToken = commentToken.next;
@@ -218,7 +225,7 @@
       for (MetadataAnnotation metadata in _element.metadata) {
         _appendCommentTokens(
             mirrorSystem.compiler.commentMap[metadata.beginToken]);
-        metadata.ensureResolved(mirrorSystem.compiler);
+        metadata.ensureResolved(mirrorSystem.compiler.resolution);
         _metadata.add(_convertConstantToInstanceMirror(
             mirrorSystem, metadata.constant,
             mirrorSystem.compiler.constants.getConstantValue(
@@ -336,7 +343,7 @@
         return new Dart2JsTypedefMirror(this, type);
       }
     }
-    compiler.internalError(type.element,
+    compiler.reporter.internalError(type.element,
         "Unexpected type $type of kind ${type.kind}.");
     return null;
   }
@@ -347,7 +354,7 @@
     } else if (element.isTypedef) {
       return new Dart2JsTypedefDeclarationMirror(this, element.thisType);
     }
-    compiler.internalError(element, "Unexpected element $element.");
+    compiler.reporter.internalError(element, "Unexpected element $element.");
     return null;
   }
 }
diff --git a/pkg/compiler/lib/src/mirrors_used.dart b/pkg/compiler/lib/src/mirrors_used.dart
index ec535c7..1928d10 100644
--- a/pkg/compiler/lib/src/mirrors_used.dart
+++ b/pkg/compiler/lib/src/mirrors_used.dart
@@ -4,8 +4,13 @@
 
 library dart2js.mirrors_used;
 
+import 'common.dart';
+import 'common/tasks.dart' show
+    CompilerTask;
 import 'compile_time_constants.dart' show
     ConstantCompiler;
+import 'compiler.dart' show
+    Compiler;
 import 'constants/expressions.dart';
 import 'constants/values.dart' show
     ConstantValue,
@@ -13,27 +18,20 @@
     ListConstantValue,
     StringConstantValue,
     TypeConstantValue;
-
 import 'dart_types.dart' show
     DartType,
     InterfaceType,
     TypeKind;
-
-import 'dart2jslib.dart' show
-    Compiler,
-    CompilerTask,
-    MessageKind,
-    TreeElements,
-    invariant;
-
 import 'elements/elements.dart' show
     ClassElement,
     Element,
+    ImportElement,
     LibraryElement,
     MetadataAnnotation,
     ScopeContainerElement,
     VariableElement;
-
+import 'resolution/tree_elements.dart' show
+    TreeElements;
 import 'tree/tree.dart' show
     Import,
     LibraryTag,
@@ -41,10 +39,6 @@
     NewExpression,
     Node;
 
-import 'util/util.dart' show
-    Link,
-    Spannable;
-
 /**
  * Compiler task that analyzes MirrorsUsed annotations.
  *
@@ -177,6 +171,8 @@
         cachedStrings = new Map<ConstantValue, List<String>>(),
         cachedElements = new Map<ConstantValue, List<Element>>();
 
+  DiagnosticReporter get reporter => compiler.reporter;
+
   /// Collect and merge all @MirrorsUsed annotations. As a side-effect, also
   /// compute which libraries have the annotation (which is used by
   /// [MirrorUsageAnalyzerTask.hasMirrorUsage]).
@@ -203,12 +199,10 @@
         new Map<LibraryElement, List<MirrorUsage>>();
     for (LibraryElement library in compiler.libraryLoader.libraries) {
       if (library.isInternalLibrary) continue;
-      for (LibraryTag tag in library.tags) {
-        Import importTag = tag.asImport();
-        if (importTag == null) continue;
-        compiler.withCurrentElement(library, () {
+      for (ImportElement import in library.imports) {
+        reporter.withCurrentElement(library, () {
           List<MirrorUsage> usages =
-              mirrorsUsedOnLibraryTag(library, importTag);
+              mirrorsUsedOnLibraryTag(library, import);
           if (usages != null) {
             List<MirrorUsage> existing = result[library];
             if (existing != null) {
@@ -259,14 +253,14 @@
   /// Find @MirrorsUsed annotations on the given import [tag] in [library]. The
   /// annotations are represented as [MirrorUsage].
   List<MirrorUsage> mirrorsUsedOnLibraryTag(LibraryElement library,
-                                            Import tag) {
-    LibraryElement importedLibrary = library.getLibraryFromTag(tag);
+                                            ImportElement import) {
+    LibraryElement importedLibrary = import.importedLibrary;
     if (importedLibrary != compiler.mirrorsLibrary) {
       return null;
     }
     List<MirrorUsage> result = <MirrorUsage>[];
-    for (MetadataAnnotation metadata in tag.metadata) {
-      metadata.ensureResolved(compiler);
+    for (MetadataAnnotation metadata in import.metadata) {
+      metadata.ensureResolved(compiler.resolution);
       ConstantValue value =
           compiler.constants.getConstantValue(metadata.constant);
       Element element = value.getType(compiler.coreTypes).element;
@@ -387,6 +381,8 @@
 
   Compiler get compiler => analyzer.compiler;
 
+  DiagnosticReporter get reporter => analyzer.reporter;
+
   /// Convert a constant to a list of [String] and [Type] values. If the
   /// constant is a single [String], it is assumed to be a comma-separated list
   /// of qualified names. If the constant is a [Type] t, the result is [:[t]:].
@@ -414,9 +410,8 @@
           MessageKind kind = onlyStrings
               ? MessageKind.MIRRORS_EXPECTED_STRING
               : MessageKind.MIRRORS_EXPECTED_STRING_OR_TYPE;
-          compiler.reportHint(
-              node,
-              kind, {'name': node, 'type': apiTypeOf(entry)});
+          reporter.reportHintMessage(
+              node, kind, {'name': node, 'type': apiTypeOf(entry)});
         }
       }
       return result;
@@ -433,9 +428,8 @@
       MessageKind kind = onlyStrings
           ? MessageKind.MIRRORS_EXPECTED_STRING_OR_LIST
           : MessageKind.MIRRORS_EXPECTED_STRING_TYPE_OR_LIST;
-      compiler.reportHint(
-          node,
-          kind, {'name': node, 'type': apiTypeOf(constant)});
+      reporter.reportHintMessage(
+          node, kind, {'name': node, 'type': apiTypeOf(constant)});
       return null;
     }
   }
@@ -447,7 +441,7 @@
     if (type.isInterfaceType && library.isInternalLibrary) {
       InterfaceType interface = type;
       ClassElement cls = type.element;
-      cls.ensureResolved(compiler);
+      cls.ensureResolved(compiler.resolution);
       for (DartType supertype in cls.allSupertypes) {
         if (supertype.isInterfaceType
             && !supertype.element.library.isInternalLibrary) {
@@ -480,8 +474,8 @@
         LibraryElement libraryCandiate;
         String libraryNameCandiate;
         for (LibraryElement l in compiler.libraryLoader.libraries) {
-          if (l.hasLibraryName()) {
-            String libraryName = l.getLibraryOrScriptName();
+          if (l.hasLibraryName) {
+            String libraryName = l.libraryOrScriptName;
             if (string == libraryName) {
               // Found an exact match.
               libraryCandiate = l;
@@ -518,8 +512,9 @@
     List<String> identifiers = expression.split('.');
     Element element = enclosingLibrary.find(identifiers[0]);
     if (element == null) {
-      compiler.reportHint(
-          spannable, MessageKind.MIRRORS_CANNOT_RESOLVE_IN_CURRENT_LIBRARY,
+      reporter.reportHintMessage(
+          spannable,
+          MessageKind.MIRRORS_CANNOT_RESOLVE_IN_CURRENT_LIBRARY,
           {'name': expression});
       return null;
     } else {
@@ -536,12 +531,12 @@
       if (e == null) {
         if (current.isLibrary) {
           LibraryElement library = current;
-          compiler.reportHint(
+          reporter.reportHintMessage(
               spannable, MessageKind.MIRRORS_CANNOT_RESOLVE_IN_LIBRARY,
               {'name': identifiers[0],
-               'library': library.getLibraryOrScriptName()});
+               'library': library.libraryOrScriptName});
         } else {
-          compiler.reportHint(
+          reporter.reportHintMessage(
               spannable, MessageKind.MIRRORS_CANNOT_FIND_IN_ELEMENT,
               {'name': identifier, 'element': current.name});
         }
@@ -559,7 +554,7 @@
       ScopeContainerElement scope = element;
       if (element.isClass) {
         ClassElement cls = element;
-        cls.ensureResolved(compiler);
+        cls.ensureResolved(compiler.resolution);
       }
       return scope.localLookup(name);
     }
diff --git a/pkg/compiler/lib/src/native/behavior.dart b/pkg/compiler/lib/src/native/behavior.dart
index edbefd1..7dbab30 100644
--- a/pkg/compiler/lib/src/native/behavior.dart
+++ b/pkg/compiler/lib/src/native/behavior.dart
@@ -196,7 +196,7 @@
   /// latter is used for the type strings of the form '' and 'var'.
   /// [validTags] can be used to restrict which tags are accepted.
   static void processSpecString(
-      DiagnosticListener listener,
+      DiagnosticReporter reporter,
       Spannable spannable,
       String specString,
       {Iterable<String> validTags,
@@ -214,7 +214,8 @@
 
     void reportError(String message) {
       seenError = true;
-      listener.reportError(spannable, MessageKind.GENERIC, {'text': message});
+      reporter.reportErrorMessage(
+          spannable, MessageKind.GENERIC, {'text': message});
     }
 
     const List<String> knownTags = const [
@@ -423,7 +424,12 @@
     return sideEffects;
   }
 
-  static NativeBehavior ofJsCall(Send jsCall, Compiler compiler, resolver) {
+  static NativeBehavior ofJsCall(
+      Send jsCall,
+      DiagnosticReporter reporter,
+      Parsing parsing,
+      CoreTypes coreTypes,
+      ForeignResolver resolver) {
     // The first argument of a JS-call is a string encoding various attributes
     // of the code.
     //
@@ -434,21 +440,25 @@
 
     var argNodes = jsCall.arguments;
     if (argNodes.isEmpty || argNodes.tail.isEmpty) {
-      compiler.reportError(jsCall, MessageKind.GENERIC,
+      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) {
-      compiler.reportError(specArgument, MessageKind.GENERIC,
+      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) {
-      compiler.reportError(codeArgument, MessageKind.GENERIC,
+      reporter.reportErrorMessage(
+          codeArgument, MessageKind.GENERIC,
           {'text': "JS second argument must be a string literal."});
       return behavior;
     }
@@ -461,7 +471,7 @@
     dynamic resolveType(String typeString) {
       return _parseType(
           typeString,
-          compiler,
+          parsing,
           (name) => resolver.resolveTypeFromString(specArgument, name),
           specArgument);
     }
@@ -487,7 +497,9 @@
       behavior.useGvn = useGvn;
     }
 
-    processSpecString(compiler, specArgument,
+    processSpecString(
+        reporter,
+        specArgument,
         specString,
         setSideEffects: setSideEffects,
         setThrows: setThrows,
@@ -496,8 +508,8 @@
         resolveType: resolveType,
         typesReturned: behavior.typesReturned,
         typesInstantiated: behavior.typesInstantiated,
-        objectType: compiler.objectClass.computeType(compiler),
-        nullType: compiler.nullClass.computeType(compiler));
+        objectType: coreTypes.objectType,
+        nullType: coreTypes.nullType);
 
     if (!sideEffectsAreEncodedInSpecString) {
       new SideEffectsVisitor(behavior.sideEffects)
@@ -514,8 +526,10 @@
   static void _fillNativeBehaviorOfBuiltinOrEmbeddedGlobal(
       NativeBehavior behavior,
       Send jsBuiltinOrEmbeddedGlobalCall,
-      Compiler compiler,
-      ResolverVisitor resolver,
+      DiagnosticReporter reporter,
+      Parsing parsing,
+      CoreTypes coreTypes,
+      ForeignResolver resolver,
       {bool isBuiltin,
        List<String> validTags}) {
     // The first argument of a JS-embedded global call is a string encoding
@@ -528,7 +542,7 @@
 
     Link<Node> argNodes = jsBuiltinOrEmbeddedGlobalCall.arguments;
     if (argNodes.isEmpty) {
-      compiler.internalError(jsBuiltinOrEmbeddedGlobalCall,
+      reporter.internalError(jsBuiltinOrEmbeddedGlobalCall,
           "JS $builtinOrGlobal expression has no type.");
     }
 
@@ -536,13 +550,13 @@
     // This is, because we want to allow non-literals (like references to
     // enums) as names.
     if (argNodes.tail.isEmpty) {
-      compiler.internalError(jsBuiltinOrEmbeddedGlobalCall,
+      reporter.internalError(jsBuiltinOrEmbeddedGlobalCall,
           'JS $builtinOrGlobal is missing name.');
     }
 
     if (!isBuiltin) {
       if (!argNodes.tail.tail.isEmpty) {
-        compiler.internalError(argNodes.tail.tail.head,
+        reporter.internalError(argNodes.tail.tail.head,
             'JS embedded global has more than 2 arguments');
       }
     }
@@ -551,7 +565,7 @@
     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.
-      compiler.internalError(argNodes.head, "Unexpected first argument.");
+      reporter.internalError(argNodes.head, "Unexpected first argument.");
     }
 
     String specString = specLiteral.dartString.slowToString();
@@ -559,7 +573,7 @@
     dynamic resolveType(String typeString) {
       return _parseType(
           typeString,
-          compiler,
+          parsing,
           (name) => resolver.resolveTypeFromString(specLiteral, name),
           jsBuiltinOrEmbeddedGlobalCall);
     }
@@ -568,32 +582,46 @@
       behavior.sideEffects.setTo(newEffects);
     }
 
-    processSpecString(compiler, jsBuiltinOrEmbeddedGlobalCall,
-                      specString,
-                      validTags: validTags,
-                      resolveType: resolveType,
-                      setSideEffects: setSideEffects,
-                      typesReturned: behavior.typesReturned,
-                      typesInstantiated: behavior.typesInstantiated,
-                      objectType: compiler.objectClass.computeType(compiler),
-                      nullType: compiler.nullClass.computeType(compiler));
+    processSpecString(
+        reporter,
+        jsBuiltinOrEmbeddedGlobalCall,
+        specString,
+        validTags: validTags,
+        resolveType: resolveType,
+        setSideEffects: setSideEffects,
+        typesReturned: behavior.typesReturned,
+        typesInstantiated: behavior.typesInstantiated,
+        objectType: coreTypes.objectType,
+        nullType: coreTypes.nullType);
   }
 
-  static NativeBehavior ofJsBuiltinCall(Send jsBuiltinCall,
-                                        Compiler compiler,
-                                        ResolverVisitor resolver) {
+  static NativeBehavior ofJsBuiltinCall(
+      Send jsBuiltinCall,
+      DiagnosticReporter reporter,
+      Parsing parsing,
+      CoreTypes coreTypes,
+      ForeignResolver resolver) {
     NativeBehavior behavior = new NativeBehavior();
     behavior.sideEffects.setTo(new SideEffects());
 
     _fillNativeBehaviorOfBuiltinOrEmbeddedGlobal(
-        behavior, jsBuiltinCall, compiler, resolver, isBuiltin: true);
+        behavior,
+        jsBuiltinCall,
+        reporter,
+        parsing,
+        coreTypes,
+        resolver,
+        isBuiltin: true);
 
     return behavior;
   }
 
-  static NativeBehavior ofJsEmbeddedGlobalCall(Send jsEmbeddedGlobalCall,
-                                               Compiler compiler,
-                                               ResolverVisitor resolver) {
+  static NativeBehavior ofJsEmbeddedGlobalCall(
+      Send jsEmbeddedGlobalCall,
+      DiagnosticReporter reporter,
+      Parsing parsing,
+      CoreTypes coreTypes,
+      ForeignResolver resolver) {
     NativeBehavior behavior = new NativeBehavior();
     // TODO(sra): Allow the use site to override these defaults.
     // Embedded globals are usually pre-computed data structures or JavaScript
@@ -602,29 +630,34 @@
     behavior.throwBehavior = NativeThrowBehavior.NEVER;
 
     _fillNativeBehaviorOfBuiltinOrEmbeddedGlobal(
-        behavior, jsEmbeddedGlobalCall, compiler, resolver,
+        behavior,
+        jsEmbeddedGlobalCall,
+        reporter,
+        parsing,
+        coreTypes,
+        resolver,
         isBuiltin: false,
         validTags: const ['returns', 'creates']);
 
     return behavior;
   }
 
-  static NativeBehavior ofMethod(FunctionElement method, Compiler compiler) {
-    FunctionType type = method.computeType(compiler);
+  static NativeBehavior ofMethod(FunctionElement method,  Compiler compiler) {
+    FunctionType type = method.computeType(compiler.resolution);
     var behavior = new NativeBehavior();
     behavior.typesReturned.add(type.returnType);
     if (!type.returnType.isVoid) {
       // Declared types are nullable.
-      behavior.typesReturned.add(compiler.nullClass.computeType(compiler));
+      behavior.typesReturned.add(compiler.coreTypes.nullType);
     }
-    behavior._capture(type, compiler);
+    behavior._capture(type, compiler.resolution);
 
     // TODO(sra): Optional arguments are currently missing from the
     // DartType. This should be fixed so the following work-around can be
     // removed.
     method.functionSignature.forEachOptionalParameter(
         (ParameterElement parameter) {
-          behavior._escape(parameter.type, compiler);
+          behavior._escape(parameter.type, compiler.resolution);
         });
 
     behavior._overrideWithAnnotations(method, compiler);
@@ -632,34 +665,36 @@
   }
 
   static NativeBehavior ofFieldLoad(MemberElement field, Compiler compiler) {
-    DartType type = field.computeType(compiler);
+    Resolution resolution = compiler.resolution;
+    DartType type = field.computeType(resolution);
     var behavior = new NativeBehavior();
     behavior.typesReturned.add(type);
     // Declared types are nullable.
-    behavior.typesReturned.add(compiler.nullClass.computeType(compiler));
-    behavior._capture(type, compiler);
+    behavior.typesReturned.add(resolution.coreTypes.nullType);
+    behavior._capture(type, resolution);
     behavior._overrideWithAnnotations(field, compiler);
     return behavior;
   }
 
   static NativeBehavior ofFieldStore(MemberElement field, Compiler compiler) {
-    DartType type = field.computeType(compiler);
+    Resolution resolution = compiler.resolution;
+    DartType type = field.computeType(resolution);
     var behavior = new NativeBehavior();
-    behavior._escape(type, compiler);
+    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.metadata.isEmpty) return;
+    if (element.implementation.metadata.isEmpty) return;
 
     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);
+      cls.ensureResolved(compiler.resolution);
       return cls.thisType;
     }
 
@@ -684,11 +719,10 @@
    */
   static _collect(Element element, Compiler compiler, Element annotationClass,
                   lookup(str)) {
+    DiagnosticReporter reporter = compiler.reporter;
     var types = null;
-    for (Link<MetadataAnnotation> link = element.metadata;
-         !link.isEmpty;
-         link = link.tail) {
-      MetadataAnnotation annotation = link.head.ensureResolved(compiler);
+    for (MetadataAnnotation annotation in element.implementation.metadata) {
+      annotation.ensureResolved(compiler.resolution);
       ConstantValue value =
           compiler.constants.getConstantValue(annotation.constant);
       if (!value.isConstructedObject) continue;
@@ -698,14 +732,13 @@
       Iterable<ConstantValue> fields = constructedObject.fields.values;
       // TODO(sra): Better validation of the constant.
       if (fields.length != 1 || !fields.single.isString) {
-        PartialMetadataAnnotation partial = annotation;
-        compiler.internalError(annotation,
-            'Annotations needs one string: ${partial.parseNode(compiler)}');
+        reporter.internalError(annotation,
+            'Annotations needs one string: ${annotation.node}');
       }
       StringConstantValue specStringConstant = fields.single;
       String specString = specStringConstant.toDartString().slowToString();
       for (final typeString in specString.split('|')) {
-        var type = _parseType(typeString, compiler, lookup, annotation);
+        var type = _parseType(typeString, compiler.parsing, lookup, annotation);
         if (types == null) types = [];
         types.add(type);
       }
@@ -715,15 +748,16 @@
 
   /// Models the behavior of having intances of [type] escape from Dart code
   /// into native code.
-  void _escape(DartType type, Compiler compiler) {
-    type = type.unalias(compiler);
+  void _escape(DartType type, Resolution resolution) {
+    type.computeUnaliased(resolution);
+    type = type.unaliased;
     if (type is FunctionType) {
       FunctionType functionType = type;
       // A function might be called from native code, passing us novel
       // parameters.
-      _escape(functionType.returnType, compiler);
+      _escape(functionType.returnType, resolution);
       for (DartType parameter in functionType.parameterTypes) {
-        _capture(parameter, compiler);
+        _capture(parameter, resolution);
       }
     }
   }
@@ -731,21 +765,26 @@
   /// Models the behavior of Dart code receiving instances and methods of [type]
   /// from native code.  We usually start the analysis by capturing a native
   /// method that has been used.
-  void _capture(DartType type, Compiler compiler) {
-    type = type.unalias(compiler);
+  void _capture(DartType type, Resolution resolution) {
+    type.computeUnaliased(resolution);
+    type = type.unaliased;
     if (type is FunctionType) {
       FunctionType functionType = type;
-      _capture(functionType.returnType, compiler);
+      _capture(functionType.returnType, resolution);
       for (DartType parameter in functionType.parameterTypes) {
-        _escape(parameter, compiler);
+        _escape(parameter, resolution);
       }
     } else {
       typesInstantiated.add(type);
     }
   }
 
-  static dynamic _parseType(String typeString, Compiler compiler,
-      lookup(name), locationNodeOrElement) {
+  static dynamic _parseType(
+      String typeString,
+      Parsing parsing,
+      lookup(name),
+      locationNodeOrElement) {
+    DiagnosticReporter reporter = parsing.reporter;
     if (typeString == '=Object') return SpecialType.JsObject;
     if (typeString == 'dynamic') {
       return const DynamicType();
@@ -755,8 +794,8 @@
 
     int index = typeString.indexOf('<');
     if (index < 1) {
-      compiler.reportError(
-          _errorNode(locationNodeOrElement, compiler),
+      reporter.reportErrorMessage(
+          _errorNode(locationNodeOrElement, parsing),
           MessageKind.GENERIC,
           {'text': "Type '$typeString' not found."});
       return const DynamicType();
@@ -766,15 +805,15 @@
       // TODO(sra): Parse type parameters.
       return type;
     }
-    compiler.reportError(
-        _errorNode(locationNodeOrElement, compiler),
+    reporter.reportErrorMessage(
+        _errorNode(locationNodeOrElement, parsing),
         MessageKind.GENERIC,
         {'text': "Type '$typeString' not found."});
     return const DynamicType();
   }
 
-  static _errorNode(locationNodeOrElement, compiler) {
+  static _errorNode(locationNodeOrElement, Parsing parsing) {
     if (locationNodeOrElement is Node) return locationNodeOrElement;
-    return locationNodeOrElement.parseNode(compiler);
+    return locationNodeOrElement.parseNode(parsing);
   }
 }
diff --git a/pkg/compiler/lib/src/native/enqueue.dart b/pkg/compiler/lib/src/native/enqueue.dart
index d936d58..42ceba2 100644
--- a/pkg/compiler/lib/src/native/enqueue.dart
+++ b/pkg/compiler/lib/src/native/enqueue.dart
@@ -11,6 +11,10 @@
   /// Initial entry point to native enqueuer.
   void processNativeClasses(Iterable<LibraryElement> libraries) {}
 
+  /// Registers the [nativeBehavior]. Adds the liveness of its instantiated
+  /// types to the world.
+  void registerNativeBehavior(NativeBehavior nativeBehavior, cause) {}
+
   /// Notification of a main Enqueuer worklist element.  For methods, adds
   /// information from metadata attributes, and computes types instantiated due
   /// to calling the method.
@@ -30,42 +34,6 @@
   /// Returns whether native classes are being used.
   bool hasInstantiatedNativeClasses() => false;
 
-  /**
-   * Handles JS-calls, which can be an instantiation point for types.
-   *
-   * For example, the following code instantiates and returns native classes
-   * that are `_DOMWindowImpl` or a subtype.
-   *
-   *     JS('_DOMWindowImpl', 'window')
-   *
-   */
-  // TODO(sra): The entry from codegen will not have a resolver.
-  void registerJsCall(Send node, ResolverVisitor resolver) {}
-
-  /**
-   * Handles JS-embedded global calls, which can be an instantiation point for
-   * types.
-   *
-   * For example, the following code instantiates and returns a String class
-   *
-   *     JS_EMBEDDED_GLOBAL('String', 'foo')
-   *
-   */
-  // TODO(sra): The entry from codegen will not have a resolver.
-  void registerJsEmbeddedGlobalCall(Send node, ResolverVisitor resolver) {}
-
-  /**
-   * Handles JS-compiler builtin calls, which can be an instantiation point for
-   * types.
-   *
-   * For example, the following code instantiates and returns a String class
-   *
-   *     JS_BUILTIN('String', 'int2string', 0)
-   *
-   */
-  // TODO(sra): The entry from codegen will not have a resolver.
-  void registerJsBuiltinCall(Send node, ResolverVisitor resolver) {}
-
   /// Emits a summary information using the [log] function.
   void logSummary(log(message)) {}
 
@@ -127,6 +95,9 @@
         processedLibraries = compiler.cacheStrategy.newSet();
 
   JavaScriptBackend get backend => compiler.backend;
+  Resolution get resolution => compiler.resolution;
+
+  DiagnosticReporter get reporter => compiler.reporter;
 
   void processNativeClasses(Iterable<LibraryElement> libraries) {
     if (compiler.hasIncrementalSupport) {
@@ -159,7 +130,7 @@
     nativeClasses.add(classElement);
     unusedClasses.add(classElement);
     // Resolve class to ensure the class has valid inheritance info.
-    classElement.ensureResolved(compiler);
+    classElement.ensureResolved(resolution);
   }
 
   void processSubclassesOfNativeClasses(Iterable<LibraryElement> libraries) {
@@ -198,7 +169,7 @@
 
     void walkPotentialSubclasses(ClassElement element) {
       if (nativeClassesAndSubclasses.contains(element)) return;
-      element.ensureResolved(compiler);
+      element.ensureResolved(resolution);
       ClassElement nativeSuperclass = nativeSuperclassOf(element);
       if (nativeSuperclass != null) {
         nativeClassesAndSubclasses.add(element);
@@ -263,7 +234,7 @@
       if (token.stringValue != 'extends') return null;
       token = token.next;
       Token id = token;
-      while (token.kind != EOF_TOKEN) {
+      while (token.kind != Tokens.EOF_TOKEN) {
         token = token.next;
         if (token.stringValue != '.') break;
         token = token.next;
@@ -274,7 +245,7 @@
       return id.value;
     }
 
-    return compiler.withCurrentElement(classElement, () {
+    return reporter.withCurrentElement(classElement, () {
       return scanForExtendsName(classElement.position);
     });
   }
@@ -299,7 +270,7 @@
     ClassElement find(name) {
       Element e = backend.findHelper(name);
       if (e == null || e is! ClassElement) {
-        compiler.internalError(NO_LOCATION_SPANNABLE,
+        reporter.internalError(NO_LOCATION_SPANNABLE,
             "Could not find implementation class '${name}'.");
       }
       return e;
@@ -314,10 +285,8 @@
   String findJsNameFromAnnotation(Element element) {
     String name = null;
     ClassElement annotationClass = annotationJsNameClass;
-    for (Link<MetadataAnnotation> link = element.metadata;
-         !link.isEmpty;
-         link = link.tail) {
-      MetadataAnnotation annotation = link.head.ensureResolved(compiler);
+    for (MetadataAnnotation annotation in element.implementation.metadata) {
+      annotation.ensureResolved(resolution);
       ConstantValue value =
           compiler.constants.getConstantValue(annotation.constant);
       if (!value.isConstructedObject) continue;
@@ -327,18 +296,16 @@
       Iterable<ConstantValue> fields = constructedObject.fields.values;
       // TODO(sra): Better validation of the constant.
       if (fields.length != 1 || fields.single is! StringConstantValue) {
-        PartialMetadataAnnotation partial = annotation;
-        compiler.internalError(annotation,
-            'Annotations needs one string: ${partial.parseNode(compiler)}');
+        reporter.internalError(annotation,
+            'Annotations needs one string: ${annotation.node}');
       }
       StringConstantValue specStringConstant = fields.single;
       String specString = specStringConstant.toDartString().slowToString();
       if (name == null) {
         name = specString;
       } else {
-        PartialMetadataAnnotation partial = annotation;
-        compiler.internalError(annotation,
-            'Too many JSName annotations: ${partial.parseNode(compiler)}');
+        reporter.internalError(annotation,
+            'Too many JSName annotations: ${annotation.node}');
       }
     }
     return name;
@@ -370,13 +337,9 @@
     registeredClasses.add(classElement);
 
     // TODO(ahe): Is this really a global dependency?
-    classElement.ensureResolved(compiler);
-    world.registerInstantiatedType(
-        classElement.rawType, compiler.globalDependencies);
-
-    // Also parse the node to know all its methods because otherwise it will
-    // only be parsed if there is a call to one of its constructors.
-    classElement.parseNode(compiler);
+    classElement.ensureResolved(resolution);
+    compiler.backend.registerInstantiatedType(
+        classElement.rawType, world, compiler.globalDependencies);
 
     if (firstTime) {
       queue.add(onFirstNativeClass);
@@ -384,7 +347,7 @@
   }
 
   registerElement(Element element) {
-    compiler.withCurrentElement(element, () {
+    reporter.withCurrentElement(element, () {
       if (element.isFunction || element.isGetter || element.isSetter) {
         handleMethodAnnotations(element);
         if (element.isNative) {
@@ -444,7 +407,7 @@
     if (isIdentifier(name)) {
       List<String> nativeNames = nativeTagsOfClassRaw(element.enclosingClass);
       if (nativeNames.length != 1) {
-        compiler.internalError(element,
+        reporter.internalError(element,
             'Unable to determine a native name for the enclosing class, '
             'options: $nativeNames');
       }
@@ -459,8 +422,8 @@
   bool isNativeMethod(FunctionElementX element) {
     if (!element.library.canUseNative) return false;
     // Native method?
-    return compiler.withCurrentElement(element, () {
-      Node node = element.parseNode(compiler);
+    return reporter.withCurrentElement(element, () {
+      Node node = element.parseNode(resolution.parsing);
       if (node is! FunctionExpression) return false;
       FunctionExpression functionExpression = node;
       node = functionExpression.body;
@@ -470,48 +433,21 @@
     });
   }
 
+  void registerNativeBehavior(NativeBehavior nativeBehavior, cause) {
+    processNativeBehavior(nativeBehavior, cause);
+    flushQueue();
+  }
+
   void registerMethodUsed(Element method) {
-    processNativeBehavior(
-        NativeBehavior.ofMethod(method, compiler),
-        method);
-      flushQueue();
+    registerNativeBehavior(NativeBehavior.ofMethod(method, compiler), method);
   }
 
   void registerFieldLoad(Element field) {
-    processNativeBehavior(
-        NativeBehavior.ofFieldLoad(field, compiler),
-        field);
-    flushQueue();
+    registerNativeBehavior(NativeBehavior.ofFieldLoad(field, compiler), field);
   }
 
   void registerFieldStore(Element field) {
-    processNativeBehavior(
-        NativeBehavior.ofFieldStore(field, compiler),
-        field);
-    flushQueue();
-  }
-
-  void registerJsCall(Send node, ResolverVisitor resolver) {
-    NativeBehavior behavior = NativeBehavior.ofJsCall(node, compiler, resolver);
-    processNativeBehavior(behavior, node);
-    nativeBehaviors[node] = behavior;
-    flushQueue();
-  }
-
-  void registerJsEmbeddedGlobalCall(Send node, ResolverVisitor resolver) {
-    NativeBehavior behavior =
-        NativeBehavior.ofJsEmbeddedGlobalCall(node, compiler, resolver);
-    processNativeBehavior(behavior, node);
-    nativeBehaviors[node] = behavior;
-    flushQueue();
-  }
-
-  void registerJsBuiltinCall(Send node, ResolverVisitor resolver) {
-    NativeBehavior behavior =
-        NativeBehavior.ofJsBuiltinCall(node, compiler, resolver);
-    processNativeBehavior(behavior, node);
-    nativeBehaviors[node] = behavior;
-    flushQueue();
+    registerNativeBehavior(NativeBehavior.ofFieldStore(field, compiler), field);
   }
 
   NativeBehavior getNativeBehaviorOf(Send node) => nativeBehaviors[node];
@@ -525,30 +461,30 @@
       matchedTypeConstraints.add(type);
       if (type is SpecialType) {
         if (type == SpecialType.JsObject) {
-          world.registerInstantiatedType(
-              compiler.coreTypes.objectType, registry);
+          backend.registerInstantiatedType(
+              compiler.coreTypes.objectType, world, registry);
         }
         continue;
       }
       if (type is InterfaceType) {
         if (type.element == compiler.intClass) {
-          world.registerInstantiatedType(type, registry);
+          backend.registerInstantiatedType(type, world, registry);
         } else if (type.element == compiler.doubleClass) {
-          world.registerInstantiatedType(type, registry);
+          backend.registerInstantiatedType(type, world, registry);
         } else if (type.element == compiler.numClass) {
-          world.registerInstantiatedType(
-              compiler.coreTypes.doubleType, registry);
-          world.registerInstantiatedType(
-              compiler.coreTypes.intType, registry);
+          backend.registerInstantiatedType(
+              compiler.coreTypes.doubleType, world, registry);
+          backend.registerInstantiatedType(
+              compiler.coreTypes.intType, world, registry);
         } else if (type.element == compiler.stringClass) {
-          world.registerInstantiatedType(type, registry);
+          backend.registerInstantiatedType(type, world, registry);
         } else if (type.element == compiler.nullClass) {
-          world.registerInstantiatedType(type, registry);
+          backend.registerInstantiatedType(type, world, registry);
         } else if (type.element == compiler.boolClass) {
-          world.registerInstantiatedType(type, registry);
+          backend.registerInstantiatedType(type, world, registry);
         } else if (compiler.types.isSubtype(
                       type, backend.listImplementation.rawType)) {
-          world.registerInstantiatedType(type, registry);
+          backend.registerInstantiatedType(type, world, registry);
         }
       }
       assert(type is DartType);
@@ -561,7 +497,7 @@
     // Give an info so that library developers can compile with -v to find why
     // all the native classes are included.
     if (unusedClasses.isEmpty && !allUsedBefore) {
-      compiler.log('All native types marked as used due to $cause.');
+      reporter.log('All native types marked as used due to $cause.');
     }
   }
 
@@ -608,13 +544,15 @@
   void processNativeClass(ClassElement classElement) {
     super.processNativeClass(classElement);
 
+    // Js Interop interfaces do not have tags.
+    if (classElement.isJsInterop) return;
     // Since we map from dispatch tags to classes, a dispatch tag must be used
     // on only one native class.
     for (String tag in nativeTagsOfClass(classElement)) {
       ClassElement owner = tagOwner[tag];
       if (owner != null) {
         if (owner != classElement) {
-          compiler.internalError(
+          reporter.internalError(
               classElement, "Tag '$tag' already in use by '${owner.name}'");
         }
       } else {
@@ -627,6 +565,56 @@
     log('Resolved ${registeredClasses.length} native elements used, '
         '${unusedClasses.length} native elements dead.');
   }
+
+  /**
+   * Handles JS-calls, which can be an instantiation point for types.
+   *
+   * For example, the following code instantiates and returns native classes
+   * that are `_DOMWindowImpl` or a subtype.
+   *
+   *     JS('_DOMWindowImpl', 'window')
+   *
+   */
+  void registerJsCall(Send node, ForeignResolver resolver) {
+    NativeBehavior behavior = NativeBehavior.ofJsCall(
+        node, reporter, compiler.parsing, compiler.coreTypes, resolver);
+    registerNativeBehavior(behavior, node);
+    nativeBehaviors[node] = behavior;
+  }
+
+
+  /**
+   * Handles JS-embedded global calls, which can be an instantiation point for
+   * types.
+   *
+   * For example, the following code instantiates and returns a String class
+   *
+   *     JS_EMBEDDED_GLOBAL('String', 'foo')
+   *
+   */
+  void registerJsEmbeddedGlobalCall(Send node, ForeignResolver resolver) {
+    NativeBehavior behavior = NativeBehavior.ofJsEmbeddedGlobalCall(
+        node, reporter, compiler.parsing, compiler.coreTypes, resolver);
+    registerNativeBehavior(behavior, node);
+    nativeBehaviors[node] = behavior;
+  }
+
+
+  /**
+   * Handles JS-compiler builtin calls, which can be an instantiation point for
+   * types.
+   *
+   * For example, the following code instantiates and returns a String class
+   *
+   *     JS_BUILTIN('String', 'int2string', 0)
+   *
+   */
+  void registerJsBuiltinCall(Send node, ForeignResolver resolver) {
+    NativeBehavior behavior = NativeBehavior.ofJsBuiltinCall(
+        node, reporter, compiler.parsing, compiler.coreTypes, resolver);
+    registerNativeBehavior(behavior, node);
+    nativeBehaviors[node] = behavior;
+  }
 }
 
 
diff --git a/pkg/compiler/lib/src/native/native.dart b/pkg/compiler/lib/src/native/native.dart
index 4a32a52..994ff37 100644
--- a/pkg/compiler/lib/src/native/native.dart
+++ b/pkg/compiler/lib/src/native/native.dart
@@ -6,20 +6,48 @@
 
 import 'dart:collection' show Queue;
 
+import '../common.dart';
+import '../common/backend_api.dart' show
+    ForeignResolver;
+import '../common/registry.dart' show
+    Registry;
+import '../common/resolution.dart' show
+    Parsing,
+    Resolution;
+import '../compiler.dart' show
+    Compiler;
 import '../constants/values.dart';
-import '../dart2jslib.dart';
+import '../core_types.dart' show
+    CoreTypes;
 import '../dart_types.dart';
+import '../enqueue.dart' show
+    Enqueuer,
+    ResolutionEnqueuer;
 import '../elements/elements.dart';
-import '../elements/modelx.dart'
-    show ElementX, BaseClassElementX, FunctionElementX, LibraryElementX;
+import '../elements/modelx.dart' show
+    BaseClassElementX,
+    ElementX,
+    FunctionElementX,
+    LibraryElementX;
 import '../js/js.dart' as js;
 import '../js_backend/js_backend.dart';
-import '../js_emitter/js_emitter.dart' show CodeEmitterTask, NativeEmitter;
-import '../resolution/resolution.dart' show ResolverVisitor;
-import '../scanner/scannerlib.dart';
+import '../js_emitter/js_emitter.dart' show
+    CodeEmitterTask,
+    NativeEmitter;
+import '../parser/listener.dart' show
+    Listener;
+import '../parser/element_listener.dart' show
+    ElementListener;
 import '../ssa/ssa.dart';
+import '../tokens/token.dart' show
+    BeginGroupToken,
+    Token;
+import '../tokens/token_constants.dart' as Tokens show
+    EOF_TOKEN,
+    STRING_TOKEN;
 import '../tree/tree.dart';
-import '../universe/universe.dart' show SideEffects;
+import '../universe/side_effects.dart' show
+    SideEffects;
 import '../util/util.dart';
 
 part 'behavior.dart';
diff --git a/pkg/compiler/lib/src/native/scanner.dart b/pkg/compiler/lib/src/native/scanner.dart
index bbbbb2e..cfdb703 100644
--- a/pkg/compiler/lib/src/native/scanner.dart
+++ b/pkg/compiler/lib/src/native/scanner.dart
@@ -13,7 +13,7 @@
 Token handleNativeBlockToSkip(Listener listener, Token token) {
   checkAllowedLibrary(listener, token);
   token = token.next;
-  if (identical(token.kind, STRING_TOKEN)) {
+  if (identical(token.kind, Tokens.STRING_TOKEN)) {
     token = token.next;
   }
   if (identical(token.stringValue, '{')) {
@@ -29,7 +29,7 @@
   listener.beginReturnStatement(token);
   token = token.next;
   bool hasExpression = false;
-  if (identical(token.kind, STRING_TOKEN)) {
+  if (identical(token.kind, Tokens.STRING_TOKEN)) {
     hasExpression = true;
     listener.beginLiteralString(token);
     listener.endLiteralString(0);
diff --git a/pkg/compiler/lib/src/native/ssa.dart b/pkg/compiler/lib/src/native/ssa.dart
index e622559..1dfa536 100644
--- a/pkg/compiler/lib/src/native/ssa.dart
+++ b/pkg/compiler/lib/src/native/ssa.dart
@@ -8,9 +8,10 @@
 
 void handleSsaNative(SsaBuilder builder, Expression nativeBody) {
   Compiler compiler = builder.compiler;
-  FunctionElement element = builder.work.element;
+  FunctionElement element = builder.target;
   NativeEmitter nativeEmitter = builder.nativeEmitter;
   JavaScriptBackend backend = builder.backend;
+  DiagnosticReporter reporter = compiler.reporter;
 
   HInstruction convertDartClosure(ParameterElement  parameter,
                                   FunctionType type) {
@@ -20,7 +21,7 @@
     HInstruction arity = builder.graph.addConstant(arityConstant, compiler);
     // TODO(ngeoffray): For static methods, we could pass a method with a
     // defined arity.
-    Element helper = backend.getClosureConverter();
+    Element helper = backend.helpers.closureConverter;
     builder.pushInvokeStatic(nativeBody, helper, [local, arity]);
     HInstruction closure = builder.pop();
     return closure;
@@ -40,7 +41,7 @@
     LiteralString jsCode = nativeBody.asLiteralString();
     String str = jsCode.dartString.slowToString();
     if (nativeRedirectionRegExp.hasMatch(str)) {
-      compiler.internalError(
+      reporter.internalError(
           nativeBody, "Deprecated syntax, use @JSName('name') instead.");
     }
     hasBody = true;
@@ -60,7 +61,7 @@
       inputs.add(builder.localsHandler.readThis());
     }
     parameters.forEachParameter((ParameterElement parameter) {
-      DartType type = parameter.type.unalias(compiler);
+      DartType type = parameter.type.unaliased;
       HInstruction input = builder.localsHandler.readLocal(parameter);
       if (type is FunctionType) {
         // The parameter type is a function type either directly or through
@@ -80,7 +81,7 @@
     } else if (element.kind == ElementKind.SETTER) {
       nativeMethodCall = '$receiver$nativeMethodName = $foreignParameters';
     } else {
-      builder.compiler.internalError(element,
+      builder.reporter.internalError(element,
                                      'Unexpected kind: "${element.kind}".');
     }
 
@@ -98,7 +99,7 @@
         .addSuccessor(builder.graph.exit);
   } else {
     if (parameters.parameterCount != 0) {
-      compiler.internalError(nativeBody,
+      reporter.internalError(nativeBody,
           'native "..." syntax is restricted to '
           'functions with zero parameters.');
     }
diff --git a/pkg/compiler/lib/src/ordered_typeset.dart b/pkg/compiler/lib/src/ordered_typeset.dart
index c3bb16d7..a5da246 100644
--- a/pkg/compiler/lib/src/ordered_typeset.dart
+++ b/pkg/compiler/lib/src/ordered_typeset.dart
@@ -4,11 +4,17 @@
 
 library ordered_typeset;
 
-import 'dart2jslib.dart' show Compiler, MessageKind, invariant;
+import 'common.dart';
+import 'compiler.dart' show
+    Compiler;
 import 'dart_types.dart';
-import 'elements/elements.dart' show ClassElement;
-import 'util/util.dart' show Link, LinkBuilder;
-import 'util/util_implementation.dart' show LinkEntry;
+import 'elements/elements.dart' show
+    ClassElement;
+import 'util/util.dart' show
+    Link,
+    LinkBuilder;
+import 'util/util_implementation.dart' show
+    LinkEntry;
 
 /**
  * An ordered set of the supertypes of a class. The supertypes of a class are
@@ -154,23 +160,26 @@
       if (type.element != compiler.objectClass) {
         allSupertypes.addLast(compiler.objectClass.rawType);
       }
-      _addAtDepth(compiler, type, maxDepth + 1);
+      DiagnosticReporter reporter = compiler.reporter;
+      _addAtDepth(reporter, type, maxDepth + 1);
     } else {
       if (type.element != compiler.objectClass) {
         allSupertypes.addLast(type);
       }
-      _addAtDepth(compiler, type, type.element.hierarchyDepth);
+      DiagnosticReporter reporter = compiler.reporter;
+      _addAtDepth(reporter, type, type.element.hierarchyDepth);
     }
   }
 
-  void _addAtDepth(Compiler compiler, InterfaceType type, int depth) {
+  void _addAtDepth(DiagnosticReporter reporter, InterfaceType type, int depth) {
     LinkEntry<DartType> prev = null;
     LinkEntry<DartType> link = map[depth];
     while (link != null) {
       DartType existingType = link.head;
       if (existingType == type) return;
       if (existingType.element == type.element) {
-        compiler.reportError(cls,
+        reporter.reportErrorMessage(
+            cls,
             MessageKind.MULTI_INHERITANCE,
             {'thisType': cls.thisType,
              'firstType': existingType,
diff --git a/pkg/compiler/lib/src/parser/class_element_parser.dart b/pkg/compiler/lib/src/parser/class_element_parser.dart
new file mode 100644
index 0000000..745665d
--- /dev/null
+++ b/pkg/compiler/lib/src/parser/class_element_parser.dart
@@ -0,0 +1,19 @@
+// 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.
+
+library dart2js.parser.classes;
+
+import '../tokens/token.dart' show
+    Token;
+
+import 'listener.dart' show
+    Listener;
+import 'partial_parser.dart' show
+    PartialParser;
+
+class ClassElementParser extends PartialParser {
+  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
new file mode 100644
index 0000000..4ae413b
--- /dev/null
+++ b/pkg/compiler/lib/src/parser/diet_parser_task.dart
@@ -0,0 +1,41 @@
+// 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 dart2js.parser.diet.task;
+
+import '../common.dart';
+import '../common/tasks.dart' show
+    CompilerTask;
+import '../compiler.dart' show
+    Compiler;
+import '../elements/elements.dart' show
+    CompilationUnitElement;
+import '../tokens/token.dart' show
+    Token;
+
+import 'listener.dart' show
+    ParserError;
+import 'element_listener.dart' show
+    ElementListener;
+import 'partial_parser.dart' show
+    PartialParser;
+
+class DietParserTask extends CompilerTask {
+  DietParserTask(Compiler compiler) : super(compiler);
+  final String name = 'Diet Parser';
+
+  dietParse(CompilationUnitElement compilationUnit, Token tokens) {
+    measure(() {
+      Function idGenerator = compiler.getNextFreeClassId;
+      ElementListener listener =
+          new ElementListener(compiler.reporter, compilationUnit, idGenerator);
+      PartialParser parser = new PartialParser(listener);
+      try {
+        parser.parseUnit(tokens);
+      } on ParserError catch(_) {
+        assert(invariant(compilationUnit, compiler.compilationFailed));
+      }
+    });
+  }
+}
diff --git a/pkg/compiler/lib/src/parser/element_listener.dart b/pkg/compiler/lib/src/parser/element_listener.dart
new file mode 100644
index 0000000..94da7df
--- /dev/null
+++ b/pkg/compiler/lib/src/parser/element_listener.dart
@@ -0,0 +1,752 @@
+// 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 dart2js.parser.element_listener;
+
+import '../common.dart';
+import '../diagnostics/messages.dart' show
+    MessageTemplate;
+import '../elements/elements.dart' show
+    Element,
+    LibraryElement,
+    MetadataAnnotation;
+import '../elements/modelx.dart' show
+    CompilationUnitElementX,
+    DeclarationSite,
+    ElementX,
+    EnumClassElementX,
+    FieldElementX,
+    LibraryElementX,
+    MixinApplicationElementX,
+    VariableList;
+import '../native/native.dart' as native;
+import '../string_validator.dart' show
+    StringValidator;
+import '../tokens/keyword.dart' show
+    Keyword;
+import '../tokens/precedence_constants.dart' as Precedence show
+    BAD_INPUT_INFO;
+import '../tokens/token.dart' show
+    BeginGroupToken,
+    ErrorToken,
+    KeywordToken,
+    Token;
+import '../tokens/token_constants.dart' as Tokens show
+    EOF_TOKEN;
+import '../tree/tree.dart';
+import '../util/util.dart' show
+    Link,
+    LinkBuilder;
+
+import 'partial_elements.dart' show
+    PartialClassElement,
+    PartialElement,
+    PartialFieldList,
+    PartialFunctionElement,
+    PartialMetadataAnnotation,
+    PartialTypedefElement;
+import 'listener.dart' show
+    closeBraceFor,
+    Listener,
+    ParserError,
+    VERBOSE;
+
+typedef int IdGenerator();
+
+/**
+ * A parser event listener designed to work with [PartialParser]. It
+ * builds elements representing the top-level declarations found in
+ * the parsed compilation unit and records them in
+ * [compilationUnitElement].
+ */
+class ElementListener extends Listener {
+  final IdGenerator idGenerator;
+  final DiagnosticReporter reporter;
+  final CompilationUnitElementX compilationUnitElement;
+  final StringValidator stringValidator;
+  Link<StringQuoting> interpolationScope;
+
+  Link<Node> nodes = const Link<Node>();
+
+  LinkBuilder<MetadataAnnotation> metadata =
+      new LinkBuilder<MetadataAnnotation>();
+
+  /// Records a stack of booleans for each member parsed (a stack is used to
+  /// support nested members which isn't currently possible, but it also serves
+  /// as a simple way to tell we're currently parsing a member). In this case,
+  /// member refers to members of a library or a class (but currently, classes
+  /// themselves are not considered members).  If the top of the stack
+  /// (memberErrors.head) is true, the current member has already reported at
+  /// least one parse error.
+  Link<bool> memberErrors = const Link<bool>();
+
+  bool suppressParseErrors = false;
+
+  ElementListener(
+      DiagnosticReporter reporter,
+      this.compilationUnitElement,
+      this.idGenerator)
+      : this.reporter = reporter,
+        stringValidator = new StringValidator(reporter),
+        interpolationScope = const Link<StringQuoting>();
+
+  bool get currentMemberHasParseError {
+    return !memberErrors.isEmpty && memberErrors.head;
+  }
+
+  void pushQuoting(StringQuoting quoting) {
+    interpolationScope = interpolationScope.prepend(quoting);
+  }
+
+  StringQuoting popQuoting() {
+    StringQuoting result = interpolationScope.head;
+    interpolationScope = interpolationScope.tail;
+    return result;
+  }
+
+  StringNode popLiteralString() {
+    StringNode node = popNode();
+    // TODO(lrn): Handle interpolations in script tags.
+    if (node.isInterpolation) {
+      reporter.internalError(node,
+          "String interpolation not supported in library tags.");
+      return null;
+    }
+    return node;
+  }
+
+  bool allowLibraryTags() {
+    // Library tags are only allowed in the library file itself, not
+    // in sourced files.
+    LibraryElement library = compilationUnitElement.implementationLibrary;
+    return !compilationUnitElement.hasMembers &&
+           library.entryCompilationUnit == compilationUnitElement;
+  }
+
+  void endLibraryName(Token libraryKeyword, Token semicolon) {
+    Expression name = popNode();
+    addLibraryTag(new LibraryName(libraryKeyword, name,
+                                  popMetadata(compilationUnitElement)));
+  }
+
+  void endImport(Token importKeyword, Token deferredKeyword, Token asKeyword,
+                 Token semicolon) {
+    NodeList combinators = popNode();
+    bool isDeferred = deferredKeyword != null;
+    Identifier prefix;
+    if (asKeyword != null) {
+      prefix = popNode();
+    }
+    StringNode uri = popLiteralString();
+    addLibraryTag(new Import(importKeyword, uri, prefix, combinators,
+                             popMetadata(compilationUnitElement),
+                             isDeferred: isDeferred));
+  }
+
+  void endEnum(Token enumKeyword, Token endBrace, int count) {
+    NodeList names = makeNodeList(count, enumKeyword.next.next, endBrace, ",");
+    Identifier name = popNode();
+
+    int id = idGenerator();
+    Element enclosing = compilationUnitElement;
+    pushElement(new EnumClassElementX(name.source, enclosing, id,
+        new Enum(enumKeyword, name, names)));
+    rejectBuiltInIdentifier(name);
+  }
+
+  void endExport(Token exportKeyword, Token semicolon) {
+    NodeList combinators = popNode();
+    StringNode uri = popNode();
+    addLibraryTag(new Export(exportKeyword, uri, combinators,
+                             popMetadata(compilationUnitElement)));
+  }
+
+  void endCombinators(int count) {
+    if (0 == count) {
+      pushNode(null);
+    } else {
+      pushNode(makeNodeList(count, null, null, " "));
+    }
+  }
+
+  void endHide(Token hideKeyword) => pushCombinator(hideKeyword);
+
+  void endShow(Token showKeyword) => pushCombinator(showKeyword);
+
+  void pushCombinator(Token keywordToken) {
+    NodeList identifiers = popNode();
+    pushNode(new Combinator(identifiers, keywordToken));
+  }
+
+  void endIdentifierList(int count) {
+    pushNode(makeNodeList(count, null, null, ","));
+  }
+
+  void endTypeList(int count) {
+    pushNode(makeNodeList(count, null, null, ","));
+  }
+
+  void endPart(Token partKeyword, Token semicolon) {
+    StringNode uri = popLiteralString();
+    addLibraryTag(new Part(partKeyword, uri,
+                           popMetadata(compilationUnitElement)));
+  }
+
+  void endPartOf(Token partKeyword, Token semicolon) {
+    Expression name = popNode();
+    addPartOfTag(new PartOf(partKeyword, name,
+                            popMetadata(compilationUnitElement)));
+  }
+
+  void addPartOfTag(PartOf tag) {
+    compilationUnitElement.setPartOf(tag, reporter);
+  }
+
+  void endMetadata(Token beginToken, Token periodBeforeName, Token endToken) {
+    if (periodBeforeName != null) {
+      popNode(); // Discard name.
+    }
+    popNode(); // Discard node (Send or Identifier).
+    pushMetadata(new PartialMetadataAnnotation(beginToken, endToken));
+  }
+
+  void endTopLevelDeclaration(Token token) {
+    if (!metadata.isEmpty) {
+      recoverableError(metadata.first.beginToken,
+                       'Metadata not supported here.');
+      metadata.clear();
+    }
+  }
+
+  void endClassDeclaration(int interfacesCount, Token beginToken,
+                           Token extendsKeyword, Token implementsKeyword,
+                           Token endToken) {
+    makeNodeList(interfacesCount, implementsKeyword, null, ","); // interfaces
+    popNode(); // superType
+    popNode(); // typeParameters
+    Identifier name = popNode();
+    int id = idGenerator();
+    PartialClassElement element = new PartialClassElement(
+        name.source, beginToken, endToken, compilationUnitElement, id);
+    pushElement(element);
+    rejectBuiltInIdentifier(name);
+  }
+
+  void rejectBuiltInIdentifier(Identifier name) {
+    if (name.token is KeywordToken) {
+      Keyword keyword = (name.token as KeywordToken).keyword;
+      if (!keyword.isPseudo) {
+        recoverableError(name, "Illegal name '${keyword.syntax}'.");
+      }
+    }
+  }
+
+  void endFunctionTypeAlias(Token typedefKeyword, Token endToken) {
+    popNode(); // TODO(karlklose): do not throw away typeVariables.
+    Identifier name = popNode();
+    popNode(); // returnType
+    pushElement(
+        new PartialTypedefElement(
+            name.source, compilationUnitElement, typedefKeyword, endToken));
+    rejectBuiltInIdentifier(name);
+  }
+
+  void endNamedMixinApplication(Token classKeyword,
+                                Token implementsKeyword,
+                                Token endToken) {
+    NodeList interfaces = (implementsKeyword != null) ? popNode() : null;
+    MixinApplication mixinApplication = popNode();
+    Modifiers modifiers = popNode();
+    NodeList typeParameters = popNode();
+    Identifier name = popNode();
+    NamedMixinApplication namedMixinApplication = new NamedMixinApplication(
+        name, typeParameters, modifiers, mixinApplication, interfaces,
+        classKeyword, endToken);
+
+    int id = idGenerator();
+    Element enclosing = compilationUnitElement;
+    pushElement(new MixinApplicationElementX(name.source, enclosing, id,
+                                             namedMixinApplication,
+                                             modifiers));
+    rejectBuiltInIdentifier(name);
+  }
+
+  void endMixinApplication() {
+    NodeList mixins = popNode();
+    TypeAnnotation superclass = popNode();
+    pushNode(new MixinApplication(superclass, mixins));
+  }
+
+  void handleVoidKeyword(Token token) {
+    pushNode(new TypeAnnotation(new Identifier(token), null));
+  }
+
+  void endTopLevelMethod(Token beginToken, Token getOrSet, Token endToken) {
+    bool hasParseError = currentMemberHasParseError;
+    memberErrors = memberErrors.tail;
+    Identifier name = popNode();
+    popNode(); // type
+    Modifiers modifiers = popNode();
+    PartialFunctionElement element = new PartialFunctionElement(
+        name.source, beginToken, getOrSet, endToken,
+        modifiers, compilationUnitElement);
+    element.hasParseError = hasParseError;
+    pushElement(element);
+  }
+
+  void endTopLevelFields(int count, Token beginToken, Token endToken) {
+    bool hasParseError = currentMemberHasParseError;
+    memberErrors = memberErrors.tail;
+    void buildFieldElement(Identifier name, VariableList fields) {
+      pushElement(
+          new FieldElementX(name, compilationUnitElement, fields));
+    }
+    NodeList variables = makeNodeList(count, null, null, ",");
+    popNode(); // type
+    Modifiers modifiers = popNode();
+    buildFieldElements(modifiers, variables, compilationUnitElement,
+                       buildFieldElement,
+                       beginToken, endToken, hasParseError);
+  }
+
+  void buildFieldElements(Modifiers modifiers,
+                          NodeList variables,
+                          Element enclosingElement,
+                          void buildFieldElement(Identifier name,
+                                                 VariableList fields),
+                          Token beginToken, Token endToken,
+                          bool hasParseError) {
+    VariableList fields =
+        new PartialFieldList(beginToken, endToken, modifiers, hasParseError);
+    for (Link<Node> variableNodes = variables.nodes;
+         !variableNodes.isEmpty;
+         variableNodes = variableNodes.tail) {
+      Expression initializedIdentifier = variableNodes.head;
+      Identifier identifier = initializedIdentifier.asIdentifier();
+      if (identifier == null) {
+        identifier = initializedIdentifier.asSendSet().selector.asIdentifier();
+      }
+      buildFieldElement(identifier, fields);
+    }
+  }
+
+  void handleIdentifier(Token token) {
+    pushNode(new Identifier(token));
+  }
+
+  void handleQualified(Token period) {
+    Identifier last = popNode();
+    Expression first = popNode();
+    pushNode(new Send(first, last));
+  }
+
+  void handleNoType(Token token) {
+    pushNode(null);
+  }
+
+  void endTypeVariable(Token token) {
+    TypeAnnotation bound = popNode();
+    Identifier name = popNode();
+    pushNode(new TypeVariable(name, bound));
+    rejectBuiltInIdentifier(name);
+  }
+
+  void endTypeVariables(int count, Token beginToken, Token endToken) {
+    pushNode(makeNodeList(count, beginToken, endToken, ','));
+  }
+
+  void handleNoTypeVariables(token) {
+    pushNode(null);
+  }
+
+  void endTypeArguments(int count, Token beginToken, Token endToken) {
+    pushNode(makeNodeList(count, beginToken, endToken, ','));
+  }
+
+  void handleNoTypeArguments(Token token) {
+    pushNode(null);
+  }
+
+  void endType(Token beginToken, Token endToken) {
+    NodeList typeArguments = popNode();
+    Expression typeName = popNode();
+    pushNode(new TypeAnnotation(typeName, typeArguments));
+  }
+
+  void handleParenthesizedExpression(BeginGroupToken token) {
+    Expression expression = popNode();
+    pushNode(new ParenthesizedExpression(expression, token));
+  }
+
+  void handleModifier(Token token) {
+    pushNode(new Identifier(token));
+  }
+
+  void handleModifiers(int count) {
+    if (count == 0) {
+      pushNode(Modifiers.EMPTY);
+    } else {
+      NodeList modifierNodes = makeNodeList(count, null, null, ' ');
+      pushNode(new Modifiers(modifierNodes));
+    }
+  }
+
+  Token expected(String string, Token token) {
+    if (token is ErrorToken) {
+      reportErrorToken(token);
+    } else if (identical(';', string)) {
+      // When a semicolon is missing, it often leads to an error on the
+      // following line. So we try to find the token preceding the semicolon
+      // and report that something is missing *after* it.
+      Token preceding = findPrecedingToken(token);
+      if (preceding == token) {
+        reportError(
+            token, MessageKind.MISSING_TOKEN_BEFORE_THIS, {'token': string});
+      } else {
+        reportError(
+            preceding, MessageKind.MISSING_TOKEN_AFTER_THIS, {'token': string});
+      }
+      return token;
+    } else {
+      reportFatalError(
+          token,
+          MessageTemplate.TEMPLATES[MessageKind.MISSING_TOKEN_BEFORE_THIS]
+              .message({'token': string}, true).toString());
+    }
+    return skipToEof(token);
+  }
+
+  /// Finds the preceding token via the begin token of the last AST node pushed
+  /// on the [nodes] stack.
+  Token findPrecedingToken(Token token) {
+    Token result;
+    Link<Node> nodes = this.nodes;
+    while (!nodes.isEmpty) {
+      result = findPrecedingTokenFromNode(nodes.head, token);
+      if (result != null) {
+        return result;
+      }
+      nodes = nodes.tail;
+    }
+    if (compilationUnitElement != null) {
+      if (compilationUnitElement is CompilationUnitElementX) {
+        CompilationUnitElementX unit = compilationUnitElement;
+        Link<Element> members = unit.localMembers;
+        while (!members.isEmpty) {
+          ElementX member = members.head;
+          DeclarationSite site = member.declarationSite;
+          if (site is PartialElement) {
+            result = findPrecedingTokenFromToken(site.endToken, token);
+            if (result != null) {
+              return result;
+            }
+          }
+          members = members.tail;
+        }
+        result =
+            findPrecedingTokenFromNode(compilationUnitElement.partTag, token);
+        if (result != null) {
+          return result;
+        }
+      }
+    }
+    return token;
+  }
+
+  Token findPrecedingTokenFromNode(Node node, Token token) {
+    if (node != null) {
+      return findPrecedingTokenFromToken(node.getBeginToken(), token);
+    }
+    return null;
+  }
+
+  Token findPrecedingTokenFromToken(Token start, Token token) {
+    if (start != null) {
+      Token current = start;
+      while (current.kind != Tokens.EOF_TOKEN && current.next != token) {
+        current = current.next;
+      }
+      if (current.kind != Tokens.EOF_TOKEN) {
+        return current;
+      }
+    }
+    return null;
+  }
+
+  Token expectedIdentifier(Token token) {
+    if (token is KeywordToken) {
+      reportError(
+          token, MessageKind.EXPECTED_IDENTIFIER_NOT_RESERVED_WORD,
+          {'keyword': token.value});
+    } else if (token is ErrorToken) {
+      reportErrorToken(token);
+      return synthesizeIdentifier(token);
+    } else {
+      reportFatalError(token,
+          "Expected identifier, but got '${token.value}'.");
+    }
+    return token;
+  }
+
+  Token expectedType(Token token) {
+    pushNode(null);
+    if (token is ErrorToken) {
+      reportErrorToken(token);
+      return synthesizeIdentifier(token);
+    } else {
+      reportFatalError(
+          token, "Expected a type, but got '${token.value}'.");
+      return skipToEof(token);
+    }
+  }
+
+  Token expectedExpression(Token token) {
+    if (token is ErrorToken) {
+      reportErrorToken(token);
+      pushNode(new ErrorExpression(token));
+      return token.next;
+    } else {
+      reportFatalError(token,
+                       "Expected an expression, but got '${token.value}'.");
+      pushNode(null);
+      return skipToEof(token);
+    }
+  }
+
+  Token unexpected(Token token) {
+    if (token is ErrorToken) {
+      reportErrorToken(token);
+    } else {
+      String message = "Unexpected token '${token.value}'.";
+      if (token.info == Precedence.BAD_INPUT_INFO) {
+        message = token.value;
+      }
+      reportFatalError(token, message);
+    }
+    return skipToEof(token);
+  }
+
+  Token expectedBlockToSkip(Token token) {
+    if (identical(token.stringValue, 'native')) {
+      return native.handleNativeBlockToSkip(this, token);
+    } else {
+      return unexpected(token);
+    }
+  }
+
+  Token expectedFunctionBody(Token token) {
+    if (token is ErrorToken) {
+      reportErrorToken(token);
+    } else {
+      String printString = token.value;
+      reportFatalError(token,
+                       "Expected a function body, but got '$printString'.");
+    }
+    return skipToEof(token);
+  }
+
+  Token expectedClassBody(Token token) {
+    if (token is ErrorToken) {
+      reportErrorToken(token);
+    } else {
+      reportFatalError(token,
+                       "Expected a class body, but got '${token.value}'.");
+    }
+    return skipToEof(token);
+  }
+
+  Token expectedClassBodyToSkip(Token token) {
+    return unexpected(token);
+  }
+
+  Token expectedDeclaration(Token token) {
+    if (token is ErrorToken) {
+      reportErrorToken(token);
+    } else {
+      reportFatalError(token,
+                       "Expected a declaration, but got '${token.value}'.");
+    }
+    return skipToEof(token);
+  }
+
+  Token unmatched(Token token) {
+    if (token is ErrorToken) {
+      reportErrorToken(token);
+    } else {
+      String begin = token.value;
+      String end = closeBraceFor(begin);
+      reportError(
+          token, MessageKind.UNMATCHED_TOKEN, {'begin': begin, 'end': end});
+    }
+    Token next = token.next;
+    while (next is ErrorToken) {
+      next = next.next;
+    }
+    return next;
+  }
+
+  void recoverableError(Spannable node, String message) {
+    // TODO(johnniwinther): Make recoverable errors non-fatal.
+    reportFatalError(node, message);
+  }
+
+  void pushElement(Element element) {
+    popMetadata(element);
+    compilationUnitElement.addMember(element, reporter);
+  }
+
+  List<MetadataAnnotation> popMetadata(ElementX element) {
+    List<MetadataAnnotation> result = metadata.toList();
+    element.metadata = result;
+    metadata.clear();
+    return result;
+  }
+
+  void pushMetadata(MetadataAnnotation annotation) {
+    metadata.addLast(annotation);
+  }
+
+  void addLibraryTag(LibraryTag tag) {
+    if (!allowLibraryTags()) {
+      recoverableError(tag, 'Library tags not allowed here.');
+    }
+    LibraryElementX implementationLibrary =
+        compilationUnitElement.implementationLibrary;
+    implementationLibrary.addTag(tag, reporter);
+  }
+
+  void pushNode(Node node) {
+    nodes = nodes.prepend(node);
+    if (VERBOSE) log("push $nodes");
+  }
+
+  Node popNode() {
+    assert(!nodes.isEmpty);
+    Node node = nodes.head;
+    nodes = nodes.tail;
+    if (VERBOSE) log("pop $nodes");
+    return node;
+  }
+
+  void log(message) {
+    print(message);
+  }
+
+  NodeList makeNodeList(int count, Token beginToken, Token endToken,
+                        String delimiter) {
+    Link<Node> poppedNodes = const Link<Node>();
+    for (; count > 0; --count) {
+      // This effectively reverses the order of nodes so they end up
+      // in correct (source) order.
+      poppedNodes = poppedNodes.prepend(popNode());
+    }
+    return new NodeList(beginToken, poppedNodes, endToken, delimiter);
+  }
+
+  void beginLiteralString(Token token) {
+    String source = token.value;
+    StringQuoting quoting = StringValidator.quotingFromString(source);
+    pushQuoting(quoting);
+    // Just wrap the token for now. At the end of the interpolation,
+    // when we know how many there are, go back and validate the tokens.
+    pushNode(new LiteralString(token, null));
+  }
+
+  void handleStringPart(Token token) {
+    // Just push an unvalidated token now, and replace it when we know the
+    // end of the interpolation.
+    pushNode(new LiteralString(token, null));
+  }
+
+  void endLiteralString(int count) {
+    StringQuoting quoting = popQuoting();
+
+    Link<StringInterpolationPart> parts =
+        const Link<StringInterpolationPart>();
+    // Parts of the string interpolation are popped in reverse order,
+    // starting with the last literal string part.
+    bool isLast = true;
+    for (int i = 0; i < count; i++) {
+      LiteralString string = popNode();
+      DartString validation =
+          stringValidator.validateInterpolationPart(string.token, quoting,
+                                                    isFirst: false,
+                                                    isLast: isLast);
+      // Replace the unvalidated LiteralString with a new LiteralString
+      // object that has the validation result included.
+      string = new LiteralString(string.token, validation);
+      Expression expression = popNode();
+      parts = parts.prepend(new StringInterpolationPart(expression, string));
+      isLast = false;
+    }
+
+    LiteralString string = popNode();
+    DartString validation =
+        stringValidator.validateInterpolationPart(string.token, quoting,
+                                                  isFirst: true,
+                                                  isLast: isLast);
+    string = new LiteralString(string.token, validation);
+    if (isLast) {
+      pushNode(string);
+    } else {
+      NodeList partNodes = new NodeList(null, parts, null, "");
+      pushNode(new StringInterpolation(string, partNodes));
+    }
+  }
+
+  void handleStringJuxtaposition(int stringCount) {
+    assert(stringCount != 0);
+    Expression accumulator = popNode();
+    stringCount--;
+    while (stringCount > 0) {
+      Expression expression = popNode();
+      accumulator = new StringJuxtaposition(expression, accumulator);
+      stringCount--;
+    }
+    pushNode(accumulator);
+  }
+
+  void beginMember(Token token) {
+    memberErrors = memberErrors.prepend(false);
+  }
+
+  void beginTopLevelMember(Token token) {
+    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) {
+    memberErrors = memberErrors.tail;
+  }
+
+  /// Don't call this method. Should only be used as a last resort when there
+  /// is no feasible way to recover from a parser error.
+  void reportFatalError(Spannable spannable, String message) {
+    reportError(spannable, MessageKind.GENERIC, {'text': message});
+    // Some parse errors are infeasible to recover from, so we throw an error.
+    throw new ParserError(message);
+  }
+
+  void reportError(Spannable spannable,
+                   MessageKind errorCode,
+                   [Map arguments = const {}]) {
+    if (currentMemberHasParseError) return; // Error already reported.
+    if (suppressParseErrors) return;
+    if (!memberErrors.isEmpty) {
+      memberErrors = memberErrors.tail.prepend(true);
+    }
+    reporter.reportErrorMessage(spannable, errorCode, arguments);
+  }
+}
diff --git a/pkg/compiler/lib/src/parser/listener.dart b/pkg/compiler/lib/src/parser/listener.dart
new file mode 100644
index 0000000..6511abc
--- /dev/null
+++ b/pkg/compiler/lib/src/parser/listener.dart
@@ -0,0 +1,793 @@
+// Copyright (c) 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.parser.listener;
+
+import '../common.dart';
+import '../diagnostics/messages.dart' show
+    MessageTemplate;
+import '../tokens/precedence_constants.dart' as Precedence show
+    EOF_INFO,
+    IDENTIFIER_INFO;
+import '../tokens/token.dart' show
+    BadInputToken,
+    BeginGroupToken,
+    ErrorToken,
+    StringToken,
+    Token,
+    UnmatchedToken,
+    UnterminatedToken;
+import '../tree/tree.dart';
+
+const bool VERBOSE = false;
+
+/**
+ * A parser event listener that does nothing except throw exceptions
+ * on parser errors.
+ */
+class Listener {
+  set suppressParseErrors(bool value) {
+  }
+
+  void beginArguments(Token token) {
+  }
+
+  void endArguments(int count, Token beginToken, Token endToken) {
+  }
+
+  /// Handle async modifiers `async`, `async*`, `sync`.
+  void handleAsyncModifier(Token asyncToken, Token startToken) {
+  }
+
+  void beginAwaitExpression(Token token) {
+  }
+
+  void endAwaitExpression(Token beginToken, Token endToken) {
+  }
+
+  void beginBlock(Token token) {
+  }
+
+  void endBlock(int count, Token beginToken, Token endToken) {
+  }
+
+  void beginCascade(Token token) {
+  }
+
+  void endCascade() {
+  }
+
+  void beginClassBody(Token token) {
+  }
+
+  void endClassBody(int memberCount, Token beginToken, Token endToken) {
+  }
+
+  void beginClassDeclaration(Token token) {
+  }
+
+  void endClassDeclaration(int interfacesCount, Token beginToken,
+                           Token extendsKeyword, Token implementsKeyword,
+                           Token endToken) {
+  }
+
+  void beginCombinators(Token token) {
+  }
+
+  void endCombinators(int count) {
+  }
+
+  void beginCompilationUnit(Token token) {
+  }
+
+  void endCompilationUnit(int count, Token token) {
+  }
+
+  void beginConstructorReference(Token start) {
+  }
+
+  void endConstructorReference(Token start, Token periodBeforeName,
+                               Token endToken) {
+  }
+
+  void beginDoWhileStatement(Token token) {
+  }
+
+  void endDoWhileStatement(Token doKeyword, Token whileKeyword,
+                           Token endToken) {
+  }
+
+  void beginEnum(Token enumKeyword) {
+  }
+
+  void endEnum(Token enumKeyword, Token endBrace, int count) {
+  }
+
+  void beginExport(Token token) {
+  }
+
+  void endExport(Token exportKeyword, Token semicolon) {
+  }
+
+  void beginExpressionStatement(Token token) {
+  }
+
+  void endExpressionStatement(Token token) {
+  }
+
+  void beginFactoryMethod(Token token) {
+  }
+
+  void endFactoryMethod(Token beginToken, Token endToken) {
+  }
+
+  void beginFormalParameter(Token token) {
+  }
+
+  void endFormalParameter(Token thisKeyword) {
+  }
+
+  void handleNoFormalParameters(Token token) {
+  }
+
+  void beginFormalParameters(Token token) {
+  }
+
+  void endFormalParameters(int count, Token beginToken, Token endToken) {
+  }
+
+  void endFields(int count, Token beginToken, Token endToken) {
+  }
+
+  void beginForStatement(Token token) {
+  }
+
+  void endForStatement(int updateExpressionCount,
+                       Token beginToken, Token endToken) {
+  }
+
+  void endForIn(Token awaitToken, Token forToken,
+                Token inKeyword, Token endToken) {
+  }
+
+  void beginFunction(Token token) {
+  }
+
+  void endFunction(Token getOrSet, Token endToken) {
+  }
+
+  void beginFunctionDeclaration(Token token) {
+  }
+
+  void endFunctionDeclaration(Token token) {
+  }
+
+  void beginFunctionBody(Token token) {
+  }
+
+  void endFunctionBody(int count, Token beginToken, Token endToken) {
+  }
+
+  void handleNoFunctionBody(Token token) {
+  }
+
+  void skippedFunctionBody(Token token) {
+  }
+
+  void beginFunctionName(Token token) {
+  }
+
+  void endFunctionName(Token token) {
+  }
+
+  void beginFunctionTypeAlias(Token token) {
+  }
+
+  void endFunctionTypeAlias(Token typedefKeyword, Token endToken) {
+  }
+
+  void beginMixinApplication(Token token) {
+  }
+
+  void endMixinApplication() {
+  }
+
+  void beginNamedMixinApplication(Token token) {
+  }
+
+  void endNamedMixinApplication(Token classKeyword,
+                                Token implementsKeyword,
+                                Token endToken) {
+  }
+
+  void beginHide(Token hideKeyword) {
+  }
+
+  void endHide(Token hideKeyword) {
+  }
+
+  void beginIdentifierList(Token token) {
+  }
+
+  void endIdentifierList(int count) {
+  }
+
+  void beginTypeList(Token token) {
+  }
+
+  void endTypeList(int count) {
+  }
+
+  void beginIfStatement(Token token) {
+  }
+
+  void endIfStatement(Token ifToken, Token elseToken) {
+  }
+
+  void beginImport(Token importKeyword) {
+  }
+
+  void endImport(Token importKeyword, Token DeferredKeyword,
+                 Token asKeyword, Token semicolon) {
+  }
+
+  void beginInitializedIdentifier(Token token) {
+  }
+
+  void endInitializedIdentifier() {
+  }
+
+  void beginInitializer(Token token) {
+  }
+
+  void endInitializer(Token assignmentOperator) {
+  }
+
+  void beginInitializers(Token token) {
+  }
+
+  void endInitializers(int count, Token beginToken, Token endToken) {
+  }
+
+  void handleNoInitializers() {
+  }
+
+  void handleLabel(Token token) {
+  }
+
+  void beginLabeledStatement(Token token, int labelCount) {
+  }
+
+  void endLabeledStatement(int labelCount) {
+  }
+
+  void beginLibraryName(Token token) {
+  }
+
+  void endLibraryName(Token libraryKeyword, Token semicolon) {
+  }
+
+  void beginLiteralMapEntry(Token token) {
+  }
+
+  void endLiteralMapEntry(Token colon, Token endToken) {
+  }
+
+  void beginLiteralString(Token token) {
+  }
+
+  void endLiteralString(int interpolationCount) {
+  }
+
+  void handleStringJuxtaposition(int literalCount) {
+  }
+
+  void beginMember(Token token) {
+  }
+
+  void endMethod(Token getOrSet, Token beginToken, Token endToken) {
+  }
+
+  void beginMetadataStar(Token token) {
+  }
+
+  void endMetadataStar(int count, bool forParameter) {
+  }
+
+  void beginMetadata(Token token) {
+  }
+
+  void endMetadata(Token beginToken, Token periodBeforeName, Token endToken) {
+  }
+
+  void beginOptionalFormalParameters(Token token) {
+  }
+
+  void endOptionalFormalParameters(int count,
+                                   Token beginToken, Token endToken) {
+  }
+
+  void beginPart(Token token) {
+  }
+
+  void endPart(Token partKeyword, Token semicolon) {
+  }
+
+  void beginPartOf(Token token) {
+  }
+
+  void endPartOf(Token partKeyword, Token semicolon) {
+  }
+
+  void beginRedirectingFactoryBody(Token token) {
+  }
+
+  void endRedirectingFactoryBody(Token beginToken, Token endToken) {
+  }
+
+  void beginReturnStatement(Token token) {
+  }
+
+  void endReturnStatement(bool hasExpression,
+                          Token beginToken, Token endToken) {
+  }
+
+  void beginSend(Token token) {
+  }
+
+  void endSend(Token token) {
+  }
+
+  void beginShow(Token showKeyword) {
+  }
+
+  void endShow(Token showKeyword) {
+  }
+
+  void beginSwitchStatement(Token token) {
+  }
+
+  void endSwitchStatement(Token switchKeyword, Token endToken) {
+  }
+
+  void beginSwitchBlock(Token token) {
+  }
+
+  void endSwitchBlock(int caseCount, Token beginToken, Token endToken) {
+  }
+
+  void beginLiteralSymbol(Token token) {
+  }
+
+  void endLiteralSymbol(Token hashToken, int identifierCount) {
+  }
+
+  void beginThrowExpression(Token token) {
+  }
+
+  void endThrowExpression(Token throwToken, Token endToken) {
+  }
+
+  void beginRethrowStatement(Token token) {
+  }
+
+  void endRethrowStatement(Token throwToken, Token endToken) {
+  }
+
+  void endTopLevelDeclaration(Token token) {
+  }
+
+  void beginTopLevelMember(Token token) {
+  }
+
+  void endTopLevelFields(int count, Token beginToken, Token endToken) {
+  }
+
+  void endTopLevelMethod(Token beginToken, Token getOrSet, Token endToken) {
+  }
+
+  void beginTryStatement(Token token) {
+  }
+
+  void handleCaseMatch(Token caseKeyword, Token colon) {
+  }
+
+  void handleCatchBlock(Token onKeyword, Token catchKeyword) {
+  }
+
+  void handleFinallyBlock(Token finallyKeyword) {
+  }
+
+  void endTryStatement(int catchCount, Token tryKeyword, Token finallyKeyword) {
+  }
+
+  void endType(Token beginToken, Token endToken) {
+  }
+
+  void beginTypeArguments(Token token) {
+  }
+
+  void endTypeArguments(int count, Token beginToken, Token endToken) {
+  }
+
+  void handleNoTypeArguments(Token token) {
+  }
+
+  void beginTypeVariable(Token token) {
+  }
+
+  void endTypeVariable(Token token) {
+  }
+
+  void beginTypeVariables(Token token) {
+  }
+
+  void endTypeVariables(int count, Token beginToken, Token endToken) {
+  }
+
+  void beginUnnamedFunction(Token token) {
+  }
+
+  void endUnnamedFunction(Token token) {
+  }
+
+  void beginVariablesDeclaration(Token token) {
+  }
+
+  void endVariablesDeclaration(int count, Token endToken) {
+  }
+
+  void beginWhileStatement(Token token) {
+  }
+
+  void endWhileStatement(Token whileKeyword, Token endToken) {
+  }
+
+  void handleAsOperator(Token operathor, Token endToken) {
+    // TODO(ahe): Rename [operathor] to "operator" when VM bug is fixed.
+  }
+
+  void handleAssignmentExpression(Token token) {
+  }
+
+  void handleBinaryExpression(Token token) {
+  }
+
+  void handleConditionalExpression(Token question, Token colon) {
+  }
+
+  void handleConstExpression(Token token) {
+  }
+
+  void handleFunctionTypedFormalParameter(Token token) {
+  }
+
+  void handleIdentifier(Token token) {
+  }
+
+  void handleIndexedExpression(Token openCurlyBracket,
+                               Token closeCurlyBracket) {
+  }
+
+  void handleIsOperator(Token operathor, Token not, Token endToken) {
+    // TODO(ahe): Rename [operathor] to "operator" when VM bug is fixed.
+  }
+
+  void handleLiteralBool(Token token) {
+  }
+
+  void handleBreakStatement(bool hasTarget,
+                            Token breakKeyword, Token endToken) {
+  }
+
+  void handleContinueStatement(bool hasTarget,
+                               Token continueKeyword, Token endToken) {
+  }
+
+  void handleEmptyStatement(Token token) {
+  }
+
+  void handleAssertStatement(Token assertKeyword,
+                             Token commaToken, Token semicolonToken) {
+  }
+
+  /** Called with either the token containing a double literal, or
+    * an immediately preceding "unary plus" token.
+    */
+  void handleLiteralDouble(Token token) {
+  }
+
+  /** Called with either the token containing an integer literal,
+    * or an immediately preceding "unary plus" token.
+    */
+  void handleLiteralInt(Token token) {
+  }
+
+  void handleLiteralList(int count, Token beginToken, Token constKeyword,
+                         Token endToken) {
+  }
+
+  void handleLiteralMap(int count, Token beginToken, Token constKeyword,
+                        Token endToken) {
+  }
+
+  void handleLiteralNull(Token token) {
+  }
+
+  void handleModifier(Token token) {
+  }
+
+  void handleModifiers(int count) {
+  }
+
+  void handleNamedArgument(Token colon) {
+  }
+
+  void handleNewExpression(Token token) {
+  }
+
+  void handleNoArguments(Token token) {
+  }
+
+  void handleNoExpression(Token token) {
+  }
+
+  void handleNoType(Token token) {
+  }
+
+  void handleNoTypeVariables(Token token) {
+  }
+
+  void handleOperator(Token token) {
+  }
+
+  void handleOperatorName(Token operatorKeyword, Token token) {
+  }
+
+  void handleParenthesizedExpression(BeginGroupToken token) {
+  }
+
+  void handleQualified(Token period) {
+  }
+
+  void handleStringPart(Token token) {
+  }
+
+  void handleSuperExpression(Token token) {
+  }
+
+  void handleSwitchCase(int labelCount, int expressionCount,
+                        Token defaultKeyword, int statementCount,
+                        Token firstToken, Token endToken) {
+  }
+
+  void handleThisExpression(Token token) {
+  }
+
+  void handleUnaryPostfixAssignmentExpression(Token token) {
+  }
+
+  void handleUnaryPrefixExpression(Token token) {
+  }
+
+  void handleUnaryPrefixAssignmentExpression(Token token) {
+  }
+
+  void handleValuedFormalParameter(Token equals, Token token) {
+  }
+
+  void handleVoidKeyword(Token token) {
+  }
+
+  void beginYieldStatement(Token token) {
+  }
+
+  void endYieldStatement(Token yieldToken, Token starToken, Token endToken) {
+  }
+
+  Token expected(String string, Token token) {
+    if (token is ErrorToken) {
+      reportErrorToken(token);
+    } else {
+      error("expected '$string', but got '${token.value}'", token);
+    }
+    return skipToEof(token);
+  }
+
+  Token synthesizeIdentifier(Token token) {
+    Token synthesizedToken =
+        new StringToken.fromString(
+            Precedence.IDENTIFIER_INFO, '?', token.charOffset);
+    synthesizedToken.next = token.next;
+    return synthesizedToken;
+  }
+
+  Token expectedIdentifier(Token token) {
+    if (token is ErrorToken) {
+      reportErrorToken(token);
+    } else {
+      error("expected identifier, but got '${token.value}'", token);
+    }
+    return skipToEof(token);
+  }
+
+  Token expectedType(Token token) {
+    if (token is ErrorToken) {
+      reportErrorToken(token);
+    } else {
+      error("expected a type, but got '${token.value}'", token);
+    }
+    return skipToEof(token);
+  }
+
+  Token expectedExpression(Token token) {
+    if (token is ErrorToken) {
+      reportErrorToken(token);
+    } else {
+      error("expected an expression, but got '${token.value}'", token);
+    }
+    return skipToEof(token);
+  }
+
+  Token unexpected(Token token) {
+    if (token is ErrorToken) {
+      reportErrorToken(token);
+    } else {
+      error("unexpected token '${token.value}'", token);
+    }
+    return skipToEof(token);
+  }
+
+  Token expectedBlockToSkip(Token token) {
+    if (token is ErrorToken) {
+      reportErrorToken(token);
+    } else {
+      error("expected a block, but got '${token.value}'", token);
+    }
+    return skipToEof(token);
+  }
+
+  Token expectedFunctionBody(Token token) {
+    if (token is ErrorToken) {
+      reportErrorToken(token);
+    } else {
+      error("expected a function body, but got '${token.value}'", token);
+    }
+    return skipToEof(token);
+  }
+
+  Token expectedClassBody(Token token) {
+    if (token is ErrorToken) {
+      reportErrorToken(token);
+    } else {
+      error("expected a class body, but got '${token.value}'", token);
+    }
+    return skipToEof(token);
+  }
+
+  Token expectedClassBodyToSkip(Token token) {
+    if (token is ErrorToken) {
+      reportErrorToken(token);
+    } else {
+      error("expected a class body, but got '${token.value}'", token);
+    }
+    return skipToEof(token);
+  }
+
+  Token expectedDeclaration(Token token) {
+    if (token is ErrorToken) {
+      reportErrorToken(token);
+    } else {
+      error("expected a declaration, but got '${token.value}'", token);
+    }
+    return skipToEof(token);
+  }
+
+  Token unmatched(Token token) {
+    if (token is ErrorToken) {
+      reportErrorToken(token);
+    } else {
+      error("unmatched '${token.value}'", token);
+    }
+    return skipToEof(token);
+  }
+
+  skipToEof(Token token) {
+    while (!identical(token.info, Precedence.EOF_INFO)) {
+      token = token.next;
+    }
+    return token;
+  }
+
+  void recoverableError(Token token, String message) {
+    error(message, token);
+  }
+
+  void error(String message, Token token) {
+    throw new ParserError("$message @ ${token.charOffset}");
+  }
+
+  void reportError(Spannable spannable,
+                   MessageKind messageKind,
+                   [Map arguments = const {}]) {
+    MessageTemplate template = MessageTemplate.TEMPLATES[messageKind];
+    String message = template.message(arguments, true).toString();
+    Token token;
+    if (spannable is Token) {
+      token = spannable;
+    } else if (spannable is Node) {
+      token = spannable.getBeginToken();
+    } else {
+      throw new ParserError(message);
+    }
+    recoverableError(token, message);
+  }
+
+  void reportErrorToken(ErrorToken token) {
+    if (token is BadInputToken) {
+      String hex = token.character.toRadixString(16);
+      if (hex.length < 4) {
+        String padding = "0000".substring(hex.length);
+        hex = "$padding$hex";
+      }
+      reportError(
+          token, MessageKind.BAD_INPUT_CHARACTER, {'characterHex': hex});
+    } else if (token is UnterminatedToken) {
+      MessageKind kind;
+      var arguments = const {};
+      switch (token.start) {
+        case '1e':
+          kind = MessageKind.EXPONENT_MISSING;
+          break;
+        case '"':
+        case "'":
+        case '"""':
+        case "'''":
+        case 'r"':
+        case "r'":
+        case 'r"""':
+        case "r'''":
+          kind = MessageKind.UNTERMINATED_STRING;
+          arguments = {'quote': token.start};
+          break;
+        case '0x':
+          kind = MessageKind.HEX_DIGIT_EXPECTED;
+          break;
+        case r'$':
+          kind = MessageKind.MALFORMED_STRING_LITERAL;
+          break;
+        case '/*':
+          kind = MessageKind.UNTERMINATED_COMMENT;
+          break;
+        default:
+          kind = MessageKind.UNTERMINATED_TOKEN;
+          break;
+      }
+      reportError(token, kind, arguments);
+    } else if (token is UnmatchedToken) {
+      String begin = token.begin.value;
+      String end = closeBraceFor(begin);
+      reportError(
+          token, MessageKind.UNMATCHED_TOKEN, {'begin': begin, 'end': end});
+    } else {
+      throw new SpannableAssertionFailure(token, token.assertionMessage);
+    }
+  }
+}
+
+String closeBraceFor(String openBrace) {
+  return const {
+    '(': ')',
+    '[': ']',
+    '{': '}',
+    '<': '>',
+    r'${': '}',
+  }[openBrace];
+}
+
+class ParserError {
+  final String reason;
+  ParserError(this.reason);
+  toString() => reason;
+}
diff --git a/pkg/compiler/lib/src/parser/member_listener.dart b/pkg/compiler/lib/src/parser/member_listener.dart
new file mode 100644
index 0000000..a6856b3
--- /dev/null
+++ b/pkg/compiler/lib/src/parser/member_listener.dart
@@ -0,0 +1,169 @@
+// 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 dart2js.parser.member_listener;
+
+import '../common.dart';
+import '../elements/elements.dart' show
+    Element,
+    ElementKind,
+    Elements,
+    MetadataAnnotation;
+import '../elements/modelx.dart' show
+    ClassElementX,
+    ElementX,
+    FieldElementX,
+    VariableList;
+import '../tokens/token.dart' show
+    Token;
+import '../tree/tree.dart';
+
+import 'partial_elements.dart' show
+    PartialConstructorElement,
+    PartialFunctionElement,
+    PartialMetadataAnnotation;
+import 'node_listener.dart' show
+    NodeListener;
+
+class MemberListener extends NodeListener {
+  final ClassElementX enclosingClass;
+
+  MemberListener(DiagnosticReporter listener,
+                 ClassElementX enclosingElement)
+      : this.enclosingClass = enclosingElement,
+        super(listener, enclosingElement.compilationUnit);
+
+  bool isConstructorName(Node nameNode) {
+    if (enclosingClass == null ||
+        enclosingClass.kind != ElementKind.CLASS) {
+      return false;
+    }
+    String name;
+    if (nameNode.asIdentifier() != null) {
+      name = nameNode.asIdentifier().source;
+    } else {
+      Send send = nameNode.asSend();
+      name = send.receiver.asIdentifier().source;
+    }
+    return enclosingClass.name == name;
+  }
+
+  // TODO(johnniwinther): Remove this method.
+  String getMethodNameHack(Node methodName) {
+    Send send = methodName.asSend();
+    if (send == null) {
+      if (isConstructorName(methodName)) return '';
+      return methodName.asIdentifier().source;
+    }
+    Identifier receiver = send.receiver.asIdentifier();
+    Identifier selector = send.selector.asIdentifier();
+    Operator operator = selector.asOperator();
+    if (operator != null) {
+      assert(identical(receiver.source, 'operator'));
+      // TODO(ahe): It is a hack to compare to ')', but it beats
+      // parsing the node.
+      bool isUnary = identical(operator.token.next.next.stringValue, ')');
+      return Elements.constructOperatorName(operator.source, isUnary);
+    } else {
+      if (receiver == null || receiver.source != enclosingClass.name) {
+        reporter.reportErrorMessage(
+            send.receiver,
+            MessageKind.INVALID_CONSTRUCTOR_NAME,
+            {'name': enclosingClass.name});
+      }
+      return selector.source;
+    }
+  }
+
+  void endMethod(Token getOrSet, Token beginToken, Token endToken) {
+    super.endMethod(getOrSet, beginToken, endToken);
+    FunctionExpression method = popNode();
+    pushNode(null);
+    bool isConstructor = isConstructorName(method.name);
+    String name = getMethodNameHack(method.name);
+    Element memberElement;
+    if (isConstructor) {
+      if (getOrSet != null) {
+        recoverableError(getOrSet, 'illegal modifier');
+      }
+      memberElement = new PartialConstructorElement(
+          name, beginToken, endToken,
+          ElementKind.GENERATIVE_CONSTRUCTOR,
+          method.modifiers,
+          enclosingClass);
+    } else {
+      memberElement = new PartialFunctionElement(
+          name, beginToken, getOrSet, endToken,
+          method.modifiers, enclosingClass, hasBody: method.hasBody());
+    }
+    addMember(memberElement);
+  }
+
+  void endFactoryMethod(Token beginToken, Token endToken) {
+    super.endFactoryMethod(beginToken, endToken);
+    FunctionExpression method = popNode();
+    pushNode(null);
+    String name = getMethodNameHack(method.name);
+    Identifier singleIdentifierName = method.name.asIdentifier();
+    if (singleIdentifierName != null && singleIdentifierName.source == name) {
+      if (name != enclosingClass.name) {
+        reporter.reportErrorMessage(
+            singleIdentifierName,
+            MessageKind.INVALID_UNNAMED_CONSTRUCTOR_NAME,
+            {'name': enclosingClass.name});
+      }
+    }
+    Element memberElement = new PartialConstructorElement(
+        name, beginToken, endToken,
+        ElementKind.FUNCTION,
+        method.modifiers,
+        enclosingClass);
+    addMember(memberElement);
+  }
+
+  void endFields(int count, Token beginToken, Token endToken) {
+    bool hasParseError = memberErrors.head;
+    super.endFields(count, beginToken, endToken);
+    VariableDefinitions variableDefinitions = popNode();
+    Modifiers modifiers = variableDefinitions.modifiers;
+    pushNode(null);
+    void buildFieldElement(Identifier name, VariableList fields) {
+      Element element =
+          new FieldElementX(name, enclosingClass, fields);
+      addMember(element);
+    }
+    buildFieldElements(modifiers, variableDefinitions.definitions,
+                       enclosingClass,
+                       buildFieldElement, beginToken, endToken,
+                       hasParseError);
+  }
+
+  void endInitializer(Token assignmentOperator) {
+    pushNode(null); // Super expects an expression, but
+                    // ClassElementParser just skips expressions.
+    super.endInitializer(assignmentOperator);
+  }
+
+  void endInitializers(int count, Token beginToken, Token endToken) {
+    pushNode(null);
+  }
+
+  void addMetadata(ElementX memberElement) {
+    memberElement.metadata = metadata.toList();
+  }
+
+  void addMember(ElementX memberElement) {
+    addMetadata(memberElement);
+    enclosingClass.addMember(memberElement, reporter);
+  }
+
+  void endMetadata(Token beginToken, Token periodBeforeName, Token endToken) {
+    popNode(); // Discard arguments.
+    if (periodBeforeName != null) {
+      popNode(); // Discard name.
+    }
+    popNode(); // Discard node (Send or Identifier).
+    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
new file mode 100644
index 0000000..c6bd18a
--- /dev/null
+++ b/pkg/compiler/lib/src/parser/node_listener.dart
@@ -0,0 +1,821 @@
+// 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 dart2js.parser.node_listener;
+
+import '../common.dart';
+import '../elements/elements.dart' show
+    CompilationUnitElement;
+import '../native/native.dart' as native;
+import '../tokens/precedence_constants.dart' as Precedence show
+    BAD_INPUT_INFO,
+    EOF_INFO,
+    INDEX_INFO;
+import '../tokens/token.dart' show
+    ErrorToken,
+    StringToken,
+    Token;
+import '../tree/tree.dart';
+import '../util/util.dart' show
+    Link;
+
+import 'element_listener.dart' show
+    ElementListener;
+import 'partial_elements.dart' show
+    PartialFunctionElement;
+
+class NodeListener extends ElementListener {
+  NodeListener(
+      DiagnosticReporter reporter,
+      CompilationUnitElement element)
+    : super(reporter, element, null);
+
+  void addLibraryTag(LibraryTag tag) {
+    pushNode(tag);
+  }
+
+  void addPartOfTag(PartOf tag) {
+    pushNode(tag);
+  }
+
+  void endClassDeclaration(int interfacesCount, Token beginToken,
+                           Token extendsKeyword, Token implementsKeyword,
+                           Token endToken) {
+    NodeList body = popNode();
+    NodeList interfaces =
+        makeNodeList(interfacesCount, implementsKeyword, null, ",");
+    Node supertype = popNode();
+    NodeList typeParameters = popNode();
+    Identifier name = popNode();
+    Modifiers modifiers = popNode();
+    pushNode(new ClassNode(modifiers, name, typeParameters, supertype,
+                           interfaces, beginToken, extendsKeyword, body,
+                           endToken));
+  }
+
+  void endCompilationUnit(int count, Token token) {
+    pushNode(makeNodeList(count, null, null, '\n'));
+  }
+
+  void endFunctionTypeAlias(Token typedefKeyword, Token endToken) {
+    NodeList formals = popNode();
+    NodeList typeParameters = popNode();
+    Identifier name = popNode();
+    TypeAnnotation returnType = popNode();
+    pushNode(new Typedef(returnType, name, typeParameters, formals,
+                         typedefKeyword, endToken));
+  }
+
+  void endNamedMixinApplication(Token classKeyword,
+                                Token implementsKeyword,
+                                Token endToken) {
+    NodeList interfaces = (implementsKeyword != null) ? popNode() : null;
+    Node mixinApplication = popNode();
+    Modifiers modifiers = popNode();
+    NodeList typeParameters = popNode();
+    Identifier name = popNode();
+    pushNode(new NamedMixinApplication(name, typeParameters,
+                                       modifiers, mixinApplication,
+                                       interfaces,
+                                       classKeyword, endToken));
+  }
+
+  void endEnum(Token enumKeyword, Token endBrace, int count) {
+    NodeList names = makeNodeList(count, enumKeyword.next.next, endBrace, ",");
+    Identifier name = popNode();
+    pushNode(new Enum(enumKeyword, name, names));
+  }
+
+  void endClassBody(int memberCount, Token beginToken, Token endToken) {
+    pushNode(makeNodeList(memberCount, beginToken, endToken, null));
+  }
+
+  void endTopLevelFields(int count, Token beginToken, Token endToken) {
+    NodeList variables = makeNodeList(count, null, endToken, ",");
+    TypeAnnotation type = popNode();
+    Modifiers modifiers = popNode();
+    pushNode(new VariableDefinitions(type, modifiers, variables));
+  }
+
+  void endTopLevelMethod(Token beginToken, Token getOrSet, Token endToken) {
+    popNode(); // body
+    popNode(); // formalParameters
+    Identifier name = popNode();
+    popNode(); // type
+    Modifiers modifiers = popNode();
+    PartialFunctionElement element = new PartialFunctionElement(
+        name.source, beginToken, getOrSet, endToken,
+        modifiers, compilationUnitElement);
+    pushElement(element);
+  }
+
+  void endFormalParameter(Token thisKeyword) {
+    Expression name = popNode();
+    if (thisKeyword != null) {
+      Identifier thisIdentifier = new Identifier(thisKeyword);
+      if (name.asSend() == null) {
+        name = new Send(thisIdentifier, name);
+      } else {
+        name = name.asSend().copyWithReceiver(thisIdentifier, false);
+      }
+    }
+    TypeAnnotation type = popNode();
+    Modifiers modifiers = popNode();
+    NodeList metadata = popNode();
+    pushNode(new VariableDefinitions.forParameter(
+        metadata, type, modifiers, new NodeList.singleton(name)));
+  }
+
+  void endFormalParameters(int count, Token beginToken, Token endToken) {
+    pushNode(makeNodeList(count, beginToken, endToken, ","));
+  }
+
+  void handleNoFormalParameters(Token token) {
+    pushNode(null);
+  }
+
+  void endArguments(int count, Token beginToken, Token endToken) {
+    pushNode(makeNodeList(count, beginToken, endToken, ","));
+  }
+
+  void handleNoArguments(Token token) {
+    pushNode(null);
+  }
+
+  void endConstructorReference(Token start, Token periodBeforeName,
+                               Token endToken) {
+    Identifier name = null;
+    if (periodBeforeName != null) {
+      name = popNode();
+    }
+    NodeList typeArguments = popNode();
+    Node classReference = popNode();
+    if (typeArguments != null) {
+      classReference = new TypeAnnotation(classReference, typeArguments);
+    } else {
+      Identifier identifier = classReference.asIdentifier();
+      Send send = classReference.asSend();
+      if (identifier != null) {
+        // TODO(ahe): Should be:
+        // classReference = new Send(null, identifier);
+        classReference = identifier;
+      } else if (send != null) {
+        classReference = send;
+      } else {
+        internalError(node: classReference);
+      }
+    }
+    Node constructor = classReference;
+    if (name != null) {
+      // Either typeName<args>.name or x.y.name.
+      constructor = new Send(classReference, name);
+    }
+    pushNode(constructor);
+  }
+
+  void endRedirectingFactoryBody(Token beginToken,
+                                 Token endToken) {
+    pushNode(new RedirectingFactoryBody(beginToken, endToken, popNode()));
+  }
+
+  void endReturnStatement(bool hasExpression,
+                          Token beginToken, Token endToken) {
+    Expression expression = hasExpression ? popNode() : null;
+    pushNode(new Return(beginToken, endToken, expression));
+  }
+
+  void endYieldStatement(Token yieldToken, Token starToken, Token endToken) {
+    Expression expression = popNode();
+    pushNode(new Yield(yieldToken, starToken, expression, endToken));
+  }
+
+  void endExpressionStatement(Token token) {
+    pushNode(new ExpressionStatement(popNode(), token));
+  }
+
+  void handleOnError(Token token, var errorInformation) {
+    reporter.internalError(token, "'${token.value}': ${errorInformation}");
+  }
+
+  Token expectedFunctionBody(Token token) {
+    if (identical(token.stringValue, 'native')) {
+      return native.handleNativeFunctionBody(this, token);
+    } else if (token is ErrorToken) {
+      pushNode(null);
+      reportErrorToken(token);
+    } else {
+      reportFatalError(token,
+                       "Expected a function body, but got '${token.value}'.");
+    }
+    return skipToEof(token);
+  }
+
+  Token expectedClassBody(Token token) {
+    if (token is ErrorToken) {
+      reportErrorToken(token);
+      return skipToEof(token);
+    } else {
+      reportFatalError(token,
+                       "Expected a class body, but got '${token.value}'.");
+      return skipToEof(token);
+    }
+  }
+
+  void handleLiteralInt(Token token) {
+    pushNode(new LiteralInt(token, (t, e) => handleOnError(t, e)));
+  }
+
+  void handleLiteralDouble(Token token) {
+    pushNode(new LiteralDouble(token, (t, e) => handleOnError(t, e)));
+  }
+
+  void handleLiteralBool(Token token) {
+    pushNode(new LiteralBool(token, (t, e) => handleOnError(t, e)));
+  }
+
+  void handleLiteralNull(Token token) {
+    pushNode(new LiteralNull(token));
+  }
+
+  void endLiteralSymbol(Token hashToken, int identifierCount) {
+    NodeList identifiers = makeNodeList(identifierCount, null, null, '.');
+    pushNode(new LiteralSymbol(hashToken, identifiers));
+  }
+
+  void handleBinaryExpression(Token token) {
+    Node argument = popNode();
+    Node receiver = popNode();
+    String tokenString = token.stringValue;
+    if (identical(tokenString, '.') ||
+        identical(tokenString, '..') ||
+        identical(tokenString, '?.')) {
+      Send argumentSend = argument.asSend();
+      if (argumentSend == null) {
+        // TODO(ahe): The parser should diagnose this problem, not
+        // this listener.
+        reportFatalError(argument,
+                         'Expected an identifier.');
+      }
+      if (argumentSend.receiver != null) internalError(node: argument);
+      if (argument is SendSet) internalError(node: argument);
+      pushNode(argument.asSend().copyWithReceiver(receiver,
+            identical(tokenString, '?.')));
+    } else {
+      NodeList arguments = new NodeList.singleton(argument);
+      pushNode(new Send(receiver, new Operator(token), arguments));
+    }
+    if (identical(tokenString, '===')) {
+      reporter.reportErrorMessage(
+          token,
+          MessageKind.UNSUPPORTED_EQ_EQ_EQ,
+          {'lhs': receiver, 'rhs': argument});
+    }
+    if (identical(tokenString, '!==')) {
+      reporter.reportErrorMessage(
+          token,
+          MessageKind.UNSUPPORTED_BANG_EQ_EQ,
+          {'lhs': receiver, 'rhs': argument});
+    }
+  }
+
+  void beginCascade(Token token) {
+    pushNode(new CascadeReceiver(popNode(), token));
+  }
+
+  void endCascade() {
+    pushNode(new Cascade(popNode()));
+  }
+
+  void handleAsOperator(Token operathor, Token endToken) {
+    TypeAnnotation type = popNode();
+    Expression expression = popNode();
+    NodeList arguments = new NodeList.singleton(type);
+    pushNode(new Send(expression, new Operator(operathor), arguments));
+  }
+
+  void handleAssignmentExpression(Token token) {
+    Node arg = popNode();
+    Node node = popNode();
+    Send send = node.asSend();
+    if (send == null || !(send.isPropertyAccess || send.isIndex)) {
+      reportNotAssignable(node);
+    }
+    if (send.asSendSet() != null) internalError(node: send);
+    NodeList arguments;
+    if (send.isIndex) {
+      Link<Node> link = const Link<Node>().prepend(arg);
+      link = link.prepend(send.arguments.head);
+      arguments = new NodeList(null, link);
+    } else {
+      arguments = new NodeList.singleton(arg);
+    }
+    Operator op = new Operator(token);
+    pushNode(new SendSet(send.receiver, send.selector, op, arguments,
+        send.isConditional));
+  }
+
+  void reportNotAssignable(Node node) {
+    // TODO(ahe): The parser should diagnose this problem, not this
+    // listener.
+    reportFatalError(node,
+                     'Not assignable.');
+  }
+
+  void handleConditionalExpression(Token question, Token colon) {
+    Node elseExpression = popNode();
+    Node thenExpression = popNode();
+    Node condition = popNode();
+    pushNode(new Conditional(
+        condition, thenExpression, elseExpression, question, colon));
+  }
+
+  void endSend(Token token) {
+    NodeList arguments = popNode();
+    Node selector = popNode();
+    // TODO(ahe): Handle receiver.
+    pushNode(new Send(null, selector, arguments));
+  }
+
+  void endFunctionBody(int count, Token beginToken, Token endToken) {
+    if (count == 0 && beginToken == null) {
+      pushNode(new EmptyStatement(endToken));
+    } else {
+      pushNode(new Block(makeNodeList(count, beginToken, endToken, null)));
+    }
+  }
+
+  void handleAsyncModifier(Token asyncToken, Token starToken) {
+    if (asyncToken != null) {
+      pushNode(new AsyncModifier(asyncToken, starToken));
+    } else {
+      pushNode(null);
+    }
+  }
+
+  void skippedFunctionBody(Token token) {
+    pushNode(new Block(new NodeList.empty()));
+  }
+
+  void handleNoFunctionBody(Token token) {
+    pushNode(new EmptyStatement(token));
+  }
+
+  void endFunction(Token getOrSet, Token endToken) {
+    Statement body = popNode();
+    AsyncModifier asyncModifier = popNode();
+    NodeList initializers = popNode();
+    NodeList formals = popNode();
+    // The name can be an identifier or a send in case of named constructors.
+    Expression name = popNode();
+    TypeAnnotation type = popNode();
+    Modifiers modifiers = popNode();
+    pushNode(new FunctionExpression(name, formals, body, type,
+                                    modifiers, initializers, getOrSet,
+                                    asyncModifier));
+  }
+
+  void endFunctionDeclaration(Token endToken) {
+    pushNode(new FunctionDeclaration(popNode()));
+  }
+
+  void endVariablesDeclaration(int count, Token endToken) {
+    // TODO(ahe): Pick one name for this concept, either
+    // VariablesDeclaration or VariableDefinitions.
+    NodeList variables = makeNodeList(count, null, endToken, ",");
+    TypeAnnotation type = popNode();
+    Modifiers modifiers = popNode();
+    pushNode(new VariableDefinitions(type, modifiers, variables));
+  }
+
+  void endInitializer(Token assignmentOperator) {
+    Expression initializer = popNode();
+    NodeList arguments =
+        initializer == null ? null : new NodeList.singleton(initializer);
+    Expression name = popNode();
+    Operator op = new Operator(assignmentOperator);
+    pushNode(new SendSet(null, name, op, arguments));
+  }
+
+  void endIfStatement(Token ifToken, Token elseToken) {
+    Statement elsePart = (elseToken == null) ? null : popNode();
+    Statement thenPart = popNode();
+    ParenthesizedExpression condition = popNode();
+    pushNode(new If(condition, thenPart, elsePart, ifToken, elseToken));
+  }
+
+  void endForStatement(int updateExpressionCount,
+                       Token beginToken, Token endToken) {
+    Statement body = popNode();
+    NodeList updates = makeNodeList(updateExpressionCount, null, null, ',');
+    Statement condition = popNode();
+    Node initializer = popNode();
+    pushNode(new For(initializer, condition, updates, body, beginToken));
+  }
+
+  void handleNoExpression(Token token) {
+    pushNode(null);
+  }
+
+  void endDoWhileStatement(Token doKeyword, Token whileKeyword,
+                           Token endToken) {
+    Expression condition = popNode();
+    Statement body = popNode();
+    pushNode(new DoWhile(body, condition, doKeyword, whileKeyword, endToken));
+  }
+
+  void endWhileStatement(Token whileKeyword, Token endToken) {
+    Statement body = popNode();
+    Expression condition = popNode();
+    pushNode(new While(condition, body, whileKeyword));
+  }
+
+  void endBlock(int count, Token beginToken, Token endToken) {
+    pushNode(new Block(makeNodeList(count, beginToken, endToken, null)));
+  }
+
+  void endThrowExpression(Token throwToken, Token endToken) {
+    Expression expression = popNode();
+    pushNode(new Throw(expression, throwToken, endToken));
+  }
+
+  void endAwaitExpression(Token awaitToken, Token endToken) {
+    Expression expression = popNode();
+    pushNode(new Await(awaitToken, expression));
+  }
+
+  void endRethrowStatement(Token throwToken, Token endToken) {
+    pushNode(new Rethrow(throwToken, endToken));
+    if (identical(throwToken.stringValue, 'throw')) {
+      reporter.reportErrorMessage(
+          throwToken, MessageKind.UNSUPPORTED_THROW_WITHOUT_EXP);
+    }
+  }
+
+  void handleUnaryPrefixExpression(Token token) {
+    pushNode(new Send.prefix(popNode(), new Operator(token)));
+  }
+
+  void handleSuperExpression(Token token) {
+    pushNode(new Identifier(token));
+  }
+
+  void handleThisExpression(Token token) {
+    pushNode(new Identifier(token));
+  }
+
+  void handleUnaryAssignmentExpression(Token token, bool isPrefix) {
+    Node node = popNode();
+    Send send = node.asSend();
+    if (send == null) {
+      reportNotAssignable(node);
+    }
+    if (!(send.isPropertyAccess || send.isIndex)) {
+      reportNotAssignable(node);
+    }
+    if (send.asSendSet() != null) internalError(node: send);
+    Node argument = null;
+    if (send.isIndex) argument = send.arguments.head;
+    Operator op = new Operator(token);
+
+    if (isPrefix) {
+      pushNode(new SendSet.prefix(send.receiver, send.selector, op, argument,
+          send.isConditional));
+    } else {
+      pushNode(new SendSet.postfix(send.receiver, send.selector, op, argument,
+          send.isConditional));
+    }
+  }
+
+  void handleUnaryPostfixAssignmentExpression(Token token) {
+    handleUnaryAssignmentExpression(token, false);
+  }
+
+  void handleUnaryPrefixAssignmentExpression(Token token) {
+    handleUnaryAssignmentExpression(token, true);
+  }
+
+  void endInitializers(int count, Token beginToken, Token endToken) {
+    pushNode(makeNodeList(count, beginToken, null, ','));
+  }
+
+  void handleNoInitializers() {
+    pushNode(null);
+  }
+
+  void endFields(int count, Token beginToken, Token endToken) {
+    NodeList variables = makeNodeList(count, null, endToken, ",");
+    TypeAnnotation type = popNode();
+    Modifiers modifiers = popNode();
+    pushNode(new VariableDefinitions(type, modifiers, variables));
+  }
+
+  void endMethod(Token getOrSet, Token beginToken, Token endToken) {
+    Statement body = popNode();
+    AsyncModifier asyncModifier = popNode();
+    NodeList initializers = popNode();
+    NodeList formalParameters = popNode();
+    Expression name = popNode();
+    TypeAnnotation returnType = popNode();
+    Modifiers modifiers = popNode();
+    pushNode(new FunctionExpression(name, formalParameters, body, returnType,
+                                    modifiers, initializers, getOrSet,
+                                    asyncModifier));
+  }
+
+  void handleLiteralMap(int count, Token beginToken, Token constKeyword,
+                        Token endToken) {
+    NodeList entries = makeNodeList(count, beginToken, endToken, ',');
+    NodeList typeArguments = popNode();
+    pushNode(new LiteralMap(typeArguments, entries, constKeyword));
+  }
+
+  void endLiteralMapEntry(Token colon, Token endToken) {
+    Expression value = popNode();
+    Expression key = popNode();
+    pushNode(new LiteralMapEntry(key, colon, value));
+  }
+
+  void handleLiteralList(int count, Token beginToken, Token constKeyword,
+                         Token endToken) {
+    NodeList elements = makeNodeList(count, beginToken, endToken, ',');
+    pushNode(new LiteralList(popNode(), elements, constKeyword));
+  }
+
+  void handleIndexedExpression(Token openSquareBracket,
+                               Token closeSquareBracket) {
+    NodeList arguments =
+        makeNodeList(1, openSquareBracket, closeSquareBracket, null);
+    Node receiver = popNode();
+    Token token = new StringToken.fromString(Precedence.INDEX_INFO, '[]',
+                                  openSquareBracket.charOffset);
+    Node selector = new Operator(token);
+    pushNode(new Send(receiver, selector, arguments));
+  }
+
+  void handleNewExpression(Token token) {
+    NodeList arguments = popNode();
+    Node name = popNode();
+    pushNode(new NewExpression(token, new Send(null, name, arguments)));
+  }
+
+  void handleConstExpression(Token token) {
+    // [token] carries the 'const' information.
+    handleNewExpression(token);
+  }
+
+  void handleOperator(Token token) {
+    pushNode(new Operator(token));
+  }
+
+  void handleOperatorName(Token operatorKeyword, Token token) {
+    Operator op = new Operator(token);
+    pushNode(new Send(new Identifier(operatorKeyword), op, null));
+  }
+
+  void handleNamedArgument(Token colon) {
+    Expression expression = popNode();
+    Identifier name = popNode();
+    pushNode(new NamedArgument(name, colon, expression));
+  }
+
+  void endOptionalFormalParameters(int count,
+                                   Token beginToken, Token endToken) {
+    pushNode(makeNodeList(count, beginToken, endToken, ','));
+  }
+
+  void handleFunctionTypedFormalParameter(Token endToken) {
+    NodeList formals = popNode();
+    Identifier name = popNode();
+    TypeAnnotation returnType = popNode();
+    pushNode(null); // Signal "no type" to endFormalParameter.
+    pushNode(new FunctionExpression(name, formals, null, returnType,
+                                    Modifiers.EMPTY, null, null, null));
+  }
+
+  void handleValuedFormalParameter(Token equals, Token token) {
+    Expression defaultValue = popNode();
+    Expression parameterName = popNode();
+    pushNode(new SendSet(null, parameterName, new Operator(equals),
+                         new NodeList.singleton(defaultValue)));
+  }
+
+  void endTryStatement(int catchCount, Token tryKeyword, Token finallyKeyword) {
+    Block finallyBlock = null;
+    if (finallyKeyword != null) {
+      finallyBlock = popNode();
+    }
+    NodeList catchBlocks = makeNodeList(catchCount, null, null, null);
+    Block tryBlock = popNode();
+    pushNode(new TryStatement(tryBlock, catchBlocks, finallyBlock,
+                              tryKeyword, finallyKeyword));
+  }
+
+  void handleCaseMatch(Token caseKeyword, Token colon) {
+    pushNode(new CaseMatch(caseKeyword, popNode(), colon));
+  }
+
+  void handleCatchBlock(Token onKeyword, Token catchKeyword) {
+    Block block = popNode();
+    NodeList formals = catchKeyword != null? popNode(): null;
+    TypeAnnotation type = onKeyword != null ? popNode() : null;
+    pushNode(new CatchBlock(type, formals, block, onKeyword, catchKeyword));
+  }
+
+  void endSwitchStatement(Token switchKeyword, Token endToken) {
+    NodeList cases = popNode();
+    ParenthesizedExpression expression = popNode();
+    pushNode(new SwitchStatement(expression, cases, switchKeyword));
+  }
+
+  void endSwitchBlock(int caseCount, Token beginToken, Token endToken) {
+    Link<Node> caseNodes = const Link<Node>();
+    while (caseCount > 0) {
+      SwitchCase switchCase = popNode();
+      caseNodes = caseNodes.prepend(switchCase);
+      caseCount--;
+    }
+    pushNode(new NodeList(beginToken, caseNodes, endToken, null));
+  }
+
+  void handleSwitchCase(int labelCount, int caseCount,
+                        Token defaultKeyword, int statementCount,
+                        Token firstToken, Token endToken) {
+    NodeList statements = makeNodeList(statementCount, null, null, null);
+    NodeList labelsAndCases =
+        makeNodeList(labelCount + caseCount, null, null, null);
+    pushNode(new SwitchCase(labelsAndCases, defaultKeyword, statements,
+                            firstToken));
+  }
+
+  void handleBreakStatement(bool hasTarget,
+                            Token breakKeyword, Token endToken) {
+    Identifier target = null;
+    if (hasTarget) {
+      target = popNode();
+    }
+    pushNode(new BreakStatement(target, breakKeyword, endToken));
+  }
+
+  void handleContinueStatement(bool hasTarget,
+                               Token continueKeyword, Token endToken) {
+    Identifier target = null;
+    if (hasTarget) {
+      target = popNode();
+    }
+    pushNode(new ContinueStatement(target, continueKeyword, endToken));
+  }
+
+  void handleEmptyStatement(Token token) {
+    pushNode(new EmptyStatement(token));
+  }
+
+  void endFactoryMethod(Token beginToken, Token endToken) {
+    super.endFactoryMethod(beginToken, endToken);
+    Statement body = popNode();
+    AsyncModifier asyncModifier = popNode();
+    NodeList formals = popNode();
+    Node name = popNode();
+
+    // TODO(ahe): Move this parsing to the parser.
+    int modifierCount = 0;
+    Token modifier = beginToken;
+    if (modifier.stringValue == "external") {
+      handleModifier(modifier);
+      modifierCount++;
+      modifier = modifier.next;
+    }
+    if (modifier.stringValue == "const") {
+      handleModifier(modifier);
+      modifierCount++;
+      modifier = modifier.next;
+    }
+    assert(modifier.stringValue == "factory");
+    handleModifier(modifier);
+    modifierCount++;
+    handleModifiers(modifierCount);
+    Modifiers modifiers = popNode();
+
+    pushNode(new FunctionExpression(name, formals, body, null,
+                                    modifiers, null, null, asyncModifier));
+  }
+
+  void endForIn(Token awaitToken, Token forToken,
+                Token inKeyword, Token endToken) {
+    Statement body = popNode();
+    Expression expression = popNode();
+    Node declaredIdentifier = popNode();
+    if (awaitToken == null) {
+      pushNode(new SyncForIn(declaredIdentifier, expression, body,
+                             forToken, inKeyword));
+    } else {
+      pushNode(new AsyncForIn(declaredIdentifier, expression, body, awaitToken,
+                              forToken, inKeyword));
+    }
+  }
+
+  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, ' '));
+      }
+    }
+  }
+
+  void endMetadata(Token beginToken, Token periodBeforeName, Token endToken) {
+    NodeList arguments = popNode();
+    if (arguments == null) {
+      // This is a constant expression.
+      Identifier name;
+      if (periodBeforeName != null) {
+        name = popNode();
+      }
+      NodeList typeArguments = popNode();
+      Node receiver = popNode();
+      if (typeArguments != null) {
+        receiver = new TypeAnnotation(receiver, typeArguments);
+        recoverableError(typeArguments,
+                         'Type arguments are not allowed here.');
+      } else {
+        Identifier identifier = receiver.asIdentifier();
+        Send send = receiver.asSend();
+        if (identifier != null) {
+          receiver = new Send(null, identifier);
+        } else if (send == null) {
+          internalError(node: receiver);
+        }
+      }
+      Send send = receiver;
+      if (name != null) {
+        send = new Send(receiver, name);
+      }
+      pushNode(new Metadata(beginToken, send));
+    } else {
+      // This is a const constructor call.
+      endConstructorReference(beginToken, periodBeforeName, endToken);
+      Node constructor = popNode();
+      pushNode(new Metadata(beginToken,
+          new NewExpression(null,
+              new Send(null, constructor, arguments))));
+    }
+  }
+
+  void handleAssertStatement(Token assertKeyword,
+                             Token commaToken, Token semicolonToken) {
+    Node message;
+    Node condition;
+    if (commaToken != null) {
+      message = popNode();
+    }
+    condition = popNode();
+    pushNode(new Assert(assertKeyword, condition,
+                        message, semicolonToken));
+  }
+
+  void endUnnamedFunction(Token token) {
+    Statement body = popNode();
+    AsyncModifier asyncModifier = popNode();
+    NodeList formals = popNode();
+    pushNode(new FunctionExpression(null, formals, body, null,
+                                    Modifiers.EMPTY, null, null,
+                                    asyncModifier));
+  }
+
+  void handleIsOperator(Token operathor, Token not, Token endToken) {
+    TypeAnnotation type = popNode();
+    Expression expression = popNode();
+    Node argument;
+    if (not != null) {
+      argument = new Send.prefix(type, new Operator(not));
+    } else {
+      argument = type;
+    }
+
+    NodeList arguments = new NodeList.singleton(argument);
+    pushNode(new Send(expression, new Operator(operathor), arguments));
+  }
+
+  void handleLabel(Token colon) {
+    Identifier name = popNode();
+    pushNode(new Label(name, colon));
+  }
+
+  void endLabeledStatement(int labelCount) {
+    Statement statement = popNode();
+    NodeList labels = makeNodeList(labelCount, null, null, null);
+    pushNode(new LabeledStatement(labels, statement));
+  }
+
+  void log(message) {
+    reporter.log(message);
+  }
+
+  void internalError({Token token, Node node}) {
+    // TODO(ahe): This should call reporter.internalError.
+    Spannable spannable = (token == null) ? node : token;
+    throw new SpannableAssertionFailure(spannable, 'Internal error in parser.');
+  }
+}
diff --git a/pkg/compiler/lib/src/parser/parser.dart b/pkg/compiler/lib/src/parser/parser.dart
new file mode 100644
index 0000000..7adddb5
--- /dev/null
+++ b/pkg/compiler/lib/src/parser/parser.dart
@@ -0,0 +1,2733 @@
+// Copyright (c) 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.parser;
+
+import '../common.dart';
+import '../tokens/keyword.dart' show
+    Keyword;
+import '../tokens/precedence.dart' show
+    PrecedenceInfo;
+import '../tokens/precedence_constants.dart' show
+    AS_INFO,
+    ASSIGNMENT_PRECEDENCE,
+    CASCADE_PRECEDENCE,
+    EQUALITY_PRECEDENCE,
+    GT_INFO,
+    GT_GT_INFO,
+    IS_INFO,
+    MINUS_MINUS_INFO,
+    OPEN_PAREN_INFO,
+    OPEN_SQUARE_BRACKET_INFO,
+    PERIOD_INFO,
+    PLUS_PLUS_INFO,
+    POSTFIX_PRECEDENCE,
+    QUESTION_INFO,
+    QUESTION_PERIOD_INFO,
+    RELATIONAL_PRECEDENCE;
+import '../tokens/token.dart' show
+    BeginGroupToken,
+    isUserDefinableOperator,
+    KeywordToken,
+    SymbolToken,
+    Token;
+import '../tokens/token_constants.dart' show
+    BAD_INPUT_TOKEN,
+    COMMA_TOKEN,
+    DOUBLE_TOKEN,
+    EOF_TOKEN,
+    EQ_TOKEN,
+    FUNCTION_TOKEN,
+    HASH_TOKEN,
+    HEXADECIMAL_TOKEN,
+    IDENTIFIER_TOKEN,
+    INT_TOKEN,
+    KEYWORD_TOKEN,
+    LT_TOKEN,
+    OPEN_CURLY_BRACKET_TOKEN,
+    OPEN_PAREN_TOKEN,
+    OPEN_SQUARE_BRACKET_TOKEN,
+    PERIOD_TOKEN,
+    SEMICOLON_TOKEN,
+    STRING_INTERPOLATION_IDENTIFIER_TOKEN,
+    STRING_INTERPOLATION_TOKEN,
+    STRING_TOKEN;
+import '../util/characters.dart' as Characters show
+    $CLOSE_CURLY_BRACKET;
+import '../util/util.dart' show
+    Link;
+
+import 'listener.dart' show
+    Listener;
+
+class FormalParameterType {
+  final String type;
+  const FormalParameterType(this.type);
+  bool get isRequired => this == REQUIRED;
+  bool get isPositional => this == POSITIONAL;
+  bool get isNamed => this == NAMED;
+  static final REQUIRED = const FormalParameterType('required');
+  static final POSITIONAL = const FormalParameterType('positional');
+  static final NAMED = const FormalParameterType('named');
+}
+
+/**
+ * An event generating parser of Dart programs. This parser expects
+ * all tokens in a linked list (aka a token stream).
+ *
+ * The class [Scanner] is used to generate a token stream. See the
+ * file scanner.dart.
+ *
+ * Subclasses of the class [Listener] are used to listen to events.
+ *
+ * Most methods of this class belong in one of two major categories:
+ * parse metods and peek methods. Parse methods all have the prefix
+ * parse, and peek methods all have the prefix peek.
+ *
+ * Parse methods generate events (by calling methods on [listener])
+ * and return the next token to parse. Peek methods do not generate
+ * events (except for errors) and may return null.
+ *
+ * Parse methods are generally named parseGrammarProductionSuffix. The
+ * suffix can be one of "opt", or "star". "opt" means zero or one
+ * matches, "star" means zero or more matches. For example,
+ * [parseMetadataStar] corresponds to this grammar snippet: [:
+ * metadata* :], and [parseTypeOpt] corresponds to: [: type? :].
+ */
+class Parser {
+  final Listener listener;
+  bool mayParseFunctionExpressions = true;
+  bool yieldIsKeyword;
+  bool awaitIsKeyword;
+
+  Parser(this.listener,
+         {this.yieldIsKeyword: false, this.awaitIsKeyword: 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);
+    return token;
+  }
+
+  Token parseTopLevelDeclaration(Token token) {
+    token = parseMetadataStar(token);
+    final String value = token.stringValue;
+    if ((identical(value, 'abstract') && optional('class', token.next))
+        || identical(value, 'class')) {
+      return parseClassOrNamedMixinApplication(token);
+    } else if (identical(value, 'enum')) {
+      return parseEnum(token);
+    } else if (identical(value, 'typedef')) {
+      return parseTypedef(token);
+    } else if (identical(value, 'library')) {
+      return parseLibraryName(token);
+    } else if (identical(value, 'import')) {
+      return parseImport(token);
+    } else if (identical(value, 'export')) {
+      return parseExport(token);
+    } else if (identical(value, 'part')) {
+      return parsePartOrPartOf(token);
+    } else {
+      return parseTopLevelMember(token);
+    }
+  }
+
+  /// library qualified ';'
+  Token parseLibraryName(Token token) {
+    Token libraryKeyword = token;
+    listener.beginLibraryName(libraryKeyword);
+    assert(optional('library', token));
+    token = parseQualified(token.next);
+    Token semicolon = token;
+    token = expect(';', token);
+    listener.endLibraryName(libraryKeyword, semicolon);
+    return token;
+  }
+
+  /// import uri (as identifier)? combinator* ';'
+  Token parseImport(Token token) {
+    Token importKeyword = token;
+    listener.beginImport(importKeyword);
+    assert(optional('import', token));
+    token = parseLiteralStringOrRecoverExpression(token.next);
+    Token deferredKeyword;
+    if (optional('deferred', token)) {
+      deferredKeyword = token;
+      token = token.next;
+    }
+    Token asKeyword;
+    if (optional('as', token)) {
+      asKeyword = token;
+      token = parseIdentifier(token.next);
+    }
+    token = parseCombinators(token);
+    Token semicolon = token;
+    token = expect(';', token);
+    listener.endImport(importKeyword, deferredKeyword, asKeyword, semicolon);
+    return token;
+  }
+
+  /// export uri combinator* ';'
+  Token parseExport(Token token) {
+    Token exportKeyword = token;
+    listener.beginExport(exportKeyword);
+    assert(optional('export', token));
+    token = parseLiteralStringOrRecoverExpression(token.next);
+    token = parseCombinators(token);
+    Token semicolon = token;
+    token = expect(';', token);
+    listener.endExport(exportKeyword, semicolon);
+    return token;
+  }
+
+  Token parseCombinators(Token token) {
+    listener.beginCombinators(token);
+    int count = 0;
+    while (true) {
+      String value = token.stringValue;
+      if (identical('hide', value)) {
+        token = parseHide(token);
+      } else if (identical('show', value)) {
+        token = parseShow(token);
+      } else {
+        listener.endCombinators(count);
+        break;
+      }
+      count++;
+    }
+    return token;
+  }
+
+  /// hide identifierList
+  Token parseHide(Token token) {
+    Token hideKeyword = token;
+    listener.beginHide(hideKeyword);
+    assert(optional('hide', token));
+    token = parseIdentifierList(token.next);
+    listener.endHide(hideKeyword);
+    return token;
+  }
+
+  /// show identifierList
+  Token parseShow(Token token) {
+    Token showKeyword = token;
+    listener.beginShow(showKeyword);
+    assert(optional('show', token));
+    token = parseIdentifierList(token.next);
+    listener.endShow(showKeyword);
+    return token;
+  }
+
+  /// identifier (, identifier)*
+  Token parseIdentifierList(Token token) {
+    listener.beginIdentifierList(token);
+    token = parseIdentifier(token);
+    int count = 1;
+    while (optional(',', token)) {
+      token = parseIdentifier(token.next);
+      count++;
+    }
+    listener.endIdentifierList(count);
+    return token;
+  }
+
+  /// type (, type)*
+  Token parseTypeList(Token token) {
+    listener.beginTypeList(token);
+    token = parseType(token);
+    int count = 1;
+    while (optional(',', token)) {
+      token = parseType(token.next);
+      count++;
+    }
+    listener.endTypeList(count);
+    return token;
+  }
+
+  Token parsePartOrPartOf(Token token) {
+    assert(optional('part', token));
+    if (optional('of', token.next)) {
+      return parsePartOf(token);
+    } else {
+      return parsePart(token);
+    }
+  }
+
+  Token parsePart(Token token) {
+    Token partKeyword = token;
+    listener.beginPart(token);
+    assert(optional('part', token));
+    token = parseLiteralStringOrRecoverExpression(token.next);
+    Token semicolon = token;
+    token = expect(';', token);
+    listener.endPart(partKeyword, semicolon);
+    return token;
+  }
+
+  Token parsePartOf(Token token) {
+    listener.beginPartOf(token);
+    assert(optional('part', token));
+    assert(optional('of', token.next));
+    Token partKeyword = token;
+    token = parseQualified(token.next.next);
+    Token semicolon = token;
+    token = expect(';', token);
+    listener.endPartOf(partKeyword, semicolon);
+    return token;
+  }
+
+  Token parseMetadataStar(Token token, {bool forParameter: false}) {
+    listener.beginMetadataStar(token);
+    int count = 0;
+    while (optional('@', token)) {
+      token = parseMetadata(token);
+      count++;
+    }
+    listener.endMetadataStar(count, forParameter);
+    return token;
+  }
+
+  /**
+   * Parse
+   * [: '@' qualified (‘.’ identifier)? (arguments)? :]
+   */
+  Token parseMetadata(Token token) {
+    listener.beginMetadata(token);
+    Token atToken = token;
+    assert(optional('@', token));
+    token = parseIdentifier(token.next);
+    token = parseQualifiedRestOpt(token);
+    token = parseTypeArgumentsOpt(token);
+    Token period = null;
+    if (optional('.', token)) {
+      period = token;
+      token = parseIdentifier(token.next);
+    }
+    token = parseArgumentsOpt(token);
+    listener.endMetadata(atToken, period, token);
+    return token;
+  }
+
+  Token parseTypedef(Token token) {
+    Token typedefKeyword = token;
+    if (optional('=', peekAfterType(token.next))) {
+      // TODO(aprelev@gmail.com): Remove deprecated 'typedef' mixin application,
+      // remove corresponding diagnostic from members.dart.
+      listener.beginNamedMixinApplication(token);
+      token = parseIdentifier(token.next);
+      token = parseTypeVariablesOpt(token);
+      token = expect('=', token);
+      token = parseModifiers(token);
+      token = parseMixinApplication(token);
+      Token implementsKeyword = null;
+      if (optional('implements', token)) {
+        implementsKeyword = token;
+        token = parseTypeList(token.next);
+      }
+      listener.endNamedMixinApplication(
+          typedefKeyword, implementsKeyword, token);
+    } else {
+      listener.beginFunctionTypeAlias(token);
+      token = parseReturnTypeOpt(token.next);
+      token = parseIdentifier(token);
+      token = parseTypeVariablesOpt(token);
+      token = parseFormalParameters(token);
+      listener.endFunctionTypeAlias(typedefKeyword, token);
+    }
+    return expect(';', token);
+  }
+
+  Token parseMixinApplication(Token token) {
+    listener.beginMixinApplication(token);
+    token = parseType(token);
+    token = expect('with', token);
+    token = parseTypeList(token);
+    listener.endMixinApplication();
+    return token;
+  }
+
+  Token parseReturnTypeOpt(Token token) {
+    if (identical(token.stringValue, 'void')) {
+      listener.handleVoidKeyword(token);
+      return token.next;
+    } else {
+      return parseTypeOpt(token);
+    }
+  }
+
+  Token parseFormalParametersOpt(Token token) {
+    if (optional('(', token)) {
+      return parseFormalParameters(token);
+    } else {
+      listener.handleNoFormalParameters(token);
+      return token;
+    }
+  }
+
+  Token parseFormalParameters(Token token) {
+    Token begin = token;
+    listener.beginFormalParameters(begin);
+    expect('(', token);
+    int parameterCount = 0;
+    if (optional(')', token.next)) {
+      listener.endFormalParameters(parameterCount, begin, token.next);
+      return token.next.next;
+    }
+    do {
+      ++parameterCount;
+      token = token.next;
+      String value = token.stringValue;
+      if (identical(value, '[')) {
+        token = parseOptionalFormalParameters(token, false);
+        break;
+      } else if (identical(value, '{')) {
+        token = parseOptionalFormalParameters(token, true);
+        break;
+      }
+      token = parseFormalParameter(token, FormalParameterType.REQUIRED);
+    } while (optional(',', token));
+    listener.endFormalParameters(parameterCount, begin, token);
+    return expect(')', token);
+  }
+
+  Token parseFormalParameter(Token token, FormalParameterType type) {
+    token = parseMetadataStar(token, forParameter: true);
+    listener.beginFormalParameter(token);
+    token = parseModifiers(token);
+    // TODO(ahe): Validate that there are formal parameters if void.
+    token = parseReturnTypeOpt(token);
+    Token thisKeyword = null;
+    if (optional('this', token)) {
+      thisKeyword = token;
+      // TODO(ahe): Validate field initializers are only used in
+      // constructors, and not for function-typed arguments.
+      token = expect('.', token.next);
+    }
+    token = parseIdentifier(token);
+    if (optional('(', token)) {
+      token = parseFormalParameters(token);
+      listener.handleFunctionTypedFormalParameter(token);
+    }
+    String value = token.stringValue;
+    if ((identical('=', value)) || (identical(':', value))) {
+      // TODO(ahe): Validate that these are only used for optional parameters.
+      Token equal = token;
+      token = parseExpression(token.next);
+      listener.handleValuedFormalParameter(equal, token);
+      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);
+      }
+    }
+    listener.endFormalParameter(thisKeyword);
+    return token;
+  }
+
+  Token parseOptionalFormalParameters(Token token, bool isNamed) {
+    Token begin = token;
+    listener.beginOptionalFormalParameters(begin);
+    assert((isNamed && optional('{', token)) || optional('[', token));
+    int parameterCount = 0;
+    do {
+      token = token.next;
+      var type = isNamed ? FormalParameterType.NAMED
+                         : FormalParameterType.POSITIONAL;
+      token = parseFormalParameter(token, type);
+      ++parameterCount;
+    } while (optional(',', token));
+    listener.endOptionalFormalParameters(parameterCount, begin, token);
+    if (isNamed) {
+      return expect('}', token);
+    } else {
+      return expect(']', token);
+    }
+  }
+
+  Token parseTypeOpt(Token token) {
+    Token peek = peekAfterIfType(token);
+    if (peek != null && (peek.isIdentifier() || optional('this', peek))) {
+      return parseType(token);
+    }
+    listener.handleNoType(token);
+    return token;
+  }
+
+  bool isValidTypeReference(Token token) {
+    final kind = token.kind;
+    if (identical(kind, IDENTIFIER_TOKEN)) return true;
+    if (identical(kind, KEYWORD_TOKEN)) {
+      Keyword keyword = (token as KeywordToken).keyword;
+      String value = keyword.syntax;
+      return keyword.isPseudo
+          || (identical(value, 'dynamic'))
+          || (identical(value, 'void'));
+    }
+    return false;
+  }
+
+  Token parseQualified(Token token) {
+    token = parseIdentifier(token);
+    while (optional('.', token)) {
+      token = parseQualifiedRest(token);
+    }
+    return token;
+  }
+
+  Token parseQualifiedRestOpt(Token token) {
+    if (optional('.', token)) {
+      return parseQualifiedRest(token);
+    } else {
+      return token;
+    }
+  }
+
+  Token parseQualifiedRest(Token token) {
+    assert(optional('.', token));
+    Token period = token;
+    token = parseIdentifier(token.next);
+    listener.handleQualified(period);
+    return token;
+  }
+
+  Token skipBlock(Token token) {
+    if (!optional('{', token)) {
+      return listener.expectedBlockToSkip(token);
+    }
+    BeginGroupToken beginGroupToken = token;
+    Token endGroup = beginGroupToken.endGroup;
+    if (endGroup == null) {
+      return listener.unmatched(beginGroupToken);
+    } else if (!identical(endGroup.kind, Characters.$CLOSE_CURLY_BRACKET)) {
+      return listener.unmatched(beginGroupToken);
+    }
+    return beginGroupToken.endGroup;
+  }
+
+  Token parseEnum(Token token) {
+    listener.beginEnum(token);
+    Token enumKeyword = token;
+    token = parseIdentifier(token.next);
+    token = expect('{', token);
+    int count = 0;
+    if (!optional('}', token)) {
+      token = parseIdentifier(token);
+      count++;
+      while (optional(',', token)) {
+        token = token.next;
+        if (optional('}', token)) break;
+        token = parseIdentifier(token);
+        count++;
+      }
+    }
+    Token endBrace = token;
+    token = expect('}', token);
+    listener.endEnum(enumKeyword, endBrace, count);
+    return token;
+  }
+
+  Token parseClassOrNamedMixinApplication(Token token) {
+    Token begin = token;
+    Token abstractKeyword;
+    if (optional('abstract', token)) {
+      abstractKeyword = token;
+      token = token.next;
+    }
+    Token classKeyword = token;
+    var isMixinApplication = optional('=', peekAfterType(token.next));
+    if (isMixinApplication) {
+      listener.beginNamedMixinApplication(begin);
+      token = parseIdentifier(token.next);
+      token = parseTypeVariablesOpt(token);
+      token = expect('=', token);
+    } else {
+      listener.beginClassDeclaration(begin);
+    }
+
+    // TODO(aprelev@gmail.com): Once 'typedef' named mixin application is
+    // removed, move modifiers for named mixin application to the bottom of
+    // listener stack. This is so stacks for class declaration and named
+    // mixin application look similar.
+    int modifierCount = 0;
+    if (abstractKeyword != null) {
+      parseModifier(abstractKeyword);
+      modifierCount++;
+    }
+    listener.handleModifiers(modifierCount);
+
+    if (isMixinApplication) {
+      return parseNamedMixinApplication(token, classKeyword);
+    } else {
+      return parseClass(begin, classKeyword);
+    }
+  }
+
+  Token parseNamedMixinApplication(Token token, Token classKeyword) {
+    token = parseMixinApplication(token);
+    Token implementsKeyword = null;
+    if (optional('implements', token)) {
+      implementsKeyword = token;
+      token = parseTypeList(token.next);
+    }
+    listener.endNamedMixinApplication(
+        classKeyword, implementsKeyword, token);
+    return expect(';', token);
+  }
+
+  Token parseClass(Token begin, Token classKeyword) {
+    Token token = parseIdentifier(classKeyword.next);
+    token = parseTypeVariablesOpt(token);
+    Token extendsKeyword;
+    if (optional('extends', token)) {
+      extendsKeyword = token;
+      if (optional('with', peekAfterType(token.next))) {
+        token = parseMixinApplication(token.next);
+      } else {
+        token = parseType(token.next);
+      }
+    } else {
+      extendsKeyword = null;
+      listener.handleNoType(token);
+    }
+    Token implementsKeyword;
+    int interfacesCount = 0;
+    if (optional('implements', token)) {
+      implementsKeyword = token;
+      do {
+        token = parseType(token.next);
+        ++interfacesCount;
+      } while (optional(',', token));
+    }
+    token = parseClassBody(token);
+    listener.endClassDeclaration(interfacesCount, begin, extendsKeyword,
+                                 implementsKeyword, token);
+    return token.next;
+  }
+
+  Token parseStringPart(Token token) {
+    if (identical(token.kind, STRING_TOKEN)) {
+      listener.handleStringPart(token);
+      return token.next;
+    } else {
+      return listener.expected('string', token);
+    }
+  }
+
+  Token parseIdentifier(Token token) {
+    if (!token.isIdentifier()) {
+      token = listener.expectedIdentifier(token);
+    }
+    listener.handleIdentifier(token);
+    return token.next;
+  }
+
+  Token expect(String string, Token token) {
+    if (!identical(string, token.stringValue)) {
+      return listener.expected(string, token);
+    }
+    return token.next;
+  }
+
+  Token parseTypeVariable(Token token) {
+    listener.beginTypeVariable(token);
+    token = parseIdentifier(token);
+    if (optional('extends', token)) {
+      token = parseType(token.next);
+    } else {
+      listener.handleNoType(token);
+    }
+    listener.endTypeVariable(token);
+    return token;
+  }
+
+  /**
+   * Returns true if the stringValue of the [token] is [value].
+   */
+  bool optional(String value, Token token) {
+    return identical(value, token.stringValue);
+  }
+
+  /**
+   * Returns true if the stringValue of the [token] is either [value1],
+   * [value2], [value3], or [value4].
+   */
+  bool isOneOf4(Token token,
+                String value1, String value2, String value3, String value4) {
+    String stringValue = token.stringValue;
+    return identical(value1, stringValue) ||
+           identical(value2, stringValue) ||
+           identical(value3, stringValue) ||
+           identical(value4, stringValue);
+  }
+
+  bool notEofOrValue(String value, Token token) {
+    return !identical(token.kind, EOF_TOKEN) &&
+           !identical(value, token.stringValue);
+  }
+
+  Token parseType(Token token) {
+    Token begin = token;
+    if (isValidTypeReference(token)) {
+      token = parseIdentifier(token);
+      token = parseQualifiedRestOpt(token);
+    } else {
+      token = listener.expectedType(token);
+    }
+    token = parseTypeArgumentsOpt(token);
+    listener.endType(begin, token);
+    return token;
+  }
+
+  Token parseTypeArgumentsOpt(Token token) {
+    return parseStuff(token,
+                      (t) => listener.beginTypeArguments(t),
+                      (t) => parseType(t),
+                      (c, bt, et) => listener.endTypeArguments(c, bt, et),
+                      (t) => listener.handleNoTypeArguments(t));
+  }
+
+  Token parseTypeVariablesOpt(Token token) {
+    return parseStuff(token,
+                      (t) => listener.beginTypeVariables(t),
+                      (t) => parseTypeVariable(t),
+                      (c, bt, et) => listener.endTypeVariables(c, bt, et),
+                      (t) => listener.handleNoTypeVariables(t));
+  }
+
+  // TODO(ahe): Clean this up.
+  Token parseStuff(Token token, Function beginStuff, Function stuffParser,
+                   Function endStuff, Function handleNoStuff) {
+    if (optional('<', token)) {
+      Token begin = token;
+      beginStuff(begin);
+      int count = 0;
+      do {
+        token = stuffParser(token.next);
+        ++count;
+      } while (optional(',', token));
+      Token next = token.next;
+      if (identical(token.stringValue, '>>')) {
+        token = new SymbolToken(GT_INFO, token.charOffset);
+        token.next = new SymbolToken(GT_INFO, token.charOffset + 1);
+        token.next.next = next;
+      } else if (identical(token.stringValue, '>>>')) {
+        token = new SymbolToken(GT_INFO, token.charOffset);
+        token.next = new SymbolToken(GT_GT_INFO, token.charOffset + 1);
+        token.next.next = next;
+      }
+      endStuff(count, begin, token);
+      return expect('>', token);
+    }
+    handleNoStuff(token);
+    return token;
+  }
+
+  Token parseTopLevelMember(Token token) {
+    Token start = token;
+    listener.beginTopLevelMember(token);
+
+    Link<Token> identifiers = findMemberName(token);
+    if (identifiers.isEmpty) {
+      return listener.expectedDeclaration(start);
+    }
+    Token afterName = identifiers.head;
+    identifiers = identifiers.tail;
+
+    if (identifiers.isEmpty) {
+      return listener.expectedDeclaration(start);
+    }
+    Token name = identifiers.head;
+    identifiers = identifiers.tail;
+    Token getOrSet;
+    if (!identifiers.isEmpty) {
+      String value = identifiers.head.stringValue;
+      if ((identical(value, 'get')) || (identical(value, 'set'))) {
+        getOrSet = identifiers.head;
+        identifiers = identifiers.tail;
+      }
+    }
+    Token type;
+    if (!identifiers.isEmpty) {
+      if (isValidTypeReference(identifiers.head)) {
+        type = identifiers.head;
+        identifiers = identifiers.tail;
+      }
+    }
+
+    token = afterName;
+    bool isField;
+    while (true) {
+      // Loop to allow the listener to rewrite the token stream for
+      // error handling.
+      final String value = token.stringValue;
+      if ((identical(value, '(')) || (identical(value, '{'))
+          || (identical(value, '=>'))) {
+        isField = false;
+        break;
+      } else if ((identical(value, '=')) || (identical(value, ','))) {
+        isField = true;
+        break;
+      } else if (identical(value, ';')) {
+        if (getOrSet != null) {
+          // If we found a "get" keyword, this must be an abstract
+          // getter.
+          isField = (!identical(getOrSet.stringValue, 'get'));
+          // TODO(ahe): This feels like a hack.
+        } else {
+          isField = true;
+        }
+        break;
+      } else {
+        token = listener.unexpected(token);
+        if (identical(token.kind, EOF_TOKEN)) return token;
+      }
+    }
+    var modifiers = identifiers.reverse();
+    return isField
+        ? parseFields(start, modifiers, type, getOrSet, name, true)
+        : parseTopLevelMethod(start, modifiers, type, getOrSet, name);
+  }
+
+  bool isVarFinalOrConst(Token token) {
+    String value = token.stringValue;
+    return identical('var', value)
+        || identical('final', value)
+        || identical('const', value);
+  }
+
+  Token expectVarFinalOrConst(Link<Token> modifiers,
+                              bool hasType,
+                              bool allowStatic) {
+    int modifierCount = 0;
+    Token staticModifier;
+    if (allowStatic && !modifiers.isEmpty
+        && optional('static', modifiers.head)) {
+      staticModifier = modifiers.head;
+      modifierCount++;
+      parseModifier(staticModifier);
+      modifiers = modifiers.tail;
+    }
+    if (modifiers.isEmpty) {
+      listener.handleModifiers(modifierCount);
+      return null;
+    }
+    if (modifiers.tail.isEmpty) {
+      Token modifier = modifiers.head;
+      if (isVarFinalOrConst(modifier)) {
+        modifierCount++;
+        parseModifier(modifier);
+        listener.handleModifiers(modifierCount);
+        // TODO(ahe): The caller checks for "var Type name", perhaps we should
+        // check here instead.
+        return modifier;
+      }
+    }
+
+    // Slow case to report errors.
+    List<Token> modifierList = modifiers.toList();
+    Token varFinalOrConst =
+        modifierList.firstWhere(isVarFinalOrConst, orElse: () => null);
+    if (allowStatic && staticModifier == null) {
+      staticModifier =
+          modifierList.firstWhere(
+              (modifier) => optional('static', modifier), orElse: () => null);
+      if (staticModifier != null) {
+        modifierCount++;
+        parseModifier(staticModifier);
+        modifierList.remove(staticModifier);
+      }
+    }
+    bool hasTypeOrModifier = hasType;
+    if (varFinalOrConst != null) {
+      parseModifier(varFinalOrConst);
+      modifierCount++;
+      hasTypeOrModifier = true;
+      modifierList.remove(varFinalOrConst);
+    }
+    listener.handleModifiers(modifierCount);
+    var kind = hasTypeOrModifier
+        ? MessageKind.EXTRANEOUS_MODIFIER
+        : MessageKind.EXTRANEOUS_MODIFIER_REPLACE;
+    for (Token modifier in modifierList) {
+      listener.reportError(modifier, kind, {'modifier': modifier});
+    }
+    return null;
+  }
+
+  Token parseFields(Token start,
+                    Link<Token> modifiers,
+                    Token type,
+                    Token getOrSet,
+                    Token name,
+                    bool isTopLevel) {
+    bool hasType = type != null;
+    Token varFinalOrConst =
+        expectVarFinalOrConst(modifiers, hasType, !isTopLevel);
+    bool isVar = false;
+    bool hasModifier = false;
+    if (varFinalOrConst != null) {
+      hasModifier = true;
+      isVar = optional('var', varFinalOrConst);
+    }
+
+    if (getOrSet != null) {
+      var kind = (hasModifier || hasType)
+          ? MessageKind.EXTRANEOUS_MODIFIER
+          : MessageKind.EXTRANEOUS_MODIFIER_REPLACE;
+      listener.reportError(getOrSet, kind, {'modifier': getOrSet});
+    }
+
+    if (!hasType) {
+      listener.handleNoType(name);
+    } else if (optional('void', type)) {
+      listener.handleNoType(name);
+      // TODO(ahe): This error is reported twice, second time is from
+      // [parseVariablesDeclarationMaybeSemicolon] via
+      // [PartialFieldListElement.parseNode].
+      listener.reportError(type, MessageKind.VOID_NOT_ALLOWED);
+    } else {
+      parseType(type);
+      if (isVar) {
+        listener.reportError(
+            modifiers.head, MessageKind.EXTRANEOUS_MODIFIER,
+            {'modifier': modifiers.head});
+      }
+    }
+
+    Token token = parseIdentifier(name);
+
+    int fieldCount = 1;
+    token = parseVariableInitializerOpt(token);
+    while (optional(',', token)) {
+      token = parseIdentifier(token.next);
+      token = parseVariableInitializerOpt(token);
+      ++fieldCount;
+    }
+    Token semicolon = token;
+    token = expectSemicolon(token);
+    if (isTopLevel) {
+      listener.endTopLevelFields(fieldCount, start, semicolon);
+    } else {
+      listener.endFields(fieldCount, start, semicolon);
+    }
+    return token;
+  }
+
+  Token parseTopLevelMethod(Token start,
+                            Link<Token> modifiers,
+                            Token type,
+                            Token getOrSet,
+                            Token name) {
+
+    Token externalModifier;
+    for (Token modifier in modifiers) {
+      if (externalModifier == null && optional('external', modifier)) {
+        externalModifier = modifier;
+      } else {
+        listener.reportError(
+            modifier, MessageKind.EXTRANEOUS_MODIFIER, {'modifier': modifier});
+      }
+    }
+    if (externalModifier != null) {
+      parseModifier(externalModifier);
+      listener.handleModifiers(1);
+    } else {
+      listener.handleModifiers(0);
+    }
+
+    if (type == null) {
+      listener.handleNoType(name);
+    } else {
+      parseReturnTypeOpt(type);
+    }
+    Token token = parseIdentifier(name);
+
+    token = parseFormalParametersOpt(token);
+    bool previousYieldIsKeyword = yieldIsKeyword;
+    bool previousAwaitIsKeyword = awaitIsKeyword;
+    token = parseAsyncModifier(token);
+    token = parseFunctionBody(token, false, externalModifier != null);
+    yieldIsKeyword = previousYieldIsKeyword;
+    awaitIsKeyword = previousAwaitIsKeyword;
+    Token endToken = token;
+    token = token.next;
+    if (token.kind == BAD_INPUT_TOKEN) {
+      token = listener.unexpected(token);
+    }
+    listener.endTopLevelMethod(start, getOrSet, endToken);
+    return token;
+  }
+
+  /// Looks ahead to find the name of a member. Returns a link of the modifiers,
+  /// set/get, (operator) name, and either the start of the method body or the
+  /// end of the declaration.
+  ///
+  /// Examples:
+  ///
+  ///     int get foo;
+  /// results in
+  ///     [';', 'foo', 'get', 'int']
+  ///
+  ///
+  ///     static const List<int> foo = null;
+  /// results in
+  ///     ['=', 'foo', 'List', 'const', 'static']
+  ///
+  ///
+  ///     get foo async* { return null }
+  /// results in
+  ///     ['{', 'foo', 'get']
+  ///
+  ///
+  ///     operator *(arg) => null;
+  /// results in
+  ///     ['(', '*', 'operator']
+  ///
+  Link<Token> findMemberName(Token token) {
+    Link<Token> identifiers = const Link<Token>();
+
+    // `true` if 'get' has been seen.
+    bool isGetter = false;
+    // `true` if an identifier has been seen after 'get'.
+    bool hasName = false;
+
+    while (token.kind != EOF_TOKEN) {
+      String value = token.stringValue;
+      if (value == 'get') {
+        isGetter = true;
+      } else if (hasName &&
+                 (value == 'sync' || value == 'async')) {
+        // Skip.
+        token = token.next;
+        value = token.stringValue;
+        if (value == '*') {
+          // Skip.
+          token = token.next;
+        }
+        continue;
+      } else if (value == '(' ||
+                 value == '{' ||
+                 value == '=>') {
+        // A method.
+        identifiers = identifiers.prepend(token);
+        return identifiers;
+      } else if (value == '=' ||
+                 value == ';' ||
+                 value == ',') {
+        // A field or abstract getter.
+        identifiers = identifiers.prepend(token);
+        return identifiers;
+      } else if (isGetter) {
+        hasName = true;
+      }
+      identifiers = identifiers.prepend(token);
+      if (isValidTypeReference(token)) {
+        // type ...
+        if (optional('.', token.next)) {
+          // type '.' ...
+          if (token.next.next.isIdentifier()) {
+            // type '.' identifier
+            token = token.next.next;
+          }
+        }
+        if (optional('<', token.next)) {
+          if (token.next is BeginGroupToken) {
+            BeginGroupToken beginGroup = token.next;
+            if (beginGroup.endGroup == null) {
+              listener.unmatched(beginGroup);
+            }
+            token = beginGroup.endGroup;
+          }
+        }
+      }
+      token = token.next;
+    }
+    return const Link<Token>();
+  }
+
+  Token parseVariableInitializerOpt(Token token) {
+    if (optional('=', token)) {
+      Token assignment = token;
+      listener.beginInitializer(token);
+      token = parseExpression(token.next);
+      listener.endInitializer(assignment);
+    }
+    return token;
+  }
+
+  Token parseInitializersOpt(Token token) {
+    if (optional(':', token)) {
+      return parseInitializers(token);
+    } else {
+      listener.handleNoInitializers();
+      return token;
+    }
+  }
+
+  Token parseInitializers(Token token) {
+    Token begin = token;
+    listener.beginInitializers(begin);
+    expect(':', token);
+    int count = 0;
+    bool old = mayParseFunctionExpressions;
+    mayParseFunctionExpressions = false;
+    do {
+      token = parseExpression(token.next);
+      ++count;
+    } while (optional(',', token));
+    mayParseFunctionExpressions = old;
+    listener.endInitializers(count, begin, token);
+    return token;
+  }
+
+  Token parseLiteralStringOrRecoverExpression(Token token) {
+    if (identical(token.kind, STRING_TOKEN)) {
+      return parseLiteralString(token);
+    } else {
+      listener.recoverableError(token, "unexpected");
+      return parseExpression(token);
+    }
+  }
+
+  Token expectSemicolon(Token token) {
+    return expect(';', token);
+  }
+
+  bool isModifier(Token token) {
+    final String value = token.stringValue;
+    return (identical('final', value)) ||
+           (identical('var', value)) ||
+           (identical('const', value)) ||
+           (identical('abstract', value)) ||
+           (identical('static', value)) ||
+           (identical('external', value));
+  }
+
+  Token parseModifier(Token token) {
+    assert(isModifier(token));
+    listener.handleModifier(token);
+    return token.next;
+  }
+
+  void parseModifierList(Link<Token> tokens) {
+    int count = 0;
+    for (; !tokens.isEmpty; tokens = tokens.tail) {
+      Token token = tokens.head;
+      if (isModifier(token)) {
+        parseModifier(token);
+      } else {
+        listener.unexpected(token);
+        // Skip the remaining modifiers.
+        break;
+      }
+      count++;
+    }
+    listener.handleModifiers(count);
+  }
+
+  Token parseModifiers(Token token) {
+    int count = 0;
+    while (identical(token.kind, KEYWORD_TOKEN)) {
+      if (!isModifier(token))
+        break;
+      token = parseModifier(token);
+      count++;
+    }
+    listener.handleModifiers(count);
+    return token;
+  }
+
+  /**
+   * Returns the first token after the type starting at [token].
+   * This method assumes that [token] is an identifier (or void).
+   * Use [peekAfterIfType] if [token] isn't known to be an identifier.
+   */
+  Token peekAfterType(Token token) {
+    // We are looking at "identifier ...".
+    Token peek = token.next;
+    if (identical(peek.kind, PERIOD_TOKEN)) {
+      if (peek.next.isIdentifier()) {
+        // Look past a library prefix.
+        peek = peek.next.next;
+      }
+    }
+    // We are looking at "qualified ...".
+    if (identical(peek.kind, LT_TOKEN)) {
+      // Possibly generic type.
+      // We are looking at "qualified '<'".
+      BeginGroupToken beginGroupToken = peek;
+      Token gtToken = beginGroupToken.endGroup;
+      if (gtToken != null) {
+        // We are looking at "qualified '<' ... '>' ...".
+        return gtToken.next;
+      }
+    }
+    return peek;
+  }
+
+  /**
+   * If [token] is the start of a type, returns the token after that type.
+   * If [token] is not the start of a type, null is returned.
+   */
+  Token peekAfterIfType(Token token) {
+    if (!optional('void', token) && !token.isIdentifier()) {
+      return null;
+    }
+    return peekAfterType(token);
+  }
+
+  Token parseClassBody(Token token) {
+    Token begin = token;
+    listener.beginClassBody(token);
+    if (!optional('{', token)) {
+      token = listener.expectedClassBody(token);
+    }
+    token = token.next;
+    int count = 0;
+    while (notEofOrValue('}', token)) {
+      token = parseMember(token);
+      ++count;
+    }
+    expect('}', token);
+    listener.endClassBody(count, begin, token);
+    return token;
+  }
+
+  bool isGetOrSet(Token token) {
+    final String value = token.stringValue;
+    return (identical(value, 'get')) || (identical(value, 'set'));
+  }
+
+  bool isFactoryDeclaration(Token token) {
+    if (optional('external', token)) token = token.next;
+    if (optional('const', token)) token = token.next;
+    return optional('factory', token);
+  }
+
+  Token parseMember(Token token) {
+    token = parseMetadataStar(token);
+    if (isFactoryDeclaration(token)) {
+      return parseFactoryMethod(token);
+    }
+    Token start = token;
+    listener.beginMember(token);
+
+    Link<Token> identifiers = findMemberName(token);
+    if (identifiers.isEmpty) {
+      return listener.expectedDeclaration(start);
+    }
+    Token afterName = identifiers.head;
+    identifiers = identifiers.tail;
+
+    if (identifiers.isEmpty) {
+      return listener.expectedDeclaration(start);
+    }
+    Token name = identifiers.head;
+    identifiers = identifiers.tail;
+    if (!identifiers.isEmpty) {
+      if (optional('operator', identifiers.head)) {
+        name = identifiers.head;
+        identifiers = identifiers.tail;
+      }
+    }
+    Token getOrSet;
+    if (!identifiers.isEmpty) {
+      if (isGetOrSet(identifiers.head)) {
+        getOrSet = identifiers.head;
+        identifiers = identifiers.tail;
+      }
+    }
+    Token type;
+    if (!identifiers.isEmpty) {
+      if (isValidTypeReference(identifiers.head)) {
+        type = identifiers.head;
+        identifiers = identifiers.tail;
+      }
+    }
+
+    token = afterName;
+    bool isField;
+    while (true) {
+      // Loop to allow the listener to rewrite the token stream for
+      // error handling.
+      final String value = token.stringValue;
+      if ((identical(value, '(')) || (identical(value, '.'))
+          || (identical(value, '{')) || (identical(value, '=>'))) {
+        isField = false;
+        break;
+      } else if (identical(value, ';')) {
+        if (getOrSet != null) {
+          // If we found a "get" keyword, this must be an abstract
+          // getter.
+          isField = (!identical(getOrSet.stringValue, 'get'));
+          // TODO(ahe): This feels like a hack.
+        } else {
+          isField = true;
+        }
+        break;
+      } else if ((identical(value, '=')) || (identical(value, ','))) {
+        isField = true;
+        break;
+      } else {
+        token = listener.unexpected(token);
+        if (identical(token.kind, EOF_TOKEN)) {
+          // TODO(ahe): This is a hack, see parseTopLevelMember.
+          listener.endFields(1, start, token);
+          return token;
+        }
+      }
+    }
+
+    var modifiers = identifiers.reverse();
+    return isField
+        ? parseFields(start, modifiers, type, getOrSet, name, false)
+        : parseMethod(start, modifiers, type, getOrSet, name);
+
+  }
+
+  Token parseMethod(Token start,
+                    Link<Token> modifiers,
+                    Token type,
+                    Token getOrSet,
+                    Token name) {
+    Token externalModifier;
+    Token staticModifier;
+    Token constModifier;
+    int modifierCount = 0;
+    int allowedModifierCount = 1;
+    for (Token modifier in modifiers) {
+      if (externalModifier == null && optional('external', modifier)) {
+        modifierCount++;
+        externalModifier = modifier;
+        if (modifierCount != allowedModifierCount) {
+          listener.reportError(
+              modifier,
+              MessageKind.EXTRANEOUS_MODIFIER, {'modifier': modifier});
+        }
+        allowedModifierCount++;
+      } else if (staticModifier == null && optional('static', modifier)) {
+        modifierCount++;
+        staticModifier = modifier;
+        if (modifierCount != allowedModifierCount) {
+          listener.reportError(
+              modifier,
+              MessageKind.EXTRANEOUS_MODIFIER, {'modifier': modifier});
+        }
+      } else if (constModifier == null && optional('const', modifier)) {
+        modifierCount++;
+        constModifier = modifier;
+        if (modifierCount != allowedModifierCount) {
+          listener.reportError(
+              modifier,
+              MessageKind.EXTRANEOUS_MODIFIER, {'modifier': modifier});
+        }
+      } else {
+        listener.reportError(
+            modifier, MessageKind.EXTRANEOUS_MODIFIER, {'modifier': modifier});
+      }
+    }
+    parseModifierList(modifiers);
+
+    if (type == null) {
+      listener.handleNoType(name);
+    } else {
+      parseReturnTypeOpt(type);
+    }
+    Token token;
+    if (optional('operator', name)) {
+      token = parseOperatorName(name);
+      if (staticModifier != null) {
+        // TODO(ahe): Consider a more specific error message.
+        listener.reportError(
+            staticModifier, MessageKind.EXTRANEOUS_MODIFIER,
+            {'modifier': staticModifier});
+      }
+    } else {
+      token = parseIdentifier(name);
+    }
+
+    token = parseQualifiedRestOpt(token);
+    token = parseFormalParametersOpt(token);
+    token = parseInitializersOpt(token);
+    bool previousYieldIsKeyword = yieldIsKeyword;
+    bool previousAwaitIsKeyword = awaitIsKeyword;
+    token = parseAsyncModifier(token);
+    if (optional('=', token)) {
+      token = parseRedirectingFactoryBody(token);
+    } else {
+      token = parseFunctionBody(
+          token, false, staticModifier == null || externalModifier != null);
+    }
+    yieldIsKeyword = previousYieldIsKeyword;
+    awaitIsKeyword = previousAwaitIsKeyword;
+    listener.endMethod(getOrSet, start, token);
+    return token.next;
+  }
+
+  Token parseFactoryMethod(Token token) {
+    assert(isFactoryDeclaration(token));
+    Token start = token;
+    Token externalModifier;
+    if (identical(token.stringValue, 'external')) {
+      externalModifier = token;
+      token = token.next;
+    }
+    if (optional('const', token)) {
+      token = token.next; // Skip const.
+    }
+    Token factoryKeyword = token;
+    listener.beginFactoryMethod(factoryKeyword);
+    token = token.next; // Skip 'factory'.
+    token = parseConstructorReference(token);
+    token = parseFormalParameters(token);
+    token = parseAsyncModifier(token);
+    if (optional('=', token)) {
+      token = parseRedirectingFactoryBody(token);
+    } else {
+      token = parseFunctionBody(token, false, externalModifier != null);
+    }
+    listener.endFactoryMethod(start, token);
+    return token.next;
+  }
+
+  Token parseOperatorName(Token token) {
+    assert(optional('operator', token));
+    if (isUserDefinableOperator(token.next.stringValue)) {
+      Token operator = token;
+      token = token.next;
+      listener.handleOperatorName(operator, token);
+      return token.next;
+    } else {
+      return parseIdentifier(token);
+    }
+  }
+
+  Token parseFunction(Token token, Token getOrSet) {
+    listener.beginFunction(token);
+    token = parseModifiers(token);
+    if (identical(getOrSet, token)) {
+      // get <name>  => ...
+      token = token.next;
+      listener.handleNoType(token);
+      listener.beginFunctionName(token);
+      if (optional('operator', token)) {
+        token = parseOperatorName(token);
+      } else {
+        token = parseIdentifier(token);
+      }
+    } else if (optional('operator', token)) {
+      // operator <op> (...
+      listener.handleNoType(token);
+      listener.beginFunctionName(token);
+      token = parseOperatorName(token);
+    } else {
+      // <type>? <get>? <name>
+      token = parseReturnTypeOpt(token);
+      if (identical(getOrSet, token)) {
+        token = token.next;
+      }
+      listener.beginFunctionName(token);
+      if (optional('operator', token)) {
+        token = parseOperatorName(token);
+      } else {
+        token = parseIdentifier(token);
+      }
+    }
+    token = parseQualifiedRestOpt(token);
+    listener.endFunctionName(token);
+    token = parseFormalParametersOpt(token);
+    token = parseInitializersOpt(token);
+    bool previousYieldIsKeyword = yieldIsKeyword;
+    bool previousAwaitIsKeyword = awaitIsKeyword;
+    token = parseAsyncModifier(token);
+    if (optional('=', token)) {
+      token = parseRedirectingFactoryBody(token);
+    } else {
+      token = parseFunctionBody(token, false, true);
+    }
+    yieldIsKeyword = previousYieldIsKeyword;
+    awaitIsKeyword = previousAwaitIsKeyword;
+    listener.endFunction(getOrSet, token);
+    return token.next;
+  }
+
+  Token parseUnnamedFunction(Token token) {
+    listener.beginUnnamedFunction(token);
+    token = parseFormalParameters(token);
+    bool previousYieldIsKeyword = yieldIsKeyword;
+    bool previousAwaitIsKeyword = awaitIsKeyword;
+    token = parseAsyncModifier(token);
+    bool isBlock = optional('{', token);
+    token = parseFunctionBody(token, true, false);
+    yieldIsKeyword = previousYieldIsKeyword;
+    awaitIsKeyword = previousAwaitIsKeyword;
+    listener.endUnnamedFunction(token);
+    return isBlock ? token.next : token;
+  }
+
+  Token parseFunctionDeclaration(Token token) {
+    listener.beginFunctionDeclaration(token);
+    token = parseFunction(token, null);
+    listener.endFunctionDeclaration(token);
+    return token;
+  }
+
+  Token parseFunctionExpression(Token token) {
+    listener.beginFunction(token);
+    listener.handleModifiers(0);
+    token = parseReturnTypeOpt(token);
+    listener.beginFunctionName(token);
+    token = parseIdentifier(token);
+    listener.endFunctionName(token);
+    token = parseFormalParameters(token);
+    listener.handleNoInitializers();
+    bool previousYieldIsKeyword = yieldIsKeyword;
+    bool previousAwaitIsKeyword = awaitIsKeyword;
+    token = parseAsyncModifier(token);
+    bool isBlock = optional('{', token);
+    token = parseFunctionBody(token, true, false);
+    yieldIsKeyword = previousYieldIsKeyword;
+    awaitIsKeyword = previousAwaitIsKeyword;
+    listener.endFunction(null, token);
+    return isBlock ? token.next : token;
+  }
+
+  Token parseConstructorReference(Token token) {
+    Token start = token;
+    listener.beginConstructorReference(start);
+    token = parseIdentifier(token);
+    token = parseQualifiedRestOpt(token);
+    token = parseTypeArgumentsOpt(token);
+    Token period = null;
+    if (optional('.', token)) {
+      period = token;
+      token = parseIdentifier(token.next);
+    }
+    listener.endConstructorReference(start, period, token);
+    return token;
+  }
+
+  Token parseRedirectingFactoryBody(Token token) {
+    listener.beginRedirectingFactoryBody(token);
+    assert(optional('=', token));
+    Token equals = token;
+    token = parseConstructorReference(token.next);
+    Token semicolon = token;
+    expectSemicolon(token);
+    listener.endRedirectingFactoryBody(equals, semicolon);
+    return token;
+  }
+
+  Token parseFunctionBody(Token token, bool isExpression, bool allowAbstract) {
+    if (optional(';', token)) {
+      if (!allowAbstract) {
+        listener.reportError(token, MessageKind.BODY_EXPECTED);
+      }
+      listener.endFunctionBody(0, null, token);
+      return token;
+    } else if (optional('=>', token)) {
+      Token begin = token;
+      token = parseExpression(token.next);
+      if (!isExpression) {
+        expectSemicolon(token);
+        listener.endReturnStatement(true, begin, token);
+      } else {
+        listener.endReturnStatement(true, begin, null);
+      }
+      return token;
+    }
+    Token begin = token;
+    int statementCount = 0;
+    if (!optional('{', token)) {
+      return listener.expectedFunctionBody(token);
+    }
+
+    listener.beginFunctionBody(begin);
+    token = token.next;
+    while (notEofOrValue('}', token)) {
+      token = parseStatement(token);
+      ++statementCount;
+    }
+    listener.endFunctionBody(statementCount, begin, token);
+    expect('}', token);
+    return token;
+  }
+
+  Token parseAsyncModifier(Token token) {
+    Token async;
+    Token star;
+    awaitIsKeyword = false;
+    yieldIsKeyword = false;
+    if (optional('async', token)) {
+      awaitIsKeyword = true;
+      async = token;
+      token = token.next;
+      if (optional('*', token)) {
+        yieldIsKeyword = true;
+        star = token;
+        token = token.next;
+      }
+    } else if (optional('sync', token)) {
+      async = token;
+      token = token.next;
+      if (optional('*', token)) {
+        yieldIsKeyword = true;
+        star = token;
+        token = token.next;
+      } else {
+        listener.reportError(async,
+            MessageKind.INVALID_SYNC_MODIFIER);
+      }
+    }
+    listener.handleAsyncModifier(async, star);
+    return token;
+  }
+
+  Token parseStatement(Token token) {
+    final value = token.stringValue;
+    if (identical(token.kind, IDENTIFIER_TOKEN)) {
+      return parseExpressionStatementOrDeclaration(token);
+    } else if (identical(value, '{')) {
+      return parseBlock(token);
+    } else if (identical(value, 'return')) {
+      return parseReturnStatement(token);
+    } else if (identical(value, 'var') || identical(value, 'final')) {
+      return parseVariablesDeclaration(token);
+    } else if (identical(value, 'if')) {
+      return parseIfStatement(token);
+    } else if (awaitIsKeyword && identical(value, 'await')) {
+      if (identical(token.next.stringValue, 'for')) {
+        return parseForStatement(token, token.next);
+      } else {
+        return parseExpressionStatement(token);
+      }
+    } else if (identical(value, 'for')) {
+      return parseForStatement(null, token);
+    } else if (identical(value, 'rethrow')) {
+      return parseRethrowStatement(token);
+    } else if (identical(value, 'throw') && optional(';', token.next)) {
+      // TODO(kasperl): Stop dealing with throw here.
+      return parseRethrowStatement(token);
+    } else if (identical(value, 'void')) {
+      return parseExpressionStatementOrDeclaration(token);
+    } else if (identical(value, 'while')) {
+      return parseWhileStatement(token);
+    } else if (identical(value, 'do')) {
+      return parseDoWhileStatement(token);
+    } else if (identical(value, 'try')) {
+      return parseTryStatement(token);
+    } else if (identical(value, 'switch')) {
+      return parseSwitchStatement(token);
+    } else if (identical(value, 'break')) {
+      return parseBreakStatement(token);
+    } else if (identical(value, 'continue')) {
+      return parseContinueStatement(token);
+    } else if (identical(value, 'assert')) {
+      return parseAssertStatement(token);
+    } else if (identical(value, ';')) {
+      return parseEmptyStatement(token);
+    } else if (yieldIsKeyword && identical(value, 'yield')) {
+      return parseYieldStatement(token);
+    } else if (identical(value, 'const')) {
+      return parseExpressionStatementOrConstDeclaration(token);
+    } else if (token.isIdentifier()) {
+      return parseExpressionStatementOrDeclaration(token);
+    } else {
+      return parseExpressionStatement(token);
+    }
+  }
+
+  Token parseYieldStatement(Token token) {
+    Token begin = token;
+    listener.beginYieldStatement(begin);
+    assert(identical('yield', token.stringValue));
+    token = token.next;
+    Token starToken;
+    if (optional('*', token)) {
+      starToken = token;
+      token = token.next;
+    }
+    token = parseExpression(token);
+    listener.endYieldStatement(begin, starToken, token);
+    return expectSemicolon(token);
+  }
+
+
+  Token parseReturnStatement(Token token) {
+    Token begin = token;
+    listener.beginReturnStatement(begin);
+    assert(identical('return', token.stringValue));
+    token = token.next;
+    if (optional(';', token)) {
+      listener.endReturnStatement(false, begin, token);
+    } else {
+      token = parseExpression(token);
+      listener.endReturnStatement(true, begin, token);
+    }
+    return expectSemicolon(token);
+  }
+
+  Token peekIdentifierAfterType(Token token) {
+    Token peek = peekAfterType(token);
+    if (peek != null && peek.isIdentifier()) {
+      // We are looking at "type identifier".
+      return peek;
+    } else {
+      return null;
+    }
+  }
+
+  Token peekIdentifierAfterOptionalType(Token token) {
+    Token peek = peekAfterIfType(token);
+    if (peek != null && peek.isIdentifier()) {
+      // We are looking at "type identifier".
+      return peek;
+    } else if (token.isIdentifier()) {
+      // We are looking at "identifier".
+      return token;
+    } else {
+      return null;
+    }
+  }
+
+  Token parseExpressionStatementOrDeclaration(Token token) {
+    assert(token.isIdentifier() || identical(token.stringValue, 'void'));
+    Token identifier = peekIdentifierAfterType(token);
+    if (identifier != null) {
+      assert(identifier.isIdentifier());
+      Token afterId = identifier.next;
+      int afterIdKind = afterId.kind;
+      if (identical(afterIdKind, EQ_TOKEN) ||
+          identical(afterIdKind, SEMICOLON_TOKEN) ||
+          identical(afterIdKind, COMMA_TOKEN)) {
+        // We are looking at "type identifier" followed by '=', ';', ','.
+        return parseVariablesDeclaration(token);
+      } else if (identical(afterIdKind, OPEN_PAREN_TOKEN)) {
+        // We are looking at "type identifier '('".
+        BeginGroupToken beginParen = afterId;
+        Token endParen = beginParen.endGroup;
+        Token afterParens = endParen.next;
+        if (optional('{', afterParens) ||
+            optional('=>', afterParens) ||
+            optional('async', afterParens) ||
+            optional('sync', afterParens)) {
+          // We are looking at "type identifier '(' ... ')'" followed
+          // by '=>' or '{'.
+          return parseFunctionDeclaration(token);
+        }
+      }
+      // Fall-through to expression statement.
+    } else {
+      if (optional(':', token.next)) {
+        return parseLabeledStatement(token);
+      } else if (optional('(', token.next)) {
+        BeginGroupToken begin = token.next;
+        String afterParens = begin.endGroup.next.stringValue;
+        if (identical(afterParens, '{') ||
+            identical(afterParens, '=>') ||
+            identical(afterParens, 'async') ||
+            identical(afterParens, 'sync')) {
+          return parseFunctionDeclaration(token);
+        }
+      }
+    }
+    return parseExpressionStatement(token);
+  }
+
+  Token parseExpressionStatementOrConstDeclaration(Token token) {
+    assert(identical(token.stringValue, 'const'));
+    if (isModifier(token.next)) {
+      return parseVariablesDeclaration(token);
+    }
+    Token identifier = peekIdentifierAfterOptionalType(token.next);
+    if (identifier != null) {
+      assert(identifier.isIdentifier());
+      Token afterId = identifier.next;
+      int afterIdKind = afterId.kind;
+      if (identical(afterIdKind, EQ_TOKEN) ||
+          identical(afterIdKind, SEMICOLON_TOKEN) ||
+          identical(afterIdKind, COMMA_TOKEN)) {
+        // We are looking at "const type identifier" followed by '=', ';', or
+        // ','.
+        return parseVariablesDeclaration(token);
+      }
+      // Fall-through to expression statement.
+    }
+
+    return parseExpressionStatement(token);
+  }
+
+  Token parseLabel(Token token) {
+    token = parseIdentifier(token);
+    Token colon = token;
+    token = expect(':', token);
+    listener.handleLabel(colon);
+    return token;
+  }
+
+  Token parseLabeledStatement(Token token) {
+    int labelCount = 0;
+    do {
+      token = parseLabel(token);
+      labelCount++;
+    } while (token.isIdentifier() && optional(':', token.next));
+    listener.beginLabeledStatement(token, labelCount);
+    token = parseStatement(token);
+    listener.endLabeledStatement(labelCount);
+    return token;
+  }
+
+  Token parseExpressionStatement(Token token) {
+    listener.beginExpressionStatement(token);
+    token = parseExpression(token);
+    listener.endExpressionStatement(token);
+    return expectSemicolon(token);
+  }
+
+  Token parseExpression(Token token) {
+    return optional('throw', token)
+        ? parseThrowExpression(token, true)
+        : parsePrecedenceExpression(token, ASSIGNMENT_PRECEDENCE, true);
+  }
+
+  Token parseExpressionWithoutCascade(Token token) {
+    return optional('throw', token)
+        ? parseThrowExpression(token, false)
+        : parsePrecedenceExpression(token, ASSIGNMENT_PRECEDENCE, false);
+  }
+
+  Token parseConditionalExpressionRest(Token token) {
+    assert(optional('?', token));
+    Token question = token;
+    token = parseExpressionWithoutCascade(token.next);
+    Token colon = token;
+    token = expect(':', token);
+    token = parseExpressionWithoutCascade(token);
+    listener.handleConditionalExpression(question, colon);
+    return token;
+  }
+
+  Token parsePrecedenceExpression(Token token, int precedence,
+                                  bool allowCascades) {
+    assert(precedence >= 1);
+    assert(precedence <= POSTFIX_PRECEDENCE);
+    token = parseUnaryExpression(token, allowCascades);
+    PrecedenceInfo info = token.info;
+    int tokenLevel = info.precedence;
+    for (int level = tokenLevel; level >= precedence; --level) {
+      while (identical(tokenLevel, level)) {
+        Token operator = token;
+        if (identical(tokenLevel, CASCADE_PRECEDENCE)) {
+          if (!allowCascades) {
+            return token;
+          }
+          token = parseCascadeExpression(token);
+        } else if (identical(tokenLevel, ASSIGNMENT_PRECEDENCE)) {
+          // Right associative, so we recurse at the same precedence
+          // level.
+          token = parsePrecedenceExpression(token.next, level, allowCascades);
+          listener.handleAssignmentExpression(operator);
+        } else if (identical(tokenLevel, POSTFIX_PRECEDENCE)) {
+          if (identical(info, PERIOD_INFO) ||
+              identical(info, QUESTION_PERIOD_INFO)) {
+            // Left associative, so we recurse at the next higher
+            // precedence level. However, POSTFIX_PRECEDENCE is the
+            // highest level, so we just call parseUnaryExpression
+            // directly.
+            token = parseUnaryExpression(token.next, allowCascades);
+            listener.handleBinaryExpression(operator);
+          } else if ((identical(info, OPEN_PAREN_INFO)) ||
+                     (identical(info, OPEN_SQUARE_BRACKET_INFO))) {
+            token = parseArgumentOrIndexStar(token);
+          } else if ((identical(info, PLUS_PLUS_INFO)) ||
+                     (identical(info, MINUS_MINUS_INFO))) {
+            listener.handleUnaryPostfixAssignmentExpression(token);
+            token = token.next;
+          } else {
+            token = listener.unexpected(token);
+          }
+        } else if (identical(info, IS_INFO)) {
+          token = parseIsOperatorRest(token);
+        } else if (identical(info, AS_INFO)) {
+          token = parseAsOperatorRest(token);
+        } else if (identical(info, QUESTION_INFO)) {
+          token = parseConditionalExpressionRest(token);
+        } else {
+          // Left associative, so we recurse at the next higher
+          // precedence level.
+          token = parsePrecedenceExpression(token.next, level + 1,
+                                            allowCascades);
+          listener.handleBinaryExpression(operator);
+        }
+        info = token.info;
+        tokenLevel = info.precedence;
+        if (level == EQUALITY_PRECEDENCE || level == RELATIONAL_PRECEDENCE) {
+          // We don't allow (a == b == c) or (a < b < c).
+          // Continue the outer loop if we have matched one equality or
+          // relational operator.
+          break;
+        }
+      }
+    }
+    return token;
+  }
+
+  Token parseCascadeExpression(Token token) {
+    listener.beginCascade(token);
+    assert(optional('..', token));
+    Token cascadeOperator = token;
+    token = token.next;
+    if (optional('[', token)) {
+      token = parseArgumentOrIndexStar(token);
+    } else if (token.isIdentifier()) {
+      token = parseSend(token);
+      listener.handleBinaryExpression(cascadeOperator);
+    } else {
+      return listener.unexpected(token);
+    }
+    Token mark;
+    do {
+      mark = token;
+      if (optional('.', token)) {
+        Token period = token;
+        token = parseSend(token.next);
+        listener.handleBinaryExpression(period);
+      }
+      token = parseArgumentOrIndexStar(token);
+    } while (!identical(mark, token));
+
+    if (identical(token.info.precedence, ASSIGNMENT_PRECEDENCE)) {
+      Token assignment = token;
+      token = parseExpressionWithoutCascade(token.next);
+      listener.handleAssignmentExpression(assignment);
+    }
+    listener.endCascade();
+    return token;
+  }
+
+  Token parseUnaryExpression(Token token, bool allowCascades) {
+    String value = token.stringValue;
+    // Prefix:
+    if (awaitIsKeyword && optional('await', token)) {
+      return parseAwaitExpression(token, allowCascades);
+    } else if (identical(value, '+')) {
+      // Dart no longer allows prefix-plus.
+      listener.reportError(token, MessageKind.UNSUPPORTED_PREFIX_PLUS);
+      return parseUnaryExpression(token.next, allowCascades);
+    } else if ((identical(value, '!')) ||
+               (identical(value, '-')) ||
+               (identical(value, '~'))) {
+      Token operator = token;
+      // Right associative, so we recurse at the same precedence
+      // level.
+      token = parsePrecedenceExpression(token.next, POSTFIX_PRECEDENCE,
+                                        allowCascades);
+      listener.handleUnaryPrefixExpression(operator);
+    } else if ((identical(value, '++')) || identical(value, '--')) {
+      // TODO(ahe): Validate this is used correctly.
+      Token operator = token;
+      // Right associative, so we recurse at the same precedence
+      // level.
+      token = parsePrecedenceExpression(token.next, POSTFIX_PRECEDENCE,
+                                        allowCascades);
+      listener.handleUnaryPrefixAssignmentExpression(operator);
+    } else {
+      token = parsePrimary(token);
+    }
+    return token;
+  }
+
+  Token parseArgumentOrIndexStar(Token token) {
+    while (true) {
+      if (optional('[', token)) {
+        Token openSquareBracket = token;
+        bool old = mayParseFunctionExpressions;
+        mayParseFunctionExpressions = true;
+        token = parseExpression(token.next);
+        mayParseFunctionExpressions = old;
+        listener.handleIndexedExpression(openSquareBracket, token);
+        token = expect(']', token);
+      } else if (optional('(', token)) {
+        token = parseArguments(token);
+        listener.endSend(token);
+      } else {
+        break;
+      }
+    }
+    return token;
+  }
+
+  Token parsePrimary(Token token) {
+    final kind = token.kind;
+    if (identical(kind, IDENTIFIER_TOKEN)) {
+      return parseSendOrFunctionLiteral(token);
+    } else if (identical(kind, INT_TOKEN)
+        || identical(kind, HEXADECIMAL_TOKEN)) {
+      return parseLiteralInt(token);
+    } else if (identical(kind, DOUBLE_TOKEN)) {
+      return parseLiteralDouble(token);
+    } else if (identical(kind, STRING_TOKEN)) {
+      return parseLiteralString(token);
+    } else if (identical(kind, HASH_TOKEN)) {
+      return parseLiteralSymbol(token);
+    } else if (identical(kind, KEYWORD_TOKEN)) {
+      final value = token.stringValue;
+      if ((identical(value, 'true')) || (identical(value, 'false'))) {
+        return parseLiteralBool(token);
+      } else if (identical(value, 'null')) {
+        return parseLiteralNull(token);
+      } else if (identical(value, 'this')) {
+        return parseThisExpression(token);
+      } else if (identical(value, 'super')) {
+        return parseSuperExpression(token);
+      } else if (identical(value, 'new')) {
+        return parseNewExpression(token);
+      } else if (identical(value, 'const')) {
+        return parseConstExpression(token);
+      } else if (identical(value, 'void')) {
+        return parseFunctionExpression(token);
+      } else if (token.isIdentifier()) {
+        return parseSendOrFunctionLiteral(token);
+      } else {
+        return listener.expectedExpression(token);
+      }
+    } else if (identical(kind, OPEN_PAREN_TOKEN)) {
+      return parseParenthesizedExpressionOrFunctionLiteral(token);
+    } else if ((identical(kind, LT_TOKEN)) ||
+               (identical(kind, OPEN_SQUARE_BRACKET_TOKEN)) ||
+               (identical(kind, OPEN_CURLY_BRACKET_TOKEN)) ||
+               identical(token.stringValue, '[]')) {
+      return parseLiteralListOrMap(token);
+    } else {
+      return listener.expectedExpression(token);
+    }
+  }
+
+  Token parseParenthesizedExpressionOrFunctionLiteral(Token token) {
+    BeginGroupToken beginGroup = token;
+    Token nextToken = beginGroup.endGroup.next;
+    int kind = nextToken.kind;
+    if (mayParseFunctionExpressions &&
+        (identical(kind, FUNCTION_TOKEN) ||
+         identical(kind, OPEN_CURLY_BRACKET_TOKEN) ||
+         (identical(kind, KEYWORD_TOKEN) &&
+             (nextToken.value == 'async' || nextToken.value == 'sync')))) {
+      return parseUnnamedFunction(token);
+    } else {
+      bool old = mayParseFunctionExpressions;
+      mayParseFunctionExpressions = true;
+      token = parseParenthesizedExpression(token);
+      mayParseFunctionExpressions = old;
+      return token;
+    }
+  }
+
+  Token parseParenthesizedExpression(Token token) {
+    // We expect [begin] to be of type [BeginGroupToken], but we don't know for
+    // sure until after calling expect.
+    var begin = token;
+    token = expect('(', token);
+    // [begin] is now known to have type [BeginGroupToken].
+    token = parseExpression(token);
+    if (!identical(begin.endGroup, token)) {
+      listener.unexpected(token);
+      token = begin.endGroup;
+    }
+    listener.handleParenthesizedExpression(begin);
+    return expect(')', token);
+  }
+
+  Token parseThisExpression(Token token) {
+    listener.handleThisExpression(token);
+    token = token.next;
+    if (optional('(', token)) {
+      // Constructor forwarding.
+      token = parseArguments(token);
+      listener.endSend(token);
+    }
+    return token;
+  }
+
+  Token parseSuperExpression(Token token) {
+    listener.handleSuperExpression(token);
+    token = token.next;
+    if (optional('(', token)) {
+      // Super constructor.
+      token = parseArguments(token);
+      listener.endSend(token);
+    }
+    return token;
+  }
+
+  Token parseLiteralListOrMap(Token token) {
+    Token constKeyword = null;
+    if (optional('const', token)) {
+      constKeyword = token;
+      token = token.next;
+    }
+    token = parseTypeArgumentsOpt(token);
+    Token beginToken = token;
+    int count = 0;
+    if (optional('{', token)) {
+      bool old = mayParseFunctionExpressions;
+      mayParseFunctionExpressions = true;
+      do {
+        if (optional('}', token.next)) {
+          token = token.next;
+          break;
+        }
+        token = parseMapLiteralEntry(token.next);
+        ++count;
+      } while (optional(',', token));
+      mayParseFunctionExpressions = old;
+      listener.handleLiteralMap(count, beginToken, constKeyword, token);
+      return expect('}', token);
+    } else if (optional('[', token)) {
+      bool old = mayParseFunctionExpressions;
+      mayParseFunctionExpressions = true;
+      do {
+        if (optional(']', token.next)) {
+          token = token.next;
+          break;
+        }
+        token = parseExpression(token.next);
+        ++count;
+      } while (optional(',', token));
+      mayParseFunctionExpressions = old;
+      listener.handleLiteralList(count, beginToken, constKeyword, token);
+      return expect(']', token);
+    } else if (optional('[]', token)) {
+      listener.handleLiteralList(0, token, constKeyword, token);
+      return token.next;
+    } else {
+      listener.unexpected(token);
+      return null;
+    }
+  }
+
+  Token parseMapLiteralEntry(Token token) {
+    listener.beginLiteralMapEntry(token);
+    // Assume the listener rejects non-string keys.
+    token = parseExpression(token);
+    Token colon = token;
+    token = expect(':', token);
+    token = parseExpression(token);
+    listener.endLiteralMapEntry(colon, token);
+    return token;
+  }
+
+  Token parseSendOrFunctionLiteral(Token token) {
+    if (!mayParseFunctionExpressions) return parseSend(token);
+    Token peek = peekAfterIfType(token);
+    if (peek != null &&
+        identical(peek.kind, IDENTIFIER_TOKEN) &&
+        isFunctionDeclaration(peek.next)) {
+      return parseFunctionExpression(token);
+    } else if (isFunctionDeclaration(token.next)) {
+      return parseFunctionExpression(token);
+    } else {
+      return parseSend(token);
+    }
+  }
+
+  bool isFunctionDeclaration(Token token) {
+    if (optional('(', token)) {
+      BeginGroupToken begin = token;
+      String afterParens = begin.endGroup.next.stringValue;
+      if (identical(afterParens, '{') ||
+          identical(afterParens, '=>') ||
+          identical(afterParens, 'async') ||
+          identical(afterParens, 'sync')) {
+        return true;
+      }
+    }
+    return false;
+  }
+
+  Token parseRequiredArguments(Token token) {
+    if (optional('(', token)) {
+      token = parseArguments(token);
+    } else {
+      listener.handleNoArguments(token);
+      token = listener.unexpected(token);
+    }
+    return token;
+  }
+
+  Token parseNewExpression(Token token) {
+    Token newKeyword = token;
+    token = expect('new', token);
+    token = parseConstructorReference(token);
+    token = parseRequiredArguments(token);
+    listener.handleNewExpression(newKeyword);
+    return token;
+  }
+
+  Token parseConstExpression(Token token) {
+    Token constKeyword = token;
+    token = expect('const', token);
+    final String value = token.stringValue;
+    if ((identical(value, '<')) ||
+        (identical(value, '[')) ||
+        (identical(value, '[]')) ||
+        (identical(value, '{'))) {
+      return parseLiteralListOrMap(constKeyword);
+    }
+    token = parseConstructorReference(token);
+    token = parseRequiredArguments(token);
+    listener.handleConstExpression(constKeyword);
+    return token;
+  }
+
+  Token parseLiteralInt(Token token) {
+    listener.handleLiteralInt(token);
+    return token.next;
+  }
+
+  Token parseLiteralDouble(Token token) {
+    listener.handleLiteralDouble(token);
+    return token.next;
+  }
+
+  Token parseLiteralString(Token token) {
+    bool old = mayParseFunctionExpressions;
+    mayParseFunctionExpressions = true;
+    token = parseSingleLiteralString(token);
+    int count = 1;
+    while (identical(token.kind, STRING_TOKEN)) {
+      token = parseSingleLiteralString(token);
+      count++;
+    }
+    if (count > 1) {
+      listener.handleStringJuxtaposition(count);
+    }
+    mayParseFunctionExpressions = old;
+    return token;
+  }
+
+  Token parseLiteralSymbol(Token token) {
+    Token hashToken = token;
+    listener.beginLiteralSymbol(hashToken);
+    token = token.next;
+    if (isUserDefinableOperator(token.stringValue)) {
+      listener.handleOperator(token);
+      listener.endLiteralSymbol(hashToken, 1);
+      return token.next;
+    } else {
+      int count = 1;
+      token = parseIdentifier(token);
+      while (identical(token.stringValue, '.')) {
+        count++;
+        token = parseIdentifier(token.next);
+      }
+      listener.endLiteralSymbol(hashToken, count);
+      return token;
+    }
+  }
+
+  /**
+   * Only called when [:token.kind === STRING_TOKEN:].
+   */
+  Token parseSingleLiteralString(Token token) {
+    listener.beginLiteralString(token);
+    // Parsing the prefix, for instance 'x of 'x${id}y${id}z'
+    token = token.next;
+    int interpolationCount = 0;
+    var kind = token.kind;
+    while (kind != EOF_TOKEN) {
+      if (identical(kind, STRING_INTERPOLATION_TOKEN)) {
+        // Parsing ${expression}.
+        token = token.next;
+        token = parseExpression(token);
+        token = expect('}', token);
+      } else if (identical(kind, STRING_INTERPOLATION_IDENTIFIER_TOKEN)) {
+        // Parsing $identifier.
+        token = token.next;
+        token = parseExpression(token);
+      } else {
+        break;
+      }
+      ++interpolationCount;
+      // Parsing the infix/suffix, for instance y and z' of 'x${id}y${id}z'
+      token = parseStringPart(token);
+      kind = token.kind;
+    }
+    listener.endLiteralString(interpolationCount);
+    return token;
+  }
+
+  Token parseLiteralBool(Token token) {
+    listener.handleLiteralBool(token);
+    return token.next;
+  }
+
+  Token parseLiteralNull(Token token) {
+    listener.handleLiteralNull(token);
+    return token.next;
+  }
+
+  Token parseSend(Token token) {
+    listener.beginSend(token);
+    token = parseIdentifier(token);
+    token = parseArgumentsOpt(token);
+    listener.endSend(token);
+    return token;
+  }
+
+  Token parseArgumentsOpt(Token token) {
+    if (!optional('(', token)) {
+      listener.handleNoArguments(token);
+      return token;
+    } else {
+      return parseArguments(token);
+    }
+  }
+
+  Token parseArguments(Token token) {
+    Token begin = token;
+    listener.beginArguments(begin);
+    assert(identical('(', token.stringValue));
+    int argumentCount = 0;
+    if (optional(')', token.next)) {
+      listener.endArguments(argumentCount, begin, token.next);
+      return token.next.next;
+    }
+    bool old = mayParseFunctionExpressions;
+    mayParseFunctionExpressions = true;
+    do {
+      Token colon = null;
+      if (optional(':', token.next.next)) {
+        token = parseIdentifier(token.next);
+        colon = token;
+      }
+      token = parseExpression(token.next);
+      if (colon != null) listener.handleNamedArgument(colon);
+      ++argumentCount;
+    } while (optional(',', token));
+    mayParseFunctionExpressions = old;
+    listener.endArguments(argumentCount, begin, token);
+    return expect(')', token);
+  }
+
+  Token parseIsOperatorRest(Token token) {
+    assert(optional('is', token));
+    Token operator = token;
+    Token not = null;
+    if (optional('!', token.next)) {
+      token = token.next;
+      not = token;
+    }
+    token = parseType(token.next);
+    listener.handleIsOperator(operator, not, token);
+    String value = token.stringValue;
+    if (identical(value, 'is') || identical(value, 'as')) {
+      // The is- and as-operators cannot be chained, but they can take part of
+      // expressions like: foo is Foo || foo is Bar.
+      listener.unexpected(token);
+    }
+    return token;
+  }
+
+  Token parseAsOperatorRest(Token token) {
+    assert(optional('as', token));
+    Token operator = token;
+    token = parseType(token.next);
+    listener.handleAsOperator(operator, token);
+    String value = token.stringValue;
+    if (identical(value, 'is') || identical(value, 'as')) {
+      // The is- and as-operators cannot be chained.
+      listener.unexpected(token);
+    }
+    return token;
+  }
+
+  Token parseVariablesDeclaration(Token token) {
+    return parseVariablesDeclarationMaybeSemicolon(token, true);
+  }
+
+  Token parseVariablesDeclarationNoSemicolon(Token token) {
+    // Only called when parsing a for loop, so this is for parsing locals.
+    return parseVariablesDeclarationMaybeSemicolon(token, false);
+  }
+
+  Token parseVariablesDeclarationMaybeSemicolon(Token token,
+                                                bool endWithSemicolon) {
+    int count = 1;
+    listener.beginVariablesDeclaration(token);
+    token = parseModifiers(token);
+    token = parseTypeOpt(token);
+    token = parseOptionallyInitializedIdentifier(token);
+    while (optional(',', token)) {
+      token = parseOptionallyInitializedIdentifier(token.next);
+      ++count;
+    }
+    if (endWithSemicolon) {
+      Token semicolon = token;
+      token = expectSemicolon(semicolon);
+      listener.endVariablesDeclaration(count, semicolon);
+      return token;
+    } else {
+      listener.endVariablesDeclaration(count, null);
+      return token;
+    }
+  }
+
+  Token parseOptionallyInitializedIdentifier(Token token) {
+    listener.beginInitializedIdentifier(token);
+    token = parseIdentifier(token);
+    token = parseVariableInitializerOpt(token);
+    listener.endInitializedIdentifier();
+    return token;
+  }
+
+  Token parseIfStatement(Token token) {
+    Token ifToken = token;
+    listener.beginIfStatement(ifToken);
+    token = expect('if', token);
+    token = parseParenthesizedExpression(token);
+    token = parseStatement(token);
+    Token elseToken = null;
+    if (optional('else', token)) {
+      elseToken = token;
+      token = parseStatement(token.next);
+    }
+    listener.endIfStatement(ifToken, elseToken);
+    return token;
+  }
+
+  Token parseForStatement(Token awaitToken, Token token) {
+    Token forToken = token;
+    listener.beginForStatement(forToken);
+    token = expect('for', token);
+    token = expect('(', token);
+    token = parseVariablesDeclarationOrExpressionOpt(token);
+    if (optional('in', token)) {
+      return parseForInRest(awaitToken, forToken, token);
+    } else {
+      if (awaitToken != null) {
+        listener.reportError(awaitToken, MessageKind.INVALID_AWAIT_FOR);
+      }
+      return parseForRest(forToken, token);
+    }
+  }
+
+  Token parseVariablesDeclarationOrExpressionOpt(Token token) {
+    final String value = token.stringValue;
+    if (identical(value, ';')) {
+      listener.handleNoExpression(token);
+      return token;
+    } else if ((identical(value, 'var')) || (identical(value, 'final'))) {
+      return parseVariablesDeclarationNoSemicolon(token);
+    }
+    Token identifier = peekIdentifierAfterType(token);
+    if (identifier != null) {
+      assert(identifier.isIdentifier());
+      if (isOneOf4(identifier.next, '=', ';', ',', 'in')) {
+        return parseVariablesDeclarationNoSemicolon(token);
+      }
+    }
+    return parseExpression(token);
+  }
+
+  Token parseForRest(Token forToken, Token token) {
+    token = expectSemicolon(token);
+    if (optional(';', token)) {
+      token = parseEmptyStatement(token);
+    } else {
+      token = parseExpressionStatement(token);
+    }
+    int expressionCount = 0;
+    while (true) {
+      if (optional(')', token)) break;
+      token = parseExpression(token);
+      ++expressionCount;
+      if (optional(',', token)) {
+        token = token.next;
+      } else {
+        break;
+      }
+    }
+    token = expect(')', token);
+    token = parseStatement(token);
+    listener.endForStatement(expressionCount, forToken, token);
+    return token;
+  }
+
+  Token parseForInRest(Token awaitToken, Token forToken, Token token) {
+    assert(optional('in', token));
+    Token inKeyword = token;
+    token = parseExpression(token.next);
+    token = expect(')', token);
+    token = parseStatement(token);
+    listener.endForIn(awaitToken, forToken, inKeyword, token);
+    return token;
+  }
+
+  Token parseWhileStatement(Token token) {
+    Token whileToken = token;
+    listener.beginWhileStatement(whileToken);
+    token = expect('while', token);
+    token = parseParenthesizedExpression(token);
+    token = parseStatement(token);
+    listener.endWhileStatement(whileToken, token);
+    return token;
+  }
+
+  Token parseDoWhileStatement(Token token) {
+    Token doToken = token;
+    listener.beginDoWhileStatement(doToken);
+    token = expect('do', token);
+    token = parseStatement(token);
+    Token whileToken = token;
+    token = expect('while', token);
+    token = parseParenthesizedExpression(token);
+    listener.endDoWhileStatement(doToken, whileToken, token);
+    return expectSemicolon(token);
+  }
+
+  Token parseBlock(Token token) {
+    Token begin = token;
+    listener.beginBlock(begin);
+    int statementCount = 0;
+    token = expect('{', token);
+    while (notEofOrValue('}', token)) {
+      token = parseStatement(token);
+      ++statementCount;
+    }
+    listener.endBlock(statementCount, begin, token);
+    return expect('}', token);
+  }
+
+  Token parseAwaitExpression(Token token, bool allowCascades) {
+    Token awaitToken = token;
+    listener.beginAwaitExpression(awaitToken);
+    token = expect('await', token);
+    token = parsePrecedenceExpression(token, POSTFIX_PRECEDENCE,
+                                      allowCascades);
+    listener.endAwaitExpression(awaitToken, token);
+    return token;
+  }
+
+  Token parseThrowExpression(Token token, bool allowCascades) {
+    Token throwToken = token;
+    listener.beginThrowExpression(throwToken);
+    token = expect('throw', token);
+    token = allowCascades
+        ? parseExpression(token)
+        : parseExpressionWithoutCascade(token);
+    listener.endThrowExpression(throwToken, token);
+    return token;
+  }
+
+  Token parseRethrowStatement(Token token) {
+    Token throwToken = token;
+    listener.beginRethrowStatement(throwToken);
+    // TODO(kasperl): Disallow throw here.
+    if (identical(throwToken.stringValue, 'throw')) {
+      token = expect('throw', token);
+    } else {
+      token = expect('rethrow', token);
+    }
+    listener.endRethrowStatement(throwToken, token);
+    return expectSemicolon(token);
+  }
+
+  Token parseTryStatement(Token token) {
+    assert(optional('try', token));
+    Token tryKeyword = token;
+    listener.beginTryStatement(tryKeyword);
+    token = parseBlock(token.next);
+    int catchCount = 0;
+
+    String value = token.stringValue;
+    while (identical(value, 'catch') || identical(value, 'on')) {
+      var onKeyword = null;
+      if (identical(value, 'on')) {
+        // on qualified catchPart?
+        onKeyword = token;
+        token = parseType(token.next);
+        value = token.stringValue;
+      }
+      Token catchKeyword = null;
+      if (identical(value, 'catch')) {
+        catchKeyword = token;
+        // TODO(ahe): Validate the "parameters".
+        token = parseFormalParameters(token.next);
+      }
+      token = parseBlock(token);
+      ++catchCount;
+      listener.handleCatchBlock(onKeyword, catchKeyword);
+      value = token.stringValue; // while condition
+    }
+
+    Token finallyKeyword = null;
+    if (optional('finally', token)) {
+      finallyKeyword = token;
+      token = parseBlock(token.next);
+      listener.handleFinallyBlock(finallyKeyword);
+    }
+    listener.endTryStatement(catchCount, tryKeyword, finallyKeyword);
+    return token;
+  }
+
+  Token parseSwitchStatement(Token token) {
+    assert(optional('switch', token));
+    Token switchKeyword = token;
+    listener.beginSwitchStatement(switchKeyword);
+    token = parseParenthesizedExpression(token.next);
+    token = parseSwitchBlock(token);
+    listener.endSwitchStatement(switchKeyword, token);
+    return token.next;
+  }
+
+  Token parseSwitchBlock(Token token) {
+    Token begin = token;
+    listener.beginSwitchBlock(begin);
+    token = expect('{', token);
+    int caseCount = 0;
+    while (!identical(token.kind, EOF_TOKEN)) {
+      if (optional('}', token)) {
+        break;
+      }
+      token = parseSwitchCase(token);
+      ++caseCount;
+    }
+    listener.endSwitchBlock(caseCount, begin, token);
+    expect('}', token);
+    return token;
+  }
+
+  /**
+   * Peek after the following labels (if any). The following token
+   * is used to determine if the labels belong to a statement or a
+   * switch case.
+   */
+  Token peekPastLabels(Token token) {
+    while (token.isIdentifier() && optional(':', token.next)) {
+      token = token.next.next;
+    }
+    return token;
+  }
+
+  /**
+   * Parse a group of labels, cases and possibly a default keyword and
+   * the statements that they select.
+   */
+  Token parseSwitchCase(Token token) {
+    Token begin = token;
+    Token defaultKeyword = null;
+    int expressionCount = 0;
+    int labelCount = 0;
+    Token peek = peekPastLabels(token);
+    while (true) {
+      // Loop until we find something that can't be part of a switch case.
+      String value = peek.stringValue;
+      if (identical(value, 'default')) {
+        while (!identical(token, peek)) {
+          token = parseLabel(token);
+          labelCount++;
+        }
+        defaultKeyword = token;
+        token = expect(':', token.next);
+        peek = token;
+        break;
+      } else if (identical(value, 'case')) {
+        while (!identical(token, peek)) {
+          token = parseLabel(token);
+          labelCount++;
+        }
+        Token caseKeyword = token;
+        token = parseExpression(token.next);
+        Token colonToken = token;
+        token = expect(':', token);
+        listener.handleCaseMatch(caseKeyword, colonToken);
+        expressionCount++;
+        peek = peekPastLabels(token);
+      } else {
+        if (expressionCount == 0) {
+          listener.expected("case", token);
+        }
+        break;
+      }
+    }
+    // Finally zero or more statements.
+    int statementCount = 0;
+    while (!identical(token.kind, EOF_TOKEN)) {
+      String value = peek.stringValue;
+      if ((identical(value, 'case')) ||
+          (identical(value, 'default')) ||
+          ((identical(value, '}')) && (identical(token, peek)))) {
+        // A label just before "}" will be handled as a statement error.
+        break;
+      } else {
+        token = parseStatement(token);
+      }
+      statementCount++;
+      peek = peekPastLabels(token);
+    }
+    listener.handleSwitchCase(labelCount, expressionCount, defaultKeyword,
+                              statementCount, begin, token);
+    return token;
+  }
+
+  Token parseBreakStatement(Token token) {
+    assert(optional('break', token));
+    Token breakKeyword = token;
+    token = token.next;
+    bool hasTarget = false;
+    if (token.isIdentifier()) {
+      token = parseIdentifier(token);
+      hasTarget = true;
+    }
+    listener.handleBreakStatement(hasTarget, breakKeyword, token);
+    return expectSemicolon(token);
+  }
+
+  Token parseAssertStatement(Token token) {
+    Token assertKeyword = token;
+    Token commaToken = null;
+    token = expect('assert', token);
+    token = expect('(', token);
+    bool old = mayParseFunctionExpressions;
+    mayParseFunctionExpressions = true;
+    token = parseExpression(token);
+    if (optional(',', token)) {
+      commaToken = token;
+      token = token.next;
+      token = parseExpression(token);
+    }
+    token = expect(')', token);
+    mayParseFunctionExpressions = old;
+    listener.handleAssertStatement(assertKeyword, commaToken, token);
+    return expectSemicolon(token);
+  }
+
+  Token parseContinueStatement(Token token) {
+    assert(optional('continue', token));
+    Token continueKeyword = token;
+    token = token.next;
+    bool hasTarget = false;
+    if (token.isIdentifier()) {
+      token = parseIdentifier(token);
+      hasTarget = true;
+    }
+    listener.handleContinueStatement(hasTarget, continueKeyword, token);
+    return expectSemicolon(token);
+  }
+
+  Token parseEmptyStatement(Token token) {
+    listener.handleEmptyStatement(token);
+    return expectSemicolon(token);
+  }
+}
diff --git a/pkg/compiler/lib/src/parser/parser_task.dart b/pkg/compiler/lib/src/parser/parser_task.dart
new file mode 100644
index 0000000..0a84c12
--- /dev/null
+++ b/pkg/compiler/lib/src/parser/parser_task.dart
@@ -0,0 +1,49 @@
+// 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.
+
+library dart2js.parser.task;
+
+import '../common.dart';
+import '../common/tasks.dart' show
+    CompilerTask;
+import '../compiler.dart' show
+    Compiler;
+import '../elements/modelx.dart' show
+    ElementX;
+import '../tokens/token.dart' show
+    Token;
+import '../tree/tree.dart' show
+    Node;
+
+import 'listener.dart' show
+    ParserError;
+import 'node_listener.dart' show
+    NodeListener;
+import 'parser.dart' show
+    Parser;
+
+class ParserTask extends CompilerTask {
+  ParserTask(Compiler compiler) : super(compiler);
+  String get name => 'Parser';
+
+  Node parse(ElementX element) {
+    return measure(() => element.parseNode(compiler.parsing));
+  }
+
+  Node parseCompilationUnit(Token token) {
+    return measure(() {
+      NodeListener listener = new NodeListener(reporter, null);
+      Parser parser = new Parser(listener);
+      try {
+        parser.parseUnit(token);
+      } on ParserError catch(_) {
+        assert(invariant(token, compiler.compilationFailed));
+        return listener.makeNodeList(0, null, null, '\n');
+      }
+      Node result = listener.popNode();
+      assert(listener.nodes.isEmpty);
+      return result;
+    });
+  }
+}
diff --git a/pkg/compiler/lib/src/parser/partial_elements.dart b/pkg/compiler/lib/src/parser/partial_elements.dart
new file mode 100644
index 0000000..6e3e11c
--- /dev/null
+++ b/pkg/compiler/lib/src/parser/partial_elements.dart
@@ -0,0 +1,498 @@
+// 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 dart2js.parser.partial_elements;
+
+import '../common.dart';
+import '../common/resolution.dart' show
+    Parsing,
+    Resolution;
+import '../dart_types.dart' show DynamicType;
+import '../elements/elements.dart' show
+    CompilationUnitElement,
+    ConstructorElement,
+    Element,
+    ElementKind,
+    GetterElement,
+    LibraryElement,
+    MetadataAnnotation,
+    MethodElement,
+    SetterElement,
+    STATE_NOT_STARTED,
+    STATE_DONE;
+import '../elements/modelx.dart' show
+    BaseFunctionElementX,
+    ClassElementX,
+    ConstructorElementX,
+    DeclarationSite,
+    ElementX,
+    FieldElementX,
+    GetterElementX,
+    MetadataAnnotationX,
+    MethodElementX,
+    SetterElementX,
+    TypedefElementX,
+    VariableList;
+import '../elements/visitor.dart' show
+    ElementVisitor;
+import '../tokens/token.dart' show
+    BadInputToken,
+    BeginGroupToken,
+    ErrorToken,
+    KeywordToken,
+    StringToken,
+    Token,
+    UnmatchedToken,
+    UnterminatedToken;
+import '../tokens/token_constants.dart' as Tokens show
+    EOF_TOKEN;
+import '../tree/tree.dart';
+
+import 'class_element_parser.dart' show
+    ClassElementParser;
+import 'parser.dart' show
+    Parser;
+import 'listener.dart' show
+    ParserError;
+import 'member_listener.dart' show
+    MemberListener;
+import 'node_listener.dart' show
+    NodeListener;
+
+abstract class PartialElement implements DeclarationSite {
+  Token beginToken;
+  Token endToken;
+
+  bool hasParseError = false;
+
+  bool get isErroneous => hasParseError;
+
+  DeclarationSite get declarationSite => this;
+}
+
+abstract class PartialFunctionMixin implements BaseFunctionElementX {
+  FunctionExpression cachedNode;
+  Modifiers get modifiers;
+  Token beginToken;
+  Token getOrSet;
+  Token endToken;
+
+  /**
+   * The position is computed in the constructor using [findMyName]. Computing
+   * it on demand fails in case tokens are GC'd.
+   */
+  Token _position;
+
+  void init(Token beginToken, Token getOrSet, Token endToken) {
+    this.beginToken = beginToken;
+    this.getOrSet = getOrSet;
+    this.endToken = endToken;
+    _position = ElementX.findNameToken(
+        beginToken,
+        modifiers.isFactory || isGenerativeConstructor,
+        name, enclosingElement.name);
+  }
+
+  bool get hasNode => cachedNode != null;
+
+  FunctionExpression get node {
+    assert(invariant(this, cachedNode != null,
+        message: "Node has not been computed for $this."));
+    return cachedNode;
+  }
+
+  FunctionExpression parseNode(Parsing parsing) {
+    if (cachedNode != null) return cachedNode;
+    parseFunction(Parser p) {
+      if (isClassMember && modifiers.isFactory) {
+        p.parseFactoryMethod(beginToken);
+      } else {
+        p.parseFunction(beginToken, getOrSet);
+      }
+    }
+    cachedNode = parse(parsing, this, declarationSite, parseFunction);
+    return cachedNode;
+  }
+
+  Token get position => _position;
+
+  void reusePartialFunctionMixin() {
+    cachedNode = null;
+  }
+
+  DeclarationSite get declarationSite;
+}
+
+abstract class PartialFunctionElement
+    implements PartialElement, PartialFunctionMixin {
+
+  factory PartialFunctionElement(
+      String name,
+      Token beginToken,
+      Token getOrSet,
+      Token endToken,
+      Modifiers modifiers,
+      Element enclosingElement,
+      {bool hasBody: true}) {
+    if (getOrSet == null) {
+      return new PartialMethodElement(
+          name, beginToken, endToken, modifiers,
+          enclosingElement, hasBody: hasBody);
+    } else if (identical(getOrSet.stringValue, 'get')) {
+      return new PartialGetterElement(
+          name, beginToken, getOrSet, endToken, modifiers,
+          enclosingElement, hasBody: hasBody);
+    } else {
+      assert(identical(getOrSet.stringValue, 'set'));
+      return new PartialSetterElement(
+          name, beginToken, getOrSet, endToken, modifiers,
+          enclosingElement, hasBody: hasBody);
+    }
+  }
+
+  PartialFunctionElement copyWithEnclosing(Element enclosing);
+}
+
+
+class PartialMethodElement extends MethodElementX
+    with PartialElement, PartialFunctionMixin
+    implements PartialFunctionElement {
+  PartialMethodElement(String name,
+                       Token beginToken,
+                       Token endToken,
+                       Modifiers modifiers,
+                       Element enclosing,
+                       {bool hasBody: true})
+      : super(name, ElementKind.FUNCTION, modifiers, enclosing, hasBody) {
+    init(beginToken, null, endToken);
+  }
+
+  void reuseElement() {
+    super.reuseElement();
+    reusePartialFunctionMixin();
+  }
+
+  PartialMethodElement copyWithEnclosing(Element enclosing) {
+    return new PartialMethodElement(
+        name, beginToken, endToken, modifiers, enclosing, hasBody: hasBody);
+  }
+}
+
+class PartialGetterElement extends GetterElementX
+    with PartialElement, PartialFunctionMixin
+    implements GetterElement, PartialFunctionElement  {
+  PartialGetterElement(String name,
+                       Token beginToken,
+                       Token getToken,
+                       Token endToken,
+                       Modifiers modifiers,
+                       Element enclosing,
+                       {bool hasBody: true})
+      : super(name, modifiers, enclosing, hasBody) {
+    init(beginToken, getToken, endToken);
+  }
+
+  @override
+  SetterElement get setter => abstractField.setter;
+
+  void reuseElement() {
+    super.reuseElement();
+    reusePartialFunctionMixin();
+  }
+
+  PartialGetterElement copyWithEnclosing(Element enclosing) {
+    return new PartialGetterElement(
+        name, beginToken, getOrSet, endToken, modifiers, enclosing,
+        hasBody: hasBody);
+  }
+}
+
+class PartialSetterElement extends SetterElementX
+    with PartialElement, PartialFunctionMixin
+    implements SetterElement, PartialFunctionElement {
+  PartialSetterElement(String name,
+                       Token beginToken,
+                       Token setToken,
+                       Token endToken,
+                       Modifiers modifiers,
+                       Element enclosing,
+                       {bool hasBody: true})
+      : super(name, modifiers, enclosing, hasBody) {
+    init(beginToken, setToken, endToken);
+  }
+
+  @override
+  GetterElement get getter => abstractField.getter;
+
+  void reuseElement() {
+    super.reuseElement();
+    reusePartialFunctionMixin();
+  }
+
+  PartialSetterElement copyWithEnclosing(Element enclosing) {
+    return new PartialSetterElement(
+        name, beginToken, getOrSet, endToken, modifiers, enclosing,
+        hasBody: hasBody);
+  }
+}
+
+class PartialConstructorElement extends ConstructorElementX
+    with PartialElement, PartialFunctionMixin {
+  PartialConstructorElement(String name,
+                            Token beginToken,
+                            Token endToken,
+                            ElementKind kind,
+                            Modifiers modifiers,
+                            Element enclosing)
+      : super(name, kind, modifiers, enclosing) {
+    init(beginToken, null, endToken);
+  }
+
+  void reuseElement() {
+    super.reuseElement();
+    reusePartialFunctionMixin();
+  }
+}
+
+class PartialFieldList extends VariableList with PartialElement {
+  PartialFieldList(Token beginToken,
+                   Token endToken,
+                   Modifiers modifiers,
+                   bool hasParseError)
+      : super(modifiers) {
+    super.beginToken = beginToken;
+    super.endToken = endToken;
+    super.hasParseError = hasParseError;
+  }
+
+  VariableDefinitions parseNode(Element element, Parsing parsing) {
+    if (definitions != null) return definitions;
+    DiagnosticReporter reporter = parsing.reporter;
+    reporter.withCurrentElement(element, () {
+      definitions = parse(
+          parsing, element, declarationSite,
+          (Parser parser) => parser.parseMember(beginToken));
+
+      if (!hasParseError &&
+          !definitions.modifiers.isVar &&
+          !definitions.modifiers.isFinal &&
+          !definitions.modifiers.isConst &&
+          definitions.type == null &&
+          !definitions.isErroneous) {
+        reporter.reportErrorMessage(
+            definitions,
+            MessageKind.GENERIC,
+            { 'text': 'A field declaration must start with var, final, '
+                      'const, or a type annotation.' });
+      }
+    });
+    return definitions;
+  }
+
+  computeType(Element element, Resolution resolution) {
+    if (type != null) return type;
+    // TODO(johnniwinther): Compute this in the resolver.
+    VariableDefinitions node = parseNode(element, resolution.parsing);
+    if (node.type != null) {
+      type = resolution.resolveTypeAnnotation(element, node.type);
+    } else {
+      type = const DynamicType();
+    }
+    assert(type != null);
+    return type;
+  }
+}
+
+class PartialTypedefElement extends TypedefElementX with PartialElement {
+
+  PartialTypedefElement(
+      String name,
+      Element enclosing,
+      Token beginToken,
+      Token endToken)
+      : super(name, enclosing) {
+    this.beginToken = beginToken;
+    this.endToken = endToken;
+  }
+
+  Token get token => beginToken;
+
+  Node parseNode(Parsing parsing) {
+    if (cachedNode != null) return cachedNode;
+    cachedNode = parse(
+        parsing, this, declarationSite,
+        (p) => p.parseTopLevelDeclaration(token));
+    return cachedNode;
+  }
+
+  Token get position => findMyName(token);
+}
+
+/// A [MetadataAnnotation] which is constructed on demand.
+class PartialMetadataAnnotation extends MetadataAnnotationX
+    implements PartialElement {
+  Token beginToken; // TODO(ahe): Make this final when issue 22065 is fixed.
+
+  final Token tokenAfterEndToken;
+
+  Expression cachedNode;
+
+  bool hasParseError = false;
+
+  PartialMetadataAnnotation(this.beginToken, this.tokenAfterEndToken);
+
+  bool get isErroneous => hasParseError;
+
+  DeclarationSite get declarationSite => this;
+
+  Token get endToken {
+    Token token = beginToken;
+    while (token.kind != Tokens.EOF_TOKEN) {
+      if (identical(token.next, tokenAfterEndToken)) break;
+      token = token.next;
+    }
+    assert(token != null);
+    return token;
+  }
+
+  void set endToken(_) {
+    throw new UnsupportedError("endToken=");
+  }
+
+  Node parseNode(Parsing parsing) {
+    if (cachedNode != null) return cachedNode;
+    var metadata = parse(parsing,
+                         annotatedElement,
+                         declarationSite,
+                         (p) => p.parseMetadata(beginToken));
+    if (metadata is Metadata) {
+      cachedNode = metadata.expression;
+      return cachedNode;
+    } else {
+      assert (metadata is ErrorNode);
+      return metadata;
+    }
+  }
+
+  bool get hasNode => cachedNode != null;
+
+  Node get node {
+    assert(invariant(this, hasNode));
+    return cachedNode;
+  }
+}
+
+class PartialClassElement extends ClassElementX with PartialElement {
+  ClassNode cachedNode;
+
+  PartialClassElement(String name,
+                      Token beginToken,
+                      Token endToken,
+                      Element enclosing,
+                      int id)
+      : super(name, enclosing, id, STATE_NOT_STARTED) {
+    this.beginToken = beginToken;
+    this.endToken = endToken;
+  }
+
+  void set supertypeLoadState(int state) {
+    assert(state == STATE_NOT_STARTED || state == supertypeLoadState + 1);
+    assert(state <= STATE_DONE);
+    super.supertypeLoadState = state;
+  }
+
+  void set resolutionState(int state) {
+    assert(state == STATE_NOT_STARTED || state == resolutionState + 1);
+    assert(state <= STATE_DONE);
+    super.resolutionState = state;
+  }
+
+  bool get hasNode => cachedNode != null;
+
+  ClassNode get node {
+    assert(invariant(this, cachedNode != null,
+        message: "Node has not been computed for $this."));
+    return cachedNode;
+  }
+
+  ClassNode parseNode(Parsing parsing) {
+    if (cachedNode != null) return cachedNode;
+    DiagnosticReporter reporter = parsing.reporter;
+    reporter.withCurrentElement(this, () {
+      parsing.measure(() {
+        MemberListener listener = new MemberListener(reporter, this);
+        Parser parser = new ClassElementParser(listener);
+        try {
+          Token token = parser.parseTopLevelDeclaration(beginToken);
+          assert(identical(token, endToken.next));
+          cachedNode = listener.popNode();
+          assert(
+              invariant(
+                  beginToken, listener.nodes.isEmpty,
+                  message: "Non-empty listener stack: ${listener.nodes}"));
+        } on ParserError {
+          // TODO(ahe): Often, a ParserError is thrown while parsing the class
+          // body. This means that the stack actually contains most of the
+          // information synthesized below. Consider rewriting the parser so
+          // endClassDeclaration is called before parsing the class body.
+          Identifier name = new Identifier(findMyName(beginToken));
+          NodeList typeParameters = null;
+          Node supertype = null;
+          NodeList interfaces = listener.makeNodeList(0, null, null, ",");
+          Token extendsKeyword = null;
+          NodeList body = listener.makeNodeList(0, beginToken, endToken, null);
+          cachedNode = new ClassNode(
+              Modifiers.EMPTY, name, typeParameters, supertype, interfaces,
+              beginToken, extendsKeyword, body, endToken);
+          hasParseError = true;
+        }
+      });
+      if (isPatched) {
+        parsing.parsePatchClass(patch);
+      }
+    });
+    return cachedNode;
+  }
+
+  Token get position => beginToken;
+
+  // TODO(johnniwinther): Ensure that modifiers are always available.
+  Modifiers get modifiers =>
+      cachedNode != null ? cachedNode.modifiers : Modifiers.EMPTY;
+
+  accept(ElementVisitor visitor, arg) {
+    return visitor.visitClassElement(this, arg);
+  }
+
+  PartialClassElement copyWithEnclosing(CompilationUnitElement enclosing) {
+    return new PartialClassElement(name, beginToken, endToken, enclosing, id);
+  }
+}
+
+Node parse(
+    Parsing parsing,
+    ElementX element,
+    PartialElement partial,
+    doParse(Parser parser)) {
+  DiagnosticReporter reporter = parsing.reporter;
+  return parsing.measure(() {
+    return reporter.withCurrentElement(element, () {
+      CompilationUnitElement unit = element.compilationUnit;
+      NodeListener listener = new NodeListener(reporter, unit);
+      listener.memberErrors = listener.memberErrors.prepend(false);
+      try {
+        if (partial.hasParseError) {
+          listener.suppressParseErrors = true;
+        }
+        doParse(new Parser(listener));
+      } on ParserError catch (e) {
+        partial.hasParseError = true;
+        return new ErrorNode(element.position, e.reason);
+      }
+      Node node = listener.popNode();
+      assert(listener.nodes.isEmpty);
+      return node;
+    });
+  });
+}
diff --git a/pkg/compiler/lib/src/parser/partial_parser.dart b/pkg/compiler/lib/src/parser/partial_parser.dart
new file mode 100644
index 0000000..01de07c
--- /dev/null
+++ b/pkg/compiler/lib/src/parser/partial_parser.dart
@@ -0,0 +1,181 @@
+// 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.
+
+library dart2js.parser.partial;
+
+import '../common.dart';
+import '../util/characters.dart' as Characters show
+    $CLOSE_CURLY_BRACKET;
+import '../tokens/token.dart' show
+    BeginGroupToken,
+    ErrorToken,
+    Token;
+import '../tokens/token_constants.dart' as Tokens show
+    EOF_TOKEN;
+
+import 'listener.dart' show
+    Listener;
+import 'parser.dart' show
+    Parser;
+
+class PartialParser extends Parser {
+  PartialParser(Listener listener) : super(listener);
+
+  Token parseClassBody(Token token) => skipClassBody(token);
+
+  Token fullParseClassBody(Token token) => super.parseClassBody(token);
+
+  Token parseExpression(Token token) => skipExpression(token);
+
+  Token parseArgumentsOpt(Token token) {
+    // 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).
+    if (optional('(', token)) {
+      BeginGroupToken begin = token;
+      return begin.endGroup.next;
+    } else {
+      return token;
+    }
+  }
+
+  Token skipExpression(Token token) {
+    while (true) {
+      final kind = token.kind;
+      final value = token.stringValue;
+      if ((identical(kind, Tokens.EOF_TOKEN)) ||
+          (identical(value, ';')) ||
+          (identical(value, ',')) ||
+          (identical(value, '}')) ||
+          (identical(value, ')')) ||
+          (identical(value, ']'))) {
+        break;
+      }
+      if (identical(value, '=') ||
+          identical(value, '?') ||
+          identical(value, ':')) {
+        var nextValue = token.next.stringValue;
+        if (identical(nextValue, 'const')) {
+          token = token.next;
+          nextValue = token.next.stringValue;
+        }
+        if (identical(nextValue, '{')) {
+          // Handle cases like this:
+          // class Foo {
+          //   var map;
+          //   Foo() : map = {};
+          //   Foo.x() : map = true ? {} : {};
+          // }
+          BeginGroupToken begin = token.next;
+          token = (begin.endGroup != null) ? begin.endGroup : token;
+          token = token.next;
+          continue;
+        }
+        if (identical(nextValue, '<')) {
+          // Handle cases like this:
+          // class Foo {
+          //   var map;
+          //   Foo() : map = <String, Foo>{};
+          //   Foo.x() : map = true ? <String, Foo>{} : <String, Foo>{};
+          // }
+          BeginGroupToken begin = token.next;
+          token = (begin.endGroup != null) ? begin.endGroup : token;
+          token = token.next;
+          if (identical(token.stringValue, '{')) {
+            begin = token;
+            token = (begin.endGroup != null) ? begin.endGroup : token;
+            token = token.next;
+          }
+          continue;
+        }
+      }
+      if (!mayParseFunctionExpressions && identical(value, '{')) {
+        break;
+      }
+      if (token is BeginGroupToken) {
+        BeginGroupToken begin = token;
+        token = (begin.endGroup != null) ? begin.endGroup : token;
+      } else if (token is ErrorToken) {
+        listener.reportErrorToken(token);
+      }
+      token = token.next;
+    }
+    return token;
+  }
+
+  Token skipClassBody(Token token) {
+    if (!optional('{', token)) {
+      return listener.expectedClassBodyToSkip(token);
+    }
+    BeginGroupToken beginGroupToken = token;
+    Token endGroup = beginGroupToken.endGroup;
+    if (endGroup == null) {
+      return listener.unmatched(beginGroupToken);
+    } else if (!identical(endGroup.kind, Characters.$CLOSE_CURLY_BRACKET)) {
+      return listener.unmatched(beginGroupToken);
+    }
+    return endGroup;
+  }
+
+  Token skipAsyncModifier(Token token) {
+    String value = token.stringValue;
+    if (identical(value, 'async')) {
+      token = token.next;
+      value = token.stringValue;
+
+      if (identical(value, '*')) {
+        token = token.next;
+      }
+    } else if (identical(value, 'sync')) {
+      token = token.next;
+      value = token.stringValue;
+
+      if (identical(value, '*')) {
+        token = token.next;
+      }
+    }
+    return token;
+  }
+
+  Token parseFunctionBody(Token token, bool isExpression, bool allowAbstract) {
+    assert(!isExpression);
+    token = skipAsyncModifier(token);
+    String value = token.stringValue;
+    if (identical(value, ';')) {
+      if (!allowAbstract) {
+        listener.reportError(token, MessageKind.BODY_EXPECTED);
+      }
+      listener.handleNoFunctionBody(token);
+    } else {
+      if (identical(value, '=>')) {
+        token = parseExpression(token.next);
+        expectSemicolon(token);
+      } else if (value == '=') {
+        token = parseRedirectingFactoryBody(token);
+        expectSemicolon(token);
+      } else {
+        token = skipBlock(token);
+      }
+      listener.skippedFunctionBody(token);
+    }
+    return token;
+  }
+
+  Token parseFormalParameters(Token token) => skipFormals(token);
+
+  Token skipFormals(Token token) {
+    listener.beginOptionalFormalParameters(token);
+    if (!optional('(', token)) {
+      if (optional(';', token)) {
+        listener.recoverableError(token, "expected '('");
+        return token;
+      }
+      return listener.unexpected(token);
+    }
+    BeginGroupToken beginGroupToken = token;
+    Token endToken = beginGroupToken.endGroup;
+    listener.endFormalParameters(0, token, endToken);
+    return endToken.next;
+  }
+}
diff --git a/pkg/compiler/lib/src/patch_parser.dart b/pkg/compiler/lib/src/patch_parser.dart
index a639a58..1b9e8f3 100644
--- a/pkg/compiler/lib/src/patch_parser.dart
+++ b/pkg/compiler/lib/src/patch_parser.dart
@@ -112,28 +112,50 @@
  *   element.
  */
 
-library patchparser;
+library dart2js.patchparser;
 
 import 'dart:async';
 
-import 'constants/values.dart' show ConstantValue;
-import 'dart2jslib.dart'
-    show Compiler,
-         CompilerTask,
-         DiagnosticListener,
-         MessageKind,
-         Script;
+import 'constants/values.dart' show
+    ConstantValue;
+import 'common.dart';
+import 'compiler.dart' show
+    Compiler;
+import 'common/tasks.dart' show
+    CompilerTask;
+import 'dart_types.dart' show
+    DartType;
 import 'elements/elements.dart';
-import 'elements/modelx.dart'
-    show BaseFunctionElementX,
-         ClassElementX,
-         GetterElementX,
-         LibraryElementX,
-         MetadataAnnotationX,
-         SetterElementX;
-import 'library_loader.dart' show LibraryLoader;
-import 'scanner/scannerlib.dart';  // Scanner, Parsers, Listeners
-import 'util/util.dart';
+import 'elements/modelx.dart' show
+    BaseFunctionElementX,
+    ClassElementX,
+    GetterElementX,
+    LibraryElementX,
+    MetadataAnnotationX,
+    SetterElementX;
+import 'js_backend/js_backend.dart' show
+    JavaScriptBackend;
+import 'library_loader.dart' show
+    LibraryLoader;
+import 'parser/listener.dart' show
+    Listener,
+    ParserError;
+import 'parser/element_listener.dart' show
+    ElementListener;
+import 'parser/member_listener.dart' show
+    MemberListener;
+import 'parser/partial_elements.dart' show
+  PartialClassElement;
+import 'parser/partial_parser.dart' show
+    PartialParser;
+import 'parser/parser.dart' show
+    Parser;
+import 'scanner/scanner.dart' show
+    Scanner;
+import 'script.dart';
+import 'tokens/token.dart' show
+    StringToken,
+    Token;
 
 class PatchParserTask extends CompilerTask {
   final String name = "Patching Parser";
@@ -150,9 +172,9 @@
     return compiler.readScript(originLibrary, patchUri)
         .then((Script script) {
       var patchLibrary = new LibraryElementX(script, null, originLibrary);
-      return compiler.withCurrentElement(patchLibrary, () {
+      return reporter.withCurrentElement(patchLibrary, () {
         loader.registerNewLibrary(patchLibrary);
-        compiler.withCurrentElement(patchLibrary.entryCompilationUnit, () {
+        reporter.withCurrentElement(patchLibrary.entryCompilationUnit, () {
           // This patches the elements of the patch library into [library].
           // Injected elements are added directly under the compilation unit.
           // Patch elements are stored on the patched functions or classes.
@@ -177,7 +199,7 @@
       } 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.
-        compiler.internalError(
+        reporter.internalError(
             compilationUnit, "Parser error in patch file: $e");
       }
     });
@@ -188,7 +210,7 @@
     // of calling its [parseNode] method.
     if (cls.cachedNode != null) return;
 
-    measure(() => compiler.withCurrentElement(cls, () {
+    measure(() => reporter.withCurrentElement(cls, () {
       MemberListener listener = new PatchMemberListener(compiler, cls);
       Parser parser = new PatchClassElementParser(listener);
       try {
@@ -197,7 +219,7 @@
       } 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.
-        compiler.internalError(
+        reporter.internalError(
             cls, "Parser error in patch file: $e");
       }
       cls.cachedNode = listener.popNode();
@@ -211,7 +233,7 @@
 
   PatchMemberListener(Compiler compiler, ClassElement enclosingClass)
       : this.compiler = compiler,
-        super(compiler, enclosingClass);
+        super(compiler.reporter, enclosingClass);
 
   @override
   void addMember(Element patch) {
@@ -221,13 +243,13 @@
     if (patchVersion != null) {
       if (patchVersion.isActive(compiler.patchVersion)) {
         Element origin = enclosingClass.origin.localLookup(patch.name);
-        patchElement(compiler, origin, patch);
-        enclosingClass.addMember(patch, listener);
+        patchElement(compiler, reporter, origin, patch);
+        enclosingClass.addMember(patch, reporter);
       } else {
         // Skip this element.
       }
     } else {
-      enclosingClass.addMember(patch, listener);
+      enclosingClass.addMember(patch, reporter);
     }
   }
 }
@@ -252,7 +274,7 @@
                        CompilationUnitElement patchElement,
                        int idGenerator())
     : this.compiler = compiler,
-      super(compiler, patchElement, idGenerator);
+      super(compiler.reporter, patchElement, idGenerator);
 
   @override
   void pushElement(Element patch) {
@@ -264,67 +286,78 @@
         LibraryElement originLibrary = compilationUnitElement.library;
         assert(originLibrary.isPatched);
         Element origin = originLibrary.localLookup(patch.name);
-        patchElement(listener, origin, patch);
-        compilationUnitElement.addMember(patch, listener);
+        patchElement(compiler, reporter, origin, patch);
+        compilationUnitElement.addMember(patch, reporter);
       } else {
         // Skip this element.
       }
     } else {
-      compilationUnitElement.addMember(patch, listener);
+      compilationUnitElement.addMember(patch, reporter);
     }
   }
 }
 
 void patchElement(Compiler compiler,
+                  DiagnosticReporter reporter,
                   Element origin,
                   Element patch) {
   if (origin == null) {
-    compiler.reportError(
+    reporter.reportErrorMessage(
         patch, MessageKind.PATCH_NON_EXISTING, {'name': patch.name});
     return;
   }
+
   if (!(origin.isClass ||
         origin.isConstructor ||
         origin.isFunction ||
         origin.isAbstractField)) {
     // TODO(ahe): Remove this error when the parser rejects all bad modifiers.
-    compiler.reportError(origin, MessageKind.PATCH_NONPATCHABLE);
+    reporter.reportErrorMessage(origin, MessageKind.PATCH_NONPATCHABLE);
     return;
   }
   if (patch.isClass) {
-    tryPatchClass(compiler, origin, patch);
+    tryPatchClass(compiler, reporter, origin, patch);
   } else if (patch.isGetter) {
-    tryPatchGetter(compiler, origin, patch);
+    tryPatchGetter(reporter, origin, patch);
   } else if (patch.isSetter) {
-    tryPatchSetter(compiler, origin, patch);
+    tryPatchSetter(reporter, origin, patch);
   } else if (patch.isConstructor) {
-    tryPatchConstructor(compiler, origin, patch);
+    tryPatchConstructor(reporter, origin, patch);
   } else if(patch.isFunction) {
-    tryPatchFunction(compiler, origin, patch);
+    tryPatchFunction(reporter, origin, patch);
   } else {
     // TODO(ahe): Remove this error when the parser rejects all bad modifiers.
-    compiler.reportError(patch, MessageKind.PATCH_NONPATCHABLE);
+    reporter.reportErrorMessage(patch, MessageKind.PATCH_NONPATCHABLE);
   }
 }
 
 void tryPatchClass(Compiler compiler,
+                   DiagnosticReporter reporter,
                    Element origin,
                    ClassElement patch) {
   if (!origin.isClass) {
-    compiler.reportError(
-        origin, MessageKind.PATCH_NON_CLASS, {'className': patch.name});
-    compiler.reportInfo(
-        patch, MessageKind.PATCH_POINT_TO_CLASS, {'className': patch.name});
+    reporter.reportError(
+        reporter.createMessage(
+            origin,
+            MessageKind.PATCH_NON_CLASS,
+            {'className': patch.name}),
+        <DiagnosticMessage>[
+            reporter.createMessage(
+                patch,
+                MessageKind.PATCH_POINT_TO_CLASS,
+                {'className': patch.name}),
+        ]);
     return;
   }
-  patchClass(compiler, origin, patch);
+  patchClass(compiler, reporter, origin, patch);
 }
 
 void patchClass(Compiler compiler,
+                DiagnosticReporter reporter,
                 ClassElementX origin,
                 ClassElementX patch) {
   if (origin.isPatched) {
-    compiler.internalError(origin,
+    reporter.internalError(origin,
         "Patching the same class more than once.");
   }
   origin.applyPatch(patch);
@@ -338,6 +371,12 @@
       const NativeAnnotationHandler());
 }
 
+checkJsInteropAnnotation(Compiler compiler, element) {
+  EagerAnnotationHandler.checkAnnotation(compiler, element,
+      const JsInteropAnnotationHandler());
+}
+
+
 /// Abstract interface for pre-resolution detection of metadata.
 ///
 /// The detection is handled in two steps:
@@ -365,16 +404,13 @@
   static checkAnnotation(Compiler compiler,
                          Element element,
                          EagerAnnotationHandler handler) {
-    for (Link<MetadataAnnotation> link = element.metadata;
-         !link.isEmpty;
-         link = link.tail) {
-      MetadataAnnotation annotation = link.head;
+    for (MetadataAnnotation annotation in element.implementation.metadata) {
       var result = handler.apply(compiler, element, annotation);
       if (result != null) {
         // TODO(johnniwinther): Perform this check in
         // [Compiler.onLibrariesLoaded].
         compiler.enqueuer.resolution.addDeferredAction(element, () {
-          annotation.ensureResolved(compiler);
+          annotation.ensureResolved(compiler.resolution);
           handler.validate(
               compiler, element, annotation,
               compiler.constants.getConstantValue(annotation.constant));
@@ -421,9 +457,43 @@
                 Element element,
                 MetadataAnnotation annotation,
                 ConstantValue constant) {
+    DartType annotationType = constant.getType(compiler.coreTypes);
+    if (annotationType.element != compiler.nativeAnnotationClass) {
+      DiagnosticReporter reporter = compiler.reporter;
+      reporter.internalError(annotation, 'Invalid @Native(...) annotation.');
+    }
+  }
+}
+
+/// Annotation handler for pre-resolution detection of `@JS(...)`
+/// annotations.
+class JsInteropAnnotationHandler implements EagerAnnotationHandler<bool> {
+  const JsInteropAnnotationHandler();
+
+  bool hasJsNameAnnotation(MetadataAnnotation annotation) =>
+      annotation.beginToken != null && annotation.beginToken.next.value == 'JS';
+
+  bool apply(Compiler compiler,
+             Element element,
+             MetadataAnnotation annotation) {
+    bool hasJsInterop = hasJsNameAnnotation(annotation);
+    if (hasJsInterop) {
+      element.markAsJsInterop();
+    }
+    // Due to semantics of apply in the baseclass we have to return null to
+    // indicate that no match was found.
+    return hasJsInterop ? true : null;
+  }
+
+  @override
+  void validate(Compiler compiler,
+                Element element,
+                MetadataAnnotation annotation,
+                ConstantValue constant) {
+    JavaScriptBackend backend = compiler.backend;
     if (constant.getType(compiler.coreTypes).element !=
-            compiler.nativeAnnotationClass) {
-      compiler.internalError(annotation, 'Invalid @Native(...) annotation.');
+        backend.jsAnnotationClass) {
+      compiler.reporter.internalError(annotation, 'Invalid @JS(...) annotation.');
     }
   }
 }
@@ -459,105 +529,143 @@
                 Element element,
                 MetadataAnnotation annotation,
                 ConstantValue constant) {
-    if (constant.getType(compiler.coreTypes).element !=
-            compiler.patchAnnotationClass) {
-      compiler.internalError(annotation, 'Invalid patch annotation.');
+    DartType annotationType = constant.getType(compiler.coreTypes);
+    if (annotationType.element != compiler.patchAnnotationClass) {
+      DiagnosticReporter reporter = compiler.reporter;
+      reporter.internalError(annotation, 'Invalid patch annotation.');
     }
   }
 }
 
 
-void tryPatchGetter(DiagnosticListener listener,
+void tryPatchGetter(DiagnosticReporter reporter,
                     Element origin,
                     FunctionElement patch) {
   if (!origin.isAbstractField) {
-    listener.reportError(
-        origin, MessageKind.PATCH_NON_GETTER, {'name': origin.name});
-    listener.reportInfo(
-        patch,
-        MessageKind.PATCH_POINT_TO_GETTER, {'getterName': patch.name});
+    reporter.reportError(
+        reporter.createMessage(
+            origin,
+            MessageKind.PATCH_NON_GETTER,
+            {'name': origin.name}),
+        <DiagnosticMessage>[
+            reporter.createMessage(
+                patch,
+                MessageKind.PATCH_POINT_TO_GETTER,
+                {'getterName': patch.name}),
+        ]);
     return;
   }
   AbstractFieldElement originField = origin;
   if (originField.getter == null) {
-    listener.reportError(
-        origin, MessageKind.PATCH_NO_GETTER, {'getterName': patch.name});
-    listener.reportInfo(
-        patch,
-        MessageKind.PATCH_POINT_TO_GETTER, {'getterName': patch.name});
+    reporter.reportError(
+        reporter.createMessage(
+            origin,
+            MessageKind.PATCH_NO_GETTER,
+            {'getterName': patch.name}),
+        <DiagnosticMessage>[
+            reporter.createMessage(
+                patch,
+                MessageKind.PATCH_POINT_TO_GETTER,
+                {'getterName': patch.name}),
+        ]);
     return;
   }
   GetterElementX getter = originField.getter;
-  patchFunction(listener, getter, patch);
+  patchFunction(reporter, getter, patch);
 }
 
-void tryPatchSetter(DiagnosticListener listener,
+void tryPatchSetter(DiagnosticReporter reporter,
                     Element origin,
                     FunctionElement patch) {
   if (!origin.isAbstractField) {
-    listener.reportError(
-        origin, MessageKind.PATCH_NON_SETTER, {'name': origin.name});
-    listener.reportInfo(
-        patch,
-        MessageKind.PATCH_POINT_TO_SETTER, {'setterName': patch.name});
+    reporter.reportError(
+        reporter.createMessage(
+            origin,
+            MessageKind.PATCH_NON_SETTER,
+            {'name': origin.name}),
+        <DiagnosticMessage>[
+            reporter.createMessage(
+                patch,
+                MessageKind.PATCH_POINT_TO_SETTER,
+                {'setterName': patch.name}),
+        ]);
     return;
   }
   AbstractFieldElement originField = origin;
   if (originField.setter == null) {
-    listener.reportError(
-        origin, MessageKind.PATCH_NO_SETTER, {'setterName': patch.name});
-    listener.reportInfo(
-        patch,
-        MessageKind.PATCH_POINT_TO_SETTER, {'setterName': patch.name});
+    reporter.reportError(
+        reporter.createMessage(
+            origin,
+            MessageKind.PATCH_NO_SETTER,
+            {'setterName': patch.name}),
+        <DiagnosticMessage>[
+              reporter.createMessage(
+                  patch,
+                  MessageKind.PATCH_POINT_TO_SETTER,
+                  {'setterName': patch.name}),
+        ]);
     return;
   }
   SetterElementX setter = originField.setter;
-  patchFunction(listener, setter, patch);
+  patchFunction(reporter, setter, patch);
 }
 
-void tryPatchConstructor(DiagnosticListener listener,
+void tryPatchConstructor(DiagnosticReporter reporter,
                          Element origin,
                          FunctionElement patch) {
   if (!origin.isConstructor) {
-    listener.reportError(
-        origin,
-        MessageKind.PATCH_NON_CONSTRUCTOR, {'constructorName': patch.name});
-    listener.reportInfo(
-        patch,
-        MessageKind.PATCH_POINT_TO_CONSTRUCTOR,
-        {'constructorName': patch.name});
+    reporter.reportError(
+        reporter.createMessage(
+            origin,
+            MessageKind.PATCH_NON_CONSTRUCTOR,
+            {'constructorName': patch.name}),
+        <DiagnosticMessage>[
+            reporter.createMessage(
+                patch,
+                MessageKind.PATCH_POINT_TO_CONSTRUCTOR,
+                {'constructorName': patch.name}),
+        ]);
     return;
   }
-  patchFunction(listener, origin, patch);
+  patchFunction(reporter, origin, patch);
 }
 
-void tryPatchFunction(DiagnosticListener listener,
+void tryPatchFunction(DiagnosticReporter reporter,
                       Element origin,
                       FunctionElement patch) {
   if (!origin.isFunction) {
-    listener.reportError(
-        origin,
-        MessageKind.PATCH_NON_FUNCTION, {'functionName': patch.name});
-    listener.reportInfo(
-        patch,
-        MessageKind.PATCH_POINT_TO_FUNCTION, {'functionName': patch.name});
+    reporter.reportError(
+        reporter.createMessage(
+            origin,
+            MessageKind.PATCH_NON_FUNCTION,
+            {'functionName': patch.name}),
+        <DiagnosticMessage>[
+            reporter.createMessage(
+                patch,
+                MessageKind.PATCH_POINT_TO_FUNCTION,
+                {'functionName': patch.name}),
+        ]);
     return;
   }
-  patchFunction(listener, origin, patch);
+  patchFunction(reporter, origin, patch);
 }
 
-void patchFunction(DiagnosticListener listener,
+void patchFunction(DiagnosticReporter reporter,
                    BaseFunctionElementX origin,
                    BaseFunctionElementX patch) {
   if (!origin.modifiers.isExternal) {
-    listener.reportError(origin, MessageKind.PATCH_NON_EXTERNAL);
-    listener.reportInfo(
-        patch,
-        MessageKind.PATCH_POINT_TO_FUNCTION, {'functionName': patch.name});
+    reporter.reportError(
+        reporter.createMessage(origin, MessageKind.PATCH_NON_EXTERNAL),
+        <DiagnosticMessage>[
+              reporter.createMessage(
+                  patch,
+                  MessageKind.PATCH_POINT_TO_FUNCTION,
+                  {'functionName': patch.name}),
+        ]);
     return;
   }
   if (origin.isPatched) {
-    listener.internalError(origin,
+    reporter.internalError(origin,
         "Trying to patch a function more than once.");
   }
   origin.applyPatch(patch);
diff --git a/pkg/compiler/lib/src/resolution/access_semantics.dart b/pkg/compiler/lib/src/resolution/access_semantics.dart
index 834a043..a41b867 100644
--- a/pkg/compiler/lib/src/resolution/access_semantics.dart
+++ b/pkg/compiler/lib/src/resolution/access_semantics.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.
 
-// TODO(johnniwinther): Temporarily copied from analyzer2dart. Merge when
-// we shared code with the analyzer and this semantic visitor is complete.
-
 /**
  * Code for classifying the semantics of identifiers appearing in a Dart file.
  */
@@ -192,7 +189,7 @@
  * Data structure used to classify the semantics of a property access or method
  * or function invocation.
  */
-class AccessSemantics {
+abstract class AccessSemantics {
   /**
    * The kind of access.
    */
@@ -205,30 +202,6 @@
    */
   Element get element => null;
 
-  /**
-   * The class containing the element being accessed, if this is a static
-   * reference to an element in a class.  This will be null if [kind] is
-   * DYNAMIC, LOCAL_FUNCTION, LOCAL_VARIABLE, PARAMETER, TOPLEVEL_CLASS, or
-   * TYPE_PARAMETER, or if the element being accessed is defined at toplevel
-   * within a library.
-   *
-   * Note: it is possible for [classElement] to be non-null and for [element]
-   * to be null; for example this occurs if the element being accessed is a
-   * non-existent static method or field inside an existing class.
-   */
-  ClassElement get classElement => null;
-
-  // TODO(paulberry): would it also be useful to store the libraryElement?
-
-  // TODO(johnniwinther): Do we need this?
-  /**
-   * When [kind] is DYNAMIC_PROPERTY, the expression whose runtime type
-   * determines the class in which [identifier] should be looked up.
-   *
-   * When [kind] is not DYNAMIC_PROPERTY, this field is always null.
-   */
-  /*Expression*/ get target => null;
-
   ConstantExpression get constant => null;
 
   /// The element for the getter in case of a compound access,
@@ -239,27 +212,27 @@
   /// [element] otherwise.
   Element get setter => element;
 
-  AccessSemantics.expression()
-      : kind = AccessKind.EXPRESSION;
+  Name get name => null;
 
-  AccessSemantics.thisAccess()
-      : kind = AccessKind.THIS;
-
-  AccessSemantics.thisProperty()
-      : kind = AccessKind.THIS_PROPERTY;
-
-  AccessSemantics._(this.kind);
+  const AccessSemantics._(this.kind);
 
   String toString() {
     StringBuffer sb = new StringBuffer();
     sb.write('AccessSemantics[');
     sb.write('kind=$kind,');
     if (element != null) {
-      sb.write('element=');
-      if (classElement != null) {
-        sb.write('${classElement.name}.');
+      if (getter != setter) {
+        sb.write('getter=');
+        sb.write('${getter}');
+        sb.write(',setter=');
+        sb.write('${setter}');
+      } else {
+        sb.write('element=');
+        sb.write('${element}');
       }
-      sb.write('${element}');
+    } else if (name != null) {
+      sb.write('name=');
+      sb.write(name);
     }
     sb.write(']');
     return sb.toString();
@@ -268,12 +241,23 @@
 
 
 class DynamicAccess extends AccessSemantics {
-  final target;
+  final Name name;
 
-  DynamicAccess.dynamicProperty(this.target)
+  const DynamicAccess.expression()
+      : name = null,
+        super._(AccessKind.EXPRESSION);
+
+  const DynamicAccess.thisAccess()
+      : name = null,
+        super._(AccessKind.THIS);
+
+  const DynamicAccess.thisProperty(this.name)
+      : super._(AccessKind.THIS_PROPERTY);
+
+  const DynamicAccess.dynamicProperty(this.name)
       : super._(AccessKind.DYNAMIC_PROPERTY);
 
-  DynamicAccess.ifNotNullProperty(this.target)
+  const DynamicAccess.ifNotNullProperty(this.name)
       : super._(AccessKind.CONDITIONAL_DYNAMIC_PROPERTY);
 }
 
@@ -296,8 +280,6 @@
 class StaticAccess extends AccessSemantics {
   final Element element;
 
-  ClassElement get classElement => element.enclosingClass;
-
   StaticAccess._(AccessKind kind, this.element)
       : super._(kind);
 
diff --git a/pkg/compiler/lib/src/resolution/class_hierarchy.dart b/pkg/compiler/lib/src/resolution/class_hierarchy.dart
index 712e78e..c156e8f 100644
--- a/pkg/compiler/lib/src/resolution/class_hierarchy.dart
+++ b/pkg/compiler/lib/src/resolution/class_hierarchy.dart
@@ -2,7 +2,40 @@
 // for 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 resolution;
+library dart2js.resolution.class_hierarchy;
+
+import '../common.dart';
+import '../compiler.dart' show
+    Compiler;
+import '../dart_types.dart';
+import '../elements/elements.dart';
+import '../elements/modelx.dart' show
+    BaseClassElementX,
+    ErroneousElementX,
+    MixinApplicationElementX,
+    SynthesizedConstructorElementX,
+    TypeVariableElementX;
+import '../ordered_typeset.dart' show
+    OrderedTypeSet,
+    OrderedTypeSetBuilder;
+import '../tree/tree.dart';
+import '../util/util.dart' show
+    Link,
+    Setlet;
+import '../universe/call_structure.dart' show
+    CallStructure;
+
+import 'enum_creator.dart';
+import 'members.dart' show
+    lookupInScope;
+import 'registry.dart' show
+    ResolutionRegistry;
+import 'resolution_common.dart' show
+    CommonResolverVisitor,
+    MappingVisitor;
+import 'scope.dart' show
+    Scope,
+    TypeDeclarationScope;
 
 class TypeDefinitionVisitor extends MappingVisitor<DartType> {
   Scope scope;
@@ -32,8 +65,10 @@
       TypeVariable typeNode = nodeLink.head;
       registry.useType(typeNode, typeVariable);
       if (nameSet.contains(typeName)) {
-        error(typeNode, MessageKind.DUPLICATE_TYPE_VARIABLE_NAME,
-              {'typeVariableName': typeName});
+        reporter.reportErrorMessage(
+            typeNode,
+            MessageKind.DUPLICATE_TYPE_VARIABLE_NAME,
+            {'typeVariableName': typeName});
       }
       nameSet.add(typeName);
 
@@ -54,7 +89,9 @@
               if (identical(element, variableElement)) {
                 // Only report an error on the checked type variable to avoid
                 // generating multiple errors for the same cyclicity.
-                warning(typeNode.name, MessageKind.CYCLIC_TYPE_VARIABLE,
+                reporter.reportWarningMessage(
+                    typeNode.name,
+                    MessageKind.CYCLIC_TYPE_VARIABLE,
                     {'typeVariableName': variableElement.name});
               }
               break;
@@ -95,14 +132,14 @@
 
   DartType visitClassNode(ClassNode node) {
     if (element == null) {
-      throw compiler.internalError(node, 'element is null');
+      throw reporter.internalError(node, 'element is null');
     }
     if (element.resolutionState != STATE_STARTED) {
-      throw compiler.internalError(element,
+      throw reporter.internalError(element,
           'cyclic resolution of class $element');
     }
 
-    element.computeType(compiler);
+    element.computeType(resolution);
     scope = new TypeDeclarationScope(scope, element);
     // TODO(ahe): It is not safe to call resolveTypeVariableBounds yet.
     // As a side-effect, this may get us back here trying to
@@ -135,12 +172,12 @@
       // Avoid making the superclass (usually Object) extend itself.
       if (element != superElement) {
         if (superElement == null) {
-          compiler.internalError(node,
+          reporter.internalError(node,
               "Cannot resolve default superclass for $element.");
         } else {
-          superElement.ensureResolved(compiler);
+          superElement.ensureResolved(resolution);
         }
-        element.supertype = superElement.computeType(compiler);
+        element.supertype = superElement.computeType(resolution);
       }
     }
 
@@ -158,17 +195,17 @@
         Map arguments = {'constructorName': ''};
         // TODO(ahe): Why is this a compile-time error? Or if it is an error,
         // why do we bother to registerThrowNoSuchMethod below?
-        compiler.reportError(node, kind, arguments);
+        reporter.reportErrorMessage(node, kind, arguments);
         superMember = new ErroneousElementX(
             kind, arguments, '', element);
         registry.registerThrowNoSuchMethod();
       } else {
         ConstructorElement superConstructor = superMember;
-        Selector callToMatch = new Selector.call("", element.library, 0);
-        superConstructor.computeType(compiler);
-        if (!callToMatch.applies(superConstructor, compiler.world)) {
+        superConstructor.computeType(resolution);
+        if (!CallStructure.NO_ARGS.signatureApplies(
+                superConstructor.functionSignature)) {
           MessageKind kind = MessageKind.NO_MATCHING_CONSTRUCTOR_FOR_IMPLICIT;
-          compiler.reportError(node, kind);
+          reporter.reportErrorMessage(node, kind);
           superMember = new ErroneousElementX(kind, {}, '', element);
         }
       }
@@ -177,33 +214,35 @@
       if (superMember.isErroneous) {
         compiler.elementsWithCompileTimeErrors.add(constructor);
       }
-      element.setDefaultConstructor(constructor, compiler);
+      element.setDefaultConstructor(constructor, reporter);
     }
-    return element.computeType(compiler);
+    return element.computeType(resolution);
   }
 
   @override
   DartType visitEnum(Enum node) {
     if (element == null) {
-      throw compiler.internalError(node, 'element is null');
+      throw reporter.internalError(node, 'element is null');
     }
     if (element.resolutionState != STATE_STARTED) {
-      throw compiler.internalError(element,
+      throw reporter.internalError(element,
           'cyclic resolution of class $element');
     }
 
-    InterfaceType enumType = element.computeType(compiler);
-    element.supertype = compiler.objectClass.computeType(compiler);
+    InterfaceType enumType = element.computeType(resolution);
+    element.supertype = compiler.coreTypes.objectType;
     element.interfaces = const Link<DartType>();
     calculateAllSupertypes(element);
 
     if (node.names.nodes.isEmpty) {
-      compiler.reportError(node,
-                           MessageKind.EMPTY_ENUM_DECLARATION,
-                           {'enumName': element.name});
+      reporter.reportErrorMessage(
+          node,
+          MessageKind.EMPTY_ENUM_DECLARATION,
+          {'enumName': element.name});
     }
 
-    EnumCreator creator = new EnumCreator(compiler, element);
+    EnumCreator creator =
+        new EnumCreator(reporter, compiler.coreTypes, element);
     creator.createMembers();
     return enumType;
   }
@@ -213,15 +252,23 @@
   DartType checkMixinType(TypeAnnotation mixinNode) {
     DartType mixinType = resolveType(mixinNode);
     if (isBlackListed(mixinType)) {
-      compiler.reportError(mixinNode,
-          MessageKind.CANNOT_MIXIN, {'type': mixinType});
+      reporter.reportErrorMessage(
+          mixinNode,
+          MessageKind.CANNOT_MIXIN,
+          {'type': mixinType});
     } else if (mixinType.isTypeVariable) {
-      compiler.reportError(mixinNode, MessageKind.CLASS_NAME_EXPECTED);
+      reporter.reportErrorMessage(
+          mixinNode,
+          MessageKind.CLASS_NAME_EXPECTED);
     } else if (mixinType.isMalformed) {
-      compiler.reportError(mixinNode, MessageKind.CANNOT_MIXIN_MALFORMED,
+      reporter.reportErrorMessage(
+          mixinNode,
+          MessageKind.CANNOT_MIXIN_MALFORMED,
           {'className': element.name, 'malformedType': mixinType});
     } else if (mixinType.isEnumType) {
-      compiler.reportError(mixinNode, MessageKind.CANNOT_MIXIN_ENUM,
+      reporter.reportErrorMessage(
+          mixinNode,
+          MessageKind.CANNOT_MIXIN_ENUM,
           {'className': element.name, 'enumType': mixinType});
     }
     return mixinType;
@@ -229,21 +276,22 @@
 
   DartType visitNamedMixinApplication(NamedMixinApplication node) {
     if (element == null) {
-      throw compiler.internalError(node, 'element is null');
+      throw reporter.internalError(node, 'element is null');
     }
     if (element.resolutionState != STATE_STARTED) {
-      throw compiler.internalError(element,
+      throw reporter.internalError(element,
           'cyclic resolution of class $element');
     }
 
     if (identical(node.classKeyword.stringValue, 'typedef')) {
       // TODO(aprelev@gmail.com): Remove this deprecation diagnostic
       // together with corresponding TODO in parser.dart.
-      compiler.reportWarning(node.classKeyword,
+      reporter.reportWarningMessage(
+          node.classKeyword,
           MessageKind.DEPRECATED_TYPEDEF_MIXIN_SYNTAX);
     }
 
-    element.computeType(compiler);
+    element.computeType(resolution);
     scope = new TypeDeclarationScope(scope, element);
     resolveTypeVariableBounds(node.typeParameters);
 
@@ -256,7 +304,7 @@
       link = link.tail;
     }
     doApplyMixinTo(element, supertype, checkMixinType(link.head));
-    return element.computeType(compiler);
+    return element.computeType(resolution);
   }
 
   DartType applyMixin(DartType supertype, DartType mixinType, Node node) {
@@ -287,7 +335,7 @@
           type.element.bound.subst(typeVariables, element.typeVariables);
     }
     // Setup this and raw type for the mixin application.
-    mixinApplication.computeThisAndRawType(compiler, typeVariables);
+    mixinApplication.computeThisAndRawType(resolution, typeVariables);
     // Substitute in synthetic type variables in super and mixin types.
     supertype = supertype.subst(typeVariables, element.typeVariables);
     mixinType = mixinType.subst(typeVariables, element.typeVariables);
@@ -304,7 +352,7 @@
 
   bool isDefaultConstructor(FunctionElement constructor) {
     if (constructor.name != '') return false;
-    constructor.computeType(compiler);
+    constructor.computeType(resolution);
     return constructor.functionSignature.parameterCount == 0;
   }
 
@@ -313,14 +361,14 @@
     FunctionElement constructor =
         new SynthesizedConstructorElementX.notForDefault(
             target.name, target, enclosing);
-    constructor.computeType(compiler);
+    constructor.computeType(resolution);
     return constructor;
   }
 
   void doApplyMixinTo(MixinApplicationElementX mixinApplication,
                       DartType supertype,
                       DartType mixinType) {
-    Node node = mixinApplication.parseNode(compiler);
+    Node node = mixinApplication.parseNode(resolution.parsing);
 
     if (mixinApplication.supertype != null) {
       // [supertype] is not null if there was a cycle.
@@ -369,7 +417,7 @@
       if (!member.isGenerativeConstructor) return;
       FunctionElement forwarder =
           createForwardingConstructor(member, mixinApplication);
-      if (isPrivateName(member.name) &&
+      if (Name.isPrivateName(member.name) &&
           mixinApplication.library != superclass.library) {
         // Do not create a forwarder to the super constructor, because the mixin
         // application is in a different library than the constructor in the
@@ -385,7 +433,7 @@
   InterfaceType resolveMixinFor(MixinApplicationElement mixinApplication,
                                 DartType mixinType) {
     ClassElement mixin = mixinType.element;
-    mixin.ensureResolved(compiler);
+    mixin.ensureResolved(resolution);
 
     // Check for cycles in the mixin chain.
     ClassElement previous = mixinApplication;  // For better error messages.
@@ -393,8 +441,9 @@
     while (current != null && current.isMixinApplication) {
       MixinApplicationElement currentMixinApplication = current;
       if (currentMixinApplication == mixinApplication) {
-        compiler.reportError(
-            mixinApplication, MessageKind.ILLEGAL_MIXIN_CYCLE,
+        reporter.reportErrorMessage(
+            mixinApplication,
+            MessageKind.ILLEGAL_MIXIN_CYCLE,
             {'mixinName1': current.name, 'mixinName2': previous.name});
         // We have found a cycle in the mixin chain. Return null as
         // the mixin for this application to avoid getting into
@@ -416,19 +465,26 @@
     DartType supertype = resolveType(superclass);
     if (supertype != null) {
       if (supertype.isMalformed) {
-        compiler.reportError(superclass, MessageKind.CANNOT_EXTEND_MALFORMED,
+        reporter.reportErrorMessage(
+            superclass,
+            MessageKind.CANNOT_EXTEND_MALFORMED,
             {'className': element.name, 'malformedType': supertype});
         return objectType;
       } else if (supertype.isEnumType) {
-        compiler.reportError(superclass, MessageKind.CANNOT_EXTEND_ENUM,
+        reporter.reportErrorMessage(
+            superclass,
+            MessageKind.CANNOT_EXTEND_ENUM,
             {'className': element.name, 'enumType': supertype});
         return objectType;
       } else if (!supertype.isInterfaceType) {
-        compiler.reportError(superclass.typeName,
+        reporter.reportErrorMessage(
+            superclass.typeName,
             MessageKind.CLASS_NAME_EXPECTED);
         return objectType;
       } else if (isBlackListed(supertype)) {
-        compiler.reportError(superclass, MessageKind.CANNOT_EXTEND,
+        reporter.reportErrorMessage(
+            superclass,
+            MessageKind.CANNOT_EXTEND,
             {'type': supertype});
         return objectType;
       }
@@ -443,38 +499,43 @@
       DartType interfaceType = resolveType(link.head);
       if (interfaceType != null) {
         if (interfaceType.isMalformed) {
-          compiler.reportError(superclass,
+          reporter.reportErrorMessage(
+              superclass,
               MessageKind.CANNOT_IMPLEMENT_MALFORMED,
               {'className': element.name, 'malformedType': interfaceType});
         } else if (interfaceType.isEnumType) {
-          compiler.reportError(superclass,
+          reporter.reportErrorMessage(
+              superclass,
               MessageKind.CANNOT_IMPLEMENT_ENUM,
               {'className': element.name, 'enumType': interfaceType});
         } else if (!interfaceType.isInterfaceType) {
           // TODO(johnniwinther): Handle dynamic.
           TypeAnnotation typeAnnotation = link.head;
-          error(typeAnnotation.typeName, MessageKind.CLASS_NAME_EXPECTED);
+          reporter.reportErrorMessage(
+              typeAnnotation.typeName, MessageKind.CLASS_NAME_EXPECTED);
         } else {
           if (interfaceType == element.supertype) {
-            compiler.reportError(
+            reporter.reportErrorMessage(
                 superclass,
                 MessageKind.DUPLICATE_EXTENDS_IMPLEMENTS,
                 {'type': interfaceType});
-            compiler.reportError(
+            reporter.reportErrorMessage(
                 link.head,
                 MessageKind.DUPLICATE_EXTENDS_IMPLEMENTS,
                 {'type': interfaceType});
           }
           if (result.contains(interfaceType)) {
-            compiler.reportError(
+            reporter.reportErrorMessage(
                 link.head,
                 MessageKind.DUPLICATE_IMPLEMENTS,
                 {'type': interfaceType});
           }
           result = result.prepend(interfaceType);
           if (isBlackListed(interfaceType)) {
-            error(link.head, MessageKind.CANNOT_IMPLEMENT,
-                  {'type': interfaceType});
+            reporter.reportErrorMessage(
+                link.head,
+                MessageKind.CANNOT_IMPLEMENT,
+                {'type': interfaceType});
           }
         }
       }
@@ -518,12 +579,12 @@
            interfaces = interfaces.tail) {
         addAllSupertypes(allSupertypes, interfaces.head);
       }
-      allSupertypes.add(compiler, cls.computeType(compiler));
+      allSupertypes.add(compiler, cls.computeType(resolution));
       cls.allSupertypesAndSelf = allSupertypes.toTypeSet();
     } else {
       assert(identical(cls, compiler.objectClass));
       cls.allSupertypesAndSelf =
-          new OrderedTypeSet.singleton(cls.computeType(compiler));
+          new OrderedTypeSet.singleton(cls.computeType(resolution));
     }
   }
 
@@ -572,7 +633,7 @@
   void loadSupertype(ClassElement element, Node from) {
     if (!element.isResolved) {
       compiler.resolver.loadSupertypes(element, from);
-      element.ensureResolved(compiler);
+      element.ensureResolved(resolution);
     }
   }
 
@@ -615,7 +676,7 @@
   }
 
   void visitIdentifier(Identifier node) {
-    Element element = lookupInScope(compiler, node, context, node.source);
+    Element element = lookupInScope(reporter, node, context, node.source);
     if (element != null && element.isClass) {
       loadSupertype(element, node);
     }
@@ -624,20 +685,24 @@
   void visitSend(Send node) {
     Identifier prefix = node.receiver.asIdentifier();
     if (prefix == null) {
-      error(node.receiver, MessageKind.NOT_A_PREFIX, {'node': node.receiver});
+      reporter.reportErrorMessage(
+          node.receiver, MessageKind.NOT_A_PREFIX, {'node': node.receiver});
       return;
     }
-    Element element = lookupInScope(compiler, prefix, context, prefix.source);
+    Element element = lookupInScope(reporter, prefix, context, prefix.source);
     if (element == null || !identical(element.kind, ElementKind.PREFIX)) {
-      error(node.receiver, MessageKind.NOT_A_PREFIX, {'node': node.receiver});
+      reporter.reportErrorMessage(
+          node.receiver, MessageKind.NOT_A_PREFIX, {'node': node.receiver});
       return;
     }
     PrefixElement prefixElement = element;
     Identifier selector = node.selector.asIdentifier();
     var e = prefixElement.lookupLocalMember(selector.source);
     if (e == null || !e.impliesType) {
-      error(node.selector, MessageKind.CANNOT_RESOLVE_TYPE,
-            {'typeName': node.selector});
+      reporter.reportErrorMessage(
+          node.selector,
+          MessageKind.CANNOT_RESOLVE_TYPE,
+          {'typeName': node.selector});
       return;
     }
     loadSupertype(e, node);
diff --git a/pkg/compiler/lib/src/resolution/class_members.dart b/pkg/compiler/lib/src/resolution/class_members.dart
index 8b624ba..125d4bf 100644
--- a/pkg/compiler/lib/src/resolution/class_members.dart
+++ b/pkg/compiler/lib/src/resolution/class_members.dart
@@ -2,24 +2,26 @@
 // for 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 resolution.compute_members;
+library dart2js.resolution.compute_members;
 
-import '../elements/elements.dart'
-    show Element,
-         Name,
-         PublicName,
-         Member,
-         MemberElement,
-         MemberSignature,
-         LibraryElement,
-         ClassElement,
-         MixinApplicationElement;
+import '../common.dart';
+import '../common/names.dart' show
+    Identifiers;
+import '../common/resolution.dart' show
+    Resolution;
+import '../compiler.dart' show
+    Compiler;
 import '../dart_types.dart';
-import '../dart2jslib.dart'
-    show Compiler,
-         MessageKind,
-         invariant,
-         isPrivateName;
+import '../elements/elements.dart' show
+    ClassElement,
+    Element,
+    LibraryElement,
+    Member,
+    MemberElement,
+    MemberSignature,
+    MixinApplicationElement,
+    Name,
+    PublicName;
 import '../util/util.dart';
 
 part 'member_impl.dart';
@@ -42,6 +44,10 @@
         message: "Members may only be computed on declarations."));
   }
 
+  DiagnosticReporter get reporter => compiler.reporter;
+
+  Resolution get resolution => compiler.resolution;
+
   void reportMessage(var marker, MessageKind kind, report()) {
     Set<MessageKind> messages =
         reportedMessages.putIfAbsent(marker,
@@ -58,7 +64,8 @@
 
   bool shouldSkipName(String name) {
     return computedMemberNames != null &&
-           computedMemberNames.contains(name);
+           // 'call' is implicitly contained in [computedMemberNames].
+           (name == Identifiers.call || computedMemberNames.contains(name));
   }
 
   /// Compute all members of [cls] with the given names.
@@ -188,7 +195,7 @@
 
         Name name = new Name(element.name, library);
         if (element.isField) {
-          DartType type = element.computeType(compiler);
+          DartType type = element.computeType(resolution);
           addDeclaredMember(name, type, new FunctionType.synthesized(type));
           if (!element.isConst && !element.isFinal) {
             addDeclaredMember(name.setter, type,
@@ -197,11 +204,11 @@
                                  <DartType>[type]));
           }
         } else if (element.isGetter) {
-          FunctionType functionType = element.computeType(compiler);
+          FunctionType functionType = element.computeType(resolution);
           DartType type = functionType.returnType;
           addDeclaredMember(name, type, functionType);
         } else if (element.isSetter) {
-          FunctionType functionType = element.computeType(compiler);
+          FunctionType functionType = element.computeType(resolution);
           DartType type;
           if (!functionType.parameterTypes.isEmpty) {
             type = functionType.parameterTypes.first;
@@ -212,7 +219,7 @@
           addDeclaredMember(name, type, functionType);
         } else {
           assert(invariant(element, element.isFunction));
-          FunctionType type = element.computeType(compiler);
+          FunctionType type = element.computeType(resolution);
           addDeclaredMember(name, type, type);
         }
       }
@@ -250,7 +257,7 @@
       }
       reportMessage(
           interfaceMember.element, MessageKind.ABSTRACT_METHOD, () {
-        compiler.reportWarning(
+        reporter.reportWarningMessage(
             interfaceMember.element, kind,
             {'class': cls.name, 'name': name.text});
       });
@@ -262,20 +269,24 @@
         Member inherited = interfaceMember.declarations.first;
         reportMessage(
             interfaceMember, MessageKind.UNIMPLEMENTED_METHOD, () {
-          compiler.reportWarning(cls,
+          DiagnosticMessage warning = reporter.createMessage(
+              cls,
               interfaceMember.declarations.length == 1
                   ? singleKind : multipleKind,
               {'class': cls.name,
                'name': name.text,
                'method': interfaceMember,
                'declarer': inherited.declarer});
+          List<DiagnosticMessage> infos = <DiagnosticMessage>[];
           for (Member inherited in interfaceMember.declarations) {
-            compiler.reportInfo(inherited.element,
+            infos.add(reporter.createMessage(
+                inherited.element,
                 inherited.isDeclaredByField ?
                     implicitlyDeclaredKind : explicitlyDeclaredKind,
                 {'class': inherited.declarer.name,
-                 'name': name.text});
+                 'name': name.text}));
           }
+          reporter.reportWarning(warning, infos);
         });
       }
       if (interfaceMember.isSetter) {
@@ -304,16 +315,18 @@
     assert(!cls.isAbstract);
 
     if (cls.asInstanceOf(compiler.functionClass) == null) return;
-    if (cls.lookupMember(Compiler.CALL_OPERATOR_NAME) != null) return;
+    if (cls.lookupMember(Identifiers.call) != null) return;
     // TODO(johnniwinther): Make separate methods for backend exceptions.
     // Avoid warnings on backend implementation classes for closures.
     if (compiler.backend.isBackendLibrary(cls.library)) return;
 
     reportMessage(compiler.functionClass, MessageKind.UNIMPLEMENTED_METHOD, () {
-      compiler.reportWarning(cls, MessageKind.UNIMPLEMENTED_METHOD_ONE,
+      reporter.reportWarningMessage(
+          cls,
+          MessageKind.UNIMPLEMENTED_METHOD_ONE,
           {'class': cls.name,
-           'name': Compiler.CALL_OPERATOR_NAME,
-           'method': Compiler.CALL_OPERATOR_NAME,
+           'name': Identifiers.call,
+           'method': Identifiers.call,
            'declarer': compiler.functionClass.name});
     });
   }
@@ -333,13 +346,18 @@
           if (superMember != null && superMember.isStatic) {
             reportMessage(superMember, MessageKind.INSTANCE_STATIC_SAME_NAME,
                 () {
-              compiler.reportWarning(
-                  declared.element,
-                  MessageKind.INSTANCE_STATIC_SAME_NAME,
-                  {'memberName': declared.name,
-                    'className': superclass.name});
-              compiler.reportInfo(superMember.element,
-                  MessageKind.INSTANCE_STATIC_SAME_NAME_CONT);
+              reporter.reportWarning(
+                  reporter.createMessage(
+                      declared.element,
+                      MessageKind.INSTANCE_STATIC_SAME_NAME,
+                      {'memberName': declared.name,
+                       'className': superclass.name}),
+                  <DiagnosticMessage>[
+                      reporter.createMessage(
+                          superMember.element,
+                          MessageKind.INSTANCE_STATIC_SAME_NAME_CONT),
+                  ]);
+
             });
             break;
           }
@@ -373,29 +391,38 @@
           // superMember.declarations. Investigate why.
         } else if (cls == inherited.declarer.element) {
           // An error should already have been reported.
-          assert(invariant(declared.element, compiler.compilationFailed));
+          assert(invariant(declared.element, compiler.compilationFailed,
+              message: "Member $inherited inherited from its "
+                       "declaring class: ${cls}."));
           continue;
         }
 
         void reportError(MessageKind errorKind, MessageKind infoKind) {
           reportMessage(
               inherited.element, MessageKind.INVALID_OVERRIDE_METHOD, () {
-            compiler.reportError(declared.element, errorKind,
-                {'name': declared.name.text,
-                 'class': cls.thisType,
-                 'inheritedClass': inherited.declarer});
-            compiler.reportInfo(inherited.element, infoKind,
-                {'name': declared.name.text,
-                 'class': inherited.declarer});
+            reporter.reportError(
+                reporter.createMessage(
+                    declared.element,
+                    errorKind,
+                    {'name': declared.name.text,
+                     'class': cls.thisType,
+                     'inheritedClass': inherited.declarer}),
+                <DiagnosticMessage>[
+                    reporter.createMessage(
+                        inherited.element,
+                        infoKind,
+                        {'name': declared.name.text,
+                         'class': inherited.declarer}),
+                ]);
           });
         }
 
         if (declared.isDeclaredByField && inherited.isMethod) {
           reportError(MessageKind.CANNOT_OVERRIDE_METHOD_WITH_FIELD,
-              MessageKind.CANNOT_OVERRIDE_METHOD_WITH_FIELD_CONT);
+                      MessageKind.CANNOT_OVERRIDE_METHOD_WITH_FIELD_CONT);
         } else if (declared.isMethod && inherited.isDeclaredByField) {
           reportError(MessageKind.CANNOT_OVERRIDE_FIELD_WITH_METHOD,
-              MessageKind.CANNOT_OVERRIDE_FIELD_WITH_METHOD_CONT);
+                      MessageKind.CANNOT_OVERRIDE_FIELD_WITH_METHOD_CONT);
         } else if (declared.isGetter && inherited.isMethod) {
           reportError(MessageKind.CANNOT_OVERRIDE_METHOD_WITH_GETTER,
                       MessageKind.CANNOT_OVERRIDE_METHOD_WITH_GETTER_CONT);
@@ -409,15 +436,22 @@
                                MessageKind warningKind,
                                MessageKind infoKind) {
               reportMessage(marker, MessageKind.INVALID_OVERRIDE_METHOD, () {
-                compiler.reportWarning(declared.element, warningKind,
-                    {'declaredType': declared.type,
-                     'name': declared.name.text,
-                     'class': cls.thisType,
-                     'inheritedType': inherited.type,
-                     'inheritedClass': inherited.declarer});
-                compiler.reportInfo(inherited.element, infoKind,
-                    {'name': declared.name.text,
-                     'class': inherited.declarer});
+                reporter.reportWarning(
+                    reporter.createMessage(
+                        declared.element,
+                        warningKind,
+                        {'declaredType': declared.type,
+                         'name': declared.name.text,
+                         'class': cls.thisType,
+                         'inheritedType': inherited.type,
+                         'inheritedClass': inherited.declarer}),
+                    <DiagnosticMessage>[
+                        reporter.createMessage(
+                            inherited.element,
+                            infoKind,
+                            {'name': declared.name.text,
+                             'class': inherited.declarer}),
+                    ]);
               });
             }
             if (declared.isDeclaredByField) {
@@ -469,12 +503,15 @@
                               MessageKind errorMessage,
                               Element contextElement,
                               MessageKind contextMessage) {
-    compiler.reportError(
-        errorneousElement,
-        errorMessage,
-        {'memberName': contextElement.name,
-         'className': contextElement.enclosingClass.name});
-    compiler.reportInfo(contextElement, contextMessage);
+    reporter.reportError(
+        reporter.createMessage(
+            errorneousElement,
+            errorMessage,
+            {'memberName': contextElement.name,
+             'className': contextElement.enclosingClass.name}),
+        <DiagnosticMessage>[
+            reporter.createMessage(contextElement, contextMessage),
+        ]);
   }
 
   /// Compute all class and interface names by the [name] in [cls].
@@ -677,9 +714,11 @@
               () => new Setlet<Member>()).add(inherited);
         }
         if (someAreGetters && !allAreGetters) {
-          compiler.reportWarning(cls,
-                                 MessageKind.INHERIT_GETTER_AND_METHOD,
-                                 {'class': thisType, 'name': name.text });
+          DiagnosticMessage warning = reporter.createMessage(
+              cls,
+              MessageKind.INHERIT_GETTER_AND_METHOD,
+              {'class': thisType, 'name': name.text });
+          List<DiagnosticMessage> infos = <DiagnosticMessage>[];
           for (Member inherited in inheritedMembers) {
             MessageKind kind;
             if (inherited.isMethod) {
@@ -694,9 +733,12 @@
                 kind = MessageKind.INHERITED_EXPLICIT_GETTER;
               }
             }
-            compiler.reportInfo(inherited.element, kind,
-                {'class': inherited.declarer, 'name': name.text });
+            infos.add(reporter.createMessage(
+                inherited.element,
+                kind,
+                {'class': inherited.declarer, 'name': name.text}));
           }
+          reporter.reportWarning(warning, infos);
           interfaceMembers[name] = new ErroneousMember(inheritedMembers);
         } else if (subtypesOfAllInherited.length == 1) {
           // All signatures have the same type.
@@ -805,6 +847,7 @@
   /// this class.
   MembersCreator _prepareCreator(Compiler compiler) {
     if (classMembers == null) {
+      ensureResolved(compiler.resolution);
       classMembers = new Map<Name, Member>();
 
       if (interfaceMembersAreClassMembers) {
@@ -834,7 +877,7 @@
   /// and private names.
   void computeClassMember(Compiler compiler, String name, Setlet<Name> names) {
     if (isMemberComputed(name)) return;
-    if (isPrivateName(name)) {
+    if (Name.isPrivateName(name)) {
       names..add(new Name(name, library))
            ..add(new Name(name, library, isSetter: true));
     }
@@ -843,7 +886,7 @@
     if (computedMemberNames == null) {
       computedMemberNames = _EMPTY_MEMBERS_NAMES;
     }
-    if (name != Compiler.CALL_OPERATOR_NAME) {
+    if (name != Identifiers.call) {
       Setlet<String> set;
       if (identical(computedMemberNames, _EMPTY_MEMBERS_NAMES)) {
         computedMemberNames = set = new Setlet<String>();
@@ -870,7 +913,7 @@
     if (computedMemberNames == null) {
       return classMembers != null;
     } else {
-      return name == Compiler.CALL_OPERATOR_NAME ||
+      return name == Identifiers.call ||
              computedMemberNames.contains(name);
     }
   }
diff --git a/pkg/compiler/lib/src/resolution/constructors.dart b/pkg/compiler/lib/src/resolution/constructors.dart
index f3f6be9..76aa6fc 100644
--- a/pkg/compiler/lib/src/resolution/constructors.dart
+++ b/pkg/compiler/lib/src/resolution/constructors.dart
@@ -2,7 +2,41 @@
 // for 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 resolution;
+library dart2js.resolution.constructors;
+
+import '../common.dart';
+import '../compiler.dart' show
+    Compiler;
+import '../constants/constructors.dart' show
+    GenerativeConstantConstructor,
+    RedirectingGenerativeConstantConstructor;
+import '../constants/expressions.dart';
+import '../dart_types.dart';
+import '../elements/elements.dart';
+import '../elements/modelx.dart' show
+    ConstructorElementX,
+    ErroneousConstructorElementX,
+    ErroneousElementX,
+    ErroneousFieldElementX,
+    FieldElementX,
+    InitializingFormalElementX,
+    ParameterElementX;
+import '../tree/tree.dart';
+import '../util/util.dart' show
+    Link;
+import '../universe/call_structure.dart' show
+    CallStructure;
+import '../universe/selector.dart' show
+    Selector;
+
+import 'members.dart' show
+    lookupInScope,
+    ResolverVisitor;
+import 'registry.dart' show
+    ResolutionRegistry;
+import 'resolution_common.dart' show
+    CommonResolverVisitor;
+import 'resolution_result.dart';
 
 class InitializerResolver {
   final ResolverVisitor visitor;
@@ -21,13 +55,7 @@
 
   ResolutionRegistry get registry => visitor.registry;
 
-  error(Node node, MessageKind kind, [arguments = const {}]) {
-    visitor.error(node, kind, arguments);
-  }
-
-  warning(Node node, MessageKind kind, [arguments = const {}]) {
-    visitor.warning(node, kind, arguments);
-  }
+  DiagnosticReporter get reporter => visitor.reporter;
 
   bool isFieldInitializer(SendSet node) {
     if (node.selector.asIdentifier() == null) return false;
@@ -37,12 +65,17 @@
   }
 
   reportDuplicateInitializerError(Element field, Node init, Node existing) {
-    visitor.compiler.reportError(
-        init,
-        MessageKind.DUPLICATE_INITIALIZER, {'fieldName': field.name});
-    visitor.compiler.reportInfo(
-        existing,
-        MessageKind.ALREADY_INITIALIZED, {'fieldName': field.name});
+    reporter.reportError(
+        reporter.createMessage(
+            init,
+            MessageKind.DUPLICATE_INITIALIZER,
+            {'fieldName': field.name}),
+        <DiagnosticMessage>[
+            reporter.createMessage(
+                existing,
+                MessageKind.ALREADY_INITIALIZED,
+                {'fieldName': field.name}),
+        ]);
     isValidAsConstant = false;
   }
 
@@ -52,7 +85,7 @@
     if (initialized.containsKey(field)) {
       reportDuplicateInitializerError(field, init, initialized[field]);
     } else if (field.isFinal) {
-      field.parseNode(visitor.compiler);
+      field.parseNode(visitor.resolution.parsing);
       Expression initializer = field.initializer;
       if (initializer != null) {
         reportDuplicateInitializerError(field, init, initializer);
@@ -71,24 +104,30 @@
     if (isFieldInitializer(init)) {
       target = constructor.enclosingClass.lookupLocalMember(name);
       if (target == null) {
-        error(selector, MessageKind.CANNOT_RESOLVE, {'name': name});
+        reporter.reportErrorMessage(
+            selector, MessageKind.CANNOT_RESOLVE, {'name': name});
         target = new ErroneousFieldElementX(
             selector.asIdentifier(), constructor.enclosingClass);
       } else if (target.kind != ElementKind.FIELD) {
-        error(selector, MessageKind.NOT_A_FIELD, {'fieldName': name});
+        reporter.reportErrorMessage(
+            selector, MessageKind.NOT_A_FIELD, {'fieldName': name});
         target = new ErroneousFieldElementX(
             selector.asIdentifier(), constructor.enclosingClass);
       } else if (!target.isInstanceMember) {
-        error(selector, MessageKind.INIT_STATIC_FIELD, {'fieldName': name});
+        reporter.reportErrorMessage(
+            selector, MessageKind.INIT_STATIC_FIELD, {'fieldName': name});
       } else {
         field = target;
       }
     } else {
-      error(init, MessageKind.INVALID_RECEIVER_IN_INITIALIZER);
+      reporter.reportErrorMessage(
+          init, MessageKind.INVALID_RECEIVER_IN_INITIALIZER);
     }
-    registry.useElement(init, target);
-    registry.registerStaticUse(target);
-    checkForDuplicateInitializers(target, init);
+    if (target != null) {
+      registry.useElement(init, target);
+      registry.registerStaticUse(target);
+      checkForDuplicateInitializers(target, init);
+    }
     // Resolve initializing value.
     ResolutionResult result = visitor.visitInStaticContext(
         init.arguments.head,
@@ -108,7 +147,8 @@
     if (isSuperCall) {
       // Calculate correct lookup target and constructor name.
       if (identical(constructor.enclosingClass, visitor.compiler.objectClass)) {
-        error(diagnosticNode, MessageKind.SUPER_INITIALIZER_IN_OBJECT);
+        reporter.reportErrorMessage(
+            diagnosticNode, MessageKind.SUPER_INITIALIZER_IN_OBJECT);
         isValidAsConstant = false;
       } else {
         return constructor.enclosingClass.supertype;
@@ -130,8 +170,8 @@
     ClassElement lookupTarget = targetType.element;
     Selector constructorSelector =
         visitor.getRedirectingThisOrSuperConstructorSelector(call);
-    FunctionElement calledConstructor =
-        lookupTarget.lookupConstructor(constructorSelector.name);
+    ConstructorElement calledConstructor = findConstructor(
+        constructor.library, lookupTarget, constructorSelector.name);
 
     final bool isImplicitSuperCall = false;
     final String className = lookupTarget.name;
@@ -141,9 +181,10 @@
                                      call,
                                      className,
                                      constructorSelector);
-
-    registry.useElement(call, calledConstructor);
-    registry.registerStaticUse(calledConstructor);
+    if (calledConstructor != null) {
+      registry.useElement(call, calledConstructor);
+      registry.registerStaticUse(calledConstructor);
+    }
     if (isConst) {
       if (isValidAsConstant &&
           calledConstructor.isConst &&
@@ -177,7 +218,9 @@
           getSuperOrThisLookupTarget(functionNode, isSuperCall: true);
       ClassElement lookupTarget = targetType.element;
       Selector constructorSelector = new Selector.callDefaultConstructor();
-      Element calledConstructor = lookupTarget.lookupConstructor(
+      ConstructorElement calledConstructor = findConstructor(
+          constructor.library,
+          lookupTarget,
           constructorSelector.name);
 
       final String className = lookupTarget.name;
@@ -188,8 +231,10 @@
                                        functionNode,
                                        className,
                                        constructorSelector);
-      registry.registerImplicitSuperCall(calledConstructor);
-      registry.registerStaticUse(calledConstructor);
+      if (calledConstructor != null) {
+        registry.registerImplicitSuperCall(calledConstructor);
+        registry.registerStaticUse(calledConstructor);
+      }
 
       if (isConst && isValidAsConstant) {
         return new ConstructedConstantExpression(
@@ -217,23 +262,23 @@
       MessageKind kind = isImplicitSuperCall
           ? MessageKind.CANNOT_RESOLVE_CONSTRUCTOR_FOR_IMPLICIT
           : MessageKind.CANNOT_RESOLVE_CONSTRUCTOR;
-      visitor.compiler.reportError(
+      reporter.reportErrorMessage(
           diagnosticNode, kind, {'constructorName': fullConstructorName});
       isValidAsConstant = false;
     } else {
-      lookedupConstructor.computeType(visitor.compiler);
+      lookedupConstructor.computeType(visitor.resolution);
       if (!call.signatureApplies(lookedupConstructor.functionSignature)) {
         MessageKind kind = isImplicitSuperCall
                            ? MessageKind.NO_MATCHING_CONSTRUCTOR_FOR_IMPLICIT
                            : MessageKind.NO_MATCHING_CONSTRUCTOR;
-        visitor.compiler.reportError(diagnosticNode, kind);
+        reporter.reportErrorMessage(diagnosticNode, kind);
         isValidAsConstant = false;
       } else if (constructor.isConst
                  && !lookedupConstructor.isConst) {
         MessageKind kind = isImplicitSuperCall
                            ? MessageKind.CONST_CALLS_NON_CONST_FOR_IMPLICIT
                            : MessageKind.CONST_CALLS_NON_CONST;
-        visitor.compiler.reportError(diagnosticNode, kind);
+        reporter.reportErrorMessage(diagnosticNode, kind);
         isValidAsConstant = false;
       }
     }
@@ -303,12 +348,14 @@
       } else if (link.head.asSend() != null) {
         final Send call = link.head.asSend();
         if (call.argumentsNode == null) {
-          error(link.head, MessageKind.INVALID_INITIALIZER);
+          reporter.reportErrorMessage(
+              link.head, MessageKind.INVALID_INITIALIZER);
           continue;
         }
         if (Initializers.isSuperConstructorCall(call)) {
           if (resolvedSuper) {
-            error(call, MessageKind.DUPLICATE_SUPER_INITIALIZER);
+            reporter.reportErrorMessage(
+                call, MessageKind.DUPLICATE_SUPER_INITIALIZER);
           }
           ResolutionResult result = resolveSuperOrThisForSend(call);
           if (isConst) {
@@ -324,11 +371,13 @@
           // constructor is also const, we already reported an error in
           // [resolveMethodElement].
           if (functionNode.hasBody() && !constructor.isConst) {
-            error(functionNode, MessageKind.REDIRECTING_CONSTRUCTOR_HAS_BODY);
+            reporter.reportErrorMessage(
+                functionNode, MessageKind.REDIRECTING_CONSTRUCTOR_HAS_BODY);
           }
           // Check that there are no other initializers.
           if (!initializers.tail.isEmpty) {
-            error(call, MessageKind.REDIRECTING_CONSTRUCTOR_HAS_INITIALIZER);
+            reporter.reportErrorMessage(
+                call, MessageKind.REDIRECTING_CONSTRUCTOR_HAS_INITIALIZER);
           } else {
             constructor.isRedirectingGenerative = true;
           }
@@ -337,7 +386,8 @@
           signature.forEachParameter((ParameterElement parameter) {
             if (parameter.isInitializingFormal) {
               Node node = parameter.node;
-              error(node, MessageKind.INITIALIZING_FORMAL_NOT_ALLOWED);
+              reporter.reportErrorMessage(
+                  node, MessageKind.INITIALIZING_FORMAL_NOT_ALLOWED);
               isValidAsConstant = false;
             }
           });
@@ -357,11 +407,13 @@
           }
           return result.element;
         } else {
-          visitor.error(call, MessageKind.CONSTRUCTOR_CALL_EXPECTED);
+          reporter.reportErrorMessage(
+              call, MessageKind.CONSTRUCTOR_CALL_EXPECTED);
           return null;
         }
       } else {
-        error(link.head, MessageKind.INVALID_INITIALIZER);
+        reporter.reportErrorMessage(
+            link.head, MessageKind.INVALID_INITIALIZER);
       }
     }
     if (!resolvedSuper) {
@@ -378,10 +430,9 @@
   }
 }
 
-class ConstructorResolver extends CommonResolverVisitor<Element> {
+class ConstructorResolver extends CommonResolverVisitor<ConstructorResult> {
   final ResolverVisitor resolver;
-  bool inConstContext;
-  DartType type;
+  final bool inConstContext;
 
   ConstructorResolver(Compiler compiler, this.resolver,
                       {bool this.inConstContext: false})
@@ -393,8 +444,10 @@
     throw 'not supported';
   }
 
-  ErroneousConstructorElementX failOrReturnErroneousConstructorElement(
+  ConstructorResult reportAndCreateErroneousConstructorElement(
       Spannable diagnosticNode,
+      ConstructorResultKind resultKind,
+      DartType type,
       Element enclosing,
       String name,
       MessageKind kind,
@@ -407,175 +460,305 @@
       registry.registerThrowRuntimeError();
     }
     if (isError || inConstContext) {
-      compiler.reportError(diagnosticNode, kind, arguments);
+      reporter.reportErrorMessage(
+          diagnosticNode, kind, arguments);
     } else {
-      compiler.reportWarning(diagnosticNode, kind, arguments);
+      reporter.reportWarningMessage(
+          diagnosticNode, kind, arguments);
     }
-    return new ErroneousConstructorElementX(
+    ErroneousElement error = new ErroneousConstructorElementX(
         kind, arguments, name, enclosing);
+    if (type == null) {
+      type = new MalformedType(error, null);
+    }
+    return new ConstructorResult(resultKind, error, type);
   }
 
-  FunctionElement resolveConstructor(ClassElement cls,
-                                     Node diagnosticNode,
-                                     String constructorName) {
-    cls.ensureResolved(compiler);
-    Element result = cls.lookupConstructor(constructorName);
-    // TODO(johnniwinther): Use [Name] for lookup.
-    if (isPrivateName(constructorName) &&
-        resolver.enclosingElement.library != cls.library) {
-      result = null;
-    }
-    if (result == null) {
-      String fullConstructorName = Elements.constructorNameForDiagnostics(
-              cls.name,
-              constructorName);
-      return failOrReturnErroneousConstructorElement(
+  ConstructorResult resolveConstructor(
+      InterfaceType type,
+      Node diagnosticNode,
+      String constructorName) {
+    ClassElement cls = type.element;
+    cls.ensureResolved(resolution);
+    ConstructorElement constructor = findConstructor(
+        resolver.enclosingElement.library, cls, constructorName);
+    if (constructor == null) {
+      String fullConstructorName =
+          Elements.constructorNameForDiagnostics(cls.name, constructorName);
+      return reportAndCreateErroneousConstructorElement(
           diagnosticNode,
+          ConstructorResultKind.UNRESOLVED_CONSTRUCTOR, type,
           cls, constructorName,
           MessageKind.CANNOT_FIND_CONSTRUCTOR,
           {'constructorName': fullConstructorName},
           missingConstructor: true);
-    } else if (inConstContext && !result.isConst) {
-      error(diagnosticNode, MessageKind.CONSTRUCTOR_IS_NOT_CONST);
+    } else if (inConstContext && !constructor.isConst) {
+      reporter.reportErrorMessage(
+          diagnosticNode, MessageKind.CONSTRUCTOR_IS_NOT_CONST);
+      return new ConstructorResult(
+          ConstructorResultKind.NON_CONSTANT, constructor, type);
+    } else {
+      if (constructor.isGenerativeConstructor) {
+        if (cls.isAbstract) {
+          reporter.reportWarningMessage(
+              diagnosticNode, MessageKind.ABSTRACT_CLASS_INSTANTIATION);
+          registry.registerAbstractClassInstantiation();
+          return new ConstructorResult(
+              ConstructorResultKind.ABSTRACT, constructor, type);
+        } else {
+          return new ConstructorResult(
+              ConstructorResultKind.GENERATIVE, constructor, type);
+        }
+      } else {
+        assert(invariant(diagnosticNode, constructor.isFactoryConstructor,
+            message: "Unexpected constructor $constructor."));
+        return new ConstructorResult(
+            ConstructorResultKind.FACTORY, constructor, type);
+      }
     }
-    return result;
   }
 
-  Element visitNewExpression(NewExpression node) {
-    inConstContext = node.isConst;
+  ConstructorResult visitNewExpression(NewExpression node) {
     Node selector = node.send.selector;
-    Element element = visit(selector);
-    assert(invariant(selector, element != null,
-        message: 'No element return for $selector.'));
-    return finishConstructorReference(element, node.send.selector, node);
+    ConstructorResult result = visit(selector);
+    assert(invariant(selector, result != null,
+        message: 'No result returned for $selector.'));
+    return finishConstructorReference(result, node.send.selector, node);
   }
 
   /// Finishes resolution of a constructor reference and records the
   /// type of the constructed instance on [expression].
-  FunctionElement finishConstructorReference(Element element,
-                                             Node diagnosticNode,
-                                             Node expression) {
-    assert(invariant(diagnosticNode, element != null,
-        message: 'No element return for $diagnosticNode.'));
+  ConstructorResult finishConstructorReference(
+      ConstructorResult result,
+      Node diagnosticNode,
+      Node expression) {
+    assert(invariant(diagnosticNode, result != null,
+        message: 'No result returned for $diagnosticNode.'));
+
+    if (result.kind != null) {
+      resolver.registry.setType(expression, result.type);
+      return result;
+    }
+
     // Find the unnamed constructor if the reference resolved to a
     // class.
-    if (!Elements.isUnresolved(element) && !element.isConstructor) {
-      if (element.isClass) {
-        ClassElement cls = element;
-        cls.ensureResolved(compiler);
-        // The unnamed constructor may not exist, so [e] may become unresolved.
-        element = resolveConstructor(cls, diagnosticNode, '');
+    if (result.type != null) {
+      // The unnamed constructor may not exist, so [e] may become unresolved.
+      result = resolveConstructor(result.type, diagnosticNode, '');
+    } else {
+      Element element = result.element;
+      if (element.isErroneous) {
+        result = constructorResultForErroneous(diagnosticNode, element);
       } else {
-        element = failOrReturnErroneousConstructorElement(
+        result = reportAndCreateErroneousConstructorElement(
             diagnosticNode,
+            ConstructorResultKind.INVALID_TYPE, null,
             element, element.name,
             MessageKind.NOT_A_TYPE, {'node': diagnosticNode});
       }
-    } else if (element.isErroneous && element is! ErroneousElementX) {
-      // Parser error. The error has already been reported.
-      element = new ErroneousConstructorElementX(
-          MessageKind.NOT_A_TYPE, {'node': diagnosticNode},
-          element.name, element);
-      registry.registerThrowRuntimeError();
     }
-
-    if (type == null) {
-      if (Elements.isUnresolved(element)) {
-        type = const DynamicType();
-      } else {
-        type = element.enclosingClass.rawType;
-      }
-    }
-    resolver.registry.setType(expression, type);
-    return element;
+    resolver.registry.setType(expression, result.type);
+    return result;
   }
 
-  Element visitTypeAnnotation(TypeAnnotation node) {
-    assert(invariant(node, type == null));
+  ConstructorResult visitTypeAnnotation(TypeAnnotation node) {
     // This is not really resolving a type-annotation, but the name of the
     // constructor. Therefore we allow deferred types.
-    type = resolver.resolveTypeAnnotation(node,
-                                          malformedIsError: inConstContext,
-                                          deferredIsMalformed: false);
+    DartType type = resolver.resolveTypeAnnotation(
+        node,
+        malformedIsError: inConstContext,
+        deferredIsMalformed: false);
     registry.registerRequiredType(type, resolver.enclosingElement);
-    return type.element;
+    return constructorResultForType(node, type);
   }
 
-  Element visitSend(Send node) {
-    Element element = visit(node.receiver);
-    assert(invariant(node.receiver, element != null,
-        message: 'No element return for $node.receiver.'));
-    if (Elements.isUnresolved(element)) return element;
-    Identifier name = node.selector.asIdentifier();
-    if (name == null) internalError(node.selector, 'unexpected node');
-
-    if (element.isClass) {
-      ClassElement cls = element;
-      cls.ensureResolved(compiler);
-      return resolveConstructor(cls, name, name.source);
-    } else if (element.isPrefix) {
-      PrefixElement prefix = element;
-      element = prefix.lookupLocalMember(name.source);
-      element = Elements.unwrap(element, compiler, node);
-      if (element == null) {
-        return failOrReturnErroneousConstructorElement(
-            name,
-            resolver.enclosingElement, name.source,
-            MessageKind.CANNOT_RESOLVE, {'name': name});
-      } else if (!element.isClass) {
-        return failOrReturnErroneousConstructorElement(
-            name,
-            resolver.enclosingElement, name.source,
-            MessageKind.NOT_A_TYPE, {'node': name},
-            isError: true);
-      }
-    } else {
-      internalError(node.receiver, 'unexpected element $element');
+  ConstructorResult visitSend(Send node) {
+    ConstructorResult receiver = visit(node.receiver);
+    assert(invariant(node.receiver, receiver != null,
+        message: 'No result returned for $node.receiver.'));
+    if (receiver.kind != null) {
+      assert(invariant(node, receiver.element.isErroneous,
+          message: "Unexpected prefix result: $receiver."));
+      // We have already found an error.
+      return receiver;
     }
-    return element;
+
+    Identifier name = node.selector.asIdentifier();
+    if (name == null) {
+      reporter.internalError(node.selector, 'unexpected node');
+    }
+
+    if (receiver.type != null) {
+      if (receiver.type.isInterfaceType) {
+        return resolveConstructor(receiver.type, name, name.source);
+      } else {
+        // TODO(johnniwinther): Update the message for the different types.
+        return reportAndCreateErroneousConstructorElement(
+            name,
+            ConstructorResultKind.INVALID_TYPE, null,
+            resolver.enclosingElement, name.source,
+            MessageKind.NOT_A_TYPE, {'node': name});
+      }
+    } else if (receiver.element.isPrefix) {
+      PrefixElement prefix = receiver.element;
+      Element member = prefix.lookupLocalMember(name.source);
+      return constructorResultForElement(node, name.source, member);
+    } else {
+      return reporter.internalError(
+          node.receiver, 'unexpected receiver $receiver');
+    }
   }
 
-  Element visitIdentifier(Identifier node) {
+  ConstructorResult visitIdentifier(Identifier node) {
     String name = node.source;
     Element element = resolver.reportLookupErrorIfAny(
-        lookupInScope(compiler, node, resolver.scope, name), node, name);
+        lookupInScope(reporter, node, resolver.scope, name), node, name);
     registry.useElement(node, element);
     // TODO(johnniwinther): Change errors to warnings, cf. 11.11.1.
-    if (element == null) {
-      return failOrReturnErroneousConstructorElement(
-          node,
-          resolver.enclosingElement, name,
-          MessageKind.CANNOT_RESOLVE,
-          {'name': name});
-    } else if (element.isErroneous) {
-      return element;
-    } else if (element.isTypedef) {
-      element = failOrReturnErroneousConstructorElement(
-          node,
-          resolver.enclosingElement, name,
-          MessageKind.CANNOT_INSTANTIATE_TYPEDEF, {'typedefName': name},
-          isError: true);
-    } else if (element.isTypeVariable) {
-      element = failOrReturnErroneousConstructorElement(
-          node,
-          resolver.enclosingElement, name,
-          MessageKind.CANNOT_INSTANTIATE_TYPE_VARIABLE,
-          {'typeVariableName': name},
-          isError: true);
-    } else if (!element.isClass && !element.isPrefix) {
-      element = failOrReturnErroneousConstructorElement(
-          node,
-          resolver.enclosingElement, name,
-          MessageKind.NOT_A_TYPE, {'node': name},
-          isError: true);
-    }
-    return element;
+    return constructorResultForElement(node, name, element);
   }
 
   /// Assumed to be called by [resolveRedirectingFactory].
-  Element visitRedirectingFactoryBody(RedirectingFactoryBody node) {
+  ConstructorResult visitRedirectingFactoryBody(RedirectingFactoryBody node) {
     Node constructorReference = node.constructorReference;
     return finishConstructorReference(visit(constructorReference),
         constructorReference, node);
   }
+
+  ConstructorResult constructorResultForElement(
+      Node node, String name, Element element) {
+    element = Elements.unwrap(element, reporter, node);
+    if (element == null) {
+      return reportAndCreateErroneousConstructorElement(
+          node,
+          ConstructorResultKind.INVALID_TYPE, null,
+          resolver.enclosingElement, name,
+          MessageKind.CANNOT_RESOLVE,
+          {'name': name});
+    } else if (element.isErroneous) {
+      return constructorResultForErroneous(node, element);
+    } else if (element.isClass) {
+      ClassElement cls = element;
+      cls.computeType(resolution);
+      return constructorResultForType(node, cls.rawType);
+    } else if (element.isPrefix) {
+      return new ConstructorResult.forElement(element);
+    } else if (element.isTypedef) {
+      TypedefElement typdef = element;
+      typdef.ensureResolved(resolution);
+      return constructorResultForType(node, typdef.rawType);
+    } else if (element.isTypeVariable) {
+      TypeVariableElement typeVariableElement = element;
+      return constructorResultForType(node, typeVariableElement.type);
+    } else {
+      return reportAndCreateErroneousConstructorElement(
+          node,
+          ConstructorResultKind.INVALID_TYPE, null,
+          resolver.enclosingElement, name,
+          MessageKind.NOT_A_TYPE, {'node': name});
+    }
+  }
+
+  ConstructorResult constructorResultForErroneous(
+      Node node, Element error) {
+    if (error is! ErroneousElementX) {
+      // Parser error. The error has already been reported.
+      error = new ErroneousConstructorElementX(
+          MessageKind.NOT_A_TYPE, {'node': node},
+          error.name, error);
+      registry.registerThrowRuntimeError();
+    }
+    return new ConstructorResult(
+        ConstructorResultKind.INVALID_TYPE,
+        error,
+        new MalformedType(error, null));
+  }
+
+  ConstructorResult constructorResultForType(
+      Node node,
+      DartType type) {
+    String name = type.name;
+    if (type.isMalformed) {
+      return new ConstructorResult(
+          ConstructorResultKind.INVALID_TYPE, type.element, type);
+    } else if (type.isInterfaceType) {
+      return new ConstructorResult.forType(type);
+    } else if (type.isTypedef) {
+      return reportAndCreateErroneousConstructorElement(
+          node,
+          ConstructorResultKind.INVALID_TYPE, type,
+          resolver.enclosingElement, name,
+          MessageKind.CANNOT_INSTANTIATE_TYPEDEF, {'typedefName': name});
+    } else if (type.isTypeVariable) {
+      return reportAndCreateErroneousConstructorElement(
+          node,
+          ConstructorResultKind.INVALID_TYPE, type,
+          resolver.enclosingElement, name,
+          MessageKind.CANNOT_INSTANTIATE_TYPE_VARIABLE,
+          {'typeVariableName': name});
+    }
+    return reporter.internalError(node, "Unexpected constructor type $type");
+  }
+
+}
+
+enum ConstructorResultKind {
+  GENERATIVE,
+  FACTORY,
+  ABSTRACT,
+  INVALID_TYPE,
+  UNRESOLVED_CONSTRUCTOR,
+  NON_CONSTANT,
+}
+
+class ConstructorResult {
+  final ConstructorResultKind kind;
+  final Element element;
+  final DartType type;
+
+  ConstructorResult(this.kind, this.element, this.type);
+
+  ConstructorResult.forElement(this.element)
+      : kind = null,
+        type = null;
+
+  ConstructorResult.forType(this.type)
+      : kind = null,
+        element = null;
+
+  String toString() {
+    StringBuffer sb = new StringBuffer();
+    sb.write('ConstructorResult(');
+    if (kind != null) {
+      sb.write('kind=$kind,');
+      sb.write('element=$element,');
+      sb.write('type=$type');
+    } else if (element != null) {
+      sb.write('element=$element');
+    } else {
+      sb.write('type=$type');
+    }
+    sb.write(')');
+    return sb.toString();
+  }
+}
+
+/// Lookup the [constructorName] constructor in [cls] and normalize the result
+/// with respect to privacy and patching.
+ConstructorElement findConstructor(
+    LibraryElement currentLibrary,
+    ClassElement cls,
+    String constructorName) {
+  if (Name.isPrivateName(constructorName) &&
+      currentLibrary.library != cls.library) {
+    // TODO(johnniwinther): Report a special error on unaccessible private
+    // constructors.
+    return null;
+  }
+  // TODO(johnniwinther): Use [Name] for lookup.
+  ConstructorElement constructor = cls.lookupConstructor(constructorName);
+  if (constructor != null) {
+    constructor = constructor.declaration;
+  }
+  return constructor;
 }
diff --git a/pkg/compiler/lib/src/resolution/enum_creator.dart b/pkg/compiler/lib/src/resolution/enum_creator.dart
index 7a25972..f9913c2 100644
--- a/pkg/compiler/lib/src/resolution/enum_creator.dart
+++ b/pkg/compiler/lib/src/resolution/enum_creator.dart
@@ -4,11 +4,17 @@
 
 library dart2js.resolution.enum_creator;
 
+import '../common.dart';
+import '../core_types.dart' show
+    CoreTypes;
 import '../dart_types.dart';
-import '../dart2jslib.dart';
 import '../elements/elements.dart';
 import '../elements/modelx.dart';
-import '../scanner/scannerlib.dart';
+import '../tokens/keyword.dart' show
+    Keyword;
+import '../tokens/precedence.dart';
+import '../tokens/precedence_constants.dart' as Precedence;
+import '../tokens/token.dart';
 import '../tree/tree.dart';
 import '../util/util.dart';
 
@@ -45,7 +51,8 @@
   }
 
   Token stringToken(String text) {
-    return new StringToken.fromString(IDENTIFIER_INFO, text, charOffset);
+    return new StringToken.fromString(
+        Precedence.IDENTIFIER_INFO, text, charOffset);
   }
 
   Token symbolToken(PrecedenceInfo info) {
@@ -70,16 +77,16 @@
   }
 
   NodeList argumentList(List<Node> nodes) {
-    return new NodeList(symbolToken(OPEN_PAREN_INFO),
+    return new NodeList(symbolToken(Precedence.OPEN_PAREN_INFO),
                         linkedList(nodes),
-                        symbolToken(CLOSE_PAREN_INFO),
+                        symbolToken(Precedence.CLOSE_PAREN_INFO),
                         ',');
   }
 
   Return returnStatement(Expression expression) {
     return new Return(
         keywordToken('return'),
-        symbolToken(SEMICOLON_INFO),
+        symbolToken(Precedence.SEMICOLON_INFO),
         expression);
   }
 
@@ -101,7 +108,7 @@
   }
 
   EmptyStatement emptyStatement() {
-    return new EmptyStatement(symbolToken(COMMA_INFO));
+    return new EmptyStatement(symbolToken(Precedence.COMMA_INFO));
   }
 
   LiteralInt literalInt(int value) {
@@ -118,17 +125,18 @@
   LiteralList listLiteral(List<Node> elements, {bool isConst: false}) {
     return new LiteralList(
         null,
-        new NodeList(symbolToken(OPEN_SQUARE_BRACKET_INFO),
+        new NodeList(symbolToken(Precedence.OPEN_SQUARE_BRACKET_INFO),
                      linkedList(elements),
-                     symbolToken(CLOSE_SQUARE_BRACKET_INFO),
+                     symbolToken(Precedence.CLOSE_SQUARE_BRACKET_INFO),
                      ','),
         isConst ? keywordToken('const') : null);
   }
 
   Node createDefinition(Identifier name, Expression initializer) {
     if (initializer == null) return name;
-    return new SendSet(null, name, new Operator(symbolToken(EQ_INFO)),
-                 new NodeList.singleton(initializer));
+    return new SendSet(null, name,
+        new Operator(symbolToken(Precedence.EQ_INFO)),
+            new NodeList.singleton(initializer));
   }
 
   VariableDefinitions initializingFormal(String fieldName) {
@@ -153,38 +161,39 @@
 
   Send indexGet(Expression receiver, Expression index) {
     return new Send(receiver,
-                    new Operator(symbolToken(INDEX_INFO)),
+                    new Operator(symbolToken(Precedence.INDEX_INFO)),
                     new NodeList.singleton(index));
   }
 
   LiteralMapEntry mapLiteralEntry(Expression key, Expression value) {
-    return new LiteralMapEntry(key, symbolToken(COLON_INFO), value);
+    return new LiteralMapEntry(key, symbolToken(Precedence.COLON_INFO), value);
   }
 
   LiteralMap mapLiteral(List<LiteralMapEntry> entries, {bool isConst: false}) {
     return new LiteralMap(
         null, // Type arguments.
-        new NodeList(symbolToken(OPEN_CURLY_BRACKET_INFO),
+        new NodeList(symbolToken(Precedence.OPEN_CURLY_BRACKET_INFO),
                      linkedList(entries),
-                     symbolToken(CLOSE_CURLY_BRACKET_INFO),
+                     symbolToken(Precedence.CLOSE_CURLY_BRACKET_INFO),
                      ','),
         isConst ? keywordToken('const') : null);
   }
 }
 
 class EnumCreator {
-  final Compiler compiler;
+  final DiagnosticReporter reporter;
+  final CoreTypes coreTypes;
   final EnumClassElementX enumClass;
 
-  EnumCreator(this.compiler, this.enumClass);
+  EnumCreator(this.reporter, this.coreTypes, this.enumClass);
 
   void createMembers() {
     Enum node = enumClass.node;
     InterfaceType enumType = enumClass.thisType;
     AstBuilder builder = new AstBuilder(enumClass.position.charOffset);
 
-    InterfaceType intType = compiler.intClass.computeType(compiler);
-    InterfaceType stringType = compiler.stringClass.computeType(compiler);
+    InterfaceType intType = coreTypes.intType;
+    InterfaceType stringType = coreTypes.stringType;
 
     EnumFieldElementX addInstanceMember(String name, InterfaceType type) {
       Identifier identifier = builder.identifier(name);
@@ -193,7 +202,7 @@
       variableList.type = type;
       EnumFieldElementX variable = new EnumFieldElementX(
           identifier, enumClass, variableList, identifier);
-      enumClass.addMember(variable, compiler);
+      enumClass.addMember(variable, reporter);
       return variable;
     }
 
@@ -223,8 +232,8 @@
         requiredParameterCount: 1,
         type: new FunctionType(constructor, const VoidType(),
             <DartType>[intType]));
-    constructor.functionSignatureCache = constructorSignature;
-    enumClass.addMember(constructor, compiler);
+    constructor.functionSignature = constructorSignature;
+    enumClass.addMember(constructor, reporter);
 
     List<FieldElement> enumValues = <FieldElement>[];
     VariableList variableList =
@@ -256,14 +265,13 @@
       EnumFieldElementX field = new EnumFieldElementX(
           name, enumClass, variableList, definition, initializer);
       enumValues.add(field);
-      enumClass.addMember(field, compiler);
+      enumClass.addMember(field, reporter);
       index++;
     }
 
     VariableList valuesVariableList =
         new VariableList(builder.modifiers(isStatic: true, isConst: true));
-    InterfaceType listType = compiler.listClass.computeType(compiler);
-    valuesVariableList.type = listType.createInstantiation([enumType]);
+    valuesVariableList.type = coreTypes.listType(enumType);
 
     Identifier valuesIdentifier = builder.identifier('values');
     // TODO(johnniwinther): Add type argument.
@@ -276,7 +284,7 @@
         valuesIdentifier, enumClass, valuesVariableList,
         definition, initializer);
 
-    enumClass.addMember(valuesVariable, compiler);
+    enumClass.addMember(valuesVariable, reporter);
 
     // TODO(johnniwinther): Support return type. Note `String` might be prefixed
     // or not imported within the current library.
@@ -295,8 +303,8 @@
         enumClass, Modifiers.EMPTY, toStringNode);
     FunctionSignatureX toStringSignature = new FunctionSignatureX(
         type: new FunctionType(toString, stringType));
-    toString.functionSignatureCache = toStringSignature;
-    enumClass.addMember(toString, compiler);
+    toString.functionSignature = toStringSignature;
+    enumClass.addMember(toString, reporter);
 
     enumClass.enumValues = enumValues;
   }
diff --git a/pkg/compiler/lib/src/resolution/label_scope.dart b/pkg/compiler/lib/src/resolution/label_scope.dart
index c02c07e..21aed76 100644
--- a/pkg/compiler/lib/src/resolution/label_scope.dart
+++ b/pkg/compiler/lib/src/resolution/label_scope.dart
@@ -2,7 +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.
 
-part of resolution;
+library dart2js.resolution.label_scope;
+
+import '../elements/elements.dart' show
+    JumpTarget,
+    LabelDefinition;
+import '../util/util.dart' show
+    Link;
 
 abstract class LabelScope {
   LabelScope get outer;
diff --git a/pkg/compiler/lib/src/resolution/member_impl.dart b/pkg/compiler/lib/src/resolution/member_impl.dart
index 6c0bb21..072ddd1 100644
--- a/pkg/compiler/lib/src/resolution/member_impl.dart
+++ b/pkg/compiler/lib/src/resolution/member_impl.dart
@@ -2,7 +2,7 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-part of resolution.compute_members;
+part of dart2js.resolution.compute_members;
 
 class DeclaredMember implements Member {
   final Name name;
diff --git a/pkg/compiler/lib/src/resolution/members.dart b/pkg/compiler/lib/src/resolution/members.dart
index a67de98..90f5365 100644
--- a/pkg/compiler/lib/src/resolution/members.dart
+++ b/pkg/compiler/lib/src/resolution/members.dart
@@ -2,7 +2,69 @@
 // for 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 resolution;
+library dart2js.resolution.members;
+
+import '../common.dart';
+import '../common/names.dart' show
+    Selectors;
+import '../compiler.dart' show
+    Compiler;
+import '../constants/constructors.dart' show
+    RedirectingFactoryConstantConstructor;
+import '../constants/expressions.dart';
+import '../constants/values.dart';
+import '../core_types.dart';
+import '../dart_types.dart';
+import '../elements/elements.dart';
+import '../elements/modelx.dart' show
+    ConstructorElementX,
+    ErroneousElementX,
+    FunctionElementX,
+    JumpTargetX,
+    LocalFunctionElementX,
+    LocalParameterElementX,
+    LocalVariableElementX,
+    MethodElementX,
+    ParameterElementX,
+    VariableElementX,
+    VariableList;
+import '../tokens/token.dart' show
+    isUserDefinableOperator;
+import '../tree/tree.dart';
+import '../util/util.dart' show
+    Link;
+import '../universe/call_structure.dart' show
+    CallStructure;
+import '../universe/selector.dart' show
+    Selector;
+import '../universe/universe.dart' show
+    UniverseSelector;
+
+import 'access_semantics.dart';
+import 'class_members.dart' show MembersCreator;
+import 'operators.dart';
+import 'send_structure.dart';
+
+import 'constructors.dart' show
+    ConstructorResolver,
+    ConstructorResult;
+import 'label_scope.dart' show
+    StatementScope;
+import 'registry.dart' show
+    ResolutionRegistry;
+import 'resolution.dart' show
+    ResolverTask;
+import 'resolution_common.dart' show
+    MappingVisitor;
+import 'resolution_result.dart';
+import 'scope.dart' show
+    BlockScope,
+    MethodScope,
+    Scope;
+import 'signatures.dart' show
+    SignatureResolver;
+import 'variables.dart' show
+    VariableDefinitionsVisitor;
 
 /// The state of constants in resolutions.
 enum ConstantState {
@@ -56,12 +118,6 @@
   int allowedCategory = ElementCategory.VARIABLE | ElementCategory.FUNCTION
       | ElementCategory.IMPLIES_TYPE;
 
-  /**
-   * Record of argument nodes to JS_INTERCEPTOR_CONSTANT for deferred
-   * processing.
-   */
-  Set<Node> argumentsToJsInterceptorConstant = null;
-
   /// When visiting the type declaration of the variable in a [ForIn] loop,
   /// the initializer of the variable is implicit and we should not emit an
   /// error when verifying that all final variables are initialized.
@@ -141,19 +197,20 @@
   Element reportLookupErrorIfAny(Element result, Node node, String name) {
     if (!Elements.isUnresolved(result)) {
       if (!inInstanceContext && result.isInstanceMember) {
-        compiler.reportError(
+        reporter.reportErrorMessage(
             node, MessageKind.NO_INSTANCE_AVAILABLE, {'name': name});
         return new ErroneousElementX(MessageKind.NO_INSTANCE_AVAILABLE,
                                      {'name': name},
                                      name, enclosingElement);
       } else if (result.isAmbiguous) {
         AmbiguousElement ambiguous = result;
-        compiler.reportError(
-            node, ambiguous.messageKind, ambiguous.messageArguments);
-        ambiguous.diagnose(enclosingElement, compiler);
-        return new ErroneousElementX(ambiguous.messageKind,
-                                     ambiguous.messageArguments,
-                                     name, enclosingElement);
+        return reportAndCreateErroneousElement(
+              node,
+              name,
+              ambiguous.messageKind,
+              ambiguous.messageArguments,
+              infos: ambiguous.computeInfos(enclosingElement, reporter),
+              isError: true);
       }
     }
     return result;
@@ -234,11 +291,14 @@
       String name,
       MessageKind kind,
       Map arguments,
-      {bool isError: false}) {
+      {List<DiagnosticMessage> infos: const <DiagnosticMessage>[],
+       bool isError: false}) {
     if (isError) {
-      compiler.reportError(node, kind, arguments);
+      reporter.reportError(
+          reporter.createMessage(node, kind, arguments), infos);
     } else {
-      compiler.reportWarning(node, kind, arguments);
+      reporter.reportWarning(
+          reporter.createMessage(node, kind, arguments), infos);
     }
     // TODO(ahe): Use [allowedCategory] to synthesize a more precise subclass
     // of [ErroneousElementX]. For example, [ErroneousFieldElementX],
@@ -287,20 +347,23 @@
   ResolutionResult visitIdentifier(Identifier node) {
     if (node.isThis()) {
       if (!inInstanceContext) {
-        error(node, MessageKind.NO_INSTANCE_AVAILABLE, {'name': node});
+        reporter.reportErrorMessage(
+            node, MessageKind.NO_INSTANCE_AVAILABLE, {'name': node});
       }
       return const NoneResult();
     } else if (node.isSuper()) {
       if (!inInstanceContext) {
-        error(node, MessageKind.NO_SUPER_IN_STATIC);
+        reporter.reportErrorMessage(
+            node, MessageKind.NO_SUPER_IN_STATIC);
       }
       if ((ElementCategory.SUPER & allowedCategory) == 0) {
-        error(node, MessageKind.INVALID_USE_OF_SUPER);
+        reporter.reportErrorMessage(
+            node, MessageKind.INVALID_USE_OF_SUPER);
       }
       return const NoneResult();
     } else {
       String name = node.source;
-      Element element = lookupInScope(compiler, node, scope, name);
+      Element element = lookupInScope(reporter, node, scope, name);
       if (Elements.isUnresolved(element) && name == 'dynamic') {
         // TODO(johnniwinther): Remove this hack when we can return more complex
         // objects than [Element] from this method.
@@ -325,7 +388,7 @@
       }
       if (!Elements.isUnresolved(element) && element.isClass) {
         ClassElement classElement = element;
-        classElement.ensureResolved(compiler);
+        classElement.ensureResolved(resolution);
       }
       if (element != null) {
         registry.useElement(node, element);
@@ -343,7 +406,7 @@
   TypeResult visitTypeAnnotation(TypeAnnotation node) {
     DartType type = resolveTypeAnnotation(node);
     if (inCheckContext) {
-      registry.registerIsCheck(type);
+      registry.registerCheckedModeCheck(type);
     }
     return new TypeResult(type);
   }
@@ -354,15 +417,14 @@
     if (isNamedConstructor(node)) {
       String constructorName = node.selector.asIdentifier().source;
       return new Selector.callConstructor(
-          constructorName,
-          enclosingElement.library);
+          new Name(constructorName, enclosingElement.library));
     } else {
       return new Selector.callDefaultConstructor();
     }
   }
 
   FunctionElement resolveConstructorRedirection(FunctionElementX constructor) {
-    FunctionExpression node = constructor.parseNode(compiler);
+    FunctionExpression node = constructor.parseNode(resolution.parsing);
 
     // A synthetic constructor does not have a node.
     if (node == null) return null;
@@ -382,7 +444,7 @@
     Element enclosingElement = function.enclosingElement;
     if (node.modifiers.isStatic &&
         enclosingElement.kind != ElementKind.CLASS) {
-      compiler.reportError(node, MessageKind.ILLEGAL_STATIC);
+      reporter.reportErrorMessage(node, MessageKind.ILLEGAL_STATIC);
     }
 
     scope = new MethodScope(scope, function);
@@ -430,11 +492,26 @@
     });
     if (inCheckContext) {
       functionParameters.forEachParameter((ParameterElement element) {
-        registry.registerIsCheck(element.type);
+        registry.registerCheckedModeCheck(element.type);
       });
     }
   }
 
+  ResolutionResult visitAssert(Assert node) {
+    if (!compiler.enableAssertMessage) {
+      if (node.hasMessage) {
+        reporter.reportErrorMessage(
+            node, MessageKind.EXPERIMENTAL_ASSERT_MESSAGE);
+      }
+    }
+    // TODO(sra): We could completely ignore the assert in production mode if we
+    // didn't need it to be resolved for type checking.
+    registry.registerAssert(node.hasMessage);
+    visit(node.condition);
+    visit(node.message);
+    return const NoneResult();
+  }
+
   ResolutionResult visitCascade(Cascade node) {
     visit(node.expression);
     return const NoneResult();
@@ -518,7 +595,7 @@
       {bool inFunctionDeclaration: false}) {
     bool doAddToScope = inFunctionDeclaration;
     if (!inFunctionDeclaration && node.name != null) {
-      compiler.reportError(
+      reporter.reportErrorMessage(
           node.name,
           MessageKind.NAMED_FUNCTION_EXPRESSION,
           {'name': node.name});
@@ -534,7 +611,7 @@
         name, node, ElementKind.FUNCTION, Modifiers.EMPTY,
         enclosingElement);
     ResolverTask.processAsyncMarker(compiler, function, registry);
-    function.functionSignatureCache = SignatureResolver.analyze(
+    function.functionSignature = SignatureResolver.analyze(
         compiler,
         node.parameters,
         node.returnType,
@@ -574,148 +651,6 @@
     return const NoneResult();
   }
 
-  ResolutionResult resolveSend(Send node) {
-    Selector selector = resolveSelector(node, null);
-    if (node.isSuperCall) registry.registerSuperUse(node);
-
-    if (node.receiver == null) {
-      // If this send is of the form "assert(expr);", then
-      // this is an assertion.
-      if (selector.isAssert) {
-        internalError(node, "Unexpected assert: $node");
-      }
-
-      return node.selector.accept(this);
-    }
-
-    var oldCategory = allowedCategory;
-    allowedCategory |= ElementCategory.PREFIX | ElementCategory.SUPER;
-
-    bool oldSendIsMemberAccess = sendIsMemberAccess;
-    int oldAllowedCategory = allowedCategory;
-
-    // Conditional sends like `e?.foo` treat the receiver as an expression.  So
-    // `C?.foo` needs to be treated like `(C).foo`, not like C.foo. Prefixes and
-    // super are not allowed on their own in that context.
-    if (node.isConditional) {
-      sendIsMemberAccess = false;
-      allowedCategory =
-          ElementCategory.VARIABLE |
-          ElementCategory.FUNCTION |
-          ElementCategory.IMPLIES_TYPE;
-    }
-    ResolutionResult resolvedReceiver = visit(node.receiver);
-    if (node.isConditional) {
-      sendIsMemberAccess = oldSendIsMemberAccess;
-      allowedCategory = oldAllowedCategory;
-    }
-
-    allowedCategory = oldCategory;
-
-    Element target;
-    String name = node.selector.asIdentifier().source;
-    if (identical(name, 'this')) {
-      error(node.selector, MessageKind.THIS_PROPERTY);
-      return const NoneResult();
-    } else if (node.isSuperCall) {
-      if (node.isOperator) {
-        if (isUserDefinableOperator(name)) {
-          name = selector.name;
-        } else {
-          error(node.selector, MessageKind.ILLEGAL_SUPER_SEND, {'name': name});
-          return const NoneResult();
-        }
-      }
-      if (!inInstanceContext) {
-        error(node.receiver, MessageKind.NO_INSTANCE_AVAILABLE, {'name': name});
-        return const NoneResult();
-      }
-      if (currentClass.supertype == null) {
-        // This is just to guard against internal errors, so no need
-        // for a real error message.
-        error(node.receiver, MessageKind.GENERIC,
-              {'text': "Object has no superclass"});
-        return const NoneResult();
-      }
-      // TODO(johnniwinther): Ensure correct behavior if currentClass is a
-      // patch.
-      target = currentClass.lookupSuperByName(selector.memberName);
-      // [target] may be null which means invoking noSuchMethod on
-      // super.
-      if (target == null) {
-        target = reportAndCreateErroneousElement(
-            node, name, MessageKind.NO_SUCH_SUPER_MEMBER,
-            {'className': currentClass.name, 'memberName': name});
-        // We still need to register the invocation, because we might
-        // call [:super.noSuchMethod:] which calls
-        // [JSInvocationMirror._invokeOn].
-        registry.registerDynamicInvocation(
-            new UniverseSelector(selector, null));
-        registry.registerSuperNoSuchMethod();
-      }
-    } else if (Elements.isUnresolved(resolvedReceiver.element)) {
-      return const NoneResult();
-    } else if (resolvedReceiver.element.isClass) {
-      ClassElement receiverClass = resolvedReceiver.element;
-      receiverClass.ensureResolved(compiler);
-      if (node.isOperator) {
-        // When the resolved receiver is a class, we can have two cases:
-        //  1) a static send: C.foo, or
-        //  2) an operator send, where the receiver is a class literal: 'C + 1'.
-        // The following code that looks up the selector on the resolved
-        // receiver will treat the second as the invocation of a static operator
-        // if the resolved receiver is not null.
-        return const NoneResult();
-      }
-      MembersCreator.computeClassMembersByName(
-          compiler, receiverClass.declaration, name);
-      target = receiverClass.lookupLocalMember(name);
-      if (target == null || target.isInstanceMember) {
-        registry.registerThrowNoSuchMethod();
-        // TODO(johnniwinther): With the simplified [TreeElements] invariant,
-        // try to resolve injected elements if [currentClass] is in the patch
-        // library of [receiverClass].
-
-        // TODO(karlklose): this should be reported by the caller of
-        // [resolveSend] to select better warning messages for getters and
-        // setters.
-        MessageKind kind = (target == null)
-            ? MessageKind.MEMBER_NOT_FOUND
-            : MessageKind.MEMBER_NOT_STATIC;
-        return new ElementResult(reportAndCreateErroneousElement(
-            node, name, kind,
-            {'className': receiverClass.name, 'memberName': name}));
-      } else if (isPrivateName(name) &&
-                 target.library != enclosingElement.library) {
-        registry.registerThrowNoSuchMethod();
-        return new ElementResult(reportAndCreateErroneousElement(
-            node, name, MessageKind.PRIVATE_ACCESS,
-            {'libraryName': target.library.getLibraryOrScriptName(),
-             'name': name}));
-      }
-    } else if (resolvedReceiver.element.isPrefix) {
-      PrefixElement prefix = resolvedReceiver.element;
-      target = prefix.lookupLocalMember(name);
-      if (Elements.isUnresolved(target)) {
-        registry.registerThrowNoSuchMethod();
-        return new ElementResult(reportAndCreateErroneousElement(
-            node, name, MessageKind.NO_SUCH_LIBRARY_MEMBER,
-            {'libraryName': prefix.name, 'memberName': name}));
-      } else if (target.isAmbiguous) {
-        registry.registerThrowNoSuchMethod();
-        AmbiguousElement ambiguous = target;
-        target = reportAndCreateErroneousElement(
-            node, name, ambiguous.messageKind, ambiguous.messageArguments);
-        ambiguous.diagnose(enclosingElement, compiler);
-        return new ElementResult(target);
-      } else if (target.kind == ElementKind.CLASS) {
-        ClassElement classElement = target;
-        classElement.ensureResolved(compiler);
-      }
-    }
-    return new ResolutionResult.forElement(target);
-  }
-
   static Selector computeSendSelector(Send node,
                                       LibraryElement library,
                                       Element element) {
@@ -743,7 +678,8 @@
       if (op == null) {
         // Unsupported operator. An error has been reported during parsing.
         return new Selector.call(
-            source, library, node.argumentsNode.slowLength(), []);
+            new Name(source, library),
+            new CallStructure.unnamed(node.argumentsNode.slowLength()));
       }
       return node.arguments.isEmpty
           ? new Selector.unaryOperator(op)
@@ -753,9 +689,11 @@
     Identifier identifier = node.selector.asIdentifier();
     if (node.isPropertyAccess) {
       assert(!isSet);
-      return new Selector.getter(identifier.source, library);
+      return new Selector.getter(
+          new Name(identifier.source, library));
     } else if (isSet) {
-      return new Selector.setter(identifier.source, library);
+      return new Selector.setter(
+          new Name(identifier.source, library, isSetter: true));
     }
 
     // Compute the arity and the list of named arguments.
@@ -774,13 +712,14 @@
 
     if (element != null && element.isConstructor) {
       return new Selector.callConstructor(
-          element.name, library, arity, named);
+          new Name(element.name, library), arity, named);
     }
 
     // If we're invoking a closure, we do not have an identifier.
     return (identifier == null)
         ? new Selector.callClosure(arity, named)
-        : new Selector.call(identifier.source, library, arity, named);
+        : new Selector.call(new Name(identifier.source, library),
+                            new CallStructure(arity, named));
   }
 
   Selector resolveSelector(Send node, Element element) {
@@ -821,7 +760,8 @@
           seenNamedArguments[source] = namedArgument;
         }
       } else if (!seenNamedArguments.isEmpty) {
-        error(argument, MessageKind.INVALID_ARGUMENT_AFTER_NAMED);
+        reporter.reportErrorMessage(
+            argument, MessageKind.INVALID_ARGUMENT_AFTER_NAMED);
         isValidAsConstant = false;
       }
       argumentCount++;
@@ -833,86 +773,53 @@
         isValidAsConstant: isValidAsConstant);
   }
 
-  void registerTypeLiteralAccess(Send node, Element target) {
-    // Set the type of the node to [Type] to mark this send as a
-    // type literal.
-    DartType type;
-
-    // TODO(johnniwinther): Remove this hack when we can pass more complex
-    // information between methods than resolved elements.
-    if (target == compiler.typeClass && node.receiver == null) {
-      // Potentially a 'dynamic' type literal.
-      type = registry.getType(node.selector);
-    }
-    if (type == null) {
-      if (target.isTypedef || target.isClass) {
-        TypeDeclarationElement typeDeclaration = target;
-        typeDeclaration.computeType(compiler);
-        type = typeDeclaration.rawType;
-      } else {
-        TypeVariableElement typeVariable = target;
-        type = typeVariable.type;
-      }
-    }
-    registry.registerTypeLiteral(node, type);
-
-    if (!target.isTypeVariable) {
-      // Don't try to make constants of calls and assignments to type literals.
-      if (!node.isCall && node.asSendSet() == null) {
-        analyzeConstantDeferred(node, enforceConst: false);
-      } else {
-        // The node itself is not a constant but we register the selector (the
-        // identifier that refers to the class/typedef) as a constant.
-        if (node.receiver != null) {
-          // This is a hack for the case of prefix.Type, we need to store
-          // the element on the selector, so [analyzeConstant] can build
-          // the type literal from the selector.
-          registry.useElement(node.selector, target);
-        }
-        analyzeConstantDeferred(node.selector, enforceConst: false);
-      }
-    }
-  }
-
   /// Check that access to `super` is currently allowed. Returns an
   /// [AccessSemantics] in case of an error, `null` otherwise.
   AccessSemantics checkSuperAccess(Send node) {
     if (!inInstanceContext) {
-      return new StaticAccess.invalid(
-          reportAndCreateErroneousElement(
-              node, 'super',
-              MessageKind.NO_SUPER_IN_STATIC, {},
-              isError: true));
+      ErroneousElement error = reportAndCreateErroneousElement(
+          node, 'super',
+          MessageKind.NO_SUPER_IN_STATIC, {},
+          isError: true);
+      registry.registerCompileTimeError(error);
+      return new StaticAccess.invalid(error);
     }
     if (node.isConditional) {
       // `super?.foo` is not allowed.
-      return new StaticAccess.invalid(
-          reportAndCreateErroneousElement(
-              node, 'super',
-              MessageKind.INVALID_USE_OF_SUPER, {},
-              isError: true));
+      ErroneousElement error = reportAndCreateErroneousElement(
+          node, 'super',
+          MessageKind.INVALID_USE_OF_SUPER, {},
+          isError: true);
+      registry.registerCompileTimeError(error);
+      return new StaticAccess.invalid(error);
     }
     if (currentClass.supertype == null) {
       // This is just to guard against internal errors, so no need
       // for a real error message.
-      return new StaticAccess.invalid(
-          reportAndCreateErroneousElement(
-              node, 'super',
-              MessageKind.GENERIC,
-              {'text': "Object has no superclass"},
-              isError: true));
+      ErroneousElement error = reportAndCreateErroneousElement(
+          node, 'super',
+          MessageKind.GENERIC,
+          {'text': "Object has no superclass"},
+          isError: true);
+      registry.registerCompileTimeError(error);
+      return new StaticAccess.invalid(error);
     }
     registry.registerSuperUse(node);
     return null;
   }
 
-  /// Check that access to `this` is currently allowed.
-  bool checkThisAccess(Send node) {
+  /// Check that access to `this` is currently allowed. Returns an
+  /// [AccessSemantics] in case of an error, `null` otherwise.
+  AccessSemantics checkThisAccess(Send node) {
     if (!inInstanceContext) {
-      compiler.reportError(node, MessageKind.NO_THIS_AVAILABLE);
-      return false;
+      ErroneousElement error = reportAndCreateErroneousElement(
+          node, 'this',
+          MessageKind.NO_THIS_AVAILABLE, const {},
+          isError: true);
+      registry.registerCompileTimeError(error);
+      return new StaticAccess.invalid(error);
     }
-    return true;
+    return null;
   }
 
   /// Compute the [AccessSemantics] corresponding to a super access of [target].
@@ -941,7 +848,8 @@
   AccessSemantics computeCompoundSuperAccessSemantics(
       Spannable node,
       Element getter,
-      Element setter) {
+      Element setter,
+      {bool isIndex: false}) {
     if (getter.isErroneous) {
       if (setter.isErroneous) {
         return new StaticAccess.unresolvedSuper(getter);
@@ -957,7 +865,11 @@
             CompoundAccessKind.UNRESOLVED_SUPER_GETTER, getter, setter);
       }
     } else if (getter.isField) {
-      if (setter.isField) {
+      if (setter.isErroneous) {
+        assert(invariant(node, getter.isFinal,
+            message: "Unexpected super setter '$setter' for getter '$getter."));
+        return new StaticAccess.superFinalField(getter);
+      } else if (setter.isField) {
         if (getter == setter) {
           return new StaticAccess.superField(getter);
         } else {
@@ -990,13 +902,17 @@
       assert(invariant(node, getter.isFunction,
           message: "Unexpected super getter '$getter'."));
       if (setter.isErroneous) {
-        return new CompoundAccessSemantics(
-            CompoundAccessKind.UNRESOLVED_SUPER_SETTER, getter, setter);
+        if (isIndex) {
+          return new CompoundAccessSemantics(
+              CompoundAccessKind.UNRESOLVED_SUPER_SETTER, getter, setter);
+        } else {
+          return new StaticAccess.superMethod(getter);
+        }
       } else if (setter.isFunction) {
-        assert(invariant(node, getter.name == '[]',
-            message: "Unexpected super getter '$getter'."));
         assert(invariant(node, setter.name == '[]=',
             message: "Unexpected super setter '$setter'."));
+        assert(invariant(node, getter.name == '[]',
+            message: "Unexpected super getter '$getter'."));
         return new CompoundAccessSemantics(
                     CompoundAccessKind.SUPER_GETTER_SETTER, getter, setter);
       } else {
@@ -1107,12 +1023,19 @@
     Element target = currentClass.lookupSuperByName(name);
     // [target] may be null which means invoking noSuchMethod on super.
     if (target == null) {
-      Element error = reportAndCreateErroneousElement(
-          node, name.text, MessageKind.NO_SUCH_SUPER_MEMBER,
-          {'className': currentClass.name, 'memberName': name});
       if (alternateName != null) {
         target = currentClass.lookupSuperByName(alternateName);
       }
+      Element error;
+      if (selector.isSetter) {
+        error = reportAndCreateErroneousElement(
+          node, name.text, MessageKind.SETTER_NOT_FOUND_IN_SUPER,
+          {'className': currentClass.name, 'name': name});
+      } else {
+        error = reportAndCreateErroneousElement(
+          node, name.text, MessageKind.NO_SUCH_SUPER_MEMBER,
+          {'className': currentClass.name, 'memberName': name});
+      }
       if (target == null) {
         // If a setter wasn't resolved, use the [ErroneousElement].
         target = error;
@@ -1143,7 +1066,11 @@
   ///
   AccessSemantics computeSuperAccessSemanticsForSelectors(
       Spannable node,
-      Selector getterSelector, Selector setterSelector) {
+      Selector getterSelector,
+      Selector setterSelector,
+      {bool isIndex: false}) {
+    bool getterError = false;
+    bool setterError = false;
 
     // TODO(johnniwinther): Ensure correct behavior if currentClass is a
     // patch.
@@ -1153,11 +1080,7 @@
       getter = reportAndCreateErroneousElement(
           node, getterSelector.name, MessageKind.NO_SUCH_SUPER_MEMBER,
           {'className': currentClass.name, 'memberName': getterSelector.name});
-      // We still need to register the invocation, because we might
-      // call `super.noSuchMethod` which calls [JSInvocationMirror._invokeOn].
-      registry.registerDynamicInvocation(
-          new UniverseSelector(getterSelector, null));
-      registry.registerSuperNoSuchMethod();
+      getterError = true;
     }
     Element setter = currentClass.lookupSuperByName(setterSelector.memberName);
     // [target] may be null which means invoking noSuchMethod on super.
@@ -1165,13 +1088,41 @@
       setter = reportAndCreateErroneousElement(
           node, setterSelector.name, MessageKind.NO_SUCH_SUPER_MEMBER,
           {'className': currentClass.name, 'memberName': setterSelector.name});
+      setterError = true;
+    } else if (getter == setter) {
+      if (setter.isFunction) {
+        setter = reportAndCreateErroneousElement(
+            node, setterSelector.name,
+            MessageKind.ASSIGNING_METHOD_IN_SUPER,
+            {'superclassName': setter.enclosingClass.name,
+             'name': setterSelector.name});
+        setterError = true;
+      } else if (setter.isField && setter.isFinal) {
+        setter = reportAndCreateErroneousElement(
+            node, setterSelector.name,
+            MessageKind.ASSIGNING_FINAL_FIELD_IN_SUPER,
+            {'superclassName': setter.enclosingClass.name,
+             'name': setterSelector.name});
+        setterError = true;
+      }
+    }
+    if (getterError) {
       // We still need to register the invocation, because we might
-      // call `super.noSuchMethod` which calls [JSInvocationMirror._invokeOn].
+      // call [:super.noSuchMethod:] which calls [JSInvocationMirror._invokeOn].
+      registry.registerDynamicInvocation(
+          new UniverseSelector(getterSelector, null));
+    }
+    if (setterError) {
+      // We still need to register the invocation, because we might
+      // call [:super.noSuchMethod:] which calls [JSInvocationMirror._invokeOn].
       registry.registerDynamicInvocation(
           new UniverseSelector(setterSelector, null));
+    }
+    if (getterError || setterError) {
       registry.registerSuperNoSuchMethod();
     }
-    return computeCompoundSuperAccessSemantics(node, getter, setter);
+    return computeCompoundSuperAccessSemantics(
+        node, getter, setter, isIndex: isIndex);
   }
 
   /// Resolve [node] as a subexpression that is _not_ the prefix of a member
@@ -1197,26 +1148,6 @@
     return result;
   }
 
-  /// Resolved [node] as a subexpression that is the prefix of a conditional
-  /// access. For instance `a` in `a?.b`.
-  // TODO(johnniwinther): Is this equivalent to [visitExpression]?
-  ResolutionResult visitConditionalPrefix(Node node) {
-    // Conditional sends like `e?.foo` treat the receiver as an expression.  So
-    // `C?.foo` needs to be treated like `(C).foo`, not like C.foo. Prefixes and
-    // super are not allowed on their own in that context.
-    int oldAllowedCategory = allowedCategory;
-    bool oldSendIsMemberAccess = sendIsMemberAccess;
-    sendIsMemberAccess = false;
-    allowedCategory =
-        ElementCategory.VARIABLE |
-        ElementCategory.FUNCTION |
-        ElementCategory.IMPLIES_TYPE;
-    ResolutionResult result = visit(node);
-    sendIsMemberAccess = oldSendIsMemberAccess;
-    allowedCategory = oldAllowedCategory;
-    return result;
-  }
-
   /// Handle a type test expression, like `a is T` and `a is! T`.
   ResolutionResult handleIs(Send node) {
     Node expression = node.receiver;
@@ -1251,7 +1182,7 @@
 
     Node typeNode = node.arguments.head;
     DartType type = resolveTypeAnnotation(typeNode);
-    registry.registerAsCheck(type);
+    registry.registerAsCast(type);
     registry.registerSendStructure(node, new AsStructure(type));
     return const NoneResult();
   }
@@ -1276,7 +1207,7 @@
     ResolutionResult result = const NoneResult();
     Node expression = node.receiver;
     Selector selector = operator.selector;
-    // TODO(johnniwinther): Remove this when all information goes through the
+    // TODO(23998): Remove this when all information goes through the
     // [SendStructure].
     registry.setSelector(node, selector);
 
@@ -1290,13 +1221,13 @@
         if (semantics.kind == AccessKind.SUPER_METHOD) {
           registry.registerStaticUse(semantics.element.declaration);
         }
-        // TODO(johnniwinther): Remove this when all information goes through
+        // TODO(23998): Remove this when all information goes through
         // the [SendStructure].
         registry.useElement(node, semantics.element);
       }
     } else {
       ResolutionResult expressionResult = visitExpression(expression);
-      semantics = new DynamicAccess.dynamicProperty(expression);
+      semantics = const DynamicAccess.expression();
       registry.registerDynamicInvocation(new UniverseSelector(selector, null));
 
       if (expressionResult.isConstant) {
@@ -1315,7 +1246,7 @@
                 knownExpressionType == coreTypes.doubleType;
             break;
           case UnaryOperatorKind.NOT:
-            internalError(node,
+            reporter.internalError(node,
                 "Unexpected user definable unary operator: $operator");
         }
         if (isValidConstant) {
@@ -1341,8 +1272,7 @@
 
     Node expression = node.receiver;
     ResolutionResult result = visitExpression(expression);
-    registry.registerSendStructure(node,
-        new NotStructure(new DynamicAccess.dynamicProperty(expression)));
+    registry.registerSendStructure(node, const NotStructure());
 
     if (result.isConstant) {
       ConstantExpression expressionConstant = result.constant;
@@ -1450,7 +1380,7 @@
     } else {
       selector = new Selector.binaryOperator(operator.selectorName);
     }
-    // TODO(johnniwinther): Remove this when all information goes through the
+    // TODO(23998): Remove this when all information goes through the
     // [SendStructure].
     registry.setSelector(node, selector);
 
@@ -1463,7 +1393,7 @@
         if (semantics.kind == AccessKind.SUPER_METHOD) {
           registry.registerStaticUse(semantics.element.declaration);
         }
-        // TODO(johnniwinther): Remove this when all information goes through
+        // TODO(23998): Remove this when all information goes through
         // the [SendStructure].
         registry.useElement(node, semantics.element);
       }
@@ -1472,7 +1402,7 @@
       ResolutionResult leftResult = visitExpression(left);
       ResolutionResult rightResult = visitExpression(right);
       registry.registerDynamicInvocation(new UniverseSelector(selector, null));
-      semantics = new DynamicAccess.dynamicProperty(left);
+      semantics = const DynamicAccess.expression();
 
       if (leftResult.isConstant && rightResult.isConstant) {
         bool isValidConstant;
@@ -1534,7 +1464,8 @@
           case BinaryOperatorKind.LOGICAL_AND:
           case BinaryOperatorKind.LOGICAL_OR:
           case BinaryOperatorKind.IF_NULL:
-            internalError(node, "Unexpected binary operator '${operator}'.");
+            reporter.internalError(
+                node, "Unexpected binary operator '${operator}'.");
             break;
         }
         if (isValidConstant) {
@@ -1584,7 +1515,8 @@
         case BinaryOperatorKind.LOGICAL_AND:
         case BinaryOperatorKind.LOGICAL_OR:
         case BinaryOperatorKind.IF_NULL:
-          internalError(node, "Unexpected binary operator '${operator}'.");
+          reporter.internalError(
+              node, "Unexpected binary operator '${operator}'.");
           break;
       }
       registry.registerSendStructure(node, sendStructure);
@@ -1601,72 +1533,55 @@
     CallStructure callStructure =
         resolveArguments(node.argumentsNode).callStructure;
     Selector selector = callStructure.callSelector;
-    // TODO(johnniwinther): Remove this when all information goes through the
+    // TODO(23998): Remove this when all information goes through the
     // [SendStructure].
     registry.setSelector(node, selector);
     registry.registerDynamicInvocation(new UniverseSelector(selector, null));
     registry.registerSendStructure(node,
-        new InvokeStructure(new AccessSemantics.expression(), selector));
+        new InvokeStructure(const DynamicAccess.expression(), selector));
     return const NoneResult();
   }
 
-  /// Handle a, possibly invalid, assertion, like `assert(cond)` or `assert()`.
-  ResolutionResult handleAssert(Send node) {
-    assert(invariant(node, node.isCall,
-        message: "Unexpected assert: $node"));
-    // If this send is of the form "assert(expr);", then
-    // this is an assertion.
-
-    CallStructure callStructure =
-        resolveArguments(node.argumentsNode).callStructure;
-    SendStructure sendStructure = const AssertStructure();
-    if (callStructure.argumentCount != 1) {
-      compiler.reportError(
-          node.selector,
-          MessageKind.WRONG_NUMBER_OF_ARGUMENTS_FOR_ASSERT,
-          {'argumentCount': callStructure.argumentCount});
-      sendStructure = const InvalidAssertStructure();
-    } else if (callStructure.namedArgumentCount != 0) {
-      compiler.reportError(
-          node.selector,
-          MessageKind.ASSERT_IS_GIVEN_NAMED_ARGUMENTS,
-          {'argumentCount': callStructure.namedArgumentCount});
-      sendStructure = const InvalidAssertStructure();
-    }
-    registry.registerAssert(node);
-    registry.registerSendStructure(node, sendStructure);
-    return const AssertResult();
-  }
-
   /// Handle access of a property of [name] on `this`, like `this.name` and
   /// `this.name()`, or `name` and `name()` in instance context.
   ResolutionResult handleThisPropertyAccess(Send node, Name name) {
-    AccessSemantics semantics = new AccessSemantics.thisProperty();
+    AccessSemantics semantics = new DynamicAccess.thisProperty(name);
     return handleDynamicAccessSemantics(node, name, semantics);
   }
 
+  /// Handle update of a property of [name] on `this`, like `this.name = b` and
+  /// `this.name++`, or `name = b` and `name++` in instance context.
+  ResolutionResult handleThisPropertyUpdate(
+      SendSet node, Name name, Element element) {
+    AccessSemantics semantics = new DynamicAccess.thisProperty(name);
+    return handleDynamicUpdateSemantics(node, name, element, semantics);
+  }
+
   /// Handle access on `this`, like `this()` and `this` when it is parsed as a
   /// [Send] node.
   ResolutionResult handleThisAccess(Send node) {
-    AccessSemantics accessSemantics = new AccessSemantics.thisAccess();
     if (node.isCall) {
       CallStructure callStructure =
           resolveArguments(node.argumentsNode).callStructure;
       Selector selector = callStructure.callSelector;
       // TODO(johnniwinther): Handle invalid this access as an
       // [AccessSemantics].
-      if (checkThisAccess(node)) {
+      AccessSemantics accessSemantics = checkThisAccess(node);
+      if (accessSemantics == null) {
+        accessSemantics = const DynamicAccess.thisAccess();
         registry.registerDynamicInvocation(
             new UniverseSelector(selector, null));
-        registry.registerSendStructure(node,
-            new InvokeStructure(accessSemantics, selector));
       }
-      // TODO(johnniwinther): Remove this when all information goes through
+      registry.registerSendStructure(node,
+          new InvokeStructure(accessSemantics, selector));
+      // TODO(23998): Remove this when all information goes through
       // the [SendStructure].
       registry.setSelector(node, selector);
+      return const NoneResult();
     } else {
       // TODO(johnniwinther): Handle get of `this` when it is a [Send] node.
-      internalError(node, "Unexpected node '$node'.");
+      reporter.internalError(
+          node, "Unexpected node '$node'.");
     }
     return const NoneResult();
   }
@@ -1675,13 +1590,12 @@
   ResolutionResult handleSuperPropertyAccess(Send node, Name name) {
     Element target;
     Selector selector;
-    CallStructure callStructure = CallStructure.NO_ARGS;
+    CallStructure callStructure;
     if (node.isCall) {
-      callStructure =
-          resolveArguments(node.argumentsNode).callStructure;
-      selector = new Selector(SelectorKind.CALL, name, callStructure);
+      callStructure = resolveArguments(node.argumentsNode).callStructure;
+      selector = new Selector.call(name, callStructure);
     } else {
-      selector = new Selector(SelectorKind.GETTER, name, callStructure);
+      selector = new Selector.getter(name);
     }
     AccessSemantics semantics = checkSuperAccess(node);
     if (semantics == null) {
@@ -1693,7 +1607,7 @@
       switch (semantics.kind) {
         case AccessKind.SUPER_METHOD:
           MethodElementX superMethod = semantics.element;
-          superMethod.computeSignature(compiler);
+          superMethod.computeType(resolution);
           if (!callStructure.signatureApplies(
                   superMethod.functionSignature)) {
             registry.registerThrowNoSuchMethod();
@@ -1721,7 +1635,8 @@
           // 'super' is not allowed.
           break;
         default:
-          internalError(node, "Unexpected super property access $semantics.");
+          reporter.internalError(
+              node, "Unexpected super property access $semantics.");
           break;
       }
       registry.registerSendStructure(node,
@@ -1748,15 +1663,15 @@
           // 'super' is not allowed.
           break;
         default:
-          internalError(node, "Unexpected super property access $semantics.");
+          reporter.internalError(
+              node, "Unexpected super property access $semantics.");
           break;
       }
-      registry.registerSendStructure(node,
-          new GetStructure(semantics, selector));
+      registry.registerSendStructure(node, new GetStructure(semantics));
     }
     target = semantics.element;
 
-    // TODO(johnniwinther): Remove these when all information goes through
+    // TODO(23998): Remove these when all information goes through
     // the [SendStructure].
     registry.useElement(node, target);
     registry.setSelector(node, selector);
@@ -1845,7 +1760,30 @@
     // TODO(johnniwinther): Add an [AccessSemantics] for unresolved static
     // member access.
     return handleErroneousAccess(
-        node, name, error, new StaticAccess.unresolved(error));
+        node, name, new StaticAccess.unresolved(error));
+  }
+
+  /// Handle qualified update to an unresolved static class member, like
+  /// `a.b = c` or `a.b++` where `a` is a class and `b` is unresolved.
+  ResolutionResult handleUnresolvedStaticMemberUpdate(
+      SendSet node, Name name, ClassElement receiverClass) {
+    // TODO(johnniwinther): Share code with [handleStaticInstanceMemberUpdate]
+    // and [handlePrivateStaticMemberUpdate].
+    registry.registerThrowNoSuchMethod();
+    // TODO(johnniwinther): Produce a different error if [name] is resolves to
+    // a constructor.
+
+    // TODO(johnniwinther): With the simplified [TreeElements] invariant,
+    // try to resolve injected elements if [currentClass] is in the patch
+    // library of [receiverClass].
+
+    // TODO(johnniwinther): Produce a different error for complex update.
+    ErroneousElement error = reportAndCreateErroneousElement(
+        node, name.text, MessageKind.MEMBER_NOT_FOUND,
+        {'className': receiverClass.name, 'memberName': name.text});
+    // TODO(johnniwinther): Add an [AccessSemantics] for unresolved static
+    // member access.
+    return handleUpdate(node, name, new StaticAccess.unresolved(error));
   }
 
   /// Handle qualified access of an instance member, like `a.b` or `a.b()` where
@@ -1868,23 +1806,58 @@
     // TODO(johnniwinther): Add an [AccessSemantics] for statically accessed
     // instance members.
     return handleErroneousAccess(
-        node, name, error, new StaticAccess.unresolved(error));
+        node, name, new StaticAccess.unresolved(error));
+  }
+
+  /// Handle qualified update of an instance member, like `a.b = c` or `a.b++`
+  /// where `a` is a class and `b` is a non-static member.
+  ResolutionResult handleStaticInstanceMemberUpdate(
+      SendSet node, Name name, ClassElement receiverClass, Element member) {
+
+    registry.registerThrowNoSuchMethod();
+    // TODO(johnniwinther): With the simplified [TreeElements] invariant,
+    // try to resolve injected elements if [currentClass] is in the patch
+    // library of [receiverClass].
+
+    // TODO(johnniwinther): Produce a different error for complex update.
+    ErroneousElement error = reportAndCreateErroneousElement(
+        node, name.text, MessageKind.MEMBER_NOT_STATIC,
+        {'className': receiverClass.name, 'memberName': name});
+
+    // TODO(johnniwinther): Add an [AccessSemantics] for statically accessed
+    // instance members.
+    return handleUpdate(node, name, new StaticAccess.unresolved(error));
   }
 
   /// Handle qualified access of an inaccessible private static class member,
-  /// like `a._b` or `a.b()` where `a` is class, `_b` is static member of `a`
+  /// like `a._b` or `a._b()` where `a` is class, `_b` is static member of `a`
   /// but `a` is not defined in the current library.
   ResolutionResult handlePrivateStaticMemberAccess(
       Send node, Name name, ClassElement receiverClass, Element member) {
     registry.registerThrowNoSuchMethod();
     ErroneousElement error = reportAndCreateErroneousElement(
         node, name.text, MessageKind.PRIVATE_ACCESS,
-        {'libraryName': member.library.getLibraryOrScriptName(),
+        {'libraryName': member.library.libraryOrScriptName,
          'name': name});
     // TODO(johnniwinther): Add an [AccessSemantics] for unresolved static
     // member access.
     return handleErroneousAccess(
-        node, name, error, new StaticAccess.unresolved(error));
+        node, name, new StaticAccess.unresolved(error));
+  }
+
+  /// Handle qualified update of an inaccessible private static class member,
+  /// like `a._b = c` or `a._b++` where `a` is class, `_b` is static member of
+  /// `a` but `a` is not defined in the current library.
+  ResolutionResult handlePrivateStaticMemberUpdate(
+      SendSet node, Name name, ClassElement receiverClass, Element member) {
+    registry.registerThrowNoSuchMethod();
+    ErroneousElement error = reportAndCreateErroneousElement(
+        node, name.text, MessageKind.PRIVATE_ACCESS,
+        {'libraryName': member.library.libraryOrScriptName,
+         'name': name});
+    // TODO(johnniwinther): Add an [AccessSemantics] for unresolved static
+    // member access.
+    return handleUpdate(node, name, new StaticAccess.unresolved(error));
   }
 
   /// Handle qualified access to a static member, like `a.b` or `a.b()` where
@@ -1892,7 +1865,7 @@
   ResolutionResult handleStaticMemberAccess(
       Send node, Name memberName, ClassElement receiverClass) {
     String name = memberName.text;
-    receiverClass.ensureResolved(compiler);
+    receiverClass.ensureResolved(resolution);
     if (node.isOperator) {
       // When the resolved receiver is a class, we can have two cases:
       //  1) a static send: C.foo, or
@@ -1921,6 +1894,31 @@
     }
   }
 
+  /// Handle qualified update to a static member, like `a.b = c` or `a.b++`
+  /// where `a` is a class and `b` is a static member of `a`.
+  ResolutionResult handleStaticMemberUpdate(
+      Send node, Name memberName, ClassElement receiverClass) {
+    String name = memberName.text;
+    receiverClass.ensureResolved(resolution);
+    MembersCreator.computeClassMembersByName(
+        compiler, receiverClass.declaration, name);
+    Element member = receiverClass.lookupLocalMember(name);
+    if (member == null) {
+      return handleUnresolvedStaticMemberUpdate(
+          node, memberName, receiverClass);
+    } else if (member.isAmbiguous) {
+      return handleAmbiguousUpdate(node, memberName, member);
+    } else if (member.isInstanceMember) {
+      return handleStaticInstanceMemberUpdate(
+          node, memberName, receiverClass, member);
+    } else if (memberName.isPrivate && memberName.library != member.library) {
+      return handlePrivateStaticMemberUpdate(
+          node, memberName, receiverClass, member);
+    } else {
+      return handleStaticOrTopLevelUpdate(node, memberName, member);
+    }
+  }
+
   /// Handle access to a type literal of type variable [element]. Like `T` or
   /// `T()` where 'T' is type variable.
   // TODO(johnniwinther): Remove [name] when [Selector] is not required for the
@@ -1931,17 +1929,22 @@
       Send node,
       Name name,
       TypeVariableElement element) {
+    AccessSemantics semantics;
     if (!Elements.hasAccessToTypeVariables(enclosingElement)) {
-      compiler.reportError(node,
-          MessageKind.TYPE_VARIABLE_WITHIN_STATIC_MEMBER,
-          {'typeVariableName': node.selector});
       // TODO(johnniwinther): Add another access semantics for this.
+      ErroneousElement error = reportAndCreateErroneousElement(
+          node, name.text,
+          MessageKind.TYPE_VARIABLE_WITHIN_STATIC_MEMBER,
+          {'typeVariableName': name},
+          isError: true);
+      registry.registerCompileTimeError(error);
+      semantics = new StaticAccess.invalid(error);
+      // TODO(johnniwinther): Clean up registration of elements and selectors
+      // for this case.
+    } else {
+      semantics = new StaticAccess.typeParameterTypeLiteral(element);
     }
-    registry.registerClassUsingVariableExpression(element.enclosingClass);
-    registry.registerTypeVariableExpression();
 
-    AccessSemantics semantics =
-        new StaticAccess.typeParameterTypeLiteral(element);
     registry.useElement(node, element);
     registry.registerTypeLiteral(node, element.type);
 
@@ -1949,7 +1952,7 @@
       CallStructure callStructure =
           resolveArguments(node.argumentsNode).callStructure;
       Selector selector = callStructure.callSelector;
-      // TODO(johnniwinther): Remove this when all information goes through
+      // TODO(23998): Remove this when all information goes through
       // the [SendStructure].
       registry.setSelector(node, selector);
 
@@ -1957,13 +1960,53 @@
           new InvokeStructure(semantics, selector));
     } else {
       // TODO(johnniwinther): Avoid the need for a [Selector] here.
-      registry.registerSendStructure(node,
-          new GetStructure(semantics,
-              new Selector(SelectorKind.GETTER, name, CallStructure.NO_ARGS)));
+      registry.registerSendStructure(node, new GetStructure(semantics));
     }
     return const NoneResult();
   }
 
+  /// Handle access to a type literal of type variable [element]. Like `T = b`,
+  /// `T++` or `T += b` where 'T' is type variable.
+  ResolutionResult handleTypeVariableTypeLiteralUpdate(
+      SendSet node,
+      Name name,
+      TypeVariableElement element) {
+    AccessSemantics semantics;
+    if (!Elements.hasAccessToTypeVariables(enclosingElement)) {
+      // TODO(johnniwinther): Add another access semantics for this.
+      ErroneousElement error = reportAndCreateErroneousElement(
+          node, name.text,
+          MessageKind.TYPE_VARIABLE_WITHIN_STATIC_MEMBER,
+          {'typeVariableName': name},
+          isError: true);
+      registry.registerCompileTimeError(error);
+      semantics = new StaticAccess.invalid(error);
+    } else {
+      ErroneousElement error;
+      if (node.isIfNullAssignment) {
+        error = reportAndCreateErroneousElement(
+            node.selector, name.text,
+            MessageKind.IF_NULL_ASSIGNING_TYPE, const {});
+        // TODO(23998): Remove these when all information goes through
+        // the [SendStructure].
+        registry.useElement(node.selector, element);
+      } else {
+        error = reportAndCreateErroneousElement(
+            node.selector, name.text,
+            MessageKind.ASSIGNING_TYPE, const {});
+      }
+
+      // TODO(23998): Remove this when all information goes through
+      // the [SendStructure].
+      registry.useElement(node, error);
+      // TODO(johnniwinther): Register only on read?
+      registry.registerTypeLiteral(node, element.type);
+      registry.registerThrowNoSuchMethod();
+      semantics = new StaticAccess.typeParameterTypeLiteral(element);
+    }
+    return handleUpdate(node, name, semantics);
+  }
+
   /// Handle access to a constant type literal of [type].
   // TODO(johnniwinther): Remove [name] when [Selector] is not required for the
   // the [GetStructure].
@@ -1982,7 +2025,7 @@
       CallStructure callStructure =
           resolveArguments(node.argumentsNode).callStructure;
       Selector selector = callStructure.callSelector;
-      // TODO(johnniwinther): Remove this when all information goes through
+      // TODO(23998): Remove this when all information goes through
       // the [SendStructure].
       registry.setSelector(node, selector);
 
@@ -1997,27 +2040,77 @@
     } else {
       analyzeConstantDeferred(node, enforceConst: false);
 
-      // TODO(johnniwinther): Avoid the need for a [Selector] here.
-      registry.registerSendStructure(node,
-          new GetStructure(semantics,
-              new Selector(SelectorKind.GETTER, name, CallStructure.NO_ARGS)));
+      registry.setConstant(node, semantics.constant);
+      registry.registerSendStructure(node, new GetStructure(semantics));
       return new ConstantResult(node, semantics.constant);
     }
   }
 
+  /// Handle access to a constant type literal of [type].
+  // TODO(johnniwinther): Remove [name] when [Selector] is not required for the
+  // the [GetStructure].
+  // TODO(johnniwinther): Remove [element] when it is no longer needed for
+  // evaluating constants.
+  ResolutionResult handleConstantTypeLiteralUpdate(
+      SendSet node,
+      Name name,
+      TypeDeclarationElement element,
+      DartType type,
+      ConstantAccess semantics) {
+
+    // TODO(johnniwinther): Remove this when all constants are evaluated.
+    compiler.resolver.constantCompiler.evaluate(semantics.constant);
+
+    ErroneousElement error;
+    if (node.isIfNullAssignment) {
+      error = reportAndCreateErroneousElement(
+          node.selector, name.text,
+          MessageKind.IF_NULL_ASSIGNING_TYPE, const {});
+      // TODO(23998): Remove these when all information goes through
+      // the [SendStructure].
+      registry.setConstant(node.selector, semantics.constant);
+      registry.useElement(node.selector, element);
+    } else {
+      error = reportAndCreateErroneousElement(
+          node.selector, name.text,
+          MessageKind.ASSIGNING_TYPE, const {});
+    }
+
+    // TODO(23998): Remove this when all information goes through
+    // the [SendStructure].
+    registry.useElement(node, error);
+    registry.registerTypeLiteral(node, type);
+    registry.registerThrowNoSuchMethod();
+
+    return handleUpdate(node, name, semantics);
+  }
+
   /// Handle access to a type literal of a typedef. Like `F` or
   /// `F()` where 'F' is typedef.
   ResolutionResult handleTypedefTypeLiteralAccess(
       Send node,
       Name name,
       TypedefElement typdef) {
-    typdef.ensureResolved(compiler);
+    typdef.ensureResolved(resolution);
     DartType type = typdef.rawType;
     ConstantExpression constant = new TypeConstantExpression(type);
     AccessSemantics semantics = new ConstantAccess.typedefTypeLiteral(constant);
     return handleConstantTypeLiteralAccess(node, name, typdef, type, semantics);
   }
 
+  /// Handle access to a type literal of a typedef. Like `F = b`, `F++` or
+  /// `F += b` where 'F' is typedef.
+  ResolutionResult handleTypedefTypeLiteralUpdate(
+      SendSet node,
+      Name name,
+      TypedefElement typdef) {
+    typdef.ensureResolved(resolution);
+    DartType type = typdef.rawType;
+    ConstantExpression constant = new TypeConstantExpression(type);
+    AccessSemantics semantics = new ConstantAccess.typedefTypeLiteral(constant);
+    return handleConstantTypeLiteralUpdate(node, name, typdef, type, semantics);
+  }
+
   /// Handle access to a type literal of the type 'dynamic'. Like `dynamic` or
   /// `dynamic()`.
   ResolutionResult handleDynamicTypeLiteralAccess(Send node) {
@@ -2031,18 +2124,43 @@
         node, const PublicName('dynamic'), compiler.typeClass, type, semantics);
   }
 
+  /// Handle update to a type literal of the type 'dynamic'. Like `dynamic++` or
+  /// `dynamic = 0`.
+  ResolutionResult handleDynamicTypeLiteralUpdate(SendSet node) {
+    DartType type = const DynamicType();
+    ConstantExpression constant =
+        new TypeConstantExpression(const DynamicType());
+    AccessSemantics semantics = new ConstantAccess.dynamicTypeLiteral(constant);
+    return handleConstantTypeLiteralUpdate(
+        node, const PublicName('dynamic'), compiler.typeClass, type, semantics);
+  }
+
   /// Handle access to a type literal of a class. Like `C` or
   /// `C()` where 'C' is class.
   ResolutionResult handleClassTypeLiteralAccess(
       Send node,
       Name name,
       ClassElement cls) {
+    cls.ensureResolved(resolution);
     DartType type = cls.rawType;
     ConstantExpression constant = new TypeConstantExpression(type);
     AccessSemantics semantics = new ConstantAccess.classTypeLiteral(constant);
     return handleConstantTypeLiteralAccess(node, name, cls, type, semantics);
   }
 
+  /// Handle access to a type literal of a class. Like `C = b`, `C++` or
+  /// `C += b` where 'C' is class.
+  ResolutionResult handleClassTypeLiteralUpdate(
+      SendSet node,
+      Name name,
+      ClassElement cls) {
+    cls.ensureResolved(resolution);
+    DartType type = cls.rawType;
+    ConstantExpression constant = new TypeConstantExpression(type);
+    AccessSemantics semantics = new ConstantAccess.classTypeLiteral(constant);
+    return handleConstantTypeLiteralUpdate(node, name, cls, type, semantics);
+  }
+
   /// Handle a [Send] that resolves to a [prefix]. Like `prefix` in
   /// `prefix.Class` or `prefix` in `prefix()`, the latter being a compile time
   /// error.
@@ -2050,7 +2168,7 @@
       Send node,
       Name name,
       ClassElement cls) {
-    cls.ensureResolved(compiler);
+    cls.ensureResolved(resolution);
     if (sendIsMemberAccess) {
       registry.useElement(node, cls);
       return new PrefixResult(null, cls);
@@ -2085,7 +2203,7 @@
   /// like `prefix.toplevelFunction()` or `prefix.Class.staticField` where
   /// `prefix` is a library prefix.
   ResolutionResult handleLibraryPrefixSend(
-      Send node, PrefixElement prefix, Name name) {
+      Send node, Name name, PrefixElement prefix) {
     ResolutionResult result;
     Element member = prefix.lookupLocalMember(name.text);
     if (member == null) {
@@ -2109,6 +2227,34 @@
     return result;
   }
 
+  /// Handle qualified [SendSet] where the receiver resolves to a [prefix],
+  /// like `prefix.toplevelField = b` or `prefix.Class.staticField++` where
+  /// `prefix` is a library prefix.
+  ResolutionResult handleLibraryPrefixSendSet(
+      SendSet node, Name name, PrefixElement prefix) {
+    ResolutionResult result;
+    Element member = prefix.lookupLocalMember(name.text);
+    if (member == null) {
+      registry.registerThrowNoSuchMethod();
+      Element error = reportAndCreateErroneousElement(
+          node, name.text, MessageKind.NO_SUCH_LIBRARY_MEMBER,
+          {'libraryName': prefix.name, 'memberName': name});
+      return handleUpdate(node, name, new StaticAccess.unresolved(error));
+    } else {
+      result = handleResolvedSendSet(node, name, member);
+    }
+    if (result.kind == ResultKind.PREFIX) {
+      // [member] is a class prefix of a static access like `prefix.Class` of
+      // `prefix.Class.foo`. No need to call [handleDeferredAccess]; it will
+      // called on the parent `prefix.Class.foo` node.
+      result = new PrefixResult(prefix, result.element);
+    } else if (prefix.isDeferred &&
+               (member == null || !member.isDeferredLoaderGetter)) {
+      result = handleDeferredAccess(node, prefix, result);
+    }
+    return result;
+  }
+
   /// Handle a [Send] that resolves to a [prefix]. Like `prefix` in
   /// `prefix.Class` or `prefix` in `prefix()`, the latter being a compile time
   /// error.
@@ -2123,11 +2269,12 @@
           MessageKind.PREFIX_AS_EXPRESSION,
           {'prefix': name},
           isError: true);
+      registry.registerCompileTimeError(error);
       return handleErroneousAccess(
-          node, name, error, new StaticAccess.invalid(error));
+          node, name, new StaticAccess.invalid(error));
     }
     if (prefix.isDeferred) {
-      // TODO(johnniwinther): Remove this when deferred access is detected
+      // TODO(23998): Remove this when deferred access is detected
       // through a [SendStructure].
       registry.useElement(node.selector, prefix);
     }
@@ -2141,7 +2288,11 @@
       Send node, Name name, PrefixResult prefixResult) {
     Element element = prefixResult.element;
     if (element.isPrefix) {
-      return handleLibraryPrefixSend(node, element, name);
+      if (node.isConditional) {
+        return handleLibraryPrefix(node, name, element);
+      } else {
+        return handleLibraryPrefixSend(node, name, element);
+      }
     } else {
       assert(element.isClass);
       ResolutionResult result = handleStaticMemberAccess(node, name, element);
@@ -2152,6 +2303,27 @@
     }
   }
 
+  /// Handle qualified [SendSet] where the receiver resolves to an [Element],
+  /// like `a.b = c` where `a` is a prefix or a class.
+  ResolutionResult handlePrefixSendSet(
+      SendSet node, Name name, PrefixResult prefixResult) {
+    Element element = prefixResult.element;
+    if (element.isPrefix) {
+      if (node.isConditional) {
+        return handleLibraryPrefix(node, name, element);
+      } else {
+        return handleLibraryPrefixSendSet(node, name, element);
+      }
+    } else {
+      assert(element.isClass);
+      ResolutionResult result = handleStaticMemberUpdate(node, name, element);
+      if (prefixResult.isDeferred) {
+        result = handleDeferredAccess(node, prefixResult.prefix, result);
+      }
+      return result;
+    }
+  }
+
   /// Handle dynamic access of [semantics].
   ResolutionResult handleDynamicAccessSemantics(
       Send node, Name name, AccessSemantics semantics) {
@@ -2160,40 +2332,53 @@
     if (node.isCall) {
       CallStructure callStructure =
           resolveArguments(node.argumentsNode).callStructure;
-      selector = new Selector(SelectorKind.CALL, name, callStructure);
+      selector = new Selector.call(name, callStructure);
       registry.registerDynamicInvocation(
           new UniverseSelector(selector, null));
       sendStructure = new InvokeStructure(semantics, selector);
     } else {
       assert(invariant(node, node.isPropertyAccess));
-      selector = new Selector(
-          SelectorKind.GETTER, name, CallStructure.NO_ARGS);
+      selector = new Selector.getter(name);
       registry.registerDynamicGetter(
           new UniverseSelector(selector, null));
-      sendStructure = new GetStructure(semantics, selector);
+      sendStructure = new GetStructure(semantics);
     }
     registry.registerSendStructure(node, sendStructure);
-    // TODO(johnniwinther): Remove this when all information goes through
+    // TODO(23998): Remove this when all information goes through
     // the [SendStructure].
     registry.setSelector(node, selector);
     return const NoneResult();
   }
 
-  /// Handle dynamic property access, like `a.b` or `a.b()` where `a` is not a
-  /// prefix or class.
-  ResolutionResult handleDynamicPropertyAccess(Send node, Name name) {
-    AccessSemantics semantics =
-        new DynamicAccess.dynamicProperty(node.receiver);
-    return handleDynamicAccessSemantics(node, name, semantics);
-  }
+  /// Handle dynamic update of [semantics].
+  ResolutionResult handleDynamicUpdateSemantics(
+      SendSet node, Name name, Element element, AccessSemantics semantics) {
+    Selector getterSelector = new Selector.getter(name);
+    Selector setterSelector = new Selector.setter(name.setter);
+    registry.registerDynamicSetter(
+        new UniverseSelector(setterSelector, null));
+    if (node.isComplex) {
+      registry.registerDynamicGetter(
+          new UniverseSelector(getterSelector, null));
+    }
 
-  /// Handle conditional access, like `a?.b` or `a?.b()`.
-  ResolutionResult handleConditionalAccess(Send node, Name name) {
-    Node receiver = node.receiver;
-    visitConditionalPrefix(receiver);
-    AccessSemantics semantics =
-        new DynamicAccess.ifNotNullProperty(receiver);
-    return handleDynamicAccessSemantics(node, name, semantics);
+    // TODO(23998): Remove these when elements are only accessed through the
+    // send structure.
+    Element getter = element;
+    Element setter = element;
+    if (element != null && element.isAbstractField) {
+      AbstractFieldElement abstractField = element;
+      getter = abstractField.getter;
+      setter = abstractField.setter;
+    }
+    if (setter != null) {
+      registry.useElement(node, setter);
+      if (getter != null && node.isComplex) {
+        registry.useElement(node.selector, getter);
+      }
+    }
+
+    return handleUpdate(node, name, semantics);
   }
 
   /// Handle `this` as a qualified property, like `a.this`.
@@ -2203,8 +2388,9 @@
         name.text,
         MessageKind.THIS_PROPERTY, {},
         isError: true);
+    registry.registerCompileTimeError(error);
     AccessSemantics accessSemantics = new StaticAccess.invalid(error);
-    return handleErroneousAccess(node, name, error, accessSemantics);
+    return handleErroneousAccess(node, name, accessSemantics);
   }
 
   /// Handle a qualified [Send], that is where the receiver is non-null, like
@@ -2218,21 +2404,60 @@
     } else if (node.isSuperCall) {
       return handleSuperPropertyAccess(node, name);
     } else if (node.receiver.isThis()) {
-      if (checkThisAccess(node)) {
+      AccessSemantics semantics = checkThisAccess(node);
+      if (semantics == null) {
         return handleThisPropertyAccess(node, name);
+      } else {
+        // TODO(johnniwinther): Handle invalid this access as an
+        // [AccessSemantics].
+        return handleErroneousAccess(node, name, semantics);
       }
-      // TODO(johnniwinther): Handle invalid this access as an
-      // [AccessSemantics].
-      return const NoneResult();
-    } else if (node.isConditional) {
-      return handleConditionalAccess(node, name);
     }
     ResolutionResult result = visitExpressionPrefix(node.receiver);
     if (result.kind == ResultKind.PREFIX) {
       return handlePrefixSend(node, name, result);
+    } else if (node.isConditional) {
+      return handleDynamicAccessSemantics(
+          node, name, new DynamicAccess.ifNotNullProperty(name));
     } else {
+      // Handle dynamic property access, like `a.b` or `a.b()` where `a` is not
+      // a prefix or class.
       // TODO(johnniwinther): Use the `element` of [result].
-      return handleDynamicPropertyAccess(node, name);
+      return handleDynamicAccessSemantics(
+          node, name, new DynamicAccess.dynamicProperty(name));
+    }
+  }
+
+  /// Handle a qualified [SendSet], that is where the receiver is non-null, like
+  /// `a.b = c`, `a.b++`, and `a.b += c`.
+  ResolutionResult handleQualifiedSendSet(SendSet node) {
+    Identifier selector = node.selector.asIdentifier();
+    String text = selector.source;
+    Name name = new Name(text, enclosingElement.library);
+    if (text == 'this') {
+      return handleQualifiedThisAccess(node, name);
+    } else if (node.receiver.isThis()) {
+      AccessSemantics semantics = checkThisAccess(node);
+      if (semantics == null) {
+        return handleThisPropertyUpdate(node, name, null);
+      } else {
+        // TODO(johnniwinther): Handle invalid this access as an
+        // [AccessSemantics].
+        return handleUpdate(node, name, semantics);
+      }
+    }
+    ResolutionResult result = visitExpressionPrefix(node.receiver);
+    if (result.kind == ResultKind.PREFIX) {
+      return handlePrefixSendSet(node, name, result);
+    } else if (node.isConditional) {
+      return handleDynamicUpdateSemantics(
+          node, name, null, new DynamicAccess.ifNotNullProperty(name));
+    } else {
+      // Handle dynamic property access, like `a.b = c`, `a.b++` or `a.b += c`
+      // where `a` is not a prefix or class.
+      // TODO(johnniwinther): Use the `element` of [result].
+      return handleDynamicUpdateSemantics(
+          node, name, null, new DynamicAccess.dynamicProperty(name));
     }
   }
 
@@ -2241,34 +2466,31 @@
         Send node, Name name, Element element) {
     // TODO(johnniwinther): Support unresolved top level access as an
     // [AccessSemantics].
-    AccessSemantics accessSemantics = new StaticAccess.unresolved(element);
-    return handleErroneousAccess(node, name, element, accessSemantics);
+    AccessSemantics semantics = new StaticAccess.unresolved(element);
+    return handleErroneousAccess(node, name, semantics);
   }
 
-  /// Handle erroneous access of [element] of the given [accessSemantics].
+  /// Handle erroneous access of [element] of the given [semantics].
   ResolutionResult handleErroneousAccess(
-      Send node, Name name, Element element, AccessSemantics accessSemantics) {
+      Send node, Name name, AccessSemantics semantics) {
     SendStructure sendStructure;
     Selector selector;
     if (node.isCall) {
       CallStructure callStructure =
           resolveArguments(node.argumentsNode).callStructure;
-      selector = new Selector(SelectorKind.CALL, name, callStructure);
-      registry.registerDynamicInvocation(
-          new UniverseSelector(selector, null));
-      sendStructure = new InvokeStructure(accessSemantics, selector);
+      selector = new Selector.call(name, callStructure);
+      registry.registerDynamicInvocation(new UniverseSelector(selector, null));
+      sendStructure = new InvokeStructure(semantics, selector);
     } else {
       assert(invariant(node, node.isPropertyAccess));
-      selector = new Selector(
-          SelectorKind.GETTER, name, CallStructure.NO_ARGS);
-      registry.registerDynamicGetter(
-          new UniverseSelector(selector, null));
-      sendStructure = new GetStructure(accessSemantics, selector);
+      selector = new Selector.getter(name);
+      registry.registerDynamicGetter(new UniverseSelector(selector, null));
+      sendStructure = new GetStructure(semantics);
     }
-    // TODO(johnniwinther): Remove this when all information goes through
+    // TODO(23998): Remove this when all information goes through
     // the [SendStructure].
     registry.setSelector(node, selector);
-    registry.useElement(node, element);
+    registry.useElement(node, semantics.element);
     registry.registerSendStructure(node, sendStructure);
     return const NoneResult();
   }
@@ -2283,30 +2505,44 @@
         node,
         name.text,
         element.messageKind,
-        element.messageArguments);
-    element.diagnose(enclosingElement, compiler);
+        element.messageArguments,
+        infos: element.computeInfos(enclosingElement, reporter));
+    registry.registerThrowNoSuchMethod();
+
+    // TODO(johnniwinther): Support ambiguous access as an [AccessSemantics].
+    AccessSemantics semantics = new StaticAccess.unresolved(error);
+    return handleErroneousAccess(node, name, semantics);
+  }
+
+  /// Handle update to an ambiguous element, that is, a name imported twice.
+  ResolutionResult handleAmbiguousUpdate(
+      SendSet node,
+      Name name,
+      AmbiguousElement element) {
+
+    ErroneousElement error = reportAndCreateErroneousElement(
+        node,
+        name.text,
+        element.messageKind,
+        element.messageArguments,
+        infos: element.computeInfos(enclosingElement, reporter));
     registry.registerThrowNoSuchMethod();
 
     // TODO(johnniwinther): Support ambiguous access as an [AccessSemantics].
     AccessSemantics accessSemantics = new StaticAccess.unresolved(error);
-    return handleErroneousAccess(node, name, error, accessSemantics);
+    return handleUpdate(node, name, accessSemantics);
   }
 
-  /// Handle access of an instance [member] from a non-instance context.
-  ResolutionResult handleStaticInstanceSend(
-      Send node, Name name, MemberElement member) {
-    compiler.reportError(
-        node, MessageKind.NO_INSTANCE_AVAILABLE, {'name': member.name});
-    ErroneousElement error = new ErroneousElementX(
-        MessageKind.NO_INSTANCE_AVAILABLE,
-        {'name': name},
-        name.text,
-        enclosingElement);
-
+  /// Report access of an instance [member] from a non-instance context.
+  AccessSemantics reportStaticInstanceAccess(Send node, Name name) {
+    ErroneousElement error = reportAndCreateErroneousElement(
+        node, name.text,
+        MessageKind.NO_INSTANCE_AVAILABLE, {'name': name},
+        isError: true);
     // TODO(johnniwinther): Support static instance access as an
     // [AccessSemantics].
-    AccessSemantics accessSemantics = new StaticAccess.unresolved(error);
-    return handleErroneousAccess(node, name, error, accessSemantics);
+    registry.registerCompileTimeError(error);
+    return new StaticAccess.invalid(error);
   }
 
   /// Handle access of a parameter, local variable or local function.
@@ -2317,12 +2553,12 @@
     if (node.isCall) {
       CallStructure callStructure =
           resolveArguments(node.argumentsNode).callStructure;
-      selector = new Selector(SelectorKind.CALL, name, callStructure);
+      selector = new Selector.call(name, callStructure);
       bool isIncompatibleInvoke = false;
       switch (semantics.kind) {
         case AccessKind.LOCAL_FUNCTION:
           LocalFunctionElementX function = semantics.element;
-          function.computeSignature(compiler);
+          function.computeType(resolution);
           if (!callStructure.signatureApplies(function.functionSignature)) {
             registry.registerThrowNoSuchMethod();
             registry.registerDynamicInvocation(
@@ -2339,7 +2575,7 @@
               new UniverseSelector(selector, null));
           break;
         default:
-          internalError(node,
+          reporter.internalError(node,
               "Unexpected local access $semantics.");
           break;
       }
@@ -2385,16 +2621,15 @@
           }
           break;
         default:
-          internalError(node,
+          reporter.internalError(node,
               "Unexpected local access $semantics.");
           break;
       }
-      selector = new Selector(SelectorKind.GETTER, name, CallStructure.NO_ARGS);
-      registry.registerSendStructure(node,
-          new GetStructure(semantics, selector));
+      selector = new Selector.getter(name);
+      registry.registerSendStructure(node, new GetStructure(semantics));
     }
 
-    // TODO(johnniwinther): Remove these when all information goes through
+    // TODO(23998): Remove these when all information goes through
     // the [SendStructure].
     registry.useElement(node, element);
     registry.setSelector(node, selector);
@@ -2404,6 +2639,56 @@
     return result;
   }
 
+  /// Handle update of a parameter, local variable or local function.
+  ResolutionResult handleLocalUpdate(Send node, Name name, Element element) {
+    AccessSemantics semantics;
+    ErroneousElement error;
+    if (element.isParameter) {
+      if (element.isFinal) {
+        error = reportAndCreateErroneousElement(
+            node.selector, name.text,
+            MessageKind.CANNOT_RESOLVE_SETTER, const {});
+        semantics = new StaticAccess.finalParameter(element);
+      } else {
+        semantics = new StaticAccess.parameter(element);
+      }
+    } else if (element.isVariable) {
+      if (element.isFinal || element.isConst) {
+        error = reportAndCreateErroneousElement(
+            node.selector, name.text,
+            MessageKind.CANNOT_RESOLVE_SETTER, const {});
+        semantics = new StaticAccess.finalLocalVariable(element);
+      } else {
+        semantics = new StaticAccess.localVariable(element);
+      }
+    } else {
+      assert(invariant(node, element.isFunction,
+          message: "Unexpected local $element."));
+      error = reportAndCreateErroneousElement(
+          node.selector, name.text,
+          MessageKind.ASSIGNING_METHOD, const {});
+      semantics = new StaticAccess.localFunction(element);
+    }
+    if (isPotentiallyMutableTarget(element)) {
+      registry.registerPotentialMutation(element, node);
+      if (enclosingElement != element.enclosingElement) {
+        registry.registerPotentialMutationInClosure(element, node);
+      }
+      for (Node scope in promotionScope) {
+        registry.registerPotentialMutationIn(scope, element, node);
+      }
+    }
+
+    ResolutionResult result = handleUpdate(node, name, semantics);
+    if (error != null) {
+      registry.registerThrowNoSuchMethod();
+      // TODO(23998): Remove this when all information goes through
+      // the [SendStructure].
+      registry.useElement(node, error);
+    }
+    return result;
+  }
+
   /// Handle access of a static or top level [element].
   ResolutionResult handleStaticOrTopLevelAccess(
         Send node, Name name, Element element) {
@@ -2421,12 +2706,12 @@
     }
     // TODO(johnniwinther): Needed to provoke a parsing and with it discovery
     // of parse errors to make [element] erroneous. Fix this!
-    member.computeType(compiler);
+    member.computeType(resolution);
 
 
     if (member == compiler.mirrorSystemGetNameFunction &&
         !compiler.mirrorUsageAnalyzerTask.hasMirrorUsage(enclosingElement)) {
-      compiler.reportHint(
+      reporter.reportHintMessage(
           node.selector, MessageKind.STATIC_FUNCTION_BLOAT,
           {'class': compiler.mirrorSystemClass.name,
            'name': compiler.mirrorSystemGetNameFunction.name});
@@ -2439,14 +2724,14 @@
       ArgumentsResult argumentsResult =
           resolveArguments(node.argumentsNode);
       CallStructure callStructure = argumentsResult.callStructure;
-      selector = new Selector(SelectorKind.CALL, name, callStructure);
+      selector = new Selector.call(name, callStructure);
 
       bool isIncompatibleInvoke = false;
       switch (semantics.kind) {
         case AccessKind.STATIC_METHOD:
         case AccessKind.TOPLEVEL_METHOD:
           MethodElement method = semantics.element;
-          method.computeType(compiler);
+          method.computeType(resolution);
           if (!callStructure.signatureApplies(method.functionSignature)) {
             registry.registerThrowNoSuchMethod();
             registry.registerDynamicInvocation(
@@ -2454,7 +2739,7 @@
             isIncompatibleInvoke = true;
           } else {
             registry.registerStaticUse(semantics.element);
-            handleForeignCall(node, semantics.element, selector);
+            handleForeignCall(node, semantics.element, callStructure);
             if (method == compiler.identicalFunction &&
                 argumentsResult.isValidAsConstant) {
               result = new ConstantResult(node,
@@ -2484,7 +2769,7 @@
               MessageKind.CANNOT_RESOLVE_GETTER, const {});
           break;
         default:
-          internalError(node,
+          reporter.internalError(node,
               "Unexpected statically resolved access $semantics.");
           break;
       }
@@ -2493,7 +2778,7 @@
               ? new IncompatibleInvokeStructure(semantics, selector)
               : new InvokeStructure(semantics, selector));
     } else {
-      selector = new Selector(SelectorKind.GETTER, name, CallStructure.NO_ARGS);
+      selector = new Selector.getter(name);
       switch (semantics.kind) {
         case AccessKind.STATIC_METHOD:
         case AccessKind.TOPLEVEL_METHOD:
@@ -2519,12 +2804,11 @@
               MessageKind.CANNOT_RESOLVE_GETTER, const {});
           break;
         default:
-          internalError(node,
+          reporter.internalError(node,
               "Unexpected statically resolved access $semantics.");
           break;
       }
-      registry.registerSendStructure(node,
-          new GetStructure(semantics, selector));
+      registry.registerSendStructure(node, new GetStructure(semantics));
       if (member.isConst) {
         FieldElement field = member;
         result = new ConstantResult(
@@ -2534,7 +2818,7 @@
       }
     }
 
-    // TODO(johnniwinther): Remove these when all information goes through
+    // TODO(23998): Remove these when all information goes through
     // the [SendStructure].
     registry.useElement(node, member);
     registry.setSelector(node, selector);
@@ -2542,6 +2826,109 @@
     return result;
   }
 
+  /// Handle update of a static or top level [element].
+  ResolutionResult handleStaticOrTopLevelUpdate(
+        SendSet node, Name name, Element element) {
+    AccessSemantics semantics;
+    if (element.isAbstractField) {
+      AbstractFieldElement abstractField = element;
+      if (abstractField.setter == null) {
+        ErroneousElement error = reportAndCreateErroneousElement(
+            node.selector, name.text,
+            MessageKind.CANNOT_RESOLVE_SETTER, const {});
+        registry.registerThrowNoSuchMethod();
+
+        if (node.isComplex) {
+          // `a++` or `a += b` where `a` has no setter.
+          semantics = new CompoundAccessSemantics(
+              element.isTopLevel
+                  ? CompoundAccessKind.UNRESOLVED_TOPLEVEL_SETTER
+                  : CompoundAccessKind.UNRESOLVED_STATIC_SETTER,
+              abstractField.getter,
+              error);
+        } else {
+          // `a = b` where `a` has no setter.
+          semantics = element.isTopLevel
+              ? new StaticAccess.topLevelGetter(abstractField.getter)
+              : new StaticAccess.staticGetter(abstractField.getter);
+        }
+        registry.registerStaticUse(abstractField.getter);
+      } else if (node.isComplex) {
+        if (abstractField.getter == null) {
+          ErroneousElement error = reportAndCreateErroneousElement(
+              node.selector, name.text,
+              MessageKind.CANNOT_RESOLVE_GETTER, const {});
+          registry.registerThrowNoSuchMethod();
+          // `a++` or `a += b` where `a` has no getter.
+          semantics = new CompoundAccessSemantics(
+              element.isTopLevel
+                  ? CompoundAccessKind.UNRESOLVED_TOPLEVEL_GETTER
+                  : CompoundAccessKind.UNRESOLVED_STATIC_GETTER,
+              error,
+              abstractField.setter);
+          registry.registerStaticUse(abstractField.setter);
+        } else {
+          // `a++` or `a += b` where `a` has both a getter and a setter.
+          semantics = new CompoundAccessSemantics(
+              element.isTopLevel
+                  ? CompoundAccessKind.TOPLEVEL_GETTER_SETTER
+                  : CompoundAccessKind.STATIC_GETTER_SETTER,
+              abstractField.getter,
+              abstractField.setter);
+          registry.registerStaticUse(abstractField.getter);
+          registry.registerStaticUse(abstractField.setter);
+        }
+      } else {
+        // `a = b` where `a` has a setter.
+        semantics = element.isTopLevel
+            ? new StaticAccess.topLevelSetter(abstractField.setter)
+            : new StaticAccess.staticSetter(abstractField.setter);
+        registry.registerStaticUse(abstractField.setter);
+      }
+    } else {
+      MemberElement member = element;
+      // TODO(johnniwinther): Needed to provoke a parsing and with it discovery
+      // of parse errors to make [element] erroneous. Fix this!
+      member.computeType(resolution);
+      registry.registerStaticUse(member);
+      if (member.isErroneous) {
+        // [member] has parse errors.
+        semantics = new StaticAccess.unresolved(member);
+      } else if (member.isFunction) {
+        // `a = b`, `a++` or `a += b` where `a` is a function.
+        ErroneousElement error = reportAndCreateErroneousElement(
+            node.selector, name.text,
+            MessageKind.ASSIGNING_METHOD, const {});
+        registry.registerThrowNoSuchMethod();
+        if (node.isComplex) {
+          // `a++` or `a += b` where `a` is a function.
+          registry.registerGetOfStaticFunction(element);
+        }
+        semantics = member.isTopLevel
+            ? new StaticAccess.topLevelMethod(member)
+            : new StaticAccess.staticMethod(member);
+      } else {
+        // `a = b`, `a++` or `a += b` where `a` is a field.
+        assert(invariant(node, member.isField,
+            message: "Unexpected element: $member."));
+        if (member.isFinal || member.isConst) {
+          ErroneousElement error = reportAndCreateErroneousElement(
+               node.selector, name.text,
+               MessageKind.CANNOT_RESOLVE_SETTER, const {});
+          registry.registerThrowNoSuchMethod();
+          semantics = member.isTopLevel
+              ? new StaticAccess.finalTopLevelField(member)
+              : new StaticAccess.finalStaticField(member);
+        } else {
+          semantics = member.isTopLevel
+              ? new StaticAccess.topLevelField(member)
+              : new StaticAccess.staticField(member);
+        }
+      }
+    }
+    return handleUpdate(node, name, semantics);
+  }
+
   /// Handle access to resolved [element].
   ResolutionResult handleResolvedSend(Send node, Name name, Element element) {
     if (element.isAmbiguous) {
@@ -2553,7 +2940,7 @@
       // [isErroneous] to `true`.
       assert(invariant(node, element is! ErroneousElement,
           message: "Unexpected erroneous element $element."));
-      return handleErroneousAccess(node, name, element,
+      return handleErroneousAccess(node, name,
           new StaticAccess.unresolved(element));
     }
     if (element.isInstanceMember) {
@@ -2561,7 +2948,8 @@
         // TODO(johnniwinther): Maybe use the found [element].
         return handleThisPropertyAccess(node, name);
       } else {
-        return handleStaticInstanceSend(node, name, element);
+        return handleErroneousAccess(
+            node, name, reportStaticInstanceAccess(node, name));
       }
     }
     if (element.isClass) {
@@ -2579,7 +2967,45 @@
     } else if (element.isStatic || element.isTopLevel) {
       return handleStaticOrTopLevelAccess(node, name, element);
     }
-    return internalError(node, "Unexpected resolved send: $element");
+    return reporter.internalError(node, "Unexpected resolved send: $element");
+  }
+
+  /// Handle update to resolved [element].
+  ResolutionResult handleResolvedSendSet(
+      SendSet node, Name name, Element element) {
+    if (element.isAmbiguous) {
+      return handleAmbiguousUpdate(node, name, element);
+    }
+    if (element.isErroneous) {
+      // This handles elements with parser errors.
+      // TODO(johnniwinther): Elements with parse error should not set
+      // [isErroneous] to `true`.
+      assert(invariant(node, element is! ErroneousElement,
+          message: "Unexpected erroneous element $element."));
+      return handleUpdate(node, name,new StaticAccess.unresolved(element));
+    }
+    if (element.isInstanceMember) {
+      if (inInstanceContext) {
+        return handleThisPropertyUpdate(node, name, element);
+      } else {
+        return handleUpdate(node, name, reportStaticInstanceAccess(node, name));
+      }
+    }
+    if (element.isClass) {
+      // `C = b`, `C++`, or 'C += b` where 'C' is a class.
+      return handleClassTypeLiteralUpdate(node, name, element);
+    } else if (element.isTypedef) {
+      // `C = b`, `C++`, or 'C += b` where 'F' is a typedef.
+      return handleTypedefTypeLiteralUpdate(node, name, element);
+    } else if (element.isTypeVariable) {
+      // `T = b`, `T++`, or 'T += b` where 'T' is a type variable.
+      return handleTypeVariableTypeLiteralUpdate(node, name, element);
+    } else if (element.isLocal) {
+      return handleLocalUpdate(node, name, element);
+    } else if (element.isStatic || element.isTopLevel) {
+      return handleStaticOrTopLevelUpdate(node, name, element);
+    }
+    return reporter.internalError(node, "Unexpected resolved send: $element");
   }
 
   /// Handle an unqualified [Send], that is where the `node.receiver` is null,
@@ -2591,16 +3017,13 @@
       return handleExpressionInvoke(node);
     }
     String text = selector.source;
-    if (text == 'assert') {
-      // `assert()`.
-      return handleAssert(node);
-    } else if (text == 'this') {
+    if (text == 'this') {
       // `this()`.
       return handleThisAccess(node);
     }
     // `name` or `name()`
     Name name = new Name(text, enclosingElement.library);
-    Element element = lookupInScope(compiler, node, scope, text);
+    Element element = lookupInScope(reporter, node, scope, text);
     if (element == null) {
       if (text == 'dynamic') {
         // `dynamic` or `dynamic()` where 'dynamic' is not declared in the
@@ -2619,6 +3042,31 @@
     }
   }
 
+  /// Handle an unqualified [SendSet], that is where the `node.receiver` is
+  /// null, like `a = b`, `a++`, and `a += b`.
+  ResolutionResult handleUnqualifiedSendSet(SendSet node) {
+    Identifier selector = node.selector.asIdentifier();
+    String text = selector.source;
+    Name name = new Name(text, enclosingElement.library);
+    Element element = lookupInScope(reporter, node, scope, text);
+    if (element == null) {
+      if (text == 'dynamic') {
+        // `dynamic = b`, `dynamic++`, or `dynamic += b` where 'dynamic' is not
+        // declared in the current scope.
+        return handleDynamicTypeLiteralUpdate(node);
+      } else if (inInstanceContext) {
+        // Left-hand side is implicitly `this.name`.
+        return handleThisPropertyUpdate(node, name, null);
+      } else {
+        // Create [ErroneousElement] for unresolved access.
+        ErroneousElement error = reportCannotResolve(node, text);
+        return handleUpdate(node, name, new StaticAccess.unresolved(error));
+      }
+    } else {
+      return handleResolvedSendSet(node, name, element);
+    }
+  }
+
   ResolutionResult visitSend(Send node) {
     if (node.isOperator) {
       // `a && b`, `a + b`, `-a`, or `a is T`.
@@ -2644,34 +3092,22 @@
   }
 
   // TODO(johnniwinther): Move this to the backend resolution callbacks.
-  void handleForeignCall(Send node, Element target, Selector selector) {
+  void handleForeignCall(Send node,
+                         Element target,
+                         CallStructure callStructure) {
     if (target != null && compiler.backend.isForeign(target)) {
-      if (selector.name == 'JS') {
-        registry.registerJsCall(node, this);
-      } else if (selector.name == 'JS_EMBEDDED_GLOBAL') {
-        registry.registerJsEmbeddedGlobalCall(node, this);
-      } else if (selector.name == 'JS_BUILTIN') {
-        registry.registerJsBuiltinCall(node, this);
-      } else if (selector.name == 'JS_INTERCEPTOR_CONSTANT') {
-        if (!node.argumentsNode.isEmpty) {
-          Node argument = node.argumentsNode.nodes.head;
-          if (argumentsToJsInterceptorConstant == null) {
-            argumentsToJsInterceptorConstant = new Set<Node>();
-          }
-          argumentsToJsInterceptorConstant.add(argument);
-        }
-      }
+      registry.registerForeignCall(node, target, callStructure, this);
     }
   }
 
   /// Callback for native enqueuer to parse a type.  Returns [:null:] on error.
   DartType resolveTypeFromString(Node node, String typeName) {
-    Element element = lookupInScope(compiler, node, scope, typeName);
+    Element element = lookupInScope(reporter, node, scope, typeName);
     if (element == null) return null;
     if (element is! ClassElement) return null;
     ClassElement cls = element;
-    cls.ensureResolved(compiler);
-    return cls.computeType(compiler);
+    cls.ensureResolved(resolution);
+    return cls.computeType(resolution);
   }
 
   /// Handle index operations like `a[b] = c`, `a[b] += c`, and `a[b]++`.
@@ -2681,16 +3117,16 @@
     Node index = node.arguments.head;
     visitExpression(receiver);
     visitExpression(index);
+    AccessSemantics semantics = const DynamicAccess.expression();
     if (node.isPrefix || node.isPostfix) {
       // `a[b]++` or `++a[b]`.
       IncDecOperator operator = IncDecOperator.parse(operatorText);
-      AccessSemantics semantics = new DynamicAccess.dynamicProperty(receiver);
       Selector getterSelector = new Selector.index();
       Selector setterSelector = new Selector.indexSet();
       Selector operatorSelector =
           new Selector.binaryOperator(operator.selectorName);
 
-      // TODO(johnniwinther): Remove these when selectors are only accessed
+      // TODO(23998): Remove these when selectors are only accessed
       // through the send structure.
       registry.setGetterSelectorInComplexSendSet(node, getterSelector);
       registry.setSelector(node, setterSelector);
@@ -2704,10 +3140,8 @@
           new UniverseSelector(operatorSelector, null));
 
       SendStructure sendStructure = node.isPrefix
-          ? new IndexPrefixStructure(
-              semantics, operator, getterSelector, setterSelector)
-          : new IndexPostfixStructure(
-              semantics, operator, getterSelector, setterSelector);
+          ? new IndexPrefixStructure(semantics, operator)
+          : new IndexPostfixStructure(semantics, operator);
       registry.registerSendStructure(node, sendStructure);
       return const NoneResult();
     } else {
@@ -2717,28 +3151,25 @@
       AssignmentOperator operator = AssignmentOperator.parse(operatorText);
       if (operator.kind == AssignmentOperatorKind.ASSIGN) {
         // `a[b] = c`.
-        AccessSemantics semantics = new DynamicAccess.dynamicProperty(receiver);
         Selector setterSelector = new Selector.indexSet();
 
-        // TODO(johnniwinther): Remove this when selectors are only accessed
+        // TODO(23998): Remove this when selectors are only accessed
         // through the send structure.
         registry.setSelector(node, setterSelector);
         registry.registerDynamicInvocation(
             new UniverseSelector(setterSelector, null));
 
-        SendStructure sendStructure =
-            new IndexSetStructure(semantics, setterSelector);
+        SendStructure sendStructure = new IndexSetStructure(semantics);
         registry.registerSendStructure(node, sendStructure);
         return const NoneResult();
       } else {
         // `a[b] += c`.
-        AccessSemantics semantics = new DynamicAccess.dynamicProperty(receiver);
         Selector getterSelector = new Selector.index();
         Selector setterSelector = new Selector.indexSet();
         Selector operatorSelector =
             new Selector.binaryOperator(operator.selectorName);
 
-        // TODO(johnniwinther): Remove these when selectors are only accessed
+        // TODO(23998): Remove these when selectors are only accessed
         // through the send structure.
         registry.setGetterSelectorInComplexSendSet(node, getterSelector);
         registry.setSelector(node, setterSelector);
@@ -2751,8 +3182,8 @@
         registry.registerDynamicInvocation(
             new UniverseSelector(operatorSelector, null));
 
-        SendStructure sendStructure = new CompoundIndexSetStructure(
-                semantics, operator, getterSelector, setterSelector);
+        SendStructure sendStructure =
+            new CompoundIndexSetStructure(semantics, operator);
         registry.registerSendStructure(node, sendStructure);
         return const NoneResult();
       }
@@ -2775,7 +3206,7 @@
       Selector operatorSelector =
           new Selector.binaryOperator(operator.selectorName);
 
-      // TODO(johnniwinther): Remove these when selectors are only accessed
+      // TODO(23998): Remove these when selectors are only accessed
       // through the send structure.
       registry.setGetterSelectorInComplexSendSet(node, getterSelector);
       registry.setSelector(node, setterSelector);
@@ -2783,12 +3214,12 @@
 
       if (semantics == null) {
         semantics = computeSuperAccessSemanticsForSelectors(
-            node, getterSelector, setterSelector);
+            node, getterSelector, setterSelector, isIndex: true);
 
         registry.registerStaticInvocation(semantics.getter);
         registry.registerStaticInvocation(semantics.setter);
 
-        // TODO(johnniwinther): Remove these when elements are only accessed
+        // TODO(23998): Remove these when elements are only accessed
         // through the send structure.
         registry.useElement(node, semantics.setter);
         registry.useElement(node.selector, semantics.getter);
@@ -2797,10 +3228,8 @@
           new UniverseSelector(operatorSelector, null));
 
       SendStructure sendStructure = node.isPrefix
-          ? new IndexPrefixStructure(
-              semantics, operator, getterSelector, setterSelector)
-          : new IndexPostfixStructure(
-              semantics, operator, getterSelector, setterSelector);
+          ? new IndexPrefixStructure(semantics, operator)
+          : new IndexPostfixStructure(semantics, operator);
       registry.registerSendStructure(node, sendStructure);
       return const NoneResult();
     } else {
@@ -2815,18 +3244,17 @@
           semantics =
               computeSuperAccessSemanticsForSelector(node, setterSelector);
 
-          // TODO(johnniwinther): Remove these when elements are only accessed
+          // TODO(23998): Remove these when elements are only accessed
           // through the send structure.
           registry.useElement(node, semantics.setter);
         }
 
-        // TODO(johnniwinther): Remove this when selectors are only accessed
+        // TODO(23998): Remove this when selectors are only accessed
         // through the send structure.
         registry.setSelector(node, setterSelector);
         registry.registerStaticInvocation(semantics.setter);
 
-        SendStructure sendStructure =
-            new IndexSetStructure(semantics, setterSelector);
+        SendStructure sendStructure = new IndexSetStructure(semantics);
         registry.registerSendStructure(node, sendStructure);
         return const NoneResult();
       } else {
@@ -2837,18 +3265,18 @@
             new Selector.binaryOperator(operator.selectorName);
         if (semantics == null) {
           semantics = computeSuperAccessSemanticsForSelectors(
-              node, getterSelector, setterSelector);
+              node, getterSelector, setterSelector, isIndex: true);
 
           registry.registerStaticInvocation(semantics.getter);
           registry.registerStaticInvocation(semantics.setter);
 
-          // TODO(johnniwinther): Remove these when elements are only accessed
+          // TODO(23998): Remove these when elements are only accessed
           // through the send structure.
           registry.useElement(node, semantics.setter);
           registry.useElement(node.selector, semantics.getter);
         }
 
-        // TODO(johnniwinther): Remove these when selectors are only accessed
+        // TODO(23998): Remove these when selectors are only accessed
         // through the send structure.
         registry.setGetterSelectorInComplexSendSet(node, getterSelector);
         registry.setSelector(node, setterSelector);
@@ -2857,156 +3285,187 @@
         registry.registerDynamicInvocation(
             new UniverseSelector(operatorSelector, null));
 
-        SendStructure sendStructure = new CompoundIndexSetStructure(
-                semantics, operator, getterSelector, setterSelector);
+        SendStructure sendStructure =
+            new CompoundIndexSetStructure(semantics, operator);
         registry.registerSendStructure(node, sendStructure);
         return const NoneResult();
       }
     }
   }
 
+  /// Handle super index operations like `super.a = b`, `super.a += b`, and
+  /// `super.a++`.
+  // TODO(johnniwinther): Share code with [handleSuperIndexSendSet].
+  ResolutionResult handleSuperSendSet(SendSet node) {
+    Identifier selector = node.selector.asIdentifier();
+    String text = selector.source;
+    Name name = new Name(text, enclosingElement.library);
+    String operatorText = node.assignmentOperator.source;
+    Selector getterSelector = new Selector.getter(name);
+    Selector setterSelector = new Selector.setter(name);
+    AccessSemantics semantics = checkSuperAccess(node);
+    if (node.isPrefix || node.isPostfix) {
+      // `super.a++` or `++super.a`.
+      if (semantics == null) {
+        semantics = computeSuperAccessSemanticsForSelectors(
+            node, getterSelector, setterSelector);
+        registry.registerStaticInvocation(semantics.getter);
+        registry.registerStaticInvocation(semantics.setter);
+      }
+      return handleUpdate(node, name, semantics);
+    } else {
+      AssignmentOperator operator = AssignmentOperator.parse(operatorText);
+      if (operator.kind == AssignmentOperatorKind.ASSIGN) {
+        // `super.a = b`.
+        if (semantics == null) {
+          semantics =
+              computeSuperAccessSemanticsForSelector(
+                  node, setterSelector, alternateName: name);
+          registry.registerStaticInvocation(semantics.setter);
+          switch (semantics.kind) {
+            case AccessKind.SUPER_FINAL_FIELD:
+              reporter.reportWarningMessage(
+                  node,
+                  MessageKind.ASSIGNING_FINAL_FIELD_IN_SUPER,
+                  {'name': name,
+                   'superclassName': semantics.setter.enclosingClass.name});
+              // TODO(johnniwinther): This shouldn't be needed.
+              registry.registerDynamicInvocation(
+                  new UniverseSelector(setterSelector, null));
+              registry.registerSuperNoSuchMethod();
+              break;
+            case AccessKind.SUPER_METHOD:
+              reporter.reportWarningMessage(
+                  node, MessageKind.ASSIGNING_METHOD_IN_SUPER,
+                  {'name': name,
+                   'superclassName': semantics.setter.enclosingClass.name});
+              // TODO(johnniwinther): This shouldn't be needed.
+              registry.registerDynamicInvocation(
+                  new UniverseSelector(setterSelector, null));
+              registry.registerSuperNoSuchMethod();
+              break;
+            default:
+              registry.registerStaticInvocation(semantics.setter);
+              break;
+          }
+        }
+        return handleUpdate(node, name, semantics);
+      } else {
+        // `super.a += b`.
+        if (semantics == null) {
+          semantics = computeSuperAccessSemanticsForSelectors(
+              node, getterSelector, setterSelector);
+          registry.registerStaticInvocation(semantics.getter);
+          registry.registerStaticInvocation(semantics.setter);
+        }
+        return handleUpdate(node, name, semantics);
+      }
+    }
+  }
+
+  /// Handle update of an entity defined by [semantics]. For instance `a = b`,
+  /// `a++` or `a += b` where [semantics] describe `a`.
+  ResolutionResult handleUpdate(
+      SendSet node,
+      Name name,
+      AccessSemantics semantics) {
+    SendStructure sendStructure;
+    String operatorText = node.assignmentOperator.source;
+    Selector getterSelector = new Selector.getter(name);
+    Selector setterSelector = new Selector.setter(name);
+    if (node.isPrefix || node.isPostfix) {
+      // `e++` or `++e`.
+      IncDecOperator operator = IncDecOperator.parse(operatorText);
+      Selector operatorSelector =
+          new Selector.binaryOperator(operator.selectorName);
+
+      // TODO(23998): Remove these when selectors are only accessed
+      // through the send structure.
+      registry.setGetterSelectorInComplexSendSet(node, getterSelector);
+      registry.setSelector(node, setterSelector);
+      registry.setOperatorSelectorInComplexSendSet(node, operatorSelector);
+
+      // TODO(23998): Remove these when elements are only accessed
+      // through the send structure.
+      registry.useElement(node, semantics.setter);
+      registry.useElement(node.selector, semantics.getter);
+
+      registry.registerDynamicInvocation(
+          new UniverseSelector(operatorSelector, null));
+
+      SendStructure sendStructure = node.isPrefix
+          ? new PrefixStructure(semantics, operator)
+          : new PostfixStructure(semantics, operator);
+      registry.registerSendStructure(node, sendStructure);
+      registry.registerIncDecOperation();
+    } else {
+      Node rhs = node.arguments.head;
+      visitExpression(rhs);
+
+      AssignmentOperator operator = AssignmentOperator.parse(operatorText);
+      if (operator.kind == AssignmentOperatorKind.ASSIGN) {
+        // `e1 = e2`.
+
+        // TODO(23998): Remove these when elements are only accessed
+        // through the send structure.
+        registry.useElement(node, semantics.setter);
+
+        // TODO(23998): Remove this when selectors are only accessed
+        // through the send structure.
+        registry.setSelector(node, setterSelector);
+
+        SendStructure sendStructure = new SetStructure(semantics);
+        registry.registerSendStructure(node, sendStructure);
+      } else {
+        // `e1 += e2`.
+        Selector operatorSelector =
+            new Selector.binaryOperator(operator.selectorName);
+
+        // TODO(23998): Remove these when elements are only accessed
+        // through the send structure.
+        registry.useElement(node, semantics.setter);
+        registry.useElement(node.selector, semantics.getter);
+
+        // TODO(23998): Remove these when selectors are only accessed
+        // through the send structure.
+        registry.setGetterSelectorInComplexSendSet(node, getterSelector);
+        registry.setSelector(node, setterSelector);
+        registry.setOperatorSelectorInComplexSendSet(node, operatorSelector);
+
+        registry.registerDynamicInvocation(
+            new UniverseSelector(operatorSelector, null));
+
+        SendStructure sendStructure;
+        if (operator.kind == AssignmentOperatorKind.IF_NULL) {
+          sendStructure = new SetIfNullStructure(semantics);
+        } else {
+          sendStructure = new CompoundStructure(semantics, operator);
+        }
+        registry.registerSendStructure(node, sendStructure);
+      }
+    }
+    return new ResolutionResult.forElement(semantics.setter);
+  }
+
   ResolutionResult visitSendSet(SendSet node) {
     if (node.isIndex) {
+      // `a[b] = c`
       if (node.isSuperCall) {
+        // `super[b] = c`
         return handleSuperIndexSendSet(node);
       } else {
         return handleIndexSendSet(node);
       }
+    } else if (node.isSuperCall) {
+      // `super.a = c`
+      return handleSuperSendSet(node);
+    } else if (node.receiver == null) {
+      // `a = c`
+      return handleUnqualifiedSendSet(node);
+    } else {
+      // `a.b = c`
+      return handleQualifiedSendSet(node);
     }
-    return oldVisitSendSet(node);
-  }
-
-  ResolutionResult oldVisitSendSet(SendSet node) {
-    bool oldSendIsMemberAccess = sendIsMemberAccess;
-    sendIsMemberAccess = node.isPropertyAccess || node.isCall;
-    ResolutionResult result = resolveSend(node);
-    sendIsMemberAccess = oldSendIsMemberAccess;
-    Element target = result.element;
-    Element setter = target;
-    Element getter = target;
-    String operatorName = node.assignmentOperator.source;
-    String source = operatorName;
-    bool isComplex = !identical(source, '=');
-    if (!(result is AssertResult || Elements.isUnresolved(target))) {
-      if (target.isAbstractField) {
-        AbstractFieldElement field = target;
-        setter = field.setter;
-        getter = field.getter;
-        if (setter == null) {
-          if (!inInstanceContext || getter.isTopLevel || getter.isStatic) {
-            setter = reportAndCreateErroneousElement(node.selector, field.name,
-                MessageKind.CANNOT_RESOLVE_SETTER, const {});
-            registry.registerThrowNoSuchMethod();
-          }
-        }
-        if (isComplex && getter == null && !inInstanceContext) {
-          getter = reportAndCreateErroneousElement(node.selector, field.name,
-              MessageKind.CANNOT_RESOLVE_GETTER, const {});
-          registry.registerThrowNoSuchMethod();
-        }
-      } else if (target.impliesType) {
-        if (node.isIfNullAssignment) {
-          setter = reportAndCreateErroneousElement(node.selector, target.name,
-              MessageKind.IF_NULL_ASSIGNING_TYPE, const {});
-          // In this case, no assignment happens, the rest of the compiler can
-          // treat the expression `C ??= e` as if it's just reading `C`.
-        } else {
-          setter = reportAndCreateErroneousElement(node.selector, target.name,
-              MessageKind.ASSIGNING_TYPE, const {});
-          registry.registerThrowNoSuchMethod();
-        }
-        registerTypeLiteralAccess(node, target);
-      } else if (target.isFinal || target.isConst) {
-        if (Elements.isStaticOrTopLevelField(target) || target.isLocal) {
-          setter = reportAndCreateErroneousElement(
-              node.selector, target.name, MessageKind.CANNOT_RESOLVE_SETTER,
-              const {});
-        } else if (node.isSuperCall) {
-          setter = reportAndCreateErroneousElement(
-              node.selector, target.name, MessageKind.SETTER_NOT_FOUND_IN_SUPER,
-              {'name': target.name, 'className': currentClass.name});
-          registry.registerSuperNoSuchMethod();
-        } else {
-          // For instance fields we don't report a warning here because the type
-          // checker will detect this as well and report a better error message
-          // with the context of the containing class.
-        }
-        registry.registerThrowNoSuchMethod();
-      } else if (target.isFunction && target.name != '[]=') {
-        assert(!target.isSetter);
-        if (Elements.isStaticOrTopLevelFunction(target) || target.isLocal) {
-          setter = reportAndCreateErroneousElement(
-              node.selector, target.name, MessageKind.ASSIGNING_METHOD,
-              const {});
-        } else if (node.isSuperCall) {
-          setter = reportAndCreateErroneousElement(
-              node.selector, target.name, MessageKind.ASSIGNING_METHOD_IN_SUPER,
-              {'name': target.name,
-               'superclassName': target.enclosingElement.name});
-          registry.registerSuperNoSuchMethod();
-        } else {
-          // For instance methods we don't report a warning here because the
-          // type checker will detect this as well and report a better error
-          // message with the context of the containing class.
-        }
-        registry.registerThrowNoSuchMethod();
-      }
-      if (isPotentiallyMutableTarget(target)) {
-        registry.registerPotentialMutation(target, node);
-        if (enclosingElement != target.enclosingElement) {
-          registry.registerPotentialMutationInClosure(target, node);
-        }
-        for (Node scope in promotionScope) {
-          registry.registerPotentialMutationIn(scope, target, node);
-        }
-      }
-    }
-
-    resolveArguments(node.argumentsNode);
-
-    Selector selector = registry.getSelector(node);
-    if (isComplex) {
-      Selector getterSelector;
-      if (selector.isSetter) {
-        getterSelector = new Selector.getterFrom(selector);
-      } else {
-        assert(selector.isIndexSet);
-        getterSelector = new Selector.index();
-      }
-      registerSend(getterSelector, getter);
-      registry.setGetterSelectorInComplexSendSet(node, getterSelector);
-      if (node.isSuperCall) {
-        getter = currentClass.lookupSuperByName(getterSelector.memberName);
-        if (getter == null) {
-          target = reportAndCreateErroneousElement(
-              node, selector.name, MessageKind.NO_SUCH_SUPER_MEMBER,
-              {'className': currentClass.name, 'memberName': selector.name});
-          registry.registerSuperNoSuchMethod();
-        }
-      }
-      registry.useElement(node.selector, getter);
-
-      // Make sure we include the + and - operators if we are using
-      // the ++ and -- ones.  Also, if op= form is used, include op itself.
-      void registerBinaryOperator(String name) {
-        Selector binop = new Selector.binaryOperator(name);
-        registry.registerDynamicInvocation(
-            new UniverseSelector(binop, null));
-        registry.setOperatorSelectorInComplexSendSet(node, binop);
-      }
-      if (identical(source, '++')) {
-        registerBinaryOperator('+');
-        registry.registerInstantiatedClass(compiler.intClass);
-      } else if (identical(source, '--')) {
-        registerBinaryOperator('-');
-        registry.registerInstantiatedClass(compiler.intClass);
-      } else if (source.endsWith('=')) {
-        registerBinaryOperator(Elements.mapToUserOperator(operatorName));
-      }
-    }
-
-    registerSend(selector, setter);
-    return new ResolutionResult.forElement(registry.useElement(node, setter));
   }
 
   void registerSend(Selector selector, Element target) {
@@ -3078,7 +3537,8 @@
     String name = node.slowNameString;
     registry.registerConstSymbol(name);
     if (!validateSymbol(node, name, reportError: false)) {
-      compiler.reportError(node,
+      reporter.reportErrorMessage(
+          node,
           MessageKind.UNSUPPORTED_LITERAL_SYMBOL,
           {'value': name});
     }
@@ -3110,7 +3570,8 @@
 
   ResolutionResult visitRethrow(Rethrow node) {
     if (!inCatchBlock) {
-      error(node, MessageKind.THROW_WITHOUT_EXPRESSION);
+      reporter.reportErrorMessage(
+          node, MessageKind.THROW_WITHOUT_EXPRESSION);
     }
     return const NoneResult();
   }
@@ -3122,10 +3583,11 @@
         // It is a compile-time error if a return statement of the form
         // `return e;` appears in a generative constructor.  (Dart Language
         // Specification 13.12.)
-        compiler.reportError(expression,
-                             MessageKind.CANNOT_RETURN_FROM_CONSTRUCTOR);
+        reporter.reportErrorMessage(
+            expression,
+            MessageKind.CANNOT_RETURN_FROM_CONSTRUCTOR);
       } else if (!node.isArrowBody && currentAsyncMarker.isYielding) {
-        compiler.reportError(
+        reporter.reportErrorMessage(
             node,
             MessageKind.RETURN_IN_GENERATOR,
             {'modifier': currentAsyncMarker});
@@ -3136,8 +3598,8 @@
   }
 
   ResolutionResult visitYield(Yield node) {
-    compiler.streamClass.ensureResolved(compiler);
-    compiler.iterableClass.ensureResolved(compiler);
+    compiler.streamClass.ensureResolved(resolution);
+    compiler.iterableClass.ensureResolved(resolution);
     visit(node.expression);
     return const NoneResult();
   }
@@ -3145,16 +3607,16 @@
   ResolutionResult visitRedirectingFactoryBody(RedirectingFactoryBody node) {
     final isSymbolConstructor = enclosingElement == compiler.symbolConstructor;
     if (!enclosingElement.isFactoryConstructor) {
-      compiler.reportError(
+      reporter.reportErrorMessage(
           node, MessageKind.FACTORY_REDIRECTION_IN_NON_FACTORY);
-      compiler.reportHint(
+      reporter.reportHintMessage(
           enclosingElement, MessageKind.MISSING_FACTORY_KEYWORD);
     }
     ConstructorElementX constructor = enclosingElement;
     bool isConstConstructor = constructor.isConst;
     bool isValidAsConstant = isConstConstructor;
     ConstructorElement redirectionTarget = resolveRedirectingFactory(
-        node, inConstContext: isConstConstructor);
+        node, inConstContext: isConstConstructor).element;
     constructor.immediateRedirectionTarget = redirectionTarget;
 
     Node constructorReference = node.constructorReference;
@@ -3171,11 +3633,13 @@
     } else {
       if (isConstConstructor &&
           !redirectionTarget.isConst) {
-        compiler.reportError(node, MessageKind.CONSTRUCTOR_IS_NOT_CONST);
+        reporter.reportErrorMessage(
+            node, MessageKind.CONSTRUCTOR_IS_NOT_CONST);
         isValidAsConstant = false;
       }
       if (redirectionTarget == constructor) {
-        compiler.reportError(node, MessageKind.CYCLIC_REDIRECTING_FACTORY);
+        reporter.reportErrorMessage(
+            node, MessageKind.CYCLIC_REDIRECTING_FACTORY);
         // TODO(johnniwinther): Create constant constructor for this case and
         // let evaluation detect the cyclicity.
         isValidAsConstant = false;
@@ -3186,20 +3650,22 @@
     // redirecting constructor.
     ClassElement targetClass = redirectionTarget.enclosingClass;
     InterfaceType type = registry.getType(node);
-    FunctionType targetType = redirectionTarget.computeType(compiler)
+    FunctionType targetType = redirectionTarget.computeType(resolution)
         .subst(type.typeArguments, targetClass.typeVariables);
-    FunctionType constructorType = constructor.computeType(compiler);
+    FunctionType constructorType = constructor.computeType(resolution);
     bool isSubtype = compiler.types.isSubtype(targetType, constructorType);
     if (!isSubtype) {
-      warning(node, MessageKind.NOT_ASSIGNABLE,
-              {'fromType': targetType, 'toType': constructorType});
+      reporter.reportWarningMessage(
+          node,
+          MessageKind.NOT_ASSIGNABLE,
+          {'fromType': targetType, 'toType': constructorType});
       // TODO(johnniwinther): Handle this (potentially) erroneous case.
       isValidAsConstant = false;
     }
 
-    redirectionTarget.computeType(compiler);
+    redirectionTarget.computeType(resolution);
     FunctionSignature targetSignature = redirectionTarget.functionSignature;
-    constructor.computeType(compiler);
+    constructor.computeType(resolution);
     FunctionSignature constructorSignature = constructor.functionSignature;
     if (!targetSignature.isCompatibleWith(constructorSignature)) {
       assert(!isSubtype);
@@ -3254,7 +3720,7 @@
   }
 
   ResolutionResult visitAwait(Await node) {
-    compiler.futureClass.ensureResolved(compiler);
+    compiler.futureClass.ensureResolved(resolution);
     visit(node.expression);
     return const NoneResult();
   }
@@ -3282,7 +3748,8 @@
         }
       }
       assert(modifierNode != null);
-      compiler.reportError(modifierNode, MessageKind.EXTRANEOUS_MODIFIER,
+      reporter.reportErrorMessage(
+          modifierNode, MessageKind.EXTRANEOUS_MODIFIER,
           {'modifier': modifier});
     }
     if (modifiers.isFinal && (modifiers.isConst || modifiers.isVar)) {
@@ -3300,7 +3767,7 @@
       }
     }
     if (node.metadata != null) {
-      variables.metadata =
+      variables.metadataInternal =
           compiler.resolver.resolveMetadata(enclosingElement, node);
     }
     visitor.visit(node.definitions);
@@ -3332,7 +3799,7 @@
 
   ResolutionResult visitNewExpression(NewExpression node) {
     bool isValidAsConstant = true;
-    FunctionElement constructor = resolveConstructor(node);
+    ConstructorElement constructor = resolveConstructor(node).element;
     final bool isSymbolConstructor = constructor == compiler.symbolConstructor;
     final bool isMirrorsUsedConstant =
         node.isConst && (constructor == compiler.mirrorsUsedConstructor);
@@ -3348,7 +3815,7 @@
     if (Elements.isUnresolved(constructor)) {
       return new ResolutionResult.forElement(constructor);
     }
-    constructor.computeType(compiler);
+    constructor.computeType(resolution);
     if (!callSelector.applies(constructor, compiler.world)) {
       registry.registerThrowNoSuchMethod();
     }
@@ -3358,24 +3825,24 @@
     registry.registerStaticUse(constructor.declaration);
     ClassElement cls = constructor.enclosingClass;
     if (cls.isEnumClass && currentClass != cls) {
-      compiler.reportError(node,
-                           MessageKind.CANNOT_INSTANTIATE_ENUM,
-                           {'enumName': cls.name});
+      reporter.reportErrorMessage(
+          node,
+          MessageKind.CANNOT_INSTANTIATE_ENUM,
+          {'enumName': cls.name});
       isValidAsConstant = false;
     }
 
     InterfaceType type = registry.getType(node);
     if (node.isConst && type.containsTypeVariables) {
-      compiler.reportError(node.send.selector,
-                           MessageKind.TYPE_VARIABLE_IN_CONSTANT);
+      reporter.reportErrorMessage(
+          node.send.selector,
+          MessageKind.TYPE_VARIABLE_IN_CONSTANT);
       isValidAsConstant = false;
     }
     // TODO(johniwinther): Avoid registration of `type` in face of redirecting
     // factory constructors.
     registry.registerInstantiatedType(type);
     if (constructor.isGenerativeConstructor && cls.isAbstract) {
-      warning(node, MessageKind.ABSTRACT_CLASS_INSTANTIATION);
-      registry.registerAbstractClassInstantiation();
       isValidAsConstant = false;
     }
 
@@ -3388,8 +3855,10 @@
         ConstantValue name = compiler.constants.getConstantValue(constant);
         if (!name.isString) {
           DartType type = name.getType(coreTypes);
-          compiler.reportError(argumentNode, MessageKind.STRING_EXPECTED,
-                                   {'type': type});
+          reporter.reportErrorMessage(
+              argumentNode,
+              MessageKind.STRING_EXPECTED,
+              {'type': type});
         } else {
           StringConstantValue stringConstant = name;
           String nameString = stringConstant.toDartString().slowToString();
@@ -3400,17 +3869,31 @@
       } else {
         if (!compiler.mirrorUsageAnalyzerTask.hasMirrorUsage(
                 enclosingElement)) {
-          compiler.reportHint(
+          reporter.reportHintMessage(
               node.newToken, MessageKind.NON_CONST_BLOAT,
               {'name': compiler.symbolClass.name});
         }
-        registry.registerNewSymbol();
       }
     } else if (isMirrorsUsedConstant) {
       compiler.mirrorUsageAnalyzerTask.validate(node, registry.mapping);
     }
     if (node.isConst) {
       analyzeConstantDeferred(node);
+
+      // TODO(johnniwinther): Compute this in the [ConstructorResolver].
+      // Check that the constructor is not deferred.
+      Send send = node.send.selector.asSend();
+      if (send != null) {
+        // Of the form `const a.b(...)`.
+        if (compiler.deferredLoadTask.deferredPrefixElement(
+                send, registry.mapping) != null) {
+          // `a` is a deferred prefix.
+          isValidAsConstant = false;
+          // TODO(johnniwinther): Create an [ErroneousConstantExpression] here
+          // when constants are only created during resolution.
+        }
+      }
+
       if (isValidAsConstant &&
           constructor.isConst &&
           argumentsResult.isValidAsConstant) {
@@ -3439,9 +3922,10 @@
       if (cls == compiler.stringClass) continue;
       Element equals = cls.lookupMember('==');
       if (equals.enclosingClass != compiler.objectClass) {
-        compiler.reportError(spannable,
-                             MessageKind.CONST_MAP_KEY_OVERRIDES_EQUALS,
-                             {'type': keyType});
+        reporter.reportErrorMessage(
+            spannable,
+            MessageKind.CONST_MAP_KEY_OVERRIDES_EQUALS,
+            {'type': keyType});
       }
     }
   }
@@ -3460,25 +3944,6 @@
     if (value.isMap) {
       checkConstMapKeysDontOverrideEquals(node, value);
     }
-
-    // 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.
-    if (argumentsToJsInterceptorConstant != null &&
-        argumentsToJsInterceptorConstant.contains(node)) {
-      if (value.isType) {
-        TypeConstantValue typeConstant = value;
-        if (typeConstant.representedType is InterfaceType) {
-          registry.registerInstantiatedType(typeConstant.representedType);
-        } else {
-          compiler.reportError(node,
-              MessageKind.WRONG_ARGUMENT_FOR_JS_INTERCEPTOR_CONSTANT);
-        }
-      } else {
-        compiler.reportError(node,
-            MessageKind.WRONG_ARGUMENT_FOR_JS_INTERCEPTOR_CONSTANT);
-      }
-    }
   }
 
   void analyzeConstantDeferred(Node node, {bool enforceConst: true}) {
@@ -3491,15 +3956,15 @@
     if (name.isEmpty) return true;
     if (name.startsWith('_')) {
       if (reportError) {
-        compiler.reportError(node, MessageKind.PRIVATE_IDENTIFIER,
-                             {'value': name});
+        reporter.reportErrorMessage(
+            node, MessageKind.PRIVATE_IDENTIFIER, {'value': name});
       }
       return false;
     }
     if (!symbolValidationPattern.hasMatch(name)) {
       if (reportError) {
-        compiler.reportError(node, MessageKind.INVALID_SYMBOL,
-                             {'value': name});
+        reporter.reportErrorMessage(
+            node, MessageKind.INVALID_SYMBOL, {'value': name});
       }
       return false;
     }
@@ -3511,14 +3976,15 @@
    * Note: this function may return an ErroneousFunctionElement instead of
    * [:null:], if there is no corresponding constructor, class or library.
    */
-  ConstructorElement resolveConstructor(NewExpression node) {
-    return node.accept(new ConstructorResolver(compiler, this));
+  ConstructorResult resolveConstructor(NewExpression node) {
+    return node.accept(new ConstructorResolver(
+        compiler, this, inConstContext: node.isConst));
   }
 
-  ConstructorElement resolveRedirectingFactory(RedirectingFactoryBody node,
+  ConstructorResult resolveRedirectingFactory(RedirectingFactoryBody node,
                                                {bool inConstContext: false}) {
-    return node.accept(new ConstructorResolver(compiler, this,
-                                               inConstContext: inConstContext));
+    return node.accept(new ConstructorResolver(
+        compiler, this, inConstContext: inConstContext));
   }
 
   DartType resolveTypeAnnotation(TypeAnnotation node,
@@ -3528,7 +3994,7 @@
         this, node, malformedIsError: malformedIsError,
         deferredIsMalformed: deferredIsMalformed);
     if (inCheckContext) {
-      registry.registerIsCheck(type);
+      registry.registerCheckedModeCheck(type);
       registry.registerRequiredType(type, enclosingElement);
     }
     return type;
@@ -3544,12 +4010,14 @@
       Link<Node> nodes = arguments.nodes;
       if (nodes.isEmpty) {
         // The syntax [: <>[] :] is not allowed.
-        error(arguments, MessageKind.MISSING_TYPE_ARGUMENT);
+        reporter.reportErrorMessage(
+            arguments, MessageKind.MISSING_TYPE_ARGUMENT);
         isValidAsConstant = false;
       } else {
         typeArgument = resolveTypeAnnotation(nodes.head);
         for (nodes = nodes.tail; !nodes.isEmpty; nodes = nodes.tail) {
-          warning(nodes.head, MessageKind.ADDITIONAL_TYPE_ARGUMENT);
+          reporter.reportWarningMessage(
+              nodes.head, MessageKind.ADDITIONAL_TYPE_ARGUMENT);
           resolveTypeAnnotation(nodes.head);
         }
       }
@@ -3557,7 +4025,8 @@
     DartType listType;
     if (typeArgument != null) {
       if (node.isConst && typeArgument.containsTypeVariables) {
-        compiler.reportError(arguments.nodes.head,
+        reporter.reportErrorMessage(
+            arguments.nodes.head,
             MessageKind.TYPE_VARIABLE_IN_CONSTANT);
         isValidAsConstant = false;
       }
@@ -3565,8 +4034,11 @@
     } else {
       listType = coreTypes.listType();
     }
-    registry.setType(node, listType);
-    registry.registerInstantiatedType(listType);
+    registry.registerLiteralList(
+        node,
+        listType,
+        isConstant: node.isConst,
+        isEmpty: node.elements.isEmpty);
     registry.registerRequiredType(listType, enclosingElement);
     if (node.isConst) {
       List<ConstantExpression> constantExpressions = <ConstantExpression>[];
@@ -3618,7 +4090,7 @@
   ResolutionResult visitStringInterpolation(StringInterpolation node) {
     registry.registerInstantiatedType(coreTypes.stringType);
     registry.registerStringInterpolation();
-    registerImplicitInvocation('toString', 0);
+    registerImplicitInvocation(Selectors.toString_);
 
     bool isValidAsConstant = true;
     List<ConstantExpression> parts = <ConstantExpression>[];
@@ -3651,7 +4123,8 @@
     if (node.target == null) {
       target = statementScope.currentBreakTarget();
       if (target == null) {
-        error(node, MessageKind.NO_BREAK_TARGET);
+        reporter.reportErrorMessage(
+            node, MessageKind.NO_BREAK_TARGET);
         return const NoneResult();
       }
       target.isBreakTarget = true;
@@ -3659,12 +4132,14 @@
       String labelName = node.target.source;
       LabelDefinition label = statementScope.lookupLabel(labelName);
       if (label == null) {
-        error(node.target, MessageKind.UNBOUND_LABEL, {'labelName': labelName});
+        reporter.reportErrorMessage(
+            node.target, MessageKind.UNBOUND_LABEL, {'labelName': labelName});
         return const NoneResult();
       }
       target = label.target;
       if (!target.statement.isValidBreakTarget()) {
-        error(node.target, MessageKind.INVALID_BREAK);
+        reporter.reportErrorMessage(
+            node.target, MessageKind.INVALID_BREAK);
         return const NoneResult();
       }
       label.setBreakTarget();
@@ -3679,7 +4154,8 @@
     if (node.target == null) {
       target = statementScope.currentContinueTarget();
       if (target == null) {
-        error(node, MessageKind.NO_CONTINUE_TARGET);
+        reporter.reportErrorMessage(
+            node, MessageKind.NO_CONTINUE_TARGET);
         return const NoneResult();
       }
       target.isContinueTarget = true;
@@ -3687,12 +4163,14 @@
       String labelName = node.target.source;
       LabelDefinition label = statementScope.lookupLabel(labelName);
       if (label == null) {
-        error(node.target, MessageKind.UNBOUND_LABEL, {'labelName': labelName});
+        reporter.reportErrorMessage(
+            node.target, MessageKind.UNBOUND_LABEL, {'labelName': labelName});
         return const NoneResult();
       }
       target = label.target;
       if (!target.statement.isValidContinueTarget()) {
-        error(node.target, MessageKind.INVALID_CONTINUE);
+        reporter.reportErrorMessage(
+            node.target, MessageKind.INVALID_CONTINUE);
       }
       label.setContinueTarget();
       registry.useLabel(node, label);
@@ -3701,19 +4179,18 @@
     return const NoneResult();
   }
 
-  registerImplicitInvocation(String name, int arity) {
-    Selector selector = new Selector.call(name, null, arity);
+  registerImplicitInvocation(Selector selector) {
     registry.registerDynamicInvocation(new UniverseSelector(selector, null));
   }
 
   ResolutionResult visitAsyncForIn(AsyncForIn node) {
     registry.registerAsyncForIn(node);
-    registry.setCurrentSelector(node, compiler.currentSelector);
+    registry.setCurrentSelector(node, Selectors.current);
     registry.registerDynamicGetter(
-        new UniverseSelector(compiler.currentSelector, null));
-    registry.setMoveNextSelector(node, compiler.moveNextSelector);
+        new UniverseSelector(Selectors.current, null));
+    registry.setMoveNextSelector(node, Selectors.moveNext);
     registry.registerDynamicInvocation(
-        new UniverseSelector(compiler.moveNextSelector, null));
+        new UniverseSelector(Selectors.moveNext, null));
 
     visit(node.expression);
 
@@ -3725,15 +4202,15 @@
 
   ResolutionResult visitSyncForIn(SyncForIn node) {
     registry.registerSyncForIn(node);
-    registry.setIteratorSelector(node, compiler.iteratorSelector);
+    registry.setIteratorSelector(node, Selectors.iterator);
     registry.registerDynamicGetter(
-        new UniverseSelector(compiler.iteratorSelector, null));
-    registry.setCurrentSelector(node, compiler.currentSelector);
+        new UniverseSelector(Selectors.iterator, null));
+    registry.setCurrentSelector(node, Selectors.current);
     registry.registerDynamicGetter(
-        new UniverseSelector(compiler.currentSelector, null));
-    registry.setMoveNextSelector(node, compiler.moveNextSelector);
+        new UniverseSelector(Selectors.current, null));
+    registry.setMoveNextSelector(node, Selectors.moveNext);
     registry.registerDynamicInvocation(
-        new UniverseSelector(compiler.moveNextSelector, null));
+        new UniverseSelector(Selectors.moveNext, null));
 
     visit(node.expression);
 
@@ -3763,28 +4240,35 @@
       loopVariable = registry.getDefinition(send);
       Identifier identifier = send.selector.asIdentifier();
       if (identifier == null) {
-        compiler.reportError(send.selector, MessageKind.INVALID_FOR_IN);
+        reporter.reportErrorMessage(
+            send.selector, MessageKind.INVALID_FOR_IN);
       } else {
-        loopVariableSelector = new Selector.setter(identifier.source, library);
+        loopVariableSelector = new Selector.setter(
+            new Name(identifier.source, library));
       }
       if (send.receiver != null) {
-        compiler.reportError(send.receiver, MessageKind.INVALID_FOR_IN);
+        reporter.reportErrorMessage(
+            send.receiver, MessageKind.INVALID_FOR_IN);
       }
     } else if (variableDefinitions != null) {
       Link<Node> nodes = variableDefinitions.definitions.nodes;
       if (!nodes.tail.isEmpty) {
-        compiler.reportError(nodes.tail.head, MessageKind.INVALID_FOR_IN);
+        reporter.reportErrorMessage(
+            nodes.tail.head, MessageKind.INVALID_FOR_IN);
       }
       Node first = nodes.head;
       Identifier identifier = first.asIdentifier();
       if (identifier == null) {
-        compiler.reportError(first, MessageKind.INVALID_FOR_IN);
+        reporter.reportErrorMessage(
+            first, MessageKind.INVALID_FOR_IN);
       } else {
-        loopVariableSelector = new Selector.setter(identifier.source, library);
+        loopVariableSelector = new Selector.setter(
+            new Name(identifier.source, library));
         loopVariable = registry.getDefinition(identifier);
       }
     } else {
-      compiler.reportError(declaration, MessageKind.INVALID_FOR_IN);
+      reporter.reportErrorMessage(
+          declaration, MessageKind.INVALID_FOR_IN);
     }
     if (loopVariableSelector != null) {
       registry.setSelector(declaration, loopVariableSelector);
@@ -3820,8 +4304,10 @@
       if (element.isTarget) {
         registry.defineLabel(element.label, element);
       } else {
-        warning(element.label, MessageKind.UNUSED_LABEL,
-                {'labelName': labelName});
+        reporter.reportWarningMessage(
+            element.label,
+            MessageKind.UNUSED_LABEL,
+            {'labelName': labelName});
       }
     });
     if (!targetElement.isTarget) {
@@ -3841,17 +4327,20 @@
       Link<Node> nodes = arguments.nodes;
       if (nodes.isEmpty) {
         // The syntax [: <>{} :] is not allowed.
-        error(arguments, MessageKind.MISSING_TYPE_ARGUMENT);
+        reporter.reportErrorMessage(
+            arguments, MessageKind.MISSING_TYPE_ARGUMENT);
         isValidAsConstant = false;
       } else {
         keyTypeArgument = resolveTypeAnnotation(nodes.head);
         nodes = nodes.tail;
         if (nodes.isEmpty) {
-          warning(arguments, MessageKind.MISSING_TYPE_ARGUMENT);
+          reporter.reportWarningMessage(
+              arguments, MessageKind.MISSING_TYPE_ARGUMENT);
         } else {
           valueTypeArgument = resolveTypeAnnotation(nodes.head);
           for (nodes = nodes.tail; !nodes.isEmpty; nodes = nodes.tail) {
-            warning(nodes.head, MessageKind.ADDITIONAL_TYPE_ARGUMENT);
+            reporter.reportWarningMessage(
+                nodes.head, MessageKind.ADDITIONAL_TYPE_ARGUMENT);
             resolveTypeAnnotation(nodes.head);
           }
         }
@@ -3864,11 +4353,16 @@
       mapType = coreTypes.mapType();
     }
     if (node.isConst && mapType.containsTypeVariables) {
-      compiler.reportError(arguments,
+      reporter.reportErrorMessage(
+          arguments,
           MessageKind.TYPE_VARIABLE_IN_CONSTANT);
       isValidAsConstant = false;
     }
-    registry.registerMapLiteral(node, mapType, node.isConst);
+    registry.registerMapLiteral(
+        node,
+        mapType,
+        isConstant: node.isConst,
+        isEmpty: node.entries.isEmpty);
     registry.registerRequiredType(mapType, enclosingElement);
     if (node.isConst) {
 
@@ -3933,7 +4427,8 @@
   void checkCaseExpressions(SwitchStatement node) {
     CaseMatch firstCase = null;
     DartType firstCaseType = null;
-    bool hasReportedProblem = false;
+    DiagnosticMessage error;
+    List<DiagnosticMessage> infos = <DiagnosticMessage>[];
 
     for (Link<Node> cases = node.cases.nodes;
          !cases.isEmpty;
@@ -3960,38 +4455,43 @@
           // We only report the bad type on the first class element. All others
           // get a "type differs" error.
           if (caseType.element == compiler.doubleClass) {
-            compiler.reportError(node,
-                                 MessageKind.SWITCH_CASE_VALUE_OVERRIDES_EQUALS,
-                                 {'type': "double"});
+            reporter.reportErrorMessage(
+                node,
+                MessageKind.SWITCH_CASE_VALUE_OVERRIDES_EQUALS,
+                {'type': "double"});
           } else if (caseType.element == compiler.functionClass) {
-            compiler.reportError(node, MessageKind.SWITCH_CASE_FORBIDDEN,
-                                 {'type': "Function"});
+            reporter.reportErrorMessage(
+                node, MessageKind.SWITCH_CASE_FORBIDDEN,
+                {'type': "Function"});
           } else if (value.isObject && overridesEquals(caseType)) {
-            compiler.reportError(firstCase.expression,
+            reporter.reportErrorMessage(
+                firstCase.expression,
                 MessageKind.SWITCH_CASE_VALUE_OVERRIDES_EQUALS,
                 {'type': caseType});
           }
         } else {
           if (caseType != firstCaseType) {
-            if (!hasReportedProblem) {
-              compiler.reportError(
+            if (error == null) {
+              error = reporter.createMessage(
                   node,
                   MessageKind.SWITCH_CASE_TYPES_NOT_EQUAL,
                   {'type': firstCaseType});
-              compiler.reportInfo(
+              infos.add(reporter.createMessage(
                   firstCase.expression,
                   MessageKind.SWITCH_CASE_TYPES_NOT_EQUAL_CASE,
-                  {'type': firstCaseType});
-              hasReportedProblem = true;
+                  {'type': firstCaseType}));
             }
-            compiler.reportInfo(
+            infos.add(reporter.createMessage(
                 caseMatch.expression,
                 MessageKind.SWITCH_CASE_TYPES_NOT_EQUAL_CASE,
-                {'type': caseType});
+                {'type': caseType}));
           }
         }
       }
     }
+    if (error != null) {
+      reporter.reportError(error, infos);
+    }
   }
 
   ResolutionResult visitSwitchStatement(SwitchStatement node) {
@@ -4014,22 +4514,32 @@
         LabelDefinition existingElement = continueLabels[labelName];
         if (existingElement != null) {
           // It's an error if the same label occurs twice in the same switch.
-          compiler.reportError(
-              label,
-              MessageKind.DUPLICATE_LABEL, {'labelName': labelName});
-          compiler.reportInfo(
-              existingElement.label,
-              MessageKind.EXISTING_LABEL, {'labelName': labelName});
+          reporter.reportError(
+              reporter.createMessage(
+                  label,
+                  MessageKind.DUPLICATE_LABEL,
+                  {'labelName': labelName}),
+              <DiagnosticMessage>[
+                  reporter.createMessage(
+                    existingElement.label,
+                    MessageKind.EXISTING_LABEL,
+                    {'labelName': labelName}),
+              ]);
         } else {
           // It's only a warning if it shadows another label.
           existingElement = statementScope.lookupLabel(labelName);
           if (existingElement != null) {
-            compiler.reportWarning(
-                label,
-                MessageKind.DUPLICATE_LABEL, {'labelName': labelName});
-            compiler.reportInfo(
-                existingElement.label,
-                MessageKind.EXISTING_LABEL, {'labelName': labelName});
+            reporter.reportWarning(
+                reporter.createMessage(
+                    label,
+                    MessageKind.DUPLICATE_LABEL,
+                    {'labelName': labelName}),
+                <DiagnosticMessage>[
+                    reporter.createMessage(
+                        existingElement.label,
+                        MessageKind.EXISTING_LABEL,
+                        {'labelName': labelName}),
+                ]);
           }
         }
 
@@ -4041,7 +4551,8 @@
       cases = cases.tail;
       // Test that only the last case, if any, is a default case.
       if (switchCase.defaultKeyword != null && !cases.isEmpty) {
-        error(switchCase, MessageKind.INVALID_CASE_DEFAULT);
+        reporter.reportErrorMessage(
+            switchCase, MessageKind.INVALID_CASE_DEFAULT);
       }
     }
 
@@ -4080,9 +4591,14 @@
   }
 
   ResolutionResult visitTryStatement(TryStatement node) {
+    // TODO(karlklose): also track the information about mutated variables,
+    // catch, and finally-block.
+    registry.registerTryStatement();
+
     visit(node.tryBlock);
     if (node.catchBlocks.isEmpty && node.finallyBlock == null) {
-      error(node.getEndToken().next, MessageKind.NO_CATCH_NOR_FINALLY);
+      reporter.reportErrorMessage(
+          node.getEndToken().next, MessageKind.NO_CATCH_NOR_FINALLY);
     }
     visit(node.catchBlocks);
     visit(node.finallyBlock);
@@ -4098,7 +4614,8 @@
     if (node.formals != null) {
       Link<Node> formalsToProcess = node.formals.nodes;
       if (formalsToProcess.isEmpty) {
-        error(node, MessageKind.EMPTY_CATCH_DECLARATION);
+        reporter.reportErrorMessage(
+            node, MessageKind.EMPTY_CATCH_DECLARATION);
       } else {
         exceptionDefinition = formalsToProcess.head.asVariableDefinitions();
         formalsToProcess = formalsToProcess.tail;
@@ -4107,7 +4624,8 @@
           formalsToProcess = formalsToProcess.tail;
           if (!formalsToProcess.isEmpty) {
             for (Node extra in formalsToProcess) {
-              error(extra, MessageKind.EXTRA_CATCH_DECLARATION);
+              reporter.reportErrorMessage(
+                  extra, MessageKind.EXTRA_CATCH_DECLARATION);
             }
           }
           registry.registerStackTraceInCatch();
@@ -4123,15 +4641,18 @@
         // sequence of optional parameters.
         NodeList nodeList = link.head.asNodeList();
         if (nodeList != null) {
-          error(nodeList, MessageKind.OPTIONAL_PARAMETER_IN_CATCH);
+          reporter.reportErrorMessage(
+              nodeList, MessageKind.OPTIONAL_PARAMETER_IN_CATCH);
         } else {
           VariableDefinitions declaration = link.head;
           for (Node modifier in declaration.modifiers.nodes) {
-            error(modifier, MessageKind.PARAMETER_WITH_MODIFIER_IN_CATCH);
+            reporter.reportErrorMessage(
+                modifier, MessageKind.PARAMETER_WITH_MODIFIER_IN_CATCH);
           }
           TypeAnnotation type = declaration.type;
           if (type != null) {
-            error(type, MessageKind.PARAMETER_WITH_TYPE_IN_CATCH);
+            reporter.reportErrorMessage(
+                type, MessageKind.PARAMETER_WITH_TYPE_IN_CATCH);
           }
         }
       }
@@ -4164,7 +4685,7 @@
 }
 
 /// Looks up [name] in [scope] and unwraps the result.
-Element lookupInScope(Compiler compiler, Node node,
+Element lookupInScope(DiagnosticReporter reporter, Node node,
                       Scope scope, String name) {
-  return Elements.unwrap(scope.lookup(name), compiler, node);
+  return Elements.unwrap(scope.lookup(name), reporter, node);
 }
diff --git a/pkg/compiler/lib/src/resolution/operators.dart b/pkg/compiler/lib/src/resolution/operators.dart
index ac202aa..6486262 100644
--- a/pkg/compiler/lib/src/resolution/operators.dart
+++ b/pkg/compiler/lib/src/resolution/operators.dart
@@ -5,7 +5,11 @@
 library dart2js.operators;
 
 import '../elements/elements.dart';
-import '../universe/universe.dart';
+import '../universe/call_structure.dart' show
+    CallStructure;
+import '../universe/selector.dart' show
+    Selector,
+    SelectorKind;
 
 enum UnaryOperatorKind {
   NOT,
diff --git a/pkg/compiler/lib/src/resolution/registry.dart b/pkg/compiler/lib/src/resolution/registry.dart
index 36c4618..b93c6e9 100644
--- a/pkg/compiler/lib/src/resolution/registry.dart
+++ b/pkg/compiler/lib/src/resolution/registry.dart
@@ -2,14 +2,46 @@
 // for 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 resolution;
+library dart2js.resolution.registry;
 
-/// [ResolutionRegistry] collects all resolution information. It stores node
-/// related information in a [TreeElements] mapping and registers calls with
-/// [Backend], [World] and [Enqueuer].
-// TODO(johnniwinther): Split this into an interface and implementation class.
+import '../common.dart';
+import '../common/backend_api.dart' show
+    Backend,
+    ForeignResolver;
+import '../common/resolution.dart' show
+    Feature,
+    ListLiteralUse,
+    MapLiteralUse,
+    ResolutionImpact;
+import '../common/registry.dart' show
+    Registry;
+import '../compiler.dart' show
+    Compiler;
+import '../constants/expressions.dart';
+import '../dart_types.dart';
+import '../enqueue.dart' show
+    ResolutionEnqueuer;
+import '../elements/elements.dart';
+import '../tree/tree.dart';
+import '../util/util.dart' show
+    Setlet;
+import '../universe/call_structure.dart' show
+    CallStructure;
+import '../universe/selector.dart' show
+    Selector;
+import '../universe/universe.dart' show
+    UniverseSelector;
+import '../world.dart' show World;
 
-class EagerRegistry implements Registry {
+import 'send_structure.dart';
+
+import 'members.dart' show
+    ResolverVisitor;
+import 'tree_elements.dart' show
+    TreeElementMapping;
+
+// TODO(johnniwinther): Remove this.
+class EagerRegistry extends Registry {
   final Compiler compiler;
   final TreeElementMapping mapping;
 
@@ -21,14 +53,6 @@
   bool get isForResolution => true;
 
   @override
-  Iterable<Element> get otherDependencies => mapping.otherDependencies;
-
-  @override
-  void registerDependency(Element element) {
-    mapping.registerDependency(element);
-  }
-
-  @override
   void registerDynamicGetter(UniverseSelector selector) {
     world.registerDynamicGetter(selector);
   }
@@ -50,8 +74,7 @@
 
   @override
   void registerInstantiation(InterfaceType type) {
-    // TODO(johnniwinther): Remove the need for passing `this`.
-    world.registerInstantiatedType(type, this);
+    world.registerInstantiatedType(type);
   }
 
   @override
@@ -59,22 +82,42 @@
     registerDependency(element);
     world.registerStaticUse(element);
   }
+
+  String toString() => 'EagerRegistry for ${mapping.analyzedElement}';
 }
 
-class ResolutionWorldImpact implements WorldImpact {
+class _ResolutionWorldImpact implements ResolutionImpact {
   final Registry registry;
+  // TODO(johnniwinther): Do we benefit from lazy initialization of the
+  // [Setlet]s?
   Setlet<UniverseSelector> _dynamicInvocations;
   Setlet<UniverseSelector> _dynamicGetters;
   Setlet<UniverseSelector> _dynamicSetters;
   Setlet<InterfaceType> _instantiatedTypes;
   Setlet<Element> _staticUses;
-  Setlet<DartType> _checkedTypes;
+  Setlet<DartType> _isChecks;
+  Setlet<DartType> _asCasts;
+  Setlet<DartType> _checkedModeChecks;
   Setlet<MethodElement> _closurizedFunctions;
+  Setlet<LocalFunctionElement> _closures;
+  Setlet<Feature> _features;
+  // TODO(johnniwinther): This seems to be a union of other sets.
+  Setlet<DartType> _requiredTypes;
+  Setlet<MapLiteralUse> _mapLiterals;
+  Setlet<ListLiteralUse> _listLiterals;
+  Setlet<DartType> _typeLiterals;
+  Setlet<String> _constSymbolNames;
 
-  ResolutionWorldImpact(Compiler compiler, TreeElementMapping mapping)
+  _ResolutionWorldImpact(Compiler compiler, TreeElementMapping mapping)
       : this.registry = new EagerRegistry(compiler, mapping);
 
+  void registerDependency(Element element) {
+    assert(element != null);
+    registry.registerDependency(element);
+  }
+
   void registerDynamicGetter(UniverseSelector selector) {
+    assert(selector != null);
     if (_dynamicGetters == null) {
       _dynamicGetters = new Setlet<UniverseSelector>();
     }
@@ -88,6 +131,7 @@
   }
 
   void registerDynamicInvocation(UniverseSelector selector) {
+    assert(selector != null);
     if (_dynamicInvocations == null) {
       _dynamicInvocations = new Setlet<UniverseSelector>();
     }
@@ -101,6 +145,7 @@
   }
 
   void registerDynamicSetter(UniverseSelector selector) {
+    assert(selector != null);
     if (_dynamicSetters == null) {
       _dynamicSetters = new Setlet<UniverseSelector>();
     }
@@ -114,10 +159,7 @@
   }
 
   void registerInstantiatedType(InterfaceType type) {
-    // TODO(johnniwinther): Enable this when registration doesn't require a
-    // [Registry].
-    throw new UnsupportedError(
-        'Lazy registration of instantiated not supported.');
+    assert(type != null);
     if (_instantiatedTypes == null) {
       _instantiatedTypes = new Setlet<InterfaceType>();
     }
@@ -130,7 +172,64 @@
         ? _instantiatedTypes : const <InterfaceType>[];
   }
 
+  void registerTypeLiteral(DartType type) {
+    assert(type != null);
+    if (_typeLiterals == null) {
+      _typeLiterals = new Setlet<DartType>();
+    }
+    _typeLiterals.add(type);
+  }
+
+  @override
+  Iterable<DartType> get typeLiterals {
+    return _typeLiterals != null
+        ? _typeLiterals : const <DartType>[];
+  }
+
+  void registerRequiredType(DartType type) {
+    assert(type != null);
+    if (_requiredTypes == null) {
+      _requiredTypes = new Setlet<DartType>();
+    }
+    _requiredTypes.add(type);
+  }
+
+  @override
+  Iterable<DartType> get requiredTypes {
+    return _requiredTypes != null
+        ? _requiredTypes : const <DartType>[];
+  }
+
+  void registerMapLiteral(MapLiteralUse mapLiteralUse) {
+    assert(mapLiteralUse != null);
+    if (_mapLiterals == null) {
+      _mapLiterals = new Setlet<MapLiteralUse>();
+    }
+    _mapLiterals.add(mapLiteralUse);
+  }
+
+  @override
+  Iterable<MapLiteralUse> get mapLiterals {
+    return _mapLiterals != null
+        ? _mapLiterals : const <MapLiteralUse>[];
+  }
+
+  void registerListLiteral(ListLiteralUse listLiteralUse) {
+    assert(listLiteralUse != null);
+    if (_listLiterals == null) {
+      _listLiterals = new Setlet<ListLiteralUse>();
+    }
+    _listLiterals.add(listLiteralUse);
+  }
+
+  @override
+  Iterable<ListLiteralUse> get listLiterals {
+    return _listLiterals != null
+        ? _listLiterals : const <ListLiteralUse>[];
+  }
+
   void registerStaticUse(Element element) {
+    assert(element != null);
     if (_staticUses == null) {
       _staticUses = new Setlet<Element>();
     }
@@ -142,17 +241,44 @@
     return _staticUses != null ? _staticUses : const <Element>[];
   }
 
-  void registerCheckedType(DartType type) {
-    if (_checkedTypes == null) {
-      _checkedTypes = new Setlet<DartType>();
+  void registerIsCheck(DartType type) {
+    assert(type != null);
+    if (_isChecks == null) {
+      _isChecks = new Setlet<DartType>();
     }
-    _checkedTypes.add(type);
+    _isChecks.add(type);
   }
 
   @override
-  Iterable<DartType> get checkedTypes {
-    return _checkedTypes != null
-        ? _checkedTypes : const <DartType>[];
+  Iterable<DartType> get isChecks {
+    return _isChecks != null
+        ? _isChecks : const <DartType>[];
+  }
+
+  void registerAsCast(DartType type) {
+    if (_asCasts == null) {
+      _asCasts = new Setlet<DartType>();
+    }
+    _asCasts.add(type);
+  }
+
+  @override
+  Iterable<DartType> get asCasts {
+    return _asCasts != null
+        ? _asCasts : const <DartType>[];
+  }
+
+  void registerCheckedModeCheckedType(DartType type) {
+    if (_checkedModeChecks == null) {
+      _checkedModeChecks = new Setlet<DartType>();
+    }
+    _checkedModeChecks.add(type);
+  }
+
+  @override
+  Iterable<DartType> get checkedModeChecks {
+    return _checkedModeChecks != null
+        ? _checkedModeChecks : const <DartType>[];
   }
 
   void registerClosurizedFunction(MethodElement element) {
@@ -167,20 +293,61 @@
     return _closurizedFunctions != null
         ? _closurizedFunctions : const <MethodElement>[];
   }
+
+  void registerClosure(LocalFunctionElement element) {
+    if (_closures == null) {
+      _closures = new Setlet<LocalFunctionElement>();
+    }
+    _closures.add(element);
+  }
+
+  @override
+  Iterable<LocalFunctionElement> get closures {
+    return _closures != null
+        ? _closures : const <LocalFunctionElement>[];
+  }
+
+  void registerConstSymbolName(String name) {
+    if (_constSymbolNames == null) {
+      _constSymbolNames = new Setlet<String>();
+    }
+    _constSymbolNames.add(name);
+  }
+
+  @override
+  Iterable<String> get constSymbolNames {
+    return _constSymbolNames != null
+        ? _constSymbolNames : const <String>[];
+  }
+
+  void registerFeature(Feature feature) {
+    if (_features == null) {
+      _features = new Setlet<Feature>();
+    }
+    _features.add(feature);
+  }
+
+  @override
+  Iterable<Feature> get features {
+    return _features != null ? _features : const <Feature>[];
+  }
+
+  String toString() => '$registry';
 }
 
-class ResolutionRegistry implements Registry {
+/// [ResolutionRegistry] collects all resolution information. It stores node
+/// 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 {
   final Compiler compiler;
   final TreeElementMapping mapping;
-  final ResolutionWorldImpact worldImpact;
+  final _ResolutionWorldImpact worldImpact;
 
-  ResolutionRegistry(Compiler compiler, Element element)
-      : this.internal(compiler, _ensureTreeElements(element));
-
-  ResolutionRegistry.internal(Compiler compiler, TreeElementMapping mapping)
+  ResolutionRegistry(Compiler compiler, TreeElementMapping mapping)
       : this.compiler = compiler,
         this.mapping = mapping,
-        this.worldImpact = new ResolutionWorldImpact(compiler, mapping);
+        this.worldImpact = new _ResolutionWorldImpact(compiler, mapping);
 
   bool get isForResolution => true;
 
@@ -190,6 +357,8 @@
 
   Backend get backend => compiler.backend;
 
+  String toString() => 'ResolutionRegistry for ${mapping.analyzedElement}';
+
   //////////////////////////////////////////////////////////////////////////////
   //  Node-to-Element mapping functionality.
   //////////////////////////////////////////////////////////////////////////////
@@ -363,52 +532,61 @@
   }
 
   void registerImplicitSuperCall(FunctionElement superConstructor) {
-    universe.registerImplicitSuperCall(this, superConstructor);
+    registerDependency(superConstructor);
   }
 
   // TODO(johnniwinther): Remove this.
   // Use [registerInstantiatedType] of `rawType` instead.
   @deprecated
   void registerInstantiatedClass(ClassElement element) {
-    element.ensureResolved(compiler);
+    element.ensureResolved(compiler.resolution);
     registerInstantiatedType(element.rawType);
   }
 
   void registerLazyField() {
-    backend.resolutionCallbacks.onLazyField(this);
+    worldImpact.registerFeature(Feature.LAZY_FIELD);
   }
 
-  void registerMetadataConstant(MetadataAnnotation metadata,
-                                Element annotatedElement) {
-    backend.registerMetadataConstant(metadata, annotatedElement, this);
+  void registerMetadataConstant(MetadataAnnotation metadata) {
+    backend.registerMetadataConstant(metadata, metadata.annotatedElement, this);
   }
 
   void registerThrowRuntimeError() {
-    backend.resolutionCallbacks.onThrowRuntimeError(this);
+    worldImpact.registerFeature(Feature.THROW_RUNTIME_ERROR);
+  }
+
+  void registerCompileTimeError(ErroneousElement error) {
+    worldImpact.registerFeature(Feature.COMPILE_TIME_ERROR);
   }
 
   void registerTypeVariableBoundCheck() {
-    backend.resolutionCallbacks.onTypeVariableBoundCheck(this);
+    worldImpact.registerFeature(Feature.TYPE_VARIABLE_BOUNDS_CHECK);
   }
 
   void registerThrowNoSuchMethod() {
-    backend.resolutionCallbacks.onThrowNoSuchMethod(this);
+    worldImpact.registerFeature(Feature.THROW_NO_SUCH_METHOD);
   }
 
-  void registerIsCheck(DartType type) {
-    worldImpact.registerCheckedType(type);
-    backend.resolutionCallbacks.onIsCheck(type, this);
+  /// Register a checked mode check against [type].
+  void registerCheckedModeCheck(DartType type) {
+    worldImpact.registerCheckedModeCheckedType(type);
     mapping.addRequiredType(type);
   }
 
-  void registerAsCheck(DartType type) {
-    registerIsCheck(type);
-    backend.resolutionCallbacks.onAsCheck(type, this);
+  /// Register an is-test or is-not-test of [type].
+  void registerIsCheck(DartType type) {
+    worldImpact.registerIsCheck(type);
+    mapping.addRequiredType(type);
+  }
+
+  /// Register an as-cast of [type].
+  void registerAsCast(DartType type) {
+    worldImpact.registerAsCast(type);
     mapping.addRequiredType(type);
   }
 
   void registerClosure(LocalFunctionElement element) {
-    world.registerClosure(element, this);
+    worldImpact.registerClosure(element);
   }
 
   void registerSuperUse(Node node) {
@@ -420,44 +598,39 @@
   }
 
   void registerSuperNoSuchMethod() {
-    backend.resolutionCallbacks.onSuperNoSuchMethod(this);
-  }
-
-  void registerClassUsingVariableExpression(ClassElement element) {
-    backend.registerClassUsingVariableExpression(element);
-  }
-
-  void registerTypeVariableExpression() {
-    backend.resolutionCallbacks.onTypeVariableExpression(this);
+    worldImpact.registerFeature(Feature.SUPER_NO_SUCH_METHOD);
   }
 
   void registerTypeLiteral(Send node, DartType type) {
     mapping.setType(node, type);
-    backend.resolutionCallbacks.onTypeLiteral(type, this);
-    world.registerInstantiatedType(compiler.coreTypes.typeType, this);
+    worldImpact.registerTypeLiteral(type);
   }
 
-  void registerMapLiteral(Node node, DartType type, bool isConstant) {
+  void registerLiteralList(Node node,
+                           InterfaceType type,
+                           {bool isConstant,
+                            bool isEmpty}) {
     setType(node, type);
-    backend.resolutionCallbacks.onMapLiteral(this, type, isConstant);
+    worldImpact.registerListLiteral(
+        new ListLiteralUse(type, isConstant: isConstant, isEmpty: isEmpty));
   }
 
-  // TODO(johnniwinther): Remove the [ResolverVisitor] dependency. Its only
-  // needed to lookup types in the current scope.
-  void registerJsCall(Node node, ResolverVisitor visitor) {
-    world.registerJsCall(node, visitor);
+  void registerMapLiteral(Node node,
+                          InterfaceType type,
+                          {bool isConstant,
+                           bool isEmpty}) {
+    setType(node, type);
+    worldImpact.registerMapLiteral(
+        new MapLiteralUse(type, isConstant: isConstant, isEmpty: isEmpty));
   }
 
-  // TODO(johnniwinther): Remove the [ResolverVisitor] dependency. Its only
-  // needed to lookup types in the current scope.
-  void registerJsEmbeddedGlobalCall(Node node, ResolverVisitor visitor) {
-    world.registerJsEmbeddedGlobalCall(node, visitor);
-  }
-
-  // TODO(johnniwinther): Remove the [ResolverVisitor] dependency. Its only
-  // needed to lookup types in the current scope.
-  void registerJsBuiltinCall(Node node, ResolverVisitor visitor) {
-    world.registerJsBuiltinCall(node, visitor);
+  void registerForeignCall(Node node,
+                           Element element,
+                           CallStructure callStructure,
+                           ResolverVisitor visitor) {
+    backend.registerForeignCall(
+        node, element, callStructure,
+        new ForeignResolutionResolver(visitor, this));
   }
 
   void registerGetOfStaticFunction(FunctionElement element) {
@@ -465,57 +638,55 @@
   }
 
   void registerDynamicGetter(UniverseSelector selector) {
+    assert(selector.selector.isGetter);
     worldImpact.registerDynamicGetter(selector);
   }
 
   void registerDynamicSetter(UniverseSelector selector) {
+    assert(selector.selector.isSetter);
     worldImpact.registerDynamicSetter(selector);
   }
 
   void registerConstSymbol(String name) {
-    backend.registerConstSymbol(name, this);
+    worldImpact.registerConstSymbolName(name);
   }
 
   void registerSymbolConstructor() {
-    backend.resolutionCallbacks.onSymbolConstructor(this);
+    worldImpact.registerFeature(Feature.SYMBOL_CONSTRUCTOR);
   }
 
   void registerInstantiatedType(InterfaceType type) {
-    world.registerInstantiatedType(type, this);
+    worldImpact.registerInstantiatedType(type);
     mapping.addRequiredType(type);
   }
 
   void registerAbstractClassInstantiation() {
-    backend.resolutionCallbacks.onAbstractClassInstantiation(this);
-  }
-
-  void registerNewSymbol() {
-    backend.registerNewSymbol(this);
+    worldImpact.registerFeature(Feature.ABSTRACT_CLASS_INSTANTIATION);
   }
 
   void registerRequiredType(DartType type, Element enclosingElement) {
-    backend.registerRequiredType(type, enclosingElement);
+    worldImpact.registerRequiredType(type);
     mapping.addRequiredType(type);
   }
 
   void registerStringInterpolation() {
-    backend.resolutionCallbacks.onStringInterpolation(this);
+    worldImpact.registerFeature(Feature.STRING_INTERPOLATION);
   }
 
   void registerFallThroughError() {
-    backend.resolutionCallbacks.onFallThroughError(this);
+    worldImpact.registerFeature(Feature.FALL_THROUGH_ERROR);
   }
 
   void registerCatchStatement() {
-    backend.resolutionCallbacks.onCatchStatement(this);
+    worldImpact.registerFeature(Feature.CATCH_STATEMENT);
   }
 
   void registerStackTraceInCatch() {
-    backend.resolutionCallbacks.onStackTraceInCatch(this);
+    worldImpact.registerFeature(Feature.STACK_TRACE_IN_CATCH);
   }
 
   void registerSyncForIn(Node node) {
-    backend.resolutionCallbacks.onSyncForIn(this);
+    worldImpact.registerFeature(Feature.SYNC_FOR_IN);
   }
 
   ClassElement defaultSuperclass(ClassElement element) {
@@ -528,32 +699,23 @@
   }
 
   void registerThrowExpression() {
-    backend.resolutionCallbacks.onThrowExpression(this);
+    worldImpact.registerFeature(Feature.THROW_EXPRESSION);
   }
 
-  void registerDependency(Element element) {
-    mapping.registerDependency(element);
-  }
-
-  Setlet<Element> get otherDependencies => mapping.otherDependencies;
-
   void registerStaticInvocation(Element element) {
+    // TODO(johnniwinther): Increase precision of [registerStaticUse] and
+    // [registerDependency].
     if (element == null) return;
     registerStaticUse(element);
-    registerDependency(element);
   }
 
   void registerInstantiation(InterfaceType type) {
-    world.registerInstantiatedType(type, this);
+    registerInstantiatedType(type);
   }
 
-  void registerAssert(Send node) {
-    mapping.setAssert(node);
-    backend.resolutionCallbacks.onAssert(node, this);
-  }
-
-  bool isAssert(Send node) {
-    return mapping.isAssert(node);
+  void registerAssert(bool hasMessage) {
+    worldImpact.registerFeature(
+        hasMessage ? Feature.ASSERT_WITH_MESSAGE : Feature.ASSERT);
   }
 
   void registerSendStructure(Send node, SendStructure sendStructure) {
@@ -567,10 +729,52 @@
   }
 
   void registerAsyncMarker(FunctionElement element) {
-    backend.registerAsyncMarker(element, world, this);
+    switch (element.asyncMarker) {
+      case AsyncMarker.SYNC:
+        break;
+      case AsyncMarker.SYNC_STAR:
+        worldImpact.registerFeature(Feature.SYNC_STAR);
+        break;
+      case AsyncMarker.ASYNC:
+        worldImpact.registerFeature(Feature.ASYNC);
+        break;
+      case AsyncMarker.ASYNC_STAR:
+        worldImpact.registerFeature(Feature.ASYNC_STAR);
+        break;
+    }
   }
 
   void registerAsyncForIn(AsyncForIn node) {
-    backend.resolutionCallbacks.onAsyncForIn(node, this);
+    worldImpact.registerFeature(Feature.ASYNC_FOR_IN);
+  }
+
+  void registerIncDecOperation() {
+    worldImpact.registerFeature(Feature.INC_DEC_OPERATION);
+  }
+
+  void registerTryStatement() {
+    mapping.containsTryStatement = true;
+  }
+}
+
+class ForeignResolutionResolver implements ForeignResolver {
+  final ResolverVisitor visitor;
+  final ResolutionRegistry registry;
+
+  ForeignResolutionResolver(this.visitor, this.registry);
+
+  @override
+  ConstantExpression getConstant(Node node) {
+    return registry.getConstant(node);
+  }
+
+  @override
+  void registerInstantiatedType(InterfaceType type) {
+    registry.registerInstantiatedType(type);
+  }
+
+  @override
+  DartType resolveTypeFromString(Node node, String typeName) {
+    return visitor.resolveTypeFromString(node, typeName);
   }
 }
diff --git a/pkg/compiler/lib/src/resolution/resolution.dart b/pkg/compiler/lib/src/resolution/resolution.dart
index ee292e4..d0bae84 100644
--- a/pkg/compiler/lib/src/resolution/resolution.dart
+++ b/pkg/compiler/lib/src/resolution/resolution.dart
@@ -2,77 +2,1084 @@
 // for 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 resolution;
+library dart2js.resolution;
 
 import 'dart:collection' show Queue;
 
-import '../compile_time_constants.dart';
-import '../constants/expressions.dart';
-import '../constants/values.dart';
-import '../core_types.dart';
-import '../dart_backend/dart_backend.dart' show DartBackend;
+import '../common.dart';
+import '../common/names.dart' show
+    Identifiers;
+import '../common/resolution.dart' show
+    Parsing,
+    Resolution,
+    ResolutionImpact;
+import '../common/tasks.dart' show
+    CompilerTask,
+    DeferredAction;
+import '../compiler.dart' show
+    Compiler;
+import '../compile_time_constants.dart' show
+    ConstantCompiler;
+import '../constants/values.dart' show
+    ConstantValue;
 import '../dart_types.dart';
-import '../dart2jslib.dart' hide DynamicAccess;
-import '../tree/tree.dart';
-import '../scanner/scannerlib.dart';
 import '../elements/elements.dart';
-
 import '../elements/modelx.dart' show
     BaseClassElementX,
     BaseFunctionElementX,
     ConstructorElementX,
-    ErroneousConstructorElementX,
-    ErroneousElementX,
-    ErroneousFieldElementX,
-    ErroneousInitializingFormalElementX,
     FieldElementX,
-    FormalElementX,
     FunctionElementX,
-    FunctionSignatureX,
     GetterElementX,
-    InitializingFormalElementX,
-    JumpTargetX,
-    LabelDefinitionX,
-    LocalFunctionElementX,
-    LocalParameterElementX,
-    LocalVariableElementX,
     MetadataAnnotationX,
-    MethodElementX,
     MixinApplicationElementX,
-    ParameterElementX,
     ParameterMetadataAnnotation,
     SetterElementX,
-    SynthesizedConstructorElementX,
-    TypeVariableElementX,
-    TypedefElementX,
-    VariableElementX,
-    VariableList;
+    TypedefElementX;
+import '../enqueue.dart' show
+    WorldImpact;
+import '../tokens/token.dart' show
+    isBinaryOperator,
+    isMinusOperator,
+    isTernaryOperator,
+    isUnaryOperator,
+    isUserDefinableOperator;
+import '../tree/tree.dart';
+import '../util/util.dart' show
+    Link,
+    LinkBuilder,
+    Setlet;
 
-import '../ordered_typeset.dart' show OrderedTypeSet, OrderedTypeSetBuilder;
-import '../types/types.dart' show TypeMask;
-import '../util/util.dart';
-import '../universe/universe.dart' show
-    CallStructure,
-    SelectorKind,
-    UniverseSelector;
-
-import 'access_semantics.dart';
+import 'class_hierarchy.dart';
 import 'class_members.dart' show MembersCreator;
-import 'enum_creator.dart';
-import 'operators.dart';
-import 'secret_tree_element.dart' show getTreeElement, setTreeElement;
-import 'send_structure.dart';
+import 'constructors.dart';
+import 'members.dart';
+import 'registry.dart';
+import 'signatures.dart';
+import 'tree_elements.dart';
+import 'typedefs.dart';
 
-part 'class_hierarchy.dart';
-part 'constructors.dart';
-part 'label_scope.dart';
-part 'members.dart';
-part 'registry.dart';
-part 'resolution_common.dart';
-part 'resolution_result.dart';
-part 'scope.dart';
-part 'signatures.dart';
-part 'tree_elements.dart';
-part 'typedefs.dart';
-part 'type_resolver.dart';
-part 'variables.dart';
+class ResolverTask extends CompilerTask {
+  final ConstantCompiler constantCompiler;
+
+  ResolverTask(Compiler compiler, this.constantCompiler) : super(compiler);
+
+  String get name => 'Resolver';
+
+  Resolution get resolution => compiler.resolution;
+
+  Parsing get parsing => compiler.parsing;
+
+  ResolutionImpact resolve(Element element) {
+    return measure(() {
+      if (Elements.isErroneous(element)) {
+        // TODO(johnniwinther): Add a predicate for this.
+        assert(invariant(element, element is! ErroneousElement,
+            message: "Element $element expected to have parse errors."));
+        _ensureTreeElements(element);
+        return const ResolutionImpact();
+      }
+
+      WorldImpact processMetadata([WorldImpact result]) {
+        for (MetadataAnnotation metadata in element.implementation.metadata) {
+          metadata.ensureResolved(resolution);
+        }
+        return result;
+      }
+
+      ElementKind kind = element.kind;
+      if (identical(kind, ElementKind.GENERATIVE_CONSTRUCTOR) ||
+          identical(kind, ElementKind.FUNCTION) ||
+          identical(kind, ElementKind.GETTER) ||
+          identical(kind, ElementKind.SETTER)) {
+        return processMetadata(resolveMethodElement(element));
+      }
+
+      if (identical(kind, ElementKind.FIELD)) {
+        return processMetadata(resolveField(element));
+      }
+      if (element.isClass) {
+        ClassElement cls = element;
+        cls.ensureResolved(resolution);
+        return processMetadata(const ResolutionImpact());
+      } else if (element.isTypedef) {
+        TypedefElement typdef = element;
+        return processMetadata(resolveTypedef(typdef));
+      }
+
+      compiler.unimplemented(element, "resolve($element)");
+    });
+  }
+
+  void resolveRedirectingConstructor(InitializerResolver resolver,
+                                     Node node,
+                                     FunctionElement constructor,
+                                     FunctionElement redirection) {
+    assert(invariant(node, constructor.isImplementation,
+        message: 'Redirecting constructors must be resolved on implementation '
+                 'elements.'));
+    Setlet<FunctionElement> seen = new Setlet<FunctionElement>();
+    seen.add(constructor);
+    while (redirection != null) {
+      // Ensure that we follow redirections through implementation elements.
+      redirection = redirection.implementation;
+      if (seen.contains(redirection)) {
+        reporter.reportErrorMessage(
+            node, MessageKind.REDIRECTING_CONSTRUCTOR_CYCLE);
+        return;
+      }
+      seen.add(redirection);
+      redirection = resolver.visitor.resolveConstructorRedirection(redirection);
+    }
+  }
+
+  static void processAsyncMarker(Compiler compiler,
+                                 BaseFunctionElementX element,
+                                 ResolutionRegistry registry) {
+    DiagnosticReporter reporter = compiler.reporter;
+    Resolution resolution = compiler.resolution;
+    FunctionExpression functionExpression = element.node;
+    AsyncModifier asyncModifier = functionExpression.asyncModifier;
+    if (asyncModifier != null) {
+
+      if (asyncModifier.isAsynchronous) {
+        element.asyncMarker = asyncModifier.isYielding
+            ? AsyncMarker.ASYNC_STAR : AsyncMarker.ASYNC;
+      } else {
+        element.asyncMarker = AsyncMarker.SYNC_STAR;
+      }
+      if (element.isAbstract) {
+        reporter.reportErrorMessage(
+            asyncModifier,
+            MessageKind.ASYNC_MODIFIER_ON_ABSTRACT_METHOD,
+            {'modifier': element.asyncMarker});
+      } else if (element.isConstructor) {
+        reporter.reportErrorMessage(
+            asyncModifier,
+            MessageKind.ASYNC_MODIFIER_ON_CONSTRUCTOR,
+            {'modifier': element.asyncMarker});
+      } else {
+        if (element.isSetter) {
+          reporter.reportErrorMessage(
+              asyncModifier,
+              MessageKind.ASYNC_MODIFIER_ON_SETTER,
+              {'modifier': element.asyncMarker});
+
+        }
+        if (functionExpression.body.asReturn() != null &&
+            element.asyncMarker.isYielding) {
+          reporter.reportErrorMessage(
+              asyncModifier,
+              MessageKind.YIELDING_MODIFIER_ON_ARROW_BODY,
+              {'modifier': element.asyncMarker});
+        }
+      }
+      registry.registerAsyncMarker(element);
+      switch (element.asyncMarker) {
+      case AsyncMarker.ASYNC:
+        compiler.futureClass.ensureResolved(resolution);
+        break;
+      case AsyncMarker.ASYNC_STAR:
+        compiler.streamClass.ensureResolved(resolution);
+        break;
+      case AsyncMarker.SYNC_STAR:
+        compiler.iterableClass.ensureResolved(resolution);
+        break;
+      }
+    }
+  }
+
+  bool _isNativeClassOrExtendsNativeClass(ClassElement classElement) {
+    assert(classElement != null);
+    while (classElement != null) {
+      if (classElement.isNative) return true;
+      classElement = classElement.superclass;
+    }
+    return false;
+  }
+
+  WorldImpact resolveMethodElementImplementation(
+      FunctionElement element, FunctionExpression tree) {
+    return reporter.withCurrentElement(element, () {
+      if (element.isExternal && tree.hasBody()) {
+        reporter.reportErrorMessage(
+            element,
+            MessageKind.EXTERNAL_WITH_BODY,
+            {'functionName': element.name});
+      }
+      if (element.isConstructor) {
+        if (tree.returnType != null) {
+          reporter.reportErrorMessage(
+              tree, MessageKind.CONSTRUCTOR_WITH_RETURN_TYPE);
+        }
+        if (element.isConst &&
+            tree.hasBody() &&
+            !tree.isRedirectingFactory) {
+          reporter.reportErrorMessage(
+              tree, MessageKind.CONST_CONSTRUCTOR_HAS_BODY);
+        }
+      }
+
+      ResolverVisitor visitor = visitorFor(element);
+      ResolutionRegistry registry = visitor.registry;
+      registry.defineFunction(tree, element);
+      visitor.setupFunction(tree, element);
+      processAsyncMarker(compiler, element, registry);
+
+      if (element.isGenerativeConstructor) {
+        // Even if there is no initializer list we still have to do the
+        // resolution in case there is an implicit super constructor call.
+        InitializerResolver resolver =
+            new InitializerResolver(visitor, element, tree);
+        FunctionElement redirection = resolver.resolveInitializers();
+        if (redirection != null) {
+          resolveRedirectingConstructor(resolver, tree, element, redirection);
+        }
+      } else if (tree.initializers != null) {
+        reporter.reportErrorMessage(
+            tree, MessageKind.FUNCTION_WITH_INITIALIZER);
+      }
+
+      if (!compiler.analyzeSignaturesOnly || tree.isRedirectingFactory) {
+        // We need to analyze the redirecting factory bodies to ensure that
+        // we can analyze compile-time constants.
+        visitor.visit(tree.body);
+      }
+
+      // Get the resolution tree and check that the resolved
+      // function doesn't use 'super' if it is mixed into another
+      // class. This is the part of the 'super' mixin check that
+      // happens when a function is resolved after the mixin
+      // application has been performed.
+      TreeElements resolutionTree = registry.mapping;
+      ClassElement enclosingClass = element.enclosingClass;
+      if (enclosingClass != null) {
+        // TODO(johnniwinther): Find another way to obtain mixin uses.
+        Iterable<MixinApplicationElement> mixinUses =
+            compiler.world.allMixinUsesOf(enclosingClass);
+        ClassElement mixin = enclosingClass;
+        for (MixinApplicationElement mixinApplication in mixinUses) {
+          checkMixinSuperUses(resolutionTree, mixinApplication, mixin);
+        }
+      }
+
+      // TODO(9631): support noSuchMethod on native classes.
+      if (Elements.isInstanceMethod(element) &&
+          element.name == Identifiers.noSuchMethod_ &&
+          _isNativeClassOrExtendsNativeClass(enclosingClass)) {
+        reporter.reportErrorMessage(
+            tree, MessageKind.NO_SUCH_METHOD_IN_NATIVE);
+      }
+
+      return registry.worldImpact;
+    });
+
+  }
+
+  WorldImpact resolveMethodElement(FunctionElementX element) {
+    assert(invariant(element, element.isDeclaration));
+    return reporter.withCurrentElement(element, () {
+      if (compiler.enqueuer.resolution.hasBeenProcessed(element)) {
+        // TODO(karlklose): Remove the check for [isConstructor]. [elememts]
+        // should never be non-null, not even for constructors.
+        assert(invariant(element, element.isConstructor,
+            message: 'Non-constructor element $element '
+                     'has already been analyzed.'));
+        return const ResolutionImpact();
+      }
+      if (element.isSynthesized) {
+        if (element.isGenerativeConstructor) {
+          ResolutionRegistry registry =
+              new ResolutionRegistry(compiler, _ensureTreeElements(element));
+          ConstructorElement constructor = element.asFunctionElement();
+          ConstructorElement target = constructor.definingConstructor;
+          // Ensure the signature of the synthesized element is
+          // resolved. This is the only place where the resolver is
+          // seeing this element.
+          element.computeType(resolution);
+          if (!target.isErroneous) {
+            registry.registerStaticUse(target);
+            registry.registerImplicitSuperCall(target);
+          }
+          return registry.worldImpact;
+        } else {
+          assert(element.isDeferredLoaderGetter || element.isErroneous);
+          _ensureTreeElements(element);
+          return const ResolutionImpact();
+        }
+      } else {
+        element.parseNode(resolution.parsing);
+        element.computeType(resolution);
+        FunctionElementX implementation = element;
+        if (element.isExternal) {
+          implementation = compiler.backend.resolveExternalFunction(element);
+        }
+        return resolveMethodElementImplementation(
+            implementation, implementation.node);
+      }
+    });
+  }
+
+  /// Creates a [ResolverVisitor] for resolving an AST in context of [element].
+  /// If [useEnclosingScope] is `true` then the initial scope of the visitor
+  /// does not include inner scope of [element].
+  ///
+  /// This method should only be used by this library (or tests of
+  /// this library).
+  ResolverVisitor visitorFor(Element element, {bool useEnclosingScope: false}) {
+    return new ResolverVisitor(compiler, element,
+        new ResolutionRegistry(compiler, _ensureTreeElements(element)),
+        useEnclosingScope: useEnclosingScope);
+  }
+
+  WorldImpact resolveField(FieldElementX element) {
+    VariableDefinitions tree = element.parseNode(parsing);
+    if(element.modifiers.isStatic && element.isTopLevel) {
+      reporter.reportErrorMessage(
+          element.modifiers.getStatic(),
+          MessageKind.TOP_LEVEL_VARIABLE_DECLARED_STATIC);
+    }
+    ResolverVisitor visitor = visitorFor(element);
+    ResolutionRegistry registry = visitor.registry;
+    // TODO(johnniwinther): Maybe remove this when placeholderCollector migrates
+    // to the backend ast.
+    registry.defineElement(tree.definitions.nodes.head, element);
+    // TODO(johnniwinther): Share the resolved type between all variables
+    // declared in the same declaration.
+    if (tree.type != null) {
+      element.variables.type = visitor.resolveTypeAnnotation(tree.type);
+    } else {
+      element.variables.type = const DynamicType();
+    }
+
+    Expression initializer = element.initializer;
+    Modifiers modifiers = element.modifiers;
+    if (initializer != null) {
+      // TODO(johnniwinther): Avoid analyzing initializers if
+      // [Compiler.analyzeSignaturesOnly] is set.
+      visitor.visit(initializer);
+    } else if (modifiers.isConst) {
+      reporter.reportErrorMessage(
+          element, MessageKind.CONST_WITHOUT_INITIALIZER);
+    } else if (modifiers.isFinal && !element.isInstanceMember) {
+      reporter.reportErrorMessage(
+          element, MessageKind.FINAL_WITHOUT_INITIALIZER);
+    } else {
+      registry.registerInstantiatedClass(compiler.nullClass);
+    }
+
+    if (Elements.isStaticOrTopLevelField(element)) {
+      visitor.addDeferredAction(element, () {
+        if (element.modifiers.isConst) {
+          element.constant = constantCompiler.compileConstant(element);
+        } else {
+          constantCompiler.compileVariable(element);
+        }
+      });
+      if (initializer != null) {
+        if (!element.modifiers.isConst) {
+          // TODO(johnniwinther): Determine the const-ness eagerly to avoid
+          // unnecessary registrations.
+          registry.registerLazyField();
+        }
+      }
+    }
+
+    // Perform various checks as side effect of "computing" the type.
+    element.computeType(resolution);
+
+    return registry.worldImpact;
+  }
+
+  DartType resolveTypeAnnotation(Element element, TypeAnnotation annotation) {
+    DartType type = resolveReturnType(element, annotation);
+    if (type.isVoid) {
+      reporter.reportErrorMessage(
+          annotation, MessageKind.VOID_NOT_ALLOWED);
+    }
+    return type;
+  }
+
+  DartType resolveReturnType(Element element, TypeAnnotation annotation) {
+    if (annotation == null) return const DynamicType();
+    DartType result = visitorFor(element).resolveTypeAnnotation(annotation);
+    if (result == null) {
+      // TODO(karklose): warning.
+      return const DynamicType();
+    }
+    return result;
+  }
+
+  void resolveRedirectionChain(ConstructorElementX constructor,
+                               Spannable node) {
+    ConstructorElementX target = constructor;
+    InterfaceType targetType;
+    List<Element> seen = new List<Element>();
+    // Follow the chain of redirections and check for cycles.
+    while (target.isRedirectingFactory || target.isPatched) {
+      if (target.internalEffectiveTarget != null) {
+        // We found a constructor that already has been processed.
+        targetType = target.effectiveTargetType;
+        assert(invariant(target, targetType != null,
+            message: 'Redirection target type has not been computed for '
+                     '$target'));
+        target = target.internalEffectiveTarget;
+        break;
+      }
+
+      Element nextTarget;
+      if (target.isPatched) {
+        nextTarget = target.patch;
+      } else {
+        nextTarget = target.immediateRedirectionTarget;
+      }
+
+      if (seen.contains(nextTarget)) {
+        reporter.reportErrorMessage(
+            node, MessageKind.CYCLIC_REDIRECTING_FACTORY);
+        targetType = target.enclosingClass.thisType;
+        break;
+      }
+      seen.add(target);
+      target = nextTarget;
+    }
+
+    if (targetType == null) {
+      assert(!target.isRedirectingFactory);
+      targetType = target.enclosingClass.thisType;
+    }
+
+    // [target] is now the actual target of the redirections.  Run through
+    // the constructors again and set their [redirectionTarget], so that we
+    // do not have to run the loop for these constructors again. Furthermore,
+    // compute [redirectionTargetType] for each factory by computing the
+    // substitution of the target type with respect to the factory type.
+    while (!seen.isEmpty) {
+      ConstructorElementX factory = seen.removeLast();
+
+      // [factory] must already be analyzed but the [TreeElements] might not
+      // have been stored in the enqueuer cache yet.
+      // TODO(johnniwinther): Store [TreeElements] in the cache before
+      // resolution of the element.
+      TreeElements treeElements = factory.treeElements;
+      assert(invariant(node, treeElements != null,
+          message: 'No TreeElements cached for $factory.'));
+      if (!factory.isPatched) {
+        FunctionExpression functionNode = factory.parseNode(parsing);
+        RedirectingFactoryBody redirectionNode = functionNode.body;
+        DartType factoryType = treeElements.getType(redirectionNode);
+        if (!factoryType.isDynamic) {
+          targetType = targetType.substByContext(factoryType);
+        }
+      }
+      factory.effectiveTarget = target;
+      factory.effectiveTargetType = targetType;
+    }
+  }
+
+  /**
+   * Load and resolve the supertypes of [cls].
+   *
+   * Warning: do not call this method directly. It should only be
+   * called by [resolveClass] and [ClassSupertypeResolver].
+   */
+  void loadSupertypes(BaseClassElementX cls, Spannable from) {
+    reporter.withCurrentElement(cls, () => measure(() {
+      if (cls.supertypeLoadState == STATE_DONE) return;
+      if (cls.supertypeLoadState == STATE_STARTED) {
+        reporter.reportErrorMessage(
+            from,
+            MessageKind.CYCLIC_CLASS_HIERARCHY,
+            {'className': cls.name});
+        cls.supertypeLoadState = STATE_DONE;
+        cls.hasIncompleteHierarchy = true;
+        cls.allSupertypesAndSelf =
+            compiler.objectClass.allSupertypesAndSelf.extendClass(
+                cls.computeType(resolution));
+        cls.supertype = cls.allSupertypes.head;
+        assert(invariant(from, cls.supertype != null,
+            message: 'Missing supertype on cyclic class $cls.'));
+        cls.interfaces = const Link<DartType>();
+        return;
+      }
+      cls.supertypeLoadState = STATE_STARTED;
+      reporter.withCurrentElement(cls, () {
+        // TODO(ahe): Cache the node in cls.
+        cls.parseNode(parsing).accept(
+            new ClassSupertypeResolver(compiler, cls));
+        if (cls.supertypeLoadState != STATE_DONE) {
+          cls.supertypeLoadState = STATE_DONE;
+        }
+      });
+    }));
+  }
+
+  // TODO(johnniwinther): Remove this queue when resolution has been split into
+  // syntax and semantic resolution.
+  TypeDeclarationElement currentlyResolvedTypeDeclaration;
+  Queue<ClassElement> pendingClassesToBeResolved = new Queue<ClassElement>();
+  Queue<ClassElement> pendingClassesToBePostProcessed =
+      new Queue<ClassElement>();
+
+  /// Resolve [element] using [resolveTypeDeclaration].
+  ///
+  /// This methods ensure that class declarations encountered through type
+  /// annotations during the resolution of [element] are resolved after
+  /// [element] has been resolved.
+  // TODO(johnniwinther): Encapsulate this functionality in a
+  // 'TypeDeclarationResolver'.
+  _resolveTypeDeclaration(TypeDeclarationElement element,
+                          resolveTypeDeclaration()) {
+    return reporter.withCurrentElement(element, () {
+      return measure(() {
+        TypeDeclarationElement previousResolvedTypeDeclaration =
+            currentlyResolvedTypeDeclaration;
+        currentlyResolvedTypeDeclaration = element;
+        var result = resolveTypeDeclaration();
+        if (previousResolvedTypeDeclaration == null) {
+          do {
+            while (!pendingClassesToBeResolved.isEmpty) {
+              pendingClassesToBeResolved.removeFirst().ensureResolved(resolution);
+            }
+            while (!pendingClassesToBePostProcessed.isEmpty) {
+              _postProcessClassElement(
+                  pendingClassesToBePostProcessed.removeFirst());
+            }
+          } while (!pendingClassesToBeResolved.isEmpty);
+          assert(pendingClassesToBeResolved.isEmpty);
+          assert(pendingClassesToBePostProcessed.isEmpty);
+        }
+        currentlyResolvedTypeDeclaration = previousResolvedTypeDeclaration;
+        return result;
+      });
+    });
+  }
+
+  /**
+   * Resolve the class [element].
+   *
+   * Before calling this method, [element] was constructed by the
+   * scanner and most fields are null or empty. This method fills in
+   * these fields and also ensure that the supertypes of [element] are
+   * resolved.
+   *
+   * Warning: Do not call this method directly. Instead use
+   * [:element.ensureResolved(resolution):].
+   */
+  TreeElements resolveClass(BaseClassElementX element) {
+    return _resolveTypeDeclaration(element, () {
+      // TODO(johnniwinther): Store the mapping in the resolution enqueuer.
+      ResolutionRegistry registry =
+          new ResolutionRegistry(compiler, _ensureTreeElements(element));
+      resolveClassInternal(element, registry);
+      return element.treeElements;
+    });
+  }
+
+  void ensureClassWillBeResolvedInternal(ClassElement element) {
+    if (currentlyResolvedTypeDeclaration == null) {
+      element.ensureResolved(resolution);
+    } else {
+      pendingClassesToBeResolved.add(element);
+    }
+  }
+
+  void resolveClassInternal(BaseClassElementX element,
+                            ResolutionRegistry registry) {
+    if (!element.isPatch) {
+      reporter.withCurrentElement(element, () => measure(() {
+        assert(element.resolutionState == STATE_NOT_STARTED);
+        element.resolutionState = STATE_STARTED;
+        Node tree = element.parseNode(parsing);
+        loadSupertypes(element, tree);
+
+        ClassResolverVisitor visitor =
+            new ClassResolverVisitor(compiler, element, registry);
+        visitor.visit(tree);
+        element.resolutionState = STATE_DONE;
+        compiler.onClassResolved(element);
+        pendingClassesToBePostProcessed.add(element);
+      }));
+      if (element.isPatched) {
+        // Ensure handling patch after origin.
+        element.patch.ensureResolved(resolution);
+      }
+    } else { // Handle patch classes:
+      element.resolutionState = STATE_STARTED;
+      // Ensure handling origin before patch.
+      element.origin.ensureResolved(resolution);
+      // Ensure that the type is computed.
+      element.computeType(resolution);
+      // Copy class hierarchy from origin.
+      element.supertype = element.origin.supertype;
+      element.interfaces = element.origin.interfaces;
+      element.allSupertypesAndSelf = element.origin.allSupertypesAndSelf;
+      // Stepwise assignment to ensure invariant.
+      element.supertypeLoadState = STATE_STARTED;
+      element.supertypeLoadState = STATE_DONE;
+      element.resolutionState = STATE_DONE;
+      // TODO(johnniwinther): Check matching type variables and
+      // empty extends/implements clauses.
+    }
+  }
+
+  void _postProcessClassElement(BaseClassElementX element) {
+    for (MetadataAnnotation metadata in element.implementation.metadata) {
+      metadata.ensureResolved(resolution);
+      ConstantValue value =
+          compiler.constants.getConstantValue(metadata.constant);
+      if (!element.isProxy && compiler.isProxyConstant(value)) {
+        element.isProxy = true;
+      }
+    }
+
+    // Force resolution of metadata on non-instance members since they may be
+    // inspected by the backend while emitting. Metadata on instance members is
+    // handled as a result of processing instantiated class members in the
+    // enqueuer.
+    // TODO(ahe): Avoid this eager resolution.
+    element.forEachMember((_, Element member) {
+      if (!member.isInstanceMember) {
+        reporter.withCurrentElement(member, () {
+          for (MetadataAnnotation metadata in member.implementation.metadata) {
+            metadata.ensureResolved(resolution);
+          }
+        });
+      }
+    });
+
+    computeClassMember(element, Identifiers.call);
+  }
+
+  void computeClassMembers(ClassElement element) {
+    MembersCreator.computeAllClassMembers(compiler, element);
+  }
+
+  void computeClassMember(ClassElement element, String name) {
+    MembersCreator.computeClassMembersByName(compiler, element, name);
+  }
+
+  void checkClass(ClassElement element) {
+    computeClassMembers(element);
+    if (element.isMixinApplication) {
+      checkMixinApplication(element);
+    } else {
+      checkClassMembers(element);
+    }
+  }
+
+  void checkMixinApplication(MixinApplicationElementX mixinApplication) {
+    Modifiers modifiers = mixinApplication.modifiers;
+    int illegalFlags = modifiers.flags & ~Modifiers.FLAG_ABSTRACT;
+    if (illegalFlags != 0) {
+      Modifiers illegalModifiers = new Modifiers.withFlags(null, illegalFlags);
+      reporter.reportErrorMessage(
+          modifiers,
+          MessageKind.ILLEGAL_MIXIN_APPLICATION_MODIFIERS,
+          {'modifiers': illegalModifiers});
+    }
+
+    // In case of cyclic mixin applications, the mixin chain will have
+    // been cut. If so, we have already reported the error to the
+    // user so we just return from here.
+    ClassElement mixin = mixinApplication.mixin;
+    if (mixin == null) return;
+
+    // Check that we're not trying to use Object as a mixin.
+    if (mixin.superclass == null) {
+      reporter.reportErrorMessage(
+          mixinApplication,
+          MessageKind.ILLEGAL_MIXIN_OBJECT);
+      // Avoid reporting additional errors for the Object class.
+      return;
+    }
+
+    if (mixin.isEnumClass) {
+      // Mixing in an enum has already caused a compile-time error.
+      return;
+    }
+
+    // Check that the mixed in class has Object as its superclass.
+    if (!mixin.superclass.isObject) {
+      reporter.reportErrorMessage(
+          mixin, MessageKind.ILLEGAL_MIXIN_SUPERCLASS);
+    }
+
+    // Check that the mixed in class doesn't have any constructors and
+    // make sure we aren't mixing in methods that use 'super'.
+    mixin.forEachLocalMember((AstElement member) {
+      if (member.isGenerativeConstructor && !member.isSynthesized) {
+        reporter.reportErrorMessage(
+            member, MessageKind.ILLEGAL_MIXIN_CONSTRUCTOR);
+      } else {
+        // Get the resolution tree and check that the resolved member
+        // doesn't use 'super'. This is the part of the 'super' mixin
+        // check that happens when a function is resolved before the
+        // mixin application has been performed.
+        // TODO(johnniwinther): Obtain the [TreeElements] for [member]
+        // differently.
+        if (compiler.enqueuer.resolution.hasBeenProcessed(member)) {
+          checkMixinSuperUses(
+              member.resolvedAst.elements,
+              mixinApplication,
+              mixin);
+        }
+      }
+    });
+  }
+
+  void checkMixinSuperUses(TreeElements resolutionTree,
+                           MixinApplicationElement mixinApplication,
+                           ClassElement mixin) {
+    // TODO(johnniwinther): Avoid the use of [TreeElements] here.
+    if (resolutionTree == null) return;
+    Iterable<Node> superUses = resolutionTree.superUses;
+    if (superUses.isEmpty) return;
+    DiagnosticMessage error = reporter.createMessage(
+        mixinApplication,
+        MessageKind.ILLEGAL_MIXIN_WITH_SUPER,
+        {'className': mixin.name});
+    // Show the user the problematic uses of 'super' in the mixin.
+    List<DiagnosticMessage> infos = <DiagnosticMessage>[];
+    for (Node use in superUses) {
+      infos.add(reporter.createMessage(
+          use,
+          MessageKind.ILLEGAL_MIXIN_SUPER_USE));
+    }
+    reporter.reportError(error, infos);
+  }
+
+  void checkClassMembers(ClassElement cls) {
+    assert(invariant(cls, cls.isDeclaration));
+    if (cls.isObject) return;
+    // TODO(johnniwinther): Should this be done on the implementation element as
+    // well?
+    List<Element> constConstructors = <Element>[];
+    List<Element> nonFinalInstanceFields = <Element>[];
+    cls.forEachMember((holder, member) {
+      reporter.withCurrentElement(member, () {
+        // Perform various checks as side effect of "computing" the type.
+        member.computeType(resolution);
+
+        // Check modifiers.
+        if (member.isFunction && member.modifiers.isFinal) {
+          reporter.reportErrorMessage(
+              member, MessageKind.ILLEGAL_FINAL_METHOD_MODIFIER);
+        }
+        if (member.isConstructor) {
+          final mismatchedFlagsBits =
+              member.modifiers.flags &
+              (Modifiers.FLAG_STATIC | Modifiers.FLAG_ABSTRACT);
+          if (mismatchedFlagsBits != 0) {
+            final mismatchedFlags =
+                new Modifiers.withFlags(null, mismatchedFlagsBits);
+            reporter.reportErrorMessage(
+                member,
+                MessageKind.ILLEGAL_CONSTRUCTOR_MODIFIERS,
+                {'modifiers': mismatchedFlags});
+          }
+          if (member.modifiers.isConst) {
+            constConstructors.add(member);
+          }
+        }
+        if (member.isField) {
+          if (member.modifiers.isConst && !member.modifiers.isStatic) {
+            reporter.reportErrorMessage(
+                member, MessageKind.ILLEGAL_CONST_FIELD_MODIFIER);
+          }
+          if (!member.modifiers.isStatic && !member.modifiers.isFinal) {
+            nonFinalInstanceFields.add(member);
+          }
+        }
+        checkAbstractField(member);
+        checkUserDefinableOperator(member);
+      });
+    });
+    if (!constConstructors.isEmpty && !nonFinalInstanceFields.isEmpty) {
+      Spannable span = constConstructors.length > 1
+          ? cls : constConstructors[0];
+      DiagnosticMessage error = reporter.createMessage(
+          span,
+          MessageKind.CONST_CONSTRUCTOR_WITH_NONFINAL_FIELDS,
+          {'className': cls.name});
+      List<DiagnosticMessage> infos = <DiagnosticMessage>[];
+      if (constConstructors.length > 1) {
+        for (Element constructor in constConstructors) {
+          infos.add(reporter.createMessage(
+              constructor,
+              MessageKind.CONST_CONSTRUCTOR_WITH_NONFINAL_FIELDS_CONSTRUCTOR));
+        }
+      }
+      for (Element field in nonFinalInstanceFields) {
+        infos.add(reporter.createMessage(
+            field,
+            MessageKind.CONST_CONSTRUCTOR_WITH_NONFINAL_FIELDS_FIELD));
+      }
+      reporter.reportError(error, infos);
+    }
+  }
+
+  void checkAbstractField(Element member) {
+    // Only check for getters. The test can only fail if there is both a setter
+    // and a getter with the same name, and we only need to check each abstract
+    // field once, so we just ignore setters.
+    if (!member.isGetter) return;
+
+    // Find the associated abstract field.
+    ClassElement classElement = member.enclosingClass;
+    Element lookupElement = classElement.lookupLocalMember(member.name);
+    if (lookupElement == null) {
+      reporter.internalError(member,
+          "No abstract field for accessor");
+    } else if (!identical(lookupElement.kind, ElementKind.ABSTRACT_FIELD)) {
+      if (lookupElement.isErroneous || lookupElement.isAmbiguous) return;
+      reporter.internalError(member,
+          "Inaccessible abstract field for accessor");
+    }
+    AbstractFieldElement field = lookupElement;
+
+    GetterElementX getter = field.getter;
+    if (getter == null) return;
+    SetterElementX setter = field.setter;
+    if (setter == null) return;
+    int getterFlags = getter.modifiers.flags | Modifiers.FLAG_ABSTRACT;
+    int setterFlags = setter.modifiers.flags | Modifiers.FLAG_ABSTRACT;
+    if (!identical(getterFlags, setterFlags)) {
+      final mismatchedFlags =
+        new Modifiers.withFlags(null, getterFlags ^ setterFlags);
+      reporter.reportErrorMessage(
+          field.getter,
+          MessageKind.GETTER_MISMATCH,
+          {'modifiers': mismatchedFlags});
+      reporter.reportErrorMessage(
+          field.setter,
+          MessageKind.SETTER_MISMATCH,
+          {'modifiers': mismatchedFlags});
+    }
+  }
+
+  void checkUserDefinableOperator(Element member) {
+    FunctionElement function = member.asFunctionElement();
+    if (function == null) return;
+    String value = member.name;
+    if (value == null) return;
+    if (!(isUserDefinableOperator(value) || identical(value, 'unary-'))) return;
+
+    bool isMinus = false;
+    int requiredParameterCount;
+    MessageKind messageKind;
+    if (identical(value, 'unary-')) {
+      isMinus = true;
+      messageKind = MessageKind.MINUS_OPERATOR_BAD_ARITY;
+      requiredParameterCount = 0;
+    } else if (isMinusOperator(value)) {
+      isMinus = true;
+      messageKind = MessageKind.MINUS_OPERATOR_BAD_ARITY;
+      requiredParameterCount = 1;
+    } else if (isUnaryOperator(value)) {
+      messageKind = MessageKind.UNARY_OPERATOR_BAD_ARITY;
+      requiredParameterCount = 0;
+    } else if (isBinaryOperator(value)) {
+      messageKind = MessageKind.BINARY_OPERATOR_BAD_ARITY;
+      requiredParameterCount = 1;
+      if (identical(value, '==')) checkOverrideHashCode(member);
+    } else if (isTernaryOperator(value)) {
+      messageKind = MessageKind.TERNARY_OPERATOR_BAD_ARITY;
+      requiredParameterCount = 2;
+    } else {
+      reporter.internalError(function,
+          'Unexpected user defined operator $value');
+    }
+    checkArity(function, requiredParameterCount, messageKind, isMinus);
+  }
+
+  void checkOverrideHashCode(FunctionElement operatorEquals) {
+    if (operatorEquals.isAbstract) return;
+    ClassElement cls = operatorEquals.enclosingClass;
+    Element hashCodeImplementation =
+        cls.lookupLocalMember('hashCode');
+    if (hashCodeImplementation != null) return;
+    reporter.reportHintMessage(
+        operatorEquals, MessageKind.OVERRIDE_EQUALS_NOT_HASH_CODE,
+        {'class': cls.name});
+  }
+
+  void checkArity(FunctionElement function,
+                  int requiredParameterCount, MessageKind messageKind,
+                  bool isMinus) {
+    FunctionExpression node = function.node;
+    FunctionSignature signature = function.functionSignature;
+    if (signature.requiredParameterCount != requiredParameterCount) {
+      Node errorNode = node;
+      if (node.parameters != null) {
+        if (isMinus ||
+            signature.requiredParameterCount < requiredParameterCount) {
+          // If there are too few parameters, point to the whole parameter list.
+          // For instance
+          //
+          //     int operator +() {}
+          //                   ^^
+          //
+          //     int operator []=(value) {}
+          //                     ^^^^^^^
+          //
+          // For operator -, always point the whole parameter list, like
+          //
+          //     int operator -(a, b) {}
+          //                   ^^^^^^
+          //
+          // instead of
+          //
+          //     int operator -(a, b) {}
+          //                       ^
+          //
+          // since the correction might not be to remove 'b' but instead to
+          // remove 'a, b'.
+          errorNode = node.parameters;
+        } else {
+          errorNode = node.parameters.nodes.skip(requiredParameterCount).head;
+        }
+      }
+      reporter.reportErrorMessage(
+          errorNode, messageKind, {'operatorName': function.name});
+    }
+    if (signature.optionalParameterCount != 0) {
+      Node errorNode =
+          node.parameters.nodes.skip(signature.requiredParameterCount).head;
+      if (signature.optionalParametersAreNamed) {
+        reporter.reportErrorMessage(
+            errorNode,
+            MessageKind.OPERATOR_NAMED_PARAMETERS,
+            {'operatorName': function.name});
+      } else {
+        reporter.reportErrorMessage(
+            errorNode,
+            MessageKind.OPERATOR_OPTIONAL_PARAMETERS,
+            {'operatorName': function.name});
+      }
+    }
+  }
+
+  reportErrorWithContext(Element errorneousElement,
+                         MessageKind errorMessage,
+                         Element contextElement,
+                         MessageKind contextMessage) {
+    reporter.reportError(
+        reporter.createMessage(
+            errorneousElement,
+            errorMessage,
+            {'memberName': contextElement.name,
+             'className': contextElement.enclosingClass.name}),
+        <DiagnosticMessage>[
+            reporter.createMessage(contextElement, contextMessage),
+        ]);
+  }
+
+
+  FunctionSignature resolveSignature(FunctionElementX element) {
+    MessageKind defaultValuesError = null;
+    if (element.isFactoryConstructor) {
+      FunctionExpression body = element.parseNode(parsing);
+      if (body.isRedirectingFactory) {
+        defaultValuesError = MessageKind.REDIRECTING_FACTORY_WITH_DEFAULT;
+      }
+    }
+    return reporter.withCurrentElement(element, () {
+      FunctionExpression node = element.parseNode(parsing);
+      return measure(() => SignatureResolver.analyze(
+          compiler, node.parameters, node.returnType, element,
+          new ResolutionRegistry(compiler, _ensureTreeElements(element)),
+          defaultValuesError: defaultValuesError,
+          createRealParameters: true));
+    });
+  }
+
+  WorldImpact resolveTypedef(TypedefElementX element) {
+    if (element.isResolved) return const ResolutionImpact();
+    compiler.world.allTypedefs.add(element);
+    return _resolveTypeDeclaration(element, () {
+      ResolutionRegistry registry = new ResolutionRegistry(
+          compiler, _ensureTreeElements(element));
+      return reporter.withCurrentElement(element, () {
+        return measure(() {
+          assert(element.resolutionState == STATE_NOT_STARTED);
+          element.resolutionState = STATE_STARTED;
+          Typedef node = element.parseNode(parsing);
+          TypedefResolverVisitor visitor =
+            new TypedefResolverVisitor(compiler, element, registry);
+          visitor.visit(node);
+          element.resolutionState = STATE_DONE;
+          return registry.worldImpact;
+        });
+      });
+    });
+  }
+
+  void resolveMetadataAnnotation(MetadataAnnotationX annotation) {
+    reporter.withCurrentElement(annotation.annotatedElement, () => measure(() {
+      assert(annotation.resolutionState == STATE_NOT_STARTED);
+      annotation.resolutionState = STATE_STARTED;
+
+      Node node = annotation.parseNode(parsing);
+      Element annotatedElement = annotation.annotatedElement;
+      AnalyzableElement context = annotatedElement.analyzableElement;
+      ClassElement classElement = annotatedElement.enclosingClass;
+      if (classElement != null) {
+        // The annotation is resolved in the scope of [classElement].
+        classElement.ensureResolved(resolution);
+      }
+      assert(invariant(node, context != null,
+          message: "No context found for metadata annotation "
+                   "on $annotatedElement."));
+      ResolverVisitor visitor = visitorFor(context, useEnclosingScope: true);
+      ResolutionRegistry registry = visitor.registry;
+      node.accept(visitor);
+      // TODO(johnniwinther): Avoid passing the [TreeElements] to
+      // [compileMetadata].
+      annotation.constant =
+          constantCompiler.compileMetadata(annotation, node, registry.mapping);
+      constantCompiler.evaluate(annotation.constant);
+      // TODO(johnniwinther): Register the relation between the annotation
+      // and the annotated element instead. This will allow the backend to
+      // retrieve the backend constant and only register metadata on the
+      // elements for which it is needed. (Issue 17732).
+      registry.registerMetadataConstant(annotation);
+      annotation.resolutionState = STATE_DONE;
+    }));
+  }
+
+  List<MetadataAnnotation> resolveMetadata(Element element,
+                                           VariableDefinitions node) {
+    List<MetadataAnnotation> metadata = <MetadataAnnotation>[];
+    for (Metadata annotation in node.metadata.nodes) {
+      ParameterMetadataAnnotation metadataAnnotation =
+          new ParameterMetadataAnnotation(annotation);
+      metadataAnnotation.annotatedElement = element;
+      metadata.add(metadataAnnotation.ensureResolved(resolution));
+    }
+    return metadata;
+  }
+}
+
+TreeElements _ensureTreeElements(AnalyzableElementX element) {
+  if (element._treeElements == null) {
+    element._treeElements = new TreeElementMapping(element);
+  }
+  return element._treeElements;
+}
+
+abstract class AnalyzableElementX implements AnalyzableElement {
+  TreeElements _treeElements;
+
+  bool get hasTreeElements => _treeElements != null;
+
+  TreeElements get treeElements {
+    assert(invariant(this, _treeElements !=null,
+        message: "TreeElements have not been computed for $this."));
+    return _treeElements;
+  }
+
+  void reuseElement() {
+    _treeElements = null;
+  }
+}
diff --git a/pkg/compiler/lib/src/resolution/resolution_common.dart b/pkg/compiler/lib/src/resolution/resolution_common.dart
index 0f1a778..e1e0d28 100644
--- a/pkg/compiler/lib/src/resolution/resolution_common.dart
+++ b/pkg/compiler/lib/src/resolution/resolution_common.dart
@@ -2,978 +2,37 @@
 // for 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 resolution;
+library dart2js.resolution.common;
 
-class ResolverTask extends CompilerTask {
-  final ConstantCompiler constantCompiler;
+import '../common.dart';
+import '../common/resolution.dart' show
+    Resolution;
+import '../common/tasks.dart' show
+    DeferredAction;
+import '../compiler.dart' show
+    Compiler;
+import '../elements/elements.dart';
+import '../tree/tree.dart';
 
-  ResolverTask(Compiler compiler, this.constantCompiler) : super(compiler);
-
-  String get name => 'Resolver';
-
-  WorldImpact resolve(Element element) {
-    return measure(() {
-      if (Elements.isErroneous(element)) {
-        // TODO(johnniwinther): Add a predicate for this.
-        assert(invariant(element, element is! ErroneousElement,
-            message: "Element $element expected to have parse errors."));
-        _ensureTreeElements(element);
-        return const WorldImpact();
-      }
-
-      WorldImpact processMetadata([WorldImpact result]) {
-        for (MetadataAnnotation metadata in element.metadata) {
-          metadata.ensureResolved(compiler);
-        }
-        return result;
-      }
-
-      ElementKind kind = element.kind;
-      if (identical(kind, ElementKind.GENERATIVE_CONSTRUCTOR) ||
-          identical(kind, ElementKind.FUNCTION) ||
-          identical(kind, ElementKind.GETTER) ||
-          identical(kind, ElementKind.SETTER)) {
-        return processMetadata(resolveMethodElement(element));
-      }
-
-      if (identical(kind, ElementKind.FIELD)) {
-        return processMetadata(resolveField(element));
-      }
-      if (element.isClass) {
-        ClassElement cls = element;
-        cls.ensureResolved(compiler);
-        return processMetadata(const WorldImpact());
-      } else if (element.isTypedef) {
-        TypedefElement typdef = element;
-        return processMetadata(resolveTypedef(typdef));
-      }
-
-      compiler.unimplemented(element, "resolve($element)");
-    });
-  }
-
-  void resolveRedirectingConstructor(InitializerResolver resolver,
-                                     Node node,
-                                     FunctionElement constructor,
-                                     FunctionElement redirection) {
-    assert(invariant(node, constructor.isImplementation,
-        message: 'Redirecting constructors must be resolved on implementation '
-                 'elements.'));
-    Setlet<FunctionElement> seen = new Setlet<FunctionElement>();
-    seen.add(constructor);
-    while (redirection != null) {
-      // Ensure that we follow redirections through implementation elements.
-      redirection = redirection.implementation;
-      if (seen.contains(redirection)) {
-        resolver.visitor.error(node, MessageKind.REDIRECTING_CONSTRUCTOR_CYCLE);
-        return;
-      }
-      seen.add(redirection);
-      redirection = resolver.visitor.resolveConstructorRedirection(redirection);
-    }
-  }
-
-  static void processAsyncMarker(Compiler compiler,
-                                 BaseFunctionElementX element,
-                                 ResolutionRegistry registry) {
-    FunctionExpression functionExpression = element.node;
-    AsyncModifier asyncModifier = functionExpression.asyncModifier;
-    if (asyncModifier != null) {
-
-      if (asyncModifier.isAsynchronous) {
-        element.asyncMarker = asyncModifier.isYielding
-            ? AsyncMarker.ASYNC_STAR : AsyncMarker.ASYNC;
-      } else {
-        element.asyncMarker = AsyncMarker.SYNC_STAR;
-      }
-      if (element.isAbstract) {
-        compiler.reportError(asyncModifier,
-            MessageKind.ASYNC_MODIFIER_ON_ABSTRACT_METHOD,
-            {'modifier': element.asyncMarker});
-      } else if (element.isConstructor) {
-        compiler.reportError(asyncModifier,
-            MessageKind.ASYNC_MODIFIER_ON_CONSTRUCTOR,
-            {'modifier': element.asyncMarker});
-      } else {
-        if (element.isSetter) {
-          compiler.reportError(asyncModifier,
-              MessageKind.ASYNC_MODIFIER_ON_SETTER,
-              {'modifier': element.asyncMarker});
-
-        }
-        if (functionExpression.body.asReturn() != null &&
-            element.asyncMarker.isYielding) {
-          compiler.reportError(asyncModifier,
-              MessageKind.YIELDING_MODIFIER_ON_ARROW_BODY,
-              {'modifier': element.asyncMarker});
-        }
-      }
-      registry.registerAsyncMarker(element);
-      switch (element.asyncMarker) {
-      case AsyncMarker.ASYNC:
-        compiler.futureClass.ensureResolved(compiler);
-        break;
-      case AsyncMarker.ASYNC_STAR:
-        compiler.streamClass.ensureResolved(compiler);
-        break;
-      case AsyncMarker.SYNC_STAR:
-        compiler.iterableClass.ensureResolved(compiler);
-        break;
-      }
-    }
-  }
-
-  bool _isNativeClassOrExtendsNativeClass(ClassElement classElement) {
-    assert(classElement != null);
-    while (classElement != null) {
-      if (classElement.isNative) return true;
-      classElement = classElement.superclass;
-    }
-    return false;
-  }
-
-  WorldImpact resolveMethodElementImplementation(
-      FunctionElement element, FunctionExpression tree) {
-    return compiler.withCurrentElement(element, () {
-      if (element.isExternal && tree.hasBody()) {
-        error(element,
-            MessageKind.EXTERNAL_WITH_BODY,
-            {'functionName': element.name});
-      }
-      if (element.isConstructor) {
-        if (tree.returnType != null) {
-          error(tree, MessageKind.CONSTRUCTOR_WITH_RETURN_TYPE);
-        }
-        if (element.isConst &&
-            tree.hasBody() &&
-            !tree.isRedirectingFactory) {
-          error(tree, MessageKind.CONST_CONSTRUCTOR_HAS_BODY);
-        }
-      }
-
-      ResolverVisitor visitor = visitorFor(element);
-      ResolutionRegistry registry = visitor.registry;
-      registry.defineFunction(tree, element);
-      visitor.setupFunction(tree, element);
-      processAsyncMarker(compiler, element, registry);
-
-      if (element.isGenerativeConstructor) {
-        // Even if there is no initializer list we still have to do the
-        // resolution in case there is an implicit super constructor call.
-        InitializerResolver resolver =
-            new InitializerResolver(visitor, element, tree);
-        FunctionElement redirection = resolver.resolveInitializers();
-        if (redirection != null) {
-          resolveRedirectingConstructor(resolver, tree, element, redirection);
-        }
-      } else if (tree.initializers != null) {
-        error(tree, MessageKind.FUNCTION_WITH_INITIALIZER);
-      }
-
-      if (!compiler.analyzeSignaturesOnly || tree.isRedirectingFactory) {
-        // We need to analyze the redirecting factory bodies to ensure that
-        // we can analyze compile-time constants.
-        visitor.visit(tree.body);
-      }
-
-      // Get the resolution tree and check that the resolved
-      // function doesn't use 'super' if it is mixed into another
-      // class. This is the part of the 'super' mixin check that
-      // happens when a function is resolved after the mixin
-      // application has been performed.
-      TreeElements resolutionTree = registry.mapping;
-      ClassElement enclosingClass = element.enclosingClass;
-      if (enclosingClass != null) {
-        // TODO(johnniwinther): Find another way to obtain mixin uses.
-        Iterable<MixinApplicationElement> mixinUses =
-            compiler.world.allMixinUsesOf(enclosingClass);
-        ClassElement mixin = enclosingClass;
-        for (MixinApplicationElement mixinApplication in mixinUses) {
-          checkMixinSuperUses(resolutionTree, mixinApplication, mixin);
-        }
-      }
-
-      // TODO(9631): support noSuchMethod on native classes.
-      if (Elements.isInstanceMethod(element) &&
-          element.name == Compiler.NO_SUCH_METHOD &&
-          _isNativeClassOrExtendsNativeClass(enclosingClass)) {
-        error(tree, MessageKind.NO_SUCH_METHOD_IN_NATIVE);
-      }
-
-      return registry.worldImpact;
-    });
-
-  }
-
-  WorldImpact resolveMethodElement(FunctionElementX element) {
-    assert(invariant(element, element.isDeclaration));
-    return compiler.withCurrentElement(element, () {
-      if (compiler.enqueuer.resolution.hasBeenResolved(element)) {
-        // TODO(karlklose): Remove the check for [isConstructor]. [elememts]
-        // should never be non-null, not even for constructors.
-        assert(invariant(element, element.isConstructor,
-            message: 'Non-constructor element $element '
-                     'has already been analyzed.'));
-        return const WorldImpact();
-      }
-      if (element.isSynthesized) {
-        if (element.isGenerativeConstructor) {
-          ResolutionRegistry registry =
-              new ResolutionRegistry(compiler, element);
-          ConstructorElement constructor = element.asFunctionElement();
-          ConstructorElement target = constructor.definingConstructor;
-          // Ensure the signature of the synthesized element is
-          // resolved. This is the only place where the resolver is
-          // seeing this element.
-          element.computeSignature(compiler);
-          if (!target.isErroneous) {
-            registry.registerStaticUse(target);
-            registry.registerImplicitSuperCall(target);
-          }
-          return registry.worldImpact;
-        } else {
-          assert(element.isDeferredLoaderGetter || element.isErroneous);
-          _ensureTreeElements(element);
-          return const WorldImpact();
-        }
-      } else {
-        element.parseNode(compiler);
-        element.computeType(compiler);
-        FunctionElementX implementation = element;
-        if (element.isExternal) {
-          implementation = compiler.backend.resolveExternalFunction(element);
-        }
-        return resolveMethodElementImplementation(
-            implementation, implementation.node);
-      }
-    });
-  }
-
-  /// Creates a [ResolverVisitor] for resolving an AST in context of [element].
-  /// If [useEnclosingScope] is `true` then the initial scope of the visitor
-  /// does not include inner scope of [element].
-  ///
-  /// This method should only be used by this library (or tests of
-  /// this library).
-  ResolverVisitor visitorFor(Element element, {bool useEnclosingScope: false}) {
-    return new ResolverVisitor(compiler, element,
-        new ResolutionRegistry(compiler, element),
-        useEnclosingScope: useEnclosingScope);
-  }
-
-  WorldImpact resolveField(FieldElementX element) {
-    VariableDefinitions tree = element.parseNode(compiler);
-    if(element.modifiers.isStatic && element.isTopLevel) {
-      error(element.modifiers.getStatic(),
-            MessageKind.TOP_LEVEL_VARIABLE_DECLARED_STATIC);
-    }
-    ResolverVisitor visitor = visitorFor(element);
-    ResolutionRegistry registry = visitor.registry;
-    // TODO(johnniwinther): Maybe remove this when placeholderCollector migrates
-    // to the backend ast.
-    registry.defineElement(tree.definitions.nodes.head, element);
-    // TODO(johnniwinther): Share the resolved type between all variables
-    // declared in the same declaration.
-    if (tree.type != null) {
-      element.variables.type = visitor.resolveTypeAnnotation(tree.type);
-    } else {
-      element.variables.type = const DynamicType();
-    }
-
-    Expression initializer = element.initializer;
-    Modifiers modifiers = element.modifiers;
-    if (initializer != null) {
-      // TODO(johnniwinther): Avoid analyzing initializers if
-      // [Compiler.analyzeSignaturesOnly] is set.
-      visitor.visit(initializer);
-    } else if (modifiers.isConst) {
-      compiler.reportError(element, MessageKind.CONST_WITHOUT_INITIALIZER);
-    } else if (modifiers.isFinal && !element.isInstanceMember) {
-      compiler.reportError(element, MessageKind.FINAL_WITHOUT_INITIALIZER);
-    } else {
-      registry.registerInstantiatedClass(compiler.nullClass);
-    }
-
-    if (Elements.isStaticOrTopLevelField(element)) {
-      visitor.addDeferredAction(element, () {
-        if (element.modifiers.isConst) {
-          element.constant = constantCompiler.compileConstant(element);
-        } else {
-          constantCompiler.compileVariable(element);
-        }
-      });
-      if (initializer != null) {
-        if (!element.modifiers.isConst) {
-          // TODO(johnniwinther): Determine the const-ness eagerly to avoid
-          // unnecessary registrations.
-          registry.registerLazyField();
-        }
-      }
-    }
-
-    // Perform various checks as side effect of "computing" the type.
-    element.computeType(compiler);
-
-    return registry.worldImpact;
-  }
-
-  DartType resolveTypeAnnotation(Element element, TypeAnnotation annotation) {
-    DartType type = resolveReturnType(element, annotation);
-    if (type.isVoid) {
-      error(annotation, MessageKind.VOID_NOT_ALLOWED);
-    }
-    return type;
-  }
-
-  DartType resolveReturnType(Element element, TypeAnnotation annotation) {
-    if (annotation == null) return const DynamicType();
-    DartType result = visitorFor(element).resolveTypeAnnotation(annotation);
-    if (result == null) {
-      // TODO(karklose): warning.
-      return const DynamicType();
-    }
-    return result;
-  }
-
-  void resolveRedirectionChain(ConstructorElementX constructor,
-                               Spannable node) {
-    ConstructorElementX target = constructor;
-    InterfaceType targetType;
-    List<Element> seen = new List<Element>();
-    // Follow the chain of redirections and check for cycles.
-    while (target.isRedirectingFactory) {
-      if (target.internalEffectiveTarget != null) {
-        // We found a constructor that already has been processed.
-        targetType = target.effectiveTargetType;
-        assert(invariant(target, targetType != null,
-            message: 'Redirection target type has not been computed for '
-                     '$target'));
-        target = target.internalEffectiveTarget;
-        break;
-      }
-
-      Element nextTarget = target.immediateRedirectionTarget;
-      if (seen.contains(nextTarget)) {
-        error(node, MessageKind.CYCLIC_REDIRECTING_FACTORY);
-        targetType = target.enclosingClass.thisType;
-        break;
-      }
-      seen.add(target);
-      target = nextTarget;
-    }
-
-    if (targetType == null) {
-      assert(!target.isRedirectingFactory);
-      targetType = target.enclosingClass.thisType;
-    }
-
-    // [target] is now the actual target of the redirections.  Run through
-    // the constructors again and set their [redirectionTarget], so that we
-    // do not have to run the loop for these constructors again. Furthermore,
-    // compute [redirectionTargetType] for each factory by computing the
-    // substitution of the target type with respect to the factory type.
-    while (!seen.isEmpty) {
-      ConstructorElementX factory = seen.removeLast();
-
-      // [factory] must already be analyzed but the [TreeElements] might not
-      // have been stored in the enqueuer cache yet.
-      // TODO(johnniwinther): Store [TreeElements] in the cache before
-      // resolution of the element.
-      TreeElements treeElements = factory.treeElements;
-      assert(invariant(node, treeElements != null,
-          message: 'No TreeElements cached for $factory.'));
-      FunctionExpression functionNode = factory.parseNode(compiler);
-      RedirectingFactoryBody redirectionNode = functionNode.body;
-      DartType factoryType = treeElements.getType(redirectionNode);
-      if (!factoryType.isDynamic) {
-        targetType = targetType.substByContext(factoryType);
-      }
-      factory.effectiveTarget = target;
-      factory.effectiveTargetType = targetType;
-    }
-  }
-
-  /**
-   * Load and resolve the supertypes of [cls].
-   *
-   * Warning: do not call this method directly. It should only be
-   * called by [resolveClass] and [ClassSupertypeResolver].
-   */
-  void loadSupertypes(BaseClassElementX cls, Spannable from) {
-    compiler.withCurrentElement(cls, () => measure(() {
-      if (cls.supertypeLoadState == STATE_DONE) return;
-      if (cls.supertypeLoadState == STATE_STARTED) {
-        compiler.reportError(from, MessageKind.CYCLIC_CLASS_HIERARCHY,
-                                 {'className': cls.name});
-        cls.supertypeLoadState = STATE_DONE;
-        cls.hasIncompleteHierarchy = true;
-        cls.allSupertypesAndSelf =
-            compiler.objectClass.allSupertypesAndSelf.extendClass(
-                cls.computeType(compiler));
-        cls.supertype = cls.allSupertypes.head;
-        assert(invariant(from, cls.supertype != null,
-            message: 'Missing supertype on cyclic class $cls.'));
-        cls.interfaces = const Link<DartType>();
-        return;
-      }
-      cls.supertypeLoadState = STATE_STARTED;
-      compiler.withCurrentElement(cls, () {
-        // TODO(ahe): Cache the node in cls.
-        cls.parseNode(compiler).accept(
-            new ClassSupertypeResolver(compiler, cls));
-        if (cls.supertypeLoadState != STATE_DONE) {
-          cls.supertypeLoadState = STATE_DONE;
-        }
-      });
-    }));
-  }
-
-  // TODO(johnniwinther): Remove this queue when resolution has been split into
-  // syntax and semantic resolution.
-  TypeDeclarationElement currentlyResolvedTypeDeclaration;
-  Queue<ClassElement> pendingClassesToBeResolved = new Queue<ClassElement>();
-  Queue<ClassElement> pendingClassesToBePostProcessed =
-      new Queue<ClassElement>();
-
-  /// Resolve [element] using [resolveTypeDeclaration].
-  ///
-  /// This methods ensure that class declarations encountered through type
-  /// annotations during the resolution of [element] are resolved after
-  /// [element] has been resolved.
-  // TODO(johnniwinther): Encapsulate this functionality in a
-  // 'TypeDeclarationResolver'.
-  _resolveTypeDeclaration(TypeDeclarationElement element,
-                          resolveTypeDeclaration()) {
-    return compiler.withCurrentElement(element, () {
-      return measure(() {
-        TypeDeclarationElement previousResolvedTypeDeclaration =
-            currentlyResolvedTypeDeclaration;
-        currentlyResolvedTypeDeclaration = element;
-        var result = resolveTypeDeclaration();
-        if (previousResolvedTypeDeclaration == null) {
-          do {
-            while (!pendingClassesToBeResolved.isEmpty) {
-              pendingClassesToBeResolved.removeFirst().ensureResolved(compiler);
-            }
-            while (!pendingClassesToBePostProcessed.isEmpty) {
-              _postProcessClassElement(
-                  pendingClassesToBePostProcessed.removeFirst());
-            }
-          } while (!pendingClassesToBeResolved.isEmpty);
-          assert(pendingClassesToBeResolved.isEmpty);
-          assert(pendingClassesToBePostProcessed.isEmpty);
-        }
-        currentlyResolvedTypeDeclaration = previousResolvedTypeDeclaration;
-        return result;
-      });
-    });
-  }
-
-  /**
-   * Resolve the class [element].
-   *
-   * Before calling this method, [element] was constructed by the
-   * scanner and most fields are null or empty. This method fills in
-   * these fields and also ensure that the supertypes of [element] are
-   * resolved.
-   *
-   * Warning: Do not call this method directly. Instead use
-   * [:element.ensureResolved(compiler):].
-   */
-  TreeElements resolveClass(BaseClassElementX element) {
-    return _resolveTypeDeclaration(element, () {
-      // TODO(johnniwinther): Store the mapping in the resolution enqueuer.
-      ResolutionRegistry registry = new ResolutionRegistry(compiler, element);
-      resolveClassInternal(element, registry);
-      return element.treeElements;
-    });
-  }
-
-  void _ensureClassWillBeResolved(ClassElement element) {
-    if (currentlyResolvedTypeDeclaration == null) {
-      element.ensureResolved(compiler);
-    } else {
-      pendingClassesToBeResolved.add(element);
-    }
-  }
-
-  void resolveClassInternal(BaseClassElementX element,
-                            ResolutionRegistry registry) {
-    if (!element.isPatch) {
-      compiler.withCurrentElement(element, () => measure(() {
-        assert(element.resolutionState == STATE_NOT_STARTED);
-        element.resolutionState = STATE_STARTED;
-        Node tree = element.parseNode(compiler);
-        loadSupertypes(element, tree);
-
-        ClassResolverVisitor visitor =
-            new ClassResolverVisitor(compiler, element, registry);
-        visitor.visit(tree);
-        element.resolutionState = STATE_DONE;
-        compiler.onClassResolved(element);
-        pendingClassesToBePostProcessed.add(element);
-      }));
-      if (element.isPatched) {
-        // Ensure handling patch after origin.
-        element.patch.ensureResolved(compiler);
-      }
-    } else { // Handle patch classes:
-      element.resolutionState = STATE_STARTED;
-      // Ensure handling origin before patch.
-      element.origin.ensureResolved(compiler);
-      // Ensure that the type is computed.
-      element.computeType(compiler);
-      // Copy class hierarchy from origin.
-      element.supertype = element.origin.supertype;
-      element.interfaces = element.origin.interfaces;
-      element.allSupertypesAndSelf = element.origin.allSupertypesAndSelf;
-      // Stepwise assignment to ensure invariant.
-      element.supertypeLoadState = STATE_STARTED;
-      element.supertypeLoadState = STATE_DONE;
-      element.resolutionState = STATE_DONE;
-      // TODO(johnniwinther): Check matching type variables and
-      // empty extends/implements clauses.
-    }
-  }
-
-  void _postProcessClassElement(BaseClassElementX element) {
-    for (MetadataAnnotation metadata in element.metadata) {
-      metadata.ensureResolved(compiler);
-      ConstantValue value =
-          compiler.constants.getConstantValue(metadata.constant);
-      if (!element.isProxy && value == compiler.proxyConstant) {
-        element.isProxy = true;
-      }
-    }
-
-    // Force resolution of metadata on non-instance members since they may be
-    // inspected by the backend while emitting. Metadata on instance members is
-    // handled as a result of processing instantiated class members in the
-    // enqueuer.
-    // TODO(ahe): Avoid this eager resolution.
-    element.forEachMember((_, Element member) {
-      if (!member.isInstanceMember) {
-        compiler.withCurrentElement(member, () {
-          for (MetadataAnnotation metadata in member.metadata) {
-            metadata.ensureResolved(compiler);
-          }
-        });
-      }
-    });
-
-    computeClassMember(element, Compiler.CALL_OPERATOR_NAME);
-  }
-
-  void computeClassMembers(ClassElement element) {
-    MembersCreator.computeAllClassMembers(compiler, element);
-  }
-
-  void computeClassMember(ClassElement element, String name) {
-    MembersCreator.computeClassMembersByName(compiler, element, name);
-  }
-
-  void checkClass(ClassElement element) {
-    computeClassMembers(element);
-    if (element.isMixinApplication) {
-      checkMixinApplication(element);
-    } else {
-      checkClassMembers(element);
-    }
-  }
-
-  void checkMixinApplication(MixinApplicationElementX mixinApplication) {
-    Modifiers modifiers = mixinApplication.modifiers;
-    int illegalFlags = modifiers.flags & ~Modifiers.FLAG_ABSTRACT;
-    if (illegalFlags != 0) {
-      Modifiers illegalModifiers = new Modifiers.withFlags(null, illegalFlags);
-      compiler.reportError(
-          modifiers,
-          MessageKind.ILLEGAL_MIXIN_APPLICATION_MODIFIERS,
-          {'modifiers': illegalModifiers});
-    }
-
-    // In case of cyclic mixin applications, the mixin chain will have
-    // been cut. If so, we have already reported the error to the
-    // user so we just return from here.
-    ClassElement mixin = mixinApplication.mixin;
-    if (mixin == null) return;
-
-    // Check that we're not trying to use Object as a mixin.
-    if (mixin.superclass == null) {
-      compiler.reportError(mixinApplication,
-                               MessageKind.ILLEGAL_MIXIN_OBJECT);
-      // Avoid reporting additional errors for the Object class.
-      return;
-    }
-
-    if (mixin.isEnumClass) {
-      // Mixing in an enum has already caused a compile-time error.
-      return;
-    }
-
-    // Check that the mixed in class has Object as its superclass.
-    if (!mixin.superclass.isObject) {
-      compiler.reportError(mixin, MessageKind.ILLEGAL_MIXIN_SUPERCLASS);
-    }
-
-    // Check that the mixed in class doesn't have any constructors and
-    // make sure we aren't mixing in methods that use 'super'.
-    mixin.forEachLocalMember((AstElement member) {
-      if (member.isGenerativeConstructor && !member.isSynthesized) {
-        compiler.reportError(member, MessageKind.ILLEGAL_MIXIN_CONSTRUCTOR);
-      } else {
-        // Get the resolution tree and check that the resolved member
-        // doesn't use 'super'. This is the part of the 'super' mixin
-        // check that happens when a function is resolved before the
-        // mixin application has been performed.
-        // TODO(johnniwinther): Obtain the [TreeElements] for [member]
-        // differently.
-        if (compiler.enqueuer.resolution.hasBeenResolved(member)) {
-          checkMixinSuperUses(
-              member.resolvedAst.elements,
-              mixinApplication,
-              mixin);
-        }
-      }
-    });
-  }
-
-  void checkMixinSuperUses(TreeElements resolutionTree,
-                           MixinApplicationElement mixinApplication,
-                           ClassElement mixin) {
-    // TODO(johnniwinther): Avoid the use of [TreeElements] here.
-    if (resolutionTree == null) return;
-    Iterable<Node> superUses = resolutionTree.superUses;
-    if (superUses.isEmpty) return;
-    compiler.reportError(mixinApplication,
-                         MessageKind.ILLEGAL_MIXIN_WITH_SUPER,
-                         {'className': mixin.name});
-    // Show the user the problematic uses of 'super' in the mixin.
-    for (Node use in superUses) {
-      compiler.reportInfo(
-          use,
-          MessageKind.ILLEGAL_MIXIN_SUPER_USE);
-    }
-  }
-
-  void checkClassMembers(ClassElement cls) {
-    assert(invariant(cls, cls.isDeclaration));
-    if (cls.isObject) return;
-    // TODO(johnniwinther): Should this be done on the implementation element as
-    // well?
-    List<Element> constConstructors = <Element>[];
-    List<Element> nonFinalInstanceFields = <Element>[];
-    cls.forEachMember((holder, member) {
-      compiler.withCurrentElement(member, () {
-        // Perform various checks as side effect of "computing" the type.
-        member.computeType(compiler);
-
-        // Check modifiers.
-        if (member.isFunction && member.modifiers.isFinal) {
-          compiler.reportError(
-              member, MessageKind.ILLEGAL_FINAL_METHOD_MODIFIER);
-        }
-        if (member.isConstructor) {
-          final mismatchedFlagsBits =
-              member.modifiers.flags &
-              (Modifiers.FLAG_STATIC | Modifiers.FLAG_ABSTRACT);
-          if (mismatchedFlagsBits != 0) {
-            final mismatchedFlags =
-                new Modifiers.withFlags(null, mismatchedFlagsBits);
-            compiler.reportError(
-                member,
-                MessageKind.ILLEGAL_CONSTRUCTOR_MODIFIERS,
-                {'modifiers': mismatchedFlags});
-          }
-          if (member.modifiers.isConst) {
-            constConstructors.add(member);
-          }
-        }
-        if (member.isField) {
-          if (member.modifiers.isConst && !member.modifiers.isStatic) {
-            compiler.reportError(
-                member, MessageKind.ILLEGAL_CONST_FIELD_MODIFIER);
-          }
-          if (!member.modifiers.isStatic && !member.modifiers.isFinal) {
-            nonFinalInstanceFields.add(member);
-          }
-        }
-        checkAbstractField(member);
-        checkUserDefinableOperator(member);
-      });
-    });
-    if (!constConstructors.isEmpty && !nonFinalInstanceFields.isEmpty) {
-      Spannable span = constConstructors.length > 1
-          ? cls : constConstructors[0];
-      compiler.reportError(span,
-          MessageKind.CONST_CONSTRUCTOR_WITH_NONFINAL_FIELDS,
-          {'className': cls.name});
-      if (constConstructors.length > 1) {
-        for (Element constructor in constConstructors) {
-          compiler.reportInfo(constructor,
-              MessageKind.CONST_CONSTRUCTOR_WITH_NONFINAL_FIELDS_CONSTRUCTOR);
-        }
-      }
-      for (Element field in nonFinalInstanceFields) {
-        compiler.reportInfo(field,
-            MessageKind.CONST_CONSTRUCTOR_WITH_NONFINAL_FIELDS_FIELD);
-      }
-    }
-  }
-
-  void checkAbstractField(Element member) {
-    // Only check for getters. The test can only fail if there is both a setter
-    // and a getter with the same name, and we only need to check each abstract
-    // field once, so we just ignore setters.
-    if (!member.isGetter) return;
-
-    // Find the associated abstract field.
-    ClassElement classElement = member.enclosingClass;
-    Element lookupElement = classElement.lookupLocalMember(member.name);
-    if (lookupElement == null) {
-      compiler.internalError(member,
-          "No abstract field for accessor");
-    } else if (!identical(lookupElement.kind, ElementKind.ABSTRACT_FIELD)) {
-      if (lookupElement.isErroneous || lookupElement.isAmbiguous) return;
-      compiler.internalError(member,
-          "Inaccessible abstract field for accessor");
-    }
-    AbstractFieldElement field = lookupElement;
-
-    GetterElementX getter = field.getter;
-    if (getter == null) return;
-    SetterElementX setter = field.setter;
-    if (setter == null) return;
-    int getterFlags = getter.modifiers.flags | Modifiers.FLAG_ABSTRACT;
-    int setterFlags = setter.modifiers.flags | Modifiers.FLAG_ABSTRACT;
-    if (!identical(getterFlags, setterFlags)) {
-      final mismatchedFlags =
-        new Modifiers.withFlags(null, getterFlags ^ setterFlags);
-      compiler.reportError(
-          field.getter,
-          MessageKind.GETTER_MISMATCH,
-          {'modifiers': mismatchedFlags});
-      compiler.reportError(
-          field.setter,
-          MessageKind.SETTER_MISMATCH,
-          {'modifiers': mismatchedFlags});
-    }
-  }
-
-  void checkUserDefinableOperator(Element member) {
-    FunctionElement function = member.asFunctionElement();
-    if (function == null) return;
-    String value = member.name;
-    if (value == null) return;
-    if (!(isUserDefinableOperator(value) || identical(value, 'unary-'))) return;
-
-    bool isMinus = false;
-    int requiredParameterCount;
-    MessageKind messageKind;
-    if (identical(value, 'unary-')) {
-      isMinus = true;
-      messageKind = MessageKind.MINUS_OPERATOR_BAD_ARITY;
-      requiredParameterCount = 0;
-    } else if (isMinusOperator(value)) {
-      isMinus = true;
-      messageKind = MessageKind.MINUS_OPERATOR_BAD_ARITY;
-      requiredParameterCount = 1;
-    } else if (isUnaryOperator(value)) {
-      messageKind = MessageKind.UNARY_OPERATOR_BAD_ARITY;
-      requiredParameterCount = 0;
-    } else if (isBinaryOperator(value)) {
-      messageKind = MessageKind.BINARY_OPERATOR_BAD_ARITY;
-      requiredParameterCount = 1;
-      if (identical(value, '==')) checkOverrideHashCode(member);
-    } else if (isTernaryOperator(value)) {
-      messageKind = MessageKind.TERNARY_OPERATOR_BAD_ARITY;
-      requiredParameterCount = 2;
-    } else {
-      compiler.internalError(function,
-          'Unexpected user defined operator $value');
-    }
-    checkArity(function, requiredParameterCount, messageKind, isMinus);
-  }
-
-  void checkOverrideHashCode(FunctionElement operatorEquals) {
-    if (operatorEquals.isAbstract) return;
-    ClassElement cls = operatorEquals.enclosingClass;
-    Element hashCodeImplementation =
-        cls.lookupLocalMember('hashCode');
-    if (hashCodeImplementation != null) return;
-    compiler.reportHint(
-        operatorEquals, MessageKind.OVERRIDE_EQUALS_NOT_HASH_CODE,
-        {'class': cls.name});
-  }
-
-  void checkArity(FunctionElement function,
-                  int requiredParameterCount, MessageKind messageKind,
-                  bool isMinus) {
-    FunctionExpression node = function.node;
-    FunctionSignature signature = function.functionSignature;
-    if (signature.requiredParameterCount != requiredParameterCount) {
-      Node errorNode = node;
-      if (node.parameters != null) {
-        if (isMinus ||
-            signature.requiredParameterCount < requiredParameterCount) {
-          // If there are too few parameters, point to the whole parameter list.
-          // For instance
-          //
-          //     int operator +() {}
-          //                   ^^
-          //
-          //     int operator []=(value) {}
-          //                     ^^^^^^^
-          //
-          // For operator -, always point the whole parameter list, like
-          //
-          //     int operator -(a, b) {}
-          //                   ^^^^^^
-          //
-          // instead of
-          //
-          //     int operator -(a, b) {}
-          //                       ^
-          //
-          // since the correction might not be to remove 'b' but instead to
-          // remove 'a, b'.
-          errorNode = node.parameters;
-        } else {
-          errorNode = node.parameters.nodes.skip(requiredParameterCount).head;
-        }
-      }
-      compiler.reportError(
-          errorNode, messageKind, {'operatorName': function.name});
-    }
-    if (signature.optionalParameterCount != 0) {
-      Node errorNode =
-          node.parameters.nodes.skip(signature.requiredParameterCount).head;
-      if (signature.optionalParametersAreNamed) {
-        compiler.reportError(
-            errorNode,
-            MessageKind.OPERATOR_NAMED_PARAMETERS,
-            {'operatorName': function.name});
-      } else {
-        compiler.reportError(
-            errorNode,
-            MessageKind.OPERATOR_OPTIONAL_PARAMETERS,
-            {'operatorName': function.name});
-      }
-    }
-  }
-
-  reportErrorWithContext(Element errorneousElement,
-                         MessageKind errorMessage,
-                         Element contextElement,
-                         MessageKind contextMessage) {
-    compiler.reportError(
-        errorneousElement,
-        errorMessage,
-        {'memberName': contextElement.name,
-         'className': contextElement.enclosingClass.name});
-    compiler.reportInfo(contextElement, contextMessage);
-  }
-
-
-  FunctionSignature resolveSignature(FunctionElementX element) {
-    MessageKind defaultValuesError = null;
-    if (element.isFactoryConstructor) {
-      FunctionExpression body = element.parseNode(compiler);
-      if (body.isRedirectingFactory) {
-        defaultValuesError = MessageKind.REDIRECTING_FACTORY_WITH_DEFAULT;
-      }
-    }
-    return compiler.withCurrentElement(element, () {
-      FunctionExpression node =
-          compiler.parser.measure(() => element.parseNode(compiler));
-      return measure(() => SignatureResolver.analyze(
-          compiler, node.parameters, node.returnType, element,
-          new ResolutionRegistry(compiler, element),
-          defaultValuesError: defaultValuesError,
-          createRealParameters: true));
-    });
-  }
-
-  WorldImpact resolveTypedef(TypedefElementX element) {
-    if (element.isResolved) return const WorldImpact();
-    compiler.world.allTypedefs.add(element);
-    return _resolveTypeDeclaration(element, () {
-      ResolutionRegistry registry = new ResolutionRegistry(compiler, element);
-      return compiler.withCurrentElement(element, () {
-        return measure(() {
-          assert(element.resolutionState == STATE_NOT_STARTED);
-          element.resolutionState = STATE_STARTED;
-          Typedef node =
-            compiler.parser.measure(() => element.parseNode(compiler));
-          TypedefResolverVisitor visitor =
-            new TypedefResolverVisitor(compiler, element, registry);
-          visitor.visit(node);
-          element.resolutionState = STATE_DONE;
-          return registry.worldImpact;
-        });
-      });
-    });
-  }
-
-  void resolveMetadataAnnotation(MetadataAnnotationX annotation) {
-    compiler.withCurrentElement(annotation.annotatedElement, () => measure(() {
-      assert(annotation.resolutionState == STATE_NOT_STARTED);
-      annotation.resolutionState = STATE_STARTED;
-
-      Node node = annotation.parseNode(compiler);
-      Element annotatedElement = annotation.annotatedElement;
-      AnalyzableElement context = annotatedElement.analyzableElement;
-      ClassElement classElement = annotatedElement.enclosingClass;
-      if (classElement != null) {
-        // The annotation is resolved in the scope of [classElement].
-        classElement.ensureResolved(compiler);
-      }
-      assert(invariant(node, context != null,
-          message: "No context found for metadata annotation "
-                   "on $annotatedElement."));
-      ResolverVisitor visitor = visitorFor(context, useEnclosingScope: true);
-      ResolutionRegistry registry = visitor.registry;
-      node.accept(visitor);
-      // TODO(johnniwinther): Avoid passing the [TreeElements] to
-      // [compileMetadata].
-      annotation.constant =
-          constantCompiler.compileMetadata(annotation, node, registry.mapping);
-      // TODO(johnniwinther): Register the relation between the annotation
-      // and the annotated element instead. This will allow the backend to
-      // retrieve the backend constant and only register metadata on the
-      // elements for which it is needed. (Issue 17732).
-      registry.registerMetadataConstant(annotation, annotatedElement);
-      annotation.resolutionState = STATE_DONE;
-    }));
-  }
-
-  error(Spannable node, MessageKind kind, [arguments = const {}]) {
-    compiler.reportError(node, kind, arguments);
-  }
-
-  Link<MetadataAnnotation> resolveMetadata(Element element,
-                                           VariableDefinitions node) {
-    LinkBuilder<MetadataAnnotation> metadata =
-        new LinkBuilder<MetadataAnnotation>();
-    for (Metadata annotation in node.metadata.nodes) {
-      ParameterMetadataAnnotation metadataAnnotation =
-          new ParameterMetadataAnnotation(annotation);
-      metadataAnnotation.annotatedElement = element;
-      metadata.addLast(metadataAnnotation.ensureResolved(compiler));
-    }
-    return metadata.toLink();
-  }
-}
+import 'registry.dart' show
+    ResolutionRegistry;
+import 'scope.dart' show
+    Scope;
+import 'type_resolver.dart' show
+    TypeResolver;
 
 class CommonResolverVisitor<R> extends Visitor<R> {
   final Compiler compiler;
 
   CommonResolverVisitor(Compiler this.compiler);
 
+  DiagnosticReporter get reporter => compiler.reporter;
+
+  Resolution get resolution => compiler.resolution;
+
   R visitNode(Node node) {
-    internalError(node,
+    return reporter.internalError(node,
         'internal error: Unhandled node: ${node.getObjectDescription()}');
-    return null;
   }
 
   R visitEmptyStatement(Node node) => null;
@@ -981,18 +40,6 @@
   /** Convenience method for visiting nodes that may be null. */
   R visit(Node node) => (node == null) ? null : node.accept(this);
 
-  void error(Spannable node, MessageKind kind, [Map arguments = const {}]) {
-    compiler.reportError(node, kind, arguments);
-  }
-
-  void warning(Spannable node, MessageKind kind, [Map arguments = const {}]) {
-    compiler.reportWarning(node, kind, arguments);
-  }
-
-  internalError(Spannable node, message) {
-    compiler.internalError(node, message);
-  }
-
   void addDeferredAction(Element element, DeferredAction action) {
     compiler.enqueuer.resolution.addDeferredAction(element, action);
   }
@@ -1029,7 +76,7 @@
       if (element.name == 'yield' ||
           element.name == 'async' ||
           element.name == 'await') {
-        compiler.reportError(
+        reporter.reportErrorMessage(
             node, MessageKind.ASYNC_KEYWORD_AS_IDENTIFIER,
             {'keyword': element.name,
              'modifier': currentAsyncMarker});
@@ -1040,7 +87,7 @@
   /// Register [node] as the definition of [element].
   void defineLocalVariable(Node node, LocalVariableElement element) {
     if (element == null) {
-      throw compiler.internalError(node, 'element is null');
+      throw reporter.internalError(node, 'element is null');
     }
     checkLocalDefinitionName(node, element);
     registry.defineElement(node, element);
@@ -1049,9 +96,16 @@
   void reportDuplicateDefinition(String name,
                                  Spannable definition,
                                  Spannable existing) {
-    compiler.reportError(definition,
-        MessageKind.DUPLICATE_DEFINITION, {'name': name});
-    compiler.reportInfo(existing,
-        MessageKind.EXISTING_DEFINITION, {'name': name});
+    reporter.reportError(
+        reporter.createMessage(
+            definition,
+            MessageKind.DUPLICATE_DEFINITION,
+            {'name': name}),
+        <DiagnosticMessage>[
+            reporter.createMessage(
+                existing,
+                MessageKind.EXISTING_DEFINITION,
+                {'name': name}),
+        ]);
   }
 }
diff --git a/pkg/compiler/lib/src/resolution/resolution_result.dart b/pkg/compiler/lib/src/resolution/resolution_result.dart
index 4b12234..6168025 100644
--- a/pkg/compiler/lib/src/resolution/resolution_result.dart
+++ b/pkg/compiler/lib/src/resolution/resolution_result.dart
@@ -2,7 +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.
 
-part of resolution;
+library dart2js.resolution.result;
+
+import '../constants/expressions.dart';
+import '../dart_types.dart';
+import '../elements/elements.dart';
+import '../tree/tree.dart';
+import '../universe/call_structure.dart' show
+    CallStructure;
 
 enum ResultKind {
   NONE,
@@ -76,15 +83,6 @@
   String toString() => 'TypeResult($type)';
 }
 
-/// The result for the resolution of the `assert` method.
-class AssertResult extends ResolutionResult {
-  const AssertResult();
-
-  ResultKind get kind => ResultKind.ASSERT;
-
-  String toString() => 'AssertResult()';
-}
-
 /// The result for resolving a constant expression.
 class ConstantResult extends ResolutionResult {
   final Node node;
@@ -136,4 +134,4 @@
       return result.constant;
     }).toList();
   }
-}
\ No newline at end of file
+}
diff --git a/pkg/compiler/lib/src/resolution/scope.dart b/pkg/compiler/lib/src/resolution/scope.dart
index 79fdacf..c3785f9 100644
--- a/pkg/compiler/lib/src/resolution/scope.dart
+++ b/pkg/compiler/lib/src/resolution/scope.dart
@@ -2,7 +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.
 
-part of resolution;
+library dart2js.resolution.scope;
+
+import '../dart_types.dart';
+import '../elements/elements.dart';
 
 abstract class Scope {
   /**
diff --git a/pkg/compiler/lib/src/resolution/secret_tree_element.dart b/pkg/compiler/lib/src/resolution/secret_tree_element.dart
index 16216df..c4d2029 100644
--- a/pkg/compiler/lib/src/resolution/secret_tree_element.dart
+++ b/pkg/compiler/lib/src/resolution/secret_tree_element.dart
@@ -16,9 +16,9 @@
  * So please, do not add additional elements to this library, and do
  * not import it.
  */
-library secret_tree_element;
+library dart2js.resolution.secret_tree_element;
 
-import '../dart2jslib.dart' show invariant, Spannable;
+import '../common.dart';
 
 /// Interface for associating
 abstract class TreeElementMixin {
diff --git a/pkg/compiler/lib/src/resolution/semantic_visitor.dart b/pkg/compiler/lib/src/resolution/semantic_visitor.dart
index d54b68a..92db2c4 100644
--- a/pkg/compiler/lib/src/resolution/semantic_visitor.dart
+++ b/pkg/compiler/lib/src/resolution/semantic_visitor.dart
@@ -4,20 +4,22 @@
 
 library dart2js.semantics_visitor;
 
+import '../common.dart';
 import '../constants/expressions.dart';
-import '../dart2jslib.dart' show invariant, MessageKind;
 import '../dart_types.dart';
-import '../elements/elements.dart';
 import '../tree/tree.dart';
-import '../universe/universe.dart';
-import '../util/util.dart' show Spannable, SpannableAssertionFailure;
-import 'access_semantics.dart';
+import '../elements/elements.dart';
+import '../universe/call_structure.dart' show
+    CallStructure;
+import '../universe/selector.dart' show
+    Selector;
+
 import 'operators.dart';
-import 'resolution.dart';
+import 'send_resolver.dart';
 import 'send_structure.dart';
+import 'tree_elements.dart';
 
 part 'semantic_visitor_mixins.dart';
-part 'send_resolver.dart';
 
 /// Mixin that couples a [SendResolverMixin] to a [SemanticSendVisitor] in a
 /// [Visitor].
@@ -43,7 +45,7 @@
     // TODO(johnniwinther): Support argument.
     A arg = null;
 
-    SendStructure structure = computeSendStructure(node);
+    SendStructure structure = elements.getSendStructure(node);
     if (structure == null) {
       return internalError(node, 'No structure for $node');
     } else {
@@ -322,7 +324,7 @@
   R visitDynamicPropertyGet(
       Send node,
       Node receiver,
-      Selector selector,
+      Name name,
       A arg);
 
   /// Conditional (if not null) getter call on [receiver] of the property
@@ -335,7 +337,7 @@
   R visitIfNotNullDynamicPropertyGet(
       Send node,
       Node receiver,
-      Selector selector,
+      Name name,
       A arg);
 
   /// Setter call on [receiver] with argument [rhs] of the property defined by
@@ -350,7 +352,7 @@
   R visitDynamicPropertySet(
       SendSet node,
       Node receiver,
-      Selector selector,
+      Name name,
       Node rhs,
       A arg);
 
@@ -366,7 +368,7 @@
   R visitIfNotNullDynamicPropertySet(
       SendSet node,
       Node receiver,
-      Selector selector,
+      Name name,
       Node rhs,
       A arg);
 
@@ -418,7 +420,7 @@
   ///
   R visitThisPropertyGet(
       Send node,
-      Selector selector,
+      Name name,
       A arg);
 
   /// Setter call on `this` with argument [rhs] of the property defined by
@@ -438,7 +440,7 @@
   ///
   R visitThisPropertySet(
       SendSet node,
-      Selector selector,
+      Name name,
       Node rhs,
       A arg);
 
@@ -740,7 +742,7 @@
       Send node,
       Node expression,
       NodeList arguments,
-      Selector selector,
+      CallStructure callStructure,
       A arg);
 
   /// Read of the static [field].
@@ -1296,32 +1298,6 @@
       Node rhs,
       A arg);
 
-  /// Call to `assert` with [expression] as the condition.
-  ///
-  /// For instance:
-  ///
-  ///     m() { assert(expression); }
-  ///
-  R visitAssert(
-      Send node,
-      Node expression,
-      A arg);
-
-  /// Call to `assert` with the wrong number of [arguments].
-  ///
-  /// For instance:
-  ///
-  ///     m() { assert(); }
-  ///
-  /// or
-  ///
-  ///     m() { assert(expression1, expression2); }
-  ///
-  R errorInvalidAssert(
-      Send node,
-      NodeList arguments,
-      A arg);
-
   /// Binary expression `left operator right` where [operator] is a user
   /// definable operator. Binary expressions using operator `==` are handled
   /// by [visitEquals] and index operations `a[b]` are handled by [visitIndex].
@@ -1874,10 +1850,9 @@
   R visitDynamicPropertyCompound(
       Send node,
       Node receiver,
+      Name name,
       AssignmentOperator operator,
       Node rhs,
-      Selector getterSelector,
-      Selector setterSelector,
       A arg);
 
   /// Compound assignment expression of [rhs] with [operator] of the property on
@@ -1891,10 +1866,9 @@
   R visitIfNotNullDynamicPropertyCompound(
       Send node,
       Node receiver,
+      Name name,
       AssignmentOperator operator,
       Node rhs,
-      Selector getterSelector,
-      Selector setterSelector,
       A arg);
 
   /// Compound assignment expression of [rhs] with [operator] of the property on
@@ -1915,10 +1889,9 @@
   ///
   R visitThisPropertyCompound(
       Send node,
+      Name name,
       AssignmentOperator operator,
       Node rhs,
-      Selector getterSelector,
-      Selector setterSelector,
       A arg);
 
   /// Compound assignment expression of [rhs] with [operator] on a [parameter].
@@ -2191,6 +2164,705 @@
       Node rhs,
       A arg);
 
+  /// If-null assignment expression of [rhs] to the [name] property on
+  /// [receiver]. That is, [rhs] is only evaluated and assigned, if the value
+  /// of [name] on [receiver] is `null`.
+  ///
+  /// For instance:
+  ///
+  ///     m(receiver, rhs) => receiver.foo ??= rhs;
+  ///
+  R visitDynamicPropertySetIfNull(
+      Send node,
+      Node receiver,
+      Name name,
+      Node rhs,
+      A arg);
+
+  /// If-null assignment expression of [rhs] to the [name] property on
+  /// [receiver] if not null. That is, [rhs] is only evaluated and assigned,
+  /// if the value of [receiver] is _not_ `null` and the value of [name] on
+  /// [receiver] is `null`.
+  ///
+  /// For instance:
+  ///
+  ///     m(receiver, rhs) => receiver?.foo ??= rhs;
+  ///
+  R visitIfNotNullDynamicPropertySetIfNull(
+      Send node,
+      Node receiver,
+      Name name,
+      Node rhs,
+      A arg);
+
+  /// If-null assignment expression of [rhs] to the [name] property on `this`.
+  /// That is, [rhs] is only evaluated and assigned, if the value of [name] on
+  /// `this` is `null`.
+  ///
+  /// For instance:
+  ///
+  ///     class C {
+  ///       m(rhs) => this.foo ??= rhs;
+  ///     }
+  ///
+  /// or
+  ///
+  ///     class C {
+  ///       m(rhs) => foo ??= rhs;
+  ///     }
+  ///
+  R visitThisPropertySetIfNull(
+      Send node,
+      Name name,
+      Node rhs,
+      A arg);
+
+  /// If-null assignment expression of [rhs] to [parameter]. That is, [rhs] is
+  /// only evaluated and assigned, if the value of the [parameter] is `null`.
+  ///
+  /// For instance:
+  ///
+  ///     m(parameter, rhs) => parameter ??= rhs;
+  ///
+  R visitParameterSetIfNull(
+      Send node,
+      ParameterElement parameter,
+      Node rhs,
+      A arg);
+
+  /// If-null assignment expression of [rhs] to the final [parameter]. That is,
+  /// [rhs] is only evaluated and assigned, if the value of the [parameter] is
+  /// `null`.
+  ///
+  /// For instance:
+  ///
+  ///     m(final parameter, rhs) => parameter ??= rhs;
+  ///
+  R visitFinalParameterSetIfNull(
+      Send node,
+      ParameterElement parameter,
+      Node rhs,
+      A arg);
+
+  /// If-null assignment expression of [rhs] to the local [variable]. That is,
+  /// [rhs] is only evaluated and assigned, if the value of the [variable] is
+  /// `null`.
+  ///
+  /// For instance:
+  ///
+  ///     m(rhs) {
+  ///       var variable;
+  ///       variable ??= rhs;
+  ///     }
+  ///
+  R visitLocalVariableSetIfNull(
+      Send node,
+      LocalVariableElement variable,
+      Node rhs,
+      A arg);
+
+  /// If-null assignment expression of [rhs] to the final local [variable]. That
+  /// is, [rhs] is only evaluated and assigned, if the value of the [variable]
+  /// is `null`.
+  ///
+  /// For instance:
+  ///
+  ///     m(rhs) {
+  ///       final variable = 0;
+  ///       variable ??= rhs;
+  ///     }
+  ///
+  R visitFinalLocalVariableSetIfNull(
+      Send node,
+      LocalVariableElement variable,
+      Node rhs,
+      A arg);
+
+  /// If-null assignment expression of [rhs] to the local [function]. That is,
+  /// [rhs] is only evaluated and assigned, if the value of the [function] is
+  /// `null`. The behavior is thus equivalent to a closurization of [function].
+  ///
+  /// For instance:
+  ///
+  ///     m(rhs) {
+  ///       function() {}
+  ///       function ??= rhs;
+  ///     }
+  ///
+  R visitLocalFunctionSetIfNull(
+      Send node,
+      LocalFunctionElement function,
+      Node rhs,
+      A arg);
+
+  /// If-null assignment expression of [rhs] to the static [field]. That is,
+  /// [rhs] is only evaluated and assigned, if the value of the [field] is
+  /// `null`.
+  ///
+  /// For instance:
+  ///
+  ///     class C {
+  ///       static var field;
+  ///       m(rhs) => field ??= rhs;
+  ///     }
+  ///
+  R visitStaticFieldSetIfNull(
+      Send node,
+      FieldElement field,
+      Node rhs,
+      A arg);
+
+  /// If-null assignment expression of [rhs] to the final static [field]. That
+  /// is, [rhs] is only evaluated and assigned, if the value of the [field] is
+  /// `null`.
+  ///
+  /// For instance:
+  ///
+  ///     class C {
+  ///       static final field = 0;
+  ///       m(rhs) => field ??= rhs;
+  ///     }
+  ///
+  R visitFinalStaticFieldSetIfNull(
+      Send node,
+      FieldElement field,
+      Node rhs,
+      A arg);
+
+  /// If-null assignment expression of [rhs] to the static property defined by
+  /// [getter] and [setter]. That is, [rhs] is only evaluated and assigned to
+  /// the [setter], if the value of the [getter] is `null`.
+  ///
+  /// For instance:
+  ///
+  ///     class C {
+  ///       static get o => 0;
+  ///       static set o(_) {}
+  ///       m(rhs) => o ??= rhs;
+  ///     }
+  ///
+  R visitStaticGetterSetterSetIfNull(
+      Send node,
+      FunctionElement getter,
+      FunctionElement setter,
+      Node rhs,
+      A arg);
+
+  /// If-null assignment expression of [rhs] to the static property defined by
+  /// [method] and [setter]. That is, [rhs] is only evaluated and assigned to
+  /// the [setter], if the value of the [method] is `null`. The behavior is thus
+  /// equivalent to a closurization of [method].
+  ///
+  /// For instance:
+  ///
+  ///     class C {
+  ///       static o() {}
+  ///       static set o(_) {}
+  ///       m(rhs) => o ??= rhs;
+  ///     }
+  ///
+  R visitStaticMethodSetterSetIfNull(
+      Send node,
+      MethodElement method,
+      MethodElement setter,
+      Node rhs,
+      A arg);
+
+  /// If-null assignment expression of [rhs] to the static [method]. That is,
+  /// [rhs] is only evaluated and assigned, if the value of the [method] is
+  /// `null`. The behavior is thus equivalent to a closurization of [method].
+  ///
+  /// For instance:
+  ///
+  ///     o() {}
+  ///     m(rhs) => o ??= rhs;
+  ///
+  R visitStaticMethodSetIfNull(
+      Send node,
+      FunctionElement method,
+      Node rhs,
+      A arg);
+
+  /// If-null assignment expression of [rhs] to the top level [field]. That is,
+  /// [rhs] is only evaluated and assigned, if the value of the [field] is
+  /// `null`.
+  ///
+  /// For instance:
+  ///
+  ///     var field;
+  ///     m(rhs) => field ??= rhs;
+  ///
+  R visitTopLevelFieldSetIfNull(
+      Send node,
+      FieldElement field,
+      Node rhs,
+      A arg);
+
+  /// If-null assignment expression of [rhs] to the final top level [field].
+  /// That is, [rhs] is only evaluated and assigned, if the value of the [field]
+  /// is `null`.
+  ///
+  /// For instance:
+  ///
+  ///     final field = 0;
+  ///     m(rhs) => field ??= rhs;
+  ///
+  R visitFinalTopLevelFieldSetIfNull(
+      Send node,
+      FieldElement field,
+      Node rhs,
+      A arg);
+
+  /// If-null assignment expression of [rhs] to the top level property defined
+  /// by [getter] and [setter]. That is, [rhs] is only evaluated and assigned to
+  /// the [setter], if the value of the [getter] is `null`.
+  ///
+  /// For instance:
+  ///
+  ///     get o => 0;
+  ///     set o(_) {}
+  ///     m(rhs) => o ??= rhs;
+  ///
+  R visitTopLevelGetterSetterSetIfNull(
+      Send node,
+      FunctionElement getter,
+      FunctionElement setter,
+      Node rhs,
+      A arg);
+
+  /// If-null assignment expression of [rhs] to the top level property defined
+  /// by [method] and [setter]. That is, [rhs] is only evaluated and assigned to
+  /// the [setter], if the value of the [method] is `null`. The behavior is thus
+  /// equivalent to a closurization of [method].
+  ///
+  /// For instance:
+  ///
+  ///     o() {}
+  ///     set o(_) {}
+  ///     m(rhs) => o ??= rhs;
+  ///
+  R visitTopLevelMethodSetterSetIfNull(
+      Send node,
+      FunctionElement method,
+      FunctionElement setter,
+      Node rhs,
+      A arg);
+
+  /// If-null assignment expression of [rhs] to the top level [method]. That is,
+  /// [rhs] is only evaluated and assigned, if the value of the [method] is
+  /// `null`. The behavior is thus equivalent to a closurization of [method].
+  ///
+  /// For instance:
+  ///
+  ///     o() {}
+  ///     m(rhs) => o ??= rhs;
+  ///
+  R visitTopLevelMethodSetIfNull(
+      Send node,
+      FunctionElement method,
+      Node rhs,
+      A arg);
+
+  /// If-null assignment expression of [rhs] to the super [field]. That is,
+  /// [rhs] is only evaluated and assigned, if the value of the [field] is
+  /// `null`.
+  ///
+  /// For instance:
+  ///
+  ///     class B {
+  ///       var field;
+  ///     }
+  ///     class C extends B {
+  ///       m(rhs) => super.field ??= rhs;
+  ///     }
+  ///
+  R visitSuperFieldSetIfNull(
+      Send node,
+      FieldElement field,
+      Node rhs,
+      A arg);
+
+  /// If-null assignment expression of [rhs] to the final super [field]. That
+  /// is, [rhs] is only evaluated and assigned, if the value of the [field] is
+  /// `null`.
+  ///
+  /// For instance:
+  ///
+  ///     class B {
+  ///       final field = 42;
+  ///     }
+  ///     class C extends B {
+  ///       m(rhs) => super.field ??= rhs;
+  ///     }
+  ///
+  R visitFinalSuperFieldSetIfNull(
+      Send node,
+      FieldElement field,
+      Node rhs,
+      A arg);
+
+  /// If-null assignment expression of [rhs] to the super property defined
+  /// by [readField] and [writtenField]. That is, [rhs] is only evaluated and
+  /// assigned to the [writtenField], if the value of the [readField] is `null`.
+  ///
+  /// For instance:
+  ///
+  ///     class A {
+  ///       var field;
+  ///     }
+  ///     class B extends A {
+  ///       final field;
+  ///     }
+  ///     class C extends B {
+  ///       m() => super.field ??= rhs;
+  ///     }
+  ///
+  R visitSuperFieldFieldSetIfNull(
+      Send node,
+      FieldElement readField,
+      FieldElement writtenField,
+      Node rhs,
+      A arg);
+
+  /// If-null assignment expression of [rhs] to the super property defined
+  /// by [getter] and [setter]. That is, [rhs] is only evaluated and assigned to
+  /// the [setter], if the value of the [getter] is `null`.
+  ///
+  /// For instance:
+  ///
+  ///     class B {
+  ///       get o => 0;
+  ///       set o(_) {}
+  ///     }
+  ///     class C extends B {
+  ///       m(rhs) => super.o ??= rhs;
+  ///     }
+  ///
+  R visitSuperGetterSetterSetIfNull(
+      Send node,
+      FunctionElement getter,
+      FunctionElement setter,
+      Node rhs,
+      A arg);
+
+  /// If-null assignment expression of [rhs] to the super property defined
+  /// by [method] and [setter]. That is, [rhs] is only evaluated and assigned to
+  /// the [setter], if the value of the [method] is `null`. The behavior is thus
+  /// equivalent to a closurization of [method].
+  ///
+  /// For instance:
+  ///
+  ///     class B {
+  ///       o() {}
+  ///       set o(_) {}
+  ///     }
+  ///     class C extends B {
+  ///       m(rhs) => super.o ??= rhs;
+  ///     }
+  ///
+  R visitSuperMethodSetterSetIfNull(
+      Send node,
+      FunctionElement method,
+      FunctionElement setter,
+      Node rhs,
+      A arg);
+
+  /// If-null assignment expression of [rhs] to the super [method].
+  /// That is, [rhs] is only evaluated and assigned, if the value of
+  /// the [method] is `null`. The behavior is thus equivalent to a closurization
+  /// of [method].
+  ///
+  /// For instance:
+  ///
+  ///     class B {
+  ///       o() {}
+  ///     }
+  ///     class C extends B {
+  ///       m(rhs) => super.o ??= rhs;
+  ///     }
+  ///
+  R visitSuperMethodSetIfNull(
+      Send node,
+      FunctionElement method,
+      Node rhs,
+      A arg);
+
+  /// If-null assignment expression of [rhs] to the super property defined
+  /// by [setter] with no corresponding getter. That is, [rhs] is only evaluated
+  /// and assigned to the [setter], if the value of the unresolved getter is
+  /// `null`. The behavior is thus equivalent to a no such method error.
+  ///
+  /// For instance:
+  ///
+  ///     class B {
+  ///       set o(_) {}
+  ///     }
+  ///     class C extends B {
+  ///       m(rhs) => super.o ??= rhs;
+  ///     }
+  ///
+  R visitUnresolvedSuperGetterSetIfNull(
+      Send node,
+      Element element,
+      MethodElement setter,
+      Node rhs,
+      A arg);
+
+  /// If-null assignment expression of [rhs] to the super property defined
+  /// by [getter] with no corresponding setter. That is, [rhs] is only evaluated
+  /// and assigned to the unresolved setter, if the value of the [getter] is
+  /// `null`.
+  ///
+  /// For instance:
+  ///
+  ///     class B {
+  ///       get o => 42;
+  ///     }
+  ///     class C extends B {
+  ///       m(rhs) => super.o ??= rhs;
+  ///     }
+  ///
+  R visitUnresolvedSuperSetterSetIfNull(
+      Send node,
+      MethodElement getter,
+      Element element,
+      Node rhs,
+      A arg);
+
+  /// If-null assignment expression of [rhs] to the top level property defined
+  /// by [field] and [setter]. That is, [rhs] is only evaluated and assigned to
+  /// the [setter], if the value of the [field] is `null`.
+  ///
+  /// For instance:
+  ///
+  ///     class A {
+  ///       var o;
+  ///     }
+  ///     class B extends A {
+  ///       set o(_) {}
+  ///     }
+  ///     class C extends B {
+  ///       m(rhs) => super.o ??= rhs;
+  ///     }
+  ///
+  R visitSuperFieldSetterSetIfNull(
+      Send node,
+      FieldElement field,
+      FunctionElement setter,
+      Node rhs,
+      A arg);
+
+  /// If-null assignment expression of [rhs] to the top level property defined
+  /// by [getter] and [field]. That is, [rhs] is only evaluated and assigned to
+  /// the [field], if the value of the [getter] is `null`.
+  ///
+  /// For instance:
+  ///
+  ///     class A {
+  ///       var o;
+  ///     }
+  ///     class B extends A {
+  ///       get o => 0;
+  ///     }
+  ///     class C extends B {
+  ///       m(rhs) => super.o ??= rhs;
+  ///     }
+  ///
+  R visitSuperGetterFieldSetIfNull(
+      Send node,
+      FunctionElement getter,
+      FieldElement field,
+      Node rhs,
+      A arg);
+
+  /// If-null assignment expression of [rhs] to an unresolved super property.
+  /// That is, [rhs] is only evaluated and assigned, if the value of the
+  /// unresolved property is `null`. The behavior is thus equivalent to a no
+  /// such method error.
+  ///
+  /// For instance:
+  ///
+  ///     class B {
+  ///     }
+  ///     class C extends B {
+  ///       m(rhs) => super.unresolved ??= rhs;
+  ///     }
+  ///
+  R visitUnresolvedSuperSetIfNull(
+      Send node,
+      Element element,
+      Node rhs,
+      A arg);
+
+  /// If-null assignment expression of [rhs] to the static property defined
+  /// by [setter] with no corresponding getter. That is, [rhs] is only evaluated
+  /// and assigned to the [setter], if the value of the unresolved
+  /// getter is `null`. The behavior is thus equivalent to a no such method
+  /// error.
+  ///
+  /// For instance:
+  ///
+  ///     class C {
+  ///       set foo(_) {}
+  ///     }
+  ///     m1() => C.foo ??= 42;
+  ///
+  R visitUnresolvedStaticGetterSetIfNull(
+      Send node,
+      Element element,
+      MethodElement setter,
+      Node rhs,
+      A arg);
+
+  /// If-null assignment expression of [rhs] to the top level property defined
+  /// by [setter] with no corresponding getter. That is, [rhs] is only evaluated
+  /// and assigned to the [setter], if the value of the unresolved getter is
+  /// `null`. The behavior is thus equivalent to a no such method error.
+  ///
+  /// For instance:
+  ///
+  ///     set foo(_) {}
+  ///     m1() => foo ??= 42;
+  ///
+  R visitUnresolvedTopLevelGetterSetIfNull(
+      Send node,
+      Element element,
+      MethodElement setter,
+      Node rhs,
+      A arg);
+
+  /// If-null assignment expression of [rhs] to the static property defined
+  /// by [getter] with no corresponding setter. That is, [rhs] is only evaluated
+  /// and assigned to the unresolved setter, if the value of the [getter] is
+  /// `null`.
+  ///
+  /// For instance:
+  ///
+  ///     class C {
+  ///       get foo => 42;
+  ///     }
+  ///     m1() => C.foo ??= 42;
+  ///
+  R visitUnresolvedStaticSetterSetIfNull(
+      Send node,
+      MethodElement getter,
+      Element element,
+      Node rhs,
+      A arg);
+
+  /// If-null assignment expression of [rhs] to the top level property defined
+  /// by [getter] with no corresponding setter. That is, [rhs] is only evaluated
+  /// and assigned to the unresolved setter, if the value of the [getter] is
+  /// `null`.
+  ///
+  /// For instance:
+  ///
+  ///     get foo => 42;
+  ///     m1() => foo ??= 42;
+  ///
+  R visitUnresolvedTopLevelSetterSetIfNull(
+      Send node,
+      MethodElement getter,
+      Element element,
+      Node rhs,
+      A arg);
+
+  /// If-null assignment expression of [rhs] to an unresolved property.
+  /// That is, [rhs] is only evaluated and assigned, if the value of the
+  /// unresolved property is `null`. The behavior is thus equivalent to a no
+  /// such method error.
+  ///
+  /// For instance:
+  ///
+  ///     class C {}
+  ///     m1() => unresolved ??= 42;
+  ///     m2() => C.unresolved ??= 42;
+  ///
+  // TODO(johnniwinther): Split the cases in which a prefix is resolved.
+  R visitUnresolvedSetIfNull(
+      Send node,
+      Element element,
+      Node rhs,
+      A arg);
+
+  /// If-null assignment expression of [rhs] to an invalid expression.
+  ///
+  /// For instance:
+  ///
+  ///     import 'foo.dart' as p;
+  ///
+  ///     m() => p ??= 42;
+  ///
+  R errorInvalidSetIfNull(
+      Send node,
+      ErroneousElement error,
+      Node rhs,
+      A arg);
+
+  /// If-null assignment expression of [rhs] to the class type literal
+  /// [contant]. That is, [rhs] is only evaluated and assigned, if the value
+  /// is of the [constant] is `null`. The behavior is thus equivalent to a type
+  /// literal access.
+  ///
+  /// For instance:
+  ///
+  ///     class C {}
+  ///     m(rhs) => C ??= rhs;
+  ///
+  R visitClassTypeLiteralSetIfNull(
+      Send node,
+      ConstantExpression constant,
+      Node rhs,
+      A arg);
+
+  /// If-null assignment expression of [rhs] to the typedef type literal
+  /// [constant]. That is, [rhs] is only evaluated and assigned, if the value
+  /// is of the [constant] is `null`. The behavior is thus equivalent to a type
+  /// literal access.
+  ///
+  /// For instance:
+  ///
+  ///     typedef F();
+  ///     m(rhs) => F ??= rhs;
+  ///
+  R visitTypedefTypeLiteralSetIfNull(
+      Send node,
+      ConstantExpression constant,
+      Node rhs,
+      A arg);
+
+  /// If-null assignment expression of [rhs] to the type literal for the type
+  /// variable [element]. That is, [rhs] is only evaluated and assigned, if
+  /// the value is of the [element] is `null`. The behavior is thus equivalent to
+  /// a type literal access.
+  ///
+  /// For instance:
+  ///
+  ///     class C<T> {
+  ///       m(rhs) => T ??= rhs;
+  ///     }
+  ///
+  R visitTypeVariableTypeLiteralSetIfNull(
+      Send node,
+      TypeVariableElement element,
+      Node rhs,
+      A arg);
+
+  /// If-null assignment expression of [rhs] to the dynamic type literal
+  /// [constant]. That is, [rhs] is only evaluated and assigned, if the value
+  /// is of the [constant] is `null`. The behavior is thus equivalent to a type
+  /// literal access.
+  ///
+  /// For instance:
+  ///
+  ///     m(rhs) => dynamic ??= rhs;
+  ///
+  R visitDynamicTypeLiteralSetIfNull(
+      Send node,
+      ConstantExpression constant,
+      Node rhs,
+      A arg);
+
   /// Prefix expression with [operator] on a final super [field].
   ///
   /// For instance:
@@ -2618,9 +3290,8 @@
   R visitDynamicPropertyPrefix(
       Send node,
       Node receiver,
+      Name name,
       IncDecOperator operator,
-      Selector getterSelector,
-      Selector setterSelector,
       A arg);
 
   /// Prefix expression with [operator] of the property on a possibly null
@@ -2634,9 +3305,8 @@
   R visitIfNotNullDynamicPropertyPrefix(
       Send node,
       Node receiver,
+      Name name,
       IncDecOperator operator,
-      Selector getterSelector,
-      Selector setterSelector,
       A arg);
 
   /// Prefix expression with [operator] on a [parameter].
@@ -2727,9 +3397,8 @@
   ///
   R visitThisPropertyPrefix(
       Send node,
+      Name name,
       IncDecOperator operator,
-      Selector getterSelector,
-      Selector setterSelector,
       A arg);
 
   /// Prefix expression with [operator] on a static [field].
@@ -3105,9 +3774,8 @@
   R visitDynamicPropertyPostfix(
       Send node,
       Node receiver,
+      Name name,
       IncDecOperator operator,
-      Selector getterSelector,
-      Selector setterSelector,
       A arg);
 
   /// Postfix expression with [operator] of the property on a possibly null
@@ -3121,9 +3789,8 @@
   R visitIfNotNullDynamicPropertyPostfix(
       Send node,
       Node receiver,
+      Name name,
       IncDecOperator operator,
-      Selector getterSelector,
-      Selector setterSelector,
       A arg);
 
   /// Postfix expression with [operator] on a [parameter].
@@ -3214,9 +3881,8 @@
   ///
   R visitThisPropertyPostfix(
       Send node,
+      Name name,
       IncDecOperator operator,
-      Selector getterSelector,
-      Selector setterSelector,
       A arg);
 
   /// Postfix expression with [operator] on a static [field].
@@ -3605,7 +4271,7 @@
       Send node,
       ConstantExpression constant,
       NodeList arguments,
-      CallStructure callStreucture,
+      CallStructure callStructure,
       A arg);
 
   /// Read of the unresolved [element].
diff --git a/pkg/compiler/lib/src/resolution/semantic_visitor_mixins.dart b/pkg/compiler/lib/src/resolution/semantic_visitor_mixins.dart
index ec45561..5e15a7d 100644
--- a/pkg/compiler/lib/src/resolution/semantic_visitor_mixins.dart
+++ b/pkg/compiler/lib/src/resolution/semantic_visitor_mixins.dart
@@ -27,14 +27,6 @@
   }
 
   @override
-  R errorInvalidAssert(
-      Send node,
-      NodeList arguments,
-      A arg) {
-    return bulkHandleError(node, null, arg);
-  }
-
-  @override
   R errorNonConstantConstructorInvoke(
       NewExpression node,
       Element element,
@@ -205,6 +197,15 @@
       A arg) {
     return bulkHandleError(node, error, arg);
   }
+
+  @override
+  R errorInvalidSetIfNull(
+      Send node,
+      ErroneousElement error,
+      Node rhs,
+      A arg) {
+    return bulkHandleError(node, error, arg);
+  }
 }
 
 /// Mixin that implements all `visitXPrefix` methods of [SemanticSendVisitor] by
@@ -223,9 +224,8 @@
   R visitDynamicPropertyPrefix(
       Send node,
       Node receiver,
+      Name name,
       IncDecOperator operator,
-      Selector getterSelector,
-      Selector setterSelector,
       A arg) {
     return bulkHandlePrefix(node, arg);
   }
@@ -233,9 +233,8 @@
   R visitIfNotNullDynamicPropertyPrefix(
       Send node,
       Node receiver,
+      Name name,
       IncDecOperator operator,
-      Selector getterSelector,
-      Selector setterSelector,
       A arg) {
     return bulkHandlePrefix(node, arg);
   }
@@ -402,9 +401,8 @@
   @override
   R visitThisPropertyPrefix(
       Send node,
+      Name name,
       IncDecOperator operator,
-      Selector getterSelector,
-      Selector setterSelector,
       A arg) {
     return bulkHandlePrefix(node, arg);
   }
@@ -650,9 +648,8 @@
   R visitDynamicPropertyPostfix(
       Send node,
       Node receiver,
+      Name name,
       IncDecOperator operator,
-      Selector getterSelector,
-      Selector setterSelector,
       A arg) {
     return bulkHandlePostfix(node, arg);
   }
@@ -661,9 +658,8 @@
   R visitIfNotNullDynamicPropertyPostfix(
       Send node,
       Node receiver,
+      Name name,
       IncDecOperator operator,
-      Selector getterSelector,
-      Selector setterSelector,
       A arg) {
     return bulkHandlePostfix(node, arg);
   }
@@ -829,9 +825,8 @@
   @override
   R visitThisPropertyPostfix(
       Send node,
+      Name name,
       IncDecOperator operator,
-      Selector getterSelector,
-      Selector setterSelector,
       A arg) {
     return bulkHandlePostfix(node, arg);
   }
@@ -1085,10 +1080,9 @@
   R visitDynamicPropertyCompound(
       Send node,
       Node receiver,
+      Name name,
       AssignmentOperator operator,
       Node rhs,
-      Selector getterSelector,
-      Selector setterSelector,
       A arg) {
     return bulkHandleCompound(node, arg);
   }
@@ -1097,10 +1091,9 @@
   R visitIfNotNullDynamicPropertyCompound(
       Send node,
       Node receiver,
+      Name name,
       AssignmentOperator operator,
       Node rhs,
-      Selector getterSelector,
-      Selector setterSelector,
       A arg) {
     return bulkHandleCompound(node, arg);
   }
@@ -1214,10 +1207,9 @@
   @override
   R visitThisPropertyCompound(
       Send node,
+      Name name,
       AssignmentOperator operator,
       Node rhs,
-      Selector getterSelector,
-      Selector setterSelector,
       A arg) {
     return bulkHandleCompound(node, arg);
   }
@@ -1480,6 +1472,378 @@
   }
 }
 
+/// Mixin that implements all `visitXSetIfNull` methods of [SemanticSendVisitor]
+/// by delegating to a bulk handler.
+///
+/// Use this mixin to provide a trivial implementation for all `xSetIfNull`
+/// methods.
+abstract class SetIfNullBulkMixin<R, A>
+    implements SemanticSendVisitor<R, A>, BulkHandle<R, A> {
+
+  R bulkHandleSetIfNull(Send node, A arg) {
+    return bulkHandleNode(node, "If null assignment `#` unhandled.", arg);
+  }
+
+  @override
+  R visitClassTypeLiteralSetIfNull(
+      Send node,
+      ConstantExpression constant,
+      Node rhs,
+      A arg) {
+    return bulkHandleSetIfNull(node, arg);
+  }
+
+  @override
+  R visitDynamicPropertySetIfNull(
+      Send node,
+      Node receiver,
+      Name name,
+      Node rhs,
+      A arg) {
+    return bulkHandleSetIfNull(node, arg);
+  }
+
+  @override
+  R visitDynamicTypeLiteralSetIfNull(
+      Send node,
+      ConstantExpression constant,
+      Node rhs,
+      A arg) {
+    return bulkHandleSetIfNull(node, arg);
+  }
+
+  @override
+  R visitFinalLocalVariableSetIfNull(
+      Send node,
+      LocalVariableElement variable,
+      Node rhs,
+      A arg) {
+    return bulkHandleSetIfNull(node, arg);
+  }
+
+  @override
+  R visitFinalParameterSetIfNull(
+      Send node,
+      ParameterElement parameter,
+      Node rhs,
+      A arg) {
+    return bulkHandleSetIfNull(node, arg);
+  }
+
+  @override
+  R visitFinalStaticFieldSetIfNull(
+      Send node,
+      FieldElement field,
+      Node rhs,
+      A arg) {
+    return bulkHandleSetIfNull(node, arg);
+  }
+
+  @override
+  R visitFinalSuperFieldSetIfNull(
+      Send node,
+      FieldElement field,
+      Node rhs,
+      A arg) {
+    return bulkHandleSetIfNull(node, arg);
+  }
+
+  @override
+  R visitFinalTopLevelFieldSetIfNull(
+      Send node,
+      FieldElement field,
+      Node rhs,
+      A arg) {
+    return bulkHandleSetIfNull(node, arg);
+  }
+
+  @override
+  R visitIfNotNullDynamicPropertySetIfNull(
+      Send node,
+      Node receiver,
+      Name name,
+      Node rhs,
+      A arg) {
+    return bulkHandleSetIfNull(node, arg);
+  }
+
+  @override
+  R visitLocalFunctionSetIfNull(
+      Send node,
+      LocalFunctionElement function,
+      Node rhs,
+      A arg) {
+    return bulkHandleSetIfNull(node, arg);
+  }
+
+  @override
+  R visitLocalVariableSetIfNull(
+      Send node,
+      LocalVariableElement variable,
+      Node rhs,
+      A arg) {
+    return bulkHandleSetIfNull(node, arg);
+  }
+
+  @override
+  R visitParameterSetIfNull(
+      Send node,
+      ParameterElement parameter,
+      Node rhs,
+      A arg) {
+    return bulkHandleSetIfNull(node, arg);
+  }
+
+  @override
+  R visitStaticFieldSetIfNull(
+      Send node,
+      FieldElement field,
+      Node rhs,
+      A arg) {
+    return bulkHandleSetIfNull(node, arg);
+  }
+
+  @override
+  R visitStaticGetterSetterSetIfNull(
+      Send node,
+      FunctionElement getter,
+      FunctionElement setter,
+      Node rhs,
+      A arg) {
+    return bulkHandleSetIfNull(node, arg);
+  }
+
+  @override
+  R visitStaticMethodSetIfNull(
+      Send node,
+      FunctionElement method,
+      Node rhs,
+      A arg) {
+    return bulkHandleSetIfNull(node, arg);
+  }
+
+  @override
+  R visitStaticMethodSetterSetIfNull(
+      Send node,
+      MethodElement method,
+      MethodElement setter,
+      Node rhs,
+      A arg) {
+    return bulkHandleSetIfNull(node, arg);
+  }
+
+  @override
+  R visitSuperFieldFieldSetIfNull(
+      Send node,
+      FieldElement readField,
+      FieldElement writtenField,
+      Node rhs,
+      A arg) {
+    return bulkHandleSetIfNull(node, arg);
+  }
+
+  @override
+  R visitSuperFieldSetIfNull(
+      Send node,
+      FieldElement field,
+      Node rhs,
+      A arg) {
+    return bulkHandleSetIfNull(node, arg);
+  }
+
+  @override
+  R visitSuperFieldSetterSetIfNull(
+      Send node,
+      FieldElement field,
+      FunctionElement setter,
+      Node rhs,
+      A arg) {
+    return bulkHandleSetIfNull(node, arg);
+  }
+
+  @override
+  R visitSuperGetterFieldSetIfNull(
+      Send node,
+      FunctionElement getter,
+      FieldElement field,
+      Node rhs,
+      A arg) {
+    return bulkHandleSetIfNull(node, arg);
+  }
+
+  @override
+  R visitSuperGetterSetterSetIfNull(
+      Send node,
+      FunctionElement getter,
+      FunctionElement setter,
+      Node rhs,
+      A arg) {
+    return bulkHandleSetIfNull(node, arg);
+  }
+
+  @override
+  R visitSuperMethodSetIfNull(
+      Send node,
+      FunctionElement method,
+      Node rhs,
+      A arg) {
+    return bulkHandleSetIfNull(node, arg);
+  }
+
+  @override
+  R visitSuperMethodSetterSetIfNull(
+      Send node,
+      FunctionElement method,
+      FunctionElement setter,
+      Node rhs,
+      A arg) {
+    return bulkHandleSetIfNull(node, arg);
+  }
+
+  @override
+  R visitThisPropertySetIfNull(
+      Send node,
+      Name name,
+      Node rhs,
+      A arg) {
+    return bulkHandleSetIfNull(node, arg);
+  }
+
+  @override
+  R visitTopLevelFieldSetIfNull(
+      Send node,
+      FieldElement field,
+      Node rhs,
+      A arg) {
+    return bulkHandleSetIfNull(node, arg);
+  }
+
+  @override
+  R visitTopLevelGetterSetterSetIfNull(
+      Send node,
+      FunctionElement getter,
+      FunctionElement setter,
+      Node rhs,
+      A arg) {
+    return bulkHandleSetIfNull(node, arg);
+  }
+
+  @override
+  R visitTopLevelMethodSetIfNull(
+      Send node,
+      FunctionElement method,
+      Node rhs,
+      A arg) {
+    return bulkHandleSetIfNull(node, arg);
+  }
+
+  @override
+  R visitTopLevelMethodSetterSetIfNull(
+      Send node,
+      FunctionElement method,
+      FunctionElement setter,
+      Node rhs,
+      A arg) {
+    return bulkHandleSetIfNull(node, arg);
+  }
+
+  @override
+  R visitTypeVariableTypeLiteralSetIfNull(
+      Send node,
+      TypeVariableElement element,
+      Node rhs,
+      A arg) {
+    return bulkHandleSetIfNull(node, arg);
+  }
+
+  @override
+  R visitTypedefTypeLiteralSetIfNull(
+      Send node,
+      ConstantExpression constant,
+      Node rhs,
+      A arg) {
+    return bulkHandleSetIfNull(node, arg);
+  }
+
+  @override
+  R visitUnresolvedSetIfNull(
+      Send node,
+      Element element,
+      Node rhs,
+      A arg) {
+    return bulkHandleSetIfNull(node, arg);
+  }
+
+  @override
+  R visitUnresolvedStaticGetterSetIfNull(
+      Send node,
+      Element element,
+      MethodElement setter,
+      Node rhs,
+      A arg) {
+    return bulkHandleSetIfNull(node, arg);
+  }
+
+  @override
+  R visitUnresolvedStaticSetterSetIfNull(
+      Send node,
+      MethodElement getter,
+      Element element,
+      Node rhs,
+      A arg) {
+    return bulkHandleSetIfNull(node, arg);
+  }
+
+  @override
+  R visitUnresolvedSuperGetterSetIfNull(
+      Send node,
+      Element element,
+      MethodElement setter,
+      Node rhs,
+      A arg) {
+    return bulkHandleSetIfNull(node, arg);
+  }
+
+  @override
+  R visitUnresolvedSuperSetIfNull(
+      Send node,
+      Element element,
+      Node rhs,
+      A arg) {
+    return bulkHandleSetIfNull(node, arg);
+  }
+
+  @override
+  R visitUnresolvedSuperSetterSetIfNull(
+      Send node,
+      MethodElement getter,
+      Element element,
+      Node rhs,
+      A arg) {
+    return bulkHandleSetIfNull(node, arg);
+  }
+
+  @override
+  R visitUnresolvedTopLevelGetterSetIfNull(
+      Send node,
+      Element element,
+      MethodElement setter,
+      Node rhs,
+      A arg) {
+    return bulkHandleSetIfNull(node, arg);
+  }
+
+  @override
+  R visitUnresolvedTopLevelSetterSetIfNull(
+      Send node,
+      MethodElement getter,
+      Element element,
+      Node rhs,
+      A arg) {
+    return bulkHandleSetIfNull(node, arg);
+  }
+}
+
 /// Mixin that implements all `visitXInvoke` methods of [SemanticSendVisitor] by
 /// delegating to a bulk handler.
 ///
@@ -1537,7 +1901,7 @@
       Send node,
       Node expression,
       NodeList arguments,
-      Selector selector,
+      CallStructure callStructure,
       A arg) {
     return bulkHandleInvoke(node, arg);
   }
@@ -1825,7 +2189,7 @@
   R visitDynamicPropertyGet(
       Send node,
       Node receiver,
-      Selector selector,
+      Name name,
       A arg) {
     return bulkHandleGet(node, arg);
   }
@@ -1834,7 +2198,7 @@
   R visitIfNotNullDynamicPropertyGet(
       Send node,
       Node receiver,
-      Selector selector,
+      Name name,
       A arg) {
     return bulkHandleGet(node, arg);
   }
@@ -1927,7 +2291,7 @@
   @override
   R visitThisPropertyGet(
       Send node,
-      Selector selector,
+      Name name,
       A arg) {
     return bulkHandleGet(node, arg);
   }
@@ -2037,7 +2401,7 @@
   R visitDynamicPropertySet(
       SendSet node,
       Node receiver,
-      Selector selector,
+      Name name,
       Node rhs,
       A arg) {
     return bulkHandleSet(node, arg);
@@ -2047,7 +2411,7 @@
   R visitIfNotNullDynamicPropertySet(
       SendSet node,
       Node receiver,
-      Selector selector,
+      Name name,
       Node rhs,
       A arg) {
     return bulkHandleSet(node, arg);
@@ -2110,7 +2474,7 @@
   @override
   R visitThisPropertySet(
       SendSet node,
-      Selector selector,
+      Name name,
       Node rhs,
       A arg) {
     return bulkHandleSet(node, arg);
@@ -2571,14 +2935,6 @@
   }
 
   @override
-  R visitAssert(
-      Send node,
-      Node expression,
-      A arg) {
-    return bulkHandleNode(node, 'Assert `#` unhandled.', arg);
-  }
-
-  @override
   R visitIs(
       Send node,
       Node expression,
@@ -3158,6 +3514,7 @@
          InvokeBulkMixin<R, A>,
          IndexSetBulkMixin<R, A>,
          CompoundBulkMixin<R, A>,
+         SetIfNullBulkMixin<R, A>,
          UnaryBulkMixin<R, A>,
          BaseBulkMixin<R, A>,
          BinaryBulkMixin<R, A>,
@@ -4162,15 +4519,6 @@
   }
 
   @override
-  R visitAssert(
-      Send node,
-      Node expression,
-      A arg) {
-    apply(expression, arg);
-    return null;
-  }
-
-  @override
   R visitBinary(
       Send node,
       Node left,
@@ -4267,10 +4615,9 @@
   R visitDynamicPropertyCompound(
       Send node,
       Node receiver,
+      Name name,
       AssignmentOperator operator,
       Node rhs,
-      Selector getterSelector,
-      Selector setterSelector,
       A arg) {
     apply(receiver, arg);
     apply(rhs, arg);
@@ -4281,10 +4628,9 @@
   R visitIfNotNullDynamicPropertyCompound(
       Send node,
       Node receiver,
+      Name name,
       AssignmentOperator operator,
       Node rhs,
-      Selector getterSelector,
-      Selector setterSelector,
       A arg) {
     apply(receiver, arg);
     apply(rhs, arg);
@@ -4295,7 +4641,7 @@
   R visitDynamicPropertyGet(
       Send node,
       Node receiver,
-      Selector selector,
+      Name name,
       A arg) {
     apply(receiver, arg);
     return null;
@@ -4305,7 +4651,7 @@
   R visitIfNotNullDynamicPropertyGet(
       Send node,
       Node receiver,
-      Selector selector,
+      Name name,
       A arg) {
     apply(receiver, arg);
     return null;
@@ -4339,9 +4685,8 @@
   R visitDynamicPropertyPostfix(
       Send node,
       Node receiver,
+      Name name,
       IncDecOperator operator,
-      Selector getterSelector,
-      Selector setterSelector,
       A arg) {
     apply(receiver, arg);
     return null;
@@ -4351,9 +4696,8 @@
   R visitIfNotNullDynamicPropertyPostfix(
       Send node,
       Node receiver,
+      Name name,
       IncDecOperator operator,
-      Selector getterSelector,
-      Selector setterSelector,
       A arg) {
     apply(receiver, arg);
     return null;
@@ -4363,9 +4707,8 @@
   R visitDynamicPropertyPrefix(
       Send node,
       Node receiver,
+      Name name,
       IncDecOperator operator,
-      Selector getterSelector,
-      Selector setterSelector,
       A arg) {
     apply(receiver, arg);
     return null;
@@ -4375,9 +4718,8 @@
   R visitIfNotNullDynamicPropertyPrefix(
       Send node,
       Node receiver,
+      Name name,
       IncDecOperator operator,
-      Selector getterSelector,
-      Selector setterSelector,
       A arg) {
     apply(receiver, arg);
     return null;
@@ -4387,7 +4729,7 @@
   R visitDynamicPropertySet(
       SendSet node,
       Node receiver,
-      Selector selector,
+      Name name,
       Node rhs,
       A arg) {
     apply(receiver, arg);
@@ -4399,7 +4741,7 @@
   R visitIfNotNullDynamicPropertySet(
       SendSet node,
       Node receiver,
-      Selector selector,
+      Name name,
       Node rhs,
       A arg) {
     apply(receiver, arg);
@@ -4471,7 +4813,7 @@
       Send node,
       Node expression,
       NodeList arguments,
-      Selector selector,
+      CallStructure callStructure,
       A arg) {
     apply(expression, arg);
     apply(arguments, arg);
@@ -5260,10 +5602,9 @@
   @override
   R visitThisPropertyCompound(
       Send node,
+      Name name,
       AssignmentOperator operator,
       Node rhs,
-      Selector getterSelector,
-      Selector setterSelector,
       A arg) {
     apply(rhs, arg);
     return null;
@@ -5272,7 +5613,7 @@
   @override
   R visitThisPropertyGet(
       Send node,
-      Selector selector,
+      Name name,
       A arg) {
     return null;
   }
@@ -5290,9 +5631,8 @@
   @override
   R visitThisPropertyPostfix(
       Send node,
+      Name name,
       IncDecOperator operator,
-      Selector getterSelector,
-      Selector setterSelector,
       A arg) {
     return null;
   }
@@ -5300,9 +5640,8 @@
   @override
   R visitThisPropertyPrefix(
       Send node,
+      Name name,
       IncDecOperator operator,
-      Selector getterSelector,
-      Selector setterSelector,
       A arg) {
     return null;
   }
@@ -5310,7 +5649,7 @@
   @override
   R visitThisPropertySet(
       SendSet node,
-      Selector selector,
+      Name name,
       Node rhs,
       A arg) {
     apply(rhs, arg);
@@ -5876,6 +6215,415 @@
   }
 
   @override
+  R errorInvalidSetIfNull(
+      Send node,
+      ErroneousElement error,
+      Node rhs,
+      A arg) {
+    apply(rhs, arg);
+    return null;
+  }
+
+  @override
+  R visitClassTypeLiteralSetIfNull(
+      Send node,
+      ConstantExpression constant,
+      Node rhs,
+      A arg) {
+    apply(rhs, arg);
+    return null;
+  }
+
+  @override
+  R visitDynamicPropertySetIfNull(
+      Send node,
+      Node receiver,
+      Name name,
+      Node rhs,
+      A arg) {
+    apply(receiver, arg);
+    apply(rhs, arg);
+    return null;
+  }
+
+  @override
+  R visitDynamicTypeLiteralSetIfNull(
+      Send node,
+      ConstantExpression constant,
+      Node rhs,
+      A arg) {
+    apply(rhs, arg);
+    return null;
+  }
+
+  @override
+  R visitFinalLocalVariableSetIfNull(
+      Send node,
+      LocalVariableElement variable,
+      Node rhs,
+      A arg) {
+    apply(rhs, arg);
+    return null;
+  }
+
+  @override
+  R visitFinalParameterSetIfNull(
+      Send node,
+      ParameterElement parameter,
+      Node rhs,
+      A arg) {
+    apply(rhs, arg);
+    return null;
+  }
+
+  @override
+  R visitFinalStaticFieldSetIfNull(
+      Send node,
+      FieldElement field,
+      Node rhs,
+      A arg) {
+    apply(rhs, arg);
+    return null;
+  }
+
+  @override
+  R visitFinalSuperFieldSetIfNull(
+      Send node,
+      FieldElement field,
+      Node rhs,
+      A arg) {
+    apply(rhs, arg);
+    return null;
+  }
+
+  @override
+  R visitFinalTopLevelFieldSetIfNull(
+      Send node,
+      FieldElement field,
+      Node rhs,
+      A arg) {
+    apply(rhs, arg);
+    return null;
+  }
+
+  @override
+  R visitIfNotNullDynamicPropertySetIfNull(
+      Send node,
+      Node receiver,
+      Name name,
+      Node rhs,
+      A arg) {
+    apply(receiver, arg);
+    apply(rhs, arg);
+    return null;
+  }
+
+  @override
+  R visitLocalFunctionSetIfNull(
+      Send node,
+      LocalFunctionElement function,
+      Node rhs,
+      A arg) {
+    apply(rhs, arg);
+    return null;
+  }
+
+  @override
+  R visitLocalVariableSetIfNull(
+      Send node,
+      LocalVariableElement variable,
+      Node rhs,
+      A arg) {
+    apply(rhs, arg);
+    return null;
+  }
+
+  @override
+  R visitParameterSetIfNull(
+      Send node,
+      ParameterElement parameter,
+      Node rhs,
+      A arg) {
+    apply(rhs, arg);
+    return null;
+  }
+
+  @override
+  R visitStaticFieldSetIfNull(
+      Send node,
+      FieldElement field,
+      Node rhs,
+      A arg) {
+    apply(rhs, arg);
+    return null;
+  }
+
+  @override
+  R visitStaticGetterSetterSetIfNull(
+      Send node,
+      FunctionElement getter,
+      FunctionElement setter,
+      Node rhs,
+      A arg) {
+    apply(rhs, arg);
+    return null;
+  }
+
+  @override
+  R visitStaticMethodSetIfNull(
+      Send node,
+      FunctionElement method,
+      Node rhs,
+      A arg) {
+    apply(rhs, arg);
+    return null;
+  }
+
+  @override
+  R visitStaticMethodSetterSetIfNull(
+      Send node,
+      MethodElement method,
+      MethodElement setter,
+      Node rhs,
+      A arg) {
+    apply(rhs, arg);
+    return null;
+  }
+
+  @override
+  R visitSuperFieldFieldSetIfNull(
+      Send node,
+      FieldElement readField,
+      FieldElement writtenField,
+      Node rhs,
+      A arg) {
+    apply(rhs, arg);
+    return null;
+  }
+
+  @override
+  R visitSuperFieldSetIfNull(
+      Send node,
+      FieldElement field,
+      Node rhs,
+      A arg) {
+    apply(rhs, arg);
+    return null;
+  }
+
+  @override
+  R visitSuperFieldSetterSetIfNull(
+      Send node,
+      FieldElement field,
+      FunctionElement setter,
+      Node rhs,
+      A arg) {
+    apply(rhs, arg);
+    return null;
+  }
+
+  @override
+  R visitSuperGetterFieldSetIfNull(
+      Send node,
+      FunctionElement getter,
+      FieldElement field,
+      Node rhs,
+      A arg) {
+    apply(rhs, arg);
+    return null;
+  }
+
+  @override
+  R visitSuperGetterSetterSetIfNull(
+      Send node,
+      FunctionElement getter,
+      FunctionElement setter,
+      Node rhs,
+      A arg) {
+    apply(rhs, arg);
+    return null;
+  }
+
+  @override
+  R visitSuperMethodSetIfNull(
+      Send node,
+      FunctionElement method,
+      Node rhs,
+      A arg) {
+    apply(rhs, arg);
+    return null;
+  }
+
+  @override
+  R visitSuperMethodSetterSetIfNull(
+      Send node,
+      FunctionElement method,
+      FunctionElement setter,
+      Node rhs,
+      A arg) {
+    apply(rhs, arg);
+    return null;
+  }
+
+  @override
+  R visitThisPropertySetIfNull(
+      Send node,
+      Name name,
+      Node rhs,
+      A arg) {
+    apply(rhs, arg);
+    return null;
+  }
+
+  @override
+  R visitTopLevelFieldSetIfNull(
+      Send node,
+      FieldElement field,
+      Node rhs,
+      A arg) {
+    apply(rhs, arg);
+    return null;
+  }
+
+  @override
+  R visitTopLevelGetterSetterSetIfNull(
+      Send node,
+      FunctionElement getter,
+      FunctionElement setter,
+      Node rhs,
+      A arg) {
+    apply(rhs, arg);
+    return null;
+  }
+
+  @override
+  R visitTopLevelMethodSetIfNull(
+      Send node,
+      FunctionElement method,
+      Node rhs,
+      A arg) {
+    apply(rhs, arg);
+    return null;
+  }
+
+  @override
+  R visitTopLevelMethodSetterSetIfNull(
+      Send node,
+      FunctionElement method,
+      FunctionElement setter,
+      Node rhs,
+      A arg) {
+    apply(rhs, arg);
+    return null;
+  }
+
+  @override
+  R visitTypeVariableTypeLiteralSetIfNull(
+      Send node,
+      TypeVariableElement element,
+      Node rhs,
+      A arg) {
+    apply(rhs, arg);
+    return null;
+  }
+
+  @override
+  R visitTypedefTypeLiteralSetIfNull(
+      Send node,
+      ConstantExpression constant,
+      Node rhs,
+      A arg) {
+    apply(rhs, arg);
+    return null;
+  }
+
+  @override
+  R visitUnresolvedSetIfNull(
+      Send node,
+      Element element,
+      Node rhs,
+      A arg) {
+    apply(rhs, arg);
+    return null;
+  }
+
+  @override
+  R visitUnresolvedStaticGetterSetIfNull(
+      Send node,
+      Element element,
+      MethodElement setter,
+      Node rhs,
+      A arg) {
+    apply(rhs, arg);
+    return null;
+  }
+
+  @override
+  R visitUnresolvedStaticSetterSetIfNull(
+      Send node,
+      MethodElement getter,
+      Element element,
+      Node rhs,
+      A arg) {
+    apply(rhs, arg);
+    return null;
+  }
+
+  @override
+  R visitUnresolvedSuperGetterSetIfNull(
+      Send node,
+      Element element,
+      MethodElement setter,
+      Node rhs,
+      A arg) {
+    apply(rhs, arg);
+    return null;
+  }
+
+  @override
+  R visitUnresolvedSuperSetIfNull(
+      Send node,
+      Element element,
+      Node rhs,
+      A arg) {
+    apply(rhs, arg);
+    return null;
+  }
+
+  @override
+  R visitUnresolvedSuperSetterSetIfNull(
+      Send node,
+      MethodElement getter,
+      Element element,
+      Node rhs,
+      A arg) {
+    apply(rhs, arg);
+    return null;
+  }
+
+  @override
+  R visitUnresolvedTopLevelGetterSetIfNull(
+      Send node,
+      Element element,
+      MethodElement setter,
+      Node rhs,
+      A arg) {
+    apply(rhs, arg);
+    return null;
+  }
+
+  @override
+  R visitUnresolvedTopLevelSetterSetIfNull(
+      Send node,
+      MethodElement getter,
+      Element element,
+      Node rhs,
+      A arg) {
+    apply(rhs, arg);
+    return null;
+  }
+
+  @override
   R visitConstConstructorInvoke(
       NewExpression node,
       ConstructedConstantExpression constant,
@@ -6927,6 +7675,12 @@
     node.visitChildren(this);
     return null;
   }
+
+  @override
+  R visitTypeAnnotation(TypeAnnotation node) {
+    // Skip [Send] contained in type annotations, like `prefix.Type`.
+    return null;
+  }
 }
 
 /// Mixin that groups all non-compound `visitStaticX` and `visitTopLevelX`
@@ -8082,7 +8836,7 @@
   R handleDynamicGet(
       Send node,
       Node receiver,
-      Selector selector,
+      Name name,
       A arg);
 
   R handleDynamicInvoke(
@@ -8095,7 +8849,7 @@
   R handleDynamicSet(
       SendSet node,
       Node receiver,
-      Selector selector,
+      Name name,
       Node rhs,
       A arg);
 
@@ -8103,19 +8857,19 @@
   R visitDynamicPropertyGet(
       Send node,
       Node receiver,
-      Selector selector,
+      Name name,
       A arg) {
-    return handleDynamicGet(node, receiver, selector, arg);
+    return handleDynamicGet(node, receiver, name, arg);
   }
 
   @override
   R visitIfNotNullDynamicPropertyGet(
       Send node,
       Node receiver,
-      Selector selector,
+      Name name,
       A arg) {
     // TODO(johnniwinther): should these redirect to handleDynamicX?
-    return handleDynamicGet(node, receiver, selector, arg);
+    return handleDynamicGet(node, receiver, name, arg);
   }
 
   @override
@@ -8142,28 +8896,28 @@
   R visitDynamicPropertySet(
       SendSet node,
       Node receiver,
-      Selector selector,
+      Name name,
       Node rhs,
       A arg) {
-    return handleDynamicSet(node, receiver, selector, rhs, arg);
+    return handleDynamicSet(node, receiver, name, rhs, arg);
   }
 
   @override
   R visitIfNotNullDynamicPropertySet(
       SendSet node,
       Node receiver,
-      Selector selector,
+      Name name,
       Node rhs,
       A arg) {
-    return handleDynamicSet(node, receiver, selector, rhs, arg);
+    return handleDynamicSet(node, receiver, name, rhs, arg);
   }
 
   @override
   R visitThisPropertyGet(
       Send node,
-      Selector selector,
+      Name name,
       A arg) {
-    return handleDynamicGet(node, null, selector, arg);
+    return handleDynamicGet(node, null, name, arg);
   }
 
   @override
@@ -8178,10 +8932,10 @@
   @override
   R visitThisPropertySet(
       SendSet node,
-      Selector selector,
+      Name name,
       Node rhs,
       A arg) {
-    return handleDynamicSet(node, null, selector, rhs, arg);
+    return handleDynamicSet(node, null, name, rhs, arg);
   }
 }
 
@@ -8196,18 +8950,16 @@
   R handleDynamicCompound(
       Send node,
       Node receiver,
+      Name name,
       AssignmentOperator operator,
       Node rhs,
-      Selector getterSelector,
-      Selector setterSelector,
       A arg);
 
   R handleDynamicPostfixPrefix(
       Send node,
       Node receiver,
+      Name name,
       IncDecOperator operator,
-      Selector getterSelector,
-      Selector setterSelector,
       A arg,
       {bool isPrefix});
 
@@ -8223,114 +8975,98 @@
   R visitDynamicPropertyCompound(
       Send node,
       Node receiver,
+      Name name,
       AssignmentOperator operator,
       Node rhs,
-      Selector getterSelector,
-      Selector setterSelector,
       A arg) {
     return handleDynamicCompound(
-        node, receiver, operator, rhs, getterSelector, setterSelector, arg);
+        node, receiver, name, operator, rhs, arg);
   }
 
   @override
   R visitIfNotNullDynamicPropertyCompound(
       Send node,
       Node receiver,
+      Name name,
       AssignmentOperator operator,
       Node rhs,
-      Selector getterSelector,
-      Selector setterSelector,
       A arg) {
     return handleDynamicCompound(
-        node, receiver, operator, rhs, getterSelector, setterSelector, arg);
+        node, receiver, name, operator, rhs, arg);
   }
 
   @override
   R visitDynamicPropertyPostfix(
       Send node,
       Node receiver,
+      Name name,
       IncDecOperator operator,
-      Selector getterSelector,
-      Selector setterSelector,
       A arg) {
     return handleDynamicPostfixPrefix(
-        node, receiver, operator,
-        getterSelector, setterSelector, arg, isPrefix: false);
+        node, receiver, name, operator, arg, isPrefix: false);
   }
 
   @override
   R visitIfNotNullDynamicPropertyPostfix(
       Send node,
       Node receiver,
+      Name name,
       IncDecOperator operator,
-      Selector getterSelector,
-      Selector setterSelector,
       A arg) {
     return handleDynamicPostfixPrefix(
-        node, receiver, operator,
-        getterSelector, setterSelector, arg, isPrefix: false);
+        node, receiver, name, operator, arg, isPrefix: false);
   }
 
   @override
   R visitDynamicPropertyPrefix(
       Send node,
       Node receiver,
+      Name name,
       IncDecOperator operator,
-      Selector getterSelector,
-      Selector setterSelector,
       A arg) {
     return handleDynamicPostfixPrefix(
-        node, receiver, operator,
-        getterSelector, setterSelector, arg, isPrefix: true);
+        node, receiver, name, operator, arg, isPrefix: true);
   }
 
   @override
   R visitIfNotNullDynamicPropertyPrefix(
       Send node,
       Node receiver,
+      Name name,
       IncDecOperator operator,
-      Selector getterSelector,
-      Selector setterSelector,
       A arg) {
     return handleDynamicPostfixPrefix(
-        node, receiver, operator,
-        getterSelector, setterSelector, arg, isPrefix: true);
+        node, receiver, name, operator, arg, isPrefix: true);
   }
 
   @override
   R visitThisPropertyCompound(
       Send node,
+      Name name,
       AssignmentOperator operator,
       Node rhs,
-      Selector getterSelector,
-      Selector setterSelector,
       A arg) {
-    return handleDynamicCompound(
-        node, null, operator, rhs, getterSelector, setterSelector, arg);
+    return handleDynamicCompound(node, null, name, operator, rhs, arg);
   }
 
   @override
   R visitThisPropertyPostfix(
       Send node,
+      Name name,
       IncDecOperator operator,
-      Selector getterSelector,
-      Selector setterSelector,
       A arg) {
     return handleDynamicPostfixPrefix(
-        node, null, operator,
-        getterSelector, setterSelector, arg, isPrefix: false);
+        node, null, name, operator, arg, isPrefix: false);
   }
 
   @override
   R visitThisPropertyPrefix(
       Send node,
+      Name name,
       IncDecOperator operator,
-      Selector getterSelector,
-      Selector setterSelector,
       A arg) {
     return handleDynamicPostfixPrefix(
-        node, null, operator,
-        getterSelector, setterSelector, arg, isPrefix: true);
+        node, null, name, operator, arg, isPrefix: true);
   }
 
   @override
@@ -8487,59 +9223,52 @@
   R handleDynamicCompounds(
       Send node,
       Node receiver,
+      Name name,
       CompoundRhs rhs,
-      Selector getterSelector,
-      Selector setterSelector,
       A arg);
 
   R visitDynamicPropertyCompound(
       Send node,
       Node receiver,
+      Name name,
       AssignmentOperator operator,
       Node rhs,
-      Selector getterSelector,
-      Selector setterSelector,
       A arg) {
     return handleDynamicCompounds(
         node,
         receiver,
+        name,
         new AssignmentCompound(operator, rhs),
-        getterSelector,
-        setterSelector,
         arg);
   }
 
   R visitIfNotNullDynamicPropertyCompound(
       Send node,
       Node receiver,
+      Name name,
       AssignmentOperator operator,
       Node rhs,
-      Selector getterSelector,
-      Selector setterSelector,
       A arg) {
     return handleDynamicCompounds(
         node,
         receiver,
+        name,
         new AssignmentCompound(operator, rhs),
-        getterSelector,
-        setterSelector,
         arg);
   }
 
   @override
   R visitThisPropertyCompound(
       Send node,
+      Name name,
       AssignmentOperator operator,
       Node rhs,
-      Selector getterSelector,
-      Selector setterSelector,
       A arg) {
     return handleDynamicCompounds(
         node,
         null,
+        name,
         new AssignmentCompound(operator, rhs),
-        getterSelector,
-        setterSelector,
         arg);
   }
 
@@ -8896,32 +9625,28 @@
   R visitDynamicPropertyPrefix(
       Send node,
       Node receiver,
+      Name name,
       IncDecOperator operator,
-      Selector getterSelector,
-      Selector setterSelector,
       A arg) {
     return handleDynamicCompounds(
         node,
         receiver,
+        name,
         new IncDecCompound(CompoundKind.PREFIX, operator),
-        getterSelector,
-        setterSelector,
         arg);
   }
 
   R visitIfNotNullDynamicPropertyPrefix(
       Send node,
       Node receiver,
+      Name name,
       IncDecOperator operator,
-      Selector getterSelector,
-      Selector setterSelector,
       A arg) {
     return handleDynamicCompounds(
         node,
         receiver,
+        name,
         new IncDecCompound(CompoundKind.PREFIX, operator),
-        getterSelector,
-        setterSelector,
         arg);
   }
 
@@ -8970,16 +9695,14 @@
 
   R visitThisPropertyPrefix(
       Send node,
+      Name name,
       IncDecOperator operator,
-      Selector getterSelector,
-      Selector setterSelector,
       A arg) {
     return handleDynamicCompounds(
         node,
         null,
+        name,
         new IncDecCompound(CompoundKind.PREFIX, operator),
-        getterSelector,
-        setterSelector,
         arg);
   }
 
@@ -9216,16 +9939,14 @@
   R visitDynamicPropertyPostfix(
       Send node,
       Node receiver,
+      Name name,
       IncDecOperator operator,
-      Selector getterSelector,
-      Selector setterSelector,
       A arg) {
     return handleDynamicCompounds(
         node,
         receiver,
+        name,
         new IncDecCompound(CompoundKind.POSTFIX, operator),
-        getterSelector,
-        setterSelector,
         arg);
   }
 
@@ -9233,16 +9954,14 @@
   R visitIfNotNullDynamicPropertyPostfix(
       Send node,
       Node receiver,
+      Name name,
       IncDecOperator operator,
-      Selector getterSelector,
-      Selector setterSelector,
       A arg) {
     return handleDynamicCompounds(
         node,
         receiver,
+        name,
         new IncDecCompound(CompoundKind.POSTFIX, operator),
-        getterSelector,
-        setterSelector,
         arg);
   }
 
@@ -9291,16 +10010,14 @@
 
   R visitThisPropertyPostfix(
       Send node,
+      Name name,
       IncDecOperator operator,
-      Selector getterSelector,
-      Selector setterSelector,
       A arg) {
     return handleDynamicCompounds(
         node,
         null,
+        name,
         new IncDecCompound(CompoundKind.POSTFIX, operator),
-        getterSelector,
-        setterSelector,
         arg);
   }
 
@@ -10260,6 +10977,594 @@
   }
 }
 
+/// Simplified handling of if-null assignments.
+abstract class BaseImplementationOfSetIfNullsMixin<R, A>
+    implements SemanticSendVisitor<R, A> {
+
+  /// Handle a super if-null assignments, like `super.foo ??= 42`.
+  R handleSuperSetIfNulls(
+      SendSet node,
+      Element getter,
+      CompoundGetter getterKind,
+      Element setter,
+      CompoundSetter setterKind,
+      Node rhs,
+      A arg);
+
+  /// Handle a static or top level if-null assignments, like `foo ??= 42`.
+  R handleStaticSetIfNulls(
+      SendSet node,
+      Element getter,
+      CompoundGetter getterKind,
+      Element setter,
+      CompoundSetter setterKind,
+      Node rhs,
+      A arg);
+
+  /// Handle a local if-null assignments, like `foo ??= 42`. If [isSetterValid]
+  /// is false [local] is unassignable.
+  R handleLocalSetIfNulls(
+      SendSet node,
+      LocalElement local,
+      Node rhs,
+      A arg,
+      {bool isSetterValid});
+
+  /// Handle a if-null assignments on a type literal constant, like
+  /// `Object ??= 42`.
+  R handleTypeLiteralConstantSetIfNulls(
+      SendSet node,
+      ConstantExpression constant,
+      Node rhs,
+      A arg);
+
+  /// Handle a dynamic if-null assignments, like `o.foo ??= 42`. [receiver] is
+  /// `null` for properties on `this`, like `this.foo ??= 42` or `foo ??= 42`.
+  R handleDynamicSetIfNulls(
+      Send node,
+      Node receiver,
+      Name name,
+      Node rhs,
+      A arg);
+
+  @override
+  R visitClassTypeLiteralSetIfNull(
+      Send node,
+      ConstantExpression constant,
+      Node rhs,
+      A arg) {
+    return handleTypeLiteralConstantSetIfNulls(node, constant, rhs, arg);
+  }
+
+  @override
+  R visitDynamicPropertySetIfNull(
+      Send node,
+      Node receiver,
+      Name name,
+      Node rhs,
+      A arg) {
+    return handleDynamicSetIfNulls(node, receiver, name, rhs, arg);
+  }
+
+  @override
+  R visitDynamicTypeLiteralSetIfNull(
+      Send node,
+      ConstantExpression constant,
+      Node rhs,
+      A arg) {
+    return handleTypeLiteralConstantSetIfNulls(node, constant, rhs, arg);
+  }
+
+  @override
+  R visitFinalLocalVariableSetIfNull(
+      Send node,
+      LocalVariableElement variable,
+      Node rhs,
+      A arg) {
+    return handleLocalSetIfNulls(
+        node, variable, rhs, arg, isSetterValid: false);
+  }
+
+  @override
+  R visitFinalParameterSetIfNull(
+      Send node,
+      ParameterElement parameter,
+      Node rhs,
+      A arg) {
+    return handleLocalSetIfNulls(
+        node, parameter, rhs, arg, isSetterValid: false);
+  }
+
+  @override
+  R visitFinalStaticFieldSetIfNull(
+      Send node,
+      FieldElement field,
+      Node rhs,
+      A arg) {
+    return handleStaticSetIfNulls(
+        node,
+        field,
+        CompoundGetter.FIELD,
+        field,
+        CompoundSetter.INVALID,
+        rhs,
+        arg);
+  }
+
+  @override
+  R visitFinalSuperFieldSetIfNull(
+      Send node,
+      FieldElement field,
+      Node rhs,
+      A arg) {
+    return handleSuperSetIfNulls(
+        node,
+        field,
+        CompoundGetter.FIELD,
+        field,
+        CompoundSetter.INVALID,
+        rhs,
+        arg);
+  }
+
+  @override
+  R visitFinalTopLevelFieldSetIfNull(
+      Send node,
+      FieldElement field,
+      Node rhs,
+      A arg) {
+    return handleStaticSetIfNulls(
+        node,
+        field,
+        CompoundGetter.FIELD,
+        field,
+        CompoundSetter.INVALID,
+        rhs,
+        arg);
+  }
+
+  @override
+  R visitIfNotNullDynamicPropertySetIfNull(
+      Send node,
+      Node receiver,
+      Name name,
+      Node rhs,
+      A arg) {
+    return handleDynamicSetIfNulls(node, receiver, name, rhs, arg);
+  }
+
+  @override
+  R visitLocalFunctionSetIfNull(
+      Send node,
+      LocalFunctionElement function,
+      Node rhs,
+      A arg) {
+    return handleLocalSetIfNulls(
+        node, function, rhs, arg, isSetterValid: false);
+  }
+
+  @override
+  R visitLocalVariableSetIfNull(
+      Send node,
+      LocalVariableElement variable,
+      Node rhs,
+      A arg) {
+    return handleLocalSetIfNulls(
+        node, variable, rhs, arg, isSetterValid: true);
+  }
+
+  @override
+  R visitParameterSetIfNull(
+      Send node,
+      ParameterElement parameter,
+      Node rhs,
+      A arg) {
+    return handleLocalSetIfNulls(
+        node, parameter, rhs, arg, isSetterValid: true);
+  }
+
+  @override
+  R visitStaticFieldSetIfNull(
+      Send node,
+      FieldElement field,
+      Node rhs,
+      A arg) {
+    return handleStaticSetIfNulls(
+        node,
+        field,
+        CompoundGetter.FIELD,
+        field,
+        CompoundSetter.FIELD,
+        rhs,
+        arg);
+  }
+
+  @override
+  R visitStaticGetterSetterSetIfNull(
+      Send node,
+      FunctionElement getter,
+      FunctionElement setter,
+      Node rhs,
+      A arg) {
+    return handleStaticSetIfNulls(
+        node,
+        getter,
+        CompoundGetter.GETTER,
+        setter,
+        CompoundSetter.SETTER,
+        rhs,
+        arg);
+  }
+
+  @override
+  R visitStaticMethodSetIfNull(
+      Send node,
+      FunctionElement method,
+      Node rhs,
+      A arg) {
+    return handleStaticSetIfNulls(
+        node,
+        method,
+        CompoundGetter.METHOD,
+        method,
+        CompoundSetter.INVALID,
+        rhs,
+        arg);
+  }
+
+  @override
+  R visitStaticMethodSetterSetIfNull(
+      Send node,
+      MethodElement method,
+      MethodElement setter,
+      Node rhs,
+      A arg) {
+    return handleStaticSetIfNulls(
+        node,
+        method,
+        CompoundGetter.METHOD,
+        setter,
+        CompoundSetter.SETTER,
+        rhs,
+        arg);
+  }
+
+  @override
+  R visitSuperFieldFieldSetIfNull(
+      Send node,
+      FieldElement readField,
+      FieldElement writtenField,
+      Node rhs,
+      A arg) {
+    return handleSuperSetIfNulls(
+        node,
+        readField,
+        CompoundGetter.FIELD,
+        writtenField,
+        CompoundSetter.FIELD,
+        rhs,
+        arg);
+  }
+
+  @override
+  R visitSuperFieldSetIfNull(
+      Send node,
+      FieldElement field,
+      Node rhs,
+      A arg) {
+    return handleSuperSetIfNulls(
+        node,
+        field,
+        CompoundGetter.FIELD,
+        field,
+        CompoundSetter.FIELD,
+        rhs,
+        arg);
+  }
+
+  @override
+  R visitSuperFieldSetterSetIfNull(
+      Send node,
+      FieldElement field,
+      FunctionElement setter,
+      Node rhs,
+      A arg) {
+    return handleSuperSetIfNulls(
+        node,
+        field,
+        CompoundGetter.FIELD,
+        setter,
+        CompoundSetter.SETTER,
+        rhs,
+        arg);
+  }
+
+  @override
+  R visitSuperGetterFieldSetIfNull(
+      Send node,
+      FunctionElement getter,
+      FieldElement field,
+      Node rhs,
+      A arg) {
+    return handleSuperSetIfNulls(
+        node,
+        getter,
+        CompoundGetter.GETTER,
+        field,
+        CompoundSetter.FIELD,
+        rhs,
+        arg);
+  }
+
+  @override
+  R visitSuperGetterSetterSetIfNull(
+      Send node,
+      FunctionElement getter,
+      FunctionElement setter,
+      Node rhs,
+      A arg) {
+    return handleSuperSetIfNulls(
+        node,
+        getter,
+        CompoundGetter.GETTER,
+        setter,
+        CompoundSetter.SETTER,
+        rhs,
+        arg);
+  }
+
+  @override
+  R visitSuperMethodSetIfNull(
+      Send node,
+      FunctionElement method,
+      Node rhs,
+      A arg) {
+    return handleSuperSetIfNulls(
+        node,
+        method,
+        CompoundGetter.METHOD,
+        method,
+        CompoundSetter.INVALID,
+        rhs,
+        arg);
+  }
+
+  @override
+  R visitSuperMethodSetterSetIfNull(
+      Send node,
+      FunctionElement method,
+      FunctionElement setter,
+      Node rhs,
+      A arg) {
+    return handleSuperSetIfNulls(
+        node,
+        method,
+        CompoundGetter.METHOD,
+        setter,
+        CompoundSetter.SETTER,
+        rhs,
+        arg);
+  }
+
+  @override
+  R visitThisPropertySetIfNull(
+      Send node,
+      Name name,
+      Node rhs,
+      A arg) {
+    return handleDynamicSetIfNulls(node, null, name, rhs, arg);
+  }
+
+  @override
+  R visitTopLevelFieldSetIfNull(
+      Send node,
+      FieldElement field,
+      Node rhs,
+      A arg) {
+    return handleStaticSetIfNulls(
+        node,
+        field,
+        CompoundGetter.FIELD,
+        field,
+        CompoundSetter.FIELD,
+        rhs,
+        arg);
+  }
+
+  @override
+  R visitTopLevelGetterSetterSetIfNull(
+      Send node,
+      FunctionElement getter,
+      FunctionElement setter,
+      Node rhs,
+      A arg) {
+    return handleStaticSetIfNulls(
+        node,
+        getter,
+        CompoundGetter.GETTER,
+        setter,
+        CompoundSetter.SETTER,
+        rhs,
+        arg);
+  }
+
+  @override
+  R visitTopLevelMethodSetIfNull(
+      Send node,
+      FunctionElement method,
+      Node rhs,
+      A arg) {
+    return handleStaticSetIfNulls(
+        node,
+        method,
+        CompoundGetter.METHOD,
+        method,
+        CompoundSetter.INVALID,
+        rhs,
+        arg);
+  }
+
+  @override
+  R visitTopLevelMethodSetterSetIfNull(
+      Send node,
+      FunctionElement method,
+      FunctionElement setter,
+      Node rhs,
+      A arg) {
+    return handleStaticSetIfNulls(
+        node,
+        method,
+        CompoundGetter.METHOD,
+        setter,
+        CompoundSetter.SETTER,
+        rhs,
+        arg);
+  }
+
+  @override
+  R visitTypedefTypeLiteralSetIfNull(
+      Send node,
+      ConstantExpression constant,
+      Node rhs,
+      A arg) {
+    return handleTypeLiteralConstantSetIfNulls(node, constant, rhs, arg);
+  }
+
+  @override
+  R visitUnresolvedSetIfNull(
+      Send node,
+      Element element,
+      Node rhs,
+      A arg) {
+    return handleStaticSetIfNulls(
+        node,
+        element,
+        CompoundGetter.UNRESOLVED,
+        element,
+        CompoundSetter.INVALID,
+        rhs,
+        arg);
+  }
+
+  @override
+  R visitUnresolvedStaticGetterSetIfNull(
+      Send node,
+      Element element,
+      MethodElement setter,
+      Node rhs,
+      A arg) {
+    return handleStaticSetIfNulls(
+        node,
+        element,
+        CompoundGetter.UNRESOLVED,
+        setter,
+        CompoundSetter.SETTER,
+        rhs,
+        arg);
+  }
+
+  @override
+  R visitUnresolvedStaticSetterSetIfNull(
+      Send node,
+      MethodElement getter,
+      Element element,
+      Node rhs,
+      A arg) {
+    return handleStaticSetIfNulls(
+        node,
+        getter,
+        CompoundGetter.GETTER,
+        element,
+        CompoundSetter.INVALID,
+        rhs,
+        arg);
+  }
+
+  @override
+  R visitUnresolvedSuperGetterSetIfNull(
+      Send node,
+      Element element,
+      MethodElement setter,
+      Node rhs,
+      A arg) {
+    return handleSuperSetIfNulls(
+        node,
+        element,
+        CompoundGetter.UNRESOLVED,
+        setter,
+        CompoundSetter.SETTER,
+        rhs,
+        arg);
+  }
+
+  @override
+  R visitUnresolvedSuperSetIfNull(
+      Send node,
+      Element element,
+      Node rhs,
+      A arg) {
+    return handleSuperSetIfNulls(
+        node,
+        element,
+        CompoundGetter.UNRESOLVED,
+        element,
+        CompoundSetter.INVALID,
+        rhs,
+        arg);
+  }
+
+  @override
+  R visitUnresolvedSuperSetterSetIfNull(
+      Send node,
+      MethodElement getter,
+      Element element,
+      Node rhs,
+      A arg) {
+    return handleSuperSetIfNulls(
+        node,
+        getter,
+        CompoundGetter.GETTER,
+        element,
+        CompoundSetter.INVALID,
+        rhs,
+        arg);
+  }
+
+  @override
+  R visitUnresolvedTopLevelGetterSetIfNull(
+      Send node,
+      Element element,
+      MethodElement setter,
+      Node rhs,
+      A arg) {
+    return handleStaticSetIfNulls(
+        node,
+        element,
+        CompoundGetter.UNRESOLVED,
+        setter,
+        CompoundSetter.SETTER,
+        rhs,
+        arg);
+  }
+
+  @override
+  R visitUnresolvedTopLevelSetterSetIfNull(
+      Send node,
+      MethodElement getter,
+      Element element,
+      Node rhs,
+      A arg) {
+    return handleStaticSetIfNulls(
+        node,
+        getter,
+        CompoundGetter.GETTER,
+        element,
+        CompoundSetter.INVALID,
+        rhs,
+        arg);
+  }
+}
+
 /// Simplified handling of indexed compound assignments and prefix/postfix
 /// expressions.
 abstract class BaseImplementationOfIndexCompoundsMixin<R, A>
diff --git a/pkg/compiler/lib/src/resolution/send_resolver.dart b/pkg/compiler/lib/src/resolution/send_resolver.dart
index d3f4e61..479dca0 100644
--- a/pkg/compiler/lib/src/resolution/send_resolver.dart
+++ b/pkg/compiler/lib/src/resolution/send_resolver.dart
@@ -2,545 +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.
 
-part of dart2js.semantics_visitor;
+library dart2js.semantics_visitor.resolver;
 
-enum SendStructureKind {
-  GET,
-  SET,
-  INVOKE,
-  UNARY,
-  NOT,
-  BINARY,
-  EQ,
-  NOT_EQ,
-  COMPOUND,
-  INDEX,
-  INDEX_SET,
-  COMPOUND_INDEX_SET,
-  PREFIX,
-  POSTFIX,
-  INDEX_PREFIX,
-  INDEX_POSTFIX,
-}
+import '../common.dart';
+import '../constants/expressions.dart';
+import '../dart_types.dart';
+import '../elements/elements.dart';
+import '../tree/tree.dart';
+import '../universe/call_structure.dart' show
+    CallStructure;
+import '../universe/selector.dart' show
+    Selector;
+
+import 'access_semantics.dart';
+import 'semantic_visitor.dart';
+import 'send_structure.dart';
+import 'tree_elements.dart';
 
 abstract class SendResolverMixin {
   TreeElements get elements;
 
   internalError(Spannable spannable, String message);
 
-  AccessSemantics handleCompoundErroneousSetterAccess(
-      Send node,
-      Element setter,
-      Element getter) {
-    assert(invariant(node, Elements.isUnresolved(setter),
-        message: "Unexpected erreneous compound setter: $setter."));
-    if (getter.isStatic) {
-      if (getter.isGetter) {
-        return new CompoundAccessSemantics(
-            CompoundAccessKind.UNRESOLVED_STATIC_SETTER, getter, setter);
-      } else if (getter.isField) {
-        // TODO(johnniwinther): Handle const field separately.
-        assert(invariant(node, getter.isFinal || getter.isConst,
-            message: "Field expected to be final or const."));
-        return new StaticAccess.finalStaticField(getter);
-      } else if (getter.isFunction) {
-        return new StaticAccess.staticMethod(getter);
-      } else {
-        return internalError(node,
-            "Unexpected erroneous static compound: getter=$getter");
-      }
-    } else if (getter.isTopLevel) {
-      if (getter.isGetter) {
-        return new CompoundAccessSemantics(
-            CompoundAccessKind.UNRESOLVED_TOPLEVEL_SETTER, getter, setter);
-      } else if (getter.isField) {
-        // TODO(johnniwinther): Handle const field separately.
-        assert(invariant(node, getter.isFinal || getter.isConst,
-            message: "Field expected to be final or const."));
-        return new StaticAccess.finalTopLevelField(getter);
-      } else if (getter.isFunction) {
-        return new StaticAccess.topLevelMethod(getter);
-      } else {
-        return internalError(node,
-            "Unexpected erroneous top level compound: getter=$getter");
-      }
-    } else if (getter.isParameter) {
-      assert(invariant(node, getter.isFinal,
-          message: "Parameter expected to be final."));
-      return new StaticAccess.finalParameter(getter);
-    } else if (getter.isLocal) {
-      if (getter.isVariable) {
-        // TODO(johnniwinther): Handle const variable separately.
-        assert(invariant(node, getter.isFinal || getter.isConst,
-            message: "Variable expected to be final or const."));
-        return new StaticAccess.finalLocalVariable(getter);
-      } else if (getter.isFunction) {
-        return new StaticAccess.localFunction(getter);
-      } else {
-        return internalError(node,
-            "Unexpected erroneous local compound: getter=$getter");
-      }
-    } else if (getter.isErroneous) {
-      return new StaticAccess.unresolved(getter);
-    } else {
-      return internalError(node,
-          "Unexpected erroneous compound: getter=$getter");
-    }
-  }
-
-  AccessSemantics handleStaticallyResolvedAccess(
-      Send node,
-      Element element,
-      Element getter,
-      {bool isCompound}) {
-    if (element == null) {
-      assert(invariant(node, isCompound, message:
-        "Non-compound static access without element."));
-      assert(invariant(node, getter != null, message:
-        "Compound static access without element."));
-      return handleCompoundErroneousSetterAccess(node, element, getter);
-    }
-    if (element.isErroneous) {
-      if (isCompound) {
-        return handleCompoundErroneousSetterAccess(node, element, getter);
-      }
-      return new StaticAccess.unresolved(element);
-    } else if (element.isParameter) {
-      if (element.isFinal) {
-        return new StaticAccess.finalParameter(element);
-      } else {
-        return new StaticAccess.parameter(element);
-      }
-    } else if (element.isLocal) {
-      if (element.isFunction) {
-        return new StaticAccess.localFunction(element);
-      } else if (element.isFinal || element.isConst) {
-        return new StaticAccess.finalLocalVariable(element);
-      } else {
-        return new StaticAccess.localVariable(element);
-      }
-    } else if (element.isStatic) {
-      if (element.isField) {
-        if (element.isFinal || element.isConst) {
-          // TODO(johnniwinther): Handle const field separately.
-          return new StaticAccess.finalStaticField(element);
-        }
-        return new StaticAccess.staticField(element);
-      } else if (element.isGetter) {
-        if (isCompound) {
-          return new CompoundAccessSemantics(
-              CompoundAccessKind.UNRESOLVED_STATIC_SETTER, element, null);
-        }
-        return new StaticAccess.staticGetter(element);
-      } else if (element.isSetter) {
-        if (getter != null) {
-          CompoundAccessKind accessKind;
-          if (getter.isErroneous) {
-            accessKind = CompoundAccessKind.UNRESOLVED_STATIC_GETTER;
-          } else if (getter.isAbstractField) {
-            AbstractFieldElement abstractField = getter;
-            if (abstractField.getter == null) {
-              accessKind = CompoundAccessKind.UNRESOLVED_STATIC_GETTER;
-            } else {
-              // TODO(johnniwinther): This might be dead code.
-              getter = abstractField.getter;
-              accessKind = CompoundAccessKind.STATIC_GETTER_SETTER;
-            }
-          } else if (getter.isGetter) {
-            accessKind = CompoundAccessKind.STATIC_GETTER_SETTER;
-          } else {
-            accessKind = CompoundAccessKind.STATIC_METHOD_SETTER;
-          }
-          return new CompoundAccessSemantics(
-              accessKind, getter, element);
-        } else {
-          return new StaticAccess.staticSetter(element);
-        }
-      } else {
-        return new StaticAccess.staticMethod(element);
-      }
-    } else if (element.isTopLevel) {
-      if (element.isField) {
-        if (element.isFinal || element.isConst) {
-          // TODO(johnniwinther): Handle const field separately.
-          return new StaticAccess.finalTopLevelField(element);
-        }
-        return new StaticAccess.topLevelField(element);
-      } else if (element.isGetter) {
-        return new StaticAccess.topLevelGetter(element);
-      } else if (element.isSetter) {
-        if (getter != null) {
-          CompoundAccessKind accessKind;
-          if (getter.isErroneous) {
-            accessKind = CompoundAccessKind.UNRESOLVED_TOPLEVEL_GETTER;
-          } else if (getter.isAbstractField) {
-            AbstractFieldElement abstractField = getter;
-            if (abstractField.getter == null) {
-              accessKind = CompoundAccessKind.UNRESOLVED_TOPLEVEL_GETTER;
-            } else {
-              // TODO(johnniwinther): This might be dead code.
-              getter = abstractField.getter;
-              accessKind = CompoundAccessKind.TOPLEVEL_GETTER_SETTER;
-            }
-          } else if (getter.isGetter) {
-            accessKind = CompoundAccessKind.TOPLEVEL_GETTER_SETTER;
-          } else {
-            accessKind = CompoundAccessKind.TOPLEVEL_METHOD_SETTER;
-          }
-          return new CompoundAccessSemantics(
-              accessKind, getter, element);
-        } else {
-          return new StaticAccess.topLevelSetter(element);
-        }
-      } else {
-        return new StaticAccess.topLevelMethod(element);
-      }
-    } else {
-      return internalError(
-          node, "Unhandled resolved property access: $element");
-    }
-  }
-
-  SendStructure computeSendStructure(Send node) {
-    SendStructure sendStructure = elements.getSendStructure(node);
-    if (sendStructure != null) {
-      return sendStructure;
-    }
-
-    if (elements.isAssert(node)) {
-      return internalError(node, "Unexpected assert.");
-    }
-
-    AssignmentOperator assignmentOperator;
-    BinaryOperator binaryOperator;
-    IncDecOperator incDecOperator;
-
-    if (node.isOperator) {
-      String operatorText = node.selector.asOperator().source;
-      if (operatorText == 'is') {
-        return internalError(node, "Unexpected is test.");
-      } else if (operatorText == 'as') {
-        return internalError(node, "Unexpected as cast.");
-      } else if (operatorText == '&&') {
-        return internalError(node, "Unexpected logical and.");
-      } else if (operatorText == '||') {
-        return internalError(node, "Unexpected logical or.");
-      } else if (operatorText == '??') {
-        return internalError(node, "Unexpected if-null.");
-      }
-    }
-
-    SendStructureKind kind;
-
-    if (node.asSendSet() != null) {
-      SendSet sendSet = node.asSendSet();
-      String operatorText = sendSet.assignmentOperator.source;
-      if (sendSet.isPrefix || sendSet.isPostfix) {
-        kind = sendSet.isPrefix
-            ? SendStructureKind.PREFIX
-            : SendStructureKind.POSTFIX;
-        incDecOperator = IncDecOperator.parse(operatorText);
-        if (incDecOperator == null) {
-          return internalError(
-              node, "No inc/dec operator for '$operatorText'.");
-        }
-      } else {
-        assignmentOperator = AssignmentOperator.parse(operatorText);
-        if (assignmentOperator != null) {
-          switch (assignmentOperator.kind) {
-            case AssignmentOperatorKind.ASSIGN:
-              kind = SendStructureKind.SET;
-              break;
-            default:
-              kind = SendStructureKind.COMPOUND;
-          }
-        } else {
-          return internalError(
-              node, "No assignment operator for '$operatorText'.");
-        }
-      }
-    } else if (!node.isPropertyAccess) {
-      kind = SendStructureKind.INVOKE;
-    } else {
-      kind = SendStructureKind.GET;
-    }
-
-    if (node.isOperator) {
-      String operatorText = node.selector.asOperator().source;
-      if (node.arguments.isEmpty) {
-        return internalError(node, "Unexpected unary $operatorText.");
-      } else {
-        binaryOperator = BinaryOperator.parse(operatorText);
-        if (binaryOperator != null) {
-          switch (binaryOperator.kind) {
-            case BinaryOperatorKind.EQ:
-              kind = SendStructureKind.EQ;
-              return internalError(node, "Unexpected binary $kind.");
-            case BinaryOperatorKind.NOT_EQ:
-              kind = SendStructureKind.NOT_EQ;
-              return internalError(node, "Unexpected binary $kind.");
-            case BinaryOperatorKind.INDEX:
-              if (node.isPrefix) {
-                kind = SendStructureKind.INDEX_PREFIX;
-              } else if (node.isPostfix) {
-                kind = SendStructureKind.INDEX_POSTFIX;
-              } else if (node.arguments.tail.isEmpty) {
-                // a[b]
-                kind = SendStructureKind.INDEX;
-                return internalError(node, "Unexpected binary $kind.");
-              } else {
-                if (kind == SendStructureKind.COMPOUND) {
-                  // a[b] += c
-                  kind = SendStructureKind.COMPOUND_INDEX_SET;
-                } else {
-                  // a[b] = c
-                  kind = SendStructureKind.INDEX_SET;
-                }
-              }
-              break;
-            default:
-              kind = SendStructureKind.BINARY;
-              return internalError(node, "Unexpected binary $kind.");
-          }
-        } else {
-          return internalError(
-              node, "Unexpected invalid binary $operatorText.");
-        }
-      }
-    }
-    AccessSemantics semantics = computeAccessSemantics(
-        node,
-        isSet: kind == SendStructureKind.SET,
-        isInvoke: kind == SendStructureKind.INVOKE,
-        isCompound: kind == SendStructureKind.COMPOUND ||
-                    kind == SendStructureKind.COMPOUND_INDEX_SET ||
-                    kind == SendStructureKind.PREFIX ||
-                    kind == SendStructureKind.POSTFIX ||
-                    kind == SendStructureKind.INDEX_PREFIX ||
-                    kind == SendStructureKind.INDEX_POSTFIX);
-    if (semantics == null) {
-      return internalError(node, 'No semantics for $node');
-    }
-    Selector selector = elements.getSelector(node);
-    switch (kind) {
-      case SendStructureKind.GET:
-        return new GetStructure(semantics, selector);
-      case SendStructureKind.SET:
-        return new SetStructure(semantics, selector);
-      case SendStructureKind.INVOKE:
-        switch (semantics.kind) {
-          case AccessKind.STATIC_METHOD:
-          case AccessKind.SUPER_METHOD:
-          case AccessKind.TOPLEVEL_METHOD:
-            // TODO(johnniwinther): Should local function also be handled here?
-            FunctionElement function = semantics.element;
-            FunctionSignature signature = function.functionSignature;
-            if (!selector.callStructure.signatureApplies(signature)) {
-              return new IncompatibleInvokeStructure(semantics, selector);
-            }
-            break;
-          default:
-            break;
-        }
-        return new InvokeStructure(semantics, selector);
-      case SendStructureKind.UNARY:
-        return internalError(node, "Unexpected unary.");
-      case SendStructureKind.NOT:
-        return internalError(node, "Unexpected not.");
-      case SendStructureKind.BINARY:
-        return internalError(node, "Unexpected binary.");
-      case SendStructureKind.INDEX:
-        return internalError(node, "Unexpected index.");
-      case SendStructureKind.EQ:
-        return internalError(node, "Unexpected equals.");
-      case SendStructureKind.NOT_EQ:
-        return internalError(node, "Unexpected not equals.");
-      case SendStructureKind.COMPOUND:
-        Selector getterSelector =
-            elements.getGetterSelectorInComplexSendSet(node);
-        return new CompoundStructure(
-            semantics,
-            assignmentOperator,
-            getterSelector,
-            selector);
-      case SendStructureKind.INDEX_SET:
-        return new IndexSetStructure(semantics, selector);
-      case SendStructureKind.COMPOUND_INDEX_SET:
-        Selector getterSelector =
-            elements.getGetterSelectorInComplexSendSet(node);
-        return new CompoundIndexSetStructure(
-            semantics,
-            assignmentOperator,
-            getterSelector,
-            selector);
-      case SendStructureKind.INDEX_PREFIX:
-        Selector getterSelector =
-            elements.getGetterSelectorInComplexSendSet(node);
-        return new IndexPrefixStructure(
-            semantics,
-            incDecOperator,
-            getterSelector,
-            selector);
-      case SendStructureKind.INDEX_POSTFIX:
-        Selector getterSelector =
-            elements.getGetterSelectorInComplexSendSet(node);
-        return new IndexPostfixStructure(
-            semantics,
-            incDecOperator,
-            getterSelector,
-            selector);
-      case SendStructureKind.PREFIX:
-        Selector getterSelector =
-            elements.getGetterSelectorInComplexSendSet(node);
-        return new PrefixStructure(
-            semantics,
-            incDecOperator,
-            getterSelector,
-            selector);
-      case SendStructureKind.POSTFIX:
-        Selector getterSelector =
-            elements.getGetterSelectorInComplexSendSet(node);
-        return new PostfixStructure(
-            semantics,
-            incDecOperator,
-            getterSelector,
-            selector);
-    }
-  }
-
-  AccessSemantics computeAccessSemantics(Send node,
-                                         {bool isSet: false,
-                                          bool isInvoke: false,
-                                          bool isCompound: false}) {
-    Element element = elements[node];
-    Element getter = isCompound ? elements[node.selector] : null;
-    if (elements.isTypeLiteral(node)) {
-      DartType dartType = elements.getTypeLiteralType(node);
-      // TODO(johnniwinther): Handle deferred constants. There are runtime
-      // but not compile-time constants and should have their own
-      // [DeferredConstantExpression] class.
-      ConstantExpression constant = elements.getConstant(
-          isInvoke || isSet || isCompound ? node.selector : node);
-      switch (dartType.kind) {
-        case TypeKind.INTERFACE:
-          return new ConstantAccess.classTypeLiteral(constant);
-        case TypeKind.TYPEDEF:
-          return new ConstantAccess.typedefTypeLiteral(constant);
-        case TypeKind.TYPE_VARIABLE:
-          return new StaticAccess.typeParameterTypeLiteral(dartType.element);
-        case TypeKind.DYNAMIC:
-          return new ConstantAccess.dynamicTypeLiteral(constant);
-        default:
-          return internalError(node, "Unexpected type literal type: $dartType");
-      }
-    } else if (node.isSuperCall) {
-      if (Elements.isUnresolved(element)) {
-        if (isCompound) {
-          if (Elements.isUnresolved(getter)) {
-            // TODO(johnniwinther): Ensure that [getter] is not null. This
-            // happens in the case of missing super getter.
-            return new StaticAccess.unresolvedSuper(element);
-          } else if (getter.isField) {
-            assert(invariant(node, getter.isFinal,
-                message: "Super field expected to be final."));
-            return new StaticAccess.superFinalField(getter);
-          } else if (getter.isFunction) {
-            if (node.isIndex) {
-              return new CompoundAccessSemantics(
-                  CompoundAccessKind.UNRESOLVED_SUPER_SETTER, getter, element);
-            } else {
-              return new StaticAccess.superMethod(getter);
-            }
-          } else {
-            return new CompoundAccessSemantics(
-                CompoundAccessKind.UNRESOLVED_SUPER_SETTER, getter, element);
-          }
-        } else {
-          return new StaticAccess.unresolvedSuper(element);
-        }
-      } else if (isCompound && Elements.isUnresolved(getter)) {
-        // TODO(johnniwinther): Ensure that [getter] is not null. This happens
-        // in the case of missing super getter.
-        return new CompoundAccessSemantics(
-            CompoundAccessKind.UNRESOLVED_SUPER_GETTER, getter, element);
-      } else if (element.isField) {
-        if (getter != null && getter != element) {
-          CompoundAccessKind accessKind;
-          if (getter.isField) {
-            accessKind = CompoundAccessKind.SUPER_FIELD_FIELD;
-          } else if (getter.isGetter) {
-            accessKind = CompoundAccessKind.SUPER_GETTER_FIELD;
-          } else {
-            return internalError(node,
-               "Unsupported super call: $node : $element/$getter.");
-          }
-          return new CompoundAccessSemantics(accessKind, getter, element);
-        } else if (element.isFinal) {
-          return new StaticAccess.superFinalField(element);
-        }
-        return new StaticAccess.superField(element);
-      } else if (element.isGetter) {
-        return new StaticAccess.superGetter(element);
-      } else if (element.isSetter) {
-        if (getter != null) {
-          CompoundAccessKind accessKind;
-          if (getter.isField) {
-            accessKind = CompoundAccessKind.SUPER_FIELD_SETTER;
-          } else if (getter.isGetter) {
-            accessKind = CompoundAccessKind.SUPER_GETTER_SETTER;
-          } else {
-            accessKind = CompoundAccessKind.SUPER_METHOD_SETTER;
-          }
-          return new CompoundAccessSemantics(accessKind, getter, element);
-        }
-        return new StaticAccess.superSetter(element);
-      } else if (isCompound) {
-        return new CompoundAccessSemantics(
-            CompoundAccessKind.SUPER_GETTER_SETTER, getter, element);
-      } else {
-        return new StaticAccess.superMethod(element);
-      }
-    } else if (node.isConditional) {
-      // Conditional sends (e?.x) are treated as dynamic property reads because
-      // they are equivalent to do ((a) => a == null ? null : a.x)(e). If `e` is
-      // a type `A`, this is equivalent to write `(A).x`.
-      return new DynamicAccess.ifNotNullProperty(node.receiver);
-    } else if (node.isOperator) {
-      return new DynamicAccess.dynamicProperty(node.receiver);
-    } else if (Elements.isClosureSend(node, element)) {
-      if (element == null) {
-        if (node.selector.isThis()) {
-          return new AccessSemantics.thisAccess();
-        } else {
-          return new AccessSemantics.expression();
-        }
-      } else if (Elements.isErroneous(element)) {
-        return new StaticAccess.unresolved(element);
-      } else {
-        return handleStaticallyResolvedAccess(
-            node, element, getter, isCompound: isCompound);
-      }
-    } else {
-      bool isDynamicAccess(Element e) => e == null || e.isInstanceMember;
-
-      if (isDynamicAccess(element) &&
-           (!isCompound || isDynamicAccess(getter))) {
-        if (node.receiver == null || node.receiver.isThis()) {
-          return new AccessSemantics.thisProperty();
-        } else {
-          return new DynamicAccess.dynamicProperty(node.receiver);
-        }
-      } else if (element != null && element.impliesType) {
-        // TODO(johnniwinther): Provide an [ErroneousElement].
-        // This happens for code like `C.this`.
-        return new StaticAccess.unresolved(null);
-      } else {
-        return handleStaticallyResolvedAccess(
-            node, element, getter, isCompound: isCompound);
-      }
-    }
-  }
-
   ConstructorAccessSemantics computeConstructorAccessSemantics(
         ConstructorElement constructor,
         CallStructure callStructure,
diff --git a/pkg/compiler/lib/src/resolution/send_structure.dart b/pkg/compiler/lib/src/resolution/send_structure.dart
index b5134a2..06c58de 100644
--- a/pkg/compiler/lib/src/resolution/send_structure.dart
+++ b/pkg/compiler/lib/src/resolution/send_structure.dart
@@ -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.
 
-library dart2js.send_structure;
+library dart2js.resolution.send_structure;
+
+import '../common.dart';
+import '../constants/expressions.dart';
+import '../dart_types.dart';
+import '../elements/elements.dart';
+import '../tree/tree.dart';
+import '../universe/call_structure.dart' show
+    CallStructure;
+import '../universe/selector.dart' show
+    Selector;
 
 import 'access_semantics.dart';
 import 'operators.dart';
 import 'semantic_visitor.dart';
-import '../dart_types.dart';
-import '../constants/expressions.dart';
-import '../elements/elements.dart';
-import '../tree/tree.dart';
-import '../universe/universe.dart';
-import '../util/util.dart';
 
 /// Interface for the structure of the semantics of a [Send] or [NewExpression]
 /// node.
@@ -30,35 +34,6 @@
   R dispatch(SemanticSendVisitor<R, A> visitor, Send send, A arg);
 }
 
-/// The structure for a [Send] of the form `assert(e)`.
-class AssertStructure<R, A> implements SendStructure<R, A> {
-  const AssertStructure();
-
-  R dispatch(SemanticSendVisitor<R, A> visitor, Send node, A arg) {
-    return visitor.visitAssert(
-        node,
-        node.arguments.single,
-        arg);
-  }
-
-  String toString() => 'assert';
-}
-
-/// The structure for a [Send] of the form an `assert` with less or more than
-/// one argument.
-class InvalidAssertStructure<R, A> implements SendStructure<R, A> {
-  const InvalidAssertStructure();
-
-  R dispatch(SemanticSendVisitor<R, A> visitor, Send node, A arg) {
-    return visitor.errorInvalidAssert(
-        node,
-        node.argumentsNode,
-        arg);
-  }
-
-  String toString() => 'invalid assert';
-}
-
 /// The structure for a [Send] of the form `a ?? b`.
 class IfNullStructure<R, A> implements SendStructure<R, A> {
   const IfNullStructure();
@@ -309,7 +284,7 @@
             node,
             node.selector,
             node.argumentsNode,
-            selector,
+            callStructure,
             arg);
       case AccessKind.THIS:
         return visitor.visitThisInvoke(
@@ -452,10 +427,7 @@
   /// The target of the read access.
   final AccessSemantics semantics;
 
-  /// The [Selector] for the getter invocation.
-  final Selector selector;
-
-  GetStructure(this.semantics, this.selector);
+  GetStructure(this.semantics);
 
   R dispatch(SemanticSendVisitor<R, A> visitor, Send node, A arg) {
     switch (semantics.kind) {
@@ -463,13 +435,13 @@
         return visitor.visitIfNotNullDynamicPropertyGet(
             node,
             node.receiver,
-            selector,
+            semantics.name,
             arg);
       case AccessKind.DYNAMIC_PROPERTY:
         return visitor.visitDynamicPropertyGet(
             node,
             node.receiver,
-            selector,
+            semantics.name,
             arg);
       case AccessKind.LOCAL_FUNCTION:
         return visitor.visitLocalFunctionGet(
@@ -559,7 +531,7 @@
       case AccessKind.THIS_PROPERTY:
         return visitor.visitThisPropertyGet(
             node,
-            selector,
+            semantics.name,
             arg);
       case AccessKind.SUPER_FIELD:
       case AccessKind.SUPER_FINAL_FIELD:
@@ -609,7 +581,7 @@
     throw new SpannableAssertionFailure(node, "Invalid getter: ${semantics}");
   }
 
-  String toString() => 'get($selector, $semantics)';
+  String toString() => 'get($semantics)';
 }
 
 /// The structure for a [Send] that is an assignment.
@@ -617,10 +589,7 @@
   /// The target of the assignment.
   final AccessSemantics semantics;
 
-  /// The [Selector] for the setter invocation.
-  final Selector selector;
-
-  SetStructure(this.semantics, this.selector);
+  SetStructure(this.semantics);
 
   R dispatch(SemanticSendVisitor<R, A> visitor, Send node, A arg) {
     switch (semantics.kind) {
@@ -628,14 +597,14 @@
         return visitor.visitIfNotNullDynamicPropertySet(
           node,
           node.receiver,
-          selector,
+          semantics.name,
           node.arguments.single,
           arg);
       case AccessKind.DYNAMIC_PROPERTY:
         return visitor.visitDynamicPropertySet(
           node,
           node.receiver,
-          selector,
+          semantics.name,
           node.arguments.single,
           arg);
       case AccessKind.LOCAL_FUNCTION:
@@ -761,7 +730,7 @@
       case AccessKind.THIS_PROPERTY:
         return visitor.visitThisPropertySet(
             node,
-            selector,
+            semantics.name,
             node.arguments.single,
             arg);
       case AccessKind.SUPER_FIELD:
@@ -818,31 +787,21 @@
     throw new SpannableAssertionFailure(node, "Invalid setter: ${semantics}");
   }
 
-  String toString() => 'set($selector,$semantics)';
+  String toString() => 'set($semantics)';
 }
 
 /// The structure for a [Send] that is a negation, i.e. of the form `!e`.
 class NotStructure<R, A> implements SendStructure<R, A> {
-  /// The target of the negation.
-  final AccessSemantics semantics;
-
-  NotStructure(this.semantics);
+  const NotStructure();
 
   R dispatch(SemanticSendVisitor<R, A> visitor, Send node, A arg) {
-    switch (semantics.kind) {
-      case AccessKind.DYNAMIC_PROPERTY:
-        return visitor.visitNot(
-            node,
-            node.receiver,
-            arg);
-     default:
-        // This is not a valid case.
-        break;
-    }
-    throw new SpannableAssertionFailure(node, "Invalid setter: ${semantics}");
+    return visitor.visitNot(
+        node,
+        node.receiver,
+        arg);
   }
 
-  String toString() => 'not($semantics)';
+  String toString() => 'not()';
 }
 
 /// The structure for a [Send] that is an invocation of a user definable unary
@@ -858,7 +817,7 @@
 
   R dispatch(SemanticSendVisitor<R, A> visitor, Send node, A arg) {
     switch (semantics.kind) {
-      case AccessKind.DYNAMIC_PROPERTY:
+      case AccessKind.EXPRESSION:
         return visitor.visitUnary(
             node,
             operator,
@@ -919,7 +878,7 @@
 
   R dispatch(SemanticSendVisitor<R, A> visitor, Send node, A arg) {
     switch (semantics.kind) {
-      case AccessKind.DYNAMIC_PROPERTY:
+      case AccessKind.EXPRESSION:
         return visitor.visitIndex(
             node,
             node.receiver,
@@ -961,7 +920,7 @@
 
   R dispatch(SemanticSendVisitor<R, A> visitor, Send node, A arg) {
     switch (semantics.kind) {
-      case AccessKind.DYNAMIC_PROPERTY:
+      case AccessKind.EXPRESSION:
         return visitor.visitEquals(
             node,
             node.receiver,
@@ -999,7 +958,7 @@
 
   R dispatch(SemanticSendVisitor<R, A> visitor, Send node, A arg) {
     switch (semantics.kind) {
-      case AccessKind.DYNAMIC_PROPERTY:
+      case AccessKind.EXPRESSION:
         return visitor.visitNotEquals(
             node,
             node.receiver,
@@ -1041,7 +1000,7 @@
 
   R dispatch(SemanticSendVisitor<R, A> visitor, Send node, A arg) {
     switch (semantics.kind) {
-      case AccessKind.DYNAMIC_PROPERTY:
+      case AccessKind.EXPRESSION:
         return visitor.visitBinary(
             node,
             node.receiver,
@@ -1103,15 +1062,11 @@
   /// The target of the index set operation.
   final AccessSemantics semantics;
 
-  // TODO(johnniwinther): Should we store this?
-  /// The [Selector] for the `[]=` operator invocation.
-  final Selector selector;
-
-  IndexSetStructure(this.semantics, this.selector);
+  IndexSetStructure(this.semantics);
 
   R dispatch(SemanticSendVisitor<R, A> visitor, Send node, A arg) {
     switch (semantics.kind) {
-      case AccessKind.DYNAMIC_PROPERTY:
+      case AccessKind.EXPRESSION:
         return visitor.visitIndexSet(
             node,
             node.receiver,
@@ -1160,22 +1115,11 @@
   /// The `++` or `--` operator used in the operation.
   final IncDecOperator operator;
 
-  // TODO(johnniwinther): Should we store this?
-  /// The [Selector] for the `[]` invocation.
-  final Selector getterSelector;
-
-  // TODO(johnniwinther): Should we store this?
-  /// The [Selector] for the `[]=` invocation.
-  final Selector setterSelector;
-
-  IndexPrefixStructure(this.semantics,
-                       this.operator,
-                       this.getterSelector,
-                       this.setterSelector);
+  IndexPrefixStructure(this.semantics, this.operator);
 
   R dispatch(SemanticSendVisitor<R, A> visitor, Send node, A arg) {
     switch (semantics.kind) {
-      case AccessKind.DYNAMIC_PROPERTY:
+      case AccessKind.EXPRESSION:
         return visitor.visitIndexPrefix(
             node,
             node.receiver,
@@ -1246,22 +1190,11 @@
   /// The `++` or `--` operator used in the operation.
   final IncDecOperator operator;
 
-  // TODO(johnniwinther): Should we store this?
-  /// The [Selector] for the `[]` invocation.
-  final Selector getterSelector;
-
-  // TODO(johnniwinther): Should we store this?
-  /// The [Selector] for the `[]=` invocation.
-  final Selector setterSelector;
-
-  IndexPostfixStructure(this.semantics,
-                        this.operator,
-                        this.getterSelector,
-                        this.setterSelector);
+  IndexPostfixStructure(this.semantics, this.operator);
 
   R dispatch(SemanticSendVisitor<R, A> visitor, Send node, A arg) {
     switch (semantics.kind) {
-      case AccessKind.DYNAMIC_PROPERTY:
+      case AccessKind.EXPRESSION:
         return visitor.visitIndexPostfix(
             node,
             node.receiver,
@@ -1332,16 +1265,8 @@
   /// The assignment operator used in the compound assignment.
   final AssignmentOperator operator;
 
-  /// The [Selector] for the getter invocation.
-  final Selector getterSelector;
-
-  /// The [Selector] for the setter invocation.
-  final Selector setterSelector;
-
   CompoundStructure(this.semantics,
-                    this.operator,
-                    this.getterSelector,
-                    this.setterSelector);
+                    this.operator);
 
   R dispatch(SemanticSendVisitor<R, A> visitor, Send node, A arg) {
     switch (semantics.kind) {
@@ -1349,19 +1274,17 @@
         return visitor.visitIfNotNullDynamicPropertyCompound(
             node,
             node.receiver,
+            semantics.name,
             operator,
             node.arguments.single,
-            getterSelector,
-            setterSelector,
             arg);
       case AccessKind.DYNAMIC_PROPERTY:
         return visitor.visitDynamicPropertyCompound(
             node,
             node.receiver,
+            semantics.name,
             operator,
             node.arguments.single,
-            getterSelector,
-            setterSelector,
             arg);
       case AccessKind.LOCAL_FUNCTION:
         return visitor.visitLocalFunctionCompound(
@@ -1489,10 +1412,9 @@
       case AccessKind.THIS_PROPERTY:
         return visitor.visitThisPropertyCompound(
             node,
+            semantics.name,
             operator,
             node.arguments.single,
-            getterSelector,
-            setterSelector,
             arg);
       case AccessKind.SUPER_FIELD:
         return visitor.visitSuperFieldCompound(
@@ -1613,8 +1535,13 @@
                 node.arguments.single,
                 arg);
           case CompoundAccessKind.SUPER_FIELD_FIELD:
-            // TODO(johnniwinther): Handle this.
-            break;
+            return visitor.visitSuperFieldFieldCompound(
+                node,
+                compoundSemantics.getter,
+                compoundSemantics.setter,
+                operator,
+                node.arguments.single,
+                arg);
           case CompoundAccessKind.SUPER_GETTER_SETTER:
             return visitor.visitSuperGetterSetterCompound(
                 node,
@@ -1673,6 +1600,307 @@
   String toString() => 'compound($operator,$semantics)';
 }
 
+/// The structure for a [Send] that is an if-null assignment. For instance
+/// `a ??= b`.
+class SetIfNullStructure<R, A> implements SendStructure<R, A> {
+  /// The target of the if-null assignment, i.e. the left-hand side.
+  final AccessSemantics semantics;
+
+  SetIfNullStructure(this.semantics);
+
+  R dispatch(SemanticSendVisitor<R, A> visitor, Send node, A arg) {
+    switch (semantics.kind) {
+      case AccessKind.CONDITIONAL_DYNAMIC_PROPERTY:
+        return visitor.visitIfNotNullDynamicPropertySetIfNull(
+            node,
+            node.receiver,
+            semantics.name,
+            node.arguments.single,
+            arg);
+      case AccessKind.DYNAMIC_PROPERTY:
+        return visitor.visitDynamicPropertySetIfNull(
+            node,
+            node.receiver,
+            semantics.name,
+            node.arguments.single,
+            arg);
+      case AccessKind.LOCAL_FUNCTION:
+        return visitor.visitLocalFunctionSetIfNull(
+            node,
+            semantics.element,
+            node.arguments.single,
+            arg);
+      case AccessKind.LOCAL_VARIABLE:
+        return visitor.visitLocalVariableSetIfNull(
+            node,
+            semantics.element,
+            node.arguments.single,
+            arg);
+      case AccessKind.FINAL_LOCAL_VARIABLE:
+        return visitor.visitFinalLocalVariableSetIfNull(
+            node,
+            semantics.element,
+            node.arguments.single,
+            arg);
+      case AccessKind.PARAMETER:
+        return visitor.visitParameterSetIfNull(
+            node,
+            semantics.element,
+            node.arguments.single,
+            arg);
+      case AccessKind.FINAL_PARAMETER:
+        return visitor.visitFinalParameterSetIfNull(
+            node,
+            semantics.element,
+            node.arguments.single,
+            arg);
+      case AccessKind.STATIC_FIELD:
+        return visitor.visitStaticFieldSetIfNull(
+            node,
+            semantics.element,
+            node.arguments.single,
+            arg);
+      case AccessKind.FINAL_STATIC_FIELD:
+        return visitor.visitFinalStaticFieldSetIfNull(
+            node,
+            semantics.element,
+            node.arguments.single,
+            arg);
+      case AccessKind.STATIC_METHOD:
+        return visitor.visitStaticMethodSetIfNull(
+            node,
+            semantics.element,
+            node.arguments.single,
+            arg);
+      case AccessKind.STATIC_GETTER:
+        // This is not a valid case.
+        break;
+      case AccessKind.STATIC_SETTER:
+        // This is not a valid case.
+        break;
+      case AccessKind.TOPLEVEL_FIELD:
+        return visitor.visitTopLevelFieldSetIfNull(
+            node,
+            semantics.element,
+            node.arguments.single,
+            arg);
+      case AccessKind.FINAL_TOPLEVEL_FIELD:
+        return visitor.visitFinalTopLevelFieldSetIfNull(
+            node,
+            semantics.element,
+            node.arguments.single,
+            arg);
+      case AccessKind.TOPLEVEL_METHOD:
+        return visitor.visitTopLevelMethodSetIfNull(
+            node,
+            semantics.element,
+            node.arguments.single,
+            arg);
+      case AccessKind.TOPLEVEL_GETTER:
+        // This is not a valid case.
+        break;
+      case AccessKind.TOPLEVEL_SETTER:
+        // This is not a valid case.
+        break;
+      case AccessKind.CLASS_TYPE_LITERAL:
+        return visitor.visitClassTypeLiteralSetIfNull(
+            node,
+            semantics.constant,
+            node.arguments.single,
+            arg);
+      case AccessKind.TYPEDEF_TYPE_LITERAL:
+        return visitor.visitTypedefTypeLiteralSetIfNull(
+            node,
+            semantics.constant,
+            node.arguments.single,
+            arg);
+      case AccessKind.DYNAMIC_TYPE_LITERAL:
+        return visitor.visitDynamicTypeLiteralSetIfNull(
+            node,
+            semantics.constant,
+            node.arguments.single,
+            arg);
+      case AccessKind.TYPE_PARAMETER_TYPE_LITERAL:
+        return visitor.visitTypeVariableTypeLiteralSetIfNull(
+            node,
+            semantics.element,
+            node.arguments.single,
+            arg);
+      case AccessKind.EXPRESSION:
+        // This is not a valid case.
+        break;
+      case AccessKind.THIS:
+        // This is not a valid case.
+        break;
+      case AccessKind.THIS_PROPERTY:
+        return visitor.visitThisPropertySetIfNull(
+            node,
+            semantics.name,
+            node.arguments.single,
+            arg);
+      case AccessKind.SUPER_FIELD:
+        return visitor.visitSuperFieldSetIfNull(
+            node,
+            semantics.element,
+            node.arguments.single,
+            arg);
+      case AccessKind.SUPER_FINAL_FIELD:
+        return visitor.visitFinalSuperFieldSetIfNull(
+            node,
+            semantics.element,
+            node.arguments.single,
+            arg);
+      case AccessKind.SUPER_METHOD:
+        return visitor.visitSuperMethodSetIfNull(
+            node,
+            semantics.element,
+            node.arguments.single,
+            arg);
+      case AccessKind.SUPER_GETTER:
+        // This is not a valid case.
+        break;
+      case AccessKind.SUPER_SETTER:
+        // This is not a valid case.
+        break;
+      case AccessKind.CONSTANT:
+        // TODO(johnniwinther): Should this be a valid case?
+        break;
+      case AccessKind.UNRESOLVED_SUPER:
+        return visitor.visitUnresolvedSuperSetIfNull(
+            node,
+            semantics.element,
+            node.arguments.single,
+            arg);
+      case AccessKind.UNRESOLVED:
+        return visitor.visitUnresolvedSetIfNull(
+            node,
+            semantics.element,
+            node.arguments.single,
+            arg);
+      case AccessKind.INVALID:
+        return visitor.errorInvalidSetIfNull(
+            node,
+            semantics.element,
+            node.arguments.single,
+            arg);
+      case AccessKind.COMPOUND:
+        CompoundAccessSemantics compoundSemantics = semantics;
+        switch (compoundSemantics.compoundAccessKind) {
+          case CompoundAccessKind.STATIC_GETTER_SETTER:
+            return visitor.visitStaticGetterSetterSetIfNull(
+                node,
+                compoundSemantics.getter,
+                compoundSemantics.setter,
+                node.arguments.single,
+                arg);
+          case CompoundAccessKind.STATIC_METHOD_SETTER:
+            return visitor.visitStaticMethodSetterSetIfNull(
+                node,
+                compoundSemantics.getter,
+                compoundSemantics.setter,
+                node.arguments.single,
+                arg);
+          case CompoundAccessKind.UNRESOLVED_STATIC_GETTER:
+            return visitor.visitUnresolvedStaticGetterSetIfNull(
+                node,
+                compoundSemantics.getter,
+                compoundSemantics.setter,
+                node.arguments.single,
+                arg);
+          case CompoundAccessKind.UNRESOLVED_STATIC_SETTER:
+            return visitor.visitUnresolvedStaticSetterSetIfNull(
+                node,
+                compoundSemantics.getter,
+                compoundSemantics.setter,
+                node.arguments.single,
+                arg);
+          case CompoundAccessKind.TOPLEVEL_GETTER_SETTER:
+            return visitor.visitTopLevelGetterSetterSetIfNull(
+                node,
+                compoundSemantics.getter,
+                compoundSemantics.setter,
+                node.arguments.single,
+                arg);
+          case CompoundAccessKind.TOPLEVEL_METHOD_SETTER:
+            return visitor.visitTopLevelMethodSetterSetIfNull(
+                node,
+                compoundSemantics.getter,
+                compoundSemantics.setter,
+                node.arguments.single,
+                arg);
+          case CompoundAccessKind.UNRESOLVED_TOPLEVEL_GETTER:
+            return visitor.visitUnresolvedTopLevelGetterSetIfNull(
+                node,
+                compoundSemantics.getter,
+                compoundSemantics.setter,
+                node.arguments.single,
+                arg);
+          case CompoundAccessKind.UNRESOLVED_TOPLEVEL_SETTER:
+            return visitor.visitUnresolvedTopLevelSetterSetIfNull(
+                node,
+                compoundSemantics.getter,
+                compoundSemantics.setter,
+                node.arguments.single,
+                arg);
+          case CompoundAccessKind.SUPER_FIELD_FIELD:
+            return visitor.visitSuperFieldFieldSetIfNull(
+                node,
+                compoundSemantics.getter,
+                compoundSemantics.setter,
+                node.arguments.single,
+                arg);
+          case CompoundAccessKind.SUPER_GETTER_SETTER:
+            return visitor.visitSuperGetterSetterSetIfNull(
+                node,
+                compoundSemantics.getter,
+                compoundSemantics.setter,
+                node.arguments.single,
+                arg);
+          case CompoundAccessKind.SUPER_GETTER_FIELD:
+            return visitor.visitSuperGetterFieldSetIfNull(
+                node,
+                compoundSemantics.getter,
+                compoundSemantics.setter,
+                node.arguments.single,
+                arg);
+          case CompoundAccessKind.SUPER_METHOD_SETTER:
+            return visitor.visitSuperMethodSetterSetIfNull(
+                node,
+                compoundSemantics.getter,
+                compoundSemantics.setter,
+                node.arguments.single,
+                arg);
+          case CompoundAccessKind.SUPER_FIELD_SETTER:
+            return visitor.visitSuperFieldSetterSetIfNull(
+                node,
+                compoundSemantics.getter,
+                compoundSemantics.setter,
+                node.arguments.single,
+                arg);
+          case CompoundAccessKind.UNRESOLVED_SUPER_GETTER:
+            return visitor.visitUnresolvedSuperGetterSetIfNull(
+                node,
+                compoundSemantics.getter,
+                compoundSemantics.setter,
+                node.arguments.single,
+                arg);
+          case CompoundAccessKind.UNRESOLVED_SUPER_SETTER:
+            return visitor.visitUnresolvedSuperSetterSetIfNull(
+                node,
+                compoundSemantics.getter,
+                compoundSemantics.setter,
+                node.arguments.single,
+                arg);
+        }
+        break;
+    }
+    throw new SpannableAssertionFailure(node,
+        "Invalid if-null assigment: ${semantics}");
+  }
+
+  String toString() => 'ifNull($semantics)';
+}
+
 /// The structure for a [Send] that is a compound assignment on the index
 /// operator. For instance `a[b] += c`.
 class CompoundIndexSetStructure<R, A> implements SendStructure<R, A> {
@@ -1682,19 +1910,11 @@
   /// The assignment operator used in the compound assignment.
   final AssignmentOperator operator;
 
-  /// The [Selector] for the `[]` operator invocation.
-  final Selector getterSelector;
-
-  /// The [Selector] for the `[]=` operator invocation.
-  final Selector setterSelector;
-
-  CompoundIndexSetStructure(this.semantics, this.operator,
-                            this.getterSelector,
-                            this.setterSelector);
+  CompoundIndexSetStructure(this.semantics, this.operator);
 
   R dispatch(SemanticSendVisitor<R, A> visitor, Send node, A arg) {
     switch (semantics.kind) {
-      case AccessKind.DYNAMIC_PROPERTY:
+      case AccessKind.EXPRESSION:
         return visitor.visitCompoundIndexSet(
             node,
             node.receiver,
@@ -1773,16 +1993,8 @@
   /// The `++` or `--` operator used in the operation.
   final IncDecOperator operator;
 
-  /// The [Selector] for the getter invocation.
-  final Selector getterSelector;
-
-  /// The [Selector] for the setter invocation.
-  final Selector setterSelector;
-
   PrefixStructure(this.semantics,
-                  this.operator,
-                  this.getterSelector,
-                  this.setterSelector);
+                  this.operator);
 
   R dispatch(SemanticSendVisitor<R, A> visitor, Send node, A arg) {
     switch (semantics.kind) {
@@ -1790,17 +2002,15 @@
         return visitor.visitIfNotNullDynamicPropertyPrefix(
             node,
             node.receiver,
+            semantics.name,
             operator,
-            getterSelector,
-            setterSelector,
             arg);
       case AccessKind.DYNAMIC_PROPERTY:
         return visitor.visitDynamicPropertyPrefix(
             node,
             node.receiver,
+            semantics.name,
             operator,
-            getterSelector,
-            setterSelector,
             arg);
       case AccessKind.LOCAL_FUNCTION:
         return visitor.visitLocalFunctionPrefix(
@@ -1913,9 +2123,8 @@
       case AccessKind.THIS_PROPERTY:
         return visitor.visitThisPropertyPrefix(
             node,
+            semantics.name,
             operator,
-            getterSelector,
-            setterSelector,
             arg);
       case AccessKind.SUPER_FIELD:
         return visitor.visitSuperFieldPrefix(
@@ -2095,16 +2304,8 @@
   /// The `++` or `--` operator used in the operation.
   final IncDecOperator operator;
 
-  /// The [Selector] for the getter invocation.
-  final Selector getterSelector;
-
-  /// The [Selector] for the setter invocation.
-  final Selector setterSelector;
-
   PostfixStructure(this.semantics,
-                   this.operator,
-                   this.getterSelector,
-                   this.setterSelector);
+                   this.operator);
 
   R dispatch(SemanticSendVisitor<R, A> visitor, Send node, A arg) {
     switch (semantics.kind) {
@@ -2112,17 +2313,15 @@
         return visitor.visitIfNotNullDynamicPropertyPostfix(
             node,
             node.receiver,
+            semantics.name,
             operator,
-            getterSelector,
-            setterSelector,
             arg);
       case AccessKind.DYNAMIC_PROPERTY:
         return visitor.visitDynamicPropertyPostfix(
             node,
             node.receiver,
+            semantics.name,
             operator,
-            getterSelector,
-            setterSelector,
             arg);
       case AccessKind.LOCAL_FUNCTION:
         return visitor.visitLocalFunctionPostfix(
@@ -2235,9 +2434,8 @@
       case AccessKind.THIS_PROPERTY:
         return visitor.visitThisPropertyPostfix(
             node,
+            semantics.name,
             operator,
-            getterSelector,
-            setterSelector,
             arg);
       case AccessKind.SUPER_FIELD:
         return visitor.visitSuperFieldPostfix(
diff --git a/pkg/compiler/lib/src/resolution/signatures.dart b/pkg/compiler/lib/src/resolution/signatures.dart
index 93ae3db..41f3033 100644
--- a/pkg/compiler/lib/src/resolution/signatures.dart
+++ b/pkg/compiler/lib/src/resolution/signatures.dart
@@ -2,7 +2,34 @@
 // for 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 resolution;
+library dart2js.resolution.signatures;
+
+import '../common.dart';
+import '../compiler.dart' show
+    Compiler;
+import '../dart_types.dart';
+import '../elements/elements.dart';
+import '../elements/modelx.dart' show
+    ErroneousFieldElementX,
+    ErroneousInitializingFormalElementX,
+    FormalElementX,
+    FunctionElementX,
+    FunctionSignatureX,
+    InitializingFormalElementX,
+    LocalParameterElementX;
+import '../tree/tree.dart';
+import '../util/util.dart' show
+    Link,
+    LinkBuilder;
+
+import 'members.dart' show
+    ResolverVisitor;
+import 'registry.dart' show
+    ResolutionRegistry;
+import 'resolution_common.dart' show
+    MappingVisitor;
+import 'scope.dart' show
+    Scope;
 
 /**
  * [SignatureResolver] resolves function signatures.
@@ -36,7 +63,7 @@
     // This must be a list of optional arguments.
     String value = node.beginToken.stringValue;
     if ((!identical(value, '[')) && (!identical(value, '{'))) {
-      internalError(node, "expected optional parameters");
+      reporter.internalError(node, "expected optional parameters");
     }
     optionalParametersAreNamed = (identical(value, '{'));
     isOptionalParameter = true;
@@ -48,31 +75,32 @@
   FormalElementX visitVariableDefinitions(VariableDefinitions node) {
     Link<Node> definitions = node.definitions.nodes;
     if (definitions.isEmpty) {
-      internalError(node, 'no parameter definition');
+      reporter.internalError(node, 'no parameter definition');
       return null;
     }
     if (!definitions.tail.isEmpty) {
-      internalError(definitions.tail.head, 'extra definition');
+      reporter.internalError(definitions.tail.head, 'extra definition');
       return null;
     }
     Node definition = definitions.head;
     if (definition is NodeList) {
-      internalError(node, 'optional parameters are not implemented');
+      reporter.internalError(node, 'optional parameters are not implemented');
     }
     if (node.modifiers.isConst) {
-      compiler.reportError(node, MessageKind.FORMAL_DECLARED_CONST);
+      reporter.reportErrorMessage(node, MessageKind.FORMAL_DECLARED_CONST);
     }
     if (node.modifiers.isStatic) {
-      compiler.reportError(node, MessageKind.FORMAL_DECLARED_STATIC);
+      reporter.reportErrorMessage(node, MessageKind.FORMAL_DECLARED_STATIC);
     }
 
     if (currentDefinitions != null) {
-      internalError(node, 'function type parameters not supported');
+      reporter.internalError(node, 'function type parameters not supported');
     }
     currentDefinitions = node;
     FormalElementX element = definition.accept(this);
     if (currentDefinitions.metadata != null) {
-      element.metadata = compiler.resolver.resolveMetadata(element, node);
+      element.metadataInternal =
+          compiler.resolver.resolveMetadata(element, node);
     }
     currentDefinitions = null;
     return element;
@@ -81,8 +109,8 @@
   void validateName(Identifier node) {
     if (isOptionalParameter &&
         optionalParametersAreNamed &&
-        isPrivateName(node.source)) {
-      compiler.reportError(node, MessageKind.PRIVATE_NAMED_PARAMETER);
+        Name.isPrivateName(node.source)) {
+      reporter.reportErrorMessage(node, MessageKind.PRIVATE_NAMED_PARAMETER);
     }
   }
 
@@ -93,8 +121,7 @@
           compiler, functionExpression.parameters,
           functionExpression.returnType, element, registry,
           defaultValuesError: MessageKind.FUNCTION_TYPE_FORMAL_WITH_DEFAULT);
-      element.functionSignatureCache = functionSignature;
-      element.typeCache = functionSignature.type;
+      element.functionSignature = functionSignature;
     }
 
     if (currentDefinitions.type != null) {
@@ -117,7 +144,7 @@
         assert(invariant(currentDefinitions,
             link.head.asIdentifier() != null || link.head.asSend() != null));
         if (fieldElement != null) {
-          element.typeCache = fieldElement.computeType(compiler);
+          element.typeCache = fieldElement.computeType(resolution);
         } else {
           element.typeCache = const DynamicType();
         }
@@ -141,7 +168,7 @@
           functionExpression.name.asIdentifier() != null) {
         return functionExpression.name.asIdentifier();
       } else {
-        internalError(node,
+        reporter.internalError(node,
             'internal error: unimplemented receiver on parameter send');
         return null;
       }
@@ -174,12 +201,13 @@
     InitializingFormalElementX element;
     Identifier receiver = node.receiver.asIdentifier();
     if (receiver == null || !receiver.isThis()) {
-      error(node, MessageKind.INVALID_PARAMETER);
+      reporter.reportErrorMessage(node, MessageKind.INVALID_PARAMETER);
       return new ErroneousInitializingFormalElementX(
           getParameterName(node), enclosingElement);
     } else {
       if (!enclosingElement.isGenerativeConstructor) {
-        error(node, MessageKind.INITIALIZING_FORMAL_NOT_ALLOWED);
+        reporter.reportErrorMessage(
+            node, MessageKind.INITIALIZING_FORMAL_NOT_ALLOWED);
         return new ErroneousInitializingFormalElementX(
             getParameterName(node), enclosingElement);
       }
@@ -189,11 +217,13 @@
           enclosingElement.enclosingClass.lookupLocalMember(name.source);
       if (fieldElement == null ||
           !identical(fieldElement.kind, ElementKind.FIELD)) {
-        error(node, MessageKind.NOT_A_FIELD, {'fieldName': name});
+        reporter.reportErrorMessage(
+            node, MessageKind.NOT_A_FIELD, {'fieldName': name});
         fieldElement = new ErroneousFieldElementX(
             name, enclosingElement.enclosingClass);
       } else if (!fieldElement.isInstanceMember) {
-        error(node, MessageKind.NOT_INSTANCE_FIELD, {'fieldName': name});
+        reporter.reportErrorMessage(
+            node, MessageKind.NOT_INSTANCE_FIELD, {'fieldName': name});
         fieldElement = new ErroneousFieldElementX(
             name, enclosingElement.enclosingClass);
       }
@@ -216,7 +246,7 @@
     }
     Node defaultValue = node.arguments.head;
     if (!defaultValuesAllowed) {
-      compiler.reportError(defaultValue, defaultValuesError);
+      reporter.reportErrorMessage(defaultValue, defaultValuesError);
     }
     return element;
   }
@@ -225,11 +255,13 @@
     // This is a function typed parameter.
     Modifiers modifiers = currentDefinitions.modifiers;
     if (modifiers.isFinal) {
-      compiler.reportError(modifiers,
+      reporter.reportErrorMessage(
+          modifiers,
           MessageKind.FINAL_FUNCTION_TYPE_PARAMETER);
     }
     if (modifiers.isVar) {
-      compiler.reportError(modifiers, MessageKind.VAR_FUNCTION_TYPE_PARAMETER);
+      reporter.reportErrorMessage(
+          modifiers, MessageKind.VAR_FUNCTION_TYPE_PARAMETER);
     }
 
     return createParameter(node.name, null);
@@ -245,7 +277,7 @@
         // If parameter is null, the current node should be the last,
         // and a list of optional named parameters.
         if (!link.tail.isEmpty || (link.head is !NodeList)) {
-          internalError(link.head, "expected optional parameters");
+          reporter.internalError(link.head, "expected optional parameters");
         }
       }
     }
@@ -269,6 +301,7 @@
       {MessageKind defaultValuesError,
        bool createRealParameters: false,
        bool isFunctionExpression: false}) {
+    DiagnosticReporter reporter = compiler.reporter;
 
     SignatureResolver visitor = new SignatureResolver(compiler, element,
         registry, defaultValuesError: defaultValuesError,
@@ -284,7 +317,7 @@
           // parse. So we suppress the message about missing formals.
           assert(invariant(element, compiler.compilationFailed));
         } else {
-          compiler.reportError(element, MessageKind.MISSING_FORMALS);
+          reporter.reportErrorMessage(element, MessageKind.MISSING_FORMALS);
         }
       }
     } else {
@@ -292,8 +325,9 @@
         if (!identical(formalParameters.endToken.next.stringValue,
                        // TODO(ahe): Remove the check for native keyword.
                        'native')) {
-          compiler.reportError(formalParameters,
-                               MessageKind.EXTRA_FORMALS);
+          reporter.reportErrorMessage(
+              formalParameters,
+              MessageKind.EXTRA_FORMALS);
         }
       }
       LinkBuilder<Element> parametersBuilder =
@@ -337,8 +371,9 @@
                                visitor.optionalParameterCount != 0)) {
       // If there are no formal parameters, we already reported an error above.
       if (formalParameters != null) {
-        compiler.reportError(formalParameters,
-                                 MessageKind.ILLEGAL_SETTER_FORMALS);
+        reporter.reportErrorMessage(
+            formalParameters,
+            MessageKind.ILLEGAL_SETTER_FORMALS);
       }
     }
     LinkBuilder<DartType> parameterTypes = new LinkBuilder<DartType>();
@@ -395,7 +430,7 @@
   DartType resolveTypeAnnotation(TypeAnnotation annotation) {
     DartType type = resolveReturnType(annotation);
     if (type.isVoid) {
-      compiler.reportError(annotation, MessageKind.VOID_NOT_ALLOWED);
+      reporter.reportErrorMessage(annotation, MessageKind.VOID_NOT_ALLOWED);
     }
     return type;
   }
diff --git a/pkg/compiler/lib/src/resolution/tree_elements.dart b/pkg/compiler/lib/src/resolution/tree_elements.dart
index e4dfb1e..8d3071c 100644
--- a/pkg/compiler/lib/src/resolution/tree_elements.dart
+++ b/pkg/compiler/lib/src/resolution/tree_elements.dart
@@ -2,16 +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.
 
-part of resolution;
+library dart2js.resolution.tree_elements;
+
+import '../common.dart';
+import '../constants/expressions.dart';
+import '../dart_types.dart';
+import '../elements/elements.dart';
+import '../types/types.dart' show
+    TypeMask;
+import '../tree/tree.dart';
+import '../util/util.dart';
+import '../universe/selector.dart' show
+    Selector;
+
+import 'secret_tree_element.dart' show
+    getTreeElement,
+    setTreeElement;
+import 'send_structure.dart';
 
 abstract class TreeElements {
   AnalyzableElement get analyzedElement;
   Iterable<Node> get superUses;
 
-  /// Iterables of the dependencies that this [TreeElement] records of
-  /// [analyzedElement].
-  Iterable<Element> get allElements;
-
   /// The set of types that this TreeElement depends on.
   /// This includes instantiated types, types in is-checks and as-expressions
   /// and in checked mode the types of all type-annotations.
@@ -19,10 +31,8 @@
 
   void forEachConstantNode(f(Node n, ConstantExpression c));
 
-  /// A set of additional dependencies.  See [registerDependency] below.
-  Iterable<Element> get otherDependencies;
-
   Element operator[](Node node);
+  Map<Node, DartType> get typesCache;
 
   SendStructure getSendStructure(Send send);
 
@@ -51,7 +61,6 @@
   void setCurrentTypeMask(ForIn node, TypeMask mask);
   void setConstant(Node node, ConstantExpression constant);
   ConstantExpression getConstant(Node node);
-  bool isAssert(Send send);
 
   /// Returns the [FunctionElement] defined by [node].
   FunctionElement getFunctionDefinition(FunctionExpression node);
@@ -71,10 +80,6 @@
   /// Returns the type that the type literal [node] refers to.
   DartType getTypeLiteralType(Send node);
 
-  /// Register additional dependencies required by [analyzedElement].
-  /// For example, elements that are used by a backend.
-  void registerDependency(Element element);
-
   /// Register a dependency on [type].
   void addRequiredType(DartType type);
 
@@ -102,6 +107,9 @@
 
   /// Returns the label that [node] targets.
   LabelDefinition getTargetLabel(GotoStatement node);
+
+  /// `true` if the [analyzedElement]'s source code contains a [TryStatement].
+  bool get containsTryStatement;
 }
 
 class TreeElementMapping extends TreeElements {
@@ -109,17 +117,16 @@
   Map<Spannable, Selector> _selectors;
   Map<Spannable, TypeMask> _typeMasks;
   Map<Node, DartType> _types;
+  Map<Node, DartType> typesCache = <Node, DartType>{};
   Setlet<Node> _superUses;
-  Setlet<Element> _otherDependencies;
   Map<Node, ConstantExpression> _constants;
   Map<VariableElement, List<Node>> _potentiallyMutated;
   Map<Node, Map<VariableElement, List<Node>>> _potentiallyMutatedIn;
   Map<VariableElement, List<Node>> _potentiallyMutatedInClosure;
   Map<Node, Map<VariableElement, List<Node>>> _accessedByClosureIn;
-  Setlet<Element> _elements;
-  Setlet<Send> _asserts;
   Maplet<Send, SendStructure> _sendStructureMap;
   Setlet<DartType> _requiredTypes;
+  bool containsTryStatement = false;
 
   /// Map from nodes to the targets they define.
   Map<Node, JumpTarget> _definedTargets;
@@ -153,10 +160,6 @@
     //                  getTreeElement(node) == null,
     //                  message: '${getTreeElement(node)}; $element'));
 
-    if (_elements == null) {
-      _elements = new Setlet<Element>();
-    }
-    _elements.add(element);
     setTreeElement(node, element);
   }
 
@@ -293,18 +296,6 @@
     return getType(node);
   }
 
-  void registerDependency(Element element) {
-    if (element == null) return;
-    if (_otherDependencies == null) {
-      _otherDependencies = new Setlet<Element>();
-    }
-    _otherDependencies.add(element.implementation);
-  }
-
-  Iterable<Element> get otherDependencies {
-    return _otherDependencies != null ? _otherDependencies : const <Element>[];
-  }
-
   List<Node> getPotentialMutations(VariableElement element) {
     if (_potentiallyMutated == null) return const <Node>[];
     List<Node> mutations = _potentiallyMutated[element];
@@ -378,27 +369,12 @@
 
   String toString() => 'TreeElementMapping($analyzedElement)';
 
-  Iterable<Element> get allElements {
-    return _elements != null ? _elements : const <Element>[];
-  }
-
   void forEachConstantNode(f(Node n, ConstantExpression c)) {
     if (_constants != null) {
       _constants.forEach(f);
     }
   }
 
-  void setAssert(Send node) {
-    if (_asserts == null) {
-      _asserts = new Setlet<Send>();
-    }
-    _asserts.add(node);
-  }
-
-  bool isAssert(Send node) {
-    return _asserts != null && _asserts.contains(node);
-  }
-
   FunctionElement getFunctionDefinition(FunctionExpression node) {
     return this[node];
   }
@@ -533,26 +509,3 @@
     return _getTypeMask(node.inToken);
   }
 }
-
-TreeElements _ensureTreeElements(AnalyzableElementX element) {
-  if (element._treeElements == null) {
-    element._treeElements = new TreeElementMapping(element);
-  }
-  return element._treeElements;
-}
-
-abstract class AnalyzableElementX implements AnalyzableElement {
-  TreeElements _treeElements;
-
-  bool get hasTreeElements => _treeElements != null;
-
-  TreeElements get treeElements {
-    assert(invariant(this, _treeElements !=null,
-        message: "TreeElements have not been computed for $this."));
-    return _treeElements;
-  }
-
-  void reuseElement() {
-    _treeElements = null;
-  }
-}
diff --git a/pkg/compiler/lib/src/resolution/type_resolver.dart b/pkg/compiler/lib/src/resolution/type_resolver.dart
index 2bc9bbd..3c6ab75 100644
--- a/pkg/compiler/lib/src/resolution/type_resolver.dart
+++ b/pkg/compiler/lib/src/resolution/type_resolver.dart
@@ -2,13 +2,49 @@
 // for 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 resolution;
+library dart2js.resolution.types;
+
+import '../common.dart';
+import '../common/resolution.dart' show
+    Resolution;
+import '../compiler.dart' show
+    Compiler;
+import '../dart_backend/dart_backend.dart' show
+    DartBackend;
+import '../dart_types.dart';
+import '../elements/elements.dart' show
+    AmbiguousElement,
+    ClassElement,
+    Element,
+    Elements,
+    ErroneousElement,
+    PrefixElement,
+    TypedefElement,
+    TypeVariableElement;
+import '../elements/modelx.dart' show
+    ErroneousElementX;
+import '../tree/tree.dart';
+import '../util/util.dart' show
+    Link;
+
+import 'members.dart' show
+    lookupInScope;
+import 'registry.dart' show
+    ResolutionRegistry;
+import 'resolution_common.dart' show
+    MappingVisitor;
+import 'scope.dart' show
+    Scope;
 
 class TypeResolver {
   final Compiler compiler;
 
   TypeResolver(this.compiler);
 
+  DiagnosticReporter get reporter => compiler.reporter;
+
+  Resolution get resolution => compiler.resolution;
+
   /// Tries to resolve the type name as an element.
   Element resolveTypeName(Identifier prefixName,
                           Identifier typeName,
@@ -17,7 +53,7 @@
     Element element;
     if (prefixName != null) {
       Element prefixElement =
-          lookupInScope(compiler, prefixName, scope, prefixName.source);
+          lookupInScope(reporter, prefixName, scope, prefixName.source);
       if (prefixElement != null && prefixElement.isPrefix) {
         // The receiver is a prefix. Lookup in the imported members.
         PrefixElement prefix = prefixElement;
@@ -39,7 +75,7 @@
         element = null;
       }
     } else {
-      element = lookupInScope(compiler, typeName, scope, typeName.source);
+      element = lookupInScope(reporter, typeName, scope, typeName.source);
     }
     return element;
   }
@@ -89,15 +125,21 @@
     Element element = resolveTypeName(prefixName, typeName, visitor.scope,
                                       deferredIsMalformed: deferredIsMalformed);
 
-    DartType reportFailureAndCreateType(MessageKind messageKind,
-                                        Map messageArguments,
-                                        {DartType userProvidedBadType,
-                                         Element erroneousElement}) {
+    DartType reportFailureAndCreateType(
+        MessageKind messageKind,
+        Map messageArguments,
+        {DartType userProvidedBadType,
+         Element erroneousElement,
+         List<DiagnosticMessage> infos: const <DiagnosticMessage>[]}) {
       if (malformedIsError) {
-        visitor.error(node, messageKind, messageArguments);
+        reporter.reportError(
+            reporter.createMessage(node, messageKind, messageArguments),
+            infos);
       } else {
         registry.registerThrowRuntimeError();
-        visitor.warning(node, messageKind, messageArguments);
+        reporter.reportWarning(
+            reporter.createMessage(node, messageKind, messageArguments),
+            infos);
       }
       if (erroneousElement == null) {
         registry.registerThrowRuntimeError();
@@ -118,8 +160,11 @@
     } else if (element.isAmbiguous) {
       AmbiguousElement ambiguous = element;
       type = reportFailureAndCreateType(
-          ambiguous.messageKind, ambiguous.messageArguments);
-      ambiguous.diagnose(registry.mapping.analyzedElement, compiler);
+          ambiguous.messageKind,
+          ambiguous.messageArguments,
+          infos: ambiguous.computeInfos(
+              registry.mapping.analyzedElement, reporter));
+      ;
     } else if (element.isErroneous) {
       if (element is ErroneousElement) {
         type = reportFailureAndCreateType(
@@ -135,10 +180,10 @@
       bool addTypeVariableBoundsCheck = false;
       if (element.isClass) {
         ClassElement cls = element;
-        // TODO(johnniwinther): [_ensureClassWillBeResolved] should imply
+        // TODO(johnniwinther): [ensureClassWillBeResolvedInternal] should imply
         // [computeType].
-        compiler.resolver._ensureClassWillBeResolved(cls);
-        cls.computeType(compiler);
+        compiler.resolver.ensureClassWillBeResolvedInternal(cls);
+        cls.computeType(resolution);
         List<DartType> arguments = <DartType>[];
         bool hasTypeArgumentMismatch = resolveTypeArguments(
             visitor, node, cls.typeVariables, arguments);
@@ -150,15 +195,16 @@
           if (arguments.isEmpty) {
             type = cls.rawType;
           } else {
-            type = new InterfaceType(cls.declaration, arguments.toList(growable: false));
+            type = new InterfaceType(
+                cls.declaration, arguments.toList(growable: false));
             addTypeVariableBoundsCheck = true;
           }
         }
       } else if (element.isTypedef) {
         TypedefElement typdef = element;
         // TODO(johnniwinther): [ensureResolved] should imply [computeType].
-        typdef.ensureResolved(compiler);
-        typdef.computeType(compiler);
+        typdef.ensureResolved(resolution);
+        typdef.computeType(resolution);
         List<DartType> arguments = <DartType>[];
         bool hasTypeArgumentMismatch = resolveTypeArguments(
             visitor, node, typdef.typeVariables, arguments);
@@ -190,7 +236,7 @@
         }
         type = checkNoTypeArguments(type);
       } else {
-        compiler.internalError(node,
+        reporter.internalError(node,
             "Unexpected element kind ${element.kind}.");
       }
       if (addTypeVariableBoundsCheck) {
@@ -210,7 +256,8 @@
                                    TypeVariableType typeVariable,
                                    DartType bound) {
       if (!compiler.types.isSubtype(typeArgument, bound)) {
-        compiler.reportWarning(node,
+        reporter.reportWarningMessage(
+            node,
             MessageKind.INVALID_TYPE_VARIABLE_BOUND,
             {'typeVariable': typeVariable,
              'bound': bound,
@@ -242,7 +289,7 @@
          !typeArguments.isEmpty;
          typeArguments = typeArguments.tail, index++) {
       if (index > expectedVariables - 1) {
-        visitor.warning(
+        reporter.reportWarningMessage(
             typeArguments.head, MessageKind.ADDITIONAL_TYPE_ARGUMENT);
         typeArgumentCountMismatch = true;
       }
@@ -251,8 +298,8 @@
       arguments.add(argType);
     }
     if (index < expectedVariables) {
-      visitor.warning(node.typeArguments,
-                      MessageKind.MISSING_TYPE_ARGUMENT);
+      reporter.reportWarningMessage(
+          node.typeArguments, MessageKind.MISSING_TYPE_ARGUMENT);
       typeArgumentCountMismatch = true;
     }
     return typeArgumentCountMismatch;
diff --git a/pkg/compiler/lib/src/resolution/typedefs.dart b/pkg/compiler/lib/src/resolution/typedefs.dart
index 7f5e820..87acbd6 100644
--- a/pkg/compiler/lib/src/resolution/typedefs.dart
+++ b/pkg/compiler/lib/src/resolution/typedefs.dart
@@ -2,7 +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.
 
-part of resolution;
+library dart2js.resolution.typedefs;
+
+import '../common.dart';
+import '../compiler.dart' show
+    Compiler;
+import '../dart_types.dart';
+import '../elements/elements.dart' show
+    FunctionSignature,
+    TypedefElement,
+    TypeVariableElement;
+import '../elements/modelx.dart' show
+    ErroneousElementX,
+    TypedefElementX;
+import '../tree/tree.dart';
+import '../util/util.dart' show
+    Link;
+
+import 'class_hierarchy.dart' show
+    TypeDefinitionVisitor;
+import 'registry.dart' show
+    ResolutionRegistry;
+import 'scope.dart' show
+    MethodScope,
+    TypeDeclarationScope;
+import 'signatures.dart' show
+    SignatureResolver;
 
 class TypedefResolverVisitor extends TypeDefinitionVisitor {
   TypedefElementX get element => enclosingElement;
@@ -13,7 +38,7 @@
       : super(compiler, typedefElement, registry);
 
   visitTypedef(Typedef node) {
-    element.computeType(compiler);
+    element.computeType(resolution);
     scope = new TypeDeclarationScope(scope, element);
     resolveTypeVariableBounds(node.typeParameters);
 
@@ -25,10 +50,10 @@
     scope = new MethodScope(scope, element);
     signature.forEachParameter(addToScope);
 
-    element.alias = signature.type;
+    element.aliasCache = signature.type;
 
     void checkCyclicReference() {
-      element.checkCyclicReference(compiler);
+      element.checkCyclicReference(resolution);
     }
     addDeferredAction(element, checkCyclicReference);
   }
@@ -37,7 +62,7 @@
 // TODO(johnniwinther): Replace with a traversal on the AST when the type
 // annotations in typedef alias are stored in a [TreeElements] mapping.
 class TypedefCyclicVisitor extends BaseDartTypeVisitor {
-  final Compiler compiler;
+  final DiagnosticReporter reporter;
   final TypedefElementX element;
   bool hasCyclicReference = false;
 
@@ -48,7 +73,7 @@
   Link<TypeVariableElement> seenTypeVariables =
       const Link<TypeVariableElement>();
 
-  TypedefCyclicVisitor(Compiler this.compiler, TypedefElement this.element);
+  TypedefCyclicVisitor(this.reporter, TypedefElement this.element);
 
   visitType(DartType type, _) {
     // Do nothing.
@@ -63,12 +88,14 @@
         hasCyclicReference = true;
         if (seenTypedefsCount == 1) {
           // Direct cyclicity.
-          compiler.reportError(element,
+          reporter.reportErrorMessage(
+              element,
               MessageKind.CYCLIC_TYPEDEF,
               {'typedefName': element.name});
         } else if (seenTypedefsCount == 2) {
           // Cyclicity through one other typedef.
-          compiler.reportError(element,
+          reporter.reportErrorMessage(
+              element,
               MessageKind.CYCLIC_TYPEDEF_ONE,
               {'typedefName': element.name,
                'otherTypedefName': seenTypedefs.head.name});
@@ -76,7 +103,8 @@
           // Cyclicity through more than one other typedef.
           for (TypedefElement cycle in seenTypedefs) {
             if (!identical(typedefElement, cycle)) {
-              compiler.reportError(element,
+              reporter.reportErrorMessage(
+                  element,
                   MessageKind.CYCLIC_TYPEDEF_ONE,
                   {'typedefName': element.name,
                    'otherTypedefName': cycle.name});
@@ -87,15 +115,15 @@
               MessageKind.CYCLIC_TYPEDEF,
               {'typedefName': element.name},
               element.name, element);
-        element.alias =
-            new MalformedType(erroneousElement, typedefElement.alias);
+        element.aliasCache =
+            new MalformedType(erroneousElement, typedefElement.aliasCache);
         element.hasBeenCheckedForCycles = true;
       }
     } else {
       seenTypedefs = seenTypedefs.prepend(typedefElement);
       seenTypedefsCount++;
       type.visitChildren(this, null);
-      typedefElement.alias.accept(this, null);
+      typedefElement.aliasCache.accept(this, null);
       seenTypedefs = seenTypedefs.tail;
       seenTypedefsCount--;
     }
diff --git a/pkg/compiler/lib/src/resolution/variables.dart b/pkg/compiler/lib/src/resolution/variables.dart
index a738b4f..e9d6b94 100644
--- a/pkg/compiler/lib/src/resolution/variables.dart
+++ b/pkg/compiler/lib/src/resolution/variables.dart
@@ -2,7 +2,26 @@
 // for 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 resolution;
+library dart2js.resolution.variables;
+
+import '../common.dart';
+import '../compiler.dart' show
+    Compiler;
+import '../elements/modelx.dart' show
+    LocalVariableElementX,
+    VariableList;
+import '../tree/tree.dart';
+import '../util/util.dart' show
+    Link;
+
+import 'members.dart' show
+    ResolverVisitor;
+import 'registry.dart' show
+    ResolutionRegistry;
+import 'resolution_common.dart' show
+    CommonResolverVisitor;
+import 'scope.dart' show
+    VariableDefinitionScope;
 
 class VariableDefinitionsVisitor extends CommonResolverVisitor<Identifier> {
   VariableDefinitions definitions;
@@ -26,7 +45,7 @@
         new VariableDefinitionScope(resolver.scope, name);
     resolver.visitIn(node.arguments.head, scope);
     if (scope.variableReferencedInInitializer) {
-      compiler.reportError(
+      reporter.reportErrorMessage(
           identifier, MessageKind.REFERENCE_IN_INITIALIZATION,
           {'variableName': name});
     }
@@ -37,11 +56,13 @@
     // The variable is initialized to null.
     registry.registerInstantiatedClass(compiler.nullClass);
     if (definitions.modifiers.isConst) {
-      compiler.reportError(node, MessageKind.CONST_WITHOUT_INITIALIZER);
+      reporter.reportErrorMessage(
+          node, MessageKind.CONST_WITHOUT_INITIALIZER);
     }
     if (definitions.modifiers.isFinal &&
         !resolver.allowFinalWithoutInitializer) {
-      compiler.reportError(node, MessageKind.FINAL_WITHOUT_INITIALIZER);
+      reporter.reportErrorMessage(
+          node, MessageKind.FINAL_WITHOUT_INITIALIZER);
     }
     return node;
   }
diff --git a/pkg/compiler/lib/src/resolved_visitor.dart b/pkg/compiler/lib/src/resolved_visitor.dart
deleted file mode 100644
index 5eb6a13..0000000
--- a/pkg/compiler/lib/src/resolved_visitor.dart
+++ /dev/null
@@ -1,828 +0,0 @@
-// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-part of dart2js;
-
-/// Enum for the visit methods added in [ResolvedVisitor].
-// TODO(johnniwinther): Remove this.
-enum ResolvedKind {
-  ASSERT,
-  TYPE_LITERAL,
-  SUPER,
-  OPERATOR,
-  TYPE_PREFIX,
-  GETTER,
-  STATIC,
-  CLOSURE,
-  DYNAMIC,
-  ERROR,
-  SEND_SET,
-  NEW,
-  SUPER_CONSTRUCTOR,
-}
-
-/// Abstract interface for a [ResolvedVisitor].
-// TODO(johnniwinther): Remove this.
-abstract class ResolvedKindVisitor<R> {
-  @deprecated
-  R visitSuperSend(Send node);
-
-  @deprecated
-  R visitOperatorSend(Send node);
-  R visitGetterSend(Send node);
-
-  @deprecated
-  R visitClosureSend(Send node);
-  @deprecated
-  R visitDynamicSend(Send node);
-  R visitStaticSend(Send node);
-
-  R handleSuperConstructorInvoke(Send node);
-  R handleSendSet(SendSet node);
-  R handleNewExpression(NewExpression node);
-
-  /// Visitor callback for a type literal.
-  @deprecated
-  R visitTypeLiteralSend(Send node);
-
-  /// Visitor callback for the class prefix of a static access, like `Foo` in
-  /// `Foo.staticField`.
-  // TODO(johnniwinther): Remove this when not needed by the inferrer.
-  @deprecated
-  R visitTypePrefixSend(Send node);
-
-  @deprecated
-  R visitAssertSend(Send node);
-
-  internalError(Spannable node, String reason);
-}
-
-/// Visitor that returns the [ResolvedKind] corresponding to the called visitor
-/// method.
-class ResolvedKindComputer implements ResolvedKindVisitor {
-  const ResolvedKindComputer();
-
-  ResolvedKind visitSuperSend(Send node) => ResolvedKind.SUPER;
-  ResolvedKind visitOperatorSend(Send node) => ResolvedKind.OPERATOR;
-  ResolvedKind visitGetterSend(Send node) => ResolvedKind.GETTER;
-  ResolvedKind visitClosureSend(Send node) => ResolvedKind.CLOSURE;
-  ResolvedKind visitDynamicSend(Send node) => ResolvedKind.DYNAMIC;
-  ResolvedKind visitStaticSend(Send node) => ResolvedKind.STATIC;
-  ResolvedKind visitTypeLiteralSend(Send node) => ResolvedKind.TYPE_LITERAL;
-  ResolvedKind visitTypePrefixSend(Send node) => ResolvedKind.TYPE_PREFIX;
-  ResolvedKind visitAssertSend(Send node) => ResolvedKind.ASSERT;
-  ResolvedKind handleSuperConstructorInvoke(Send node) {
-    return ResolvedKind.SUPER_CONSTRUCTOR;
-  }
-  ResolvedKind handleSendSet(SendSet node) => ResolvedKind.SEND_SET;
-  ResolvedKind handleNewExpression(NewExpression node) => ResolvedKind.NEW;
-  internalError(Spannable node, String reason) => ResolvedKind.ERROR;
-}
-
-abstract class ResolvedVisitor<R>
-    implements Visitor<R>, ResolvedKindVisitor<R> {}
-
-abstract class BaseResolvedVisitor<R> extends Visitor<R>
-    implements ResolvedVisitor<R> {
-
-  TreeElements elements;
-
-  BaseResolvedVisitor(this.elements);
-
-  /// Dispatch using the old [ResolvedVisitor] logic.
-  // TODO(johnniwinther): Remove this.
-  _oldDispatch(Send node, ResolvedKindVisitor visitor) {
-    Element element = elements[node];
-    if (elements.isAssert(node)) {
-      return visitor.visitAssertSend(node);
-    } else if (elements.isTypeLiteral(node)) {
-      return visitor.visitTypeLiteralSend(node);
-    } else if (node.isSuperCall) {
-      if (element != null && element.isConstructor) {
-        return visitor.handleSuperConstructorInvoke(node);
-      }
-      return visitor.visitSuperSend(node);
-    } else if (node.isOperator) {
-      return visitor.visitOperatorSend(node);
-    } else if (node.isPropertyAccess) {
-      if (!Elements.isUnresolved(element) && element.impliesType) {
-        return visitor.visitTypePrefixSend(node);
-      } else {
-        return visitor.visitGetterSend(node);
-      }
-    } else if (element != null && Initializers.isConstructorRedirect(node)) {
-      return visitor.visitStaticSend(node);
-    } else if (Elements.isClosureSend(node, element)) {
-      return visitor.visitClosureSend(node);
-    } else {
-      if (node.isConditional) {
-        return visitor.visitDynamicSend(node);
-      } else if (Elements.isUnresolved(element)) {
-        if (element == null) {
-          // Example: f() with 'f' unbound.
-          // This can only happen inside an instance method.
-          return visitor.visitDynamicSend(node);
-        } else {
-          return visitor.visitStaticSend(node);
-        }
-      } else if (element.isInstanceMember) {
-        // Example: f() with 'f' bound to instance method.
-        return visitor.visitDynamicSend(node);
-      } else if (!element.isInstanceMember) {
-        // Example: A.f() or f() with 'f' bound to a static function.
-        // Also includes new A() or new A.named() which is treated like a
-        // static call to a factory.
-        return visitor.visitStaticSend(node);
-      } else {
-        return visitor.internalError(node, "Cannot generate code for send");
-      }
-    }
-  }
-
-  internalError(Spannable node, String reason);
-
-  R visitNode(Node node) {
-    internalError(node, "Unhandled node");
-    return null;
-  }
-}
-
-abstract class NewResolvedVisitor<R> extends BaseResolvedVisitor<R>
-    with SendResolverMixin,
-         GetBulkMixin<R, dynamic>,
-         SetBulkMixin<R, dynamic>,
-         ErrorBulkMixin<R, dynamic>,
-         InvokeBulkMixin<R, dynamic>,
-         IndexSetBulkMixin<R, dynamic>,
-         CompoundBulkMixin<R, dynamic>,
-         UnaryBulkMixin<R, dynamic>,
-         BaseBulkMixin<R, dynamic>,
-         BinaryBulkMixin<R, dynamic>,
-         PrefixBulkMixin<R, dynamic>,
-         PostfixBulkMixin<R, dynamic>,
-         NewBulkMixin<R, dynamic> {
-
-  final ResolvedSemanticDispatcher<R> _semanticDispatcher =
-      new ResolvedSemanticDispatcher<R>();
-
-  final ResolvedSemanticDispatcher<ResolvedKind> _resolvedKindDispatcher =
-      new ResolvedSemanticDispatcher<ResolvedKind>();
-
-  NewResolvedVisitor(TreeElements elements) : super(elements);
-
-  /// Dispatch using the new [SemanticSendVisitor] logic.
-  _newDispatch(Send node,
-               ResolvedKindVisitor kindVisitor,
-               SemanticSendVisitor sendVisitor) {
-    Element element = elements[node];
-    if (element != null && element.isConstructor) {
-      if (node.isSuperCall) {
-        return kindVisitor.handleSuperConstructorInvoke(node);
-      } else {
-        return kindVisitor.visitStaticSend(node);
-      }
-    } else if (element != null && element.isPrefix) {
-      return kindVisitor.visitGetterSend(node);
-    } else if (!elements.isTypeLiteral(node) &&
-               node.isPropertyAccess &&
-               !Elements.isUnresolved(element) &&
-               element.impliesType) {
-      return kindVisitor.visitTypePrefixSend(node);
-    } else {
-      SendStructure sendStructure = computeSendStructure(node);
-      if (sendStructure != null) {
-        var arg = sendVisitor == _resolvedKindDispatcher
-            ? kindVisitor : sendStructure;
-        return sendStructure.dispatch(sendVisitor, node, arg);
-      } else {
-        return kindVisitor.visitStaticSend(node);
-      }
-    }
-  }
-
-  @override
-  R visitDynamicSend(Send node) {
-    return internalError(node, "visitDynamicSend is deprecated");
-  }
-
-  @override
-  R visitSuperSend(Send node) {
-    return internalError(node, "visitSuperSend is deprecated");
-  }
-
-  @override
-  R visitOperatorSend(Send node) {
-    return internalError(node, "visitOperaterSend is deprecated");
-  }
-
-  @override
-  R visitClosureSend(Send node) {
-    return internalError(node, "visitClosureSend is deprecated");
-  }
-
-  @override
-  R visitTypeLiteralSend(Send node) {
-    return internalError(node, "visitTypeLiteralSend is deprecated");
-  }
-
-  @override
-  R visitTypePrefixSend(Send node) {
-    return internalError(node, "visitTypePrefixSend is deprecated");
-  }
-
-  @override
-  R visitAssertSend(Send node) {
-    return internalError(node, "visitAssertSend is deprecated");
-  }
-
-  bool checkResolvedKind(Node node,
-                         ResolvedKind oldKind,
-                         ResolvedKind newKind) {
-    return invariant(node, oldKind == newKind,
-        message: 'old=$oldKind != new=$newKind');
-  }
-
-  ResolvedKind computeResolvedKindFromStructure(
-      Node node, SemanticSendStructure structure) {
-    return structure.dispatch(
-        _resolvedKindDispatcher, node, const ResolvedKindComputer());
-  }
-
-  @override
-  R visitSend(Send node) {
-    assert(checkResolvedKind(
-        node,
-        _oldDispatch(node, const ResolvedKindComputer()),
-        _newDispatch(node, const ResolvedKindComputer(),
-            _resolvedKindDispatcher)));
-    return _newDispatch(node, this, this);
-  }
-
-  @override
-  R visitSendSet(Send node) {
-    SendStructure structure = computeSendStructure(node);
-    if (structure == null) {
-      return internalError(node, 'No structure for $node');
-    } else {
-      assert(checkResolvedKind(node,
-          ResolvedKind.SEND_SET,
-          computeResolvedKindFromStructure(node, structure)));
-      return structure.dispatch(this, node, structure);
-    }
-  }
-
-  @override
-  R visitNewExpression(NewExpression node) {
-    NewStructure structure = computeNewStructure(node);
-    if (structure == null) {
-      return internalError(node, 'No structure for $node');
-    } else {
-      assert(checkResolvedKind(node,
-          ResolvedKind.NEW,
-          computeResolvedKindFromStructure(node, structure)));
-      return structure.dispatch(this, node, structure);
-    }
-  }
-
-  @override
-  R apply(Node node, arg) {
-    return visitNode(node);
-  }
-
-  @override
-  R bulkHandleNode(
-      Node node,
-      String message,
-      SemanticSendStructure structure) {
-    return structure.dispatch(_semanticDispatcher, node, this);
-  }
-}
-
-/// Visitor that dispatches [SemanticSendVisitor] calls to the corresponding
-/// visit methods in [ResolvedVisitor].
-class ResolvedSemanticDispatcher<R> extends Object
-    with GetBulkMixin<R, ResolvedKindVisitor<R>>,
-         SetBulkMixin<R, ResolvedKindVisitor<R>>,
-         InvokeBulkMixin<R, ResolvedKindVisitor<R>>,
-         PrefixBulkMixin<R, ResolvedKindVisitor<R>>,
-         PostfixBulkMixin<R, ResolvedKindVisitor<R>>,
-         SuperBulkMixin<R, ResolvedKindVisitor<R>>,
-         CompoundBulkMixin<R, ResolvedKindVisitor<R>>,
-         IndexSetBulkMixin<R, ResolvedKindVisitor<R>>,
-         NewBulkMixin<R, ResolvedKindVisitor<R>>,
-         ErrorBulkMixin<R, ResolvedKindVisitor<R>>
-    implements SemanticSendVisitor<R, ResolvedKindVisitor<R>> {
-
-  ResolvedSemanticDispatcher();
-
-  @override
-  R apply(Node node, ResolvedKindVisitor<R> visitor) {
-    return visitor.internalError(
-        node, "ResolvedSemanticDispatcher.apply unsupported.");
-  }
-
-  @override
-  R bulkHandleNode(
-      Node node,
-      String message,
-      ResolvedKindVisitor<R> visitor) {
-    return bulkHandleError(node, null, visitor);
-  }
-
-  R bulkHandleError(
-      Node node,
-      ErroneousElement error,
-      ResolvedKindVisitor<R> visitor) {
-    if (node.asSendSet() != null) {
-      return visitor.handleSendSet(node);
-    } else if (node.asNewExpression() != null) {
-      return visitor.handleNewExpression(node);
-    }
-    return visitor.internalError(node, "No resolved kind for $node.");
-  }
-
-  @override
-  R bulkHandleGet(Node node, ResolvedKindVisitor<R> visitor) {
-    return visitor.visitGetterSend(node);
-  }
-
-  @override
-  R bulkHandleInvoke(Node node, ResolvedKindVisitor<R> visitor) {
-    // Most invokes are static.
-    return visitor.visitStaticSend(node);
-  }
-
-  @override
-  R bulkHandlePrefix(Node node, ResolvedKindVisitor<R> visitor) {
-    return visitor.handleSendSet(node);
-  }
-
-  @override
-  R bulkHandlePostfix(Node node, ResolvedKindVisitor<R> visitor) {
-    return visitor.handleSendSet(node);
-  }
-
-  @override
-  R bulkHandleSuper(Node node, ResolvedKindVisitor<R> visitor) {
-    if (node.asSendSet() != null) {
-      return visitor.handleSendSet(node);
-    }
-    return visitor.visitSuperSend(node);
-  }
-
-  @override
-  R bulkHandleSet(SendSet node, ResolvedKindVisitor<R> visitor) {
-    return visitor.handleSendSet(node);
-  }
-
-  @override
-  R bulkHandleCompound(SendSet node, ResolvedKindVisitor<R> visitor) {
-    return visitor.handleSendSet(node);
-  }
-
-  @override
-  R bulkHandleIndexSet(SendSet node, ResolvedKindVisitor<R> visitor) {
-    return visitor.handleSendSet(node);
-  }
-
-  @override
-  R bulkHandleNew(NewExpression node, ResolvedKindVisitor<R> visitor) {
-    return visitor.handleNewExpression(node);
-  }
-
-  @override
-  void previsitDeferredAccess(
-      Send node,
-      PrefixElement prefix,
-      ResolvedKindVisitor<R> visitor) {
-  }
-
-  @override
-  R errorInvalidAssert(
-      Send node,
-      NodeList arguments,
-      ResolvedKindVisitor<R> visitor) {
-    return visitor.visitAssertSend(node);
-  }
-
-  @override
-  R visitLocalFunctionPostfix(
-      Send node,
-      LocalFunctionElement function,
-      op.IncDecOperator operator,
-      ResolvedKindVisitor<R> visitor) {
-    return visitor.handleSendSet(node);
-  }
-
-  @override
-  R visitLocalFunctionPrefix(
-      Send node,
-      LocalFunctionElement function,
-      op.IncDecOperator operator,
-      ResolvedKindVisitor<R> visitor) {
-    return visitor.handleSendSet(node);
-  }
-
-  @override
-  R visitStaticSetterGet(
-      Send node,
-      FunctionElement setter,
-      ResolvedKindVisitor<R> visitor) {
-    return visitor.visitGetterSend(node);
-  }
-
-  @override
-  R visitStaticSetterInvoke(
-      Send node,
-      FunctionElement setter,
-      NodeList arguments,
-      CallStructure callStructure,
-      ResolvedKindVisitor<R> visitor) {
-    return visitor.visitStaticSend(node);
-  }
-
-  @override
-  R visitSuperSetterGet(
-      Send node,
-      FunctionElement setter,
-      ResolvedKindVisitor<R> visitor) {
-    return visitor.visitSuperSend(node);
-  }
-
-  @override
-  R visitSuperSetterInvoke(
-      Send node,
-      FunctionElement setter,
-      NodeList arguments,
-      CallStructure callStructure,
-      ResolvedKindVisitor<R> visitor) {
-    return visitor.visitSuperSend(node);
-  }
-
-  @override
-  R visitTopLevelSetterGet(
-      Send node,
-      FunctionElement setter,
-      ResolvedKindVisitor<R> visitor) {
-    return visitor.visitGetterSend(node);
-  }
-
-  @override
-  R visitTopLevelSetterInvoke(
-      Send node,
-      FunctionElement setter,
-      NodeList arguments,
-      CallStructure callStructure,
-      ResolvedKindVisitor<R> visitor) {
-    return visitor.visitStaticSend(node);
-  }
-
-  @override
-  R errorUndefinedBinaryExpression(
-      Send node,
-      Node left,
-      Operator operator,
-      Node right,
-      ResolvedKindVisitor<R> visitor) {
-    return visitor.visitOperatorSend(node);
-  }
-
-  @override
-  R errorUndefinedUnaryExpression(
-      Send node,
-      Operator operator,
-      Node expression,
-      ResolvedKindVisitor<R> visitor) {
-    return visitor.visitOperatorSend(node);
-  }
-
-  @override
-  R visitUnresolvedGet(
-      Send node,
-      Element element,
-      ResolvedKindVisitor<R> visitor) {
-    return visitor.visitGetterSend(node);
-  }
-
-  @override
-  R visitUnresolvedSuperGet(
-      Send node,
-      Element element,
-      ResolvedKindVisitor<R> visitor) {
-    return visitor.visitSuperSend(node);
-  }
-
-  @override
-  R visitUnresolvedInvoke(
-      Send node,
-      Element element,
-      NodeList arguments,
-      Selector selector,
-      ResolvedKindVisitor<R> visitor) {
-    return visitor.visitStaticSend(node);
-  }
-
-  @override
-  R visitUnresolvedPostfix(
-      Send node,
-      Element element,
-      op.IncDecOperator operator,
-      ResolvedKindVisitor<R> visitor) {
-    return visitor.handleSendSet(node);
-  }
-
-  @override
-  R visitUnresolvedPrefix(
-      Send node,
-      Element element,
-      op.IncDecOperator operator,
-      ResolvedKindVisitor<R> visitor) {
-    return visitor.handleSendSet(node);
-  }
-
-  @override
-  R visitAs(
-      Send node,
-      Node expression,
-      DartType type,
-      ResolvedKindVisitor<R> visitor) {
-    return visitor.visitOperatorSend(node);
-  }
-
-  @override
-  R visitAssert(
-      Send node,
-      Node expression,
-      ResolvedKindVisitor<R> visitor) {
-    return visitor.visitAssertSend(node);
-  }
-
-  @override
-  R visitBinary(
-      Send node,
-      Node left,
-      op.BinaryOperator operator,
-      Node right,
-      ResolvedKindVisitor<R> visitor) {
-    return visitor.visitOperatorSend(node);
-  }
-
-  @override
-  R visitEquals(
-      Send node,
-      Node left,
-      Node right,
-      ResolvedKindVisitor<R> visitor) {
-    return visitor.visitOperatorSend(node);
-  }
-
-  @override
-  R visitIs(
-      Send node,
-      Node expression,
-      DartType type,
-      ResolvedKindVisitor<R> visitor) {
-    return visitor.visitOperatorSend(node);
-  }
-
-  @override
-  R visitIsNot(
-      Send node,
-      Node expression,
-      DartType type,
-      ResolvedKindVisitor<R> visitor) {
-    return visitor.visitOperatorSend(node);
-  }
-
-  @override
-  R visitIfNull(
-      Send node,
-      Node left,
-      Node right,
-      ResolvedKindVisitor<R> visitor) {
-    return visitor.visitOperatorSend(node);
-  }
-
-  @override
-  R visitLogicalAnd(
-      Send node,
-      Node left,
-      Node right,
-      ResolvedKindVisitor<R> visitor) {
-    return visitor.visitOperatorSend(node);
-  }
-
-  @override
-  R visitLogicalOr(
-      Send node,
-      Node left,
-      Node right,
-      ResolvedKindVisitor<R> visitor) {
-    return visitor.visitOperatorSend(node);
-  }
-
-  @override
-  R visitNot(
-      Send node,
-      Node expression,
-      ResolvedKindVisitor<R> visitor) {
-    return visitor.visitOperatorSend(node);
-  }
-
-  @override
-  R visitNotEquals(
-      Send node,
-      Node left,
-      Node right,
-      ResolvedKindVisitor<R> visitor) {
-    return visitor.visitOperatorSend(node);
-  }
-
-  @override
-  R visitUnary(
-      Send node,
-      op.UnaryOperator operator,
-      Node expression,
-      ResolvedKindVisitor<R> visitor) {
-    return visitor.visitOperatorSend(node);
-  }
-
-  @override
-  R visitDynamicPropertyInvoke(
-      Send node,
-      Node receiver,
-      NodeList arguments,
-      Selector selector,
-      ResolvedKindVisitor<R> visitor) {
-    return visitor.visitDynamicSend(node);
-  }
-
-  @override
-  R visitIfNotNullDynamicPropertyInvoke(
-      Send node,
-      Node receiver,
-      NodeList arguments,
-      Selector selector,
-      ResolvedKindVisitor<R> visitor) {
-    return visitor.visitDynamicSend(node);
-  }
-
-  @override
-  R visitThisPropertyInvoke(
-      Send node,
-      NodeList arguments,
-      Selector selector,
-      ResolvedKindVisitor<R> visitor) {
-    return visitor.visitDynamicSend(node);
-  }
-
-  @override
-  R visitExpressionInvoke(
-      Send node,
-      Node receiver,
-      NodeList arguments,
-      Selector selector,
-      ResolvedKindVisitor<R> visitor) {
-    return visitor.visitClosureSend(node);
-  }
-
-  @override
-  R visitParameterInvoke(
-      Send node,
-      ParameterElement parameter,
-      NodeList arguments,
-      CallStructure callStructure,
-      ResolvedKindVisitor<R> visitor) {
-    return visitor.visitClosureSend(node);
-  }
-
-  @override
-  R visitLocalVariableInvoke(
-      Send node,
-      LocalVariableElement variable,
-      NodeList arguments,
-      CallStructure callStructure,
-      ResolvedKindVisitor<R> visitor) {
-    return visitor.visitClosureSend(node);
-  }
-
-  @override
-  R visitLocalFunctionInvoke(
-      Send node,
-      LocalFunctionElement function,
-      NodeList arguments,
-      CallStructure callStructure,
-      ResolvedKindVisitor<R> visitor) {
-    return visitor.visitClosureSend(node);
-  }
-
-  @override
-  R visitThisInvoke(
-      Send node,
-      NodeList arguments,
-      CallStructure callStructure,
-      ResolvedKindVisitor<R> visitor) {
-    return visitor.visitClosureSend(node);
-  }
-
-  @override
-  R visitClassTypeLiteralGet(
-      Send node,
-      ConstantExpression constant,
-      ResolvedKindVisitor<R> visitor) {
-    return visitor.visitTypeLiteralSend(node);
-  }
-
-  @override
-  R visitTypedefTypeLiteralGet(
-      Send node,
-      ConstantExpression constant,
-      ResolvedKindVisitor<R> visitor) {
-    return visitor.visitTypeLiteralSend(node);
-  }
-
-  @override
-  R visitDynamicTypeLiteralGet(
-      Send node,
-      ConstantExpression constant,
-      ResolvedKindVisitor<R> visitor) {
-    return visitor.visitTypeLiteralSend(node);
-  }
-
-  @override
-  R visitTypeVariableTypeLiteralGet(
-      Send node,
-      TypeVariableElement element,
-      ResolvedKindVisitor<R> visitor) {
-    return visitor.visitTypeLiteralSend(node);
-  }
-
-  @override
-  R visitClassTypeLiteralInvoke(
-      Send node,
-      ConstantExpression constant,
-      NodeList arguments,
-      CallStructure callStructure,
-      ResolvedKindVisitor<R> visitor) {
-    return visitor.visitTypeLiteralSend(node);
-  }
-
-  @override
-  R visitTypedefTypeLiteralInvoke(
-      Send node,
-      ConstantExpression constant,
-      NodeList arguments,
-      CallStructure callStructure,
-      ResolvedKindVisitor<R> visitor) {
-    return visitor.visitTypeLiteralSend(node);
-  }
-
-  @override
-  R visitDynamicTypeLiteralInvoke(
-      Send node,
-      ConstantExpression constant,
-      NodeList arguments,
-      CallStructure callStructure,
-      ResolvedKindVisitor<R> visitor) {
-    return visitor.visitTypeLiteralSend(node);
-  }
-
-  @override
-  R visitTypeVariableTypeLiteralInvoke(
-      Send node,
-      TypeVariableElement element,
-      NodeList arguments,
-      CallStructure callStructure,
-      ResolvedKindVisitor<R> visitor) {
-    return visitor.visitTypeLiteralSend(node);
-  }
-
-  @override
-  R visitIndex(
-      Send node,
-      Node receiver,
-      Node index,
-      ResolvedKindVisitor<R> visitor) {
-    return visitor.visitOperatorSend(node);
-  }
-
-  @override
-  R visitSuperIndex(
-      Send node,
-      FunctionElement function,
-      Node index,
-      ResolvedKindVisitor<R> visitor) {
-    return visitor.visitSuperSend(node);
-  }
-
-  @override
-  R visitLocalFunctionIncompatibleInvoke(
-      Send node,
-      LocalFunctionElement function,
-      NodeList arguments,
-      CallStructure callStructure,
-      ResolvedKindVisitor<R> visitor) {
-    return visitor.visitClosureSend(node);
-  }
-}
diff --git a/pkg/compiler/lib/src/scanner/array_based_scanner.dart b/pkg/compiler/lib/src/scanner/array_based_scanner.dart
index 457be84..49461fb 100644
--- a/pkg/compiler/lib/src/scanner/array_based_scanner.dart
+++ b/pkg/compiler/lib/src/scanner/array_based_scanner.dart
@@ -2,7 +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.
 
-part of scanner;
+library dart2js.scanner.array_based;
+
+import '../io/source_file.dart' show
+    SourceFile;
+import '../tokens/keyword.dart' show
+    Keyword;
+import '../tokens/precedence.dart' show
+    PrecedenceInfo;
+import '../tokens/precedence_constants.dart' as Precedence show
+    COMMENT_INFO,
+    EOF_INFO;
+import '../tokens/token.dart' show
+    BeginGroupToken,
+    ErrorToken,
+    KeywordToken,
+    SymbolToken,
+    Token;
+import '../tokens/token_constants.dart' as Tokens show
+    LT_TOKEN,
+    OPEN_CURLY_BRACKET_TOKEN,
+    STRING_INTERPOLATION_TOKEN;
+import '../util/characters.dart' show
+    $LF,
+    $STX;
+import '../util/util.dart' show
+    Link;
+
+import 'scanner.dart' show
+    AbstractScanner;
 
 abstract class ArrayBasedScanner extends AbstractScanner {
   ArrayBasedScanner(SourceFile file, bool includeComments)
@@ -64,7 +92,7 @@
       unmatchedBeginGroup(groupingStack.head);
       groupingStack = groupingStack.tail;
     }
-    tail.next = new SymbolToken(EOF_INFO, tokenStart);
+    tail.next = new SymbolToken(Precedence.EOF_INFO, tokenStart);
     tail = tail.next;
     // EOF points to itself so there's always infinite look-ahead.
     tail.next = tail;
@@ -105,7 +133,7 @@
     tail = tail.next;
 
     // { (  [ ${ cannot appear inside a type parameters / arguments.
-    if (!identical(info.kind, LT_TOKEN)) discardOpenLt();
+    if (!identical(info.kind, Tokens.LT_TOKEN)) discardOpenLt();
     groupingStack = groupingStack.prepend(token);
   }
 
@@ -115,7 +143,7 @@
    * '>>' are handled separately bo [appendGt] and [appendGtGt].
    */
   int appendEndGroup(PrecedenceInfo info, int openKind) {
-    assert(!identical(openKind, LT_TOKEN)); // openKind is < for > and >>
+    assert(!identical(openKind, Tokens.LT_TOKEN)); // openKind is < for > and >>
     discardBeginGroupUntil(openKind);
     appendPrecedenceToken(info);
     Token close = tail;
@@ -124,8 +152,8 @@
     }
     BeginGroupToken begin = groupingStack.head;
     if (!identical(begin.kind, openKind)) {
-      assert(begin.kind == STRING_INTERPOLATION_TOKEN &&
-             openKind == OPEN_CURLY_BRACKET_TOKEN);
+      assert(begin.kind == Tokens.STRING_INTERPOLATION_TOKEN &&
+             openKind == Tokens.OPEN_CURLY_BRACKET_TOKEN);
       // We're ending an interpolated expression.
       begin.endGroup = close;
       groupingStack = groupingStack.tail;
@@ -149,8 +177,8 @@
       if (groupingStack.isEmpty) return;
       BeginGroupToken begin = groupingStack.head;
       if (openKind == begin.kind) return;
-      if (openKind == OPEN_CURLY_BRACKET_TOKEN &&
-          begin.kind == STRING_INTERPOLATION_TOKEN) return;
+      if (openKind == Tokens.OPEN_CURLY_BRACKET_TOKEN &&
+          begin.kind == Tokens.STRING_INTERPOLATION_TOKEN) return;
       unmatchedBeginGroup(begin);
       groupingStack = groupingStack.tail;
     }
@@ -164,7 +192,7 @@
   void appendGt(PrecedenceInfo info) {
     appendPrecedenceToken(info);
     if (groupingStack.isEmpty) return;
-    if (identical(groupingStack.head.kind, LT_TOKEN)) {
+    if (identical(groupingStack.head.kind, Tokens.LT_TOKEN)) {
       groupingStack.head.endGroup = tail;
       groupingStack = groupingStack.tail;
     }
@@ -178,13 +206,13 @@
   void appendGtGt(PrecedenceInfo info) {
     appendPrecedenceToken(info);
     if (groupingStack.isEmpty) return;
-    if (identical(groupingStack.head.kind, LT_TOKEN)) {
+    if (identical(groupingStack.head.kind, Tokens.LT_TOKEN)) {
       // Don't assign endGroup: in "T<U<V>>", the '>>' token closes the outer
       // '<', the inner '<' is left without endGroup.
       groupingStack = groupingStack.tail;
     }
     if (groupingStack.isEmpty) return;
-    if (identical(groupingStack.head.kind, LT_TOKEN)) {
+    if (identical(groupingStack.head.kind, Tokens.LT_TOKEN)) {
       groupingStack.head.endGroup = tail;
       groupingStack = groupingStack.tail;
     }
@@ -192,7 +220,7 @@
 
   void appendComment(start, bool asciiOnly) {
     if (!includeComments) return;
-    appendSubstringToken(COMMENT_INFO, start, asciiOnly);
+    appendSubstringToken(Precedence.COMMENT_INFO, start, asciiOnly);
   }
 
   void appendErrorToken(ErrorToken token) {
@@ -213,7 +241,7 @@
    */
   void discardOpenLt() {
     while (!groupingStack.isEmpty
-        && identical(groupingStack.head.kind, LT_TOKEN)) {
+        && identical(groupingStack.head.kind, Tokens.LT_TOKEN)) {
       groupingStack = groupingStack.tail;
     }
   }
diff --git a/pkg/compiler/lib/src/scanner/class_element_parser.dart b/pkg/compiler/lib/src/scanner/class_element_parser.dart
deleted file mode 100644
index 627b0ad..0000000
--- a/pkg/compiler/lib/src/scanner/class_element_parser.dart
+++ /dev/null
@@ -1,244 +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.
-
-part of scanner;
-
-class ClassElementParser extends PartialParser {
-  ClassElementParser(Listener listener) : super(listener);
-
-  Token parseClassBody(Token token) => fullParseClassBody(token);
-}
-
-class PartialClassElement extends ClassElementX with PartialElement {
-  ClassNode cachedNode;
-
-  PartialClassElement(String name,
-                      Token beginToken,
-                      Token endToken,
-                      Element enclosing,
-                      int id)
-      : super(name, enclosing, id, STATE_NOT_STARTED) {
-    this.beginToken = beginToken;
-    this.endToken = endToken;
-  }
-
-  void set supertypeLoadState(int state) {
-    assert(state == STATE_NOT_STARTED || state == supertypeLoadState + 1);
-    assert(state <= STATE_DONE);
-    super.supertypeLoadState = state;
-  }
-
-  void set resolutionState(int state) {
-    assert(state == STATE_NOT_STARTED || state == resolutionState + 1);
-    assert(state <= STATE_DONE);
-    super.resolutionState = state;
-  }
-
-  bool get hasNode => cachedNode != null;
-
-  ClassNode get node {
-    assert(invariant(this, cachedNode != null,
-        message: "Node has not been computed for $this."));
-    return cachedNode;
-  }
-
-  ClassNode parseNode(Compiler compiler) {
-    if (cachedNode != null) return cachedNode;
-    compiler.withCurrentElement(this, () {
-      compiler.parser.measure(() {
-        MemberListener listener = new MemberListener(compiler, this);
-        Parser parser = new ClassElementParser(listener);
-        try {
-          Token token = parser.parseTopLevelDeclaration(beginToken);
-          assert(identical(token, endToken.next));
-          cachedNode = listener.popNode();
-          assert(
-              invariant(
-                  beginToken, listener.nodes.isEmpty,
-                  message: "Non-empty listener stack: ${listener.nodes}"));
-        } on ParserError {
-          // TODO(ahe): Often, a ParserError is thrown while parsing the class
-          // body. This means that the stack actually contains most of the
-          // information synthesized below. Consider rewriting the parser so
-          // endClassDeclaration is called before parsing the class body.
-          Identifier name = new Identifier(findMyName(beginToken));
-          NodeList typeParameters = null;
-          Node supertype = null;
-          NodeList interfaces = listener.makeNodeList(0, null, null, ",");
-          Token extendsKeyword = null;
-          NodeList body = listener.makeNodeList(0, beginToken, endToken, null);
-          cachedNode = new ClassNode(
-              Modifiers.EMPTY, name, typeParameters, supertype, interfaces,
-              beginToken, extendsKeyword, body, endToken);
-          hasParseError = true;
-        }
-      });
-      compiler.patchParser.measure(() {
-        if (isPatched) {
-          // TODO(lrn): Perhaps extract functionality so it doesn't
-          // need compiler.
-          compiler.patchParser.parsePatchClassNode(patch);
-        }
-      });
-    });
-    return cachedNode;
-  }
-
-  Token get position => beginToken;
-
-  // TODO(johnniwinther): Ensure that modifiers are always available.
-  Modifiers get modifiers =>
-      cachedNode != null ? cachedNode.modifiers : Modifiers.EMPTY;
-
-  accept(ElementVisitor visitor, arg) {
-    return visitor.visitClassElement(this, arg);
-  }
-
-  PartialClassElement copyWithEnclosing(CompilationUnitElement enclosing) {
-    return new PartialClassElement(name, beginToken, endToken, enclosing, id);
-  }
-}
-
-class MemberListener extends NodeListener {
-  final ClassElementX enclosingClass;
-
-  MemberListener(DiagnosticListener listener,
-                 ClassElementX enclosingElement)
-      : this.enclosingClass = enclosingElement,
-        super(listener, enclosingElement.compilationUnit);
-
-  bool isConstructorName(Node nameNode) {
-    if (enclosingClass == null ||
-        enclosingClass.kind != ElementKind.CLASS) {
-      return false;
-    }
-    String name;
-    if (nameNode.asIdentifier() != null) {
-      name = nameNode.asIdentifier().source;
-    } else {
-      Send send = nameNode.asSend();
-      name = send.receiver.asIdentifier().source;
-    }
-    return enclosingClass.name == name;
-  }
-
-  // TODO(johnniwinther): Remove this method.
-  String getMethodNameHack(Node methodName) {
-    Send send = methodName.asSend();
-    if (send == null) {
-      if (isConstructorName(methodName)) return '';
-      return methodName.asIdentifier().source;
-    }
-    Identifier receiver = send.receiver.asIdentifier();
-    Identifier selector = send.selector.asIdentifier();
-    Operator operator = selector.asOperator();
-    if (operator != null) {
-      assert(identical(receiver.source, 'operator'));
-      // TODO(ahe): It is a hack to compare to ')', but it beats
-      // parsing the node.
-      bool isUnary = identical(operator.token.next.next.stringValue, ')');
-      return Elements.constructOperatorName(operator.source, isUnary);
-    } else {
-      if (receiver == null || receiver.source != enclosingClass.name) {
-        listener.reportError(send.receiver,
-                                 MessageKind.INVALID_CONSTRUCTOR_NAME,
-                                 {'name': enclosingClass.name});
-      }
-      return selector.source;
-    }
-  }
-
-  void endMethod(Token getOrSet, Token beginToken, Token endToken) {
-    super.endMethod(getOrSet, beginToken, endToken);
-    FunctionExpression method = popNode();
-    pushNode(null);
-    bool isConstructor = isConstructorName(method.name);
-    String name = getMethodNameHack(method.name);
-    Element memberElement;
-    if (isConstructor) {
-      if (getOrSet != null) {
-        recoverableError(getOrSet, 'illegal modifier');
-      }
-      memberElement = new PartialConstructorElement(
-          name, beginToken, endToken,
-          ElementKind.GENERATIVE_CONSTRUCTOR,
-          method.modifiers,
-          enclosingClass);
-    } else {
-      memberElement = new PartialFunctionElement(
-          name, beginToken, getOrSet, endToken,
-          method.modifiers, enclosingClass, hasBody: method.hasBody());
-    }
-    addMember(memberElement);
-  }
-
-  void endFactoryMethod(Token beginToken, Token endToken) {
-    super.endFactoryMethod(beginToken, endToken);
-    FunctionExpression method = popNode();
-    pushNode(null);
-    String name = getMethodNameHack(method.name);
-    Identifier singleIdentifierName = method.name.asIdentifier();
-    if (singleIdentifierName != null && singleIdentifierName.source == name) {
-      if (name != enclosingClass.name) {
-        listener.reportError(singleIdentifierName,
-                                 MessageKind.INVALID_UNNAMED_CONSTRUCTOR_NAME,
-                                 {'name': enclosingClass.name});
-      }
-    }
-    Element memberElement = new PartialConstructorElement(
-        name, beginToken, endToken,
-        ElementKind.FUNCTION,
-        method.modifiers,
-        enclosingClass);
-    addMember(memberElement);
-  }
-
-  void endFields(int count, Token beginToken, Token endToken) {
-    bool hasParseError = memberErrors.head;
-    super.endFields(count, beginToken, endToken);
-    VariableDefinitions variableDefinitions = popNode();
-    Modifiers modifiers = variableDefinitions.modifiers;
-    pushNode(null);
-    void buildFieldElement(Identifier name, VariableList fields) {
-      Element element =
-          new FieldElementX(name, enclosingClass, fields);
-      addMember(element);
-    }
-    buildFieldElements(modifiers, variableDefinitions.definitions,
-                       enclosingClass,
-                       buildFieldElement, beginToken, endToken,
-                       hasParseError);
-  }
-
-  void endInitializer(Token assignmentOperator) {
-    pushNode(null); // Super expects an expression, but
-                    // ClassElementParser just skips expressions.
-    super.endInitializer(assignmentOperator);
-  }
-
-  void endInitializers(int count, Token beginToken, Token endToken) {
-    pushNode(null);
-  }
-
-  void addMetadata(ElementX memberElement) {
-    for (Link link = metadata; !link.isEmpty; link = link.tail) {
-      memberElement.addMetadata(link.head);
-    }
-    metadata = const Link<MetadataAnnotation>();
-  }
-
-  void addMember(ElementX memberElement) {
-    addMetadata(memberElement);
-    enclosingClass.addMember(memberElement, listener);
-  }
-
-  void endMetadata(Token beginToken, Token periodBeforeName, Token endToken) {
-    popNode(); // Discard arguments.
-    if (periodBeforeName != null) {
-      popNode(); // Discard name.
-    }
-    popNode(); // Discard node (Send or Identifier).
-    pushMetadata(new PartialMetadataAnnotation(beginToken, endToken));
-  }
-}
diff --git a/pkg/compiler/lib/src/scanner/keyword.dart b/pkg/compiler/lib/src/scanner/keyword.dart
deleted file mode 100644
index 804a0ee..0000000
--- a/pkg/compiler/lib/src/scanner/keyword.dart
+++ /dev/null
@@ -1,210 +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.
-
-part of scanner;
-
-/**
- * A keyword in the Dart programming language.
- */
-class Keyword {
-  static const List<Keyword> values = const <Keyword> [
-      const Keyword("assert"),
-      const Keyword("break"),
-      const Keyword("case"),
-      const Keyword("catch"),
-      const Keyword("class"),
-      const Keyword("const"),
-      const Keyword("continue"),
-      const Keyword("default"),
-      const Keyword("do"),
-      const Keyword("else"),
-      const Keyword("enum"),
-      const Keyword("extends"),
-      const Keyword("false"),
-      const Keyword("final"),
-      const Keyword("finally"),
-      const Keyword("for"),
-      const Keyword("if"),
-      const Keyword("in"),
-      const Keyword("new"),
-      const Keyword("null"),
-      const Keyword("rethrow"),
-      const Keyword("return"),
-      const Keyword("super"),
-      const Keyword("switch"),
-      const Keyword("this"),
-      const Keyword("throw"),
-      const Keyword("true"),
-      const Keyword("try"),
-      const Keyword("var"),
-      const Keyword("void"),
-      const Keyword("while"),
-      const Keyword("with"),
-
-      // TODO(ahe): Don't think this is a reserved word.
-      // See: http://dartbug.com/5579
-      const Keyword("is", info: IS_INFO),
-
-      const Keyword("abstract", isBuiltIn: true),
-      const Keyword("as", info: AS_INFO, isBuiltIn: true),
-      const Keyword("dynamic", isBuiltIn: true),
-      const Keyword("export", isBuiltIn: true),
-      const Keyword("external", isBuiltIn: true),
-      const Keyword("factory", isBuiltIn: true),
-      const Keyword("get", isBuiltIn: true),
-      const Keyword("implements", isBuiltIn: true),
-      const Keyword("import", isBuiltIn: true),
-      const Keyword("library", isBuiltIn: true),
-      const Keyword("operator", isBuiltIn: true),
-      const Keyword("part", isBuiltIn: true),
-      const Keyword("set", isBuiltIn: true),
-      const Keyword("static", isBuiltIn: true),
-      const Keyword("typedef", isBuiltIn: true),
-
-      const Keyword("hide", isPseudo: true),
-      const Keyword("native", isPseudo: true),
-      const Keyword("of", isPseudo: true),
-      const Keyword("on", isPseudo: true),
-      const Keyword("show", isPseudo: true),
-      const Keyword("source", isPseudo: true),
-      const Keyword("deferred", isPseudo: true),
-      const Keyword("async", isPseudo: true),
-      const Keyword("sync", isPseudo: true),
-      const Keyword("await", isPseudo: true),
-      const Keyword("yield", isPseudo: true)];
-
-  final String syntax;
-  final bool isPseudo;
-  final bool isBuiltIn;
-  final PrecedenceInfo info;
-
-  static Map<String, Keyword> _keywords;
-  static Map<String, Keyword> get keywords {
-    if (_keywords == null) {
-      _keywords = computeKeywordMap();
-    }
-    return _keywords;
-  }
-
-  const Keyword(this.syntax,
-                {this.isPseudo: false,
-                 this.isBuiltIn: false,
-                 this.info: KEYWORD_INFO});
-
-  static Map<String, Keyword> computeKeywordMap() {
-    Map<String, Keyword> result = new Map<String, Keyword>();
-    for (Keyword keyword in values) {
-      result[keyword.syntax] = keyword;
-    }
-    return result;
-  }
-
-  String toString() => syntax;
-}
-
-/**
- * Abstract state in a state machine for scanning keywords.
- */
-abstract class KeywordState {
-  KeywordState(this.keyword);
-
-  KeywordState next(int c);
-  final Keyword keyword;
-
-  static KeywordState _KEYWORD_STATE;
-  static KeywordState get KEYWORD_STATE {
-    if (_KEYWORD_STATE == null) {
-      List<String> strings =
-          new List<String>(Keyword.values.length);
-      for (int i = 0; i < Keyword.values.length; i++) {
-        strings[i] = Keyword.values[i].syntax;
-      }
-      strings.sort((a,b) => a.compareTo(b));
-      _KEYWORD_STATE = computeKeywordStateTable(0, strings, 0, strings.length);
-    }
-    return _KEYWORD_STATE;
-  }
-
-  static KeywordState computeKeywordStateTable(int start, List<String> strings,
-                                               int offset, int length) {
-    List<KeywordState> result = new List<KeywordState>(26);
-    assert(length != 0);
-    int chunk = 0;
-    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) {
-            assert(result[chunk - $a] == null);
-            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 LeafKeywordState(strings[offset]);
-    }
-    if (isLeaf) {
-      return new ArrayKeywordState(result, strings[offset]);
-    } else {
-      return new ArrayKeywordState(result, null);
-    }
-  }
-}
-
-/**
- * A state with multiple outgoing transitions.
- */
-class ArrayKeywordState extends KeywordState {
-  final List<KeywordState> table;
-
-  ArrayKeywordState(List<KeywordState> this.table, String syntax)
-    : super((syntax == null) ? null : Keyword.keywords[syntax]);
-
-  KeywordState next(int c) => table[c - $a];
-
-  String toString() {
-    StringBuffer sb = new StringBuffer();
-    sb.write("[");
-    if (keyword != null) {
-      sb.write("*");
-      sb.write(keyword);
-      sb.write(" ");
-    }
-    List<KeywordState> foo = table;
-    for (int i = 0; i < foo.length; i++) {
-      if (foo[i] != null) {
-        sb.write("${new String.fromCharCodes([i + $a])}: ${foo[i]}; ");
-      }
-    }
-    sb.write("]");
-    return sb.toString();
-  }
-}
-
-/**
- * A state that has no outgoing transitions.
- */
-class LeafKeywordState extends KeywordState {
-  LeafKeywordState(String syntax) : super(Keyword.keywords[syntax]);
-
-  KeywordState next(int c) => null;
-
-  String toString() => keyword.syntax;
-}
diff --git a/pkg/compiler/lib/src/scanner/listener.dart b/pkg/compiler/lib/src/scanner/listener.dart
deleted file mode 100644
index c3299a3..0000000
--- a/pkg/compiler/lib/src/scanner/listener.dart
+++ /dev/null
@@ -1,2610 +0,0 @@
-// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-part of scanner;
-
-const bool VERBOSE = false;
-
-/**
- * A parser event listener that does nothing except throw exceptions
- * on parser errors.
- */
-class Listener {
-  set suppressParseErrors(bool value) {
-  }
-
-  void beginArguments(Token token) {
-  }
-
-  void endArguments(int count, Token beginToken, Token endToken) {
-  }
-
-  /// Handle async modifiers `async`, `async*`, `sync`.
-  void handleAsyncModifier(Token asyncToken, Token startToken) {
-  }
-
-  void beginAwaitExpression(Token token) {
-  }
-
-  void endAwaitExpression(Token beginToken, Token endToken) {
-  }
-
-  void beginBlock(Token token) {
-  }
-
-  void endBlock(int count, Token beginToken, Token endToken) {
-  }
-
-  void beginCascade(Token token) {
-  }
-
-  void endCascade() {
-  }
-
-  void beginClassBody(Token token) {
-  }
-
-  void endClassBody(int memberCount, Token beginToken, Token endToken) {
-  }
-
-  void beginClassDeclaration(Token token) {
-  }
-
-  void endClassDeclaration(int interfacesCount, Token beginToken,
-                           Token extendsKeyword, Token implementsKeyword,
-                           Token endToken) {
-  }
-
-  void beginCombinators(Token token) {
-  }
-
-  void endCombinators(int count) {
-  }
-
-  void beginCompilationUnit(Token token) {
-  }
-
-  void endCompilationUnit(int count, Token token) {
-  }
-
-  void beginConstructorReference(Token start) {
-  }
-
-  void endConstructorReference(Token start, Token periodBeforeName,
-                               Token endToken) {
-  }
-
-  void beginDoWhileStatement(Token token) {
-  }
-
-  void endDoWhileStatement(Token doKeyword, Token whileKeyword,
-                           Token endToken) {
-  }
-
-  void beginEnum(Token enumKeyword) {
-  }
-
-  void endEnum(Token enumKeyword, Token endBrace, int count) {
-  }
-
-  void beginExport(Token token) {
-  }
-
-  void endExport(Token exportKeyword, Token semicolon) {
-  }
-
-  void beginExpressionStatement(Token token) {
-  }
-
-  void endExpressionStatement(Token token) {
-  }
-
-  void beginFactoryMethod(Token token) {
-  }
-
-  void endFactoryMethod(Token beginToken, Token endToken) {
-  }
-
-  void beginFormalParameter(Token token) {
-  }
-
-  void endFormalParameter(Token thisKeyword) {
-  }
-
-  void handleNoFormalParameters(Token token) {
-  }
-
-  void beginFormalParameters(Token token) {
-  }
-
-  void endFormalParameters(int count, Token beginToken, Token endToken) {
-  }
-
-  void endFields(int count, Token beginToken, Token endToken) {
-  }
-
-  void beginForStatement(Token token) {
-  }
-
-  void endForStatement(int updateExpressionCount,
-                       Token beginToken, Token endToken) {
-  }
-
-  void endForIn(Token awaitToken, Token forToken,
-                Token inKeyword, Token endToken) {
-  }
-
-  void beginFunction(Token token) {
-  }
-
-  void endFunction(Token getOrSet, Token endToken) {
-  }
-
-  void beginFunctionDeclaration(Token token) {
-  }
-
-  void endFunctionDeclaration(Token token) {
-  }
-
-  void beginFunctionBody(Token token) {
-  }
-
-  void endFunctionBody(int count, Token beginToken, Token endToken) {
-  }
-
-  void handleNoFunctionBody(Token token) {
-  }
-
-  void skippedFunctionBody(Token token) {
-  }
-
-  void beginFunctionName(Token token) {
-  }
-
-  void endFunctionName(Token token) {
-  }
-
-  void beginFunctionTypeAlias(Token token) {
-  }
-
-  void endFunctionTypeAlias(Token typedefKeyword, Token endToken) {
-  }
-
-  void beginMixinApplication(Token token) {
-  }
-
-  void endMixinApplication() {
-  }
-
-  void beginNamedMixinApplication(Token token) {
-  }
-
-  void endNamedMixinApplication(Token classKeyword,
-                                Token implementsKeyword,
-                                Token endToken) {
-  }
-
-  void beginHide(Token hideKeyword) {
-  }
-
-  void endHide(Token hideKeyword) {
-  }
-
-  void beginIdentifierList(Token token) {
-  }
-
-  void endIdentifierList(int count) {
-  }
-
-  void beginTypeList(Token token) {
-  }
-
-  void endTypeList(int count) {
-  }
-
-  void beginIfStatement(Token token) {
-  }
-
-  void endIfStatement(Token ifToken, Token elseToken) {
-  }
-
-  void beginImport(Token importKeyword) {
-  }
-
-  void endImport(Token importKeyword, Token DeferredKeyword,
-                 Token asKeyword, Token semicolon) {
-  }
-
-  void beginInitializedIdentifier(Token token) {
-  }
-
-  void endInitializedIdentifier() {
-  }
-
-  void beginInitializer(Token token) {
-  }
-
-  void endInitializer(Token assignmentOperator) {
-  }
-
-  void beginInitializers(Token token) {
-  }
-
-  void endInitializers(int count, Token beginToken, Token endToken) {
-  }
-
-  void handleNoInitializers() {
-  }
-
-  void handleLabel(Token token) {
-  }
-
-  void beginLabeledStatement(Token token, int labelCount) {
-  }
-
-  void endLabeledStatement(int labelCount) {
-  }
-
-  void beginLibraryName(Token token) {
-  }
-
-  void endLibraryName(Token libraryKeyword, Token semicolon) {
-  }
-
-  void beginLiteralMapEntry(Token token) {
-  }
-
-  void endLiteralMapEntry(Token colon, Token endToken) {
-  }
-
-  void beginLiteralString(Token token) {
-  }
-
-  void endLiteralString(int interpolationCount) {
-  }
-
-  void handleStringJuxtaposition(int literalCount) {
-  }
-
-  void beginMember(Token token) {
-  }
-
-  void endMethod(Token getOrSet, Token beginToken, Token endToken) {
-  }
-
-  void beginMetadataStar(Token token) {
-  }
-
-  void endMetadataStar(int count, bool forParameter) {
-  }
-
-  void beginMetadata(Token token) {
-  }
-
-  void endMetadata(Token beginToken, Token periodBeforeName, Token endToken) {
-  }
-
-  void beginOptionalFormalParameters(Token token) {
-  }
-
-  void endOptionalFormalParameters(int count,
-                                   Token beginToken, Token endToken) {
-  }
-
-  void beginPart(Token token) {
-  }
-
-  void endPart(Token partKeyword, Token semicolon) {
-  }
-
-  void beginPartOf(Token token) {
-  }
-
-  void endPartOf(Token partKeyword, Token semicolon) {
-  }
-
-  void beginRedirectingFactoryBody(Token token) {
-  }
-
-  void endRedirectingFactoryBody(Token beginToken, Token endToken) {
-  }
-
-  void beginReturnStatement(Token token) {
-  }
-
-  void endReturnStatement(bool hasExpression,
-                          Token beginToken, Token endToken) {
-  }
-
-  void beginSend(Token token) {
-  }
-
-  void endSend(Token token) {
-  }
-
-  void beginShow(Token showKeyword) {
-  }
-
-  void endShow(Token showKeyword) {
-  }
-
-  void beginSwitchStatement(Token token) {
-  }
-
-  void endSwitchStatement(Token switchKeyword, Token endToken) {
-  }
-
-  void beginSwitchBlock(Token token) {
-  }
-
-  void endSwitchBlock(int caseCount, Token beginToken, Token endToken) {
-  }
-
-  void beginLiteralSymbol(Token token) {
-  }
-
-  void endLiteralSymbol(Token hashToken, int identifierCount) {
-  }
-
-  void beginThrowExpression(Token token) {
-  }
-
-  void endThrowExpression(Token throwToken, Token endToken) {
-  }
-
-  void beginRethrowStatement(Token token) {
-  }
-
-  void endRethrowStatement(Token throwToken, Token endToken) {
-  }
-
-  void endTopLevelDeclaration(Token token) {
-  }
-
-  void beginTopLevelMember(Token token) {
-  }
-
-  void endTopLevelFields(int count, Token beginToken, Token endToken) {
-  }
-
-  void endTopLevelMethod(Token beginToken, Token getOrSet, Token endToken) {
-  }
-
-  void beginTryStatement(Token token) {
-  }
-
-  void handleCaseMatch(Token caseKeyword, Token colon) {
-  }
-
-  void handleCatchBlock(Token onKeyword, Token catchKeyword) {
-  }
-
-  void handleFinallyBlock(Token finallyKeyword) {
-  }
-
-  void endTryStatement(int catchCount, Token tryKeyword, Token finallyKeyword) {
-  }
-
-  void endType(Token beginToken, Token endToken) {
-  }
-
-  void beginTypeArguments(Token token) {
-  }
-
-  void endTypeArguments(int count, Token beginToken, Token endToken) {
-  }
-
-  void handleNoTypeArguments(Token token) {
-  }
-
-  void beginTypeVariable(Token token) {
-  }
-
-  void endTypeVariable(Token token) {
-  }
-
-  void beginTypeVariables(Token token) {
-  }
-
-  void endTypeVariables(int count, Token beginToken, Token endToken) {
-  }
-
-  void beginUnnamedFunction(Token token) {
-  }
-
-  void endUnnamedFunction(Token token) {
-  }
-
-  void beginVariablesDeclaration(Token token) {
-  }
-
-  void endVariablesDeclaration(int count, Token endToken) {
-  }
-
-  void beginWhileStatement(Token token) {
-  }
-
-  void endWhileStatement(Token whileKeyword, Token endToken) {
-  }
-
-  void handleAsOperator(Token operathor, Token endToken) {
-    // TODO(ahe): Rename [operathor] to "operator" when VM bug is fixed.
-  }
-
-  void handleAssignmentExpression(Token token) {
-  }
-
-  void handleBinaryExpression(Token token) {
-  }
-
-  void handleConditionalExpression(Token question, Token colon) {
-  }
-
-  void handleConstExpression(Token token) {
-  }
-
-  void handleFunctionTypedFormalParameter(Token token) {
-  }
-
-  void handleIdentifier(Token token) {
-  }
-
-  void handleIndexedExpression(Token openCurlyBracket,
-                               Token closeCurlyBracket) {
-  }
-
-  void handleIsOperator(Token operathor, Token not, Token endToken) {
-    // TODO(ahe): Rename [operathor] to "operator" when VM bug is fixed.
-  }
-
-  void handleLiteralBool(Token token) {
-  }
-
-  void handleBreakStatement(bool hasTarget,
-                            Token breakKeyword, Token endToken) {
-  }
-
-  void handleContinueStatement(bool hasTarget,
-                               Token continueKeyword, Token endToken) {
-  }
-
-  void handleEmptyStatement(Token token) {
-  }
-
-  void handleAssertStatement(Token assertKeyword, Token semicolonToken) {
-  }
-
-  /** Called with either the token containing a double literal, or
-    * an immediately preceding "unary plus" token.
-    */
-  void handleLiteralDouble(Token token) {
-  }
-
-  /** Called with either the token containing an integer literal,
-    * or an immediately preceding "unary plus" token.
-    */
-  void handleLiteralInt(Token token) {
-  }
-
-  void handleLiteralList(int count, Token beginToken, Token constKeyword,
-                         Token endToken) {
-  }
-
-  void handleLiteralMap(int count, Token beginToken, Token constKeyword,
-                        Token endToken) {
-  }
-
-  void handleLiteralNull(Token token) {
-  }
-
-  void handleModifier(Token token) {
-  }
-
-  void handleModifiers(int count) {
-  }
-
-  void handleNamedArgument(Token colon) {
-  }
-
-  void handleNewExpression(Token token) {
-  }
-
-  void handleNoArguments(Token token) {
-  }
-
-  void handleNoExpression(Token token) {
-  }
-
-  void handleNoType(Token token) {
-  }
-
-  void handleNoTypeVariables(Token token) {
-  }
-
-  void handleOperator(Token token) {
-  }
-
-  void handleOperatorName(Token operatorKeyword, Token token) {
-  }
-
-  void handleParenthesizedExpression(BeginGroupToken token) {
-  }
-
-  void handleQualified(Token period) {
-  }
-
-  void handleStringPart(Token token) {
-  }
-
-  void handleSuperExpression(Token token) {
-  }
-
-  void handleSwitchCase(int labelCount, int expressionCount,
-                        Token defaultKeyword, int statementCount,
-                        Token firstToken, Token endToken) {
-  }
-
-  void handleThisExpression(Token token) {
-  }
-
-  void handleUnaryPostfixAssignmentExpression(Token token) {
-  }
-
-  void handleUnaryPrefixExpression(Token token) {
-  }
-
-  void handleUnaryPrefixAssignmentExpression(Token token) {
-  }
-
-  void handleValuedFormalParameter(Token equals, Token token) {
-  }
-
-  void handleVoidKeyword(Token token) {
-  }
-
-  void beginYieldStatement(Token token) {
-  }
-
-  void endYieldStatement(Token yieldToken, Token starToken, Token endToken) {
-  }
-
-  Token expected(String string, Token token) {
-    if (token is ErrorToken) {
-      reportErrorToken(token);
-    } else {
-      error("expected '$string', but got '${token.value}'", token);
-    }
-    return skipToEof(token);
-  }
-
-  Token synthesizeIdentifier(Token token) {
-    Token synthesizedToken =
-        new StringToken.fromString(IDENTIFIER_INFO, '?', token.charOffset);
-    synthesizedToken.next = token.next;
-    return synthesizedToken;
-  }
-
-  Token expectedIdentifier(Token token) {
-    if (token is ErrorToken) {
-      reportErrorToken(token);
-    } else {
-      error("expected identifier, but got '${token.value}'", token);
-    }
-    return skipToEof(token);
-  }
-
-  Token expectedType(Token token) {
-    if (token is ErrorToken) {
-      reportErrorToken(token);
-    } else {
-      error("expected a type, but got '${token.value}'", token);
-    }
-    return skipToEof(token);
-  }
-
-  Token expectedExpression(Token token) {
-    if (token is ErrorToken) {
-      reportErrorToken(token);
-    } else {
-      error("expected an expression, but got '${token.value}'", token);
-    }
-    return skipToEof(token);
-  }
-
-  Token unexpected(Token token) {
-    if (token is ErrorToken) {
-      reportErrorToken(token);
-    } else {
-      error("unexpected token '${token.value}'", token);
-    }
-    return skipToEof(token);
-  }
-
-  Token expectedBlockToSkip(Token token) {
-    if (token is ErrorToken) {
-      reportErrorToken(token);
-    } else {
-      error("expected a block, but got '${token.value}'", token);
-    }
-    return skipToEof(token);
-  }
-
-  Token expectedFunctionBody(Token token) {
-    if (token is ErrorToken) {
-      reportErrorToken(token);
-    } else {
-      error("expected a function body, but got '${token.value}'", token);
-    }
-    return skipToEof(token);
-  }
-
-  Token expectedClassBody(Token token) {
-    if (token is ErrorToken) {
-      reportErrorToken(token);
-    } else {
-      error("expected a class body, but got '${token.value}'", token);
-    }
-    return skipToEof(token);
-  }
-
-  Token expectedClassBodyToSkip(Token token) {
-    if (token is ErrorToken) {
-      reportErrorToken(token);
-    } else {
-      error("expected a class body, but got '${token.value}'", token);
-    }
-    return skipToEof(token);
-  }
-
-  Token expectedDeclaration(Token token) {
-    if (token is ErrorToken) {
-      reportErrorToken(token);
-    } else {
-      error("expected a declaration, but got '${token.value}'", token);
-    }
-    return skipToEof(token);
-  }
-
-  Token unmatched(Token token) {
-    if (token is ErrorToken) {
-      reportErrorToken(token);
-    } else {
-      error("unmatched '${token.value}'", token);
-    }
-    return skipToEof(token);
-  }
-
-  skipToEof(Token token) {
-    while (!identical(token.info, EOF_INFO)) {
-      token = token.next;
-    }
-    return token;
-  }
-
-  void recoverableError(Token token, String message) {
-    error(message, token);
-  }
-
-  void error(String message, Token token) {
-    throw new ParserError("$message @ ${token.charOffset}");
-  }
-
-  void reportError(Spannable spannable,
-                   MessageKind messageKind,
-                   [Map arguments = const {}]) {
-    MessageTemplate template = MessageTemplate.TEMPLATES[messageKind];
-    String message = template.message(arguments, true).toString();
-    Token token;
-    if (spannable is Token) {
-      token = spannable;
-    } else if (spannable is Node) {
-      token = spannable.getBeginToken();
-    } else {
-      throw new ParserError(message);
-    }
-    recoverableError(token, message);
-  }
-
-  void reportErrorToken(ErrorToken token) {
-    if (token is BadInputToken) {
-      String hex = token.character.toRadixString(16);
-      if (hex.length < 4) {
-        String padding = "0000".substring(hex.length);
-        hex = "$padding$hex";
-      }
-      reportError(
-          token, MessageKind.BAD_INPUT_CHARACTER, {'characterHex': hex});
-    } else if (token is UnterminatedToken) {
-      MessageKind kind;
-      var arguments = const {};
-      switch (token.start) {
-        case '1e':
-          kind = MessageKind.EXPONENT_MISSING;
-          break;
-        case '"':
-        case "'":
-        case '"""':
-        case "'''":
-        case 'r"':
-        case "r'":
-        case 'r"""':
-        case "r'''":
-          kind = MessageKind.UNTERMINATED_STRING;
-          arguments = {'quote': token.start};
-          break;
-        case '0x':
-          kind = MessageKind.HEX_DIGIT_EXPECTED;
-          break;
-        case r'$':
-          kind = MessageKind.MALFORMED_STRING_LITERAL;
-          break;
-        case '/*':
-          kind = MessageKind.UNTERMINATED_COMMENT;
-          break;
-        default:
-          kind = MessageKind.UNTERMINATED_TOKEN;
-          break;
-      }
-      reportError(token, kind, arguments);
-    } else if (token is UnmatchedToken) {
-      String begin = token.begin.value;
-      String end = closeBraceFor(begin);
-      reportError(
-          token, MessageKind.UNMATCHED_TOKEN, {'begin': begin, 'end': end});
-    } else {
-      throw new SpannableAssertionFailure(token, token.assertionMessage);
-    }
-  }
-}
-
-String closeBraceFor(String openBrace) {
-  return const {
-    '(': ')',
-    '[': ']',
-    '{': '}',
-    '<': '>',
-    r'${': '}',
-  }[openBrace];
-}
-
-class ParserError {
-  final String reason;
-  ParserError(this.reason);
-  toString() => reason;
-}
-
-typedef int IdGenerator();
-
-/**
- * A parser event listener designed to work with [PartialParser]. It
- * builds elements representing the top-level declarations found in
- * the parsed compilation unit and records them in
- * [compilationUnitElement].
- */
-class ElementListener extends Listener {
-  final IdGenerator idGenerator;
-  final DiagnosticListener listener;
-  final CompilationUnitElementX compilationUnitElement;
-  final StringValidator stringValidator;
-  Link<StringQuoting> interpolationScope;
-
-  Link<Node> nodes = const Link<Node>();
-
-  Link<MetadataAnnotation> metadata = const Link<MetadataAnnotation>();
-
-  /// Records a stack of booleans for each member parsed (a stack is used to
-  /// support nested members which isn't currently possible, but it also serves
-  /// as a simple way to tell we're currently parsing a member). In this case,
-  /// member refers to members of a library or a class (but currently, classes
-  /// themselves are not considered members).  If the top of the stack
-  /// (memberErrors.head) is true, the current member has already reported at
-  /// least one parse error.
-  Link<bool> memberErrors = const Link<bool>();
-
-  bool suppressParseErrors = false;
-
-  ElementListener(
-      DiagnosticListener listener,
-      this.compilationUnitElement,
-      this.idGenerator)
-      : this.listener = listener,
-        stringValidator = new StringValidator(listener),
-        interpolationScope = const Link<StringQuoting>();
-
-  bool get currentMemberHasParseError {
-    return !memberErrors.isEmpty && memberErrors.head;
-  }
-
-  void pushQuoting(StringQuoting quoting) {
-    interpolationScope = interpolationScope.prepend(quoting);
-  }
-
-  StringQuoting popQuoting() {
-    StringQuoting result = interpolationScope.head;
-    interpolationScope = interpolationScope.tail;
-    return result;
-  }
-
-  StringNode popLiteralString() {
-    StringNode node = popNode();
-    // TODO(lrn): Handle interpolations in script tags.
-    if (node.isInterpolation) {
-      listener.internalError(node,
-          "String interpolation not supported in library tags.");
-      return null;
-    }
-    return node;
-  }
-
-  bool allowLibraryTags() {
-    // Library tags are only allowed in the library file itself, not
-    // in sourced files.
-    LibraryElement library = compilationUnitElement.implementationLibrary;
-    return !compilationUnitElement.hasMembers &&
-           library.entryCompilationUnit == compilationUnitElement;
-  }
-
-  void endLibraryName(Token libraryKeyword, Token semicolon) {
-    Expression name = popNode();
-    addLibraryTag(new LibraryName(libraryKeyword, name,
-                                  popMetadata(compilationUnitElement)));
-  }
-
-  void endImport(Token importKeyword, Token deferredKeyword, Token asKeyword,
-                 Token semicolon) {
-    NodeList combinators = popNode();
-    bool isDeferred = deferredKeyword != null;
-    Identifier prefix;
-    if (asKeyword != null) {
-      prefix = popNode();
-    }
-    StringNode uri = popLiteralString();
-    addLibraryTag(new Import(importKeyword, uri, prefix, combinators,
-                             popMetadata(compilationUnitElement),
-                             isDeferred: isDeferred));
-  }
-
-  void endEnum(Token enumKeyword, Token endBrace, int count) {
-    NodeList names = makeNodeList(count, enumKeyword.next.next, endBrace, ",");
-    Identifier name = popNode();
-
-    int id = idGenerator();
-    Element enclosing = compilationUnitElement;
-    pushElement(new EnumClassElementX(name.source, enclosing, id,
-        new Enum(enumKeyword, name, names)));
-    rejectBuiltInIdentifier(name);
-  }
-
-  void endExport(Token exportKeyword, Token semicolon) {
-    NodeList combinators = popNode();
-    StringNode uri = popNode();
-    addLibraryTag(new Export(exportKeyword, uri, combinators,
-                             popMetadata(compilationUnitElement)));
-  }
-
-  void endCombinators(int count) {
-    if (0 == count) {
-      pushNode(null);
-    } else {
-      pushNode(makeNodeList(count, null, null, " "));
-    }
-  }
-
-  void endHide(Token hideKeyword) => pushCombinator(hideKeyword);
-
-  void endShow(Token showKeyword) => pushCombinator(showKeyword);
-
-  void pushCombinator(Token keywordToken) {
-    NodeList identifiers = popNode();
-    pushNode(new Combinator(identifiers, keywordToken));
-  }
-
-  void endIdentifierList(int count) {
-    pushNode(makeNodeList(count, null, null, ","));
-  }
-
-  void endTypeList(int count) {
-    pushNode(makeNodeList(count, null, null, ","));
-  }
-
-  void endPart(Token partKeyword, Token semicolon) {
-    StringNode uri = popLiteralString();
-    addLibraryTag(new Part(partKeyword, uri,
-                           popMetadata(compilationUnitElement)));
-  }
-
-  void endPartOf(Token partKeyword, Token semicolon) {
-    Expression name = popNode();
-    addPartOfTag(new PartOf(partKeyword, name,
-                            popMetadata(compilationUnitElement)));
-  }
-
-  void addPartOfTag(PartOf tag) {
-    compilationUnitElement.setPartOf(tag, listener);
-  }
-
-  void endMetadata(Token beginToken, Token periodBeforeName, Token endToken) {
-    if (periodBeforeName != null) {
-      popNode(); // Discard name.
-    }
-    popNode(); // Discard node (Send or Identifier).
-    pushMetadata(new PartialMetadataAnnotation(beginToken, endToken));
-  }
-
-  void endTopLevelDeclaration(Token token) {
-    if (!metadata.isEmpty) {
-      recoverableError(metadata.head.beginToken,
-                       'Metadata not supported here.');
-      metadata = const Link<MetadataAnnotation>();
-    }
-  }
-
-  void endClassDeclaration(int interfacesCount, Token beginToken,
-                           Token extendsKeyword, Token implementsKeyword,
-                           Token endToken) {
-    makeNodeList(interfacesCount, implementsKeyword, null, ","); // interfaces
-    popNode(); // superType
-    popNode(); // typeParameters
-    Identifier name = popNode();
-    int id = idGenerator();
-    PartialClassElement element = new PartialClassElement(
-        name.source, beginToken, endToken, compilationUnitElement, id);
-    pushElement(element);
-    rejectBuiltInIdentifier(name);
-  }
-
-  void rejectBuiltInIdentifier(Identifier name) {
-    if (name.token is KeywordToken) {
-      Keyword keyword = (name.token as KeywordToken).keyword;
-      if (!keyword.isPseudo) {
-        recoverableError(name, "Illegal name '${keyword.syntax}'.");
-      }
-    }
-  }
-
-  void endFunctionTypeAlias(Token typedefKeyword, Token endToken) {
-    popNode(); // TODO(karlklose): do not throw away typeVariables.
-    Identifier name = popNode();
-    popNode(); // returnType
-    pushElement(
-        new PartialTypedefElement(
-            name.source, compilationUnitElement, typedefKeyword, endToken));
-    rejectBuiltInIdentifier(name);
-  }
-
-  void endNamedMixinApplication(Token classKeyword,
-                                Token implementsKeyword,
-                                Token endToken) {
-    NodeList interfaces = (implementsKeyword != null) ? popNode() : null;
-    MixinApplication mixinApplication = popNode();
-    Modifiers modifiers = popNode();
-    NodeList typeParameters = popNode();
-    Identifier name = popNode();
-    NamedMixinApplication namedMixinApplication = new NamedMixinApplication(
-        name, typeParameters, modifiers, mixinApplication, interfaces,
-        classKeyword, endToken);
-
-    int id = idGenerator();
-    Element enclosing = compilationUnitElement;
-    pushElement(new MixinApplicationElementX(name.source, enclosing, id,
-                                             namedMixinApplication,
-                                             modifiers));
-    rejectBuiltInIdentifier(name);
-  }
-
-  void endMixinApplication() {
-    NodeList mixins = popNode();
-    TypeAnnotation superclass = popNode();
-    pushNode(new MixinApplication(superclass, mixins));
-  }
-
-  void handleVoidKeyword(Token token) {
-    pushNode(new TypeAnnotation(new Identifier(token), null));
-  }
-
-  void endTopLevelMethod(Token beginToken, Token getOrSet, Token endToken) {
-    bool hasParseError = currentMemberHasParseError;
-    memberErrors = memberErrors.tail;
-    Identifier name = popNode();
-    popNode(); // type
-    Modifiers modifiers = popNode();
-    PartialFunctionElement element = new PartialFunctionElement(
-        name.source, beginToken, getOrSet, endToken,
-        modifiers, compilationUnitElement);
-    element.hasParseError = hasParseError;
-    pushElement(element);
-  }
-
-  void endTopLevelFields(int count, Token beginToken, Token endToken) {
-    bool hasParseError = currentMemberHasParseError;
-    memberErrors = memberErrors.tail;
-    void buildFieldElement(Identifier name, VariableList fields) {
-      pushElement(
-          new FieldElementX(name, compilationUnitElement, fields));
-    }
-    NodeList variables = makeNodeList(count, null, null, ",");
-    popNode(); // type
-    Modifiers modifiers = popNode();
-    buildFieldElements(modifiers, variables, compilationUnitElement,
-                       buildFieldElement,
-                       beginToken, endToken, hasParseError);
-  }
-
-  void buildFieldElements(Modifiers modifiers,
-                          NodeList variables,
-                          Element enclosingElement,
-                          void buildFieldElement(Identifier name,
-                                                 VariableList fields),
-                          Token beginToken, Token endToken,
-                          bool hasParseError) {
-    VariableList fields =
-        new PartialFieldList(beginToken, endToken, modifiers, hasParseError);
-    for (Link<Node> variableNodes = variables.nodes;
-         !variableNodes.isEmpty;
-         variableNodes = variableNodes.tail) {
-      Expression initializedIdentifier = variableNodes.head;
-      Identifier identifier = initializedIdentifier.asIdentifier();
-      if (identifier == null) {
-        identifier = initializedIdentifier.asSendSet().selector.asIdentifier();
-      }
-      buildFieldElement(identifier, fields);
-    }
-  }
-
-  void handleIdentifier(Token token) {
-    pushNode(new Identifier(token));
-  }
-
-  void handleQualified(Token period) {
-    Identifier last = popNode();
-    Expression first = popNode();
-    pushNode(new Send(first, last));
-  }
-
-  void handleNoType(Token token) {
-    pushNode(null);
-  }
-
-  void endTypeVariable(Token token) {
-    TypeAnnotation bound = popNode();
-    Identifier name = popNode();
-    pushNode(new TypeVariable(name, bound));
-    rejectBuiltInIdentifier(name);
-  }
-
-  void endTypeVariables(int count, Token beginToken, Token endToken) {
-    pushNode(makeNodeList(count, beginToken, endToken, ','));
-  }
-
-  void handleNoTypeVariables(token) {
-    pushNode(null);
-  }
-
-  void endTypeArguments(int count, Token beginToken, Token endToken) {
-    pushNode(makeNodeList(count, beginToken, endToken, ','));
-  }
-
-  void handleNoTypeArguments(Token token) {
-    pushNode(null);
-  }
-
-  void endType(Token beginToken, Token endToken) {
-    NodeList typeArguments = popNode();
-    Expression typeName = popNode();
-    pushNode(new TypeAnnotation(typeName, typeArguments));
-  }
-
-  void handleParenthesizedExpression(BeginGroupToken token) {
-    Expression expression = popNode();
-    pushNode(new ParenthesizedExpression(expression, token));
-  }
-
-  void handleModifier(Token token) {
-    pushNode(new Identifier(token));
-  }
-
-  void handleModifiers(int count) {
-    if (count == 0) {
-      pushNode(Modifiers.EMPTY);
-    } else {
-      NodeList modifierNodes = makeNodeList(count, null, null, ' ');
-      pushNode(new Modifiers(modifierNodes));
-    }
-  }
-
-  Token expected(String string, Token token) {
-    if (token is ErrorToken) {
-      reportErrorToken(token);
-    } else if (identical(';', string)) {
-      // When a semicolon is missing, it often leads to an error on the
-      // following line. So we try to find the token preceding the semicolon
-      // and report that something is missing *after* it.
-      Token preceding = findPrecedingToken(token);
-      if (preceding == token) {
-        reportError(
-            token, MessageKind.MISSING_TOKEN_BEFORE_THIS, {'token': string});
-      } else {
-        reportError(
-            preceding, MessageKind.MISSING_TOKEN_AFTER_THIS, {'token': string});
-      }
-      return token;
-    } else {
-      reportFatalError(
-          token,
-          MessageTemplate.TEMPLATES[MessageKind.MISSING_TOKEN_BEFORE_THIS]
-              .message({'token': string}, true).toString());
-    }
-    return skipToEof(token);
-  }
-
-  /// Finds the preceding token via the begin token of the last AST node pushed
-  /// on the [nodes] stack.
-  Token findPrecedingToken(Token token) {
-    Token result;
-    Link<Node> nodes = this.nodes;
-    while (!nodes.isEmpty) {
-      result = findPrecedingTokenFromNode(nodes.head, token);
-      if (result != null) {
-        return result;
-      }
-      nodes = nodes.tail;
-    }
-    if (compilationUnitElement != null) {
-      if (compilationUnitElement is CompilationUnitElementX) {
-        CompilationUnitElementX unit = compilationUnitElement;
-        Link<Element> members = unit.localMembers;
-        while (!members.isEmpty) {
-          ElementX member = members.head;
-          DeclarationSite site = member.declarationSite;
-          if (site is PartialElement) {
-            result = findPrecedingTokenFromToken(site.endToken, token);
-            if (result != null) {
-              return result;
-            }
-          }
-          members = members.tail;
-        }
-        result =
-            findPrecedingTokenFromNode(compilationUnitElement.partTag, token);
-        if (result != null) {
-          return result;
-        }
-      }
-    }
-    return token;
-  }
-
-  Token findPrecedingTokenFromNode(Node node, Token token) {
-    if (node != null) {
-      return findPrecedingTokenFromToken(node.getBeginToken(), token);
-    }
-    return null;
-  }
-
-  Token findPrecedingTokenFromToken(Token start, Token token) {
-    if (start != null) {
-      Token current = start;
-      while (current.kind != EOF_TOKEN && current.next != token) {
-        current = current.next;
-      }
-      if (current.kind != EOF_TOKEN) {
-        return current;
-      }
-    }
-    return null;
-  }
-
-  Token expectedIdentifier(Token token) {
-    if (token is KeywordToken) {
-      reportError(
-          token, MessageKind.EXPECTED_IDENTIFIER_NOT_RESERVED_WORD,
-          {'keyword': token.value});
-    } else if (token is ErrorToken) {
-      reportErrorToken(token);
-      return synthesizeIdentifier(token);
-    } else {
-      reportFatalError(token,
-          "Expected identifier, but got '${token.value}'.");
-    }
-    return token;
-  }
-
-  Token expectedType(Token token) {
-    pushNode(null);
-    if (token is ErrorToken) {
-      reportErrorToken(token);
-      return synthesizeIdentifier(token);
-    } else {
-      reportFatalError(
-          token, "Expected a type, but got '${token.value}'.");
-      return skipToEof(token);
-    }
-  }
-
-  Token expectedExpression(Token token) {
-    if (token is ErrorToken) {
-      reportErrorToken(token);
-      pushNode(new ErrorExpression(token));
-      return token.next;
-    } else {
-      reportFatalError(token,
-                       "Expected an expression, but got '${token.value}'.");
-      pushNode(null);
-      return skipToEof(token);
-    }
-  }
-
-  Token unexpected(Token token) {
-    if (token is ErrorToken) {
-      reportErrorToken(token);
-    } else {
-      String message = "Unexpected token '${token.value}'.";
-      if (token.info == BAD_INPUT_INFO) {
-        message = token.value;
-      }
-      reportFatalError(token, message);
-    }
-    return skipToEof(token);
-  }
-
-  Token expectedBlockToSkip(Token token) {
-    if (identical(token.stringValue, 'native')) {
-      return native.handleNativeBlockToSkip(this, token);
-    } else {
-      return unexpected(token);
-    }
-  }
-
-  Token expectedFunctionBody(Token token) {
-    if (token is ErrorToken) {
-      reportErrorToken(token);
-    } else {
-      String printString = token.value;
-      reportFatalError(token,
-                       "Expected a function body, but got '$printString'.");
-    }
-    return skipToEof(token);
-  }
-
-  Token expectedClassBody(Token token) {
-    if (token is ErrorToken) {
-      reportErrorToken(token);
-    } else {
-      reportFatalError(token,
-                       "Expected a class body, but got '${token.value}'.");
-    }
-    return skipToEof(token);
-  }
-
-  Token expectedClassBodyToSkip(Token token) {
-    return unexpected(token);
-  }
-
-  Token expectedDeclaration(Token token) {
-    if (token is ErrorToken) {
-      reportErrorToken(token);
-    } else {
-      reportFatalError(token,
-                       "Expected a declaration, but got '${token.value}'.");
-    }
-    return skipToEof(token);
-  }
-
-  Token unmatched(Token token) {
-    if (token is ErrorToken) {
-      reportErrorToken(token);
-    } else {
-      String begin = token.value;
-      String end = closeBraceFor(begin);
-      reportError(
-          token, MessageKind.UNMATCHED_TOKEN, {'begin': begin, 'end': end});
-    }
-    Token next = token.next;
-    while (next is ErrorToken) {
-      next = next.next;
-    }
-    return next;
-  }
-
-  void recoverableError(Spannable node, String message) {
-    // TODO(johnniwinther): Make recoverable errors non-fatal.
-    reportFatalError(node, message);
-  }
-
-  void pushElement(Element element) {
-    popMetadata(element);
-    compilationUnitElement.addMember(element, listener);
-  }
-
-  Link<MetadataAnnotation> popMetadata(ElementX element) {
-    var result = const Link<MetadataAnnotation>();
-    for (Link link = metadata; !link.isEmpty; link = link.tail) {
-      element.addMetadata(link.head);
-      // Reverse the list as is implicitly done by addMetadata.
-      result = result.prepend(link.head);
-    }
-    metadata = const Link<MetadataAnnotation>();
-    return result;
-  }
-
-  void pushMetadata(MetadataAnnotation annotation) {
-    metadata = metadata.prepend(annotation);
-  }
-
-  void addLibraryTag(LibraryTag tag) {
-    if (!allowLibraryTags()) {
-      recoverableError(tag, 'Library tags not allowed here.');
-    }
-    LibraryElementX implementationLibrary =
-        compilationUnitElement.implementationLibrary;
-    implementationLibrary.addTag(tag, listener);
-  }
-
-  void pushNode(Node node) {
-    nodes = nodes.prepend(node);
-    if (VERBOSE) log("push $nodes");
-  }
-
-  Node popNode() {
-    assert(!nodes.isEmpty);
-    Node node = nodes.head;
-    nodes = nodes.tail;
-    if (VERBOSE) log("pop $nodes");
-    return node;
-  }
-
-  void log(message) {
-    print(message);
-  }
-
-  NodeList makeNodeList(int count, Token beginToken, Token endToken,
-                        String delimiter) {
-    Link<Node> poppedNodes = const Link<Node>();
-    for (; count > 0; --count) {
-      // This effectively reverses the order of nodes so they end up
-      // in correct (source) order.
-      poppedNodes = poppedNodes.prepend(popNode());
-    }
-    return new NodeList(beginToken, poppedNodes, endToken, delimiter);
-  }
-
-  void beginLiteralString(Token token) {
-    String source = token.value;
-    StringQuoting quoting = StringValidator.quotingFromString(source);
-    pushQuoting(quoting);
-    // Just wrap the token for now. At the end of the interpolation,
-    // when we know how many there are, go back and validate the tokens.
-    pushNode(new LiteralString(token, null));
-  }
-
-  void handleStringPart(Token token) {
-    // Just push an unvalidated token now, and replace it when we know the
-    // end of the interpolation.
-    pushNode(new LiteralString(token, null));
-  }
-
-  void endLiteralString(int count) {
-    StringQuoting quoting = popQuoting();
-
-    Link<StringInterpolationPart> parts =
-        const Link<StringInterpolationPart>();
-    // Parts of the string interpolation are popped in reverse order,
-    // starting with the last literal string part.
-    bool isLast = true;
-    for (int i = 0; i < count; i++) {
-      LiteralString string = popNode();
-      DartString validation =
-          stringValidator.validateInterpolationPart(string.token, quoting,
-                                                    isFirst: false,
-                                                    isLast: isLast);
-      // Replace the unvalidated LiteralString with a new LiteralString
-      // object that has the validation result included.
-      string = new LiteralString(string.token, validation);
-      Expression expression = popNode();
-      parts = parts.prepend(new StringInterpolationPart(expression, string));
-      isLast = false;
-    }
-
-    LiteralString string = popNode();
-    DartString validation =
-        stringValidator.validateInterpolationPart(string.token, quoting,
-                                                  isFirst: true,
-                                                  isLast: isLast);
-    string = new LiteralString(string.token, validation);
-    if (isLast) {
-      pushNode(string);
-    } else {
-      NodeList partNodes = new NodeList(null, parts, null, "");
-      pushNode(new StringInterpolation(string, partNodes));
-    }
-  }
-
-  void handleStringJuxtaposition(int stringCount) {
-    assert(stringCount != 0);
-    Expression accumulator = popNode();
-    stringCount--;
-    while (stringCount > 0) {
-      Expression expression = popNode();
-      accumulator = new StringJuxtaposition(expression, accumulator);
-      stringCount--;
-    }
-    pushNode(accumulator);
-  }
-
-  void beginMember(Token token) {
-    memberErrors = memberErrors.prepend(false);
-  }
-
-  void beginTopLevelMember(Token token) {
-    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) {
-    memberErrors = memberErrors.tail;
-  }
-
-  /// Don't call this method. Should only be used as a last resort when there
-  /// is no feasible way to recover from a parser error.
-  void reportFatalError(Spannable spannable, String message) {
-    reportError(spannable, MessageKind.GENERIC, {'text': message});
-    // Some parse errors are infeasible to recover from, so we throw an error.
-    throw new ParserError(message);
-  }
-
-  void reportError(Spannable spannable,
-                   MessageKind errorCode,
-                   [Map arguments = const {}]) {
-    if (currentMemberHasParseError) return; // Error already reported.
-    if (suppressParseErrors) return;
-    if (!memberErrors.isEmpty) {
-      memberErrors = memberErrors.tail.prepend(true);
-    }
-    listener.reportError(spannable, errorCode, arguments);
-  }
-}
-
-class NodeListener extends ElementListener {
-  NodeListener(
-      DiagnosticListener listener,
-      CompilationUnitElement element)
-    : super(listener, element, null);
-
-  void addLibraryTag(LibraryTag tag) {
-    pushNode(tag);
-  }
-
-  void addPartOfTag(PartOf tag) {
-    pushNode(tag);
-  }
-
-  void endClassDeclaration(int interfacesCount, Token beginToken,
-                           Token extendsKeyword, Token implementsKeyword,
-                           Token endToken) {
-    NodeList body = popNode();
-    NodeList interfaces =
-        makeNodeList(interfacesCount, implementsKeyword, null, ",");
-    Node supertype = popNode();
-    NodeList typeParameters = popNode();
-    Identifier name = popNode();
-    Modifiers modifiers = popNode();
-    pushNode(new ClassNode(modifiers, name, typeParameters, supertype,
-                           interfaces, beginToken, extendsKeyword, body,
-                           endToken));
-  }
-
-  void endCompilationUnit(int count, Token token) {
-    pushNode(makeNodeList(count, null, null, '\n'));
-  }
-
-  void endFunctionTypeAlias(Token typedefKeyword, Token endToken) {
-    NodeList formals = popNode();
-    NodeList typeParameters = popNode();
-    Identifier name = popNode();
-    TypeAnnotation returnType = popNode();
-    pushNode(new Typedef(returnType, name, typeParameters, formals,
-                         typedefKeyword, endToken));
-  }
-
-  void endNamedMixinApplication(Token classKeyword,
-                                Token implementsKeyword,
-                                Token endToken) {
-    NodeList interfaces = (implementsKeyword != null) ? popNode() : null;
-    Node mixinApplication = popNode();
-    Modifiers modifiers = popNode();
-    NodeList typeParameters = popNode();
-    Identifier name = popNode();
-    pushNode(new NamedMixinApplication(name, typeParameters,
-                                       modifiers, mixinApplication,
-                                       interfaces,
-                                       classKeyword, endToken));
-  }
-
-  void endEnum(Token enumKeyword, Token endBrace, int count) {
-    NodeList names = makeNodeList(count, enumKeyword.next.next, endBrace, ",");
-    Identifier name = popNode();
-    pushNode(new Enum(enumKeyword, name, names));
-  }
-
-  void endClassBody(int memberCount, Token beginToken, Token endToken) {
-    pushNode(makeNodeList(memberCount, beginToken, endToken, null));
-  }
-
-  void endTopLevelFields(int count, Token beginToken, Token endToken) {
-    NodeList variables = makeNodeList(count, null, endToken, ",");
-    TypeAnnotation type = popNode();
-    Modifiers modifiers = popNode();
-    pushNode(new VariableDefinitions(type, modifiers, variables));
-  }
-
-  void endTopLevelMethod(Token beginToken, Token getOrSet, Token endToken) {
-    popNode(); // body
-    popNode(); // formalParameters
-    Identifier name = popNode();
-    popNode(); // type
-    Modifiers modifiers = popNode();
-    PartialFunctionElement element = new PartialFunctionElement(
-        name.source, beginToken, getOrSet, endToken,
-        modifiers, compilationUnitElement);
-    pushElement(element);
-  }
-
-  void endFormalParameter(Token thisKeyword) {
-    Expression name = popNode();
-    if (thisKeyword != null) {
-      Identifier thisIdentifier = new Identifier(thisKeyword);
-      if (name.asSend() == null) {
-        name = new Send(thisIdentifier, name);
-      } else {
-        name = name.asSend().copyWithReceiver(thisIdentifier, false);
-      }
-    }
-    TypeAnnotation type = popNode();
-    Modifiers modifiers = popNode();
-    NodeList metadata = popNode();
-    pushNode(new VariableDefinitions.forParameter(
-        metadata, type, modifiers, new NodeList.singleton(name)));
-  }
-
-  void endFormalParameters(int count, Token beginToken, Token endToken) {
-    pushNode(makeNodeList(count, beginToken, endToken, ","));
-  }
-
-  void handleNoFormalParameters(Token token) {
-    pushNode(null);
-  }
-
-  void endArguments(int count, Token beginToken, Token endToken) {
-    pushNode(makeNodeList(count, beginToken, endToken, ","));
-  }
-
-  void handleNoArguments(Token token) {
-    pushNode(null);
-  }
-
-  void endConstructorReference(Token start, Token periodBeforeName,
-                               Token endToken) {
-    Identifier name = null;
-    if (periodBeforeName != null) {
-      name = popNode();
-    }
-    NodeList typeArguments = popNode();
-    Node classReference = popNode();
-    if (typeArguments != null) {
-      classReference = new TypeAnnotation(classReference, typeArguments);
-    } else {
-      Identifier identifier = classReference.asIdentifier();
-      Send send = classReference.asSend();
-      if (identifier != null) {
-        // TODO(ahe): Should be:
-        // classReference = new Send(null, identifier);
-        classReference = identifier;
-      } else if (send != null) {
-        classReference = send;
-      } else {
-        internalError(node: classReference);
-      }
-    }
-    Node constructor = classReference;
-    if (name != null) {
-      // Either typeName<args>.name or x.y.name.
-      constructor = new Send(classReference, name);
-    }
-    pushNode(constructor);
-  }
-
-  void endRedirectingFactoryBody(Token beginToken,
-                                 Token endToken) {
-    pushNode(new RedirectingFactoryBody(beginToken, endToken, popNode()));
-  }
-
-  void endReturnStatement(bool hasExpression,
-                          Token beginToken, Token endToken) {
-    Expression expression = hasExpression ? popNode() : null;
-    pushNode(new Return(beginToken, endToken, expression));
-  }
-
-  void endYieldStatement(Token yieldToken, Token starToken, Token endToken) {
-    Expression expression = popNode();
-    pushNode(new Yield(yieldToken, starToken, expression, endToken));
-  }
-
-  void endExpressionStatement(Token token) {
-    pushNode(new ExpressionStatement(popNode(), token));
-  }
-
-  void handleOnError(Token token, var errorInformation) {
-    listener.internalError(token, "'${token.value}': ${errorInformation}");
-  }
-
-  Token expectedFunctionBody(Token token) {
-    if (identical(token.stringValue, 'native')) {
-      return native.handleNativeFunctionBody(this, token);
-    } else if (token is ErrorToken) {
-      pushNode(null);
-      reportErrorToken(token);
-    } else {
-      reportFatalError(token,
-                       "Expected a function body, but got '${token.value}'.");
-    }
-    return skipToEof(token);
-  }
-
-  Token expectedClassBody(Token token) {
-    if (token is ErrorToken) {
-      reportErrorToken(token);
-      return skipToEof(token);
-    } else {
-      reportFatalError(token,
-                       "Expected a class body, but got '${token.value}'.");
-      return skipToEof(token);
-    }
-  }
-
-  void handleLiteralInt(Token token) {
-    pushNode(new LiteralInt(token, (t, e) => handleOnError(t, e)));
-  }
-
-  void handleLiteralDouble(Token token) {
-    pushNode(new LiteralDouble(token, (t, e) => handleOnError(t, e)));
-  }
-
-  void handleLiteralBool(Token token) {
-    pushNode(new LiteralBool(token, (t, e) => handleOnError(t, e)));
-  }
-
-  void handleLiteralNull(Token token) {
-    pushNode(new LiteralNull(token));
-  }
-
-  void endLiteralSymbol(Token hashToken, int identifierCount) {
-    NodeList identifiers = makeNodeList(identifierCount, null, null, '.');
-    pushNode(new LiteralSymbol(hashToken, identifiers));
-  }
-
-  void handleBinaryExpression(Token token) {
-    Node argument = popNode();
-    Node receiver = popNode();
-    String tokenString = token.stringValue;
-    if (identical(tokenString, '.') ||
-        identical(tokenString, '..') ||
-        identical(tokenString, '?.')) {
-      Send argumentSend = argument.asSend();
-      if (argumentSend == null) {
-        // TODO(ahe): The parser should diagnose this problem, not
-        // this listener.
-        reportFatalError(argument,
-                         'Expected an identifier.');
-      }
-      if (argumentSend.receiver != null) internalError(node: argument);
-      if (argument is SendSet) internalError(node: argument);
-      pushNode(argument.asSend().copyWithReceiver(receiver,
-            identical(tokenString, '?.')));
-    } else {
-      NodeList arguments = new NodeList.singleton(argument);
-      pushNode(new Send(receiver, new Operator(token), arguments));
-    }
-    if (identical(tokenString, '===')) {
-      listener.reportError(token, MessageKind.UNSUPPORTED_EQ_EQ_EQ,
-                           {'lhs': receiver, 'rhs': argument});
-    }
-    if (identical(tokenString, '!==')) {
-      listener.reportError(token, MessageKind.UNSUPPORTED_BANG_EQ_EQ,
-                           {'lhs': receiver, 'rhs': argument});
-    }
-  }
-
-  void beginCascade(Token token) {
-    pushNode(new CascadeReceiver(popNode(), token));
-  }
-
-  void endCascade() {
-    pushNode(new Cascade(popNode()));
-  }
-
-  void handleAsOperator(Token operathor, Token endToken) {
-    TypeAnnotation type = popNode();
-    Expression expression = popNode();
-    NodeList arguments = new NodeList.singleton(type);
-    pushNode(new Send(expression, new Operator(operathor), arguments));
-  }
-
-  void handleAssignmentExpression(Token token) {
-    Node arg = popNode();
-    Node node = popNode();
-    Send send = node.asSend();
-    if (send == null || !(send.isPropertyAccess || send.isIndex)) {
-      reportNotAssignable(node);
-    }
-    if (send.asSendSet() != null) internalError(node: send);
-    NodeList arguments;
-    if (send.isIndex) {
-      Link<Node> link = const Link<Node>().prepend(arg);
-      link = link.prepend(send.arguments.head);
-      arguments = new NodeList(null, link);
-    } else {
-      arguments = new NodeList.singleton(arg);
-    }
-    Operator op = new Operator(token);
-    pushNode(new SendSet(send.receiver, send.selector, op, arguments,
-        send.isConditional));
-  }
-
-  void reportNotAssignable(Node node) {
-    // TODO(ahe): The parser should diagnose this problem, not this
-    // listener.
-    reportFatalError(node,
-                     'Not assignable.');
-  }
-
-  void handleConditionalExpression(Token question, Token colon) {
-    Node elseExpression = popNode();
-    Node thenExpression = popNode();
-    Node condition = popNode();
-    pushNode(new Conditional(
-        condition, thenExpression, elseExpression, question, colon));
-  }
-
-  void endSend(Token token) {
-    NodeList arguments = popNode();
-    Node selector = popNode();
-    // TODO(ahe): Handle receiver.
-    pushNode(new Send(null, selector, arguments));
-  }
-
-  void endFunctionBody(int count, Token beginToken, Token endToken) {
-    if (count == 0 && beginToken == null) {
-      pushNode(new EmptyStatement(endToken));
-    } else {
-      pushNode(new Block(makeNodeList(count, beginToken, endToken, null)));
-    }
-  }
-
-  void handleAsyncModifier(Token asyncToken, Token starToken) {
-    if (asyncToken != null) {
-      pushNode(new AsyncModifier(asyncToken, starToken));
-    } else {
-      pushNode(null);
-    }
-  }
-
-  void skippedFunctionBody(Token token) {
-    pushNode(new Block(new NodeList.empty()));
-  }
-
-  void handleNoFunctionBody(Token token) {
-    pushNode(new EmptyStatement(token));
-  }
-
-  void endFunction(Token getOrSet, Token endToken) {
-    Statement body = popNode();
-    AsyncModifier asyncModifier = popNode();
-    NodeList initializers = popNode();
-    NodeList formals = popNode();
-    // The name can be an identifier or a send in case of named constructors.
-    Expression name = popNode();
-    TypeAnnotation type = popNode();
-    Modifiers modifiers = popNode();
-    pushNode(new FunctionExpression(name, formals, body, type,
-                                    modifiers, initializers, getOrSet,
-                                    asyncModifier));
-  }
-
-  void endFunctionDeclaration(Token endToken) {
-    pushNode(new FunctionDeclaration(popNode()));
-  }
-
-  void endVariablesDeclaration(int count, Token endToken) {
-    // TODO(ahe): Pick one name for this concept, either
-    // VariablesDeclaration or VariableDefinitions.
-    NodeList variables = makeNodeList(count, null, endToken, ",");
-    TypeAnnotation type = popNode();
-    Modifiers modifiers = popNode();
-    pushNode(new VariableDefinitions(type, modifiers, variables));
-  }
-
-  void endInitializer(Token assignmentOperator) {
-    Expression initializer = popNode();
-    NodeList arguments =
-        initializer == null ? null : new NodeList.singleton(initializer);
-    Expression name = popNode();
-    Operator op = new Operator(assignmentOperator);
-    pushNode(new SendSet(null, name, op, arguments));
-  }
-
-  void endIfStatement(Token ifToken, Token elseToken) {
-    Statement elsePart = (elseToken == null) ? null : popNode();
-    Statement thenPart = popNode();
-    ParenthesizedExpression condition = popNode();
-    pushNode(new If(condition, thenPart, elsePart, ifToken, elseToken));
-  }
-
-  void endForStatement(int updateExpressionCount,
-                       Token beginToken, Token endToken) {
-    Statement body = popNode();
-    NodeList updates = makeNodeList(updateExpressionCount, null, null, ',');
-    Statement condition = popNode();
-    Node initializer = popNode();
-    pushNode(new For(initializer, condition, updates, body, beginToken));
-  }
-
-  void handleNoExpression(Token token) {
-    pushNode(null);
-  }
-
-  void endDoWhileStatement(Token doKeyword, Token whileKeyword,
-                           Token endToken) {
-    Expression condition = popNode();
-    Statement body = popNode();
-    pushNode(new DoWhile(body, condition, doKeyword, whileKeyword, endToken));
-  }
-
-  void endWhileStatement(Token whileKeyword, Token endToken) {
-    Statement body = popNode();
-    Expression condition = popNode();
-    pushNode(new While(condition, body, whileKeyword));
-  }
-
-  void endBlock(int count, Token beginToken, Token endToken) {
-    pushNode(new Block(makeNodeList(count, beginToken, endToken, null)));
-  }
-
-  void endThrowExpression(Token throwToken, Token endToken) {
-    Expression expression = popNode();
-    pushNode(new Throw(expression, throwToken, endToken));
-  }
-
-  void endAwaitExpression(Token awaitToken, Token endToken) {
-    Expression expression = popNode();
-    pushNode(new Await(awaitToken, expression));
-  }
-
-  void endRethrowStatement(Token throwToken, Token endToken) {
-    pushNode(new Rethrow(throwToken, endToken));
-    if (identical(throwToken.stringValue, 'throw')) {
-      listener.reportError(throwToken,
-                           MessageKind.UNSUPPORTED_THROW_WITHOUT_EXP);
-    }
-  }
-
-  void handleUnaryPrefixExpression(Token token) {
-    pushNode(new Send.prefix(popNode(), new Operator(token)));
-  }
-
-  void handleSuperExpression(Token token) {
-    pushNode(new Identifier(token));
-  }
-
-  void handleThisExpression(Token token) {
-    pushNode(new Identifier(token));
-  }
-
-  void handleUnaryAssignmentExpression(Token token, bool isPrefix) {
-    Node node = popNode();
-    Send send = node.asSend();
-    if (send == null) {
-      reportNotAssignable(node);
-    }
-    if (!(send.isPropertyAccess || send.isIndex)) {
-      reportNotAssignable(node);
-    }
-    if (send.asSendSet() != null) internalError(node: send);
-    Node argument = null;
-    if (send.isIndex) argument = send.arguments.head;
-    Operator op = new Operator(token);
-
-    if (isPrefix) {
-      pushNode(new SendSet.prefix(send.receiver, send.selector, op, argument,
-          send.isConditional));
-    } else {
-      pushNode(new SendSet.postfix(send.receiver, send.selector, op, argument,
-          send.isConditional));
-    }
-  }
-
-  void handleUnaryPostfixAssignmentExpression(Token token) {
-    handleUnaryAssignmentExpression(token, false);
-  }
-
-  void handleUnaryPrefixAssignmentExpression(Token token) {
-    handleUnaryAssignmentExpression(token, true);
-  }
-
-  void endInitializers(int count, Token beginToken, Token endToken) {
-    pushNode(makeNodeList(count, beginToken, null, ','));
-  }
-
-  void handleNoInitializers() {
-    pushNode(null);
-  }
-
-  void endFields(int count, Token beginToken, Token endToken) {
-    NodeList variables = makeNodeList(count, null, endToken, ",");
-    TypeAnnotation type = popNode();
-    Modifiers modifiers = popNode();
-    pushNode(new VariableDefinitions(type, modifiers, variables));
-  }
-
-  void endMethod(Token getOrSet, Token beginToken, Token endToken) {
-    Statement body = popNode();
-    AsyncModifier asyncModifier = popNode();
-    NodeList initializers = popNode();
-    NodeList formalParameters = popNode();
-    Expression name = popNode();
-    TypeAnnotation returnType = popNode();
-    Modifiers modifiers = popNode();
-    pushNode(new FunctionExpression(name, formalParameters, body, returnType,
-                                    modifiers, initializers, getOrSet,
-                                    asyncModifier));
-  }
-
-  void handleLiteralMap(int count, Token beginToken, Token constKeyword,
-                        Token endToken) {
-    NodeList entries = makeNodeList(count, beginToken, endToken, ',');
-    NodeList typeArguments = popNode();
-    pushNode(new LiteralMap(typeArguments, entries, constKeyword));
-  }
-
-  void endLiteralMapEntry(Token colon, Token endToken) {
-    Expression value = popNode();
-    Expression key = popNode();
-    pushNode(new LiteralMapEntry(key, colon, value));
-  }
-
-  void handleLiteralList(int count, Token beginToken, Token constKeyword,
-                         Token endToken) {
-    NodeList elements = makeNodeList(count, beginToken, endToken, ',');
-    pushNode(new LiteralList(popNode(), elements, constKeyword));
-  }
-
-  void handleIndexedExpression(Token openSquareBracket,
-                               Token closeSquareBracket) {
-    NodeList arguments =
-        makeNodeList(1, openSquareBracket, closeSquareBracket, null);
-    Node receiver = popNode();
-    Token token = new StringToken.fromString(INDEX_INFO, '[]',
-                                  openSquareBracket.charOffset);
-    Node selector = new Operator(token);
-    pushNode(new Send(receiver, selector, arguments));
-  }
-
-  void handleNewExpression(Token token) {
-    NodeList arguments = popNode();
-    Node name = popNode();
-    pushNode(new NewExpression(token, new Send(null, name, arguments)));
-  }
-
-  void handleConstExpression(Token token) {
-    // [token] carries the 'const' information.
-    handleNewExpression(token);
-  }
-
-  void handleOperator(Token token) {
-    pushNode(new Operator(token));
-  }
-
-  void handleOperatorName(Token operatorKeyword, Token token) {
-    Operator op = new Operator(token);
-    pushNode(new Send(new Identifier(operatorKeyword), op, null));
-  }
-
-  void handleNamedArgument(Token colon) {
-    Expression expression = popNode();
-    Identifier name = popNode();
-    pushNode(new NamedArgument(name, colon, expression));
-  }
-
-  void endOptionalFormalParameters(int count,
-                                   Token beginToken, Token endToken) {
-    pushNode(makeNodeList(count, beginToken, endToken, ','));
-  }
-
-  void handleFunctionTypedFormalParameter(Token endToken) {
-    NodeList formals = popNode();
-    Identifier name = popNode();
-    TypeAnnotation returnType = popNode();
-    pushNode(null); // Signal "no type" to endFormalParameter.
-    pushNode(new FunctionExpression(name, formals, null, returnType,
-                                    Modifiers.EMPTY, null, null, null));
-  }
-
-  void handleValuedFormalParameter(Token equals, Token token) {
-    Expression defaultValue = popNode();
-    Expression parameterName = popNode();
-    pushNode(new SendSet(null, parameterName, new Operator(equals),
-                         new NodeList.singleton(defaultValue)));
-  }
-
-  void endTryStatement(int catchCount, Token tryKeyword, Token finallyKeyword) {
-    Block finallyBlock = null;
-    if (finallyKeyword != null) {
-      finallyBlock = popNode();
-    }
-    NodeList catchBlocks = makeNodeList(catchCount, null, null, null);
-    Block tryBlock = popNode();
-    pushNode(new TryStatement(tryBlock, catchBlocks, finallyBlock,
-                              tryKeyword, finallyKeyword));
-  }
-
-  void handleCaseMatch(Token caseKeyword, Token colon) {
-    pushNode(new CaseMatch(caseKeyword, popNode(), colon));
-  }
-
-  void handleCatchBlock(Token onKeyword, Token catchKeyword) {
-    Block block = popNode();
-    NodeList formals = catchKeyword != null? popNode(): null;
-    TypeAnnotation type = onKeyword != null ? popNode() : null;
-    pushNode(new CatchBlock(type, formals, block, onKeyword, catchKeyword));
-  }
-
-  void endSwitchStatement(Token switchKeyword, Token endToken) {
-    NodeList cases = popNode();
-    ParenthesizedExpression expression = popNode();
-    pushNode(new SwitchStatement(expression, cases, switchKeyword));
-  }
-
-  void endSwitchBlock(int caseCount, Token beginToken, Token endToken) {
-    Link<Node> caseNodes = const Link<Node>();
-    while (caseCount > 0) {
-      SwitchCase switchCase = popNode();
-      caseNodes = caseNodes.prepend(switchCase);
-      caseCount--;
-    }
-    pushNode(new NodeList(beginToken, caseNodes, endToken, null));
-  }
-
-  void handleSwitchCase(int labelCount, int caseCount,
-                        Token defaultKeyword, int statementCount,
-                        Token firstToken, Token endToken) {
-    NodeList statements = makeNodeList(statementCount, null, null, null);
-    NodeList labelsAndCases =
-        makeNodeList(labelCount + caseCount, null, null, null);
-    pushNode(new SwitchCase(labelsAndCases, defaultKeyword, statements,
-                            firstToken));
-  }
-
-  void handleBreakStatement(bool hasTarget,
-                            Token breakKeyword, Token endToken) {
-    Identifier target = null;
-    if (hasTarget) {
-      target = popNode();
-    }
-    pushNode(new BreakStatement(target, breakKeyword, endToken));
-  }
-
-  void handleContinueStatement(bool hasTarget,
-                               Token continueKeyword, Token endToken) {
-    Identifier target = null;
-    if (hasTarget) {
-      target = popNode();
-    }
-    pushNode(new ContinueStatement(target, continueKeyword, endToken));
-  }
-
-  void handleEmptyStatement(Token token) {
-    pushNode(new EmptyStatement(token));
-  }
-
-  void endFactoryMethod(Token beginToken, Token endToken) {
-    super.endFactoryMethod(beginToken, endToken);
-    Statement body = popNode();
-    AsyncModifier asyncModifier = popNode();
-    NodeList formals = popNode();
-    Node name = popNode();
-
-    // TODO(ahe): Move this parsing to the parser.
-    int modifierCount = 0;
-    Token modifier = beginToken;
-    if (modifier.stringValue == "external") {
-      handleModifier(modifier);
-      modifierCount++;
-      modifier = modifier.next;
-    }
-    if (modifier.stringValue == "const") {
-      handleModifier(modifier);
-      modifierCount++;
-      modifier = modifier.next;
-    }
-    assert(modifier.stringValue == "factory");
-    handleModifier(modifier);
-    modifierCount++;
-    handleModifiers(modifierCount);
-    Modifiers modifiers = popNode();
-
-    pushNode(new FunctionExpression(name, formals, body, null,
-                                    modifiers, null, null, asyncModifier));
-  }
-
-  void endForIn(Token awaitToken, Token forToken,
-                Token inKeyword, Token endToken) {
-    Statement body = popNode();
-    Expression expression = popNode();
-    Node declaredIdentifier = popNode();
-    if (awaitToken == null) {
-      pushNode(new SyncForIn(declaredIdentifier, expression, body,
-                             forToken, inKeyword));
-    } else {
-      pushNode(new AsyncForIn(declaredIdentifier, expression, body, awaitToken,
-                              forToken, inKeyword));
-    }
-  }
-
-  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, ' '));
-      }
-    }
-  }
-
-  void endMetadata(Token beginToken, Token periodBeforeName, Token endToken) {
-    NodeList arguments = popNode();
-    if (arguments == null) {
-      // This is a constant expression.
-      Identifier name;
-      if (periodBeforeName != null) {
-        name = popNode();
-      }
-      NodeList typeArguments = popNode();
-      Node receiver = popNode();
-      if (typeArguments != null) {
-        receiver = new TypeAnnotation(receiver, typeArguments);
-        recoverableError(typeArguments,
-                         'Type arguments are not allowed here.');
-      } else {
-        Identifier identifier = receiver.asIdentifier();
-        Send send = receiver.asSend();
-        if (identifier != null) {
-          receiver = new Send(null, identifier);
-        } else if (send == null) {
-          internalError(node: receiver);
-        }
-      }
-      Send send = receiver;
-      if (name != null) {
-        send = new Send(receiver, name);
-      }
-      pushNode(new Metadata(beginToken, send));
-    } else {
-      // This is a const constructor call.
-      endConstructorReference(beginToken, periodBeforeName, endToken);
-      Node constructor = popNode();
-      pushNode(new Metadata(beginToken,
-          new NewExpression(null,
-              new Send(null, constructor, arguments))));
-    }
-  }
-
-  void handleAssertStatement(Token assertKeyword, Token semicolonToken) {
-    NodeList arguments = popNode();
-    Node selector = new Identifier(assertKeyword);
-    Node send = new Send(null, selector, arguments);
-    pushNode(new ExpressionStatement(send, semicolonToken));
-  }
-
-  void endUnnamedFunction(Token token) {
-    Statement body = popNode();
-    AsyncModifier asyncModifier = popNode();
-    NodeList formals = popNode();
-    pushNode(new FunctionExpression(null, formals, body, null,
-                                    Modifiers.EMPTY, null, null,
-                                    asyncModifier));
-  }
-
-  void handleIsOperator(Token operathor, Token not, Token endToken) {
-    TypeAnnotation type = popNode();
-    Expression expression = popNode();
-    Node argument;
-    if (not != null) {
-      argument = new Send.prefix(type, new Operator(not));
-    } else {
-      argument = type;
-    }
-
-    NodeList arguments = new NodeList.singleton(argument);
-    pushNode(new Send(expression, new Operator(operathor), arguments));
-  }
-
-  void handleLabel(Token colon) {
-    Identifier name = popNode();
-    pushNode(new Label(name, colon));
-  }
-
-  void endLabeledStatement(int labelCount) {
-    Statement statement = popNode();
-    NodeList labels = makeNodeList(labelCount, null, null, null);
-    pushNode(new LabeledStatement(labels, statement));
-  }
-
-  void log(message) {
-    listener.log(message);
-  }
-
-  void internalError({Token token, Node node}) {
-    // TODO(ahe): This should call listener.internalError.
-    Spannable spannable = (token == null) ? node : token;
-    throw new SpannableAssertionFailure(spannable, 'Internal error in parser.');
-  }
-}
-
-abstract class PartialElement implements DeclarationSite {
-  Token beginToken;
-  Token endToken;
-
-  bool hasParseError = false;
-
-  bool get isErroneous => hasParseError;
-
-  DeclarationSite get declarationSite => this;
-}
-
-abstract class PartialFunctionMixin implements BaseFunctionElementX {
-  FunctionExpression cachedNode;
-  Modifiers get modifiers;
-  Token beginToken;
-  Token getOrSet;
-  Token endToken;
-
-  /**
-   * The position is computed in the constructor using [findMyName]. Computing
-   * it on demand fails in case tokens are GC'd.
-   */
-  Token _position;
-
-  void init(Token beginToken, Token getOrSet, Token endToken) {
-    this.beginToken = beginToken;
-    this.getOrSet = getOrSet;
-    this.endToken = endToken;
-    _position = ElementX.findNameToken(
-        beginToken,
-        modifiers.isFactory ||
-          identical(kind, ElementKind.GENERATIVE_CONSTRUCTOR),
-        name, enclosingElement.name);
-  }
-
-  bool get hasNode => cachedNode != null;
-
-  FunctionExpression get node {
-    assert(invariant(this, cachedNode != null,
-        message: "Node has not been computed for $this."));
-    return cachedNode;
-  }
-
-  FunctionExpression parseNode(DiagnosticListener listener) {
-    if (cachedNode != null) return cachedNode;
-    parseFunction(Parser p) {
-      if (isClassMember && modifiers.isFactory) {
-        p.parseFactoryMethod(beginToken);
-      } else {
-        p.parseFunction(beginToken, getOrSet);
-      }
-    }
-    cachedNode = parse(listener, this, declarationSite, parseFunction);
-    return cachedNode;
-  }
-
-  Token get position => _position;
-
-  void reusePartialFunctionMixin() {
-    cachedNode = null;
-  }
-
-  DeclarationSite get declarationSite;
-}
-
-abstract class PartialFunctionElement
-    implements PartialElement, PartialFunctionMixin {
-
-  factory PartialFunctionElement(
-      String name,
-      Token beginToken,
-      Token getOrSet,
-      Token endToken,
-      Modifiers modifiers,
-      Element enclosingElement,
-      {bool hasBody: true}) {
-    if (getOrSet == null) {
-      return new PartialMethodElement(
-          name, beginToken, endToken, modifiers,
-          enclosingElement, hasBody: hasBody);
-    } else if (identical(getOrSet.stringValue, 'get')) {
-      return new PartialGetterElement(
-          name, beginToken, getOrSet, endToken, modifiers,
-          enclosingElement, hasBody: hasBody);
-    } else {
-      assert(identical(getOrSet.stringValue, 'set'));
-      return new PartialSetterElement(
-          name, beginToken, getOrSet, endToken, modifiers,
-          enclosingElement, hasBody: hasBody);
-    }
-  }
-
-  PartialFunctionElement copyWithEnclosing(Element enclosing);
-}
-
-
-class PartialMethodElement extends MethodElementX
-    with PartialElement, PartialFunctionMixin
-    implements PartialFunctionElement {
-  PartialMethodElement(String name,
-                       Token beginToken,
-                       Token endToken,
-                       Modifiers modifiers,
-                       Element enclosing,
-                       {bool hasBody: true})
-      : super(name, ElementKind.FUNCTION, modifiers, enclosing, hasBody) {
-    init(beginToken, null, endToken);
-  }
-
-  void reuseElement() {
-    super.reuseElement();
-    reusePartialFunctionMixin();
-  }
-
-  PartialMethodElement copyWithEnclosing(Element enclosing) {
-    return new PartialMethodElement(
-        name, beginToken, endToken, modifiers, enclosing, hasBody: hasBody);
-  }
-}
-
-class PartialGetterElement extends GetterElementX
-    with PartialElement, PartialFunctionMixin
-    implements GetterElement, PartialFunctionElement  {
-  PartialGetterElement(String name,
-                       Token beginToken,
-                       Token getToken,
-                       Token endToken,
-                       Modifiers modifiers,
-                       Element enclosing,
-                       {bool hasBody: true})
-      : super(name, modifiers, enclosing, hasBody) {
-    init(beginToken, getToken, endToken);
-  }
-
-  @override
-  SetterElement get setter => abstractField.setter;
-
-  void reuseElement() {
-    super.reuseElement();
-    reusePartialFunctionMixin();
-  }
-
-  PartialGetterElement copyWithEnclosing(Element enclosing) {
-    return new PartialGetterElement(
-        name, beginToken, getOrSet, endToken, modifiers, enclosing,
-        hasBody: hasBody);
-  }
-}
-
-class PartialSetterElement extends SetterElementX
-    with PartialElement, PartialFunctionMixin
-    implements SetterElement, PartialFunctionElement {
-  PartialSetterElement(String name,
-                       Token beginToken,
-                       Token setToken,
-                       Token endToken,
-                       Modifiers modifiers,
-                       Element enclosing,
-                       {bool hasBody: true})
-      : super(name, modifiers, enclosing, hasBody) {
-    init(beginToken, setToken, endToken);
-  }
-
-  @override
-  GetterElement get getter => abstractField.getter;
-
-  void reuseElement() {
-    super.reuseElement();
-    reusePartialFunctionMixin();
-  }
-
-  PartialSetterElement copyWithEnclosing(Element enclosing) {
-    return new PartialSetterElement(
-        name, beginToken, getOrSet, endToken, modifiers, enclosing,
-        hasBody: hasBody);
-  }
-}
-
-class PartialConstructorElement extends ConstructorElementX
-    with PartialElement, PartialFunctionMixin {
-  PartialConstructorElement(String name,
-                            Token beginToken,
-                            Token endToken,
-                            ElementKind kind,
-                            Modifiers modifiers,
-                            Element enclosing)
-      : super(name, kind, modifiers, enclosing) {
-    init(beginToken, null, endToken);
-  }
-
-  void reuseElement() {
-    super.reuseElement();
-    reusePartialFunctionMixin();
-  }
-}
-
-class PartialFieldList extends VariableList with PartialElement {
-  PartialFieldList(Token beginToken,
-                   Token endToken,
-                   Modifiers modifiers,
-                   bool hasParseError)
-      : super(modifiers) {
-    super.beginToken = beginToken;
-    super.endToken = endToken;
-    super.hasParseError = hasParseError;
-  }
-
-  VariableDefinitions parseNode(Element element, DiagnosticListener listener) {
-    if (definitions != null) return definitions;
-    listener.withCurrentElement(element, () {
-      definitions = parse(
-          listener, element, declarationSite,
-          (Parser parser) => parser.parseMember(beginToken));
-
-      if (!hasParseError &&
-          !definitions.modifiers.isVar &&
-          !definitions.modifiers.isFinal &&
-          !definitions.modifiers.isConst &&
-          definitions.type == null &&
-          !definitions.isErroneous) {
-        listener.reportError(
-            definitions,
-            MessageKind.GENERIC,
-            { 'text': 'A field declaration must start with var, final, '
-                      'const, or a type annotation.' });
-      }
-    });
-    return definitions;
-  }
-
-  computeType(Element element, Compiler compiler) {
-    if (type != null) return type;
-    // TODO(johnniwinther): Compute this in the resolver.
-    compiler.withCurrentElement(element, () {
-      VariableDefinitions node = parseNode(element, compiler);
-      if (node.type != null) {
-        type = compiler.resolver.resolveTypeAnnotation(element, node.type);
-      } else {
-        type = const DynamicType();
-      }
-    });
-    assert(type != null);
-    return type;
-  }
-}
-
-class PartialTypedefElement extends TypedefElementX with PartialElement {
-
-  PartialTypedefElement(
-      String name,
-      Element enclosing,
-      Token beginToken,
-      Token endToken)
-      : super(name, enclosing) {
-    this.beginToken = beginToken;
-    this.endToken = endToken;
-  }
-
-  Token get token => beginToken;
-
-  Node parseNode(DiagnosticListener listener) {
-    if (cachedNode != null) return cachedNode;
-    cachedNode = parse(
-        listener, this, declarationSite,
-        (p) => p.parseTopLevelDeclaration(token));
-    return cachedNode;
-  }
-
-  Token get position => findMyName(token);
-}
-
-/// A [MetadataAnnotation] which is constructed on demand.
-class PartialMetadataAnnotation extends MetadataAnnotationX
-    implements PartialElement {
-  Token beginToken; // TODO(ahe): Make this final when issue 22065 is fixed.
-
-  final Token tokenAfterEndToken;
-
-  Expression cachedNode;
-
-  bool hasParseError = false;
-
-  PartialMetadataAnnotation(this.beginToken, this.tokenAfterEndToken);
-
-  bool get isErroneous => hasParseError;
-
-  DeclarationSite get declarationSite => this;
-
-  Token get endToken {
-    Token token = beginToken;
-    while (token.kind != EOF_TOKEN) {
-      if (identical(token.next, tokenAfterEndToken)) break;
-      token = token.next;
-    }
-    assert(token != null);
-    return token;
-  }
-
-  void set endToken(_) {
-    throw new UnsupportedError("endToken=");
-  }
-
-  Node parseNode(DiagnosticListener listener) {
-    if (cachedNode != null) return cachedNode;
-    var metadata = parse(listener,
-                         annotatedElement,
-                         declarationSite,
-                         (p) => p.parseMetadata(beginToken));
-    if (metadata is Metadata) {
-      cachedNode = metadata.expression;
-      return cachedNode;
-    } else {
-      assert (metadata is ErrorNode);
-      return metadata;
-    }
-  }
-
-  bool get hasNode => cachedNode != null;
-
-  Node get node {
-    assert(invariant(this, hasNode));
-    return cachedNode;
-  }
-}
-
-Node parse(
-    DiagnosticListener diagnosticListener,
-    ElementX element,
-    PartialElement partial,
-    doParse(Parser parser)) {
-  CompilationUnitElement unit = element.compilationUnit;
-  NodeListener listener = new NodeListener(diagnosticListener, unit);
-  listener.memberErrors = listener.memberErrors.prepend(false);
-  try {
-    if (partial.hasParseError) {
-      listener.suppressParseErrors = true;
-    }
-    doParse(new Parser(listener));
-  } on ParserError catch (e) {
-    partial.hasParseError = true;
-    return new ErrorNode(element.position, e.reason);
-  }
-  Node node = listener.popNode();
-  assert(listener.nodes.isEmpty);
-  return node;
-}
diff --git a/pkg/compiler/lib/src/scanner/parser.dart b/pkg/compiler/lib/src/scanner/parser.dart
deleted file mode 100644
index 66d26bd..0000000
--- a/pkg/compiler/lib/src/scanner/parser.dart
+++ /dev/null
@@ -1,2666 +0,0 @@
-// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-part of scanner;
-
-class FormalParameterType {
-  final String type;
-  const FormalParameterType(this.type);
-  bool get isRequired => this == REQUIRED;
-  bool get isPositional => this == POSITIONAL;
-  bool get isNamed => this == NAMED;
-  static final REQUIRED = const FormalParameterType('required');
-  static final POSITIONAL = const FormalParameterType('positional');
-  static final NAMED = const FormalParameterType('named');
-}
-
-/**
- * An event generating parser of Dart programs. This parser expects
- * all tokens in a linked list (aka a token stream).
- *
- * The class [Scanner] is used to generate a token stream. See the
- * file scanner.dart.
- *
- * Subclasses of the class [Listener] are used to listen to events.
- *
- * Most methods of this class belong in one of two major categories:
- * parse metods and peek methods. Parse methods all have the prefix
- * parse, and peek methods all have the prefix peek.
- *
- * Parse methods generate events (by calling methods on [listener])
- * and return the next token to parse. Peek methods do not generate
- * events (except for errors) and may return null.
- *
- * Parse methods are generally named parseGrammarProductionSuffix. The
- * suffix can be one of "opt", or "star". "opt" means zero or one
- * matches, "star" means zero or more matches. For example,
- * [parseMetadataStar] corresponds to this grammar snippet: [:
- * metadata* :], and [parseTypeOpt] corresponds to: [: type? :].
- */
-class Parser {
-  final Listener listener;
-  bool mayParseFunctionExpressions = true;
-  bool yieldIsKeyword;
-  bool awaitIsKeyword;
-
-  Parser(this.listener,
-         {this.yieldIsKeyword: false, this.awaitIsKeyword: 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);
-    return token;
-  }
-
-  Token parseTopLevelDeclaration(Token token) {
-    token = parseMetadataStar(token);
-    final String value = token.stringValue;
-    if ((identical(value, 'abstract') && optional('class', token.next))
-        || identical(value, 'class')) {
-      return parseClassOrNamedMixinApplication(token);
-    } else if (identical(value, 'enum')) {
-      return parseEnum(token);
-    } else if (identical(value, 'typedef')) {
-      return parseTypedef(token);
-    } else if (identical(value, 'library')) {
-      return parseLibraryName(token);
-    } else if (identical(value, 'import')) {
-      return parseImport(token);
-    } else if (identical(value, 'export')) {
-      return parseExport(token);
-    } else if (identical(value, 'part')) {
-      return parsePartOrPartOf(token);
-    } else {
-      return parseTopLevelMember(token);
-    }
-  }
-
-  /// library qualified ';'
-  Token parseLibraryName(Token token) {
-    Token libraryKeyword = token;
-    listener.beginLibraryName(libraryKeyword);
-    assert(optional('library', token));
-    token = parseQualified(token.next);
-    Token semicolon = token;
-    token = expect(';', token);
-    listener.endLibraryName(libraryKeyword, semicolon);
-    return token;
-  }
-
-  /// import uri (as identifier)? combinator* ';'
-  Token parseImport(Token token) {
-    Token importKeyword = token;
-    listener.beginImport(importKeyword);
-    assert(optional('import', token));
-    token = parseLiteralStringOrRecoverExpression(token.next);
-    Token deferredKeyword;
-    if (optional('deferred', token)) {
-      deferredKeyword = token;
-      token = token.next;
-    }
-    Token asKeyword;
-    if (optional('as', token)) {
-      asKeyword = token;
-      token = parseIdentifier(token.next);
-    }
-    token = parseCombinators(token);
-    Token semicolon = token;
-    token = expect(';', token);
-    listener.endImport(importKeyword, deferredKeyword, asKeyword, semicolon);
-    return token;
-  }
-
-  /// export uri combinator* ';'
-  Token parseExport(Token token) {
-    Token exportKeyword = token;
-    listener.beginExport(exportKeyword);
-    assert(optional('export', token));
-    token = parseLiteralStringOrRecoverExpression(token.next);
-    token = parseCombinators(token);
-    Token semicolon = token;
-    token = expect(';', token);
-    listener.endExport(exportKeyword, semicolon);
-    return token;
-  }
-
-  Token parseCombinators(Token token) {
-    listener.beginCombinators(token);
-    int count = 0;
-    while (true) {
-      String value = token.stringValue;
-      if (identical('hide', value)) {
-        token = parseHide(token);
-      } else if (identical('show', value)) {
-        token = parseShow(token);
-      } else {
-        listener.endCombinators(count);
-        break;
-      }
-      count++;
-    }
-    return token;
-  }
-
-  /// hide identifierList
-  Token parseHide(Token token) {
-    Token hideKeyword = token;
-    listener.beginHide(hideKeyword);
-    assert(optional('hide', token));
-    token = parseIdentifierList(token.next);
-    listener.endHide(hideKeyword);
-    return token;
-  }
-
-  /// show identifierList
-  Token parseShow(Token token) {
-    Token showKeyword = token;
-    listener.beginShow(showKeyword);
-    assert(optional('show', token));
-    token = parseIdentifierList(token.next);
-    listener.endShow(showKeyword);
-    return token;
-  }
-
-  /// identifier (, identifier)*
-  Token parseIdentifierList(Token token) {
-    listener.beginIdentifierList(token);
-    token = parseIdentifier(token);
-    int count = 1;
-    while (optional(',', token)) {
-      token = parseIdentifier(token.next);
-      count++;
-    }
-    listener.endIdentifierList(count);
-    return token;
-  }
-
-  /// type (, type)*
-  Token parseTypeList(Token token) {
-    listener.beginTypeList(token);
-    token = parseType(token);
-    int count = 1;
-    while (optional(',', token)) {
-      token = parseType(token.next);
-      count++;
-    }
-    listener.endTypeList(count);
-    return token;
-  }
-
-  Token parsePartOrPartOf(Token token) {
-    assert(optional('part', token));
-    if (optional('of', token.next)) {
-      return parsePartOf(token);
-    } else {
-      return parsePart(token);
-    }
-  }
-
-  Token parsePart(Token token) {
-    Token partKeyword = token;
-    listener.beginPart(token);
-    assert(optional('part', token));
-    token = parseLiteralStringOrRecoverExpression(token.next);
-    Token semicolon = token;
-    token = expect(';', token);
-    listener.endPart(partKeyword, semicolon);
-    return token;
-  }
-
-  Token parsePartOf(Token token) {
-    listener.beginPartOf(token);
-    assert(optional('part', token));
-    assert(optional('of', token.next));
-    Token partKeyword = token;
-    token = parseQualified(token.next.next);
-    Token semicolon = token;
-    token = expect(';', token);
-    listener.endPartOf(partKeyword, semicolon);
-    return token;
-  }
-
-  Token parseMetadataStar(Token token, {bool forParameter: false}) {
-    listener.beginMetadataStar(token);
-    int count = 0;
-    while (optional('@', token)) {
-      token = parseMetadata(token);
-      count++;
-    }
-    listener.endMetadataStar(count, forParameter);
-    return token;
-  }
-
-  /**
-   * Parse
-   * [: '@' qualified (‘.’ identifier)? (arguments)? :]
-   */
-  Token parseMetadata(Token token) {
-    listener.beginMetadata(token);
-    Token atToken = token;
-    assert(optional('@', token));
-    token = parseIdentifier(token.next);
-    token = parseQualifiedRestOpt(token);
-    token = parseTypeArgumentsOpt(token);
-    Token period = null;
-    if (optional('.', token)) {
-      period = token;
-      token = parseIdentifier(token.next);
-    }
-    token = parseArgumentsOpt(token);
-    listener.endMetadata(atToken, period, token);
-    return token;
-  }
-
-  Token parseTypedef(Token token) {
-    Token typedefKeyword = token;
-    if (optional('=', peekAfterType(token.next))) {
-      // TODO(aprelev@gmail.com): Remove deprecated 'typedef' mixin application,
-      // remove corresponding diagnostic from members.dart.
-      listener.beginNamedMixinApplication(token);
-      token = parseIdentifier(token.next);
-      token = parseTypeVariablesOpt(token);
-      token = expect('=', token);
-      token = parseModifiers(token);
-      token = parseMixinApplication(token);
-      Token implementsKeyword = null;
-      if (optional('implements', token)) {
-        implementsKeyword = token;
-        token = parseTypeList(token.next);
-      }
-      listener.endNamedMixinApplication(
-          typedefKeyword, implementsKeyword, token);
-    } else {
-      listener.beginFunctionTypeAlias(token);
-      token = parseReturnTypeOpt(token.next);
-      token = parseIdentifier(token);
-      token = parseTypeVariablesOpt(token);
-      token = parseFormalParameters(token);
-      listener.endFunctionTypeAlias(typedefKeyword, token);
-    }
-    return expect(';', token);
-  }
-
-  Token parseMixinApplication(Token token) {
-    listener.beginMixinApplication(token);
-    token = parseType(token);
-    token = expect('with', token);
-    token = parseTypeList(token);
-    listener.endMixinApplication();
-    return token;
-  }
-
-  Token parseReturnTypeOpt(Token token) {
-    if (identical(token.stringValue, 'void')) {
-      listener.handleVoidKeyword(token);
-      return token.next;
-    } else {
-      return parseTypeOpt(token);
-    }
-  }
-
-  Token parseFormalParametersOpt(Token token) {
-    if (optional('(', token)) {
-      return parseFormalParameters(token);
-    } else {
-      listener.handleNoFormalParameters(token);
-      return token;
-    }
-  }
-
-  Token parseFormalParameters(Token token) {
-    Token begin = token;
-    listener.beginFormalParameters(begin);
-    expect('(', token);
-    int parameterCount = 0;
-    if (optional(')', token.next)) {
-      listener.endFormalParameters(parameterCount, begin, token.next);
-      return token.next.next;
-    }
-    do {
-      ++parameterCount;
-      token = token.next;
-      String value = token.stringValue;
-      if (identical(value, '[')) {
-        token = parseOptionalFormalParameters(token, false);
-        break;
-      } else if (identical(value, '{')) {
-        token = parseOptionalFormalParameters(token, true);
-        break;
-      }
-      token = parseFormalParameter(token, FormalParameterType.REQUIRED);
-    } while (optional(',', token));
-    listener.endFormalParameters(parameterCount, begin, token);
-    return expect(')', token);
-  }
-
-  Token parseFormalParameter(Token token, FormalParameterType type) {
-    token = parseMetadataStar(token, forParameter: true);
-    listener.beginFormalParameter(token);
-    token = parseModifiers(token);
-    // TODO(ahe): Validate that there are formal parameters if void.
-    token = parseReturnTypeOpt(token);
-    Token thisKeyword = null;
-    if (optional('this', token)) {
-      thisKeyword = token;
-      // TODO(ahe): Validate field initializers are only used in
-      // constructors, and not for function-typed arguments.
-      token = expect('.', token.next);
-    }
-    token = parseIdentifier(token);
-    if (optional('(', token)) {
-      token = parseFormalParameters(token);
-      listener.handleFunctionTypedFormalParameter(token);
-    }
-    String value = token.stringValue;
-    if ((identical('=', value)) || (identical(':', value))) {
-      // TODO(ahe): Validate that these are only used for optional parameters.
-      Token equal = token;
-      token = parseExpression(token.next);
-      listener.handleValuedFormalParameter(equal, token);
-      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);
-      }
-    }
-    listener.endFormalParameter(thisKeyword);
-    return token;
-  }
-
-  Token parseOptionalFormalParameters(Token token, bool isNamed) {
-    Token begin = token;
-    listener.beginOptionalFormalParameters(begin);
-    assert((isNamed && optional('{', token)) || optional('[', token));
-    int parameterCount = 0;
-    do {
-      token = token.next;
-      var type = isNamed ? FormalParameterType.NAMED
-                         : FormalParameterType.POSITIONAL;
-      token = parseFormalParameter(token, type);
-      ++parameterCount;
-    } while (optional(',', token));
-    listener.endOptionalFormalParameters(parameterCount, begin, token);
-    if (isNamed) {
-      return expect('}', token);
-    } else {
-      return expect(']', token);
-    }
-  }
-
-  Token parseTypeOpt(Token token) {
-    Token peek = peekAfterIfType(token);
-    if (peek != null && (peek.isIdentifier() || optional('this', peek))) {
-      return parseType(token);
-    }
-    listener.handleNoType(token);
-    return token;
-  }
-
-  bool isValidTypeReference(Token token) {
-    final kind = token.kind;
-    if (identical(kind, IDENTIFIER_TOKEN)) return true;
-    if (identical(kind, KEYWORD_TOKEN)) {
-      Keyword keyword = (token as KeywordToken).keyword;
-      String value = keyword.syntax;
-      return keyword.isPseudo
-          || (identical(value, 'dynamic'))
-          || (identical(value, 'void'));
-    }
-    return false;
-  }
-
-  Token parseQualified(Token token) {
-    token = parseIdentifier(token);
-    while (optional('.', token)) {
-      token = parseQualifiedRest(token);
-    }
-    return token;
-  }
-
-  Token parseQualifiedRestOpt(Token token) {
-    if (optional('.', token)) {
-      return parseQualifiedRest(token);
-    } else {
-      return token;
-    }
-  }
-
-  Token parseQualifiedRest(Token token) {
-    assert(optional('.', token));
-    Token period = token;
-    token = parseIdentifier(token.next);
-    listener.handleQualified(period);
-    return token;
-  }
-
-  Token skipBlock(Token token) {
-    if (!optional('{', token)) {
-      return listener.expectedBlockToSkip(token);
-    }
-    BeginGroupToken beginGroupToken = token;
-    Token endGroup = beginGroupToken.endGroup;
-    if (endGroup == null) {
-      return listener.unmatched(beginGroupToken);
-    } else if (!identical(endGroup.kind, $CLOSE_CURLY_BRACKET)) {
-      return listener.unmatched(beginGroupToken);
-    }
-    return beginGroupToken.endGroup;
-  }
-
-  Token parseEnum(Token token) {
-    listener.beginEnum(token);
-    Token enumKeyword = token;
-    token = parseIdentifier(token.next);
-    token = expect('{', token);
-    int count = 0;
-    if (!optional('}', token)) {
-      token = parseIdentifier(token);
-      count++;
-      while (optional(',', token)) {
-        token = token.next;
-        if (optional('}', token)) break;
-        token = parseIdentifier(token);
-        count++;
-      }
-    }
-    Token endBrace = token;
-    token = expect('}', token);
-    listener.endEnum(enumKeyword, endBrace, count);
-    return token;
-  }
-
-  Token parseClassOrNamedMixinApplication(Token token) {
-    Token begin = token;
-    Token abstractKeyword;
-    if (optional('abstract', token)) {
-      abstractKeyword = token;
-      token = token.next;
-    }
-    Token classKeyword = token;
-    var isMixinApplication = optional('=', peekAfterType(token.next));
-    if (isMixinApplication) {
-      listener.beginNamedMixinApplication(begin);
-      token = parseIdentifier(token.next);
-      token = parseTypeVariablesOpt(token);
-      token = expect('=', token);
-    } else {
-      listener.beginClassDeclaration(begin);
-    }
-
-    // TODO(aprelev@gmail.com): Once 'typedef' named mixin application is
-    // removed, move modifiers for named mixin application to the bottom of
-    // listener stack. This is so stacks for class declaration and named
-    // mixin application look similar.
-    int modifierCount = 0;
-    if (abstractKeyword != null) {
-      parseModifier(abstractKeyword);
-      modifierCount++;
-    }
-    listener.handleModifiers(modifierCount);
-
-    if (isMixinApplication) {
-      return parseNamedMixinApplication(token, classKeyword);
-    } else {
-      return parseClass(begin, classKeyword);
-    }
-  }
-
-  Token parseNamedMixinApplication(Token token, Token classKeyword) {
-    token = parseMixinApplication(token);
-    Token implementsKeyword = null;
-    if (optional('implements', token)) {
-      implementsKeyword = token;
-      token = parseTypeList(token.next);
-    }
-    listener.endNamedMixinApplication(
-        classKeyword, implementsKeyword, token);
-    return expect(';', token);
-  }
-
-  Token parseClass(Token begin, Token classKeyword) {
-    Token token = parseIdentifier(classKeyword.next);
-    token = parseTypeVariablesOpt(token);
-    Token extendsKeyword;
-    if (optional('extends', token)) {
-      extendsKeyword = token;
-      if (optional('with', peekAfterType(token.next))) {
-        token = parseMixinApplication(token.next);
-      } else {
-        token = parseType(token.next);
-      }
-    } else {
-      extendsKeyword = null;
-      listener.handleNoType(token);
-    }
-    Token implementsKeyword;
-    int interfacesCount = 0;
-    if (optional('implements', token)) {
-      implementsKeyword = token;
-      do {
-        token = parseType(token.next);
-        ++interfacesCount;
-      } while (optional(',', token));
-    }
-    token = parseClassBody(token);
-    listener.endClassDeclaration(interfacesCount, begin, extendsKeyword,
-                                 implementsKeyword, token);
-    return token.next;
-  }
-
-  Token parseStringPart(Token token) {
-    if (identical(token.kind, STRING_TOKEN)) {
-      listener.handleStringPart(token);
-      return token.next;
-    } else {
-      return listener.expected('string', token);
-    }
-  }
-
-  Token parseIdentifier(Token token) {
-    if (!token.isIdentifier()) {
-      token = listener.expectedIdentifier(token);
-    }
-    listener.handleIdentifier(token);
-    return token.next;
-  }
-
-  Token expect(String string, Token token) {
-    if (!identical(string, token.stringValue)) {
-      return listener.expected(string, token);
-    }
-    return token.next;
-  }
-
-  Token parseTypeVariable(Token token) {
-    listener.beginTypeVariable(token);
-    token = parseIdentifier(token);
-    if (optional('extends', token)) {
-      token = parseType(token.next);
-    } else {
-      listener.handleNoType(token);
-    }
-    listener.endTypeVariable(token);
-    return token;
-  }
-
-  /**
-   * Returns true if the stringValue of the [token] is [value].
-   */
-  bool optional(String value, Token token) {
-    return identical(value, token.stringValue);
-  }
-
-  /**
-   * Returns true if the stringValue of the [token] is either [value1],
-   * [value2], [value3], or [value4].
-   */
-  bool isOneOf4(Token token,
-                String value1, String value2, String value3, String value4) {
-    String stringValue = token.stringValue;
-    return identical(value1, stringValue) ||
-           identical(value2, stringValue) ||
-           identical(value3, stringValue) ||
-           identical(value4, stringValue);
-  }
-
-  bool notEofOrValue(String value, Token token) {
-    return !identical(token.kind, EOF_TOKEN) &&
-           !identical(value, token.stringValue);
-  }
-
-  Token parseType(Token token) {
-    Token begin = token;
-    if (isValidTypeReference(token)) {
-      token = parseIdentifier(token);
-      token = parseQualifiedRestOpt(token);
-    } else {
-      token = listener.expectedType(token);
-    }
-    token = parseTypeArgumentsOpt(token);
-    listener.endType(begin, token);
-    return token;
-  }
-
-  Token parseTypeArgumentsOpt(Token token) {
-    return parseStuff(token,
-                      (t) => listener.beginTypeArguments(t),
-                      (t) => parseType(t),
-                      (c, bt, et) => listener.endTypeArguments(c, bt, et),
-                      (t) => listener.handleNoTypeArguments(t));
-  }
-
-  Token parseTypeVariablesOpt(Token token) {
-    return parseStuff(token,
-                      (t) => listener.beginTypeVariables(t),
-                      (t) => parseTypeVariable(t),
-                      (c, bt, et) => listener.endTypeVariables(c, bt, et),
-                      (t) => listener.handleNoTypeVariables(t));
-  }
-
-  // TODO(ahe): Clean this up.
-  Token parseStuff(Token token, Function beginStuff, Function stuffParser,
-                   Function endStuff, Function handleNoStuff) {
-    if (optional('<', token)) {
-      Token begin = token;
-      beginStuff(begin);
-      int count = 0;
-      do {
-        token = stuffParser(token.next);
-        ++count;
-      } while (optional(',', token));
-      Token next = token.next;
-      if (identical(token.stringValue, '>>')) {
-        token = new SymbolToken(GT_INFO, token.charOffset);
-        token.next = new SymbolToken(GT_INFO, token.charOffset + 1);
-        token.next.next = next;
-      } else if (identical(token.stringValue, '>>>')) {
-        token = new SymbolToken(GT_INFO, token.charOffset);
-        token.next = new SymbolToken(GT_GT_INFO, token.charOffset + 1);
-        token.next.next = next;
-      }
-      endStuff(count, begin, token);
-      return expect('>', token);
-    }
-    handleNoStuff(token);
-    return token;
-  }
-
-  Token parseTopLevelMember(Token token) {
-    Token start = token;
-    listener.beginTopLevelMember(token);
-
-    Link<Token> identifiers = findMemberName(token);
-    if (identifiers.isEmpty) {
-      return listener.expectedDeclaration(start);
-    }
-    Token afterName = identifiers.head;
-    identifiers = identifiers.tail;
-
-    if (identifiers.isEmpty) {
-      return listener.expectedDeclaration(start);
-    }
-    Token name = identifiers.head;
-    identifiers = identifiers.tail;
-    Token getOrSet;
-    if (!identifiers.isEmpty) {
-      String value = identifiers.head.stringValue;
-      if ((identical(value, 'get')) || (identical(value, 'set'))) {
-        getOrSet = identifiers.head;
-        identifiers = identifiers.tail;
-      }
-    }
-    Token type;
-    if (!identifiers.isEmpty) {
-      if (isValidTypeReference(identifiers.head)) {
-        type = identifiers.head;
-        identifiers = identifiers.tail;
-      }
-    }
-
-    token = afterName;
-    bool isField;
-    while (true) {
-      // Loop to allow the listener to rewrite the token stream for
-      // error handling.
-      final String value = token.stringValue;
-      if ((identical(value, '(')) || (identical(value, '{'))
-          || (identical(value, '=>'))) {
-        isField = false;
-        break;
-      } else if ((identical(value, '=')) || (identical(value, ','))) {
-        isField = true;
-        break;
-      } else if (identical(value, ';')) {
-        if (getOrSet != null) {
-          // If we found a "get" keyword, this must be an abstract
-          // getter.
-          isField = (!identical(getOrSet.stringValue, 'get'));
-          // TODO(ahe): This feels like a hack.
-        } else {
-          isField = true;
-        }
-        break;
-      } else {
-        token = listener.unexpected(token);
-        if (identical(token.kind, EOF_TOKEN)) return token;
-      }
-    }
-    var modifiers = identifiers.reverse();
-    return isField
-        ? parseFields(start, modifiers, type, getOrSet, name, true)
-        : parseTopLevelMethod(start, modifiers, type, getOrSet, name);
-  }
-
-  bool isVarFinalOrConst(Token token) {
-    String value = token.stringValue;
-    return identical('var', value)
-        || identical('final', value)
-        || identical('const', value);
-  }
-
-  Token expectVarFinalOrConst(Link<Token> modifiers,
-                              bool hasType,
-                              bool allowStatic) {
-    int modifierCount = 0;
-    Token staticModifier;
-    if (allowStatic && !modifiers.isEmpty
-        && optional('static', modifiers.head)) {
-      staticModifier = modifiers.head;
-      modifierCount++;
-      parseModifier(staticModifier);
-      modifiers = modifiers.tail;
-    }
-    if (modifiers.isEmpty) {
-      listener.handleModifiers(modifierCount);
-      return null;
-    }
-    if (modifiers.tail.isEmpty) {
-      Token modifier = modifiers.head;
-      if (isVarFinalOrConst(modifier)) {
-        modifierCount++;
-        parseModifier(modifier);
-        listener.handleModifiers(modifierCount);
-        // TODO(ahe): The caller checks for "var Type name", perhaps we should
-        // check here instead.
-        return modifier;
-      }
-    }
-
-    // Slow case to report errors.
-    List<Token> modifierList = modifiers.toList();
-    Token varFinalOrConst =
-        modifierList.firstWhere(isVarFinalOrConst, orElse: () => null);
-    if (allowStatic && staticModifier == null) {
-      staticModifier =
-          modifierList.firstWhere(
-              (modifier) => optional('static', modifier), orElse: () => null);
-      if (staticModifier != null) {
-        modifierCount++;
-        parseModifier(staticModifier);
-        modifierList.remove(staticModifier);
-      }
-    }
-    bool hasTypeOrModifier = hasType;
-    if (varFinalOrConst != null) {
-      parseModifier(varFinalOrConst);
-      modifierCount++;
-      hasTypeOrModifier = true;
-      modifierList.remove(varFinalOrConst);
-    }
-    listener.handleModifiers(modifierCount);
-    var kind = hasTypeOrModifier
-        ? MessageKind.EXTRANEOUS_MODIFIER
-        : MessageKind.EXTRANEOUS_MODIFIER_REPLACE;
-    for (Token modifier in modifierList) {
-      listener.reportError(modifier, kind, {'modifier': modifier});
-    }
-    return null;
-  }
-
-  Token parseFields(Token start,
-                    Link<Token> modifiers,
-                    Token type,
-                    Token getOrSet,
-                    Token name,
-                    bool isTopLevel) {
-    bool hasType = type != null;
-    Token varFinalOrConst =
-        expectVarFinalOrConst(modifiers, hasType, !isTopLevel);
-    bool isVar = false;
-    bool hasModifier = false;
-    if (varFinalOrConst != null) {
-      hasModifier = true;
-      isVar = optional('var', varFinalOrConst);
-    }
-
-    if (getOrSet != null) {
-      var kind = (hasModifier || hasType)
-          ? MessageKind.EXTRANEOUS_MODIFIER
-          : MessageKind.EXTRANEOUS_MODIFIER_REPLACE;
-      listener.reportError(getOrSet, kind, {'modifier': getOrSet});
-    }
-
-    if (!hasType) {
-      listener.handleNoType(name);
-    } else if (optional('void', type)) {
-      listener.handleNoType(name);
-      // TODO(ahe): This error is reported twice, second time is from
-      // [parseVariablesDeclarationMaybeSemicolon] via
-      // [PartialFieldListElement.parseNode].
-      listener.reportError(type, MessageKind.VOID_NOT_ALLOWED);
-    } else {
-      parseType(type);
-      if (isVar) {
-        listener.reportError(
-            modifiers.head, MessageKind.EXTRANEOUS_MODIFIER,
-            {'modifier': modifiers.head});
-      }
-    }
-
-    Token token = parseIdentifier(name);
-
-    int fieldCount = 1;
-    token = parseVariableInitializerOpt(token);
-    while (optional(',', token)) {
-      token = parseIdentifier(token.next);
-      token = parseVariableInitializerOpt(token);
-      ++fieldCount;
-    }
-    Token semicolon = token;
-    token = expectSemicolon(token);
-    if (isTopLevel) {
-      listener.endTopLevelFields(fieldCount, start, semicolon);
-    } else {
-      listener.endFields(fieldCount, start, semicolon);
-    }
-    return token;
-  }
-
-  Token parseTopLevelMethod(Token start,
-                            Link<Token> modifiers,
-                            Token type,
-                            Token getOrSet,
-                            Token name) {
-
-    Token externalModifier;
-    for (Token modifier in modifiers) {
-      if (externalModifier == null && optional('external', modifier)) {
-        externalModifier = modifier;
-      } else {
-        listener.reportError(
-            modifier, MessageKind.EXTRANEOUS_MODIFIER, {'modifier': modifier});
-      }
-    }
-    if (externalModifier != null) {
-      parseModifier(externalModifier);
-      listener.handleModifiers(1);
-    } else {
-      listener.handleModifiers(0);
-    }
-
-    if (type == null) {
-      listener.handleNoType(name);
-    } else {
-      parseReturnTypeOpt(type);
-    }
-    Token token = parseIdentifier(name);
-
-    token = parseFormalParametersOpt(token);
-    bool previousYieldIsKeyword = yieldIsKeyword;
-    bool previousAwaitIsKeyword = awaitIsKeyword;
-    token = parseAsyncModifier(token);
-    token = parseFunctionBody(token, false, externalModifier != null);
-    yieldIsKeyword = previousYieldIsKeyword;
-    awaitIsKeyword = previousAwaitIsKeyword;
-    Token endToken = token;
-    token = token.next;
-    if (token.kind == BAD_INPUT_TOKEN) {
-      token = listener.unexpected(token);
-    }
-    listener.endTopLevelMethod(start, getOrSet, endToken);
-    return token;
-  }
-
-  /// Looks ahead to find the name of a member. Returns a link of the modifiers,
-  /// set/get, (operator) name, and either the start of the method body or the
-  /// end of the declaration.
-  ///
-  /// Examples:
-  ///
-  ///     int get foo;
-  /// results in
-  ///     [';', 'foo', 'get', 'int']
-  ///
-  ///
-  ///     static const List<int> foo = null;
-  /// results in
-  ///     ['=', 'foo', 'List', 'const', 'static']
-  ///
-  ///
-  ///     get foo async* { return null }
-  /// results in
-  ///     ['{', 'foo', 'get']
-  ///
-  ///
-  ///     operator *(arg) => null;
-  /// results in
-  ///     ['(', '*', 'operator']
-  ///
-  Link<Token> findMemberName(Token token) {
-    Link<Token> identifiers = const Link<Token>();
-
-    // `true` if 'get' has been seen.
-    bool isGetter = false;
-    // `true` if an identifier has been seen after 'get'.
-    bool hasName = false;
-
-    while (token.kind != EOF_TOKEN) {
-      String value = token.stringValue;
-      if (value == 'get') {
-        isGetter = true;
-      } else if (hasName &&
-                 (value == 'sync' || value == 'async')) {
-        // Skip.
-        token = token.next;
-        value = token.stringValue;
-        if (value == '*') {
-          // Skip.
-          token = token.next;
-        }
-        continue;
-      } else if (value == '(' ||
-                 value == '{' ||
-                 value == '=>') {
-        // A method.
-        identifiers = identifiers.prepend(token);
-        return identifiers;
-      } else if (value == '=' ||
-                 value == ';' ||
-                 value == ',') {
-        // A field or abstract getter.
-        identifiers = identifiers.prepend(token);
-        return identifiers;
-      } else if (isGetter) {
-        hasName = true;
-      }
-      identifiers = identifiers.prepend(token);
-      if (isValidTypeReference(token)) {
-        // type ...
-        if (optional('.', token.next)) {
-          // type '.' ...
-          if (token.next.next.isIdentifier()) {
-            // type '.' identifier
-            token = token.next.next;
-          }
-        }
-        if (optional('<', token.next)) {
-          if (token.next is BeginGroupToken) {
-            BeginGroupToken beginGroup = token.next;
-            if (beginGroup.endGroup == null) {
-              listener.unmatched(beginGroup);
-            }
-            token = beginGroup.endGroup;
-          }
-        }
-      }
-      token = token.next;
-    }
-    return const Link<Token>();
-  }
-
-  Token parseVariableInitializerOpt(Token token) {
-    if (optional('=', token)) {
-      Token assignment = token;
-      listener.beginInitializer(token);
-      token = parseExpression(token.next);
-      listener.endInitializer(assignment);
-    }
-    return token;
-  }
-
-  Token parseInitializersOpt(Token token) {
-    if (optional(':', token)) {
-      return parseInitializers(token);
-    } else {
-      listener.handleNoInitializers();
-      return token;
-    }
-  }
-
-  Token parseInitializers(Token token) {
-    Token begin = token;
-    listener.beginInitializers(begin);
-    expect(':', token);
-    int count = 0;
-    bool old = mayParseFunctionExpressions;
-    mayParseFunctionExpressions = false;
-    do {
-      token = parseExpression(token.next);
-      ++count;
-    } while (optional(',', token));
-    mayParseFunctionExpressions = old;
-    listener.endInitializers(count, begin, token);
-    return token;
-  }
-
-  Token parseLiteralStringOrRecoverExpression(Token token) {
-    if (identical(token.kind, STRING_TOKEN)) {
-      return parseLiteralString(token);
-    } else {
-      listener.recoverableError(token, "unexpected");
-      return parseExpression(token);
-    }
-  }
-
-  Token expectSemicolon(Token token) {
-    return expect(';', token);
-  }
-
-  bool isModifier(Token token) {
-    final String value = token.stringValue;
-    return (identical('final', value)) ||
-           (identical('var', value)) ||
-           (identical('const', value)) ||
-           (identical('abstract', value)) ||
-           (identical('static', value)) ||
-           (identical('external', value));
-  }
-
-  Token parseModifier(Token token) {
-    assert(isModifier(token));
-    listener.handleModifier(token);
-    return token.next;
-  }
-
-  void parseModifierList(Link<Token> tokens) {
-    int count = 0;
-    for (; !tokens.isEmpty; tokens = tokens.tail) {
-      Token token = tokens.head;
-      if (isModifier(token)) {
-        parseModifier(token);
-      } else {
-        listener.unexpected(token);
-        // Skip the remaining modifiers.
-        break;
-      }
-      count++;
-    }
-    listener.handleModifiers(count);
-  }
-
-  Token parseModifiers(Token token) {
-    int count = 0;
-    while (identical(token.kind, KEYWORD_TOKEN)) {
-      if (!isModifier(token))
-        break;
-      token = parseModifier(token);
-      count++;
-    }
-    listener.handleModifiers(count);
-    return token;
-  }
-
-  /**
-   * Returns the first token after the type starting at [token].
-   * This method assumes that [token] is an identifier (or void).
-   * Use [peekAfterIfType] if [token] isn't known to be an identifier.
-   */
-  Token peekAfterType(Token token) {
-    // We are looking at "identifier ...".
-    Token peek = token.next;
-    if (identical(peek.kind, PERIOD_TOKEN)) {
-      if (peek.next.isIdentifier()) {
-        // Look past a library prefix.
-        peek = peek.next.next;
-      }
-    }
-    // We are looking at "qualified ...".
-    if (identical(peek.kind, LT_TOKEN)) {
-      // Possibly generic type.
-      // We are looking at "qualified '<'".
-      BeginGroupToken beginGroupToken = peek;
-      Token gtToken = beginGroupToken.endGroup;
-      if (gtToken != null) {
-        // We are looking at "qualified '<' ... '>' ...".
-        return gtToken.next;
-      }
-    }
-    return peek;
-  }
-
-  /**
-   * If [token] is the start of a type, returns the token after that type.
-   * If [token] is not the start of a type, null is returned.
-   */
-  Token peekAfterIfType(Token token) {
-    if (!optional('void', token) && !token.isIdentifier()) {
-      return null;
-    }
-    return peekAfterType(token);
-  }
-
-  Token parseClassBody(Token token) {
-    Token begin = token;
-    listener.beginClassBody(token);
-    if (!optional('{', token)) {
-      token = listener.expectedClassBody(token);
-    }
-    token = token.next;
-    int count = 0;
-    while (notEofOrValue('}', token)) {
-      token = parseMember(token);
-      ++count;
-    }
-    expect('}', token);
-    listener.endClassBody(count, begin, token);
-    return token;
-  }
-
-  bool isGetOrSet(Token token) {
-    final String value = token.stringValue;
-    return (identical(value, 'get')) || (identical(value, 'set'));
-  }
-
-  bool isFactoryDeclaration(Token token) {
-    if (optional('external', token)) token = token.next;
-    if (optional('const', token)) token = token.next;
-    return optional('factory', token);
-  }
-
-  Token parseMember(Token token) {
-    token = parseMetadataStar(token);
-    if (isFactoryDeclaration(token)) {
-      return parseFactoryMethod(token);
-    }
-    Token start = token;
-    listener.beginMember(token);
-
-    Link<Token> identifiers = findMemberName(token);
-    if (identifiers.isEmpty) {
-      return listener.expectedDeclaration(start);
-    }
-    Token afterName = identifiers.head;
-    identifiers = identifiers.tail;
-
-    if (identifiers.isEmpty) {
-      return listener.expectedDeclaration(start);
-    }
-    Token name = identifiers.head;
-    identifiers = identifiers.tail;
-    if (!identifiers.isEmpty) {
-      if (optional('operator', identifiers.head)) {
-        name = identifiers.head;
-        identifiers = identifiers.tail;
-      }
-    }
-    Token getOrSet;
-    if (!identifiers.isEmpty) {
-      if (isGetOrSet(identifiers.head)) {
-        getOrSet = identifiers.head;
-        identifiers = identifiers.tail;
-      }
-    }
-    Token type;
-    if (!identifiers.isEmpty) {
-      if (isValidTypeReference(identifiers.head)) {
-        type = identifiers.head;
-        identifiers = identifiers.tail;
-      }
-    }
-
-    token = afterName;
-    bool isField;
-    while (true) {
-      // Loop to allow the listener to rewrite the token stream for
-      // error handling.
-      final String value = token.stringValue;
-      if ((identical(value, '(')) || (identical(value, '.'))
-          || (identical(value, '{')) || (identical(value, '=>'))) {
-        isField = false;
-        break;
-      } else if (identical(value, ';')) {
-        if (getOrSet != null) {
-          // If we found a "get" keyword, this must be an abstract
-          // getter.
-          isField = (!identical(getOrSet.stringValue, 'get'));
-          // TODO(ahe): This feels like a hack.
-        } else {
-          isField = true;
-        }
-        break;
-      } else if ((identical(value, '=')) || (identical(value, ','))) {
-        isField = true;
-        break;
-      } else {
-        token = listener.unexpected(token);
-        if (identical(token.kind, EOF_TOKEN)) {
-          // TODO(ahe): This is a hack, see parseTopLevelMember.
-          listener.endFields(1, start, token);
-          return token;
-        }
-      }
-    }
-
-    var modifiers = identifiers.reverse();
-    return isField
-        ? parseFields(start, modifiers, type, getOrSet, name, false)
-        : parseMethod(start, modifiers, type, getOrSet, name);
-
-  }
-
-  Token parseMethod(Token start,
-                    Link<Token> modifiers,
-                    Token type,
-                    Token getOrSet,
-                    Token name) {
-    Token externalModifier;
-    Token staticModifier;
-    Token constModifier;
-    int modifierCount = 0;
-    int allowedModifierCount = 1;
-    for (Token modifier in modifiers) {
-      if (externalModifier == null && optional('external', modifier)) {
-        modifierCount++;
-        externalModifier = modifier;
-        if (modifierCount != allowedModifierCount) {
-          listener.reportError(
-              modifier,
-              MessageKind.EXTRANEOUS_MODIFIER, {'modifier': modifier});
-        }
-        allowedModifierCount++;
-      } else if (staticModifier == null && optional('static', modifier)) {
-        modifierCount++;
-        staticModifier = modifier;
-        if (modifierCount != allowedModifierCount) {
-          listener.reportError(
-              modifier,
-              MessageKind.EXTRANEOUS_MODIFIER, {'modifier': modifier});
-        }
-      } else if (constModifier == null && optional('const', modifier)) {
-        modifierCount++;
-        constModifier = modifier;
-        if (modifierCount != allowedModifierCount) {
-          listener.reportError(
-              modifier,
-              MessageKind.EXTRANEOUS_MODIFIER, {'modifier': modifier});
-        }
-      } else {
-        listener.reportError(
-            modifier, MessageKind.EXTRANEOUS_MODIFIER, {'modifier': modifier});
-      }
-    }
-    parseModifierList(modifiers);
-
-    if (type == null) {
-      listener.handleNoType(name);
-    } else {
-      parseReturnTypeOpt(type);
-    }
-    Token token;
-    if (optional('operator', name)) {
-      token = parseOperatorName(name);
-      if (staticModifier != null) {
-        // TODO(ahe): Consider a more specific error message.
-        listener.reportError(
-            staticModifier, MessageKind.EXTRANEOUS_MODIFIER,
-            {'modifier': staticModifier});
-      }
-    } else {
-      token = parseIdentifier(name);
-    }
-
-    token = parseQualifiedRestOpt(token);
-    token = parseFormalParametersOpt(token);
-    token = parseInitializersOpt(token);
-    bool previousYieldIsKeyword = yieldIsKeyword;
-    bool previousAwaitIsKeyword = awaitIsKeyword;
-    token = parseAsyncModifier(token);
-    if (optional('=', token)) {
-      token = parseRedirectingFactoryBody(token);
-    } else {
-      token = parseFunctionBody(
-          token, false, staticModifier == null || externalModifier != null);
-    }
-    yieldIsKeyword = previousYieldIsKeyword;
-    awaitIsKeyword = previousAwaitIsKeyword;
-    listener.endMethod(getOrSet, start, token);
-    return token.next;
-  }
-
-  Token parseFactoryMethod(Token token) {
-    assert(isFactoryDeclaration(token));
-    Token start = token;
-    Token externalModifier;
-    if (identical(token.stringValue, 'external')) {
-      externalModifier = token;
-      token = token.next;
-    }
-    if (optional('const', token)) {
-      token = token.next; // Skip const.
-    }
-    Token factoryKeyword = token;
-    listener.beginFactoryMethod(factoryKeyword);
-    token = token.next; // Skip 'factory'.
-    token = parseConstructorReference(token);
-    token = parseFormalParameters(token);
-    token = parseAsyncModifier(token);
-    if (optional('=', token)) {
-      token = parseRedirectingFactoryBody(token);
-    } else {
-      token = parseFunctionBody(token, false, externalModifier != null);
-    }
-    listener.endFactoryMethod(start, token);
-    return token.next;
-  }
-
-  Token parseOperatorName(Token token) {
-    assert(optional('operator', token));
-    if (isUserDefinableOperator(token.next.stringValue)) {
-      Token operator = token;
-      token = token.next;
-      listener.handleOperatorName(operator, token);
-      return token.next;
-    } else {
-      return parseIdentifier(token);
-    }
-  }
-
-  Token parseFunction(Token token, Token getOrSet) {
-    listener.beginFunction(token);
-    token = parseModifiers(token);
-    if (identical(getOrSet, token)) {
-      // get <name>  => ...
-      token = token.next;
-      listener.handleNoType(token);
-      listener.beginFunctionName(token);
-      if (optional('operator', token)) {
-        token = parseOperatorName(token);
-      } else {
-        token = parseIdentifier(token);
-      }
-    } else if (optional('operator', token)) {
-      // operator <op> (...
-      listener.handleNoType(token);
-      listener.beginFunctionName(token);
-      token = parseOperatorName(token);
-    } else {
-      // <type>? <get>? <name>
-      token = parseReturnTypeOpt(token);
-      if (identical(getOrSet, token)) {
-        token = token.next;
-      }
-      listener.beginFunctionName(token);
-      if (optional('operator', token)) {
-        token = parseOperatorName(token);
-      } else {
-        token = parseIdentifier(token);
-      }
-    }
-    token = parseQualifiedRestOpt(token);
-    listener.endFunctionName(token);
-    token = parseFormalParametersOpt(token);
-    token = parseInitializersOpt(token);
-    bool previousYieldIsKeyword = yieldIsKeyword;
-    bool previousAwaitIsKeyword = awaitIsKeyword;
-    token = parseAsyncModifier(token);
-    if (optional('=', token)) {
-      token = parseRedirectingFactoryBody(token);
-    } else {
-      token = parseFunctionBody(token, false, true);
-    }
-    yieldIsKeyword = previousYieldIsKeyword;
-    awaitIsKeyword = previousAwaitIsKeyword;
-    listener.endFunction(getOrSet, token);
-    return token.next;
-  }
-
-  Token parseUnnamedFunction(Token token) {
-    listener.beginUnnamedFunction(token);
-    token = parseFormalParameters(token);
-    bool previousYieldIsKeyword = yieldIsKeyword;
-    bool previousAwaitIsKeyword = awaitIsKeyword;
-    token = parseAsyncModifier(token);
-    bool isBlock = optional('{', token);
-    token = parseFunctionBody(token, true, false);
-    yieldIsKeyword = previousYieldIsKeyword;
-    awaitIsKeyword = previousAwaitIsKeyword;
-    listener.endUnnamedFunction(token);
-    return isBlock ? token.next : token;
-  }
-
-  Token parseFunctionDeclaration(Token token) {
-    listener.beginFunctionDeclaration(token);
-    token = parseFunction(token, null);
-    listener.endFunctionDeclaration(token);
-    return token;
-  }
-
-  Token parseFunctionExpression(Token token) {
-    listener.beginFunction(token);
-    listener.handleModifiers(0);
-    token = parseReturnTypeOpt(token);
-    listener.beginFunctionName(token);
-    token = parseIdentifier(token);
-    listener.endFunctionName(token);
-    token = parseFormalParameters(token);
-    listener.handleNoInitializers();
-    bool previousYieldIsKeyword = yieldIsKeyword;
-    bool previousAwaitIsKeyword = awaitIsKeyword;
-    token = parseAsyncModifier(token);
-    bool isBlock = optional('{', token);
-    token = parseFunctionBody(token, true, false);
-    yieldIsKeyword = previousYieldIsKeyword;
-    awaitIsKeyword = previousAwaitIsKeyword;
-    listener.endFunction(null, token);
-    return isBlock ? token.next : token;
-  }
-
-  Token parseConstructorReference(Token token) {
-    Token start = token;
-    listener.beginConstructorReference(start);
-    token = parseIdentifier(token);
-    token = parseQualifiedRestOpt(token);
-    token = parseTypeArgumentsOpt(token);
-    Token period = null;
-    if (optional('.', token)) {
-      period = token;
-      token = parseIdentifier(token.next);
-    }
-    listener.endConstructorReference(start, period, token);
-    return token;
-  }
-
-  Token parseRedirectingFactoryBody(Token token) {
-    listener.beginRedirectingFactoryBody(token);
-    assert(optional('=', token));
-    Token equals = token;
-    token = parseConstructorReference(token.next);
-    Token semicolon = token;
-    expectSemicolon(token);
-    listener.endRedirectingFactoryBody(equals, semicolon);
-    return token;
-  }
-
-  Token parseFunctionBody(Token token, bool isExpression, bool allowAbstract) {
-    if (optional(';', token)) {
-      if (!allowAbstract) {
-        listener.reportError(token, MessageKind.BODY_EXPECTED);
-      }
-      listener.endFunctionBody(0, null, token);
-      return token;
-    } else if (optional('=>', token)) {
-      Token begin = token;
-      token = parseExpression(token.next);
-      if (!isExpression) {
-        expectSemicolon(token);
-        listener.endReturnStatement(true, begin, token);
-      } else {
-        listener.endReturnStatement(true, begin, null);
-      }
-      return token;
-    }
-    Token begin = token;
-    int statementCount = 0;
-    if (!optional('{', token)) {
-      return listener.expectedFunctionBody(token);
-    }
-
-    listener.beginFunctionBody(begin);
-    token = token.next;
-    while (notEofOrValue('}', token)) {
-      token = parseStatement(token);
-      ++statementCount;
-    }
-    listener.endFunctionBody(statementCount, begin, token);
-    expect('}', token);
-    return token;
-  }
-
-  Token parseAsyncModifier(Token token) {
-    Token async;
-    Token star;
-    awaitIsKeyword = false;
-    yieldIsKeyword = false;
-    if (optional('async', token)) {
-      awaitIsKeyword = true;
-      async = token;
-      token = token.next;
-      if (optional('*', token)) {
-        yieldIsKeyword = true;
-        star = token;
-        token = token.next;
-      }
-    } else if (optional('sync', token)) {
-      async = token;
-      token = token.next;
-      if (optional('*', token)) {
-        yieldIsKeyword = true;
-        star = token;
-        token = token.next;
-      } else {
-        listener.reportError(async,
-            MessageKind.INVALID_SYNC_MODIFIER);
-      }
-    }
-    listener.handleAsyncModifier(async, star);
-    return token;
-  }
-
-  Token parseStatement(Token token) {
-    final value = token.stringValue;
-    if (identical(token.kind, IDENTIFIER_TOKEN)) {
-      return parseExpressionStatementOrDeclaration(token);
-    } else if (identical(value, '{')) {
-      return parseBlock(token);
-    } else if (identical(value, 'return')) {
-      return parseReturnStatement(token);
-    } else if (identical(value, 'var') || identical(value, 'final')) {
-      return parseVariablesDeclaration(token);
-    } else if (identical(value, 'if')) {
-      return parseIfStatement(token);
-    } else if (awaitIsKeyword && identical(value, 'await')) {
-      if (identical(token.next.stringValue, 'for')) {
-        return parseForStatement(token, token.next);
-      } else {
-        return parseExpressionStatement(token);
-      }
-    } else if (identical(value, 'for')) {
-      return parseForStatement(null, token);
-    } else if (identical(value, 'rethrow')) {
-      return parseRethrowStatement(token);
-    } else if (identical(value, 'throw') && optional(';', token.next)) {
-      // TODO(kasperl): Stop dealing with throw here.
-      return parseRethrowStatement(token);
-    } else if (identical(value, 'void')) {
-      return parseExpressionStatementOrDeclaration(token);
-    } else if (identical(value, 'while')) {
-      return parseWhileStatement(token);
-    } else if (identical(value, 'do')) {
-      return parseDoWhileStatement(token);
-    } else if (identical(value, 'try')) {
-      return parseTryStatement(token);
-    } else if (identical(value, 'switch')) {
-      return parseSwitchStatement(token);
-    } else if (identical(value, 'break')) {
-      return parseBreakStatement(token);
-    } else if (identical(value, 'continue')) {
-      return parseContinueStatement(token);
-    } else if (identical(value, 'assert')) {
-      return parseAssertStatement(token);
-    } else if (identical(value, ';')) {
-      return parseEmptyStatement(token);
-    } else if (yieldIsKeyword && identical(value, 'yield')) {
-      return parseYieldStatement(token);
-    } else if (identical(value, 'const')) {
-      return parseExpressionStatementOrConstDeclaration(token);
-    } else if (token.isIdentifier()) {
-      return parseExpressionStatementOrDeclaration(token);
-    } else {
-      return parseExpressionStatement(token);
-    }
-  }
-
-  Token parseYieldStatement(Token token) {
-    Token begin = token;
-    listener.beginYieldStatement(begin);
-    assert(identical('yield', token.stringValue));
-    token = token.next;
-    Token starToken;
-    if (optional('*', token)) {
-      starToken = token;
-      token = token.next;
-    }
-    token = parseExpression(token);
-    listener.endYieldStatement(begin, starToken, token);
-    return expectSemicolon(token);
-  }
-
-
-  Token parseReturnStatement(Token token) {
-    Token begin = token;
-    listener.beginReturnStatement(begin);
-    assert(identical('return', token.stringValue));
-    token = token.next;
-    if (optional(';', token)) {
-      listener.endReturnStatement(false, begin, token);
-    } else {
-      token = parseExpression(token);
-      listener.endReturnStatement(true, begin, token);
-    }
-    return expectSemicolon(token);
-  }
-
-  Token peekIdentifierAfterType(Token token) {
-    Token peek = peekAfterType(token);
-    if (peek != null && peek.isIdentifier()) {
-      // We are looking at "type identifier".
-      return peek;
-    } else {
-      return null;
-    }
-  }
-
-  Token peekIdentifierAfterOptionalType(Token token) {
-    Token peek = peekAfterIfType(token);
-    if (peek != null && peek.isIdentifier()) {
-      // We are looking at "type identifier".
-      return peek;
-    } else if (token.isIdentifier()) {
-      // We are looking at "identifier".
-      return token;
-    } else {
-      return null;
-    }
-  }
-
-  Token parseExpressionStatementOrDeclaration(Token token) {
-    assert(token.isIdentifier() || identical(token.stringValue, 'void'));
-    Token identifier = peekIdentifierAfterType(token);
-    if (identifier != null) {
-      assert(identifier.isIdentifier());
-      Token afterId = identifier.next;
-      int afterIdKind = afterId.kind;
-      if (identical(afterIdKind, EQ_TOKEN) ||
-          identical(afterIdKind, SEMICOLON_TOKEN) ||
-          identical(afterIdKind, COMMA_TOKEN)) {
-        // We are looking at "type identifier" followed by '=', ';', ','.
-        return parseVariablesDeclaration(token);
-      } else if (identical(afterIdKind, OPEN_PAREN_TOKEN)) {
-        // We are looking at "type identifier '('".
-        BeginGroupToken beginParen = afterId;
-        Token endParen = beginParen.endGroup;
-        Token afterParens = endParen.next;
-        if (optional('{', afterParens) ||
-            optional('=>', afterParens) ||
-            optional('async', afterParens) ||
-            optional('sync', afterParens)) {
-          // We are looking at "type identifier '(' ... ')'" followed
-          // by '=>' or '{'.
-          return parseFunctionDeclaration(token);
-        }
-      }
-      // Fall-through to expression statement.
-    } else {
-      if (optional(':', token.next)) {
-        return parseLabeledStatement(token);
-      } else if (optional('(', token.next)) {
-        BeginGroupToken begin = token.next;
-        String afterParens = begin.endGroup.next.stringValue;
-        if (identical(afterParens, '{') ||
-            identical(afterParens, '=>') ||
-            identical(afterParens, 'async') ||
-            identical(afterParens, 'sync')) {
-          return parseFunctionDeclaration(token);
-        }
-      }
-    }
-    return parseExpressionStatement(token);
-  }
-
-  Token parseExpressionStatementOrConstDeclaration(Token token) {
-    assert(identical(token.stringValue, 'const'));
-    if (isModifier(token.next)) {
-      return parseVariablesDeclaration(token);
-    }
-    Token identifier = peekIdentifierAfterOptionalType(token.next);
-    if (identifier != null) {
-      assert(identifier.isIdentifier());
-      Token afterId = identifier.next;
-      int afterIdKind = afterId.kind;
-      if (identical(afterIdKind, EQ_TOKEN) ||
-          identical(afterIdKind, SEMICOLON_TOKEN) ||
-          identical(afterIdKind, COMMA_TOKEN)) {
-        // We are looking at "const type identifier" followed by '=', ';', or
-        // ','.
-        return parseVariablesDeclaration(token);
-      }
-      // Fall-through to expression statement.
-    }
-
-    return parseExpressionStatement(token);
-  }
-
-  Token parseLabel(Token token) {
-    token = parseIdentifier(token);
-    Token colon = token;
-    token = expect(':', token);
-    listener.handleLabel(colon);
-    return token;
-  }
-
-  Token parseLabeledStatement(Token token) {
-    int labelCount = 0;
-    do {
-      token = parseLabel(token);
-      labelCount++;
-    } while (token.isIdentifier() && optional(':', token.next));
-    listener.beginLabeledStatement(token, labelCount);
-    token = parseStatement(token);
-    listener.endLabeledStatement(labelCount);
-    return token;
-  }
-
-  Token parseExpressionStatement(Token token) {
-    listener.beginExpressionStatement(token);
-    token = parseExpression(token);
-    listener.endExpressionStatement(token);
-    return expectSemicolon(token);
-  }
-
-  Token parseExpression(Token token) {
-    return optional('throw', token)
-        ? parseThrowExpression(token, true)
-        : parsePrecedenceExpression(token, ASSIGNMENT_PRECEDENCE, true);
-  }
-
-  Token parseExpressionWithoutCascade(Token token) {
-    return optional('throw', token)
-        ? parseThrowExpression(token, false)
-        : parsePrecedenceExpression(token, ASSIGNMENT_PRECEDENCE, false);
-  }
-
-  Token parseConditionalExpressionRest(Token token) {
-    assert(optional('?', token));
-    Token question = token;
-    token = parseExpressionWithoutCascade(token.next);
-    Token colon = token;
-    token = expect(':', token);
-    token = parseExpressionWithoutCascade(token);
-    listener.handleConditionalExpression(question, colon);
-    return token;
-  }
-
-  Token parsePrecedenceExpression(Token token, int precedence,
-                                  bool allowCascades) {
-    assert(precedence >= 1);
-    assert(precedence <= POSTFIX_PRECEDENCE);
-    token = parseUnaryExpression(token, allowCascades);
-    PrecedenceInfo info = token.info;
-    int tokenLevel = info.precedence;
-    for (int level = tokenLevel; level >= precedence; --level) {
-      while (identical(tokenLevel, level)) {
-        Token operator = token;
-        if (identical(tokenLevel, CASCADE_PRECEDENCE)) {
-          if (!allowCascades) {
-            return token;
-          }
-          token = parseCascadeExpression(token);
-        } else if (identical(tokenLevel, ASSIGNMENT_PRECEDENCE)) {
-          // Right associative, so we recurse at the same precedence
-          // level.
-          token = parsePrecedenceExpression(token.next, level, allowCascades);
-          listener.handleAssignmentExpression(operator);
-        } else if (identical(tokenLevel, POSTFIX_PRECEDENCE)) {
-          if (identical(info, PERIOD_INFO) ||
-              identical(info, QUESTION_PERIOD_INFO)) {
-            // Left associative, so we recurse at the next higher
-            // precedence level. However, POSTFIX_PRECEDENCE is the
-            // highest level, so we just call parseUnaryExpression
-            // directly.
-            token = parseUnaryExpression(token.next, allowCascades);
-            listener.handleBinaryExpression(operator);
-          } else if ((identical(info, OPEN_PAREN_INFO)) ||
-                     (identical(info, OPEN_SQUARE_BRACKET_INFO))) {
-            token = parseArgumentOrIndexStar(token);
-          } else if ((identical(info, PLUS_PLUS_INFO)) ||
-                     (identical(info, MINUS_MINUS_INFO))) {
-            listener.handleUnaryPostfixAssignmentExpression(token);
-            token = token.next;
-          } else {
-            token = listener.unexpected(token);
-          }
-        } else if (identical(info, IS_INFO)) {
-          token = parseIsOperatorRest(token);
-        } else if (identical(info, AS_INFO)) {
-          token = parseAsOperatorRest(token);
-        } else if (identical(info, QUESTION_INFO)) {
-          token = parseConditionalExpressionRest(token);
-        } else {
-          // Left associative, so we recurse at the next higher
-          // precedence level.
-          token = parsePrecedenceExpression(token.next, level + 1,
-                                            allowCascades);
-          listener.handleBinaryExpression(operator);
-        }
-        info = token.info;
-        tokenLevel = info.precedence;
-        if (level == EQUALITY_PRECEDENCE || level == RELATIONAL_PRECEDENCE) {
-          // We don't allow (a == b == c) or (a < b < c).
-          // Continue the outer loop if we have matched one equality or
-          // relational operator.
-          break;
-        }
-      }
-    }
-    return token;
-  }
-
-  Token parseCascadeExpression(Token token) {
-    listener.beginCascade(token);
-    assert(optional('..', token));
-    Token cascadeOperator = token;
-    token = token.next;
-    if (optional('[', token)) {
-      token = parseArgumentOrIndexStar(token);
-    } else if (token.isIdentifier()) {
-      token = parseSend(token);
-      listener.handleBinaryExpression(cascadeOperator);
-    } else {
-      return listener.unexpected(token);
-    }
-    Token mark;
-    do {
-      mark = token;
-      if (optional('.', token)) {
-        Token period = token;
-        token = parseSend(token.next);
-        listener.handleBinaryExpression(period);
-      }
-      token = parseArgumentOrIndexStar(token);
-    } while (!identical(mark, token));
-
-    if (identical(token.info.precedence, ASSIGNMENT_PRECEDENCE)) {
-      Token assignment = token;
-      token = parseExpressionWithoutCascade(token.next);
-      listener.handleAssignmentExpression(assignment);
-    }
-    listener.endCascade();
-    return token;
-  }
-
-  Token parseUnaryExpression(Token token, bool allowCascades) {
-    String value = token.stringValue;
-    // Prefix:
-    if (awaitIsKeyword && optional('await', token)) {
-      return parseAwaitExpression(token, allowCascades);
-    } else if (identical(value, '+')) {
-      // Dart no longer allows prefix-plus.
-      listener.reportError(token, MessageKind.UNSUPPORTED_PREFIX_PLUS);
-      return parseUnaryExpression(token.next, allowCascades);
-    } else if ((identical(value, '!')) ||
-               (identical(value, '-')) ||
-               (identical(value, '~'))) {
-      Token operator = token;
-      // Right associative, so we recurse at the same precedence
-      // level.
-      token = parsePrecedenceExpression(token.next, POSTFIX_PRECEDENCE,
-                                        allowCascades);
-      listener.handleUnaryPrefixExpression(operator);
-    } else if ((identical(value, '++')) || identical(value, '--')) {
-      // TODO(ahe): Validate this is used correctly.
-      Token operator = token;
-      // Right associative, so we recurse at the same precedence
-      // level.
-      token = parsePrecedenceExpression(token.next, POSTFIX_PRECEDENCE,
-                                        allowCascades);
-      listener.handleUnaryPrefixAssignmentExpression(operator);
-    } else {
-      token = parsePrimary(token);
-    }
-    return token;
-  }
-
-  Token parseArgumentOrIndexStar(Token token) {
-    while (true) {
-      if (optional('[', token)) {
-        Token openSquareBracket = token;
-        bool old = mayParseFunctionExpressions;
-        mayParseFunctionExpressions = true;
-        token = parseExpression(token.next);
-        mayParseFunctionExpressions = old;
-        listener.handleIndexedExpression(openSquareBracket, token);
-        token = expect(']', token);
-      } else if (optional('(', token)) {
-        token = parseArguments(token);
-        listener.endSend(token);
-      } else {
-        break;
-      }
-    }
-    return token;
-  }
-
-  Token parsePrimary(Token token) {
-    final kind = token.kind;
-    if (identical(kind, IDENTIFIER_TOKEN)) {
-      return parseSendOrFunctionLiteral(token);
-    } else if (identical(kind, INT_TOKEN)
-        || identical(kind, HEXADECIMAL_TOKEN)) {
-      return parseLiteralInt(token);
-    } else if (identical(kind, DOUBLE_TOKEN)) {
-      return parseLiteralDouble(token);
-    } else if (identical(kind, STRING_TOKEN)) {
-      return parseLiteralString(token);
-    } else if (identical(kind, HASH_TOKEN)) {
-      return parseLiteralSymbol(token);
-    } else if (identical(kind, KEYWORD_TOKEN)) {
-      final value = token.stringValue;
-      if ((identical(value, 'true')) || (identical(value, 'false'))) {
-        return parseLiteralBool(token);
-      } else if (identical(value, 'null')) {
-        return parseLiteralNull(token);
-      } else if (identical(value, 'this')) {
-        return parseThisExpression(token);
-      } else if (identical(value, 'super')) {
-        return parseSuperExpression(token);
-      } else if (identical(value, 'new')) {
-        return parseNewExpression(token);
-      } else if (identical(value, 'const')) {
-        return parseConstExpression(token);
-      } else if (identical(value, 'void')) {
-        return parseFunctionExpression(token);
-      } else if (token.isIdentifier()) {
-        return parseSendOrFunctionLiteral(token);
-      } else {
-        return listener.expectedExpression(token);
-      }
-    } else if (identical(kind, OPEN_PAREN_TOKEN)) {
-      return parseParenthesizedExpressionOrFunctionLiteral(token);
-    } else if ((identical(kind, LT_TOKEN)) ||
-               (identical(kind, OPEN_SQUARE_BRACKET_TOKEN)) ||
-               (identical(kind, OPEN_CURLY_BRACKET_TOKEN)) ||
-               identical(token.stringValue, '[]')) {
-      return parseLiteralListOrMap(token);
-    } else {
-      return listener.expectedExpression(token);
-    }
-  }
-
-  Token parseParenthesizedExpressionOrFunctionLiteral(Token token) {
-    BeginGroupToken beginGroup = token;
-    Token nextToken = beginGroup.endGroup.next;
-    int kind = nextToken.kind;
-    if (mayParseFunctionExpressions &&
-        (identical(kind, FUNCTION_TOKEN) ||
-         identical(kind, OPEN_CURLY_BRACKET_TOKEN) ||
-         (identical(kind, KEYWORD_TOKEN) &&
-             (nextToken.value == 'async' || nextToken.value == 'sync')))) {
-      return parseUnnamedFunction(token);
-    } else {
-      bool old = mayParseFunctionExpressions;
-      mayParseFunctionExpressions = true;
-      token = parseParenthesizedExpression(token);
-      mayParseFunctionExpressions = old;
-      return token;
-    }
-  }
-
-  Token parseParenthesizedExpression(Token token) {
-    // We expect [begin] to be of type [BeginGroupToken], but we don't know for
-    // sure until after calling expect.
-    var begin = token;
-    token = expect('(', token);
-    // [begin] is now known to have type [BeginGroupToken].
-    token = parseExpression(token);
-    if (!identical(begin.endGroup, token)) {
-      listener.unexpected(token);
-      token = begin.endGroup;
-    }
-    listener.handleParenthesizedExpression(begin);
-    return expect(')', token);
-  }
-
-  Token parseThisExpression(Token token) {
-    listener.handleThisExpression(token);
-    token = token.next;
-    if (optional('(', token)) {
-      // Constructor forwarding.
-      token = parseArguments(token);
-      listener.endSend(token);
-    }
-    return token;
-  }
-
-  Token parseSuperExpression(Token token) {
-    listener.handleSuperExpression(token);
-    token = token.next;
-    if (optional('(', token)) {
-      // Super constructor.
-      token = parseArguments(token);
-      listener.endSend(token);
-    }
-    return token;
-  }
-
-  Token parseLiteralListOrMap(Token token) {
-    Token constKeyword = null;
-    if (optional('const', token)) {
-      constKeyword = token;
-      token = token.next;
-    }
-    token = parseTypeArgumentsOpt(token);
-    Token beginToken = token;
-    int count = 0;
-    if (optional('{', token)) {
-      bool old = mayParseFunctionExpressions;
-      mayParseFunctionExpressions = true;
-      do {
-        if (optional('}', token.next)) {
-          token = token.next;
-          break;
-        }
-        token = parseMapLiteralEntry(token.next);
-        ++count;
-      } while (optional(',', token));
-      mayParseFunctionExpressions = old;
-      listener.handleLiteralMap(count, beginToken, constKeyword, token);
-      return expect('}', token);
-    } else if (optional('[', token)) {
-      bool old = mayParseFunctionExpressions;
-      mayParseFunctionExpressions = true;
-      do {
-        if (optional(']', token.next)) {
-          token = token.next;
-          break;
-        }
-        token = parseExpression(token.next);
-        ++count;
-      } while (optional(',', token));
-      mayParseFunctionExpressions = old;
-      listener.handleLiteralList(count, beginToken, constKeyword, token);
-      return expect(']', token);
-    } else if (optional('[]', token)) {
-      listener.handleLiteralList(0, token, constKeyword, token);
-      return token.next;
-    } else {
-      listener.unexpected(token);
-      return null;
-    }
-  }
-
-  Token parseMapLiteralEntry(Token token) {
-    listener.beginLiteralMapEntry(token);
-    // Assume the listener rejects non-string keys.
-    token = parseExpression(token);
-    Token colon = token;
-    token = expect(':', token);
-    token = parseExpression(token);
-    listener.endLiteralMapEntry(colon, token);
-    return token;
-  }
-
-  Token parseSendOrFunctionLiteral(Token token) {
-    if (!mayParseFunctionExpressions) return parseSend(token);
-    Token peek = peekAfterIfType(token);
-    if (peek != null &&
-        identical(peek.kind, IDENTIFIER_TOKEN) &&
-        isFunctionDeclaration(peek.next)) {
-      return parseFunctionExpression(token);
-    } else if (isFunctionDeclaration(token.next)) {
-      return parseFunctionExpression(token);
-    } else {
-      return parseSend(token);
-    }
-  }
-
-  bool isFunctionDeclaration(Token token) {
-    if (optional('(', token)) {
-      BeginGroupToken begin = token;
-      String afterParens = begin.endGroup.next.stringValue;
-      if (identical(afterParens, '{') ||
-          identical(afterParens, '=>') ||
-          identical(afterParens, 'async') ||
-          identical(afterParens, 'sync')) {
-        return true;
-      }
-    }
-    return false;
-  }
-
-  Token parseRequiredArguments(Token token) {
-    if (optional('(', token)) {
-      token = parseArguments(token);
-    } else {
-      listener.handleNoArguments(token);
-      token = listener.unexpected(token);
-    }
-    return token;
-  }
-
-  Token parseNewExpression(Token token) {
-    Token newKeyword = token;
-    token = expect('new', token);
-    token = parseConstructorReference(token);
-    token = parseRequiredArguments(token);
-    listener.handleNewExpression(newKeyword);
-    return token;
-  }
-
-  Token parseConstExpression(Token token) {
-    Token constKeyword = token;
-    token = expect('const', token);
-    final String value = token.stringValue;
-    if ((identical(value, '<')) ||
-        (identical(value, '[')) ||
-        (identical(value, '[]')) ||
-        (identical(value, '{'))) {
-      return parseLiteralListOrMap(constKeyword);
-    }
-    token = parseConstructorReference(token);
-    token = parseRequiredArguments(token);
-    listener.handleConstExpression(constKeyword);
-    return token;
-  }
-
-  Token parseLiteralInt(Token token) {
-    listener.handleLiteralInt(token);
-    return token.next;
-  }
-
-  Token parseLiteralDouble(Token token) {
-    listener.handleLiteralDouble(token);
-    return token.next;
-  }
-
-  Token parseLiteralString(Token token) {
-    bool old = mayParseFunctionExpressions;
-    mayParseFunctionExpressions = true;
-    token = parseSingleLiteralString(token);
-    int count = 1;
-    while (identical(token.kind, STRING_TOKEN)) {
-      token = parseSingleLiteralString(token);
-      count++;
-    }
-    if (count > 1) {
-      listener.handleStringJuxtaposition(count);
-    }
-    mayParseFunctionExpressions = old;
-    return token;
-  }
-
-  Token parseLiteralSymbol(Token token) {
-    Token hashToken = token;
-    listener.beginLiteralSymbol(hashToken);
-    token = token.next;
-    if (isUserDefinableOperator(token.stringValue)) {
-      listener.handleOperator(token);
-      listener.endLiteralSymbol(hashToken, 1);
-      return token.next;
-    } else {
-      int count = 1;
-      token = parseIdentifier(token);
-      while (identical(token.stringValue, '.')) {
-        count++;
-        token = parseIdentifier(token.next);
-      }
-      listener.endLiteralSymbol(hashToken, count);
-      return token;
-    }
-  }
-
-  /**
-   * Only called when [:token.kind === STRING_TOKEN:].
-   */
-  Token parseSingleLiteralString(Token token) {
-    listener.beginLiteralString(token);
-    // Parsing the prefix, for instance 'x of 'x${id}y${id}z'
-    token = token.next;
-    int interpolationCount = 0;
-    var kind = token.kind;
-    while (kind != EOF_TOKEN) {
-      if (identical(kind, STRING_INTERPOLATION_TOKEN)) {
-        // Parsing ${expression}.
-        token = token.next;
-        token = parseExpression(token);
-        token = expect('}', token);
-      } else if (identical(kind, STRING_INTERPOLATION_IDENTIFIER_TOKEN)) {
-        // Parsing $identifier.
-        token = token.next;
-        token = parseExpression(token);
-      } else {
-        break;
-      }
-      ++interpolationCount;
-      // Parsing the infix/suffix, for instance y and z' of 'x${id}y${id}z'
-      token = parseStringPart(token);
-      kind = token.kind;
-    }
-    listener.endLiteralString(interpolationCount);
-    return token;
-  }
-
-  Token parseLiteralBool(Token token) {
-    listener.handleLiteralBool(token);
-    return token.next;
-  }
-
-  Token parseLiteralNull(Token token) {
-    listener.handleLiteralNull(token);
-    return token.next;
-  }
-
-  Token parseSend(Token token) {
-    listener.beginSend(token);
-    token = parseIdentifier(token);
-    token = parseArgumentsOpt(token);
-    listener.endSend(token);
-    return token;
-  }
-
-  Token parseArgumentsOpt(Token token) {
-    if (!optional('(', token)) {
-      listener.handleNoArguments(token);
-      return token;
-    } else {
-      return parseArguments(token);
-    }
-  }
-
-  Token parseArguments(Token token) {
-    Token begin = token;
-    listener.beginArguments(begin);
-    assert(identical('(', token.stringValue));
-    int argumentCount = 0;
-    if (optional(')', token.next)) {
-      listener.endArguments(argumentCount, begin, token.next);
-      return token.next.next;
-    }
-    bool old = mayParseFunctionExpressions;
-    mayParseFunctionExpressions = true;
-    do {
-      Token colon = null;
-      if (optional(':', token.next.next)) {
-        token = parseIdentifier(token.next);
-        colon = token;
-      }
-      token = parseExpression(token.next);
-      if (colon != null) listener.handleNamedArgument(colon);
-      ++argumentCount;
-    } while (optional(',', token));
-    mayParseFunctionExpressions = old;
-    listener.endArguments(argumentCount, begin, token);
-    return expect(')', token);
-  }
-
-  Token parseIsOperatorRest(Token token) {
-    assert(optional('is', token));
-    Token operator = token;
-    Token not = null;
-    if (optional('!', token.next)) {
-      token = token.next;
-      not = token;
-    }
-    token = parseType(token.next);
-    listener.handleIsOperator(operator, not, token);
-    String value = token.stringValue;
-    if (identical(value, 'is') || identical(value, 'as')) {
-      // The is- and as-operators cannot be chained, but they can take part of
-      // expressions like: foo is Foo || foo is Bar.
-      listener.unexpected(token);
-    }
-    return token;
-  }
-
-  Token parseAsOperatorRest(Token token) {
-    assert(optional('as', token));
-    Token operator = token;
-    token = parseType(token.next);
-    listener.handleAsOperator(operator, token);
-    String value = token.stringValue;
-    if (identical(value, 'is') || identical(value, 'as')) {
-      // The is- and as-operators cannot be chained.
-      listener.unexpected(token);
-    }
-    return token;
-  }
-
-  Token parseVariablesDeclaration(Token token) {
-    return parseVariablesDeclarationMaybeSemicolon(token, true);
-  }
-
-  Token parseVariablesDeclarationNoSemicolon(Token token) {
-    // Only called when parsing a for loop, so this is for parsing locals.
-    return parseVariablesDeclarationMaybeSemicolon(token, false);
-  }
-
-  Token parseVariablesDeclarationMaybeSemicolon(Token token,
-                                                bool endWithSemicolon) {
-    int count = 1;
-    listener.beginVariablesDeclaration(token);
-    token = parseModifiers(token);
-    token = parseTypeOpt(token);
-    token = parseOptionallyInitializedIdentifier(token);
-    while (optional(',', token)) {
-      token = parseOptionallyInitializedIdentifier(token.next);
-      ++count;
-    }
-    if (endWithSemicolon) {
-      Token semicolon = token;
-      token = expectSemicolon(semicolon);
-      listener.endVariablesDeclaration(count, semicolon);
-      return token;
-    } else {
-      listener.endVariablesDeclaration(count, null);
-      return token;
-    }
-  }
-
-  Token parseOptionallyInitializedIdentifier(Token token) {
-    listener.beginInitializedIdentifier(token);
-    token = parseIdentifier(token);
-    token = parseVariableInitializerOpt(token);
-    listener.endInitializedIdentifier();
-    return token;
-  }
-
-  Token parseIfStatement(Token token) {
-    Token ifToken = token;
-    listener.beginIfStatement(ifToken);
-    token = expect('if', token);
-    token = parseParenthesizedExpression(token);
-    token = parseStatement(token);
-    Token elseToken = null;
-    if (optional('else', token)) {
-      elseToken = token;
-      token = parseStatement(token.next);
-    }
-    listener.endIfStatement(ifToken, elseToken);
-    return token;
-  }
-
-  Token parseForStatement(Token awaitToken, Token token) {
-    Token forToken = token;
-    listener.beginForStatement(forToken);
-    token = expect('for', token);
-    token = expect('(', token);
-    token = parseVariablesDeclarationOrExpressionOpt(token);
-    if (optional('in', token)) {
-      return parseForInRest(awaitToken, forToken, token);
-    } else {
-      if (awaitToken != null) {
-        listener.reportError(awaitToken, MessageKind.INVALID_AWAIT_FOR);
-      }
-      return parseForRest(forToken, token);
-    }
-  }
-
-  Token parseVariablesDeclarationOrExpressionOpt(Token token) {
-    final String value = token.stringValue;
-    if (identical(value, ';')) {
-      listener.handleNoExpression(token);
-      return token;
-    } else if ((identical(value, 'var')) || (identical(value, 'final'))) {
-      return parseVariablesDeclarationNoSemicolon(token);
-    }
-    Token identifier = peekIdentifierAfterType(token);
-    if (identifier != null) {
-      assert(identifier.isIdentifier());
-      if (isOneOf4(identifier.next, '=', ';', ',', 'in')) {
-        return parseVariablesDeclarationNoSemicolon(token);
-      }
-    }
-    return parseExpression(token);
-  }
-
-  Token parseForRest(Token forToken, Token token) {
-    token = expectSemicolon(token);
-    if (optional(';', token)) {
-      token = parseEmptyStatement(token);
-    } else {
-      token = parseExpressionStatement(token);
-    }
-    int expressionCount = 0;
-    while (true) {
-      if (optional(')', token)) break;
-      token = parseExpression(token);
-      ++expressionCount;
-      if (optional(',', token)) {
-        token = token.next;
-      } else {
-        break;
-      }
-    }
-    token = expect(')', token);
-    token = parseStatement(token);
-    listener.endForStatement(expressionCount, forToken, token);
-    return token;
-  }
-
-  Token parseForInRest(Token awaitToken, Token forToken, Token token) {
-    assert(optional('in', token));
-    Token inKeyword = token;
-    token = parseExpression(token.next);
-    token = expect(')', token);
-    token = parseStatement(token);
-    listener.endForIn(awaitToken, forToken, inKeyword, token);
-    return token;
-  }
-
-  Token parseWhileStatement(Token token) {
-    Token whileToken = token;
-    listener.beginWhileStatement(whileToken);
-    token = expect('while', token);
-    token = parseParenthesizedExpression(token);
-    token = parseStatement(token);
-    listener.endWhileStatement(whileToken, token);
-    return token;
-  }
-
-  Token parseDoWhileStatement(Token token) {
-    Token doToken = token;
-    listener.beginDoWhileStatement(doToken);
-    token = expect('do', token);
-    token = parseStatement(token);
-    Token whileToken = token;
-    token = expect('while', token);
-    token = parseParenthesizedExpression(token);
-    listener.endDoWhileStatement(doToken, whileToken, token);
-    return expectSemicolon(token);
-  }
-
-  Token parseBlock(Token token) {
-    Token begin = token;
-    listener.beginBlock(begin);
-    int statementCount = 0;
-    token = expect('{', token);
-    while (notEofOrValue('}', token)) {
-      token = parseStatement(token);
-      ++statementCount;
-    }
-    listener.endBlock(statementCount, begin, token);
-    return expect('}', token);
-  }
-
-  Token parseAwaitExpression(Token token, bool allowCascades) {
-    Token awaitToken = token;
-    listener.beginAwaitExpression(awaitToken);
-    token = expect('await', token);
-    token = parsePrecedenceExpression(token, POSTFIX_PRECEDENCE,
-                                      allowCascades);
-    listener.endAwaitExpression(awaitToken, token);
-    return token;
-  }
-
-  Token parseThrowExpression(Token token, bool allowCascades) {
-    Token throwToken = token;
-    listener.beginThrowExpression(throwToken);
-    token = expect('throw', token);
-    token = allowCascades
-        ? parseExpression(token)
-        : parseExpressionWithoutCascade(token);
-    listener.endThrowExpression(throwToken, token);
-    return token;
-  }
-
-  Token parseRethrowStatement(Token token) {
-    Token throwToken = token;
-    listener.beginRethrowStatement(throwToken);
-    // TODO(kasperl): Disallow throw here.
-    if (identical(throwToken.stringValue, 'throw')) {
-      token = expect('throw', token);
-    } else {
-      token = expect('rethrow', token);
-    }
-    listener.endRethrowStatement(throwToken, token);
-    return expectSemicolon(token);
-  }
-
-  Token parseTryStatement(Token token) {
-    assert(optional('try', token));
-    Token tryKeyword = token;
-    listener.beginTryStatement(tryKeyword);
-    token = parseBlock(token.next);
-    int catchCount = 0;
-
-    String value = token.stringValue;
-    while (identical(value, 'catch') || identical(value, 'on')) {
-      var onKeyword = null;
-      if (identical(value, 'on')) {
-        // on qualified catchPart?
-        onKeyword = token;
-        token = parseType(token.next);
-        value = token.stringValue;
-      }
-      Token catchKeyword = null;
-      if (identical(value, 'catch')) {
-        catchKeyword = token;
-        // TODO(ahe): Validate the "parameters".
-        token = parseFormalParameters(token.next);
-      }
-      token = parseBlock(token);
-      ++catchCount;
-      listener.handleCatchBlock(onKeyword, catchKeyword);
-      value = token.stringValue; // while condition
-    }
-
-    Token finallyKeyword = null;
-    if (optional('finally', token)) {
-      finallyKeyword = token;
-      token = parseBlock(token.next);
-      listener.handleFinallyBlock(finallyKeyword);
-    }
-    listener.endTryStatement(catchCount, tryKeyword, finallyKeyword);
-    return token;
-  }
-
-  Token parseSwitchStatement(Token token) {
-    assert(optional('switch', token));
-    Token switchKeyword = token;
-    listener.beginSwitchStatement(switchKeyword);
-    token = parseParenthesizedExpression(token.next);
-    token = parseSwitchBlock(token);
-    listener.endSwitchStatement(switchKeyword, token);
-    return token.next;
-  }
-
-  Token parseSwitchBlock(Token token) {
-    Token begin = token;
-    listener.beginSwitchBlock(begin);
-    token = expect('{', token);
-    int caseCount = 0;
-    while (!identical(token.kind, EOF_TOKEN)) {
-      if (optional('}', token)) {
-        break;
-      }
-      token = parseSwitchCase(token);
-      ++caseCount;
-    }
-    listener.endSwitchBlock(caseCount, begin, token);
-    expect('}', token);
-    return token;
-  }
-
-  /**
-   * Peek after the following labels (if any). The following token
-   * is used to determine if the labels belong to a statement or a
-   * switch case.
-   */
-  Token peekPastLabels(Token token) {
-    while (token.isIdentifier() && optional(':', token.next)) {
-      token = token.next.next;
-    }
-    return token;
-  }
-
-  /**
-   * Parse a group of labels, cases and possibly a default keyword and
-   * the statements that they select.
-   */
-  Token parseSwitchCase(Token token) {
-    Token begin = token;
-    Token defaultKeyword = null;
-    int expressionCount = 0;
-    int labelCount = 0;
-    Token peek = peekPastLabels(token);
-    while (true) {
-      // Loop until we find something that can't be part of a switch case.
-      String value = peek.stringValue;
-      if (identical(value, 'default')) {
-        while (!identical(token, peek)) {
-          token = parseLabel(token);
-          labelCount++;
-        }
-        defaultKeyword = token;
-        token = expect(':', token.next);
-        peek = token;
-        break;
-      } else if (identical(value, 'case')) {
-        while (!identical(token, peek)) {
-          token = parseLabel(token);
-          labelCount++;
-        }
-        Token caseKeyword = token;
-        token = parseExpression(token.next);
-        Token colonToken = token;
-        token = expect(':', token);
-        listener.handleCaseMatch(caseKeyword, colonToken);
-        expressionCount++;
-        peek = peekPastLabels(token);
-      } else {
-        if (expressionCount == 0) {
-          listener.expected("case", token);
-        }
-        break;
-      }
-    }
-    // Finally zero or more statements.
-    int statementCount = 0;
-    while (!identical(token.kind, EOF_TOKEN)) {
-      String value = peek.stringValue;
-      if ((identical(value, 'case')) ||
-          (identical(value, 'default')) ||
-          ((identical(value, '}')) && (identical(token, peek)))) {
-        // A label just before "}" will be handled as a statement error.
-        break;
-      } else {
-        token = parseStatement(token);
-      }
-      statementCount++;
-      peek = peekPastLabels(token);
-    }
-    listener.handleSwitchCase(labelCount, expressionCount, defaultKeyword,
-                              statementCount, begin, token);
-    return token;
-  }
-
-  Token parseBreakStatement(Token token) {
-    assert(optional('break', token));
-    Token breakKeyword = token;
-    token = token.next;
-    bool hasTarget = false;
-    if (token.isIdentifier()) {
-      token = parseIdentifier(token);
-      hasTarget = true;
-    }
-    listener.handleBreakStatement(hasTarget, breakKeyword, token);
-    return expectSemicolon(token);
-  }
-
-  Token parseAssertStatement(Token token) {
-    Token assertKeyword = token;
-    token = expect('assert', token);
-    expect('(', token);
-    token = parseArguments(token);
-    listener.handleAssertStatement(assertKeyword, token);
-    return expectSemicolon(token);
-  }
-
-  Token parseContinueStatement(Token token) {
-    assert(optional('continue', token));
-    Token continueKeyword = token;
-    token = token.next;
-    bool hasTarget = false;
-    if (token.isIdentifier()) {
-      token = parseIdentifier(token);
-      hasTarget = true;
-    }
-    listener.handleContinueStatement(hasTarget, continueKeyword, token);
-    return expectSemicolon(token);
-  }
-
-  Token parseEmptyStatement(Token token) {
-    listener.handleEmptyStatement(token);
-    return expectSemicolon(token);
-  }
-}
diff --git a/pkg/compiler/lib/src/scanner/parser_task.dart b/pkg/compiler/lib/src/scanner/parser_task.dart
deleted file mode 100644
index c680a31..0000000
--- a/pkg/compiler/lib/src/scanner/parser_task.dart
+++ /dev/null
@@ -1,30 +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.
-
-part of scanner;
-
-class ParserTask extends CompilerTask {
-  ParserTask(Compiler compiler) : super(compiler);
-  String get name => 'Parser';
-
-  Node parse(ElementX element) {
-    return measure(() => element.parseNode(compiler));
-  }
-
-  Node parseCompilationUnit(Token token) {
-    return measure(() {
-      NodeListener listener = new NodeListener(compiler, null);
-      Parser parser = new Parser(listener);
-      try {
-        parser.parseUnit(token);
-      } on ParserError catch(_) {
-        assert(invariant(token, compiler.compilationFailed));
-        return listener.makeNodeList(0, null, null, '\n');
-      }
-      Node result = listener.popNode();
-      assert(listener.nodes.isEmpty);
-      return result;
-    });
-  }
-}
diff --git a/pkg/compiler/lib/src/scanner/partial_parser.dart b/pkg/compiler/lib/src/scanner/partial_parser.dart
deleted file mode 100644
index c6ccbf4..0000000
--- a/pkg/compiler/lib/src/scanner/partial_parser.dart
+++ /dev/null
@@ -1,166 +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.
-
-part of scanner;
-
-class PartialParser extends Parser {
-  PartialParser(Listener listener) : super(listener);
-
-  Token parseClassBody(Token token) => skipClassBody(token);
-
-  Token fullParseClassBody(Token token) => super.parseClassBody(token);
-
-  Token parseExpression(Token token) => skipExpression(token);
-
-  Token parseArgumentsOpt(Token token) {
-    // 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).
-    if (optional('(', token)) {
-      BeginGroupToken begin = token;
-      return begin.endGroup.next;
-    } else {
-      return token;
-    }
-  }
-
-  Token skipExpression(Token token) {
-    while (true) {
-      final kind = token.kind;
-      final value = token.stringValue;
-      if ((identical(kind, EOF_TOKEN)) ||
-          (identical(value, ';')) ||
-          (identical(value, ',')) ||
-          (identical(value, '}')) ||
-          (identical(value, ')')) ||
-          (identical(value, ']'))) {
-        break;
-      }
-      if (identical(value, '=') ||
-          identical(value, '?') ||
-          identical(value, ':')) {
-        var nextValue = token.next.stringValue;
-        if (identical(nextValue, 'const')) {
-          token = token.next;
-          nextValue = token.next.stringValue;
-        }
-        if (identical(nextValue, '{')) {
-          // Handle cases like this:
-          // class Foo {
-          //   var map;
-          //   Foo() : map = {};
-          //   Foo.x() : map = true ? {} : {};
-          // }
-          BeginGroupToken begin = token.next;
-          token = (begin.endGroup != null) ? begin.endGroup : token;
-          token = token.next;
-          continue;
-        }
-        if (identical(nextValue, '<')) {
-          // Handle cases like this:
-          // class Foo {
-          //   var map;
-          //   Foo() : map = <String, Foo>{};
-          //   Foo.x() : map = true ? <String, Foo>{} : <String, Foo>{};
-          // }
-          BeginGroupToken begin = token.next;
-          token = (begin.endGroup != null) ? begin.endGroup : token;
-          token = token.next;
-          if (identical(token.stringValue, '{')) {
-            begin = token;
-            token = (begin.endGroup != null) ? begin.endGroup : token;
-            token = token.next;
-          }
-          continue;
-        }
-      }
-      if (!mayParseFunctionExpressions && identical(value, '{')) {
-        break;
-      }
-      if (token is BeginGroupToken) {
-        BeginGroupToken begin = token;
-        token = (begin.endGroup != null) ? begin.endGroup : token;
-      } else if (token is ErrorToken) {
-        listener.reportErrorToken(token);
-      }
-      token = token.next;
-    }
-    return token;
-  }
-
-  Token skipClassBody(Token token) {
-    if (!optional('{', token)) {
-      return listener.expectedClassBodyToSkip(token);
-    }
-    BeginGroupToken beginGroupToken = token;
-    Token endGroup = beginGroupToken.endGroup;
-    if (endGroup == null) {
-      return listener.unmatched(beginGroupToken);
-    } else if (!identical(endGroup.kind, $CLOSE_CURLY_BRACKET)) {
-      return listener.unmatched(beginGroupToken);
-    }
-    return endGroup;
-  }
-
-  Token skipAsyncModifier(Token token) {
-    String value = token.stringValue;
-    if (identical(value, 'async')) {
-      token = token.next;
-      value = token.stringValue;
-
-      if (identical(value, '*')) {
-        token = token.next;
-      }
-    } else if (identical(value, 'sync')) {
-      token = token.next;
-      value = token.stringValue;
-
-      if (identical(value, '*')) {
-        token = token.next;
-      }
-    }
-    return token;
-  }
-
-  Token parseFunctionBody(Token token, bool isExpression, bool allowAbstract) {
-    assert(!isExpression);
-    token = skipAsyncModifier(token);
-    String value = token.stringValue;
-    if (identical(value, ';')) {
-      if (!allowAbstract) {
-        listener.reportError(token, MessageKind.BODY_EXPECTED);
-      }
-      listener.handleNoFunctionBody(token);
-    } else {
-      if (identical(value, '=>')) {
-        token = parseExpression(token.next);
-        expectSemicolon(token);
-      } else if (value == '=') {
-        token = parseRedirectingFactoryBody(token);
-        expectSemicolon(token);
-      } else {
-        token = skipBlock(token);
-      }
-      listener.skippedFunctionBody(token);
-    }
-    return token;
-  }
-
-  Token parseFormalParameters(Token token) => skipFormals(token);
-
-  Token skipFormals(Token token) {
-    listener.beginOptionalFormalParameters(token);
-    if (!optional('(', token)) {
-      if (optional(';', token)) {
-        listener.recoverableError(token, "expected '('");
-        return token;
-      }
-      return listener.unexpected(token);
-    }
-    BeginGroupToken beginGroupToken = token;
-    Token endToken = beginGroupToken.endGroup;
-    listener.endFormalParameters(0, token, endToken);
-    return endToken.next;
-  }
-}
diff --git a/pkg/compiler/lib/src/scanner/scanner.dart b/pkg/compiler/lib/src/scanner/scanner.dart
index d9ab312..1a52a64 100644
--- a/pkg/compiler/lib/src/scanner/scanner.dart
+++ b/pkg/compiler/lib/src/scanner/scanner.dart
@@ -2,7 +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.
 
-part of scanner;
+library dart2js.scanner;
+
+import '../io/source_file.dart' show
+    SourceFile,
+    Utf8BytesSourceFile;
+import '../tokens/keyword.dart' show
+    Keyword,
+    KeywordState;
+import '../tokens/precedence.dart';
+import '../tokens/precedence_constants.dart';
+import '../tokens/token.dart';
+import '../tokens/token_constants.dart';
+import '../util/characters.dart';
+
+import 'string_scanner.dart' show
+    StringScanner;
+import 'utf8_bytes_scanner.dart' show
+    Utf8BytesScanner;
+
 
 abstract class Scanner {
   Token tokenize();
diff --git a/pkg/compiler/lib/src/scanner/scanner_task.dart b/pkg/compiler/lib/src/scanner/scanner_task.dart
index 636ee34..17b3dbc 100644
--- a/pkg/compiler/lib/src/scanner/scanner_task.dart
+++ b/pkg/compiler/lib/src/scanner/scanner_task.dart
@@ -2,7 +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.
 
-part of scanner;
+library dart2js.scanner.task;
+
+import '../common/tasks.dart' show
+    CompilerTask;
+import '../compiler.dart' show
+    Compiler;
+import '../elements/elements.dart' show
+    CompilationUnitElement,
+    LibraryElement;
+import '../script.dart' show
+    Script;
+import '../tokens/token.dart' show
+    Token;
+
+import 'scanner.dart' show
+    Scanner;
+import 'string_scanner.dart' show
+    StringScanner;
 
 class ScannerTask extends CompilerTask {
   ScannerTask(Compiler compiler) : super(compiler);
@@ -13,9 +30,9 @@
     String canonicalUri = library.canonicalUri.toString();
     String resolvedUri = compilationUnit.script.resourceUri.toString();
     if (canonicalUri == resolvedUri) {
-      compiler.log("Scanning library $canonicalUri");
+      reporter.log("Scanning library $canonicalUri");
     } else {
-      compiler.log("Scanning library $canonicalUri ($resolvedUri)");
+      reporter.log("Scanning library $canonicalUri ($resolvedUri)");
     }
     scan(compilationUnit);
   }
@@ -50,22 +67,3 @@
     });
   }
 }
-
-class DietParserTask extends CompilerTask {
-  DietParserTask(Compiler compiler) : super(compiler);
-  final String name = 'Diet Parser';
-
-  dietParse(CompilationUnitElement compilationUnit, Token tokens) {
-    measure(() {
-      Function idGenerator = compiler.getNextFreeClassId;
-      ElementListener listener =
-          new ElementListener(compiler, compilationUnit, idGenerator);
-      PartialParser parser = new PartialParser(listener);
-      try {
-        parser.parseUnit(tokens);
-      } on ParserError catch(_) {
-        assert(invariant(compilationUnit, compiler.compilationFailed));
-      }
-    });
-  }
-}
diff --git a/pkg/compiler/lib/src/scanner/scannerlib.dart b/pkg/compiler/lib/src/scanner/scannerlib.dart
deleted file mode 100644
index d0c3a2e..0000000
--- a/pkg/compiler/lib/src/scanner/scannerlib.dart
+++ /dev/null
@@ -1,53 +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.
-
-library scanner;
-
-import 'dart:collection' show IterableBase, HashSet;
-
-import '../dart_types.dart' show DynamicType;
-import '../elements/elements.dart';
-
-import '../elements/modelx.dart' show
-    BaseFunctionElementX,
-    ClassElementX,
-    CompilationUnitElementX,
-    ConstructorElementX,
-    DeclarationSite,
-    ElementX,
-    EnumClassElementX,
-    FieldElementX,
-    GetterElementX,
-    MethodElementX,
-    LibraryElementX,
-    MetadataAnnotationX,
-    MixinApplicationElementX,
-    SetterElementX,
-    TypedefElementX,
-    VariableElementX,
-    VariableList;
-
-import '../elements/visitor.dart'
-    show ElementVisitor;
-import '../dart2jslib.dart';
-import '../native/native.dart' as native;
-import '../string_validator.dart';
-import '../tree/tree.dart';
-import '../util/characters.dart';
-import '../util/util.dart';
-import '../io/source_file.dart' show SourceFile, Utf8BytesSourceFile;
-import 'dart:convert' show UTF8, UNICODE_BOM_CHARACTER_RUNE;
-
-part 'class_element_parser.dart';
-part 'keyword.dart';
-part 'listener.dart';
-part 'parser.dart';
-part 'parser_task.dart';
-part 'partial_parser.dart';
-part 'scanner.dart';
-part 'scanner_task.dart';
-part 'array_based_scanner.dart';
-part 'utf8_bytes_scanner.dart';
-part 'string_scanner.dart';
-part 'token.dart';
diff --git a/pkg/compiler/lib/src/scanner/string_scanner.dart b/pkg/compiler/lib/src/scanner/string_scanner.dart
index 5a30e43..21bc2bb 100644
--- a/pkg/compiler/lib/src/scanner/string_scanner.dart
+++ b/pkg/compiler/lib/src/scanner/string_scanner.dart
@@ -2,7 +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.
 
-part of scanner;
+library dart2js.scanner.string;
+
+import '../io/source_file.dart' show
+    SourceFile;
+import '../tokens/precedence.dart' show
+    PrecedenceInfo;
+import '../tokens/token.dart' show
+    StringToken,
+    Token;
+
+import 'array_based_scanner.dart' show
+    ArrayBasedScanner;
+
 
 /**
  * Scanner that reads from a String and creates tokens that points to
diff --git a/pkg/compiler/lib/src/scanner/token.dart b/pkg/compiler/lib/src/scanner/token.dart
deleted file mode 100644
index c7c74d1..0000000
--- a/pkg/compiler/lib/src/scanner/token.dart
+++ /dev/null
@@ -1,740 +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.
-
-part of scanner;
-
-const int EOF_TOKEN = 0;
-
-const int KEYWORD_TOKEN = $k;
-const int IDENTIFIER_TOKEN = $a;
-const int BAD_INPUT_TOKEN = $X;
-const int DOUBLE_TOKEN = $d;
-const int INT_TOKEN = $i;
-const int HEXADECIMAL_TOKEN = $x;
-const int STRING_TOKEN = $SQ;
-
-const int AMPERSAND_TOKEN = $AMPERSAND;
-const int BACKPING_TOKEN = $BACKPING;
-const int BACKSLASH_TOKEN = $BACKSLASH;
-const int BANG_TOKEN = $BANG;
-const int BAR_TOKEN = $BAR;
-const int COLON_TOKEN = $COLON;
-const int COMMA_TOKEN = $COMMA;
-const int EQ_TOKEN = $EQ;
-const int GT_TOKEN = $GT;
-const int HASH_TOKEN = $HASH;
-const int OPEN_CURLY_BRACKET_TOKEN = $OPEN_CURLY_BRACKET;
-const int OPEN_SQUARE_BRACKET_TOKEN = $OPEN_SQUARE_BRACKET;
-const int OPEN_PAREN_TOKEN = $OPEN_PAREN;
-const int LT_TOKEN = $LT;
-const int MINUS_TOKEN = $MINUS;
-const int PERIOD_TOKEN = $PERIOD;
-const int PLUS_TOKEN = $PLUS;
-const int QUESTION_TOKEN = $QUESTION;
-const int AT_TOKEN = $AT;
-const int CLOSE_CURLY_BRACKET_TOKEN = $CLOSE_CURLY_BRACKET;
-const int CLOSE_SQUARE_BRACKET_TOKEN = $CLOSE_SQUARE_BRACKET;
-const int CLOSE_PAREN_TOKEN = $CLOSE_PAREN;
-const int SEMICOLON_TOKEN = $SEMICOLON;
-const int SLASH_TOKEN = $SLASH;
-const int TILDE_TOKEN = $TILDE;
-const int STAR_TOKEN = $STAR;
-const int PERCENT_TOKEN = $PERCENT;
-const int CARET_TOKEN = $CARET;
-
-const int STRING_INTERPOLATION_TOKEN = 128;
-const int LT_EQ_TOKEN = STRING_INTERPOLATION_TOKEN + 1;
-const int FUNCTION_TOKEN = LT_EQ_TOKEN + 1;
-const int SLASH_EQ_TOKEN = FUNCTION_TOKEN + 1;
-const int PERIOD_PERIOD_PERIOD_TOKEN = SLASH_EQ_TOKEN + 1;
-const int PERIOD_PERIOD_TOKEN = PERIOD_PERIOD_PERIOD_TOKEN + 1;
-const int EQ_EQ_EQ_TOKEN = PERIOD_PERIOD_TOKEN + 1;
-const int EQ_EQ_TOKEN = EQ_EQ_EQ_TOKEN + 1;
-const int LT_LT_EQ_TOKEN = EQ_EQ_TOKEN + 1;
-const int LT_LT_TOKEN = LT_LT_EQ_TOKEN + 1;
-const int GT_EQ_TOKEN = LT_LT_TOKEN + 1;
-const int GT_GT_EQ_TOKEN = GT_EQ_TOKEN + 1;
-const int INDEX_EQ_TOKEN = GT_GT_EQ_TOKEN + 1;
-const int INDEX_TOKEN = INDEX_EQ_TOKEN + 1;
-const int BANG_EQ_EQ_TOKEN = INDEX_TOKEN + 1;
-const int BANG_EQ_TOKEN = BANG_EQ_EQ_TOKEN + 1;
-const int AMPERSAND_AMPERSAND_TOKEN = BANG_EQ_TOKEN + 1;
-const int AMPERSAND_EQ_TOKEN = AMPERSAND_AMPERSAND_TOKEN + 1;
-const int BAR_BAR_TOKEN = AMPERSAND_EQ_TOKEN + 1;
-const int BAR_EQ_TOKEN = BAR_BAR_TOKEN + 1;
-const int STAR_EQ_TOKEN = BAR_EQ_TOKEN + 1;
-const int PLUS_PLUS_TOKEN = STAR_EQ_TOKEN + 1;
-const int PLUS_EQ_TOKEN = PLUS_PLUS_TOKEN + 1;
-const int MINUS_MINUS_TOKEN = PLUS_EQ_TOKEN + 1;
-const int MINUS_EQ_TOKEN = MINUS_MINUS_TOKEN + 1;
-const int TILDE_SLASH_EQ_TOKEN = MINUS_EQ_TOKEN + 1;
-const int TILDE_SLASH_TOKEN = TILDE_SLASH_EQ_TOKEN + 1;
-const int PERCENT_EQ_TOKEN = TILDE_SLASH_TOKEN + 1;
-const int GT_GT_TOKEN = PERCENT_EQ_TOKEN + 1;
-const int CARET_EQ_TOKEN = GT_GT_TOKEN + 1;
-const int COMMENT_TOKEN = CARET_EQ_TOKEN + 1;
-const int STRING_INTERPOLATION_IDENTIFIER_TOKEN = COMMENT_TOKEN + 1;
-const int QUESTION_PERIOD_TOKEN = STRING_INTERPOLATION_IDENTIFIER_TOKEN + 1;
-const int QUESTION_QUESTION_TOKEN = QUESTION_PERIOD_TOKEN + 1;
-const int QUESTION_QUESTION_EQ_TOKEN = QUESTION_QUESTION_TOKEN + 1;
-
-/**
- * A token that doubles as a linked list.
- */
-abstract class Token implements Spannable {
-  /**
-   * The character offset of the start of this token within the source text.
-   */
-  final int charOffset;
-
-  Token(this.charOffset);
-
-  /**
-   * The next token in the token stream.
-   */
-  Token next;
-
-  /**
-   * The precedence info for this token. [info] determines the kind and the
-   * precedence level of this token.
-   *
-   * Defined as getter to save a field in the [KeywordToken] subclass.
-   */
-  PrecedenceInfo get info;
-
-  /**
-   * The string represented by this token, a substring of the source code.
-   *
-   * For [StringToken]s the [value] includes the quotes, explicit escapes, etc.
-   */
-  String get value;
-
-  /**
-   * For symbol and keyword tokens, returns the string value represented by this
-   * token. For [StringToken]s this method returns [:null:].
-   *
-   * For [SymbolToken]s and [KeywordToken]s, the string value is a compile-time
-   * constant originating in the [PrecedenceInfo] or in the [Keyword] instance.
-   * This allows testing for keywords and symbols using [:identical:], e.g.,
-   * [:identical('class', token.value):].
-   *
-   * Note that returning [:null:] for string tokens is important to identify
-   * symbols and keywords, we cannot use [value] instead. The string literal
-   *   "$a($b"
-   * produces ..., SymbolToken($), StringToken(a), StringToken((), ...
-   *
-   * After parsing the identifier 'a', the parser tests for a function
-   * declaration using [:identical(next.stringValue, '('):], which (rihgtfully)
-   * returns false because stringValue returns [:null:].
-   */
-  String get stringValue;
-
-  /**
-   * The kind enum of this token as determined by its [info].
-   */
-  int get kind => info.kind;
-
-  /**
-   * The precedence level for this token.
-   */
-  int get precedence => info.precedence;
-
-  /**
-   * True if this token is an identifier. Some keywords allowed as identifiers,
-   * see implementation in [KeywordToken].
-   */
-  bool isIdentifier();
-
-  /**
-   * Returns a textual representation of this token to be used for debugging
-   * purposes. The resulting string might contain information about the
-   * structure of the token, for example 'StringToken(foo)' for the identifier
-   * token 'foo'.
-   *
-   * Use [value] for the text actually parsed by the token.
-   */
-  String toString();
-
-  /**
-   * The number of characters parsed by this token.
-   */
-  int get charCount {
-    if (info == BAD_INPUT_INFO) {
-      // This is a token that wraps around an error message. Return 1
-      // instead of the size of the length of the error message.
-      return 1;
-    } else {
-      return value.length;
-    }
-  }
-
-  int get hashCode => computeHashCode(charOffset, info, value);
-}
-
-/// A pair of tokens marking the beginning and the end of a span. Use for error
-/// reporting.
-class TokenPair implements Spannable {
-  final Token begin;
-  final Token end;
-
-  TokenPair(this.begin, this.end);
-}
-
-/**
- * A [SymbolToken] represents the symbol in its precendence info.
- * Also used for end of file with EOF_INFO.
- */
-class SymbolToken extends Token {
-
-  final PrecedenceInfo info;
-
-  SymbolToken(this.info, int charOffset) : super(charOffset);
-
-  String get value => info.value;
-
-  String get stringValue => info.value;
-
-  bool isIdentifier() => false;
-
-  String toString() => "SymbolToken($value)";
-}
-
-/**
- * A [BeginGroupToken] represents a symbol that may be the beginning of
- * a pair of brackets, i.e., ( { [ < or ${
- * The [endGroup] token points to the matching closing bracked in case
- * it can be identified during scanning.
- */
-class BeginGroupToken extends SymbolToken {
-  Token endGroup;
-
-  BeginGroupToken(PrecedenceInfo info, int charOffset)
-      : super(info, charOffset);
-}
-
-/**
- * A keyword token.
- */
-class KeywordToken extends Token {
-  final Keyword keyword;
-
-  KeywordToken(this.keyword, int charOffset) : super(charOffset);
-
-  PrecedenceInfo get info => keyword.info;
-
-  String get value => keyword.syntax;
-
-  String get stringValue => keyword.syntax;
-
-  bool isIdentifier() => keyword.isPseudo || keyword.isBuiltIn;
-
-  String toString() => "KeywordToken($value)";
-}
-
-abstract class ErrorToken extends Token {
-  ErrorToken(int charOffset)
-      : super(charOffset);
-
-  PrecedenceInfo get info => BAD_INPUT_INFO;
-
-  String get value {
-    throw new SpannableAssertionFailure(this, assertionMessage);
-  }
-
-  String get stringValue => null;
-
-  bool isIdentifier() => false;
-
-  String get assertionMessage;
-}
-
-class BadInputToken extends ErrorToken {
-  final int character;
-
-  BadInputToken(this.character, int charOffset)
-      : super(charOffset);
-
-  String toString() => "BadInputToken($character)";
-
-  String get assertionMessage {
-    return 'Character U+${character.toRadixString(16)} not allowed here.';
-  }
-}
-
-class UnterminatedToken extends ErrorToken {
-  final String start;
-  final int endOffset;
-
-  UnterminatedToken(this.start, int charOffset, this.endOffset)
-      : super(charOffset);
-
-  String toString() => "UnterminatedToken($start)";
-
-  String get assertionMessage => "'$start' isn't terminated.";
-
-  int get charCount => endOffset - charOffset;
-}
-
-class UnmatchedToken extends ErrorToken {
-  final BeginGroupToken begin;
-
-  UnmatchedToken(BeginGroupToken begin)
-      : this.begin = begin,
-        super(begin.charOffset);
-
-  String toString() => "UnmatchedToken(${begin.value})";
-
-  String get assertionMessage => "'$begin' isn't closed.";
-}
-
-/**
- * A String-valued token. Represents identifiers, string literals,
- * number literals, comments, and error tokens, using the corresponding
- * precedence info.
- */
-class StringToken extends Token {
-  /**
-   * The length threshold above which substring tokens are computed lazily.
-   *
-   * For string tokens that are substrings of the program source, the actual
-   * substring extraction is performed lazily. This is beneficial because
-   * not all scanned code is actually used. For unused parts, the substrings
-   * are never computed and allocated.
-   */
-  static const int LAZY_THRESHOLD = 4;
-
-  var /* String | LazySubtring */ valueOrLazySubstring;
-
-  final PrecedenceInfo info;
-
-  /**
-   * Creates a non-lazy string token. If [canonicalize] is true, the string
-   * is canonicalized before the token is created.
-   */
-  StringToken.fromString(this.info, String value, int charOffset,
-                         {bool canonicalize : false})
-      : valueOrLazySubstring = canonicalizedString(value, canonicalize),
-        super(charOffset);
-
-  /**
-   * Creates a lazy string token. If [canonicalize] is true, the string
-   * is canonicalized before the token is created.
-   */
-  StringToken.fromSubstring(this.info, String data, int start, int end,
-                            int charOffset, {bool canonicalize : false})
-      : super(charOffset) {
-    int length = end - start;
-    if (length <= LAZY_THRESHOLD) {
-      valueOrLazySubstring = canonicalizedString(data.substring(start, end),
-                                                 canonicalize);
-    } else {
-      valueOrLazySubstring =
-          new LazySubstring(data, start, length, canonicalize);
-    }
-  }
-
-  /**
-   * Creates a lazy string token. If [asciiOnly] is false, the byte array
-   * is passed through a UTF-8 decoder.
-   */
-  StringToken.fromUtf8Bytes(this.info, List<int> data, int start, int end,
-                            bool asciiOnly, int charOffset)
-      : super(charOffset) {
-    int length = end - start;
-    if (length <= LAZY_THRESHOLD) {
-      valueOrLazySubstring = decodeUtf8(data, start, end, asciiOnly);
-    } else {
-      valueOrLazySubstring = new LazySubstring(data, start, length, asciiOnly);
-    }
-  }
-
-  String get value {
-    if (valueOrLazySubstring is String) {
-      return valueOrLazySubstring;
-    } else {
-      assert(valueOrLazySubstring is LazySubstring);
-      var data = valueOrLazySubstring.data;
-      int start = valueOrLazySubstring.start;
-      int end = start + valueOrLazySubstring.length;
-      if (data is String) {
-        valueOrLazySubstring = canonicalizedString(
-            data.substring(start, end), valueOrLazySubstring.boolValue);
-      } else {
-        valueOrLazySubstring = decodeUtf8(
-            data, start, end, valueOrLazySubstring.boolValue);
-      }
-      return valueOrLazySubstring;
-    }
-  }
-
-  String get stringValue => null;
-
-  bool isIdentifier() => identical(kind, IDENTIFIER_TOKEN);
-
-  String toString() => "StringToken($value)";
-
-  static final HashSet<String> canonicalizedSubstrings =
-      new HashSet<String>();
-
-  static String canonicalizedString(String s, bool canonicalize) {
-    if (!canonicalize) return s;
-    var result = canonicalizedSubstrings.lookup(s);
-    if (result != null) return result;
-    canonicalizedSubstrings.add(s);
-    return s;
-  }
-
-  static String decodeUtf8(List<int> data, int start, int end, bool asciiOnly) {
-    var s;
-    if (asciiOnly) {
-      s = new String.fromCharCodes(data, start, end);
-    } else {
-      s = UTF8.decoder.convert(data, start, end);
-    }
-    return canonicalizedString(s, true);
-  }
-}
-
-/**
- * This class represents the necessary information to compute a substring
- * lazily. The substring can either originate from a string or from
- * a [:List<int>:] of UTF-8 bytes.
- */
-abstract class LazySubstring {
-  /** The original data, either a string or a List<int> */
-  get data;
-
-  int get start;
-  int get length;
-
-  /**
-   * If this substring is based on a String, the [boolValue] indicates wheter
-   * the resulting substring should be canonicalized.
-   *
-   * For substrings based on a byte array, the [boolValue] is true if the
-   * array only holds ASCII characters. The resulting substring will be
-   * canonicalized after decoding.
-   */
-  bool get boolValue;
-
-  LazySubstring.internal();
-
-  factory LazySubstring(data, int start, int length, bool b) {
-    // See comment on [CompactLazySubstring].
-    if (start < 0x100000 && length < 0x200) {
-      int fields = (start << 9);
-      fields = fields | length;
-      fields = fields << 1;
-      if (b) fields |= 1;
-      return new CompactLazySubstring(data, fields);
-    } else {
-      return new FullLazySubstring(data, start, length, b);
-    }
-  }
-}
-
-/**
- * This class encodes [start], [length] and [boolValue] in a single
- * 30 bit integer. It uses 20 bits for [start], which covers source files
- * of 1MB. [length] has 9 bits, which covers 512 characters.
- *
- * The file html_dart2js.dart is currently around 1MB.
- */
-class CompactLazySubstring extends LazySubstring {
-  final data;
-  final int fields;
-
-  CompactLazySubstring(this.data, this.fields) : super.internal();
-
-  int get start => fields >> 10;
-  int get length => (fields >> 1) & 0x1ff;
-  bool get boolValue => (fields & 1) == 1;
-}
-
-class FullLazySubstring extends LazySubstring {
-  final data;
-  final int start;
-  final int length;
-  final bool boolValue;
-  FullLazySubstring(this.data, this.start, this.length, this.boolValue)
-      : super.internal();
-}
-
-bool isUserDefinableOperator(String value) {
-  return
-      isBinaryOperator(value) ||
-      isMinusOperator(value) ||
-      isTernaryOperator(value) ||
-      isUnaryOperator(value);
-}
-
-bool isUnaryOperator(String value) => identical(value, '~');
-
-bool isBinaryOperator(String value) {
-  return
-      (identical(value, '==')) ||
-      (identical(value, '[]')) ||
-      (identical(value, '*')) ||
-      (identical(value, '/')) ||
-      (identical(value, '%')) ||
-      (identical(value, '~/')) ||
-      (identical(value, '+')) ||
-      (identical(value, '<<')) ||
-      (identical(value, '>>')) ||
-      (identical(value, '>=')) ||
-      (identical(value, '>')) ||
-      (identical(value, '<=')) ||
-      (identical(value, '<')) ||
-      (identical(value, '&')) ||
-      (identical(value, '^')) ||
-      (identical(value, '|'));
-}
-
-bool isTernaryOperator(String value) => identical(value, '[]=');
-
-bool isMinusOperator(String value) => identical(value, '-');
-
-class PrecedenceInfo {
-  final String value;
-  final int precedence;
-  final int kind;
-
-  const PrecedenceInfo(this.value, this.precedence, this.kind);
-
-  toString() => 'PrecedenceInfo($value, $precedence, $kind)';
-
-  int get hashCode => computeHashCode(value, precedence, kind);
-}
-
-// TODO(ahe): The following are not tokens in Dart.
-const PrecedenceInfo BACKPING_INFO =
-  const PrecedenceInfo('`', 0, BACKPING_TOKEN);
-const PrecedenceInfo BACKSLASH_INFO =
-  const PrecedenceInfo('\\', 0, BACKSLASH_TOKEN);
-const PrecedenceInfo PERIOD_PERIOD_PERIOD_INFO =
-  const PrecedenceInfo('...', 0,
-                       PERIOD_PERIOD_PERIOD_TOKEN);
-
-/**
- * The cascade operator has the lowest precedence of any operator
- * except assignment.
- */
-const int CASCADE_PRECEDENCE = 2;
-const PrecedenceInfo PERIOD_PERIOD_INFO =
-  const PrecedenceInfo('..', CASCADE_PRECEDENCE,
-                       PERIOD_PERIOD_TOKEN);
-
-const PrecedenceInfo BANG_INFO =
-  const PrecedenceInfo('!', 0, BANG_TOKEN);
-const PrecedenceInfo COLON_INFO =
-  const PrecedenceInfo(':', 0, COLON_TOKEN);
-const PrecedenceInfo INDEX_INFO =
-  const PrecedenceInfo('[]', 0, INDEX_TOKEN);
-const PrecedenceInfo MINUS_MINUS_INFO =
-  const PrecedenceInfo('--', POSTFIX_PRECEDENCE,
-                       MINUS_MINUS_TOKEN);
-const PrecedenceInfo PLUS_PLUS_INFO =
-  const PrecedenceInfo('++', POSTFIX_PRECEDENCE,
-                       PLUS_PLUS_TOKEN);
-const PrecedenceInfo TILDE_INFO =
-  const PrecedenceInfo('~', 0, TILDE_TOKEN);
-
-const PrecedenceInfo FUNCTION_INFO =
-  const PrecedenceInfo('=>', 0, FUNCTION_TOKEN);
-const PrecedenceInfo HASH_INFO =
-  const PrecedenceInfo('#', 0, HASH_TOKEN);
-const PrecedenceInfo INDEX_EQ_INFO =
-  const PrecedenceInfo('[]=', 0, INDEX_EQ_TOKEN);
-const PrecedenceInfo SEMICOLON_INFO =
-  const PrecedenceInfo(';', 0, SEMICOLON_TOKEN);
-const PrecedenceInfo COMMA_INFO =
-  const PrecedenceInfo(',', 0, COMMA_TOKEN);
-
-const PrecedenceInfo AT_INFO =
-  const PrecedenceInfo('@', 0, AT_TOKEN);
-
-// Assignment operators.
-const int ASSIGNMENT_PRECEDENCE = 1;
-const PrecedenceInfo AMPERSAND_EQ_INFO =
-  const PrecedenceInfo('&=',
-                       ASSIGNMENT_PRECEDENCE, AMPERSAND_EQ_TOKEN);
-const PrecedenceInfo BAR_EQ_INFO =
-  const PrecedenceInfo('|=',
-                       ASSIGNMENT_PRECEDENCE, BAR_EQ_TOKEN);
-const PrecedenceInfo CARET_EQ_INFO =
-  const PrecedenceInfo('^=',
-                       ASSIGNMENT_PRECEDENCE, CARET_EQ_TOKEN);
-const PrecedenceInfo EQ_INFO =
-  const PrecedenceInfo('=',
-                       ASSIGNMENT_PRECEDENCE, EQ_TOKEN);
-const PrecedenceInfo GT_GT_EQ_INFO =
-  const PrecedenceInfo('>>=',
-                       ASSIGNMENT_PRECEDENCE, GT_GT_EQ_TOKEN);
-const PrecedenceInfo LT_LT_EQ_INFO =
-  const PrecedenceInfo('<<=',
-                       ASSIGNMENT_PRECEDENCE, LT_LT_EQ_TOKEN);
-const PrecedenceInfo MINUS_EQ_INFO =
-  const PrecedenceInfo('-=',
-                       ASSIGNMENT_PRECEDENCE, MINUS_EQ_TOKEN);
-const PrecedenceInfo PERCENT_EQ_INFO =
-  const PrecedenceInfo('%=',
-                       ASSIGNMENT_PRECEDENCE, PERCENT_EQ_TOKEN);
-const PrecedenceInfo PLUS_EQ_INFO =
-  const PrecedenceInfo('+=',
-                       ASSIGNMENT_PRECEDENCE, PLUS_EQ_TOKEN);
-const PrecedenceInfo SLASH_EQ_INFO =
-  const PrecedenceInfo('/=',
-                       ASSIGNMENT_PRECEDENCE, SLASH_EQ_TOKEN);
-const PrecedenceInfo STAR_EQ_INFO =
-  const PrecedenceInfo('*=',
-                       ASSIGNMENT_PRECEDENCE, STAR_EQ_TOKEN);
-const PrecedenceInfo TILDE_SLASH_EQ_INFO =
-  const PrecedenceInfo('~/=',
-                       ASSIGNMENT_PRECEDENCE, TILDE_SLASH_EQ_TOKEN);
-const PrecedenceInfo QUESTION_QUESTION_EQ_INFO =
-  const PrecedenceInfo('??=',
-                       ASSIGNMENT_PRECEDENCE, QUESTION_QUESTION_EQ_TOKEN);
-
-const PrecedenceInfo QUESTION_INFO =
-  const PrecedenceInfo('?', 3, QUESTION_TOKEN);
-
-const PrecedenceInfo QUESTION_QUESTION_INFO =
-  const PrecedenceInfo('??', 4, QUESTION_QUESTION_TOKEN);
-
-const PrecedenceInfo BAR_BAR_INFO =
-  const PrecedenceInfo('||', 5, BAR_BAR_TOKEN);
-
-const PrecedenceInfo AMPERSAND_AMPERSAND_INFO =
-  const PrecedenceInfo('&&', 6, AMPERSAND_AMPERSAND_TOKEN);
-
-const PrecedenceInfo BAR_INFO =
-  const PrecedenceInfo('|', 9, BAR_TOKEN);
-
-const PrecedenceInfo CARET_INFO =
-  const PrecedenceInfo('^', 10, CARET_TOKEN);
-
-const PrecedenceInfo AMPERSAND_INFO =
-  const PrecedenceInfo('&', 11, AMPERSAND_TOKEN);
-
-// Equality operators.
-const int EQUALITY_PRECEDENCE = 7;
-const PrecedenceInfo BANG_EQ_EQ_INFO =
-  const PrecedenceInfo('!==',
-                       EQUALITY_PRECEDENCE, BANG_EQ_EQ_TOKEN);
-const PrecedenceInfo BANG_EQ_INFO =
-  const PrecedenceInfo('!=',
-                       EQUALITY_PRECEDENCE, BANG_EQ_TOKEN);
-const PrecedenceInfo EQ_EQ_EQ_INFO =
-  const PrecedenceInfo('===',
-                       EQUALITY_PRECEDENCE, EQ_EQ_EQ_TOKEN);
-const PrecedenceInfo EQ_EQ_INFO =
-  const PrecedenceInfo('==',
-                       EQUALITY_PRECEDENCE, EQ_EQ_TOKEN);
-
-// Relational operators.
-const int RELATIONAL_PRECEDENCE = 8;
-const PrecedenceInfo GT_EQ_INFO =
-  const PrecedenceInfo('>=',
-                       RELATIONAL_PRECEDENCE, GT_EQ_TOKEN);
-const PrecedenceInfo GT_INFO =
-  const PrecedenceInfo('>',
-                       RELATIONAL_PRECEDENCE, GT_TOKEN);
-const PrecedenceInfo IS_INFO =
-  const PrecedenceInfo('is',
-                       RELATIONAL_PRECEDENCE, KEYWORD_TOKEN);
-const PrecedenceInfo AS_INFO =
-  const PrecedenceInfo('as',
-                       RELATIONAL_PRECEDENCE, KEYWORD_TOKEN);
-const PrecedenceInfo LT_EQ_INFO =
-  const PrecedenceInfo('<=',
-                       RELATIONAL_PRECEDENCE, LT_EQ_TOKEN);
-const PrecedenceInfo LT_INFO =
-  const PrecedenceInfo('<',
-                       RELATIONAL_PRECEDENCE, LT_TOKEN);
-
-// Shift operators.
-const PrecedenceInfo GT_GT_INFO =
-  const PrecedenceInfo('>>', 12, GT_GT_TOKEN);
-const PrecedenceInfo LT_LT_INFO =
-  const PrecedenceInfo('<<', 12, LT_LT_TOKEN);
-
-// Additive operators.
-const PrecedenceInfo MINUS_INFO =
-  const PrecedenceInfo('-', 13, MINUS_TOKEN);
-const PrecedenceInfo PLUS_INFO =
-  const PrecedenceInfo('+', 13, PLUS_TOKEN);
-
-// Multiplicative operators.
-const PrecedenceInfo PERCENT_INFO =
-  const PrecedenceInfo('%', 14, PERCENT_TOKEN);
-const PrecedenceInfo SLASH_INFO =
-  const PrecedenceInfo('/', 14, SLASH_TOKEN);
-const PrecedenceInfo STAR_INFO =
-  const PrecedenceInfo('*', 14, STAR_TOKEN);
-const PrecedenceInfo TILDE_SLASH_INFO =
-  const PrecedenceInfo('~/', 14, TILDE_SLASH_TOKEN);
-
-const int POSTFIX_PRECEDENCE = 15;
-const PrecedenceInfo PERIOD_INFO =
-  const PrecedenceInfo('.', POSTFIX_PRECEDENCE,
-                       PERIOD_TOKEN);
-const PrecedenceInfo QUESTION_PERIOD_INFO =
-  const PrecedenceInfo('?.', POSTFIX_PRECEDENCE,
-                       QUESTION_PERIOD_TOKEN);
-
-const PrecedenceInfo KEYWORD_INFO =
-  const PrecedenceInfo('keyword', 0, KEYWORD_TOKEN);
-
-const PrecedenceInfo EOF_INFO =
-  const PrecedenceInfo('EOF', 0, EOF_TOKEN);
-
-const PrecedenceInfo IDENTIFIER_INFO =
-  const PrecedenceInfo('identifier', 0, IDENTIFIER_TOKEN);
-
-const PrecedenceInfo BAD_INPUT_INFO =
-  const PrecedenceInfo('malformed input', 0,
-                       BAD_INPUT_TOKEN);
-
-const PrecedenceInfo OPEN_PAREN_INFO =
-  const PrecedenceInfo('(', POSTFIX_PRECEDENCE,
-                       OPEN_PAREN_TOKEN);
-
-const PrecedenceInfo CLOSE_PAREN_INFO =
-  const PrecedenceInfo(')', 0, CLOSE_PAREN_TOKEN);
-
-const PrecedenceInfo OPEN_CURLY_BRACKET_INFO =
-  const PrecedenceInfo('{', 0, OPEN_CURLY_BRACKET_TOKEN);
-
-const PrecedenceInfo CLOSE_CURLY_BRACKET_INFO =
-  const PrecedenceInfo('}', 0, CLOSE_CURLY_BRACKET_TOKEN);
-
-const PrecedenceInfo INT_INFO =
-  const PrecedenceInfo('int', 0, INT_TOKEN);
-
-const PrecedenceInfo STRING_INFO =
-  const PrecedenceInfo('string', 0, STRING_TOKEN);
-
-const PrecedenceInfo OPEN_SQUARE_BRACKET_INFO =
-  const PrecedenceInfo('[', POSTFIX_PRECEDENCE,
-                       OPEN_SQUARE_BRACKET_TOKEN);
-
-const PrecedenceInfo CLOSE_SQUARE_BRACKET_INFO =
-  const PrecedenceInfo(']', 0, CLOSE_SQUARE_BRACKET_TOKEN);
-
-const PrecedenceInfo DOUBLE_INFO =
-  const PrecedenceInfo('double', 0, DOUBLE_TOKEN);
-
-const PrecedenceInfo STRING_INTERPOLATION_INFO =
-  const PrecedenceInfo('\${', 0,
-                       STRING_INTERPOLATION_TOKEN);
-
-const PrecedenceInfo STRING_INTERPOLATION_IDENTIFIER_INFO =
-  const PrecedenceInfo('\$', 0,
-                       STRING_INTERPOLATION_IDENTIFIER_TOKEN);
-
-const PrecedenceInfo HEXADECIMAL_INFO =
-  const PrecedenceInfo('hexadecimal', 0, HEXADECIMAL_TOKEN);
-
-const PrecedenceInfo COMMENT_INFO =
-  const PrecedenceInfo('comment', 0, COMMENT_TOKEN);
diff --git a/pkg/compiler/lib/src/scanner/utf8_bytes_scanner.dart b/pkg/compiler/lib/src/scanner/utf8_bytes_scanner.dart
index d919596..4c42bf7 100644
--- a/pkg/compiler/lib/src/scanner/utf8_bytes_scanner.dart
+++ b/pkg/compiler/lib/src/scanner/utf8_bytes_scanner.dart
@@ -2,7 +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.
 
-part of scanner;
+library dart2js.scanner.utf8;
+
+import 'dart:convert' show
+    UNICODE_BOM_CHARACTER_RUNE,
+    UTF8;
+
+import '../io/source_file.dart' show
+    SourceFile;
+import '../tokens/precedence.dart' show
+    PrecedenceInfo;
+import '../tokens/token.dart' show
+    StringToken,
+    Token;
+
+import 'array_based_scanner.dart' show
+    ArrayBasedScanner;
 
 /**
  * Scanner that reads from a UTF-8 encoded list of bytes and creates tokens
diff --git a/pkg/compiler/lib/src/script.dart b/pkg/compiler/lib/src/script.dart
index fcdf890..3dce8e1 100644
--- a/pkg/compiler/lib/src/script.dart
+++ b/pkg/compiler/lib/src/script.dart
@@ -2,7 +2,9 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-part of dart2js;
+library dart2js.script;
+
+import 'io/source_file.dart';
 
 class Script {
   final SourceFile file;
diff --git a/pkg/compiler/lib/src/serialization/constant_serialization.dart b/pkg/compiler/lib/src/serialization/constant_serialization.dart
index 94dc24f..3af1b4f 100644
--- a/pkg/compiler/lib/src/serialization/constant_serialization.dart
+++ b/pkg/compiler/lib/src/serialization/constant_serialization.dart
@@ -4,11 +4,14 @@
 
 library dart2js.serialization.constants;
 
+import '../constants/constructors.dart';
 import '../constants/expressions.dart';
 import '../dart_types.dart';
-import '../elements/elements.dart' show FieldElement;
+import '../elements/elements.dart' show
+    FieldElement;
 import '../resolution/operators.dart';
-import '../universe/universe.dart';
+import '../universe/call_structure.dart' show
+    CallStructure;
 import 'serialization.dart';
 import 'keys.dart';
 
diff --git a/pkg/compiler/lib/src/serialization/element_serialization.dart b/pkg/compiler/lib/src/serialization/element_serialization.dart
index 9ba4db8..6e7f5d4 100644
--- a/pkg/compiler/lib/src/serialization/element_serialization.dart
+++ b/pkg/compiler/lib/src/serialization/element_serialization.dart
@@ -4,11 +4,11 @@
 
 library dart2js.serialization.elements;
 
+import '../common.dart';
+import '../constants/constructors.dart';
 import '../constants/expressions.dart';
 import '../dart_types.dart';
-import '../dart2jslib.dart' show SourceSpan;
 import '../elements/elements.dart';
-import '../tree/tree.dart';
 import 'constant_serialization.dart';
 import 'keys.dart';
 import 'modelz.dart';
@@ -37,6 +37,9 @@
   TYPEVARIABLE,
   PARAMETER,
   INITIALIZING_FORMAL,
+  IMPORT,
+  EXPORT,
+  PREFIX,
 }
 
 /// Set of serializers used to serialize different kinds of elements by
@@ -56,6 +59,9 @@
     const TypedefSerializer(),
     const TypeVariableSerializer(),
     const ParameterSerializer(),
+    const ImportSerializer(),
+    const ExportSerializer(),
+    const PrefixSerializer(),
 ];
 
 /// Interface for a function that can serialize a set of element kinds.
@@ -148,32 +154,22 @@
                  SerializedElementKind kind) {
     encoder.setUri(
         Key.CANONICAL_URI, element.canonicalUri, element.canonicalUri);
-    encoder.setString(Key.LIBRARY_NAME, element.getLibraryName());
+    encoder.setString(Key.LIBRARY_NAME, element.libraryName);
     SerializerUtil.serializeMembers(element, encoder);
     encoder.setElement(Key.COMPILATION_UNIT, element.entryCompilationUnit);
     encoder.setElements(
         Key.COMPILATION_UNITS, element.compilationUnits.toList());
-    ListEncoder tags = encoder.createList(Key.TAGS);
+    encoder.setElements(Key.IMPORTS, element.imports);
+    encoder.setElements(Key.EXPORTS, element.exports);
 
-    for (LibraryTag tag in element.tags) {
-      if (tag is Import) {
-        ObjectEncoder importTag = tags.createObject();
-        importTag.setString(Key.KIND, 'import');
-        importTag.setElement(Key.LIBRARY, element.getLibraryFromTag(tag));
-      } else if (tag is Export) {
-        ObjectEncoder exportTag = tags.createObject();
-        exportTag.setString(Key.KIND, 'export');
-        exportTag.setElement(Key.LIBRARY, element.getLibraryFromTag(tag));
-      }
-    }
+    List<Element> importedElements = <Element>[];
+    element.forEachImport(SerializerUtil.flattenElements(importedElements));
+    encoder.setElements(Key.IMPORT_SCOPE, importedElements);
 
-    List<Element> imports = <Element>[];
-    element.forEachImport(SerializerUtil.flattenElements(imports));
-    encoder.setElements(Key.IMPORTS, imports);
+    List<Element> exportedElements = <Element>[];
+    element.forEachExport(SerializerUtil.flattenElements(exportedElements));
+    encoder.setElements(Key.EXPORT_SCOPE, exportedElements);
 
-    List<Element> exports = <Element>[];
-    element.forEachExport(SerializerUtil.flattenElements(exports));
-    encoder.setElements(Key.EXPORTS, exports);
   }
 }
 
@@ -423,6 +419,75 @@
   }
 }
 
+class ImportSerializer implements ElementSerializer {
+  const ImportSerializer();
+
+  SerializedElementKind getSerializedKind(Element element) {
+    if (element.isImport) {
+      return SerializedElementKind.IMPORT;
+    }
+    return null;
+  }
+
+  void serialize(ImportElement element,
+                 ObjectEncoder encoder,
+                 SerializedElementKind kind) {
+    encoder.setElement(Key.LIBRARY, element.library);
+    encoder.setElement(Key.COMPILATION_UNIT, element.compilationUnit);
+    encoder.setElement(Key.LIBRARY_DEPENDENCY, element.importedLibrary);
+    if (element.prefix != null) {
+      encoder.setElement(Key.PREFIX, element.prefix);
+    }
+    encoder.setBool(Key.IS_DEFERRED, element.isDeferred);
+    // TODO(johnniwinther): What is the base for the URI?
+    encoder.setUri(Key.URI, element.uri, element.uri);
+  }
+}
+
+class ExportSerializer implements ElementSerializer {
+  const ExportSerializer();
+
+  SerializedElementKind getSerializedKind(Element element) {
+    if (element.isExport) {
+      return SerializedElementKind.EXPORT;
+    }
+    return null;
+  }
+
+  void serialize(ExportElement element,
+                 ObjectEncoder encoder,
+                 SerializedElementKind kind) {
+    encoder.setElement(Key.LIBRARY, element.library);
+    encoder.setElement(Key.COMPILATION_UNIT, element.compilationUnit);
+    encoder.setElement(Key.LIBRARY_DEPENDENCY, element.exportedLibrary);
+    // TODO(johnniwinther): What is the base for the URI?
+    encoder.setUri(Key.URI, element.uri, element.uri);
+  }
+}
+
+class PrefixSerializer implements ElementSerializer {
+  const PrefixSerializer();
+
+  SerializedElementKind getSerializedKind(Element element) {
+    if (element.isPrefix) {
+      return SerializedElementKind.PREFIX;
+    }
+    return null;
+  }
+
+  void serialize(PrefixElement element,
+                 ObjectEncoder encoder,
+                 SerializedElementKind kind) {
+    encoder.setString(Key.NAME, element.name);
+    encoder.setElement(Key.LIBRARY, element.library);
+    encoder.setElement(Key.COMPILATION_UNIT, element.compilationUnit);
+    if (element.deferredImport != null) {
+      encoder.setElement(Key.IMPORT, element.deferredImport);
+    }
+    encoder.setBool(Key.IS_DEFERRED, element.isDeferred);
+  }
+}
+
 /// Utility class for deserializing [Element]s.
 ///
 /// This is used by the [Deserializer].
@@ -480,6 +545,12 @@
         return new ParameterElementZ(decoder);
       case SerializedElementKind.INITIALIZING_FORMAL:
         return new InitializingFormalElementZ(decoder);
+      case SerializedElementKind.IMPORT:
+        return new ImportElementZ(decoder);
+      case SerializedElementKind.EXPORT:
+        return new ExportElementZ(decoder);
+      case SerializedElementKind.PREFIX:
+        return new PrefixElementZ(decoder);
     }
     throw new UnsupportedError("Unexpected element kind '${elementKind}.");
   }
diff --git a/pkg/compiler/lib/src/serialization/keys.dart b/pkg/compiler/lib/src/serialization/keys.dart
index a3c276e..de1af42 100644
--- a/pkg/compiler/lib/src/serialization/keys.dart
+++ b/pkg/compiler/lib/src/serialization/keys.dart
@@ -23,17 +23,21 @@
   static const Key ELEMENT = const Key('element');
   static const Key ELEMENTS = const Key('elements');
   static const Key EXPORTS = const Key('exports');
+  static const Key EXPORT_SCOPE = const Key('export-scope');
   static const Key EXPRESSION = const Key('expression');
   static const Key FALSE = const Key('false');
   static const Key FIELD = const Key('field');
   static const Key FIELDS = const Key('fields');
   static const Key FUNCTION = const Key('function');
   static const Key ID = const Key('id');
+  static const Key IMPORT = const Key('import');
   static const Key IMPORTS = const Key('imports');
+  static const Key IMPORT_SCOPE = const Key('import-scope');
   static const Key INTERFACES = const Key('interfaces');
   static const Key INDEX = const Key('index');
   static const Key IS_ABSTRACT = const Key('isAbstract');
   static const Key IS_CONST = const Key('isConst');
+  static const Key IS_DEFERRED = const Key('isDeferred');
   static const Key IS_EXTERNAL = const Key('isExternal');
   static const Key IS_FINAL = const Key('isFinal');
   static const Key IS_NAMED = const Key('isNamed');
@@ -44,6 +48,7 @@
   static const Key LEFT = const Key('left');
   static const Key LENGTH = const Key('length');
   static const Key LIBRARY = const Key('library');
+  static const Key LIBRARY_DEPENDENCY = const Key('library-dependency');
   static const Key LIBRARY_NAME = const Key('library-name');
   static const Key MEMBERS = const Key('members');
   static const Key NAME = const Key('name');
@@ -57,6 +62,7 @@
       const Key('optional-parameter-types');
   static const Key PARAMETERS = const Key('parameters');
   static const Key PARAMETER_TYPES = const Key('parameter-types');
+  static const Key PREFIX = const Key('prefix');
   static const Key RETURN_TYPE = const Key('return-type');
   static const Key RIGHT = const Key('right');
   static const Key SUPERTYPE = const Key('supertype');
diff --git a/pkg/compiler/lib/src/serialization/modelz.dart b/pkg/compiler/lib/src/serialization/modelz.dart
index 15bfc1e..86d27901 100644
--- a/pkg/compiler/lib/src/serialization/modelz.dart
+++ b/pkg/compiler/lib/src/serialization/modelz.dart
@@ -9,29 +9,37 @@
 
 library dart2js.serialization.modelz;
 
-import 'serialization.dart';
-import 'keys.dart';
+import '../common.dart';
+import '../common/resolution.dart' show
+    Resolution;
+import '../compiler.dart'
+    show Compiler;
+import '../constants/constructors.dart';
 import '../constants/expressions.dart';
-import '../dart2jslib.dart'
-    show Backend,
-         Compiler,
-         DiagnosticListener,
-         Script,
-         SourceSpan;
 import '../dart_types.dart';
 import '../elements/elements.dart';
-import '../elements/modelx.dart' show FunctionSignatureX;
+import '../elements/modelx.dart' show
+    FunctionSignatureX;
 import '../elements/common.dart';
 import '../elements/visitor.dart';
-import '../ordered_typeset.dart';
-import '../resolution/resolution.dart';
-import '../resolution/class_members.dart' as class_members;
-import '../resolution/enum_creator.dart' show AstBuilder;
-import '../scanner/scannerlib.dart' show Token, SEMICOLON_INFO;
-import '../serialization/constant_serialization.dart';
 import '../io/source_file.dart';
+import '../ordered_typeset.dart';
+import '../resolution/class_members.dart' as class_members;
+import '../resolution/tree_elements.dart' show
+    TreeElements;
+import '../resolution/scope.dart' show
+    Scope;
+import '../script.dart';
+import '../serialization/constant_serialization.dart';
+import '../tokens/token.dart' show
+    Token;
 import '../tree/tree.dart';
-import '../util/util.dart' show Link, LinkBuilder;
+import '../util/util.dart' show
+    Link,
+    LinkBuilder;
+
+import 'keys.dart';
+import 'serialization.dart';
 
 /// Compute a [Link] from an [Iterable].
 Link toLink(Iterable iterable) {
@@ -79,11 +87,6 @@
   ClassElement get contextClass => _unsupported('contextClass');
 
   @override
-  void diagnose(Element context, DiagnosticListener listener) {
-    _unsupported('diagnose');
-  }
-
-  @override
   ClassElement get enclosingClass => null;
 
   @override
@@ -134,6 +137,12 @@
   bool get isNative => false;
 
   @override
+  bool get isJsInterop => false;
+
+  @override
+  String get jsInteropName => null;
+
+  @override
   bool get isOperator => false;
 
   @override
@@ -148,7 +157,7 @@
 
   // TODO(johnniwinther): Support metadata.
   @override
-  Link<MetadataAnnotation> get metadata => const Link<MetadataAnnotation>();
+  Iterable<MetadataAnnotation> get metadata => const <MetadataAnnotation>[];
 
   @override
   Element get outermostEnclosingMemberOrTopLevel {
@@ -364,7 +373,8 @@
   Uri _canonicalUri;
   CompilationUnitElement _entryCompilationUnit;
   Link<CompilationUnitElement> _compilationUnits;
-  Link<Element> _exports;
+  List<ImportElement> _imports;
+  List<ExportElement> _exports;
   ListedContainer _exportsMap;
   ListedContainer _importsMap;
   Map<LibraryTag, LibraryElement> _libraryDependencies;
@@ -415,12 +425,12 @@
   }
 
   @override
-  bool hasLibraryName() {
-    return getLibraryName() != '';
+  bool get hasLibraryName {
+    return libraryName != '';
   }
 
   @override
-  String getLibraryName() {
+  String get libraryName {
     return _decoder.getString(Key.LIBRARY_NAME);
   }
 
@@ -428,20 +438,15 @@
   bool get exportsHandled => true;
 
   void _ensureExports() {
-    if (_exports == null) {
-      _exportsMap = new ListedContainer(_decoder.getElements(Key.EXPORTS));
-      _exports = toLink(_exportsMap.values);
+    if (_exportsMap == null) {
+      _exportsMap = new ListedContainer(_decoder.getElements(Key.EXPORT_SCOPE));
     }
   }
 
-  Link<Element> get exports {
-    _ensureExports();
-    return _exports;
-  }
-
   @override
   void forEachExport(f(Element element)) {
-    exports.forEach(f);
+    _ensureExports();
+    _exportsMap.forEach(f);
   }
 
   @override
@@ -459,51 +464,6 @@
     return localLookup(elementName);
   }
 
-  void _ensureLibraryDependencies() {
-    if (_libraryDependencies == null) {
-      _libraryDependencies = <LibraryTag, LibraryElement>{};
-      ListDecoder tags = _decoder.getList(Key.TAGS);
-      AstBuilder builder = new AstBuilder(0);
-      for (int i = 0; i < tags.length; i++) {
-        ObjectDecoder dependency = tags.getObject(i);
-        String kind = dependency.getString(Key.KIND);
-        LibraryElement library = dependency.getElement(Key.LIBRARY);
-        // TODO(johnniwinther): Add `ImportElement` and `ExportElement` to the
-        // element model to avoid hacking up nodes.
-        if (kind == 'import') {
-          Import tag = new Import(
-              builder.keywordToken('import'),
-              builder.literalString(library.canonicalUri.toString())
-                  ..getEndToken().next = builder.symbolToken(SEMICOLON_INFO),
-              null, // prefix
-              null, // combinators
-              null, // metadata
-              isDeferred: false);
-          _libraryDependencies[tag] = library;
-        } else if (kind == 'export') {
-          Export tag = new Export(
-              builder.keywordToken('export'),
-              builder.literalString(library.canonicalUri.toString())
-                  ..getEndToken().next = builder.symbolToken(SEMICOLON_INFO),
-              null,  // combinators
-              null); // metadata
-          _libraryDependencies[tag] = library;
-        }
-      }
-    }
-  }
-
-  @override
-  Iterable<LibraryTag> get tags {
-    _ensureLibraryDependencies();
-    return _libraryDependencies.keys;
-  }
-
-  LibraryElement getLibraryFromTag(LibraryDependency tag) {
-    _ensureLibraryDependencies();
-    return _libraryDependencies[tag];
-  }
-
   @override
   bool get canUseNative => false;
 
@@ -512,7 +472,7 @@
 
   void _ensureImports() {
     if (_importsMap == null) {
-      _importsMap = new ListedContainer(_decoder.getElements(Key.IMPORTS));
+      _importsMap = new ListedContainer(_decoder.getElements(Key.IMPORT_SCOPE));
     }
   }
 
@@ -523,14 +483,29 @@
   }
 
   @override
-  Link<Import> getImportsFor(Element element) => _unsupported('getImportsFor');
-
-  @override
-  LibraryName get libraryTag => _unsupported('libraryTag');
+  Iterable<ImportElement> getImportsFor(Element element) {
+    return _unsupported('getImportsFor');
+  }
 
   String toString() {
     return 'Zlibrary(${canonicalUri})';
   }
+
+  @override
+  Iterable<ExportElement> get exports {
+    if (_exports == null) {
+      _exports = _decoder.getElements(Key.EXPORTS, isOptional: true);
+    }
+    return _exports;
+  }
+
+  @override
+  Iterable<ImportElement> get imports {
+    if (_imports == null) {
+      _imports = _decoder.getElements(Key.IMPORTS, isOptional: true);
+    }
+    return _imports;
+  }
 }
 
 class ScriptZ implements Script {
@@ -694,7 +669,7 @@
   }
 
   @override
-  DartType computeType(Compiler compiler) => type;
+  DartType computeType(Resolution resolution) => type;
 }
 
 abstract class ParametersMixin
@@ -927,6 +902,11 @@
 
   @override
   ClassElement get superclass => supertype != null ? supertype.element : null;
+
+  @override
+  void ensureResolved(Resolution resolution) {
+    resolution.registerClass(this);
+  }
 }
 
 abstract class ConstructorElementZ extends DeserializedElementZ
@@ -1223,6 +1203,14 @@
   List<DartType> _typeVariables;
   T _rawType;
   T _thisType;
+  Name _memberName;
+
+  Name get memberName {
+    if (_memberName == null) {
+      _memberName = new Name(name, library);
+    }
+    return _memberName;
+  }
 
   void _ensureTypes() {
     if (_typeVariables == null) {
@@ -1255,13 +1243,10 @@
   }
 
   @override
-  T computeType(Compiler compiler) => thisType;
+  T computeType(Resolution resolution) => thisType;
 
   @override
   bool get isResolved => true;
-
-  @override
-  void ensureResolved(Compiler compiler) {}
 }
 
 class TypedefElementZ extends DeserializedElementZ
@@ -1297,7 +1282,10 @@
   }
 
   @override
-  void checkCyclicReference(Compiler compiler) {}
+  void ensureResolved(Resolution resolution) {}
+
+  @override
+  void checkCyclicReference(Resolution resolution) {}
 }
 
 class TypeVariableElementZ extends DeserializedElementZ
@@ -1308,10 +1296,18 @@
   TypeDeclarationElement _typeDeclaration;
   TypeVariableType _type;
   DartType _bound;
+  Name _memberName;
 
   TypeVariableElementZ(ObjectDecoder decoder)
       : super(decoder);
 
+  Name get memberName {
+    if (_memberName == null) {
+      _memberName = new Name(name, library);
+    }
+    return _memberName;
+  }
+
   @override
   ElementKind get kind => ElementKind.TYPE_VARIABLE;
 
@@ -1422,7 +1418,6 @@
   MemberElement get memberContext => executableContext.memberContext;
 }
 
-
 class InitializingFormalElementZ extends ParameterElementZ
     implements InitializingFormalElement {
   FieldElement _fieldElement;
@@ -1445,5 +1440,142 @@
 
   @override
   ElementKind get kind => ElementKind.INITIALIZING_FORMAL;
+}
 
+class ImportElementZ extends DeserializedElementZ
+    with LibraryMemberMixin implements ImportElement {
+  bool _isDeferred;
+  PrefixElement _prefix;
+  LibraryElement _importedLibrary;
+  Uri _uri;
+
+  ImportElementZ(ObjectDecoder decoder)
+      : super(decoder);
+
+  @override
+  String get name => '';
+
+  @override
+  accept(ElementVisitor visitor, arg) => visitor.visitImportElement(this, arg);
+
+  @override
+  ElementKind get kind => ElementKind.IMPORT;
+
+  @override
+  LibraryElement get importedLibrary {
+    if (_importedLibrary == null) {
+      _importedLibrary = _decoder.getElement(Key.LIBRARY_DEPENDENCY);
+    }
+    return _importedLibrary;
+  }
+
+  void _ensurePrefixResolved() {
+    if (_isDeferred == null) {
+      _isDeferred = _decoder.getBool(Key.IS_DEFERRED);
+      _prefix = _decoder.getElement(Key.PREFIX, isOptional: true);
+    }
+  }
+
+  @override
+  bool get isDeferred {
+    _ensurePrefixResolved();
+    return _isDeferred;
+  }
+
+  @override
+  PrefixElement get prefix {
+    _ensurePrefixResolved();
+    return _prefix;
+  }
+
+  @override
+  Uri get uri {
+    if (_uri == null) {
+      _uri = _decoder.getUri(Key.URI);
+    }
+    return _uri;
+  }
+
+  @override
+  Import get node => _unsupported('node');
+
+  String toString() => 'Z$kind($uri)';
+}
+
+class ExportElementZ extends DeserializedElementZ
+    with LibraryMemberMixin implements ExportElement {
+  LibraryElement _exportedLibrary;
+  Uri _uri;
+
+  ExportElementZ(ObjectDecoder decoder)
+      : super(decoder);
+
+  @override
+  String get name => '';
+
+  @override
+  accept(ElementVisitor visitor, arg) => visitor.visitExportElement(this, arg);
+
+  @override
+  ElementKind get kind => ElementKind.EXPORT;
+
+  @override
+  LibraryElement get exportedLibrary {
+    if (_exportedLibrary == null) {
+      _exportedLibrary = _decoder.getElement(Key.LIBRARY_DEPENDENCY);
+    }
+    return _exportedLibrary;
+  }
+
+  @override
+  Uri get uri {
+    if (_uri == null) {
+      _uri = _decoder.getUri(Key.URI);
+    }
+    return _uri;
+  }
+
+  @override
+  Export get node => _unsupported('node');
+
+  String toString() => 'Z$kind($uri)';
+}
+
+class PrefixElementZ extends DeserializedElementZ
+    with LibraryMemberMixin implements PrefixElement {
+  bool _isDeferred;
+  ImportElement _deferredImport;
+
+  PrefixElementZ(ObjectDecoder decoder)
+      : super(decoder);
+
+  @override
+  accept(ElementVisitor visitor, arg) => visitor.visitPrefixElement(this, arg);
+
+  void _ensureDeferred() {
+    if (_isDeferred == null) {
+      _isDeferred = _decoder.getBool(Key.IS_DEFERRED);
+      _deferredImport = _decoder.getElement(Key.IMPORT, isOptional: true);
+    }
+  }
+
+  @override
+  ImportElement get deferredImport {
+    _ensureDeferred();
+    return _deferredImport;
+  }
+
+  @override
+  bool get isDeferred {
+    _ensureDeferred();
+    return _isDeferred;
+  }
+
+  @override
+  ElementKind get kind => ElementKind.PREFIX;
+
+  @override
+  Element lookupLocalMember(String memberName) {
+    return _unsupported('lookupLocalMember');
+  }
 }
\ No newline at end of file
diff --git a/pkg/compiler/lib/src/serialization/task.dart b/pkg/compiler/lib/src/serialization/task.dart
index d82bb7e..2b86c5e 100644
--- a/pkg/compiler/lib/src/serialization/task.dart
+++ b/pkg/compiler/lib/src/serialization/task.dart
@@ -4,8 +4,18 @@
 
 library dart2js.serialization.task;
 
-import '../dart2jslib.dart';
+import '../common/resolution.dart' show
+    ResolutionWorkItem;
+import '../common/tasks.dart' show
+    CompilerTask;
+import '../common/work.dart' show
+    ItemCompilationContext;
+import '../compiler.dart' show
+    Compiler;
 import '../elements/elements.dart';
+import '../enqueue.dart' show
+    ResolutionEnqueuer,
+    WorldImpact;
 
 /// Task that supports deserialization of elements.
 class SerializationTask extends CompilerTask {
@@ -55,7 +65,7 @@
   @override
   WorldImpact run(Compiler compiler, ResolutionEnqueuer world) {
     _isAnalyzed = true;
-    world.registerResolvedElement(element);
+    world.registerProcessedElement(element);
     return worldImpact;
   }
 }
diff --git a/pkg/compiler/lib/src/ssa/builder.dart b/pkg/compiler/lib/src/ssa/builder.dart
index 435b4bb..0258d7d 100644
--- a/pkg/compiler/lib/src/ssa/builder.dart
+++ b/pkg/compiler/lib/src/ssa/builder.dart
@@ -5,15 +5,17 @@
 part of ssa;
 
 class SsaFunctionCompiler implements FunctionCompiler {
-  SsaCodeGeneratorTask generator;
-  SsaBuilderTask builder;
-  SsaOptimizerTask optimizer;
+  final SsaCodeGeneratorTask generator;
+  final SsaBuilderTask builder;
+  final SsaOptimizerTask optimizer;
+  final JavaScriptBackend backend;
 
   SsaFunctionCompiler(JavaScriptBackend backend,
                       SourceInformationStrategy sourceInformationFactory)
       : generator = new SsaCodeGeneratorTask(backend, sourceInformationFactory),
         builder = new SsaBuilderTask(backend, sourceInformationFactory),
-        optimizer = new SsaOptimizerTask(backend);
+        optimizer = new SsaOptimizerTask(backend),
+        backend = backend;
 
   /// Generates JavaScript code for `work.element`.
   /// Using the ssa builder, optimizer and codegenerator.
@@ -23,55 +25,7 @@
     Element element = work.element;
     js.Expression result = generator.generateCode(work, graph);
     if (element is FunctionElement) {
-      JavaScriptBackend backend = builder.backend;
-
-      AsyncRewriterBase rewriter = null;
-      js.Name name = backend.namer.methodPropertyName(element);
-      if (element.asyncMarker == AsyncMarker.ASYNC) {
-        rewriter = new AsyncRewriter(
-            backend.compiler,
-            backend.compiler.currentElement,
-            asyncHelper:
-                backend.emitter.staticFunctionAccess(backend.getAsyncHelper()),
-            newCompleter: backend.emitter.staticFunctionAccess(
-                backend.getCompleterConstructor()),
-            safeVariableName: backend.namer.safeVariablePrefixForAsyncRewrite,
-            bodyName: backend.namer.deriveAsyncBodyName(name));
-      } else if (element.asyncMarker == AsyncMarker.SYNC_STAR) {
-        rewriter = new SyncStarRewriter(
-            backend.compiler,
-            backend.compiler.currentElement,
-            endOfIteration: backend.emitter.staticFunctionAccess(
-                backend.getEndOfIteration()),
-            newIterable: backend.emitter.staticFunctionAccess(
-                backend.getSyncStarIterableConstructor()),
-            yieldStarExpression: backend.emitter.staticFunctionAccess(
-                backend.getYieldStar()),
-            uncaughtErrorExpression: backend.emitter.staticFunctionAccess(
-                backend.getSyncStarUncaughtError()),
-            safeVariableName: backend.namer.safeVariablePrefixForAsyncRewrite,
-            bodyName: backend.namer.deriveAsyncBodyName(name));
-      }
-      else if (element.asyncMarker == AsyncMarker.ASYNC_STAR) {
-        rewriter = new AsyncStarRewriter(
-            backend.compiler,
-            backend.compiler.currentElement,
-            asyncStarHelper: backend.emitter.staticFunctionAccess(
-                backend.getAsyncStarHelper()),
-            streamOfController: backend.emitter.staticFunctionAccess(
-                backend.getStreamOfController()),
-            newController: backend.emitter.staticFunctionAccess(
-                backend.getASyncStarControllerConstructor()),
-            safeVariableName: backend.namer.safeVariablePrefixForAsyncRewrite,
-            yieldExpression: backend.emitter.staticFunctionAccess(
-                backend.getYieldSingle()),
-            yieldStarExpression: backend.emitter.staticFunctionAccess(
-                backend.getYieldStar()),
-            bodyName: backend.namer.deriveAsyncBodyName(name));
-      }
-      if (rewriter != null) {
-        result = rewriter.rewrite(result);
-      }
+      result = backend.rewriteAsync(element, result);
     }
     return result;
   }
@@ -106,44 +60,29 @@
       backend = backend,
       super(backend.compiler);
 
+  DiagnosticReporter get reporter => compiler.reporter;
+
   HGraph build(CodegenWorkItem work) {
     return measure(() {
       Element element = work.element.implementation;
-      return compiler.withCurrentElement(element, () {
-        HInstruction.idCounter = 0;
+      return reporter.withCurrentElement(element, () {
         SsaBuilder builder =
-            new SsaBuilder(
-                backend, work, emitter.nativeEmitter,
+            new SsaBuilder(work.element.implementation,
+                work.resolutionTree, work.compilationContext, work.registry,
+                backend, emitter.nativeEmitter,
                 sourceInformationFactory);
-        HGraph graph;
-        ElementKind kind = element.kind;
-        if (kind == ElementKind.GENERATIVE_CONSTRUCTOR) {
-          graph = compileConstructor(builder, work);
-        } else if (kind == ElementKind.GENERATIVE_CONSTRUCTOR_BODY ||
-                   kind == ElementKind.FUNCTION ||
-                   kind == ElementKind.GETTER ||
-                   kind == ElementKind.SETTER) {
-          graph = builder.buildMethod(element);
-        } else if (kind == ElementKind.FIELD) {
-          if (element.isInstanceMember) {
-            assert(compiler.enableTypeAssertions);
-            graph = builder.buildCheckedSetter(element);
-          } else {
-            graph = builder.buildLazyInitializer(element);
-          }
-        } else {
-          compiler.internalError(element, 'Unexpected element kind $kind.');
-        }
-        assert(graph.isValid());
-        if (!identical(kind, ElementKind.FIELD)) {
+        HGraph graph = builder.build();
+
+        // Default arguments are handled elsewhere, but we must ensure
+        // that the default values are computed during codegen.
+        if (!identical(element.kind, ElementKind.FIELD)) {
           FunctionElement function = element;
           FunctionSignature signature = function.functionSignature;
           signature.forEachOptionalParameter((ParameterElement parameter) {
             // This ensures the default value will be computed.
             ConstantValue constant =
                 backend.constants.getConstantValueForVariable(parameter);
-            CodegenRegistry registry = work.registry;
-            registry.registerCompileTimeConstant(constant);
+            work.registry.registerCompileTimeConstant(constant);
           });
         }
         if (compiler.tracer.isEnabled) {
@@ -167,9 +106,6 @@
     });
   }
 
-  HGraph compileConstructor(SsaBuilder builder, CodegenWorkItem work) {
-    return builder.buildFactory(work.element);
-  }
 }
 
 /**
@@ -485,10 +421,10 @@
     if (isAccessedDirectly(local)) {
       if (directLocals[local] == null) {
         if (local is TypeVariableElement) {
-          builder.compiler.internalError(builder.compiler.currentElement,
+          builder.reporter.internalError(builder.compiler.currentElement,
               "Runtime type information not available for $local.");
         } else {
-          builder.compiler.internalError(local,
+          builder.reporter.internalError(local,
               "Cannot find value $local.");
         }
       }
@@ -838,17 +774,17 @@
 // used as the target of a break, and therefore doesn't need a break
 // handler associated with it.
 class NullJumpHandler implements JumpHandler {
-  final Compiler compiler;
+  final DiagnosticReporter reporter;
 
-  NullJumpHandler(this.compiler);
+  NullJumpHandler(this.reporter);
 
   void generateBreak([LabelDefinition label]) {
-    compiler.internalError(CURRENT_ELEMENT_SPANNABLE,
+    reporter.internalError(CURRENT_ELEMENT_SPANNABLE,
         'NullJumpHandler.generateBreak should not be called.');
   }
 
   void generateContinue([LabelDefinition label]) {
-    compiler.internalError(CURRENT_ELEMENT_SPANNABLE,
+    reporter.internalError(CURRENT_ELEMENT_SPANNABLE,
         'NullJumpHandler.generateContinue should not be called.');
   }
 
@@ -1036,23 +972,50 @@
  */
 class SsaBuilder extends ast.Visitor
     with BaseImplementationOfCompoundsMixin,
+         BaseImplementationOfSetIfNullsMixin,
          SendResolverMixin,
          SemanticSendResolvedMixin,
          NewBulkMixin,
          ErrorBulkMixin
     implements SemanticSendVisitor {
+
+  /// The element for which this SSA builder is being used.
+  final Element target;
+
+  /// Reference to resolved elements in [target]'s AST.
+  TreeElements elements;
+
+  /// Used to report information about inlining (which occurs while building the
+  /// SSA graph), when dump-info is enabled.
+  final InfoReporter infoReporter;
+
+  /// If not null, the builder will store in [context] data that is used later
+  /// during the optimization phases.
+  final JavaScriptItemCompilationContext context;
+
+  /// Registry used to enqueue work during codegen, may be null to avoid
+  /// enqueing any work.
+  // TODO(sigmund,johnniwinther): get rid of registry entirely. We should be
+  // able to return the impact as a result after building and avoid enqueing
+  // things here. Later the codegen task can decide whether to enqueue
+  // something. In the past this didn't matter as much because the SSA graph was
+  // used only for codegen, but currently we want to experiment using it for
+  // code-analysis too.
+  final CodegenRegistry registry;
   final Compiler compiler;
   final JavaScriptBackend backend;
   final ConstantSystem constantSystem;
-  final CodegenWorkItem work;
   final RuntimeTypes rti;
-  TreeElements elements;
+
   SourceInformationBuilder sourceInformationBuilder;
+
   bool inLazyInitializerExpression = false;
 
+  // TODO(sigmund): make all comments /// instead of /* */
   /* This field is used by the native handler. */
   final NativeEmitter nativeEmitter;
 
+  /// Holds the resulting SSA graph.
   final HGraph graph = new HGraph();
 
   /**
@@ -1132,23 +1095,29 @@
             element.asyncMarker == AsyncMarker.ASYNC);
   }
 
-  SsaBuilder(JavaScriptBackend backend,
-             CodegenWorkItem work,
-             this.nativeEmitter,
-             SourceInformationStrategy sourceInformationFactory)
+  // TODO(sigmund): make most args optional
+  SsaBuilder(this.target, this.elements, this.context, this.registry,
+      JavaScriptBackend backend, this.nativeEmitter,
+      SourceInformationStrategy sourceInformationFactory)
     : this.compiler = backend.compiler,
+      this.infoReporter = backend.compiler.dumpInfoTask,
       this.backend = backend,
       this.constantSystem = backend.constantSystem,
-      this.work = work,
-      this.rti = backend.rti,
-      this.elements = work.resolutionTree {
-    localsHandler = new LocalsHandler(this, work.element, null);
-    sourceElementStack.add(work.element);
-    sourceInformationBuilder =
-        sourceInformationFactory.createBuilderForContext(
-            work.element.implementation);
+      this.rti = backend.rti {
+    assert(target.isImplementation);
+    graph.element = target;
+    localsHandler = new LocalsHandler(this, target, null);
+    sourceElementStack.add(target);
+    sourceInformationBuilder = sourceInformationFactory.createBuilderForContext(
+            target);
   }
 
+  BackendHelpers get helpers => backend.helpers;
+
+  RuntimeTypesEncoder get rtiEncoder => backend.rtiEncoder;
+
+  DiagnosticReporter get reporter => compiler.reporter;
+
   @override
   SemanticSendVisitor get sendVisitor => this;
 
@@ -1162,8 +1131,6 @@
     node.accept(this);
   }
 
-  CodegenRegistry get registry => work.registry;
-
   /// Returns the current source element.
   ///
   /// The returned element is a declaration element.
@@ -1174,6 +1141,36 @@
   bool get _checkOrTrustTypes =>
       compiler.enableTypeAssertions || compiler.trustTypeAnnotations;
 
+  /// Build the graph for [target].
+  HGraph build() {
+    assert(invariant(target, target.isImplementation));
+    HInstruction.idCounter = 0;
+    ElementKind kind = target.kind;
+    // TODO(sigmund): remove `result` and return graph directly, need to ensure
+    // that it can never be null (see result in buildFactory for instance).
+    var result;
+    if (kind == ElementKind.GENERATIVE_CONSTRUCTOR) {
+      result = buildFactory(target);
+    } else if (kind == ElementKind.GENERATIVE_CONSTRUCTOR_BODY ||
+               kind == ElementKind.FUNCTION ||
+               kind == ElementKind.GETTER ||
+               kind == ElementKind.SETTER) {
+      result = buildMethod(target);
+    } else if (kind == ElementKind.FIELD) {
+      if (target.isInstanceMember) {
+        assert(compiler.enableTypeAssertions);
+        result = buildCheckedSetter(target);
+      } else {
+        result = buildLazyInitializer(target);
+      }
+    } else {
+      reporter.internalError(target, 'Unexpected element kind $kind.');
+    }
+    assert(result.isValid());
+    return result;
+  }
+
+
   HBasicBlock addNewBlock() {
     HBasicBlock block = graph.addNewBlock();
     // If adding a new block during building of an expression, it is due to
@@ -1342,6 +1339,11 @@
     // enqueued.
     backend.registerStaticUse(element, compiler.enqueuer.codegen);
 
+    if (element.isJsInterop && !element.isFactoryConstructor) {
+      // We only inline factory JavaScript interop constructors.
+      return false;
+    }
+
     // Ensure that [element] is an implementation element.
     element = element.implementation;
 
@@ -1372,6 +1374,8 @@
         }
       }
 
+      if (element.isJsInterop) return false;
+
       // Don't inline operator== methods if the parameter can be null.
       if (element.name == '==') {
         if (element.enclosingClass != compiler.objectClass
@@ -1407,14 +1411,16 @@
 
     bool doesNotContainCode() {
       // A function with size 1 does not contain any code.
-      return InlineWeeder.canBeInlined(function, 1, true);
+      return InlineWeeder.canBeInlined(function, 1, true,
+          enableUserAssertions: compiler.enableUserAssertions);
     }
 
     bool reductiveHeuristic() {
       // The call is on a path which is executed rarely, so inline only if it
       // does not make the program larger.
       if (isCalledOnce(element)) {
-        return InlineWeeder.canBeInlined(function, -1, false);
+        return InlineWeeder.canBeInlined(function, -1, false,
+            enableUserAssertions: compiler.enableUserAssertions);
       }
       // TODO(sra): Measure if inlining would 'reduce' the size.  One desirable
       // case we miss by doing nothing is inlining very simple constructors
@@ -1452,7 +1458,8 @@
         // We may have forced the inlining of some methods. Therefore check
         // if we can inline this method regardless of size.
         assert(InlineWeeder.canBeInlined(function, -1, false,
-                                         allowLoops: true));
+                allowLoops: true,
+                enableUserAssertions: compiler.enableUserAssertions));
         return true;
       }
 
@@ -1475,7 +1482,8 @@
       }
       bool canInline;
       canInline = InlineWeeder.canBeInlined(
-          function, maxInliningNodes, useMaxInliningNodes);
+          function, maxInliningNodes, useMaxInliningNodes,
+          enableUserAssertions: compiler.enableUserAssertions);
       if (canInline) {
         backend.inlineCache.markAsInlinable(element, insideLoop: insideLoop);
       } else {
@@ -1512,9 +1520,8 @@
 
     if (meetsHardConstraints() && heuristicSayGoodToGo()) {
       doInlining();
-      registry.registerInlining(
-          element,
-          compiler.currentElement);
+      infoReporter?.reportInlined(element,
+          inliningStack.isEmpty ? target : inliningStack.last.function);
       return true;
     }
 
@@ -1533,7 +1540,7 @@
 
   inlinedFrom(Element element, f()) {
     assert(element is FunctionElement || element is VariableElement);
-    return compiler.withCurrentElement(element, () {
+    return reporter.withCurrentElement(element, () {
       // The [sourceElementStack] contains declaration elements.
       SourceInformationBuilder oldSourceInformationBuilder =
           sourceInformationBuilder;
@@ -1547,6 +1554,13 @@
     });
   }
 
+  /**
+   * Return null so it is simple to remove the optional parameters completely
+   * from interop methods to match JavaScript semantics for ommitted arguments.
+   */
+  HInstruction handleConstantForOptionalParameterJsInterop(Element parameter) =>
+      null;
+
   HInstruction handleConstantForOptionalParameter(Element parameter) {
     ConstantValue constantValue =
         backend.constants.getConstantValueForVariable(parameter);
@@ -1565,13 +1579,6 @@
     }
   }
 
-  /**
-   * Returns whether this builder is building code for [element].
-   */
-  bool isBuildingFor(Element element) {
-    return work.element == element;
-  }
-
   /// A stack of [DartType]s the have been seen during inlining of factory
   /// constructors.  These types are preserved in [HInvokeStatic]s and
   /// [HForeignNew]s inside the inline code and registered during code
@@ -1641,10 +1648,19 @@
     graph.calledInLoop = compiler.world.isCalledInLoop(functionElement);
     ast.FunctionExpression function = functionElement.node;
     assert(function != null);
-    assert(!function.modifiers.isExternal);
     assert(elements.getFunctionDefinition(function) != null);
     openFunction(functionElement, function);
     String name = functionElement.name;
+    if (functionElement.isJsInterop) {
+      push(invokeJsInteropFunction(functionElement, parameters.values.toList(),
+          sourceInformationBuilder.buildGeneric(function)));
+      var value = pop();
+      closeAndGotoExit(new HReturn(value,
+          sourceInformationBuilder.buildReturn(functionElement.node)));
+      return closeFunction();
+    }
+    assert(invariant(functionElement, !function.modifiers.isExternal));
+
     // If [functionElement] is `operator==` we explicitely add a null check at
     // the beginning of the method. This is to avoid having call sites do the
     // null check.
@@ -1668,10 +1684,33 @@
             sourceInformation: sourceInformationBuilder.buildIf(function.body));
       }
     }
+    if (const bool.fromEnvironment('unreachable-throw') == true) {
+      var emptyParameters = parameters.values.where((p) =>
+          p.instructionType.isEmpty && !p.instructionType.isNullable);
+      if (emptyParameters.length > 0) {
+        addComment('${emptyParameters} inferred as [empty]');
+        pushInvokeStatic(function.body, backend.assertUnreachableMethod, []);
+        pop();
+        return closeFunction();
+      }
+    }
     function.body.accept(this);
     return closeFunction();
   }
 
+  /// Adds a JavaScript comment to the output. The comment will be omitted in
+  /// minified mode.  Each line in [text] is preceded with `//` and indented.
+  /// Use sparingly. In order for the comment to be retained it is modeled as
+  /// having side effects which will inhibit code motion.
+  // TODO(sra): Figure out how to keep comment anchored without effects.
+  void addComment(String text) {
+    add(new HForeignCode(
+        js.js.statementTemplateYielding(new js.Comment(text)),
+        backend.dynamicType,
+        <HInstruction>[],
+        isStatement: true));
+  }
+
   HGraph buildCheckedSetter(VariableElement field) {
     openFunction(field, field.node);
     HInstruction thisInstruction = localsHandler.readThis();
@@ -1689,10 +1728,10 @@
 
   HGraph buildLazyInitializer(VariableElement variable) {
     inLazyInitializerExpression = true;
-    ast.VariableDefinitions node = variable.node;
-    openFunction(variable, node);
     assert(invariant(variable, variable.initializer != null,
         message: "Non-constant variable $variable has no initializer."));
+    ast.VariableDefinitions node = variable.node;
+    openFunction(variable, node);
     visit(variable.initializer);
     HInstruction value = pop();
     value = potentiallyCheckOrTrustType(value, variable.type);
@@ -1808,6 +1847,7 @@
     stack = <HInstruction>[];
 
     insertTraceCall(function);
+    insertCoverageCall(function);
   }
 
   void restoreState(AstInliningState state) {
@@ -1825,6 +1865,7 @@
    */
   void visitInlinedFunction(FunctionElement function) {
     potentiallyCheckInlinedParameterTypes(function);
+
     if (function.isGenerativeConstructor) {
       buildFactory(function);
     } else {
@@ -1881,7 +1922,7 @@
                              Map<Element, HInstruction> fieldValues,
                              FunctionElement caller) {
     callee = callee.implementation;
-    compiler.withCurrentElement(callee, () {
+    reporter.withCurrentElement(callee, () {
       constructors.add(callee);
       ClassElement enclosingClass = callee.enclosingClass;
       if (backend.classNeedsRti(enclosingClass)) {
@@ -1996,7 +2037,7 @@
         // forwarding constructor in a mixin application did not match the
         // constructor (which, for example, may happen when the libraries are
         // not compatible for private names, see issue 20394).
-        compiler.internalError(constructor,
+        reporter.internalError(constructor,
                                'forwarding constructor call does not match');
       }
       inlineSuperOrRedirect(
@@ -2058,7 +2099,7 @@
         // TODO(johnniwinther): Should we find injected constructors as well?
         FunctionElement target = superClass.lookupDefaultConstructor();
         if (target == null) {
-          compiler.internalError(superClass,
+          reporter.internalError(superClass,
               "No default constructor available.");
         }
         List<HInstruction> arguments =
@@ -2088,7 +2129,7 @@
     classElement.forEachInstanceField(
         (ClassElement enclosingClass, VariableElement member) {
           if (compiler.elementHasCompileTimeError(member)) return;
-          compiler.withCurrentElement(member, () {
+          reporter.withCurrentElement(member, () {
             TreeElements definitions = member.treeElements;
             ast.Node node = member.node;
             ast.Expression initializer = member.initializer;
@@ -2128,7 +2169,8 @@
     ClassElement classElement =
         functionElement.enclosingClass.implementation;
     bool isNativeUpgradeFactory =
-        Elements.isNativeOrExtendsNative(classElement);
+        Elements.isNativeOrExtendsNative(classElement)
+            && !classElement.isJsInterop;
     ast.FunctionExpression function = functionElement.node;
     // Note that constructors (like any other static function) do not need
     // to deal with optional arguments. It is the callers job to provide all
@@ -2248,7 +2290,7 @@
       bool isIndexedTypeArgumentGet(HInstruction instruction) {
         if (instruction is! HInvokeStatic) return false;
         HInvokeStatic invoke = instruction;
-        if (invoke.element != backend.getGetTypeArgumentByIndex()) {
+        if (invoke.element != helpers.getTypeArgumentByIndex) {
           return false;
         }
         HConstant index = invoke.inputs[1];
@@ -2446,10 +2488,11 @@
     }
 
     insertTraceCall(element);
+    insertCoverageCall(element);
   }
 
   insertTraceCall(Element element) {
-    if (JavaScriptBackend.TRACE_CALLS) {
+    if (JavaScriptBackend.TRACE_METHOD == 'console') {
       if (element == backend.traceHelper) return;
       n(e) => e == null ? '' : e.name;
       String name = "${n(element.library)}:${n(element.enclosingClass)}."
@@ -2461,6 +2504,18 @@
     }
   }
 
+  insertCoverageCall(Element element) {
+    if (JavaScriptBackend.TRACE_METHOD == 'post') {
+      if (element == backend.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,
+                            <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]) {
@@ -2482,7 +2537,7 @@
                                    DartType type,
                                    int kind) {
     if (type == null) return original;
-    type = type.unalias(compiler);
+    type = type.unaliased;
     assert(assertTypeInContext(type, original));
     if (type.isInterfaceType && !type.treatAsRaw) {
       TypeMask subtype = new TypeMask.subtype(type.element, compiler.world);
@@ -2503,7 +2558,8 @@
           <HInstruction>[buildFunctionType(type), original];
       pushInvokeDynamic(
           null,
-          new Selector.call(name, backend.jsHelperLibrary, 1),
+          new Selector.call(
+              new Name(name, backend.jsHelperLibrary), CallStructure.ONE_ARG),
           null,
           arguments);
 
@@ -2517,7 +2573,7 @@
     assert(compiler.trustTypeAnnotations);
     assert(type != null);
     type = localsHandler.substInContext(type);
-    type = type.unalias(compiler);
+    type = type.unaliased;
     if (type.isDynamic) return original;
     if (!type.isInterfaceType) return original;
     // The type element is either a class or the void element.
@@ -2532,7 +2588,7 @@
     assert(type != null);
     type = localsHandler.substInContext(type);
     HInstruction other = buildTypeConversion(original, type, kind);
-    registry.registerIsCheck(type);
+    registry?.registerIsCheck(type);
     return other;
   }
 
@@ -2558,12 +2614,12 @@
         analyzeTypeArgument(localsHandler.substInContext(supertype));
     HInstruction messageInstruction =
         graph.addConstantString(new ast.DartString.literal(message), compiler);
-    Element element = backend.getAssertIsSubtype();
+    Element element = helpers.assertIsSubtype;
     var inputs = <HInstruction>[subtypeInstruction, supertypeInstruction,
                                 messageInstruction];
     HInstruction assertIsSubtype = new HInvokeStatic(
         element, inputs, subtypeInstruction.instructionType);
-    registry.registerTypeVariableBoundsSubtypeCheck(subtype, supertype);
+    registry?.registerTypeVariableBoundsSubtypeCheck(subtype, supertype);
     add(assertIsSubtype);
   }
 
@@ -2621,6 +2677,37 @@
     return pop();
   }
 
+  visitAssert(ast.Assert node) {
+    if (!compiler.enableUserAssertions) return;
+
+    if (!node.hasMessage) {
+      // Generate:
+      //
+      //     assertHelper(condition);
+      //
+      visit(node.condition);
+      pushInvokeStatic(node, helpers.assertHelper, [pop()]);
+      pop();
+      return;
+    }
+    // Assert has message. Generate:
+    //
+    //     if (assertTest(condition)) assertThrow(message);
+    //
+    void buildCondition() {
+      visit(node.condition);
+      pushInvokeStatic(node, helpers.assertTest, [pop()]);
+    }
+    void fail() {
+      visit(node.message);
+      pushInvokeStatic(node, helpers.assertThrow, [pop()]);
+      pop();
+    }
+    handleIf(node,
+             visitCondition: buildCondition,
+             visitThen: fail);
+  }
+
   visitBlock(ast.Block node) {
     assert(!isAborted());
     if (!isReachable) return;  // This can only happen when inlining.
@@ -2631,19 +2718,19 @@
       if (!isReachable) {
         // The block has been aborted by a return or a throw.
         if (!stack.isEmpty) {
-          compiler.internalError(node, 'Non-empty instruction stack.');
+          reporter.internalError(node, 'Non-empty instruction stack.');
         }
         return;
       }
     }
     assert(!current.isClosed());
     if (!stack.isEmpty) {
-      compiler.internalError(node, 'Non-empty instruction stack.');
+      reporter.internalError(node, 'Non-empty instruction stack.');
     }
   }
 
   visitClassNode(ast.ClassNode node) {
-    compiler.internalError(node,
+    reporter.internalError(node,
         'SsaBuilder.visitClassNode should not be called.');
   }
 
@@ -3147,7 +3234,7 @@
     // TODO(ahe): This should be registered in codegen, not here.
     // TODO(johnniwinther): Is [registerStaticUse] equivalent to
     // [addToWorkList]?
-    registry.registerStaticUse(callElement);
+    registry?.registerStaticUse(callElement);
 
     List<HInstruction> capturedVariables = <HInstruction>[];
     closureClassElement.closureFields.forEach((ClosureFieldElement field) {
@@ -3163,7 +3250,7 @@
         ..sourceInformation = sourceInformationBuilder.buildCreate(node));
 
     Element methodElement = nestedClosureData.closureElement;
-    registry.registerInstantiatedClosure(methodElement);
+    registry?.registerInstantiatedClosure(methodElement);
   }
 
   visitFunctionDeclaration(ast.FunctionDeclaration node) {
@@ -3183,7 +3270,7 @@
     if (node.isThis()) {
       visitThisGet(node);
     } else {
-      compiler.internalError(node,
+      reporter.internalError(node,
           "SsaFromAstMixin.visitIdentifier on non-this.");
     }
   }
@@ -3352,11 +3439,11 @@
                                              ast.Node location) {
     if (prefixElement == null) return;
     String loadId =
-        compiler.deferredLoadTask.importDeferName[prefixElement.deferredImport];
+        compiler.deferredLoadTask.getImportDeferName(location, prefixElement);
     HInstruction loadIdConstant = addConstantString(loadId);
-    String uri = prefixElement.deferredImport.uri.dartString.slowToString();
+    String uri = prefixElement.deferredImport.uri.toString();
     HInstruction uriConstant = addConstantString(uri);
-    Element helper = backend.getCheckDeferredIsLoaded();
+    Element helper = helpers.checkDeferredIsLoaded;
     pushInvokeStatic(location, helper, [loadIdConstant, uriConstant]);
     pop();
   }
@@ -3505,7 +3592,7 @@
   void visitDynamicPropertyGet(
       ast.Send node,
       ast.Node receiver,
-      Selector selector,
+      Name name,
       _) {
     generateDynamicGet(node);
   }
@@ -3514,7 +3601,7 @@
   void visitIfNotNullDynamicPropertyGet(
       ast.Send node,
       ast.Node receiver,
-      Selector selector,
+      Name name,
       _) {
     // exp?.x compiled as:
     //   t1 = exp;
@@ -3587,7 +3674,7 @@
   @override
   void visitThisPropertyGet(
       ast.Send node,
-      Selector selector,
+      Name name,
       _) {
     generateDynamicGet(node);
   }
@@ -3622,7 +3709,11 @@
                                                   {Selector selector,
                                                    TypeMask mask,
                                                    ast.Node location}) {
-    assert(send == null || Elements.isInstanceSend(send, elements));
+    assert(invariant(
+        send == null ? location : send,
+        send == null || Elements.isInstanceSend(send, elements),
+        message: "Unexpected instance setter"
+                 "${send != null ? " element: ${elements[send]}" : ""}"));
     if (selector == null) {
       assert(send != null);
       selector = elements.getSelector(send);
@@ -3641,15 +3732,28 @@
     stack.add(value);
   }
 
+  void generateNoSuchSetter(ast.Node location,
+                            Element element,
+                            HInstruction value) {
+    List<HInstruction> arguments =
+        value == null ? const <HInstruction>[] : <HInstruction>[value];
+    // An erroneous element indicates an unresolved static setter.
+    generateThrowNoSuchMethod(
+        location, noSuchMethodTargetSymbolString(element, 'set'),
+        argumentValues: arguments);
+  }
+
   void generateNonInstanceSetter(ast.SendSet send,
                                  Element element,
                                  HInstruction value,
                                  {ast.Node location}) {
-    assert(send == null || !Elements.isInstanceSend(send, elements));
     if (location == null) {
       assert(send != null);
       location = send;
     }
+    assert(invariant(location,
+        send == null || !Elements.isInstanceSend(send, elements),
+        message: "Unexpected non instance setter: $element."));
     if (Elements.isStaticOrTopLevelField(element)) {
       if (element.isSetter) {
         pushInvokeStatic(location, element, <HInstruction>[value]);
@@ -3662,12 +3766,7 @@
       stack.add(value);
     } else if (Elements.isErroneous(element)) {
       if (element is ErroneousElement) {
-        List<HInstruction> arguments =
-            send == null ? const <HInstruction>[] : <HInstruction>[value];
-        // An erroneous element indicates an unresolved static setter.
-        generateThrowNoSuchMethod(
-            location, noSuchMethodTargetSymbolString(element, 'set'),
-            argumentValues: arguments);
+        generateNoSuchSetter(location, element,  send == null ? null : value);
       } else {
         // TODO(ahe): Do something like [generateWrongArgumentCountError].
         stack.add(graph.addConstantNull(compiler));
@@ -3720,7 +3819,8 @@
         // inputs that are later used to instantiate it. We do this by starting
         // the indexing with the number of inputs from previous sub-templates.
         templates.add(
-            rti.getTypeRepresentationWithPlaceholders(argument, (variable) {
+            rtiEncoder.getTypeRepresentationWithPlaceholders(
+                argument, (variable) {
               HInstruction runtimeType = addTypeVariableReference(variable);
               inputs.add(runtimeType);
             }, firstPlaceholderIndex: inputs.length));
@@ -3769,25 +3869,27 @@
   HInstruction buildIsNode(ast.Node node,
                            DartType type,
                            HInstruction expression) {
-    type = localsHandler.substInContext(type).unalias(compiler);
+    type = localsHandler.substInContext(type).unaliased;
     if (type.isFunctionType) {
       List arguments = [buildFunctionType(type), expression];
       pushInvokeDynamic(
           node,
-          new Selector.call('_isTest', backend.jsHelperLibrary, 1),
+          new Selector.call(
+              new PrivateName('_isTest', backend.jsHelperLibrary),
+              CallStructure.ONE_ARG),
           null,
           arguments);
       return new HIs.compound(type, expression, pop(), backend.boolType);
     } else if (type.isTypeVariable) {
       HInstruction runtimeType = addTypeVariableReference(type);
-      Element helper = backend.getCheckSubtypeOfRuntimeType();
+      Element helper = helpers.checkSubtypeOfRuntimeType;
       List<HInstruction> inputs = <HInstruction>[expression, runtimeType];
       pushInvokeStatic(null, helper, inputs, typeMask: backend.boolType);
       HInstruction call = pop();
       return new HIs.variable(type, expression, call, backend.boolType);
     } else if (RuntimeTypes.hasTypeArguments(type)) {
       ClassElement element = type.element;
-      Element helper = backend.getCheckSubtype();
+      Element helper = helpers.checkSubtype;
       HInstruction representations =
           buildTypeArgumentRepresentations(type);
       add(representations);
@@ -3879,7 +3981,9 @@
         arguments,
         element,
         compileArgument,
-        handleConstantForOptionalParameter);
+        element.isJsInterop ?
+            handleConstantForOptionalParameterJsInterop :
+            handleConstantForOptionalParameter);
   }
 
   void addGenericSendArgumentsToList(Link<ast.Node> link, List<HInstruction> list) {
@@ -3956,7 +4060,7 @@
       ast.Send node,
       ast.Node expression,
       ast.NodeList arguments,
-      Selector selector,
+      CallStructure callStructure,
       _) {
     generateCallInvoke(
         node,
@@ -4031,7 +4135,8 @@
     // Don't visit the first argument, which is the type, and the second
     // argument, which is the foreign code.
     if (link.isEmpty || link.tail.isEmpty) {
-      compiler.internalError(node.argumentsNode,
+      // We should not get here because the call should be compiled to NSM.
+      reporter.internalError(node.argumentsNode,
           'At least two arguments expected.');
     }
     native.NativeBehavior nativeBehavior =
@@ -4040,6 +4145,16 @@
     List<HInstruction> inputs = <HInstruction>[];
     addGenericSendArgumentsToList(link.tail.tail, inputs);
 
+    if (nativeBehavior.codeTemplate.positionalArgumentCount != inputs.length) {
+      reporter.reportErrorMessage(
+          node, MessageKind.GENERIC,
+          {'text':
+            'Mismatch between number of placeholders'
+            ' and number of arguments.'});
+      stack.add(graph.addConstantNull(compiler));  // Result expected on stack.
+      return;
+    }
+
     TypeMask ssaType =
         TypeMaskFactory.fromNativeBehavior(nativeBehavior, compiler);
 
@@ -4065,14 +4180,14 @@
     List<HInstruction> inputs = <HInstruction>[];
     addGenericSendArgumentsToList(node.arguments, inputs);
     if (inputs.length != 2) {
-      compiler.internalError(node.argumentsNode, 'Two arguments expected.');
+      reporter.internalError(node.argumentsNode, 'Two arguments expected.');
     }
     push(new HStringConcat(inputs[0], inputs[1], node, backend.stringType));
   }
 
   void handleForeignJsCurrentIsolateContext(ast.Send node) {
     if (!node.arguments.isEmpty) {
-      compiler.internalError(node,
+      reporter.internalError(node,
           'Too many arguments to JS_CURRENT_ISOLATE_CONTEXT.');
     }
 
@@ -4089,7 +4204,7 @@
       // Leg's isolate.
       Element element = backend.isolateHelperLibrary.find('_currentIsolate');
       if (element == null) {
-        compiler.internalError(node,
+        reporter.internalError(node,
             'Isolate library and compiler mismatch.');
       }
       pushInvokeStatic(null, element, [], typeMask: backend.dynamicType);
@@ -4101,7 +4216,7 @@
      ast.Node argument;
      switch (arguments.length) {
      case 0:
-       compiler.reportError(
+       reporter.reportErrorMessage(
            node, MessageKind.GENERIC,
            {'text': 'Error: Expected one argument to JS_GET_FLAG.'});
        return;
@@ -4110,7 +4225,7 @@
        break;
      default:
        for (int i = 1; i < arguments.length; i++) {
-         compiler.reportError(
+         reporter.reportErrorMessage(
              arguments[i], MessageKind.GENERIC,
              {'text': 'Error: Extra argument to JS_GET_FLAG.'});
        }
@@ -4118,7 +4233,7 @@
      }
      ast.LiteralString string = argument.asLiteralString();
      if (string == null) {
-       compiler.reportError(
+       reporter.reportErrorMessage(
            argument, MessageKind.GENERIC,
            {'text': 'Error: Expected a literal string.'});
      }
@@ -4132,7 +4247,7 @@
          value = compiler.useContentSecurityPolicy;
          break;
        default:
-         compiler.reportError(
+         reporter.reportErrorMessage(
              node, MessageKind.GENERIC,
              {'text': 'Error: Unknown internal flag "$name".'});
      }
@@ -4144,7 +4259,7 @@
     ast.Node argument;
     switch (arguments.length) {
     case 0:
-      compiler.reportError(
+      reporter.reportErrorMessage(
           node, MessageKind.GENERIC,
           {'text': 'Error: Expected one argument to JS_GET_NAME.'});
       return;
@@ -4153,8 +4268,8 @@
       break;
     default:
       for (int i = 1; i < arguments.length; i++) {
-        compiler.reportError(
-           arguments[i], MessageKind.GENERIC,
+        reporter.reportErrorMessage(
+            arguments[i], MessageKind.GENERIC,
             {'text': 'Error: Extra argument to JS_GET_NAME.'});
       }
       return;
@@ -4163,7 +4278,7 @@
     if (element == null ||
         element is! FieldElement ||
         element.enclosingClass != backend.jsGetNameEnum) {
-      compiler.reportError(
+      reporter.reportErrorMessage(
           argument, MessageKind.GENERIC,
           {'text': 'Error: Expected a JsGetName enum value.'});
     }
@@ -4179,7 +4294,7 @@
     List<ast.Node> arguments = node.arguments.toList();
     ast.Node argument;
     if (arguments.length < 2) {
-      compiler.reportError(
+      reporter.reportErrorMessage(
           node, MessageKind.GENERIC,
           {'text': 'Error: Expected at least two arguments to JS_BUILTIN.'});
     }
@@ -4188,7 +4303,7 @@
     if (builtinElement == null ||
         (builtinElement is! FieldElement) ||
         builtinElement.enclosingClass != backend.jsBuiltinEnum) {
-      compiler.reportError(
+      reporter.reportErrorMessage(
           argument, MessageKind.GENERIC,
           {'text': 'Error: Expected a JsBuiltin enum value.'});
     }
@@ -4222,7 +4337,7 @@
     switch (arguments.length) {
     case 0:
     case 1:
-      compiler.reportError(
+      reporter.reportErrorMessage(
           node, MessageKind.GENERIC,
           {'text': 'Error: Expected two arguments to JS_EMBEDDED_GLOBAL.'});
       return;
@@ -4233,7 +4348,7 @@
       break;
     default:
       for (int i = 2; i < arguments.length; i++) {
-        compiler.reportError(
+        reporter.reportErrorMessage(
             arguments[i], MessageKind.GENERIC,
             {'text': 'Error: Extra argument to JS_EMBEDDED_GLOBAL.'});
       }
@@ -4242,7 +4357,7 @@
     visit(globalNameNode);
     HInstruction globalNameHNode = pop();
     if (!globalNameHNode.isConstantString()) {
-      compiler.reportError(
+      reporter.reportErrorMessage(
           arguments[1], MessageKind.GENERIC,
           {'text': 'Error: Expected String as second argument '
                    'to JS_EMBEDDED_GLOBAL.'});
@@ -4279,7 +4394,8 @@
         }
       }
     }
-    compiler.reportError(node,
+    reporter.reportErrorMessage(
+        node,
         MessageKind.WRONG_ARGUMENT_FOR_JS_INTERCEPTOR_CONSTANT);
     stack.add(graph.addConstantNull(compiler));
   }
@@ -4297,7 +4413,7 @@
       // Call a helper method from the isolate library.
       Element element = backend.isolateHelperLibrary.find('_callInIsolate');
       if (element == null) {
-        compiler.internalError(node,
+        reporter.internalError(node,
             'Isolate library and compiler mismatch.');
       }
       List<HInstruction> inputs = <HInstruction>[];
@@ -4308,13 +4424,13 @@
 
   FunctionSignature handleForeignRawFunctionRef(ast.Send node, String name) {
     if (node.arguments.isEmpty || !node.arguments.tail.isEmpty) {
-      compiler.internalError(node.argumentsNode,
+      reporter.internalError(node.argumentsNode,
           '"$name" requires exactly one argument.');
     }
     ast.Node closure = node.arguments.head;
     Element element = elements[closure];
     if (!Elements.isStaticOrTopLevelFunction(element)) {
-      compiler.internalError(closure,
+      reporter.internalError(closure,
           '"$name" requires a static or top-level method.');
     }
     FunctionElement function = element;
@@ -4324,11 +4440,11 @@
     FunctionElement implementation = function.implementation;
     FunctionSignature params = implementation.functionSignature;
     if (params.optionalParameterCount != 0) {
-      compiler.internalError(closure,
+      reporter.internalError(closure,
           '"$name" does not handle closure with optional parameters.');
     }
 
-    registry.registerStaticUse(element);
+    registry?.registerStaticUse(element);
     push(new HForeignCode(
         js.js.expressionTemplateYielding(
             backend.emitter.staticFunctionAccess(element)),
@@ -4347,7 +4463,7 @@
 
   void handleForeignJsSetStaticState(ast.Send node) {
     if (node.arguments.isEmpty || !node.arguments.tail.isEmpty) {
-      compiler.internalError(node.argumentsNode,
+      reporter.internalError(node.argumentsNode,
           'Exactly one argument required.');
     }
     visit(node.arguments.head);
@@ -4364,7 +4480,7 @@
 
   void handleForeignJsGetStaticState(ast.Send node) {
     if (!node.arguments.isEmpty) {
-      compiler.internalError(node.argumentsNode, 'Too many arguments.');
+      reporter.internalError(node.argumentsNode, 'Too many arguments.');
     }
     push(new HForeignCode(js.js.parseForeignJS(backend.namer.staticStateHolder),
                           backend.dynamicType,
@@ -4402,7 +4518,7 @@
     } else if (name == 'JS_STRING_CONCAT') {
       handleJsStringConcat(node);
     } else {
-      compiler.internalError(node, "Unknown foreign: ${element}");
+      reporter.internalError(node, "Unknown foreign: ${element}");
     }
   }
 
@@ -4413,8 +4529,8 @@
     invariant(node, deferredLoader.isDeferredLoaderGetter);
     Element loadFunction = compiler.loadLibraryFunction;
     PrefixElement prefixElement = deferredLoader.enclosingElement;
-    String loadId = compiler.deferredLoadTask
-        .importDeferName[prefixElement.deferredImport];
+    String loadId =
+        compiler.deferredLoadTask.getImportDeferName(node, prefixElement);
     var inputs = [graph.addConstantString(
         new ast.DartString.literal(loadId), compiler)];
     push(new HInvokeStatic(loadFunction, inputs, backend.nonNullType,
@@ -4428,14 +4544,14 @@
     String name = selector.name;
 
     ClassElement cls = currentNonClosureClass;
-    Element element = cls.lookupSuperMember(Compiler.NO_SUCH_METHOD);
+    Element element = cls.lookupSuperMember(Identifiers.noSuchMethod_);
     if (compiler.enabledInvokeOn
         && element.enclosingElement.declaration != compiler.objectClass) {
       // Register the call as dynamic if [noSuchMethod] on the super
       // class is _not_ the default implementation from [Object], in
       // case the [noSuchMethod] implementation calls
       // [JSInvocationMirror._invokeOn].
-      registry.registerSelectorUse(selector);
+      registry?.registerSelectorUse(selector);
     }
     String publicName = name;
     if (selector.isSetter) publicName += '=';
@@ -4445,7 +4561,7 @@
 
     js.Name internalName = backend.namer.invocationName(selector);
 
-    Element createInvocationMirror = backend.getCreateInvocationMirror();
+    Element createInvocationMirror = helpers.createInvocationMirror;
     var argumentsInstruction = buildLiteralList(arguments);
     add(argumentsInstruction);
 
@@ -4471,7 +4587,7 @@
                      typeMask: backend.dynamicType);
 
     var inputs = <HInstruction>[pop()];
-    push(buildInvokeSuper(compiler.noSuchMethodSelector, element, inputs));
+    push(buildInvokeSuper(Selectors.noSuchMethod_, element, inputs));
   }
 
   /// Generate a call to a super method or constructor.
@@ -4736,9 +4852,7 @@
     assert(sourceElement.isInstanceMember);
 
     HInstruction target = localsHandler.readThis();
-    HConstant index = graph.addConstantInt(
-        RuntimeTypes.getTypeVariableIndex(variable),
-        compiler);
+    HConstant index = graph.addConstantInt(variable.index, compiler);
 
     if (needsSubstitutionForTypeVariableAccess(cls)) {
       // TODO(ahe): Creating a string here is unfortunate. It is slow (due to
@@ -4748,14 +4862,14 @@
       HInstruction substitutionNameInstr = graph.addConstantStringFromName(
           substitutionName, compiler);
       pushInvokeStatic(null,
-                       backend.getGetRuntimeTypeArgument(),
+                       helpers.getRuntimeTypeArgument,
                        [target, substitutionNameInstr, index],
                        typeMask: backend.dynamicType,
                        sourceInformation: sourceInformation);
     } else {
       pushInvokeStatic(
           null,
-          backend.getGetTypeArgumentByIndex(),
+          helpers.getTypeArgumentByIndex,
           [target, index],
           typeMask: backend.dynamicType,
           sourceInformation: sourceInformation);
@@ -4816,9 +4930,9 @@
                // 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 [isBuildingFor] will
-               // always return true when seeing one.
-               (member.isField && !isBuildingFor(member))) {
+               // 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);
@@ -4829,7 +4943,7 @@
           type.element,
           sourceInformation: sourceInformation);
     } else {
-      compiler.internalError(type.element,
+      reporter.internalError(type.element,
           'Unexpected type variable in static context.');
       return null;
     }
@@ -4853,7 +4967,7 @@
     List<HInstruction> inputs = <HInstruction>[];
 
     js.Expression template =
-        rti.getTypeRepresentationWithPlaceholders(argument, (variable) {
+        rtiEncoder.getTypeRepresentationWithPlaceholders(argument, (variable) {
             inputs.add(addTypeVariableReference(variable));
         });
 
@@ -4876,12 +4990,12 @@
       inputs.add(analyzeTypeArgument(argument));
     });
     // TODO(15489): Register at codegen.
-    registry.registerInstantiatedType(type);
+    registry?.registerInstantiatedType(type);
     return callSetRuntimeTypeInfo(type.element, inputs, newObject);
   }
 
   void copyRuntimeTypeInfo(HInstruction source, HInstruction target) {
-    Element copyHelper = backend.getCopyTypeArguments();
+    Element copyHelper = helpers.copyTypeArguments;
     pushInvokeStatic(null, copyHelper, [source, target],
         sourceInformation: target.sourceInformation);
     pop();
@@ -4898,7 +5012,7 @@
     add(typeInfo);
 
     // Set the runtime type information on the object.
-    Element typeInfoSetterElement = backend.getSetRuntimeTypeInfo();
+    Element typeInfoSetterElement = helpers.setRuntimeTypeInfo;
     pushInvokeStatic(
         null,
         typeInfoSetterElement,
@@ -5014,7 +5128,8 @@
 
     var inputs = <HInstruction>[];
     if (constructor.isGenerativeConstructor &&
-        Elements.isNativeOrExtendsNative(constructor.enclosingClass)) {
+        Elements.isNativeOrExtendsNative(constructor.enclosingClass) &&
+        !constructor.isJsInterop) {
       // Native class generative constructors take a pre-constructed object.
       inputs.add(graph.addConstantNull(compiler));
     }
@@ -5040,7 +5155,7 @@
         add(conversion);
         inputs[0] = conversion;
       }
-      js.Template code = js.js.parseForeignJS('Array(#)');
+      js.Template code = js.js.parseForeignJS('new Array(#)');
       var behavior = new native.NativeBehavior();
       behavior.typesReturned.add(expectedType);
       // The allocation can throw only if the given length is a double
@@ -5089,8 +5204,9 @@
       // Overwrite the element type, in case the allocation site has
       // been inlined.
       newInstance.instructionType = elementType;
-      JavaScriptItemCompilationContext context = work.compilationContext;
-      context.allocatedFixedLists.add(newInstance);
+      if (context != null) {
+        context.allocatedFixedLists.add(newInstance);
+      }
     }
 
     // The List constructor forwards to a Dart static method that does
@@ -5182,18 +5298,6 @@
     return false;
   }
 
-  @override
-  visitAssert(ast.Send node, ast.Node expression, _) {
-    if (!compiler.enableUserAssertions) {
-      stack.add(graph.addConstantNull(compiler));
-      return;
-    }
-    assert(invariant(node, node.arguments.tail.isEmpty,
-        message: "Invalid assertion: $node"));
-    generateStaticFunctionInvoke(
-        node, backend.assertMethod, CallStructure.ONE_ARG);
-  }
-
   visitStaticSend(ast.Send node) {
     internalError(node, "Unexpected visitStaticSend");
   }
@@ -5490,11 +5594,11 @@
     HInstruction value = analyzeTypeArgument(type,
         sourceInformation: sourceInformationBuilder.buildGet(node));
     pushInvokeStatic(node,
-                     backend.getRuntimeTypeToString(),
+                     helpers.runtimeTypeToString,
                      [value],
                      typeMask: backend.stringType);
     pushInvokeStatic(node,
-                     backend.getCreateRuntimeType(),
+                     helpers.createRuntimeType,
                      [pop()]);
   }
 
@@ -5528,7 +5632,7 @@
 
   // TODO(antonm): migrate rest of SsaFromAstMixin to internalError.
   internalError(Spannable node, String reason) {
-    compiler.internalError(node, reason);
+    reporter.internalError(node, reason);
   }
 
   void generateError(ast.Node node, String message, Element helper) {
@@ -5537,17 +5641,17 @@
   }
 
   void generateRuntimeError(ast.Node node, String message) {
-    generateError(node, message, backend.getThrowRuntimeError());
+    generateError(node, message, helpers.throwRuntimeError);
   }
 
   void generateTypeError(ast.Node node, String message) {
-    generateError(node, message, backend.getThrowTypeError());
+    generateError(node, message, helpers.throwTypeError);
   }
 
   void generateAbstractClassInstantiationError(ast.Node node, String message) {
     generateError(node,
                   message,
-                  backend.getThrowAbstractClassInstantiationError());
+                  helpers.throwAbstractClassInstantiationError);
   }
 
   void generateThrowNoSuchMethod(ast.Node diagnosticNode,
@@ -5556,7 +5660,7 @@
                                   List<HInstruction> argumentValues,
                                   List<String> existingArguments,
                                   SourceInformation sourceInformation}) {
-    Element helper = backend.getThrowNoSuchMethod();
+    Element helper = helpers.throwNoSuchMethod;
     ConstantValue receiverConstant =
         constantSystem.createString(new ast.DartString.empty());
     HInstruction receiver = graph.addConstant(receiverConstant, compiler);
@@ -5647,7 +5751,7 @@
         ConstructedConstantValue symbol = getConstantForNode(node);
         StringConstantValue stringConstant = symbol.fields.values.single;
         String nameString = stringConstant.toDartString().slowToString();
-        registry.registerConstSymbol(nameString);
+        registry?.registerConstSymbol(nameString);
       }
     } else {
       handleNewSend(node);
@@ -5679,13 +5783,13 @@
       bool isLength = selector.isGetter
           && selector.name == "length";
       if (isLength || selector.isIndex) {
-        TypeMask type = new TypeMask.nonNullExact(
-            element.enclosingClass.declaration, compiler.world);
-        return type.satisfies(backend.jsIndexableClass, compiler.world);
+        return compiler.world.isSubtypeOf(
+            element.enclosingClass.declaration,
+            backend.jsIndexableClass);
       } else if (selector.isIndexSet) {
-        TypeMask type = new TypeMask.nonNullExact(
-            element.enclosingClass.declaration, compiler.world);
-        return type.satisfies(backend.jsMutableIndexableClass, compiler.world);
+        return compiler.world.isSubtypeOf(
+            element.enclosingClass.declaration,
+            backend.jsMutableIndexableClass);
       } else {
         return false;
       }
@@ -5742,6 +5846,100 @@
     }
   }
 
+  bool _hasNamedParameters(FunctionElement function) {
+    FunctionSignature params = function.functionSignature;
+    return params.optionalParameterCount > 0
+        && params.optionalParametersAreNamed;
+  }
+
+  HForeignCode invokeJsInteropFunction(Element element,
+                                       List<HInstruction> arguments,
+                                       SourceInformation sourceInformation) {
+    assert(element.isJsInterop);
+    nativeEmitter.nativeMethods.add(element);
+    String templateString;
+
+    if (element.isFactoryConstructor &&
+        backend.jsInteropAnalysis.hasAnonymousAnnotation(element.contextClass)) {
+      // Factory constructor that is syntactic sugar for creating a JavaScript
+      // object literal.
+      ConstructorElement constructor = element;
+      FunctionSignature params = constructor.functionSignature;
+      int i = 0;
+      int positions = 0;
+      var filteredArguments = <HInstruction>[];
+      var parameterNameMap = new Map<String, js.Expression>();
+      params.orderedForEachParameter((ParameterElement parameter) {
+        // TODO(jacobr): throw if parameter names do not match names of property
+        // names in the class.
+        assert (parameter.isNamed);
+        HInstruction argument = arguments[i];
+        if (argument != null) {
+          filteredArguments.add(argument);
+          parameterNameMap[parameter.name] =
+              new js.InterpolatedExpression(positions++);
+        }
+        i++;
+      });
+      var codeTemplate = new js.Template(null,
+          js.objectLiteral(parameterNameMap));
+
+      var nativeBehavior = new native.NativeBehavior()
+        ..codeTemplate = codeTemplate;
+      return new HForeignCode(
+          codeTemplate,
+          backend.dynamicType, filteredArguments,
+          nativeBehavior: nativeBehavior)
+        ..sourceInformation = sourceInformation;
+    }
+    var target = new HForeignCode(js.js.parseForeignJS(
+            "${backend.namer.fixedBackendPath(element)}."
+            "${element.fixedBackendName}"),
+        backend.dynamicType,
+        <HInstruction>[]);
+    add(target);
+    // Strip off trailing arguments that were not specified.
+    // we could assert that the trailing arguments are all null.
+    // TODO(jacobr): rewrite named arguments to an object literal matching
+    // the factory constructor case.
+    arguments = arguments.where((arg) => arg != null).toList();
+    var inputs = <HInstruction>[target]..addAll(arguments);
+
+    js.Template codeTemplate;
+    if (element.isGetter) {
+      codeTemplate = js.js.parseForeignJS("#");
+    } else if (element.isSetter) {
+      codeTemplate = js.js.parseForeignJS("# = #");
+    } else {
+      FunctionElement function = element;
+      FunctionSignature params = function.functionSignature;
+
+      var argsStub = <String>[];
+      for (int i = 0; i < arguments.length; i++) {
+        argsStub.add('#');
+      }
+
+      if (element.isConstructor) {
+        codeTemplate = js.js.parseForeignJS("new #(${argsStub.join(",")})");
+      } else {
+        codeTemplate = js.js.parseForeignJS("#(${argsStub.join(",")})");
+      }
+    }
+
+    var nativeBehavior = new native.NativeBehavior()
+      ..codeTemplate = codeTemplate
+      ..typesReturned.add(
+          backend.jsJavaScriptObjectClass.thisType)
+      ..typesInstantiated.add(
+          backend.jsJavaScriptObjectClass.thisType)
+      ..sideEffects.setAllSideEffects();
+    return new HForeignCode(
+        codeTemplate,
+        backend.dynamicType, inputs,
+        nativeBehavior: nativeBehavior)
+      ..sourceInformation = sourceInformation;
+  }
+
   void pushInvokeStatic(ast.Node location,
                         Element element,
                         List<HInstruction> arguments,
@@ -5760,16 +5958,22 @@
     }
     bool targetCanThrow = !compiler.world.getCannotThrow(element);
     // TODO(5346): Try to avoid the need for calling [declaration] before
-    // creating an [HInvokeStatic].
-    HInvokeStatic instruction = new HInvokeStatic(
-        element.declaration, arguments, typeMask,
-        targetCanThrow: targetCanThrow)
-            ..sourceInformation = sourceInformation;
-    if (!currentInlinedInstantiations.isEmpty) {
-      instruction.instantiatedTypes = new List<DartType>.from(
-          currentInlinedInstantiations);
+    var instruction;
+    if (element.isJsInterop) {
+      instruction = invokeJsInteropFunction(element, arguments,
+          sourceInformation);
+    } else {
+      // creating an [HInvokeStatic].
+      instruction = new HInvokeStatic(
+          element.declaration, arguments, typeMask,
+          targetCanThrow: targetCanThrow)
+        ..sourceInformation = sourceInformation;
+      if (!currentInlinedInstantiations.isEmpty) {
+        instruction.instantiatedTypes = new List<DartType>.from(
+            currentInlinedInstantiations);
+      }
+      instruction.sideEffects = compiler.world.getSideEffectsOfElement(element);
     }
-    instruction.sideEffects = compiler.world.getSideEffectsOfElement(element);
     if (location == null) {
       push(instruction);
     } else {
@@ -6366,7 +6570,7 @@
   @override
   void visitThisPropertySet(
       ast.SendSet node,
-      Selector selector,
+      Name name,
       ast.Node rhs,
       _) {
     generateInstanceSetterWithCompiledReceiver(
@@ -6379,7 +6583,7 @@
   void visitDynamicPropertySet(
       ast.SendSet node,
       ast.Node receiver,
-      Selector selector,
+      Name name,
       ast.Node rhs,
       _) {
     generateInstanceSetterWithCompiledReceiver(
@@ -6392,7 +6596,7 @@
   void visitIfNotNullDynamicPropertySet(
       ast.SendSet node,
       ast.Node receiver,
-      Selector selector,
+      Name name,
       ast.Node rhs,
       _) {
     // compile e?.x = e2 to:
@@ -6433,7 +6637,7 @@
       ParameterElement parameter,
       ast.Node rhs,
       _) {
-    generateNonInstanceSetter(node, parameter, visitAndPop(rhs));
+    generateNoSuchSetter(node, parameter, visitAndPop(rhs));
   }
 
   @override
@@ -6451,7 +6655,7 @@
       LocalVariableElement variable,
       ast.Node rhs,
       _) {
-    generateNonInstanceSetter(node, variable, visitAndPop(rhs));
+    generateNoSuchSetter(node, variable, visitAndPop(rhs));
   }
 
   @override
@@ -6460,7 +6664,7 @@
       LocalFunctionElement function,
       ast.Node rhs,
       _) {
-    generateNonInstanceSetter(node, function, visitAndPop(rhs));
+    generateNoSuchSetter(node, function, visitAndPop(rhs));
   }
 
   @override
@@ -6480,7 +6684,7 @@
       ast.Node rhs,
       _) {
     generateIsDeferredLoadedCheckOfSend(node);
-    generateNonInstanceSetter(node, field, visitAndPop(rhs));
+    generateNoSuchSetter(node, field, visitAndPop(rhs));
   }
 
   @override
@@ -6490,7 +6694,7 @@
       ast.Node rhs,
       _) {
     generateIsDeferredLoadedCheckOfSend(node);
-    generateNonInstanceSetter(node, getter, visitAndPop(rhs));
+    generateNoSuchSetter(node, getter, visitAndPop(rhs));
   }
 
   @override
@@ -6510,7 +6714,7 @@
       ast.Node rhs,
       _) {
     generateIsDeferredLoadedCheckOfSend(node);
-    generateNonInstanceSetter(node, function, visitAndPop(rhs));
+    generateNoSuchSetter(node, function, visitAndPop(rhs));
   }
 
   @override
@@ -6530,7 +6734,7 @@
       ast.Node rhs,
       _) {
     generateIsDeferredLoadedCheckOfSend(node);
-    generateNonInstanceSetter(node, field, visitAndPop(rhs));
+    generateNoSuchSetter(node, field, visitAndPop(rhs));
   }
 
   @override
@@ -6540,7 +6744,7 @@
       ast.Node rhs,
       _) {
     generateIsDeferredLoadedCheckOfSend(node);
-    generateNonInstanceSetter(node, getter, visitAndPop(rhs));
+    generateNoSuchSetter(node, getter, visitAndPop(rhs));
   }
 
   @override
@@ -6560,7 +6764,7 @@
       ast.Node rhs,
       _) {
     generateIsDeferredLoadedCheckOfSend(node);
-    generateNonInstanceSetter(node, function, visitAndPop(rhs));
+    generateNoSuchSetter(node, function, visitAndPop(rhs));
   }
 
   @override
@@ -6717,9 +6921,8 @@
   void handleDynamicCompounds(
       ast.Send node,
       ast.Node receiver,
+      Name name,
       CompoundRhs rhs,
-      Selector getterSelector,
-      Selector setterSelector,
       _) {
     handleCompoundSendSet(node);
   }
@@ -6746,6 +6949,70 @@
     handleCompoundSendSet(node);
   }
 
+  @override
+  handleDynamicSetIfNulls(
+      ast.Send node,
+      ast.Node receiver,
+      Name name,
+      ast.Node rhs,
+      arg) {
+    handleCompoundSendSet(node);
+  }
+
+  @override
+  handleLocalSetIfNulls(
+      ast.SendSet node,
+      LocalElement local,
+      ast.Node rhs,
+      arg,
+      {bool isSetterValid}) {
+    handleCompoundSendSet(node);
+  }
+
+  @override
+  handleStaticSetIfNulls(
+      ast.SendSet node,
+      Element getter,
+      CompoundGetter getterKind,
+      Element setter,
+      CompoundSetter setterKind,
+      ast.Node rhs,
+      arg) {
+    handleCompoundSendSet(node);
+  }
+
+  @override
+  handleSuperSetIfNulls(
+      ast.SendSet node,
+      Element getter,
+      CompoundGetter getterKind,
+      Element setter,
+      CompoundSetter setterKind,
+      ast.Node rhs,
+      arg) {
+    handleSuperSendSet(node);
+  }
+
+  @override
+  handleTypeLiteralConstantSetIfNulls(
+      ast.SendSet node,
+      ConstantExpression constant,
+      ast.Node rhs,
+      arg) {
+    // The type variable is never `null`.
+    generateConstantTypeLiteral(node);
+  }
+
+  @override
+  visitTypeVariableTypeLiteralSetIfNull(
+      ast.Send node,
+      TypeVariableElement element,
+      ast.Node rhs,
+      arg) {
+    // The type variable is never `null`.
+    generateTypeVariableLiteral(node, element.type);
+  }
+
   void visitLiteralInt(ast.LiteralInt node) {
     stack.add(graph.addConstantInt(node.value, compiler));
   }
@@ -6764,7 +7031,7 @@
 
   void visitLiteralSymbol(ast.LiteralSymbol node) {
     stack.add(addConstant(node));
-    registry.registerConstSymbol(node.slowNameString);
+    registry?.registerConstSymbol(node.slowNameString);
   }
 
   void visitStringJuxtaposition(ast.StringJuxtaposition node) {
@@ -6785,8 +7052,10 @@
   visitNodeList(ast.NodeList node) {
     for (Link<ast.Node> link = node.nodes; !link.isEmpty; link = link.tail) {
       if (isAborted()) {
-        compiler.reportWarning(link.head,
-            MessageKind.GENERIC, {'text': 'dead code'});
+        reporter.reportHintMessage(
+            link.head,
+            MessageKind.GENERIC,
+            {'text': 'dead code'});
       } else {
         visit(link.head);
       }
@@ -6799,7 +7068,7 @@
 
   visitOperator(ast.Operator node) {
     // Operators are intercepted in their surrounding Send nodes.
-    compiler.internalError(node,
+    reporter.internalError(node,
         'SsaBuilder.visitOperator should not be called.');
   }
 
@@ -6826,7 +7095,7 @@
     HInstruction exception = rethrowableException;
     if (exception == null) {
       exception = graph.addConstantNull(compiler);
-      compiler.internalError(node,
+      reporter.internalError(node,
           'rethrowableException should not be null.');
     }
     handleInTryStatement();
@@ -6951,7 +7220,7 @@
   }
 
   visitTypeAnnotation(ast.TypeAnnotation node) {
-    compiler.internalError(node,
+    reporter.internalError(node,
         'Visiting type annotation in SSA builder.');
   }
 
@@ -6961,13 +7230,14 @@
          !link.isEmpty;
          link = link.tail) {
       ast.Node definition = link.head;
+      LocalElement local = elements[definition];
       if (definition is ast.Identifier) {
         HInstruction initialValue = graph.addConstantNull(compiler);
-        LocalElement local = elements[definition];
         localsHandler.updateLocal(local, initialValue);
       } else {
-        assert(definition is ast.SendSet);
-        visitSendSet(definition);
+        ast.SendSet node = definition;
+        generateNonInstanceSetter(
+            node, local, visitAndPop(node.arguments.first));
         pop();  // Discard value.
       }
     }
@@ -6983,7 +7253,7 @@
       arguments.add(analyzeTypeArgument(argument));
     }
     // TODO(15489): Register at codegen.
-    registry.registerInstantiatedType(type);
+    registry?.registerInstantiatedType(type);
     return callSetRuntimeTypeInfo(type.element, arguments, object);
   }
 
@@ -7026,7 +7296,7 @@
 
   visitStringInterpolationPart(ast.StringInterpolationPart node) {
     // The parts are iterated in visitStringInterpolation.
-    compiler.internalError(node,
+    reporter.internalError(node,
       'SsaBuilder.visitStringInterpolation should not be called.');
   }
 
@@ -7081,7 +7351,7 @@
     JumpTarget element = elements.getTargetDefinition(node);
     if (element == null || !identical(element.statement, node)) {
       // No breaks or continues to this node.
-      return new NullJumpHandler(compiler);
+      return new NullJumpHandler(reporter);
     }
     if (isLoopJump && node is ast.SwitchStatement) {
       // Create a special jump handler for loops created for switch statements
@@ -7098,7 +7368,7 @@
     visit(node.expression);
     HInstruction expression = pop();
     pushInvokeStatic(node,
-                     backend.getStreamIteratorConstructor(),
+                     helpers.streamIteratorConstructor,
                      [expression, graph.addConstantNull(compiler)]);
     streamIterator = pop();
 
@@ -7154,7 +7424,7 @@
                  buildBody);
     }, () {
       pushInvokeDynamic(node,
-          new Selector.call("cancel", null, 0),
+          Selectors.cancel,
           null,
           [streamIterator]);
       push(new HAwait(pop(), new TypeMask.subclass(compiler.objectClass,
@@ -7283,7 +7553,7 @@
       HInstruction length = buildGetLength();
       push(new HIdentity(length, originalLength, null, boolType));
       pushInvokeStatic(node,
-          backend.getCheckConcurrentModificationError(),
+          helpers.checkConcurrentModificationError,
           [pop(), array]);
       pop();
     }
@@ -7348,7 +7618,7 @@
   }
 
   visitLabel(ast.Label node) {
-    compiler.internalError(node, 'SsaFromAstMixin.visitLabel.');
+    reporter.internalError(node, 'SsaFromAstMixin.visitLabel.');
   }
 
   visitLabeledStatement(ast.LabeledStatement node) {
@@ -7678,7 +7948,7 @@
       // is not the generated switch statement but instead the loop generated
       // in the call to [handleLoop] below.
       handleSwitch(node,
-                   new NullJumpHandler(compiler),
+                   new NullJumpHandler(reporter),
                    buildExpression, node.cases, getConstants,
                    (_) => false, // No case is default.
                    buildSwitchCase);
@@ -7745,7 +8015,7 @@
 
     List<HStatementInformation> statements = <HStatementInformation>[];
     bool hasDefault = false;
-    Element getFallThroughErrorElement = backend.getFallThroughError();
+    Element getFallThroughErrorElement = helpers.fallThroughError;
     HasNextIterator<ast.Node> caseIterator =
         new HasNextIterator<ast.Node>(switchCases.iterator);
     while (caseIterator.hasNext) {
@@ -7845,11 +8115,11 @@
   }
 
   visitSwitchCase(ast.SwitchCase node) {
-    compiler.internalError(node, 'SsaFromAstMixin.visitSwitchCase.');
+    reporter.internalError(node, 'SsaFromAstMixin.visitSwitchCase.');
   }
 
   visitCaseMatch(ast.CaseMatch node) {
-    compiler.internalError(node, 'SsaFromAstMixin.visitCaseMatch.');
+    reporter.internalError(node, 'SsaFromAstMixin.visitCaseMatch.');
   }
 
   /// Calls [buildTry] inside a synthetic try block with [buildFinally] in the
@@ -7991,7 +8261,7 @@
       HInstruction oldRethrowableException = rethrowableException;
       rethrowableException = exception;
 
-      pushInvokeStatic(node, backend.getExceptionUnwrapper(), [exception]);
+      pushInvokeStatic(node, helpers.exceptionUnwrapper, [exception]);
       HInvokeStatic unwrappedException = pop();
       tryInstruction.exception = exception;
       Link<ast.Node> link = node.catchBlocks.nodes;
@@ -8000,7 +8270,7 @@
         if (catchBlock.onKeyword != null) {
           DartType type = elements.getType(catchBlock.type);
           if (type == null) {
-            compiler.internalError(catchBlock.type, 'On with no type.');
+            reporter.internalError(catchBlock.type, 'On with no type.');
           }
           HInstruction condition =
               buildIsNode(catchBlock.type, type, unwrappedException);
@@ -8018,7 +8288,7 @@
             // condition.
             DartType type = elements.getType(declaration.type);
             if (type == null) {
-              compiler.internalError(catchBlock, 'Catch with unresolved type.');
+              reporter.internalError(catchBlock, 'Catch with unresolved type.');
             }
             condition = buildIsNode(declaration.type, type, unwrappedException);
             push(condition);
@@ -8037,7 +8307,7 @@
         }
         ast.Node trace = catchBlock.trace;
         if (trace != null) {
-          pushInvokeStatic(trace, backend.getTraceFromException(), [exception]);
+          pushInvokeStatic(trace, helpers.traceFromException, [exception]);
           HInstruction traceInstruction = pop();
           LocalVariableElement traceVariable = elements[trace];
           localsHandler.updateLocal(traceVariable, traceInstruction);
@@ -8157,7 +8427,7 @@
   }
 
   visitTypeVariable(ast.TypeVariable node) {
-    compiler.internalError(node, 'SsaFromAstMixin.visitTypeVariable.');
+    reporter.internalError(node, 'SsaFromAstMixin.visitTypeVariable.');
   }
 
   /**
@@ -8208,11 +8478,7 @@
       ConstantExpression constant,
       CompoundRhs rhs,
       _) {
-    if (rhs.operator.kind == BinaryOperatorKind.IF_NULL) {
-      handleCompoundSendSet(node);
-    } else {
-      handleTypeLiteralCompound(node);
-    }
+    handleTypeLiteralCompound(node);
   }
 
   @override
@@ -8250,14 +8516,6 @@
   }
 
   @override
-  void errorInvalidAssert(
-      ast.Send node,
-      ast.NodeList arguments,
-      _) {
-    visitNode(node);
-  }
-
-  @override
   void errorUndefinedBinaryExpression(
       ast.Send node,
       ast.Node left,
@@ -8306,7 +8564,7 @@
   }
 
   visitNode(ast.Node node) {
-    builder.compiler.internalError(node, 'Unexpected node.');
+    builder.reporter.internalError(node, 'Unexpected node.');
   }
 
   void visitExpression(ast.Node node) {
@@ -8326,12 +8584,13 @@
 
     // If the `toString` method is guaranteed to return a string we can call it
     // directly.
-    Selector selector = new Selector.call('toString', null, 0);
+    Selector selector = Selectors.toString_;
     TypeMask type = TypeMaskFactory.inferredTypeForSelector(
         selector, expression.instructionType, compiler);
     if (type.containsOnlyString(compiler.world)) {
       builder.pushInvokeDynamic(
-          node, selector, expression.instructionType, <HInstruction>[expression]);
+          node, selector,
+          expression.instructionType, <HInstruction>[expression]);
       append(builder.pop());
       return;
     }
@@ -8395,17 +8654,24 @@
   final int maxInliningNodes;
   final bool useMaxInliningNodes;
   final bool allowLoops;
+  final bool enableUserAssertions;
 
   InlineWeeder(this.maxInliningNodes,
                this.useMaxInliningNodes,
-               this.allowLoops);
+               this.allowLoops,
+               this.enableUserAssertions);
 
   static bool canBeInlined(FunctionElement function,
                            int maxInliningNodes,
                            bool useMaxInliningNodes,
-                           {bool allowLoops: false}) {
+                           {bool allowLoops: false,
+                            bool enableUserAssertions: null}) {
+    assert(enableUserAssertions is bool); // Ensure we passed it.
+    if (function.resolvedAst.elements.containsTryStatement) return false;
+
     InlineWeeder weeder =
-        new InlineWeeder(maxInliningNodes, useMaxInliningNodes, allowLoops);
+        new InlineWeeder(maxInliningNodes, useMaxInliningNodes, allowLoops,
+            enableUserAssertions);
     ast.FunctionExpression functionExpression = function.node;
     weeder.visit(functionExpression.initializers);
     weeder.visit(functionExpression.body);
@@ -8437,6 +8703,13 @@
   }
 
   @override
+  void visitAssert(ast.Assert node) {
+    if (enableUserAssertions) {
+      visitNode(node);
+    }
+  }
+
+  @override
   void visitAsyncModifier(ast.AsyncModifier node) {
     if (node.isYielding || node.isAsynchronous) {
       tooDifficult = true;
@@ -8486,11 +8759,6 @@
     seenReturn = true;
   }
 
-  void visitTryStatement(ast.Node node) {
-    if (!registerNode()) return;
-    tooDifficult = true;
-  }
-
   void visitThrow(ast.Throw node) {
     if (!registerNode()) return;
     // For now, we don't want to handle throw after a return even if
@@ -8877,7 +9145,7 @@
   }
 
   void visitTypedefType(TypedefType type, SsaBuilder builder) {
-    DartType unaliased = type.unalias(builder.compiler);
+    DartType unaliased = type.unaliased;
     if (unaliased is TypedefType) throw 'unable to unalias $type';
     unaliased.accept(this, builder);
   }
diff --git a/pkg/compiler/lib/src/ssa/codegen.dart b/pkg/compiler/lib/src/ssa/codegen.dart
index 998ed36..1edaf6e 100644
--- a/pkg/compiler/lib/src/ssa/codegen.dart
+++ b/pkg/compiler/lib/src/ssa/codegen.dart
@@ -152,9 +152,17 @@
       continueAction = new Map<Entity, EntityAction>();
 
   Compiler get compiler => backend.compiler;
+
   NativeEmitter get nativeEmitter => backend.emitter.nativeEmitter;
+
   CodegenRegistry get registry => work.registry;
 
+  native.NativeEnqueuer get nativeEnqueuer {
+    return compiler.enqueuer.codegen.nativeEnqueuer;
+  }
+
+  DiagnosticReporter get reporter => compiler.reporter;
+
   bool isGenerateAtUseSite(HInstruction instruction) {
     return generateAtUseSite.contains(instruction);
   }
@@ -932,7 +940,7 @@
         currentContainer = oldContainer;
         break;
       default:
-        compiler.internalError(condition.conditionExpression,
+        reporter.internalError(condition.conditionExpression,
             'Unexpected loop kind: ${info.kind}.');
     }
     js.Statement result = loop;
@@ -1333,10 +1341,10 @@
     // is responsible for visiting the successor.
     if (dominated.isEmpty) return;
     if (dominated.length > 2) {
-      compiler.internalError(node, 'dominated.length = ${dominated.length}');
+      reporter.internalError(node, 'dominated.length = ${dominated.length}');
     }
     if (dominated.length == 2 && block != currentGraph.entry) {
-      compiler.internalError(node, 'node.block != currentGraph.entry');
+      reporter.internalError(node, 'node.block != currentGraph.entry');
     }
     assert(dominated[0] == block.successors[0]);
     visitBasicBlock(dominated[0]);
@@ -1427,7 +1435,7 @@
   visitTry(HTry node) {
     // We should never get here. Try/catch/finally is always handled using block
     // information in [visitTryInfo].
-    compiler.internalError(node, 'visitTry should not be called.');
+    reporter.internalError(node, 'visitTry should not be called.');
   }
 
   bool tryControlFlowOperation(HIf node) {
@@ -1598,8 +1606,18 @@
       // type because our optimizations might end up in a state where the
       // invoke dynamic knows more than the receiver.
       ClassElement enclosing = node.element.enclosingClass;
-      return
-          new TypeMask.nonNullExact(enclosing.declaration, compiler.world);
+      if (compiler.world.isInstantiated(enclosing)) {
+        return new TypeMask.nonNullExact(
+            enclosing.declaration, compiler.world);
+      } else {
+        // The element is mixed in so a non-null subtype mask is the most
+        // precise we have.
+        assert(invariant(node, compiler.world.isUsedAsMixin(enclosing),
+            message: "Element ${node.element} from $enclosing expected "
+                     "to be mixed in."));
+        return new TypeMask.nonNullSubtype(
+            enclosing.declaration, compiler.world);
+      }
     }
     // If [JSInvocationMirror._invokeOn] is enabled, and this call
     // might hit a `noSuchMethod`, we register an untyped selector.
@@ -1679,7 +1697,7 @@
 
     List<js.Expression> arguments = visitArguments(node.inputs, start: 0);
 
-    if (element == backend.getCheckConcurrentModificationError()) {
+    if (element == backend.helpers.checkConcurrentModificationError) {
       // Manually inline the [checkConcurrentModificationError] function.  This
       // function is only called from a for-loop update.  Ideally we would just
       // generate the conditionalcontrol flow in the builder but it adds basic
@@ -1687,7 +1705,7 @@
       // confuses loop recognition.
 
       assert(arguments.length == 2);
-      Element throwFunction = backend.getThrowConcurrentModificationError();
+      Element throwFunction = backend.helpers.throwConcurrentModificationError;
       registry.registerStaticInvocation(throwFunction);
 
       // Calling using `(0, #)(#)` instead of `#(#)` separates the property load
@@ -1737,8 +1755,11 @@
           // If the selector we need to register a typed getter to the
           // [world]. The emitter needs to know if it needs to emit a
           // bound closure for a method.
+
+          // If [superMethod] is mixed in, [superClass] might not be live.
+          // We use the superclass of the access instead.
           TypeMask receiverType =
-              new TypeMask.nonNullExact(superClass, compiler.world);
+              new TypeMask.nonNullExact(node.caller.superclass, compiler.world);
           // TODO(floitsch): we know the target. We shouldn't register a
           // dynamic getter.
           registry.registerDynamicGetter(
@@ -1832,11 +1853,7 @@
   void registerForeignTypes(HForeign node) {
     native.NativeBehavior nativeBehavior = node.nativeBehavior;
     if (nativeBehavior == null) return;
-    nativeBehavior.typesReturned.forEach((type) {
-      if (type is InterfaceType) {
-        registry.registerInstantiatedType(type);
-      }
-    });
+    nativeEnqueuer.registerNativeBehavior(nativeBehavior, node);
   }
 
   visitForeignCode(HForeignCode node) {
@@ -1924,7 +1941,6 @@
     generateConstant(node.constant, node.sourceInformation);
 
     registry.registerCompileTimeConstant(node.constant);
-    backend.constants.addCompileTimeConstantForEmission(node.constant);
   }
 
   visitNot(HNot node) {
@@ -2123,7 +2139,7 @@
       js.Statement thenBody = new js.Block.empty();
       js.Block oldContainer = currentContainer;
       currentContainer = thenBody;
-      generateThrowWithHelper('ioore', [node.array, node.index]);
+      generateThrowWithHelper('ioore', [node.array, node.reportedIndex]);
       currentContainer = oldContainer;
       thenBody = unwrapStatement(thenBody);
       pushStatement(new js.If.noElse(underOver, thenBody)
@@ -2249,7 +2265,7 @@
             .withSourceInformation(node.sourceInformation));
       }
     } else {
-      Element convertToString = backend.getStringInterpolationHelper();
+      Element convertToString = backend.helpers.stringInterpolationHelper;
       registry.registerStaticUse(convertToString);
       js.Expression jsHelper =
           backend.emitter.staticFunctionAccess(convertToString);
@@ -2695,7 +2711,7 @@
       checkString(input, '!==', input.sourceInformation);
       return pop();
     }
-    compiler.internalError(input, 'Unexpected check.');
+    reporter.internalError(input, 'Unexpected check: $checkedType.');
     return null;
   }
 
@@ -2814,7 +2830,7 @@
     use(node.inputs[0]);
     if (node.hasReceiver) {
       if (backend.isInterceptorClass(element.enclosingClass)) {
-        int index = RuntimeTypes.getTypeVariableIndex(element);
+        int index = element.index;
         js.Expression receiver = pop();
         js.Expression helper = backend.emitter
             .staticFunctionAccess(helperElement);
diff --git a/pkg/compiler/lib/src/ssa/invoke_dynamic_specializers.dart b/pkg/compiler/lib/src/ssa/invoke_dynamic_specializers.dart
index be3406f..e0c5611 100644
--- a/pkg/compiler/lib/src/ssa/invoke_dynamic_specializers.dart
+++ b/pkg/compiler/lib/src/ssa/invoke_dynamic_specializers.dart
@@ -27,11 +27,11 @@
   Operation operation(ConstantSystem constantSystem) => null;
 
   static InvokeDynamicSpecializer lookupSpecializer(Selector selector) {
-    if (selector.kind == SelectorKind.INDEX) {
-      return selector.name == '[]'
-          ? const IndexSpecializer()
-          : const IndexAssignSpecializer();
-    } else if (selector.kind == SelectorKind.OPERATOR) {
+    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 == '~') {
@@ -69,7 +69,7 @@
       } else if (selector.name == '>=') {
         return const GreaterEqualSpecializer();
       }
-    } else if (selector.kind == SelectorKind.CALL) {
+    } else if (selector.isCall) {
       if (selector.argumentCount == 1 && selector.namedArguments.length == 0) {
         if (selector.name == 'codeUnitAt') {
           return const CodeUnitAtSpecializer();
@@ -238,8 +238,7 @@
                                      Compiler compiler) {
     if (selector.name == name) return selector;
     JavaScriptBackend backend = compiler.backend;
-    return new Selector(
-        SelectorKind.CALL, new Name(name, backend.interceptorsLibrary),
+    return new Selector.call(new Name(name, backend.interceptorsLibrary),
         new CallStructure(selector.argumentCount));
   }
 }
diff --git a/pkg/compiler/lib/src/ssa/nodes.dart b/pkg/compiler/lib/src/ssa/nodes.dart
index b23f32d..08f6987 100644
--- a/pkg/compiler/lib/src/ssa/nodes.dart
+++ b/pkg/compiler/lib/src/ssa/nodes.dart
@@ -130,6 +130,7 @@
 }
 
 class HGraph {
+  Element element;  // Used for debug printing.
   HBasicBlock entry;
   HBasicBlock exit;
   HThis thisInstruction;
@@ -137,15 +138,13 @@
   HParameterValue explicitReceiverParameter;
   bool isRecursiveMethod = false;
   bool calledInLoop = false;
-  final List<HBasicBlock> blocks;
+  final List<HBasicBlock> blocks = <HBasicBlock>[];
 
   // We canonicalize all constants used within a graph so we do not
   // have to worry about them for global value numbering.
-  Map<ConstantValue, HConstant> constants;
+  Map<ConstantValue, HConstant> constants = new Map<ConstantValue, HConstant>();
 
-  HGraph()
-      : blocks = new List<HBasicBlock>(),
-        constants = new Map<ConstantValue, HConstant>() {
+  HGraph() {
     entry = addNewBlock();
     // The exit block will be added later, so it has an id that is
     // after all others in the system.
@@ -262,6 +261,8 @@
     validator.visitGraph(this);
     return validator.isValid;
   }
+
+  toString() => 'HGraph($element)';
 }
 
 class HBaseVisitor extends HGraphVisitor implements HVisitor {
@@ -875,6 +876,8 @@
 
   bool isExact() => instructionType.isExact || isNull();
 
+  bool isValue() => instructionType.isValue;
+
   bool canBeNull() => instructionType.isNullable;
 
   bool isNull() => instructionType.isEmpty && instructionType.isNullable;
@@ -882,6 +885,32 @@
     return instructionType.isEmpty && !instructionType.isNullable;
   }
 
+  /// Returns `true` if [typeMask] contains [cls].
+  static bool containsType(
+      TypeMask typeMask,
+      ClassElement cls,
+      ClassWorld classWorld) {
+    return classWorld.isInstantiated(cls) && typeMask.contains(cls, classWorld);
+  }
+
+  /// Returns `true` if [typeMask] contains only [cls].
+  static bool containsOnlyType(
+      TypeMask typeMask,
+      ClassElement cls,
+      ClassWorld classWorld) {
+    return classWorld.isInstantiated(cls) &&
+        typeMask.containsOnly(cls);
+  }
+
+  /// Returns `true` if [typeMask] is an instance of [cls].
+  static bool isInstanceOf(
+      TypeMask typeMask,
+      ClassElement cls,
+      ClassWorld classWorld) {
+    return classWorld.isImplemented(cls) &&
+        typeMask.satisfies(cls, classWorld);
+  }
+
   bool canBePrimitive(Compiler compiler) {
     return canBePrimitiveNumber(compiler)
         || canBePrimitiveArray(compiler)
@@ -895,27 +924,28 @@
     JavaScriptBackend backend = compiler.backend;
     // TODO(sra): It should be possible to test only jsDoubleClass and
     // jsUInt31Class, since all others are superclasses of these two.
-    return instructionType.contains(backend.jsNumberClass, classWorld)
-        || instructionType.contains(backend.jsIntClass, classWorld)
-        || instructionType.contains(backend.jsPositiveIntClass, classWorld)
-        || instructionType.contains(backend.jsUInt32Class, classWorld)
-        || instructionType.contains(backend.jsUInt31Class, classWorld)
-        || instructionType.contains(backend.jsDoubleClass, classWorld);
+    return containsType(instructionType, backend.jsNumberClass, classWorld)
+        || containsType(instructionType, backend.jsIntClass, classWorld)
+        || containsType(instructionType, backend.jsPositiveIntClass, classWorld)
+        || containsType(instructionType, backend.jsUInt32Class, classWorld)
+        || containsType(instructionType, backend.jsUInt31Class, classWorld)
+        || containsType(instructionType, backend.jsDoubleClass, classWorld);
   }
 
   bool canBePrimitiveBoolean(Compiler compiler) {
     ClassWorld classWorld = compiler.world;
     JavaScriptBackend backend = compiler.backend;
-    return instructionType.contains(backend.jsBoolClass, classWorld);
+    return containsType(instructionType, backend.jsBoolClass, classWorld);
   }
 
   bool canBePrimitiveArray(Compiler compiler) {
     ClassWorld classWorld = compiler.world;
     JavaScriptBackend backend = compiler.backend;
-    return instructionType.contains(backend.jsArrayClass, classWorld)
-        || instructionType.contains(backend.jsFixedArrayClass, classWorld)
-        || instructionType.contains(backend.jsExtendableArrayClass, classWorld)
-        || instructionType.contains(
+    return containsType(instructionType, backend.jsArrayClass, classWorld)
+        || containsType(instructionType, backend.jsFixedArrayClass, classWorld)
+        || containsType(
+            instructionType, backend.jsExtendableArrayClass, classWorld)
+        || containsType(instructionType,
             backend.jsUnmodifiableArrayClass, classWorld);
   }
 
@@ -923,37 +953,43 @@
     ClassWorld classWorld = compiler.world;
     JavaScriptBackend backend = compiler.backend;
     return instructionType.containsOnlyString(classWorld)
-        || instructionType.satisfies(backend.jsIndexableClass, classWorld);
+        || isInstanceOf(instructionType, backend.jsIndexableClass, classWorld);
   }
 
   bool isFixedArray(Compiler compiler) {
+    ClassWorld classWorld = compiler.world;
     JavaScriptBackend backend = compiler.backend;
     // TODO(sra): Recognize the union of these types as well.
-    return instructionType.containsOnly(backend.jsFixedArrayClass)
-        || instructionType.containsOnly(backend.jsUnmodifiableArrayClass);
+    return containsOnlyType(
+            instructionType, backend.jsFixedArrayClass, classWorld)
+        || containsOnlyType(
+            instructionType, backend.jsUnmodifiableArrayClass, classWorld);
   }
 
   bool isExtendableArray(Compiler compiler) {
+    ClassWorld classWorld = compiler.world;
     JavaScriptBackend backend = compiler.backend;
-    return instructionType.containsOnly(backend.jsExtendableArrayClass);
+    return containsOnlyType(
+        instructionType, backend.jsExtendableArrayClass, classWorld);
   }
 
   bool isMutableArray(Compiler compiler) {
     ClassWorld classWorld = compiler.world;
     JavaScriptBackend backend = compiler.backend;
-    return instructionType.satisfies(backend.jsMutableArrayClass, classWorld);
+    return isInstanceOf(
+        instructionType, backend.jsMutableArrayClass, classWorld);
   }
 
   bool isReadableArray(Compiler compiler) {
     ClassWorld classWorld = compiler.world;
     JavaScriptBackend backend = compiler.backend;
-    return instructionType.satisfies(backend.jsArrayClass, classWorld);
+    return isInstanceOf(instructionType, backend.jsArrayClass, classWorld);
   }
 
   bool isMutableIndexable(Compiler compiler) {
     ClassWorld classWorld = compiler.world;
     JavaScriptBackend backend = compiler.backend;
-    return instructionType.satisfies(
+    return isInstanceOf(instructionType,
         backend.jsMutableIndexableClass, classWorld);
   }
 
@@ -962,7 +998,7 @@
   bool canBePrimitiveString(Compiler compiler) {
     ClassWorld classWorld = compiler.world;
     JavaScriptBackend backend = compiler.backend;
-    return instructionType.contains(backend.jsStringClass, classWorld);
+    return containsType(instructionType, backend.jsStringClass, classWorld);
   }
 
   bool isInteger(Compiler compiler) {
@@ -975,27 +1011,28 @@
     ClassWorld classWorld = compiler.world;
     JavaScriptBackend backend = compiler.backend;
     return !instructionType.isNullable
-        && instructionType.satisfies(backend.jsUInt32Class, classWorld);
+        && isInstanceOf(instructionType, backend.jsUInt32Class, classWorld);
   }
 
   bool isUInt31(Compiler compiler) {
     ClassWorld classWorld = compiler.world;
     JavaScriptBackend backend = compiler.backend;
     return !instructionType.isNullable
-        && instructionType.satisfies(backend.jsUInt31Class, classWorld);
+        && isInstanceOf(instructionType, backend.jsUInt31Class, classWorld);
   }
 
   bool isPositiveInteger(Compiler compiler) {
     ClassWorld classWorld = compiler.world;
     JavaScriptBackend backend = compiler.backend;
-    return !instructionType.isNullable
-        && instructionType.satisfies(backend.jsPositiveIntClass, classWorld);
+    return !instructionType.isNullable &&
+        isInstanceOf(instructionType, backend.jsPositiveIntClass, classWorld);
   }
 
   bool isPositiveIntegerOrNull(Compiler compiler) {
     ClassWorld classWorld = compiler.world;
     JavaScriptBackend backend = compiler.backend;
-    return instructionType.satisfies(backend.jsPositiveIntClass, classWorld);
+    return isInstanceOf(
+        instructionType, backend.jsPositiveIntClass, classWorld);
   }
 
   bool isIntegerOrNull(Compiler compiler) {
@@ -1275,7 +1312,7 @@
 
   HInstruction convertType(Compiler compiler, DartType type, int kind) {
     if (type == null) return this;
-    type = type.unalias(compiler);
+    type = type.unaliased;
     // Only the builder knows how to create [HTypeConversion]
     // instructions with generics. It has the generic type context
     // available.
@@ -1393,6 +1430,9 @@
   HInstruction get length => inputs[1];
   HInstruction get index => inputs[0];
   HInstruction get array => inputs[2];
+  // There can be an additional fourth input which is the index to report to
+  // [ioore]. This is used by the expansion of [JSArray.removeLast].
+  HInstruction get reportedIndex => inputs.length > 3 ? inputs[3] : index;
   bool isControlFlow() => true;
 
   accept(HVisitor visitor) => visitor.visitBoundsCheck(this);
@@ -1846,6 +1886,8 @@
   accept(HVisitor visitor) => visitor.visitForeignNew(this);
 
   bool get isAllocation => true;
+
+  String toString() => 'HForeignNew($element)';
 }
 
 abstract class HInvokeBinary extends HInstruction {
diff --git a/pkg/compiler/lib/src/ssa/optimize.dart b/pkg/compiler/lib/src/ssa/optimize.dart
index 977900c..563b503 100644
--- a/pkg/compiler/lib/src/ssa/optimize.dart
+++ b/pkg/compiler/lib/src/ssa/optimize.dart
@@ -20,7 +20,7 @@
 
   void optimize(CodegenWorkItem work, HGraph graph) {
     void runPhase(OptimizationPhase phase) {
-      phase.visitGraph(graph);
+      measureSubtask(phase.name, () => phase.visitGraph(graph));
       compiler.tracer.traceGraph(phase.name, graph);
       assert(graph.isValid());
     }
@@ -200,6 +200,41 @@
     return node;
   }
 
+  ConstantValue getConstantFromType(HInstruction node) {
+    if (node.isValue() && !node.canBeNull()) {
+      ValueTypeMask valueMask = node.instructionType;
+      if (valueMask.value.isBool) {
+        return valueMask.value;
+      }
+      // TODO(het): consider supporting other values (short strings?)
+    }
+    return null;
+  }
+
+  void propagateConstantValueToUses(HInstruction node) {
+    if (node.usedBy.isEmpty) return;
+    ConstantValue value = getConstantFromType(node);
+    if (value != null) {
+      HConstant constant = graph.addConstant(value, compiler);
+      for (HInstruction user in node.usedBy.toList()) {
+        user.changeUse(node, constant);
+      }
+    }
+  }
+
+  HInstruction visitParameterValue(HParameterValue node) {
+    // It is possible for the parameter value to be assigned to in the function
+    // body. If that happens then we should not forward the constant value to
+    // its uses since since the uses reachable from the assignment may have
+    // values in addition to the constant passed to the function.
+    if (node.usedBy.any((user) =>
+            user is HLocalSet && identical(user.local, node))) {
+      return node;
+    }
+    propagateConstantValueToUses(node);
+    return node;
+  }
+
   HInstruction visitBoolify(HBoolify node) {
     List<HInstruction> inputs = node.inputs;
     assert(inputs.length == 1);
@@ -268,9 +303,11 @@
       ClassWorld classWorld = compiler.world;
       TypeMask resultType = backend.positiveIntType;
       // If we already have computed a more specific type, keep that type.
-      if (actualType.satisfies(backend.jsUInt31Class, classWorld)) {
+      if (HInstruction.isInstanceOf(
+              actualType, backend.jsUInt31Class, classWorld)) {
         resultType = backend.uint31Type;
-      } else if (actualType.satisfies(backend.jsUInt32Class, classWorld)) {
+      } else if (HInstruction.isInstanceOf(
+              actualType, backend.jsUInt32Class, classWorld)) {
         resultType = backend.uint32Type;
       }
       HFieldGet result = new HFieldGet(
@@ -370,6 +407,7 @@
   }
 
   HInstruction visitInvokeDynamicMethod(HInvokeDynamicMethod node) {
+    propagateConstantValueToUses(node);
     if (node.isInterceptedCall) {
       HInstruction folded = handleInterceptedCall(node);
       if (folded != node) return folded;
@@ -435,7 +473,7 @@
     bool canInline = true;
     signature.forEachParameter((ParameterElement element) {
       if (inputPosition++ < inputs.length && canInline) {
-        DartType type = element.type.unalias(compiler);
+        DartType type = element.type.unaliased;
         if (type is FunctionType) {
           canInline = false;
         }
@@ -804,6 +842,7 @@
   }
 
   HInstruction visitInvokeDynamicGetter(HInvokeDynamicGetter node) {
+    propagateConstantValueToUses(node);
     if (node.isInterceptedCall) {
       HInstruction folded = handleInterceptedCall(node);
       if (folded != node) return folded;
@@ -865,7 +904,8 @@
   }
 
   HInstruction visitInvokeStatic(HInvokeStatic node) {
-    if (node.element == backend.getCheckConcurrentModificationError()) {
+    propagateConstantValueToUses(node);
+    if (node.element == backend.helpers.checkConcurrentModificationError) {
       if (node.inputs.length == 2) {
         HInstruction firstArgument = node.inputs[0];
         if (firstArgument is HConstant) {
@@ -1029,8 +1069,13 @@
     if (node.isInterceptedCall) return;
     if (element != backend.jsArrayRemoveLast) return;
     if (boundsChecked.contains(node)) return;
-    insertBoundsCheck(
+    // `0` is the index we want to check, but we want to report `-1`, as if we
+    // executed `a[a.length-1]`
+    HBoundsCheck check = insertBoundsCheck(
         node, node.receiver, graph.addConstantInt(0, backend.compiler));
+    HInstruction minusOne = graph.addConstantInt(-1, backend.compiler);
+    check.inputs.add(minusOne);
+    minusOne.usedBy.add(check);
   }
 }
 
@@ -1954,17 +1999,57 @@
 
   void visitForeignNew(HForeignNew instruction) {
     memorySet.registerAllocation(instruction);
-    int argumentIndex = 0;
-    instruction.element.forEachInstanceField((_, Element member) {
-      if (compiler.elementHasCompileTimeError(member)) return;
-      memorySet.registerFieldValue(
-          member, instruction, instruction.inputs[argumentIndex++]);
-    }, includeSuperAndInjectedMembers: true);
+    if (shouldTrackInitialValues(instruction)) {
+      int argumentIndex = 0;
+      instruction.element.forEachInstanceField((_, Element member) {
+        if (compiler.elementHasCompileTimeError(member)) return;
+        memorySet.registerFieldValue(
+            member, instruction, instruction.inputs[argumentIndex++]);
+      }, includeSuperAndInjectedMembers: true);
+    }
     // In case this instruction has as input non-escaping objects, we
     // need to mark these objects as escaping.
     memorySet.killAffectedBy(instruction);
   }
 
+  bool shouldTrackInitialValues(HForeignNew instruction) {
+    // Don't track initial field values of an allocation that are
+    // unprofitable. We search the chain of single uses in allocations for a
+    // limited depth.
+
+    const MAX_HEAP_DEPTH = 5;
+
+    bool interestingUse(HInstruction instruction, int heapDepth) {
+      // Heuristic: if the allocation is too deep in heap it is unlikely we will
+      // recover a field by load-elimination.
+      // TODO(sra): We can measure this depth by looking at load chains.
+      if (heapDepth == MAX_HEAP_DEPTH) return false;
+      // There are multiple uses so do the full store analysis.
+      if (instruction.usedBy.length != 1) return true;
+      HInstruction use = instruction.usedBy.single;
+      // When the only use is an allocation, the allocation becomes the only
+      // heap alias for the current instruction.
+      if (use is HForeignNew) return interestingUse(use, heapDepth + 1);
+      if (use is HLiteralList) return interestingUse(use, heapDepth + 1);
+      if (use is HInvokeStatic) {
+        // Assume the argument escapes. All we do with our initial allocation is
+        // have it escape or store it into an object that escapes.
+        return false;
+        // TODO(sra): Handle more functions. `setRuntimeTypeInfo` does not
+        // actually kill it's input, but we don't make use of that elsewhere so
+        // there is not point in checking here.
+      }
+      if (use is HPhi) {
+        // The initial allocation (it's only alias) gets merged out of the model
+        // of the heap before load.
+        return false;
+      }
+      return true;
+    }
+
+    return interestingUse(instruction, 0);
+  }
+
   void visitInstruction(HInstruction instruction) {
     if (instruction.isAllocation) {
       memorySet.registerAllocation(instruction);
diff --git a/pkg/compiler/lib/src/ssa/ssa.dart b/pkg/compiler/lib/src/ssa/ssa.dart
index c1d4dac..5d56ba3 100644
--- a/pkg/compiler/lib/src/ssa/ssa.dart
+++ b/pkg/compiler/lib/src/ssa/ssa.dart
@@ -6,33 +6,65 @@
 
 import 'dart:collection';
 
+import 'package:js_runtime/shared/embedded_names.dart';
+
 import '../closure.dart';
+import '../common.dart';
+import '../common/codegen.dart' show
+    CodegenRegistry,
+    CodegenWorkItem;
+import '../common/names.dart' show
+    Identifiers,
+    Selectors;
+import '../common/tasks.dart' show
+    CompilerTask;
+import '../compiler.dart' show
+    Compiler;
 import '../constant_system_dart.dart';
 import '../constants/constant_system.dart';
 import '../constants/expressions.dart';
 import '../constants/values.dart';
-import '../dart2jslib.dart' hide Selector, TypedSelector;
 import '../dart_types.dart';
+import '../diagnostics/messages.dart' show
+    Message,
+    MessageTemplate;
 import '../elements/elements.dart';
-import '../elements/modelx.dart'
-    show ElementX,
-         VariableElementX,
-         ConstructorBodyElementX;
-
+import '../elements/modelx.dart' show
+    ConstructorBodyElementX,
+    ElementX,
+    VariableElementX;
 import '../io/source_information.dart';
 import '../js/js.dart' as js;
+import '../js_backend/backend_helpers.dart' show
+    BackendHelpers;
 import '../js_backend/js_backend.dart';
-import '../js_emitter/js_emitter.dart' show CodeEmitterTask, NativeEmitter;
+import '../js_emitter/js_emitter.dart' show
+    CodeEmitterTask,
+    NativeEmitter;
 import '../native/native.dart' as native;
 import '../resolution/operators.dart';
 import '../resolution/semantic_visitor.dart';
+import '../resolution/send_resolver.dart' show
+    SendResolverMixin;
+import '../resolution/tree_elements.dart' show
+    TreeElements;
 import '../tree/tree.dart' as ast;
 import '../types/types.dart';
-import '../types/constants.dart' show computeTypeMask;
-import '../universe/universe.dart';
+import '../types/constants.dart' show
+    computeTypeMask;
+import '../universe/call_structure.dart' show
+    CallStructure;
+import '../universe/selector.dart' show
+    Selector;
+import '../universe/side_effects.dart' show
+    SideEffects;
+import '../universe/universe.dart' show
+    UniverseSelector;
 import '../util/util.dart';
-import '../js/rewrite_async.dart';
-import 'package:js_runtime/shared/embedded_names.dart';
+import '../world.dart' show
+    ClassWorld,
+    World;
+import '../dump_info.dart' show InfoReporter;
 
 part 'builder.dart';
 part 'codegen.dart';
diff --git a/pkg/compiler/lib/src/ssa/ssa_tracer.dart b/pkg/compiler/lib/src/ssa/ssa_tracer.dart
index 830c6c7..841b0a2 100644
--- a/pkg/compiler/lib/src/ssa/ssa_tracer.dart
+++ b/pkg/compiler/lib/src/ssa/ssa_tracer.dart
@@ -4,11 +4,16 @@
 
 library ssa.tracer;
 
-import 'dart:async' show EventSink;
+import 'dart:async' show
+  EventSink;
 
 import 'ssa.dart';
+import '../common.dart';
+import '../compiler.dart' show
+    Compiler;
+import '../diagnostics/invariant.dart' show
+    DEBUG_MODE;
 import '../js_backend/js_backend.dart';
-import '../dart2jslib.dart';
 import '../tracer.dart';
 
 /**
diff --git a/pkg/compiler/lib/src/ssa/variable_allocator.dart b/pkg/compiler/lib/src/ssa/variable_allocator.dart
index bd95f58..fb35705 100644
--- a/pkg/compiler/lib/src/ssa/variable_allocator.dart
+++ b/pkg/compiler/lib/src/ssa/variable_allocator.dart
@@ -209,10 +209,12 @@
     : liveInstructions = new Map<HBasicBlock, LiveEnvironment>(),
       liveIntervals = new Map<HInstruction, LiveInterval>();
 
+  DiagnosticReporter get reporter => compiler.reporter;
+
   void visitGraph(HGraph graph) {
     visitPostDominatorTree(graph);
     if (!liveInstructions[graph.entry].isEmpty) {
-      compiler.internalError(CURRENT_ELEMENT_SPANNABLE, 'LiveIntervalBuilder.');
+      reporter.internalError(CURRENT_ELEMENT_SPANNABLE, 'LiveIntervalBuilder.');
     }
   }
 
diff --git a/pkg/compiler/lib/src/string_validator.dart b/pkg/compiler/lib/src/string_validator.dart
index 6b519f3..60f31dc 100644
--- a/pkg/compiler/lib/src/string_validator.dart
+++ b/pkg/compiler/lib/src/string_validator.dart
@@ -6,17 +6,17 @@
 
 library stringvalidator;
 
-import "dart:collection";
+import 'dart:collection';
 
-import "dart2jslib.dart";
-import "tree/tree.dart";
-import "util/characters.dart";
-import "scanner/scannerlib.dart" show Token;
+import 'common.dart';
+import 'tokens/token.dart' show Token;
+import 'tree/tree.dart';
+import 'util/characters.dart';
 
 class StringValidator {
-  final DiagnosticListener listener;
+  final DiagnosticReporter reporter;
 
-  StringValidator(this.listener);
+  StringValidator(this.reporter);
 
   DartString validateInterpolationPart(Token token, StringQuoting quoting,
                                        {bool isFirst: false,
@@ -101,7 +101,7 @@
   }
 
   void stringParseError(String message, Token token, int offset) {
-    listener.reportError(
+    reporter.reportErrorMessage(
         token, MessageKind.GENERIC, {'text': "$message @ $offset"});
   }
 
diff --git a/pkg/compiler/lib/src/tokens/keyword.dart b/pkg/compiler/lib/src/tokens/keyword.dart
new file mode 100644
index 0000000..ce1bc87
--- /dev/null
+++ b/pkg/compiler/lib/src/tokens/keyword.dart
@@ -0,0 +1,221 @@
+// 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.
+
+library dart2js.tokens.keywords;
+
+import '../util/characters.dart' as Characters show
+    $a;
+
+import 'precedence.dart' show
+    PrecedenceInfo;
+import 'precedence_constants.dart' as Precedence show
+    AS_INFO,
+    IS_INFO,
+    KEYWORD_INFO;
+
+/**
+ * A keyword in the Dart programming language.
+ */
+class Keyword {
+  static const List<Keyword> values = const <Keyword> [
+      const Keyword("assert"),
+      const Keyword("break"),
+      const Keyword("case"),
+      const Keyword("catch"),
+      const Keyword("class"),
+      const Keyword("const"),
+      const Keyword("continue"),
+      const Keyword("default"),
+      const Keyword("do"),
+      const Keyword("else"),
+      const Keyword("enum"),
+      const Keyword("extends"),
+      const Keyword("false"),
+      const Keyword("final"),
+      const Keyword("finally"),
+      const Keyword("for"),
+      const Keyword("if"),
+      const Keyword("in"),
+      const Keyword("new"),
+      const Keyword("null"),
+      const Keyword("rethrow"),
+      const Keyword("return"),
+      const Keyword("super"),
+      const Keyword("switch"),
+      const Keyword("this"),
+      const Keyword("throw"),
+      const Keyword("true"),
+      const Keyword("try"),
+      const Keyword("var"),
+      const Keyword("void"),
+      const Keyword("while"),
+      const Keyword("with"),
+
+      // TODO(ahe): Don't think this is a reserved word.
+      // See: http://dartbug.com/5579
+      const Keyword("is", info: Precedence.IS_INFO),
+
+      const Keyword("abstract", isBuiltIn: true),
+      const Keyword("as", info: Precedence.AS_INFO, isBuiltIn: true),
+      const Keyword("dynamic", isBuiltIn: true),
+      const Keyword("export", isBuiltIn: true),
+      const Keyword("external", isBuiltIn: true),
+      const Keyword("factory", isBuiltIn: true),
+      const Keyword("get", isBuiltIn: true),
+      const Keyword("implements", isBuiltIn: true),
+      const Keyword("import", isBuiltIn: true),
+      const Keyword("library", isBuiltIn: true),
+      const Keyword("operator", isBuiltIn: true),
+      const Keyword("part", isBuiltIn: true),
+      const Keyword("set", isBuiltIn: true),
+      const Keyword("static", isBuiltIn: true),
+      const Keyword("typedef", isBuiltIn: true),
+
+      const Keyword("hide", isPseudo: true),
+      const Keyword("native", isPseudo: true),
+      const Keyword("of", isPseudo: true),
+      const Keyword("on", isPseudo: true),
+      const Keyword("show", isPseudo: true),
+      const Keyword("source", isPseudo: true),
+      const Keyword("deferred", isPseudo: true),
+      const Keyword("async", isPseudo: true),
+      const Keyword("sync", isPseudo: true),
+      const Keyword("await", isPseudo: true),
+      const Keyword("yield", isPseudo: true)];
+
+  final String syntax;
+  final bool isPseudo;
+  final bool isBuiltIn;
+  final PrecedenceInfo info;
+
+  static Map<String, Keyword> _keywords;
+  static Map<String, Keyword> get keywords {
+    if (_keywords == null) {
+      _keywords = computeKeywordMap();
+    }
+    return _keywords;
+  }
+
+  const Keyword(this.syntax,
+                {this.isPseudo: false,
+                 this.isBuiltIn: false,
+                 this.info: Precedence.KEYWORD_INFO});
+
+  static Map<String, Keyword> computeKeywordMap() {
+    Map<String, Keyword> result = new Map<String, Keyword>();
+    for (Keyword keyword in values) {
+      result[keyword.syntax] = keyword;
+    }
+    return result;
+  }
+
+  String toString() => syntax;
+}
+
+/**
+ * Abstract state in a state machine for scanning keywords.
+ */
+abstract class KeywordState {
+  KeywordState(this.keyword);
+
+  KeywordState next(int c);
+  final Keyword keyword;
+
+  static KeywordState _KEYWORD_STATE;
+  static KeywordState get KEYWORD_STATE {
+    if (_KEYWORD_STATE == null) {
+      List<String> strings =
+          new List<String>(Keyword.values.length);
+      for (int i = 0; i < Keyword.values.length; i++) {
+        strings[i] = Keyword.values[i].syntax;
+      }
+      strings.sort((a,b) => a.compareTo(b));
+      _KEYWORD_STATE = computeKeywordStateTable(0, strings, 0, strings.length);
+    }
+    return _KEYWORD_STATE;
+  }
+
+  static KeywordState computeKeywordStateTable(int start, List<String> strings,
+                                               int offset, int length) {
+    List<KeywordState> result = new List<KeywordState>(26);
+    assert(length != 0);
+    int chunk = 0;
+    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) {
+            assert(result[chunk - Characters.$a] == null);
+            result[chunk - Characters.$a] =
+                computeKeywordStateTable(
+                    start + 1, strings, chunkStart, i - chunkStart);
+          }
+          chunkStart = i;
+          chunk = c;
+        }
+      }
+    }
+    if (chunkStart != -1) {
+      assert(result[chunk - Characters.$a] == null);
+      result[chunk - Characters.$a] =
+        computeKeywordStateTable(start + 1, strings, chunkStart,
+                                 offset + length - chunkStart);
+    } else {
+      assert(length == 1);
+      return new LeafKeywordState(strings[offset]);
+    }
+    if (isLeaf) {
+      return new ArrayKeywordState(result, strings[offset]);
+    } else {
+      return new ArrayKeywordState(result, null);
+    }
+  }
+}
+
+/**
+ * A state with multiple outgoing transitions.
+ */
+class ArrayKeywordState extends KeywordState {
+  final List<KeywordState> table;
+
+  ArrayKeywordState(List<KeywordState> this.table, String syntax)
+    : super((syntax == null) ? null : Keyword.keywords[syntax]);
+
+  KeywordState next(int c) => table[c - Characters.$a];
+
+  String toString() {
+    StringBuffer sb = new StringBuffer();
+    sb.write("[");
+    if (keyword != null) {
+      sb.write("*");
+      sb.write(keyword);
+      sb.write(" ");
+    }
+    List<KeywordState> foo = table;
+    for (int i = 0; i < foo.length; i++) {
+      if (foo[i] != null) {
+        sb.write("${new String.fromCharCodes([i + Characters.$a])}: "
+                 "${foo[i]}; ");
+      }
+    }
+    sb.write("]");
+    return sb.toString();
+  }
+}
+
+/**
+ * A state that has no outgoing transitions.
+ */
+class LeafKeywordState extends KeywordState {
+  LeafKeywordState(String syntax) : super(Keyword.keywords[syntax]);
+
+  KeywordState next(int c) => null;
+
+  String toString() => keyword.syntax;
+}
diff --git a/pkg/compiler/lib/src/tokens/precedence.dart b/pkg/compiler/lib/src/tokens/precedence.dart
new file mode 100644
index 0000000..1183a0b
--- /dev/null
+++ b/pkg/compiler/lib/src/tokens/precedence.dart
@@ -0,0 +1,20 @@
+// 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 dart2js.tokens.precedence;
+
+import '../util/util.dart' show
+    computeHashCode;
+
+class PrecedenceInfo {
+  final String value;
+  final int precedence;
+  final int kind;
+
+  const PrecedenceInfo(this.value, this.precedence, this.kind);
+
+  toString() => 'PrecedenceInfo($value, $precedence, $kind)';
+
+  int get hashCode => computeHashCode(value, precedence, kind);
+}
diff --git a/pkg/compiler/lib/src/tokens/precedence_constants.dart b/pkg/compiler/lib/src/tokens/precedence_constants.dart
new file mode 100644
index 0000000..f2e44f2
--- /dev/null
+++ b/pkg/compiler/lib/src/tokens/precedence_constants.dart
@@ -0,0 +1,241 @@
+// 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 dart2js.tokens.precedence.constants;
+
+import 'precedence.dart' show
+    PrecedenceInfo;
+import 'token_constants.dart';
+
+// TODO(ahe): The following are not tokens in Dart.
+const PrecedenceInfo BACKPING_INFO =
+  const PrecedenceInfo('`', 0, BACKPING_TOKEN);
+const PrecedenceInfo BACKSLASH_INFO =
+  const PrecedenceInfo('\\', 0, BACKSLASH_TOKEN);
+const PrecedenceInfo PERIOD_PERIOD_PERIOD_INFO =
+  const PrecedenceInfo('...', 0,
+                       PERIOD_PERIOD_PERIOD_TOKEN);
+
+/**
+ * The cascade operator has the lowest precedence of any operator
+ * except assignment.
+ */
+const int CASCADE_PRECEDENCE = 2;
+const PrecedenceInfo PERIOD_PERIOD_INFO =
+  const PrecedenceInfo('..', CASCADE_PRECEDENCE,
+                       PERIOD_PERIOD_TOKEN);
+
+const PrecedenceInfo BANG_INFO =
+  const PrecedenceInfo('!', 0, BANG_TOKEN);
+const PrecedenceInfo COLON_INFO =
+  const PrecedenceInfo(':', 0, COLON_TOKEN);
+const PrecedenceInfo INDEX_INFO =
+  const PrecedenceInfo('[]', 0, INDEX_TOKEN);
+const PrecedenceInfo MINUS_MINUS_INFO =
+  const PrecedenceInfo('--', POSTFIX_PRECEDENCE,
+                       MINUS_MINUS_TOKEN);
+const PrecedenceInfo PLUS_PLUS_INFO =
+  const PrecedenceInfo('++', POSTFIX_PRECEDENCE,
+                       PLUS_PLUS_TOKEN);
+const PrecedenceInfo TILDE_INFO =
+  const PrecedenceInfo('~', 0, TILDE_TOKEN);
+
+const PrecedenceInfo FUNCTION_INFO =
+  const PrecedenceInfo('=>', 0, FUNCTION_TOKEN);
+const PrecedenceInfo HASH_INFO =
+  const PrecedenceInfo('#', 0, HASH_TOKEN);
+const PrecedenceInfo INDEX_EQ_INFO =
+  const PrecedenceInfo('[]=', 0, INDEX_EQ_TOKEN);
+const PrecedenceInfo SEMICOLON_INFO =
+  const PrecedenceInfo(';', 0, SEMICOLON_TOKEN);
+const PrecedenceInfo COMMA_INFO =
+  const PrecedenceInfo(',', 0, COMMA_TOKEN);
+
+const PrecedenceInfo AT_INFO =
+  const PrecedenceInfo('@', 0, AT_TOKEN);
+
+// Assignment operators.
+const int ASSIGNMENT_PRECEDENCE = 1;
+const PrecedenceInfo AMPERSAND_EQ_INFO =
+  const PrecedenceInfo('&=',
+                       ASSIGNMENT_PRECEDENCE, AMPERSAND_EQ_TOKEN);
+const PrecedenceInfo BAR_EQ_INFO =
+  const PrecedenceInfo('|=',
+                       ASSIGNMENT_PRECEDENCE, BAR_EQ_TOKEN);
+const PrecedenceInfo CARET_EQ_INFO =
+  const PrecedenceInfo('^=',
+                       ASSIGNMENT_PRECEDENCE, CARET_EQ_TOKEN);
+const PrecedenceInfo EQ_INFO =
+  const PrecedenceInfo('=',
+                       ASSIGNMENT_PRECEDENCE, EQ_TOKEN);
+const PrecedenceInfo GT_GT_EQ_INFO =
+  const PrecedenceInfo('>>=',
+                       ASSIGNMENT_PRECEDENCE, GT_GT_EQ_TOKEN);
+const PrecedenceInfo LT_LT_EQ_INFO =
+  const PrecedenceInfo('<<=',
+                       ASSIGNMENT_PRECEDENCE, LT_LT_EQ_TOKEN);
+const PrecedenceInfo MINUS_EQ_INFO =
+  const PrecedenceInfo('-=',
+                       ASSIGNMENT_PRECEDENCE, MINUS_EQ_TOKEN);
+const PrecedenceInfo PERCENT_EQ_INFO =
+  const PrecedenceInfo('%=',
+                       ASSIGNMENT_PRECEDENCE, PERCENT_EQ_TOKEN);
+const PrecedenceInfo PLUS_EQ_INFO =
+  const PrecedenceInfo('+=',
+                       ASSIGNMENT_PRECEDENCE, PLUS_EQ_TOKEN);
+const PrecedenceInfo SLASH_EQ_INFO =
+  const PrecedenceInfo('/=',
+                       ASSIGNMENT_PRECEDENCE, SLASH_EQ_TOKEN);
+const PrecedenceInfo STAR_EQ_INFO =
+  const PrecedenceInfo('*=',
+                       ASSIGNMENT_PRECEDENCE, STAR_EQ_TOKEN);
+const PrecedenceInfo TILDE_SLASH_EQ_INFO =
+  const PrecedenceInfo('~/=',
+                       ASSIGNMENT_PRECEDENCE, TILDE_SLASH_EQ_TOKEN);
+const PrecedenceInfo QUESTION_QUESTION_EQ_INFO =
+  const PrecedenceInfo('??=',
+                       ASSIGNMENT_PRECEDENCE, QUESTION_QUESTION_EQ_TOKEN);
+
+const PrecedenceInfo QUESTION_INFO =
+  const PrecedenceInfo('?', 3, QUESTION_TOKEN);
+
+const PrecedenceInfo QUESTION_QUESTION_INFO =
+  const PrecedenceInfo('??', 4, QUESTION_QUESTION_TOKEN);
+
+const PrecedenceInfo BAR_BAR_INFO =
+  const PrecedenceInfo('||', 5, BAR_BAR_TOKEN);
+
+const PrecedenceInfo AMPERSAND_AMPERSAND_INFO =
+  const PrecedenceInfo('&&', 6, AMPERSAND_AMPERSAND_TOKEN);
+
+const PrecedenceInfo BAR_INFO =
+  const PrecedenceInfo('|', 9, BAR_TOKEN);
+
+const PrecedenceInfo CARET_INFO =
+  const PrecedenceInfo('^', 10, CARET_TOKEN);
+
+const PrecedenceInfo AMPERSAND_INFO =
+  const PrecedenceInfo('&', 11, AMPERSAND_TOKEN);
+
+// Equality operators.
+const int EQUALITY_PRECEDENCE = 7;
+const PrecedenceInfo BANG_EQ_EQ_INFO =
+  const PrecedenceInfo('!==',
+                       EQUALITY_PRECEDENCE, BANG_EQ_EQ_TOKEN);
+const PrecedenceInfo BANG_EQ_INFO =
+  const PrecedenceInfo('!=',
+                       EQUALITY_PRECEDENCE, BANG_EQ_TOKEN);
+const PrecedenceInfo EQ_EQ_EQ_INFO =
+  const PrecedenceInfo('===',
+                       EQUALITY_PRECEDENCE, EQ_EQ_EQ_TOKEN);
+const PrecedenceInfo EQ_EQ_INFO =
+  const PrecedenceInfo('==',
+                       EQUALITY_PRECEDENCE, EQ_EQ_TOKEN);
+
+// Relational operators.
+const int RELATIONAL_PRECEDENCE = 8;
+const PrecedenceInfo GT_EQ_INFO =
+  const PrecedenceInfo('>=',
+                       RELATIONAL_PRECEDENCE, GT_EQ_TOKEN);
+const PrecedenceInfo GT_INFO =
+  const PrecedenceInfo('>',
+                       RELATIONAL_PRECEDENCE, GT_TOKEN);
+const PrecedenceInfo IS_INFO =
+  const PrecedenceInfo('is',
+                       RELATIONAL_PRECEDENCE, KEYWORD_TOKEN);
+const PrecedenceInfo AS_INFO =
+  const PrecedenceInfo('as',
+                       RELATIONAL_PRECEDENCE, KEYWORD_TOKEN);
+const PrecedenceInfo LT_EQ_INFO =
+  const PrecedenceInfo('<=',
+                       RELATIONAL_PRECEDENCE, LT_EQ_TOKEN);
+const PrecedenceInfo LT_INFO =
+  const PrecedenceInfo('<',
+                       RELATIONAL_PRECEDENCE, LT_TOKEN);
+
+// Shift operators.
+const PrecedenceInfo GT_GT_INFO =
+  const PrecedenceInfo('>>', 12, GT_GT_TOKEN);
+const PrecedenceInfo LT_LT_INFO =
+  const PrecedenceInfo('<<', 12, LT_LT_TOKEN);
+
+// Additive operators.
+const PrecedenceInfo MINUS_INFO =
+  const PrecedenceInfo('-', 13, MINUS_TOKEN);
+const PrecedenceInfo PLUS_INFO =
+  const PrecedenceInfo('+', 13, PLUS_TOKEN);
+
+// Multiplicative operators.
+const PrecedenceInfo PERCENT_INFO =
+  const PrecedenceInfo('%', 14, PERCENT_TOKEN);
+const PrecedenceInfo SLASH_INFO =
+  const PrecedenceInfo('/', 14, SLASH_TOKEN);
+const PrecedenceInfo STAR_INFO =
+  const PrecedenceInfo('*', 14, STAR_TOKEN);
+const PrecedenceInfo TILDE_SLASH_INFO =
+  const PrecedenceInfo('~/', 14, TILDE_SLASH_TOKEN);
+
+const int POSTFIX_PRECEDENCE = 15;
+const PrecedenceInfo PERIOD_INFO =
+  const PrecedenceInfo('.', POSTFIX_PRECEDENCE,
+                       PERIOD_TOKEN);
+const PrecedenceInfo QUESTION_PERIOD_INFO =
+  const PrecedenceInfo('?.', POSTFIX_PRECEDENCE,
+                       QUESTION_PERIOD_TOKEN);
+
+const PrecedenceInfo KEYWORD_INFO =
+  const PrecedenceInfo('keyword', 0, KEYWORD_TOKEN);
+
+const PrecedenceInfo EOF_INFO =
+  const PrecedenceInfo('EOF', 0, EOF_TOKEN);
+
+const PrecedenceInfo IDENTIFIER_INFO =
+  const PrecedenceInfo('identifier', 0, IDENTIFIER_TOKEN);
+
+const PrecedenceInfo BAD_INPUT_INFO =
+  const PrecedenceInfo('malformed input', 0,
+                       BAD_INPUT_TOKEN);
+
+const PrecedenceInfo OPEN_PAREN_INFO =
+  const PrecedenceInfo('(', POSTFIX_PRECEDENCE,
+                       OPEN_PAREN_TOKEN);
+
+const PrecedenceInfo CLOSE_PAREN_INFO =
+  const PrecedenceInfo(')', 0, CLOSE_PAREN_TOKEN);
+
+const PrecedenceInfo OPEN_CURLY_BRACKET_INFO =
+  const PrecedenceInfo('{', 0, OPEN_CURLY_BRACKET_TOKEN);
+
+const PrecedenceInfo CLOSE_CURLY_BRACKET_INFO =
+  const PrecedenceInfo('}', 0, CLOSE_CURLY_BRACKET_TOKEN);
+
+const PrecedenceInfo INT_INFO =
+  const PrecedenceInfo('int', 0, INT_TOKEN);
+
+const PrecedenceInfo STRING_INFO =
+  const PrecedenceInfo('string', 0, STRING_TOKEN);
+
+const PrecedenceInfo OPEN_SQUARE_BRACKET_INFO =
+  const PrecedenceInfo('[', POSTFIX_PRECEDENCE,
+                       OPEN_SQUARE_BRACKET_TOKEN);
+
+const PrecedenceInfo CLOSE_SQUARE_BRACKET_INFO =
+  const PrecedenceInfo(']', 0, CLOSE_SQUARE_BRACKET_TOKEN);
+
+const PrecedenceInfo DOUBLE_INFO =
+  const PrecedenceInfo('double', 0, DOUBLE_TOKEN);
+
+const PrecedenceInfo STRING_INTERPOLATION_INFO =
+  const PrecedenceInfo('\${', 0,
+                       STRING_INTERPOLATION_TOKEN);
+
+const PrecedenceInfo STRING_INTERPOLATION_IDENTIFIER_INFO =
+  const PrecedenceInfo('\$', 0,
+                       STRING_INTERPOLATION_IDENTIFIER_TOKEN);
+
+const PrecedenceInfo HEXADECIMAL_INFO =
+  const PrecedenceInfo('hexadecimal', 0, HEXADECIMAL_TOKEN);
+
+const PrecedenceInfo COMMENT_INFO =
+  const PrecedenceInfo('comment', 0, COMMENT_TOKEN);
diff --git a/pkg/compiler/lib/src/tokens/token.dart b/pkg/compiler/lib/src/tokens/token.dart
new file mode 100644
index 0000000..4c33648
--- /dev/null
+++ b/pkg/compiler/lib/src/tokens/token.dart
@@ -0,0 +1,440 @@
+// 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.
+
+library dart2js.tokens;
+
+import 'dart:convert' show
+    UTF8;
+import 'dart:collection' show
+    HashSet;
+
+import '../common.dart';
+import '../util/util.dart' show
+    computeHashCode;
+
+import 'keyword.dart' show
+    Keyword;
+import 'precedence.dart' show
+    PrecedenceInfo;
+import 'precedence_constants.dart' as Precedence show
+    BAD_INPUT_INFO;
+import 'token_constants.dart' as Tokens show
+    IDENTIFIER_TOKEN;
+
+/**
+ * A token that doubles as a linked list.
+ */
+abstract class Token implements Spannable {
+  /**
+   * The character offset of the start of this token within the source text.
+   */
+  final int charOffset;
+
+  Token(this.charOffset);
+
+  /**
+   * The next token in the token stream.
+   */
+  Token next;
+
+  /**
+   * The precedence info for this token. [info] determines the kind and the
+   * precedence level of this token.
+   *
+   * Defined as getter to save a field in the [KeywordToken] subclass.
+   */
+  PrecedenceInfo get info;
+
+  /**
+   * The string represented by this token, a substring of the source code.
+   *
+   * For [StringToken]s the [value] includes the quotes, explicit escapes, etc.
+   */
+  String get value;
+
+  /**
+   * For symbol and keyword tokens, returns the string value represented by this
+   * token. For [StringToken]s this method returns [:null:].
+   *
+   * For [SymbolToken]s and [KeywordToken]s, the string value is a compile-time
+   * constant originating in the [PrecedenceInfo] or in the [Keyword] instance.
+   * This allows testing for keywords and symbols using [:identical:], e.g.,
+   * [:identical('class', token.value):].
+   *
+   * Note that returning [:null:] for string tokens is important to identify
+   * symbols and keywords, we cannot use [value] instead. The string literal
+   *   "$a($b"
+   * produces ..., SymbolToken($), StringToken(a), StringToken((), ...
+   *
+   * After parsing the identifier 'a', the parser tests for a function
+   * declaration using [:identical(next.stringValue, '('):], which (rightfully)
+   * returns false because stringValue returns [:null:].
+   */
+  String get stringValue;
+
+  /**
+   * The kind enum of this token as determined by its [info].
+   */
+  int get kind => info.kind;
+
+  /**
+   * The precedence level for this token.
+   */
+  int get precedence => info.precedence;
+
+  /**
+   * True if this token is an identifier. Some keywords allowed as identifiers,
+   * see implementation in [KeywordToken].
+   */
+  bool isIdentifier();
+
+  /**
+   * Returns a textual representation of this token to be used for debugging
+   * purposes. The resulting string might contain information about the
+   * structure of the token, for example 'StringToken(foo)' for the identifier
+   * token 'foo'.
+   *
+   * Use [value] for the text actually parsed by the token.
+   */
+  String toString();
+
+  /**
+   * The number of characters parsed by this token.
+   */
+  int get charCount {
+    if (info == Precedence.BAD_INPUT_INFO) {
+      // This is a token that wraps around an error message. Return 1
+      // instead of the size of the length of the error message.
+      return 1;
+    } else {
+      return value.length;
+    }
+  }
+
+  int get hashCode => computeHashCode(charOffset, info, value);
+}
+
+/// A pair of tokens marking the beginning and the end of a span. Use for error
+/// reporting.
+class TokenPair implements Spannable {
+  final Token begin;
+  final Token end;
+
+  TokenPair(this.begin, this.end);
+}
+
+/**
+ * A [SymbolToken] represents the symbol in its precendence info.
+ * Also used for end of file with EOF_INFO.
+ */
+class SymbolToken extends Token {
+
+  final PrecedenceInfo info;
+
+  SymbolToken(this.info, int charOffset) : super(charOffset);
+
+  String get value => info.value;
+
+  String get stringValue => info.value;
+
+  bool isIdentifier() => false;
+
+  String toString() => "SymbolToken($value)";
+}
+
+/**
+ * A [BeginGroupToken] represents a symbol that may be the beginning of
+ * a pair of brackets, i.e., ( { [ < or ${
+ * The [endGroup] token points to the matching closing bracked in case
+ * it can be identified during scanning.
+ */
+class BeginGroupToken extends SymbolToken {
+  Token endGroup;
+
+  BeginGroupToken(PrecedenceInfo info, int charOffset)
+      : super(info, charOffset);
+}
+
+/**
+ * A keyword token.
+ */
+class KeywordToken extends Token {
+  final Keyword keyword;
+
+  KeywordToken(this.keyword, int charOffset) : super(charOffset);
+
+  PrecedenceInfo get info => keyword.info;
+
+  String get value => keyword.syntax;
+
+  String get stringValue => keyword.syntax;
+
+  bool isIdentifier() => keyword.isPseudo || keyword.isBuiltIn;
+
+  String toString() => "KeywordToken($value)";
+}
+
+abstract class ErrorToken extends Token {
+  ErrorToken(int charOffset)
+      : super(charOffset);
+
+  PrecedenceInfo get info => Precedence.BAD_INPUT_INFO;
+
+  String get value {
+    throw new SpannableAssertionFailure(this, assertionMessage);
+  }
+
+  String get stringValue => null;
+
+  bool isIdentifier() => false;
+
+  String get assertionMessage;
+}
+
+class BadInputToken extends ErrorToken {
+  final int character;
+
+  BadInputToken(this.character, int charOffset)
+      : super(charOffset);
+
+  String toString() => "BadInputToken($character)";
+
+  String get assertionMessage {
+    return 'Character U+${character.toRadixString(16)} not allowed here.';
+  }
+}
+
+class UnterminatedToken extends ErrorToken {
+  final String start;
+  final int endOffset;
+
+  UnterminatedToken(this.start, int charOffset, this.endOffset)
+      : super(charOffset);
+
+  String toString() => "UnterminatedToken($start)";
+
+  String get assertionMessage => "'$start' isn't terminated.";
+
+  int get charCount => endOffset - charOffset;
+}
+
+class UnmatchedToken extends ErrorToken {
+  final BeginGroupToken begin;
+
+  UnmatchedToken(BeginGroupToken begin)
+      : this.begin = begin,
+        super(begin.charOffset);
+
+  String toString() => "UnmatchedToken(${begin.value})";
+
+  String get assertionMessage => "'$begin' isn't closed.";
+}
+
+/**
+ * A String-valued token. Represents identifiers, string literals,
+ * number literals, comments, and error tokens, using the corresponding
+ * precedence info.
+ */
+class StringToken extends Token {
+  /**
+   * The length threshold above which substring tokens are computed lazily.
+   *
+   * For string tokens that are substrings of the program source, the actual
+   * substring extraction is performed lazily. This is beneficial because
+   * not all scanned code is actually used. For unused parts, the substrings
+   * are never computed and allocated.
+   */
+  static const int LAZY_THRESHOLD = 4;
+
+  var /* String | LazySubtring */ valueOrLazySubstring;
+
+  final PrecedenceInfo info;
+
+  /**
+   * Creates a non-lazy string token. If [canonicalize] is true, the string
+   * is canonicalized before the token is created.
+   */
+  StringToken.fromString(this.info, String value, int charOffset,
+                         {bool canonicalize : false})
+      : valueOrLazySubstring = canonicalizedString(value, canonicalize),
+        super(charOffset);
+
+  /**
+   * Creates a lazy string token. If [canonicalize] is true, the string
+   * is canonicalized before the token is created.
+   */
+  StringToken.fromSubstring(this.info, String data, int start, int end,
+                            int charOffset, {bool canonicalize : false})
+      : super(charOffset) {
+    int length = end - start;
+    if (length <= LAZY_THRESHOLD) {
+      valueOrLazySubstring = canonicalizedString(data.substring(start, end),
+                                                 canonicalize);
+    } else {
+      valueOrLazySubstring =
+          new LazySubstring(data, start, length, canonicalize);
+    }
+  }
+
+  /**
+   * Creates a lazy string token. If [asciiOnly] is false, the byte array
+   * is passed through a UTF-8 decoder.
+   */
+  StringToken.fromUtf8Bytes(this.info, List<int> data, int start, int end,
+                            bool asciiOnly, int charOffset)
+      : super(charOffset) {
+    int length = end - start;
+    if (length <= LAZY_THRESHOLD) {
+      valueOrLazySubstring = decodeUtf8(data, start, end, asciiOnly);
+    } else {
+      valueOrLazySubstring = new LazySubstring(data, start, length, asciiOnly);
+    }
+  }
+
+  String get value {
+    if (valueOrLazySubstring is String) {
+      return valueOrLazySubstring;
+    } else {
+      assert(valueOrLazySubstring is LazySubstring);
+      var data = valueOrLazySubstring.data;
+      int start = valueOrLazySubstring.start;
+      int end = start + valueOrLazySubstring.length;
+      if (data is String) {
+        valueOrLazySubstring = canonicalizedString(
+            data.substring(start, end), valueOrLazySubstring.boolValue);
+      } else {
+        valueOrLazySubstring = decodeUtf8(
+            data, start, end, valueOrLazySubstring.boolValue);
+      }
+      return valueOrLazySubstring;
+    }
+  }
+
+  /// See [Token.stringValue] for an explanation.
+  String get stringValue => null;
+
+  bool isIdentifier() => identical(kind, Tokens.IDENTIFIER_TOKEN);
+
+  String toString() => "StringToken($value)";
+
+  static final HashSet<String> canonicalizedSubstrings =
+      new HashSet<String>();
+
+  static String canonicalizedString(String s, bool canonicalize) {
+    if (!canonicalize) return s;
+    var result = canonicalizedSubstrings.lookup(s);
+    if (result != null) return result;
+    canonicalizedSubstrings.add(s);
+    return s;
+  }
+
+  static String decodeUtf8(List<int> data, int start, int end, bool asciiOnly) {
+    var s;
+    if (asciiOnly) {
+      s = new String.fromCharCodes(data, start, end);
+    } else {
+      s = UTF8.decoder.convert(data, start, end);
+    }
+    return canonicalizedString(s, true);
+  }
+}
+
+/**
+ * This class represents the necessary information to compute a substring
+ * lazily. The substring can either originate from a string or from
+ * a [:List<int>:] of UTF-8 bytes.
+ */
+abstract class LazySubstring {
+  /** The original data, either a string or a List<int> */
+  get data;
+
+  int get start;
+  int get length;
+
+  /**
+   * If this substring is based on a String, the [boolValue] indicates wheter
+   * the resulting substring should be canonicalized.
+   *
+   * For substrings based on a byte array, the [boolValue] is true if the
+   * array only holds ASCII characters. The resulting substring will be
+   * canonicalized after decoding.
+   */
+  bool get boolValue;
+
+  LazySubstring.internal();
+
+  factory LazySubstring(data, int start, int length, bool b) {
+    // See comment on [CompactLazySubstring].
+    if (start < 0x100000 && length < 0x200) {
+      int fields = (start << 9);
+      fields = fields | length;
+      fields = fields << 1;
+      if (b) fields |= 1;
+      return new CompactLazySubstring(data, fields);
+    } else {
+      return new FullLazySubstring(data, start, length, b);
+    }
+  }
+}
+
+/**
+ * This class encodes [start], [length] and [boolValue] in a single
+ * 30 bit integer. It uses 20 bits for [start], which covers source files
+ * of 1MB. [length] has 9 bits, which covers 512 characters.
+ *
+ * The file html_dart2js.dart is currently around 1MB.
+ */
+class CompactLazySubstring extends LazySubstring {
+  final data;
+  final int fields;
+
+  CompactLazySubstring(this.data, this.fields) : super.internal();
+
+  int get start => fields >> 10;
+  int get length => (fields >> 1) & 0x1ff;
+  bool get boolValue => (fields & 1) == 1;
+}
+
+class FullLazySubstring extends LazySubstring {
+  final data;
+  final int start;
+  final int length;
+  final bool boolValue;
+  FullLazySubstring(this.data, this.start, this.length, this.boolValue)
+      : super.internal();
+}
+
+bool isUserDefinableOperator(String value) {
+  return
+      isBinaryOperator(value) ||
+      isMinusOperator(value) ||
+      isTernaryOperator(value) ||
+      isUnaryOperator(value);
+}
+
+bool isUnaryOperator(String value) => identical(value, '~');
+
+bool isBinaryOperator(String value) {
+  return
+      (identical(value, '==')) ||
+      (identical(value, '[]')) ||
+      (identical(value, '*')) ||
+      (identical(value, '/')) ||
+      (identical(value, '%')) ||
+      (identical(value, '~/')) ||
+      (identical(value, '+')) ||
+      (identical(value, '<<')) ||
+      (identical(value, '>>')) ||
+      (identical(value, '>=')) ||
+      (identical(value, '>')) ||
+      (identical(value, '<=')) ||
+      (identical(value, '<')) ||
+      (identical(value, '&')) ||
+      (identical(value, '^')) ||
+      (identical(value, '|'));
+}
+
+bool isTernaryOperator(String value) => identical(value, '[]=');
+
+bool isMinusOperator(String value) => identical(value, '-');
diff --git a/pkg/compiler/lib/src/tokens/token_constants.dart b/pkg/compiler/lib/src/tokens/token_constants.dart
new file mode 100644
index 0000000..c1078f0
--- /dev/null
+++ b/pkg/compiler/lib/src/tokens/token_constants.dart
@@ -0,0 +1,82 @@
+// 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 dart2js.tokens.constants;
+
+import '../util/characters.dart';
+
+const int EOF_TOKEN = 0;
+
+const int KEYWORD_TOKEN = $k;
+const int IDENTIFIER_TOKEN = $a;
+const int BAD_INPUT_TOKEN = $X;
+const int DOUBLE_TOKEN = $d;
+const int INT_TOKEN = $i;
+const int HEXADECIMAL_TOKEN = $x;
+const int STRING_TOKEN = $SQ;
+
+const int AMPERSAND_TOKEN = $AMPERSAND;
+const int BACKPING_TOKEN = $BACKPING;
+const int BACKSLASH_TOKEN = $BACKSLASH;
+const int BANG_TOKEN = $BANG;
+const int BAR_TOKEN = $BAR;
+const int COLON_TOKEN = $COLON;
+const int COMMA_TOKEN = $COMMA;
+const int EQ_TOKEN = $EQ;
+const int GT_TOKEN = $GT;
+const int HASH_TOKEN = $HASH;
+const int OPEN_CURLY_BRACKET_TOKEN = $OPEN_CURLY_BRACKET;
+const int OPEN_SQUARE_BRACKET_TOKEN = $OPEN_SQUARE_BRACKET;
+const int OPEN_PAREN_TOKEN = $OPEN_PAREN;
+const int LT_TOKEN = $LT;
+const int MINUS_TOKEN = $MINUS;
+const int PERIOD_TOKEN = $PERIOD;
+const int PLUS_TOKEN = $PLUS;
+const int QUESTION_TOKEN = $QUESTION;
+const int AT_TOKEN = $AT;
+const int CLOSE_CURLY_BRACKET_TOKEN = $CLOSE_CURLY_BRACKET;
+const int CLOSE_SQUARE_BRACKET_TOKEN = $CLOSE_SQUARE_BRACKET;
+const int CLOSE_PAREN_TOKEN = $CLOSE_PAREN;
+const int SEMICOLON_TOKEN = $SEMICOLON;
+const int SLASH_TOKEN = $SLASH;
+const int TILDE_TOKEN = $TILDE;
+const int STAR_TOKEN = $STAR;
+const int PERCENT_TOKEN = $PERCENT;
+const int CARET_TOKEN = $CARET;
+
+const int STRING_INTERPOLATION_TOKEN = 128;
+const int LT_EQ_TOKEN = STRING_INTERPOLATION_TOKEN + 1;
+const int FUNCTION_TOKEN = LT_EQ_TOKEN + 1;
+const int SLASH_EQ_TOKEN = FUNCTION_TOKEN + 1;
+const int PERIOD_PERIOD_PERIOD_TOKEN = SLASH_EQ_TOKEN + 1;
+const int PERIOD_PERIOD_TOKEN = PERIOD_PERIOD_PERIOD_TOKEN + 1;
+const int EQ_EQ_EQ_TOKEN = PERIOD_PERIOD_TOKEN + 1;
+const int EQ_EQ_TOKEN = EQ_EQ_EQ_TOKEN + 1;
+const int LT_LT_EQ_TOKEN = EQ_EQ_TOKEN + 1;
+const int LT_LT_TOKEN = LT_LT_EQ_TOKEN + 1;
+const int GT_EQ_TOKEN = LT_LT_TOKEN + 1;
+const int GT_GT_EQ_TOKEN = GT_EQ_TOKEN + 1;
+const int INDEX_EQ_TOKEN = GT_GT_EQ_TOKEN + 1;
+const int INDEX_TOKEN = INDEX_EQ_TOKEN + 1;
+const int BANG_EQ_EQ_TOKEN = INDEX_TOKEN + 1;
+const int BANG_EQ_TOKEN = BANG_EQ_EQ_TOKEN + 1;
+const int AMPERSAND_AMPERSAND_TOKEN = BANG_EQ_TOKEN + 1;
+const int AMPERSAND_EQ_TOKEN = AMPERSAND_AMPERSAND_TOKEN + 1;
+const int BAR_BAR_TOKEN = AMPERSAND_EQ_TOKEN + 1;
+const int BAR_EQ_TOKEN = BAR_BAR_TOKEN + 1;
+const int STAR_EQ_TOKEN = BAR_EQ_TOKEN + 1;
+const int PLUS_PLUS_TOKEN = STAR_EQ_TOKEN + 1;
+const int PLUS_EQ_TOKEN = PLUS_PLUS_TOKEN + 1;
+const int MINUS_MINUS_TOKEN = PLUS_EQ_TOKEN + 1;
+const int MINUS_EQ_TOKEN = MINUS_MINUS_TOKEN + 1;
+const int TILDE_SLASH_EQ_TOKEN = MINUS_EQ_TOKEN + 1;
+const int TILDE_SLASH_TOKEN = TILDE_SLASH_EQ_TOKEN + 1;
+const int PERCENT_EQ_TOKEN = TILDE_SLASH_TOKEN + 1;
+const int GT_GT_TOKEN = PERCENT_EQ_TOKEN + 1;
+const int CARET_EQ_TOKEN = GT_GT_TOKEN + 1;
+const int COMMENT_TOKEN = CARET_EQ_TOKEN + 1;
+const int STRING_INTERPOLATION_IDENTIFIER_TOKEN = COMMENT_TOKEN + 1;
+const int QUESTION_PERIOD_TOKEN = STRING_INTERPOLATION_IDENTIFIER_TOKEN + 1;
+const int QUESTION_QUESTION_TOKEN = QUESTION_PERIOD_TOKEN + 1;
+const int QUESTION_QUESTION_EQ_TOKEN = QUESTION_QUESTION_TOKEN + 1;
diff --git a/pkg/compiler/lib/src/tokens/token_map.dart b/pkg/compiler/lib/src/tokens/token_map.dart
new file mode 100644
index 0000000..55b4d30
--- /dev/null
+++ b/pkg/compiler/lib/src/tokens/token_map.dart
@@ -0,0 +1,47 @@
+// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library dart2js.tokens.token_map;
+
+import 'token.dart' show
+    Token;
+
+/**
+ * Key class used in [TokenMap] in which the hash code for a token is based
+ * on the [charOffset].
+ */
+class TokenKey {
+  final Token token;
+  TokenKey(this.token);
+  int get hashCode => token.charOffset;
+  operator==(other) => other is TokenKey && token == other.token;
+}
+
+/// Map of tokens and the first associated comment.
+/*
+ * This implementation was chosen among several candidates for its space/time
+ * efficiency by empirical tests of running dartdoc on dartdoc itself. Time
+ * measurements for the use of [Compiler.commentMap]:
+ *
+ * 1) Using [TokenKey] as key (this class): ~80 msec
+ * 2) Using [TokenKey] as key + storing a separate map in each script: ~120 msec
+ * 3) Using [Token] as key in a [Map]: ~38000 msec
+ * 4) Storing comments is new field in [Token]: ~20 msec
+ *    (Abandoned due to the increased memory usage)
+ * 5) Storing comments in an [Expando]: ~14000 msec
+ * 6) Storing token/comments pairs in a linked list: ~5400 msec
+ */
+class TokenMap {
+  Map<TokenKey,Token> comments = new Map<TokenKey,Token>();
+
+  Token operator[] (Token key) {
+    if (key == null) return null;
+    return comments[new TokenKey(key)];
+  }
+
+  void operator[]= (Token key, Token value) {
+    if (key == null) return;
+    comments[new TokenKey(key)] = value;
+  }
+}
diff --git a/pkg/compiler/lib/src/tracer.dart b/pkg/compiler/lib/src/tracer.dart
index 32327c3..bc50222 100644
--- a/pkg/compiler/lib/src/tracer.dart
+++ b/pkg/compiler/lib/src/tracer.dart
@@ -4,16 +4,23 @@
 
 library tracer;
 
-import '../compiler.dart' as api;
 import 'dart:async' show EventSink;
+import '../compiler.dart' as api;
+import 'common/work.dart' show
+    ItemCompilationContext;
+import 'compiler.dart' show
+    Compiler;
 import 'ssa/ssa.dart' as ssa;
-import 'ssa/ssa_tracer.dart' show HTracer;
+import 'ssa/ssa_tracer.dart' show
+    HTracer;
 import 'cps_ir/cps_ir_nodes.dart' as cps_ir;
-import 'cps_ir/cps_ir_tracer.dart' show IRTracer;
+import 'cps_ir/cps_ir_tracer.dart' show
+    IRTracer;
 import 'tree_ir/tree_ir_nodes.dart' as tree_ir;
-import 'tree_ir/tree_ir_tracer.dart' show TreeTracer;
-import 'util/util.dart' show Indentation;
-import 'dart2jslib.dart';
+import 'tree_ir/tree_ir_tracer.dart' show
+    TreeTracer;
+import 'util/util.dart' show
+    Indentation;
 
 /**
  * If non-null, we only trace methods whose name match the regexp defined by the
diff --git a/pkg/compiler/lib/src/tree/nodes.dart b/pkg/compiler/lib/src/tree/nodes.dart
index 6461256..7ef28dc 100644
--- a/pkg/compiler/lib/src/tree/nodes.dart
+++ b/pkg/compiler/lib/src/tree/nodes.dart
@@ -9,6 +9,7 @@
 
   R visitNode(Node node);
 
+  R visitAssert(Assert node) => visitStatement(node);
   R visitAsyncForIn(AsyncForIn node) => visitLoop(node);
   R visitAsyncModifier(AsyncModifier node) => visitNode(node);
   R visitAwait(Await node) => visitExpression(node);
@@ -146,6 +147,7 @@
 
   Token getEndToken();
 
+  Assert asAssert() => null;
   AsyncModifier asAsyncModifier() => null;
   Await asAwait() => null;
   Block asBlock() => null;
@@ -486,6 +488,9 @@
 
   accept(Visitor visitor) => visitor.visitSendSet(this);
 
+  /// `true` if this send is not a simple assignment.
+  bool get isComplex => !identical(assignmentOperator.source, '=');
+
   /// Whether this is an if-null assignment of the form `a ??= b`.
   bool get isIfNullAssignment =>
       identical(assignmentOperator.source, '??=');
@@ -849,7 +854,9 @@
   int get value {
     try {
       Token valueToken = token;
-      if (identical(valueToken.kind, PLUS_TOKEN)) valueToken = valueToken.next;
+      if (identical(valueToken.kind, Tokens.PLUS_TOKEN)) {
+        valueToken = valueToken.next;
+      }
       return int.parse(valueToken.value);
     } on FormatException catch (ex) {
       (this.handler)(token, ex);
@@ -868,7 +875,9 @@
   double get value {
     try {
       Token valueToken = token;
-      if (identical(valueToken.kind, PLUS_TOKEN)) valueToken = valueToken.next;
+      if (identical(valueToken.kind, Tokens.PLUS_TOKEN)) {
+        valueToken = valueToken.next;
+      }
       return double.parse(valueToken.value);
     } on FormatException catch (ex) {
       (this.handler)(token, ex);
@@ -1084,7 +1093,7 @@
   bool get hasExpression => expression != null;
 
   /// `true` if this return is of the form `=> e;`.
-  bool get isArrowBody => beginToken.info == FUNCTION_INFO;
+  bool get isArrowBody => beginToken.info == Precedence.FUNCTION_INFO;
 
   accept(Visitor visitor) => visitor.visitReturn(this);
 
@@ -1204,6 +1213,30 @@
   Token getEndToken() => expression.getEndToken();
 }
 
+class Assert extends Statement {
+  final Token assertToken;
+  final Expression condition;
+  /** Message may be `null`. */
+  final Expression message;
+  final Token semicolonToken;
+
+  Assert(this.assertToken, this.condition, this.message, this.semicolonToken);
+
+  Assert asAssert() => this;
+
+  bool get hasMessage => message != null;
+
+  accept(Visitor visitor) => visitor.visitAssert(this);
+
+  visitChildren(Visitor visitor) {
+    condition.accept(visitor);
+    if (message != null) message.accept(visitor);
+  }
+
+  Token getBeginToken() => assertToken;
+  Token getEndToken() => semicolonToken;
+}
+
 class Rethrow extends Statement {
   final Token throwToken;
   final Token endToken;
@@ -1890,7 +1923,7 @@
 }
 
 abstract class LibraryTag extends Node {
-  final Link<MetadataAnnotation> metadata;
+  final List<MetadataAnnotation> metadata;
 
   LibraryTag(this.metadata);
 
@@ -1908,7 +1941,7 @@
 
   LibraryName(this.libraryKeyword,
               this.name,
-              Link<MetadataAnnotation> metadata)
+              List<MetadataAnnotation> metadata)
     : super(metadata);
 
   bool get isLibraryName => true;
@@ -1935,7 +1968,7 @@
 
   LibraryDependency(this.uri,
                     this.combinators,
-                    Link<MetadataAnnotation> metadata)
+                    List<MetadataAnnotation> metadata)
     : super(metadata);
 
   LibraryDependency asLibraryDependency() => this;
@@ -1955,7 +1988,7 @@
 
   Import(this.importKeyword, StringNode uri,
          this.prefix, NodeList combinators,
-         Link<MetadataAnnotation> metadata,
+         List<MetadataAnnotation> metadata,
          {this.isDeferred})
       : super(uri, combinators, metadata);
 
@@ -2020,7 +2053,7 @@
   Export(this.exportKeyword,
          StringNode uri,
          NodeList combinators,
-         Link<MetadataAnnotation> metadata)
+         List<MetadataAnnotation> metadata)
       : super(uri, combinators, metadata);
 
   bool get isExport => true;
@@ -2047,7 +2080,7 @@
 
   final Token partKeyword;
 
-  Part(this.partKeyword, this.uri, Link<MetadataAnnotation> metadata)
+  Part(this.partKeyword, this.uri, List<MetadataAnnotation> metadata)
     : super(metadata);
 
   bool get isPart => true;
@@ -2068,7 +2101,7 @@
 
   final Token partKeyword;
 
-  final Link<MetadataAnnotation> metadata;
+  final List<MetadataAnnotation> metadata;
 
   PartOf(this.partKeyword, this.name, this.metadata);
 
diff --git a/pkg/compiler/lib/src/tree/prettyprint.dart b/pkg/compiler/lib/src/tree/prettyprint.dart
index ab4c87c..5096e74 100644
--- a/pkg/compiler/lib/src/tree/prettyprint.dart
+++ b/pkg/compiler/lib/src/tree/prettyprint.dart
@@ -39,6 +39,10 @@
     closeNode();
   }
 
+  visitAssert(Assert node) {
+    visitNodeWithChildren(node, "Assert");
+  }
+
   visitAsyncModifier(AsyncModifier node) {
     openAndCloseNode(node, "AsyncModifier",
         {'asyncToken': node.asyncToken,
diff --git a/pkg/compiler/lib/src/tree/tree.dart b/pkg/compiler/lib/src/tree/tree.dart
index f69c3a4..8c65fab 100644
--- a/pkg/compiler/lib/src/tree/tree.dart
+++ b/pkg/compiler/lib/src/tree/tree.dart
@@ -6,14 +6,25 @@
 
 import 'dart:collection';
 
-import '../scanner/scannerlib.dart';
+import '../common.dart';
+import '../tokens/precedence_constants.dart' as Precedence show
+    FUNCTION_INFO;
+import '../tokens/token.dart' show
+    BeginGroupToken,
+    Token;
+import '../tokens/token_constants.dart' as Tokens show
+    IDENTIFIER_TOKEN,
+    KEYWORD_TOKEN,
+    PLUS_TOKEN;
 import '../util/util.dart';
 import '../util/characters.dart';
 
-import '../resolution/secret_tree_element.dart'
-    show StoredTreeElementMixin, NullTreeElementMixin;
+import '../resolution/secret_tree_element.dart' show
+    NullTreeElementMixin,
+    StoredTreeElementMixin;
 
-import '../elements/elements.dart' show MetadataAnnotation;
+import '../elements/elements.dart' show
+    MetadataAnnotation;
 
 part 'dartstring.dart';
 part 'nodes.dart';
diff --git a/pkg/compiler/lib/src/tree/unparser.dart b/pkg/compiler/lib/src/tree/unparser.dart
index b7d3109..6f141fd 100644
--- a/pkg/compiler/lib/src/tree/unparser.dart
+++ b/pkg/compiler/lib/src/tree/unparser.dart
@@ -34,8 +34,8 @@
   void addToken(Token token) {
     if (token == null) return;
     write(token.value);
-    if (identical(token.kind, KEYWORD_TOKEN)
-        || identical(token.kind, IDENTIFIER_TOKEN)) {
+    if (identical(token.kind, Tokens.KEYWORD_TOKEN)
+        || identical(token.kind, Tokens.IDENTIFIER_TOKEN)) {
       write(' ');
     }
   }
@@ -58,6 +58,18 @@
     if (node != null) node.accept(this);
   }
 
+  visitAssert(Assert node) {
+    write(node.assertToken.value);
+    write('(');
+    visit(node.condition);
+    if (node.hasMessage) {
+      write(',');
+      space();
+      visit(node.message);
+    }
+    write(');');
+  }
+
   visitBlock(Block node) => unparseBlockStatements(node.statements);
 
   unparseBlockStatements(NodeList statements) {
@@ -209,7 +221,7 @@
       } else {
         visit(send.receiver);
         Identifier identifier = send.selector.asIdentifier();
-        if (identical(identifier.token.kind, KEYWORD_TOKEN)) {
+        if (identical(identifier.token.kind, Tokens.KEYWORD_TOKEN)) {
           write(' ');
         } else if (identifier.source == 'negate') {
           // TODO(ahe): Remove special case for negate.
@@ -292,13 +304,13 @@
   visitLiteralDouble(LiteralDouble node) {
     write(node.token.value);
     // -Lit is represented as a send.
-    if (node.token.kind == PLUS_TOKEN) write(node.token.next.value);
+    if (node.token.kind == Tokens.PLUS_TOKEN) write(node.token.next.value);
   }
 
   visitLiteralInt(LiteralInt node) {
     write(node.token.value);
     // -Lit is represented as a send.
-    if (node.token.kind == PLUS_TOKEN) write(node.token.next.value);
+    if (node.token.kind == Tokens.PLUS_TOKEN) write(node.token.next.value);
   }
 
   visitLiteralString(LiteralString node) {
@@ -698,6 +710,11 @@
     indentLess();
   }
 
+  unparseLibraryName(String libraryName) {
+    write('library $libraryName;');
+    newline();
+  }
+
   unparseImportTag(String uri, {String prefix,
                                 List<String> shows: const <String>[],
                                 bool isDeferred: false}) {
diff --git a/pkg/compiler/lib/src/tree_ir/optimization/logical_rewriter.dart b/pkg/compiler/lib/src/tree_ir/optimization/logical_rewriter.dart
index 2b614ae..4f0be4a 100644
--- a/pkg/compiler/lib/src/tree_ir/optimization/logical_rewriter.dart
+++ b/pkg/compiler/lib/src/tree_ir/optimization/logical_rewriter.dart
@@ -95,7 +95,8 @@
 
   bool isTerminator(Statement node) {
     return (node is Jump || node is Return) && !isFallthrough(node) ||
-           (node is ExpressionStatement && node.next is Unreachable);
+           (node is ExpressionStatement && node.next is Unreachable) ||
+           node is Throw;
   }
 
   Statement visitIf(If node) {
@@ -190,7 +191,7 @@
     return node;
   }
 
-  Statement visitWhileCondition(WhileCondition node) {
+  Statement visitFor(For node) {
     fallthrough.push(node);
     node.condition = makeCondition(node.condition, true, liftNots: false);
     node.body = visitStatement(node.body);
@@ -306,6 +307,17 @@
       node.elseExpression = tmp;
     }
 
+    // x ? y : x ==> x && y
+    if (isSameVariable(node.condition, node.elseExpression)) {
+      destroyVariableUse(node.elseExpression);
+      return new LogicalOperator.and(node.condition, node.thenExpression);
+    }
+    // x ? x : y ==> x || y
+    if (isSameVariable(node.condition, node.thenExpression)) {
+      destroyVariableUse(node.thenExpression);
+      return new LogicalOperator.or(node.condition, node.elseExpression);
+    }
+
     return node;
   }
 
@@ -323,8 +335,13 @@
     return isTrue(e) ||
            isFalse(e) ||
            e is Not ||
-           e is LogicalOperator ||
-           e is ApplyBuiltinOperator && operatorReturnsBool(e.operator);
+           e is LogicalOperator && isBooleanValuedLogicalOperator(e) ||
+           e is ApplyBuiltinOperator && operatorReturnsBool(e.operator) ||
+           e is TypeOperator && isBooleanValuedTypeOperator(e);
+  }
+
+  bool isBooleanValuedLogicalOperator(LogicalOperator e) {
+    return isBooleanValued(e.left) && isBooleanValued(e.right);
   }
 
   /// True if the given operator always returns `true` or `false`.
@@ -342,12 +359,17 @@
       case BuiltinOperator.IsNotNumber:
       case BuiltinOperator.IsFloor:
       case BuiltinOperator.IsNumberAndFloor:
+      case BuiltinOperator.Identical:
         return true;
       default:
         return false;
     }
   }
 
+  bool isBooleanValuedTypeOperator(TypeOperator e) {
+    return e.isTypeTest;
+  }
+
   BuiltinOperator negateBuiltin(BuiltinOperator operator) {
     switch (operator) {
       case BuiltinOperator.StrictEq: return BuiltinOperator.StrictNeq;
@@ -467,6 +489,18 @@
         e.elseExpression = (e.elseExpression as Not).operand;
         return new Not(e);
       }
+
+      // x ? y : x ==> x && y
+      if (isSameVariable(e.condition, e.elseExpression)) {
+        destroyVariableUse(e.elseExpression);
+        return new LogicalOperator.and(e.condition, e.thenExpression);
+      }
+      // x ? x : y ==> x || y
+      if (isSameVariable(e.condition, e.thenExpression)) {
+        destroyVariableUse(e.thenExpression);
+        return new LogicalOperator.or(e.condition, e.elseExpression);
+      }
+
       return e;
     }
     if (e is Constant && e.value.isBool) {
@@ -508,5 +542,22 @@
       return new LogicalOperator.or(e1, e2);
     }
   }
-}
 
+  /// True if [e2] is known to return the same value as [e1] 
+  /// (with no additional side effects) if evaluated immediately after [e1].
+  /// 
+  /// Concretely, this is true if [e1] and [e2] are uses of the same variable,
+  /// or if [e2] is a use of a variable assigned by [e1].
+  bool isSameVariable(Expression e1, Expression e2) {
+    if (e1 is VariableUse) {
+      return e2 is VariableUse && e1.variable == e2.variable;
+    } else if (e1 is Assign) {
+      return e2 is VariableUse && e1.variable == e2.variable;
+    }
+    return false;
+  }
+
+  void destroyVariableUse(VariableUse node) {
+    --node.variable.readCount;
+  }
+}
diff --git a/pkg/compiler/lib/src/tree_ir/optimization/loop_rewriter.dart b/pkg/compiler/lib/src/tree_ir/optimization/loop_rewriter.dart
index 8287bac..14069e8 100644
--- a/pkg/compiler/lib/src/tree_ir/optimization/loop_rewriter.dart
+++ b/pkg/compiler/lib/src/tree_ir/optimization/loop_rewriter.dart
@@ -7,7 +7,7 @@
 import 'optimization.dart' show Pass;
 import '../tree_ir_nodes.dart';
 
-/// Rewrites [WhileTrue] statements.
+/// Rewrites [WhileTrue] statements into [For] statements.
 ///
 /// Before this phase, loops usually contain a lot of "exit code", that is,
 /// code that happens at a point where a [Continue] can no longer be reached,
@@ -50,16 +50,40 @@
 ///
 /// A similar transformation is used when S2 occurs in the 'then' position.
 ///
-/// Note that the last pattern above needs no iteration since nested ifs
-/// have been collapsed previously in the [StatementRewriter] phase.
+/// Note that the pattern above needs no iteration since nested ifs have been
+/// collapsed previously in the [StatementRewriter] phase.
+/// 
 ///
-/// [WhileCondition] statements exist only after this phase.
+/// PULL INTO UPDATE EXPRESSION:
+/// 
+/// Assignment expressions before the unique continue to a [whileCondition] are
+/// pulled into the updates for the loop.
+/// 
+///   L:
+///   for (; condition; updates) {
+///     S [ x = E; continue L ]
+///   }
+///     ==>
+///   L:
+///   for (; condition; updates, x = E) {
+///     S [ continue L ]
+///   }
+///
+/// The decision to only pull in assignments is a heuristic to balance 
+/// readability and stack trace usability versus the modest code size
+/// reduction one might get by aggressively moving expressions into the
+/// updates.
 class LoopRewriter extends RecursiveTransformer
                    implements Pass {
   String get passName => 'Loop rewriter';
 
   Set<Label> usedContinueLabels = new Set<Label>();
 
+  /// Maps loop labels to a list, if that loop can accept update expressions.
+  /// The list will then be populated while traversing the body of that loop.
+  /// If a loop is not in the map, update expressions cannot be hoisted there.
+  Map<Label, List<Expression>> updateExpressions = <Label, List<Expression>>{};
+
   void rewrite(FunctionDefinition root) {
     root.body = visitStatement(root.body);
   }
@@ -96,26 +120,29 @@
       }
     }
 
-    // Rewrite while(true) to while(condition).
+    // Rewrite while(true) to for(; condition; updates).
     Statement loop = node;
     if (node.body is If) {
       If body = node.body;
+      updateExpressions[node.label] = <Expression>[];
       body.thenStatement = visitStatement(body.thenStatement);
       bool thenHasContinue = usedContinueLabels.remove(node.label);
       body.elseStatement = visitStatement(body.elseStatement);
       bool elseHasContinue = usedContinueLabels.remove(node.label);
       if (thenHasContinue && !elseHasContinue) {
         node.label.binding = null; // Prepare to rebind the label.
-        loop = new WhileCondition(
+        loop = new For(
             node.label,
             body.condition,
+            updateExpressions[node.label],
             body.thenStatement,
             body.elseStatement);
       } else if (!thenHasContinue && elseHasContinue) {
         node.label.binding = null;
-        loop = new WhileCondition(
+        loop = new For(
             node.label,
             new Not(body.condition),
+            updateExpressions[node.label],
             body.elseStatement,
             body.thenStatement);
       }
@@ -133,4 +160,42 @@
     tail.body = loop;
     return head;
   }
+
+  Statement visitExpressionStatement(ExpressionStatement node) {
+    if (updateExpressions.isEmpty) {
+      // Avoid allocating a list if there is no loop.
+      return super.visitExpressionStatement(node);
+    }
+    List<ExpressionStatement> statements = <ExpressionStatement>[];
+    while (node.next is ExpressionStatement) {
+      statements.add(node);
+      node = node.next;
+    }
+    statements.add(node);
+    Statement next = visitStatement(node.next);
+    if (next is Continue && next.target.useCount == 1) {
+      List<Expression> updates = updateExpressions[next.target];
+      if (updates != null) {
+        // Pull expressions before the continue into the for loop update.
+        // As a heuristic, we only pull in assignment expressions.
+        // Determine the index of the first assignment to pull in.
+        int index = statements.length;
+        while (index > 0 && statements[index - 1].expression is Assign) {
+          --index;
+        }
+        for (ExpressionStatement stmt in statements.skip(index)) {
+          updates.add(stmt.expression);
+        }
+        if (index > 0) {
+          statements[index - 1].next = next;
+          return statements.first;
+        } else {
+          return next;
+        }
+      }
+    }
+    // The expression statements could not be pulled into a loop update.
+    node.next = next;
+    return statements.first;
+  }
 }
diff --git a/pkg/compiler/lib/src/tree_ir/optimization/pull_into_initializers.dart b/pkg/compiler/lib/src/tree_ir/optimization/pull_into_initializers.dart
index 1820f1d..878d8e1 100644
--- a/pkg/compiler/lib/src/tree_ir/optimization/pull_into_initializers.dart
+++ b/pkg/compiler/lib/src/tree_ir/optimization/pull_into_initializers.dart
@@ -160,7 +160,7 @@
     return node;
   }
 
-  Statement visitWhileCondition(WhileCondition node) {
+  Statement visitFor(For node) {
     return node;
   }
 
@@ -315,6 +315,11 @@
     return node;
   }
 
+  Expression visitGetTypeTestProperty(GetTypeTestProperty node) {
+    super.visitGetTypeTestProperty(node);
+    return node;
+  }
+
   Expression visitGetLength(GetLength node) {
     super.visitGetLength(node);
     ++impureCounter;
@@ -347,6 +352,17 @@
     return node;
   }
 
+  Expression visitApplyBuiltinMethod(ApplyBuiltinMethod node) {
+    node.receiver = visitExpression(node.receiver);
+    if (!node.receiverIsNotNull) {
+      // If the receiver is null, the method lookup throws.
+      ++impureCounter;
+    }
+    rewriteList(node.arguments);
+    ++impureCounter;
+    return node;
+  }
+
   @override
   Expression visitForeignExpression(ForeignExpression node) {
     rewriteList(node.arguments);
diff --git a/pkg/compiler/lib/src/tree_ir/optimization/statement_rewriter.dart b/pkg/compiler/lib/src/tree_ir/optimization/statement_rewriter.dart
index 6c864be..0091ef9 100644
--- a/pkg/compiler/lib/src/tree_ir/optimization/statement_rewriter.dart
+++ b/pkg/compiler/lib/src/tree_ir/optimization/statement_rewriter.dart
@@ -207,15 +207,19 @@
     return newJump != null ? newJump : jump;
   }
 
-  void inEmptyEnvironment(void action()) {
+  void inEmptyEnvironment(void action(), {bool keepConstants: true}) {
     List oldEnvironment = environment;
     Map oldConstantEnvironment = constantEnvironment;
     environment = <Expression>[];
-    constantEnvironment = <Variable, Expression>{};
+    if (!keepConstants) {
+      constantEnvironment = <Variable, Expression>{};
+    }
     action();
     assert(environment.isEmpty);
     environment = oldEnvironment;
-    constantEnvironment = oldConstantEnvironment;
+    if (!keepConstants) {
+      constantEnvironment = oldConstantEnvironment;
+    }
   }
 
   /// Left-hand side of the given assignment, or `null` if not an assignment.
@@ -354,8 +358,9 @@
     return exp is Constant ||
            exp is This ||
            exp is CreateInvocationMirror ||
+           exp is CreateInstance ||
+           exp is CreateBox ||
            exp is GetStatic && exp.element.isFunction ||
-           exp is GetField && exp.objectIsNotNull && exp.field.isFinal ||
            exp is Interceptor ||
            exp is ApplyBuiltinOperator ||
            exp is VariableUse && constantEnvironment.containsKey(exp.variable);
@@ -387,7 +392,7 @@
   }
 
   /// Attempts to propagate an assignment in an expression statement.
-  /// 
+  ///
   /// Returns a callback to be invoked after the sucessor statement has
   /// been processed.
   Function processExpressionStatement(ExpressionStatement stmt) {
@@ -405,7 +410,7 @@
         return (Statement next) {
           popDominatingAssignment(leftHand);
           if (assign.variable.readCount > 0) {
-            // The assignment could not be propagated into the successor, 
+            // The assignment could not be propagated into the successor,
             // either because it [hasUnsafeVariableUse] or because the
             // use is outside the current try block, and we do not currently
             // support constant propagation out of a try block.
@@ -491,6 +496,21 @@
     return node;
   }
 
+  Expression visitApplyBuiltinMethod(ApplyBuiltinMethod node) {
+    if (node.receiverIsNotNull) {
+      _rewriteList(node.arguments);
+      node.receiver = visitExpression(node.receiver);
+    } else {
+      // Impure expressions cannot be propagated across the method lookup,
+      // because it throws when the receiver is null.
+      inEmptyEnvironment(() {
+        _rewriteList(node.arguments);
+      });
+      node.receiver = visitExpression(node.receiver);
+    }
+    return node;
+  }
+
   Expression visitInvokeMethodDirectly(InvokeMethodDirectly node) {
     _rewriteList(node.arguments);
     node.receiver = visitExpression(node.receiver);
@@ -643,15 +663,17 @@
   Statement visitWhileTrue(WhileTrue node) {
     // Do not propagate assignments into loops.  Doing so is not safe for
     // variables modified in the loop (the initial value will be propagated).
+    // Do not propagate effective constant expressions into loops, since
+    // computing them is not free (e.g. interceptors are expensive).
     inEmptyEnvironment(() {
       node.body = visitStatement(node.body);
-    });
+    }, keepConstants: false);
     return node;
   }
 
-  Statement visitWhileCondition(WhileCondition node) {
+  Statement visitFor(For node) {
     // Not introduced yet
-    throw "Unexpected WhileCondition in StatementRewriter";
+    throw "Unexpected For in StatementRewriter";
   }
 
   Statement visitTry(Try node) {
@@ -715,6 +737,11 @@
     return node;
   }
 
+  Expression visitGetTypeTestProperty(GetTypeTestProperty node) {
+    node.object = visitExpression(node.object);
+    return node;
+  }
+
   Expression visitCreateBox(CreateBox node) {
     return node;
   }
@@ -826,15 +853,18 @@
     BuiltinOperator commuted = commuteBinaryOperator(node.operator);
     if (commuted != null) {
       assert(node.arguments.length == 2); // Only binary operators can commute.
-      VariableUse arg1 = node.arguments[0];
-      VariableUse arg2 = node.arguments[1];
-      if (propagatableVariable == arg1.variable &&
-          propagatableVariable != arg2.variable &&
-          !constantEnvironment.containsKey(arg2.variable)) {
-        // An assignment can be propagated if we commute the operator.
-        node.operator = commuted;
-        node.arguments[0] = arg2;
-        node.arguments[1] = arg1;
+      Expression left = node.arguments[0];
+      if (left is VariableUse && propagatableVariable == left.variable) {
+        Expression right = node.arguments[1];
+        if (right is This ||
+            (right is VariableUse &&
+             propagatableVariable != right.variable &&
+             !constantEnvironment.containsKey(right.variable))) {
+          // An assignment can be propagated if we commute the operator.
+          node.operator = commuted;
+          node.arguments[0] = right;
+          node.arguments[1] = left;
+        }
       }
     }
     _rewriteList(node.arguments);
@@ -1107,6 +1137,19 @@
     _rewriteList(node.arguments);
     return node;
   }
+
+  @override
+  Expression visitAwait(Await node) {
+    node.input = visitExpression(node.input);
+    return node;
+  }
+
+  @override
+  Statement visitYield(Yield node) {
+    node.input = visitExpression(node.input);
+    node.next = visitStatement(node.next);
+    return node;
+  }
 }
 
 /// Result of combining two expressions, with the potential for reverting the
diff --git a/pkg/compiler/lib/src/tree_ir/optimization/variable_merger.dart b/pkg/compiler/lib/src/tree_ir/optimization/variable_merger.dart
index 79f018b..91a5aac 100644
--- a/pkg/compiler/lib/src/tree_ir/optimization/variable_merger.dart
+++ b/pkg/compiler/lib/src/tree_ir/optimization/variable_merger.dart
@@ -208,10 +208,11 @@
     visitStatement(node.body); // visitContinue will add predecessors to join.
   }
 
-  visitWhileCondition(WhileCondition node) {
-    Block join = _jumpTarget[node.label] = newBlock();
-    join.predecessors.add(_currentBlock);
-    _currentBlock = join;
+  visitFor(For node) {
+    Block entry = _currentBlock;
+    _currentBlock = _jumpTarget[node.label] = newBlock();
+    node.updates.forEach(visitExpression);
+    joinFrom(entry, _currentBlock);
     visitExpression(node.condition);
     Block afterCondition = _currentBlock;
     branchFrom(afterCondition);
diff --git a/pkg/compiler/lib/src/tree_ir/tree_ir_builder.dart b/pkg/compiler/lib/src/tree_ir/tree_ir_builder.dart
index 921e830..5eddb37 100644
--- a/pkg/compiler/lib/src/tree_ir/tree_ir_builder.dart
+++ b/pkg/compiler/lib/src/tree_ir/tree_ir_builder.dart
@@ -4,10 +4,11 @@
 
 library tree_ir_builder;
 
-import '../dart2jslib.dart' as dart2js;
-import '../elements/elements.dart';
+import '../common.dart';
+import '../constants/values.dart';
 import '../cps_ir/cps_ir_nodes.dart' as cps_ir;
-import '../util/util.dart' show CURRENT_ELEMENT_SPANNABLE;
+import '../elements/elements.dart';
+
 import 'tree_ir_nodes.dart';
 
 typedef Statement NodeCallback(Statement next);
@@ -45,7 +46,7 @@
  * still all named.
  */
 class Builder implements cps_ir.Visitor/*<NodeCallback|Node>*/ {
-  final dart2js.InternalErrorFunction internalError;
+  final InternalErrorFunction internalError;
 
   final Map<cps_ir.Primitive, Variable> primitive2variable =
       <cps_ir.Primitive, Variable>{};
@@ -248,10 +249,10 @@
   visit(cps_ir.Node node) => throw 'Use translateXXX instead of visit';
 
   /// Translates a CPS expression into a tree statement.
-  /// 
+  ///
   /// To avoid deep recursion, we traverse each basic blocks without
   /// recursion.
-  /// 
+  ///
   /// Non-tail expressions evaluate to a callback to be invoked once the
   /// successor statement has been constructed. These callbacks are stored
   /// in a stack until the block's tail expression has been translated.
@@ -269,18 +270,12 @@
   }
 
   /// Translates a CPS primitive to a tree expression.
-  /// 
+  ///
   /// This simply calls the visit method for the primitive.
   Expression translatePrimitive(cps_ir.Primitive prim) {
     return prim.accept(this);
   }
 
-  /// Translates a condition to a tree expression.
-  Expression translateCondition(cps_ir.Condition condition) {
-    cps_ir.IsTrue isTrue = condition;
-    return getVariableUse(isTrue.value);
-  }
-
   /************************ INTERIOR EXPRESSIONS  ************************/
   //
   // Visit methods for interior expressions must return a function:
@@ -321,8 +316,8 @@
         // Recursively build the body. We only do this for join continuations,
         // so we should not risk overly deep recursion.
         next = new LabeledStatement(
-            label, 
-            next, 
+            label,
+            next,
             translateExpression(continuation.body));
       }
     }
@@ -395,14 +390,14 @@
     Expression value = getVariableUse(node.value);
     List<Expression> typeArgs = translateArguments(node.typeArguments);
     Expression expression =
-        new TypeOperator(value, node.type, typeArgs, isTypeTest: false);
+        new TypeOperator(value, node.dartType, typeArgs, isTypeTest: false);
     return makeCallExpression(node, expression);
   }
 
   NodeCallback visitInvokeConstructor(cps_ir.InvokeConstructor node) {
     List<Expression> arguments = translateArguments(node.arguments);
     Expression invoke = new InvokeConstructor(
-        node.type,
+        node.dartType,
         node.target,
         node.selector,
         arguments,
@@ -439,6 +434,19 @@
     return makeCallExpression(node, value);
   }
 
+  @override
+  NodeCallback visitYield(cps_ir.Yield node) {
+    return (Statement next) {
+      return new Yield(getVariableUse(node.input), node.hasStar, next);
+    };
+  }
+
+  @override
+  NodeCallback visitAwait(cps_ir.Await node) {
+    Expression value = new Await(getVariableUse(node.input));
+    return makeCallExpression(node, value);
+  }
+
 
   /************************** TAIL EXPRESSIONS  **************************/
   //
@@ -487,7 +495,7 @@
             if (cont.isRecursive) {
               return node.isRecursive
                   ? new Continue(getLabel(cont))
-                  : new WhileTrue(getLabel(cont), 
+                  : new WhileTrue(getLabel(cont),
                                   translateExpression(cont.body));
             } else {
               return cont.hasExactlyOneUse && !node.isEscapingTry
@@ -498,25 +506,37 @@
     }
   }
 
+  /// Translates a branch condition to a tree expression.
+  Expression translateCondition(cps_ir.Branch branch) {
+    Expression value = getVariableUse(branch.condition);
+    if (branch.isStrictCheck) {
+      return new ApplyBuiltinOperator(
+          BuiltinOperator.StrictEq,
+          <Expression>[value, new Constant(new TrueConstantValue())]);
+    } else {
+      return value;
+    }
+  }
+
   Statement visitBranch(cps_ir.Branch node) {
-    Expression condition = translateCondition(node.condition);
+    Expression condition = translateCondition(node);
     Statement thenStatement, elseStatement;
     cps_ir.Continuation cont = node.trueContinuation.definition;
     assert(cont.parameters.isEmpty);
-    thenStatement = cont.hasExactlyOneUse 
-        ? translateExpression(cont.body) 
+    thenStatement = cont.hasExactlyOneUse
+        ? translateExpression(cont.body)
         : new Break(labels[cont]);
     cont = node.falseContinuation.definition;
     assert(cont.parameters.isEmpty);
-    elseStatement = cont.hasExactlyOneUse 
-        ? translateExpression(cont.body) 
+    elseStatement = cont.hasExactlyOneUse
+        ? translateExpression(cont.body)
         : new Break(labels[cont]);
     return new If(condition, thenStatement, elseStatement);
   }
 
 
   /************************** PRIMITIVES  **************************/
-  // 
+  //
   // Visit methods for primitives must return an expression.
   //
 
@@ -525,9 +545,9 @@
                         node.field,
                         getVariableUse(node.value));
   }
-  
+
   Expression visitInterceptor(cps_ir.Interceptor node) {
-    return new Interceptor(getVariableUse(node.input), 
+    return new Interceptor(getVariableUse(node.input),
                            node.interceptedClasses,
                            node.sourceInformation);
   }
@@ -571,13 +591,13 @@
 
   Expression visitLiteralList(cps_ir.LiteralList node) {
     return new LiteralList(
-            node.type,
+            node.dartType,
             translateArguments(node.values));
   }
 
   Expression visitLiteralMap(cps_ir.LiteralMap node) {
     return new LiteralMap(
-        node.type,
+        node.dartType,
         new List<LiteralMapEntry>.generate(node.entries.length, (int index) {
           return new LiteralMapEntry(
               getVariableUse(node.entries[index].key),
@@ -616,7 +636,13 @@
   Expression visitTypeTest(cps_ir.TypeTest node) {
     Expression value = getVariableUse(node.value);
     List<Expression> typeArgs = translateArguments(node.typeArguments);
-    return new TypeOperator(value, node.type, typeArgs, isTypeTest: true);
+    return new TypeOperator(value, node.dartType, typeArgs, isTypeTest: true);
+  }
+
+  Expression visitTypeTestViaFlag(cps_ir.TypeTestViaFlag node) {
+    Expression value = getVariableUse(node.interceptor);
+    // TODO(sra): Move !! to cps_ir level.
+    return new Not(new Not(new GetTypeTestProperty(value, node.dartType)));
   }
 
   Expression visitGetStatic(cps_ir.GetStatic node) {
@@ -638,6 +664,13 @@
                                     translateArguments(node.arguments));
   }
 
+  Expression visitApplyBuiltinMethod(cps_ir.ApplyBuiltinMethod node) {
+    return new ApplyBuiltinMethod(node.method,
+        getVariableUse(node.receiver),
+        translateArguments(node.arguments),
+        receiverIsNotNull: node.receiverIsNotNull);
+  }
+
   Expression visitGetLength(cps_ir.GetLength node) {
     return new GetLength(getVariableUse(node.object));
   }
@@ -653,6 +686,11 @@
                         getVariableUse(node.value));
   }
 
+  @override
+  Expression visitRefinement(cps_ir.Refinement node) {
+    throw 'Unexpected Refinement node in tree builder';
+  }
+
   /********** UNUSED VISIT METHODS *************/
 
   unexpectedNode(cps_ir.Node node) {
@@ -665,6 +703,4 @@
   visitParameter(cps_ir.Parameter node) => unexpectedNode(node);
   visitContinuation(cps_ir.Continuation node) => unexpectedNode(node);
   visitMutableVariable(cps_ir.MutableVariable node) => unexpectedNode(node);
-  visitIsTrue(cps_ir.IsTrue node) => unexpectedNode(node);
 }
-
diff --git a/pkg/compiler/lib/src/tree_ir/tree_ir_integrity.dart b/pkg/compiler/lib/src/tree_ir/tree_ir_integrity.dart
index 5afd2da..3a1a0bc 100644
--- a/pkg/compiler/lib/src/tree_ir/tree_ir_integrity.dart
+++ b/pkg/compiler/lib/src/tree_ir/tree_ir_integrity.dart
@@ -85,7 +85,7 @@
     label2declaration[label] = target;
     labelUses[label] = 0;
     visitStatement(target.body);
-    label2declaration.remove(target);
+    label2declaration.remove(label);
 
     if (labelUses[label] != label.useCount) {
       error('Label $label has ${labelUses[label]} uses '
@@ -102,9 +102,10 @@
     visitJumpTargetBody(node);
   }
 
-  visitWhileCondition(WhileCondition node) {
+  visitFor(For node) {
     visitExpression(node.condition);
     visitJumpTargetBody(node);
+    node.updates.forEach(visitExpression);
     visitStatement(node.next);
   }
 
diff --git a/pkg/compiler/lib/src/tree_ir/tree_ir_nodes.dart b/pkg/compiler/lib/src/tree_ir/tree_ir_nodes.dart
index c23efd5..4693bad 100644
--- a/pkg/compiler/lib/src/tree_ir/tree_ir_nodes.dart
+++ b/pkg/compiler/lib/src/tree_ir/tree_ir_nodes.dart
@@ -9,7 +9,7 @@
 import '../elements/elements.dart';
 import '../io/source_information.dart' show SourceInformation;
 import '../types/types.dart' show TypeMask;
-import '../universe/universe.dart' show Selector;
+import '../universe/selector.dart' show Selector;
 
 import '../cps_ir/builtin_operator.dart';
 export '../cps_ir/builtin_operator.dart';
@@ -43,6 +43,9 @@
  * The base class of all Tree nodes.
  */
 abstract class Node {
+  /// Workaround for a slow Object.hashCode in the VM.
+  static int _usedHashCodes = 0;
+  final int hashCode = ++_usedHashCodes;
 }
 
 /**
@@ -362,6 +365,26 @@
   }
 }
 
+class ApplyBuiltinMethod extends Expression {
+  BuiltinMethod method;
+  Expression receiver;
+  List<Expression> arguments;
+
+  bool receiverIsNotNull;
+
+  ApplyBuiltinMethod(this.method,
+                     this.receiver,
+                     this.arguments,
+                     {this.receiverIsNotNull: false});
+
+  accept(ExpressionVisitor visitor) {
+    return visitor.visitApplyBuiltinMethod(this);
+  }
+  accept1(ExpressionVisitor1 visitor, arg) {
+    return visitor.visitApplyBuiltinMethod(this, arg);
+  }
+}
+
 /// A conditional expression.
 class Conditional extends Expression {
   Expression condition;
@@ -381,6 +404,8 @@
 
 /// An && or || expression. The operator is internally represented as a boolean
 /// [isAnd] to simplify rewriting of logical operators.
+/// Note the the result of && and || is one of the arguments, which might not be
+/// boolean. 'ShortCircuitOperator' might have been a better name.
 class LogicalOperator extends Expression {
   Expression left;
   bool isAnd;
@@ -426,7 +451,7 @@
   }
 }
 
-/// A [LabeledStatement] or [WhileTrue] or [WhileCondition].
+/// A [LabeledStatement] or [WhileTrue] or [For].
 abstract class JumpTarget extends Statement {
   Label get label;
   Statement get body;
@@ -452,7 +477,7 @@
   }
 }
 
-/// A [WhileTrue] or [WhileCondition] loop.
+/// A [WhileTrue] or [For] loop.
 abstract class Loop extends JumpTarget {
 }
 
@@ -476,30 +501,36 @@
 }
 
 /**
- * A while loop with a condition. If the condition is false, control resumes
- * at the [next] statement.
+ * A loop with a condition and update expressions. If there are any update
+ * expressions, this generates a for loop, otherwise a while loop.
+ *
+ * When the condition is false, control resumes at the [next] statement.
  *
  * It is NOT valid to target this statement with a [Break].
  * The only way to reach [next] is for the condition to evaluate to false.
  *
- * [WhileCondition] statements are introduced in the [LoopRewriter] and is
+ * [For] statements are introduced in the [LoopRewriter] and are
  * assumed not to occur before then.
  */
-class WhileCondition extends Loop {
+class For extends Loop {
   final Label label;
   Expression condition;
+  List<Expression> updates;
   Statement body;
   Statement next;
 
-  WhileCondition(this.label, this.condition, this.body,
-                 this.next) {
+  For(this.label,
+      this.condition,
+      this.updates,
+      this.body,
+      this.next) {
     assert(label.binding == null);
     label.binding = this;
   }
 
-  accept(StatementVisitor visitor) => visitor.visitWhileCondition(this);
+  accept(StatementVisitor visitor) => visitor.visitFor(this);
   accept1(StatementVisitor1 visitor, arg) {
-    return visitor.visitWhileCondition(this, arg);
+    return visitor.visitFor(this, arg);
   }
 }
 
@@ -527,7 +558,7 @@
 }
 
 /**
- * A continue to an enclosing [WhileTrue] or [WhileCondition] loop.
+ * A continue to an enclosing [WhileTrue] or [For] loop.
  * The continue targets the loop's body.
  */
 class Continue extends Jump {
@@ -713,6 +744,22 @@
   accept1(ExpressionVisitor1 visitor, arg) => visitor.visitSetField(this, arg);
 }
 
+
+/// Read the type test property from [object]. The value is truthy/fasly rather
+/// than bool. [object] must not be `null`.
+class GetTypeTestProperty extends Expression {
+  Expression object;
+  DartType dartType;
+
+  GetTypeTestProperty(this.object, this.dartType);
+
+  accept(ExpressionVisitor visitor) =>
+      visitor.visitGetTypeTestProperty(this);
+  accept1(ExpressionVisitor1 visitor, arg) =>
+      visitor.visitGetTypeTestProperty(this, arg);
+}
+
+
 /// Read the value of a field, possibly provoking its initializer to evaluate,
 /// or tear off a static method.
 class GetStatic extends Expression {
@@ -895,6 +942,36 @@
   }
 }
 
+class Await extends Expression {
+  Expression input;
+
+  Await(this.input);
+
+  accept(ExpressionVisitor visitor) {
+    return visitor.visitAwait(this);
+  }
+
+  accept1(ExpressionVisitor1 visitor, arg) {
+    return visitor.visitAwait(this, arg);
+  }
+}
+
+class Yield extends Statement {
+  Statement next;
+  Expression input;
+  final bool hasStar;
+
+  Yield(this.input, this.hasStar, this.next);
+
+  accept(StatementVisitor visitor) {
+    return visitor.visitYield(this);
+  }
+
+  accept1(StatementVisitor1 visitor, arg) {
+    return visitor.visitYield(this, arg);
+  }
+}
+
 abstract class ExpressionVisitor<E> {
   E visitExpression(Expression node) => node.accept(this);
   E visitVariableUse(VariableUse node);
@@ -916,6 +993,7 @@
   E visitSetField(SetField node);
   E visitGetStatic(GetStatic node);
   E visitSetStatic(SetStatic node);
+  E visitGetTypeTestProperty(GetTypeTestProperty node);
   E visitCreateBox(CreateBox node);
   E visitCreateInstance(CreateInstance node);
   E visitReifyRuntimeType(ReifyRuntimeType node);
@@ -924,10 +1002,12 @@
   E visitCreateInvocationMirror(CreateInvocationMirror node);
   E visitInterceptor(Interceptor node);
   E visitApplyBuiltinOperator(ApplyBuiltinOperator node);
+  E visitApplyBuiltinMethod(ApplyBuiltinMethod node);
   E visitForeignExpression(ForeignExpression node);
   E visitGetLength(GetLength node);
   E visitGetIndex(GetIndex node);
   E visitSetIndex(SetIndex node);
+  E visitAwait(Await node);
 }
 
 abstract class ExpressionVisitor1<E, A> {
@@ -951,6 +1031,7 @@
   E visitSetField(SetField node, A arg);
   E visitGetStatic(GetStatic node, A arg);
   E visitSetStatic(SetStatic node, A arg);
+  E visitGetTypeTestProperty(GetTypeTestProperty node, A arg);
   E visitCreateBox(CreateBox node, A arg);
   E visitCreateInstance(CreateInstance node, A arg);
   E visitReifyRuntimeType(ReifyRuntimeType node, A arg);
@@ -959,10 +1040,12 @@
   E visitCreateInvocationMirror(CreateInvocationMirror node, A arg);
   E visitInterceptor(Interceptor node, A arg);
   E visitApplyBuiltinOperator(ApplyBuiltinOperator node, A arg);
+  E visitApplyBuiltinMethod(ApplyBuiltinMethod node, A arg);
   E visitForeignExpression(ForeignExpression node, A arg);
   E visitGetLength(GetLength node, A arg);
   E visitGetIndex(GetIndex node, A arg);
   E visitSetIndex(SetIndex node, A arg);
+  E visitAwait(Await node, A arg);
 }
 
 abstract class StatementVisitor<S> {
@@ -975,11 +1058,12 @@
   S visitContinue(Continue node);
   S visitIf(If node);
   S visitWhileTrue(WhileTrue node);
-  S visitWhileCondition(WhileCondition node);
+  S visitFor(For node);
   S visitExpressionStatement(ExpressionStatement node);
   S visitTry(Try node);
   S visitUnreachable(Unreachable node);
   S visitForeignStatement(ForeignStatement node);
+  S visitYield(Yield node);
 }
 
 abstract class StatementVisitor1<S, A> {
@@ -992,11 +1076,12 @@
   S visitContinue(Continue node, A arg);
   S visitIf(If node, A arg);
   S visitWhileTrue(WhileTrue node, A arg);
-  S visitWhileCondition(WhileCondition node, A arg);
+  S visitFor(For node, A arg);
   S visitExpressionStatement(ExpressionStatement node, A arg);
   S visitTry(Try node, A arg);
   S visitUnreachable(Unreachable node, A arg);
   S visitForeignStatement(ForeignStatement node, A arg);
+  S visitYield(Yield node, A arg);
 }
 
 abstract class RecursiveVisitor implements StatementVisitor, ExpressionVisitor {
@@ -1102,8 +1187,9 @@
     visitStatement(node.body);
   }
 
-  visitWhileCondition(WhileCondition node) {
+  visitFor(For node) {
     visitExpression(node.condition);
+    node.updates.forEach(visitExpression);
     visitStatement(node.body);
     visitStatement(node.next);
   }
@@ -1140,6 +1226,10 @@
     visitExpression(node.value);
   }
 
+  visitGetTypeTestProperty(GetTypeTestProperty node) {
+    visitExpression(node.object);
+  }
+
   visitCreateBox(CreateBox node) {
   }
 
@@ -1171,6 +1261,11 @@
     node.arguments.forEach(visitExpression);
   }
 
+  visitApplyBuiltinMethod(ApplyBuiltinMethod node) {
+    visitExpression(node.receiver);
+    node.arguments.forEach(visitExpression);
+  }
+
   visitInterceptor(Interceptor node) {
     visitExpression(node.input);
   }
@@ -1196,6 +1291,15 @@
     visitExpression(node.index);
     visitExpression(node.value);
   }
+
+  visitAwait(Await node) {
+    visitExpression(node.input);
+  }
+
+  visitYield(Yield node) {
+    visitExpression(node.input);
+    visitStatement(node.next);
+  }
 }
 
 abstract class Transformer implements ExpressionVisitor<Expression>,
@@ -1324,8 +1428,9 @@
     return node;
   }
 
-  visitWhileCondition(WhileCondition node) {
+  visitFor(For node) {
     node.condition = visitExpression(node.condition);
+    _replaceExpressions(node.updates);
     node.body = visitStatement(node.body);
     node.next = visitStatement(node.next);
     return node;
@@ -1370,10 +1475,16 @@
     return node;
   }
 
+  visitGetTypeTestProperty(GetTypeTestProperty node) {
+    node.object = visitExpression(node.object);
+    return node;
+  }
+
   visitCreateBox(CreateBox node) => node;
 
   visitCreateInstance(CreateInstance node) {
     _replaceExpressions(node.arguments);
+    _replaceExpressions(node.typeInformation);
     return node;
   }
 
@@ -1416,6 +1527,12 @@
     return node;
   }
 
+  visitApplyBuiltinMethod(ApplyBuiltinMethod node) {
+    node.receiver = visitExpression(node.receiver);
+    _replaceExpressions(node.arguments);
+    return node;
+  }
+
   visitInterceptor(Interceptor node) {
     node.input = visitExpression(node.input);
     return node;
@@ -1438,6 +1555,17 @@
     node.value = visitExpression(node.value);
     return node;
   }
+
+  visitAwait(Await node) {
+    node.input = visitExpression(node.input);
+    return node;
+  }
+
+  visitYield(Yield node) {
+    node.input = visitExpression(node.input);
+    node.next = visitStatement(node.next);
+    return node;
+  }
 }
 
 class FallthroughTarget {
diff --git a/pkg/compiler/lib/src/tree_ir/tree_ir_tracer.dart b/pkg/compiler/lib/src/tree_ir/tree_ir_tracer.dart
index f07a030..130d268 100644
--- a/pkg/compiler/lib/src/tree_ir/tree_ir_tracer.dart
+++ b/pkg/compiler/lib/src/tree_ir/tree_ir_tracer.dart
@@ -127,13 +127,12 @@
     visitStatement(node.body);
   }
 
-  visitWhileCondition(WhileCondition node) {
+  visitFor(For node) {
     Block whileBlock = new Block();
     _addGotoStatement(whileBlock);
 
     _addBlock(whileBlock);
     _addStatement(node);
-    whileBlock.statements.add(node);
     blocks.last.addEdgeTo(whileBlock);
 
     Block bodyBlock = new Block();
@@ -178,6 +177,11 @@
   visitForeignStatement(ForeignStatement node) {
     _addStatement(node);
   }
+
+  visitYield(Yield node) {
+    _addStatement(node);
+    visitStatement(node.next);
+  }
 }
 
 class TreeTracer extends TracerUtil with StatementVisitor {
@@ -297,11 +301,13 @@
     printStatement(null, "while true do");
   }
 
-  visitWhileCondition(WhileCondition node) {
+  visitFor(For node) {
     String bodyTarget = collector.substatements[node.body].name;
     String nextTarget = collector.substatements[node.next].name;
+    String updates = node.updates.map(expr).join(', ');
     printStatement(null, "while ${expr(node.condition)}");
     printStatement(null, "do $bodyTarget");
+    printStatement(null, "updates ($updates)");
     printStatement(null, "then $nextTarget" );
   }
 
@@ -334,6 +340,12 @@
   visitForeignStatement(ForeignStatement node) {
     printStatement(null, 'foreign ${node.codeTemplate.source}');
   }
+
+  @override
+  visitYield(Yield node) {
+    String name = node.hasStar ? 'yield*' : 'yield';
+    printStatement(null, '$name ${expr(node.input)}');
+  }
 }
 
 class SubexpressionVisitor extends ExpressionVisitor<String> {
@@ -486,6 +498,15 @@
     return '$element = $value';
   }
 
+  String visitGetTypeTestProperty(GetTypeTestProperty node) {
+    String object = visitExpression(node.object);
+    if (usesInfixNotation(node.object)) {
+      object = '($object)';
+    }
+    // TODO(sra): Fix up this.
+    return '$object."is-${node.dartType}"';
+  }
+
   String visitCreateBox(CreateBox node) {
     return 'CreateBox';
   }
@@ -496,7 +517,6 @@
     return 'CreateInstance $className($arguments)';
   }
 
-
   @override
   String visitReadTypeVariable(ReadTypeVariable node) {
     return 'Read ${node.variable.element} ${visitExpression(node.target)}';
@@ -536,6 +556,13 @@
   }
 
   @override
+  String visitApplyBuiltinMethod(ApplyBuiltinMethod node) {
+    String receiver = visitExpression(node.receiver);
+    String args = node.arguments.map(visitExpression).join(', ');
+    return 'ApplyBuiltinMethod ${node.method} $receiver ($args)';
+  }
+
+  @override
   String visitGetLength(GetLength node) {
     String object = visitExpression(node.object);
     return 'GetLength($object)';
@@ -555,6 +582,18 @@
     String value = visitExpression(node.value);
     return 'SetIndex($object, $index, $value)';
   }
+
+  @override
+  String visitAwait(Await node) {
+    String value = visitExpression(node.input);
+    return 'Await($value)';
+  }
+
+  @override
+  String visitYield(Yield node) {
+    String value = visitExpression(node.input);
+    return 'Yield($value)';
+  }
 }
 
 /**
@@ -581,4 +620,4 @@
     }
     return name;
   }
-}
\ No newline at end of file
+}
diff --git a/pkg/compiler/lib/src/typechecker.dart b/pkg/compiler/lib/src/typechecker.dart
index 2d854a2..90a85fb 100644
--- a/pkg/compiler/lib/src/typechecker.dart
+++ b/pkg/compiler/lib/src/typechecker.dart
@@ -2,7 +2,56 @@
 // for 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 dart2js;
+library dart2js.typechecker;
+
+import 'common.dart';
+import 'common/names.dart' show
+    Identifiers;
+import 'common/resolution.dart' show
+    Resolution;
+import 'common/tasks.dart' show
+    CompilerTask;
+import 'compiler.dart' show
+    Compiler;
+import 'constants/expressions.dart';
+import 'constants/values.dart';
+import 'core_types.dart';
+import 'dart_types.dart';
+import 'elements/elements.dart' show
+    AbstractFieldElement,
+    AstElement,
+    AsyncMarker,
+    ClassElement,
+    ConstructorElement,
+    Element,
+    Elements,
+    EnumClassElement,
+    ExecutableElement,
+    FieldElement,
+    FunctionElement,
+    GetterElement,
+    InitializingFormalElement,
+    LibraryElement,
+    Member,
+    MemberSignature,
+    Name,
+    ParameterElement,
+    PrivateName,
+    PublicName,
+    ResolvedAst,
+    SetterElement,
+    TypeDeclarationElement,
+    TypedElement,
+    TypedefElement,
+    VariableElement;
+import 'resolution/tree_elements.dart' show
+    TreeElements;
+import 'resolution/class_members.dart' show
+    MembersCreator;
+import 'tree/tree.dart';
+import 'util/util.dart' show
+    Link,
+    LinkBuilder;
 
 class TypeCheckerTask extends CompilerTask {
   TypeCheckerTask(Compiler compiler) : super(compiler);
@@ -12,7 +61,7 @@
     if (element.isClass) return;
     if (element.isTypedef) return;
     ResolvedAst resolvedAst = element.resolvedAst;
-    compiler.withCurrentElement(element, () {
+    reporter.withCurrentElement(element.implementation, () {
       measure(() {
         TypeCheckerVisitor visitor = new TypeCheckerVisitor(
             compiler, resolvedAst.elements, compiler.types);
@@ -26,7 +75,7 @@
 }
 
 /**
- * Class used to report different warnings for differrent kinds of members.
+ * Class used to report different warnings for different kinds of members.
  */
 class MemberKind {
   static const MemberKind METHOD = const MemberKind("method");
@@ -50,7 +99,7 @@
 
   String get name => element.name;
 
-  DartType computeType(Compiler compiler);
+  DartType computeType(Resolution resolution);
 
   /// Returns [: true :] if the element can be access as an invocation.
   bool isCallable(Compiler compiler) {
@@ -62,7 +111,7 @@
       }
     }
     return compiler.types.isAssignable(
-        computeType(compiler), compiler.coreTypes.functionType);
+        computeType(compiler.resolution), compiler.coreTypes.functionType);
   }
 }
 
@@ -74,7 +123,7 @@
 
   Element get element => member.declarations.first.element;
 
-  DartType computeType(Compiler compiler) => member.type;
+  DartType computeType(Resolution resolution) => member.type;
 
   String toString() => 'MemberAccess($member)';
 }
@@ -87,32 +136,13 @@
 
   String get name => 'dynamic';
 
-  DartType computeType(Compiler compiler) => const DynamicType();
+  DartType computeType(Resolution resolution) => const DynamicType();
 
   bool isCallable(Compiler compiler) => true;
 
   String toString() => 'DynamicAccess';
 }
 
-/// An access of the `assert` method.
-class AssertAccess implements ElementAccess {
-  const AssertAccess();
-
-  Element get element => null;
-
-  String get name => 'assert';
-
-  DartType computeType(Compiler compiler) {
-    return new FunctionType.synthesized(
-        const VoidType(),
-        <DartType>[const DynamicType()]);
-  }
-
-  bool isCallable(Compiler compiler) => true;
-
-  String toString() => 'AssertAccess';
-}
-
 /**
  * An access of a resolved top-level or static property or function, or an
  * access of a resolved element through [:this:].
@@ -124,14 +154,14 @@
     assert(element != null);
   }
 
-  DartType computeType(Compiler compiler) {
+  DartType computeType(Resolution resolution) {
     if (element.isGetter) {
       GetterElement getter = element;
-      FunctionType functionType = getter.computeType(compiler);
+      FunctionType functionType = getter.computeType(resolution);
       return functionType.returnType;
     } else if (element.isSetter) {
       SetterElement setter = element;
-      FunctionType functionType = setter.computeType(compiler);
+      FunctionType functionType = setter.computeType(resolution);
       if (functionType.parameterTypes.length != 1) {
         // TODO(johnniwinther,karlklose): this happens for malformed static
         // setters. Treat them the same as instance members.
@@ -140,11 +170,11 @@
       return functionType.parameterTypes.first;
     } else if (element.isTypedef || element.isClass) {
       TypeDeclarationElement typeDeclaration = element;
-      typeDeclaration.computeType(compiler);
+      typeDeclaration.computeType(resolution);
       return typeDeclaration.thisType;
     } else {
       TypedElement typedElement = element;
-      typedElement.computeType(compiler);
+      typedElement.computeType(resolution);
       return typedElement.type;
     }
   }
@@ -162,7 +192,7 @@
     assert(type != null);
   }
 
-  DartType computeType(Compiler compiler) => type;
+  DartType computeType(Resolution resolution) => type;
 
   String toString() => 'PromotedAccess($element,$type)';
 }
@@ -179,7 +209,7 @@
 
   Element get element => type.element;
 
-  DartType computeType(Compiler compiler) => type;
+  DartType computeType(Resolution resolution) => type;
 
   String toString() => 'TypeAccess($type)';
 }
@@ -198,7 +228,7 @@
 
   String get name => type.name;
 
-  DartType computeType(Compiler compiler) => compiler.typeClass.rawType;
+  DartType computeType(Resolution resolution) => resolution.coreTypes.typeType;
 
   String toString() => 'TypeLiteralAccess($type)';
 }
@@ -213,7 +243,7 @@
 
   String get name => 'call';
 
-  DartType computeType(Compiler compiler) => type;
+  DartType computeType(Resolution resolution) => type;
 
   bool isCallable(Compiler compiler) => true;
 
@@ -236,14 +266,9 @@
     return new TypePromotion(node, variable, type)..messages.addAll(messages);
   }
 
-  void addHint(Spannable spannable, MessageKind kind, [Map arguments]) {
-    messages.add(new TypePromotionMessage(api.Diagnostic.HINT,
-        spannable, kind, arguments));
-  }
-
-  void addInfo(Spannable spannable, MessageKind kind, [Map arguments]) {
-    messages.add(new TypePromotionMessage(api.Diagnostic.INFO,
-        spannable, kind, arguments));
+  void addHint(DiagnosticMessage hint,
+               [List<DiagnosticMessage> infos = const <DiagnosticMessage>[]]) {
+    messages.add(new TypePromotionMessage(hint, infos));
   }
 
   String toString() {
@@ -253,13 +278,10 @@
 
 /// A hint or info message attached to a type promotion.
 class TypePromotionMessage {
-  api.Diagnostic diagnostic;
-  Spannable spannable;
-  MessageKind messageKind;
-  Map messageArguments;
+  DiagnosticMessage hint;
+  List<DiagnosticMessage> infos;
 
-  TypePromotionMessage(this.diagnostic, this.spannable, this.messageKind,
-                       [this.messageArguments]);
+  TypePromotionMessage(this.hint, this.infos);
 }
 
 class TypeCheckerVisitor extends Visitor<DartType> {
@@ -278,6 +300,10 @@
 
   CoreTypes get coreTypes => compiler.coreTypes;
 
+  DiagnosticReporter get reporter => compiler.reporter;
+
+  Resolution get resolution => compiler.resolution;
+
   InterfaceType get intType => coreTypes.intType;
   InterfaceType get doubleType => coreTypes.doubleType;
   InterfaceType get boolType => coreTypes.boolType;
@@ -367,30 +393,24 @@
 
   reportTypeWarning(Spannable spannable, MessageKind kind,
                     [Map arguments = const {}]) {
-    compiler.reportWarning(spannable, kind, arguments);
+    reporter.reportWarningMessage(spannable, kind, arguments);
   }
 
-  reportTypeInfo(Spannable spannable, MessageKind kind,
-                 [Map arguments = const {}]) {
-    compiler.reportInfo(spannable, kind, arguments);
+  reportMessage(Spannable spannable, MessageKind kind,
+                Map arguments,
+                {bool isHint: false}) {
+    if (isHint) {
+      reporter.reportHintMessage(spannable, kind, arguments);
+    } else {
+      reporter.reportWarningMessage(spannable, kind, arguments);
+    }
   }
 
   reportTypePromotionHint(TypePromotion typePromotion) {
     if (!reportedTypePromotions.contains(typePromotion)) {
       reportedTypePromotions.add(typePromotion);
       for (TypePromotionMessage message in typePromotion.messages) {
-        switch (message.diagnostic) {
-          case api.Diagnostic.HINT:
-            compiler.reportHint(message.spannable,
-                                message.messageKind,
-                                message.messageArguments);
-            break;
-          case api.Diagnostic.INFO:
-            compiler.reportInfo(message.spannable,
-                                message.messageKind,
-                                message.messageArguments);
-            break;
-        }
+        reporter.reportHint(message.hint, message.infos);
       }
     }
   }
@@ -416,9 +436,9 @@
     if (node == null) {
       final String error = 'Unexpected node: null';
       if (lastSeenNode != null) {
-        compiler.internalError(lastSeenNode, error);
+        reporter.internalError(lastSeenNode, error);
       } else {
-        compiler.internalError(executableContext, error);
+        reporter.internalError(executableContext, error);
       }
     } else {
       lastSeenNode = node;
@@ -428,9 +448,9 @@
     DartType result = node.accept(this);
     analyzingInitializer = previouslyInitializer;
     if (result == null) {
-      compiler.internalError(node, 'Type is null.');
+      reporter.internalError(node, 'Type is null.');
     }
-    return result;
+    return _record(node, result);
   }
 
   void checkTypePromotion(Node node, TypePromotion typePromotion,
@@ -440,44 +460,56 @@
     List<Node> potentialMutationsIn =
         elements.getPotentialMutationsIn(node, variable);
     if (!potentialMutationsIn.isEmpty) {
-      typePromotion.addHint(typePromotion.node,
+      DiagnosticMessage hint = reporter.createMessage(
+          typePromotion.node,
           MessageKind.POTENTIAL_MUTATION,
           {'variableName': variableName, 'shownType': typePromotion.type});
+      List<DiagnosticMessage> infos = <DiagnosticMessage>[];
       for (Node mutation in potentialMutationsIn) {
-        typePromotion.addInfo(mutation,
+        infos.add(reporter.createMessage(mutation,
             MessageKind.POTENTIAL_MUTATION_HERE,
-            {'variableName': variableName});
+            {'variableName': variableName}));
       }
+      typePromotion.addHint(hint, infos);
     }
     List<Node> potentialMutationsInClosures =
         elements.getPotentialMutationsInClosure(variable);
     if (!potentialMutationsInClosures.isEmpty) {
-      typePromotion.addHint(typePromotion.node,
+      DiagnosticMessage hint = reporter.createMessage(
+          typePromotion.node,
           MessageKind.POTENTIAL_MUTATION_IN_CLOSURE,
           {'variableName': variableName, 'shownType': typePromotion.type});
+      List<DiagnosticMessage> infos = <DiagnosticMessage>[];
       for (Node mutation in potentialMutationsInClosures) {
-        typePromotion.addInfo(mutation,
+        infos.add(reporter.createMessage(
+            mutation,
             MessageKind.POTENTIAL_MUTATION_IN_CLOSURE_HERE,
-            {'variableName': variableName});
+            {'variableName': variableName}));
       }
+      typePromotion.addHint(hint, infos);
     }
     if (checkAccesses) {
       List<Node> accesses = elements.getAccessesByClosureIn(node, variable);
       List<Node> mutations = elements.getPotentialMutations(variable);
       if (!accesses.isEmpty && !mutations.isEmpty) {
-        typePromotion.addHint(typePromotion.node,
+        DiagnosticMessage hint = reporter.createMessage(
+            typePromotion.node,
             MessageKind.ACCESSED_IN_CLOSURE,
             {'variableName': variableName, 'shownType': typePromotion.type});
+        List<DiagnosticMessage> infos = <DiagnosticMessage>[];
         for (Node access in accesses) {
-          typePromotion.addInfo(access,
+          infos.add(reporter.createMessage(
+              access,
               MessageKind.ACCESSED_IN_CLOSURE_HERE,
-              {'variableName': variableName});
+              {'variableName': variableName}));
         }
         for (Node mutation in mutations) {
-          typePromotion.addInfo(mutation,
+          infos.add(reporter.createMessage(
+              mutation,
               MessageKind.POTENTIAL_MUTATION_HERE,
-              {'variableName': variableName});
+              {'variableName': variableName}));
         }
+        typePromotion.addHint(hint, infos);
       }
     }
   }
@@ -527,11 +559,15 @@
                        {bool isConst: false}) {
     if (!types.isAssignable(from, to)) {
       if (compiler.enableTypeAssertions && isConst) {
-        compiler.reportError(spannable, MessageKind.NOT_ASSIGNABLE,
-                             {'fromType': from, 'toType': to});
+        reporter.reportErrorMessage(
+            spannable,
+            MessageKind.NOT_ASSIGNABLE,
+            {'fromType': from, 'toType': to});
       } else {
-        reportTypeWarning(spannable, MessageKind.NOT_ASSIGNABLE,
-                          {'fromType': from, 'toType': to});
+        reporter.reportWarningMessage(
+            spannable,
+            MessageKind.NOT_ASSIGNABLE,
+            {'fromType': from, 'toType': to});
       }
       return false;
     }
@@ -552,6 +588,12 @@
     return type;
   }
 
+  DartType visitAssert(Assert node) {
+    analyze(node.condition);
+    if (node.hasMessage) analyze(node.message);
+    return const StatementType();
+  }
+
   DartType visitBlock(Block node) {
     return analyze(node.statements);
   }
@@ -613,14 +655,14 @@
         if (parameter.isInitializingFormal) {
           InitializingFormalElement fieldParameter = parameter;
           checkAssignable(parameter, parameter.type,
-              fieldParameter.fieldElement.computeType(compiler));
+              fieldParameter.fieldElement.computeType(resolution));
         }
       });
       if (node.initializers != null) {
         analyze(node.initializers, inInitializer: true);
       }
     } else {
-      FunctionType functionType = element.computeType(compiler);
+      FunctionType functionType = element.computeType(resolution);
       returnType = functionType.returnType;
       type = functionType;
     }
@@ -652,7 +694,7 @@
                              element.isParameter ||
                              element.isField,
           message: 'Unexpected context element ${element}'));
-      return element.computeType(compiler);
+      return element.computeType(resolution);
     }
   }
 
@@ -670,20 +712,21 @@
 
   void checkPrivateAccess(Node node, Element element, String name) {
     if (name != null &&
-        isPrivateName(name) &&
+        Name.isPrivateName(name) &&
         element.library != currentLibrary) {
       reportTypeWarning(
           node,
           MessageKind.PRIVATE_ACCESS,
           {'name': name,
-           'libraryName': element.library.getLibraryOrScriptName()});
+           'libraryName': element.library.libraryOrScriptName});
     }
 
   }
 
   ElementAccess lookupMember(Node node, DartType receiverType, String name,
                              MemberKind memberKind, Element receiverElement,
-                             {bool lookupClassMember: false}) {
+                             {bool lookupClassMember: false,
+                              bool isHint: false}) {
     if (receiverType.treatAsDynamic) {
       return const DynamicAccess();
     }
@@ -691,35 +734,6 @@
     Name memberName = new Name(name, currentLibrary,
         isSetter: memberKind == MemberKind.SETTER);
 
-    // Compute the unaliased type of the first non type variable bound of
-    // [type].
-    DartType computeUnaliasedBound(DartType type) {
-      DartType originalType = type;
-      while (identical(type.kind, TypeKind.TYPE_VARIABLE)) {
-        TypeVariableType variable = type;
-        type = variable.element.bound;
-        if (type == originalType) {
-          type = compiler.objectClass.rawType;
-        }
-      }
-      if (type.isMalformed) {
-        return const DynamicType();
-      }
-      return type.unalias(compiler);
-    }
-
-    // Compute the interface type of [type]. For type variable it is the
-    // interface type of the bound, for function types and typedefs it is the
-    // `Function` type.
-    InterfaceType computeInterfaceType(DartType type) {
-      if (type.isFunctionType) {
-         type = compiler.functionClass.rawType;
-      }
-      assert(invariant(node, type.isInterfaceType,
-          message: "unexpected type kind ${type.kind}."));
-      return type;
-    }
-
     // Lookup the class or interface member [name] in [interface].
     MemberSignature lookupMemberSignature(Name name, InterfaceType interface) {
       MembersCreator.computeClassMembersByName(
@@ -752,11 +766,13 @@
       return null;
     }
 
-    DartType unaliasedBound = computeUnaliasedBound(receiverType);
+    DartType unaliasedBound =
+        Types.computeUnaliasedBound(resolution, receiverType);
     if (unaliasedBound.treatAsDynamic) {
       return new DynamicAccess();
     }
-    InterfaceType interface = computeInterfaceType(unaliasedBound);
+    InterfaceType interface =
+        Types.computeInterfaceType(resolution, unaliasedBound);
     ElementAccess access = getAccess(memberName, unaliasedBound, interface);
     if (access != null) {
       return access;
@@ -768,9 +784,11 @@
         while (!typePromotions.isEmpty) {
           TypePromotion typePromotion = typePromotions.head;
           if (!typePromotion.isValid) {
-            DartType unaliasedBound = computeUnaliasedBound(typePromotion.type);
+            DartType unaliasedBound =
+                Types.computeUnaliasedBound(resolution, typePromotion.type);
             if (!unaliasedBound.treatAsDynamic) {
-              InterfaceType interface = computeInterfaceType(unaliasedBound);
+              InterfaceType interface =
+                  Types.computeInterfaceType(resolution, unaliasedBound);
               if (getAccess(memberName, unaliasedBound, interface) != null) {
                 reportTypePromotionHint(typePromotion);
               }
@@ -790,11 +808,12 @@
         void findPrivateMember(MemberSignature member) {
           if (memberName.isSimilarTo(member.name)) {
             PrivateName privateName = member.name;
-            reportTypeWarning(
+            reportMessage(
                  node,
                  MessageKind.PRIVATE_ACCESS,
                  {'name': name,
-                  'libraryName': privateName.library.getLibraryOrScriptName()});
+                  'libraryName': privateName.library.libraryOrScriptName},
+                 isHint: isHint);
             foundPrivateMember = true;
           }
         }
@@ -810,19 +829,22 @@
       if (!foundPrivateMember) {
         switch (memberKind) {
           case MemberKind.METHOD:
-            reportTypeWarning(node, MessageKind.METHOD_NOT_FOUND,
-                {'className': receiverType.name, 'memberName': name});
+            reportMessage(node, MessageKind.METHOD_NOT_FOUND,
+                {'className': receiverType.name, 'memberName': name},
+                isHint: isHint);
             break;
           case MemberKind.OPERATOR:
-            reportTypeWarning(node, MessageKind.OPERATOR_NOT_FOUND,
-                {'className': receiverType.name, 'memberName': name});
+            reportMessage(node, MessageKind.OPERATOR_NOT_FOUND,
+                {'className': receiverType.name, 'memberName': name},
+                isHint: isHint);
             break;
           case MemberKind.GETTER:
             if (lookupMemberSignature(memberName.setter, interface) != null) {
               // A setter is present so warn explicitly about the missing
               // getter.
-              reportTypeWarning(node, MessageKind.GETTER_NOT_FOUND,
-                  {'className': receiverType.name, 'memberName': name});
+              reportMessage(node, MessageKind.GETTER_NOT_FOUND,
+                  {'className': receiverType.name, 'memberName': name},
+                  isHint: isHint);
             } else if (name == 'await') {
               Map arguments = {'className': receiverType.name};
               String functionName = executableContext.name;
@@ -833,15 +855,17 @@
                 kind = MessageKind.AWAIT_MEMBER_NOT_FOUND;
                 arguments['functionName'] = functionName;
               }
-              reportTypeWarning(node, kind, arguments);
+              reportMessage(node, kind, arguments, isHint: isHint);
             } else {
-              reportTypeWarning(node, MessageKind.MEMBER_NOT_FOUND,
-                  {'className': receiverType.name, 'memberName': name});
+              reportMessage(node, MessageKind.MEMBER_NOT_FOUND,
+                  {'className': receiverType.name, 'memberName': name},
+                  isHint: isHint);
             }
             break;
           case MemberKind.SETTER:
-            reportTypeWarning(node, MessageKind.SETTER_NOT_FOUND,
-                {'className': receiverType.name, 'memberName': name});
+            reportMessage(node, MessageKind.SETTER_NOT_FOUND,
+                {'className': receiverType.name, 'memberName': name},
+                isHint: isHint);
             break;
         }
       }
@@ -850,17 +874,55 @@
   }
 
   DartType lookupMemberType(Node node, DartType type, String name,
-                            MemberKind memberKind) {
-    return lookupMember(node, type, name, memberKind, null)
-        .computeType(compiler);
+                            MemberKind memberKind,
+                            {bool isHint: false}) {
+    return lookupMember(node, type, name, memberKind, null, isHint: isHint)
+        .computeType(resolution);
   }
 
   void analyzeArguments(Send send, Element element, DartType type,
                         [LinkBuilder<DartType> argumentTypes]) {
     Link<Node> arguments = send.arguments;
-    DartType unaliasedType = type.unalias(compiler);
+    type.computeUnaliased(resolution);
+    DartType unaliasedType = type.unaliased;
     if (identical(unaliasedType.kind, TypeKind.FUNCTION)) {
-      bool error = false;
+
+      /// Report [warning] including info(s) about the declaration of [element]
+      /// or [type].
+      void reportWarning(DiagnosticMessage warning) {
+        // TODO(johnniwinther): Support pointing to individual parameters on
+        // assignability warnings.
+        List<DiagnosticMessage> infos = <DiagnosticMessage>[];
+        Element declaration = element;
+        if (declaration == null) {
+          declaration = type.element;
+        } else if (type.isTypedef) {
+          infos.add(reporter.createMessage(
+              declaration,
+              MessageKind.THIS_IS_THE_DECLARATION,
+              {'name': element.name}));
+          declaration = type.element;
+        }
+        if (declaration != null) {
+          infos.add(reporter.createMessage(
+              declaration, MessageKind.THIS_IS_THE_METHOD));
+        }
+        reporter.reportWarning(warning, infos);
+      }
+
+      /// Report a warning on [node] if [argumentType] is not assignable to
+      /// [parameterType].
+      void checkAssignable(Spannable node,
+                           DartType argumentType,
+                           DartType parameterType) {
+        if (!types.isAssignable(argumentType, parameterType)) {
+          reportWarning(reporter.createMessage(
+              node,
+              MessageKind.NOT_ASSIGNABLE,
+              {'fromType': argumentType, 'toType': parameterType}));
+        }
+      }
+
       FunctionType funType = unaliasedType;
       Iterator<DartType> parameterTypes = funType.parameterTypes.iterator;
       Iterator<DartType> optionalParameterTypes =
@@ -874,73 +936,51 @@
           DartType namedParameterType =
               funType.getNamedParameterType(argumentName);
           if (namedParameterType == null) {
-            error = true;
             // TODO(johnniwinther): Provide better information on the called
             // function.
-            reportTypeWarning(argument, MessageKind.NAMED_ARGUMENT_NOT_FOUND,
-                {'argumentName': argumentName});
+            reportWarning(reporter.createMessage(
+                argument,
+                MessageKind.NAMED_ARGUMENT_NOT_FOUND,
+                {'argumentName': argumentName}));
 
             DartType argumentType = analyze(argument);
             if (argumentTypes != null) argumentTypes.addLast(argumentType);
           } else {
             DartType argumentType = analyze(argument);
             if (argumentTypes != null) argumentTypes.addLast(argumentType);
-            if (!checkAssignable(argument, argumentType, namedParameterType)) {
-              error = true;
-            }
+            checkAssignable(argument, argumentType, namedParameterType);
           }
         } else {
           if (!parameterTypes.moveNext()) {
             if (!optionalParameterTypes.moveNext()) {
-              error = true;
+
               // TODO(johnniwinther): Provide better information on the
               // called function.
-              reportTypeWarning(argument, MessageKind.ADDITIONAL_ARGUMENT);
+              reportWarning(reporter.createMessage(
+                  argument, MessageKind.ADDITIONAL_ARGUMENT));
 
               DartType argumentType = analyze(argument);
               if (argumentTypes != null) argumentTypes.addLast(argumentType);
             } else {
               DartType argumentType = analyze(argument);
               if (argumentTypes != null) argumentTypes.addLast(argumentType);
-              if (!checkAssignable(argument,
-                                   argumentType,
-                                   optionalParameterTypes.current)) {
-                error = true;
-              }
+              checkAssignable(
+                  argument, argumentType, optionalParameterTypes.current);
             }
           } else {
             DartType argumentType = analyze(argument);
             if (argumentTypes != null) argumentTypes.addLast(argumentType);
-            if (!checkAssignable(argument, argumentType,
-                                 parameterTypes.current)) {
-              error = true;
-            }
+            checkAssignable(argument, argumentType, parameterTypes.current);
           }
         }
         arguments = arguments.tail;
       }
       if (parameterTypes.moveNext()) {
-        error = true;
         // TODO(johnniwinther): Provide better information on the called
         // function.
-        reportTypeWarning(send, MessageKind.MISSING_ARGUMENT,
-            {'argumentType': parameterTypes.current});
-      }
-      if (error) {
-        // TODO(johnniwinther): Improve access to declaring element and handle
-        // synthesized member signatures. Currently function typed instance
-        // members provide no access to their own name.
-        if (element == null) {
-          element = type.element;
-        } else if (type.isTypedef) {
-          reportTypeInfo(element,
-              MessageKind.THIS_IS_THE_DECLARATION,
-              {'name': element.name});
-          element = type.element;
-        }
-        if (element != null) {
-          reportTypeInfo(element, MessageKind.THIS_IS_THE_METHOD);
-        }
+        reportWarning(reporter.createMessage(
+            send, MessageKind.MISSING_ARGUMENT,
+            {'argumentType': parameterTypes.current}));
       }
     } else {
       while(!arguments.isEmpty) {
@@ -957,7 +997,7 @@
   // analysis.
   DartType analyzeInvocation(Send node, ElementAccess elementAccess,
                              [LinkBuilder<DartType> argumentTypes]) {
-    DartType type = elementAccess.computeType(compiler);
+    DartType type = elementAccess.computeType(resolution);
     if (elementAccess.isCallable(compiler)) {
       analyzeArguments(node, elementAccess.element, type, argumentTypes);
     } else {
@@ -966,8 +1006,9 @@
       analyzeArguments(node, elementAccess.element, const DynamicType(),
                        argumentTypes);
     }
-    type = type.unalias(compiler);
-    if (identical(type.kind, TypeKind.FUNCTION)) {
+    type.computeUnaliased(resolution);
+    type = type.unaliased;
+    if (type.isFunctionType) {
       FunctionType funType = type;
       return funType.returnType;
     } else {
@@ -990,6 +1031,10 @@
       Element receiverElement = elements[node.receiver];
       if (receiverElement != null) {
         if (receiverElement.isPrefix) {
+          if (node.isConditional) {
+            // Skip cases like `prefix?.topLevel`.
+            return const DynamicAccess();
+          }
           assert(invariant(node, element != null,
               message: 'Prefixed node has no element.'));
           return computeResolvedAccess(node, name, element, memberKind);
@@ -1042,7 +1087,7 @@
     } else if (element.isGetter || element.isSetter) {
       return createResolvedAccess(node, name, element);
     } else {
-      compiler.internalError(element,
+      reporter.internalError(element,
           'Unexpected element kind ${element.kind}.');
       return null;
     }
@@ -1073,9 +1118,9 @@
                              {bool lookupClassMember: false}) {
     DartType type =
         computeAccess(node, name, element, memberKind,
-            lookupClassMember: lookupClassMember).computeType(compiler);
+            lookupClassMember: lookupClassMember).computeType(resolution);
     if (type == null) {
-      compiler.internalError(node, 'Type is null on access of $name on $node.');
+      reporter.internalError(node, 'Type is null on access of $name on $node.');
     }
     return type;
   }
@@ -1100,7 +1145,7 @@
       // Compute `B<double, dynamic>` as the subtype of `A<double, int>` using
       // the relation between `A<S, int>` and `A<double, int>`.
       MoreSpecificSubtypeVisitor visitor =
-          new MoreSpecificSubtypeVisitor(compiler);
+          new MoreSpecificSubtypeVisitor(types);
       InterfaceType shownTypeGeneric = visitor.computeMoreSpecific(
           shownClass, knownInterfaceType);
 
@@ -1115,11 +1160,24 @@
 
   }
 
-  DartType visitSend(Send node) {
-    if (elements.isAssert(node)) {
-      return analyzeInvocation(node, const AssertAccess());
+  static bool _fyiShown = false;
+  DartType _record(Node node, DartType type) {
+    if (node is! Expression) return type;
+    if (const bool.fromEnvironment('send_stats') &&
+        executableContext != null &&
+        // TODO(sigmund): enable also in core libs.
+        !executableContext.library.isPlatformLibrary && !type.isDynamic) {
+      if (!_fyiShown) {
+        print('FYI experiment to collect send stats is on: '
+            'caching types of expressions');
+        _fyiShown = true;
+      }
+      elements.typesCache[node] = type;
     }
+    return type;
+  }
 
+  DartType visitSend(Send node) {
     Element element = elements[node];
 
     if (element != null && element.isConstructor) {
@@ -1181,27 +1239,30 @@
             if (!types.isMoreSpecific(shownType, knownType)) {
               String variableName = variable.name;
               if (!types.isSubtype(shownType, knownType)) {
-                typePromotion.addHint(node,
+                typePromotion.addHint(reporter.createMessage(
+                    node,
                     MessageKind.NOT_MORE_SPECIFIC_SUBTYPE,
                     {'variableName': variableName,
                      'shownType': shownType,
-                     'knownType': knownType});
+                     'knownType': knownType}));
               } else {
                 DartType shownTypeSuggestion =
                     computeMoreSpecificType(shownType, knownType);
                 if (shownTypeSuggestion != null) {
-                  typePromotion.addHint(node,
+                  typePromotion.addHint(reporter.createMessage(
+                      node,
                       MessageKind.NOT_MORE_SPECIFIC_SUGGESTION,
                       {'variableName': variableName,
                        'shownType': shownType,
                        'shownTypeSuggestion': shownTypeSuggestion,
-                       'knownType': knownType});
+                       'knownType': knownType}));
                 } else {
-                  typePromotion.addHint(node,
+                  typePromotion.addHint(reporter.createMessage(
+                      node,
                       MessageKind.NOT_MORE_SPECIFIC,
                       {'variableName': variableName,
                        'shownType': shownType,
-                       'knownType': knownType});
+                       'knownType': knownType}));
                 }
               }
             }
@@ -1291,7 +1352,7 @@
     } else if (node.isPropertyAccess) {
       ElementAccess access =
           computeAccess(node, selector.source, element, MemberKind.GETTER);
-      return access.computeType(compiler);
+      return access.computeType(resolution);
     } else if (node.isFunctionObjectInvocation) {
       return unhandledExpression();
     } else {
@@ -1485,7 +1546,7 @@
         case '<<=': operatorName = '<<'; break;
         case '>>=': operatorName = '>>'; break;
         default:
-          compiler.internalError(node, 'Unexpected assignment operator $name.');
+          reporter.internalError(node, 'Unexpected assignment operator $name.');
       }
       if (node.isIndex) {
         // base[key] o= value for some operator o.
@@ -1535,7 +1596,7 @@
   DartType computeConstructorType(ConstructorElement constructor,
                                   DartType type) {
     if (Elements.isUnresolved(constructor)) return const DynamicType();
-    DartType constructorType = constructor.computeType(compiler);
+    DartType constructorType = constructor.computeType(resolution);
     if (identical(type.kind, TypeKind.INTERFACE)) {
       if (constructor.isSynthesized) {
         // TODO(johnniwinther): Remove this when synthesized constructors handle
@@ -1623,7 +1684,7 @@
           checkAssignable(expression, expressionType, expectedReturnType);
         }
       }
-    } else if (currentAsyncMarker == AsyncMarker.ASYNC) {
+    } else if (currentAsyncMarker != AsyncMarker.SYNC) {
       // `return;` is allowed.
     } else if (!types.isAssignable(expectedReturnType, const VoidType())) {
       // Let f be the function immediately enclosing a return statement of the
@@ -1689,6 +1750,17 @@
         SendSet initialization = definition;
         DartType initializer = analyzeNonVoid(initialization.arguments.head);
         checkAssignable(initialization.assignmentOperator, initializer, type);
+        // TODO(sigmund): explore inferring a type for `var` using the RHS (like
+        // DDC does), for example:
+        // if (node.type == null && node.modifiers.isVar &&
+        //     !initializer.isDynamic) {
+        //   var variable = elements[definition];
+        //   if (variable != null) {
+        //     var typePromotion = new TypePromotion(
+        //         node, variable, initializer);
+        //     registerKnownTypePromotion(typePromotion);
+        //   }
+        // }
       }
     }
     return const StatementType();
@@ -1743,14 +1815,67 @@
     return const StatementType();
   }
 
+  DartType computeForInElementType(ForIn node) {
+    VariableDefinitions declaredIdentifier =
+        node.declaredIdentifier.asVariableDefinitions();
+    if (declaredIdentifier != null) {
+      return
+          analyzeWithDefault(declaredIdentifier.type, const DynamicType());
+    } else {
+      return analyze(node.declaredIdentifier);
+    }
+  }
+
   visitAsyncForIn(AsyncForIn node) {
-    analyze(node.expression);
+    DartType elementType = computeForInElementType(node);
+    DartType expressionType = analyze(node.expression);
+    // TODO(johnniwinther): Move this to _CompilerCoreTypes.
+    compiler.streamClass.ensureResolved(resolution);
+    DartType streamOfDynamic = coreTypes.streamType();
+    if (!types.isAssignable(expressionType, streamOfDynamic)) {
+      reportMessage(node.expression,
+          MessageKind.NOT_ASSIGNABLE,
+          {'fromType': expressionType, 'toType': streamOfDynamic},
+          isHint: true);
+    } else {
+      InterfaceType interfaceType =
+          Types.computeInterfaceType(resolution, expressionType);
+      if (interfaceType != null) {
+        InterfaceType streamType =
+            interfaceType.asInstanceOf(compiler.streamClass);
+        if (streamType != null) {
+          DartType streamElementType = streamType.typeArguments.first;
+          if (!types.isAssignable(streamElementType, elementType)) {
+            reportMessage(node.expression,
+                MessageKind.FORIN_NOT_ASSIGNABLE,
+                {'currentType': streamElementType,
+                 'expressionType': expressionType,
+                 'elementType': elementType},
+                isHint: true);
+          }
+        }
+      }
+    }
     analyze(node.body);
     return const StatementType();
   }
 
   visitSyncForIn(SyncForIn node) {
-    analyze(node.expression);
+    DartType elementType = computeForInElementType(node);
+    DartType expressionType = analyze(node.expression);
+    DartType iteratorType = lookupMemberType(node.expression,
+        expressionType, Identifiers.iterator, MemberKind.GETTER);
+    DartType currentType = lookupMemberType(node.expression,
+              iteratorType, Identifiers.current, MemberKind.GETTER,
+              isHint: true);
+    if (!types.isAssignable(currentType, elementType)) {
+      reportMessage(node.expression,
+          MessageKind.FORIN_NOT_ASSIGNABLE,
+          {'currentType': currentType,
+           'expressionType': expressionType,
+           'elementType': elementType},
+          isHint: true);
+    }
     analyze(node.body);
     return const StatementType();
   }
@@ -1840,9 +1965,11 @@
         }
         unreferencedFields.addAll(enumValues.values);
         if (!unreferencedFields.isEmpty) {
-          compiler.reportWarning(node, MessageKind.MISSING_ENUM_CASES,
+          reporter.reportWarningMessage(
+              node, MessageKind.MISSING_ENUM_CASES,
               {'enumType': expressionType,
-               'enumValues': unreferencedFields.map((e) => e.name).join(', ')});
+               'enumValues': unreferencedFields.map(
+                   (e) => e.name).join(', ')});
         }
       });
     }
@@ -1875,7 +2002,7 @@
   }
 
   visitNode(Node node) {
-    compiler.internalError(node,
+    reporter.internalError(node,
         'Unexpected node ${node.getObjectDescription()} in the type checker.');
   }
 }
diff --git a/pkg/compiler/lib/src/types/constants.dart b/pkg/compiler/lib/src/types/constants.dart
index 27b21c8..1129465 100644
--- a/pkg/compiler/lib/src/types/constants.dart
+++ b/pkg/compiler/lib/src/types/constants.dart
@@ -4,10 +4,13 @@
 
 library types.constants;
 
+import '../common.dart';
+import '../compiler.dart' show
+    Compiler;
 import '../constants/values.dart';
-import '../dart2jslib.dart';
+import '../js_backend/js_backend.dart' show
+    SyntheticConstantKind;
 import 'types.dart';
-import '../js_backend/js_backend.dart' show SyntheticConstantKind;
 
 /// Computes the [TypeMask] for the constant [value].
 TypeMask computeTypeMask(Compiler compiler, ConstantValue value) {
@@ -57,7 +60,8 @@
       case SyntheticConstantKind.NAME:
         return compiler.typesTask.stringType;
       default:
-        compiler.internalError(compiler.currentElement,
+        DiagnosticReporter reporter = compiler.reporter;
+        reporter.internalError(CURRENT_ELEMENT_SPANNABLE,
                                "Unexpected DummyConstantKind.");
         return null;
     }
diff --git a/pkg/compiler/lib/src/types/type_mask.dart b/pkg/compiler/lib/src/types/type_mask.dart
index bf095b8..2f5754f 100644
--- a/pkg/compiler/lib/src/types/type_mask.dart
+++ b/pkg/compiler/lib/src/types/type_mask.dart
@@ -4,12 +4,78 @@
 
 part of types;
 
+/// An implementation of a [UniverseSelectorConstraints] that is consists if an only
+/// increasing set of [TypeMask]s, that is, once a mask is added it cannot be
+/// removed.
+class IncreasingTypeMaskSet extends UniverseSelectorConstraints {
+  bool isAll = false;
+  Set<TypeMask> _masks;
+
+  @override
+  bool applies(Element element, Selector selector, ClassWorld world) {
+    if (isAll) return true;
+    if (_masks == null) return false;
+    for (TypeMask mask in _masks) {
+      if (mask.canHit(element, selector, world)) return true;
+    }
+    return false;
+  }
+
+  @override
+  bool needsNoSuchMethodHandling(Selector selector, ClassWorld world) {
+    if (isAll) {
+      TypeMask mask =
+          new TypeMask.subclass(world.objectClass, world);
+      return mask.needsNoSuchMethodHandling(selector, world);
+    }
+    for (TypeMask mask in _masks) {
+      if (mask.needsNoSuchMethodHandling(selector, world)) {
+        return true;
+      }
+    }
+    return false;
+  }
+
+  @override
+  bool addReceiverConstraint(TypeMask mask) {
+    if (isAll) return false;
+    if (mask == null) {
+      isAll = true;
+      _masks = null;
+      return true;
+    }
+    if (_masks == null) {
+      _masks = new Setlet<TypeMask>();
+    }
+    return _masks.add(mask);
+  }
+
+  String toString() {
+    if (isAll) {
+      return '<all>';
+    } else if (_masks != null) {
+      return '$_masks';
+    } else {
+      return '<none>';
+    }
+  }
+}
+
+class TypeMaskStrategy implements SelectorConstraintsStrategy {
+  const TypeMaskStrategy();
+
+  @override
+  UniverseSelectorConstraints createSelectorConstraints(Selector selector) {
+    return new IncreasingTypeMaskSet();
+  }
+}
+
 /**
  * A type mask represents a set of contained classes, but the
  * operations on it are not guaranteed to be precise and they may
  * yield conservative answers that contain too many classes.
  */
-abstract class TypeMask {
+abstract class TypeMask implements ReceiverConstraint {
   factory TypeMask(ClassElement base,
                    int kind,
                    bool isNullable,
@@ -22,8 +88,8 @@
 
   factory TypeMask.exact(ClassElement base, ClassWorld classWorld) {
     assert(invariant(base, classWorld.isInstantiated(base),
-        message: "Cannot create extact type mask for uninstantiated class "
-          "${base.name}"));
+        message: () => "Cannot create exact type mask for uninstantiated "
+                       "class $base.\n${classWorld.dump()}"));
     return new FlatTypeMask.exact(base);
   }
 
@@ -55,8 +121,8 @@
 
   factory TypeMask.nonNullExact(ClassElement base, ClassWorld classWorld) {
     assert(invariant(base, classWorld.isInstantiated(base),
-        message: "Cannot create extact type mask for "
-                 "uninstantiated class $base."));
+        message: () => "Cannot create exact type mask for "
+                 "uninstantiated class $base.\n${classWorld.dump(base)}"));
     return new FlatTypeMask.nonNullExact(base);
   }
 
diff --git a/pkg/compiler/lib/src/types/types.dart b/pkg/compiler/lib/src/types/types.dart
index 9db71f1..9d91f99 100644
--- a/pkg/compiler/lib/src/types/types.dart
+++ b/pkg/compiler/lib/src/types/types.dart
@@ -4,13 +4,29 @@
 
 library types;
 
-import '../dart2jslib.dart' hide Selector, TypedSelector;
+import '../common.dart';
+import '../common/backend_api.dart' show
+    Backend;
+import '../common/tasks.dart' show
+    CompilerTask;
+import '../compiler.dart' show
+    Compiler;
+import '../constants/values.dart' show
+    PrimitiveConstantValue;
 import '../elements/elements.dart';
-import '../inferrer/type_graph_inferrer.dart' show TypeGraphInferrer;
+import '../inferrer/type_graph_inferrer.dart' show
+    TypeGraphInferrer;
 import '../tree/tree.dart';
 import '../util/util.dart';
-import '../universe/universe.dart';
-import '../inferrer/concrete_types_inferrer.dart' show ConcreteTypesInferrer;
+import '../universe/selector.dart' show
+    Selector;
+import '../universe/universe.dart' show
+    ReceiverConstraint,
+    UniverseSelectorConstraints,
+    SelectorConstraintsStrategy;
+import '../world.dart' show
+    ClassWorld,
+    World;
 
 part 'container_type_mask.dart';
 part 'dictionary_type_mask.dart';
@@ -45,15 +61,11 @@
   final String name = 'Type inference';
   final ClassWorld classWorld;
   TypesInferrer typesInferrer;
-  ConcreteTypesInferrer concreteTypesInferrer;
 
   TypesTask(Compiler compiler)
       : this.classWorld = compiler.world,
         super(compiler) {
     typesInferrer = new TypeGraphInferrer(compiler);
-    if (compiler.enableConcreteTypeInference) {
-      concreteTypesInferrer = new ConcreteTypesInferrer(compiler);
-    }
   }
 
   TypeMask dynamicTypeCache;
@@ -247,7 +259,7 @@
     return result;
   }
 
-  /** Returns true if [type1] is strictly bettern than [type2]. */
+  /** Returns true if [type1] is strictly better than [type2]. */
   bool better(TypeMask type1, TypeMask type2) {
     if (type1 == null) return false;
     if (type2 == null) {
@@ -265,15 +277,6 @@
   void onResolutionComplete(Element mainElement) {
     measure(() {
       typesInferrer.analyzeMain(mainElement);
-      if (concreteTypesInferrer != null) {
-        bool success = concreteTypesInferrer.analyzeMain(mainElement);
-        if (!success) {
-          // If the concrete type inference bailed out, we pretend it didn't
-          // happen. In the future we might want to record that it failed but
-          // use the partial results as hints.
-          concreteTypesInferrer = null;
-        }
-      }
     });
     typesInferrer.clear();
   }
@@ -283,24 +286,25 @@
    */
   TypeMask getGuaranteedTypeOfElement(Element element) {
     return measure(() {
+      // TODO(24489): trust some JsInterop types.
+      if (element.isJsInterop) {
+        return dynamicType;
+      }
       TypeMask guaranteedType = typesInferrer.getTypeOfElement(element);
-      return (concreteTypesInferrer == null)
-          ? guaranteedType
-          : intersection(guaranteedType,
-                         concreteTypesInferrer.getTypeOfElement(element),
-                         element);
+      return guaranteedType;
     });
   }
 
   TypeMask getGuaranteedReturnTypeOfElement(Element element) {
     return measure(() {
+      // TODO(24489): trust some JsInterop types.
+      if (element.isJsInterop) {
+        return dynamicType;
+      }
+
       TypeMask guaranteedType =
           typesInferrer.getReturnTypeOfElement(element);
-      return (concreteTypesInferrer == null)
-          ? guaranteedType
-          : intersection(guaranteedType,
-                         concreteTypesInferrer.getReturnTypeOfElement(element),
-                         element);
+      return guaranteedType;
     });
   }
 
@@ -311,11 +315,7 @@
   TypeMask getGuaranteedTypeOfNode(owner, node) {
     return measure(() {
       TypeMask guaranteedType = typesInferrer.getTypeOfNode(owner, node);
-      return (concreteTypesInferrer == null)
-          ? guaranteedType
-          : intersection(guaranteedType,
-                         concreteTypesInferrer.getTypeOfNode(owner, node),
-                         node);
+      return guaranteedType;
     });
   }
 
@@ -326,12 +326,7 @@
     return measure(() {
       TypeMask guaranteedType =
           typesInferrer.getTypeOfSelector(selector, mask);
-      return (concreteTypesInferrer == null)
-          ? guaranteedType
-          : intersection(
-              guaranteedType,
-              concreteTypesInferrer.getTypeOfSelector(selector, mask),
-              selector);
+      return guaranteedType;
     });
   }
 }
diff --git a/pkg/compiler/lib/src/types/value_type_mask.dart b/pkg/compiler/lib/src/types/value_type_mask.dart
index 737be5e..72c5af2 100644
--- a/pkg/compiler/lib/src/types/value_type_mask.dart
+++ b/pkg/compiler/lib/src/types/value_type_mask.dart
@@ -6,7 +6,7 @@
 
 class ValueTypeMask extends ForwardingTypeMask {
   final TypeMask forwardTo;
-  final value;
+  final PrimitiveConstantValue value;
 
   ValueTypeMask(this.forwardTo, this.value);
 
@@ -44,6 +44,6 @@
   }
 
   String toString() {
-    return 'Value mask: [$value] type: $forwardTo';
+    return 'Value mask: [${value.unparse()}] type: $forwardTo';
   }
 }
\ No newline at end of file
diff --git a/pkg/compiler/lib/src/universe/call_structure.dart b/pkg/compiler/lib/src/universe/call_structure.dart
new file mode 100644
index 0000000..461950f
--- /dev/null
+++ b/pkg/compiler/lib/src/universe/call_structure.dart
@@ -0,0 +1,292 @@
+// 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 dart2js.call_structure;
+
+import '../common.dart';
+import '../common/names.dart' show
+    Identifiers,
+    Names,
+    Selectors;
+import '../elements/elements.dart';
+import '../tree/tree.dart';
+import '../util/util.dart';
+
+import 'selector.dart' show
+    Selector;
+
+/// The structure of the arguments at a call-site.
+// TODO(johnniwinther): Should these be cached?
+// TODO(johnniwinther): Should isGetter/isSetter be part of the call structure
+// instead of the selector?
+class CallStructure {
+  static const CallStructure NO_ARGS = const CallStructure.unnamed(0);
+  static const CallStructure ONE_ARG = const CallStructure.unnamed(1);
+  static const CallStructure TWO_ARGS = const CallStructure.unnamed(2);
+
+  /// The numbers of arguments of the call. Includes named arguments.
+  final int argumentCount;
+
+  /// The number of named arguments of the call.
+  int get namedArgumentCount => 0;
+
+  /// The number of positional argument of the call.
+  int get positionalArgumentCount => argumentCount;
+
+  const CallStructure.unnamed(this.argumentCount);
+
+  factory CallStructure(int argumentCount, [List<String> namedArguments]) {
+    if (namedArguments == null || namedArguments.isEmpty) {
+      return new CallStructure.unnamed(argumentCount);
+    }
+    return new NamedCallStructure(argumentCount, namedArguments);
+  }
+
+  /// `true` if this call has named arguments.
+  bool get isNamed => false;
+
+  /// `true` if this call has no named arguments.
+  bool get isUnnamed => true;
+
+  /// The names of the named arguments in call-site order.
+  List<String> get namedArguments => const <String>[];
+
+  /// The names of the named arguments in canonicalized order.
+  List<String> getOrderedNamedArguments() => const <String>[];
+
+  /// A description of the argument structure.
+  String structureToString() => 'arity=$argumentCount';
+
+  String toString() => 'CallStructure(${structureToString()})';
+
+  Selector get callSelector => new Selector.call(Names.call, this);
+
+  bool match(CallStructure other) {
+    if (identical(this, other)) return true;
+    return this.argumentCount == other.argumentCount
+        && this.namedArgumentCount == other.namedArgumentCount
+        && sameNames(this.namedArguments, other.namedArguments);
+  }
+
+  // TODO(johnniwinther): Cache hash code?
+  int get hashCode {
+    return Hashing.listHash(namedArguments,
+        Hashing.objectHash(argumentCount, namedArguments.length));
+  }
+
+  bool operator ==(other) {
+    if (other is! CallStructure) return false;
+    return match(other);
+  }
+
+  bool signatureApplies(FunctionSignature parameters) {
+    if (argumentCount > parameters.parameterCount) return false;
+    int requiredParameterCount = parameters.requiredParameterCount;
+    int optionalParameterCount = parameters.optionalParameterCount;
+    if (positionalArgumentCount < requiredParameterCount) return false;
+
+    if (!parameters.optionalParametersAreNamed) {
+      // We have already checked that the number of arguments are
+      // not greater than the number of parameters. Therefore the
+      // number of positional arguments are not greater than the
+      // number of parameters.
+      assert(positionalArgumentCount <= parameters.parameterCount);
+      return namedArguments.isEmpty;
+    } else {
+      if (positionalArgumentCount > requiredParameterCount) return false;
+      assert(positionalArgumentCount == requiredParameterCount);
+      if (namedArgumentCount > optionalParameterCount) return false;
+      Set<String> nameSet = new Set<String>();
+      parameters.optionalParameters.forEach((Element element) {
+        nameSet.add(element.name);
+      });
+      for (String name in namedArguments) {
+        if (!nameSet.contains(name)) return false;
+        // TODO(5213): By removing from the set we are checking
+        // that we are not passing the name twice. We should have this
+        // check in the resolver also.
+        nameSet.remove(name);
+      }
+      return true;
+    }
+  }
+
+  /**
+   * Returns a `List` with the evaluated arguments in the normalized order.
+   *
+   * [compileDefaultValue] is a function that returns a compiled constant
+   * of an optional argument that is not in [compiledArguments].
+   *
+   * Precondition: `this.applies(element, world)`.
+   *
+   * Invariant: [element] must be the implementation element.
+   */
+  /*<T>*/ List/*<T>*/ makeArgumentsList(
+      Link<Node> arguments,
+      FunctionElement element,
+      /*T*/ compileArgument(Node argument),
+      /*T*/ compileDefaultValue(ParameterElement element)) {
+    assert(invariant(element, element.isImplementation));
+    List/*<T>*/ result = new List();
+
+    FunctionSignature parameters = element.functionSignature;
+    parameters.forEachRequiredParameter((ParameterElement element) {
+      result.add(compileArgument(arguments.head));
+      arguments = arguments.tail;
+    });
+
+    if (!parameters.optionalParametersAreNamed) {
+      parameters.forEachOptionalParameter((ParameterElement element) {
+        if (!arguments.isEmpty) {
+          result.add(compileArgument(arguments.head));
+          arguments = arguments.tail;
+        } else {
+          result.add(compileDefaultValue(element));
+        }
+      });
+    } else {
+      // Visit named arguments and add them into a temporary list.
+      List compiledNamedArguments = [];
+      for (; !arguments.isEmpty; arguments = arguments.tail) {
+        NamedArgument namedArgument = arguments.head;
+        compiledNamedArguments.add(compileArgument(namedArgument.expression));
+      }
+      // Iterate over the optional parameters of the signature, and try to
+      // find them in [compiledNamedArguments]. If found, we use the
+      // value in the temporary list, otherwise the default value.
+      parameters.orderedOptionalParameters.forEach((ParameterElement element) {
+        int foundIndex = namedArguments.indexOf(element.name);
+        if (foundIndex != -1) {
+          result.add(compiledNamedArguments[foundIndex]);
+        } else {
+          result.add(compileDefaultValue(element));
+        }
+      });
+    }
+    return result;
+  }
+
+  /**
+   * Fills [list] with the arguments in the order expected by
+   * [callee], and where [caller] is a synthesized element
+   *
+   * [compileArgument] is a function that returns a compiled version
+   * of a parameter of [callee].
+   *
+   * [compileConstant] is a function that returns a compiled constant
+   * of an optional argument that is not in the parameters of [callee].
+   *
+   * Returns [:true:] if the signature of the [caller] matches the
+   * signature of the [callee], [:false:] otherwise.
+   */
+  static /*<T>*/ bool addForwardingElementArgumentsToList(
+      ConstructorElement caller,
+      List/*<T>*/ list,
+      ConstructorElement callee,
+      /*T*/ compileArgument(ParameterElement element),
+      /*T*/ compileConstant(ParameterElement element)) {
+    assert(invariant(caller, !callee.isErroneous,
+        message: "Cannot compute arguments to erroneous constructor: "
+                 "$caller calling $callee."));
+
+    FunctionSignature signature = caller.functionSignature;
+    Map<Node, ParameterElement> mapping = <Node, ParameterElement>{};
+
+    // TODO(ngeoffray): This is a hack that fakes up AST nodes, so
+    // that we can call [addArgumentsToList].
+    Link<Node> computeCallNodesFromParameters() {
+      LinkBuilder<Node> builder = new LinkBuilder<Node>();
+      signature.forEachRequiredParameter((ParameterElement element) {
+        Node node = element.node;
+        mapping[node] = element;
+        builder.addLast(node);
+      });
+      if (signature.optionalParametersAreNamed) {
+        signature.forEachOptionalParameter((ParameterElement element) {
+          mapping[element.initializer] = element;
+          builder.addLast(new NamedArgument(null, null, element.initializer));
+        });
+      } else {
+        signature.forEachOptionalParameter((ParameterElement element) {
+          Node node = element.node;
+          mapping[node] = element;
+          builder.addLast(node);
+        });
+      }
+      return builder.toLink();
+    }
+
+    /*T*/ internalCompileArgument(Node node) {
+      return compileArgument(mapping[node]);
+    }
+
+    Link<Node> nodes = computeCallNodesFromParameters();
+
+    // Synthesize a structure for the call.
+    // TODO(ngeoffray): Should the resolver do it instead?
+    List<String> namedParameters;
+    if (signature.optionalParametersAreNamed) {
+      namedParameters =
+          signature.optionalParameters.map((e) => e.name).toList();
+    }
+    CallStructure callStructure =
+        new CallStructure(signature.parameterCount, namedParameters);
+    if (!callStructure.signatureApplies(signature)) {
+      return false;
+    }
+    list.addAll(callStructure.makeArgumentsList(
+        nodes,
+        callee,
+        internalCompileArgument,
+        compileConstant));
+
+    return true;
+  }
+
+  static bool sameNames(List<String> first, List<String> second) {
+    for (int i = 0; i < first.length; i++) {
+      if (first[i] != second[i]) return false;
+    }
+    return true;
+  }
+}
+
+///
+class NamedCallStructure extends CallStructure {
+  final List<String> namedArguments;
+  final List<String> _orderedNamedArguments = <String>[];
+
+  NamedCallStructure(int argumentCount, this.namedArguments)
+      : super.unnamed(argumentCount) {
+    assert(namedArguments.isNotEmpty);
+  }
+
+  @override
+  bool get isNamed => true;
+
+  @override
+  bool get isUnnamed => false;
+
+  @override
+  int get namedArgumentCount => namedArguments.length;
+
+  @override
+  int get positionalArgumentCount => argumentCount - namedArgumentCount;
+
+  @override
+  List<String> getOrderedNamedArguments() {
+    if (!_orderedNamedArguments.isEmpty) return _orderedNamedArguments;
+
+    _orderedNamedArguments.addAll(namedArguments);
+    _orderedNamedArguments.sort((String first, String second) {
+      return first.compareTo(second);
+    });
+    return _orderedNamedArguments;
+  }
+
+  @override
+  String structureToString() {
+    return 'arity=$argumentCount, named=[${namedArguments.join(', ')}]';
+  }
+}
diff --git a/pkg/compiler/lib/src/universe/class_set.dart b/pkg/compiler/lib/src/universe/class_set.dart
index 11d9e09..b418976 100644
--- a/pkg/compiler/lib/src/universe/class_set.dart
+++ b/pkg/compiler/lib/src/universe/class_set.dart
@@ -12,7 +12,27 @@
 ///
 /// This is used by the [ClassWorld] to perform queries on subclass and subtype
 /// relations.
-// TODO(johnniwinther): Use this for `ClassWorld.subtypesOf`.
+///
+/// For this class hierarchy:
+///
+///     class A {}
+///     class B extends A {}
+///     class C extends A {}
+///     class D extends B {}
+///     class E extends D {}
+///
+/// the [ClassHierarchyNode]s form this subclass tree:
+///
+///       Object
+///         |
+///         A
+///        / \
+///       B   C
+///       |
+///       D
+///       |
+///       E
+///
 class ClassHierarchyNode {
   final ClassElement cls;
 
@@ -47,39 +67,280 @@
     _directSubclasses = _directSubclasses.prepend(subclass);
   }
 
+  /// Returns `true` if [other] is contained in the subtree of this node.
+  ///
+  /// This means that [other] is a subclass of [cls].
+  bool contains(ClassElement other) {
+    while (other != null) {
+      if (cls == other) return true;
+      if (cls.hierarchyDepth >= other.hierarchyDepth) return false;
+      other = other.superclass;
+    }
+    return false;
+  }
+
   /// `true` if [cls] has been directly or indirectly instantiated.
   bool get isInstantiated => isDirectlyInstantiated || isIndirectlyInstantiated;
 
   /// Returns an [Iterable] of the subclasses of [cls] possibly including [cls].
-  /// If [directlyInstantiated] is `true`, the iterable only returns the
-  /// directly instantiated subclasses of [cls].
-  Iterable<ClassElement> subclasses({bool directlyInstantiated: true}) {
+  ///
+  /// The directly instantiated, indirectly instantiated and uninstantiated
+  /// subclasses of [cls] are returned if [includeDirectlyInstantiated],
+  /// [includeIndirectlyInstantiated], and [includeUninstantiated] are `true`,
+  /// respectively. If [strict] is `true`, [cls] itself is _not_ returned.
+  Iterable<ClassElement> subclasses(
+      {bool includeDirectlyInstantiated: true,
+       bool includeIndirectlyInstantiated: true,
+       bool includeUninstantiated: true,
+       bool strict: false}) {
     return new ClassHierarchyNodeIterable(
-        this, directlyInstantiatedOnly: directlyInstantiated);
+        this,
+        includeRoot: !strict,
+        includeDirectlyInstantiated: includeDirectlyInstantiated,
+        includeIndirectlyInstantiated: includeIndirectlyInstantiated,
+        includeUninstantiated: includeUninstantiated);
   }
 
-  /// Returns an [Iterable] of the strict subclasses of [cls] _not_ including
-  /// [cls] itself. If [directlyInstantiated] is `true`, the iterable only
-  /// returns the directly instantiated subclasses of [cls].
-  Iterable<ClassElement> strictSubclasses(
-      {bool directlyInstantiated: true}) {
-    return new ClassHierarchyNodeIterable(this,
-        includeRoot: false, directlyInstantiatedOnly: directlyInstantiated);
+  void printOn(StringBuffer sb, String indentation,
+               {bool instantiatedOnly: false,
+                ClassElement withRespectTo}) {
+
+    bool isRelatedTo(ClassElement subclass) {
+      return subclass.implementsInterface(withRespectTo);
+    }
+
+    sb.write('$indentation$cls');
+    if (isDirectlyInstantiated) {
+      sb.write(' directly');
+    }
+    if (isIndirectlyInstantiated) {
+      sb.write(' indirectly');
+    }
+    sb.write(' [');
+    if (_directSubclasses.isEmpty) {
+      sb.write(']');
+    } else {
+      bool needsComma = false;
+      for (Link<ClassHierarchyNode> link = _directSubclasses;
+           !link.isEmpty;
+           link = link.tail) {
+        ClassHierarchyNode child = link.head;
+        if (instantiatedOnly && !child.isInstantiated) {
+          continue;
+        }
+        if (withRespectTo != null && !child.subclasses().any(isRelatedTo)) {
+          continue;
+        }
+        if (needsComma) {
+          sb.write(',\n');
+        } else {
+          sb.write('\n');
+        }
+        child.printOn(
+            sb,
+            '$indentation  ',
+            instantiatedOnly: instantiatedOnly,
+            withRespectTo: withRespectTo);
+        needsComma = true;
+      }
+      if (needsComma) {
+        sb.write('\n');
+        sb.write('$indentation]');
+      } else {
+        sb.write(']');
+      }
+    }
+  }
+
+  String dump({String indentation: '',
+               bool instantiatedOnly: false,
+               ClassElement withRespectTo}) {
+    StringBuffer sb = new StringBuffer();
+    printOn(sb, indentation,
+        instantiatedOnly: instantiatedOnly,
+        withRespectTo: withRespectTo);
+    return sb.toString();
   }
 
   String toString() => cls.toString();
 }
 
+/// Object holding the subclass and subtype relation for a single
+/// [ClassElement].
+///
+/// The subclass relation for a class `C` is modelled through a reference to
+/// the [ClassHierarchyNode] for `C` in the global [ClassHierarchyNode] tree
+/// computed in [World].
+///
+/// The subtype relation for a class `C` is modelled through a collection of
+/// disjoint [ClassHierarchyNode] subtrees. The subclasses of `C`, modelled
+/// through the aforementioned [ClassHierarchyNode] pointer, are extended with
+/// the subtypes that do not extend `C` through a list of additional
+/// [ClassHierarchyNode] nodes. This list is normalized to contain only the
+/// nodes for the topmost subtypes and is furthermore ordered in increasing
+/// hierarchy depth order.
+///
+/// For this class hierarchy:
+///
+///     class A {}
+///     class B extends A {}
+///     class C implements B {}
+///     class D implements A {}
+///     class E extends D {}
+///     class F implements D {}
+///
+/// the [ClassHierarchyNode] tree is
+///
+///       Object
+///      / |  | \
+///     A  C  D  F
+///     |     |
+///     B     E
+///
+/// and the [ClassSet] for `A` holds these [ClassHierarchyNode] nodes:
+///
+///      A  ->  [C, D, F]
+///
+/// The subtypes `B` and `E` are not directly modeled because they are implied
+/// by their subclass relation to `A` and `D`, repectively. This can be seen
+/// if we expand the subclass subtrees:
+///
+///      A  ->  [C, D, F]
+///      |          |
+///      B          E
+///
+class ClassSet {
+  final ClassHierarchyNode node;
+
+  List<ClassHierarchyNode> _directSubtypes;
+
+  ClassSet(this.node);
+
+  ClassElement get cls => node.cls;
+
+  /// Returns an [Iterable] of the subclasses of [cls] possibly including [cls].
+  ///
+  /// The directly instantiated, indirectly instantiated and uninstantiated
+  /// subclasses of [cls] are returned if [includeDirectlyInstantiated],
+  /// [includeIndirectlyInstantiated], and [includeUninstantiated] are `true`,
+  /// respectively. If [strict] is `true`, [cls] itself is _not_ returned.
+  Iterable<ClassElement> subclasses(
+      {bool includeDirectlyInstantiated: true,
+       bool includeIndirectlyInstantiated: true,
+       bool includeUninstantiated: true,
+       bool strict: false}) {
+    return node.subclasses(
+        strict: strict,
+        includeDirectlyInstantiated: includeDirectlyInstantiated,
+        includeIndirectlyInstantiated: includeIndirectlyInstantiated,
+        includeUninstantiated: includeUninstantiated);
+  }
+
+  /// Returns an [Iterable] of the subtypes of [cls] possibly including [cls].
+  ///
+  /// The directly instantiated, indirectly instantiated and uninstantiated
+  /// subtypes of [cls] are returned if [includeDirectlyInstantiated],
+  /// [includeIndirectlyInstantiated], and [includeUninstantiated] are `true`,
+  /// respectively. If [strict] is `true`, [cls] itself is _not_ returned.
+  Iterable<ClassElement> subtypes(
+      {bool includeDirectlyInstantiated: true,
+       bool includeIndirectlyInstantiated: true,
+       bool includeUninstantiated: true,
+       bool strict: false}) {
+    if (_directSubtypes == null) {
+      return node.subclasses(
+          strict: strict,
+          includeDirectlyInstantiated: includeDirectlyInstantiated,
+          includeIndirectlyInstantiated: includeIndirectlyInstantiated,
+          includeUninstantiated: includeUninstantiated);
+    }
+    return new SubtypesIterable.SubtypesIterator(this,
+        includeRoot: !strict,
+        includeDirectlyInstantiated: includeDirectlyInstantiated,
+        includeIndirectlyInstantiated: includeIndirectlyInstantiated,
+        includeUninstantiated: includeUninstantiated);
+  }
+
+  /// Adds [subtype] as a subtype of [cls].
+  void addSubtype(ClassHierarchyNode subtype) {
+    if (node.contains(subtype.cls)) {
+      return;
+    }
+    if (_directSubtypes == null) {
+      _directSubtypes = <ClassHierarchyNode>[subtype];
+    } else {
+      int hierarchyDepth = subtype.cls.hierarchyDepth;
+      List<ClassHierarchyNode> newSubtypes = <ClassHierarchyNode>[];
+      bool added = false;
+      for (ClassHierarchyNode otherSubtype in _directSubtypes) {
+        int otherHierarchyDepth = otherSubtype.cls.hierarchyDepth;
+        if (hierarchyDepth == otherHierarchyDepth) {
+          if (subtype == otherSubtype) {
+            return;
+          } else {
+            // [otherSubtype] is unrelated to [subtype].
+            newSubtypes.add(otherSubtype);
+          }
+        } else if (hierarchyDepth > otherSubtype.cls.hierarchyDepth) {
+          // [otherSubtype] could be a superclass of [subtype].
+          if (otherSubtype.contains(subtype.cls)) {
+            // [subtype] is already in this set.
+            return;
+          } else {
+            // [otherSubtype] is unrelated to [subtype].
+            newSubtypes.add(otherSubtype);
+          }
+        } else {
+          if (!added) {
+            // Insert [subtype] before other subtypes of higher hierarchy depth.
+            newSubtypes.add(subtype);
+            added = true;
+          }
+          // [subtype] could be a superclass of [otherSubtype].
+          if (subtype.contains(otherSubtype.cls)) {
+            // Replace [otherSubtype].
+          } else {
+            newSubtypes.add(otherSubtype);
+          }
+        }
+      }
+      if (!added) {
+        newSubtypes.add(subtype);
+      }
+      _directSubtypes = newSubtypes;
+    }
+  }
+
+  String toString() {
+    StringBuffer sb = new StringBuffer();
+    sb.write('[\n');
+    node.printOn(sb, '  ');
+    sb.write('\n');
+    if (_directSubtypes != null) {
+      for (ClassHierarchyNode node in _directSubtypes) {
+        node.printOn(sb, '  ');
+        sb.write('\n');
+      }
+    }
+    sb.write(']');
+    return sb.toString();
+  }
+}
+
 /// Iterable for subclasses of a [ClassHierarchyNode].
 class ClassHierarchyNodeIterable extends IterableBase<ClassElement> {
   final ClassHierarchyNode root;
   final bool includeRoot;
-  final bool directlyInstantiatedOnly;
+  final bool includeDirectlyInstantiated;
+  final bool includeIndirectlyInstantiated;
+  final bool includeUninstantiated;
 
   ClassHierarchyNodeIterable(
       this.root,
       {this.includeRoot: true,
-       this.directlyInstantiatedOnly: false}) {
+       this.includeDirectlyInstantiated: true,
+       this.includeIndirectlyInstantiated: true,
+       this.includeUninstantiated: true}) {
     if (root == null) throw new StateError("No root for iterable.");
   }
 
@@ -112,7 +373,13 @@
 
   bool get includeRoot => iterable.includeRoot;
 
-  bool get directlyInstantiatedOnly => iterable.directlyInstantiatedOnly;
+  bool get includeDirectlyInstantiated => iterable.includeDirectlyInstantiated;
+
+  bool get includeIndirectlyInstantiated {
+    return iterable.includeIndirectlyInstantiated;
+  }
+
+  bool get includeUninstantiated => iterable.includeUninstantiated;
 
   @override
   ClassElement get current {
@@ -143,6 +410,11 @@
       }
       currentNode = stack.head;
       stack = stack.tail;
+      if (!includeUninstantiated && !currentNode.isInstantiated) {
+        // We're only iterating instantiated classes so there is no use in
+        // visiting the current node and its subtree.
+        continue;
+      }
       for (Link<ClassHierarchyNode> link = currentNode._directSubclasses;
            !link.isEmpty;
            link = link.tail) {
@@ -157,9 +429,90 @@
   /// Returns `true` if the class of [node] is a valid result for this iterator.
   bool _isValid(ClassHierarchyNode node) {
     if (!includeRoot && node == root) return false;
-    if (directlyInstantiatedOnly && !node.isDirectlyInstantiated) return false;
-    return true;
+    if (includeDirectlyInstantiated && node.isDirectlyInstantiated) {
+      return true;
+    }
+    if (includeIndirectlyInstantiated && node.isIndirectlyInstantiated) {
+      return true;
+    }
+    if (includeUninstantiated && !node.isInstantiated) {
+      return true;
+    }
+    return false;
   }
 }
 
+/// Iterable for the subtypes in a [ClassSet].
+class SubtypesIterable extends IterableBase<ClassElement> {
+  final ClassSet subtypeSet;
+  final bool includeRoot;
+  final bool includeDirectlyInstantiated;
+  final bool includeIndirectlyInstantiated;
+  final bool includeUninstantiated;
 
+  SubtypesIterable.SubtypesIterator(
+      this.subtypeSet,
+      {this.includeRoot: true,
+       this.includeDirectlyInstantiated: true,
+       this.includeIndirectlyInstantiated: true,
+       this.includeUninstantiated: true});
+
+  @override
+  Iterator<ClassElement> get iterator => new SubtypesIterator(this);
+}
+
+/// Iterator for the subtypes in a [ClassSet].
+class SubtypesIterator extends Iterator<ClassElement> {
+  final SubtypesIterable iterable;
+  Iterator<ClassElement> elements;
+  Iterator<ClassHierarchyNode> hierarchyNodes;
+
+  SubtypesIterator(this.iterable);
+
+  bool get includeRoot => iterable.includeRoot;
+
+  bool get includeDirectlyInstantiated => iterable.includeDirectlyInstantiated;
+
+  bool get includeIndirectlyInstantiated {
+    return iterable.includeIndirectlyInstantiated;
+  }
+
+  bool get includeUninstantiated => iterable.includeUninstantiated;
+
+  @override
+  ClassElement get current {
+    if (elements != null) {
+      return elements.current;
+    }
+    return null;
+  }
+
+  @override
+  bool moveNext() {
+    if (elements == null && hierarchyNodes == null) {
+      // Initial state. Iterate through subclasses.
+      elements = iterable.subtypeSet.node.subclasses(
+          strict: !includeRoot,
+          includeDirectlyInstantiated: includeDirectlyInstantiated,
+          includeIndirectlyInstantiated: includeIndirectlyInstantiated,
+          includeUninstantiated: includeUninstantiated).iterator;
+    }
+    if (elements != null && elements.moveNext()) {
+      return true;
+    }
+    if (hierarchyNodes == null) {
+      // Start iterating through subtypes.
+      hierarchyNodes = iterable.subtypeSet._directSubtypes.iterator;
+    }
+    while (hierarchyNodes.moveNext()) {
+      elements = hierarchyNodes.current.subclasses(
+          includeDirectlyInstantiated: includeDirectlyInstantiated,
+          includeIndirectlyInstantiated: includeIndirectlyInstantiated,
+          includeUninstantiated: includeUninstantiated).iterator;
+      if (elements.moveNext()) {
+        return true;
+      }
+    }
+    return false;
+  }
+}
diff --git a/pkg/compiler/lib/src/universe/function_set.dart b/pkg/compiler/lib/src/universe/function_set.dart
index 7260c6d..72a1813 100644
--- a/pkg/compiler/lib/src/universe/function_set.dart
+++ b/pkg/compiler/lib/src/universe/function_set.dart
@@ -2,7 +2,23 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-part of universe;
+library universe.function_set;
+
+import '../common/names.dart' show
+    Identifiers,
+    Selectors;
+import '../compiler.dart' show
+    Compiler;
+import '../elements/elements.dart';
+import '../types/types.dart';
+import '../util/util.dart' show
+    Hashing,
+    Setlet;
+import '../world.dart' show
+    ClassWorld;
+
+import 'selector.dart' show
+    Selector;
 
 // TODO(kasperl): This actually holds getters and setters just fine
 // too and stricly they aren't functions. Maybe this needs a better
@@ -13,6 +29,8 @@
       new Map<String, FunctionSetNode>();
   FunctionSet(this.compiler);
 
+  ClassWorld get classWorld => compiler.world;
+
   FunctionSetNode newNode(String name)
       => new FunctionSetNode(name);
 
@@ -44,30 +62,50 @@
         : false;
   }
 
-  /**
-   * Returns an object that allows iterating over all the functions
-   * that may be invoked with the given [selector].
-   */
+  /// Returns an object that allows iterating over all the functions
+  /// that may be invoked with the given [selector].
   Iterable<Element> filter(Selector selector, TypeMask mask) {
     return query(selector, mask).functions;
   }
 
+  /// Returns the mask for the potential receivers of a dynamic call to
+  /// [selector] on [mask].
+  ///
+  /// This will reduce the set of classes in [mask] to a [TypeMask] of the set
+  /// of classes that actually implement the selected member or implement the
+  /// handling 'noSuchMethod' where the selected member is unimplemented.
   TypeMask receiverType(Selector selector, TypeMask mask) {
-    return query(selector, mask).computeMask(compiler.world);
+    return query(selector, mask).computeMask(classWorld);
   }
 
+  SelectorMask _createSelectorMask(
+      Selector selector, TypeMask mask, ClassWorld classWorld) {
+    return mask != null
+        ? new SelectorMask(selector, mask)
+        : new SelectorMask(selector,
+            new TypeMask.subclass(classWorld.objectClass, classWorld));
+  }
+
+  /// Returns the set of functions that can be the target of a call to
+  /// [selector] on a receiver of type [mask] including 'noSuchMethod' methods
+  /// where applicable.
   FunctionSetQuery query(Selector selector, TypeMask mask) {
     String name = selector.name;
+    SelectorMask selectorMask = _createSelectorMask(selector, mask, classWorld);
+    SelectorMask noSuchMethodMask =
+        new SelectorMask(Selectors.noSuchMethod_, selectorMask.mask);
     FunctionSetNode node = nodes[name];
-    FunctionSetNode noSuchMethods = nodes[Compiler.NO_SUCH_METHOD];
+    FunctionSetNode noSuchMethods = nodes[Identifiers.noSuchMethod_];
     if (node != null) {
-      return node.query(selector, mask, compiler, noSuchMethods);
+      return node.query(
+          selectorMask, classWorld, noSuchMethods, noSuchMethodMask);
     }
     // If there is no method that matches [selector] we know we can
     // only hit [:noSuchMethod:].
-    if (noSuchMethods == null) return const FunctionSetQuery(const <Element>[]);
-    return noSuchMethods.query(
-        compiler.noSuchMethodSelector, mask, compiler, null);
+    if (noSuchMethods == null) {
+      return const EmptyFunctionSetQuery();
+    }
+    return noSuchMethods.query(noSuchMethodMask, classWorld);
   }
 
   void forEach(Function action) {
@@ -77,6 +115,8 @@
   }
 }
 
+/// A selector/mask pair representing the dynamic invocation of [selector] on
+/// a receiver of type [mask].
 class SelectorMask {
   final Selector selector;
   final TypeMask mask;
@@ -86,16 +126,21 @@
       : this.selector = selector,
         this.mask = mask,
         this.hashCode =
-            Hashing.mixHashCodeBits(selector.hashCode, mask.hashCode);
+            Hashing.mixHashCodeBits(selector.hashCode, mask.hashCode) {
+    assert(mask != null);
+  }
 
   String get name => selector.name;
 
   bool applies(Element element, ClassWorld classWorld) {
     if (!selector.appliesUnnamed(element, classWorld)) return false;
-    if (mask == null) return true;
     return mask.canHit(element, selector, classWorld);
   }
 
+  bool needsNoSuchMethodHandling(ClassWorld classWorld) {
+    return mask.needsNoSuchMethodHandling(selector, classWorld);
+  }
+
   bool operator ==(other) {
     if (identical(this, other)) return true;
     return selector == other.selector && mask == other.mask;
@@ -104,6 +149,8 @@
   String toString() => '($selector,$mask)';
 }
 
+/// A node in the [FunctionSet] caching all [FunctionSetQuery] object for
+/// selectors with the same [name].
 class FunctionSetNode {
   final String name;
   final Map<SelectorMask, FunctionSetQuery> cache =
@@ -164,24 +211,13 @@
     elements.forEach(action);
   }
 
-  TypeMask getNonNullTypeMaskOfSelector(TypeMask mask, ClassWorld classWorld) {
-    // TODO(ngeoffray): We should probably change untyped selector
-    // to always be a subclass of Object.
-    return mask != null
-        ? mask
-        : new TypeMask.subclass(classWorld.objectClass, classWorld);
-    }
-
-  // TODO(johnniwinther): Use [SelectorMask] instead of [Selector] and
-  // [TypeMask].
-  FunctionSetQuery query(Selector selector,
-                         TypeMask mask,
-                         Compiler compiler,
-                         FunctionSetNode noSuchMethods) {
-    mask = getNonNullTypeMaskOfSelector(mask, compiler.world);
-    SelectorMask selectorMask = new SelectorMask(selector, mask);
-    ClassWorld classWorld = compiler.world;
-    assert(selector.name == name);
+  /// Returns the set of functions that can be the target of [selectorMask]
+  /// including no such method handling where applicable.
+  FunctionSetQuery query(SelectorMask selectorMask,
+                         ClassWorld classWorld,
+                         [FunctionSetNode noSuchMethods,
+                          SelectorMask noSuchMethodMask]) {
+    assert(selectorMask.name == name);
     FunctionSetQuery result = cache[selectorMask];
     if (result != null) return result;
 
@@ -201,13 +237,10 @@
     // If we cannot ensure a method will be found at runtime, we also
     // add [noSuchMethod] implementations that apply to [mask] as
     // potential targets.
-    if (noSuchMethods != null
-        && mask.needsNoSuchMethodHandling(selector, classWorld)) {
-      FunctionSetQuery noSuchMethodQuery = noSuchMethods.query(
-          compiler.noSuchMethodSelector,
-          mask,
-          compiler,
-          null);
+    if (noSuchMethods != null &&
+        selectorMask.needsNoSuchMethodHandling(classWorld)) {
+      FunctionSetQuery noSuchMethodQuery =
+          noSuchMethods.query(noSuchMethodMask, classWorld);
       if (!noSuchMethodQuery.functions.isEmpty) {
         if (functions == null) {
           functions = new Setlet<Element>.from(noSuchMethodQuery.functions);
@@ -217,31 +250,43 @@
       }
     }
     cache[selectorMask] = result = (functions != null)
-        ? newQuery(functions, selector, mask, compiler)
-        : const FunctionSetQuery(const <Element>[]);
+        ? new FullFunctionSetQuery(functions)
+        : const EmptyFunctionSetQuery();
     return result;
   }
-
-  FunctionSetQuery newQuery(Iterable<Element> functions,
-                            Selector selector,
-                            TypeMask mask,
-                            Compiler compiler) {
-    return new FullFunctionSetQuery(functions);
-  }
 }
 
-class FunctionSetQuery {
-  final Iterable<Element> functions;
+/// A set of functions that are the potential targets of all call sites sharing
+/// the same receiver mask and selector.
+abstract class FunctionSetQuery {
+  const FunctionSetQuery();
+
+  /// Compute the type of all potential receivers of this function set.
+  TypeMask computeMask(ClassWorld classWorld);
+
+  /// Returns all potential targets of this function set.
+  Iterable<Element> get functions;
+}
+
+class EmptyFunctionSetQuery implements FunctionSetQuery {
+  const EmptyFunctionSetQuery();
+
+  @override
   TypeMask computeMask(ClassWorld classWorld) => const TypeMask.nonNullEmpty();
-  const FunctionSetQuery(this.functions);
+
+  @override
+  Iterable<Element> get functions => const <Element>[];
 }
 
-class FullFunctionSetQuery extends FunctionSetQuery {
+class FullFunctionSetQuery implements FunctionSetQuery {
+  @override
+  final Iterable<Element> functions;
+
   TypeMask _mask;
 
-  /**
-   * Compute the type of all potential receivers of this function set.
-   */
+  FullFunctionSetQuery(this.functions);
+
+  @override
   TypeMask computeMask(ClassWorld classWorld) {
     assert(classWorld.hasAnyStrictSubclass(classWorld.objectClass));
     if (_mask != null) return _mask;
@@ -259,6 +304,4 @@
         }),
         classWorld);
   }
-
-  FullFunctionSetQuery(functions) : super(functions);
 }
diff --git a/pkg/compiler/lib/src/universe/selector.dart b/pkg/compiler/lib/src/universe/selector.dart
new file mode 100644
index 0000000..f8a44e6
--- /dev/null
+++ b/pkg/compiler/lib/src/universe/selector.dart
@@ -0,0 +1,282 @@
+// 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 dart2js.selector;
+
+import '../common.dart';
+import '../common/names.dart' show
+    Names;
+import '../elements/elements.dart' show
+    Element,
+    Elements,
+    FunctionElement,
+    FunctionSignature,
+    Name,
+    LibraryElement,
+    PublicName;
+import '../util/util.dart' show
+    Hashing;
+import '../world.dart' show
+    World;
+
+import 'call_structure.dart' show
+    CallStructure;
+
+class SelectorKind {
+  final String name;
+  final int hashCode;
+  const SelectorKind(this.name, this.hashCode);
+
+  static const SelectorKind GETTER = const SelectorKind('getter', 0);
+  static const SelectorKind SETTER = const SelectorKind('setter', 1);
+  static const SelectorKind CALL = const SelectorKind('call', 2);
+  static const SelectorKind OPERATOR = const SelectorKind('operator', 3);
+  static const SelectorKind INDEX = const SelectorKind('index', 4);
+
+  String toString() => name;
+}
+
+class Selector {
+  final SelectorKind kind;
+  final Name memberName;
+  final CallStructure callStructure;
+
+  final int hashCode;
+
+  int get argumentCount => callStructure.argumentCount;
+  int get namedArgumentCount => callStructure.namedArgumentCount;
+  int get positionalArgumentCount => callStructure.positionalArgumentCount;
+  List<String> get namedArguments => callStructure.namedArguments;
+
+  String get name => memberName.text;
+
+  LibraryElement get library => memberName.library;
+
+  Selector.internal(this.kind,
+                    this.memberName,
+                    this.callStructure,
+                    this.hashCode) {
+    assert(kind == SelectorKind.INDEX ||
+           (memberName != Names.INDEX_NAME &&
+            memberName != Names.INDEX_SET_NAME));
+    assert(kind == SelectorKind.OPERATOR ||
+           kind == SelectorKind.INDEX ||
+           !Elements.isOperatorName(memberName.text) ||
+           identical(memberName.text, '??'));
+    assert(kind == SelectorKind.CALL ||
+           kind == SelectorKind.GETTER ||
+           kind == SelectorKind.SETTER ||
+           Elements.isOperatorName(memberName.text) ||
+           identical(memberName.text, '??'));
+  }
+
+  // TODO(johnniwinther): Extract caching.
+  static Map<int, List<Selector>> canonicalizedValues =
+      new Map<int, List<Selector>>();
+
+  factory Selector(SelectorKind kind,
+                   Name name,
+                   CallStructure callStructure) {
+    // TODO(johnniwinther): Maybe use equality instead of implicit hashing.
+    int hashCode = computeHashCode(kind, name, callStructure);
+    List<Selector> list = canonicalizedValues.putIfAbsent(hashCode,
+        () => <Selector>[]);
+    for (int i = 0; i < list.length; i++) {
+      Selector existing = list[i];
+      if (existing.match(kind, name, callStructure)) {
+        assert(existing.hashCode == hashCode);
+        return existing;
+      }
+    }
+    Selector result = new Selector.internal(
+        kind, name, callStructure, hashCode);
+    list.add(result);
+    return result;
+  }
+
+  factory Selector.fromElement(Element element) {
+    Name name = new Name(element.name, element.library);
+    if (element.isFunction) {
+      if (name == Names.INDEX_NAME) {
+        return new Selector.index();
+      } else if (name == Names.INDEX_SET_NAME) {
+        return new Selector.indexSet();
+      }
+      FunctionSignature signature =
+          element.asFunctionElement().functionSignature;
+      int arity = signature.parameterCount;
+      List<String> namedArguments = null;
+      if (signature.optionalParametersAreNamed) {
+        namedArguments =
+            signature.orderedOptionalParameters.map((e) => e.name).toList();
+      }
+      if (element.isOperator) {
+        // Operators cannot have named arguments, however, that doesn't prevent
+        // a user from declaring such an operator.
+        return new Selector(
+            SelectorKind.OPERATOR,
+            name,
+            new CallStructure(arity, namedArguments));
+      } else {
+        return new Selector.call(
+            name, new CallStructure(arity, namedArguments));
+      }
+    } else if (element.isSetter) {
+      return new Selector.setter(name);
+    } else if (element.isGetter) {
+      return new Selector.getter(name);
+    } else if (element.isField) {
+      return new Selector.getter(name);
+    } else if (element.isConstructor) {
+      return new Selector.callConstructor(name);
+    } else {
+      throw new SpannableAssertionFailure(
+          element, "Can't get selector from $element");
+    }
+  }
+
+  factory Selector.getter(Name name)
+      => new Selector(SelectorKind.GETTER,
+                      name.getter,
+                      CallStructure.NO_ARGS);
+
+  factory Selector.setter(Name name)
+      => new Selector(SelectorKind.SETTER,
+                      name.setter,
+                      CallStructure.ONE_ARG);
+
+  factory Selector.unaryOperator(String name) => new Selector(
+      SelectorKind.OPERATOR,
+      new PublicName(Elements.constructOperatorName(name, true)),
+      CallStructure.NO_ARGS);
+
+  factory Selector.binaryOperator(String name) => new Selector(
+      SelectorKind.OPERATOR,
+      new PublicName(Elements.constructOperatorName(name, false)),
+      CallStructure.ONE_ARG);
+
+  factory Selector.index()
+      => new Selector(SelectorKind.INDEX, Names.INDEX_NAME,
+                      CallStructure.ONE_ARG);
+
+  factory Selector.indexSet()
+      => new Selector(SelectorKind.INDEX, Names.INDEX_SET_NAME,
+                      CallStructure.TWO_ARGS);
+
+  factory Selector.call(Name name, CallStructure callStructure)
+      => new Selector(SelectorKind.CALL, name, callStructure);
+
+  factory Selector.callClosure(int arity, [List<String> namedArguments])
+      => new Selector(SelectorKind.CALL, Names.call,
+                      new CallStructure(arity, namedArguments));
+
+  factory Selector.callClosureFrom(Selector selector)
+      => new Selector(SelectorKind.CALL, Names.call, selector.callStructure);
+
+  factory Selector.callConstructor(Name name,
+                                   [int arity = 0,
+                                    List<String> namedArguments])
+      => new Selector(SelectorKind.CALL, name,
+                      new CallStructure(arity, namedArguments));
+
+  factory Selector.callDefaultConstructor()
+      => new Selector(
+          SelectorKind.CALL,
+          const PublicName(''),
+          CallStructure.NO_ARGS);
+
+  bool get isGetter => kind == SelectorKind.GETTER;
+  bool get isSetter => kind == SelectorKind.SETTER;
+  bool get isCall => kind == SelectorKind.CALL;
+  bool get isClosureCall => isCall && memberName == Names.CALL_NAME;
+
+  bool get isIndex => kind == SelectorKind.INDEX && argumentCount == 1;
+  bool get isIndexSet => kind == SelectorKind.INDEX && argumentCount == 2;
+
+  bool get isOperator => kind == SelectorKind.OPERATOR;
+  bool get isUnaryOperator => isOperator && argumentCount == 0;
+
+  /**
+   * The member name for invocation mirrors created from this selector.
+   */
+  String get invocationMirrorMemberName =>
+      isSetter ? '$name=' : name;
+
+  int get invocationMirrorKind {
+    const int METHOD = 0;
+    const int GETTER = 1;
+    const int SETTER = 2;
+    int kind = METHOD;
+    if (isGetter) {
+      kind = GETTER;
+    } else if (isSetter) {
+      kind = SETTER;
+    }
+    return kind;
+  }
+
+  bool appliesUnnamed(Element element, World world) {
+    assert(sameNameHack(element, world));
+    return appliesUntyped(element, world);
+  }
+
+  bool appliesUntyped(Element element, World world) {
+    assert(sameNameHack(element, world));
+    if (Elements.isUnresolved(element)) return false;
+    if (memberName.isPrivate && memberName.library != element.library) {
+      // TODO(johnniwinther): Maybe this should be
+      // `memberName != element.memberName`.
+      return false;
+    }
+    if (world.isForeign(element)) return true;
+    if (element.isSetter) return isSetter;
+    if (element.isGetter) return isGetter || isCall;
+    if (element.isField) {
+      return isSetter
+          ? !element.isFinal && !element.isConst
+          : isGetter || isCall;
+    }
+    if (isGetter) return true;
+    if (isSetter) return false;
+    return signatureApplies(element);
+  }
+
+  bool signatureApplies(FunctionElement function) {
+    if (Elements.isUnresolved(function)) return false;
+    return callStructure.signatureApplies(function.functionSignature);
+  }
+
+  bool sameNameHack(Element element, World world) {
+    // TODO(ngeoffray): Remove workaround checks.
+    return element.isConstructor || name == element.name;
+  }
+
+  bool applies(Element element, World world) {
+    if (!sameNameHack(element, world)) return false;
+    return appliesUnnamed(element, world);
+  }
+
+  bool match(SelectorKind kind,
+             Name memberName,
+             CallStructure callStructure) {
+    return this.kind == kind
+        && this.memberName == memberName
+        && this.callStructure.match(callStructure);
+  }
+
+  static int computeHashCode(SelectorKind kind,
+                             Name name,
+                             CallStructure callStructure) {
+    // Add bits from name and kind.
+    int hash = Hashing.mixHashCodeBits(name.hashCode, kind.hashCode);
+    // Add bits from the call structure.
+    return Hashing.mixHashCodeBits(hash, callStructure.hashCode);
+  }
+
+  String toString() {
+    return 'Selector($kind, $name, ${callStructure.structureToString()})';
+  }
+
+  Selector toCallSelector() => new Selector.callClosureFrom(this);
+}
diff --git a/pkg/compiler/lib/src/universe/side_effects.dart b/pkg/compiler/lib/src/universe/side_effects.dart
index 66b4aa7..f7625e4 100644
--- a/pkg/compiler/lib/src/universe/side_effects.dart
+++ b/pkg/compiler/lib/src/universe/side_effects.dart
@@ -2,7 +2,9 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-part of universe;
+library universe.side_effects;
+
+import '../common.dart';
 
 class SideEffects {
   // Changes flags.
diff --git a/pkg/compiler/lib/src/universe/universe.dart b/pkg/compiler/lib/src/universe/universe.dart
index aa90f73..78e586f 100644
--- a/pkg/compiler/lib/src/universe/universe.dart
+++ b/pkg/compiler/lib/src/universe/universe.dart
@@ -6,19 +6,22 @@
 
 import 'dart:collection';
 
+import '../common.dart';
+import '../compiler.dart' show
+    Compiler;
 import '../elements/elements.dart';
-import '../dart2jslib.dart';
 import '../dart_types.dart';
-import '../types/types.dart';
-import '../tree/tree.dart';
 import '../util/util.dart';
+import '../world.dart' show
+    ClassWorld,
+    World;
 
-part 'function_set.dart';
-part 'side_effects.dart';
+import 'selector.dart' show
+    Selector;
 
 class UniverseSelector {
   final Selector selector;
-  final TypeMask mask;
+  final ReceiverConstraint mask;
 
   UniverseSelector(this.selector, this.mask);
 
@@ -27,60 +30,99 @@
         (mask == null || mask.canHit(element, selector, world));
   }
 
+  int get hashCode => selector.hashCode * 13 + mask.hashCode * 17;
+
+  bool operator ==(other) {
+    if (identical(this, other)) return true;
+    if (other is! UniverseSelector) return false;
+    return selector == other.selector && mask == other.mask;
+  }
+
   String toString() => '$selector,$mask';
 }
 
-abstract class TypeMaskSet {
+/// 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, ClassWorld classWorld);
+}
+
+/// 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 constaints 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, ClassWorld world);
-  Iterable<TypeMask> get masks;
+
+  /// 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, ClassWorld world);
 }
 
-/// An implementation of a [TypeMaskSet] that is only increasing, that is, once
-/// a mask is added it cannot be removed.
-class IncreasingTypeMaskSet extends TypeMaskSet {
-  bool isAll = false;
-  Set<TypeMask> _masks;
-
-  bool applies(Element element, Selector selector, ClassWorld world) {
-    if (isAll) return true;
-    if (_masks == null) return false;
-    for (TypeMask mask in _masks) {
-      if (mask.canHit(element, selector, world)) return true;
-    }
-    return false;
-  }
-
-  bool add(TypeMask mask) {
-    if (isAll) return false;
-    if (mask == null) {
-      isAll = true;
-      _masks = null;
-      return true;
-    }
-    if (_masks == null) {
-      _masks = new Setlet<TypeMask>();
-    }
-    return _masks.add(mask);
-  }
-
-  Iterable<TypeMask> get masks {
-    if (isAll) return const [null];
-    if (_masks == null) return const [];
-    return _masks;
-  }
-
-  String toString() {
-    if (isAll) {
-      return '<all>';
-    } else if (_masks != null) {
-      return '$_masks';
-    } else {
-      return '<none>';
-    }
-  }
+/// 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);
+}
 
 class Universe {
   /// The set of all directly instantiated classes, that is, classes with a
@@ -105,6 +147,9 @@
   /// Invariant: Elements are declaration elements.
   final Set<ClassElement> _allInstantiatedClasses = new Set<ClassElement>();
 
+  /// 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.
@@ -119,12 +164,12 @@
       new Set<FunctionElement>();
   final Set<FunctionElement> methodsNeedingSuperGetter =
       new Set<FunctionElement>();
-  final Map<String, Map<Selector, TypeMaskSet>> _invokedNames =
-      <String, Map<Selector, TypeMaskSet>>{};
-  final Map<String, Map<Selector, TypeMaskSet>> _invokedGetters =
-      <String, Map<Selector, TypeMaskSet>>{};
-  final Map<String, Map<Selector, TypeMaskSet>> _invokedSetters =
-      <String, Map<Selector, TypeMaskSet>>{};
+  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 accessed. Currently only the codegen knows this
@@ -166,6 +211,10 @@
    */
   final Set<Element> closurizedMembers = new Set<Element>();
 
+  final SelectorConstraintsStrategy selectorConstraintsStrategy;
+
+  Universe(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.
@@ -189,12 +238,19 @@
   Iterable<DartType> get instantiatedTypes => _instantiatedTypes;
 
   /// Returns `true` if [cls] is considered to be instantiated, either directly,
-  /// through subclasses or through subtypes. The latter case only contains
-  /// spurious information from instatiations through factory constructors and
-  /// mixins.
+  /// through subclasses.
   // TODO(johnniwinther): Improve semantic precision.
   bool isInstantiated(ClassElement cls) {
-    return _allInstantiatedClasses.contains(cls);
+    return _allInstantiatedClasses.contains(cls.declaration);
+  }
+
+  /// 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.
@@ -204,7 +260,8 @@
   // subclass and through subtype instantiated types/classes.
   // TODO(johnniwinther): Support unknown type arguments for generic types.
   void registerTypeInstantiation(InterfaceType type,
-                                 {bool byMirrors: false}) {
+                                 {bool byMirrors: false,
+                                  void onImplemented(ClassElement cls)}) {
     _instantiatedTypes.add(type);
     ClassElement cls = type.element;
     if (!cls.isAbstract
@@ -220,20 +277,31 @@
       _directlyInstantiatedClasses.add(cls);
     }
 
-    // TODO(johnniwinther): Replace this by separate more specific mappings.
-    if (!_allInstantiatedClasses.add(cls)) return;
-    cls.allSupertypes.forEach((InterfaceType supertype) {
-      _allInstantiatedClasses.add(supertype.element);
-    });
+    // 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);
+        }
+      });
+    }
+    while (cls != null) {
+      if (!_allInstantiatedClasses.add(cls)) {
+        return;
+      }
+      cls = cls.superclass;
+    }
   }
 
-  bool _hasMatchingSelector(Map<Selector, TypeMaskSet> selectors,
+  bool _hasMatchingSelector(Map<Selector, SelectorConstraints> selectors,
                             Element member,
                             World world) {
     if (selectors == null) return false;
     for (Selector selector in selectors.keys) {
       if (selector.appliesUnnamed(member, world)) {
-        TypeMaskSet masks = selectors[selector];
+        SelectorConstraints masks = selectors[selector];
         if (masks.applies(member, selector, world)) {
           return true;
         }
@@ -268,51 +336,53 @@
 
   bool _registerNewSelector(
       UniverseSelector universeSelector,
-      Map<String, Map<Selector, TypeMaskSet>> selectorMap) {
+      Map<String, Map<Selector, SelectorConstraints>> selectorMap) {
     Selector selector = universeSelector.selector;
     String name = selector.name;
-    TypeMask mask = universeSelector.mask;
-    Map<Selector, TypeMaskSet> selectors = selectorMap.putIfAbsent(
-        name, () => new Maplet<Selector, TypeMaskSet>());
-    IncreasingTypeMaskSet masks = selectors.putIfAbsent(
-        selector, () => new IncreasingTypeMaskSet());
-    return masks.add(mask);
+    ReceiverConstraint mask = universeSelector.mask;
+    Map<Selector, SelectorConstraints> selectors = selectorMap.putIfAbsent(
+        name, () => new Maplet<Selector, SelectorConstraints>());
+    UniverseSelectorConstraints constraints = selectors.putIfAbsent(
+        selector, () => selectorConstraintsStrategy.createSelectorConstraints(selector));
+    return constraints.addReceiverConstraint(mask);
   }
 
-  Map<Selector, TypeMaskSet> _asUnmodifiable(Map<Selector, TypeMaskSet> map) {
+  Map<Selector, SelectorConstraints> _asUnmodifiable(
+      Map<Selector, SelectorConstraints> map) {
     if (map == null) return null;
     return new UnmodifiableMapView(map);
   }
 
-  Map<Selector, TypeMaskSet> invocationsByName(String name) {
+  Map<Selector, SelectorConstraints> invocationsByName(String name) {
     return _asUnmodifiable(_invokedNames[name]);
   }
 
-  Map<Selector, TypeMaskSet> getterInvocationsByName(String name) {
+  Map<Selector, SelectorConstraints> getterInvocationsByName(String name) {
     return _asUnmodifiable(_invokedGetters[name]);
   }
 
-  Map<Selector, TypeMaskSet> setterInvocationsByName(String name) {
+  Map<Selector, SelectorConstraints> setterInvocationsByName(String name) {
     return _asUnmodifiable(_invokedSetters[name]);
   }
 
   void forEachInvokedName(
-      f(String name, Map<Selector, TypeMaskSet> selectors)) {
+      f(String name, Map<Selector, SelectorConstraints> selectors)) {
     _invokedNames.forEach(f);
   }
 
   void forEachInvokedGetter(
-      f(String name, Map<Selector, TypeMaskSet> selectors)) {
+      f(String name, Map<Selector, SelectorConstraints> selectors)) {
     _invokedGetters.forEach(f);
   }
 
   void forEachInvokedSetter(
-      f(String name, Map<Selector, TypeMaskSet> selectors)) {
+      f(String name, Map<Selector, SelectorConstraints> selectors)) {
     _invokedSetters.forEach(f);
   }
 
   DartType registerIsCheck(DartType type, Compiler compiler) {
-    type = type.unalias(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.
@@ -355,556 +425,3 @@
         }));
   }
 }
-
-class SelectorKind {
-  final String name;
-  final int hashCode;
-  const SelectorKind(this.name, this.hashCode);
-
-  static const SelectorKind GETTER = const SelectorKind('getter', 0);
-  static const SelectorKind SETTER = const SelectorKind('setter', 1);
-  static const SelectorKind CALL = const SelectorKind('call', 2);
-  static const SelectorKind OPERATOR = const SelectorKind('operator', 3);
-  static const SelectorKind INDEX = const SelectorKind('index', 4);
-
-  String toString() => name;
-}
-
-/// The structure of the arguments at a call-site.
-// TODO(johnniwinther): Should these be cached?
-// TODO(johnniwinther): Should isGetter/isSetter be part of the call structure
-// instead of the selector?
-class CallStructure {
-  static const CallStructure NO_ARGS = const CallStructure.unnamed(0);
-  static const CallStructure ONE_ARG = const CallStructure.unnamed(1);
-  static const CallStructure TWO_ARGS = const CallStructure.unnamed(2);
-
-  /// The numbers of arguments of the call. Includes named arguments.
-  final int argumentCount;
-
-  /// The number of named arguments of the call.
-  int get namedArgumentCount => 0;
-
-  /// The number of positional argument of the call.
-  int get positionalArgumentCount => argumentCount;
-
-  const CallStructure.unnamed(this.argumentCount);
-
-  factory CallStructure(int argumentCount, [List<String> namedArguments]) {
-    if (namedArguments == null || namedArguments.isEmpty) {
-      return new CallStructure.unnamed(argumentCount);
-    }
-    return new NamedCallStructure(argumentCount, namedArguments);
-  }
-
-  /// `true` if this call has named arguments.
-  bool get isNamed => false;
-
-  /// `true` if this call has no named arguments.
-  bool get isUnnamed => true;
-
-  /// The names of the named arguments in call-site order.
-  List<String> get namedArguments => const <String>[];
-
-  /// The names of the named arguments in canonicalized order.
-  List<String> getOrderedNamedArguments() => const <String>[];
-
-  /// A description of the argument structure.
-  String structureToString() => 'arity=$argumentCount';
-
-  String toString() => 'CallStructure(${structureToString()})';
-
-  Selector get callSelector {
-    return new Selector(SelectorKind.CALL, Selector.CALL_NAME, this);
-  }
-
-  bool match(CallStructure other) {
-    if (identical(this, other)) return true;
-    return this.argumentCount == other.argumentCount
-        && this.namedArgumentCount == other.namedArgumentCount
-        && sameNames(this.namedArguments, other.namedArguments);
-  }
-
-  // TODO(johnniwinther): Cache hash code?
-  int get hashCode {
-    return Hashing.listHash(namedArguments,
-        Hashing.objectHash(argumentCount, namedArguments.length));
-  }
-
-  bool operator ==(other) {
-    if (other is! CallStructure) return false;
-    return match(other);
-  }
-
-  bool signatureApplies(FunctionSignature parameters) {
-    if (argumentCount > parameters.parameterCount) return false;
-    int requiredParameterCount = parameters.requiredParameterCount;
-    int optionalParameterCount = parameters.optionalParameterCount;
-    if (positionalArgumentCount < requiredParameterCount) return false;
-
-    if (!parameters.optionalParametersAreNamed) {
-      // We have already checked that the number of arguments are
-      // not greater than the number of parameters. Therefore the
-      // number of positional arguments are not greater than the
-      // number of parameters.
-      assert(positionalArgumentCount <= parameters.parameterCount);
-      return namedArguments.isEmpty;
-    } else {
-      if (positionalArgumentCount > requiredParameterCount) return false;
-      assert(positionalArgumentCount == requiredParameterCount);
-      if (namedArgumentCount > optionalParameterCount) return false;
-      Set<String> nameSet = new Set<String>();
-      parameters.optionalParameters.forEach((Element element) {
-        nameSet.add(element.name);
-      });
-      for (String name in namedArguments) {
-        if (!nameSet.contains(name)) return false;
-        // TODO(5213): By removing from the set we are checking
-        // that we are not passing the name twice. We should have this
-        // check in the resolver also.
-        nameSet.remove(name);
-      }
-      return true;
-    }
-  }
-
-  /**
-   * Returns a `List` with the evaluated arguments in the normalized order.
-   *
-   * [compileDefaultValue] is a function that returns a compiled constant
-   * of an optional argument that is not in [compiledArguments].
-   *
-   * Precondition: `this.applies(element, world)`.
-   *
-   * Invariant: [element] must be the implementation element.
-   */
-  /*<T>*/ List/*<T>*/ makeArgumentsList(
-      Link<Node> arguments,
-      FunctionElement element,
-      /*T*/ compileArgument(Node argument),
-      /*T*/ compileDefaultValue(ParameterElement element)) {
-    assert(invariant(element, element.isImplementation));
-    List/*<T>*/ result = new List();
-
-    FunctionSignature parameters = element.functionSignature;
-    parameters.forEachRequiredParameter((ParameterElement element) {
-      result.add(compileArgument(arguments.head));
-      arguments = arguments.tail;
-    });
-
-    if (!parameters.optionalParametersAreNamed) {
-      parameters.forEachOptionalParameter((ParameterElement element) {
-        if (!arguments.isEmpty) {
-          result.add(compileArgument(arguments.head));
-          arguments = arguments.tail;
-        } else {
-          result.add(compileDefaultValue(element));
-        }
-      });
-    } else {
-      // Visit named arguments and add them into a temporary list.
-      List compiledNamedArguments = [];
-      for (; !arguments.isEmpty; arguments = arguments.tail) {
-        NamedArgument namedArgument = arguments.head;
-        compiledNamedArguments.add(compileArgument(namedArgument.expression));
-      }
-      // Iterate over the optional parameters of the signature, and try to
-      // find them in [compiledNamedArguments]. If found, we use the
-      // value in the temporary list, otherwise the default value.
-      parameters.orderedOptionalParameters.forEach((ParameterElement element) {
-        int foundIndex = namedArguments.indexOf(element.name);
-        if (foundIndex != -1) {
-          result.add(compiledNamedArguments[foundIndex]);
-        } else {
-          result.add(compileDefaultValue(element));
-        }
-      });
-    }
-    return result;
-  }
-
-  /**
-   * Fills [list] with the arguments in the order expected by
-   * [callee], and where [caller] is a synthesized element
-   *
-   * [compileArgument] is a function that returns a compiled version
-   * of a parameter of [callee].
-   *
-   * [compileConstant] is a function that returns a compiled constant
-   * of an optional argument that is not in the parameters of [callee].
-   *
-   * Returns [:true:] if the signature of the [caller] matches the
-   * signature of the [callee], [:false:] otherwise.
-   */
-  static /*<T>*/ bool addForwardingElementArgumentsToList(
-      ConstructorElement caller,
-      List/*<T>*/ list,
-      ConstructorElement callee,
-      /*T*/ compileArgument(ParameterElement element),
-      /*T*/ compileConstant(ParameterElement element)) {
-    assert(invariant(caller, !callee.isErroneous,
-        message: "Cannot compute arguments to erroneous constructor: "
-                 "$caller calling $callee."));
-
-    FunctionSignature signature = caller.functionSignature;
-    Map<Node, ParameterElement> mapping = <Node, ParameterElement>{};
-
-    // TODO(ngeoffray): This is a hack that fakes up AST nodes, so
-    // that we can call [addArgumentsToList].
-    Link<Node> computeCallNodesFromParameters() {
-      LinkBuilder<Node> builder = new LinkBuilder<Node>();
-      signature.forEachRequiredParameter((ParameterElement element) {
-        Node node = element.node;
-        mapping[node] = element;
-        builder.addLast(node);
-      });
-      if (signature.optionalParametersAreNamed) {
-        signature.forEachOptionalParameter((ParameterElement element) {
-          mapping[element.initializer] = element;
-          builder.addLast(new NamedArgument(null, null, element.initializer));
-        });
-      } else {
-        signature.forEachOptionalParameter((ParameterElement element) {
-          Node node = element.node;
-          mapping[node] = element;
-          builder.addLast(node);
-        });
-      }
-      return builder.toLink();
-    }
-
-    /*T*/ internalCompileArgument(Node node) {
-      return compileArgument(mapping[node]);
-    }
-
-    Link<Node> nodes = computeCallNodesFromParameters();
-
-    // Synthesize a structure for the call.
-    // TODO(ngeoffray): Should the resolver do it instead?
-    List<String> namedParameters;
-    if (signature.optionalParametersAreNamed) {
-      namedParameters =
-          signature.optionalParameters.map((e) => e.name).toList();
-    }
-    CallStructure callStructure =
-        new CallStructure(signature.parameterCount, namedParameters);
-    if (!callStructure.signatureApplies(signature)) {
-      return false;
-    }
-    list.addAll(callStructure.makeArgumentsList(
-        nodes,
-        callee,
-        internalCompileArgument,
-        compileConstant));
-
-    return true;
-  }
-
-  static bool sameNames(List<String> first, List<String> second) {
-    for (int i = 0; i < first.length; i++) {
-      if (first[i] != second[i]) return false;
-    }
-    return true;
-  }
-}
-
-///
-class NamedCallStructure extends CallStructure {
-  final List<String> namedArguments;
-  final List<String> _orderedNamedArguments = <String>[];
-
-  NamedCallStructure(int argumentCount, this.namedArguments)
-      : super.unnamed(argumentCount) {
-    assert(namedArguments.isNotEmpty);
-  }
-
-  @override
-  bool get isNamed => true;
-
-  @override
-  bool get isUnnamed => false;
-
-  @override
-  int get namedArgumentCount => namedArguments.length;
-
-  @override
-  int get positionalArgumentCount => argumentCount - namedArgumentCount;
-
-  @override
-  List<String> getOrderedNamedArguments() {
-    if (!_orderedNamedArguments.isEmpty) return _orderedNamedArguments;
-
-    _orderedNamedArguments.addAll(namedArguments);
-    _orderedNamedArguments.sort((String first, String second) {
-      return first.compareTo(second);
-    });
-    return _orderedNamedArguments;
-  }
-
-  @override
-  String structureToString() {
-    return 'arity=$argumentCount, named=[${namedArguments.join(', ')}]';
-  }
-}
-
-class Selector {
-  final SelectorKind kind;
-  final Name memberName;
-  final CallStructure callStructure;
-
-  final int hashCode;
-
-  int get argumentCount => callStructure.argumentCount;
-  int get namedArgumentCount => callStructure.namedArgumentCount;
-  int get positionalArgumentCount => callStructure.positionalArgumentCount;
-  List<String> get namedArguments => callStructure.namedArguments;
-
-  String get name => memberName.text;
-
-  LibraryElement get library => memberName.library;
-
-  static const Name INDEX_NAME = const PublicName("[]");
-  static const Name INDEX_SET_NAME = const PublicName("[]=");
-  static const Name CALL_NAME = const PublicName(Compiler.CALL_OPERATOR_NAME);
-
-  Selector.internal(this.kind,
-                    this.memberName,
-                    this.callStructure,
-                    this.hashCode) {
-    assert(kind == SelectorKind.INDEX ||
-           (memberName != INDEX_NAME && memberName != INDEX_SET_NAME));
-    assert(kind == SelectorKind.OPERATOR ||
-           kind == SelectorKind.INDEX ||
-           !Elements.isOperatorName(memberName.text) ||
-           identical(memberName.text, '??'));
-    assert(kind == SelectorKind.CALL ||
-           kind == SelectorKind.GETTER ||
-           kind == SelectorKind.SETTER ||
-           Elements.isOperatorName(memberName.text) ||
-           identical(memberName.text, '??'));
-  }
-
-  // TODO(johnniwinther): Extract caching.
-  static Map<int, List<Selector>> canonicalizedValues =
-      new Map<int, List<Selector>>();
-
-  factory Selector(SelectorKind kind,
-                   Name name,
-                   CallStructure callStructure) {
-    // TODO(johnniwinther): Maybe use equality instead of implicit hashing.
-    int hashCode = computeHashCode(kind, name, callStructure);
-    List<Selector> list = canonicalizedValues.putIfAbsent(hashCode,
-        () => <Selector>[]);
-    for (int i = 0; i < list.length; i++) {
-      Selector existing = list[i];
-      if (existing.match(kind, name, callStructure)) {
-        assert(existing.hashCode == hashCode);
-        return existing;
-      }
-    }
-    Selector result = new Selector.internal(
-        kind, name, callStructure, hashCode);
-    list.add(result);
-    return result;
-  }
-
-  factory Selector.fromElement(Element element) {
-    String name = element.name;
-    if (element.isFunction) {
-      if (name == '[]') {
-        return new Selector.index();
-      } else if (name == '[]=') {
-        return new Selector.indexSet();
-      }
-      FunctionSignature signature =
-          element.asFunctionElement().functionSignature;
-      int arity = signature.parameterCount;
-      List<String> namedArguments = null;
-      if (signature.optionalParametersAreNamed) {
-        namedArguments =
-            signature.orderedOptionalParameters.map((e) => e.name).toList();
-      }
-      if (element.isOperator) {
-        // Operators cannot have named arguments, however, that doesn't prevent
-        // a user from declaring such an operator.
-        return new Selector(
-            SelectorKind.OPERATOR,
-            new PublicName(name),
-            new CallStructure(arity, namedArguments));
-      } else {
-        return new Selector.call(
-            name, element.library, arity, namedArguments);
-      }
-    } else if (element.isSetter) {
-      return new Selector.setter(name, element.library);
-    } else if (element.isGetter) {
-      return new Selector.getter(name, element.library);
-    } else if (element.isField) {
-      return new Selector.getter(name, element.library);
-    } else if (element.isConstructor) {
-      return new Selector.callConstructor(name, element.library);
-    } else {
-      throw new SpannableAssertionFailure(
-          element, "Can't get selector from $element");
-    }
-  }
-
-  factory Selector.getter(String name, LibraryElement library)
-      => new Selector(SelectorKind.GETTER,
-                      new Name(name, library),
-                      CallStructure.NO_ARGS);
-
-  factory Selector.getterFrom(Selector selector)
-      => new Selector(SelectorKind.GETTER,
-                      selector.memberName.getter,
-                      CallStructure.NO_ARGS);
-
-  factory Selector.setter(String name, LibraryElement library)
-      => new Selector(SelectorKind.SETTER,
-                      new Name(name, library, isSetter: true),
-                      CallStructure.ONE_ARG);
-
-  factory Selector.unaryOperator(String name) => new Selector(
-      SelectorKind.OPERATOR,
-      new PublicName(Elements.constructOperatorName(name, true)),
-      CallStructure.NO_ARGS);
-
-  factory Selector.binaryOperator(String name) => new Selector(
-      SelectorKind.OPERATOR,
-      new PublicName(Elements.constructOperatorName(name, false)),
-      CallStructure.ONE_ARG);
-
-  factory Selector.index()
-      => new Selector(SelectorKind.INDEX, INDEX_NAME,
-                      CallStructure.ONE_ARG);
-
-  factory Selector.indexSet()
-      => new Selector(SelectorKind.INDEX, INDEX_SET_NAME,
-                      CallStructure.TWO_ARGS);
-
-  factory Selector.call(String name,
-                        LibraryElement library,
-                        int arity,
-                        [List<String> namedArguments])
-      => new Selector(SelectorKind.CALL,
-          new Name(name, library),
-          new CallStructure(arity, namedArguments));
-
-  factory Selector.callClosure(int arity, [List<String> namedArguments])
-      => new Selector(SelectorKind.CALL, CALL_NAME,
-                      new CallStructure(arity, namedArguments));
-
-  factory Selector.callClosureFrom(Selector selector)
-      => new Selector(SelectorKind.CALL, CALL_NAME, selector.callStructure);
-
-  factory Selector.callConstructor(String name, LibraryElement library,
-                                   [int arity = 0,
-                                    List<String> namedArguments])
-      => new Selector(SelectorKind.CALL, new Name(name, library),
-                      new CallStructure(arity, namedArguments));
-
-  factory Selector.callDefaultConstructor()
-      => new Selector(
-          SelectorKind.CALL,
-          const PublicName(''),
-          CallStructure.NO_ARGS);
-
-  bool get isGetter => kind == SelectorKind.GETTER;
-  bool get isSetter => kind == SelectorKind.SETTER;
-  bool get isCall => kind == SelectorKind.CALL;
-  bool get isClosureCall => isCall && memberName == CALL_NAME;
-
-  bool get isIndex => kind == SelectorKind.INDEX && argumentCount == 1;
-  bool get isIndexSet => kind == SelectorKind.INDEX && argumentCount == 2;
-
-  bool get isOperator => kind == SelectorKind.OPERATOR;
-  bool get isUnaryOperator => isOperator && argumentCount == 0;
-
-  /** Check whether this is a call to 'assert'. */
-  bool get isAssert => isCall && identical(name, "assert");
-
-  /**
-   * The member name for invocation mirrors created from this selector.
-   */
-  String get invocationMirrorMemberName =>
-      isSetter ? '$name=' : name;
-
-  int get invocationMirrorKind {
-    const int METHOD = 0;
-    const int GETTER = 1;
-    const int SETTER = 2;
-    int kind = METHOD;
-    if (isGetter) {
-      kind = GETTER;
-    } else if (isSetter) {
-      kind = SETTER;
-    }
-    return kind;
-  }
-
-  bool appliesUnnamed(Element element, World world) {
-    assert(sameNameHack(element, world));
-    return appliesUntyped(element, world);
-  }
-
-  bool appliesUntyped(Element element, World world) {
-    assert(sameNameHack(element, world));
-    if (Elements.isUnresolved(element)) return false;
-    if (memberName.isPrivate && memberName.library != element.library) {
-      // TODO(johnniwinther): Maybe this should be
-      // `memberName != element.memberName`.
-      return false;
-    }
-    if (world.isForeign(element)) return true;
-    if (element.isSetter) return isSetter;
-    if (element.isGetter) return isGetter || isCall;
-    if (element.isField) {
-      return isSetter
-          ? !element.isFinal && !element.isConst
-          : isGetter || isCall;
-    }
-    if (isGetter) return true;
-    if (isSetter) return false;
-    return signatureApplies(element);
-  }
-
-  bool signatureApplies(FunctionElement function) {
-    if (Elements.isUnresolved(function)) return false;
-    return callStructure.signatureApplies(function.functionSignature);
-  }
-
-  bool sameNameHack(Element element, World world) {
-    // TODO(ngeoffray): Remove workaround checks.
-    return element.isConstructor ||
-           name == element.name ||
-           name == 'assert' && world.isAssertMethod(element);
-  }
-
-  bool applies(Element element, World world) {
-    if (!sameNameHack(element, world)) return false;
-    return appliesUnnamed(element, world);
-  }
-
-  bool match(SelectorKind kind,
-             Name memberName,
-             CallStructure callStructure) {
-    return this.kind == kind
-        && this.memberName == memberName
-        && this.callStructure.match(callStructure);
-  }
-
-  static int computeHashCode(SelectorKind kind,
-                             Name name,
-                             CallStructure callStructure) {
-    // Add bits from name and kind.
-    int hash = Hashing.mixHashCodeBits(name.hashCode, kind.hashCode);
-    // Add bits from the call structure.
-    return Hashing.mixHashCodeBits(hash, callStructure.hashCode);
-  }
-
-  String toString() {
-    return 'Selector($kind, $name, ${callStructure.structureToString()})';
-  }
-
-  Selector toCallSelector() => new Selector.callClosureFrom(this);
-}
diff --git a/pkg/compiler/lib/src/use_unused_api.dart b/pkg/compiler/lib/src/use_unused_api.dart
index 570ccf4..772e231 100644
--- a/pkg/compiler/lib/src/use_unused_api.dart
+++ b/pkg/compiler/lib/src/use_unused_api.dart
@@ -11,7 +11,10 @@
 import '../compiler.dart' as api;
 
 import 'colors.dart' as colors;
+import 'compiler.dart' as compiler;
 import 'constants/constant_system.dart' as constants;
+import 'constants/constructors.dart' as constants;
+import 'constants/evaluation.dart' as constants;
 import 'constants/expressions.dart' as constants;
 import 'constants/values.dart' as constants;
 import 'cps_ir/cps_ir_builder.dart' as ir_builder;
@@ -19,12 +22,12 @@
 import 'tree_ir/tree_ir_nodes.dart' as tree_ir;
 import 'dart_types.dart' as dart_types;
 import 'dart2js.dart' as dart2js;
-import 'dart2jslib.dart' as dart2jslib;
+import 'deferred_load.dart' as deferred;
+import 'diagnostics/source_span.dart' as diagnostics;
 import 'elements/elements.dart' as elements;
 import 'elements/modelx.dart' as modelx;
 import 'elements/visitor.dart' as elements_visitor;
 import 'filenames.dart' as filenames;
-import 'inferrer/concrete_types_inferrer.dart' as concrete_types_inferrer;
 import 'inferrer/type_graph_inferrer.dart' as type_graph_inferrer;
 import 'io/line_column_provider.dart' as io;
 import 'io/source_map_builder.dart' as io;
@@ -35,12 +38,14 @@
 import 'js_emitter/program_builder/program_builder.dart' as program_builder;
 import 'resolution/semantic_visitor.dart' as semantic_visitor;
 import 'resolution/operators.dart' as operators;
+import 'script.dart';
 import 'source_file_provider.dart' as source_file_provider;
 import 'ssa/ssa.dart' as ssa;
 import 'tree/tree.dart' as tree;
 import 'util/util.dart' as util;
+import 'world.dart';
 
-import 'scanner/scannerlib.dart' show
+import 'parser/partial_elements.dart' show
     PartialClassElement,
     PartialFunctionElement;
 
@@ -51,7 +56,7 @@
 void main(List<String> arguments) {
   useApi(null);
   dart2js.main(arguments);
-  dart2jslib.isPublicName(null);
+  elements.Name.isPublicName(null);
   useConstant();
   useNode(null);
   useUtil(null);
@@ -63,7 +68,6 @@
   useJsNode(new js.ArrayHole());
   useJsOther(new js.SimpleJavaScriptPrintingContext());
   useJsBackend(null);
-  useConcreteTypesInferrer(null);
   useColor();
   useFilenames();
   useSsa(null);
@@ -78,12 +82,16 @@
   useProgramBuilder(null);
   useSemanticVisitor();
   useTreeVisitors();
+  useDeferred();
 }
 
-useApi(api.ReadStringFromUri uri) {
+useApi([api.ReadStringFromUri uri, compiler.Compiler compiler]) {
+  compiler.analyzeUri(null);
+  new diagnostics.SourceSpan.fromNode(null, null);
 }
 
-class NullConstantConstructorVisitor extends constants.ConstantConstructorVisitor {
+class NullConstantConstructorVisitor
+    extends constants.ConstantConstructorVisitor {
   @override
   visitGenerative(constants.GenerativeConstantConstructor constructor, arg) {
   }
@@ -135,6 +143,7 @@
     ..asFor()
     ..asFunctionDeclaration()
     ..asIf()
+    ..asImport()
     ..asLabeledStatement()
     ..asLibraryDependency()
     ..asLibraryName()
@@ -217,11 +226,7 @@
 }
 
 useJsBackend(js_backend.JavaScriptBackend backend) {
-  backend.assembleCode(null);
-}
-
-useConcreteTypesInferrer(concrete_types_inferrer.ConcreteTypesInferrer c) {
-  c.debug();
+  backend.getGeneratedCode(null);
 }
 
 useColor() {
@@ -253,18 +258,18 @@
 usedByTests() {
   // TODO(ahe): We should try to avoid including API used only for tests. In
   // most cases, such API can be moved to a test library.
-  dart2jslib.World world = null;
-  dart2jslib.Compiler compiler = null;
-  compiler.currentlyInUserCode();
+  World world = null;
   type_graph_inferrer.TypeGraphInferrer typeGraphInferrer = null;
   source_file_provider.SourceFileProvider sourceFileProvider = null;
   sourceFileProvider.getSourceFile(null);
   world.hasAnyUserDefinedGetter(null, null);
   world.subclassesOf(null);
-  world.classHierarchyNode(null);
+  world.getClassHierarchyNode(null);
+  world.getClassSet(null);
+  world.haveAnyCommonSubtypes(null, null);
   typeGraphInferrer.getCallersOf(null);
   dart_types.Types.sorted(null);
-  new dart_types.Types(compiler).copy(compiler);
+  new dart_types.Types(null).copy(null);
   sourceFileProvider.readStringFromUri(null);
 }
 
@@ -289,17 +294,18 @@
     ..buildStringConstant(null);
 }
 
-useCompiler(dart2jslib.Compiler compiler) {
-  compiler.libraryLoader
+useCompiler(compiler.Compiler c) {
+  c.libraryLoader
       ..reset()
       ..resetAsync(null)
       ..lookupLibrary(null);
-  compiler.forgetElement(null);
-  compiler.backend.constantCompilerTask.copyConstantValues(null);
+  c.forgetElement(null);
+  c.backend.constantCompilerTask.copyConstantValues(null);
+  c.currentlyInUserCode();
+
 }
 
 useTypes() {
-  new dart_types.ResolvedTypedefType(null, null, null).unalias(null);
 }
 
 useCodeEmitterTask(js_emitter.CodeEmitterTask codeEmitterTask) {
@@ -308,7 +314,7 @@
   fullEmitter.buildLazilyInitializedStaticField(null, isolateProperties: null);
 }
 
-useScript(dart2jslib.Script script) {
+useScript(Script script) {
   script.copyWithFile(null);
 }
 
@@ -320,9 +326,7 @@
 useSemanticVisitor() {
   operators.UnaryOperator.fromKind(null);
   operators.BinaryOperator.fromKind(null);
-  new semantic_visitor.BulkSendVisitor()
-      ..apply(null, null)
-      ..visitSuperFieldFieldCompound(null, null, null, null, null, null);
+  new semantic_visitor.BulkSendVisitor()..apply(null, null);
   new semantic_visitor.TraversalVisitor(null).apply(null, null);
   new semantic_visitor.BulkDeclarationVisitor().apply(null, null);
 }
@@ -336,3 +340,7 @@
   new TreeVisitor1().visitExpression(null, null);
   new TreeVisitor1().visitStatement(null, null);
 }
+
+useDeferred([deferred.DeferredLoadTask task]) {
+  task.dump();
+}
\ No newline at end of file
diff --git a/pkg/compiler/lib/src/util/link.dart b/pkg/compiler/lib/src/util/link.dart
index 31316e9..3a9c133 100644
--- a/pkg/compiler/lib/src/util/link.dart
+++ b/pkg/compiler/lib/src/util/link.dart
@@ -57,6 +57,7 @@
   }
 
   bool get isEmpty => true;
+  bool get isNotEmpty => false;
 
   Link<T> reverse() => this;
 
@@ -121,19 +122,31 @@
   Link copyWithout(e) => this;
 }
 
+/// Builder object for creating linked lists using [Link] or fixed-length [List]
+/// objects.
 abstract class LinkBuilder<T> {
   factory LinkBuilder() = LinkBuilderImplementation;
 
-  /**
-   * Prepends all elements added to the builder to [tail]. The resulting list is
-   * returned and the builder is cleared.
-   */
+  /// Prepends all elements added to the builder to [tail]. The resulting list
+  /// is returned and the builder is cleared.
   Link<T> toLink([Link<T> tail = const Link()]);
 
+  /// Creates a new fixed length containing all added elements. The
+  /// resulting list is returned and the builder is cleared.
   List<T> toList();
 
+  /// Adds the element [t] to the end of the list being built.
   Link<T> addLast(T t);
 
+  /// Returns the first element in the list being built.
+  T get first;
+
+  /// Returns the number of elements in the list being built.
   final int length;
+
+  /// Returns `true` if the list being built is empty.
   final bool isEmpty;
+
+  /// Removes all added elements and resets the builder.
+  void clear();
 }
diff --git a/pkg/compiler/lib/src/util/link_implementation.dart b/pkg/compiler/lib/src/util/link_implementation.dart
index 7cea7d9..973ef50 100644
--- a/pkg/compiler/lib/src/util/link_implementation.dart
+++ b/pkg/compiler/lib/src/util/link_implementation.dart
@@ -71,7 +71,7 @@
   void printOn(StringBuffer buffer, [separatedBy]) {
     buffer.write(head);
     if (separatedBy == null) separatedBy = '';
-    for (Link link = tail; !link.isEmpty; link = link.tail) {
+    for (Link link = tail; link.isNotEmpty; link = link.tail) {
       buffer.write(separatedBy);
       buffer.write(link.head);
     }
@@ -87,7 +87,7 @@
 
   Link<T> reverse() {
     Link<T> result = const Link();
-    for (Link<T> link = this; !link.isEmpty; link = link.tail) {
+    for (Link<T> link = this; link.isNotEmpty; link = link.tail) {
       result = result.prepend(link.head);
     }
     return result;
@@ -95,7 +95,7 @@
 
   Link<T> reversePrependAll(Link<T> from) {
     Link<T> result;
-    for (result = this; !from.isEmpty; from = from.tail) {
+    for (result = this; from.isNotEmpty; from = from.tail) {
       result = result.prepend(from.head);
     }
     return result;
@@ -113,9 +113,10 @@
   }
 
   bool get isEmpty => false;
+  bool get isNotEmpty => true;
 
   void forEach(void f(T element)) {
-    for (Link<T> link = this; !link.isEmpty; link = link.tail) {
+    for (Link<T> link = this; link.isNotEmpty; link = link.tail) {
       f(link.head);
     }
   }
@@ -123,7 +124,7 @@
   bool operator ==(other) {
     if (other is !Link<T>) return false;
     Link<T> myElements = this;
-    while (!myElements.isEmpty && !other.isEmpty) {
+    while (myElements.isNotEmpty && other.isNotEmpty) {
       if (myElements.head != other.head) {
         return false;
       }
@@ -135,12 +136,18 @@
 
   int get hashCode => throw new UnsupportedError('LinkEntry.hashCode');
 
-  int slowLength() => 1 + tail.slowLength();
+  int slowLength() {
+    int length = 0;
+    for (Link current = this; current.isNotEmpty; current = current.tail) {
+      ++length;
+    }
+    return length;
+  }
 
   Link copyWithout(e) {
     LinkBuilder copy = new LinkBuilder();
     Link link = this;
-    for (; !link.isEmpty; link = link.tail) {
+    for (; link.isNotEmpty; link = link.tail) {
       if (link.head != e) {
         copy.addLast(link.head);
       }
@@ -162,6 +169,7 @@
     Link<T> link = head;
     lastLink = null;
     head = null;
+    length = 0;
     return link;
   }
 
@@ -170,13 +178,14 @@
     List<T> list = new List<T>(length);
     int index = 0;
     Link<T> link = head;
-    while (!link.isEmpty) {
+    while (link.isNotEmpty) {
       list[index] = link.head;
       link = link.tail;
       index++;
     }
     lastLink = null;
     head = null;
+    length = 0;
     return list;
   }
 
@@ -193,4 +202,17 @@
   }
 
   bool get isEmpty => length == 0;
+
+  T get first {
+    if (head != null) {
+      return head.head;
+    }
+    throw new StateError("no elements");
+  }
+
+  void clear() {
+    head = null;
+    lastLink = null;
+    length = 0;
+  }
 }
diff --git a/pkg/compiler/lib/src/util/util.dart b/pkg/compiler/lib/src/util/util.dart
index d26a5c3..a91f6cd 100644
--- a/pkg/compiler/lib/src/util/util.dart
+++ b/pkg/compiler/lib/src/util/util.dart
@@ -63,42 +63,6 @@
   }
 }
 
-/**
- * Tagging interface for classes from which source spans can be generated.
- */
-// TODO(johnniwinther): Find a better name.
-// TODO(ahe): How about "Bolt"?
-abstract class Spannable {}
-
-class _SpannableSentinel implements Spannable {
-  final String name;
-
-  const _SpannableSentinel(this.name);
-
-  String toString() => name;
-}
-
-/// Sentinel spannable used to mark that diagnostics should point to the
-/// current element. Note that the diagnostic reporting will fail if the current
-/// element is `null`.
-const Spannable CURRENT_ELEMENT_SPANNABLE =
-    const _SpannableSentinel("Current element");
-
-/// Sentinel spannable used to mark that there might be no location for the
-/// diagnostic. Use this only when it is not an error not to have a current
-/// element.
-const Spannable NO_LOCATION_SPANNABLE =
-    const _SpannableSentinel("No location");
-
-class SpannableAssertionFailure {
-  final Spannable node;
-  final String message;
-  SpannableAssertionFailure(this.node, this.message);
-
-  String toString() => 'Assertion failure'
-                       '${message != null ? ': $message' : ''}';
-}
-
 bool equalElements(List a, List b) {
   if (a.length != b.length) return false;
   for (int index = 0; index < a.length; index++) {
diff --git a/pkg/compiler/lib/src/warnings.dart b/pkg/compiler/lib/src/warnings.dart
deleted file mode 100644
index 6108da1..0000000
--- a/pkg/compiler/lib/src/warnings.dart
+++ /dev/null
@@ -1,3354 +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.
-
-
-/**
- * The messages in this file should meet the following guide lines:
- *
- * 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 '#{className}' 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 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 for violating the specification.
- *
- * Other things to keep in mind:
- *
- * An INFO message should always be preceded by a non-INFO message, and the
- * INFO messages are additional details about the preceding non-INFO
- * message. For example, consider duplicated elements. First report a WARNING
- * or ERROR about the duplicated element, and then report an INFO about the
- * location of the existing element.
- *
- * Generally, we want to provide messages that consists of three sentences:
- * 1. what is wrong, 2. why is it wrong, 3. how do I fix it. However, we
- * combine the first two in [template] and the last in [howToFix].
- */
-
-library dart2js.messages;
-
-import 'dart2jslib.dart';
-import 'scanner/scannerlib.dart';
-
-const DONT_KNOW_HOW_TO_FIX = "Computer says no!";
-
-/// Keys for the [MessageTemplate]s.
-enum MessageKind {
-  ABSTRACT_CLASS_INSTANTIATION,
-  ABSTRACT_GETTER,
-  ABSTRACT_METHOD,
-  ABSTRACT_SETTER,
-  ACCESSED_IN_CLOSURE,
-  ACCESSED_IN_CLOSURE_HERE,
-  ADDITIONAL_ARGUMENT,
-  ADDITIONAL_TYPE_ARGUMENT,
-  ALREADY_INITIALIZED,
-  AMBIGUOUS_LOCATION,
-  AMBIGUOUS_REEXPORT,
-  ASSERT_IS_GIVEN_NAMED_ARGUMENTS,
-  ASSIGNING_METHOD,
-  ASSIGNING_METHOD_IN_SUPER,
-  ASSIGNING_TYPE,
-  ASYNC_KEYWORD_AS_IDENTIFIER,
-  ASYNC_MODIFIER_ON_ABSTRACT_METHOD,
-  ASYNC_MODIFIER_ON_CONSTRUCTOR,
-  ASYNC_MODIFIER_ON_SETTER,
-  AWAIT_MEMBER_NOT_FOUND,
-  AWAIT_MEMBER_NOT_FOUND_IN_CLOSURE,
-  BAD_INPUT_CHARACTER,
-  BEFORE_TOP_LEVEL,
-  BINARY_OPERATOR_BAD_ARITY,
-  BODY_EXPECTED,
-  CALL_NOT_SUPPORTED_ON_NATIVE_CLASS,
-  CANNOT_EXTEND,
-  CANNOT_EXTEND_ENUM,
-  CANNOT_EXTEND_MALFORMED,
-  CANNOT_FIND_CONSTRUCTOR,
-  CANNOT_IMPLEMENT,
-  CANNOT_IMPLEMENT_ENUM,
-  CANNOT_IMPLEMENT_MALFORMED,
-  CANNOT_INSTANTIATE_ENUM,
-  CANNOT_INSTANTIATE_TYPE_VARIABLE,
-  CANNOT_INSTANTIATE_TYPEDEF,
-  CANNOT_MIXIN,
-  CANNOT_MIXIN_ENUM,
-  CANNOT_MIXIN_MALFORMED,
-  CANNOT_OVERRIDE_FIELD_WITH_METHOD,
-  CANNOT_OVERRIDE_FIELD_WITH_METHOD_CONT,
-  CANNOT_OVERRIDE_GETTER_WITH_METHOD,
-  CANNOT_OVERRIDE_GETTER_WITH_METHOD_CONT,
-  CANNOT_OVERRIDE_METHOD_WITH_FIELD,
-  CANNOT_OVERRIDE_METHOD_WITH_FIELD_CONT,
-  CANNOT_OVERRIDE_METHOD_WITH_GETTER,
-  CANNOT_OVERRIDE_METHOD_WITH_GETTER_CONT,
-  CANNOT_RESOLVE,
-  CANNOT_RESOLVE_AWAIT,
-  CANNOT_RESOLVE_AWAIT_IN_CLOSURE,
-  CANNOT_RESOLVE_CONSTRUCTOR,
-  CANNOT_RESOLVE_CONSTRUCTOR_FOR_IMPLICIT,
-  CANNOT_RESOLVE_GETTER,
-  CANNOT_RESOLVE_IN_INITIALIZER,
-  CANNOT_RESOLVE_SETTER,
-  CANNOT_RESOLVE_TYPE,
-  CANNOT_RETURN_FROM_CONSTRUCTOR,
-  CLASS_NAME_EXPECTED,
-  COMPILER_CRASHED,
-  COMPLEX_RETURNING_NSM,
-  COMPLEX_THROWING_NSM,
-  CONSIDER_ANALYZE_ALL,
-  CONST_CALLS_NON_CONST,
-  CONST_CALLS_NON_CONST_FOR_IMPLICIT,
-  CONST_CONSTRUCTOR_HAS_BODY,
-  CONST_CONSTRUCTOR_WITH_NONFINAL_FIELDS,
-  CONST_CONSTRUCTOR_WITH_NONFINAL_FIELDS_CONSTRUCTOR,
-  CONST_CONSTRUCTOR_WITH_NONFINAL_FIELDS_FIELD,
-  CONST_MAP_KEY_OVERRIDES_EQUALS,
-  CONST_WITHOUT_INITIALIZER,
-  CONSTRUCTOR_CALL_EXPECTED,
-  CONSTRUCTOR_IS_NOT_CONST,
-  CONSTRUCTOR_WITH_RETURN_TYPE,
-  CYCLIC_CLASS_HIERARCHY,
-  CYCLIC_COMPILE_TIME_CONSTANTS,
-  CYCLIC_REDIRECTING_FACTORY,
-  CYCLIC_TYPE_VARIABLE,
-  CYCLIC_TYPEDEF,
-  CYCLIC_TYPEDEF_ONE,
-  DART_EXT_NOT_SUPPORTED,
-  DEFERRED_COMPILE_TIME_CONSTANT,
-  DEFERRED_COMPILE_TIME_CONSTANT_CONSTRUCTION,
-  DEFERRED_LIBRARY_DART_2_DART,
-  DEFERRED_LIBRARY_DUPLICATE_PREFIX,
-  DEFERRED_LIBRARY_WITHOUT_PREFIX,
-  DEFERRED_OLD_SYNTAX,
-  DEFERRED_TYPE_ANNOTATION,
-  DEPRECATED_TYPEDEF_MIXIN_SYNTAX,
-  DIRECTLY_THROWING_NSM,
-  DUPLICATE_DEFINITION,
-  DUPLICATE_EXPORT,
-  DUPLICATE_EXPORT_CONT,
-  DUPLICATE_EXPORT_DECL,
-  DUPLICATE_EXTENDS_IMPLEMENTS,
-  DUPLICATE_IMPLEMENTS,
-  DUPLICATE_IMPORT,
-  DUPLICATE_INITIALIZER,
-  DUPLICATE_LABEL,
-  DUPLICATE_SUPER_INITIALIZER,
-  DUPLICATE_TYPE_VARIABLE_NAME,
-  DUPLICATED_LIBRARY_NAME,
-  DUPLICATED_LIBRARY_RESOURCE,
-  DUPLICATED_PART_OF,
-  DUPLICATED_RESOURCE,
-  EMPTY_CATCH_DECLARATION,
-  EMPTY_ENUM_DECLARATION,
-  EQUAL_MAP_ENTRY_KEY,
-  EXISTING_DEFINITION,
-  EXISTING_LABEL,
-  EXPECTED_IDENTIFIER_NOT_RESERVED_WORD,
-  EXPONENT_MISSING,
-  EXPORT_BEFORE_PARTS,
-  EXTERNAL_WITH_BODY,
-  EXTRA_CATCH_DECLARATION,
-  EXTRA_FORMALS,
-  EXTRANEOUS_MODIFIER,
-  EXTRANEOUS_MODIFIER_REPLACE,
-  FACTORY_REDIRECTION_IN_NON_FACTORY,
-  FINAL_FUNCTION_TYPE_PARAMETER,
-  FINAL_WITHOUT_INITIALIZER,
-  FORMAL_DECLARED_CONST,
-  FORMAL_DECLARED_STATIC,
-  FUNCTION_TYPE_FORMAL_WITH_DEFAULT,
-  FUNCTION_WITH_INITIALIZER,
-  GENERIC,
-  GETTER_MISMATCH,
-  GETTER_NOT_FOUND,
-  HEX_DIGIT_EXPECTED,
-  HIDDEN_HINTS,
-  HIDDEN_IMPLICIT_IMPORT,
-  HIDDEN_IMPORT,
-  HIDDEN_WARNINGS,
-  HIDDEN_WARNINGS_HINTS,
-  IF_NULL_ASSIGNING_TYPE,
-  ILLEGAL_CONST_FIELD_MODIFIER,
-  ILLEGAL_CONSTRUCTOR_MODIFIERS,
-  ILLEGAL_FINAL_METHOD_MODIFIER,
-  ILLEGAL_MIXIN_APPLICATION_MODIFIERS,
-  ILLEGAL_MIXIN_CONSTRUCTOR,
-  ILLEGAL_MIXIN_CYCLE,
-  ILLEGAL_MIXIN_OBJECT,
-  ILLEGAL_MIXIN_SUPER_USE,
-  ILLEGAL_MIXIN_SUPERCLASS,
-  ILLEGAL_MIXIN_WITH_SUPER,
-  ILLEGAL_SETTER_FORMALS,
-  ILLEGAL_STATIC,
-  ILLEGAL_SUPER_SEND,
-  IMPORT_BEFORE_PARTS,
-  IMPORT_EXPERIMENTAL_MIRRORS,
-  IMPORT_PART_OF,
-  IMPORTED_HERE,
-  INHERIT_GETTER_AND_METHOD,
-  INHERITED_EXPLICIT_GETTER,
-  INHERITED_IMPLICIT_GETTER,
-  INHERITED_METHOD,
-  INIT_STATIC_FIELD,
-  INITIALIZING_FORMAL_NOT_ALLOWED,
-  INSTANCE_STATIC_SAME_NAME,
-  INSTANCE_STATIC_SAME_NAME_CONT,
-  INTERNAL_LIBRARY,
-  INTERNAL_LIBRARY_FROM,
-  INVALID_ARGUMENT_AFTER_NAMED,
-  INVALID_AWAIT_FOR,
-  INVALID_BREAK,
-  INVALID_CASE_DEFAULT,
-  INVALID_CONSTRUCTOR_ARGUMENTS,
-  INVALID_CONSTRUCTOR_NAME,
-  INVALID_CONTINUE,
-  INVALID_FOR_IN,
-  INVALID_INITIALIZER,
-  INVALID_OVERRIDDEN_FIELD,
-  INVALID_OVERRIDDEN_GETTER,
-  INVALID_OVERRIDDEN_METHOD,
-  INVALID_OVERRIDDEN_SETTER,
-  INVALID_OVERRIDE_FIELD,
-  INVALID_OVERRIDE_FIELD_WITH_GETTER,
-  INVALID_OVERRIDE_FIELD_WITH_SETTER,
-  INVALID_OVERRIDE_GETTER,
-  INVALID_OVERRIDE_GETTER_WITH_FIELD,
-  INVALID_OVERRIDE_METHOD,
-  INVALID_OVERRIDE_SETTER,
-  INVALID_OVERRIDE_SETTER_WITH_FIELD,
-  INVALID_PACKAGE_CONFIG,
-  INVALID_PACKAGE_URI,
-  INVALID_PARAMETER,
-  INVALID_RECEIVER_IN_INITIALIZER,
-  INVALID_SOURCE_FILE_LOCATION,
-  INVALID_SYMBOL,
-  INVALID_SYNC_MODIFIER,
-  INVALID_TYPE_VARIABLE_BOUND,
-  INVALID_UNNAMED_CONSTRUCTOR_NAME,
-  INVALID_URI,
-  INVALID_USE_OF_SUPER,
-  LIBRARY_NAME_MISMATCH,
-  LIBRARY_NOT_FOUND,
-  LIBRARY_TAG_MUST_BE_FIRST,
-  MAIN_NOT_A_FUNCTION,
-  MAIN_WITH_EXTRA_PARAMETER,
-  MALFORMED_STRING_LITERAL,
-  MEMBER_NOT_FOUND,
-  MEMBER_NOT_STATIC,
-  MEMBER_USES_CLASS_NAME,
-  METHOD_NOT_FOUND,
-  MINUS_OPERATOR_BAD_ARITY,
-  MIRROR_BLOAT,
-  MIRROR_IMPORT,
-  MIRROR_IMPORT_NO_USAGE,
-  MIRRORS_CANNOT_FIND_IN_ELEMENT,
-  MIRRORS_CANNOT_RESOLVE_IN_CURRENT_LIBRARY,
-  MIRRORS_CANNOT_RESOLVE_IN_LIBRARY,
-  MIRRORS_EXPECTED_STRING,
-  MIRRORS_EXPECTED_STRING_OR_LIST,
-  MIRRORS_EXPECTED_STRING_OR_TYPE,
-  MIRRORS_EXPECTED_STRING_TYPE_OR_LIST,
-  MIRRORS_LIBRARY_NOT_SUPPORT_BY_BACKEND,
-  MISSING_ARGUMENT,
-  MISSING_ENUM_CASES,
-  MISSING_FACTORY_KEYWORD,
-  MISSING_FORMALS,
-  MISSING_LIBRARY_NAME,
-  MISSING_MAIN,
-  MISSING_PART_OF_TAG,
-  MISSING_TOKEN_AFTER_THIS,
-  MISSING_TOKEN_BEFORE_THIS,
-  MISSING_TYPE_ARGUMENT,
-  MULTI_INHERITANCE,
-  NAMED_ARGUMENT_NOT_FOUND,
-  NAMED_FUNCTION_EXPRESSION,
-  NAMED_PARAMETER_WITH_EQUALS,
-  NATIVE_NOT_SUPPORTED,
-  NO_BREAK_TARGET,
-  NO_CATCH_NOR_FINALLY,
-  NO_CONTINUE_TARGET,
-  NO_INSTANCE_AVAILABLE,
-  NO_MATCHING_CONSTRUCTOR,
-  NO_MATCHING_CONSTRUCTOR_FOR_IMPLICIT,
-  NO_STATIC_OVERRIDE,
-  NO_STATIC_OVERRIDE_CONT,
-  NO_SUCH_LIBRARY_MEMBER,
-  NO_SUCH_METHOD_IN_NATIVE,
-  NO_SUCH_SUPER_MEMBER,
-  NO_SUPER_IN_STATIC,
-  NO_THIS_AVAILABLE,
-  NON_CONST_BLOAT,
-  NOT_A_COMPILE_TIME_CONSTANT,
-  NOT_A_FIELD,
-  NOT_A_PREFIX,
-  NOT_A_TYPE,
-  NOT_ASSIGNABLE,
-  NOT_CALLABLE,
-  NOT_INSTANCE_FIELD,
-  NOT_MORE_SPECIFIC,
-  NOT_MORE_SPECIFIC_SUBTYPE,
-  NOT_MORE_SPECIFIC_SUGGESTION,
-  NULL_NOT_ALLOWED,
-  ONLY_ONE_LIBRARY_TAG,
-  OPERATOR_NAMED_PARAMETERS,
-  OPERATOR_NOT_FOUND,
-  OPERATOR_OPTIONAL_PARAMETERS,
-  OPTIONAL_PARAMETER_IN_CATCH,
-  OVERRIDE_EQUALS_NOT_HASH_CODE,
-  PARAMETER_NAME_EXPECTED,
-  PARAMETER_WITH_MODIFIER_IN_CATCH,
-  PARAMETER_WITH_TYPE_IN_CATCH,
-  PATCH_EXTERNAL_WITHOUT_IMPLEMENTATION,
-  PATCH_NO_GETTER,
-  PATCH_NO_SETTER,
-  PATCH_NON_CLASS,
-  PATCH_NON_CONSTRUCTOR,
-  PATCH_NON_EXISTING,
-  PATCH_NON_EXTERNAL,
-  PATCH_NON_FUNCTION,
-  PATCH_NON_GETTER,
-  PATCH_NON_SETTER,
-  PATCH_NONPATCHABLE,
-  PATCH_OPTIONAL_PARAMETER_COUNT_MISMATCH,
-  PATCH_OPTIONAL_PARAMETER_NAMED_MISMATCH,
-  PATCH_PARAMETER_MISMATCH,
-  PATCH_PARAMETER_TYPE_MISMATCH,
-  PATCH_POINT_TO_CLASS,
-  PATCH_POINT_TO_CONSTRUCTOR,
-  PATCH_POINT_TO_FUNCTION,
-  PATCH_POINT_TO_GETTER,
-  PATCH_POINT_TO_PARAMETER,
-  PATCH_POINT_TO_SETTER,
-  PATCH_REQUIRED_PARAMETER_COUNT_MISMATCH,
-  PATCH_RETURN_TYPE_MISMATCH,
-  PLEASE_REPORT_THE_CRASH,
-  POSITIONAL_PARAMETER_WITH_EQUALS,
-  POTENTIAL_MUTATION,
-  POTENTIAL_MUTATION_HERE,
-  POTENTIAL_MUTATION_IN_CLOSURE,
-  POTENTIAL_MUTATION_IN_CLOSURE_HERE,
-  PREAMBLE,
-  PREFIX_AS_EXPRESSION,
-  PRIVATE_ACCESS,
-  PRIVATE_IDENTIFIER,
-  PRIVATE_NAMED_PARAMETER,
-  READ_SCRIPT_ERROR,
-  READ_SELF_ERROR,
-  REDIRECTING_CONSTRUCTOR_CYCLE,
-  REDIRECTING_CONSTRUCTOR_HAS_BODY,
-  REDIRECTING_CONSTRUCTOR_HAS_INITIALIZER,
-  REDIRECTING_FACTORY_WITH_DEFAULT,
-  REFERENCE_IN_INITIALIZATION,
-  REQUIRED_PARAMETER_WITH_DEFAULT,
-  RETURN_IN_GENERATOR,
-  RETURN_NOTHING,
-  RETURN_VALUE_IN_VOID,
-  SETTER_MISMATCH,
-  SETTER_NOT_FOUND,
-  SETTER_NOT_FOUND_IN_SUPER,
-  STATIC_FUNCTION_BLOAT,
-  STRING_EXPECTED,
-  SUPER_INITIALIZER_IN_OBJECT,
-  SWITCH_CASE_FORBIDDEN,
-  SWITCH_CASE_TYPES_NOT_EQUAL,
-  SWITCH_CASE_TYPES_NOT_EQUAL_CASE,
-  SWITCH_CASE_VALUE_OVERRIDES_EQUALS,
-  TERNARY_OPERATOR_BAD_ARITY,
-  THIS_IS_THE_DECLARATION,
-  THIS_IS_THE_METHOD,
-  THIS_IS_THE_PART_OF_TAG,
-  THIS_PROPERTY,
-  THROW_WITHOUT_EXPRESSION,
-  TOP_LEVEL_VARIABLE_DECLARED_STATIC,
-  TYPE_ARGUMENT_COUNT_MISMATCH,
-  TYPE_VARIABLE_IN_CONSTANT,
-  TYPE_VARIABLE_WITHIN_STATIC_MEMBER,
-  TYPEDEF_FORMAL_WITH_DEFAULT,
-  UNARY_OPERATOR_BAD_ARITY,
-  UNBOUND_LABEL,
-  UNIMPLEMENTED_EXPLICIT_GETTER,
-  UNIMPLEMENTED_EXPLICIT_SETTER,
-  UNIMPLEMENTED_GETTER,
-  UNIMPLEMENTED_GETTER_ONE,
-  UNIMPLEMENTED_IMPLICIT_GETTER,
-  UNIMPLEMENTED_IMPLICIT_SETTER,
-  UNIMPLEMENTED_METHOD,
-  UNIMPLEMENTED_METHOD_CONT,
-  UNIMPLEMENTED_METHOD_ONE,
-  UNIMPLEMENTED_SETTER,
-  UNIMPLEMENTED_SETTER_ONE,
-  UNMATCHED_TOKEN,
-  UNSUPPORTED_BANG_EQ_EQ,
-  UNSUPPORTED_EQ_EQ_EQ,
-  UNSUPPORTED_LITERAL_SYMBOL,
-  UNSUPPORTED_PREFIX_PLUS,
-  UNSUPPORTED_THROW_WITHOUT_EXP,
-  UNTERMINATED_COMMENT,
-  UNTERMINATED_STRING,
-  UNTERMINATED_TOKEN,
-  UNUSED_CLASS,
-  UNUSED_LABEL,
-  UNUSED_METHOD,
-  UNUSED_TYPEDEF,
-  VAR_FUNCTION_TYPE_PARAMETER,
-  VOID_EXPRESSION,
-  VOID_NOT_ALLOWED,
-  VOID_VARIABLE,
-  WRONG_ARGUMENT_FOR_JS_INTERCEPTOR_CONSTANT,
-  WRONG_NUMBER_OF_ARGUMENTS_FOR_ASSERT,
-  YIELDING_MODIFIER_ON_ARROW_BODY,
-}
-
-/// A message template for an error, warning, hint or info message generated
-/// by the compiler. Each template is associated with a [MessageKind] that
-/// uniquely identifies the message template.
-// TODO(johnnniwinther): For Infos, consider adding a reference to the
-// error/warning/hint that they belong to.
-class MessageTemplate {
-  final MessageKind kind;
-
-  /// Should describe what is wrong and why.
-  final String template;
-
-  /// Should describe how to fix the problem. Elided when using --terse option.
-  final String howToFix;
-
-  /**
-   *  Examples will be checked by
-   *  tests/compiler/dart2js/message_kind_test.dart.
-   *
-   *  An example is either a String containing the example source code or a Map
-   *  from filenames to source code. In the latter case, the filename for the
-   *  main library code must be 'main.dart'.
-   */
-  final List examples;
-
-  /// Additional options needed for the examples to work.
-  final List<String> options;
-
-  const MessageTemplate(
-      this.kind,
-      this.template,
-      {this.howToFix,
-       this.examples,
-       this.options: const <String>[]});
-
-  /// All templates used by the compiler.
-  ///
-  /// The map is complete mapping from [MessageKind] to their corresponding
-  /// [MessageTemplate].
-  static const Map<MessageKind, MessageTemplate> TEMPLATES =
-    const <MessageKind, MessageTemplate>{
-      /// Do not use this. It is here for legacy and debugging. It violates item
-      /// 4 of the guide lines for error messages in the beginning of the file.
-      MessageKind.GENERIC:
-        const MessageTemplate(MessageKind.GENERIC, '#{text}'),
-
-      MessageKind.NOT_ASSIGNABLE:
-        const MessageTemplate(MessageKind.NOT_ASSIGNABLE,
-          "'#{fromType}' is not assignable to '#{toType}'."),
-
-      MessageKind.VOID_EXPRESSION:
-        const MessageTemplate(MessageKind.VOID_EXPRESSION,
-          "Expression does not yield a value."),
-
-      MessageKind.VOID_VARIABLE:
-        const MessageTemplate(MessageKind.VOID_VARIABLE,
-          "Variable cannot be of type void."),
-
-      MessageKind.RETURN_VALUE_IN_VOID:
-        const MessageTemplate(MessageKind.RETURN_VALUE_IN_VOID,
-          "Cannot return value from void function."),
-
-      MessageKind.RETURN_NOTHING:
-        const MessageTemplate(MessageKind.RETURN_NOTHING,
-          "Value of type '#{returnType}' expected."),
-
-      MessageKind.MISSING_ARGUMENT:
-        const MessageTemplate(MessageKind.MISSING_ARGUMENT,
-          "Missing argument of type '#{argumentType}'."),
-
-      MessageKind.ADDITIONAL_ARGUMENT:
-        const MessageTemplate(MessageKind.ADDITIONAL_ARGUMENT,
-          "Additional argument."),
-
-      MessageKind.NAMED_ARGUMENT_NOT_FOUND:
-        const MessageTemplate(MessageKind.NAMED_ARGUMENT_NOT_FOUND,
-          "No named argument '#{argumentName}' found on method."),
-
-      MessageKind.MEMBER_NOT_FOUND:
-        const MessageTemplate(MessageKind.MEMBER_NOT_FOUND,
-          "No member named '#{memberName}' in class '#{className}'."),
-
-      MessageKind.AWAIT_MEMBER_NOT_FOUND:
-        const MessageTemplate(MessageKind.AWAIT_MEMBER_NOT_FOUND,
-          "No member named 'await' in class '#{className}'.",
-          howToFix: "Did you mean to add the 'async' marker "
-                    "to '#{functionName}'?",
-          examples: const ["""
-class A {
-  m() => await -3;
-}
-main() => new A().m();
-"""]),
-
-      MessageKind.AWAIT_MEMBER_NOT_FOUND_IN_CLOSURE:
-        const MessageTemplate(MessageKind.AWAIT_MEMBER_NOT_FOUND_IN_CLOSURE,
-          "No member named 'await' in class '#{className}'.",
-          howToFix: "Did you mean to add the 'async' marker "
-                    "to the enclosing function?",
-          examples: const ["""
-class A {
-  m() => () => await -3;
-}
-main() => new A().m();
-"""]),
-
-      MessageKind.METHOD_NOT_FOUND:
-        const MessageTemplate(MessageKind.METHOD_NOT_FOUND,
-          "No method named '#{memberName}' in class '#{className}'."),
-
-      MessageKind.OPERATOR_NOT_FOUND:
-        const MessageTemplate(MessageKind.OPERATOR_NOT_FOUND,
-          "No operator '#{memberName}' in class '#{className}'."),
-
-      MessageKind.SETTER_NOT_FOUND:
-        const MessageTemplate(MessageKind.SETTER_NOT_FOUND,
-          "No setter named '#{memberName}' in class '#{className}'."),
-
-      MessageKind.SETTER_NOT_FOUND_IN_SUPER:
-        const MessageTemplate(MessageKind.SETTER_NOT_FOUND_IN_SUPER,
-          "No setter named '#{name}' in superclass of '#{className}'."),
-
-      MessageKind.GETTER_NOT_FOUND:
-        const MessageTemplate(MessageKind.GETTER_NOT_FOUND,
-          "No getter named '#{memberName}' in class '#{className}'."),
-
-      MessageKind.NOT_CALLABLE:
-        const MessageTemplate(MessageKind.NOT_CALLABLE,
-          "'#{elementName}' is not callable."),
-
-      MessageKind.MEMBER_NOT_STATIC:
-        const MessageTemplate(MessageKind.MEMBER_NOT_STATIC,
-          "'#{className}.#{memberName}' is not static."),
-
-      MessageKind.NO_INSTANCE_AVAILABLE:
-        const MessageTemplate(MessageKind.NO_INSTANCE_AVAILABLE,
-          "'#{name}' is only available in instance methods."),
-
-      MessageKind.NO_THIS_AVAILABLE:
-        const MessageTemplate(MessageKind.NO_THIS_AVAILABLE,
-          "'this' is only available in instance methods."),
-
-      MessageKind.PRIVATE_ACCESS:
-        const MessageTemplate(MessageKind.PRIVATE_ACCESS,
-          "'#{name}' is declared private within library "
-          "'#{libraryName}'."),
-
-      MessageKind.THIS_IS_THE_DECLARATION:
-        const MessageTemplate(MessageKind.THIS_IS_THE_DECLARATION,
-          "This is the declaration of '#{name}'."),
-
-      MessageKind.THIS_IS_THE_METHOD:
-        const MessageTemplate(MessageKind.THIS_IS_THE_METHOD,
-          "This is the method declaration."),
-
-      MessageKind.CANNOT_RESOLVE:
-        const MessageTemplate(MessageKind.CANNOT_RESOLVE,
-          "Cannot resolve '#{name}'."),
-
-      MessageKind.CANNOT_RESOLVE_AWAIT:
-        const MessageTemplate(MessageKind.CANNOT_RESOLVE_AWAIT,
-          "Cannot resolve '#{name}'.",
-          howToFix: "Did you mean to add the 'async' marker "
-                    "to '#{functionName}'?",
-          examples: const [
-              "main() => await -3;",
-              "foo() => await -3; main() => foo();"
-          ]),
-
-      MessageKind.CANNOT_RESOLVE_AWAIT_IN_CLOSURE:
-        const MessageTemplate(MessageKind.CANNOT_RESOLVE_AWAIT_IN_CLOSURE,
-          "Cannot resolve '#{name}'.",
-          howToFix: "Did you mean to add the 'async' marker "
-                    "to the enclosing function?",
-          examples: const [
-              "main() { (() => await -3)(); }",
-          ]),
-
-      MessageKind.CANNOT_RESOLVE_IN_INITIALIZER:
-        const MessageTemplate(MessageKind.CANNOT_RESOLVE_IN_INITIALIZER,
-          "Cannot resolve '#{name}'. It would be implicitly looked up on this "
-          "instance, but instances are not available in initializers.",
-          howToFix: "Try correcting the unresolved reference or move the "
-              "initialization to a constructor body.",
-          examples: const ["""
-class A {
-  var test = unresolvedName;
-}
-main() => new A();
-"""]),
-
-      MessageKind.CANNOT_RESOLVE_CONSTRUCTOR:
-        const MessageTemplate(MessageKind.CANNOT_RESOLVE_CONSTRUCTOR,
-          "Cannot resolve constructor '#{constructorName}'."),
-
-      MessageKind.CANNOT_RESOLVE_CONSTRUCTOR_FOR_IMPLICIT:
-        const MessageTemplate(
-          MessageKind.CANNOT_RESOLVE_CONSTRUCTOR_FOR_IMPLICIT,
-          "cannot resolve constructor '#{constructorName}' "
-          "for implicit super call.",
-          howToFix: "Try explicitly invoking a constructor of the super class",
-          examples: const ["""
-class A {
-  A.foo() {}
-}
-class B extends A {
-  B();
-}
-main() => new B();
-"""]),
-
-      MessageKind.INVALID_UNNAMED_CONSTRUCTOR_NAME:
-        const MessageTemplate(MessageKind.INVALID_UNNAMED_CONSTRUCTOR_NAME,
-          "Unnamed constructor name must be '#{name}'."),
-
-      MessageKind.INVALID_CONSTRUCTOR_NAME:
-        const MessageTemplate(MessageKind.INVALID_CONSTRUCTOR_NAME,
-          "Constructor name must start with '#{name}'."),
-
-      MessageKind.CANNOT_RESOLVE_TYPE:
-        const MessageTemplate(MessageKind.CANNOT_RESOLVE_TYPE,
-          "Cannot resolve type '#{typeName}'."),
-
-      MessageKind.DUPLICATE_DEFINITION:
-        const MessageTemplate(MessageKind.DUPLICATE_DEFINITION,
-          "Duplicate definition of '#{name}'.",
-          howToFix: "Try to rename or remove this definition.",
-          examples: const ["""
-class C {
-  void f() {}
-  int get f => 1;
-}
-
-main() {
-  new C();
-}
-
-"""]),
-
-      MessageKind.EXISTING_DEFINITION:
-        const MessageTemplate(MessageKind.EXISTING_DEFINITION,
-          "Existing definition of '#{name}'."),
-
-      MessageKind.DUPLICATE_IMPORT:
-        const MessageTemplate(MessageKind.DUPLICATE_IMPORT,
-          "Duplicate import of '#{name}'."),
-
-      MessageKind.HIDDEN_IMPORT:
-        const MessageTemplate(MessageKind.HIDDEN_IMPORT,
-          "'#{name}' from library '#{hiddenUri}' is hidden by '#{name}' "
-          "from library '#{hidingUri}'.",
-          howToFix:
-            "Try adding 'hide #{name}' to the import of '#{hiddenUri}'.",
-          examples: const [
-              const {
-'main.dart':
-"""
-import 'dart:async'; // This imports a class Future.
-import 'future.dart';
-
-void main() => new Future();""",
-
-'future.dart':
-"""
-library future;
-
-class Future {}"""},
-
-          const {
-'main.dart':
-"""
-import 'future.dart';
-import 'dart:async'; // This imports a class Future.
-
-void main() => new Future();""",
-
-'future.dart':
-"""
-library future;
-
-class Future {}"""},
-
-          const {
-'main.dart':
-"""
-import 'export.dart';
-import 'dart:async'; // This imports a class Future.
-
-void main() => new Future();""",
-
-'future.dart':
-"""
-library future;
-
-class Future {}""",
-
-'export.dart':
-"""
-library export;
-
-export 'future.dart';"""},
-
-         const {
-'main.dart':
-"""
-import 'future.dart' as prefix;
-import 'dart:async' as prefix; // This imports a class Future.
-
-void main() => new prefix.Future();""",
-
-'future.dart':
-"""
-library future;
-
-class Future {}"""}]),
-
-
-      MessageKind.HIDDEN_IMPLICIT_IMPORT:
-        const MessageTemplate(MessageKind.HIDDEN_IMPLICIT_IMPORT,
-          "'#{name}' from library '#{hiddenUri}' is hidden by '#{name}' "
-          "from library '#{hidingUri}'.",
-          howToFix: "Try adding an explicit "
-                    "'import \"#{hiddenUri}\" hide #{name}'.",
-          examples: const [
-              const {
-'main.dart':
-"""
-// This hides the implicit import of class Type from dart:core.
-import 'type.dart';
-
-void main() => new Type();""",
-
-'type.dart':
-"""
-library type;
-
-class Type {}"""},
-          const {
-'conflictsWithDart.dart':
-"""
-library conflictsWithDart;
-
-class Duration {
-  static var x = 100;
-}
-""",
-
-'conflictsWithDartAsWell.dart':
-"""
-library conflictsWithDartAsWell;
-
-class Duration {
-  static var x = 100;
-}
-""",
-
-'main.dart':
-r"""
-library testDartConflicts;
-
-import 'conflictsWithDart.dart';
-import 'conflictsWithDartAsWell.dart';
-
-main() {
-  print("Hail Caesar ${Duration.x}");
-}
-"""}]),
-
-      MessageKind.DUPLICATE_EXPORT:
-        const MessageTemplate(MessageKind.DUPLICATE_EXPORT,
-          "Duplicate export of '#{name}'.",
-          howToFix: "Trying adding 'hide #{name}' to one of the exports.",
-          examples: const [const {
-'main.dart': """
-export 'decl1.dart';
-export 'decl2.dart';
-
-main() {}""",
-'decl1.dart': "class Class {}",
-'decl2.dart': "class Class {}"}]),
-
-      MessageKind.DUPLICATE_EXPORT_CONT:
-        const MessageTemplate(MessageKind.DUPLICATE_EXPORT_CONT,
-          "This is another export of '#{name}'."),
-
-      MessageKind.DUPLICATE_EXPORT_DECL:
-        const MessageTemplate(MessageKind.DUPLICATE_EXPORT_DECL,
-          "The exported '#{name}' from export #{uriString} is defined here."),
-
-      MessageKind.NOT_A_TYPE:
-        const MessageTemplate(MessageKind.NOT_A_TYPE,
-          "'#{node}' is not a type."),
-
-      MessageKind.NOT_A_PREFIX:
-        const MessageTemplate(MessageKind.NOT_A_PREFIX,
-          "'#{node}' is not a prefix."),
-
-      MessageKind.PREFIX_AS_EXPRESSION:
-        const MessageTemplate(MessageKind.PREFIX_AS_EXPRESSION,
-          "Library prefix '#{prefix}' is not a valid expression."),
-
-      MessageKind.CANNOT_FIND_CONSTRUCTOR:
-        const MessageTemplate(MessageKind.CANNOT_FIND_CONSTRUCTOR,
-          "Cannot find constructor '#{constructorName}'."),
-
-      MessageKind.CYCLIC_CLASS_HIERARCHY:
-        const MessageTemplate(MessageKind.CYCLIC_CLASS_HIERARCHY,
-          "'#{className}' creates a cycle in the class hierarchy."),
-
-      MessageKind.CYCLIC_REDIRECTING_FACTORY:
-        const MessageTemplate(MessageKind.CYCLIC_REDIRECTING_FACTORY,
-          'Redirecting factory leads to a cyclic redirection.'),
-
-      MessageKind.INVALID_RECEIVER_IN_INITIALIZER:
-        const MessageTemplate(MessageKind.INVALID_RECEIVER_IN_INITIALIZER,
-          "Field initializer expected."),
-
-      MessageKind.NO_SUPER_IN_STATIC:
-        const MessageTemplate(MessageKind.NO_SUPER_IN_STATIC,
-          "'super' is only available in instance methods."),
-
-      MessageKind.DUPLICATE_INITIALIZER:
-        const MessageTemplate(MessageKind.DUPLICATE_INITIALIZER,
-          "Field '#{fieldName}' is initialized more than once."),
-
-      MessageKind.ALREADY_INITIALIZED:
-        const MessageTemplate(MessageKind.ALREADY_INITIALIZED,
-          "'#{fieldName}' was already initialized here."),
-
-      MessageKind.INIT_STATIC_FIELD:
-        const MessageTemplate(MessageKind.INIT_STATIC_FIELD,
-          "Cannot initialize static field '#{fieldName}'."),
-
-      MessageKind.NOT_A_FIELD:
-        const MessageTemplate(MessageKind.NOT_A_FIELD,
-          "'#{fieldName}' is not a field."),
-
-      MessageKind.CONSTRUCTOR_CALL_EXPECTED:
-        const MessageTemplate(MessageKind.CONSTRUCTOR_CALL_EXPECTED,
-          "only call to 'this' or 'super' constructor allowed."),
-
-      MessageKind.INVALID_FOR_IN:
-        const MessageTemplate(MessageKind.INVALID_FOR_IN,
-          "Invalid for-in variable declaration."),
-
-      MessageKind.INVALID_INITIALIZER:
-        const MessageTemplate(MessageKind.INVALID_INITIALIZER,
-          "Invalid initializer."),
-
-      MessageKind.FUNCTION_WITH_INITIALIZER:
-        const MessageTemplate(MessageKind.FUNCTION_WITH_INITIALIZER,
-          "Only constructors can have initializers."),
-
-      MessageKind.REDIRECTING_CONSTRUCTOR_CYCLE:
-        const MessageTemplate(MessageKind.REDIRECTING_CONSTRUCTOR_CYCLE,
-          "Cyclic constructor redirection."),
-
-      MessageKind.REDIRECTING_CONSTRUCTOR_HAS_BODY:
-        const MessageTemplate(MessageKind.REDIRECTING_CONSTRUCTOR_HAS_BODY,
-          "Redirecting constructor can't have a body."),
-
-      MessageKind.CONST_CONSTRUCTOR_HAS_BODY:
-        const MessageTemplate(MessageKind.CONST_CONSTRUCTOR_HAS_BODY,
-          "Const constructor or factory can't have a body.",
-          howToFix: "Remove the 'const' keyword or the body",
-          examples: const ["""
-class C {
-  const C() {}
-}
-
-main() => new C();"""]),
-
-      MessageKind.REDIRECTING_CONSTRUCTOR_HAS_INITIALIZER:
-        const MessageTemplate(
-          MessageKind.REDIRECTING_CONSTRUCTOR_HAS_INITIALIZER,
-          "Redirecting constructor cannot have other initializers."),
-
-      MessageKind.SUPER_INITIALIZER_IN_OBJECT:
-        const MessageTemplate(MessageKind.SUPER_INITIALIZER_IN_OBJECT,
-          "'Object' cannot have a super initializer."),
-
-      MessageKind.DUPLICATE_SUPER_INITIALIZER:
-        const MessageTemplate(MessageKind.DUPLICATE_SUPER_INITIALIZER,
-          "Cannot have more than one super initializer."),
-
-      MessageKind.INVALID_CONSTRUCTOR_ARGUMENTS:
-        const MessageTemplate(MessageKind.INVALID_CONSTRUCTOR_ARGUMENTS,
-          "Arguments do not match the expected parameters of constructor "
-          "'#{constructorName}'."),
-
-      MessageKind.NO_MATCHING_CONSTRUCTOR:
-        const MessageTemplate(MessageKind.NO_MATCHING_CONSTRUCTOR,
-          "'super' call arguments and constructor parameters do not match."),
-
-      MessageKind.NO_MATCHING_CONSTRUCTOR_FOR_IMPLICIT:
-        const MessageTemplate(MessageKind.NO_MATCHING_CONSTRUCTOR_FOR_IMPLICIT,
-              "Implicit 'super' call arguments and constructor parameters "
-              "do not match."),
-
-      MessageKind.CONST_CALLS_NON_CONST:
-        const MessageTemplate(MessageKind.CONST_CALLS_NON_CONST,
-          "'const' constructor cannot call a non-const constructor."),
-
-      MessageKind.CONST_CALLS_NON_CONST_FOR_IMPLICIT:
-        const MessageTemplate(MessageKind.CONST_CALLS_NON_CONST_FOR_IMPLICIT,
-              "'const' constructor cannot call a non-const constructor. "
-              "This constructor has an implicit call to a "
-              "super non-const constructor.",
-              howToFix: "Try making the super constructor const.",
-              examples: const ["""
-class C {
-  C(); // missing const
-}
-class D extends C {
-  final d;
-  const D(this.d);
-}
-main() => new D(0);"""]),
-
-      MessageKind.CONST_CONSTRUCTOR_WITH_NONFINAL_FIELDS:
-        const MessageTemplate(
-          MessageKind.CONST_CONSTRUCTOR_WITH_NONFINAL_FIELDS,
-          "Can't declare constructor 'const' on class #{className} "
-          "because the class contains non-final instance fields.",
-          howToFix: "Try making all fields final.",
-          examples: const ["""
-class C {
-  // 'a' must be declared final to allow for the const constructor.
-  var a;
-  const C(this.a);
-}
-
-main() => new C(0);"""]),
-
-      MessageKind.CONST_CONSTRUCTOR_WITH_NONFINAL_FIELDS_FIELD:
-        const MessageTemplate(
-          MessageKind.CONST_CONSTRUCTOR_WITH_NONFINAL_FIELDS_FIELD,
-          "This non-final field prevents using const constructors."),
-
-      MessageKind.CONST_CONSTRUCTOR_WITH_NONFINAL_FIELDS_CONSTRUCTOR:
-        const MessageTemplate(
-          MessageKind.CONST_CONSTRUCTOR_WITH_NONFINAL_FIELDS_CONSTRUCTOR,
-          "This const constructor is not allowed due to "
-          "non-final fields."),
-
-
-      MessageKind.INITIALIZING_FORMAL_NOT_ALLOWED:
-        const MessageTemplate(MessageKind.INITIALIZING_FORMAL_NOT_ALLOWED,
-          "Initializing formal parameter only allowed in generative "
-          "constructor."),
-
-      MessageKind.INVALID_PARAMETER:
-        const MessageTemplate(MessageKind.INVALID_PARAMETER,
-          "Cannot resolve parameter."),
-
-      MessageKind.NOT_INSTANCE_FIELD:
-        const MessageTemplate(MessageKind.NOT_INSTANCE_FIELD,
-          "'#{fieldName}' is not an instance field."),
-
-      MessageKind.THIS_PROPERTY:
-        const MessageTemplate(MessageKind.THIS_PROPERTY,
-          "Expected an identifier."),
-
-      MessageKind.NO_CATCH_NOR_FINALLY:
-        const MessageTemplate(MessageKind.NO_CATCH_NOR_FINALLY,
-          "Expected 'catch' or 'finally'."),
-
-      MessageKind.EMPTY_CATCH_DECLARATION:
-        const MessageTemplate(MessageKind.EMPTY_CATCH_DECLARATION,
-          "Expected an identifier in catch declaration."),
-
-      MessageKind.EXTRA_CATCH_DECLARATION:
-        const MessageTemplate(MessageKind.EXTRA_CATCH_DECLARATION,
-          "Extra parameter in catch declaration."),
-
-      MessageKind.PARAMETER_WITH_TYPE_IN_CATCH:
-        const MessageTemplate(MessageKind.PARAMETER_WITH_TYPE_IN_CATCH,
-          "Cannot use type annotations in catch."),
-
-      MessageKind.PARAMETER_WITH_MODIFIER_IN_CATCH:
-        const MessageTemplate(MessageKind.PARAMETER_WITH_MODIFIER_IN_CATCH,
-          "Cannot use modifiers in catch."),
-
-      MessageKind.OPTIONAL_PARAMETER_IN_CATCH:
-        const MessageTemplate(MessageKind.OPTIONAL_PARAMETER_IN_CATCH,
-          "Cannot use optional parameters in catch."),
-
-      MessageKind.THROW_WITHOUT_EXPRESSION:
-        const MessageTemplate(MessageKind.THROW_WITHOUT_EXPRESSION,
-          "Cannot use re-throw outside of catch block "
-          "(expression expected after 'throw')."),
-
-      MessageKind.UNBOUND_LABEL:
-        const MessageTemplate(MessageKind.UNBOUND_LABEL,
-          "Cannot resolve label '#{labelName}'."),
-
-      MessageKind.NO_BREAK_TARGET:
-        const MessageTemplate(MessageKind.NO_BREAK_TARGET,
-          "'break' statement not inside switch or loop."),
-
-      MessageKind.NO_CONTINUE_TARGET:
-        const MessageTemplate(MessageKind.NO_CONTINUE_TARGET,
-          "'continue' statement not inside loop."),
-
-      MessageKind.EXISTING_LABEL:
-        const MessageTemplate(MessageKind.EXISTING_LABEL,
-          "Original declaration of duplicate label '#{labelName}'."),
-
-      MessageKind.DUPLICATE_LABEL:
-        const MessageTemplate(MessageKind.DUPLICATE_LABEL,
-          "Duplicate declaration of label '#{labelName}'."),
-
-      MessageKind.UNUSED_LABEL:
-        const MessageTemplate(MessageKind.UNUSED_LABEL,
-          "Unused label '#{labelName}'."),
-
-      MessageKind.INVALID_CONTINUE:
-        const MessageTemplate(MessageKind.INVALID_CONTINUE,
-          "Target of continue is not a loop or switch case."),
-
-      MessageKind.INVALID_BREAK:
-        const MessageTemplate(MessageKind.INVALID_BREAK,
-          "Target of break is not a statement."),
-
-      MessageKind.DUPLICATE_TYPE_VARIABLE_NAME:
-        const MessageTemplate(MessageKind.DUPLICATE_TYPE_VARIABLE_NAME,
-          "Type variable '#{typeVariableName}' already declared."),
-
-      MessageKind.TYPE_VARIABLE_WITHIN_STATIC_MEMBER:
-        const MessageTemplate(MessageKind.TYPE_VARIABLE_WITHIN_STATIC_MEMBER,
-              "Cannot refer to type variable '#{typeVariableName}' "
-              "within a static member."),
-
-      MessageKind.TYPE_VARIABLE_IN_CONSTANT:
-        const MessageTemplate(MessageKind.TYPE_VARIABLE_IN_CONSTANT,
-          "Constant expressions can't refer to type variables.",
-          howToFix: "Try removing the type variable or replacing it with a "
-                    "concrete type.",
-          examples: const ["""
-class C<T> {
-  const C();
-
-  m(T t) => const C<T>();
-}
-
-void main() => new C().m(null);
-"""
-]),
-
-      MessageKind.INVALID_TYPE_VARIABLE_BOUND:
-        const MessageTemplate(MessageKind.INVALID_TYPE_VARIABLE_BOUND,
-          "'#{typeArgument}' is not a subtype of bound '#{bound}' for "
-          "type variable '#{typeVariable}' of type '#{thisType}'.",
-          howToFix: "Try to change or remove the type argument.",
-          examples: const ["""
-class C<T extends num> {}
-
-// 'String' is not a valid instantiation of T with bound num.'.
-main() => new C<String>();
-"""]),
-
-      MessageKind.INVALID_USE_OF_SUPER:
-        const MessageTemplate(MessageKind.INVALID_USE_OF_SUPER,
-          "'super' not allowed here."),
-
-      MessageKind.INVALID_CASE_DEFAULT:
-        const MessageTemplate(MessageKind.INVALID_CASE_DEFAULT,
-          "'default' only allowed on last case of a switch."),
-
-      MessageKind.SWITCH_CASE_TYPES_NOT_EQUAL:
-        const MessageTemplate(MessageKind.SWITCH_CASE_TYPES_NOT_EQUAL,
-          "'case' expressions do not all have type '#{type}'."),
-
-      MessageKind.SWITCH_CASE_TYPES_NOT_EQUAL_CASE:
-        const MessageTemplate(MessageKind.SWITCH_CASE_TYPES_NOT_EQUAL_CASE,
-          "'case' expression of type '#{type}'."),
-
-      MessageKind.SWITCH_CASE_FORBIDDEN:
-        const MessageTemplate(MessageKind.SWITCH_CASE_FORBIDDEN,
-          "'case' expression may not be of type '#{type}'."),
-
-      MessageKind.SWITCH_CASE_VALUE_OVERRIDES_EQUALS:
-        const MessageTemplate(MessageKind.SWITCH_CASE_VALUE_OVERRIDES_EQUALS,
-              "'case' expression type '#{type}' overrides 'operator =='."),
-
-      MessageKind.INVALID_ARGUMENT_AFTER_NAMED:
-        const MessageTemplate(MessageKind.INVALID_ARGUMENT_AFTER_NAMED,
-          "Unnamed argument after named argument."),
-
-      MessageKind.NOT_A_COMPILE_TIME_CONSTANT:
-        const MessageTemplate(MessageKind.NOT_A_COMPILE_TIME_CONSTANT,
-          "Not a compile-time constant."),
-
-      MessageKind.DEFERRED_COMPILE_TIME_CONSTANT:
-        const MessageTemplate(MessageKind.DEFERRED_COMPILE_TIME_CONSTANT,
-          "A deferred value cannot be used as a compile-time constant."),
-
-      MessageKind.DEFERRED_COMPILE_TIME_CONSTANT_CONSTRUCTION:
-        const MessageTemplate(
-          MessageKind.DEFERRED_COMPILE_TIME_CONSTANT_CONSTRUCTION,
-          "A deferred class cannot be used to create a "
-          "compile-time constant."),
-
-      MessageKind.CYCLIC_COMPILE_TIME_CONSTANTS:
-        const MessageTemplate(MessageKind.CYCLIC_COMPILE_TIME_CONSTANTS,
-          "Cycle in the compile-time constant computation."),
-
-      MessageKind.CONSTRUCTOR_IS_NOT_CONST:
-        const MessageTemplate(MessageKind.CONSTRUCTOR_IS_NOT_CONST,
-          "Constructor is not a 'const' constructor."),
-
-      MessageKind.CONST_MAP_KEY_OVERRIDES_EQUALS:
-        const MessageTemplate(MessageKind.CONST_MAP_KEY_OVERRIDES_EQUALS,
-              "Const-map key type '#{type}' overrides 'operator =='."),
-
-      MessageKind.NO_SUCH_LIBRARY_MEMBER:
-        const MessageTemplate(MessageKind.NO_SUCH_LIBRARY_MEMBER,
-          "'#{libraryName}' has no member named '#{memberName}'."),
-
-      MessageKind.CANNOT_INSTANTIATE_TYPEDEF:
-        const MessageTemplate(MessageKind.CANNOT_INSTANTIATE_TYPEDEF,
-          "Cannot instantiate typedef '#{typedefName}'."),
-
-      MessageKind.REQUIRED_PARAMETER_WITH_DEFAULT:
-        const MessageTemplate(MessageKind.REQUIRED_PARAMETER_WITH_DEFAULT,
-          "Non-optional parameters can't have a default value.",
-          howToFix:
-            "Try removing the default value or making the parameter optional.",
-          examples: const ["""
-main() {
-  foo(a: 1) => print(a);
-  foo(2);
-}""", """
-main() {
-  foo(a = 1) => print(a);
-  foo(2);
-}"""]),
-
-      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 "
-          "default value.",
-          howToFix: "Try replacing ':' with '='.",
-          examples: const ["""
-main() {
-  foo([a: 1]) => print(a);
-  foo(2);
-}"""]),
-
-      MessageKind.TYPEDEF_FORMAL_WITH_DEFAULT:
-        const MessageTemplate(MessageKind.TYPEDEF_FORMAL_WITH_DEFAULT,
-          "A parameter of a typedef can't specify a default value.",
-          howToFix:
-            "Try removing the default value.",
-          examples: const ["""
-typedef void F([int arg = 0]);
-
-main() {
-  F f;
-}""", """
-typedef void F({int arg: 0});
-
-main() {
-  F f;
-}"""]),
-
-      MessageKind.FUNCTION_TYPE_FORMAL_WITH_DEFAULT:
-        const MessageTemplate(MessageKind.FUNCTION_TYPE_FORMAL_WITH_DEFAULT,
-          "A function type parameter can't specify a default value.",
-          howToFix:
-            "Try removing the default value.",
-          examples: const ["""
-foo(f(int i, [a = 1])) {}
-
-main() {
-  foo(1, 2);
-}""", """
-foo(f(int i, {a: 1})) {}
-
-main() {
-  foo(1, a: 2);
-}"""]),
-
-      MessageKind.REDIRECTING_FACTORY_WITH_DEFAULT:
-        const MessageTemplate(MessageKind.REDIRECTING_FACTORY_WITH_DEFAULT,
-          "A parameter of a redirecting factory constructor can't specify a "
-          "default value.",
-          howToFix:
-            "Try removing the default value.",
-          examples: const ["""
-class A {
-  A([a]);
-  factory A.foo([a = 1]) = A;
-}
-
-main() {
-  new A.foo(1);
-}""", """
-class A {
-  A({a});
-  factory A.foo({a: 1}) = A;
-}
-
-main() {
-  new A.foo(a: 1);
-}"""]),
-
-      MessageKind.FORMAL_DECLARED_CONST:
-        const MessageTemplate(MessageKind.FORMAL_DECLARED_CONST,
-          "A formal parameter can't be declared const.",
-          howToFix: "Try removing 'const'.",
-          examples: const ["""
-foo(const x) {}
-main() => foo(42);
-""", """
-foo({const x}) {}
-main() => foo(42);
-""", """
-foo([const x]) {}
-main() => foo(42);
-"""]),
-
-      MessageKind.FORMAL_DECLARED_STATIC:
-        const MessageTemplate(MessageKind.FORMAL_DECLARED_STATIC,
-          "A formal parameter can't be declared static.",
-          howToFix: "Try removing 'static'.",
-          examples: const ["""
-foo(static x) {}
-main() => foo(42);
-""", """
-foo({static x}) {}
-main() => foo(42);
-""", """
-foo([static x]) {}
-main() => foo(42);
-"""]),
-
-      MessageKind.FINAL_FUNCTION_TYPE_PARAMETER:
-        const MessageTemplate(MessageKind.FINAL_FUNCTION_TYPE_PARAMETER,
-          "A function type parameter can't be declared final.",
-          howToFix: "Try removing 'final'.",
-          examples: const ["""
-foo(final int x(int a)) {}
-main() => foo((y) => 42);
-""", """
-foo({final int x(int a)}) {}
-main() => foo((y) => 42);
-""", """
-foo([final int x(int a)]) {}
-main() => foo((y) => 42);
-"""]),
-
-      MessageKind.VAR_FUNCTION_TYPE_PARAMETER:
-        const MessageTemplate(MessageKind.VAR_FUNCTION_TYPE_PARAMETER,
-          "A function type parameter can't be declared with 'var'.",
-          howToFix: "Try removing 'var'.",
-          examples: const ["""
-foo(var int x(int a)) {}
-main() => foo((y) => 42);
-""", """
-foo({var int x(int a)}) {}
-main() => foo((y) => 42);
-""", """
-foo([var int x(int a)]) {}
-main() => foo((y) => 42);
-"""]),
-
-      MessageKind.CANNOT_INSTANTIATE_TYPE_VARIABLE:
-        const MessageTemplate(MessageKind.CANNOT_INSTANTIATE_TYPE_VARIABLE,
-          "Cannot instantiate type variable '#{typeVariableName}'."),
-
-      MessageKind.CYCLIC_TYPE_VARIABLE:
-        const MessageTemplate(MessageKind.CYCLIC_TYPE_VARIABLE,
-          "Type variable '#{typeVariableName}' is a supertype of itself."),
-
-      MessageKind.CYCLIC_TYPEDEF:
-        const MessageTemplate(MessageKind.CYCLIC_TYPEDEF,
-          "A typedef can't refer to itself.",
-          howToFix: "Try removing all references to '#{typedefName}' "
-                    "in the definition of '#{typedefName}'.",
-          examples: const ["""
-typedef F F(); // The return type 'F' is a self-reference.
-main() { F f = null; }"""]),
-
-      MessageKind.CYCLIC_TYPEDEF_ONE:
-        const MessageTemplate(MessageKind.CYCLIC_TYPEDEF_ONE,
-          "A typedef can't refer to itself through another typedef.",
-          howToFix:
-            "Try removing all references to "
-            "'#{otherTypedefName}' in the definition of '#{typedefName}'.",
-          examples: const ["""
-typedef G F(); // The return type 'G' is a self-reference through typedef 'G'.
-typedef F G(); // The return type 'F' is a self-reference through typedef 'F'.
-main() { F f = null; }""",
-"""
-typedef G F(); // The return type 'G' creates a self-reference.
-typedef H G(); // The return type 'H' creates a self-reference.
-typedef H(F f); // The argument type 'F' creates a self-reference.
-main() { F f = null; }"""]),
-
-      MessageKind.CLASS_NAME_EXPECTED:
-        const MessageTemplate(MessageKind.CLASS_NAME_EXPECTED,
-          "Class name expected."),
-
-      MessageKind.CANNOT_EXTEND:
-        const MessageTemplate(MessageKind.CANNOT_EXTEND,
-          "'#{type}' cannot be extended."),
-
-      MessageKind.CANNOT_IMPLEMENT:
-        const MessageTemplate(MessageKind.CANNOT_IMPLEMENT,
-          "'#{type}' cannot be implemented."),
-
-      // TODO(johnnwinther): Split messages into reasons for malformedness.
-      MessageKind.CANNOT_EXTEND_MALFORMED:
-        const MessageTemplate(MessageKind.CANNOT_EXTEND_MALFORMED,
-          "Class '#{className}' can't extend the type '#{malformedType}' "
-          "because it is malformed.",
-          howToFix:
-            "Try correcting the malformed type annotation or removing the "
-            "'extends' clause.",
-          examples: const ["""
-class A extends Malformed {}
-main() => new A();"""]),
-
-      MessageKind.CANNOT_IMPLEMENT_MALFORMED:
-        const MessageTemplate(MessageKind.CANNOT_IMPLEMENT_MALFORMED,
-          "Class '#{className}' can't implement the type '#{malformedType}' "
-          "because it is malformed.",
-          howToFix:
-            "Try correcting the malformed type annotation or removing the "
-            "type from the 'implements' clause.",
-          examples: const ["""
-class A implements Malformed {}
-main() => new A();"""]),
-
-      MessageKind.CANNOT_MIXIN_MALFORMED:
-        const MessageTemplate(MessageKind.CANNOT_MIXIN_MALFORMED,
-          "Class '#{className}' can't mixin the type '#{malformedType}' "
-          "because it is malformed.",
-          howToFix:
-            "Try correcting the malformed type annotation or removing the "
-            "type from the 'with' clause.",
-          examples: const ["""
-class A extends Object with Malformed {}
-main() => new A();"""]),
-
-      MessageKind.CANNOT_MIXIN:
-        const MessageTemplate(MessageKind.CANNOT_MIXIN,
-          "The type '#{type}' can't be mixed in.",
-          howToFix: "Try removing '#{type}' from the 'with' clause.",
-          examples: const ["""
-class C extends Object with String {}
-
-main() => new C();
-""", """
-typedef C = Object with String;
-
-main() => new C();
-"""]),
-
-      MessageKind.CANNOT_EXTEND_ENUM:
-        const MessageTemplate(MessageKind.CANNOT_EXTEND_ENUM,
-          "Class '#{className}' can't extend the type '#{enumType}' because "
-          "it is declared by an enum.",
-          howToFix: "Try making '#{enumType}' a normal class or removing the "
-            "'extends' clause.",
-          examples: const ["""
-enum Enum { A }
-class B extends Enum {}
-main() => new B();"""]),
-
-      MessageKind.CANNOT_IMPLEMENT_ENUM:
-        const MessageTemplate(MessageKind.CANNOT_IMPLEMENT_ENUM,
-          "Class '#{className}' can't implement the type '#{enumType}' "
-          "because it is declared by an enum.",
-          howToFix: "Try making '#{enumType}' a normal class or removing the "
-            "type from the 'implements' clause.",
-          examples: const ["""
-enum Enum { A }
-class B implements Enum {}
-main() => new B();"""]),
-
-      MessageKind.CANNOT_MIXIN_ENUM:
-        const MessageTemplate(MessageKind.CANNOT_MIXIN_ENUM,
-          "Class '#{className}' can't mixin the type '#{enumType}' because it "
-          "is declared by an enum.",
-          howToFix: "Try making '#{enumType}' a normal class or removing the "
-            "type from the 'with' clause.",
-          examples: const ["""
-enum Enum { A }
-class B extends Object with Enum {}
-main() => new B();"""]),
-
-      MessageKind.CANNOT_INSTANTIATE_ENUM:
-        const MessageTemplate(MessageKind.CANNOT_INSTANTIATE_ENUM,
-          "Enum type '#{enumName}' cannot be instantiated.",
-          howToFix: "Try making '#{enumType}' a normal class or use an enum "
-                    "constant.",
-          examples: const ["""
-enum Enum { A }
-main() => new Enum(0);""", """
-enum Enum { A }
-main() => const Enum(0);"""]),
-
-      MessageKind.EMPTY_ENUM_DECLARATION:
-        const MessageTemplate(MessageKind.EMPTY_ENUM_DECLARATION,
-          "Enum '#{enumName}' must contain at least one value.",
-          howToFix: "Try adding an enum constant or making #{enumName} a "
-                    "normal class.",
-          examples: const ["""
-enum Enum {}
-main() { Enum e; }"""]),
-
-      MessageKind.MISSING_ENUM_CASES:
-        const MessageTemplate(MessageKind.MISSING_ENUM_CASES,
-          "Missing enum constants in switch statement: #{enumValues}.",
-          howToFix: "Try adding the missing constants or a default case.",
-          examples: const ["""
-enum Enum { A, B }
-main() {
-  switch (Enum.A) {
-  case Enum.B: break;
-  }
-}""", """
-enum Enum { A, B, C }
-main() {
-  switch (Enum.A) {
-  case Enum.B: break;
-  }
-}"""]),
-
-      MessageKind.DUPLICATE_EXTENDS_IMPLEMENTS:
-        const MessageTemplate(MessageKind.DUPLICATE_EXTENDS_IMPLEMENTS,
-          "'#{type}' can not be both extended and implemented."),
-
-      MessageKind.DUPLICATE_IMPLEMENTS:
-        const MessageTemplate(MessageKind.DUPLICATE_IMPLEMENTS,
-          "'#{type}' must not occur more than once "
-          "in the implements clause."),
-
-      MessageKind.MULTI_INHERITANCE:
-        const MessageTemplate(MessageKind.MULTI_INHERITANCE,
-          "Dart2js does not currently support inheritance of the same class "
-          "with different type arguments: Both #{firstType} and #{secondType} "
-          "are supertypes of #{thisType}."),
-
-      MessageKind.ILLEGAL_SUPER_SEND:
-        const MessageTemplate(MessageKind.ILLEGAL_SUPER_SEND,
-          "'#{name}' cannot be called on super."),
-
-      MessageKind.NO_SUCH_SUPER_MEMBER:
-        const MessageTemplate(MessageKind.NO_SUCH_SUPER_MEMBER,
-          "Cannot resolve '#{memberName}' in a superclass of '#{className}'."),
-
-      MessageKind.ADDITIONAL_TYPE_ARGUMENT:
-        const MessageTemplate(MessageKind.ADDITIONAL_TYPE_ARGUMENT,
-          "Additional type argument."),
-
-      MessageKind.MISSING_TYPE_ARGUMENT:
-        const MessageTemplate(MessageKind.MISSING_TYPE_ARGUMENT,
-          "Missing type argument."),
-
-      // TODO(johnniwinther): Use ADDITIONAL_TYPE_ARGUMENT or
-      // MISSING_TYPE_ARGUMENT instead.
-      MessageKind.TYPE_ARGUMENT_COUNT_MISMATCH:
-        const MessageTemplate(MessageKind.TYPE_ARGUMENT_COUNT_MISMATCH,
-          "Incorrect number of type arguments on '#{type}'."),
-
-      MessageKind.GETTER_MISMATCH:
-        const MessageTemplate(MessageKind.GETTER_MISMATCH,
-          "Setter disagrees on: '#{modifiers}'."),
-
-      MessageKind.SETTER_MISMATCH:
-        const MessageTemplate(MessageKind.SETTER_MISMATCH,
-          "Getter disagrees on: '#{modifiers}'."),
-
-      MessageKind.ILLEGAL_SETTER_FORMALS:
-        const MessageTemplate(MessageKind.ILLEGAL_SETTER_FORMALS,
-          "A setter must have exactly one argument."),
-
-      MessageKind.NO_STATIC_OVERRIDE:
-        const MessageTemplate(MessageKind.NO_STATIC_OVERRIDE,
-          "Static member cannot override instance member '#{memberName}' of "
-          "'#{className}'."),
-
-      MessageKind.NO_STATIC_OVERRIDE_CONT:
-        const MessageTemplate(MessageKind.NO_STATIC_OVERRIDE_CONT,
-          "This is the instance member that cannot be overridden "
-          "by a static member."),
-
-      MessageKind.INSTANCE_STATIC_SAME_NAME:
-        const MessageTemplate(MessageKind.INSTANCE_STATIC_SAME_NAME,
-          "Instance member '#{memberName}' and static member of "
-          "superclass '#{className}' have the same name."),
-
-      MessageKind.INSTANCE_STATIC_SAME_NAME_CONT:
-        const MessageTemplate(MessageKind.INSTANCE_STATIC_SAME_NAME_CONT,
-          "This is the static member with the same name."),
-
-      MessageKind.INVALID_OVERRIDE_METHOD:
-        const MessageTemplate(MessageKind.INVALID_OVERRIDE_METHOD,
-          "The type '#{declaredType}' of method '#{name}' declared in "
-          "'#{class}' is not a subtype of the overridden method type "
-          "'#{inheritedType}' inherited from '#{inheritedClass}'."),
-
-      MessageKind.INVALID_OVERRIDDEN_METHOD:
-        const MessageTemplate(MessageKind.INVALID_OVERRIDDEN_METHOD,
-          "This is the overridden method '#{name}' declared in class "
-          "'#{class}'."),
-
-      MessageKind.INVALID_OVERRIDE_GETTER:
-        const MessageTemplate(MessageKind.INVALID_OVERRIDE_GETTER,
-          "The type '#{declaredType}' of getter '#{name}' declared in "
-          "'#{class}' is not assignable to the type '#{inheritedType}' of the "
-          "overridden getter inherited from '#{inheritedClass}'."),
-
-      MessageKind.INVALID_OVERRIDDEN_GETTER:
-        const MessageTemplate(MessageKind.INVALID_OVERRIDDEN_GETTER,
-          "This is the overridden getter '#{name}' declared in class "
-          "'#{class}'."),
-
-      MessageKind.INVALID_OVERRIDE_GETTER_WITH_FIELD:
-        const MessageTemplate(MessageKind.INVALID_OVERRIDE_GETTER_WITH_FIELD,
-          "The type '#{declaredType}' of field '#{name}' declared in "
-          "'#{class}' is not assignable to the type '#{inheritedType}' of the "
-          "overridden getter inherited from '#{inheritedClass}'."),
-
-      MessageKind.INVALID_OVERRIDE_FIELD_WITH_GETTER:
-        const MessageTemplate(MessageKind.INVALID_OVERRIDE_FIELD_WITH_GETTER,
-          "The type '#{declaredType}' of getter '#{name}' declared in "
-          "'#{class}' is not assignable to the type '#{inheritedType}' of the "
-          "overridden field inherited from '#{inheritedClass}'."),
-
-      MessageKind.INVALID_OVERRIDE_SETTER:
-        const MessageTemplate(MessageKind.INVALID_OVERRIDE_SETTER,
-          "The type '#{declaredType}' of setter '#{name}' declared in "
-          "'#{class}' is not assignable to the type '#{inheritedType}' of the "
-          "overridden setter inherited from '#{inheritedClass}'."),
-
-      MessageKind.INVALID_OVERRIDDEN_SETTER:
-        const MessageTemplate(MessageKind.INVALID_OVERRIDDEN_SETTER,
-          "This is the overridden setter '#{name}' declared in class "
-          "'#{class}'."),
-
-      MessageKind.INVALID_OVERRIDE_SETTER_WITH_FIELD:
-        const MessageTemplate(MessageKind.INVALID_OVERRIDE_SETTER_WITH_FIELD,
-          "The type '#{declaredType}' of field '#{name}' declared in "
-          "'#{class}' is not assignable to the type '#{inheritedType}' of the "
-          "overridden setter inherited from '#{inheritedClass}'."),
-
-      MessageKind.INVALID_OVERRIDE_FIELD_WITH_SETTER:
-        const MessageTemplate(MessageKind.INVALID_OVERRIDE_FIELD_WITH_SETTER,
-          "The type '#{declaredType}' of setter '#{name}' declared in "
-          "'#{class}' is not assignable to the type '#{inheritedType}' of the "
-          "overridden field inherited from '#{inheritedClass}'."),
-
-      MessageKind.INVALID_OVERRIDE_FIELD:
-        const MessageTemplate(MessageKind.INVALID_OVERRIDE_FIELD,
-          "The type '#{declaredType}' of field '#{name}' declared in "
-          "'#{class}' is not assignable to the type '#{inheritedType}' of the "
-          "overridden field inherited from '#{inheritedClass}'."),
-
-      MessageKind.INVALID_OVERRIDDEN_FIELD:
-        const MessageTemplate(MessageKind.INVALID_OVERRIDDEN_FIELD,
-          "This is the overridden field '#{name}' declared in class "
-          "'#{class}'."),
-
-      MessageKind.CANNOT_OVERRIDE_FIELD_WITH_METHOD:
-        const MessageTemplate(MessageKind.CANNOT_OVERRIDE_FIELD_WITH_METHOD,
-          "Method '#{name}' in '#{class}' can't override field from "
-          "'#{inheritedClass}'."),
-
-      MessageKind.CANNOT_OVERRIDE_FIELD_WITH_METHOD_CONT:
-        const MessageTemplate(
-          MessageKind.CANNOT_OVERRIDE_FIELD_WITH_METHOD_CONT,
-          "This is the field that cannot be overridden by a method."),
-
-      MessageKind.CANNOT_OVERRIDE_METHOD_WITH_FIELD:
-        const MessageTemplate(
-          MessageKind.CANNOT_OVERRIDE_METHOD_WITH_FIELD,
-          "Field '#{name}' in '#{class}' can't override method from "
-          "'#{inheritedClass}'."),
-
-      MessageKind.CANNOT_OVERRIDE_METHOD_WITH_FIELD_CONT:
-        const MessageTemplate(
-          MessageKind.CANNOT_OVERRIDE_METHOD_WITH_FIELD_CONT,
-          "This is the method that cannot be overridden by a field."),
-
-      MessageKind.CANNOT_OVERRIDE_GETTER_WITH_METHOD:
-        const MessageTemplate(MessageKind.CANNOT_OVERRIDE_GETTER_WITH_METHOD,
-              "Method '#{name}' in '#{class}' can't override getter from "
-              "'#{inheritedClass}'."),
-
-      MessageKind.CANNOT_OVERRIDE_GETTER_WITH_METHOD_CONT:
-        const MessageTemplate(
-          MessageKind.CANNOT_OVERRIDE_GETTER_WITH_METHOD_CONT,
-          "This is the getter that cannot be overridden by a method."),
-
-      MessageKind.CANNOT_OVERRIDE_METHOD_WITH_GETTER:
-        const MessageTemplate(MessageKind.CANNOT_OVERRIDE_METHOD_WITH_GETTER,
-          "Getter '#{name}' in '#{class}' can't override method from "
-          "'#{inheritedClass}'."),
-
-      MessageKind.CANNOT_OVERRIDE_METHOD_WITH_GETTER_CONT:
-        const MessageTemplate(
-          MessageKind.CANNOT_OVERRIDE_METHOD_WITH_GETTER_CONT,
-          "This is the method that cannot be overridden by a getter."),
-
-      MessageKind.MISSING_FORMALS:
-        const MessageTemplate(MessageKind.MISSING_FORMALS,
-          "Formal parameters are missing."),
-
-      MessageKind.EXTRA_FORMALS:
-        const MessageTemplate(MessageKind.EXTRA_FORMALS,
-          "Formal parameters are not allowed here."),
-
-      MessageKind.UNARY_OPERATOR_BAD_ARITY:
-        const MessageTemplate(MessageKind.UNARY_OPERATOR_BAD_ARITY,
-          "Operator '#{operatorName}' must have no parameters."),
-
-      MessageKind.MINUS_OPERATOR_BAD_ARITY:
-        const MessageTemplate(MessageKind.MINUS_OPERATOR_BAD_ARITY,
-          "Operator '-' must have 0 or 1 parameters."),
-
-      MessageKind.BINARY_OPERATOR_BAD_ARITY:
-        const MessageTemplate(MessageKind.BINARY_OPERATOR_BAD_ARITY,
-          "Operator '#{operatorName}' must have exactly 1 parameter."),
-
-      MessageKind.TERNARY_OPERATOR_BAD_ARITY:
-        const MessageTemplate(MessageKind.TERNARY_OPERATOR_BAD_ARITY,
-          "Operator '#{operatorName}' must have exactly 2 parameters."),
-
-      MessageKind.OPERATOR_OPTIONAL_PARAMETERS:
-        const MessageTemplate(MessageKind.OPERATOR_OPTIONAL_PARAMETERS,
-          "Operator '#{operatorName}' cannot have optional parameters."),
-
-      MessageKind.OPERATOR_NAMED_PARAMETERS:
-        const MessageTemplate(MessageKind.OPERATOR_NAMED_PARAMETERS,
-          "Operator '#{operatorName}' cannot have named parameters."),
-
-      MessageKind.CONSTRUCTOR_WITH_RETURN_TYPE:
-        const MessageTemplate(MessageKind.CONSTRUCTOR_WITH_RETURN_TYPE,
-          "Cannot have return type for constructor."),
-
-      MessageKind.CANNOT_RETURN_FROM_CONSTRUCTOR:
-        const MessageTemplate(MessageKind.CANNOT_RETURN_FROM_CONSTRUCTOR,
-          "Constructors can't return values.",
-          howToFix: "Remove the return statement or use a factory constructor.",
-          examples: const ["""
-class C {
-  C() {
-    return 1;
-  }
-}
-
-main() => new C();"""]),
-
-      MessageKind.ILLEGAL_FINAL_METHOD_MODIFIER:
-        const MessageTemplate(MessageKind.ILLEGAL_FINAL_METHOD_MODIFIER,
-          "Cannot have final modifier on method."),
-
-      MessageKind.ILLEGAL_CONST_FIELD_MODIFIER:
-        const MessageTemplate(MessageKind.ILLEGAL_CONST_FIELD_MODIFIER,
-          "Cannot have const modifier on non-static field.",
-          howToFix:
-            "Try adding a static modifier, or removing the const modifier.",
-          examples: const ["""
-class C {
-  const int a = 1;
-}
-
-main() => new C();"""]),
-
-      MessageKind.ILLEGAL_CONSTRUCTOR_MODIFIERS:
-        const MessageTemplate(MessageKind.ILLEGAL_CONSTRUCTOR_MODIFIERS,
-          "Illegal constructor modifiers: '#{modifiers}'."),
-
-      MessageKind.ILLEGAL_MIXIN_APPLICATION_MODIFIERS:
-        const MessageTemplate(MessageKind.ILLEGAL_MIXIN_APPLICATION_MODIFIERS,
-              "Illegal mixin application modifiers: '#{modifiers}'."),
-
-      MessageKind.ILLEGAL_MIXIN_SUPERCLASS:
-        const MessageTemplate(MessageKind.ILLEGAL_MIXIN_SUPERCLASS,
-          "Class used as mixin must have Object as superclass."),
-
-      MessageKind.ILLEGAL_MIXIN_OBJECT:
-        const MessageTemplate(MessageKind.ILLEGAL_MIXIN_OBJECT,
-          "Cannot use Object as mixin."),
-
-      MessageKind.ILLEGAL_MIXIN_CONSTRUCTOR:
-        const MessageTemplate(MessageKind.ILLEGAL_MIXIN_CONSTRUCTOR,
-          "Class used as mixin cannot have non-factory constructor."),
-
-      MessageKind.ILLEGAL_MIXIN_CYCLE:
-        const MessageTemplate(MessageKind.ILLEGAL_MIXIN_CYCLE,
-          "Class used as mixin introduces mixin cycle: "
-          "'#{mixinName1}' <-> '#{mixinName2}'."),
-
-      MessageKind.ILLEGAL_MIXIN_WITH_SUPER:
-        const MessageTemplate(MessageKind.ILLEGAL_MIXIN_WITH_SUPER,
-          "Cannot use class '#{className}' as a mixin because it uses "
-          "'super'."),
-
-      MessageKind.ILLEGAL_MIXIN_SUPER_USE:
-        const MessageTemplate(MessageKind.ILLEGAL_MIXIN_SUPER_USE,
-          "Use of 'super' in class used as mixin."),
-
-      MessageKind.PARAMETER_NAME_EXPECTED:
-        const MessageTemplate(MessageKind.PARAMETER_NAME_EXPECTED,
-          "parameter name expected."),
-
-      MessageKind.CANNOT_RESOLVE_GETTER:
-        const MessageTemplate(MessageKind.CANNOT_RESOLVE_GETTER,
-          "Cannot resolve getter."),
-
-      MessageKind.CANNOT_RESOLVE_SETTER:
-        const MessageTemplate(MessageKind.CANNOT_RESOLVE_SETTER,
-          "Cannot resolve setter."),
-
-      MessageKind.ASSIGNING_METHOD:
-        const MessageTemplate(MessageKind.ASSIGNING_METHOD,
-          "Cannot assign a value to a method."),
-
-      MessageKind.ASSIGNING_METHOD_IN_SUPER:
-        const MessageTemplate(MessageKind.ASSIGNING_METHOD_IN_SUPER,
-          "Cannot assign a value to method '#{name}' "
-          "in superclass '#{superclassName}'."),
-
-      MessageKind.ASSIGNING_TYPE:
-        const MessageTemplate(MessageKind.ASSIGNING_TYPE,
-          "Cannot assign a value to a type."),
-
-      MessageKind.IF_NULL_ASSIGNING_TYPE:
-        const MessageTemplate(MessageKind.IF_NULL_ASSIGNING_TYPE,
-          "Cannot assign a value to a type. Note that types are never null, "
-          "so this ??= assignment has no effect.",
-          howToFix: "Try removing the '??=' assignment.",
-          examples: const [
-              "class A {} main() { print(A ??= 3);}",
-          ]),
-
-      MessageKind.VOID_NOT_ALLOWED:
-        const MessageTemplate(MessageKind.VOID_NOT_ALLOWED,
-          "Type 'void' can't be used here because it isn't a return type.",
-          howToFix:
-            "Try removing 'void' keyword or replace it with 'var', 'final', "
-            "or a type.",
-          examples: const [
-              "void x; main() {}",
-              "foo(void x) {} main() { foo(null); }",
-          ]),
-
-      MessageKind.NULL_NOT_ALLOWED:
-        const MessageTemplate(MessageKind.NULL_NOT_ALLOWED,
-          "`null` can't be used here."),
-
-      MessageKind.BEFORE_TOP_LEVEL:
-        const MessageTemplate(MessageKind.BEFORE_TOP_LEVEL,
-          "Part header must come before top-level definitions."),
-
-      MessageKind.IMPORT_PART_OF:
-        const MessageTemplate(MessageKind.IMPORT_PART_OF,
-          "The imported library must not have a 'part-of' directive.",
-          howToFix: "Try removing the 'part-of' directive or replacing the "
-                    "import of the library with a 'part' directive.",
-          examples: const [const {
-'main.dart': """
-library library;
-
-import 'part.dart';
-
-main() {}
-""",
-
-'part.dart': """
-part of library;
-"""}]),
-
-      MessageKind.LIBRARY_NAME_MISMATCH:
-        const MessageTemplate(MessageKind.LIBRARY_NAME_MISMATCH,
-          "Expected part of library name '#{libraryName}'.",
-          howToFix: "Try changing the directive to 'part of #{libraryName};'.",
-          examples: const [const {
-'main.dart': """
-library lib.foo;
-
-part 'part.dart';
-
-main() {}
-""",
-
-'part.dart': """
-part of lib.bar;
-"""}]),
-
-      MessageKind.MISSING_LIBRARY_NAME:
-        const MessageTemplate(MessageKind.MISSING_LIBRARY_NAME,
-          "Library has no name. Part directive expected library name "
-          "to be '#{libraryName}'.",
-          howToFix: "Try adding 'library #{libraryName};' to the library.",
-          examples: const [const {
-'main.dart': """
-part 'part.dart';
-
-main() {}
-""",
-
-'part.dart': """
-part of lib.foo;
-"""}]),
-
-      MessageKind.THIS_IS_THE_PART_OF_TAG:
-        const MessageTemplate(MessageKind.THIS_IS_THE_PART_OF_TAG,
-          "This is the part of directive."),
-
-      MessageKind.MISSING_PART_OF_TAG:
-        const MessageTemplate(MessageKind.MISSING_PART_OF_TAG,
-          "This file has no part-of tag, but it is being used as a part."),
-
-      MessageKind.DUPLICATED_PART_OF:
-        const MessageTemplate(MessageKind.DUPLICATED_PART_OF,
-          "Duplicated part-of directive."),
-
-      MessageKind.DUPLICATED_LIBRARY_NAME:
-        const MessageTemplate(MessageKind.DUPLICATED_LIBRARY_NAME,
-          "Duplicated library name '#{libraryName}'."),
-
-      MessageKind.DUPLICATED_RESOURCE:
-        const MessageTemplate(MessageKind.DUPLICATED_RESOURCE,
-          "The resource '#{resourceUri}' is loaded through both "
-          "'#{canonicalUri1}' and '#{canonicalUri2}'."),
-
-      MessageKind.DUPLICATED_LIBRARY_RESOURCE:
-        const MessageTemplate(MessageKind.DUPLICATED_LIBRARY_RESOURCE,
-          "The library '#{libraryName}' in '#{resourceUri}' is loaded through "
-          "both '#{canonicalUri1}' and '#{canonicalUri2}'."),
-
-      // This is used as an exception.
-      MessageKind.INVALID_SOURCE_FILE_LOCATION:
-        const MessageTemplate(MessageKind.INVALID_SOURCE_FILE_LOCATION, '''
-Invalid offset (#{offset}) in source map.
-File: #{fileName}
-Length: #{length}'''),
-
-      MessageKind.TOP_LEVEL_VARIABLE_DECLARED_STATIC:
-        const MessageTemplate(MessageKind.TOP_LEVEL_VARIABLE_DECLARED_STATIC,
-              "Top-level variable cannot be declared static."),
-
-      MessageKind.REFERENCE_IN_INITIALIZATION:
-        const MessageTemplate(MessageKind.REFERENCE_IN_INITIALIZATION,
-           "Variable '#{variableName}' is referenced during its "
-           "initialization.",
-           howToFix:
-             "If you are trying to reference a shadowed variable, rename "
-             "one of the variables.",
-           examples: const ["""
-foo(t) {
-  var t = t;
-  return t;
-}
-
-main() => foo(1);
-"""]),
-
-      MessageKind.CONST_WITHOUT_INITIALIZER:
-        const MessageTemplate(MessageKind.CONST_WITHOUT_INITIALIZER,
-          "A constant variable must be initialized.",
-          howToFix: "Try adding an initializer or "
-                    "removing the 'const' modifier.",
-          examples: const ["""
-void main() {
-  const c; // This constant variable must be initialized.
-}"""]),
-
-      MessageKind.FINAL_WITHOUT_INITIALIZER:
-        const MessageTemplate(MessageKind.FINAL_WITHOUT_INITIALIZER,
-          "A final variable must be initialized.",
-          howToFix: "Try adding an initializer or "
-                    "removing the 'final' modifier.",
-          examples: const [
-              "class C { static final field; } main() => C.field;"]),
-
-      MessageKind.MEMBER_USES_CLASS_NAME:
-        const MessageTemplate(MessageKind.MEMBER_USES_CLASS_NAME,
-          "Member variable can't have the same name as the class it is "
-          "declared in.",
-          howToFix: "Try renaming the variable.",
-          examples: const ["""
-class A { var A; }
-main() {
-  var a = new A();
-  a.A = 1;
-}
-""", """
-class A { static var A; }
-main() => A.A = 1;
-"""]),
-
-      MessageKind.WRONG_NUMBER_OF_ARGUMENTS_FOR_ASSERT:
-        const MessageTemplate(
-          MessageKind.WRONG_NUMBER_OF_ARGUMENTS_FOR_ASSERT,
-          "Wrong number of arguments to assert. Should be 1, but given "
-          "#{argumentCount}."),
-
-      MessageKind.ASSERT_IS_GIVEN_NAMED_ARGUMENTS:
-        const MessageTemplate(MessageKind.ASSERT_IS_GIVEN_NAMED_ARGUMENTS,
-          "'assert' takes no named arguments, but given #{argumentCount}."),
-
-      MessageKind.FACTORY_REDIRECTION_IN_NON_FACTORY:
-        const MessageTemplate(MessageKind.FACTORY_REDIRECTION_IN_NON_FACTORY,
-          "Factory redirection only allowed in factories."),
-
-      MessageKind.MISSING_FACTORY_KEYWORD:
-        const MessageTemplate(MessageKind.MISSING_FACTORY_KEYWORD,
-          "Did you forget a factory keyword here?"),
-
-      MessageKind.NO_SUCH_METHOD_IN_NATIVE:
-        const MessageTemplate(MessageKind.NO_SUCH_METHOD_IN_NATIVE,
-          "'NoSuchMethod' is not supported for classes that extend native "
-          "classes."),
-
-      MessageKind.DEFERRED_LIBRARY_DART_2_DART:
-        const MessageTemplate(MessageKind.DEFERRED_LIBRARY_DART_2_DART,
-          "Deferred loading is not supported by the dart backend yet. "
-          "The output will not be split."),
-
-      MessageKind.DEFERRED_LIBRARY_WITHOUT_PREFIX:
-        const MessageTemplate(MessageKind.DEFERRED_LIBRARY_WITHOUT_PREFIX,
-          "This import is deferred but there is no prefix keyword.",
-          howToFix: "Try adding a prefix to the import."),
-
-      MessageKind.DEFERRED_OLD_SYNTAX:
-        const MessageTemplate(MessageKind.DEFERRED_OLD_SYNTAX,
-          "The DeferredLibrary annotation is obsolete.",
-          howToFix:
-            "Use the \"import 'lib.dart' deferred as prefix\" syntax instead."),
-
-      MessageKind.DEFERRED_LIBRARY_DUPLICATE_PREFIX:
-        const MessageTemplate(MessageKind.DEFERRED_LIBRARY_DUPLICATE_PREFIX,
-          "The prefix of this deferred import is not unique.",
-          howToFix: "Try changing the import prefix."),
-
-      MessageKind.DEFERRED_TYPE_ANNOTATION:
-        const MessageTemplate(MessageKind.DEFERRED_TYPE_ANNOTATION,
-          "The type #{node} is deferred. "
-          "Deferred types are not valid as type annotations.",
-          howToFix:
-            "Try using a non-deferred abstract class as an interface."),
-
-      MessageKind.ILLEGAL_STATIC:
-        const MessageTemplate(MessageKind.ILLEGAL_STATIC,
-          "Modifier static is only allowed on functions declared in "
-          "a class."),
-
-      MessageKind.STATIC_FUNCTION_BLOAT:
-        const MessageTemplate(MessageKind.STATIC_FUNCTION_BLOAT,
-          "Using '#{class}.#{name}' may lead to unnecessarily large "
-          "generated code.",
-          howToFix:
-              "Try adding '@MirrorsUsed(...)' as described at "
-              "https://goo.gl/Akrrog."),
-
-      MessageKind.NON_CONST_BLOAT:
-        const MessageTemplate(MessageKind.NON_CONST_BLOAT,
-          "Using 'new #{name}' may lead to unnecessarily large generated "
-          "code.",
-          howToFix:
-              "Try using 'const #{name}' or adding '@MirrorsUsed(...)' as "
-              "described at https://goo.gl/Akrrog."),
-
-      MessageKind.STRING_EXPECTED:
-        const MessageTemplate(MessageKind.STRING_EXPECTED,
-          "Expected a 'String', but got an instance of '#{type}'."),
-
-      MessageKind.PRIVATE_IDENTIFIER:
-        const MessageTemplate(MessageKind.PRIVATE_IDENTIFIER,
-          "'#{value}' is not a valid Symbol name because it starts with "
-          "'_'."),
-
-      MessageKind.PRIVATE_NAMED_PARAMETER:
-        const MessageTemplate(MessageKind.PRIVATE_NAMED_PARAMETER,
-          "Named optional parameter can't have a library private name.",
-          howToFix:
-            "Try removing the '_' or making the parameter positional or "
-            "required.",
-          examples: const ["""foo({int _p}) {} main() => foo();"""]),
-
-      MessageKind.UNSUPPORTED_LITERAL_SYMBOL:
-        const MessageTemplate(MessageKind.UNSUPPORTED_LITERAL_SYMBOL,
-          "Symbol literal '##{value}' is currently unsupported by dart2js."),
-
-      MessageKind.INVALID_SYMBOL:
-        const MessageTemplate(MessageKind.INVALID_SYMBOL, '''
-'#{value}' is not a valid Symbol name because is not:
- * an empty String,
- * a user defined operator,
- * a qualified non-private identifier optionally followed by '=', or
- * a qualified non-private identifier followed by '.' and a user-defined '''
-"operator."),
-
-      MessageKind.AMBIGUOUS_REEXPORT:
-        const MessageTemplate(MessageKind.AMBIGUOUS_REEXPORT,
-          "'#{name}' is (re)exported by multiple libraries."),
-
-      MessageKind.AMBIGUOUS_LOCATION:
-        const MessageTemplate(MessageKind.AMBIGUOUS_LOCATION,
-          "'#{name}' is defined here."),
-
-      MessageKind.IMPORTED_HERE:
-        const MessageTemplate(MessageKind.IMPORTED_HERE,
-          "'#{name}' is imported here."),
-
-      MessageKind.OVERRIDE_EQUALS_NOT_HASH_CODE:
-        const MessageTemplate(MessageKind.OVERRIDE_EQUALS_NOT_HASH_CODE,
-          "The class '#{class}' overrides 'operator==', "
-          "but not 'get hashCode'."),
-
-      MessageKind.INTERNAL_LIBRARY_FROM:
-        const MessageTemplate(MessageKind.INTERNAL_LIBRARY_FROM,
-          "Internal library '#{resolvedUri}' is not accessible from "
-          "'#{importingUri}'."),
-
-      MessageKind.INTERNAL_LIBRARY:
-        const MessageTemplate(MessageKind.INTERNAL_LIBRARY,
-          "Internal library '#{resolvedUri}' is not accessible."),
-
-      MessageKind.LIBRARY_NOT_FOUND:
-        const MessageTemplate(MessageKind.LIBRARY_NOT_FOUND,
-          "Library not found '#{resolvedUri}'."),
-
-      MessageKind.UNSUPPORTED_EQ_EQ_EQ:
-        const MessageTemplate(MessageKind.UNSUPPORTED_EQ_EQ_EQ,
-          "'===' is not an operator. "
-          "Did you mean '#{lhs} == #{rhs}' or 'identical(#{lhs}, #{rhs})'?"),
-
-      MessageKind.UNSUPPORTED_BANG_EQ_EQ:
-        const MessageTemplate(MessageKind.UNSUPPORTED_BANG_EQ_EQ,
-          "'!==' is not an operator. "
-          "Did you mean '#{lhs} != #{rhs}' or '!identical(#{lhs}, #{rhs})'?"),
-
-      MessageKind.UNSUPPORTED_PREFIX_PLUS:
-        const MessageTemplate(MessageKind.UNSUPPORTED_PREFIX_PLUS,
-          "'+' is not a prefix operator. ",
-          howToFix: "Try removing '+'.",
-          examples: const [
-              "main() => +2;  // No longer a valid way to write '2'"
-          ]),
-
-      MessageKind.UNSUPPORTED_THROW_WITHOUT_EXP:
-        const MessageTemplate(MessageKind.UNSUPPORTED_THROW_WITHOUT_EXP,
-          "No expression after 'throw'. "
-          "Did you mean 'rethrow'?"),
-
-      MessageKind.DEPRECATED_TYPEDEF_MIXIN_SYNTAX:
-        const MessageTemplate(MessageKind.DEPRECATED_TYPEDEF_MIXIN_SYNTAX,
-          "'typedef' not allowed here. ",
-          howToFix: "Try replacing 'typedef' with 'class'.",
-          examples: const [
-              """
-class B { }
-class M1 {  }
-typedef C = B with M1;  // Need to replace 'typedef' with 'class'.
-main() { new C(); }
-"""]),
-
-      MessageKind.MIRRORS_EXPECTED_STRING:
-        const MessageTemplate(MessageKind.MIRRORS_EXPECTED_STRING,
-          "Can't use '#{name}' here because it's an instance of '#{type}' "
-          "and a 'String' value is expected.",
-          howToFix: "Did you forget to add quotes?",
-          examples: const [
-              """
-// 'Foo' is a type literal, not a string.
-@MirrorsUsed(symbols: const [Foo])
-import 'dart:mirrors';
-
-class Foo {}
-
-main() {}
-"""]),
-
-      MessageKind.MIRRORS_EXPECTED_STRING_OR_TYPE:
-        const MessageTemplate(MessageKind.MIRRORS_EXPECTED_STRING_OR_TYPE,
-          "Can't use '#{name}' here because it's an instance of '#{type}' "
-          "and a 'String' or 'Type' value is expected.",
-          howToFix: "Did you forget to add quotes?",
-          examples: const [
-              """
-// 'main' is a method, not a class.
-@MirrorsUsed(targets: const [main])
-import 'dart:mirrors';
-
-main() {}
-"""]),
-
-      MessageKind.MIRRORS_EXPECTED_STRING_OR_LIST:
-        const MessageTemplate(MessageKind.MIRRORS_EXPECTED_STRING_OR_LIST,
-          "Can't use '#{name}' here because it's an instance of '#{type}' "
-          "and a 'String' or 'List' value is expected.",
-          howToFix: "Did you forget to add quotes?",
-          examples: const [
-              """
-// 'Foo' is not a string.
-@MirrorsUsed(symbols: Foo)
-import 'dart:mirrors';
-
-class Foo {}
-
-main() {}
-"""]),
-
-      MessageKind.MIRRORS_EXPECTED_STRING_TYPE_OR_LIST:
-        const MessageTemplate(MessageKind.MIRRORS_EXPECTED_STRING_TYPE_OR_LIST,
-          "Can't use '#{name}' here because it's an instance of '#{type}' "
-          "but a 'String', 'Type', or 'List' value is expected.",
-          howToFix: "Did you forget to add quotes?",
-          examples: const [
-              """
-// '1' is not a string.
-@MirrorsUsed(targets: 1)
-import 'dart:mirrors';
-
-main() {}
-"""]),
-
-      MessageKind.MIRRORS_CANNOT_RESOLVE_IN_CURRENT_LIBRARY:
-        const MessageTemplate(
-          MessageKind.MIRRORS_CANNOT_RESOLVE_IN_CURRENT_LIBRARY,
-          "Can't find '#{name}' in the current library.",
-          // TODO(ahe): The closest identifiers in edit distance would be nice.
-          howToFix: "Did you forget to add an import?",
-          examples: const [
-              """
-// 'window' is not in scope because dart:html isn't imported.
-@MirrorsUsed(targets: 'window')
-import 'dart:mirrors';
-
-main() {}
-"""]),
-
-      MessageKind.MIRRORS_CANNOT_RESOLVE_IN_LIBRARY:
-        const MessageTemplate(MessageKind.MIRRORS_CANNOT_RESOLVE_IN_LIBRARY,
-          "Can't find '#{name}' in the library '#{library}'.",
-          // TODO(ahe): The closest identifiers in edit distance would be nice.
-          howToFix: "Is '#{name}' spelled right?",
-          examples: const [
-              """
-// 'List' is misspelled.
-@MirrorsUsed(targets: 'dart.core.Lsit')
-import 'dart:mirrors';
-
-main() {}
-"""]),
-
-      MessageKind.MIRRORS_CANNOT_FIND_IN_ELEMENT:
-        const MessageTemplate(MessageKind.MIRRORS_CANNOT_FIND_IN_ELEMENT,
-          "Can't find '#{name}' in '#{element}'.",
-          // TODO(ahe): The closest identifiers in edit distance would be nice.
-          howToFix: "Is '#{name}' spelled right?",
-          examples: const [
-              """
-// 'addAll' is misspelled.
-@MirrorsUsed(targets: 'dart.core.List.addAl')
-import 'dart:mirrors';
-
-main() {}
-"""]),
-
-      MessageKind.INVALID_URI:
-        const MessageTemplate(MessageKind.INVALID_URI,
-          "'#{uri}' is not a valid URI.",
-          howToFix: DONT_KNOW_HOW_TO_FIX,
-          examples: const [
-            """
-// can't have a '[' in a URI
-import '../../Udyn[mic ils/expect.dart';
-
-main() {}
-"""]),
-
-      MessageKind.INVALID_PACKAGE_CONFIG:
-          const MessageTemplate(MessageKind.INVALID_PACKAGE_CONFIG,
-            """Package config file '#{uri}' is invalid.
-#{exception}""",
-            howToFix: DONT_KNOW_HOW_TO_FIX
-      ),
-
-      MessageKind.INVALID_PACKAGE_URI:
-        const MessageTemplate(MessageKind.INVALID_PACKAGE_URI,
-          "'#{uri}' is not a valid package URI (#{exception}).",
-          howToFix: DONT_KNOW_HOW_TO_FIX,
-          examples: const [
-            """
-// can't have a 'top level' package URI
-import 'package:foo.dart';
-
-main() {}
-""", """
-// can't have 2 slashes
-import 'package://foo/foo.dart';
-
-main() {}
-""", """
-// package name must be valid
-import 'package:not\valid/foo.dart';
-
-main() {}
-"""]),
-
-      MessageKind.READ_SCRIPT_ERROR:
-        const MessageTemplate(MessageKind.READ_SCRIPT_ERROR,
-          "Can't read '#{uri}' (#{exception}).",
-          // Don't know how to fix since the underlying error is unknown.
-          howToFix: DONT_KNOW_HOW_TO_FIX,
-          examples: const [
-              """
-// 'foo.dart' does not exist.
-import 'foo.dart';
-
-main() {}
-"""]),
-
-      MessageKind.READ_SELF_ERROR:
-        const MessageTemplate(MessageKind.READ_SELF_ERROR,
-          "#{exception}",
-          // Don't know how to fix since the underlying error is unknown.
-          howToFix: DONT_KNOW_HOW_TO_FIX),
-
-      MessageKind.EXTRANEOUS_MODIFIER:
-        const MessageTemplate(MessageKind.EXTRANEOUS_MODIFIER,
-          "Can't have modifier '#{modifier}' here.",
-          howToFix: "Try removing '#{modifier}'.",
-          examples: const [
-              "var String foo; main(){}",
-              // "var get foo; main(){}",
-              "var set foo; main(){}",
-              "var final foo; main(){}",
-              "var var foo; main(){}",
-              "var const foo; main(){}",
-              "var abstract foo; main(){}",
-              "var static foo; main(){}",
-              "var external foo; main(){}",
-              "get var foo; main(){}",
-              "set var foo; main(){}",
-              "final var foo; main(){}",
-              "var var foo; main(){}",
-              "const var foo; main(){}",
-              "abstract var foo; main(){}",
-              "static var foo; main(){}",
-              "external var foo; main(){}"]),
-
-      MessageKind.EXTRANEOUS_MODIFIER_REPLACE:
-        const MessageTemplate(MessageKind.EXTRANEOUS_MODIFIER_REPLACE,
-          "Can't have modifier '#{modifier}' here.",
-          howToFix:
-            "Try replacing modifier '#{modifier}' with 'var', 'final', "
-            "or a type.",
-          examples: const [
-              // "get foo; main(){}",
-              "set foo; main(){}",
-              "abstract foo; main(){}",
-              "static foo; main(){}",
-              "external foo; main(){}"]),
-
-      MessageKind.ABSTRACT_CLASS_INSTANTIATION:
-        const MessageTemplate(MessageKind.ABSTRACT_CLASS_INSTANTIATION,
-          "Can't instantiate abstract class.",
-          howToFix: DONT_KNOW_HOW_TO_FIX,
-          examples: const ["abstract class A {} main() { new A(); }"]),
-
-      MessageKind.BODY_EXPECTED:
-        const MessageTemplate(MessageKind.BODY_EXPECTED,
-          "Expected a function body or '=>'.",
-          // TODO(ahe): In some scenarios, we can suggest removing the 'static'
-          // keyword.
-          howToFix: "Try adding {}.",
-          examples: const [
-              "main();"]),
-
-      MessageKind.MIRROR_BLOAT:
-        const MessageTemplate(MessageKind.MIRROR_BLOAT,
-          "#{count} methods retained for use by dart:mirrors out of #{total}"
-          " total methods (#{percentage}%)."),
-
-      MessageKind.MIRROR_IMPORT:
-        const MessageTemplate(MessageKind.MIRROR_IMPORT,
-          "Import of 'dart:mirrors'."),
-
-      MessageKind.MIRROR_IMPORT_NO_USAGE:
-        const MessageTemplate(MessageKind.MIRROR_IMPORT_NO_USAGE,
-          "This import is not annotated with @MirrorsUsed, which may lead to "
-          "unnecessarily large generated code.",
-          howToFix:
-              "Try adding '@MirrorsUsed(...)' as described at "
-              "https://goo.gl/Akrrog."),
-
-      MessageKind.WRONG_ARGUMENT_FOR_JS_INTERCEPTOR_CONSTANT:
-        const MessageTemplate(
-          MessageKind.WRONG_ARGUMENT_FOR_JS_INTERCEPTOR_CONSTANT,
-          "Argument for 'JS_INTERCEPTOR_CONSTANT' must be a type constant."),
-
-      MessageKind.EXPECTED_IDENTIFIER_NOT_RESERVED_WORD:
-        const MessageTemplate(MessageKind.EXPECTED_IDENTIFIER_NOT_RESERVED_WORD,
-              "'#{keyword}' is a reserved word and can't be used here.",
-              howToFix: "Try using a different name.",
-              examples: const ["do() {} main() {}"]),
-
-      MessageKind. NAMED_FUNCTION_EXPRESSION:
-        const MessageTemplate(MessageKind.NAMED_FUNCTION_EXPRESSION,
-          "Function expression '#{name}' cannot be named.",
-          howToFix: "Try removing the name.",
-          examples: const ["main() { var f = func() {}; }"]),
-
-      MessageKind.UNUSED_METHOD:
-        const MessageTemplate(MessageKind.UNUSED_METHOD,
-          "The method '#{name}' is never called.",
-          howToFix: "Consider deleting it.",
-          examples: const ["deadCode() {} main() {}"]),
-
-      MessageKind.UNUSED_CLASS:
-        const MessageTemplate(MessageKind.UNUSED_CLASS,
-          "The class '#{name}' is never used.",
-          howToFix: "Consider deleting it.",
-          examples: const ["class DeadCode {} main() {}"]),
-
-      MessageKind.UNUSED_TYPEDEF:
-        const MessageTemplate(MessageKind.UNUSED_TYPEDEF,
-          "The typedef '#{name}' is never used.",
-          howToFix: "Consider deleting it.",
-          examples: const ["typedef DeadCode(); main() {}"]),
-
-      MessageKind.ABSTRACT_METHOD:
-        const MessageTemplate(MessageKind.ABSTRACT_METHOD,
-          "The method '#{name}' has no implementation in "
-          "class '#{class}'.",
-          howToFix: "Try adding a body to '#{name}' or declaring "
-                    "'#{class}' to be 'abstract'.",
-          examples: const ["""
-class Class {
-  method();
-}
-main() => new Class().method();
-"""]),
-
-      MessageKind.ABSTRACT_GETTER:
-        const MessageTemplate(MessageKind.ABSTRACT_GETTER,
-          "The getter '#{name}' has no implementation in "
-          "class '#{class}'.",
-          howToFix: "Try adding a body to '#{name}' or declaring "
-                    "'#{class}' to be 'abstract'.",
-          examples: const ["""
-class Class {
-  get getter;
-}
-main() => new Class();
-"""]),
-
-      MessageKind.ABSTRACT_SETTER:
-        const MessageTemplate(MessageKind.ABSTRACT_SETTER,
-          "The setter '#{name}' has no implementation in "
-          "class '#{class}'.",
-          howToFix: "Try adding a body to '#{name}' or declaring "
-                    "'#{class}' to be 'abstract'.",
-          examples: const ["""
-class Class {
-  set setter(_);
-}
-main() => new Class();
-"""]),
-
-      MessageKind.INHERIT_GETTER_AND_METHOD:
-        const MessageTemplate(MessageKind.INHERIT_GETTER_AND_METHOD,
-          "The class '#{class}' can't inherit both getters and methods "
-          "by the named '#{name}'.",
-          howToFix: DONT_KNOW_HOW_TO_FIX,
-          examples: const ["""
-class A {
-  get member => null;
-}
-class B {
-  member() {}
-}
-class Class implements A, B {
-}
-main() => new Class();
-"""]),
-
-      MessageKind.INHERITED_METHOD:
-        const MessageTemplate(MessageKind.INHERITED_METHOD,
-          "The inherited method '#{name}' is declared here in class "
-          "'#{class}'."),
-
-      MessageKind.INHERITED_EXPLICIT_GETTER:
-        const MessageTemplate(MessageKind.INHERITED_EXPLICIT_GETTER,
-          "The inherited getter '#{name}' is declared here in class "
-          "'#{class}'."),
-
-      MessageKind.INHERITED_IMPLICIT_GETTER:
-        const MessageTemplate(MessageKind.INHERITED_IMPLICIT_GETTER,
-          "The inherited getter '#{name}' is implicitly declared by this "
-          "field in class '#{class}'."),
-
-      MessageKind.UNIMPLEMENTED_METHOD_ONE:
-        const MessageTemplate(MessageKind.UNIMPLEMENTED_METHOD_ONE,
-          "'#{class}' doesn't implement '#{method}' "
-          "declared in '#{declarer}'.",
-          howToFix: "Try adding an implementation of '#{name}' or declaring "
-                    "'#{class}' to be 'abstract'.",
-          examples: const ["""
-abstract class I {
-  m();
-}
-class C implements I {}
-main() => new C();
-""", """
-abstract class I {
-  m();
-}
-class C extends I {}
-main() => new C();
-"""]),
-
-      MessageKind.UNIMPLEMENTED_METHOD:
-        const MessageTemplate(MessageKind.UNIMPLEMENTED_METHOD,
-          "'#{class}' doesn't implement '#{method}'.",
-          howToFix: "Try adding an implementation of '#{name}' or declaring "
-                    "'#{class}' to be 'abstract'.",
-          examples: const ["""
-abstract class I {
-  m();
-}
-
-abstract class J {
-  m();
-}
-
-class C implements I, J {}
-
-main() {
- new C();
-}
-""", """
-abstract class I {
-  m();
-}
-
-abstract class J {
-  m();
-}
-
-class C extends I implements J {}
-
-main() {
- new C();
-}
-"""]),
-
-      MessageKind.UNIMPLEMENTED_METHOD_CONT:
-        const MessageTemplate(MessageKind.UNIMPLEMENTED_METHOD_CONT,
-          "The method '#{name}' is declared here in class '#{class}'."),
-
-      MessageKind.UNIMPLEMENTED_SETTER_ONE:
-        const MessageTemplate(MessageKind.UNIMPLEMENTED_SETTER_ONE,
-          "'#{class}' doesn't implement the setter '#{name}' "
-          "declared in '#{declarer}'.",
-          howToFix: "Try adding an implementation of '#{name}' or declaring "
-                    "'#{class}' to be 'abstract'.",
-          examples: const ["""
-abstract class I {
-  set m(_);
-}
-class C implements I {}
-class D implements I {
-  set m(_) {}
-}
-main() {
- new D().m = 0;
- new C();
-}
-"""]),
-
-      MessageKind.UNIMPLEMENTED_SETTER:
-        const MessageTemplate(MessageKind.UNIMPLEMENTED_SETTER,
-          "'#{class}' doesn't implement the setter '#{name}'.",
-          howToFix: "Try adding an implementation of '#{name}' or declaring "
-                    "'#{class}' to be 'abstract'.",
-          examples: const ["""
-abstract class I {
-  set m(_);
-}
-abstract class J {
-  set m(_);
-}
-class C implements I, J {}
-main() => new C();
-""", """
-abstract class I {
-  set m(_);
-}
-abstract class J {
-  set m(_);
-}
-class C extends I implements J {}
-main() => new C();
-"""]),
-
-      MessageKind.UNIMPLEMENTED_EXPLICIT_SETTER:
-        const MessageTemplate(MessageKind.UNIMPLEMENTED_EXPLICIT_SETTER,
-          "The setter '#{name}' is declared here in class '#{class}'."),
-
-      MessageKind.UNIMPLEMENTED_IMPLICIT_SETTER:
-        const MessageTemplate(MessageKind.UNIMPLEMENTED_IMPLICIT_SETTER,
-          "The setter '#{name}' is implicitly declared by this field "
-          "in class '#{class}'."),
-
-      MessageKind.UNIMPLEMENTED_GETTER_ONE:
-        const MessageTemplate(MessageKind.UNIMPLEMENTED_GETTER_ONE,
-          "'#{class}' doesn't implement the getter '#{name}' "
-          "declared in '#{declarer}'.",
-          howToFix: "Try adding an implementation of '#{name}' or declaring "
-                    "'#{class}' to be 'abstract'.",
-          examples: const ["""
-abstract class I {
-  get m;
-}
-class C implements I {}
-main() => new C();
-""", """
-abstract class I {
-  get m;
-}
-class C extends I {}
-main() => new C();
-"""]),
-
-      MessageKind.UNIMPLEMENTED_GETTER:
-        const MessageTemplate(MessageKind.UNIMPLEMENTED_GETTER,
-          "'#{class}' doesn't implement the getter '#{name}'.",
-          howToFix: "Try adding an implementation of '#{name}' or declaring "
-                    "'#{class}' to be 'abstract'.",
-          examples: const ["""
-abstract class I {
-  get m;
-}
-abstract class J {
-  get m;
-}
-class C implements I, J {}
-main() => new C();
-""", """
-abstract class I {
-  get m;
-}
-abstract class J {
-  get m;
-}
-class C extends I implements J {}
-main() => new C();
-"""]),
-
-      MessageKind.UNIMPLEMENTED_EXPLICIT_GETTER:
-        const MessageTemplate(MessageKind.UNIMPLEMENTED_EXPLICIT_GETTER,
-          "The getter '#{name}' is declared here in class '#{class}'."),
-
-      MessageKind.UNIMPLEMENTED_IMPLICIT_GETTER:
-        const MessageTemplate(MessageKind.UNIMPLEMENTED_IMPLICIT_GETTER,
-          "The getter '#{name}' is implicitly declared by this field "
-          "in class '#{class}'."),
-
-      MessageKind.EQUAL_MAP_ENTRY_KEY:
-        const MessageTemplate(MessageKind.EQUAL_MAP_ENTRY_KEY,
-          "An entry with the same key already exists in the map.",
-          howToFix:
-            "Try removing the previous entry or changing the key in one "
-            "of the entries.",
-          examples: const ["""
-main() {
-  var m = const {'foo': 1, 'foo': 2};
-}"""]),
-
-      MessageKind.BAD_INPUT_CHARACTER:
-        const MessageTemplate(MessageKind.BAD_INPUT_CHARACTER,
-          "Character U+#{characterHex} isn't allowed here.",
-          howToFix: DONT_KNOW_HOW_TO_FIX,
-          examples: const ["""
-main() {
-  String x = ç;
-}
-"""]),
-
-      MessageKind.UNTERMINATED_STRING:
-        const MessageTemplate(MessageKind.UNTERMINATED_STRING,
-          "String must end with #{quote}.",
-          howToFix: DONT_KNOW_HOW_TO_FIX,
-          examples: const ["""
-main() {
-  return '
-;
-}
-""",
-"""
-main() {
-  return \"
-;
-}
-""",
-"""
-main() {
-  return r'
-;
-}
-""",
-"""
-main() {
-  return r\"
-;
-}
-""",
-"""
-main() => '''
-""",
-"""
-main() => \"\"\"
-""",
-"""
-main() => r'''
-""",
-"""
-main() => r\"\"\"
-"""]),
-
-      MessageKind.UNMATCHED_TOKEN:
-        const MessageTemplate(MessageKind.UNMATCHED_TOKEN,
-          "Can't find '#{end}' to match '#{begin}'.",
-          howToFix: DONT_KNOW_HOW_TO_FIX,
-          examples: const[
-              "main(",
-              "main(){",
-              "main(){]}",
-            ]),
-
-      MessageKind.UNTERMINATED_TOKEN:
-        const MessageTemplate(MessageKind.UNTERMINATED_TOKEN,
-          // This is a fall-back message that shouldn't happen.
-          "Incomplete token."),
-
-      MessageKind.EXPONENT_MISSING:
-        const MessageTemplate(MessageKind.EXPONENT_MISSING,
-          "Numbers in exponential notation should always contain an exponent"
-          " (an integer number with an optional sign).",
-          howToFix:
-            "Make sure there is an exponent, and remove any whitespace "
-            "before it.",
-          examples: const ["""
-main() {
-  var i = 1e;
-}
-"""]),
-
-      MessageKind.HEX_DIGIT_EXPECTED:
-        const MessageTemplate(MessageKind.HEX_DIGIT_EXPECTED,
-          "A hex digit (0-9 or A-F) must follow '0x'.",
-          howToFix:
-            DONT_KNOW_HOW_TO_FIX, // Seems obvious from the error message.
-          examples: const ["""
-main() {
-  var i = 0x;
-}
-"""]),
-
-      MessageKind.MALFORMED_STRING_LITERAL:
-        const MessageTemplate(MessageKind.MALFORMED_STRING_LITERAL,
-          r"A '$' has special meaning inside a string, and must be followed by "
-          "an identifier or an expression in curly braces ({}).",
-          howToFix: r"Try adding a backslash (\) to escape the '$'.",
-          examples: const [r"""
-main() {
-  return '$';
-}
-""",
-r'''
-main() {
-  return "$";
-}
-''',
-r"""
-main() {
-  return '''$''';
-}
-""",
-r'''
-main() {
-  return """$""";
-}
-''']),
-
-      MessageKind.UNTERMINATED_COMMENT:
-        const MessageTemplate(MessageKind.UNTERMINATED_COMMENT,
-          "Comment starting with '/*' must end with '*/'.",
-          howToFix: DONT_KNOW_HOW_TO_FIX,
-          examples: const [r"""
-main() {
-}
-/*"""]),
-
-      MessageKind.MISSING_TOKEN_BEFORE_THIS:
-        const MessageTemplate(MessageKind.MISSING_TOKEN_BEFORE_THIS,
-          "Expected '#{token}' before this.",
-          // Consider the second example below: the parser expects a ')' before
-          // 'y', but a ',' would also have worked. We don't have enough
-          // information to give a good suggestion.
-          howToFix: DONT_KNOW_HOW_TO_FIX,
-          examples: const [
-              "main() => true ? 1;",
-              "main() => foo(x: 1 y: 2);",
-            ]),
-
-      MessageKind.MISSING_TOKEN_AFTER_THIS:
-        const MessageTemplate(MessageKind.MISSING_TOKEN_AFTER_THIS,
-          "Expected '#{token}' after this.",
-          // See [MISSING_TOKEN_BEFORE_THIS], we don't have enough information
-          // to give a good suggestion.
-          howToFix: DONT_KNOW_HOW_TO_FIX,
-          examples: const [
-              "main(x) {x}",
-"""
-class S1 {}
-class S2 {}
-class S3 {}
-class A = S1 with S2, S3
-main() => new A();
-"""
-]),
-
-      MessageKind.CONSIDER_ANALYZE_ALL:
-        const MessageTemplate(MessageKind.CONSIDER_ANALYZE_ALL,
-          "Could not find '#{main}'.  Nothing will be analyzed.",
-          howToFix: "Try using '--analyze-all' to analyze everything.",
-          examples: const ['']),
-
-      MessageKind.MISSING_MAIN:
-        const MessageTemplate(MessageKind.MISSING_MAIN,
-          "Could not find '#{main}'.",
-          howToFix: "Try adding a method named '#{main}' to your program."
-          /* No example, test uses '--analyze-only' which will produce the above
-           * message [CONSIDER_ANALYZE_ALL].  An example for a human operator
-           * would be an empty file.*/),
-
-      MessageKind.MAIN_NOT_A_FUNCTION:
-        const MessageTemplate(MessageKind.MAIN_NOT_A_FUNCTION,
-          "'#{main}' is not a function.",
-          howToFix: DONT_KNOW_HOW_TO_FIX, /* Don't state the obvious. */
-          examples: const ['var main;']),
-
-      MessageKind.MAIN_WITH_EXTRA_PARAMETER:
-        const MessageTemplate(MessageKind.MAIN_WITH_EXTRA_PARAMETER,
-          "'#{main}' cannot have more than two parameters.",
-          howToFix: DONT_KNOW_HOW_TO_FIX, /* Don't state the obvious. */
-          examples: const ['main(a, b, c) {}']),
-
-      MessageKind.COMPILER_CRASHED:
-        const MessageTemplate(MessageKind.COMPILER_CRASHED,
-          "The compiler crashed when compiling this element."),
-
-      MessageKind.PLEASE_REPORT_THE_CRASH:
-        const MessageTemplate(MessageKind.PLEASE_REPORT_THE_CRASH, '''
-The compiler is broken.
-
-When compiling the above element, the compiler crashed. It is not
-possible to tell if this is caused by a problem in your program or
-not. Regardless, the compiler should not crash.
-
-The Dart team would greatly appreciate if you would take a moment to
-report this problem at http://dartbug.com/new.
-
-Please include the following information:
-
-* the name and version of your operating system,
-
-* the Dart SDK build number (#{buildId}), and
-
-* the entire message you see here (including the full stack trace
-  below as well as the source location above).
-'''),
-
-      MessageKind.POTENTIAL_MUTATION:
-        const MessageTemplate(MessageKind.POTENTIAL_MUTATION,
-          "Variable '#{variableName}' is not known to be of type "
-          "'#{shownType}' because it is potentially mutated in the scope for "
-          "promotion."),
-
-      MessageKind.POTENTIAL_MUTATION_HERE:
-        const MessageTemplate(MessageKind.POTENTIAL_MUTATION_HERE,
-          "Variable '#{variableName}' is potentially mutated here."),
-
-      MessageKind.POTENTIAL_MUTATION_IN_CLOSURE:
-        const MessageTemplate(MessageKind.POTENTIAL_MUTATION_IN_CLOSURE,
-          "Variable '#{variableName}' is not known to be of type "
-          "'#{shownType}' because it is potentially mutated within a closure."),
-
-      MessageKind.POTENTIAL_MUTATION_IN_CLOSURE_HERE:
-        const MessageTemplate(MessageKind.POTENTIAL_MUTATION_IN_CLOSURE_HERE,
-              "Variable '#{variableName}' is potentially mutated in a "
-              "closure here."),
-
-      MessageKind.ACCESSED_IN_CLOSURE:
-        const MessageTemplate(MessageKind.ACCESSED_IN_CLOSURE,
-          "Variable '#{variableName}' is not known to be of type "
-          "'#{shownType}' because it is accessed by a closure in the scope for "
-          "promotion and potentially mutated in the scope of "
-          "'#{variableName}'."),
-
-      MessageKind.ACCESSED_IN_CLOSURE_HERE:
-        const MessageTemplate(MessageKind.ACCESSED_IN_CLOSURE_HERE,
-          "Variable '#{variableName}' is accessed in a closure here."),
-
-      MessageKind.NOT_MORE_SPECIFIC:
-        const MessageTemplate(MessageKind.NOT_MORE_SPECIFIC,
-          "Variable '#{variableName}' is not shown to have type "
-          "'#{shownType}' because '#{shownType}' is not more specific than the "
-          "known type '#{knownType}' of '#{variableName}'."),
-
-      MessageKind.NOT_MORE_SPECIFIC_SUBTYPE:
-        const MessageTemplate(MessageKind.NOT_MORE_SPECIFIC_SUBTYPE,
-          "Variable '#{variableName}' is not shown to have type "
-          "'#{shownType}' because '#{shownType}' is not a subtype of the "
-          "known type '#{knownType}' of '#{variableName}'."),
-
-      MessageKind.NOT_MORE_SPECIFIC_SUGGESTION:
-        const MessageTemplate(MessageKind.NOT_MORE_SPECIFIC_SUGGESTION,
-          "Variable '#{variableName}' is not shown to have type "
-          "'#{shownType}' because '#{shownType}' is not more specific than the "
-          "known type '#{knownType}' of '#{variableName}'.",
-          howToFix:
-            "Try replacing '#{shownType}' with '#{shownTypeSuggestion}'."),
-
-      MessageKind.HIDDEN_WARNINGS_HINTS:
-        const MessageTemplate(MessageKind.HIDDEN_WARNINGS_HINTS,
-          "#{warnings} warning(s) and #{hints} hint(s) suppressed in #{uri}."),
-
-      MessageKind.HIDDEN_WARNINGS:
-        const MessageTemplate(MessageKind.HIDDEN_WARNINGS,
-          "#{warnings} warning(s) suppressed in #{uri}."),
-
-      MessageKind.HIDDEN_HINTS:
-        const MessageTemplate(MessageKind.HIDDEN_HINTS,
-          "#{hints} hint(s) suppressed in #{uri}."),
-
-      MessageKind.PREAMBLE:
-        const MessageTemplate(MessageKind.PREAMBLE,
-        "When run on the command-line, the compiled output might"
-        " require a preamble file located in:\n"
-        "  <sdk>/lib/_internal/js_runtime/lib/preambles."),
-
-      MessageKind.INVALID_SYNC_MODIFIER:
-        const MessageTemplate(MessageKind.INVALID_SYNC_MODIFIER,
-          "Invalid modifier 'sync'.",
-          options: const ['--enable-async'],
-          howToFix: "Try replacing 'sync' with 'sync*'.",
-          examples: const [
-            "main() sync {}"
-          ]),
-
-      MessageKind.INVALID_AWAIT_FOR:
-        const MessageTemplate(MessageKind.INVALID_AWAIT_FOR,
-          "'await' is only supported on for-in loops.",
-          options: const ['--enable-async'],
-          howToFix: "Try rewriting the loop as a for-in loop or removing the "
-                    "'await' keyword.",
-          examples: const ["""
-main() async* {
-  await for (int i = 0; i < 10; i++) {}
-}
-"""]),
-
-      MessageKind.ASYNC_MODIFIER_ON_ABSTRACT_METHOD:
-        const MessageTemplate(MessageKind.ASYNC_MODIFIER_ON_ABSTRACT_METHOD,
-          "The modifier '#{modifier}' is not allowed on an abstract method.",
-          options: const ['--enable-async'],
-          howToFix: "Try removing the '#{modifier}' modifier or adding a "
-                    "body to the method.",
-          examples: const ["""
-abstract class A {
-  method() async;
-}
-class B extends A {
-  method() {}
-}
-main() {
-  A a = new B();
-  a.method();
-}
-"""]),
-
-      MessageKind.ASYNC_MODIFIER_ON_CONSTRUCTOR:
-        const MessageTemplate(MessageKind.ASYNC_MODIFIER_ON_CONSTRUCTOR,
-              "The modifier '#{modifier}' is not allowed on constructors.",
-              options: const ['--enable-async'],
-              howToFix: "Try removing the '#{modifier}' modifier.",
-              examples: const ["""
-class A {
-  A() async;
-}
-main() => new A();""",
-
-"""
-class A {
-  A();
-  factory A.a() async* {}
-}
-main() => new A.a();"""]),
-
-      MessageKind.ASYNC_MODIFIER_ON_SETTER:
-        const MessageTemplate(MessageKind.ASYNC_MODIFIER_ON_SETTER,
-              "The modifier '#{modifier}' is not allowed on setters.",
-              options: const ['--enable-async'],
-              howToFix: "Try removing the '#{modifier}' modifier.",
-              examples: const ["""
-class A {
-  set foo(v) async {}
-}
-main() => new A().foo = 0;"""]),
-
-      MessageKind.YIELDING_MODIFIER_ON_ARROW_BODY:
-        const MessageTemplate(MessageKind.YIELDING_MODIFIER_ON_ARROW_BODY,
-          "The modifier '#{modifier}' is not allowed on methods implemented "
-          "using '=>'.",
-          options: const ['--enable-async'],
-          howToFix: "Try removing the '#{modifier}' modifier or implementing "
-                    "the method body using a block: '{ ... }'.",
-          examples: const ["main() sync* => null;", "main() async* => null;"]),
-
-      // TODO(johnniwinther): Check for 'async' as identifier.
-      MessageKind.ASYNC_KEYWORD_AS_IDENTIFIER:
-        const MessageTemplate(MessageKind.ASYNC_KEYWORD_AS_IDENTIFIER,
-          "'#{keyword}' cannot be used as an identifier in a function body "
-          "marked with '#{modifier}'.",
-          options: const ['--enable-async'],
-          howToFix: "Try removing the '#{modifier}' modifier or renaming the "
-                    "identifier.",
-          examples: const ["""
-main() async {
- var await;
-}""",
-"""
-main() async* {
- var yield;
-}""",
-"""
-main() sync* {
- var yield;
-}"""]),
-
-      MessageKind.RETURN_IN_GENERATOR:
-        const MessageTemplate(MessageKind.RETURN_IN_GENERATOR,
-          "'return' with a value is not allowed in a method body using the "
-          "'#{modifier}' modifier.",
-          howToFix: "Try removing the value, replacing 'return' with 'yield' "
-                    "or changing the method body modifier.",
-          examples: const [
-"""
-foo() async* { return 0; }
-main() => foo();
-""",
-
-"""
-foo() sync* { return 0; }
-main() => foo();
-"""]),
-
-      MessageKind.NATIVE_NOT_SUPPORTED:
-        const MessageTemplate(MessageKind.NATIVE_NOT_SUPPORTED,
-          "'native' modifier is not supported.",
-          howToFix: "Try removing the 'native' implementation or analyzing the "
-                    "code with the --allow-native-extensions option.",
-          examples: const ["""
-main() native "Main";
-"""]),
-
-      MessageKind.DART_EXT_NOT_SUPPORTED:
-        const MessageTemplate(MessageKind.DART_EXT_NOT_SUPPORTED,
-          "The 'dart-ext' scheme is not supported.",
-          howToFix: "Try analyzing the code with the --allow-native-extensions "
-                    "option.",
-          examples: const ["""
-import 'dart-ext:main';
-
-main() {}
-"""]),
-
-      MessageKind.LIBRARY_TAG_MUST_BE_FIRST:
-        const MessageTemplate(MessageKind.LIBRARY_TAG_MUST_BE_FIRST,
-          "The library declaration should come before other declarations.",
-          howToFix: "Try moving the declaration to the top of the file.",
-          examples: const [
-"""
-import 'dart:core';
-library foo;
-main() {}
-""",
-      ]),
-
-      MessageKind.ONLY_ONE_LIBRARY_TAG:
-        const MessageTemplate(MessageKind.ONLY_ONE_LIBRARY_TAG,
-          "There can only be one library declaration.",
-          howToFix: "Try removing all other library declarations.",
-          examples: const [
-"""
-library foo;
-library bar;
-main() {}
-""",
-"""
-library foo;
-import 'dart:core';
-library bar;
-main() {}
-""",
-      ]),
-
-      MessageKind.IMPORT_BEFORE_PARTS:
-        const MessageTemplate(MessageKind.IMPORT_BEFORE_PARTS,
-          "Import declarations should come before parts.",
-          howToFix: "Try moving this import further up in the file.",
-          examples: const [
-              const <String, String>{
-                'main.dart': """
-library test.main;
-part 'part.dart';
-import 'dart:core';
-main() {}
-""",
-                'part.dart': """
-part of test.main;
-""",
-          }]),
-
-      MessageKind.EXPORT_BEFORE_PARTS:
-        const MessageTemplate(MessageKind.EXPORT_BEFORE_PARTS,
-          "Export declarations should come before parts.",
-          howToFix: "Try moving this export further up in the file.",
-          examples: const [
-              const <String, String>{
-                'main.dart': """
-library test.main;
-part 'part.dart';
-export 'dart:core';
-main() {}
-""",
-               'part.dart': """
-part of test.main;
-""",
-          }]),
-
-  //////////////////////////////////////////////////////////////////////////////
-  // Patch errors start.
-  //////////////////////////////////////////////////////////////////////////////
-
-      MessageKind.PATCH_RETURN_TYPE_MISMATCH:
-        const MessageTemplate(MessageKind.PATCH_RETURN_TYPE_MISMATCH,
-          "Patch return type '#{patchReturnType}' does not match "
-          "'#{originReturnType}' on origin method '#{methodName}'."),
-
-      MessageKind.PATCH_REQUIRED_PARAMETER_COUNT_MISMATCH:
-        const MessageTemplate(
-          MessageKind.PATCH_REQUIRED_PARAMETER_COUNT_MISMATCH,
-          "Required parameter count of patch method "
-          "(#{patchParameterCount}) does not match parameter count on origin "
-          "method '#{methodName}' (#{originParameterCount})."),
-
-      MessageKind.PATCH_OPTIONAL_PARAMETER_COUNT_MISMATCH:
-        const MessageTemplate(
-          MessageKind.PATCH_OPTIONAL_PARAMETER_COUNT_MISMATCH,
-          "Optional parameter count of patch method "
-          "(#{patchParameterCount}) does not match parameter count on origin "
-          "method '#{methodName}' (#{originParameterCount})."),
-
-      MessageKind.PATCH_OPTIONAL_PARAMETER_NAMED_MISMATCH:
-        const MessageTemplate(
-          MessageKind.PATCH_OPTIONAL_PARAMETER_NAMED_MISMATCH,
-          "Optional parameters of origin and patch method "
-          "'#{methodName}' must both be either named or positional."),
-
-      MessageKind.PATCH_PARAMETER_MISMATCH:
-        const MessageTemplate(MessageKind.PATCH_PARAMETER_MISMATCH,
-          "Patch method parameter '#{patchParameter}' does not match "
-          "'#{originParameter}' on origin method '#{methodName}'."),
-
-      MessageKind.PATCH_PARAMETER_TYPE_MISMATCH:
-        const MessageTemplate(MessageKind.PATCH_PARAMETER_TYPE_MISMATCH,
-          "Patch method parameter '#{parameterName}' type "
-          "'#{patchParameterType}' does not match '#{originParameterType}' on "
-          "origin method '#{methodName}'."),
-
-      MessageKind.PATCH_EXTERNAL_WITHOUT_IMPLEMENTATION:
-        const MessageTemplate(MessageKind.PATCH_EXTERNAL_WITHOUT_IMPLEMENTATION,
-          "External method without an implementation."),
-
-      MessageKind.PATCH_POINT_TO_FUNCTION:
-        const MessageTemplate(MessageKind.PATCH_POINT_TO_FUNCTION,
-          "This is the function patch '#{functionName}'."),
-
-      MessageKind.PATCH_POINT_TO_CLASS:
-        const MessageTemplate(MessageKind.PATCH_POINT_TO_CLASS,
-          "This is the class patch '#{className}'."),
-
-      MessageKind.PATCH_POINT_TO_GETTER:
-        const MessageTemplate(MessageKind.PATCH_POINT_TO_GETTER,
-          "This is the getter patch '#{getterName}'."),
-
-      MessageKind.PATCH_POINT_TO_SETTER:
-        const MessageTemplate(MessageKind.PATCH_POINT_TO_SETTER,
-          "This is the setter patch '#{setterName}'."),
-
-      MessageKind.PATCH_POINT_TO_CONSTRUCTOR:
-        const MessageTemplate(MessageKind.PATCH_POINT_TO_CONSTRUCTOR,
-          "This is the constructor patch '#{constructorName}'."),
-
-      MessageKind.PATCH_POINT_TO_PARAMETER:
-        const MessageTemplate(MessageKind.PATCH_POINT_TO_PARAMETER,
-          "This is the patch parameter '#{parameterName}'."),
-
-      MessageKind.PATCH_NON_EXISTING:
-        const MessageTemplate(MessageKind.PATCH_NON_EXISTING,
-          "Origin does not exist for patch '#{name}'."),
-
-      // TODO(ahe): Eventually, this error should be removed as it will be
-      // handled by the regular parser.
-      MessageKind.PATCH_NONPATCHABLE:
-        const MessageTemplate(MessageKind.PATCH_NONPATCHABLE,
-          "Only classes and functions can be patched."),
-
-      MessageKind.PATCH_NON_EXTERNAL:
-        const MessageTemplate(MessageKind.PATCH_NON_EXTERNAL,
-          "Only external functions can be patched."),
-
-      MessageKind.PATCH_NON_CLASS:
-        const MessageTemplate(MessageKind.PATCH_NON_CLASS,
-          "Patching non-class with class patch '#{className}'."),
-
-      MessageKind.PATCH_NON_GETTER:
-        const MessageTemplate(MessageKind.PATCH_NON_GETTER,
-          "Cannot patch non-getter '#{name}' with getter patch."),
-
-      MessageKind.PATCH_NO_GETTER:
-        const MessageTemplate(MessageKind.PATCH_NO_GETTER,
-          "No getter found for getter patch '#{getterName}'."),
-
-      MessageKind.PATCH_NON_SETTER:
-        const MessageTemplate(MessageKind.PATCH_NON_SETTER,
-          "Cannot patch non-setter '#{name}' with setter patch."),
-
-      MessageKind.PATCH_NO_SETTER:
-        const MessageTemplate(MessageKind.PATCH_NO_SETTER,
-          "No setter found for setter patch '#{setterName}'."),
-
-      MessageKind.PATCH_NON_CONSTRUCTOR:
-        const MessageTemplate(MessageKind.PATCH_NON_CONSTRUCTOR,
-          "Cannot patch non-constructor with constructor patch "
-          "'#{constructorName}'."),
-
-      MessageKind.PATCH_NON_FUNCTION:
-        const MessageTemplate(MessageKind.PATCH_NON_FUNCTION,
-          "Cannot patch non-function with function patch "
-          "'#{functionName}'."),
-
-      MessageKind.EXTERNAL_WITH_BODY:
-        const MessageTemplate(MessageKind.EXTERNAL_WITH_BODY,
-          "External function '#{functionName}' cannot have a function body.",
-          options: const ["--output-type=dart"],
-          howToFix:
-            "Try removing the 'external' modifier or the function body.",
-          examples: const ["""
-external foo() => 0;
-main() => foo();
-""", """
-external foo() {}
-main() => foo();
-"""]),
-
-  //////////////////////////////////////////////////////////////////////////////
-  // Patch errors end.
-  //////////////////////////////////////////////////////////////////////////////
-
-      MessageKind.IMPORT_EXPERIMENTAL_MIRRORS:
-        const MessageTemplate(MessageKind.IMPORT_EXPERIMENTAL_MIRRORS, r'''
-
-****************************************************************
-* WARNING: dart:mirrors support in dart2js is experimental,
-*          and not recommended.
-*          This implementation of mirrors is incomplete,
-*          and often greatly increases the size of the generated
-*          JavaScript code.
-*
-* Your app imports dart:mirrors via:''''''
-$IMPORT_EXPERIMENTAL_MIRRORS_PADDING#{importChain}
-*
-* You can disable this message by using the --enable-experimental-mirrors
-* command-line flag.
-*
-* To learn what to do next, please visit:
-*    http://dartlang.org/dart2js-reflection
-****************************************************************
-'''),
-
-
-      MessageKind.MIRRORS_LIBRARY_NOT_SUPPORT_BY_BACKEND:
-        const MessageTemplate(
-          MessageKind.MIRRORS_LIBRARY_NOT_SUPPORT_BY_BACKEND,
-          "dart:mirrors library is not supported when using this backend."),
-
-      MessageKind.CALL_NOT_SUPPORTED_ON_NATIVE_CLASS:
-        const MessageTemplate(MessageKind.CALL_NOT_SUPPORTED_ON_NATIVE_CLASS,
-          "Non-supported 'call' member on a native class, or a "
-          "subclass of a native class."),
-
-      MessageKind.DIRECTLY_THROWING_NSM:
-        const MessageTemplate(MessageKind.DIRECTLY_THROWING_NSM,
-          "This 'noSuchMethod' implementation is guaranteed to throw an "
-          "exception. The generated code will be smaller if it is "
-          "rewritten.",
-          howToFix: "Rewrite to "
-                    "'noSuchMethod(Invocation i) => super.noSuchMethod(i);'."),
-
-      MessageKind.COMPLEX_THROWING_NSM:
-        const MessageTemplate(MessageKind.COMPLEX_THROWING_NSM,
-          "This 'noSuchMethod' implementation is guaranteed to throw an "
-          "exception. The generated code will be smaller and the compiler "
-          "will be able to perform more optimizations if it is rewritten.",
-          howToFix: "Rewrite to "
-                    "'noSuchMethod(Invocation i) => super.noSuchMethod(i);'."),
-
-      MessageKind.COMPLEX_RETURNING_NSM:
-        const MessageTemplate(MessageKind.COMPLEX_RETURNING_NSM,
-          "Overriding 'noSuchMethod' causes the compiler to generate "
-          "more code and prevents the compiler from doing some optimizations.",
-          howToFix: "Consider removing this 'noSuchMethod' implementation."),
-
-
-  }; // End of TEMPLATES.
-
-  static const String IMPORT_EXPERIMENTAL_MIRRORS_PADDING = '\n*   ';
-
-  toString() => template;
-
-  Message message([Map arguments = const {}, bool terse = false]) {
-    return new Message(this, arguments, terse);
-  }
-
-  bool get hasHowToFix => howToFix != null && howToFix != DONT_KNOW_HOW_TO_FIX;
-}
-
-class Message {
-  final MessageTemplate template;
-  final Map arguments;
-  final bool terse;
-  String message;
-
-  Message(this.template, this.arguments, this.terse) {
-    assert(() { computeMessage(); return true; });
-  }
-
-  MessageKind get kind => template.kind;
-
-  String computeMessage() {
-    if (message == null) {
-      message = template.template;
-      arguments.forEach((key, value) {
-        message = message.replaceAll('#{${key}}', convertToString(value));
-      });
-      assert(invariant(
-          CURRENT_ELEMENT_SPANNABLE,
-          kind == MessageKind.GENERIC ||
-            !message.contains(new RegExp(r'#\{.+\}')),
-          message: 'Missing arguments in error message: "$message"'));
-      if (!terse && template.hasHowToFix) {
-        String howToFix = template.howToFix;
-        arguments.forEach((key, value) {
-          howToFix = howToFix.replaceAll('#{${key}}', convertToString(value));
-        });
-        message = '$message\n$howToFix';
-      }
-    }
-    return message;
-  }
-
-  String toString() {
-    return computeMessage();
-  }
-
-  bool operator==(other) {
-    if (other is !Message) return false;
-    return (template == other.template) && (toString() == other.toString());
-  }
-
-  int get hashCode => throw new UnsupportedError('Message.hashCode');
-
-  static String convertToString(value) {
-    if (value is ErrorToken) {
-      // Shouldn't happen.
-      return value.assertionMessage;
-    } else if (value is Token) {
-      value = value.value;
-    }
-    return '$value';
-  }
-}
diff --git a/pkg/compiler/lib/src/world.dart b/pkg/compiler/lib/src/world.dart
index 68d0f4d..b8c6387 100644
--- a/pkg/compiler/lib/src/world.dart
+++ b/pkg/compiler/lib/src/world.dart
@@ -2,7 +2,34 @@
 // for 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 dart2js;
+library dart2js.world;
+
+import 'closure.dart' show
+    SynthesizedCallMethodElementX;
+import 'common.dart';
+import 'common/backend_api.dart' show
+    Backend;
+import 'compiler.dart' show
+    Compiler;
+import 'dart_types.dart';
+import 'elements/elements.dart' show
+    ClassElement,
+    Element,
+    FunctionElement,
+    MixinApplicationElement,
+    TypedefElement,
+    VariableElement;
+import 'ordered_typeset.dart';
+import 'types/types.dart' as ti;
+import 'universe/class_set.dart';
+import 'universe/function_set.dart' show
+    FunctionSet;
+import 'universe/selector.dart' show
+    Selector;
+import 'universe/side_effects.dart' show
+    SideEffects;
+import 'util/util.dart' show
+    Link;
 
 abstract class ClassWorld {
   // TODO(johnniwinther): Refine this into a `BackendClasses` interface.
@@ -36,6 +63,9 @@
   /// Returns `true` if [cls] is instantiated.
   bool isInstantiated(ClassElement cls);
 
+  /// Returns `true` if [cls] is implemented by an instantiated class.
+  bool isImplemented(ClassElement cls);
+
   /// Returns `true` if the class world is closed.
   bool get isClosed;
 
@@ -54,10 +84,17 @@
   /// including [cls] itself.
   Iterable<ClassElement> strictSubclassesOf(ClassElement cls);
 
+  /// Returns an iterable over the directly instantiated that implement [cls]
+  /// possibly including [cls] itself, if it is live.
+  Iterable<ClassElement> subtypesOf(ClassElement cls);
+
   /// Returns an iterable over the live classes that implement [cls] _not_
   /// including [cls] if it is live.
   Iterable<ClassElement> strictSubtypesOf(ClassElement cls);
 
+  /// Returns `true` if [a] and [b] have any known common subtypes.
+  bool haveAnyCommonSubtypes(ClassElement a, ClassElement b);
+
   /// Returns `true` if any live class other than [cls] extends [cls].
   bool hasAnyStrictSubclass(ClassElement cls);
 
@@ -90,6 +127,11 @@
   /// Returns `true` if closed-world assumptions can be made, that is,
   /// incremental compilation isn't enabled.
   bool get hasClosedWorldAssumption;
+
+  /// Returns a string representation of the closed world.
+  ///
+  /// If [cls] is provided, the dump will contain only classes related to [cls].
+  String dump([ClassElement cls]);
 }
 
 class World implements ClassWorld {
@@ -100,6 +142,7 @@
   ClassElement get intClass => compiler.intClass;
   ClassElement get doubleClass => compiler.doubleClass;
   ClassElement get stringClass => compiler.stringClass;
+  ClassElement get nullClass => compiler.nullClass;
 
   /// Cache of [ti.FlatTypeMask]s grouped by the 8 possible values of the
   /// [ti.FlatTypeMask.flags] property.
@@ -111,10 +154,11 @@
       invariant(cls, cls.isDeclaration,
                 message: '$cls must be the declaration.') &&
       invariant(cls, cls.isResolved,
-                message: '$cls must be resolved.') &&
+                message: '$cls must be resolved.')/* &&
+      // TODO(johnniwinther): Reinsert this or similar invariant.
       (!mustBeInstantiated ||
        invariant(cls, isInstantiated(cls),
-                 message: '$cls is not instantiated.'));
+                 message: '$cls is not instantiated.'))*/;
  }
 
   /// Returns `true` if [x] is a subtype of [y], that is, if [x] implements an
@@ -144,19 +188,25 @@
     return false;
   }
 
-  /// Returns `true` if [cls] is instantiated.
+  /// Returns `true` if [cls] is instantiated either directly or through a
+  /// subclass.
   bool isInstantiated(ClassElement cls) {
     return compiler.resolverWorld.isInstantiated(cls);
   }
 
+  /// Returns `true` if [cls] is implemented by an instantiated class.
+  bool isImplemented(ClassElement cls) {
+    return compiler.resolverWorld.isImplemented(cls);
+  }
+
   /// Returns an iterable over the directly instantiated classes that extend
   /// [cls] possibly including [cls] itself, if it is live.
   Iterable<ClassElement> subclassesOf(ClassElement cls) {
     ClassHierarchyNode hierarchy = _classHierarchyNodes[cls.declaration];
     if (hierarchy == null) return const <ClassElement>[];
-    assert(invariant(cls, isInstantiated(cls.declaration),
-        message: 'Class $cls has not been instantiated.'));
-    return hierarchy.subclasses();
+    return hierarchy.subclasses(
+        includeIndirectlyInstantiated: false,
+        includeUninstantiated: false);
   }
 
   /// Returns an iterable over the directly instantiated classes that extend
@@ -164,16 +214,52 @@
   Iterable<ClassElement> strictSubclassesOf(ClassElement cls) {
     ClassHierarchyNode subclasses = _classHierarchyNodes[cls.declaration];
     if (subclasses == null) return const <ClassElement>[];
-    assert(invariant(cls, isInstantiated(cls.declaration),
-        message: 'Class $cls has not been instantiated.'));
-    return subclasses.strictSubclasses();
+    return subclasses.subclasses(
+        strict: true,
+        includeIndirectlyInstantiated: false,
+        includeUninstantiated: false);
+  }
+
+  /// Returns an iterable over the directly instantiated that implement [cls]
+  /// possibly including [cls] itself, if it is live.
+  Iterable<ClassElement> subtypesOf(ClassElement cls) {
+    ClassSet classSet = _classSets[cls.declaration];
+    if (classSet == null) {
+      return const <ClassElement>[];
+    } else {
+      return classSet.subtypes(
+          includeIndirectlyInstantiated: false,
+          includeUninstantiated: false);
+    }
   }
 
   /// Returns an iterable over the directly instantiated that implement [cls]
   /// _not_ including [cls].
   Iterable<ClassElement> strictSubtypesOf(ClassElement cls) {
-    Set<ClassElement> subtypes = _subtypes[cls.declaration];
-    return subtypes != null ? subtypes : const <ClassElement>[];
+    ClassSet classSet = _classSets[cls.declaration];
+    if (classSet == null) {
+      return const <ClassElement>[];
+    } else {
+      return classSet.subtypes(
+          strict: true,
+          includeIndirectlyInstantiated: false,
+          includeUninstantiated: false);
+    }
+  }
+
+  /// Returns `true` if [a] and [b] have any known common subtypes.
+  bool haveAnyCommonSubtypes(ClassElement a, ClassElement b) {
+    ClassSet classSetA = _classSets[a.declaration];
+    ClassSet classSetB = _classSets[b.declaration];
+    if (classSetA == null || classSetB == null) return false;
+    // TODO(johnniwinther): Implement an optimized query on [ClassSet].
+    Set<ClassElement> subtypesOfB = classSetB.subtypes().toSet();
+    for (ClassElement subtypeOfA in classSetA.subtypes()) {
+      if (subtypesOfB.contains(subtypeOfA)) {
+        return true;
+      }
+    }
+    return false;
   }
 
   /// Returns `true` if any directly instantiated class other than [cls] extends
@@ -181,8 +267,6 @@
   bool hasAnyStrictSubclass(ClassElement cls) {
     ClassHierarchyNode subclasses = _classHierarchyNodes[cls.declaration];
     if (subclasses == null) return false;
-    assert(invariant(cls, isInstantiated(cls.declaration),
-        message: 'Class $cls has not been instantiated.'));
     return subclasses.isIndirectlyInstantiated;
   }
 
@@ -253,9 +337,23 @@
     if (_liveMixinUses == null) {
       _liveMixinUses = new Map<ClassElement, List<MixinApplicationElement>>();
       for (ClassElement mixin in _mixinUses.keys) {
-        Iterable<MixinApplicationElement> uses =
-            _mixinUses[mixin].where(isInstantiated);
-        if (uses.isNotEmpty) _liveMixinUses[mixin] = uses.toList();
+        List<MixinApplicationElement> uses = <MixinApplicationElement>[];
+
+        void addLiveUse(MixinApplicationElement mixinApplication) {
+          if (isInstantiated(mixinApplication)) {
+            uses.add(mixinApplication);
+          } else if (mixinApplication.isNamedMixinApplication) {
+            List<MixinApplicationElement> next = _mixinUses[mixinApplication];
+            if (next != null) {
+              next.forEach(addLiveUse);
+            }
+          }
+        }
+
+        _mixinUses[mixin].forEach(addLiveUse);
+        if (uses.isNotEmpty) {
+          _liveMixinUses[mixin] = uses;
+        }
       }
     }
     Iterable<MixinApplicationElement> uses = _liveMixinUses[cls];
@@ -307,8 +405,8 @@
   // distinct sets to make class hierarchy analysis faster.
   final Map<ClassElement, ClassHierarchyNode> _classHierarchyNodes =
       <ClassElement, ClassHierarchyNode>{};
-  final Map<ClassElement, Set<ClassElement>> _subtypes =
-      new Map<ClassElement, Set<ClassElement>>();
+  final Map<ClassElement, ClassSet> _classSets =
+        <ClassElement, ClassSet>{};
 
   final Set<Element> sideEffectsFreeElements = new Set<Element>();
 
@@ -322,11 +420,6 @@
   bool get isClosed => compiler.phase > Compiler.PHASE_RESOLVING;
 
   // Used by selectors.
-  bool isAssertMethod(Element element) {
-    return compiler.backend.isAssertMethod(element);
-  }
-
-  // Used by selectors.
   bool isForeign(Element element) {
     return compiler.backend.isForeign(element);
   }
@@ -340,38 +433,83 @@
         this.compiler = compiler,
         alreadyPopulated = compiler.cacheStrategy.newSet();
 
-  ClassHierarchyNode classHierarchyNode(ClassElement cls) {
-    return _classHierarchyNodes[cls];
+  DiagnosticReporter get reporter => compiler.reporter;
+
+  /// Called to add [cls] to the set of known classes.
+  ///
+  /// This ensures that class hierarchy queries can be performed on [cls] and
+  /// classes that extend or implement it.
+  void registerClass(ClassElement cls) {
+    _ensureClassSet(cls);
+  }
+
+  /// Returns [ClassHierarchyNode] for [cls] used to model the class hierarchies
+  /// of known classes.
+  ///
+  /// This method is only provided for testing. For queries on classes, use the
+  /// methods defined in [ClassWorld].
+  ClassHierarchyNode getClassHierarchyNode(ClassElement cls) {
+    return _classHierarchyNodes[cls.declaration];
+  }
+
+  ClassHierarchyNode _ensureClassHierarchyNode(ClassElement cls) {
+    cls = cls.declaration;
+    return _classHierarchyNodes.putIfAbsent(cls, () {
+      ClassHierarchyNode node = new ClassHierarchyNode(cls);
+      if (cls.superclass != null) {
+        _ensureClassHierarchyNode(cls.superclass).addDirectSubclass(node);
+      }
+      return node;
+    });
+  }
+
+  /// Returns [ClassSet] for [cls] used to model the extends and implements
+  /// relations of known classes.
+  ///
+  /// This method is only provided for testing. For queries on classes, use the
+  /// methods defined in [ClassWorld].
+  ClassSet getClassSet(ClassElement cls) {
+    return _classSets[cls.declaration];
+  }
+
+  ClassSet _ensureClassSet(ClassElement cls) {
+    cls = cls.declaration;
+    return _classSets.putIfAbsent(cls, () {
+      ClassHierarchyNode node = _ensureClassHierarchyNode(cls);
+      ClassSet classSet = new ClassSet(node);
+
+      for (InterfaceType type in cls.allSupertypes) {
+        // TODO(johnniwinther): Optimization: Avoid adding [cls] to
+        // superclasses.
+        ClassSet subtypeSet = _ensureClassSet(type.element);
+        subtypeSet.addSubtype(node);
+      }
+      return classSet;
+    });
   }
 
   void populate() {
-
-    /// Ensure that a [ClassHierarchyNode] exists for [cls]. Updates the
-    /// `isDirectlyInstantiated` and `isIndirectlyInstantiated` property of the
-    /// node according the provided arguments and returns the node.
-    ClassHierarchyNode createClassHierarchyNodeForClass(
+    /// Updates the `isDirectlyInstantiated` and `isIndirectlyInstantiated`
+    /// properties of the [ClassHierarchyNode] for [cls].
+    void updateClassHierarchyNodeForClass(
         ClassElement cls,
         {bool directlyInstantiated: false,
          bool indirectlyInstantiated: false}) {
-      assert(isInstantiated(cls));
-
-      ClassHierarchyNode node = _classHierarchyNodes.putIfAbsent(cls, () {
-        ClassHierarchyNode node = new ClassHierarchyNode(cls);
-        if (cls.superclass != null) {
-          createClassHierarchyNodeForClass(cls.superclass,
-              indirectlyInstantiated:
-                directlyInstantiated || indirectlyInstantiated)
-              .addDirectSubclass(node);
-        }
-        return node;
-      });
-      if (directlyInstantiated) {
+      assert(!directlyInstantiated || isInstantiated(cls));
+      ClassHierarchyNode node = getClassHierarchyNode(cls);
+      bool changed = false;
+      if (directlyInstantiated && !node.isDirectlyInstantiated) {
         node.isDirectlyInstantiated = true;
+        changed = true;
       }
-      if (indirectlyInstantiated) {
+      if (indirectlyInstantiated && !node.isIndirectlyInstantiated) {
         node.isIndirectlyInstantiated = true;
+        changed = true;
       }
-      return node;
+      if (changed && cls.superclass != null) {
+        updateClassHierarchyNodeForClass(
+            cls.superclass, indirectlyInstantiated: true);
+      }
     }
 
     void addSubtypes(ClassElement cls) {
@@ -380,16 +518,10 @@
       }
       assert(cls.isDeclaration);
       if (!cls.isResolved) {
-        compiler.internalError(cls, 'Class "${cls.name}" is not resolved.');
+        reporter.internalError(cls, 'Class "${cls.name}" is not resolved.');
       }
 
-      createClassHierarchyNodeForClass(cls, directlyInstantiated: true);
-
-      for (DartType type in cls.allSupertypes) {
-        Set<Element> subtypesOfSupertype =
-            _subtypes.putIfAbsent(type.element, () => new Set<ClassElement>());
-        subtypesOfSupertype.add(cls);
-      }
+      updateClassHierarchyNodeForClass(cls, directlyInstantiated: true);
 
       // Walk through the superclasses, and record the types
       // implemented by that type on the superclasses.
@@ -412,6 +544,19 @@
     compiler.resolverWorld.directlyInstantiatedClasses.forEach(addSubtypes);
   }
 
+  @override
+  String dump([ClassElement cls]) {
+    StringBuffer sb = new StringBuffer();
+    if (cls != null) {
+      sb.write("Classes in the closed world related to $cls:\n");
+    } else {
+      sb.write("Instantiated classes in the closed world:\n");
+    }
+    getClassHierarchyNode(compiler.objectClass)
+        .printOn(sb, ' ', instantiatedOnly: cls == null, withRespectTo: cls);
+    return sb.toString();
+  }
+
   void registerMixinUse(MixinApplicationElement mixinApplication,
                         ClassElement mixin) {
     // TODO(johnniwinther): Add map restricted to live classes.
@@ -535,11 +680,6 @@
     return elementsThatCannotThrow.contains(element);
   }
 
-  void registerImplicitSuperCall(Registry registry,
-                                 FunctionElement superConstructor) {
-    registry.registerDependency(superConstructor);
-  }
-
   void registerMightBePassedToApply(Element element) {
     functionsThatMightBePassedToApply.add(element);
   }
@@ -551,7 +691,7 @@
     // expressions. In such a case, we have to look at the original
     // function expressions's element.
     // TODO(herhut): Generate classes for function expressions earlier.
-    if (element is closureMapping.SynthesizedCallMethodElementX) {
+    if (element is SynthesizedCallMethodElementX) {
       return getMightBePassedToApply(element.expression);
     }
     return functionsThatMightBePassedToApply.contains(element);
diff --git a/pkg/compiler/pubspec.yaml b/pkg/compiler/pubspec.yaml
index d1f45c5..c885986 100644
--- a/pkg/compiler/pubspec.yaml
+++ b/pkg/compiler/pubspec.yaml
@@ -4,20 +4,39 @@
 #version: do-not-upload
 dependencies:
   package_config: ^0.1.1
+  pub_semver: ^1.2.1
+  js:
+    path: ../js
   js_ast:
     path: ../js_ast
   js_runtime:
     path: ../../sdk/lib/_internal/js_runtime
   sdk_library_metadata:
     path: ../../sdk/lib/_internal/sdk_library_metadata
+  dart2js_info:
+    path: ../../../../dart2js_info
+  lookup_map:
+    path: ../lookup_map
 
 # Uncomment if running gclient, so you can depend directly on the downloaded
 # versions of dart2js's transitive dependencies:
 #
 # dependency_overrides:
 #   package_config:
-#     path: ../../third_party/pkg/package_config
+#     path: ../../third_party/pkg_tested/package_config
 #   path:
 #     path: ../../third_party/pkg/path
 #   charcode:
 #     path: ../../third_party/pkg/charcode
+#   collection:
+#     path: ../../third_party/pkg/collection
+#   crypto:
+#     path: ../../third_party/pkg/crypto
+#   http_parser:
+#     path: ../../third_party/pkg/http_parser
+#   args:
+#     path: ../../third_party/pkg/args
+#   shelf:
+#     path: ../../third_party/pkg/shelf
+#   yaml:
+#     path: ../../third_party/pkg/yaml
diff --git a/pkg/compiler/samples/darttags/darttags.dart b/pkg/compiler/samples/darttags/darttags.dart
index 0653a09..2000b9b 100644
--- a/pkg/compiler/samples/darttags/darttags.dart
+++ b/pkg/compiler/samples/darttags/darttags.dart
@@ -33,7 +33,7 @@
 import 'dart:mirrors';
 
 import 'package:sdk_library_metadata/libraries.dart'
-    show LIBRARIES, LibraryInfo;
+    show libraries, LibraryInfo;
 
 import 'package:compiler/src/mirrors/analyze.dart'
     show analyze;
@@ -51,7 +51,7 @@
 const SDK_ROOT = '../../../../sdk/';
 
 bool isPublicDart2jsLibrary(String name) {
-  return !name.startsWith('_') && LIBRARIES[name].isDart2jsLibrary;
+  return !name.startsWith('_') && libraries[name].isDart2jsLibrary;
 }
 
 var handler;
@@ -82,7 +82,7 @@
   }
 
   // Get the names of public dart2js libraries.
-  Iterable<String> names = LIBRARIES.keys.where(isPublicDart2jsLibrary);
+  Iterable<String> names = libraries.keys.where(isPublicDart2jsLibrary);
 
   // Prepend "dart:" to the names.
   uris.addAll(names.map((String name) => Uri.parse('dart:$name')));
diff --git a/pkg/compiler/samples/jsonify/jsonify.dart b/pkg/compiler/samples/jsonify/jsonify.dart
index 0d0c7e6..7638ca5 100644
--- a/pkg/compiler/samples/jsonify/jsonify.dart
+++ b/pkg/compiler/samples/jsonify/jsonify.dart
@@ -8,7 +8,7 @@
 import 'dart:mirrors';
 
 import 'package:sdk_library_metadata/libraries.dart'
-    show LIBRARIES, LibraryInfo;
+    show libraries, LibraryInfo;
 
 import '../../lib/src/mirrors/analyze.dart'
     show analyze;
@@ -25,7 +25,7 @@
 const SDK_ROOT = '../../../../sdk/';
 
 bool isPublicDart2jsLibrary(String name) {
-  return !name.startsWith('_') && LIBRARIES[name].isDart2jsLibrary;
+  return !name.startsWith('_') && libraries[name].isDart2jsLibrary;
 }
 
 var handler;
@@ -54,7 +54,7 @@
   sdkRoot = libraryRoot.resolve('../');
 
   // Get the names of public dart2js libraries.
-  Iterable<String> names = LIBRARIES.keys.where(isPublicDart2jsLibrary);
+  Iterable<String> names = libraries.keys.where(isPublicDart2jsLibrary);
 
   // Turn the names into uris by prepending dart: to them.
   List<Uri> uris = names.map((String name) => Uri.parse('dart:$name')).toList();
@@ -75,7 +75,7 @@
     });
   });
 
-  LIBRARIES.forEach((name, info) {
+  libraries.forEach((name, info) {
     var patch = info.dart2jsPatchPath;
     if (patch != null) {
       Uri uri = sdkRoot.resolve('sdk/lib/$patch');
diff --git a/pkg/compiler/tool/track_memory.dart b/pkg/compiler/tool/track_memory.dart
new file mode 100644
index 0000000..effd92f
--- /dev/null
+++ b/pkg/compiler/tool/track_memory.dart
@@ -0,0 +1,193 @@
+// 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.
+
+/// A script to track the high water-mark of memory usage of an application.
+/// To monitor how much memory dart2js is using, run dart2js as follows:
+///
+///     DART_VM_OPTIONS=--observe dart2js ...
+///
+/// and run this script immediately after.
+library compiler.tool.track_memory;
+
+import 'dart:math' show max;
+import 'dart:io';
+import 'dart:async';
+
+import 'dart:convert';
+
+/// Socket to connect to the vm observatory service.
+WebSocket socket;
+
+main(args) async {
+  _printHeader();
+  _showProgress(0, 0, 0, 0);
+  try {
+    var port = args.length > 0 ? int.parse(args[0]) : 8181;
+    socket = await WebSocket.connect('ws://localhost:$port/ws');
+    socket.listen(_handleResponse);
+    await _resumeMainIsolateIfPaused();
+    _streamListen('GC');
+    _streamListen('Isolate');
+    _streamListen('Debug');
+  } catch (e) {
+    // TODO(sigmund): add better error messages, maybe option to retry.
+    print('\n${_RED}error${_NONE}: $e');
+    print('usage:\n'
+        '  Start a Dart process with the --observe flag (and optionally '
+        'the --pause_isolates_on_start flag), then invoke:\n'
+        '      dart tool/track_memory.dart [<port>]\n'
+        '  by default port is 8181');
+  }
+}
+
+/// Internal counter for request ids.
+int _requestId = 0;
+Map _pendingResponses = {};
+
+/// Subscribe to listen to a vm service data stream.
+_streamListen(String streamId) =>
+    _sendMessage('streamListen', {'streamId': '$streamId'});
+
+/// Tell the vm service to resume a specific isolate.
+_resumeIsolate(String isolateId) =>
+    _sendMessage('resume', {'isolateId': '$isolateId'});
+
+/// Resumes the main isolate if it was paused on start.
+_resumeMainIsolateIfPaused() async {
+  var vm = await _sendMessage('getVM');
+  var isolateId = vm['isolates'][0]['id'];
+  var isolate = await _sendMessage('getIsolate', {'isolateId': isolateId});
+  bool isPaused = isolate['pauseEvent']['kind'] == 'PauseStart';
+  if (isPaused) _resumeIsolate(isolateId);
+}
+
+/// Send a message to the vm service.
+Future _sendMessage(String method, [Map args= const {}]) {
+  var id = _requestId++;
+  _pendingResponses[id] = new Completer();
+  socket.add(JSON.encode({
+      'jsonrpc': '2.0',
+      'id': '$id',
+      'method': '$method',
+      'params': args,
+    }));
+  return _pendingResponses[id].future;
+}
+
+/// Handle all responses
+_handleResponse(String s) {
+  var json = JSON.decode(s);
+  if (json['method'] != 'streamNotify') {
+    var id = json['id'];
+    if (id is String) id = int.parse(id);
+    if (id == null || !_pendingResponses.containsKey(id)) return;
+    _pendingResponses.remove(id).complete(json['result']);
+    return;
+  }
+
+  // isolate pauses on exit automatically. We detect this to stop and exit.
+  if (json['params']['streamId'] == 'Debug') {
+    _handleDebug(json);
+  } else if (json['params']['streamId'] == 'Isolate') {
+    _handleIsolate(json);
+  } else if (json['params']['streamId'] == 'GC') {
+    _handleGC(json);
+  }
+}
+
+/// Handle a `Debug` notification.
+_handleDebug(Map json) {
+  var isolateId = json['params']['event']['isolate']['id'];
+  if (json['params']['event']['kind'] == 'PauseStart') {
+    _resumeIsolate(isolateId);
+  } if (json['params']['event']['kind'] == 'PauseExit') {
+    _resumeIsolate(isolateId);
+  }
+}
+
+/// Handle a `Isolate` notification.
+_handleIsolate(Map json) {
+  if (json['params']['event']['kind'] == 'IsolateExit') {
+    print('');
+    socket.close();
+  }
+}
+
+/// Handle a `GC` notification.
+_handleGC(Map json) {
+  // print(new JsonEncoder.withIndent(' ').convert(json));
+  var event = json['params']['event'];
+  var newUsed = event['new']['used'];
+  var newCapacity = event['new']['capacity'];
+  var oldUsed = event['old']['used'];
+  var oldCapacity = event['old']['capacity'];
+  _showProgress(newUsed, newCapacity, oldUsed, oldCapacity);
+}
+
+int lastNewUsed = 0;
+int lastOldUsed = 0;
+int lastMaxUsed = 0;
+int lastNewCapacity = 0;
+int lastOldCapacity = 0;
+int lastMaxCapacity = 0;
+
+/// Shows a status line with use/capacity numbers for new/old/total/max,
+/// highlighting in red when capacity increases, and in green when it decreases.
+_showProgress(newUsed, newCapacity, oldUsed, oldCapacity) {
+  var sb = new StringBuffer();
+  sb.write('\r '); // replace the status-line in place
+  _writeNumber(sb, lastNewUsed, newUsed);
+  _writeNumber(sb, lastNewCapacity, newCapacity, color: true);
+
+  sb.write(' | ');
+  _writeNumber(sb, lastOldUsed, oldUsed);
+  _writeNumber(sb, lastOldCapacity, oldCapacity, color: true);
+
+  sb.write(' | ');
+  _writeNumber(sb, lastNewUsed + lastOldUsed, newUsed + oldUsed);
+  _writeNumber(sb, lastNewCapacity + lastOldCapacity, newCapacity + oldCapacity,
+      color: true);
+
+  sb.write(' | ');
+  var maxUsed = max(lastMaxUsed, newUsed + oldUsed);
+  var maxCapacity = max(lastMaxCapacity, newCapacity + oldCapacity);
+  _writeNumber(sb, lastMaxUsed, maxUsed);
+  _writeNumber(sb, lastMaxCapacity, maxCapacity, color: true);
+  stdout.write('$sb');
+
+  lastNewUsed = newUsed;
+  lastOldUsed = oldUsed;
+  lastMaxUsed = maxUsed;
+  lastNewCapacity = newCapacity;
+  lastOldCapacity = oldCapacity;
+  lastMaxCapacity = maxCapacity;
+}
+
+const mega = 1024 * 1024;
+_writeNumber(sb, before, now, {color: false}) {
+  if (color) sb.write(before < now ? _RED : before > now ? _GREEN : '');
+  var string;
+  if (now < 1024) {
+    string = ' ${now}b';
+  } else if (now < mega) {
+    string = ' ${(now/1024).toStringAsFixed(0)}K';
+  } else {
+    string = ' ${(now/mega).toStringAsFixed(1)}M';
+  }
+  if (string.length < 10) string = '${' ' * (8 - string.length)}$string';
+  sb.write(string);
+  if (color) sb.write(before != now ? _NONE : '');
+  return before > now;
+}
+
+_printHeader() {
+  print('''
+Memory usage:
+ new generation   | old generation   | total            | max
+  in-use/capacity |  in-use/capacity |  in-use/capacity |  in-use/capacity ''');
+}
+
+const _RED = '\x1b[31m';
+const _GREEN = '\x1b[32m';
+const _NONE = '\x1b[0m';
diff --git a/pkg/dart2js_incremental/lib/dart2js_incremental.dart b/pkg/dart2js_incremental/lib/dart2js_incremental.dart
index bcbc760..12d285c 100644
--- a/pkg/dart2js_incremental/lib/dart2js_incremental.dart
+++ b/pkg/dart2js_incremental/lib/dart2js_incremental.dart
@@ -8,7 +8,7 @@
     EventSink,
     Future;
 
-import 'dart:profiler' show
+import 'dart:developer' show
     UserTag;
 
 import 'package:compiler/src/apiimpl.dart' show
diff --git a/pkg/dart2js_incremental/lib/diff.dart b/pkg/dart2js_incremental/lib/diff.dart
index a667fad..b0569d1 100644
--- a/pkg/dart2js_incremental/lib/diff.dart
+++ b/pkg/dart2js_incremental/lib/diff.dart
@@ -19,15 +19,19 @@
 import 'package:compiler/src/elements/modelx.dart' show
     DeclarationSite;
 
-import 'package:compiler/src/scanner/scannerlib.dart' show
-    EOF_TOKEN,
-    ErrorToken,
-    IDENTIFIER_TOKEN,
-    KEYWORD_TOKEN,
+import 'package:compiler/src/parser/partial_elements.dart' show
     PartialClassElement,
-    PartialElement,
+    PartialElement;
+
+import 'package:compiler/src/tokens/token.dart' show
+    ErrorToken,
     Token;
 
+import 'package:compiler/src/tokens/token_constants.dart' show
+    EOF_TOKEN,
+    IDENTIFIER_TOKEN,
+    KEYWORD_TOKEN;
+
 class Difference {
   final DeclarationSite before;
   final DeclarationSite after;
diff --git a/pkg/dart2js_incremental/lib/library_updater.dart b/pkg/dart2js_incremental/lib/library_updater.dart
index bd2188b..eb4bbd1 100644
--- a/pkg/dart2js_incremental/lib/library_updater.dart
+++ b/pkg/dart2js_incremental/lib/library_updater.dart
@@ -7,16 +7,13 @@
 import 'dart:async' show
     Future;
 
-import 'dart:convert' show
-    UTF8;
-
 import 'package:compiler/compiler.dart' as api;
 
-import 'package:compiler/src/dart2jslib.dart' show
-    Compiler,
-    EnqueueTask,
-    MessageKind,
-    Script;
+import 'package:compiler/src/compiler.dart' show
+    Compiler;
+
+import 'package:compiler/src/diagnostics/messages.dart' show
+    MessageKind;
 
 import 'package:compiler/src/elements/elements.dart' show
     ClassElement,
@@ -27,18 +24,36 @@
     STATE_NOT_STARTED,
     ScopeContainerElement;
 
-import 'package:compiler/src/scanner/scannerlib.dart' show
-    EOF_TOKEN,
-    Listener,
-    NodeListener,
-    Parser,
+import 'package:compiler/src/enqueue.dart' show
+    EnqueueTask;
+
+import 'package:compiler/src/parser/listener.dart' show
+    Listener;
+
+import 'package:compiler/src/parser/node_listener.dart' show
+    NodeListener;
+
+import 'package:compiler/src/parser/partial_elements.dart' show
     PartialClassElement,
     PartialElement,
     PartialFieldList,
-    PartialFunctionElement,
-    Scanner,
+    PartialFunctionElement;
+
+import 'package:compiler/src/parser/parser.dart' show
+    Parser;
+
+import 'package:compiler/src/scanner/scanner.dart' show
+    Scanner;
+
+import 'package:compiler/src/tokens/token.dart' show
     Token;
 
+import 'package:compiler/src/tokens/token_constants.dart' show
+    EOF_TOKEN;
+
+import 'package:compiler/src/script.dart' show
+    Script;
+
 import 'package:compiler/src/io/source_file.dart' show
     CachingUtf8BytesSourceFile,
     SourceFile,
@@ -59,11 +74,7 @@
 import 'package:compiler/src/js/js.dart' as jsAst;
 
 import 'package:compiler/src/js_emitter/js_emitter.dart' show
-    ClassBuilder,
-    ClassEmitter,
     CodeEmitterTask,
-    ContainerBuilder,
-    MemberInfo,
     computeMixinClass;
 
 import 'package:compiler/src/js_emitter/full_emitter/emitter.dart'
@@ -95,7 +106,7 @@
     FieldElementX,
     LibraryElementX;
 
-import 'package:compiler/src/universe/universe.dart' show
+import 'package:compiler/src/universe/selector.dart' show
     Selector;
 
 import 'package:compiler/src/constants/values.dart' show
@@ -672,7 +683,7 @@
       PartialFunctionElement before,
       PartialFunctionElement after) {
     FunctionExpression node =
-        after.parseNode(compiler).asFunctionExpression();
+        after.parseNode(compiler.parsing).asFunctionExpression();
     if (node == null) {
       return cannotReuse(after, "Not a function expression: '$node'");
     }
@@ -694,7 +705,7 @@
       Token diffToken,
       PartialClassElement before,
       PartialClassElement after) {
-    ClassNode node = after.parseNode(compiler).asClassNode();
+    ClassNode node = after.parseNode(compiler.parsing).asClassNode();
     if (node == null) {
       return cannotReuse(after, "Not a ClassNode: '$node'");
     }
diff --git a/pkg/docgen/LICENSE b/pkg/docgen/LICENSE
deleted file mode 100644
index 5c60afe..0000000
--- a/pkg/docgen/LICENSE
+++ /dev/null
@@ -1,26 +0,0 @@
-Copyright 2014, the Dart project authors. All rights reserved.
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
-    * Redistributions of source code must retain the above copyright
-      notice, this list of conditions and the following disclaimer.
-    * Redistributions in binary form must reproduce the above
-      copyright notice, this list of conditions and the following
-      disclaimer in the documentation and/or other materials provided
-      with the distribution.
-    * Neither the name of Google Inc. nor the names of its
-      contributors may be used to endorse or promote products derived
-      from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/pkg/docgen/README.md b/pkg/docgen/README.md
deleted file mode 100644
index 95ee68a..0000000
--- a/pkg/docgen/README.md
+++ /dev/null
@@ -1,137 +0,0 @@
-docgen
-======
-
-A documentation generator for Dart.
-- - -
-The docgen tool takes in a file or directory as input and produces documentation
-for all `.dart` file it finds as YAML or JSON files. This outputs information 
-about all classes, variables, functions, and methods defined in the library and 
-its imported libraries.
-
-### Quick Start: Common Commands 
-
-##### To only generate documentation, while standing in the `bin` directory:
-
-`dartdoc.py` generates all documentation and runs a local server with your html
-pages.
-
-`dartdoc.py -d` ONLY generates documentation for the SDK and all packages (no
-html pages generated and no server).
-
-`dartdoc.py -d -o package/to/document` ONLY generates documenation for the
-specified package.
-
-##### To generate documentation and view it through the webpage:
-- Install [Google App Engine SDK for Python][GAE] (one time setup) and agree to
-   add symlinks so that dev\_appserver.py can be found on your PATH.
-- Run `dartdoc.py`.
-
-### Generating files & uploading to Cloud Storage
-
-The viewer uses YAML files generated by the docgen package as the data 
-being displayed. These files are stored in Google Cloud Storage.
-
- - Run `python upload_docgen.py` to generate these files and upload them to 
- Cloud Storage as a new version.
-- - -
-These tasks can be done separately if necessary:
-
-##### 
-
-#### Generating YAML files
-
-YAML files can be generated using the docgen package in the dart repository. 
-
-###### Usage 
-
-Run  `dart docgen.dart [OPTIONS] <path to directory or file>`
-
-###### Options available
-
-- `-h`, `--help` Prints help and usage information.
-- `-v`, `--verbose` Output more logging information.
-- `-j`, `--[no-]json` Outputs to JSON. Files are outputted to YAML by default. 
-If `--append` is used, it takes the file-format of the previous run stated in 
-library_list.json ignoring the flag.
-- `--include-private` Flag to include private declarations.
-- `--include-sdk` Flag to parse SDK Library files imported.
-- `--parse-sdk` Parses the SDK libraries only. (Ignores the path passed in.)
-- `--package-root` Sets the package root of the library being analyzed.
-- `--append` Appends to the docs folder, library_list.json, and index.txt.
-- `--introduction` Adds the provided markdown text file as the introduction
-for the outputted documentation.
-
-
-###### Output directory
-Documented libraries will be located at bin/docs in either YAML or JSON format 
-depending on options specified. There will also be a library\_list.json, 
-containing a list of all the libraries inside the docs folder. 
-
-To get more information on how to use the outputted documentation with 
-dartdoc-viewer, please take a look at the 
-[dartdoc-viewer documentation][dartdoc-viewer].
-
-#### Uploading to Cloud Storage
-
-To push new files to Google Cloud Storage for use by the viewer, use the 
-`gsutil` tool located at third_party/gsutil/gsutil in the Dart repository.
-
- - Run `python gsutil -m cp -q -a public-read -r <folder> gs://dartlang-docgen`
- to upload the specified folder to the viewer's bucket. Be sure to also upload 
- a new VERSION file if the uploaded folder is to be used.**
-
-**Note that the bucket contains several numbered folders for each version of 
-the documentation. Run `python gsutil ls gs://dartlang-docgen` to see the file 
-layout. Follow this convention and update a new VERSION file when uploading 
-a new version of documentation. You can see the format of the VERSION file 
-by running `python gsutil cat gs://dartlang-docgen/VERSION`.
-
-### Viewing generated documentation
-
-Docgen's generated YAML files can be used by the 
-[Dart Documentation Viewer][dartdoc-viewer] for easy viewing and navigation 
-through a project. 
-
----
-
-#### Using dartdoc.py
-
-The `dartdoc.py` script located in the `bin` directory is a useful tool for 
-creating documentation for a Dart project and running it locally. 
-
-##### Setup
-
-The `dartdoc.py` script makes use of the 
-[Google App Engine SDK for Python][GAE]'s development server to serve the 
-documentation viewer. Install a recent version of the SDK before running 
-`dartdoc.py`.
-
-##### Running dartdoc.py
-
-######Common Options
-
-The following options are the most used:
-
-    python dartdoc.py --gae-sdk=<path to SDK>
-      --options=<path to files>
-      --options=--parse-sdk
-      --options='--include-sdk <path to files>'
-      --options='--append <path to files>'
-
-######All Options
-
-Run `python dartdoc.py -h` from the `bin` directory for all available options. 
-The two required options are as follows:
- 
- 1. The `--options` option describes any options being passed into `docgen.dart`.
- If more then one option is desired, separate the options with a space 
- (ex. `--options='--include-sdk files'`).
- 2. The `--gae-sdk` option gives the absolute path to the 
- [Google App Engine SDK][GAE]. 
-
-Running `python dartdoc.py --options=<docgen options> --gae-sdk=<path to SDK>` 
-will serve files generated by `docgen.dart` in your browser.
-
-[dartdoc-viewer]: https://github.com/dart-lang/dartdoc-viewer "Dartdoc-Viewer"
-[GAE]: https://developers.google.com/appengine/downloads#Google_App_Engine_SDK_for_Python  "Google App Engine SDK for Python"
-
diff --git a/pkg/docgen/bin/docgen.dart b/pkg/docgen/bin/docgen.dart
deleted file mode 100644
index 5bb7e20..0000000
--- a/pkg/docgen/bin/docgen.dart
+++ /dev/null
@@ -1,156 +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 'dart:io';
-
-import 'package:args/args.dart';
-import 'package:logging/logging.dart';
-import 'package:path/path.dart' as path;
-
-// Must use relative paths because library imports mirrors via relative paths
-import '../lib/docgen.dart';
-
-/**
- * Analyzes Dart files and generates a representation of included libraries,
- * classes, and members.
- */
-void main(List<String> arguments) {
-  var options = _initArgParser().parse(arguments);
-  var files = options.rest.map(path.normalize).toList();
-  if (files.isEmpty) _printHelpAndExit();
-  var startPage = options['start-page'];
-  if (_singlePackage(files) && startPage == null) {
-    startPage = _defaultStartPageFor(files);
-    print("Using default options for documenting a single package: "
-        "--start-page=$startPage");
-  }
-  var includeSdk = options['parse-sdk'] || options['include-sdk'];
-  var scriptDir = path.dirname(Platform.script.toFilePath());
-  var introduction = includeSdk ? '' : options['introduction'];
-
-  var pubScript = options['sdk'] != null ?
-      path.join(options['sdk'], 'bin', 'pub') : 'pub';
-
-  var dartBinary = options['sdk'] != null ?
-      path.join(options['sdk'], 'bin', 'dart') : 'dart';
-
-  var excludedLibraries = options['exclude-lib'];
-  if (excludedLibraries == null) excludedLibraries = [];
-
-  var indentJSON = options['indent-json'] as bool;
-
-  docgen(files,
-      packageRoot: options['package-root'],
-      includePrivate: options['include-private'],
-      includeSdk: includeSdk,
-      parseSdk: options['parse-sdk'],
-      introFileName: introduction,
-      out: options['out'],
-      excludeLibraries: excludedLibraries,
-      includeDependentPackages: options['include-dependent-packages'],
-      compile: options['compile'],
-      serve: options['serve'],
-      dartBinary: dartBinary,
-      pubScript: pubScript,
-      noDocs: options['no-docs'],
-      startPage: startPage,
-      indentJSON: indentJSON,
-      sdk: options['sdk']);
-}
-
-/**
- * Print help if we are passed the help option or invalid arguments.
- */
-void _printHelpAndExit() {
-  print(_initArgParser().usage);
-  print('Usage: dartdocgen [OPTIONS] fooDir/barFile');
-  exit(0);
-}
-
-/**
- * If the user seems to have given us a single package to document, use some
- * reasonable arguments for what they probably meant.
- */
-bool _singlePackage(List files) {
-  if (files.length != 1) return false;
-  var pubspec = new File(path.join(files.first, 'pubspec.yaml'));
-  if (!pubspec.existsSync()) return false;
-  return true;
-}
-
-/**
- * If we've specified just a package and no other command-line options,
- * use the single package name as the start page.
- */
-String _defaultStartPageFor(files) {
-  var pubspec = new File(path.join(files.first, 'pubspec.yaml'));
-  if (!pubspec.existsSync()) return null;
-  return packageNameFor(files.first);
-}
-
-/**
- * Creates parser for docgen command line arguments.
- */
-ArgParser _initArgParser() {
-  var parser = new ArgParser();
-  parser.addFlag('help', abbr: 'h',
-      help: 'Prints help and usage information.',
-      negatable: false,
-      callback: (help) {
-        if (help) _printHelpAndExit();
-      });
-  parser.addFlag('verbose', abbr: 'v',
-      help: 'Output more logging information.', negatable: false,
-      callback: (verbose) {
-        if (verbose) Logger.root.level = Level.FINEST;
-      });
-  parser.addFlag('include-private',
-      help: 'Flag to include private declarations.', negatable: false);
-  parser.addFlag('include-sdk',
-      help: 'Flag to parse SDK Library files.',
-      defaultsTo: false,
-      negatable: true);
-  parser.addFlag('parse-sdk',
-      help: 'Parses the SDK libraries only.',
-      defaultsTo: false, negatable: false);
-  parser.addOption('package-root',
-      help: 'Sets the package root of the library being analyzed.');
-  parser.addFlag('compile', help: 'Clone the documentation viewer repo locally '
-      '(if not already present) and compile with dart2js', defaultsTo: false,
-      negatable: false);
-  parser.addFlag('serve', help: 'Clone the documentation viewer repo locally '
-      '(if not already present), compile with dart2js, '
-      'and start a simple server',
-      defaultsTo: false, negatable: false);
-  parser.addFlag('no-docs', help: 'Do not generate any new documentation',
-      defaultsTo: false, negatable: false);
-  parser.addOption('introduction',
-      help: 'Adds the provided markdown text file as the introduction'
-        ' for the generated documentation.', defaultsTo: '');
-  parser.addOption('out',
-      help: 'The name of the output directory.',
-      defaultsTo: 'docs');
-  parser.addOption('exclude-lib',
-      help: 'Exclude the library by this name from the documentation',
-      allowMultiple: true);
-  parser.addFlag('include-dependent-packages',
-      help: 'Assumes we are documenting a single package and are running '
-        'in the directory with its pubspec. Includes documentation for all '
-        'of its dependent packages.',
-      defaultsTo: true, negatable: true);
-  parser.addOption('sdk',
-      help: 'SDK directory',
-      defaultsTo: null);
-  parser.addOption('start-page',
-      help: 'By default the viewer will start at the SDK introduction page. '
-        'To start at some other page, e.g. for a package, provide the name '
-        'of the package in this argument, e.g. --start-page=intl will make '
-        'the start page of the viewer be the intl package.',
-        defaultsTo: null);
-  parser.addFlag('indent-json',
-      help: 'Indents each level of JSON output by two spaces',
-      defaultsTo: false, negatable: true);
-
-  return parser;
-}
diff --git a/pkg/docgen/lib/docgen.dart b/pkg/docgen/lib/docgen.dart
deleted file mode 100644
index a9f171a..0000000
--- a/pkg/docgen/lib/docgen.dart
+++ /dev/null
@@ -1,73 +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.
-
-/// **docgen** is a tool for creating machine readable representations of Dart
-/// code metadata, including: classes, members, comments and annotations.
-///
-/// docgen is run on a `.dart` file or a directory containing `.dart` files.
-///
-///      $ dart docgen.dart [OPTIONS] [FILE/DIR]
-///
-/// This creates files called `docs/<library_name>.yaml` in your current
-/// working directory.
-library docgen;
-
-import 'dart:async';
-
-import 'src/generator.dart' as gen;
-import 'src/viewer.dart' as viewer;
-
-export 'src/generator.dart' show getMirrorSystem;
-export 'src/library_helpers.dart' show getDocgenObject;
-export 'src/models.dart';
-export 'src/package_helpers.dart' show packageNameFor;
-
-/// Docgen constructor initializes the link resolver for markdown parsing.
-/// Also initializes the command line arguments.
-///
-/// [packageRoot] is the packages directory of the directory being analyzed.
-/// If [includeSdk] is `true`, then any SDK libraries explicitly imported will
-/// also be documented.
-/// If [parseSdk] is `true`, then all Dart SDK libraries will be documented.
-/// This option is useful when only the SDK libraries are needed.
-/// If [compile] is `true`, then after generating the documents, compile the
-/// viewer with dart2js.
-/// If [serve] is `true`, then after generating the documents we fire up a
-/// simple server to view the documentation.
-///
-/// Returned Future completes with true if document generation is successful.
-Future<bool> docgen(List<String> files, {String packageRoot,
-    bool includePrivate: false, bool includeSdk: false, bool parseSdk: false,
-    String introFileName: '', String out: gen.DEFAULT_OUTPUT_DIRECTORY,
-    List<String> excludeLibraries: const [],
-    bool includeDependentPackages: false, bool compile: false,
-    bool serve: false, bool noDocs: false, String startPage,
-    String pubScript : 'pub', String dartBinary: 'dart',
-    bool indentJSON: false, String sdk}) {
-  var result;
-  if (!noDocs) {
-    viewer.ensureMovedViewerCode();
-    result = gen.generateDocumentation(files, packageRoot: packageRoot,
-        includePrivate: includePrivate,
-        includeSdk: includeSdk, parseSdk: parseSdk,
-        introFileName: introFileName, out: out,
-        excludeLibraries: excludeLibraries,
-        includeDependentPackages: includeDependentPackages,
-        startPage: startPage, pubScriptValue: pubScript,
-        dartBinaryValue: dartBinary, indentJSON: indentJSON, sdk: sdk);
-    viewer.addBackViewerCode();
-    if (compile || serve) {
-      result.then((success) {
-        if (success) {
-          viewer.createViewer(serve);
-        }
-      });
-    }
-  } else if (compile || serve) {
-    gen.pubScript = pubScript;
-    gen.dartBinary = dartBinary;
-    viewer.createViewer(serve);
-  }
-  return result;
-}
diff --git a/pkg/docgen/lib/src/exports/dart2js_mirrors.dart b/pkg/docgen/lib/src/exports/dart2js_mirrors.dart
deleted file mode 100644
index d99a98c..0000000
--- a/pkg/docgen/lib/src/exports/dart2js_mirrors.dart
+++ /dev/null
@@ -1,7 +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 docgen.exports.dart2js_mirrors;
-
-export 'package:compiler/src/mirrors/dart2js_mirrors.dart';
diff --git a/pkg/docgen/lib/src/exports/libraries.dart b/pkg/docgen/lib/src/exports/libraries.dart
deleted file mode 100644
index 7e48c79..0000000
--- a/pkg/docgen/lib/src/exports/libraries.dart
+++ /dev/null
@@ -1,7 +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 docgen.exports.libraries;
-
-export 'package:sdk_library_metadata/libraries.dart';
diff --git a/pkg/docgen/lib/src/exports/mirrors_util.dart b/pkg/docgen/lib/src/exports/mirrors_util.dart
deleted file mode 100644
index f02b55e..0000000
--- a/pkg/docgen/lib/src/exports/mirrors_util.dart
+++ /dev/null
@@ -1,7 +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 docgen.exports.mirrors_util;
-
-export 'package:compiler/src/mirrors/mirrors_util.dart';
diff --git a/pkg/docgen/lib/src/exports/source_mirrors.dart b/pkg/docgen/lib/src/exports/source_mirrors.dart
deleted file mode 100644
index 5f2f1ff..0000000
--- a/pkg/docgen/lib/src/exports/source_mirrors.dart
+++ /dev/null
@@ -1,8 +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 docgen.exports.source_mirrors;
-
-export 'package:compiler/src/mirrors/source_mirrors.dart'
-    hide SourceLocation;
diff --git a/pkg/docgen/lib/src/generator.dart b/pkg/docgen/lib/src/generator.dart
deleted file mode 100644
index 18ed895..0000000
--- a/pkg/docgen/lib/src/generator.dart
+++ /dev/null
@@ -1,487 +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 docgen.generator;
-
-import 'dart:async';
-import 'dart:collection';
-import 'dart:convert';
-import 'dart:io';
-
-import 'package:markdown/markdown.dart' as markdown;
-import 'package:path/path.dart' as path;
-
-import 'package:compiler/compiler.dart' as api;
-import 'package:compiler/src/filenames.dart';
-import 'package:compiler/src/mirrors/analyze.dart'
-    as dart2js;
-import 'package:compiler/src/source_file_provider.dart';
-
-import 'exports/dart2js_mirrors.dart' as dart2js_mirrors;
-import 'exports/libraries.dart';
-import 'exports/mirrors_util.dart' as dart2js_util;
-import 'exports/source_mirrors.dart';
-
-import 'io.dart';
-import 'library_helpers.dart';
-import 'models.dart';
-import 'package_helpers.dart';
-
-const String DEFAULT_OUTPUT_DIRECTORY = 'docs';
-
-/// The directory where the output docs are generated.
-String get outputDirectory => _outputDirectory;
-String _outputDirectory;
-
-/// Library names to explicitly exclude.
-///
-///   Set from the command line option
-/// --exclude-lib.
-List<String> _excluded;
-
-/// The path of the pub script.
-String pubScript;
-
-/// The path of Dart binary.
-String dartBinary;
-
-/// Docgen constructor initializes the link resolver for markdown parsing.
-/// Also initializes the command line arguments.
-///
-/// [packageRoot] is the packages directory of the directory being analyzed.
-/// If [includeSdk] is `true`, then any SDK libraries explicitly imported will
-/// also be documented.
-/// If [parseSdk] is `true`, then all Dart SDK libraries will be documented.
-/// This option is useful when only the SDK libraries are needed.
-///
-/// Returned Future completes with true if document generation is successful.
-Future<bool> generateDocumentation(List<String> files, {String packageRoot,
-    bool outputToYaml: true, bool includePrivate: false, bool includeSdk: false,
-    bool parseSdk: false, String introFileName: '',
-    out: DEFAULT_OUTPUT_DIRECTORY, List<String> excludeLibraries: const [], bool
-    includeDependentPackages: false, String startPage, String dartBinaryValue,
-    String pubScriptValue, bool indentJSON: false, String sdk}) {
-  _excluded = excludeLibraries;
-  dartBinary = dartBinaryValue;
-  pubScript = pubScriptValue;
-
-  logger.onRecord.listen((record) => print(record.message));
-
-  _ensureOutputDirectory(out);
-  var updatedPackageRoot = _obtainPackageRoot(packageRoot, parseSdk, files);
-
-  var requestedLibraries = _findLibrariesToDocument(files,
-      includeDependentPackages);
-
-  var allLibraries = []..addAll(requestedLibraries);
-  if (includeSdk) {
-    allLibraries.addAll(_listSdk());
-  }
-
-  return getMirrorSystem(allLibraries, includePrivate,
-      packageRoot: updatedPackageRoot, parseSdk: parseSdk, sdkRoot: sdk)
-      .then((MirrorSystem mirrorSystem) {
-    if (mirrorSystem.libraries.isEmpty) {
-      throw new StateError('No library mirrors were created.');
-    }
-    initializeTopLevelLibraries(mirrorSystem);
-
-    var availableLibraries = mirrorSystem.libraries.values
-        .where((each) => each.uri.scheme == 'file');
-    var availableLibrariesByPath =
-        new Map.fromIterables(availableLibraries.map((each) => each.uri),
-            availableLibraries);
-    var librariesToDocument = requestedLibraries
-          .map((each) {
-            return availableLibrariesByPath
-                .putIfAbsent(each, () => throw "Missing library $each");
-    }).toList();
-    librariesToDocument.addAll((includeSdk || parseSdk) ? sdkLibraries : []);
-    librariesToDocument.removeWhere((x) => _excluded.contains(
-        dart2js_util.nameOf(x)));
-    _documentLibraries(librariesToDocument, includeSdk, parseSdk, introFileName,
-        startPage, indentJSON);
-    return true;
-  });
-}
-
-
-/// Analyzes set of libraries by getting a mirror system and triggers the
-/// documentation of the libraries.
-Future<MirrorSystem> getMirrorSystem(List<Uri> libraries,
-    bool includePrivate, {String packageRoot, bool parseSdk: false,
-    String sdkRoot}) {
-  if (libraries.isEmpty) throw new StateError('No Libraries.');
-
-  includePrivateMembers = includePrivate;
-
-  // Finds the root of SDK library based off the location of docgen.
-  // We have two different places to look, depending if we're in a development
-  // repo or in a built SDK, either sdk or dart-sdk respectively
-  if (sdkRoot == null) {
-    var root = rootDirectory;
-    sdkRoot = path.normalize(path.absolute(path.join(root, 'sdk')));
-    if (!new Directory(sdkRoot).existsSync()) {
-      sdkRoot = path.normalize(path.absolute(path.join(root, 'dart-sdk')));
-    }
-  }
-  logger.info('SDK Root: ${sdkRoot}');
-  return analyzeLibraries(libraries, sdkRoot, packageRoot: packageRoot);
-}
-
-/// Writes [text] to a file in the output directory.
-void _writeToFile(String text, String filename) {
-  if (text == null) return;
-
-  var filePath = path.join(_outputDirectory, filename);
-
-  var parentDir = new Directory(path.dirname(filePath));
-  if (!parentDir.existsSync()) parentDir.createSync(recursive: true);
-
-  try {
-    new File(filePath)
-        .writeAsStringSync(text, mode: FileMode.WRITE);
-  } on FileSystemException catch (e) {
-    print('Failed to write to the path $filePath. Do you have write '
-        'permissions to that directory? If not, please specify a different '
-        'output directory using the --out option.');
-    exit(1);
-  }
-}
-
-/// Resolve all the links in the introductory comments for a given library or
-/// package as specified by [filename].
-String _readIntroductionFile(String fileName, bool includeSdk) {
-  var linkResolver = (name) => globalFixReference(name);
-  var defaultText = includeSdk ? _DEFAULT_SDK_INTRODUCTION : '';
-  var introText = defaultText;
-  if (fileName.isNotEmpty) {
-    var introFile = new File(fileName);
-    introText = introFile.existsSync() ? introFile.readAsStringSync() :
-        defaultText;
-  }
-  return markdown.markdownToHtml(introText, linkResolver: linkResolver,
-      inlineSyntaxes: MARKDOWN_SYNTAXES);
-}
-
-int _indexableComparer(Indexable a, Indexable b) {
-  if (a is Library && b is Library) {
-    var compare = a.packageName.compareTo(b.packageName);
-    if (compare == 0) {
-      compare = a.name.compareTo(b.name);
-    }
-    return compare;
-  }
-
-  if (a is Library) return -1;
-  if (b is Library) return 1;
-
-  return a.qualifiedName.compareTo(b.qualifiedName);
-}
-
-/// Creates documentation for filtered libraries.
-void _documentLibraries(List<LibraryMirror> libs, bool includeSdk,
-  bool parseSdk, String introFileName, String startPage, bool indentJson) {
-  libs.forEach((lib) {
-    // Files belonging to the SDK have a uri that begins with 'dart:'.
-    if (includeSdk || !lib.uri.toString().startsWith('dart:')) {
-      generateLibrary(lib);
-    }
-  });
-
-  var filteredEntities = new SplayTreeSet<Indexable>(_indexableComparer);
-  for (Indexable item in allIndexables) {
-    if (isFullChainVisible(item)) {
-      if (item is! Method ||
-          (item is Method && item.methodInheritedFrom == null)) {
-        filteredEntities.add(item);
-      }
-    }
-  }
-
-  // Outputs a JSON file with all libraries and their preview comments.
-  // This will help the viewer know what libraries are available to read in.
-  Map<String, dynamic> libraryMap = {
-      'libraries': filteredEntities.where((e) => e is Library).map((e) =>
-          e.previewMap).toList(),
-      'introduction': _readIntroductionFile(introFileName, includeSdk),
-      'filetype': 'json',
-      'sdkVersion': packageVersion(coreLibrary.mirror)
-    };
-
-  var encoder = new JsonEncoder.withIndent(indentJson ? '  ' : null);
-
-  _writeOutputFiles(libraryMap, filteredEntities, startPage, encoder);
-}
-
-/// Output all of the libraries and classes into json files for consumption by a
-/// viewer.
-void _writeOutputFiles(Map<String, dynamic> libraryMap, Iterable<Indexable>
-    filteredEntities, String startPage, JsonEncoder encoder) {
-  if (startPage != null) libraryMap['start-page'] = startPage;
-
-  _writeToFile(encoder.convert(libraryMap), 'library_list.json');
-
-  // Output libraries and classes to file after all information is generated.
-  filteredEntities.where((e) => e is Class || e is Library).forEach((output) {
-    _writeIndexableToFile(output, encoder);
-  });
-
-  // Outputs all the qualified names documented with their type.
-  // This will help generate search results.
-  var sortedEntities = filteredEntities
-      .map((e) => '${e.qualifiedName} ${e.typeName}')
-      .toList();
-
-  sortedEntities.sort();
-
-  var buffer = new StringBuffer()
-      ..writeAll(sortedEntities, '\n')
-      ..write('\n');
-
-  _writeToFile(buffer.toString(), 'index.txt');
-
-  var index = new SplayTreeMap.fromIterable(filteredEntities,
-      key: (e) => e.qualifiedName, value: (e) => e.typeName);
-
-  _writeToFile(encoder.convert(index), 'index.json');
-}
-
-/// Helper method to serialize the given Indexable out to a file.
-void _writeIndexableToFile(Indexable result, JsonEncoder encoder) {
-  var outputFile = result.fileName + '.json';
-  var output = encoder.convert(result.toMap());
-  _writeToFile(output, outputFile);
-}
-
-/// Set the location of the ouput directory, and ensure that the location is
-/// available on the file system.
-void _ensureOutputDirectory(String outputDirectory) {
-  _outputDirectory = outputDirectory;
-  var dir = new Directory(_outputDirectory);
-  if (dir.existsSync()) dir.deleteSync(recursive: true);
-}
-
-/// Analyzes set of libraries and provides a mirror system which can be used
-/// for static inspection of the source code.
-Future<MirrorSystem> analyzeLibraries(List<Uri> libraries, String
-    libraryRoot, {String packageRoot}) {
-  SourceFileProvider provider = new CompilerSourceFileProvider();
-  api.DiagnosticHandler diagnosticHandler = new FormattingDiagnosticHandler(
-      provider)
-      ..showHints = false
-      ..showWarnings = false;
-  Uri libraryUri = new Uri.file(appendSlash(libraryRoot));
-  Uri packageUri = null;
-  if (packageRoot == null) {
-    packageRoot = Platform.packageRoot;
-  }
-  packageUri = new Uri.file(appendSlash(packageRoot));
-  return dart2js.analyze(libraries, libraryUri, packageUri,
-      provider.readStringFromUri, diagnosticHandler, ['--preserve-comments',
-      '--categories=Client,Server'])..catchError((error) {
-        logger.severe('Error: Failed to create mirror system. ');
-        // TODO(janicejl): Use the stack trace package when bug is resolved.
-        // Currently, a string is thrown when it fails to create a mirror
-        // system, and it is not possible to use the stack trace. BUG(#11622)
-        // To avoid printing the stack trace.
-        exit(1);
-      });
-}
-
-/// For this run of docgen, determine the packageRoot value.
-///
-/// If packageRoot is not explicitly passed, we examine the files we're
-/// documenting to attempt to find a package root.
-String _obtainPackageRoot(String packageRoot, bool parseSdk,
-    List<String> files) {
-  if (packageRoot == null && !parseSdk) {
-    var type = FileSystemEntity.typeSync(files.first);
-    if (type == FileSystemEntityType.DIRECTORY) {
-      var files2 = listDir(files.first, recursive: true);
-      // Return '' means that there was no pubspec.yaml and therefore no
-      // packageRoot.
-      packageRoot = files2.firstWhere((f) => f.endsWith(
-          '${path.separator}pubspec.yaml'), orElse: () => '');
-      if (packageRoot != '') {
-        packageRoot = path.join(path.dirname(packageRoot), 'packages');
-      }
-    } else if (type == FileSystemEntityType.FILE) {
-      logger.warning('WARNING: No package root defined. If Docgen fails, try '
-          'again by setting the --package-root option.');
-    }
-  }
-  logger.info('Package Root: ${packageRoot}');
-  return path.normalize(path.absolute(packageRoot));
-}
-
-/// Given the user provided list of items to document, expand all directories
-/// to document out into specific files and add any dependent packages for
-/// documentation if desired.
-List<Uri> _findLibrariesToDocument(List<String> args, bool
-    includeDependentPackages) {
-  if (includeDependentPackages) {
-    args.addAll(_allDependentPackageDirs(args.first));
-  }
-
-  var libraries = new List<Uri>();
-  for (var arg in args) {
-    if (FileSystemEntity.typeSync(arg) == FileSystemEntityType.FILE) {
-      if (arg.endsWith('.dart')) {
-        var lib = new Uri.file(path.absolute(arg));
-        libraries.add(lib);
-        logger.info('Added to libraries: $lib');
-      }
-    } else {
-      libraries.addAll(_findFilesToDocumentInPackage(arg));
-    }
-  }
-  return libraries;
-}
-
-/// Given a package name, explore the directory and pull out all top level
-/// library files in the "lib" directory to document.
-List<Uri> _findFilesToDocumentInPackage(String packageDir) {
-  var libraries = [];
-  // To avoid anaylzing package files twice, only files with paths not
-  // containing '/packages' will be added. The only exception is if the file
-  // to analyze already has a '/package' in its path.
-  var files = listDir(packageDir, recursive: true, listDir: _packageDirList)
-      .where((f) => f.endsWith('.dart') &&
-        (!f.contains('${path.separator}packages') ||
-            packageDir.contains('${path.separator}packages')))
-      .toList();
-
-  var packageLibDir = path.join(packageDir, 'lib');
-  var packageLibSrcDir = path.join(packageLibDir, 'src');
-
-  files.forEach((String lib) {
-    // Only include libraries within the lib dir that are not in lib/src
-    if (path.isWithin(packageLibDir, lib) &&
-        !path.isWithin(packageLibSrcDir, lib)) {
-      // Only add the file if it does not contain 'part of'
-      // TODO(janicejl): Remove when Issue(12406) is resolved.
-      var contents = new File(lib).readAsStringSync();
-
-
-      if (contents.contains(new RegExp('\npart of ')) ||
-          contents.startsWith(new RegExp('part of '))) {
-        logger.warning('Skipping part "$lib". '
-            'Part files should be in "lib/src".');
-      } else {
-        libraries.add(new Uri.file(path.normalize(path.absolute(lib))));
-        logger.info('Added to libraries: $lib');
-      }
-    }
-  });
-  return libraries;
-}
-
-/// If [dir] contains both a `lib` directory and a `pubspec.yaml` file treat
-/// it like a package and only return the `lib` dir.
-///
-/// This ensures that packages don't have non-`lib` content documented.
-List<FileSystemEntity> _packageDirList(Directory dir) {
-  var entities = dir.listSync();
-
-  var pubspec = entities.firstWhere((e) => e is File &&
-      path.basename(e.path) == 'pubspec.yaml', orElse: () => null);
-
-  var libDir = entities.firstWhere((e) => e is Directory &&
-      path.basename(e.path) == 'lib', orElse: () => null);
-
-  if (pubspec != null && libDir != null) {
-    return [libDir];
-  } else {
-    return entities;
-  }
-}
-
-/// All of the directories for our dependent packages
-/// If this is not a package, return an empty list.
-List<String> _allDependentPackageDirs(String packageDirectory) {
-  var packageName = packageNameFor(packageDirectory);
-  if (packageName == '') return [];
-  var dependentsJson = Process.runSync(pubScript, ['list-package-dirs'],
-      workingDirectory: packageDirectory, runInShell: true);
-  if (dependentsJson.exitCode != 0) {
-    print(dependentsJson.stderr);
-  }
-  var dependents = JSON.decode(dependentsJson.stdout)['packages'];
-  return dependents != null ? dependents.values.toList() : [];
-}
-
-/// For all the libraries, return a list of the libraries that are part of
-/// the SDK.
-List<Uri> _listSdk() {
-  var sdk = new List<Uri>();
-  LIBRARIES.forEach((String name, LibraryInfo info) {
-    if (info.documented) {
-      sdk.add(Uri.parse('dart:$name'));
-      logger.info('Add to SDK: ${sdk.last}');
-    }
-  });
-  return sdk;
-}
-
-/// Currently left public for testing purposes. :-/
-void generateLibrary(dart2js_mirrors.Dart2JsLibraryMirror library) {
-  var result = new Library(library);
-  result.updateLibraryPackage(library);
-  logger.fine('Generated library for ${result.name}');
-}
-
-/// If we can't find the SDK introduction text, which will happen if running
-/// from a snapshot and using --parse-sdk or --include-sdk, then use this
-/// hard-coded version. This should be updated to be consistent with the text
-/// in docgen/doc/sdk-introduction.md
-// TODO(alanknight): It would be better if we could resolve the references to
-// dart:core etc. at load-time in the viewer. dartbug.com/20112
-const _DEFAULT_SDK_INTRODUCTION =
-    """
-Welcome to the Dart API reference documentation,
-covering the official Dart API libraries.
-Some of the most fundamental Dart libraries include:
-
-* [dart:core](./dart:core):
-  Core functionality such as strings, numbers, collections, errors,
-  dates, and URIs.
-* [dart:html](./dart:html):
-  DOM manipulation for web apps.
-* [dart:io](./dart:io):
-  I/O for command-line apps.
-
-Except for dart:core, you must import a library before you can use it.
-Here's an example of importing dart:html, dart:math, and a
-third popular library called
-[polymer.dart](http://www.dartlang.org/polymer-dart/):
-
-    import 'dart:html';
-    import 'dart:math';
-    import 'package:polymer/polymer.dart';
-
-Polymer.dart is an example of a library that isn't
-included in the Dart download,
-but is easy to get and update using the _pub package manager_.
-For information on finding, using, and publishing libraries (and more)
-with pub, see
-[pub.dartlang.org](http://pub.dartlang.org).
-
-The main site for learning and using Dart is
-[www.dartlang.org](http://www.dartlang.org).
-Check out these pages:
-
-  * [Dart homepage](http://www.dartlang.org)
-  * [Tutorials](http://www.dartlang.org/docs/tutorials/)
-  * [Programmer's Guide](http://www.dartlang.org/docs/)
-  * [Samples](http://www.dartlang.org/samples/)
-  * [A Tour of the Dart Libraries](http://www.dartlang.org/docs/dart-up-and-running/contents/ch03.html)
-
-This API reference is automatically generated from the source code in the
-[Dart project](https://code.google.com/p/dart/).
-If you'd like to contribute to this documentation, see
-[Contributing](https://code.google.com/p/dart/wiki/Contributing)
-and
-[Writing API Documentation](https://code.google.com/p/dart/wiki/WritingApiDocumentation).
-""";
diff --git a/pkg/docgen/lib/src/io.dart b/pkg/docgen/lib/src/io.dart
deleted file mode 100644
index 65e69e8..0000000
--- a/pkg/docgen/lib/src/io.dart
+++ /dev/null
@@ -1,61 +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.
-
-/// This is a helper library to make working with io easier.
-library docgen.io;
-
-// TODO(janicejl): listDir, canonicalize, resolveLink, and linkExists are from
-// pub/lib/src/io.dart. If the io.dart file becomes a package, should remove
-// copy of the functions.
-
-import 'dart:io';
-import 'package:path/path.dart' as path;
-
-/// Lists the contents of [dir].
-///
-/// If [recursive] is `true`, lists subdirectory contents (defaults to `false`).
-///
-/// Excludes files and directories beginning with `.`
-///
-/// The returned paths are guaranteed to begin with [dir].
-List<String> listDir(String dir, {bool recursive: false,
-  List<FileSystemEntity> listDir(Directory dir)}) {
-  if (listDir == null) listDir = (Directory dir) => dir.listSync();
-
-  return _doList(dir, new Set<String>(), recursive, listDir);
-}
-
-List<String> _doList(String dir, Set<String> listedDirectories, bool recurse,
-    List<FileSystemEntity> listDir(Directory dir)) {
-  var contents = <String>[];
-
-  // Avoid recursive symlinks.
-  var resolvedPath = new Directory(dir).resolveSymbolicLinksSync();
-  if (listedDirectories.contains(resolvedPath)) return [];
-
-  listedDirectories = new Set<String>.from(listedDirectories);
-  listedDirectories.add(resolvedPath);
-
-  var children = <String>[];
-  for (var entity in listDir(new Directory(dir))) {
-    // Skip hidden files and directories
-    if (path.basename(entity.path).startsWith('.')) {
-      continue;
-    }
-
-    contents.add(entity.path);
-    if (entity is Directory) {
-      // TODO(nweiz): don't manually recurse once issue 4794 is fixed.
-      // Note that once we remove the manual recursion, we'll need to
-      // explicitly filter out files in hidden directories.
-      if (recurse) {
-        children.addAll(_doList(entity.path, listedDirectories, recurse,
-            listDir));
-      }
-    }
-  }
-
-  contents.addAll(children);
-  return contents;
-}
diff --git a/pkg/docgen/lib/src/library_helpers.dart b/pkg/docgen/lib/src/library_helpers.dart
deleted file mode 100644
index 24e89d3..0000000
--- a/pkg/docgen/lib/src/library_helpers.dart
+++ /dev/null
@@ -1,220 +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 docgen.library_helpers;
-
-import 'package:logging/logging.dart';
-import 'package:markdown/markdown.dart' as markdown;
-
-import 'exports/source_mirrors.dart';
-import 'exports/mirrors_util.dart' as dart2js_util;
-
-import 'models/indexable.dart';
-import 'models/library.dart';
-import 'models/dummy_mirror.dart';
-
-typedef DeclarationMirror LookupFunction(DeclarationSourceMirror declaration,
-    String name);
-
-/// Support for [:foo:]-style code comments to the markdown parser.
-final List<markdown.InlineSyntax> MARKDOWN_SYNTAXES =
-  [new markdown.CodeSyntax(r'\[:\s?((?:.|\n)*?)\s?:\]')];
-
-bool get includePrivateMembers {
-  if (_includePrivate == null) {
-    throw new StateError('includePrivate has not been set');
-  }
-  return _includePrivate;
-}
-
-void set includePrivateMembers(bool value) {
-  if (value == null) throw new ArgumentError('includePrivate cannot be null');
-  _includePrivate = value;
-}
-
-bool _includePrivate;
-
-/// Return true if this item and all of its owners are all visible.
-bool isFullChainVisible(Indexable item) {
-  return includePrivateMembers || (!item.isPrivate && (item.owner != null ?
-      isFullChainVisible(item.owner) : true));
-}
-
-/// Logger for printing out progress of documentation generation.
-final Logger logger = new Logger('Docgen');
-
-/// The dart:core library, which contains all types that are always available
-/// without import.
-Library coreLibrary;
-
-/// Set of libraries declared in the SDK, so libraries that can be accessed
-/// when running dart by default.
-Iterable<LibraryMirror> get sdkLibraries => _sdkLibraries;
-Iterable<LibraryMirror> _sdkLibraries;
-
-////// Top level resolution functions
-/// Converts all [foo] references in comments to <a>libraryName.foo</a>.
-markdown.Node globalFixReference(String name) {
-  // Attempt the look up the whole name up in the scope.
-  String elementName = findElementInScopeWithPrefix(name, '');
-  if (elementName != null) {
-    return new markdown.Element.text('a', elementName);
-  }
-  return fixComplexReference(name);
-}
-
-/// This is a more complex reference. Try to break up if its of the form A<B>
-/// where A is an alphanumeric string and B is an A, a list of B ("B, B, B"),
-/// or of the form A<B>. Note: unlike other the other markdown-style links,
-/// all text inside the square brackets is treated as part of the link (aka
-/// the * is interpreted literally as a *, not as a indicator for bold <em>.
-///
-/// Example: [foo&lt;_bar_>] will produce
-/// <a>resolvedFoo</a>&lt;<a>resolved_bar_</a>> rather than an italicized
-/// version of resolvedBar.
-markdown.Node fixComplexReference(String name) {
-  // Parse into multiple elements we can try to resolve.
-  var tokens = _tokenizeComplexReference(name);
-
-  // Produce an html representation of our elements. Group unresolved and
-  // plain text are grouped into "link" elements so they display as code.
-  final textElements = [' ', ',', '>', _LESS_THAN];
-  var accumulatedHtml = '';
-
-  for (var token in tokens) {
-    bool added = false;
-    if (!textElements.contains(token)) {
-      String elementName = findElementInScopeWithPrefix(token, '');
-      if (elementName != null) {
-        accumulatedHtml += markdown.renderToHtml([new markdown.Element.text('a',
-            elementName)]);
-        added = true;
-      }
-    }
-    if (!added) {
-      accumulatedHtml += token;
-    }
-  }
-  return new markdown.Text(accumulatedHtml);
-}
-
-String findElementInScopeWithPrefix(String name, String packagePrefix) {
-  var lookupFunc = determineLookupFunc(name);
-  // Look in the dart core library scope.
-  var coreScope = coreLibrary == null ? null : lookupFunc(coreLibrary.mirror,
-      name);
-  if (coreScope != null) return packagePrefix + coreLibrary.docName;
-
-  // If it's a reference that starts with a another library name, then it
-  // looks for a match of that library name in the other sdk libraries.
-  if (name.contains('.')) {
-    var index = name.indexOf('.');
-    var libraryName = name.substring(0, index);
-    var remainingName = name.substring(index + 1);
-    foundLibraryName(library) => library.uri.pathSegments[0] == libraryName;
-
-    if (_sdkLibraries.any(foundLibraryName)) {
-      var library = _sdkLibraries.singleWhere(foundLibraryName);
-      // Look to see if it's a fully qualified library name.
-      var scope = determineLookupFunc(remainingName)(library, remainingName);
-      if (scope != null) {
-        var result = getDocgenObject(scope);
-        if (result is DummyMirror) {
-          return packagePrefix + result.docName;
-        } else {
-          return result.packagePrefix + result.docName;
-        }
-      }
-    }
-  }
-  return null;
-}
-
-/// Given a Dart2jsMirror, find the corresponding Docgen [MirrorBased] object.
-///
-/// We have this global lookup function to avoid re-implementing looking up
-/// the scoping rules for comment resolution here (it is currently done in
-/// mirrors). If no corresponding MirrorBased object is found, we return a
-/// [DummyMirror] that simply returns the original mirror's qualifiedName
-/// while behaving like a MirrorBased object.
-Indexable getDocgenObject(DeclarationMirror mirror, [Indexable owner]) {
-  Map<String, Indexable> docgenObj = lookupIndexableMap(mirror);
-
-  if (docgenObj == null) {
-    return new DummyMirror(mirror, owner);
-  }
-
-  var setToExamine = new Set();
-  if (owner != null) {
-    var firstSet = docgenObj[owner.docName];
-    if (firstSet != null) setToExamine.add(firstSet);
-    if (coreLibrary != null && docgenObj[coreLibrary.docName] != null) {
-      setToExamine.add(docgenObj[coreLibrary.docName]);
-    }
-  } else {
-    setToExamine.addAll(docgenObj.values);
-  }
-
-  Set<Indexable> results = new Set<Indexable>();
-  for (Indexable indexable in setToExamine) {
-    if (indexable.mirror.qualifiedName == mirror.qualifiedName &&
-        indexable.isValidMirror(mirror)) {
-      results.add(indexable);
-    }
-  }
-
-  if (results.length > 0) {
-    // This might occur if we didn't specify an "owner."
-    return results.first;
-  }
-  return new DummyMirror(mirror, owner);
-}
-
-void initializeTopLevelLibraries(MirrorSystem mirrorSystem) {
-  _sdkLibraries = mirrorSystem.libraries.values.where(
-      (each) => each.uri.scheme == 'dart');
-  coreLibrary = new Library(_sdkLibraries.singleWhere((lib) =>
-      lib.uri.toString().startsWith('dart:core')));
-}
-
-/// For a given name, determine if we need to resolve it as a qualified name
-/// or a simple name in the source mirors.
-LookupFunction determineLookupFunc(String name) => name.contains('.') ?
-  dart2js_util.lookupQualifiedInScope :
-    (mirror, name) => mirror.lookupInScope(name);
-
-/// Chunk the provided name into individual parts to be resolved. We take a
-/// simplistic approach to chunking, though, we break at " ", ",", "&lt;"
-/// and ">". All other characters are grouped into the name to be resolved.
-/// As a result, these characters will all be treated as part of the item to
-/// be resolved (aka the * is interpreted literally as a *, not as an
-/// indicator for bold <em>.
-List<String> _tokenizeComplexReference(String name) {
-  var tokens = [];
-  var append = false;
-  var index = 0;
-  while (index < name.length) {
-    if (name.indexOf(_LESS_THAN, index) == index) {
-      tokens.add(_LESS_THAN);
-      append = false;
-      index += _LESS_THAN.length;
-    } else if (name[index] == ' ' || name[index] == ',' || name[index] == '>') {
-      tokens.add(name[index]);
-      append = false;
-      index++;
-    } else {
-      if (append) {
-        tokens[tokens.length - 1] = tokens.last + name[index];
-      } else {
-        tokens.add(name[index]);
-        append = true;
-      }
-      index++;
-    }
-  }
-  return tokens;
-}
-
-// HTML escaped version of '<' character.
-const _LESS_THAN = '&lt;';
diff --git a/pkg/docgen/lib/src/mdn.dart b/pkg/docgen/lib/src/mdn.dart
deleted file mode 100644
index f5fd69b..0000000
--- a/pkg/docgen/lib/src/mdn.dart
+++ /dev/null
@@ -1,65 +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 docgen.mdn;
-
-import 'dart:convert';
-import 'dart:io';
-
-import 'package:logging/logging.dart';
-import 'package:path/path.dart' as p;
-
-// TODO(janicejl): Make MDN content generic or pluggable.
-
-/// Map of all the comments for dom elements from MDN.
-Map<String, dynamic> _mdn;
-
-/// Generates MDN comments from database.json.
-String mdnComment(String root, Logger logger, String domName) {
-  //Check if MDN is loaded.
-  if (_mdn == null) {
-    // Reading in MDN related json file.
-    var mdnPath = p.join(root, 'utils/apidoc/mdn/database.json');
-    var mdnFile = new File(mdnPath);
-    if (mdnFile.existsSync()) {
-      _mdn = JSON.decode(mdnFile.readAsStringSync());
-    } else {
-      logger.warning("Cannot find MDN docs expected at $mdnPath");
-      _mdn = {};
-    }
-  }
-
-  var parts = domName.split('.');
-  if (parts.length == 2) return _mdnMemberComment(parts[0], parts[1]);
-  if (parts.length == 1) return _mdnTypeComment(parts[0]);
-
-  throw new StateError('More than two items is not supported: $parts');
-}
-
-/// Generates the MDN Comment for variables and method DOM elements.
-String _mdnMemberComment(String type, String member) {
-  var mdnType = _mdn[type];
-  if (mdnType == null) return '';
-  var mdnMember = mdnType['members'].firstWhere((e) => e['name'] == member,
-      orElse: () => null);
-  if (mdnMember == null) return '';
-  if (mdnMember['help'] == null || mdnMember['help'] == '') return '';
-  if (mdnMember['url'] == null) return '';
-  return _htmlifyMdn(mdnMember['help'], mdnMember['url']);
-}
-
-/// Generates the MDN Comment for class DOM elements.
-String _mdnTypeComment(String type) {
-  var mdnType = _mdn[type];
-  if (mdnType == null) return '';
-  if (mdnType['summary'] == null || mdnType['summary'] == "") return '';
-  if (mdnType['srcUrl'] == null) return '';
-  return _htmlifyMdn(mdnType['summary'], mdnType['srcUrl']);
-}
-
-/// Encloses the given content in an MDN div and the original source link.
-String _htmlifyMdn(String content, String url) {
-  return '<div class="mdn">' + content.trim() + '<p class="mdn-note">'
-      '<a href="' + url.trim() + '">from Mdn</a></p></div>';
-}
diff --git a/pkg/docgen/lib/src/models.dart b/pkg/docgen/lib/src/models.dart
deleted file mode 100644
index ad61145..0000000
--- a/pkg/docgen/lib/src/models.dart
+++ /dev/null
@@ -1,13 +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 docgen.models;
-
-export 'models/class.dart';
-export 'models/indexable.dart';
-export 'models/library.dart';
-export 'models/method.dart';
-export 'models/parameter.dart';
-export 'models/typedef.dart';
-export 'models/variable.dart';
diff --git a/pkg/docgen/lib/src/models/annotation.dart b/pkg/docgen/lib/src/models/annotation.dart
deleted file mode 100644
index 766939c..0000000
--- a/pkg/docgen/lib/src/models/annotation.dart
+++ /dev/null
@@ -1,32 +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 docgen.models.annotation;
-
-import '../exports/source_mirrors.dart';
-
-import '../library_helpers.dart';
-
-import 'library.dart';
-import 'mirror_based.dart';
-
-import 'dart:mirrors';
-
-/// Holds the name of the annotation, and its parameters.
-class Annotation extends MirrorBased<ClassMirror> {
-  /// The class of this annotation.
-  DeclarationMirror mirror;
-  final Library owningLibrary;
-  List<String> parameters;
-
-  Annotation(this.owningLibrary, this.mirror,
-             [List<String> this.parameters = const <String>[]]);
-
-  Map toMap() => {
-    'name': owningLibrary.packagePrefix +
-        getDocgenObject(mirror, owningLibrary).docName,
-    'parameters': parameters
-  };
-}
-
diff --git a/pkg/docgen/lib/src/models/class.dart b/pkg/docgen/lib/src/models/class.dart
deleted file mode 100644
index f323eb5..0000000
--- a/pkg/docgen/lib/src/models/class.dart
+++ /dev/null
@@ -1,245 +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 docgen.models.clazz;
-
-import '../exports/dart2js_mirrors.dart' as dart2js_mirrors;
-import '../exports/mirrors_util.dart' as dart2js_util;
-import '../exports/source_mirrors.dart';
-
-import '../library_helpers.dart';
-
-import 'dummy_mirror.dart';
-import 'generic.dart';
-import 'library.dart';
-import 'method.dart';
-import 'model_helpers.dart';
-import 'owned_indexable.dart';
-import 'variable.dart';
-
-/// A class containing contents of a Dart class.
-class Class extends OwnedIndexable<dart2js_mirrors.Dart2JsInterfaceTypeMirror>
-    implements Comparable<Class> {
-
-  /// List of the names of interfaces that this class implements.
-  List<Class> interfaces = [];
-
-  /// Names of classes that extends or implements this class.
-  Set<Class> subclasses = new Set<Class>();
-
-  /// Top-level variables in the class.
-  Map<String, Variable> variables;
-
-  /// Inherited variables in the class.
-  final Map<String, Variable> inheritedVariables = {};
-
-  /// Methods in the class.
-  Map<String, Method> methods;
-
-  final Map<String, Method> inheritedMethods = new Map<String, Method>();
-
-  /// Generic infomation about the class.
-  final Map<String, Generic> generics;
-
-  Class _superclass;
-  bool get isAbstract => mirror.isAbstract;
-
-  /// Make sure that we don't check for inherited comments more than once.
-  bool _commentsEnsured = false;
-
-  /// Returns the [Class] for the given [mirror] if it has already been created,
-  /// else creates it.
-  factory Class(ClassMirror mirror, Library owner) {
-    var clazz = getDocgenObject(mirror, owner);
-    if (clazz is DummyMirror) {
-      clazz = new Class._(mirror, owner);
-    }
-    return clazz;
-  }
-
-  /// Called when we are constructing a superclass or interface class, but it
-  /// is not known if it belongs to the same owner as the original class. In
-  /// this case, we create an object whose owner is what the original mirror
-  /// says it is.
-  factory Class._possiblyDifferentOwner(ClassMirror mirror,
-      Library originalOwner) {
-    var realOwner = getDocgenObject(mirror.owner);
-    if (realOwner is Library) {
-      return new Class(mirror, realOwner);
-    } else {
-      return new Class(mirror, originalOwner);
-    }
-  }
-
-  Class._(ClassSourceMirror classMirror, Library owner)
-      : generics = createGenerics(classMirror),
-        super(classMirror, owner) {
-
-    // The reason we do this madness is the superclass and interface owners may
-    // not be this class's owner!! Example: BaseClient in http pkg.
-    var superinterfaces = classMirror.superinterfaces.map(
-        (interface) => new Class._possiblyDifferentOwner(interface, owner));
-    this._superclass = classMirror.superclass == null? null :
-        new Class._possiblyDifferentOwner(classMirror.superclass, owner);
-
-    interfaces = superinterfaces.toList();
-    variables = createVariables(
-        dart2js_util.variablesOf(classMirror.declarations), this);
-    methods = createMethods(dart2js_util.anyMethodOf(classMirror.declarations),
-        this);
-
-    // Tell superclass that you are a subclass, unless you are not
-    // visible or an intermediary mixin class.
-    if (!classMirror.isNameSynthetic && isVisible && _superclass != null) {
-      _superclass.addSubclass(this);
-    }
-
-    if (this._superclass != null) addInherited(_superclass);
-    interfaces.forEach((interface) => addInherited(interface));
-  }
-
-  String _lookupInClassAndSuperclasses(String name) {
-    var lookupFunc = determineLookupFunc(name);
-    var classScope = this;
-    while (classScope != null) {
-      var classFunc = lookupFunc(classScope.mirror, name);
-      if (classFunc != null) {
-        return packagePrefix + getDocgenObject(classFunc, owner).docName;
-      }
-      classScope = classScope._superclass;
-    }
-    return null;
-  }
-
-  /// Look for the specified name starting with the current member, and
-  /// progressively working outward to the current library scope.
-  String findElementInScope(String name) {
-    var lookupFunc = determineLookupFunc(name);
-    var result = _lookupInClassAndSuperclasses(name);
-    if (result != null) {
-      return result;
-    }
-    result = owner.findElementInScope(name);
-    return result == null ? super.findElementInScope(name) : result;
-  }
-
-  String get typeName => 'class';
-
-  /// Add all inherited variables and methods from the provided superclass.
-  /// If [_includePrivate] is true, it also adds the variables and methods from
-  /// the superclass.
-  void addInherited(Class superclass) {
-    inheritedVariables.addAll(superclass.inheritedVariables);
-    inheritedVariables.addAll(_allButStatics(superclass.variables));
-    addInheritedMethod(superclass, this);
-  }
-
-  /** [newParent] refers to the actual class is currently using these methods.
-   * which may be different because with the mirror system, we only point to the
-   * original canonical superclasse's method.
-   */
-  void addInheritedMethod(Class parent, Class newParent) {
-    parent.inheritedMethods.forEach((name, method) {
-      if (!method.mirror.isConstructor) {
-        inheritedMethods[name] = new Method(method.mirror, newParent, method);
-      }
-    });
-    _allButStatics(parent.methods).forEach((name, method) {
-      if (!method.mirror.isConstructor) {
-        inheritedMethods[name] = new Method(method.mirror, newParent, method);
-      }
-    });
-  }
-
-  /// Remove statics from the map of inherited items before adding them.
-  Map _allButStatics(Map items) {
-    var result = {};
-    items.forEach((name, item) {
-      if (!item.isStatic) {
-        result[name] = item;
-      }
-    });
-    return result;
-  }
-
-  /// Add the subclass to the class.
-  ///
-  /// If [this] is private (or an intermediary mixin class), it will add the
-  /// subclass to the list of subclasses in the superclasses.
-  void addSubclass(Class subclass) {
-    if (docName == 'dart:core.Object') return;
-
-    if (!includePrivateMembers && isPrivate || mirror.isNameSynthetic) {
-      if (_superclass != null) _superclass.addSubclass(subclass);
-      interfaces.forEach((interface) {
-        interface.addSubclass(subclass);
-      });
-    } else {
-      subclasses.add(subclass);
-    }
-  }
-
-  /// Check if this [Class] is an error or exception.
-  bool isError() {
-    if (qualifiedName == 'dart:core.Error' ||
-        qualifiedName == 'dart:core.Exception')
-      return true;
-    for (var interface in interfaces) {
-      if (interface.isError()) return true;
-    }
-    if (_superclass == null) return false;
-    return _superclass.isError();
-  }
-
-  /// Makes sure that all methods with inherited equivalents have comments.
-  void ensureComments() {
-    if (_commentsEnsured) return;
-    _commentsEnsured = true;
-    if (_superclass != null) _superclass.ensureComments();
-    inheritedMethods.forEach((qualifiedName, inheritedMethod) {
-      var method = methods[qualifiedName];
-      if (method != null) {
-        // if we have overwritten this method in this class, we still provide
-        // the opportunity to inherit the comments.
-        method.ensureCommentFor(inheritedMethod);
-      }
-    });
-    // we need to populate the comments for all methods. so that the subclasses
-    // can get for their inherited versions the comments.
-    methods.forEach((qualifiedName, method) {
-      if (!method.mirror.isConstructor) method.ensureCommentFor(method);
-    });
-  }
-
-  /// If a class extends a private superclass, find the closest public
-  /// superclass of the private superclass.
-  String validSuperclass() {
-    if (_superclass == null) return 'dart:core.Object';
-    if (_superclass.isVisible) return _superclass.qualifiedName;
-    return _superclass.validSuperclass();
-  }
-
-  /// Generates a map describing the [Class] object.
-  Map toMap() => {
-    'name': name,
-    'qualifiedName': qualifiedName,
-    'comment': comment,
-    'isAbstract' : isAbstract,
-    'superclass': validSuperclass(),
-    'implements': interfaces.where((i) => i.isVisible)
-        .map((e) => e.qualifiedName).toList(),
-    'subclass': (subclasses.toList()..sort())
-        .map((x) => x.qualifiedName).toList(),
-    'variables': recurseMap(variables),
-    'inheritedVariables': recurseMap(inheritedVariables),
-    'methods': expandMethodMap(methods),
-    'inheritedMethods': expandMethodMap(inheritedMethods),
-    'annotations': annotations.map((a) => a.toMap()).toList(),
-    'generics': recurseMap(generics)
-  };
-
-  int compareTo(Class other) => name.compareTo(other.name);
-
-  bool isValidMirror(DeclarationMirror mirror) => mirror is ClassMirror;
-}
diff --git a/pkg/docgen/lib/src/models/closure.dart b/pkg/docgen/lib/src/models/closure.dart
deleted file mode 100644
index 2fcfa19..0000000
--- a/pkg/docgen/lib/src/models/closure.dart
+++ /dev/null
@@ -1,35 +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 docgen.models.closure;
-
-import '../exports/source_mirrors.dart';
-
-import 'doc_gen_type.dart';
-import 'indexable.dart';
-import 'mirror_based.dart';
-import 'model_helpers.dart';
-import 'parameter.dart';
-
-/// A class containing the properties of a function to be called (used in our
-/// case specifically to illustrate evidence of the type of function for a
-/// parameter).
-class Closure extends MirrorBased<FunctionTypeMirror> {
-
-  /// Parameters for this method.
-  final Map<String, Parameter> parameters;
-  final DocGenType returnType;
-  final FunctionTypeMirror mirror;
-
-  Closure(FunctionTypeMirror mirror, Indexable owner)
-    : returnType = new DocGenType(mirror.returnType, owner.owningLibrary),
-      parameters = createParameters(mirror.parameters, owner),
-      mirror = mirror;
-
-  /// Generates a map describing the [Method] object.
-  Map toMap() => {
-    'return': [returnType.toMap()],
-    'parameters': recurseMap(parameters),
-  };
-}
\ No newline at end of file
diff --git a/pkg/docgen/lib/src/models/doc_gen_type.dart b/pkg/docgen/lib/src/models/doc_gen_type.dart
deleted file mode 100644
index 47fc99b..0000000
--- a/pkg/docgen/lib/src/models/doc_gen_type.dart
+++ /dev/null
@@ -1,66 +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 docgen.models.doc_gen_type;
-
-import '../exports/source_mirrors.dart';
-
-import '../library_helpers.dart';
-
-import 'library.dart';
-import 'mirror_based.dart';
-
-/// Docgen wrapper around the mirror for a return type, and/or its generic
-/// type parameters.
-///
-/// Return types are of a form [outer]<[inner]>.
-/// If there is no [inner] part, [inner] will be an empty list.
-///
-/// For example:
-///        int size()
-///          "return" :
-///            - "outer" : "dart:core.int"
-///              "inner" :
-///
-///        List<String> toList()
-///          "return" :
-///            - "outer" : "dart:core.List"
-///              "inner" :
-///                - "outer" : "dart:core.String"
-///                  "inner" :
-///
-///        Map<String, List<int>>
-///          "return" :
-///            - "outer" : "dart:core.Map"
-///              "inner" :
-///                - "outer" : "dart:core.String"
-///                  "inner" :
-///                - "outer" : "dart:core.List"
-///                  "inner" :
-///                    - "outer" : "dart:core.int"
-///                      "inner" :
-class DocGenType extends MirrorBased {
-  final TypeMirror mirror;
-  final Library owningLibrary;
-
-  DocGenType(this.mirror, this.owningLibrary);
-
-  Map toMap() {
-    var result = getDocgenObject(mirror, owningLibrary);
-    return {
-      // We may encounter types whose corresponding library has not been
-      // processed yet, so look up with the owningLibrary at the last moment.
-      'outer': result.packagePrefix + result.docName,
-      'inner': _createTypeGenerics(mirror).map((e) => e.toMap()).toList(),
-    };
-  }
-
-  /// Returns a list of [DocGenType] objects constructed from TypeMirrors.
-  List<DocGenType> _createTypeGenerics(TypeMirror mirror) {
-    if (mirror is! ClassMirror) return [];
-    return mirror.typeArguments
-        .map((e) => new DocGenType(e, owningLibrary))
-        .toList();
-  }
-}
diff --git a/pkg/docgen/lib/src/models/dummy_mirror.dart b/pkg/docgen/lib/src/models/dummy_mirror.dart
deleted file mode 100644
index 9ad612a..0000000
--- a/pkg/docgen/lib/src/models/dummy_mirror.dart
+++ /dev/null
@@ -1,66 +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 docgen.models.dummy_mirror;
-
-import '../exports/mirrors_util.dart' as dart2js_util;
-import '../exports/source_mirrors.dart';
-
-import '../library_helpers.dart';
-
-import 'indexable.dart';
-import 'model_helpers.dart';
-
-/// For types that we do not explicitly create or have not yet created in our
-/// entity map (like core types).
-class DummyMirror implements Indexable {
-  final DeclarationMirror mirror;
-  /// The library that contains this element, if any. Used as a hint to help
-  /// determine which object we're referring to when looking up this mirror in
-  /// our map.
-  final Indexable owner;
-
-  DummyMirror(this.mirror, [this.owner]);
-
-  String get docName {
-    if (mirror is LibraryMirror) {
-      return getLibraryDocName(mirror);
-    }
-    var mirrorOwner = mirror.owner;
-    if (mirrorOwner == null) return dart2js_util.qualifiedNameOf(mirror);
-    var simpleName = dart2js_util.nameOf(mirror);
-    if (mirror is MethodMirror && (mirror as MethodMirror).isConstructor) {
-      // We name constructors specially -- repeating the class name and a
-      // "-" to separate the constructor from its name (if any).
-      simpleName = '${dart2js_util.nameOf(mirrorOwner)}-$simpleName';
-    }
-    return getDocgenObject(mirrorOwner, owner).docName + '.' +
-        simpleName;
-  }
-
-  bool get isPrivate => mirror.isPrivate;
-
-  String get packageName {
-    var libMirror = _getOwningLibraryFromMirror(mirror);
-    if (libMirror != null) {
-      return getPackageName(libMirror);
-    }
-    return '';
-  }
-
-  String get packagePrefix => packageName == null || packageName.isEmpty ?
-      '' : '$packageName/';
-
-  // This is a known incomplete implementation of Indexable
-  // overriding noSuchMethod to remove static warnings
-  noSuchMethod(Invocation invocation) {
-    throw new UnimplementedError(invocation.memberName.toString());
-  }
-}
-
-LibraryMirror _getOwningLibraryFromMirror(DeclarationMirror mirror) {
-  if (mirror == null) return null;
-  if (mirror is LibraryMirror) return mirror;
-  return _getOwningLibraryFromMirror(mirror.owner);
-}
diff --git a/pkg/docgen/lib/src/models/generic.dart b/pkg/docgen/lib/src/models/generic.dart
deleted file mode 100644
index 46a48a1..0000000
--- a/pkg/docgen/lib/src/models/generic.dart
+++ /dev/null
@@ -1,22 +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 docgen.models.generic;
-
-import '../exports/source_mirrors.dart';
-import '../exports/mirrors_util.dart' as dart2js_util;
-
-import 'mirror_based.dart';
-
-/// A Docgen wrapper around the dart2js mirror for a generic type.
-class Generic extends MirrorBased<TypeVariableMirror> {
-  final TypeVariableMirror mirror;
-
-  Generic(this.mirror);
-
-  Map toMap() => {
-    'name': dart2js_util.nameOf(mirror),
-    'type': dart2js_util.qualifiedNameOf(mirror.upperBound)
-  };
-}
diff --git a/pkg/docgen/lib/src/models/indexable.dart b/pkg/docgen/lib/src/models/indexable.dart
deleted file mode 100644
index 1c14a79..0000000
--- a/pkg/docgen/lib/src/models/indexable.dart
+++ /dev/null
@@ -1,221 +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 docgen.models.indexable;
-
-import 'dart:collection';
-
-import 'package:markdown/markdown.dart' as markdown;
-
-import '../exports/mirrors_util.dart' as dart2js_util;
-import '../exports/source_mirrors.dart';
-
-import '../library_helpers.dart';
-import 'library.dart';
-import 'mirror_based.dart';
-import 'model_helpers.dart';
-
-/// An item that is categorized in our mirrorToDocgen map, as a distinct,
-/// searchable element.
-///
-/// These are items that refer to concrete entities (a Class, for example,
-/// but not a Type, which is a "pointer" to a class) that we wish to be
-/// globally resolvable. This includes things such as class methods and
-/// variables, but parameters for methods are not "Indexable" as we do not want
-/// the user to be able to search for a method based on its parameter names!
-/// The set of indexable items also includes Typedefs, since the user can refer
-/// to them as concrete entities in a particular scope.
-abstract class Indexable<TMirror extends DeclarationMirror>
-    extends MirrorBased<TMirror> {
-
-  Library get owningLibrary => owner.owningLibrary;
-
-  /// The reference to this element based on where it is printed as a
-  /// documentation file and also the unique URL to refer to this item.
-  ///
-  /// The qualified name (for URL purposes) and the file name are the same,
-  /// of the form packageName/ClassName or packageName/ClassName.methodName.
-  /// This defines both the URL and the directory structure.
-  String get qualifiedName => packagePrefix + ownerPrefix + name;
-
-  /// The name of the file we write this object's data into. The same as the
-  /// qualified name but with leading colons (i.e. dart:)
-  /// replaced by hyphens because of Windows.
-  String get fileName => qualifiedName.replaceFirst(":", "-");
-
-  final TMirror mirror;
-  final bool isPrivate;
-  /// The comment text pre-resolution. We keep this around because inherited
-  /// methods need to resolve links differently from the superclass.
-  String unresolvedComment = '';
-
-  Indexable(TMirror mirror)
-      : this.mirror = mirror,
-        this.isPrivate = isHidden(mirror as DeclarationSourceMirror) {
-
-    var mirrorQualifiedName = dart2js_util.qualifiedNameOf(this.mirror);
-
-    var map = _mirrorToDocgen.putIfAbsent(mirrorQualifiedName,
-        () => new HashMap<String, Indexable>());
-
-    var added = false;
-    map.putIfAbsent(owner.docName, () {
-      added = true;
-      return this;
-    });
-
-    if (!added) {
-      throw new StateError('An indexable has already been stored for '
-          '${owner.docName}');
-    }
-  }
-
-  /// Returns this object's qualified name, but following the conventions
-  /// we're using in Dartdoc, which is that library names with dots in them
-  /// have them replaced with hyphens.
-  String get docName;
-
-  /// Converts all [foo] references in comments to <a>libraryName.foo</a>.
-  markdown.Node fixReference(String name) {
-    // Attempt the look up the whole name up in the scope.
-    String elementName = findElementInScope(name);
-    if (elementName != null) {
-      return new markdown.Element.text('a', elementName);
-    }
-    return fixComplexReference(name);
-  }
-
-  /// Look for the specified name starting with the current member, and
-  /// progressively working outward to the current library scope.
-  String findElementInScope(String name) =>
-      findElementInScopeWithPrefix(name, packagePrefix);
-
-  /// The full docName of the owner element, appended with a '.' for this
-  /// object's name to be appended.
-  String get ownerPrefix => owner.docName != '' ? owner.docName + '.' : '';
-
-  /// The prefix String to refer to the package that this item is in, for URLs
-  /// and comment resolution.
-  ///
-  /// The prefix can be prepended to a qualified name to get a fully unique
-  /// name among all packages.
-  String get packagePrefix;
-
-  /// Documentation comment with converted markdown and all links resolved.
-  String commentField;
-
-  /// Accessor to documentation comment with markdown converted to html and all
-  /// links resolved.
-  String get comment {
-    if (commentField != null) return commentField;
-
-    commentField = commentToHtml();
-    if (commentField.isEmpty) {
-      commentField = getMdnComment();
-    }
-    return commentField;
-  }
-
-  void set comment(x) {
-    commentField = x;
-  }
-
-  /// The simple name to refer to this item.
-  String get name => dart2js_util.nameOf(mirror);
-
-  /// Accessor to the parent item that owns this item.
-  ///
-  /// "Owning" is defined as the object one scope-level above which this item
-  /// is defined. Ex: The owner for a top level class, would be its enclosing
-  /// library. The owner of a local variable in a method would be the enclosing
-  /// method.
-  Indexable get owner;
-
-  /// Generates MDN comments from database.json.
-  String getMdnComment();
-
-  /// The type of this member to be used in index.txt.
-  String get typeName;
-
-  /// Creates a [Map] with this [Indexable]'s name and a preview comment.
-  Map get previewMap {
-    var finalMap = { 'name' : name, 'qualifiedName' : qualifiedName };
-    var pre = preview;
-    if (pre != null) finalMap['preview'] = pre;
-    return finalMap;
-  }
-
-  String get preview {
-    if (comment != '') {
-      var index = comment.indexOf('</p>');
-      return index > 0 ?
-          '${comment.substring(0, index)}</p>' :
-          '<p><i>Comment preview not available</i></p>';
-    }
-    return null;
-  }
-
-  /// Accessor to obtain the raw comment text for a given item, _without_ any
-  /// of the links resolved.
-  String get _commentText {
-    String commentText;
-    mirror.metadata.forEach((metadata) {
-      if (metadata is CommentInstanceMirror) {
-        CommentInstanceMirror comment = metadata;
-        if (comment.isDocComment) {
-          if (commentText == null) {
-            commentText = comment.trimmedText;
-          } else {
-            commentText = '$commentText\n${comment.trimmedText}';
-          }
-        }
-      }
-    });
-    return commentText;
-  }
-
-  /// Returns any documentation comments associated with a mirror with
-  /// simple markdown converted to html.
-  ///
-  /// By default we resolve any comment references within our own scope.
-  /// However, if a method is inherited, we want the inherited comments, but
-  /// links to the subclasses's version of the methods.
-  String commentToHtml([Indexable resolvingScope]) {
-    if (resolvingScope == null) resolvingScope = this;
-    var commentText = _commentText;
-    unresolvedComment = commentText;
-
-    commentText = commentText == null ? '' :
-        markdown.markdownToHtml(commentText.trim(),
-            linkResolver: resolvingScope.fixReference,
-            inlineSyntaxes: MARKDOWN_SYNTAXES);
-    return commentText;
-  }
-
-  /// Return a map representation of this type.
-  Map toMap();
-
-  /// Accessor to determine if this item and all of its owners are visible.
-  bool get isVisible => isFullChainVisible(this);
-
-  /// Returns true if [mirror] is the correct type of mirror that this Docgen
-  /// object wraps. (Workaround for the fact that Types are not first class.)
-  bool isValidMirror(DeclarationMirror mirror);
-}
-
-/// Index of all the dart2js mirrors examined to corresponding MirrorBased
-/// docgen objects.
-///
-/// Used for lookup because of the dart2js mirrors exports
-/// issue. The second level map is indexed by owner docName for faster lookup.
-/// Why two levels of lookup? Speed, man. Speed.
-final Map<String, Map<String, Indexable>> _mirrorToDocgen =
-    new HashMap<String, Map<String, Indexable>>();
-
-Iterable<Indexable> get allIndexables =>
-    _mirrorToDocgen.values.expand((map) => map.values);
-
-Map<String, Indexable> lookupIndexableMap(DeclarationMirror mirror) {
-  return _mirrorToDocgen[dart2js_util.qualifiedNameOf(mirror)];
-}
diff --git a/pkg/docgen/lib/src/models/library.dart b/pkg/docgen/lib/src/models/library.dart
deleted file mode 100644
index 9403239..0000000
--- a/pkg/docgen/lib/src/models/library.dart
+++ /dev/null
@@ -1,192 +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 docgen.models.library;
-
-import 'dart:io';
-
-import 'package:markdown/markdown.dart' as markdown;
-
-import '../exports/source_mirrors.dart';
-import '../exports/mirrors_util.dart' as dart2js_util;
-
-import '../library_helpers.dart';
-import '../package_helpers.dart';
-
-import 'class.dart';
-import 'dummy_mirror.dart';
-import 'indexable.dart';
-import 'method.dart';
-import 'model_helpers.dart';
-import 'typedef.dart';
-import 'variable.dart';
-
-/// A class containing contents of a Dart library.
-class Library extends Indexable {
-  final Map<String, Class> classes = {};
-  final Map<String, Typedef> typedefs = {};
-  final Map<String, Class> errors = {};
-
-  /// Top-level variables in the library.
-  Map<String, Variable> variables;
-
-  /// Top-level functions in the library.
-  Map<String, Method> functions;
-
-  String packageName = '';
-  bool _hasBeenCheckedForPackage = false;
-  String packageIntro;
-
-  Indexable get owner => const _LibraryOwner();
-
-  Library get owningLibrary => this;
-
-  /// Returns the [Library] for the given [mirror] if it has already been
-  /// created, else creates it.
-  factory Library(LibraryMirror mirror) {
-    var library = getDocgenObject(mirror);
-    if (library is DummyMirror) {
-      library = new Library._(mirror);
-    }
-    return library;
-  }
-
-  Library._(LibraryMirror libraryMirror) : super(libraryMirror) {
-    var exported = calcExportedItems(libraryMirror, {});
-    var exportedClasses = addAll(exported['classes'],
-        dart2js_util.typesOf(libraryMirror.declarations));
-    updateLibraryPackage(mirror);
-    exportedClasses.forEach((String mirrorName, TypeMirror mirror) {
-      if (mirror is TypedefMirror) {
-        // This is actually a Dart2jsTypedefMirror, and it does define value,
-        // but we don't have visibility to that type.
-        if (includePrivateMembers || !mirror.isPrivate) {
-          typedefs[dart2js_util.nameOf(mirror)] = new Typedef(mirror, this);
-        }
-      } else if (mirror is ClassMirror) {
-        var clazz = new Class(mirror, this);
-
-        if (clazz.isError()) {
-          errors[dart2js_util.nameOf(mirror)] = clazz;
-        } else {
-          classes[dart2js_util.nameOf(mirror)] = clazz;
-        }
-      } else {
-        throw new ArgumentError(
-            '${dart2js_util.nameOf(mirror)} - no class type match. ');
-      }
-    });
-    this.functions = createMethods(addAll(exported['methods'],
-        libraryMirror.declarations.values.where(
-            (mirror) => mirror is MethodMirror)).values, this);
-    this.variables = createVariables(addAll(exported['variables'],
-        dart2js_util.variablesOf(libraryMirror.declarations)).values, this);
-  }
-
-  /// Look for the specified name starting with the current member, and
-  /// progressively working outward to the current library scope.
-  String findElementInScope(String name) {
-    var lookupFunc = determineLookupFunc(name);
-    var libraryScope = lookupFunc(mirror, name);
-    if (libraryScope != null) {
-      var result = getDocgenObject(libraryScope, this);
-      if (result is DummyMirror) return packagePrefix + result.docName;
-      return result.packagePrefix + result.docName;
-    }
-    return super.findElementInScope(name);
-  }
-
-  String getMdnComment() => '';
-
-  /// For a library's [mirror], determine the name of the package (if any) we
-  /// believe it came from (because of its file URI).
-  ///
-  /// If no package could be determined, we return an empty string.
-  void updateLibraryPackage(LibraryMirror mirror) {
-    if (mirror == null) return;
-    if (_hasBeenCheckedForPackage) return;
-    _hasBeenCheckedForPackage = true;
-    if (mirror.uri.scheme != 'file') return;
-    packageName = getPackageName(mirror);
-    // Associate the package readme with all the libraries. This is a bit
-    // wasteful, but easier than trying to figure out which partial match
-    // is best.
-    packageIntro = _packageIntro(getPackageDirectory(mirror));
-  }
-
-  String _packageIntro(packageDir) {
-    if (packageDir == null) return null;
-    var dir = new Directory(packageDir);
-    var files = dir.listSync();
-    var readmes = files.where((FileSystemEntity each) => (each is File &&
-        each.path.substring(packageDir.length + 1, each.path.length)
-          .startsWith('README'))).toList();
-    if (readmes.isEmpty) return '';
-    // If there are multiples, pick the shortest name.
-    readmes.sort((a, b) => a.path.length.compareTo(b.path.length));
-    var readme = readmes.first;
-    var linkResolver = (name) => globalFixReference(name);
-    var contents = markdown.markdownToHtml(readme
-      .readAsStringSync(), linkResolver: linkResolver,
-      inlineSyntaxes: MARKDOWN_SYNTAXES);
-    return contents;
-  }
-
-  String get packagePrefix => packageName == null || packageName.isEmpty ?
-      '' : '$packageName/';
-
-  Map get previewMap {
-    var map = {'packageName': packageName};
-    map.addAll(super.previewMap);
-    if (packageIntro != null) {
-      map['packageIntro'] = packageIntro;
-    }
-    var version = packageVersion(mirror);
-    if (version != '' && version != null) map['version'] = version;
-    return map;
-  }
-
-  String get name => docName;
-
-  String get docName => getLibraryDocName(mirror);
-
-  /// Generates a map describing the [Library] object.
-  Map toMap() => {
-    'name': name,
-    'qualifiedName': qualifiedName,
-    'comment': comment,
-    'variables': recurseMap(variables),
-    'functions': expandMethodMap(functions),
-    'classes': {
-      'class': classes.values.where((c) => c.isVisible)
-        .map((e) => e.previewMap).toList(),
-      'typedef': recurseMap(typedefs),
-      'error': errors.values.where((e) => e.isVisible)
-          .map((e) => e.previewMap).toList()
-    },
-    'packageName': packageName,
-    'packageIntro': packageIntro
-  };
-
-  String get typeName => 'library';
-
-  bool isValidMirror(DeclarationMirror mirror) => mirror is LibraryMirror;
-}
-
-/// Dummy implementation of Indexable to represent the owner of a Library.
-class _LibraryOwner implements Indexable {
-  const _LibraryOwner();
-
-  String get docName => '';
-
-  bool get isPrivate => false;
-
-  Indexable get owner => null;
-
-  // This is a known incomplete implementation of Indexable
-  // overriding noSuchMethod to remove static warnings
-  noSuchMethod(Invocation invocation) {
-    throw new UnimplementedError(invocation.memberName.toString());
-  }
-}
diff --git a/pkg/docgen/lib/src/models/method.dart b/pkg/docgen/lib/src/models/method.dart
deleted file mode 100644
index f25d53b..0000000
--- a/pkg/docgen/lib/src/models/method.dart
+++ /dev/null
@@ -1,156 +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 docgen.models.method;
-
-import 'package:markdown/markdown.dart' as markdown;
-
-import '../exports/mirrors_util.dart' as dart2js_util;
-import '../exports/source_mirrors.dart';
-
-import '../library_helpers.dart';
-
-import 'class.dart';
-import 'doc_gen_type.dart';
-import 'dummy_mirror.dart';
-import 'indexable.dart';
-import 'model_helpers.dart';
-import 'owned_indexable.dart';
-import 'parameter.dart';
-
-
-/// A class containing properties of a Dart method.
-class Method extends OwnedIndexable<MethodMirror> {
-
-  /// Parameters for this method.
-  final Map<String, Parameter> parameters;
-
-  final bool isStatic;
-  final bool isAbstract;
-  final bool isConst;
-  final DocGenType returnType;
-  Method methodInheritedFrom;
-
-  /// Qualified name to state where the comment is inherited from.
-  String commentInheritedFrom = "";
-
-  factory Method(MethodMirror mirror, Indexable owner,
-      [Method methodInheritedFrom]) {
-    var method = getDocgenObject(mirror, owner);
-    if (method is DummyMirror) {
-      method = new Method._(mirror, owner, methodInheritedFrom);
-    }
-    return method;
-  }
-
-  Method._(MethodMirror mirror, Indexable owner, this.methodInheritedFrom)
-      : returnType = new DocGenType(mirror.returnType, owner.owningLibrary),
-        isStatic = mirror.isStatic,
-        isAbstract = mirror.isAbstract,
-        isConst = mirror.isConstConstructor,
-        parameters = createParameters(mirror.parameters, owner),
-        super(mirror, owner);
-
-  Method get originallyInheritedFrom => methodInheritedFrom == null ?
-      this : methodInheritedFrom.originallyInheritedFrom;
-
-  /// Look for the specified name starting with the current member, and
-  /// progressively working outward to the current library scope.
-  String findElementInScope(String name) {
-    var lookupFunc = determineLookupFunc(name);
-
-    var memberScope = lookupFunc(this.mirror, name);
-    if (memberScope != null) {
-      // do we check for a dummy mirror returned here and look up with an owner
-      // higher ooooor in getDocgenObject do we include more things in our
-      // lookup
-      var result = getDocgenObject(memberScope, owner);
-      if (result is DummyMirror && owner.owner != null
-          && owner.owner is! DummyMirror) {
-        var aresult = getDocgenObject(memberScope, owner.owner);
-        if (aresult is! DummyMirror) result = aresult;
-      }
-      if (result is DummyMirror) return packagePrefix + result.docName;
-      return result.packagePrefix + result.docName;
-    }
-
-    if (owner != null) {
-      var result = owner.findElementInScope(name);
-      if (result != null) return result;
-    }
-    return super.findElementInScope(name);
-  }
-
-  String get docName {
-    if (mirror.isConstructor) {
-      // We name constructors specially -- including the class name again and a
-      // "-" to separate the constructor from its name (if any).
-      return '${owner.docName}.${dart2js_util.nameOf(mirror.owner)}-'
-          '${dart2js_util.nameOf(mirror)}';
-    }
-    return super.docName;
-  }
-
-  String get qualifiedName => packagePrefix + docName;
-
-  /// Makes sure that the method with an inherited equivalent have comments.
-  void ensureCommentFor(Method inheritedMethod) {
-    if (comment.isNotEmpty) return;
-
-    comment = inheritedMethod.commentToHtml(this);
-    unresolvedComment = inheritedMethod.unresolvedComment;
-    commentInheritedFrom = inheritedMethod.commentInheritedFrom == '' ?
-        new DummyMirror(inheritedMethod.mirror).docName :
-        inheritedMethod.commentInheritedFrom;
-  }
-
-  /// Generates a map describing the [Method] object.
-  Map toMap() => {
-    'name': name,
-    'qualifiedName': qualifiedName,
-    'comment': comment,
-    'commentFrom': (methodInheritedFrom != null &&
-        commentInheritedFrom == methodInheritedFrom.docName ? ''
-        : commentInheritedFrom),
-    'inheritedFrom': (methodInheritedFrom == null? '' :
-        originallyInheritedFrom.docName),
-    'static': isStatic,
-    'abstract': isAbstract,
-    'constant': isConst,
-    'return': [returnType.toMap()],
-    'parameters': recurseMap(parameters),
-    'annotations': annotations.map((a) => a.toMap()).toList()
-  };
-
-  String get typeName {
-    if (mirror.isConstructor) return 'constructor';
-    if (mirror.isGetter) return 'getter';
-    if (mirror.isSetter) return 'setter';
-    if (mirror.isOperator) return 'operator';
-    return 'method';
-  }
-
-  String get comment {
-    if (commentField != null) return commentField;
-    if (owner is Class) {
-      (owner as Class).ensureComments();
-    }
-    var result = super.comment;
-    if (result == '' && methodInheritedFrom != null) {
-      // This should be NOT from the MIRROR, but from the COMMENT.
-      methodInheritedFrom.comment; // Ensure comment field has been populated.
-      unresolvedComment = methodInheritedFrom.unresolvedComment;
-
-      comment = unresolvedComment == null ? '' :
-        markdown.markdownToHtml(unresolvedComment.trim(),
-            linkResolver: fixReference, inlineSyntaxes: MARKDOWN_SYNTAXES);
-      commentInheritedFrom = comment != '' ?
-          methodInheritedFrom.commentInheritedFrom : '';
-      result = comment;
-    }
-    return result;
-  }
-
-  bool isValidMirror(DeclarationMirror mirror) => mirror is MethodMirror;
-}
\ No newline at end of file
diff --git a/pkg/docgen/lib/src/models/mirror_based.dart b/pkg/docgen/lib/src/models/mirror_based.dart
deleted file mode 100644
index eceac68..0000000
--- a/pkg/docgen/lib/src/models/mirror_based.dart
+++ /dev/null
@@ -1,17 +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 docgen.models.mirror_based;
-
-import '../exports/source_mirrors.dart';
-
-/// Docgen representation of an item to be documented, that wraps around a
-/// dart2js mirror.
-abstract class MirrorBased<TMirror extends DeclarationMirror> {
-  /// The original dart2js mirror around which this object wraps.
-  TMirror get mirror;
-
-  /// Return an informative [Object.toString] for debugging.
-  String toString() => "${super.toString()} - $mirror";
-}
diff --git a/pkg/docgen/lib/src/models/model_helpers.dart b/pkg/docgen/lib/src/models/model_helpers.dart
deleted file mode 100644
index 0aa8c9f..0000000
--- a/pkg/docgen/lib/src/models/model_helpers.dart
+++ /dev/null
@@ -1,443 +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 docgen.model_helpers;
-
-import 'dart:collection';
-
-import 'package:compiler/src/constants/expressions.dart';
-
-import '../exports/dart2js_mirrors.dart' as dart2js_mirrors;
-import '../exports/mirrors_util.dart' as dart2js_util;
-import '../exports/source_mirrors.dart';
-import '../exports/libraries.dart';
-
-import '../library_helpers.dart' show includePrivateMembers;
-import '../package_helpers.dart';
-
-import 'annotation.dart';
-import 'generic.dart';
-import 'indexable.dart';
-import 'library.dart';
-import 'method.dart';
-import 'parameter.dart';
-import 'variable.dart';
-
-String getLibraryDocName(LibraryMirror mirror) {
-  var dotsFixed = dart2js_util.qualifiedNameOf(mirror).replaceAll('.', '-');
-  if (dotsFixed.startsWith('dart-dom-')) {
-    return dotsFixed.replaceFirst("dart-dom-", "dart:");
-  } else if (dotsFixed.startsWith("dart-")) {
-    return dotsFixed.replaceFirst("dart-", "dart:");
-  } else {
-    return dotsFixed;
-  }
-}
-
-/// Expand the method map [mapToExpand] into a more detailed map that
-/// separates out setters, getters, constructors, operators, and methods.
-Map expandMethodMap(Map<String, Method> mapToExpand) => {
-  'setters': recurseMap(_filterMap(mapToExpand,
-      (key, val) => val.mirror.isSetter)),
-  'getters': recurseMap(_filterMap(mapToExpand,
-      (key, val) => val.mirror.isGetter)),
-  'constructors': recurseMap(_filterMap(mapToExpand,
-      (key, val) => val.mirror.isConstructor)),
-  'operators': recurseMap(_filterMap(mapToExpand,
-      (key, val) => val.mirror.isOperator)),
-  'methods': recurseMap(_filterMap(mapToExpand,
-      (key, val) => val.mirror.isRegularMethod && !val.mirror.isOperator))
-};
-
-String getDefaultValue(ParameterMirror mirror) {
-  if (!mirror.hasDefaultValue) return null;
-  return '${mirror.defaultValue}';
-}
-
-/// Returns a list of meta annotations assocated with a mirror.
-List<Annotation> createAnnotations(DeclarationMirror mirror,
-    Library owningLibrary) {
-  var annotations = [];
-  var info = new AnnotationInfo(mirror, owningLibrary);
-  for (var expr in dart2js_mirrors.BackDoor.metadataSyntaxOf(mirror)) {
-    var docgenAnnotation = expr.accept(const AnnotationCreator(), info);
-    if (docgenAnnotation != null &&
-        !_SKIPPED_ANNOTATIONS.contains(
-            dart2js_util.qualifiedNameOf(docgenAnnotation.mirror))) {
-      annotations.add(docgenAnnotation);
-    }
-  }
-  return annotations;
-}
-
-class AnnotationInfo {
-  final Mirror mirror;
-  final Library owningLibrary;
-
-  AnnotationInfo(this.mirror, this.owningLibrary);
-}
-
-class AnnotationCreator
-    extends ConstantExpressionVisitor<Annotation, AnnotationInfo> {
-
-  const AnnotationCreator();
-
-  Annotation createAnnotation(var element,
-                              AnnotationInfo context,
-                              [List<String> parameters = const <String>[]]) {
-    var mirror =
-        dart2js_mirrors.BackDoor.getMirrorFromElement(context.mirror, element);
-    if (mirror != null) {
-      return new Annotation(context.owningLibrary, mirror, parameters);
-    }
-    return null;
-  }
-
-  @override
-  Annotation visitBinary(BinaryConstantExpression exp,
-                         AnnotationInfo context) {
-    return null;
-  }
-
-  @override
-  Annotation visitIdentical(IdenticalConstantExpression exp,
-                            AnnotationInfo context) {
-    return null;
-  }
-
-  @override
-  Annotation visitConcatenate(ConcatenateConstantExpression exp,
-                              AnnotationInfo context) {
-    return null;
-  }
-
-  @override
-  Annotation visitConditional(ConditionalConstantExpression exp,
-                              AnnotationInfo context) {
-    return null;
-  }
-
-  @override
-  Annotation visitConstructed(ConstructedConstantExpression exp,
-                              AnnotationInfo context) {
-    return createAnnotation(exp.target, context,
-        exp.arguments.map((a) => a.getText()).toList());
-  }
-
-  @override
-  Annotation visitFunction(FunctionConstantExpression exp,
-                           AnnotationInfo context) {
-    return createAnnotation(exp.element, context);
-  }
-
-  @override
-  Annotation visitList(ListConstantExpression exp,
-                       AnnotationInfo context) {
-    return null;
-  }
-
-  @override
-  Annotation visitMap(MapConstantExpression exp,
-                      AnnotationInfo context) {
-    return null;
-  }
-
-  @override
-  Annotation visitSymbol(SymbolConstantExpression exp,
-                         AnnotationInfo context) {
-    return null;
-  }
-
-  @override
-  Annotation visitType(TypeConstantExpression exp,
-                       AnnotationInfo context) {
-    return null;
-  }
-
-  @override
-  Annotation visitUnary(UnaryConstantExpression exp,
-                        AnnotationInfo context) {
-    return null;
-  }
-
-  @override
-  Annotation visitVariable(VariableConstantExpression exp,
-                           AnnotationInfo context) {
-    return createAnnotation(exp.element, context);
-  }
-
-  @override
-  Annotation visitBool(BoolConstantExpression exp,
-                       AnnotationInfo context) {
-    return null;
-  }
-
-  @override
-  Annotation visitBoolFromEnvironment(BoolFromEnvironmentConstantExpression exp,
-                                      AnnotationInfo context) {
-    return null;
-  }
-
-  @override
-  Annotation visitDouble(DoubleConstantExpression exp,
-                         AnnotationInfo context) {
-    return null;
-  }
-
-  @override
-  Annotation visitInt(IntConstantExpression exp,
-                      AnnotationInfo context) {
-    return null;
-  }
-
-  @override
-  Annotation visitIntFromEnvironment(IntFromEnvironmentConstantExpression exp,
-                                     AnnotationInfo context) {
-    return null;
-  }
-
-  @override
-  Annotation visitNamed(NamedArgumentReference exp,
-                        AnnotationInfo context) {
-    return null;
-  }
-
-  @override
-  Annotation visitNull(NullConstantExpression exp,
-                       AnnotationInfo context) {
-    return null;
-  }
-
-  @override
-  Annotation visitPositional(PositionalArgumentReference exp,
-                             AnnotationInfo context) {
-    return null;
-  }
-
-  @override
-  Annotation visitString(StringConstantExpression exp,
-                         AnnotationInfo context) {
-    return null;
-  }
-
-  @override
-  Annotation visitStringFromEnvironment(
-      StringFromEnvironmentConstantExpression exp,
-      AnnotationInfo context) {
-    return null;
-  }
-
-  @override
-  Annotation visitStringLength(StringLengthConstantExpression exp,
-                               AnnotationInfo context) {
-    return null;
-  }
-
-  @override
-  Annotation visitDeferred(DeferredConstantExpression exp,
-                           AnnotationInfo context) {
-    return exp.expression.accept(this, context);
-  }
-}
-
-/// A declaration is private if itself is private, or the owner is private.
-bool isHidden(DeclarationSourceMirror mirror) {
-  if (mirror is LibraryMirror) {
-    return _isLibraryPrivate(mirror);
-  } else if (mirror.owner is LibraryMirror) {
-    return (mirror.isPrivate || _isLibraryPrivate(mirror.owner) ||
-        mirror.isNameSynthetic);
-  } else {
-    return (mirror.isPrivate || isHidden(mirror.owner) ||
-        mirror.isNameSynthetic);
-  }
-}
-
-/// Transforms the map by calling toMap on each value in it.
-Map recurseMap(Map inputMap) {
-  var outputMap = new LinkedHashMap();
-  inputMap.forEach((key, value) {
-    if (value is Map) {
-      outputMap[key] = recurseMap(value);
-    } else {
-      outputMap[key] = value.toMap();
-    }
-  });
-  return outputMap;
-}
-
-/// Read a pubspec and return the library name given a [LibraryMirror].
-String getPackageName(LibraryMirror mirror) {
-  if (mirror.uri.scheme != 'file') return '';
-  var rootdir = getPackageDirectory(mirror);
-  if (rootdir == null) return '';
-  return packageNameFor(rootdir);
-}
-
-
-/// Helper that maps [mirrors] to their simple name in map.
-Map addAll(Map map, Iterable<DeclarationMirror> mirrors) {
-  for (var mirror in mirrors) {
-    map[dart2js_util.nameOf(mirror)] = mirror;
-  }
-  return map;
-}
-
-/// For the given library determine what items (if any) are exported.
-///
-/// Returns a Map with three keys: "classes", "methods", and "variables" the
-/// values of which point to a map of exported name identifiers with values
-/// corresponding to the actual DeclarationMirror.
-Map<String, Map<String, DeclarationMirror>> calcExportedItems(
-    LibrarySourceMirror library, Map visited) {
-  var exports = {};
-  visited[library] = exports;
-  exports['classes'] = new SplayTreeMap();
-  exports['methods'] = new SplayTreeMap();
-  exports['variables'] = new SplayTreeMap();
-
-  // Determine the classes, variables and methods that are exported for a
-  // specific dependency.
-  void _populateExports(LibraryDependencyMirror export, bool showExport) {
-    if (visited[export.targetLibrary] != null) return;
-    var transitiveExports = calcExportedItems(export.targetLibrary, visited);
-    exports['classes'].addAll(transitiveExports['classes']);
-    exports['methods'].addAll(transitiveExports['methods']);
-    exports['variables'].addAll(transitiveExports['variables']);
-    // If there is a show in the export, add only the show items to the
-    // library. Ex: "export foo show bar"
-    // Otherwise, add all items, and then remove the hidden ones.
-    // Ex: "export foo hide bar"
-
-    if (!showExport) {
-      // Add all items, and then remove the hidden ones.
-      // Ex: "export foo hide bar"
-      addAll(exports['classes'],
-          dart2js_util.typesOf(export.targetLibrary.declarations));
-      addAll(exports['methods'],
-          export.targetLibrary.declarations.values.where(
-              (mirror) => mirror is MethodMirror));
-      addAll(exports['variables'],
-          dart2js_util.variablesOf(export.targetLibrary.declarations));
-    }
-    for (CombinatorMirror combinator in export.combinators) {
-      for (String identifier in combinator.identifiers) {
-        var librarySourceMirror =
-            export.targetLibrary as DeclarationSourceMirror;
-        var declaration = librarySourceMirror.lookupInScope(identifier);
-        if (declaration == null) {
-          // Technically this should be a bug, but some of our packages
-          // (such as the polymer package) are curently broken in this
-          // way, so we just produce a warning.
-          print('Warning identifier $identifier not found in library '
-              '${dart2js_util.qualifiedNameOf(export.targetLibrary)}');
-        } else {
-          var subMap = exports['classes'];
-          if (declaration is MethodMirror) {
-            subMap = exports['methods'];
-          } else if (declaration is VariableMirror) {
-            subMap = exports['variables'];
-          }
-          if (showExport) {
-            subMap[identifier] = declaration;
-          } else {
-            subMap.remove(identifier);
-          }
-        }
-      }
-    }
-  }
-
-  Iterable<LibraryDependencyMirror> exportList =
-      library.libraryDependencies.where((lib) => lib.isExport);
-  for (LibraryDependencyMirror export in exportList) {
-    _populateExports(export,
-        export.combinators.any((combinator) => combinator.isShow));
-  }
-  return exports;
-}
-
-
-/// Returns a map of [Variable] objects constructed from [mirrorMap].
-/// The optional parameter [containingLibrary] is contains data for variables
-/// defined at the top level of a library (potentially for exporting
-/// purposes).
-Map<String, Variable> createVariables(Iterable<VariableMirror> mirrors,
-    Indexable owner) {
-  var data = new SplayTreeMap<String, Variable>();
-  // TODO(janicejl): When map to map feature is created, replace the below
-  // with a filter. Issue(#9590).
-  mirrors.forEach((dart2js_mirrors.Dart2JsFieldMirror mirror) {
-    if (includePrivateMembers || !isHidden(mirror)) {
-      var mirrorName = dart2js_util.nameOf(mirror);
-      data[mirrorName] = new Variable(mirrorName, mirror, owner);
-    }
-  });
-  return data;
-}
-
-/// Returns a map of [Method] objects constructed from [mirrorMap].
-/// The optional parameter [containingLibrary] is contains data for variables
-/// defined at the top level of a library (potentially for exporting
-/// purposes).
-Map<String, Method> createMethods(Iterable<MethodMirror> mirrors,
-    Indexable owner) {
-  var group = new SplayTreeMap<String, Method>();
-  mirrors.forEach((MethodMirror mirror) {
-    if (includePrivateMembers || !mirror.isPrivate) {
-      group[dart2js_util.nameOf(mirror)] = new Method(mirror, owner);
-    }
-  });
-  return group;
-}
-
-/// Returns a map of [Parameter] objects constructed from [mirrorList].
-Map<String, Parameter> createParameters(List<ParameterMirror> mirrorList,
-    Indexable owner) {
-  var data = {};
-  mirrorList.forEach((ParameterMirror mirror) {
-    data[dart2js_util.nameOf(mirror)] =
-        new Parameter(mirror, owner.owningLibrary);
-  });
-  return data;
-}
-
-/// Returns a map of [Generic] objects constructed from the class mirror.
-Map<String, Generic> createGenerics(TypeMirror mirror) {
-  return new Map.fromIterable(mirror.typeVariables,
-      key: (e) => dart2js_util.nameOf(e),
-      value: (e) => new Generic(e));
-}
-
-Map _filterMap(Map map, bool test(k, v)) {
-  var exported = new SplayTreeMap();
-  map.forEach((key, value) {
-    if (test(key, value)) exported[key] = value;
-  });
-  return exported;
-}
-
-/// Annotations that we do not display in the viewer.
-const List<String> _SKIPPED_ANNOTATIONS = const [
-  'metadata.DocsEditable', '_js_helper.JSName', '_js_helper.Creates',
-  '_js_helper.Returns'
-];
-
-/// Returns true if a library name starts with an underscore, and false
-/// otherwise.
-///
-/// An example that starts with _ is _js_helper.
-/// An example that contains ._ is dart._collection.dev
-bool _isLibraryPrivate(dart2js_mirrors.Dart2JsLibraryMirror mirror) {
-  // This method is needed because LibraryMirror.isPrivate returns `false` all
-  // the time.
-  var sdkLibrary = LIBRARIES[dart2js_util.nameOf(mirror)];
-  if (sdkLibrary != null) {
-    return !sdkLibrary.documented;
-  } else if (dart2js_util.nameOf(mirror).startsWith('_') || dart2js_util.nameOf(
-      mirror).contains('._')) {
-    return true;
-  }
-  return false;
-}
diff --git a/pkg/docgen/lib/src/models/owned_indexable.dart b/pkg/docgen/lib/src/models/owned_indexable.dart
deleted file mode 100644
index ea3335d..0000000
--- a/pkg/docgen/lib/src/models/owned_indexable.dart
+++ /dev/null
@@ -1,70 +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 docgen.models.owned_indexable;
-
-import '../exports/mirrors_util.dart' as dart2js_util;
-import '../exports/source_mirrors.dart';
-
-import '../library_helpers.dart';
-import '../mdn.dart';
-import '../package_helpers.dart';
-
-import 'annotation.dart';
-import 'dummy_mirror.dart';
-import 'indexable.dart';
-import 'model_helpers.dart';
-
-abstract class OwnedIndexable<TMirror extends DeclarationMirror>
-    extends Indexable<TMirror> {
-  /// List of the meta annotations on this item.
-  final List<Annotation> annotations;
-
-  /// The object one scope-level above which this item is defined.
-  ///
-  /// Ex: The owner for a top level class, would be its enclosing library.
-  /// The owner of a local variable in a method would be the enclosing method.
-  final Indexable owner;
-
-  /// Returns this object's qualified name, but following the conventions
-  /// we're using in Dartdoc, which is that library names with dots in them
-  /// have them replaced with hyphens.
-  String get docName => owner.docName + '.' + dart2js_util.nameOf(mirror);
-
-  OwnedIndexable(DeclarationMirror mirror, Indexable owner)
-      : annotations = createAnnotations(mirror, owner.owningLibrary),
-        this.owner = owner,
-        super(mirror);
-
-  /// Generates MDN comments from database.json.
-  String getMdnComment() {
-    var domAnnotation = this.annotations.firstWhere(
-        (e) => e.mirror.qualifiedName == #metadata.DomName,
-        orElse: () => null);
-    if (domAnnotation == null) return '';
-    var domName = domAnnotation.parameters.single;
-
-    return mdnComment(rootDirectory, logger, domName);
-  }
-
-  String get packagePrefix => owner.packagePrefix;
-
-  String findElementInScope(String name) {
-    var lookupFunc = determineLookupFunc(name);
-    var result = lookupFunc(mirror, name);
-    if (result != null) {
-      result = getDocgenObject(result);
-      if (result is DummyMirror) return packagePrefix + result.docName;
-      return result.packagePrefix + result.docName;
-    }
-
-    if (owner != null) {
-      var result = owner.findElementInScope(name);
-      if (result != null) {
-        return result;
-      }
-    }
-    return super.findElementInScope(name);
-  }
-}
diff --git a/pkg/docgen/lib/src/models/parameter.dart b/pkg/docgen/lib/src/models/parameter.dart
deleted file mode 100644
index ef9d9ab..0000000
--- a/pkg/docgen/lib/src/models/parameter.dart
+++ /dev/null
@@ -1,65 +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 docgen.models.parameter;
-
-import '../exports/mirrors_util.dart' as dart2js_util;
-import '../exports/source_mirrors.dart';
-
-import 'annotation.dart';
-import 'closure.dart';
-import 'doc_gen_type.dart';
-import 'library.dart';
-import 'mirror_based.dart';
-import 'model_helpers.dart';
-
-/// Docgen wrapper around the dart2js mirror for a Dart
-/// method/function parameter.
-class Parameter extends MirrorBased {
-  final ParameterMirror mirror;
-  final String name;
-  final bool isOptional;
-  final bool isNamed;
-  final bool hasDefaultValue;
-  final DocGenType type;
-  final String defaultValue;
-  /// List of the meta annotations on the parameter.
-  final List<Annotation> annotations;
-  final Library owningLibrary;
-  // Only non-null if this parameter is a function declaration.
-  Closure functionDeclaration;
-
-  Parameter(ParameterMirror mirror, Library owningLibrary)
-      : this.mirror = mirror,
-        name = dart2js_util.nameOf(mirror),
-        isOptional = mirror.isOptional,
-        isNamed = mirror.isNamed,
-        hasDefaultValue = mirror.hasDefaultValue,
-        defaultValue = getDefaultValue(mirror),
-        type = new DocGenType(mirror.type, owningLibrary),
-        annotations = createAnnotations(mirror, owningLibrary),
-        owningLibrary = owningLibrary {
-    if (mirror.type is FunctionTypeMirror) {
-      functionDeclaration =
-          new Closure(mirror.type as FunctionTypeMirror, owningLibrary);
-    }
-  }
-
-  /// Generates a map describing the [Parameter] object.
-  Map toMap() {
-    var map = {
-      'name': name,
-      'optional': isOptional,
-      'named': isNamed,
-      'default': hasDefaultValue,
-      'type': new List.filled(1, type.toMap()),
-      'value': defaultValue,
-      'annotations': annotations.map((a) => a.toMap()).toList()
-    };
-    if (functionDeclaration != null) {
-      map['functionDeclaration'] = functionDeclaration.toMap();
-    }
-    return map;
-  }
-}
\ No newline at end of file
diff --git a/pkg/docgen/lib/src/models/typedef.dart b/pkg/docgen/lib/src/models/typedef.dart
deleted file mode 100644
index 17e4208..0000000
--- a/pkg/docgen/lib/src/models/typedef.dart
+++ /dev/null
@@ -1,65 +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 docgen.models.typedef;
-
-import '../exports/source_mirrors.dart';
-
-import '../library_helpers.dart';
-
-import 'dummy_mirror.dart';
-import 'library.dart';
-import 'model_helpers.dart';
-import 'generic.dart';
-import 'parameter.dart';
-import 'owned_indexable.dart';
-
-class Typedef extends OwnedIndexable<TypedefMirror> {
-  final String returnType;
-
-  final Map<String, Parameter> parameters;
-
-  /// Generic information about the typedef.
-  final Map<String, Generic> generics;
-
-  /// Returns the [Library] for the given [mirror] if it has already been
-  /// created, else creates it.
-  factory Typedef(TypedefMirror mirror, Library owningLibrary) {
-    var aTypedef = getDocgenObject(mirror, owningLibrary);
-    if (aTypedef is DummyMirror) {
-      aTypedef = new Typedef._(mirror, owningLibrary);
-    }
-    return aTypedef;
-  }
-
-  Typedef._(TypedefMirror mirror, Library owningLibrary)
-      : returnType = getDocgenObject(mirror.referent.returnType).docName,
-        generics = createGenerics(mirror),
-        parameters = createParameters(mirror.referent.parameters,
-            owningLibrary),
-        super(mirror, owningLibrary);
-
-  Map toMap() {
-    var map = {
-      'name': name,
-      'qualifiedName': qualifiedName,
-      'comment': comment,
-      'return': returnType,
-      'parameters': recurseMap(parameters),
-      'annotations': annotations.map((a) => a.toMap()).toList(),
-      'generics': recurseMap(generics)
-    };
-
-    // Typedef is displayed on the library page as a class, so a preview is
-    // added manually
-    var pre = preview;
-    if (pre != null) map['preview'] = pre;
-
-    return map;
-  }
-
-  String get typeName => 'typedef';
-
-  bool isValidMirror(DeclarationMirror mirror) => mirror is TypedefMirror;
-}
diff --git a/pkg/docgen/lib/src/models/variable.dart b/pkg/docgen/lib/src/models/variable.dart
deleted file mode 100644
index b4b83ac..0000000
--- a/pkg/docgen/lib/src/models/variable.dart
+++ /dev/null
@@ -1,64 +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 docgen.models.variable;
-
-import '../exports/source_mirrors.dart';
-
-import '../library_helpers.dart';
-
-import 'class.dart';
-import 'doc_gen_type.dart';
-import 'dummy_mirror.dart';
-import 'indexable.dart';
-import 'owned_indexable.dart';
-
-
-/// A class containing properties of a Dart variable.
-class Variable extends OwnedIndexable<VariableMirror> {
-  final bool isFinal;
-  final bool isStatic;
-  final bool isConst;
-  final DocGenType type;
-  final String name;
-
-  factory Variable(String name, VariableMirror mirror, Indexable owner) {
-    var variable = getDocgenObject(mirror, owner);
-    if (variable is DummyMirror) {
-      return new Variable._(name, mirror, owner);
-    }
-    return variable;
-  }
-
-  Variable._(this.name, VariableMirror mirror, Indexable owner)
-      : isFinal = mirror.isFinal,
-        isStatic = mirror.isStatic,
-        isConst = mirror.isConst,
-        type = new DocGenType(mirror.type, owner.owningLibrary),
-        super(mirror, owner);
-
-  /// Generates a map describing the [Variable] object.
-  Map toMap() => {
-    'name': name,
-    'qualifiedName': qualifiedName,
-    'comment': comment,
-    'final': isFinal,
-    'static': isStatic,
-    'constant': isConst,
-    'type': new List.filled(1, type.toMap()),
-    'annotations': annotations.map((a) => a.toMap()).toList()
-  };
-
-  String get typeName => 'property';
-
-  String get comment {
-    if (commentField != null) return commentField;
-    if (owner is Class) {
-      (owner as Class).ensureComments();
-    }
-    return super.comment;
-  }
-
-  bool isValidMirror(DeclarationMirror mirror) => mirror is VariableMirror;
-}
diff --git a/pkg/docgen/lib/src/package_helpers.dart b/pkg/docgen/lib/src/package_helpers.dart
deleted file mode 100644
index f437166..0000000
--- a/pkg/docgen/lib/src/package_helpers.dart
+++ /dev/null
@@ -1,126 +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 docgen.package_helpers;
-
-import 'exports/source_mirrors.dart';
-import 'generator.dart' show pubScript;
-
-import 'dart:io';
-import 'package:path/path.dart' as path;
-import 'package:yaml/yaml.dart';
-
-/// Helper accessor to determine the full pathname of the root of the dart
-/// checkout if we are running without the --sdk parameter specified. That
-/// normally means we are running directly from source, and we expect to
-/// find the root as the directory above 'pkg'. The only other time this
-/// would happen is running a snapshot directly, rather than from the
-/// dartdocgen script, where we look for the dart-sdk directory. If not
-/// using the script and not in a normal directory structure, you'll need
-/// to pass the --sdk parameter.
-String get rootDirectory {
-  if (_rootDirectoryCache != null) return _rootDirectoryCache;
-  var scriptDir = path.absolute(path.dirname(Platform.script.toFilePath()));
-  var root = scriptDir;
-  var base = path.basename(root);
-  while (base != 'dart-sdk' && base != 'pkg') {
-    root = path.dirname(root);
-    base = path.basename(root);
-    if (root == base) {
-      // We have reached the root of the filesystem without finding anything.
-      throw new FileSystemException("Cannot find SDK directory starting from ",
-          scriptDir);
-    }
-  }
-  _rootDirectoryCache = path.dirname(root);
-  return _rootDirectoryCache;
-}
-String _rootDirectoryCache;
-
-/// Given a LibraryMirror that is a library, return the name of the directory
-/// holding the package information for that library. If the library is not
-/// part of a package, return null.
-String getPackageDirectory(LibraryMirror mirror) {
-  var file = mirror.uri.toFilePath();
-  // Any file that's in a package will be in a directory of the form
-  // packagename/lib/.../filename.dart, so we know that a possible
-  // package directory is at least in the directory above the one containing
-  // [file]
-  var directoryAbove = path.dirname(path.dirname(file));
-  var possiblePackage = _packageDirectoryFor(directoryAbove);
-  // We only want components that are somewhere underneath the lib directory.
-  var subPath = path.relative(file, from: possiblePackage);
-  var subPathComponents = path.split(subPath);
-  if (subPathComponents.isNotEmpty && subPathComponents.first == 'lib') {
-    return possiblePackage;
-  } else {
-    return null;
-  }
-}
-
-Map _getPubspec(String directoryName) {
-  var pubspecName = path.join(directoryName, 'pubspec.yaml');
-  File pubspec = new File(pubspecName);
-  if (!pubspec.existsSync()) return {'name': ''};
-  var contents = pubspec.readAsStringSync();
-  return loadYaml(contents);
-}
-
-/// Read a pubspec and return the library name, given a directory
-String packageNameFor(String directoryName) =>
-    _getPubspec(directoryName)['name'];
-
-/// Read a pubspec and return the library name, given a directory
-String _packageVersionFor(String directoryName) {
-  var spec = _getPubspec(directoryName);
-  return '${spec['name']}-${spec['version']}';
-}
-
-/// Look in the pubspec.lock to determine what version of a package we are
-/// documenting (null if not applicable).
-String packageVersion(LibraryMirror mirror) {
-  if (mirror.uri.scheme == 'file') {
-    String packageDirectory = getPackageDirectory(mirror);
-    if (packageDirectory == null) return '';
-    if (packageDirectory.contains('.pub-cache')) {
-      return path.basename(packageDirectory);
-    }
-    String packageName = packageNameFor(packageDirectory);
-    return _packageVersionFor(packageDirectory);
-  } else if (mirror.uri.scheme == 'dart') {
-    // If this item is from the SDK, use what version of pub we're running to
-    // ascertain the SDK version.
-    var pubVersion = Process.runSync(pubScript, ['--version'],
-        runInShell: true);
-    if (pubVersion.exitCode != 0) {
-      print(pubVersion.stderr);
-    }
-    return pubVersion.stdout.replaceAll('Pub ', '').trim();
-  }
-  return '';
-}
-
-String _packageVersionHelper(String packageDirectory, String packageName) {
-  var publockName = path.join(packageDirectory, 'pubspec.lock');
-  File publock = new File(publockName);
-  if (!publock.existsSync()) return '';
-  var contents = publock.readAsStringSync();
-  var spec = loadYaml(contents);
-  return spec['packages'][packageName];
-}
-
-/// Recursively walk up from directory name looking for a pubspec. Return
-/// the directory that contains it, or null if none is found.
-String _packageDirectoryFor(String directoryName) {
-  var dir = directoryName;
-  while (!_pubspecFor(dir).existsSync()) {
-    var newDir = path.dirname(dir);
-    if (newDir == dir) return null;
-    dir = newDir;
-  }
-  return dir;
-}
-
-File _pubspecFor(String directoryName) =>
-    new File(path.join(directoryName, 'pubspec.yaml'));
diff --git a/pkg/docgen/lib/src/viewer.dart b/pkg/docgen/lib/src/viewer.dart
deleted file mode 100644
index f5b7172..0000000
--- a/pkg/docgen/lib/src/viewer.dart
+++ /dev/null
@@ -1,201 +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.
-
-/// Convenience methods wrapped up in a class to pull down the docgen viewer for
-/// a viewable website, and start up a server for viewing.
-library docgen.viewer;
-
-import 'dart:io';
-
-import 'package:path/path.dart' as path;
-
-import 'generator.dart' as gen;
-import 'package_helpers.dart' show rootDirectory;
-
-final String _dartdocViewerString =
-    path.join(Directory.current.path, 'dartdoc-viewer');
-
-final Directory _dartdocViewerDir = new Directory(_dartdocViewerString);
-
-Directory _topLevelTempDir;
-Directory _webDocsDir;
-bool _movedViewerCode = false;
-
-void createViewer(bool serve) {
-  _clone();
-  _compile();
-  if (serve) {
-    _runServer();
-  }
-}
-
-/*
- * dartdoc-viewer currently has the web app code under a 'client' directory
- *
- * This is confusing for folks that want to clone and modify the code.
- * It also includes a number of python files and other content related to
- * app engine hosting that are not needed.
- *
- * This logic exists to support the current model and a (future) updated
- * dartdoc-viewer repo where the 'client' content exists at the root of the
- * project and the other content is removed.
- */
-String get _viewerCodePath {
-  if (_viewerCodePathCache == null) {
-    var pubspecFileName = 'pubspec.yaml';
-
-    var thePath = _dartdocViewerDir.path;
-
-    if (!FileSystemEntity.isFileSync(path.join(thePath, pubspecFileName))) {
-      thePath = path.join(thePath, 'client');
-      if (!FileSystemEntity.isFileSync(path.join(thePath, pubspecFileName))) {
-        throw new StateError('Could not find a pubspec file');
-      }
-    }
-
-    _viewerCodePathCache = thePath;
-  }
-  return _viewerCodePathCache;
-}
-String _viewerCodePathCache;
-
-/// If our dartdoc-viewer code is already checked out, move it to a temporary
-/// directory outside of the package directory, so we don't try to process it
-/// for documentation.
-void ensureMovedViewerCode() {
-  // TODO(efortuna): This will need to be modified to run on anyone's package
-  // outside of the checkout!
-  if (_dartdocViewerDir.existsSync()) {
-    _topLevelTempDir = new Directory(rootDirectory).createTempSync();
-    _dartdocViewerDir.renameSync(_topLevelTempDir.path);
-  }
-}
-
-/// Move the dartdoc-viewer code back into place for "webpage deployment."
-void addBackViewerCode() {
-  if (_movedViewerCode) _dartdocViewerDir.renameSync(_dartdocViewerString);
-}
-
-/// Serve up our generated documentation for viewing in a browser.
-void _clone() {
-  // If the viewer code is already there, then don't clone again.
-  if (_dartdocViewerDir.existsSync()) {
-    _moveDirectoryAndServe();
-  } else {
-    var processResult = Process.runSync('git', ['clone', '-b', 'master',
-        'https://github.com/dart-lang/dartdoc-viewer.git'], runInShell: true);
-
-    if (processResult.exitCode == 0) {
-      /// Move the generated json/yaml docs directory to the dartdoc-viewer
-      /// directory, to run as a webpage.
-      var processResult = Process.runSync(gen.pubScript, ['get'],
-          runInShell: true, workingDirectory: _viewerCodePath);
-      print('process output: ${processResult.stdout}');
-      print('process stderr: ${processResult.stderr}');
-
-      var dir = new Directory(gen.outputDirectory == null ? 'docs' :
-          gen.outputDirectory);
-      _webDocsDir = new Directory(path.join(_viewerCodePath, 'web', 'docs'));
-      if (dir.existsSync()) {
-        // Move the docs folder to dartdoc-viewer/client/web/docs
-        dir.renameSync(_webDocsDir.path);
-      }
-    } else {
-      print('Error cloning git repository:');
-      print('process output: ${processResult.stdout}');
-      print('process stderr: ${processResult.stderr}');
-    }
-  }
-}
-
-/// Move the generated json/yaml docs directory to the dartdoc-viewer
-/// directory, to run as a webpage.
-void _moveDirectoryAndServe() {
-  var processResult = Process.runSync(gen.pubScript, ['upgrade'], runInShell:
-      true, workingDirectory: path.join(_dartdocViewerDir.path, 'client'));
-  print('process output: ${processResult.stdout}');
-  print('process stderr: ${processResult.stderr}');
-
-  var dir = new Directory(gen.outputDirectory == null ? 'docs' :
-      gen.outputDirectory);
-  var webDocsDir = new Directory(path.join(_dartdocViewerDir.path, 'client',
-      'web', 'docs'));
-  if (dir.existsSync()) {
-    // Move the docs folder to dartdoc-viewer/client/web/docs
-    dir.renameSync(webDocsDir.path);
-  }
-
-  if (webDocsDir.existsSync()) {
-    // Compile the code to JavaScript so we can run on any browser.
-    print('Compiling the app to JavaScript.');
-    var processResult = Process.runSync(gen.dartBinary, ['deploy.dart'],
-        workingDirectory: path.join(_dartdocViewerDir.path, 'client'),
-        runInShell: true);
-    print('process output: ${processResult.stdout}');
-    print('process stderr: ${processResult.stderr}');
-    _runServer();
-  }
-}
-
-void _compile() {
-  if (_webDocsDir.existsSync()) {
-    // Compile the code to JavaScript so we can run on any browser.
-    print('Compiling the app to JavaScript.');
-    var processResult = Process.runSync(gen.dartBinary, ['deploy.dart'],
-        workingDirectory: _viewerCodePath, runInShell: true);
-    print('process output: ${processResult.stdout}');
-    print('process stderr: ${processResult.stderr}');
-    var outputDir = path.join(_viewerCodePath, 'out', 'web');
-    print('Docs are available at $outputDir');
-  }
-}
-
-/// A simple HTTP server. Implemented here because this is part of the SDK,
-/// so it shouldn't have any external dependencies.
-void _runServer() {
-  // Launch a server to serve out of the directory dartdoc-viewer/client/web.
-  HttpServer.bind(InternetAddress.ANY_IP_V6, 8080).then((HttpServer httpServer)
-      {
-    print('Server launched. Navigate your browser to: '
-        'http://localhost:${httpServer.port}');
-    httpServer.listen((HttpRequest request) {
-      var response = request.response;
-      var basePath = path.join(_viewerCodePath, 'out', 'web');
-      var requestPath = path.join(basePath, request.uri.path.substring(1));
-      bool found = true;
-      var file = new File(requestPath);
-      if (file.existsSync()) {
-        // Set the correct header type.
-        if (requestPath.endsWith('.html')) {
-          response.headers.set('Content-Type', 'text/html');
-        } else if (requestPath.endsWith('.js')) {
-          response.headers.set('Content-Type', 'application/javascript');
-        } else if (requestPath.endsWith('.dart')) {
-          response.headers.set('Content-Type', 'application/dart');
-        } else if (requestPath.endsWith('.css')) {
-          response.headers.set('Content-Type', 'text/css');
-        }
-      } else {
-        if (requestPath == basePath) {
-          response.headers.set('Content-Type', 'text/html');
-          file = new File(path.join(basePath, 'index.html'));
-        } else {
-          print('Path not found: $requestPath');
-          found = false;
-          response.statusCode = HttpStatus.NOT_FOUND;
-          response.close();
-        }
-      }
-
-      if (found) {
-        // Serve up file contents.
-        file.openRead().pipe(response).catchError((e) {
-          print('HttpServer: error while closing the response stream $e');
-        });
-      }
-    }, onError: (e) {
-      print('HttpServer: an error occured $e');
-    });
-  });
-}
diff --git a/pkg/docgen/pubspec.yaml b/pkg/docgen/pubspec.yaml
deleted file mode 100644
index d34a4d8..0000000
--- a/pkg/docgen/pubspec.yaml
+++ /dev/null
@@ -1,13 +0,0 @@
-name: docgen
-author: Dart Team <misc@dartlang.org>
-description: A documentation generator for the Dart repository.
-homepage: https://www.dartlang.org/
-dependencies:
-  args: '>=0.9.0 <0.14.0'
-  logging: '>=0.9.0 <0.12.0'
-  markdown: ^0.7.1+2
-  path: '>=0.9.0 <2.0.0'
-  yaml: '>=0.9.0 <3.0.0'
-dev_dependencies:
-  scheduled_test: '>=0.10.0 <0.12.0'
-  unittest: '>=0.9.0 <0.12.0'
diff --git a/pkg/docgen/test/async_await_test.dart b/pkg/docgen/test/async_await_test.dart
deleted file mode 100644
index e129455..0000000
--- a/pkg/docgen/test/async_await_test.dart
+++ /dev/null
@@ -1,150 +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 async_await_test;
-
-import 'dart:io';
-
-import 'package:path/path.dart' as path;
-import 'package:unittest/unittest.dart';
-
-import '../lib/src/exports/mirrors_util.dart' as dart2js_util;
-import '../lib/docgen.dart';
-
-const String DART_LIBRARY = '''
-  library test;
-  /**
-   * Doc comment for class [A].
-   *
-   * Multiline Test
-   */
-  /*
-   * Normal comment for class A.
-   */
-  class A {
-    m1() sync* {
-      yield 0;
-    }
-
-    m2() async {
-      await 0;
-      await for (var e in m1()) {}
-    }
-
-    m3() async* {
-      yield* m1();
-    }
-  }
-
-  m1() sync* {
-    yield 0;
-  }
-
-  m2() async {
-    await 0;
-    await for (var e in m1()) {}
-  }
-
-  m3() async* {
-    yield* m1();
-  }
-
-  main() {
-    m1();
-    m2();
-    m3();
-    A a = new A();
-    a.m1();
-    a.m2();
-    a.m3();
-  }
-''';
-
-main() {
-  group('Generate docs for', () {
-    test('file with async/await.', () {
-      var temporaryDir = Directory.systemTemp.createTempSync('single_library_');
-      var fileName = path.join(temporaryDir.path, 'temp.dart');
-      var file = new File(fileName);
-      file.writeAsStringSync(DART_LIBRARY);
-
-      return getMirrorSystem([new Uri.file(fileName)], false)
-        .then((mirrorSystem) {
-          var testLibraryUri = new Uri.file(path.absolute(fileName),
-                                            windows: Platform.isWindows);
-          var library = new Library(mirrorSystem.libraries[testLibraryUri]);
-          expect(library is Library, isTrue);
-
-          var classTypes = library.classes;
-          var classes = [];
-          classes.addAll(classTypes.values);
-          classes.addAll(library.errors.values);
-          expect(classes.every((e) => e is Class), isTrue);
-
-          expect(library.typedefs.values.every((e) => e is Typedef), isTrue);
-
-          var classMethodTypes = [];
-          classes.forEach((e) {
-            classMethodTypes.add(e.methods);
-            classMethodTypes.add(e.inheritedMethods);
-          });
-          expect(classMethodTypes.every((e) => e is Map<String, Method>),
-                 isTrue);
-
-          var classMethods = [];
-          classMethodTypes.forEach((e) {
-            classMethods.addAll(e.values);
-          });
-          expect(classMethods.every((e) => e is Method), isTrue);
-
-          var methodParameters = [];
-          classMethods.forEach((e) {
-            methodParameters.addAll(e.parameters.values);
-          });
-          expect(methodParameters.every((e) => e is Parameter), isTrue);
-
-          var functionTypes = library.functions;
-          expect(functionTypes is Map<String, Method>, isTrue);
-
-          var functions = [];
-          functions.addAll(functionTypes.values);
-          expect(functions.every((e) => e is Method), isTrue);
-
-          var functionParameters = [];
-          functions.forEach((e) {
-            functionParameters.addAll(e.parameters.values);
-          });
-          expect(functionParameters.every((e) => e is Parameter), isTrue);
-
-          var variables = library.variables.values;
-          expect(variables.every((e) => e is Variable), isTrue);
-
-          /// Testing fixReference
-          // Testing Doc comment for class [A].
-          var libraryMirror = mirrorSystem.libraries[testLibraryUri];
-          var classMirror =
-              dart2js_util.classesOf(libraryMirror.declarations).first;
-          var classDocComment = library.fixReference('A').children.first.text;
-          expect(classDocComment, 'test.A');
-
-          // Test for linking to parameter [A]
-          var method = getDocgenObject(
-              classMirror.declarations[dart2js_util.symbolOf('m1')]);
-
-          // Testing trying to refer to m1 method
-          var methodDocComment = method.fixReference(
-              'm1').children.first.text;
-          expect(methodDocComment, 'test.A.m1');
-
-          // Testing something with no reference
-          var libraryDocComment = method.fixReference('foobar').text;
-          expect(libraryDocComment, 'foobar');
-
-          // Testing trying to refer to m1 function
-          libraryDocComment = library.fixReference('m1').children.first.text;
-          expect(libraryDocComment, 'test.m1');
-        }).whenComplete(() => temporaryDir.deleteSync(recursive: true));
-    });
-  });
-}
diff --git a/pkg/docgen/test/constant_argument_test.dart b/pkg/docgen/test/constant_argument_test.dart
deleted file mode 100644
index bf5a84a..0000000
--- a/pkg/docgen/test/constant_argument_test.dart
+++ /dev/null
@@ -1,80 +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 docgen.test.typedef;
-
-import 'dart:convert';
-import 'dart:io';
-
-import 'package:path/path.dart' as p;
-import 'package:scheduled_test/descriptor.dart' as d;
-import 'package:scheduled_test/scheduled_test.dart';
-
-import 'util.dart';
-import '../lib/docgen.dart' as dg;
-
-void main() {
-
-  setUp(() {
-    scheduleTempDir();
-  });
-
-  test('argument default values', () {
-    schedule(() {
-      var codeDir = getMultiLibraryCodePath();
-      expect(FileSystemEntity.isDirectorySync(codeDir), isTrue);
-      return dg.docgen([codeDir], out: p.join(d.defaultRoot, 'docs'));
-    });
-
-    schedule(() {
-      var path = p.join(d.defaultRoot, 'docs', 'test_lib.json');
-      var dartCoreJson = new File(path).readAsStringSync();
-
-      var testLibBar = JSON.decode(dartCoreJson) as Map<String, dynamic>;
-
-      //
-      // Validate function doc references
-      //
-      var functionDef =
-          testLibBar['functions']['methods']['positionalDefaultValues']
-          as Map<String, dynamic>;
-
-      var params = functionDef['parameters'] as Map<String, dynamic>;
-
-      expect(params.keys, orderedEquals(_PARAM_NAME_ORDER),
-          reason: 'parameter order  must be maintained');
-
-      var vals = {};
-      params.forEach((paramName, paramHash) {
-        expect(_PARAM_VALUES, contains(paramName));
-        expect(paramHash['value'], _PARAM_VALUES[paramName],
-            reason: 'Value for $paramName should match expected');
-      });
-    });
-  });
-}
-
-final _PARAM_VALUES = {
-  "intConst": "42",
-  "boolConst": "true",
-  "listConst": 'const [true, 42, "Shanna", null, 3.14, const []]',
-  "stringConst": "\"Shanna\"",
-  "mapConst": 'const {"a": 1, 2: true, "c": const [1, null, true]}',
-  "emptyMap": 'const {}',
-  "referencedConst": "INT_CONST",
-  "constructedConstant1": "const ConstClass<int>(0, true)",
-  "constructedConstant2": 'const ConstClass(1, false, str: "str")'
-};
-
-const _PARAM_NAME_ORDER = const [
-  "intConst",
-  "boolConst",
-  "listConst",
-  "stringConst",
-  "mapConst",
-  "emptyMap",
-  "referencedConst",
-  "constructedConstant1",
-  "constructedConstant2"
-];
diff --git a/pkg/docgen/test/generate_json_test.dart b/pkg/docgen/test/generate_json_test.dart
deleted file mode 100644
index c22ae13..0000000
--- a/pkg/docgen/test/generate_json_test.dart
+++ /dev/null
@@ -1,50 +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 docgen.generate_json_test;
-
-import 'dart:io';
-
-import 'package:path/path.dart' as p;
-import 'package:scheduled_test/descriptor.dart' as d;
-import 'package:scheduled_test/scheduled_test.dart';
-
-import 'util.dart';
-import '../lib/docgen.dart' as dg;
-
-void main() {
-
-  setUp(() {
-    scheduleTempDir();
-  });
-
-  test('json output', () {
-    schedule(() {
-      var codeDir = getMultiLibraryCodePath();
-      expect(FileSystemEntity.isDirectorySync(codeDir), isTrue);
-      return dg.docgen([codeDir], out: p.join(d.defaultRoot, 'docs'));
-    });
-
-    d.dir('docs', [
-        d.matcherFile('index.json', isJsonMap),
-        d.matcherFile('index.txt', hasSortedLines),
-        d.matcherFile('library_list.json', isJsonMap),
-        d.matcherFile('library_list.json',
-            startsWith(_LIBRARY_LIST_UNINDENT_START)),
-        d.matcherFile('sub_lib.json', isJsonMap),
-        d.matcherFile('sub_lib.SubLibClass.json', isJsonMap),
-        d.matcherFile('sub_lib.SubLibPart.json', isJsonMap),
-        d.matcherFile('test_lib-bar.C.json', isJsonMap),
-        d.matcherFile('test_lib-bar.json', isJsonMap),
-        d.matcherFile('test_lib-foo.B.json', isJsonMap),
-        d.matcherFile('test_lib-foo.json', isJsonMap),
-        d.matcherFile('test_lib.A.json', isJsonMap),
-        d.matcherFile('test_lib.B.json', isJsonMap),
-        d.matcherFile('test_lib.C.json', isJsonMap),
-        d.matcherFile('test_lib.json', isJsonMap),
-    ]).validate();
-  });
-}
-
-const _LIBRARY_LIST_UNINDENT_START = '{"libraries":[{"packageName":""';
diff --git a/pkg/docgen/test/inherited_comments_test.dart b/pkg/docgen/test/inherited_comments_test.dart
deleted file mode 100644
index 3f07887..0000000
--- a/pkg/docgen/test/inherited_comments_test.dart
+++ /dev/null
@@ -1,49 +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 docgen.test.inherited_comments;
-
-import 'dart:convert';
-import 'dart:io';
-
-import 'package:path/path.dart' as p;
-import 'package:scheduled_test/descriptor.dart' as d;
-import 'package:scheduled_test/scheduled_test.dart';
-
-import 'util.dart';
-import '../lib/docgen.dart' as dg;
-
-void main() {
-
-  setUp(() {
-    scheduleTempDir();
-  });
-
-  test('inherited comments', () {
-    schedule(() {
-      var codeDir = getMultiLibraryCodePath();
-      expect(FileSystemEntity.isDirectorySync(codeDir), isTrue);
-      return dg.docgen([codeDir], out: p.join(d.defaultRoot, 'docs'));
-    });
-
-    schedule(() {
-      var path = p.join(d.defaultRoot, 'docs', 'dart-core.Set.json');
-      var dartCoreSetJson = new File(path).readAsStringSync();
-
-      var dartCoreSet = JSON.decode(dartCoreSetJson) as Map<String, dynamic>;
-
-      var toListDetails = dartCoreSet['inheritedMethods']['methods']['toList']
-          as Map<String, dynamic>;
-
-      expect(toListDetails, containsPair('comment', _TO_LIST_COMMENT));
-      expect(toListDetails, containsPair('commentFrom', _TO_LIST_COMMENT_FROM));
-    });
-  });
-}
-
-const _TO_LIST_COMMENT = "<p>Creates a <a>dart:core.List</a> containing the "
-    "elements of this <a>dart:core.Iterable</a>.</p>\n<p>The elements are in "
-    "iteration order. The list is fixed-length\nif "
-    "<a>dart:core.Set.toList.growable</a> is false.</p>";
-const _TO_LIST_COMMENT_FROM = "dart:core.Iterable.toList";
diff --git a/pkg/docgen/test/metadata_test.dart b/pkg/docgen/test/metadata_test.dart
deleted file mode 100644
index 87ea6f5..0000000
--- a/pkg/docgen/test/metadata_test.dart
+++ /dev/null
@@ -1,65 +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 async_await_test;
-
-import 'dart:io';
-
-import 'package:path/path.dart' as path;
-import 'package:unittest/unittest.dart';
-
-import '../lib/src/exports/mirrors_util.dart' as dart2js_util;
-import '../lib/src/models/annotation.dart';
-import '../lib/docgen.dart';
-
-const Map<String, String> SOURCES = const <String, String>{
-  'main.dart': '''
-import 'lib.dart' as lib;
-
-@lib.Annotation("foo", 42)
-main() {
-}
-''',
-  'lib.dart': '''
-class Annotation {
-  final String arg1;
-  final int arg2;
-  const Annotation(this.arg1, this.arg2);
-}
-'''};
-
-main() {
-  group('Generate docs for', () {
-    test('files with annotations', () {
-      var temporaryDir = Directory.systemTemp.createTempSync('metadata_');
-      var uris = <Uri>[];
-      SOURCES.forEach((name, code) {
-        var fileName = path.join(temporaryDir.path, name);
-        var file = new File(fileName);
-        file.writeAsStringSync(code);
-        uris.add(new Uri.file(fileName));
-      });
-
-      return getMirrorSystem(uris, false).then((mirrorSystem) {
-        var library = new Library(mirrorSystem.libraries[uris[0]]);
-        expect(library is Library, isTrue);
-
-        var main = library.functions['main'];
-        expect(main is Method, isTrue);
-
-        var annotations = main.annotations;
-        expect(annotations.length, equals(1));
-
-        var annotation = annotations[0];
-        expect(annotation is Annotation, isTrue);
-
-        var map = annotation.toMap();
-        expect(map['name'], equals('lib-dart.Annotation.Annotation-'));
-        expect(map['parameters'].length, equals(2));
-        expect(map['parameters'][0], equals('"foo"'));
-        expect(map['parameters'][1], equals('42'));
-      }).whenComplete(() => temporaryDir.deleteSync(recursive: true));
-    });
-  });
-}
diff --git a/pkg/docgen/test/method_param_test.dart b/pkg/docgen/test/method_param_test.dart
deleted file mode 100644
index a12840e..0000000
--- a/pkg/docgen/test/method_param_test.dart
+++ /dev/null
@@ -1,28 +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 docgen.test.method_param;
-
-import 'package:path/path.dart' as path;
-import 'package:scheduled_test/scheduled_test.dart';
-
-import 'util.dart';
-import '../lib/docgen.dart' as gen;
-
-void main() {
-  test('method function parameters', () {
-    var lib_file = path.toUri(path.join(getMultiLibraryCodePath(), 'lib',
-        'test_lib2.dart'));
-    return gen.getMirrorSystem([lib_file], false)
-      .then((mirrorSystem) {
-        var library = new gen.Library(mirrorSystem.libraries[lib_file]);
-
-        // Test that libraries do recursive exports correctly.
-        var funcParams = library.functions['fooFunc'].parameters;
-        expect('Symbol("dart.core.int")', library.functions['fooFunc']
-            .parameters['fooFuncParam'].functionDeclaration.parameters['x']
-            .type.mirror.qualifiedName.toString());
-      });
-  });
-}
\ No newline at end of file
diff --git a/pkg/docgen/test/multi_library_code/lib/dottedLibraryName.dart b/pkg/docgen/test/multi_library_code/lib/dottedLibraryName.dart
deleted file mode 100644
index c4357c1..0000000
--- a/pkg/docgen/test/multi_library_code/lib/dottedLibraryName.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 library.name.wiith.dots.init;
-
-/// This library is purely for testing purposes, to ensure
-/// that we have a library that has dots in its name and
-/// that it works properly
-///
-/// In addition, it's nice to have something which has paragraph
-/// breaks inside a triple-slash doc comment.
-///
-/// Like this.
-
-/// This is a top level field holding the number three;
-int topLevelInt = 3;
-
-/// This is a class with various ways of getting the number three.
-///
-/// It also has a comment with paragraph breaks.
-class SomeClass {
-  /// This is a method that returns the number three. See
-  /// [three]
-  someMethod() => 3;
-
-  /// This is a symbolic representation of the number three.
-  int three = 3;
-}
-
-/// This is another class.
-class AnotherClass {
-  /// This method returns [List<int>] containing the number
-  /// three three times. Compare with [SomeClass.someMethod].
-  List<int> anotherMethod() {
-    return const [3, 3, 3];
-  }
-}
diff --git a/pkg/docgen/test/multi_library_code/lib/root_lib.dart b/pkg/docgen/test/multi_library_code/lib/root_lib.dart
deleted file mode 100644
index 74423ab..0000000
--- a/pkg/docgen/test/multi_library_code/lib/root_lib.dart
+++ /dev/null
@@ -1,13 +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 root_lib;
-
-export 'test_lib.dart';
-export 'test_lib_foo.dart';
-export 'test_lib_bar.dart';
-
-class RootClass {
-  RootClass(int a, int b);
-}
diff --git a/pkg/docgen/test/multi_library_code/lib/src/src_lib.dart b/pkg/docgen/test/multi_library_code/lib/src/src_lib.dart
deleted file mode 100644
index 9755378..0000000
--- a/pkg/docgen/test/multi_library_code/lib/src/src_lib.dart
+++ /dev/null
@@ -1,5 +0,0 @@
-library internal_lib;
-
-part 'src_lib_part.dart';
-
-class InternalLibClass {}
diff --git a/pkg/docgen/test/multi_library_code/lib/src/src_lib_part.dart b/pkg/docgen/test/multi_library_code/lib/src/src_lib_part.dart
deleted file mode 100644
index 1f866ed..0000000
--- a/pkg/docgen/test/multi_library_code/lib/src/src_lib_part.dart
+++ /dev/null
@@ -1,3 +0,0 @@
-part of internal_lib;
-
-class InternalLibPart {}
diff --git a/pkg/docgen/test/multi_library_code/lib/sublib_dir/sub_lib.dart b/pkg/docgen/test/multi_library_code/lib/sublib_dir/sub_lib.dart
deleted file mode 100644
index b1726a9..0000000
--- a/pkg/docgen/test/multi_library_code/lib/sublib_dir/sub_lib.dart
+++ /dev/null
@@ -1,5 +0,0 @@
-library sub_lib;
-
-part 'sub_lib_part.dart';
-
-class SubLibClass {}
diff --git a/pkg/docgen/test/multi_library_code/lib/sublib_dir/sub_lib_part.dart b/pkg/docgen/test/multi_library_code/lib/sublib_dir/sub_lib_part.dart
deleted file mode 100644
index 9698296..0000000
--- a/pkg/docgen/test/multi_library_code/lib/sublib_dir/sub_lib_part.dart
+++ /dev/null
@@ -1,3 +0,0 @@
-part of sub_lib;
-
-class SubLibPart {}
diff --git a/pkg/docgen/test/multi_library_code/lib/test_lib.dart b/pkg/docgen/test/multi_library_code/lib/test_lib.dart
deleted file mode 100644
index 8d76624..0000000
--- a/pkg/docgen/test/multi_library_code/lib/test_lib.dart
+++ /dev/null
@@ -1,65 +0,0 @@
-// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library test_lib;
-
-import 'test_lib_foo.dart';
-import 'test_lib_bar.dart';
-export 'test_lib_foo.dart';
-export 'test_lib_bar.dart';
-
-/**
- * Doc comment for class [A].
- *
- * Multiline Test
- */
-/*
- * Normal comment for class A.
- */
-class A {
-
-  int _someNumber;
-
-  A() {
-    _someNumber = 12;
-  }
-
-  A.customConstructor();
-
-  /**
-   * Test for linking to parameter [A]
-   */
-  void doThis(int A) {
-    print(A);
-  }
-}
-
-// A trivial use of `B` and `C` to eliminate import warnings
-B sampleMethod(C cInstance) {
-  throw new UnimplementedError();
-}
-
-int positionalDefaultValues([
-    int intConst = 42,
-    bool boolConst = true,
-    List listConst = const [true, 42, 'Shanna', null, 3.14, const []],
-    String stringConst = 'Shanna',
-    Map mapConst = const {'a':1, 2: true, 'c': const [1,null,true]},
-    Map emptyMap = const {},
-    int referencedConst = INT_CONST,
-    ConstClass constructedConstant1 = const ConstClass<int>(0, true),
-    ConstClass constructedConstant2 = const ConstClass(1, false, str: "str")]) {
-  throw new UnimplementedError();
-}
-
-const int INT_CONST = 42;
-
-class ConstClass<T> {
-  final bool boolField;
-  final int intField;
-  final String stringField;
-
-  const ConstClass(this.intField, this.boolField, {String str: 'default'})
-      : this.stringField = str;
-}
diff --git a/pkg/docgen/test/multi_library_code/lib/test_lib2.dart b/pkg/docgen/test/multi_library_code/lib/test_lib2.dart
deleted file mode 100644
index b28f6d8..0000000
--- a/pkg/docgen/test/multi_library_code/lib/test_lib2.dart
+++ /dev/null
@@ -1,9 +0,0 @@
-// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library test_lib2;
-
-export 'test_lib2_foo.dart';
-
-String fooFunc(bool fooFuncParam(int x)) => 'hi';
\ No newline at end of file
diff --git a/pkg/docgen/test/multi_library_code/lib/test_lib2_bar.dart b/pkg/docgen/test/multi_library_code/lib/test_lib2_bar.dart
deleted file mode 100644
index 1a07d2b..0000000
--- a/pkg/docgen/test/multi_library_code/lib/test_lib2_bar.dart
+++ /dev/null
@@ -1,9 +0,0 @@
-// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library test_lib2_bar;
-
-class Bar {
-
-}
diff --git a/pkg/docgen/test/multi_library_code/lib/test_lib2_foo.dart b/pkg/docgen/test/multi_library_code/lib/test_lib2_foo.dart
deleted file mode 100644
index 1b3d037..0000000
--- a/pkg/docgen/test/multi_library_code/lib/test_lib2_foo.dart
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library test_lib2_foo;
-
-export 'test_lib2_bar.dart';
-
-class Foo {
-
-}
-
-main() {
-  print('hello world');
-}
diff --git a/pkg/docgen/test/multi_library_code/lib/test_lib_bar.dart b/pkg/docgen/test/multi_library_code/lib/test_lib_bar.dart
deleted file mode 100644
index 6f36d9b..0000000
--- a/pkg/docgen/test/multi_library_code/lib/test_lib_bar.dart
+++ /dev/null
@@ -1,30 +0,0 @@
-// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library test_lib.bar;
-
-import 'test_lib.dart';
-import 'test_lib_foo.dart';
-
-/*
- * Normal comment for class C.
- */
-class C {
-}
-
-/// Processes an [input] of type [C] instance for testing.
-///
-/// To eliminate import warnings for [A] and to test typedefs.
-///
-/// It's important that the [List<A>] for param [listOfA] is not empty.
-A testMethod(C input, List<A> listOfA, B aBee) {
-  throw 'noop';
-}
-
-/// Processes an [input] of type [C] instance for testing.
-///
-/// To eliminate import warnings for [A] and to test typedefs.
-///
-/// It's important that the [List<A>] for param [listOfA] is not empty.
-typedef A testTypedef(C other, List<A> listOfA, B aBee);
diff --git a/pkg/docgen/test/multi_library_code/lib/test_lib_foo.dart b/pkg/docgen/test/multi_library_code/lib/test_lib_foo.dart
deleted file mode 100644
index b615bf6..0000000
--- a/pkg/docgen/test/multi_library_code/lib/test_lib_foo.dart
+++ /dev/null
@@ -1,41 +0,0 @@
-// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library test_lib.foo;
-
-import 'test_lib.dart';
-
-/**
- * Doc comment for class [B].
- *
- * Multiline Test
- */
-
-/*
- * Normal comment for class B.
- */
-class B extends A {
-
-  B();
-  B.fooBar();
-
-  /**
-   * Test for linking to super
-   */
-  int doElse(int b) {
-    print(b);
-    return b;
-  }
-
-  /**
-   * Test for linking to parameter [c]
-   */
-  void doThis(int c) {
-    print(c);
-  }
-}
-
-int testFunc(int a) {
-  return a;
-}
diff --git a/pkg/docgen/test/multi_library_test.dart b/pkg/docgen/test/multi_library_test.dart
deleted file mode 100644
index ceda276..0000000
--- a/pkg/docgen/test/multi_library_test.dart
+++ /dev/null
@@ -1,106 +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 single_library_test;
-
-import 'package:path/path.dart' as p;
-import 'package:unittest/unittest.dart';
-
-import '../lib/docgen.dart';
-import '../lib/src/exports/mirrors_util.dart' as dart2js_util;
-
-import 'util.dart';
-
-List<Uri> _writeLibFiles() {
-  var codePath = getMultiLibraryCodePath();
-
-  codePath = p.join(codePath, 'lib');
-
-  return ['test_lib.dart', 'test_lib_bar.dart', 'test_lib_foo.dart']
-      .map((name) => p.join(codePath, name))
-      .map(p.toUri)
-      .toList();
-}
-
-void main() {
-  group('Generate docs for', () {
-    test('multiple libraries.', () {
-      var files = _writeLibFiles();
-      return getMirrorSystem(files, false)
-        .then((mirrorSystem) {
-          var test_libraryUri = files[0];
-          var library = new Library(mirrorSystem.libraries[test_libraryUri]);
-
-          /// Testing fixReference
-          // Testing Doc comment for class [B].
-          var libraryMirror = mirrorSystem.libraries[test_libraryUri];
-          var classDocComment = library.fixReference('B').children.first.text;
-          expect(classDocComment, 'test_lib.B');
-
-          // Test for linking to parameter [c]
-          var importedLib = libraryMirror.libraryDependencies.firstWhere(
-            (dep) => dep.isImport).targetLibrary;
-          var aClassMirror =
-              dart2js_util.classesOf(importedLib.declarations).first;
-          expect(dart2js_util.qualifiedNameOf(aClassMirror),
-                 'test_lib.foo.B');
-          var exportedClass = getDocgenObject(aClassMirror, library);
-          expect(exportedClass is Class, isTrue);
-
-
-          var method = exportedClass.methods['doThis'];
-          expect(method is Method, isTrue);
-          var methodParameterDocComment = method.fixReference(
-              'c').children.first.text;
-          expect(methodParameterDocComment, 'test_lib.B.doThis.c');
-
-
-          expect(method.fixReference('A').children.first.text, 'test_lib.A');
-          // Testing trying to refer to doThis function
-          expect(method.fixReference('doThis').children.first.text,
-              'test_lib.B.doThis');
-
-          // Testing trying to refer to doThis function
-          expect(method.fixReference('doElse').children.first.text,
-              'test_lib.B.doElse');
-
-
-          // Test a third library referencing another exported library in a
-          // separate file.
-          importedLib = libraryMirror.libraryDependencies.firstWhere(
-            (dep) => dep.isImport &&
-                     dart2js_util.qualifiedNameOf(dep.targetLibrary) ==
-            'test_lib.bar').targetLibrary;
-          aClassMirror = dart2js_util.classesOf(importedLib.declarations).first;
-          expect(dart2js_util.qualifiedNameOf(aClassMirror),
-                 'test_lib.bar.C');
-          exportedClass = getDocgenObject(aClassMirror, library);
-          expect(exportedClass is Class, isTrue);
-          expect(exportedClass.docName, 'test_lib.C');
-
-          methodParameterDocComment = exportedClass.fixReference(
-              'B').children.first.text;
-          expect(methodParameterDocComment, 'test_lib.B');
-
-          methodParameterDocComment = exportedClass.fixReference(
-              'testFunc').children.first.text;
-          expect(methodParameterDocComment, 'test_lib.testFunc');
-
-        });
-    });
-
-    test('multiple exported libraries.', () {
-      var lib_file = p.toUri(p.join(getMultiLibraryCodePath(), 'lib',
-          'test_lib2.dart'));
-      return getMirrorSystem([lib_file], false)
-        .then((mirrorSystem) {
-          var library = new Library(mirrorSystem.libraries[lib_file]);
-
-          // Test that libraries do recursive exports correctly.
-          expect(true, library.classes.keys.contains('Bar'));
-        });
-
-    });
-  });
-}
diff --git a/pkg/docgen/test/native_extensions_test.dart b/pkg/docgen/test/native_extensions_test.dart
deleted file mode 100644
index 70e789c..0000000
--- a/pkg/docgen/test/native_extensions_test.dart
+++ /dev/null
@@ -1,100 +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 native_extensions_test;
-
-import 'dart:io';
-
-import 'package:path/path.dart' as path;
-import 'package:unittest/unittest.dart';
-
-import '../lib/src/exports/mirrors_util.dart' as dart2js_util;
-import '../lib/docgen.dart';
-
-const String DART_LIBRARY = '''
-  library sample_synchronous_extension;
-
-  import 'dart-ext:sample_extension';
-
-  // The simplest way to call native code: top-level functions.
-  int systemRand() native "SystemRand";
-  bool systemSrand(int seed) native "SystemSrand";
-
-  void main() {
-    systemRand();
-    systemSrand(4);
-  }
-''';
-
-main() {
-  group('Generate docs for', () {
-    test('file with native extensions.', () {
-      var temporaryDir = Directory.systemTemp.createTempSync('native_ext_');
-      var fileName = path.join(temporaryDir.path, 'temp.dart');
-      var file = new File(fileName);
-      file.writeAsStringSync(DART_LIBRARY);
-
-      return getMirrorSystem([new Uri.file(fileName)], false)
-        .then((mirrorSystem) {
-          var testLibraryUri = new Uri.file(path.absolute(fileName),
-                                            windows: Platform.isWindows);
-          var library = new Library(mirrorSystem.libraries[testLibraryUri]);
-          expect(library is Library, isTrue);
-
-          var classTypes = library.classes;
-          var classes = [];
-          classes.addAll(classTypes.values);
-          classes.addAll(library.errors.values);
-          expect(classes.every((e) => e is Class), isTrue);
-
-          expect(library.typedefs.values.every((e) => e is Typedef), isTrue);
-
-          var classMethodTypes = [];
-          classes.forEach((e) {
-            classMethodTypes.add(e.methods);
-            classMethodTypes.add(e.inheritedMethods);
-          });
-          expect(classMethodTypes.every((e) => e is Map<String, Method>),
-                 isTrue);
-
-          var classMethods = [];
-          classMethodTypes.forEach((e) {
-            classMethods.addAll(e.values);
-          });
-          expect(classMethods.every((e) => e is Method), isTrue);
-
-          var methodParameters = [];
-          classMethods.forEach((e) {
-            methodParameters.addAll(e.parameters.values);
-          });
-          expect(methodParameters.every((e) => e is Parameter), isTrue);
-
-          var functionTypes = library.functions;
-          expect(functionTypes is Map<String, Method>, isTrue);
-
-          var functions = [];
-          functions.addAll(functionTypes.values);
-          expect(functions.every((e) => e is Method), isTrue);
-
-          var functionParameters = [];
-          functions.forEach((e) {
-            functionParameters.addAll(e.parameters.values);
-          });
-          expect(functionParameters.every((e) => e is Parameter), isTrue);
-
-          var variables = library.variables.values;
-          expect(variables.every((e) => e is Variable), isTrue);
-
-          // Testing trying to refer to m1 function
-          var libraryDocComment =
-              library.fixReference('systemRand').children.first.text;
-          expect(libraryDocComment, 'sample_synchronous_extension.systemRand');
-
-          libraryDocComment =
-              library.fixReference('systemSrand').children.first.text;
-          expect(libraryDocComment, 'sample_synchronous_extension.systemSrand');
-        }).whenComplete(() => temporaryDir.deleteSync(recursive: true));
-    });
-  });
-}
diff --git a/pkg/docgen/test/only_lib_content_in_pkg_test.dart b/pkg/docgen/test/only_lib_content_in_pkg_test.dart
deleted file mode 100644
index b4ec488..0000000
--- a/pkg/docgen/test/only_lib_content_in_pkg_test.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 docgen.test.only_lib_content_in_pkg;
-
-import 'dart:io';
-
-import 'package:path/path.dart' as p;
-import 'package:scheduled_test/descriptor.dart' as d;
-import 'package:scheduled_test/scheduled_test.dart';
-
-import '../lib/docgen.dart' as dg;
-import 'util.dart';
-
-void main() {
-
-  setUp(() {
-    scheduleTempDir();
-  });
-
-  test('exclude non-lib code from package docs', () {
-    schedule(() {
-      var thisScript = Platform.script;
-      var thisPath = p.fromUri(thisScript);
-      expect(p.basename(thisPath), 'only_lib_content_in_pkg_test.dart');
-      expect(p.dirname(thisPath), endsWith('test'));
-
-      var packageRoot = Platform.packageRoot;
-      if (packageRoot == '') packageRoot = null;
-
-      var codeDir = p.normalize(p.join(thisPath, '..', '..'));
-      expect(FileSystemEntity.isDirectorySync(codeDir), isTrue);
-      return dg.docgen(['$codeDir/'], out: p.join(d.defaultRoot, 'docs'),
-          packageRoot: packageRoot);
-    });
-
-    d.dir('docs', [
-        d.dir('docgen', [
-          d.matcherFile('docgen.json',  isJsonMap)
-        ]),
-        d.matcherFile('index.json', isJsonMap),
-        d.matcherFile('index.txt', hasSortedLines),
-        d.matcherFile('library_list.json', isJsonMap),
-        d.nothing('test_lib.json'),
-        d.nothing('test_lib-bar.json'),
-        d.nothing('test_lib-foo.json')
-    ]).validate();
-
-  });
-}
diff --git a/pkg/docgen/test/single_library_test.dart b/pkg/docgen/test/single_library_test.dart
deleted file mode 100644
index 31f3a5e..0000000
--- a/pkg/docgen/test/single_library_test.dart
+++ /dev/null
@@ -1,131 +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 single_library_test;
-
-import 'dart:io';
-
-import 'package:path/path.dart' as path;
-import 'package:unittest/unittest.dart';
-
-import '../lib/src/exports/mirrors_util.dart' as dart2js_util;
-import '../lib/docgen.dart';
-
-const String DART_LIBRARY = '''
-  library test;
-  /**
-   * Doc comment for class [A].
-   *
-   * Multiline Test
-   */
-  /*
-   * Normal comment for class A.
-   */
-  class A {
-
-    int _someNumber;
-
-    A() {
-      _someNumber = 12;
-    }
-
-    /**
-     * Test for linking to parameter [A]
-     */
-    void doThis(int A) {
-      print(A);
-    }
-  }
-
-  main() {
-    A a = new A();
-    a.doThis(5);
-  }
-''';
-
-main() {
-  group('Generate docs for', () {
-    test('one simple file.', () {
-      var temporaryDir = Directory.systemTemp.createTempSync('single_library_');
-      var fileName = path.join(temporaryDir.path, 'temp.dart');
-      var file = new File(fileName);
-      file.writeAsStringSync(DART_LIBRARY);
-
-      return getMirrorSystem([new Uri.file(fileName)], false)
-        .then((mirrorSystem) {
-          var testLibraryUri = new Uri.file(path.absolute(fileName),
-                                            windows: Platform.isWindows);
-          var library = new Library(mirrorSystem.libraries[testLibraryUri]);
-          expect(library is Library, isTrue);
-
-          var classTypes = library.classes;
-          var classes = [];
-          classes.addAll(classTypes.values);
-          classes.addAll(library.errors.values);
-          expect(classes.every((e) => e is Class), isTrue);
-
-          expect(library.typedefs.values.every((e) => e is Typedef), isTrue);
-
-          var classMethodTypes = [];
-          classes.forEach((e) {
-            classMethodTypes.add(e.methods);
-            classMethodTypes.add(e.inheritedMethods);
-          });
-          expect(classMethodTypes.every((e) => e is Map<String, Method>), isTrue);
-
-          var classMethods = [];
-          classMethodTypes.forEach((e) {
-            classMethods.addAll(e.values);
-          });
-          expect(classMethods.every((e) => e is Method), isTrue);
-
-          var methodParameters = [];
-          classMethods.forEach((e) {
-            methodParameters.addAll(e.parameters.values);
-          });
-          expect(methodParameters.every((e) => e is Parameter), isTrue);
-
-          var functionTypes = library.functions;
-          expect(functionTypes is Map<String, Method>, isTrue);
-
-          var functions = [];
-          functions.addAll(functionTypes.values);
-          expect(functions.every((e) => e is Method), isTrue);
-
-          var functionParameters = [];
-          functions.forEach((e) {
-            functionParameters.addAll(e.parameters.values);
-          });
-          expect(functionParameters.every((e) => e is Parameter), isTrue);
-
-          var variables = library.variables.values;
-          expect(variables.every((e) => e is Variable), isTrue);
-
-          /// Testing fixReference
-          // Testing Doc comment for class [A].
-          var libraryMirror = mirrorSystem.libraries[testLibraryUri];
-          var classMirror =
-              dart2js_util.classesOf(libraryMirror.declarations).first;
-          var classDocComment = library.fixReference('A').children.first.text;
-          expect(classDocComment, 'test.A');
-
-          // Test for linking to parameter [A]
-          var method = getDocgenObject(
-              classMirror.declarations[dart2js_util.symbolOf('doThis')]);
-          var methodParameterDocComment = method.fixReference(
-              'A').children.first.text;
-          expect(methodParameterDocComment, 'test.A.doThis.A');
-
-          // Testing trying to refer to doThis function
-          var methodDocComment = method.fixReference(
-              'doThis').children.first.text;
-          expect(methodDocComment, 'test.A.doThis');
-
-          // Testing something with no reference
-          var libraryDocComment = method.fixReference('foobar').text;
-          expect(libraryDocComment, 'foobar');
-        }).whenComplete(() => temporaryDir.deleteSync(recursive: true));
-    });
-  });
-}
diff --git a/pkg/docgen/test/typedef_test.dart b/pkg/docgen/test/typedef_test.dart
deleted file mode 100644
index 7a1e217..0000000
--- a/pkg/docgen/test/typedef_test.dart
+++ /dev/null
@@ -1,105 +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 docgen.test.typedef;
-
-import 'dart:convert';
-import 'dart:io';
-
-import 'package:path/path.dart' as p;
-import 'package:scheduled_test/descriptor.dart' as d;
-import 'package:scheduled_test/scheduled_test.dart';
-
-import 'util.dart';
-import '../lib/docgen.dart' as dg;
-
-void main() {
-  setUp(() {
-    scheduleTempDir();
-  });
-
-  test('typedef gen', () {
-    schedule(() {
-      var codeDir = getMultiLibraryCodePath();
-      expect(FileSystemEntity.isDirectorySync(codeDir), isTrue);
-      return dg.docgen([codeDir], out: p.join(d.defaultRoot, 'docs'));
-    });
-
-    schedule(() {
-      var path = p.join(d.defaultRoot, 'docs', 'root_lib.json');
-      var rootLibJson = new File(path).readAsStringSync();
-
-      var rootLib = JSON.decode(rootLibJson) as Map<String, dynamic>;
-
-      //
-      // Validate function doc references
-      //
-      //var testMethod =
-      //    rootLib['functions']['methods']['testMethod'] as Map<String, dynamic>;
-
-      // test commented out
-      // TODO: figure out why test is failing after upgrade to markdown 0.7.2
-      // Expected: '<p>Processes an <a>root_lib.testMethod.input</a> of type <a>root_lib.C</a> instance for testing.</p>\n'
-      //  '<p>To eliminate import warnings for <a>root_lib.A</a> and to test typedefs.</p>\n'
-      //  '<p>It\'s important that the <a>dart:core</a>&lt;A> for param <a>root_lib.testMethod.listOfA</a> is not empty.</p>'
-      // Actual: '<p>Processes an <a>root_lib.testMethod.input</a> of type <a>root_lib.C</a> instance for testing.</p>\n'
-      //  '<p>To eliminate import warnings for <a>root_lib.A</a> and to test typedefs.</p>\n'
-      //  '<p>It\'s important that the List<A> for param <a>root_lib.testMethod.listOfA</a> is not empty.</p>'
-      //   Which: is different.
-      // Expected: ...  that the <a>dart:co ...
-      // Actual: ...  that the List<A> fo ...
-      //                     ^
-      // Differ at offset 210
-      //
-      // expect(testMethod['comment'], _TEST_METHOD_COMMENT);
-
-//      var classes = rootLib['classes'] as Map<String, dynamic>;
-//
-//      expect(classes, hasLength(3));
-//
-//      expect(classes['class'], isList);
-//      expect(classes['error'], isList);
-//
-//      var typeDefs = classes['typedef'] as Map<String, dynamic>;
-//      var comparator = typeDefs['testTypedef'] as Map<String, dynamic>;
-//
-//      expect(comparator['preview'], _TEST_TYPEDEF_PREVIEW);
-//
-//      expect(comparator['comment'], _TEST_TYPEDEF_COMMENT);
-    });
-
-    schedule(() {
-      var path = p.join(d.defaultRoot, 'docs', 'root_lib.RootClass.json');
-      var rootClassJson = new File(path).readAsStringSync();
-
-      var rootClass = JSON.decode(rootClassJson) as Map<String, dynamic>;
-
-      var defaultCtor = rootClass['methods']['constructors'][''] as Map;
-
-      expect(defaultCtor['qualifiedName'], 'root_lib.RootClass.RootClass-');
-    });
-  });
-}
-
-// TOOD: [List<A>] is not formatted correctly - issue 16771
-const _TEST_METHOD_COMMENT = '<p>Processes an '
-    '<a>root_lib.testMethod.input</a> of type <a>root_lib.C</a> '
-    'instance for testing.</p>\n<p>To eliminate import warnings for '
-    '<a>root_lib.A</a> and to test typedefs.</p>\n<p>It\'s important that the'
-    ' <a>dart:core</a>&lt;A> for param <a>root_lib.testMethod.listOfA</a> '
-    'is not empty.</p>';
-
-// TODO: [input] is not turned into a param refenece
-// TODO(kevmoo): <a>test_lib.C</a> should be <a>root_lib.C</a> - Issues 18352
-const _TEST_TYPEDEF_PREVIEW = '<p>Processes an input of type '
-    '<a>test_lib.C</a> instance for testing.</p>';
-
-// TOOD: [List<A>] is not formatted correctly - issue 16771
-// TODO: [listOfA] is not turned into a param reference
-// TODO(kevmoo): <a>test_lib.C</a> should be <a>root_lib.C</a> - Issues 18352
-final _TEST_TYPEDEF_COMMENT = _TEST_TYPEDEF_PREVIEW +
-    '\n<p>To eliminate import'
-    ' warnings for <a>test_lib.A</a> and to test typedefs.</p>\n<p>It\'s '
-    'important that the <a>dart:core</a>&lt;A> for param listOfA is not '
-    'empty.</p>';
diff --git a/pkg/docgen/test/util.dart b/pkg/docgen/test/util.dart
deleted file mode 100644
index 3f7f2ed..0000000
--- a/pkg/docgen/test/util.dart
+++ /dev/null
@@ -1,54 +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 docgen.test.util;
-
-import 'dart:convert';
-import 'dart:io';
-import 'package:path/path.dart' as p;
-import 'package:scheduled_test/descriptor.dart' as d;
-import 'package:scheduled_test/scheduled_test.dart';
-
-void scheduleTempDir() {
-  var tempDir;
-  schedule(() {
-    return Directory.systemTemp
-        .createTemp('docgen_test-')
-        .then((dir) {
-      tempDir = dir;
-      d.defaultRoot = tempDir.path;
-    });
-  });
-
-  currentSchedule.onComplete.schedule(() {
-    d.defaultRoot = null;
-    return tempDir.delete(recursive: true);
-  });
-}
-
-String getMultiLibraryCodePath() {
-  var currentScript = p.fromUri(Platform.script);
-  var codeDir = p.join(p.dirname(currentScript), 'multi_library_code');
-
-  assert(FileSystemEntity.isDirectorySync(codeDir));
-
-  return codeDir;
-}
-
-final Matcher hasSortedLines = predicate((String input) {
-  var lines = new LineSplitter().convert(input);
-
-  var sortedLines = new List.from(lines)..sort();
-
-  var orderedMatcher = orderedEquals(sortedLines);
-  return orderedMatcher.matches(lines, {});
-}, 'String has sorted lines');
-
-final Matcher isJsonMap = predicate((input) {
-  try {
-    return JSON.decode(input) is Map;
-  } catch (e) {
-    return false;
-  }
-}, 'Output is JSON encoded Map');
diff --git a/pkg/expect/lib/expect.dart b/pkg/expect/lib/expect.dart
index e7eb892..616920b 100644
--- a/pkg/expect/lib/expect.dart
+++ b/pkg/expect/lib/expect.dart
@@ -357,7 +357,7 @@
    *     Expect.throws(myThrowingFunction, (e) => e is MyException);
    */
   static void throws(void f(),
-                     [_CheckExceptionFn check = null,
+                     [bool check(exception) = null,
                       String reason = null]) {
     String msg = reason == null ? "" : "($reason)";
     if (f is! _Nullary) {
@@ -388,7 +388,6 @@
 
 bool _identical(a, b) => identical(a, b);
 
-typedef bool _CheckExceptionFn(exception);
 typedef _Nullary();  // Expect.throws argument must be this type.
 
 class ExpectException implements Exception {
diff --git a/pkg/js/AUTHORS b/pkg/js/AUTHORS
new file mode 100644
index 0000000..d773d3a
--- /dev/null
+++ b/pkg/js/AUTHORS
@@ -0,0 +1,8 @@
+# Below is a list of people and organizations that have contributed
+# to the Dart project. Names should be added to the list like so:
+#
+#   Name/Organization <email address>
+
+Google Inc.
+
+Alexandre Ardhuin <alexandre.ardhuin@gmail.com>
diff --git a/pkg/js/LICENSE b/pkg/js/LICENSE
new file mode 100644
index 0000000..abbb072
--- /dev/null
+++ b/pkg/js/LICENSE
@@ -0,0 +1,24 @@
+Copyright 2012, 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/js/PATENTS b/pkg/js/PATENTS
new file mode 100644
index 0000000..6954196
--- /dev/null
+++ b/pkg/js/PATENTS
@@ -0,0 +1,23 @@
+Additional IP Rights Grant (Patents)
+
+"This implementation" means the copyrightable works distributed by
+Google as part of the Dart Project.
+
+Google hereby grants to you a perpetual, worldwide, non-exclusive,
+no-charge, royalty-free, irrevocable (except as stated in this
+section) patent license to make, have made, use, offer to sell, sell,
+import, transfer, and otherwise run, modify and propagate the contents
+of this implementation of Dart, where such license applies only to
+those patent claims, both currently owned by Google and acquired in
+the future, licensable by Google that are necessarily infringed by
+this implementation of Dart. This grant does not include claims that
+would be infringed only as a consequence of further modification of
+this implementation. If you or your agent or exclusive licensee
+institute or order or agree to the institution of patent litigation
+against any entity (including a cross-claim or counterclaim in a
+lawsuit) alleging that this implementation of Dart or any code
+incorporated within this implementation of Dart constitutes direct or
+contributory patent infringement, or inducement of patent
+infringement, then any patent rights granted to you under this License
+for this implementation of Dart shall terminate as of the date such
+litigation is filed.
diff --git a/pkg/js/README.md b/pkg/js/README.md
new file mode 100644
index 0000000..d27b6eb
--- /dev/null
+++ b/pkg/js/README.md
@@ -0,0 +1,60 @@
+Dart-JavaScript Interop
+=======================
+
+Status
+------
+
+Version 0.6.0 is a complete rewrite of package:js 
+
+The package now only contains annotations specifying the shape of the
+JavaScript API to import into Dart.
+The core implementation is defined directly in Dart2Js, Dartium, and DDC.
+
+**Warning: support in Dartium and Dart2Js is still in progress.
+
+#### Example - TODO(jacobr)
+
+Configuration and Initialization
+--------------------------------
+
+### Adding the dependency
+
+Add the following to your `pubspec.yaml`:
+
+```yaml
+dependencies:
+  js: ">=0.6.0 <0.7.0"
+```
+
+##### main.html
+
+```html
+<html>
+  <head>
+  </head>
+  <body>
+    <script type="application/dart" src="main.dart"></script>
+  </body>
+</html>
+```
+
+##### main.dart
+
+TODO(jacobr): example under construction.
+```dart
+library main;
+
+import 'package:js/js.dart';
+
+main() {
+}
+```
+
+Contributing and Filing Bugs
+----------------------------
+
+Please file bugs and features requests on the Github issue tracker: https://github.com/dart-lang/js-interop/issues
+
+We also love and accept community contributions, from API suggestions to pull requests. Please file an issue before beginning work so we can discuss the design and implementation. We are trying to create issues for all current and future work, so if something there intrigues you (or you need it!) join in on the discussion.
+
+All we require is that you sign the Google Individual Contributor License Agreement https://developers.google.com/open-source/cla/individual?csw=1
diff --git a/pkg/js/lib/js.dart b/pkg/js/lib/js.dart
new file mode 100644
index 0000000..17b1ded
--- /dev/null
+++ b/pkg/js/lib/js.dart
@@ -0,0 +1,32 @@
+// 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.
+
+/// Allows interoperability with Javascript APIs.
+library js;
+
+export 'dart:js' show allowInterop, allowInteropCaptureThis;
+
+/// A metadata annotation that indicates that a Library, Class, or member is
+/// implemented directly in JavaScript. All external members of a class or
+/// library with this annotation implicitly have it as well.
+///
+/// Specifying [name] customizes the JavaScript name to use. By default the
+/// dart name is used. It is not valid to specify a custom [name] for class
+/// instance members.
+class JS {
+  final String name;
+  const JS([this.name]);
+}
+
+class _Anonymous {
+  const _Anonymous();
+}
+
+/// A metadata annotation that indicates that a @JS annotated class is
+/// structural and does not have a known JavaScript prototype.
+///
+/// Factory constructors for anonymous JavaScript classes desugar to creating
+/// JavaScript object literals with name-value pairs corresponding to the
+/// parameter names and values.
+const _Anonymous anonymous = const _Anonymous();
diff --git a/pkg/js/pubspec.yaml b/pkg/js/pubspec.yaml
new file mode 100644
index 0000000..d558126
--- /dev/null
+++ b/pkg/js/pubspec.yaml
@@ -0,0 +1,9 @@
+name: js
+version: 0.6.0-dev.1
+authors:
+- Dart Team <misc@dartlang.org>
+- Alexandre Ardhuin <alexandre.ardhuin@gmail.com>
+description: Access JavaScript from Dart.
+homepage: https://github.com/dart-lang/js-interop
+environment:
+  sdk: '>=1.13.0-dev <2.0.0'
diff --git a/pkg/js_ast/lib/src/printer.dart b/pkg/js_ast/lib/src/printer.dart
index 8523916..7a1124f 100644
--- a/pkg/js_ast/lib/src/printer.dart
+++ b/pkg/js_ast/lib/src/printer.dart
@@ -136,7 +136,7 @@
 
   int get lastCharCode {
     if (lastAddedString == null) return 0;
-    assert(lastAddedString.length != "");
+    assert(lastAddedString.length != 0);
     return lastAddedString.codeUnitAt(lastAddedString.length - 1);
   }
 
diff --git a/pkg/js_ast/lib/src/template.dart b/pkg/js_ast/lib/src/template.dart
index 632f273..34ad972 100644
--- a/pkg/js_ast/lib/src/template.dart
+++ b/pkg/js_ast/lib/src/template.dart
@@ -765,7 +765,6 @@
     int before = count;
     node.visitChildren(this);
     if (count != before) containsInterpolatedNode.add(node);
-    return null;
   }
 
   visitInterpolatedNode(InterpolatedNode node) {
diff --git a/pkg/js_ast/test/printer_callback_test.dart b/pkg/js_ast/test/printer_callback_test.dart
index dbd248b..7e14110 100644
--- a/pkg/js_ast/test/printer_callback_test.dart
+++ b/pkg/js_ast/test/printer_callback_test.dart
@@ -161,11 +161,11 @@
   }),
 
   const TestCase(const {
-    TestMode.INPUT: "a.#nameTemplate",
-    TestMode.NONE: "a.nameValue",
-    TestMode.ENTER: "@0@1a.@2nameValue",
-    TestMode.DELIMITER: "a.nameValue",
-    TestMode.EXIT: "a@1.nameValue@2@0",
+    TestMode.INPUT: "a.#nameTemplate = #nameTemplate",
+    TestMode.NONE: "a.nameValue = nameValue",
+    TestMode.ENTER: "@0@1@2a.@3nameValue = @3nameValue",
+    TestMode.DELIMITER: "a.nameValue = nameValue",
+    TestMode.EXIT: "a@2.nameValue@3@1 = nameValue@3@0",
   }, const {'nameTemplate': 'nameValue'}),
 ];
 
diff --git a/pkg/lookup_map/AUTHORS b/pkg/lookup_map/AUTHORS
new file mode 100644
index 0000000..e8063a8
--- /dev/null
+++ b/pkg/lookup_map/AUTHORS
@@ -0,0 +1,6 @@
+# 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.
diff --git a/pkg/lookup_map/CHANGELOG.md b/pkg/lookup_map/CHANGELOG.md
new file mode 100644
index 0000000..beb0eb0
--- /dev/null
+++ b/pkg/lookup_map/CHANGELOG.md
@@ -0,0 +1,7 @@
+# Changelog
+
+## 0.0.1+1
+- Fix minor typo in readme.
+
+## 0.0.1
+- Initial version of `LookupMap`
diff --git a/pkg/lookup_map/LICENSE b/pkg/lookup_map/LICENSE
new file mode 100644
index 0000000..de31e1a
--- /dev/null
+++ b/pkg/lookup_map/LICENSE
@@ -0,0 +1,26 @@
+Copyright 2015, 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/lookup_map/README.md b/pkg/lookup_map/README.md
new file mode 100644
index 0000000..a333791
--- /dev/null
+++ b/pkg/lookup_map/README.md
@@ -0,0 +1,31 @@
+# Lookup maps
+
+This package contains the definition of `LookupMap`: a simple, but very
+restricted map. The map can only hold constant keys and the only way to use the
+map is to retrieve values with a key you already have.  Except for lookup, any
+other operation in `Map` (like forEach, keys, values, length, etc) is not
+available.
+
+Constant `LookupMap`s are understood by dart2js and can be tree-shaken
+internally: if a key is not used elsewhere in the program, its entry can be
+deleted from the map during compilation without changing the program's behavior.
+Currently dart2js supports tree-shaking keys that are Type literals, and any
+const expression that can only be created with a const constructor. This means
+that primitives, Strings, and constant objects that override the `==` operator
+cannot be tree-shaken.
+
+**Note**: this feature is currently experimental in dart2js, we recommend trying
+other alternatives before relying on this feature.
+
+## Examples
+
+`LookupMap` is unlikely going to be useful for individual developers writing
+code by hand. It is mainly intended as a helper utility for frameworks that need
+to autogenerate data and associate it with a type in the program. For example,
+this can be used by a dependency injection system to record how to create
+instances of a given type. A dependency injection framework can store in a
+`LookupMap` all the information it needs for every injectable type in every
+library and package.  When compiling a specific application, dart2js can
+tree-shake the data of types that are not used by the application. Similarly,
+this can also be used by serialization/deserialization packages that can store
+in a `LookupMap` the deserialization logic for a given type.
diff --git a/pkg/lookup_map/lib/lookup_map.dart b/pkg/lookup_map/lib/lookup_map.dart
new file mode 100644
index 0000000..65ac754
--- /dev/null
+++ b/pkg/lookup_map/lib/lookup_map.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.
+
+/// Defines [LookupMap], a simple map that can be optimized by dart2js.
+library lookup_map;
+
+/// [LookupMap] is a simple, but very restricted map.  The map can only hold
+/// constant keys and the only way to use the map is to retrieve values with a
+/// key you already have.  Except for lookup, any other operation in [Map] (like
+/// forEach, keys, values, length, etc) is not available.
+///
+/// Constant [LookupMap]s are understood by dart2js and can be tree-shaken
+/// internally: if a key is not used elsewhere in the program, its entry can be
+/// deleted from the map during compilation without changing the program's
+/// behavior. Currently dart2js supports tree-shaking keys that are `Type`
+/// literals, and any const expression that can only be created with a const
+/// constructor. This means that primitives, Strings, and constant objects that
+/// override the `==` operator cannot be tree-shaken.
+///
+/// Note: [LookupMap] is unlikely going to be useful for individual developers
+/// writing code by hand. It is mainly intended as a helper utility for
+/// frameworks that need to autogenerate data and associate it with a type in
+/// the program. For example, this can be used by a dependency injection system
+/// to record how to create instances of a given type. A dependency injection
+/// framework can store in a [LookupMap] all the information it needs for every
+/// injectable type in every library and package.  When compiling a specific
+/// application, dart2js can tree-shake the data of types that are not used by
+/// the application. Similarly, this can also be used by
+/// serialization/deserialization packages that can store in a [LookupMap] the
+/// deserialization logic for a given type.
+class LookupMap<K, V> {
+  /// The key for [LookupMap]s with a single key/value pair.
+  final K _key;
+
+  /// The value for [LookupMap]s with a single key/value pair.
+  final V _value;
+
+  /// List of alternating key-value pairs in the map.
+  final List _entries;
+
+  /// Other maps to which this map delegates lookup operations if the key is not
+  /// found on [entries]. See [LookupMap]'s constructor for details.
+  final List<LookupMap<K, V>> _nestedMaps;
+
+  /// Creates a lookup-map given a list of key-value pair [entries], and
+  /// optionally additional entries from other [LookupMap]s.
+  ///
+  /// When doing a lookup, if the key is not found on [entries]. The lookup will
+  /// be performed in reverse order of the list of [nestedMaps], so a later
+  /// entry for a key shadows previous entries.  For example, in:
+  ///
+  ///     const map = const LookupMap(const [A, 1],
+  ///         const [const LookupMap(const [A, 2, B, 4]),
+  ///                const LookupMap(const [A, 3, B, 5]));
+  ///
+  /// `map[A]` returns `1` and `map[B]` returns `5`.
+  ///
+  /// Note: in the future we expect to change [entries] to be a const map
+  /// instead of a list of key-value pairs.
+  // TODO(sigmund): make entries a map once we fix TypeImpl.== (issue #17207).
+  const LookupMap(List entries, [List<LookupMap<K, V>> nestedMaps = const []])
+    : _key = null, _value = null, _entries = entries, _nestedMaps = nestedMaps;
+
+  /// Creates a lookup map with a single key-value pair.
+  const LookupMap.pair(K key, V value)
+    : _key = key, _value = value, _entries = const [], _nestedMaps = const [];
+
+  /// Return the data corresponding to [key].
+  V operator[](K key) {
+    var map = _flatMap[this];
+    if (map == null) {
+      map = {};
+      _addEntriesTo(map);
+      _flatMap[this] = map;
+    }
+    return map[key];
+  }
+
+  /// Add to [map] entries from [nestedMaps] and from [entries] according to the
+  /// precedense order described in [nestedMaps].
+  _addEntriesTo(Map map) {
+    _nestedMaps.forEach((m) => m._addEntriesTo(map));
+    for (var i = 0; i < _entries.length; i += 2) {
+      map[_entries[i]] = _entries[i + 1];
+    }
+    if (_key != null) map[_key] = _value;
+  }
+}
+
+/// An expando that stores a flatten version of a [LookupMap], this is
+/// computed and stored the first time the map is accessed.
+final _flatMap = new Expando('_flat_map');
+
+/// Internal constant that matches the version in the pubspec. This is used by
+/// dart2js to ensure that optimizations are only enabled on known versions of
+/// this code.
+// Note: this needs to be kept in sync with the pubspec, otherwise
+// test/version_check_test would fail.
+final _version = '0.0.1+1';
diff --git a/pkg/lookup_map/pubspec.yaml b/pkg/lookup_map/pubspec.yaml
new file mode 100644
index 0000000..adaee09e
--- /dev/null
+++ b/pkg/lookup_map/pubspec.yaml
@@ -0,0 +1,10 @@
+name: lookup_map
+description: a lookup-only map that can be tree-shaken by dart2js
+# Note: the version needs to be kept in sync with the string in
+# lib/lookup_map.dart, otherwise test/version_check_test would fail.
+version: 0.0.1+1
+author: "Dart Team <misc@dartlang.org>"
+homepage: https://github.com/dart-lang/sdk/blob/master/pkg/lookup_map/README.md
+dev_dependencies:
+  test: ^0.12.3+8
+  yaml: ^2.1.2
diff --git a/pkg/lookup_map/test/lookup_map_test.dart b/pkg/lookup_map/test/lookup_map_test.dart
new file mode 100644
index 0000000..ce001dd
--- /dev/null
+++ b/pkg/lookup_map/test/lookup_map_test.dart
@@ -0,0 +1,74 @@
+// 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 'package:lookup_map/lookup_map.dart';
+
+import 'package:test/test.dart';
+
+class Key {
+  final int id;
+  const Key(this.id);
+}
+
+class A{}
+const B = const Key(1);
+class C{}
+
+main() {
+  test('entries constructor', () {
+    var m = const LookupMap(const [
+        A, "the-text-for-A",
+        B, "the-text-for-B",
+        1.2, "the-text-for-1.2"]);
+    expect(m[A], 'the-text-for-A');
+    expect(m[B], 'the-text-for-B');
+    expect(m[1.2], 'the-text-for-1.2');
+    expect(m[C], null);
+    expect(m[1.3], null);
+  });
+
+  test('pair constructor', () {
+    var m = const LookupMap.pair(A, "the-text-for-A");
+    expect(m[A], 'the-text-for-A');
+    expect(m[B], null);
+  });
+
+  test('nested lookup', () {
+    var m = const LookupMap(const [],
+        const [const LookupMap.pair(A, "the-text-for-A")]);
+    expect(m[A], 'the-text-for-A');
+    expect(m[B], null);
+  });
+
+  test('entry shadows nested maps', () {
+    var m = const LookupMap(const [
+      A, "the-text-for-A2",
+    ], const [
+      const LookupMap.pair(A, "the-text-for-A1"),
+    ]);
+    expect(m[A], 'the-text-for-A2');
+  });
+
+  test('nested maps shadow in order', () {
+    var m = const LookupMap(const [ ], const [
+      const LookupMap.pair(A, "the-text-for-A1"),
+      const LookupMap.pair(B, "the-text-for-B2"),
+      const LookupMap.pair(A, "the-text-for-A2"),
+      const LookupMap.pair(B, "the-text-for-B1"),
+    ]);
+    expect(m[A], 'the-text-for-A2');
+    expect(m[B], 'the-text-for-B1');
+  });
+
+  // This test would fail if dart2js has a bug, but we keep it here for our
+  // sanity.
+  test('reachable lookups are not tree-shaken', () {
+    var m = const LookupMap(const [
+      A, B,
+      B, C,
+      C, 3.4,
+    ]);
+    expect(m[m[m[A]]], 3.4);
+  });
+}
diff --git a/pkg/lookup_map/test/version_check_test.dart b/pkg/lookup_map/test/version_check_test.dart
new file mode 100644
index 0000000..2bee1a6
--- /dev/null
+++ b/pkg/lookup_map/test/version_check_test.dart
@@ -0,0 +1,21 @@
+// 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:io';
+import 'dart:mirrors';
+import 'package:lookup_map/lookup_map.dart'; // accessed via mirrors;
+import 'package:test/test.dart';
+import 'package:yaml/yaml.dart';
+
+/// This dartdoc helps remove a warning for the unused import on [LookupMap].
+main() {
+  test('validate version number matches', () {
+    var pubspec = Platform.script.resolve('../pubspec.yaml');
+    var yaml = loadYaml(new File.fromUri(pubspec).readAsStringSync());
+    var version1 = yaml['version'];
+    var library = currentMirrorSystem().findLibrary(#lookup_map);
+    var version2 = library.getField(new Symbol('_version')).reflectee;
+    expect(version1, version2);
+  });
+}
diff --git a/pkg/package_test_data/lib/resources/sample.txt b/pkg/package_test_data/lib/resources/sample.txt
new file mode 100644
index 0000000..94ad275
--- /dev/null
+++ b/pkg/package_test_data/lib/resources/sample.txt
@@ -0,0 +1 @@
+Sample text file.
diff --git a/pkg/package_test_data/pubspec.yaml b/pkg/package_test_data/pubspec.yaml
new file mode 100644
index 0000000..8585f51
--- /dev/null
+++ b/pkg/package_test_data/pubspec.yaml
@@ -0,0 +1,7 @@
+name: package_test_data
+version: 0.0.1
+author: "Dart Team <misc@dartlang.org>"
+publish_to: "none"
+description: >
+ Contains data used by platform tests using package: URIs.
+ Should *not* be published.
diff --git a/pkg/pkg.status b/pkg/pkg.status
index e98d307..e9c99b2 100644
--- a/pkg/pkg.status
+++ b/pkg/pkg.status
@@ -14,12 +14,10 @@
 # Analyzer2dart is not maintained anymore.
 analyzer2dart/test/*: Skip
 
-[ $compiler != dartanalyzer && $compiler != dart2analyzer ]
-docgen/test/inherited_comments_test: Fail # issue 22233
-
 [ $compiler == none && ($runtime == drt || $runtime == dartium || $runtime == ContentShellOnAndroid) ]
 mutation_observer: Skip # Issue 21149
 unittest/*: Skip # Issue 21949
+lookup_map/*: SkipByDesign
 
 [ $runtime == vm && $mode == debug]
 analysis_server/test/analysis_server_test: SkipSlow  # Times out
@@ -30,7 +28,6 @@
 analysis_server/tool/spec/check_all_test: SkipSlow # Times out
 analyzer/test/generated/element_test: SkipSlow  # Times out
 analyzer/test/generated/parser_test: SkipSlow  # Times out
-docgen/test/*: SkipSlow
 
 [ $runtime == vm && $system == windows]
 analysis_server/test/analysis/get_errors_test: Skip # runtime error, Issue 22180
@@ -42,7 +39,6 @@
 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
-docgen/test/*: SkipSlow # Far too slow
 typed_data/test/typed_buffers_test/01: Fail # Not supporting Int64List, Uint64List.
 analyzer/test/generated/engine_test: SkipSlow
 analyzer/test/generated/static_type_warning_code_test: Pass, Slow
@@ -75,23 +71,39 @@
 analysis_server/index/store/codec_test: Pass, Slow # Issue 19756
 
 [ $compiler == dart2js ]
-analysis_server/test/edit/refactoring_test: Pass, Slow # Issue 19756, 21628
+analysis_server/test/analysis_notification_highlights_test: Pass, Slow # 19756, 21628
+analysis_server/test/analysis_notification_navigation_test: Pass, Slow # Issue 19756, 21628
 analysis_server/test/analysis_notification_occurrences_test: Pass, Slow # Issue 19756, 21628
 analysis_server/test/analysis_notification_outline_test: Pass, Slow # Issue 19756, 21628
-analysis_server/test/analysis_notification_navigation_test: Pass, Slow # Issue 19756, 21628
 analysis_server/test/domain_analysis_test: Pass, Slow # Issue 19756, 21628
-analysis_server/test/analysis_notification_highlights_test: Pass, Slow # 19756, 21628
+analysis_server/test/edit/refactoring_test: Pass, Slow # Issue 19756, 21628
 analysis_server/test/search/top_level_declarations_test: Pass, Slow # 19756, 21628
 analysis_server/test/socket_server_test: Pass, Slow # Issue 19756, 21628
 analyzer/test/generated/all_the_rest_test: Pass, Slow # Issue 21628
+analyzer/test/generated/ast_test: Pass, Slow # Issue 21628
+analyzer/test/generated/compile_time_error_code_test: Pass, Slow # Issue 21628
 analyzer/test/generated/element_test: Pass, Slow # Issue 21628
 analyzer/test/generated/incremental_resolver_test: Pass, Slow # Issue 21628
-analyzer/test/generated/utilities_test: Pass, Slow # Issue 21628
+analyzer/test/generated/incremental_scanner_test: Pass, Slow # Issue 21628
+analyzer/test/generated/non_error_resolver_test: Pass, Slow # Issue 21628
 analyzer/test/generated/parser_test: Pass, Slow # Issue 21628
+analyzer/test/generated/resolver_test: Pass, Slow # Issue 21628
 analyzer/test/generated/scanner_test: Pass, Slow # Issue 21628
-analyzer/test/src/task/dart_test: Pass, Slow # Issue 21628
-analyzer/test/src/task/driver_test: Pass, Slow # Issue 21628
+analyzer/test/generated/source_factory_test: Pass, Slow # Issue 21628
+analyzer/test/generated/static_type_warning_code_test: Pass, Slow # Issue 21628
+analyzer/test/generated/static_warning_code_test: Pass, Slow # Issue 21628
+analyzer/test/generated/utilities_test: Pass, Slow # Issue 21628
 analyzer/test/src/context/cache_test: Pass, Slow # Issue 21628
+analyzer/test/src/task/dart_test: Pass, Slow # Issue 21628
+analyzer/test/src/task/dart_work_manager_test: Pass, Slow # Issue 21628
+analyzer/test/src/task/driver_test: Pass, Slow # Issue 21628
+analyzer/test/src/task/general_test: Pass, Slow # Issue 21628
+analyzer/test/src/task/html_work_manager_test: Pass, Slow # Issue 21628
+analyzer/test/src/task/incremental_element_builder_test: Pass, Slow # Issue 21628
+analyzer/test/src/task/inputs_test: Pass, Slow # Issue 21628
+analyzer/test/src/task/manager_test: Pass, Slow # Issue 21628
+analyzer/test/src/task/model_test: Pass, Slow # Issue 21628
+lookup_map/test/version_check_test: SkipByDesign # Only meant to run in vm.
 
 [ $runtime == jsshell ]
 async/test/stream_zip_test: RuntimeError, OK # Timers are not supported.
@@ -131,8 +143,8 @@
 analysis_server/test/*: SkipByDesign # Uses dart:io.
 analysis_server/tool/spec/check_all_test: SkipByDesign # Uses dart:io.
 analyzer/test/*: SkipByDesign # Uses dart:io.
+analyzer/tool/task_dependency_graph/check_test: SkipByDesign # Uses dart:io.
 analyzer2dart/*: SkipByDesign # Uses dart:io.
-docgen/test/*: SkipByDesign # Uses dart:io.
 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.
@@ -153,9 +165,36 @@
 analyzer/test/*: PubGetError
 
 [ $compiler == dart2js && $cps_ir ]
-analyzer/test/cancelable_future_test: Crash # Invalid argument(s)
-analyzer/test/enum_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-analyzer/test/file_system/physical_resource_provider_test: Crash # (Future _poll()async...  cannot handle async/sync*/async* functions
-analyzer/test/generated/all_the_rest_test: Crash # (Future test_implici...  cannot handle async/sync*/async* functions
-analyzer/test/src/context/context_test: Crash # Invalid argument(s)
-typed_data/test/typed_buffers_test/none: RuntimeError # Please triage this failure.
+lookup_map/test/lookup_map_test: RuntimeError # $async$temp1.get$tests is not a function
+
+[ $compiler == dart2js && $cps_ir && $host_checked ]
+analyzer/test/enum_test: Crash # Issue 24485
+analyzer/test/generated/all_the_rest_test: Crash # Issue 24485
+analyzer/test/generated/ast_test: Crash # Issue 24485
+analyzer/test/generated/compile_time_error_code_test: Crash # Issue 24485
+analyzer/test/generated/element_test: Crash # Issue 24485
+analyzer/test/generated/incremental_resolver_test: Crash # Issue 24485
+analyzer/test/generated/incremental_scanner_test: Crash # Issue 24485
+analyzer/test/generated/non_error_resolver_test: Crash # Issue 24485
+analyzer/test/generated/parser_test: Crash # Issue 24485
+analyzer/test/generated/resolver_test: Crash # Issue 24485
+analyzer/test/generated/scanner_test: Crash # Issue 24485
+analyzer/test/generated/source_factory_test: Crash # Issue 24485
+analyzer/test/generated/static_type_warning_code_test: Crash # Issue 24485
+analyzer/test/generated/static_warning_code_test: Crash # Issue 24485
+analyzer/test/generated/utilities_test: Crash # Issue 24485
+analyzer/test/src/context/cache_test: Crash # Issue 24485
+analyzer/test/src/context/context_test: Crash # Issue 24485
+analyzer/test/src/task/dart_test: Crash # Issue 24485
+analyzer/test/src/task/dart_work_manager_test: Crash # Issue 24485
+analyzer/test/src/task/driver_test: Crash # Issue 24485
+analyzer/test/src/task/general_test: Crash # Issue 24485
+analyzer/test/src/task/html_test: Crash # Issue 24485
+analyzer/test/src/task/html_work_manager_test: Crash # Issue 24485
+analyzer/test/src/task/incremental_element_builder_test: Crash # Issue 24485
+analyzer/test/src/task/inputs_test: Crash # Issue 24485
+analyzer/test/src/task/manager_test: Crash # Issue 24485
+analyzer/test/src/task/model_test: Crash # Issue 24485
+analyzer/test/src/task/strong/checker_test: Crash # t: Failed assertion: line 88 pos 12: '!variable2index.containsKey(element)' is not true.
+analyzer/test/src/task/strong/inferred_type_test: Crash # t: Failed assertion: line 88 pos 12: '!variable2index.containsKey(element)' is not true.
+analyzer/test/src/task/strong_mode_test: Crash # Issue 24485
diff --git a/pkg/pkgbuild.status b/pkg/pkgbuild.status
index 3cf95f1..2404f3e 100644
--- a/pkg/pkgbuild.status
+++ b/pkg/pkgbuild.status
@@ -4,7 +4,6 @@
 
 samples/third_party/dromaeo: Pass, Slow
 samples/searchable_list: Pass, Slow
-pkg/docgen: Pass, Slow
 
 [ $use_repository_packages ]
 pkg/analyzer: PubGetError
diff --git a/runtime/BUILD.gn b/runtime/BUILD.gn
index e9c339a..cbc0643 100644
--- a/runtime/BUILD.gn
+++ b/runtime/BUILD.gn
@@ -13,6 +13,12 @@
   dart_debug = false
 }
 
+config("dart_public_config") {
+  include_dirs = [
+    ".",
+  ]
+}
+
 config("dart_config") {
   defines = []
   if (dart_debug) {
@@ -66,6 +72,7 @@
   include_dirs = [
     ".",
   ]
+  public_configs = [":dart_public_config"]
   sources = [
     "include/dart_api.h",
     "include/dart_mirrors_api.h",
diff --git a/runtime/bin/BUILD.gn b/runtime/bin/BUILD.gn
index bbc4d3e..1185ee4 100644
--- a/runtime/bin/BUILD.gn
+++ b/runtime/bin/BUILD.gn
@@ -175,7 +175,7 @@
 }
 
 
-static_library("libdart_embedder_noio") {
+source_set("libdart_embedder_noio") {
   configs += ["..:dart_config",]
   deps = [
     "..:libdart",
@@ -205,6 +205,8 @@
     "*secure_socket.h",
     "*filter_unsupported.cc",
     "*io_service_unsupported.cc",
+    "*io_service.cc",
+    "*io_service.h",
     "*_test.cc",
     "*_test.h",
     "*dbg*",
diff --git a/runtime/bin/bin.gypi b/runtime/bin/bin.gypi
index 00c9f69..1777513 100644
--- a/runtime/bin/bin.gypi
+++ b/runtime/bin/bin.gypi
@@ -13,6 +13,7 @@
     'snapshot_in_cc_file': 'snapshot_in.cc',
     'vm_isolate_snapshot_bin_file': '<(gen_source_dir)/vm_isolate_snapshot_gen.bin',
     'isolate_snapshot_bin_file': '<(gen_source_dir)/isolate_snapshot_gen.bin',
+    'gen_snapshot_stamp_file': '<(gen_source_dir)/gen_snapshot.stamp',
     'resources_cc_file': '<(gen_source_dir)/resources_gen.cc',
     'bootstrap_resources_cc_file':
         '<(gen_source_dir)/bootstrap_resources_gen.cc',
@@ -136,6 +137,9 @@
         'log_macos.cc',
         'log_win.cc',
       ],
+      'defines': [
+        'LEGACY_DEBUG_PROTOCOL_ENABLED',
+      ],
       'includes': [
         'builtin_impl_sources.gypi',
         '../platform/platform_sources.gypi',
@@ -224,7 +228,7 @@
       'conditions': [
         ['dart_io_support==1 and dart_io_secure_socket==1', {
           'dependencies': [
-            'bin/net/ssl.gyp:libssl_dart',
+          '../third_party/boringssl/boringssl_dart.gyp:boringssl',
           ],
         }],
         ['dart_io_secure_socket==0', {
@@ -292,14 +296,14 @@
         'io_natives.cc',
       ],
       'conditions': [
-        ['dart_io_support==1 and dart_io_secure_socket==1', {
+        ['dart_io_support==1', {
           'dependencies': [
-            'bin/net/ssl.gyp:libssl_dart',
+            'bin/zlib.gyp:zlib_dart',
           ],
         }],
-        ['dart_io_support==1 and dart_io_secure_socket==0', {
+        ['dart_io_support==1 and dart_io_secure_socket==1', {
           'dependencies': [
-            'bin/net/zlib.gyp:zlib_dart',
+            '../third_party/boringssl/boringssl_dart.gyp:boringssl',
           ],
         }],
         ['dart_io_secure_socket==0', {
@@ -333,19 +337,6 @@
           },
         }],
       ],
-      'configurations': {
-        'Dart_Android_Base': {
-          'target_conditions': [
-            ['_toolset=="target"', {
-              'defines': [
-                # Needed for sources outside of nss that include pr and ssl
-                # header files.
-                'MDCPUCFG="md/_linux.cfg"',
-              ],
-            }],
-          ],
-        },
-      },
     },
     {
       'target_name': 'libdart_nosnapshot',
@@ -433,8 +424,7 @@
             '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)gen_snapshot<(EXECUTABLE_SUFFIX)',
           ],
           'outputs': [
-            '<(vm_isolate_snapshot_bin_file)',
-            '<(isolate_snapshot_bin_file)',
+            '<(gen_snapshot_stamp_file)',
           ],
           'action': [
             'python',
@@ -443,7 +433,8 @@
             '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)gen_snapshot<(EXECUTABLE_SUFFIX)',
             '--vm_output_bin', '<(vm_isolate_snapshot_bin_file)',
             '--output_bin', '<(isolate_snapshot_bin_file)',
-            '--target_os', '<(OS)'
+            '--target_os', '<(OS)',
+            '--timestamp_file', '<(gen_snapshot_stamp_file)',
           ],
           'message': 'Generating ''<(vm_isolate_snapshot_bin_file)'' ''<(isolate_snapshot_bin_file)'' files.'
         },
@@ -462,9 +453,8 @@
           'action_name': 'generate_snapshot_file',
           'inputs': [
             '../tools/create_snapshot_file.py',
+            '<(gen_snapshot_stamp_file)',
             '<(snapshot_in_cc_file)',
-            '<(vm_isolate_snapshot_bin_file)',
-            '<(isolate_snapshot_bin_file)',
           ],
           'outputs': [
             '<(snapshot_cc_file)',
@@ -750,6 +740,7 @@
         '../vm/vm_sources.gypi',
       ],
       'defines': [
+        'LEGACY_DEBUG_PROTOCOL_ENABLED',
         'TESTING',
       ],
       # Only include _test.[cc|h] files.
@@ -768,6 +759,15 @@
           },
         }],
       ],
+      'configurations': {
+        'Dart_Linux_Base': {
+          # Have the linker add all symbols to the dynamic symbol table
+          # so that extensions can look them up dynamically in the binary.
+          'ldflags': [
+            '-rdynamic',
+          ],
+        },
+      },
     },
     {
       'target_name': 'test_extension',
diff --git a/runtime/bin/builtin.dart b/runtime/bin/builtin.dart
index feb26a9..d6d945e 100644
--- a/runtime/bin/builtin.dart
+++ b/runtime/bin/builtin.dart
@@ -71,8 +71,7 @@
 SendPort _loadPort;
 // The receive port for a load request. Multiple sources can be fetched in
 // a single load request.
-RawReceivePort _receivePort;
-SendPort _sendPort;
+RawReceivePort _dataPort;
 // A request id valid only for the current load cycle (while the number of
 // outstanding load requests is greater than 0). Can be reset when loading is
 // completed.
@@ -125,17 +124,16 @@
 
 // Class collecting all of the information about a particular load request.
 class _LoadRequest {
-  final int _id;
+  final int _id = _reqId++;
   final int _tag;
   final String _uri;
   final Uri _resourceUri;
   final _context;
 
-  _LoadRequest(this._id,
-               this._tag,
-               this._uri,
-               this._resourceUri,
-               this._context);
+  _LoadRequest(this._tag, this._uri, this._resourceUri, this._context) {
+    assert(_reqMap[_id] == null);
+    _reqMap[_id] = this;
+  }
 
   toString() => "LoadRequest($_id, $_tag, $_uri, $_resourceUri, $_context)";
 }
@@ -320,13 +318,13 @@
     }
   }
 
-  if (!_pendingLoads()) {
+  if (!_pendingLoads() && (_dataPort != null)) {
+    // Close the _dataPort now that there are no more requests outstanding.
     if (_traceLoading) {
       _log("Closing loading port.");
     }
-    _receivePort.close();
-    _receivePort = null;
-    _sendPort = null;
+    _dataPort.close();
+    _dataPort = null;
     _reqId = 0;
     _signalDoneLoading();
   }
@@ -367,33 +365,26 @@
 
 
 void _startLoadRequest(int tag, String uri, Uri resourceUri, context) {
-  if (_receivePort == null) {
+  if (_dataPort == null) {
     if (_traceLoading) {
       _log("Initializing load port.");
     }
-    assert(_receivePort == null);
-    assert(_sendPort == null);
-    _receivePort = new RawReceivePort(_handleLoaderReply);
-    _sendPort = _receivePort.sendPort;
+    assert(_dataPort == null);
+    _dataPort = new RawReceivePort(_handleLoaderReply);
   }
   // Register the load request and send it to the VM service isolate.
-  var curId = _reqId++;
+  var req = new _LoadRequest(tag, uri, resourceUri, context);
 
-  assert(_reqMap[curId] == null);
-  _reqMap[curId] = new _LoadRequest(curId, tag, uri, resourceUri, context);
-
-  assert(_receivePort != null);
-  assert(_sendPort != null);
-
+  assert(_dataPort != null);
   var msg = new List(4);
-  msg[0] = _sendPort;
+  msg[0] = _dataPort.sendPort;
   msg[1] = _traceLoading;
-  msg[2] = curId;
+  msg[2] = req._id;
   msg[3] = resourceUri.toString();
   _loadPort.send(msg);
 
   if (_traceLoading) {
-    _log("Loading of $resourceUri for $uri started with id: $curId. "
+    _log("Loading of $resourceUri for $uri started with id: ${req._id}. "
          "${_reqMap.length} requests remaining, "
          "${_pendingPackageLoads.length} packages pending.");
   }
@@ -434,17 +425,10 @@
 
   // Resolve all pending package loads now that we know how to resolve them.
   while (_pendingPackageLoads.length > 0) {
+    // Order does not matter as we queue all of the requests up right now.
     var req = _pendingPackageLoads.removeLast();
-    if (req != null) {
-      if (_traceLoading) {
-        _log("Handling deferred load request: $req");
-      }
-      _loadPackage(req._tag, req._uri, req._resourceUri, req._context);
-    } else {
-      if (_traceLoading) {
-        _log("Skipping dummy deferred request.");
-      }
-    }
+    // Call the registered closure, to handle the delayed action.
+    req();
   }
   // Reset the pending package loads to empty. So that we eventually can
   // finish loading.
@@ -516,7 +500,13 @@
 
   // Signal that the resolution of the packages map has started. But in this
   // case it is not tied to a particular request.
-  _pendingPackageLoads.add(null);
+  _pendingPackageLoads.add(() {
+    // Nothing to be done beyond registering that there is pending package
+    // resolution requested by having an empty entry.
+    if (_traceLoading) {
+      _log("Skipping dummy deferred request.");
+    }
+  });
 
   if (_traceLoading) {
     _log("Requested packages map at '$packagesUri'.");
@@ -524,6 +514,34 @@
 }
 
 
+// Embedder Entrypoint:
+// Add mapping from package name to URI.
+void _addPackageMapEntry(String key, String value) {
+  if (!_setupCompleted) {
+    _setupHooks();
+  }
+  if (_traceLoading) {
+    _log("Adding packages map entry: $key -> $value");
+  }
+  if (_packageRoot != null) {
+    if (_traceLoading) {
+      _log("_packageRoot already set: $_packageRoot");
+    }
+    throw "Cannot add package map entry to an exisiting package root.";
+  }
+  if (_packagesPort != null) {
+    if (_traceLoading) {
+      _log("Package map load request already pending.");
+    }
+    throw "Cannot add package map entry during package map resolution.";
+  }
+  if (_packageMap == null) {
+    _packageMap = new Map<String, Uri>();
+  }
+  _packageMap[key] = _workingDirectory.resolve(value);
+}
+
+
 void _asyncLoadError(_LoadRequest req, _LoadError error, StackTrace stack) {
   if (_traceLoading) {
     _log("_asyncLoadError(${req._uri}), error: $error\nstack: $stack");
@@ -553,8 +571,10 @@
     }
     // Wrap inside a _LoadError unless we are already propagating a previously
     // seen _LoadError.
-    var error = (e is _LoadError) ? e : new _LoadError(e.toString());
-    _asyncLoadError(tag, uri, context, error, s);
+    var error = (e is _LoadError) ? e : new _LoadError(uri, e.toString());
+    // Register a dummy load request and fail to load it.
+    var req = new _LoadRequest(tag, uri, resourceUri, context);
+    _asyncLoadError(req, error, s);
   }
 }
 
@@ -570,8 +590,15 @@
       // request for package resolution & loading.
       _requestPackagesMap();
     }
-    var req = new _LoadRequest(-1, tag, uri, resourceUri, context);
-    _pendingPackageLoads.add(req);
+    // Register the action of loading this package once the package resolution
+    // is ready.
+    _pendingPackageLoads.add(() {
+      if (_traceLoading) {
+        _log("Handling deferred package request: "
+             "$tag, $uri, $resourceUri, $context");
+      }
+      _loadPackage(tag, uri, resourceUri, context);
+    });
     if (_traceLoading) {
       _log("Pending package load of '$uri': "
       "${_pendingPackageLoads.length} pending");
@@ -635,6 +662,48 @@
 }
 
 
+// Handling of access to the package root or package map from user code.
+_triggerPackageResolution(action) {
+  if (_packagesReady()) {
+    // Packages are ready. Execute the action now.
+    action();
+  } else {
+    if (_pendingPackageLoads.isEmpty) {
+      // Package resolution has not been setup yet, and this is the first
+      // request for package resolution & loading.
+      _requestPackagesMap();
+    }
+    // Register the action for when the package resolution is ready.
+    _pendingPackageLoads.add(action);
+  }
+}
+
+
+Future<Uri> _getPackageRoot() {
+  if (_traceLoading) {
+    _log("Request for package root from user code.");
+  }
+  var completer = new Completer<Uri>();
+  _triggerPackageResolution(() {
+    completer.complete(_packageRoot);
+  });
+  return completer.future;
+}
+
+
+Future<Map<String, Uri>> _getPackageMap() {
+  if (_traceLoading) {
+    _log("Request for package map from user code.");
+  }
+  var completer = new Completer<Map<String, Uri>>();
+  _triggerPackageResolution(() {
+    var result = (_packageMap != null) ? new Map.from(_packageMap) : {};
+    completer.complete(result);
+  });
+  return completer.future;
+}
+
+
 // Handling of Resource class by dispatching to the load port.
 Future<List<int>> _resourceReadAsBytes(Uri uri) {
   var completer = new Completer<List<int>>();
@@ -762,4 +831,6 @@
 _setupHooks() {
   _setupCompleted = true;
   VMLibraryHooks.resourceReadAsBytes = _resourceReadAsBytes;
+  VMLibraryHooks.getPackageRoot = _getPackageRoot;
+  VMLibraryHooks.getPackageMap = _getPackageMap;
 }
diff --git a/runtime/bin/builtin.h b/runtime/bin/builtin.h
index a943dc8..ab871af 100644
--- a/runtime/bin/builtin.h
+++ b/runtime/bin/builtin.h
@@ -49,7 +49,7 @@
   // load it.
   static Dart_Handle LoadAndCheckLibrary(BuiltinLibraryId id);
 
-  static void SetLoadPort(Dart_Port port);
+  static Dart_Handle SetLoadPort(Dart_Port port);
 
  private:
   // Map specified URI to an actual file name from 'source_paths' and read
diff --git a/runtime/bin/builtin_common.cc b/runtime/bin/builtin_common.cc
index da754a5..678e48b 100644
--- a/runtime/bin/builtin_common.cc
+++ b/runtime/bin/builtin_common.cc
@@ -10,27 +10,37 @@
 #include "bin/dartutils.h"
 #include "bin/platform.h"
 
+// Return the error from the containing function if handle is in error handle.
+#define RETURN_IF_ERROR(handle)                                                \
+  {                                                                            \
+    Dart_Handle __handle = handle;                                             \
+    if (Dart_IsError((__handle))) {                                            \
+      return __handle;                                                         \
+    }                                                                          \
+  }
+
 namespace dart {
 namespace bin {
 
-void Builtin::SetLoadPort(Dart_Port port) {
+Dart_Handle Builtin::SetLoadPort(Dart_Port port) {
   load_port_ = port;
   ASSERT(load_port_ != ILLEGAL_PORT);
   Dart_Handle field_name = DartUtils::NewString("_loadPort");
-  ASSERT(!Dart_IsError(field_name));
+  RETURN_IF_ERROR(field_name);
   Dart_Handle builtin_lib =
       Builtin::LoadAndCheckLibrary(Builtin::kBuiltinLibrary);
-  ASSERT(!Dart_IsError(builtin_lib));
+  RETURN_IF_ERROR(builtin_lib);
   Dart_Handle send_port = Dart_GetField(builtin_lib, field_name);
-  ASSERT(!Dart_IsError(send_port));
+  RETURN_IF_ERROR(send_port);
   if (!Dart_IsNull(send_port)) {
     // Already created and set.
-    return;
+    return Dart_True();
   }
   send_port = Dart_NewSendPort(load_port_);
-  ASSERT(!Dart_IsError(send_port));
+  RETURN_IF_ERROR(send_port);
   Dart_Handle result = Dart_SetField(builtin_lib, field_name, send_port);
-  ASSERT(!Dart_IsError(result));
+  RETURN_IF_ERROR(result);
+  return Dart_True();
 }
 
 }  // namespace bin
diff --git a/runtime/bin/dartutils.cc b/runtime/bin/dartutils.cc
index dd63bec..3c01e64 100644
--- a/runtime/bin/dartutils.cc
+++ b/runtime/bin/dartutils.cc
@@ -21,6 +21,15 @@
 #include "bin/socket.h"
 #include "bin/utils.h"
 
+// Return the error from the containing function if handle is in error handle.
+#define RETURN_IF_ERROR(handle)                                                \
+  {                                                                            \
+    Dart_Handle __handle = handle;                                             \
+    if (Dart_IsError((__handle))) {                                            \
+      return __handle;                                                         \
+    }                                                                          \
+  }
+
 namespace dart {
 namespace bin {
 
@@ -126,21 +135,17 @@
 }
 
 
-void DartUtils::SetIntegerField(Dart_Handle handle,
-                                const char* name,
-                                int64_t val) {
-  Dart_Handle result = Dart_SetField(handle,
-                                     NewString(name),
-                                     Dart_NewInteger(val));
-  if (Dart_IsError(result)) Dart_PropagateError(result);
+Dart_Handle DartUtils::SetIntegerField(Dart_Handle handle,
+                                       const char* name,
+                                       int64_t val) {
+  return Dart_SetField(handle, NewString(name), Dart_NewInteger(val));
 }
 
 
-void DartUtils::SetStringField(Dart_Handle handle,
+Dart_Handle DartUtils::SetStringField(Dart_Handle handle,
                                const char* name,
                                const char* val) {
-  Dart_Handle result = Dart_SetField(handle, NewString(name), NewString(val));
-  if (Dart_IsError(result)) Dart_PropagateError(result);
+  return Dart_SetField(handle, NewString(name), NewString(val));
 }
 
 
@@ -383,7 +388,7 @@
     // Resolve the url within the context of the library's URL.
     Dart_Handle builtin_lib =
         Builtin::LoadAndCheckLibrary(Builtin::kBuiltinLibrary);
-    DART_CHECK_VALID(builtin_lib);
+    RETURN_IF_ERROR(builtin_lib);
     return ResolveUri(library_url, url, builtin_lib);
   }
 
@@ -423,7 +428,7 @@
 
   Dart_Handle builtin_lib =
       Builtin::LoadAndCheckLibrary(Builtin::kBuiltinLibrary);
-  DART_CHECK_VALID(builtin_lib);
+  RETURN_IF_ERROR(builtin_lib);
   if (DartUtils::IsDartExtensionSchemeURL(url_string)) {
     // Load a native code shared library to use in a native extension
     if (tag != Dart_kImportTag) {
@@ -459,6 +464,10 @@
                                               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;
@@ -569,7 +578,9 @@
       } else {
         ASSERT(tag == Dart_kSourceTag);
         Dart_Handle library = Dart_LookupLibrary(library_uri);
-        DART_CHECK_VALID(library);
+        if (Dart_IsError(library)) {
+          Dart_PropagateError(library);
+        }
         result = Dart_LoadSource(library, resolved_script_uri, source, 0, 0);
       }
     }
@@ -589,11 +600,6 @@
 // no more outstanding load requests.
 void FUNCTION_NAME(Builtin_DoneLoading)(Dart_NativeArguments args) {
   Dart_Handle res = Dart_FinalizeLoading(true);
-  IsolateData* isolate_data =
-      reinterpret_cast<IsolateData*>(Dart_CurrentIsolateData());
-  if (isolate_data->load_async_id >= 0) {
-    Dart_TimelineAsyncEnd("LoadScript", isolate_data->load_async_id);
-  }
   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
@@ -631,41 +637,44 @@
                                              bool is_service_isolate,
                                              bool trace_loading,
                                              const char* package_root,
+                                             const char** package_map,
                                              const char* packages_file) {
   // Setup the internal library's 'internalPrint' function.
   Dart_Handle print = Dart_Invoke(
       builtin_lib, NewString("_getPrintClosure"), 0, NULL);
-  DART_CHECK_VALID(print);
+  RETURN_IF_ERROR(print);
   Dart_Handle result =
       Dart_SetField(internal_lib, NewString("_printClosure"), print);
-  DART_CHECK_VALID(result);
+  RETURN_IF_ERROR(result);
 
   if (!is_service_isolate) {
     if (IsWindowsHost()) {
       result = Dart_SetField(builtin_lib, NewString("_isWindows"), Dart_True());
-      DART_CHECK_VALID(result);
+      RETURN_IF_ERROR(result);
     }
     if (trace_loading) {
       result = Dart_SetField(builtin_lib,
                              NewString("_traceLoading"), Dart_True());
-      DART_CHECK_VALID(result);
+      RETURN_IF_ERROR(result);
     }
     // Set current working directory.
     result = SetWorkingDirectory(builtin_lib);
-    DART_CHECK_VALID(result);
+    RETURN_IF_ERROR(result);
     // Wait for the service isolate to initialize the load port.
     Dart_Port load_port = Dart_ServiceWaitForLoadPort();
     if (load_port == ILLEGAL_PORT) {
       return NewDartUnsupportedError("Service did not return load port.");
     }
-    Builtin::SetLoadPort(load_port);
+    result = Builtin::SetLoadPort(load_port);
+    RETURN_IF_ERROR(result);
   }
 
   // Set up package root if specified.
   if (package_root != NULL) {
+    ASSERT(package_map == NULL);
     ASSERT(packages_file == NULL);
     result = NewString(package_root);
-    DART_CHECK_VALID(result);
+    RETURN_IF_ERROR(result);
     const int kNumArgs = 1;
     Dart_Handle dart_args[kNumArgs];
     dart_args[0] = result;
@@ -673,10 +682,37 @@
                          NewString("_setPackageRoot"),
                          kNumArgs,
                          dart_args);
-    DART_CHECK_VALID(result);
+    RETURN_IF_ERROR(result);
+  } else if (package_map != NULL) {
+    ASSERT(packages_file == NULL);
+    Dart_Handle func_name = NewString("_addPackageMapEntry");
+    RETURN_IF_ERROR(func_name);
+
+    for (int i = 0; package_map[i] != NULL; i +=2) {
+      const int kNumArgs = 2;
+      Dart_Handle dart_args[kNumArgs];
+      // Get the key.
+      result = NewString(package_map[i]);
+      RETURN_IF_ERROR(result);
+      dart_args[0] = result;
+      if (package_map[i + 1] == NULL) {
+        return Dart_NewUnhandledExceptionError(
+            NewDartArgumentError("Adding package map entry without value."));
+      }
+      // Get the value.
+      result = NewString(package_map[i + 1]);
+      RETURN_IF_ERROR(result);
+      dart_args[1] = result;
+      // Setup the next package map entry.
+      result = Dart_Invoke(builtin_lib,
+                           func_name,
+                           kNumArgs,
+                           dart_args);
+      RETURN_IF_ERROR(result);
+    }
   } else if (packages_file != NULL) {
     result = NewString(packages_file);
-    DART_CHECK_VALID(result);
+    RETURN_IF_ERROR(result);
     const int kNumArgs = 1;
     Dart_Handle dart_args[kNumArgs];
     dart_args[0] = result;
@@ -684,110 +720,116 @@
                          NewString("_loadPackagesMap"),
                          kNumArgs,
                          dart_args);
-    DART_CHECK_VALID(result);
+    RETURN_IF_ERROR(result);
   }
   return Dart_True();
 }
 
 
-void DartUtils::PrepareCoreLibrary(Dart_Handle core_lib,
-                                   Dart_Handle builtin_lib,
-                                   bool is_service_isolate) {
+Dart_Handle DartUtils::PrepareCoreLibrary(Dart_Handle core_lib,
+                                          Dart_Handle builtin_lib,
+                                          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_CHECK_VALID(uri_base);
+    RETURN_IF_ERROR(uri_base);
     Dart_Handle result = Dart_SetField(core_lib,
                                        NewString("_uriBaseClosure"),
                                        uri_base);
-    DART_CHECK_VALID(result);
+    RETURN_IF_ERROR(result);
   }
+  return Dart_True();
 }
 
 
-void DartUtils::PrepareAsyncLibrary(Dart_Handle async_lib,
-                                    Dart_Handle isolate_lib) {
+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);
+  RETURN_IF_ERROR(schedule_immediate_closure);
   Dart_Handle args[1];
   args[0] = schedule_immediate_closure;
-  DART_CHECK_VALID(Dart_Invoke(
-      async_lib, NewString("_setScheduleImmediateClosure"), 1, args));
+  return Dart_Invoke(
+      async_lib, NewString("_setScheduleImmediateClosure"), 1, args);
 }
 
 
-void DartUtils::PrepareIOLibrary(Dart_Handle io_lib) {
-  DART_CHECK_VALID(Dart_Invoke(io_lib, NewString("_setupHooks"), 0, NULL));
+Dart_Handle DartUtils::PrepareIOLibrary(Dart_Handle io_lib) {
+  return Dart_Invoke(io_lib, NewString("_setupHooks"), 0, NULL);
 }
 
 
-void DartUtils::PrepareIsolateLibrary(Dart_Handle isolate_lib) {
-  DART_CHECK_VALID(Dart_Invoke(isolate_lib, NewString("_setupHooks"), 0, NULL));
+Dart_Handle DartUtils::PrepareIsolateLibrary(Dart_Handle isolate_lib) {
+  return Dart_Invoke(isolate_lib, NewString("_setupHooks"), 0, NULL);
 }
 
 
 Dart_Handle DartUtils::PrepareForScriptLoading(const char* package_root,
+                                               const char** package_map,
                                                const char* packages_file,
                                                bool is_service_isolate,
                                                bool trace_loading,
                                                Dart_Handle builtin_lib) {
   // First ensure all required libraries are available.
   Dart_Handle url = NewString(kCoreLibURL);
-  DART_CHECK_VALID(url);
+  RETURN_IF_ERROR(url);
   Dart_Handle core_lib = Dart_LookupLibrary(url);
-  DART_CHECK_VALID(core_lib);
+  RETURN_IF_ERROR(core_lib);
   url = NewString(kAsyncLibURL);
-  DART_CHECK_VALID(url);
+  RETURN_IF_ERROR(url);
   Dart_Handle async_lib = Dart_LookupLibrary(url);
-  DART_CHECK_VALID(async_lib);
+  RETURN_IF_ERROR(async_lib);
   url = NewString(kIsolateLibURL);
-  DART_CHECK_VALID(url);
+  RETURN_IF_ERROR(url);
   Dart_Handle isolate_lib = Dart_LookupLibrary(url);
-  DART_CHECK_VALID(isolate_lib);
+  RETURN_IF_ERROR(isolate_lib);
   url = NewString(kInternalLibURL);
-  DART_CHECK_VALID(url);
+  RETURN_IF_ERROR(url);
   Dart_Handle internal_lib = Dart_LookupLibrary(url);
-  DART_CHECK_VALID(internal_lib);
+  RETURN_IF_ERROR(internal_lib);
   Dart_Handle io_lib = Builtin::LoadAndCheckLibrary(Builtin::kIOLibrary);
-  DART_CHECK_VALID(io_lib);
+  RETURN_IF_ERROR(io_lib);
 
   // We need to ensure that all the scripts loaded so far are finalized
   // as we are about to invoke some Dart code below to setup closures.
   Dart_Handle result = Dart_FinalizeLoading(false);
-  DART_CHECK_VALID(result);
+  RETURN_IF_ERROR(result);
 
   result = PrepareBuiltinLibrary(builtin_lib,
                                  internal_lib,
                                  is_service_isolate,
                                  trace_loading,
                                  package_root,
+                                 package_map,
                                  packages_file);
-  DART_CHECK_VALID(result);
+  RETURN_IF_ERROR(result);
 
-  PrepareAsyncLibrary(async_lib, isolate_lib);
-  PrepareCoreLibrary(core_lib, builtin_lib, is_service_isolate);
-  PrepareIsolateLibrary(isolate_lib);
-  PrepareIOLibrary(io_lib);
+  RETURN_IF_ERROR(PrepareAsyncLibrary(async_lib, isolate_lib));
+  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;
 }
 
 
-void DartUtils::SetupIOLibrary(const char* script_uri) {
+Dart_Handle DartUtils::SetupIOLibrary(const char* script_uri) {
   Dart_Handle io_lib_url = NewString(kIOLibURL);
-  DART_CHECK_VALID(io_lib_url);
+  RETURN_IF_ERROR(io_lib_url);
   Dart_Handle io_lib = Dart_LookupLibrary(io_lib_url);
-  DART_CHECK_VALID(io_lib);
+  RETURN_IF_ERROR(io_lib);
   Dart_Handle platform_type = GetDartType(DartUtils::kIOLibURL, "_Platform");
-  DART_CHECK_VALID(platform_type);
+  RETURN_IF_ERROR(platform_type);
   Dart_Handle script_name = NewString("_nativeScript");
-  DART_CHECK_VALID(script_name);
+  RETURN_IF_ERROR(script_name);
   Dart_Handle dart_script = NewString(script_uri);
-  DART_CHECK_VALID(dart_script);
+  RETURN_IF_ERROR(dart_script);
   Dart_Handle set_script_name =
       Dart_SetField(platform_type, script_name, dart_script);
-  DART_CHECK_VALID(set_script_name);
+  RETURN_IF_ERROR(set_script_name);
+  return Dart_Null();
 }
 
 
diff --git a/runtime/bin/dartutils.h b/runtime/bin/dartutils.h
index 8a9c953..d337a10 100644
--- a/runtime/bin/dartutils.h
+++ b/runtime/bin/dartutils.h
@@ -102,12 +102,12 @@
   // a boolean value an API error is propagated.
   static bool GetBooleanValue(Dart_Handle bool_obj);
 
-  static void SetIntegerField(Dart_Handle handle,
-                              const char* name,
-                              int64_t val);
-  static void SetStringField(Dart_Handle handle,
-                             const char* name,
-                             const char* val);
+  static Dart_Handle SetIntegerField(Dart_Handle handle,
+                                     const char* name,
+                                     int64_t val);
+  static Dart_Handle SetStringField(Dart_Handle handle,
+                                    const char* name,
+                                    const char* val);
   static bool IsDartSchemeURL(const char* url_name);
   static bool IsDartExtensionSchemeURL(const char* url_name);
   static bool IsDartIOLibURL(const char* url_name);
@@ -129,20 +129,22 @@
                                            bool is_service_isolate,
                                            bool trace_loading,
                                            const char* package_root,
+                                           const char** package_map,
                                            const char* packages_file);
-  static void PrepareCoreLibrary(Dart_Handle core_lib,
+  static Dart_Handle PrepareCoreLibrary(Dart_Handle core_lib,
                                  Dart_Handle builtin_lib,
                                  bool is_service_isolate);
-  static void PrepareAsyncLibrary(Dart_Handle async_lib,
+  static Dart_Handle PrepareAsyncLibrary(Dart_Handle async_lib,
                                   Dart_Handle isolate_lib);
-  static void PrepareIOLibrary(Dart_Handle io_lib);
-  static void PrepareIsolateLibrary(Dart_Handle isolate_lib);
+  static Dart_Handle PrepareIOLibrary(Dart_Handle io_lib);
+  static Dart_Handle PrepareIsolateLibrary(Dart_Handle isolate_lib);
   static Dart_Handle PrepareForScriptLoading(const char* package_root,
+                                             const char** package_map,
                                              const char* packages_file,
                                              bool is_service_isolate,
                                              bool trace_loading,
                                              Dart_Handle builtin_lib);
-  static void SetupIOLibrary(const char* script_uri);
+  static Dart_Handle SetupIOLibrary(const char* script_uri);
 
   static bool PostNull(Dart_Port port_id);
   static bool PostInt32(Dart_Port port_id, int32_t value);
diff --git a/runtime/bin/dbg_connection.cc b/runtime/bin/dbg_connection.cc
index 2cc4cd8..6bd0cda 100644
--- a/runtime/bin/dbg_connection.cc
+++ b/runtime/bin/dbg_connection.cc
@@ -198,6 +198,9 @@
       msgbuf_->ReadData();
     }
     if (!msgbuf_->Alive()) {
+      if (trace_debug_protocol) {
+        Log::Print("Debugger is exiting HandleMessages loop.\n");
+      }
       return;
     }
 
@@ -344,6 +347,13 @@
 }
 
 
+void DebuggerConnectionHandler::StopHandler() {
+  if (IsConnected()) {
+    DebuggerConnectionImpl::StopHandler(singleton_handler->debug_fd());
+  }
+}
+
+
 void DebuggerConnectionHandler::WaitForConnection() {
   ASSERT(handler_lock_ != NULL);
   MonitorLocker ml(handler_lock_);
diff --git a/runtime/bin/dbg_connection.h b/runtime/bin/dbg_connection.h
index bd4f4dd..577c30a 100644
--- a/runtime/bin/dbg_connection.h
+++ b/runtime/bin/dbg_connection.h
@@ -51,6 +51,9 @@
   // from the client.
   static int StartHandler(const char* address, int port_number);
 
+  // Stops the native thread.
+  static void StopHandler();
+
   // Initializes the parts of the debugger which are needed by the vm
   // service.  This function should only be called when StartHandler
   // is not called.
diff --git a/runtime/bin/dbg_connection_android.h b/runtime/bin/dbg_connection_android.h
index 591ee9f..8975294 100644
--- a/runtime/bin/dbg_connection_android.h
+++ b/runtime/bin/dbg_connection_android.h
@@ -16,6 +16,7 @@
 class DebuggerConnectionImpl {
  public:
   static void StartHandler(int port_number);
+  static void StopHandler(intptr_t debug_fd) {}
   static intptr_t Send(intptr_t socket, const char* buf, int len);
   static intptr_t Receive(intptr_t socket, char* buf, int len);
 
diff --git a/runtime/bin/dbg_connection_linux.h b/runtime/bin/dbg_connection_linux.h
index 94a9664..fcbd16e 100644
--- a/runtime/bin/dbg_connection_linux.h
+++ b/runtime/bin/dbg_connection_linux.h
@@ -16,6 +16,7 @@
 class DebuggerConnectionImpl {
  public:
   static void StartHandler(int port_number);
+  static void StopHandler(intptr_t debug_fd) {}
   static intptr_t Send(intptr_t socket, const char* buf, int len);
   static intptr_t Receive(intptr_t socket, char* buf, int len);
 
diff --git a/runtime/bin/dbg_connection_macos.h b/runtime/bin/dbg_connection_macos.h
index 9665700..064238e 100644
--- a/runtime/bin/dbg_connection_macos.h
+++ b/runtime/bin/dbg_connection_macos.h
@@ -16,6 +16,7 @@
 class DebuggerConnectionImpl {
  public:
   static void StartHandler(int port_number);
+  static void StopHandler(intptr_t debug_fd) {}
   static intptr_t Send(intptr_t socket, const char* buf, int len);
   static intptr_t Receive(intptr_t socket, char* buf, int len);
 
diff --git a/runtime/bin/dbg_connection_win.cc b/runtime/bin/dbg_connection_win.cc
index fee02e6c..49bc4a9 100644
--- a/runtime/bin/dbg_connection_win.cc
+++ b/runtime/bin/dbg_connection_win.cc
@@ -8,12 +8,59 @@
 #include "bin/dbg_connection.h"
 
 #include "bin/eventhandler.h"
-
+#include "bin/lockers.h"
+#include "bin/log.h"
+#include "bin/thread.h"
 
 namespace dart {
 namespace bin {
 
+Monitor* DebuggerConnectionImpl::handler_monitor_ = new Monitor();
+ThreadId DebuggerConnectionImpl::handler_thread_id_ = Thread::kInvalidThreadId;
+bool DebuggerConnectionImpl::handler_thread_running_ = false;
+
+
+void DebuggerConnectionImpl::NotifyThreadStarted() {
+  MonitorLocker ml(handler_monitor_);
+  ASSERT(!handler_thread_running_);
+  ASSERT(handler_thread_id_ == Thread::kInvalidThreadId);
+  handler_thread_running_ = true;
+  handler_thread_id_ = Thread::GetCurrentThreadId();
+  ml.Notify();
+}
+
+
+void DebuggerConnectionImpl::WaitForThreadStarted() {
+  MonitorLocker ml(handler_monitor_);
+  while (!handler_thread_running_) {
+    ml.Wait();
+  }
+  ASSERT(handler_thread_id_ != Thread::kInvalidThreadId);
+}
+
+
+void DebuggerConnectionImpl::NotifyThreadFinished() {
+  MonitorLocker ml(handler_monitor_);
+  ASSERT(handler_thread_running_);
+  ASSERT(handler_thread_id_ != Thread::kInvalidThreadId);
+  handler_thread_running_ = false;
+  ml.Notify();
+}
+
+
+void DebuggerConnectionImpl::WaitForThreadFinished() {
+  MonitorLocker ml(handler_monitor_);
+  while (handler_thread_running_) {
+    ml.Wait();
+  }
+  ASSERT(handler_thread_id_ != Thread::kInvalidThreadId);
+  Thread::Join(handler_thread_id_);
+  handler_thread_id_ = Thread::kInvalidThreadId;
+}
+
+
 void DebuggerConnectionImpl::ThreadEntry(uword args) {
+  NotifyThreadStarted();
   ListenSocket* listen_socket =
       reinterpret_cast<ListenSocket*>(DebuggerConnectionHandler::listener_fd_);
   SOCKET client_socket = accept(listen_socket->socket(), NULL, NULL);
@@ -23,6 +70,7 @@
   ClientSocket* socket = new ClientSocket(client_socket);
   DebuggerConnectionHandler::AcceptDbgConnection(
       reinterpret_cast<intptr_t>(socket));
+  NotifyThreadFinished();
 }
 
 
@@ -32,6 +80,13 @@
   if (result != 0) {
     FATAL1("Failed to start debugger connection handler thread: %d\n", result);
   }
+  WaitForThreadStarted();
+}
+
+
+void DebuggerConnectionImpl::StopHandler(intptr_t debug_fd) {
+  Send(debug_fd, NULL, 0);
+  WaitForThreadFinished();
 }
 
 
diff --git a/runtime/bin/dbg_connection_win.h b/runtime/bin/dbg_connection_win.h
index 2a9feb2..8f5d0c6 100644
--- a/runtime/bin/dbg_connection_win.h
+++ b/runtime/bin/dbg_connection_win.h
@@ -5,17 +5,29 @@
 #ifndef BIN_DBG_CONNECTION_WIN_H_
 #define BIN_DBG_CONNECTION_WIN_H_
 
+#include "bin/lockers.h"
+#include "bin/thread.h"
+
 namespace dart {
 namespace bin {
 
 class DebuggerConnectionImpl {
  public:
   static void StartHandler(int port_number);
+  static void StopHandler(intptr_t debug_fd);
   static intptr_t Send(intptr_t socket, const char* buf, int len);
   static intptr_t Receive(intptr_t socket, char* buf, int len);
 
  private:
   static void ThreadEntry(uword args);
+  static void NotifyThreadStarted();
+  static void WaitForThreadStarted();
+  static void NotifyThreadFinished();
+  static void WaitForThreadFinished();
+
+  static Monitor* handler_monitor_;
+  static ThreadId handler_thread_id_;
+  static bool handler_thread_running_;
 };
 
 }  // namespace bin
diff --git a/runtime/bin/dbg_message.cc b/runtime/bin/dbg_message.cc
index a635880..d0f13d7 100644
--- a/runtime/bin/dbg_message.cc
+++ b/runtime/bin/dbg_message.cc
@@ -1402,25 +1402,29 @@
 
 void DbgMsgQueueList::IsolateEventHandler(Dart_IsolateId isolate_id,
                                           Dart_IsolateEvent kind) {
-  DebuggerConnectionHandler::WaitForConnection();
-  Dart_EnterScope();
   if (kind == kCreated) {
+    DebuggerConnectionHandler::WaitForConnection();
+    Dart_EnterScope();
     DbgMsgQueue* msg_queue = AddIsolateMsgQueue(isolate_id);
     msg_queue->SendIsolateEvent(isolate_id, kind);
+    Dart_ExitScope();
   } else {
+    DebuggerConnectionHandler::WaitForConnection();
     DbgMsgQueue* msg_queue = GetIsolateMsgQueue(isolate_id);
-    if (msg_queue != NULL) {
-      msg_queue->SendQueuedMsgs();
-      msg_queue->SendIsolateEvent(isolate_id, kind);
-      if (kind == kInterrupted) {
-        msg_queue->MessageLoop();
-      } else {
-        ASSERT(kind == kShutdown);
-        RemoveIsolateMsgQueue(isolate_id);
-      }
+    ASSERT(msg_queue != NULL);
+    Dart_EnterScope();
+    msg_queue->SendQueuedMsgs();
+    msg_queue->SendIsolateEvent(isolate_id, kind);
+    if (kind == kInterrupted) {
+      msg_queue->MessageLoop();
+    } else {
+      ASSERT(kind == kShutdown);
+      RemoveIsolateMsgQueue(isolate_id);
     }
+    Dart_ExitScope();
+    // If there is no receive message queue, do not wait for a connection, and
+    // ignore the message.
   }
-  Dart_ExitScope();
 }
 
 }  // namespace bin
diff --git a/runtime/bin/eventhandler_win.cc b/runtime/bin/eventhandler_win.cc
index db698a3..33f59d6 100644
--- a/runtime/bin/eventhandler_win.cc
+++ b/runtime/bin/eventhandler_win.cc
@@ -29,6 +29,7 @@
 
 static const int kBufferSize = 64 * 1024;
 static const int kStdOverlappedBufferSize = 16 * 1024;
+static const int kMaxUDPPackageLength = 64 * 1024;
 
 OverlappedBuffer* OverlappedBuffer::AllocateBuffer(int buffer_size,
                                                    Operation operation) {
@@ -121,23 +122,16 @@
       pending_read_(NULL),
       pending_write_(NULL),
       last_error_(NOERROR),
-      flags_(0) {
-  InitializeCriticalSection(&cs_);
+      flags_(0),
+      read_thread_id_(Thread::kInvalidThreadId),
+      read_thread_starting_(false),
+      read_thread_finished_(false),
+      monitor_(new Monitor()) {
 }
 
 
 Handle::~Handle() {
-  DeleteCriticalSection(&cs_);
-}
-
-
-void Handle::Lock() {
-  EnterCriticalSection(&cs_);
-}
-
-
-void Handle::Unlock() {
-  LeaveCriticalSection(&cs_);
+  delete monitor_;
 }
 
 
@@ -154,7 +148,7 @@
 
 
 void Handle::Close() {
-  ScopedLock lock(this);
+  MonitorLocker ml(monitor_);
   if (!IsClosing()) {
     // Close the socket and set the closing state. This close method can be
     // called again if this socket has pending IO operations in flight.
@@ -175,28 +169,60 @@
 
 
 bool Handle::HasPendingRead() {
-  ScopedLock lock(this);
+  MonitorLocker ml(monitor_);
   return pending_read_ != NULL;
 }
 
 
 bool Handle::HasPendingWrite() {
-  ScopedLock lock(this);
+  MonitorLocker ml(monitor_);
   return pending_write_ != NULL;
 }
 
 
-void Handle::ReadComplete(OverlappedBuffer* buffer) {
-  ScopedLock lock(this);
-  // Currently only one outstanding read at the time.
-  ASSERT(pending_read_ == buffer);
-  ASSERT(data_ready_ == NULL);
-  if (!IsClosing() && !buffer->IsEmpty()) {
-    data_ready_ = pending_read_;
-  } else {
-    OverlappedBuffer::DisposeBuffer(buffer);
+void Handle::WaitForReadThreadStarted() {
+  MonitorLocker ml(monitor_);
+  while (read_thread_starting_) {
+    ml.Wait();
   }
-  pending_read_ = NULL;
+}
+
+
+void Handle::WaitForReadThreadFinished() {
+  // Join the Reader thread if there is one.
+  ThreadId to_join = Thread::kInvalidThreadId;
+  {
+    MonitorLocker ml(monitor_);
+    if (read_thread_id_ != Thread::kInvalidThreadId) {
+      while (!read_thread_finished_) {
+        ml.Wait();
+      }
+      read_thread_finished_ = false;
+      to_join = read_thread_id_;
+      read_thread_id_ = Thread::kInvalidThreadId;
+    }
+  }
+  if (to_join != Thread::kInvalidThreadId) {
+    Thread::Join(to_join);
+  }
+}
+
+
+void Handle::ReadComplete(OverlappedBuffer* buffer) {
+  WaitForReadThreadStarted();
+  {
+    MonitorLocker ml(monitor_);
+    // Currently only one outstanding read at the time.
+    ASSERT(pending_read_ == buffer);
+    ASSERT(data_ready_ == NULL);
+    if (!IsClosing() && !buffer->IsEmpty()) {
+      data_ready_ = pending_read_;
+    } else {
+      OverlappedBuffer::DisposeBuffer(buffer);
+    }
+    pending_read_ = NULL;
+  }
+  WaitForReadThreadFinished();
 }
 
 
@@ -206,7 +232,7 @@
 
 
 void Handle::WriteComplete(OverlappedBuffer* buffer) {
-  ScopedLock lock(this);
+  MonitorLocker ml(monitor_);
   // Currently only one outstanding write at the time.
   ASSERT(pending_write_ == buffer);
   OverlappedBuffer::DisposeBuffer(buffer);
@@ -220,7 +246,26 @@
 }
 
 
+void Handle::NotifyReadThreadStarted() {
+  MonitorLocker ml(monitor_);
+  ASSERT(read_thread_starting_);
+  ASSERT(read_thread_id_ == Thread::kInvalidThreadId);
+  read_thread_id_ = Thread::GetCurrentThreadId();
+  read_thread_starting_ = false;
+  ml.Notify();
+}
+
+void Handle::NotifyReadThreadFinished() {
+  MonitorLocker ml(monitor_);
+  ASSERT(!read_thread_finished_);
+  ASSERT(read_thread_id_ != Thread::kInvalidThreadId);
+  read_thread_finished_ = true;
+  ml.Notify();
+}
+
+
 void Handle::ReadSyncCompleteAsync() {
+  NotifyReadThreadStarted();
   ASSERT(pending_read_ != NULL);
   ASSERT(pending_read_->GetBufferSize() >= kStdOverlappedBufferSize);
 
@@ -228,9 +273,10 @@
   if (GetFileType(handle_) == FILE_TYPE_CHAR) {
     buffer_size = kStdOverlappedBufferSize;
   }
+  char* buffer_start = pending_read_->GetBufferStart();
   DWORD bytes_read = 0;
   BOOL ok = ReadFile(handle_,
-                     pending_read_->GetBufferStart(),
+                     buffer_start,
                      buffer_size,
                      &bytes_read,
                      NULL);
@@ -245,11 +291,11 @@
   if (!ok) {
     FATAL("PostQueuedCompletionStatus failed");
   }
+  NotifyReadThreadFinished();
 }
 
 
 bool Handle::IssueRead() {
-  ScopedLock lock(this);
   ASSERT(type_ != kListenSocket);
   ASSERT(pending_read_ == NULL);
   OverlappedBuffer* buffer = OverlappedBuffer::AllocateReadBuffer(kBufferSize);
@@ -272,6 +318,7 @@
   } else {
     // Completing asynchronously through thread.
     pending_read_ = buffer;
+    read_thread_starting_ = true;
     int result = Thread::Start(ReadFileThread,
                                reinterpret_cast<uword>(this));
     if (result != 0) {
@@ -288,7 +335,7 @@
 
 
 bool Handle::IssueWrite() {
-  ScopedLock lock(this);
+  MonitorLocker ml(monitor_);
   ASSERT(type_ != kListenSocket);
   ASSERT(completion_port_ != INVALID_HANDLE_VALUE);
   ASSERT(pending_write_ != NULL);
@@ -345,7 +392,7 @@
 
 
 void FileHandle::EnsureInitialized(EventHandlerImplementation* event_handler) {
-  ScopedLock lock(this);
+  MonitorLocker ml(monitor_);
   event_handler_ = event_handler;
   if (SupportsOverlappedIO() && completion_port_ == INVALID_HANDLE_VALUE) {
     CreateCompletionPort(event_handler_->completion_port());
@@ -360,7 +407,7 @@
 
 void DirectoryWatchHandle::EnsureInitialized(
     EventHandlerImplementation* event_handler) {
-  ScopedLock lock(this);
+  MonitorLocker ml(monitor_);
   event_handler_ = event_handler;
   if (completion_port_ == INVALID_HANDLE_VALUE) {
     CreateCompletionPort(event_handler_->completion_port());
@@ -374,7 +421,6 @@
 
 
 bool DirectoryWatchHandle::IssueRead() {
-  ScopedLock lock(this);
   // It may have been started before, as we start the directory-handler when
   // we create it.
   if (pending_read_ != NULL || data_ready_ != NULL) return true;
@@ -399,7 +445,7 @@
 
 
 void DirectoryWatchHandle::Stop() {
-  ScopedLock lock(this);
+  MonitorLocker ml(monitor_);
   // Stop the outstanding read, so we can close the handle.
 
   if (pending_read_ != NULL) {
@@ -443,7 +489,7 @@
 
 
 bool ListenSocket::IssueAccept() {
-  ScopedLock lock(this);
+  MonitorLocker ml(monitor_);
 
   // For AcceptEx there needs to be buffer storage for address
   // information for two addresses (local and remote address). The
@@ -483,7 +529,7 @@
 
 void ListenSocket::AcceptComplete(OverlappedBuffer* buffer,
                                   HANDLE completion_port) {
-  ScopedLock lock(this);
+  MonitorLocker ml(monitor_);
   if (!IsClosing()) {
     // Update the accepted socket to support the full range of API calls.
     SOCKET s = socket();
@@ -544,13 +590,13 @@
 
 
 bool ListenSocket::CanAccept() {
-  ScopedLock lock(this);
+  MonitorLocker ml(monitor_);
   return accepted_head_ != NULL;
 }
 
 
 ClientSocket* ListenSocket::Accept() {
-  ScopedLock lock(this);
+  MonitorLocker ml(monitor_);
 
   ClientSocket *result = NULL;
 
@@ -577,7 +623,7 @@
 
 void ListenSocket::EnsureInitialized(
     EventHandlerImplementation* event_handler) {
-  ScopedLock lock(this);
+  MonitorLocker ml(monitor_);
   if (AcceptEx_ == NULL) {
     ASSERT(completion_port_ == INVALID_HANDLE_VALUE);
     ASSERT(event_handler_ == NULL);
@@ -594,7 +640,7 @@
 
 
 intptr_t Handle::Available() {
-  ScopedLock lock(this);
+  MonitorLocker ml(monitor_);
   if (data_ready_ == NULL) return 0;
   ASSERT(!data_ready_->IsEmpty());
   return data_ready_->GetRemainingLength();
@@ -602,7 +648,7 @@
 
 
 intptr_t Handle::Read(void* buffer, intptr_t num_bytes) {
-  ScopedLock lock(this);
+  MonitorLocker ml(monitor_);
   if (data_ready_ == NULL) return 0;
   num_bytes = data_ready_->Read(
       buffer, Utils::Minimum<intptr_t>(num_bytes, INT_MAX));
@@ -617,7 +663,7 @@
 
 intptr_t Handle::RecvFrom(
     void* buffer, intptr_t num_bytes, struct sockaddr* sa, socklen_t sa_len) {
-  ScopedLock lock(this);
+  MonitorLocker ml(monitor_);
   if (data_ready_ == NULL) return 0;
   num_bytes = data_ready_->Read(
       buffer, Utils::Minimum<intptr_t>(num_bytes, INT_MAX));
@@ -639,7 +685,7 @@
 
 
 intptr_t Handle::Write(const void* buffer, intptr_t num_bytes) {
-  ScopedLock lock(this);
+  MonitorLocker ml(monitor_);
   if (pending_write_ != NULL) return 0;
   if (num_bytes > kBufferSize) num_bytes = kBufferSize;
   ASSERT(SupportsOverlappedIO());
@@ -656,7 +702,7 @@
                         intptr_t num_bytes,
                         struct sockaddr* sa,
                         socklen_t sa_len) {
-  ScopedLock lock(this);
+  MonitorLocker ml(monitor_);
   if (pending_write_ != NULL) return 0;
   if (num_bytes > kBufferSize) num_bytes = kBufferSize;
   ASSERT(SupportsOverlappedIO());
@@ -675,13 +721,14 @@
 
 
 void StdHandle::RunWriteLoop() {
-  write_monitor_->Enter();
+  MonitorLocker ml(monitor_);
   write_thread_running_ = true;
+  thread_id_ = Thread::GetCurrentThreadId();
   // Notify we have started.
-  write_monitor_->Notify();
+  ml.Notify();
 
   while (write_thread_running_) {
-    write_monitor_->Wait(Monitor::kNoTimeout);
+    ml.Wait(Monitor::kNoTimeout);
     if (pending_write_ != NULL) {
       // We woke up and had a pending write. Execute it.
       WriteSyncCompleteAsync();
@@ -689,8 +736,7 @@
   }
 
   write_thread_exists_ = false;
-  write_monitor_->Notify();
-  write_monitor_->Exit();
+  ml.Notify();
 }
 
 
@@ -718,7 +764,7 @@
 }
 
 intptr_t StdHandle::Write(const void* buffer, intptr_t num_bytes) {
-  ScopedLock lock(this);
+  MonitorLocker ml(monitor_);
   if (pending_write_ != NULL) return 0;
   if (num_bytes > kBufferSize) num_bytes = kBufferSize;
   // In the case of stdout and stderr, OverlappedIO is not supported.
@@ -726,7 +772,6 @@
   // This code is actually never exposed to the user, as stdout and stderr is
   // not available as a RawSocket, but only wrapped in a Socket.
   // Note that we return '0', unless a thread have already completed a write.
-  MonitorLocker locker(write_monitor_);
   if (thread_wrote_ > 0) {
     if (num_bytes > thread_wrote_) num_bytes = thread_wrote_;
     thread_wrote_ -= num_bytes;
@@ -734,14 +779,14 @@
   }
   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);
     }
     while (!write_thread_running_) {
       // Wait until we the thread is running.
-      locker.Wait(Monitor::kNoTimeout);
+      ml.Wait(Monitor::kNoTimeout);
     }
   }
   // Only queue up to INT_MAX bytes.
@@ -749,19 +794,20 @@
   // Create buffer and notify thread about the new handle.
   pending_write_ = OverlappedBuffer::AllocateWriteBuffer(truncated_bytes);
   pending_write_->Write(buffer, truncated_bytes);
-  locker.Notify();
+  ml.Notify();
   return 0;
 }
 
 
 void StdHandle::DoClose() {
-  MonitorLocker locker(write_monitor_);
+  MonitorLocker ml(monitor_);
   if (write_thread_exists_) {
     write_thread_running_ = false;
-    locker.Notify();
+    ml.Notify();
     while (write_thread_exists_) {
-      locker.Wait(Monitor::kNoTimeout);
+      ml.Wait(Monitor::kNoTimeout);
     }
+    Thread::Join(thread_id_);
   }
   Handle::DoClose();
 }
@@ -807,7 +853,7 @@
 
 
 bool ClientSocket::IssueRead() {
-  ScopedLock lock(this);
+  MonitorLocker ml(monitor_);
   ASSERT(completion_port_ != INVALID_HANDLE_VALUE);
   ASSERT(pending_read_ == NULL);
 
@@ -836,7 +882,7 @@
 
 
 bool ClientSocket::IssueWrite() {
-  ScopedLock lock(this);
+  MonitorLocker ml(monitor_);
   ASSERT(completion_port_ != INVALID_HANDLE_VALUE);
   ASSERT(pending_write_ != NULL);
   ASSERT(pending_write_->operation() == OverlappedBuffer::kWrite);
@@ -900,7 +946,7 @@
 
 void ClientSocket::EnsureInitialized(
     EventHandlerImplementation* event_handler) {
-  ScopedLock lock(this);
+  MonitorLocker ml(monitor_);
   if (completion_port_ == INVALID_HANDLE_VALUE) {
     ASSERT(event_handler_ == NULL);
     event_handler_ = event_handler;
@@ -915,7 +961,7 @@
 
 
 bool DatagramSocket::IssueSendTo(struct sockaddr* sa, socklen_t sa_len) {
-  ScopedLock lock(this);
+  MonitorLocker ml(monitor_);
   ASSERT(completion_port_ != INVALID_HANDLE_VALUE);
   ASSERT(pending_write_ != NULL);
   ASSERT(pending_write_->operation() == OverlappedBuffer::kSendTo);
@@ -940,11 +986,12 @@
 
 
 bool DatagramSocket::IssueRecvFrom() {
-  ScopedLock lock(this);
+  MonitorLocker ml(monitor_);
   ASSERT(completion_port_ != INVALID_HANDLE_VALUE);
   ASSERT(pending_read_ == NULL);
 
-  OverlappedBuffer* buffer = OverlappedBuffer::AllocateRecvFromBuffer(1024);
+  OverlappedBuffer* buffer =
+      OverlappedBuffer::AllocateRecvFromBuffer(kMaxUDPPackageLength);
 
   DWORD flags;
   flags = 0;
@@ -970,7 +1017,7 @@
 
 void DatagramSocket::EnsureInitialized(
     EventHandlerImplementation* event_handler) {
-  ScopedLock lock(this);
+  MonitorLocker ml(monitor_);
   if (completion_port_ == INVALID_HANDLE_VALUE) {
     ASSERT(event_handler_ == NULL);
     event_handler_ = event_handler;
@@ -1010,7 +1057,7 @@
           reinterpret_cast<ListenSocket*>(handle);
       listen_socket->EnsureInitialized(this);
 
-      Handle::ScopedLock lock(listen_socket);
+      MonitorLocker ml(listen_socket->monitor_);
 
       if (IS_COMMAND(msg->data, kReturnTokenCommand)) {
         listen_socket->ReturnTokens(msg->dart_port, TOKEN_COUNT(msg->data));
@@ -1040,7 +1087,7 @@
       }
     } else {
       handle->EnsureInitialized(this);
-      Handle::ScopedLock lock(handle);
+      MonitorLocker ml(handle->monitor_);
 
       if (IS_COMMAND(msg->data, kReturnTokenCommand)) {
         handle->ReturnTokens(msg->dart_port, TOKEN_COUNT(msg->data));
@@ -1114,7 +1161,7 @@
   listen_socket->AcceptComplete(buffer, completion_port_);
 
   {
-    Handle::ScopedLock lock(listen_socket);
+    MonitorLocker ml(listen_socket->monitor_);
     TryDispatchingPendingAccepts(listen_socket);
   }
 
@@ -1167,14 +1214,18 @@
                                                 int bytes,
                                                 OverlappedBuffer* buffer) {
   ASSERT(handle->is_datagram_socket());
-  buffer->set_data_length(bytes);
-  handle->ReadComplete(buffer);
-  if (!handle->IsClosing()) {
-    int event_mask = 1 << kInEvent;
-    if ((handle->Mask() & event_mask) != 0) {
+  if (bytes >= 0) {
+    buffer->set_data_length(bytes);
+    handle->ReadComplete(buffer);
+    if (!handle->IsClosing()) {
+      int event_mask = 1 << kInEvent;
+      if ((handle->Mask() & event_mask) != 0) {
         Dart_Port port = handle->NextNotifyDartPort(event_mask);
-      DartUtils::PostInt32(port, event_mask);
+        DartUtils::PostInt32(port, event_mask);
+      }
     }
+  } else {
+    HandleError(handle);
   }
 
   DeleteIfClosed(handle);
@@ -1278,6 +1329,8 @@
 
 
 EventHandlerImplementation::EventHandlerImplementation() {
+  startup_monitor_ = new Monitor();
+  handler_thread_id_ = Thread::kInvalidThreadId;
   completion_port_ =
       CreateIoCompletionPort(INVALID_HANDLE_VALUE, NULL, NULL, 1);
   if (completion_port_ == NULL) {
@@ -1288,6 +1341,8 @@
 
 
 EventHandlerImplementation::~EventHandlerImplementation() {
+  Thread::Join(handler_thread_id_);
+  delete startup_monitor_;
   CloseHandle(completion_port_);
 }
 
@@ -1322,6 +1377,12 @@
   EventHandlerImplementation* handler_impl = &handler->delegate_;
   ASSERT(handler_impl != NULL);
 
+  {
+    MonitorLocker ml(handler_impl->startup_monitor_);
+    handler_impl->handler_thread_id_ = Thread::GetCurrentThreadId();
+    ml.Notify();
+  }
+
   while (!handler_impl->shutdown_) {
     DWORD bytes;
     ULONG_PTR key;
@@ -1358,6 +1419,11 @@
           last_error == ERROR_BROKEN_PIPE) {
         ASSERT(bytes == 0);
         handler_impl->HandleIOCompletion(bytes, key, overlapped);
+      } else if (last_error == ERROR_MORE_DATA) {
+        // Don't ASSERT no bytes in this case. This can happen if the receive
+        // buffer for datagram sockets is to small to contain a full datagram,
+        // and in this case bytes hold the bytes that was read.
+        handler_impl->HandleIOCompletion(-1, key, overlapped);
       } else {
         ASSERT(bytes == 0);
         handler_impl->HandleIOCompletion(-1, key, overlapped);
@@ -1382,6 +1448,13 @@
     FATAL1("Failed to start event handler thread %d", result);
   }
 
+  {
+    MonitorLocker ml(startup_monitor_);
+    while (handler_thread_id_ == Thread::kInvalidThreadId) {
+      ml.Wait();
+    }
+  }
+
   // Initialize Winsock32
   if (!Socket::Initialize()) {
     FATAL("Failed to initialized Windows sockets");
diff --git a/runtime/bin/eventhandler_win.h b/runtime/bin/eventhandler_win.h
index bfd02f9..38509dd 100644
--- a/runtime/bin/eventhandler_win.h
+++ b/runtime/bin/eventhandler_win.h
@@ -165,20 +165,6 @@
     kDatagramSocket
   };
 
-  class ScopedLock {
-   public:
-    explicit ScopedLock(Handle* handle)
-        : handle_(handle) {
-      handle_->Lock();
-    }
-    ~ScopedLock() {
-      handle_->Unlock();
-    }
-
-   private:
-    Handle* handle_;
-  };
-
   virtual ~Handle();
 
   // Socket interface exposing normal socket operations.
@@ -219,9 +205,6 @@
 
   HANDLE handle() { return handle_; }
 
-  void Lock();
-  void Unlock();
-
   bool CreateCompletionPort(HANDLE completion_port);
 
   void Close();
@@ -252,6 +235,9 @@
   void set_last_error(DWORD last_error) { last_error_ = last_error; }
 
  protected:
+  // For access to monitor_;
+  friend class EventHandlerImplementation;
+
   enum Flags {
     kClosing = 0,
     kCloseRead = 1,
@@ -264,6 +250,7 @@
 
   virtual void HandleIssueError();
 
+  Monitor* monitor_;
   Type type_;
   HANDLE handle_;
   HANDLE completion_port_;
@@ -275,9 +262,17 @@
 
   DWORD last_error_;
 
+  ThreadId read_thread_id_;
+  bool read_thread_starting_;
+  bool read_thread_finished_;
+
  private:
+  void WaitForReadThreadStarted();
+  void NotifyReadThreadStarted();
+  void WaitForReadThreadFinished();
+  void NotifyReadThreadFinished();
+
   int flags_;
-  CRITICAL_SECTION cs_;  // Critical section protecting this object.
 };
 
 
@@ -297,17 +292,13 @@
  public:
   explicit StdHandle(HANDLE handle)
       : FileHandle(handle),
+        thread_id_(Thread::kInvalidThreadId),
         thread_wrote_(0),
         write_thread_exists_(false),
-        write_thread_running_(false),
-        write_monitor_(new Monitor()) {
+        write_thread_running_(false) {
     type_ = kStd;
   }
 
-  ~StdHandle() {
-    delete write_monitor_;
-  }
-
   virtual void DoClose();
   virtual intptr_t Write(const void* buffer, intptr_t num_bytes);
 
@@ -315,10 +306,10 @@
   void RunWriteLoop();
 
  private:
+  ThreadId thread_id_;
   intptr_t thread_wrote_;
   bool write_thread_exists_;
   bool write_thread_running_;
-  Monitor* write_monitor_;
 };
 
 
@@ -526,6 +517,9 @@
  private:
   ClientSocket* client_sockets_head_;
 
+  Monitor* startup_monitor_;
+  ThreadId handler_thread_id_;
+
   TimeoutQueue timeout_queue_;  // Time for next timeout.
   bool shutdown_;
   HANDLE completion_port_;
diff --git a/runtime/bin/extensions.h b/runtime/bin/extensions.h
index 2b4e19b..25dbfeb 100644
--- a/runtime/bin/extensions.h
+++ b/runtime/bin/extensions.h
@@ -21,14 +21,14 @@
                                    const char* extension_name,
                                    Dart_Handle parent_library);
 
- private:
-  // The returned string must be freed.
-  static char* Concatenate(const char** strings);
-
   // Platform-specific implementations.
   static void* LoadExtensionLibrary(const char* library_file);
   static void* ResolveSymbol(void* lib_handle, const char* symbol);
 
+ private:
+  // The returned string must be freed.
+  static char* Concatenate(const char** strings);
+
   DISALLOW_ALLOCATION();
   DISALLOW_IMPLICIT_CONSTRUCTORS(Extensions);
 };
diff --git a/runtime/bin/extensions_android.cc b/runtime/bin/extensions_android.cc
index 3d2688b..1b79991 100644
--- a/runtime/bin/extensions_android.cc
+++ b/runtime/bin/extensions_android.cc
@@ -12,6 +12,9 @@
 namespace dart {
 namespace bin {
 
+const char* kPrecompiledLibraryName = "libprecompiled.so";
+const char* kPrecompiledSymbolName = "_kInstructionsSnapshot";
+
 void* Extensions::LoadExtensionLibrary(const char* library_file) {
   return dlopen(library_file, RTLD_LAZY);
 }
diff --git a/runtime/bin/extensions_linux.cc b/runtime/bin/extensions_linux.cc
index c42024a..23ee6ed 100644
--- a/runtime/bin/extensions_linux.cc
+++ b/runtime/bin/extensions_linux.cc
@@ -12,6 +12,9 @@
 namespace dart {
 namespace bin {
 
+const char* kPrecompiledLibraryName = "libprecompiled.so";
+const char* kPrecompiledSymbolName = "_kInstructionsSnapshot";
+
 void* Extensions::LoadExtensionLibrary(const char* library_file) {
   return dlopen(library_file, RTLD_LAZY);
 }
diff --git a/runtime/bin/extensions_macos.cc b/runtime/bin/extensions_macos.cc
index 814f935..92a5e98 100644
--- a/runtime/bin/extensions_macos.cc
+++ b/runtime/bin/extensions_macos.cc
@@ -12,6 +12,9 @@
 namespace dart {
 namespace bin {
 
+const char* kPrecompiledLibraryName = "libprecompiled.dylib";
+const char* kPrecompiledSymbolName = "kInstructionsSnapshot";
+
 void* Extensions::LoadExtensionLibrary(const char* library_file) {
   return dlopen(library_file, RTLD_LAZY);
 }
diff --git a/runtime/bin/extensions_win.cc b/runtime/bin/extensions_win.cc
index 63462ee..8c0a15f 100644
--- a/runtime/bin/extensions_win.cc
+++ b/runtime/bin/extensions_win.cc
@@ -13,6 +13,9 @@
 namespace dart {
 namespace bin {
 
+const char* kPrecompiledLibraryName = "precompiled.dll";
+const char* kPrecompiledSymbolName = "_kInstructionsSnapshot";
+
 void* Extensions::LoadExtensionLibrary(const char* library_file) {
   return LoadLibraryW(StringUtilsWin::Utf8ToWide(library_file));
 }
diff --git a/runtime/bin/file_system_watcher_macos.cc b/runtime/bin/file_system_watcher_macos.cc
index fbecffa5..5c0d430 100644
--- a/runtime/bin/file_system_watcher_macos.cc
+++ b/runtime/bin/file_system_watcher_macos.cc
@@ -7,7 +7,7 @@
 
 #include "bin/file_system_watcher.h"
 
-#if !defined(TARGET_OS_IOS)
+#if !TARGET_OS_IOS
 
 #include <errno.h>  // NOLINT
 #include <fcntl.h>  // NOLINT
@@ -394,7 +394,7 @@
 }  // namespace bin
 }  // namespace dart
 
-#else  // !defined(TARGET_OS_IOS)
+#else  // !TARGET_OS_IOS
 
 namespace dart {
 namespace bin {
@@ -432,6 +432,6 @@
 }  // namespace bin
 }  // namespace dart
 
-#endif  // !defined(TARGET_OS_IOS)
+#endif  // !TARGET_OS_IOS
 
 #endif  // defined(TARGET_OS_MACOS)
diff --git a/runtime/bin/filter.cc b/runtime/bin/filter.cc
index f537606..5e87f62 100644
--- a/runtime/bin/filter.cc
+++ b/runtime/bin/filter.cc
@@ -154,7 +154,14 @@
   uint8_t* buffer = NULL;
   Dart_Handle result = Dart_TypedDataAcquireData(
       data_obj, &type, reinterpret_cast<void**>(&buffer), &length);
+
   if (!Dart_IsError(result)) {
+    ASSERT(type == Dart_TypedData_kUint8 || type == Dart_TypedData_kInt8);
+    if (type != Dart_TypedData_kUint8 && type != Dart_TypedData_kInt8) {
+      Dart_TypedDataReleaseData(data_obj);
+      Dart_ThrowException(DartUtils::NewInternalError(
+          "Invalid argument passed to Filter_Process"));
+    }
     uint8_t* zlib_buffer = new uint8_t[chunk_length];
     if (zlib_buffer == NULL) {
       Dart_TypedDataReleaseData(data_obj);
diff --git a/runtime/bin/gen_snapshot.cc b/runtime/bin/gen_snapshot.cc
index 2f19fb2..72ee0f1 100644
--- a/runtime/bin/gen_snapshot.cc
+++ b/runtime/bin/gen_snapshot.cc
@@ -544,18 +544,19 @@
   // Initialize the Dart VM.
   // Note: We don't expect isolates to be created from dart code during
   // snapshot generation.
-  if (!Dart_Initialize(NULL,
-                       NULL, NULL, NULL, NULL,
-                       DartUtils::OpenFile,
-                       DartUtils::ReadFile,
-                       DartUtils::WriteFile,
-                       DartUtils::CloseFile,
-                       DartUtils::EntropySource)) {
-    Log::PrintErr("VM initialization failed\n");
+  char* error = Dart_Initialize(NULL, NULL,
+      NULL, NULL, NULL, NULL,
+      DartUtils::OpenFile,
+      DartUtils::ReadFile,
+      DartUtils::WriteFile,
+      DartUtils::CloseFile,
+      DartUtils::EntropySource);
+  if (error != NULL) {
+    Log::PrintErr("VM initialization failed: %s\n", error);
+    free(error);
     return 255;
   }
 
-  char* error;
   Dart_Isolate isolate = Dart_CreateIsolate(
       NULL, NULL, NULL, NULL, NULL, &error);
   if (isolate == NULL) {
@@ -593,6 +594,7 @@
     result =
         DartUtils::PrepareForScriptLoading(package_root,
                                            NULL,
+                                           NULL,
                                            false,
                                            false,
                                            builtin_lib);
diff --git a/runtime/bin/io_impl_sources.gypi b/runtime/bin/io_impl_sources.gypi
index 9236ec7..611b458 100644
--- a/runtime/bin/io_impl_sources.gypi
+++ b/runtime/bin/io_impl_sources.gypi
@@ -26,9 +26,9 @@
     'filter_unsupported.cc',
     'io_service.cc',
     'io_service.h',
+    'io_service_no_ssl.cc',
+    'io_service_no_ssl.h',
     'io_service_unsupported.cc',
-    'net/nss_memio.cc',
-    'net/nss_memio.h',
     'platform.cc',
     'platform.h',
     'platform_android.cc',
@@ -41,6 +41,7 @@
     'process_linux.cc',
     'process_macos.cc',
     'process_win.cc',
+    '../../third_party/root_certificates/root_certificates.cc',
     'secure_socket.cc',
     'secure_socket.h',
     'secure_socket_unsupported.cc',
@@ -62,12 +63,15 @@
       'conditions': [
         ['dart_io_secure_socket==1', {
           'sources!' : [
+            'io_service_no_ssl.cc',
+            'io_service_no_ssl.h',
             'secure_socket_unsupported.cc',
           ],
         }, {  # else dart_io_secure_socket == 0
           'sources!' : [
-            'net/nss_memio.cc',
-            'net/nss_memio.h',
+            '../../third_party/root_certificates/root_certificates.cc',
+            'io_service.cc',
+            'io_service.h',
             'secure_socket.cc',
             'secure_socket.h',
           ],
@@ -83,8 +87,9 @@
         'filter.h',
         'io_service.cc',
         'io_service.h',
-        'net/nss_memio.cc',
-        'net/nss_memio.h',
+        'io_service_no_ssl.cc',
+        'io_service_no_ssl.h',
+        '../../third_party/root_certificates/root_certificates.cc',
         'secure_socket.cc',
         'secure_socket.h',
       ],
diff --git a/runtime/bin/io_natives.cc b/runtime/bin/io_natives.cc
index 2be3f34..011e792 100644
--- a/runtime/bin/io_natives.cc
+++ b/runtime/bin/io_natives.cc
@@ -96,17 +96,23 @@
   V(Process_Pid, 1)                                                            \
   V(Process_SetSignalHandler, 1)                                               \
   V(Process_ClearSignalHandler, 1)                                             \
-  V(SecureSocket_Connect, 10)                                                  \
+  V(SecureSocket_Connect, 7)                                                   \
   V(SecureSocket_Destroy, 1)                                                   \
   V(SecureSocket_FilterPointer, 1)                                             \
   V(SecureSocket_GetSelectedProtocol, 1)                                       \
   V(SecureSocket_Handshake, 1)                                                 \
   V(SecureSocket_Init, 1)                                                      \
-  V(SecureSocket_InitializeLibrary, 3)                                         \
   V(SecureSocket_PeerCertificate, 1)                                           \
   V(SecureSocket_RegisterBadCertificateCallback, 2)                            \
   V(SecureSocket_RegisterHandshakeCompleteCallback, 2)                         \
   V(SecureSocket_Renegotiate, 4)                                               \
+  V(SecurityContext_Allocate, 1)                                               \
+  V(SecurityContext_UsePrivateKey, 3)                                          \
+  V(SecurityContext_SetAlpnProtocols, 3)                                       \
+  V(SecurityContext_SetClientAuthorities, 2)                                   \
+  V(SecurityContext_SetTrustedCertificates, 3)                                 \
+  V(SecurityContext_TrustBuiltinRoots, 1)                                      \
+  V(SecurityContext_UseCertificateChain, 2)                                    \
   V(ServerSocket_Accept, 2)                                                    \
   V(ServerSocket_CreateBindListen, 6)                                          \
   V(Socket_CreateConnect, 3)                                                   \
@@ -126,7 +132,6 @@
   V(Socket_SetOption, 4)                                                       \
   V(Socket_JoinMulticast, 4)                                                   \
   V(Socket_LeaveMulticast, 4)                                                  \
-  V(Socket_MarkSocketAsSharedHack, 1)                                          \
   V(Socket_GetSocketId, 1)                                                     \
   V(Socket_SetSocketId, 2)                                                     \
   V(Stdin_ReadByte, 1)                                                         \
@@ -136,8 +141,11 @@
   V(Stdin_SetLineMode, 1)                                                      \
   V(Stdout_GetTerminalSize, 1)                                                 \
   V(StringToSystemEncoding, 1)                                                 \
-  V(SystemEncodingToString, 1)
-
+  V(SystemEncodingToString, 1)                                                 \
+  V(X509_Subject, 1)                                                           \
+  V(X509_Issuer, 1)                                                            \
+  V(X509_StartValidity, 1)                                                     \
+  V(X509_EndValidity, 1)
 
 IO_NATIVE_LIST(DECLARE_FUNCTION);
 
diff --git a/runtime/bin/io_service_no_ssl.cc b/runtime/bin/io_service_no_ssl.cc
new file mode 100644
index 0000000..b63f8c8
--- /dev/null
+++ b/runtime/bin/io_service_no_ssl.cc
@@ -0,0 +1,78 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+#include "bin/dartutils.h"
+#include "bin/directory.h"
+#include "bin/file.h"
+#include "bin/io_buffer.h"
+#include "bin/io_service_no_ssl.h"
+#include "bin/socket.h"
+#include "bin/utils.h"
+
+#include "platform/globals.h"
+#include "platform/utils.h"
+
+#include "include/dart_api.h"
+
+
+namespace dart {
+namespace bin {
+
+#define CASE_REQUEST(type, method, id)                                         \
+  case IOService::k##type##method##Request:                                    \
+    response = type::method##Request(data);                                    \
+    break;
+
+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()) {
+    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);
+      default:
+        UNREACHABLE();
+    }
+  }
+
+  CObjectArray result(CObject::NewArray(2));
+  result.SetAt(0, request[0]);
+  result.SetAt(1, response);
+  ASSERT(reply_port_id != ILLEGAL_PORT);
+  Dart_PostCObject(reply_port_id, result.AsApiCObject());
+}
+
+
+Dart_Port IOService::GetServicePort() {
+  Dart_Port result = Dart_NewNativePort("IOService",
+                                        IOServiceCallback,
+                                        true);
+  return result;
+}
+
+
+void FUNCTION_NAME(IOService_NewServicePort)(Dart_NativeArguments args) {
+  Dart_SetReturnValue(args, Dart_Null());
+  Dart_Port service_port = IOService::GetServicePort();
+  if (service_port != ILLEGAL_PORT) {
+    // Return a send port for the service port.
+    Dart_Handle send_port = Dart_NewSendPort(service_port);
+    Dart_SetReturnValue(args, send_port);
+  }
+}
+
+
+}  // namespace bin
+}  // namespace dart
diff --git a/runtime/bin/io_service_no_ssl.h b/runtime/bin/io_service_no_ssl.h
new file mode 100644
index 0000000..9cc7fc1
--- /dev/null
+++ b/runtime/bin/io_service_no_ssl.h
@@ -0,0 +1,74 @@
+// 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 BIN_IO_SERVICE_NO_SSL_H_
+#define BIN_IO_SERVICE_NO_SSL_H_
+
+#include "bin/builtin.h"
+#include "bin/utils.h"
+
+
+namespace dart {
+namespace bin {
+
+// This list must be kept in sync with the list in sdk/lib/io/io_service.dart
+// In this modified version, though, the request 39 for SSLFilter::ProcessFilter
+// is removed, for use in contexts in which secure sockets are not enabled.
+#define IO_SERVICE_REQUEST_LIST(V)                                             \
+  V(File, Exists, 0)                                                           \
+  V(File, Create, 1)                                                           \
+  V(File, Delete, 2)                                                           \
+  V(File, Rename, 3)                                                           \
+  V(File, Copy, 4)                                                             \
+  V(File, Open, 5)                                                             \
+  V(File, ResolveSymbolicLinks, 6)                                             \
+  V(File, Close, 7)                                                            \
+  V(File, Position, 8)                                                         \
+  V(File, SetPosition, 9)                                                      \
+  V(File, Truncate, 10)                                                        \
+  V(File, Length, 11)                                                          \
+  V(File, LengthFromPath, 12)                                                  \
+  V(File, LastModified, 13)                                                    \
+  V(File, Flush, 14)                                                           \
+  V(File, ReadByte, 15)                                                        \
+  V(File, WriteByte, 16)                                                       \
+  V(File, Read, 17)                                                            \
+  V(File, ReadInto, 18)                                                        \
+  V(File, WriteFrom, 19)                                                       \
+  V(File, CreateLink, 20)                                                      \
+  V(File, DeleteLink, 21)                                                      \
+  V(File, RenameLink, 22)                                                      \
+  V(File, LinkTarget, 23)                                                      \
+  V(File, Type, 24)                                                            \
+  V(File, Identical, 25)                                                       \
+  V(File, Stat, 26)                                                            \
+  V(File, Lock, 27)                                                            \
+  V(Socket, Lookup, 28)                                                        \
+  V(Socket, ListInterfaces, 29)                                                \
+  V(Socket, ReverseLookup, 30)                                                 \
+  V(Directory, Create, 31)                                                     \
+  V(Directory, Delete, 32)                                                     \
+  V(Directory, Exists, 33)                                                     \
+  V(Directory, CreateTemp, 34)                                                 \
+  V(Directory, ListStart, 35)                                                  \
+  V(Directory, ListNext, 36)                                                   \
+  V(Directory, ListStop, 37)                                                   \
+  V(Directory, Rename, 38)
+
+#define DECLARE_REQUEST(type, method, id)                                      \
+  k##type##method##Request = id,
+
+class IOService {
+ public:
+  enum {
+IO_SERVICE_REQUEST_LIST(DECLARE_REQUEST)
+  };
+
+  static Dart_Port GetServicePort();
+};
+
+}  // namespace bin
+}  // namespace dart
+
+#endif  // BIN_IO_SERVICE_NO_SSL_H_
diff --git a/runtime/bin/main.cc b/runtime/bin/main.cc
index 5c36f41..1429ff4e 100644
--- a/runtime/bin/main.cc
+++ b/runtime/bin/main.cc
@@ -73,7 +73,25 @@
 
 // Global flag that is used to indicate that we want to compile all the
 // dart functions before running main and not compile anything thereafter.
-static bool has_precompile = false;
+static bool has_gen_precompiled_snapshot = false;
+
+
+// Global flag that is used to indicate that we want to run from a precompiled
+// snapshot.
+static bool has_run_precompiled_snapshot = false;
+
+
+// Global flag that is used to indicate that we want to compile everything in
+// the same way as precompilation before main, then continue running in the
+// same process.
+static bool has_noopt = false;
+
+
+extern const char* kPrecompiledLibraryName;
+extern const char* kPrecompiledSymbolName;
+static const char* kPrecompiledVmIsolateName = "precompiled.vmisolate";
+static const char* kPrecompiledIsolateName = "precompiled.isolate";
+static const char* kPrecompiledInstructionsName = "precompiled.S";
 
 
 // Global flag that is used to indicate that we want to trace resolution of
@@ -84,7 +102,6 @@
 static const char* DEFAULT_VM_SERVICE_SERVER_IP = "127.0.0.1";
 static const int DEFAULT_VM_SERVICE_SERVER_PORT = 8181;
 // VM Service options.
-static bool start_vm_service = false;
 static const char* vm_service_server_ip = DEFAULT_VM_SERVICE_SERVER_IP;
 // The 0 port is a magic value which results in the first available port
 // being allocated.
@@ -97,7 +114,10 @@
 static const int kCompilationErrorExitCode = 254;
 // Exit code indicating an unhandled error that is not a compilation error.
 static const int kErrorExitCode = 255;
+// Exit code indicating a vm restart request.  Never returned to the user.
+static const int kRestartRequestExitCode = 1000;
 
+extern bool do_vm_shutdown;  // Defined in bin/process.cc
 static void ErrorExit(int exit_code, const char* format, ...) {
   va_list arguments;
   va_start(arguments, format);
@@ -108,8 +128,19 @@
   Dart_ExitScope();
   Dart_ShutdownIsolate();
 
-  Dart_Cleanup();
+  // Terminate process exit-code handler.
+  Process::TerminateExitCodeHandler();
 
+  char* error = Dart_Cleanup();
+  if (error != NULL) {
+    Log::PrintErr("VM cleanup failed: %s\n", error);
+    free(error);
+  }
+
+  if (do_vm_shutdown) {
+    DebuggerConnectionHandler::StopHandler();
+    EventHandler::Stop();
+  }
   exit(exit_code);
 }
 
@@ -289,14 +320,47 @@
 }
 
 
-static bool ProcessPrecompileOption(const char* arg,
-                                    CommandLineOptions* vm_options) {
+static bool ProcessGenPrecompiledSnapshotOption(
+    const char* arg,
+    CommandLineOptions* vm_options) {
   ASSERT(arg != NULL);
   if (*arg != '\0') {
     return false;
   }
-  has_precompile = true;
-  vm_options->AddArgument("--precompile");
+  // Ensure that we are not already running using a full snapshot.
+  if (isolate_snapshot_buffer != NULL) {
+    Log::PrintErr("Precompiled snapshots must be generated with"
+                  " dart_no_snapshot.\n");
+    return false;
+  }
+  has_gen_precompiled_snapshot = true;
+  vm_options->AddArgument("--precompilation");
+  return true;
+}
+
+
+static bool ProcessRunPrecompiledSnapshotOption(
+    const char* arg,
+    CommandLineOptions* vm_options) {
+  ASSERT(arg != NULL);
+  if (*arg != '\0') {
+    return false;
+  }
+  has_run_precompiled_snapshot = true;
+  vm_options->AddArgument("--precompilation");
+  return true;
+}
+
+
+static bool ProcessNooptOption(
+    const char* arg,
+    CommandLineOptions* vm_options) {
+  ASSERT(arg != NULL);
+  if (*arg != '\0') {
+    return false;
+  }
+  has_noopt = true;
+  vm_options->AddArgument("--precompilation");
   return true;
 }
 
@@ -320,7 +384,7 @@
 static bool ProcessGenScriptSnapshotOption(const char* filename,
                                            CommandLineOptions* vm_options) {
   if (filename != NULL && strlen(filename) != 0) {
-    // Ensure that are already running using a full snapshot.
+    // Ensure that we are already running using a full snapshot.
     if (isolate_snapshot_buffer == NULL) {
       Log::PrintErr("Script snapshots cannot be generated in this version of"
                     " dart\n");
@@ -348,7 +412,6 @@
     return false;
   }
 
-  start_vm_service = true;
   return true;
 }
 
@@ -367,8 +430,6 @@
     return false;
   }
 
-  start_vm_service = true;
-
   vm_options->AddArgument("--pause-isolates-on-exit");
   return true;
 }
@@ -395,29 +456,61 @@
 }
 
 
+
+static bool ProcessShutdownOption(const char* arg,
+                                  CommandLineOptions* vm_options) {
+  ASSERT(arg != NULL);
+  if (*arg == '\0') {
+    do_vm_shutdown = true;
+    vm_options->AddArgument("--shutdown");
+    return true;
+  }
+
+  if ((*arg != '=') && (*arg != ':')) {
+    return false;
+  }
+
+  if (strcmp(arg + 1, "true") == 0) {
+    do_vm_shutdown = true;
+    vm_options->AddArgument("--shutdown");
+    return true;
+  } else if (strcmp(arg + 1, "false") == 0) {
+    do_vm_shutdown = false;
+    vm_options->AddArgument("--no-shutdown");
+    return true;
+  }
+
+  return false;
+}
+
+
 static struct {
   const char* option_name;
   bool (*process)(const char* option, CommandLineOptions* vm_options);
 } main_options[] = {
   // Standard options shared with dart2js.
-  { "--version", ProcessVersionOption },
-  { "--help", ProcessHelpOption },
-  { "-h", ProcessHelpOption },
-  { "--verbose", ProcessVerboseOption },
-  { "-v", ProcessVerboseOption },
-  { "--package-root=", ProcessPackageRootOption },
-  { "--packages=", ProcessPackagesOption },
   { "-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.
   { "--break-at=", ProcessBreakpointOption },
   { "--compile_all", ProcessCompileAllOption },
-  { "--precompile", ProcessPrecompileOption },
   { "--debug", ProcessDebugOption },
-  { "--snapshot=", ProcessGenScriptSnapshotOption },
   { "--enable-vm-service", ProcessEnableVmServiceOption },
+  { "--gen-precompiled-snapshot", ProcessGenPrecompiledSnapshotOption },
+  { "--noopt", ProcessNooptOption },
   { "--observe", ProcessObserveOption },
+  { "--run-precompiled-snapshot", ProcessRunPrecompiledSnapshotOption },
+  { "--shutdown", ProcessShutdownOption },
+  { "--snapshot=", ProcessGenScriptSnapshotOption },
   { "--trace-debug-protocol", ProcessTraceDebugProtocolOption },
-  { "--trace-loading", ProcessTraceLoadingOption},
+  { "--trace-loading", ProcessTraceLoadingOption },
   { NULL, NULL }
 };
 
@@ -594,8 +687,15 @@
 #define CHECK_RESULT(result)                                                   \
   if (Dart_IsError(result)) {                                                  \
     *error = strdup(Dart_GetError(result));                                    \
-    *exit_code = Dart_IsCompilationError(result) ? kCompilationErrorExitCode : \
-        (Dart_IsApiError(result) ? kApiErrorExitCode : kErrorExitCode);        \
+    if (Dart_IsCompilationError(result)) {                                     \
+      *exit_code = kCompilationErrorExitCode;                                  \
+    } else if (Dart_IsApiError(result)) {                                      \
+      *exit_code = kApiErrorExitCode;                                          \
+    } else if (Dart_IsVMRestartRequest(result)) {                              \
+      *exit_code = kRestartRequestExitCode;                                    \
+    } else {                                                                   \
+      *exit_code = kErrorExitCode;                                             \
+    }                                                                          \
     Dart_ExitScope();                                                          \
     Dart_ShutdownIsolate();                                                    \
     return NULL;                                                               \
@@ -606,6 +706,7 @@
 static Dart_Isolate CreateIsolateAndSetupHelper(const char* script_uri,
                                                 const char* main,
                                                 const char* package_root,
+                                                const char** package_map,
                                                 const char* packages_file,
                                                 Dart_IsolateFlags* flags,
                                                 char** error,
@@ -624,6 +725,7 @@
                                error);
 
   if (isolate == NULL) {
+    delete isolate_data;
     return NULL;
   }
 
@@ -645,10 +747,7 @@
       *error = strdup(VmService::GetErrorMessage());
       return NULL;
     }
-    if (has_precompile) {
-      result = Dart_Precompile();
-      CHECK_RESULT(result);
-    } else if (has_compile_all) {
+    if (has_compile_all) {
       result = Dart_CompileAll();
       CHECK_RESULT(result);
     }
@@ -669,6 +768,7 @@
   // Prepare for script loading by setting up the 'print' and 'timer'
   // closures and setting up 'package root' for URI resolution.
   result = DartUtils::PrepareForScriptLoading(package_root,
+                                              package_map,
                                               packages_file,
                                               false,
                                               has_trace_loading,
@@ -678,17 +778,24 @@
   result = Dart_SetEnvironmentCallback(EnvironmentCallback);
   CHECK_RESULT(result);
 
-  // Load the script.
-  result = DartUtils::LoadScript(script_uri, builtin_lib);
-  CHECK_RESULT(result);
+  if (!has_run_precompiled_snapshot) {
+    // Load the script.
+    result = DartUtils::LoadScript(script_uri, builtin_lib);
+    CHECK_RESULT(result);
 
-  // Run event-loop and wait for script loading to complete.
-  result = Dart_RunLoop();
-  CHECK_RESULT(result);
+    // Run event-loop and wait for script loading to complete.
+    result = Dart_RunLoop();
+    CHECK_RESULT(result);
 
-  Platform::SetPackageRoot(package_root);
+    if (isolate_data->load_async_id >= 0) {
+      Dart_TimelineAsyncEnd("LoadScript", isolate_data->load_async_id);
+    }
 
-  DartUtils::SetupIOLibrary(script_uri);
+    Platform::SetPackageRoot(package_root);
+
+    result = DartUtils::SetupIOLibrary(script_uri);
+    CHECK_RESULT(result);
+  }
 
   // Make the isolate runnable so that it is ready to handle messages.
   Dart_ExitScope();
@@ -706,16 +813,22 @@
 
 #undef CHECK_RESULT
 
+
 static Dart_Isolate CreateIsolateAndSetup(const char* script_uri,
                                           const char* main,
                                           const char* package_root,
+                                          const char** package_map,
                                           Dart_IsolateFlags* flags,
                                           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_map != NULL)) {
+    *error = strdup("Invalid arguments - Cannot simultaneously specify "
+                    "package root and package map.");
+    return NULL;
+  }
   IsolateData* parent_isolate_data = reinterpret_cast<IsolateData*>(data);
-  int exit_code = 0;
   if (script_uri == NULL) {
     if (data == NULL) {
       *error = strdup("Invalid 'callback_data' - Unable to spawn new isolate");
@@ -728,15 +841,20 @@
     }
   }
   const char* packages_file = NULL;
-  if (package_root == NULL) {
+  // If neither a package root nor a package map are requested pass on the
+  // inherited values.
+  if ((package_root == NULL) && (package_map == NULL)) {
     if (parent_isolate_data != NULL) {
       package_root = parent_isolate_data->package_root;
       packages_file = parent_isolate_data->packages_file;
     }
   }
+
+  int exit_code = 0;
   return CreateIsolateAndSetupHelper(script_uri,
                                      main,
                                      package_root,
+                                     package_map,
                                      packages_file,
                                      flags,
                                      error,
@@ -811,9 +929,6 @@
 "  enables the VM service and listens on specified port for connections\n"
 "  (default port number is 8181)\n"
 "\n"
-"--noopt\n"
-"  run unoptimized code only\n"
-"\n"
 "The following options are only used for VM development and may\n"
 "be changed in any future version:\n");
     const char* print_flags = "--print_flags";
@@ -857,16 +972,6 @@
   return buffer;
 }
 
-static void DartExitOnError(Dart_Handle error) {
-  if (!Dart_IsError(error)) {
-    return;
-  }
-  const int exit_code = Dart_IsCompilationError(error) ?
-      kCompilationErrorExitCode : kErrorExitCode;
-  ErrorExit(exit_code, "%s\n", Dart_GetError(error));
-}
-
-
 static void ShutdownIsolate(void* callback_data) {
   IsolateData* isolate_data = reinterpret_cast<IsolateData*>(callback_data);
   delete isolate_data;
@@ -955,6 +1060,259 @@
 }
 
 
+static void WriteSnapshotFile(const char* filename,
+                              const uint8_t* buffer,
+                              const intptr_t size) {
+  File* file = File::Open(filename, File::kWriteTruncate);
+  ASSERT(file != NULL);
+  if (!file->WriteFully(buffer, size)) {
+    ErrorExit(kErrorExitCode,
+              "Unable to open file %s for writing snapshot\n",
+              filename);
+  }
+  delete file;
+}
+
+
+static void ReadSnapshotFile(const char* filename,
+                             const uint8_t** buffer) {
+  void* file = DartUtils::OpenFile(filename, false);
+  if (file == NULL) {
+    ErrorExit(kErrorExitCode,
+              "Error: Unable to open file %s for reading snapshot\n", filename);
+  }
+  intptr_t len = -1;
+  DartUtils::ReadFile(buffer, &len, file);
+  if (*buffer == NULL || len == -1) {
+    ErrorExit(kErrorExitCode,
+              "Error: Unable to read snapshot file %s\n", filename);
+  }
+  DartUtils::CloseFile(file);
+}
+
+
+static void* LoadLibrarySymbol(const char* libname, const char* symname) {
+  void* library = Extensions::LoadExtensionLibrary(libname);
+  if (library == NULL) {
+    Log::PrintErr("Error: Failed to load library '%s'\n", libname);
+    exit(kErrorExitCode);
+  }
+  void* symbol = Extensions::ResolveSymbol(library, symname);
+  if (symbol == NULL) {
+    Log::PrintErr("Error: Failed to load symbol '%s'\n", symname);
+    exit(kErrorExitCode);
+  }
+  return symbol;
+}
+
+
+#define CHECK_RESULT(result)                                                   \
+  if (Dart_IsError(result)) {                                                  \
+    if (Dart_IsVMRestartRequest(result)) {                                     \
+      Dart_ExitScope();                                                        \
+      Dart_ShutdownIsolate();                                                  \
+      return true;                                                             \
+    }                                                                          \
+    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) {
+  // 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,
+                                                     NULL,
+                                                     commandline_packages_file,
+                                                     NULL,
+                                                     &error,
+                                                     &exit_code);
+  if (isolate == NULL) {
+    delete [] isolate_name;
+    if (exit_code == kRestartRequestExitCode) {
+      free(error);
+      return true;
+    }
+    Log::PrintErr("%s\n", error);
+    free(error);
+    error = NULL;
+    Process::TerminateExitCodeHandler();
+    error = Dart_Cleanup();
+    if (error != NULL) {
+      Log::PrintErr("VM cleanup failed: %s\n", error);
+      free(error);
+    }
+    if (do_vm_shutdown) {
+      DebuggerConnectionHandler::StopHandler();
+      EventHandler::Stop();
+    }
+    exit((exit_code != 0) ? exit_code : kErrorExitCode);
+  }
+  delete [] isolate_name;
+
+  Dart_EnterIsolate(isolate);
+  ASSERT(isolate == Dart_CurrentIsolate());
+  ASSERT(isolate != NULL);
+  Dart_Handle result;
+
+  Dart_EnterScope();
+
+  if (generate_script_snapshot) {
+    // First create a snapshot.
+    Dart_Handle result;
+    uint8_t* buffer = NULL;
+    intptr_t size = 0;
+    result = Dart_CreateScriptSnapshot(&buffer, &size);
+    CHECK_RESULT(result);
+
+    // Open the snapshot file.
+    File* snapshot_file = File::Open(snapshot_filename, File::kWriteTruncate);
+    if (snapshot_file == NULL) {
+      ErrorExit(kErrorExitCode,
+                "Unable to open file %s for writing the snapshot\n",
+                snapshot_filename);
+    }
+
+    // Write the magic number to indicate file is a script snapshot.
+    DartUtils::WriteMagicNumber(snapshot_file);
+
+    // Now write the snapshot out to specified file.
+    bool bytes_written = snapshot_file->WriteFully(buffer, size);
+    ASSERT(bytes_written);
+    delete snapshot_file;
+    snapshot_file = NULL;
+  } else {
+    // Lookup the library of the root script.
+    Dart_Handle root_lib = Dart_RootLibrary();
+    // Import the root library into the builtin library so that we can easily
+    // lookup the main entry point exported from the root library.
+    Dart_Handle builtin_lib =
+        Builtin::LoadAndCheckLibrary(Builtin::kBuiltinLibrary);
+    ASSERT(!Dart_IsError(builtin_lib));
+    result = Dart_LibraryImportLibrary(builtin_lib, root_lib, Dart_Null());
+
+    if (has_noopt || has_gen_precompiled_snapshot) {
+      Dart_QualifiedFunctionName standalone_entry_points[] = {
+        { "dart:_builtin", "::", "_getMainClosure" },
+        { "dart:_builtin", "::", "_getPrintClosure" },
+        { "dart:_builtin", "::", "_getUriBaseClosure" },
+        { "dart:_builtin", "::", "_resolveUri" },
+        { "dart:_builtin", "::", "_setWorkingDirectory" },
+        { "dart:_builtin", "::", "_loadDataAsync" },
+        { "dart:io", "::", "_makeUint8ListView" },
+        { "dart:io", "::", "_makeDatagram" },
+        { "dart:io", "::", "_setupHooks" },
+        { "dart:io", "CertificateException", "CertificateException." },
+        { "dart:io", "HandshakeException", "HandshakeException." },
+        { "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", "::", "_addResource" },
+        { "dart:vmservice_io", "::", "main" },
+        { NULL, NULL, NULL }  // Must be terminated with NULL entries.
+      };
+
+      const bool reset_fields = has_gen_precompiled_snapshot;
+      result = Dart_Precompile(standalone_entry_points, reset_fields);
+      CHECK_RESULT(result);
+    }
+
+    if (has_gen_precompiled_snapshot) {
+      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_buffer = NULL;
+      intptr_t instructions_size = 0;
+      result = Dart_CreatePrecompiledSnapshot(&vm_isolate_buffer,
+                                              &vm_isolate_size,
+                                              &isolate_buffer,
+                                              &isolate_size,
+                                              &instructions_buffer,
+                                              &instructions_size);
+      CHECK_RESULT(result);
+      WriteSnapshotFile(kPrecompiledVmIsolateName,
+                        vm_isolate_buffer,
+                        vm_isolate_size);
+      WriteSnapshotFile(kPrecompiledIsolateName,
+                        isolate_buffer,
+                        isolate_size);
+      WriteSnapshotFile(kPrecompiledInstructionsName,
+                        instructions_buffer,
+                        instructions_size);
+    } else {
+      if (has_compile_all) {
+        result = Dart_CompileAll();
+        CHECK_RESULT(result);
+      }
+
+      if (Dart_IsNull(root_lib)) {
+        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(builtin_lib,
+          Dart_NewStringFromCString("_getMainClosure"), 0, NULL);
+      CHECK_RESULT(main_closure);
+
+      // Set debug breakpoint if specified on the command line before calling
+      // the main function.
+      if (breakpoint_at != NULL) {
+        result = SetBreakpoint(breakpoint_at, root_lib);
+        if (Dart_IsError(result)) {
+          ErrorExit(kErrorExitCode,
+                    "Error setting breakpoint at '%s': %s\n",
+                    breakpoint_at,
+                    Dart_GetError(result));
+        }
+      }
+
+      // Call _startIsolate in the isolate library to enable dispatching the
+      // initial startup message.
+      const intptr_t kNumIsolateArgs = 2;
+      Dart_Handle isolate_args[kNumIsolateArgs];
+      isolate_args[0] = main_closure;                        // entryPoint
+      isolate_args[1] = CreateRuntimeOptions(dart_options);  // args
+
+      Dart_Handle isolate_lib =
+          Dart_LookupLibrary(Dart_NewStringFromCString("dart:isolate"));
+      result = Dart_Invoke(isolate_lib,
+                           Dart_NewStringFromCString("_startMainIsolate"),
+                           kNumIsolateArgs, isolate_args);
+      CHECK_RESULT(result);
+
+      // Keep handling messages until the last active receive port is closed.
+      result = Dart_RunLoop();
+      CHECK_RESULT(result);
+    }
+  }
+
+  Dart_ExitScope();
+  // Shutdown the isolate.
+  Dart_ShutdownIsolate();
+
+  // No restart.
+  return false;
+}
+
+#undef CHECK_RESULT
+
+
 void main(int argc, char** argv) {
   char* script_name;
   const int EXTRA_VM_ARGUMENTS = 2;
@@ -1028,16 +1386,31 @@
     DebuggerConnectionHandler::InitForVmService();
   }
 
+  const uint8_t* instructions_snapshot = NULL;
+  if (has_run_precompiled_snapshot) {
+    instructions_snapshot = reinterpret_cast<const uint8_t*>(
+        LoadLibrarySymbol(kPrecompiledLibraryName, kPrecompiledSymbolName));
+    ReadSnapshotFile(kPrecompiledVmIsolateName, &vm_isolate_snapshot_buffer);
+    ReadSnapshotFile(kPrecompiledIsolateName, &isolate_snapshot_buffer);
+  }
+
   // Initialize the Dart VM.
-  if (!Dart_Initialize(vm_isolate_snapshot_buffer,
-                       CreateIsolateAndSetup, NULL, NULL, ShutdownIsolate,
-                       DartUtils::OpenFile,
-                       DartUtils::ReadFile,
-                       DartUtils::WriteFile,
-                       DartUtils::CloseFile,
-                       DartUtils::EntropySource)) {
-    fprintf(stderr, "%s", "VM initialization failed\n");
+  char* error = Dart_Initialize(
+      vm_isolate_snapshot_buffer, instructions_snapshot,
+      CreateIsolateAndSetup, NULL, NULL, ShutdownIsolate,
+      DartUtils::OpenFile,
+      DartUtils::ReadFile,
+      DartUtils::WriteFile,
+      DartUtils::CloseFile,
+      DartUtils::EntropySource);
+  if (error != NULL) {
+    if (do_vm_shutdown) {
+      DebuggerConnectionHandler::StopHandler();
+      EventHandler::Stop();
+    }
+    fprintf(stderr, "VM initialization failed: %s\n", error);
     fflush(stderr);
+    free(error);
     exit(kErrorExitCode);
   }
 
@@ -1046,126 +1419,23 @@
   Dart_SetServiceStreamCallbacks(&ServiceStreamListenCallback,
                                  &ServiceStreamCancelCallback);
 
-  // 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);
-  if (isolate == NULL) {
-    Log::PrintErr("%s\n", error);
-    free(error);
-    delete [] isolate_name;
-    exit((exit_code != 0) ? exit_code : kErrorExitCode);
-  }
-  delete [] isolate_name;
-
-  Dart_EnterIsolate(isolate);
-  ASSERT(isolate == Dart_CurrentIsolate());
-  ASSERT(isolate != NULL);
-  Dart_Handle result;
-
-  Dart_EnterScope();
-
-  if (generate_script_snapshot) {
-    // First create a snapshot.
-    Dart_Handle result;
-    uint8_t* buffer = NULL;
-    intptr_t size = 0;
-    result = Dart_CreateScriptSnapshot(&buffer, &size);
-    DartExitOnError(result);
-
-    // Open the snapshot file.
-    File* snapshot_file = File::Open(snapshot_filename, File::kWriteTruncate);
-    if (snapshot_file == NULL) {
-      ErrorExit(kErrorExitCode,
-                "Unable to open file %s for writing the snapshot\n",
-                snapshot_filename);
-    }
-
-    // Write the magic number to indicate file is a script snapshot.
-    DartUtils::WriteMagicNumber(snapshot_file);
-
-    // Now write the snapshot out to specified file.
-    bool bytes_written = snapshot_file->WriteFully(buffer, size);
-    ASSERT(bytes_written);
-    delete snapshot_file;
-    snapshot_file = NULL;
-  } else {
-    // Lookup the library of the root script.
-    Dart_Handle root_lib = Dart_RootLibrary();
-    // Import the root library into the builtin library so that we can easily
-    // lookup the main entry point exported from the root library.
-    Dart_Handle builtin_lib =
-        Builtin::LoadAndCheckLibrary(Builtin::kBuiltinLibrary);
-    ASSERT(!Dart_IsError(builtin_lib));
-    result = Dart_LibraryImportLibrary(builtin_lib, root_lib, Dart_Null());
-
-    if (has_precompile) {
-      result = Dart_Precompile();
-      DartExitOnError(result);
-    } else if (has_compile_all) {
-      result = Dart_CompileAll();
-      DartExitOnError(result);
-    }
-
-    if (Dart_IsNull(root_lib)) {
-      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(
-        builtin_lib, Dart_NewStringFromCString("_getMainClosure"), 0, NULL);
-    DartExitOnError(main_closure);
-
-    // Set debug breakpoint if specified on the command line before calling
-    // the main function.
-    if (breakpoint_at != NULL) {
-      result = SetBreakpoint(breakpoint_at, root_lib);
-      if (Dart_IsError(result)) {
-        ErrorExit(kErrorExitCode,
-                  "Error setting breakpoint at '%s': %s\n",
-                  breakpoint_at,
-                  Dart_GetError(result));
-      }
-    }
-
-    // Call _startIsolate in the isolate library to enable dispatching the
-    // initial startup message.
-    const intptr_t kNumIsolateArgs = 2;
-    Dart_Handle isolate_args[kNumIsolateArgs];
-    isolate_args[0] = main_closure;                         // entryPoint
-    isolate_args[1] = CreateRuntimeOptions(&dart_options);  // args
-
-    Dart_Handle isolate_lib = Dart_LookupLibrary(
-        Dart_NewStringFromCString("dart:isolate"));
-    result = Dart_Invoke(isolate_lib,
-                         Dart_NewStringFromCString("_startMainIsolate"),
-                         kNumIsolateArgs, isolate_args);
-    DartExitOnError(result);
-
-    // Keep handling messages until the last active receive port is closed.
-    result = Dart_RunLoop();
-    DartExitOnError(result);
+  // Run the main isolate until we aren't told to restart.
+  while (RunMainIsolate(script_name, &dart_options)) {
+    Log::PrintErr("Restarting VM\n");
   }
 
-  Dart_ExitScope();
-  // Shutdown the isolate.
-  Dart_ShutdownIsolate();
   // Terminate process exit-code handler.
   Process::TerminateExitCodeHandler();
 
-  Dart_Cleanup();
+  error = Dart_Cleanup();
+  if (error != NULL) {
+    Log::PrintErr("VM cleanup failed: %s\n", error);
+    free(error);
+  }
+  if (do_vm_shutdown) {
+    DebuggerConnectionHandler::StopHandler();
+    EventHandler::Stop();
+  }
 
   // Free copied argument strings if converted.
   if (argv_converted) {
diff --git a/runtime/bin/net/.gitignore b/runtime/bin/net/.gitignore
deleted file mode 100644
index 3ca2cc5..0000000
--- a/runtime/bin/net/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-/*.Makefile
-/*.sln
-/*.target.mk
-/*.vcproj
-/*.vcxproj
-/*.vcxproj.filters
-/*.vcxproj.user
-/*.xcodeproj
diff --git a/runtime/bin/net/README-updating b/runtime/bin/net/README-updating
deleted file mode 100644
index 9b0375e..0000000
--- a/runtime/bin/net/README-updating
+++ /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.
-
-The standalone Dart executable uses the NSS library from Mozilla to
-support secure networking connections (SSL and TLS).  It uses a copy
-of the library from the Chromium repository, that includes patches
-added by Chromium.  We pin this to a fixed revision, using the
-nss_revision variable in all the DEPS files in the deps directory of
-the Dart repository.
-
-This revision should be updated when new security fixes are added to
-NSS, or every few months.  The .gyp files in this directory are copies
-of the .gyp files in the Chromium copy of NSS, with changes made to
-account for the configurations and directory structure of the Dart
-repository.  Differences between the Chromium versions and the Dart
-versions should be annotated with "# Added by Dart'.
-
-All the files should have a comment saying where the original file is
-in the Chromium repository. To update these files, look at the diff
-between the two revisions in Chromium, and apply the changes manually,
-with any needed modifications, to the Dart copies.  Our aim is to keep
-the difference between the Chromium and Dart copies as small as
-possible.
-
-The nss_memio.cc and nss_memio.h files are also taken from Chromium,
-and should be updated at the same time.  The os_Linux.s file is new,
-and should not need changing.
-
-The file nss.gyp includes support for disabling compilation of NSS
-using the variable dart_io_support, when building configurations that
-don't use it.  NSS compilation is disabled when building Dartium,
-because Chromium includes its own copy, and the build process would
-get confused.
diff --git a/runtime/bin/net/nss.gyp b/runtime/bin/net/nss.gyp
deleted file mode 100644
index eb1c726..0000000
--- a/runtime/bin/net/nss.gyp
+++ /dev/null
@@ -1,1400 +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.
-
-# Copyright (c) 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 file is a modified copy of Chromium's deps/third_party/nss/nss.gyp.
-# Revision 291806 (this should agree with "nss_rev" in DEPS).
-{
-  # Added by Dart. All Dart comments refer to the following block or line.
-  'includes': [
-    '../../tools/gyp/runtime-configurations.gypi',
-    '../../tools/gyp/nss_configurations.gypi',
-  ],
-  'variables': {
-    # Added by Dart.
-    'nss_directory': '../../../third_party/nss',
-    'conditions': [
-      ['OS=="ios"', {
-        'exclude_nss_root_certs%': 0,
-        'exclude_nss_libpkix%': 0,
-      }, {
-        'exclude_nss_root_certs%': 1,
-        'exclude_nss_libpkix%': 1,
-      }],
-    ],
-  },
-  'target_defaults': {
-    'configurations': {
-      'Debug': {
-        'defines': [
-          'DEBUG',
-          '_DEBUG',
-        ],
-      },
-      'Release': {
-        'defines': [
-          'NDEBUG',
-        ],
-      },
-      # Added by Dart.
-      'Dart_ia32_Base': {
-        'defines': [
-          'NSS_X86_OR_X64',
-          'NSS_X86',
-          '_X86_',
-        ],
-      },
-      # Added by Dart.
-      'Dart_x64_Base': {
-        'defines': [
-          'NSS_X86_OR_X64',
-          'NSS_X64',
-          'NSS_USE_64',
-        ],
-      },
-      # Added by Dart.
-      'Dart_simarm64_Base': {
-        'defines': [
-          'NSS_X86_OR_X64',
-          'NSS_X64',
-          'NSS_USE_64',
-        ],
-      },
-      'Dart_arm64_Base': {
-        'defines': [
-          'NSS_USE_64',
-        ],
-      },
-    },
-    'conditions': [
-      ['OS=="win"', {
-        'configurations': {
-          'Common_Base': {
-            'msvs_configuration_attributes': {
-              # Do not compile NSPR and NSS with /D _UNICODE /D UNICODE.
-              'CharacterSet': '0'
-            }
-          },
-          # Added by Dart. All target_arch specific defines are taken
-          # from below.
-          'Dart_ia32_Base': {
-            'defines': [
-              'NSS_X86_OR_X64',
-              'NSS_X86',
-              '_X86_',
-              'MP_ASSEMBLY_MULTIPLY',
-              'MP_ASSEMBLY_SQUARE',
-              'MP_ASSEMBLY_DIV_2DX1D',
-              'MP_USE_UINT_DIGIT',
-              'MP_NO_MP_WORD',
-            ],
-          },
-          'Dart_x64_Base': {
-            'defines': [
-              'NSS_USE_64',
-              'NSS_X86_OR_X64',
-              'NSS_X64',
-              '_AMD64_',
-              'MP_CHAR_STORE_SLOW',
-              'MP_IS_LITTLE_ENDIAN',
-              'WIN64',
-            ],
-          },
-        },
-        'defines!': [
-          'WIN32_LEAN_AND_MEAN',
-        ],
-      }],
-    ],
-  },
-  # Added by Dart.  We do not indent, so diffs with the original are clearer.
-  'conditions': [[ 'dart_io_support==1', {
-  'targets': [
-    {
-      'target_name': 'nspr_dart',  # Added by Dart (the _dart postfix)
-      'product_name': 'crnspr',
-      'type': '<(component)',
-      'toolsets':['host','target'],
-      # Changed by Dart: '<(nss_directory)/' added to all paths.
-      'sources': [
-        # Added by Dart.
-        'os_linux.S',
-        '<(nss_directory)/nspr/lib/ds/plarena.c',
-        '<(nss_directory)/nspr/lib/ds/plarena.h',
-        '<(nss_directory)/nspr/lib/ds/plarenas.h',
-        '<(nss_directory)/nspr/lib/ds/plhash.c',
-        '<(nss_directory)/nspr/lib/ds/plhash.h',
-        '<(nss_directory)/nspr/lib/libc/include/plbase64.h',
-        '<(nss_directory)/nspr/lib/libc/include/plerror.h',
-        '<(nss_directory)/nspr/lib/libc/include/plgetopt.h',
-        '<(nss_directory)/nspr/lib/libc/include/plstr.h',
-        '<(nss_directory)/nspr/lib/libc/src/base64.c',
-        '<(nss_directory)/nspr/lib/libc/src/plerror.c',
-        '<(nss_directory)/nspr/lib/libc/src/plgetopt.c',
-        '<(nss_directory)/nspr/lib/libc/src/strcase.c',
-        '<(nss_directory)/nspr/lib/libc/src/strcat.c',
-        '<(nss_directory)/nspr/lib/libc/src/strchr.c',
-        '<(nss_directory)/nspr/lib/libc/src/strcmp.c',
-        '<(nss_directory)/nspr/lib/libc/src/strcpy.c',
-        '<(nss_directory)/nspr/lib/libc/src/strdup.c',
-        '<(nss_directory)/nspr/lib/libc/src/strlen.c',
-        '<(nss_directory)/nspr/lib/libc/src/strpbrk.c',
-        '<(nss_directory)/nspr/lib/libc/src/strstr.c',
-        '<(nss_directory)/nspr/lib/libc/src/strtok.c',
-        '<(nss_directory)/nspr/pr/include/md/prosdep.h',
-        '<(nss_directory)/nspr/pr/include/md/_darwin.cfg',
-        '<(nss_directory)/nspr/pr/include/md/_darwin.h',
-        # Added by Dart.
-        '<(nss_directory)/nspr/pr/include/md/_linux.cfg',
-        # Added by Dart.
-        '<(nss_directory)/nspr/pr/include/md/_linux.h',
-        '<(nss_directory)/nspr/pr/include/md/_pcos.h',
-        '<(nss_directory)/nspr/pr/include/md/_pth.h',
-        '<(nss_directory)/nspr/pr/include/md/_unixos.h',
-        '<(nss_directory)/nspr/pr/include/md/_unix_errors.h',
-        '<(nss_directory)/nspr/pr/include/md/_win32_errors.h',
-        '<(nss_directory)/nspr/pr/include/md/_win95.cfg',
-        '<(nss_directory)/nspr/pr/include/md/_win95.h',
-        '<(nss_directory)/nspr/pr/include/nspr.h',
-        '<(nss_directory)/nspr/pr/include/obsolete/pralarm.h',
-        '<(nss_directory)/nspr/pr/include/obsolete/probslet.h',
-        '<(nss_directory)/nspr/pr/include/obsolete/protypes.h',
-        '<(nss_directory)/nspr/pr/include/obsolete/prsem.h',
-        '<(nss_directory)/nspr/pr/include/pratom.h',
-        '<(nss_directory)/nspr/pr/include/prbit.h',
-        '<(nss_directory)/nspr/pr/include/prclist.h',
-        '<(nss_directory)/nspr/pr/include/prcmon.h',
-        '<(nss_directory)/nspr/pr/include/prcountr.h',
-        '<(nss_directory)/nspr/pr/include/prcpucfg.h',
-        '<(nss_directory)/nspr/pr/include/prcvar.h',
-        '<(nss_directory)/nspr/pr/include/prdtoa.h',
-        '<(nss_directory)/nspr/pr/include/prenv.h',
-        '<(nss_directory)/nspr/pr/include/prerr.h',
-        '<(nss_directory)/nspr/pr/include/prerror.h',
-        '<(nss_directory)/nspr/pr/include/prinet.h',
-        '<(nss_directory)/nspr/pr/include/prinit.h',
-        '<(nss_directory)/nspr/pr/include/prinrval.h',
-        '<(nss_directory)/nspr/pr/include/prio.h',
-        '<(nss_directory)/nspr/pr/include/pripcsem.h',
-        '<(nss_directory)/nspr/pr/include/private/pprio.h',
-        '<(nss_directory)/nspr/pr/include/private/pprmwait.h',
-        '<(nss_directory)/nspr/pr/include/private/pprthred.h',
-        '<(nss_directory)/nspr/pr/include/private/primpl.h',
-        '<(nss_directory)/nspr/pr/include/private/prpriv.h',
-        '<(nss_directory)/nspr/pr/include/prlink.h',
-        '<(nss_directory)/nspr/pr/include/prlock.h',
-        '<(nss_directory)/nspr/pr/include/prlog.h',
-        '<(nss_directory)/nspr/pr/include/prlong.h',
-        '<(nss_directory)/nspr/pr/include/prmem.h',
-        '<(nss_directory)/nspr/pr/include/prmon.h',
-        '<(nss_directory)/nspr/pr/include/prmwait.h',
-        '<(nss_directory)/nspr/pr/include/prnetdb.h',
-        '<(nss_directory)/nspr/pr/include/prolock.h',
-        '<(nss_directory)/nspr/pr/include/prpdce.h',
-        '<(nss_directory)/nspr/pr/include/prprf.h',
-        '<(nss_directory)/nspr/pr/include/prproces.h',
-        '<(nss_directory)/nspr/pr/include/prrng.h',
-        '<(nss_directory)/nspr/pr/include/prrwlock.h',
-        '<(nss_directory)/nspr/pr/include/prshm.h',
-        '<(nss_directory)/nspr/pr/include/prshma.h',
-        '<(nss_directory)/nspr/pr/include/prsystem.h',
-        '<(nss_directory)/nspr/pr/include/prthread.h',
-        '<(nss_directory)/nspr/pr/include/prtime.h',
-        '<(nss_directory)/nspr/pr/include/prtpool.h',
-        '<(nss_directory)/nspr/pr/include/prtrace.h',
-        '<(nss_directory)/nspr/pr/include/prtypes.h',
-        '<(nss_directory)/nspr/pr/include/prvrsion.h',
-        '<(nss_directory)/nspr/pr/include/prwin16.h',
-        '<(nss_directory)/nspr/pr/src/io/prdir.c',
-        '<(nss_directory)/nspr/pr/src/io/prfdcach.c',
-        '<(nss_directory)/nspr/pr/src/io/prfile.c',
-        '<(nss_directory)/nspr/pr/src/io/prio.c',
-        '<(nss_directory)/nspr/pr/src/io/priometh.c',
-        '<(nss_directory)/nspr/pr/src/io/pripv6.c',
-        '<(nss_directory)/nspr/pr/src/io/prlayer.c',
-        '<(nss_directory)/nspr/pr/src/io/prlog.c',
-        '<(nss_directory)/nspr/pr/src/io/prmapopt.c',
-        '<(nss_directory)/nspr/pr/src/io/prmmap.c',
-        '<(nss_directory)/nspr/pr/src/io/prmwait.c',
-        '<(nss_directory)/nspr/pr/src/io/prpolevt.c',
-        '<(nss_directory)/nspr/pr/src/io/prprf.c',
-        '<(nss_directory)/nspr/pr/src/io/prscanf.c',
-        '<(nss_directory)/nspr/pr/src/io/prsocket.c',
-        '<(nss_directory)/nspr/pr/src/io/prstdio.c',
-        '<(nss_directory)/nspr/pr/src/linking/prlink.c',
-        '<(nss_directory)/nspr/pr/src/malloc/prmalloc.c',
-        '<(nss_directory)/nspr/pr/src/malloc/prmem.c',
-        '<(nss_directory)/nspr/pr/src/md/prosdep.c',
-        '<(nss_directory)/nspr/pr/src/md/unix/darwin.c',
-        # Added by Dart.
-        '<(nss_directory)/nspr/pr/src/md/unix/linux.c',
-        '<(nss_directory)/nspr/pr/src/md/unix/os_Darwin.s',
-        '<(nss_directory)/nspr/pr/src/md/unix/os_Darwin_x86.s',
-        '<(nss_directory)/nspr/pr/src/md/unix/os_Darwin_x86_64.s',
-        # Added by Dart.
-        '<(nss_directory)/nspr/pr/src/md/unix/os_Linux_x86.s',
-        # Added by Dart.
-        '<(nss_directory)/nspr/pr/src/md/unix/os_Linux_x86_64.s',
-        '<(nss_directory)/nspr/pr/src/md/unix/unix.c',
-        '<(nss_directory)/nspr/pr/src/md/unix/unix_errors.c',
-        '<(nss_directory)/nspr/pr/src/md/unix/uxproces.c',
-        '<(nss_directory)/nspr/pr/src/md/unix/uxrng.c',
-        '<(nss_directory)/nspr/pr/src/md/unix/uxshm.c',
-        '<(nss_directory)/nspr/pr/src/md/unix/uxwrap.c',
-        '<(nss_directory)/nspr/pr/src/md/windows/ntgc.c',
-        '<(nss_directory)/nspr/pr/src/md/windows/ntinrval.c',
-        '<(nss_directory)/nspr/pr/src/md/windows/ntmisc.c',
-        '<(nss_directory)/nspr/pr/src/md/windows/ntsec.c',
-        '<(nss_directory)/nspr/pr/src/md/windows/ntsem.c',
-        '<(nss_directory)/nspr/pr/src/md/windows/w32ipcsem.c',
-        '<(nss_directory)/nspr/pr/src/md/windows/w32poll.c',
-        '<(nss_directory)/nspr/pr/src/md/windows/w32rng.c',
-        '<(nss_directory)/nspr/pr/src/md/windows/w32shm.c',
-        '<(nss_directory)/nspr/pr/src/md/windows/w95cv.c',
-        '<(nss_directory)/nspr/pr/src/md/windows/w95dllmain.c',
-        '<(nss_directory)/nspr/pr/src/md/windows/w95io.c',
-        '<(nss_directory)/nspr/pr/src/md/windows/w95sock.c',
-        '<(nss_directory)/nspr/pr/src/md/windows/w95thred.c',
-        '<(nss_directory)/nspr/pr/src/md/windows/win32_errors.c',
-        '<(nss_directory)/nspr/pr/src/memory/prseg.c',
-        '<(nss_directory)/nspr/pr/src/memory/prshm.c',
-        '<(nss_directory)/nspr/pr/src/memory/prshma.c',
-        '<(nss_directory)/nspr/pr/src/misc/pralarm.c',
-        '<(nss_directory)/nspr/pr/src/misc/pratom.c',
-        '<(nss_directory)/nspr/pr/src/misc/praton.c',
-        '<(nss_directory)/nspr/pr/src/misc/prcountr.c',
-        '<(nss_directory)/nspr/pr/src/misc/prdtoa.c',
-        '<(nss_directory)/nspr/pr/src/misc/prenv.c',
-        '<(nss_directory)/nspr/pr/src/misc/prerr.c',
-        '<(nss_directory)/nspr/pr/src/misc/prerror.c',
-        '<(nss_directory)/nspr/pr/src/misc/prerrortable.c',
-        '<(nss_directory)/nspr/pr/src/misc/prinit.c',
-        '<(nss_directory)/nspr/pr/src/misc/prinrval.c',
-        '<(nss_directory)/nspr/pr/src/misc/pripc.c',
-        '<(nss_directory)/nspr/pr/src/misc/pripcsem.c',
-        '<(nss_directory)/nspr/pr/src/misc/prlog2.c',
-        '<(nss_directory)/nspr/pr/src/misc/prlong.c',
-        '<(nss_directory)/nspr/pr/src/misc/prnetdb.c',
-        '<(nss_directory)/nspr/pr/src/misc/prolock.c',
-        '<(nss_directory)/nspr/pr/src/misc/prrng.c',
-        '<(nss_directory)/nspr/pr/src/misc/prsystem.c',
-        '<(nss_directory)/nspr/pr/src/misc/prthinfo.c',
-        '<(nss_directory)/nspr/pr/src/misc/prtime.c',
-        '<(nss_directory)/nspr/pr/src/misc/prtpool.c',
-        '<(nss_directory)/nspr/pr/src/misc/prtrace.c',
-        '<(nss_directory)/nspr/pr/src/pthreads/ptio.c',
-        '<(nss_directory)/nspr/pr/src/pthreads/ptmisc.c',
-        '<(nss_directory)/nspr/pr/src/pthreads/ptsynch.c',
-        '<(nss_directory)/nspr/pr/src/pthreads/ptthread.c',
-        '<(nss_directory)/nspr/pr/src/threads/combined/prucpu.c',
-        '<(nss_directory)/nspr/pr/src/threads/combined/prucv.c',
-        '<(nss_directory)/nspr/pr/src/threads/combined/prulock.c',
-        '<(nss_directory)/nspr/pr/src/threads/combined/prustack.c',
-        '<(nss_directory)/nspr/pr/src/threads/combined/pruthr.c',
-        '<(nss_directory)/nspr/pr/src/threads/prcmon.c',
-        '<(nss_directory)/nspr/pr/src/threads/prcthr.c',
-        '<(nss_directory)/nspr/pr/src/threads/prdump.c',
-        '<(nss_directory)/nspr/pr/src/threads/prmon.c',
-        '<(nss_directory)/nspr/pr/src/threads/prrwlock.c',
-        '<(nss_directory)/nspr/pr/src/threads/prsem.c',
-        '<(nss_directory)/nspr/pr/src/threads/prtpd.c',
-      ],
-      'defines': [
-        '_NSPR_BUILD_',
-        'FORCE_PR_LOG',
-      ],
-      'include_dirs': [
-        '<(nss_directory)/nspr/pr/include',
-        '<(nss_directory)/nspr/pr/include/private',
-        '<(nss_directory)/nspr/lib/ds',
-        '<(nss_directory)/nspr/lib/libc/include',
-      ],
-      'direct_dependent_settings': {
-        'defines': [
-          'NO_NSPR_10_SUPPORT',
-        ],
-        'include_dirs': [
-          '<(nss_directory)/nspr/pr/include',
-          '<(nss_directory)/nspr/lib/ds',
-          '<(nss_directory)/nspr/lib/libc/include',
-        ],
-      },
-      # TODO(wtc): suppress C4244 and C4554 in prdtoa.c.
-      'msvs_disabled_warnings': [4018, 4244, 4554, 4267,],
-      'variables': {
-        'clang_warning_flags': [
-          # nspr passes "const char*" through "void*".
-          '-Wno-incompatible-pointer-types',
-          # nspr passes "int*" through "unsigned int*".
-          '-Wno-pointer-sign',
-        ],
-      },
-      'conditions': [
-        ['OS=="mac" or OS=="ios"', {
-          'defines': [
-            'XP_UNIX',
-            'DARWIN',
-            'XP_MACOSX',
-            '_PR_PTHREADS',
-            'HAVE_BSD_FLOCK',
-            'HAVE_CRT_EXTERNS_H',
-            'HAVE_DLADDR',
-            'HAVE_LCHOWN',
-            'HAVE_SOCKLEN_T',
-            'HAVE_STRERROR',
-          ],
-          # Changed by Dart:
-          # nss_directory contains .., which is bad in a regular expression.
-          # So we use the partial match by dropping '^' from '^nspr/...
-          'sources/': [
-            ['exclude', 'nspr/pr/src/md/windows/'],
-            ['exclude', 'nspr/pr/src/threads/combined/'],
-          ],
-          'sources!': [
-            # Added by Dart.
-            'os_linux.S',
-            '<(nss_directory)/nspr/pr/src/io/prdir.c',
-            '<(nss_directory)/nspr/pr/src/io/prfile.c',
-            '<(nss_directory)/nspr/pr/src/io/prio.c',
-            '<(nss_directory)/nspr/pr/src/io/prsocket.c',
-            # os_Darwin_x86.s and os_Darwin_x86_64.s are included by
-            # os_Darwin.s.
-            # Added by Dart.
-            '<(nss_directory)/nspr/pr/src/md/unix/linux.c',
-            '<(nss_directory)/nspr/pr/src/md/unix/os_Darwin_x86.s',
-            '<(nss_directory)/nspr/pr/src/md/unix/os_Darwin_x86_64.s',
-            # Added by Dart.
-            '<(nss_directory)/nspr/pr/src/md/unix/os_Linux_x86.s',
-            # Added by Dart.
-            '<(nss_directory)/nspr/pr/src/md/unix/os_Linux_x86_64.s',
-            '<(nss_directory)/nspr/pr/src/misc/pripcsem.c',
-            '<(nss_directory)/nspr/pr/src/threads/prcthr.c',
-            '<(nss_directory)/nspr/pr/src/threads/prdump.c',
-            '<(nss_directory)/nspr/pr/src/threads/prmon.c',
-            '<(nss_directory)/nspr/pr/src/threads/prsem.c',
-          ],
-        }],
-        # Added by Dart.
-        ['OS=="linux"', {
-          'defines': [
-            'HAVE_VISIBILITY_HIDDEN_ATTRIBUTE=1',
-            'HAVE_VISIBILITY_PRAGMA=1',
-            'XP_UNIX=1',
-            '_GNU_SOURCE=1',
-            'HAVE_FCNTL_FILE_LOCKING=1',
-            'LINUX=1',
-            'i386=1',
-            'HAVE_LCHOWN=1',
-            'HAVE_STRERROR=1',
-            'HAVE_DLADDR=1',
-            'HAVE_SETPRIORITY=1',
-            'HAVE_SYSCALL=1',
-            '_REENTRANT=1',
-             'FORCE_PR_LOG',
-            '_PR_PTHREADS',
-            '_NSPR_BUILD_',
-          ],
-          'sources/': [
-            ['exclude', 'nspr/pr/src/md/windows/'],
-            ['exclude', 'nspr/pr/src/threads/combined/'],
-          ],
-          'sources!': [
-            '<(nss_directory)/nspr/pr/src/md/unix/darwin.c',
-            '<(nss_directory)/nspr/pr/src/md/unix/os_Darwin.s',
-            '<(nss_directory)/nspr/pr/src/md/unix/os_Darwin_x86.s',
-            '<(nss_directory)/nspr/pr/src/md/unix/os_Darwin_x86_64.s',
-            # os_Linux_x86.s and os_Linux_x86_64.s are included by
-            # runtime/bin/net/os_Linux.S.
-            '<(nss_directory)/nspr/pr/src/md/unix/os_Linux_x86.s',
-            '<(nss_directory)/nspr/pr/src/md/unix/os_Linux_x86_64.s',
-            '<(nss_directory)/nspr/pr/src/misc/pripcsem.c',
-            '<(nss_directory)/nspr/pr/src/threads/prcthr.c',
-            '<(nss_directory)/nspr/pr/src/threads/prdump.c',
-            '<(nss_directory)/nspr/pr/src/threads/prmon.c',
-            '<(nss_directory)/nspr/pr/src/threads/prsem.c',
-            '<(nss_directory)/nspr/pr/src/io/prdir.c',
-            '<(nss_directory)/nspr/pr/src/io/prfile.c',
-            '<(nss_directory)/nspr/pr/src/io/prio.c',
-            '<(nss_directory)/nspr/pr/src/io/prsocket.c',
-          ],
-        }],
-        ['OS=="mac"', {
-          'link_settings': {
-            'libraries': [
-              '$(SDKROOT)/System/Library/Frameworks/CoreFoundation.framework',
-              '$(SDKROOT)/System/Library/Frameworks/CoreServices.framework',
-            ],
-          },
-        }],
-        ['OS=="ios"', {
-          'defines!': [
-            'HAVE_CRT_EXTERNS_H',
-          ],
-        }],
-        ['OS=="win"', {
-          'defines': [
-            'XP_PC',
-            'WIN32',
-            'WIN95',
-            '_PR_GLOBAL_THREADS_ONLY',
-            '_CRT_SECURE_NO_WARNINGS',
-            '_CRT_NONSTDC_NO_WARNINGS',
-          ],
-          'sources!': [
-            # Added by Dart.
-            'os_linux.S',
-          ],
-          # Changed by Dart:
-          # nss_directory contains .., which is bad in a regular expression.
-          # So we use the partial match by dropping '^' from '^nspr/...
-          'sources/': [
-            ['exclude', 'nspr/pr/src/md/unix/'],
-            ['exclude', 'nspr/pr/src/pthreads/'],
-          ],
-          # Changed by Dart. We don't use target_arch.
-          # 'conditions': [
-          #  ['target_arch=="ia32"', {
-          #    'defines': [
-          #      '_X86_',
-          #    ],
-          #  }],
-          # ],
-        }],
-        ['component == "static_library"', {
-          'defines': [
-            'NSPR_STATIC',
-          ],
-          'direct_dependent_settings': {
-            'defines': [
-              'NSPR_STATIC',
-            ],
-          },
-        }],
-        ['clang==1', {
-          'xcode_settings': {
-            'WARNING_CFLAGS': [
-              # nspr uses a bunch of deprecated functions (NSLinkModule etc) in
-              # prlink.c on mac.
-              '-Wno-deprecated-declarations',
-            ],
-          },
-        }],
-      ],
-    },
-    {
-      'target_name': 'nss_dart',  # Added by Dart (the _dart postfix)
-      'product_name': 'crnss',
-      'type': '<(component)',
-      'toolsets':['host','target'],
-      'dependencies': [
-        'nss_static_dart',  # Added by Dart (the _dart postfix)
-      ],
-      'export_dependent_settings': [
-        'nss_static_dart',  # Added by Dart (the _dart postfix)
-      ],
-      'sources': [
-        # Ensure at least one object file is produced, so that MSVC does not
-        # warn when creating the static/shared library. See the note for
-        # the 'nssckbi' target for why the 'nss' target was split as such.
-        '<(nss_directory)/nss/lib/nss/nssver.c',
-      ],
-      'conditions': [
-        ['exclude_nss_root_certs==0', {
-          'dependencies': [
-            'nssckbi_dart',  # Added by Dart (the _dart postfix)
-          ],
-          'export_dependent_settings': [
-            'nssckbi_dart',  # Added by Dart (the _dart postfix)
-          ],
-        }],
-        ['OS == "mac" and component == "shared_library"', {
-          'xcode_settings': {
-            'OTHER_LDFLAGS': ['-all_load'],
-          },
-        }],
-        ['OS == "win" and component == "shared_library"', {
-          'sources': [
-            '<(nss_directory)/nss/exports_win.def',
-          ],
-        }],
-      ],
-    },
-    {
-      # This is really more of a pseudo-target to work around the fact that
-      # a single static_library target cannot contain two object files of the
-      # same name (hash.o / hash.obj). Logically, this is part of the
-      # 'nss_static' target. By separating it out, it creates a possible
-      # circular dependency between 'nss_static' and 'nssckbi' when
-      # 'exclude_nss_root_certs' is not specified, as 'nss_static' depends on
-      # the 'builtinsC_GetFunctionList' exported by this target. This is an
-      # artifact of how NSS is being statically built, which is not an
-      # officially supported configuration - normally, 'nssckbi.dll/so' would
-      # depend on libnss3.dll/so, and the higher layer caller would instruct
-      # libnss3.dll to dynamically load nssckbi.dll, breaking the circle.
-      #
-      # TODO(rsleevi): http://crbug.com/128134 - Break the circular dependency
-      # without requiring nssckbi to be built as a shared library.
-      'target_name': 'nssckbi_dart',  # Added by Dart (the _dart postfix)
-      'product_name': 'crnssckbi',
-      'type': 'static_library',
-      'toolsets':['host','target'],
-      # This target is an implementation detail - the public dependencies
-      # should be on 'nss'.
-      'suppress_wildcard': 1,
-      'sources': [
-        '<(nss_directory)/nss/lib/ckfw/builtins/anchor.c',
-        '<(nss_directory)/nss/lib/ckfw/builtins/bfind.c',
-        '<(nss_directory)/nss/lib/ckfw/builtins/binst.c',
-        '<(nss_directory)/nss/lib/ckfw/builtins/bobject.c',
-        '<(nss_directory)/nss/lib/ckfw/builtins/bsession.c',
-        '<(nss_directory)/nss/lib/ckfw/builtins/bslot.c',
-        '<(nss_directory)/nss/lib/ckfw/builtins/btoken.c',
-        '<(nss_directory)/nss/lib/ckfw/builtins/builtins.h',
-        '<(nss_directory)/nss/lib/ckfw/builtins/certdata.c',
-        '<(nss_directory)/nss/lib/ckfw/builtins/ckbiver.c',
-        '<(nss_directory)/nss/lib/ckfw/builtins/constants.c',
-        '<(nss_directory)/nss/lib/ckfw/builtins/nssckbi.h',
-        '<(nss_directory)/nss/lib/ckfw/ck.h',
-        '<(nss_directory)/nss/lib/ckfw/ckfw.h',
-        '<(nss_directory)/nss/lib/ckfw/ckfwm.h',
-        '<(nss_directory)/nss/lib/ckfw/ckfwtm.h',
-        '<(nss_directory)/nss/lib/ckfw/ckmd.h',
-        '<(nss_directory)/nss/lib/ckfw/ckt.h',
-        '<(nss_directory)/nss/lib/ckfw/crypto.c',
-        '<(nss_directory)/nss/lib/ckfw/find.c',
-        '<(nss_directory)/nss/lib/ckfw/hash.c',
-        '<(nss_directory)/nss/lib/ckfw/instance.c',
-        '<(nss_directory)/nss/lib/ckfw/mechanism.c',
-        '<(nss_directory)/nss/lib/ckfw/mutex.c',
-        '<(nss_directory)/nss/lib/ckfw/nssck.api',
-        '<(nss_directory)/nss/lib/ckfw/nssckepv.h',
-        '<(nss_directory)/nss/lib/ckfw/nssckft.h',
-        '<(nss_directory)/nss/lib/ckfw/nssckfw.h',
-        '<(nss_directory)/nss/lib/ckfw/nssckfwc.h',
-        '<(nss_directory)/nss/lib/ckfw/nssckfwt.h',
-        '<(nss_directory)/nss/lib/ckfw/nssckg.h',
-        '<(nss_directory)/nss/lib/ckfw/nssckmdt.h',
-        '<(nss_directory)/nss/lib/ckfw/nssckt.h',
-        '<(nss_directory)/nss/lib/ckfw/object.c',
-        '<(nss_directory)/nss/lib/ckfw/session.c',
-        '<(nss_directory)/nss/lib/ckfw/sessobj.c',
-        '<(nss_directory)/nss/lib/ckfw/slot.c',
-        '<(nss_directory)/nss/lib/ckfw/token.c',
-        '<(nss_directory)/nss/lib/ckfw/wrap.c',
-      ],
-      'dependencies': [
-        'nss_static_dart',  # Added by Dart (the _dart postfix)
-      ],
-      'export_dependent_settings': [
-        'nss_static_dart',  # Added by Dart (the _dart postfix)
-      ],
-      'include_dirs': [
-        '<(nss_directory)/nss/lib/ckfw',
-      ],
-      'direct_dependent_settings': {
-        'include_dirs': [
-          '<(nss_directory)/nss/lib/ckfw/builtins',
-        ],
-      },
-    },
-    # Removed by Dart: the target nss_static_avx_dart.
-    # This is an optimization of AES on 32 bit Windows using new
-    # Intel assembly instructions.  Not enabling it on Dart.
-    {
-      'target_name': 'nss_static_dart',  # Added by Dart (the _dart postfix)
-      'type': 'static_library',
-      'toolsets':['host','target'],
-      # This target is an implementation detail - the public dependencies
-      # should be on 'nss'.
-      'suppress_wildcard': 1,
-      'sources': [
-        'os_windows.c',
-        '<(nss_directory)/nss/lib/base/arena.c',
-        '<(nss_directory)/nss/lib/base/base.h',
-        '<(nss_directory)/nss/lib/base/baset.h',
-        '<(nss_directory)/nss/lib/base/error.c',
-        '<(nss_directory)/nss/lib/base/errorval.c',
-        '<(nss_directory)/nss/lib/base/hash.c',
-        '<(nss_directory)/nss/lib/base/hashops.c',
-        '<(nss_directory)/nss/lib/base/item.c',
-        '<(nss_directory)/nss/lib/base/libc.c',
-        '<(nss_directory)/nss/lib/base/list.c',
-        '<(nss_directory)/nss/lib/base/nssbase.h',
-        '<(nss_directory)/nss/lib/base/nssbaset.h',
-        '<(nss_directory)/nss/lib/base/nssutf8.c',
-        '<(nss_directory)/nss/lib/base/tracker.c',
-        '<(nss_directory)/nss/lib/certdb/alg1485.c',
-        '<(nss_directory)/nss/lib/certdb/cert.h',
-        '<(nss_directory)/nss/lib/certdb/certdb.c',
-        '<(nss_directory)/nss/lib/certdb/certdb.h',
-        '<(nss_directory)/nss/lib/certdb/certi.h',
-        '<(nss_directory)/nss/lib/certdb/certt.h',
-        '<(nss_directory)/nss/lib/certdb/certv3.c',
-        '<(nss_directory)/nss/lib/certdb/certxutl.c',
-        '<(nss_directory)/nss/lib/certdb/certxutl.h',
-        '<(nss_directory)/nss/lib/certdb/crl.c',
-        '<(nss_directory)/nss/lib/certdb/genname.c',
-        '<(nss_directory)/nss/lib/certdb/genname.h',
-        '<(nss_directory)/nss/lib/certdb/polcyxtn.c',
-        '<(nss_directory)/nss/lib/certdb/secname.c',
-        '<(nss_directory)/nss/lib/certdb/stanpcertdb.c',
-        '<(nss_directory)/nss/lib/certdb/xauthkid.c',
-        '<(nss_directory)/nss/lib/certdb/xbsconst.c',
-        '<(nss_directory)/nss/lib/certdb/xconst.c',
-        '<(nss_directory)/nss/lib/certdb/xconst.h',
-        '<(nss_directory)/nss/lib/certhigh/certhigh.c',
-        '<(nss_directory)/nss/lib/certhigh/certhtml.c',
-        '<(nss_directory)/nss/lib/certhigh/certreq.c',
-        '<(nss_directory)/nss/lib/certhigh/certvfy.c',
-        '<(nss_directory)/nss/lib/certhigh/certvfypkix.c',
-        '<(nss_directory)/nss/lib/certhigh/certvfypkixprint.c',
-        '<(nss_directory)/nss/lib/certhigh/crlv2.c',
-        '<(nss_directory)/nss/lib/certhigh/ocsp.c',
-        '<(nss_directory)/nss/lib/certhigh/ocsp.h',
-        '<(nss_directory)/nss/lib/certhigh/ocspi.h',
-        '<(nss_directory)/nss/lib/certhigh/ocspt.h',
-        '<(nss_directory)/nss/lib/certhigh/ocspti.h',
-        '<(nss_directory)/nss/lib/certhigh/xcrldist.c',
-        '<(nss_directory)/nss/lib/cryptohi/cryptohi.h',
-        '<(nss_directory)/nss/lib/cryptohi/cryptoht.h',
-        '<(nss_directory)/nss/lib/cryptohi/dsautil.c',
-        '<(nss_directory)/nss/lib/cryptohi/key.h',
-        '<(nss_directory)/nss/lib/cryptohi/keyhi.h',
-        '<(nss_directory)/nss/lib/cryptohi/keyi.h',
-        '<(nss_directory)/nss/lib/cryptohi/keyt.h',
-        '<(nss_directory)/nss/lib/cryptohi/keythi.h',
-        '<(nss_directory)/nss/lib/cryptohi/sechash.c',
-        '<(nss_directory)/nss/lib/cryptohi/sechash.h',
-        '<(nss_directory)/nss/lib/cryptohi/seckey.c',
-        '<(nss_directory)/nss/lib/cryptohi/secsign.c',
-        '<(nss_directory)/nss/lib/cryptohi/secvfy.c',
-        '<(nss_directory)/nss/lib/dev/ckhelper.c',
-        '<(nss_directory)/nss/lib/dev/ckhelper.h',
-        '<(nss_directory)/nss/lib/dev/dev.h',
-        '<(nss_directory)/nss/lib/dev/devm.h',
-        '<(nss_directory)/nss/lib/dev/devslot.c',
-        '<(nss_directory)/nss/lib/dev/devt.h',
-        '<(nss_directory)/nss/lib/dev/devtm.h',
-        '<(nss_directory)/nss/lib/dev/devtoken.c',
-        '<(nss_directory)/nss/lib/dev/devutil.c',
-        '<(nss_directory)/nss/lib/dev/nssdev.h',
-        '<(nss_directory)/nss/lib/dev/nssdevt.h',
-        '<(nss_directory)/nss/lib/freebl/aeskeywrap.c',
-        '<(nss_directory)/nss/lib/freebl/alg2268.c',
-        '<(nss_directory)/nss/lib/freebl/alghmac.c',
-        '<(nss_directory)/nss/lib/freebl/alghmac.h',
-        '<(nss_directory)/nss/lib/freebl/arcfive.c',
-        '<(nss_directory)/nss/lib/freebl/arcfour.c',
-        '<(nss_directory)/nss/lib/freebl/blapi.h',
-        '<(nss_directory)/nss/lib/freebl/blapii.h',
-        '<(nss_directory)/nss/lib/freebl/blapit.h',
-        '<(nss_directory)/nss/lib/freebl/camellia.c',
-        '<(nss_directory)/nss/lib/freebl/camellia.h',
-        '<(nss_directory)/nss/lib/freebl/chacha20/chacha20.c',
-        '<(nss_directory)/nss/lib/freebl/chacha20/chacha20.h',
-        '<(nss_directory)/nss/lib/freebl/chacha20/chacha20_vec.c',
-        '<(nss_directory)/nss/lib/freebl/chacha20poly1305.c',
-        '<(nss_directory)/nss/lib/freebl/chacha20poly1305.h',
-        '<(nss_directory)/nss/lib/freebl/ctr.c',
-        '<(nss_directory)/nss/lib/freebl/ctr.h',
-        '<(nss_directory)/nss/lib/freebl/cts.c',
-        '<(nss_directory)/nss/lib/freebl/cts.h',
-        '<(nss_directory)/nss/lib/freebl/des.c',
-        '<(nss_directory)/nss/lib/freebl/des.h',
-        '<(nss_directory)/nss/lib/freebl/desblapi.c',
-        '<(nss_directory)/nss/lib/freebl/dh.c',
-        '<(nss_directory)/nss/lib/freebl/drbg.c',
-        '<(nss_directory)/nss/lib/freebl/dsa.c',
-        '<(nss_directory)/nss/lib/freebl/ec.c',
-        '<(nss_directory)/nss/lib/freebl/ec.h',
-        '<(nss_directory)/nss/lib/freebl/ecdecode.c',
-        '<(nss_directory)/nss/lib/freebl/ecl/ec2.h',
-        '<(nss_directory)/nss/lib/freebl/ecl/ecl-curve.h',
-        '<(nss_directory)/nss/lib/freebl/ecl/ecl-exp.h',
-        '<(nss_directory)/nss/lib/freebl/ecl/ecl-priv.h',
-        '<(nss_directory)/nss/lib/freebl/ecl/ecl.c',
-        '<(nss_directory)/nss/lib/freebl/ecl/ecl.h',
-        '<(nss_directory)/nss/lib/freebl/ecl/ecl_curve.c',
-        '<(nss_directory)/nss/lib/freebl/ecl/ecl_gf.c',
-        '<(nss_directory)/nss/lib/freebl/ecl/ecl_mult.c',
-        '<(nss_directory)/nss/lib/freebl/ecl/ecp.h',
-        '<(nss_directory)/nss/lib/freebl/ecl/ecp_256.c',
-        '<(nss_directory)/nss/lib/freebl/ecl/ecp_256_32.c',
-        '<(nss_directory)/nss/lib/freebl/ecl/ecp_384.c',
-        '<(nss_directory)/nss/lib/freebl/ecl/ecp_521.c',
-        '<(nss_directory)/nss/lib/freebl/ecl/ecp_aff.c',
-        '<(nss_directory)/nss/lib/freebl/ecl/ecp_jac.c',
-        '<(nss_directory)/nss/lib/freebl/ecl/ecp_jm.c',
-        '<(nss_directory)/nss/lib/freebl/ecl/ecp_mont.c',
-        '<(nss_directory)/nss/lib/freebl/ecl/ec_naf.c',
-        '<(nss_directory)/nss/lib/freebl/gcm.c',
-        '<(nss_directory)/nss/lib/freebl/gcm.h',
-        # Changed by Dart: intel-aes assembly language files dropped.
-        '<(nss_directory)/nss/lib/freebl/hmacct.c',
-        '<(nss_directory)/nss/lib/freebl/hmacct.h',
-        '<(nss_directory)/nss/lib/freebl/jpake.c',
-        '<(nss_directory)/nss/lib/freebl/md2.c',
-        '<(nss_directory)/nss/lib/freebl/md5.c',
-        '<(nss_directory)/nss/lib/freebl/mpi/logtab.h',
-        '<(nss_directory)/nss/lib/freebl/mpi/mpcpucache.c',
-        '<(nss_directory)/nss/lib/freebl/mpi/mpi-config.h',
-        '<(nss_directory)/nss/lib/freebl/mpi/mpi-priv.h',
-        '<(nss_directory)/nss/lib/freebl/mpi/mpi.c',
-        '<(nss_directory)/nss/lib/freebl/mpi/mpi.h',
-        '<(nss_directory)/nss/lib/freebl/mpi/mpi_amd64.c',
-        '<(nss_directory)/nss/lib/freebl/mpi/mpi_x86_asm.c',
-        '<(nss_directory)/nss/lib/freebl/mpi/mplogic.c',
-        '<(nss_directory)/nss/lib/freebl/mpi/mplogic.h',
-        '<(nss_directory)/nss/lib/freebl/mpi/mpmontg.c',
-        '<(nss_directory)/nss/lib/freebl/mpi/mpprime.c',
-        '<(nss_directory)/nss/lib/freebl/mpi/mpprime.h',
-        '<(nss_directory)/nss/lib/freebl/mpi/mp_gf2m-priv.h',
-        '<(nss_directory)/nss/lib/freebl/mpi/mp_gf2m.c',
-        '<(nss_directory)/nss/lib/freebl/mpi/mp_gf2m.h',
-        '<(nss_directory)/nss/lib/freebl/mpi/primes.c',
-        '<(nss_directory)/nss/lib/freebl/nss_build_config_mac.h',
-        '<(nss_directory)/nss/lib/freebl/poly1305/poly1305-donna-x64-sse2-incremental-source.c',
-        '<(nss_directory)/nss/lib/freebl/poly1305/poly1305.c',
-        '<(nss_directory)/nss/lib/freebl/poly1305/poly1305.h',
-        '<(nss_directory)/nss/lib/freebl/pqg.c',
-        '<(nss_directory)/nss/lib/freebl/pqg.h',
-        '<(nss_directory)/nss/lib/freebl/rawhash.c',
-        '<(nss_directory)/nss/lib/freebl/rijndael.c',
-        '<(nss_directory)/nss/lib/freebl/rijndael.h',
-        '<(nss_directory)/nss/lib/freebl/rijndael32.tab',
-        '<(nss_directory)/nss/lib/freebl/rsa.c',
-        '<(nss_directory)/nss/lib/freebl/rsapkcs.c',
-        '<(nss_directory)/nss/lib/freebl/secmpi.h',
-        '<(nss_directory)/nss/lib/freebl/secrng.h',
-        '<(nss_directory)/nss/lib/freebl/seed.c',
-        '<(nss_directory)/nss/lib/freebl/seed.h',
-        '<(nss_directory)/nss/lib/freebl/sha256.h',
-        '<(nss_directory)/nss/lib/freebl/sha512.c',
-        '<(nss_directory)/nss/lib/freebl/sha_fast.c',
-        '<(nss_directory)/nss/lib/freebl/sha_fast.h',
-        '<(nss_directory)/nss/lib/freebl/shsign.h',
-        '<(nss_directory)/nss/lib/freebl/shvfy.c',
-        '<(nss_directory)/nss/lib/freebl/sysrand.c',
-        '<(nss_directory)/nss/lib/freebl/tlsprfalg.c',
-        '<(nss_directory)/nss/lib/freebl/unix_rand.c',
-        '<(nss_directory)/nss/lib/freebl/win_rand.c',
-        '<(nss_directory)/nss/lib/libpkix/include/pkix.h',
-        '<(nss_directory)/nss/lib/libpkix/include/pkix_certsel.h',
-        '<(nss_directory)/nss/lib/libpkix/include/pkix_certstore.h',
-        '<(nss_directory)/nss/lib/libpkix/include/pkix_checker.h',
-        '<(nss_directory)/nss/lib/libpkix/include/pkix_crlsel.h',
-        '<(nss_directory)/nss/lib/libpkix/include/pkix_errorstrings.h',
-        '<(nss_directory)/nss/lib/libpkix/include/pkix_params.h',
-        '<(nss_directory)/nss/lib/libpkix/include/pkix_pl_pki.h',
-        '<(nss_directory)/nss/lib/libpkix/include/pkix_pl_system.h',
-        '<(nss_directory)/nss/lib/libpkix/include/pkix_results.h',
-        '<(nss_directory)/nss/lib/libpkix/include/pkix_revchecker.h',
-        '<(nss_directory)/nss/lib/libpkix/include/pkix_sample_modules.h',
-        '<(nss_directory)/nss/lib/libpkix/include/pkix_util.h',
-        '<(nss_directory)/nss/lib/libpkix/include/pkixt.h',
-        '<(nss_directory)/nss/lib/libpkix/pkix/certsel/pkix_certselector.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix/certsel/pkix_certselector.h',
-        '<(nss_directory)/nss/lib/libpkix/pkix/certsel/pkix_comcertselparams.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix/certsel/pkix_comcertselparams.h',
-        '<(nss_directory)/nss/lib/libpkix/pkix/checker/pkix_basicconstraintschecker.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix/checker/pkix_basicconstraintschecker.h',
-        '<(nss_directory)/nss/lib/libpkix/pkix/checker/pkix_certchainchecker.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix/checker/pkix_certchainchecker.h',
-        '<(nss_directory)/nss/lib/libpkix/pkix/checker/pkix_crlchecker.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix/checker/pkix_crlchecker.h',
-        '<(nss_directory)/nss/lib/libpkix/pkix/checker/pkix_ekuchecker.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix/checker/pkix_ekuchecker.h',
-        '<(nss_directory)/nss/lib/libpkix/pkix/checker/pkix_expirationchecker.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix/checker/pkix_expirationchecker.h',
-        '<(nss_directory)/nss/lib/libpkix/pkix/checker/pkix_namechainingchecker.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix/checker/pkix_namechainingchecker.h',
-        '<(nss_directory)/nss/lib/libpkix/pkix/checker/pkix_nameconstraintschecker.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix/checker/pkix_nameconstraintschecker.h',
-        '<(nss_directory)/nss/lib/libpkix/pkix/checker/pkix_ocspchecker.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix/checker/pkix_ocspchecker.h',
-        '<(nss_directory)/nss/lib/libpkix/pkix/checker/pkix_policychecker.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix/checker/pkix_policychecker.h',
-        '<(nss_directory)/nss/lib/libpkix/pkix/checker/pkix_revocationchecker.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix/checker/pkix_revocationchecker.h',
-        '<(nss_directory)/nss/lib/libpkix/pkix/checker/pkix_revocationmethod.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix/checker/pkix_revocationmethod.h',
-        '<(nss_directory)/nss/lib/libpkix/pkix/checker/pkix_signaturechecker.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix/checker/pkix_signaturechecker.h',
-        '<(nss_directory)/nss/lib/libpkix/pkix/checker/pkix_targetcertchecker.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix/checker/pkix_targetcertchecker.h',
-        '<(nss_directory)/nss/lib/libpkix/pkix/crlsel/pkix_comcrlselparams.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix/crlsel/pkix_comcrlselparams.h',
-        '<(nss_directory)/nss/lib/libpkix/pkix/crlsel/pkix_crlselector.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix/crlsel/pkix_crlselector.h',
-        '<(nss_directory)/nss/lib/libpkix/pkix/params/pkix_procparams.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix/params/pkix_procparams.h',
-        '<(nss_directory)/nss/lib/libpkix/pkix/params/pkix_resourcelimits.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix/params/pkix_resourcelimits.h',
-        '<(nss_directory)/nss/lib/libpkix/pkix/params/pkix_trustanchor.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix/params/pkix_trustanchor.h',
-        '<(nss_directory)/nss/lib/libpkix/pkix/params/pkix_valparams.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix/params/pkix_valparams.h',
-        '<(nss_directory)/nss/lib/libpkix/pkix/results/pkix_buildresult.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix/results/pkix_buildresult.h',
-        '<(nss_directory)/nss/lib/libpkix/pkix/results/pkix_policynode.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix/results/pkix_policynode.h',
-        '<(nss_directory)/nss/lib/libpkix/pkix/results/pkix_valresult.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix/results/pkix_valresult.h',
-        '<(nss_directory)/nss/lib/libpkix/pkix/results/pkix_verifynode.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix/results/pkix_verifynode.h',
-        '<(nss_directory)/nss/lib/libpkix/pkix/store/pkix_store.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix/store/pkix_store.h',
-        '<(nss_directory)/nss/lib/libpkix/pkix/top/pkix_build.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix/top/pkix_build.h',
-        '<(nss_directory)/nss/lib/libpkix/pkix/top/pkix_lifecycle.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix/top/pkix_lifecycle.h',
-        '<(nss_directory)/nss/lib/libpkix/pkix/top/pkix_validate.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix/top/pkix_validate.h',
-        '<(nss_directory)/nss/lib/libpkix/pkix/util/pkix_error.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix/util/pkix_error.h',
-        '<(nss_directory)/nss/lib/libpkix/pkix/util/pkix_errpaths.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix/util/pkix_list.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix/util/pkix_list.h',
-        '<(nss_directory)/nss/lib/libpkix/pkix/util/pkix_logger.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix/util/pkix_logger.h',
-        '<(nss_directory)/nss/lib/libpkix/pkix/util/pkix_tools.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix/util/pkix_tools.h',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/module/pkix_pl_aiamgr.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/module/pkix_pl_aiamgr.h',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/module/pkix_pl_colcertstore.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/module/pkix_pl_colcertstore.h',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/module/pkix_pl_httpcertstore.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/module/pkix_pl_httpcertstore.h',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/module/pkix_pl_httpdefaultclient.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/module/pkix_pl_httpdefaultclient.h',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/module/pkix_pl_ldapcertstore.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/module/pkix_pl_ldapcertstore.h',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/module/pkix_pl_ldapdefaultclient.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/module/pkix_pl_ldapdefaultclient.h',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/module/pkix_pl_ldaprequest.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/module/pkix_pl_ldaprequest.h',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/module/pkix_pl_ldapresponse.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/module/pkix_pl_ldapresponse.h',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/module/pkix_pl_ldapt.h',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/module/pkix_pl_ldaptemplates.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/module/pkix_pl_nsscontext.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/module/pkix_pl_nsscontext.h',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/module/pkix_pl_pk11certstore.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/module/pkix_pl_pk11certstore.h',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/module/pkix_pl_socket.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/module/pkix_pl_socket.h',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/pki/pkix_pl_basicconstraints.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/pki/pkix_pl_basicconstraints.h',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/pki/pkix_pl_cert.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/pki/pkix_pl_cert.h',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/pki/pkix_pl_certpolicyinfo.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/pki/pkix_pl_certpolicyinfo.h',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/pki/pkix_pl_certpolicymap.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/pki/pkix_pl_certpolicymap.h',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/pki/pkix_pl_certpolicyqualifier.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/pki/pkix_pl_certpolicyqualifier.h',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/pki/pkix_pl_crl.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/pki/pkix_pl_crl.h',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/pki/pkix_pl_crldp.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/pki/pkix_pl_crldp.h',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/pki/pkix_pl_crlentry.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/pki/pkix_pl_crlentry.h',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/pki/pkix_pl_date.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/pki/pkix_pl_date.h',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/pki/pkix_pl_generalname.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/pki/pkix_pl_generalname.h',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/pki/pkix_pl_infoaccess.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/pki/pkix_pl_infoaccess.h',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/pki/pkix_pl_nameconstraints.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/pki/pkix_pl_nameconstraints.h',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/pki/pkix_pl_ocspcertid.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/pki/pkix_pl_ocspcertid.h',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/pki/pkix_pl_ocsprequest.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/pki/pkix_pl_ocsprequest.h',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/pki/pkix_pl_ocspresponse.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/pki/pkix_pl_ocspresponse.h',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/pki/pkix_pl_publickey.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/pki/pkix_pl_publickey.h',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/pki/pkix_pl_x500name.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/pki/pkix_pl_x500name.h',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/system/pkix_pl_bigint.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/system/pkix_pl_bigint.h',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/system/pkix_pl_bytearray.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/system/pkix_pl_bytearray.h',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/system/pkix_pl_common.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/system/pkix_pl_common.h',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/system/pkix_pl_error.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/system/pkix_pl_hashtable.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/system/pkix_pl_hashtable.h',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/system/pkix_pl_lifecycle.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/system/pkix_pl_lifecycle.h',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/system/pkix_pl_mem.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/system/pkix_pl_mem.h',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/system/pkix_pl_monitorlock.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/system/pkix_pl_monitorlock.h',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/system/pkix_pl_mutex.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/system/pkix_pl_mutex.h',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/system/pkix_pl_object.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/system/pkix_pl_object.h',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/system/pkix_pl_oid.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/system/pkix_pl_oid.h',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/system/pkix_pl_primhash.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/system/pkix_pl_primhash.h',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/system/pkix_pl_rwlock.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/system/pkix_pl_rwlock.h',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/system/pkix_pl_string.c',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/system/pkix_pl_string.h',
-        '<(nss_directory)/nss/lib/nss/nss.h',
-        '<(nss_directory)/nss/lib/nss/nssinit.c',
-        '<(nss_directory)/nss/lib/nss/nssrenam.h',
-        '<(nss_directory)/nss/lib/nss/utilwrap.c',
-        '<(nss_directory)/nss/lib/pk11wrap/debug_module.c',
-        '<(nss_directory)/nss/lib/pk11wrap/dev3hack.c',
-        '<(nss_directory)/nss/lib/pk11wrap/dev3hack.h',
-        '<(nss_directory)/nss/lib/pk11wrap/pk11akey.c',
-        '<(nss_directory)/nss/lib/pk11wrap/pk11auth.c',
-        '<(nss_directory)/nss/lib/pk11wrap/pk11cert.c',
-        '<(nss_directory)/nss/lib/pk11wrap/pk11cxt.c',
-        '<(nss_directory)/nss/lib/pk11wrap/pk11err.c',
-        '<(nss_directory)/nss/lib/pk11wrap/pk11func.h',
-        '<(nss_directory)/nss/lib/pk11wrap/pk11kea.c',
-        '<(nss_directory)/nss/lib/pk11wrap/pk11list.c',
-        '<(nss_directory)/nss/lib/pk11wrap/pk11load.c',
-        '<(nss_directory)/nss/lib/pk11wrap/pk11mech.c',
-        '<(nss_directory)/nss/lib/pk11wrap/pk11merge.c',
-        '<(nss_directory)/nss/lib/pk11wrap/pk11nobj.c',
-        '<(nss_directory)/nss/lib/pk11wrap/pk11obj.c',
-        '<(nss_directory)/nss/lib/pk11wrap/pk11pars.c',
-        '<(nss_directory)/nss/lib/pk11wrap/pk11pbe.c',
-        '<(nss_directory)/nss/lib/pk11wrap/pk11pk12.c',
-        '<(nss_directory)/nss/lib/pk11wrap/pk11pqg.c',
-        '<(nss_directory)/nss/lib/pk11wrap/pk11pqg.h',
-        '<(nss_directory)/nss/lib/pk11wrap/pk11priv.h',
-        '<(nss_directory)/nss/lib/pk11wrap/pk11pub.h',
-        '<(nss_directory)/nss/lib/pk11wrap/pk11sdr.c',
-        '<(nss_directory)/nss/lib/pk11wrap/pk11sdr.h',
-        '<(nss_directory)/nss/lib/pk11wrap/pk11skey.c',
-        '<(nss_directory)/nss/lib/pk11wrap/pk11slot.c',
-        '<(nss_directory)/nss/lib/pk11wrap/pk11util.c',
-        '<(nss_directory)/nss/lib/pk11wrap/secmod.h',
-        '<(nss_directory)/nss/lib/pk11wrap/secmodi.h',
-        '<(nss_directory)/nss/lib/pk11wrap/secmodt.h',
-        '<(nss_directory)/nss/lib/pk11wrap/secmodti.h',
-        '<(nss_directory)/nss/lib/pk11wrap/secpkcs5.h',
-        '<(nss_directory)/nss/lib/pkcs7/certread.c',
-        '<(nss_directory)/nss/lib/pkcs7/p7common.c',
-        '<(nss_directory)/nss/lib/pkcs7/p7create.c',
-        '<(nss_directory)/nss/lib/pkcs7/p7decode.c',
-        '<(nss_directory)/nss/lib/pkcs7/p7encode.c',
-        '<(nss_directory)/nss/lib/pkcs7/p7local.c',
-        '<(nss_directory)/nss/lib/pkcs7/p7local.h',
-        '<(nss_directory)/nss/lib/pkcs7/pkcs7t.h',
-        '<(nss_directory)/nss/lib/pkcs7/secmime.c',
-        '<(nss_directory)/nss/lib/pkcs7/secmime.h',
-        '<(nss_directory)/nss/lib/pkcs7/secpkcs7.h',
-        '<(nss_directory)/nss/lib/pki/asymmkey.c',
-        '<(nss_directory)/nss/lib/pki/certdecode.c',
-        '<(nss_directory)/nss/lib/pki/certificate.c',
-        '<(nss_directory)/nss/lib/pki/cryptocontext.c',
-        '<(nss_directory)/nss/lib/pki/nsspki.h',
-        '<(nss_directory)/nss/lib/pki/nsspkit.h',
-        '<(nss_directory)/nss/lib/pki/pki.h',
-        '<(nss_directory)/nss/lib/pki/pki3hack.c',
-        '<(nss_directory)/nss/lib/pki/pki3hack.h',
-        '<(nss_directory)/nss/lib/pki/pkibase.c',
-        '<(nss_directory)/nss/lib/pki/pkim.h',
-        '<(nss_directory)/nss/lib/pki/pkistore.c',
-        '<(nss_directory)/nss/lib/pki/pkistore.h',
-        '<(nss_directory)/nss/lib/pki/pkit.h',
-        '<(nss_directory)/nss/lib/pki/pkitm.h',
-        '<(nss_directory)/nss/lib/pki/symmkey.c',
-        '<(nss_directory)/nss/lib/pki/tdcache.c',
-        '<(nss_directory)/nss/lib/pki/trustdomain.c',
-        '<(nss_directory)/nss/lib/smime/cms.h',
-        '<(nss_directory)/nss/lib/smime/cmslocal.h',
-        '<(nss_directory)/nss/lib/smime/cmsreclist.h',
-        '<(nss_directory)/nss/lib/smime/cmst.h',
-        '<(nss_directory)/nss/lib/smime/smime.h',
-        '<(nss_directory)/nss/lib/softoken/fipsaudt.c',
-        '<(nss_directory)/nss/lib/softoken/fipstest.c',
-        '<(nss_directory)/nss/lib/softoken/fipstokn.c',
-        '<(nss_directory)/nss/lib/softoken/jpakesftk.c',
-        '<(nss_directory)/nss/lib/softoken/lgglue.c',
-        '<(nss_directory)/nss/lib/softoken/lgglue.h',
-        '<(nss_directory)/nss/lib/softoken/lowkey.c',
-        '<(nss_directory)/nss/lib/softoken/lowkeyi.h',
-        '<(nss_directory)/nss/lib/softoken/lowkeyti.h',
-        '<(nss_directory)/nss/lib/softoken/lowpbe.c',
-        '<(nss_directory)/nss/lib/softoken/lowpbe.h',
-        '<(nss_directory)/nss/lib/softoken/padbuf.c',
-        '<(nss_directory)/nss/lib/softoken/pkcs11.c',
-        '<(nss_directory)/nss/lib/softoken/pkcs11c.c',
-        '<(nss_directory)/nss/lib/softoken/pkcs11i.h',
-        '<(nss_directory)/nss/lib/softoken/pkcs11ni.h',
-        '<(nss_directory)/nss/lib/softoken/pkcs11u.c',
-        '<(nss_directory)/nss/lib/softoken/sdb.c',
-        '<(nss_directory)/nss/lib/softoken/sdb.h',
-        '<(nss_directory)/nss/lib/softoken/sftkdb.c',
-        '<(nss_directory)/nss/lib/softoken/sftkdb.h',
-        '<(nss_directory)/nss/lib/softoken/sftkdbt.h',
-        '<(nss_directory)/nss/lib/softoken/sftkdbti.h',
-        '<(nss_directory)/nss/lib/softoken/sftkhmac.c',
-        '<(nss_directory)/nss/lib/softoken/sftkpars.c',
-        '<(nss_directory)/nss/lib/softoken/sftkpars.h',
-        '<(nss_directory)/nss/lib/softoken/sftkpwd.c',
-        '<(nss_directory)/nss/lib/softoken/softkver.c',
-        '<(nss_directory)/nss/lib/softoken/softkver.h',
-        '<(nss_directory)/nss/lib/softoken/softoken.h',
-        '<(nss_directory)/nss/lib/softoken/softoknt.h',
-        '<(nss_directory)/nss/lib/softoken/tlsprf.c',
-        '<(nss_directory)/nss/lib/ssl/sslerr.h',
-        '<(nss_directory)/nss/lib/util/SECerrs.h',
-        '<(nss_directory)/nss/lib/util/base64.h',
-        '<(nss_directory)/nss/lib/util/ciferfam.h',
-        '<(nss_directory)/nss/lib/util/derdec.c',
-        '<(nss_directory)/nss/lib/util/derenc.c',
-        '<(nss_directory)/nss/lib/util/dersubr.c',
-        '<(nss_directory)/nss/lib/util/dertime.c',
-        '<(nss_directory)/nss/lib/util/errstrs.c',
-        '<(nss_directory)/nss/lib/util/hasht.h',
-        '<(nss_directory)/nss/lib/util/nssb64.h',
-        '<(nss_directory)/nss/lib/util/nssb64d.c',
-        '<(nss_directory)/nss/lib/util/nssb64e.c',
-        '<(nss_directory)/nss/lib/util/nssb64t.h',
-        '<(nss_directory)/nss/lib/util/nssilckt.h',
-        '<(nss_directory)/nss/lib/util/nssilock.c',
-        '<(nss_directory)/nss/lib/util/nssilock.h',
-        '<(nss_directory)/nss/lib/util/nsslocks.h',
-        '<(nss_directory)/nss/lib/util/nssrwlk.c',
-        '<(nss_directory)/nss/lib/util/nssrwlk.h',
-        '<(nss_directory)/nss/lib/util/nssrwlkt.h',
-        '<(nss_directory)/nss/lib/util/nssutil.h',
-        '<(nss_directory)/nss/lib/util/oidstring.c',
-        '<(nss_directory)/nss/lib/util/pkcs11.h',
-        '<(nss_directory)/nss/lib/util/pkcs11f.h',
-        '<(nss_directory)/nss/lib/util/pkcs11n.h',
-        '<(nss_directory)/nss/lib/util/pkcs11p.h',
-        '<(nss_directory)/nss/lib/util/pkcs11t.h',
-        '<(nss_directory)/nss/lib/util/pkcs11u.h',
-        '<(nss_directory)/nss/lib/util/pkcs1sig.c',
-        '<(nss_directory)/nss/lib/util/pkcs1sig.h',
-        '<(nss_directory)/nss/lib/util/portreg.c',
-        '<(nss_directory)/nss/lib/util/portreg.h',
-        '<(nss_directory)/nss/lib/util/quickder.c',
-        '<(nss_directory)/nss/lib/util/secalgid.c',
-        '<(nss_directory)/nss/lib/util/secasn1.h',
-        '<(nss_directory)/nss/lib/util/secasn1d.c',
-        '<(nss_directory)/nss/lib/util/secasn1e.c',
-        '<(nss_directory)/nss/lib/util/secasn1t.h',
-        '<(nss_directory)/nss/lib/util/secasn1u.c',
-        '<(nss_directory)/nss/lib/util/seccomon.h',
-        '<(nss_directory)/nss/lib/util/secder.h',
-        '<(nss_directory)/nss/lib/util/secdert.h',
-        '<(nss_directory)/nss/lib/util/secdig.c',
-        '<(nss_directory)/nss/lib/util/secdig.h',
-        '<(nss_directory)/nss/lib/util/secdigt.h',
-        '<(nss_directory)/nss/lib/util/secerr.h',
-        '<(nss_directory)/nss/lib/util/secitem.c',
-        '<(nss_directory)/nss/lib/util/secitem.h',
-        '<(nss_directory)/nss/lib/util/secoid.c',
-        '<(nss_directory)/nss/lib/util/secoid.h',
-        '<(nss_directory)/nss/lib/util/secoidt.h',
-        '<(nss_directory)/nss/lib/util/secport.c',
-        '<(nss_directory)/nss/lib/util/secport.h',
-        '<(nss_directory)/nss/lib/util/sectime.c',
-        '<(nss_directory)/nss/lib/util/templates.c',
-        '<(nss_directory)/nss/lib/util/utf8.c',
-        '<(nss_directory)/nss/lib/util/utilmod.c',
-        '<(nss_directory)/nss/lib/util/utilmodt.h',
-        '<(nss_directory)/nss/lib/util/utilpars.c',
-        '<(nss_directory)/nss/lib/util/utilpars.h',
-        '<(nss_directory)/nss/lib/util/utilparst.h',
-        '<(nss_directory)/nss/lib/util/utilrename.h',
-      ],
-      'sources!': [
-        # mpi_arm.c is included by mpi_arm_mac.c.
-        # NOTE: mpi_arm.c can be used directly on Linux. mpi_arm.c will need
-        # to be excluded conditionally if we start to build NSS on Linux.
-        '<(nss_directory)/nss/lib/freebl/mpi/mpi_arm.c',
-        # primes.c is included by mpprime.c.
-        '<(nss_directory)/nss/lib/freebl/mpi/primes.c',
-        # unix_rand.c and win_rand.c are included by sysrand.c.
-        '<(nss_directory)/nss/lib/freebl/unix_rand.c',
-        '<(nss_directory)/nss/lib/freebl/win_rand.c',
-        # debug_module.c is included by pk11load.c.
-        '<(nss_directory)/nss/lib/pk11wrap/debug_module.c',
-      ],
-      'dependencies': [
-        'nspr_dart',  # Added by Dart (the _dart postfix)
-        # Removed by Dart: nss_static_avx target dependency.
-        'sqlite.gyp:sqlite_dart',  # Changed by Dart prefix ../sqllite removed _dart postfix added.
-      ],
-      'export_dependent_settings': [
-        'nspr_dart',  # Added by Dart (the _dart postfix)
-      ],
-      'defines': [
-        'MP_API_COMPATIBLE',
-        'NSS_DISABLE_DBM',
-        'NSS_STATIC',
-        'NSS_USE_STATIC_LIBS',
-        'RIJNDAEL_INCLUDE_TABLES',
-        'SHLIB_VERSION=\"3\"',
-        'SOFTOKEN_SHLIB_VERSION=\"3\"',
-        'USE_UTIL_DIRECTLY',
-      ],
-      'include_dirs': [
-        '<(nss_directory)/nss/lib/base',
-        '<(nss_directory)/nss/lib/certdb',
-        '<(nss_directory)/nss/lib/certhigh',
-        '<(nss_directory)/nss/lib/cryptohi',
-        '<(nss_directory)/nss/lib/dev',
-        '<(nss_directory)/nss/lib/freebl',
-        '<(nss_directory)/nss/lib/freebl/ecl',
-        '<(nss_directory)/nss/lib/freebl/mpi',
-        '<(nss_directory)/nss/lib/libpkix/include',
-        '<(nss_directory)/nss/lib/libpkix/pkix/certsel',
-        '<(nss_directory)/nss/lib/libpkix/pkix/checker',
-        '<(nss_directory)/nss/lib/libpkix/pkix/crlsel',
-        '<(nss_directory)/nss/lib/libpkix/pkix/params',
-        '<(nss_directory)/nss/lib/libpkix/pkix/results',
-        '<(nss_directory)/nss/lib/libpkix/pkix/store',
-        '<(nss_directory)/nss/lib/libpkix/pkix/top',
-        '<(nss_directory)/nss/lib/libpkix/pkix/util',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/module',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/pki',
-        '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/system',
-        '<(nss_directory)/nss/lib/nss',
-        '<(nss_directory)/nss/lib/pk11wrap',
-        '<(nss_directory)/nss/lib/pkcs7',
-        '<(nss_directory)/nss/lib/pki',
-        '<(nss_directory)/nss/lib/smime',
-        '<(nss_directory)/nss/lib/softoken',
-        '<(nss_directory)/nss/lib/ssl',
-        '<(nss_directory)/nss/lib/util',
-      ],
-      'direct_dependent_settings': {
-        'defines': [
-          'NSS_STATIC',
-          'NSS_USE_STATIC_LIBS',
-          'USE_UTIL_DIRECTLY',
-        ],
-        'include_dirs': [
-          '<(nss_directory)/nspr/pr/include',
-          '<(nss_directory)/nspr/lib/ds',
-          '<(nss_directory)/nspr/lib/libc/include',
-          '<(nss_directory)/nss/lib/base',
-          '<(nss_directory)/nss/lib/certdb',
-          '<(nss_directory)/nss/lib/certhigh',
-          '<(nss_directory)/nss/lib/cryptohi',
-          '<(nss_directory)/nss/lib/dev',
-          '<(nss_directory)/nss/lib/freebl',
-          '<(nss_directory)/nss/lib/freebl/ecl',
-          '<(nss_directory)/nss/lib/nss',
-          '<(nss_directory)/nss/lib/pk11wrap',
-          '<(nss_directory)/nss/lib/pkcs7',
-          '<(nss_directory)/nss/lib/pki',
-          '<(nss_directory)/nss/lib/smime',
-          '<(nss_directory)/nss/lib/softoken',
-          '<(nss_directory)/nss/lib/util',
-        ],
-      },
-      'msvs_disabled_warnings': [4018, 4101, 4267, ],
-      'variables': {
-        'clang_warning_flags': [
-          # nss doesn't explicitly cast between different enum types.
-          '-Wno-conversion',
-          # nss passes "const char*" through "void*".
-          '-Wno-incompatible-pointer-types',
-          # nss prefers `a && b || c` over `(a && b) || c`.
-          '-Wno-logical-op-parentheses',
-          # nss doesn't use exhaustive switches on enums
-          '-Wno-switch',
-          # nss has some `unsigned < 0` checks.
-          '-Wno-tautological-compare',
-        ],
-      },
-      'conditions': [
-        ['exclude_nss_root_certs==1', {
-          'defines': [
-            'NSS_DISABLE_ROOT_CERTS',
-          ],
-        }],
-        ['exclude_nss_libpkix==1', {
-          'defines': [
-            'NSS_DISABLE_LIBPKIX',
-          ],
-          # Changed by Dart:
-          # nss_directory contains .., which is bad in a regular expression.
-          # So we use the partial match by dropping '^' from '^nss/...
-          'sources/': [
-            ['exclude', 'nss/lib/libpkix/'],
-          ],
-          'sources!': [
-            '<(nss_directory)/nss/lib/certhigh/certvfypkix.c',
-            '<(nss_directory)/nss/lib/certhigh/certvfypkixprint.c',
-          ],
-          # Changed by Dart:
-          # nss_directory contains .., which is bad in a regular expression.
-          # So we use the partial match by dropping '^' from '^nss/...
-          'include_dirs/': [
-            ['exclude', 'nss/lib/libpkix/'],
-          ],
-        }, { # else: exclude_nss_libpkix==0
-          # Disable the LDAP code in libpkix.
-          'defines': [
-            'NSS_PKIX_NO_LDAP',
-          ],
-          'sources!': [
-            '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/module/pkix_pl_ldapcertstore.c',
-            '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/module/pkix_pl_ldapcertstore.h',
-            '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/module/pkix_pl_ldapdefaultclient.c',
-            '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/module/pkix_pl_ldapdefaultclient.h',
-            '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/module/pkix_pl_ldaprequest.c',
-            '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/module/pkix_pl_ldaprequest.h',
-            '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/module/pkix_pl_ldapresponse.c',
-            '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/module/pkix_pl_ldapresponse.h',
-            '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/module/pkix_pl_ldapt.h',
-            '<(nss_directory)/nss/lib/libpkix/pkix_pl_nss/module/pkix_pl_ldaptemplates.c',
-          ],
-        }],
-        ['target_arch=="ia32"', {
-          'sources!': [
-            '<(nss_directory)/nss/lib/freebl/mpi/mpi_amd64.c',
-          ],
-        }],
-        # Added by Dart.
-        ['OS=="linux"', {
-          'defines': [
-            'XP_UNIX',
-            'HAVE_STRERROR',
-            'SHLIB_SUFFIX=\"so\"',
-            'SHLIB_PREFIX=\"lib\"',
-            'SHLIB_VERSION=\"3\"',
-            'SOFTOKEN_SHLIB_VERSION=\"3\"',
-            'SOFTOKEN_LIB_NAME=\"libsoftokn3.so\"',
-          ],
-          'sources!': [
-            '<(nss_directory)/nss/lib/freebl/mpi/mpi_amd64.c',
-            '<(nss_directory)/nss/lib/freebl/mpi/mpi_x86_asm.c',
-          ],
-        }],
-        ['target_arch=="x64" and OS!="win"', {
-          'sources!': [
-            '<(nss_directory)/nss/lib/freebl/chacha20/chacha20.c',
-            '<(nss_directory)/nss/lib/freebl/poly1305/poly1305.c',
-            ],
-        }, { # else: target_arch!="x64" or OS=="win"
-          'sources!': [
-            '<(nss_directory)/nss/lib/freebl/chacha20/chacha20_vec.c',
-            '<(nss_directory)/nss/lib/freebl/poly1305/poly1305-donna-x64-sse2-incremental-source.c',
-            ],
-        }],
-        ['OS=="mac" or OS=="ios"', {
-          'defines': [
-            'XP_UNIX',
-            'DARWIN',
-            'HAVE_STRERROR',
-            'HAVE_BSD_FLOCK',
-            'SHLIB_SUFFIX=\"dylib\"',
-            'SHLIB_PREFIX=\"lib\"',
-            'SOFTOKEN_LIB_NAME=\"libsoftokn3.dylib\"',
-          ],
-          'sources!': [
-            '<(nss_directory)/nss/lib/freebl/mpi/mpi_amd64.c',
-            '<(nss_directory)/nss/lib/freebl/mpi/mpi_x86_asm.c',
-          ],
-          'variables': {
-            'forced_include_file': 'nss_build_config_mac.h',
-          },
-          'xcode_settings': {
-            'conditions': [
-              ['component == "shared_library"', {
-                'GCC_SYMBOLS_PRIVATE_EXTERN': 'NO',  # no -fvisibility=hidden
-              }],
-            ],
-            # Define processor architecture specific macros in
-            # <(forced_include_file).
-            'OTHER_CFLAGS': [
-              '-include', '<(forced_include_file)',
-            ],
-          },
-        }, { # else: OS!="mac" and OS!="ios"
-          'sources!': [
-            '<(nss_directory)/nss/lib/freebl/mpi/mpi_arm_mac.c',
-          ],
-        }],
-        ['OS=="win"', {
-          'defines': [
-            'SHLIB_SUFFIX=\"dll\"',
-            'SHLIB_PREFIX=\"\"',
-            'SOFTOKEN_LIB_NAME=\"softokn3.dll\"',
-            'XP_PC',
-            'WIN32',
-            'WIN95',
-            '_WINDOWS',
-          ],
-          'direct_dependent_settings': {
-            'defines': [
-              '_WINDOWS',
-            ],
-          },
-          'sources!': [
-            '<(nss_directory)/nss/lib/freebl/mpi/mpi_amd64.c',
-            # If needed it will be included by os_windows.c.
-            '<(nss_directory)/nss/lib/freebl/mpi/mpi_x86_asm.c',
-          ],
-          # Changed by Dart. We don't use target_arch. This was moved into
-          # configurations instead.
-          # 'conditions': [
-          #   ['target_arch=="ia32"', {
-          #     'defines': [
-          #       'NSS_X86_OR_X64',
-          #       'NSS_X86',
-          #       '_X86_',
-          #       'MP_ASSEMBLY_MULTIPLY',
-          #       'MP_ASSEMBLY_SQUARE',
-          #       'MP_ASSEMBLY_DIV_2DX1D',
-          #       'MP_USE_UINT_DIGIT',
-          #       'MP_NO_MP_WORD',
-          # Changed by Dart: 'USE_HW_AES' and 'INTEL_GCM' are not enabled.
-          #       'USE_HW_AES',
-          #       'INTEL_GCM',
-          #     ],
-          #   }],
-          #   'msvs_settings': {
-          #     'MASM': {
-          #       'UseSafeExceptionHandlers': 'true',
-          #     },
-          #   },
-          #   ['target_arch=="x64"', {
-          #     'defines': [
-          #       'NSS_USE_64',
-          #       'NSS_X86_OR_X64',
-          #       'NSS_X64',
-          #       '_AMD64_',
-          #       'MP_CHAR_STORE_SLOW',
-          #       'MP_IS_LITTLE_ENDIAN',
-          #       'WIN64',
-          #     ],
-          #     'sources!': [
-          #       '<(nss_directory)/nss/lib/freebl/mpi/mpi_amd64.c',
-          #       '<(nss_directory)/nss/lib/freebl/mpi/mpi_x86_asm.c',
-          #     ],
-          #    }],
-          # ],
-        }, { # else: OS!="win"
-          'sources!': [
-            'os_windows.c',
-            # mpi_x86_asm.c contains MSVC inline assembly code.
-            '<(nss_directory)/nss/lib/freebl/mpi/mpi_x86_asm.c',
-          ],
-        }],
-      ],
-    },
-  ],
-  }]],
-}
diff --git a/runtime/bin/net/nss_memio.cc b/runtime/bin/net/nss_memio.cc
deleted file mode 100644
index f8f4f82..0000000
--- a/runtime/bin/net/nss_memio.cc
+++ /dev/null
@@ -1,538 +0,0 @@
-// 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.
-// Written in NSPR style to also be suitable for adding to the NSS demo suite
-
-// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// This file is a modified copy of Chromium's src/net/base/nss_memio.c.
-// char* has been changed to uint8_t* everywhere, and C++ casts are used.
-// Revision 291806 (this should agree with "nss_rev" in DEPS).
-
-
-/* memio is a simple NSPR I/O layer that lets you decouple NSS from
- * the real network.  It's rather like openssl's memory bio,
- * and is useful when your app absolutely, positively doesn't
- * want to let NSS do its own networking.
- */
-#include "bin/net/nss_memio.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "prerror.h"
-#include "prinit.h"
-#include "prlog.h"
-
-/*--------------- private memio types -----------------------*/
-
-/*----------------------------------------------------------------------
- Simple private circular buffer class.  Size cannot be changed once allocated.
-----------------------------------------------------------------------*/
-
-struct memio_buffer {
-    int head;     /* where to take next byte out of buf */
-    int tail;     /* where to put next byte into buf */
-    int bufsize;  /* number of bytes allocated to buf */
-    /* TODO(port): error handling is pessimistic right now.
-     * Once an error is set, the socket is considered broken
-     * (PR_WOULD_BLOCK_ERROR not included).
-     */
-    PRErrorCode last_err;
-    uint8_t* buf;
-};
-
-
-/* The 'secret' field of a PRFileDesc created by memio_CreateIOLayer points
- * to one of these.
- * In the public header, we use struct memio_Private as a typesafe alias
- * for this.  This causes a few ugly typecasts in the private file, but
- * seems safer.
- */
-struct PRFilePrivate {
-    /* read requests are satisfied from this buffer */
-    struct memio_buffer readbuf;
-
-    /* write requests are satisfied from this buffer */
-    struct memio_buffer writebuf;
-
-    /* SSL needs to know socket peer's name */
-    PRNetAddr peername;
-
-    /* if set, empty I/O returns EOF instead of EWOULDBLOCK */
-    int eof;
-
-    /* if set, the number of bytes requested from readbuf that were not
-     * fulfilled (due to readbuf being empty) */
-    int read_requested;
-};
-
-/*--------------- private memio_buffer functions ---------------------*/
-
-/* Forward declarations.  */
-
-/* Allocate a memio_buffer of given size. */
-static void memio_buffer_new(struct memio_buffer *mb, int size);
-
-/* Deallocate a memio_buffer allocated by memio_buffer_new. */
-static void memio_buffer_destroy(struct memio_buffer *mb);
-
-/* How many bytes can be read out of the buffer without wrapping */
-static int memio_buffer_used_contiguous(const struct memio_buffer *mb);
-
-/* How many bytes exist after the wrap? */
-static int memio_buffer_wrapped_bytes(const struct memio_buffer *mb);
-
-/* How many bytes can be written into the buffer without wrapping */
-static int memio_buffer_unused_contiguous(const struct memio_buffer *mb);
-
-/* Write n bytes into the buffer.  Returns number of bytes written. */
-static int memio_buffer_put(struct memio_buffer *mb, const uint8_t* buf, int n);
-
-/* Read n bytes from the buffer.  Returns number of bytes read. */
-static int memio_buffer_get(struct memio_buffer *mb, uint8_t* buf, int n);
-
-/* Allocate a memio_buffer of given size. */
-static void memio_buffer_new(struct memio_buffer *mb, int size) {
-    mb->head = 0;
-    mb->tail = 0;
-    mb->bufsize = size;
-    mb->buf = static_cast<uint8_t*>(malloc(size));
-}
-
-/* Deallocate a memio_buffer allocated by memio_buffer_new. */
-static void memio_buffer_destroy(struct memio_buffer *mb) {
-    free(mb->buf);
-    mb->buf = NULL;
-    mb->bufsize = 0;
-    mb->head = 0;
-    mb->tail = 0;
-}
-
-/* How many bytes can be read out of the buffer without wrapping */
-static int memio_buffer_used_contiguous(const struct memio_buffer *mb) {
-    return (((mb->tail >= mb->head) ? mb->tail : mb->bufsize) - mb->head);
-}
-
-/* How many bytes exist after the wrap? */
-static int memio_buffer_wrapped_bytes(const struct memio_buffer *mb) {
-    return (mb->tail >= mb->head) ? 0 : mb->tail;
-}
-
-/* How many bytes can be written into the buffer without wrapping */
-static int memio_buffer_unused_contiguous(const struct memio_buffer *mb) {
-    if (mb->head > mb->tail) return mb->head - mb->tail - 1;
-    return mb->bufsize - mb->tail - (mb->head == 0);
-}
-
-/* Write n bytes into the buffer.  Returns number of bytes written. */
-static int memio_buffer_put(struct memio_buffer *mb,
-                            const uint8_t* buf,
-                            int n) {
-    int len;
-    int transferred = 0;
-
-    /* Handle part before wrap */
-    len = PR_MIN(n, memio_buffer_unused_contiguous(mb));
-    if (len > 0) {
-        /* Buffer not full */
-        memmove(&mb->buf[mb->tail], buf, len);
-        mb->tail += len;
-        if (mb->tail == mb->bufsize)
-            mb->tail = 0;
-        n -= len;
-        buf += len;
-        transferred += len;
-
-        /* Handle part after wrap */
-        len = PR_MIN(n, memio_buffer_unused_contiguous(mb));
-        if (len > 0) {
-            /* Output buffer still not full, input buffer still not empty */
-            memmove(&mb->buf[mb->tail], buf, len);
-            mb->tail += len;
-            if (mb->tail == mb->bufsize)
-                mb->tail = 0;
-                transferred += len;
-        }
-    }
-
-    return transferred;
-}
-
-
-/* Read n bytes from the buffer.  Returns number of bytes read. */
-static int memio_buffer_get(struct memio_buffer *mb, uint8_t* buf, int n) {
-    int len;
-    int transferred = 0;
-
-    /* Handle part before wrap */
-    len = PR_MIN(n, memio_buffer_used_contiguous(mb));
-    if (len) {
-        memmove(buf, &mb->buf[mb->head], len);
-        mb->head += len;
-        if (mb->head == mb->bufsize)
-            mb->head = 0;
-        n -= len;
-        buf += len;
-        transferred += len;
-
-        /* Handle part after wrap */
-        len = PR_MIN(n, memio_buffer_used_contiguous(mb));
-        if (len) {
-        memmove(buf, &mb->buf[mb->head], len);
-        mb->head += len;
-            if (mb->head == mb->bufsize)
-                mb->head = 0;
-                transferred += len;
-        }
-    }
-
-    return transferred;
-}
-
-/*--------------- private memio functions -----------------------*/
-
-static PRStatus PR_CALLBACK memio_Close(PRFileDesc *fd) {
-    struct PRFilePrivate *secret = fd->secret;
-    memio_buffer_destroy(&secret->readbuf);
-    memio_buffer_destroy(&secret->writebuf);
-    free(secret);
-    fd->dtor(fd);
-    return PR_SUCCESS;
-}
-
-static PRStatus PR_CALLBACK memio_Shutdown(PRFileDesc *fd, PRIntn how) {
-    /* TODO: pass shutdown status to app somehow */
-    return PR_SUCCESS;
-}
-
-/* If there was a network error in the past taking bytes
- * out of the buffer, return it to the next call that
- * tries to read from an empty buffer.
- */
-static int PR_CALLBACK memio_Recv(PRFileDesc *fd,
-                                  uint8_t *buf,
-                                  PRInt32 len,
-                                  PRIntn flags,
-                                  PRIntervalTime timeout) {
-    struct PRFilePrivate *secret;
-    struct memio_buffer *mb;
-    int rv;
-
-    if (flags) {
-        PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);
-        return -1;
-    }
-
-    secret = fd->secret;
-    mb = &secret->readbuf;
-    PR_ASSERT(mb->bufsize);
-    rv = memio_buffer_get(mb, buf, len);
-    if (rv == 0 && !secret->eof) {
-        secret->read_requested = len;
-        /* If there is no more data in the buffer, report any pending errors
-         * that were previously observed. Note that both the readbuf and the
-         * writebuf are checked for errors, since the application may have
-         * encountered a socket error while writing that would otherwise not
-         * be reported until the application attempted to write again - which
-         * it may never do.
-         */
-        if (mb->last_err)
-            PR_SetError(mb->last_err, 0);
-        else if (secret->writebuf.last_err)
-            PR_SetError(secret->writebuf.last_err, 0);
-        else
-            PR_SetError(PR_WOULD_BLOCK_ERROR, 0);
-        return -1;
-    }
-
-    secret->read_requested = 0;
-    return rv;
-}
-
-static int PR_CALLBACK memio_Read(PRFileDesc *fd, uint8_t *buf, PRInt32 len) {
-    /* pull bytes from buffer */
-    return memio_Recv(fd, buf, len, 0, PR_INTERVAL_NO_TIMEOUT);
-}
-
-static int PR_CALLBACK memio_Send(PRFileDesc *fd,
-                                  const uint8_t *buf,
-                                  PRInt32 len,
-                                  PRIntn flags,
-                                  PRIntervalTime timeout) {
-    struct PRFilePrivate *secret;
-    struct memio_buffer *mb;
-    int rv;
-
-    secret = fd->secret;
-    mb = &secret->writebuf;
-    PR_ASSERT(mb->bufsize);
-
-    /* Note that the read error state is not reported, because it cannot be
-     * reported until all buffered data has been read. If there is an error
-     * with the next layer, attempting to call Send again will report the
-     * error appropriately.
-     */
-    if (mb->last_err) {
-        PR_SetError(mb->last_err, 0);
-        return -1;
-    }
-    rv = memio_buffer_put(mb, buf, len);
-    if (rv == 0) {
-        PR_SetError(PR_WOULD_BLOCK_ERROR, 0);
-        return -1;
-    }
-    return rv;
-}
-
-static int PR_CALLBACK memio_Write(PRFileDesc *fd,
-                                   const uint8_t *buf,
-                                   PRInt32 len) {
-    /* append bytes to buffer */
-    return memio_Send(fd, buf, len, 0, PR_INTERVAL_NO_TIMEOUT);
-}
-
-static PRStatus PR_CALLBACK memio_GetPeerName(PRFileDesc *fd, PRNetAddr *addr) {
-    /* TODO: fail if memio_SetPeerName has not been called */
-    struct PRFilePrivate *secret = fd->secret;
-    *addr = secret->peername;
-    return PR_SUCCESS;
-}
-
-static PRStatus memio_GetSocketOption(PRFileDesc *fd,
-                                      PRSocketOptionData *data) {
-    /*
-     * Even in the original version for real tcp sockets,
-     * PR_SockOpt_Nonblocking is a special case that does not
-     * translate to a getsockopt() call
-     */
-    if (PR_SockOpt_Nonblocking == data->option) {
-        data->value.non_blocking = PR_TRUE;
-        return PR_SUCCESS;
-    }
-    PR_SetError(PR_OPERATION_NOT_SUPPORTED_ERROR, 0);
-    return PR_FAILURE;
-}
-
-/*--------------- private memio data -----------------------*/
-
-/*
- * Implement just the bare minimum number of methods needed to make ssl happy.
- *
- * Oddly, PR_Recv calls ssl_Recv calls ssl_SocketIsBlocking calls
- * PR_GetSocketOption, so we have to provide an implementation of
- * PR_GetSocketOption that just says "I'm nonblocking".
- */
-
-static struct PRIOMethods  memio_layer_methods = {
-    PR_DESC_LAYERED,
-    memio_Close,
-    (PRReadFN)memio_Read,
-    (PRWriteFN)memio_Write,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    memio_Shutdown,
-    (PRRecvFN)memio_Recv,
-    (PRSendFN)memio_Send,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    memio_GetPeerName,
-    NULL,
-    NULL,
-    memio_GetSocketOption,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-};
-
-static PRDescIdentity memio_identity = PR_INVALID_IO_LAYER;
-
-static PRStatus memio_InitializeLayerName(void) {
-    memio_identity = PR_GetUniqueIdentity("memio");
-    return PR_SUCCESS;
-}
-
-/*--------------- public memio functions -----------------------*/
-
-PRFileDesc *memio_CreateIOLayer(int readbufsize, int writebufsize) {
-    PRFileDesc *fd;
-    struct PRFilePrivate *secret;
-    static PRCallOnceType once;
-
-    PR_CallOnce(&once, memio_InitializeLayerName);
-
-    fd = PR_CreateIOLayerStub(memio_identity, &memio_layer_methods);
-    secret = static_cast<PRFilePrivate*>(malloc(sizeof(struct PRFilePrivate)));
-    memset(secret, 0, sizeof(*secret));
-
-    memio_buffer_new(&secret->readbuf, readbufsize);
-    memio_buffer_new(&secret->writebuf, writebufsize);
-    fd->secret = secret;
-    return fd;
-}
-
-void memio_SetPeerName(PRFileDesc* fd, const PRNetAddr* peername) {
-    PRFileDesc *memiofd = PR_GetIdentitiesLayer(fd, memio_identity);
-    struct PRFilePrivate *secret = memiofd->secret;
-    secret->peername = *peername;
-}
-
-memio_Private* memio_GetSecret(PRFileDesc* fd) {
-  PRFileDesc* memiofd = PR_GetIdentitiesLayer(fd, memio_identity);
-  struct PRFilePrivate *secret =  memiofd->secret;
-  return reinterpret_cast<memio_Private*>(secret);
-}
-
-int memio_GetReadRequest(memio_Private *secret) {
-  return reinterpret_cast<PRFilePrivate*>(secret)->read_requested;
-}
-
-int memio_GetReadParams(memio_Private* secret, uint8_t** buf) {
-  struct memio_buffer* mb =
-      &(reinterpret_cast<PRFilePrivate*>(secret)->readbuf);
-  PR_ASSERT(mb->bufsize);
-
-  *buf = &mb->buf[mb->tail];
-  return memio_buffer_unused_contiguous(mb);
-}
-
-int memio_GetReadableBufferSize(memio_Private *secret) {
-  struct memio_buffer* mb =
-      &(reinterpret_cast<PRFilePrivate*>(secret)->readbuf);
-  PR_ASSERT(mb->bufsize);
-
-  return memio_buffer_used_contiguous(mb);
-}
-
-void memio_PutReadResult(memio_Private *secret, int bytes_read) {
-  struct memio_buffer* mb =
-      &(reinterpret_cast<PRFilePrivate*>(secret)->readbuf);
-  PR_ASSERT(mb->bufsize);
-
-  if (bytes_read > 0) {
-    mb->tail += bytes_read;
-    if (mb->tail == mb->bufsize)
-      mb->tail = 0;
-  } else if (bytes_read == 0) {
-    /* Record EOF condition and report to caller when buffer runs dry */
-    reinterpret_cast<PRFilePrivate*>(secret)->eof = PR_TRUE;
-  } else /* if (bytes_read < 0) */ {
-    mb->last_err = bytes_read;
-  }
-}
-
-int memio_GetWriteParams(memio_Private *secret,
-                          const uint8_t** buf1, unsigned int *len1,
-                          const uint8_t** buf2, unsigned int *len2) {
-  struct memio_buffer* mb =
-      &(reinterpret_cast<PRFilePrivate*>(secret)->writebuf);
-  PR_ASSERT(mb->bufsize);
-
-  if (mb->last_err)
-    return mb->last_err;
-
-  *buf1 = &mb->buf[mb->head];
-  *len1 = memio_buffer_used_contiguous(mb);
-  *buf2 = mb->buf;
-  *len2 = memio_buffer_wrapped_bytes(mb);
-  return 0;
-}
-
-void memio_PutWriteResult(memio_Private *secret, int bytes_written) {
-  struct memio_buffer* mb =
-      &(reinterpret_cast<PRFilePrivate*>(secret)->writebuf);
-  PR_ASSERT(mb->bufsize);
-
-  if (bytes_written > 0) {
-    mb->head += bytes_written;
-    if (mb->head >= mb->bufsize)
-      mb->head -= mb->bufsize;
-  } else if (bytes_written < 0) {
-    mb->last_err = bytes_written;
-  }
-}
-
-/*--------------- private memio_buffer self-test -----------------*/
-
-/* Even a trivial unit test is very helpful when doing circular buffers. */
-/*#define TRIVIAL_SELF_TEST*/
-#ifdef TRIVIAL_SELF_TEST
-
-#define TEST_BUFLEN 7
-
-#define CHECKEQ(a, b) { \
-    if ((a) != (b)) { \
-        printf("%d != %d, Test failed line %d\n", a, b, __LINE__); \
-        exit(1); \
-    } \
-}
-
-#define FROM_STR(a) reinterpret_cast<const uint8_t*>(a)
-
-int main() {
-    struct memio_buffer mb;
-    uint8_t buf[100];
-    int i;
-
-    memio_buffer_new(&mb, TEST_BUFLEN);
-
-    CHECKEQ(memio_buffer_unused_contiguous(&mb), TEST_BUFLEN-1);
-    CHECKEQ(memio_buffer_used_contiguous(&mb), 0);
-
-    CHECKEQ(memio_buffer_put(&mb, FROM_STR("howdy"), 5), 5);
-
-    CHECKEQ(memio_buffer_unused_contiguous(&mb), TEST_BUFLEN-1-5);
-    CHECKEQ(memio_buffer_used_contiguous(&mb), 5);
-    CHECKEQ(memio_buffer_wrapped_bytes(&mb), 0);
-
-    CHECKEQ(memio_buffer_put(&mb, FROM_STR("!"), 1), 1);
-
-    CHECKEQ(memio_buffer_unused_contiguous(&mb), 0);
-    CHECKEQ(memio_buffer_used_contiguous(&mb), 6);
-    CHECKEQ(memio_buffer_wrapped_bytes(&mb), 0);
-
-    CHECKEQ(memio_buffer_get(&mb, buf, 6), 6);
-    CHECKEQ(memcmp(buf, FROM_STR("howdy!"), 6), 0);
-
-    CHECKEQ(memio_buffer_unused_contiguous(&mb), 1);
-    CHECKEQ(memio_buffer_used_contiguous(&mb), 0);
-
-    CHECKEQ(memio_buffer_put(&mb, FROM_STR("01234"), 5), 5);
-
-    CHECKEQ(memio_buffer_used_contiguous(&mb), 1);
-    CHECKEQ(memio_buffer_wrapped_bytes(&mb), 4);
-    CHECKEQ(memio_buffer_unused_contiguous(&mb), TEST_BUFLEN-1-5);
-
-    CHECKEQ(memio_buffer_put(&mb, FROM_STR("5"), 1), 1);
-
-    CHECKEQ(memio_buffer_unused_contiguous(&mb), 0);
-    CHECKEQ(memio_buffer_used_contiguous(&mb), 1);
-
-    /* TODO: add more cases */
-
-    printf("Test passed\n");
-    exit(0);
-}
-
-#endif
diff --git a/runtime/bin/net/nss_memio.h b/runtime/bin/net/nss_memio.h
deleted file mode 100644
index acfd467..0000000
--- a/runtime/bin/net/nss_memio.h
+++ /dev/null
@@ -1,111 +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.
-// Written in NSPR style to also be suitable for adding to the NSS demo suite
-
-// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// This file is a modified copy of Chromium's src/net/base/nss_memio.h.
-// char* has been changed to uint8_t* everywhere, and C++ casts are used.
-// Revision 291806 (this should agree with "nss_rev" in DEPS).
-
-#ifndef BIN_NET_NSS_MEMIO_H_
-#define BIN_NET_NSS_MEMIO_H_
-
-#include <stddef.h>
-#include "vm/globals.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "prio.h"
-
-/* Opaque structure.  Really just a more typesafe alias for PRFilePrivate. */
-struct memio_Private;
-typedef struct memio_Private memio_Private;
-
-/*----------------------------------------------------------------------
- NSPR I/O layer that terminates in a pair of circular buffers
- rather than talking to the real network.
- To use this with NSS:
- 1) call memio_CreateIOLayer to create a fake NSPR socket
- 2) call SSL_ImportFD to ssl-ify the socket
- 3) Do your own networking calls to set up a TCP connection
- 4) call memio_SetPeerName to tell NSS about the other end of the connection
- 5) While at the same time doing plaintext nonblocking NSPR I/O as
-    usual to the nspr file descriptor returned by SSL_ImportFD,
-    your app must shuttle encrypted data between
-    the real network and memio's network buffers.
-    memio_GetReadParams/memio_PutReadResult
-    are the hooks you need to pump data into memio's input buffer,
-    and memio_GetWriteParams/memio_PutWriteResult
-    are the hooks you need to pump data out of memio's output buffer.
-----------------------------------------------------------------------*/
-
-/* Create the I/O layer and its two circular buffers. */
-PRFileDesc *memio_CreateIOLayer(int readbufsize, int writebufsize);
-
-/* Must call before trying to make an ssl connection */
-void memio_SetPeerName(PRFileDesc *fd, const PRNetAddr *peername);
-
-/* Return a private pointer needed by the following
- * four functions.  (We could have passed a PRFileDesc to
- * them, but that would be slower.  Better for the caller
- * to grab the pointer once and cache it.
- * This may be a premature optimization.)
- */
-memio_Private *memio_GetSecret(PRFileDesc *fd);
-
-/* Ask memio how many bytes were requested by a higher layer if the
- * last attempt to read data resulted in PR_WOULD_BLOCK_ERROR, due to the
- * transport buffer being empty. If the last attempt to read data from the
- * memio did not result in PR_WOULD_BLOCK_ERROR, returns 0.
- */
-int memio_GetReadRequest(memio_Private *secret);
-
-/* Ask memio where to put bytes from the network, and how many it can handle.
- * Returns bytes available to write, or 0 if none available.
- * Puts current buffer position into *buf.
- */
-int memio_GetReadParams(memio_Private *secret, uint8_t **buf);
-
-/* Ask memio how many bytes are contained in the internal buffer.
- * Returns bytes available to read, or 0 if none available.
- */
-int memio_GetReadableBufferSize(memio_Private *secret);
-
-/* Tell memio how many bytes were read from the network.
- * If bytes_read is 0, causes EOF to be reported to
- * NSS after it reads the last byte from the circular buffer.
- * If bytes_read is < 0, it is treated as an NSPR error code.
- * See nspr/pr/src/md/unix/unix_errors.c for how to
- * map from Unix errors to NSPR error codes.
- * On EWOULDBLOCK or the equivalent, don't call this function.
- */
-void memio_PutReadResult(memio_Private *secret, int bytes_read);
-
-/* Ask memio what data it has to send to the network.
- * If there was previous a write error, the NSPR error code is returned.
- * Otherwise, it returns 0 and provides up to two buffers of data by
- * writing the positions and lengths into |buf1|, |len1| and |buf2|, |len2|.
- */
-int memio_GetWriteParams(memio_Private *secret,
-                         const uint8_t **buf1, unsigned int *len1,
-                         const uint8_t **buf2, unsigned int *len2);
-
-/* Tell memio how many bytes were sent to the network.
- * If bytes_written is < 0, it is treated as an NSPR error code.
- * See nspr/pr/src/md/unix/unix_errors.c for how to
- * map from Unix errors to NSPR error codes.
- * On EWOULDBLOCK or the equivalent, don't call this function.
- */
-void memio_PutWriteResult(memio_Private *secret, int bytes_written);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif  // BIN_NET_NSS_MEMIO_H_
diff --git a/runtime/bin/net/os_linux.S b/runtime/bin/net/os_linux.S
deleted file mode 100644
index a009e83..0000000
--- a/runtime/bin/net/os_linux.S
+++ /dev/null
@@ -1,9 +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.
-
-#ifdef __i386__
-#include "../../../third_party/nss/nspr/pr/src/md/unix/os_Linux_x86.s"
-#elif defined(__x86_64__)
-#include "../../../third_party/nss/nspr/pr/src/md/unix/os_Linux_x86_64.s"
-#endif
diff --git a/runtime/bin/net/os_windows.c b/runtime/bin/net/os_windows.c
deleted file mode 100644
index 07ccdc5..0000000
--- a/runtime/bin/net/os_windows.c
+++ /dev/null
@@ -1,11 +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.
-
-#if !defined(_MSC_VER)
-#error "This file should only be compiled under MSVC"
-#endif
-
-#if defined(_X86_)
-#include "../../../third_party/nss/nss/lib/freebl/mpi/mpi_x86_asm.c"
-#endif
diff --git a/runtime/bin/net/sqlite.gyp b/runtime/bin/net/sqlite.gyp
deleted file mode 100644
index bcfc0c7..0000000
--- a/runtime/bin/net/sqlite.gyp
+++ /dev/null
@@ -1,226 +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.
-
-# Copyright (c) 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 file is a modified copy of Chromium's src/third_party/sqlite/sqlite.gyp.
-# Revision 291806 (this should agree with "nss_rev" in DEPS).
-{
-  # Added by Dart. All Dart comments refer to the following block or line.
-  'includes': [
-    '../../tools/gyp/runtime-configurations.gypi',
-    '../../tools/gyp/nss_configurations.gypi',
-  ],
-  'variables': {
-    # Added by Dart.
-    'sqlite_directory': '../../../third_party/sqlite',
-    'use_system_sqlite%': 0,
-    'required_sqlite_version': '3.6.1',
-  },
-  'target_defaults': {
-    'defines': [
-      'SQLITE_CORE',
-      'SQLITE_ENABLE_BROKEN_FTS2',
-      'SQLITE_ENABLE_FTS2',
-      'SQLITE_ENABLE_FTS3',
-      # Disabled by Dart: An external module with advanced unicode functions.
-      # 'SQLITE_ENABLE_ICU',
-      'SQLITE_ENABLE_MEMORY_MANAGEMENT',
-      'SQLITE_SECURE_DELETE',
-      'SQLITE_SEPARATE_CACHE_POOLS',
-      'THREADSAFE',
-      '_HAS_EXCEPTIONS=0',
-    ],
-  },
-  # Added by Dart.  We do not indent, so diffs with the original are clearer.
-  'conditions': [[ 'dart_io_support==1', {
-  'targets': [
-    {
-      'target_name': 'sqlite_dart',  # Added by Dart (the _dart postfix)
-      'toolsets':['host','target'],
-      'conditions': [
-        [ 'chromeos==1' , {
-            'defines': [
-                # Despite obvious warnings about not using this flag
-                # in deployment, we are turning off sync in ChromeOS
-                # and relying on the underlying journaling filesystem
-                # to do error recovery properly.  It's much faster.
-                'SQLITE_NO_SYNC',
-                ],
-          },
-        ],
-        ['use_system_sqlite', {
-          'type': 'none',
-          'direct_dependent_settings': {
-            'defines': [
-              'USE_SYSTEM_SQLITE',
-            ],
-          },
-
-          'conditions': [
-            ['OS == "ios"', {
-              'dependencies': [
-                'sqlite_regexp',
-              ],
-              'link_settings': {
-                'libraries': [
-                  '$(SDKROOT)/usr/lib/libsqlite3.dylib',
-                ],
-              },
-            }],
-            ['os_posix == 1 and OS != "mac" and OS != "ios" and OS != "android"', {
-              'direct_dependent_settings': {
-                'cflags': [
-                  # This next command produces no output but it it will fail
-                  # (and cause GYP to fail) if we don't have a recent enough
-                  # version of sqlite.
-                  '<!@(pkg-config --atleast-version=<(required_sqlite_version) sqlite3)',
-
-                  '<!@(pkg-config --cflags sqlite3)',
-                ],
-              },
-              'link_settings': {
-                'ldflags': [
-                  '<!@(pkg-config --libs-only-L --libs-only-other sqlite3)',
-                ],
-                'libraries': [
-                  '<!@(pkg-config --libs-only-l sqlite3)',
-                ],
-              },
-            }],
-          ],
-        }, { # !use_system_sqlite
-          'product_name': 'sqlite3',
-          'type': 'static_library',
-          # Changed by Dart: '<(sqlite_directory)/' added to all paths.
-          'sources': [
-            '<(sqlite_directory)/amalgamation/sqlite3.h',
-            '<(sqlite_directory)/amalgamation/sqlite3.c',
-            # fts2.c currently has a lot of conflicts when added to
-            # the amalgamation.  It is probably not worth fixing that.
-            '<(sqlite_directory)/src/ext/fts2/fts2.c',
-            '<(sqlite_directory)/src/ext/fts2/fts2.h',
-            '<(sqlite_directory)/src/ext/fts2/fts2_hash.c',
-            '<(sqlite_directory)/src/ext/fts2/fts2_hash.h',
-            '<(sqlite_directory)/src/ext/fts2/fts2_icu.c',
-            '<(sqlite_directory)/src/ext/fts2/fts2_porter.c',
-            '<(sqlite_directory)/src/ext/fts2/fts2_tokenizer.c',
-            '<(sqlite_directory)/src/ext/fts2/fts2_tokenizer.h',
-            '<(sqlite_directory)/src/ext/fts2/fts2_tokenizer1.c',
-          ],
-
-          # TODO(shess): Previously fts1 and rtree files were
-          # explicitly excluded from the build.  Make sure they are
-          # logically still excluded.
-
-          # TODO(shess): Should all of the sources be listed and then
-          # excluded?  For editing purposes?
-
-          'include_dirs': [
-            '<(sqlite_directory)/amalgamation',
-            # Needed for fts2 to build.
-            '<(sqlite_directory)/src/src',
-          ],
-          'dependencies': [
-            # Disabled by Dart.
-            # '../icu/icu.gyp:icui18n',
-            # Disabled by Dart.
-            # '../icu/icu.gyp:icuuc',
-          ],
-          'direct_dependent_settings': {
-            'include_dirs': [
-              '<(sqlite_directory)/.',
-              '<(sqlite_directory)/../..',
-            ],
-          },
-          'msvs_disabled_warnings': [
-            4018, 4244, 4267,
-          ],
-          'variables': {
-            'clang_warning_flags': [
-              # sqlite does `if (*a++ && *b++);` in a non-buggy way.
-              '-Wno-empty-body',
-              # sqlite has some `unsigned < 0` checks.
-              '-Wno-tautological-compare',
-            ],
-          },
-          'conditions': [
-            ['OS=="linux"', {
-              'link_settings': {
-                'libraries': [
-                  '-ldl',
-                ],
-              },
-            }],
-            ['OS == "mac" or OS == "ios"', {
-              'link_settings': {
-                'libraries': [
-                  '$(SDKROOT)/System/Library/Frameworks/CoreFoundation.framework',
-                ],
-              },
-            }],
-            ['OS == "android"', {
-              'defines': [
-                'HAVE_USLEEP=1',
-                'SQLITE_DEFAULT_JOURNAL_SIZE_LIMIT=1048576',
-                'SQLITE_DEFAULT_AUTOVACUUM=1',
-                'SQLITE_TEMP_STORE=3',
-                'SQLITE_ENABLE_FTS3_BACKWARDS',
-                'DSQLITE_DEFAULT_FILE_FORMAT=4',
-              ],
-            }],
-            ['os_posix == 1 and OS != "mac" and OS != "android"', {
-              'cflags': [
-                # SQLite doesn't believe in compiler warnings,
-                # preferring testing.
-                #   http://www.sqlite.org/faq.html#q17
-                '-Wno-int-to-pointer-cast',
-                '-Wno-pointer-to-int-cast',
-              ],
-            }],
-          ],
-        }],
-      ],
-    },
-  ],
-  'conditions': [
-    ['os_posix == 1 and OS != "mac" and OS != "ios" and OS != "android" and not use_system_sqlite', {
-      'targets': [
-        {
-          'target_name': 'sqlite_shell_dart',  # Added by Dart (the _dart postfix)
-          'type': 'executable',
-          'dependencies': [
-            # Disabled by Dart.
-            # '../icu/icu.gyp:icuuc',
-            'sqlite_dart',  # Added by Dart (the _dart postfix)
-          ],
-          'sources': [
-            '<(sqlite_directory)/src/src/shell.c',
-            '<(sqlite_directory)/src/src/shell_icu_linux.c',
-            # Include a dummy c++ file to force linking of libstdc++.
-            '<(sqlite_directory)/build_as_cpp.cc',
-          ],
-        },
-      ],
-    },],
-    ['OS == "ios"', {
-      'targets': [
-        {
-          'target_name': 'sqlite_regexp',
-          'type': 'static_library',
-          'dependencies': [
-            '../icu/icu.gyp:icui18n',
-            '../icu/icu.gyp:icuuc',
-          ],
-          'sources': [
-            'src/ext/icu/icu.c',
-          ],
-        },
-      ],
-    }],
-  ],
-  }]],
-}
diff --git a/runtime/bin/net/ssl.gyp b/runtime/bin/net/ssl.gyp
deleted file mode 100644
index cb15c0e4..0000000
--- a/runtime/bin/net/ssl.gyp
+++ /dev/null
@@ -1,216 +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.
-
-# Copyright (c) 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 file is a modified copy of Chromium's src/net/third_party/nss/ssl.gyp.
-# Revision 291806 (this should agree with "nss_rev" in DEPS).
-
-# The following modification was made to make sure we have the same
-# xcode_settings on all configurations (otherwise we can't build with ninja):
-#   'configurations': {
-#     'Debug_Base': {
-# +     'inherit_from': ['Dart_Base'],
-#       'defines': [
-#         'DEBUG',
-#       ],
-#    },
-#  },
-
-{
-  # Conditions section for ssl-bodge (Compiling SSL on linux using system
-  # NSS and NSPR libraries) removed:
-  # 'conditions': [
-  #   [ 'os_posix == 1 and OS != "mac" and OS != "ios"', {
-  #   ...
-  #   }]],
-
-  # Added by Dart. All Dart comments refer to the following block or line.
-  'includes': [
-    '../../tools/gyp/runtime-configurations.gypi',
-    '../../tools/gyp/nss_configurations.gypi',
-  ],
-  # Added by Dart.
-  'variables': {
-    'ssl_directory': '../../../third_party/net_nss',
-    'os_posix': 0,
-  },
-  # Added by Dart.  We do not indent, so diffs with the original are clearer.
-  'conditions': [[ 'dart_io_support==1', {
-  'targets': [
-    {
-      'target_name': 'libssl_dart',  # Added by Dart (the _dart postfix)
-      'type': 'static_library',
-      'toolsets':['host','target'],
-      # Changed by Dart: '<(ssl_directory)/' added to all paths.
-      'sources': [
-        '<(ssl_directory)/ssl/authcert.c',
-        '<(ssl_directory)/ssl/cmpcert.c',
-        '<(ssl_directory)/ssl/derive.c',
-        '<(ssl_directory)/ssl/dtlscon.c',
-        '<(ssl_directory)/ssl/os2_err.c',
-        '<(ssl_directory)/ssl/os2_err.h',
-        '<(ssl_directory)/ssl/preenc.h',
-        '<(ssl_directory)/ssl/prelib.c',
-        '<(ssl_directory)/ssl/ssl.h',
-        '<(ssl_directory)/ssl/ssl3con.c',
-        '<(ssl_directory)/ssl/ssl3ecc.c',
-        '<(ssl_directory)/ssl/ssl3ext.c',
-        '<(ssl_directory)/ssl/ssl3gthr.c',
-        '<(ssl_directory)/ssl/ssl3prot.h',
-        '<(ssl_directory)/ssl/sslauth.c',
-        '<(ssl_directory)/ssl/sslcon.c',
-        '<(ssl_directory)/ssl/ssldef.c',
-        '<(ssl_directory)/ssl/sslenum.c',
-        '<(ssl_directory)/ssl/sslerr.c',
-        '<(ssl_directory)/ssl/sslerr.h',
-        '<(ssl_directory)/ssl/SSLerrs.h',
-        '<(ssl_directory)/ssl/sslerrstrs.c',
-        '<(ssl_directory)/ssl/sslgathr.c',
-        '<(ssl_directory)/ssl/sslimpl.h',
-        '<(ssl_directory)/ssl/sslinfo.c',
-        '<(ssl_directory)/ssl/sslinit.c',
-        '<(ssl_directory)/ssl/sslmutex.c',
-        '<(ssl_directory)/ssl/sslmutex.h',
-        '<(ssl_directory)/ssl/sslnonce.c',
-        '<(ssl_directory)/ssl/sslplatf.c',
-        '<(ssl_directory)/ssl/sslproto.h',
-        '<(ssl_directory)/ssl/sslreveal.c',
-        '<(ssl_directory)/ssl/sslsecur.c',
-        '<(ssl_directory)/ssl/sslsnce.c',
-        '<(ssl_directory)/ssl/sslsock.c',
-        '<(ssl_directory)/ssl/sslt.h',
-        '<(ssl_directory)/ssl/ssltrace.c',
-        '<(ssl_directory)/ssl/sslver.c',
-        '<(ssl_directory)/ssl/unix_err.c',
-        '<(ssl_directory)/ssl/unix_err.h',
-        '<(ssl_directory)/ssl/win32err.c',
-        '<(ssl_directory)/ssl/win32err.h',
-        # Changed by Dart: All files under '<(ssl_directory)/ssl/bodge' removed.
-      ],
-      # Changed by Dart: '<(ssl_directory)/' added to all paths.
-      'sources!': [
-        '<(ssl_directory)/ssl/os2_err.c',
-        '<(ssl_directory)/ssl/os2_err.h',
-      ],
-      'defines': [
-        'NO_PKCS11_BYPASS',
-        'NSS_ENABLE_ECC',
-        'USE_UTIL_DIRECTLY',
-      ],
-      'defines!': [
-        'DEBUG',
-      ],
-      'dependencies': [
-        # Changed by Dart.
-        'zlib.gyp:zlib_dart',  # Added by Dart (the _dart postfix)
-        # Dart: Start of copy of code from 'bodge' conditions section below.
-        'nss.gyp:nspr_dart',  # Added by Dart (the _dart postfix)
-        'nss.gyp:nss_dart',  # Added by Dart (the _dart postfix)
-      ],
-      'export_dependent_settings': [
-        'nss.gyp:nspr_dart',  # Added by Dart (the _dart postfix)
-        'nss.gyp:nss_dart',  # Added by Dart (the _dart postfix)
-      ],
-      'direct_dependent_settings': {
-        'include_dirs': [
-          '<(ssl_directory)/ssl',
-        ],
-        'defines': [
-          'NSS_PLATFORM_CLIENT_AUTH',
-        ],
-        # Dart: End of copy of code from bodge conditions section.
-      },
-      'msvs_disabled_warnings': [4018, 4244, 4267],
-      'conditions': [
-        ['component == "shared_library"', {
-          'conditions': [
-            ['OS == "mac" or OS == "ios"', {
-              'xcode_settings': {
-                'GCC_SYMBOLS_PRIVATE_EXTERN': 'NO',
-              },
-            }],
-            ['OS == "win"', {
-              'sources': [
-                'ssl/exports_win.def',
-              ],
-            }],
-            ['os_posix == 1 and OS != "mac" and OS != "ios"', {
-              'cflags!': ['-fvisibility=hidden'],
-            }],
-          ],
-        }],
-        [ 'clang == 1', {
-          'cflags': [
-            # See http://crbug.com/138571#c8. In short, sslsecur.c picks up the
-            # system's cert.h because cert.h isn't in chromium's repo.
-            '-Wno-incompatible-pointer-types',
-
-            # There is a broken header guard in /usr/include/nss/secmod.h:
-            # https://bugzilla.mozilla.org/show_bug.cgi?id=884072
-            '-Wno-header-guard',
-          ],
-        }],
-        [ 'OS == "linux"', {
-          'link_settings': {
-            'libraries': [
-              '-ldl',
-            ],
-          },
-          # Added by Dart.
-          'defines': [
-            'XP_UNIX',
-            'NSS_PLATFORM_CLIENT_AUTH',
-            'NSS_USE_STATIC_LIBS',
-          ],
-        }],
-        [ 'OS == "mac" or OS == "ios"', {
-          'defines': [
-            'XP_UNIX',
-            'DARWIN',
-            'XP_MACOSX',
-          ],
-        }],
-        [ 'OS == "mac"', {
-          'link_settings': {
-            'libraries': [
-              '$(SDKROOT)/System/Library/Frameworks/Security.framework',
-            ],
-          },
-        }],
-        [ 'OS == "win"', {
-            'sources!': [
-              '<(ssl_directory)/ssl/unix_err.c',
-              '<(ssl_directory)/ssl/unix_err.h',
-            ],
-          },
-          {  # else: OS != "win"
-            'sources!': [
-              '<(ssl_directory)/ssl/win32err.c',
-              '<(ssl_directory)/ssl/win32err.h',
-            ],
-          },
-        ],
-        # Dart: Conditions sections for ssl/bodge removed.
-        #       [ 'os_posix == 1 and OS != "mac" and OS != "ios", {
-        #         ...
-        #       ],
-        #       [ 'OS == "mac" or OS == "ios" or OS == "win"', {
-        #         ...
-        #       ],
-      ],
-      'configurations': {
-        'Debug_Base': {
-          'inherit_from': ['Dart_Base'],
-          'defines': [
-            'DEBUG',
-          ],
-        },
-      },
-    },
-  ],
-  }]],
-}
diff --git a/runtime/bin/net/zlib.gyp b/runtime/bin/net/zlib.gyp
deleted file mode 100644
index 8aa920d..0000000
--- a/runtime/bin/net/zlib.gyp
+++ /dev/null
@@ -1,75 +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.
-
-# Copyright (c) 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 file is a modified copy of src/third_party/zlib/zlib.gyp from Chromium.
-# Revision 291806 (this should agree with "nss_rev" in DEPS).
-{
-  # Added by Dart. All Dart comments refer to the following block or line.
-  'includes': [
-    '../../tools/gyp/runtime-configurations.gypi',
-    '../../tools/gyp/nss_configurations.gypi',
-  ],
-  'variables': {
-    # Added by Dart.
-    'zlib_path': '../../../third_party/zlib',
-  },
-  # Added by Dart.  We do not indent, so diffs with the original are clearer.
-  'conditions': [[ 'dart_io_support==1', {
-  'targets': [
-    {
-      'target_name': 'zlib_dart',  # Added by Dart (the _dart postfix)
-      'type': 'static_library',
-      # Added by Dart (the original only has this on android).
-      'toolsets':['host','target'],
-      # Changed by Dart: '<(zlib_directory)/' added to all paths.
-      'sources': [
-        '<(zlib_path)/adler32.c',
-        '<(zlib_path)/compress.c',
-        '<(zlib_path)/crc32.c',
-        '<(zlib_path)/crc32.h',
-        '<(zlib_path)/deflate.c',
-        '<(zlib_path)/deflate.h',
-        '<(zlib_path)/gzclose.c',
-        '<(zlib_path)/gzguts.h',
-        '<(zlib_path)/gzlib.c',
-        '<(zlib_path)/gzread.c',
-        '<(zlib_path)/gzwrite.c',
-        '<(zlib_path)/infback.c',
-        '<(zlib_path)/inffast.c',
-        '<(zlib_path)/inffast.h',
-        '<(zlib_path)/inffixed.h',
-        '<(zlib_path)/inflate.c',
-        '<(zlib_path)/inflate.h',
-        '<(zlib_path)/inftrees.c',
-        '<(zlib_path)/inftrees.h',
-        '<(zlib_path)/mozzconf.h',
-        '<(zlib_path)/trees.c',
-        '<(zlib_path)/trees.h',
-        '<(zlib_path)/uncompr.c',
-        '<(zlib_path)/zconf.h',
-        '<(zlib_path)/zlib.h',
-        '<(zlib_path)/zutil.c',
-        '<(zlib_path)/zutil.h',
-      ],
-      'include_dirs': [
-            '<(zlib_path)/.',
-      ],
-      'direct_dependent_settings': {
-        'include_dirs': [
-              '<(zlib_path)/.',
-        ],
-      },
-      'conditions': [
-        ['OS!="win"', {
-          'product_name': 'chrome_zlib',
-        }],
-      ],
-    },
-  ],
-  }]],
-}
diff --git a/runtime/bin/platform_macos.cc b/runtime/bin/platform_macos.cc
index e970d6e..54b48d6 100644
--- a/runtime/bin/platform_macos.cc
+++ b/runtime/bin/platform_macos.cc
@@ -12,9 +12,9 @@
 #include "bin/file.h"
 #include "bin/platform.h"
 
-#if !defined(TARGET_OS_IOS)
+#if !TARGET_OS_IOS
 #include <crt_externs.h>  // NOLINT
-#endif  // !defined(TARGET_OS_IOS)
+#endif  // !TARGET_OS_IOS
 #include <signal.h>  // NOLINT
 #include <string.h>  // NOLINT
 #include <unistd.h>  // NOLINT
@@ -68,7 +68,7 @@
 
 
 char** Platform::Environment(intptr_t* count) {
-#if defined(TARGET_OS_IOS)
+#if TARGET_OS_IOS
   // TODO(iposva): On Mac (desktop), _NSGetEnviron() is used to access the
   // environ from shared libraries or bundles. This is present in crt_externs.h
   // which is unavailable on iOS. On iOS, everything is statically linked for
diff --git a/runtime/bin/process.cc b/runtime/bin/process.cc
index 2c90c11..47e2ff5 100644
--- a/runtime/bin/process.cc
+++ b/runtime/bin/process.cc
@@ -3,7 +3,10 @@
 // BSD-style license that can be found in the LICENSE file.
 
 #include "bin/dartutils.h"
+#include "bin/dbg_connection.h"
+#include "bin/eventhandler.h"
 #include "bin/io_buffer.h"
+#include "bin/log.h"
 #include "bin/platform.h"
 #include "bin/process.h"
 #include "bin/socket.h"
@@ -14,6 +17,10 @@
 namespace dart {
 namespace bin {
 
+// Global flag that is used to indicate that the VM should do a clean
+// shutdown.
+bool do_vm_shutdown = false;
+
 static const int kProcessIdNativeField = 0;
 
 int Process::global_exit_code_ = 0;
@@ -34,9 +41,15 @@
   // Protect against user-defined list implementations that can have
   // arbitrary length.
   if (len < 0 || len > kMaxArgumentListLength) {
-    DartUtils::SetIntegerField(status_handle, "_errorCode", 0);
-    DartUtils::SetStringField(
+    result = DartUtils::SetIntegerField(status_handle, "_errorCode", 0);
+    if (Dart_IsError(result)) {
+      Dart_PropagateError(result);
+    }
+    result = DartUtils::SetStringField(
         status_handle, "_errorMessage", "Max argument list length exceeded");
+    if (Dart_IsError(result)) {
+      Dart_PropagateError(result);
+    }
     return NULL;
   }
   *length = len;
@@ -48,9 +61,15 @@
       Dart_PropagateError(arg);
     }
     if (!Dart_IsString(arg)) {
-      DartUtils::SetIntegerField(status_handle, "_errorCode", 0);
-      DartUtils::SetStringField(
+      result = DartUtils::SetIntegerField(status_handle, "_errorCode", 0);
+      if (Dart_IsError(result)) {
+        Dart_PropagateError(result);
+      }
+      result = DartUtils::SetStringField(
           status_handle, "_errorMessage", error_msg);
+      if (Dart_IsError(result)) {
+        Dart_PropagateError(result);
+      }
       delete[] string_args;
       return NULL;
     }
@@ -65,15 +84,22 @@
   intptr_t process_stdout;
   intptr_t process_stderr;
   intptr_t exit_event;
+  Dart_Handle result;
   Dart_Handle status_handle = Dart_GetNativeArgument(args, 10);
   Dart_Handle path_handle = Dart_GetNativeArgument(args, 1);
   // The Dart code verifies that the path implements the String
   // interface. However, only builtin Strings are handled by
   // GetStringValue.
   if (!Dart_IsString(path_handle)) {
-    DartUtils::SetIntegerField(status_handle, "_errorCode", 0);
-    DartUtils::SetStringField(
+    result = DartUtils::SetIntegerField(status_handle, "_errorCode", 0);
+    if (Dart_IsError(result)) {
+      Dart_PropagateError(result);
+    }
+    result = DartUtils::SetStringField(
         status_handle, "_errorMessage", "Path must be a builtin string");
+    if (Dart_IsError(result)) {
+      Dart_PropagateError(result);
+    }
     Dart_SetReturnValue(args, Dart_NewBoolean(false));
     return;
   }
@@ -96,10 +122,16 @@
     working_directory = DartUtils::GetStringValue(working_directory_handle);
   } else if (!Dart_IsNull(working_directory_handle)) {
     delete[] string_args;
-    DartUtils::SetIntegerField(status_handle, "_errorCode", 0);
-    DartUtils::SetStringField(
+    result = DartUtils::SetIntegerField(status_handle, "_errorCode", 0);
+    if (Dart_IsError(result)) {
+      Dart_PropagateError(result);
+    }
+    result = DartUtils::SetStringField(
         status_handle, "_errorMessage",
         "WorkingDirectory must be a builtin string");
+    if (Dart_IsError(result)) {
+      Dart_PropagateError(result);
+    }
     Dart_SetReturnValue(args, Dart_NewBoolean(false));
     return;
   }
@@ -151,13 +183,19 @@
     }
     Process::SetProcessIdNativeField(process, pid);
   } else {
-    DartUtils::SetIntegerField(
+    result = DartUtils::SetIntegerField(
         status_handle, "_errorCode", error_code);
-    DartUtils::SetStringField(
+    if (Dart_IsError(result)) {
+      Dart_PropagateError(result);
+    }
+    result = DartUtils::SetStringField(
         status_handle,
         "_errorMessage",
         os_error_message != NULL ? os_error_message
                                  : "Cannot get error message");
+    if (Dart_IsError(result)) {
+      Dart_PropagateError(result);
+    }
   }
   delete[] string_args;
   delete[] string_environment;
@@ -216,8 +254,25 @@
   int64_t status = 0;
   // Ignore result if passing invalid argument and just exit 0.
   DartUtils::GetInt64Value(Dart_GetNativeArgument(args, 0), &status);
-  Dart_ExitIsolate();
-  Dart_Cleanup();
+  Dart_ShutdownIsolate();
+  Process::TerminateExitCodeHandler();
+  char* error = Dart_Cleanup();
+  if (error != NULL) {
+    Log::PrintErr("VM cleanup failed: %s\n", error);
+    free(error);
+  }
+  if (do_vm_shutdown) {
+#ifdef LEGACY_DEBUG_PROTOCOL_ENABLED
+    // Note that this dependency crosses logical project boundaries by making
+    // the dart:io implementation depend upon the standalone VM's legacy debug
+    // protocol. This breaks projects which want to use our dart:io
+    // implementation. Because the protocol is going away shortly, it's
+    // reasonable to leave it behind a #ifdef that is only enabled for the
+    // standalone VM for now.
+    DebuggerConnectionHandler::StopHandler();
+#endif
+    EventHandler::Stop();
+  }
   exit(static_cast<int>(status));
 }
 
diff --git a/runtime/bin/process_macos.cc b/runtime/bin/process_macos.cc
index bf81a8c..f694958 100644
--- a/runtime/bin/process_macos.cc
+++ b/runtime/bin/process_macos.cc
@@ -7,7 +7,7 @@
 
 #include "bin/process.h"
 
-#if !defined(TARGET_OS_IOS)
+#if !TARGET_OS_IOS
 #include <crt_externs.h>  // NOLINT
 #endif
 #include <errno.h>  // NOLINT
@@ -451,7 +451,7 @@
       ReportChildError();
     }
 
-#if !defined(TARGET_OS_IOS)
+#if !TARGET_OS_IOS
     if (program_environment_ != NULL) {
       // On MacOS you have to do a bit of magic to get to the
       // environment strings.
diff --git a/runtime/bin/process_patch.dart b/runtime/bin/process_patch.dart
index 3126c26..1917b46 100644
--- a/runtime/bin/process_patch.dart
+++ b/runtime/bin/process_patch.dart
@@ -176,10 +176,9 @@
 // implicit constructor.
 class _ProcessImplNativeWrapper extends NativeFieldWrapperClass1 {}
 
-class _ProcessImpl extends _ProcessImplNativeWrapper with _ServiceObject
-    implements Process {
-  // Use default Map so we keep order.
-  static Map<int, _ProcessImpl> _processes = new Map<int, _ProcessImpl>();
+class _ProcessImpl extends _ProcessImplNativeWrapper implements Process {
+  _ProcessResourceInfo _resourceInfo;
+  static bool connectedResourceHandler = false;
 
   _ProcessImpl(String path,
                List<String> arguments,
@@ -188,6 +187,14 @@
                bool includeParentEnvironment,
                bool runInShell,
                ProcessStartMode mode) : super() {
+    if (!connectedResourceHandler) {
+      registerExtension('__getProcesses',
+                        _ProcessResourceInfo.getStartedProcesses);
+      registerExtension('__getProcessById',
+                        _ProcessResourceInfo.getProcessInfoMapById);
+      connectedResourceHandler = true;
+    }
+
     if (runInShell) {
       arguments = _getShellArguments(path, arguments);
       path = _getShellCommand();
@@ -266,38 +273,6 @@
     _started = false;
   }
 
-  String get _serviceTypePath => 'io/processes';
-  String get _serviceTypeName => 'Process';
-
-  Map _toJSON(bool ref) {
-    var r = {
-      'id': _servicePath,
-      'type': _serviceType(ref),
-      'name': '$_path',
-      'user_name': '$_path',
-      'pid': '$pid',
-      'arguments': _arguments.join(' '),
-    };
-    if (ref) {
-      return r;
-    }
-    r['started'] = _started;
-    r['ended'] = _ended;
-    r['path'] = _path;
-    r['environment'] = _environment;
-    r['workingDirectory'] = _workingDirectory == null ? '.' : _workingDirectory;
-    if (_stdin._sink._nativeSocket.owner != null) {
-      r['stdin'] = _stdin._sink._nativeSocket._toJSON(true);
-    }
-    if (_stdout._stream._nativeSocket.owner != null) {
-      r['stdout'] = _stdout._stream._nativeSocket._toJSON(true);
-    }
-    if (_stderr._stream._nativeSocket.owner != null) {
-      r['stderr'] = _stderr._stream._nativeSocket._toJSON(true);
-    }
-    return r;
-  }
-
   static String _getShellCommand() {
     if (Platform.isWindows) {
       return 'cmd.exe';
@@ -417,6 +392,7 @@
       }
 
       _started = true;
+      _resourceInfo = new _ProcessResourceInfo(this);
 
       // Setup an exit handler to handle internal cleanup and possible
       // callback when a process terminates.
@@ -438,6 +414,7 @@
             _exitCode.complete(exitCode(exitDataBuffer));
             // Kill stdin, helping hand if the user forgot to do it.
             _stdin._sink.destroy();
+            _resourceInfo.stopped();
           }
 
           exitDataBuffer.setRange(
@@ -475,6 +452,8 @@
                                  status._errorCode);
     }
 
+    _resourceInfo = new _ProcessResourceInfo(this);
+
     var result = _wait(
         _stdin._sink._nativeSocket,
         _stdout._stream._nativeSocket,
@@ -486,6 +465,8 @@
       return encoding.decode(output);
     }
 
+    _resourceInfo.stopped();
+
     return new ProcessResult(
         result[0],
         result[1],
diff --git a/runtime/bin/run_vm_tests.cc b/runtime/bin/run_vm_tests.cc
index 3880062..c45a2a0 100644
--- a/runtime/bin/run_vm_tests.cc
+++ b/runtime/bin/run_vm_tests.cc
@@ -102,6 +102,7 @@
                                                              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,
@@ -113,6 +114,12 @@
   TestCaseBase::RunAll();
   // Apply the filter to all registered benchmarks.
   Benchmark::RunAll(argv[0]);
+
+  if (Flags::IsSet("shutdown")) {
+    err_msg = Dart::Cleanup();
+    ASSERT(err_msg == NULL);
+  }
+
   // Print a warning message if no tests or benchmarks were matched.
   if (run_matches == 0) {
     fprintf(stderr, "No tests matched: %s\n", run_filter);
diff --git a/runtime/bin/secure_socket.cc b/runtime/bin/secure_socket.cc
index 63f600f..c5bdae9 100644
--- a/runtime/bin/secure_socket.cc
+++ b/runtime/bin/secure_socket.cc
@@ -10,21 +10,17 @@
 #include <stdio.h>
 #include <string.h>
 
-#include <key.h>
-#include <keyt.h>
-#include <nss.h>
-#include <pk11pub.h>
-#include <prerror.h>
-#include <prinit.h>
-#include <prnetdb.h>
-#include <secmod.h>
-#include <ssl.h>
-#include <sslproto.h>
+#include <openssl/bio.h>
+#include <openssl/err.h>
+#include <openssl/safestack.h>
+#include <openssl/ssl.h>
+#include <openssl/tls1.h>
+#include <openssl/x509.h>
 
 #include "bin/builtin.h"
 #include "bin/dartutils.h"
 #include "bin/lockers.h"
-#include "bin/net/nss_memio.h"
+#include "bin/log.h"
 #include "bin/socket.h"
 #include "bin/thread.h"
 #include "bin/utils.h"
@@ -32,27 +28,56 @@
 
 #include "include/dart_api.h"
 
-
 namespace dart {
 namespace bin {
 
 bool SSLFilter::library_initialized_ = false;
 // To protect library initialization.
 Mutex* SSLFilter::mutex_ = new Mutex();
-// The password is needed when creating secure server sockets.  It can
-// be null if only secure client sockets are used.
-const char* SSLFilter::password_ = NULL;
+int SSLFilter::filter_ssl_index;
 
 static const int kSSLFilterNativeFieldIndex = 0;
+static const int kSecurityContextNativeFieldIndex = 0;
+static const int kX509NativeFieldIndex = 0;
+
+static const bool SSL_LOG_STATUS = false;
+static const bool SSL_LOG_DATA = false;
+
+static const int SSL_ERROR_MESSAGE_BUFFER_SIZE = 1000;
 
 
-/* Handle an error reported from the NSS library. */
-static void ThrowPRException(const char* exception_type,
+/* Get the error messages from BoringSSL, and put them in buffer as a
+ * null-terminated string. */
+static void FetchErrorString(char* buffer, int length) {
+  buffer[0] = '\0';
+  int error = ERR_get_error();
+  while (error != 0) {
+    int used = strlen(buffer);
+    int free_length = length - used;
+    if (free_length > 16) {
+      // Enough room for error code at least.
+      if (used > 0) {
+        buffer[used] = '\n';
+        buffer[used + 1] = '\0';
+        used++;
+        free_length--;
+      }
+      ERR_error_string_n(error, buffer + used, free_length);
+      // ERR_error_string_n is guaranteed to leave a null-terminated string.
+    }
+    error = ERR_get_error();
+  }
+}
+
+
+/* Handle an error reported from the BoringSSL library. */
+static void ThrowIOException(int status,
+                             const char* exception_type,
                              const char* message,
                              bool free_message = false) {
-  PRErrorCode error_code = PR_GetError();
-  const char* error_message = PR_ErrorToString(error_code, PR_LANGUAGE_EN);
-  OSError os_error_struct(error_code, error_message, OSError::kNSS);
+  char error_string[SSL_ERROR_MESSAGE_BUFFER_SIZE];
+  FetchErrorString(error_string, SSL_ERROR_MESSAGE_BUFFER_SIZE);
+  OSError os_error_struct(status, error_string, OSError::kBoringSSL);
   Dart_Handle os_error = DartUtils::NewDartOSError(&os_error_struct);
   Dart_Handle exception =
       DartUtils::NewDartIOException(exception_type, message, os_error);
@@ -64,20 +89,6 @@
 }
 
 
-static void ThrowCertificateException(const char* format,
-                                      const char* certificate_name) {
-  int length = strlen(certificate_name);
-  length += strlen(format);
-  char* message = reinterpret_cast<char*>(malloc(length + 1));
-  if (message == NULL) {
-    FATAL("Out of memory formatting CertificateException for throwing");
-  }
-  snprintf(message, length + 1, format, certificate_name);
-  message[length] = '\0';
-  ThrowPRException("CertificateException", message, true);
-}
-
-
 static SSLFilter* GetFilter(Dart_NativeArguments args) {
   SSLFilter* filter;
   Dart_Handle dart_this = ThrowIfError(Dart_GetNativeArgument(args, 0));
@@ -100,6 +111,62 @@
 }
 
 
+static SSL_CTX* GetSecurityContext(Dart_NativeArguments args) {
+  SSL_CTX* 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)));
+  return context;
+}
+
+
+static void FreeSecurityContext(
+    void* isolate_data,
+    Dart_WeakPersistentHandle handle,
+    void* context_pointer) {
+  SSL_CTX* context = static_cast<SSL_CTX*>(context_pointer);
+  SSL_CTX_free(context);
+}
+
+
+static void SetSecurityContext(Dart_NativeArguments args,
+                               SSL_CTX* context) {
+  const int approximate_size_of_context = 1500;
+  Dart_Handle dart_this = ThrowIfError(Dart_GetNativeArgument(args, 0));
+  ASSERT(Dart_IsInstance(dart_this));
+  ThrowIfError(Dart_SetNativeInstanceField(
+      dart_this,
+      kSecurityContextNativeFieldIndex,
+      reinterpret_cast<intptr_t>(context)));
+  Dart_NewWeakPersistentHandle(dart_this,
+                               context,
+                               approximate_size_of_context,
+                               FreeSecurityContext);
+}
+
+
+static X509* GetX509Certificate(Dart_NativeArguments args) {
+  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)));
+  return certificate;
+}
+
+
+// Forward declaration.
+static void SetAlpnProtocolList(Dart_Handle protocols_handle,
+                                SSL* ssl,
+                                SSL_CTX* context,
+                                bool is_server);
+
+
 void FUNCTION_NAME(SecureSocket_Init)(Dart_NativeArguments args) {
   Dart_Handle dart_this = ThrowIfError(Dart_GetNativeArgument(args, 0));
   SSLFilter* filter = new SSLFilter;
@@ -110,53 +177,36 @@
 
 void FUNCTION_NAME(SecureSocket_Connect)(Dart_NativeArguments args) {
   Dart_Handle host_name_object = ThrowIfError(Dart_GetNativeArgument(args, 1));
-  Dart_Handle host_sockaddr_storage_object =
-      ThrowIfError(Dart_GetNativeArgument(args, 2));
-  Dart_Handle port_object = ThrowIfError(Dart_GetNativeArgument(args, 3));
-  bool is_server = DartUtils::GetBooleanValue(Dart_GetNativeArgument(args, 4));
-  Dart_Handle certificate_name_object =
-      ThrowIfError(Dart_GetNativeArgument(args, 5));
+  Dart_Handle context_object = ThrowIfError(Dart_GetNativeArgument(args, 2));
+  bool is_server = DartUtils::GetBooleanValue(Dart_GetNativeArgument(args, 3));
   bool request_client_certificate =
-      DartUtils::GetBooleanValue(Dart_GetNativeArgument(args, 6));
+      DartUtils::GetBooleanValue(Dart_GetNativeArgument(args, 4));
   bool require_client_certificate =
-      DartUtils::GetBooleanValue(Dart_GetNativeArgument(args, 7));
-  bool send_client_certificate =
-      DartUtils::GetBooleanValue(Dart_GetNativeArgument(args, 8));
+      DartUtils::GetBooleanValue(Dart_GetNativeArgument(args, 5));
   Dart_Handle protocols_handle =
-      ThrowIfError(Dart_GetNativeArgument(args, 9));
+      ThrowIfError(Dart_GetNativeArgument(args, 6));
 
   const char* host_name = NULL;
   // TODO(whesse): Is truncating a Dart string containing \0 what we want?
   ThrowIfError(Dart_StringToCString(host_name_object, &host_name));
 
-  RawAddr raw_addr;
-  SocketAddress::GetSockAddr(host_sockaddr_storage_object, &raw_addr);
-
-  int64_t port;
-  if (!DartUtils::GetInt64Value(port_object, &port)) {
-    FATAL("The range of port_object was checked in Dart - it cannot fail here");
+  SSL_CTX* context = NULL;
+  if (!Dart_IsNull(context_object)) {
+    ThrowIfError(Dart_GetNativeInstanceField(
+        context_object,
+        kSecurityContextNativeFieldIndex,
+        reinterpret_cast<intptr_t*>(&context)));
   }
 
-  const char* certificate_name = NULL;
-  if (Dart_IsString(certificate_name_object)) {
-    ThrowIfError(Dart_StringToCString(certificate_name_object,
-                                      &certificate_name));
-  }
-  // If this is a server connection, it must have a certificate to connect with.
-  ASSERT(!is_server || certificate_name != NULL);
-
   // The protocols_handle is guaranteed to be a valid Uint8List.
   // It will have the correct length encoding of the protocols array.
   ASSERT(!Dart_IsNull(protocols_handle));
 
   GetFilter(args)->Connect(host_name,
-                           raw_addr,
-                           static_cast<int>(port),
+                           context,
                            is_server,
-                           certificate_name,
                            request_client_certificate,
                            require_client_certificate,
-                           send_client_certificate,
                            protocols_handle);
 }
 
@@ -217,50 +267,6 @@
 }
 
 
-void FUNCTION_NAME(SecureSocket_InitializeLibrary)
-    (Dart_NativeArguments args) {
-  Dart_Handle certificate_database_object =
-      ThrowIfError(Dart_GetNativeArgument(args, 0));
-  // Check that the type is string, and get the UTF-8 C string value from it.
-  const char* certificate_database = NULL;
-  if (Dart_IsString(certificate_database_object)) {
-    ThrowIfError(Dart_StringToCString(certificate_database_object,
-                                      &certificate_database));
-  } else if (!Dart_IsNull(certificate_database_object)) {
-    Dart_ThrowException(DartUtils::NewDartArgumentError(
-        "Non-String certificate directory argument to SetCertificateDatabase"));
-  }
-  // Leave certificate_database as NULL if no value was provided.
-
-  Dart_Handle password_object = ThrowIfError(Dart_GetNativeArgument(args, 1));
-  // Check that the type is string or null,
-  // and get the UTF-8 C string value from it.
-  const char* password = NULL;
-  if (Dart_IsString(password_object)) {
-    ThrowIfError(Dart_StringToCString(password_object, &password));
-  } else if (Dart_IsNull(password_object)) {
-    // Pass the empty string as the password.
-    password = "";
-  } else {
-    Dart_ThrowException(DartUtils::NewDartArgumentError(
-        "Password argument to SetCertificateDatabase is not a String or null"));
-  }
-
-  Dart_Handle builtin_roots_object =
-      ThrowIfError(Dart_GetNativeArgument(args, 2));
-  // Check that the type is boolean, and get the boolean value from it.
-  bool builtin_roots = true;
-  if (Dart_IsBoolean(builtin_roots_object)) {
-    ThrowIfError(Dart_BooleanValue(builtin_roots_object, &builtin_roots));
-  } else {
-    Dart_ThrowException(DartUtils::NewDartArgumentError(
-        "UseBuiltinRoots argument to SetCertificateDatabase is not a bool"));
-  }
-
-  SSLFilter::InitializeLibrary(certificate_database, password, builtin_roots);
-}
-
-
 void FUNCTION_NAME(SecureSocket_PeerCertificate)
     (Dart_NativeArguments args) {
   Dart_SetReturnValue(args, GetFilter(args)->PeerCertificate());
@@ -273,6 +279,293 @@
 }
 
 
+static Dart_Handle WrappedX509Certificate(X509* certificate) {
+  if (certificate == NULL) return Dart_Null();
+  Dart_Handle x509_type =
+      DartUtils::GetDartType(DartUtils::kIOLibURL, "X509Certificate");
+  if (Dart_IsError(x509_type)) {
+    return x509_type;
+  }
+  Dart_Handle arguments[] = { NULL };
+  Dart_Handle result =
+      Dart_New(x509_type, DartUtils::NewString("_"), 0, arguments);
+  if (Dart_IsError(result)) {
+    return result;
+  }
+  ASSERT(Dart_IsInstance(result));
+  Dart_Handle status = Dart_SetNativeInstanceField(
+      result,
+      kX509NativeFieldIndex,
+      reinterpret_cast<intptr_t>(certificate));
+  if (Dart_IsError(status)) {
+    return status;
+  }
+  return result;
+}
+
+
+int CertificateCallback(int preverify_ok, X509_STORE_CTX* store_ctx) {
+  if (preverify_ok == 1) return 1;
+  Dart_Isolate isolate = Dart_CurrentIsolate();
+  if (isolate == NULL) {
+    FATAL("CertificateCallback called with no current isolate\n");
+  }
+  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));
+  SSLFilter* filter = static_cast<SSLFilter*>(
+      SSL_get_ex_data(ssl, SSLFilter::filter_ssl_index));
+  Dart_Handle callback = filter->bad_certificate_callback();
+  if (Dart_IsNull(callback)) return 0;
+  Dart_Handle args[1];
+  args[0] = WrappedX509Certificate(certificate);
+  if (Dart_IsError(args[0])) {
+    filter->callback_error = args[0];
+    return 0;
+  }
+  Dart_Handle result = Dart_InvokeClosure(callback, 1, args);
+  if (!Dart_IsError(result) && !Dart_IsBoolean(result)) {
+    result = Dart_NewUnhandledExceptionError(DartUtils::NewDartIOException(
+        "HandshakeException",
+        "BadCertificateCallback returned a value that was not a boolean",
+        Dart_Null()));
+  }
+  if (Dart_IsError(result)) {
+    filter->callback_error = result;
+    return 0;
+  }
+  return DartUtils::GetBooleanValue(result);
+}
+
+
+void FUNCTION_NAME(SecurityContext_Allocate)(Dart_NativeArguments args) {
+  SSLFilter::InitializeLibrary();
+  SSL_CTX* context = SSL_CTX_new(TLS_method());
+  SSL_CTX_set_verify(context, SSL_VERIFY_PEER, CertificateCallback);
+  SSL_CTX_set_min_version(context, TLS1_VERSION);
+  SSL_CTX_set_cipher_list(context, "HIGH:MEDIUM");
+  SSL_CTX_set_cipher_list_tls11(context, "HIGH:MEDIUM");
+  SetSecurityContext(args, context);
+}
+
+
+int PasswordCallback(char* buf, int size, int rwflag, void* userdata) {
+  char* password = static_cast<char*>(userdata);
+  ASSERT(size == PEM_BUFSIZE);
+  strncpy(buf, password, size);
+  return strlen(password);
+}
+
+
+void CheckStatus(int status,
+                 const char* type,
+                 const char* message) {
+  // TODO(24183): Take appropriate action on failed calls,
+  // throw exception that includes all messages from the error stack.
+  if (status == 1) return;
+  if (SSL_LOG_STATUS) {
+    int error = ERR_get_error();
+    Log::PrintErr("Failed: %s status %d", message, status);
+    char error_string[SSL_ERROR_MESSAGE_BUFFER_SIZE];
+    ERR_error_string_n(error, error_string, SSL_ERROR_MESSAGE_BUFFER_SIZE);
+    Log::PrintErr("ERROR: %d %s\n", error, error_string);
+  }
+  ThrowIOException(status, type, message);
+}
+
+
+void FUNCTION_NAME(SecurityContext_UsePrivateKey)(Dart_NativeArguments args) {
+  SSL_CTX* context = GetSecurityContext(args);
+  Dart_Handle filename_object = ThrowIfError(Dart_GetNativeArgument(args, 1));
+  const char* filename = NULL;
+  if (Dart_IsString(filename_object)) {
+    ThrowIfError(Dart_StringToCString(filename_object, &filename));
+  } else {
+    Dart_ThrowException(DartUtils::NewDartArgumentError(
+        "File argument to SecurityContext.usePrivateKey is not a String"));
+  }
+  Dart_Handle password_object = ThrowIfError(Dart_GetNativeArgument(args, 2));
+  const char* password = NULL;
+  if (Dart_IsString(password_object)) {
+    ThrowIfError(Dart_StringToCString(password_object, &password));
+    if (strlen(password) > PEM_BUFSIZE - 1) {
+      Dart_ThrowException(DartUtils::NewDartArgumentError(
+        "SecurityContext.usePrivateKey password length is greater than"
+        " 1023 (PEM_BUFSIZE)"));
+    }
+  } else if (Dart_IsNull(password_object)) {
+    password = "";
+  } else {
+    Dart_ThrowException(DartUtils::NewDartArgumentError(
+        "SecurityContext.usePrivateKey password is not a String or null"));
+  }
+
+  SSL_CTX_set_default_passwd_cb(context, PasswordCallback);
+  SSL_CTX_set_default_passwd_cb_userdata(context, const_cast<char*>(password));
+  int status = SSL_CTX_use_PrivateKey_file(context,
+                                           filename,
+                                           SSL_FILETYPE_PEM);
+  // TODO(24184): Handle different expected errors here - file missing,
+  // incorrect password, file not a PEM, and throw exceptions.
+  // CheckStatus should also throw an exception in uncaught cases.
+  CheckStatus(status, "TlsException", "Failure in usePrivateKey");
+  SSL_CTX_set_default_passwd_cb_userdata(context, NULL);
+}
+
+
+void FUNCTION_NAME(SecurityContext_SetTrustedCertificates)(
+    Dart_NativeArguments args) {
+  SSL_CTX* context = GetSecurityContext(args);
+  Dart_Handle filename_object = ThrowIfError(Dart_GetNativeArgument(args, 1));
+  const char* filename = NULL;
+  if (Dart_IsString(filename_object)) {
+    ThrowIfError(Dart_StringToCString(filename_object, &filename));
+  }
+  Dart_Handle directory_object = ThrowIfError(Dart_GetNativeArgument(args, 2));
+  const char* directory = NULL;
+  if (Dart_IsString(directory_object)) {
+    ThrowIfError(Dart_StringToCString(directory_object, &directory));
+  } else if (Dart_IsNull(directory_object)) {
+    directory = NULL;
+  } else {
+    Dart_ThrowException(DartUtils::NewDartArgumentError(
+        "Directory argument to SecurityContext.setTrustedCertificates is not "
+        "a String or null"));
+  }
+
+  int status = SSL_CTX_load_verify_locations(context, filename, directory);
+  CheckStatus(
+      status, "TlsException", "SSL_CTX_load_verify_locations");
+}
+
+
+void FUNCTION_NAME(SecurityContext_TrustBuiltinRoots)(
+    Dart_NativeArguments args) {
+  SSL_CTX* context = GetSecurityContext(args);
+  X509_STORE* store = SSL_CTX_get_cert_store(context);
+  BIO* roots_bio =
+      BIO_new_mem_buf(const_cast<unsigned char*>(root_certificates_pem),
+                      root_certificates_pem_length);
+  X509* root_cert;
+  // PEM_read_bio_X509 reads PEM-encoded certificates from a bio (in our case,
+  // backed by a memory buffer), and returns X509 objects, one by one.
+  // When the end of the bio is reached, it returns null.
+  while ((root_cert = PEM_read_bio_X509(roots_bio, NULL, NULL, NULL))) {
+    X509_STORE_add_cert(store, root_cert);
+  }
+  BIO_free(roots_bio);
+}
+
+
+void FUNCTION_NAME(SecurityContext_UseCertificateChain)(
+    Dart_NativeArguments args) {
+  SSL_CTX* context = GetSecurityContext(args);
+  Dart_Handle filename_object = ThrowIfError(Dart_GetNativeArgument(args, 1));
+  const char* filename = NULL;
+  if (Dart_IsString(filename_object)) {
+    ThrowIfError(Dart_StringToCString(filename_object, &filename));
+  } else {
+    Dart_ThrowException(DartUtils::NewDartArgumentError(
+        "file argument in SecurityContext.useCertificateChain"
+        " is not a String"));
+  }
+  int status = SSL_CTX_use_certificate_chain_file(context, filename);
+  CheckStatus(status,
+              "TlsException",
+              "Failure in useCertificateChain");
+}
+
+
+void FUNCTION_NAME(SecurityContext_SetClientAuthorities)(
+    Dart_NativeArguments args) {
+  SSL_CTX* context = GetSecurityContext(args);
+  Dart_Handle filename_object = ThrowIfError(Dart_GetNativeArgument(args, 1));
+  const char* filename = NULL;
+  if (Dart_IsString(filename_object)) {
+    ThrowIfError(Dart_StringToCString(filename_object, &filename));
+  } else {
+    Dart_ThrowException(DartUtils::NewDartArgumentError(
+         "file argument in SecurityContext.setClientAuthorities"
+         " is not a String"));
+  }
+  STACK_OF(X509_NAME)* certificate_names;
+  certificate_names = SSL_load_client_CA_file(filename);
+  if (certificate_names != NULL) {
+    SSL_CTX_set_client_CA_list(context, certificate_names);
+  } else {
+    Dart_ThrowException(DartUtils::NewDartArgumentError(
+        "Could not load certificate names from file in SetClientAuthorities"));
+  }
+}
+
+
+void FUNCTION_NAME(SecurityContext_SetAlpnProtocols)(
+    Dart_NativeArguments args) {
+  SSL_CTX* context = GetSecurityContext(args);
+  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);
+  } else {
+    Dart_ThrowException(DartUtils::NewDartArgumentError(
+        "Non-boolean is_server argument passed to SetAlpnProtocols"));
+  }
+}
+
+
+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);
+  Dart_SetReturnValue(args, Dart_NewStringFromCString(subject_string));
+  OPENSSL_free(subject_string);
+}
+
+
+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);
+  Dart_SetReturnValue(args, Dart_NewStringFromCString(issuer_string));
+  OPENSSL_free(issuer_string);
+}
+
+static Dart_Handle ASN1TimeToMilliseconds(ASN1_TIME* aTime) {
+  ASN1_UTCTIME* epoch_start = M_ASN1_UTCTIME_new();
+  ASN1_UTCTIME_set_string(epoch_start, "700101000000Z");
+  int days;
+  int seconds;
+  int result = ASN1_TIME_diff(&days, &seconds, epoch_start, aTime);
+  M_ASN1_UTCTIME_free(epoch_start);
+  if (result != 1) {
+    // TODO(whesse): Propagate an error to Dart.
+    Log::PrintErr("ASN1Time error %d\n", result);
+  }
+  return Dart_NewInteger((86400LL * days + seconds) * 1000LL);
+}
+
+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) {
+  X509* certificate = GetX509Certificate(args);
+  ASN1_TIME* not_after = X509_get_notAfter(certificate);
+  Dart_SetReturnValue(args, ASN1TimeToMilliseconds(not_after));
+}
+
+
 /**
  * Pushes data through the SSL filter, reading and writing from circular
  * buffers shared with Dart.
@@ -314,11 +607,12 @@
     }
     return result;
   } else {
-    PRErrorCode error_code = PR_GetError();
-    const char* error_message = PR_ErrorToString(error_code, PR_LANGUAGE_EN);
+    int32_t error_code = static_cast<int32_t>(ERR_peek_error());
+    char error_string[SSL_ERROR_MESSAGE_BUFFER_SIZE];
+    FetchErrorString(error_string, SSL_ERROR_MESSAGE_BUFFER_SIZE);
     CObjectArray* result = new CObjectArray(CObject::NewArray(2));
     result->SetAt(0, new CObjectInt32(CObject::NewInt32(error_code)));
-    result->SetAt(1, new CObjectString(CObject::NewString(error_message)));
+    result->SetAt(1, new CObjectString(CObject::NewString(error_string)));
     return result;
   }
 }
@@ -365,33 +659,24 @@
         ends[i] = end;
         break;
       case kReadEncrypted:
-        // Read data from circular buffer.
+      case kWritePlaintext:
+        // Read/Write data from circular buffer.  If the buffer is empty,
+        // neither if statement's condition is true.
         if (end < start) {
           // Data may be split into two segments.  In this case,
           // the first is [start, size).
-          int bytes = ProcessReadEncryptedBuffer(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 = ProcessReadEncryptedBuffer(start, end);
-          if (bytes < 0) return false;
-          start += bytes;
-          ASSERT(start <= end);
-        }
-        starts[i] = start;
-        break;
-      case kWritePlaintext:
-        if (end < start) {
-          // Data is split into two segments, [start, size) and [0, end).
-          int bytes = ProcessWritePlaintextBuffer(start, size, 0, end);
-          if (bytes < 0) return false;
-          start += bytes;
-          if (start >= size) start -= size;
-        } else {
-          int bytes = ProcessWritePlaintextBuffer(start, end, 0, 0);
+          int bytes = (i == kReadEncrypted) ?
+              ProcessReadEncryptedBuffer(start, end) :
+              ProcessWritePlaintextBuffer(start, end);
           if (bytes < 0) return false;
           start += bytes;
           ASSERT(start <= end);
@@ -406,47 +691,9 @@
 }
 
 
-static Dart_Handle X509FromCertificate(CERTCertificate* certificate) {
-  PRTime start_validity;
-  PRTime end_validity;
-  SECStatus status =
-      CERT_GetCertTimes(certificate, &start_validity, &end_validity);
-  if (status != SECSuccess) {
-    ThrowPRException("CertificateException",
-                     "Cannot get validity times from certificate");
-  }
-  int64_t start_epoch_ms = start_validity / PR_USEC_PER_MSEC;
-  int64_t end_epoch_ms = end_validity / PR_USEC_PER_MSEC;
-  Dart_Handle subject_name_object =
-      DartUtils::NewString(certificate->subjectName);
-  Dart_Handle issuer_name_object =
-      DartUtils::NewString(certificate->issuerName);
-  Dart_Handle start_epoch_ms_int = Dart_NewInteger(start_epoch_ms);
-  Dart_Handle end_epoch_ms_int = Dart_NewInteger(end_epoch_ms);
-
-  Dart_Handle date_type =
-      DartUtils::GetDartType(DartUtils::kCoreLibURL, "DateTime");
-  Dart_Handle from_milliseconds =
-      DartUtils::NewString("fromMillisecondsSinceEpoch");
-
-  Dart_Handle start_validity_date =
-      Dart_New(date_type, from_milliseconds, 1, &start_epoch_ms_int);
-  Dart_Handle end_validity_date =
-      Dart_New(date_type, from_milliseconds, 1, &end_epoch_ms_int);
-
-  Dart_Handle x509_type =
-      DartUtils::GetDartType(DartUtils::kIOLibURL, "X509Certificate");
-  Dart_Handle arguments[] = { subject_name_object,
-                              issuer_name_object,
-                              start_validity_date,
-                              end_validity_date };
-  return Dart_New(x509_type, Dart_Null(), 4, arguments);
-}
-
-
 void SSLFilter::Init(Dart_Handle dart_this) {
   if (!library_initialized_) {
-    InitializeLibrary(NULL, "", true, false);
+    InitializeLibrary();
   }
   ASSERT(string_start_ == NULL);
   string_start_ = Dart_NewPersistentHandle(DartUtils::NewString("start"));
@@ -459,7 +706,6 @@
   ASSERT(bad_certificate_callback_ != NULL);
 
   InitializeBuffers(dart_this);
-  filter_ = memio_CreateIOLayer(kMemioBufferSize, kMemioBufferSize);
 }
 
 
@@ -507,6 +753,7 @@
 void SSLFilter::RegisterHandshakeCompleteCallback(Dart_Handle complete) {
   ASSERT(NULL == handshake_complete_);
   handshake_complete_ = Dart_NewPersistentHandle(complete);
+
   ASSERT(handshake_complete_ != NULL);
 }
 
@@ -519,400 +766,245 @@
 }
 
 
-char* PasswordCallback(PK11SlotInfo* slot, PRBool retry, void* arg) {
-  if (!retry) {
-    return PL_strdup(static_cast<char*>(arg));  // Freed by NSS internals.
-  }
-  return NULL;
-}
-
-
-static const char* builtin_roots_module =
-#if defined(TARGET_OS_LINUX) || defined(TARGET_OS_ANDROID)
-    "name=\"Root Certs\" library=\"libnssckbi.so\"";
-#elif defined(TARGET_OS_MACOS)
-    "name=\"Root Certs\" library=\"libnssckbi.dylib\"";
-#elif defined(TARGET_OS_WINDOWS)
-    "name=\"Root Certs\" library=\"nssckbi.dll\"";
-#else
-#error Automatic target os detection failed.
-#endif
-
-
-
-void SSLFilter::InitializeLibrary(const char* certificate_database,
-                                  const char* password,
-                                  bool use_builtin_root_certificates,
-                                  bool report_duplicate_initialization) {
+void SSLFilter::InitializeLibrary() {
   MutexLocker locker(mutex_);
-  SECStatus status;
   if (!library_initialized_) {
-    PR_Init(PR_USER_THREAD, PR_PRIORITY_NORMAL, 0);
-    // TODO(whesse): Verify there are no UTF-8 issues here.
-    if (certificate_database == NULL || certificate_database[0] == '\0') {
-      status = NSS_NoDB_Init(NULL);
-      if (status != SECSuccess) {
-        mutex_->Unlock();  // MutexLocker destructor not called when throwing.
-        ThrowPRException("TlsException",
-                         "Failed NSS_NoDB_Init call.");
-      }
-      if (use_builtin_root_certificates) {
-        SECMODModule* module = SECMOD_LoadUserModule(
-            const_cast<char*>(builtin_roots_module), NULL, PR_FALSE);
-        if (!module) {
-          mutex_->Unlock();  // MutexLocker destructor not called when throwing.
-          ThrowPRException("TlsException",
-                           "Failed to load builtin root certificates.");
-        }
-      }
-    } else {
-      PRUint32 init_flags = NSS_INIT_READONLY;
-      if (!use_builtin_root_certificates) {
-        init_flags |= NSS_INIT_NOMODDB;
-      }
-      status = NSS_Initialize(certificate_database,
-                              "",
-                              "",
-                              SECMOD_DB,
-                              init_flags);
-      if (status != SECSuccess) {
-        mutex_->Unlock();  // MutexLocker destructor not called when throwing.
-        ThrowPRException("TlsException",
-                         "Failed NSS_Init call.");
-      }
-      password_ = strdup(password);  // This one copy persists until Dart exits.
-      PK11_SetPasswordFunc(PasswordCallback);
-    }
+    SSL_library_init();
+    filter_ssl_index = SSL_get_ex_new_index(0, NULL, NULL, NULL, NULL);
+    ASSERT(filter_ssl_index >= 0);
     library_initialized_ = true;
-
-    status = NSS_SetDomesticPolicy();
-    if (status != SECSuccess) {
-      mutex_->Unlock();  // MutexLocker destructor not called when throwing.
-      ThrowPRException("TlsException",
-                       "Failed NSS_SetDomesticPolicy call.");
-    }
-
-    // Enable the same additional ciphers that Chromium does.
-    // See NSSSSLInitSingleton() in Chromium's net/socket/nss_ssl_util.cc.
-    // Explicitly enable exactly those ciphers with keys of at least 80 bits.
-    const PRUint16* const ssl_ciphers = SSL_GetImplementedCiphers();
-    const PRUint16 num_ciphers = SSL_GetNumImplementedCiphers();
-    for (int i = 0; i < num_ciphers; i++) {
-      SSLCipherSuiteInfo info;
-      if (SSL_GetCipherSuiteInfo(ssl_ciphers[i], &info, sizeof(info)) ==
-          SECSuccess) {
-        bool enabled = (info.effectiveKeyBits >= 80);
-        // Trim the list of cipher suites in order to keep the size of the
-        // ClientHello down. DSS, ECDH, CAMELLIA, SEED, ECC+3DES, and
-        // HMAC-SHA256 cipher suites are disabled.
-        if (info.symCipher == ssl_calg_camellia ||
-            info.symCipher == ssl_calg_seed ||
-            (info.symCipher == ssl_calg_3des && info.keaType != ssl_kea_rsa) ||
-            info.authAlgorithm == ssl_auth_dsa ||
-            info.macAlgorithm == ssl_hmac_sha256 ||
-            info.nonStandard ||
-            strcmp(info.keaTypeName, "ECDH") == 0) {
-          enabled = false;
-        }
-
-        if (ssl_ciphers[i] == TLS_DHE_DSS_WITH_AES_128_CBC_SHA) {
-          // Enabled to allow servers with only a DSA certificate to function.
-          enabled = true;
-        }
-        SSL_CipherPrefSetDefault(ssl_ciphers[i], enabled);
-      }
-    }
-
-    status = SSL_ConfigServerSessionIDCache(0, 0, 0, NULL);
-    if (status != SECSuccess) {
-      mutex_->Unlock();  // MutexLocker destructor not called when throwing.
-      ThrowPRException("TlsException",
-                       "Failed SSL_ConfigServerSessionIDCache call.");
-    }
-
-  } else if (report_duplicate_initialization) {
-    mutex_->Unlock();  // MutexLocker destructor not called when throwing.
-    // Like ThrowPRException, without adding an OSError.
-    Dart_ThrowException(DartUtils::NewDartIOException("TlsException",
-        "Called SecureSocket.initialize more than once",
-        Dart_Null()));
   }
 }
 
 
-SECStatus BadCertificateCallback(void* filter, PRFileDesc* fd) {
-  SSLFilter* ssl_filter = static_cast<SSLFilter*>(filter);
-  Dart_Handle callback = ssl_filter->bad_certificate_callback();
-  if (Dart_IsNull(callback)) return SECFailure;
-  Dart_Handle x509_object = ssl_filter->PeerCertificate();
-  Dart_Handle result = Dart_InvokeClosure(callback, 1, &x509_object);
-  if (Dart_IsError(result)) {
-    ssl_filter->callback_error = result;
-    return SECFailure;
-  }
-  // Our wrapper is guaranteed to return a boolean.
-  bool c_result = DartUtils::GetBooleanValue(result);
-  return c_result ? SECSuccess : SECFailure;
-}
-
-
 Dart_Handle SSLFilter::PeerCertificate() {
-  CERTCertificate* certificate = SSL_PeerCertificate(filter_);
-  if (certificate == NULL) return Dart_Null();
-  Dart_Handle x509_object = X509FromCertificate(certificate);
-  CERT_DestroyCertificate(certificate);
+  X509* certificate = SSL_get_peer_certificate(ssl_);
+  Dart_Handle x509_object = WrappedX509Certificate(certificate);
+  if (Dart_IsError(x509_object)) {
+    Dart_PropagateError(x509_object);
+  }
   return x509_object;
 }
 
 
-void SSLFilter::Connect(const char* host_name,
-                        const RawAddr& raw_addr,
-                        int port,
+int AlpnCallback(SSL *ssl,
+                 const uint8_t **out,
+                 uint8_t *outlen,
+                 const uint8_t *in,
+                 unsigned int inlen,
+                 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);
+  while (*server_list != 0) {
+    uint8_t protocol_length = *server_list++;
+    const uint8_t* client_list = in;
+    while (client_list < in + inlen) {
+      uint8_t client_protocol_length = *client_list++;
+      if (client_protocol_length == protocol_length) {
+        if (0 == memcmp(server_list, client_list, protocol_length)) {
+          *out = client_list;
+          *outlen = client_protocol_length;
+          return SSL_TLSEXT_ERR_OK;  // Success
+        }
+      }
+      client_list += client_protocol_length;
+    }
+    server_list += protocol_length;
+  }
+  // TODO(23580): Make failure send a fatal alert instead of ignoring ALPN.
+  return SSL_TLSEXT_ERR_NOACK;
+}
+
+
+// Sets the protocol list for ALPN on a SSL object or a context.
+static void SetAlpnProtocolList(Dart_Handle protocols_handle,
+                                SSL* ssl,
+                                SSL_CTX* context,
+                                bool is_server) {
+  // Enable ALPN (application layer protocol negotiation) if the caller provides
+  // a valid list of supported protocols.
+  Dart_TypedData_Type protocols_type;
+  uint8_t* protocol_string = NULL;
+  uint8_t* protocol_string_copy = NULL;
+  intptr_t protocol_string_len = 0;
+  int status;
+
+  Dart_Handle result = Dart_TypedDataAcquireData(
+      protocols_handle,
+      &protocols_type,
+      reinterpret_cast<void**>(&protocol_string),
+      &protocol_string_len);
+  if (Dart_IsError(result)) {
+    Dart_PropagateError(result);
+  }
+
+  if (protocols_type != Dart_TypedData_kUint8) {
+    Dart_TypedDataReleaseData(protocols_handle);
+    Dart_PropagateError(Dart_NewApiError(
+        "Unexpected type for protocols (expected valid Uint8List)."));
+  }
+
+  if (protocol_string_len > 0) {
+    if (is_server) {
+      // ALPN on server connections must be set on an SSL_CTX object,
+      // not on the SSL object of the individual connection.
+      ASSERT(context != NULL);
+      ASSERT(ssl == NULL);
+      // Because it must be passed as a single void*, terminate
+      // the list of (length, data) strings with a length 0 string.
+      protocol_string_copy =
+          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, AlpnCallback, protocol_string_copy);
+      // TODO(whesse): If this function is called again, free the previous
+      // protocol_string_copy.  It may be better to keep this as a native
+      // field on the Dart object, since fetching it from the structure is
+      // not in the public api.
+      // Also free protocol_string_copy when the context is destroyed,
+      // in FreeSecurityContext()
+    } else {
+      // The function makes a local copy of protocol_string, which it owns.
+      if (ssl != NULL) {
+        ASSERT(context == NULL);
+        status = SSL_set_alpn_protos(ssl, protocol_string, protocol_string_len);
+      } else {
+        ASSERT(context != NULL);
+        ASSERT(ssl == NULL);
+        status = SSL_CTX_set_alpn_protos(
+            context, protocol_string, protocol_string_len);
+      }
+      ASSERT(status == 0);  // The function returns a non-standard status.
+    }
+  }
+  Dart_TypedDataReleaseData(protocols_handle);
+}
+
+
+void SSLFilter::Connect(const char* hostname,
+                        SSL_CTX* context,
                         bool is_server,
-                        const char* certificate_name,
                         bool request_client_certificate,
                         bool require_client_certificate,
-                        bool send_client_certificate,
                         Dart_Handle protocols_handle) {
   is_server_ = is_server;
   if (in_handshake_) {
     FATAL("Connect called twice on the same _SecureFilter.");
   }
 
-  if (!is_server && certificate_name != NULL) {
-    client_certificate_name_ = strdup(certificate_name);
+  int status;
+  int error;
+  BIO* ssl_side;
+  status = BIO_new_bio_pair(&ssl_side, 10000, &socket_side_, 10000);
+  CheckStatus(status, "TlsException", "BIO_new_bio_pair");
+
+  assert(context != NULL);
+  ssl_ = SSL_new(context);
+  SSL_set_bio(ssl_, ssl_side, ssl_side);
+  SSL_set_mode(ssl_, SSL_MODE_AUTO_RETRY);  // TODO(whesse): Is this right?
+  SSL_set_ex_data(ssl_, filter_ssl_index, this);
+
+  if (is_server_) {
+    int certificate_mode =
+      request_client_certificate ? SSL_VERIFY_PEER : SSL_VERIFY_NONE;
+    if (require_client_certificate) {
+      certificate_mode |= SSL_VERIFY_FAIL_IF_NO_PEER_CERT;
+    }
+    SSL_set_verify(ssl_, certificate_mode, NULL);
+  } else {
+    SetAlpnProtocolList(protocols_handle, ssl_, NULL, false);
+    status = SSL_set_tlsext_host_name(ssl_, hostname);
+    CheckStatus(status, "TlsException", "Set SNI host name");
+    // Sets the hostname in the certificate-checking object, so it is checked
+    // 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_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");
   }
-
-  filter_ = SSL_ImportFD(NULL, filter_);
-  if (filter_ == NULL) {
-    ThrowPRException("TlsException", "Failed SSL_ImportFD call");
-  }
-
-
-  SECStatus status;
-
-  // Enable ALPN (application layer protocol negogiation) if the caller provides
-  // a valid list of supported protocols.
-  {
-    Dart_TypedData_Type protocols_type;
-    uint8_t* protocol_string = NULL;
-    intptr_t protocol_string_len = 0;
-
-    Dart_Handle result = Dart_TypedDataAcquireData(
-        protocols_handle,
-        &protocols_type,
-        reinterpret_cast<void**>(&protocol_string),
-        &protocol_string_len);
-    if (Dart_IsError(result)) {
-      Dart_PropagateError(result);
+  // Make the connection:
+  if (is_server_) {
+    status = SSL_accept(ssl_);
+    if (SSL_LOG_STATUS) Log::Print("SSL_accept status: %d\n", status);
+    if (status != 1) {
+      // TODO(whesse): expect a needs-data error here.  Handle other errors.
+      error = SSL_get_error(ssl_, status);
+      if (SSL_LOG_STATUS) Log::Print("SSL_accept error: %d\n", error);
     }
-
-    if (protocols_type != Dart_TypedData_kUint8) {
-      Dart_TypedDataReleaseData(protocols_handle);
-      Dart_PropagateError(Dart_NewApiError(
-          "Unexpected type for protocols (expected valid Uint8List)."));
-    }
-
-    if (protocol_string_len > 0) {
-      status = SSL_OptionSet(filter_, SSL_ENABLE_ALPN, PR_TRUE);
-      ASSERT(status == SECSuccess);
-
-      status = SSL_SetNextProtoNego(filter_,
-                                    protocol_string,
-                                    protocol_string_len);
-      ASSERT(status == SECSuccess);
-    }
-
-    Dart_TypedDataReleaseData(protocols_handle);
-  }
-
-  SSLVersionRange vrange;
-  vrange.min = SSL_LIBRARY_VERSION_3_0;
-  vrange.max = SSL_LIBRARY_VERSION_TLS_1_2;
-  SSL_VersionRangeSet(filter_, &vrange);
-
-  if (is_server) {
-    CERTCertificate* certificate = NULL;
-    if (strstr(certificate_name, "CN=") != NULL) {
-      // Look up certificate using the distinguished name (DN) certificate_name.
-      CERTCertDBHandle* certificate_database = CERT_GetDefaultCertDB();
-      if (certificate_database == NULL) {
-        ThrowPRException("CertificateException",
-                         "Certificate database cannot be loaded");
-      }
-      certificate = CERT_FindCertByNameString(certificate_database,
-          const_cast<char*>(certificate_name));
-      if (certificate == NULL) {
-        ThrowCertificateException(
-            "Cannot find server certificate by distinguished name: %s",
-            certificate_name);
-      }
-    } else {
-      // Look up certificate using the nickname certificate_name.
-      certificate = PK11_FindCertFromNickname(
-          const_cast<char*>(certificate_name),
-          static_cast<void*>(const_cast<char*>(password_)));
-      if (certificate == NULL) {
-        ThrowCertificateException(
-            "Cannot find server certificate by nickname: %s",
-            certificate_name);
-      }
-    }
-    SECKEYPrivateKey* key = PK11_FindKeyByAnyCert(
-        certificate,
-        static_cast<void*>(const_cast<char*>(password_)));
-    if (key == NULL) {
-      CERT_DestroyCertificate(certificate);
-      if (PR_GetError() == -8177) {
-        ThrowPRException("CertificateException",
-                         "Certificate database password incorrect");
-      } else {
-        ThrowCertificateException(
-            "Cannot find private key for certificate %s",
-            certificate_name);
-      }
-    }
-
-    // kt_rsa (key type RSA) is an enum constant from the NSS libraries.
-    // TODO(whesse): Allow different key types.
-    status = SSL_ConfigSecureServer(filter_, certificate, key, kt_rsa);
-    CERT_DestroyCertificate(certificate);
-    SECKEY_DestroyPrivateKey(key);
-    if (status != SECSuccess) {
-      ThrowCertificateException(
-          "Failed SSL_ConfigSecureServer call with certificate %s",
-          certificate_name);
-    }
-
-    if (request_client_certificate) {
-      status = SSL_OptionSet(filter_, SSL_REQUEST_CERTIFICATE, PR_TRUE);
-      if (status != SECSuccess) {
-        ThrowPRException("TlsException",
-                         "Failed SSL_OptionSet(REQUEST_CERTIFICATE) call");
-      }
-      status = SSL_OptionSet(filter_,
-                             SSL_REQUIRE_CERTIFICATE,
-                             require_client_certificate);
-      if (status != SECSuccess) {
-        ThrowPRException("TlsException",
-                         "Failed SSL_OptionSet(REQUIRE_CERTIFICATE) call");
-      }
-    }
-  } else {  // Client.
-    if (SSL_SetURL(filter_, host_name) == -1) {
-      ThrowPRException("TlsException", "Failed SetURL call");
-    }
-    if (send_client_certificate) {
-      SSL_SetPKCS11PinArg(filter_, const_cast<char*>(password_));
-      status = SSL_GetClientAuthDataHook(
-          filter_,
-          NSS_GetClientAuthData,
-          static_cast<void*>(client_certificate_name_));
-      if (status != SECSuccess) {
-        ThrowPRException("TlsException",
-                         "Failed SSL_GetClientAuthDataHook call");
-      }
+  } else {
+    status = SSL_connect(ssl_);
+    if (SSL_LOG_STATUS) Log::Print("SSL_connect status: %d\n", status);
+    if (status != 1) {
+      // TODO(whesse): expect a needs-data error here.  Handle other errors.
+      error = SSL_get_error(ssl_, status);
+      if (SSL_LOG_STATUS) Log::Print("SSL_connect error: %d\n", error);
     }
   }
-
-  // Install bad certificate callback, and pass 'this' to it if it is called.
-  status = SSL_BadCertHook(filter_,
-                           BadCertificateCallback,
-                           static_cast<void*>(this));
-
-  status = SSL_ResetHandshake(filter_, is_server);
-  if (status != SECSuccess) {
-    ThrowPRException("TlsException",
-                     "Failed SSL_ResetHandshake call");
-  }
-
-  // Set the peer address from the address passed. The DNS has already
-  // been done in Dart code, so just use that address. This relies on
-  // following about PRNetAddr: "The raw member of the union is
-  // equivalent to struct sockaddr", which is stated in the NSS
-  // documentation.
-  PRNetAddr peername;
-  memset(&peername, 0, sizeof(peername));
-  intptr_t len = SocketAddress::GetAddrLength(raw_addr);
-  ASSERT(static_cast<size_t>(len) <= sizeof(peername));
-  memmove(&peername, &raw_addr.addr, len);
-
-  // Adjust the address family field for BSD, whose sockaddr
-  // structure has a one-byte length and one-byte address family
-  // field at the beginning.  PRNetAddr has a two-byte address
-  // family field at the beginning.
-  peername.raw.family = raw_addr.addr.sa_family;
-
-  memio_SetPeerName(filter_, &peername);
+  Handshake();
 }
 
 
+int printErrorCallback(const char *str, size_t len, void *ctx) {
+  Log::PrintErr("%.*s\n", static_cast<int>(len), str);
+  return 1;
+}
+
 void SSLFilter::Handshake() {
-  SECStatus status = SSL_ForceHandshake(filter_);
-  if (status == SECSuccess) {
-    if (in_handshake_) {
-      ThrowIfError(Dart_InvokeClosure(
-          Dart_HandleFromPersistent(handshake_complete_), 0, NULL));
-      in_handshake_ = false;
-    }
-  } else {
-    if (callback_error != NULL) {
-      Dart_PropagateError(callback_error);
-    }
-    PRErrorCode error = PR_GetError();
-    if (error == PR_WOULD_BLOCK_ERROR) {
-      if (!in_handshake_) {
-        in_handshake_ = true;
-      }
-    } else {
-      if (is_server_) {
-        ThrowPRException("HandshakeException",
-                         "Handshake error in server");
+  // Try and push handshake along.
+  int status;
+  status = SSL_do_handshake(ssl_);
+  if (callback_error != NULL) {
+    // The SSL_do_handshake will try performing a handshake and might call
+    // a CertificateCallback. If the certificate validation
+    // failed the 'callback_error" will be set by the certificateCallback
+    // logic and we propagate the error"
+    Dart_PropagateError(callback_error);
+  }
+  if (SSL_want_write(ssl_) || SSL_want_read(ssl_)) {
+    in_handshake_ = true;
+    return;
+  }
+  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
+    //    should give us the hostname check.
+    int result = SSL_get_verify_result(ssl_);
+    if (SSL_LOG_STATUS) {
+      Log::Print("Handshake verification status: %d\n", result);
+      X509* peer_certificate = SSL_get_peer_certificate(ssl_);
+      if (peer_certificate == NULL) {
+        Log::Print("No peer certificate received\n");
       } else {
-        ThrowPRException("HandshakeException",
-                         "Handshake error in client");
+        X509_NAME* s_name = X509_get_subject_name(peer_certificate);
+        printf("Peer certificate SN: ");
+        X509_NAME_print_ex_fp(stdout, s_name, 4, 0);
+        printf("\n");
       }
     }
+    ThrowIfError(Dart_InvokeClosure(
+        Dart_HandleFromPersistent(handshake_complete_), 0, NULL));
+    in_handshake_ = false;
   }
 }
 
 void SSLFilter::GetSelectedProtocol(Dart_NativeArguments args) {
-  // Space for the selected protocol.
-  const unsigned int kBufferSize = 256;
-  unsigned char buffer[kBufferSize + 1];
-
-  unsigned int outLength = 0;
-  SSLNextProtoState outState;
-
-  SECStatus status = SSL_GetNextProto(
-      filter_, &outState, buffer, &outLength, kBufferSize);
-  if (status == SECSuccess) {
-    if (outState == SSL_NEXT_PROTO_SELECTED ||
-        outState == SSL_NEXT_PROTO_NEGOTIATED) {
-      ASSERT(outLength <= kBufferSize);
-      buffer[outLength] = '\0';
-      Dart_Handle protocol_string = DartUtils::NewString(
-          reinterpret_cast<const char *>(&buffer[0]));
-      if (Dart_IsError(protocol_string)) {
-        ThrowPRException("HandshakeException",
-                         "Protocol selected via ALPN, unable to get protocol "
-                         "string.");
-      } else {
-        Dart_SetReturnValue(args, protocol_string);
-      }
-    } else if (outState == SSL_NEXT_PROTO_NO_OVERLAP) {
-      ThrowPRException("HandshakeException",
-                       "Client and Server could not agree upon a protocol");
-    } else if (outState == SSL_NEXT_PROTO_NO_SUPPORT) {
-      // A value of `null` denotes that the client did not support protocol
-      // negogiation.
-      Dart_SetReturnValue(args, Dart_Null());
-    } else {
-      UNREACHABLE();
-    }
+  const uint8_t* protocol;
+  unsigned length;
+  SSL_get0_alpn_selected(ssl_, &protocol, &length);
+  if (length == 0) {
+    Dart_SetReturnValue(args, Dart_Null());
   } else {
-    ThrowPRException("HandshakeException",
-                     "Could not retrieve selected protocol via ALPN");
+    Dart_SetReturnValue(args, Dart_NewStringFromUTF8(protocol, length));
   }
 }
 
@@ -920,41 +1012,28 @@
 void SSLFilter::Renegotiate(bool use_session_cache,
                             bool request_client_certificate,
                             bool require_client_certificate) {
-  SECStatus status;
   // The SSL_REQUIRE_CERTIFICATE option only takes effect if the
   // SSL_REQUEST_CERTIFICATE option is also set, so set it.
   request_client_certificate =
       request_client_certificate || require_client_certificate;
-
-  status = SSL_OptionSet(filter_,
-                         SSL_REQUEST_CERTIFICATE,
-                         request_client_certificate);
-  if (status != SECSuccess) {
-    ThrowPRException("TlsException",
-       "Failure in (Raw)SecureSocket.renegotiate request_client_certificate");
-  }
-  status = SSL_OptionSet(filter_,
-                         SSL_REQUIRE_CERTIFICATE,
-                         require_client_certificate);
-  if (status != SECSuccess) {
-    ThrowPRException("TlsException",
-       "Failure in (Raw)SecureSocket.renegotiate require_client_certificate");
-  }
-  bool flush_cache = !use_session_cache;
-  status = SSL_ReHandshake(filter_, flush_cache);
-  if (status != SECSuccess) {
-    if (is_server_) {
-      ThrowPRException("HandshakeException",
-                       "Failure in (Raw)SecureSocket.renegotiate in server");
-    } else {
-      ThrowPRException("HandshakeException",
-                       "Failure in (Raw)SecureSocket.renegotiate in client");
-    }
-  }
+  // TODO(24070, 24069): Implement setting the client certificate parameters,
+  //   and triggering rehandshake.
 }
 
 
 void SSLFilter::Destroy() {
+  if (ssl_ != NULL) {
+    SSL_free(ssl_);
+    ssl_ = NULL;
+  }
+  if (socket_side_ != NULL) {
+    BIO_free(socket_side_);
+    socket_side_ = NULL;
+  }
+  if (hostname_ != NULL) {
+    free(hostname_);
+    hostname_ = NULL;
+  }
   for (int i = 0; i < kNumBuffers; ++i) {
     Dart_DeletePersistentHandle(dart_buffer_objects_[i]);
     delete[] buffers_[i];
@@ -963,25 +1042,21 @@
   Dart_DeletePersistentHandle(string_length_);
   Dart_DeletePersistentHandle(handshake_complete_);
   Dart_DeletePersistentHandle(bad_certificate_callback_);
-  free(client_certificate_name_);
-
-  PR_Close(filter_);
 }
 
 
-intptr_t SSLFilter::ProcessReadPlaintextBuffer(int start, int end) {
+/* Read decrypted data from the filter to the circular buffer */
+int SSLFilter::ProcessReadPlaintextBuffer(int start, int end) {
   int length = end - start;
   int bytes_processed = 0;
   if (length > 0) {
-    bytes_processed = PR_Read(filter_,
-                              buffers_[kReadPlaintext] + start,
-                              length);
+    bytes_processed = SSL_read(
+        ssl_,
+        reinterpret_cast<char*>((buffers_[kReadPlaintext] + start)),
+        length);
     if (bytes_processed < 0) {
-      ASSERT(bytes_processed == -1);
-      PRErrorCode pr_error = PR_GetError();
-      if (PR_WOULD_BLOCK_ERROR != pr_error) {
-        return -1;
-      }
+      int error = SSL_get_error(ssl_, bytes_processed);
+      USE(error);
       bytes_processed = 0;
     }
   }
@@ -989,70 +1064,58 @@
 }
 
 
-intptr_t SSLFilter::ProcessWritePlaintextBuffer(int start1, int end1,
-                                                int start2, int end2) {
-  PRIOVec ranges[2];
-  uint8_t* buffer = buffers_[kWritePlaintext];
-  ranges[0].iov_base = reinterpret_cast<char*>(buffer + start1);
-  ranges[0].iov_len = end1 - start1;
-  ranges[1].iov_base = reinterpret_cast<char*>(buffer + start2);
-  ranges[1].iov_len = end2 - start2;
-  int bytes_processed = PR_Writev(filter_, ranges, 2, PR_INTERVAL_NO_TIMEOUT);
+int SSLFilter::ProcessWritePlaintextBuffer(int start, int end) {
+  int length = end - start;
+  int bytes_processed = SSL_write(
+      ssl_, buffers_[kWritePlaintext] + start, length);
   if (bytes_processed < 0) {
-    ASSERT(bytes_processed == -1);
-    PRErrorCode pr_error = PR_GetError();
-    if (PR_WOULD_BLOCK_ERROR != pr_error) {
-      return -1;
+    if (SSL_LOG_DATA) {
+      Log::Print("SSL_write returned error %d\n", bytes_processed);
     }
-    bytes_processed = 0;
+    return 0;
   }
   return bytes_processed;
 }
 
 
-intptr_t SSLFilter::ProcessReadEncryptedBuffer(int start, int end) {
+/* 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);
   int bytes_processed = 0;
   if (length > 0) {
-    memio_Private* secret = memio_GetSecret(filter_);
-    uint8_t* filter_buf;
-    int free_bytes = memio_GetReadParams(secret, &filter_buf);
-    bytes_processed = dart::Utils::Minimum(length, free_bytes);
-    memmove(filter_buf, buffers_[kReadEncrypted] + start, bytes_processed);
-    memio_PutReadResult(secret, bytes_processed);
+    bytes_processed =
+        BIO_write(socket_side_, buffers_[kReadEncrypted] + start, length);
+    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");
+      }
+      bytes_processed = 0;
+    }
   }
+  if (SSL_LOG_DATA) Log::Print(
+      "Leaving ProcessReadEncryptedBuffer wrote %d bytes\n", bytes_processed);
   return bytes_processed;
 }
 
 
-intptr_t SSLFilter::ProcessWriteEncryptedBuffer(int start, int end) {
+int SSLFilter::ProcessWriteEncryptedBuffer(int start, int end) {
   int length = end - start;
   int bytes_processed = 0;
   if (length > 0) {
-    uint8_t* buffer = buffers_[kWriteEncrypted];
-    const uint8_t* buf1;
-    const uint8_t* buf2;
-    unsigned int len1;
-    unsigned int len2;
-    memio_Private* secret = memio_GetSecret(filter_);
-    int status = memio_GetWriteParams(secret, &buf1, &len1, &buf2, &len2);
-    if (status != 0) {
-      return -1;
-    }
-    int bytes_to_send =
-        dart::Utils::Minimum(len1, static_cast<unsigned>(length));
-    if (bytes_to_send > 0) {
-      memmove(buffer + start, buf1, bytes_to_send);
-      bytes_processed = bytes_to_send;
-    }
-    bytes_to_send = dart::Utils::Minimum(len2,
-        static_cast<unsigned>(length - bytes_processed));
-    if (bytes_to_send > 0) {
-      memmove(buffer + start + bytes_processed, buf2, bytes_to_send);
-      bytes_processed += bytes_to_send;
-    }
-    if (bytes_processed > 0) {
-      memio_PutWriteResult(secret, bytes_processed);
+    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);
+      return 0;
+    } else {
+      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.h b/runtime/bin/secure_socket.h
index 5deccc1..29adef4 100644
--- a/runtime/bin/secure_socket.h
+++ b/runtime/bin/secure_socket.h
@@ -5,19 +5,19 @@
 #ifndef BIN_SECURE_SOCKET_H_
 #define BIN_SECURE_SOCKET_H_
 
+#ifdef DART_IO_SECURE_SOCKET_DISABLED
+#error "secure_socket.h can only be included on builds with SSL enabled"
+#endif
+
 #include <stdlib.h>
 #include <string.h>
 #include <stdio.h>
 #include <sys/types.h>
 
-#if !defined(DART_IO_SECURE_SOCKET_DISABLED)
-#include <prinit.h>
-#include <prerror.h>
-#include <prnetdb.h>
-#include <ssl.h>
-#else
-struct PRFileDesc;
-#endif
+#include <openssl/bio.h>
+#include <openssl/ssl.h>
+#include <openssl/err.h>
+#include <openssl/x509.h>
 
 #include "bin/builtin.h"
 #include "bin/dartutils.h"
@@ -28,6 +28,10 @@
 namespace dart {
 namespace bin {
 
+/* These are defined in root_certificates.cc. */
+extern const unsigned char* root_certificates_pem;
+extern unsigned int root_certificates_pem_length;
+
 /*
  * SSLFilter encapsulates the NSS SSL(TLS) code in a filter, that communicates
  * with the containing _SecureFilterImpl Dart object through four shared
@@ -49,23 +53,21 @@
 
   SSLFilter()
       : callback_error(NULL),
+        ssl_(NULL),
+        socket_side_(NULL),
         string_start_(NULL),
         string_length_(NULL),
         handshake_complete_(NULL),
         bad_certificate_callback_(NULL),
         in_handshake_(false),
-        client_certificate_name_(NULL),
-        filter_(NULL) { }
+        hostname_(NULL) { }
 
   void Init(Dart_Handle dart_this);
-  void Connect(const char* host,
-               const RawAddr& raw_addr,
-               int port,
+  void Connect(const char* hostname,
+               SSL_CTX* context,
                bool is_server,
-               const char* certificate_name,
                bool request_client_certificate,
                bool require_client_certificate,
-               bool send_client_certificate,
                Dart_Handle protocols_handle);
   void Destroy();
   void Handshake();
@@ -78,27 +80,29 @@
   Dart_Handle bad_certificate_callback() {
     return Dart_HandleFromPersistent(bad_certificate_callback_);
   }
-  intptr_t ProcessReadPlaintextBuffer(int start, int end);
-  intptr_t ProcessWritePlaintextBuffer(int start1, int end1,
-                                       int start2, int end2);
-  intptr_t ProcessReadEncryptedBuffer(int start, int end);
-  intptr_t ProcessWriteEncryptedBuffer(int start, int end);
+  int ProcessReadPlaintextBuffer(int start, int end);
+  int ProcessWritePlaintextBuffer(int start, int end);
+  int ProcessReadEncryptedBuffer(int start, int end);
+  int ProcessWriteEncryptedBuffer(int start, int end);
   bool ProcessAllBuffers(int starts[kNumBuffers],
                          int ends[kNumBuffers],
                          bool in_handshake);
   Dart_Handle PeerCertificate();
-  static void InitializeLibrary(const char* certificate_database,
-                                const char* password,
-                                bool use_builtin_root_certificates,
-                                bool report_duplicate_initialization = true);
+  static void InitializeLibrary();
   Dart_Handle callback_error;
 
   static CObject* ProcessFilterRequest(const CObjectArray& request);
 
+  // The index of the external data field in _ssl that points to the SSLFilter.
+  static int filter_ssl_index;
+
+  // TODO(whesse): make private:
+  SSL* ssl_;
+  BIO* socket_side_;
+
+
  private:
-  static const int kMemioBufferSize = 20 * KB;
   static bool library_initialized_;
-  static const char* password_;
   static Mutex* mutex_;  // To protect library initialization.
 
   uint8_t* buffers_[kNumBuffers];
@@ -111,8 +115,8 @@
   Dart_PersistentHandle bad_certificate_callback_;
   bool in_handshake_;
   bool is_server_;
-  char* client_certificate_name_;
-  PRFileDesc* filter_;
+  char* hostname_;
+  X509_VERIFY_PARAM* certificate_checking_parameters_;
 
   static bool isBufferEncrypted(int i) {
     return static_cast<BufferIndex>(i) >= kFirstEncrypted;
diff --git a/runtime/bin/secure_socket_patch.dart b/runtime/bin/secure_socket_patch.dart
index 4e22a14..8d0b6bc 100644
--- a/runtime/bin/secure_socket_patch.dart
+++ b/runtime/bin/secure_socket_patch.dart
@@ -5,11 +5,6 @@
 patch class SecureSocket {
   /* patch */ factory SecureSocket._(RawSecureSocket rawSocket) =>
       new _SecureSocket(rawSocket);
-
-  /* patch */ static void initialize({String database,
-                                      String password,
-                                      bool useBuiltinRoots: true})
-  native "SecureSocket_InitializeLibrary";
 }
 
 
@@ -17,6 +12,9 @@
   /* patch */ factory _SecureFilter() => new _SecureFilterImpl();
 }
 
+patch class X509Certificate {
+  /* patch */ factory X509Certificate._() => new _X509CertificateImpl();
+}
 
 class _SecureSocket extends _Socket implements SecureSocket {
   _SecureSocket(RawSecureSocket raw) : super(raw);
@@ -79,13 +77,10 @@
   }
 
   void connect(String hostName,
-               Uint8List sockaddrStorage,
-               int port,
+               SecurityContext context,
                bool is_server,
-               String certificateName,
                bool requestClientCertificate,
                bool requireClientCertificate,
-               bool sendClientCertificate,
                Uint8List protocols) native "SecureSocket_Connect";
 
   void destroy() {
@@ -119,3 +114,68 @@
 
   List<_ExternalBuffer> buffers;
 }
+
+patch class SecurityContext {
+  /* patch */ factory SecurityContext() {
+    return new _SecurityContext();
+  }
+
+  /* patch */ static SecurityContext get defaultContext {
+    return _SecurityContext.defaultContext;
+  }
+}
+
+class _SecurityContext
+    extends NativeFieldWrapperClass1
+    implements SecurityContext {
+  _SecurityContext() {
+    _createNativeContext();
+  }
+
+  void _createNativeContext() native "SecurityContext_Allocate";
+
+  static final SecurityContext defaultContext =
+      new _SecurityContext().._trustBuiltinRoots();
+
+  void usePrivateKey(String keyFile, {String password})
+      native "SecurityContext_UsePrivateKey";
+  void setTrustedCertificates({String file, String directory})
+      native "SecurityContext_SetTrustedCertificates";
+  void useCertificateChain(String file)
+      native "SecurityContext_UseCertificateChain";
+  void setClientAuthorities(String file)
+      native "SecurityContext_SetClientAuthorities";
+  void setAlpnProtocols(List<String> protocols, bool isServer) {
+    Uint8List encodedProtocols =
+        SecurityContext._protocolsToLengthEncoding(protocols);
+    _setAlpnProtocols(encodedProtocols, isServer);
+  }
+  void _setAlpnProtocols(Uint8List protocols, bool isServer)
+      native "SecurityContext_SetAlpnProtocols";
+  void _trustBuiltinRoots()
+      native "SecurityContext_TrustBuiltinRoots";
+}
+
+/**
+ * _X509CertificateImpl wraps an X509 certificate object held by the BoringSSL
+ * library. It exposes the fields of the certificate object.
+ */
+class _X509CertificateImpl extends NativeFieldWrapperClass1
+    implements X509Certificate {
+  // The native field must be set manually on a new object, in native code.
+  // This is done by WrappedX509 in secure_socket.cc.
+  _X509CertificateImpl();
+
+  String get subject native "X509_Subject";
+  String get issuer native "X509_Issuer";
+  DateTime get startValidity {
+    return new DateTime.fromMillisecondsSinceEpoch(_startValidity(),
+                                                   isUtc: true);
+  }
+  DateTime get endValidity {
+    return new DateTime.fromMillisecondsSinceEpoch(_endValidity(),
+                                                   isUtc: true);
+  }
+  int _startValidity() native "X509_StartValidity";
+  int _endValidity() native "X509_EndValidity";
+}
\ No newline at end of file
diff --git a/runtime/bin/secure_socket_unsupported.cc b/runtime/bin/secure_socket_unsupported.cc
index 231b71e..6bcc55e 100644
--- a/runtime/bin/secure_socket_unsupported.cc
+++ b/runtime/bin/secure_socket_unsupported.cc
@@ -99,6 +99,66 @@
       "Secure Sockets unsupported on this platform"));
 }
 
+void FUNCTION_NAME(SecurityContext_Allocate)(Dart_NativeArguments args) {
+  Dart_ThrowException(DartUtils::NewDartArgumentError(
+      "Secure Sockets unsupported on this platform"));
+}
+
+void FUNCTION_NAME(SecurityContext_UsePrivateKey)(Dart_NativeArguments args) {
+  Dart_ThrowException(DartUtils::NewDartArgumentError(
+      "Secure Sockets unsupported on this platform"));
+}
+
+void FUNCTION_NAME(SecurityContext_SetAlpnProtocols)(
+    Dart_NativeArguments args) {
+  Dart_ThrowException(DartUtils::NewDartArgumentError(
+      "Secure Sockets unsupported on this platform"));
+}
+
+void FUNCTION_NAME(SecurityContext_SetClientAuthorities)(
+    Dart_NativeArguments args) {
+  Dart_ThrowException(DartUtils::NewDartArgumentError(
+      "Secure Sockets unsupported on this platform"));
+}
+
+void FUNCTION_NAME(SecurityContext_SetTrustedCertificates)(
+    Dart_NativeArguments args) {
+  Dart_ThrowException(DartUtils::NewDartArgumentError(
+      "Secure Sockets unsupported on this platform"));
+}
+
+void FUNCTION_NAME(SecurityContext_TrustBuiltinRoots)(
+    Dart_NativeArguments args) {
+  Dart_ThrowException(DartUtils::NewDartArgumentError(
+      "Secure Sockets unsupported on this platform"));
+}
+
+void FUNCTION_NAME(SecurityContext_UseCertificateChain)(
+    Dart_NativeArguments args) {
+  Dart_ThrowException(DartUtils::NewDartArgumentError(
+      "Secure Sockets unsupported on this platform"));
+}
+
+void FUNCTION_NAME(X509_Subject)(Dart_NativeArguments args) {
+  Dart_ThrowException(DartUtils::NewDartArgumentError(
+      "Secure Sockets unsupported on this platform"));
+}
+
+void FUNCTION_NAME(X509_Issuer)(Dart_NativeArguments args) {
+  Dart_ThrowException(DartUtils::NewDartArgumentError(
+      "Secure Sockets unsupported on this platform"));
+}
+
+void FUNCTION_NAME(X509_StartValidity)(Dart_NativeArguments args) {
+  Dart_ThrowException(DartUtils::NewDartArgumentError(
+      "Secure Sockets unsupported on this platform"));
+}
+
+void FUNCTION_NAME(X509_EndValidity)(Dart_NativeArguments args) {
+  Dart_ThrowException(DartUtils::NewDartArgumentError(
+      "Secure Sockets unsupported on this platform"));
+}
+
 class SSLFilter {
  public:
   static CObject* ProcessFilterRequest(const CObjectArray& request);
diff --git a/runtime/bin/socket.cc b/runtime/bin/socket.cc
index ea5154e..b0b6a34 100644
--- a/runtime/bin/socket.cc
+++ b/runtime/bin/socket.cc
@@ -170,20 +170,6 @@
 }
 
 
-Dart_Handle ListeningSocketRegistry::MarkSocketFdAsSharableHack(
-    intptr_t socketfd) {
-  MutexLocker ml(ListeningSocketRegistry::mutex_);
-
-  SocketsIterator it = sockets_by_fd_.find(socketfd);
-  if (it != sockets_by_fd_.end()) {
-    it->second->shared = true;
-    return Dart_True();
-  } else {
-    return Dart_False();
-  }
-}
-
-
 void FUNCTION_NAME(InternetAddress_Parse)(Dart_NativeArguments args) {
   const char* address =
       DartUtils::GetStringValue(Dart_GetNativeArgument(args, 0));
@@ -855,15 +841,6 @@
 }
 
 
-void FUNCTION_NAME(Socket_MarkSocketAsSharedHack)(Dart_NativeArguments args) {
-  intptr_t socketfd =
-      Socket::GetSocketIdNativeField(Dart_GetNativeArgument(args, 0));
-
-  ListeningSocketRegistry *registry = ListeningSocketRegistry::Instance();
-  Dart_SetReturnValue(args, registry->MarkSocketFdAsSharableHack(socketfd));
-}
-
-
 void Socket::SetSocketIdNativeField(Dart_Handle socket, intptr_t id) {
   Dart_Handle err =
       Dart_SetNativeInstanceField(socket, kSocketIdNativeField, id);
diff --git a/runtime/bin/socket.h b/runtime/bin/socket.h
index 507acd9..1910f86 100644
--- a/runtime/bin/socket.h
+++ b/runtime/bin/socket.h
@@ -395,13 +395,6 @@
   // this function.
   bool CloseSafe(intptr_t socketfd);
 
-  // Mark an existing socket as sharable if it is not already marked as
-  // sharable.
-  //
-  // NOTE: This is a temporary measure until ServerSocketReference's are
-  // removed.
-  Dart_Handle MarkSocketFdAsSharableHack(intptr_t socketfd);
-
   Mutex *mutex() { return mutex_; }
 
  private:
diff --git a/runtime/bin/socket_patch.dart b/runtime/bin/socket_patch.dart
index 94285aa..7de16a9 100644
--- a/runtime/bin/socket_patch.dart
+++ b/runtime/bin/socket_patch.dart
@@ -280,9 +280,6 @@
   static const Duration _RETRY_DURATION_LOOPBACK =
       const Duration(milliseconds: 25);
 
-  // Use default Map so we keep order.
-  static Map<int, _NativeSocket> _sockets = new Map<int, _NativeSocket>();
-
   // Socket close state
   bool isClosed = false;
   bool isClosing = false;
@@ -316,14 +313,8 @@
   bool writeEventIssued = false;
   bool writeAvailable = false;
 
-  static final Stopwatch sw = new Stopwatch()..start();
-  // Statistics.
-  int totalRead = 0;
-  int totalWritten = 0;
-  int readCount = 0;
-  int writeCount = 0;
-  double lastRead;
-  double lastWrite;
+  static bool connectedResourceHandler = false;
+  _ReadWriteResourceInfo resourceInfo;
 
   // The owner object is the object that the Socket is being used by, e.g.
   // a HttpServer, a WebSocket connection, a process pipe, etc.
@@ -441,6 +432,8 @@
                   _RETRY_DURATION_LOOPBACK :
                   _RETRY_DURATION;
               var timer = new Timer(duration, connectNext);
+              setupResourceInfo(socket);
+
               connecting[socket] = timer;
               // Setup handlers for receiving the first write event which
               // indicate that the socket is fully connected.
@@ -492,7 +485,6 @@
         .then((address) {
           var socket = new _NativeSocket.listen();
           socket.localAddress = address;
-
           var result = socket.nativeCreateBindListen(address._in_addr,
                                                      port,
                                                      backlog,
@@ -505,11 +497,16 @@
                                       port: port);
           }
           if (port != 0) socket.localPort = port;
+          setupResourceInfo(socket);
           socket.connectToEventHandler();
           return socket;
         });
   }
 
+  static void setupResourceInfo(_NativeSocket socket) {
+    socket.resourceInfo = new _SocketResourceInfo(socket);
+  }
+
   static Future<_NativeSocket> bindDatagram(
       host, int port, bool reuseAddress) {
     return new Future.value(host)
@@ -534,6 +531,7 @@
                                       port: port);
           }
           if (port != 0) socket.localPort = port;
+          setupResourceInfo(socket);
           return socket;
         });
   }
@@ -575,10 +573,17 @@
     }
     if (result != null) {
       available -= result.length;
-      totalRead += result.length;
+      // TODO(ricow): Remove when we track internal and pipe uses.
+      assert(resourceInfo != null || isPipe || isInternal);
+      if (resourceInfo != null) {
+        resourceInfo.totalRead += result.length;
+      }
     }
-    readCount++;
-    lastRead = timestamp;
+    // TODO(ricow): Remove when we track internal and pipe uses.
+    assert(resourceInfo != null || isPipe || isInternal);
+    if (resourceInfo != null) {
+      resourceInfo.didRead();
+    }
     return result;
   }
 
@@ -595,10 +600,17 @@
       // receive. If available becomes > 0, the _NativeSocket will continue to
       // emit read events.
       available = nativeAvailable();
-      totalRead += result.data.length;
+      // TODO(ricow): Remove when we track internal and pipe uses.
+      assert(resourceInfo != null || isPipe || isInternal);
+      if (resourceInfo != null) {
+        resourceInfo.totalRead += result.data.length;
+      }
     }
-    readCount++;
-    lastRead = timestamp;
+    // TODO(ricow): Remove when we track internal and pipe uses.
+    assert(resourceInfo != null || isPipe || isInternal);
+    if (resourceInfo != null) {
+      resourceInfo.didRead();
+    }
     return result;
   }
 
@@ -637,9 +649,11 @@
     }
     // Negate the result, as stated above.
     if (result < 0) result = -result;
-    totalWritten += result;
-    writeCount++;
-    lastWrite = timestamp;
+    // TODO(ricow): Remove when we track internal and pipe uses.
+    assert(resourceInfo != null || isPipe || isInternal);
+    if (resourceInfo != null) {
+      resourceInfo.addWrite(result);
+    }
     return result;
   }
 
@@ -656,9 +670,11 @@
       scheduleMicrotask(() => reportError(result, "Send failed"));
       result = 0;
     }
-    totalWritten += result;
-    writeCount++;
-    lastWrite = timestamp;
+    // TODO(ricow): Remove when we track internal and pipe uses.
+    assert(resourceInfo != null || isPipe || isInternal);
+    if (resourceInfo != null) {
+      resourceInfo.addWrite(result);
+    }
     return result;
   }
 
@@ -673,8 +689,13 @@
     if (nativeAccept(socket) != true) return null;
     socket.localPort = localPort;
     socket.localAddress = address;
-    totalRead += 1;
-    lastRead = timestamp;
+    setupResourceInfo(socket);
+    // TODO(ricow): Remove when we track internal and pipe uses.
+    assert(resourceInfo != null || isPipe || isInternal);
+    if (resourceInfo != null) {
+      // We track this as read one byte.
+      resourceInfo.addRead(1);
+    }
     return socket;
   }
 
@@ -787,6 +808,11 @@
         if (i == DESTROYED_EVENT) {
           assert(isClosing);
           assert(!isClosed);
+          // TODO(ricow): Remove/update when we track internal and pipe uses.
+          assert(resourceInfo != null || isPipe || isInternal);
+          if (resourceInfo != null) {
+            _SocketResourceInfo.SocketClosed(resourceInfo);
+          }
           isClosed = true;
           closeCompleter.complete();
           disconnectFromEventHandler();
@@ -904,7 +930,14 @@
     assert(!isClosed);
     if (eventPort == null) {
       eventPort = new RawReceivePort(multiplex);
-      _sockets[_serviceId] = this;
+    }
+    if (!connectedResourceHandler) {
+      registerExtension('__getOpenSockets',
+                        _SocketResourceInfo.getOpenSockets);
+      registerExtension('__getSocketByID',
+                        _SocketResourceInfo.getSocketInfoMapByID);
+
+      connectedResourceHandler = true;
     }
   }
 
@@ -912,7 +945,6 @@
     assert(eventPort != null);
     eventPort.close();
     eventPort = null;
-    _sockets.remove(_serviceId);
     // Now that we don't track this Socket anymore, we can clear the owner
     // field.
     owner = null;
@@ -1017,123 +1049,6 @@
     if (result is OSError) throw result;
   }
 
-  String get _serviceTypePath => 'io/sockets';
-  String get _serviceTypeName => 'Socket';
-
-  String _JSONKind() {
-    return isListening ? "Listening" :
-           isPipe ? "Pipe" :
-           isInternal ? "Internal" : "Normal";
-  }
-
-  Map _toJSONPipe(bool ref) {
-    var name = 'Anonymous Pipe';
-    var r = {
-      'id': _servicePath,
-      'type': _serviceType(ref),
-      'name': name,
-      'user_name': name,
-      'kind': _JSONKind(),
-    };
-    if (ref) {
-      return r;
-    }
-    r['readClosed'] = isClosedRead;
-    r['writeClosed'] = isClosedWrite;
-    r['closing'] = isClosing;
-    r['fd'] = nativeGetSocketId();
-    if (owner != null) {
-      r['owner'] = owner._toJSON(true);
-    }
-    return r;
-  }
-
-  Map _toJSONInternal(bool ref) {
-    var name = 'Internal';
-    var r = {
-      'id': _servicePath,
-      'type': _serviceType(ref),
-      'name': name,
-      'user_name': name,
-      'kind': _JSONKind(),
-    };
-    if (ref) {
-      return r;
-    }
-    r['closing'] = isClosing;
-    r['fd'] = nativeGetSocketId();
-    if (owner != null) {
-      r['owner'] = owner._toJSON(true);
-    }
-    return r;
-  }
-
-  Map _toJSONNetwork(bool ref) {
-    var name = '${address.host}:$port';
-    if (isTcp && !isListening) name += " <-> ${remoteAddress.host}:$remotePort";
-    var r = {
-      'id': _servicePath,
-      'type': _serviceType(ref),
-      'name': name,
-      'user_name': name,
-      'kind': _JSONKind(),
-    };
-    if (ref) {
-      return r;
-    }
-    var protocol = isTcp ? "TCP" : isUdp ? "UDP" : null;
-    var localAddress;
-    var localPort;
-    var rAddress;
-    var rPort;
-    try {
-      localAddress = address.address;
-    } catch (e) { }
-    try {
-      localPort = port;
-    } catch (e) { }
-    try {
-      rAddress = this.remoteAddress.address;
-    } catch (e) { }
-    try {
-      rPort = remotePort;
-    } catch (e) { }
-    r['localAddress'] = localAddress;
-    r['localPort'] = localPort;
-    r['remoteAddress'] = rAddress;
-    r['remotePort'] = rPort;
-    r['protocol'] = protocol;
-    r['readClosed'] = isClosedRead;
-    r['writeClosed'] = isClosedWrite;
-    r['closing'] = isClosing;
-    r['listening'] = isListening;
-    r['fd'] = nativeGetSocketId();
-    if (owner != null) {
-      r['owner'] = owner._toJSON(true);
-    }
-    return r;
-  }
-
-  Map _toJSON(bool ref) {
-    var map;
-    if (isPipe) {
-      map =  _toJSONPipe(ref);
-    } else if (isInternal) {
-      map = _toJSONInternal(ref);
-    } else {
-      map = _toJSONNetwork(ref);
-    }
-    if (!ref) {
-      map['available'] = available;
-      map['totalRead'] = totalRead;
-      map['totalWritten'] = totalWritten;
-      map['readCount'] = totalWritten;
-      map['writeCount'] = writeCount;
-      map['lastRead'] = lastRead;
-      map['lastWrite'] = lastWrite;
-    }
-    return map;
-  }
 
   void nativeSetSocketId(int id) native "Socket_SetSocketId";
   nativeAvailable() native "Socket_Available";
@@ -1168,8 +1083,6 @@
   bool nativeLeaveMulticast(
       List<int> addr, List<int> interfaceAddr, int interfaceIndex)
       native "Socket_LeaveMulticast";
-  bool _nativeMarkSocketAsSharedHack()
-      native "Socket_MarkSocketAsSharedHack";
 }
 
 
@@ -1272,52 +1185,10 @@
     }
   }
 
-  RawServerSocketReference get reference {
-    if (_referencePort == null) {
-      bool successfull = _socket._nativeMarkSocketAsSharedHack();
-      _referencePort = new ReceivePort();
-      _referencePort.listen((sendPort) {
-        sendPort.send(
-          [_socket.address,
-           _socket.port,
-           _v6Only]);
-      });
-    }
-    return new _RawServerSocketReference(_referencePort.sendPort);
-  }
-
-  Map _toJSON(bool ref) => _socket._toJSON(ref);
-
   void set _owner(owner) { _socket.owner = owner; }
 }
 
 
-class _RawServerSocketReference implements RawServerSocketReference {
-  final SendPort _sendPort;
-
-  _RawServerSocketReference(this._sendPort);
-
-  Future<RawServerSocket> create() {
-    var port = new ReceivePort();
-    _sendPort.send(port.sendPort);
-    return port.first.then((List args) {
-      port.close();
-
-      InternetAddress address = args[0];
-      int tcpPort = args[1];
-      bool v6Only = args[2];
-      return
-          RawServerSocket.bind(address, tcpPort, v6Only: v6Only, shared: true);
-    });
-  }
-
-  int get hashCode => _sendPort.hashCode;
-
-  bool operator==(Object other)
-      => other is _RawServerSocketReference && _sendPort == other._sendPort;
-}
-
-
 class _RawSocket extends Stream<RawSocketEvent>
                  implements RawSocket {
   final _NativeSocket _socket;
@@ -1465,7 +1336,6 @@
     }
   }
 
-  Map _toJSON(bool ref) => _socket._toJSON(ref);
   void set _owner(owner) { _socket.owner = owner; }
 }
 
@@ -1481,17 +1351,6 @@
 }
 
 
-class _ServerSocketReference implements ServerSocketReference {
-  final RawServerSocketReference _rawReference;
-
-  _ServerSocketReference(this._rawReference);
-
-  Future<ServerSocket> create() {
-    return _rawReference.create().then((raw) => new _ServerSocket(raw));
-  }
-}
-
-
 class _ServerSocket extends Stream<Socket>
                     implements ServerSocket {
   final _socket;
@@ -1524,12 +1383,6 @@
 
   Future close() => _socket.close().then((_) => this);
 
-  ServerSocketReference get reference {
-    return new _ServerSocketReference(_socket.reference);
-  }
-
-  Map _toJSON(bool ref) => _socket._toJSON(ref);
-
   void set _owner(owner) { _socket._owner = owner; }
 }
 
@@ -1843,7 +1696,6 @@
     }
   }
 
-  Map _toJSON(bool ref) => _raw._toJSON(ref);
   void set _owner(owner) { _raw._owner = owner; }
 }
 
@@ -1999,4 +1851,3 @@
       port);
 }
 
-String _socketsStats() => _SocketsObservatory.toJSON();
diff --git a/runtime/bin/utils.h b/runtime/bin/utils.h
index 10ca3735..2c3f1fc 100644
--- a/runtime/bin/utils.h
+++ b/runtime/bin/utils.h
@@ -11,7 +11,6 @@
 #include "include/dart_api.h"
 #include "platform/globals.h"
 
-
 namespace dart {
 namespace bin {
 
@@ -20,7 +19,7 @@
   enum SubSystem {
     kSystem,
     kGetAddressInfo,
-    kNSS,
+    kBoringSSL,
     kUnknown = -1
   };
 
diff --git a/runtime/bin/vmservice/server.dart b/runtime/bin/vmservice/server.dart
index 1f807e7..8697e65 100644
--- a/runtime/bin/vmservice/server.dart
+++ b/runtime/bin/vmservice/server.dart
@@ -16,6 +16,12 @@
     socket.done.then((_) => close());
   }
 
+  disconnect() {
+    if (socket != null) {
+      socket.close();
+    }
+  }
+
   void onWebSocketMessage(message) {
     if (message is String) {
       var map;
@@ -40,6 +46,10 @@
   }
 
   void post(dynamic result) {
+    if (result == null) {
+      // Do nothing.
+      return;
+    }
     try {
       socket.add(result);
     } catch (_) {
@@ -64,7 +74,16 @@
   HttpRequestClient(this.request, VMService service)
       : super(service, sendEvents:false);
 
+  disconnect() {
+    request.response.close();
+    close();
+  }
+
   void post(String result) {
+    if (result == null) {
+      close();
+      return;
+    }
     request.response..headers.contentType = jsonContentType
                     ..write(result)
                     ..close();
@@ -127,9 +146,16 @@
       return;
     }
     // HTTP based service request.
-    var client = new HttpRequestClient(request, _service);
-    var message = new Message.fromUri(client, request.uri);
-    client.onMessage(null, message);
+    try {
+      var client = new HttpRequestClient(request, _service);
+      var message = new Message.fromUri(client, request.uri);
+      client.onMessage(null, message);
+    } catch (e) {
+      print('Unexpected error processing HTTP request uri: '
+            '${request.uri}\n$e\n');
+      rethrow;
+    }
+
   }
 
   Future startup() {
diff --git a/runtime/bin/vmservice/vmservice_io.dart b/runtime/bin/vmservice/vmservice_io.dart
index 409bc59..eb44a6c 100644
--- a/runtime/bin/vmservice/vmservice_io.dart
+++ b/runtime/bin/vmservice/vmservice_io.dart
@@ -8,7 +8,7 @@
 import 'dart:convert';
 import 'dart:io';
 import 'dart:isolate';
-import 'dart:vmservice';
+import 'dart:_vmservice';
 
 part 'loader.dart';
 part 'resources.dart';
@@ -89,6 +89,15 @@
     // scheduled microtasks.
     Timer.run(() {});
   }
+  // TODO(johnmccutchan, turnidge) Creating a VMService object here causes
+  // strange behavior from the legacy debug protocol and coverage tool.
+  // Enable this code, and remove the call to Isolate::KillIsolate() from
+  // service_isolate.cc when the strange behavior is solved.
+  // See: https://github.com/dart-lang/sdk/issues/23977
+  // else {
+  //   var service = new VMService();
+  //   service.onShutdown = _onShutdown;
+  // }
   scriptLoadPort.handler = _processLoadRequest;
   // Register signal handler after a small delay to avoid stalling main
   // isolate startup.
diff --git a/runtime/bin/vmservice_dartium.cc b/runtime/bin/vmservice_dartium.cc
index 195a6ce..40e61ef 100644
--- a/runtime/bin/vmservice_dartium.cc
+++ b/runtime/bin/vmservice_dartium.cc
@@ -65,7 +65,7 @@
   // Prepare for script loading by setting up the 'print' and 'timer'
   // closures and setting up 'package root' for URI resolution.
   result = DartUtils::PrepareForScriptLoading(
-      NULL, NULL, true, false, builtin_lib);
+      NULL, NULL, NULL, true, false, builtin_lib);
   CHECK_RESULT(result);
 
   ASSERT(Dart_IsServiceIsolate(isolate));
diff --git a/runtime/bin/vmservice_impl.cc b/runtime/bin/vmservice_impl.cc
index 89d802f..6ffe61e 100644
--- a/runtime/bin/vmservice_impl.cc
+++ b/runtime/bin/vmservice_impl.cc
@@ -159,6 +159,7 @@
 char VmService::server_ip_[kServerIpStringBufferSize];
 intptr_t VmService::server_port_ = 0;
 
+
 bool VmService::Setup(const char* server_ip, intptr_t server_port) {
   Dart_Isolate isolate = Dart_CurrentIsolate();
   ASSERT(isolate != NULL);
@@ -173,7 +174,7 @@
   // Prepare for script loading by setting up the 'print' and 'timer'
   // closures and setting up 'package root' for URI resolution.
   result = DartUtils::PrepareForScriptLoading(
-      NULL, NULL, true, false, builtin_lib);
+      NULL, NULL, NULL, true, false, builtin_lib);
   SHUTDOWN_ON_ERROR(result);
 
   // Load main script.
@@ -203,7 +204,8 @@
   SHUTDOWN_ON_ERROR(library);
 
   // Set HTTP server state.
-  DartUtils::SetStringField(library, "_ip", server_ip);
+  result = DartUtils::SetStringField(library, "_ip", server_ip);
+  SHUTDOWN_ON_ERROR(result);
   // If we have a port specified, start the server immediately.
   bool auto_start = server_port >= 0;
   if (server_port < 0) {
@@ -211,7 +213,8 @@
     // port when the HTTP server is started.
     server_port = 0;
   }
-  DartUtils::SetIntegerField(library, "_port", server_port);
+  result = DartUtils::SetIntegerField(library, "_port", server_port);
+  SHUTDOWN_ON_ERROR(result);
   result = Dart_SetField(library,
                          DartUtils::NewString("_autoStart"),
                          Dart_NewBoolean(auto_start));
@@ -313,7 +316,7 @@
   RETURN_ERROR_HANDLE(result);
   ASSERT(data_buffer_length == data_list_buffer_length);
   ASSERT(data_list_buffer != NULL);
-  ASSERT(type = Dart_TypedData_kUint8);
+  ASSERT(type == Dart_TypedData_kUint8);
   memmove(data_list_buffer, &data_buffer[0], data_buffer_length);
   result = Dart_TypedDataReleaseData(data_list);
   RETURN_ERROR_HANDLE(result);
diff --git a/runtime/bin/zlib.gyp b/runtime/bin/zlib.gyp
new file mode 100644
index 0000000..6f2f913
--- /dev/null
+++ b/runtime/bin/zlib.gyp
@@ -0,0 +1,76 @@
+# 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.
+
+# Copyright (c) 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 file is a modified copy of
+# https://chromium.googlesource.com/chromium/src/third_party/zlib/zlib.gyp
+# at revision c3d0a6190f2f8c924a05ab6cc97b8f975bddd33f.
+{
+  # Added by Dart. All Dart comments refer to the following block or line.
+  'includes': [
+    '../tools/gyp/runtime-configurations.gypi',
+    '../tools/gyp/nss_configurations.gypi',
+  ],
+  'variables': {
+    # Added by Dart.
+    'zlib_path': '../../third_party/zlib',
+  },
+  # Added by Dart.  We do not indent, so diffs with the original are clearer.
+  'conditions': [[ 'dart_io_support==1', {
+  'targets': [
+    {
+      'target_name': 'zlib_dart',  # Added by Dart (the _dart postfix)
+      'type': 'static_library',
+      # Added by Dart (the original only has this on android).
+      'toolsets':['host','target'],
+      # Changed by Dart: '<(zlib_directory)/' added to all paths.
+      'sources': [
+        '<(zlib_path)/adler32.c',
+        '<(zlib_path)/compress.c',
+        '<(zlib_path)/crc32.c',
+        '<(zlib_path)/crc32.h',
+        '<(zlib_path)/deflate.c',
+        '<(zlib_path)/deflate.h',
+        '<(zlib_path)/gzclose.c',
+        '<(zlib_path)/gzguts.h',
+        '<(zlib_path)/gzlib.c',
+        '<(zlib_path)/gzread.c',
+        '<(zlib_path)/gzwrite.c',
+        '<(zlib_path)/infback.c',
+        '<(zlib_path)/inffast.c',
+        '<(zlib_path)/inffast.h',
+        '<(zlib_path)/inffixed.h',
+        '<(zlib_path)/inflate.c',
+        '<(zlib_path)/inflate.h',
+        '<(zlib_path)/inftrees.c',
+        '<(zlib_path)/inftrees.h',
+        '<(zlib_path)/mozzconf.h',
+        '<(zlib_path)/trees.c',
+        '<(zlib_path)/trees.h',
+        '<(zlib_path)/uncompr.c',
+        '<(zlib_path)/zconf.h',
+        '<(zlib_path)/zlib.h',
+        '<(zlib_path)/zutil.c',
+        '<(zlib_path)/zutil.h',
+      ],
+      'include_dirs': [
+            '<(zlib_path)/.',
+      ],
+      'direct_dependent_settings': {
+        'include_dirs': [
+              '<(zlib_path)/.',
+        ],
+      },
+      'conditions': [
+        ['OS!="win"', {
+          'product_name': 'chrome_zlib',
+        }],
+      ],
+    },
+  ],
+  }]],
+}
diff --git a/runtime/codereview.settings b/runtime/codereview.settings
index f0cfca3..b731156 100644
--- a/runtime/codereview.settings
+++ b/runtime/codereview.settings
@@ -1,4 +1,4 @@
 # This file is used by gcl to get repository specific information.
-CODE_REVIEW_SERVER: http://codereview.chromium.org/
-VIEW_VC: https://code.google.com/p/dart/source/detail?r=
+CODE_REVIEW_SERVER: http://codereview.chromium.org
+VIEW_VC: https://github.com/dart-lang/sdk/commit/
 CC_LIST: reviews@dartlang.org,vm-dev@dartlang.org
diff --git a/runtime/include/dart_api.h b/runtime/include/dart_api.h
index d3f54b1..e6f643c 100755
--- a/runtime/include/dart_api.h
+++ b/runtime/include/dart_api.h
@@ -131,7 +131,10 @@
  *   occur in any function which triggers the execution of Dart code.
  *
  * - Fatal error handles are produced when the system wants to shut
- *   down the current isolate.
+ *   down the current isolate. Sometimes a fatal error may be a
+ *   restart request (see Dart_IsRestartRequest). If the embedder does
+ *   not support restarting the VM, then this should be treated as a
+ *   normal fatal error.
  *
  * --- Propagating errors ---
  *
@@ -268,6 +271,17 @@
 DART_EXPORT bool Dart_IsFatalError(Dart_Handle handle);
 
 /**
+ * Is this error a request to restart the VM?
+ *
+ * If an embedder chooses to support restarting the VM from tools
+ * (such as a debugger), then this function is used to distinguish
+ * restart requests from other fatal errors.
+ *
+ * Requires there to be a current isolate.
+ */
+DART_EXPORT bool Dart_IsVMRestartRequest(Dart_Handle handle);
+
+/**
  * Gets the error message from an error handle.
  *
  * Requires there to be a current isolate.
@@ -368,7 +382,6 @@
     }                                                                          \
   }                                                                            \
 
-
 /**
  * Converts an object to a string.
  *
@@ -742,8 +755,14 @@
  *   improve debugging messages.  The main function is not invoked by
  *   this function.
  * \param package_root The package root path for this isolate to resolve
- *   package imports against. If this parameter is NULL, the package root path
- *   of the parent isolate should be used.
+ *   package imports against. Only one of package_root and package_map
+ *   parameters is non-NULL. If neither parameter is passed the package
+ *   resolution of the parent isolate should be used.
+ * \param package_map The package map for this isolate to resolve package
+ *   imports against. The array contains alternating keys and values,
+ *   terminated by a NULL key. Only one of package_root and package_map
+ *   parameters is non-NULL. If neither parameter is passed the package
+ *   resolution of the parent isolate should be used.
  * \param flags Default flags for this isolate being spawned. Either inherited
  *   from the spawning isolate or passed as parameters when spawning the
  *   isolate from Dart code.
@@ -758,6 +777,7 @@
 typedef Dart_Isolate (*Dart_IsolateCreateCallback)(const char* script_uri,
                                                    const char* main,
                                                    const char* package_root,
+                                                   const char** package_map,
                                                    Dart_IsolateFlags* flags,
                                                    void* callback_data,
                                                    char** error);
@@ -852,6 +872,8 @@
  *
  * \param vm_isolate_snapshot A buffer containing a snapshot of the VM isolate
  *   or NULL if no snapshot is provided.
+ * \param instructions_snapshot A buffer containing a snapshot of precompiled
+ *   instructions, or NULL if no snapshot is provided.
  * \param create A function to be called during isolate creation.
  *   See Dart_IsolateCreateCallback.
  * \param interrupt A function to be called when an isolate is interrupted.
@@ -861,10 +883,12 @@
  * \param shutdown A function to be called when an isolate is shutdown.
  *   See Dart_IsolateShutdownCallback.
  *
- * \return True if initialization is successful.
+ * \return NULL if initialization is successful. Returns an error message
+ *   otherwise. The caller is responsible for freeing the error message.
  */
-DART_EXPORT bool Dart_Initialize(
+DART_EXPORT char* Dart_Initialize(
     const uint8_t* vm_isolate_snapshot,
+    const uint8_t* instructions_snapshot,
     Dart_IsolateCreateCallback create,
     Dart_IsolateInterruptCallback interrupt,
     Dart_IsolateUnhandledExceptionCallback unhandled_exception,
@@ -878,9 +902,10 @@
 /**
  * Cleanup state in the VM before process termination.
  *
- * \return True if cleanup is successful.
+ * \return NULL if cleanup is successful. Returns an error message otherwise.
+ *   The caller is responsible for freeing the error message.
  */
-DART_EXPORT bool Dart_Cleanup();
+DART_EXPORT char* Dart_Cleanup();
 
 /**
  * Sets command line flags. Should be called before Dart_Initialize.
@@ -1841,6 +1866,25 @@
                                        intptr_t index);
 
 /**
+* Gets a range of Objects from a List.
+*
+* If any of the requested index values are out of bounds, an error occurs.
+*
+* May generate an unhandled exception error.
+*
+* \param list A List.
+* \param offset The offset of the first item to get.
+* \param length The number of items to get.
+* \param result A pointer to fill with the objects.
+*
+* \return Success if no error occurs during the operation.
+*/
+DART_EXPORT Dart_Handle Dart_ListGetRange(Dart_Handle list,
+                                          intptr_t offset,
+                                          intptr_t length,
+                                          Dart_Handle* result);
+
+/**
  * Sets the Object at some index of a List.
  *
  * If the index is out of bounds, an error occurs.
@@ -2839,4 +2883,52 @@
  */
 DART_EXPORT Dart_Port Dart_ServiceWaitForLoadPort();
 
+
+/*
+ * ==============
+ * Precompilation
+ * ==============
+ */
+
+
+typedef struct {
+  const char* library_uri;
+  const char* class_name;
+  const char* function_name;
+} Dart_QualifiedFunctionName;
+
+
+/**
+ * Compiles all functions reachable from the provided entry points and marks
+ * the isolate to disallow future compilation.
+ *
+ * \param entry_points A list of functions that may be invoked through the
+ * embedding API, e.g. Dart_Invoke/GetField/SetField/New/InvokeClosure.
+ *
+ * \param reset_fields Controls whether static fields are reset. Fields without
+ * an initializer will be set to null, and fields with an initializer will have
+ * their initializer run the next time they are accessed.
+ *
+ * reset_fields is true when we are about to create a precompilated snapshot.
+ * Some fields are already been initialized as part of the loading logic, and
+ * we want them to be reinitialized in the new process that will load the
+ * snapshot. reset_fields is false for --noopt, which will continue running in
+ * the same process.
+ *
+ * \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_CreatePrecompiledSnapshot(
+    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_snapshot_buffer,
+    intptr_t* instructions_snapshot_size);
+
 #endif  /* INCLUDE_DART_API_H_ */  /* NOLINT */
diff --git a/runtime/include/dart_native_api.h b/runtime/include/dart_native_api.h
index 5a27249..ea7900d 100644
--- a/runtime/include/dart_native_api.h
+++ b/runtime/include/dart_native_api.h
@@ -159,6 +159,5 @@
  * TODO(turnidge): Document.
  */
 DART_EXPORT Dart_Handle Dart_CompileAll();
-DART_EXPORT Dart_Handle Dart_Precompile();
 
 #endif  /* INCLUDE_DART_NATIVE_API_H_ */  /* NOLINT */
diff --git a/runtime/include/dart_tools_api.h b/runtime/include/dart_tools_api.h
index cd096de..88c2616 100644
--- a/runtime/include/dart_tools_api.h
+++ b/runtime/include/dart_tools_api.h
@@ -341,6 +341,7 @@
   kNoPauseOnExceptions = 1,
   kPauseOnUnhandledExceptions,
   kPauseOnAllExceptions,
+  kInvalidExceptionPauseInfo
 } Dart_ExceptionPauseInfo;
 
 /**
@@ -880,14 +881,137 @@
  */
 
 /**
+ * Returns a timestamp in microseconds. This timestamp is suitable for
+ * passing into the timeline system.
+ *
+ * \return A timestamp that can be passed to the timeline system.
+ */
+DART_EXPORT int64_t Dart_TimelineGetMicros();
+
+/** Timeline stream for Dart API calls */
+#define DART_TIMELINE_STREAM_API (1 << 0)
+/** Timeline stream for compiler events */
+#define DART_TIMELINE_STREAM_COMPILER (1 << 1)
+/** Timeline stream for Dart provided events */
+#define DART_TIMELINE_STREAM_DART (1 << 2)
+/** Timeline stream for embedder provided events */
+#define DART_TIMELINE_STREAM_EMBEDDER (1 << 3)
+/** Timeline stream for GC events */
+#define DART_TIMELINE_STREAM_GC (1 << 4)
+/** Timeline stream for isolate events */
+#define DART_TIMELINE_STREAM_ISOLATE (1 << 5)
+
+/** Timeline stream for VM events */
+#define DART_TIMELINE_STREAM_VM (1 << 6)
+
+/** Enable all timeline stream recording for an isolate */
+#define DART_TIMELINE_STREAM_ALL (DART_TIMELINE_STREAM_API |                   \
+                                  DART_TIMELINE_STREAM_COMPILER |              \
+                                  DART_TIMELINE_STREAM_DART |                  \
+                                  DART_TIMELINE_STREAM_EMBEDDER |              \
+                                  DART_TIMELINE_STREAM_GC |                    \
+                                  DART_TIMELINE_STREAM_ISOLATE)
+
+/** Disable all timeline stream recording */
+#define DART_TIMELINE_STREAM_DISABLE 0
+
+/**
+ * Start recording timeline events for the current isolate.
+ *
+ * \param stream_mask A bitmask of streams that should be recorded.
+ *
+ * NOTE: Calling with 0 disables recording of all streams.
+ */
+DART_EXPORT void Dart_TimelineSetRecordedStreams(int64_t stream_mask);
+
+
+/**
+ * Start recording timeline events for the entire VM (including all isolates).
+ *
+ * NOTE: When enabled, the global flag, will override the per-isolate flag.
+ *
+ * \param stream_mask A bitmask of streams that should be recorded.
+ *
+ * NOTE: Calling with 0 disables recording of all streams.
+ */
+DART_EXPORT void Dart_GlobalTimelineSetRecordedStreams(int64_t stream_mask);
+
+
+typedef enum {
+  /** Indicates a new stream is being output */
+  Dart_StreamConsumer_kStart = 0,
+  /** Data for the current stream */
+  Dart_StreamConsumer_kData = 1,
+  /** Indicates stream is finished */
+  Dart_StreamConsumer_kFinish = 2,
+} Dart_StreamConsumer_State;
+
+/**
+ * A stream consumer callback function.
+ *
+ * This function will be called repeatedly until there is no more data in a
+ * stream and there are no more streams.
+ *
+ * \param state Indicates a new stream, data, or a finished stream.
+ * \param stream_name A name for this stream. Not guaranteed to be meaningful.
+ * \param buffer A pointer to the stream data.
+ * \param buffer_length The number of bytes at buffer that should be consumed.
+ * \param stream_callback_data The pointer passed in when requesting the stream.
+ *
+ * At the start of each stream state will be DART_STREAM_CONSUMER_STATE_START
+ * and buffer will be NULL.
+ *
+ * For each chunk of data the state will be DART_STREAM_CONSUMER_STATE_DATA
+ * and buffer will not be NULL.
+ *
+ * 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);
+
+
+/**
+ * Get the timeline for the current isolate in trace-event format
+ *
+ * \param consumer A Dart_StreamConsumer.
+ * \param user_data User data passed into consumer.
+ *
+ * NOTE: The trace-event format is documented here: https://goo.gl/hDZw5M
+ *
+ * \return True if a stream was output.
+ */
+DART_EXPORT bool Dart_TimelineGetTrace(Dart_StreamConsumer consumer,
+                                       void* user_data);
+
+/**
+ * Get the timeline for entire VM (including all isolates).
+ *
+ * NOTE: The timeline retrieved from this API call may not include the most
+ * recent events.
+ *
+ * \param consumer A Dart_StreamConsumer.
+ * \param user_data User data passed into consumer.
+ *
+ * NOTE: The trace-event format is documented here: https://goo.gl/hDZw5M
+ *
+ * \return True if a stream was output.
+ */
+DART_EXPORT bool Dart_GlobalTimelineGetTrace(Dart_StreamConsumer consumer,
+                                             void* user_data);
+
+/**
  * Add a duration timeline event to the embedder stream for the current isolate.
  *
  * \param label The name of the event.
  * \param start_micros The start of the duration (in microseconds)
  * \param end_micros The end of the duration (in microseconds)
  *
- * NOTE: On Posix platforms you should use gettimeofday and on Windows platforms
- * you should use GetSystemTimeAsFileTime to get the time values.
+ * NOTE: All timestamps should be acquired from Dart_TimelineGetMicros.
  */
 DART_EXPORT Dart_Handle Dart_TimelineDuration(const char* label,
                                               int64_t start_micros,
@@ -899,8 +1023,7 @@
  *
  * \param label The name of event.
  *
- * NOTE: On Posix platforms this call uses gettimeofday and on Windows platforms
- * this call uses GetSystemTimeAsFileTime to get the current time.
+ * NOTE: All timestamps should be acquired from Dart_TimelineGetMicros.
  */
 DART_EXPORT Dart_Handle Dart_TimelineInstant(const char* label);
 
@@ -917,8 +1040,7 @@
  * calls to Dart_TimelineAsyncInstant and Dart_TimelineAsyncEnd will become
  * no-ops.
  *
- * NOTE: On Posix platforms this call uses gettimeofday and on Windows platforms
- * this call uses GetSystemTimeAsFileTime to get the current time.
+ * NOTE: All timestamps should be acquired from Dart_TimelineGetMicros.
  */
 DART_EXPORT Dart_Handle Dart_TimelineAsyncBegin(const char* label,
                                                 int64_t* async_id);
@@ -933,8 +1055,7 @@
  * \return Returns an asynchronous id that must be passed to
  * Dart_TimelineAsyncInstant and Dart_TimelineAsyncEnd.
  *
- * NOTE: On Posix platforms this call uses gettimeofday and on Windows platforms
- * this call uses GetSystemTimeAsFileTime to get the current time.
+ * NOTE: All timestamps should be acquired from Dart_TimelineGetMicros.
  */
 DART_EXPORT Dart_Handle Dart_TimelineAsyncInstant(const char* label,
                                                   int64_t async_id);
@@ -949,8 +1070,7 @@
  * \return Returns an asynchronous id that must be passed to
  * Dart_TimelineAsyncInstant and Dart_TimelineAsyncEnd.
  *
- * NOTE: On Posix platforms this call uses gettimeofday and on Windows platforms
- * this call uses GetSystemTimeAsFileTime to get the current time.
+ * NOTE: All timestamps should be acquired from Dart_TimelineGetMicros.
  */
 DART_EXPORT Dart_Handle Dart_TimelineAsyncEnd(const char* label,
                                               int64_t async_id);
diff --git a/runtime/lib/array.cc b/runtime/lib/array.cc
index 003f12f..b95e6b0 100644
--- a/runtime/lib/array.cc
+++ b/runtime/lib/array.cc
@@ -22,7 +22,7 @@
   const Array& array = Array::CheckedHandle(arguments->NativeArgAt(0));
   GET_NON_NULL_NATIVE_ARGUMENT(Smi, index, arguments->NativeArgAt(1));
   if ((index.Value() < 0) || (index.Value() >= array.Length())) {
-    Exceptions::ThrowRangeError("index", index, 0, array.Length());
+    Exceptions::ThrowRangeError("index", index, 0, array.Length() - 1);
   }
   return array.At(index.Value());
 }
@@ -33,7 +33,7 @@
   GET_NON_NULL_NATIVE_ARGUMENT(Smi, index, arguments->NativeArgAt(1));
   const Instance& value = Instance::CheckedHandle(arguments->NativeArgAt(2));
   if ((index.Value() < 0) || (index.Value() >= array.Length())) {
-    Exceptions::ThrowRangeError("index", index, 0, array.Length());
+    Exceptions::ThrowRangeError("index", index, 0, array.Length() - 1);
   }
   array.SetAt(index.Value(), value);
   return Object::null();
@@ -52,22 +52,22 @@
   GET_NON_NULL_NATIVE_ARGUMENT(Smi, start, arguments->NativeArgAt(1));
   GET_NON_NULL_NATIVE_ARGUMENT(Smi, count, arguments->NativeArgAt(2));
   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());
+  }
   intptr_t icount = count.Value();
   // Zero count should be handled outside already.
   if ((icount <= 0) || (icount > src.Length())) {
     Exceptions::ThrowRangeError(
         "count",
-        Smi::Handle(Smi::New(icount)),
-        1,
-        src.Length() + 1);
-  }
-  intptr_t istart = start.Value();
-  if ((istart < 0) || ((istart + icount) > src.Length())) {
-    Exceptions::ThrowRangeError(
-        "start",
-        Smi::Handle(Smi::New(istart)),
-        0,
-        src.Length() - icount + 1);
+        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/async_patch.dart b/runtime/lib/async_patch.dart
index 682ee8b..fdeb5c9 100644
--- a/runtime/lib/async_patch.dart
+++ b/runtime/lib/async_patch.dart
@@ -4,3 +4,183 @@
 
 import "dart:_internal";
 
+// We need to pass the value as first argument and leave the second and third
+// arguments empty (used for error handling).
+// See vm/ast_transformer.cc for usage.
+Function _asyncThenWrapperHelper(continuation) {
+  // Any function that is used as an asynchronous callback must be registered
+  // in the current Zone. Normally, this is done by the future when a
+  // callback is registered (for example with `.then` or `.catchError`). In our
+  // case we want to reuse the same callback multiple times and therefore avoid
+  // the multiple registrations. For our internal futures (`_Future`) we can
+  // use the shortcut-version of `.then`, and skip the registration. However,
+  // that means that the continuation must be registered by us.
+  //
+  // Furthermore, we know that the root-zone doesn't actually do anything and
+  // we can therefore skip the registration call for it.
+  //
+  // Note, that the continuation accepts up to three arguments. If the current
+  // zone is the root zone, we don't wrap the continuation, and a bad
+  // `Future` implementation could potentially invoke the callback with the
+  // wrong number of arguments.
+  if (Zone.current == Zone.ROOT) return continuation;
+  return Zone.current.registerUnaryCallback((x) => continuation(x, null, null));
+}
+
+// We need to pass the exception and stack trace objects as second and third
+// parameter to the continuation.  See vm/ast_transformer.cc for usage.
+Function _asyncErrorWrapperHelper(continuation) {
+  // See comments of `_asyncThenWrapperHelper`.
+  var errorCallback = (e, s) => continuation(null, e, s);
+  if (Zone.current == Zone.ROOT) return errorCallback;
+  return Zone.current.registerBinaryCallback(errorCallback);
+}
+
+/// Registers the [thenCallback] and [errorCallback] on the given [object].
+///
+/// If [object] is not a future, then it is wrapped into one.
+///
+/// Returns the result of registering with `.then`.
+Future _awaitHelper(
+    var object, Function thenCallback, Function errorCallback) {
+  if (object is! Future) {
+    object = new _Future().._setValue(object);
+  } else if (object is! _Future) {
+    return object.then(thenCallback, onError: errorCallback);
+  }
+  // `object` is a `_Future`.
+  //
+  // Since the callbacks have been registered in the current zone (see
+  // [_asyncThenWrapperHelper] and [_asyncErrorWrapperHelper]), we can avoid
+  // another registration and directly invoke the no-zone-registration `.then`.
+  //
+  // We can only do this for our internal futures (the default implementation of
+  // all futures that are constructed by the `dart:async` library).
+  return object._thenNoZoneRegistration(thenCallback, errorCallback);
+}
+
+// _AsyncStarStreamController is used by the compiler to implement
+// async* generator functions.
+class _AsyncStarStreamController {
+  StreamController controller;
+  Function asyncStarBody;
+  bool isAdding = false;
+  bool onListenReceived = false;
+  bool isScheduled = false;
+  bool isSuspendedAtYield = false;
+  Completer cancellationCompleter = null;
+
+  Stream get stream => controller.stream;
+
+  void runBody() {
+    isScheduled = false;
+    isSuspendedAtYield = false;
+    asyncStarBody();
+  }
+
+  void scheduleGenerator() {
+    if (isScheduled || controller.isPaused || isAdding) {
+      return;
+    }
+    isScheduled = true;
+    scheduleMicrotask(runBody);
+  }
+
+  // Adds element to steam, returns true if the caller should terminate
+  // execution of the generator.
+  //
+  // TODO(hausner): Per spec, the generator should be suspended before
+  // exiting when the stream is closed. We could add a getter like this:
+  // get isCancelled => controller.hasListener;
+  // The generator would translate a 'yield e' statement to
+  // controller.add(e);
+  // suspend;
+  // if (controller.isCancelled) return;
+  bool add(event) {
+    if (!onListenReceived) _fatal("yield before stream is listened to!");
+    if (isSuspendedAtYield) _fatal("unexpected yield");
+    // If stream is cancelled, tell caller to exit the async generator.
+    if (!controller.hasListener) {
+      return true;
+    }
+    controller.add(event);
+    scheduleGenerator();
+    isSuspendedAtYield = true;
+    return false;
+  }
+
+  // Adds the elements of stream into this controller's stream.
+  // The generator will be scheduled again when all of the
+  // elements of the added stream have been consumed.
+  // Returns true if the caller should terminate
+  // execution of the generator.
+  bool addStream(Stream stream) {
+    if (!onListenReceived) _fatal("yield before stream is listened to!");
+    // If stream is cancelled, tell caller to exit the async generator.
+    if (!controller.hasListener) return true;
+    isAdding = true;
+    var whenDoneAdding =
+        controller.addStream(stream as Stream, cancelOnError: false);
+    whenDoneAdding.then((_) {
+      isAdding = false;
+      scheduleGenerator();
+    });
+    return false;
+  }
+
+  void addError(error, stackTrace) {
+    if ((cancellationCompleter != null) && !cancellationCompleter.isCompleted) {
+      // If the stream has been cancelled, complete the cancellation future
+      // with the error.
+      cancellationCompleter.completeError(error, stackTrace);
+      return;
+    }
+    // If stream is cancelled, tell caller to exit the async generator.
+    if (!controller.hasListener) return;
+    controller.addError(error, stackTrace);
+    // No need to schedule the generator body here. This code is only
+    // called from the catch clause of the implicit try-catch-finally
+    // around the generator body. That is, we are on the error path out
+    // of the generator and do not need to run the generator again.
+  }
+
+  close() {
+    if ((cancellationCompleter != null) && !cancellationCompleter.isCompleted) {
+      // If the stream has been cancelled, complete the cancellation future
+      // with the error.
+      cancellationCompleter.complete();
+    }
+    controller.close();
+  }
+
+  _AsyncStarStreamController(this.asyncStarBody) {
+    controller = new StreamController(onListen: this.onListen,
+                                      onResume: this.onResume,
+                                      onCancel: this.onCancel);
+  }
+
+  onListen() {
+    assert(!onListenReceived);
+    onListenReceived = true;
+    scheduleGenerator();
+  }
+
+  onResume() {
+    if (isSuspendedAtYield) {
+      scheduleGenerator();
+    }
+  }
+
+  onCancel() {
+    if (controller.isClosed) {
+      return null;
+    }
+    if (cancellationCompleter == null) {
+      cancellationCompleter = new Completer();
+      scheduleGenerator();
+    }
+    return cancellationCompleter.future;
+  }
+}
+
+patch void _rethrow(Object error, StackTrace stackTrace) native "Async_rethrow";
diff --git a/runtime/lib/bigint.dart b/runtime/lib/bigint.dart
index a278595..ae941b7 100644
--- a/runtime/lib/bigint.dart
+++ b/runtime/lib/bigint.dart
@@ -1745,7 +1745,7 @@
             _absSub(d_digits, abcd_used, b_digits, abcd_used, d_digits);
           } else {
             _absSub(b_digits, abcd_used, d_digits, abcd_used, d_digits);
-            d_neg = !d_neg && (d_cmp_ab != 0);
+            d_neg = !d_neg && (d_cmp_b != 0);
           }
         } else {
           _absAdd(d_digits, abcd_used, b_digits, abcd_used, d_digits);
diff --git a/runtime/lib/core_patch.dart b/runtime/lib/core_patch.dart
index 2a45ae7..79749fd 100644
--- a/runtime/lib/core_patch.dart
+++ b/runtime/lib/core_patch.dart
@@ -8,12 +8,6 @@
 // Equivalent of calling FATAL from C++ code.
 _fatal(msg) native "DartCore_fatal";
 
-// We need to pass the exception and stack trace objects as second and third
-// parameter to the continuation.  See vm/ast_transformer.cc for usage.
-void  _asyncCatchHelper(catchFunction, continuation) {
-  catchFunction((e, s) => continuation(null, e, s));
-}
-
 // The members of this class are cloned and added to each class that
 // represents an enum type.
 class _EnumHelper {
@@ -26,132 +20,6 @@
   int get hashCode => _enum_names[index].hashCode;
 }
 
-
-// _AsyncStarStreamController is used by the compiler to implement
-// async* generator functions.
-class _AsyncStarStreamController {
-  StreamController controller;
-  Function asyncStarBody;
-  bool isAdding = false;
-  bool onListenReceived = false;
-  bool isScheduled = false;
-  bool isSuspendedAtYield = false;
-  Completer cancellationCompleter = null;
-
-  Stream get stream => controller.stream;
-
-  void runBody() {
-    isScheduled = false;
-    isSuspendedAtYield = false;
-    asyncStarBody();
-  }
-
-  void scheduleGenerator() {
-    if (isScheduled || controller.isPaused || isAdding) {
-      return;
-    }
-    isScheduled = true;
-    scheduleMicrotask(runBody);
-  }
-
-  // Adds element to steam, returns true if the caller should terminate
-  // execution of the generator.
-  //
-  // TODO(hausner): Per spec, the generator should be suspended before
-  // exiting when the stream is closed. We could add a getter like this:
-  // get isCancelled => controller.hasListener;
-  // The generator would translate a 'yield e' statement to
-  // controller.add(e);
-  // suspend;
-  // if (controller.isCancelled) return;
-  bool add(event) {
-    if (!onListenReceived) _fatal("yield before stream is listened to!");
-    if (isSuspendedAtYield) _fatal("unexpected yield");
-    // If stream is cancelled, tell caller to exit the async generator.
-    if (!controller.hasListener) {
-      return true;
-    }
-    controller.add(event);
-    scheduleGenerator();
-    isSuspendedAtYield = true;
-    return false;
-  }
-
-  // Adds the elements of stream into this controller's stream.
-  // The generator will be scheduled again when all of the
-  // elements of the added stream have been consumed.
-  // Returns true if the caller should terminate
-  // execution of the generator.
-  bool addStream(Stream stream) {
-    if (!onListenReceived) _fatal("yield before stream is listened to!");
-    // If stream is cancelled, tell caller to exit the async generator.
-    if (!controller.hasListener) return true;
-    isAdding = true;
-    var whenDoneAdding =
-        controller.addStream(stream as Stream, cancelOnError: false);
-    whenDoneAdding.then((_) {
-      isAdding = false;
-      scheduleGenerator();
-    });
-    return false;
-  }
-
-  void addError(error, stackTrace) {
-    if ((cancellationCompleter != null) && !cancellationCompleter.isCompleted) {
-      // If the stream has been cancelled, complete the cancellation future
-      // with the error.
-      cancellationCompleter.completeError(error, stackTrace);
-      return;
-    }
-    // If stream is cancelled, tell caller to exit the async generator.
-    if (!controller.hasListener) return;
-    controller.addError(error, stackTrace);
-    // No need to schedule the generator body here. This code is only
-    // called from the catch clause of the implicit try-catch-finally
-    // around the generator body. That is, we are on the error path out
-    // of the generator and do not need to run the generator again.
-  }
-
-  close() {
-    if ((cancellationCompleter != null) && !cancellationCompleter.isCompleted) {
-      // If the stream has been cancelled, complete the cancellation future
-      // with the error.
-      cancellationCompleter.complete();
-    }
-    controller.close();
-  }
-
-  _AsyncStarStreamController(this.asyncStarBody) {
-    controller = new StreamController(onListen: this.onListen,
-                                      onResume: this.onResume,
-                                      onCancel: this.onCancel);
-  }
-
-  onListen() {
-    assert(!onListenReceived);
-    onListenReceived = true;
-    scheduleGenerator();
-  }
-
-  onResume() {
-    if (isSuspendedAtYield) {
-      scheduleGenerator();
-    }
-  }
-
-  onCancel() {
-    if (controller.isClosed) {
-      return null;
-    }
-    if (cancellationCompleter == null) {
-      cancellationCompleter = new Completer();
-      scheduleGenerator();
-    }
-    return cancellationCompleter.future;
-  }
-}
-
-
 // _SyncIterable and _syncIterator are used by the compiler to
 // implement sync* generator functions. A sync* generator allocates
 // and returns a new _SyncIterable object.
diff --git a/runtime/lib/date_patch.dart b/runtime/lib/date_patch.dart
index 0d6065d..6c5c0c2 100644
--- a/runtime/lib/date_patch.dart
+++ b/runtime/lib/date_patch.dart
@@ -67,13 +67,13 @@
              const [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335]];
 
   static List _computeUpperPart(int localMs) {
-    final int DAYS_IN_4_YEARS = 4 * 365 + 1;
-    final int DAYS_IN_100_YEARS = 25 * DAYS_IN_4_YEARS - 1;
-    final int DAYS_IN_400_YEARS = 4 * DAYS_IN_100_YEARS + 1;
-    final int DAYS_1970_TO_2000 = 30 * 365 + 7;
-    final int DAYS_OFFSET = 1000 * DAYS_IN_400_YEARS + 5 * DAYS_IN_400_YEARS -
+    const int DAYS_IN_4_YEARS = 4 * 365 + 1;
+    const int DAYS_IN_100_YEARS = 25 * DAYS_IN_4_YEARS - 1;
+    const int DAYS_IN_400_YEARS = 4 * DAYS_IN_100_YEARS + 1;
+    const int DAYS_1970_TO_2000 = 30 * 365 + 7;
+    const int DAYS_OFFSET = 1000 * DAYS_IN_400_YEARS + 5 * DAYS_IN_400_YEARS -
                             DAYS_1970_TO_2000;
-    final int YEARS_OFFSET = 400000;
+    const int YEARS_OFFSET = 400000;
 
     int resultYear = 0;
     int resultMonth = 0;
@@ -295,9 +295,9 @@
    * Code is adapted from V8.
    */
   static int _yearsFromSecondsSinceEpoch(int secondsSinceEpoch) {
-    final int DAYS_IN_4_YEARS = 4 * 365 + 1;
-    final int DAYS_IN_100_YEARS = 25 * DAYS_IN_4_YEARS - 1;
-    final int DAYS_YEAR_2098 = DAYS_IN_100_YEARS + 6 * DAYS_IN_4_YEARS;
+    const int DAYS_IN_4_YEARS = 4 * 365 + 1;
+    const int DAYS_IN_100_YEARS = 25 * DAYS_IN_4_YEARS - 1;
+    const int DAYS_YEAR_2098 = DAYS_IN_100_YEARS + 6 * DAYS_IN_4_YEARS;
 
     int days = secondsSinceEpoch ~/ Duration.SECONDS_PER_DAY;
     if (days > 0 && days < DAYS_YEAR_2098) {
@@ -319,7 +319,7 @@
    * * The week day of [this] is the same as the one for the returned date.
    */
   static int _equivalentSeconds(int millisecondsSinceEpoch) {
-    final int CUT_OFF_SECONDS = 2100000000;
+    const int CUT_OFF_SECONDS = 2100000000;
 
     int secondsSinceEpoch = _flooredDivision(millisecondsSinceEpoch,
                                              Duration.MILLISECONDS_PER_SECOND);
diff --git a/runtime/lib/developer.cc b/runtime/lib/developer.cc
index 464e89b..d2466af 100644
--- a/runtime/lib/developer.cc
+++ b/runtime/lib/developer.cc
@@ -59,4 +59,18 @@
   return Object::null();
 }
 
+
+DEFINE_NATIVE_ENTRY(Developer_lookupExtension, 1) {
+  GET_NON_NULL_NATIVE_ARGUMENT(String, name, arguments->NativeArgAt(0));
+  return isolate->LookupServiceExtensionHandler(name);
+}
+
+
+DEFINE_NATIVE_ENTRY(Developer_registerExtension, 2) {
+  GET_NON_NULL_NATIVE_ARGUMENT(String, name, arguments->NativeArgAt(0));
+  GET_NON_NULL_NATIVE_ARGUMENT(Instance, handler, arguments->NativeArgAt(1));
+  isolate->RegisterServiceExtensionHandler(name, handler);
+  return Object::null();
+}
+
 }  // namespace dart
diff --git a/runtime/lib/developer.dart b/runtime/lib/developer.dart
index 707d591..71b1f5c 100644
--- a/runtime/lib/developer.dart
+++ b/runtime/lib/developer.dart
@@ -7,14 +7,14 @@
 
 patch Object inspect(Object object) native "Developer_inspect";
 
-patch log(String message,
-          {DateTime time,
-           int sequenceNumber,
-           int level: 0,
-           String name: '',
-           Zone zone,
-           Object error,
-           StackTrace stackTrace}) {
+patch void log(String message,
+               {DateTime time,
+                int sequenceNumber,
+                int level: 0,
+                String name: '',
+                Zone zone,
+                Object error,
+                StackTrace stackTrace}) {
   if (message is! String) {
     throw new ArgumentError(message, "message", "Must be a String");
   }
@@ -29,14 +29,14 @@
   } else {
     _nextSequenceNumber = sequenceNumber + 1;
   }
-  return _log(message,
-              time.millisecondsSinceEpoch,
-              sequenceNumber,
-              level,
-              name,
-              zone,
-              error,
-              stackTrace);
+  _log(message,
+       time.millisecondsSinceEpoch,
+       sequenceNumber,
+       level,
+       name,
+       zone,
+       error,
+       stackTrace);
 }
 
 int _nextSequenceNumber = 0;
@@ -49,3 +49,9 @@
      Zone zone,
      Object error,
      StackTrace stackTrace) native "Developer_log";
+
+patch ServiceExtensionHandler _lookupExtension(String method)
+    native "Developer_lookupExtension";
+
+patch _registerExtension(String method, ServiceExtensionHandler handler)
+    native "Developer_registerExtension";
diff --git a/runtime/lib/developer_sources.gypi b/runtime/lib/developer_sources.gypi
index 4d4218c..e3f1ea6 100644
--- a/runtime/lib/developer_sources.gypi
+++ b/runtime/lib/developer_sources.gypi
@@ -10,6 +10,8 @@
     'developer.dart',
     'profiler.cc',
     'profiler.dart',
+    'timeline.cc',
+    'timeline.dart',
   ],
 }
 
diff --git a/runtime/lib/double.dart b/runtime/lib/double.dart
index 280bf3b..ea7c1cf 100644
--- a/runtime/lib/double.dart
+++ b/runtime/lib/double.dart
@@ -246,7 +246,7 @@
 
   // Order is: NaN > Infinity > ... > 0.0 > -0.0 > ... > -Infinity.
   int compareTo(num other) {
-    final int EQUAL = 0, LESS = -1, GREATER = 1;
+    const int EQUAL = 0, LESS = -1, GREATER = 1;
     if (this < other) {
       return LESS;
     } else if (this > other) {
diff --git a/runtime/lib/errors.cc b/runtime/lib/errors.cc
index 8383a30..c7a2164 100644
--- a/runtime/lib/errors.cc
+++ b/runtime/lib/errors.cc
@@ -126,4 +126,12 @@
   return Object::null();
 }
 
+// Rethrow an error with a stacktrace.
+DEFINE_NATIVE_ENTRY(Async_rethrow, 2) {
+  GET_NON_NULL_NATIVE_ARGUMENT(Instance, error, arguments->NativeArgAt(0));
+  GET_NON_NULL_NATIVE_ARGUMENT(Instance, stacktrace, arguments->NativeArgAt(1));
+  Exceptions::ReThrow(thread, error, stacktrace);
+  return Object::null();
+}
+
 }  // namespace dart
diff --git a/runtime/lib/growable_array.cc b/runtime/lib/growable_array.cc
index 8181e73..e892813 100644
--- a/runtime/lib/growable_array.cc
+++ b/runtime/lib/growable_array.cc
@@ -20,7 +20,7 @@
     Exceptions::ThrowRangeError(
         "length",
         Integer::Handle(Integer::New(data.Length())),
-        1,
+        0,  // This is the limit the user sees.
         Array::kMaxElements);
   }
   const GrowableObjectArray& new_array =
@@ -35,7 +35,7 @@
       GrowableObjectArray::CheckedHandle(arguments->NativeArgAt(0));
   GET_NON_NULL_NATIVE_ARGUMENT(Smi, index, arguments->NativeArgAt(1));
   if ((index.Value() < 0) || (index.Value() >= array.Length())) {
-    Exceptions::ThrowRangeError("index", index, 0, array.Length());
+    Exceptions::ThrowRangeError("index", index, 0, array.Length() - 1);
   }
   const Instance& obj = Instance::CheckedHandle(array.At(index.Value()));
   return obj.raw();
@@ -47,7 +47,7 @@
       GrowableObjectArray::CheckedHandle(arguments->NativeArgAt(0));
   GET_NON_NULL_NATIVE_ARGUMENT(Smi, index, arguments->NativeArgAt(1));
   if ((index.Value() < 0) || (index.Value() >= array.Length())) {
-    Exceptions::ThrowRangeError("index", index, 0, array.Length());
+    Exceptions::ThrowRangeError("index", index, 0, array.Length() - 1);
   }
   GET_NON_NULL_NATIVE_ARGUMENT(Instance, value, arguments->NativeArgAt(2));
   array.SetAt(index.Value(), value);
diff --git a/runtime/lib/growable_array.dart b/runtime/lib/growable_array.dart
index bd79837..39b4522 100644
--- a/runtime/lib/growable_array.dart
+++ b/runtime/lib/growable_array.dart
@@ -70,14 +70,13 @@
   }
 
   void removeRange(int start, int end) {
-    Lists.indicesCheck(this, start, end);
+    RangeError.checkValidRange(start, end, this.length);
     Lists.copy(this, end, this, start, this.length - end);
     this.length = this.length - (end - start);
   }
 
   List<T> sublist(int start, [int end]) {
-    Lists.indicesCheck(this, start, end);
-    if (end == null) end = this.length;
+    end = RangeError.checkValidRange(start, end, this.length);
     int length = end - start;
     if (length == 0) return <T>[];
     List list = new _List(length);
diff --git a/runtime/lib/integers.cc b/runtime/lib/integers.cc
index 1ee5b25..e8d655c 100644
--- a/runtime/lib/integers.cc
+++ b/runtime/lib/integers.cc
@@ -261,7 +261,7 @@
   }
   if (value.IsSmi()) {
     const Smi& smi_value = Smi::Cast(value);
-    return smi_value.ShiftOp(kind, amount, silent);
+    return smi_value.ShiftOp(kind, amount, Heap::kNew, silent);
   }
   if (value.IsMint()) {
     const int64_t mint_value = value.AsInt64Value();
@@ -275,7 +275,9 @@
         case Token::kSHL:
           return Integer::New(mint_value << shift_count, Heap::kNew, silent);
         case Token::kSHR:
-          return Integer::New(mint_value >> -shift_count, Heap::kNew, silent);
+          shift_count =
+              (-shift_count > Mint::kBits) ? Mint::kBits : -shift_count;
+          return Integer::New(mint_value >> shift_count, Heap::kNew, silent);
         default:
           UNIMPLEMENTED();
       }
diff --git a/runtime/lib/internal_patch.dart b/runtime/lib/internal_patch.dart
index f2fe680..8e95506 100644
--- a/runtime/lib/internal_patch.dart
+++ b/runtime/lib/internal_patch.dart
@@ -15,6 +15,9 @@
   static var eventHandlerSendData;
   // Implementation of Resource.readAsBytes.
   static var resourceReadAsBytes;
+  // Implementation of package root/map provision.
+  static var getPackageRoot;
+  static var getPackageMap;
 }
 
 patch class CodeUnits {
diff --git a/runtime/lib/invocation_mirror_patch.dart b/runtime/lib/invocation_mirror_patch.dart
index cc820cb..09b6827 100644
--- a/runtime/lib/invocation_mirror_patch.dart
+++ b/runtime/lib/invocation_mirror_patch.dart
@@ -80,7 +80,7 @@
       int numPositionalArguments = _argumentsDescriptor[1] - 1;
       int numNamedArguments = numArguments - numPositionalArguments;
       if (numNamedArguments == 0) {
-        return _namedArguments = const <Symbol, dynamic>{};
+        return _namedArguments = const {};
       }
       _namedArguments = new Map<Symbol, dynamic>();
       for (int i = 0; i < numNamedArguments; i++) {
diff --git a/runtime/lib/isolate.cc b/runtime/lib/isolate.cc
index 5199f19..349788c 100644
--- a/runtime/lib/isolate.cc
+++ b/runtime/lib/isolate.cc
@@ -125,43 +125,6 @@
 }
 
 
-static bool CanonicalizeUri(Isolate* isolate,
-                            const Library& library,
-                            const String& uri,
-                            char** canonical_uri,
-                            char** error) {
-  Zone* zone = isolate->current_zone();
-  bool retval = false;
-  Dart_LibraryTagHandler handler = isolate->library_tag_handler();
-  if (handler != NULL) {
-    Dart_EnterScope();
-    Dart_Handle result = handler(Dart_kCanonicalizeUrl,
-                                 Api::NewHandle(isolate, library.raw()),
-                                 Api::NewHandle(isolate, uri.raw()));
-    const Object& obj = Object::Handle(Api::UnwrapHandle(result));
-    if (obj.IsString()) {
-      *canonical_uri = zone->MakeCopyOfString(String::Cast(obj).ToCString());
-      retval = true;
-    } else if (obj.IsError()) {
-      Error& error_obj = Error::Handle();
-      error_obj ^= obj.raw();
-      *error = zone->PrintToString("Unable to canonicalize uri '%s': %s",
-                                   uri.ToCString(), error_obj.ToErrorCString());
-    } else {
-      *error = zone->PrintToString("Unable to canonicalize uri '%s': "
-                                   "library tag handler returned wrong type",
-                                   uri.ToCString());
-    }
-    Dart_ExitScope();
-  } else {
-    *error = zone->PrintToString(
-        "Unable to canonicalize uri '%s': no library tag handler found.",
-        uri.ToCString());
-  }
-  return retval;
-}
-
-
 static bool CreateIsolate(Isolate* parent_isolate,
                           IsolateSpawnState* state,
                           char** error) {
@@ -179,6 +142,7 @@
       (callback)(state->script_url(),
                  state->function_name(),
                  state->package_root(),
+                 state->package_map(),
                  &api_flags,
                  init_data,
                  error));
@@ -259,50 +223,118 @@
 }
 
 
-DEFINE_NATIVE_ENTRY(Isolate_spawnUri, 10) {
+static char* String2UTF8(const String& str) {
+  intptr_t len = Utf8::Length(str);
+  char* result = new char[len + 1];
+  str.ToUTF8(reinterpret_cast<uint8_t*>(result), len);
+  result[len] = 0;
+
+  return result;
+}
+
+
+static char* CanonicalizeUri(Isolate* isolate,
+                             const Library& library,
+                             const String& uri,
+                             char** error) {
+  char* result = NULL;
+  Zone* zone = isolate->current_zone();
+  Dart_LibraryTagHandler handler = isolate->library_tag_handler();
+  if (handler != NULL) {
+    Dart_EnterScope();
+    Dart_Handle handle = handler(Dart_kCanonicalizeUrl,
+                                 Api::NewHandle(isolate, library.raw()),
+                                 Api::NewHandle(isolate, uri.raw()));
+    const Object& obj = Object::Handle(Api::UnwrapHandle(handle));
+    if (obj.IsString()) {
+      result = String2UTF8(String::Cast(obj));
+    } else if (obj.IsError()) {
+      Error& error_obj = Error::Handle();
+      error_obj ^= obj.raw();
+      *error = zone->PrintToString("Unable to canonicalize uri '%s': %s",
+                                   uri.ToCString(), error_obj.ToErrorCString());
+    } else {
+      *error = zone->PrintToString("Unable to canonicalize uri '%s': "
+                                   "library tag handler returned wrong type",
+                                   uri.ToCString());
+    }
+    Dart_ExitScope();
+  } else {
+    *error = zone->PrintToString(
+        "Unable to canonicalize uri '%s': no library tag handler found.",
+        uri.ToCString());
+  }
+  return result;
+}
+
+
+DEFINE_NATIVE_ENTRY(Isolate_spawnUri, 12) {
   GET_NON_NULL_NATIVE_ARGUMENT(SendPort, port, arguments->NativeArgAt(0));
   GET_NON_NULL_NATIVE_ARGUMENT(String, uri, arguments->NativeArgAt(1));
+
   GET_NON_NULL_NATIVE_ARGUMENT(Instance, args, arguments->NativeArgAt(2));
   GET_NON_NULL_NATIVE_ARGUMENT(Instance, message, arguments->NativeArgAt(3));
+
   GET_NON_NULL_NATIVE_ARGUMENT(Bool, paused, arguments->NativeArgAt(4));
-  GET_NATIVE_ARGUMENT(Bool, checked, arguments->NativeArgAt(5));
-  GET_NATIVE_ARGUMENT(String, package_root, arguments->NativeArgAt(6));
+  GET_NATIVE_ARGUMENT(SendPort, onExit, arguments->NativeArgAt(5));
+  GET_NATIVE_ARGUMENT(SendPort, onError, arguments->NativeArgAt(6));
+
   GET_NATIVE_ARGUMENT(Bool, fatalErrors, arguments->NativeArgAt(7));
-  GET_NATIVE_ARGUMENT(SendPort, onExit, arguments->NativeArgAt(8));
-  GET_NATIVE_ARGUMENT(SendPort, onError, arguments->NativeArgAt(9));
+  GET_NATIVE_ARGUMENT(Bool, checked, arguments->NativeArgAt(8));
+
+  GET_NATIVE_ARGUMENT(Array, environment, arguments->NativeArgAt(9));
+
+  GET_NATIVE_ARGUMENT(String, package_root, arguments->NativeArgAt(10));
+  GET_NATIVE_ARGUMENT(Array, packages, arguments->NativeArgAt(11));
+
 
   // Canonicalize the uri with respect to the current isolate.
-  char* error = NULL;
-  char* canonical_uri = NULL;
   const Library& root_lib =
       Library::Handle(isolate->object_store()->root_library());
-  if (!CanonicalizeUri(isolate, root_lib, uri,
-                       &canonical_uri, &error)) {
+  char* error = NULL;
+  char* canonical_uri = CanonicalizeUri(isolate, root_lib, uri, &error);
+  if (canonical_uri == NULL) {
     const String& msg = String::Handle(String::New(error));
     ThrowIsolateSpawnException(msg);
   }
 
-  char* utf8_package_root = NULL;
-  if (!package_root.IsNull()) {
-    const intptr_t len = Utf8::Length(package_root);
-    utf8_package_root = zone->Alloc<char>(len + 1);
-    package_root.ToUTF8(reinterpret_cast<uint8_t*>(utf8_package_root), len);
-    utf8_package_root[len] = '\0';
+  char* utf8_package_root =
+      package_root.IsNull() ? NULL : String2UTF8(package_root);
+
+  char** utf8_package_map = NULL;
+  if (!packages.IsNull()) {
+    intptr_t len = packages.Length();
+    utf8_package_map = new char*[len + 1];
+
+    Object& entry = Object::Handle();
+    for (intptr_t i = 0; i < len; i++) {
+      entry = packages.At(i);
+      if (!entry.IsString()) {
+        const String& msg = String::Handle(String::NewFormatted(
+            "Bad value in package map: %s", entry.ToCString()));
+        ThrowIsolateSpawnException(msg);
+      }
+      utf8_package_map[i] = String2UTF8(String::Cast(entry));
+    }
+    // NULL terminated array.
+    utf8_package_map[len] = NULL;
   }
 
   bool fatal_errors = fatalErrors.IsNull() ? true : fatalErrors.value();
   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(),
-                                                   canonical_uri,
-                                                   utf8_package_root,
-                                                   args,
-                                                   message,
-                                                   paused.value(),
-                                                   fatal_errors,
-                                                   on_exit_port,
-                                                   on_error_port);
+  IsolateSpawnState* state = new IsolateSpawnState(
+      port.Id(),
+      canonical_uri,
+      utf8_package_root,
+      const_cast<const char**>(utf8_package_map),
+      args,
+      message,
+      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.
   if (!checked.IsNull()) {
diff --git a/runtime/lib/isolate_patch.dart b/runtime/lib/isolate_patch.dart
index e3dbec1..41389a5 100644
--- a/runtime/lib/isolate_patch.dart
+++ b/runtime/lib/isolate_patch.dart
@@ -127,9 +127,11 @@
   }
 
   int get hashCode {
-    return sendPort.hashCode();
+    return sendPort.hashCode;
   }
 
+  Uri get remotePortUri => new Uri.https('localhost', '55');
+
   /**** Internal implementation details ****/
   _get_id() native "RawReceivePortImpl_get_id";
   _get_sendport() native "RawReceivePortImpl_get_sendport";
@@ -306,17 +308,28 @@
 
   /* patch */ static Future<Isolate> spawnUri(
       Uri uri, List<String> args, var message,
-      {bool paused: false, bool checked, Uri packageRoot, bool errorsAreFatal,
-       SendPort onExit, SendPort onError}) {
+      {bool paused: false,
+       SendPort onExit,
+       SendPort onError,
+       bool errorsAreFatal,
+       bool checked,
+       Map<String, String> environment,
+       Uri packageRoot}) {
     RawReceivePort readyPort;
+    if (environment != null) throw new UnimplementedError("environment");
     try {
       // The VM will invoke [_startIsolate] and not `main`.
       readyPort = new RawReceivePort();
       var packageRootString =
           (packageRoot == null) ? null : packageRoot.toString();
-      _spawnUri(readyPort.sendPort, uri.toString(), args, message,
-                paused, checked, packageRootString,
-                errorsAreFatal, onExit, onError);
+      var packagesList = null;
+
+      _spawnUri(readyPort.sendPort, uri.toString(),
+                args, message,
+                paused, onExit, onError,
+                errorsAreFatal, checked,
+                null, /* environment */
+                packageRootString, packagesList);
       Completer completer = new Completer<Isolate>.sync();
       readyPort.handler = (readyMessage) {
         readyPort.close();
@@ -359,8 +372,10 @@
 
   static void _spawnUri(SendPort readyPort, String uri,
                         List<String> args, var message,
-                        bool paused, bool checked, String packageRoot,
-                        bool errorsAreFatal, SendPort onExit, SendPort onError)
+                        bool paused, SendPort onExit, SendPort onError,
+                        bool errorsAreFatal, bool checked,
+                        List environment,
+                        String packageRoot, List packages)
       native "Isolate_spawnUri";
 
   static void _sendOOB(port, msg) native "Isolate_sendOOB";
diff --git a/runtime/lib/map_patch.dart b/runtime/lib/map_patch.dart
index 682ba03..8a8359a 100644
--- a/runtime/lib/map_patch.dart
+++ b/runtime/lib/map_patch.dart
@@ -20,4 +20,6 @@
   /* patch */ factory Map.unmodifiable(Map other) {
     return new UnmodifiableMapView<K, V>(new Map.from(other));
   }
+
+  /* patch */ factory Map() = LinkedHashMap<K, V>;
 }
diff --git a/runtime/lib/math.cc b/runtime/lib/math.cc
index 94662e6..f4b4626 100644
--- a/runtime/lib/math.cc
+++ b/runtime/lib/math.cc
@@ -110,9 +110,9 @@
 }
 
 
-RawTypedData* CreateRandomState(Isolate* isolate, uint64_t seed) {
+RawTypedData* CreateRandomState(Zone* zone, uint64_t seed) {
   const TypedData& result = TypedData::Handle(
-      isolate, TypedData::New(kTypedDataUint32ArrayCid, 2));
+      zone, TypedData::New(kTypedDataUint32ArrayCid, 2));
   result.SetUint32(0, static_cast<uint32_t>(seed));
   result.SetUint32(result.ElementSizeInBytes(),
                    static_cast<uint32_t>(seed >> 32));
@@ -187,7 +187,7 @@
   if (seed == 0) {
     seed = 0x5a17;
   }
-  return CreateRandomState(isolate, seed);
+  return CreateRandomState(zone, seed);
 }
 
 
@@ -195,7 +195,7 @@
   Random* rnd = isolate->random();
   uint64_t seed = rnd->NextUInt32();
   seed |= (static_cast<uint64_t>(rnd->NextUInt32()) << 32);
-  return CreateRandomState(isolate, seed);
+  return CreateRandomState(zone, seed);
 }
 
 }  // namespace dart
diff --git a/runtime/lib/math_patch.dart b/runtime/lib/math_patch.dart
index 5942078..e9cc083 100644
--- a/runtime/lib/math_patch.dart
+++ b/runtime/lib/math_patch.dart
@@ -114,7 +114,7 @@
   void _nextState() native "Random_nextState";
 
   int nextInt(int max) {
-    final limit = 0x3FFFFFFF;
+    const limit = 0x3FFFFFFF;
     if (max <= 0 || ((max > limit) && (max > _POW2_32))) {
       throw new ArgumentError("max must be positive and < 2^32:"
                                          " $max");
diff --git a/runtime/lib/mirrors.cc b/runtime/lib/mirrors.cc
index d68e758..d33b754 100644
--- a/runtime/lib/mirrors.cc
+++ b/runtime/lib/mirrors.cc
@@ -91,8 +91,7 @@
   Thread* thread = Thread::Current();
   Zone* zone = thread->zone();
   const Class& cls = Class::Handle(zone, func.Owner());
-  const Error& error = Error::Handle(
-      zone, cls.EnsureIsFinalized(thread->isolate()));
+  const Error& error = Error::Handle(zone, cls.EnsureIsFinalized(thread));
   if (!error.IsNull()) {
     Exceptions::PropagateError(error);
     UNREACHABLE();
@@ -109,7 +108,7 @@
 
 static RawInstance* CreateParameterMirrorList(const Function& func,
                                               const Instance& owner_mirror) {
-  HANDLESCOPE(Isolate::Current());
+  HANDLESCOPE(Thread::Current());
   const intptr_t implicit_param_count = func.NumImplicitParameters();
   const intptr_t non_implicit_param_count = func.NumParameters() -
                                             implicit_param_count;
@@ -279,6 +278,7 @@
   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)));
 
   return CreateMirror(Symbols::_LocalMethodMirror(), args);
@@ -345,7 +345,7 @@
     }
   }
 
-  const Error& error = Error::Handle(cls.EnsureIsFinalized(Isolate::Current()));
+  const Error& error = Error::Handle(cls.EnsureIsFinalized(Thread::Current()));
   if (!error.IsNull()) {
     Exceptions::PropagateError(error);
     UNREACHABLE();
@@ -382,9 +382,17 @@
   str = lib.name();
   args.SetAt(1, str);
   str = lib.url();
-  if (str.Equals("dart:_builtin") || str.Equals("dart:_blink")) {
-    // Censored library (grumble).
-    return Instance::null();
+  const char* censored_libraries[] = {
+    "dart:_builtin",
+    "dart:_blink",
+    "dart:_vmservice",
+    NULL,
+  };
+  for (intptr_t i = 0; censored_libraries[i] != NULL; i++) {
+    if (str.Equals(censored_libraries[i])) {
+      // Censored library (grumble).
+      return Instance::null();
+    }
   }
   if (str.Equals("dart:io")) {
     // Hack around dart:io being loaded into non-service isolates in Dartium.
@@ -573,10 +581,11 @@
 
 
 static RawInstance* CreateIsolateMirror() {
-  Isolate* isolate = Isolate::Current();
+  Thread* thread = Thread::Current();
+  Isolate* isolate = thread->isolate();
   const String& debug_name = String::Handle(String::New(isolate->name()));
-  const Library& root_library =
-      Library::Handle(isolate, 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(root_library));
 
@@ -589,11 +598,12 @@
 
 static void VerifyMethodKindShifts() {
 #ifdef DEBUG
-  Isolate* isolate = Isolate::Current();
-  const Library& lib = Library::Handle(isolate, Library::MirrorsLibrary());
-  const Class& cls = Class::Handle(isolate,
+  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 Error& error = Error::Handle(isolate, cls.EnsureIsFinalized(isolate));
+  const Error& error = Error::Handle(zone, cls.EnsureIsFinalized(thread));
   ASSERT(error.IsNull());
 
   Field& field = Field::Handle();
@@ -602,7 +612,7 @@
   #define CHECK_KIND_SHIFT(name)                                               \
     field = cls.LookupField(String::Handle(String::New(#name)));               \
     ASSERT(!field.IsNull());                                                   \
-    value ^= field.value();                                                    \
+    value ^= field.StaticValue();                                              \
     ASSERT(value.Value() == Mirrors::name);
   MIRRORS_KIND_SHIFT_LIST(CHECK_KIND_SHIFT)
   #undef CHECK_KIND_SHIFT
@@ -677,7 +687,7 @@
     }
   } else {
     if (!field.IsUninitialized()) {
-      return field.value();
+      return field.StaticValue();
     }
     // An uninitialized field was found.  Check for a getter in the field's
     // owner classs.
@@ -754,7 +764,7 @@
         DartEntry::InvokeFunction(getter, Object::empty_array()));
     return ReturnResult(result);
   }
-  return field.value();
+  return field.StaticValue();
 }
 
 
@@ -788,13 +798,13 @@
 
 DEFINE_NATIVE_ENTRY(MirrorSystem_libraries, 0) {
   const GrowableObjectArray& libraries = GrowableObjectArray::Handle(
-      isolate, isolate->object_store()->libraries());
+      zone, isolate->object_store()->libraries());
 
   const intptr_t num_libraries = libraries.Length();
   const GrowableObjectArray& library_mirrors = GrowableObjectArray::Handle(
-      isolate, GrowableObjectArray::New(num_libraries));
-  Library& library = Library::Handle(isolate);
-  Instance& library_mirror = Instance::Handle(isolate);
+      zone, GrowableObjectArray::New(num_libraries));
+  Library& library = Library::Handle(zone);
+  Instance& library_mirror = Instance::Handle(zone);
 
   for (int i = 0; i < num_libraries; i++) {
     library ^= libraries.At(i);
@@ -977,7 +987,7 @@
     UNREACHABLE();
   }
   const Class& cls = Class::Handle(type.type_class());
-  const Error& error = Error::Handle(cls.EnsureIsFinalized(isolate));
+  const Error& error = Error::Handle(cls.EnsureIsFinalized(thread));
   if (!error.IsNull()) {
     Exceptions::PropagateError(error);
   }
@@ -994,7 +1004,7 @@
     UNREACHABLE();
   }
   const Class& cls = Class::Handle(type.type_class());
-  const Error& error = Error::Handle(cls.EnsureIsFinalized(isolate));
+  const Error& error = Error::Handle(cls.EnsureIsFinalized(thread));
   if (!error.IsNull()) {
     Exceptions::PropagateError(error);
   }
@@ -1059,7 +1069,7 @@
   GET_NON_NULL_NATIVE_ARGUMENT(MirrorReference, ref, arguments->NativeArgAt(2));
   const Class& klass = Class::Handle(ref.GetClassReferent());
 
-  const Error& error = Error::Handle(klass.EnsureIsFinalized(isolate));
+  const Error& error = Error::Handle(klass.EnsureIsFinalized(thread));
   if (!error.IsNull()) {
     Exceptions::PropagateError(error);
   }
@@ -1110,7 +1120,7 @@
   GET_NON_NULL_NATIVE_ARGUMENT(MirrorReference, ref, arguments->NativeArgAt(2));
   const Class& klass = Class::Handle(ref.GetClassReferent());
 
-  const Error& error = Error::Handle(klass.EnsureIsFinalized(isolate));
+  const Error& error = Error::Handle(klass.EnsureIsFinalized(thread));
   if (!error.IsNull()) {
     Exceptions::PropagateError(error);
   }
@@ -1620,7 +1630,7 @@
     UNREACHABLE();
   }
 
-  field.set_value(value);
+  field.SetStaticValue(value);
   return value.raw();
 }
 
@@ -1917,7 +1927,7 @@
     UNREACHABLE();
   }
 
-  field.set_value(value);
+  field.SetStaticValue(value);
   return value.raw();
 }
 
diff --git a/runtime/lib/mirrors.h b/runtime/lib/mirrors.h
index dc09109..40bd5d5 100644
--- a/runtime/lib/mirrors.h
+++ b/runtime/lib/mirrors.h
@@ -20,6 +20,7 @@
     V(kGenerativeCtor)                                                         \
     V(kRedirectingCtor)                                                        \
     V(kFactoryCtor)                                                            \
+    V(kExternal)                                                               \
 
   // These offsets much be kept in sync with those in mirrors_impl.dart.
   enum KindShifts {
diff --git a/runtime/lib/mirrors_impl.dart b/runtime/lib/mirrors_impl.dart
index 0c7b0bb..8b099c9 100644
--- a/runtime/lib/mirrors_impl.dart
+++ b/runtime/lib/mirrors_impl.dart
@@ -1372,6 +1372,7 @@
   static const kGenerativeCtor = 5;
   static const kRedirectingCtor = 6;
   static const kFactoryCtor = 7;
+  static const kExternal = 8;
 
   // These offsets much be kept in sync with those in mirrors.h.
   bool get isAbstract =>               0 != (_kindFlags & (1 << kAbstract));
@@ -1382,6 +1383,7 @@
   bool get isGenerativeConstructor =>  0 != (_kindFlags & (1 << kGenerativeCtor));
   bool get isRedirectingConstructor => 0 != (_kindFlags & (1 << kRedirectingCtor));
   bool get isFactoryConstructor =>     0 != (_kindFlags & (1 << kFactoryCtor));
+  bool get isExternal =>               0 != (_kindFlags & (1 << kExternal));
 
   static const _operators = const ["%", "&", "*", "+", "-", "/", "<", "<<",
       "<=", "==", ">", ">=", ">>", "[]", "[]=", "^", "|", "~", "unary-", "~/"];
diff --git a/runtime/lib/regexp.cc b/runtime/lib/regexp.cc
index 6fd9d6f..14bf14f 100644
--- a/runtime/lib/regexp.cc
+++ b/runtime/lib/regexp.cc
@@ -83,6 +83,7 @@
 
 
 DEFINE_NATIVE_ENTRY(JSSyntaxRegExp_ExecuteMatch, 3) {
+  // This function is intrinsified. See Intrinsifier::JSRegExp_ExecuteMatch.
   const JSRegExp& regexp = JSRegExp::CheckedHandle(arguments->NativeArgAt(0));
   ASSERT(!regexp.IsNull());
   GET_NON_NULL_NATIVE_ARGUMENT(String, subject, arguments->NativeArgAt(1));
@@ -93,15 +94,7 @@
                                                    zone);
   }
 
-  // This function is intrinsified. See Intrinsifier::JSRegExp_ExecuteMatch.
-  const intptr_t cid = subject.GetClassId();
-
-  // Retrieve the cached function.
-  const Function& fn = Function::Handle(regexp.function(cid));
-  ASSERT(!fn.IsNull());
-
-  // And finally call the generated code.
-  return IRRegExpMacroAssembler::Execute(fn, subject, start_index, zone);
+  return IRRegExpMacroAssembler::Execute(regexp, subject, start_index, zone);
 }
 
 }  // namespace dart
diff --git a/runtime/lib/simd128.cc b/runtime/lib/simd128.cc
index b9bf55c..4492555 100644
--- a/runtime/lib/simd128.cc
+++ b/runtime/lib/simd128.cc
@@ -14,7 +14,7 @@
 static void ThrowMaskRangeException(int64_t m) {
   if ((m < 0) || (m > 255)) {
     Exceptions::ThrowRangeError(
-        "mask", Integer::Handle(Integer::New(m)), 0, 256);
+        "mask", Integer::Handle(Integer::New(m)), 0, 255);
   }
 }
 
diff --git a/runtime/lib/string.cc b/runtime/lib/string.cc
index 9d4137d..2eae245 100644
--- a/runtime/lib/string.cc
+++ b/runtime/lib/string.cc
@@ -515,7 +515,7 @@
   }
 
   // An index larger than Smi is always illegal.
-  Exceptions::ThrowRangeError("index", index, 0, str.Length());
+  Exceptions::ThrowRangeError("index", index, 0, str.Length() - 1);
   return 0;
 }
 
@@ -601,7 +601,7 @@
   intptr_t array_length = codeUnits.Length();
   intptr_t length_value = length.Value();
   if (length_value < 0 || length_value > array_length) {
-    Exceptions::ThrowRangeError("length", length, 0, array_length + 1);
+    Exceptions::ThrowRangeError("length", length, 0, array_length);
   }
   const String& result = isLatin1.value()
       ? String::Handle(OneByteString::New(length_value, Heap::kNew))
diff --git a/runtime/lib/string_patch.dart b/runtime/lib/string_patch.dart
index 21a5ab0..eb1a2a2 100644
--- a/runtime/lib/string_patch.dart
+++ b/runtime/lib/string_patch.dart
@@ -312,7 +312,7 @@
 
   int indexOf(Pattern pattern, [int start = 0]) {
     if ((start < 0) || (start > this.length)) {
-      throw new RangeError.range(start, 0, this.length);
+      throw new RangeError.range(start, 0, this.length, "start");
     }
     if (pattern is String) {
       String other = pattern;
@@ -844,26 +844,10 @@
   }
 
   Iterable<Match> allMatches(String string, [int start = 0]) {
-    List<Match> result = new List<Match>();
-    int length = string.length;
-    int patternLength = this.length;
-    int startIndex = start;
-    while (true) {
-      int position = string.indexOf(this, startIndex);
-      if (position == -1) {
-        break;
-      }
-      result.add(new _StringMatch(position, string, this));
-      int endIndex = position + patternLength;
-      if (endIndex == length) {
-        break;
-      } else if (position == endIndex) {
-        ++startIndex;  // empty match, advance and restart
-      } else {
-        startIndex = endIndex;
-      }
+    if (start < 0 || start > string.length) {
+      throw new RangeError.range(start, 0, string.length, "start");
     }
-    return result;
+    return new _StringAllMatchesIterable(string, this, start);
   }
 
   Match matchAsPrefix(String string, [int start = 0]) {
@@ -1323,3 +1307,53 @@
   final String input;
   final String pattern;
 }
+
+
+class _StringAllMatchesIterable extends Iterable<Match> {
+  final String _input;
+  final String _pattern;
+  final int _index;
+
+  _StringAllMatchesIterable(this._input, this._pattern, this._index);
+
+  Iterator<Match> get iterator =>
+      new _StringAllMatchesIterator(_input, _pattern, _index);
+
+  Match get first {
+    int index = _input.indexOf(_pattern, _index);
+    if (index >= 0) {
+      return new _StringMatch(index, _input, _pattern);
+    }
+    throw IterableElementError.noElement();
+  }
+}
+
+class _StringAllMatchesIterator implements Iterator<Match> {
+  final String _input;
+  final String _pattern;
+  int _index;
+  Match _current;
+
+  _StringAllMatchesIterator(this._input, this._pattern, this._index);
+
+  bool moveNext() {
+    if (_index + _pattern.length > _input.length) {
+      _current = null;
+      return false;
+    }
+    var index = _input.indexOf(_pattern, _index);
+    if (index < 0) {
+      _index = _input.length + 1;
+      _current = null;
+      return false;
+    }
+    int end = index + _pattern.length;
+    _current = new _StringMatch(index, _input, _pattern);
+    // Empty match, don't start at same location again.
+    if (end == _index) end++;
+    _index = end;
+    return true;
+  }
+
+  Match get current => _current;
+}
diff --git a/runtime/lib/timeline.cc b/runtime/lib/timeline.cc
new file mode 100644
index 0000000..32f5896
--- /dev/null
+++ b/runtime/lib/timeline.cc
@@ -0,0 +1,110 @@
+// 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.
+
+#include "vm/bootstrap_natives.h"
+
+#include "include/dart_api.h"
+
+#include "vm/native_entry.h"
+#include "vm/object.h"
+#include "vm/os.h"
+#include "vm/timeline.h"
+
+namespace dart {
+
+// Native implementations for the dart:developer library.
+DEFINE_NATIVE_ENTRY(Timeline_getTraceClock, 0) {
+  return Integer::New(OS::GetCurrentTraceMicros(), Heap::kNew, true);
+}
+
+
+DEFINE_NATIVE_ENTRY(Timeline_getNextAsyncId, 0) {
+  TimelineEventRecorder* recorder = Timeline::recorder();
+  if (recorder == NULL) {
+    return Integer::New(0);
+  }
+  return Integer::New(recorder->GetNextAsyncId());
+}
+
+
+DEFINE_NATIVE_ENTRY(Timeline_reportTaskEvent, 6) {
+  GET_NON_NULL_NATIVE_ARGUMENT(Integer, start, arguments->NativeArgAt(0));
+  GET_NON_NULL_NATIVE_ARGUMENT(Integer, id, arguments->NativeArgAt(1));
+  GET_NON_NULL_NATIVE_ARGUMENT(String, phase, arguments->NativeArgAt(2));
+  GET_NON_NULL_NATIVE_ARGUMENT(String, category, arguments->NativeArgAt(3));
+  GET_NON_NULL_NATIVE_ARGUMENT(String, name, arguments->NativeArgAt(4));
+  GET_NON_NULL_NATIVE_ARGUMENT(String, args, arguments->NativeArgAt(5));
+
+  TimelineEventRecorder* recorder = Timeline::recorder();
+  if (recorder == NULL) {
+    return Object::null();
+  }
+
+  if (!isolate->GetDartStream()->Enabled()) {
+    // Dart stream is not enabled for this isolate, do nothing.
+    return Object::null();
+  }
+
+
+  int64_t pid = OS::ProcessId();
+  int64_t tid = OSThread::ThreadIdToIntPtr(OSThread::GetCurrentThreadTraceId());
+
+  char* event = 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.ToCString(),
+      id.AsInt64Value(),
+      args.ToCString());
+
+  // event was allocated in the zone and will be copied by AppendDartEvent.
+  recorder->AppendDartEvent(isolate, event);
+
+  return Object::null();
+}
+
+
+DEFINE_NATIVE_ENTRY(Timeline_reportCompleteEvent, 5) {
+  GET_NON_NULL_NATIVE_ARGUMENT(Integer, start, arguments->NativeArgAt(0));
+  GET_NON_NULL_NATIVE_ARGUMENT(Integer, end, arguments->NativeArgAt(1));
+  GET_NON_NULL_NATIVE_ARGUMENT(String, category, arguments->NativeArgAt(2));
+  GET_NON_NULL_NATIVE_ARGUMENT(String, name, arguments->NativeArgAt(3));
+  GET_NON_NULL_NATIVE_ARGUMENT(String, args, arguments->NativeArgAt(4));
+
+  TimelineEventRecorder* recorder = Timeline::recorder();
+  if (recorder == NULL) {
+    return Object::null();
+  }
+
+  if (!isolate->GetDartStream()->Enabled()) {
+    // Dart stream is not enabled for this isolate, do nothing.
+    return Object::null();
+  }
+
+  int64_t duration = end.AsInt64Value() - start.AsInt64Value();
+  int64_t pid = OS::ProcessId();
+  int64_t tid = OSThread::ThreadIdToIntPtr(OSThread::GetCurrentThreadTraceId());
+
+  char* event = 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());
+
+  // event was allocated in the zone and will be copied by AppendDartEvent.
+  recorder->AppendDartEvent(isolate, event);
+
+  return Object::null();
+}
+
+}  // namespace dart
diff --git a/runtime/lib/timeline.dart b/runtime/lib/timeline.dart
new file mode 100644
index 0000000..12b9278
--- /dev/null
+++ b/runtime/lib/timeline.dart
@@ -0,0 +1,24 @@
+// 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:_internal';
+
+patch int _getTraceClock() native "Timeline_getTraceClock";
+
+patch int _getNextAsyncId() native "Timeline_getNextAsyncId";
+
+patch void _reportTaskEvent(
+    int start,
+    int taskId,
+    String phase,
+    String category,
+    String name,
+    String argumentsAsJson) native "Timeline_reportTaskEvent";
+
+patch void _reportCompleteEvent(
+    int start,
+    int end,
+    String category,
+    String name,
+    String argumentsAsJson) native "Timeline_reportCompleteEvent";
diff --git a/runtime/lib/typed_data.dart b/runtime/lib/typed_data.dart
index f70781a..a56c39f 100644
--- a/runtime/lib/typed_data.dart
+++ b/runtime/lib/typed_data.dart
@@ -477,9 +477,8 @@
   }
 
   List sublist(int start, [int end]) {
-    if (end == null) end = this.length;
+    end = RangeError.checkValidRange(start, end, this.length);
     var length = end - start;
-    _rangeCheck(this.length, start, length);
     List result = _createList(length);
     result.setRange(0, length, this, start);
     return result;
diff --git a/runtime/lib/vmservice.cc b/runtime/lib/vmservice.cc
new file mode 100644
index 0000000..9a2cb2a
--- /dev/null
+++ b/runtime/lib/vmservice.cc
@@ -0,0 +1,149 @@
+// 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.
+
+#include "vm/bootstrap_natives.h"
+
+#include "vm/dart_api_impl.h"
+#include "vm/exceptions.h"
+#include "vm/message.h"
+#include "vm/native_entry.h"
+#include "vm/object.h"
+#include "vm/port.h"
+#include "vm/service_isolate.h"
+#include "vm/symbols.h"
+
+namespace dart {
+
+DECLARE_FLAG(bool, trace_service);
+
+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);
+  return reinterpret_cast<uint8_t*>(new_ptr);
+}
+
+
+class RegisterRunningIsolatesVisitor : public IsolateVisitor {
+ public:
+  explicit RegisterRunningIsolatesVisitor(Thread* thread)
+      : IsolateVisitor(),
+        register_function_(Function::Handle(thread->zone())),
+        service_isolate_(thread->isolate()) {
+    ASSERT(ServiceIsolate::IsServiceIsolate(Isolate::Current()));
+    // Get library.
+    const String& library_url = Symbols::DartVMService();
+    ASSERT(!library_url.IsNull());
+    const Library& library =
+        Library::Handle(Library::LookupLibrary(library_url));
+    ASSERT(!library.IsNull());
+    // Get function.
+    const String& function_name =
+        String::Handle(String::New("_registerIsolate"));
+    ASSERT(!function_name.IsNull());
+    register_function_ = library.LookupFunctionAllowPrivate(function_name);
+    ASSERT(!register_function_.IsNull());
+  }
+
+  virtual void VisitIsolate(Isolate* isolate) {
+    ASSERT(ServiceIsolate::IsServiceIsolate(Isolate::Current()));
+    if (ServiceIsolate::IsServiceIsolateDescendant(isolate) ||
+        (isolate == Dart::vm_isolate())) {
+      // We do not register the service (and descendants) or the vm-isolate.
+      return;
+    }
+    // Setup arguments for call.
+    Dart_Port port_id = isolate->main_port();
+    const Integer& port_int = Integer::Handle(Integer::New(port_id));
+    ASSERT(!port_int.IsNull());
+    const SendPort& send_port = SendPort::Handle(SendPort::New(port_id));
+    const String& name = String::Handle(String::New(isolate->name()));
+    ASSERT(!name.IsNull());
+    const Array& args = Array::Handle(Array::New(3));
+    ASSERT(!args.IsNull());
+    args.SetAt(0, port_int);
+    args.SetAt(1, send_port);
+    args.SetAt(2, name);
+    Object& r = Object::Handle(service_isolate_->current_zone());
+    r = DartEntry::InvokeFunction(register_function_, args);
+    if (FLAG_trace_service) {
+      OS::Print("vm-service: Isolate %s %" Pd64 " registered.\n",
+                name.ToCString(),
+                port_id);
+    }
+    ASSERT(!r.IsError());
+  }
+
+ private:
+  Function& register_function_;
+  Isolate* service_isolate_;
+};
+
+
+DEFINE_NATIVE_ENTRY(VMService_SendIsolateServiceMessage, 2) {
+  GET_NON_NULL_NATIVE_ARGUMENT(SendPort, sp, arguments->NativeArgAt(0));
+  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)));
+
+  // Serialize message.
+  uint8_t* data = NULL;
+  MessageWriter writer(&data, &allocator, false);
+  writer.WriteMessage(message);
+
+  // TODO(turnidge): Throw an exception when the return value is false?
+  bool result = PortMap::PostMessage(
+      new Message(sp.Id(), data, writer.BytesWritten(),
+                  Message::kOOBPriority));
+  return Bool::Get(result).raw();
+}
+
+
+DEFINE_NATIVE_ENTRY(VMService_SendRootServiceMessage, 1) {
+  GET_NON_NULL_NATIVE_ARGUMENT(Array, message, arguments->NativeArgAt(0));
+  Service::HandleRootMessage(message);
+  return Object::null();
+}
+
+
+DEFINE_NATIVE_ENTRY(VMService_OnStart, 0) {
+  if (FLAG_trace_service) {
+    OS::Print("vm-service: Booting dart:vmservice library.\n");
+  }
+  // Boot the dart:vmservice library.
+  ServiceIsolate::BootVmServiceLibrary();
+
+  // Register running isolates with service.
+  RegisterRunningIsolatesVisitor register_isolates(thread);
+  if (FLAG_trace_service) {
+    OS::Print("vm-service: Registering running isolates.\n");
+  }
+  Isolate::VisitIsolates(&register_isolates);
+
+  return Object::null();
+}
+
+
+DEFINE_NATIVE_ENTRY(VMService_OnExit, 0) {
+  if (FLAG_trace_service) {
+    OS::Print("vm-service: processed exit message.\n");
+  }
+  return Object::null();
+}
+
+
+DEFINE_NATIVE_ENTRY(VMService_ListenStream, 1) {
+  GET_NON_NULL_NATIVE_ARGUMENT(String, stream_id, arguments->NativeArgAt(0));
+  bool result = Service::ListenStream(stream_id.ToCString());
+  return Bool::Get(result).raw();
+}
+
+
+DEFINE_NATIVE_ENTRY(VMService_CancelStream, 1) {
+  GET_NON_NULL_NATIVE_ARGUMENT(String, stream_id, arguments->NativeArgAt(0));
+  Service::CancelStream(stream_id.ToCString());
+  return Object::null();
+}
+
+}  // namespace dart
diff --git a/runtime/lib/vmservice_patch.dart b/runtime/lib/vmservice_patch.dart
new file mode 100644
index 0000000..e9b4da7
--- /dev/null
+++ b/runtime/lib/vmservice_patch.dart
@@ -0,0 +1,12 @@
+// 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 bool sendIsolateServiceMessage(SendPort sp, List m)
+    native "VMService_SendIsolateServiceMessage";
+patch void sendRootServiceMessage(List m)
+    native "VMService_SendRootServiceMessage";
+patch void _onStart() native "VMService_OnStart";
+patch void _onExit() native "VMService_OnExit";
+patch bool _vmListenStream(String streamId) native "VMService_ListenStream";
+patch void _vmCancelStream(String streamId) native "VMService_CancelStream";
diff --git a/runtime/lib/vmservice_sources.gypi b/runtime/lib/vmservice_sources.gypi
new file mode 100644
index 0000000..6eeb759
--- /dev/null
+++ b/runtime/lib/vmservice_sources.gypi
@@ -0,0 +1,13 @@
+# 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.
+
+# Sources that patch the library "dart:_vmservice".
+
+{
+  'sources': [
+    'vmservice_patch.dart',
+    # The above file needs to be first as it imports required libraries.
+    'vmservice.cc',
+  ],
+}
diff --git a/runtime/observatory/.analysis_options b/runtime/observatory/.analysis_options
new file mode 100644
index 0000000..fd7cfbf
--- /dev/null
+++ b/runtime/observatory/.analysis_options
@@ -0,0 +1,9 @@
+analyzer:
+  exclude:
+# Remove once Dart 1.13-dev is released
+    - tests/service/developer_extension_test.dart
+# Remove once Dart 1.13-dev is released
+    - tests/service/logging_test.dart
+    - tests/ui/log.dart
+# Remove once Dart 1.13-dev is released
+    - tests/service/get_stack_rpc_test.dart
diff --git a/runtime/observatory/lib/app.dart b/runtime/observatory/lib/app.dart
index 9bb2df8..a0e52bb 100644
--- a/runtime/observatory/lib/app.dart
+++ b/runtime/observatory/lib/app.dart
@@ -7,7 +7,6 @@
 import 'dart:async';
 import 'dart:convert';
 import 'dart:html';
-import 'dart:js';
 
 import 'package:logging/logging.dart';
 import 'package:observatory/service_html.dart';
@@ -20,7 +19,6 @@
 export 'package:observatory/utils.dart';
 
 part 'src/app/application.dart';
-part 'src/app/chart.dart';
 part 'src/app/location_manager.dart';
 part 'src/app/page.dart';
 part 'src/app/settings.dart';
diff --git a/runtime/observatory/lib/elements.dart b/runtime/observatory/lib/elements.dart
index bcaf0ab..51309f5 100644
--- a/runtime/observatory/lib/elements.dart
+++ b/runtime/observatory/lib/elements.dart
@@ -37,6 +37,7 @@
 export 'package:observatory/src/elements/library_ref.dart';
 export 'package:observatory/src/elements/library_view.dart';
 export 'package:observatory/src/elements/logging.dart';
+export 'package:observatory/src/elements/megamorphiccache_view.dart';
 export 'package:observatory/src/elements/metrics.dart';
 export 'package:observatory/src/elements/nav_bar.dart';
 export 'package:observatory/src/elements/object_common.dart';
diff --git a/runtime/observatory/lib/elements.html b/runtime/observatory/lib/elements.html
index 9888697..87376f0 100644
--- a/runtime/observatory/lib/elements.html
+++ b/runtime/observatory/lib/elements.html
@@ -30,6 +30,7 @@
 <link rel="import" href="src/elements/library_ref.html">
 <link rel="import" href="src/elements/library_view.html">
 <link rel="import" href="src/elements/logging.html">
+<link rel="import" href="src/elements/megamorphiccache_view.html">
 <link rel="import" href="src/elements/metrics.html">
 <link rel="import" href="src/elements/nav_bar.html">
 <link rel="import" href="src/elements/object_common.html">
diff --git a/runtime/observatory/lib/object_graph.dart b/runtime/observatory/lib/object_graph.dart
index ddbfdc2..2a5e2b7 100644
--- a/runtime/observatory/lib/object_graph.dart
+++ b/runtime/observatory/lib/object_graph.dart
@@ -682,6 +682,8 @@
       }
     }
 
+    Logger.root.info("Start remap dominators");
+
     // Reindex doms by id instead of post order index so we can throw away
     // the post order arrays.
     var domById = new Uint32List(N + 1);
@@ -689,6 +691,8 @@
       domById[id] = postOrder[domByPOI[postOrderIndex[id]]];
     }
 
+    Logger.root.info("End remap dominators");
+
     domById[root] = 0;
 
     _doms = domById;
diff --git a/runtime/observatory/lib/service_common.dart b/runtime/observatory/lib/service_common.dart
index 0faa080..ba55349 100644
--- a/runtime/observatory/lib/service_common.dart
+++ b/runtime/observatory/lib/service_common.dart
@@ -88,7 +88,7 @@
   int _requestSerial = 0;
   bool _hasInitiatedConnect = false;
   bool _hasFinishedConnect = false;
-  Utf8Decoder _utf8Decoder = new Utf8Decoder();
+  Utf8Decoder _utf8Decoder = const Utf8Decoder();
 
   CommonWebSocket _webSocket;
 
@@ -209,7 +209,7 @@
       }
       var event = map['params']['event'];
       var streamId = map['params']['streamId'];
-      postServiceEvent(streamId, event, data);
+      scheduleMicrotask(() { postServiceEvent(streamId, event, data); });
     });
   }
 
@@ -222,7 +222,7 @@
     if (map['method'] == 'streamNotify') {
       var event = map['params']['event'];
       var streamId = map['params']['streamId'];
-      postServiceEvent(streamId, event, null);
+      scheduleMicrotask(() { postServiceEvent(streamId, event, null); });
       return;
     }
 
diff --git a/runtime/observatory/lib/src/app/analytics.dart b/runtime/observatory/lib/src/app/analytics.dart
index cb6a91f..8f09f61 100644
--- a/runtime/observatory/lib/src/app/analytics.dart
+++ b/runtime/observatory/lib/src/app/analytics.dart
@@ -7,7 +7,7 @@
 class Analytics {
   static final _UA = 'UA-26406144-17';
   static final _name = 'Observatory';
-  static final _version = '1.11';
+  static final _version = const String.fromEnvironment('OBS_VER');
   static final _googleAnalytics = new AnalyticsHtml(_UA, _name, _version);
 
   static initialize() {
diff --git a/runtime/observatory/lib/src/app/application.dart b/runtime/observatory/lib/src/app/application.dart
index ff45043..c4050e5 100644
--- a/runtime/observatory/lib/src/app/application.dart
+++ b/runtime/observatory/lib/src/app/application.dart
@@ -88,7 +88,9 @@
 
   void _onEvent(ServiceEvent event) {
     switch(event.kind) {
+      case ServiceEvent.kVMUpdate:
       case ServiceEvent.kIsolateStart:
+      case ServiceEvent.kIsolateRunnable:
       case ServiceEvent.kIsolateUpdate:
       case ServiceEvent.kBreakpointAdded:
       case ServiceEvent.kBreakpointResolved:
@@ -222,6 +224,13 @@
   }
 
   void handleException(e, st) {
+    if (e is ServerRpcException) {
+      if (e.code == ServerRpcException.kFeatureDisabled) return;
+      if (e.code == ServerRpcException.kVMMustBePaused) return;
+      if (e.code == ServerRpcException.kCannotAddBreakpoint) return;
+      Logger.root.fine('Dropping exception: ${e}\n${st}');
+    }
+
     // TODO(turnidge): Report this failure via analytics.
     Logger.root.warning('Caught exception: ${e}\n${st}');
     notifications.add(new Notification.fromException(e, st));
diff --git a/runtime/observatory/lib/src/app/chart.dart b/runtime/observatory/lib/src/app/chart.dart
deleted file mode 100644
index c2d10b4..0000000
--- a/runtime/observatory/lib/src/app/chart.dart
+++ /dev/null
@@ -1,128 +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.
-
-part of app;
-
-class GoogleChart {
-  static var _api;
-
-  /// Get access to the JsObject containing the Google Chart API:
-  /// https://developers.google.com/chart/interactive/docs/reference
-  static get api {
-    return _api;
-  }
-
-  static Completer _completer = new Completer();
-
-  static Future get onReady => _completer.future;
-
-  static bool get ready => _completer.isCompleted;
-
-  /// Load the Google Chart API. Returns a [Future] which completes
-  /// when the API is loaded.
-  static Future initOnce() {
-    Logger.root.info('Loading Google Charts API');
-    context['google'].callMethod('load',
-        ['visualization', '1', new JsObject.jsify({
-          'packages': ['corechart', 'table'],
-          'callback': new JsFunction.withThis(_completer.complete)
-    })]);
-    return _completer.future.then(_initOnceOnComplete);
-  }
-
-  static _initOnceOnComplete(_) {
-    Logger.root.info('Google Charts API loaded');
-    _api = context['google']['visualization'];
-    assert(_api != null);
-    return _api;
-  }
-}
-
-class DataTable {
-  final _table = new JsObject(GoogleChart.api['DataTable']);
-  /// Construct a Google Chart DataTable.
-  DataTable();
-
-  /// Number of columns.
-  int get columns => _table.callMethod('getNumberOfColumns');
-  /// Number of rows.
-  int get rows => _table.callMethod('getNumberOfRows');
-
-  /// Add a new column with [type] and [label].
-  /// type must be: 'string', 'number', or 'boolean'.
-  void addColumn(String type, String label) {
-    _table.callMethod('addColumn', [type, label]);
-  }
-
-  /// Add a new column with [type], [label] and [role].
-  /// Roles are used for metadata such as 'interval', 'annotation', or 'domain'.
-  /// type must be: 'string', 'number', or 'boolean'.
-  void addRoleColumn(String type, String label, String role) {
-    _table.callMethod('addColumn', [new JsObject.jsify({
-      'type': type,
-      'label': label,
-      'role': role,
-    })]);
-  }
-
-  /// Remove [count] columns starting with [start].
-  void removeColumns(int start, int count) {
-    _table.callMethod('removeColumns', [start, count]);
-  }
-
-  /// Remove all columns in the table.
-  void clearColumns() {
-    removeColumns(0, columns);
-  }
-
-  /// Remove [count] rows starting with [start].
-  void removeRows(int start, int count) {
-    _table.callMethod('removeRows', [start, count]);
-  }
-
-  /// Remove all rows in the table.
-  void clearRows() {
-    removeRows(0, rows);
-  }
-
-  /// Adds a new row to the table. [row] must have an entry for each
-  /// column in the table.
-  void addRow(List row) {
-    _table.callMethod('addRow', [new JsArray.from(row)]);
-  }
-
-  void addTimeOfDayValue(DateTime dt, value) {
-    var array = new JsArray.from([dt.hour, dt.minute, dt.second]);
-    addRow([array, value]);
-  }
-}
-
-class Chart {
-  var _chart;
-  final Map options = new Map();
-
-  /// Create a Google Chart of [chartType]. e.g. 'Table', 'AreaChart',
-  /// 'BarChart', the chart is rendered inside [element].
-  Chart(String chartType, Element element) {
-    _chart = new JsObject(GoogleChart.api[chartType], [element]);
-  }
-
-  /// When the user interacts with the table by clicking on columns,
-  /// you must call this function before [draw] so that we draw
-  /// with the current sort settings.
-  void refreshOptionsSortInfo() {
-    var props = _chart.callMethod('getSortInfo');
-    if ((props != null) && (props['column'] != -1)) {
-      // Preserve current sort settings.
-      options['sortColumn'] = props['column'];
-      options['sortAscending'] = props['ascending'];
-    }
-  }
-
-  /// Draw this chart using [table] and the current [options].
-  void draw(DataTable table) {
-    var jsOptions = new JsObject.jsify(options);
-    _chart.callMethod('draw', [table._table, jsOptions]);
-  }
-}
diff --git a/runtime/observatory/lib/src/app/view_model.dart b/runtime/observatory/lib/src/app/view_model.dart
index 659091b..072b156 100644
--- a/runtime/observatory/lib/src/app/view_model.dart
+++ b/runtime/observatory/lib/src/app/view_model.dart
@@ -68,7 +68,7 @@
 
   HtmlElement _makeExpander() {
     var expander = new SpanElement();
-    expander.style.minWidth = '1.5em';
+    expander.style.minWidth = '2em';
     listeners.add(expander.onClick.listen(onClick));
     return expander;
   }
diff --git a/runtime/observatory/lib/src/debugger/debugger_location.dart b/runtime/observatory/lib/src/debugger/debugger_location.dart
index 469609b..31facf2 100644
--- a/runtime/observatory/lib/src/debugger/debugger_location.dart
+++ b/runtime/observatory/lib/src/debugger/debugger_location.dart
@@ -42,23 +42,29 @@
         "Invalid source location '${locDesc}'"));
   }
 
-  static Future<DebuggerLocation> _currentLocation(Debugger debugger) {
+  static Future<Frame> _currentFrame(Debugger debugger) async {
     ServiceMap stack = debugger.stack;
     if (stack == null || stack['frames'].length == 0) {
-      return new Future.value(new DebuggerLocation.error(
-          'A script must be provided when the stack is empty'));
+      return null;
     }
-    var frame = stack['frames'][debugger.currentFrame];
+    return stack['frames'][debugger.currentFrame];
+  }
+
+  static Future<DebuggerLocation> _currentLocation(Debugger debugger) async {
+    var frame = await _currentFrame(debugger);
+    if (frame == null) {
+      return new DebuggerLocation.error(
+          'A script must be provided when the stack is empty');
+    }
     Script script = frame.location.script;
-    return script.load().then((_) {
-      var line = script.tokenToLine(frame.location.tokenPos);
-      // TODO(turnidge): Pass in the column here once the protocol supports it.
-      return new Future.value(new DebuggerLocation.file(script, line, null));
-    });
+    await script.load();
+    var line = script.tokenToLine(frame.location.tokenPos);
+    var col = script.tokenToCol(frame.location.tokenPos);
+    return new DebuggerLocation.file(script, line, col);
   }
 
   static Future<DebuggerLocation> _parseScriptLine(Debugger debugger,
-                                                   Match match) {
+                                                   Match match) async {
     var scriptName = match.group(1);
     if (scriptName != null) {
       scriptName = scriptName.substring(0, scriptName.length - 1);
@@ -84,25 +90,25 @@
 
     if (scriptName != null) {
       // Resolve the script.
-      return _lookupScript(debugger.isolate, scriptName).then((scripts) {
-        if (scripts.length == 0) {
-          return new DebuggerLocation.error("Script '${scriptName}' not found");
-        } else if (scripts.length == 1) {
-          return new DebuggerLocation.file(scripts[0], line, col);
-        } else {
-          // TODO(turnidge): Allow the user to disambiguate.
-          return new DebuggerLocation.error("Script '${scriptName}' is ambigous");
-        }
-      });
+      var scripts = await _lookupScript(debugger.isolate, scriptName);
+      if (scripts.length == 0) {
+        return new DebuggerLocation.error("Script '${scriptName}' not found");
+      } else if (scripts.length == 1) {
+        return new DebuggerLocation.file(scripts[0], line, col);
+      } else {
+        // TODO(turnidge): Allow the user to disambiguate.
+        return new DebuggerLocation.error("Script '${scriptName}' is ambigous");
+      }
     } else {
       // No script provided.  Default to top of stack for now.
-      ServiceMap stack = debugger.stack;
-      if (stack == null || stack['frames'].length == 0) {
+      var frame = await _currentFrame(debugger);
+      if (frame == null) {
         return new Future.value(new DebuggerLocation.error(
             'A script must be provided when the stack is empty'));
       }
-      Script script = stack['frames'][0].location.script;
-      return new Future.value(new DebuggerLocation.file(script, line, col));
+      Script script = frame.location.script;
+      await script.load();
+      return new DebuggerLocation.file(script, line, col);
     }
   }
 
@@ -157,7 +163,10 @@
 
   static Future<List<Class>> _lookupClass(Isolate isolate,
                                           String name,
-                                          { bool allowPrefix: false }) {
+                                          { bool allowPrefix: false }) async {
+    if (isolate == null) {
+      return [];
+    }
     var pending = [];
     for (var lib in isolate.libraries) {
       assert(lib.loaded);
@@ -167,23 +176,22 @@
         }
       }
     }
-    return Future.wait(pending).then((_) {
-      var matches = [];
-      for (var lib in isolate.libraries) {
-        for (var cls in lib.classes) {
-          if (allowPrefix) {
-            if (cls.name.startsWith(name)) {
-              matches.add(cls);
-            }
-          } else {
-            if (name == cls.name) {
-              matches.add(cls);
-            }
+    await Future.wait(pending);
+    var matches = [];
+    for (var lib in isolate.libraries) {
+      for (var cls in lib.classes) {
+        if (allowPrefix) {
+          if (cls.name.startsWith(name)) {
+            matches.add(cls);
+          }
+        } else {
+          if (name == cls.name) {
+            matches.add(cls);
           }
         }
       }
-      return matches;
-    });
+    }
+    return matches;
   }
 
   static ServiceFunction _getConstructor(Class cls, String name) {
@@ -252,7 +260,7 @@
   }
 
   static RegExp partialSourceLocMatcher =
-      new RegExp(r'^([^\d:]?[^:]+[:]?)?(\d+)?([:]\d+)?');
+      new RegExp(r'^([^\d:]?[^:]+[:]?)?(\d+)?([:]\d*)?');
   static RegExp partialFunctionMatcher = new RegExp(r'^([^.]*)([.][^.]*)?');
 
   /// Completes a partial source location description.
@@ -323,25 +331,105 @@
     }
   }
 
-  static Future<List<String>> _completeFile(Debugger debugger, Match match) {
-    var scriptName = match.group(1);
-    var lineStr = match.group(2);
-    var colStr = match.group(3);
-    if (lineStr != null || colStr != null) {
-      // TODO(turnidge): Complete valid line and column numbers.
-      return new Future.value([]);
-    }
-    scriptName = (scriptName == null ? '' : scriptName);
+  static bool _startsWithDigit(String s) {
+    return '0'.compareTo(s[0]) <= 0 && '9'.compareTo(s[0]) >= 0;
+  }
 
-    return _lookupScript(debugger.isolate, scriptName, allowPrefix:true)
-      .then((scripts) {
+  static Future<List<String>> _completeFile(
+      Debugger debugger, Match match) async {
+    var scriptName;
+    var scriptNameComplete = false;
+    var lineStr;
+    var lineStrComplete = false;
+    var colStr;
+    if (_startsWithDigit(match.group(1))) {
+      // CASE 1: We have matched a prefix of (lineStr:)(colStr)
+      var frame = await _currentFrame(debugger);
+      if (frame == null) {
+        return [];
+      }
+      scriptName = frame.location.script.name;
+      scriptNameComplete = true;
+      lineStr = match.group(1);
+      lineStr = (lineStr == null ? '' : lineStr);
+      if (lineStr.endsWith(':')) {
+        lineStr = lineStr.substring(0, lineStr.length - 1);
+        lineStrComplete = true;
+      }
+      colStr = match.group(2);
+      colStr = (colStr == null ? '' : colStr);
+    } else {
+      // CASE 2: We have matched a prefix of (scriptName:)(lineStr)(:colStr)
+      scriptName = match.group(1);
+      scriptName = (scriptName == null ? '' : scriptName);
+      if (scriptName.endsWith(':')) {
+        scriptName = scriptName.substring(0, scriptName.length - 1);
+        scriptNameComplete = true;
+      }
+      lineStr = match.group(2);
+      lineStr = (lineStr == null ? '' : lineStr);
+      colStr = match.group(3);
+      colStr = (colStr == null ? '' : colStr);
+      if (colStr.startsWith(':')) {
+        lineStrComplete = true;
+        colStr = colStr.substring(1);
+      }
+    }
+
+    if (!scriptNameComplete) {
+      // The script name is incomplete.  Complete it.
+      var scripts =
+          await _lookupScript(debugger.isolate, scriptName, allowPrefix:true);
+      List completions = [];
+      for (var script in scripts) {
+        completions.add(script.name + ':');
+      }
+      completions.sort();
+      return completions;
+
+    } else {
+      // The script name is complete.  Look it up.
+      var scripts =
+          await _lookupScript(debugger.isolate, scriptName, allowPrefix:false);
+      if (scripts.isEmpty) {
+        return [];
+      }
+      var script = scripts[0];
+      await script.load();
+      if (!lineStrComplete) {
+        // Complete the line.
+        var sharedPrefix = '${script.name}:';
         List completions = [];
-        for (var script in scripts) {
-          completions.add(script.name + ':');
+        for (var line in script.lines) {
+          if (line.possibleBpt) {
+            var currentLineStr = line.line.toString();
+            if (currentLineStr.startsWith(lineStr)) {
+              completions.add('${sharedPrefix}${currentLineStr} ');
+              completions.add('${sharedPrefix}${currentLineStr}:');
+            }
+          }
         }
-        completions.sort();
         return completions;
-      });
+
+      } else {
+        // Complete the column.
+        int lineNum = int.parse(lineStr);
+        var scriptLine = script.getLine(lineNum);
+        if (!scriptLine.possibleBpt) {
+          return [];
+        }
+        var sharedPrefix = '${script.name}:${lineStr}:';
+        List completions = [];
+        int maxCol = scriptLine.text.trimRight().runes.length;
+        for (int i = 1; i <= maxCol; i++) {
+          var currentColStr = i.toString();
+          if (currentColStr.startsWith(colStr)) {
+            completions.add('${sharedPrefix}${currentColStr} ');
+          }
+        }
+        return completions;
+      }
+    }
   }
 
   String toString() {
diff --git a/runtime/observatory/lib/src/elements/class_tree.html b/runtime/observatory/lib/src/elements/class_tree.html
index 5217e61..7f40600 100644
--- a/runtime/observatory/lib/src/elements/class_tree.html
+++ b/runtime/observatory/lib/src/elements/class_tree.html
@@ -11,7 +11,7 @@
         border-spacing: 0px;
         width: 100%;
         margin-bottom: 20px
-      vertical-align: middle;
+        vertical-align: middle;
       }
 
       tr {
@@ -21,6 +21,10 @@
       tr:hover {
         background-color: #FAFAFA;
       }
+
+      th {
+        text-align: left;
+      }
     </style>
     <nav-bar>
       <top-nav-menu last="{{ true }}"></top-nav-menu>
diff --git a/runtime/observatory/lib/src/elements/class_view.html b/runtime/observatory/lib/src/elements/class_view.html
index a8f8165..5dadba6 100644
--- a/runtime/observatory/lib/src/elements/class_view.html
+++ b/runtime/observatory/lib/src/elements/class_view.html
@@ -38,6 +38,10 @@
         </template>
         class {{ cls.name }}
       </h1>
+
+      <object-common object="{{ cls }}"></object-common>
+      <br>
+
       <div class="memberList">
         <div class="memberItem">
           <div class="memberName">library</div>
diff --git a/runtime/observatory/lib/src/elements/context_view.html b/runtime/observatory/lib/src/elements/context_view.html
index efffcb1..44972f3 100644
--- a/runtime/observatory/lib/src/elements/context_view.html
+++ b/runtime/observatory/lib/src/elements/context_view.html
@@ -27,10 +27,9 @@
         <h1>instance of Context</h1>
 
         <object-common object="{{ context }}"></object-common>
+        <br>
 
         <div class="memberList">
-          <div class="memberItem">&nbsp;</div>
-
           <template if="{{ context.parentContext != null }}">
             <div class="memberItem">
               <div class="memberName">parent context</div>
diff --git a/runtime/observatory/lib/src/elements/debugger.dart b/runtime/observatory/lib/src/elements/debugger.dart
index ede4571..4310075 100644
--- a/runtime/observatory/lib/src/elements/debugger.dart
+++ b/runtime/observatory/lib/src/elements/debugger.dart
@@ -6,6 +6,7 @@
 
 import 'dart:async';
 import 'dart:html';
+import 'dart:math';
 import 'observatory_element.dart';
 import 'package:observatory/app.dart';
 import 'package:observatory/cli.dart';
@@ -317,11 +318,13 @@
       '        c\n';
 }
 
-class NextCommand extends DebuggerCommand {
-  NextCommand(Debugger debugger) : super(debugger, 'next', []);
+class SmartNextCommand extends DebuggerCommand {
+  SmartNextCommand(Debugger debugger) : super(debugger, 'next', []) {
+    alias = 'n';
+  }
 
-  Future run(List<String> args) {
-    return debugger.next();
+  Future run(List<String> args) async {
+    return debugger.smartNext();
   }
 
   String helpShort =
@@ -337,6 +340,40 @@
       'Syntax: next\n';
 }
 
+class SyncNextCommand extends DebuggerCommand {
+  SyncNextCommand(Debugger debugger) : super(debugger, 'next-sync', []);
+
+  Future run(List<String> args) {
+    return debugger.syncNext();
+  }
+
+  String helpShort =
+      'Run until return/unwind to current activation.';
+
+  String helpLong =
+      'Continue running the isolate until control returns to the current '
+      'activation or one of its callers.\n'
+      '\n'
+      'Syntax: next-sync\n';
+}
+
+class AsyncNextCommand extends DebuggerCommand {
+  AsyncNextCommand(Debugger debugger) : super(debugger, 'next-async', []);
+
+  Future run(List<String> args) {
+    return debugger.asyncNext();
+  }
+
+  String helpShort =
+      'Step over await or yield';
+
+  String helpLong =
+      'Continue running the isolate until control returns to the current '
+      'activation of an async or async* function.\n'
+      '\n'
+      'Syntax: next-async\n';
+}
+
 class StepCommand extends DebuggerCommand {
   StepCommand(Debugger debugger) : super(debugger, 'step', []) {
     alias = 's';
@@ -445,33 +482,6 @@
       '# Display all log messages.\n';
 }
 
-class AsyncNextCommand extends DebuggerCommand {
-  AsyncNextCommand(Debugger debugger) : super(debugger, 'anext', []) {
-  }
-
-  Future run(List<String> args) async {
-    if (debugger.isolatePaused()) {
-      var event = debugger.isolate.pauseEvent;
-      if (event.asyncContinuation == null) {
-        debugger.console.print("No async continuation at this location");
-      } else {
-        return debugger.isolate.asyncStepOver()[Isolate.kFirstResume];
-      }
-    } else {
-      debugger.console.print('The program is already running');
-    }
-  }
-
-  String helpShort =
-      'Step over await or yield';
-
-  String helpLong =
-      'Continue running the isolate until control returns to the current '
-      'activation of an async or async* function.\n'
-      '\n'
-      'Syntax: anext\n';
-}
-
 class FinishCommand extends DebuggerCommand {
   FinishCommand(Debugger debugger) : super(debugger, 'finish', []);
 
@@ -507,7 +517,7 @@
   SetCommand(Debugger debugger)
       : super(debugger, 'set', []);
 
-  static var _boeValues = ['all', 'none', 'unhandled'];
+  static var _boeValues = ['All', 'None', 'Unhandled'];
   static var _boolValues = ['false', 'true'];
 
   static var _options = {
@@ -520,7 +530,7 @@
   };
 
   static Future _setBreakOnException(debugger, name, value) async {
-    var result = await debugger.isolate.setExceptionPauseInfo(value);
+    var result = await debugger.isolate.setExceptionPauseMode(value);
     if (result.isError) {
       debugger.console.print(result.toString());
     } else {
@@ -612,7 +622,7 @@
       'Set a debugger option.\n'
       '\n'
       'Known options:\n'
-      '  break-on-exceptions   # Should the debugger break on exceptions?\n'
+      '  break-on-exception    # Should the debugger break on exceptions?\n'
       "                        # ${_boeValues}\n"
       '  up-is-down            # Reverse meaning of up/down commands?\n'
       "                        # ${_boolValues}\n"
@@ -628,7 +638,7 @@
   Future run(List<String> args) async {
     if (args.length > 1) {
       debugger.console.print('not implemented');
-      return new Future.value(null);
+      return;
     }
     var arg = (args.length == 0 ? '' : args[0]);
     var loc = await DebuggerLocation.parse(debugger, arg);
@@ -645,14 +655,15 @@
         }
       } else {
         assert(loc.script != null);
-        if (loc.col != null) {
-          // TODO(turnidge): Add tokenPos breakpoint support.
+        var script = loc.script;
+        await script.load();
+        if (loc.line < 1 || loc.line > script.lines.length) {
           debugger.console.print(
-              'Ignoring column: '
-              'adding breakpoint at a specific column not yet implemented');
-          }
+              'line number must be in range [1,${script.lines.length}]');
+          return;
+        }
         try {
-          await debugger.isolate.addBreakpoint(loc.script, loc.line);
+          await debugger.isolate.addBreakpoint(script, loc.line, loc.col);
         } on ServerRpcException catch(e) {
           if (e.code == ServerRpcException.kCannotAddBreakpoint) {
             debugger.console.print('Unable to set breakpoint at ${loc}');
@@ -709,48 +720,50 @@
 class ClearCommand extends DebuggerCommand {
   ClearCommand(Debugger debugger) : super(debugger, 'clear', []);
 
-  Future run(List<String> args) {
+  Future run(List<String> args) async {
     if (args.length > 1) {
       debugger.console.print('not implemented');
-      return new Future.value(null);
+      return;
     }
     var arg = (args.length == 0 ? '' : args[0]);
-    return DebuggerLocation.parse(debugger, arg).then((loc) {
-      if (loc.valid) {
-        if (loc.function != null) {
-          debugger.console.print(
-              'Ignoring breakpoint at $loc: '
-              'Function entry breakpoints not yet implemented');
-          return null;
-        }
-        if (loc.col != null) {
-          // TODO(turnidge): Add tokenPos clear support.
-          debugger.console.print(
-              'Ignoring column: '
-              'clearing breakpoint at a specific column not yet implemented');
-        }
+    var loc = await DebuggerLocation.parse(debugger, arg);
+    if (!loc.valid) {
+      debugger.console.print(loc.errorMessage);
+      return;
+    }
+    if (loc.function != null) {
+      debugger.console.print(
+          'Ignoring breakpoint at $loc: '
+          'Clearing function breakpoints not yet implemented');
+      return;
+    }
 
-        for (var bpt in debugger.isolate.breakpoints.values) {
-          var script = bpt.location.script;
-          if (script.id == loc.script.id) {
-            assert(script.loaded);
-            var line = script.tokenToLine(bpt.location.tokenPos);
-            if (line == loc.line) {
-              return debugger.isolate.removeBreakpoint(bpt).then((result) {
-                if (result is DartError) {
-                  debugger.console.print(
-                      'Unable to clear breakpoint at ${loc}: ${result.message}');
-                  return;
-                }
-              });
-            }
+    var script = loc.script;
+    if (loc.line < 1 || loc.line > script.lines.length) {
+      debugger.console.print(
+          'line number must be in range [1,${script.lines.length}]');
+      return;
+    }
+    var lineInfo = script.getLine(loc.line);
+    var bpts = lineInfo.breakpoints;
+    var foundBreakpoint = false;
+    if (bpts != null) {
+      var bptList = bpts.toList();
+      for (var bpt in bptList) {
+        if (loc.col == null ||
+            loc.col == script.tokenToCol(bpt.location.tokenPos)) {
+          foundBreakpoint = true;
+          var result = await debugger.isolate.removeBreakpoint(bpt);
+          if (result is DartError) {
+            debugger.console.print(
+                'Error clearing breakpoint ${bpt.number}: ${result.message}');
           }
         }
-        debugger.console.print('No breakpoint found at ${loc}');
-      } else {
-        debugger.console.print(loc.errorMessage);
       }
-    });
+    }
+    if (!foundBreakpoint) {
+      debugger.console.print('No breakpoint found at ${loc}');
+    }
   }
 
   Future<List<String>> complete(List<String> args) {
@@ -837,7 +850,7 @@
   InfoBreakpointsCommand(Debugger debugger)
       : super(debugger, 'breakpoints', []);
 
-  Future run(List<String> args) {
+  Future run(List<String> args) async {
     if (debugger.isolate.breakpoints.isEmpty) {
       debugger.console.print('No breakpoints');
     }
@@ -845,19 +858,15 @@
     bpts.sort((a, b) => a.number - b.number);
     for (var bpt in bpts) {
       var bpId = bpt.number;
-      var script = bpt.location.script;
-      var tokenPos = bpt.location.tokenPos;
-      var line = script.tokenToLine(tokenPos);
-      var col = script.tokenToCol(tokenPos);
+      var locString = await bpt.location.toUserString();
       if (!bpt.resolved) {
         debugger.console.print(
-            'Future breakpoint ${bpId} at ${script.name}:${line}:${col}');
+            'Future breakpoint ${bpId} at ${locString}');
       } else {
         debugger.console.print(
-            'Breakpoint ${bpId} at ${script.name}:${line}:${col}');
+            'Breakpoint ${bpId} at ${locString}');
       }
     }
-    return new Future.value(null);
   }
 
   String helpShort = 'List all breakpoints';
@@ -937,7 +946,7 @@
   Future<List<String>> complete(List<String> args) {
     if (args.length != 1) {
       return new Future.value([args.join('')]);
-    } 
+    }
     var result = [];
     for (var isolate in debugger.vm.isolates) {
       var str = isolate.number.toString();
@@ -955,27 +964,62 @@
   String helpShort = 'Switch the current isolate';
 
   String helpLong =
-      'Switch the current isolate.\n'
+      'Switch, list, or rename isolates.\n'
       '\n'
       'Syntax: isolate <number>\n'
       '        isolate <name>\n';
 }
 
+String _isolateRunState(Isolate isolate) {
+  if (isolate.paused) {
+    return 'paused';
+  } else if (isolate.running) {
+    return 'running';
+  } else if (isolate.idle) {
+    return 'idle';
+  } else {
+    return 'unknown';
+  }
+}
+
 class IsolateListCommand extends DebuggerCommand {
   IsolateListCommand(Debugger debugger) : super(debugger, 'list', []);
 
-  Future run(List<String> args) {
+  Future run(List<String> args) async {
     if (debugger.vm == null) {
       debugger.console.print(
           "Internal error: vm has not been set");
-      return new Future.value(null);
+      return;
     }
+
+    // Refresh all isolates first.
+    var pending = [];
     for (var isolate in debugger.vm.isolates) {
-      String current = (isolate == debugger.isolate ? ' *' : '');
-      debugger.console.print(
-          "Isolate ${isolate.number} '${isolate.name}'${current}");
+      pending.add(isolate.reload());
     }
-    return new Future.value(null);
+    await Future.wait(pending);
+
+    const maxIdLen = 10;
+    const maxRunStateLen = 7;
+    var maxNameLen = 'NAME'.length;
+    for (var isolate in debugger.vm.isolates) {
+      maxNameLen = max(maxNameLen, isolate.name.length);
+    }
+    debugger.console.print("${'ID'.padLeft(maxIdLen, ' ')} "
+                           "${'ORIGIN'.padLeft(maxIdLen, ' ')} "
+                           "${'NAME'.padRight(maxNameLen, ' ')} "
+                           "${'STATE'.padRight(maxRunStateLen, ' ')} "
+                           "CURRENT");
+    for (var isolate in debugger.vm.isolates) {
+      String current = (isolate == debugger.isolate ? '*' : '');
+      debugger.console.print(
+          "${isolate.number.toString().padLeft(maxIdLen, ' ')} "
+          "${isolate.originNumber.toString().padLeft(maxIdLen, ' ')} "
+          "${isolate.name.padRight(maxNameLen, ' ')} "
+          "${_isolateRunState(isolate).padRight(maxRunStateLen, ' ')} "
+          "${current}");
+    }
+    debugger.console.newline();
   }
 
   String helpShort = 'List all isolates';
@@ -1079,6 +1123,119 @@
       'Syntax: refresh <subcommand>\n';
 }
 
+class VmListCommand extends DebuggerCommand {
+  VmListCommand(Debugger debugger) : super(debugger, 'list', []);
+
+  Future run(List<String> args) async {
+    if (args.length > 0) {
+      debugger.console.print('vm list expects no arguments');
+      return;
+    }
+    if (debugger.vm == null) {
+      debugger.console.print("No connected VMs");
+      return;
+    }
+    // TODO(turnidge): Right now there is only one vm listed.
+    var vmList = [debugger.vm];
+
+    var maxAddrLen = 'ADDRESS'.length;
+    var maxNameLen = 'NAME'.length;
+
+    for (var vm in vmList) {
+      maxAddrLen = max(maxAddrLen, vm.target.networkAddress.length);
+      maxNameLen = max(maxNameLen, vm.name.length);
+    }
+
+    debugger.console.print("${'ADDRESS'.padRight(maxAddrLen, ' ')} "
+                           "${'NAME'.padRight(maxNameLen, ' ')} "
+                           "CURRENT");
+    for (var vm in vmList) {
+      String current = (vm == debugger.vm ? '*' : '');
+      debugger.console.print(
+          "${vm.target.networkAddress.padRight(maxAddrLen, ' ')} "
+          "${vm.name.padRight(maxNameLen, ' ')} "
+          "${current}");
+    }
+  }
+
+  String helpShort = 'List all connected Dart virtual machines';
+
+  String helpLong =
+      'List all connected Dart virtual machines..\n'
+      '\n'
+      'Syntax: vm list\n';
+}
+
+class VmNameCommand extends DebuggerCommand {
+  VmNameCommand(Debugger debugger) : super(debugger, 'name', []);
+
+  Future run(List<String> args) async {
+    if (args.length != 1) {
+      debugger.console.print('vm name expects one argument');
+      return;
+    }
+    if (debugger.vm == null) {
+      debugger.console.print('There is no current vm');
+      return;
+    }
+    await debugger.vm.setName(args[0]);
+  }
+
+  String helpShort = 'Rename the current Dart virtual machine';
+
+  String helpLong =
+      'Rename the current Dart virtual machine.\n'
+      '\n'
+      'Syntax: vm name <name>\n';
+}
+
+class VmRestartCommand extends DebuggerCommand {
+  VmRestartCommand(Debugger debugger) : super(debugger, 'restart', []);
+
+  Future handleModalInput(String line) async {
+    if (line == 'yes') {
+      debugger.console.printRed('Restarting VM...');
+      await debugger.vm.restart();
+      debugger.input.exitMode();
+    } else if (line == 'no') {
+      debugger.console.printRed('VM restart canceled.');
+      debugger.input.exitMode();
+    } else {
+      debugger.console.printRed("Please type 'yes' or 'no'");
+    }
+  }
+
+  Future run(List<String> args) async {
+    debugger.input.enterMode('Restart vm? (yes/no)', handleModalInput);
+  }
+
+  String helpShort = 'Restart a Dart virtual machine';
+
+  String helpLong =
+      'Restart a Dart virtual machine.\n'
+      '\n'
+      'Syntax: vm restart\n';
+}
+
+class VmCommand extends DebuggerCommand {
+  VmCommand(Debugger debugger) : super(debugger, 'vm', [
+      new VmListCommand(debugger),
+      new VmNameCommand(debugger),
+      new VmRestartCommand(debugger),
+  ]);
+
+  Future run(List<String> args) async {
+    debugger.console.print("'vm' expects a subcommand (see 'help vm')");
+  }
+
+  String helpShort = 'Manage a Dart virtual machine';
+
+  String helpLong =
+      'Manage a Dart virtual machine.\n'
+      '\n'
+      'Syntax: vm <subcommand>\n';
+}
+
 class _ConsoleStreamPrinter {
   ObservatoryDebugger _debugger;
 
@@ -1205,26 +1362,28 @@
   ObservatoryDebugger() {
     _loadSettings();
     cmd = new RootCommand([
-        new HelpCommand(this),
-        new PrintCommand(this),
-        new DownCommand(this),
-        new UpCommand(this),
-        new FrameCommand(this),
-        new PauseCommand(this),
-        new ContinueCommand(this),
-        new NextCommand(this),
-        new StepCommand(this),
         new AsyncNextCommand(this),
-        new FinishCommand(this),
         new BreakCommand(this),
-        new SetCommand(this),
         new ClearCommand(this),
+        new ClsCommand(this),
+        new ContinueCommand(this),
         new DeleteCommand(this),
+        new DownCommand(this),
+        new FinishCommand(this),
+        new FrameCommand(this),
+        new HelpCommand(this),
         new InfoCommand(this),
         new IsolateCommand(this),
-        new RefreshCommand(this),
         new LogCommand(this),
-        new ClsCommand(this),
+        new PauseCommand(this),
+        new PrintCommand(this),
+        new RefreshCommand(this),
+        new SetCommand(this),
+        new SmartNextCommand(this),
+        new StepCommand(this),
+        new SyncNextCommand(this),
+        new UpCommand(this),
+        new VmCommand(this),
     ]);
     _consolePrinter = new _ConsoleStreamPrinter(this);
   }
@@ -1245,23 +1404,24 @@
       }
 
       _isolate.reload().then((response) {
+        if (response.isSentinel) {
+          // The isolate has gone away.  The IsolateExit event will
+          // clear the isolate for the debugger page.
+          return;
+        }
         // TODO(turnidge): Currently the debugger relies on all libs
         // being loaded.  Fix this.
         var pending = [];
-        for (var lib in _isolate.libraries) {
+        for (var lib in response.libraries) {
           if (!lib.loaded) {
             pending.add(lib.load());
           }
         }
         Future.wait(pending).then((_) {
-          _refreshStack(isolate.pauseEvent).then((_) {
-            reportStatus();
-          });
-        }).catchError((_) {
-          // Error loading libraries, try and display stack.
-          _refreshStack(isolate.pauseEvent).then((_) {
-            reportStatus();
-          });
+          refreshStack();
+        }).catchError((e) {
+          print("UNEXPECTED ERROR $e");
+          reportStatus();
         });
       });
     } else {
@@ -1291,10 +1451,16 @@
     });
   }
 
-  Future refreshStack() {
-    return _refreshStack(isolate.pauseEvent).then((_) {
+  Future refreshStack() async {
+    try {
+      if (_isolate != null) {
+        await _refreshStack(_isolate.pauseEvent);
+      }
+      flushStdio();
       reportStatus();
-    });
+    } catch (e, st) {
+      console.printRed("Unexpected error in refreshStack: $e\n$st");
+    }
   }
 
   bool isolatePaused() {
@@ -1317,9 +1483,12 @@
 
   Future<ServiceMap> _refreshStack(ServiceEvent pauseEvent) {
     return isolate.getStack().then((result) {
+      if (result.isSentinel) {
+        // The isolate has gone away.  The IsolateExit event will
+        // clear the isolate for the debugger page.
+        return;
+      }
       stack = result;
-      // TODO(turnidge): Replace only the changed part of the stack to
-      // reduce flicker.
       stackElement.updateStack(stack, pauseEvent);
       if (stack['frames'].length > 0) {
         currentFrame = 0;
@@ -1349,12 +1518,13 @@
   void _reportPause(ServiceEvent event) {
     if (event.kind == ServiceEvent.kPauseStart) {
       console.print(
-          "Paused at isolate start (type 'continue' [F7] or 'step' [F10] to start the isolate')");
+          "Paused at isolate start "
+          "(type 'continue' [F7] or 'step' [F10] to start the isolate')");
     } else if (event.kind == ServiceEvent.kPauseExit) {
       console.print(
-          "Paused at isolate exit (type 'continue' or [F7] to exit the isolate')");
-    }
-    if (stack['frames'].length > 0) {
+          "Paused at isolate exit "
+          "(type 'continue' or [F7] to exit the isolate')");
+    } else if (stack['frames'].length > 0) {
       Frame frame = stack['frames'][0];
       var script = frame.location.script;
       script.load().then((_) {
@@ -1374,14 +1544,14 @@
         } else {
           console.print('Paused at ${script.name}:${line}:${col}');
         }
-        if (event.asyncContinuation != null) {
-          console.print("Paused in async function: 'anext' available");
-        }
       });
+    } else {
+      console.print("Paused in message loop (type 'continue' or [F7] "
+                    "to resume processing messages)");
     }
   }
 
-  Future _reportBreakpointEvent(ServiceEvent event) {
+  Future _reportBreakpointEvent(ServiceEvent event) async {
     var bpt = event.breakpoint;
     var verb = null;
     switch (event.kind) {
@@ -1398,28 +1568,35 @@
         break;
     }
     var script = bpt.location.script;
-    return script.load().then((_) {
-      var bpId = bpt.number;
-      var tokenPos = bpt.location.tokenPos;
-      var line = script.tokenToLine(tokenPos);
-      var col = script.tokenToCol(tokenPos);
-      if (bpt.resolved) {
-        console.print(
-            'Breakpoint ${bpId} ${verb} at ${script.name}:${line}:${col}');
-      } else {
-        console.print(
-            'Future breakpoint ${bpId} ${verb} at ${script.name}:${line}:${col}');
-      }
-    });
+    await script.load();
+
+    var bpId = bpt.number;
+    var locString = await bpt.location.toUserString();
+    if (bpt.resolved) {
+      console.print(
+          'Breakpoint ${bpId} ${verb} at ${locString}');
+    } else {
+      console.print(
+          'Future breakpoint ${bpId} ${verb} at ${locString}');
+    }
   }
 
   void onEvent(ServiceEvent event) {
     switch(event.kind) {
+      case ServiceEvent.kVMUpdate:
+        var vm = event.owner;
+        console.print("VM ${vm.target.networkAddress} renamed to '${vm.name}'");
+        break;
+
       case ServiceEvent.kIsolateStart:
         {
           var iso = event.owner;
           console.print(
               "Isolate ${iso.number} '${iso.name}' has been created");
+          if (isolate == null) {
+            console.print("Switching to isolate ${iso.number} '${iso.name}'");
+            isolate = iso;
+          }
         }
         break;
 
@@ -1427,7 +1604,17 @@
         {
           var iso = event.owner;
           if (iso == isolate) {
-            console.print("The current isolate has exited");
+            console.print("The current isolate ${iso.number} '${iso.name}' "
+                          "has exited");
+            var isolates = vm.isolates;
+            if (isolates.length > 0) {
+              var newIsolate = isolates.first;
+              console.print("Switching to isolate "
+                            "${newIsolate.number} '${newIsolate.name}'");
+              isolate = newIsolate;
+            } else {
+              isolate = null;
+            }
           } else {
             console.print(
                 "Isolate ${iso.number} '${iso.name}' has exited");
@@ -1475,10 +1662,11 @@
         }
         break;
 
-      case ServiceEvent.kIsolateStart:
+      case ServiceEvent.kIsolateRunnable:
       case ServiceEvent.kGraph:
       case ServiceEvent.kGC:
       case ServiceEvent.kInspect:
+        // Ignore.
         break;
 
       case ServiceEvent.kLogging:
@@ -1618,21 +1806,48 @@
     return new Future.value(null);
   }
 
-  Future next() {
+
+  Future smartNext() async {
+    if (isolatePaused()) {
+      var event = isolate.pauseEvent;
+      if (event.atAsyncJump) {
+        return asyncNext();
+      } else {
+        return syncNext();
+      }
+    } else {
+      console.print('The program is already running');
+    }
+  }
+
+  Future asyncNext() async {
+    if (isolatePaused()) {
+      var event = isolate.pauseEvent;
+      if (event.asyncContinuation == null) {
+        console.print("No async continuation at this location");
+      } else {
+        return isolate.asyncStepOver()[Isolate.kFirstResume];
+      }
+    } else {
+      console.print('The program is already running');
+    }
+  }
+
+  Future syncNext() async {
     if (isolatePaused()) {
       var event = isolate.pauseEvent;
       if (event.kind == ServiceEvent.kPauseStart) {
         console.print("Type 'continue' [F7] or 'step' [F10] to start the isolate");
-        return new Future.value(null);
+        return null;
       }
       if (event.kind == ServiceEvent.kPauseExit) {
         console.print("Type 'continue' [F7] to exit the isolate");
-        return new Future.value(null);
+        return null;
       }
       return isolate.stepOver();
     } else {
       console.print('The program is already running');
-      return new Future.value(null);
+      return null;
     }
   }
 
@@ -1656,9 +1871,7 @@
   @published Isolate isolate;
 
   isolateChanged(oldValue) {
-    if (isolate != null) {
-      debugger.updateIsolate(isolate);
-    }
+    debugger.updateIsolate(isolate);
   }
   ObservatoryDebugger debugger = new ObservatoryDebugger();
 
@@ -1666,6 +1879,8 @@
     debugger.page = this;
   }
 
+  StreamSubscription _resizeSubscription;
+  Future<StreamSubscription> _vmSubscriptionFuture;
   Future<StreamSubscription> _isolateSubscriptionFuture;
   Future<StreamSubscription> _debugSubscriptionFuture;
   Future<StreamSubscription> _stdoutSubscriptionFuture;
@@ -1675,21 +1890,7 @@
   @override
   void attached() {
     super.attached();
-
-    var navbarDiv = $['navbarDiv'];
-    var stackDiv = $['stackDiv'];
-    var splitterDiv = $['splitterDiv'];
-    var cmdDiv = $['commandDiv'];
-
-    int navbarHeight = navbarDiv.clientHeight;
-    int splitterHeight = splitterDiv.clientHeight;
-    int cmdHeight = cmdDiv.clientHeight;
-
-    int windowHeight = window.innerHeight;
-    int fixedHeight = navbarHeight + splitterHeight + cmdHeight;
-    int available = windowHeight - fixedHeight;
-    int stackHeight = available ~/ 1.6;
-    stackDiv.style.setProperty('height', '${stackHeight}px');
+    _onResize(null);
 
     // Wire the debugger object to the stack, console, and command line.
     var stackElement = $['stackElement'];
@@ -1700,6 +1901,9 @@
     debugger.input.debugger = debugger;
     debugger.init();
 
+    _resizeSubscription = window.onResize.listen(_onResize);
+    _vmSubscriptionFuture =
+        app.vm.listenEventStream(VM.kVMStream, debugger.onEvent);
     _isolateSubscriptionFuture =
         app.vm.listenEventStream(VM.kIsolateStream, debugger.onEvent);
     _debugSubscriptionFuture =
@@ -1740,9 +1944,30 @@
     debugger.flushStdio();
   }
 
+  void _onResize(_) {
+    var navbarDiv = $['navbarDiv'];
+    var stackDiv = $['stackDiv'];
+    var splitterDiv = $['splitterDiv'];
+    var cmdDiv = $['commandDiv'];
+
+    int navbarHeight = navbarDiv.clientHeight;
+    int splitterHeight = splitterDiv.clientHeight;
+    int cmdHeight = cmdDiv.clientHeight;
+
+    int windowHeight = window.innerHeight;
+    int fixedHeight = navbarHeight + splitterHeight + cmdHeight;
+    int available = windowHeight - fixedHeight;
+    int stackHeight = available ~/ 1.6;
+    stackDiv.style.setProperty('height', '${stackHeight}px');
+  }
+
   @override
   void detached() {
     debugger.isolate = null;
+    _resizeSubscription.cancel();
+    _resizeSubscription = null;
+    cancelFutureSubscription(_vmSubscriptionFuture);
+    _vmSubscriptionFuture = null;
     cancelFutureSubscription(_isolateSubscriptionFuture);
     _isolateSubscriptionFuture = null;
     cancelFutureSubscription(_debugSubscriptionFuture);
@@ -2206,6 +2431,20 @@
   @published String text = '';
   @observable ObservatoryDebugger debugger;
   @observable bool busy = false;
+  @observable String modalPrompt = null;
+  var modalCallback = null;
+
+  void enterMode(String prompt, callback) {
+    assert(modalPrompt == null);
+    modalPrompt = prompt;
+    modalCallback = callback;
+  }
+
+  void exitMode() {
+    assert(modalPrompt != null);
+    modalPrompt = null;
+    modalCallback = null;
+  }
 
   @override
   void ready() {
@@ -2218,7 +2457,19 @@
           return;
         }
         busy = true;
-	switch (e.keyCode) {
+        if (modalCallback != null) {
+          if (e.keyCode == KeyCode.ENTER) {
+            var response = text;
+            modalCallback(response).whenComplete(() {
+              text = '';
+              busy = false;
+            });
+          } else {
+            busy = false;
+          }
+          return;
+        }
+        switch (e.keyCode) {
           case KeyCode.TAB:
             e.preventDefault();
             int cursorPos = textBox.selectionStart;
@@ -2255,7 +2506,7 @@
             e.preventDefault();
             try {
               debugger.upFrame(1);
-            } on RangeError catch (e) {
+            } on RangeError catch (_) {
               // Ignore.
             }
             busy = false;
@@ -2265,7 +2516,7 @@
             e.preventDefault();
             try {
               debugger.downFrame(1);
-            } on RangeError catch (e) {
+            } on RangeError catch (_) {
               // Ignore.
             }
             busy = false;
@@ -2287,7 +2538,7 @@
 
           case KeyCode.F9:
             e.preventDefault();
-            debugger.next().whenComplete(() {
+            debugger.smartNext().whenComplete(() {
               busy = false;
             });
             break;
@@ -2314,7 +2565,7 @@
           default:
             busy = false;
             break;
-	}
+        }
       });
   }
 
diff --git a/runtime/observatory/lib/src/elements/debugger.html b/runtime/observatory/lib/src/elements/debugger.html
index e0f5dce..5b74667 100644
--- a/runtime/observatory/lib/src/elements/debugger.html
+++ b/runtime/observatory/lib/src/elements/debugger.html
@@ -100,6 +100,7 @@
       }
       .console {
         flex: 1 1 auto;
+        overflow-x: auto;
         overflow-y: auto;
       }
       .commandline {
@@ -234,7 +235,8 @@
       .flex-item-vars {
         flex-grow: 5;
         flex-shrink: 0;
-        flex-basis: 225px;
+        flex-basis: 250px;
+        overflow-x: hidden;
       }
     </style>
     <div id="frameOuter" class="frameOuter">
@@ -371,8 +373,8 @@
             <div class="flex-item-script">
               <template if="{{ message.handler != null }}">
               <source-inset height="{{ scriptHeight }}"
-                              location="{{ message.handler.location }}"
-                              inDebuggerContext="{{ true }}">
+                            location="{{ message.handler.location }}"
+                            inDebuggerContext="{{ true }}">
               </source-inset>
               </template>
             </div>
@@ -441,14 +443,34 @@
   <template>
     <link rel="stylesheet" href="css/shared.css">
     <style>
+      .container {
+        height: 100%;
+        display: flex;
+        flex-direction: row;
+        justify-content: space-between;
+      }
       .textBox {
+        flex: 1 1 auto;
         margin: 20px;
         padding: 5px;
         font: 400 16px consolas, courier, monospace;
         width: 95%;
       }
+      .modalPrompt {
+        flex: 0 0 auto;
+        margin-top: 20px;
+        margin-left: 20px;
+        padding: 5px;
+        font: 400 16px consolas, courier, monospace;
+        color: red;
+      }
     </style>
-    <input id="textBox" class="textBox" type="text" value="{{ text }}" autofocus>
+    <div class="container">
+      <template if="{{ modalPrompt != null }}">
+        <div class="modalPrompt">{{ modalPrompt }}</div>
+      </template>
+      <input id="textBox" class="textBox" type="text" value="{{ text }}" autofocus>
+    </div>
   </template>
 </polymer-element>
 
diff --git a/runtime/observatory/lib/src/elements/field_view.html b/runtime/observatory/lib/src/elements/field_view.html
index d32cab0..d9cdefd 100644
--- a/runtime/observatory/lib/src/elements/field_view.html
+++ b/runtime/observatory/lib/src/elements/field_view.html
@@ -37,6 +37,10 @@
         </template>
         {{ field.name }}
       </h1>
+
+      <object-common object="{{ field }}"></object-common>
+      <br>
+
       <div class="memberList">
         <div class="memberItem">
           <div class="memberName">owner</div>
diff --git a/runtime/observatory/lib/src/elements/function_view.html b/runtime/observatory/lib/src/elements/function_view.html
index fee4cb4..2119fa8 100644
--- a/runtime/observatory/lib/src/elements/function_view.html
+++ b/runtime/observatory/lib/src/elements/function_view.html
@@ -27,6 +27,10 @@
 
     <div class="content">
       <h1>function {{ function.qualifiedName }}</h1>
+
+      <object-common object="{{ function }}"></object-common>
+      <br>
+
       <div class="memberList">
         <div class="memberItem">
           <div class="memberName">kind</div>
diff --git a/runtime/observatory/lib/src/elements/heap_profile.dart b/runtime/observatory/lib/src/elements/heap_profile.dart
index 25b5d54..731ff48 100644
--- a/runtime/observatory/lib/src/elements/heap_profile.dart
+++ b/runtime/observatory/lib/src/elements/heap_profile.dart
@@ -7,6 +7,7 @@
 import 'dart:async';
 import 'dart:html';
 import 'observatory_element.dart';
+import 'package:charted/charted.dart';
 import 'package:observatory/app.dart';
 import 'package:observatory/service.dart';
 import 'package:observatory/elements.dart';
@@ -32,12 +33,11 @@
   @observable String lastAccumulatorReset = '---';
 
   // Pie chart of new space usage.
-  var _newPieDataTable;
   var _newPieChart;
-
+  final _newPieChartRows = [];
   // Pie chart of old space usage.
-  var _oldPieDataTable;
   var _oldPieChart;
+  final _oldPieChartRows = [];
 
   @observable ClassSortedTable classTable;
   var _classTableBody;
@@ -48,14 +48,14 @@
   @published Isolate isolate;
   @observable ServiceMap profile;
 
+  final _pieChartColumns = [
+      new ChartColumnSpec(label: 'Type', type: ChartColumnSpec.TYPE_STRING),
+      new ChartColumnSpec(label: 'Size', formatter: (v) => v.toString())
+  ];
+
   HeapProfileElement.created() : super.created() {
-    // Create pie chart models.
-    _newPieDataTable = new DataTable();
-    _newPieDataTable.addColumn('string', 'Type');
-    _newPieDataTable.addColumn('number', 'Size');
-    _oldPieDataTable = new DataTable();
-    _oldPieDataTable.addColumn('string', 'Type');
-    _oldPieDataTable.addColumn('number', 'Size');
+    _initPieChartData(_newPieChartRows);
+    _initPieChartData(_oldPieChartRows);
 
     // Create class table model.
     var columns = [
@@ -84,14 +84,34 @@
     classTable.sortColumnIndex = 2;
   }
 
+  LayoutArea _makePieChart(String id, List rows) {
+    var wrapper = shadowRoot.querySelector(id);
+    var areaHost = wrapper.querySelector('.chart-host');
+    assert(areaHost != null);
+    var legendHost = wrapper.querySelector('.chart-legend-host');
+    assert(legendHost != null);
+    var series = new ChartSeries(id, [1], new PieChartRenderer(
+      sortDataByValue: false
+    ));
+    var config = new ChartConfig([series], [0]);
+    config.minimumSize = new Rect(300, 300);
+    config.legend = new ChartLegend(legendHost, showValues: true);
+    var data = new ChartData(_pieChartColumns, rows);
+    var area = new LayoutArea(areaHost,
+                              data,
+                              config,
+                              state: new ChartState(),
+                              autoUpdate: false);
+    area.addChartBehavior(new Hovercard());
+    area.addChartBehavior(new AxisLabelTooltip());
+    return area;
+  }
+
   @override
   void attached() {
     super.attached();
-    // Grab the pie chart divs.
-    _newPieChart = new Chart('PieChart',
-        shadowRoot.querySelector('#newPieChart'));
-    _oldPieChart = new Chart('PieChart',
-        shadowRoot.querySelector('#oldPieChart'));
+    _newPieChart = _makePieChart('#new-pie-chart', _newPieChartRows);
+    _oldPieChart = _makePieChart('#old-pie-chart', _oldPieChartRows);
     _classTableBody = shadowRoot.querySelector('#classTableBody');
     _subscriptionFuture =
         app.vm.listenEventStream(VM.kGCStream, _onEvent);
@@ -132,18 +152,29 @@
     }).catchError(app.handleException);
   }
 
+  static const _USED_INDEX = 0;
+  static const _FREE_INDEX = 1;
+  static const _EXTERNAL_INDEX = 2;
+
+  static const _LABEL_INDEX = 0;
+  static const _VALUE_INDEX = 1;
+
+  void _initPieChartData(List rows) {
+    rows.add(['Used', 0]);
+    rows.add(['Free', 0]);
+    rows.add(['External', 0]);
+  }
+
+  void _updatePieChartData(List rows, HeapSpace space) {
+    rows[_USED_INDEX][_VALUE_INDEX] = space.used;
+    rows[_FREE_INDEX][_VALUE_INDEX] = space.capacity - space.used;
+    rows[_EXTERNAL_INDEX][_VALUE_INDEX] = space.external;
+  }
+
   void _updatePieCharts() {
     assert(profile != null);
-    _newPieDataTable.clearRows();
-    _newPieDataTable.addRow(['Used', isolate.newSpace.used]);
-    _newPieDataTable.addRow(['Free',
-        isolate.newSpace.capacity - isolate.newSpace.used]);
-    _newPieDataTable.addRow(['External', isolate.newSpace.external]);
-    _oldPieDataTable.clearRows();
-    _oldPieDataTable.addRow(['Used', isolate.oldSpace.used]);
-    _oldPieDataTable.addRow(['Free',
-        isolate.oldSpace.capacity - isolate.oldSpace.used]);
-    _oldPieDataTable.addRow(['External', isolate.oldSpace.external]);
+    _updatePieChartData(_newPieChartRows, isolate.newSpace);
+    _updatePieChartData(_oldPieChartRows, isolate.oldSpace);
   }
 
   void _updateClasses() {
@@ -268,8 +299,8 @@
   }
 
   void _drawCharts() {
-    _newPieChart.draw(_newPieDataTable);
-    _oldPieChart.draw(_oldPieDataTable);
+    _newPieChart.draw();
+    _oldPieChart.draw();
   }
 
   @observable void changeSort(Event e, var detail, Element target) {
diff --git a/runtime/observatory/lib/src/elements/heap_profile.html b/runtime/observatory/lib/src/elements/heap_profile.html
index 6cece87..5e05d55 100644
--- a/runtime/observatory/lib/src/elements/heap_profile.html
+++ b/runtime/observatory/lib/src/elements/heap_profile.html
@@ -51,6 +51,20 @@
       padding: 8px;
     }
   </style>
+  <link rel="stylesheet" href="../../../../packages/charted/charts/themes/quantum_theme.css">
+  <style>
+.chart-wrapper {
+}
+
+.chart-host-wrapper {
+height: 200px;
+}
+.chart-legend-host {
+max-height: 200px;
+overflow-x: auto;
+overflow-y: auto;
+}
+  </style>
   <nav-bar>
     <top-nav-menu></top-nav-menu>
     <vm-nav-menu vm="{{ profile.isolate.vm }}"></vm-nav-menu>
@@ -115,7 +129,13 @@
             <div class="memberValue">{{ isolate.newSpace.averageCollectionPeriodInMillis.toStringAsFixed(2) }} ms</div>
           </div>
         </div>
-        <div id="newPieChart" style="height: 300px"></div>
+        <br>
+        <div class="chart-wrapper" id="new-pie-chart">
+          <div class="chart-host-wrapper">
+              <div class="chart-legend-host"></div>
+              <div class="chart-host"></div>
+          </div>
+        </div>
       </div>
       <div id="oldSpace" class="flex-item-50-percent">
         <h2>Old Generation</h2>
@@ -152,7 +172,13 @@
             <div class="memberValue">{{ isolate.oldSpace.averageCollectionPeriodInMillis.toStringAsFixed(2) }} ms</div>
           </div>
         </div>
-        <div id="oldPieChart" style="height: 300px"></div>
+        <br>
+        <div class="chart-wrapper" id="old-pie-chart">
+          <div class="chart-host-wrapper">
+              <div class="chart-host"></div>
+              <div class="chart-legend-host"></div>
+          </div>
+        </div>
       </div>
     </div>
   </div>
diff --git a/runtime/observatory/lib/src/elements/heap_snapshot.dart b/runtime/observatory/lib/src/elements/heap_snapshot.dart
index 1dee104..a9e4a8e 100644
--- a/runtime/observatory/lib/src/elements/heap_snapshot.dart
+++ b/runtime/observatory/lib/src/elements/heap_snapshot.dart
@@ -12,6 +12,7 @@
 import 'package:observatory/elements.dart';
 import 'package:observatory/object_graph.dart';
 import 'package:polymer/polymer.dart';
+import 'package:logging/logging.dart';
 
 class DominatorTreeRow extends TableTreeRow {
   final ObjectVertex vertex;
@@ -335,6 +336,8 @@
 
 
 Future<List<MergedVertex>> buildMergedVertices(ObjectGraph graph) async {
+  Logger.root.info("Start merge vertices");
+
   var cidToMergedVertex = {};
 
   for (var vertex in graph.vertices) {
@@ -365,6 +368,8 @@
     }
   }
 
+  Logger.root.info("End merge vertices");
+
   return cidToMergedVertex.values.toList();
 }
 
diff --git a/runtime/observatory/lib/src/elements/inbound_reference.dart b/runtime/observatory/lib/src/elements/inbound_reference.dart
index 39c8644..c291cf6 100644
--- a/runtime/observatory/lib/src/elements/inbound_reference.dart
+++ b/runtime/observatory/lib/src/elements/inbound_reference.dart
@@ -14,15 +14,10 @@
   @published ObservableMap ref;
   InboundReferenceElement.created() : super.created();
 
-  dynamic get slot => ref['slot'];
-  bool get slotIsArrayIndex => slot is num;
-  bool get slotIsField => slot is ServiceMap && slot['type'] == '@Field';
-
-  ServiceObject get source => ref['source'];
-
   // I.e., inbound references to 'source' for recursive pointer chasing.
   @observable ObservableList inboundReferences;
   Future<ServiceObject> fetchInboundReferences(arg) {
+    var source = ref['source'];
     return source.isolate.getInboundReferences(source, arg)
         .then((ServiceMap response) {
           inboundReferences = new ObservableList.from(response['references']);
diff --git a/runtime/observatory/lib/src/elements/inbound_reference.html b/runtime/observatory/lib/src/elements/inbound_reference.html
index d7b9e5d..4ca13c3 100644
--- a/runtime/observatory/lib/src/elements/inbound_reference.html
+++ b/runtime/observatory/lib/src/elements/inbound_reference.html
@@ -8,16 +8,21 @@
   <template>
     <link rel="stylesheet" href="css/shared.css">
     <div>
-      from
-      <template if="{{ slotIsArrayIndex }}">[{{ slot }}] of</template>
-      <template if="{{ slotIsField }}"><field-ref ref="{{ slot }}"></field-ref> of</template>
-      <any-service-ref ref="{{ source }}"></any-service-ref>
-
+      <template if="{{ ref['parentField'] != null }}">
+        from <any-service-ref ref="{{ ref['parentField'] }}"></any-service-ref>
+      </template>
+      <template if="{{ ref['parentListIndex'] != null }}">
+        from [{{ ref['parentListIndex'] }}] of
+      </template>
+      <template if="{{ ref['_parentWordOffset'] != null }}">
+        from word[{{ ref['_parentWordOffset'] }}] of
+      </template>
+      <any-service-ref ref="{{ ref['source'] }}"></any-service-ref>
       <curly-block callback="{{ expander() }}">
         <div class="memberList">
           <div class="memberItem">
             <div class="memberName">
-              <template repeat="{{ reference in inboundReferences] }}">
+              <template repeat="{{ reference in inboundReferences }}">
                 <inbound-reference ref="{{ reference }}"></inbound-reference>
               </template>
             </div>
diff --git a/runtime/observatory/lib/src/elements/instance_ref.html b/runtime/observatory/lib/src/elements/instance_ref.html
index 4781972..57dcec9 100644
--- a/runtime/observatory/lib/src/elements/instance_ref.html
+++ b/runtime/observatory/lib/src/elements/instance_ref.html
@@ -7,14 +7,20 @@
   <template>
     <link rel="stylesheet" href="css/shared.css">
     <style>
-      .errorBox {
+      .indented {
+        margin-left: 1.5em;
+        font: 400 14px 'Montserrat', sans-serif;
+        line-height: 150%;
+      }
+      .stackTraceBox {
+        margin-left: 1.5em;
         background-color: #f5f5f5;
         border: 1px solid #ccc;
         padding: 10px;
         font-family: consolas, courier, monospace;
-        font-size: 1em;
-        line-height: 1.2em;
+        font-size: 12px;
         white-space: pre;
+        overflow-x: auto;
       }
     </style>
     <span>
@@ -23,10 +29,18 @@
       </template>
 
       <template if="{{ ref.isBool || ref.isInt ||
-                       ref.isDouble || ref.isNull }}">
+                       ref.isDouble || ref.isSimdValue ||
+                       ref.isNull }}">
         <a on-click="{{ goto }}" _href="{{ url }}">{{ ref.valueAsString }}</a>
       </template>
 
+      <template if="{{ ref.isStackTrace }}">
+        <a on-click="{{ goto }}" _href="{{ url }}"><em>{{ ref.clazz.name }}</em></a>
+        <curly-block expandKey="{{ expandKey }}">
+          <div class="stackTraceBox">{{ ref.valueAsString }}</div>
+        </curly-block>
+      </template>
+
       <template if="{{ ref.isString }}">
         <a on-click="{{ goto }}" _href="{{ url }}">{{ asStringLiteral(ref.valueAsString, ref.valueAsStringIsTruncated) }}</a>
       </template>
@@ -51,18 +65,12 @@
       <template if="{{ ref.isPlainInstance }}">
         <a on-click="{{ goto }}" _href="{{ url }}"><em>{{ ref.clazz.name }}</em></a>
         <curly-block callback="{{ expander() }}" expandKey="{{ expandKey }}">
-          <div class="memberList">
+          <div class="indented">
             <template repeat="{{ field in ref.fields }}">
-              <div class="memberItem">
-                <div class="memberName">
-                  {{ field['decl'].name }}
-                </div>
-                <div class="memberValue">
-                  <any-service-ref ref="{{ field['value'] }}"
-                                   expandKey="{{ makeExpandKey(field['decl'].name) }}">
-                  </any-service-ref>
-                </div>
-              </div>
+              {{ field['decl'].name }}&nbsp;:&nbsp;
+              <any-service-ref ref="{{ field['value'] }}"
+                               expandKey="{{ makeExpandKey(field['decl'].name) }}">
+              </any-service-ref><br>
             </template>
           </div>
         </curly-block>
@@ -70,17 +78,14 @@
 
       <template if="{{ ref.isList }}">
         <a on-click="{{ goto }}" _href="{{ url }}"><em>{{ ref.clazz.name }}</em> ({{ ref.length }})</a>
-        <curly-block callback="{{ expander() }}" expandKey="{{ expandKey }}">
-          <div class="memberList">
+        <curly-block callback="{{ expander() }}"
+                     expandKey="{{ expandKey }}">
+          <div class="indented">
             <template repeat="{{ index in ref.elements.asMap().keys }}">
-              <div class="memberItem">
-                <div class="memberName">[{{ index }}]</div>
-                <div class="memberValue">
-                  <any-service-ref ref="{{ ref.elements[index] }}"
-                                   expandKey="{{ makeExpandKey(index.toString()) }}">
-                  </any-service-ref>
-                </div>
-              </div>
+              [ {{ index }} ]&nbsp;&nbsp;
+              <any-service-ref ref="{{ ref.elements[index] }}"
+                               expandKey="{{ makeExpandKey(index.toString()) }}">
+              </any-service-ref><br>
             </template>
           </div>
         </curly-block>
@@ -89,20 +94,14 @@
       <template if="{{ ref.isMap }}">
         <a on-click="{{ goto }}" _href="{{ url }}"><em>{{ ref.clazz.name }}</em> ({{ ref.length }})</a>
         <curly-block callback="{{ expander() }}" expandKey="{{ expandKey }}">
-          <div class="memberList">
+          <div class="indented">
             <template repeat="{{ association in ref.associations }}">
-              <div class="memberItem">
-                <div class="memberName">
-                  [<any-service-ref ref="{{ association['key'] }}"
-                                    expandKey="{{ makeExpandKey('key') }}">
-                  </any-service-ref>]
-                </div>
-                <div class="memberValue">
-                  <any-service-ref ref="{{ association['value'] }}"
-                                   expandKey="{{ makeExpandKey('value') }}">
-                  </any-service-ref>
-                </div>
-              </div>
+              [ <any-service-ref ref="{{ association['key'] }}"
+                                expandKey="{{ makeExpandKey('key') }}">
+              </any-service-ref> ]&nbsp;&nbsp;
+              <any-service-ref ref="{{ association['value'] }}"
+                                 expandKey="{{ makeExpandKey('value') }}">
+              </any-service-ref><br>
             </template>
           </div>
         </curly-block>
@@ -111,12 +110,10 @@
       <template if="{{ ref.isTypedData }}">
         <a on-click="{{ goto }}" _href="{{ url }}"><em>{{ ref.clazz.name }}</em> ({{ ref.length }})</a>
         <curly-block callback="{{ expander() }}" expandKey="{{ expandKey }}">
-          <div class="memberList">
+          <div class="indented">
             <template repeat="{{ index in ref.typedElements.asMap().keys }}">
-              <div class="memberItem">
-                <div class="memberName">[{{ index }}]</div>
-                <div class="memberValue">{{ ref.typedElements[index].toString() }}</div>
-              </div>
+              [ {{ index }} ]&nbsp;&nbsp;
+              {{ ref.typedElements[index].toString() }}<br>
             </template>
           </div>
         </curly-block>
@@ -125,15 +122,11 @@
       <template if="{{ ref.isMirrorReference }}">
         <a on-click="{{ goto }}" _href="{{ url }}"><em>{{ ref.clazz.name }}</em></a>
         <curly-block callback="{{ expander() }}" expandKey="{{ expandKey }}">
-          <div class="memberList">
-            <div class="memberItem">
-              <div class="memberName">referent</div>
-              <div class="memberValue">
-                <any-service-ref ref="{{ ref.referent }}"
-                                 expandKey="{{ makeExpandKey('referent') }}">
-                </any-service-ref>
-              </div>
-            </div>
+          <div class="indented">
+            &lt;referent&gt;&nbsp;:&nbsp;
+            <any-service-ref ref="{{ ref.referent }}"
+                             expandKey="{{ makeExpandKey('referent') }}">
+            </any-service-ref>
           </div>
         </curly-block>
       </template>
@@ -141,23 +134,15 @@
       <template if="{{ ref.isWeakProperty }}">
         <a on-click="{{ goto }}" _href="{{ url }}"><em>{{ ref.clazz.name }}</em></a>
         <curly-block callback="{{ expander() }}" expandKey="{{ expandKey }}">
-          <div class="memberList">
-            <div class="memberItem">
-              <div class="memberName">key</div>
-              <div class="memberValue">
-                <any-service-ref ref="{{ ref.key }}"
-                                 expandKey="{{ makeExpandKey('key') }}">
-                </any-service-ref>
-              </div>
-            </div>
-            <div class="memberItem">
-              <div class="memberName">value</div>
-              <div class="memberValue">
-                <any-service-ref ref="{{ ref.value }}"
-                                 expandKey="{{ makeExpandKey('value') }}">
-                </any-service-ref>
-              </div>
-            </div>
+          <div class="indented">
+            &lt;key&gt;&nbsp;:&nbsp;
+            <any-service-ref ref="{{ ref.key }}"
+                             expandKey="{{ makeExpandKey('key') }}">
+            </any-service-ref><br>
+            &lt;value&gt;&nbsp;:&nbsp;
+            <any-service-ref ref="{{ ref.value }}"
+                             expandKey="{{ makeExpandKey('value') }}">
+            </any-service-ref><br>
           </div>
         </curly-block>
       </template>
diff --git a/runtime/observatory/lib/src/elements/instance_view.html b/runtime/observatory/lib/src/elements/instance_view.html
index 4e718d9..28f093f 100644
--- a/runtime/observatory/lib/src/elements/instance_view.html
+++ b/runtime/observatory/lib/src/elements/instance_view.html
@@ -211,6 +211,14 @@
               </div>
             </div>
             <div class="memberItem">
+              <div class="memberName">isCaseSensitive</div>
+              <div class="memberValue">{{ instance.isCaseSensitive }}</div>
+            </div>
+            <div class="memberItem">
+              <div class="memberName">isMultiLine</div>
+              <div class="memberValue">{{ instance.isMultiLine }}</div>
+            </div>
+            <div class="memberItem">
               <div class="memberName">oneByteFunction</div>
               <div class="memberValue">
                 <any-service-ref ref="{{ instance.oneByteFunction }}"></any-service-ref>
diff --git a/runtime/observatory/lib/src/elements/isolate_ref.html b/runtime/observatory/lib/src/elements/isolate_ref.html
index ccc8a20..edfb3ea 100644
--- a/runtime/observatory/lib/src/elements/isolate_ref.html
+++ b/runtime/observatory/lib/src/elements/isolate_ref.html
@@ -2,7 +2,7 @@
 <link rel="import" href="service_ref.html">
 <polymer-element name="isolate-ref" extends="service-ref">
 <template><link rel="stylesheet" href="css/shared.css">
-  <a on-click="{{ goto }}" _href="{{ url }}">{{ ref.name }}</a>
+  <a on-click="{{ goto }}" _href="{{ url }}">Isolate {{ ref.number }} ({{ ref.name }})</a>
 </template>
 </polymer-element>
 
diff --git a/runtime/observatory/lib/src/elements/isolate_summary.dart b/runtime/observatory/lib/src/elements/isolate_summary.dart
index 288a21e..b0b2e06 100644
--- a/runtime/observatory/lib/src/elements/isolate_summary.dart
+++ b/runtime/observatory/lib/src/elements/isolate_summary.dart
@@ -4,8 +4,10 @@
 
 library isolate_summary_element;
 
+import 'dart:html';
 import 'observatory_element.dart';
-import 'package:observatory/app.dart';
+import 'package:charted/charted.dart';
+import "package:charted/charts/charts.dart";
 import 'package:observatory/service.dart';
 import 'package:polymer/polymer.dart';
 
@@ -38,28 +40,47 @@
 }
 
 class CounterChart {
-  var _table = new DataTable();
-  var _chart;
+  final HtmlElement _wrapper;
+  HtmlElement _areaHost;
+  HtmlElement _legendHost;
+  LayoutArea _area;
+  ChartData _data;
+  final _columns = [
+      new ChartColumnSpec(label: 'Type', type: ChartColumnSpec.TYPE_STRING),
+      new ChartColumnSpec(label: 'Percent', formatter: (v) => v.toString())
+  ];
 
-  void update(Map counters) {
-    if (_table.columns == 0) {
-      // Initialize.
-      _table.addColumn('string', 'Name');
-      _table.addColumn('number', 'Value');
-    }
-    _table.clearRows();
-    for (var key in counters.keys) {
-      var value = double.parse(counters[key].split('%')[0]);
-      _table.addRow([key, value]);
-    }
+  CounterChart(this._wrapper) {
+    assert(_wrapper != null);
+    _areaHost = _wrapper.querySelector('.chart-host');
+    assert(_areaHost != null);
+    _areaHost.clientWidth;
+    _legendHost = _wrapper.querySelector('.chart-legend-host');
+    assert(_legendHost != null);
+    var series = new ChartSeries("Work", [1], new PieChartRenderer(
+      sortDataByValue: false
+    ));
+    var config = new ChartConfig([series], [0]);
+    config.minimumSize = new Rect(200, 200);
+    config.legend = new ChartLegend(_legendHost, showValues: true);
+    _data = new ChartData(_columns, []);
+    _area = new LayoutArea(_areaHost,
+                           _data,
+                           config,
+                           state: new ChartState(),
+                           autoUpdate: false);
+    _area.addChartBehavior(new Hovercard());
+    _area.addChartBehavior(new AxisLabelTooltip());
   }
 
-  void draw(var element) {
-    if (_chart == null) {
-      assert(element != null);
-      _chart = new Chart('PieChart', element);
+  void update(Map counters) {
+    var rows = [];
+    for (var key in counters.keys) {
+      var value = double.parse(counters[key].split('%')[0]);
+      rows.add([key, value]);
     }
-    _chart.draw(_table);
+    _area.data = new ChartData(_columns, rows);
+    _area.draw();
   }
 }
 
@@ -70,24 +91,28 @@
   @published ObservableMap counters;
   CounterChart chart;
 
+  attached() {
+    super.attached();
+    chart =
+        new CounterChart(shadowRoot.querySelector('#isolate-counter-chart'));
+  }
+
+  detached() {
+    super.detached();
+    var host = shadowRoot.querySelector('#isolate-counter-chart-host');
+    host.children.clear();
+    var legendHost =
+        shadowRoot.querySelector('#isolate-counter-chart-legend-host');
+    legendHost.children.clear();
+  }
+
   void countersChanged(oldValue) {
     if (counters == null) {
       return;
     }
-    // Lazily create the chart.
-    if (GoogleChart.ready && chart == null) {
-      chart = new CounterChart();
-    }
     if (chart == null) {
       return;
     }
     chart.update(counters);
-    var element = shadowRoot.querySelector('#counterPieChart');
-    if (element != null) {
-      chart.draw(element);
-    }
   }
 }
-
-
-
diff --git a/runtime/observatory/lib/src/elements/isolate_summary.html b/runtime/observatory/lib/src/elements/isolate_summary.html
index 31dc45c..c146bfa 100644
--- a/runtime/observatory/lib/src/elements/isolate_summary.html
+++ b/runtime/observatory/lib/src/elements/isolate_summary.html
@@ -9,43 +9,25 @@
   <template>
     <link rel="stylesheet" href="css/shared.css">
     <div class="flex-row">
-      <div class="flex-item-10-percent">
-        <img src="img/isolate_icon.png">
-      </div>
-      <div class="flex-item-10-percent">
-        {{ isolate.number }}
-      </div>
-      <div class="flex-item-20-percent">
+      <div>
         <isolate-ref ref="{{ isolate }}"></isolate-ref>
       </div>
-      <div class="flex-item-10-percent">
+      <div style="flex:1"></div>
+      <div>
         <isolate-run-state isolate="{{ isolate }}"></isolate-run-state>
-      </div>
-      <div class="flex-item-40-percent">
         <isolate-location isolate="{{ isolate }}"></isolate-location>
         [<a on-click="{{ goto }}" _href="{{ gotoLink('/debugger', isolate) }}">debug</a>]
       </div>
-      <div class="flex-item-10-percent">
-      </div>
     </div>
-
-    <div class="flex-row">
-      <div class="flex-item-20-percent"></div>
-      <div class="flex-item-60-percent">
-        <hr>
-      </div>
-      <div class="flex-item-20-percent"></div>
-    </div>
-
+    <br>
     <isolate-shared-summary isolate="{{ isolate }}"></isolate-shared-summary>
-
   </template>
 </polymer-element>
 
 <polymer-element name="isolate-run-state" extends="observatory-element">
   <template>
     <template if="{{ isolate.paused }}">
-      <strong>paused</strong>
+      <strong title="{{ isolate.pauseEvent.timestamp.toString() }}">paused</strong>
     </template>
 
     <template if="{{ isolate.running }}">
@@ -106,7 +88,7 @@
       .errorBox {
         background-color: #f5f5f5;
         border: 1px solid #ccc;
-        padding: 10px;
+        padding: 2em;
         font-family: consolas, courier, monospace;
         font-size: 1em;
         line-height: 1.2em;
@@ -121,12 +103,10 @@
       </div>
     </template>
     <div class="flex-row">
-      <div class="flex-item-10-percent">
-      </div>
-      <div class="flex-item-40-percent">
+      <div style="flex:2">
         <isolate-counter-chart counters="{{ isolate.counters }}"></isolate-counter-chart>
       </div>
-      <div class="flex-item-40-percent">
+      <div style="flex:1">
         <div class="memberList">
           <div class="memberItem">
             <div class="memberName">new heap</div>
@@ -206,15 +186,36 @@
         </template>
         -->
       </div>
-      <div class="flex-item-10-percent">
-      </div>
     </div>
   </template>
 </polymer-element>
 
 <polymer-element name="isolate-counter-chart" extends="observatory-element">
   <template>
-    <div id="counterPieChart" style="height: 200px"></div>
+    <link rel="stylesheet" href="../../../../packages/charted/charts/themes/quantum_theme.css">
+    <style>
+.chart-wrapper {
+}
+.chart-host-wrapper {
+  display: flex;
+  flex-direction: row;
+  max-height: 250px;
+}
+.chart-host {
+  flex: 1;
+}
+.chart-legend-host {
+  flex: 1;
+  overflow-x: auto;
+  overflow-y: auto;
+}
+    </style>
+    <div class="chart-wrapper" id="isolate-counter-chart">
+      <div class="chart-host-wrapper">
+        <div class="chart-host" id="isolate-counter-chart-host"></div>
+        <div class="chart-legend-host" id="isolate-counter-chart-legend-host"></div>
+      </div>
+  </div>
   </template>
 </polymer-element>
 
diff --git a/runtime/observatory/lib/src/elements/isolate_view.html b/runtime/observatory/lib/src/elements/isolate_view.html
index 8a928e7..915930fc 100644
--- a/runtime/observatory/lib/src/elements/isolate_view.html
+++ b/runtime/observatory/lib/src/elements/isolate_view.html
@@ -32,28 +32,22 @@
       <nav-refresh callback="{{ refresh }}"></nav-refresh>
     </nav-bar>
 
-    <div class="content">
+    <div class="content-centered">
       <h1>isolate '{{ isolate.name }}'</h1>
-    </div>
-
-    <br>
-    <div class="flex-row">
-      <div class="flex-item-10-percent">
-      </div>
-      <div class="flex-item-30-percent">
-        <isolate-run-state isolate="{{ isolate }}"></isolate-run-state>
-      </div>
-      <div class="flex-item-50-percent">
-        <isolate-location isolate="{{ isolate }}"></isolate-location>
-      </div>
-      <div class="flex-item-10-percent">
+      <br>
+      <div class="flex-row">
+        <div style="flex:1"></div>
+        <div>
+          <isolate-run-state isolate="{{ isolate }}"></isolate-run-state>
+          <isolate-location isolate="{{ isolate }}"></isolate-location>
+          [<a on-click="{{ goto }}" _href="{{ gotoLink('/debugger', isolate) }}">debug</a>]
+        </div>
       </div>
     </div>
-    <br>
 
     <template if="{{ isolate.topFrame != null }}">
       <br>
-      <div class="content-centered-big">
+      <div class="content-centered">
         <source-inset location="{{ isolate.topFrame.function.location }}"
                       currentPos="{{ isolate.topFrame.location.tokenPos }}"
                       height="200px">
@@ -61,23 +55,13 @@
       </div>
     </template>
 
-    <div class="flex-row">
-      <div class="flex-item-20-percent"></div>
-      <div class="flex-item-60-percent"><hr></div>
-      <div class="flex-item-20-percent"></div>
-    </div>
-
-    <br>
-
-    <isolate-shared-summary isolate="{{ isolate }}"></isolate-shared-summary>
-
-    <div class="flex-row">
-      <div class="flex-item-20-percent"></div>
-      <div class="flex-item-60-percent"><hr></div>
-      <div class="flex-item-20-percent"></div>
+    <div class="content-centered">
+      <hr>
+      <isolate-shared-summary isolate="{{ isolate }}"></isolate-shared-summary>
     </div>
 
     <div class="content-centered">
+      <hr>
       <div class="flex-row">
         <div class="flex-item-50-percent">
           <div class="memberList">
@@ -112,9 +96,8 @@
       </div>
     </div>
 
-    <hr>
-
-    <div class="content">
+    <div class="content-centered">
+      <hr>
       libraries ({{ isolate.libraries.length }})
       <curly-block expand="{{ isolate.libraries.length <= 8 }}">
         <div class="memberList">
@@ -129,13 +112,12 @@
       </curly-block>
     </div>
 
-    <hr>
-
-    <div class="content">
+    <div class="content-centered">
+      <hr>
       <eval-box callback="{{ evaluate }}"></eval-box>
     </div>
 
-    <div class="content-centered-big">
+    <div class="content-centered">
       <hr>
       <script-inset script="{{ rootLibrary.rootScript }}">
       </script-inset>
diff --git a/runtime/observatory/lib/src/elements/library_view.html b/runtime/observatory/lib/src/elements/library_view.html
index 26ecc8e..d43fe3e 100644
--- a/runtime/observatory/lib/src/elements/library_view.html
+++ b/runtime/observatory/lib/src/elements/library_view.html
@@ -29,6 +29,10 @@
         <!-- TODO(turnidge): Handle unnamed libraries -->
         library {{ library.name }}
       </h1>
+
+      <object-common object="{{ library }}"></object-common>
+      <br>
+
       <div class="memberList">
         <div class="memberItem">
           <div class="memberName">uri</div>
diff --git a/runtime/observatory/lib/src/elements/megamorphiccache_view.dart b/runtime/observatory/lib/src/elements/megamorphiccache_view.dart
new file mode 100644
index 0000000..59cb301
--- /dev/null
+++ b/runtime/observatory/lib/src/elements/megamorphiccache_view.dart
@@ -0,0 +1,21 @@
+// 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 megamorphiccache_view;
+
+import 'dart:async';
+import 'observatory_element.dart';
+import 'package:observatory/service.dart';
+import 'package:polymer/polymer.dart';
+
+@CustomTag('megamorphiccache-view')
+class MegamorphicCacheViewElement extends ObservatoryElement {
+  @published MegamorphicCache megamorphicCache;
+
+  MegamorphicCacheViewElement.created() : super.created();
+
+  Future refresh() {
+    return megamorphicCache.reload();
+  }
+}
diff --git a/runtime/observatory/lib/src/elements/megamorphiccache_view.html b/runtime/observatory/lib/src/elements/megamorphiccache_view.html
new file mode 100644
index 0000000..db073e6
--- /dev/null
+++ b/runtime/observatory/lib/src/elements/megamorphiccache_view.html
@@ -0,0 +1,51 @@
+<link rel="import" href="../../../../packages/polymer/polymer.html">
+<link rel="import" href="class_ref.html">
+<link rel="import" href="error_view.html">
+<link rel="import" href="field_ref.html">
+<link rel="import" href="function_ref.html">
+<link rel="import" href="inbound_reference.html">
+<link rel="import" href="instance_ref.html">
+<link rel="import" href="observatory_element.html">
+<link rel="import" href="object_common.html">
+<link rel="import" href="nav_bar.html">
+<link rel="import" href="eval_link.html">
+
+<polymer-element name="megamorphiccache-view" extends="observatory-element">
+  <template>
+    <link rel="stylesheet" href="css/shared.css">
+    <nav-bar>
+      <top-nav-menu></top-nav-menu>
+      <vm-nav-menu vm="{{ megamorphicCache.isolate.vm }}"></vm-nav-menu>
+      <isolate-nav-menu isolate="{{ megamorphicCache.isolate }}"></isolate-nav-menu>
+      <nav-menu link="." anchor="object" last="{{ true }}"></nav-menu>
+      <nav-refresh callback="{{ refresh }}"></nav-refresh>
+    </nav-bar>
+
+    <div class="content">
+      <object-common object="{{ megamorphicCache }}"></object-common>
+
+      <br><br>
+
+      <div class="memberList">
+        <div class="memberItem">
+          <div class="memberName">mask</div>
+          <div class="memberValue"> 
+            {{ megamorphicCache.mask }}
+          </div>
+        </div>
+        <div class="memberItem">
+          <div class="memberName">buckets</div>
+          <div class="memberValue">
+            <any-service-ref ref="{{ megamorphicCache.buckets }}"></any-service-ref>
+          </div>
+        </div>
+      </div>
+
+    </div>
+  
+    <hr>
+    <view-footer></view-footer>
+  </template>
+</polymer-element>
+
+<script type="application/dart" src="megamorphiccache_view.dart"></script>
diff --git a/runtime/observatory/lib/src/elements/metrics.dart b/runtime/observatory/lib/src/elements/metrics.dart
index 73343c5..cb5282b 100644
--- a/runtime/observatory/lib/src/elements/metrics.dart
+++ b/runtime/observatory/lib/src/elements/metrics.dart
@@ -7,6 +7,7 @@
 import 'dart:async';
 import 'dart:html';
 import 'observatory_element.dart';
+import 'package:charted/charted.dart';
 import 'package:observatory/app.dart';
 import 'package:observatory/service.dart';
 import 'package:polymer/polymer.dart';
@@ -152,57 +153,70 @@
 class MetricsGraphElement extends ObservatoryElement {
   MetricsGraphElement.created() : super.created();
 
-  final DataTable _table = new DataTable();
-  Chart _chart;
+  HtmlElement _wrapper;
+  HtmlElement _areaHost;
+  CartesianArea _area;
+  ChartData _data;
+  final _columns = [
+      new ChartColumnSpec(label: 'Time', type: ChartColumnSpec.TYPE_TIMESTAMP),
+      new ChartColumnSpec(label: 'Value', formatter: (v) => v.toString())
+  ];
+  final _rows = [[0, 1000000.0]];
 
   @published ServiceMetric metric;
   @observable Isolate isolate;
 
   void attached() {
+    super.attached();
     // Redraw once a second.
     pollPeriod = new Duration(seconds: 1);
-    super.attached();
+    _reset();
   }
 
   void onPoll() {
-    draw();
-  }
-
-  void draw() {
-    if (_chart == null) {
-      // Construct chart.
-      var element = shadowRoot.querySelector('#graph');
-      if (element == null) {
-        // Bail.
-        return;
-      }
-      _chart = new Chart('LineChart', element);
-    }
     if (metric == null) {
       return;
     }
     _update();
-    _chart.draw(_table);
+    _draw();
   }
 
-  void _setupInitialDataTable() {
-    _table.clearColumns();
-    // Only one metric right now.
-    _table.addColumn('timeofday', 'time');
-    _table.addColumn('number', metric.name);
+  void _reset() {
+    _rows.clear();
+    _wrapper = shadowRoot.querySelector('#metric-chart');
+    assert(_wrapper != null);
+    _areaHost = _wrapper.querySelector('.chart-host');
+    assert(_areaHost != null);
+    _areaHost.children.clear();
+    var series = new ChartSeries("one", [1], new LineChartRenderer());
+    var config = new ChartConfig([series], [0]);
+    config.minimumSize = new Rect(800, 600);
+    _data = new ChartData(_columns, _rows);
+    _area = new CartesianArea(_areaHost,
+                              _data,
+                              config,
+                              state: new ChartState());
   }
 
   void _update() {
-    _table.clearRows();
+    _rows.clear();
     for (var i = 0; i < metric.samples.length; i++) {
       var sample = metric.samples[i];
-      _table.addTimeOfDayValue(sample.time, sample.value);
+      _rows.add([sample.time.millisecondsSinceEpoch, sample.value]);
     }
   }
 
+  void _draw() {
+    if (_rows.length < 2) {
+      return;
+    }
+    _area.data = new ChartData(_columns, _rows);
+    _area.draw();
+  }
+
   metricChanged(oldValue) {
     if (oldValue != metric) {
-      _setupInitialDataTable();
+      _reset();
     }
   }
 }
diff --git a/runtime/observatory/lib/src/elements/metrics.html b/runtime/observatory/lib/src/elements/metrics.html
index 899292a..a6a0411 100644
--- a/runtime/observatory/lib/src/elements/metrics.html
+++ b/runtime/observatory/lib/src/elements/metrics.html
@@ -127,12 +127,20 @@
 <polymer-element name="metrics-graph" extends="observatory-element">
   <template>
     <link rel="stylesheet" href="css/shared.css">
+    <link rel="stylesheet" href="../../../../packages/charted/charts/themes/quantum_theme.css">
     <style>
-      .graph {
-        min-height: 600px;
-      }
+.chart-wrapper {
+  padding: 40px;
+  width: 800px;
+}
+.chart-host-wrapper {
+  height: 300px;
+}
     </style>
-    <div id="graph" class="graph">
+    <div class="chart-wrapper" id="metric-chart">
+        <div class="chart-host-wrapper">
+            <div class="chart-host" dir="ltr"></div>
+        </div>
     </div>
   </template>
 </polymer-element>
diff --git a/runtime/observatory/lib/src/elements/nav_bar.dart b/runtime/observatory/lib/src/elements/nav_bar.dart
index f8ce11e..db77700 100644
--- a/runtime/observatory/lib/src/elements/nav_bar.dart
+++ b/runtime/observatory/lib/src/elements/nav_bar.dart
@@ -76,6 +76,14 @@
   @published bool last = false;
   @published VM vm;
 
+  String nameAndAddress(name, target) {
+    if (name != null && target != null) {
+      return '${name}@${target.networkAddress}';
+    } else {
+      return '<initializing>';
+    }
+  }
+
   VMNavMenuElement.created() : super.created();
 }
 
diff --git a/runtime/observatory/lib/src/elements/nav_bar.html b/runtime/observatory/lib/src/elements/nav_bar.html
index c52370d..c9e6b62 100644
--- a/runtime/observatory/lib/src/elements/nav_bar.html
+++ b/runtime/observatory/lib/src/elements/nav_bar.html
@@ -178,7 +178,7 @@
 
 <polymer-element name="vm-nav-menu">
   <template>
-    <nav-menu link="/vm" anchor="{{ vm.target.name }}" last="{{ last }}">
+    <nav-menu link="/vm" anchor="{{ nameAndAddress(vm.name, vm.target) }}" last="{{ last }}">
       <template repeat="{{ isolate in vm.isolates }}">
         <nav-menu-item link="{{ makeLink('/inspect', isolate) }}"
 	               anchor="{{ isolate.name }}"></nav-menu-item>
diff --git a/runtime/observatory/lib/src/elements/object_common.html b/runtime/observatory/lib/src/elements/object_common.html
index c4ce618..7cad87a 100644
--- a/runtime/observatory/lib/src/elements/object_common.html
+++ b/runtime/observatory/lib/src/elements/object_common.html
@@ -22,7 +22,7 @@
       </div>
 
       <div class="memberItem" title="Space for this object in memory">
-        <div class="memberName">size</div>
+        <div class="memberName">shallow size</div>
         <div class="memberValue">{{ object.size | formatSize }}</div>
       </div>
 
@@ -50,12 +50,15 @@
             </eval-link>
           </template>
           <template if="{{ path != null }}">
+            <template if="{{ path['length'] == 0 }}">
+              &lt;root&gt;
+            </template>
             <template repeat="{{ element in path['elements'] }}">
             <div class="memberItem">
               <div class="memberName">[{{ element['index']}}]</div>
               <div class="memberValue">
                 <template if="{{ element['parentField'] != null }}">
-                  from <field-ref ref="{{ element['parentField'] }}"></field-ref> of
+                  from <any-service-ref ref="{{ element['parentField'] }}"></any-service-ref> of
                 </template>
                 <template if="{{ element['parentListIndex'] != null }}">
                   from [{{ element['parentListIndex'] }}] of
@@ -89,6 +92,9 @@
             </eval-link>
           </template>
           <template if="{{ inboundReferences != null }}">
+            <template if="{{ inboundReferences['references'].length == 0 }}">
+              &lt;root&gt;
+            </template>
             <template repeat="{{ reference in inboundReferences['references'] }}">
               <inbound-reference ref="{{ reference }}"></inbound-reference>
             </template>
diff --git a/runtime/observatory/lib/src/elements/objectpool_view.dart b/runtime/observatory/lib/src/elements/objectpool_view.dart
index 9bc5a4e..1e08198 100644
--- a/runtime/observatory/lib/src/elements/objectpool_view.dart
+++ b/runtime/observatory/lib/src/elements/objectpool_view.dart
@@ -12,32 +12,12 @@
 @CustomTag('objectpool-view')
 class ObjectPoolViewElement extends ObservatoryElement {
   @published ObjectPool pool;
-  @published List annotatedEntries;
 
   ObjectPoolViewElement.created() : super.created();
 
   bool isServiceObject(o) => o is ServiceObject;
 
-  void poolChanged(oldValue) {
-    annotateRawEntries();
-  }
-
-  Future annotateRawEntries() {
-    var tasks = pool.entries.map((entry) {
-     if (entry is int) {
-       var addr = entry.toRadixString(16);
-       return pool.isolate.getObjectByAddress(addr).then((result) {
-         return result is ServiceObject ? result : null;
-       });
-     } else {
-       return new Future.value(null);
-     }
-    });
-
-    return Future.wait(tasks).then((results) => annotatedEntries = results);
-  }
-
   Future refresh() {
-    return pool.reload().then((_) => annotateRawEntries());
+    return pool.reload();
   }
 }
diff --git a/runtime/observatory/lib/src/elements/objectpool_view.html b/runtime/observatory/lib/src/elements/objectpool_view.html
index a928531..4177eea 100644
--- a/runtime/observatory/lib/src/elements/objectpool_view.html
+++ b/runtime/observatory/lib/src/elements/objectpool_view.html
@@ -28,19 +28,19 @@
 
       entries ({{ pool.entries.length }})
       <div class="memberList">
-        <template repeat="{{ index in pool.entries.asMap().keys }}">
+        <template repeat="{{ entry in pool.entries }}">
           <div class="memberItem">
-            <div class="memberName">[{{ index }}]</div>
+            <div class="memberName">[PP+0x{{ entry['offset'].toRadixString(16) }}]</div>
             <div class="memberValue">
-              <template if="{{ isServiceObject(pool.entries[index]) }}">
-                <any-service-ref ref="{{ pool.entries[index] }}">
+              <template if="{{ entry['kind'] == 'Object' }}">
+                <any-service-ref ref="{{ entry['value'] }}">
                 </any-service-ref>
               </template>
-              <template if="{{ !isServiceObject(pool.entries[index]) }}">
-                0x{{ pool.entries[index].toRadixString(16) }}
-                <template if="{{ annotatedEntries != null && annotatedEntries[index] != null }}">
-                  (<any-service-ref ref="{{ annotatedEntries[index] }}"></any-service-ref>)
-                </template>
+              <template if="{{ entry['kind'] == 'Immediate' }}">
+                Immediate 0x{{ entry['value'].toRadixString(16) }}
+             </template>
+              <template if="{{ entry['kind'] == 'NativeEntry' }}">
+                NativeEntry 0x{{ entry['value'].toRadixString(16) }}
              </template>
             </div>
           </div>
diff --git a/runtime/observatory/lib/src/elements/script_inset.dart b/runtime/observatory/lib/src/elements/script_inset.dart
index ee555ca..92930a9 100644
--- a/runtime/observatory/lib/src/elements/script_inset.dart
+++ b/runtime/observatory/lib/src/elements/script_inset.dart
@@ -57,11 +57,15 @@
   int line;
   int columnStart;
   int columnStop;
+  int get priority;
 
   void applyStyleTo(element);
 
   int compareTo(Annotation other) {
     if (line == other.line) {
+      if (columnStart == other.columnStart) {
+        return priority.compareTo(other.priority);
+      }
       return columnStart.compareTo(other.columnStart);
     }
     return line.compareTo(other.line);
@@ -100,6 +104,8 @@
 }
 
 class CurrentExecutionAnnotation extends Annotation {
+  int priority = 0;  // highest priority.
+
   void applyStyleTo(element) {
     if (element == null) {
       return;  // TODO(rmacnak): Handling overlapping annotations.
@@ -109,9 +115,53 @@
   }
 }
 
+class BreakpointAnnotation extends Annotation {
+  Breakpoint bpt;
+  int priority = 1;
+
+  BreakpointAnnotation(this.bpt) {
+    var script = bpt.location.script;
+    var location = bpt.location;
+    if (location.tokenPos != null) {
+      var pos = location.tokenPos;
+      line = script.tokenToLine(pos);
+      columnStart = script.tokenToCol(pos) - 1;  // tokenToCol is 1-origin.
+    } else if (location is UnresolvedSourceLocation) {
+      line = location.line;
+      columnStart = location.column;
+      if (columnStart == null) {
+        columnStart = 0;
+      }
+    }
+    var length = script.guessTokenLength(line, columnStart);
+    if (length == null) {
+      length = 1;
+    }
+    columnStop = columnStart + length;
+  }
+
+  void applyStyleTo(element) {
+    if (element == null) {
+      return;  // TODO(rmacnak): Handling overlapping annotations.
+    }
+    var script = bpt.location.script;
+    var pos = bpt.location.tokenPos;
+    int line = script.tokenToLine(pos);
+    int column = script.tokenToCol(pos);
+    if (bpt.resolved) {
+      element.classes.add("resolvedBreakAnnotation");
+    } else {
+      element.classes.add("unresolvedBreakAnnotation");
+    }
+    element.title = "Breakpoint ${bpt.number} at ${line}:${column}";
+  }
+}
+
 class LibraryAnnotation extends Annotation {
   Library target;
   String url;
+  int priority = 2;
+
   LibraryAnnotation(this.target, this.url);
 
   void applyStyleTo(element) {
@@ -126,6 +176,8 @@
 class PartAnnotation extends Annotation {
   Script part;
   String url;
+  int priority = 2;
+
   PartAnnotation(this.part, this.url);
 
   void applyStyleTo(element) {
@@ -139,6 +191,7 @@
 
 class LocalVariableAnnotation extends Annotation {
   final value;
+  int priority = 2;
 
   LocalVariableAnnotation(LocalVarLocation location, this.value) {
     line = location.line;
@@ -157,13 +210,17 @@
 
 class CallSiteAnnotation extends Annotation {
   CallSite callSite;
+  int priority = 2;
 
   CallSiteAnnotation(this.callSite) {
     line = callSite.line;
     columnStart = callSite.column - 1;  // Call site is 1-origin.
-    var tokenLength = callSite.name.length;  // Approximate.
-    if (callSite.name.startsWith("get:") ||
-        callSite.name.startsWith("set:")) tokenLength -= 4;
+    var tokenLength = callSite.script.guessTokenLength(line, columnStart);
+    if (tokenLength == null) {
+      tokenLength = callSite.name.length;  // Approximate.
+      if (callSite.name.startsWith("get:") ||
+          callSite.name.startsWith("set:")) tokenLength -= 4;
+    }
     columnStop = columnStart + tokenLength;
   }
 
@@ -200,6 +257,8 @@
 
 abstract class DeclarationAnnotation extends Annotation {
   String url;
+  int priority = 2;
+
   DeclarationAnnotation(decl, this.url) {
     assert(decl.loaded);
     SourceLocation location = decl.location;
@@ -323,7 +382,8 @@
   var annotations = [];
   var annotationsCursor;
 
-  StreamSubscription scriptChangeSubscription;
+  StreamSubscription _scriptChangeSubscription;
+  Future<StreamSubscription> _debugSubscriptionFuture;
 
   bool hasLoadedLibraryDeclarations = false;
 
@@ -338,15 +398,50 @@
     }
   }
 
+  void attached() {
+    super.attached();
+    _debugSubscriptionFuture =
+        app.vm.listenEventStream(VM.kDebugStream, _onDebugEvent);
+  }
+
   void detached() {
-    if (scriptChangeSubscription != null) {
+    cancelFutureSubscription(_debugSubscriptionFuture);
+    _debugSubscriptionFuture = null;
+    if (_scriptChangeSubscription != null) {
       // Don't leak. If only Dart and Javascript exposed weak references...
-      scriptChangeSubscription.cancel();
-      scriptChangeSubscription = null;
+      _scriptChangeSubscription.cancel();
+      _scriptChangeSubscription = null;
     }
     super.detached();
   }
 
+  void _onDebugEvent(event) {
+    if (script == null) {
+      return;
+    }
+    switch (event.kind) {
+      case ServiceEvent.kBreakpointAdded:
+      case ServiceEvent.kBreakpointResolved:
+      case ServiceEvent.kBreakpointRemoved:
+        var loc = event.breakpoint.location;
+        if (loc.script == script) {
+          int line;
+          if (loc.tokenPos != null) {
+            line = script.tokenToLine(loc.tokenPos);
+          } else {
+            line = script.tokenToLine(loc.line);
+          }
+          if ((line >= _startLine) && (line <= _endLine)) {
+            _updateTask.queue();
+          }
+        }
+        break;
+      default:
+        // Ignore.
+        break;
+    }
+  }
+
   void currentPosChanged(oldValue) {
     _updateTask.queue();
     _scrollToCurrentPos();
@@ -371,6 +466,11 @@
   Element a(String text) => new AnchorElement()..text = text;
   Element span(String text) => new SpanElement()..text = text;
 
+  Element hitsCurrent(Element element) {
+    element.classes.add('hitsCurrent');
+    element.title = "";
+    return element;
+  }
   Element hitsUnknown(Element element) {
     element.classes.add('hitsNone');
     element.title = "";
@@ -404,8 +504,8 @@
       return;
     }
 
-    if (scriptChangeSubscription == null) {
-      scriptChangeSubscription = script.changes.listen((_) => update());
+    if (_scriptChangeSubscription == null) {
+      _scriptChangeSubscription = script.changes.listen((_) => update());
     }
 
     computeAnnotations();
@@ -444,9 +544,14 @@
                 ? script.tokenToLine(endPos)
                 : script.lines.length + script.lineOffset);
 
+    if (_startLine == null || _endLine == null) {
+      return;
+    }
+
     annotations.clear();
 
     addCurrentExecutionAnnotation();
+    addBreakpointAnnotations();
 
     if (!inDebuggerContext && script.library != null) {
       if (hasLoadedLibraryDeclarations) {
@@ -475,11 +580,28 @@
       var a = new CurrentExecutionAnnotation();
       a.line = _currentLine;
       a.columnStart = _currentCol;
-      a.columnStop = _currentCol + 1;
+      var length = script.guessTokenLength(_currentLine, _currentCol);
+      if (length == null) {
+        length = 1;
+      }
+      a.columnStop = _currentCol + length;
       annotations.add(a);
     }
   }
 
+  void addBreakpointAnnotations() {
+    for (var line = _startLine; line <= _endLine; line++) {
+      var bpts = script.getLine(line).breakpoints;
+      if (bpts != null) {
+        for (var bpt in bpts) {
+          if (bpt.location != null) {
+            annotations.add(new BreakpointAnnotation(bpt));
+          }
+        }
+      }
+    }
+  }
+
   Future loadDeclarationsOfLibrary(Library lib) {
     return lib.load().then((lib) {
       var loads = [];
@@ -835,7 +957,9 @@
     var e = span("$nbsp$lineNumber$nbsp");
     e.classes.add('noCopy');
 
-    if ((line == null) || (line.hits == null)) {
+    if (lineNumber == _currentLine) {
+      hitsCurrent(e);
+    } else if ((line == null) || (line.hits == null)) {
       hitsUnknown(e);
     } else if (line.hits == 0) {
       hitsNotExecuted(e);
@@ -905,4 +1029,3 @@
   @published bool inDebuggerContext = false;
   @published ObservableList variables;
 }
-
diff --git a/runtime/observatory/lib/src/elements/script_inset.html b/runtime/observatory/lib/src/elements/script_inset.html
index 167816d..a76ae42 100644
--- a/runtime/observatory/lib/src/elements/script_inset.html
+++ b/runtime/observatory/lib/src/elements/script_inset.html
@@ -14,24 +14,24 @@
       .sourceInset {
       }
       .sourceTable {
-        display: table;
         background-color: #f5f5f5;
         border: 1px solid #ccc;
         padding: 10px;
         width: 100%;
         box-sizing: border-box;
+        overflow-x: scroll;
       }
       .sourceRow {
-        display: table-row;
+        display: flex;
+        flex-direction: row;
+        width: 100%;
       }
       .sourceItem, .sourceItemCurrent {
-        display: table-cell;
         vertical-align: top;
         font: 400 14px consolas, courier, monospace;
         line-height: 125%;
         white-space: pre;
         max-width: 0;
-	overflow-x: hidden;
       }
       .currentLine {
         background-color: #fff;
@@ -39,19 +39,24 @@
       .currentCol {
         background-color: #6cf;
       }
-      .hitsNone, .hitsNotExecuted, .hitsExecuted {
+      .hitsCurrent, .hitsNone, .hitsNotExecuted, .hitsExecuted {
         display: table-cell;
         vertical-align: top;
         font: 400 14px consolas, courier, monospace;
-        width: 4em;
+        margin-left: 5px;
+        margin-right: 5px;
         text-align: right;
         color: #a8a8a8;
       }
+      .hitsCurrent {
+        background-color: #6cf;
+        color: black;
+      }
       .hitsNotExecuted {
-        background-color: #EEA7A7;
+        background-color: #faa;
       }
       .hitsExecuted {
-        background-color: #9BDD9B;
+        background-color: #aea;
       }
       .noCopy {}
       .emptyBreakpoint, .possibleBreakpoint, .busyBreakpoint, .unresolvedBreakpoint, .resolvedBreakpoint  {
@@ -82,6 +87,14 @@
         color: white;
         background-color: #e66;
       }
+      .unresolvedBreakAnnotation {
+        color: white;
+        background-color: #cac;
+      }
+      .resolvedBreakAnnotation {
+        color: white;
+        background-color: #e66;
+      }
     </style>
   </template>
 </polymer-element>
diff --git a/runtime/observatory/lib/src/elements/script_view.html b/runtime/observatory/lib/src/elements/script_view.html
index 575a1ce..1dc23b4 100644
--- a/runtime/observatory/lib/src/elements/script_view.html
+++ b/runtime/observatory/lib/src/elements/script_view.html
@@ -19,6 +19,9 @@
 
   <div class="content-centered-big">
     <h1>script {{ script.name }}</h1>
+    <object-common object="{{ script }}"></object-common>
+    <br>
+
     <hr>
     <script-inset id="scriptInset" script="{{ script }}"
                   currentPos="{{ app.locationManager.internalArguments['pos'] | parseInt }}">
diff --git a/runtime/observatory/lib/src/elements/service_view.dart b/runtime/observatory/lib/src/elements/service_view.dart
index 26ffd36..c9924a6 100644
--- a/runtime/observatory/lib/src/elements/service_view.dart
+++ b/runtime/observatory/lib/src/elements/service_view.dart
@@ -89,6 +89,11 @@
                   new Element.tag('instructions-view');
               element.instructions = object;
               return element;
+            case 'MegamorphicCache':
+              MegamorphicCacheViewElement element =
+                  new Element.tag('megamorphiccache-view');
+              element.megamorphicCache = object;
+              return element;
             case 'ObjectPool':
               ObjectPoolViewElement element = new Element.tag('objectpool-view');
               element.pool = object;
diff --git a/runtime/observatory/lib/src/elements/vm_view.html b/runtime/observatory/lib/src/elements/vm_view.html
index 3ea8909..55fc712 100644
--- a/runtime/observatory/lib/src/elements/vm_view.html
+++ b/runtime/observatory/lib/src/elements/vm_view.html
@@ -19,10 +19,19 @@
       <nav-refresh callback="{{ refresh }}"></nav-refresh>
     </nav-bar>
 
-    <div class="content">
+    <div class="content-centered">
       <h1>VM</h1>
+      <hr>
       <div class="memberList">
         <div class="memberItem">
+          <div class="memberName">name</div>
+          <div class="memberValue">{{ vm.name }}</div>
+        </div>
+        <div class="memberItem">
+          <div class="memberName">address</div>
+          <div class="memberValue">{{ vm.target.networkAddress }}</div>
+        </div>
+        <div class="memberItem">
           <div class="memberName">version</div>
           <div class="memberValue">{{ vm.version }}</div>
         </div>
@@ -39,14 +48,6 @@
           <div class="memberValue">{{ vm.refreshTime.toString() }}</div>
         </div>
         <div class="memberItem">
-          <div class="memberName">type checks enabled</div>
-          <div class="memberValue">{{ vm.typeChecksEnabled }}</div>
-        </div>
-        <div class="memberItem">
-          <div class="memberName">asserts enabled</div>
-          <div class="memberValue">{{ vm.assertsEnabled }}</div>
-        </div>
-        <div class="memberItem">
           <div class="memberName">pid</div>
           <div class="memberValue">{{ vm.pid }}</div>
         </div>
@@ -57,17 +58,19 @@
           </div>
         </div>
       </div>
+      <br>
+      <br>
+      <h1>Isolates ({{ vm.isolates.length }})</h1>
+      <hr>
+      <ul class="list-group">
+        <template repeat="{{ isolate in vm.isolates }}">
+          <li class="list-group-item">
+            <isolate-summary isolate="{{ isolate }}"></isolate-summary>
+          </li>
+          <hr>
+        </template>
+      </ul>
     </div>
-    <br>
-    <hr>
-    <ul class="list-group">
-      <template repeat="{{ isolate in vm.isolates }}">
-      	<li class="list-group-item">
-          <isolate-summary isolate="{{ isolate }}"></isolate-summary>
-        </li>
-        <hr>
-      </template>
-    </ul>
     <view-footer></view-footer>
   </template>
 </polymer-element>
diff --git a/runtime/observatory/lib/src/service/object.dart b/runtime/observatory/lib/src/service/object.dart
index 3c8e639..acb3edf 100644
--- a/runtime/observatory/lib/src/service/object.dart
+++ b/runtime/observatory/lib/src/service/object.dart
@@ -136,6 +136,8 @@
   bool get isMirrorReference => false;
   bool get isWeakProperty => false;
   bool get isClosure => false;
+  bool get isStackTrace => false;
+  bool get isSimdValue => false;
   bool get isPlainInstance => false;
 
   /// Has this object been fully loaded?
@@ -215,6 +217,9 @@
       case 'SourceLocation':
         obj = new SourceLocation._empty(owner);
         break;
+      case 'UnresolvedSourceLocation':
+        obj = new UnresolvedSourceLocation._empty(owner);
+        break;
       case 'Object':
         switch (vmType) {
           case 'ICData':
@@ -226,6 +231,9 @@
           case 'LocalVarDescriptors':
             obj = new LocalVarDescriptors._empty(owner);
             break;
+          case 'MegamorphicCache':
+            obj = new MegamorphicCache._empty(owner);
+            break;
           case 'ObjectPool':
             obj = new ObjectPool._empty(owner);
             break;
@@ -365,6 +373,19 @@
   @observable int retainedSize;
 
   HeapObject._empty(ServiceObjectOwner owner) : super._empty(owner);
+
+  void _update(ObservableMap map, bool mapIsRef) {
+    if (map['class'] != null) {
+      // Sent with refs for some types. Load it if available, but don't clobber
+      // it with null for kinds that only send if for full responses.
+      clazz = map['class'];
+    }
+
+    if (mapIsRef) {
+      return;
+    }
+    size = map['size'];
+  }
 }
 
 abstract class Coverage {
@@ -411,12 +432,27 @@
   ServiceObject getFromMap(ObservableMap map);
 }
 
+abstract class Location  {
+  Script get script;
+  int get tokenPos;
+}
+
 /// A [SourceLocation] represents a location or range in the source code.
-class SourceLocation extends ServiceObject {
+class SourceLocation extends ServiceObject implements Location {
   Script script;
   int tokenPos;
   int endTokenPos;
 
+  Future<int> getLine() async {
+    await script.load();
+    return script.tokenToLine(tokenPos);
+  }
+
+  Future<int> getColumn() async {
+    await script.load();
+    return script.tokenToCol(tokenPos);
+  }
+
   SourceLocation._empty(ServiceObject owner) : super._empty(owner);
 
   void _update(ObservableMap map, bool mapIsRef) {
@@ -424,8 +460,15 @@
     _upgradeCollection(map, owner);
     script = map['script'];
     tokenPos = map['tokenPos'];
-    assert(script != null && tokenPos != null);
     endTokenPos = map['endTokenPos'];
+
+    assert(script != null && tokenPos != null);
+  }
+
+  Future<String> toUserString() async {
+    int line = await getLine();
+    int column = await getColumn();
+    return '${script.name}:${line}:${column}';
   }
 
   String toString() {
@@ -437,6 +480,86 @@
   }
 }
 
+/// An [UnresolvedSourceLocation] represents a location in the source
+// code which has not been precisely mapped to a token position.
+class UnresolvedSourceLocation extends ServiceObject implements Location {
+  Script script;
+  String scriptUri;
+  int line;
+  int column;
+  int tokenPos;
+
+  Future<int> getLine() async {
+    if (tokenPos != null) {
+      await script.load();
+      return script.tokenToLine(tokenPos);
+    } else {
+      return line;
+    }
+  }
+
+  Future<int> getColumn() async {
+    if (tokenPos != null) {
+      await script.load();
+      return script.tokenToCol(tokenPos);
+    } else {
+      return column;
+    }
+  }
+
+  UnresolvedSourceLocation._empty(ServiceObject owner) : super._empty(owner);
+
+  void _update(ObservableMap map, bool mapIsRef) {
+    assert(!mapIsRef);
+    _upgradeCollection(map, owner);
+    script = map['script'];
+    scriptUri = map['scriptUri'];
+    line = map['line'];
+    column = map['column'];
+    tokenPos = map['tokenPos'];
+
+    assert(script != null || scriptUri != null);
+    assert(line != null || tokenPos != null);
+  }
+
+  Future<String> toUserString() async {
+    StringBuffer sb = new StringBuffer();
+
+    int line = await getLine();
+    int column = await getColumn();
+
+    if (script != null) {
+      sb.write('${script.name}:');
+    } else {
+      sb.write('${scriptUri}:');
+    }
+    if (column != null) {
+      sb.write('${line}:${column}');
+    } else {
+      sb.write('${line}');
+    }
+    return sb.toString();
+  }
+
+  String toString() {
+    StringBuffer sb = new StringBuffer();
+    if (script != null) {
+      sb.write('${script.name}:');
+    } else {
+      sb.write('${scriptUri}:');
+    }
+    if (tokenPos != null) {
+      sb.write('token(${tokenPos})');
+    } else if (column != null) {
+      sb.write('${line}:${column}');
+    } else {
+      sb.write('${line}');
+    }
+    sb.write('[unresolved]');
+    return sb.toString();
+  }
+}
+
 class _EventStreamState {
   VM _vm;
   String streamId;
@@ -501,6 +624,9 @@
   // TODO(turnidge): The connection should not be stored in the VM object.
   bool get isDisconnected;
 
+  // Used for verbose logging.
+  bool verbose = false;
+
   // TODO(johnmccutchan): Ensure that isolates do not end up in _cache.
   Map<String,ServiceObject> _cache = new Map<String,ServiceObject>();
   final ObservableMap<String,Isolate> _isolateCache =
@@ -514,17 +640,18 @@
   @observable int architectureBits;
   @observable bool assertsEnabled = false;
   @observable bool typeChecksEnabled = false;
-  @observable String pid = '';
+  @observable int pid = 0;
   @observable DateTime startTime;
   @observable DateTime refreshTime;
-  @observable Duration get upTime =>
-      (new DateTime.now().difference(startTime));
+  @observable Duration get upTime {
+    if (startTime == null) {
+      return null;
+    }
+    return (new DateTime.now().difference(startTime));
+  }
 
   VM() : super._empty(null) {
-    name = 'vm';
-    vmName = 'vm';
-    _cache['vm'] = this;
-    update(toObservable({'id':'vm', 'type':'@VM'}));
+    update(toObservable({'name':'vm', 'type':'@VM'}));
   }
 
   void postServiceEvent(String streamId, Map response, ByteData data) {
@@ -551,6 +678,11 @@
         _isolateCache.remove(isolate.id);
         _buildIsolateList();
       }
+      if (event.kind == ServiceEvent.kIsolateRunnable) {
+        // Force reload once the isolate becomes runnable so that we
+        // update the root library.
+        isolate.reload();
+      }
     }
     var eventStream = _eventStreams[streamId];
     if (eventStream != null) {
@@ -605,6 +737,14 @@
     if (map == null) {
       return null;
     }
+    var type = _stripRef(map['type']);
+    if (type == 'VM') {
+      // Update this VM object.
+      update(map);
+      return this;
+    }
+
+    assert(type == 'Isolate');
     String id = map['id'];
     if (!id.startsWith(_isolateIdPrefix)) {
       // Currently the VM only supports upgrading Isolate ServiceObjects.
@@ -680,10 +820,15 @@
     }
   }
 
+  Future restart() {
+    return invokeRpc('_restartVM', {});
+  }
+
   Future<ObservableMap> _fetchDirect() async {
     if (!loaded) {
       // The vm service relies on these events to keep the VM and
       // Isolate types up to date.
+      await listenEventStream(kVMStream, _dispatchEventToIsolate);
       await listenEventStream(kIsolateStream, _dispatchEventToIsolate);
       await listenEventStream(kDebugStream, _dispatchEventToIsolate);
       await listenEventStream(_kGraphStream, _dispatchEventToIsolate);
@@ -691,6 +836,10 @@
     return await invokeRpcNoUpgrade('getVM', {});
   }
 
+  Future setName(String newName) {
+    return invokeRpc('setVMName', { 'name': newName });
+  }
+
   Future<ServiceObject> getFlagList() {
     return invokeRpc('getFlagList', {});
   }
@@ -713,6 +862,7 @@
   Map<String,_EventStreamState> _eventStreams = {};
 
   // Well-known stream ids.
+  static const kVMStream = 'VM';
   static const kIsolateStream = 'Isolate';
   static const kDebugStream = 'Debug';
   static const kGCStream = 'GC';
@@ -743,6 +893,8 @@
   Future get onDisconnect;
 
   void _update(ObservableMap map, bool mapIsRef) {
+    name = map['name'];
+    vmName = map.containsKey('_vmName') ? map['_vmName'] : name;
     if (mapIsRef) {
       return;
     }
@@ -754,7 +906,7 @@
     version = map['version'];
     targetCPU = map['targetCPU'];
     architectureBits = map['architectureBits'];
-    var startTimeMillis = map['startTime'];
+    int startTimeMillis = map['startTime'];
     startTime = new DateTime.fromMillisecondsSinceEpoch(startTimeMillis);
     refreshTime = new DateTime.now();
     notifyPropertyChange(#upTime, 0, 1);
@@ -959,10 +1111,10 @@
                                                  limit: limit)) {
       result.add(isolate.getObjectByAddress(v.address)
                         .then((ServiceObject obj) {
-        if (obj is Instance) {
-          // TODO(rmacnak): size/retainedSize are properties of all heap
-          // objects, not just Instances.
+        if (obj is HeapObject) {
           obj.retainedSize = v.retainedSize;
+        } else {
+          print("${obj.runtimeType} should be a HeapObject");
         }
         return obj;
       }));
@@ -977,9 +1129,14 @@
   @reflectable VM get vm => owner;
   @reflectable Isolate get isolate => this;
   @observable int number;
+  @observable int originNumber;
   @observable DateTime startTime;
-  @observable Duration get upTime =>
-      (new DateTime.now().difference(startTime));
+  @observable Duration get upTime {
+    if (startTime == null) {
+      return null;
+    }
+    return (new DateTime.now().difference(startTime));
+  }
 
   @observable ObservableMap counters = new ObservableMap();
 
@@ -1147,9 +1304,6 @@
   @observable String vmName;
   @observable ServiceFunction entry;
 
-  @observable final Map<String, double> timers =
-      toObservable(new Map<String, double>());
-
   final HeapSpace newSpace = new HeapSpace();
   final HeapSpace oldSpace = new HeapSpace();
 
@@ -1211,7 +1365,7 @@
 
   void _update(ObservableMap map, bool mapIsRef) {
     name = map['name'];
-    vmName = map['name'];
+    vmName = map.containsKey('_vmName') ? map['_vmName'] : name;
     number = int.parse(map['number'], onError:(_) => null);
     if (mapIsRef) {
       return;
@@ -1220,12 +1374,13 @@
     loading = false;
 
     _upgradeCollection(map, isolate);
+    originNumber = int.parse(map['_originNumber'], onError:(_) => null);
     rootLibrary = map['rootLib'];
     if (map['entry'] != null) {
       entry = map['entry'];
     }
     var savedStartTime = startTime;
-    var startTimeInMillis = map['startTime'];
+    int startTimeInMillis = map['startTime'];
     startTime = new DateTime.fromMillisecondsSinceEpoch(startTimeInMillis);
     notifyPropertyChange(#upTime, 0, 1);
     var countersMap = map['_tagCounters'];
@@ -1250,24 +1405,16 @@
         }
       }
     }
-    var timerMap = {};
-    map['timers'].forEach((timer) {
-        timerMap[timer['name']] = timer['time'];
-      });
-    timers['total'] = timerMap['time_total_runtime'];
-    timers['compile'] = timerMap['time_compilation'];
-    timers['gc'] = 0.0;  // TODO(turnidge): Export this from VM.
-    timers['init'] = (timerMap['time_script_loading'] +
-                      timerMap['time_creating_snapshot'] +
-                      timerMap['time_isolate_initialization'] +
-                      timerMap['time_bootstrap']);
-    timers['dart'] = timerMap['time_dart_execution'];
 
     updateHeapsFromMap(map['_heaps']);
     _updateBreakpoints(map['breakpoints']);
     exceptionsPauseInfo = map['_debuggerSettings']['_exceptions'];
 
-    pauseEvent = map['pauseEvent'];
+    var newPauseEvent = map['pauseEvent'];
+    assert((pauseEvent == null) ||
+           (newPauseEvent == null) ||
+           !newPauseEvent.timestamp.isBefore(pauseEvent.timestamp));
+    pauseEvent = newPauseEvent;
     _updateRunState();
     error = map['error'];
 
@@ -1321,6 +1468,7 @@
   void _onEvent(ServiceEvent event) {
     switch(event.kind) {
       case ServiceEvent.kIsolateStart:
+      case ServiceEvent.kIsolateRunnable:
       case ServiceEvent.kIsolateExit:
       case ServiceEvent.kInspect:
         // Handled elsewhere.
@@ -1346,6 +1494,8 @@
       case ServiceEvent.kPauseInterrupted:
       case ServiceEvent.kPauseException:
       case ServiceEvent.kResume:
+        assert((pauseEvent == null) ||
+               !event.timestamp.isBefore(pauseEvent.timestamp));
         pauseEvent = event;
         _updateRunState();
         break;
@@ -1359,36 +1509,54 @@
         break;
 
       default:
-        // Log unrecognized events.
-        Logger.root.severe('Unrecognized event: $event');
+        // Log unexpected events.
+        Logger.root.severe('Unexpected event: $event');
         break;
     }
   }
 
-  Future<ServiceObject> addBreakpoint(Script script, int line) async {
+  Future<ServiceObject> addBreakpoint(
+      Script script, int line, [int col]) async {
     // TODO(turnidge): Pass line as an int instead of a string.
     try {
       Map params = {
         'scriptId': script.id,
-        'line': '$line',
+        'line': line.toString(),
       };
+      if (col != null) {
+        params['column'] = col.toString();
+      }
       Breakpoint bpt = await invokeRpc('addBreakpoint', params);
-      if (bpt.resolved &&
-          script.loaded &&
-          script.tokenToLine(bpt.location.tokenPos) != line) {
-        // TODO(turnidge): Can this still happen?
-        script.getLine(line).possibleBpt = false;
+      if (bpt.resolved && script.loaded) {
+        SourceLocation loc = bpt.location;
+        if (script.tokenToLine(loc.tokenPos) != line) {
+          script.getLine(line).possibleBpt = false;
+        }
       }
       return bpt;
     } on ServerRpcException catch(e) {
       if (e.code == ServerRpcException.kCannotAddBreakpoint) {
         // Unable to set a breakpoint at the desired line.
-        script.getLine(line).possibleBpt = false;
+        if (script.loaded) {
+          script.getLine(line).possibleBpt = false;
+        }
       }
       rethrow;
     }
   }
 
+  Future<ServiceObject> addBreakpointByScriptUri(
+      String uri, int line, [int col]) {
+    Map params = {
+      'scriptUri': uri,
+      'line': line.toString(),
+    };
+    if (col != null) {
+      params['column'] = col.toString();
+    }
+    return invokeRpc('addBreakpointWithScriptUri', params);
+  }
+
   Future<ServiceObject> addBreakpointAtEntry(ServiceFunction function) {
     return invokeRpc('addBreakpointAtEntry',
                      { 'functionId': function.id });
@@ -1489,8 +1657,8 @@
     return invokeRpc('setName', {'name': newName});
   }
 
-  Future setExceptionPauseInfo(String exceptions) {
-    return invokeRpc('_setExceptionPauseInfo', {'exceptions': exceptions});
+  Future setExceptionPauseMode(String mode) {
+    return invokeRpc('setExceptionPauseMode', {'mode': mode});
   }
 
   Future<ServiceMap> getStack() {
@@ -1624,7 +1792,7 @@
     _map.addAll(map);
 
     name = _map['name'];
-    vmName = (_map.containsKey('vmName') ? _map['vmName'] : name);
+    vmName = (_map.containsKey('_vmName') ? _map['_vmName'] : name);
   }
 
   // TODO(turnidge): These are temporary until we have a proper root
@@ -1692,7 +1860,9 @@
 /// A [ServiceEvent] is an asynchronous event notification from the vm.
 class ServiceEvent extends ServiceObject {
   /// The possible 'kind' values.
+  static const kVMUpdate               = 'VMUpdate';
   static const kIsolateStart           = 'IsolateStart';
+  static const kIsolateRunnable        = 'IsolateRunnable';
   static const kIsolateExit            = 'IsolateExit';
   static const kIsolateUpdate          = 'IsolateUpdate';
   static const kPauseStart             = 'PauseStart';
@@ -1718,10 +1888,12 @@
   }
 
   @observable String kind;
+  @observable DateTime timestamp;
   @observable Breakpoint breakpoint;
   @observable Frame topFrame;
   @observable Instance exception;
   @observable Instance asyncContinuation;
+  @observable bool atAsyncJump;
   @observable ServiceObject inspectee;
   @observable ByteData data;
   @observable int count;
@@ -1729,6 +1901,7 @@
   @observable String exceptions;
   @observable String bytesAsString;
   @observable Map logRecord;
+
   int chunkIndex, chunkCount, nodeCount;
 
   @observable bool get isPauseEvent {
@@ -1743,6 +1916,8 @@
     _loaded = true;
     _upgradeCollection(map, owner);
     assert(map['isolate'] == null || owner == map['isolate']);
+    timestamp =
+        new DateTime.fromMillisecondsSinceEpoch(map['timestamp']);
     kind = map['kind'];
     notifyPropertyChange(#isPauseEvent, 0, 1);
     name = 'ServiceEvent $kind';
@@ -1764,6 +1939,9 @@
     }
     if (map['_asyncContinuation'] != null) {
       asyncContinuation = map['_asyncContinuation'];
+      atAsyncJump = map['_atAsyncJump'];
+    } else {
+      atAsyncJump = false;
     }
     if (map['inspectee'] != null) {
       inspectee = map['inspectee'];
@@ -1794,17 +1972,19 @@
     if (map['logRecord'] != null) {
       logRecord = map['logRecord'];
       logRecord['time'] =
-          new DateTime.fromMillisecondsSinceEpoch(logRecord['time'].toInt());
+          new DateTime.fromMillisecondsSinceEpoch(logRecord['time']);
       logRecord['level'] = _findLogLevel(logRecord['level']);
     }
   }
 
   String toString() {
+    var ownerName = owner.id != null ? owner.id.toString() : owner.name;
     if (data == null) {
-      return "ServiceEvent(owner='${owner.id}', kind='${kind}')";
+      return "ServiceEvent(owner='${ownerName}', kind='${kind}', "
+          "time=${timestamp})";
     } else {
-      return "ServiceEvent(owner='${owner.id}', kind='${kind}', "
-          "data.lengthInBytes=${data.lengthInBytes})";
+      return "ServiceEvent(owner='${ownerName}', kind='${kind}', "
+          "data.lengthInBytes=${data.lengthInBytes}, time=${timestamp})";
     }
   }
 }
@@ -1820,8 +2000,11 @@
   // A unique integer identifier for this breakpoint.
   @observable int number;
 
-  // Source location information.
-  @observable SourceLocation location;
+  // Either SourceLocation or UnresolvedSourceLocation.
+  @observable Location location;
+
+  // The breakpoint is in a file which is not yet loaded.
+  @observable bool latent;
 
   // The breakpoint has been assigned to a final source location.
   @observable bool resolved;
@@ -1834,38 +2017,25 @@
     // number never changes.
     assert((number == null) || (number == newNumber));
     number = newNumber;
-
     resolved = map['resolved'];
 
     var oldLocation = location;
     var newLocation = map['location'];
-    var oldScript;
-    var newScript;
-    var oldTokenPos;
-    var newTokenPos;
-    if (oldLocation != null) {
-      oldScript = location.script;
-      oldTokenPos = location.tokenPos;
-    }
-    if (newLocation != null) {
-      newScript = newLocation.script;
-      newTokenPos = newLocation.tokenPos;
-    }
-    // script never changes
-    assert((oldScript == null) || (oldScript == newScript));
-    bool tokenPosChanged = oldTokenPos != newTokenPos;
-    if (newScript.loaded &&
-        (newTokenPos != null) &&
-        tokenPosChanged) {
-      // The breakpoint has moved.  Remove it and add it later.
-      if (oldScript != null) {
+    if (oldLocation is UnresolvedSourceLocation &&
+        newLocation is SourceLocation) {
+      // Breakpoint has been resolved.  Remove old breakpoint.
+      var oldScript = oldLocation.script;
+      if (oldScript != null && oldScript.loaded) {
         oldScript._removeBreakpoint(this);
       }
     }
     location = newLocation;
-    if (newScript.loaded && tokenPosChanged) {
+    var newScript = location.script;
+    if (newScript != null && newScript.loaded) {
       newScript._addBreakpoint(this);
     }
+
+    assert(resolved || location is UnresolvedSourceLocation);
   }
 
   void remove() {
@@ -1905,7 +2075,7 @@
 }
 
 
-class Library extends ServiceObject with Coverage {
+class Library extends HeapObject with Coverage {
   @observable String uri;
   @reflectable final dependencies = new ObservableList<LibraryDependency>();
   @reflectable final scripts = new ObservableList<Script>();
@@ -1919,6 +2089,9 @@
   Library._empty(ServiceObjectOwner owner) : super._empty(owner);
 
   void _update(ObservableMap map, bool mapIsRef) {
+    _upgradeCollection(map, isolate);
+    super._update(map, mapIsRef);
+
     uri = map['uri'];
     var shortUri = uri;
     if (uri.startsWith('file://') ||
@@ -1930,12 +2103,11 @@
       // When there is no name for a library, use the shortUri.
       name = shortUri;
     }
-    vmName = (map.containsKey('vmName') ? map['vmName'] : name);
+    vmName = (map.containsKey('_vmName') ? map['_vmName'] : name);
     if (mapIsRef) {
       return;
     }
     _loaded = true;
-    _upgradeCollection(map, isolate);
     dependencies.clear();
     dependencies.addAll(map["dependencies"].map(LibraryDependency._fromMap));
     scripts.clear();
@@ -2001,7 +2173,7 @@
   bool get empty => accumulated.empty && current.empty;
 }
 
-class Class extends ServiceObject with Coverage {
+class Class extends HeapObject with Coverage {
   @observable Library library;
 
   @observable bool isAbstract;
@@ -2034,8 +2206,14 @@
   Class._empty(ServiceObjectOwner owner) : super._empty(owner);
 
   void _update(ObservableMap map, bool mapIsRef) {
+    _upgradeCollection(map, isolate);
+    super._update(map, mapIsRef);
+
     name = map['name'];
-    vmName = (map.containsKey('vmName') ? map['vmName'] : name);
+    vmName = (map.containsKey('_vmName') ? map['_vmName'] : name);
+    if (vmName == '::') {
+      name = 'top-level-class';  // Better than ''
+    }
     var idPrefix = "classes/";
     assert(id.startsWith(idPrefix));
     vmCid = int.parse(id.substring(idPrefix.length));
@@ -2128,18 +2306,15 @@
   String toString() => 'Class($vmName)';
 }
 
-class Instance extends ServiceObject {
+class Instance extends HeapObject {
   @observable String kind;
-  @observable Class clazz;
-  @observable int size;
-  @observable int retainedSize;
   @observable String valueAsString;  // If primitive.
   @observable bool valueAsStringIsTruncated;
   @observable ServiceFunction function;  // If a closure.
   @observable Context context;  // If a closure.
   @observable String name;  // If a Type.
   @observable int length; // If a List, Map or TypedData.
-  @observable String pattern;  // If a RegExp.
+  @observable Instance pattern;  // If a RegExp.
 
   @observable var typeClass;
   @observable var fields;
@@ -2155,6 +2330,8 @@
   @observable Function twoByteFunction;  // If a RegExp.
   @observable Function externalOneByteFunction;  // If a RegExp.
   @observable Function externalTwoByteFunction;  // If a RegExp.
+  @observable bool isCaseSensitive;  // If a RegExp.
+  @observable bool isMultiLine;  // If a RegExp.
 
   bool get isAbstractType {
     return (kind == 'Type' || kind == 'TypeRef' ||
@@ -2183,10 +2360,16 @@
         || kind == 'Float32x4List'
         || kind == 'Float64x2List';
   }
+  bool get isSimdValue {
+    return kind == 'Float32x4'
+        || kind == 'Float64x2'
+        || kind == 'Int32x4';
+  }
   bool get isRegExp => kind == 'RegExp';
   bool get isMirrorReference => kind == 'MirrorReference';
   bool get isWeakProperty => kind == 'WeakProperty';
   bool get isClosure => kind == 'Closure';
+  bool get isStackTrace => kind == 'StackTrace';
 
   // TODO(turnidge): Is this properly backwards compatible when new
   // instance kinds are added?
@@ -2197,9 +2380,9 @@
   void _update(ObservableMap map, bool mapIsRef) {
     // Extract full properties.
     _upgradeCollection(map, isolate);
+    super._update(map, mapIsRef);
 
     kind = map['kind'];
-    clazz = map['class'];
     valueAsString = map['valueAsString'];
     // Coerce absence to false.
     valueAsStringIsTruncated = map['valueAsStringIsTruncated'] == true;
@@ -2213,8 +2396,8 @@
       return;
     }
 
-    size = map['size'];
-
+    isCaseSensitive = map['isCaseSensitive'];
+    isMultiLine = map['isMultiLine'];
     oneByteFunction = map['_oneByteFunction'];
     twoByteFunction = map['_twoByteFunction'];
     externalOneByteFunction = map['_externalOneByteFunction'];
@@ -2285,10 +2468,7 @@
 }
 
 
-class Context extends ServiceObject {
-  @observable Class clazz;
-  @observable int size;
-
+class Context extends HeapObject {
   @observable var parentContext;
   @observable int length;
   @observable var variables;
@@ -2298,6 +2478,7 @@
   void _update(ObservableMap map, bool mapIsRef) {
     // Extract full properties.
     _upgradeCollection(map, isolate);
+    super._update(map, mapIsRef);
 
     length = map['length'];
     parentContext = map['parent'];
@@ -2306,8 +2487,6 @@
       return;
     }
 
-    size = map['size'];
-    clazz = map['class'];
     variables = map['variables'];
 
     // We are fully loaded.
@@ -2346,6 +2525,7 @@
       case 'Native': return kNative;
       case 'Stub': return kStub;
       case 'Tag': return kTag;
+      case 'SignatureFunction': return kSignatureFunction;
     }
     Logger.root.severe('Unrecognized function kind: $value');
     throw new FallThroughError();
@@ -2368,10 +2548,11 @@
   static FunctionKind kNative = new FunctionKind._internal('Native');
   static FunctionKind kTag = new FunctionKind._internal('Tag');
   static FunctionKind kStub = new FunctionKind._internal('Stub');
+  static FunctionKind kSignatureFunction = new FunctionKind._internal('SignatureFunction');
   static FunctionKind kUNKNOWN = new FunctionKind._internal('UNKNOWN');
 }
 
-class ServiceFunction extends ServiceObject with Coverage {
+class ServiceFunction extends HeapObject with Coverage {
   // owner is a Library, Class, or ServiceFunction.
   @observable ServiceObject dartOwner;
   @observable Library library;
@@ -2396,10 +2577,11 @@
   ServiceFunction._empty(ServiceObject owner) : super._empty(owner);
 
   void _update(ObservableMap map, bool mapIsRef) {
-    name = map['name'];
-    vmName = (map.containsKey('vmName') ? map['vmName'] : name);
-
     _upgradeCollection(map, isolate);
+    super._update(map, mapIsRef);
+
+    name = map['name'];
+    vmName = (map.containsKey('_vmName') ? map['_vmName'] : name);
 
     dartOwner = map['owner'];
     kind = FunctionKind.fromJSON(map['_kind']);
@@ -2439,7 +2621,7 @@
 }
 
 
-class Field extends ServiceObject {
+class Field extends HeapObject {
   // Library or Class.
   @observable ServiceObject dartOwner;
   @observable Library library;
@@ -2461,9 +2643,10 @@
   void _update(ObservableMap map, bool mapIsRef) {
     // Extract full properties.
     _upgradeCollection(map, isolate);
+    super._update(map, mapIsRef);
 
     name = map['name'];
-    vmName = (map.containsKey('vmName') ? map['vmName'] : name);
+    vmName = (map.containsKey('_vmName') ? map['_vmName'] : name);
     dartOwner = map['owner'];
     declaredType = map['declaredType'];
     isStatic = map['static'];
@@ -2633,7 +2816,7 @@
   LocalVarLocation(this.line, this.column, this.endColumn);
 }
 
-class Script extends ServiceObject with Coverage {
+class Script extends HeapObject with Coverage {
   Set<CallSite> callSites = new Set<CallSite>();
   final lines = new ObservableList<ScriptLine>();
   final _hits = new Map<int, int>();
@@ -2658,15 +2841,80 @@
   }
 
   /// This function maps a token position to a line number.
-  int tokenToLine(int token) => _tokenToLine[token];
+  int tokenToLine(int tokenPos) => _tokenToLine[tokenPos];
   Map _tokenToLine = {};
 
   /// This function maps a token position to a column number.
-  int tokenToCol(int token) => _tokenToCol[token];
+  int tokenToCol(int tokenPos) => _tokenToCol[tokenPos];
   Map _tokenToCol = {};
 
+  int guessTokenLength(int line, int column) {
+    String source = getLine(line).text;
+
+    var pos = column;
+    if (pos >= source.length) {
+      return null;
+    }
+
+    var c = source.codeUnitAt(pos);
+    if (c == 123) return 1; // { - Map literal
+
+    if (c == 91) return 1;  // [ - List literal, index, index assignment
+
+    if (c == 40) return 1;  // ( - Closure call
+
+    if (_isOperatorChar(c)) {
+      while (++pos < source.length &&
+             _isOperatorChar(source.codeUnitAt(pos)));
+      return pos - column;
+    }
+
+    if (_isInitialIdentifierChar(c)) {
+      while (++pos < source.length &&
+             _isIdentifierChar(source.codeUnitAt(pos)));
+      return pos - column;
+    }
+
+    return null;
+  }
+
+  static bool _isOperatorChar(int c) {
+    switch (c) {
+    case 25: // %
+    case 26: // &
+    case 42: // *
+    case 43: // +
+    case 45: // -:
+    case 47: // /
+    case 60: // <
+    case 61: // =
+    case 62: // >
+    case 94: // ^
+    case 124: // |
+    case 126: // ~
+      return true;
+    default:
+      return false;
+    }
+  }
+
+  static bool _isInitialIdentifierChar(int c) {
+    if (c >= 65 && c <= 90) return true; // Upper
+    if (c >= 97 && c <= 122) return true; // Lower
+    if (c == 95) return true; // Underscore
+    if (c == 36) return true; // Dollar
+    return false;
+  }
+
+  static bool _isIdentifierChar(int c) {
+    if (_isInitialIdentifierChar(c)) return true;
+    return c >= 48 && c <= 75; // Digit
+  }
+
   void _update(ObservableMap map, bool mapIsRef) {
     _upgradeCollection(map, isolate);
+    super._update(map, mapIsRef);
+
     uri = map['uri'];
     kind = map['_kind'];
     _shortUri = uri.substring(uri.lastIndexOf('/') + 1);
@@ -2780,12 +3028,24 @@
   }
 
   void _addBreakpoint(Breakpoint bpt) {
-    var line = tokenToLine(bpt.location.tokenPos);
+    var line;
+    if (bpt.location.tokenPos != null) {
+      line = tokenToLine(bpt.location.tokenPos);
+    } else {
+      UnresolvedSourceLocation loc = bpt.location;
+      line = loc.line;
+    }
     getLine(line).addBreakpoint(bpt);
   }
 
   void _removeBreakpoint(Breakpoint bpt) {
-    var line = tokenToLine(bpt.location.tokenPos);
+    var line;
+    if (bpt.location.tokenPos != null) {
+      line = tokenToLine(bpt.location.tokenPos);
+    } else {
+      UnresolvedSourceLocation loc = bpt.location;
+      line = loc.line;
+    }
     if (line != null) {
       getLine(line).removeBreakpoint(bpt);
     }
@@ -3038,15 +3298,15 @@
 
   ObjectPool._empty(ServiceObjectOwner owner) : super._empty(owner);
 
-  void _update(ObservableMap m, bool mapIsRef) {
-    _upgradeCollection(m, isolate);
-    clazz = m['class'];
-    length = m['length'];
+  void _update(ObservableMap map, bool mapIsRef) {
+    _upgradeCollection(map, isolate);
+    super._update(map, mapIsRef);
+
+    length = map['length'];
     if (mapIsRef) {
       return;
     }
-    size = m['size'];
-    entries = m['_entries'];
+    entries = map['_entries'];
   }
 }
 
@@ -3061,17 +3321,39 @@
 
   ICData._empty(ServiceObjectOwner owner) : super._empty(owner);
 
-  void _update(ObservableMap m, bool mapIsRef) {
-    _upgradeCollection(m, isolate);
-    clazz = m['class'];
-    dartOwner = m['_owner'];
-    selector = m['_selector'];
+  void _update(ObservableMap map, bool mapIsRef) {
+    _upgradeCollection(map, isolate);
+    super._update(map, mapIsRef);
+
+    dartOwner = map['_owner'];
+    selector = map['_selector'];
     if (mapIsRef) {
       return;
     }
-    size = m['size'];
-    argumentsDescriptor = m['_argumentsDescriptor'];
-    entries = m['_entries'];
+    argumentsDescriptor = map['_argumentsDescriptor'];
+    entries = map['_entries'];
+  }
+}
+
+class MegamorphicCache extends HeapObject {
+  @observable int mask;
+  @observable Instance buckets;
+
+  bool get canCache => false;
+  bool get immutable => false;
+
+  MegamorphicCache._empty(ServiceObjectOwner owner) : super._empty(owner);
+
+  void _update(ObservableMap map, bool mapIsRef) {
+    _upgradeCollection(map, isolate);
+    super._update(map, mapIsRef);
+
+    if (mapIsRef) {
+      return;
+    }
+
+    mask = map['_mask'];
+    buckets = map['_buckets'];
   }
 }
 
@@ -3084,15 +3366,15 @@
 
   Instructions._empty(ServiceObjectOwner owner) : super._empty(owner);
 
-  void _update(ObservableMap m, bool mapIsRef) {
-    _upgradeCollection(m, isolate);
-    clazz = m['class'];
-    code = m['_code'];
+  void _update(ObservableMap map, bool mapIsRef) {
+    _upgradeCollection(map, isolate);
+    super._update(map, mapIsRef);
+
+    code = map['_code'];
     if (mapIsRef) {
       return;
     }
-    size = m['size'];
-    objectPool = m['_objectPool'];
+    objectPool = map['_objectPool'];
   }
 }
 
@@ -3104,14 +3386,14 @@
 
   TokenStream._empty(ServiceObjectOwner owner) : super._empty(owner);
 
-  void _update(ObservableMap m, bool mapIsRef) {
+  void _update(ObservableMap map, bool mapIsRef) {
+    _upgradeCollection(map, isolate);
+    super._update(map, mapIsRef);
+
     if (mapIsRef) {
       return;
     }
-    _upgradeCollection(m, isolate);
-    clazz = m['class'];
-    size = m['size'];
-    privateKey = m['privateKey'];
+    privateKey = map['privateKey'];
   }
 }
 
@@ -3282,14 +3564,13 @@
 
   void _update(ObservableMap m, bool mapIsRef) {
     name = m['name'];
-    vmName = (m.containsKey('vmName') ? m['vmName'] : name);
+    vmName = (m.containsKey('_vmName') ? m['_vmName'] : name);
     isOptimized = m['_optimized'];
     kind = CodeKind.fromString(m['kind']);
     if (mapIsRef) {
       return;
     }
     _loaded = true;
-    size = m['size'];
     startAddress = int.parse(m['_startAddress'], radix:16);
     endAddress = int.parse(m['_endAddress'], radix:16);
     function = isolate.getFromMap(m['function']);
@@ -3324,6 +3605,9 @@
       return;
     }
     _processInline(inlinedFunctionsTable, inlinedIntervals);
+
+    _upgradeCollection(m, isolate);
+    super._update(m, mapIsRef);
   }
 
   CodeInlineInterval findInterval(int pc) {
@@ -3639,7 +3923,7 @@
     this.variables = map['vars'];
   }
 
-  String toString() => "Frame(${function.qualifiedName})";
+  String toString() => "Frame(${function.qualifiedName} $location)";
 }
 
 
diff --git a/runtime/observatory/maintainers/pubspec.template b/runtime/observatory/maintainers/pubspec.template
index daed864..87154f3 100644
--- a/runtime/observatory/maintainers/pubspec.template
+++ b/runtime/observatory/maintainers/pubspec.template
@@ -7,12 +7,14 @@
     inline_stylesheets:
       lib/src/elements/css/shared.css: false
 - $dart2js:
+    $include: "**/*.polymer.bootstrap.dart"
     suppressWarnings: false
-    $exclude: web/main.dart
     commandLineOptions: [--show-package-warnings]
 dependencies:
   args: any
-  charted: any
+  charted: ^0.2.9
   polymer: any
   unittest: < 0.12.0
   usage: any
+  code_transformers: 0.2.9
+
diff --git a/runtime/observatory/observatory.gypi b/runtime/observatory/observatory.gypi
index 50cd334..4971524 100644
--- a/runtime/observatory/observatory.gypi
+++ b/runtime/observatory/observatory.gypi
@@ -30,6 +30,7 @@
           'action': [
             'python',
             '../tools/observatory_tool.py',
+            '--sdk=True',
             '--package-root', '<(PRODUCT_DIR)/packages',
             '--dart-executable',
             '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)dart_bootstrap<(EXECUTABLE_SUFFIX)',
@@ -63,6 +64,7 @@
           'action': [
             'python',
             '../tools/observatory_tool.py',
+            '--sdk=True',
             '--package-root', '<(PRODUCT_DIR)/packages',
             '--dart-executable',
             '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)dart_bootstrap<(EXECUTABLE_SUFFIX)',
@@ -83,6 +85,7 @@
           'action': [
             'python',
             '../tools/observatory_tool.py',
+            '--sdk=True',
             '--package-root', '<(PRODUCT_DIR)/packages',
             '--dart-executable',
             '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)dart_bootstrap<(EXECUTABLE_SUFFIX)',
diff --git a/runtime/observatory/observatory_sources.gypi b/runtime/observatory/observatory_sources.gypi
index e02a5e7..630ca4c 100644
--- a/runtime/observatory/observatory_sources.gypi
+++ b/runtime/observatory/observatory_sources.gypi
@@ -19,7 +19,6 @@
     'lib/service_html.dart',
     'lib/src/app/analytics.dart',
     'lib/src/app/application.dart',
-    'lib/src/app/chart.dart',
     'lib/src/app/location_manager.dart',
     'lib/src/app/page.dart',
     'lib/src/app/settings.dart',
@@ -105,6 +104,8 @@
     'lib/src/elements/library_view.html',
     'lib/src/elements/logging.dart',
     'lib/src/elements/logging.html',
+    'lib/src/elements/megamorphiccache_view.dart',
+    'lib/src/elements/megamorphiccache_view.html',
     'lib/src/elements/metrics.dart',
     'lib/src/elements/metrics.html',
     'lib/src/elements/nav_bar.dart',
diff --git a/runtime/observatory/pubspec.yaml b/runtime/observatory/pubspec.yaml
index 294aa1d..ade59b1 100644
--- a/runtime/observatory/pubspec.yaml
+++ b/runtime/observatory/pubspec.yaml
@@ -1,3 +1,4 @@
+# Generated file DO NOT EDIT
 name: observatory
 version: 1.6.0-dev.1
 transformers:
@@ -6,90 +7,99 @@
     - web/index.html
     inline_stylesheets:
       lib/src/elements/css/shared.css: false
+      packages/charted/charts/themes/quantum_theme.css: false
 - $dart2js:
     $include: "**/*.polymer.bootstrap.dart"
     suppressWarnings: false
     commandLineOptions: [--show-package-warnings]
 dependencies:
   args: any
-  charted: any
-  polymer: any
+  charted: ^0.2.9
+  polymer: ^0.16.3
   unittest: < 0.12.0
   usage: any
 dependency_overrides:
   analyzer:
-    path: ../../third_party/observatory_pub_packages/analyzer
+    path: ../../third_party/observatory_pub_packages/packages/analyzer
   args:
-    path: ../../third_party/observatory_pub_packages/args
+    path: ../../third_party/observatory_pub_packages/packages/args
+  async:
+    path: ../../third_party/observatory_pub_packages/packages/async
   barback:
-    path: ../../third_party/observatory_pub_packages/barback
+    path: ../../third_party/observatory_pub_packages/packages/barback
   browser:
-    path: ../../third_party/observatory_pub_packages/browser
+    path: ../../third_party/observatory_pub_packages/packages/browser
+  charcode:
+    path: ../../third_party/observatory_pub_packages/packages/charcode
   charted:
-    path: ../../third_party/observatory_pub_packages/charted
+    path: ../../third_party/observatory_pub_packages/packages/charted
   cli_util:
-    path: ../../third_party/observatory_pub_packages/cli_util
+    path: ../../third_party/observatory_pub_packages/packages/cli_util
   code_transformers:
-    path: ../../third_party/observatory_pub_packages/code_transformers
+    path: ../../third_party/observatory_pub_packages/packages/code_transformers
   collection:
-    path: ../../third_party/observatory_pub_packages/collection
+    path: ../../third_party/observatory_pub_packages/packages/collection
   csslib:
-    path: ../../third_party/observatory_pub_packages/csslib
+    path: ../../third_party/observatory_pub_packages/packages/csslib
   dart_style:
-    path: ../../third_party/observatory_pub_packages/dart_style
+    path: ../../third_party/observatory_pub_packages/packages/dart_style
   glob:
-    path: ../../third_party/observatory_pub_packages/glob
+    path: ../../third_party/observatory_pub_packages/packages/glob
   html:
-    path: ../../third_party/observatory_pub_packages/html
+    path: ../../third_party/observatory_pub_packages/packages/html
   initialize:
-    path: ../../third_party/observatory_pub_packages/initialize
+    path: ../../third_party/observatory_pub_packages/packages/initialize
   intl:
-    path: ../../third_party/observatory_pub_packages/intl
+    path: ../../third_party/observatory_pub_packages/packages/intl
   logging:
-    path: ../../third_party/observatory_pub_packages/logging
+    path: ../../third_party/observatory_pub_packages/packages/logging
   matcher:
-    path: ../../third_party/observatory_pub_packages/matcher
+    path: ../../third_party/observatory_pub_packages/packages/matcher
   observe:
-    path: ../../third_party/observatory_pub_packages/observe
+    path: ../../third_party/observatory_pub_packages/packages/observe
+  package_config:
+    path: ../../third_party/observatory_pub_packages/packages/package_config
   path:
-    path: ../../third_party/observatory_pub_packages/path
+    path: ../../third_party/observatory_pub_packages/packages/path
   petitparser:
-    path: ../../third_party/observatory_pub_packages/petitparser
+    path: ../../third_party/observatory_pub_packages/packages/petitparser
+  plugin:
+    path: ../../third_party/observatory_pub_packages/packages/plugin
   polymer:
-    path: ../../third_party/observatory_pub_packages/polymer
+    path: ../../third_party/observatory_pub_packages/packages/polymer
   polymer_expressions:
-    path: ../../third_party/observatory_pub_packages/polymer_expressions
+    path: ../../third_party/observatory_pub_packages/packages/polymer_expressions
   polymer_interop:
-    path: ../../third_party/observatory_pub_packages/polymer_interop
+    path: ../../third_party/observatory_pub_packages/packages/polymer_interop
   pool:
-    path: ../../third_party/observatory_pub_packages/pool
+    path: ../../third_party/observatory_pub_packages/packages/pool
   quiver:
-    path: ../../third_party/observatory_pub_packages/quiver
+    path: ../../third_party/observatory_pub_packages/packages/quiver
   smoke:
-    path: ../../third_party/observatory_pub_packages/smoke
+    path: ../../third_party/observatory_pub_packages/packages/smoke
   source_maps:
-    path: ../../third_party/observatory_pub_packages/source_maps
+    path: ../../third_party/observatory_pub_packages/packages/source_maps
   source_span:
-    path: ../../third_party/observatory_pub_packages/source_span
+    path: ../../third_party/observatory_pub_packages/packages/source_span
   stack_trace:
-    path: ../../third_party/observatory_pub_packages/stack_trace
+    path: ../../third_party/observatory_pub_packages/packages/stack_trace
   string_scanner:
-    path: ../../third_party/observatory_pub_packages/string_scanner
+    path: ../../third_party/observatory_pub_packages/packages/string_scanner
   template_binding:
-    path: ../../third_party/observatory_pub_packages/template_binding
+    path: ../../third_party/observatory_pub_packages/packages/template_binding
   unittest:
-    path: ../../third_party/observatory_pub_packages/unittest
+    path: ../../third_party/observatory_pub_packages/packages/unittest
   usage:
-    path: ../../third_party/observatory_pub_packages/usage
+    path: ../../third_party/observatory_pub_packages/packages/usage
   utf:
-    path: ../../third_party/observatory_pub_packages/utf
+    path: ../../third_party/observatory_pub_packages/packages/utf
   watcher:
-    path: ../../third_party/observatory_pub_packages/watcher
+    path: ../../third_party/observatory_pub_packages/packages/watcher
   web_components:
-    path: ../../third_party/observatory_pub_packages/web_components
+    path: ../../third_party/observatory_pub_packages/packages/web_components
   when:
-    path: ../../third_party/observatory_pub_packages/when
+    path: ../../third_party/observatory_pub_packages/packages/when
   which:
-    path: ../../third_party/observatory_pub_packages/which
+    path: ../../third_party/observatory_pub_packages/packages/which
   yaml:
-    path: ../../third_party/observatory_pub_packages/yaml
+    path: ../../third_party/observatory_pub_packages/packages/yaml
diff --git a/runtime/observatory/tests/service/add_breakpoint_rpc_test.dart b/runtime/observatory/tests/service/add_breakpoint_rpc_test.dart
new file mode 100644
index 0000000..a51a2b3
--- /dev/null
+++ b/runtime/observatory/tests/service/add_breakpoint_rpc_test.dart
@@ -0,0 +1,214 @@
+// 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/service_io.dart';
+import 'package:unittest/unittest.dart';
+import 'test_helper.dart';
+import 'deferred_library.dart' deferred as deferredLib;
+import 'dart:async';
+
+int value = 0;
+
+int incValue(int amount) {
+  value += amount;
+  return amount;
+}
+
+Future testMain() async {
+  incValue(incValue(1));  // line 20
+
+  incValue(incValue(1));  // line 22
+
+  await deferredLib.loadLibrary();
+  deferredLib.deferredTest();
+}
+
+var tests = [
+  hasPausedAtStart,
+
+  // Test future breakpoints.
+  (Isolate isolate) async {
+    var rootLib = isolate.rootLibrary;
+    await rootLib.load();
+    var script = rootLib.scripts[0];
+
+    // Future breakpoint.
+    var futureBpt1 = await isolate.addBreakpoint(script, 20);
+    expect(futureBpt1.number, equals(1));
+    expect(futureBpt1.resolved, isFalse);
+    expect(await futureBpt1.location.getLine(), equals(20));
+    expect(await futureBpt1.location.getColumn(), equals(null));
+
+    // Future breakpoint with specific column.
+    var futureBpt2 = await isolate.addBreakpoint(script, 20, 3);
+    expect(futureBpt2.number, equals(2));
+    expect(futureBpt2.resolved, isFalse);
+    expect(await futureBpt2.location.getLine(), equals(20));
+    expect(await futureBpt2.location.getColumn(), equals(3));
+
+    var stream = await isolate.vm.getEventStream(VM.kDebugStream);
+    Completer completer = new Completer();
+    var subscription;
+    var resolvedCount = 0;
+    subscription = stream.listen((ServiceEvent event) async {
+      if (event.kind == ServiceEvent.kBreakpointResolved) {
+        resolvedCount++;
+      }
+      if (event.kind == ServiceEvent.kPauseBreakpoint) {
+        subscription.cancel();
+        completer.complete(null);
+      }
+    });
+    await isolate.resume();
+    await completer.future;
+
+    // After resolution the breakpoints have assigned line & column.
+    expect(resolvedCount, equals(2));
+    expect(futureBpt1.resolved, isTrue);
+    expect(await futureBpt1.location.getLine(), equals(20));
+    expect(await futureBpt1.location.getColumn(), equals(12));
+    expect(futureBpt2.resolved, isTrue);
+    expect(await futureBpt2.location.getLine(), equals(20));
+    expect(await futureBpt2.location.getColumn(), equals(3));
+
+    // The first breakpoint hits before value is modified.
+    expect((await rootLib.evaluate('value')).valueAsString, equals('0'));
+
+    stream = await isolate.vm.getEventStream(VM.kDebugStream);
+    completer = new Completer();
+    subscription = stream.listen((ServiceEvent event) async {
+      if (event.kind == ServiceEvent.kPauseBreakpoint) {
+        subscription.cancel();
+        completer.complete(null);
+      }
+    });
+    await isolate.resume();
+    await completer.future;
+
+    // The second breakpoint hits after value has been modified once.
+    expect((await rootLib.evaluate('value')).valueAsString, equals('1'));
+
+    // Remove the breakpoints.
+    expect((await isolate.removeBreakpoint(futureBpt1)).type,
+           equals('Success'));
+    expect((await isolate.removeBreakpoint(futureBpt2)).type,
+           equals('Success'));
+  },
+
+  // Test breakpoints in deferred libraries (latent breakpoints).
+  (Isolate isolate) async {
+    var rootLib = isolate.rootLibrary;
+    var uri = rootLib.scripts[0].uri;
+    var lastSlashPos = uri.lastIndexOf('/');
+    var deferredUri =uri.substring(0, lastSlashPos) + '/deferred_library.dart';
+
+    // Latent breakpoint.
+    var latentBpt1 = await isolate.addBreakpointByScriptUri(deferredUri, 15);
+    expect(latentBpt1.number, equals(3));
+    expect(latentBpt1.resolved, isFalse);
+    expect(await latentBpt1.location.getLine(), equals(15));
+    expect(await latentBpt1.location.getColumn(), equals(null));
+
+    // Latent breakpoint with specific column.
+    var latentBpt2 =
+    await isolate.addBreakpointByScriptUri(deferredUri, 15, 3);
+    expect(latentBpt2.number, equals(4));
+    expect(latentBpt2.resolved, isFalse);
+    expect(await latentBpt2.location.getLine(), equals(15));
+    expect(await latentBpt2.location.getColumn(), equals(3));
+
+    var stream = await isolate.vm.getEventStream(VM.kDebugStream);
+    Completer completer = new Completer();
+    var subscription;
+    var resolvedCount = 0;
+    subscription = stream.listen((ServiceEvent event) async {
+      if (event.kind == ServiceEvent.kBreakpointResolved) {
+        resolvedCount++;
+      }
+      if (event.kind == ServiceEvent.kPauseBreakpoint) {
+        subscription.cancel();
+        completer.complete(null);
+      }
+    });
+    await isolate.resume();
+    await completer.future;
+
+    // After resolution the breakpoints have assigned line & column.
+    expect(resolvedCount, equals(2));
+    expect(latentBpt1.resolved, isTrue);
+    expect(await latentBpt1.location.getLine(), equals(15));
+    expect(await latentBpt1.location.getColumn(), equals(12));
+    expect(latentBpt2.resolved, isTrue);
+    expect(await latentBpt2.location.getLine(), equals(15));
+    expect(await latentBpt2.location.getColumn(), equals(3));
+
+    // The first breakpoint hits before value is modified.
+    expect((await rootLib.evaluate('deferredLib.value')).valueAsString,
+           equals('0'));
+
+    stream = await isolate.vm.getEventStream(VM.kDebugStream);
+    completer = new Completer();
+    subscription = stream.listen((ServiceEvent event) async {
+      if (event.kind == ServiceEvent.kPauseBreakpoint) {
+        subscription.cancel();
+        completer.complete(null);
+      }
+    });
+    await isolate.resume();
+    await completer.future;
+
+    // The second breakpoint hits after value has been modified once.
+    expect((await rootLib.evaluate('deferredLib.value')).valueAsString,
+           equals('-1'));
+
+    // Remove the breakpoints.
+    expect((await isolate.removeBreakpoint(latentBpt1)).type,
+           equals('Success'));
+    expect((await isolate.removeBreakpoint(latentBpt2)).type,
+           equals('Success'));
+  },
+
+
+  // Test resolution of column breakpoints.
+  (Isolate isolate) async {
+    var script = isolate.rootLibrary.scripts[0];
+    // Try all columns, including some columns that are too big.
+    for (int col = 1; col <= 50; col++) {
+      var bpt = await isolate.addBreakpoint(script, 20, col);
+      expect(bpt.resolved, isTrue);
+      int resolvedLine = await bpt.location.getLine();
+      int resolvedCol = await bpt.location.getColumn();
+      print('20:${col} -> ${resolvedLine}:${resolvedCol}');
+      if (col <= 10) {
+        expect(resolvedLine, equals(20));
+        expect(resolvedCol, equals(3));
+      } else if (col <= 19) {
+        expect(resolvedLine, equals(20));
+        expect(resolvedCol, equals(12));
+      } else {
+        expect(resolvedLine, equals(22));
+        expect(resolvedCol, equals(12));
+      }
+      expect((await isolate.removeBreakpoint(bpt)).type, equals('Success'));
+    }
+
+    // Make sure that a zero column is an error.
+    var caughtException = false;
+    try {
+      await isolate.addBreakpoint(script, 20, 0);
+      expect(false, isTrue, reason:'Unreachable');
+    } on ServerRpcException catch(e) {
+      caughtException = true;
+      expect(e.code, equals(ServerRpcException.kInvalidParams));
+      expect(e.message,
+             "addBreakpoint: invalid 'column' parameter: 0");
+    }
+    expect(caughtException, isTrue);
+  },
+];
+
+main(args) => runIsolateTests(args, tests,
+                              testeeConcurrent: testMain,
+                              pause_on_start: true);
diff --git a/runtime/observatory/tests/service/allocations_test.dart b/runtime/observatory/tests/service/allocations_test.dart
index 6cd953f..fc0e09f 100644
--- a/runtime/observatory/tests/service/allocations_test.dart
+++ b/runtime/observatory/tests/service/allocations_test.dart
@@ -1,7 +1,7 @@
 // Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
-// VMOptions=--compile_all --error_on_bad_type --error_on_bad_override
+// VMOptions=--error_on_bad_type --error_on_bad_override
 
 library allocations_test;
 
diff --git a/runtime/observatory/tests/service/async_continuation_test.dart b/runtime/observatory/tests/service/async_continuation_test.dart
index 781f7ca..dfbad2d 100644
--- a/runtime/observatory/tests/service/async_continuation_test.dart
+++ b/runtime/observatory/tests/service/async_continuation_test.dart
@@ -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.
-// VMOptions=--compile_all --error_on_bad_type --error_on_bad_override --verbose-debug
+// VMOptions=--error_on_bad_type --error_on_bad_override --verbose-debug
 
 import 'dart:async';
 import 'dart:developer';
diff --git a/runtime/observatory/tests/service/async_generator_breakpoint_test.dart b/runtime/observatory/tests/service/async_generator_breakpoint_test.dart
index 474b54b..7a26e42 100644
--- a/runtime/observatory/tests/service/async_generator_breakpoint_test.dart
+++ b/runtime/observatory/tests/service/async_generator_breakpoint_test.dart
@@ -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.
-// VMOptions=--compile_all --error_on_bad_type --error_on_bad_override --verbose-debug
+// VMOptions=--error_on_bad_type --error_on_bad_override --verbose-debug
 
 import 'package:observatory/service_io.dart';
 import 'package:unittest/unittest.dart';
diff --git a/runtime/observatory/tests/service/async_next_test.dart b/runtime/observatory/tests/service/async_next_test.dart
index 2e9a0f2..9e298f7 100644
--- a/runtime/observatory/tests/service/async_next_test.dart
+++ b/runtime/observatory/tests/service/async_next_test.dart
@@ -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.
-// VMOptions=--compile_all --error_on_bad_type --error_on_bad_override  --verbose_debug
+// VMOptions=--error_on_bad_type --error_on_bad_override  --verbose_debug
 
 import 'package:observatory/service_io.dart';
 import 'test_helper.dart';
diff --git a/runtime/observatory/tests/service/async_scope_test.dart b/runtime/observatory/tests/service/async_scope_test.dart
index 981ea26..a3f97cc 100644
--- a/runtime/observatory/tests/service/async_scope_test.dart
+++ b/runtime/observatory/tests/service/async_scope_test.dart
@@ -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.
-// VMOptions=--compile_all --error_on_bad_type --error_on_bad_override
+// VMOptions=--error_on_bad_type --error_on_bad_override
 
 import 'dart:developer';
 import 'package:observatory/service_io.dart';
diff --git a/runtime/observatory/tests/service/bad_web_socket_address_test.dart b/runtime/observatory/tests/service/bad_web_socket_address_test.dart
index 946a596..2417d02 100644
--- a/runtime/observatory/tests/service/bad_web_socket_address_test.dart
+++ b/runtime/observatory/tests/service/bad_web_socket_address_test.dart
@@ -1,7 +1,7 @@
 // Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
-// VMOptions=--compile_all --error_on_bad_type --error_on_bad_override
+// VMOptions=--error_on_bad_type --error_on_bad_override
 
 import 'package:logging/logging.dart';
 import "package:observatory/service_io.dart";
diff --git a/runtime/observatory/tests/service/break_on_activation_test.dart b/runtime/observatory/tests/service/break_on_activation_test.dart
index 7de3d76..6291de5 100644
--- a/runtime/observatory/tests/service/break_on_activation_test.dart
+++ b/runtime/observatory/tests/service/break_on_activation_test.dart
@@ -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.
-// VMOptions=--compile_all --error_on_bad_type --error_on_bad_override
+// VMOptions=--error_on_bad_type --error_on_bad_override
 
 import 'package:observatory/service_io.dart';
 import 'package:unittest/unittest.dart';
diff --git a/runtime/observatory/tests/service/break_on_function_test.dart b/runtime/observatory/tests/service/break_on_function_test.dart
index 1988578..1a0e0ee 100644
--- a/runtime/observatory/tests/service/break_on_function_test.dart
+++ b/runtime/observatory/tests/service/break_on_function_test.dart
@@ -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.
-// VMOptions=--compile_all --error_on_bad_type --error_on_bad_override  --verbose_debug
+// VMOptions=--error_on_bad_type --error_on_bad_override  --verbose_debug
 
 import 'package:observatory/service_io.dart';
 import 'package:unittest/unittest.dart';
diff --git a/runtime/observatory/tests/service/caching_test.dart b/runtime/observatory/tests/service/caching_test.dart
index 196bab4..8a72447 100644
--- a/runtime/observatory/tests/service/caching_test.dart
+++ b/runtime/observatory/tests/service/caching_test.dart
@@ -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.
-// VMOptions=--compile_all --error_on_bad_type --error_on_bad_override
+// VMOptions=--error_on_bad_type --error_on_bad_override
 
 // If caching is working properly, the coverage data will go into the same
 // Script object from which we requested coverage data, instead of a new
diff --git a/runtime/observatory/tests/service/code_test.dart b/runtime/observatory/tests/service/code_test.dart
index bffbb79..5a3af8c 100644
--- a/runtime/observatory/tests/service/code_test.dart
+++ b/runtime/observatory/tests/service/code_test.dart
@@ -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.
-// VMOptions=--compile_all --error_on_bad_type --error_on_bad_override
+// VMOptions=--error_on_bad_type --error_on_bad_override
 
 import 'package:observatory/service_io.dart';
 import 'package:unittest/unittest.dart';
diff --git a/runtime/observatory/tests/service/command_test.dart b/runtime/observatory/tests/service/command_test.dart
index 69ac08f..8792d87 100644
--- a/runtime/observatory/tests/service/command_test.dart
+++ b/runtime/observatory/tests/service/command_test.dart
@@ -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.
-// VMOptions=--compile_all --error_on_bad_type --error_on_bad_override
+// VMOptions=--error_on_bad_type --error_on_bad_override
 
 import 'dart:async';
 
diff --git a/runtime/observatory/tests/service/contexts_test.dart b/runtime/observatory/tests/service/contexts_test.dart
index 2a34ba0..12bbbfb 100644
--- a/runtime/observatory/tests/service/contexts_test.dart
+++ b/runtime/observatory/tests/service/contexts_test.dart
@@ -1,7 +1,7 @@
 // Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
-// VMOptions=--compile_all --error_on_bad_type --error_on_bad_override
+// VMOptions=--error_on_bad_type --error_on_bad_override
 
 library inbound_references_test;
 
diff --git a/runtime/observatory/tests/service/coverage_test.dart b/runtime/observatory/tests/service/coverage_test.dart
index 9a6db65..5223092 100644
--- a/runtime/observatory/tests/service/coverage_test.dart
+++ b/runtime/observatory/tests/service/coverage_test.dart
@@ -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.
-// VMOptions=--compile_all --error_on_bad_type --error_on_bad_override
+// VMOptions=--error_on_bad_type --error_on_bad_override
 
 import 'package:observatory/service_io.dart';
 import 'package:unittest/unittest.dart';
@@ -11,7 +11,7 @@
 int globalVar = 100;
 
 class MyClass {
-  static void myFunction(int value) {
+       static       void myFunction(int value) {
     if (value < 0) {
       print("negative");
     } else {
@@ -22,9 +22,9 @@
 
   static void otherFunction(int value) {
     if (value < 0) {
-      print("otherFunction <");
+               print("otherFunction <");
     } else {
-      print("otherFunction >=");
+         print("otherFunction >=");
     }
   }
 }
@@ -79,8 +79,8 @@
   expect(coverage['coverage'][0]['hits'],
          equals([15, 1, 16, 0, 18, 1, 20, 1,
                  24, 1, 25, 1, 27, 0]));
-  expect(coverage['coverage'][1]['hits'].take(12),
-         equals([33, 1, 34, 1, 32, 1, 105, 2, 105, 1]));
+  expect(coverage['coverage'][1]['hits'],
+         equals([33, 1, 34, 1, 105, 2]));
 
   // Script
   await cls.load();
@@ -91,8 +91,8 @@
   expect(coverage['coverage'][0]['hits'],
          equals([15, 1, 16, 0, 18, 1, 20, 1,
                  24, 1, 25, 1, 27, 0]));
-  expect(coverage['coverage'][1]['hits'].take(12),
-         equals([33, 1, 34, 1, 32, 1, 105, 2, 105, 1]));
+  expect(coverage['coverage'][1]['hits'],
+         equals([33, 1, 34, 1, 105, 2]));
 
   // Isolate
   coverage = await isolate.invokeRpcNoUpgrade('_getCoverage', {});
diff --git a/runtime/observatory/tests/service/debugger_inspect_test.dart b/runtime/observatory/tests/service/debugger_inspect_test.dart
index 3037abe..1f7fe31 100644
--- a/runtime/observatory/tests/service/debugger_inspect_test.dart
+++ b/runtime/observatory/tests/service/debugger_inspect_test.dart
@@ -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.
-// VMOptions=--compile_all --error_on_bad_type --error_on_bad_override
+// VMOptions=--error_on_bad_type --error_on_bad_override
 
 import 'package:observatory/service_io.dart';
 import 'package:unittest/unittest.dart';
diff --git a/runtime/observatory/tests/service/debugger_location_test.dart b/runtime/observatory/tests/service/debugger_location_test.dart
index 1c26e31..7825ae6 100644
--- a/runtime/observatory/tests/service/debugger_location_test.dart
+++ b/runtime/observatory/tests/service/debugger_location_test.dart
@@ -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.
-// VMOptions=--compile_all --error_on_bad_type --error_on_bad_override
+// VMOptions=--error_on_bad_type --error_on_bad_override
 
 import 'package:observatory/service_io.dart';
 import 'package:observatory/debugger.dart';
@@ -55,209 +55,233 @@
 hasStoppedAtBreakpoint,
 
 // Parse '' => current position
-(Isolate isolate) {
-  return initDebugger(isolate).then((debugger) {
-    return DebuggerLocation.parse(debugger, '').then((DebuggerLocation loc) {
-      expect(loc.valid, isTrue);
-      expect(loc.toString(), equals('debugger_location_test.dart:17'));
-    });
-  });
+(Isolate isolate) async {
+  var debugger = await initDebugger(isolate);
+  var loc = await DebuggerLocation.parse(debugger, '');
+  expect(loc.valid, isTrue);
+  expect(loc.toString(), equals('debugger_location_test.dart:17:5'));
 },
 
 // Parse line
-(Isolate isolate) {
-  return initDebugger(isolate).then((debugger) {
-    return DebuggerLocation.parse(debugger, '18').then((DebuggerLocation loc) {
-      expect(loc.valid, isTrue);
-      expect(loc.toString(), equals('debugger_location_test.dart:18'));
-    });
-  });
+(Isolate isolate) async {
+  var debugger = await initDebugger(isolate);
+  var loc = await DebuggerLocation.parse(debugger, '18');
+  expect(loc.valid, isTrue);
+  expect(loc.toString(), equals('debugger_location_test.dart:18'));
 },
 
 // Parse line + col
-(Isolate isolate) {
-  return initDebugger(isolate).then((debugger) {
-    return DebuggerLocation.parse(debugger, '16:11').then((DebuggerLocation loc) {
-      expect(loc.valid, isTrue);
-      expect(loc.toString(), equals('debugger_location_test.dart:16:11'));
-    });
-  });
+(Isolate isolate) async {
+  var debugger = await initDebugger(isolate);
+  var loc = await DebuggerLocation.parse(debugger, '16:11');
+  expect(loc.valid, isTrue);
+  expect(loc.toString(), equals('debugger_location_test.dart:16:11'));
 },
 
 // Parse script + line
-(Isolate isolate) {
-  return initDebugger(isolate).then((debugger) {
-    return DebuggerLocation.parse(debugger, 'unittest.dart:15')
-      .then((DebuggerLocation loc) {
-        expect(loc.valid, isTrue);
-        expect(loc.toString(), equals('unittest.dart:15'));
-      });
-  });
+(Isolate isolate) async {
+  var debugger = await initDebugger(isolate);
+  var loc = await DebuggerLocation.parse(debugger, 'unittest.dart:15');
+  expect(loc.valid, isTrue);
+  expect(loc.toString(), equals('unittest.dart:15'));
 },
 
 // Parse script + line + col
-(Isolate isolate) {
-  return initDebugger(isolate).then((debugger) {
-    return DebuggerLocation.parse(debugger, 'unittest.dart:15:10')
-      .then((DebuggerLocation loc) {
-        expect(loc.valid, isTrue);
-        expect(loc.toString(), equals('unittest.dart:15:10'));
-      });
-  });
+(Isolate isolate) async {
+  var debugger = await initDebugger(isolate);
+  var loc = await DebuggerLocation.parse(debugger, 'unittest.dart:15:10');
+  expect(loc.valid, isTrue);
+  expect(loc.toString(), equals('unittest.dart:15:10'));
 },
 
 // Parse bad script
-(Isolate isolate) {
-  return initDebugger(isolate).then((debugger) {
-    return DebuggerLocation.parse(debugger, 'bad.dart:15')
-      .then((DebuggerLocation loc) {
-        expect(loc.valid, isFalse);
-        expect(loc.toString(), equals(
-            'invalid source location (Script \'bad.dart\' not found)'));
-      });
-  });
+(Isolate isolate) async {
+  var debugger = await initDebugger(isolate);
+  var loc = await DebuggerLocation.parse(debugger, 'bad.dart:15');
+  expect(loc.valid, isFalse);
+  expect(loc.toString(), equals(
+      'invalid source location (Script \'bad.dart\' not found)'));
 },
 
 // Parse function
-(Isolate isolate) {
-  return initDebugger(isolate).then((debugger) {
-    return DebuggerLocation.parse(debugger, 'testFunction')
-      .then((DebuggerLocation loc) {
-        expect(loc.valid, isTrue);
-        expect(loc.toString(), equals('testFunction'));
-      });
-  });
+(Isolate isolate) async {
+  var debugger = await initDebugger(isolate);
+  var loc = await DebuggerLocation.parse(debugger, 'testFunction');
+  expect(loc.valid, isTrue);
+  expect(loc.toString(), equals('testFunction'));
 },
 
 // Parse bad function
-(Isolate isolate) {
-  return initDebugger(isolate).then((debugger) {
-    return DebuggerLocation.parse(debugger, 'doesNotReallyExit')
-      .then((DebuggerLocation loc) {
-        expect(loc.valid, isFalse);
-        expect(loc.toString(), equals(
-            'invalid source location (Function \'doesNotReallyExit\' not found)'));
-      });
-  });
+(Isolate isolate) async {
+  var debugger = await initDebugger(isolate);
+  var loc = await DebuggerLocation.parse(debugger, 'doesNotReallyExist');
+  expect(loc.valid, isFalse);
+  expect(loc.toString(), equals(
+      'invalid source location (Function \'doesNotReallyExist\' not found)'));
 },
 
 // Parse constructor
-(Isolate isolate) {
-  return initDebugger(isolate).then((debugger) {
-    return DebuggerLocation.parse(debugger, 'DebuggerLocationTestFoo')
-      .then((DebuggerLocation loc) {
-        expect(loc.valid, isTrue);
-        // TODO(turnidge): Printing a constructor currently adds
-        // another class qualifier at the front.  Do we want to change
-        // this to be more consistent?
-        expect(loc.toString(), equals(
-            'DebuggerLocationTestFoo.DebuggerLocationTestFoo'));
-      });
-  });
+(Isolate isolate) async {
+  var debugger = await initDebugger(isolate);
+  var loc = await DebuggerLocation.parse(debugger, 'DebuggerLocationTestFoo');
+  expect(loc.valid, isTrue);
+  // TODO(turnidge): Printing a constructor currently adds
+  // another class qualifier at the front.  Do we want to change
+  // this to be more consistent?
+  expect(loc.toString(), equals(
+      'DebuggerLocationTestFoo.DebuggerLocationTestFoo'));
 },
 
 // Parse named constructor
-(Isolate isolate) {
-  return initDebugger(isolate).then((debugger) {
-    return DebuggerLocation.parse(debugger, 'DebuggerLocationTestFoo.named')
-      .then((DebuggerLocation loc) {
-        expect(loc.valid, isTrue);
-        // TODO(turnidge): Printing a constructor currently adds
-        // another class qualifier at the front.  Do we want to change
-        // this to be more consistent?
-        expect(loc.toString(), equals(
-            'DebuggerLocationTestFoo.DebuggerLocationTestFoo.named'));
-      });
-  });
+(Isolate isolate) async {
+  var debugger = await initDebugger(isolate);
+  var loc =
+      await DebuggerLocation.parse(debugger, 'DebuggerLocationTestFoo.named');
+  expect(loc.valid, isTrue);
+  // TODO(turnidge): Printing a constructor currently adds
+  // another class qualifier at the front.  Do we want to change
+  // this to be more consistent?
+  expect(loc.toString(), equals(
+      'DebuggerLocationTestFoo.DebuggerLocationTestFoo.named'));
 },
 
 // Parse method
-(Isolate isolate) {
-  return initDebugger(isolate).then((debugger) {
-    return DebuggerLocation.parse(debugger, 'DebuggerLocationTestFoo.method')
-      .then((DebuggerLocation loc) {
-        expect(loc.valid, isTrue);
-        expect(loc.toString(), equals('DebuggerLocationTestFoo.method'));
-      });
-  });
+(Isolate isolate) async {
+  var debugger = await initDebugger(isolate);
+  var loc =
+      await DebuggerLocation.parse(debugger, 'DebuggerLocationTestFoo.method');
+  expect(loc.valid, isTrue);
+  expect(loc.toString(), equals('DebuggerLocationTestFoo.method'));
 },
 
 // Parse method
-(Isolate isolate) {
-  return initDebugger(isolate).then((debugger) {
-    return DebuggerLocation.parse(debugger, 'DebuggerLocationTestFoo.field=')
-      .then((DebuggerLocation loc) {
-        expect(loc.valid, isTrue);
-        expect(loc.toString(), equals('DebuggerLocationTestFoo.field='));
-      });
-  });
+(Isolate isolate) async {
+  var debugger = await initDebugger(isolate);
+  var loc =
+      await DebuggerLocation.parse(debugger, 'DebuggerLocationTestFoo.field=');
+  expect(loc.valid, isTrue);
+  expect(loc.toString(), equals('DebuggerLocationTestFoo.field='));
 },
 
 // Parse bad method
-(Isolate isolate) {
-  return initDebugger(isolate).then((debugger) {
-    return DebuggerLocation.parse(debugger, 'DebuggerLocationTestFoo.missing')
-      .then((DebuggerLocation loc) {
-        expect(loc.valid, isFalse);
-        expect(loc.toString(), equals(
-            'invalid source location '
-            '(Function \'DebuggerLocationTestFoo.missing\' not found)'));
-      });
-  });
+(Isolate isolate) async {
+  var debugger = await initDebugger(isolate);
+  var loc =
+    await DebuggerLocation.parse(debugger, 'DebuggerLocationTestFoo.missing');
+  expect(loc.valid, isFalse);
+  expect(loc.toString(), equals(
+      'invalid source location '
+      '(Function \'DebuggerLocationTestFoo.missing\' not found)'));
 },
 
 // Complete function + script
-(Isolate isolate) {
-  return initDebugger(isolate).then((debugger) {
-    return DebuggerLocation.complete(debugger, 'debugger_loc')
-      .then((List<String> completions) {
-        expect(completions.toString(), equals(
-            '[debugger_location_dummy_function, '
-             'debugger_location.dart:, debugger_location_test.dart:]'));
-      });
-  });
+(Isolate isolate) async {
+  var debugger = await initDebugger(isolate);
+  var completions = await DebuggerLocation.complete(debugger, 'debugger_loc');
+  expect(completions.toString(), equals(
+      '[debugger_location_dummy_function,'
+      ' debugger_location.dart:,'
+      ' debugger_location_test.dart:]'));
 },
 
 // Complete class
-(Isolate isolate) {
-  return initDebugger(isolate).then((debugger) {
-    return DebuggerLocation.complete(debugger, 'DebuggerLocationTe')
-      .then((List<String> completions) {
-        expect(completions.toString(), equals(
-            '[DebuggerLocationTestBar, DebuggerLocationTestFoo]'));
-      });
-  });
+(Isolate isolate) async {
+  var debugger = await initDebugger(isolate);
+  var completions =
+      await DebuggerLocation.complete(debugger, 'DebuggerLocationTe');
+  expect(completions.toString(), equals(
+      '[DebuggerLocationTestBar,'
+      ' DebuggerLocationTestFoo]'));
 },
 
 // No completions: unqualified name
-(Isolate isolate) {
-  return initDebugger(isolate).then((debugger) {
-    return DebuggerLocation.complete(debugger, 'debugger_locXYZZY')
-      .then((List<String> completions) {
-        expect(completions.toString(), equals('[]'));
-      });
-  });
+(Isolate isolate) async {
+  var debugger = await initDebugger(isolate);
+  var completions =
+      await DebuggerLocation.complete(debugger, 'debugger_locXYZZY');
+  expect(completions.toString(), equals('[]'));
 },
 
 // Complete method
-(Isolate isolate) {
-  return initDebugger(isolate).then((debugger) {
-    return DebuggerLocation.complete(debugger, 'DebuggerLocationTestFoo.m')
-      .then((List<String> completions) {
-        expect(completions.toString(), equals(
-          '[DebuggerLocationTestFoo.madness, DebuggerLocationTestFoo.method]'));
-      });
-  });
+(Isolate isolate) async {
+  var debugger = await initDebugger(isolate);
+  var completions =
+      await DebuggerLocation.complete(debugger, 'DebuggerLocationTestFoo.m');
+  expect(completions.toString(), equals(
+      '[DebuggerLocationTestFoo.madness,'
+      ' DebuggerLocationTestFoo.method]'));
 },
 
 // No completions: qualified name
-(Isolate isolate) {
-  return initDebugger(isolate).then((debugger) {
-    return DebuggerLocation.complete(debugger, 'DebuggerLocationTestFoo.q')
-      .then((List<String> completions) {
-        expect(completions.toString(), equals('[]'));
-      });
-  });
+(Isolate isolate) async {
+  var debugger = await initDebugger(isolate);
+  var completions =
+      await DebuggerLocation.complete(debugger, 'DebuggerLocationTestFoo.q');
+  expect(completions.toString(), equals('[]'));
+},
+
+// Complete script
+(Isolate isolate) async {
+  var debugger = await initDebugger(isolate);
+  var completions =
+      await DebuggerLocation.complete(debugger, 'debugger_location_te');
+  expect(completions.toString(), equals(
+      '[debugger_location_test.dart:]'));
+},
+
+// Complete script:line
+(Isolate isolate) async {
+  var debugger = await initDebugger(isolate);
+  var completions =
+      await DebuggerLocation.complete(debugger,
+                                      'debugger_location_test.dart:11');
+  expect(completions.toString(), equals(
+      '[debugger_location_test.dart:11 ,'
+      ' debugger_location_test.dart:11:,'
+      ' debugger_location_test.dart:110 ,'
+      ' debugger_location_test.dart:110:,'
+      ' debugger_location_test.dart:111 ,'
+      ' debugger_location_test.dart:111:,'
+      ' debugger_location_test.dart:112 ,'
+      ' debugger_location_test.dart:112:,'
+      ' debugger_location_test.dart:115 ,'
+      ' debugger_location_test.dart:115:,'
+      ' debugger_location_test.dart:116 ,'
+      ' debugger_location_test.dart:116:,'
+      ' debugger_location_test.dart:117 ,'
+      ' debugger_location_test.dart:117:,'
+      ' debugger_location_test.dart:118 ,'
+      ' debugger_location_test.dart:118:,'
+      ' debugger_location_test.dart:119 ,'
+      ' debugger_location_test.dart:119:]'));
+},
+
+// Complete script:line:col
+(Isolate isolate) async {
+  var debugger = await initDebugger(isolate);
+  var completions =
+      await DebuggerLocation.complete(debugger,
+                                      'debugger_location_test.dart:11:2');
+  expect(completions.toString(), equals(
+      '[debugger_location_test.dart:11:2 ,'
+      ' debugger_location_test.dart:11:20 ,'
+      ' debugger_location_test.dart:11:21 ,'
+      ' debugger_location_test.dart:11:22 ,'
+      ' debugger_location_test.dart:11:23 ,'
+      ' debugger_location_test.dart:11:24 ]'));
+},
+
+// Complete without the script name.
+(Isolate isolate) async {
+  var debugger = await initDebugger(isolate);
+  var completions = await DebuggerLocation.complete(debugger, '11:2');
+  expect(completions.toString(), equals(
+      '[debugger_location_test.dart:11:2 ,'
+      ' debugger_location_test.dart:11:20 ,'
+      ' debugger_location_test.dart:11:21 ,'
+      ' debugger_location_test.dart:11:22 ,'
+      ' debugger_location_test.dart:11:23 ,'
+      ' debugger_location_test.dart:11:24 ]'));
 },
 
 ];
diff --git a/runtime/observatory/tests/service/debugging_inlined_finally_test.dart b/runtime/observatory/tests/service/debugging_inlined_finally_test.dart
index 886b368..91ca4b2 100644
--- a/runtime/observatory/tests/service/debugging_inlined_finally_test.dart
+++ b/runtime/observatory/tests/service/debugging_inlined_finally_test.dart
@@ -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.
-// VMOptions=--compile_all --error_on_bad_type --error_on_bad_override
+// VMOptions=--error_on_bad_type --error_on_bad_override
 
 import 'package:observatory/service_io.dart';
 import 'package:unittest/unittest.dart';
diff --git a/runtime/observatory/tests/service/debugging_test.dart b/runtime/observatory/tests/service/debugging_test.dart
index d3908b9..c43dcbb 100644
--- a/runtime/observatory/tests/service/debugging_test.dart
+++ b/runtime/observatory/tests/service/debugging_test.dart
@@ -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.
-// VMOptions=--compile_all --error_on_bad_type --error_on_bad_override
+// VMOptions=--error_on_bad_type --error_on_bad_override
 
 import 'package:observatory/service_io.dart';
 import 'package:unittest/unittest.dart';
diff --git a/runtime/observatory/tests/service/deferred_library.dart b/runtime/observatory/tests/service/deferred_library.dart
new file mode 100644
index 0000000..d2074ee
--- /dev/null
+++ b/runtime/observatory/tests/service/deferred_library.dart
@@ -0,0 +1,18 @@
+// 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 deferred_library;
+
+int value = 0;
+
+int decValue(int amount) {
+  value -= amount;
+  return amount;
+}
+
+void deferredTest() {
+  decValue(decValue(1));  // line 15
+
+  decValue(decValue(1));  // line 17
+}
diff --git a/runtime/observatory/tests/service/developer_extension_test.dart b/runtime/observatory/tests/service/developer_extension_test.dart
new file mode 100644
index 0000000..f134606
--- /dev/null
+++ b/runtime/observatory/tests/service/developer_extension_test.dart
@@ -0,0 +1,133 @@
+// 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 'dart:async';
+import 'dart:convert';
+import 'dart:developer';
+import 'package:observatory/service_io.dart';
+import 'package:observatory/cpu_profile.dart';
+import 'package:unittest/unittest.dart';
+
+import 'test_helper.dart';
+
+Future<ServiceExtensionResponse> Handler(String method,
+                                         Map paremeters) {
+  print('Invoked extension: $method');
+  switch (method) {
+    case '__delay':
+      Completer c = new Completer();
+      new Timer(new Duration(seconds: 1), () {
+        c.complete(new ServiceExtensionResponse.result(JSON.encode({
+            'type': '_delayedType',
+            'method': method,
+            'parameters': paremeters,
+          })));
+      });
+      return c.future;
+    case '__error':
+      return new Future.value(
+              new ServiceExtensionResponse.error(
+                  ServiceExtensionResponse.kExtensionErrorMin,
+                  'My error detail.'));
+    case '__exception':
+      throw "I always throw!";
+    case '__success':
+      return new Future.value(
+          new ServiceExtensionResponse.result(JSON.encode({
+              'type': '_extensionType',
+              'method': method,
+              'parameters': paremeters,
+          })));
+    case '__null':
+      return null;
+    case '__nullFuture':
+      return new Future.value(null);
+  }
+}
+
+Future<ServiceExtensionResponse> LanguageErrorHandler(String method,
+                                                      Map paremeters) {
+  // The following is an intentional syntax error.
+  klajsdlkjfad
+}
+
+void test() {
+  registerExtension('__delay', Handler);
+  registerExtension('__error', Handler);
+  registerExtension('__exception', Handler);
+  registerExtension('__null', Handler);
+  registerExtension('__nullFuture', Handler);
+  registerExtension('__success', Handler);
+  bool exceptionThrown = false;
+  try {
+    registerExtension('__delay', Handler);
+  } catch (e) {
+    exceptionThrown = true;
+  }
+  expect(exceptionThrown, isTrue);
+  registerExtension('__languageError', LanguageErrorHandler);
+}
+
+var tests = [
+  // Initial.
+  (Isolate isolate) async {
+    var result;
+
+    result = await isolate.invokeRpcNoUpgrade('__delay', {});
+    expect(result['type'], equals('_delayedType'));
+    expect(result['method'], equals('__delay'));
+    expect(result['parameters']['isolateId'], isNotNull);
+
+    try {
+      await isolate.invokeRpcNoUpgrade('__error', {});
+    } on ServerRpcException catch (e, st) {
+      expect(e.code, equals(ServiceExtensionResponse.kExtensionErrorMin));
+      expect(e.message, equals('My error detail.'));
+    }
+
+    try {
+      await isolate.invokeRpcNoUpgrade('__exception', {});
+    } on ServerRpcException catch (e, st) {
+      expect(e.code, equals(ServiceExtensionResponse.kExtensionError));
+      expect(e.message.startsWith('I always throw!\n'), isTrue);
+    }
+
+    try {
+      await isolate.invokeRpcNoUpgrade('__null', {});
+    } on ServerRpcException catch (e, st) {
+      expect(e.code, equals(ServiceExtensionResponse.kExtensionError));
+      expect(e.message, equals('Extension handler must return a Future'));
+    }
+
+    try {
+      await isolate.invokeRpcNoUpgrade('__nullFuture', {});
+    } on ServerRpcException catch (e, st) {
+      expect(e.code, equals(ServiceExtensionResponse.kExtensionError));
+      expect(e.message, equals('Extension handler must complete to a '
+                               'ServiceExtensionResponse'));
+    }
+
+    result = await isolate.invokeRpcNoUpgrade('__success',
+                                              {'apple': 'banana'});
+    expect(result['type'], equals('_extensionType'));
+    expect(result['method'], equals('__success'));
+    expect(result['parameters']['isolateId'], isNotNull);
+    expect(result['parameters']['apple'], equals('banana'));
+
+
+    try {
+      result = await isolate.invokeRpcNoUpgrade('__languageError', {});
+    } on ServerRpcException catch (e, st) {
+      expect(e.code, equals(ServiceExtensionResponse.kExtensionError));
+      expect(e.message, stringContainsInOrder([
+          'Error in extension `__languageError`:',
+          'developer_extension_test.dart',
+          'semicolon expected']));
+    }
+
+  },
+];
+
+main(args) async => runIsolateTests(args, tests, testeeBefore:test);
diff --git a/runtime/observatory/tests/service/dominator_tree_test.dart b/runtime/observatory/tests/service/dominator_tree_test.dart
index ef4fcd8..a778f62 100644
--- a/runtime/observatory/tests/service/dominator_tree_test.dart
+++ b/runtime/observatory/tests/service/dominator_tree_test.dart
@@ -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.
-// VMOptions=--compile_all --error_on_bad_type --error_on_bad_override
+// VMOptions=--error_on_bad_type --error_on_bad_override
 
 import 'package:observatory/service_io.dart';
 import 'package:unittest/unittest.dart';
diff --git a/runtime/observatory/tests/service/echo_test.dart b/runtime/observatory/tests/service/echo_test.dart
index b64b177..64399de 100644
--- a/runtime/observatory/tests/service/echo_test.dart
+++ b/runtime/observatory/tests/service/echo_test.dart
@@ -1,7 +1,7 @@
 // Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
-// VMOptions=--compile_all --error_on_bad_type --error_on_bad_override
+// VMOptions=--error_on_bad_type --error_on_bad_override
 
 import 'dart:async';
 import 'package:observatory/service_io.dart';
diff --git a/runtime/observatory/tests/service/eval_test.dart b/runtime/observatory/tests/service/eval_test.dart
index 7a535f4..99dfe8f 100644
--- a/runtime/observatory/tests/service/eval_test.dart
+++ b/runtime/observatory/tests/service/eval_test.dart
@@ -1,20 +1,21 @@
 // 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=--compile_all --error_on_bad_type --error_on_bad_override
+// 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';
-import 'dart:async';
 
 int globalVar = 100;
 
 class MyClass {
   static int staticVar = 1000;
 
-  static void printValue(int value) {
-    print(value);   // line 17
+  static void method(int value) {
+    debugger();
   }
 }
 
@@ -22,37 +23,14 @@
   int i = 0;
   while (true) {
     if (++i % 100000000 == 0) {
-      MyClass.printValue(10000);
+      MyClass.method(10000);
     }
   }
 }
 
 var tests = [
 
-// Go to breakpoint at line 16.
-(Isolate isolate) {
-  return isolate.rootLibrary.load().then((_) {
-      // Set up a listener to wait for breakpoint events.
-      Completer completer = new Completer();
-      isolate.vm.getEventStream(VM.kDebugStream).then((stream) {
-        var subscription;
-        subscription = stream.listen((ServiceEvent event) {
-          if (event.kind == ServiceEvent.kPauseBreakpoint) {
-            print('Breakpoint reached');
-            subscription.cancel();
-            completer.complete();
-          }
-        });
-      });
-
-      // Add the breakpoint.
-      var script = isolate.rootLibrary.scripts[0];
-      var line = 17;
-      return isolate.addBreakpoint(script, line).then((ServiceObject bpt) {
-          return completer.future;  // Wait for breakpoint reached.
-      });
-    });
-},
+hasStoppedAtBreakpoint,
 
 // Evaluate against library, class, and instance.
 (Isolate isolate) {
@@ -60,7 +38,7 @@
       // Make sure we are in the right place.
       expect(stack.type, equals('Stack'));
       expect(stack['frames'].length, greaterThanOrEqualTo(2));
-      expect(stack['frames'][0].function.name, equals('printValue'));
+      expect(stack['frames'][0].function.name, equals('method'));
       expect(stack['frames'][0].function.dartOwner.name, equals('MyClass'));
 
       var lib = isolate.rootLibrary;
diff --git a/runtime/observatory/tests/service/evaluate_activation_test.dart b/runtime/observatory/tests/service/evaluate_activation_test.dart
index cffc6fa..eb24a0e 100644
--- a/runtime/observatory/tests/service/evaluate_activation_test.dart
+++ b/runtime/observatory/tests/service/evaluate_activation_test.dart
@@ -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.
-// VMOptions=--compile_all --error_on_bad_type --error_on_bad_override
+// VMOptions=--error_on_bad_type --error_on_bad_override
 
 import 'package:observatory/service_io.dart';
 import 'package:unittest/unittest.dart';
diff --git a/runtime/observatory/tests/service/evaluate_in_frame_rpc_test.dart b/runtime/observatory/tests/service/evaluate_in_frame_rpc_test.dart
new file mode 100644
index 0000000..053fd15
--- /dev/null
+++ b/runtime/observatory/tests/service/evaluate_in_frame_rpc_test.dart
@@ -0,0 +1,47 @@
+// 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 'dart:async';
+import 'dart:developer';
+import 'package:observatory/service_io.dart';
+import 'package:unittest/unittest.dart';
+import 'test_helper.dart';
+
+void method(int value, _) {
+  debugger();
+}
+
+void testFunction() {
+  int i = 0;
+  while (true) {
+    if (++i % 100000000 == 0) {
+      method(10000, 50);
+    }
+  }
+}
+
+var tests = [
+
+hasStoppedAtBreakpoint,
+
+// Evaluate against library, class, and instance.
+(Isolate isolate) async {
+  var result;
+  result = await isolate.evalFrame(0, 'value');
+  expect(result.valueAsString, equals('10000'));
+
+  result = await isolate.evalFrame(0, '_');
+  expect(result.valueAsString, equals('50'));
+
+  result = await isolate.evalFrame(0, 'value + _');
+  expect(result.valueAsString, equals('10050'));
+
+  result = await isolate.evalFrame(1, 'i');
+  expect(result.valueAsString, equals('100000000'));
+},
+
+];
+
+main(args) => runIsolateTests(args, tests, testeeConcurrent: testFunction);
diff --git a/runtime/observatory/tests/service/file_service_test.dart b/runtime/observatory/tests/service/file_service_test.dart
new file mode 100644
index 0000000..22b5827
--- /dev/null
+++ b/runtime/observatory/tests/service/file_service_test.dart
@@ -0,0 +1,105 @@
+// 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:convert';
+import 'dart:developer';
+import 'dart:io' as io;
+import 'package:observatory/service_io.dart';
+import 'package:unittest/unittest.dart';
+import 'test_helper.dart';
+
+Future setupFiles() async {
+  var dir = await io.Directory.systemTemp.createTemp('file_service');
+  var writingFile;
+  var readingFile;
+
+  void closeDown() {
+    if (writingFile != null) {
+      writingFile.closeSync();
+    }
+    if (readingFile != null) {
+      readingFile.closeSync();
+    }
+    dir.deleteSync(recursive: true);
+  }
+
+  Future<ServiceExtensionResponse> cleanup(ignored_a, ignored_b) {
+    closeDown();
+    var result = JSON.encode({'type' : 'foobar'});
+    return new Future.value(new ServiceExtensionResponse.result(result));
+  }
+
+  Future<ServiceExtensionResponse> setup(ignored_a, ignored_b) async {
+    try {
+      var filePath = dir.path + io.Platform.pathSeparator + "file";
+      var f = new io.File(filePath);
+      writingFile = await f.open(mode: io.FileMode.WRITE);
+      await writingFile.writeByte(42);
+      await writingFile.writeByte(42);
+      await writingFile.writeByte(42);
+
+      var file = new io.File.fromUri(io.Platform.script);
+      readingFile = await file.open();
+      await readingFile.readByte();
+      await readingFile.readByte();
+      await readingFile.readByte();
+      await readingFile.readByte();
+      await readingFile.readByte();
+
+      // The utility functions should close the files after them, so we
+      // don't expect the calls below to result in open files.
+      var writeTemp = dir.path + io.Platform.pathSeparator + "other_file";
+      var utilFile = new io.File(writeTemp);
+      await utilFile.writeAsString('foobar');
+      var readTemp = new io.File(writeTemp);
+      var result = await readTemp.readAsString();
+      expect(result, equals('foobar'));
+
+    } catch (e) {
+      closeDown();
+      throw e;
+    }
+    var result = JSON.encode({'type' : 'foobar'});
+    return new Future.value(new ServiceExtensionResponse.result(result));
+  }
+  registerExtension('__cleanup', cleanup);
+  registerExtension('__setup', setup);
+}
+
+var fileTests = [
+  (Isolate isolate) async {
+    await isolate.invokeRpcNoUpgrade('__setup', {});
+    try {
+      var result = await isolate.invokeRpcNoUpgrade('__getOpenFiles', {});
+      expect(result['type'], equals('_openfiles'));
+
+      expect(result['data'].length, equals(2));
+      var writing = await isolate.invokeRpcNoUpgrade(
+           '__getFileByID', { 'id' : result['data'][0]['id'] });
+
+      expect(writing['totalRead'], equals(0));
+      expect(writing['readCount'], equals(0));
+      expect(writing['writeCount'], equals(3));
+      expect(writing['totalWritten'], equals(3));
+      expect(writing['lastWrite'], greaterThan(0));
+      expect(writing['lastRead'], equals(0));
+
+      var reading = await isolate.invokeRpcNoUpgrade(
+          '__getFileByID', { 'id' : result['data'][1]['id'] });
+
+      expect(reading['totalRead'], equals(5));
+      expect(reading['readCount'], equals(5));
+      expect(reading['writeCount'], equals(0));
+      expect(reading['totalWritten'], equals(0));
+      expect(reading['lastWrite'], equals(0));
+      expect(reading['lastRead'], greaterThan(0));
+
+    } finally {
+      await isolate.invokeRpcNoUpgrade('__cleanup', {});
+    }
+  },
+];
+
+main(args) async => runIsolateTests(args, fileTests, testeeBefore:setupFiles);
diff --git a/runtime/observatory/tests/service/gc_test.dart b/runtime/observatory/tests/service/gc_test.dart
index fba9ebd..c21c858 100644
--- a/runtime/observatory/tests/service/gc_test.dart
+++ b/runtime/observatory/tests/service/gc_test.dart
@@ -1,7 +1,7 @@
 // Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
-// VMOptions=--compile_all --error_on_bad_type --error_on_bad_override
+// VMOptions=--error_on_bad_type --error_on_bad_override
 
 import 'package:observatory/service_io.dart';
 import 'test_helper.dart';
diff --git a/runtime/observatory/tests/service/get_allocation_profile_rpc_test.dart b/runtime/observatory/tests/service/get_allocation_profile_rpc_test.dart
index 10ffc2c..7db64c9 100644
--- a/runtime/observatory/tests/service/get_allocation_profile_rpc_test.dart
+++ b/runtime/observatory/tests/service/get_allocation_profile_rpc_test.dart
@@ -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.
-// VMOptions=--compile_all --error_on_bad_type --error_on_bad_override
+// VMOptions=--error_on_bad_type --error_on_bad_override
 
 import 'package:observatory/service_io.dart';
 import 'package:unittest/unittest.dart';
diff --git a/runtime/observatory/tests/service/get_allocation_samples_test.dart b/runtime/observatory/tests/service/get_allocation_samples_test.dart
index b70d121..698fce5 100644
--- a/runtime/observatory/tests/service/get_allocation_samples_test.dart
+++ b/runtime/observatory/tests/service/get_allocation_samples_test.dart
@@ -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.
-// VMOptions=--compile_all --error_on_bad_type --error_on_bad_override
+// VMOptions=--error_on_bad_type --error_on_bad_override
 
 import 'dart:developer';
 import 'package:observatory/service_io.dart';
diff --git a/runtime/observatory/tests/service/get_flag_list_rpc_test.dart b/runtime/observatory/tests/service/get_flag_list_rpc_test.dart
index db3040c..3b646c7 100644
--- a/runtime/observatory/tests/service/get_flag_list_rpc_test.dart
+++ b/runtime/observatory/tests/service/get_flag_list_rpc_test.dart
@@ -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.
-// VMOptions=--compile_all --error_on_bad_type --error_on_bad_override
+// VMOptions=--error_on_bad_type --error_on_bad_override
 
 import 'package:observatory/service_io.dart';
 import 'package:unittest/unittest.dart';
diff --git a/runtime/observatory/tests/service/get_heap_map_rpc_test.dart b/runtime/observatory/tests/service/get_heap_map_rpc_test.dart
index 9999ce6..520801d 100644
--- a/runtime/observatory/tests/service/get_heap_map_rpc_test.dart
+++ b/runtime/observatory/tests/service/get_heap_map_rpc_test.dart
@@ -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.
-// VMOptions=--compile_all --error_on_bad_type --error_on_bad_override
+// VMOptions=--error_on_bad_type --error_on_bad_override
 
 import 'package:observatory/service_io.dart';
 import 'package:unittest/unittest.dart';
diff --git a/runtime/observatory/tests/service/get_instances_rpc_test.dart b/runtime/observatory/tests/service/get_instances_rpc_test.dart
index da26013..cd9f476 100644
--- a/runtime/observatory/tests/service/get_instances_rpc_test.dart
+++ b/runtime/observatory/tests/service/get_instances_rpc_test.dart
@@ -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.
-// VMOptions=--compile_all --error_on_bad_type --error_on_bad_override
+// VMOptions=--error_on_bad_type --error_on_bad_override
 
 import 'package:observatory/service_io.dart';
 import 'package:unittest/unittest.dart';
diff --git a/runtime/observatory/tests/service/get_isolate_rpc_test.dart b/runtime/observatory/tests/service/get_isolate_rpc_test.dart
index 153cbb6..840c705 100644
--- a/runtime/observatory/tests/service/get_isolate_rpc_test.dart
+++ b/runtime/observatory/tests/service/get_isolate_rpc_test.dart
@@ -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.
-// VMOptions=--compile_all --error_on_bad_type --error_on_bad_override
+// VMOptions=--error_on_bad_type --error_on_bad_override
 
 import 'package:observatory/service_io.dart';
 import 'package:unittest/unittest.dart';
@@ -17,6 +17,7 @@
     expect(result['type'], equals('Isolate'));
     expect(result['id'], startsWith('isolates/'));
     expect(result['number'], new isInstanceOf<String>());
+    expect(result['_originNumber'], equals(result['number']));
     expect(result['startTime'], isPositive);
     expect(result['livePorts'], isPositive);
     expect(result['pauseOnExit'], isFalse);
@@ -29,6 +30,34 @@
     expect(result['_heaps']['new']['type'], equals('HeapSpace'));
     expect(result['_heaps']['old']['type'], equals('HeapSpace'));
   },
+
+  (VM vm) async {
+    var params = {
+      'isolateId': 'badid',
+    };
+    bool caughtException;
+    try {
+      await vm.invokeRpcNoUpgrade('getIsolate', params);
+      expect(false, isTrue, reason:'Unreachable');
+    } on ServerRpcException catch(e) {
+      caughtException = true;
+      expect(e.code, equals(ServerRpcException.kInvalidParams));
+      expect(e.message,
+             "getIsolate: invalid 'isolateId' parameter: badid");
+    }
+    expect(caughtException, isTrue);
+  },
+
+  // Plausible isolate id, not found.
+  (VM vm) async {
+    var params = {
+      'isolateId': 'isolates/9999999999',
+    };
+    var result = await vm.invokeRpcNoUpgrade('getIsolate', params);
+    expect(result['type'], equals('Sentinel'));
+    expect(result['kind'], equals('Collected'));
+    expect(result['valueAsString'], equals('<collected>'));
+  },
 ];
 
 main(args) async => runVMTests(args, tests);
diff --git a/runtime/observatory/tests/service/get_object_rpc_test.dart b/runtime/observatory/tests/service/get_object_rpc_test.dart
index 18d984d..fdcbaa1 100644
--- a/runtime/observatory/tests/service/get_object_rpc_test.dart
+++ b/runtime/observatory/tests/service/get_object_rpc_test.dart
@@ -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.
-// VMOptions=--compile_all --error_on_bad_type --error_on_bad_override
+// VMOptions=--error_on_bad_type --error_on_bad_override
 
 library get_object_rpc_test;
 
diff --git a/runtime/observatory/tests/service/get_ports_rpc_test.dart b/runtime/observatory/tests/service/get_ports_rpc_test.dart
index 1c08a16..7e977ed 100644
--- a/runtime/observatory/tests/service/get_ports_rpc_test.dart
+++ b/runtime/observatory/tests/service/get_ports_rpc_test.dart
@@ -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.
-// VMOptions=--compile_all --error_on_bad_type --error_on_bad_override
+// VMOptions=--error_on_bad_type --error_on_bad_override
 
 library get_ports_rpc_test;
 
diff --git a/runtime/observatory/tests/service/get_retained_size_rpc_test.dart b/runtime/observatory/tests/service/get_retained_size_rpc_test.dart
index 1ead7cf..96df916 100644
--- a/runtime/observatory/tests/service/get_retained_size_rpc_test.dart
+++ b/runtime/observatory/tests/service/get_retained_size_rpc_test.dart
@@ -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.
-// VMOptions=--compile_all --error_on_bad_type --error_on_bad_override
+// VMOptions=--error_on_bad_type --error_on_bad_override
 
 import 'package:observatory/service_io.dart';
 import 'package:unittest/unittest.dart';
diff --git a/runtime/observatory/tests/service/get_retaining_path_rpc_test.dart b/runtime/observatory/tests/service/get_retaining_path_rpc_test.dart
index f773dae..74e98c9 100644
--- a/runtime/observatory/tests/service/get_retaining_path_rpc_test.dart
+++ b/runtime/observatory/tests/service/get_retaining_path_rpc_test.dart
@@ -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.
-// VMOptions=--compile_all --error_on_bad_type --error_on_bad_override
+// VMOptions=--error_on_bad_type --error_on_bad_override
 
 import 'package:observatory/service_io.dart';
 import 'package:unittest/unittest.dart';
diff --git a/runtime/observatory/tests/service/get_stack_rpc_test.dart b/runtime/observatory/tests/service/get_stack_rpc_test.dart
index 7210794..2bf7c3a 100644
--- a/runtime/observatory/tests/service/get_stack_rpc_test.dart
+++ b/runtime/observatory/tests/service/get_stack_rpc_test.dart
@@ -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.
-// VMOptions=--compile_all --error_on_bad_type --error_on_bad_override
+// VMOptions=--error_on_bad_type --error_on_bad_override
 
 import 'package:observatory/service_io.dart';
 import 'package:unittest/unittest.dart';
diff --git a/runtime/observatory/tests/service/get_version_rpc_test.dart b/runtime/observatory/tests/service/get_version_rpc_test.dart
index 636eb71..3df8d67 100644
--- a/runtime/observatory/tests/service/get_version_rpc_test.dart
+++ b/runtime/observatory/tests/service/get_version_rpc_test.dart
@@ -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.
-// VMOptions=--compile_all --error_on_bad_type --error_on_bad_override
+// VMOptions=--error_on_bad_type --error_on_bad_override
 
 import 'package:observatory/service_io.dart';
 import 'package:unittest/unittest.dart';
@@ -12,7 +12,7 @@
   (VM vm) async {
     var result = await vm.invokeRpcNoUpgrade('getVersion', {});
     expect(result['type'], equals('Version'));
-    expect(result['major'], equals(2));
+    expect(result['major'], equals(3));
     expect(result['minor'], equals(0));
     expect(result['_privateMajor'], equals(0));
     expect(result['_privateMinor'], equals(0));
diff --git a/runtime/observatory/tests/service/get_vm_rpc_test.dart b/runtime/observatory/tests/service/get_vm_rpc_test.dart
index 95481c5..f16c2b7 100644
--- a/runtime/observatory/tests/service/get_vm_rpc_test.dart
+++ b/runtime/observatory/tests/service/get_vm_rpc_test.dart
@@ -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.
-// VMOptions=--compile_all --error_on_bad_type --error_on_bad_override
+// VMOptions=--error_on_bad_type --error_on_bad_override --vm-name=Walter
 
 import 'package:observatory/service_io.dart';
 import 'package:unittest/unittest.dart';
@@ -12,16 +12,15 @@
   (VM vm) async {
     var result = await vm.invokeRpcNoUpgrade('getVM', {});
     expect(result['type'], equals('VM'));
+    expect(result['name'], equals('Walter'));
     expect(result['architectureBits'], isPositive);
     expect(result['targetCPU'], new isInstanceOf<String>());
     expect(result['hostCPU'], new isInstanceOf<String>());
     expect(result['version'], new isInstanceOf<String>());
-    expect(result['pid'], new isInstanceOf<String>());
+    expect(result['pid'], new isInstanceOf<int>());
     expect(result['startTime'], isPositive);
     expect(result['isolates'].length, isPositive);
     expect(result['isolates'][0]['type'], equals('@Isolate'));
-    expect(result['_assertsEnabled'], new isInstanceOf<bool>());
-    expect(result['_typeChecksEnabled'], new isInstanceOf<bool>());
   },
 ];
 
diff --git a/runtime/observatory/tests/service/graph_test.dart b/runtime/observatory/tests/service/graph_test.dart
index feac00c..3cf8c46 100644
--- a/runtime/observatory/tests/service/graph_test.dart
+++ b/runtime/observatory/tests/service/graph_test.dart
@@ -1,7 +1,7 @@
 // Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
-// VMOptions=--compile_all --error_on_bad_type --error_on_bad_override
+// VMOptions=--error_on_bad_type --error_on_bad_override
 
 import 'package:observatory/object_graph.dart';
 import 'package:observatory/service_io.dart';
diff --git a/runtime/observatory/tests/service/inbound_references_test.dart b/runtime/observatory/tests/service/inbound_references_test.dart
index ba97490..b73ace5 100644
--- a/runtime/observatory/tests/service/inbound_references_test.dart
+++ b/runtime/observatory/tests/service/inbound_references_test.dart
@@ -1,7 +1,7 @@
 // Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
-// VMOptions=--compile_all --error_on_bad_type --error_on_bad_override
+// VMOptions=--error_on_bad_type --error_on_bad_override
 
 library inbound_references_test;
 
@@ -41,14 +41,14 @@
 
     // Assert e is referenced by at least n, array, and the top-level
     // field e.
-    hasReferenceSuchThat((r) => r['slot'] is Field &&
-                         r['slot'].name=='edge' &&
-                         r['source'].isInstance &&
-                         r['source'].clazz.name=='Node');
-    hasReferenceSuchThat((r) => r['slot'] == 1 &&
-                         r['source'].isList);
-    hasReferenceSuchThat((r) => r['slot']=='<unknown>' &&
-                         r['source'] is Field);
+    hasReferenceSuchThat((r) => r['parentField'] != null &&
+                                r['parentField'].name == 'edge' &&
+                                r['source'].isInstance &&
+                                r['source'].clazz.name == 'Node');
+    hasReferenceSuchThat((r) => r['parentListIndex'] == 1 &&
+                                r['source'].isList);
+    hasReferenceSuchThat((r) => r['source'] is Field &&
+                                r['source'].name == 'e');
   }
 
 ];
diff --git a/runtime/observatory/tests/service/isolate_lifecycle_test.dart b/runtime/observatory/tests/service/isolate_lifecycle_test.dart
index 2160d0c..f88b123 100644
--- a/runtime/observatory/tests/service/isolate_lifecycle_test.dart
+++ b/runtime/observatory/tests/service/isolate_lifecycle_test.dart
@@ -1,9 +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.
-// VMOptions=--compile_all --error_on_bad_type --error_on_bad_override
+// VMOptions=--error_on_bad_type --error_on_bad_override
 
 import 'dart:async';
+import 'dart:developer';
 import 'dart:isolate' as I;
 
 import 'package:observatory/service_io.dart';
@@ -18,7 +19,8 @@
 void spawnEntry(int i) {
 }
 
-Future before() async {
+Future during() async {
+  debugger();
   // Spawn spawnCount long lived isolates.
   for (var i = 0; i < spawnCount; i++) {
     var isolate = await I.Isolate.spawn(spawnEntry, i);
@@ -27,9 +29,6 @@
   print('spawned all isolates');
 }
 
-Future during() async {
-}
-
 int numPaused(vm) {
   int paused = 0;
   for (var isolate in vm.isolates) {
@@ -42,20 +41,33 @@
 
 var tests = [
   (VM vm) async {
+    expect(vm.isolates.length, 1);
+    await hasStoppedAtBreakpoint(vm.isolates[0]);
+  },
+
+  (VM vm) async {
     Completer completer = new Completer();
     var stream = await vm.getEventStream(VM.kIsolateStream);
-    if (vm.isolates.length < spawnCount + 1) {
-      var subscription;
-      subscription = stream.listen((ServiceEvent event) {
-        if (event.kind == ServiceEvent.kIsolateStart) {
-          if (vm.isolates.length == (spawnCount + 1)) {
-            subscription.cancel();
-            completer.complete(null);
-          }
-        }
-      });
-      await completer.future;
-    }
+    var subscription;
+    int startCount = 0;
+    int runnableCount = 0;
+    subscription = stream.listen((ServiceEvent event) {
+      if (event.kind == ServiceEvent.kIsolateStart) {
+        startCount++;
+      }
+      if (event.kind == ServiceEvent.kIsolateRunnable) {
+        runnableCount++;
+      }
+      if (runnableCount == spawnCount) {
+        subscription.cancel();
+        completer.complete(null);
+      }
+    });
+    expect(vm.isolates.length, 1);
+    vm.isolates[0].resume();
+    await completer.future;
+    expect(startCount, spawnCount);
+    expect(runnableCount, spawnCount);
     expect(vm.isolates.length, spawnCount + 1);
   },
 
@@ -69,7 +81,7 @@
   (VM vm) async {
     Completer completer = new Completer();
     var stream = await vm.getEventStream(VM.kDebugStream);
-    if (numPaused(vm) < spawnCount) {
+    if (numPaused(vm) < (spawnCount + 1)) {
       var subscription;
       subscription = stream.listen((ServiceEvent event) {
         if (event.kind == ServiceEvent.kPauseExit) {
@@ -124,6 +136,5 @@
 ];
 
 main(args) async => runVMTests(args, tests,
-                               testeeBefore: before,
                                testeeConcurrent: during,
                                pause_on_exit: true);
diff --git a/runtime/observatory/tests/service/library_dependency_test.dart b/runtime/observatory/tests/service/library_dependency_test.dart
index 8297261..6a91179 100644
--- a/runtime/observatory/tests/service/library_dependency_test.dart
+++ b/runtime/observatory/tests/service/library_dependency_test.dart
@@ -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.
-// VMOptions=--compile_all --error_on_bad_type --error_on_bad_override
+// VMOptions=--error_on_bad_type --error_on_bad_override
 
 import 'package:observatory/service_io.dart';
 import 'package:unittest/unittest.dart';
diff --git a/runtime/observatory/tests/service/malformed_test.dart b/runtime/observatory/tests/service/malformed_test.dart
index 6cf5302..ea3a093 100644
--- a/runtime/observatory/tests/service/malformed_test.dart
+++ b/runtime/observatory/tests/service/malformed_test.dart
@@ -1,7 +1,7 @@
 // Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
-// VMOptions=--compile_all --error_on_bad_type --error_on_bad_override
+// VMOptions=--error_on_bad_type --error_on_bad_override
 
 import 'package:observatory/service_io.dart';
 import 'package:unittest/unittest.dart';
diff --git a/runtime/observatory/tests/service/metrics_test.dart b/runtime/observatory/tests/service/metrics_test.dart
index 9b3a45e..d501f03 100644
--- a/runtime/observatory/tests/service/metrics_test.dart
+++ b/runtime/observatory/tests/service/metrics_test.dart
@@ -1,7 +1,7 @@
 // Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
-// VMOptions=--compile_all --error_on_bad_type --error_on_bad_override
+// VMOptions=--error_on_bad_type --error_on_bad_override
 
 import 'package:observatory/service_io.dart';
 import 'package:unittest/unittest.dart';
diff --git a/runtime/observatory/tests/service/mirror_references_test.dart b/runtime/observatory/tests/service/mirror_references_test.dart
index dacb412..b93bfa6 100644
--- a/runtime/observatory/tests/service/mirror_references_test.dart
+++ b/runtime/observatory/tests/service/mirror_references_test.dart
@@ -1,7 +1,7 @@
 // Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
-// VMOptions=--compile_all --error_on_bad_type --error_on_bad_override
+// VMOptions=--error_on_bad_type --error_on_bad_override
 
 library vm_references_test;
 
diff --git a/runtime/observatory/tests/service/native_metrics_test.dart b/runtime/observatory/tests/service/native_metrics_test.dart
index 77bc903..dd713a2 100644
--- a/runtime/observatory/tests/service/native_metrics_test.dart
+++ b/runtime/observatory/tests/service/native_metrics_test.dart
@@ -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.
-// VMOptions=--compile_all --error_on_bad_type --error_on_bad_override
+// VMOptions=--error_on_bad_type --error_on_bad_override
 
 import 'package:observatory/service_io.dart';
 import 'package:unittest/unittest.dart';
diff --git a/runtime/observatory/tests/service/parameters_in_scope_at_entry_test.dart b/runtime/observatory/tests/service/parameters_in_scope_at_entry_test.dart
new file mode 100644
index 0000000..0e4209a
--- /dev/null
+++ b/runtime/observatory/tests/service/parameters_in_scope_at_entry_test.dart
@@ -0,0 +1,67 @@
+// 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  --verbose_debug
+
+import 'package:observatory/service_io.dart';
+import 'test_helper.dart';
+import 'dart:developer';
+import 'package:unittest/unittest.dart';
+
+foo(param) {
+  return param;
+}
+
+fooClosure() {
+  theClosureFunction(param) {
+    return param;
+  }
+  return theClosureFunction;
+}
+
+testMain() {
+  debugger();
+  foo("in-scope");  // Line 24
+
+  var f = fooClosure();
+  debugger();
+  f("in-scope");  // Line 28
+}
+
+var tests = [
+  hasStoppedAtBreakpoint,
+  stoppedAtLine(24),
+  (isolate) => isolate.stepInto(),
+  hasStoppedAtBreakpoint,
+  (isolate) async {
+    var stack = await isolate.getStack();
+    Frame top = stack['frames'][0];
+    print(top);
+    expect(top.function.name, equals("foo"));
+    print(top.variables);
+    expect(top.variables.length, equals(1));
+    var param = top.variables[0];
+    expect(param['name'], equals("param"));
+    expect(param['value'].valueAsString, equals("in-scope"));
+  },
+  resumeIsolate,
+
+  hasStoppedAtBreakpoint,
+  stoppedAtLine(28),
+  (isolate) => isolate.stepInto(),
+  hasStoppedAtBreakpoint,
+  (isolate) async {
+    var stack = await isolate.getStack();
+    Frame top = stack['frames'][0];
+    print(top);
+    expect(top.function.name, equals("theClosureFunction"));
+    print(top.variables);
+    expect(top.variables.length, equals(1));
+    var param = top.variables[0];
+    expect(param['name'], equals("param"));
+    expect(param['value'].valueAsString, equals("in-scope"));
+  },
+  resumeIsolate,
+];
+
+main(args) => runIsolateTests(args, tests, testeeConcurrent: testMain);
diff --git a/runtime/observatory/tests/service/pause_idle_isolate_test.dart b/runtime/observatory/tests/service/pause_idle_isolate_test.dart
new file mode 100644
index 0000000..cfd418c
--- /dev/null
+++ b/runtime/observatory/tests/service/pause_idle_isolate_test.dart
@@ -0,0 +1,80 @@
+// 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/service_io.dart';
+import 'package:unittest/unittest.dart';
+import 'test_helper.dart';
+import 'dart:async';
+import 'dart:io';
+import 'dart:isolate' show ReceivePort;
+
+var receivePort;
+
+void testMain() {
+  receivePort = new ReceivePort();
+}
+
+var tests = [
+
+(Isolate isolate) async {
+  Completer completer = new Completer();
+  var stream = await isolate.vm.getEventStream(VM.kDebugStream);
+  var subscription;
+  subscription = stream.listen((ServiceEvent event) {
+    if (event.kind == ServiceEvent.kPauseStart) {
+      print('Received $event');
+      subscription.cancel();
+      completer.complete();
+    }
+  });
+
+  if (isolate.pauseEvent != null &&
+      isolate.pauseEvent.kind == ServiceEvent.kPauseStart) {
+    // Wait for the isolate to hit PauseStart.
+    subscription.cancel();
+  } else {
+    await completer.future;
+  }
+  print('Done waiting for pause event.');
+
+  // Wait for the isolate to pause due to interruption.
+  completer = new Completer();
+  stream = await isolate.vm.getEventStream(VM.kDebugStream);
+  bool receivedInterrupt = false;
+  subscription = stream.listen((ServiceEvent event) {
+    print('Received $event');
+    if (event.kind == ServiceEvent.kPauseInterrupted) {
+      receivedInterrupt = true;
+      subscription.cancel();
+      completer.complete();
+    }
+  });
+
+  await isolate.resume();
+
+  // Wait for the isolate to become idle.  We detect this by querying
+  // the stack until it becomes empty.
+  var frameCount;
+  do {
+    var stack = await isolate.getStack();
+    frameCount = stack['frames'].length;
+    print('frames: $frameCount');
+    sleep(const Duration(milliseconds:10));
+  } while (frameCount > 0);
+
+  // Make sure that the isolate receives an interrupt even when it is
+  // idle. (https://github.com/dart-lang/sdk/issues/24349)
+  await isolate.pause();
+  await completer.future;
+  expect(receivedInterrupt, isTrue);
+},
+
+];
+
+main(args) => runIsolateTests(args, tests,
+                              testeeConcurrent: testMain,
+                              pause_on_start: true,
+                              trace_service: true,
+                              verbose_vm: true);
diff --git a/runtime/observatory/tests/service/pause_on_exceptions_test.dart b/runtime/observatory/tests/service/pause_on_exceptions_test.dart
index f4a1da2..03d4731 100644
--- a/runtime/observatory/tests/service/pause_on_exceptions_test.dart
+++ b/runtime/observatory/tests/service/pause_on_exceptions_test.dart
@@ -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.
-// VMOptions=--compile_all --error_on_bad_type --error_on_bad_override
+// VMOptions=--error_on_bad_type --error_on_bad_override
 
 import 'package:observatory/service_io.dart';
 import 'package:unittest/unittest.dart';
@@ -51,13 +51,13 @@
     }
   });
 
-  test(String pauseInfo,
+  test(String pauseMode,
        String expression,
        bool shouldPause,
        bool shouldBeCaught) async {
-    print("Evaluating $expression with pause on $pauseInfo exception");
+    print("Evaluating $expression with pause on $pauseMode exception");
 
-    expect((await isolate.setExceptionPauseInfo(pauseInfo)) is DartError,
+    expect((await isolate.setExceptionPauseMode(pauseMode)) is DartError,
            isFalse);
 
     var t;
@@ -94,14 +94,14 @@
     }
   }
 
-  await test("all", "doCaught()", true, true);
-  await test("all", "doUncaught()", true, false);
+  await test("All", "doCaught()", true, true);
+  await test("All", "doUncaught()", true, false);
 
-  await test("unhandled", "doCaught()", false, true);
-  await test("unhandled", "doUncaught()", true, false);
+  await test("Unhandled", "doCaught()", false, true);
+  await test("Unhandled", "doUncaught()", true, false);
 
-  await test("none", "doCaught()", false, true);
-  await test("none", "doUncaught()", false, false);
+  await test("None", "doCaught()", false, true);
+  await test("None", "doUncaught()", false, false);
 
   subscription.cancel();
 },
diff --git a/runtime/observatory/tests/service/pause_on_start_and_exit_test.dart b/runtime/observatory/tests/service/pause_on_start_and_exit_test.dart
index b7f7935..93444d0 100644
--- a/runtime/observatory/tests/service/pause_on_start_and_exit_test.dart
+++ b/runtime/observatory/tests/service/pause_on_start_and_exit_test.dart
@@ -4,6 +4,7 @@
 // VMOptions=--error_on_bad_type --error_on_bad_override
 
 import 'package:observatory/service_io.dart';
+import 'package:unittest/unittest.dart';
 import 'test_helper.dart';
 import 'dart:async';
 
@@ -14,24 +15,41 @@
 var tests = [
 
 (Isolate isolate) async {
+  print('Getting stream...');
   Completer completer = new Completer();
   var stream = await isolate.vm.getEventStream(VM.kDebugStream);
+  print('Subscribing...');
   var subscription;
   subscription = stream.listen((ServiceEvent event) {
     if (event.kind == ServiceEvent.kPauseStart) {
-      print('Received PauseStart');
+      print('Received $event');
       subscription.cancel();
       completer.complete();
+    } else {
+      print('Ignoring event $event');
     }
   });
+  print('Subscribed.  Pause event is ${isolate.pauseEvent}');
 
   if (isolate.pauseEvent != null &&
       isolate.pauseEvent.kind == ServiceEvent.kPauseStart) {
     // Wait for the isolate to hit PauseStart.
     subscription.cancel();
+    print('Subscription cancelled.');
   } else {
+    print('Waiting for pause start event.');
     await completer.future;
   }
+  print('Done waiting for pause event.');
+
+  // Grab the timestamp.
+  var pausetime1 = isolate.pauseEvent.timestamp;
+  expect(pausetime1, isNotNull);
+  // Reload the isolate.
+  await isolate.reload();
+  // Verify that it is the same.
+  expect(pausetime1.millisecondsSinceEpoch,
+         equals(isolate.pauseEvent.timestamp.millisecondsSinceEpoch));
 
   completer = new Completer();
   stream = await isolate.vm.getEventStream(VM.kDebugStream);
@@ -48,10 +66,24 @@
 
   // Wait for the isolate to hit PauseExit.
   await completer.future;
+
+  // Grab the timestamp.
+  var pausetime2 = isolate.pauseEvent.timestamp;
+  expect(pausetime2, isNotNull);
+  // Reload the isolate.
+  await isolate.reload();
+  // Verify that it is the same.
+  expect(pausetime2.millisecondsSinceEpoch,
+         equals(isolate.pauseEvent.timestamp.millisecondsSinceEpoch));
+  expect(pausetime2.millisecondsSinceEpoch,
+         greaterThan(pausetime1.millisecondsSinceEpoch));
 },
 
 ];
 
 main(args) => runIsolateTests(args, tests,
                               testeeConcurrent: testMain,
-                              pause_on_start: true, pause_on_exit: true);
+                              pause_on_start: true,
+                              pause_on_exit: true,
+                              trace_service: true,
+                              verbose_vm: true);
diff --git a/runtime/observatory/tests/service/pause_on_start_then_step_test.dart b/runtime/observatory/tests/service/pause_on_start_then_step_test.dart
index 20e91c5..9fbf6ba 100644
--- a/runtime/observatory/tests/service/pause_on_start_then_step_test.dart
+++ b/runtime/observatory/tests/service/pause_on_start_then_step_test.dart
@@ -4,6 +4,7 @@
 // VMOptions=--error_on_bad_type --error_on_bad_override
 
 import 'package:observatory/service_io.dart';
+import 'package:unittest/unittest.dart';
 import 'test_helper.dart';
 import 'dart:async';
 
@@ -14,24 +15,41 @@
 var tests = [
 
 (Isolate isolate) async {
+  print('Getting stream...');
   Completer completer = new Completer();
   var stream = await isolate.vm.getEventStream(VM.kDebugStream);
+  print('Subscribing...');
   var subscription;
   subscription = stream.listen((ServiceEvent event) {
     if (event.kind == ServiceEvent.kPauseStart) {
-      print('Received PauseStart');
+      print('Received $event');
       subscription.cancel();
       completer.complete();
+    } else {
+      print('Ignoring event $event');
     }
   });
+  print('Subscribed.  Pause event is ${isolate.pauseEvent}');
 
   if (isolate.pauseEvent != null &&
       isolate.pauseEvent.kind == ServiceEvent.kPauseStart) {
     // Wait for the isolate to hit PauseStart.
     subscription.cancel();
+    print('Subscription cancelled.');
   } else {
+    print('Waiting for pause start event.');
     await completer.future;
   }
+  print('Done waiting for pause event.');
+
+  // Grab the timestamp.
+  var pausetime1 = isolate.pauseEvent.timestamp;
+  expect(pausetime1, isNotNull);
+  // Reload the isolate.
+  await isolate.reload();
+  // Verify that it is the same.
+  expect(pausetime1.millisecondsSinceEpoch,
+         equals(isolate.pauseEvent.timestamp.millisecondsSinceEpoch));
 
   completer = new Completer();
   stream = await isolate.vm.getEventStream(VM.kDebugStream);
@@ -41,17 +59,34 @@
       subscription.cancel();
       completer.complete();
     }
+    print('Got ${event.kind}');
   });
 
   print('Stepping...');
   isolate.stepInto();
 
   // Wait for the isolate to hit PauseBreakpoint.
+  print('Waiting for PauseBreakpoint');
   await completer.future;
+
+  // Grab the timestamp.
+  var pausetime2 = isolate.pauseEvent.timestamp;
+  expect(pausetime2, isNotNull);
+  // Reload the isolate.
+  await isolate.reload();
+  // Verify that it is the same.
+  expect(pausetime2.millisecondsSinceEpoch,
+         equals(isolate.pauseEvent.timestamp.millisecondsSinceEpoch));
+
+ expect(pausetime2.millisecondsSinceEpoch,
+        greaterThan(pausetime1.millisecondsSinceEpoch));
 },
 
 ];
 
 main(args) => runIsolateTests(args, tests,
                               testeeConcurrent: testMain,
-                              pause_on_start: true, pause_on_exit: true);
+                              pause_on_start: true,
+                              pause_on_exit: true,
+                              trace_service: true,
+                              verbose_vm: true);
diff --git a/runtime/observatory/tests/service/process_service_test.dart b/runtime/observatory/tests/service/process_service_test.dart
new file mode 100644
index 0000000..956cc77
--- /dev/null
+++ b/runtime/observatory/tests/service/process_service_test.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.
+
+import 'dart:async';
+import 'dart:convert';
+import 'dart:developer';
+import 'dart:io' as io;
+import 'package:observatory/service_io.dart';
+import 'package:unittest/unittest.dart';
+import 'test_helper.dart';
+
+Future setupProcesses() async {
+  var dir = await io.Directory.systemTemp.createTemp('file_service');
+
+  var args = ['--pause_isolates_on_start', io.Platform.script.toFilePath()];
+  var process1;
+  var process2;
+  var process3;
+
+  void closeDown() {
+    if (process1 != null) {
+      process1.kill();
+    }
+    if (process2 != null) {
+      process2.kill();
+    }
+    if (process3 != null) {
+      process3.kill();
+    }
+    dir.deleteSync(recursive: true);
+  }
+
+  Future<ServiceExtensionResponse> cleanup(ignored_a, ignored_b) {
+    closeDown();
+    var result = JSON.encode({'type' : 'foobar'});
+    return new Future.value(new ServiceExtensionResponse.result(result));
+  }
+
+  Future<ServiceExtensionResponse> setup(ignored_a, ignored_b) async {
+    try {
+      process1 = await io.Process.start(io.Platform.executable, args);
+      process2 = await io.Process.start(io.Platform.executable,
+                                        args..add('foobar'));
+      var codeFilePath = dir.path + io.Platform.pathSeparator + "other_file";
+      var codeFile = new io.File(codeFilePath);
+      await codeFile.writeAsString(
+          '''
+          import "dart:io";
+
+          void main() async {
+            await stdin.drain();
+          }
+          ''');
+      process3 = await io.Process.start(io.Platform.executable,
+                                        [codeFilePath]);
+    } catch (e) {
+      closeDown();
+      throw e;
+    }
+
+    var result =
+      JSON.encode({'type': 'foobar',
+                   'pids' : [process1.pid, process2.pid, process3.pid]});
+    return new Future.value(new ServiceExtensionResponse.result(result));
+  }
+
+  Future<ServiceExtensionResponse> closeStdin(ignored_a, ignored_b) async {
+    process3.stdin.close();
+    var result = JSON.encode({'type' : 'foobar'});
+    var returnValue =
+        new Future.value(new ServiceExtensionResponse.result(result));
+    return  process3.exitCode.then((int exit) => returnValue);
+  }
+
+  registerExtension('__cleanup', cleanup);
+  registerExtension('__setup', setup);
+  registerExtension('__closeStdin', closeStdin);
+
+}
+
+var processTests = [
+  // Initial.
+  (Isolate isolate) async {
+    var setup = await isolate.invokeRpcNoUpgrade('__setup', {});
+    try {
+      var all = await isolate.invokeRpcNoUpgrade('__getProcesses', {});
+      expect(all['type'], equals('_startedprocesses'));
+
+      expect(all['data'].length, equals(3));
+
+      var first = await isolate.invokeRpcNoUpgrade(
+          '__getProcessById', { 'id' : all['data'][0]['id'] });
+      expect(first['name'], io.Platform.executable);
+      expect(first['pid'], equals(setup['pids'][0]));
+      expect(first['arguments'].contains('foobar'), isFalse);
+      expect(first['startedAt'], greaterThan(0));
+
+      var second = await isolate.invokeRpcNoUpgrade(
+          '__getProcessById', { 'id' : all['data'][1]['id'] });
+      expect(second['name'], io.Platform.executable);
+      expect(second['pid'], equals(setup['pids'][1]));
+      expect(second['arguments'].contains('foobar'), isTrue);
+      expect(second['pid'] != first['pid'], isTrue);
+      expect(second['startedAt'], greaterThan(0));
+      expect(second['startedAt'], greaterThanOrEqualTo(first['startedAt']));
+
+      var third = await isolate.invokeRpcNoUpgrade(
+          '__getProcessById', { 'id' : all['data'][2]['id'] });
+      expect(third['name'], io.Platform.executable);
+      expect(third['pid'], equals(setup['pids'][2]));
+      expect(third['pid'] != first['pid'], isTrue);
+      expect(third['pid'] != second['pid'], isTrue);
+      expect(third['startedAt'], greaterThanOrEqualTo(second['startedAt']));
+
+      await isolate.invokeRpcNoUpgrade('__closeStdin', {});
+      all = await isolate.invokeRpcNoUpgrade('__getProcesses', {});
+      expect(all['type'], equals('_startedprocesses'));
+      expect(all['data'].length, equals(2));
+    } finally {
+      await isolate.invokeRpcNoUpgrade('__cleanup', {});
+    }
+  },
+];
+
+main(args) async => runIsolateTests(args, processTests,
+                                    testeeBefore:setupProcesses);
diff --git a/runtime/observatory/tests/service/read_stream_test.dart b/runtime/observatory/tests/service/read_stream_test.dart
index 74c12a2..1376d50 100644
--- a/runtime/observatory/tests/service/read_stream_test.dart
+++ b/runtime/observatory/tests/service/read_stream_test.dart
@@ -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.
-// VMOptions=--compile_all --error_on_bad_type --error_on_bad_override
+// VMOptions=--error_on_bad_type --error_on_bad_override
 
 import 'package:observatory/object_graph.dart';
 import 'package:unittest/unittest.dart';
diff --git a/runtime/observatory/tests/service/service.status b/runtime/observatory/tests/service/service.status
index ce688fb..1aeac65 100644
--- a/runtime/observatory/tests/service/service.status
+++ b/runtime/observatory/tests/service/service.status
@@ -6,22 +6,6 @@
 evaluate_activation_test/instance: RuntimeError # http://dartbug.com/20047
 evaluate_activation_test/scope: RuntimeError # http://dartbug.com/20047
 
-# Unexpected number format
-[ $system == windows ]
-code_test: Skip
-
-# Null code assertion http://dartbug.com/23290
-[ $system == windows ]
-coverage_test: Skip
-
-# Issue 23201
-[ $system == windows ]
-debugging_test: Skip
-
-# Tests that depend on token positions (which differ in release mode).
-[ $mode == release ]
-debugging_test: Skip
-
 # Disable on simulators.
 [ $arch == simarm || $arch == simmips || $arch == simarm64]
 *: SkipSlow
@@ -29,3 +13,10 @@
 # All tests use dart:io
 [ $browser || $compiler == dart2js ]
 *: SkipByDesign
+
+# Tests with known analyzer issues
+[ $compiler == dartanalyzer || $compiler == dart2analyzer ]
+developer_extension_test: SkipByDesign
+
+[ $arch == arm ]
+process_service_test: Pass, Fail # Issue 24344
diff --git a/runtime/observatory/tests/service/set_library_debuggable_rpc_test.dart b/runtime/observatory/tests/service/set_library_debuggable_rpc_test.dart
index fea9fed..fe51ff7 100644
--- a/runtime/observatory/tests/service/set_library_debuggable_rpc_test.dart
+++ b/runtime/observatory/tests/service/set_library_debuggable_rpc_test.dart
@@ -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.
-// VMOptions=--compile_all --error_on_bad_type --error_on_bad_override
+// VMOptions=--error_on_bad_type --error_on_bad_override
 
 library set_library_debuggable_rpc_test;
 
diff --git a/runtime/observatory/tests/service/set_vm_name_rpc_test.dart b/runtime/observatory/tests/service/set_vm_name_rpc_test.dart
new file mode 100644
index 0000000..7e3a53a
--- /dev/null
+++ b/runtime/observatory/tests/service/set_vm_name_rpc_test.dart
@@ -0,0 +1,35 @@
+// 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 --vm-name=Walter
+
+import 'dart:async';
+import 'package:observatory/service_io.dart';
+import 'package:unittest/unittest.dart';
+import 'test_helper.dart';
+
+var tests = [
+  (VM vm) async {
+    expect(vm.name, equals('Walter'));
+
+    Completer completer = new Completer();
+    var stream = await vm.getEventStream(VM.kVMStream);
+    var subscription;
+    subscription = stream.listen((ServiceEvent event) {
+      if (event.kind == ServiceEvent.kVMUpdate) {
+        expect(event.owner.type, equals('VM'));
+        expect(event.owner.name, equals('Barbara'));
+        subscription.cancel();
+        completer.complete();
+      }
+    });
+    
+    var result = await vm.setName('Barbara');
+    expect(result.type, equals('Success'));
+
+    await completer.future;
+    expect(vm.name, equals('Barbara'));
+  },
+];
+
+main(args) async => runVMTests(args, tests, trace_service: true);
diff --git a/runtime/observatory/tests/service/smart_next_test.dart b/runtime/observatory/tests/service/smart_next_test.dart
new file mode 100644
index 0000000..aeb819f
--- /dev/null
+++ b/runtime/observatory/tests/service/smart_next_test.dart
@@ -0,0 +1,70 @@
+// 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/service_io.dart';
+import 'test_helper.dart';
+import 'dart:async';
+import 'dart:developer';
+
+foo() async { }
+bar() { }
+
+doAsync(stop) async {
+  if (stop) debugger();
+  await foo(); // Line 16.
+  bar();       // Line 17.
+  bar();       // Line 18.
+  await foo(); // Line 19.
+  await foo(); // Line 20.
+  bar();       // Line 21.
+  return null;
+}
+
+testMain() {
+  // With two runs of doAsync floating around, async step should only cause
+  // us to stop in the run we started in.
+  doAsync(false);
+  doAsync(true);
+}
+
+stepOverAwaitingResume(Isolate isolate) async {
+  Completer completer = new Completer();
+  await isolate.vm.getEventStream(VM.kDebugStream).then((stream) {
+    var subscription;
+    subscription = stream.listen((ServiceEvent event) {
+      if (event.kind == ServiceEvent.kResume) {
+        subscription.cancel();
+        completer.complete();
+      }
+    });
+  });
+  isolate.stepOver();
+  return completer.future;
+}
+
+smartNext(Isolate isolate) async {
+  if (isolate.pauseEvent.atAsyncJump) {
+    print("next-async");
+    return isolate.asyncStepOver()[Isolate.kSecondResume];
+  } else {
+    print("next-sync");
+    return stepOverAwaitingResume(isolate);
+  }
+}
+
+var tests = [
+             hasStoppedAtBreakpoint, stoppedAtLine(16), // foo()
+  smartNext, hasStoppedAtBreakpoint, stoppedAtLine(16), // await
+  smartNext, hasStoppedAtBreakpoint, stoppedAtLine(17), // bar()
+  smartNext, hasStoppedAtBreakpoint, stoppedAtLine(18), // bar()
+  smartNext, hasStoppedAtBreakpoint, stoppedAtLine(19), // foo()
+  smartNext, hasStoppedAtBreakpoint, stoppedAtLine(19), // await
+  smartNext, hasStoppedAtBreakpoint, stoppedAtLine(20), // foo()
+  smartNext, hasStoppedAtBreakpoint, stoppedAtLine(20), // await
+  smartNext, hasStoppedAtBreakpoint, stoppedAtLine(21), // bar()
+  resumeIsolate,
+];
+
+main(args) => runIsolateTests(args, tests, testeeConcurrent: testMain);
diff --git a/runtime/observatory/tests/service/steal_breakpoint_test.dart b/runtime/observatory/tests/service/steal_breakpoint_test.dart
index 95a4191..5c7c1b6 100644
--- a/runtime/observatory/tests/service/steal_breakpoint_test.dart
+++ b/runtime/observatory/tests/service/steal_breakpoint_test.dart
@@ -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.
-// VMOptions=--compile_all --error_on_bad_type --error_on_bad_override --steal-breakpoints
+// VMOptions=--error_on_bad_type --error_on_bad_override --steal-breakpoints
 
 import 'package:observatory/service_io.dart';
 import 'package:unittest/unittest.dart';
diff --git a/runtime/observatory/tests/service/step_into_async_no_await_test.dart b/runtime/observatory/tests/service/step_into_async_no_await_test.dart
new file mode 100644
index 0000000..f9dddd5
--- /dev/null
+++ b/runtime/observatory/tests/service/step_into_async_no_await_test.dart
@@ -0,0 +1,32 @@
+// 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  --verbose_debug
+
+import 'test_helper.dart';
+import 'dart:developer';
+
+// :async_op will not be captured in this function because it never needs to
+// reschedule it.
+asyncWithoutAwait() async {
+  print("asyncWithoutAwait");
+}
+
+testMain() {
+  debugger();
+  asyncWithoutAwait();  // Line 17
+}
+
+var tests = [
+  hasStoppedAtBreakpoint,
+  stoppedAtLine(17),
+  (isolate) => isolate.stepInto(),
+  hasStoppedAtBreakpoint,
+  (isolate) => isolate.getStack(),  // Should not crash.
+  // TODO(rmacnak): stoppedAtLine(12)
+  // This doesn't happen because asyncWithoutAwait is marked undebuggable.
+  // Probably needs to change to support async-step-into.
+  resumeIsolate,
+];
+
+main(args) => runIsolateTests(args, tests, testeeConcurrent: testMain);
diff --git a/runtime/observatory/tests/service/string_escaping_test.dart b/runtime/observatory/tests/service/string_escaping_test.dart
index 0fd3c6a..fd99cee 100644
--- a/runtime/observatory/tests/service/string_escaping_test.dart
+++ b/runtime/observatory/tests/service/string_escaping_test.dart
@@ -1,7 +1,7 @@
 // Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
-// VMOptions=--compile_all --error_on_bad_type --error_on_bad_override
+// VMOptions=--error_on_bad_type --error_on_bad_override
 
 library string_escaping_test;
 
diff --git a/runtime/observatory/tests/service/tcp_socket_closing_service_test.dart b/runtime/observatory/tests/service/tcp_socket_closing_service_test.dart
new file mode 100644
index 0000000..20a9b76
--- /dev/null
+++ b/runtime/observatory/tests/service/tcp_socket_closing_service_test.dart
@@ -0,0 +1,74 @@
+// 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:convert';
+import 'dart:io' as io;
+import 'package:observatory/service_io.dart';
+import 'package:unittest/unittest.dart';
+import 'test_helper.dart';
+
+
+/// Test that we correctly remove sockets that have been closed from the list
+/// of open sockets. We explictly leave one socket open.
+
+Future setup() async {
+  var serverSocket = await io.ServerSocket.bind('127.0.0.1', 0);
+  serverSocket.listen((s) {
+    s.drain();
+    s.close();
+  });
+  var socket = await io.Socket.connect("127.0.0.1", serverSocket.port);
+  socket.write("foobar");
+  socket.write("foobar");
+
+  await socket.flush();
+  await socket.close();
+  await socket.drain();
+
+  var socket2 = await io.Socket.connect("127.0.0.1", serverSocket.port);
+  socket2.write("foobarfoobar");
+  await socket2.flush();
+  await socket2.close();
+  await socket2.drain();
+  await serverSocket.close();
+
+  var server = await io.RawDatagramSocket.bind('127.0.0.1', 0);
+  server.listen((io.RawSocketEvent event) {
+    if(event == io.RawSocketEvent.READ) {
+      io.Datagram dg = server.receive();
+      dg.data.forEach((x) => true);
+      server.close();
+    }
+  });
+  var client = await io.RawDatagramSocket.bind('127.0.0.1', 0);
+  client.send(UTF8.encoder.convert('foobar'),
+              new io.InternetAddress('127.0.0.1'), server.port);
+  client.close();
+
+  // The one socket to expect.
+  await io.ServerSocket.bind('127.0.0.1', 0);
+}
+
+var tests = [
+  // Initial.
+  (Isolate isolate) async {
+    var result = await isolate.invokeRpcNoUpgrade('__getOpenSockets', {});
+    expect(result['type'], equals('_opensockets'));
+    // We expect only one socket to be open, the server socket create at the
+    // end of test.
+    expect(result['data'].length, equals(1));
+    var server = await isolate.invokeRpcNoUpgrade(
+        '__getSocketByID', { 'id' : result['data'][0]['id'] });
+    expect(server['listening'], isTrue);
+    expect(server['lastRead'], equals(0));
+    expect(server['totalRead'], equals(0));
+    expect(server['lastWrite'], equals(0));
+    expect(server['totalWritten'], equals(0));
+    expect(server['writeCount'], equals(0));
+    expect(server['readCount'], equals(0));
+  },
+];
+
+main(args) async => runIsolateTests(args, tests, testeeBefore:setup);
diff --git a/runtime/observatory/tests/service/tcp_socket_service_test.dart b/runtime/observatory/tests/service/tcp_socket_service_test.dart
new file mode 100644
index 0000000..f8dff03
--- /dev/null
+++ b/runtime/observatory/tests/service/tcp_socket_service_test.dart
@@ -0,0 +1,166 @@
+// 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:convert';
+import 'dart:io' as io;
+import 'package:observatory/service_io.dart';
+import 'package:unittest/unittest.dart';
+import 'test_helper.dart';
+
+Future setupTCP() async {
+  // Note that we don't close after us, by design we leave the sockets opens
+  // to allow us to query them from the other isolate.
+  var serverSocket = await io.ServerSocket.bind('127.0.0.1', 0);
+  serverSocket.listen((s) {
+    s.transform(UTF8.decoder).listen(print);
+    s.close();
+  });
+  var socket = await io.Socket.connect("127.0.0.1", serverSocket.port);
+  socket.write("foobar");
+  socket.write("foobar");
+  await socket.flush();
+
+  var socket2 = await io.Socket.connect("127.0.0.1", serverSocket.port);
+  socket2.write("foobarfoobar");
+  await socket2.flush();
+}
+
+var tcpTests = [
+  // Initial.
+  (Isolate isolate) async {
+    var result = await isolate.invokeRpcNoUpgrade('__getOpenSockets', {});
+    expect(result['type'], equals('_opensockets'));
+    // We expect 3 sockets to be open (in this order):
+    //   The server socket accepting connections, on port X
+    //   The accepted connection on the client, on port Y
+    //   The client connection, on port X
+    expect(result['data'].length, equals(5));
+    // The first socket will have a name like listening:127.0.0.1:X
+    // The second will have a name like 127.0.0.1:Y
+    // The third will have a name like 127.0.0.1:X
+    expect(result['data'][0]['name'].startsWith('listening:127.0.0.1'), isTrue);
+    expect(result['data'][1]['name'].startsWith('127.0.0.1:'), isTrue);
+    expect(result['data'][2]['name'].startsWith('127.0.0.1:'), isTrue);
+
+    var listening = await isolate.invokeRpcNoUpgrade(
+        '__getSocketByID', { 'id' : result['data'][0]['id'] });
+    expect(listening['id'], equals(result['data'][0]['id']));
+    expect(listening['listening'], isTrue);
+    expect(listening['socketType'], equals('TCP'));
+    expect(listening['port'], greaterThanOrEqualTo(1024));
+    expect(listening['lastRead'], greaterThan(0));
+
+    expect(listening['totalRead'], equals(2));
+    expect(listening['lastWrite'], equals(0));
+    expect(listening['totalWritten'], equals(0));
+    expect(listening['writeCount'], equals(0));
+    expect(listening['readCount'], equals(2));
+    expect(listening['remoteHost'], equals('NA'));
+    expect(listening['remotePort'], equals('NA'));
+
+    var client = await isolate.invokeRpcNoUpgrade(
+        '__getSocketByID', { 'id' : result['data'][1]['id'] });
+    expect(client['id'], equals(result['data'][1]['id']));
+
+    var server = await isolate.invokeRpcNoUpgrade(
+        '__getSocketByID', { 'id' : result['data'][2]['id'] });
+    expect(server['id'], equals(result['data'][2]['id']));
+
+    // We expect the client to be connected on the port and
+    // host of the listening socket.
+    expect(client['remotePort'], equals(listening['port']));
+    expect(client['remoteHost'], equals(listening['host']));
+    // We expect the third socket (accepted server) to be connected to the
+    // same port and host as the listening socket (the listening one).
+    expect(server['port'], equals(listening['port']));
+    expect(server['host'], equals(listening['host']));
+
+    expect(client['listening'], isFalse);
+    expect(server['listening'], isFalse);
+
+    expect(client['socketType'], equals('TCP'));
+    expect(server['socketType'], equals('TCP'));
+
+    // We are using no reserved ports.
+    expect(client['port'], greaterThanOrEqualTo(1024));
+    expect(server['port'], greaterThanOrEqualTo(1024));
+
+    // The client and server "mirror" each other in reads and writes, and the
+    // timestamps are in correct order.
+    expect(client['lastRead'], equals(0));
+    expect(server['lastRead'], greaterThan(0));
+    expect(client['totalRead'], equals(0));
+    expect(server['totalRead'], equals(12));
+    expect(client['readCount'], equals(0));
+    expect(server['readCount'], greaterThanOrEqualTo(1));
+
+    expect(client['lastWrite'], greaterThan(0));
+    expect(server['lastWrite'], equals(0));
+    expect(client['totalWritten'], equals(12));
+    expect(server['totalWritten'], equals(0));
+    expect(client['writeCount'], greaterThanOrEqualTo(2));
+    expect(server['writeCount'], equals(0));
+
+    // Order
+    // Stopwatch resolution on windows can make us have the same timestamp.
+    if (io.Platform.isWindows) {
+      expect(server['lastRead'], greaterThanOrEqualTo(client['lastWrite']));
+    } else {
+      expect(server['lastRead'], greaterThan(client['lastWrite']));
+    }
+
+    var secondClient = await isolate.invokeRpcNoUpgrade(
+        '__getSocketByID', { 'id' : result['data'][3]['id'] });
+    expect(secondClient['id'], equals(result['data'][3]['id']));
+    var secondServer = await isolate.invokeRpcNoUpgrade(
+        '__getSocketByID', { 'id' : result['data'][4]['id'] });
+    expect(secondServer['id'], equals(result['data'][4]['id']));
+
+    // We expect the client to be connected on the port and
+    // host of the listening socket.
+    expect(secondClient['remotePort'], equals(listening['port']));
+    expect(secondClient['remoteHost'], equals(listening['host']));
+    // We expect the third socket (accepted server) to be connected to the
+    // same port and host as the listening socket (the listening one).
+    expect(secondServer['port'], equals(listening['port']));
+    expect(secondServer['host'], equals(listening['host']));
+
+    expect(secondClient['listening'], isFalse);
+    expect(secondServer['listening'], isFalse);
+
+    expect(secondClient['socketType'], equals('TCP'));
+    expect(secondServer['socketType'], equals('TCP'));
+
+    // We are using no reserved ports.
+    expect(secondClient['port'], greaterThanOrEqualTo(1024));
+    expect(secondServer['port'], greaterThanOrEqualTo(1024));
+
+    // The client and server "mirror" each other in reads and writes, and the
+    // timestamps are in correct order.
+    expect(secondClient['lastRead'], equals(0));
+    expect(secondServer['lastRead'], greaterThan(0));
+    expect(secondClient['totalRead'], equals(0));
+    expect(secondServer['totalRead'], equals(12));
+    expect(secondClient['readCount'], equals(0));
+    expect(secondServer['readCount'], greaterThanOrEqualTo(1));
+
+    expect(secondClient['lastWrite'], greaterThan(0));
+    expect(secondServer['lastWrite'], equals(0));
+    expect(secondClient['totalWritten'], equals(12));
+    expect(secondServer['totalWritten'], equals(0));
+    expect(secondClient['writeCount'], greaterThanOrEqualTo(1));
+    expect(secondServer['writeCount'], equals(0));
+
+    // Order
+    // Stopwatch resolution on windows make us sometimes report the same value.
+    if (io.Platform.isWindows) {
+      expect(server['lastRead'], greaterThanOrEqualTo(client['lastWrite']));
+    } else {
+      expect(server['lastRead'], greaterThan(client['lastWrite']));
+    }
+  },
+];
+
+main(args) async => runIsolateTests(args, tcpTests, testeeBefore:setupTCP);
diff --git a/runtime/observatory/tests/service/test_helper.dart b/runtime/observatory/tests/service/test_helper.dart
index d640dc5..6248b43 100644
--- a/runtime/observatory/tests/service/test_helper.dart
+++ b/runtime/observatory/tests/service/test_helper.dart
@@ -26,13 +26,19 @@
                             Platform.script.toFilePath(),
                             _TESTEE_MODE_FLAG] {}
 
-  Future<int> launch(bool pause_on_start, bool pause_on_exit) {
+  Future<int> launch(bool pause_on_start, bool pause_on_exit, bool trace_service) {
+    assert(pause_on_start != null);
+    assert(pause_on_exit != null);
+    assert(trace_service != null);
     String dartExecutable = Platform.executable;
     var fullArgs = [];
-    if (pause_on_start == true) {
+    if (trace_service) {
+      fullArgs.add('--trace-service');
+    }
+    if (pause_on_start) {
       fullArgs.add('--pause-isolates-on-start');
     }
-    if (pause_on_exit == true) {
+    if (pause_on_exit) {
       fullArgs.add('--pause-isolates-on-exit');
     }
     fullArgs.addAll(Platform.executableArguments);
@@ -102,7 +108,9 @@
                      {void testeeBefore(),
                       void testeeConcurrent(),
                       bool pause_on_start: false,
-                      bool pause_on_exit: false}) {
+                      bool pause_on_exit: false,
+                      bool trace_service: false,
+                      bool verbose_vm: false}) {
   assert(!pause_on_start || testeeBefore == null);
   if (mainArgs.contains(_TESTEE_MODE_FLAG)) {
     if (!pause_on_start) {
@@ -120,7 +128,7 @@
     }
   } else {
     var process = new _TestLauncher();
-    process.launch(pause_on_start, pause_on_exit).then((port) {
+    process.launch(pause_on_start, pause_on_exit, trace_service).then((port) {
       if (mainArgs.contains("--gdb")) {
         port = 8181;
       }
@@ -133,6 +141,7 @@
         new WebSocketVM(new WebSocketVMTarget(addr)).load()
             .then((VM vm) => vm.isolates.first.load())
             .then((Isolate isolate) => Future.forEach(tests, (test) {
+              isolate.vm.verbose = verbose_vm;
               print('Running $name [$testIndex/$totalTests]');
               testIndex++;
               return test(isolate);
@@ -155,7 +164,6 @@
   isolate.vm.getEventStream(VM.kDebugStream).then((stream) {
     var subscription;
     subscription = stream.listen((ServiceEvent event) {
-        print("Event: $event");
         if (event.kind == ServiceEvent.kPauseBreakpoint) {
           print('Breakpoint reached');
           subscription.cancel();
@@ -186,6 +194,41 @@
 }
 
 
+Future<Isolate> hasPausedAtStart(Isolate isolate) {
+  // Set up a listener to wait for breakpoint events.
+  Completer completer = new Completer();
+  isolate.vm.getEventStream(VM.kDebugStream).then((stream) {
+    var subscription;
+    subscription = stream.listen((ServiceEvent event) {
+        if (event.kind == ServiceEvent.kPauseStart) {
+          print('Paused at isolate start');
+          subscription.cancel();
+          if (completer != null) {
+            // Reload to update isolate.pauseEvent.
+            completer.complete(isolate.reload());
+            completer = null;
+          }
+        }
+    });
+
+    // Pause may have happened before we subscribed.
+    isolate.reload().then((_) {
+      if ((isolate.pauseEvent != null) &&
+         (isolate.pauseEvent.kind == ServiceEvent.kPauseStart)) {
+        print('Paused at isolate start');
+        subscription.cancel();
+        if (completer != null) {
+          completer.complete(isolate);
+          completer = null;
+        }
+      }
+    });
+  });
+
+  return completer.future;
+}
+
+
 // Currying is your friend.
 IsolateTest setBreakpointAtLine(int line) {
   return (Isolate isolate) async {
@@ -206,11 +249,20 @@
 
     ServiceMap stack = await isolate.getStack();
     expect(stack.type, equals('Stack'));
-    expect(stack['frames'].length, greaterThanOrEqualTo(1));
 
-    Frame top = stack['frames'][0];
+    List<Frame> frames = stack['frames'];
+    expect(frames.length, greaterThanOrEqualTo(1));
+
+    Frame top = frames[0];
     Script script = await top.location.script.load();
-    expect(script.tokenToLine(top.location.tokenPos), equals(line));
+    if (script.tokenToLine(top.location.tokenPos) != line) {
+      var sb = new StringBuffer();
+      sb.write("Expected to be at line $line, but got stack trace:\n");
+      for (Frame f in stack['frames']) {
+        sb.write(" $f\n");
+      }
+      throw sb.toString();
+    }
   };
 }
 
@@ -276,7 +328,9 @@
                   {Future testeeBefore(),
                    Future testeeConcurrent(),
                    bool pause_on_start: false,
-                   bool pause_on_exit: false}) async {
+                   bool pause_on_exit: false,
+                   bool trace_service: false,
+                   bool verbose_vm: false}) async {
   if (mainArgs.contains(_TESTEE_MODE_FLAG)) {
     if (!pause_on_start) {
       if (testeeBefore != null) {
@@ -293,7 +347,9 @@
     }
   } else {
     var process = new _TestLauncher();
-    process.launch(pause_on_start, pause_on_exit).then((port) async {
+    process.launch(pause_on_start,
+                   pause_on_exit,
+                   trace_service).then((port) async {
       if (mainArgs.contains("--gdb")) {
         port = 8181;
       }
@@ -305,6 +361,7 @@
       runZoned(() {
         new WebSocketVM(new WebSocketVMTarget(addr)).load()
             .then((VM vm) => Future.forEach(tests, (test) {
+              vm.verbose = verbose_vm;
               print('Running $name [$testIndex/$totalTests]');
               testIndex++;
               return test(vm);
diff --git a/runtime/observatory/tests/service/type_arguments_test.dart b/runtime/observatory/tests/service/type_arguments_test.dart
index 6741520..bfa2f93 100644
--- a/runtime/observatory/tests/service/type_arguments_test.dart
+++ b/runtime/observatory/tests/service/type_arguments_test.dart
@@ -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.
-// VMOptions=--compile_all --error_on_bad_type --error_on_bad_override
+// VMOptions=--error_on_bad_type --error_on_bad_override
 
 import 'package:observatory/service_io.dart';
 import 'package:unittest/unittest.dart';
diff --git a/runtime/observatory/tests/service/typed_data_test.dart b/runtime/observatory/tests/service/typed_data_test.dart
index 83be522..df52afd 100644
--- a/runtime/observatory/tests/service/typed_data_test.dart
+++ b/runtime/observatory/tests/service/typed_data_test.dart
@@ -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.
-// VMOptions=--compile_all --error_on_bad_type --error_on_bad_override
+// VMOptions=--error_on_bad_type --error_on_bad_override
 
 library typed_data_test;
 
diff --git a/runtime/observatory/tests/service/udp_socket_service_test.dart b/runtime/observatory/tests/service/udp_socket_service_test.dart
new file mode 100644
index 0000000..49ff5e4
--- /dev/null
+++ b/runtime/observatory/tests/service/udp_socket_service_test.dart
@@ -0,0 +1,82 @@
+// 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:convert';
+import 'dart:io' as io;
+import 'package:observatory/service_io.dart';
+import 'package:unittest/unittest.dart';
+import 'test_helper.dart';
+
+Future setupUDP() async {
+  var server = await io.RawDatagramSocket.bind('127.0.0.1', 0);
+  server.listen((io.RawSocketEvent event) {
+    if(event == io.RawSocketEvent.READ) {
+      io.Datagram dg = server.receive();
+      dg.data.forEach((x) => true);
+    }
+  });
+  var client = await io.RawDatagramSocket.bind('127.0.0.1', 0);
+  client.send(UTF8.encoder.convert('foobar'),
+              new io.InternetAddress('127.0.0.1'), server.port);
+}
+
+var udpTests = [
+  // Initial.
+  (Isolate isolate) async {
+    var result = await isolate.invokeRpcNoUpgrade('__getOpenSockets', {});
+    expect(result['type'], equals('_opensockets'));
+    // We expect 2 sockets to be open (in this order):
+    //   The server socket accepting connections, on port X
+    //   The client socket on port Y
+    expect(result['data'].length, equals(2));
+    // The first socket will have a name like listening:127.0.0.1:X
+    // The second will have a name like 127.0.0.1:Y
+    // The third will have a name like 127.0.0.1:X
+    expect(result['data'][0]['name'].startsWith('127.0.0.1'), isTrue);
+    expect(result['data'][1]['name'].startsWith('127.0.0.1:'), isTrue);
+
+    var server = await isolate.invokeRpcNoUpgrade(
+        '__getSocketByID', { 'id' : result['data'][0]['id'] });
+    expect(server['id'], equals(result['data'][0]['id']));
+    expect(server['remotePort'], equals('NA'));
+    expect(server['remoteHost'], equals('NA'));
+    expect(server['listening'], isFalse);
+    expect(server['socketType'], equals('UDP'));
+    expect(server['port'], greaterThanOrEqualTo(1024));
+    // Stopwatch resolution on windows makes us sometimes report 0;
+    if (io.Platform.isWindows) {
+      expect(server['lastRead'], greaterThanOrEqualTo(0));
+    } else {
+      expect(server['lastRead'], greaterThan(0));
+    }
+    expect(server['totalRead'], equals(6));
+    expect(server['lastWrite'], equals(0));
+    expect(server['totalWritten'], equals(0));
+    expect(server['writeCount'], equals(0));
+    expect(server['readCount'], greaterThanOrEqualTo(1));
+
+    var client = await isolate.invokeRpcNoUpgrade(
+        '__getSocketByID', { 'id' : result['data'][1]['id'] });
+    expect(client['id'], equals(result['data'][1]['id']));
+    expect(client['remotePort'], equals('NA'));
+    expect(client['remoteHost'], equals('NA'));
+    expect(client['listening'], isFalse);
+    expect(client['socketType'], equals('UDP'));
+    expect(client['port'], greaterThanOrEqualTo(1024));
+    expect(client['lastRead'], equals(0));
+    expect(client['totalRead'], equals(0));
+    // Stopwatch resolution on windows makes us sometimes report 0;
+    if (io.Platform.isWindows) {
+      expect(client['lastWrite'], greaterThanOrEqualTo(0));
+    } else {
+      expect(client['lastWrite'], greaterThan(0));
+    }
+    expect(client['totalWritten'], equals(6));
+    expect(client['writeCount'], greaterThanOrEqualTo(1));
+    expect(client['readCount'], equals(0));
+  },
+];
+
+main(args) async => runIsolateTests(args, udpTests, testeeBefore:setupUDP);
diff --git a/runtime/observatory/tests/service/vm_restart_test.dart b/runtime/observatory/tests/service/vm_restart_test.dart
new file mode 100644
index 0000000..8f5da2e
--- /dev/null
+++ b/runtime/observatory/tests/service/vm_restart_test.dart
@@ -0,0 +1,105 @@
+// 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=--compile-all --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 count = 0;
+
+void test() {
+  while (true) {
+    count++;
+    debugger();
+  }
+}
+
+var tests = [
+  hasStoppedAtBreakpoint,
+
+  (Isolate isolate) async {
+    // The loop has run one time.
+    var result = await isolate.rootLibrary.evaluate('count');
+    expect(result.type, equals('Instance'));
+    expect(result.valueAsString, equals('1'));
+
+    Completer completer = new Completer();
+    var stream = await isolate.vm.getEventStream(VM.kDebugStream);
+    var subscription;
+    subscription = stream.listen((ServiceEvent event) {
+      if (event.kind == ServiceEvent.kResume) {
+        subscription.cancel();
+        completer.complete();
+      }
+    });
+    isolate.resume();
+    await completer.future;
+
+    // The loop has run twice.
+    result = await isolate.rootLibrary.evaluate('count');
+    expect(result.type, equals('Instance'));
+    expect(result.valueAsString, equals('2'));
+  },
+
+  hasStoppedAtBreakpoint,
+
+  (Isolate isolate) async {
+    Isolate newIsolate = null;
+
+    Completer testCompleter = new Completer();
+    var debugStream = await isolate.vm.getEventStream(VM.kDebugStream);
+    var debugSub;
+    debugSub = debugStream.listen((ServiceEvent event) {
+      if (event.kind == ServiceEvent.kPauseBreakpoint) {
+        if (event.isolate == newIsolate) {
+          // The old isolate has died and the new isolate is at
+          // the breakpoint.
+          newIsolate.reload().then((_) {
+            newIsolate.rootLibrary.evaluate('count').then((result) {
+              expect(result.type, equals('Instance'));
+              expect(result.valueAsString, equals('1'));
+              debugSub.cancel();
+              testCompleter.complete();
+            });
+          });
+        }
+      }
+    });
+    
+    Completer restartCompleter = new Completer();
+    var isolateStream = await isolate.vm.getEventStream(VM.kIsolateStream);
+    var isolateSub;
+    bool exit = false;
+    bool start = false;
+    isolateSub = isolateStream.listen((ServiceEvent event) {
+      if (event.kind == ServiceEvent.kIsolateExit) {
+        expect(event.isolate, equals(isolate));
+        print('Old isolate exited');
+        exit = true;
+      }
+      if (event.kind == ServiceEvent.kIsolateStart) {
+        print('New isolate started');
+        newIsolate = event.isolate;
+        start = true;
+      }
+      if (exit && start) {
+        isolateSub.cancel();
+        restartCompleter.complete();
+      }
+    });
+
+    // Restart the vm.
+    print("restarting");
+    await isolate.vm.restart();
+    await restartCompleter.future;
+    print("restarted");
+    await testCompleter.future;
+  },
+];
+
+  
+main(args) => runIsolateTests(args, tests, testeeConcurrent: test);
diff --git a/runtime/observatory/tests/service/vm_test.dart b/runtime/observatory/tests/service/vm_test.dart
index bbce87b..eedf6ae 100644
--- a/runtime/observatory/tests/service/vm_test.dart
+++ b/runtime/observatory/tests/service/vm_test.dart
@@ -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.
-// VMOptions=--compile_all --error_on_bad_type --error_on_bad_override
+// VMOptions=--error_on_bad_type --error_on_bad_override
 
 import 'package:observatory/service_io.dart';
 import 'package:unittest/unittest.dart';
diff --git a/runtime/observatory/tests/service/weak_properties_test.dart b/runtime/observatory/tests/service/weak_properties_test.dart
index 7de95c1..02f4d31 100644
--- a/runtime/observatory/tests/service/weak_properties_test.dart
+++ b/runtime/observatory/tests/service/weak_properties_test.dart
@@ -1,7 +1,7 @@
 // Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
-// VMOptions=--compile_all --error_on_bad_type --error_on_bad_override
+// VMOptions=--error_on_bad_type --error_on_bad_override
 
 library vm_references_test;
 
diff --git a/runtime/observatory/tests/ui/inspector.dart b/runtime/observatory/tests/ui/inspector.dart
index 450cfeb..fd6d0c3 100644
--- a/runtime/observatory/tests/ui/inspector.dart
+++ b/runtime/observatory/tests/ui/inspector.dart
@@ -11,153 +11,240 @@
 import 'dart:developer';
 import 'dart:typed_data';
 
-class A <T> {}
-class B <S extends num> {}
+part 'inspector_part.dart';
 
-var array;
-var bigint;
-var blockClean;
-var blockCopying;
-var blockFull;
-var blockFullWithChain;
-var boundedType;
-var capability;
-var counter;
-var expando;
-var float32x4;
-var float64;
-var float64x2;
-var gauge;
-var growableList;
-var int32x4;
-var isolate;
-var map;
-var mint;
-var mirrorClass;
-var mirrorClosure;
-var mirrorInstance;
-var mirrorReference;
-var portReceive;
-var portSend;
-var regex;
-var smi;
-var stacktrace;
-var string;
-var stringEscapedUnicodeEscape;
-var stringHebrew;
-var stringLatin1;
-var stringMalformedLead;
-var stringMalformedTrail;
-var stringNewLinesAndTabs;
-var stringNullInTheMiddle;
-var stringSnowflake;
-var stringTrebleClefs;
-var stringUnicode;
-var theFalse;
-var theNull;
-var theTrue;
-var type;
-var typeParameter;
-var typedData;
+var libraryField;
+var node;
 var uninitialized = new Object();
-var userTag;
-var weakProperty;
 
 extractPrivateField(obj, name) {
   return reflect(obj).getField(MirrorSystem.getSymbol(name, reflect(obj).type.owner)).reflectee;
 }
 
-genStacktrace() {
-  try {
-    num.parse(',');
-  } catch (e, s) {
-    return s;
+class A <T> {}
+class B <S extends num> {}
+
+class Node {
+  static var classField;
+
+  var nullable;
+  var mixedType;
+  var array;
+  var bigint;
+  var blockClean;
+  var blockCopying;
+  var blockFull;
+  var blockFullWithChain;
+  var boundedType;
+  var capability;
+  var counter;
+  var expando;
+  var float32x4;
+  var float64;
+  var float64x2;
+  var gauge;
+  var growableList;
+  var int32x4;
+  var isolate;
+  var map;
+  var mint;
+  var mirrorClass;
+  var mirrorClosure;
+  var mirrorInstance;
+  var mirrorReference;
+  var portReceive;
+  var portSend;
+  var regex;
+  var smi;
+  var stacktrace;
+  var string;
+  var stringLatin1;
+  var stringSnowflake;
+  var stringUnicode;
+  var stringHebrew;
+  var stringTrebleClef;
+  var theFalse;
+  var theNull;
+  var theTrue;
+  var type;
+  var typeParameter;
+  var typedData;
+  var userTag;
+  var weakProperty;
+
+  genStacktrace() {
+    try {
+      num.parse(',');
+    } catch (e, s) {
+      return s;
+    }
   }
-}
 
-genCleanBlock() {
-  block(x) => x;
-  return block;
-}
-
-genCopyingBlock() {
-  final x = 'I could be copied down';
-  block() => x;
-  return block;
-}
-
-genFullBlock() {
-  var x = 0;
-  block() => x++;
-  return block;
-}
-
-genFullBlockWithChain() {
-  var x = 0;
-  outer() {
-    var y = 0;
-    block() => x++ + y++;
+  genCleanBlock() {
+    block(x) => x;
     return block;
   }
-  return outer;
+
+  genCopyingBlock() {
+    final x = 'I could be copied down';
+    block() => x;
+    return block;
+  }
+
+  genFullBlock() {
+    var x = 0;
+    block() => x++;
+    return block;
+  }
+
+  genFullBlockWithChain() {
+    var x = 0;
+    outer() {
+      var y = 0;
+      block() => x++ + y++;
+      return block;
+    }
+    return outer;
+  }
+
+  f(int x) {
+    ++x;
+    return x;
+  }
+
+  main() {
+    print("Started main");
+
+    f(9);
+
+    nullable = 1;
+    nullable = null;
+    nullable = 1;
+    mixedType = 1;
+    mixedType = "2";
+    mixedType = false;
+
+    array = new List(3);
+    array[0] = 1;
+    array[1] = 2;
+    array[2] = 3;
+    bigint = 1 << 65;
+    blockClean = genCleanBlock();
+    blockCopying = genCopyingBlock();
+    blockFull = genFullBlock();
+    blockFullWithChain = genFullBlockWithChain();
+    boundedType = extractPrivateField(reflect(new B<int>()).type.typeVariables.single, '_reflectee');
+    counter = new Counter("CounterName", "Counter description");
+    expando = new Expando("expando-name");
+    expando[array] = 'The weakly associated value';
+    float32x4 = new Float32x4(0.0, -1.0, 3.14, 2e28);
+    float64 = 3.14;
+    float64x2 = new Float64x2(0.0, 3.14);
+    gauge = new Gauge("GaugeName", "Gauge description", 0.0, 100.0);
+    growableList = new List();
+    int32x4 = new Int32x4(0,1,10,11);
+    map = { "x-key": "x-value", "y-key": "y-value", "removed-key": "removed-value" };
+    map.remove("removed-key");
+    mint = 1 << 32;
+    mirrorClass = reflectClass(Object);
+    mirrorClosure = reflect(blockFull);
+    mirrorInstance = reflect("a reflectee");
+    mirrorReference = extractPrivateField(mirrorClass, '_reflectee');
+    portReceive = new RawReceivePort();
+    portSend = portReceive.sendPort;
+    regex = new RegExp("a*b+c");
+    smi = 7;
+    stacktrace = genStacktrace();
+    string = "Hello $smi ${smi.runtimeType}";
+    stringLatin1 = "blåbærgrød";
+    stringSnowflake = "❄";
+    stringUnicode = "Îñţérñåţîöñåļîžåţîờñ";
+    stringHebrew = "שלום רב שובך צפורה נחמדת";  // An example of Right-to-Left.
+    stringTrebleClef = "𝄞";  // An example of a surrogate pair.
+    theFalse = false;
+    theNull = null;
+    theTrue = true;
+    type = String;
+    typeParameter = extractPrivateField(reflectClass(A).typeVariables.single, '_reflectee');
+    typedData = extractPrivateField(new ByteData(64), '_typedData');
+    userTag = new UserTag("Example tag name");
+    weakProperty = extractPrivateField(expando, '_data').firstWhere((e) => e != null);
+
+    Isolate.spawn(secondMain, "Hello2").then((otherIsolate) {
+      isolate = otherIsolate;
+      portSend = otherIsolate.controlPort;
+      capability = otherIsolate.terminateCapability;
+    });
+    Isolate.spawn(secondMain, "Hello3").then((otherIsolate) {
+      isolate = otherIsolate;
+      portSend = otherIsolate.controlPort;
+      capability = otherIsolate.terminateCapability;
+    });
+
+    print("Finished main");
+    busy();
+  }
+
+  busy() {
+    var localVar = 0;
+    while (true) {
+      localVar = (localVar + 1) & 0xFFFF;
+    }
+  }
 }
 
-secondMain(msg) { }
+secondMain(msg) {
+  print("Hello from second isolate");
+}
+
+var typed;
+class Typed {
+  var float32List = new Float32List(16);
+  var float64List = new Float64List(16);
+
+  var int32x4 = new Int32x4(1, 2, 3, 4);
+  var float32x4 = new Float32x4.zero();
+  var float64x2 = new Float64x2.zero();
+  var int32x4List = new Int32x4List(16);
+  var float32x4List = new Float32x4List(16);
+  var float64x2List = new Float64x2List(16);
+
+  var int8List = new Int8List(8);
+  var int16List = new Int16List(8);
+  var int32List = new Int32List(8);
+  var int64List = new Int64List(8);
+  var uint8List = new Uint8List(8);
+  var uint16List = new Uint16List(8);
+  var uint32List = new Uint32List(8);
+  var uint64List = new Uint64List(8);
+  var uint8ClampedList = new Uint8ClampedList(8);
+
+  var byteBuffer = new Uint8List(8).buffer;
+  var byteBuffer2 = new Float32List(8).buffer;
+
+  var byteData = new ByteData(8);
+
+  Typed() {
+    float32List[0] = 3.14;
+    int8List[0] = 5;
+  }
+
+  Typed._named() {
+    float32List[0] = 3.14;
+    int8List[0] = 5;
+  }
+}
 
 main() {
-  print("Started main");
+  libraryField = 'Library field value';
+  Node.classField = 'Class field value';
+  typed = new Typed();
+  node = new Node();
+  node.main();
+}
 
-  array = new List(1);
-  bigint = 1 << 65;
-  blockClean = genCleanBlock();
-  blockCopying = genCopyingBlock();
-  blockFull = genFullBlock();
-  blockFullWithChain = genFullBlockWithChain();
-  boundedType = extractPrivateField(reflect(new B<int>()).type.typeVariables.single, '_reflectee');
-  counter = new Counter("CounterName", "Counter description");
-  expando = new Expando("expando-name");
-  expando[array] = 'The weakly associated value';
-  float32x4 = new Float32x4.zero();
-  float64 = 3.14;
-  float64x2 = new Float64x2.zero();
-  gauge = new Gauge("GaugeName", "Gauge description", 0.0, 100.0);
-  growableList = new List();
-  int32x4 = new Int32x4(0,0,0,0);
-  map = { "x":3, "y":4 };
-  mint = 1 << 32;
-  mirrorClass = reflectClass(Object);
-  mirrorClosure = reflect(blockFull);
-  mirrorInstance = reflect("a reflectee");
-  mirrorReference = extractPrivateField(mirrorClass, '_reflectee');
-  portReceive = new RawReceivePort();
-  regex = new RegExp("a*b+c");
-  smi = 7;
-  stacktrace = genStacktrace();
-  string = "Hello";
-  stringEscapedUnicodeEscape = "Should not be A: \\u0041";
-  stringHebrew = "שלום רב שובך צפורה נחמדת";  // Right-to-left text.
-  stringLatin1 = "blåbærgrød";
-  stringMalformedLead = "before" + "𝄞"[0] + "after";
-  stringMalformedTrail = "before" + "𝄞"[1] + "after";
-  stringNewLinesAndTabs = "One fish\ttwo fish\nRed fish\tBlue fish\n";
-  stringNullInTheMiddle = "There are four\u0000 words.";
-  stringSnowflake = "❄";
-  stringTrebleClefs = "1𝄞2𝄞𝄞3𝄞𝄞𝄞";  // Surrogate pair.
-  stringUnicode = "Îñţérñåţîöñåļîžåţîờñ";
-  theFalse = false;
-  theNull = null;
-  theTrue = true;
-  type = String;
-  typeParameter = extractPrivateField(reflectClass(A).typeVariables.single, '_reflectee');
-  typedData = extractPrivateField(new ByteData(64), '_typedData');
-  userTag = new UserTag("Example tag name");
-  weakProperty = extractPrivateField(expando, '_data').firstWhere((e) => e != null);
-
-  Isolate.spawn(secondMain, "Hello").then((otherIsolate) {
-    isolate = otherIsolate;
-    portSend = otherIsolate.controlPort;
-    capability = otherIsolate.terminateCapability;
-  });
-
-  print("Finished main");
+class C {
+  static doPrint() {
+    print("Original");
+  }
 }
diff --git a/runtime/observatory/tests/ui/inspector_part.dart b/runtime/observatory/tests/ui/inspector_part.dart
new file mode 100644
index 0000000..7d3bcb6
--- /dev/null
+++ b/runtime/observatory/tests/ui/inspector_part.dart
@@ -0,0 +1,21 @@
+// 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 manual_inspector_test;
+
+functionInPart() {
+
+}
+
+set explicitSetter(x) {}
+
+get explicitGetter {}
+
+
+class D {
+  set explicitSetter(x) {}
+
+  get explicitGetter {}
+}
+
diff --git a/runtime/observatory/web/index.html b/runtime/observatory/web/index.html
index 9353a41..d318cf7 100644
--- a/runtime/observatory/web/index.html
+++ b/runtime/observatory/web/index.html
@@ -4,7 +4,6 @@
   <meta charset="utf-8">
   <title>Dart VM Observatory</title>
   <link rel="import" href="packages/polymer/polymer.html">
-  <script type="text/javascript" src="https://www.google.com/jsapi"></script>
   <link rel="stylesheet" href="packages/observatory/src/elements/css/shared.css">
   <link rel="import" href="packages/observatory/elements.html">
   <script type="application/dart" src="main.dart"></script>
diff --git a/runtime/observatory/web/main.dart b/runtime/observatory/web/main.dart
index 928bd61..238bf97 100644
--- a/runtime/observatory/web/main.dart
+++ b/runtime/observatory/web/main.dart
@@ -3,7 +3,6 @@
 // BSD-style license that can be found in the LICENSE file.
 
 import 'package:logging/logging.dart';
-import 'package:observatory/app.dart';
 import 'package:polymer/polymer.dart';
 
 main() {
@@ -19,16 +18,12 @@
       print('${rec.level.name}: ${rec.time}: ${rec.message}');
   });
   Logger.root.info('Starting Observatory');
-  var chartsLoaded = GoogleChart.initOnce();
-  chartsLoaded.then((_) {
-    // Charts loaded, initialize polymer.
-    initPolymer().then((zone) {
-      Logger.root.info('Polymer initialized');
-      // Code here is in the polymer Zone, which ensures that
-      // @observable properties work correctly.
-      Polymer.onReady.then((_) {
-        Logger.root.info('Polymer elements have been upgraded');
-      });
+  initPolymer().then((zone) {
+    Logger.root.info('Polymer initialized');
+    // Code here is in the polymer Zone, which ensures that
+    // @observable properties work correctly.
+    Polymer.onReady.then((_) {
+      Logger.root.info('Polymer elements have been upgraded');
     });
   });
 }
diff --git a/runtime/platform/globals.h b/runtime/platform/globals.h
index 0d49310..cd7b058 100644
--- a/runtime/platform/globals.h
+++ b/runtime/platform/globals.h
@@ -94,8 +94,8 @@
 // TODO(iposva): Rename TARGET_OS_MACOS to TARGET_OS_MAC to inherit
 // the value defined in TargetConditionals.h
 #define TARGET_OS_MACOS 1
-#if TARGET_OS_IPHONE
-#define TARGET_OS_IOS
+#if TARGET_OS_IPHONE && !defined(TARGET_OS_IOS)
+#define TARGET_OS_IOS 1
 #endif
 
 #elif defined(_WIN32)
@@ -279,17 +279,17 @@
 #elif defined(TARGET_ARCH_X64)
   // No simulator used.
 #elif defined(TARGET_ARCH_ARM)
-#if !defined(HOST_ARCH_ARM) || defined(TARGET_OS_IOS)
+#if !defined(HOST_ARCH_ARM) || TARGET_OS_IOS
 #define USING_SIMULATOR 1
 #endif
 
 #elif defined(TARGET_ARCH_ARM64)
-#if !defined(HOST_ARCH_ARM64) || defined(TARGET_OS_IOS)
+#if !defined(HOST_ARCH_ARM64) || TARGET_OS_IOS
 #define USING_SIMULATOR 1
 #endif
 
 #elif defined(TARGET_ARCH_MIPS)
-#if !defined(HOST_ARCH_MIPS) || defined(TARGET_OS_IOS)
+#if !defined(HOST_ARCH_MIPS) || TARGET_OS_IOS
 #define USING_SIMULATOR 1
 #endif
 
diff --git a/runtime/tests/vm/dart/spawn_infinite_loop_test.dart b/runtime/tests/vm/dart/spawn_infinite_loop_test.dart
new file mode 100644
index 0000000..cc0fb42
--- /dev/null
+++ b/runtime/tests/vm/dart/spawn_infinite_loop_test.dart
@@ -0,0 +1,18 @@
+// 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';
+
+// This test ensures that the VM can kill the spawned isolate during VM
+// shutdown even when the isolate is in an infinite loop and will not finish
+// on its own.
+
+void loop(msg) {
+  while (true) {}
+  throw "Unreachable";
+}
+
+void main() {
+  Isolate.spawn(loop, []);
+}
diff --git a/runtime/tests/vm/dart/spawn_shutdown_test.dart b/runtime/tests/vm/dart/spawn_shutdown_test.dart
new file mode 100644
index 0000000..794e737
--- /dev/null
+++ b/runtime/tests/vm/dart/spawn_shutdown_test.dart
@@ -0,0 +1,32 @@
+// 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:isolate';
+
+// Spawn an isolate |foo| that will continue trying to spawn isolates even after
+// the timer in |main| completes. This test ensures that the VM can shutdown
+// correctly even while an isolate is attempting to spawn more isolates.
+
+isolate1(sendPort) {
+  var receivePort = new ReceivePort();
+  sendPort.send(receivePort.sendPort);
+  receivePort.listen((msg) {});
+}
+
+void foo(_) {
+  while (true) {
+    var receivePort = new ReceivePort();
+    Isolate.spawn(isolate1, receivePort.sendPort);
+    receivePort.listen((sendPort) {
+      Isolate.spawn(isolate1,sendPort);
+      receivePort.close();
+    });
+  }
+}
+
+void main() {
+  Isolate.spawn(foo, null);
+  new Timer(const Duration(seconds: 10), () {});
+}
diff --git a/runtime/tests/vm/vm.status b/runtime/tests/vm/vm.status
index d0ffb46..3c0182f 100644
--- a/runtime/tests/vm/vm.status
+++ b/runtime/tests/vm/vm.status
@@ -29,6 +29,10 @@
 cc/ThreadInterrupterMedium: Skip
 cc/ThreadInterrupterLow: Skip
 cc/Service_Profile: Skip
+cc/Dart2JSCompilerStats: Skip
+cc/CorelibCompilerStats: Skip
+cc/ThreadIterator_AddFindRemove: Skip  # Issue 23474
+
 
 [ $system == linux ]
 cc/ThreadInterrupterHigh: Skip
@@ -88,6 +92,8 @@
 
 [ $runtime != vm ]
 dart/snapshot_version_test: SkipByDesign  # Spawns processes
+dart/spawn_infinite_loop_test: Skip  # VM shutdown test
+dart/spawn_shutdown_test: Skip  # VM Shutdown test
 
 [ $runtime == vm && $mode == debug && $builder_tag == asan ]
 cc/Dart2JSCompileAll: Skip  # Timeout.
diff --git a/runtime/tools/create_snapshot_bin.py b/runtime/tools/create_snapshot_bin.py
index 19c2943..b91de38 100755
--- a/runtime/tools/create_snapshot_bin.py
+++ b/runtime/tools/create_snapshot_bin.py
@@ -52,6 +52,10 @@
   result.add_option("--abi",
       action="store", type="string",
       help="Desired ABI for android target OS. armeabi-v7a or x86")
+  result.add_option("--timestamp_file",
+      action="store", type="string",
+      help="Path to timestamp file that will be written",
+      default="")
   return result
 
 
@@ -71,6 +75,14 @@
   return True
 
 
+def CreateTimestampFile(options):
+  if options.timestamp_file != '':
+    dir_name = os.path.dirname(options.timestamp_file)
+    if not os.path.exists(dir_name):
+      os.mkdir(dir_name)
+    open(options.timestamp_file, 'w').close()
+
+
 def Main():
   # Parse options.
   parser = BuildOptions()
@@ -113,6 +125,9 @@
   except Exception as e:
     return -1
 
+  # Success, update timestamp file.
+  CreateTimestampFile(options)
+
   return 0
 
 
diff --git a/runtime/tools/verbose_gc_to_bmu.dart b/runtime/tools/verbose_gc_to_bmu.dart
index ccf9306..67c1605 100644
--- a/runtime/tools/verbose_gc_to_bmu.dart
+++ b/runtime/tools/verbose_gc_to_bmu.dart
@@ -1,7 +1,9 @@
 // Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
-
+//
+// NOTE: See also wrapper script sdk/runtime/tools/bmu_benchmark_gallery.sh
+//
 // Tool to compute bounded mutator utilization (BMU) from a --verbose_gc log.
 // Outputs CSV suitable for, e.g., gnuplot:
 //
diff --git a/runtime/vm/BUILD.gn b/runtime/vm/BUILD.gn
index 601f041..2db9a6e 100644
--- a/runtime/vm/BUILD.gn
+++ b/runtime/vm/BUILD.gn
@@ -47,7 +47,6 @@
 static_library("libdart_vm") {
   configs += ["..:dart_config"]
   public_configs = [":libdart_vm_config"]
-  deps = [ ":generate_service_cc_file", ]
 
   vm_sources_list = exec_script("../../tools/gypi_to_gn.py",
                                 [rebase_path("vm_sources.gypi")],
@@ -56,7 +55,6 @@
 
   set_sources_assignment_filter(["*_test.cc", "*_test.h"])
   sources = vm_sources_list.sources
-            + ["$target_gen_dir/service_gen.cc",]
             - ["vtune.cc", "vtune.h"]
   include_dirs = [
     "..",
@@ -67,7 +65,6 @@
 static_library("libdart_vm_nosnapshot") {
   configs += ["..:dart_config"]
   public_configs = [":libdart_vm_config"]
-  deps = [ ":generate_service_cc_file", ]
   defines = [ "DART_NO_SNAPSHOT" ]
   vm_sources_list = exec_script("../../tools/gypi_to_gn.py",
                                 [rebase_path("vm_sources.gypi")],
@@ -76,7 +73,6 @@
 
   set_sources_assignment_filter(["*_test.cc", "*_test.h"])
   sources = vm_sources_list.sources
-            + ["$target_gen_dir/service_gen.cc",]
             - ["vtune.cc", "vtune.h"]
   include_dirs = [
     "..",
@@ -199,30 +195,6 @@
     ["mirrors", "mirrors"],
     ["profiler", "profiler"],
     ["typed_data", "typed_data"],
+    ["_vmservice", "vmservice"],
   ]
 }
-
-
-action("generate_service_cc_file") {
-  visibility = [ ":*" ]  # Only targets in this file can see this.
-  script = "../tools/create_resources.py"
-  sources = [
-    "service/client.dart",
-    "service/constants.dart",
-    "service/message.dart",
-    "service/message_router.dart",
-    "service/running_isolate.dart",
-    "service/running_isolates.dart",
-    "service/vmservice.dart",
-  ]
-
-  output = "$target_gen_dir/service_gen.cc"
-  outputs = [ output, ]
-
-  args = [
-    "--output", rebase_path(output, root_build_dir),
-    "--outer_namespace", "dart",
-    "--table_name", "service",
-    "--root_prefix", rebase_path("service/", root_build_dir)] +
-    rebase_path(sources, root_build_dir)
-}
diff --git a/runtime/vm/allocation.cc b/runtime/vm/allocation.cc
index 92e2885..b5f0f6c 100644
--- a/runtime/vm/allocation.cc
+++ b/runtime/vm/allocation.cc
@@ -6,6 +6,7 @@
 
 #include "platform/assert.h"
 #include "vm/isolate.h"
+#include "vm/thread.h"
 #include "vm/zone.h"
 
 namespace dart {
@@ -30,6 +31,41 @@
 }
 
 
+StackResource::~StackResource() {
+  if (thread_ != NULL) {
+    StackResource* top = thread_->top_resource();
+    ASSERT(top == this);
+    thread_->set_top_resource(previous_);
+  }
+#if defined(DEBUG)
+  if (thread_ != NULL) {
+    ASSERT(Thread::Current() == thread_);
+    BaseIsolate::AssertCurrent(reinterpret_cast<BaseIsolate*>(isolate()));
+  }
+#endif
+}
+
+
+Isolate* StackResource::isolate() const {
+  return thread_ == NULL ? NULL : thread_->isolate();
+}
+
+
+void StackResource::Init(Thread* thread) {
+  // We can only have longjumps and exceptions when there is a current
+  // thread and isolate.  If there is no current thread, we don't need to
+  // protect this case.
+  // TODO(23807): Eliminate this special case.
+  if (thread != NULL) {
+    ASSERT(Thread::Current() == thread);
+    thread_ = thread;
+    previous_ = thread_->top_resource();
+    ASSERT((previous_ == NULL) || (previous_->thread_ == thread));
+    thread_->set_top_resource(this);
+  }
+}
+
+
 void StackResource::UnwindAbove(Thread* thread, StackResource* new_top) {
   StackResource* current_resource = thread->top_resource();
   while (current_resource != new_top) {
@@ -38,4 +74,16 @@
   }
 }
 
+
+#if defined(DEBUG)
+NoSafepointScope::NoSafepointScope() : StackResource(Thread::Current()) {
+  thread()->IncrementNoSafepointScopeDepth();
+}
+
+
+NoSafepointScope::~NoSafepointScope() {
+  thread()->DecrementNoSafepointScopeDepth();
+}
+#endif  // defined(DEBUG)
+
 }  // namespace dart
diff --git a/runtime/vm/allocation.h b/runtime/vm/allocation.h
index 3947f0e..468c1ad 100644
--- a/runtime/vm/allocation.h
+++ b/runtime/vm/allocation.h
@@ -8,12 +8,12 @@
 #include "platform/assert.h"
 #include "vm/base_isolate.h"
 #include "vm/globals.h"
-#include "vm/thread.h"
 
 namespace dart {
 
 // Forward declarations.
 class Isolate;
+class Thread;
 
 // Stack allocated objects subclass from this base class. Objects of this type
 // cannot be allocated on either the C or object heaps. Destructors for objects
@@ -48,24 +48,10 @@
     Init(thread);
   }
 
-  virtual ~StackResource() {
-    if (thread_ != NULL) {
-      StackResource* top = thread_->top_resource();
-      ASSERT(top == this);
-      thread_->set_top_resource(previous_);
-    }
-#if defined(DEBUG)
-    if (thread_ != NULL) {
-      ASSERT(Thread::Current() == thread_);
-      BaseIsolate::AssertCurrent(reinterpret_cast<BaseIsolate*>(isolate()));
-    }
-#endif
-  }
+  virtual ~StackResource();
 
   // Convenient access to the isolate of the thread of this resource.
-  Isolate* isolate() const {
-    return thread_ == NULL ? NULL : thread_->isolate();
-  }
+  Isolate* isolate() const;
 
   // The thread that owns this resource.
   Thread* thread() const { return thread_; }
@@ -76,19 +62,7 @@
   static void UnwindAbove(Thread* thread, StackResource* new_top);
 
  private:
-  void Init(Thread* thread) {
-    // We can only have longjumps and exceptions when there is a current
-    // thread and isolate.  If there is no current thread, we don't need to
-    // protect this case.
-    // TODO(23807): Eliminate this special case.
-    if (thread != NULL) {
-      ASSERT(Thread::Current() == thread);
-      thread_ = thread;
-      previous_ = thread_->top_resource();
-      ASSERT((previous_ == NULL) || (previous_->thread_ == thread));
-      thread_->set_top_resource(this);
-    }
-  }
+  void Init(Thread* thread);
 
   Thread* thread_;
   StackResource* previous_;
@@ -134,6 +108,27 @@
   DISALLOW_COPY_AND_ASSIGN(ZoneAllocated);
 };
 
+
+
+// Within a NoSafepointScope, the thread must not reach any safepoint. Used
+// around code that manipulates raw object pointers directly without handles.
+#if defined(DEBUG)
+class NoSafepointScope : public StackResource {
+ public:
+  NoSafepointScope();
+  ~NoSafepointScope();
+ private:
+  DISALLOW_COPY_AND_ASSIGN(NoSafepointScope);
+};
+#else  // defined(DEBUG)
+class NoSafepointScope : public ValueObject {
+ public:
+  NoSafepointScope() {}
+ private:
+  DISALLOW_COPY_AND_ASSIGN(NoSafepointScope);
+};
+#endif  // defined(DEBUG)
+
 }  // namespace dart
 
 #endif  // VM_ALLOCATION_H_
diff --git a/runtime/vm/allocation_test.cc b/runtime/vm/allocation_test.cc
index 04b4b80..f8fe5a0 100644
--- a/runtime/vm/allocation_test.cc
+++ b/runtime/vm/allocation_test.cc
@@ -153,7 +153,7 @@
 
 
 TEST_CASE(StackResourceLongJump) {
-  LongJumpScope* base = Isolate::Current()->long_jump_base();
+  LongJumpScope* base = Thread::Current()->long_jump_base();
   {
     LongJumpScope jump;
     int data = 1;
@@ -163,7 +163,7 @@
     }
     EXPECT_EQ(7, data);
   }
-  ASSERT(base == Isolate::Current()->long_jump_base());
+  ASSERT(base == Thread::Current()->long_jump_base());
 }
 
 }  // namespace dart
diff --git a/runtime/vm/assembler.cc b/runtime/vm/assembler.cc
index 9d17b1b..4e1eca9 100644
--- a/runtime/vm/assembler.cc
+++ b/runtime/vm/assembler.cc
@@ -242,8 +242,9 @@
 }
 
 
-intptr_t ObjectPoolWrapper::AddObject(const Object& obj) {
-  return AddObject(ObjectPool::Entry(&obj), kNotPatchable);
+intptr_t ObjectPoolWrapper::AddObject(const Object& obj,
+                                      Patchability patchable) {
+  return AddObject(ObjectPool::Entry(&obj), patchable);
 }
 
 
@@ -264,14 +265,6 @@
 }
 
 
-intptr_t ObjectPoolWrapper::AddExternalLabel(const ExternalLabel* label,
-                                             Patchability patchable) {
-  return AddObject(ObjectPool::Entry(label->address(),
-                                     ObjectPool::kImmediate),
-                   patchable);
-}
-
-
 intptr_t ObjectPoolWrapper::FindObject(ObjectPool::Entry entry,
                                        Patchability patchable) {
   // If the object is not patchable, check if we've already got it in the
@@ -287,8 +280,9 @@
 }
 
 
-intptr_t ObjectPoolWrapper::FindObject(const Object& obj) {
-  return FindObject(ObjectPool::Entry(&obj), kNotPatchable);
+intptr_t ObjectPoolWrapper::FindObject(const Object& obj,
+                                       Patchability patchable) {
+  return FindObject(ObjectPool::Entry(&obj), patchable);
 }
 
 
@@ -298,10 +292,10 @@
 }
 
 
-intptr_t ObjectPoolWrapper::FindExternalLabel(const ExternalLabel* label,
-                                              Patchability patchable) {
+intptr_t ObjectPoolWrapper::FindNativeEntry(const ExternalLabel* label,
+                                            Patchability patchable) {
   return FindObject(ObjectPool::Entry(label->address(),
-                                      ObjectPool::kImmediate),
+                                      ObjectPool::kNativeEntry),
                     patchable);
 }
 
diff --git a/runtime/vm/assembler.h b/runtime/vm/assembler.h
index f2ad6fe..c414c0d 100644
--- a/runtime/vm/assembler.h
+++ b/runtime/vm/assembler.h
@@ -287,15 +287,15 @@
 
 class ObjectPoolWrapper : public ValueObject {
  public:
-  intptr_t AddObject(const Object& obj);
+  intptr_t AddObject(const Object& obj,
+                     Patchability patchable = kNotPatchable);
   intptr_t AddImmediate(uword imm);
-  intptr_t AddExternalLabel(const ExternalLabel* label,
-                            Patchability patchable);
 
-  intptr_t FindObject(const Object& obj);
+  intptr_t FindObject(const Object& obj,
+                      Patchability patchable = kNotPatchable);
   intptr_t FindImmediate(uword imm);
-  intptr_t FindExternalLabel(const ExternalLabel* label,
-                             Patchability patchable);
+  intptr_t FindNativeEntry(const ExternalLabel* label,
+                           Patchability patchable);
 
   RawObjectPool* MakeObjectPool();
 
@@ -310,6 +310,12 @@
   DirectChainedHashMap<ObjIndexPair> object_pool_index_table_;
 };
 
+
+enum RestorePP {
+  kRestoreCallerPP,
+  kKeepCalleePP
+};
+
 }  // namespace dart
 
 
diff --git a/runtime/vm/assembler_arm.cc b/runtime/vm/assembler_arm.cc
index bd2a6e7..815b796 100644
--- a/runtime/vm/assembler_arm.cc
+++ b/runtime/vm/assembler_arm.cc
@@ -20,51 +20,10 @@
 
 namespace dart {
 
+DECLARE_FLAG(bool, allow_absolute_addresses);
 DEFINE_FLAG(bool, print_stop_message, true, "Print stop message.");
 DECLARE_FLAG(bool, inline_alloc);
 
-// 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)
-
-  B0 = 1,
-  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,
-  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,
-};
-
-
 uint32_t Address::encoding3() const {
   if (kind_ == Immediate) {
     uint32_t offset = encoding_ & kOffset12Mask;
@@ -1471,10 +1430,7 @@
 
 
 void Assembler::bkpt(uint16_t imm16) {
-  // bkpt requires that the cond field is AL.
-  int32_t encoding = (AL << kConditionShift) | B24 | B21 |
-                     ((imm16 >> 4) << 8) | B6 | B5 | B4 | (imm16 & 0xf);
-  Emit(encoding);
+  Emit(BkptEncoding(imm16));
 }
 
 
@@ -1533,34 +1489,64 @@
 // Uses a code sequence that can easily be decoded.
 void Assembler::LoadWordFromPoolOffset(Register rd,
                                        int32_t offset,
+                                       Register pp,
                                        Condition cond) {
-  ASSERT(constant_pool_allowed());
-  ASSERT(rd != PP);
+  ASSERT((pp != PP) || constant_pool_allowed());
+  ASSERT(rd != pp);
   int32_t offset_mask = 0;
   if (Address::CanHoldLoadOffset(kWord, offset, &offset_mask)) {
-    ldr(rd, Address(PP, offset), cond);
+    ldr(rd, Address(pp, offset), cond);
   } else {
     int32_t offset_hi = offset & ~offset_mask;  // signed
     uint32_t offset_lo = offset & offset_mask;  // unsigned
-    // Inline a simplified version of AddImmediate(rd, PP, offset_hi).
+    // Inline a simplified version of AddImmediate(rd, pp, offset_hi).
     Operand o;
     if (Operand::CanHold(offset_hi, &o)) {
-      add(rd, PP, o, cond);
+      add(rd, pp, o, cond);
     } else {
       LoadImmediate(rd, offset_hi, cond);
-      add(rd, PP, Operand(rd), cond);
+      add(rd, pp, Operand(rd), cond);
     }
     ldr(rd, Address(rd, offset_lo), cond);
   }
 }
 
+void Assembler::CheckCodePointer() {
+#ifdef DEBUG
+  Label cid_ok, instructions_ok;
+  Push(R0);
+  Push(IP);
+  CompareClassId(CODE_REG, kCodeCid, R0);
+  b(&cid_ok, EQ);
+  bkpt(0);
+  Bind(&cid_ok);
 
-void Assembler::LoadPoolPointer() {
-  const intptr_t object_pool_pc_dist =
-     Instructions::HeaderSize() - Instructions::object_pool_offset() +
-     CodeSize() + Instr::kPCReadOffset;
-  LoadFromOffset(kWord, PP, PC, -object_pool_pc_dist);
-  set_constant_pool_allowed(true);
+  const intptr_t offset = CodeSize() + Instr::kPCReadOffset +
+      Instructions::HeaderSize() - kHeapObjectTag;
+  mov(R0, Operand(PC));
+  AddImmediate(R0, R0, -offset);
+  ldr(IP, FieldAddress(CODE_REG, Code::saved_instructions_offset()));
+  cmp(R0, Operand(IP));
+  b(&instructions_ok, EQ);
+  bkpt(1);
+  Bind(&instructions_ok);
+  Pop(IP);
+  Pop(R0);
+#endif
+}
+
+
+void Assembler::RestoreCodePointer() {
+  ldr(CODE_REG, Address(FP, kPcMarkerSlotFromFp * kWordSize));
+  CheckCodePointer();
+}
+
+
+void Assembler::LoadPoolPointer(Register reg) {
+  // Load new pool pointer.
+  CheckCodePointer();
+  ldr(reg, FieldAddress(CODE_REG, Code::object_pool_offset()));
+  set_constant_pool_allowed(reg == PP);
 }
 
 
@@ -1569,53 +1555,77 @@
 }
 
 
+bool Assembler::CanLoadFromObjectPool(const Object& object) const {
+  ASSERT(!Thread::CanLoadFromThread(object));
+  if (!constant_pool_allowed()) {
+    return false;
+  }
+
+  ASSERT(object.IsNotTemporaryScopedHandle());
+  ASSERT(object.IsOld());
+  return true;
+}
+
+
 void Assembler::LoadObjectHelper(Register rd,
                                  const Object& object,
                                  Condition cond,
-                                 bool is_unique) {
+                                 bool is_unique,
+                                 Register pp) {
   // Load common VM constants from the thread. This works also in places where
   // no constant pool is set up (e.g. intrinsic code).
   if (Thread::CanLoadFromThread(object)) {
+    // Load common VM constants from the thread. This works also in places where
+    // no constant pool is set up (e.g. intrinsic code).
     ldr(rd, Address(THR, Thread::OffsetFromThread(object)), cond);
-    return;
-  }
-  // Smis and VM heap objects are never relocated; do not use object pool.
-  if (object.IsSmi()) {
+  } else if (object.IsSmi()) {
+    // Relocation doesn't apply to Smis.
     LoadImmediate(rd, reinterpret_cast<int32_t>(object.raw()), cond);
-  } else if (object.InVMHeap() || !constant_pool_allowed()) {
-    // Make sure that class CallPattern is able to decode this load immediate.
-    const int32_t object_raw = reinterpret_cast<int32_t>(object.raw());
-    LoadImmediate(rd, object_raw, cond);
-  } else {
+  } else if (CanLoadFromObjectPool(object)) {
     // 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));
-    LoadWordFromPoolOffset(rd, offset - kHeapObjectTag, cond);
+    LoadWordFromPoolOffset(rd, offset - kHeapObjectTag, pp, cond);
+  } else {
+    ASSERT(FLAG_allow_absolute_addresses);
+    ASSERT(object.IsOld());
+    // Make sure that class CallPattern is able to decode this load immediate.
+    const int32_t object_raw = reinterpret_cast<int32_t>(object.raw());
+    LoadImmediate(rd, object_raw, cond);
   }
 }
 
 
 void Assembler::LoadObject(Register rd, const Object& object, Condition cond) {
-  LoadObjectHelper(rd, object, cond, false);
+  LoadObjectHelper(rd, object, cond, /* is_unique = */ false, PP);
 }
 
 
 void Assembler::LoadUniqueObject(Register rd,
                                  const Object& object,
                                  Condition cond) {
-  LoadObjectHelper(rd, object, cond, true);
+  LoadObjectHelper(rd, object, cond, /* is_unique = */ true, PP);
 }
 
 
-void Assembler::LoadExternalLabel(Register rd,
-                                  const ExternalLabel* label,
-                                  Patchability patchable,
-                                  Condition cond) {
+void Assembler::LoadFunctionFromCalleePool(Register dst,
+                                           const Function& function,
+                                           Register new_pp) {
+  const int32_t offset =
+      ObjectPool::element_offset(object_pool_wrapper_.FindObject(function));
+  LoadWordFromPoolOffset(dst, offset - kHeapObjectTag, new_pp, AL);
+}
+
+
+void Assembler::LoadNativeEntry(Register rd,
+                                const ExternalLabel* label,
+                                Patchability patchable,
+                                Condition cond) {
   const int32_t offset = ObjectPool::element_offset(
-      object_pool_wrapper_.FindExternalLabel(label, patchable));
-  LoadWordFromPoolOffset(rd, offset - kHeapObjectTag, cond);
+      object_pool_wrapper_.FindNativeEntry(label, patchable));
+  LoadWordFromPoolOffset(rd, offset - kHeapObjectTag, PP, cond);
 }
 
 
@@ -1767,7 +1777,7 @@
       LoadImmediate(temp, Heap::kZap32Bits);
       cmp(old_value, Operand(temp));
       b(&ok, EQ);
-      LoadImmediate(temp, reinterpret_cast<uint32_t>(Object::null()));
+      LoadObject(temp, Object::null_object());
       cmp(old_value, Operand(temp));
       b(&ok, EQ);
       Stop("Expected zapped, Smi or null");
@@ -1812,7 +1822,7 @@
     StoreIntoObjectFilterNoSmi(object, value, &done);
   }
   // A store buffer update is required.
-  RegList regs = (1 << LR);
+  RegList regs = (1 << CODE_REG) | (1 << LR);
   if (value != R0) {
     regs |= (1 << R0);  // Preserve R0.
   }
@@ -1820,6 +1830,7 @@
   if (object != R0) {
     mov(R0, Operand(object));
   }
+  ldr(CODE_REG, Address(THR, Thread::update_store_buffer_code_offset()));
   ldr(LR, Address(THR, Thread::update_store_buffer_entry_point_offset()));
   blx(LR);
   PopList(regs);
@@ -1997,12 +2008,9 @@
 
 
 void Assembler::LoadClassIdMayBeSmi(Register result, Register object) {
-  static const intptr_t kSmiCidSource = kSmiCid << RawObject::kClassIdTagPos;
-
-  LoadImmediate(TMP, reinterpret_cast<int32_t>(&kSmiCidSource) + 1);
   tst(object, Operand(kSmiTagMask));
-  mov(TMP, Operand(object), NE);
-  LoadClassId(result, TMP);
+  LoadClassId(result, object, NE);
+  LoadImmediate(result, kSmiCid, EQ);
 }
 
 
@@ -2065,7 +2073,7 @@
 
   if (!CanEncodeBranchOffset(offset)) {
     ASSERT(!use_far_branches());
-    Isolate::Current()->long_jump_base()->Jump(
+    Thread::Current()->long_jump_base()->Jump(
         1, Object::branch_offset_error());
   }
 
@@ -2678,31 +2686,41 @@
 }
 
 
-void Assembler::Branch(const ExternalLabel* label, Condition cond) {
-  LoadImmediate(IP, label->address(), cond);  // Address is never patched.
+void Assembler::Branch(const StubEntry& stub_entry,
+                       Patchability patchable,
+                       Register pp,
+                       Condition cond) {
+  const Code& target_code = Code::Handle(stub_entry.code());
+  const int32_t offset = ObjectPool::element_offset(
+      object_pool_wrapper_.FindObject(target_code, patchable));
+  LoadWordFromPoolOffset(CODE_REG, offset - kHeapObjectTag, pp, cond);
+  ldr(IP, FieldAddress(CODE_REG, Code::entry_point_offset()), cond);
   bx(IP, cond);
 }
 
 
-void Assembler::Branch(const StubEntry& stub_entry, Condition cond) {
-  const ExternalLabel label(stub_entry.EntryPoint());
-  Branch(&label, cond);
+void Assembler::BranchLink(const Code& target, Patchability patchable) {
+  // Make sure that class CallPattern is able to patch the label referred
+  // to by this code sequence.
+  // For added code robustness, use 'blx lr' in a patchable sequence and
+  // use 'blx ip' in a non-patchable sequence (see other BranchLink flavors).
+  const int32_t offset = ObjectPool::element_offset(
+      object_pool_wrapper_.FindObject(target, patchable));
+  LoadWordFromPoolOffset(CODE_REG, offset - kHeapObjectTag, PP, AL);
+  ldr(LR, FieldAddress(CODE_REG, Code::entry_point_offset()));
+  blx(LR);  // Use blx instruction so that the return branch prediction works.
 }
 
 
-void Assembler::BranchPatchable(const ExternalLabel* label) {
-  // Use a fixed size code sequence, since a function prologue may be patched
-  // with this branch sequence.
-  // Contrarily to BranchLinkPatchable, BranchPatchable requires an instruction
-  // cache flush upon patching.
-  LoadPatchableImmediate(IP, label->address());
-  bx(IP);
+void Assembler::BranchLink(const StubEntry& stub_entry,
+                           Patchability patchable) {
+  const Code& code = Code::Handle(stub_entry.code());
+  BranchLink(code, patchable);
 }
 
 
-void Assembler::BranchPatchable(const StubEntry& stub_entry) {
-  const ExternalLabel label(stub_entry.EntryPoint());
-  BranchPatchable(&label);
+void Assembler::BranchLinkPatchable(const Code& target) {
+  BranchLink(target, kPatchable);
 }
 
 
@@ -2712,39 +2730,8 @@
 }
 
 
-void Assembler::BranchLink(const StubEntry& stub_entry) {
-  const ExternalLabel label(stub_entry.EntryPoint());
-  BranchLink(&label);
-}
-
-
-void Assembler::BranchLink(const ExternalLabel* label, Patchability patchable) {
-  // Make sure that class CallPattern is able to patch the label referred
-  // to by this code sequence.
-  // For added code robustness, use 'blx lr' in a patchable sequence and
-  // use 'blx ip' in a non-patchable sequence (see other BranchLink flavors).
-  const int32_t offset = ObjectPool::element_offset(
-      object_pool_wrapper_.FindExternalLabel(label, patchable));
-  LoadWordFromPoolOffset(LR, offset - kHeapObjectTag);
-  blx(LR);  // Use blx instruction so that the return branch prediction works.
-}
-
-
-void Assembler::BranchLink(const StubEntry& stub_entry,
-                           Patchability patchable) {
-  const ExternalLabel label(stub_entry.EntryPoint());
-  BranchLink(&label, patchable);
-}
-
-
-void Assembler::BranchLinkPatchable(const ExternalLabel* label) {
-  BranchLink(label, kPatchable);
-}
-
-
 void Assembler::BranchLinkPatchable(const StubEntry& stub_entry) {
-  const ExternalLabel label(stub_entry.EntryPoint());
-  BranchLinkPatchable(&label);
+  BranchLinkPatchable(Code::Handle(stub_entry.code()));
 }
 
 
@@ -2785,7 +2772,7 @@
   if ((version == ARMv5TE) || (version == ARMv6)) {
     if (constant_pool_allowed()) {
       const int32_t offset = Array::element_offset(FindImmediate(value));
-      LoadWordFromPoolOffset(rd, offset - kHeapObjectTag);
+      LoadWordFromPoolOffset(rd, offset - kHeapObjectTag, PP, cond);
     } else {
       LoadPatchableImmediate(rd, value, cond);
     }
@@ -3256,8 +3243,9 @@
 
 
 void Assembler::EnterCallRuntimeFrame(intptr_t frame_space) {
-  // Preserve volatile CPU registers.
-  EnterFrame(kDartVolatileCpuRegs | (1 << FP), 0);
+  // Preserve volatile CPU registers and PP.
+  EnterFrame(kDartVolatileCpuRegs | (1 << PP) | (1 << FP), 0);
+  COMPILE_ASSERT((kDartVolatileCpuRegs & (1 << PP)) == 0);
 
   // Preserve all volatile FPU registers.
   if (TargetCPUFeatures::vfp_supported()) {
@@ -3272,6 +3260,8 @@
     }
   }
 
+  LoadPoolPointer();
+
   ReserveAlignedFrameSpace(frame_space);
 }
 
@@ -3284,10 +3274,12 @@
       TargetCPUFeatures::vfp_supported() ?
       kDartVolatileFpuRegCount * kFpuRegisterSize : 0;
 
-  // We subtract one from the volatile cpu register count because, even though
-  // LR is volatile, it is pushed ahead of FP.
+  COMPILE_ASSERT(PP < FP);
+  COMPILE_ASSERT((kDartVolatileCpuRegs & (1 << PP)) == 0);
+  // kVolatileCpuRegCount +1 for PP, -1 because even though LR is volatile,
+  // it is pushed ahead of FP.
   const intptr_t kPushedRegistersSize =
-      (kDartVolatileCpuRegCount - 1) * kWordSize + kPushedFpuRegisterSize;
+      kDartVolatileCpuRegCount * kWordSize + kPushedFpuRegisterSize;
   AddImmediate(SP, FP, -kPushedRegistersSize);
 
   // Restore all volatile FPU registers.
@@ -3304,7 +3296,7 @@
   }
 
   // Restore volatile CPU registers.
-  LeaveFrame(kDartVolatileCpuRegs | (1 << FP));
+  LeaveFrame(kDartVolatileCpuRegs | (1 << PP) | (1 << FP));
 }
 
 
@@ -3316,19 +3308,9 @@
 
 void Assembler::EnterDartFrame(intptr_t frame_size) {
   ASSERT(!constant_pool_allowed());
-  const intptr_t offset = CodeSize();
 
-  // Save PC in frame for fast identification of corresponding code.
-  // Note that callee-saved registers can be added to the register list.
-  EnterFrame((1 << PP) | (1 << FP) | (1 << LR) | (1 << PC), 0);
-
-  if (offset != 0) {
-    // Adjust saved PC for any intrinsic code that could have been generated
-    // before a frame is created. Use PP as temp register.
-    ldr(PP, Address(FP, 2 * kWordSize));
-    AddImmediate(PP, PP, -offset);
-    str(PP, Address(FP, 2 * kWordSize));
-  }
+  // Registers are pushed in descending order: R9 | R10 | R11 | R14.
+  EnterFrame((1 << PP) | (1 << CODE_REG) | (1 << FP) | (1 << LR), 0);
 
   // Setup pool pointer for this dart function.
   LoadPoolPointer();
@@ -3345,52 +3327,31 @@
 // allocate. We must also set up the pool pointer for the function.
 void Assembler::EnterOsrFrame(intptr_t extra_size) {
   ASSERT(!constant_pool_allowed());
-  // mov(IP, Operand(PC)) loads PC + Instr::kPCReadOffset (8). This may be
-  // different from EntryPointToPcMarkerOffset().
-  const intptr_t offset =
-      CodeSize() + Instr::kPCReadOffset - EntryPointToPcMarkerOffset();
-
   Comment("EnterOsrFrame");
-  mov(IP, Operand(PC));
-
-  AddImmediate(IP, -offset);
-  str(IP, Address(FP, kPcMarkerSlotFromFp * kWordSize));
-
-  // Setup pool pointer for this dart function.
+  RestoreCodePointer();
   LoadPoolPointer();
 
   AddImmediate(SP, -extra_size);
 }
 
 
-void Assembler::LeaveDartFrame() {
-  // LeaveDartFrame is called from stubs (pp disallowed) and from Dart code (pp
-  // allowed), so there is no point in checking the current value of
-  // constant_pool_allowed().
-  set_constant_pool_allowed(false);
-  LeaveFrame((1 << PP) | (1 << FP) | (1 << LR));
-  // Adjust SP for PC pushed in EnterDartFrame.
-  AddImmediate(SP, kWordSize);
+void Assembler::LeaveDartFrame(RestorePP restore_pp) {
+  if (restore_pp == kRestoreCallerPP) {
+    ldr(PP, Address(FP, kSavedCallerPpSlotFromFp * kWordSize));
+    set_constant_pool_allowed(false);
+  }
+  Drop(2);  // Drop saved PP, PC marker.
+  LeaveFrame((1 << FP) | (1 << LR));
 }
 
 
 void Assembler::EnterStubFrame() {
-  set_constant_pool_allowed(false);
-  // Push 0 as saved PC for stub frames.
-  mov(IP, Operand(LR));
-  mov(LR, Operand(0));
-  RegList regs = (1 << PP) | (1 << FP) | (1 << IP) | (1 << LR);
-  EnterFrame(regs, 0);
-  // Setup pool pointer for this stub.
-  LoadPoolPointer();
+  EnterDartFrame(0);
 }
 
 
 void Assembler::LeaveStubFrame() {
-  LeaveFrame((1 << PP) | (1 << FP) | (1 << LR));
-  set_constant_pool_allowed(false);
-  // Adjust SP for null PC pushed in EnterStubFrame.
-  AddImmediate(SP, kWordSize);
+  LeaveDartFrame();
 }
 
 
@@ -3402,6 +3363,7 @@
   ASSERT(cid > 0);
   const intptr_t class_offset = ClassTable::ClassOffsetFor(cid);
   if (inline_isolate) {
+    ASSERT(FLAG_allow_absolute_addresses);
     ClassTable* class_table = Isolate::Current()->class_table();
     ClassHeapStats** table_ptr = class_table->TableAddressFor(cid);
     if (cid < kNumPredefinedCids) {
diff --git a/runtime/vm/assembler_arm.h b/runtime/vm/assembler_arm.h
index 8218bb9..9ba279c 100644
--- a/runtime/vm/assembler_arm.h
+++ b/runtime/vm/assembler_arm.h
@@ -23,6 +23,49 @@
 class RuntimeEntry;
 class StubEntry;
 
+
+// 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)
+
+  B0 = 1,
+  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,
+  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,
+};
+
+
 class Label : public ValueObject {
  public:
   Label() : position_(0) { }
@@ -488,6 +531,16 @@
   // Note that gdb sets breakpoints using the undefined instruction 0xe7f001f0.
   void bkpt(uint16_t imm16);
 
+  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);
+  }
+
+  static uword GetBreakInstructionFiller() {
+    return BkptEncoding(0);
+  }
+
   // Floating point instructions (VFPv3-D16 and VFPv3-D32 profiles).
   void vmovsr(SRegister sn, Register rt, Condition cond = AL);
   void vmovrs(Register rt, SRegister sn, Condition cond = AL);
@@ -606,25 +659,18 @@
   void bx(Register rm, Condition cond = AL);
   void blx(Register rm, Condition cond = AL);
 
-  // Macros.
-  // Branch to an entry address. Call sequence is never patched.
-  void Branch(const ExternalLabel* label, Condition cond = AL);
-  void Branch(const StubEntry& stub_entry, Condition cond = AL);
+  void Branch(const StubEntry& stub_entry,
+              Patchability patchable = kNotPatchable,
+              Register pp = PP,
+              Condition cond = AL);
 
-  // Branch to an entry address. Call sequence can be patched or even replaced.
-  void BranchPatchable(const ExternalLabel* label);
-  void BranchPatchable(const StubEntry& stub_entry);
-
-  // Branch and link to an entry address. Call sequence is never patched.
-  void BranchLink(const ExternalLabel* label);
-  void BranchLink(const StubEntry& stub_entry);
-
-  void BranchLink(const ExternalLabel* label, Patchability patchable);
-  void BranchLink(const StubEntry& stub_entry, Patchability patchable);
+  void BranchLink(const StubEntry& stub_entry,
+                  Patchability patchable = kNotPatchable);
+  void BranchLink(const Code& code, Patchability patchable);
 
   // Branch and link to an entry address. Call sequence can be patched.
-  void BranchLinkPatchable(const ExternalLabel* label);
   void BranchLinkPatchable(const StubEntry& stub_entry);
+  void BranchLinkPatchable(const Code& code);
 
   // Branch and link to [base + offset]. Call sequence is never patched.
   void BranchLinkOffset(Register base, int32_t offset);
@@ -667,16 +713,20 @@
 
   void Drop(intptr_t stack_elements);
 
-  void LoadPoolPointer();
+  void RestoreCodePointer();
+  void LoadPoolPointer(Register reg = PP);
 
   void LoadIsolate(Register rd);
 
   void LoadObject(Register rd, const Object& object, Condition cond = AL);
   void LoadUniqueObject(Register rd, const Object& object, Condition cond = AL);
-  void LoadExternalLabel(Register dst,
-                         const ExternalLabel* label,
-                         Patchability patchable,
-                         Condition cond = AL);
+  void LoadFunctionFromCalleePool(Register dst,
+                                  const Function& function,
+                                  Register new_pp);
+  void LoadNativeEntry(Register dst,
+                       const ExternalLabel* label,
+                       Patchability patchable,
+                       Condition cond = AL);
   void PushObject(const Object& object);
   void CompareObject(Register rn, const Object& object);
 
@@ -762,7 +812,7 @@
                            Label* miss);
 
   intptr_t FindImmediate(int32_t imm);
-  void LoadWordFromPoolOffset(Register rd, int32_t offset, Condition cond = AL);
+  bool CanLoadFromObjectPool(const Object& object) const;
   void LoadFromOffset(OperandSize type,
                       Register reg,
                       Register base,
@@ -874,6 +924,8 @@
     b(is_smi, CC);
   }
 
+  void CheckCodePointer();
+
   // Function frame setup and tear down.
   void EnterFrame(RegList regs, intptr_t frame_space);
   void LeaveFrame(RegList regs);
@@ -892,7 +944,7 @@
   // enable easy access to the RawInstruction object of code corresponding
   // to this frame.
   void EnterDartFrame(intptr_t frame_size);
-  void LeaveDartFrame();
+  void LeaveDartFrame(RestorePP restore_pp = kRestoreCallerPP);
 
   // Set up a Dart frame for a function compiled for on-stack replacement.
   // The frame layout is a normal Dart frame, but the frame is partially set
@@ -904,13 +956,6 @@
   void EnterStubFrame();
   void LeaveStubFrame();
 
-  // Instruction pattern from entrypoint is used in Dart frame prologs
-  // to set up the frame and save a PC which can be used to figure out the
-  // RawInstruction object corresponding to the code running in the frame.
-  static intptr_t EntryPointToPcMarkerOffset() {
-    return TargetCPUFeatures::store_pc_read_offset();
-  }
-
   // The register into which the allocation stats table is loaded with
   // LoadAllocationStatsAddress should be passed to
   // IncrementAllocationStats(WithSize) as stats_addr_reg to update the
@@ -996,6 +1041,13 @@
   void BindARMv6(Label* label);
   void BindARMv7(Label* label);
 
+  void LoadWordFromPoolOffset(Register rd,
+                              int32_t offset,
+                              Register pp,
+                              Condition cond);
+
+  void BranchLink(const ExternalLabel* label);
+
   class CodeComment : public ZoneAllocated {
    public:
     CodeComment(intptr_t pc_offset, const String& comment)
@@ -1018,7 +1070,8 @@
   void LoadObjectHelper(Register rd,
                         const Object& object,
                         Condition cond,
-                        bool is_unique);
+                        bool is_unique,
+                        Register pp);
 
   void EmitType01(Condition cond,
                   int type,
diff --git a/runtime/vm/assembler_arm64.cc b/runtime/vm/assembler_arm64.cc
index 11fbdb2..06203d2 100644
--- a/runtime/vm/assembler_arm64.cc
+++ b/runtime/vm/assembler_arm64.cc
@@ -20,6 +20,7 @@
 
 namespace dart {
 
+DECLARE_FLAG(bool, allow_absolute_addresses);
 DEFINE_FLAG(bool, use_far_branches, false, "Always use far branches");
 DEFINE_FLAG(bool, print_stop_message, false, "Print stop message.");
 DECLARE_FLAG(bool, inline_alloc);
@@ -303,11 +304,8 @@
 
 
 void Assembler::LoadPoolPointer(Register pp) {
-  const intptr_t object_pool_pc_dist =
-    Instructions::HeaderSize() - Instructions::object_pool_offset() +
-    CodeSize();
-  // PP <- Read(PC - object_pool_pc_dist).
-  ldr(pp, Address::PC(-object_pool_pc_dist));
+  CheckCodePointer();
+  ldr(pp, FieldAddress(CODE_REG, Code::object_pool_offset()));
 
   // When in the PP register, the pool pointer is untagged. When we
   // push it on the stack with TagAndPushPP it is tagged again. PopAndUntagPP
@@ -320,18 +318,20 @@
 }
 
 
-void Assembler::LoadWordFromPoolOffset(Register dst, uint32_t offset) {
-  ASSERT(constant_pool_allowed());
-  ASSERT(dst != PP);
+void Assembler::LoadWordFromPoolOffset(Register dst,
+                                       uint32_t offset,
+                                       Register pp) {
+  ASSERT((pp != PP) || constant_pool_allowed());
+  ASSERT(dst != pp);
   Operand op;
   const uint32_t upper20 = offset & 0xfffff000;
   if (Address::CanHoldOffset(offset)) {
-    ldr(dst, Address(PP, offset));
+    ldr(dst, Address(pp, offset));
   } else if (Operand::CanHold(upper20, kXRegSizeInBits, &op) ==
              Operand::Immediate) {
     const uint32_t lower12 = offset & 0x00000fff;
     ASSERT(Address::CanHoldOffset(lower12));
-    add(dst, PP, op);
+    add(dst, pp, op);
     ldr(dst, Address(dst, lower12));
   } else {
     const uint16_t offset_low = Utils::Low16Bits(offset);
@@ -340,7 +340,7 @@
     if (offset_high != 0) {
       movk(dst, Immediate(offset_high), 1);
     }
-    ldr(dst, Address(PP, dst));
+    ldr(dst, Address(pp, dst));
   }
 }
 
@@ -384,24 +384,11 @@
 }
 
 
-void Assembler::LoadExternalLabel(Register dst, const ExternalLabel* label) {
-  if (constant_pool_allowed()) {
-    const int32_t offset = ObjectPool::element_offset(
-        object_pool_wrapper_.FindExternalLabel(label, kNotPatchable));
-    LoadWordFromPoolOffset(dst, offset);
-  } else {
-    const int64_t target = static_cast<int64_t>(label->address());
-    LoadImmediate(dst, target);
-  }
-}
-
-
-void Assembler::LoadExternalLabelFixed(Register dst,
-                                       const ExternalLabel* label,
-                                       Patchability patchable) {
+void Assembler::LoadNativeEntry(Register dst,
+                                const ExternalLabel* label) {
   const int32_t offset = ObjectPool::element_offset(
-      object_pool_wrapper_.FindExternalLabel(label, patchable));
-  LoadWordFromPoolOffsetFixed(dst, offset);
+      object_pool_wrapper_.FindNativeEntry(label, kNotPatchable));
+  LoadWordFromPoolOffset(dst, offset);
 }
 
 
@@ -422,6 +409,7 @@
     LoadWordFromPoolOffset(dst, offset);
   } else {
     ASSERT(object.IsSmi() || object.InVMHeap());
+    ASSERT(object.IsSmi() || FLAG_allow_absolute_addresses);
     LoadDecodableImmediate(dst, reinterpret_cast<int64_t>(object.raw()));
   }
 }
@@ -457,6 +445,7 @@
     LoadObject(TMP, object);
     CompareRegisters(reg, TMP);
   } else {
+    ASSERT(object.IsSmi() || FLAG_allow_absolute_addresses);
     CompareImmediate(reg, reinterpret_cast<int64_t>(object.raw()));
   }
 }
@@ -584,27 +573,35 @@
 }
 
 
-void Assembler::Branch(const StubEntry& stub_entry) {
-  const ExternalLabel label(stub_entry.EntryPoint());
-  Branch(&label);
+void Assembler::Branch(const StubEntry& stub_entry,
+                       Register pp,
+                       Patchability patchable) {
+  const Code& target = Code::Handle(stub_entry.code());
+  const int32_t offset = ObjectPool::element_offset(
+      object_pool_wrapper_.FindObject(target, patchable));
+  LoadWordFromPoolOffset(CODE_REG, offset, pp);
+  ldr(TMP, FieldAddress(CODE_REG, Code::entry_point_offset()));
+  br(TMP);
 }
 
-
 void Assembler::BranchPatchable(const StubEntry& stub_entry) {
-  const ExternalLabel label(stub_entry.EntryPoint());
-  BranchPatchable(&label);
+  Branch(stub_entry, PP, kPatchable);
 }
 
 
-void Assembler::BranchLink(const StubEntry& stub_entry) {
-  const ExternalLabel label(stub_entry.EntryPoint());
-  BranchLink(&label);
+void Assembler::BranchLink(const StubEntry& stub_entry,
+                           Patchability patchable) {
+  const Code& target = Code::Handle(stub_entry.code());
+  const int32_t offset = ObjectPool::element_offset(
+      object_pool_wrapper_.FindObject(target, patchable));
+  LoadWordFromPoolOffset(CODE_REG, offset);
+  ldr(TMP, FieldAddress(CODE_REG, Code::entry_point_offset()));
+  blr(TMP);
 }
 
 
 void Assembler::BranchLinkPatchable(const StubEntry& stub_entry) {
-  const ExternalLabel label(stub_entry.EntryPoint());
-  BranchLinkPatchable(&label);
+  BranchLink(stub_entry, kPatchable);
 }
 
 
@@ -894,6 +891,7 @@
   if (object != R0) {
     mov(R0, object);
   }
+  ldr(CODE_REG, Address(THR, Thread::update_store_buffer_code_offset()));
   ldr(TMP, Address(THR, Thread::update_store_buffer_entry_point_offset()));
   blr(TMP);
   Pop(LR);
@@ -1070,6 +1068,34 @@
 }
 
 
+void Assembler::RestoreCodePointer() {
+  ldr(CODE_REG, Address(FP, kPcMarkerSlotFromFp * kWordSize));
+  CheckCodePointer();
+}
+
+
+void Assembler::CheckCodePointer() {
+#ifdef DEBUG
+  Label cid_ok, instructions_ok;
+  Push(R0);
+  CompareClassId(CODE_REG, kCodeCid);
+  b(&cid_ok, EQ);
+  brk(0);
+  Bind(&cid_ok);
+
+  const intptr_t entry_offset =
+      CodeSize() + Instructions::HeaderSize() - kHeapObjectTag;
+  adr(R0, Immediate(-entry_offset));
+  ldr(TMP, FieldAddress(CODE_REG, Code::saved_instructions_offset()));
+  cmp(R0, Operand(TMP));
+  b(&instructions_ok, EQ);
+  brk(1);
+  Bind(&instructions_ok);
+  Pop(R0);
+#endif
+}
+
+
 void Assembler::EnterFrame(intptr_t frame_size) {
   PushPair(LR, FP);
   mov(FP, SP);
@@ -1086,29 +1112,11 @@
 }
 
 
-void Assembler::EnterDartFrame(intptr_t frame_size) {
+void Assembler::EnterDartFrame(intptr_t frame_size, Register new_pp) {
   ASSERT(!constant_pool_allowed());
   // Setup the frame.
-  adr(TMP, Immediate(-CodeSize()));  // TMP gets PC marker.
   EnterFrame(0);
-  TagAndPushPPAndPcMarker(TMP);  // Save PP and PC marker.
-
-  // Load the pool pointer.
-  LoadPoolPointer();
-
-  // Reserve space.
-  if (frame_size > 0) {
-    AddImmediate(SP, SP, -frame_size);
-  }
-}
-
-
-void Assembler::EnterDartFrameWithInfo(intptr_t frame_size, Register new_pp) {
-  ASSERT(!constant_pool_allowed());
-  // Setup the frame.
-  adr(TMP, Immediate(-CodeSize()));  // TMP gets PC marker.
-  EnterFrame(0);
-  TagAndPushPPAndPcMarker(TMP);  // Save PP and PC marker.
+  TagAndPushPPAndPcMarker();  // Save PP and PC marker.
 
   // Load the pool pointer.
   if (new_pp == kNoRegister) {
@@ -1133,17 +1141,8 @@
 void Assembler::EnterOsrFrame(intptr_t extra_size, Register new_pp) {
   ASSERT(!constant_pool_allowed());
   Comment("EnterOsrFrame");
-  adr(TMP, Immediate(-CodeSize()));
-
-  StoreToOffset(TMP, FP, kPcMarkerSlotFromFp * kWordSize);
-
-  // Setup pool pointer for this dart function.
-  if (new_pp == kNoRegister) {
-    LoadPoolPointer();
-  } else {
-    mov(PP, new_pp);
-    set_constant_pool_allowed(true);
-  }
+  RestoreCodePointer();
+  LoadPoolPointer();
 
   if (extra_size > 0) {
     AddImmediate(SP, SP, -extra_size);
@@ -1151,20 +1150,19 @@
 }
 
 
-void Assembler::LeaveDartFrame() {
-  // LeaveDartFrame is called from stubs (pp disallowed) and from Dart code (pp
-  // allowed), so there is no point in checking the current value of
-  // constant_pool_allowed().
-  set_constant_pool_allowed(false);
-  // Restore and untag PP.
-  LoadFromOffset(PP, FP, kSavedCallerPpSlotFromFp * kWordSize);
-  sub(PP, PP, Operand(kHeapObjectTag));
+void Assembler::LeaveDartFrame(RestorePP restore_pp) {
+  if (restore_pp == kRestoreCallerPP) {
+    set_constant_pool_allowed(false);
+    // Restore and untag PP.
+    LoadFromOffset(PP, FP, kSavedCallerPpSlotFromFp * kWordSize);
+    sub(PP, PP, Operand(kHeapObjectTag));
+  }
   LeaveFrame();
 }
 
 
 void Assembler::EnterCallRuntimeFrame(intptr_t frame_size) {
-  EnterFrame(0);
+  EnterStubFrame();
 
   // Store fpu registers with the lowest register number at the lowest
   // address.
@@ -1194,7 +1192,8 @@
   // We need to restore it before restoring registers.
   const intptr_t kPushedRegistersSize =
       kDartVolatileCpuRegCount * kWordSize +
-      kDartVolatileFpuRegCount * kWordSize;
+      kDartVolatileFpuRegCount * kWordSize +
+      2 * kWordSize;  // PP and pc marker from EnterStubFrame.
   AddImmediate(SP, FP, -kPushedRegistersSize);
   for (int i = kDartLastVolatileCpuReg; i >= kDartFirstVolatileCpuReg; i--) {
     const Register reg = static_cast<Register>(i);
@@ -1212,7 +1211,7 @@
     PopDouble(reg);
   }
 
-  PopPair(LR, FP);
+  LeaveStubFrame();
 }
 
 
@@ -1223,20 +1222,12 @@
 
 
 void Assembler::EnterStubFrame() {
-  set_constant_pool_allowed(false);
-  EnterFrame(0);
-  // Save caller's pool pointer. Push 0 in the saved PC area for stub frames.
-  TagAndPushPPAndPcMarker(ZR);
-  LoadPoolPointer();
+  EnterDartFrame(0);
 }
 
 
 void Assembler::LeaveStubFrame() {
-  set_constant_pool_allowed(false);
-  // Restore and untag PP.
-  LoadFromOffset(PP, FP, kSavedCallerPpSlotFromFp * kWordSize);
-  sub(PP, PP, Operand(kHeapObjectTag));
-  LeaveFrame();
+  LeaveDartFrame();
 }
 
 
@@ -1247,6 +1238,7 @@
   intptr_t counter_offset =
       ClassTable::CounterOffsetFor(cid, space == Heap::kNew);
   if (inline_isolate) {
+    ASSERT(FLAG_allow_absolute_addresses);
     ClassTable* class_table = Isolate::Current()->class_table();
     ClassHeapStats** table_ptr = class_table->TableAddressFor(cid);
     if (cid < kNumPredefinedCids) {
@@ -1316,6 +1308,7 @@
   ASSERT(cid > 0);
   intptr_t state_offset = ClassTable::StateOffsetFor(cid);
   if (inline_isolate) {
+    ASSERT(FLAG_allow_absolute_addresses);
     ClassTable* class_table = Isolate::Current()->class_table();
     ClassHeapStats** table_ptr = class_table->TableAddressFor(cid);
     if (cid < kNumPredefinedCids) {
diff --git a/runtime/vm/assembler_arm64.h b/runtime/vm/assembler_arm64.h
index 936e105..ffb6b768 100644
--- a/runtime/vm/assembler_arm64.h
+++ b/runtime/vm/assembler_arm64.h
@@ -838,6 +838,11 @@
     EmitExceptionGenOp(BRK, imm);
   }
 
+  static uword GetBreakInstructionFiller() {
+    const intptr_t encoding = ExceptionGenOpEncoding(BRK, 0);
+    return encoding << 32 | encoding;
+  }
+
   // Double floating point.
   bool fmovdi(VRegister vd, double immd) {
     int64_t imm64 = bit_cast<int64_t, double>(immd);
@@ -1152,11 +1157,11 @@
     add(TMP, PP, Operand(kHeapObjectTag));
     str(TMP, Address(SP, -1 * kWordSize, Address::PreIndex));
   }
-  void TagAndPushPPAndPcMarker(Register pc_marker_reg) {
-    ASSERT(pc_marker_reg != TMP2);
+  void TagAndPushPPAndPcMarker() {
+    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, pc_marker_reg,
+    stp(TMP2, CODE_REG,
         Address(SP, -2 * kWordSize, Address::PairPreIndex));
   }
   void PopAndUntagPP() {
@@ -1198,36 +1203,13 @@
     LslImmediate(dst, src, kSmiTagSize);
   }
 
-  // Branching to ExternalLabels.
-  void Branch(const ExternalLabel* label) {
-    LoadExternalLabel(TMP, label);
-    br(TMP);
-  }
-
-  void Branch(const StubEntry& stub_entry);
-
-  // Fixed length branch to label.
-  void BranchPatchable(const ExternalLabel* label) {
-    // TODO(zra): Use LoadExternalLabelFixed if possible.
-    LoadImmediateFixed(TMP, label->address());
-    br(TMP);
-  }
-
+  void Branch(const StubEntry& stub_entry,
+              Register pp,
+              Patchability patchable = kNotPatchable);
   void BranchPatchable(const StubEntry& stub_entry);
 
-  void BranchLink(const ExternalLabel* label) {
-    LoadExternalLabel(TMP, label);
-    blr(TMP);
-  }
-
-  void BranchLink(const StubEntry& stub_entry);
-
-  // BranchLinkPatchable must be a fixed-length sequence so we can patch it
-  // with the debugger.
-  void BranchLinkPatchable(const ExternalLabel* label) {
-    LoadExternalLabelFixed(TMP, label, kPatchable);
-    blr(TMP);
-  }
+  void BranchLink(const StubEntry& stub_entry,
+                  Patchability patchable = kNotPatchable);
 
   void BranchLinkPatchable(const StubEntry& stub_entry);
 
@@ -1306,14 +1288,9 @@
     constant_pool_allowed_ = b;
   }
 
-  void LoadWordFromPoolOffset(Register dst, uint32_t offset);
-  void LoadWordFromPoolOffsetFixed(Register dst, uint32_t offset);
   intptr_t FindImmediate(int64_t imm);
   bool CanLoadFromObjectPool(const Object& object) const;
-  void LoadExternalLabel(Register dst, const ExternalLabel* label);
-  void LoadExternalLabelFixed(Register dst,
-                              const ExternalLabel* label,
-                              Patchability patchable);
+  void LoadNativeEntry(Register dst, const ExternalLabel* label);
   void LoadFunctionFromCalleePool(Register dst,
                                   const Function& function,
                                   Register new_pp);
@@ -1362,10 +1339,12 @@
     sub(CSP, CSP, Operand(reserved_space));
   }
 
-  void EnterDartFrame(intptr_t frame_size);
-  void EnterDartFrameWithInfo(intptr_t frame_size, Register new_pp);
+  void CheckCodePointer();
+  void RestoreCodePointer();
+
+  void EnterDartFrame(intptr_t frame_size, Register new_pp = kNoRegister);
   void EnterOsrFrame(intptr_t extra_size, Register new_pp);
-  void LeaveDartFrame();
+  void LeaveDartFrame(RestorePP restore_pp = kRestoreCallerPP);
 
   void EnterCallRuntimeFrame(intptr_t frame_size);
   void LeaveCallRuntimeFrame();
@@ -1449,6 +1428,9 @@
 
   bool constant_pool_allowed_;
 
+  void LoadWordFromPoolOffset(Register dst, uint32_t offset, Register pp = PP);
+  void LoadWordFromPoolOffsetFixed(Register dst, uint32_t offset);
+
   void LoadObjectHelper(Register dst, const Object& obj, bool is_unique);
 
   void AddSubHelper(OperandSize os, bool set_flags, bool subtract,
@@ -1553,7 +1535,7 @@
   int32_t EncodeImm19BranchOffset(int64_t imm, int32_t instr) {
     if (!CanEncodeImm19BranchOffset(imm)) {
       ASSERT(!use_far_branches());
-      Isolate::Current()->long_jump_base()->Jump(
+      Thread::Current()->long_jump_base()->Jump(
           1, Object::branch_offset_error());
     }
     const int32_t imm32 = static_cast<int32_t>(imm);
@@ -1711,10 +1693,12 @@
     Emit(encoding);
   }
 
+  static int32_t ExceptionGenOpEncoding(ExceptionGenOp op, uint16_t imm) {
+    return op | (static_cast<int32_t>(imm) << kImm16Shift);
+  }
+
   void EmitExceptionGenOp(ExceptionGenOp op, uint16_t imm) {
-    const int32_t encoding =
-        op | (static_cast<int32_t>(imm) << kImm16Shift);
-    Emit(encoding);
+    Emit(ExceptionGenOpEncoding(op, imm));
   }
 
   void EmitMoveWideOp(MoveWideOp op, Register rd, const Immediate& imm,
diff --git a/runtime/vm/assembler_arm64_test.cc b/runtime/vm/assembler_arm64_test.cc
index 6fb9822..a187ee8 100644
--- a/runtime/vm/assembler_arm64_test.cc
+++ b/runtime/vm/assembler_arm64_test.cc
@@ -1622,149 +1622,146 @@
 }
 
 
+static void EnterTestFrame(Assembler* assembler) {
+  __ EnterFrame(0);
+  __ Push(CODE_REG);
+  __ TagAndPushPP();
+  __ ldr(CODE_REG, Address(R0, VMHandles::kOffsetOfRawPtrInHandle));
+  __ LoadPoolPointer(PP);
+}
+
+
+static void LeaveTestFrame(Assembler* assembler) {
+  __ PopAndUntagPP();
+  __ Pop(CODE_REG);
+  __ LeaveFrame();
+}
+
+
+
+
 // Loading immediate values with the object pool.
 ASSEMBLER_TEST_GENERATE(LoadImmediatePPSmall, assembler) {
   __ SetupDartSP(kTestStackSpace);
-  __ TagAndPushPP();  // Save caller's pool pointer and load a new one here.
-  __ LoadPoolPointer();
+  EnterTestFrame(assembler);
   __ LoadImmediate(R0, 42);
-  __ PopAndUntagPP();
+  LeaveTestFrame(assembler);
   __ mov(CSP, SP);
   __ ret();
 }
 
 
 ASSEMBLER_TEST_RUN(LoadImmediatePPSmall, test) {
-  typedef int64_t (*Int64Return)() DART_UNUSED;
-  EXPECT_EQ(42, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry()));
+  EXPECT_EQ(42, test->InvokeWithCode<int64_t>());
 }
 
 
 ASSEMBLER_TEST_GENERATE(LoadImmediatePPMed, assembler) {
   __ SetupDartSP(kTestStackSpace);
-  __ TagAndPushPP();  // Save caller's pool pointer and load a new one here.
-  __ LoadPoolPointer();
+  EnterTestFrame(assembler);
   __ LoadImmediate(R0, 0xf1234123);
-  __ PopAndUntagPP();
+  LeaveTestFrame(assembler);
   __ mov(CSP, SP);
   __ ret();
 }
 
 
 ASSEMBLER_TEST_RUN(LoadImmediatePPMed, test) {
-  typedef int64_t (*Int64Return)() DART_UNUSED;
-  EXPECT_EQ(0xf1234123, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry()));
+  EXPECT_EQ(0xf1234123, test->InvokeWithCode<int64_t>());
 }
 
 
 ASSEMBLER_TEST_GENERATE(LoadImmediatePPMed2, assembler) {
   __ SetupDartSP(kTestStackSpace);
-  __ TagAndPushPP();  // Save caller's pool pointer and load a new one here.
-  __ LoadPoolPointer();
+  EnterTestFrame(assembler);
   __ LoadImmediate(R0, 0x4321f1234124);
-  __ PopAndUntagPP();
+  LeaveTestFrame(assembler);
   __ mov(CSP, SP);
   __ ret();
 }
 
 
 ASSEMBLER_TEST_RUN(LoadImmediatePPMed2, test) {
-  typedef int64_t (*Int64Return)() DART_UNUSED;
-  EXPECT_EQ(
-      0x4321f1234124, EXECUTE_TEST_CODE_INT64(Int64Return, test->entry()));
+  EXPECT_EQ(0x4321f1234124, test->InvokeWithCode<int64_t>());
 }
 
 
 ASSEMBLER_TEST_GENERATE(LoadImmediatePPLarge, assembler) {
   __ SetupDartSP(kTestStackSpace);
-  __ TagAndPushPP();  // Save caller's pool pointer and load a new one here.
-  __ LoadPoolPointer();
+  EnterTestFrame(assembler);
   __ LoadImmediate(R0, 0x9287436598237465);
-  __ PopAndUntagPP();
+  LeaveTestFrame(assembler);
   __ mov(CSP, SP);
   __ ret();
 }
 
 
 ASSEMBLER_TEST_RUN(LoadImmediatePPLarge, test) {
-  typedef int64_t (*Int64Return)() DART_UNUSED;
   EXPECT_EQ(static_cast<int64_t>(0x9287436598237465),
-            EXECUTE_TEST_CODE_INT64(Int64Return, test->entry()));
+            test->InvokeWithCode<int64_t>());
 }
 
 
-#if defined(USING_SIMULATOR)
-#define ASSEMBLER_TEST_RUN_WITH_THREAD(var_name) \
+#define ASSEMBLER_TEST_RUN_WITH_THREAD(result_type, var_name) \
   Thread* thread = Thread::Current(); \
-  int64_t var_name = Simulator::Current()->Call( \
-      bit_cast<intptr_t, uword>(test->entry()), \
-      reinterpret_cast<intptr_t>(thread), 0, 0, 0)
-#else
-#define ASSEMBER_TEST_RUN_WITH_THREAD(var_name) \
-  typedef int64_t (*Int64Return)(Thread* thread); \
-  Int64Return test_code = reinterpret_cast<Int64Return>(test->entry()); \
-  int64_t var_name = test_code(thread)
-#endif
+  result_type var_name = test->InvokeWithCode<result_type>(thread);
 
 
 // LoadObject null.
 ASSEMBLER_TEST_GENERATE(LoadObjectNull, assembler) {
   __ SetupDartSP(kTestStackSpace);
+  EnterTestFrame(assembler);
   __ Push(THR);
-  __ mov(THR, R0);
-  __ TagAndPushPP();  // Save caller's pool pointer and load a new one here.
-  __ LoadPoolPointer();
+  __ mov(THR, R1);
   __ LoadObject(R0, Object::null_object());
-  __ PopAndUntagPP();
   __ Pop(THR);
+  LeaveTestFrame(assembler);
   __ mov(CSP, SP);
   __ ret();
 }
 
 
 ASSEMBLER_TEST_RUN(LoadObjectNull, test) {
-  ASSEMBLER_TEST_RUN_WITH_THREAD(result);
-  EXPECT_EQ(reinterpret_cast<int64_t>(Object::null()), result);
+  ASSEMBLER_TEST_RUN_WITH_THREAD(RawObject*, result);
+  EXPECT_EQ(Object::null(), result);
 }
 
 
 ASSEMBLER_TEST_GENERATE(LoadObjectTrue, assembler) {
   __ SetupDartSP(kTestStackSpace);
+  EnterTestFrame(assembler);
   __ Push(THR);
-  __ mov(THR, R0);
-  __ TagAndPushPP();  // Save caller's pool pointer and load a new one here.
-  __ LoadPoolPointer();
+  __ mov(THR, R1);
   __ LoadObject(R0, Bool::True());
-  __ PopAndUntagPP();
   __ Pop(THR);
+  LeaveTestFrame(assembler);
   __ mov(CSP, SP);
   __ ret();
 }
 
 
 ASSEMBLER_TEST_RUN(LoadObjectTrue, test) {
-  ASSEMBLER_TEST_RUN_WITH_THREAD(result);
-  EXPECT_EQ(reinterpret_cast<int64_t>(Bool::True().raw()), result);
+  ASSEMBLER_TEST_RUN_WITH_THREAD(RawObject*, result);
+  EXPECT_EQ(Bool::True().raw(), result);
 }
 
 
 ASSEMBLER_TEST_GENERATE(LoadObjectFalse, assembler) {
   __ SetupDartSP(kTestStackSpace);
+  EnterTestFrame(assembler);
   __ Push(THR);
-  __ mov(THR, R0);
-  __ TagAndPushPP();  // Save caller's pool pointer and load a new one here.
-  __ LoadPoolPointer();
+  __ mov(THR, R1);
   __ LoadObject(R0, Bool::False());
-  __ PopAndUntagPP();
   __ Pop(THR);
+  LeaveTestFrame(assembler);
   __ mov(CSP, SP);
   __ ret();
 }
 
 
 ASSEMBLER_TEST_RUN(LoadObjectFalse, test) {
-  ASSEMBLER_TEST_RUN_WITH_THREAD(result);
-  EXPECT_EQ(reinterpret_cast<int64_t>(Bool::False().raw()), result);
+  ASSEMBLER_TEST_RUN_WITH_THREAD(RawObject*, result);
+  EXPECT_EQ(Bool::False().raw(), result);
 }
 
 
@@ -3570,26 +3567,21 @@
 
 // Called from assembler_test.cc.
 // LR: return address.
-// R0: context.
-// R1: value.
-// R2: growable array.
-// R3: current thread.
+// R0: value.
+// R1: growable array.
+// R2: current thread.
 ASSEMBLER_TEST_GENERATE(StoreIntoObject, assembler) {
   __ SetupDartSP(kTestStackSpace);
-  __ TagAndPushPP();
-  __ LoadPoolPointer();
+  __ Push(CODE_REG);
   __ Push(THR);
-  __ Push(CTX);
   __ Push(LR);
-  __ mov(CTX, R0);
-  __ mov(THR, R3);
-  __ StoreIntoObject(R2,
-                     FieldAddress(R2, GrowableObjectArray::data_offset()),
-                     R1);
+  __ mov(THR, R2);
+  __ StoreIntoObject(R1,
+                     FieldAddress(R1, GrowableObjectArray::data_offset()),
+                     R0);
   __ Pop(LR);
-  __ Pop(CTX);
   __ Pop(THR);
-  __ PopAndUntagPP();
+  __ Pop(CODE_REG);
   __ mov(CSP, SP);
   __ ret();
 }
@@ -3597,10 +3589,8 @@
 
 ASSEMBLER_TEST_GENERATE(ComputeRange, assembler) {
   __ SetupDartSP(kTestStackSpace);
-  __ TagAndPushPP();
-  __ LoadPoolPointer();
+  EnterTestFrame(assembler);
   Label miss, done;
-  __ mov(R1, R0);
   __ ComputeRange(R0, R1, R2, &miss);
   __ b(&done);
 
@@ -3608,48 +3598,50 @@
   __ LoadImmediate(R0, -1);
 
   __ Bind(&done);
-  __ PopAndUntagPP();
+  LeaveTestFrame(assembler);
   __ mov(CSP, SP);
   __ ret();
 }
 
 
 ASSEMBLER_TEST_RUN(ComputeRange, test) {
-  typedef intptr_t (*ComputeRange)(intptr_t value) DART_UNUSED;
+#define RANGE_OF(arg_type, v) test->InvokeWithCode<intptr_t, arg_type>(v)
 
-#define RANGE_OF(v)                                              \
-  (EXECUTE_TEST_CODE_INTPTR_INTPTR(                              \
-    ComputeRange, test->entry(), reinterpret_cast<intptr_t>(v)))
-
-  EXPECT_EQ(ICData::kInt32RangeBit, RANGE_OF(Smi::New(0)));
-  EXPECT_EQ(ICData::kInt32RangeBit, RANGE_OF(Smi::New(1)));
-  EXPECT_EQ(ICData::kInt32RangeBit, RANGE_OF(Smi::New(kMaxInt32)));
+  EXPECT_EQ(ICData::kInt32RangeBit, RANGE_OF(RawSmi*, Smi::New(0)));
+  EXPECT_EQ(ICData::kInt32RangeBit, RANGE_OF(RawSmi*, Smi::New(1)));
+  EXPECT_EQ(ICData::kInt32RangeBit, RANGE_OF(RawSmi*, Smi::New(kMaxInt32)));
   EXPECT_EQ(ICData::kInt32RangeBit | ICData::kSignedRangeBit,
-            RANGE_OF(Smi::New(-1)));
+            RANGE_OF(RawSmi*, Smi::New(-1)));
   EXPECT_EQ(ICData::kInt32RangeBit | ICData::kSignedRangeBit,
-            RANGE_OF(Smi::New(kMinInt32)));
+            RANGE_OF(RawSmi*, Smi::New(kMinInt32)));
 
   EXPECT_EQ(ICData::kUint32RangeBit,
-            RANGE_OF(Smi::New(static_cast<int64_t>(kMaxInt32) + 1)));
+            RANGE_OF(RawSmi*, Smi::New(static_cast<int64_t>(kMaxInt32) + 1)));
   EXPECT_EQ(ICData::kUint32RangeBit,
-            RANGE_OF(Smi::New(kMaxUint32)));
+            RANGE_OF(RawSmi*, Smi::New(kMaxUint32)));
 
   // On 64-bit platforms we don't track the sign of the smis outside of
   // int32 range because it is not needed to distinguish kInt32Range from
   // kUint32Range.
   EXPECT_EQ(ICData::kSignedRangeBit,
-            RANGE_OF(Smi::New(static_cast<int64_t>(kMinInt32) - 1)));
+            RANGE_OF(RawSmi*, Smi::New(static_cast<int64_t>(kMinInt32) - 1)));
   EXPECT_EQ(ICData::kSignedRangeBit,
-            RANGE_OF(Smi::New(static_cast<int64_t>(kMaxUint32) + 1)));
-  EXPECT_EQ(ICData::kSignedRangeBit, RANGE_OF(Smi::New(Smi::kMaxValue)));
-  EXPECT_EQ(ICData::kSignedRangeBit, RANGE_OF(Smi::New(Smi::kMinValue)));
+            RANGE_OF(RawSmi*, Smi::New(static_cast<int64_t>(kMaxUint32) + 1)));
+  EXPECT_EQ(ICData::kSignedRangeBit,
+            RANGE_OF(RawSmi*, Smi::New(Smi::kMaxValue)));
+  EXPECT_EQ(ICData::kSignedRangeBit, RANGE_OF(RawSmi*,
+            Smi::New(Smi::kMinValue)));
 
-  EXPECT_EQ(ICData::kInt64RangeBit, RANGE_OF(Integer::New(Smi::kMaxValue + 1)));
-  EXPECT_EQ(ICData::kInt64RangeBit, RANGE_OF(Integer::New(Smi::kMinValue - 1)));
-  EXPECT_EQ(ICData::kInt64RangeBit, RANGE_OF(Integer::New(kMaxInt64)));
-  EXPECT_EQ(ICData::kInt64RangeBit, RANGE_OF(Integer::New(kMinInt64)));
+  EXPECT_EQ(ICData::kInt64RangeBit,
+            RANGE_OF(RawInteger*, Integer::New(Smi::kMaxValue + 1)));
+  EXPECT_EQ(ICData::kInt64RangeBit,
+            RANGE_OF(RawInteger*, Integer::New(Smi::kMinValue - 1)));
+  EXPECT_EQ(ICData::kInt64RangeBit,
+            RANGE_OF(RawInteger*, Integer::New(kMaxInt64)));
+  EXPECT_EQ(ICData::kInt64RangeBit,
+            RANGE_OF(RawInteger*, Integer::New(kMinInt64)));
 
-  EXPECT_EQ(-1, RANGE_OF(Bool::True().raw()));
+  EXPECT_EQ(-1, RANGE_OF(RawBool*, Bool::True().raw()));
 
 #undef RANGE_OF
 }
diff --git a/runtime/vm/assembler_arm_test.cc b/runtime/vm/assembler_arm_test.cc
index 2cc40fd..dd53235 100644
--- a/runtime/vm/assembler_arm_test.cc
+++ b/runtime/vm/assembler_arm_test.cc
@@ -3928,18 +3928,16 @@
 
 // Called from assembler_test.cc.
 // LR: return address.
-// R0: context.
-// R1: value.
-// R2: growable array.
-// R3: current thread.
+// R0: value.
+// R1: growable array.
+// R2: current thread.
 ASSEMBLER_TEST_GENERATE(StoreIntoObject, assembler) {
-  __ PushList((1 << CTX) | (1 << LR) | (1 << THR));
-  __ mov(CTX, Operand(R0));
-  __ mov(THR, Operand(R3));
-  __ StoreIntoObject(R2,
-                     FieldAddress(R2, GrowableObjectArray::data_offset()),
-                     R1);
-  __ PopList((1 << CTX) | (1 << LR) | (1 << THR));
+  __ PushList((1 << LR) | (1 << THR));
+  __ mov(THR, Operand(R2));
+  __ StoreIntoObject(R1,
+                     FieldAddress(R1, GrowableObjectArray::data_offset()),
+                     R0);
+  __ PopList((1 << LR) | (1 << THR));
   __ Ret();
 }
 
diff --git a/runtime/vm/assembler_ia32.cc b/runtime/vm/assembler_ia32.cc
index c6c8da8..7fe4193 100644
--- a/runtime/vm/assembler_ia32.cc
+++ b/runtime/vm/assembler_ia32.cc
@@ -96,8 +96,13 @@
 
 void Assembler::pushl(const Immediate& imm) {
   AssemblerBuffer::EnsureCapacity ensured(&buffer_);
-  EmitUint8(0x68);
-  EmitImmediate(imm);
+  if (imm.is_int8()) {
+    EmitUint8(0x6A);
+    EmitUint8(imm.value() & 0xFF);
+  } else {
+    EmitUint8(0x68);
+    EmitImmediate(imm);
+  }
 }
 
 
@@ -2366,7 +2371,7 @@
   if (object != EDX) {
     movl(EDX, object);
   }
-  Call(*StubCode::UpdateStoreBuffer_entry());
+  call(Address(THR, Thread::update_store_buffer_entry_point_offset()));
   if (value != EDX) {
     popl(EDX);  // Restore EDX.
   }
@@ -2622,8 +2627,9 @@
 
 
 void Assembler::Call(const StubEntry& stub_entry) {
-  const ExternalLabel label(stub_entry.EntryPoint());
-  call(&label);
+  const Code& target = Code::ZoneHandle(stub_entry.code());
+  LoadObject(CODE_REG, target);
+  call(FieldAddress(CODE_REG, Code::entry_point_offset()));
 }
 
 
@@ -2869,18 +2875,19 @@
 }
 
 
+void Assembler::PushCodeObject() {
+  ASSERT(code_.IsNotTemporaryScopedHandle());
+  AssemblerBuffer::EnsureCapacity ensured(&buffer_);
+  EmitUint8(0x68);
+  buffer_.EmitObject(code_);
+}
+
+
 void Assembler::EnterDartFrame(intptr_t frame_size) {
   EnterFrame(0);
-  Label dart_entry;
-  call(&dart_entry);
-  Bind(&dart_entry);
-  // The runtime system assumes that the code marker address is
-  // kEntryPointToPcMarkerOffset bytes from the entry.  If there is any code
-  // generated before entering the frame, the address needs to be adjusted.
-  const intptr_t offset = EntryPointToPcMarkerOffset() - CodeSize();
-  if (offset != 0) {
-    addl(Address(ESP, 0), Immediate(offset));
-  }
+
+  PushCodeObject();
+
   if (frame_size != 0) {
     subl(ESP, Immediate(frame_size));
   }
@@ -2889,8 +2896,7 @@
 
 // On entry to a function compiled for OSR, the caller's frame pointer, the
 // stack locals, and any copied parameters are already in place.  The frame
-// pointer is already set up.  The PC marker is not correct for the
-// optimized function and there may be extra space for spill slots to
+// pointer is already set up. There may be extra space for spill slots to
 // allocate.
 void Assembler::EnterOsrFrame(intptr_t extra_size) {
   Comment("EnterOsrFrame");
@@ -2898,17 +2904,7 @@
     Comment("PrologueOffset = %" Pd "", CodeSize());
     prologue_offset_ = CodeSize();
   }
-  Label dart_entry;
-  call(&dart_entry);
-  Bind(&dart_entry);
-  // The runtime system assumes that the code marker address is
-  // kEntryPointToPcMarkerOffset bytes from the entry.  Since there is no
-  // code to set up the frame pointer, the address needs to be adjusted.
-  const intptr_t offset = EntryPointToPcMarkerOffset() - CodeSize();
-  if (offset != 0) {
-    addl(Address(ESP, 0), Immediate(offset));
-  }
-  popl(Address(EBP, kPcMarkerSlotFromFp * kWordSize));
+
   if (extra_size != 0) {
     subl(ESP, Immediate(extra_size));
   }
@@ -2916,8 +2912,7 @@
 
 
 void Assembler::EnterStubFrame() {
-  EnterFrame(0);
-  pushl(Immediate(0));  // Push 0 in the saved PC area for stub frames.
+  EnterDartFrame(0);
 }
 
 
diff --git a/runtime/vm/assembler_ia32.h b/runtime/vm/assembler_ia32.h
index bac86c4..075ac70 100644
--- a/runtime/vm/assembler_ia32.h
+++ b/runtime/vm/assembler_ia32.h
@@ -305,7 +305,8 @@
       : buffer_(),
         prologue_offset_(-1),
         jit_cookie_(0),
-        comments_() {
+        comments_(),
+        code_(Code::ZoneHandle()) {
     // This mode is only needed and implemented for MIPS and ARM.
     ASSERT(!use_far_branches);
   }
@@ -631,6 +632,10 @@
   void int3();
   void hlt();
 
+  static uword GetBreakInstructionFiller() {
+    return 0xCCCCCCCC;
+  }
+
   // Note: verified_mem mode forces far jumps.
   void j(Condition condition, Label* label, bool near = kFarJump);
   void j(Condition condition, const ExternalLabel* label);
@@ -782,6 +787,10 @@
                                            Register array,
                                            Register index);
 
+  static Address VMTagAddress() {
+    return Address(THR, Thread::vm_tag_offset());
+  }
+
   /*
    * Misc. functionality
    */
@@ -957,6 +966,12 @@
     return !object.IsSmi() || IsSafeSmi(object);
   }
 
+  void set_code_object(const Code& code) {
+    code_ ^= code.raw();
+  }
+
+  void PushCodeObject();
+
  private:
   class CodeComment : public ZoneAllocated {
    public:
@@ -1017,6 +1032,7 @@
   intptr_t prologue_offset_;
   int32_t jit_cookie_;
   GrowableArray<CodeComment*> comments_;
+  Code& code_;
 
   DISALLOW_ALLOCATION();
   DISALLOW_COPY_AND_ASSIGN(Assembler);
diff --git a/runtime/vm/assembler_ia32_test.cc b/runtime/vm/assembler_ia32_test.cc
index b541574..2ce9da2 100644
--- a/runtime/vm/assembler_ia32_test.cc
+++ b/runtime/vm/assembler_ia32_test.cc
@@ -3394,17 +3394,14 @@
 // Called from assembler_test.cc.
 ASSEMBLER_TEST_GENERATE(StoreIntoObject, assembler) {
   __ pushl(THR);
-  __ pushl(CTX);
-  __ movl(CTX, Address(ESP, 3 * kWordSize));
-  __ movl(EAX, Address(ESP, 4 * kWordSize));
-  __ movl(ECX, Address(ESP, 5 * kWordSize));
-  __ movl(THR, Address(ESP, 6 * kWordSize));
+  __ movl(EAX, Address(ESP, 2 * kWordSize));
+  __ movl(ECX, Address(ESP, 3 * kWordSize));
+  __ movl(THR, Address(ESP, 4 * kWordSize));
   __ pushl(EAX);
   __ StoreIntoObject(ECX,
                      FieldAddress(ECX, GrowableObjectArray::data_offset()),
                      EAX);
   __ popl(EAX);
-  __ popl(CTX);
   __ popl(THR);
   __ ret();
 }
diff --git a/runtime/vm/assembler_mips.cc b/runtime/vm/assembler_mips.cc
index e4f9082..90a010a 100644
--- a/runtime/vm/assembler_mips.cc
+++ b/runtime/vm/assembler_mips.cc
@@ -17,6 +17,7 @@
 #if defined(USING_SIMULATOR)
 DECLARE_FLAG(int, trace_sim_after);
 #endif
+DECLARE_FLAG(bool, allow_absolute_addresses);
 DEFINE_FLAG(bool, print_stop_message, false, "Print stop message.");
 DECLARE_FLAG(bool, inline_alloc);
 
@@ -52,7 +53,7 @@
 int32_t Assembler::EncodeBranchOffset(int32_t offset, int32_t instr) {
   if (!CanEncodeBranchOffset(offset)) {
     ASSERT(!use_far_branches());
-    Isolate::Current()->long_jump_base()->Jump(
+    Thread::Current()->long_jump_base()->Jump(
         1, Object::branch_offset_error());
   }
 
@@ -354,22 +355,24 @@
 }
 
 
-void Assembler::LoadWordFromPoolOffset(Register rd, int32_t offset) {
-  ASSERT(constant_pool_allowed());
+void Assembler::LoadWordFromPoolOffset(Register rd,
+                                       int32_t offset,
+                                       Register pp) {
+  ASSERT((pp != PP) || constant_pool_allowed());
   ASSERT(!in_delay_slot_);
-  ASSERT(rd != PP);
+  ASSERT(rd != pp);
   if (Address::CanHoldOffset(offset)) {
-    lw(rd, Address(PP, offset));
+    lw(rd, Address(pp, offset));
   } else {
     const int16_t offset_low = Utils::Low16Bits(offset);  // Signed.
     offset -= offset_low;
     const uint16_t offset_high = Utils::High16Bits(offset);  // Unsigned.
     if (offset_high != 0) {
       lui(rd, Immediate(offset_high));
-      addu(rd, rd, PP);
+      addu(rd, rd, pp);
       lw(rd, Address(rd, offset_low));
     } else {
-      lw(rd, Address(PP, offset_low));
+      lw(rd, Address(pp, offset_low));
     }
   }
 }
@@ -456,64 +459,116 @@
 }
 
 
-void Assembler::Branch(const StubEntry& stub_entry) {
-  const ExternalLabel label(stub_entry.EntryPoint());
-  Branch(&label);
+void Assembler::CheckCodePointer() {
+#ifdef DEBUG
+  Label cid_ok, instructions_ok;
+  Push(CMPRES1);
+  Push(CMPRES2);
+  LoadClassId(CMPRES1, CODE_REG);
+  BranchEqual(CMPRES1, Immediate(kCodeCid), &cid_ok);
+  break_(0);
+  Bind(&cid_ok);
+  GetNextPC(CMPRES1, TMP);
+  const intptr_t entry_offset = CodeSize() - Instr::kInstrSize +
+      Instructions::HeaderSize() - kHeapObjectTag;
+  AddImmediate(CMPRES1, CMPRES1, -entry_offset);
+  lw(CMPRES2, FieldAddress(CODE_REG, Code::saved_instructions_offset()));
+  BranchEqual(CMPRES1, CMPRES2, &instructions_ok);
+  break_(1);
+  Bind(&instructions_ok);
+  Pop(CMPRES2);
+  Pop(CMPRES1);
+#endif
 }
 
 
-void Assembler::BranchPatchable(const StubEntry& stub_entry) {
-  const ExternalLabel label(stub_entry.EntryPoint());
-  BranchPatchable(&label);
+void Assembler::RestoreCodePointer() {
+  lw(CODE_REG, Address(FP, kPcMarkerSlotFromFp * kWordSize));
+  CheckCodePointer();
 }
 
 
-void Assembler::BranchLink(const StubEntry& stub_entry) {
-  const ExternalLabel label(stub_entry.EntryPoint());
-  BranchLink(&label);
+void Assembler::Branch(const StubEntry& stub_entry, Register pp) {
+  ASSERT(!in_delay_slot_);
+  const Code& target_code = Code::Handle(stub_entry.code());
+  const int32_t offset = ObjectPool::element_offset(
+      object_pool_wrapper_.FindObject(target_code, kPatchable));
+  LoadWordFromPoolOffset(CODE_REG, offset - kHeapObjectTag, pp);
+  lw(TMP, FieldAddress(CODE_REG, Code::entry_point_offset()));
+  jr(TMP);
+}
+
+
+void Assembler::BranchLink(const ExternalLabel* label) {
+  ASSERT(!in_delay_slot_);
+  LoadImmediate(T9, label->address());
+  jalr(T9);
+}
+
+
+void Assembler::BranchLink(const Code& target, Patchability patchable) {
+  ASSERT(!in_delay_slot_);
+  const int32_t offset = ObjectPool::element_offset(
+      object_pool_wrapper_.FindObject(target, patchable));
+  LoadWordFromPoolOffset(CODE_REG, offset - kHeapObjectTag);
+  lw(T9, FieldAddress(CODE_REG, Code::entry_point_offset()));
+  jalr(T9);
+  if (patchable == kPatchable) {
+    delay_slot_available_ = false;  // CodePatcher expects a nop.
+  }
 }
 
 
 void Assembler::BranchLink(const StubEntry& stub_entry,
                            Patchability patchable) {
-  const ExternalLabel label(stub_entry.EntryPoint());
-  BranchLink(&label, patchable);
+  BranchLink(Code::Handle(stub_entry.code()), patchable);
 }
 
 
 void Assembler::BranchLinkPatchable(const StubEntry& stub_entry) {
-  const ExternalLabel label(stub_entry.EntryPoint());
-  BranchLink(&label, kPatchable);
+  BranchLink(Code::Handle(stub_entry.code()), kPatchable);
+}
+
+
+bool Assembler::CanLoadFromObjectPool(const Object& object) const {
+  ASSERT(!Thread::CanLoadFromThread(object));
+  if (!constant_pool_allowed()) {
+    return false;
+  }
+
+  ASSERT(object.IsNotTemporaryScopedHandle());
+  ASSERT(object.IsOld());
+  return true;
 }
 
 
 void Assembler::LoadObjectHelper(Register rd,
                                  const Object& object,
                                  bool is_unique) {
-  // Load common VM constants from the thread. This works also in places where
-  // no constant pool is set up (e.g. intrinsic code).
-  if (Thread::CanLoadFromThread(object)) {
-    lw(rd, Address(THR, Thread::OffsetFromThread(object)));
-    return;
-  }
   ASSERT(!in_delay_slot_);
-  // Smis and VM heap objects are never relocated; do not use object pool.
-  if (object.IsSmi()) {
+  if (Thread::CanLoadFromThread(object)) {
+    // Load common VM constants from the thread. This works also in places where
+    // no constant pool is set up (e.g. intrinsic code).
+    lw(rd, Address(THR, Thread::OffsetFromThread(object)));
+  } else if (object.IsSmi()) {
+    // Relocation doesn't apply to Smis.
     LoadImmediate(rd, reinterpret_cast<int32_t>(object.raw()));
-  } else if (object.InVMHeap() || !constant_pool_allowed()) {
-    // Make sure that class CallPattern is able to decode this load immediate.
-    int32_t object_raw = reinterpret_cast<int32_t>(object.raw());
-    const uint16_t object_low = Utils::Low16Bits(object_raw);
-    const uint16_t object_high = Utils::High16Bits(object_raw);
-    lui(rd, Immediate(object_high));
-    ori(rd, rd, Immediate(object_low));
-  } else {
+  } else if (CanLoadFromObjectPool(object)) {
     // 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));
     LoadWordFromPoolOffset(rd, offset - kHeapObjectTag);
+  } else {
+    ASSERT(FLAG_allow_absolute_addresses);
+    ASSERT(object.IsOld());
+    // Make sure that class CallPattern is able to decode this load immediate.
+    int32_t object_raw = reinterpret_cast<int32_t>(object.raw());
+    const uint16_t object_low = Utils::Low16Bits(object_raw);
+    const uint16_t object_high = Utils::High16Bits(object_raw);
+    lui(rd, Immediate(object_high));
+    ori(rd, rd, Immediate(object_low));
   }
 }
 
@@ -528,11 +583,20 @@
 }
 
 
-void Assembler::LoadExternalLabel(Register rd,
-                                  const ExternalLabel* label,
-                                  Patchability patchable) {
+void Assembler::LoadFunctionFromCalleePool(Register dst,
+                                           const Function& function,
+                                           Register new_pp) {
+  const int32_t offset =
+      ObjectPool::element_offset(object_pool_wrapper_.FindObject(function));
+  LoadWordFromPoolOffset(dst, offset - kHeapObjectTag, new_pp);
+}
+
+
+void Assembler::LoadNativeEntry(Register rd,
+                                const ExternalLabel* label,
+                                Patchability patchable) {
   const int32_t offset = ObjectPool::element_offset(
-      object_pool_wrapper_.FindExternalLabel(label, patchable));
+      object_pool_wrapper_.FindNativeEntry(label, patchable));
   LoadWordFromPoolOffset(rd, offset - kHeapObjectTag);
 }
 
@@ -605,6 +669,7 @@
   if (object != T0) {
     mov(T0, object);
   }
+  lw(CODE_REG, Address(THR, Thread::update_store_buffer_code_offset()));
   lw(T9, Address(THR, Thread::update_store_buffer_entry_point_offset()));
   jalr(T9);
   lw(RA, Address(SP, 0 * kWordSize));
@@ -720,15 +785,14 @@
 
 
 void Assembler::LoadClassIdMayBeSmi(Register result, Register object) {
-  static const intptr_t kSmiCidSource = kSmiCid << RawObject::kClassIdTagPos;
-
-  LoadImmediate(TMP, reinterpret_cast<int32_t>(&kSmiCidSource) + 1);
+  Label heap_object, done;
   andi(CMPRES1, object, Immediate(kSmiTagMask));
-  if (result != object) {
-    mov(result, object);
-  }
-  movz(result, TMP, CMPRES1);
-  LoadClassId(result, result);
+  bne(CMPRES1, ZR, &heap_object);
+  LoadImmediate(result, kSmiCid);
+  b(&done);
+  Bind(&heap_object);
+  LoadClassId(result, object);
+  Bind(&done);
 }
 
 
@@ -800,38 +864,18 @@
 }
 
 
-void Assembler::EnterStubFrame() {
-  ASSERT(!in_delay_slot_);
-  SetPrologueOffset();
-  addiu(SP, SP, Immediate(-4 * kWordSize));
-  sw(ZR, Address(SP, 3 * kWordSize));  // PC marker is 0 in stubs.
-  sw(RA, Address(SP, 2 * kWordSize));
-  sw(FP, Address(SP, 1 * kWordSize));
-  sw(PP, Address(SP, 0 * kWordSize));
-  addiu(FP, SP, Immediate(1 * kWordSize));
-  // Setup pool pointer for this stub.
-  LoadPoolPointer();
+void Assembler::EnterStubFrame(intptr_t frame_size) {
+  EnterDartFrame(frame_size);
 }
 
 
 void Assembler::LeaveStubFrame() {
-  ASSERT(!in_delay_slot_);
-  addiu(SP, FP, Immediate(-1 * kWordSize));
-  lw(RA, Address(SP, 2 * kWordSize));
-  lw(FP, Address(SP, 1 * kWordSize));
-  lw(PP, Address(SP, 0 * kWordSize));
-  addiu(SP, SP, Immediate(4 * kWordSize));
+  LeaveDartFrame();
 }
 
 
 void Assembler::LeaveStubFrameAndReturn(Register ra) {
-  ASSERT(!in_delay_slot_);
-  addiu(SP, FP, Immediate(-1 * kWordSize));
-  lw(RA, Address(SP, 2 * kWordSize));
-  lw(FP, Address(SP, 1 * kWordSize));
-  lw(PP, Address(SP, 0 * kWordSize));
-  jr(ra);
-  delay_slot()->addiu(SP, SP, Immediate(4 * kWordSize));
+  LeaveDartFrameAndReturn(ra);
 }
 
 
@@ -846,6 +890,7 @@
   intptr_t counter_offset =
       ClassTable::CounterOffsetFor(cid, space == Heap::kNew);
   if (inline_isolate) {
+    ASSERT(FLAG_allow_absolute_addresses);
     ClassTable* class_table = Isolate::Current()->class_table();
     ClassHeapStats** table_ptr = class_table->TableAddressFor(cid);
     if (cid < kNumPredefinedCids) {
@@ -924,6 +969,7 @@
   ASSERT(temp_reg != TMP);
   intptr_t state_offset = ClassTable::StateOffsetFor(cid);
   if (inline_isolate) {
+    ASSERT(FLAG_allow_absolute_addresses);
     ClassTable* class_table = Isolate::Current()->class_table();
     ClassHeapStats** table_ptr = class_table->TableAddressFor(cid);
     if (cid < kNumPredefinedCids) {
@@ -1002,7 +1048,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.
-    MaybeTraceAllocation(cid, temp1, failure);
+    MaybeTraceAllocation(cid, temp1, failure, /* inline_isolate = */ false);
     Isolate* isolate = Isolate::Current();
     Heap* heap = isolate->heap();
     Heap::Space space = heap->SpaceForAllocation(cid);
@@ -1049,31 +1095,19 @@
 
 void Assembler::EnterDartFrame(intptr_t frame_size) {
   ASSERT(!in_delay_slot_);
-  const intptr_t offset = CodeSize();
 
   SetPrologueOffset();
 
   addiu(SP, SP, Immediate(-4 * kWordSize));
-  sw(RA, Address(SP, 2 * kWordSize));
-  sw(FP, Address(SP, 1 * kWordSize));
+  sw(RA, Address(SP, 3 * kWordSize));
+  sw(FP, Address(SP, 2 * kWordSize));
+  sw(CODE_REG, Address(SP, 1 * kWordSize));
   sw(PP, Address(SP, 0 * kWordSize));
 
-  GetNextPC(TMP);  // TMP gets the address of the next instruction.
-
-  // Calculate the offset of the pool pointer from the PC.
-  const intptr_t object_pool_pc_dist =
-      Instructions::HeaderSize() - Instructions::object_pool_offset() +
-      CodeSize();
-
-  // Save PC in frame for fast identification of corresponding code.
-  AddImmediate(TMP, -offset);
-  sw(TMP, Address(SP, 3 * kWordSize));
-
   // Set FP to the saved previous FP.
-  addiu(FP, SP, Immediate(kWordSize));
+  addiu(FP, SP, Immediate(2 * kWordSize));
 
-  // Load the pool pointer. offset has already been subtracted from TMP.
-  lw(PP, Address(TMP, -object_pool_pc_dist + offset));
+  LoadPoolPointer();
 
   // Reserve space for locals.
   AddImmediate(SP, -frame_size);
@@ -1089,55 +1123,43 @@
   ASSERT(!in_delay_slot_);
   Comment("EnterOsrFrame");
 
-  GetNextPC(TMP);  // TMP gets the address of the next instruction.
-
-  // The runtime system assumes that the code marker address is
-  // kEntryPointToPcMarkerOffset bytes from the entry.  Since there is no
-  // code to set up the frame pointer, etc., the address needs to be adjusted.
-  const intptr_t offset = EntryPointToPcMarkerOffset() - CodeSize();
-  // Calculate the offset of the pool pointer from the PC.
-  const intptr_t object_pool_pc_dist =
-      Instructions::HeaderSize() - Instructions::object_pool_offset() +
-      CodeSize();
-
-  // Adjust PC by the offset, and store it in the stack frame.
-  AddImmediate(TMP, TMP, offset);
-  sw(TMP, Address(FP, kPcMarkerSlotFromFp * kWordSize));
-
   // Restore return address.
   lw(RA, Address(FP, 1 * kWordSize));
 
   // Load the pool pointer. offset has already been subtracted from temp.
-  lw(PP, Address(TMP, -object_pool_pc_dist - offset));
+  RestoreCodePointer();
+  LoadPoolPointer();
 
   // Reserve space for locals.
   AddImmediate(SP, -extra_size);
 }
 
 
-void Assembler::LeaveDartFrame() {
+void Assembler::LeaveDartFrame(RestorePP restore_pp) {
   ASSERT(!in_delay_slot_);
-  addiu(SP, FP, Immediate(-kWordSize));
+  addiu(SP, FP, Immediate(-2 * kWordSize));
 
-  lw(RA, Address(SP, 2 * kWordSize));
-  lw(FP, Address(SP, 1 * kWordSize));
-  lw(PP, Address(SP, 0 * kWordSize));
+  lw(RA, Address(SP, 3 * kWordSize));
+  lw(FP, Address(SP, 2 * kWordSize));
+  if (restore_pp == kRestoreCallerPP) {
+    lw(PP, Address(SP, 0 * kWordSize));
+  }
 
   // Adjust SP for PC, RA, FP, PP pushed in EnterDartFrame.
   addiu(SP, SP, Immediate(4 * kWordSize));
 }
 
 
-void Assembler::LeaveDartFrameAndReturn() {
+void Assembler::LeaveDartFrameAndReturn(Register ra) {
   ASSERT(!in_delay_slot_);
-  addiu(SP, FP, Immediate(-kWordSize));
+  addiu(SP, FP, Immediate(-2 * kWordSize));
 
-  lw(RA, Address(SP, 2 * kWordSize));
-  lw(FP, Address(SP, 1 * kWordSize));
+  lw(RA, Address(SP, 3 * kWordSize));
+  lw(FP, Address(SP, 2 * kWordSize));
   lw(PP, Address(SP, 0 * kWordSize));
 
   // Adjust SP for PC, RA, FP, PP pushed in EnterDartFrame, and return.
-  Ret();
+  jr(ra);
   delay_slot()->addiu(SP, SP, Immediate(4 * kWordSize));
 }
 
@@ -1158,7 +1180,7 @@
   ASSERT(!in_delay_slot_);
   const intptr_t kPushedRegistersSize =
       kDartVolatileCpuRegCount * kWordSize +
-      2 * kWordSize +  // FP and RA.
+      3 * kWordSize +  // PP, FP and RA.
       kDartVolatileFpuRegCount * kWordSize;
 
   SetPrologueOffset();
@@ -1179,18 +1201,21 @@
   for (int i = kDartFirstVolatileFpuReg; i <= kDartLastVolatileFpuReg; i++) {
     // These go above the volatile CPU registers.
     const int slot =
-        (i - kDartFirstVolatileFpuReg) + kDartVolatileCpuRegCount + 2;
+        (i - kDartFirstVolatileFpuReg) + kDartVolatileCpuRegCount + 3;
     FRegister reg = static_cast<FRegister>(i);
     swc1(reg, Address(SP, slot * kWordSize));
   }
   for (int i = kDartFirstVolatileCpuReg; i <= kDartLastVolatileCpuReg; i++) {
     // + 2 because FP goes in slot 0.
-    const int slot = (i - kDartFirstVolatileCpuReg) + 2;
+    const int slot = (i - kDartFirstVolatileCpuReg) + 3;
     Register reg = static_cast<Register>(i);
     sw(reg, Address(SP, slot * kWordSize));
   }
-  sw(RA, Address(SP, 1 * kWordSize));
-  sw(FP, Address(SP, 0 * kWordSize));
+  sw(RA, Address(SP, 2 * kWordSize));
+  sw(FP, Address(SP, 1 * kWordSize));
+  sw(PP, Address(SP, 0 * kWordSize));
+  LoadPoolPointer();
+
   mov(FP, SP);
 
   ReserveAlignedFrameSpace(frame_space);
@@ -1201,7 +1226,7 @@
   ASSERT(!in_delay_slot_);
   const intptr_t kPushedRegistersSize =
       kDartVolatileCpuRegCount * kWordSize +
-      2 * kWordSize +  // FP and RA.
+      3 * kWordSize +  // FP and RA.
       kDartVolatileFpuRegCount * kWordSize;
 
   Comment("LeaveCallRuntimeFrame");
@@ -1212,18 +1237,19 @@
   mov(SP, FP);
 
   // Restore volatile CPU and FPU registers from the stack.
-  lw(FP, Address(SP, 0 * kWordSize));
-  lw(RA, Address(SP, 1 * kWordSize));
+  lw(PP, Address(SP, 0 * kWordSize));
+  lw(FP, Address(SP, 1 * kWordSize));
+  lw(RA, Address(SP, 2 * kWordSize));
   for (int i = kDartFirstVolatileCpuReg; i <= kDartLastVolatileCpuReg; i++) {
     // + 2 because FP goes in slot 0.
-    const int slot = (i - kDartFirstVolatileCpuReg) + 2;
+    const int slot = (i - kDartFirstVolatileCpuReg) + 3;
     Register reg = static_cast<Register>(i);
     lw(reg, Address(SP, slot * kWordSize));
   }
   for (int i = kDartFirstVolatileFpuReg; i <= kDartLastVolatileFpuReg; i++) {
     // These go above the volatile CPU registers.
     const int slot =
-        (i - kDartFirstVolatileFpuReg) + kDartVolatileCpuRegCount + 2;
+        (i - kDartFirstVolatileFpuReg) + kDartVolatileCpuRegCount + 3;
     FRegister reg = static_cast<FRegister>(i);
     lwc1(reg, Address(SP, slot * kWordSize));
   }
diff --git a/runtime/vm/assembler_mips.h b/runtime/vm/assembler_mips.h
index 0f0897f..5316110 100644
--- a/runtime/vm/assembler_mips.h
+++ b/runtime/vm/assembler_mips.h
@@ -288,21 +288,12 @@
 
   // Set up a stub frame so that the stack traversal code can easily identify
   // a stub frame.
-  void EnterStubFrame();
+  void EnterStubFrame(intptr_t frame_size = 0);
   void LeaveStubFrame();
   // A separate macro for when a Ret immediately follows, so that we can use
   // the branch delay slot.
   void LeaveStubFrameAndReturn(Register ra = RA);
 
-  // Instruction pattern from entrypoint is used in dart frame prologs
-  // to set up the frame and save a PC which can be used to figure out the
-  // RawInstruction object corresponding to the code running in the frame.
-  // See EnterDartFrame. There are 6 instructions before we know the PC.
-  static const intptr_t kEntryPointToPcMarkerOffset = 6 * Instr::kInstrSize;
-  static intptr_t EntryPointToPcMarkerOffset() {
-    return kEntryPointToPcMarkerOffset;
-  }
-
   void UpdateAllocationStats(intptr_t cid,
                              Register temp_reg,
                              Heap::Space space,
@@ -513,11 +504,20 @@
     EmitBranchDelayNop();
   }
 
-  void break_(int32_t code) {
+  static int32_t BreakEncoding(int32_t code) {
     ASSERT(Utils::IsUint(20, code));
-    Emit(SPECIAL << kOpcodeShift |
-         code << kBreakCodeShift |
-         BREAK << kFunctionShift);
+    return SPECIAL << kOpcodeShift |
+           code << kBreakCodeShift |
+           BREAK << kFunctionShift;
+  }
+
+
+  void break_(int32_t code) {
+    Emit(BreakEncoding(code));
+  }
+
+  static uword GetBreakInstructionFiller() {
+    return BreakEncoding(0);
   }
 
   // FPU compare, always false.
@@ -912,50 +912,10 @@
     SubuDetectOverflow(rd, rs, rd, ro);
   }
 
-  void Branch(const ExternalLabel* label) {
-    ASSERT(!in_delay_slot_);
-    LoadImmediate(TMP, label->address());
-    jr(TMP);
-  }
+  void Branch(const StubEntry& stub_entry, Register pp = PP);
 
-  void Branch(const StubEntry& stub_entry);
-
-  void BranchPatchable(const ExternalLabel* label) {
-    ASSERT(!in_delay_slot_);
-    const uint16_t low = Utils::Low16Bits(label->address());
-    const uint16_t high = Utils::High16Bits(label->address());
-    lui(T9, Immediate(high));
-    ori(T9, T9, Immediate(low));
-    jr(T9);
-    delay_slot_available_ = false;  // CodePatcher expects a nop.
-  }
-
-  void BranchPatchable(const StubEntry& stub_entry);
-
-  void BranchLink(const ExternalLabel* label) {
-    ASSERT(!in_delay_slot_);
-    LoadImmediate(T9, label->address());
-    jalr(T9);
-  }
-
-  void BranchLink(const StubEntry& stub_entry);
-
-  void BranchLink(const ExternalLabel* label, Patchability patchable) {
-    ASSERT(!in_delay_slot_);
-    const int32_t offset = ObjectPool::element_offset(
-        object_pool_wrapper_.FindExternalLabel(label, patchable));
-    LoadWordFromPoolOffset(T9, offset - kHeapObjectTag);
-    jalr(T9);
-    if (patchable == kPatchable) {
-      delay_slot_available_ = false;  // CodePatcher expects a nop.
-    }
-  }
-
-  void BranchLink(const StubEntry& stub_entry, Patchability patchable);
-
-  void BranchLinkPatchable(const ExternalLabel* label) {
-    BranchLink(label, kPatchable);
-  }
+  void BranchLink(const StubEntry& stub_entry,
+                  Patchability patchable = kNotPatchable);
 
   void BranchLinkPatchable(const StubEntry& stub_entry);
 
@@ -966,15 +926,17 @@
     }
   }
 
-  void LoadPoolPointer() {
+  void LoadPoolPointer(Register reg = PP) {
     ASSERT(!in_delay_slot_);
-    GetNextPC(TMP);  // TMP gets the address of the next instruction.
-    const intptr_t object_pool_pc_dist =
-        Instructions::HeaderSize() - Instructions::object_pool_offset() +
-        CodeSize();
-    lw(PP, Address(TMP, -object_pool_pc_dist));
+    CheckCodePointer();
+    lw(reg, FieldAddress(CODE_REG, Code::object_pool_offset()));
+    set_constant_pool_allowed(reg == PP);
   }
 
+  void CheckCodePointer();
+
+  void RestoreCodePointer();
+
   void LoadImmediate(Register rd, int32_t value) {
     ASSERT(!in_delay_slot_);
     if (Utils::IsInt(kImmBits, value)) {
@@ -1555,12 +1517,14 @@
   void EnterCallRuntimeFrame(intptr_t frame_space);
   void LeaveCallRuntimeFrame();
 
-  void LoadWordFromPoolOffset(Register rd, int32_t offset);
   void LoadObject(Register rd, const Object& object);
   void LoadUniqueObject(Register rd, const Object& object);
-  void LoadExternalLabel(Register rd,
-                         const ExternalLabel* label,
-                         Patchability patchable);
+  void LoadFunctionFromCalleePool(Register dst,
+                                  const Function& function,
+                                  Register new_pp);
+  void LoadNativeEntry(Register rd,
+                       const ExternalLabel* label,
+                       Patchability patchable);
   void PushObject(const Object& object);
 
   void LoadIsolate(Register result);
@@ -1609,8 +1573,8 @@
   // enable easy access to the RawInstruction object of code corresponding
   // to this frame.
   void EnterDartFrame(intptr_t frame_size);
-  void LeaveDartFrame();
-  void LeaveDartFrameAndReturn();
+  void LeaveDartFrame(RestorePP restore_pp = kRestoreCallerPP);
+  void LeaveDartFrameAndReturn(Register ra = RA);
 
   // Set up a Dart frame for a function compiled for on-stack replacement.
   // The frame layout is a normal Dart frame, but the frame is partially set
@@ -1629,6 +1593,10 @@
                                     Register array,
                                     Register index);
 
+  static Address VMTagAddress() {
+    return Address(THR, Thread::vm_tag_offset());
+  }
+
   // On some other platforms, we draw a distinction between safe and unsafe
   // smis.
   static bool IsSafe(const Object& object) { return true; }
@@ -1670,6 +1638,12 @@
 
   bool constant_pool_allowed_;
 
+  void BranchLink(const ExternalLabel* label);
+  void BranchLink(const Code& code, Patchability patchable);
+
+  bool CanLoadFromObjectPool(const Object& object) const;
+
+  void LoadWordFromPoolOffset(Register rd, int32_t offset, Register pp = PP);
   void LoadObjectHelper(Register rd, const Object& object, bool is_unique);
 
   void Emit(int32_t value) {
diff --git a/runtime/vm/assembler_mips_test.cc b/runtime/vm/assembler_mips_test.cc
index a0a3a41..552aa60 100644
--- a/runtime/vm/assembler_mips_test.cc
+++ b/runtime/vm/assembler_mips_test.cc
@@ -2083,23 +2083,21 @@
 
 // Called from assembler_test.cc.
 // RA: return address.
-// A0: context.
-// A1: value.
-// A2: growable array.
-// A3: current thread.
+// A0: value.
+// A1: growable array.
+// A2: current thread.
 ASSEMBLER_TEST_GENERATE(StoreIntoObject, assembler) {
   __ addiu(SP, SP, Immediate(-3 * kWordSize));
-  __ sw(THR, Address(SP, 2 * kWordSize));
-  __ sw(CTX, Address(SP, 1 * kWordSize));
+  __ sw(CODE_REG, Address(SP, 2 * kWordSize));
+  __ sw(THR, Address(SP, 1 * kWordSize));
   __ sw(RA, Address(SP, 0 * kWordSize));
-  __ mov(CTX, A0);
-  __ mov(THR, A3);
-  __ StoreIntoObject(A2,
-                     FieldAddress(A2, GrowableObjectArray::data_offset()),
-                     A1);
+  __ mov(THR, A2);
+  __ StoreIntoObject(A1,
+                     FieldAddress(A1, GrowableObjectArray::data_offset()),
+                     A0);
   __ lw(RA, Address(SP, 0 * kWordSize));
-  __ lw(CTX, Address(SP, 1 * kWordSize));
-  __ lw(THR, Address(SP, 2 * kWordSize));
+  __ lw(THR, Address(SP, 1 * kWordSize));
+  __ lw(CODE_REG, Address(SP, 2 * kWordSize));
   __ addiu(SP, SP, Immediate(3 * kWordSize));
   __ Ret();
 }
diff --git a/runtime/vm/assembler_test.cc b/runtime/vm/assembler_test.cc
index 5933488..fbbd994 100644
--- a/runtime/vm/assembler_test.cc
+++ b/runtime/vm/assembler_test.cc
@@ -14,21 +14,9 @@
 ASSEMBLER_TEST_EXTERN(StoreIntoObject);
 
 ASSEMBLER_TEST_RUN(StoreIntoObject, test) {
-#if defined(USING_SIMULATOR)
-#define test_code(ctx, value, growable_array, thread)                          \
-  Simulator::Current()->Call(                                                  \
-      bit_cast<intptr_t, uword>(test->entry()),                                \
-      reinterpret_cast<intptr_t>(ctx),                                         \
-      reinterpret_cast<intptr_t>(value),                                       \
-      reinterpret_cast<intptr_t>(growable_array),                              \
-      reinterpret_cast<intptr_t>(thread))
-#else
-  typedef void (*StoreData)(RawContext* ctx,
-                            RawObject* value,
-                            RawObject* growable_array,
-                            Thread* thread);
-  StoreData test_code = reinterpret_cast<StoreData>(test->entry());
-#endif
+#define TEST_CODE(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));
@@ -37,7 +25,6 @@
   const GrowableObjectArray& grow_new_array = GrowableObjectArray::Handle(
       GrowableObjectArray::New(old_array, Heap::kNew));
   Smi& smi = Smi::Handle();
-  const Context& ctx = Context::Handle(Context::New(0));
   Thread* thread = Thread::Current();
 
   EXPECT(old_array.raw() == grow_old_array.data());
@@ -48,28 +35,28 @@
   // Store Smis into the old object.
   for (int i = -128; i < 128; i++) {
     smi = Smi::New(i);
-    test_code(ctx.raw(), smi.raw(), grow_old_array.raw(), thread);
+    TEST_CODE(smi.raw(), grow_old_array.raw(), thread);
     EXPECT(reinterpret_cast<RawArray*>(smi.raw()) == grow_old_array.data());
     EXPECT(!thread->StoreBufferContains(grow_old_array.raw()));
   }
 
   // Store an old object into the old object.
-  test_code(ctx.raw(), old_array.raw(), grow_old_array.raw(), thread);
+  TEST_CODE(old_array.raw(), grow_old_array.raw(), thread);
   EXPECT(old_array.raw() == grow_old_array.data());
   EXPECT(!thread->StoreBufferContains(grow_old_array.raw()));
 
   // Store a new object into the old object.
-  test_code(ctx.raw(), new_array.raw(), grow_old_array.raw(), thread);
+  TEST_CODE(new_array.raw(), grow_old_array.raw(), thread);
   EXPECT(new_array.raw() == grow_old_array.data());
   EXPECT(thread->StoreBufferContains(grow_old_array.raw()));
 
   // Store a new object into the new object.
-  test_code(ctx.raw(), new_array.raw(), grow_new_array.raw(), thread);
+  TEST_CODE(new_array.raw(), grow_new_array.raw(), thread);
   EXPECT(new_array.raw() == grow_new_array.data());
   EXPECT(!thread->StoreBufferContains(grow_new_array.raw()));
 
   // Store an old object into the new object.
-  test_code(ctx.raw(), old_array.raw(), grow_new_array.raw(), thread);
+  TEST_CODE(old_array.raw(), grow_new_array.raw(), thread);
   EXPECT(old_array.raw() == grow_new_array.data());
   EXPECT(!thread->StoreBufferContains(grow_new_array.raw()));
 }
diff --git a/runtime/vm/assembler_x64.cc b/runtime/vm/assembler_x64.cc
index fd27c9a..04e82d8 100644
--- a/runtime/vm/assembler_x64.cc
+++ b/runtime/vm/assembler_x64.cc
@@ -17,6 +17,7 @@
 
 namespace dart {
 
+DECLARE_FLAG(bool, allow_absolute_addresses);
 DEFINE_FLAG(bool, print_stop_message, true, "Print stop message.");
 DECLARE_FLAG(bool, inline_alloc);
 
@@ -61,11 +62,11 @@
 }
 
 
-void Assembler::LoadExternalLabel(Register dst,
-                                  const ExternalLabel* label,
-                                  Patchability patchable) {
+void Assembler::LoadNativeEntry(Register dst,
+                                const ExternalLabel* label,
+                                Patchability patchable) {
   const int32_t offset = ObjectPool::element_offset(
-      object_pool_wrapper_.FindExternalLabel(label, patchable));
+      object_pool_wrapper_.FindNativeEntry(label, patchable));
   LoadWordFromPoolOffset(dst, offset - kHeapObjectTag);
 }
 
@@ -81,33 +82,27 @@
 }
 
 
-void Assembler::CallPatchable(const ExternalLabel* label) {
+void Assembler::CallPatchable(const StubEntry& stub_entry) {
   ASSERT(constant_pool_allowed());
+  const Code& target = Code::Handle(stub_entry.code());
   intptr_t call_start = buffer_.GetPosition();
   const int32_t offset = ObjectPool::element_offset(
-      object_pool_wrapper_.FindExternalLabel(label, kPatchable));
-  call(Address::AddressBaseImm32(PP, offset - kHeapObjectTag));
+      object_pool_wrapper_.FindObject(target, kPatchable));
+  LoadWordFromPoolOffset(CODE_REG, offset - kHeapObjectTag);
+  movq(TMP, FieldAddress(CODE_REG, Code::entry_point_offset()));
+  call(TMP);
   ASSERT((buffer_.GetPosition() - call_start) == kCallExternalLabelSize);
 }
 
 
-void Assembler::Call(const ExternalLabel* label) {
-  ASSERT(constant_pool_allowed());
-  const int32_t offset = ObjectPool::element_offset(
-      object_pool_wrapper_.FindExternalLabel(label, kNotPatchable));
-  call(Address::AddressBaseImm32(PP, offset - kHeapObjectTag));
-}
-
-
-void Assembler::CallPatchable(const StubEntry& stub_entry) {
-  const ExternalLabel label(stub_entry.EntryPoint());
-  CallPatchable(&label);
-}
-
-
 void Assembler::Call(const StubEntry& stub_entry) {
-  const ExternalLabel label(stub_entry.EntryPoint());
-  Call(&label);
+  ASSERT(constant_pool_allowed());
+  const Code& target = Code::Handle(stub_entry.code());
+  const int32_t offset = ObjectPool::element_offset(
+      object_pool_wrapper_.FindObject(target, kNotPatchable));
+  LoadWordFromPoolOffset(CODE_REG, offset - kHeapObjectTag);
+  movq(TMP, FieldAddress(CODE_REG, Code::entry_point_offset()));
+  call(TMP);
 }
 
 
@@ -127,7 +122,11 @@
 
 
 void Assembler::pushq(const Immediate& imm) {
-  if (imm.is_int32()) {
+  if (imm.is_int8()) {
+    AssemblerBuffer::EnsureCapacity ensured(&buffer_);
+    EmitUint8(0x6A);
+    EmitUint8(imm.value() & 0xFF);
+  } else if (imm.is_int32()) {
     AssemblerBuffer::EnsureCapacity ensured(&buffer_);
     EmitUint8(0x68);
     EmitImmediate(imm);
@@ -2544,32 +2543,17 @@
 }
 
 
-void Assembler::j(Condition condition, const ExternalLabel* label) {
-  Label no_jump;
-  // Negate condition.
-  j(static_cast<Condition>(condition ^ 1), &no_jump, Assembler::kNearJump);
-  jmp(label);
-  Bind(&no_jump);
-}
-
-
-void Assembler::J(Condition condition, const ExternalLabel* label,
+void Assembler::J(Condition condition,
+                  const StubEntry& stub_entry,
                   Register pp) {
   Label no_jump;
   // Negate condition.
-  j(static_cast<Condition>(condition ^ 1), &no_jump, Assembler::kNearJump);
-  Jmp(label, pp);
+  j(static_cast<Condition>(condition ^ 1), &no_jump, kNearJump);
+  Jmp(stub_entry, pp);
   Bind(&no_jump);
 }
 
 
-void Assembler::J(Condition condition, const StubEntry& stub_entry,
-                  Register pp) {
-  const ExternalLabel label(stub_entry.EntryPoint());
-  J(condition, &label, pp);
-}
-
-
 void Assembler::jmp(Register reg) {
   AssemblerBuffer::EnsureCapacity ensured(&buffer_);
   Operand operand(reg);
@@ -2625,40 +2609,25 @@
 }
 
 
-void Assembler::jmp(const StubEntry& stub_entry) {
-  const ExternalLabel label(stub_entry.EntryPoint());
-  jmp(&label);
-}
-
-
-void Assembler::JmpPatchable(const ExternalLabel* label, Register pp) {
-  ASSERT((pp != PP) || constant_pool_allowed());
-  intptr_t call_start = buffer_.GetPosition();
-  const int32_t offset = ObjectPool::element_offset(
-      object_pool_wrapper_.FindExternalLabel(label, kPatchable));
-  // Patchable jumps always use a 32-bit immediate encoding.
-  jmp(Address::AddressBaseImm32(pp, offset - kHeapObjectTag));
-  ASSERT((buffer_.GetPosition() - call_start) == JumpPattern::kLengthInBytes);
-}
-
-
 void Assembler::JmpPatchable(const StubEntry& stub_entry, Register pp) {
-  const ExternalLabel label(stub_entry.EntryPoint());
-  JmpPatchable(&label, pp);
-}
-
-
-void Assembler::Jmp(const ExternalLabel* label, Register pp) {
   ASSERT((pp != PP) || constant_pool_allowed());
+  const Code& target = Code::Handle(stub_entry.code());
   const int32_t offset = ObjectPool::element_offset(
-      object_pool_wrapper_.FindExternalLabel(label, kNotPatchable));
-  jmp(Address(pp, offset - kHeapObjectTag));
+      object_pool_wrapper_.FindObject(target, kPatchable));
+  movq(CODE_REG, Address::AddressBaseImm32(pp, offset - kHeapObjectTag));
+  movq(TMP, FieldAddress(CODE_REG, Code::entry_point_offset()));
+  jmp(TMP);
 }
 
 
 void Assembler::Jmp(const StubEntry& stub_entry, Register pp) {
-  const ExternalLabel label(stub_entry.EntryPoint());
-  Jmp(&label, pp);
+  ASSERT((pp != PP) || constant_pool_allowed());
+  const Code& target = Code::Handle(stub_entry.code());
+  const int32_t offset = ObjectPool::element_offset(
+      object_pool_wrapper_.FindObject(target, kNotPatchable));
+  movq(CODE_REG, FieldAddress(pp, offset));
+  movq(TMP, FieldAddress(CODE_REG, Code::entry_point_offset()));
+  jmp(TMP);
 }
 
 
@@ -2857,6 +2826,7 @@
     LoadWordFromPoolOffset(dst, offset - kHeapObjectTag);
   } else {
     ASSERT(object.IsSmi() || object.InVMHeap());
+    ASSERT(object.IsSmi() || FLAG_allow_absolute_addresses);
     LoadImmediate(dst, Immediate(reinterpret_cast<int64_t>(object.raw())));
   }
 }
@@ -2891,6 +2861,7 @@
     LoadObject(TMP, object);
     movq(dst, TMP);
   } else {
+    ASSERT(object.IsSmi() || FLAG_allow_absolute_addresses);
     MoveImmediate(dst, Immediate(reinterpret_cast<int64_t>(object.raw())));
   }
 }
@@ -2903,6 +2874,7 @@
     LoadObject(TMP, object);
     pushq(TMP);
   } else {
+    ASSERT(object.IsSmi() || FLAG_allow_absolute_addresses);
     PushImmediate(Immediate(reinterpret_cast<int64_t>(object.raw())));
   }
 }
@@ -2916,6 +2888,7 @@
         ObjectPool::element_offset(object_pool_wrapper_.FindObject(object));
     cmpq(reg, Address(PP, offset-kHeapObjectTag));
   } else {
+    ASSERT(object.IsSmi() || FLAG_allow_absolute_addresses);
     CompareImmediate(
         reg, Immediate(reinterpret_cast<int64_t>(object.raw())));
   }
@@ -3065,7 +3038,8 @@
 #else
 #error Only supported in DEBUG mode
 #endif
-  cmpq(dest, Immediate(reinterpret_cast<uint64_t>(Object::null())));
+  LoadObject(TMP, Object::null_object());
+  cmpq(dest, TMP);
   j(EQUAL, &ok, Assembler::kNearJump);
   static const bool kFixedLengthEncoding = true;
   Stop("Expected zapped, Smi or null", kFixedLengthEncoding);
@@ -3101,8 +3075,12 @@
   if (object != RDX) {
     movq(RDX, object);
   }
+  pushq(CODE_REG);
+  movq(CODE_REG, Address(THR, Thread::update_store_buffer_code_offset()));
   movq(TMP, Address(THR, Thread::update_store_buffer_entry_point_offset()));
   call(TMP);
+
+  popq(CODE_REG);
   if (value != RDX) popq(RDX);
   Bind(&done);
 }
@@ -3305,8 +3283,8 @@
     // Store XMM registers with the lowest register number at the lowest
     // address.
     intptr_t offset = 0;
-    for (intptr_t reg_idx = 0; reg_idx < kNumberOfXmmRegisters; ++reg_idx) {
-      XmmRegister xmm_reg = static_cast<XmmRegister>(reg_idx);
+    for (intptr_t i = 0; i < kNumberOfXmmRegisters; ++i) {
+      XmmRegister xmm_reg = static_cast<XmmRegister>(i);
       if (RegisterSet::Contains(xmm_register_set, xmm_reg)) {
         movups(Address(RSP, offset), xmm_reg);
         offset += kFpuRegisterSize;
@@ -3315,11 +3293,10 @@
     ASSERT(offset == (xmm_regs_count * kFpuRegisterSize));
   }
 
-  // Store general purpose registers with the highest register number at the
-  // lowest address. The order in which the registers are pushed must match the
-  // order in which the registers are encoded in the safe point's stack map.
-  for (intptr_t reg_idx = 0; reg_idx < kNumberOfCpuRegisters; ++reg_idx) {
-    Register reg = static_cast<Register>(reg_idx);
+  // The order in which the registers are pushed must match the order
+  // in which the registers are encoded in the safe point's stack map.
+  for (intptr_t i = kNumberOfCpuRegisters - 1; i >= 0; --i) {
+    Register reg = static_cast<Register>(i);
     if (RegisterSet::Contains(cpu_register_set, reg)) {
       pushq(reg);
     }
@@ -3329,10 +3306,8 @@
 
 void Assembler::PopRegisters(intptr_t cpu_register_set,
                              intptr_t xmm_register_set) {
-  // General purpose registers have the highest register number at the
-  // lowest address.
-  for (intptr_t reg_idx = kNumberOfCpuRegisters - 1; reg_idx >= 0; --reg_idx) {
-    Register reg = static_cast<Register>(reg_idx);
+  for (intptr_t i = 0; i < kNumberOfCpuRegisters; ++i) {
+    Register reg = static_cast<Register>(i);
     if (RegisterSet::Contains(cpu_register_set, reg)) {
       popq(reg);
     }
@@ -3342,8 +3317,8 @@
   if (xmm_regs_count > 0) {
     // XMM registers have the lowest register number at the lowest address.
     intptr_t offset = 0;
-    for (intptr_t reg_idx = 0; reg_idx < kNumberOfXmmRegisters; ++reg_idx) {
-      XmmRegister xmm_reg = static_cast<XmmRegister>(reg_idx);
+    for (intptr_t i = 0; i < kNumberOfXmmRegisters; ++i) {
+      XmmRegister xmm_reg = static_cast<XmmRegister>(i);
       if (RegisterSet::Contains(xmm_register_set, xmm_reg)) {
         movups(xmm_reg, Address(RSP, offset));
         offset += kFpuRegisterSize;
@@ -3356,7 +3331,7 @@
 
 
 void Assembler::EnterCallRuntimeFrame(intptr_t frame_space) {
-  EnterFrame(0);
+  EnterStubFrame();
 
   // TODO(vegorov): avoid saving FpuTMP, it is used only as scratch.
   PushRegisters(CallingConventions::kVolatileCpuRegisters,
@@ -3376,23 +3351,15 @@
       RegisterSet::RegisterCount(CallingConventions::kVolatileXmmRegisters);
   const intptr_t kPushedRegistersSize =
       kPushedCpuRegistersCount * kWordSize +
-      kPushedXmmRegistersCount * kFpuRegisterSize;
+      kPushedXmmRegistersCount * kFpuRegisterSize +
+      2 * kWordSize;  // PP, pc marker from EnterStubFrame
   leaq(RSP, Address(RBP, -kPushedRegistersSize));
 
   // TODO(vegorov): avoid saving FpuTMP, it is used only as scratch.
   PopRegisters(CallingConventions::kVolatileCpuRegisters,
                CallingConventions::kVolatileXmmRegisters);
 
-  leave();
-}
-
-
-void Assembler::CallCFunction(const ExternalLabel* label) {
-  // Reserve shadow space for outgoing arguments.
-  if (CallingConventions::kShadowSpaceBytes != 0) {
-    subq(RSP, Immediate(CallingConventions::kShadowSpaceBytes));
-  }
-  call(label);
+  LeaveStubFrame();
 }
 
 
@@ -3411,27 +3378,29 @@
 }
 
 
+void Assembler::RestoreCodePointer() {
+  movq(CODE_REG, Address(RBP, kPcMarkerSlotFromFp * kWordSize));
+}
+
+
 void Assembler::LoadPoolPointer(Register pp) {
   // Load new pool pointer.
-  const intptr_t kRIPRelativeMovqSize = 7;
-  const intptr_t entry_to_rip_offset = CodeSize() + kRIPRelativeMovqSize;
-  const intptr_t object_pool_pc_dist =
-      Instructions::HeaderSize() - Instructions::object_pool_offset();
-  movq(pp, Address::AddressRIPRelative(
-      -entry_to_rip_offset - object_pool_pc_dist));
-  ASSERT(CodeSize() == entry_to_rip_offset);
+  CheckCodePointer();
+  movq(pp, FieldAddress(CODE_REG, Code::object_pool_offset()));
   set_constant_pool_allowed(pp == PP);
 }
 
 
-void Assembler::EnterDartFrameWithInfo(intptr_t frame_size,
-                                       Register new_pp,
-                                       Register pc_marker_override) {
+void Assembler::EnterDartFrame(intptr_t frame_size, Register new_pp) {
   ASSERT(!constant_pool_allowed());
   EnterFrame(0);
-  pushq(pc_marker_override);
+  pushq(CODE_REG);
   pushq(PP);
-  movq(PP, new_pp);
+  if (new_pp == kNoRegister) {
+    LoadPoolPointer(PP);
+  } else {
+    movq(PP, new_pp);
+  }
   set_constant_pool_allowed(true);
   if (frame_size != 0) {
     subq(RSP, Immediate(frame_size));
@@ -3439,33 +3408,57 @@
 }
 
 
-void Assembler::LeaveDartFrame() {
-  // LeaveDartFrame is called from stubs (pp disallowed) and from Dart code (pp
-  // allowed), so there is no point in checking the current value of
-  // constant_pool_allowed().
-  set_constant_pool_allowed(false);
+void Assembler::LeaveDartFrame(RestorePP restore_pp) {
   // Restore caller's PP register that was pushed in EnterDartFrame.
-  movq(PP, Address(RBP, (kSavedCallerPpSlotFromFp * kWordSize)));
+  if (restore_pp == kRestoreCallerPP) {
+    movq(PP, Address(RBP, (kSavedCallerPpSlotFromFp * kWordSize)));
+    set_constant_pool_allowed(false);
+  }
   LeaveFrame();
 }
 
 
+void Assembler::CheckCodePointer() {
+#ifdef DEBUG
+  Label cid_ok, instructions_ok;
+  pushq(RAX);
+  LoadClassId(RAX, CODE_REG);
+  cmpq(RAX, Immediate(kCodeCid));
+  j(EQUAL, &cid_ok);
+  int3();
+  Bind(&cid_ok);
+  {
+    const intptr_t kRIPRelativeLeaqSize = 7;
+    const intptr_t header_to_entry_offset =
+        (Instructions::HeaderSize() - kHeapObjectTag);
+    const intptr_t header_to_rip_offset =
+        CodeSize() + kRIPRelativeLeaqSize + header_to_entry_offset;
+    leaq(RAX, Address::AddressRIPRelative(-header_to_rip_offset));
+    ASSERT(CodeSize() == (header_to_rip_offset - header_to_entry_offset));
+  }
+  cmpq(RAX, FieldAddress(CODE_REG, Code::saved_instructions_offset()));
+  j(EQUAL, &instructions_ok);
+  int3();
+  Bind(&instructions_ok);
+  popq(RAX);
+#endif
+}
+
+
 // On entry to a function compiled for OSR, the caller's frame pointer, the
 // stack locals, and any copied parameters are already in place.  The frame
 // pointer is already set up.  The PC marker is not correct for the
 // optimized function and there may be extra space for spill slots to
 // allocate.
-void Assembler::EnterOsrFrame(intptr_t extra_size,
-                              Register new_pp,
-                              Register pc_marker_override) {
+void Assembler::EnterOsrFrame(intptr_t extra_size) {
   ASSERT(!constant_pool_allowed());
   if (prologue_offset_ == -1) {
     Comment("PrologueOffset = %" Pd "", CodeSize());
     prologue_offset_ = CodeSize();
   }
-  movq(Address(RBP, kPcMarkerSlotFromFp * kWordSize), pc_marker_override);
-  movq(PP, new_pp);
-  set_constant_pool_allowed(true);
+  RestoreCodePointer();
+  LoadPoolPointer();
+
   if (extra_size != 0) {
     subq(RSP, Immediate(extra_size));
   }
@@ -3473,19 +3466,12 @@
 
 
 void Assembler::EnterStubFrame() {
-  set_constant_pool_allowed(false);
-  EnterFrame(0);
-  pushq(Immediate(0));  // Push 0 in the saved PC area for stub frames.
-  pushq(PP);  // Save caller's pool pointer
-  LoadPoolPointer();
+  EnterDartFrame(0, kNoRegister);
 }
 
 
 void Assembler::LeaveStubFrame() {
-  set_constant_pool_allowed(false);
-  // Restore caller's PP register that was pushed in EnterStubFrame.
-  movq(PP, Address(RBP, (kSavedCallerPpSlotFromFp * kWordSize)));
-  LeaveFrame();
+  LeaveDartFrame();
 }
 
 
@@ -3497,6 +3483,7 @@
   intptr_t state_offset = ClassTable::StateOffsetFor(cid);
   Register temp_reg = TMP;
   if (inline_isolate) {
+    ASSERT(FLAG_allow_absolute_addresses);
     ClassTable* class_table = Isolate::Current()->class_table();
     ClassHeapStats** table_ptr = class_table->TableAddressFor(cid);
     if (cid < kNumPredefinedCids) {
@@ -3527,6 +3514,7 @@
       ClassTable::CounterOffsetFor(cid, space == Heap::kNew);
   Register temp_reg = TMP;
   if (inline_isolate) {
+    ASSERT(FLAG_allow_absolute_addresses);
     ClassTable* class_table = Isolate::Current()->class_table();
     ClassHeapStats** table_ptr = class_table->TableAddressFor(cid);
     if (cid < kNumPredefinedCids) {
diff --git a/runtime/vm/assembler_x64.h b/runtime/vm/assembler_x64.h
index edc7bc2..0a6b694 100644
--- a/runtime/vm/assembler_x64.h
+++ b/runtime/vm/assembler_x64.h
@@ -366,7 +366,7 @@
   void call(Label* label);
   void call(const ExternalLabel* label);
 
-  static const intptr_t kCallExternalLabelSize = 7;
+  static const intptr_t kCallExternalLabelSize = 15;
 
   void pushq(Register reg);
   void pushq(const Address& address);
@@ -684,9 +684,12 @@
   void int3();
   void hlt();
 
+  static uword GetBreakInstructionFiller() {
+    return 0xCCCCCCCCCCCCCCCC;
+  }
+
   // Note: verified_mem mode forces far jumps.
   void j(Condition condition, Label* label, bool near = kFarJump);
-  void j(Condition condition, const ExternalLabel* label);
 
   void jmp(Register reg);
   void jmp(const Address& address);
@@ -761,21 +764,16 @@
   void LoadIsolate(Register dst);
   void LoadObject(Register dst, const Object& obj);
   void LoadUniqueObject(Register dst, const Object& obj);
-  void LoadExternalLabel(Register dst,
-                         const ExternalLabel* label,
-                         Patchability patchable);
+  void LoadNativeEntry(Register dst,
+                       const ExternalLabel* label,
+                       Patchability patchable);
   void LoadFunctionFromCalleePool(Register dst,
                                   const Function& function,
                                   Register new_pp);
-  void JmpPatchable(const ExternalLabel* label, Register pp);
   void JmpPatchable(const StubEntry& stub_entry, Register pp);
-  void Jmp(const ExternalLabel* label, Register pp);
-  void Jmp(const StubEntry& stub_entry, Register pp);
-  void J(Condition condition, const ExternalLabel* label, Register pp);
+  void Jmp(const StubEntry& stub_entry, Register pp = PP);
   void J(Condition condition, const StubEntry& stub_entry, Register pp);
-  void CallPatchable(const ExternalLabel* label);
   void CallPatchable(const StubEntry& stub_entry);
-  void Call(const ExternalLabel* label);
   void Call(const StubEntry& stub_entry);
   // Unaware of write barrier (use StoreInto* methods for storing to objects).
   // TODO(koda): Add StackAddress/HeapAddress types to prevent misuse.
@@ -835,6 +833,8 @@
   void PushRegisters(intptr_t cpu_register_set, intptr_t xmm_register_set);
   void PopRegisters(intptr_t cpu_register_set, intptr_t xmm_register_set);
 
+  void CheckCodePointer();
+
   void EnterFrame(intptr_t frame_space);
   void LeaveFrame();
   void ReserveAlignedFrameSpace(intptr_t frame_space);
@@ -849,7 +849,6 @@
 
   // Call runtime function. Reserves shadow space on the stack before calling
   // if platform ABI requires that. Does not restore RSP after the call itself.
-  void CallCFunction(const ExternalLabel* label);
   void CallCFunction(Register reg);
 
   /*
@@ -926,6 +925,7 @@
     buffer_.FinalizeInstructions(region);
   }
 
+  void RestoreCodePointer();
   void LoadPoolPointer(Register pp = PP);
 
   // Set up a Dart frame on entry with a frame pointer and PC information to
@@ -947,15 +947,13 @@
   //   ...
   //   pushq r15
   //   .....
-  void EnterDartFrameWithInfo(intptr_t frame_size,
-                              Register new_pp, Register pc_marker_override);
-  void LeaveDartFrame();
+  void EnterDartFrame(intptr_t frame_size, Register new_pp);
+  void LeaveDartFrame(RestorePP restore_pp = kRestoreCallerPP);
 
   // Set up a Dart frame for a function compiled for on-stack replacement.
   // The frame layout is a normal Dart frame, but the frame is partially set
   // up on entry (it is the frame of the unoptimized code).
-  void EnterOsrFrame(intptr_t extra_size,
-                     Register new_pp, Register pc_marker_override);
+  void EnterOsrFrame(intptr_t extra_size);
 
   // Set up a stub frame so that the stack traversal code can easily identify
   // a stub frame.
@@ -973,19 +971,6 @@
   void EnterStubFrame();
   void LeaveStubFrame();
 
-  // Instruction pattern from entrypoint is used in dart frame prologues
-  // to set up the frame and save a PC which can be used to figure out the
-  // RawInstruction object corresponding to the code running in the frame.
-  // entrypoint:
-  //   pushq rbp          (size is 1 byte)
-  //   movq rbp, rsp      (size is 3 bytes)
-  //   call L             (size is 5 bytes)
-  //   L:
-  static const intptr_t kEntryPointToPcMarkerOffset = 0;
-  static intptr_t EntryPointToPcMarkerOffset() {
-    return kEntryPointToPcMarkerOffset;
-  }
-
   void UpdateAllocationStats(intptr_t cid,
                              Heap::Space space,
                              bool inline_isolate = true);
@@ -1047,6 +1032,10 @@
                                            Register array,
                                            Register index);
 
+  static Address VMTagAddress() {
+    return Address(THR, Thread::vm_tag_offset());
+  }
+
   // On some other platforms, we draw a distinction between safe and unsafe
   // smis.
   static bool IsSafe(const Object& object) { return true; }
diff --git a/runtime/vm/assembler_x64_test.cc b/runtime/vm/assembler_x64_test.cc
index cd99603..e404b89 100644
--- a/runtime/vm/assembler_x64_test.cc
+++ b/runtime/vm/assembler_x64_test.cc
@@ -2020,25 +2020,40 @@
 }
 
 
+static void EnterTestFrame(Assembler* assembler) {
+  __ EnterFrame(0);
+  __ pushq(CODE_REG);
+  __ pushq(PP);
+  __ movq(CODE_REG, Address(CallingConventions::kArg1Reg,
+                            VMHandles::kOffsetOfRawPtrInHandle));
+  __ LoadPoolPointer(PP);
+}
+
+
+static void LeaveTestFrame(Assembler* assembler) {
+  __ popq(PP);
+  __ popq(CODE_REG);
+  __ LeaveFrame();
+}
+
+
 ASSEMBLER_TEST_GENERATE(PackedDoubleNegate, assembler) {
   static const struct ALIGN16 {
     double a;
     double b;
   } constant0 = { 1.0, 2.0 };
-  __ pushq(PP);  // Save caller's pool pointer and load a new one here.
-  __ LoadPoolPointer();
+  EnterTestFrame(assembler);
   __ movq(RAX, Immediate(reinterpret_cast<uword>(&constant0)));
   __ movups(XMM10, Address(RAX, 0));
   __ negatepd(XMM10);
   __ movaps(XMM0, XMM10);
-  __ popq(PP);  // Restore caller's pool pointer.
+  LeaveTestFrame(assembler);
   __ ret();
 }
 
 
 ASSEMBLER_TEST_RUN(PackedDoubleNegate, test) {
-  typedef double (*PackedDoubleNegate)();
-  double res = reinterpret_cast<PackedDoubleNegate>(test->entry())();
+  double res = test->InvokeWithCode<double>();
   EXPECT_FLOAT_EQ(-1.0, res, 0.000001f);
 }
 
@@ -2048,20 +2063,18 @@
     double a;
     double b;
   } constant0 = { -1.0, 2.0 };
-  __ pushq(PP);  // Save caller's pool pointer and load a new one here.
-  __ LoadPoolPointer();
+  EnterTestFrame(assembler);
   __ movq(RAX, Immediate(reinterpret_cast<uword>(&constant0)));
   __ movups(XMM10, Address(RAX, 0));
   __ abspd(XMM10);
   __ movaps(XMM0, XMM10);
-  __ popq(PP);  // Restore caller's pool pointer.
+  LeaveTestFrame(assembler);
   __ ret();
 }
 
 
 ASSEMBLER_TEST_RUN(PackedDoubleAbsolute, test) {
-  typedef double (*PackedDoubleAbsolute)();
-  double res = reinterpret_cast<PackedDoubleAbsolute>(test->entry())();
+  double res = test->InvokeWithCode<double>();
   EXPECT_FLOAT_EQ(1.0, res, 0.000001f);
 }
 
@@ -2495,59 +2508,53 @@
 
 
 ASSEMBLER_TEST_GENERATE(PackedNegate, assembler) {
-  __ pushq(PP);  // Save caller's pool pointer and load a new one here.
-  __ LoadPoolPointer();
+  EnterTestFrame(assembler);
   __ movl(RAX, Immediate(bit_cast<int32_t, float>(12.3f)));
   __ movd(XMM0, RAX);
   __ shufps(XMM0, XMM0, Immediate(0x0));
   __ negateps(XMM0);
   __ shufps(XMM0, XMM0, Immediate(0xAA));  // Copy third lane into all 4 lanes.
-  __ popq(PP);  // Restore caller's pool pointer.
+  LeaveTestFrame(assembler);
   __ ret();
 }
 
 
 ASSEMBLER_TEST_RUN(PackedNegate, test) {
-  typedef float (*PackedNegateCode)();
-  float res = reinterpret_cast<PackedNegateCode>(test->entry())();
+  float res = test->InvokeWithCode<float>();
   EXPECT_FLOAT_EQ(-12.3f, res, 0.001f);
 }
 
 
 ASSEMBLER_TEST_GENERATE(PackedAbsolute, assembler) {
-  __ pushq(PP);  // Save caller's pool pointer and load a new one here.
-  __ LoadPoolPointer();
+  EnterTestFrame(assembler);
   __ movl(RAX, Immediate(bit_cast<int32_t, float>(-15.3f)));
   __ movd(XMM0, RAX);
   __ shufps(XMM0, XMM0, Immediate(0x0));
   __ absps(XMM0);
   __ shufps(XMM0, XMM0, Immediate(0xAA));  // Copy third lane into all 4 lanes.
-  __ popq(PP);  // Restore caller's pool pointer.
+  LeaveTestFrame(assembler);
   __ ret();
 }
 
 
 ASSEMBLER_TEST_RUN(PackedAbsolute, test) {
-  typedef float (*PackedAbsoluteCode)();
-  float res = reinterpret_cast<PackedAbsoluteCode>(test->entry())();
+  float res = test->InvokeWithCode<float>();
   EXPECT_FLOAT_EQ(15.3f, res, 0.001f);
 }
 
 
 ASSEMBLER_TEST_GENERATE(PackedSetWZero, assembler) {
-  __ pushq(PP);  // Save caller's pool pointer and load a new one here.
-  __ LoadPoolPointer();
+  EnterTestFrame(assembler);
   __ set1ps(XMM0, RAX, Immediate(bit_cast<int32_t, float>(12.3f)));
   __ zerowps(XMM0);
   __ shufps(XMM0, XMM0, Immediate(0xFF));  // Copy the W lane which is now 0.0.
-  __ popq(PP);  // Restore caller's pool pointer.
+  LeaveTestFrame(assembler);
   __ ret();
 }
 
 
 ASSEMBLER_TEST_RUN(PackedSetWZero, test) {
-  typedef float (*PackedSetWZeroCode)();
-  float res = reinterpret_cast<PackedSetWZeroCode>(test->entry())();
+  float res = test->InvokeWithCode<float>();
   EXPECT_FLOAT_EQ(0.0f, res, 0.001f);
 }
 
@@ -2657,8 +2664,7 @@
     uint32_t d;
   } constant1 =
       { 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF };
-  __ pushq(PP);  // Save caller's pool pointer and load a new one here.
-  __ LoadPoolPointer();
+  EnterTestFrame(assembler);
   __ LoadImmediate(RAX, Immediate(reinterpret_cast<intptr_t>(&constant1)));
   __ movups(XMM9, Address(RAX, 0));
   __ notps(XMM9);
@@ -2666,14 +2672,13 @@
   __ pushq(RAX);
   __ movss(Address(RSP, 0), XMM0);
   __ popq(RAX);
-  __ popq(PP);  // Restore caller's pool pointer.
+  LeaveTestFrame(assembler);
   __ ret();
 }
 
 
 ASSEMBLER_TEST_RUN(PackedLogicalNot, test) {
-  typedef uint32_t (*PackedLogicalNotCode)();
-  uint32_t res = reinterpret_cast<PackedLogicalNotCode>(test->entry())();
+  uint32_t res = test->InvokeWithCode<uint32_t>();
   EXPECT_EQ(static_cast<uword>(0x0), res);
 }
 
@@ -3065,9 +3070,7 @@
   ObjectStore* object_store = Isolate::Current()->object_store();
   const Object& obj = Object::ZoneHandle(object_store->smi_class());
   Label fail;
-  __ EnterFrame(0);
-  __ pushq(PP);  // Save caller's pool pointer and load a new one here.
-  __ LoadPoolPointer();
+  EnterTestFrame(assembler);
   __ LoadObject(RAX, obj);
   __ CompareObject(RAX, obj);
   __ j(NOT_EQUAL, &fail);
@@ -3094,15 +3097,13 @@
   __ ret();
   __ Bind(&fail);
   __ movl(RAX, Immediate(0));  // Fail.
-  __ popq(PP);  // Restore caller's pool pointer.
-  __ LeaveFrame();
+  LeaveTestFrame(assembler);
   __ ret();
 }
 
 
 ASSEMBLER_TEST_RUN(TestObjectCompare, test) {
-  typedef bool (*TestObjectCompare)();
-  bool res = reinterpret_cast<TestObjectCompare>(test->entry())();
+  bool res = test->InvokeWithCode<bool>();
   EXPECT_EQ(true, res);
 }
 
@@ -3306,19 +3307,15 @@
 
 // Called from assembler_test.cc.
 ASSEMBLER_TEST_GENERATE(StoreIntoObject, assembler) {
-  __ pushq(PP);  // Save caller's pool pointer and load a new one here.
-  __ LoadPoolPointer();
+  __ pushq(CODE_REG);
   __ pushq(THR);
-  __ movq(THR, CallingConventions::kArg4Reg);
-  __ pushq(CTX);
-  __ movq(CTX, CallingConventions::kArg1Reg);
-  __ StoreIntoObject(CallingConventions::kArg3Reg,
-                     FieldAddress(CallingConventions::kArg3Reg,
+  __ movq(THR, CallingConventions::kArg3Reg);
+  __ StoreIntoObject(CallingConventions::kArg2Reg,
+                     FieldAddress(CallingConventions::kArg2Reg,
                                   GrowableObjectArray::data_offset()),
-                     CallingConventions::kArg2Reg);
-  __ popq(CTX);
+                     CallingConventions::kArg1Reg);
   __ popq(THR);
-  __ popq(PP);  // Restore caller's pool pointer.
+  __ popq(CODE_REG);
   __ ret();
 }
 
@@ -3432,21 +3429,25 @@
 
 
 ASSEMBLER_TEST_GENERATE(DoubleAbs, assembler) {
-  __ pushq(PP);  // Save caller's pool pointer and load a new one here.
-  __ LoadPoolPointer();
+  EnterTestFrame(assembler);
+#if defined(TARGET_OS_WINDOWS)
+  // First argument is code object, MSVC passes second argument in XMM1.
+  __ DoubleAbs(XMM1);
+  __ movaps(XMM0, XMM1);
+#else
   __ DoubleAbs(XMM0);
-  __ popq(PP);  // Restore caller's pool pointer.
+#endif
+  LeaveTestFrame(assembler);
   __ ret();
 }
 
 
 ASSEMBLER_TEST_RUN(DoubleAbs, test) {
-  typedef double (*DoubleAbsCode)(double d);
   double val = -12.45;
-  double res =  reinterpret_cast<DoubleAbsCode>(test->entry())(val);
+  double res =  test->InvokeWithCode<double, double>(val);
   EXPECT_FLOAT_EQ(-val, res, 0.001);
   val = 12.45;
-  res =  reinterpret_cast<DoubleAbsCode>(test->entry())(val);
+  res = test->InvokeWithCode<double, double>(val);
   EXPECT_FLOAT_EQ(val, res, 0.001);
 }
 
diff --git a/runtime/vm/ast.cc b/runtime/vm/ast.cc
index 26618b5..48bd053 100644
--- a/runtime/vm/ast.cc
+++ b/runtime/vm/ast.cc
@@ -572,9 +572,11 @@
   if (is_super_getter()) {
     ASSERT(receiver() != NULL);
     const String& setter_name =
-        String::ZoneHandle(zone, Field::SetterSymbol(field_name_));
-    Function& setter = Function::ZoneHandle(zone,
-        Resolver::ResolveDynamicAnyArgs(cls(), setter_name));
+        String::ZoneHandle(zone, Field::LookupSetterSymbol(field_name_));
+    Function& setter = Function::ZoneHandle(zone);
+    if (!setter_name.IsNull()) {
+      setter = Resolver::ResolveDynamicAnyArgs(cls(), setter_name);
+    }
     if (setter.IsNull() || setter.is_abstract()) {
       // No instance setter found in super class chain,
       // noSuchMethod will be called at runtime.
@@ -618,15 +620,17 @@
     }
 
     // No field found in prefix. Look for a setter function.
-    const String& setter_name = String::Handle(zone,
-                                               Field::SetterName(field_name_));
-    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);
+    const String& setter_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);
+      }
     }
 
     // No writeable field and no setter found in the prefix. Return a
@@ -651,14 +655,17 @@
     }
 
     // No field found in library. Look for a setter function.
-    const String& setter_name = String::Handle(zone,
-                                               Field::SetterName(field_name_));
-    obj = library.ResolveName(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);
+    const String& setter_name =
+        String::Handle(zone, Field::LookupSetterSymbol(field_name_));
+    if (!setter_name.IsNull()) {
+      obj = library.ResolveName(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);
+      }
     }
 
     // No writeable field and no setter found in the library. Return a
@@ -685,8 +692,9 @@
       return new StaticSetterNode(token_pos(), NULL, cls(), field_name_, rhs);
     }
 #if defined(DEBUG)
-    const String& getter_name = String::Handle(zone,
-                                               Field::GetterName(field_name_));
+    const String& getter_name =
+        String::Handle(zone, Field::LookupGetterSymbol(field_name_));
+    ASSERT(!getter_name.IsNull());
     const Function& getter =
         Function::Handle(zone, cls().LookupStaticFunction(getter_name));
     ASSERT(!getter.IsNull() &&
@@ -741,7 +749,10 @@
     return NULL;
   }
   const String& getter_name =
-      String::Handle(Field::GetterName(this->field_name()));
+      String::Handle(Field::LookupGetterSymbol(this->field_name()));
+  if (getter_name.IsNull()) {
+    return NULL;
+  }
   const Function& getter_func =
       Function::Handle(this->cls().LookupStaticFunction(getter_name));
   if (getter_func.IsNull() || !getter_func.is_const()) {
diff --git a/runtime/vm/ast.h b/runtime/vm/ast.h
index 79283b3..c3b6ac1 100644
--- a/runtime/vm/ast.h
+++ b/runtime/vm/ast.h
@@ -165,13 +165,15 @@
             LocalVariable* saved_try_ctx,
             LocalVariable* async_saved_try_ctx,
             LocalVariable* outer_saved_try_ctx,
-            LocalVariable* outer_async_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) { }
+      outer_async_saved_try_ctx_(outer_async_saved_try_ctx),
+      scope_(scope) { }
 
   void VisitChildren(AstNodeVisitor* visitor) const {
     expr_->Visit(visitor);
@@ -184,6 +186,7 @@
   LocalVariable* outer_async_saved_try_ctx() const {
     return outer_async_saved_try_ctx_;
   }
+  LocalScope* scope() const { return scope_; }
 
   DECLARE_COMMON_NODE_FUNCTIONS(AwaitNode);
 
@@ -193,6 +196,7 @@
   LocalVariable* async_saved_try_ctx_;
   LocalVariable* outer_saved_try_ctx_;
   LocalVariable* outer_async_saved_try_ctx_;
+  LocalScope* scope_;
 
   DISALLOW_COPY_AND_ASSIGN(AwaitNode);
 };
@@ -209,17 +213,25 @@
 //   <AwaitMarker> -> ...
 class AwaitMarkerNode : public AstNode {
  public:
-  AwaitMarkerNode() : AstNode(Scanner::kNoSourcePos) { }
+  AwaitMarkerNode(LocalScope* async_scope, LocalScope* await_scope)
+    : AstNode(Scanner::kNoSourcePos),
+      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 { }
 
-  LocalScope* scope() const { return scope_; }
-  void set_scope(LocalScope* scope) { scope_ = scope; }
+  LocalScope* async_scope() const { return async_scope_; }
+  LocalScope* await_scope() const { return await_scope_; }
 
   DECLARE_COMMON_NODE_FUNCTIONS(AwaitMarkerNode);
 
  private:
-  LocalScope* scope_;
+  LocalScope* async_scope_;
+  LocalScope* await_scope_;
 
   DISALLOW_COPY_AND_ASSIGN(AwaitMarkerNode);
 };
@@ -1214,7 +1226,6 @@
 };
 
 
-
 class LoadInstanceFieldNode : public AstNode {
  public:
   LoadInstanceFieldNode(intptr_t token_pos,
@@ -1299,7 +1310,7 @@
   virtual const Instance* EvalConstExpr() const {
     ASSERT(field_.is_static());
     return !is_deferred_reference_ && field_.is_const()
-        ? &Instance::ZoneHandle(field_.value())
+        ? &Instance::ZoneHandle(field_.StaticValue())
         : NULL;
   }
 
@@ -1805,13 +1816,15 @@
                  const String& native_c_function_name,
                  NativeFunction native_c_function,
                  LocalScope* scope,
-                 bool is_bootstrap_native)
+                 bool is_bootstrap_native,
+                 bool link_lazily = false)
       : AstNode(token_pos),
         function_(function),
         native_c_function_name_(native_c_function_name),
         native_c_function_(native_c_function),
         scope_(scope),
-        is_bootstrap_native_(is_bootstrap_native) {
+        is_bootstrap_native_(is_bootstrap_native),
+        link_lazily_(link_lazily) {
     ASSERT(function_.IsZoneHandle());
     ASSERT(native_c_function_ != NULL);
     ASSERT(native_c_function_name_.IsZoneHandle());
@@ -1826,6 +1839,8 @@
   LocalScope* scope() const { return scope_; }
   bool is_bootstrap_native() const { return is_bootstrap_native_; }
 
+  bool link_lazily() const { return link_lazily_; }
+
   virtual void VisitChildren(AstNodeVisitor* visitor) const { }
 
   DECLARE_COMMON_NODE_FUNCTIONS(NativeBodyNode);
@@ -1836,6 +1851,7 @@
   NativeFunction native_c_function_;  // Actual non-Dart implementation.
   LocalScope* scope_;
   const bool is_bootstrap_native_;  // Is a bootstrap native method.
+  const bool link_lazily_;
 
   DISALLOW_IMPLICIT_CONSTRUCTORS(NativeBodyNode);
 };
diff --git a/runtime/vm/ast_printer.cc b/runtime/vm/ast_printer.cc
index 8197dd9..7cc69d4 100644
--- a/runtime/vm/ast_printer.cc
+++ b/runtime/vm/ast_printer.cc
@@ -19,38 +19,38 @@
 
 
 void AstPrinter::VisitGenericAstNode(AstNode* node) {
-  ISL_Print("(%s ", node->PrettyName());
+  THR_Print("(%s ", node->PrettyName());
   node->VisitChildren(this);
-  ISL_Print(")");
+  THR_Print(")");
 }
 
 
 void AstPrinter::VisitSequenceNode(SequenceNode* node) {
   indent_++;
   LocalScope* scope = node->scope();
-  ISL_Print("(%s (scope \"%p\"", node->PrettyName(), scope);
+  THR_Print("(%s (scope \"%p\"", node->PrettyName(), scope);
   if (scope != NULL) {
-    ISL_Print(" (%" Pd "-%" Pd ") loop %d",
+    THR_Print(" (%" Pd "-%" Pd ") loop %d",
               scope->begin_token_pos(),
               scope->end_token_pos(),
               scope->loop_level());
     if (scope->HasContextLevel()) {
-      ISL_Print(" context %d captures %d",
+      THR_Print(" context %d captures %d",
                 scope->context_level(),
                 scope->num_context_variables());
     } else {
       ASSERT(scope->num_context_variables() == 0);
     }
   }
-  ISL_Print(")");
+  THR_Print(")");
   for (int i = 0; i < node->length(); ++i) {
-    ISL_Print("\n");
+    THR_Print("\n");
     for (intptr_t p = 0; p < indent_; p++) {
-      ISL_Print("  ");
+      THR_Print("  ");
     }
     node->NodeAt(i)->Visit(this);
   }
-  ISL_Print(")");
+  THR_Print(")");
   indent_--;
 }
 
@@ -81,29 +81,29 @@
       kind = "";
       UNREACHABLE();
   }
-  ISL_Print("(%s %s", node->PrettyName(), kind);
+  THR_Print("(%s %s", node->PrettyName(), kind);
   node->VisitChildren(this);
-  ISL_Print(")");
+  THR_Print(")");
 }
 
 
 void AstPrinter::VisitGenericLocalNode(AstNode* node,
                                        const LocalVariable& var) {
-  ISL_Print("(%s %s%s \"%s\"",
+  THR_Print("(%s %s%s \"%s\"",
             node->PrettyName(),
             var.is_final() ? "final " : "",
             String::Handle(var.type().Name()).ToCString(),
             var.name().ToCString());
   if (var.HasIndex()) {
     if (var.is_captured()) {
-      ISL_Print(" (context %d %d)", var.owner()->context_level(), var.index());
+      THR_Print(" (context %d %d)", var.owner()->context_level(), var.index());
     } else {
-      ISL_Print(" (stack %d)", var.index());
+      THR_Print(" (stack %d)", var.index());
     }
   }
-  ISL_Print(" ");
+  THR_Print(" ");
   node->VisitChildren(this);
-  ISL_Print(")");
+  THR_Print(")");
 }
 
 
@@ -118,14 +118,14 @@
 
 
 void AstPrinter::VisitGenericFieldNode(AstNode* node, const Field& field) {
-  ISL_Print("(%s %s%s \"%s\" ",
+  THR_Print("(%s %s%s \"%s\" ",
             node->PrettyName(),
             field.is_final() ? "final " : "",
             String::Handle(AbstractType::Handle(field.type()).Name()).
                 ToCString(),
             String::Handle(field.name()).ToCString());
   node->VisitChildren(this);
-  ISL_Print(")");
+  THR_Print(")");
 }
 
 
@@ -166,13 +166,13 @@
 
 void AstPrinter::VisitLiteralNode(LiteralNode* node) {
   const Instance& literal = node->literal();
-  ISL_Print("(%s \"%s\")", node->PrettyName(), literal.ToCString());
+  THR_Print("(%s \"%s\")", node->PrettyName(), literal.ToCString());
 }
 
 
 void AstPrinter::VisitTypeNode(TypeNode* node) {
   const AbstractType& type = node->type();
-  ISL_Print("(%s \"%s\")",
+  THR_Print("(%s \"%s\")",
             node->PrettyName(),
             String::Handle(type.Name()).ToCString());
 }
@@ -181,58 +181,63 @@
 void AstPrinter::VisitAssignableNode(AssignableNode* node) {
   const AbstractType& type = node->type();
   const String& dst_name = node->dst_name();
-  ISL_Print("(%s (type \"%s\") (of \"%s\") ",
+  THR_Print("(%s (type \"%s\") (of \"%s\") ",
             node->PrettyName(),
             String::Handle(type.Name()).ToCString(),
             dst_name.ToCString());
   node->VisitChildren(this);
-  ISL_Print(")");
+  THR_Print(")");
 }
 
 
 void AstPrinter::VisitAwaitNode(AwaitNode* node) {
-  VisitGenericAstNode(node);
+  THR_Print("(*****%s***** (scope \"%p\") ", node->PrettyName(), node->scope());
+  node->VisitChildren(this);
+  THR_Print(")");
 }
 
 
 void AstPrinter::VisitAwaitMarkerNode(AwaitMarkerNode* node) {
-  VisitGenericAstNode(node);
+  THR_Print("(%s (async_scope \"%p\" await_scope \"%p\"))",
+            node->PrettyName(),
+            node->async_scope(),
+            node->await_scope());
 }
 
 
 void AstPrinter::VisitPrimaryNode(PrimaryNode* node) {
-  ISL_Print("*****%s***** \"%s\")",
+  THR_Print("(*****%s***** \"%s\")",
             node->PrettyName(),
             node->primary().ToCString());
 }
 
 
 void AstPrinter::VisitComparisonNode(ComparisonNode* node) {
-  ISL_Print("(%s %s ", node->PrettyName(), node->TokenName());
+  THR_Print("(%s %s ", node->PrettyName(), node->TokenName());
   node->VisitChildren(this);
-  ISL_Print(")");
+  THR_Print(")");
 }
 
 
 void AstPrinter::VisitBinaryOpNode(BinaryOpNode* node) {
-  ISL_Print("(%s %s ", node->PrettyName(), node->TokenName());
+  THR_Print("(%s %s ", node->PrettyName(), node->TokenName());
   node->VisitChildren(this);
-  ISL_Print(")");
+  THR_Print(")");
 }
 
 
 void AstPrinter::VisitBinaryOpWithMask32Node(BinaryOpWithMask32Node* node) {
-  ISL_Print("(%s %s ", node->PrettyName(), node->TokenName());
+  THR_Print("(%s %s ", node->PrettyName(), node->TokenName());
   node->VisitChildren(this);
-  ISL_Print(" & \"0x%" Px64 "", node->mask32());
-  ISL_Print("\")");
+  THR_Print(" & \"0x%" Px64 "", node->mask32());
+  THR_Print("\")");
 }
 
 
 void AstPrinter::VisitUnaryOpNode(UnaryOpNode* node) {
-  ISL_Print("(%s %s ", node->PrettyName(), node->TokenName());
+  THR_Print("(%s %s ", node->PrettyName(), node->TokenName());
   node->VisitChildren(this);
-  ISL_Print(")");
+  THR_Print(")");
 }
 
 
@@ -247,16 +252,16 @@
 
 
 void AstPrinter::VisitCaseNode(CaseNode* node) {
-  ISL_Print("(%s (", node->PrettyName());
+  THR_Print("(%s (", node->PrettyName());
   for (int i = 0; i < node->case_expressions()->length(); i++) {
     node->case_expressions()->NodeAt(i)->Visit(this);
   }
   if (node->contains_default()) {
-    ISL_Print(" default");
+    THR_Print(" default");
   }
-  ISL_Print(")");
+  THR_Print(")");
   node->statements()->Visit(this);
-  ISL_Print(")");
+  THR_Print(")");
 }
 
 
@@ -273,17 +278,17 @@
 void AstPrinter::VisitForNode(ForNode* node) {
   // Complicated because the condition is optional and so we clearly want to
   // indicate the subparts.
-  ISL_Print("(%s (init ", node->PrettyName());
+  THR_Print("(%s (init ", node->PrettyName());
   node->initializer()->Visit(this);
   if (node->condition() != NULL) {
-    ISL_Print(") (cond ");
+    THR_Print(") (cond ");
     node->condition()->Visit(this);
   }
-  ISL_Print(") (update ");
+  THR_Print(") (update ");
   node->increment()->Visit(this);
-  ISL_Print(") ");
+  THR_Print(") ");
   node->body()->Visit(this);
-  ISL_Print(")");
+  THR_Print(")");
 }
 
 
@@ -293,7 +298,7 @@
 
 
 void AstPrinter::VisitJumpNode(JumpNode* node) {
-  ISL_Print("(%s %s %s (scope \"%p\"))",
+  THR_Print("(%s %s %s (scope \"%p\"))",
             node->PrettyName(),
             node->TokenName(),
             node->label()->name().ToCString(),
@@ -302,25 +307,25 @@
 
 
 void AstPrinter::VisitInstanceCallNode(InstanceCallNode* node) {
-  ISL_Print("(%s \"%s\" ",
+  THR_Print("(%s \"%s\" ",
             node->PrettyName(),
             node->function_name().ToCString());
   node->VisitChildren(this);
-  ISL_Print(")");
+  THR_Print(")");
 }
 
 
 void AstPrinter::VisitStaticCallNode(StaticCallNode* node) {
   const char* function_fullname = node->function().ToFullyQualifiedCString();
-  ISL_Print("(%s \"%s\" ", node->PrettyName(), function_fullname);
+  THR_Print("(%s \"%s\" ", node->PrettyName(), function_fullname);
   node->VisitChildren(this);
-  ISL_Print(")");
+  THR_Print(")");
 }
 
 
 void AstPrinter::VisitClosureNode(ClosureNode* node) {
   const char* function_fullname = node->function().ToFullyQualifiedCString();
-  ISL_Print("(%s \"%s\")", node->PrettyName(), function_fullname);
+  THR_Print("(%s \"%s\")", node->PrettyName(), function_fullname);
 }
 
 
@@ -332,39 +337,39 @@
 void AstPrinter::VisitConstructorCallNode(ConstructorCallNode* node) {
   const char* kind = node->constructor().IsFactory() ? "factory " : "";
   const char* constructor_name = node->constructor().ToFullyQualifiedCString();
-  ISL_Print("(%s %s \"%s\" ", node->PrettyName(), kind, constructor_name);
+  THR_Print("(%s %s \"%s\" ", node->PrettyName(), kind, constructor_name);
   node->VisitChildren(this);
-  ISL_Print(")");
+  THR_Print(")");
 }
 
 
 void AstPrinter::VisitInstanceGetterNode(InstanceGetterNode* node) {
-  ISL_Print("(%s \"%s\" ",
+  THR_Print("(%s \"%s\" ",
             node->PrettyName(),
             node->field_name().ToCString());
   node->VisitChildren(this);
-  ISL_Print(")");
+  THR_Print(")");
 }
 
 
 void AstPrinter::VisitInstanceSetterNode(InstanceSetterNode* node) {
-  ISL_Print("(%s \"%s\" ",
+  THR_Print("(%s \"%s\" ",
             node->PrettyName(),
             node->field_name().ToCString());
   node->VisitChildren(this);
-  ISL_Print(")");
+  THR_Print(")");
 }
 
 
 void AstPrinter::VisitInitStaticFieldNode(InitStaticFieldNode* node) {
-  ISL_Print("(%s \"%s\")", node->PrettyName(),
+  THR_Print("(%s \"%s\")", node->PrettyName(),
             String::Handle(node->field().name()).ToCString());
 }
 
 
 void AstPrinter::VisitStaticGetterNode(StaticGetterNode* node) {
   String& class_name = String::Handle(node->cls().Name());
-  ISL_Print("(%s \"%s.%s\")",
+  THR_Print("(%s \"%s.%s\")",
             node->PrettyName(),
             class_name.ToCString(),
             node->field_name().ToCString());
@@ -373,31 +378,31 @@
 
 void AstPrinter::VisitStaticSetterNode(StaticSetterNode* node) {
   String& class_name = String::Handle(node->cls().Name());
-  ISL_Print("(%s \"%s.%s\" ",
+  THR_Print("(%s \"%s.%s\" ",
             node->PrettyName(),
             class_name.ToCString(),
             node->field_name().ToCString());
   node->VisitChildren(this);
-  ISL_Print(")");
+  THR_Print(")");
 }
 
 
 void AstPrinter::VisitLoadIndexedNode(LoadIndexedNode* node) {
-  ISL_Print("(%s%s ", node->PrettyName(), node->IsSuperLoad() ? " super" : "");
+  THR_Print("(%s%s ", node->PrettyName(), node->IsSuperLoad() ? " super" : "");
   node->VisitChildren(this);
-  ISL_Print(")");
+  THR_Print(")");
 }
 
 
 void AstPrinter::VisitStoreIndexedNode(StoreIndexedNode* node) {
-  ISL_Print("(%s%s ", node->PrettyName(), node->IsSuperStore() ? " super" : "");
+  THR_Print("(%s%s ", node->PrettyName(), node->IsSuperStore() ? " super" : "");
   node->VisitChildren(this);
-  ISL_Print(")");
+  THR_Print(")");
 }
 
 
 void AstPrinter::VisitNativeBodyNode(NativeBodyNode* node) {
-  ISL_Print("(%s \"%s\" (%" Pd " args))",
+  THR_Print("(%s \"%s\" (%" Pd " args))",
             node->PrettyName(),
             node->native_c_function_name().ToCString(),
             NativeArguments::ParameterCountForResolution(node->function()));
@@ -410,15 +415,15 @@
 
 
 void AstPrinter::VisitTryCatchNode(TryCatchNode* node) {
-  ISL_Print("(%s ", node->PrettyName());
+  THR_Print("(%s ", node->PrettyName());
   node->try_block()->Visit(this);
   node->catch_block()->Visit(this);
   if (node->finally_block() != NULL) {
-    ISL_Print("(finally ");
+    THR_Print("(finally ");
     node->finally_block()->Visit(this);
-    ISL_Print(")");
+    THR_Print(")");
   }
-  ISL_Print(")");
+  THR_Print(")");
 }
 
 
@@ -428,7 +433,7 @@
 
 
 void AstPrinter::VisitStopNode(StopNode* node) {
-  ISL_Print("(%s %s)", node->PrettyName(), node->message());
+  THR_Print("(%s %s)", node->PrettyName(), node->message());
 }
 
 
@@ -441,13 +446,13 @@
   ASSERT(node != NULL);
   AstPrinter ast_printer;
   node->Visit(&ast_printer);
-  ISL_Print("\n");
+  THR_Print("\n");
 }
 
 
 static void IndentN(int count) {
   for (int i = 0; i < count; i++) {
-    ISL_Print(" ");
+    THR_Print(" ");
   }
 }
 
@@ -458,22 +463,22 @@
   ASSERT(scope != NULL);
   ASSERT(var != NULL);
   IndentN(indent);
-  ISL_Print("(%s%s '%s'",
+  THR_Print("(%s%s '%s'",
             var->is_final() ? "final " : "",
             String::Handle(var->type().Name()).ToCString(),
             var->name().ToCString());
   if (var->owner() != scope) {
-    ISL_Print(" alias");
+    THR_Print(" alias");
   }
   if (var->HasIndex()) {
-    ISL_Print(" @%d", var->index());
+    THR_Print(" @%d", var->index());
     if (var->is_captured()) {
-      ISL_Print(" ctx %d", var->owner()->context_level());
+      THR_Print(" ctx %d", var->owner()->context_level());
     }
   } else if (var->owner()->function_level() != 0) {
-    ISL_Print(" lev %d", var->owner()->function_level());
+    THR_Print(" lev %d", var->owner()->function_level());
   }
-  ISL_Print(" valid %" Pd "-%" Pd ")\n",
+  THR_Print(" valid %" Pd "-%" Pd ")\n",
             var->token_pos(),
             scope->end_token_pos());
 }
@@ -490,38 +495,36 @@
   const LocalScope* child = scope->child();
   while (child != NULL) {
     IndentN(indent);
-    ISL_Print("{scope %p ", child);
+    THR_Print("{scope %p ", child);
     if (child->HasContextLevel()) {
-      ISL_Print("ctx %d numctxvar %d ",
+      THR_Print("ctx %d numctxvar %d ",
                 child->context_level(),
                 child->num_context_variables());
     }
-    ISL_Print("llev %d\n", child->loop_level());
+    THR_Print("llev %d\n", child->loop_level());
     PrintLocalScope(child, 0, indent + kScopeIndent);
     IndentN(indent);
-    ISL_Print("}\n");
+    THR_Print("}\n");
     child = child->sibling();
   }
 }
 
 
 void AstPrinter::PrintFunctionScope(const ParsedFunction& parsed_function) {
-  HANDLESCOPE(Isolate::Current());
+  HANDLESCOPE(parsed_function.thread());
   const Function& function = parsed_function.function();
-  const Array& default_parameter_values =
-      parsed_function.default_parameter_values();
   SequenceNode* node_sequence = parsed_function.node_sequence();
   ASSERT(node_sequence != NULL);
   const LocalScope* scope = node_sequence->scope();
   ASSERT(scope != NULL);
   const char* function_name = function.ToFullyQualifiedCString();
-  ISL_Print("Scope for function '%s'\n{scope %p ", function_name, scope);
+  THR_Print("Scope for function '%s'\n{scope %p ", function_name, scope);
   if (scope->HasContextLevel()) {
-    ISL_Print("ctx %d numctxvar %d ",
+    THR_Print("ctx %d numctxvar %d ",
               scope->context_level(),
               scope->num_context_variables());
   }
-  ISL_Print("llev %d\n", scope->loop_level());
+  THR_Print("llev %d\n", scope->loop_level());
   const int num_fixed_params = function.num_fixed_parameters();
   const int num_params = num_fixed_params + function.NumOptionalParameters();
   // Parameters must be listed first and must all appear in the top scope.
@@ -532,43 +535,43 @@
     LocalVariable* param = scope->VariableAt(pos);
     ASSERT(param->owner() == scope);  // No aliases should precede parameters.
     IndentN(indent);
-    ISL_Print("(param %s%s '%s'",
+    THR_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 Object& default_parameter_value = Object::Handle(
-          default_parameter_values.At(pos - num_fixed_params));
-      ISL_Print(" =%s", default_parameter_value.ToCString());
+      const Instance& default_parameter_value =
+          parsed_function.DefaultParameterValueAt(pos - num_fixed_params);
+      THR_Print(" =%s", default_parameter_value.ToCString());
     }
     if (param->HasIndex()) {
-      ISL_Print(" @%d", param->index());
+      THR_Print(" @%d", param->index());
       if (param->is_captured()) {
-        ISL_Print(" ctx %d", param->owner()->context_level());
+        THR_Print(" ctx %d", param->owner()->context_level());
       }
     }
-    ISL_Print(" valid %" Pd "-%" Pd ")\n",
+    THR_Print(" valid %" Pd "-%" Pd ")\n",
               param->token_pos(),
               scope->end_token_pos());
     pos++;
   }
   // Visit remaining non-parameter variables and children scopes.
   PrintLocalScope(scope, pos, indent);
-  ISL_Print("}\n");
+  THR_Print("}\n");
 }
 
 
 void AstPrinter::PrintFunctionNodes(const ParsedFunction& parsed_function) {
-  HANDLESCOPE(Isolate::Current());
+  HANDLESCOPE(parsed_function.thread());
   SequenceNode* node_sequence = parsed_function.node_sequence();
   ASSERT(node_sequence != NULL);
   AstPrinter ast_printer;
   const char* function_name =
       parsed_function.function().ToFullyQualifiedCString();
-  ISL_Print("Ast for function '%s' {\n", function_name);
+  THR_Print("Ast for function '%s' {\n", function_name);
   node_sequence->Visit(&ast_printer);
-  ISL_Print("}\n");
+  THR_Print("}\n");
 }
 
 }  // namespace dart
diff --git a/runtime/vm/ast_transformer.cc b/runtime/vm/ast_transformer.cc
index ac3f9f1..95d8d4f 100644
--- a/runtime/vm/ast_transformer.cc
+++ b/runtime/vm/ast_transformer.cc
@@ -46,12 +46,12 @@
 #undef DEFINE_UNREACHABLE
 
 AwaitTransformer::AwaitTransformer(SequenceNode* preamble,
-                                   LocalScope* function_top)
+                                   LocalScope* async_temp_scope)
     : preamble_(preamble),
       temp_cnt_(0),
-      function_top_(function_top),
+      async_temp_scope_(async_temp_scope),
       thread_(Thread::Current()) {
-  ASSERT(function_top_ != NULL);
+  ASSERT(async_temp_scope_ != NULL);
 }
 
 
@@ -62,18 +62,17 @@
 
 
 LocalVariable* AwaitTransformer::EnsureCurrentTempVar() {
-  const char* await_temp_prefix = ":await_temp_var_";
-  const String& cnt_str = String::ZoneHandle(
-      Z, String::NewFormatted("%s%d", await_temp_prefix, temp_cnt_));
-  const String& symbol = String::ZoneHandle(Z, Symbols::New(cnt_str));
+  String& symbol =
+      String::ZoneHandle(Z, Symbols::NewFormatted("%d", temp_cnt_));
+  symbol = Symbols::FromConcat(Symbols::AwaitTempVarPrefix(), symbol);
   ASSERT(!symbol.IsNull());
   // Look up the variable in the scope used for async temp variables.
-  LocalVariable* await_tmp = function_top_->LocalLookupVariable(symbol);
+  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(
         Scanner::kNoSourcePos, symbol, Type::ZoneHandle(Type::DynamicType()));
-    function_top_->AddVariable(await_tmp);
+    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.
     await_tmp = GetVariableInScope(preamble_->scope(), symbol);
@@ -112,13 +111,9 @@
   // Await transformation:
   //
   //   :await_temp_var_X = <expr>;
-  //   :result_param = :await_temp_var_X;
-  //   if (:result_param is !Future) {
-  //     :result_param = Future.value(:result_param);
-  //   }
   //   AwaitMarker(kNewContinuationState);
-  //   :result_param = :result_param.then(:async_op);
-  //   _asyncCatchHelper(:result_param.catchError, :async_op);
+  //   :result_param = _awaitHelper(
+  //      :await_temp_var_X, :async_then_callback, :async_catch_error_callback);
   //   return;  // (return_type() == kContinuationTarget)
   //
   //   :saved_try_ctx_var = :await_saved_try_ctx_var_y;
@@ -126,6 +121,10 @@
 
   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* error_param = GetVariableInScope(
@@ -134,78 +133,34 @@
       preamble_->scope(), Symbols::AsyncOperationStackTraceParam());
 
   AstNode* transformed_expr = Transform(node->expr());
-  preamble_->Add(new(Z) StoreLocalNode(
-      Scanner::kNoSourcePos, result_param, transformed_expr));
+  LocalVariable* await_temp = AddToPreambleNewTempVar(transformed_expr);
 
-  LoadLocalNode* load_result_param = new(Z) LoadLocalNode(
-      Scanner::kNoSourcePos, result_param);
-
-  const Class& future_cls =
-      Class::ZoneHandle(Z, thread()->isolate()->object_store()->future_class());
-  ASSERT(!future_cls.IsNull());
-  const AbstractType& future_type =
-      AbstractType::ZoneHandle(Z, future_cls.RareType());
-  ASSERT(!future_type.IsNull());
-
-  LocalScope* is_not_future_scope = ChainNewScope(preamble_->scope());
-  SequenceNode* is_not_future_branch =
-      new (Z) SequenceNode(Scanner::kNoSourcePos, is_not_future_scope);
-
-  // if (:result_param is !Future) {
-  //   :result_param = Future.value(:result_param);
-  // }
-  const Function& value_ctor = Function::ZoneHandle(
-      Z, future_cls.LookupFunction(Symbols::FutureValue()));
-  ASSERT(!value_ctor.IsNull());
-  ArgumentListNode* ctor_args = new (Z) ArgumentListNode(Scanner::kNoSourcePos);
-  ctor_args->Add(new (Z) LoadLocalNode(Scanner::kNoSourcePos, result_param));
-  ConstructorCallNode* ctor_call =
-      new (Z) ConstructorCallNode(Scanner::kNoSourcePos,
-                                  TypeArguments::ZoneHandle(Z),
-                                  value_ctor,
-                                  ctor_args);
-  is_not_future_branch->Add(new (Z) StoreLocalNode(
-      Scanner::kNoSourcePos, result_param, ctor_call));
-  AstNode* is_not_future_test = new (Z) ComparisonNode(
-      Scanner::kNoSourcePos,
-      Token::kISNOT,
-      load_result_param,
-      new (Z) TypeNode(Scanner::kNoSourcePos, future_type));
-  preamble_->Add(new(Z) IfNode(Scanner::kNoSourcePos,
-                               is_not_future_test,
-                               is_not_future_branch,
-                               NULL));
-
-  AwaitMarkerNode* await_marker = new (Z) AwaitMarkerNode();
-  await_marker->set_scope(preamble_->scope());
+  AwaitMarkerNode* await_marker =
+      new (Z) AwaitMarkerNode(async_temp_scope_, node->scope());
   preamble_->Add(await_marker);
-  ArgumentListNode* args = new(Z) ArgumentListNode(Scanner::kNoSourcePos);
 
-  args->Add(new(Z) LoadLocalNode(Scanner::kNoSourcePos, async_op));
-  preamble_->Add(new (Z) StoreLocalNode(
-      Scanner::kNoSourcePos,
-      result_param,
-      new(Z) InstanceCallNode(node->token_pos(),
-                              load_result_param,
-                              Symbols::FutureThen(),
-                              args)));
-  const Library& core_lib = Library::Handle(Library::CoreLibrary());
-  const Function& async_catch_helper = Function::ZoneHandle(
-      Z, core_lib.LookupFunctionAllowPrivate(Symbols::AsyncCatchHelper()));
-  ASSERT(!async_catch_helper.IsNull());
-  ArgumentListNode* catch_helper_args = new (Z) ArgumentListNode(
+  // :result_param = _awaitHelper(
+  //      :await_temp, :async_then_callback, :async_catch_error_callback)
+  const Library& async_lib = Library::Handle(Library::AsyncLibrary());
+  const Function& async_await_helper = Function::ZoneHandle(
+      Z, async_lib.LookupFunctionAllowPrivate(Symbols::AsyncAwaitHelper()));
+  ASSERT(!async_await_helper.IsNull());
+  ArgumentListNode* async_await_helper_args = new (Z) ArgumentListNode(
       Scanner::kNoSourcePos);
-  InstanceGetterNode* catch_error_getter = new (Z) InstanceGetterNode(
-      Scanner::kNoSourcePos,
-      load_result_param,
-      Symbols::FutureCatchError());
-  catch_helper_args->Add(catch_error_getter);
-  catch_helper_args->Add(new (Z) LoadLocalNode(
-      Scanner::kNoSourcePos, async_op));
-  preamble_->Add(new (Z) StaticCallNode(
-      Scanner::kNoSourcePos,
-      async_catch_helper,
-      catch_helper_args));
+  async_await_helper_args->Add(
+      new(Z) LoadLocalNode(Scanner::kNoSourcePos, await_temp));
+  async_await_helper_args->Add(
+      new(Z) LoadLocalNode(Scanner::kNoSourcePos, async_then_callback));
+  async_await_helper_args->Add(
+      new(Z) LoadLocalNode(Scanner::kNoSourcePos, 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(
+      Scanner::kNoSourcePos, result_param, await_helper_call));
+
   ReturnNode* continuation_return = new(Z) ReturnNode(Scanner::kNoSourcePos);
   continuation_return->set_return_type(ReturnNode::kContinuationTarget);
   preamble_->Add(continuation_return);
@@ -230,6 +185,12 @@
     ASSERT(node->outer_saved_try_ctx() == NULL);
   }
 
+  // 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(
+      Scanner::kNoSourcePos, async_op);
+  preamble_->Add(load_async_op);
+
   LoadLocalNode* load_error_param = new (Z) LoadLocalNode(
       Scanner::kNoSourcePos, error_param);
   LoadLocalNode* load_stack_trace_param = new (Z) LoadLocalNode(
@@ -600,18 +561,27 @@
   // added to a scope, and the subsequent nodes that are added to the
   // preample can access them.
   for (intptr_t i = 0; i < node->num_temps(); i++) {
-    function_top_->AddVariable(node->TempAt(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));
   }
-  // The transformed LetNode does not have any temporary variables.
-  LetNode* result = new(Z) LetNode(node->token_pos());
-  for (intptr_t i = 0; i < node->nodes().length(); i++) {
-    result->AddNode(Transform(node->nodes()[i]));
+
+  // Add all expressions but the last to the preamble. We must do
+  // this because subexpressions of the awaitable expression we
+  // are currently transforming may depend on each other,
+  // e.g. await foo(a++, a++). Thus we must preserve the order of the
+  // transformed subexpressions.
+  for (intptr_t i = 0; i < node->nodes().length() - 1; i++) {
+    preamble_->Add(Transform(node->nodes()[i]));
   }
-  result_ = result;
+
+  // The last expression in the let node is the value of the node.
+  // The result of the transformed let node is this expression.
+  ASSERT(node->nodes().length() > 0);
+  const intptr_t last_node_index = node->nodes().length() - 1;
+  result_ = Transform(node->nodes()[last_node_index]);
 }
 
 
diff --git a/runtime/vm/ast_transformer.h b/runtime/vm/ast_transformer.h
index 807f7cf..e9f6791 100644
--- a/runtime/vm/ast_transformer.h
+++ b/runtime/vm/ast_transformer.h
@@ -39,7 +39,7 @@
 //
 class AwaitTransformer : public AstNodeVisitor {
  public:
-  AwaitTransformer(SequenceNode* preamble, LocalScope* function_top);
+  AwaitTransformer(SequenceNode* preamble, LocalScope* async_temp_scope);
 
 #define DECLARE_VISIT(BaseName)                                                \
   virtual void Visit##BaseName##Node(BaseName##Node* node);
@@ -66,7 +66,7 @@
   SequenceNode* preamble_;
   int32_t temp_cnt_;
   AstNode* result_;
-  LocalScope* function_top_;
+  LocalScope* async_temp_scope_;
 
   Thread* thread_;
 
diff --git a/runtime/vm/atomic.h b/runtime/vm/atomic.h
index c256fe5..9d1fd13 100644
--- a/runtime/vm/atomic.h
+++ b/runtime/vm/atomic.h
@@ -21,7 +21,24 @@
   // that are accessed by generated code
   static uintptr_t FetchAndIncrement(uintptr_t* p);
 
+  // Atomically fetch the value at p and decrement the value at p.
+  // Returns the original value at p.
+  //
+  // NOTE: Not to be used for any atomic operations involving memory locations
+  // that are accessed by generated code
+  static uintptr_t FetchAndDecrement(uintptr_t* p);
+
+  // Atomically compare *ptr to old_value, and if equal, store new_value.
+  // Returns the original value at ptr.
+  //
+  // NOTE: OK to use with memory locations that are accessed by generated code
   static uword CompareAndSwapWord(uword* ptr, uword old_value, uword new_value);
+
+  // Performs a load of a word from 'ptr', but without any guarantees about
+  // memory order (i.e., no load barriers/fences).
+  static uword LoadRelaxed(uword* ptr) {
+    return *static_cast<volatile uword*>(ptr);
+  }
 };
 
 
diff --git a/runtime/vm/atomic_android.h b/runtime/vm/atomic_android.h
index 06208f2..9f4df90 100644
--- a/runtime/vm/atomic_android.h
+++ b/runtime/vm/atomic_android.h
@@ -21,6 +21,11 @@
 }
 
 
+inline uintptr_t AtomicOperations::FetchAndDecrement(uintptr_t* p) {
+  return __sync_fetch_and_sub(p, 1);
+}
+
+
 #if !defined(USING_SIMULATOR)
 inline uword AtomicOperations::CompareAndSwapWord(uword* ptr,
                                                   uword old_value,
diff --git a/runtime/vm/atomic_linux.h b/runtime/vm/atomic_linux.h
index 9789ae5..dc57f2d 100644
--- a/runtime/vm/atomic_linux.h
+++ b/runtime/vm/atomic_linux.h
@@ -21,6 +21,11 @@
 }
 
 
+inline uintptr_t AtomicOperations::FetchAndDecrement(uintptr_t* p) {
+  return __sync_fetch_and_sub(p, 1);
+}
+
+
 #if !defined(USING_SIMULATOR)
 inline uword AtomicOperations::CompareAndSwapWord(uword* ptr,
                                                   uword old_value,
diff --git a/runtime/vm/atomic_macos.h b/runtime/vm/atomic_macos.h
index 288fe3c..b56d2a0 100644
--- a/runtime/vm/atomic_macos.h
+++ b/runtime/vm/atomic_macos.h
@@ -21,6 +21,11 @@
 }
 
 
+inline uintptr_t AtomicOperations::FetchAndDecrement(uintptr_t* p) {
+  return __sync_fetch_and_sub(p, 1);
+}
+
+
 #if !defined(USING_SIMULATOR)
 inline uword AtomicOperations::CompareAndSwapWord(uword* ptr,
                                                   uword old_value,
diff --git a/runtime/vm/atomic_test.cc b/runtime/vm/atomic_test.cc
new file mode 100644
index 0000000..5e22606
--- /dev/null
+++ b/runtime/vm/atomic_test.cc
@@ -0,0 +1,34 @@
+// 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.
+
+#include "platform/assert.h"
+#include "platform/utils.h"
+#include "vm/atomic.h"
+#include "vm/globals.h"
+#include "vm/unit_test.h"
+
+namespace dart {
+
+UNIT_TEST_CASE(FetchAndIncrement) {
+  uintptr_t v = 42;
+  EXPECT_EQ(static_cast<uintptr_t>(42),
+            AtomicOperations::FetchAndIncrement(&v));
+  EXPECT_EQ(static_cast<uintptr_t>(43), v);
+}
+
+
+UNIT_TEST_CASE(FetchAndDecrement) {
+  uintptr_t v = 42;
+  EXPECT_EQ(static_cast<uintptr_t>(42),
+            AtomicOperations::FetchAndDecrement(&v));
+  EXPECT_EQ(static_cast<uintptr_t>(41), v);
+}
+
+
+UNIT_TEST_CASE(LoadRelaxed) {
+  uword v = 42;
+  EXPECT_EQ(static_cast<uword>(42), AtomicOperations::LoadRelaxed(&v));
+}
+
+}  // namespace dart
diff --git a/runtime/vm/atomic_win.h b/runtime/vm/atomic_win.h
index 24be3b1..4ef539c 100644
--- a/runtime/vm/atomic_win.h
+++ b/runtime/vm/atomic_win.h
@@ -16,14 +16,27 @@
 namespace dart {
 
 inline uintptr_t AtomicOperations::FetchAndIncrement(uintptr_t* p) {
-#if defined(TARGET_ARCH_X64)
+#if defined(HOST_ARCH_X64)
   return static_cast<uintptr_t>(
       InterlockedIncrement64(reinterpret_cast<LONGLONG*>(p))) - 1;
-#elif defined(TARGET_ARCH_IA32)
+#elif defined(HOST_ARCH_IA32)
   return static_cast<uintptr_t>(
       InterlockedIncrement(reinterpret_cast<LONG*>(p))) - 1;
 #else
-  UNIMPLEMENTED();
+#error Unsupported host architecture.
+#endif
+}
+
+
+inline uintptr_t AtomicOperations::FetchAndDecrement(uintptr_t* p) {
+#if defined(HOST_ARCH_X64)
+  return static_cast<uintptr_t>(
+      InterlockedDecrement64(reinterpret_cast<LONGLONG*>(p))) + 1;
+#elif defined(HOST_ARCH_IA32)
+  return static_cast<uintptr_t>(
+      InterlockedDecrement(reinterpret_cast<LONG*>(p))) + 1;
+#else
+#error Unsupported host architecture.
 #endif
 }
 
@@ -32,18 +45,18 @@
 inline uword AtomicOperations::CompareAndSwapWord(uword* ptr,
                                                   uword old_value,
                                                   uword new_value) {
-#if defined(TARGET_ARCH_X64)
+#if defined(HOST_ARCH_X64)
   return static_cast<uword>(
       InterlockedCompareExchange64(reinterpret_cast<LONGLONG*>(ptr),
                                    static_cast<LONGLONG>(new_value),
                                    static_cast<LONGLONG>(old_value)));
-#elif defined(TARGET_ARCH_IA32)
+#elif defined(HOST_ARCH_IA32)
   return static_cast<uword>(
       InterlockedCompareExchange(reinterpret_cast<LONG*>(ptr),
                                  static_cast<LONG>(new_value),
                                  static_cast<LONG>(old_value)));
 #else
-  UNIMPLEMENTED();
+#error Unsupported host architecture.
 #endif
 }
 #endif  // !defined(USING_SIMULATOR)
diff --git a/runtime/vm/base_isolate.h b/runtime/vm/base_isolate.h
index 33c5f4d3..833f7e5 100644
--- a/runtime/vm/base_isolate.h
+++ b/runtime/vm/base_isolate.h
@@ -26,28 +26,13 @@
   void AssertCurrentThreadIsMutator() const {}
 #endif  // DEBUG
 
-  int32_t no_callback_scope_depth() const {
-    return no_callback_scope_depth_;
-  }
-
-  void IncrementNoCallbackScopeDepth() {
-    ASSERT(no_callback_scope_depth_ < INT_MAX);
-    no_callback_scope_depth_ += 1;
-  }
-
-  void DecrementNoCallbackScopeDepth() {
-    ASSERT(no_callback_scope_depth_ > 0);
-    no_callback_scope_depth_ -= 1;
-  }
-
 #if defined(DEBUG)
   static void AssertCurrent(BaseIsolate* isolate);
 #endif
 
  protected:
   BaseIsolate()
-      : mutator_thread_(NULL),
-        no_callback_scope_depth_(0) {
+      : mutator_thread_(NULL) {
   }
 
   ~BaseIsolate() {
@@ -55,7 +40,6 @@
   }
 
   Thread* mutator_thread_;
-  int32_t no_callback_scope_depth_;
 
  private:
   // During migration, some deprecated interfaces will default to using the
diff --git a/runtime/vm/benchmark_test.cc b/runtime/vm/benchmark_test.cc
index 7f51ac4..9fcb4d00 100644
--- a/runtime/vm/benchmark_test.cc
+++ b/runtime/vm/benchmark_test.cc
@@ -10,6 +10,7 @@
 #include "platform/assert.h"
 #include "platform/globals.h"
 
+#include "vm/compiler_stats.h"
 #include "vm/dart_api_impl.h"
 #include "vm/stack_frame.h"
 #include "vm/unit_test.h"
@@ -40,13 +41,32 @@
   bin::Builtin::SetNativeResolver(bin::Builtin::kIOLibrary);
   Timer timer(true, "Compile all of Core lib benchmark");
   timer.Start();
-  const Error& error = Error::Handle(benchmark->isolate(),
+  const Error& error = Error::Handle(benchmark->isolate()->current_zone(),
                                      Library::CompileAll());
   if (!error.IsNull()) {
     OS::PrintErr("Unexpected error in CorelibCompileAll benchmark:\n%s",
                  error.ToErrorCString());
   }
-  EXPECT(error.IsNull());
+  timer.Stop();
+  int64_t elapsed_time = timer.TotalElapsedTime();
+  benchmark->set_score(elapsed_time);
+}
+
+
+BENCHMARK(CorelibCompilerStats) {
+  bin::Builtin::SetNativeResolver(bin::Builtin::kBuiltinLibrary);
+  bin::Builtin::SetNativeResolver(bin::Builtin::kIOLibrary);
+  CompilerStats* stats = Isolate::Current()->compiler_stats();
+  ASSERT(stats != NULL);
+  stats->EnableBenchmark();
+  Timer timer(true, "Compiler stats compiling all of Core lib");
+  timer.Start();
+  const Error& error = Error::Handle(benchmark->isolate()->current_zone(),
+                                     Library::CompileAll());
+  if (!error.IsNull()) {
+    OS::PrintErr("Unexpected error in CorelibCompileAll benchmark:\n%s",
+                 error.ToErrorCString());
+  }
   timer.Stop();
   int64_t elapsed_time = timer.TotalElapsedTime();
   benchmark->set_score(elapsed_time);
@@ -353,14 +373,9 @@
   char* dart_root = ComputeDart2JSPath(Benchmark::Executable());
   char* script = NULL;
   if (dart_root != NULL) {
-    Isolate* isolate = Isolate::Current();
-    HANDLESCOPE(isolate);
-    const char* kFormatStr =
-        "import '%s/pkg/compiler/lib/compiler.dart';";
-    intptr_t len = OS::SNPrint(NULL, 0, kFormatStr, dart_root) + 1;
-    script = reinterpret_cast<char*>(malloc(len));
-    EXPECT(script != NULL);
-    OS::SNPrint(script, len, kFormatStr, dart_root);
+    HANDLESCOPE(thread);
+    script = OS::SCreate(NULL,
+        "import '%s/pkg/compiler/lib/compiler.dart';", dart_root);
     Dart_Handle lib = TestCase::LoadTestScript(
         script,
         reinterpret_cast<Dart_NativeEntryResolver>(NativeResolver));
@@ -383,6 +398,41 @@
 }
 
 
+BENCHMARK(Dart2JSCompilerStats) {
+  bin::Builtin::SetNativeResolver(bin::Builtin::kBuiltinLibrary);
+  bin::Builtin::SetNativeResolver(bin::Builtin::kIOLibrary);
+  SetupDart2JSPackagePath();
+  char* dart_root = ComputeDart2JSPath(Benchmark::Executable());
+  char* script = NULL;
+  if (dart_root != NULL) {
+    HANDLESCOPE(thread);
+    script = OS::SCreate(NULL,
+        "import '%s/pkg/compiler/lib/compiler.dart';", dart_root);
+    Dart_Handle lib = TestCase::LoadTestScript(
+        script,
+        reinterpret_cast<Dart_NativeEntryResolver>(NativeResolver));
+    EXPECT_VALID(lib);
+  } else {
+    Dart_Handle lib = TestCase::LoadTestScript(
+        "import 'pkg/compiler/lib/compiler.dart';",
+        reinterpret_cast<Dart_NativeEntryResolver>(NativeResolver));
+    EXPECT_VALID(lib);
+  }
+  CompilerStats* stats = Isolate::Current()->compiler_stats();
+  ASSERT(stats != NULL);
+  stats->EnableBenchmark();
+  Timer timer(true, "Compile all of dart2js benchmark");
+  timer.Start();
+  Dart_Handle result = Dart_CompileAll();
+  EXPECT_VALID(result);
+  timer.Stop();
+  int64_t elapsed_time = timer.TotalElapsedTime();
+  benchmark->set_score(elapsed_time);
+  free(dart_root);
+  free(script);
+}
+
+
 //
 // Measure frame lookup during stack traversal.
 //
@@ -502,7 +552,10 @@
   // Write snapshot with object content.
   FullSnapshotWriter writer(&vm_isolate_snapshot_buffer,
                             &isolate_snapshot_buffer,
-                            &malloc_allocator);
+                            NULL, /* instructions_snapshot_buffer */
+                            &malloc_allocator,
+                            false, /* snapshot_code */
+                            true /* vm_isolate_is_symbolic */);
   writer.WriteFullSnapshot();
   const Snapshot* snapshot = Snapshot::SetupFromBuffer(isolate_snapshot_buffer);
   ASSERT(snapshot->kind() == Snapshot::kFull);
@@ -536,7 +589,10 @@
   // Write snapshot with object content.
   FullSnapshotWriter writer(&vm_isolate_snapshot_buffer,
                             &isolate_snapshot_buffer,
-                            &malloc_allocator);
+                            NULL, /* instructions_snapshot_buffer */
+                            &malloc_allocator,
+                            false, /* snapshot_code */
+                            true /* vm_isolate_is_symbolic */);
   writer.WriteFullSnapshot();
   const Snapshot* snapshot = Snapshot::SetupFromBuffer(isolate_snapshot_buffer);
   ASSERT(snapshot->kind() == Snapshot::kFull);
@@ -593,12 +649,11 @@
 BENCHMARK(SerializeNull) {
   const Object& null_object = Object::Handle();
   const intptr_t kLoopCount = 1000000;
-  Isolate* isolate = Isolate::Current();
   uint8_t* buffer;
   Timer timer(true, "Serialize Null");
   timer.Start();
   for (intptr_t i = 0; i < kLoopCount; i++) {
-    StackZone zone(isolate);
+    StackZone zone(thread);
     MessageWriter writer(&buffer, &message_allocator, true);
     writer.WriteMessage(null_object);
     intptr_t buffer_len = writer.BytesWritten();
@@ -606,8 +661,7 @@
     // Read object back from the snapshot.
     MessageSnapshotReader reader(buffer,
                                  buffer_len,
-                                 isolate,
-                                 zone.GetZone());
+                                 thread);
     reader.ReadObject();
   }
   timer.Stop();
@@ -619,12 +673,11 @@
 BENCHMARK(SerializeSmi) {
   const Integer& smi_object = Integer::Handle(Smi::New(42));
   const intptr_t kLoopCount = 1000000;
-  Isolate* isolate = Isolate::Current();
   uint8_t* buffer;
   Timer timer(true, "Serialize Smi");
   timer.Start();
   for (intptr_t i = 0; i < kLoopCount; i++) {
-    StackZone zone(isolate);
+    StackZone zone(thread);
     MessageWriter writer(&buffer, &message_allocator, true);
     writer.WriteMessage(smi_object);
     intptr_t buffer_len = writer.BytesWritten();
@@ -632,8 +685,7 @@
     // Read object back from the snapshot.
     MessageSnapshotReader reader(buffer,
                                  buffer_len,
-                                 isolate,
-                                 zone.GetZone());
+                                 thread);
     reader.ReadObject();
   }
   timer.Stop();
@@ -647,12 +699,11 @@
   array_object.SetAt(0, Integer::Handle(Smi::New(42)));
   array_object.SetAt(1, Object::Handle());
   const intptr_t kLoopCount = 1000000;
-  Isolate* isolate = Isolate::Current();
   uint8_t* buffer;
   Timer timer(true, "Simple Message");
   timer.Start();
   for (intptr_t i = 0; i < kLoopCount; i++) {
-    StackZone zone(isolate);
+    StackZone zone(thread);
     MessageWriter writer(&buffer, &malloc_allocator, true);
     writer.WriteMessage(array_object);
     intptr_t buffer_len = writer.BytesWritten();
@@ -660,8 +711,7 @@
     // Read object back from the snapshot.
     MessageSnapshotReader reader(buffer,
                                  buffer_len,
-                                 isolate,
-                                 zone.GetZone());
+                                 thread);
     reader.ReadObject();
     free(buffer);
   }
@@ -685,12 +735,11 @@
   Instance& map = Instance::Handle();
   map ^= Api::UnwrapHandle(h_result);
   const intptr_t kLoopCount = 100;
-  Isolate* isolate = Isolate::Current();
   uint8_t* buffer;
   Timer timer(true, "Large Map");
   timer.Start();
   for (intptr_t i = 0; i < kLoopCount; i++) {
-    StackZone zone(isolate);
+    StackZone zone(thread);
     MessageWriter writer(&buffer, &malloc_allocator, true);
     writer.WriteMessage(map);
     intptr_t buffer_len = writer.BytesWritten();
@@ -698,8 +747,7 @@
     // Read object back from the snapshot.
     MessageSnapshotReader reader(buffer,
                                  buffer_len,
-                                 isolate,
-                                 zone.GetZone());
+                                 thread);
     reader.ReadObject();
     free(buffer);
   }
diff --git a/runtime/vm/benchmark_test.h b/runtime/vm/benchmark_test.h
index de7d6ae..615965c 100644
--- a/runtime/vm/benchmark_test.h
+++ b/runtime/vm/benchmark_test.h
@@ -34,15 +34,17 @@
 #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);                \
+  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);                              \
-    StackZone __zone__(benchmark->isolate());                                  \
-    HandleScope __hs__(benchmark->isolate());                                  \
-    Dart_BenchmarkHelper##name(benchmark);                                     \
+    Thread* __thread__ = Thread::Current();                                    \
+    ASSERT(__thread__->isolate() == benchmark->isolate());                     \
+    StackZone __zone__(__thread__);                                            \
+    HandleScope __hs__(__thread__);                                            \
+    Dart_BenchmarkHelper##name(benchmark, __thread__);                         \
   }                                                                            \
-  static void Dart_BenchmarkHelper##name(Benchmark* benchmark)
+  static void Dart_BenchmarkHelper##name(Benchmark* benchmark, Thread* thread)
 
 #define BENCHMARK(name) BENCHMARK_HELPER(name, "RunTime")
 #define BENCHMARK_SIZE(name) BENCHMARK_HELPER(name, "CodeSize")
diff --git a/runtime/vm/bit_vector_test.cc b/runtime/vm/bit_vector_test.cc
index 4c803d9..d2b7d1a 100644
--- a/runtime/vm/bit_vector_test.cc
+++ b/runtime/vm/bit_vector_test.cc
@@ -8,7 +8,7 @@
 
 namespace dart {
 
-#define Z Thread::Current()->zone()
+#define Z (thread->zone())
 
 TEST_CASE(BitVector) {
   { BitVector* v = new BitVector(Z, 15);
diff --git a/runtime/vm/block_scheduler.cc b/runtime/vm/block_scheduler.cc
index e8d950c..a84a5d9 100644
--- a/runtime/vm/block_scheduler.cc
+++ b/runtime/vm/block_scheduler.cc
@@ -12,63 +12,37 @@
 
 DEFINE_FLAG(bool, emit_edge_counters, true, "Emit edge counters at targets.");
 
-// Compute the edge count at the deopt id of a TargetEntry or Goto.
-static intptr_t ComputeEdgeCount(
-    const Code& unoptimized_code,
-    const ZoneGrowableArray<uword>& deopt_id_pc_pairs,
-    intptr_t deopt_id) {
-  ASSERT(deopt_id != Isolate::kNoDeoptId);
-
+static intptr_t GetEdgeCount(const Array& edge_counters, intptr_t edge_id) {
   if (!FLAG_emit_edge_counters) {
     // Assume everything was visited once.
     return 1;
   }
-
-  for (intptr_t i = 0; i < deopt_id_pc_pairs.length(); i += 2) {
-    intptr_t deopt_id_entry = static_cast<intptr_t>(deopt_id_pc_pairs[i]);
-    uword pc = deopt_id_pc_pairs[i + 1];
-    if (deopt_id_entry == deopt_id) {
-      Array& array = Array::Handle();
-      array ^= CodePatcher::GetEdgeCounterAt(pc, unoptimized_code);
-      ASSERT(!array.IsNull());
-      return Smi::Value(Smi::RawCast(array.At(0)));
-    }
-  }
-
-  UNREACHABLE();
-  return 1;
+  return Smi::Value(Smi::RawCast(edge_counters.At(edge_id)));
 }
 
 
 // There is an edge from instruction->successor.  Set its weight (edge count
 // per function entry).
-static void SetEdgeWeight(Instruction* instruction,
+static void SetEdgeWeight(BlockEntryInstr* block,
                           BlockEntryInstr* successor,
-                          const Code& unoptimized_code,
-                          const ZoneGrowableArray<uword>& deopt_id_pc_pairs,
+                          const Array& edge_counters,
                           intptr_t entry_count) {
   TargetEntryInstr* target = successor->AsTargetEntry();
   if (target != NULL) {
     // If this block ends in a goto, the edge count of this edge is the same
     // as the count on the single outgoing edge. This is true as long as the
     // block does not throw an exception.
-    GotoInstr* jump = target->last_instruction()->AsGoto();
-    const intptr_t deopt_id =
-        (jump != NULL)  ? jump->deopt_id() : target->deopt_id();
-    intptr_t count = ComputeEdgeCount(unoptimized_code,
-                                      deopt_id_pc_pairs,
-                                      deopt_id);
+    intptr_t count = GetEdgeCount(edge_counters, target->preorder_number());
     if ((count >= 0) && (entry_count != 0)) {
       double weight =
           static_cast<double>(count) / static_cast<double>(entry_count);
       target->set_edge_weight(weight);
     }
   } else {
-    GotoInstr* jump = instruction->AsGoto();
+    GotoInstr* jump = block->last_instruction()->AsGoto();
     if (jump != NULL) {
-      intptr_t count = ComputeEdgeCount(unoptimized_code,
-                                        deopt_id_pc_pairs,
-                                        jump->deopt_id());
+      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);
@@ -83,26 +57,15 @@
   if (!FLAG_emit_edge_counters) {
     return;
   }
-  const Code& unoptimized_code = flow_graph()->parsed_function().code();
-  ASSERT(!unoptimized_code.IsNull());
 
-  ZoneGrowableArray<uword>* deopt_id_pc_pairs = new ZoneGrowableArray<uword>();
-  const PcDescriptors& descriptors =
-      PcDescriptors::Handle(unoptimized_code.pc_descriptors());
-  PcDescriptors::Iterator iter(descriptors, RawPcDescriptors::kDeopt);
-  uword entry = unoptimized_code.EntryPoint();
-  while (iter.MoveNext()) {
-    intptr_t deopt_id = iter.DeoptId();
-    ASSERT(deopt_id != Isolate::kNoDeoptId);
-    uint32_t pc_offset = iter.PcOffset();
-    deopt_id_pc_pairs->Add(static_cast<uword>(deopt_id));
-    deopt_id_pc_pairs->Add(entry + pc_offset);
-  }
+  const Array& ic_data_array = Array::Handle(flow_graph()->zone(),
+      flow_graph()->parsed_function().function().ic_data_array());
+  Array& edge_counters = Array::Handle();
+  edge_counters ^= ic_data_array.At(0);
 
-  intptr_t entry_count =
-      ComputeEdgeCount(unoptimized_code,
-                       *deopt_id_pc_pairs,
-                       flow_graph()->graph_entry()->normal_entry()->deopt_id());
+  intptr_t entry_count = GetEdgeCount(
+      edge_counters,
+      flow_graph()->graph_entry()->normal_entry()->preorder_number());
   flow_graph()->graph_entry()->set_entry_count(entry_count);
 
   for (BlockIterator it = flow_graph()->reverse_postorder_iterator();
@@ -112,8 +75,7 @@
     Instruction* last = block->last_instruction();
     for (intptr_t i = 0; i < last->SuccessorCount(); ++i) {
       BlockEntryInstr* succ = last->SuccessorAt(i);
-      SetEdgeWeight(last, succ,
-                    unoptimized_code, *deopt_id_pc_pairs, entry_count);
+      SetEdgeWeight(block, succ, edge_counters, entry_count);
     }
   }
 }
diff --git a/runtime/vm/bootstrap.cc b/runtime/vm/bootstrap.cc
index b844d01..85fcf52 100644
--- a/runtime/vm/bootstrap.cc
+++ b/runtime/vm/bootstrap.cc
@@ -75,6 +75,10 @@
                typed_data,
                Bootstrap::typed_data_source_paths_,
                Bootstrap::typed_data_patch_paths_),
+  INIT_LIBRARY(ObjectStore::kVMService,
+               _vmservice,
+               Bootstrap::_vmservice_source_paths_,
+               Bootstrap::_vmservice_patch_paths_),
   { ObjectStore::kNone, NULL, NULL, NULL, NULL }
 };
 
@@ -154,35 +158,37 @@
     } else {
       // Compilation errors are not Dart instances, so just mark the library
       // as having failed to load without providing an error instance.
-      library.SetLoadError(Instance::Handle());
+      library.SetLoadError(Object::null_instance());
     }
   }
   return error.raw();
 }
 
 
-static Dart_Handle LoadPartSource(Isolate* isolate,
+static Dart_Handle LoadPartSource(Thread* thread,
                                   const Library& lib,
                                   const String& uri) {
+  Zone* zone = thread->zone();
+  Isolate* isolate = thread->isolate();
   const String& part_source = String::Handle(
-      isolate, GetLibrarySource(lib, uri, false));
-  const String& lib_uri = String::Handle(isolate, lib.url());
+      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'",
                          uri.ToCString(), lib_uri.ToCString());
   }
 
   // Prepend the library URI to form a unique script URI for the part.
-  const Array& strings = Array::Handle(isolate, Array::New(3));
+  const Array& strings = Array::Handle(zone, Array::New(3));
   strings.SetAt(0, lib_uri);
   strings.SetAt(1, Symbols::Slash());
   strings.SetAt(2, uri);
-  const String& part_uri = String::Handle(isolate, String::ConcatAll(strings));
+  const String& part_uri = String::Handle(zone, String::ConcatAll(strings));
 
   // Create a script object and compile the part.
   const Script& part_script = Script::Handle(
-      isolate, Script::New(part_uri, part_source, RawScript::kSourceTag));
-  const Error& error = Error::Handle(isolate, Compile(lib, part_script));
+      zone, Script::New(part_uri, part_source, RawScript::kSourceTag));
+  const Error& error = Error::Handle(zone, Compile(lib, part_script));
   return Api::NewHandle(isolate, error.raw());
 }
 
@@ -190,7 +196,8 @@
 static Dart_Handle BootstrapLibraryTagHandler(Dart_LibraryTag tag,
                                               Dart_Handle library,
                                               Dart_Handle uri) {
-  Isolate* isolate = Isolate::Current();
+  Thread* thread = Thread::Current();
+  Zone* zone = thread->zone();
   if (!Dart_IsLibrary(library)) {
     return Api::NewError("not a library");
   }
@@ -201,7 +208,7 @@
     // In the bootstrap loader we do not try and do any canonicalization.
     return uri;
   }
-  const String& uri_str = Api::UnwrapStringHandle(isolate, uri);
+  const String& uri_str = Api::UnwrapStringHandle(zone, uri);
   ASSERT(!uri_str.IsNull());
   if (tag == Dart_kImportTag) {
     // We expect the core bootstrap libraries to only import other
@@ -213,21 +220,21 @@
                          uri_str.ToCString());
   }
   ASSERT(tag == Dart_kSourceTag);
-  const Library& lib = Api::UnwrapLibraryHandle(isolate, library);
+  const Library& lib = Api::UnwrapLibraryHandle(zone, library);
   ASSERT(!lib.IsNull());
-  return LoadPartSource(isolate, lib, uri_str);
+  return LoadPartSource(thread, lib, uri_str);
 }
 
 
-static RawError* LoadPatchFiles(Isolate* isolate,
+static RawError* LoadPatchFiles(Zone* zone,
                                 const Library& lib,
                                 const String& patch_uri,
                                 const char** patch_files) {
-  String& patch_file_uri = String::Handle(isolate);
-  String& source = String::Handle(isolate);
-  Script& script = Script::Handle(isolate);
-  Error& error = Error::Handle(isolate);
-  const Array& strings = Array::Handle(isolate, Array::New(3));
+  String& patch_file_uri = String::Handle(zone);
+  String& source = String::Handle(zone);
+  Script& script = Script::Handle(zone);
+  Error& error = Error::Handle(zone);
+  const Array& strings = Array::Handle(zone, Array::New(3));
   strings.SetAt(0, patch_uri);
   strings.SetAt(1, Symbols::Slash());
   for (intptr_t j = 0; patch_files[j] != NULL; j += 2) {
@@ -253,20 +260,22 @@
 
 
 RawError* Bootstrap::LoadandCompileScripts() {
-  Isolate* isolate = Isolate::Current();
-  String& uri = String::Handle(isolate);
-  String& patch_uri = String::Handle(isolate);
-  String& source = String::Handle(isolate);
-  Script& script = Script::Handle(isolate);
-  Library& lib = Library::Handle(isolate);
-  Error& error = Error::Handle(isolate);
+  Thread* thread = Thread::Current();
+  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.
   isolate->set_library_tag_handler(BootstrapLibraryTagHandler);
 
-  HANDLESCOPE(isolate);
+  HANDLESCOPE(thread);
 
   // Create library objects for all the bootstrap libraries.
   for (intptr_t i = 0;
@@ -306,7 +315,7 @@
     // If a patch exists, load and patch the script.
     if (bootstrap_libraries[i].patch_paths_ != NULL) {
       patch_uri = Symbols::New(bootstrap_libraries[i].patch_uri_);
-      error = LoadPatchFiles(isolate,
+      error = LoadPatchFiles(zone,
                              lib,
                              patch_uri,
                              bootstrap_libraries[i].patch_paths_);
@@ -319,12 +328,12 @@
     SetupNativeResolver();
     ClassFinalizer::ProcessPendingClasses();
 
-    Class& cls = Class::Handle(isolate);
+    Class& cls = Class::Handle(zone);
     // Eagerly compile the function implementation class as it is the super
     // class of signature classes. This allows us to just finalize signature
     // classes without going through the hoops of trying to compile them.
     const Type& type =
-        Type::Handle(isolate, isolate->object_store()->function_impl_type());
+        Type::Handle(zone, isolate->object_store()->function_impl_type());
     cls = type.type_class();
     Compiler::CompileClass(cls);
   }
diff --git a/runtime/vm/bootstrap.h b/runtime/vm/bootstrap.h
index 76758b6..eb238ed 100644
--- a/runtime/vm/bootstrap.h
+++ b/runtime/vm/bootstrap.h
@@ -33,6 +33,7 @@
   static const char* profiler_source_paths_[];
   static const char* typed_data_source_paths_[];
   static const char* utf_source_paths_[];
+  static const char* _vmservice_source_paths_[];
 
   // Source path mapping for patch URI and 'parts'.
   static const char* async_patch_paths_[];
@@ -46,6 +47,7 @@
   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_[];
 };
 
 }  // namespace dart
diff --git a/runtime/vm/bootstrap_natives.cc b/runtime/vm/bootstrap_natives.cc
index 07c4928..d0bef86 100644
--- a/runtime/vm/bootstrap_natives.cc
+++ b/runtime/vm/bootstrap_natives.cc
@@ -10,6 +10,7 @@
 #include "vm/dart_api_impl.h"
 #include "vm/object.h"
 #include "vm/object_store.h"
+#include "vm/service_isolate.h"
 
 namespace dart {
 
@@ -129,6 +130,11 @@
   ASSERT(!library.IsNull());
   library.set_native_entry_resolver(resolver);
   library.set_native_entry_symbol_resolver(symbol_resolver);
+
+  library = Library::VMServiceLibrary();
+  ASSERT(!library.IsNull());
+  library.set_native_entry_resolver(resolver);
+  library.set_native_entry_symbol_resolver(symbol_resolver);
 }
 
 
diff --git a/runtime/vm/bootstrap_natives.h b/runtime/vm/bootstrap_natives.h
index 0358a00..e416b7f 100644
--- a/runtime/vm/bootstrap_natives.h
+++ b/runtime/vm/bootstrap_natives.h
@@ -70,6 +70,8 @@
   V(Bigint_allocate, 4)                                                        \
   V(Developer_debugger, 2)                                                     \
   V(Developer_inspect, 1)                                                      \
+  V(Developer_lookupExtension, 1)                                              \
+  V(Developer_registerExtension, 2)                                            \
   V(Developer_log, 8)                                                          \
   V(Double_getIsNegative, 1)                                                   \
   V(Double_getIsInfinite, 1)                                                   \
@@ -147,11 +149,16 @@
   V(DateNatives_timeZoneOffsetInSeconds, 1)                                    \
   V(DateNatives_localTimeZoneAdjustmentInSeconds, 0)                           \
   V(AssertionError_throwNew, 2)                                                \
+  V(Async_rethrow, 2)                                                          \
   V(TypeError_throwNew, 5)                                                     \
   V(FallThroughError_throwNew, 1)                                              \
   V(AbstractClassInstantiationError_throwNew, 2)                               \
   V(Stopwatch_now, 0)                                                          \
   V(Stopwatch_frequency, 0)                                                    \
+  V(Timeline_getNextAsyncId, 0)                                                \
+  V(Timeline_getTraceClock, 0)                                                 \
+  V(Timeline_reportCompleteEvent, 5)                                           \
+  V(Timeline_reportTaskEvent, 6)                                               \
   V(TypedData_Int8Array_new, 1)                                                \
   V(TypedData_Uint8Array_new, 1)                                               \
   V(TypedData_Uint8ClampedArray_new, 1)                                        \
@@ -300,7 +307,7 @@
   V(Int32x4_setFlagW, 2)                                                       \
   V(Int32x4_select, 3)                                                         \
   V(Isolate_spawnFunction, 7)                                                  \
-  V(Isolate_spawnUri, 10)                                                      \
+  V(Isolate_spawnUri, 12)                                                      \
   V(Isolate_getPortAndCapabilitiesOfCurrentIsolate, 0)                         \
   V(Isolate_sendOOB, 2)                                                        \
   V(Mirrors_evalInLibraryWithPrivateKey, 2)                                    \
@@ -389,7 +396,12 @@
   V(Profiler_getCurrentTag, 0)                                                 \
   V(ClassID_getID, 1)                                                          \
   V(Num_toString, 1)                                                           \
-
+  V(VMService_SendIsolateServiceMessage, 2)                                    \
+  V(VMService_SendRootServiceMessage, 1)                                       \
+  V(VMService_OnStart, 0)                                                      \
+  V(VMService_OnExit, 0)                                                       \
+  V(VMService_ListenStream, 1)                                                 \
+  V(VMService_CancelStream, 1)                                                 \
 
 class BootstrapNatives : public AllStatic {
  public:
diff --git a/runtime/vm/class_finalizer.cc b/runtime/vm/class_finalizer.cc
index 75b832b..4d8178b 100644
--- a/runtime/vm/class_finalizer.cc
+++ b/runtime/vm/class_finalizer.cc
@@ -9,6 +9,7 @@
 #include "vm/heap.h"
 #include "vm/isolate.h"
 #include "vm/longjump.h"
+#include "vm/log.h"
 #include "vm/object_store.h"
 #include "vm/report.h"
 #include "vm/symbols.h"
@@ -18,7 +19,6 @@
 DEFINE_FLAG(bool, print_classes, false, "Prints details about loaded classes.");
 DEFINE_FLAG(bool, trace_class_finalization, false, "Trace class finalization.");
 DEFINE_FLAG(bool, trace_type_finalization, false, "Trace type finalization.");
-DECLARE_FLAG(bool, supermixin);
 DECLARE_FLAG(bool, use_cha_deopt);
 
 
@@ -115,11 +115,13 @@
 // a) when bootstrap process completes (VerifyBootstrapClasses).
 // b) after the user classes are loaded (dart_api).
 bool ClassFinalizer::ProcessPendingClasses() {
-  Isolate* isolate = Isolate::Current();
+  Thread* thread = Thread::Current();
+  Isolate* isolate = thread->isolate();
   ASSERT(isolate != NULL);
-  HANDLESCOPE(isolate);
+  HANDLESCOPE(thread);
   ObjectStore* object_store = isolate->object_store();
-  const Error& error = Error::Handle(isolate, object_store->sticky_error());
+  const Error& error =
+      Error::Handle(thread->zone(), object_store->sticky_error());
   if (!error.IsNull()) {
     return false;
   }
@@ -166,15 +168,16 @@
 
 // Adds all interfaces of cls into 'collected'. Duplicate entries may occur.
 // No cycles are allowed.
-void ClassFinalizer::CollectInterfaces(const Class& cls,
-                                       const GrowableObjectArray& collected) {
-  const Array& interface_array = Array::Handle(cls.interfaces());
-  AbstractType& interface = AbstractType::Handle();
-  Class& interface_class = Class::Handle();
+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);
+  Class& interface_class = Class::Handle(zone);
   for (intptr_t i = 0; i < interface_array.Length(); i++) {
     interface ^= interface_array.At(i);
     interface_class = interface.type_class();
-    collected.Add(interface_class);
+    collected->Add(&Class::ZoneHandle(zone, interface_class.raw()));
     CollectInterfaces(interface_class, collected);
   }
 }
@@ -335,7 +338,7 @@
 
   // Target is not resolved yet.
   if (FLAG_trace_class_finalization) {
-    OS::Print("Resolving redirecting factory: %s\n",
+    THR_Print("Resolving redirecting factory: %s\n",
               String::Handle(factory.name()).ToCString());
   }
   type ^= FinalizeType(cls, type, kCanonicalize);
@@ -457,7 +460,7 @@
     return;
   }
   if (FLAG_trace_type_finalization) {
-    OS::Print("Resolve type class of '%s'\n",
+    THR_Print("Resolve type class of '%s'\n",
               String::Handle(type.Name()).ToCString());
   }
 
@@ -496,7 +499,7 @@
   }
   ASSERT(type.IsType());
   if (FLAG_trace_type_finalization) {
-    OS::Print("Resolve type '%s'\n", String::Handle(type.Name()).ToCString());
+    THR_Print("Resolve type '%s'\n", String::Handle(type.Name()).ToCString());
   }
   ResolveTypeClass(cls, type);
   if (type.IsMalformed()) {
@@ -521,9 +524,9 @@
 
 void ClassFinalizer::FinalizeTypeParameters(
     const Class& cls,
-    GrowableObjectArray* pending_types) {
+    PendingTypes* pending_types) {
   if (FLAG_trace_type_finalization) {
-    OS::Print("Finalizing type parameters of '%s'\n",
+    THR_Print("Finalizing type parameters of '%s'\n",
               String::Handle(cls.Name()).ToCString());
   }
   if (cls.IsMixinApplication()) {
@@ -559,16 +562,16 @@
 // pending finalization that are mutually recursive with the checked type.
 void ClassFinalizer::CheckRecursiveType(const Class& cls,
                                         const Type& type,
-                                        GrowableObjectArray* pending_types) {
-  Isolate* isolate = Isolate::Current();
+                                        PendingTypes* pending_types) {
+  Zone* zone = Thread::Current()->zone();
   if (FLAG_trace_type_finalization) {
-    OS::Print("Checking recursive type '%s': %s\n",
+    THR_Print("Checking recursive type '%s': %s\n",
               String::Handle(type.Name()).ToCString(),
               type.ToCString());
   }
-  const Class& type_cls = Class::Handle(isolate, type.type_class());
+  const Class& type_cls = Class::Handle(zone, type.type_class());
   const TypeArguments& arguments =
-      TypeArguments::Handle(isolate, type.arguments());
+      TypeArguments::Handle(zone, type.arguments());
   // A type can only be recursive via its type arguments.
   ASSERT(!arguments.IsNull());
   const intptr_t num_type_args = arguments.Length();
@@ -587,13 +590,12 @@
   // The type parameters are not instantiated. Verify that there is no other
   // type pending finalization with the same type class, but different
   // uninstantiated type parameters.
-  Type& pending_type = Type::Handle(isolate);
-  TypeArguments& pending_arguments = TypeArguments::Handle(isolate);
-  const intptr_t num_pending_types = pending_types->Length();
+  TypeArguments& pending_arguments = TypeArguments::Handle(zone);
+  const intptr_t num_pending_types = pending_types->length();
   for (intptr_t i = num_pending_types - 1; i >= 0; i--) {
-    pending_type ^= pending_types->At(i);
+    const Type& pending_type = Type::Cast(pending_types->At(i));
     if (FLAG_trace_type_finalization) {
-      OS::Print("  Comparing with pending type '%s': %s\n",
+      THR_Print("  Comparing with pending type '%s': %s\n",
                 String::Handle(pending_type.Name()).ToCString(),
                 pending_type.ToCString());
     }
@@ -606,7 +608,7 @@
           !pending_arguments.IsSubvectorInstantiated(first_type_param,
                                                      num_type_params)) {
         // Reject the non-contractive recursive type.
-        const String& type_name = String::Handle(isolate, type.Name());
+        const String& type_name = String::Handle(zone, type.Name());
         ReportError(cls, type.token_pos(),
                     "illegal recursive type '%s'", type_name.ToCString());
       }
@@ -653,8 +655,8 @@
     const TypeArguments& arguments,
     intptr_t num_uninitialized_arguments,
     Error* bound_error,
-    GrowableObjectArray* pending_types,
-    GrowableObjectArray* trail) {
+    PendingTypes* pending_types,
+    TrailPtr trail) {
   ASSERT(arguments.Length() >= cls.NumTypeArguments());
   if (!cls.is_type_finalized()) {
     FinalizeTypeParameters(cls, pending_types);
@@ -685,7 +687,7 @@
             ASSERT(super_type_arg.IsType());
             CheckRecursiveType(cls, Type::Cast(super_type_arg), pending_types);
             if (FLAG_trace_type_finalization) {
-              OS::Print("Creating TypeRef '%s': '%s'\n",
+              THR_Print("Creating TypeRef '%s': '%s'\n",
                         String::Handle(super_type_arg.Name()).ToCString(),
                         super_type_arg.ToCString());
             }
@@ -706,15 +708,15 @@
           if (FLAG_trace_type_finalization && super_type_arg.IsTypeRef()) {
             AbstractType& ref_type = AbstractType::Handle(
                 TypeRef::Cast(super_type_arg).type());
-            OS::Print("Instantiating TypeRef '%s': '%s'\n"
+            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(arguments, &error, trail);
+          super_type_arg = super_type_arg.InstantiateFrom(
+              arguments, &error, trail, Heap::kOld);
           if (!error.IsNull()) {
             // InstantiateFrom does not report an error if the type is still
             // uninstantiated. Instead, it will return a new BoundedType so
@@ -816,7 +818,8 @@
       if (declared_bound.IsInstantiated()) {
         instantiated_bound = declared_bound.raw();
       } else {
-        instantiated_bound = declared_bound.InstantiateFrom(arguments, &error);
+        instantiated_bound =
+            declared_bound.InstantiateFrom(arguments, &error, NULL, Heap::kOld);
       }
       if (!instantiated_bound.IsFinalized()) {
         // The bound refers to type parameters, creating a cycle; postpone
@@ -842,8 +845,10 @@
               TypeParameter::Cast(type_arg).bound());
           ResolveType(type_arg_cls, bound);
         }
-        if (!type_param.CheckBound(type_arg, instantiated_bound, &error) &&
-            error.IsNull()) {
+        // 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, 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);
           arguments.SetTypeAt(offset + i, type_arg);
@@ -892,7 +897,7 @@
                            "type '%s' has an out of bound type argument",
                            type_name.ToCString());
     if (FLAG_trace_type_finalization) {
-      OS::Print("Marking type '%s' as malbounded: %s\n",
+      THR_Print("Marking type '%s' as malbounded: %s\n",
                 String::Handle(type.Name()).ToCString(),
                 bound_error.ToCString());
     }
@@ -904,7 +909,7 @@
     const Class& cls,
     const AbstractType& type,
     FinalizationKind finalization,
-    GrowableObjectArray* pending_types) {
+    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));
@@ -935,17 +940,17 @@
     return type.raw();
   }
 
-  Isolate* isolate = Isolate::Current();
+  Zone* Z = Thread::Current()->zone();
   if (FLAG_trace_type_finalization) {
-    OS::Print("Finalizing type '%s' for class '%s'\n",
-              String::Handle(isolate, type.Name()).ToCString(),
+    THR_Print("Finalizing type '%s' for class '%s'\n",
+              String::Handle(Z, type.Name()).ToCString(),
               cls.ToCString());
   }
 
   if (type.IsTypeParameter()) {
     const TypeParameter& type_parameter = TypeParameter::Cast(type);
     const Class& parameterized_class =
-        Class::Handle(isolate, type_parameter.parameterized_class());
+        Class::Handle(Z, type_parameter.parameterized_class());
     ASSERT(!parameterized_class.IsNull());
     // The index must reflect the position of this type parameter in the type
     // arguments vector of its parameterized class. The offset to add is the
@@ -964,8 +969,8 @@
     }
 
     if (FLAG_trace_type_finalization) {
-      OS::Print("Done finalizing type parameter '%s' with index %" Pd "\n",
-                String::Handle(isolate, type_parameter.name()).ToCString(),
+      THR_Print("Done finalizing type parameter '%s' with index %" Pd "\n",
+                String::Handle(Z, type_parameter.name()).ToCString(),
                 type_parameter.index());
     }
 
@@ -979,10 +984,8 @@
   // This type is the root type of the type graph if no pending types queue is
   // allocated yet.
   const bool is_root_type = (pending_types == NULL);
-  GrowableObjectArray& types = GrowableObjectArray::Handle(isolate);
   if (is_root_type) {
-    types = GrowableObjectArray::New();
-    pending_types = &types;
+    pending_types = new PendingTypes(Z, 4);
   }
 
   // The type class does not need to be finalized in order to finalize the type,
@@ -990,7 +993,7 @@
   // the type itself, a precondition to calling FinalizeType).
   // Also, the interfaces of the type class must be resolved and the type
   // parameters of the type class must be finalized.
-  Class& type_class = Class::Handle(isolate, parameterized_type.type_class());
+  Class& type_class = Class::Handle(Z, parameterized_type.type_class());
   if (!type_class.is_type_finalized()) {
     FinalizeTypeParameters(type_class, pending_types);
     ResolveUpperBounds(type_class);
@@ -1006,12 +1009,12 @@
   // Specifying no type arguments indicates a raw type, which is not an error.
   // However, type parameter bounds are checked below, even for a raw type.
   TypeArguments& arguments =
-      TypeArguments::Handle(isolate, parameterized_type.arguments());
+      TypeArguments::Handle(Z, parameterized_type.arguments());
   if (!arguments.IsNull() && (arguments.Length() != num_type_parameters)) {
     // Wrong number of type arguments. The type is mapped to the raw type.
     if (Isolate::Current()->flags().error_on_bad_type()) {
       const String& type_class_name =
-          String::Handle(isolate, type_class.Name());
+          String::Handle(Z, type_class.Name());
       ReportError(cls, parameterized_type.token_pos(),
                   "wrong number of type arguments for class '%s'",
                   type_class_name.ToCString());
@@ -1031,8 +1034,8 @@
   // The full type argument vector consists of the type arguments of the
   // super types of type_class, which are initialized from the parsed
   // type arguments, followed by the parsed type arguments.
-  TypeArguments& full_arguments = TypeArguments::Handle(isolate);
-  Error& bound_error = Error::Handle(isolate);
+  TypeArguments& full_arguments = TypeArguments::Handle(Z);
+  Error& bound_error = Error::Handle(Z);
   if (num_type_arguments > 0) {
     // If no type arguments were parsed and if the super types do not prepend
     // type arguments to the vector, we can leave the vector as null.
@@ -1042,7 +1045,7 @@
       // argument vector.
       const intptr_t offset = num_type_arguments - num_type_parameters;
       AbstractType& type_arg =
-          AbstractType::Handle(isolate, Type::DynamicType());
+          AbstractType::Handle(Z, 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
@@ -1081,20 +1084,19 @@
       // signature function may either be an alias or the enclosing class of a
       // local function, in which case the super type of the enclosing class is
       // also considered when filling up the argument vector.
-      Class& owner_class = Class::Handle(isolate);
+      Class& owner_class = Class::Handle(Z);
       if (type_class.IsSignatureClass()) {
         const Function& signature_fun =
-            Function::Handle(isolate, type_class.signature_function());
+            Function::Handle(Z, type_class.signature_function());
         ASSERT(!signature_fun.is_static());
         owner_class = signature_fun.Owner();
       } else {
         owner_class = type_class.raw();
       }
       if (offset > 0) {
-        GrowableObjectArray& trail =
-            GrowableObjectArray::Handle(isolate, GrowableObjectArray::New());
+        TrailPtr trail = new Trail(Z, 4);
         FinalizeTypeArguments(owner_class, full_arguments, offset,
-                              &bound_error, pending_types, &trail);
+                              &bound_error, pending_types, trail);
       }
       if (full_arguments.IsRaw(0, num_type_arguments)) {
         // The parameterized_type is raw. Set its argument vector to null, which
@@ -1119,13 +1121,11 @@
   // If we are done finalizing a graph of mutually recursive types, check their
   // bounds.
   if (is_root_type) {
-    Type& type = Type::Handle(isolate);
-    for (intptr_t i = types.Length() - 1; i >= 0; i--) {
-      type ^= types.At(i);
-      CheckTypeBounds(cls, type);
+    for (intptr_t i = pending_types->length() - 1; i >= 0; i--) {
+      CheckTypeBounds(cls, Type::Cast(pending_types->At(i)));
       if (FLAG_trace_type_finalization && type.IsRecursive()) {
-        OS::Print("Done finalizing recursive type '%s': %s\n",
-                  String::Handle(isolate, type.Name()).ToCString(),
+        THR_Print("Done finalizing recursive type '%s': %s\n",
+                  String::Handle(Z, type.Name()).ToCString(),
                   type.ToCString());
       }
     }
@@ -1143,8 +1143,8 @@
   }
 
   if (FLAG_trace_type_finalization) {
-    OS::Print("Done finalizing type '%s' with %" Pd " type args: %s\n",
-              String::Handle(isolate, parameterized_type.Name()).ToCString(),
+    THR_Print("Done finalizing type '%s' with %" Pd " type args: %s\n",
+              String::Handle(Z, parameterized_type.Name()).ToCString(),
               parameterized_type.arguments() == TypeArguments::null() ?
                   0 : num_type_arguments,
               parameterized_type.ToCString());
@@ -1152,10 +1152,10 @@
 
   if (finalization >= kCanonicalize) {
     if (FLAG_trace_type_finalization && parameterized_type.IsRecursive()) {
-      AbstractType& type = Type::Handle(isolate);
+      AbstractType& type = Type::Handle(Z);
       type = parameterized_type.Canonicalize();
-      OS::Print("Done canonicalizing recursive type '%s': %s\n",
-                String::Handle(isolate, type.Name()).ToCString(),
+      THR_Print("Done canonicalizing recursive type '%s': %s\n",
+                String::Handle(Z, type.Name()).ToCString(),
                 type.ToCString());
       return type.raw();
     }
@@ -1301,14 +1301,14 @@
   //   instance method.
 
   // Resolve type of fields and check for conflicts in super classes.
-  Isolate* I = Isolate::Current();
-  Array& array = Array::Handle(I, cls.fields());
-  Field& field = Field::Handle(I);
-  AbstractType& type = AbstractType::Handle(I);
-  String& name = String::Handle(I);
-  String& getter_name = String::Handle(I);
-  String& setter_name = String::Handle(I);
-  Class& super_class = Class::Handle(I);
+  Zone* Z = Thread::Current()->zone();
+  Array& array = Array::Handle(Z, cls.fields());
+  Field& field = Field::Handle(Z);
+  AbstractType& type = AbstractType::Handle(Z);
+  String& name = String::Handle(Z);
+  String& getter_name = String::Handle(Z);
+  String& setter_name = String::Handle(Z);
+  Class& super_class = Class::Handle(Z);
   const intptr_t num_fields = array.Length();
   for (intptr_t i = 0; i < num_fields; i++) {
     field ^= array.At(i);
@@ -1320,8 +1320,8 @@
       getter_name = Field::GetterSymbol(name);
       super_class = FindSuperOwnerOfInstanceMember(cls, name, getter_name);
       if (!super_class.IsNull()) {
-        const String& class_name = String::Handle(I, cls.Name());
-        const String& super_class_name = String::Handle(I, super_class.Name());
+        const String& class_name = String::Handle(Z, cls.Name());
+        const String& super_class_name = String::Handle(Z, super_class.Name());
         ReportError(cls, field.token_pos(),
                     "static field '%s' of class '%s' conflicts with "
                     "instance member '%s' of super class '%s'",
@@ -1336,8 +1336,8 @@
       setter_name = Field::SetterSymbol(name);
       super_class = FindSuperOwnerOfFunction(cls, setter_name);
       if (!super_class.IsNull()) {
-        const String& class_name = String::Handle(I, cls.Name());
-        const String& super_class_name = String::Handle(I, super_class.Name());
+        const String& class_name = String::Handle(Z, cls.Name());
+        const String& super_class_name = String::Handle(Z, super_class.Name());
         ReportError(cls, field.token_pos(),
                     "static field '%s' of class '%s' conflicts with "
                     "instance setter '%s=' of super class '%s'",
@@ -1352,8 +1352,8 @@
       // (but not getter).
       super_class = FindSuperOwnerOfFunction(cls, name);
       if (!super_class.IsNull()) {
-        const String& class_name = String::Handle(I, cls.Name());
-        const String& super_class_name = String::Handle(I, super_class.Name());
+        const String& class_name = String::Handle(Z, cls.Name());
+        const String& super_class_name = String::Handle(Z, super_class.Name());
         ReportError(cls, field.token_pos(),
                     "field '%s' of class '%s' conflicts with method '%s' "
                     "of super class '%s'",
@@ -1364,17 +1364,18 @@
       }
     }
     if (field.is_static() &&
-        (field.value() != Object::null()) &&
-        (field.value() != Object::sentinel().raw())) {
+        (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.
-      Error& error = Error::Handle(I);
+      Error& error = Error::Handle(Z);
       if (type.IsMalformedOrMalbounded()) {
         error = type.error();
       } else {
         ASSERT(type.IsInstantiated());
       }
-      const Instance& const_value = Instance::Handle(I, field.value());
+      const Instance& const_value =
+          Instance::Handle(Z, field.StaticValue());
       if (!error.IsNull() ||
           (!type.IsDynamicType() &&
            !const_value.IsInstanceOf(type,
@@ -1382,10 +1383,10 @@
                                      &error))) {
         if (Isolate::Current()->flags().error_on_bad_type()) {
           const AbstractType& const_value_type = AbstractType::Handle(
-              I, const_value.GetType());
+              Z, const_value.GetType());
           const String& const_value_type_name = String::Handle(
-              I, const_value_type.UserVisibleName());
-          const String& type_name = String::Handle(I, type.UserVisibleName());
+              Z, const_value_type.UserVisibleName());
+          const String& type_name = String::Handle(Z, type.UserVisibleName());
           ReportErrors(error, cls, field.token_pos(),
                        "error initializing static %s field '%s': "
                        "type '%s' is not a subtype of type '%s'",
@@ -1403,7 +1404,7 @@
           // we create an implicit static final getter and reset the field value
           // to the sentinel value.
           const Function& getter = Function::Handle(
-              I,
+              Z,
               Function::New(getter_name,
                             RawFunction::kImplicitStaticFinalGetter,
                             /* is_static = */ true,
@@ -1416,29 +1417,28 @@
           getter.set_result_type(type);
           getter.set_is_debuggable(false);
           cls.AddFunction(getter);
-          field.set_value(Instance::Handle(I, Object::sentinel().raw()));
+          field.SetStaticValue(Object::sentinel(), true);
         }
       }
     }
   }
   // Collect interfaces, super interfaces, and super classes of this class.
-  const GrowableObjectArray& interfaces =
-      GrowableObjectArray::Handle(I, GrowableObjectArray::New());
-  CollectInterfaces(cls, interfaces);
+  GrowableArray<const Class*> interfaces(Z, 4);
+  CollectInterfaces(cls, &interfaces);
   // Include superclasses in list of interfaces and super interfaces.
   super_class = cls.SuperClass();
   while (!super_class.IsNull()) {
-    interfaces.Add(super_class);
-    CollectInterfaces(super_class, interfaces);
+    interfaces.Add(&Class::ZoneHandle(Z, super_class.raw()));
+    CollectInterfaces(super_class, &interfaces);
     super_class = super_class.SuperClass();
   }
   // Resolve function signatures and check for conflicts in super classes and
   // interfaces.
   array = cls.functions();
-  Function& function = Function::Handle(I);
-  Function& overridden_function = Function::Handle(I);
+  Function& function = Function::Handle(Z);
+  Function& overridden_function = Function::Handle(Z);
   const intptr_t num_functions = array.Length();
-  Error& error = Error::Handle(I);
+  Error& error = Error::Handle(Z);
   for (intptr_t i = 0; i < num_functions; i++) {
     function ^= array.At(i);
     ResolveAndFinalizeSignature(cls, function);
@@ -1447,18 +1447,18 @@
     if (Isolate::Current()->flags().error_on_bad_override() &&
         !function.is_static() && !function.IsGenerativeConstructor()) {
       // A constructor cannot override anything.
-      for (intptr_t i = 0; i < interfaces.Length(); i++) {
-        super_class ^= interfaces.At(i);
+      for (intptr_t i = 0; i < interfaces.length(); i++) {
+        const Class* super_class = interfaces.At(i);
         // Finalize superclass since overrides check relies on all members
         // of the superclass to be finalized.
-        FinalizeClass(super_class);
-        overridden_function = super_class.LookupDynamicFunction(name);
+        FinalizeClass(*super_class);
+        overridden_function = super_class->LookupDynamicFunction(name);
         if (!overridden_function.IsNull() &&
             !function.HasCompatibleParametersWith(overridden_function,
                                                   &error)) {
-          const String& class_name = String::Handle(I, cls.Name());
+          const String& class_name = String::Handle(Z, cls.Name());
           const String& super_class_name =
-              String::Handle(I, super_class.Name());
+              String::Handle(Z, super_class->Name());
           ReportErrors(error, cls, function.token_pos(),
                        "class '%s' overrides method '%s' of super "
                        "class '%s' with incompatible parameters",
@@ -1472,9 +1472,9 @@
       if (function.is_static()) {
         super_class = FindSuperOwnerOfFunction(cls, name);
         if (!super_class.IsNull()) {
-          const String& class_name = String::Handle(I, cls.Name());
+          const String& class_name = String::Handle(Z, cls.Name());
           const String& super_class_name =
-              String::Handle(I, super_class.Name());
+              String::Handle(Z, super_class.Name());
           ReportError(cls, function.token_pos(),
                       "static setter '%s=' of class '%s' conflicts with "
                       "instance setter '%s=' of super class '%s'",
@@ -1495,8 +1495,8 @@
     if (function.is_static()) {
       super_class = FindSuperOwnerOfInstanceMember(cls, name, getter_name);
       if (!super_class.IsNull()) {
-        const String& class_name = String::Handle(I, cls.Name());
-        const String& super_class_name = String::Handle(I, super_class.Name());
+        const String& class_name = String::Handle(Z, cls.Name());
+        const String& super_class_name = String::Handle(Z, super_class.Name());
         ReportError(cls, function.token_pos(),
                     "static %s '%s' of class '%s' conflicts with "
                     "instance member '%s' of super class '%s'",
@@ -1513,7 +1513,7 @@
         // However, the redirection type should be finalized.
         // If the redirection type is from a deferred library and is not
         // yet loaded, do not attempt to resolve.
-        Type& type = Type::Handle(I, function.RedirectionType());
+        Type& type = Type::Handle(Z, function.RedirectionType());
         if (IsLoaded(type)) {
           type ^= FinalizeType(cls, type, kCanonicalize);
           function.SetRedirectionType(type);
@@ -1523,8 +1523,8 @@
                function.IsImplicitGetterFunction()) {
       super_class = FindSuperOwnerOfFunction(cls, name);
       if (!super_class.IsNull()) {
-        const String& class_name = String::Handle(I, cls.Name());
-        const String& super_class_name = String::Handle(I, super_class.Name());
+        const String& class_name = String::Handle(Z, cls.Name());
+        const String& super_class_name = String::Handle(Z, super_class.Name());
         ReportError(cls, function.token_pos(),
                     "getter '%s' of class '%s' conflicts with "
                     "method '%s' of super class '%s'",
@@ -1539,8 +1539,8 @@
       // have the same name. Thus, we do not need to check setters.
       super_class = FindSuperOwnerOfFunction(cls, getter_name);
       if (!super_class.IsNull()) {
-        const String& class_name = String::Handle(I, cls.Name());
-        const String& super_class_name = String::Handle(I, super_class.Name());
+        const String& class_name = String::Handle(Z, cls.Name());
+        const String& super_class_name = String::Handle(Z, super_class.Name());
         ReportError(cls, function.token_pos(),
                     "method '%s' of class '%s' conflicts with "
                     "getter '%s' of super class '%s'",
@@ -1574,14 +1574,15 @@
 // bound BT on T of M is applied to T of S&M. See comments below.
 void ClassFinalizer::CloneMixinAppTypeParameters(const Class& mixin_app_class) {
   ASSERT(mixin_app_class.type_parameters() == TypeArguments::null());
-  Isolate* isolate = Isolate::Current();
-  const AbstractType& super_type = AbstractType::Handle(isolate,
+  Thread* thread = Thread::Current();
+  Zone* zone = thread->zone();
+  const AbstractType& super_type = AbstractType::Handle(zone,
       mixin_app_class.super_type());
   ASSERT(super_type.IsResolved());
-  const Class& super_class = Class::Handle(isolate, super_type.type_class());
+  const Class& super_class = Class::Handle(zone, super_type.type_class());
   const intptr_t num_super_type_params = super_class.NumTypeParameters();
-  const Type& mixin_type = Type::Handle(isolate, mixin_app_class.mixin());
-  const Class& mixin_class = Class::Handle(isolate, mixin_type.type_class());
+  const Type& mixin_type = Type::Handle(zone, mixin_app_class.mixin());
+  const Class& mixin_class = Class::Handle(zone, mixin_type.type_class());
   const intptr_t num_mixin_type_params = mixin_class.NumTypeParameters();
 
   // The mixin type (in raw form) should have been added to the interfaces
@@ -1594,14 +1595,14 @@
   // If both the super type and the mixin type are non generic, the mixin
   // application class is non generic as well and we can skip type parameter
   // cloning.
-  TypeArguments& instantiator = TypeArguments::Handle(isolate);
+  TypeArguments& instantiator = TypeArguments::Handle(zone);
   if ((num_super_type_params + num_mixin_type_params) > 0) {
     // If the last ampersand in the name of the mixin application class is
     // doubled, the same type parameters can propagate the type arguments to
     // the super type and to the mixin type.
     bool share_type_params = false;
     if (num_super_type_params == num_mixin_type_params) {
-      const String& name = String::Handle(isolate, mixin_app_class.Name());
+      const String& name = String::Handle(zone, mixin_app_class.Name());
       for (intptr_t i = name.Length() - 1; i > 0; --i) {
         if (name.CharAt(i) == '&') {
           if (name.CharAt(i - 1) == '&') {
@@ -1612,13 +1613,13 @@
       }
     }
 
-    const TypeArguments& cloned_type_params = TypeArguments::Handle(isolate,
+    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(isolate);
-    TypeParameter& cloned_param = TypeParameter::Handle(isolate);
-    String& param_name = String::Handle(isolate);
-    AbstractType& param_bound = AbstractType::Handle(isolate);
+    TypeParameter& param = TypeParameter::Handle(zone);
+    TypeParameter& cloned_param = TypeParameter::Handle(zone);
+    String& param_name = String::Handle(zone);
+    AbstractType& param_bound = AbstractType::Handle(zone);
     intptr_t cloned_index = 0;
 
     // First, clone the super class type parameters. Rename them so that
@@ -1626,8 +1627,8 @@
     // class and the mixin class.
     if (!share_type_params && (num_super_type_params > 0)) {
       const TypeArguments& super_type_params =
-          TypeArguments::Handle(isolate, super_class.type_parameters());
-      const TypeArguments& super_type_args = TypeArguments::Handle(isolate,
+          TypeArguments::Handle(zone, super_class.type_parameters());
+      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
@@ -1637,12 +1638,11 @@
       // the super class of its mixin. Note also that the other mixin
       // application will only mixin the last mixin type listed in the first
       // mixin application it is mixing in.
-      param_bound = isolate->object_store()->object_type();
+      param_bound = thread->isolate()->object_store()->object_type();
       for (intptr_t i = 0; i < num_super_type_params; i++) {
         param ^= super_type_params.TypeAt(i);
         param_name = param.name();
-        param_name = String::Concat(param_name, Symbols::Backtick());
-        param_name = Symbols::New(param_name);
+        param_name = Symbols::FromConcat(param_name, Symbols::Backtick());
         cloned_param = TypeParameter::New(mixin_app_class,
                                           cloned_index,
                                           param_name,
@@ -1667,10 +1667,10 @@
     // with that name. We also retain the type parameter bounds.
     if (num_mixin_type_params > 0) {
       const TypeArguments& mixin_params =
-          TypeArguments::Handle(isolate, mixin_class.type_parameters());
+          TypeArguments::Handle(zone, mixin_class.type_parameters());
       const intptr_t offset =
           mixin_class.NumTypeArguments() - mixin_class.NumTypeParameters();
-      const TypeArguments& mixin_type_args = TypeArguments::Handle(isolate,
+      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;
@@ -1702,7 +1702,7 @@
       // is not a problem since they will get finalized shortly as the mixin
       // application class gets finalized.
       if (has_uninstantiated_bounds) {
-        Error& bound_error = Error::Handle(isolate);
+        Error& bound_error = Error::Handle(zone);
         for (intptr_t i = 0; i < num_mixin_type_params; i++) {
           param ^= mixin_type_args.TypeAt(i);
           param_bound = param.bound();
@@ -1823,13 +1823,13 @@
   // If this mixin alias is aliasing another mixin alias, another class
   // will be inserted via recursion. No need to check here.
   // The mixin type may or may not be finalized yet.
-  Isolate* isolate = Isolate::Current();
-  AbstractType& super_type = AbstractType::Handle(isolate,
+  Zone* zone = Thread::Current()->zone();
+  AbstractType& super_type = AbstractType::Handle(zone,
                                                   mixin_app_class.super_type());
-  const Type& mixin_type = Type::Handle(isolate, mixin_app_class.mixin());
-  const Class& mixin_class = Class::Handle(isolate, mixin_type.type_class());
+  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(isolate,
+  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
@@ -1837,26 +1837,26 @@
   // 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(isolate,
+  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(isolate, mixin_app_class.Name());
+  String& inserted_class_name = String::Handle(zone, mixin_app_class.Name());
   inserted_class_name = String::Concat(inserted_class_name,
                                        Symbols::Backtick());
-  const Library& library = Library::Handle(isolate, mixin_app_class.library());
-  Class& inserted_class = Class::Handle(isolate,
+  const Library& library = Library::Handle(zone, mixin_app_class.library());
+  Class& inserted_class = Class::Handle(zone,
       library.LookupLocalClass(inserted_class_name));
   if (inserted_class.IsNull()) {
     inserted_class_name = Symbols::New(inserted_class_name);
-    const Script& script = Script::Handle(isolate, mixin_app_class.script());
+    const Script& script = Script::Handle(zone, mixin_app_class.script());
     inserted_class = Class::New(
         inserted_class_name, script, mixin_app_class.token_pos());
     inserted_class.set_is_synthesized_class();
     library.AddClass(inserted_class);
 
     if (FLAG_trace_class_finalization) {
-      OS::Print("Creating mixin application alias %s\n",
+      THR_Print("Creating mixin application alias %s\n",
                 inserted_class.ToCString());
     }
 
@@ -1874,8 +1874,8 @@
     // 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(isolate,
-        Type::New(Class::Handle(isolate, aliased_mixin_type.type_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()));
     inserted_class.set_mixin(inserted_class_mixin_type);
@@ -1906,33 +1906,33 @@
   // It is important that the type parameters of the mixin application class
   // are not finalized yet, because new type parameters may have been added
   // to the super class.
-  const Class& super_class = Class::Handle(isolate, super_type.type_class());
+  const Class& super_class = Class::Handle(zone, super_type.type_class());
   ASSERT(mixin_app_class.SuperClass() == super_class.raw());  // Will change.
   const intptr_t num_super_type_params = super_class.NumTypeParameters();
-  AbstractType& type = AbstractType::Handle(isolate);
+  AbstractType& type = AbstractType::Handle(zone);
   // The instantiator is mapping finalized type parameters of mixin_class to
   // unfinalized type parameters of mixin_app_class.
   ASSERT(aliased_mixin_type.IsFinalized());
-  const Class& aliased_mixin_type_class = Class::Handle(isolate,
+  const Class& aliased_mixin_type_class = Class::Handle(zone,
       aliased_mixin_type.type_class());
   const intptr_t num_aliased_mixin_type_params =
       aliased_mixin_type_class.NumTypeParameters();
   ASSERT(inserted_class.NumTypeParameters() ==
          (num_super_type_params + num_aliased_mixin_type_params));
   const AbstractType& mixin_class_super_type =
-      AbstractType::Handle(isolate, mixin_class.super_type());
+      AbstractType::Handle(zone, mixin_class.super_type());
   ASSERT(mixin_class_super_type.IsFinalized());
   // The aliased_mixin_type may be raw.
   const TypeArguments& mixin_class_super_type_args =
-      TypeArguments::Handle(isolate, mixin_class_super_type.arguments());
-  TypeArguments& new_mixin_type_args = TypeArguments::Handle(isolate);
+      TypeArguments::Handle(zone, mixin_class_super_type.arguments());
+  TypeArguments& new_mixin_type_args = TypeArguments::Handle(zone);
   if ((num_aliased_mixin_type_params > 0) &&
       !mixin_class_super_type_args.IsNull()) {
     new_mixin_type_args = TypeArguments::New(num_aliased_mixin_type_params);
-    AbstractType& bounded_type = AbstractType::Handle(isolate);
-    AbstractType& upper_bound = AbstractType::Handle(isolate);
-    TypeParameter& type_parameter = TypeParameter::Handle(isolate);
-    Error& bound_error = Error::Handle(isolate);
+    AbstractType& bounded_type = AbstractType::Handle(zone);
+    AbstractType& upper_bound = AbstractType::Handle(zone);
+    TypeParameter& type_parameter = TypeParameter::Handle(zone);
+    Error& bound_error = Error::Handle(zone);
     const intptr_t offset =
         mixin_class_super_type_args.Length() - num_aliased_mixin_type_params;
     for (intptr_t i = 0; i < num_aliased_mixin_type_params; i++) {
@@ -1962,12 +1962,12 @@
       new_mixin_type_args.SetTypeAt(i, type);
     }
   }
-  TypeArguments& new_super_type_args = TypeArguments::Handle(isolate);
+  TypeArguments& new_super_type_args = TypeArguments::Handle(zone);
   if ((num_super_type_params + num_aliased_mixin_type_params) > 0) {
     new_super_type_args = TypeArguments::New(num_super_type_params +
                                              num_aliased_mixin_type_params);
     const TypeArguments& type_params =
-        TypeArguments::Handle(isolate, mixin_app_class.type_parameters());
+        TypeArguments::Handle(zone, mixin_app_class.type_parameters());
     for (intptr_t i = 0; i < num_super_type_params; i++) {
       type = type_params.TypeAt(i);
       new_super_type_args.SetTypeAt(i, type);
@@ -1991,13 +1991,13 @@
   ASSERT(!mixin_app_class.is_type_finalized());
   ASSERT(!mixin_app_class.is_mixin_type_applied());
   if (FLAG_trace_class_finalization) {
-    OS::Print("Inserting class '%s' %s\n"
+    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(isolate, super_type.Name()).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(),
@@ -2008,7 +2008,7 @@
 
 
 void ClassFinalizer::ApplyMixinType(const Class& mixin_app_class,
-                                    GrowableObjectArray* pending_types) {
+                                    PendingTypes* pending_types) {
   if (mixin_app_class.is_mixin_type_applied()) {
     return;
   }
@@ -2018,7 +2018,7 @@
   const Class& mixin_class = Class::Handle(mixin_type.type_class());
 
   if (FLAG_trace_class_finalization) {
-    OS::Print("Applying mixin type '%s' to %s at pos %" Pd "\n",
+    THR_Print("Applying mixin type '%s' to %s at pos %" Pd "\n",
               String::Handle(mixin_type.Name()).ToCString(),
               mixin_app_class.ToCString(),
               mixin_app_class.token_pos());
@@ -2033,25 +2033,6 @@
                 class_name.ToCString());
   }
 
-  if (!FLAG_supermixin) {
-    // Check that the super class of the mixin class is class Object.
-    Class& mixin_super_class = Class::Handle(mixin_class.SuperClass());
-    // Skip over mixin application alias classes, which are implemented as
-    // subclasses of the mixin application classes they name.
-    if (!mixin_super_class.IsNull() && mixin_class.is_mixin_app_alias()) {
-      while (mixin_super_class.is_mixin_app_alias()) {
-        mixin_super_class = mixin_super_class.SuperClass();
-      }
-      mixin_super_class = mixin_super_class.SuperClass();
-    }
-    if (mixin_super_class.IsNull() || !mixin_super_class.IsObjectClass()) {
-      const String& class_name = String::Handle(mixin_class.Name());
-      ReportError(mixin_app_class, mixin_app_class.token_pos(),
-                  "mixin class '%s' must extend class 'Object'",
-                  class_name.ToCString());
-    }
-  }
-
   // Copy type parameters to mixin application class.
   CloneMixinAppTypeParameters(mixin_app_class);
 
@@ -2061,7 +2042,7 @@
   ResolveSuperTypeAndInterfaces(mixin_app_class, &visited_interfaces);
 
   if (FLAG_trace_class_finalization) {
-    OS::Print("Done applying mixin type '%s' to class '%s' %s extending '%s'\n",
+    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(
@@ -2103,11 +2084,10 @@
       const String& ctor_name = String::Handle(func.name());
       String& clone_name = String::Handle(
           String::SubString(ctor_name, super_name.Length()));
-      clone_name = String::Concat(mixin_name, clone_name);
-      clone_name = Symbols::New(clone_name);
+      clone_name = Symbols::FromConcat(mixin_name, clone_name);
 
       if (FLAG_trace_class_finalization) {
-        OS::Print("Cloning constructor '%s' as '%s'\n",
+        THR_Print("Cloning constructor '%s' as '%s'\n",
                   ctor_name.ToCString(),
                   clone_name.ToCString());
       }
@@ -2146,11 +2126,11 @@
 
 
 void ClassFinalizer::ApplyMixinMembers(const Class& cls) {
-  Isolate* isolate = Isolate::Current();
-  const Type& mixin_type = Type::Handle(isolate, cls.mixin());
+  Zone* zone = Thread::Current()->zone();
+  const Type& mixin_type = Type::Handle(zone, cls.mixin());
   ASSERT(!mixin_type.IsNull());
   ASSERT(mixin_type.HasResolvedTypeClass());
-  const Class& mixin_cls = Class::Handle(isolate, mixin_type.type_class());
+  const Class& mixin_cls = Class::Handle(zone, mixin_type.type_class());
   FinalizeClass(mixin_cls);
   // If the mixin is a mixin application alias class, there are no members to
   // apply here. A new synthesized class representing the aliased mixin
@@ -2158,23 +2138,23 @@
   // class. Members of the actual mixin class will be applied when visiting
   // the mixin application class referring to the actual mixin.
   ASSERT(!mixin_cls.is_mixin_app_alias() ||
-         Class::Handle(isolate, cls.SuperClass()).IsMixinApplication());
+         Class::Handle(zone, cls.SuperClass()).IsMixinApplication());
   // A default constructor will be created for the mixin app alias class.
 
   if (FLAG_trace_class_finalization) {
-    OS::Print("Applying mixin members of %s to %s at pos %" Pd "\n",
+    THR_Print("Applying mixin members of %s to %s at pos %" Pd "\n",
               mixin_cls.ToCString(),
               cls.ToCString(),
               cls.token_pos());
   }
 
   const GrowableObjectArray& cloned_funcs =
-      GrowableObjectArray::Handle(isolate, GrowableObjectArray::New());
+      GrowableObjectArray::Handle(zone, GrowableObjectArray::New());
 
   CreateForwardingConstructors(cls, cloned_funcs);
 
-  Array& functions = Array::Handle(isolate);
-  Function& func = Function::Handle(isolate);
+  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));
   // Now clone the functions from the mixin class.
@@ -2187,7 +2167,7 @@
       if (!func.IsImplicitConstructor()) {
         ReportError(cls, cls.token_pos(),
                     "mixin class '%s' must not have constructors\n",
-                    String::Handle(isolate, mixin_cls.Name()).ToCString());
+                    String::Handle(zone, mixin_cls.Name()).ToCString());
       }
       continue;  // Skip the implicit constructor.
     }
@@ -2205,24 +2185,23 @@
   // Now clone the fields from the mixin class. There should be no
   // existing fields in the mixin application class.
   ASSERT(Array::Handle(cls.fields()).Length() == 0);
-  const Array& fields = Array::Handle(isolate, mixin_cls.fields());
-  Field& field = Field::Handle(isolate);
-  const GrowableObjectArray& cloned_fields =
-      GrowableObjectArray::Handle(isolate, GrowableObjectArray::New());
+  const Array& fields = Array::Handle(zone, mixin_cls.fields());
   const intptr_t num_fields = fields.Length();
+  Field& field = Field::Handle(zone);
+  GrowableArray<const Field*> cloned_fields(num_fields);
   for (intptr_t i = 0; i < num_fields; i++) {
     field ^= fields.At(i);
     // Static fields are shared between the mixin class and the mixin
     // application class.
     if (!field.is_static()) {
-      field = field.Clone(cls);
-      cloned_fields.Add(field);
+      const Field& cloned = Field::ZoneHandle(zone, field.Clone(cls));
+      cloned_fields.Add(&cloned);
     }
   }
   cls.AddFields(cloned_fields);
 
   if (FLAG_trace_class_finalization) {
-    OS::Print("Done applying mixin members of %s to %s\n",
+    THR_Print("Done applying mixin members of %s to %s\n",
               mixin_cls.ToCString(),
               cls.ToCString());
   }
@@ -2230,12 +2209,13 @@
 
 
 void ClassFinalizer::FinalizeTypesInClass(const Class& cls) {
-  HANDLESCOPE(Isolate::Current());
+  Thread* thread = Thread::Current();
+  HANDLESCOPE(thread);
   if (cls.is_type_finalized()) {
     return;
   }
   if (FLAG_trace_class_finalization) {
-    OS::Print("Finalize types in %s\n", cls.ToCString());
+    THR_Print("Finalize types in %s\n", cls.ToCString());
   }
   if (!IsSuperCycleFree(cls)) {
     const String& name = String::Handle(cls.Name());
@@ -2363,12 +2343,13 @@
 
 
 void ClassFinalizer::FinalizeClass(const Class& cls) {
-  HANDLESCOPE(Isolate::Current());
+  Thread* thread = Thread::Current();
+  HANDLESCOPE(thread);
   if (cls.is_finalized()) {
     return;
   }
   if (FLAG_trace_class_finalization) {
-    OS::Print("Finalize %s\n", cls.ToCString());
+    THR_Print("Finalize %s\n", cls.ToCString());
   }
   if (cls.is_patch()) {
     // The fields and functions of a patch class are copied to the
@@ -2436,8 +2417,9 @@
   const Field& values_field =
       Field::Handle(enum_cls.LookupStaticField(Symbols::Values()));
   ASSERT(!values_field.IsNull());
-  ASSERT(Instance::Handle(values_field.value()).IsArray());
-  Array& values_list = Array::Handle(Array::RawCast(values_field.value()));
+  ASSERT(Instance::Handle(values_field.StaticValue()).IsArray());
+  Array& values_list = Array::Handle(
+      Array::RawCast(values_field.StaticValue()));
 
   const Array& fields = Array::Handle(enum_cls.fields());
   Field& field = Field::Handle();
@@ -2447,7 +2429,7 @@
   for (intptr_t i = 0; i < fields.Length(); i++) {
     field = Field::RawCast(fields.At(i));
     if (!field.is_static()) continue;
-    ordinal_value = field.value();
+    ordinal_value = field.StaticValue();
     // The static fields that need to be initialized with enum instances
     // contain the smi value of the ordinal number, which was stored in
     // the field by the parser. Other fields contain non-smi values.
@@ -2461,7 +2443,7 @@
       UNREACHABLE();
     }
     ASSERT(enum_value.IsCanonical());
-    field.set_value(enum_value);
+    field.SetStaticValue(enum_value, true);
     field.RecordStore(enum_value);
     intptr_t ord = Smi::Cast(ordinal_value).Value();
     ASSERT(ord < values_list.Length());
@@ -2647,27 +2629,27 @@
     const MixinAppType& mixin_app_type) {
   // Lookup or create mixin application classes in the library of cls
   // and resolve super type and mixin types.
-  Isolate* isolate = Isolate::Current();
-  const Library& library = Library::Handle(isolate, cls.library());
+  Zone* zone = Thread::Current()->zone();
+  const Library& library = Library::Handle(zone, cls.library());
   ASSERT(!library.IsNull());
-  const Script& script = Script::Handle(isolate, cls.script());
+  const Script& script = Script::Handle(zone, cls.script());
   ASSERT(!script.IsNull());
   const GrowableObjectArray& type_args =
-      GrowableObjectArray::Handle(isolate, GrowableObjectArray::New());
+      GrowableObjectArray::Handle(zone, GrowableObjectArray::New());
   AbstractType& mixin_super_type =
-      AbstractType::Handle(isolate, mixin_app_type.super_type());
+      AbstractType::Handle(zone, mixin_app_type.super_type());
   ResolveType(cls, mixin_super_type);
   ASSERT(mixin_super_type.HasResolvedTypeClass());  // Even if malformed.
   // 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(isolate);
-  Class& mixin_type_class = Class::Handle(isolate);
-  Class& mixin_app_class = Class::Handle(isolate);
-  String& mixin_app_class_name = String::Handle(isolate);
-  String& mixin_type_class_name = String::Handle(isolate);
-  AbstractType& super_type_arg = AbstractType::Handle(isolate);
-  AbstractType& mixin_type_arg = AbstractType::Handle(isolate);
+  AbstractType& mixin_type = AbstractType::Handle(zone);
+  Class& mixin_type_class = Class::Handle(zone);
+  Class& mixin_app_class = Class::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);
   const intptr_t depth = mixin_app_type.Depth();
   for (intptr_t i = 0; i < depth; i++) {
     mixin_type = mixin_app_type.MixinTypeAt(i);
@@ -2722,7 +2704,7 @@
                                    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(isolate,
+      const Type& generic_mixin_type = Type::Handle(zone,
           Type::New(mixin_type_class,
                     Object::null_type_arguments(),
                     mixin_type.token_pos()));
@@ -2730,7 +2712,7 @@
       // 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(isolate, Array::New(1));
+      const Array& interfaces = Array::Handle(zone, Array::New(1));
       interfaces.SetAt(0, generic_mixin_type);
       ASSERT(mixin_app_class.interfaces() == Object::empty_array().raw());
       mixin_app_class.set_interfaces(interfaces);
@@ -2741,7 +2723,7 @@
       // processed via the super_type chain of a pending class.
 
       if (FLAG_trace_class_finalization) {
-        OS::Print("Creating mixin application %s\n",
+        THR_Print("Creating mixin application %s\n",
                   mixin_app_class.ToCString());
       }
     }
@@ -2752,17 +2734,17 @@
                                  Object::null_type_arguments(),
                                  mixin_type.token_pos());
   }
-  TypeArguments& mixin_app_args = TypeArguments::Handle(isolate);
+  TypeArguments& mixin_app_args = TypeArguments::Handle(zone);
   if (type_args.Length() > 0) {
     mixin_app_args = TypeArguments::New(type_args.Length());
-    AbstractType& type_arg = AbstractType::Handle(isolate);
+    AbstractType& type_arg = AbstractType::Handle(zone);
     for (intptr_t i = 0; i < type_args.Length(); i++) {
       type_arg ^= type_args.At(i);
       mixin_app_args.SetTypeAt(i, type_arg);
     }
   }
   if (FLAG_trace_class_finalization) {
-    OS::Print("ResolveMixinAppType: mixin appl type args: %s\n",
+    THR_Print("ResolveMixinAppType: mixin appl type args: %s\n",
               mixin_app_args.ToCString());
   }
   // The mixin application class at depth k is a subclass of mixin application
@@ -2789,14 +2771,14 @@
   }
   ASSERT(visited != NULL);
   if (FLAG_trace_class_finalization) {
-    OS::Print("Resolving super and interfaces: %s\n", cls.ToCString());
+    THR_Print("Resolving super and interfaces: %s\n", cls.ToCString());
   }
-  Isolate* isolate = Isolate::Current();
+  Zone* zone = Thread::Current()->zone();
   const intptr_t cls_index = cls.id();
   for (intptr_t i = 0; i < visited->length(); i++) {
     if ((*visited)[i] == cls_index) {
       // We have already visited class 'cls'. We found a cycle.
-      const String& class_name = String::Handle(isolate, cls.Name());
+      const String& class_name = String::Handle(zone, cls.Name());
       ReportError(cls, cls.token_pos(),
                   "cyclic reference found for class '%s'",
                   class_name.ToCString());
@@ -2805,8 +2787,8 @@
 
   // If the class/interface has no explicit super class/interfaces
   // and is not a mixin application, we are done.
-  AbstractType& super_type = AbstractType::Handle(isolate, cls.super_type());
-  Array& super_interfaces = Array::Handle(isolate, cls.interfaces());
+  AbstractType& super_type = AbstractType::Handle(zone, cls.super_type());
+  Array& super_interfaces = Array::Handle(zone, cls.interfaces());
   if ((super_type.IsNull() || super_type.IsObjectType()) &&
       (super_interfaces.Length() == 0)) {
     cls.set_is_cycle_free();
@@ -2829,32 +2811,32 @@
 
   // Resolve and check the super type and interfaces of cls.
   visited->Add(cls_index);
-  AbstractType& interface = AbstractType::Handle(isolate);
-  Class& interface_class = Class::Handle(isolate);
+  AbstractType& interface = AbstractType::Handle(zone);
+  Class& interface_class = Class::Handle(zone);
 
   // Resolve super type. Failures lead to a longjmp.
   ResolveType(cls, super_type);
   if (super_type.IsMalformedOrMalbounded()) {
-    ReportError(Error::Handle(isolate, super_type.error()));
+    ReportError(Error::Handle(zone, super_type.error()));
   }
   if (super_type.IsDynamicType()) {
     ReportError(cls, cls.token_pos(),
                 "class '%s' may not extend 'dynamic'",
-                String::Handle(isolate, cls.Name()).ToCString());
+                String::Handle(zone, cls.Name()).ToCString());
   }
   interface_class = super_type.type_class();
   if (interface_class.IsSignatureClass()) {
     ReportError(cls, cls.token_pos(),
                 "class '%s' may not extend function type alias '%s'",
-                String::Handle(isolate, cls.Name()).ToCString(),
-                String::Handle(isolate,
+                String::Handle(zone, cls.Name()).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'",
-                String::Handle(isolate, cls.Name()).ToCString(),
-                String::Handle(isolate, interface_class.Name()).ToCString());
+                String::Handle(zone, cls.Name()).ToCString(),
+                String::Handle(zone, interface_class.Name()).ToCString());
   }
 
   // If cls belongs to core lib or to core lib's implementation, restrictions
@@ -2899,11 +2881,11 @@
       }
     }
     if (is_error) {
-      const String& interface_name = String::Handle(isolate,
+      const String& interface_name = String::Handle(zone,
                                                     interface_class.Name());
       ReportError(cls, cls.token_pos(),
                   "'%s' is not allowed to extend '%s'",
-                  String::Handle(isolate, cls.Name()).ToCString(),
+                  String::Handle(zone, cls.Name()).ToCString(),
                   interface_name.ToCString());
     }
   }
@@ -2917,7 +2899,7 @@
     ASSERT(!interface.IsTypeParameter());  // Should be detected by parser.
     // A malbounded interface is only reported when involved in a type test.
     if (interface.IsMalformed()) {
-      ReportError(Error::Handle(isolate, interface.error()));
+      ReportError(Error::Handle(zone, interface.error()));
     }
     if (interface.IsDynamicType()) {
       ReportError(cls, cls.token_pos(),
@@ -2925,14 +2907,14 @@
     }
     interface_class = interface.type_class();
     if (interface_class.IsSignatureClass()) {
-      const String& interface_name = String::Handle(isolate,
+      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(isolate,
+      const String& interface_name = String::Handle(zone,
                                                     interface_class.Name());
       ReportError(cls, cls.token_pos(),
                   "enum '%s' may not be used as interface",
@@ -2948,7 +2930,7 @@
           interface.IsDoubleType() ||
           interface.IsStringType() ||
           interface.IsDynamicType()) {
-        const String& interface_name = String::Handle(isolate,
+        const String& interface_name = String::Handle(zone,
                                                       interface_class.Name());
         if (cls.IsMixinApplication()) {
           ReportError(cls, cls.token_pos(),
@@ -2957,7 +2939,7 @@
         } else {
           ReportError(cls, cls.token_pos(),
                       "'%s' is not allowed to extend or implement '%s'",
-                      String::Handle(isolate, cls.Name()).ToCString(),
+                      String::Handle(zone, cls.Name()).ToCString(),
                       interface_name.ToCString());
         }
       }
@@ -2993,48 +2975,49 @@
 
 
 void ClassFinalizer::PrintClassInformation(const Class& cls) {
-  HANDLESCOPE(Isolate::Current());
+  Thread* thread = Thread::Current();
+  HANDLESCOPE(thread);
   const String& class_name = String::Handle(cls.Name());
-  OS::Print("class '%s'", class_name.ToCString());
+  THR_Print("class '%s'", class_name.ToCString());
   const Library& library = Library::Handle(cls.library());
   if (!library.IsNull()) {
-    OS::Print(" library '%s%s':\n",
+    THR_Print(" library '%s%s':\n",
               String::Handle(library.url()).ToCString(),
               String::Handle(library.private_key()).ToCString());
   } else {
-    OS::Print(" (null library):\n");
+    THR_Print(" (null library):\n");
   }
   const AbstractType& super_type = AbstractType::Handle(cls.super_type());
   if (super_type.IsNull()) {
-    OS::Print("  Super: NULL");
+    THR_Print("  Super: NULL");
   } else {
     const String& super_name = String::Handle(super_type.Name());
-    OS::Print("  Super: %s", super_name.ToCString());
+    THR_Print("  Super: %s", super_name.ToCString());
   }
   const Array& interfaces_array = Array::Handle(cls.interfaces());
   if (interfaces_array.Length() > 0) {
-    OS::Print("; interfaces: ");
+    THR_Print("; interfaces: ");
     AbstractType& interface = AbstractType::Handle();
     intptr_t len = interfaces_array.Length();
     for (intptr_t i = 0; i < len; i++) {
       interface ^= interfaces_array.At(i);
-      OS::Print("  %s ", interface.ToCString());
+      THR_Print("  %s ", interface.ToCString());
     }
   }
-  OS::Print("\n");
+  THR_Print("\n");
   const Array& functions_array = Array::Handle(cls.functions());
   Function& function = Function::Handle();
   intptr_t len = functions_array.Length();
   for (intptr_t i = 0; i < len; i++) {
     function ^= functions_array.At(i);
-    OS::Print("  %s\n", function.ToCString());
+    THR_Print("  %s\n", function.ToCString());
   }
   const Array& fields_array = Array::Handle(cls.fields());
   Field& field = Field::Handle();
   len = fields_array.Length();
   for (intptr_t i = 0; i < len; i++) {
     field ^= fields_array.At(i);
-    OS::Print("  %s\n", field.ToCString());
+    THR_Print("  %s\n", field.ToCString());
   }
 }
 
@@ -3155,21 +3138,23 @@
 
 void ClassFinalizer::VerifyImplicitFieldOffsets() {
 #ifdef DEBUG
-  Isolate* isolate = Isolate::Current();
+  Thread* thread = Thread::Current();
+  Isolate* isolate = thread->isolate();
+  Zone* zone = thread->zone();
   const ClassTable& class_table = *(isolate->class_table());
-  Class& cls = Class::Handle(isolate);
-  Array& fields_array = Array::Handle(isolate);
-  Field& field = Field::Handle(isolate);
-  String& name = String::Handle(isolate);
-  String& expected_name = String::Handle(isolate);
-  Error& error = Error::Handle(isolate);
+  Class& cls = Class::Handle(zone);
+  Array& fields_array = Array::Handle(zone);
+  Field& field = Field::Handle(zone);
+  String& name = String::Handle(zone);
+  String& expected_name = String::Handle(zone);
+  Error& error = Error::Handle(zone);
 
   // First verify field offsets of all the TypedDataView classes.
   for (intptr_t cid = kTypedDataInt8ArrayViewCid;
        cid <= kTypedDataFloat32x4ArrayViewCid;
        cid++) {
     cls = class_table.At(cid);  // Get the TypedDataView class.
-    error = cls.EnsureIsFinalized(isolate);
+    error = cls.EnsureIsFinalized(thread);
     ASSERT(error.IsNull());
     cls = cls.SuperClass();  // Get it's super class '_TypedListView'.
     cls = cls.SuperClass();
@@ -3192,7 +3177,7 @@
 
   // Now verify field offsets of '_ByteDataView' class.
   cls = class_table.At(kByteDataViewCid);
-  error = cls.EnsureIsFinalized(isolate);
+  error = cls.EnsureIsFinalized(thread);
   ASSERT(error.IsNull());
   fields_array ^= cls.fields();
   ASSERT(fields_array.Length() == TypedDataView::NumberOfFields());
@@ -3213,7 +3198,7 @@
 
   // Now verify field offsets of '_ByteBuffer' class.
   cls = class_table.At(kByteBufferCid);
-  error = cls.EnsureIsFinalized(isolate);
+  error = cls.EnsureIsFinalized(thread);
   ASSERT(error.IsNull());
   fields_array ^= cls.fields();
   ASSERT(fields_array.Length() == ByteBuffer::NumberOfFields());
diff --git a/runtime/vm/class_finalizer.h b/runtime/vm/class_finalizer.h
index de8cdde..0b8d7c5 100644
--- a/runtime/vm/class_finalizer.h
+++ b/runtime/vm/class_finalizer.h
@@ -7,27 +7,16 @@
 
 #include "vm/allocation.h"
 #include "vm/growable_array.h"
+#include "vm/object.h"
 
 namespace dart {
 
-class AbstractType;
-class Class;
-class Error;
-class Function;
-class GrowableObjectArray;
-class MixinAppType;
-class RawAbstractType;
-class RawClass;
-class RawType;
-class Script;
-class Type;
-class TypeArguments;
-class UnresolvedClass;
-
 // Traverses all pending, unfinalized classes, validates and marks them as
 // finalized.
 class ClassFinalizer : public AllStatic {
  public:
+  typedef ZoneGrowableHandlePtrArray<const AbstractType> PendingTypes;
+
   // Modes for type resolution and finalization. The ordering is relevant.
   enum FinalizationKind {
     kIgnore,                   // Type is ignored and replaced by dynamic.
@@ -45,7 +34,7 @@
       const Class& cls,
       const AbstractType& type,
       FinalizationKind finalization,
-      GrowableObjectArray* pending_types = NULL);
+      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.
@@ -108,7 +97,7 @@
 
   // Apply the mixin type to the mixin application class.
   static void ApplyMixinType(const Class& mixin_app_class,
-                             GrowableObjectArray* pending_types = NULL);
+                             PendingTypes* pending_types = NULL);
 
  private:
   static void AllocateEnumValues(const Class& enum_cls);
@@ -143,16 +132,16 @@
   static void ResolveSuperTypeAndInterfaces(const Class& cls,
                                             GrowableArray<intptr_t>* visited);
   static void FinalizeTypeParameters(const Class& cls,
-                                     GrowableObjectArray* pending_types = NULL);
+                                     PendingTypes* pending_types = NULL);
   static void FinalizeTypeArguments(const Class& cls,
                                     const TypeArguments& arguments,
                                     intptr_t num_uninitialized_arguments,
                                     Error* bound_error,
-                                    GrowableObjectArray* pending_types,
-                                    GrowableObjectArray* trail);
+                                    PendingTypes* pending_types,
+                                    TrailPtr trail);
   static void CheckRecursiveType(const Class& cls,
                                  const Type& type,
-                                 GrowableObjectArray* pending_types);
+                                 PendingTypes* pending_types);
   static void CheckTypeBounds(const Class& cls, const Type& type);
   static void CheckTypeArgumentBounds(const Class& cls,
                                       const TypeArguments& arguments,
@@ -163,8 +152,9 @@
                                           const Function& function);
   static void ResolveAndFinalizeMemberTypes(const Class& cls);
   static void PrintClassInformation(const Class& cls);
-  static void CollectInterfaces(const Class& cls,
-                                const GrowableObjectArray& interfaces);
+  static void CollectInterfaces(
+      const Class& cls, GrowableArray<const Class*>* collected);
+
   static void MarkTypeMalformed(const Error& prev_error,
                                 const Script& script,
                                 const Type& type,
diff --git a/runtime/vm/class_finalizer_test.cc b/runtime/vm/class_finalizer_test.cc
index 648ab6e..828ecac 100644
--- a/runtime/vm/class_finalizer_test.cc
+++ b/runtime/vm/class_finalizer_test.cc
@@ -23,10 +23,11 @@
 
 
 TEST_CASE(ClassFinalizer) {
-  Isolate* isolate = Isolate::Current();
+  Zone* zone = thread->zone();
+  Isolate* isolate = thread->isolate();
   ObjectStore* object_store = isolate->object_store();
   const GrowableObjectArray& pending_classes =
-      GrowableObjectArray::Handle(isolate, object_store->pending_classes());
+      GrowableObjectArray::Handle(zone, object_store->pending_classes());
   GrowableArray<const Class*> classes_1;
   classes_1.Add(&Class::Handle(CreateTestClass("BMW")));
   pending_classes.Add(*classes_1[0]);
@@ -53,10 +54,11 @@
 
 
 TEST_CASE(ClassFinalize_Cycles) {
-  Isolate* isolate = Isolate::Current();
+  Zone* zone = thread->zone();
+  Isolate* isolate = thread->isolate();
   ObjectStore* object_store = isolate->object_store();
   const GrowableObjectArray& pending_classes =
-      GrowableObjectArray::Handle(isolate, object_store->pending_classes());
+      GrowableObjectArray::Handle(zone, object_store->pending_classes());
   GrowableArray<const Class*> classes;
   classes.Add(&Class::Handle(CreateTestClass("Jungfrau")));
   pending_classes.Add(*classes[0]);
@@ -78,10 +80,11 @@
 
 
 TEST_CASE(ClassFinalize_Resolve) {
-  Isolate* isolate = Isolate::Current();
+  Zone* zone = thread->zone();
+  Isolate* isolate = thread->isolate();
   ObjectStore* object_store = isolate->object_store();
   const GrowableObjectArray& pending_classes =
-      GrowableObjectArray::Handle(isolate, object_store->pending_classes());
+      GrowableObjectArray::Handle(zone, object_store->pending_classes());
   Class& rhb = Class::Handle(CreateTestClass("RhB"));
   pending_classes.Add(rhb);
   Class& sbb = Class::Handle(CreateTestClass("SBB"));
diff --git a/runtime/vm/class_table.cc b/runtime/vm/class_table.cc
index e57178c..ea37920 100644
--- a/runtime/vm/class_table.cc
+++ b/runtime/vm/class_table.cc
@@ -520,11 +520,12 @@
 }
 
 
-void ClassTable::UpdateLiveOld(intptr_t cid, intptr_t size) {
+void ClassTable::UpdateLiveOld(intptr_t cid, intptr_t size, intptr_t count) {
   ClassHeapStats* stats = PreliminaryStatsAt(cid);
   ASSERT(stats != NULL);
   ASSERT(size >= 0);
-  stats->post_gc.AddOld(size);
+  ASSERT(count >= 0);
+  stats->post_gc.AddOld(size, count);
 }
 
 
diff --git a/runtime/vm/class_table.h b/runtime/vm/class_table.h
index d7917de..aaabdf4 100644
--- a/runtime/vm/class_table.h
+++ b/runtime/vm/class_table.h
@@ -43,8 +43,8 @@
     old_size = 0;
   }
 
-  void AddOld(T size) {
-    old_count++;
+  void AddOld(T size, T count = 1) {
+    old_count += count;
     old_size += size;
   }
 
@@ -222,7 +222,7 @@
   bool TraceAllocationFor(intptr_t cid);
 
  private:
-  friend class MarkingVisitor;
+  friend class GCMarker;
   friend class ScavengerVisitor;
   friend class ClassHeapStatsTestHelper;
   static const int initial_capacity_ = 512;
@@ -243,7 +243,7 @@
 
   // May not have updated size for variable size classes.
   ClassHeapStats* PreliminaryStatsAt(intptr_t cid);
-  void UpdateLiveOld(intptr_t cid, intptr_t size);
+  void UpdateLiveOld(intptr_t cid, intptr_t size, intptr_t count = 1);
   void UpdateLiveNew(intptr_t cid, intptr_t size);
 
   DISALLOW_COPY_AND_ASSIGN(ClassTable);
diff --git a/runtime/vm/code_descriptors.cc b/runtime/vm/code_descriptors.cc
index 5a9ba10..adc7853 100644
--- a/runtime/vm/code_descriptors.cc
+++ b/runtime/vm/code_descriptors.cc
@@ -13,7 +13,7 @@
                                    intptr_t try_index) {
   ASSERT((kind == RawPcDescriptors::kRuntimeCall) ||
          (kind == RawPcDescriptors::kOther) ||
-         (deopt_id != Isolate::kNoDeoptId));
+         (deopt_id != Thread::kNoDeoptId));
 
   intptr_t merged_kind_try =
       RawPcDescriptors::MergedKindTry::Encode(kind, try_index);
diff --git a/runtime/vm/code_descriptors_test.cc b/runtime/vm/code_descriptors_test.cc
index 9c760bb..2586a97 100644
--- a/runtime/vm/code_descriptors_test.cc
+++ b/runtime/vm/code_descriptors_test.cc
@@ -32,7 +32,6 @@
   test->node_sequence()->Add(new ReturnNode(kPos, l));
   parsed_function->SetNodeSequence(test->node_sequence());
   parsed_function->set_instantiator(NULL);
-  parsed_function->set_default_parameter_values(Object::null_array());
   parsed_function->EnsureExpressionTemp();
   test->node_sequence()->scope()->AddVariable(
       parsed_function->expression_temp_var());
diff --git a/runtime/vm/code_generator.cc b/runtime/vm/code_generator.cc
index 5df3636..60a3ab3 100644
--- a/runtime/vm/code_generator.cc
+++ b/runtime/vm/code_generator.cc
@@ -31,6 +31,8 @@
 DEFINE_FLAG(bool, deoptimize_alot, false,
     "Deoptimizes all live frames when we are about to return to Dart code from"
     " native entries.");
+DEFINE_FLAG(bool, background_compilation, false,
+    "Run optimizing compilation in background");
 DEFINE_FLAG(int, max_subtype_cache_entries, 100,
     "Maximum number of subtype cache entries (number of checks cached).");
 DEFINE_FLAG(int, optimization_counter_threshold, 30000,
@@ -57,6 +59,7 @@
 DEFINE_FLAG(bool, trace_type_checks, false, "Trace runtime type checks.");
 
 DECLARE_FLAG(int, deoptimization_counter_threshold);
+DECLARE_FLAG(bool, trace_compiler);
 DECLARE_FLAG(bool, warn_on_javascript_compatibility);
 
 DEFINE_FLAG(bool, use_osr, true, "Use on-stack replacement.");
@@ -106,31 +109,38 @@
 // Return value: newly allocated array of length arg0.
 DEFINE_RUNTIME_ENTRY(AllocateArray, 2) {
   const Instance& length = Instance::CheckedHandle(arguments.ArgAt(0));
-  if (!length.IsSmi()) {
-    const String& error = String::Handle(String::NewFormatted(
-        "Length must be an integer in the range [0..%" Pd "].",
-        Array::kMaxElements));
-    Exceptions::ThrowArgumentError(error);
+  if (!length.IsInteger()) {
+    // Throw: new ArgumentError.value(length, "length", "is not an integer");
+    const Array& args = Array::Handle(Array::New(3));
+    args.SetAt(0, length);
+    args.SetAt(1, Symbols::Length());
+    args.SetAt(2, String::Handle(String::New("is not an integer")));
+    Exceptions::ThrowByType(Exceptions::kArgumentValue, args);
   }
-  const intptr_t len = Smi::Cast(length).Value();
-  if ((len < 0) || (len > Array::kMaxElements)) {
-    const String& error = String::Handle(String::NewFormatted(
-        "Length (%" Pd ") must be an integer in the range [0..%" Pd "].",
-        len, Array::kMaxElements));
-    Exceptions::ThrowArgumentError(error);
+  if (length.IsSmi()) {
+    const intptr_t len = Smi::Cast(length).Value();
+    if ((len >= 0) && (len <= Array::kMaxElements)) {
+      Heap::Space space = isolate->heap()->SpaceForAllocation(kArrayCid);
+      const Array& array = Array::Handle(Array::New(len, space));
+      arguments.SetReturn(array);
+      TypeArguments& element_type =
+          TypeArguments::CheckedHandle(arguments.ArgAt(1));
+      // An Array is raw or takes one type argument. However, its type argument
+      // vector may be longer than 1 due to a type optimization reusing the type
+      // argument vector of the instantiator.
+      ASSERT(element_type.IsNull() ||
+             ((element_type.Length() >= 1) && element_type.IsInstantiated()));
+      array.SetTypeArguments(element_type);  // May be null.
+      return;
+    }
   }
-
-  Heap::Space space = isolate->heap()->SpaceForAllocation(kArrayCid);
-  const Array& array = Array::Handle(Array::New(len, space));
-  arguments.SetReturn(array);
-  TypeArguments& element_type =
-      TypeArguments::CheckedHandle(arguments.ArgAt(1));
-  // An Array is raw or takes one type argument. However, its type argument
-  // vector may be longer than 1 due to a type optimization reusing the type
-  // argument vector of the instantiator.
-  ASSERT(element_type.IsNull() ||
-         ((element_type.Length() >= 1) && element_type.IsInstantiated()));
-  array.SetTypeArguments(element_type);  // May be null.
+  // Throw: new RangeError.range(length, 0, Array::kMaxElements, "length");
+  const Array& args = Array::Handle(Array::New(4));
+  args.SetAt(0, length);
+  args.SetAt(1, Integer::Handle(Integer::New(0)));
+  args.SetAt(2, Integer::Handle(Integer::New(Array::kMaxElements)));
+  args.SetAt(3, Symbols::Length());
+  Exceptions::ThrowByType(Exceptions::kRange, args);
 }
 
 
@@ -268,7 +278,7 @@
   const Context& ctx = Context::CheckedHandle(arguments.ArgAt(0));
   Context& cloned_ctx = Context::Handle(Context::New(ctx.num_variables()));
   cloned_ctx.set_parent(Context::Handle(ctx.parent()));
-  Object& inst = Object::Handle(isolate);
+  Object& inst = Object::Handle(zone);
   for (int i = 0; i < ctx.num_variables(); i++) {
     inst = ctx.At(i);
     cloned_ctx.SetAt(i, inst);
@@ -666,16 +676,12 @@
   const Code& target_code = Code::Handle(target_function.CurrentCode());
   // Before patching verify that we are not repeatedly patching to the same
   // target.
-  ASSERT(target_code.EntryPoint() !=
+  ASSERT(target_code.raw() !=
          CodePatcher::GetStaticCallTargetAt(caller_frame->pc(), caller_code));
-  const Instructions& instrs =
-      Instructions::Handle(caller_code.instructions());
-  {
-    WritableInstructionsScope writable(instrs.EntryPoint(), instrs.size());
-    CodePatcher::PatchStaticCallAt(caller_frame->pc(), caller_code,
-                                   target_code.EntryPoint());
-    caller_code.SetStaticCallTargetCodeAt(caller_frame->pc(), target_code);
-  }
+  CodePatcher::PatchStaticCallAt(caller_frame->pc(),
+                                 caller_code,
+                                 target_code);
+  caller_code.SetStaticCallTargetCodeAt(caller_frame->pc(), target_code);
   if (FLAG_trace_patching) {
     OS::PrintErr("PatchStaticCall: patching caller pc %#" Px ""
         " to '%s' new entry point %#" Px " (%s)\n",
@@ -703,16 +709,24 @@
   DartFrameIterator iterator;
   StackFrame* caller_frame = iterator.NextFrame();
   ASSERT(caller_frame != NULL);
-  uword orig_stub =
-      isolate->debugger()->GetPatchedStubAddress(caller_frame->pc());
-  isolate->debugger()->SignalBpReached();
-  ASSERT((orig_stub & kSmiTagMask) == kSmiTag);
-  arguments.SetReturn(Smi::Handle(reinterpret_cast<RawSmi*>(orig_stub)));
+  const Code& orig_stub = Code::Handle(
+      isolate->debugger()->GetPatchedStubAddress(caller_frame->pc()));
+  const Error& error = Error::Handle(isolate->debugger()->SignalBpReached());
+  if (!error.IsNull()) {
+    Exceptions::PropagateError(error);
+    UNREACHABLE();
+  }
+  arguments.SetReturn(orig_stub);
 }
 
 
 DEFINE_RUNTIME_ENTRY(SingleStepHandler, 0) {
-  isolate->debugger()->DebuggerStepCallback();
+  const Error& error =
+      Error::Handle(isolate->debugger()->DebuggerStepCallback());
+  if (!error.IsNull()) {
+    Exceptions::PropagateError(error);
+    UNREACHABLE();
+  }
 }
 
 
@@ -725,7 +739,6 @@
                                      const String& target_name,
                                      const Array& arguments_descriptor,
                                      Function* result) {
-  ASSERT(FLAG_lazy_dispatchers);
   // 1. Check if there is a getter with the same name.
   const String& getter_name = String::Handle(Field::GetterName(target_name));
   const int kNumArguments = 1;
@@ -749,13 +762,14 @@
       Function::Handle(cache_class.GetInvocationDispatcher(
           target_name,
           arguments_descriptor,
-          RawFunction::kInvokeFieldDispatcher));
-  ASSERT(!target_function.IsNull());
+          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(),
-        target_function.ToCString());
+        target_function.IsNull() ? "null" : target_function.ToCString());
   }
   *result = target_function.raw();
   return true;
@@ -766,10 +780,6 @@
 RawFunction* InlineCacheMissHelper(
     const Instance& receiver,
     const ICData& ic_data) {
-  if (!FLAG_lazy_dispatchers) {
-    return Function::null();  // We'll handle it in the runtime.
-  }
-
   const Array& args_descriptor = Array::Handle(ic_data.arguments_descriptor());
 
   const Class& receiver_class = Class::Handle(receiver.clazz());
@@ -786,15 +796,19 @@
         Function::Handle(receiver_class.GetInvocationDispatcher(
             target_name,
             args_descriptor,
-            RawFunction::kNoSuchMethodDispatcher));
+            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(),
-          target_function.ToCString());
+          target_function.IsNull() ? "null" : target_function.ToCString());
     }
     result = target_function.raw();
   }
+  // May be null if --no-lazy-dispatchers, in which case dispatch will be
+  // handled by InvokeNoSuchMethodDispatcher.
+  ASSERT(!result.IsNull() || !FLAG_lazy_dispatchers);
   return result.raw();
 }
 
@@ -1004,7 +1018,7 @@
   const Array& descriptor = Array::CheckedHandle(arguments.ArgAt(2));
   const String& name = String::Handle(ic_data.target_name());
   const MegamorphicCache& cache = MegamorphicCache::Handle(
-      isolate->megamorphic_cache_table()->Lookup(name, descriptor));
+      MegamorphicCacheTable::Lookup(isolate, name, descriptor));
   Class& cls = Class::Handle(receiver.clazz());
   ASSERT(!cls.IsNull());
   if (FLAG_trace_ic || FLAG_trace_ic_miss_in_optimized) {
@@ -1344,40 +1358,10 @@
     }
   }
 
-  uword interrupt_bits = isolate->GetAndClearInterrupts();
-  if ((interrupt_bits & Isolate::kVMInterrupt) != 0) {
-    isolate->thread_registry()->CheckSafepoint();
-    if (isolate->store_buffer()->Overflowed()) {
-      if (FLAG_verbose_gc) {
-        OS::PrintErr("Scavenge scheduled by store buffer overflow.\n");
-      }
-      isolate->heap()->CollectGarbage(Heap::kNew);
-    }
-  }
-  if ((interrupt_bits & Isolate::kMessageInterrupt) != 0) {
-    bool ok = isolate->message_handler()->HandleOOBMessages();
-    if (!ok) {
-      // False result from HandleOOBMessages signals that the isolate should
-      // be terminating.
-      const String& msg = String::Handle(String::New("isolate terminated"));
-      const UnwindError& error = UnwindError::Handle(UnwindError::New(msg));
-      Exceptions::PropagateError(error);
-      UNREACHABLE();
-    }
-  }
-  if ((interrupt_bits & Isolate::kApiInterrupt) != 0) {
-    // Signal isolate interrupt event.
-    Debugger::SignalIsolateInterrupted();
-
-    Dart_IsolateInterruptCallback callback = isolate->InterruptCallback();
-    if (callback) {
-      if ((*callback)()) {
-        return;
-      } else {
-        // TODO(turnidge): Unwind the stack.
-        UNIMPLEMENTED();
-      }
-    }
+  const Error& error = Error::Handle(isolate->HandleInterrupts());
+  if (!error.IsNull()) {
+    Exceptions::PropagateError(error);
+    UNREACHABLE();
   }
 
   if ((stack_overflow_flags & Isolate::kOsrRequest) != 0) {
@@ -1403,7 +1387,7 @@
     ASSERT(function.unoptimized_code() != Object::null());
     intptr_t osr_id =
         Code::Handle(function.unoptimized_code()).GetDeoptIdForOsr(frame->pc());
-    ASSERT(osr_id != Isolate::kNoDeoptId);
+    ASSERT(osr_id != Thread::kNoDeoptId);
     if (FLAG_trace_osr) {
       OS::Print("Attempting OSR for %s at id=%" Pd ", count=%" Pd "\n",
                 function.ToFullyQualifiedCString(),
@@ -1432,6 +1416,7 @@
           Instructions::Handle(optimized_code.instructions()).EntryPoint();
       function.AttachCode(original_code);
       frame->set_pc(optimized_entry);
+      frame->set_pc_marker(optimized_code.raw());
     }
   }
 }
@@ -1466,15 +1451,29 @@
     // Reset usage counter for reoptimization before calling optimizer to
     // prevent recursive triggering of function optimization.
     function.set_usage_counter(0);
+    if (FLAG_background_compilation) {
+      BackgroundCompiler::EnsureInit(isolate);
+      ASSERT(isolate->background_compiler() != NULL);
+      isolate->background_compiler()->CompileOptimized(function);
+      // Continue in the same code.
+      arguments.SetReturn(Code::Handle(zone, function.CurrentCode()));
+      return;
+    }
+    if (FLAG_trace_compiler) {
+      if (function.HasOptimizedCode()) {
+        THR_Print("ReCompiling function: '%s' \n",
+                  function.ToFullyQualifiedCString());
+      }
+    }
     const Error& error = Error::Handle(
-        isolate, Compiler::CompileOptimizedFunction(thread, function));
+        zone, Compiler::CompileOptimizedFunction(thread, function));
     if (!error.IsNull()) {
       Exceptions::PropagateError(error);
     }
-    const Code& optimized_code = Code::Handle(isolate, function.CurrentCode());
+    const Code& optimized_code = Code::Handle(zone, function.CurrentCode());
     ASSERT(!optimized_code.IsNull());
   }
-  arguments.SetReturn(Code::Handle(isolate, function.CurrentCode()));
+  arguments.SetReturn(Code::Handle(zone, function.CurrentCode()));
 }
 
 
@@ -1494,16 +1493,16 @@
     UNREACHABLE();
   }
   ASSERT(frame->IsDartFrame());
-  const Code& caller_code = Code::Handle(isolate, frame->LookupDartCode());
+  const Code& caller_code = Code::Handle(zone, frame->LookupDartCode());
   ASSERT(caller_code.is_optimized());
   const Function& target_function = Function::Handle(
-      isolate, caller_code.GetStaticCallTargetFunctionAt(frame->pc()));
+      zone, caller_code.GetStaticCallTargetFunctionAt(frame->pc()));
   const Code& target_code = Code::Handle(
-      isolate, caller_code.GetStaticCallTargetCodeAt(frame->pc()));
+      zone, caller_code.GetStaticCallTargetCodeAt(frame->pc()));
   ASSERT(!target_code.IsNull());
   if (!target_function.HasCode()) {
     const Error& error = Error::Handle(
-        isolate, Compiler::CompileFunction(thread, target_function));
+        zone, Compiler::CompileFunction(thread, target_function));
     if (!error.IsNull()) {
       Exceptions::PropagateError(error);
     }
@@ -1512,15 +1511,11 @@
   ASSERT(target_function.raw() == target_code.function());
 
   const Code& current_target_code = Code::Handle(
-      isolate, target_function.CurrentCode());
-  const Instructions& instrs = Instructions::Handle(
-      isolate, caller_code.instructions());
-  {
-    WritableInstructionsScope writable(instrs.EntryPoint(), instrs.size());
-    CodePatcher::PatchStaticCallAt(frame->pc(), caller_code,
-                                   current_target_code.EntryPoint());
-    caller_code.SetStaticCallTargetCodeAt(frame->pc(), current_target_code);
-  }
+      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 " "
         "target '%s' %#" Px " -> %#" Px "\n",
@@ -1548,27 +1543,21 @@
     UNREACHABLE();
   }
   ASSERT(frame->IsDartFrame());
-  const Code& caller_code = Code::Handle(isolate, frame->LookupDartCode());
+  const Code& caller_code = Code::Handle(zone, frame->LookupDartCode());
   ASSERT(!caller_code.IsNull());
-  const uword target =
-      CodePatcher::GetStaticCallTargetAt(frame->pc(), caller_code);
-  const Code& stub = Code::Handle(isolate, Code::LookupCode(target));
+  const Code& stub = Code::Handle(
+      CodePatcher::GetStaticCallTargetAt(frame->pc(), caller_code));
   Class& alloc_class = Class::ZoneHandle(zone);
   alloc_class ^= stub.owner();
-  Code& alloc_stub = Code::Handle(isolate, alloc_class.allocation_stub());
+  Code& alloc_stub = Code::Handle(zone, alloc_class.allocation_stub());
   if (alloc_stub.IsNull()) {
     alloc_stub = StubCode::GetAllocationStubForClass(alloc_class);
-    ASSERT(!CodePatcher::IsEntryPatched(alloc_stub));
+    ASSERT(!alloc_stub.IsDisabled());
   }
-  const Instructions& instrs =
-      Instructions::Handle(isolate, caller_code.instructions());
-  {
-    WritableInstructionsScope writable(instrs.EntryPoint(), instrs.size());
-    CodePatcher::PatchStaticCallAt(frame->pc(),
-                                   caller_code,
-                                   alloc_stub.EntryPoint());
-    caller_code.SetStubCallTargetCodeAt(frame->pc(), 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",
@@ -1622,11 +1611,11 @@
       Instructions::Handle(zone, optimized_code.instructions());
   {
     WritableInstructionsScope writable(instrs.EntryPoint(), instrs.size());
-    CodePatcher::InsertCallAt(pc, lazy_deopt_jump);
+    CodePatcher::InsertDeoptimizationCallAt(pc, lazy_deopt_jump);
   }
   if (FLAG_trace_patching) {
     const String& name = String::Handle(function.name());
-    OS::PrintErr("InsertCallAt: %" Px " to %" Px " for %s\n", pc,
+    OS::PrintErr("InsertDeoptimizationCallAt: %" Px " to %" Px " for %s\n", pc,
                  lazy_deopt_jump, name.ToCString());
   }
   // Mark code as dead (do not GC its embedded objects).
@@ -1679,10 +1668,13 @@
 // Copies saved registers and caller's frame into temporary buffers.
 // Returns the stack size of unoptimized frame.
 DEFINE_LEAF_RUNTIME_ENTRY(intptr_t, DeoptimizeCopyFrame,
-                          1, uword saved_registers_address) {
-  Isolate* isolate = Isolate::Current();
-  StackZone zone(isolate);
-  HANDLESCOPE(isolate);
+                          2,
+                          uword saved_registers_address,
+                          uword is_lazy_deopt) {
+  Thread* thread = Thread::Current();
+  Isolate* isolate = thread->isolate();
+  StackZone zone(thread);
+  HANDLESCOPE(thread);
 
   // All registers have been saved below last-fp as if they were locals.
   const uword last_fp = saved_registers_address
@@ -1704,9 +1696,12 @@
 
   // Create the DeoptContext.
   DeoptContext* deopt_context =
-      new DeoptContext(caller_frame, optimized_code,
+      new DeoptContext(caller_frame,
+                       optimized_code,
                        DeoptContext::kDestIsOriginalFrame,
-                       fpu_registers, cpu_registers);
+                       fpu_registers,
+                       cpu_registers,
+                       is_lazy_deopt != 0);
   isolate->set_deopt_context(deopt_context);
 
   // Stack size (FP - SP) in bytes.
@@ -1718,9 +1713,10 @@
 // The stack has been adjusted to fit all values for unoptimized frame.
 // Fill the unoptimized frame.
 DEFINE_LEAF_RUNTIME_ENTRY(void, DeoptimizeFillFrame, 1, uword last_fp) {
-  Isolate* isolate = Isolate::Current();
-  StackZone zone(isolate);
-  HANDLESCOPE(isolate);
+  Thread* thread = Thread::Current();
+  Isolate* isolate = thread->isolate();
+  StackZone zone(thread);
+  HANDLESCOPE(thread);
 
   DeoptContext* deopt_context = isolate->deopt_context();
   DartFrameIterator iterator(last_fp);
@@ -1777,9 +1773,9 @@
                           2,
                           RawBigint* left,
                           RawBigint* right) {
-  Isolate* isolate = Isolate::Current();
-  StackZone zone(isolate);
-  HANDLESCOPE(isolate);
+  Thread* thread = Thread::Current();
+  StackZone zone(thread);
+  HANDLESCOPE(thread);
   const Bigint& big_left = Bigint::Handle(left);
   const Bigint& big_right = Bigint::Handle(right);
   return big_left.CompareWith(big_right);
diff --git a/runtime/vm/code_generator.h b/runtime/vm/code_generator.h
index 49a63f6..62e8e23 100644
--- a/runtime/vm/code_generator.h
+++ b/runtime/vm/code_generator.h
@@ -15,43 +15,6 @@
 class ICData;
 class Instance;
 
-// Declaration of runtime entries called from stub or generated code.
-DECLARE_RUNTIME_ENTRY(AllocateArray);
-DECLARE_RUNTIME_ENTRY(AllocateContext);
-DECLARE_RUNTIME_ENTRY(AllocateObject);
-DECLARE_RUNTIME_ENTRY(BreakpointRuntimeHandler);
-DECLARE_RUNTIME_ENTRY(SingleStepHandler);
-DECLARE_RUNTIME_ENTRY(CloneContext);
-DECLARE_RUNTIME_ENTRY(Deoptimize);
-DECLARE_RUNTIME_ENTRY(FixCallersTarget);
-DECLARE_RUNTIME_ENTRY(FixAllocationStubTarget);
-DECLARE_RUNTIME_ENTRY(InlineCacheMissHandlerOneArg);
-DECLARE_RUNTIME_ENTRY(InlineCacheMissHandlerTwoArgs);
-DECLARE_RUNTIME_ENTRY(InlineCacheMissHandlerThreeArgs);
-DECLARE_RUNTIME_ENTRY(StaticCallMissHandlerOneArg);
-DECLARE_RUNTIME_ENTRY(StaticCallMissHandlerTwoArgs);
-DECLARE_RUNTIME_ENTRY(Instanceof);
-DECLARE_RUNTIME_ENTRY(TypeCheck);
-DECLARE_RUNTIME_ENTRY(BadTypeError);
-DECLARE_RUNTIME_ENTRY(NonBoolTypeError);
-DECLARE_RUNTIME_ENTRY(InstantiateType);
-DECLARE_RUNTIME_ENTRY(InstantiateTypeArguments);
-DECLARE_RUNTIME_ENTRY(InvokeClosureNoSuchMethod);
-DECLARE_RUNTIME_ENTRY(InvokeNoSuchMethodDispatcher);
-DECLARE_RUNTIME_ENTRY(MegamorphicCacheMissHandler);
-DECLARE_RUNTIME_ENTRY(OptimizeInvokedFunction);
-DECLARE_RUNTIME_ENTRY(TraceICCall);
-DECLARE_RUNTIME_ENTRY(PatchStaticCall);
-DECLARE_RUNTIME_ENTRY(ReThrow);
-DECLARE_RUNTIME_ENTRY(StackOverflow);
-DECLARE_RUNTIME_ENTRY(Throw);
-DECLARE_RUNTIME_ENTRY(TraceFunctionEntry);
-DECLARE_RUNTIME_ENTRY(TraceFunctionExit);
-DECLARE_RUNTIME_ENTRY(DeoptimizeMaterialize);
-DECLARE_RUNTIME_ENTRY(UpdateFieldCid);
-DECLARE_RUNTIME_ENTRY(InitStaticField);
-DECLARE_RUNTIME_ENTRY(GrowRegExpStack);
-
 const char* DeoptReasonToCString(ICData::DeoptReasonId deopt_reason);
 
 void DeoptimizeAt(const Code& optimized_code, uword pc);
diff --git a/runtime/vm/code_generator_test.cc b/runtime/vm/code_generator_test.cc
index 90c1360..aac9311 100644
--- a/runtime/vm/code_generator_test.cc
+++ b/runtime/vm/code_generator_test.cc
@@ -209,8 +209,9 @@
   local_scope->InsertParameterAt(0, NewTestLocalVariable("a"));
   local_scope->InsertParameterAt(1, NewTestLocalVariable("b"));
   ASSERT(local_scope->num_variables() == num_params);
-  const Array& default_values = Array::ZoneHandle(Array::New(num_opt_params));
-  default_values.SetAt(0, Smi::ZoneHandle(Smi::New(1)));  // b = 1.
+  ZoneGrowableArray<const Instance*>* default_values =
+      new ZoneGrowableArray<const Instance*>(num_opt_params);
+  default_values->Add(&Smi::ZoneHandle(Smi::New(1)));  // b = 1.
   test->set_default_parameter_values(default_values);
   const Function& function = test->function();
   function.set_is_native(true);
@@ -383,10 +384,11 @@
   local_scope->InsertParameterAt(3, NewTestLocalVariable("d"));
   local_scope->InsertParameterAt(4, NewTestLocalVariable("e"));
   ASSERT(local_scope->num_variables() == num_params);
-  const Array& default_values = Array::ZoneHandle(Array::New(num_opt_params));
-  default_values.SetAt(0, Smi::ZoneHandle(Smi::New(10)));
-  default_values.SetAt(1, Smi::ZoneHandle(Smi::New(21)));
-  default_values.SetAt(2, Smi::ZoneHandle(Smi::New(-32)));
+  ZoneGrowableArray<const Instance*>* default_values =
+      new ZoneGrowableArray<const Instance*>(num_opt_params);
+  default_values->Add(&Smi::ZoneHandle(Smi::New(10)));
+  default_values->Add(&Smi::ZoneHandle(Smi::New(21)));
+  default_values->Add(&Smi::ZoneHandle(Smi::New(-32)));
   test->set_default_parameter_values(default_values);
   const Function& function = test->function();
   function.set_is_native(true);
diff --git a/runtime/vm/code_patcher.cc b/runtime/vm/code_patcher.cc
index d579577..c62be00 100644
--- a/runtime/vm/code_patcher.cc
+++ b/runtime/vm/code_patcher.cc
@@ -34,103 +34,4 @@
   }
 }
 
-
-static void SwapCode(intptr_t num_bytes, char* code, char* buffer) {
-  uword code_address = reinterpret_cast<uword>(code);
-  for (intptr_t i = 0; i < num_bytes; i++) {
-    char tmp = *code;
-    *code = *buffer;
-    *buffer = tmp;
-    code++;
-    buffer++;
-  }
-  CPU::FlushICache(code_address, num_bytes);
-  // The buffer is not executed. No need to flush.
-}
-
-
-// The patch code buffer contains the jmp code which will be inserted at
-// entry point.
-void CodePatcher::PatchEntry(const Code& code) {
-  ASSERT(!IsEntryPatched(code));
-  const uword patch_addr = code.GetEntryPatchPc();
-  ASSERT(patch_addr != 0);
-  JumpPattern jmp_entry(patch_addr, code);
-  ASSERT(!jmp_entry.IsValid());
-  const uword patch_buffer = code.GetPatchCodePc();
-  ASSERT(patch_buffer != 0);
-  JumpPattern jmp_patch(patch_buffer, code);
-  ASSERT(jmp_patch.IsValid());
-  const uword jump_target = jmp_patch.TargetAddress();
-  intptr_t length = jmp_patch.pattern_length_in_bytes();
-  {
-    WritableInstructionsScope writable_code(patch_addr, length);
-    WritableInstructionsScope writable_buffer(patch_buffer, length);
-    SwapCode(jmp_patch.pattern_length_in_bytes(),
-             reinterpret_cast<char*>(patch_addr),
-             reinterpret_cast<char*>(patch_buffer));
-    jmp_entry.SetTargetAddress(jump_target);
-  }
-}
-
-
-// The entry point is a jmp instruction, the patch code buffer contains
-// original code, the entry point contains the jump instruction.
-void CodePatcher::RestoreEntry(const Code& code) {
-  if (!IsEntryPatched(code)) return;
-  const uword patch_addr = code.GetEntryPatchPc();
-  ASSERT(patch_addr != 0);
-  JumpPattern jmp_entry(patch_addr, code);
-  ASSERT(jmp_entry.IsValid());
-  const uword jump_target = jmp_entry.TargetAddress();
-  const uword patch_buffer = code.GetPatchCodePc();
-  ASSERT(patch_buffer != 0);
-  // 'patch_buffer' contains original entry code.
-  JumpPattern jmp_patch(patch_buffer, code);
-  ASSERT(!jmp_patch.IsValid());
-  intptr_t length = jmp_patch.pattern_length_in_bytes();
-  {
-    WritableInstructionsScope writable_code(patch_addr, length);
-    WritableInstructionsScope writable_buffer(patch_buffer, length);
-    SwapCode(jmp_patch.pattern_length_in_bytes(),
-             reinterpret_cast<char*>(patch_addr),
-             reinterpret_cast<char*>(patch_buffer));
-    ASSERT(jmp_patch.IsValid());
-    jmp_patch.SetTargetAddress(jump_target);
-  }
-}
-
-
-bool CodePatcher::IsEntryPatched(const Code& code) {
-  const uword patch_addr = code.GetEntryPatchPc();
-  if (patch_addr == 0) {
-    return false;
-  }
-  JumpPattern jmp_entry(patch_addr, code);
-  return jmp_entry.IsValid();
-}
-
-
-bool CodePatcher::CodeIsPatchable(const Code& code) {
-  const uword patch_addr = code.GetEntryPatchPc();
-  // Zero means means that the function is not patchable.
-  if (patch_addr == 0) {
-    return false;
-  }
-  JumpPattern jmp_entry(patch_addr, code);
-  if (code.Size() < (jmp_entry.pattern_length_in_bytes() * 2)) {
-    return false;
-  }
-  const uword limit = patch_addr + jmp_entry.pattern_length_in_bytes();
-  // Check no object stored between patch_addr .. limit.
-  for (intptr_t i = 0; i < code.pointer_offsets_length(); i++) {
-    const uword obj_start = code.GetPointerOffsetAt(i) + code.EntryPoint();
-    const uword obj_end  = obj_start + kWordSize;
-    if ((obj_start < limit) && (obj_end > patch_addr)) {
-      return false;
-    }
-  }
-  return true;
-}
-
 }  // namespace dart
diff --git a/runtime/vm/code_patcher.h b/runtime/vm/code_patcher.h
index f563426..dc27168 100644
--- a/runtime/vm/code_patcher.h
+++ b/runtime/vm/code_patcher.h
@@ -7,6 +7,7 @@
 #define VM_CODE_PATCHER_H_
 
 #include "vm/allocation.h"
+#include "vm/native_entry.h"
 
 namespace dart {
 
@@ -17,6 +18,7 @@
 class Function;
 class ICData;
 class RawArray;
+class RawCode;
 class RawFunction;
 class RawICData;
 class RawObject;
@@ -45,36 +47,18 @@
   // Patch static call before return_address in given code to the new target.
   static void PatchStaticCallAt(uword return_address,
                                 const Code& code,
-                                uword new_target_address);
-
-  // Patch instance call before return_address in given code to the new target.
-  static void PatchInstanceCallAt(uword return_address,
-                                  const Code& code,
-                                  uword new_target_address);
-
-  // Patch entry point with a jump as specified in the code's patch region.
-  static void PatchEntry(const Code& code);
-
-  // Restore entry point with original code (i.e., before patching).
-  static void RestoreEntry(const Code& code);
-
-  // Has the entry been patched?
-  static bool IsEntryPatched(const Code& code);
-
-  // Returns true if the code can be patched with a jump at beginning (checks
-  // that there are no conflicts with object pointers). Used in ASSERTs.
-  static bool CodeIsPatchable(const Code& code);
+                                const Code& new_target);
 
   // Return the target address of the static call before return_address
   // in given code.
-  static uword GetStaticCallTargetAt(uword return_address, const Code& code);
+  static RawCode* GetStaticCallTargetAt(uword return_address, const Code& code);
 
   // Get instance call information.  Returns the call target and sets each
   // of the output parameters ic_data and arguments_descriptor if they are
   // non-NULL.
-  static uword GetInstanceCallAt(uword return_address,
-                                 const Code& code,
-                                 ICData* ic_data);
+  static RawCode* GetInstanceCallAt(uword return_address,
+                                    const Code& code,
+                                    ICData* ic_data);
 
   // Return target of an unoptimized static call and its ICData object
   // (calls target via a stub).
@@ -84,15 +68,20 @@
 
   static intptr_t InstanceCallSizeInBytes();
 
-  static void InsertCallAt(uword start, uword target);
+  static void InsertDeoptimizationCallAt(uword start, uword target);
 
-  static RawObject* GetEdgeCounterAt(uword pc, const Code& code);
-
-  static int32_t GetPoolOffsetAt(uword return_address);
-  static void SetPoolOffsetAt(uword return_address, int32_t offset);
   static void PatchPoolPointerCallAt(uword return_address,
                                      const Code& code,
-                                     uword new_target);
+                                     const Code& new_target);
+
+  static RawCode* GetNativeCallAt(uword return_address,
+                                  const Code& code,
+                                  NativeFunction* target);
+
+  static void PatchNativeCallAt(uword return_address,
+                                const Code& code,
+                                NativeFunction target,
+                                const Code& trampoline);
 };
 
 }  // namespace dart
diff --git a/runtime/vm/code_patcher_arm.cc b/runtime/vm/code_patcher_arm.cc
index f443c13..a9d5a10 100644
--- a/runtime/vm/code_patcher_arm.cc
+++ b/runtime/vm/code_patcher_arm.cc
@@ -13,48 +13,39 @@
 
 namespace dart {
 
-uword CodePatcher::GetStaticCallTargetAt(uword return_address,
-                                         const Code& code) {
+RawCode* CodePatcher::GetStaticCallTargetAt(uword return_address,
+                                            const Code& code) {
   ASSERT(code.ContainsInstructionAt(return_address));
   CallPattern call(return_address, code);
-  return call.TargetAddress();
+  return call.TargetCode();
 }
 
 
 void CodePatcher::PatchStaticCallAt(uword return_address,
                                     const Code& code,
-                                    uword new_target) {
+                                    const Code& new_target) {
   ASSERT(code.ContainsInstructionAt(return_address));
   CallPattern call(return_address, code);
-  call.SetTargetAddress(new_target);
+  call.SetTargetCode(new_target);
 }
 
 
-void CodePatcher::PatchInstanceCallAt(uword return_address,
-                                      const Code& code,
-                                      uword new_target) {
-  ASSERT(code.ContainsInstructionAt(return_address));
-  CallPattern call(return_address, code);
-  call.SetTargetAddress(new_target);
-}
-
-
-void CodePatcher::InsertCallAt(uword start, uword target) {
+void CodePatcher::InsertDeoptimizationCallAt(uword start, uword target) {
   // The inserted call should not overlap the lazy deopt jump code.
-  ASSERT(start + CallPattern::LengthInBytes() <= target);
-  CallPattern::InsertAt(start, target);
+  ASSERT(start + CallPattern::DeoptCallPatternLengthInBytes() <= target);
+  CallPattern::InsertDeoptCallAt(start, target);
 }
 
 
-uword 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));
   CallPattern call(return_address, code);
   if (ic_data != NULL) {
     *ic_data = call.IcData();
   }
-  return call.TargetAddress();
+  return call.TargetCode();
 }
 
 
@@ -78,45 +69,24 @@
 }
 
 
-// This class pattern matches on a load from the object pool.  Loading on
-// ARM is complicated because it can take four possible different forms.  We
-// match backwards from the end of the sequence so we can reuse the code for
-// matching object pool loads at calls.
-class EdgeCounter : public ValueObject {
- public:
-  EdgeCounter(uword pc, const Code& code)
-      : end_(pc - FlowGraphCompiler::EdgeCounterIncrementSizeInBytes()),
-        object_pool_(ObjectPool::Handle(code.GetObjectPool())) {
-    // An IsValid predicate is complicated and duplicates the code in the
-    // decoding function.  Instead we rely on decoding the pattern which
-    // will assert partial validity.
-  }
-
-  RawObject* edge_counter() const {
-    Register ignored;
-    intptr_t index;
-    InstructionPattern::DecodeLoadWordFromPool(end_, &ignored, &index);
-    ASSERT(ignored == R0);
-    return object_pool_.ObjectAt(index);
-  }
-
- private:
-  // The object pool load is followed by the fixed-size edge counter
-  // incrementing code:
-  //     ldr ip, [r0, #+11]
-  //     adds ip, ip, #2
-  //     str ip, [r0, #+11]
-  static const intptr_t kAdjust = 3 * Instr::kInstrSize;
-
-  uword end_;
-  const ObjectPool& object_pool_;
-};
+void CodePatcher::PatchNativeCallAt(uword return_address,
+                                    const Code& code,
+                                    NativeFunction target,
+                                    const Code& trampoline) {
+  ASSERT(code.ContainsInstructionAt(return_address));
+  NativeCallPattern call(return_address, code);
+  call.set_target(trampoline);
+  call.set_native_function(target);
+}
 
 
-RawObject* CodePatcher::GetEdgeCounterAt(uword pc, const Code& code) {
-  ASSERT(code.ContainsInstructionAt(pc));
-  EdgeCounter counter(pc, code);
-  return counter.edge_counter();
+RawCode* CodePatcher::GetNativeCallAt(uword return_address,
+                                     const Code& code,
+                                     NativeFunction* target) {
+  ASSERT(code.ContainsInstructionAt(return_address));
+  NativeCallPattern call(return_address, code);
+  *target = call.native_function();
+  return call.target();
 }
 
 }  // namespace dart
diff --git a/runtime/vm/code_patcher_arm64.cc b/runtime/vm/code_patcher_arm64.cc
index 7b0afef..4e0bbee 100644
--- a/runtime/vm/code_patcher_arm64.cc
+++ b/runtime/vm/code_patcher_arm64.cc
@@ -12,15 +12,6 @@
 
 namespace dart {
 
-void CodePatcher::PatchInstanceCallAt(uword return_address,
-                                      const Code& code,
-                                      uword new_target) {
-  ASSERT(code.ContainsInstructionAt(return_address));
-  CallPattern call(return_address, code);
-  call.SetTargetAddress(new_target);
-}
-
-
 class PoolPointerCall : public ValueObject {
  public:
   PoolPointerCall(uword pc, const Code& code)
@@ -29,19 +20,19 @@
     // Last instruction: blr ip0.
     ASSERT(*(reinterpret_cast<uint32_t*>(end_) - 1) == 0xd63f0200);
     InstructionPattern::DecodeLoadWordFromPool(
-        end_ - Instr::kInstrSize, &reg_, &index_);
+        end_ - 2 * Instr::kInstrSize, &reg_, &index_);
   }
 
   intptr_t pp_index() const {
     return index_;
   }
 
-  uword Target() const {
-    return object_pool_.RawValueAt(pp_index());
+  RawCode* Target() const {
+    return reinterpret_cast<RawCode*>(object_pool_.ObjectAt(pp_index()));
   }
 
-  void SetTarget(uword target) const {
-    object_pool_.SetRawValueAt(pp_index(), target);
+  void SetTarget(const Code& target) const {
+    object_pool_.SetObjectAt(pp_index(), target);
     // No need to flush the instruction cache, since the code is not modified.
   }
 
@@ -55,8 +46,8 @@
 };
 
 
-uword CodePatcher::GetStaticCallTargetAt(uword return_address,
-                                         const Code& code) {
+RawCode* CodePatcher::GetStaticCallTargetAt(uword return_address,
+                                            const Code& code) {
   ASSERT(code.ContainsInstructionAt(return_address));
   PoolPointerCall call(return_address, code);
   return call.Target();
@@ -65,36 +56,36 @@
 
 void CodePatcher::PatchStaticCallAt(uword return_address,
                                     const Code& code,
-                                    uword new_target) {
+                                    const Code& new_target) {
   PatchPoolPointerCallAt(return_address, code, new_target);
 }
 
 
 void CodePatcher::PatchPoolPointerCallAt(uword return_address,
                                          const Code& code,
-                                         uword new_target) {
+                                         const Code& new_target) {
   ASSERT(code.ContainsInstructionAt(return_address));
   PoolPointerCall call(return_address, code);
   call.SetTarget(new_target);
 }
 
 
-void CodePatcher::InsertCallAt(uword start, uword target) {
+void CodePatcher::InsertDeoptimizationCallAt(uword start, uword target) {
   // The inserted call should not overlap the lazy deopt jump code.
-  ASSERT(start + CallPattern::kLengthInBytes <= target);
-  CallPattern::InsertAt(start, target);
+  ASSERT(start + CallPattern::kDeoptCallLengthInBytes <= target);
+  CallPattern::InsertDeoptCallAt(start, target);
 }
 
 
-uword 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));
   CallPattern call(return_address, code);
   if (ic_data != NULL) {
     *ic_data = call.IcData();
   }
-  return call.TargetAddress();
+  return call.TargetCode();
 }
 
 
@@ -118,45 +109,24 @@
 }
 
 
-// This class pattern matches on a load from the object pool.  Loading on
-// ARM64 is complicated because it can take more than one form.  We
-// match backwards from the end of the sequence so we can reuse the code for
-// matching object pool loads at calls.
-class EdgeCounter : public ValueObject {
- public:
-  EdgeCounter(uword pc, const Code& code)
-      : end_(pc - kAdjust),
-        object_pool_(ObjectPool::Handle(code.GetObjectPool())) {
-    // An IsValid predicate is complicated and duplicates the code in the
-    // decoding function.  Instead we rely on decoding the pattern which
-    // will assert partial validity.
-  }
-
-  RawObject* edge_counter() const {
-    Register ignored;
-    intptr_t index;
-    InstructionPattern::DecodeLoadWordFromPool(end_, &ignored, &index);
-    ASSERT(ignored == R0);
-    return object_pool_.ObjectAt(index);
-  }
-
- private:
-  // The object pool load is followed by the fixed-size edge counter
-  // incrementing code:
-  //     ldr ip, [r0, #+11]
-  //     adds ip, ip, #2
-  //     str ip, [r0, #+11]
-  static const intptr_t kAdjust = 3 * Instr::kInstrSize;
-
-  uword end_;
-  const ObjectPool& object_pool_;
-};
+void CodePatcher::PatchNativeCallAt(uword return_address,
+                                    const Code& code,
+                                    NativeFunction target,
+                                    const Code& trampoline) {
+  ASSERT(code.ContainsInstructionAt(return_address));
+  NativeCallPattern call(return_address, code);
+  call.set_target(trampoline);
+  call.set_native_function(target);
+}
 
 
-RawObject* CodePatcher::GetEdgeCounterAt(uword pc, const Code& code) {
-  ASSERT(code.ContainsInstructionAt(pc));
-  EdgeCounter counter(pc, code);
-  return counter.edge_counter();
+RawCode* CodePatcher::GetNativeCallAt(uword return_address,
+                                      const Code& code,
+                                      NativeFunction* target) {
+  ASSERT(code.ContainsInstructionAt(return_address));
+  NativeCallPattern call(return_address, code);
+  *target = call.native_function();
+  return call.target();
 }
 
 }  // namespace dart
diff --git a/runtime/vm/code_patcher_ia32.cc b/runtime/vm/code_patcher_ia32.cc
index 08d95b4..d0a4f07 100644
--- a/runtime/vm/code_patcher_ia32.cc
+++ b/runtime/vm/code_patcher_ia32.cc
@@ -18,57 +18,67 @@
 
 // The expected pattern of a Dart unoptimized call (static and instance):
 //  mov ECX, ic-data
+//  mov EDI, target-code-object
 //  call target_address (stub)
 //  <- return address
 class UnoptimizedCall : public ValueObject {
  public:
   explicit UnoptimizedCall(uword return_address)
-      : start_(return_address - (kNumInstructions * kInstructionSize)) {
-    ASSERT(IsValid(return_address));
-    ASSERT(kInstructionSize == Assembler::kCallExternalLabelSize);
-  }
-
-  static bool IsValid(uword return_address) {
-    uint8_t* code_bytes =
-        reinterpret_cast<uint8_t*>(
-            return_address - (kNumInstructions * kInstructionSize));
-    return (code_bytes[0] == 0xB9) &&
-           (code_bytes[1 * kInstructionSize] == 0xE8);
-  }
-
-  uword target() const {
-    const uword offset = *reinterpret_cast<uword*>(call_address() + 1);
-    return return_address() + offset;
-  }
-
-  void set_target(uword target) const {
-    uword* target_addr = reinterpret_cast<uword*>(call_address() + 1);
-    uword offset = target - return_address();
-    *target_addr = offset;
-    CPU::FlushICache(call_address(), kInstructionSize);
+      : start_(return_address - kPatternSize) {
+    ASSERT(IsValid());
   }
 
   RawObject* ic_data() const {
     return *reinterpret_cast<RawObject**>(start_ + 1);
   }
 
-  static const int kNumInstructions = 2;
-  static const int kInstructionSize = 5;  // All instructions have same length.
+  static const int kMovInstructionSize = 5;
+  static const int kCallInstructionSize = 3;
+  static const int kPatternSize =
+      2 * kMovInstructionSize + kCallInstructionSize;
 
  private:
+  bool IsValid() {
+    uint8_t* code_bytes = reinterpret_cast<uint8_t*>(start_);
+    return (code_bytes[0] == 0xB9) &&
+           (code_bytes[2 * kMovInstructionSize] == 0xFF);
+  }
+
   uword return_address() const {
-    return start_ + kNumInstructions * kInstructionSize;
+    return start_ + kPatternSize;
   }
 
   uword call_address() const {
-    return start_ + 1 * kInstructionSize;
+    return start_ + 2 * kMovInstructionSize;
   }
 
+ protected:
   uword start_;
+
+ private:
   DISALLOW_IMPLICIT_CONSTRUCTORS(UnoptimizedCall);
 };
 
 
+class NativeCall : public UnoptimizedCall {
+ public:
+  explicit NativeCall(uword return_address) : UnoptimizedCall(return_address) {
+  }
+
+  NativeFunction native_function() const {
+    return *reinterpret_cast<NativeFunction*>(start_ + 1);
+  }
+
+  void set_native_function(NativeFunction func) const {
+    WritableInstructionsScope writable(start_ + 1, sizeof(func));
+    *reinterpret_cast<NativeFunction*>(start_ + 1) = func;
+  }
+
+ private:
+  DISALLOW_IMPLICIT_CONSTRUCTORS(NativeCall);
+};
+
+
 class InstanceCall : public UnoptimizedCall {
  public:
   explicit InstanceCall(uword return_address)
@@ -103,45 +113,43 @@
 
 // The expected pattern of a dart static call:
 //  mov EDX, arguments_descriptor_array (optional in polymorphic calls)
-//  call target_address
+//  mov EDI, Immediate(code_object)
+//  call [EDI + entry_point_offset]
 //  <- return address
 class StaticCall : public ValueObject {
  public:
   explicit StaticCall(uword return_address)
-      : start_(return_address - (kNumInstructions * kInstructionSize)) {
-    ASSERT(IsValid(return_address));
-    ASSERT(kInstructionSize == Assembler::kCallExternalLabelSize);
+      : start_(return_address - (kMovInstructionSize + kCallInstructionSize)) {
+    ASSERT(IsValid());
   }
 
-  static bool IsValid(uword return_address) {
-    uint8_t* code_bytes =
-        reinterpret_cast<uint8_t*>(
-            return_address - (kNumInstructions * kInstructionSize));
-    return (code_bytes[0] == 0xE8);
+  bool IsValid() {
+    uint8_t* code_bytes = reinterpret_cast<uint8_t*>(start_);
+    return (code_bytes[0] == 0xBF) && (code_bytes[5] == 0xFF);
   }
 
-  uword target() const {
-    const uword offset = *reinterpret_cast<uword*>(call_address() + 1);
-    return return_address() + offset;
+  RawCode* target() const {
+    const uword imm = *reinterpret_cast<uword*>(start_ + 1);
+    return reinterpret_cast<RawCode*>(imm);
   }
 
-  void set_target(uword target) const {
-    uword* target_addr = reinterpret_cast<uword*>(call_address() + 1);
-    uword offset = target - return_address();
-    *target_addr = offset;
-    CPU::FlushICache(call_address(), kInstructionSize);
+  void set_target(const Code& target) const {
+    uword* target_addr = reinterpret_cast<uword*>(start_ + 1);
+    uword imm = reinterpret_cast<uword>(target.raw());
+    *target_addr = imm;
+    CPU::FlushICache(start_ + 1, sizeof(imm));
   }
 
-  static const int kNumInstructions = 1;
-  static const int kInstructionSize = 5;  // All instructions have same length.
+  static const int kMovInstructionSize = 5;
+  static const int kCallInstructionSize = 3;
 
  private:
   uword return_address() const {
-    return start_ + kNumInstructions * kInstructionSize;
+    return start_ + kMovInstructionSize +  kCallInstructionSize;
   }
 
   uword call_address() const {
-    return start_;
+    return start_ + kMovInstructionSize;
   }
 
   uword start_;
@@ -150,8 +158,8 @@
 };
 
 
-uword CodePatcher::GetStaticCallTargetAt(uword return_address,
-                                         const Code& code) {
+RawCode* CodePatcher::GetStaticCallTargetAt(uword return_address,
+                                            const Code& code) {
   ASSERT(code.ContainsInstructionAt(return_address));
   StaticCall call(return_address);
   return call.target();
@@ -160,40 +168,33 @@
 
 void CodePatcher::PatchStaticCallAt(uword return_address,
                                     const Code& code,
-                                    uword new_target) {
+                                    const Code& new_target) {
+  const Instructions& instrs = Instructions::Handle(code.instructions());
+  WritableInstructionsScope writable(instrs.EntryPoint(), instrs.size());
   ASSERT(code.ContainsInstructionAt(return_address));
   StaticCall call(return_address);
   call.set_target(new_target);
 }
 
 
-void CodePatcher::PatchInstanceCallAt(uword return_address,
-                                      const Code& code,
-                                      uword new_target) {
-  ASSERT(code.ContainsInstructionAt(return_address));
-  InstanceCall call(return_address);
-  call.set_target(new_target);
-}
-
-
-void CodePatcher::InsertCallAt(uword start, uword target) {
+void CodePatcher::InsertDeoptimizationCallAt(uword start, uword target) {
   // The inserted call should not overlap the lazy deopt jump code.
-  ASSERT(start + CallPattern::InstructionLength() <= target);
+  ASSERT(start + CallPattern::pattern_length_in_bytes() <= target);
   *reinterpret_cast<uint8_t*>(start) = 0xE8;
   CallPattern call(start);
   call.SetTargetAddress(target);
-  CPU::FlushICache(start, CallPattern::InstructionLength());
+  CPU::FlushICache(start, CallPattern::pattern_length_in_bytes());
 }
 
 
-uword CodePatcher::GetInstanceCallAt(
+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) {
     *ic_data ^= call.ic_data();
   }
-  return call.target();
+  return Code::null();
 }
 
 
@@ -210,37 +211,25 @@
 }
 
 
-intptr_t CodePatcher::InstanceCallSizeInBytes() {
-  return InstanceCall::kNumInstructions * InstanceCall::kInstructionSize;
+void CodePatcher::PatchNativeCallAt(uword return_address,
+                                    const Code& code,
+                                    NativeFunction target,
+                                    const Code& trampoline) {
+  UNREACHABLE();
 }
 
 
-// The expected code pattern of an edge counter in unoptimized code:
-//  b8 imm32    mov EAX, immediate
-class EdgeCounter : public ValueObject {
- public:
-  EdgeCounter(uword pc, const Code& ignored)
-      : end_(pc - FlowGraphCompiler::EdgeCounterIncrementSizeInBytes()) {
-    ASSERT(IsValid(end_));
-  }
-
-  static bool IsValid(uword end) {
-    return (*reinterpret_cast<uint8_t*>(end - 5) == 0xb8);
-  }
-
-  RawObject* edge_counter() const {
-    return *reinterpret_cast<RawObject**>(end_ - 4);
-  }
-
- private:
-  uword end_;
-};
+RawCode* CodePatcher::GetNativeCallAt(uword return_address,
+                                      const Code& code,
+                                      NativeFunction* target) {
+  UNREACHABLE();
+  return NULL;
+}
 
 
-RawObject* CodePatcher::GetEdgeCounterAt(uword pc, const Code& code) {
-  ASSERT(code.ContainsInstructionAt(pc));
-  EdgeCounter counter(pc, code);
-  return counter.edge_counter();
+
+intptr_t CodePatcher::InstanceCallSizeInBytes() {
+  return InstanceCall::kPatternSize;
 }
 
 }  // namespace dart
diff --git a/runtime/vm/code_patcher_mips.cc b/runtime/vm/code_patcher_mips.cc
index 1794ab8..09b06a2 100644
--- a/runtime/vm/code_patcher_mips.cc
+++ b/runtime/vm/code_patcher_mips.cc
@@ -12,48 +12,39 @@
 
 namespace dart {
 
-uword CodePatcher::GetStaticCallTargetAt(uword return_address,
-                                         const Code& code) {
+RawCode* CodePatcher::GetStaticCallTargetAt(uword return_address,
+                                            const Code& code) {
   ASSERT(code.ContainsInstructionAt(return_address));
   CallPattern call(return_address, code);
-  return call.TargetAddress();
+  return call.TargetCode();
 }
 
 
 void CodePatcher::PatchStaticCallAt(uword return_address,
                                     const Code& code,
-                                    uword new_target) {
+                                    const Code& new_target) {
   ASSERT(code.ContainsInstructionAt(return_address));
   CallPattern call(return_address, code);
-  call.SetTargetAddress(new_target);
+  call.SetTargetCode(new_target);
 }
 
 
-void CodePatcher::PatchInstanceCallAt(uword return_address,
-                                      const Code& code,
-                                      uword new_target) {
-  ASSERT(code.ContainsInstructionAt(return_address));
-  CallPattern call(return_address, code);
-  call.SetTargetAddress(new_target);
-}
-
-
-void CodePatcher::InsertCallAt(uword start, uword target) {
+void CodePatcher::InsertDeoptimizationCallAt(uword start, uword target) {
   // The inserted call should not overlap the lazy deopt jump code.
-  ASSERT(start + CallPattern::kFixedLengthInBytes <= target);
-  CallPattern::InsertAt(start, target);
+  ASSERT(start + CallPattern::kDeoptCallLengthInBytes <= target);
+  CallPattern::InsertDeoptCallAt(start, target);
 }
 
 
-uword 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));
   CallPattern call(return_address, code);
   if (ic_data != NULL) {
     *ic_data = call.IcData();
   }
-  return call.TargetAddress();
+  return call.TargetCode();
 }
 
 
@@ -77,45 +68,24 @@
 }
 
 
-// This class pattern matches on a load from the object pool.  Loading on
-// MIPS is complicated because it can take four possible different forms.
-// We match backwards from the end of the sequence so we can reuse the code
-// for matching object pool loads at calls.
-class EdgeCounter : public ValueObject {
- public:
-  EdgeCounter(uword pc, const Code& code)
-      : end_(pc - kAdjust),
-        object_pool_(ObjectPool::Handle(code.GetObjectPool())) {
-    // An IsValid predicate is complicated and duplicates the code in the
-    // decoding function.  Instead we rely on decoding the pattern which
-    // will assert partial validity.
-  }
-
-  RawObject* edge_counter() const {
-    Register ignored;
-    intptr_t index;
-    InstructionPattern::DecodeLoadWordFromPool(end_, &ignored, &index);
-    ASSERT(ignored == T0);
-    return object_pool_.ObjectAt(index);
-  }
-
- private:
-  // The object pool load is followed by the fixed-size edge counter
-  // incrementing code:
-  //     lw r9, 11(r8)
-  //     addiu r9, r9, 2
-  //     sw r9, 11(r8)
-  static const intptr_t kAdjust = 3 * Instr::kInstrSize;
-
-  uword end_;
-  const ObjectPool& object_pool_;
-};
+void CodePatcher::PatchNativeCallAt(uword return_address,
+                                    const Code& code,
+                                    NativeFunction target,
+                                    const Code& trampoline) {
+  ASSERT(code.ContainsInstructionAt(return_address));
+  NativeCallPattern call(return_address, code);
+  call.set_target(trampoline);
+  call.set_native_function(target);
+}
 
 
-RawObject* CodePatcher::GetEdgeCounterAt(uword pc, const Code& code) {
-  ASSERT(code.ContainsInstructionAt(pc));
-  EdgeCounter counter(pc, code);
-  return counter.edge_counter();
+RawCode* CodePatcher::GetNativeCallAt(uword return_address,
+                                      const Code& code,
+                                      NativeFunction* target) {
+  ASSERT(code.ContainsInstructionAt(return_address));
+  NativeCallPattern call(return_address, code);
+  *target = call.native_function();
+  return call.target();
 }
 
 }  // namespace dart
diff --git a/runtime/vm/code_patcher_x64.cc b/runtime/vm/code_patcher_x64.cc
index 1f3f8e1..d0ac739 100644
--- a/runtime/vm/code_patcher_x64.cc
+++ b/runtime/vm/code_patcher_x64.cc
@@ -16,53 +16,97 @@
 
 namespace dart {
 
-// The expected pattern of a Dart unoptimized call (static and instance):
-//   0: 49 8b 9f imm32  mov RBX, [PP + off]
-//   7: 41 ff 97 imm32  call [PP + off]
-//  14 <- return address
+
+static bool MatchesPattern(uword addr, int16_t* pattern, intptr_t size) {
+  uint8_t* bytes = reinterpret_cast<uint8_t*>(addr);
+  for (intptr_t i = 0; i < size; i++) {
+    int16_t val = pattern[i];
+    if ((val >= 0) && (val != bytes[i])) {
+      return false;
+    }
+  }
+  return true;
+}
+
+
+intptr_t IndexFromPPLoad(uword start) {
+  int32_t offset = *reinterpret_cast<int32_t*>(start);
+  return ObjectPool::IndexFromOffset(offset);
+}
+
+
 class UnoptimizedCall : public ValueObject {
  public:
   UnoptimizedCall(uword return_address, const Code& code)
-      : start_(return_address - kCallPatternSize),
-        object_pool_(ObjectPool::Handle(code.GetObjectPool())) {
-    ASSERT(IsValid(return_address));
+      : object_pool_(ObjectPool::Handle(code.GetObjectPool())),
+        start_(return_address - kCallPatternSize) {
     ASSERT((kCallPatternSize - 7) == Assembler::kCallExternalLabelSize);
+    ASSERT(IsValid());
   }
 
-  static const int kCallPatternSize = 14;
+  static const int kCallPatternSize = 22;
 
-  static bool IsValid(uword return_address) {
-    uint8_t* code_bytes =
-        reinterpret_cast<uint8_t*>(return_address - kCallPatternSize);
-    return (code_bytes[0] == 0x49) && (code_bytes[1] == 0x8B) &&
-           (code_bytes[2] == 0x9F) &&
-           (code_bytes[7] == 0x41) && (code_bytes[8] == 0xFF) &&
-           (code_bytes[9] == 0x97);
+  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
+    };
+    return MatchesPattern(start_, pattern, kCallPatternSize);
+  }
+
+  intptr_t argument_index() const {
+    return IndexFromPPLoad(start_ + 3);
   }
 
   RawObject* ic_data() const {
-    intptr_t index = InstructionPattern::IndexFromPPLoad(start_ + 3);
-    return object_pool_.ObjectAt(index);
+    return object_pool_.ObjectAt(argument_index());
   }
 
-  uword target() const {
-    intptr_t index = InstructionPattern::IndexFromPPLoad(start_ + 10);
-    return object_pool_.RawValueAt(index);
+  RawCode* target() const {
+    intptr_t index = IndexFromPPLoad(start_ + 10);
+    Code& code = Code::Handle();
+    code ^= object_pool_.ObjectAt(index);
+    return code.raw();
   }
 
-  void set_target(uword target) const {
-    intptr_t index = InstructionPattern::IndexFromPPLoad(start_ + 10);
-    object_pool_.SetRawValueAt(index, target);
+  void set_target(const Code& target) const {
+    intptr_t index = IndexFromPPLoad(start_ + 10);
+    object_pool_.SetObjectAt(index, target);
     // No need to flush the instruction cache, since the code is not modified.
   }
 
+ protected:
+  const ObjectPool& object_pool_;
+
  private:
   uword start_;
-  const ObjectPool& object_pool_;
   DISALLOW_IMPLICIT_CONSTRUCTORS(UnoptimizedCall);
 };
 
 
+class NativeCall : public UnoptimizedCall {
+ public:
+  NativeCall(uword return_address, const Code& code)
+      : UnoptimizedCall(return_address, code) {
+  }
+
+  NativeFunction native_function() const {
+    return reinterpret_cast<NativeFunction>(
+        object_pool_.RawValueAt(argument_index()));
+  }
+
+  void set_native_function(NativeFunction func) const {
+    object_pool_.SetRawValueAt(argument_index(),
+        reinterpret_cast<uword>(func));
+  }
+
+ private:
+  DISALLOW_IMPLICIT_CONSTRUCTORS(NativeCall);
+};
+
+
 class InstanceCall : public UnoptimizedCall {
  public:
   InstanceCall(uword return_address, const Code& code)
@@ -96,36 +140,38 @@
 
 
 // The expected pattern of a call where the target is loaded from
-// the object pool:
-//   0: 41 ff 97 imm32  call [PP + off]
-//   7: <- return address
+// the object pool.
 class PoolPointerCall : public ValueObject {
  public:
   explicit PoolPointerCall(uword return_address, const Code& code)
       : start_(return_address - kCallPatternSize),
         object_pool_(ObjectPool::Handle(code.GetObjectPool())) {
-    ASSERT(IsValid(return_address));
+    ASSERT(IsValid());
   }
 
-  static const int kCallPatternSize = 7;
+  static const int kCallPatternSize = 15;
 
-  static bool IsValid(uword return_address) {
-    uint8_t* code_bytes =
-        reinterpret_cast<uint8_t*>(return_address - kCallPatternSize);
-    return (code_bytes[0] == 0x41) && (code_bytes[1] == 0xFF) &&
-           (code_bytes[2] == 0x97);
+  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
+    };
+    return MatchesPattern(start_, pattern, kCallPatternSize);
   }
 
   intptr_t pp_index() const {
-    return InstructionPattern::IndexFromPPLoad(start_ + 3);
+    return IndexFromPPLoad(start_ + 3);
   }
 
-  uword Target() const {
-    return object_pool_.RawValueAt(pp_index());
+  RawCode* Target() const {
+    Code& code = Code::Handle();
+    code ^= object_pool_.ObjectAt(pp_index());
+    return code.raw();
   }
 
-  void SetTarget(uword target) const {
-    object_pool_.SetRawValueAt(pp_index(), target);
+  void SetTarget(const Code& target) const {
+    object_pool_.SetObjectAt(pp_index(), target);
     // No need to flush the instruction cache, since the code is not modified.
   }
 
@@ -138,8 +184,8 @@
 };
 
 
-uword CodePatcher::GetStaticCallTargetAt(uword return_address,
-                                         const Code& code) {
+RawCode* CodePatcher::GetStaticCallTargetAt(uword return_address,
+                                            const Code& code) {
   ASSERT(code.ContainsInstructionAt(return_address));
   PoolPointerCall call(return_address, code);
   return call.Target();
@@ -148,32 +194,23 @@
 
 void CodePatcher::PatchStaticCallAt(uword return_address,
                                     const Code& code,
-                                    uword new_target) {
+                                    const Code& new_target) {
   PatchPoolPointerCallAt(return_address, code, new_target);
 }
 
 
 void CodePatcher::PatchPoolPointerCallAt(uword return_address,
                                          const Code& code,
-                                         uword new_target) {
+                                         const Code& new_target) {
   ASSERT(code.ContainsInstructionAt(return_address));
   PoolPointerCall call(return_address, code);
   call.SetTarget(new_target);
 }
 
 
-void CodePatcher::PatchInstanceCallAt(uword return_address,
-                                      const Code& code,
-                                      uword new_target) {
-  ASSERT(code.ContainsInstructionAt(return_address));
-  InstanceCall call(return_address, code);
-  call.set_target(new_target);
-}
-
-
-uword 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, code);
   if (ic_data != NULL) {
@@ -188,13 +225,13 @@
 }
 
 
-void CodePatcher::InsertCallAt(uword start, uword target) {
+void CodePatcher::InsertDeoptimizationCallAt(uword start, uword target) {
   // The inserted call should not overlap the lazy deopt jump code.
-  ASSERT(start + ShortCallPattern::InstructionLength() <= target);
+  ASSERT(start + ShortCallPattern::pattern_length_in_bytes() <= target);
   *reinterpret_cast<uint8_t*>(start) = 0xE8;
   ShortCallPattern call(start);
   call.SetTargetAddress(target);
-  CPU::FlushICache(start, ShortCallPattern::InstructionLength());
+  CPU::FlushICache(start, ShortCallPattern::pattern_length_in_bytes());
 }
 
 
@@ -211,35 +248,24 @@
 }
 
 
-// The expected code pattern of an edge counter in unoptimized code:
-//  49 8b 87 imm32    mov RAX, [PP + offset]
-class EdgeCounter : public ValueObject {
- public:
-  EdgeCounter(uword pc, const Code& code)
-      : end_(pc - FlowGraphCompiler::EdgeCounterIncrementSizeInBytes()),
-        object_pool_(ObjectPool::Handle(code.GetObjectPool())) {
-    ASSERT(IsValid(end_));
-  }
-
-  static bool IsValid(uword end) {
-    uint8_t* bytes = reinterpret_cast<uint8_t*>(end - 7);
-    return (bytes[0] == 0x49) && (bytes[1] == 0x8b) && (bytes[2] == 0x87);
-  }
-
-  RawObject* edge_counter() const {
-    return object_pool_.ObjectAt(InstructionPattern::IndexFromPPLoad(end_ - 4));
-  }
-
- private:
-  uword end_;
-  const ObjectPool& object_pool_;
-};
+void CodePatcher::PatchNativeCallAt(uword return_address,
+                                    const Code& code,
+                                    NativeFunction target,
+                                    const Code& trampoline) {
+  ASSERT(code.ContainsInstructionAt(return_address));
+  NativeCall call(return_address, code);
+  call.set_target(trampoline);
+  call.set_native_function(target);
+}
 
 
-RawObject* CodePatcher::GetEdgeCounterAt(uword pc, const Code& code) {
-  ASSERT(code.ContainsInstructionAt(pc));
-  EdgeCounter counter(pc, code);
-  return counter.edge_counter();
+RawCode* CodePatcher::GetNativeCallAt(uword return_address,
+                                      const Code& code,
+                                      NativeFunction* target) {
+  ASSERT(code.ContainsInstructionAt(return_address));
+  NativeCall call(return_address, code);
+  *target = call.native_function();
+  return call.target();
 }
 
 }  // namespace dart
diff --git a/runtime/vm/compiler.cc b/runtime/vm/compiler.cc
index 001f980..5d683ce 100644
--- a/runtime/vm/compiler.cc
+++ b/runtime/vm/compiler.cc
@@ -64,11 +64,11 @@
 DEFINE_FLAG(bool, verify_compiler, false,
     "Enable compiler verification assertions");
 
+DECLARE_FLAG(bool, background_compilation);
 DECLARE_FLAG(bool, load_deferred_eagerly);
 DECLARE_FLAG(bool, trace_failed_optimization_attempts);
 DECLARE_FLAG(bool, trace_inlining_intervals);
 DECLARE_FLAG(bool, trace_irregexp);
-DECLARE_FLAG(bool, trace_patching);
 
 
 bool Compiler::always_optimize_ = false;
@@ -187,20 +187,21 @@
 RawError* Compiler::Compile(const Library& library, const Script& script) {
   LongJumpScope jump;
   if (setjmp(*jump.Set()) == 0) {
-    Isolate* const isolate = Isolate::Current();
-    StackZone zone(isolate);
+    Thread* const thread = Thread::Current();
+    StackZone zone(thread);
     if (FLAG_trace_compiler) {
       const String& script_url = String::Handle(script.url());
       // TODO(iposva): Extract script kind.
-      ISL_Print("Compiling %s '%s'\n", "", script_url.ToCString());
+      THR_Print("Compiling %s '%s'\n", "", script_url.ToCString());
     }
     const String& library_key = String::Handle(library.private_key());
     script.Tokenize(library_key);
     Parser::ParseCompilationUnit(library, script);
     return Error::null();
   } else {
-    Isolate* const isolate = Isolate::Current();
-    StackZone zone(isolate);
+    Thread* const thread = Thread::Current();
+    Isolate* const isolate = thread->isolate();
+    StackZone zone(thread);
     Error& error = Error::Handle();
     error = isolate->object_store()->sticky_error();
     isolate->object_store()->clear_sticky_error();
@@ -211,13 +212,14 @@
 }
 
 
-static void AddRelatedClassesToList(const Class& cls,
-                                    const GrowableObjectArray& parse_list,
-                                    const GrowableObjectArray& patch_list) {
-  Isolate* isolate = Isolate::Current();
-  Class& parse_class = Class::Handle(isolate);
-  AbstractType& interface_type = Type::Handle(isolate);
-  Array& interfaces = Array::Handle(isolate);
+static void AddRelatedClassesToList(
+    const Class& cls,
+    GrowableHandlePtrArray<const Class>* parse_list,
+    GrowableHandlePtrArray<const Class>* patch_list) {
+  Zone* zone = Thread::Current()->zone();
+  Class& parse_class = Class::Handle(zone);
+  AbstractType& interface_type = Type::Handle(zone);
+  Array& interfaces = Array::Handle(zone);
 
   // Add all the interfaces implemented by the class that have not been
   // already parsed to the parse list. Mark the interface as parsed so that
@@ -227,7 +229,7 @@
     interface_type ^= interfaces.At(i);
     parse_class ^= interface_type.type_class();
     if (!parse_class.is_finalized() && !parse_class.is_marked_for_parsing()) {
-      parse_list.Add(parse_class);
+      parse_list->Add(parse_class);
       parse_class.set_is_marked_for_parsing();
     }
   }
@@ -238,7 +240,7 @@
   parse_class ^= cls.SuperClass();
   while (!parse_class.IsNull()) {
     if (!parse_class.is_finalized() && !parse_class.is_marked_for_parsing()) {
-      parse_list.Add(parse_class);
+      parse_list->Add(parse_class);
       parse_class.set_is_marked_for_parsing();
     }
     parse_class ^= parse_class.SuperClass();
@@ -250,7 +252,7 @@
   parse_class ^= cls.patch_class();
   if (!parse_class.IsNull()) {
     if (!parse_class.is_finalized() && !parse_class.is_marked_for_parsing()) {
-      patch_list.Add(parse_class);
+      patch_list->Add(parse_class);
       parse_class.set_is_marked_for_parsing();
     }
   }
@@ -280,31 +282,30 @@
       ClassFinalizer::FinalizeClass(cls);
       return Error::null();
     } else {
-      Isolate* isolate = Isolate::Current();
-      Error& error = Error::Handle(isolate);
+      Thread* thread = Thread::Current();
+      Isolate* isolate = thread->isolate();
+      Error& error = Error::Handle(thread->zone());
       error = isolate->object_store()->sticky_error();
       isolate->object_store()->clear_sticky_error();
       return error.raw();
     }
   }
 
-  Isolate* const isolate = Isolate::Current();
+  Thread* const thread = Thread::Current();
+  Isolate* const isolate = thread->isolate();
+  StackZone zone(thread);
   // 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
   // error.
-  VMTagScope tagScope(isolate, VMTag::kCompileClassTagId);
-  Class& parse_class = Class::Handle(isolate);
-  const GrowableObjectArray& parse_list =
-      GrowableObjectArray::Handle(isolate, GrowableObjectArray::New(4));
-  const GrowableObjectArray& patch_list =
-      GrowableObjectArray::Handle(isolate, GrowableObjectArray::New(4));
+  VMTagScope tagScope(thread, VMTag::kCompileClassTagId);
+  GrowableHandlePtrArray<const Class> parse_list(thread->zone(), 4);
+  GrowableHandlePtrArray<const Class> patch_list(thread->zone(), 4);
 
   // Parse the class and all the interfaces it implements and super classes.
   LongJumpScope jump;
   if (setjmp(*jump.Set()) == 0) {
-    StackZone zone(isolate);
     if (FLAG_trace_compiler) {
-      ISL_Print("Compiling Class %s '%s'\n", "", cls.ToCString());
+      THR_Print("Compiling Class %s '%s'\n", "", cls.ToCString());
     }
 
     // Add the primary class which needs to be parsed to the parse list.
@@ -319,34 +320,33 @@
     // to it by AddRelatedClassesToList. It is not OK to hoist
     // parse_list.Length() into a local variable and iterate using the local
     // variable.
-    for (intptr_t i = 0; i < parse_list.Length(); i++) {
-      parse_class ^= parse_list.At(i);
-      AddRelatedClassesToList(parse_class, parse_list, patch_list);
+    for (intptr_t i = 0; i < parse_list.length(); i++) {
+      AddRelatedClassesToList(parse_list.At(i), &parse_list, &patch_list);
     }
 
     // Parse all the classes that have been added above.
-    for (intptr_t i = (parse_list.Length() - 1); i >=0 ; i--) {
-      parse_class ^= parse_list.At(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);
     }
 
     // Parse all the patch classes that have been added above.
-    for (intptr_t i = 0; i < patch_list.Length(); i++) {
-      parse_class ^= patch_list.At(i);
+    for (intptr_t i = 0; i < patch_list.length(); i++) {
+      const Class& parse_class = patch_list.At(i);
       ASSERT(!parse_class.IsNull());
       Parser::ParseClass(parse_class);
     }
 
     // Finalize these classes.
-    for (intptr_t i = (parse_list.Length() - 1); i >=0 ; i--) {
-      parse_class ^= parse_list.At(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--) {
-      parse_class ^= patch_list.At(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);
       parse_class.reset_is_marked_for_parsing();
@@ -355,21 +355,19 @@
     return Error::null();
   } else {
     // Reset the marked for parsing flags.
-    for (intptr_t i = 0; i < parse_list.Length(); i++) {
-      parse_class ^= parse_list.At(i);
+    for (intptr_t i = 0; i < parse_list.length(); i++) {
+      const Class& parse_class = parse_list.At(i);
       if (parse_class.is_marked_for_parsing()) {
         parse_class.reset_is_marked_for_parsing();
       }
     }
-    for (intptr_t i = 0; i < patch_list.Length(); i++) {
-      parse_class ^= patch_list.At(i);
+    for (intptr_t i = 0; i < patch_list.length(); i++) {
+      const Class& parse_class = patch_list.At(i);
       if (parse_class.is_marked_for_parsing()) {
         parse_class.reset_is_marked_for_parsing();
       }
     }
-    Isolate* const isolate = Isolate::Current();
-    StackZone zone(isolate);
-    Error& error = Error::Handle(isolate);
+    Error& error = Error::Handle(zone.GetZone());
     error = isolate->object_store()->sticky_error();
     isolate->object_store()->clear_sticky_error();
     return error.raw();
@@ -392,8 +390,8 @@
   Thread* const thread = Thread::Current();
   Zone* const zone = thread->zone();
   Isolate* const isolate = thread->isolate();
-  CSTAT_TIMER_SCOPE(isolate, codegen_timer);
-  HANDLESCOPE(isolate);
+  CSTAT_TIMER_SCOPE(thread, codegen_timer);
+  HANDLESCOPE(thread);
 
   // We may reattempt compilation if the function needs to be assembled using
   // far branches on ARM and MIPS. In the else branch of the setjmp call,
@@ -405,8 +403,8 @@
   // volatile because the variable may be clobbered by a longjmp.
   volatile bool use_far_branches = false;
   while (!done) {
-    const intptr_t prev_deopt_id = isolate->deopt_id();
-    isolate->set_deopt_id(0);
+    const intptr_t prev_deopt_id = thread->deopt_id();
+    thread->set_deopt_id(0);
     LongJumpScope jump;
     if (setjmp(*jump.Set()) == 0) {
       FlowGraph* flow_graph = NULL;
@@ -418,7 +416,7 @@
       // TimerScope needs an isolate to be properly terminated in case of a
       // LongJump.
       {
-        CSTAT_TIMER_SCOPE(isolate, graphbuilder_timer);
+        CSTAT_TIMER_SCOPE(thread, graphbuilder_timer);
         ZoneGrowableArray<const ICData*>* ic_data_array =
             new(zone) ZoneGrowableArray<const ICData*>();
         if (optimized) {
@@ -430,7 +428,7 @@
           if (FLAG_print_ic_data_map) {
             for (intptr_t i = 0; i < ic_data_array->length(); i++) {
               if ((*ic_data_array)[i] != NULL) {
-                ISL_Print("%" Pd " ", i);
+                THR_Print("%" Pd " ", i);
                 FlowGraphPrinter::PrintICData(*(*ic_data_array)[i]);
               }
             }
@@ -449,7 +447,7 @@
           FlowGraphPrinter::ShouldPrint(function);
 
       if (print_flow_graph) {
-        if (osr_id == Isolate::kNoDeoptId) {
+        if (osr_id == Thread::kNoDeoptId) {
           FlowGraphPrinter::PrintGraph("Before Optimizations", flow_graph);
         } else {
           FlowGraphPrinter::PrintGraph("For OSR", flow_graph);
@@ -464,7 +462,7 @@
       }
 
       if (optimized) {
-        CSTAT_TIMER_SCOPE(isolate, ssa_timer);
+        CSTAT_TIMER_SCOPE(thread, ssa_timer);
         // Transform to SSA (virtual register 0 and no inlining arguments).
         flow_graph->ComputeSSA(0, NULL);
         DEBUG_ASSERT(flow_graph->VerifyUseLists());
@@ -485,7 +483,7 @@
         inline_id_to_function.Add(&function);
         // Top scope function has no caller (-1).
         caller_inline_id.Add(-1);
-        CSTAT_TIMER_SCOPE(isolate, graphoptimizer_timer);
+        CSTAT_TIMER_SCOPE(thread, graphoptimizer_timer);
 
         FlowGraphOptimizer optimizer(flow_graph);
         if (Compiler::always_optimize()) {
@@ -503,7 +501,7 @@
 
         // Inlining (mutates the flow graph)
         if (FLAG_use_inlining) {
-          CSTAT_TIMER_SCOPE(isolate, graphinliner_timer);
+          CSTAT_TIMER_SCOPE(thread, graphinliner_timer);
           // Propagate types to create more inlining opportunities.
           FlowGraphTypePropagator::Propagate(flow_graph);
           DEBUG_ASSERT(flow_graph->VerifyUseLists());
@@ -717,36 +715,36 @@
                                        inline_id_to_function,
                                        caller_inline_id);
       {
-        CSTAT_TIMER_SCOPE(isolate, graphcompiler_timer);
+        CSTAT_TIMER_SCOPE(thread, graphcompiler_timer);
         graph_compiler.CompileGraph();
         pipeline->FinalizeCompilation();
       }
       {
-        CSTAT_TIMER_SCOPE(isolate, codefinalizer_timer);
+        CSTAT_TIMER_SCOPE(thread, codefinalizer_timer);
         // CreateDeoptInfo uses the object pool and needs to be done before
         // FinalizeCode.
         const Array& deopt_info_array =
-            Array::Handle(isolate, graph_compiler.CreateDeoptInfo(&assembler));
-        INC_STAT(isolate, total_code_size,
+            Array::Handle(zone, graph_compiler.CreateDeoptInfo(&assembler));
+        INC_STAT(thread, total_code_size,
                  deopt_info_array.Length() * sizeof(uword));
         const Code& code = Code::Handle(
             Code::FinalizeCode(function, &assembler, optimized));
         code.set_is_optimized(optimized);
 
         const Array& intervals = graph_compiler.inlined_code_intervals();
-        INC_STAT(isolate, total_code_size,
+        INC_STAT(thread, total_code_size,
                  intervals.Length() * sizeof(uword));
         code.SetInlinedIntervals(intervals);
 
         const Array& inlined_id_array =
-            Array::Handle(isolate, graph_compiler.InliningIdToFunction());
-        INC_STAT(isolate, total_code_size,
+            Array::Handle(zone, graph_compiler.InliningIdToFunction());
+        INC_STAT(thread, total_code_size,
                  inlined_id_array.Length() * sizeof(uword));
         code.SetInlinedIdToFunction(inlined_id_array);
 
         const Array& caller_inlining_id_map_array =
-            Array::Handle(isolate, graph_compiler.CallerInliningIdMap());
-        INC_STAT(isolate, total_code_size,
+            Array::Handle(zone, graph_compiler.CallerInliningIdMap());
+        INC_STAT(thread, total_code_size,
                  caller_inlining_id_map_array.Length() * sizeof(uword));
         code.SetInlinedCallerIdMap(caller_inlining_id_map_array);
 
@@ -760,16 +758,8 @@
 
         if (optimized) {
           // We may not have previous code if 'always_optimize' is set.
-          if ((osr_id == Isolate::kNoDeoptId) && function.HasCode()) {
-            CodePatcher::PatchEntry(Code::Handle(function.CurrentCode()));
-            if (FLAG_trace_compiler || FLAG_trace_patching) {
-              if (FLAG_trace_compiler) {
-                ISL_Print("  ");
-              }
-              ISL_Print("Patch unoptimized '%s' entry point %#" Px "\n",
-                  function.ToFullyQualifiedCString(),
-                  Code::Handle(function.unoptimized_code()).EntryPoint());
-            }
+          if ((osr_id == Thread::kNoDeoptId) && function.HasCode()) {
+            Code::Handle(function.CurrentCode()).DisableDartCode();
           }
           function.AttachCode(code);
 
@@ -789,11 +779,12 @@
         } else {  // not optimized.
           if (!Compiler::always_optimize() &&
               (function.ic_data_array() == Array::null())) {
-            function.SaveICDataMap(graph_compiler.deopt_id_to_ic_data());
+            function.SaveICDataMap(
+                graph_compiler.deopt_id_to_ic_data(),
+                Array::Handle(zone, graph_compiler.edge_counters_array()));
           }
           function.set_unoptimized_code(code);
           function.AttachCode(code);
-          ASSERT(CodePatcher::CodeIsPatchable(code));
         }
         if (parsed_function->HasDeferredPrefixes()) {
           ASSERT(!FLAG_load_deferred_eagerly);
@@ -805,7 +796,7 @@
         }
       }
       // Mark that this isolate now has compiled code.
-      isolate->set_has_compiled(true);
+      isolate->set_has_compiled_code(true);
       // Exit the loop and the function with the correct result value.
       is_compiled = true;
       done = true;
@@ -825,7 +816,7 @@
         // try again (done = true), and indicate that we did not finish
         // compiling (is_compiled = false).
         if (FLAG_trace_bailout) {
-          ISL_Print("%s\n", error.ToErrorCString());
+          THR_Print("%s\n", error.ToErrorCString());
         }
         done = true;
         ASSERT(optimized);
@@ -839,7 +830,7 @@
       is_compiled = false;
     }
     // Reset global isolate state.
-    isolate->set_deopt_id(prev_deopt_id);
+    thread->set_deopt_id(prev_deopt_id);
   }
   return is_compiled;
 }
@@ -847,35 +838,35 @@
 
 static void DisassembleCode(const Function& function, bool optimized) {
   const char* function_fullname = function.ToFullyQualifiedCString();
-  ISL_Print("Code for %sfunction '%s' {\n",
+  THR_Print("Code for %sfunction '%s' {\n",
             optimized ? "optimized " : "",
             function_fullname);
   const Code& code = Code::Handle(function.CurrentCode());
   code.Disassemble();
-  ISL_Print("}\n");
+  THR_Print("}\n");
 
-  ISL_Print("Pointer offsets for function: {\n");
+  THR_Print("Pointer offsets for function: {\n");
   // Pointer offsets are stored in descending order.
   Object& obj = Object::Handle();
   for (intptr_t i = code.pointer_offsets_length() - 1; i >= 0; i--) {
     const uword addr = code.GetPointerOffsetAt(i) + code.EntryPoint();
     obj = *reinterpret_cast<RawObject**>(addr);
-    ISL_Print(" %d : %#" Px " '%s'\n",
+    THR_Print(" %d : %#" Px " '%s'\n",
               code.GetPointerOffsetAt(i), addr, obj.ToCString());
   }
-  ISL_Print("}\n");
+  THR_Print("}\n");
 
-  ISL_Print("PC Descriptors for function '%s' {\n", function_fullname);
+  THR_Print("PC Descriptors for function '%s' {\n", function_fullname);
   PcDescriptors::PrintHeaderString();
   const PcDescriptors& descriptors =
       PcDescriptors::Handle(code.pc_descriptors());
-  ISL_Print("%s}\n", descriptors.ToCString());
+  THR_Print("%s}\n", descriptors.ToCString());
 
   uword start = Instructions::Handle(code.instructions()).EntryPoint();
   const Array& deopt_table = Array::Handle(code.deopt_info_array());
   intptr_t deopt_table_length = DeoptTable::GetLength(deopt_table);
   if (deopt_table_length > 0) {
-    ISL_Print("DeoptInfo: {\n");
+    THR_Print("DeoptInfo: {\n");
     Smi& offset = Smi::Handle();
     TypedData& info = TypedData::Handle();
     Smi& reason_and_flags = Smi::Handle();
@@ -884,31 +875,31 @@
       const intptr_t reason =
           DeoptTable::ReasonField::decode(reason_and_flags.Value());
       ASSERT((0 <= reason) && (reason < ICData::kDeoptNumReasons));
-      ISL_Print("%4" Pd ": 0x%" Px "  %s  (%s)\n",
+      THR_Print("%4" Pd ": 0x%" Px "  %s  (%s)\n",
                 i,
                 start + offset.Value(),
                 DeoptInfo::ToCString(deopt_table, info),
                 DeoptReasonToCString(
                     static_cast<ICData::DeoptReasonId>(reason)));
     }
-    ISL_Print("}\n");
+    THR_Print("}\n");
   }
 
   const ObjectPool& object_pool = ObjectPool::Handle(code.GetObjectPool());
   object_pool.DebugPrint();
 
-  ISL_Print("Stackmaps for function '%s' {\n", function_fullname);
+  THR_Print("Stackmaps for function '%s' {\n", function_fullname);
   if (code.stackmaps() != Array::null()) {
     const Array& stackmap_table = Array::Handle(code.stackmaps());
     Stackmap& map = Stackmap::Handle();
     for (intptr_t i = 0; i < stackmap_table.Length(); ++i) {
       map ^= stackmap_table.At(i);
-      ISL_Print("%s\n", map.ToCString());
+      THR_Print("%s\n", map.ToCString());
     }
   }
-  ISL_Print("}\n");
+  THR_Print("}\n");
 
-  ISL_Print("Variable Descriptors for function '%s' {\n",
+  THR_Print("Variable Descriptors for function '%s' {\n",
             function_fullname);
   const LocalVarDescriptors& var_descriptors =
       LocalVarDescriptors::Handle(code.GetLocalVarDescriptors());
@@ -921,31 +912,31 @@
     var_descriptors.GetInfo(i, &var_info);
     const int8_t kind = var_info.kind();
     if (kind == RawLocalVarDescriptors::kSavedCurrentContext) {
-      ISL_Print("  saved current CTX reg offset %d\n", var_info.index());
+      THR_Print("  saved current CTX reg offset %d\n", var_info.index());
     } else {
       if (kind == RawLocalVarDescriptors::kContextLevel) {
-        ISL_Print("  context level %d scope %d", var_info.index(),
+        THR_Print("  context level %d scope %d", var_info.index(),
             var_info.scope_id);
       } else if (kind == RawLocalVarDescriptors::kStackVar) {
-        ISL_Print("  stack var '%s' offset %d",
+        THR_Print("  stack var '%s' offset %d",
           var_name.ToCString(), var_info.index());
       } else {
         ASSERT(kind == RawLocalVarDescriptors::kContextVar);
-        ISL_Print("  context var '%s' level %d offset %d",
+        THR_Print("  context var '%s' level %d offset %d",
             var_name.ToCString(), var_info.scope_id, var_info.index());
       }
-      ISL_Print(" (valid %d-%d)\n", var_info.begin_pos, var_info.end_pos);
+      THR_Print(" (valid %d-%d)\n", var_info.begin_pos, var_info.end_pos);
     }
   }
-  ISL_Print("}\n");
+  THR_Print("}\n");
 
-  ISL_Print("Exception Handlers for function '%s' {\n", function_fullname);
+  THR_Print("Exception Handlers for function '%s' {\n", function_fullname);
   const ExceptionHandlers& handlers =
         ExceptionHandlers::Handle(code.exception_handlers());
-  ISL_Print("%s}\n", handlers.ToCString());
+  THR_Print("%s}\n", handlers.ToCString());
 
   {
-    ISL_Print("Static call target functions {\n");
+    THR_Print("Static call target functions {\n");
     const Array& table = Array::Handle(code.static_calls_target_table());
     Smi& offset = Smi::Handle();
     Function& function = Function::Handle();
@@ -960,24 +951,24 @@
         cls ^= code.owner();
         if (cls.IsNull()) {
           const String& code_name = String::Handle(code.Name());
-          ISL_Print("  0x%" Px ": %s, %p\n",
+          THR_Print("  0x%" Px ": %s, %p\n",
               start + offset.Value(),
               code_name.ToCString(),
               code.raw());
         } else {
-          ISL_Print("  0x%" Px ": allocation stub for %s, %p\n",
+          THR_Print("  0x%" Px ": allocation stub for %s, %p\n",
               start + offset.Value(),
               cls.ToCString(),
               code.raw());
         }
       } else {
-        ISL_Print("  0x%" Px ": %s, %p\n",
+        THR_Print("  0x%" Px ": %s, %p\n",
             start + offset.Value(),
             function.ToFullyQualifiedCString(),
             code.raw());
       }
     }
-    ISL_Print("}\n");
+    THR_Print("}\n");
   }
   if (optimized && FLAG_trace_inlining_intervals) {
     code.DumpInlinedIntervals();
@@ -1019,36 +1010,33 @@
   if (setjmp(*jump.Set()) == 0) {
     Thread* const thread = Thread::Current();
     Isolate* const isolate = thread->isolate();
-    StackZone stack_zone(isolate);
+    StackZone stack_zone(thread);
     Zone* const zone = stack_zone.GetZone();
-    TIMERSCOPE(isolate, time_compilation);
     Timer per_compile_timer(FLAG_trace_compiler, "Compilation time");
     per_compile_timer.Start();
 
-    // Restore unoptimized code if needed.
-    if (optimized) {
-      if (!Compiler::always_optimize()) {
-        const Error& error = Error::Handle(
-            zone, Compiler::EnsureUnoptimizedCode(Thread::Current(), function));
-        if (!error.IsNull()) {
-          return error.raw();
-        }
-      }
-    }
-
     ParsedFunction* parsed_function = new(zone) ParsedFunction(
         thread, Function::ZoneHandle(zone, function.raw()));
     if (FLAG_trace_compiler) {
-      ISL_Print("Compiling %s%sfunction: '%s' @ token %" Pd ", size %" Pd "\n",
-                (osr_id == Isolate::kNoDeoptId ? "" : "osr "),
+      THR_Print("Compiling %s%sfunction: '%s' @ token %" Pd ", size %" Pd "\n",
+                (osr_id == Thread::kNoDeoptId ? "" : "osr "),
                 (optimized ? "optimized " : ""),
                 function.ToFullyQualifiedCString(),
                 function.token_pos(),
                 (function.end_token_pos() - function.token_pos()));
     }
+    INC_STAT(thread, num_functions_compiled, 1);
+    if (optimized) {
+      INC_STAT(thread, num_functions_optimized, 1);
+    }
     {
-      HANDLESCOPE(isolate);
+      HANDLESCOPE(thread);
+      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,
+               num_tokens_after - num_tokens_before);
     }
 
     const bool success = CompileParsedFunctionHelper(pipeline,
@@ -1060,10 +1048,10 @@
         ASSERT(!Compiler::always_optimize());  // Optimized is the only code.
         // Optimizer bailed out. Disable optimizations and never try again.
         if (FLAG_trace_compiler) {
-          ISL_Print("--> disabling optimizations for '%s'\n",
+          THR_Print("--> disabling optimizations for '%s'\n",
                     function.ToFullyQualifiedCString());
         } else if (FLAG_trace_failed_optimization_attempts) {
-          ISL_Print("Cannot optimize: %s\n",
+          THR_Print("Cannot optimize: %s\n",
                     function.ToFullyQualifiedCString());
         }
         function.SetIsOptimizable(false);
@@ -1075,7 +1063,7 @@
     per_compile_timer.Stop();
 
     if (FLAG_trace_compiler) {
-      ISL_Print("--> '%s' entry: %#" Px " size: %" Pd " time: %" Pd64 " us\n",
+      THR_Print("--> '%s' entry: %#" Px " size: %" Pd " time: %" Pd64 " us\n",
                 function.ToFullyQualifiedCString(),
                 Code::Handle(function.CurrentCode()).EntryPoint(),
                 Code::Handle(function.CurrentCode()).Size(),
@@ -1090,9 +1078,9 @@
                optimized &&
                FlowGraphPrinter::ShouldPrint(function)) {
       // TODO(fschneider): Print unoptimized code along with the optimized code.
-      ISL_Print("*** BEGIN CODE\n");
+      THR_Print("*** BEGIN CODE\n");
       DisassembleCode(function, true);
-      ISL_Print("*** END CODE\n");
+      THR_Print("*** END CODE\n");
     }
 #if defined(DEBUG)
     CheckInliningIntervals(function);
@@ -1101,7 +1089,7 @@
   } else {
     Thread* const thread = Thread::Current();
     Isolate* const isolate = thread->isolate();
-    StackZone stack_zone(isolate);
+    StackZone stack_zone(thread);
     Error& error = Error::Handle();
     // We got an error during compilation.
     error = isolate->object_store()->sticky_error();
@@ -1116,8 +1104,8 @@
 RawError* Compiler::CompileFunction(Thread* thread,
                                     const Function& function) {
   Isolate* isolate = thread->isolate();
-  VMTagScope tagScope(isolate, VMTag::kCompileUnoptimizedTagId);
-  TIMELINE_FUNCTION_COMPILATION_DURATION(isolate, "Function", function);
+  VMTagScope tagScope(thread, VMTag::kCompileUnoptimizedTagId);
+  TIMELINE_FUNCTION_COMPILATION_DURATION(thread, "Function", function);
 
   if (!isolate->compilation_allowed()) {
     FATAL3("Precompilation missed function %s (%" Pd ", %s)\n",
@@ -1133,12 +1121,12 @@
       Compiler::always_optimize() && function.IsOptimizable();
 
   return CompileFunctionHelper(pipeline, function, optimized,
-      Isolate::kNoDeoptId);
+      Thread::kNoDeoptId);
 }
 
 
 RawError* Compiler::EnsureUnoptimizedCode(Thread* thread,
-                                     const Function& function) {
+                                          const Function& function) {
   if (function.unoptimized_code() != Object::null()) {
     return Error::null();
   }
@@ -1149,7 +1137,7 @@
   CompilationPipeline* pipeline =
       CompilationPipeline::New(thread->zone(), function);
   const Error& error = Error::Handle(
-      CompileFunctionHelper(pipeline, function, false, Isolate::kNoDeoptId));
+      CompileFunctionHelper(pipeline, function, false, Thread::kNoDeoptId));
   if (!error.IsNull()) {
     return error.raw();
   }
@@ -1161,7 +1149,7 @@
   }
   ASSERT(function.unoptimized_code() != Object::null());
   if (FLAG_trace_compiler) {
-    ISL_Print("Ensure unoptimized code for %s\n", function.ToCString());
+    THR_Print("Ensure unoptimized code for %s\n", function.ToCString());
   }
   return Error::null();
 }
@@ -1170,11 +1158,14 @@
 RawError* Compiler::CompileOptimizedFunction(Thread* thread,
                                              const Function& function,
                                              intptr_t osr_id) {
-  Isolate* isolate = thread->isolate();
-  VMTagScope tagScope(isolate, VMTag::kCompileOptimizedTagId);
-  TIMELINE_FUNCTION_COMPILATION_DURATION(isolate,
+  VMTagScope tagScope(thread, VMTag::kCompileOptimizedTagId);
+  TIMELINE_FUNCTION_COMPILATION_DURATION(thread,
                                          "OptimizedFunction", function);
 
+  // Optimization must happen in non-mutator/Dart thread if background
+  // compilation is on.
+  ASSERT(!FLAG_background_compilation ||
+         !thread->isolate()->MutatorThreadIsCurrentThread());
   CompilationPipeline* pipeline =
       CompilationPipeline::New(thread->zone(), function);
   return CompileFunctionHelper(pipeline, function, true, osr_id);
@@ -1191,7 +1182,7 @@
     CompileParsedFunctionHelper(&pipeline,
                                 parsed_function,
                                 false,
-                                Isolate::kNoDeoptId);
+                                Thread::kNoDeoptId);
     if (FLAG_disassemble) {
       DisassembleCode(parsed_function->function(), false);
     }
@@ -1278,25 +1269,16 @@
 }
 
 
-static void CreateLocalVarDescriptors(const ParsedFunction& parsed_function) {
-  const Function& func = parsed_function.function();
-  LocalVarDescriptors& var_descs = LocalVarDescriptors::Handle();
-  var_descs = parsed_function.node_sequence()->scope()->GetVarDescriptors(func);
-  Code::Handle(func.unoptimized_code()).set_var_descriptors(var_descs);
-}
-
-
 void Compiler::CompileStaticInitializer(const Field& field) {
   ASSERT(field.is_static());
-  if (field.initializer() != Function::null()) {
+  if (field.HasPrecompiledInitializer()) {
     // TODO(rmacnak): Investigate why this happens for _enum_names.
     OS::Print("Warning: Ignoring repeated request for initializer for %s\n",
               field.ToCString());
     return;
   }
-  ASSERT(field.initializer() == Function::null());
-  Isolate* isolate = Isolate::Current();
-  StackZone zone(isolate);
+  Thread* thread = Thread::Current();
+  StackZone zone(thread);
 
   ParsedFunction* parsed_function = Parser::ParseStaticFieldInitializer(field);
 
@@ -1306,10 +1288,10 @@
   CompileParsedFunctionHelper(&pipeline,
                               parsed_function,
                               false,  // optimized
-                              Isolate::kNoDeoptId);
+                              Thread::kNoDeoptId);
 
   const Function& initializer = parsed_function->function();
-  field.set_initializer(initializer);
+  field.SetPrecompiledInitializer(initializer);
 }
 
 
@@ -1317,18 +1299,17 @@
   ASSERT(field.is_static());
   // The VM sets the field's value to transiton_sentinel prior to
   // evaluating the initializer value.
-  ASSERT(field.value() == Object::transition_sentinel().raw());
+  ASSERT(field.StaticValue() == Object::transition_sentinel().raw());
   LongJumpScope jump;
   if (setjmp(*jump.Set()) == 0) {
-    Function& initializer = Function::Handle(field.initializer());
-
     // Under precompilation, the initializer may have already been compiled, in
     // which case use it. Under lazy compilation or early in precompilation, the
     // initializer has not yet been created, so create it now, but don't bother
     // remembering it because it won't be used again.
-    if (initializer.IsNull()) {
-      Isolate* const isolate = Isolate::Current();
-      StackZone zone(isolate);
+    Function& initializer = Function::Handle();
+    if (!field.HasPrecompiledInitializer()) {
+      Thread* const thread = Thread::Current();
+      StackZone zone(thread);
       ParsedFunction* parsed_function =
           Parser::ParseStaticFieldInitializer(field);
 
@@ -1338,21 +1319,21 @@
       CompileParsedFunctionHelper(&pipeline,
                                   parsed_function,
                                   false,  // optimized
-                                  Isolate::kNoDeoptId);
-      // Eagerly create local var descriptors.
-      CreateLocalVarDescriptors(*parsed_function);
-
+                                  Thread::kNoDeoptId);
       initializer = parsed_function->function().raw();
+      Code::Handle(initializer.unoptimized_code()).set_var_descriptors(
+          Object::empty_var_descriptors());
+    } else {
+      initializer ^= field.PrecompiledInitializer();
     }
     // Invoke the function to evaluate the expression.
-    const Object& result = PassiveObject::Handle(
-        DartEntry::InvokeFunction(initializer, Object::empty_array()));
-    return result.raw();
+    return DartEntry::InvokeFunction(initializer, Object::empty_array());
   } else {
-    Isolate* const isolate = Isolate::Current();
-    StackZone zone(isolate);
+    Thread* const thread = Thread::Current();
+    Isolate* const isolate = thread->isolate();
+    StackZone zone(thread);
     const Error& error =
-        Error::Handle(isolate, isolate->object_store()->sticky_error());
+        Error::Handle(thread->zone(), isolate->object_store()->sticky_error());
     isolate->object_store()->clear_sticky_error();
     return error.raw();
   }
@@ -1367,7 +1348,7 @@
   if (setjmp(*jump.Set()) == 0) {
     Thread* const thread = Thread::Current();
     if (FLAG_trace_compiler) {
-      ISL_Print("compiling expression: ");
+      THR_Print("compiling expression: ");
       AstPrinter::PrintNode(fragment);
     }
 
@@ -1398,7 +1379,6 @@
     // here.
     ParsedFunction* parsed_function = new ParsedFunction(thread, func);
     parsed_function->SetNodeSequence(fragment);
-    parsed_function->set_default_parameter_values(Object::null_array());
     fragment->scope()->AddVariable(parsed_function->EnsureExpressionTemp());
     fragment->scope()->AddVariable(
         parsed_function->current_context_var());
@@ -1409,10 +1389,10 @@
     CompileParsedFunctionHelper(&pipeline,
                                 parsed_function,
                                 false,
-                                Isolate::kNoDeoptId);
+                                Thread::kNoDeoptId);
+    Code::Handle(func.unoptimized_code()).set_var_descriptors(
+        Object::empty_var_descriptors());
 
-    // Eagerly create local var descriptors.
-    CreateLocalVarDescriptors(*parsed_function);
     const Object& result = PassiveObject::Handle(
         DartEntry::InvokeFunction(func, Object::empty_array()));
     return result.raw();
@@ -1428,4 +1408,158 @@
   return Object::null();
 }
 
+
+// A simple work queue containing functions to be optimized. Use
+// PushFront and PopBack to add and read from queue.
+// TODO(srdjan): Write a more efficient implementation.
+class CompilationWorkQueue : public ValueObject {
+ public:
+  explicit CompilationWorkQueue(Isolate* isolate) :
+      data_(GrowableObjectArray::Handle()) {
+    data_ = isolate->background_compilation_queue();
+  }
+
+  intptr_t IsEmpty() const { return data_.Length() == 0; }
+
+  // Adds to the queue only if 'function' is not already in there.
+  void PushFront(const Function& function) {
+    for (intptr_t i = 0; i < data_.Length(); i++) {
+      if (data_.At(i) == function.raw()) {
+        return;
+      }
+    }
+    // Insert new element in front.
+    Object& f = Object::Handle();
+    data_.Add(f);
+    for (intptr_t i = data_.Length() - 1; i > 0; i--) {
+      f = data_.At(i - 1);
+      data_.SetAt(i, f);
+    }
+    data_.SetAt(0, function);
+  }
+
+  RawFunction* PopBack() {
+    ASSERT(!IsEmpty());
+    Object& result = Object::Handle();
+    result = data_.At(data_.Length() - 1);
+    data_.SetLength(data_.Length() - 1);
+    return Function::Cast(result).raw();
+  }
+
+ private:
+  GrowableObjectArray& data_;
+
+  DISALLOW_IMPLICIT_CONSTRUCTORS(CompilationWorkQueue);
+};
+
+
+BackgroundCompiler::BackgroundCompiler(Isolate* isolate)
+    : isolate_(isolate), running_(true), done_(new bool()),
+      monitor_(new Monitor()), done_monitor_(new Monitor())  {
+  *done_ = false;
+}
+
+
+void BackgroundCompiler::Run() {
+  while (running_) {
+    {
+      // Wait to be notified when the work queue is not empty.
+      MonitorLocker ml(monitor_);
+      ml.Wait();
+    }
+
+    Thread::EnterIsolateAsHelper(isolate_);
+    {
+      Thread* thread = Thread::Current();
+      StackZone stack_zone(thread);
+      HANDLESCOPE(thread);
+      Function& function = Function::Handle();
+      function = RemoveOrNull();
+      while (!function.IsNull()) {
+        const Error& error = Error::Handle(
+            Compiler::CompileOptimizedFunction(thread, function));
+        // TODO(srdjan): We do not expect errors while compiling optimized
+        // code, any errors should have been caught when compiling
+        // unoptimized code.
+        // If it still happens mark function as not optimizable.
+        ASSERT(error.IsNull());
+        function = RemoveOrNull();
+      }
+    }
+    Thread::ExitIsolateAsHelper();
+  }
+  {
+    // Notify that the thread is done.
+    MonitorLocker ml_done(done_monitor_);
+    *done_ = true;
+    ml_done.Notify();
+  }
+}
+
+
+void BackgroundCompiler::CompileOptimized(const Function& function) {
+  Add(function);
+}
+
+
+void BackgroundCompiler::Add(const Function& f) const {
+  MonitorLocker ml(monitor_);
+  CompilationWorkQueue queue(isolate_);
+  queue.PushFront(f);
+  ml.Notify();
+}
+
+
+RawFunction* BackgroundCompiler::RemoveOrNull() const {
+  MonitorLocker ml(monitor_);
+  CompilationWorkQueue queue(isolate_);
+  return queue.IsEmpty() ? Function::null() : queue.PopBack();
+}
+
+
+void BackgroundCompiler::Stop(BackgroundCompiler* task) {
+  if (task == NULL) {
+    return;
+  }
+  Monitor* monitor = task->monitor_;
+  Monitor* done_monitor = task->done_monitor_;
+  bool* task_done = task->done_;
+  // Wake up compiler task and stop it.
+  {
+    MonitorLocker ml(task->monitor_);
+    task->running_ = false;
+    // 'task' will be deleted by thread pool.
+    task = NULL;
+    ml.Notify();
+  }
+
+  {
+    MonitorLocker ml_done(done_monitor);
+    while (!(*task_done)) {
+      ml_done.Wait();
+    }
+  }
+  delete task_done;
+  delete done_monitor;
+  delete monitor;
+}
+
+
+void BackgroundCompiler::EnsureInit(Isolate* isolate) {
+  bool start_task = false;
+  {
+    MutexLocker ml(isolate->mutex());
+    if (isolate->background_compiler() == NULL) {
+      BackgroundCompiler* task = new BackgroundCompiler(isolate);
+      isolate->set_background_compiler(task);
+      isolate->set_background_compilation_queue(GrowableObjectArray::Handle(
+          isolate->current_zone(), GrowableObjectArray::New()));
+      start_task = true;
+    }
+  }
+  if (start_task) {
+    Dart::thread_pool()->Run(isolate->background_compiler());
+  }
+}
+
 }  // namespace dart
diff --git a/runtime/vm/compiler.h b/runtime/vm/compiler.h
index 746d5d8..9c3e73f 100644
--- a/runtime/vm/compiler.h
+++ b/runtime/vm/compiler.h
@@ -8,6 +8,7 @@
 #include "vm/allocation.h"
 #include "vm/growable_array.h"
 #include "vm/runtime_entry.h"
+#include "vm/thread_pool.h"
 
 namespace dart {
 
@@ -20,8 +21,6 @@
 class Script;
 class SequenceNode;
 
-DECLARE_RUNTIME_ENTRY(CompileFunction);
-
 class Compiler : public AllStatic {
  public:
   // Extracts top level entities from the script and populates
@@ -51,7 +50,7 @@
   static RawError* CompileOptimizedFunction(
       Thread* thread,
       const Function& function,
-      intptr_t osr_id = Isolate::kNoDeoptId);
+      intptr_t osr_id = Thread::kNoDeoptId);
 
   // Generates code for given parsed function (without parsing it again) and
   // sets its code field.
@@ -101,6 +100,35 @@
   static bool allow_recompilation_;
 };
 
+
+// Class to run optimizing compilation in a background thread.
+// Current implementation: one task per isolate, it dies with the owning
+// isolate.
+class BackgroundCompiler : public ThreadPool::Task {
+ public:
+  static void EnsureInit(Isolate* isolate);
+
+  static void Stop(BackgroundCompiler* task);
+
+  void CompileOptimized(const Function& function);
+
+ private:
+  explicit BackgroundCompiler(Isolate* isolate);
+
+  virtual void Run();
+
+  void Add(const Function& f) const;
+  RawFunction* RemoveOrNull() const;
+
+  Isolate* isolate_;
+  bool running_;
+  bool* done_;
+  Monitor* monitor_;
+  Monitor* done_monitor_;
+
+  DISALLOW_IMPLICIT_CONSTRUCTORS(BackgroundCompiler);
+};
+
 }  // namespace dart
 
 #endif  // VM_COMPILER_H_
diff --git a/runtime/vm/compiler_stats.cc b/runtime/vm/compiler_stats.cc
index 2a03611..d3e4b02 100644
--- a/runtime/vm/compiler_stats.cc
+++ b/runtime/vm/compiler_stats.cc
@@ -5,6 +5,7 @@
 #include "vm/compiler_stats.h"
 
 #include "vm/flags.h"
+#include "vm/log.h"
 #include "vm/object_graph.h"
 #include "vm/timer.h"
 
@@ -12,18 +13,21 @@
 namespace dart {
 
 DEFINE_FLAG(bool, compiler_stats, false, "Compiler stat counters.");
+DEFINE_FLAG(bool, compiler_benchmark, false,
+            "Compiler stat counters for benchmark.");
 
 
-class TokenStreamVisitor : public ObjectGraph::Visitor {
+class TokenStreamVisitor : public ObjectVisitor {
  public:
-  explicit TokenStreamVisitor(CompilerStats* compiler_stats)
-      : obj_(Object::Handle()), stats_(compiler_stats) {
+  TokenStreamVisitor(Isolate* isolate, CompilerStats* compiler_stats)
+      : ObjectVisitor(isolate),
+        obj_(Object::Handle()),
+        stats_(compiler_stats) {
   }
 
-  virtual Direction VisitObject(ObjectGraph::StackIterator* it) {
-    RawObject* raw_obj = it->Get();
+  void VisitObject(RawObject* raw_obj) {
     if (raw_obj->IsFreeListElement()) {
-      return kProceed;
+      return;
     }
     obj_ = raw_obj;
     if (obj_.GetClassId() == TokenStream::kClassId) {
@@ -42,7 +46,6 @@
         kind = tkit.CurrentTokenKind();
       }
     }
-    return kProceed;
   }
 
  private:
@@ -70,107 +73,223 @@
       num_tokens_total(0),
       num_literal_tokens_total(0),
       num_ident_tokens_total(0),
+      num_tokens_scanned(0),
       num_tokens_consumed(0),
-      num_token_checks(0),
-      num_tokens_lookahead(0),
-      num_classes_compiled(0),
+      num_cached_consts(0),
+      num_const_cache_hits(0),
+      num_classes_parsed(0),
+      num_class_tokens(0),
+      num_functions_parsed(0),
       num_functions_compiled(0),
+      num_functions_optimized(0),
+      num_func_tokens_compiled(0),
       num_implicit_final_getters(0),
+      num_method_extractors(0),
       src_length(0),
       total_code_size(0),
       total_instr_size(0),
       pc_desc_size(0),
-      vardesc_size(0) {
+      vardesc_size(0),
+      text(NULL),
+      use_benchmark_output(false) {
 }
 
 
-void CompilerStats::Print() {
-  if (!FLAG_compiler_stats) {
-    return;
-  }
+// This function is used as a callback in the log object to which the
+// compiler stats are printed. It will be called only once, to print
+// the accumulated text when all of the compiler stats values are
+// added to the log.
+static void PrintToStats(const char* format, ...) PRINTF_ATTRIBUTE(1, 2);
+static void PrintToStats(const char* format, ...) {
+  Thread* thread = Thread::Current();
+  Isolate* isolate = thread->isolate();
+  CompilerStats* stats = isolate->compiler_stats();
+  Zone* zone = thread->zone();
+  ASSERT(stats != NULL);
+  va_list args;
+  va_start(args, format);
+  stats->text = zone->VPrint(format, args);
+  va_end(args);
+}
 
+
+void CompilerStats::Update() {
   // Traverse the heap and compute number of tokens in all
   // TokenStream objects.
   num_tokens_total = 0;
   num_literal_tokens_total = 0;
   num_ident_tokens_total = 0;
-  TokenStreamVisitor visitor(this);
-  ObjectGraph graph(isolate_);
-  graph.IterateObjects(&visitor);
+  TokenStreamVisitor visitor(isolate_, this);
+  isolate_->heap()->IterateObjects(&visitor);
+  Dart::vm_isolate()->heap()->IterateObjects(&visitor);
+}
 
-  OS::Print("==== Compiler Stats for isolate '%s' ====\n",
+
+void CompilerStats::EnableBenchmark() {
+  FLAG_compiler_stats = true;
+  use_benchmark_output = true;
+}
+
+
+// Generate output for Golem benchmark harness. If the output format
+// changes, the parsing function in Golem must be updated.
+char* CompilerStats::BenchmarkOutput() {
+  Update();
+  Log log(PrintToStats);
+  LogBlock lb(Thread::Current(), &log);
+  log.Print("==== Compiler Stats for isolate '%s' ====\n",
             isolate_->debugger_name());
-  OS::Print("Number of tokens:   %" Pd64 "\n", num_tokens_total);
-  OS::Print("  Literal tokens:   %" Pd64 "\n", num_literal_tokens_total);
-  OS::Print("  Ident tokens:     %" Pd64 "\n", num_ident_tokens_total);
-  OS::Print("Tokens consumed:    %" Pd64 " (%.2f times number of tokens)\n",
-            num_tokens_consumed,
-            (1.0 * num_tokens_consumed) / num_tokens_total);
-  OS::Print("Tokens checked:     %" Pd64 "  (%.2f times tokens consumed)\n",
-            num_token_checks, (1.0 * num_token_checks) / num_tokens_consumed);
-  OS::Print("Token lookahead:    %" Pd64 " (%" Pd64 "%% of tokens checked)\n",
-            num_tokens_lookahead,
-            (100 * num_tokens_lookahead) / num_token_checks);
 
-  OS::Print("Classes parsed:     %" Pd64 "\n", num_classes_compiled);
-  OS::Print("Functions compiled: %" Pd64 "\n", num_functions_compiled);
-  OS::Print("  Impl getters:     %" Pd64 "\n", num_implicit_final_getters);
+  log.Print("NumberOfTokens: %" Pd64 "\n", num_tokens_total);
+  log.Print("NumClassesParsed: %" Pd64 "\n", num_classes_parsed);
+  log.Print("NumFunctionsCompiled: %" Pd64 "\n", num_functions_compiled);
+  log.Print("NumFunctionsOptimized: %" Pd64 "\n", num_functions_optimized);
+  log.Print("NumFunctionsParsed: %" Pd64 "\n", num_functions_parsed);
 
-  OS::Print("Source length:      %" Pd64 " characters\n", src_length);
+  // Scanner stats.
   int64_t scan_usecs = scanner_timer.TotalElapsedTime();
-  OS::Print("Scanner time:       %" Pd64 " msecs\n",
-            scan_usecs / 1000);
+  int64_t scan_speed =
+      scan_usecs > 0 ? 1000 * num_tokens_scanned / scan_usecs : 0;
+  log.Print("NumTokensScanned: %" Pd64 " tokens\n", num_tokens_scanned);
+  log.Print("ScannerTime: %" Pd64 " ms\n", scan_usecs / 1000);
+  log.Print("ScannerSpeed: %" Pd64 " tokens/ms\n", scan_speed);
+
+  // Parser stats.
   int64_t parse_usecs = parser_timer.TotalElapsedTime();
-  OS::Print("Parser time:        %" Pd64 " msecs\n",
-            parse_usecs / 1000);
+  int64_t parse_speed =
+      parse_usecs > 0 ? 1000 * num_tokens_consumed / parse_usecs : 0;
+  log.Print("NumTokensParsed: %" Pd64 " tokens\n", num_tokens_consumed);
+  log.Print("ParserTime: %" Pd64 " ms\n", parse_usecs / 1000);
+  log.Print("ParserSpeed: %" Pd64 " tokens/ms\n", parse_speed);
+
+  // Compiler stats.
   int64_t codegen_usecs = codegen_timer.TotalElapsedTime();
-  OS::Print("Code gen. time:     %" Pd64 " msecs\n",
-            codegen_usecs / 1000);
+  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;
+  log.Print("NumTokensCompiled: %" Pd64 " tokens\n", num_func_tokens_compiled);
+  log.Print("CompilerTime: %" Pd64 " ms\n", compile_usecs / 1000);
+
+  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;
+
+  log.Print("CodeDensity: %" Pd64 " tokens/KB\n", code_density);
+  log.Print("InstrSize: %" Pd64 " KB\n", total_instr_size / 1024);
+  log.Flush();
+  char* benchmark_text = text;
+  text = NULL;
+  return benchmark_text;
+}
+
+
+char* CompilerStats::PrintToZone() {
+  if (!FLAG_compiler_stats) {
+    return NULL;
+  } else if (use_benchmark_output) {
+    return BenchmarkOutput();
+  }
+
+  Update();
+
+  Log log(PrintToStats);
+  LogBlock lb(Thread::Current(), &log);
+
+  log.Print("==== Compiler Stats for isolate '%s' ====\n",
+            isolate_->debugger_name());
+  log.Print("Number of tokens:        %" Pd64 "\n", num_tokens_total);
+  log.Print("  Literal tokens:        %" Pd64 "\n", num_literal_tokens_total);
+  log.Print("  Ident tokens:          %" Pd64 "\n", num_ident_tokens_total);
+  log.Print("Source length:           %" Pd64 " characters\n", src_length);
+  log.Print("Number of source tokens: %" Pd64 "\n", num_tokens_scanned);
+
+  log.Print("==== Parser stats:\n");
+  log.Print("Total tokens consumed:   %" Pd64 "\n", num_tokens_consumed);
+  log.Print("Classes parsed:          %" Pd64 "\n", num_classes_parsed);
+  log.Print("  Tokens consumed:       %" Pd64 "\n", num_class_tokens);
+  log.Print("Functions parsed:        %" Pd64 "\n", num_functions_parsed);
+  log.Print("  Tokens consumed:       %" Pd64 "\n", num_func_tokens_compiled);
+  log.Print("Impl getter funcs:       %" Pd64 "\n", num_implicit_final_getters);
+  log.Print("Impl method extractors:  %" Pd64 "\n", num_method_extractors);
+  log.Print("Consts cached:           %" Pd64 "\n", num_cached_consts);
+  log.Print("Consts cache hits:       %" Pd64 "\n", num_const_cache_hits);
+
+  int64_t scan_usecs = scanner_timer.TotalElapsedTime();
+  log.Print("Scanner time:            %" Pd64 " ms\n", scan_usecs / 1000);
+  int64_t scan_speed =
+      scan_usecs > 0 ? 1000 * num_tokens_consumed / scan_usecs : 0;
+  log.Print("Scanner speed:           %" Pd64 " tokens/ms\n", scan_speed);
+  int64_t parse_usecs = parser_timer.TotalElapsedTime();
+  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);
+
+  int64_t codegen_usecs = codegen_timer.TotalElapsedTime();
+
+  log.Print("==== Backend stats:\n");
+  log.Print("Code gen. time:          %" Pd64 " ms\n", codegen_usecs / 1000);
   int64_t graphbuilder_usecs = graphbuilder_timer.TotalElapsedTime();
-  OS::Print("  Graph builder:    %" Pd64 " msecs\n", graphbuilder_usecs / 1000);
+  log.Print("  Graph builder:         %" Pd64 " ms\n",
+            graphbuilder_usecs / 1000);
   int64_t ssa_usecs = ssa_timer.TotalElapsedTime();
-  OS::Print("  Graph SSA:        %" Pd64 " msecs\n", ssa_usecs / 1000);
+  log.Print("  Graph SSA:             %" Pd64 " ms\n", ssa_usecs / 1000);
 
   int64_t graphinliner_usecs = graphinliner_timer.TotalElapsedTime();
-  OS::Print("  Graph inliner:    %" Pd64 " msecs\n", graphinliner_usecs / 1000);
+  log.Print("  Graph inliner:         %" Pd64 " ms\n",
+            graphinliner_usecs / 1000);
   int64_t graphinliner_parse_usecs =
       graphinliner_parse_timer.TotalElapsedTime();
-  OS::Print("    Parsing:        %" Pd64 " msecs\n",
+  log.Print("    Parsing:             %" Pd64 " ms\n",
             graphinliner_parse_usecs / 1000);
   int64_t graphinliner_build_usecs =
       graphinliner_build_timer.TotalElapsedTime();
-  OS::Print("    Building:       %" Pd64 " msecs\n",
+  log.Print("    Building:            %" Pd64 " ms\n",
             graphinliner_build_usecs / 1000);
   int64_t graphinliner_ssa_usecs = graphinliner_ssa_timer.TotalElapsedTime();
-  OS::Print("    SSA:            %" Pd64 " msecs\n",
+  log.Print("    SSA:                 %" Pd64 " ms\n",
             graphinliner_ssa_usecs / 1000);
   int64_t graphinliner_opt_usecs = graphinliner_opt_timer.TotalElapsedTime();
-  OS::Print("    Optimization:   %" Pd64 " msecs\n",
+  log.Print("    Optimization:        %" Pd64 " ms\n",
             graphinliner_opt_usecs / 1000);
   int64_t graphinliner_subst_usecs =
       graphinliner_subst_timer.TotalElapsedTime();
-  OS::Print("    Substitution:   %" Pd64 " msecs\n",
+  log.Print("    Substitution:        %" Pd64 " ms\n",
             graphinliner_subst_usecs / 1000);
-
   int64_t graphoptimizer_usecs = graphoptimizer_timer.TotalElapsedTime();
-  OS::Print("  Graph optimizer:  %" Pd64 " msecs\n",
+  log.Print("  Graph optimizer:       %" Pd64 " ms\n",
             (graphoptimizer_usecs - graphinliner_usecs) / 1000);
   int64_t graphcompiler_usecs = graphcompiler_timer.TotalElapsedTime();
-  OS::Print("  Graph compiler:   %" Pd64 " msecs\n",
+  log.Print("  Graph compiler:        %" Pd64 " ms\n",
             graphcompiler_usecs / 1000);
   int64_t codefinalizer_usecs = codefinalizer_timer.TotalElapsedTime();
-  OS::Print("  Code finalizer:   %" Pd64 " msecs\n",
+  log.Print("  Code finalizer:        %" Pd64 " ms\n",
             codefinalizer_usecs / 1000);
-  OS::Print("Compilation speed:  %" Pd64 " tokens per msec\n",
-            (1000 * num_tokens_total) / (parse_usecs + codegen_usecs));
-  OS::Print("Code density:       %" Pd64 " tokens per KB\n",
-            (num_tokens_total * 1024) / total_instr_size);
-  OS::Print("Instr size:         %" Pd64 " KB\n",
-            total_instr_size / 1024);
-  OS::Print("Pc Desc size:       %" Pd64 " KB\n", pc_desc_size / 1024);
-  OS::Print("VarDesc size:       %" Pd64 " KB\n", vardesc_size / 1024);
 
-  OS::Print("Code size:          %" Pd64 " KB\n", total_code_size / 1024);
+  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;
+  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;
+  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("  Pc Desc size:          %" Pd64 " KB\n", pc_desc_size / 1024);
+  log.Print("  VarDesc size:          %" Pd64 " KB\n", vardesc_size / 1024);
+  log.Flush();
+  char* stats_text = text;
+  text = NULL;
+  return stats_text;
 }
 
 }  // namespace dart
diff --git a/runtime/vm/compiler_stats.h b/runtime/vm/compiler_stats.h
index a9ea0f1..4487991 100644
--- a/runtime/vm/compiler_stats.h
+++ b/runtime/vm/compiler_stats.h
@@ -11,13 +11,11 @@
 #include "vm/timer.h"
 
 
-
 namespace dart {
 
-DECLARE_FLAG(bool, compiler_stats);
 
-// TODO(hausner): Might want to expose some of these values in the
-// observatory. Use the metrics mechanism (metrics.h) for this.
+DECLARE_FLAG(bool, compiler_stats);
+DECLARE_FLAG(bool, compiler_benchmark);
 
 class CompilerStats {
  public:
@@ -26,8 +24,6 @@
 
   Isolate* isolate_;
 
-  // TODO(hausner): add these timers to the timer list maintained
-  // in the isolate?
   Timer parser_timer;         // Cumulative runtime of parser.
   Timer scanner_timer;        // Cumulative runtime of scanner.
   Timer codegen_timer;        // Cumulative runtime of code generator.
@@ -44,33 +40,52 @@
   Timer graphcompiler_timer;   // Included in codegen_timer.
   Timer codefinalizer_timer;   // Included in codegen_timer.
 
-  int64_t num_tokens_total;
+  int64_t num_tokens_total;    // Isolate + VM isolate
   int64_t num_literal_tokens_total;
   int64_t num_ident_tokens_total;
+  int64_t num_tokens_scanned;
   int64_t num_tokens_consumed;
-  int64_t num_token_checks;
-  int64_t num_tokens_lookahead;
+  int64_t num_cached_consts;
+  int64_t num_const_cache_hits;
 
-  int64_t num_classes_compiled;
-  int64_t num_functions_compiled;
+  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_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 pc_desc_size;
   int64_t vardesc_size;
+  char* text;
+  bool use_benchmark_output;
 
-  void Print();
+  // Update stats that are computed, e.g. token count.
+  void Update();
+
+  void EnableBenchmark();
+  char* BenchmarkOutput();
+  char* PrintToZone();
 };
 
-#define INC_STAT(isolate, counter, incr)                                       \
-  if (FLAG_compiler_stats) { (isolate)->compiler_stats()->counter += (incr); }
+// TODO(hausner): make the increment thread-safe.
+#define INC_STAT(thread, counter, incr)                                        \
+  if (FLAG_compiler_stats) {                                                   \
+      (thread)->isolate()->compiler_stats()->counter += (incr); }
 
-#define CSTAT_TIMER_SCOPE(iso, t)                                              \
+#define STAT_VALUE(thread, counter)                                            \
+  ((FLAG_compiler_stats != false) ?                                            \
+      (thread)->isolate()->compiler_stats()->counter : 0)
+
+#define CSTAT_TIMER_SCOPE(thr, t)                                              \
   TimerScope timer(FLAG_compiler_stats,                                        \
-  FLAG_compiler_stats ? &((iso)->compiler_stats()->t) : NULL,                  \
-  iso);
+      FLAG_compiler_stats ? &((thr)->isolate()->compiler_stats()->t) : NULL,   \
+      thr);
 
 }  // namespace dart
 
diff --git a/runtime/vm/compiler_test.cc b/runtime/vm/compiler_test.cc
index aa5b892..19e4953 100644
--- a/runtime/vm/compiler_test.cc
+++ b/runtime/vm/compiler_test.cc
@@ -9,6 +9,7 @@
 #include "vm/dart_api_impl.h"
 #include "vm/object.h"
 #include "vm/symbols.h"
+#include "vm/thread_pool.h"
 #include "vm/unit_test.h"
 
 namespace dart {
@@ -69,6 +70,99 @@
 }
 
 
+class CompileFunctionTask : public ThreadPool::Task {
+ public:
+  CompileFunctionTask(Isolate* isolate,
+                      const Function& func,
+                      Monitor* done_monitor,
+                      bool* done)
+      : isolate_(isolate),
+        func_(func),
+        done_monitor_(done_monitor),
+        done_(done) {
+  }
+
+  virtual void Run() {
+    Thread::EnterIsolateAsHelper(isolate_);
+    {
+      Thread* thread = Thread::Current();
+      StackZone stack_zone(thread);
+      HANDLESCOPE(thread);
+      EXPECT(func_.HasCode());
+      EXPECT(!func_.HasOptimizedCode());
+      const Error& err =
+          Error::Handle(Compiler::CompileOptimizedFunction(thread, func_));
+      EXPECT(err.IsNull());
+      EXPECT(func_.HasOptimizedCode());
+    }
+    Thread::ExitIsolateAsHelper();
+    // Tell main thread that we are done.
+    {
+      MonitorLocker ml(done_monitor_);
+      ASSERT(!*done_);
+      *done_ = true;
+      ml.Notify();
+    }
+  }
+
+ private:
+  Isolate* isolate_;
+  const Function& func_;
+  Monitor* done_monitor_;
+  bool* done_;
+};
+
+
+TEST_CASE(CompileFunctionOnHelperThread) {
+  Monitor done_monitor;
+  bool done = false;
+  Isolate* isolate = Thread::Current()->isolate();
+  // Flush store buffers, etc.
+  // TODO(koda): Currently, the GC only does this for the current thread, (i.e,
+  // the helper, in this test), but it should be done for all *threads*
+  // after/at safepointing.
+  Thread::PrepareForGC();
+
+  // Create a simple function and compile it without optimization.
+  const char* kScriptChars =
+            "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));
+  Library& lib = Library::Handle(Library::CoreLibrary());
+  EXPECT(CompilerTest::TestCompileScript(lib, script));
+  EXPECT(ClassFinalizer::ProcessPendingClasses());
+  Class& cls = Class::Handle(
+      lib.LookupClass(String::Handle(Symbols::New("A"))));
+  EXPECT(!cls.IsNull());
+  String& function_foo_name = String::Handle(String::New("foo"));
+  Function& func =
+      Function::Handle(cls.LookupStaticFunction(function_foo_name));
+  EXPECT(!func.HasCode());
+  CompilerTest::TestCompileFunction(func);
+  EXPECT(func.HasCode());
+  EXPECT(!func.HasOptimizedCode());
+
+  // Now optimize it on a helper thread.
+  Dart::thread_pool()->Run(
+      new CompileFunctionTask(isolate, func, &done_monitor, &done));
+  {
+    // Manually wait.
+    // TODO(koda): Replace with execution of Dart and/or VM code when GC
+    // actually safepoints everything.
+    MonitorLocker ml(&done_monitor);
+    while (!done) {
+      ml.Wait();
+    }
+  }
+}
+
+
 TEST_CASE(RegenerateAllocStubs) {
   const char* kScriptChars =
             "class A {\n"
@@ -89,8 +183,8 @@
       lib_handle.LookupClass(String::Handle(Symbols::New("A"))));
   EXPECT(!cls.IsNull());
 
-  Isolate* isolate = Isolate::Current();
-  const Code& stub = Code::Handle(isolate,
+  Zone* zone = thread->zone();
+  const Code& stub = Code::Handle(zone,
                                   StubCode::GetAllocationStubForClass(cls));
   Class& owner = Class::Handle();
   owner ^= stub.owner();
diff --git a/runtime/vm/constant_propagator.cc b/runtime/vm/constant_propagator.cc
index 29818e1..61c09a6 100644
--- a/runtime/vm/constant_propagator.cc
+++ b/runtime/vm/constant_propagator.cc
@@ -431,7 +431,7 @@
     ASSERT(value.IsBool());
     bool result = Bool::Cast(value).value();
     SetValue(instr,
-             Smi::Handle(I, Smi::New(
+             Smi::Handle(Z, Smi::New(
                  result ? instr->if_true() : instr->if_false())));
   }
 }
@@ -521,9 +521,9 @@
         !left.IsBigint() && !right.IsBigint()) {
       const bool result = CompareIntegers(
           instr->kind(),
-          Integer::Handle(I, Integer::Cast(left).BitOp(Token::kBIT_AND,
+          Integer::Handle(Z, Integer::Cast(left).BitOp(Token::kBIT_AND,
                                                        Integer::Cast(right))),
-          Smi::Handle(I, Smi::New(0)));
+          Smi::Handle(Z, Smi::New(0)));
       SetValue(instr, result ? Bool::True() : Bool::False());
     } else {
       SetValue(instr, non_constant_);
@@ -662,14 +662,14 @@
       if (array_obj.IsString()) {
         const String& str = String::Cast(array_obj);
         if (str.Length() > index) {
-          SetValue(instr, Smi::Handle(I,
+          SetValue(instr, Smi::Handle(Z,
               Smi::New(static_cast<intptr_t>(str.CharAt(index)))));
           return;
         }
       } else if (array_obj.IsArray()) {
         const Array& a = Array::Cast(array_obj);
         if ((a.Length() > index) && a.IsImmutable()) {
-          Instance& result = Instance::Handle(I);
+          Instance& result = Instance::Handle(Z);
           result ^= a.At(index);
           SetValue(instr, result);
           return;
@@ -706,7 +706,7 @@
 void ConstantPropagator::VisitLoadStaticField(LoadStaticFieldInstr* instr) {
   const Field& field = instr->StaticField();
   ASSERT(field.is_static());
-  Instance& obj = Instance::Handle(I, field.value());
+  Instance& obj = Instance::Handle(Z, field.StaticValue());
   if (field.is_final() && (obj.raw() != Object::sentinel().raw()) &&
       (obj.raw() != Object::transition_sentinel().raw())) {
     if (obj.IsSmi() || obj.IsOld()) {
@@ -761,7 +761,7 @@
       const Instance& instance = Instance::Cast(value);
       const AbstractType& checked_type = instr->type();
       if (instr->instantiator()->BindsToConstantNull() &&
-        instr->instantiator_type_arguments()->BindsToConstantNull()) {
+          instr->instantiator_type_arguments()->BindsToConstantNull()) {
         const TypeArguments& checked_type_arguments = TypeArguments::Handle();
         Error& bound_error = Error::Handle();
         bool is_instance = instance.IsInstanceOf(checked_type,
@@ -924,7 +924,7 @@
       const Integer& left_int = Integer::Cast(left);
       const Integer& right_int = Integer::Cast(right);
       const Integer& result =
-          Integer::Handle(I, binary_op->Evaluate(left_int, right_int));
+          Integer::Handle(Z, binary_op->Evaluate(left_int, right_int));
       if (!result.IsNull()) {
         SetValue(binary_op, Integer::ZoneHandle(Z, result.raw()));
         return;
@@ -983,7 +983,7 @@
   if (IsConstant(value) && value.IsInteger()) {
     const Integer& value_int = Integer::Cast(value);
     const Integer& result =
-        Integer::Handle(I, unary_op->Evaluate(value_int));
+        Integer::Handle(Z, unary_op->Evaluate(value_int));
     if (!result.IsNull()) {
       SetValue(unary_op, Integer::ZoneHandle(Z, result.raw()));
       return;
@@ -1018,9 +1018,9 @@
 void ConstantPropagator::VisitSmiToDouble(SmiToDoubleInstr* instr) {
   const Object& value = instr->value()->definition()->constant_value();
   if (IsConstant(value) && value.IsInteger()) {
-    SetValue(instr, Double::Handle(I,
+    SetValue(instr, Double::Handle(Z,
         Double::New(Integer::Cast(value).AsDoubleValue(), Heap::kOld)));
-  } else if (IsNonConstant(value)) {
+  } else if (!IsUnknown(value)) {
     SetValue(instr, non_constant_);
   }
 }
@@ -1029,9 +1029,9 @@
 void ConstantPropagator::VisitMintToDouble(MintToDoubleInstr* instr) {
   const Object& value = instr->value()->definition()->constant_value();
   if (IsConstant(value) && value.IsInteger()) {
-    SetValue(instr, Double::Handle(I,
+    SetValue(instr, Double::Handle(Z,
         Double::New(Integer::Cast(value).AsDoubleValue(), Heap::kOld)));
-  } else if (IsNonConstant(value)) {
+  } else if (!IsUnknown(value)) {
     SetValue(instr, non_constant_);
   }
 }
@@ -1040,9 +1040,9 @@
 void ConstantPropagator::VisitInt32ToDouble(Int32ToDoubleInstr* instr) {
   const Object& value = instr->value()->definition()->constant_value();
   if (IsConstant(value) && value.IsInteger()) {
-    SetValue(instr, Double::Handle(I,
+    SetValue(instr, Double::Handle(Z,
         Double::New(Integer::Cast(value).AsDoubleValue(), Heap::kOld)));
-  } else if (IsNonConstant(value)) {
+  } else if (!IsUnknown(value)) {
     SetValue(instr, non_constant_);
   }
 }
diff --git a/runtime/vm/constants_arm.h b/runtime/vm/constants_arm.h
index c4487b6..9bd7640 100644
--- a/runtime/vm/constants_arm.h
+++ b/runtime/vm/constants_arm.h
@@ -45,11 +45,11 @@
   R14 = 14,
   kLastFreeCpuRegister = 14,
   R15 = 15,
-  FP  = 11,
-  IP  = 12,
-  SP  = 13,
-  LR  = 14,
-  PC  = 15,
+  FP  = R11,
+  IP  = R12,
+  SP  = R13,
+  LR  = R14,
+  PC  = R15,
   kNumberOfCpuRegisters = 16,
 };
 
@@ -231,13 +231,14 @@
 // Register aliases.
 const Register TMP = IP;  // Used as scratch register by assembler.
 const Register TMP2 = kNoRegister;  // There is no second assembler temporary.
-const Register CTX = R9;  // Location of current context at method entry.
-const Register PP = R10;  // Caches object pool pointer in generated code.
+const Register CTX = R10;  // Location of current context at method entry.
+const Register PP = R9;  // 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.
 const Register ICREG = R5;  // IC data register.
 const Register ARGS_DESC_REG = R4;
+const Register CODE_REG = R10;
 const Register THR = R8;  // Caches current thread in generated code.
 
 // R15 encodes APSR in the vmrs instruction.
diff --git a/runtime/vm/constants_arm64.h b/runtime/vm/constants_arm64.h
index f84cf68..ab76fd1 100644
--- a/runtime/vm/constants_arm64.h
+++ b/runtime/vm/constants_arm64.h
@@ -111,6 +111,7 @@
 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 CODE_REG = R24;
 const Register FPREG = FP;  // Frame pointer register.
 const Register SPREG = R18;  // Stack pointer register.
 const Register LRREG = LR;  // Link register.
diff --git a/runtime/vm/constants_ia32.h b/runtime/vm/constants_ia32.h
index f1edc35..0950639 100644
--- a/runtime/vm/constants_ia32.h
+++ b/runtime/vm/constants_ia32.h
@@ -63,6 +63,7 @@
 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.
diff --git a/runtime/vm/constants_mips.h b/runtime/vm/constants_mips.h
index 5c721b3..fed178f 100644
--- a/runtime/vm/constants_mips.h
+++ b/runtime/vm/constants_mips.h
@@ -179,6 +179,7 @@
 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 SPREG = SP;  // Stack pointer register.
 const Register FPREG = FP;  // Frame pointer register.
diff --git a/runtime/vm/constants_x64.h b/runtime/vm/constants_x64.h
index fdded5f..c2b48c5 100644
--- a/runtime/vm/constants_x64.h
+++ b/runtime/vm/constants_x64.h
@@ -86,13 +86,14 @@
 // Register aliases.
 const Register TMP = R11;  // Used as scratch register by the assembler.
 const Register TMP2 = kNoRegister;  // No second assembler scratch register.
-const Register CTX = R9;  // Location of current context at method entry.
+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 ARGS_DESC_REG = R10;  // Arguments descriptor register.
+const Register CODE_REG = R12;
 const Register THR = R14;  // Caches current thread in generated code.
 
 // Exception object is passed in this register to the catch handlers when an
diff --git a/runtime/vm/counters.cc b/runtime/vm/counters.cc
deleted file mode 100644
index 7e43d9a..0000000
--- a/runtime/vm/counters.cc
+++ /dev/null
@@ -1,40 +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.
-
-#include "vm/counters.h"
-
-#include <string.h>
-#include <map>  // TODO(koda): Remove STL dependencies.
-
-#include "platform/globals.h"
-#include "vm/os.h"
-
-namespace dart {
-
-struct CStrLess {
-  bool operator()(const char* a, const char* b) const {
-    return strcmp(a, b) < 0;
-  }
-};
-
-
-Counters::~Counters() {
-  if (collision_) {
-    OS::PrintErr("Counters table collision; increase Counters::kSize.");
-    return;
-  }
-  typedef std::map<const char*, int64_t, CStrLess> TotalsMap;
-  TotalsMap totals;
-  for (int i = 0; i < kSize; ++i) {
-    const Counter& counter = counters_[i];
-    if (counter.name != NULL) {
-      totals[counter.name] += counter.value;
-    }
-  }
-  for (TotalsMap::iterator it = totals.begin(); it != totals.end(); ++it) {
-    OS::PrintErr("%s: %" Pd64 "\n", it->first, it->second);
-  }
-}
-
-}  // namespace dart
diff --git a/runtime/vm/counters.h b/runtime/vm/counters.h
deleted file mode 100644
index ee79b69..0000000
--- a/runtime/vm/counters.h
+++ /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.
-
-#ifndef VM_COUNTERS_H_
-#define VM_COUNTERS_H_
-
-#include "platform/assert.h"
-
-namespace dart {
-
-struct Counter {
-  Counter() : name(NULL), value(0) {}
-  const char* name;
-  int64_t value;
-};
-
-
-// Light-weight stats counters for temporary experiments/debugging.
-// A single statement is enough to add a counter:
-//   ...
-//   Isolate::Current()->counters()->Increment("allocated", size_in_bytes);
-//   ...
-class Counters {
- public:
-  Counters() : collision_(false) {}
-
-  // Adds 'delta' to the named counter. 'name' must be a literal string.
-  void Increment(const char* name, int64_t delta) {
-    Counter& counter =
-      counters_[reinterpret_cast<uword>(name) & (kSize - 1)];
-    if (counter.name != name && counter.name != NULL) {
-      collision_ = true;
-    }
-    counter.name = name;
-    counter.value += delta;
-  }
-
-  // Prints all counters to stderr.
-  ~Counters();
-
- private:
-  enum { kSize = 1024 };
-  COMPILE_ASSERT((0 == (kSize & (kSize - 1))));  // kSize is a power of 2.
-  Counter counters_[kSize];
-  bool collision_;
-};
-
-}  // namespace dart
-
-#endif  // VM_COUNTERS_H_
diff --git a/runtime/vm/coverage.cc b/runtime/vm/coverage.cc
index cef0201..73fb5b6 100644
--- a/runtime/vm/coverage.cc
+++ b/runtime/vm/coverage.cc
@@ -72,7 +72,6 @@
   }
   Thread* thread = Thread::Current();
   Zone* zone = thread->zone();
-  Isolate* isolate = thread->isolate();
   // Make sure we have the unoptimized code for this function available.
   if (Compiler::EnsureUnoptimizedCode(thread, function) != Error::null()) {
     // Ignore the error and this function entirely.
@@ -96,7 +95,7 @@
   PcDescriptors::Iterator iter(descriptors,
       RawPcDescriptors::kIcCall | RawPcDescriptors::kUnoptStaticCall);
   while (iter.MoveNext()) {
-    HANDLESCOPE(isolate);
+    HANDLESCOPE(thread);
     const ICData* ic_data = (*ic_data_array)[iter.DeoptId()];
     if (!ic_data->IsNull()) {
       const intptr_t token_pos = iter.TokenPos();
@@ -104,32 +103,33 @@
       if ((token_pos < begin_pos) || (token_pos > end_pos)) {
         continue;
       }
-      intptr_t line = pos_to_line[token_pos];
-#if defined(DEBUG)
-      const Script& script = Script::Handle(zone, function.script());
-      intptr_t test_line = -1;
-      script.GetTokenLocation(token_pos, &test_line, NULL);
-      ASSERT(test_line == line);
-#endif
-      // Merge hit data where possible.
-      if (last_line == line) {
-        last_count += ic_data->AggregateCount();
-      } else {
-        if ((last_line != -1) && !as_call_sites) {
-          hits_or_sites.AddValue(last_line);
-          hits_or_sites.AddValue(last_count);
-        }
-        last_count = ic_data->AggregateCount();
-        last_line = line;
-      }
       if (as_call_sites) {
         bool is_static_call = iter.Kind() == RawPcDescriptors::kUnoptStaticCall;
         ic_data->PrintToJSONArray(hits_or_sites, token_pos, is_static_call);
+      } else {
+        intptr_t line = pos_to_line[token_pos];
+#if defined(DEBUG)
+        const Script& script = Script::Handle(zone, function.script());
+        intptr_t test_line = -1;
+        script.GetTokenLocation(token_pos, &test_line, NULL);
+        ASSERT(test_line == line);
+#endif
+        // Merge hit data where possible.
+        if (last_line == line) {
+          last_count += ic_data->AggregateCount();
+        } else {
+          if ((last_line != -1)) {
+            hits_or_sites.AddValue(last_line);
+            hits_or_sites.AddValue(last_count);
+          }
+          last_count = ic_data->AggregateCount();
+          last_line = line;
+        }
       }
     }
   }
   // Write last hit value if needed.
-  if ((last_line != -1) && !as_call_sites) {
+  if (!as_call_sites && (last_line != -1)) {
     hits_or_sites.AddValue(last_line);
     hits_or_sites.AddValue(last_count);
   }
@@ -141,8 +141,8 @@
                               const JSONArray& jsarr,
                               CoverageFilter* filter,
                               bool as_call_sites) {
-  Isolate* isolate = Isolate::Current();
-  if (cls.EnsureIsFinalized(isolate) != Error::null()) {
+  Thread* thread = Thread::Current();
+  if (cls.EnsureIsFinalized(thread) != Error::null()) {
     // Only classes that have been finalized do have a meaningful list of
     // functions.
     return;
@@ -156,7 +156,7 @@
   GrowableArray<intptr_t> pos_to_line;
   int i = 0;
   while (i < functions.Length()) {
-    HANDLESCOPE(isolate);
+    HANDLESCOPE(thread);
     function ^= functions.At(i);
     script = function.script();
     saved_url = script.url();
@@ -164,7 +164,9 @@
       i++;
       continue;
     }
-    ComputeTokenPosToLineNumberMap(script, &pos_to_line);
+    if (!as_call_sites) {
+      ComputeTokenPosToLineNumberMap(script, &pos_to_line);
+    }
     JSONObject jsobj(&jsarr);
     jsobj.AddProperty("source", saved_url.ToCString());
     jsobj.AddProperty("script", script);
@@ -185,10 +187,6 @@
         continue;
       }
       CompileAndAdd(function, hits_or_sites, pos_to_line, as_call_sites);
-      if (function.HasImplicitClosureFunction()) {
-        function = function.ImplicitClosureFunction();
-        CompileAndAdd(function, hits_or_sites, pos_to_line, as_call_sites);
-      }
       i++;
     }
   }
@@ -201,7 +199,7 @@
     // We need to keep rechecking the length of the closures array, as handling
     // a closure potentially adds new entries to the end.
     while (i < closures.Length()) {
-      HANDLESCOPE(isolate);
+      HANDLESCOPE(thread);
       function ^= closures.At(i);
       script = function.script();
       saved_url = script.url();
@@ -233,7 +231,7 @@
 }
 
 
-void CodeCoverage::Write(Isolate* isolate) {
+void CodeCoverage::Write(Thread* thread) {
   if (FLAG_coverage_dir == NULL) {
     return;
   }
@@ -246,15 +244,12 @@
   }
 
   JSONStream stream;
-  PrintJSON(isolate, &stream, NULL, false);
+  PrintJSON(thread, &stream, NULL, false);
 
-  const char* format = "%s/dart-cov-%" Pd "-%" Pd ".json";
   intptr_t pid = OS::ProcessId();
-  intptr_t len = OS::SNPrint(NULL, 0, format,
-                             FLAG_coverage_dir, pid, isolate->main_port());
-  char* filename = Thread::Current()->zone()->Alloc<char>(len + 1);
-  OS::SNPrint(filename, len + 1, format,
-              FLAG_coverage_dir, pid, isolate->main_port());
+  char* filename = OS::SCreate(thread->zone(),
+      "%s/dart-cov-%" Pd "-%" Pd64 ".json",
+      FLAG_coverage_dir, pid, thread->isolate()->main_port());
   void* file = (*file_open)(filename, true);
   if (file == NULL) {
     OS::Print("Failed to write coverage file: %s\n", filename);
@@ -265,7 +260,7 @@
 }
 
 
-void CodeCoverage::PrintJSON(Isolate* isolate,
+void CodeCoverage::PrintJSON(Thread* thread,
                              JSONStream* stream,
                              CoverageFilter* filter,
                              bool as_call_sites) {
@@ -274,7 +269,8 @@
     filter = &default_filter;
   }
   const GrowableObjectArray& libs = GrowableObjectArray::Handle(
-      isolate, isolate->object_store()->libraries());
+      thread->zone(),
+      thread->isolate()->object_store()->libraries());
   Library& lib = Library::Handle();
   Class& cls = Class::Handle();
   JSONObject coverage(stream);
diff --git a/runtime/vm/coverage.h b/runtime/vm/coverage.h
index 496ff65..8c2ce23 100644
--- a/runtime/vm/coverage.h
+++ b/runtime/vm/coverage.h
@@ -34,8 +34,8 @@
 
 class CodeCoverage : public AllStatic {
  public:
-  static void Write(Isolate* isolate);
-  static void PrintJSON(Isolate* isolate,
+  static void Write(Thread* thread);
+  static void PrintJSON(Thread* thread,
                         JSONStream* stream,
                         CoverageFilter* filter,
                         bool as_call_sites);
diff --git a/runtime/vm/coverage_test.cc b/runtime/vm/coverage_test.cc
index 92a98cd..1a2b0eb 100644
--- a/runtime/vm/coverage_test.cc
+++ b/runtime/vm/coverage_test.cc
@@ -39,13 +39,12 @@
       "main() {\n"
       "}";
 
-  Isolate* isolate = Isolate::Current();
   Library& lib = Library::Handle();
   lib ^= ExecuteScript(kScript);
   ASSERT(!lib.IsNull());
 
   JSONStream js;
-  CodeCoverage::PrintJSON(isolate, &js, NULL, false);
+  CodeCoverage::PrintJSON(thread, &js, NULL, false);
 
   char buf[1024];
   OS::SNPrint(buf, sizeof(buf),
@@ -72,13 +71,12 @@
       "  foo.bar();\n"
       "}\n";
 
-  Isolate* isolate = Isolate::Current();
   Library& lib = Library::Handle();
   lib ^= ExecuteScript(kScript);
   ASSERT(!lib.IsNull());
 
   JSONStream js;
-  CodeCoverage::PrintJSON(isolate, &js, NULL, false);
+  CodeCoverage::PrintJSON(thread, &js, NULL, false);
 
   char buf[1024];
   // Coverage data is printed per class, i.e., there should be two sections
@@ -115,7 +113,6 @@
       "  var foo = new Foo(7);\n"
       "}\n";
 
-  Isolate* isolate = Isolate::Current();
   Library& lib = Library::Handle();
   lib ^= ExecuteScript(kScript);
   ASSERT(!lib.IsNull());
@@ -128,7 +125,7 @@
 
   JSONStream js;
   FunctionCoverageFilter filter(func);
-  CodeCoverage::PrintJSON(isolate, &js, &filter, false);
+  CodeCoverage::PrintJSON(thread, &js, &filter, false);
   // Only expect coverage data for Foo.yetAnother() on line 6.
   char buf[1024];
   OS::SNPrint(buf, sizeof(buf),
diff --git a/runtime/vm/cpu_arm.cc b/runtime/vm/cpu_arm.cc
index 5a66954..44964d2 100644
--- a/runtime/vm/cpu_arm.cc
+++ b/runtime/vm/cpu_arm.cc
@@ -165,14 +165,21 @@
       FLAG_use_vfp;
 
   // Has integer division.
+  // Special cases:
+  // - 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.
   bool is_krait = CpuInfo::FieldContains(kCpuInfoHardware, "QCT APQ8064");
+  bool is_armada_370xp =
+      CpuInfo::FieldContains(kCpuInfoHardware, "Marvell Armada 370/XP");
   if (is_krait) {
-    // Special case for Qualcomm Krait CPUs in Nexus 4 and 7.
     integer_division_supported_ = FLAG_use_integer_division;
-  } else {
+  } else if (!is_armada_370xp) {
     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) &&
diff --git a/runtime/vm/cpuinfo_test.cc b/runtime/vm/cpuinfo_test.cc
index e717d28..860c407 100644
--- a/runtime/vm/cpuinfo_test.cc
+++ b/runtime/vm/cpuinfo_test.cc
@@ -10,10 +10,8 @@
 namespace dart {
 
 UNIT_TEST_CASE(GetCpuModelTest) {
-  CpuInfo::InitOnce();
   const char* cpumodel = CpuInfo::GetCpuModel();
   EXPECT_NE(strlen(cpumodel), 0UL);
-  CpuInfo::Cleanup();
 }
 
 }  // namespace dart
diff --git a/runtime/vm/custom_isolate_test.cc b/runtime/vm/custom_isolate_test.cc
index af30507..2cb2e00 100644
--- a/runtime/vm/custom_isolate_test.cc
+++ b/runtime/vm/custom_isolate_test.cc
@@ -59,6 +59,7 @@
     "     var replyTo = message[1];\n"
     "     echo('Received: $data');\n"
     "     replyTo.send(data + 1);\n"
+    "     mainPort.close();\n"
     "   };\n"
     "}\n"
     "\n"
@@ -179,6 +180,7 @@
   free(const_cast<char*>(main_));
   main_ = NULL;
 
+  Dart_SetMessageNotifyCallback(NULL);
   Dart_ExitScope();
   Dart_ExitIsolate();
 }
@@ -207,6 +209,7 @@
   if (!Dart_HasLivePorts()) {
     OS::Print("<< Shutting down isolate(%p)\n", isolate());
     event_queue->RemoveEventsForIsolate(isolate());
+    Dart_SetMessageNotifyCallback(NULL);
     Dart_ShutdownIsolate();
   } else {
     Dart_ExitScope();
@@ -350,6 +353,7 @@
   free(const_cast<char*>(saved_echo));
 
   delete event_queue;
+  event_queue = NULL;
 }
 
 }  // namespace dart
diff --git a/runtime/vm/dart.cc b/runtime/vm/dart.cc
index 8718c00..8ed714a 100644
--- a/runtime/vm/dart.cc
+++ b/runtime/vm/dart.cc
@@ -28,21 +28,23 @@
 #include "vm/symbols.h"
 #include "vm/thread_interrupter.h"
 #include "vm/thread_pool.h"
-#include "vm/timeline.h"
 #include "vm/virtual_memory.h"
 #include "vm/zone.h"
 
 namespace dart {
 
-DEFINE_FLAG(bool, keep_code, false,
-            "Keep deoptimized code for profiling.");
 DECLARE_FLAG(bool, print_class_table);
 DECLARE_FLAG(bool, trace_isolates);
+DECLARE_FLAG(bool, trace_time_all);
+DEFINE_FLAG(bool, keep_code, false,
+            "Keep deoptimized code for profiling.");
+DEFINE_FLAG(bool, shutdown, false, "Do a clean shutdown of the VM");
 
 Isolate* Dart::vm_isolate_ = NULL;
 ThreadPool* Dart::thread_pool_ = NULL;
 DebugInfo* Dart::pprof_symbol_generator_ = NULL;
 ReadOnlyHandles* Dart::predefined_handles_ = NULL;
+const uint8_t* Dart::instructions_snapshot_buffer_ = NULL;
 
 // Structure for managing read-only global handles allocation used for
 // creating global read-only handles that are pre created and initialized
@@ -69,6 +71,7 @@
 
 
 const char* Dart::InitOnce(const uint8_t* vm_isolate_snapshot,
+                           const uint8_t* instructions_snapshot,
                            Dart_IsolateCreateCallback create,
                            Dart_IsolateInterruptCallback interrupt,
                            Dart_IsolateUnhandledExceptionCallback unhandled,
@@ -87,6 +90,10 @@
   OS::InitOnce();
   VirtualMemory::InitOnce();
   Thread::InitOnceBeforeIsolate();
+  Thread::EnsureInit();
+  Timeline::InitOnce();
+  TimelineDurationScope tds(Timeline::GetVMStream(),
+                            "Dart::InitOnce");
   Isolate::InitOnce();
   PortMap::InitOnce();
   FreeListElement::InitOnce();
@@ -97,6 +104,8 @@
   SemiSpace::InitOnce();
   Metric::InitOnce();
   StoreBuffer::InitOnce();
+  MarkingStack::InitOnce();
+  Thread::EnsureInit();
 
 #if defined(USING_SIMULATOR)
   Simulator::InitOnce();
@@ -108,28 +117,38 @@
   ASSERT(thread_pool_ == NULL);
   thread_pool_ = new ThreadPool();
   {
+    Thread* T = Thread::Current();
+    ASSERT(T != NULL);
     ASSERT(vm_isolate_ == NULL);
     ASSERT(Flags::Initialized());
     const bool is_vm_isolate = true;
+    const bool precompiled = instructions_snapshot != NULL;
 
     // Setup default flags for the VM isolate.
     Isolate::Flags vm_flags;
     Dart_IsolateFlags api_flags;
     vm_flags.CopyTo(&api_flags);
     vm_isolate_ = Isolate::Init("vm-isolate", api_flags, is_vm_isolate);
+    vm_isolate_->set_compilation_allowed(!precompiled);
+    // Verify assumptions about executing in the VM isolate.
+    ASSERT(vm_isolate_ == Isolate::Current());
+    ASSERT(vm_isolate_ == Thread::Current()->isolate());
 
-    StackZone zone(vm_isolate_);
-    HandleScope handle_scope(vm_isolate_);
+    StackZone zone(T);
+    HandleScope handle_scope(T);
     Object::InitNull(vm_isolate_);
     ObjectStore::Init(vm_isolate_);
     TargetCPUFeatures::InitOnce();
     Object::InitOnce(vm_isolate_);
     ArgumentsDescriptor::InitOnce();
-    StubCode::InitOnce();
-    Thread::InitOnceAfterObjectAndStubCode();
-    // Now that the needed stub has been generated, set the stack limit.
-    vm_isolate_->InitializeStackLimit();
+    // When precompiled the stub code is initialized from the snapshot.
+    if (!precompiled) {
+      StubCode::InitOnce();
+    }
     if (vm_isolate_snapshot != NULL) {
+      if (instructions_snapshot != NULL) {
+        vm_isolate_->SetupInstructionsSnapshotPage(instructions_snapshot);
+      }
       const Snapshot* snapshot = Snapshot::SetupFromBuffer(vm_isolate_snapshot);
       if (snapshot == NULL) {
         return "Invalid vm isolate snapshot seen.";
@@ -137,7 +156,8 @@
       ASSERT(snapshot->kind() == Snapshot::kFull);
       VmIsolateSnapshotReader reader(snapshot->content(),
                                      snapshot->length(),
-                                     zone.GetZone());
+                                     instructions_snapshot,
+                                     T);
       const Error& error = Error::Handle(reader.ReadVmIsolateSnapshot());
       if (!error.IsNull()) {
         return error.ToCString();
@@ -146,7 +166,7 @@
         OS::Print("Size of vm isolate snapshot = %" Pd "\n",
                   snapshot->length());
         vm_isolate_->heap()->PrintSizes();
-        vm_isolate_->megamorphic_cache_table()->PrintSizes();
+        MegamorphicCacheTable::PrintSizes(vm_isolate_);
         intptr_t size;
         intptr_t capacity;
         Symbols::GetStats(vm_isolate_, &size, &capacity);
@@ -156,6 +176,9 @@
     } else {
       Symbols::InitOnce(vm_isolate_);
     }
+    Thread::InitOnceAfterObjectAndStubCode();
+    // Now that the needed stub has been generated, set the stack limit.
+    vm_isolate_->InitializeStackLimit();
     Scanner::InitOnce();
 #if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64)
     // Dart VM requires at least SSE2.
@@ -184,39 +207,65 @@
 }
 
 
+// This waits until only the VM isolate remains in the list.
+void Dart::WaitForIsolateShutdown() {
+  ASSERT(!Isolate::creation_enabled_);
+  MonitorLocker ml(Isolate::isolates_list_monitor_);
+  while ((Isolate::isolates_list_head_ != NULL) &&
+         (Isolate::isolates_list_head_->next_ != NULL)) {
+    ml.Wait();
+  }
+  ASSERT(Isolate::isolates_list_head_ == Dart::vm_isolate());
+}
+
+
 const char* Dart::Cleanup() {
-  // Shutdown the service isolate before shutting down the thread pool.
-  ServiceIsolate::Shutdown();
-#if 0
-  // Ideally we should shutdown the VM isolate here, but the thread pool
-  // shutdown does not seem to ensure that all the threads have stopped
-  // execution before it terminates, this results in racing isolates.
+  ASSERT(Isolate::Current() == NULL);
   if (vm_isolate_ == NULL) {
     return "VM already terminated.";
   }
 
-  ASSERT(Isolate::Current() == NULL);
-
-  delete thread_pool_;
-  thread_pool_ = NULL;
-
-  // Set the VM isolate as current isolate.
-  Thread::EnsureInit();
-  Thread::EnterIsolate(vm_isolate_);
-
-  // There is a planned and known asymmetry here: We exit one scope for the VM
-  // isolate to account for the scope that was entered in Dart_InitOnce.
-  Dart_ExitScope();
-
-  ShutdownIsolate();
-  vm_isolate_ = NULL;
-
-  TargetCPUFeatures::Cleanup();
-  StoreBuffer::ShutDown();
-#endif
-
+  // Shut down profiling.
   Profiler::Shutdown();
+
+  if (FLAG_shutdown) {
+    // Disable the creation of new isolates.
+    Isolate::DisableIsolateCreation();
+
+    // Send the OOB Kill message to all remaining application isolates.
+    Isolate::KillAllIsolates(Isolate::kInternalKillMsg);
+
+    // Shutdown the service isolate.
+    ServiceIsolate::Shutdown();
+
+    // Wait for all application isolates and the service isolate to shutdown
+    // before shutting down the thread pool.
+    WaitForIsolateShutdown();
+
+    // Shutdown the thread pool. On return, all thread pool threads have exited.
+    delete thread_pool_;
+    thread_pool_ = NULL;
+
+    // Set the VM isolate as current isolate.
+    Thread::EnsureInit();
+    Thread::EnterIsolate(vm_isolate_);
+
+    ShutdownIsolate();
+    vm_isolate_ = NULL;
+    ASSERT(Isolate::IsolateListLength() == 0);
+
+    TargetCPUFeatures::Cleanup();
+    StoreBuffer::ShutDown();
+
+    Thread::Shutdown();
+  } else {
+    // Shutdown the service isolate.
+    ServiceIsolate::Shutdown();
+  }
+
   CodeObservers::DeleteAll();
+  Timeline::Shutdown();
+  Metric::Cleanup();
 
   return NULL;
 }
@@ -226,30 +275,37 @@
                              const Dart_IsolateFlags& api_flags) {
   // Create a new isolate.
   Isolate* isolate = Isolate::Init(name_prefix, api_flags);
-  ASSERT(isolate != NULL);
   return isolate;
 }
 
 
 RawError* Dart::InitializeIsolate(const uint8_t* snapshot_buffer, void* data) {
   // Initialize the new isolate.
-  Isolate* isolate = Isolate::Current();
-  TIMERSCOPE(isolate, time_isolate_initialization);
-  ASSERT(isolate != NULL);
-  StackZone zone(isolate);
-  HandleScope handle_scope(isolate);
-  ObjectStore::Init(isolate);
+  Thread* T = Thread::Current();
+  Isolate* I = T->isolate();
+  TimelineDurationScope tds(T, I->GetIsolateStream(), "InitializeIsolate");
+  tds.SetNumArguments(1);
+  tds.CopyArgument(0, "isolateName", I->name());
+
+  ASSERT(I != NULL);
+  StackZone zone(T);
+  HandleScope handle_scope(T);
+  {
+    TimelineDurationScope tds(T, I->GetIsolateStream(), "ObjectStore::Init");
+    ObjectStore::Init(I);
+  }
 
   // Setup for profiling.
-  Profiler::InitProfilingForIsolate(isolate);
+  Profiler::InitProfilingForIsolate(I);
 
-  const Error& error = Error::Handle(Object::Init(isolate));
+  const Error& error = Error::Handle(Object::Init(I));
   if (!error.IsNull()) {
     return error.raw();
   }
   if (snapshot_buffer != NULL) {
     // Read the snapshot and setup the initial state.
-
+    TimelineDurationScope tds(
+        T, I->GetIsolateStream(), "IsolateSnapshotReader");
     // TODO(turnidge): Remove once length is not part of the snapshot.
     const Snapshot* snapshot = Snapshot::SetupFromBuffer(snapshot_buffer);
     if (snapshot == NULL) {
@@ -263,15 +319,15 @@
     }
     IsolateSnapshotReader reader(snapshot->content(),
                                  snapshot->length(),
-                                 isolate,
-                                 zone.GetZone());
+                                 Dart::instructions_snapshot_buffer(),
+                                 T);
     const Error& error = Error::Handle(reader.ReadFullSnapshot());
     if (!error.IsNull()) {
       return error.raw();
     }
     if (FLAG_trace_isolates) {
-      isolate->heap()->PrintSizes();
-      isolate->megamorphic_cache_table()->PrintSizes();
+      I->heap()->PrintSizes();
+      MegamorphicCacheTable::PrintSizes(I);
     }
   } else {
     // Populate the isolate's symbol table with all symbols from the
@@ -282,39 +338,47 @@
   }
 
   Object::VerifyBuiltinVtables();
+#if defined(DEBUG)
+  I->heap()->Verify(kForbidMarked);
+#endif
 
-  StubCode::Init(isolate);
-  isolate->megamorphic_cache_table()->InitMissHandler();
+  {
+    TimelineDurationScope tds(T, I->GetIsolateStream(), "StubCode::Init");
+    StubCode::Init(I);
+  }
+
+  // When running precompiled, the megamorphic miss function/code comes from the
+  // snapshot.
+  if (!Dart::IsRunningPrecompiledCode()) {
+    MegamorphicCacheTable::InitMissHandler(I);
+  }
   if (snapshot_buffer == NULL) {
-    if (!isolate->object_store()->PreallocateObjects()) {
-      return isolate->object_store()->sticky_error();
+    if (!I->object_store()->PreallocateObjects()) {
+      return I->object_store()->sticky_error();
     }
   }
 
-  isolate->heap()->EnableGrowthControl();
-  isolate->set_init_callback_data(data);
-  Api::SetupAcquiredError(isolate);
+  I->heap()->EnableGrowthControl();
+  I->set_init_callback_data(data);
+  Api::SetupAcquiredError(I);
   if (FLAG_print_class_table) {
-    isolate->class_table()->Print();
+    I->class_table()->Print();
   }
 
-  ServiceIsolate::MaybeInjectVMServiceLibrary(isolate);
+  ServiceIsolate::MaybeMakeServiceIsolate(I);
 
   ServiceIsolate::SendIsolateStartupMessage();
-  isolate->debugger()->NotifyIsolateCreated();
+  I->debugger()->NotifyIsolateCreated();
 
   // Create tag table.
-  isolate->set_tag_table(
-      GrowableObjectArray::Handle(GrowableObjectArray::New()));
+  I->set_tag_table(GrowableObjectArray::Handle(GrowableObjectArray::New()));
   // Set up default UserTag.
   const UserTag& default_tag = UserTag::Handle(UserTag::DefaultTag());
-  isolate->set_current_tag(default_tag);
-
-  isolate->SetTimelineEventRecorder(new TimelineEventRingRecorder());
+  I->set_current_tag(default_tag);
 
   if (FLAG_keep_code) {
-    isolate->set_deoptimized_code_array(
-      GrowableObjectArray::Handle(GrowableObjectArray::New()));
+    I->set_deoptimized_code_array(
+        GrowableObjectArray::Handle(GrowableObjectArray::New()));
   }
   return Error::null();
 }
diff --git a/runtime/vm/dart.h b/runtime/vm/dart.h
index be6db3b..5ae0550 100644
--- a/runtime/vm/dart.h
+++ b/runtime/vm/dart.h
@@ -22,6 +22,7 @@
  public:
   static const char* InitOnce(
       const uint8_t* vm_isolate_snapshot,
+      const uint8_t* instructions_snapshot,
       Dart_IsolateCreateCallback create,
       Dart_IsolateInterruptCallback interrupt,
       Dart_IsolateUnhandledExceptionCallback unhandled,
@@ -53,11 +54,24 @@
   static uword AllocateReadOnlyHandle();
   static bool IsReadOnlyHandle(uword address);
 
+  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 bool IsRunningPrecompiledCode() {
+    return instructions_snapshot_buffer_ != NULL;
+  }
+
  private:
+  static void WaitForIsolateShutdown();
+
   static Isolate* vm_isolate_;
   static ThreadPool* thread_pool_;
   static DebugInfo* pprof_symbol_generator_;
   static ReadOnlyHandles* predefined_handles_;
+  static const uint8_t* instructions_snapshot_buffer_;
 };
 
 }  // namespace dart
diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc
index 3ccb68b..55a352f 100644
--- a/runtime/vm/dart_api_impl.cc
+++ b/runtime/vm/dart_api_impl.cc
@@ -26,7 +26,9 @@
 #include "vm/object.h"
 #include "vm/object_store.h"
 #include "vm/os_thread.h"
+#include "vm/os.h"
 #include "vm/port.h"
+#include "vm/precompiler.h"
 #include "vm/profiler.h"
 #include "vm/resolver.h"
 #include "vm/reusable_handles.h"
@@ -36,6 +38,7 @@
 #include "vm/stack_frame.h"
 #include "vm/symbols.h"
 #include "vm/tags.h"
+#include "vm/thread_registry.h"
 #include "vm/timeline.h"
 #include "vm/timer.h"
 #include "vm/unicode.h"
@@ -44,6 +47,10 @@
 
 namespace dart {
 
+// Facilitate quick access to the current zone once we have the curren thread.
+#define Z (T->zone())
+
+
 DECLARE_FLAG(bool, load_deferred_eagerly);
 DECLARE_FLAG(bool, print_class_table);
 DECLARE_FLAG(bool, verify_handles);
@@ -78,11 +85,11 @@
 // or not. An assertion is raised if a type is not canonicalized.
 class FunctionVisitor : public ObjectVisitor {
  public:
-  explicit FunctionVisitor(Isolate* isolate) :
-      ObjectVisitor(isolate),
-      classHandle_(Class::Handle(isolate)),
-      funcHandle_(Function::Handle(isolate)),
-      typeHandle_(AbstractType::Handle(isolate)) {}
+  explicit FunctionVisitor(Thread* thread) :
+      ObjectVisitor(thread->isolate()),
+      classHandle_(Class::Handle(thread->zone())),
+      funcHandle_(Function::Handle(thread->zone())),
+      typeHandle_(AbstractType::Handle(thread->zone())) {}
 
   void VisitObject(RawObject* obj) {
     if (obj->IsFunction()) {
@@ -115,15 +122,15 @@
 #endif  // #if defined(DEBUG).
 
 
-static RawInstance* GetListInstance(Isolate* isolate, const Object& obj) {
+static RawInstance* GetListInstance(Zone* zone, const Object& obj) {
   if (obj.IsInstance()) {
-    const Library& core_lib = Library::Handle(Library::CoreLibrary());
+    const Library& core_lib = Library::Handle(zone, Library::CoreLibrary());
     const Class& list_class =
-        Class::Handle(core_lib.LookupClass(Symbols::List()));
+        Class::Handle(zone, core_lib.LookupClass(Symbols::List()));
     ASSERT(!list_class.IsNull());
     const Instance& instance = Instance::Cast(obj);
-    const Class& obj_class = Class::Handle(isolate, obj.clazz());
-    Error& malformed_type_error = Error::Handle(isolate);
+    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,
                               Object::null_type_arguments(),
@@ -135,15 +142,15 @@
   return Instance::null();
 }
 
-static RawInstance* GetMapInstance(Isolate* isolate, const Object& obj) {
+static RawInstance* GetMapInstance(Zone* zone, const Object& obj) {
   if (obj.IsInstance()) {
-    const Library& core_lib = Library::Handle(Library::CoreLibrary());
+    const Library& core_lib = Library::Handle(zone, Library::CoreLibrary());
     const Class& map_class =
         Class::Handle(core_lib.LookupClass(Symbols::Map()));
     ASSERT(!map_class.IsNull());
     const Instance& instance = Instance::Cast(obj);
-    const Class& obj_class = Class::Handle(isolate, obj.clazz());
-    Error& malformed_type_error = Error::Handle(isolate);
+    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,
                               Object::null_type_arguments(),
@@ -165,11 +172,12 @@
     *str = NULL;
     return true;
   }
-  Isolate* isolate = arguments->thread()->isolate();
+  Thread* thread = arguments->thread();
+  Isolate* isolate = thread->isolate();
   ASSERT(isolate == Isolate::Current());
   *peer = NULL;
-  REUSABLE_OBJECT_HANDLESCOPE(isolate);
-  Object& obj = isolate->ObjectHandle();
+  REUSABLE_OBJECT_HANDLESCOPE(thread);
+  Object& obj = thread->ObjectHandle();
   obj = arguments->NativeArgAt(arg_index);
   if (RawObject::IsStringClassId(obj.GetClassId())) {
     ASSERT(isolate->api_state() &&
@@ -192,10 +200,10 @@
   if (Api::GetNativeIntegerArgument(arguments, arg_index, value)) {
     return true;
   }
-  Isolate* isolate = arguments->thread()->isolate();
-  ASSERT(isolate == Isolate::Current());
-  REUSABLE_OBJECT_HANDLESCOPE(isolate);
-  Object& obj = isolate->ObjectHandle();
+  Thread* thread = arguments->thread();
+  ASSERT(thread == Thread::Current());
+  REUSABLE_OBJECT_HANDLESCOPE(thread);
+  Object& obj = thread->ObjectHandle();
   obj = arguments->NativeArgAt(arg_index);
   intptr_t cid = obj.GetClassId();
   if (cid == kBigintCid) {
@@ -218,10 +226,10 @@
     *value = static_cast<uint64_t>(arg_value);
     return true;
   }
-  Isolate* isolate = arguments->thread()->isolate();
-  ASSERT(isolate == Isolate::Current());
-  REUSABLE_OBJECT_HANDLESCOPE(isolate);
-  Object& obj = isolate->ObjectHandle();
+  Thread* thread = arguments->thread();
+  ASSERT(thread == Thread::Current());
+  REUSABLE_OBJECT_HANDLESCOPE(thread);
+  Object& obj = thread->ObjectHandle();
   obj = arguments->NativeArgAt(arg_index);
   intptr_t cid = obj.GetClassId();
   if (cid == kBigintCid) {
@@ -242,10 +250,10 @@
   if (Api::GetNativeDoubleArgument(arguments, arg_index, value)) {
     return true;
   }
-  Isolate* isolate = arguments->thread()->isolate();
-  ASSERT(isolate == Isolate::Current());
-  REUSABLE_OBJECT_HANDLESCOPE(isolate);
-  Object& obj = isolate->ObjectHandle();
+  Thread* thread = arguments->thread();
+  ASSERT(thread == Thread::Current());
+  REUSABLE_OBJECT_HANDLESCOPE(thread);
+  Object& obj = thread->ObjectHandle();
   obj = arguments->NativeArgAt(arg_index);
   intptr_t cid = obj.GetClassId();
   if (cid == kBigintCid) {
@@ -268,10 +276,10 @@
                                      field_values)) {
     return Api::Success();
   }
-  Isolate* isolate = arguments->thread()->isolate();
-  ASSERT(isolate == Isolate::Current());
-  REUSABLE_OBJECT_HANDLESCOPE(isolate);
-  Object& obj = isolate->ObjectHandle();
+  Thread* thread = arguments->thread();
+  ASSERT(thread == Thread::Current());
+  REUSABLE_OBJECT_HANDLESCOPE(thread);
+  Object& obj = thread->ObjectHandle();
   obj = arguments->NativeArgAt(arg_index);
   if (obj.IsNull()) {
     memset(field_values, 0, (num_fields * sizeof(field_values[0])));
@@ -389,13 +397,13 @@
 
 
 #define DEFINE_UNWRAP(type)                                                    \
-  const type& Api::Unwrap##type##Handle(Isolate* iso,                          \
+  const type& Api::Unwrap##type##Handle(Zone* zone,                            \
                                         Dart_Handle dart_handle) {             \
-    const Object& obj = Object::Handle(iso, Api::UnwrapHandle(dart_handle));   \
+    const Object& obj = Object::Handle(zone, Api::UnwrapHandle(dart_handle));  \
     if (obj.Is##type()) {                                                      \
       return type::Cast(obj);                                                  \
     }                                                                          \
-    return type::Handle(iso);                                                  \
+    return type::Handle(zone  );                                               \
   }
 CLASS_LIST_FOR_HANDLES(DEFINE_UNWRAP)
 #undef DEFINE_UNWRAP
@@ -442,25 +450,22 @@
 
 
 Dart_Handle Api::NewError(const char* format, ...) {
-  Thread* thread = Thread::Current();
-  Isolate* isolate = thread->isolate();
-  Zone* zone = thread->zone();
-  DARTSCOPE(isolate);
-  CHECK_CALLBACK_STATE(isolate);
+  DARTSCOPE(Thread::Current());
+  CHECK_CALLBACK_STATE(T);
 
   va_list args;
   va_start(args, format);
   intptr_t len = OS::VSNPrint(NULL, 0, format, args);
   va_end(args);
 
-  char* buffer = zone->Alloc<char>(len + 1);
+  char* buffer = Z->Alloc<char>(len + 1);
   va_list args2;
   va_start(args2, format);
   OS::VSNPrint(buffer, (len + 1), format, args2);
   va_end(args2);
 
-  const String& message = String::Handle(zone, String::New(buffer));
-  return Api::NewHandle(isolate, ApiError::New(message));
+  const String& message = String::Handle(Z, String::New(buffer));
+  return Api::NewHandle(I, ApiError::New(message));
 }
 
 
@@ -743,15 +748,21 @@
 }
 
 
+DART_EXPORT bool Dart_IsVMRestartRequest(Dart_Handle handle) {
+  DARTSCOPE(Thread::Current());
+  const Object& obj = Object::Handle(Z, Api::UnwrapHandle(handle));
+  return (obj.IsUnwindError() && UnwindError::Cast(obj).is_vm_restart());
+}
+
+
 DART_EXPORT const char* Dart_GetError(Dart_Handle handle) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  const Object& obj = Object::Handle(isolate, Api::UnwrapHandle(handle));
+  DARTSCOPE(Thread::Current());
+  const Object& obj = Object::Handle(Z, Api::UnwrapHandle(handle));
   if (obj.IsError()) {
     const Error& error = Error::Cast(obj);
     const char* str = error.ToErrorCString();
     intptr_t len = strlen(str) + 1;
-    char* str_copy = Api::TopScope(isolate)->zone()->Alloc<char>(len);
+    char* str_copy = Api::TopScope(I)->zone()->Alloc<char>(len);
     strncpy(str_copy, str, len);
     // Strip a possible trailing '\n'.
     if ((len > 1) && (str_copy[len - 2] == '\n')) {
@@ -765,20 +776,18 @@
 
 
 DART_EXPORT bool Dart_ErrorHasException(Dart_Handle handle) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  const Object& obj = Object::Handle(isolate, Api::UnwrapHandle(handle));
+  DARTSCOPE(Thread::Current());
+  const Object& obj = Object::Handle(Z, Api::UnwrapHandle(handle));
   return obj.IsUnhandledException();
 }
 
 
 DART_EXPORT Dart_Handle Dart_ErrorGetException(Dart_Handle handle) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  const Object& obj = Object::Handle(isolate, Api::UnwrapHandle(handle));
+  DARTSCOPE(Thread::Current());
+  const Object& obj = Object::Handle(Z, Api::UnwrapHandle(handle));
   if (obj.IsUnhandledException()) {
     const UnhandledException& error = UnhandledException::Cast(obj);
-    return Api::NewHandle(isolate, error.exception());
+    return Api::NewHandle(I, error.exception());
   } else if (obj.IsError()) {
     return Api::NewError("This error is not an unhandled exception error.");
   } else {
@@ -788,12 +797,11 @@
 
 
 DART_EXPORT Dart_Handle Dart_ErrorGetStacktrace(Dart_Handle handle) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  const Object& obj = Object::Handle(isolate, Api::UnwrapHandle(handle));
+  DARTSCOPE(Thread::Current());
+  const Object& obj = Object::Handle(Z, Api::UnwrapHandle(handle));
   if (obj.IsUnhandledException()) {
     const UnhandledException& error = UnhandledException::Cast(obj);
-    return Api::NewHandle(isolate, error.stacktrace());
+    return Api::NewHandle(I, error.stacktrace());
   } else if (obj.IsError()) {
     return Api::NewError("This error is not an unhandled exception error.");
   } else {
@@ -805,39 +813,39 @@
 // TODO(turnidge): This clones Api::NewError.  I need to use va_copy to
 // fix this but not sure if it available on all of our builds.
 DART_EXPORT Dart_Handle Dart_NewApiError(const char* error) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  CHECK_CALLBACK_STATE(isolate);
+  DARTSCOPE(Thread::Current());
+  CHECK_CALLBACK_STATE(T);
 
-  const String& message = String::Handle(isolate, String::New(error));
-  return Api::NewHandle(isolate, ApiError::New(message));
+  const String& message = String::Handle(Z, String::New(error));
+  return Api::NewHandle(I, ApiError::New(message));
 }
 
 
 DART_EXPORT Dart_Handle Dart_NewUnhandledExceptionError(Dart_Handle exception) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  CHECK_CALLBACK_STATE(isolate);
+  DARTSCOPE(Thread::Current());
+  CHECK_CALLBACK_STATE(T);
 
-  Instance& obj = Instance::Handle(isolate);
+  Instance& obj = Instance::Handle(Z);
   intptr_t class_id = Api::ClassId(exception);
   if ((class_id == kApiErrorCid) || (class_id == kLanguageErrorCid)) {
     obj = String::New(::Dart_GetError(exception));
   } else {
-    obj = Api::UnwrapInstanceHandle(isolate, exception).raw();
+    obj = Api::UnwrapInstanceHandle(Z, exception).raw();
     if (obj.IsNull()) {
-      RETURN_TYPE_ERROR(isolate, exception, Instance);
+      RETURN_TYPE_ERROR(Z, exception, Instance);
     }
   }
-  const Stacktrace& stacktrace = Stacktrace::Handle(isolate);
-  return Api::NewHandle(isolate, UnhandledException::New(obj, stacktrace));
+  const Stacktrace& stacktrace = Stacktrace::Handle(Z);
+  return Api::NewHandle(I, UnhandledException::New(obj, stacktrace));
 }
 
 
 DART_EXPORT Dart_Handle Dart_PropagateError(Dart_Handle handle) {
-  Isolate* isolate = Isolate::Current();
+  Thread* thread = Thread::Current();
+  Isolate* isolate = thread->isolate();
   {
-    const Object& obj = Object::Handle(isolate, 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.  "
@@ -861,9 +869,11 @@
     // that GC won't touch the raw error object before creating a valid
     // handle for it in the surviving zone.
     NoSafepointScope no_safepoint;
-    RawError* raw_error = Api::UnwrapErrorHandle(isolate, handle).raw();
+    RawError* raw_error = Api::UnwrapErrorHandle(thread->zone(), handle).raw();
     state->UnwindScopes(isolate->top_exit_frame_info());
-    error = &Error::Handle(isolate, raw_error);
+    // Note that thread's zone is different here than at the beginning of this
+    // function.
+    error = &Error::Handle(thread->zone(), raw_error);
   }
   Exceptions::PropagateError(*error);
   UNREACHABLE();
@@ -882,34 +892,32 @@
 
 
 DART_EXPORT Dart_Handle Dart_ToString(Dart_Handle object) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  const Object& obj = Object::Handle(isolate, Api::UnwrapHandle(object));
+  DARTSCOPE(Thread::Current());
+  const Object& obj = Object::Handle(Z, Api::UnwrapHandle(object));
   if (obj.IsString()) {
-    return Api::NewHandle(isolate, obj.raw());
+    return Api::NewHandle(I, obj.raw());
   } else if (obj.IsInstance()) {
-    CHECK_CALLBACK_STATE(isolate);
+    CHECK_CALLBACK_STATE(T);
     const Instance& receiver = Instance::Cast(obj);
-    return Api::NewHandle(isolate, DartLibraryCalls::ToString(receiver));
+    return Api::NewHandle(I, DartLibraryCalls::ToString(receiver));
   } else {
-    CHECK_CALLBACK_STATE(isolate);
+    CHECK_CALLBACK_STATE(T);
     // This is a VM internal object. Call the C++ method of printing.
-    return Api::NewHandle(isolate, String::New(obj.ToCString()));
+    return Api::NewHandle(I, String::New(obj.ToCString()));
   }
 }
 
 
 DART_EXPORT bool Dart_IdentityEquals(Dart_Handle obj1, Dart_Handle obj2) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
+  DARTSCOPE(Thread::Current());
   {
     NoSafepointScope no_safepoint_scope;
     if (Api::UnwrapHandle(obj1) == Api::UnwrapHandle(obj2)) {
       return true;
     }
   }
-  const Object& object1 = Object::Handle(isolate, Api::UnwrapHandle(obj1));
-  const Object& object2 = Object::Handle(isolate, Api::UnwrapHandle(obj2));
+  const Object& object1 = Object::Handle(Z, Api::UnwrapHandle(obj1));
+  const Object& object2 = Object::Handle(Z, Api::UnwrapHandle(obj2));
   if (object1.IsInstance() && object2.IsInstance()) {
     return Instance::Cast(object1).IsIdenticalTo(Instance::Cast(object2));
   }
@@ -918,29 +926,27 @@
 
 
 DART_EXPORT uint64_t Dart_IdentityHash(Dart_Handle obj) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
+  DARTSCOPE(Thread::Current());
 
-  const Object& object = Object::Handle(isolate, Api::UnwrapHandle(obj));
+  const Object& object = Object::Handle(Z, Api::UnwrapHandle(obj));
   if (!object.IsInstance() && !object.IsNull()) {
     return 0;
   }
 
-  const Library& libcore = Library::Handle(isolate, Library::CoreLibrary());
-  const String& function_name = String::Handle(isolate,
+  const Library& libcore = Library::Handle(Z, Library::CoreLibrary());
+  const String& function_name = String::Handle(Z,
                                                String::New("identityHashCode"));
   const Function& function =
-      Function::Handle(isolate,
-                       libcore.LookupFunctionAllowPrivate(function_name));
+      Function::Handle(Z, libcore.LookupFunctionAllowPrivate(function_name));
   if (function.IsNull()) {
     UNREACHABLE();
     return 0;
   }
 
-  const Array& arguments = Array::Handle(isolate, Array::New(1));
+  const Array& arguments = Array::Handle(Z, Array::New(1));
   arguments.SetAt(0, object);
   const Object& result =
-      Object::Handle(isolate, DartEntry::InvokeFunction(function, arguments));
+      Object::Handle(Z, DartEntry::InvokeFunction(function, arguments));
 
   if (result.IsSmi()) {
     return Smi::Cast(result).Value();
@@ -985,11 +991,10 @@
 
 
 DART_EXPORT Dart_PersistentHandle Dart_NewPersistentHandle(Dart_Handle object) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  ApiState* state = isolate->api_state();
+  DARTSCOPE(Thread::Current());
+  ApiState* state = I->api_state();
   ASSERT(state != NULL);
-  const Object& old_ref = Object::Handle(isolate, Api::UnwrapHandle(object));
+  const Object& old_ref = Object::Handle(Z, Api::UnwrapHandle(object));
   PersistentHandle* new_ref = state->persistent_handles().AllocateHandle();
   new_ref->set_raw(old_ref);
   return new_ref->apiHandle();
@@ -998,29 +1003,28 @@
 
 DART_EXPORT void Dart_SetPersistentHandle(Dart_PersistentHandle obj1,
                                           Dart_Handle obj2) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  ApiState* state = isolate->api_state();
+  DARTSCOPE(Thread::Current());
+  ApiState* state = I->api_state();
   ASSERT(state != NULL);
   ASSERT(state->IsValidPersistentHandle(obj1));
-  const Object& obj2_ref = Object::Handle(isolate, Api::UnwrapHandle(obj2));
+  const Object& obj2_ref = Object::Handle(Z, Api::UnwrapHandle(obj2));
   PersistentHandle* obj1_ref = PersistentHandle::Cast(obj1);
   obj1_ref->set_raw(obj2_ref);
 }
 
 
 static Dart_WeakPersistentHandle AllocateFinalizableHandle(
-    Isolate* isolate,
+    Thread* thread,
     Dart_Handle object,
     bool is_prologue,
     void* peer,
     intptr_t external_allocation_size,
     Dart_WeakPersistentHandleFinalizer callback) {
-  REUSABLE_OBJECT_HANDLESCOPE(isolate);
-  Object& ref = isolate->ObjectHandle();
+  REUSABLE_OBJECT_HANDLESCOPE(thread);
+  Object& ref = thread->ObjectHandle();
   ref = Api::UnwrapHandle(object);
   FinalizablePersistentHandle* finalizable_ref =
-      FinalizablePersistentHandle::New(isolate,
+      FinalizablePersistentHandle::New(thread->isolate(),
                                        is_prologue,
                                        ref,
                                        peer,
@@ -1035,12 +1039,12 @@
     void* peer,
     intptr_t external_allocation_size,
     Dart_WeakPersistentHandleFinalizer callback) {
-  Isolate* isolate = Isolate::Current();
-  CHECK_ISOLATE(isolate);
+  Thread* thread = Thread::Current();
+  CHECK_ISOLATE(thread->isolate());
   if (callback == NULL) {
     return NULL;
   }
-  return AllocateFinalizableHandle(isolate,
+  return AllocateFinalizableHandle(thread,
                                    object,
                                    false,
                                    peer,
@@ -1054,12 +1058,12 @@
     void* peer,
     intptr_t external_allocation_size,
     Dart_WeakPersistentHandleFinalizer callback) {
-  Isolate* isolate = Isolate::Current();
-  CHECK_ISOLATE(isolate);
+  Thread* thread = Thread::Current();
+  CHECK_ISOLATE(thread->isolate());
   if (callback == NULL) {
     return NULL;
   }
-  return AllocateFinalizableHandle(isolate,
+  return AllocateFinalizableHandle(thread,
                                    object,
                                    true,
                                    peer,
@@ -1213,12 +1217,13 @@
 
 class PrologueWeakVisitor : public HandleVisitor {
  public:
-  PrologueWeakVisitor(Isolate* isolate,
+  PrologueWeakVisitor(Thread* thread,
                       Dart_GcPrologueWeakHandleCallback callback)
-      :  HandleVisitor(isolate),
+      :  HandleVisitor(thread),
          callback_(callback) {
   }
 
+
   void VisitHandle(uword addr) {
     NoSafepointScope no_safepoint;
     FinalizablePersistentHandle* handle =
@@ -1226,13 +1231,13 @@
     RawObject* raw_obj = handle->raw();
     if (raw_obj->IsHeapObject()) {
       ASSERT(handle->IsPrologueWeakPersistent());
-      ReusableInstanceHandleScope reused_instance_handle(isolate());
+      ReusableInstanceHandleScope reused_instance_handle(thread());
       Instance& instance = reused_instance_handle.Handle();
       instance ^= reinterpret_cast<RawInstance*>(handle->raw());
       intptr_t num_native_fields = instance.NumNativeFields();
       intptr_t* native_fields = instance.NativeFieldsDataAddr();
       if (native_fields != NULL) {
-        callback_(isolate()->init_callback_data(),
+        callback_(thread()->isolate()->init_callback_data(),
                   reinterpret_cast<Dart_WeakPersistentHandle>(addr),
                   num_native_fields,
                   native_fields);
@@ -1249,10 +1254,10 @@
 
 DART_EXPORT Dart_Handle Dart_VisitPrologueWeakHandles(
     Dart_GcPrologueWeakHandleCallback callback) {
-  Isolate* isolate = Isolate::Current();
-  CHECK_ISOLATE(isolate);
-  PrologueWeakVisitor visitor(isolate, callback);
-  isolate->VisitPrologueWeakPersistentHandles(&visitor);
+  Thread* thread = Thread::Current();
+  CHECK_ISOLATE(thread->isolate());
+  PrologueWeakVisitor visitor(thread, callback);
+  thread->isolate()->VisitPrologueWeakPersistentHandles(&visitor);
   return Api::Success();
 }
 
@@ -1263,8 +1268,9 @@
   return Version::String();
 }
 
-DART_EXPORT bool Dart_Initialize(
+DART_EXPORT char* Dart_Initialize(
     const uint8_t* vm_isolate_snapshot,
+    const uint8_t* instructions_snapshot,
     Dart_IsolateCreateCallback create,
     Dart_IsolateInterruptCallback interrupt,
     Dart_IsolateUnhandledExceptionCallback unhandled,
@@ -1275,25 +1281,24 @@
     Dart_FileCloseCallback file_close,
     Dart_EntropySource entropy_source) {
   const char* err_msg = Dart::InitOnce(vm_isolate_snapshot,
+                                       instructions_snapshot,
                                        create, interrupt, unhandled, shutdown,
                                        file_open, file_read, file_write,
                                        file_close, entropy_source);
   if (err_msg != NULL) {
-    OS::PrintErr("Dart_Initialize: %s\n", err_msg);
-    return false;
+    return strdup(err_msg);
   }
-  return true;
+  return NULL;
 }
 
 
-DART_EXPORT bool Dart_Cleanup() {
+DART_EXPORT char* Dart_Cleanup() {
   CHECK_NO_ISOLATE(Isolate::Current());
   const char* err_msg = Dart::Cleanup();
   if (err_msg != NULL) {
-    OS::PrintErr("Dart_Cleanup: %s\n", err_msg);
-    return false;
+    return strdup(err_msg);
   }
-  return true;
+  return NULL;
 }
 
 
@@ -1362,18 +1367,22 @@
     vm_flags.CopyTo(&api_flags);
     flags = &api_flags;
   }
-  Isolate* isolate = Dart::CreateIsolate(isolate_name, *flags);
+  Isolate* I = Dart::CreateIsolate(isolate_name, *flags);
   free(isolate_name);
+  if (I == NULL) {
+    *error = strdup("Isolate creation failed");
+    return reinterpret_cast<Dart_Isolate>(NULL);
+  }
   {
-    StackZone zone(isolate);
-    HANDLESCOPE(isolate);
+    Thread* T = Thread::Current();
+    StackZone zone(T);
+    HANDLESCOPE(T);
     // We enter an API scope here as InitializeIsolate could compile some
     // 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(isolate,
-                      Dart::InitializeIsolate(snapshot, callback_data));
+        Error::Handle(Z, Dart::InitializeIsolate(snapshot, callback_data));
     if (error_obj.IsNull()) {
   #if defined(DART_NO_SNAPSHOT)
       if (FLAG_check_function_fingerprints) {
@@ -1382,8 +1391,7 @@
   #endif  // defined(DART_NO_SNAPSHOT).
       // We exit the API scope entered above.
       Dart_ExitScope();
-      START_TIMER(isolate, time_total_runtime);
-      return Api::CastIsolate(isolate);
+      return Api::CastIsolate(I);
     }
     *error = strdup(error_obj.ToErrorCString());
     // We exit the API scope entered above.
@@ -1395,14 +1403,14 @@
 
 
 DART_EXPORT void Dart_ShutdownIsolate() {
-  Isolate* isolate = Isolate::Current();
-  CHECK_ISOLATE(isolate);
+  Thread* T = Thread::Current();
+  Isolate* I = T->isolate();
+  CHECK_ISOLATE(I);
   {
-    StackZone zone(isolate);
-    HandleScope handle_scope(isolate);
+    StackZone zone(T);
+    HandleScope handle_scope(T);
     Dart::RunShutdownCallback();
   }
-  STOP_TIMER(isolate, time_total_runtime);
   Dart::ShutdownIsolate();
 }
 
@@ -1431,9 +1439,8 @@
 
 
 DART_EXPORT Dart_Handle Dart_DebugName() {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  return Api::NewHandle(isolate, String::New(isolate->name()));
+  DARTSCOPE(Thread::Current());
+  return Api::NewHandle(I, String::New(I->name()));
 }
 
 
@@ -1482,7 +1489,7 @@
 DART_EXPORT Dart_Handle Dart_IsolateSetStrictCompilation(bool value) {
   CHECK_ISOLATE(Isolate::Current());
   Isolate* isolate = Isolate::Current();
-  if (isolate->has_compiled()) {
+  if (isolate->has_compiled_code()) {
     return Api::NewError(
         "%s expects that the isolate has not yet compiled code.", CURRENT_FUNC);
   }
@@ -1509,9 +1516,7 @@
     uint8_t** isolate_snapshot_buffer,
     intptr_t* isolate_snapshot_size) {
   ASSERT(FLAG_load_deferred_eagerly);
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  TIMERSCOPE(isolate, time_creating_snapshot);
+  DARTSCOPE(Thread::Current());
   if (vm_isolate_snapshot_buffer != NULL &&
       vm_isolate_snapshot_size == NULL) {
     RETURN_NULL_ERROR(vm_isolate_snapshot_size);
@@ -1523,21 +1528,24 @@
     RETURN_NULL_ERROR(isolate_snapshot_size);
   }
   // Finalize all classes if needed.
-  Dart_Handle state = Api::CheckAndFinalizePendingClasses(isolate);
+  Dart_Handle state = Api::CheckAndFinalizePendingClasses(I);
   if (::Dart_IsError(state)) {
     return state;
   }
-  isolate->heap()->CollectAllGarbage();
+  I->heap()->CollectAllGarbage();
 #if defined(DEBUG)
-  FunctionVisitor check_canonical(isolate);
-  isolate->heap()->IterateObjects(&check_canonical);
+  FunctionVisitor check_canonical(T);
+  I->heap()->IterateObjects(&check_canonical);
 #endif  // #if defined(DEBUG).
 
   // Since this is only a snapshot the root library should not be set.
-  isolate->object_store()->set_root_library(Library::Handle(isolate));
+  I->object_store()->set_root_library(Library::Handle(Z));
   FullSnapshotWriter writer(vm_isolate_snapshot_buffer,
                             isolate_snapshot_buffer,
-                            ApiReallocate);
+                            NULL, /* instructions_snapshot_buffer */
+                            ApiReallocate,
+                            false, /* snapshot_code */
+                            true /* vm_isolate_is_symbolic */);
   writer.WriteFullSnapshot();
   *vm_isolate_snapshot_size = writer.VmIsolateSnapshotSize();
   *isolate_snapshot_size = writer.IsolateSnapshotSize();
@@ -1548,9 +1556,7 @@
 static Dart_Handle createLibrarySnapshot(Dart_Handle library,
                                          uint8_t** buffer,
                                          intptr_t* size) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  TIMERSCOPE(isolate, time_creating_snapshot);
+  DARTSCOPE(Thread::Current());
   if (buffer == NULL) {
     RETURN_NULL_ERROR(buffer);
   }
@@ -1558,20 +1564,20 @@
     RETURN_NULL_ERROR(size);
   }
   // Finalize all classes if needed.
-  Dart_Handle state = Api::CheckAndFinalizePendingClasses(isolate);
+  Dart_Handle state = Api::CheckAndFinalizePendingClasses(I);
   if (::Dart_IsError(state)) {
     return state;
   }
-  Library& lib = Library::Handle(isolate);
+  Library& lib = Library::Handle(Z);
   if (library == Dart_Null()) {
-    lib ^= isolate->object_store()->root_library();
+    lib ^= I->object_store()->root_library();
   } else {
     lib ^= Api::UnwrapHandle(library);
   }
-  isolate->heap()->CollectAllGarbage();
+  I->heap()->CollectAllGarbage();
 #if defined(DEBUG)
-  FunctionVisitor check_canonical(isolate);
-  isolate->heap()->IterateObjects(&check_canonical);
+  FunctionVisitor check_canonical(T);
+  I->heap()->IterateObjects(&check_canonical);
 #endif  // #if defined(DEBUG).
   ScriptSnapshotWriter writer(buffer, ApiReallocate);
   writer.WriteScriptSnapshot(lib);
@@ -1600,10 +1606,7 @@
   }
   // TODO(16615): Validate isolate parameter.
   Isolate* iso = reinterpret_cast<Isolate*>(isolate);
-  iso->ScheduleInterrupts(Isolate::kApiInterrupt);
-  // Can't use Dart_Post() since there isn't a current isolate.
-  Dart_CObject api_null = { Dart_CObject_kNull , { 0 } };
-  Dart_PostCObject(iso->main_port(), &api_null);
+  iso->SendInternalLibMessage(Isolate::kInterruptMsg, iso->pause_capability());
 }
 
 
@@ -1648,9 +1651,10 @@
 
 
 DART_EXPORT Dart_Handle Dart_RunLoop() {
-  Isolate* isolate = Isolate::Current();
-  CHECK_ISOLATE_SCOPE(isolate);
-  CHECK_CALLBACK_STATE(isolate);
+  Thread* T = Thread::Current();
+  Isolate* I = T->isolate();
+  CHECK_ISOLATE_SCOPE(I);
+  CHECK_CALLBACK_STATE(T);
   Monitor monitor;
   MonitorLocker ml(&monitor);
   {
@@ -1659,32 +1663,32 @@
     RunLoopData data;
     data.monitor = &monitor;
     data.done = false;
-    isolate->message_handler()->Run(
+    I->message_handler()->Run(
         Dart::thread_pool(),
         NULL, RunLoopDone, reinterpret_cast<uword>(&data));
     while (!data.done) {
       ml.Wait();
     }
   }
-  if (isolate->object_store()->sticky_error() != Object::null()) {
-    Dart_Handle error = Api::NewHandle(isolate,
-                                       isolate->object_store()->sticky_error());
-    isolate->object_store()->clear_sticky_error();
+  if (I->object_store()->sticky_error() != Object::null()) {
+    Dart_Handle error = Api::NewHandle(I, I->object_store()->sticky_error());
+    I->object_store()->clear_sticky_error();
     return error;
   }
   if (FLAG_print_class_table) {
-    HANDLESCOPE(isolate);
-    isolate->class_table()->Print();
+    HANDLESCOPE(T);
+    I->class_table()->Print();
   }
   return Api::Success();
 }
 
 
 DART_EXPORT Dart_Handle Dart_HandleMessage() {
-  Isolate* isolate = Isolate::Current();
+  Thread* thread = Thread::Current();
+  Isolate* isolate = thread->isolate();
   CHECK_ISOLATE_SCOPE(isolate);
-  CHECK_CALLBACK_STATE(isolate);
-  if (!isolate->message_handler()->HandleNextMessage()) {
+  CHECK_CALLBACK_STATE(thread);
+  if (isolate->message_handler()->HandleNextMessage() != MessageHandler::kOK) {
     Dart_Handle error = Api::NewHandle(isolate,
                                        isolate->object_store()->sticky_error());
     isolate->object_store()->clear_sticky_error();
@@ -1695,13 +1699,16 @@
 
 
 DART_EXPORT bool Dart_HandleServiceMessages() {
-  Isolate* isolate = Isolate::Current();
+  Thread* thread = Thread::Current();
+  Isolate* isolate = thread->isolate();
   CHECK_ISOLATE_SCOPE(isolate);
-  CHECK_CALLBACK_STATE(isolate);
+  CHECK_CALLBACK_STATE(thread);
 
   ASSERT(isolate->GetAndClearResumeRequest() == false);
-  isolate->message_handler()->HandleOOBMessages();
-  return isolate->GetAndClearResumeRequest();
+  MessageHandler::MessageStatus status =
+      isolate->message_handler()->HandleOOBMessages();
+  bool resume = isolate->GetAndClearResumeRequest();
+  return (status != MessageHandler::kOK) || resume;
 }
 
 
@@ -1726,12 +1733,11 @@
 
 
 DART_EXPORT bool Dart_Post(Dart_Port port_id, Dart_Handle handle) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
+  DARTSCOPE(Thread::Current());
   if (port_id == ILLEGAL_PORT) {
     return false;
   }
-  const Object& object = Object::Handle(isolate, Api::UnwrapHandle(handle));
+  const Object& object = Object::Handle(Z, Api::UnwrapHandle(handle));
   uint8_t* data = NULL;
   MessageWriter writer(&data, &allocator, false);
   writer.WriteMessage(object);
@@ -1742,26 +1748,24 @@
 
 
 DART_EXPORT Dart_Handle Dart_NewSendPort(Dart_Port port_id) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  CHECK_CALLBACK_STATE(isolate);
+  DARTSCOPE(Thread::Current());
+  CHECK_CALLBACK_STATE(T);
   if (port_id == ILLEGAL_PORT) {
     return Api::NewError("%s: illegal port_id %" Pd64 ".",
                          CURRENT_FUNC,
                          port_id);
   }
-  return Api::NewHandle(isolate, SendPort::New(port_id));
+  return Api::NewHandle(I, SendPort::New(port_id));
 }
 
 
 DART_EXPORT Dart_Handle Dart_SendPortGetId(Dart_Handle port,
                                            Dart_Port* port_id) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  CHECK_CALLBACK_STATE(isolate);
-  const SendPort& send_port = Api::UnwrapSendPortHandle(isolate, port);
+  DARTSCOPE(Thread::Current());
+  CHECK_CALLBACK_STATE(T);
+  const SendPort& send_port = Api::UnwrapSendPortHandle(Z, port);
   if (send_port.IsNull()) {
-    RETURN_TYPE_ERROR(isolate, port, SendPort);
+    RETURN_TYPE_ERROR(Z, port, SendPort);
   }
   if (port_id == NULL) {
     RETURN_NULL_ERROR(port_id);
@@ -1857,22 +1861,19 @@
 
 DART_EXPORT Dart_Handle Dart_ObjectEquals(Dart_Handle obj1, Dart_Handle obj2,
                                           bool* value) {
-  Thread* thread = Thread::Current();
-  Isolate* isolate = thread->isolate();
-  Zone* zone = thread->zone();
-  DARTSCOPE(isolate);
-  CHECK_CALLBACK_STATE(isolate);
+  DARTSCOPE(Thread::Current());
+  CHECK_CALLBACK_STATE(T);
   const Instance& expected =
-      Instance::CheckedHandle(zone, Api::UnwrapHandle(obj1));
+      Instance::CheckedHandle(Z, Api::UnwrapHandle(obj1));
   const Instance& actual =
-      Instance::CheckedHandle(zone, Api::UnwrapHandle(obj2));
+      Instance::CheckedHandle(Z, Api::UnwrapHandle(obj2));
   const Object& result =
-      Object::Handle(zone, DartLibraryCalls::Equals(expected, actual));
+      Object::Handle(Z, DartLibraryCalls::Equals(expected, actual));
   if (result.IsBool()) {
     *value = Bool::Cast(result).value();
     return Api::Success();
   } else if (result.IsError()) {
-    return Api::NewHandle(isolate, result.raw());
+    return Api::NewHandle(I, result.raw());
   } else {
     return Api::NewError("Expected boolean result from ==");
   }
@@ -1885,13 +1886,12 @@
 DART_EXPORT Dart_Handle Dart_ObjectIsType(Dart_Handle object,
                                           Dart_Handle type,
                                           bool* value) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
+  DARTSCOPE(Thread::Current());
 
-  const Type& type_obj = Api::UnwrapTypeHandle(isolate, type);
+  const Type& type_obj = Api::UnwrapTypeHandle(Z, type);
   if (type_obj.IsNull()) {
     *value = false;
-    RETURN_TYPE_ERROR(isolate, type, Type);
+    RETURN_TYPE_ERROR(Z, type, Type);
   }
   if (!type_obj.IsFinalized()) {
     return Api::NewError(
@@ -1902,13 +1902,13 @@
     *value = false;
     return Api::Success();
   }
-  const Instance& instance = Api::UnwrapInstanceHandle(isolate, object);
+  const Instance& instance = Api::UnwrapInstanceHandle(Z, object);
   if (instance.IsNull()) {
     *value = false;
-    RETURN_TYPE_ERROR(isolate, object, Instance);
+    RETURN_TYPE_ERROR(Z, object, Instance);
   }
-  CHECK_CALLBACK_STATE(isolate);
-  Error& malformed_type_error = Error::Handle(isolate);
+  CHECK_CALLBACK_STATE(T);
+  Error& malformed_type_error = Error::Handle(Z);
   *value = instance.IsInstanceOf(type_obj,
                                  Object::null_type_arguments(),
                                  &malformed_type_error);
@@ -1918,10 +1918,10 @@
 
 
 DART_EXPORT bool Dart_IsInstance(Dart_Handle object) {
-  Isolate* isolate = Isolate::Current();
-  CHECK_ISOLATE(isolate);
-  REUSABLE_OBJECT_HANDLESCOPE(isolate);
-  Object& ref = isolate->ObjectHandle();
+  Thread* thread = Thread::Current();
+  CHECK_ISOLATE(thread->isolate());
+  REUSABLE_OBJECT_HANDLESCOPE(thread);
+  Object& ref = thread->ObjectHandle();
   ref = Api::UnwrapHandle(object);
   return ref.IsInstance();
 }
@@ -1975,18 +1975,16 @@
     return true;
   }
 
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  const Object& obj = Object::Handle(isolate, Api::UnwrapHandle(object));
-  return GetListInstance(isolate, obj) != Instance::null();
+  DARTSCOPE(Thread::Current());
+  const Object& obj = Object::Handle(Z, Api::UnwrapHandle(object));
+  return GetListInstance(Z, obj) != Instance::null();
 }
 
 
 DART_EXPORT bool Dart_IsMap(Dart_Handle object) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  const Object& obj = Object::Handle(isolate, Api::UnwrapHandle(object));
-  return GetMapInstance(isolate, obj) != Instance::null();
+  DARTSCOPE(Thread::Current());
+  const Object& obj = Object::Handle(Z, Api::UnwrapHandle(object));
+  return GetMapInstance(Z, obj) != Instance::null();
 }
 
 
@@ -2023,9 +2021,9 @@
 DART_EXPORT bool Dart_IsClosure(Dart_Handle object) {
   // We can't use a fast class index check here because there are many
   // different signature classes for closures.
-  Isolate* isolate = Isolate::Current();
-  CHECK_ISOLATE(isolate);
-  ReusableObjectHandleScope reused_obj_handle(isolate);
+  Thread* thread = Thread::Current();
+  CHECK_ISOLATE(thread->isolate());
+  ReusableObjectHandleScope reused_obj_handle(thread);
   const Instance& closure_obj =
       Api::UnwrapInstanceHandle(reused_obj_handle, object);
   return (!closure_obj.IsNull() && closure_obj.IsClosure());
@@ -2049,15 +2047,14 @@
 
 DART_EXPORT bool Dart_IsFuture(Dart_Handle handle) {
   TRACE_API_CALL(CURRENT_FUNC);
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  const Object& obj = Object::Handle(isolate, Api::UnwrapHandle(handle));
+  DARTSCOPE(Thread::Current());
+  const Object& obj = Object::Handle(Z, Api::UnwrapHandle(handle));
   if (obj.IsInstance()) {
     const Class& future_class =
-        Class::Handle(isolate->object_store()->future_class());
+        Class::Handle(I->object_store()->future_class());
     ASSERT(!future_class.IsNull());
-    const Class& obj_class = Class::Handle(isolate, obj.clazz());
-    Error& malformed_type_error = Error::Handle(isolate);
+    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(),
@@ -2072,17 +2069,16 @@
 // --- Instances ----
 
 DART_EXPORT Dart_Handle Dart_InstanceGetType(Dart_Handle instance) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  const Object& obj = Object::Handle(isolate, Api::UnwrapHandle(instance));
+  DARTSCOPE(Thread::Current());
+  const Object& obj = Object::Handle(Z, Api::UnwrapHandle(instance));
   if (obj.IsNull()) {
-    return Api::NewHandle(isolate, isolate->object_store()->null_type());
+    return Api::NewHandle(I, I->object_store()->null_type());
   }
   if (!obj.IsInstance()) {
-    RETURN_TYPE_ERROR(isolate, instance, Instance);
+    RETURN_TYPE_ERROR(Z, instance, Instance);
   }
   const Type& type = Type::Handle(Instance::Cast(obj).GetType());
-  return Api::NewHandle(isolate, type.Canonicalize());
+  return Api::NewHandle(I, type.Canonicalize());
 }
 
 
@@ -2091,7 +2087,8 @@
 DART_EXPORT Dart_Handle Dart_IntegerFitsIntoInt64(Dart_Handle integer,
                                                   bool* fits) {
   // Fast path for Smis and Mints.
-  Isolate* isolate = Isolate::Current();
+  Thread* thread = Thread::Current();
+  Isolate* isolate = thread->isolate();
   CHECK_ISOLATE(isolate);
   intptr_t class_id = Api::ClassId(integer);
   if (class_id == kSmiCid || class_id == kMintCid) {
@@ -2099,10 +2096,10 @@
     return Api::Success();
   }
   // Slow path for Mints and Bigints.
-  DARTSCOPE(isolate);
-  const Integer& int_obj = Api::UnwrapIntegerHandle(isolate, integer);
+  DARTSCOPE(thread);
+  const Integer& int_obj = Api::UnwrapIntegerHandle(Z, integer);
   if (int_obj.IsNull()) {
-    RETURN_TYPE_ERROR(isolate, integer, Integer);
+    RETURN_TYPE_ERROR(Z, integer, Integer);
   }
   ASSERT(!Bigint::Cast(int_obj).FitsIntoInt64());
   *fits = false;
@@ -2113,17 +2110,18 @@
 DART_EXPORT Dart_Handle Dart_IntegerFitsIntoUint64(Dart_Handle integer,
                                                    bool* fits) {
   // Fast path for Smis.
-  Isolate* isolate = Isolate::Current();
+  Thread* thread = Thread::Current();
+  Isolate* isolate = thread->isolate();
   CHECK_ISOLATE(isolate);
   if (Api::IsSmi(integer)) {
     *fits = (Api::SmiValue(integer) >= 0);
     return Api::Success();
   }
   // Slow path for Mints and Bigints.
-  DARTSCOPE(isolate);
-  const Integer& int_obj = Api::UnwrapIntegerHandle(isolate, integer);
+  DARTSCOPE(thread);
+  const Integer& int_obj = Api::UnwrapIntegerHandle(Z, integer);
   if (int_obj.IsNull()) {
-    RETURN_TYPE_ERROR(isolate, integer, Integer);
+    RETURN_TYPE_ERROR(Z, integer, Integer);
   }
   ASSERT(!int_obj.IsSmi());
   if (int_obj.IsMint()) {
@@ -2137,50 +2135,50 @@
 
 DART_EXPORT Dart_Handle Dart_NewInteger(int64_t value) {
   // Fast path for Smis.
-  Isolate* isolate = Isolate::Current();
+  Thread* thread = Thread::Current();
+  Isolate* isolate = thread->isolate();
   CHECK_ISOLATE(isolate);
   if (Smi::IsValid(value)) {
-    NOHANDLESCOPE(isolate);
+    NOHANDLESCOPE(thread);
     return Api::NewHandle(isolate, Smi::New(static_cast<intptr_t>(value)));
   }
   // Slow path for Mints and Bigints.
-  DARTSCOPE(isolate);
-  CHECK_CALLBACK_STATE(isolate);
+  DARTSCOPE(thread);
+  CHECK_CALLBACK_STATE(thread);
   return Api::NewHandle(isolate, Integer::New(value));
 }
 
 
 DART_EXPORT Dart_Handle Dart_NewIntegerFromUint64(uint64_t value) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  CHECK_CALLBACK_STATE(isolate);
-  return Api::NewHandle(isolate, Integer::NewFromUint64(value));
+  DARTSCOPE(Thread::Current());
+  CHECK_CALLBACK_STATE(T);
+  return Api::NewHandle(I, Integer::NewFromUint64(value));
 }
 
 
 DART_EXPORT Dart_Handle Dart_NewIntegerFromHexCString(const char* str) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  CHECK_CALLBACK_STATE(isolate);
-  const String& str_obj = String::Handle(isolate, String::New(str));
-  return Api::NewHandle(isolate, Integer::New(str_obj));
+  DARTSCOPE(Thread::Current());
+  CHECK_CALLBACK_STATE(T);
+  const String& str_obj = String::Handle(Z, String::New(str));
+  return Api::NewHandle(I, Integer::New(str_obj));
 }
 
 
 DART_EXPORT Dart_Handle Dart_IntegerToInt64(Dart_Handle integer,
                                             int64_t* value) {
   // Fast path for Smis.
-  Isolate* isolate = Isolate::Current();
+  Thread* thread = Thread::Current();
+  Isolate* isolate = thread->isolate();
   CHECK_ISOLATE(isolate);
   if (Api::IsSmi(integer)) {
     *value = Api::SmiValue(integer);
     return Api::Success();
   }
   // Slow path for Mints and Bigints.
-  DARTSCOPE(isolate);
-  const Integer& int_obj = Api::UnwrapIntegerHandle(isolate, integer);
+  DARTSCOPE(thread);
+  const Integer& int_obj = Api::UnwrapIntegerHandle(Z, integer);
   if (int_obj.IsNull()) {
-    RETURN_TYPE_ERROR(isolate, integer, Integer);
+    RETURN_TYPE_ERROR(Z, integer, Integer);
   }
   ASSERT(!int_obj.IsSmi());
   if (int_obj.IsMint()) {
@@ -2201,7 +2199,8 @@
 DART_EXPORT Dart_Handle Dart_IntegerToUint64(Dart_Handle integer,
                                              uint64_t* value) {
   // Fast path for Smis.
-  Isolate* isolate = Isolate::Current();
+  Thread* thread = Thread::Current();
+  Isolate* isolate = thread->isolate();
   CHECK_ISOLATE(isolate);
   if (Api::IsSmi(integer)) {
     intptr_t smi_value = Api::SmiValue(integer);
@@ -2211,10 +2210,10 @@
     }
   }
   // Slow path for Mints and Bigints.
-  DARTSCOPE(isolate);
-  const Integer& int_obj = Api::UnwrapIntegerHandle(isolate, integer);
+  DARTSCOPE(thread);
+  const Integer& int_obj = Api::UnwrapIntegerHandle(Z, integer);
   if (int_obj.IsNull()) {
-    RETURN_TYPE_ERROR(isolate, integer, Integer);
+    RETURN_TYPE_ERROR(Z, integer, Integer);
   }
   if (int_obj.IsSmi()) {
     ASSERT(int_obj.IsNegative());
@@ -2240,14 +2239,13 @@
 
 DART_EXPORT Dart_Handle Dart_IntegerToHexCString(Dart_Handle integer,
                                                  const char** value) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  const Integer& int_obj = Api::UnwrapIntegerHandle(isolate, integer);
+  DARTSCOPE(Thread::Current());
+  const Integer& int_obj = Api::UnwrapIntegerHandle(Z, integer);
   if (int_obj.IsNull()) {
-    RETURN_TYPE_ERROR(isolate, integer, Integer);
+    RETURN_TYPE_ERROR(Z, integer, Integer);
   }
   if (int_obj.IsSmi() || int_obj.IsMint()) {
-    const Bigint& bigint = Bigint::Handle(isolate,
+    const Bigint& bigint = Bigint::Handle(Z,
         Bigint::NewFromInt64(int_obj.AsInt64Value()));
     *value = bigint.ToHexCString(BigintAllocate);
   } else {
@@ -2258,20 +2256,18 @@
 
 
 DART_EXPORT Dart_Handle Dart_NewDouble(double value) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  CHECK_CALLBACK_STATE(isolate);
-  return Api::NewHandle(isolate, Double::New(value));
+  DARTSCOPE(Thread::Current());
+  CHECK_CALLBACK_STATE(T);
+  return Api::NewHandle(I, Double::New(value));
 }
 
 
 DART_EXPORT Dart_Handle Dart_DoubleValue(Dart_Handle double_obj,
                                          double* value) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  const Double& obj = Api::UnwrapDoubleHandle(isolate, double_obj);
+  DARTSCOPE(Thread::Current());
+  const Double& obj = Api::UnwrapDoubleHandle(Z, double_obj);
   if (obj.IsNull()) {
-    RETURN_TYPE_ERROR(isolate, double_obj, Double);
+    RETURN_TYPE_ERROR(Z, double_obj, Double);
   }
   *value = obj.value();
   return Api::Success();
@@ -2301,11 +2297,10 @@
 
 DART_EXPORT Dart_Handle Dart_BooleanValue(Dart_Handle boolean_obj,
                                           bool* value) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  const Bool& obj = Api::UnwrapBoolHandle(isolate, boolean_obj);
+  DARTSCOPE(Thread::Current());
+  const Bool& obj = Api::UnwrapBoolHandle(Z, boolean_obj);
   if (obj.IsNull()) {
-    RETURN_TYPE_ERROR(isolate, boolean_obj, Bool);
+    RETURN_TYPE_ERROR(Z, boolean_obj, Bool);
   }
   *value = obj.value();
   return Api::Success();
@@ -2316,12 +2311,12 @@
 
 
 DART_EXPORT Dart_Handle Dart_StringLength(Dart_Handle str, intptr_t* len) {
-  Isolate* isolate = Isolate::Current();
-  CHECK_ISOLATE(isolate);
-  ReusableObjectHandleScope reused_obj_handle(isolate);
+  Thread* thread = Thread::Current();
+  CHECK_ISOLATE(thread->isolate());
+  ReusableObjectHandleScope reused_obj_handle(thread);
   const String& str_obj = Api::UnwrapStringHandle(reused_obj_handle, str);
   if (str_obj.IsNull()) {
-    RETURN_TYPE_ERROR(isolate, str, String);
+    RETURN_TYPE_ERROR(thread->zone(), str, String);
   }
   *len = str_obj.Length();
   return Api::Success();
@@ -2329,20 +2324,18 @@
 
 
 DART_EXPORT Dart_Handle Dart_NewStringFromCString(const char* str) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
+  DARTSCOPE(Thread::Current());
   if (str == NULL) {
     RETURN_NULL_ERROR(str);
   }
-  CHECK_CALLBACK_STATE(isolate);
-  return Api::NewHandle(isolate, String::New(str));
+  CHECK_CALLBACK_STATE(T);
+  return Api::NewHandle(I, String::New(str));
 }
 
 
 DART_EXPORT Dart_Handle Dart_NewStringFromUTF8(const uint8_t* utf8_array,
                                                intptr_t length) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
+  DARTSCOPE(Thread::Current());
   if (utf8_array == NULL && length != 0) {
     RETURN_NULL_ERROR(utf8_array);
   }
@@ -2351,34 +2344,32 @@
     return Api::NewError("%s expects argument 'str' to be valid UTF-8.",
                          CURRENT_FUNC);
   }
-  CHECK_CALLBACK_STATE(isolate);
-  return Api::NewHandle(isolate, String::FromUTF8(utf8_array, length));
+  CHECK_CALLBACK_STATE(T);
+  return Api::NewHandle(I, String::FromUTF8(utf8_array, length));
 }
 
 
 DART_EXPORT Dart_Handle Dart_NewStringFromUTF16(const uint16_t* utf16_array,
                                                 intptr_t length) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
+  DARTSCOPE(Thread::Current());
   if (utf16_array == NULL && length != 0) {
     RETURN_NULL_ERROR(utf16_array);
   }
   CHECK_LENGTH(length, String::kMaxElements);
-  CHECK_CALLBACK_STATE(isolate);
-  return Api::NewHandle(isolate, String::FromUTF16(utf16_array, length));
+  CHECK_CALLBACK_STATE(T);
+  return Api::NewHandle(I, String::FromUTF16(utf16_array, length));
 }
 
 
 DART_EXPORT Dart_Handle Dart_NewStringFromUTF32(const int32_t* utf32_array,
                                                 intptr_t length) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
+  DARTSCOPE(Thread::Current());
   if (utf32_array == NULL && length != 0) {
     RETURN_NULL_ERROR(utf32_array);
   }
   CHECK_LENGTH(length, String::kMaxElements);
-  CHECK_CALLBACK_STATE(isolate);
-  return Api::NewHandle(isolate, String::FromUTF32(utf32_array, length));
+  CHECK_CALLBACK_STATE(T);
+  return Api::NewHandle(I, String::FromUTF32(utf32_array, length));
 }
 
 
@@ -2387,19 +2378,18 @@
     intptr_t length,
     void* peer,
     Dart_PeerFinalizer cback) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
+  DARTSCOPE(Thread::Current());
   if (latin1_array == NULL && length != 0) {
     RETURN_NULL_ERROR(latin1_array);
   }
   CHECK_LENGTH(length, String::kMaxElements);
-  CHECK_CALLBACK_STATE(isolate);
-  return Api::NewHandle(isolate,
+  CHECK_CALLBACK_STATE(T);
+  return Api::NewHandle(I,
                         String::NewExternal(latin1_array,
                                             length,
                                             peer,
                                             cback,
-                                            SpaceForExternal(isolate, length)));
+                                            SpaceForExternal(I, length)));
 }
 
 
@@ -2407,36 +2397,34 @@
                                                     intptr_t length,
                                                     void* peer,
                                                     Dart_PeerFinalizer cback) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
+  DARTSCOPE(Thread::Current());
   if (utf16_array == NULL && length != 0) {
     RETURN_NULL_ERROR(utf16_array);
   }
   CHECK_LENGTH(length, String::kMaxElements);
-  CHECK_CALLBACK_STATE(isolate);
+  CHECK_CALLBACK_STATE(T);
   intptr_t bytes = length * sizeof(*utf16_array);
-  return Api::NewHandle(isolate,
+  return Api::NewHandle(I,
                         String::NewExternal(utf16_array,
                                             length,
                                             peer,
                                             cback,
-                                            SpaceForExternal(isolate, bytes)));
+                                            SpaceForExternal(I, bytes)));
 }
 
 
 DART_EXPORT Dart_Handle Dart_StringToCString(Dart_Handle object,
                                              const char** cstr) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
+  DARTSCOPE(Thread::Current());
   if (cstr == NULL) {
     RETURN_NULL_ERROR(cstr);
   }
-  const String& str_obj = Api::UnwrapStringHandle(isolate, object);
+  const String& str_obj = Api::UnwrapStringHandle(Z, object);
   if (str_obj.IsNull()) {
-    RETURN_TYPE_ERROR(isolate, object, String);
+    RETURN_TYPE_ERROR(Z, object, String);
   }
   intptr_t string_length = Utf8::Length(str_obj);
-  char* res = Api::TopScope(isolate)->zone()->Alloc<char>(string_length + 1);
+  char* res = Api::TopScope(I)->zone()->Alloc<char>(string_length + 1);
   if (res == NULL) {
     return Api::NewError("Unable to allocate memory");
   }
@@ -2451,20 +2439,19 @@
 DART_EXPORT Dart_Handle Dart_StringToUTF8(Dart_Handle str,
                                           uint8_t** utf8_array,
                                           intptr_t* length) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
+  DARTSCOPE(Thread::Current());
   if (utf8_array == NULL) {
     RETURN_NULL_ERROR(utf8_array);
   }
   if (length == NULL) {
     RETURN_NULL_ERROR(length);
   }
-  const String& str_obj = Api::UnwrapStringHandle(isolate, str);
+  const String& str_obj = Api::UnwrapStringHandle(Z, str);
   if (str_obj.IsNull()) {
-    RETURN_TYPE_ERROR(isolate, str, String);
+    RETURN_TYPE_ERROR(Z, str, String);
   }
   intptr_t str_len = Utf8::Length(str_obj);
-  *utf8_array = Api::TopScope(isolate)->zone()->Alloc<uint8_t>(str_len);
+  *utf8_array = Api::TopScope(I)->zone()->Alloc<uint8_t>(str_len);
   if (*utf8_array == NULL) {
     return Api::NewError("Unable to allocate memory");
   }
@@ -2477,17 +2464,16 @@
 DART_EXPORT Dart_Handle Dart_StringToLatin1(Dart_Handle str,
                                             uint8_t* latin1_array,
                                             intptr_t* length) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
+  DARTSCOPE(Thread::Current());
   if (latin1_array == NULL) {
     RETURN_NULL_ERROR(latin1_array);
   }
   if (length == NULL) {
     RETURN_NULL_ERROR(length);
   }
-  const String& str_obj = Api::UnwrapStringHandle(isolate, str);
+  const String& str_obj = Api::UnwrapStringHandle(Z, str);
   if (str_obj.IsNull() || !str_obj.IsOneByteString()) {
-    RETURN_TYPE_ERROR(isolate, str, String);
+    RETURN_TYPE_ERROR(Z, str, String);
   }
   intptr_t str_len = str_obj.Length();
   intptr_t copy_len = (str_len > *length) ? *length : str_len;
@@ -2505,11 +2491,10 @@
 DART_EXPORT Dart_Handle Dart_StringToUTF16(Dart_Handle str,
                                            uint16_t* utf16_array,
                                            intptr_t* length) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  const String& str_obj = Api::UnwrapStringHandle(isolate, str);
+  DARTSCOPE(Thread::Current());
+  const String& str_obj = Api::UnwrapStringHandle(Z, str);
   if (str_obj.IsNull()) {
-    RETURN_TYPE_ERROR(isolate, str, String);
+    RETURN_TYPE_ERROR(Z, str, String);
   }
   intptr_t str_len = str_obj.Length();
   intptr_t copy_len = (str_len > *length) ? *length : str_len;
@@ -2523,12 +2508,12 @@
 
 DART_EXPORT Dart_Handle Dart_StringStorageSize(Dart_Handle str,
                                                intptr_t* size) {
-  Isolate* isolate = Isolate::Current();
-  CHECK_ISOLATE(isolate);
-  ReusableObjectHandleScope reused_obj_handle(isolate);
+  Thread* thread = Thread::Current();
+  CHECK_ISOLATE(thread->isolate());
+  ReusableObjectHandleScope reused_obj_handle(thread);
   const String& str_obj = Api::UnwrapStringHandle(reused_obj_handle, str);
   if (str_obj.IsNull()) {
-    RETURN_TYPE_ERROR(isolate, str, String);
+    RETURN_TYPE_ERROR(thread->zone(), str, String);
   }
   if (size == NULL) {
     RETURN_NULL_ERROR(size);
@@ -2543,14 +2528,13 @@
                                                 intptr_t length,
                                                 void* peer,
                                                 Dart_PeerFinalizer cback) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  const String& str_obj = Api::UnwrapStringHandle(isolate, str);
+  DARTSCOPE(Thread::Current());
+  const String& str_obj = Api::UnwrapStringHandle(Z, str);
   if (str_obj.IsExternal()) {
     return str;  // String is already an external string.
   }
   if (str_obj.IsNull()) {
-    RETURN_TYPE_ERROR(isolate, str, String);
+    RETURN_TYPE_ERROR(Z, str, String);
   }
   if (array == NULL) {
     RETURN_NULL_ERROR(array);
@@ -2587,8 +2571,7 @@
     }
     return str;
   }
-  return Api::NewHandle(isolate,
-                        str_obj.MakeExternal(array, length, peer, cback));
+  return Api::NewHandle(I, str_obj.MakeExternal(array, length, peer, cback));
 }
 
 
@@ -2596,19 +2579,19 @@
                                                  intptr_t* char_size,
                                                  intptr_t* str_len,
                                                  void** peer) {
-  Isolate* isolate = Isolate::Current();
-  CHECK_ISOLATE(isolate);
-  ReusableObjectHandleScope reused_obj_handle(isolate);
+  Thread* thread = Thread::Current();
+  CHECK_ISOLATE(thread->isolate());
+  ReusableObjectHandleScope reused_obj_handle(thread);
   const String& str = Api::UnwrapStringHandle(reused_obj_handle, object);
   if (str.IsNull()) {
-    RETURN_TYPE_ERROR(isolate, object, String);
+    RETURN_TYPE_ERROR(thread->zone(), object, String);
   }
   if (str.IsExternal()) {
     *peer = str.GetPeer();
     ASSERT(*peer != NULL);
   } else {
     NoSafepointScope no_safepoint_scope;
-    *peer = isolate->heap()->GetPeer(str.raw());
+    *peer = thread->isolate()->heap()->GetPeer(str.raw());
   }
   *char_size = str.CharSize();
   *str_len = str.Length();
@@ -2619,65 +2602,60 @@
 // --- Lists ---
 
 DART_EXPORT Dart_Handle Dart_NewList(intptr_t length) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
+  DARTSCOPE(Thread::Current());
   CHECK_LENGTH(length, Array::kMaxElements);
-  CHECK_CALLBACK_STATE(isolate);
-  return Api::NewHandle(isolate, Array::New(length));
+  CHECK_CALLBACK_STATE(T);
+  return Api::NewHandle(I, Array::New(length));
 }
 
 
-#define GET_LIST_LENGTH(isolate, type, obj, len)                               \
-  type& array = type::Handle(isolate);                                         \
+#define GET_LIST_LENGTH(zone, type, obj, len)                                  \
+  type& array = type::Handle(zone);                                            \
   array ^= obj.raw();                                                          \
   *len = array.Length();                                                       \
   return Api::Success();                                                       \
 
 
 DART_EXPORT Dart_Handle Dart_ListLength(Dart_Handle list, intptr_t* len) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  const Object& obj = Object::Handle(isolate, Api::UnwrapHandle(list));
+  DARTSCOPE(Thread::Current());
+  const Object& obj = Object::Handle(Z, Api::UnwrapHandle(list));
   if (obj.IsError()) {
     // Pass through errors.
     return list;
   }
   if (obj.IsTypedData()) {
-    GET_LIST_LENGTH(isolate, TypedData, obj, len);
+    GET_LIST_LENGTH(Z, TypedData, obj, len);
   }
   if (obj.IsArray()) {
-    GET_LIST_LENGTH(isolate, Array, obj, len);
+    GET_LIST_LENGTH(Z, Array, obj, len);
   }
   if (obj.IsGrowableObjectArray()) {
-    GET_LIST_LENGTH(isolate, GrowableObjectArray, obj, len);
+    GET_LIST_LENGTH(Z, GrowableObjectArray, obj, len);
   }
   if (obj.IsExternalTypedData()) {
-    GET_LIST_LENGTH(isolate, ExternalTypedData, obj, len);
+    GET_LIST_LENGTH(Z, ExternalTypedData, obj, len);
   }
-  CHECK_CALLBACK_STATE(isolate);
+  CHECK_CALLBACK_STATE(T);
 
   // Now check and handle a dart object that implements the List interface.
-  const Instance& instance =
-      Instance::Handle(isolate, GetListInstance(isolate, obj));
+  const Instance& instance = Instance::Handle(Z, GetListInstance(Z, obj));
   if (instance.IsNull()) {
     return Api::NewError("Object does not implement the List interface");
   }
-  const String& name = String::Handle(Field::GetterName(Symbols::Length()));
+  const String& name = String::Handle(Z, Field::GetterName(Symbols::Length()));
   const int kNumArgs = 1;
   ArgumentsDescriptor args_desc(
-      Array::Handle(ArgumentsDescriptor::New(kNumArgs)));
+      Array::Handle(Z, ArgumentsDescriptor::New(kNumArgs)));
   const Function& function =
-      Function::Handle(isolate, Resolver::ResolveDynamic(instance,
-                                                         name,
-                                                         args_desc));
+      Function::Handle(Z, Resolver::ResolveDynamic(instance, name, args_desc));
   if (function.IsNull()) {
     return Api::NewError("List object does not have a 'length' field.");
   }
 
-  const Array& args = Array::Handle(isolate, Array::New(kNumArgs));
+  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(isolate, DartEntry::InvokeFunction(function, args));
+    Object::Handle(Z, DartEntry::InvokeFunction(function, args));
   if (retval.IsSmi()) {
     *len = Smi::Cast(retval).Value();
     return Api::Success();
@@ -2701,7 +2679,7 @@
     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(isolate, retval.raw());
+    return Api::NewHandle(I, retval.raw());
   } else {
     return Api::NewError("Length of List object is not an integer");
   }
@@ -2717,36 +2695,93 @@
 
 
 DART_EXPORT Dart_Handle Dart_ListGetAt(Dart_Handle list, intptr_t index) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  const Object& obj = Object::Handle(isolate, Api::UnwrapHandle(list));
+  DARTSCOPE(Thread::Current());
+  const Object& obj = Object::Handle(Z, Api::UnwrapHandle(list));
   if (obj.IsArray()) {
-    GET_LIST_ELEMENT(isolate, Array, obj, index);
+    GET_LIST_ELEMENT(I, Array, obj, index);
   } else if (obj.IsGrowableObjectArray()) {
-    GET_LIST_ELEMENT(isolate, GrowableObjectArray, obj, index);
+    GET_LIST_ELEMENT(I, GrowableObjectArray, obj, index);
   } else if (obj.IsError()) {
     return list;
   } else {
-    CHECK_CALLBACK_STATE(isolate);
+    CHECK_CALLBACK_STATE(T);
     // Check and handle a dart object that implements the List interface.
-    const Instance& instance =
-        Instance::Handle(isolate, GetListInstance(isolate, obj));
+    const Instance& instance = Instance::Handle(Z, GetListInstance(Z, obj));
     if (!instance.IsNull()) {
-      return Api::NewHandle(isolate, Send1Arg(
+      return Api::NewHandle(I, Send1Arg(
           instance,
           Symbols::IndexToken(),
-          Instance::Handle(isolate, Integer::New(index))));
+          Instance::Handle(Z, Integer::New(index))));
     }
     return Api::NewError("Object does not implement the 'List' interface");
   }
 }
 
 
-#define SET_LIST_ELEMENT(isolate, type, obj, index, value)                     \
+#define GET_LIST_RANGE(isolate, type, obj, offset, length)                     \
+  const type& array_obj = type::Cast(obj);                                     \
+  if ((offset >= 0) && (offset + length <= array_obj.Length())) {              \
+    for (intptr_t index = 0; index < length; ++index) {                        \
+      result[index] = Api::NewHandle(isolate, array_obj.At(index + offset));   \
+    }                                                                          \
+    return Api::Success();                                                     \
+  }                                                                            \
+  return Api::NewError("Invalid offset/length passed in to access list");      \
+
+
+DART_EXPORT Dart_Handle Dart_ListGetRange(Dart_Handle list,
+                                          intptr_t offset,
+                                          intptr_t length,
+                                          Dart_Handle* result) {
+  DARTSCOPE(Thread::Current());
+  if (result == NULL) {
+    RETURN_NULL_ERROR(result);
+  }
+  const Object& obj = Object::Handle(Z, Api::UnwrapHandle(list));
+  if (obj.IsArray()) {
+    GET_LIST_RANGE(I, Array, obj, offset, length);
+  } else if (obj.IsGrowableObjectArray()) {
+    GET_LIST_RANGE(I, GrowableObjectArray, obj, offset, length);
+  } else if (obj.IsError()) {
+    return list;
+  } else {
+    CHECK_CALLBACK_STATE(T);
+    // Check and handle a dart object that implements the List interface.
+    const Instance& instance = Instance::Handle(Z, GetListInstance(Z, obj));
+    if (!instance.IsNull()) {
+      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));
+      if (!function.IsNull()) {
+        const Array& args = Array::Handle(Array::New(kNumArgs));
+        args.SetAt(0, instance);
+        Instance& index = Instance::Handle(Z);
+        for (intptr_t i = 0; i < length; ++i) {
+          index = Integer::New(i);
+          args.SetAt(1, index);
+          Dart_Handle value = Api::NewHandle(I,
+              DartEntry::InvokeFunction(function, args));
+          if (::Dart_IsError(value))
+            return value;
+          result[i] = value;
+        }
+        return Api::Success();
+      }
+    }
+    return Api::NewError("Object does not implement the 'List' interface");
+  }
+}
+
+
+#define SET_LIST_ELEMENT(type, obj, index, value)                              \
   const type& array = type::Cast(obj);                                         \
-  const Object& value_obj = Object::Handle(isolate, Api::UnwrapHandle(value)); \
+  const Object& value_obj = Object::Handle(Z, Api::UnwrapHandle(value));       \
   if (!value_obj.IsNull() && !value_obj.IsInstance()) {                        \
-    RETURN_TYPE_ERROR(isolate, value, Instance);                               \
+    RETURN_TYPE_ERROR(Z, value, Instance);                                     \
   }                                                                            \
   if ((index >= 0) && (index < array.Length())) {                              \
     array.SetAt(index, value_obj);                                             \
@@ -2758,45 +2793,40 @@
 DART_EXPORT Dart_Handle Dart_ListSetAt(Dart_Handle list,
                                        intptr_t index,
                                        Dart_Handle value) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  const Object& obj = Object::Handle(isolate, Api::UnwrapHandle(list));
+  DARTSCOPE(Thread::Current());
+  const Object& obj = Object::Handle(Z, Api::UnwrapHandle(list));
   // If the list is immutable we call into Dart for the indexed setter to
   // get the unsupported operation exception as the result.
   if (obj.IsArray() && !Array::Cast(obj).IsImmutable()) {
-    SET_LIST_ELEMENT(isolate, Array, obj, index, value);
+    SET_LIST_ELEMENT(Array, obj, index, value);
   } else if (obj.IsGrowableObjectArray()) {
-    SET_LIST_ELEMENT(isolate, GrowableObjectArray, obj, index, value);
+    SET_LIST_ELEMENT(GrowableObjectArray, obj, index, value);
   } else if (obj.IsError()) {
     return list;
   } else {
-    CHECK_CALLBACK_STATE(isolate);
+    CHECK_CALLBACK_STATE(T);
 
     // Check and handle a dart object that implements the List interface.
-    const Instance& instance =
-        Instance::Handle(isolate, GetListInstance(isolate, obj));
+    const Instance& instance = Instance::Handle(Z, GetListInstance(Z, obj));
     if (!instance.IsNull()) {
       const intptr_t kNumArgs = 3;
       ArgumentsDescriptor args_desc(
           Array::Handle(ArgumentsDescriptor::New(kNumArgs)));
-      const Function& function = Function::Handle(
-          isolate,
+      const Function& function = Function::Handle(Z,
           Resolver::ResolveDynamic(instance,
                                    Symbols::AssignIndexToken(),
                                    args_desc));
       if (!function.IsNull()) {
-        const Integer& index_obj =
-            Integer::Handle(isolate, Integer::New(index));
-        const Object& value_obj =
-            Object::Handle(isolate, Api::UnwrapHandle(value));
+        const Integer& index_obj = Integer::Handle(Z, Integer::New(index));
+        const Object& value_obj = Object::Handle(Z, Api::UnwrapHandle(value));
         if (!value_obj.IsNull() && !value_obj.IsInstance()) {
-          RETURN_TYPE_ERROR(isolate, value, Instance);
+          RETURN_TYPE_ERROR(Z, value, Instance);
         }
-        const Array& args = Array::Handle(isolate, Array::New(kNumArgs));
+        const Array& args = Array::Handle(Z, Array::New(kNumArgs));
         args.SetAt(0, instance);
         args.SetAt(1, index_obj);
         args.SetAt(2, value_obj);
-        return Api::NewHandle(isolate, DartEntry::InvokeFunction(function,
+        return Api::NewHandle(I, DartEntry::InvokeFunction(function,
                                                                  args));
       }
     }
@@ -2815,11 +2845,12 @@
 static RawObject* ThrowArgumentError(const char* exception_message) {
   Thread* thread = Thread::Current();
   Isolate* isolate = thread->isolate();
+  Zone* zone = thread->zone();
   // 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(isolate, Library::LookupLibrary(lib_url));
+      Library::Handle(zone, Library::LookupLibrary(lib_url));
   if (lib.IsNull()) {
     const String& message = String::Handle(
         String::NewFormatted("%s: library '%s' not found.",
@@ -2827,15 +2858,15 @@
     return ApiError::New(message);
   }
   const Class& cls = Class::Handle(
-      isolate, lib.LookupClassAllowPrivate(class_name));
+      zone, lib.LookupClassAllowPrivate(class_name));
   ASSERT(!cls.IsNull());
-  Object& result = Object::Handle(isolate);
+  Object& result = Object::Handle(zone);
   String& dot_name = String::Handle(String::New("."));
   String& constr_name = String::Handle(String::Concat(class_name, dot_name));
   result = ResolveConstructor(CURRENT_FUNC, cls, class_name, constr_name, 1);
   if (result.IsError()) return result.raw();
   ASSERT(result.IsFunction());
-  Function& constructor = Function::Handle(isolate);
+  Function& constructor = Function::Handle(zone);
   constructor ^= result.raw();
   if (!constructor.IsGenerativeConstructor()) {
     const String& message = String::Handle(
@@ -2843,12 +2874,11 @@
                              CURRENT_FUNC, class_name.ToCString()));
     return ApiError::New(message);
   }
-  Instance& exception = Instance::Handle(isolate);
+  Instance& exception = Instance::Handle(zone);
   exception = Instance::New(cls);
-  const Array& args = Array::Handle(isolate, Array::New(3));
+  const Array& args = Array::Handle(zone, Array::New(3));
   args.SetAt(0, exception);
-  args.SetAt(1,
-             Smi::Handle(isolate, Smi::New(Function::kCtorPhaseAll)));
+  args.SetAt(1, Smi::Handle(zone, Smi::New(Function::kCtorPhaseAll)));
   args.SetAt(2, String::Handle(String::New(exception_message)));
   result = DartEntry::InvokeFunction(constructor, args);
   if (result.IsError()) return result.raw();
@@ -2879,16 +2909,15 @@
 }
 
 // TODO(sgjesse): value should always be smaller then 0xff. Add error handling.
-#define GET_LIST_ELEMENT_AS_BYTES(isolate, type, obj, native_array, offset,    \
-                                  length)                                      \
+#define GET_LIST_ELEMENT_AS_BYTES(type, obj, native_array, offset, length)     \
   const type& array = type::Cast(obj);                                         \
   if (Utils::RangeCheck(offset, length, array.Length())) {                     \
-    Object& element = Object::Handle(isolate);                                 \
+    Object& element = Object::Handle(Z);                                       \
     for (int i = 0; i < length; i++) {                                         \
       element = array.At(offset + i);                                          \
       if (!element.IsInteger()) {                                              \
-        return Api::NewHandle(                                                 \
-            isolate, ThrowArgumentError("List contains non-int elements"));    \
+        return Api::NewHandle(I,                                               \
+            ThrowArgumentError("List contains non-int elements"));             \
                                                                                \
       }                                                                        \
       const Integer& integer = Integer::Cast(element);                         \
@@ -2917,9 +2946,8 @@
                                             intptr_t offset,
                                             uint8_t* native_array,
                                             intptr_t length) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  const Object& obj = Object::Handle(isolate, Api::UnwrapHandle(list));
+  DARTSCOPE(Thread::Current());
+  const Object& obj = Object::Handle(Z, Api::UnwrapHandle(list));
   if (obj.IsTypedData()) {
     const TypedData& array = TypedData::Cast(obj);
     if (array.ElementSizeInBytes() == 1) {
@@ -2962,48 +2990,38 @@
     }
   }
   if (obj.IsArray()) {
-    GET_LIST_ELEMENT_AS_BYTES(isolate,
-                              Array,
-                              obj,
-                              native_array,
-                              offset,
-                              length);
+    GET_LIST_ELEMENT_AS_BYTES(Array, obj, native_array, offset, length);
   }
   if (obj.IsGrowableObjectArray()) {
-    GET_LIST_ELEMENT_AS_BYTES(isolate,
-                              GrowableObjectArray,
-                              obj,
-                              native_array,
-                              offset,
-                              length);
+    GET_LIST_ELEMENT_AS_BYTES(
+        GrowableObjectArray, obj, native_array, offset, length);
   }
   if (obj.IsError()) {
     return list;
   }
-  CHECK_CALLBACK_STATE(isolate);
+  CHECK_CALLBACK_STATE(T);
 
   // Check and handle a dart object that implements the List interface.
   const Instance& instance =
-      Instance::Handle(isolate, GetListInstance(isolate, obj));
+      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(
-        isolate,
+    const Function& function = Function::Handle(Z,
         Resolver::ResolveDynamic(instance, Symbols::IndexToken(), args_desc));
     if (!function.IsNull()) {
-      Object& result = Object::Handle(isolate);
-      Integer& intobj = Integer::Handle(isolate);
-      const Array& args = Array::Handle(isolate, Array::New(kNumArgs));
+      Object& result = Object::Handle(Z);
+      Integer& intobj = Integer::Handle(Z);
+      const Array& args = Array::Handle(Z, Array::New(kNumArgs));
       args.SetAt(0, instance);  // Set up the receiver as the first argument.
       for (int i = 0; i < length; i++) {
-        HANDLESCOPE(isolate);
+        HANDLESCOPE(T);
         intobj = Integer::New(offset + i);
         args.SetAt(1, intobj);
         result = DartEntry::InvokeFunction(function, args);
         if (result.IsError()) {
-          return Api::NewHandle(isolate, result.raw());
+          return Api::NewHandle(I, result.raw());
         }
         if (!result.IsInteger()) {
           return Api::NewError("%s expects the argument 'list' to be "
@@ -3023,10 +3041,9 @@
 }
 
 
-#define SET_LIST_ELEMENT_AS_BYTES(isolate, type, obj, native_array, offset,    \
-                                  length)                                      \
+#define SET_LIST_ELEMENT_AS_BYTES(type, obj, native_array, offset, length)     \
   const type& array = type::Cast(obj);                                         \
-  Integer& integer = Integer::Handle(isolate);                                 \
+  Integer& integer = Integer::Handle(Z);                                       \
   if (Utils::RangeCheck(offset, length, array.Length())) {                     \
     for (int i = 0; i < length; i++) {                                         \
       integer = Integer::New(native_array[i]);                                 \
@@ -3041,9 +3058,8 @@
                                             intptr_t offset,
                                             uint8_t* native_array,
                                             intptr_t length) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  const Object& obj = Object::Handle(isolate, Api::UnwrapHandle(list));
+  DARTSCOPE(Thread::Current());
+  const Object& obj = Object::Handle(Z, Api::UnwrapHandle(list));
   if (obj.IsTypedData()) {
     const TypedData& array = TypedData::Cast(obj);
     if (array.ElementSizeInBytes() == 1) {
@@ -3060,52 +3076,41 @@
   if (obj.IsArray() && !Array::Cast(obj).IsImmutable()) {
     // If the list is immutable we call into Dart for the indexed setter to
     // get the unsupported operation exception as the result.
-    SET_LIST_ELEMENT_AS_BYTES(isolate,
-                              Array,
-                              obj,
-                              native_array,
-                              offset,
-                              length);
+    SET_LIST_ELEMENT_AS_BYTES(Array, obj, native_array, offset, length);
   }
   if (obj.IsGrowableObjectArray()) {
-    SET_LIST_ELEMENT_AS_BYTES(isolate,
-                              GrowableObjectArray,
-                              obj,
-                              native_array,
-                              offset,
-                              length);
+    SET_LIST_ELEMENT_AS_BYTES(
+        GrowableObjectArray, obj, native_array, offset, length);
   }
   if (obj.IsError()) {
     return list;
   }
-  CHECK_CALLBACK_STATE(isolate);
+  CHECK_CALLBACK_STATE(T);
 
   // Check and handle a dart object that implements the List interface.
-  const Instance& instance =
-      Instance::Handle(isolate, GetListInstance(isolate, obj));
+  const Instance& instance = Instance::Handle(Z, GetListInstance(Z, obj));
   if (!instance.IsNull()) {
     const int kNumArgs = 3;
     ArgumentsDescriptor args_desc(
         Array::Handle(ArgumentsDescriptor::New(kNumArgs)));
-    const Function& function = Function::Handle(
-        isolate,
+    const Function& function = Function::Handle(Z,
         Resolver::ResolveDynamic(instance,
                                  Symbols::AssignIndexToken(),
                                  args_desc));
     if (!function.IsNull()) {
-      Integer& indexobj = Integer::Handle(isolate);
-      Integer& valueobj = Integer::Handle(isolate);
-      const Array& args = Array::Handle(isolate, Array::New(kNumArgs));
+      Integer& indexobj = Integer::Handle(Z);
+      Integer& valueobj = Integer::Handle(Z);
+      const Array& args = Array::Handle(Z, Array::New(kNumArgs));
       args.SetAt(0, instance);  // Set up the receiver as the first argument.
       for (int i = 0; i < length; i++) {
         indexobj = Integer::New(offset + i);
         valueobj = Integer::New(native_array[i]);
         args.SetAt(1, indexobj);
         args.SetAt(2, valueobj);
-        const Object& result = Object::Handle(
-            isolate, DartEntry::InvokeFunction(function, args));
+        const Object& result = Object::Handle(Z,
+            DartEntry::InvokeFunction(function, args));
         if (result.IsError()) {
-          return Api::NewHandle(isolate, result.raw());
+          return Api::NewHandle(I, result.raw());
         }
       }
       return Api::Success();
@@ -3118,41 +3123,35 @@
 // --- Maps ---
 
 DART_EXPORT Dart_Handle Dart_MapGetAt(Dart_Handle map, Dart_Handle key) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  CHECK_CALLBACK_STATE(isolate);
-  const Object& obj = Object::Handle(isolate, Api::UnwrapHandle(map));
-  const Instance& instance =
-      Instance::Handle(isolate, GetMapInstance(isolate, obj));
+  DARTSCOPE(Thread::Current());
+  CHECK_CALLBACK_STATE(T);
+  const Object& obj = Object::Handle(Z, Api::UnwrapHandle(map));
+  const Instance& instance = Instance::Handle(Z, GetMapInstance(Z, obj));
   if (!instance.IsNull()) {
     const Object& key_obj = Object::Handle(Api::UnwrapHandle(key));
     if (!(key_obj.IsInstance() || key_obj.IsNull())) {
       return Api::NewError("Key is not an instance");
     }
-    return Api::NewHandle(isolate, Send1Arg(
-       instance,
-       Symbols::IndexToken(),
-       Instance::Cast(key_obj)));
+    return Api::NewHandle(I,
+        Send1Arg(instance, Symbols::IndexToken(), Instance::Cast(key_obj)));
   }
   return Api::NewError("Object does not implement the 'Map' interface");
 }
 
 
 DART_EXPORT Dart_Handle Dart_MapContainsKey(Dart_Handle map, Dart_Handle key) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  CHECK_CALLBACK_STATE(isolate);
-  const Object& obj = Object::Handle(isolate, Api::UnwrapHandle(map));
-  const Instance& instance =
-      Instance::Handle(isolate, GetMapInstance(isolate, obj));
+  DARTSCOPE(Thread::Current());
+  CHECK_CALLBACK_STATE(T);
+  const Object& obj = Object::Handle(Z, Api::UnwrapHandle(map));
+  const Instance& instance = Instance::Handle(Z, GetMapInstance(Z, obj));
   if (!instance.IsNull()) {
-    const Object& key_obj = Object::Handle(Api::UnwrapHandle(key));
+    const Object& key_obj = Object::Handle(Z, Api::UnwrapHandle(key));
     if (!(key_obj.IsInstance() || key_obj.IsNull())) {
       return Api::NewError("Key is not an instance");
     }
-    return Api::NewHandle(isolate, Send1Arg(
+    return Api::NewHandle(I, Send1Arg(
        instance,
-       String::Handle(isolate, String::New("containsKey")),
+       String::Handle(Z, String::New("containsKey")),
        Instance::Cast(key_obj)));
   }
   return Api::NewError("Object does not implement the 'Map' interface");
@@ -3160,19 +3159,17 @@
 
 
 DART_EXPORT Dart_Handle Dart_MapKeys(Dart_Handle map) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  CHECK_CALLBACK_STATE(isolate);
-  Object& obj = Object::Handle(isolate, Api::UnwrapHandle(map));
-  Instance& instance =
-      Instance::Handle(isolate, GetMapInstance(isolate, obj));
+  DARTSCOPE(Thread::Current());
+  CHECK_CALLBACK_STATE(T);
+  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(String::New("get:keys"))));
+        instance, String::Handle(Z, String::New("get:keys"))));
     if (!iterator.IsInstance()) {
-      return Api::NewHandle(isolate, iterator.raw());
+      return Api::NewHandle(I, iterator.raw());
     }
-    return Api::NewHandle(isolate, Send0Arg(
+    return Api::NewHandle(I, Send0Arg(
         Instance::Cast(iterator),
         String::Handle(String::New("toList"))));
   }
@@ -3277,11 +3274,11 @@
   }
   if (RawObject::IsTypedDataViewClassId(class_id)) {
     // Check if data object of the view is external.
-    Isolate* isolate = Isolate::Current();
-    const Instance& view_obj = Api::UnwrapInstanceHandle(isolate, object);
+    Zone* zone = Thread::Current()->zone();
+    const Instance& view_obj = Api::UnwrapInstanceHandle(zone, object);
     ASSERT(!view_obj.IsNull());
     const Instance& data_obj =
-        Instance::Handle(isolate, TypedDataView::Data(view_obj));
+        Instance::Handle(zone, TypedDataView::Data(view_obj));
     if (ExternalTypedData::IsExternalTypedData(data_obj)) {
       return GetType(class_id);
     }
@@ -3290,14 +3287,14 @@
 }
 
 
-static RawObject* GetByteDataConstructor(Isolate* isolate,
+static RawObject* GetByteDataConstructor(Thread* thread,
                                          const String& constructor_name,
                                          intptr_t num_args) {
   const Library& lib =
-      Library::Handle(isolate->object_store()->typed_data_library());
+      Library::Handle(thread->isolate()->object_store()->typed_data_library());
   ASSERT(!lib.IsNull());
   const Class& cls = Class::Handle(
-      isolate, lib.LookupClassAllowPrivate(Symbols::ByteData()));
+      thread->zone(), lib.LookupClassAllowPrivate(Symbols::ByteData()));
   ASSERT(!cls.IsNull());
   return ResolveConstructor(CURRENT_FUNC,
                             cls,
@@ -3307,20 +3304,22 @@
 }
 
 
-static Dart_Handle NewByteData(Isolate* isolate, intptr_t length) {
+static Dart_Handle NewByteData(Thread* thread, intptr_t length) {
   CHECK_LENGTH(length, TypedData::MaxElements(kTypedDataInt8ArrayCid));
-  Object& result = Object::Handle(isolate);
-  result = GetByteDataConstructor(isolate, Symbols::ByteDataDot(), 1);
+  Isolate* isolate = thread->isolate();
+  Zone* zone = thread->zone();
+  Object& result = Object::Handle(zone);
+  result = GetByteDataConstructor(thread, Symbols::ByteDataDot(), 1);
   ASSERT(!result.IsNull());
   ASSERT(result.IsFunction());
   const Function& factory = Function::Cast(result);
   ASSERT(!factory.IsGenerativeConstructor());
 
   // Create the argument list.
-  const Array& args = Array::Handle(isolate, Array::New(2));
+  const Array& args = Array::Handle(zone, Array::New(2));
   // Factories get type arguments.
   args.SetAt(0, Object::null_type_arguments());
-  args.SetAt(1, Smi::Handle(isolate, Smi::New(length)));
+  args.SetAt(1, Smi::Handle(zone, Smi::New(length)));
 
   // Invoke the constructor and return the new object.
   result = DartEntry::InvokeFunction(factory, args);
@@ -3338,11 +3337,13 @@
 
 
 static Dart_Handle NewExternalTypedData(
-    Isolate* isolate, intptr_t cid, void* data, intptr_t length) {
+    Thread* thread, intptr_t cid, void* data, intptr_t length) {
   CHECK_LENGTH(length, ExternalTypedData::MaxElements(cid));
+  Isolate* isolate = thread->isolate();
+  Zone* zone = thread->zone();
   intptr_t bytes = length * ExternalTypedData::ElementSizeInBytes(cid);
   const ExternalTypedData& result = ExternalTypedData::Handle(
-      isolate,
+      zone,
       ExternalTypedData::New(cid,
                              reinterpret_cast<uint8_t*>(data),
                              length,
@@ -3352,14 +3353,16 @@
 
 
 static Dart_Handle NewExternalByteData(
-    Isolate* isolate, void* data, intptr_t length) {
+    Thread* thread, void* data, intptr_t length) {
+  Zone* zone = thread->zone();
+  Isolate* isolate = thread->isolate();
   Dart_Handle ext_data = NewExternalTypedData(
-      isolate, kExternalTypedDataUint8ArrayCid, data, length);
+      thread, kExternalTypedDataUint8ArrayCid, data, length);
   if (::Dart_IsError(ext_data)) {
     return ext_data;
   }
-  Object& result = Object::Handle(isolate);
-  result = GetByteDataConstructor(isolate, Symbols::ByteDataDot_view(), 3);
+  Object& result = Object::Handle(zone);
+  result = GetByteDataConstructor(thread, Symbols::ByteDataDot_view(), 3);
   ASSERT(!result.IsNull());
   ASSERT(result.IsFunction());
   const Function& factory = Function::Cast(result);
@@ -3367,13 +3370,13 @@
 
   // Create the argument list.
   const intptr_t num_args = 3;
-  const Array& args = Array::Handle(isolate, Array::New(num_args + 1));
+  const Array& args = Array::Handle(zone, Array::New(num_args + 1));
   // Factories get type arguments.
   args.SetAt(0, Object::null_type_arguments());
   const ExternalTypedData& array =
-      Api::UnwrapExternalTypedDataHandle(isolate, ext_data);
+      Api::UnwrapExternalTypedDataHandle(zone, ext_data);
   args.SetAt(1, array);
-  Smi& smi = Smi::Handle(isolate);
+  Smi& smi = Smi::Handle(zone);
   smi = Smi::New(0);
   args.SetAt(2, smi);
   smi = Smi::New(length);
@@ -3388,36 +3391,35 @@
 
 DART_EXPORT Dart_Handle Dart_NewTypedData(Dart_TypedData_Type type,
                                           intptr_t length) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  CHECK_CALLBACK_STATE(isolate);
+  DARTSCOPE(Thread::Current());
+  CHECK_CALLBACK_STATE(T);
   switch (type) {
     case Dart_TypedData_kByteData :
-      return NewByteData(isolate, length);
+      return NewByteData(T, length);
     case Dart_TypedData_kInt8 :
-      return NewTypedData(isolate, kTypedDataInt8ArrayCid, length);
+      return NewTypedData(I, kTypedDataInt8ArrayCid, length);
     case Dart_TypedData_kUint8 :
-      return NewTypedData(isolate, kTypedDataUint8ArrayCid, length);
+      return NewTypedData(I, kTypedDataUint8ArrayCid, length);
     case Dart_TypedData_kUint8Clamped :
-      return NewTypedData(isolate, kTypedDataUint8ClampedArrayCid, length);
+      return NewTypedData(I, kTypedDataUint8ClampedArrayCid, length);
     case Dart_TypedData_kInt16 :
-      return NewTypedData(isolate, kTypedDataInt16ArrayCid, length);
+      return NewTypedData(I, kTypedDataInt16ArrayCid, length);
     case Dart_TypedData_kUint16 :
-      return NewTypedData(isolate, kTypedDataUint16ArrayCid, length);
+      return NewTypedData(I, kTypedDataUint16ArrayCid, length);
     case Dart_TypedData_kInt32 :
-      return NewTypedData(isolate, kTypedDataInt32ArrayCid, length);
+      return NewTypedData(I, kTypedDataInt32ArrayCid, length);
     case Dart_TypedData_kUint32 :
-      return NewTypedData(isolate, kTypedDataUint32ArrayCid, length);
+      return NewTypedData(I, kTypedDataUint32ArrayCid, length);
     case Dart_TypedData_kInt64 :
-      return NewTypedData(isolate, kTypedDataInt64ArrayCid, length);
+      return NewTypedData(I, kTypedDataInt64ArrayCid, length);
     case Dart_TypedData_kUint64 :
-      return NewTypedData(isolate, kTypedDataUint64ArrayCid, length);
+      return NewTypedData(I, kTypedDataUint64ArrayCid, length);
     case Dart_TypedData_kFloat32 :
-      return NewTypedData(isolate, kTypedDataFloat32ArrayCid,  length);
+      return NewTypedData(I, kTypedDataFloat32ArrayCid,  length);
     case Dart_TypedData_kFloat64 :
-      return NewTypedData(isolate, kTypedDataFloat64ArrayCid, length);
+      return NewTypedData(I, kTypedDataFloat64ArrayCid, length);
     case Dart_TypedData_kFloat32x4:
-      return NewTypedData(isolate, kTypedDataFloat32x4ArrayCid, length);
+      return NewTypedData(I, kTypedDataFloat32x4ArrayCid, length);
     default:
       return Api::NewError("%s expects argument 'type' to be of 'TypedData'",
                            CURRENT_FUNC);
@@ -3431,75 +3433,50 @@
     Dart_TypedData_Type type,
     void* data,
     intptr_t length) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
+  DARTSCOPE(Thread::Current());
   if (data == NULL && length != 0) {
     RETURN_NULL_ERROR(data);
   }
-  CHECK_CALLBACK_STATE(isolate);
+  CHECK_CALLBACK_STATE(T);
   switch (type) {
     case Dart_TypedData_kByteData:
-      return NewExternalByteData(isolate, data, length);
+      return NewExternalByteData(T, data, length);
     case Dart_TypedData_kInt8:
-      return NewExternalTypedData(isolate,
-                                  kExternalTypedDataInt8ArrayCid,
-                                  data,
-                                  length);
+      return NewExternalTypedData(T,
+          kExternalTypedDataInt8ArrayCid, data, length);
     case Dart_TypedData_kUint8:
-      return NewExternalTypedData(isolate,
-                                  kExternalTypedDataUint8ArrayCid,
-                                  data,
-                                  length);
+      return NewExternalTypedData(T,
+          kExternalTypedDataUint8ArrayCid, data, length);
     case Dart_TypedData_kUint8Clamped:
-      return NewExternalTypedData(isolate,
-                                  kExternalTypedDataUint8ClampedArrayCid,
-                                  data,
-                                  length);
+      return NewExternalTypedData(T,
+          kExternalTypedDataUint8ClampedArrayCid, data, length);
     case Dart_TypedData_kInt16:
-      return NewExternalTypedData(isolate,
-                                  kExternalTypedDataInt16ArrayCid,
-                                  data,
-                                  length);
+      return NewExternalTypedData(T,
+          kExternalTypedDataInt16ArrayCid, data, length);
     case Dart_TypedData_kUint16:
-      return NewExternalTypedData(isolate,
-                                  kExternalTypedDataUint16ArrayCid,
-                                  data,
-                                  length);
+      return NewExternalTypedData(T,
+          kExternalTypedDataUint16ArrayCid, data, length);
     case Dart_TypedData_kInt32:
-      return NewExternalTypedData(isolate,
-                                  kExternalTypedDataInt32ArrayCid,
-                                  data,
-                                  length);
+      return NewExternalTypedData(T,
+          kExternalTypedDataInt32ArrayCid, data, length);
     case Dart_TypedData_kUint32:
-      return NewExternalTypedData(isolate,
-                                  kExternalTypedDataUint32ArrayCid,
-                                  data,
-                                  length);
+      return NewExternalTypedData(T,
+          kExternalTypedDataUint32ArrayCid, data, length);
     case Dart_TypedData_kInt64:
-      return NewExternalTypedData(isolate,
-                                  kExternalTypedDataInt64ArrayCid,
-                                  data,
-                                  length);
+      return NewExternalTypedData(T,
+          kExternalTypedDataInt64ArrayCid, data, length);
     case Dart_TypedData_kUint64:
-      return NewExternalTypedData(isolate,
-                                  kExternalTypedDataUint64ArrayCid,
-                                  data,
-                                  length);
+      return NewExternalTypedData(T,
+          kExternalTypedDataUint64ArrayCid, data, length);
     case Dart_TypedData_kFloat32:
-      return NewExternalTypedData(isolate,
-                                  kExternalTypedDataFloat32ArrayCid,
-                                  data,
-                                  length);
+      return NewExternalTypedData(T,
+          kExternalTypedDataFloat32ArrayCid, data, length);
     case Dart_TypedData_kFloat64:
-      return NewExternalTypedData(isolate,
-                                  kExternalTypedDataFloat64ArrayCid,
-                                  data,
-                                  length);
+      return NewExternalTypedData(T,
+          kExternalTypedDataFloat64ArrayCid, data, length);
     case Dart_TypedData_kFloat32x4:
-      return NewExternalTypedData(isolate,
-                                  kExternalTypedDataFloat32x4ArrayCid,
-                                  data,
-                                  length);
+      return NewExternalTypedData(T,
+          kExternalTypedDataFloat32x4ArrayCid, data, length);
     default:
       return Api::NewError("%s expects argument 'type' to be of"
                            " 'external TypedData'", CURRENT_FUNC);
@@ -3509,15 +3486,15 @@
 }
 
 
-static RawObject* GetByteBufferConstructor(Isolate* isolate,
+static RawObject* GetByteBufferConstructor(Thread* thread,
                                            const String& class_name,
                                            const String& constructor_name,
                                            intptr_t num_args) {
   const Library& lib =
-      Library::Handle(isolate->object_store()->typed_data_library());
+      Library::Handle(thread->isolate()->object_store()->typed_data_library());
   ASSERT(!lib.IsNull());
   const Class& cls = Class::Handle(
-      isolate, lib.LookupClassAllowPrivate(class_name));
+      thread->zone(), lib.LookupClassAllowPrivate(class_name));
   ASSERT(!cls.IsNull());
   return ResolveConstructor(CURRENT_FUNC,
                             cls,
@@ -3528,16 +3505,15 @@
 
 
 DART_EXPORT Dart_Handle Dart_NewByteBuffer(Dart_Handle typed_data) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
+  DARTSCOPE(Thread::Current());
   intptr_t class_id = Api::ClassId(typed_data);
   if (!RawObject::IsExternalTypedDataClassId(class_id) &&
       !RawObject::IsTypedDataViewClassId(class_id) &&
       !RawObject::IsTypedDataClassId(class_id)) {
-    RETURN_TYPE_ERROR(isolate, typed_data, 'TypedData');
+    RETURN_TYPE_ERROR(Z, typed_data, 'TypedData');
   }
-  Object& result = Object::Handle(isolate);
-  result = GetByteBufferConstructor(isolate,
+  Object& result = Object::Handle(Z);
+  result = GetByteBufferConstructor(T,
                                     Symbols::_ByteBuffer(),
                                     Symbols::_ByteBufferDot_New(),
                                     1);
@@ -3547,16 +3523,16 @@
   ASSERT(!factory.IsGenerativeConstructor());
 
   // Create the argument list.
-  const Array& args = Array::Handle(isolate, Array::New(2));
+  const Array& args = Array::Handle(Z, Array::New(2));
   // Factories get type arguments.
   args.SetAt(0, Object::null_type_arguments());
-  const Object& obj = Object::Handle(isolate, Api::UnwrapHandle(typed_data));
+  const Object& obj = Object::Handle(Z, Api::UnwrapHandle(typed_data));
   args.SetAt(1, obj);
 
   // Invoke the factory constructor and return the new object.
   result = DartEntry::InvokeFunction(factory, args);
   ASSERT(result.IsInstance() || result.IsNull() || result.IsError());
-  return Api::NewHandle(isolate, result.raw());
+  return Api::NewHandle(I, result.raw());
 }
 
 
@@ -3597,14 +3573,12 @@
                                                   Dart_TypedData_Type* type,
                                                   void** data,
                                                   intptr_t* len) {
-  Thread* thread = Thread::Current();
-  Isolate* isolate = thread->isolate();
-  DARTSCOPE(isolate);
+  DARTSCOPE(Thread::Current());
   intptr_t class_id = Api::ClassId(object);
   if (!RawObject::IsExternalTypedDataClassId(class_id) &&
       !RawObject::IsTypedDataViewClassId(class_id) &&
       !RawObject::IsTypedDataClassId(class_id)) {
-    RETURN_TYPE_ERROR(isolate, object, 'TypedData');
+    RETURN_TYPE_ERROR(Z, object, 'TypedData');
   }
   if (type == NULL) {
     RETURN_NULL_ERROR(type);
@@ -3624,7 +3598,7 @@
   // If it is an external typed data object just return the data field.
   if (RawObject::IsExternalTypedDataClassId(class_id)) {
     const ExternalTypedData& obj =
-        Api::UnwrapExternalTypedDataHandle(isolate, object);
+        Api::UnwrapExternalTypedDataHandle(Z, object);
     ASSERT(!obj.IsNull());
     length = obj.Length();
     size_in_bytes = length * ExternalTypedData::ElementSizeInBytes(class_id);
@@ -3632,16 +3606,16 @@
     external = true;
   } else if (RawObject::IsTypedDataClassId(class_id)) {
     // Regular typed data object, set up some GC and API callback guards.
-    const TypedData& obj = Api::UnwrapTypedDataHandle(isolate, object);
+    const TypedData& obj = Api::UnwrapTypedDataHandle(Z, object);
     ASSERT(!obj.IsNull());
     length = obj.Length();
     size_in_bytes = length * TypedData::ElementSizeInBytes(class_id);
-    thread->IncrementNoSafepointScopeDepth();
-    START_NO_CALLBACK_SCOPE(isolate);
+    T->IncrementNoSafepointScopeDepth();
+    START_NO_CALLBACK_SCOPE(T);
     data_tmp = obj.DataAddr(0);
   } else {
     ASSERT(RawObject::IsTypedDataViewClassId(class_id));
-    const Instance& view_obj = Api::UnwrapInstanceHandle(isolate, object);
+    const Instance& view_obj = Api::UnwrapInstanceHandle(Z, object);
     ASSERT(!view_obj.IsNull());
     Smi& val = Smi::Handle();
     val ^= TypedDataView::Length(view_obj);
@@ -3650,8 +3624,8 @@
     val ^= TypedDataView::OffsetInBytes(view_obj);
     intptr_t offset_in_bytes = val.Value();
     const Instance& obj = Instance::Handle(TypedDataView::Data(view_obj));
-    thread->IncrementNoSafepointScopeDepth();
-    START_NO_CALLBACK_SCOPE(isolate);
+    T->IncrementNoSafepointScopeDepth();
+    START_NO_CALLBACK_SCOPE(T);
     if (TypedData::IsTypedData(obj)) {
       const TypedData& data_obj = TypedData::Cast(obj);
       data_tmp = data_obj.DataAddr(offset_in_bytes);
@@ -3664,12 +3638,12 @@
   }
   if (FLAG_verify_acquired_data) {
     if (external) {
-      ASSERT(!isolate->heap()->Contains(reinterpret_cast<uword>(data_tmp)));
+      ASSERT(!I->heap()->Contains(reinterpret_cast<uword>(data_tmp)));
     } else {
-      ASSERT(isolate->heap()->Contains(reinterpret_cast<uword>(data_tmp)));
+      ASSERT(I->heap()->Contains(reinterpret_cast<uword>(data_tmp)));
     }
-    const Object& obj = Object::Handle(isolate, Api::UnwrapHandle(object));
-    WeakTable* table = isolate->api_state()->acquired_table();
+    const Object& obj = Object::Handle(Z, Api::UnwrapHandle(object));
+    WeakTable* table = I->api_state()->acquired_table();
     intptr_t current = table->GetValue(obj.raw());
     if (current != 0) {
       return Api::NewError("Data was already acquired for this object.");
@@ -3688,22 +3662,20 @@
 
 
 DART_EXPORT Dart_Handle Dart_TypedDataReleaseData(Dart_Handle object) {
-  Thread* thread = Thread::Current();
-  Isolate* isolate = thread->isolate();
-  DARTSCOPE(isolate);
+  DARTSCOPE(Thread::Current());
   intptr_t class_id = Api::ClassId(object);
   if (!RawObject::IsExternalTypedDataClassId(class_id) &&
       !RawObject::IsTypedDataViewClassId(class_id) &&
       !RawObject::IsTypedDataClassId(class_id)) {
-    RETURN_TYPE_ERROR(isolate, object, 'TypedData');
+    RETURN_TYPE_ERROR(Z, object, 'TypedData');
   }
   if (!RawObject::IsExternalTypedDataClassId(class_id)) {
-    thread->DecrementNoSafepointScopeDepth();
-    END_NO_CALLBACK_SCOPE(isolate);
+    T->DecrementNoSafepointScopeDepth();
+    END_NO_CALLBACK_SCOPE(T);
   }
   if (FLAG_verify_acquired_data) {
-    const Object& obj = Object::Handle(isolate, Api::UnwrapHandle(object));
-    WeakTable* table = isolate->api_state()->acquired_table();
+    const Object& obj = Object::Handle(Z, Api::UnwrapHandle(object));
+    WeakTable* table = I->api_state()->acquired_table();
     intptr_t current = table->GetValue(obj.raw());
     if (current == 0) {
       return Api::NewError("Data was not acquired for this object.");
@@ -3717,13 +3689,15 @@
 
 
 DART_EXPORT Dart_Handle Dart_GetDataFromByteBuffer(Dart_Handle object) {
-  Isolate* isolate = Isolate::Current();
+  Thread* thread = Thread::Current();
+  Zone* zone = thread->zone();
+  Isolate* isolate = thread->isolate();
   CHECK_ISOLATE(isolate);
   intptr_t class_id = Api::ClassId(object);
   if (class_id != kByteBufferCid) {
-    RETURN_TYPE_ERROR(isolate, object, 'ByteBuffer');
+    RETURN_TYPE_ERROR(zone, object, 'ByteBuffer');
   }
-  const Instance& instance = Api::UnwrapInstanceHandle(isolate, object);
+  const Instance& instance = Api::UnwrapInstanceHandle(zone, object);
   ASSERT(!instance.IsNull());
   return Api::NewHandle(isolate, ByteBuffer::Data(instance));
 }
@@ -3783,10 +3757,9 @@
                                  Dart_Handle constructor_name,
                                  int number_of_arguments,
                                  Dart_Handle* arguments) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  CHECK_CALLBACK_STATE(isolate);
-  Object& result = Object::Handle(isolate);
+  DARTSCOPE(Thread::Current());
+  CHECK_CALLBACK_STATE(T);
+  Object& result = Object::Handle(Z);
 
   if (number_of_arguments < 0) {
     return Api::NewError(
@@ -3797,7 +3770,7 @@
   // Get the class to instantiate.
   Object& unchecked_type = Object::Handle(Api::UnwrapHandle(type));
   if (unchecked_type.IsNull() || !unchecked_type.IsType()) {
-    RETURN_TYPE_ERROR(isolate, type, Type);
+    RETURN_TYPE_ERROR(Z, type, Type);
   }
   Type& type_obj = Type::Handle();
   type_obj ^= unchecked_type.raw();
@@ -3806,21 +3779,21 @@
         "%s expects argument 'type' to be a fully resolved type.",
         CURRENT_FUNC);
   }
-  Class& cls = Class::Handle(isolate, type_obj.type_class());
+  Class& cls = Class::Handle(Z, type_obj.type_class());
   TypeArguments& type_arguments =
-      TypeArguments::Handle(isolate, type_obj.arguments());
+      TypeArguments::Handle(Z, type_obj.arguments());
 
-  const String& base_constructor_name = String::Handle(isolate, cls.Name());
+  const String& base_constructor_name = String::Handle(Z, cls.Name());
 
   // And get the name of the constructor to invoke.
-  String& dot_name = String::Handle(isolate);
+  String& dot_name = String::Handle(Z);
   result = Api::UnwrapHandle(constructor_name);
   if (result.IsNull()) {
     dot_name = Symbols::Dot().raw();
   } else if (result.IsString()) {
     dot_name = String::Concat(Symbols::Dot(), String::Cast(result));
   } else {
-    RETURN_TYPE_ERROR(isolate, constructor_name, String);
+    RETURN_TYPE_ERROR(Z, constructor_name, String);
   }
 
   // Resolve the constructor.
@@ -3832,20 +3805,20 @@
                               constr_name,
                               number_of_arguments);
   if (result.IsError()) {
-    return Api::NewHandle(isolate, result.raw());
+    return Api::NewHandle(I, result.raw());
   }
   ASSERT(result.IsFunction());
-  Function& constructor = Function::Handle(isolate);
+  Function& constructor = Function::Handle(Z);
   constructor ^= result.raw();
 
-  Instance& new_object = Instance::Handle(isolate);
+  Instance& new_object = Instance::Handle(Z);
   if (constructor.IsRedirectingFactory()) {
     ClassFinalizer::ResolveRedirectingFactory(cls, constructor);
     Type& redirect_type = Type::Handle(constructor.RedirectionType());
     constructor = constructor.RedirectionTarget();
     if (constructor.IsNull()) {
       ASSERT(redirect_type.IsMalformed());
-      return Api::NewHandle(isolate, redirect_type.error());
+      return Api::NewHandle(I, redirect_type.error());
     }
 
     if (!redirect_type.IsInstantiated()) {
@@ -3855,7 +3828,7 @@
       redirect_type ^= redirect_type.InstantiateFrom(type_arguments,
                                                      &bound_error);
       if (!bound_error.IsNull()) {
-        return Api::NewHandle(isolate, bound_error.raw());
+        return Api::NewHandle(I, bound_error.raw());
       }
       redirect_type ^= redirect_type.Canonicalize();
     }
@@ -3874,7 +3847,7 @@
   intptr_t arg_index = 0;
   int extra_args = (constructor.IsGenerativeConstructor() ? 2 : 1);
   const Array& args =
-      Array::Handle(isolate, Array::New(number_of_arguments + extra_args));
+      Array::Handle(Z, Array::New(number_of_arguments + extra_args));
   if (constructor.IsGenerativeConstructor()) {
     // Constructors get the uninitialized object and a constructor phase.
     if (!type_arguments.IsNull()) {
@@ -3884,18 +3857,17 @@
       new_object.SetTypeArguments(type_arguments);
     }
     args.SetAt(arg_index++, new_object);
-    args.SetAt(arg_index++,
-               Smi::Handle(isolate, Smi::New(Function::kCtorPhaseAll)));
+    args.SetAt(arg_index++, Smi::Handle(Z, Smi::New(Function::kCtorPhaseAll)));
   } else {
     // Factories get type arguments.
     args.SetAt(arg_index++, type_arguments);
   }
-  Object& argument = Object::Handle(isolate);
+  Object& argument = Object::Handle(Z);
   for (int i = 0; i < number_of_arguments; i++) {
     argument = Api::UnwrapHandle(arguments[i]);
     if (!argument.IsNull() && !argument.IsInstance()) {
       if (argument.IsError()) {
-        return Api::NewHandle(isolate, argument.raw());
+        return Api::NewHandle(I, argument.raw());
       } else {
         return Api::NewError(
             "%s expects arguments[%d] to be an Instance handle.",
@@ -3908,7 +3880,7 @@
   // Invoke the constructor and return the new object.
   result = DartEntry::InvokeFunction(constructor, args);
   if (result.IsError()) {
-    return Api::NewHandle(isolate, result.raw());
+    return Api::NewHandle(I, result.raw());
   }
 
   if (constructor.IsGenerativeConstructor()) {
@@ -3917,16 +3889,17 @@
     ASSERT(result.IsNull() || result.IsInstance());
     new_object ^= result.raw();
   }
-  return Api::NewHandle(isolate, new_object.raw());
+  return Api::NewHandle(I, new_object.raw());
 }
 
 
-static RawInstance* AllocateObject(Isolate* isolate, const Class& cls) {
+static RawInstance* AllocateObject(Thread* thread, const Class& cls) {
   if (!cls.is_fields_marked_nullable()) {
     // Mark all fields as nullable.
-    Class& iterate_cls = Class::Handle(isolate, cls.raw());
-    Field& field = Field::Handle(isolate);
-    Array& fields = Array::Handle(isolate);
+    Zone* zone = thread->zone();
+    Class& iterate_cls = Class::Handle(zone, cls.raw());
+    Field& field = Field::Handle(zone);
+    Array& fields = Array::Handle(zone);
     while (!iterate_cls.IsNull()) {
       ASSERT(iterate_cls.is_finalized());
       iterate_cls.set_is_fields_marked_nullable();
@@ -3948,22 +3921,21 @@
 
 
 DART_EXPORT Dart_Handle Dart_Allocate(Dart_Handle type) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  CHECK_CALLBACK_STATE(isolate);
+  DARTSCOPE(Thread::Current());
+  CHECK_CALLBACK_STATE(T);
 
-  const Type& type_obj = Api::UnwrapTypeHandle(isolate, type);
+  const Type& type_obj = Api::UnwrapTypeHandle(Z, type);
   // Get the class to instantiate.
   if (type_obj.IsNull()) {
-    RETURN_TYPE_ERROR(isolate, type, Type);
+    RETURN_TYPE_ERROR(Z, type, Type);
   }
-  const Class& cls = Class::Handle(isolate, type_obj.type_class());
-  const Error& error = Error::Handle(isolate, cls.EnsureIsFinalized(isolate));
+  const Class& cls = Class::Handle(Z, type_obj.type_class());
+  const Error& error = Error::Handle(Z, cls.EnsureIsFinalized(T));
   if (!error.IsNull()) {
     // An error occurred, return error object.
-    return Api::NewHandle(isolate, error.raw());
+    return Api::NewHandle(I, error.raw());
   }
-  return Api::NewHandle(isolate, AllocateObject(isolate, cls));
+  return Api::NewHandle(I, AllocateObject(T, cls));
 }
 
 
@@ -3971,44 +3943,44 @@
     Dart_Handle type,
     intptr_t num_native_fields,
     const intptr_t* native_fields) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  CHECK_CALLBACK_STATE(isolate);
+  DARTSCOPE(Thread::Current());
+  CHECK_CALLBACK_STATE(T);
 
-  const Type& type_obj = Api::UnwrapTypeHandle(isolate, type);
+  const Type& type_obj = Api::UnwrapTypeHandle(Z, type);
   // Get the class to instantiate.
   if (type_obj.IsNull()) {
-    RETURN_TYPE_ERROR(isolate, type, Type);
+    RETURN_TYPE_ERROR(Z, type, Type);
   }
   if (native_fields == NULL) {
     RETURN_NULL_ERROR(native_fields);
   }
-  const Class& cls = Class::Handle(isolate, type_obj.type_class());
-  const Error& error = Error::Handle(isolate, cls.EnsureIsFinalized(isolate));
+  const Class& cls = Class::Handle(Z, type_obj.type_class());
+  const Error& error = Error::Handle(Z, cls.EnsureIsFinalized(T));
   if (!error.IsNull()) {
     // An error occurred, return error object.
-    return Api::NewHandle(isolate, error.raw());
+    return Api::NewHandle(I, error.raw());
   }
   if (num_native_fields != cls.num_native_fields()) {
     return Api::NewError(
         "%s: invalid number of native fields %" Pd " passed in, expected %d",
         CURRENT_FUNC, num_native_fields, cls.num_native_fields());
   }
-  const Instance& instance = Instance::Handle(isolate,
-                                              AllocateObject(isolate, cls));
+  const Instance& instance = Instance::Handle(Z, AllocateObject(T, cls));
   instance.SetNativeFields(num_native_fields, native_fields);
-  return Api::NewHandle(isolate, instance.raw());
+  return Api::NewHandle(I, instance.raw());
 }
 
 
-static Dart_Handle SetupArguments(Isolate* isolate,
+static Dart_Handle SetupArguments(Thread* thread,
                                   int num_args,
                                   Dart_Handle* arguments,
                                   int extra_args,
                                   Array* args) {
+  Zone* zone = thread->zone();
+  Isolate* isolate = thread->isolate();
   // Check for malformed arguments in the arguments list.
   *args = Array::New(num_args + extra_args);
-  Object& arg = Object::Handle(isolate);
+  Object& arg = Object::Handle(zone);
   for (int i = 0; i < num_args; i++) {
     arg = Api::UnwrapHandle(arguments[i]);
     if (!arg.IsNull() && !arg.IsInstance()) {
@@ -4031,22 +4003,21 @@
                                                Dart_Handle name,
                                                int number_of_arguments,
                                                Dart_Handle* arguments) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  CHECK_CALLBACK_STATE(isolate);
+  DARTSCOPE(Thread::Current());
+  CHECK_CALLBACK_STATE(T);
 
   if (number_of_arguments < 0) {
     return Api::NewError(
         "%s expects argument 'number_of_arguments' to be non-negative.",
         CURRENT_FUNC);
   }
-  const String& constructor_name = Api::UnwrapStringHandle(isolate, name);
+  const String& constructor_name = Api::UnwrapStringHandle(Z, name);
   if (constructor_name.IsNull()) {
-    RETURN_TYPE_ERROR(isolate, name, String);
+    RETURN_TYPE_ERROR(Z, name, String);
   }
-  const Instance& instance = Api::UnwrapInstanceHandle(isolate, object);
+  const Instance& instance = Api::UnwrapInstanceHandle(Z, object);
   if (instance.IsNull()) {
-    RETURN_TYPE_ERROR(isolate, object, Instance);
+    RETURN_TYPE_ERROR(Z, object, Instance);
   }
 
   // Since we have allocated an object it would mean that the type
@@ -4055,18 +4026,18 @@
   // once for the same object.
 
   // Construct name of the constructor to invoke.
-  const Type& type_obj = Type::Handle(isolate, instance.GetType());
-  const Class& cls = Class::Handle(isolate, type_obj.type_class());
-  const String& class_name = String::Handle(isolate, cls.Name());
-  const Array& strings = Array::Handle(Array::New(3));
+  const Type& type_obj = Type::Handle(Z, instance.GetType());
+  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));
   strings.SetAt(0, class_name);
   strings.SetAt(1, Symbols::Dot());
   strings.SetAt(2, constructor_name);
-  const String& dot_name = String::Handle(isolate, String::ConcatAll(strings));
+  const String& dot_name = String::Handle(Z, String::ConcatAll(strings));
   const TypeArguments& type_arguments =
-    TypeArguments::Handle(isolate, type_obj.arguments());
+      TypeArguments::Handle(Z, type_obj.arguments());
   const Function& constructor =
-    Function::Handle(isolate, cls.LookupFunctionAllowPrivate(dot_name));
+      Function::Handle(Z, cls.LookupFunctionAllowPrivate(dot_name));
   const int extra_args = 2;
   if (!constructor.IsNull() &&
       constructor.IsGenerativeConstructor() &&
@@ -4083,22 +4054,18 @@
       instance.SetTypeArguments(type_arguments);
     }
     Dart_Handle result;
-    Array& args = Array::Handle(isolate);
-    result = SetupArguments(isolate,
-                            number_of_arguments,
-                            arguments,
-                            extra_args,
-                            &args);
+    Array& args = Array::Handle(Z);
+    result = SetupArguments(T,
+        number_of_arguments, arguments, extra_args, &args);
     if (!::Dart_IsError(result)) {
       args.SetAt(0, instance);
-      args.SetAt(1, Smi::Handle(isolate, Smi::New(Function::kCtorPhaseAll)));
-      const Object& retval = Object::Handle(
-          isolate,
+      args.SetAt(1, Smi::Handle(Z, Smi::New(Function::kCtorPhaseAll)));
+      const Object& retval = Object::Handle(Z,
           DartEntry::InvokeFunction(constructor, args));
       if (retval.IsError()) {
-        result = Api::NewHandle(isolate, retval.raw());
+        result = Api::NewHandle(I, retval.raw());
       } else {
-        result = Api::NewHandle(isolate, instance.raw());
+        result = Api::NewHandle(I, instance.raw());
       }
     }
     return result;
@@ -4113,28 +4080,24 @@
                                     Dart_Handle name,
                                     int number_of_arguments,
                                     Dart_Handle* arguments) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  CHECK_CALLBACK_STATE(isolate);
-  // TODO(turnidge): This is a bit simplistic.  It overcounts when
-  // other operations (gc, compilation) are active.
-  TIMERSCOPE(isolate, time_dart_execution);
+  DARTSCOPE(Thread::Current());
+  CHECK_CALLBACK_STATE(T);
 
-  const String& function_name = Api::UnwrapStringHandle(isolate, name);
+  const String& function_name = Api::UnwrapStringHandle(Z, name);
   if (function_name.IsNull()) {
-    RETURN_TYPE_ERROR(isolate, name, String);
+    RETURN_TYPE_ERROR(Z, name, String);
   }
   if (number_of_arguments < 0) {
     return Api::NewError(
         "%s expects argument 'number_of_arguments' to be non-negative.",
         CURRENT_FUNC);
   }
-  const Object& obj = Object::Handle(isolate, Api::UnwrapHandle(target));
+  const Object& obj = Object::Handle(Z, Api::UnwrapHandle(target));
   if (obj.IsError()) {
     return target;
   }
   Dart_Handle result;
-  Array& args = Array::Handle(isolate);
+  Array& args = Array::Handle(Z);
   if (obj.IsType()) {
     if (!Type::Cast(obj).IsFinalized()) {
       return Api::NewError(
@@ -4142,41 +4105,38 @@
           CURRENT_FUNC);
     }
 
-    const Class& cls = Class::Handle(isolate, Type::Cast(obj).type_class());
-    const Function& function = Function::Handle(
-        isolate,
+    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()));
     if (function.IsNull()) {
-      const String& cls_name = String::Handle(isolate, cls.Name());
+      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(),
                            function_name.ToCString());
     }
     // Setup args and check for malformed arguments in the arguments list.
-    result = SetupArguments(isolate, number_of_arguments, arguments, 0, &args);
+    result = SetupArguments(T, number_of_arguments, arguments, 0, &args);
     if (!::Dart_IsError(result)) {
-      result = Api::NewHandle(isolate,
-                              DartEntry::InvokeFunction(function, args));
+      result = Api::NewHandle(I, DartEntry::InvokeFunction(function, args));
     }
     return result;
   } else if (obj.IsNull() || obj.IsInstance()) {
     // Since we have allocated an object it would mean that the type of the
     // receiver is already resolved and finalized, hence it is not necessary
     // to check here.
-    Instance& instance = Instance::Handle(isolate);
+    Instance& instance = Instance::Handle(Z);
     instance ^= obj.raw();
     ArgumentsDescriptor args_desc(
-        Array::Handle(ArgumentsDescriptor::New(number_of_arguments + 1)));
-    const Function& function = Function::Handle(
-        isolate,
+        Array::Handle(Z, ArgumentsDescriptor::New(number_of_arguments + 1)));
+    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(isolate,
+      result = SetupArguments(T,
                               number_of_arguments,
                               arguments,
                               1,
@@ -4184,8 +4144,8 @@
       if (!::Dart_IsError(result)) {
         args.SetAt(0, instance);
         const Array& args_descriptor =
-          Array::Handle(ArgumentsDescriptor::New(args.Length()));
-        result = Api::NewHandle(isolate,
+          Array::Handle(Z, ArgumentsDescriptor::New(args.Length()));
+        result = Api::NewHandle(I,
                                 DartEntry::InvokeNoSuchMethod(instance,
                                                               function_name,
                                                               args,
@@ -4194,11 +4154,10 @@
       return result;
     }
     // Setup args and check for malformed arguments in the arguments list.
-    result = SetupArguments(isolate, number_of_arguments, arguments, 1, &args);
+    result = SetupArguments(T, number_of_arguments, arguments, 1, &args);
     if (!::Dart_IsError(result)) {
       args.SetAt(0, instance);
-      result = Api::NewHandle(isolate,
-                              DartEntry::InvokeFunction(function, args));
+      result = Api::NewHandle(I, DartEntry::InvokeFunction(function, args));
     }
     return result;
   } else if (obj.IsLibrary()) {
@@ -4213,8 +4172,7 @@
     }
 
     const Function& function =
-        Function::Handle(isolate,
-                         lib.LookupFunctionAllowPrivate(function_name));
+        Function::Handle(Z, lib.LookupFunctionAllowPrivate(function_name));
     if (function.IsNull()) {
       return Api::NewError("%s: did not find top-level function '%s'.",
                            CURRENT_FUNC,
@@ -4222,7 +4180,7 @@
     }
     // LookupFunctionAllowPrivate does not check argument arity, so we
     // do it here.
-    String& error_message = String::Handle();
+    String& error_message = String::Handle(Z);
     if (!function.AreValidArgumentCounts(number_of_arguments,
                                          0,
                                          &error_message)) {
@@ -4232,10 +4190,9 @@
                            error_message.ToCString());
     }
     // Setup args and check for malformed arguments in the arguments list.
-    result = SetupArguments(isolate, number_of_arguments, arguments, 0, &args);
+    result = SetupArguments(T, number_of_arguments, arguments, 0, &args);
     if (!::Dart_IsError(result)) {
-      result = Api::NewHandle(isolate,
-                              DartEntry::InvokeFunction(function, args));
+      result = Api::NewHandle(I, DartEntry::InvokeFunction(function, args));
     }
     return result;
   } else {
@@ -4249,12 +4206,11 @@
 DART_EXPORT Dart_Handle Dart_InvokeClosure(Dart_Handle closure,
                                            int number_of_arguments,
                                            Dart_Handle* arguments) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  CHECK_CALLBACK_STATE(isolate);
-  const Instance& closure_obj = Api::UnwrapInstanceHandle(isolate, closure);
+  DARTSCOPE(Thread::Current());
+  CHECK_CALLBACK_STATE(T);
+  const Instance& closure_obj = Api::UnwrapInstanceHandle(Z, closure);
   if (closure_obj.IsNull() || !closure_obj.IsCallable(NULL)) {
-    RETURN_TYPE_ERROR(isolate, closure, Instance);
+    RETURN_TYPE_ERROR(Z, closure, Instance);
   }
   if (number_of_arguments < 0) {
     return Api::NewError(
@@ -4263,35 +4219,33 @@
   }
 
   // Set up arguments to include the closure as the first argument.
-  const Array& args = Array::Handle(isolate,
-                                    Array::New(number_of_arguments + 1));
-  Object& obj = Object::Handle(isolate);
+  const Array& args = Array::Handle(Z, Array::New(number_of_arguments + 1));
+  Object& obj = Object::Handle(Z);
   args.SetAt(0, closure_obj);
   for (int i = 0; i < number_of_arguments; i++) {
     obj = Api::UnwrapHandle(arguments[i]);
     if (!obj.IsNull() && !obj.IsInstance()) {
-      RETURN_TYPE_ERROR(isolate, arguments[i], Instance);
+      RETURN_TYPE_ERROR(Z, arguments[i], Instance);
     }
     args.SetAt(i + 1, obj);
   }
   // Now try to invoke the closure.
-  return Api::NewHandle(isolate, DartEntry::InvokeClosure(args));
+  return Api::NewHandle(I, DartEntry::InvokeClosure(args));
 }
 
 
 DART_EXPORT Dart_Handle Dart_GetField(Dart_Handle container, Dart_Handle name) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  CHECK_CALLBACK_STATE(isolate);
+  DARTSCOPE(Thread::Current());
+  CHECK_CALLBACK_STATE(T);
 
-  const String& field_name = Api::UnwrapStringHandle(isolate, name);
+  const String& field_name = Api::UnwrapStringHandle(Z, name);
   if (field_name.IsNull()) {
-    RETURN_TYPE_ERROR(isolate, name, String);
+    RETURN_TYPE_ERROR(Z, name, String);
   }
 
-  Field& field = Field::Handle(isolate);
-  Function& getter = Function::Handle(isolate);
-  const Object& obj = Object::Handle(isolate, Api::UnwrapHandle(container));
+  Field& field = Field::Handle(Z);
+  Function& getter = Function::Handle(Z);
+  const Object& obj = Object::Handle(Z, Api::UnwrapHandle(container));
   if (obj.IsNull()) {
     return Api::NewError("%s expects argument 'container' to be non-null.",
                          CURRENT_FUNC);
@@ -4303,21 +4257,21 @@
     }
     // To access a static field we may need to use the Field or the
     // getter Function.
-    Class& cls = Class::Handle(isolate, Type::Cast(obj).type_class());
+    Class& cls = Class::Handle(Z, Type::Cast(obj).type_class());
 
     field = cls.LookupStaticField(field_name);
     if (field.IsNull() || field.IsUninitialized()) {
       const String& getter_name =
-          String::Handle(isolate, Field::GetterName(field_name));
+          String::Handle(Z, Field::GetterName(field_name));
       getter = cls.LookupStaticFunctionAllowPrivate(getter_name);
     }
 
     if (!getter.IsNull()) {
       // Invoke the getter and return the result.
-      return Api::NewHandle(
-          isolate, DartEntry::InvokeFunction(getter, Object::empty_array()));
+      return Api::NewHandle(I,
+          DartEntry::InvokeFunction(getter, Object::empty_array()));
     } else if (!field.IsNull()) {
-      return Api::NewHandle(isolate, field.value());
+      return Api::NewHandle(I, field.StaticValue());
     } else {
       return Api::NewError("%s: did not find static field '%s'.",
                            CURRENT_FUNC, field_name.ToCString());
@@ -4328,9 +4282,8 @@
     // getter in any superclass and use that function to access the
     // field.
     const Instance& instance = Instance::Cast(obj);
-    Class& cls = Class::Handle(isolate, instance.clazz());
-    String& getter_name =
-        String::Handle(isolate, Field::GetterName(field_name));
+    Class& cls = Class::Handle(Z, instance.clazz());
+    String& getter_name = String::Handle(Z, Field::GetterName(field_name));
     while (!cls.IsNull()) {
       getter = cls.LookupDynamicFunctionAllowPrivate(getter_name);
       if (!getter.IsNull()) {
@@ -4341,18 +4294,18 @@
 
     // Invoke the getter and return the result.
     const int kNumArgs = 1;
-    const Array& args = Array::Handle(isolate, Array::New(kNumArgs));
+    const Array& args = Array::Handle(Z, Array::New(kNumArgs));
     args.SetAt(0, instance);
     if (getter.IsNull()) {
       const Array& args_descriptor =
-          Array::Handle(ArgumentsDescriptor::New(args.Length()));
-      return Api::NewHandle(isolate,
+          Array::Handle(Z, ArgumentsDescriptor::New(args.Length()));
+      return Api::NewHandle(I,
                             DartEntry::InvokeNoSuchMethod(instance,
                                                           getter_name,
                                                           args,
                                                           args_descriptor));
     }
-    return Api::NewHandle(isolate, DartEntry::InvokeFunction(getter, args));
+    return Api::NewHandle(I, DartEntry::InvokeFunction(getter, args));
 
   } else if (obj.IsLibrary()) {
     // To access a top-level we may need to use the Field or the
@@ -4369,23 +4322,23 @@
     if (field.IsNull()) {
       // No field found and no ambiguity error.  Check for a getter in the lib.
       const String& getter_name =
-          String::Handle(isolate, Field::GetterName(field_name));
+          String::Handle(Z, Field::GetterName(field_name));
       getter = lib.LookupFunctionAllowPrivate(getter_name);
     } 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(isolate, field.owner());
-      const String& getter_name =
-          String::Handle(isolate, Field::GetterName(field_name));
+      const Class& cls = Class::Handle(Z, field.owner());
+      const String& getter_name = String::Handle(Z,
+          Field::GetterName(field_name));
       getter = cls.LookupStaticFunctionAllowPrivate(getter_name);
     }
 
     if (!getter.IsNull()) {
       // Invoke the getter and return the result.
-      return Api::NewHandle(
-          isolate, DartEntry::InvokeFunction(getter, Object::empty_array()));
+      return Api::NewHandle(I,
+          DartEntry::InvokeFunction(getter, Object::empty_array()));
     }
     if (!field.IsNull()) {
-      return Api::NewHandle(isolate, field.value());
+      return Api::NewHandle(I, field.StaticValue());
     }
     return Api::NewError("%s: did not find top-level variable '%s'.",
                          CURRENT_FUNC, field_name.ToCString());
@@ -4403,26 +4356,25 @@
 DART_EXPORT Dart_Handle Dart_SetField(Dart_Handle container,
                                       Dart_Handle name,
                                       Dart_Handle value) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  CHECK_CALLBACK_STATE(isolate);
+  DARTSCOPE(Thread::Current());
+  CHECK_CALLBACK_STATE(T);
 
-  const String& field_name = Api::UnwrapStringHandle(isolate, name);
+  const String& field_name = Api::UnwrapStringHandle(Z, name);
   if (field_name.IsNull()) {
-    RETURN_TYPE_ERROR(isolate, name, String);
+    RETURN_TYPE_ERROR(Z, name, String);
   }
 
   // Since null is allowed for value, we don't use UnwrapInstanceHandle.
-  const Object& value_obj = Object::Handle(isolate, Api::UnwrapHandle(value));
+  const Object& value_obj = Object::Handle(Z, Api::UnwrapHandle(value));
   if (!value_obj.IsNull() && !value_obj.IsInstance()) {
-    RETURN_TYPE_ERROR(isolate, value, Instance);
+    RETURN_TYPE_ERROR(Z, value, Instance);
   }
-  Instance& value_instance = Instance::Handle(isolate);
+  Instance& value_instance = Instance::Handle(Z);
   value_instance ^= value_obj.raw();
 
-  Field& field = Field::Handle(isolate);
-  Function& setter = Function::Handle(isolate);
-  const Object& obj = Object::Handle(isolate, Api::UnwrapHandle(container));
+  Field& field = Field::Handle(Z);
+  Function& setter = Function::Handle(Z);
+  const Object& obj = Object::Handle(Z, Api::UnwrapHandle(container));
   if (obj.IsNull()) {
     return Api::NewError("%s expects argument 'container' to be non-null.",
                          CURRENT_FUNC);
@@ -4435,24 +4387,23 @@
 
     // To access a static field we may need to use the Field or the
     // setter Function.
-    Class& cls = Class::Handle(isolate, Type::Cast(obj).type_class());
+    Class& cls = Class::Handle(Z, Type::Cast(obj).type_class());
 
     field = cls.LookupStaticField(field_name);
     if (field.IsNull()) {
-      String& setter_name =
-          String::Handle(isolate, Field::SetterName(field_name));
+      String& setter_name = String::Handle(Z, Field::SetterName(field_name));
       setter = cls.LookupStaticFunctionAllowPrivate(setter_name);
     }
 
     if (!setter.IsNull()) {
       // Invoke the setter and return the result.
       const int kNumArgs = 1;
-      const Array& args = Array::Handle(isolate, Array::New(kNumArgs));
+      const Array& args = Array::Handle(Z, Array::New(kNumArgs));
       args.SetAt(0, value_instance);
-      const Object& result =
-          Object::Handle(isolate, DartEntry::InvokeFunction(setter, args));
+      const Object& result = Object::Handle(Z,
+          DartEntry::InvokeFunction(setter, args));
       if (result.IsError()) {
-        return Api::NewHandle(isolate, result.raw());
+        return Api::NewHandle(I, result.raw());
       } else {
         return Api::Success();
       }
@@ -4461,7 +4412,7 @@
         return Api::NewError("%s: cannot set final field '%s'.",
                              CURRENT_FUNC, field_name.ToCString());
       } else {
-        field.set_value(value_instance);
+        field.SetStaticValue(value_instance);
         return Api::Success();
       }
     } else {
@@ -4474,9 +4425,8 @@
     // setter in any superclass and use that function to access the
     // field.
     const Instance& instance = Instance::Cast(obj);
-    Class& cls = Class::Handle(isolate, instance.clazz());
-    String& setter_name =
-        String::Handle(isolate, Field::SetterName(field_name));
+    Class& cls = Class::Handle(Z, instance.clazz());
+    String& setter_name = String::Handle(Z, Field::SetterName(field_name));
     while (!cls.IsNull()) {
       field = cls.LookupInstanceField(field_name);
       if (!field.IsNull() && field.is_final()) {
@@ -4492,19 +4442,18 @@
 
     // Invoke the setter and return the result.
     const int kNumArgs = 2;
-    const Array& args = Array::Handle(isolate, Array::New(kNumArgs));
+    const Array& args = Array::Handle(Z, Array::New(kNumArgs));
     args.SetAt(0, instance);
     args.SetAt(1, value_instance);
     if (setter.IsNull()) {
       const Array& args_descriptor =
-          Array::Handle(ArgumentsDescriptor::New(args.Length()));
-      return Api::NewHandle(isolate,
-                            DartEntry::InvokeNoSuchMethod(instance,
-                                                          setter_name,
-                                                          args,
-                                                          args_descriptor));
+          Array::Handle(Z, ArgumentsDescriptor::New(args.Length()));
+      return Api::NewHandle(I, DartEntry::InvokeNoSuchMethod(instance,
+                                                             setter_name,
+                                                             args,
+                                                             args_descriptor));
     }
-    return Api::NewHandle(isolate, DartEntry::InvokeFunction(setter, args));
+    return Api::NewHandle(I, DartEntry::InvokeFunction(setter, args));
 
   } else if (obj.IsLibrary()) {
     // To access a top-level we may need to use the Field or the
@@ -4520,19 +4469,19 @@
     field = lib.LookupFieldAllowPrivate(field_name);
     if (field.IsNull()) {
       const String& setter_name =
-          String::Handle(isolate, Field::SetterName(field_name));
+          String::Handle(Z, Field::SetterName(field_name));
       setter ^= lib.LookupFunctionAllowPrivate(setter_name);
     }
 
     if (!setter.IsNull()) {
       // Invoke the setter and return the result.
       const int kNumArgs = 1;
-      const Array& args = Array::Handle(isolate, Array::New(kNumArgs));
+      const Array& args = Array::Handle(Z, Array::New(kNumArgs));
       args.SetAt(0, value_instance);
       const Object& result =
-          Object::Handle(isolate, DartEntry::InvokeFunction(setter, args));
+          Object::Handle(Z, DartEntry::InvokeFunction(setter, args));
       if (result.IsError()) {
-        return Api::NewHandle(isolate, result.raw());
+        return Api::NewHandle(I, result.raw());
       }
       return Api::Success();
     }
@@ -4541,7 +4490,7 @@
         return Api::NewError("%s: cannot set final top-level variable '%s'.",
                              CURRENT_FUNC, field_name.ToCString());
       }
-      field.set_value(value_instance);
+      field.SetStaticValue(value_instance);
       return Api::Success();
     }
     return Api::NewError("%s: did not find top-level variable '%s'.",
@@ -4560,13 +4509,14 @@
 
 DART_EXPORT Dart_Handle Dart_ThrowException(Dart_Handle exception) {
   Thread* thread = Thread::Current();
+  Zone* zone = thread->zone();
   Isolate* isolate = thread->isolate();
   CHECK_ISOLATE(isolate);
-  CHECK_CALLBACK_STATE(isolate);
+  CHECK_CALLBACK_STATE(thread);
   {
-    const Instance& excp = Api::UnwrapInstanceHandle(isolate, exception);
+    const Instance& excp = Api::UnwrapInstanceHandle(zone, exception);
     if (excp.IsNull()) {
-      RETURN_TYPE_ERROR(isolate, exception, Instance);
+      RETURN_TYPE_ERROR(zone, exception, Instance);
     }
   }
   if (isolate->top_exit_frame_info() == 0) {
@@ -4583,7 +4533,7 @@
   {
     NoSafepointScope no_safepoint;
     RawInstance* raw_exception =
-        Api::UnwrapInstanceHandle(isolate, exception).raw();
+        Api::UnwrapInstanceHandle(zone, exception).raw();
     state->UnwindScopes(isolate->top_exit_frame_info());
     saved_exception = &Instance::Handle(raw_exception);
   }
@@ -4595,17 +4545,18 @@
 DART_EXPORT Dart_Handle Dart_ReThrowException(Dart_Handle exception,
                                               Dart_Handle stacktrace) {
   Thread* thread = Thread::Current();
+  Zone* zone = thread->zone();
   Isolate* isolate = thread->isolate();
   CHECK_ISOLATE(isolate);
-  CHECK_CALLBACK_STATE(isolate);
+  CHECK_CALLBACK_STATE(thread);
   {
-    const Instance& excp = Api::UnwrapInstanceHandle(isolate, exception);
+    const Instance& excp = Api::UnwrapInstanceHandle(zone, exception);
     if (excp.IsNull()) {
-      RETURN_TYPE_ERROR(isolate, exception, Instance);
+      RETURN_TYPE_ERROR(zone, exception, Instance);
     }
-    const Instance& stk = Api::UnwrapInstanceHandle(isolate, stacktrace);
+    const Instance& stk = Api::UnwrapInstanceHandle(zone, stacktrace);
     if (stk.IsNull()) {
-      RETURN_TYPE_ERROR(isolate, stacktrace, Instance);
+      RETURN_TYPE_ERROR(zone, stacktrace, Instance);
     }
   }
   if (isolate->top_exit_frame_info() == 0) {
@@ -4623,9 +4574,9 @@
   {
     NoSafepointScope no_safepoint;
     RawInstance* raw_exception =
-        Api::UnwrapInstanceHandle(isolate, exception).raw();
+        Api::UnwrapInstanceHandle(zone, exception).raw();
     RawStacktrace* raw_stacktrace =
-        Api::UnwrapStacktraceHandle(isolate, stacktrace).raw();
+        Api::UnwrapStacktraceHandle(zone, stacktrace).raw();
     state->UnwindScopes(isolate->top_exit_frame_info());
     saved_exception = &Instance::Handle(raw_exception);
     saved_stacktrace = &Stacktrace::Handle(raw_stacktrace);
@@ -4640,41 +4591,40 @@
 DART_EXPORT Dart_Handle Dart_CreateNativeWrapperClass(Dart_Handle library,
                                                       Dart_Handle name,
                                                       int field_count) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  const String& cls_name = Api::UnwrapStringHandle(isolate, name);
+  DARTSCOPE(Thread::Current());
+  const String& cls_name = Api::UnwrapStringHandle(Z, name);
   if (cls_name.IsNull()) {
-    RETURN_TYPE_ERROR(isolate, name, String);
+    RETURN_TYPE_ERROR(Z, name, String);
   }
-  const Library& lib = Api::UnwrapLibraryHandle(isolate, library);
+  const Library& lib = Api::UnwrapLibraryHandle(Z, library);
   if (lib.IsNull()) {
-    RETURN_TYPE_ERROR(isolate, library, Library);
+    RETURN_TYPE_ERROR(Z, library, Library);
   }
   if (!Utils::IsUint(16, field_count)) {
     return Api::NewError(
         "Invalid field_count passed to Dart_CreateNativeWrapperClass");
   }
-  CHECK_CALLBACK_STATE(isolate);
+  CHECK_CALLBACK_STATE(T);
 
-  String& cls_symbol = String::Handle(isolate, Symbols::New(cls_name));
-  const Class& cls = Class::Handle(
-      isolate, Class::NewNativeWrapper(lib, cls_symbol, field_count));
+  String& cls_symbol = String::Handle(Z, Symbols::New(cls_name));
+  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");
   }
-  return Api::NewHandle(isolate, cls.RareType());
+  return Api::NewHandle(I, cls.RareType());
 }
 
 
 DART_EXPORT Dart_Handle Dart_GetNativeInstanceFieldCount(Dart_Handle obj,
                                                          int* count) {
-  Isolate* isolate = Isolate::Current();
-  CHECK_ISOLATE(isolate);
-  ReusableObjectHandleScope reused_obj_handle(isolate);
+  Thread* thread = Thread::Current();
+  CHECK_ISOLATE(thread->isolate());
+  ReusableObjectHandleScope reused_obj_handle(thread);
   const Instance& instance = Api::UnwrapInstanceHandle(reused_obj_handle, obj);
   if (instance.IsNull()) {
-    RETURN_TYPE_ERROR(isolate, obj, Instance);
+    RETURN_TYPE_ERROR(thread->zone(), obj, Instance);
   }
   *count = instance.NumNativeFields();
   return Api::Success();
@@ -4684,12 +4634,12 @@
 DART_EXPORT Dart_Handle Dart_GetNativeInstanceField(Dart_Handle obj,
                                                     int index,
                                                     intptr_t* value) {
-  Isolate* isolate = Isolate::Current();
-  CHECK_ISOLATE(isolate);
-  ReusableObjectHandleScope reused_obj_handle(isolate);
+  Thread* thread = Thread::Current();
+  CHECK_ISOLATE(thread->isolate());
+  ReusableObjectHandleScope reused_obj_handle(thread);
   const Instance& instance = Api::UnwrapInstanceHandle(reused_obj_handle, obj);
   if (instance.IsNull()) {
-    RETURN_TYPE_ERROR(isolate, obj, Instance);
+    RETURN_TYPE_ERROR(thread->zone(), obj, Instance);
   }
   if (!instance.IsValidNativeIndex(index)) {
     return Api::NewError(
@@ -4704,11 +4654,10 @@
 DART_EXPORT Dart_Handle Dart_SetNativeInstanceField(Dart_Handle obj,
                                                     int index,
                                                     intptr_t value) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  const Instance& instance = Api::UnwrapInstanceHandle(isolate, obj);
+  DARTSCOPE(Thread::Current());
+  const Instance& instance = Api::UnwrapInstanceHandle(Z, obj);
   if (instance.IsNull()) {
-    RETURN_TYPE_ERROR(isolate, obj, Instance);
+    RETURN_TYPE_ERROR(Z, obj, Instance);
   }
   if (!instance.IsValidNativeIndex(index)) {
     return Api::NewError(
@@ -5019,14 +4968,14 @@
 RawString* Api::CallEnvironmentCallback(Isolate* isolate, const String& name) {
   Scope api_scope(isolate);
   Dart_EnvironmentCallback callback = isolate->environment_callback();
-  String& result = String::Handle(isolate);
+  String& result = String::Handle(isolate->current_zone());
   if (callback != NULL) {
     Dart_Handle response = callback(Api::NewHandle(isolate, name.raw()));
     if (::Dart_IsString(response)) {
       result ^= Api::UnwrapHandle(response);
     } else if (::Dart_IsError(response)) {
       const Object& error =
-          Object::Handle(isolate, Api::UnwrapHandle(response));
+          Object::Handle(isolate->current_zone(), Api::UnwrapHandle(response));
       Exceptions::ThrowArgumentError(
           String::Handle(String::New(Error::Cast(error).ToErrorCString())));
     } else if (!::Dart_IsNull(response)) {
@@ -5074,7 +5023,7 @@
     Api::SetSmiReturnValue(arguments, static_cast<intptr_t>(retval));
   } else {
     // Slow path for Mints and Bigints.
-    ASSERT_CALLBACK_STATE(arguments->thread()->isolate());
+    ASSERT_CALLBACK_STATE(arguments->thread());
     Api::SetIntegerReturnValue(arguments, retval);
   }
 }
@@ -5083,11 +5032,7 @@
 DART_EXPORT void Dart_SetDoubleReturnValue(Dart_NativeArguments args,
                                            double retval) {
   NativeArguments* arguments = reinterpret_cast<NativeArguments*>(args);
-#if defined(DEBUG)
-  Isolate* isolate = arguments->thread()->isolate();
-  ASSERT(isolate == Isolate::Current());
-  ASSERT_CALLBACK_STATE(isolate);
-#endif
+  ASSERT_CALLBACK_STATE(arguments->thread());
   Api::SetDoubleReturnValue(arguments, retval);
 }
 
@@ -5116,14 +5061,15 @@
     lib.SetLoadInProgress();
   }
   ASSERT(isolate != NULL);
-  const Error& error = Error::Handle(isolate, Compiler::Compile(lib, script));
+  const Error& error =
+      Error::Handle(isolate->current_zone(), Compiler::Compile(lib, script));
   if (error.IsNull()) {
     *result = Api::NewHandle(isolate, lib.raw());
   } else {
     *result = Api::NewHandle(isolate, error.raw());
     // Compilation errors are not Dart instances, so just mark the library
     // as having failed to load without providing an error instance.
-    lib.SetLoadError(Instance::Handle());
+    lib.SetLoadError(Object::null_instance());
   }
 }
 
@@ -5132,21 +5078,18 @@
                                         Dart_Handle source,
                                         intptr_t line_offset,
                                         intptr_t column_offset) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  TIMERSCOPE(isolate, time_script_loading);
-  const String& url_str = Api::UnwrapStringHandle(isolate, url);
+  DARTSCOPE(Thread::Current());
+  const String& url_str = Api::UnwrapStringHandle(Z, url);
   if (url_str.IsNull()) {
-    RETURN_TYPE_ERROR(isolate, url, String);
+    RETURN_TYPE_ERROR(Z, url, String);
   }
-  const String& source_str = Api::UnwrapStringHandle(isolate, source);
+  const String& source_str = Api::UnwrapStringHandle(Z, source);
   if (source_str.IsNull()) {
-    RETURN_TYPE_ERROR(isolate, source, String);
+    RETURN_TYPE_ERROR(Z, source, String);
   }
-  Library& library =
-      Library::Handle(isolate, isolate->object_store()->root_library());
+  Library& library = Library::Handle(Z, I->object_store()->root_library());
   if (!library.IsNull()) {
-    const String& library_url = String::Handle(isolate, library.url());
+    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());
   }
@@ -5158,30 +5101,29 @@
     return Api::NewError("%s: argument 'column_offset' must be positive number",
                          CURRENT_FUNC);
   }
-  CHECK_CALLBACK_STATE(isolate);
+  CHECK_CALLBACK_STATE(T);
+  CHECK_COMPILATION_ALLOWED(I);
 
   NoHeapGrowthControlScope no_growth_control;
 
   library = Library::New(url_str);
   library.set_debuggable(true);
   library.Register();
-  isolate->object_store()->set_root_library(library);
+  I->object_store()->set_root_library(library);
 
-  const Script& script = Script::Handle(
-      isolate, Script::New(url_str, source_str, RawScript::kScriptTag));
+  const Script& script = Script::Handle(Z,
+      Script::New(url_str, source_str, RawScript::kScriptTag));
   script.SetLocationOffset(line_offset, column_offset);
   Dart_Handle result;
-  CompileSource(isolate, library, script, &result);
+  CompileSource(I, library, script, &result);
   return result;
 }
 
 
 DART_EXPORT Dart_Handle Dart_LoadScriptFromSnapshot(const uint8_t* buffer,
                                                     intptr_t buffer_len) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  TIMERSCOPE(isolate, time_script_loading);
-  StackZone zone(isolate);
+  DARTSCOPE(Thread::Current());
+  StackZone zone(T);
   if (buffer == NULL) {
     RETURN_NULL_ERROR(buffer);
   }
@@ -5197,28 +5139,25 @@
                          " which is the expected length in the snapshot.",
                          CURRENT_FUNC, buffer_len, snapshot->length());
   }
-  Library& library =
-      Library::Handle(isolate, isolate->object_store()->root_library());
+  Library& library = Library::Handle(Z, I->object_store()->root_library());
   if (!library.IsNull()) {
-    const String& library_url = String::Handle(isolate, library.url());
+    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(isolate);
+  CHECK_CALLBACK_STATE(T);
+  CHECK_COMPILATION_ALLOWED(I);
 
   ASSERT(snapshot->kind() == Snapshot::kScript);
-  ScriptSnapshotReader reader(snapshot->content(),
-                              snapshot->length(),
-                              isolate,
-                              zone.GetZone());
-  const Object& tmp = Object::Handle(isolate, reader.ReadScriptSnapshot());
+  ScriptSnapshotReader reader(snapshot->content(), snapshot->length(), T);
+  const Object& tmp = Object::Handle(Z, reader.ReadScriptSnapshot());
   if (tmp.IsError()) {
-    return Api::NewHandle(isolate, tmp.raw());
+    return Api::NewHandle(I, tmp.raw());
   }
   library ^= tmp.raw();
   library.set_debuggable(true);
-  isolate->object_store()->set_root_library(library);
-  return Api::NewHandle(isolate, library.raw());
+  I->object_store()->set_root_library(library);
+  return Api::NewHandle(I, library.raw());
 }
 
 
@@ -5231,25 +5170,23 @@
 
 DART_EXPORT Dart_Handle Dart_GetClass(Dart_Handle library,
                                       Dart_Handle class_name) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  const Library& lib = Api::UnwrapLibraryHandle(isolate, library);
+  DARTSCOPE(Thread::Current());
+  const Library& lib = Api::UnwrapLibraryHandle(Z, library);
   if (lib.IsNull()) {
-    RETURN_TYPE_ERROR(isolate, library, Library);
+    RETURN_TYPE_ERROR(Z, library, Library);
   }
-  const String& cls_name = Api::UnwrapStringHandle(isolate, class_name);
+  const String& cls_name = Api::UnwrapStringHandle(Z, class_name);
   if (cls_name.IsNull()) {
-    RETURN_TYPE_ERROR(isolate, class_name, String);
+    RETURN_TYPE_ERROR(Z, class_name, String);
   }
-  const Class& cls = Class::Handle(
-      isolate, lib.LookupClassAllowPrivate(cls_name));
+  const Class& cls = Class::Handle(Z, lib.LookupClassAllowPrivate(cls_name));
   if (cls.IsNull()) {
     // TODO(turnidge): Return null or error in this case?
-    const String& lib_name = String::Handle(isolate, lib.name());
+    const String& lib_name = String::Handle(Z, lib.name());
     return Api::NewError("Class '%s' not found in library '%s'.",
                          cls_name.ToCString(), lib_name.ToCString());
   }
-  return Api::NewHandle(isolate, cls.RareType());
+  return Api::NewHandle(I, cls.RareType());
 }
 
 
@@ -5257,27 +5194,25 @@
                                      Dart_Handle class_name,
                                      intptr_t number_of_type_arguments,
                                      Dart_Handle* type_arguments) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
+  DARTSCOPE(Thread::Current());
 
   // Validate the input arguments.
-  const Library& lib = Api::UnwrapLibraryHandle(isolate, library);
+  const Library& lib = Api::UnwrapLibraryHandle(Z, library);
   if (lib.IsNull()) {
-    RETURN_TYPE_ERROR(isolate, library, Library);
+    RETURN_TYPE_ERROR(Z, library, Library);
   }
   if (!lib.Loaded()) {
     return Api::NewError(
         "%s expects library argument 'library' to be loaded.",
         CURRENT_FUNC);
   }
-  const String& name_str = Api::UnwrapStringHandle(isolate, class_name);
+  const String& name_str = Api::UnwrapStringHandle(Z, class_name);
   if (name_str.IsNull()) {
-    RETURN_TYPE_ERROR(isolate, class_name, String);
+    RETURN_TYPE_ERROR(Z, class_name, String);
   }
-  const Class& cls =
-      Class::Handle(isolate, lib.LookupClassAllowPrivate(name_str));
+  const Class& cls = Class::Handle(Z, lib.LookupClassAllowPrivate(name_str));
   if (cls.IsNull()) {
-    const String& lib_name = String::Handle(isolate, lib.name());
+    const String& lib_name = String::Handle(Z, lib.name());
     return Api::NewError("Type '%s' not found in library '%s'.",
                          name_str.ToCString(), lib_name.ToCString());
   }
@@ -5286,7 +5221,7 @@
       return Api::NewError("Invalid number of type arguments specified, "
                            "got %" Pd " expected 0", number_of_type_arguments);
     }
-    return Api::NewHandle(isolate, Type::NewNonParameterizedType(cls));
+    return Api::NewHandle(I, Type::NewNonParameterizedType(cls));
   }
   intptr_t num_expected_type_arguments = cls.NumTypeParameters();
   TypeArguments& type_args_obj = TypeArguments::Handle();
@@ -5300,9 +5235,9 @@
                            number_of_type_arguments,
                            num_expected_type_arguments);
     }
-    const Array& array = Api::UnwrapArrayHandle(isolate, *type_arguments);
+    const Array& array = Api::UnwrapArrayHandle(Z, *type_arguments);
     if (array.IsNull()) {
-      RETURN_TYPE_ERROR(isolate, *type_arguments, Array);
+      RETURN_TYPE_ERROR(Z, *type_arguments, Array);
     }
     if (array.Length() != num_expected_type_arguments) {
       return Api::NewError("Invalid type arguments specified, expected an "
@@ -5324,59 +5259,55 @@
       Type::New(cls, type_args_obj, Scanner::kNoSourcePos));
   instantiated_type ^= ClassFinalizer::FinalizeType(
       cls, instantiated_type, ClassFinalizer::kCanonicalize);
-  return Api::NewHandle(isolate, instantiated_type.raw());
+  return Api::NewHandle(I, instantiated_type.raw());
 }
 
 
 DART_EXPORT Dart_Handle Dart_LibraryUrl(Dart_Handle library) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  const Library& lib = Api::UnwrapLibraryHandle(isolate, library);
+  DARTSCOPE(Thread::Current());
+  const Library& lib = Api::UnwrapLibraryHandle(Z, library);
   if (lib.IsNull()) {
-    RETURN_TYPE_ERROR(isolate, library, Library);
+    RETURN_TYPE_ERROR(Z, library, Library);
   }
-  const String& url = String::Handle(isolate, lib.url());
+  const String& url = String::Handle(Z, lib.url());
   ASSERT(!url.IsNull());
-  return Api::NewHandle(isolate, url.raw());
+  return Api::NewHandle(I, url.raw());
 }
 
 
 DART_EXPORT Dart_Handle Dart_LookupLibrary(Dart_Handle url) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  const String& url_str = Api::UnwrapStringHandle(isolate, url);
+  DARTSCOPE(Thread::Current());
+  const String& url_str = Api::UnwrapStringHandle(Z, url);
   if (url_str.IsNull()) {
-    RETURN_TYPE_ERROR(isolate, url, String);
+    RETURN_TYPE_ERROR(Z, url, String);
   }
-  const Library& library =
-      Library::Handle(isolate, Library::LookupLibrary(url_str));
+  const Library& library = Library::Handle(Z, Library::LookupLibrary(url_str));
   if (library.IsNull()) {
     return Api::NewError("%s: library '%s' not found.",
                          CURRENT_FUNC, url_str.ToCString());
   } else {
-    return Api::NewHandle(isolate, library.raw());
+    return Api::NewHandle(I, library.raw());
   }
 }
 
 
 DART_EXPORT Dart_Handle Dart_LibraryHandleError(Dart_Handle library_in,
                                                 Dart_Handle error_in) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
+  DARTSCOPE(Thread::Current());
 
-  const Library& lib = Api::UnwrapLibraryHandle(isolate, library_in);
+  const Library& lib = Api::UnwrapLibraryHandle(Z, library_in);
   if (lib.IsNull()) {
-    RETURN_TYPE_ERROR(isolate, library_in, Library);
+    RETURN_TYPE_ERROR(Z, library_in, Library);
   }
-  const Instance& err = Api::UnwrapInstanceHandle(isolate, error_in);
+  const Instance& err = Api::UnwrapInstanceHandle(Z, error_in);
   if (err.IsNull()) {
-    RETURN_TYPE_ERROR(isolate, error_in, Instance);
+    RETURN_TYPE_ERROR(Z, error_in, Instance);
   }
-  CHECK_CALLBACK_STATE(isolate);
+  CHECK_CALLBACK_STATE(T);
 
   const GrowableObjectArray& pending_deferred_loads =
-      GrowableObjectArray::Handle(
-          isolate->object_store()->pending_deferred_loads());
+      GrowableObjectArray::Handle(Z,
+          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);
@@ -5391,16 +5322,14 @@
                                          Dart_Handle source,
                                          intptr_t line_offset,
                                          intptr_t column_offset) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  TIMERSCOPE(isolate, time_script_loading);
-  const String& url_str = Api::UnwrapStringHandle(isolate, url);
+  DARTSCOPE(Thread::Current());
+  const String& url_str = Api::UnwrapStringHandle(Z, url);
   if (url_str.IsNull()) {
-    RETURN_TYPE_ERROR(isolate, url, String);
+    RETURN_TYPE_ERROR(Z, url, String);
   }
-  const String& source_str = Api::UnwrapStringHandle(isolate, source);
+  const String& source_str = Api::UnwrapStringHandle(Z, source);
   if (source_str.IsNull()) {
-    RETURN_TYPE_ERROR(isolate, source, String);
+    RETURN_TYPE_ERROR(Z, source, String);
   }
   if (line_offset < 0) {
     return Api::NewError("%s: argument 'line_offset' must be positive number",
@@ -5410,11 +5339,12 @@
     return Api::NewError("%s: argument 'column_offset' must be positive number",
                          CURRENT_FUNC);
   }
-  CHECK_CALLBACK_STATE(isolate);
+  CHECK_CALLBACK_STATE(T);
+  CHECK_COMPILATION_ALLOWED(I);
 
   NoHeapGrowthControlScope no_growth_control;
 
-  Library& library = Library::Handle(isolate, Library::LookupLibrary(url_str));
+  Library& library = Library::Handle(Z, Library::LookupLibrary(url_str));
   if (library.IsNull()) {
     library = Library::New(url_str);
     library.Register();
@@ -5426,11 +5356,11 @@
     return Api::NewError("%s: library '%s' has already been loaded.",
                          CURRENT_FUNC, url_str.ToCString());
   }
-  const Script& script = Script::Handle(
-      isolate, Script::New(url_str, source_str, RawScript::kLibraryTag));
+  const Script& script = Script::Handle(Z,
+      Script::New(url_str, source_str, RawScript::kLibraryTag));
   script.SetLocationOffset(line_offset, column_offset);
   Dart_Handle result;
-  CompileSource(isolate, library, script, &result);
+  CompileSource(I, library, script, &result);
   // Propagate the error out right now.
   if (::Dart_IsError(result)) {
     return result;
@@ -5438,8 +5368,8 @@
 
   // If this is the dart:_builtin library, register it with the VM.
   if (url_str.Equals("dart:_builtin")) {
-    isolate->object_store()->set_builtin_library(library);
-    Dart_Handle state = Api::CheckAndFinalizePendingClasses(isolate);
+    I->object_store()->set_builtin_library(library);
+    Dart_Handle state = Api::CheckAndFinalizePendingClasses(I);
     if (::Dart_IsError(state)) {
       return state;
     }
@@ -5451,29 +5381,27 @@
 DART_EXPORT Dart_Handle Dart_LibraryImportLibrary(Dart_Handle library,
                                                   Dart_Handle import,
                                                   Dart_Handle prefix) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  const Library& library_vm = Api::UnwrapLibraryHandle(isolate, library);
+  DARTSCOPE(Thread::Current());
+  const Library& library_vm = Api::UnwrapLibraryHandle(Z, library);
   if (library_vm.IsNull()) {
-    RETURN_TYPE_ERROR(isolate, library, Library);
+    RETURN_TYPE_ERROR(Z, library, Library);
   }
-  const Library& import_vm = Api::UnwrapLibraryHandle(isolate, import);
+  const Library& import_vm = Api::UnwrapLibraryHandle(Z, import);
   if (import_vm.IsNull()) {
-    RETURN_TYPE_ERROR(isolate, import, Library);
+    RETURN_TYPE_ERROR(Z, import, Library);
   }
-  const Object& prefix_object =
-      Object::Handle(isolate, Api::UnwrapHandle(prefix));
+  const Object& prefix_object = Object::Handle(Z, Api::UnwrapHandle(prefix));
   const String& prefix_vm = prefix_object.IsNull()
       ? Symbols::Empty()
       : String::Cast(prefix_object);
   if (prefix_vm.IsNull()) {
-    RETURN_TYPE_ERROR(isolate, prefix, String);
+    RETURN_TYPE_ERROR(Z, prefix, String);
   }
-  CHECK_CALLBACK_STATE(isolate);
+  CHECK_CALLBACK_STATE(T);
+  CHECK_COMPILATION_ALLOWED(I);
 
-  const String& prefix_symbol =
-      String::Handle(isolate, Symbols::New(prefix_vm));
-  const Namespace& import_ns = Namespace::Handle(
+  const String& prefix_symbol = String::Handle(Z, Symbols::New(prefix_vm));
+  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);
@@ -5497,20 +5425,18 @@
                                         Dart_Handle source,
                                         intptr_t line_offset,
                                         intptr_t column_offset) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  TIMERSCOPE(isolate, time_script_loading);
-  const Library& lib = Api::UnwrapLibraryHandle(isolate, library);
+  DARTSCOPE(Thread::Current());
+  const Library& lib = Api::UnwrapLibraryHandle(Z, library);
   if (lib.IsNull()) {
-    RETURN_TYPE_ERROR(isolate, library, Library);
+    RETURN_TYPE_ERROR(Z, library, Library);
   }
-  const String& url_str = Api::UnwrapStringHandle(isolate, url);
+  const String& url_str = Api::UnwrapStringHandle(Z, url);
   if (url_str.IsNull()) {
-    RETURN_TYPE_ERROR(isolate, url, String);
+    RETURN_TYPE_ERROR(Z, url, String);
   }
-  const String& source_str = Api::UnwrapStringHandle(isolate, source);
+  const String& source_str = Api::UnwrapStringHandle(Z, source);
   if (source_str.IsNull()) {
-    RETURN_TYPE_ERROR(isolate, source, String);
+    RETURN_TYPE_ERROR(Z, source, String);
   }
   if (line_offset < 0) {
     return Api::NewError("%s: argument 'line_offset' must be positive number",
@@ -5520,15 +5446,16 @@
     return Api::NewError("%s: argument 'column_offset' must be positive number",
                          CURRENT_FUNC);
   }
-  CHECK_CALLBACK_STATE(isolate);
+  CHECK_CALLBACK_STATE(T);
+  CHECK_COMPILATION_ALLOWED(I);
 
   NoHeapGrowthControlScope no_growth_control;
 
-  const Script& script = Script::Handle(
-      isolate, Script::New(url_str, source_str, RawScript::kSourceTag));
+  const Script& script = Script::Handle(Z,
+      Script::New(url_str, source_str, RawScript::kSourceTag));
   script.SetLocationOffset(line_offset, column_offset);
   Dart_Handle result;
-  CompileSource(isolate, lib, script, &result);
+  CompileSource(I, lib, script, &result);
   return result;
 }
 
@@ -5536,29 +5463,28 @@
 DART_EXPORT Dart_Handle Dart_LibraryLoadPatch(Dart_Handle library,
                                               Dart_Handle url,
                                               Dart_Handle patch_source) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  TIMERSCOPE(isolate, time_script_loading);
-  const Library& lib = Api::UnwrapLibraryHandle(isolate, library);
+  DARTSCOPE(Thread::Current());
+  const Library& lib = Api::UnwrapLibraryHandle(Z, library);
   if (lib.IsNull()) {
-    RETURN_TYPE_ERROR(isolate, library, Library);
+    RETURN_TYPE_ERROR(Z, library, Library);
   }
-  const String& url_str = Api::UnwrapStringHandle(isolate, url);
+  const String& url_str = Api::UnwrapStringHandle(Z, url);
   if (url_str.IsNull()) {
-    RETURN_TYPE_ERROR(isolate, url, String);
+    RETURN_TYPE_ERROR(Z, url, String);
   }
-  const String& source_str = Api::UnwrapStringHandle(isolate, patch_source);
+  const String& source_str = Api::UnwrapStringHandle(Z, patch_source);
   if (source_str.IsNull()) {
-    RETURN_TYPE_ERROR(isolate, patch_source, String);
+    RETURN_TYPE_ERROR(Z, patch_source, String);
   }
-  CHECK_CALLBACK_STATE(isolate);
+  CHECK_CALLBACK_STATE(T);
+  CHECK_COMPILATION_ALLOWED(I);
 
   NoHeapGrowthControlScope no_growth_control;
 
-  const Script& script = Script::Handle(
-      isolate, Script::New(url_str, source_str, RawScript::kPatchTag));
+  const Script& script = Script::Handle(Z,
+      Script::New(url_str, source_str, RawScript::kPatchTag));
   Dart_Handle result;
-  CompileSource(isolate, lib, script, &result);
+  CompileSource(I, lib, script, &result);
   return result;
 }
 
@@ -5566,17 +5492,16 @@
 // Finalizes classes and invokes Dart core library function that completes
 // futures of loadLibrary calls (deferred library loading).
 DART_EXPORT Dart_Handle Dart_FinalizeLoading(bool complete_futures) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  CHECK_CALLBACK_STATE(isolate);
+  DARTSCOPE(Thread::Current());
+  CHECK_CALLBACK_STATE(T);
 
-  isolate->DoneLoading();
+  I->DoneLoading();
 
   // TODO(hausner): move the remaining code below (finalization and
   // invoing of _completeDeferredLoads) into Isolate::DoneLoading().
 
   // Finalize all classes if needed.
-  Dart_Handle state = Api::CheckAndFinalizePendingClasses(isolate);
+  Dart_Handle state = Api::CheckAndFinalizePendingClasses(I);
   if (::Dart_IsError(state)) {
     return state;
   }
@@ -5586,31 +5511,29 @@
   // the new code, the debugger convert them to unresolved source breakpoints.
   // The code that completes the futures (invoked below) may call into the
   // newly loaded code and trigger one of these breakpoints.
-  isolate->debugger()->NotifyDoneLoading();
+  I->debugger()->NotifyDoneLoading();
 
   // Notify mirrors that MirrorSystem.libraries needs to be recomputed.
-  const Library& libmirrors =
-      Library::Handle(isolate, Library::MirrorsLibrary());
-  const Field& dirty_bit = Field::Handle(isolate,
+  const Library& libmirrors = Library::Handle(Z, Library::MirrorsLibrary());
+  const Field& dirty_bit = Field::Handle(Z,
       libmirrors.LookupLocalField(String::Handle(String::New("dirty"))));
   ASSERT(!dirty_bit.IsNull() && dirty_bit.is_static());
-  dirty_bit.set_value(Bool::True());
+  dirty_bit.SetStaticValue(Bool::True());
 
   if (complete_futures) {
-    const Library& corelib = Library::Handle(isolate, Library::CoreLibrary());
+    const Library& corelib = Library::Handle(Z, Library::CoreLibrary());
     const String& function_name =
-        String::Handle(isolate, String::New("_completeDeferredLoads"));
-    const Function& function =
-        Function::Handle(isolate,
-                         corelib.LookupFunctionAllowPrivate(function_name));
+        String::Handle(Z, String::New("_completeDeferredLoads"));
+    const Function& function = Function::Handle(Z,
+        corelib.LookupFunctionAllowPrivate(function_name));
     ASSERT(!function.IsNull());
     const Array& args = Array::empty_array();
 
     const Object& res =
-        Object::Handle(isolate, DartEntry::InvokeFunction(function, args));
-    isolate->object_store()->clear_pending_deferred_loads();
+        Object::Handle(Z, DartEntry::InvokeFunction(function, args));
+    I->object_store()->clear_pending_deferred_loads();
     if (res.IsError() || res.IsUnhandledException()) {
-      return Api::NewHandle(isolate, res.raw());
+      return Api::NewHandle(I, res.raw());
     }
   }
   return Api::Success();
@@ -5621,11 +5544,10 @@
     Dart_Handle library,
     Dart_NativeEntryResolver resolver,
     Dart_NativeEntrySymbol symbol) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  const Library& lib = Api::UnwrapLibraryHandle(isolate, library);
+  DARTSCOPE(Thread::Current());
+  const Library& lib = Api::UnwrapLibraryHandle(Z, library);
   if (lib.IsNull()) {
-    RETURN_TYPE_ERROR(isolate, library, Library);
+    RETURN_TYPE_ERROR(Z, library, Library);
   }
   lib.set_native_entry_resolver(resolver);
   lib.set_native_entry_symbol_resolver(symbol);
@@ -5639,10 +5561,10 @@
   if (peer == NULL) {
     RETURN_NULL_ERROR(peer);
   }
-  Isolate* isolate = Isolate::Current();
-  CHECK_ISOLATE(isolate);
-  REUSABLE_OBJECT_HANDLESCOPE(isolate);
-  Object& obj = isolate->ObjectHandle();
+  Thread* thread = Thread::Current();
+  CHECK_ISOLATE(thread->isolate());
+  REUSABLE_OBJECT_HANDLESCOPE(thread);
+  Object& obj = thread->ObjectHandle();
   obj = Api::UnwrapHandle(object);
   if (obj.IsNull() || obj.IsNumber() || obj.IsBool()) {
     const char* msg =
@@ -5652,17 +5574,17 @@
   {
     NoSafepointScope no_safepoint;
     RawObject* raw_obj = obj.raw();
-    *peer = isolate->heap()->GetPeer(raw_obj);
+    *peer = thread->isolate()->heap()->GetPeer(raw_obj);
   }
   return Api::Success();
 }
 
 
 DART_EXPORT Dart_Handle Dart_SetPeer(Dart_Handle object, void* peer) {
-  Isolate* isolate = Isolate::Current();
-  CHECK_ISOLATE(isolate);
-  REUSABLE_OBJECT_HANDLESCOPE(isolate);
-  Object& obj = isolate->ObjectHandle();
+  Thread* thread = Thread::Current();
+  CHECK_ISOLATE(thread->isolate());
+  REUSABLE_OBJECT_HANDLESCOPE(thread);
+  Object& obj = thread->ObjectHandle();
   obj = Api::UnwrapHandle(object);
   if (obj.IsNull() || obj.IsNumber() || obj.IsBool()) {
     const char* msg =
@@ -5672,7 +5594,7 @@
   {
     NoSafepointScope no_safepoint;
     RawObject* raw_obj = obj.raw();
-    isolate->heap()->SetPeer(raw_obj, peer);
+    thread->isolate()->heap()->SetPeer(raw_obj, peer);
   }
   return Api::Success();
 }
@@ -5747,8 +5669,7 @@
                                                   const char* event_kind,
                                                   const uint8_t* bytes,
                                                   intptr_t bytes_length) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
+  DARTSCOPE(Thread::Current());
   if (stream_id == NULL) {
     RETURN_NULL_ERROR(stream_id);
   }
@@ -5762,12 +5683,247 @@
     return Api::NewError("%s expects argument 'bytes_length' to be >= 0.",
                          CURRENT_FUNC);
   }
-  Service::SendEmbedderEvent(isolate, stream_id, event_kind,
+  Service::SendEmbedderEvent(I, stream_id, event_kind,
                              bytes, bytes_length);
   return Api::Success();
 }
 
 
+DART_EXPORT int64_t Dart_TimelineGetMicros() {
+  return OS::GetCurrentTraceMicros();
+}
+
+
+DART_EXPORT void Dart_TimelineSetRecordedStreams(int64_t stream_mask) {
+  Isolate* isolate = Isolate::Current();
+  CHECK_ISOLATE(isolate);
+  isolate->GetAPIStream()->set_enabled(
+      (stream_mask & DART_TIMELINE_STREAM_API) != 0);
+  isolate->GetCompilerStream()->set_enabled(
+      (stream_mask & DART_TIMELINE_STREAM_COMPILER) != 0);
+  isolate->GetDartStream()->set_enabled(
+      (stream_mask & DART_TIMELINE_STREAM_DART) != 0);
+  isolate->GetEmbedderStream()->set_enabled(
+      (stream_mask & DART_TIMELINE_STREAM_EMBEDDER) != 0);
+  isolate->GetGCStream()->set_enabled(
+      (stream_mask & DART_TIMELINE_STREAM_GC) != 0);
+  isolate->GetIsolateStream()->set_enabled(
+      (stream_mask & DART_TIMELINE_STREAM_ISOLATE) != 0);
+}
+
+
+DART_EXPORT void Dart_GlobalTimelineSetRecordedStreams(int64_t stream_mask) {
+  // Per isolate overrides.
+  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 embedder_enabled =
+      (stream_mask & DART_TIMELINE_STREAM_EMBEDDER) != 0;
+  const bool gc_enabled = (stream_mask & DART_TIMELINE_STREAM_GC) != 0;
+  const bool isolate_enabled =
+      (stream_mask & DART_TIMELINE_STREAM_ISOLATE) != 0;
+  Timeline::SetStreamAPIEnabled(api_enabled);
+  Timeline::SetStreamCompilerEnabled(compiler_enabled);
+  Timeline::SetStreamDartEnabled(dart_enabled);
+  Timeline::SetStreamEmbedderEnabled(embedder_enabled);
+  Timeline::SetStreamGCEnabled(gc_enabled);
+  Timeline::SetStreamIsolateEnabled(isolate_enabled);
+  // VM wide.
+  const bool vm_enabled =
+      (stream_mask & DART_TIMELINE_STREAM_VM) != 0;
+  Timeline::GetVMStream()->set_enabled(vm_enabled);
+}
+
+
+// '[' + ']' + '\0'.
+#define MINIMUM_OUTPUT_LENGTH 3
+
+// Trims the '[' and ']' characters and, depending on whether or not more events
+// will follow, adjusts the last character of the string to either a '\0' or
+// ','.
+static char* TrimOutput(char* output,
+                        intptr_t* output_length,
+                        bool events_will_follow) {
+  ASSERT(output != NULL);
+  ASSERT(output_length != NULL);
+  ASSERT(*output_length > MINIMUM_OUTPUT_LENGTH);
+  // We expect the first character to be the opening of an array.
+  ASSERT(output[0] == '[');
+  // We expect the last character to be the closing of an array.
+  ASSERT(output[*output_length - 2] == ']');
+  if (events_will_follow) {
+    // Replace array closing character (']') with ','.
+    output[*output_length - 2] = ',';
+  } else {
+    // Replace array closing character (']') with '\0'.
+    output[*output_length - 2] = '\0';
+  }
+  // Skip the array opening character ('[').
+  *output_length -= 2;
+  return &output[1];
+}
+
+
+static void StartStreamToConsumer(Dart_StreamConsumer consumer,
+                                  void* user_data,
+                                  const char* stream_name) {
+  // Start stream.
+  consumer(Dart_StreamConsumer_kStart,
+           stream_name,
+           NULL,
+           0,
+           user_data);
+}
+
+
+static void FinishStreamToConsumer(Dart_StreamConsumer consumer,
+                                   void* user_data,
+                                   const char* stream_name) {
+  // Finish stream.
+  consumer(Dart_StreamConsumer_kFinish,
+           stream_name,
+           NULL,
+           0,
+           user_data);
+}
+
+
+static void DataStreamToConsumer(Dart_StreamConsumer consumer,
+                                 void* user_data,
+                                 const char* output,
+                                 intptr_t output_length,
+                                 const char* stream_name) {
+  if (output == NULL) {
+    return;
+  }
+  const intptr_t kDataSize = 64 * KB;
+  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,
+             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,
+             user_data);
+    cursor += remaining;
+    remaining -= remaining;
+  }
+  ASSERT(cursor == output_length);
+  ASSERT(remaining == 0);
+}
+
+
+static bool StreamTraceEvents(Dart_StreamConsumer consumer,
+                              void* user_data,
+                              JSONStream* js,
+                              const char* dart_events) {
+  ASSERT(js != NULL);
+  // Steal output from JSONStream.
+  char* output = NULL;
+  intptr_t output_length = 0;
+  js->Steal(const_cast<const char**>(&output), &output_length);
+
+  const bool output_vm = output_length > MINIMUM_OUTPUT_LENGTH;
+  const bool output_dart = dart_events != NULL;
+
+  if (!output_vm && !output_dart) {
+    // We stole the JSONStream's output buffer, free it.
+    free(output);
+    // Nothing will be emitted.
+    return false;
+  }
+
+  // Start the stream.
+  StartStreamToConsumer(consumer, user_data, "timeline");
+
+  // Send events from the VM.
+  if (output_vm) {
+    // Add one for the '\0' character.
+    output_length++;
+    char* trimmed_output = TrimOutput(output, &output_length, output_dart);
+    DataStreamToConsumer(consumer, user_data,
+                         trimmed_output, output_length, "timeline");
+  }
+  // We stole the JSONStream's output buffer, free it.
+  free(output);
+
+  // Send events from dart.
+  if (output_dart) {
+    const intptr_t dart_events_len = strlen(dart_events) + 1;  // +1 for '\0'.
+    DataStreamToConsumer(consumer, user_data,
+                         dart_events, dart_events_len, "timeline");
+  }
+
+  // Finish the stream.
+  FinishStreamToConsumer(consumer, user_data, "timeline");
+  return true;
+}
+
+
+DART_EXPORT bool Dart_TimelineGetTrace(Dart_StreamConsumer consumer,
+                                       void* user_data) {
+  Isolate* isolate = Isolate::Current();
+  CHECK_ISOLATE(isolate);
+  if (consumer == NULL) {
+    return false;
+  }
+  TimelineEventRecorder* timeline_recorder = Timeline::recorder();
+  if (timeline_recorder == NULL) {
+    // Nothing has been recorded.
+    return false;
+  }
+  Thread* T = Thread::Current();
+  StackZone zone(T);
+  // Reclaim all blocks cached by isolate.
+  Timeline::ReclaimIsolateBlocks();
+  JSONStream js;
+  IsolateTimelineEventFilter filter(isolate);
+  timeline_recorder->PrintTraceEvent(&js, &filter);
+  const char* dart_events =
+      DartTimelineEventIterator::PrintTraceEvents(timeline_recorder,
+                                                  zone.GetZone(),
+                                                  isolate);
+  return StreamTraceEvents(consumer, user_data, &js, dart_events);
+}
+
+
+DART_EXPORT bool Dart_GlobalTimelineGetTrace(Dart_StreamConsumer consumer,
+                                             void* user_data) {
+  if (consumer == NULL) {
+    return false;
+  }
+  TimelineEventRecorder* timeline_recorder = Timeline::recorder();
+  if (timeline_recorder == NULL) {
+    // Nothing has been recorded.
+    return false;
+  }
+  Thread* T = Thread::Current();
+  StackZone zone(T);
+  // Reclaim all blocks cached in the system.
+  Timeline::ReclaimAllBlocks();
+  JSONStream js;
+  TimelineEventFilter filter;
+  timeline_recorder->PrintTraceEvent(&js, &filter);
+  const char* dart_events =
+      DartTimelineEventIterator::PrintTraceEvents(timeline_recorder,
+                                                  zone.GetZone(),
+                                                  NULL);
+  return StreamTraceEvents(consumer, user_data, &js, dart_events);
+}
+
+
 DART_EXPORT Dart_Handle Dart_TimelineDuration(const char* label,
                                               int64_t start_micros,
                                               int64_t end_micros) {
@@ -5823,7 +5979,10 @@
   ASSERT(stream != NULL);
   TimelineEvent* event = stream->StartEvent();
   if (event != NULL) {
-    *async_id = event->AsyncBegin(label);
+    TimelineEventRecorder* recorder = Timeline::recorder();
+    ASSERT(recorder != NULL);
+    *async_id = recorder->GetNextAsyncId();
+    event->AsyncBegin(label, *async_id);
     event->Complete();
   }
   return Api::Success();
@@ -5871,4 +6030,68 @@
   return Api::Success();
 }
 
+
+DART_EXPORT Dart_Handle Dart_Precompile(
+    Dart_QualifiedFunctionName entry_points[],
+    bool reset_fields) {
+  DARTSCOPE(Thread::Current());
+  Dart_Handle result = Api::CheckAndFinalizePendingClasses(I);
+  if (::Dart_IsError(result)) {
+    return result;
+  }
+  CHECK_CALLBACK_STATE(T);
+  const Error& error = Error::Handle(Precompiler::CompileAll(entry_points,
+                                                             reset_fields));
+  if (!error.IsNull()) {
+    return Api::NewHandle(I, error.raw());
+  }
+  return Api::Success();
+}
+
+
+DART_EXPORT Dart_Handle Dart_CreatePrecompiledSnapshot(
+    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_snapshot_buffer,
+    intptr_t* instructions_snapshot_size) {
+  ASSERT(FLAG_load_deferred_eagerly);
+  DARTSCOPE(Thread::Current());
+  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 (instructions_snapshot_buffer == NULL) {
+    RETURN_NULL_ERROR(instructions_snapshot_buffer);
+  }
+  if (instructions_snapshot_size == NULL) {
+    RETURN_NULL_ERROR(instructions_snapshot_size);
+  }
+  // Finalize all classes if needed.
+  Dart_Handle state = Api::CheckAndFinalizePendingClasses(I);
+  if (::Dart_IsError(state)) {
+    return state;
+  }
+  I->heap()->CollectAllGarbage();
+  PrecompiledSnapshotWriter writer(vm_isolate_snapshot_buffer,
+                                   isolate_snapshot_buffer,
+                                   instructions_snapshot_buffer,
+                                   ApiReallocate);
+  writer.WriteFullSnapshot();
+  *vm_isolate_snapshot_size = writer.VmIsolateSnapshotSize();
+  *isolate_snapshot_size = writer.IsolateSnapshotSize();
+  *instructions_snapshot_size = writer.InstructionsSnapshotSize();
+
+  return Api::Success();
+}
+
 }  // namespace dart
diff --git a/runtime/vm/dart_api_impl.h b/runtime/vm/dart_api_impl.h
index 46f85aa..613778a 100644
--- a/runtime/vm/dart_api_impl.h
+++ b/runtime/vm/dart_api_impl.h
@@ -68,16 +68,17 @@
     }                                                                          \
   } while (0)
 
-#define DARTSCOPE(isolate)                                                     \
-  Isolate* __temp_isolate__ = (isolate);                                       \
-  CHECK_ISOLATE_SCOPE(__temp_isolate__);                                       \
-  HANDLESCOPE(__temp_isolate__);
+#define DARTSCOPE(thread)                                                      \
+  Thread* T = (thread);                                                        \
+  Isolate* I = T->isolate();                                                   \
+  CHECK_ISOLATE_SCOPE(I);                                                      \
+  HANDLESCOPE(T);
 
 
-#define RETURN_TYPE_ERROR(isolate, dart_handle, type)                          \
+#define RETURN_TYPE_ERROR(zone, dart_handle, type)                             \
   do {                                                                         \
     const Object& tmp =                                                        \
-        Object::Handle(isolate, Api::UnwrapHandle((dart_handle)));             \
+        Object::Handle(zone, Api::UnwrapHandle((dart_handle)));                \
     if (tmp.IsNull()) {                                                        \
       return Api::NewError("%s expects argument '%s' to be non-null.",         \
                            CURRENT_FUNC, #dart_handle);                        \
@@ -131,7 +132,7 @@
   // 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(Isolate* isolate,                    \
+  static const Type& Unwrap##Type##Handle(Zone* zone,                          \
                                           Dart_Handle object);
   CLASS_LIST_FOR_HANDLES(DECLARE_UNWRAP)
 #undef DECLARE_UNWRAP
@@ -303,20 +304,27 @@
 };
 
 // Start a scope in which no Dart API call backs are allowed.
-#define START_NO_CALLBACK_SCOPE(isolate)                                       \
-  isolate->IncrementNoCallbackScopeDepth()
+#define START_NO_CALLBACK_SCOPE(thread)                                        \
+  thread->IncrementNoCallbackScopeDepth()
 
 // End a no Dart API call backs Scope.
-#define END_NO_CALLBACK_SCOPE(isolate)                                         \
-  isolate->DecrementNoCallbackScopeDepth()
+#define END_NO_CALLBACK_SCOPE(thread)                                          \
+  thread->DecrementNoCallbackScopeDepth()
 
-#define CHECK_CALLBACK_STATE(isolate)                                          \
-  if (isolate->no_callback_scope_depth() != 0) {                               \
-    return reinterpret_cast<Dart_Handle>(Api::AcquiredError(isolate));         \
+#define CHECK_CALLBACK_STATE(thread)                                           \
+  if (thread->no_callback_scope_depth() != 0) {                                \
+    return reinterpret_cast<Dart_Handle>(                                      \
+        Api::AcquiredError(thread->isolate()));                                \
   }                                                                            \
 
-#define ASSERT_CALLBACK_STATE(isolate)                                         \
-  ASSERT(isolate->no_callback_scope_depth() == 0)
+#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)                                         \
+  ASSERT(thread->no_callback_scope_depth() == 0)
 
 }  // namespace dart.
 
diff --git a/runtime/vm/dart_api_impl_test.cc b/runtime/vm/dart_api_impl_test.cc
index 46653c8..6a53ff7 100644
--- a/runtime/vm/dart_api_impl_test.cc
+++ b/runtime/vm/dart_api_impl_test.cc
@@ -21,6 +21,7 @@
 
 DECLARE_FLAG(int, optimization_counter_threshold);
 DECLARE_FLAG(bool, verify_acquired_data);
+DECLARE_FLAG(bool, ignore_patch_signature_mismatch);
 
 TEST_CASE(ErrorHandleBasics) {
   const char* kScriptChars =
@@ -616,8 +617,7 @@
 
   // Non-instance objects.
   {
-    Isolate* isolate = Isolate::Current();
-    DARTSCOPE(isolate);
+    DARTSCOPE(Thread::Current());
     Dart_Handle lib1 = Dart_LookupLibrary(dart_core);
     Dart_Handle lib2 = Dart_LookupLibrary(dart_mirrors);
 
@@ -662,8 +662,7 @@
 
   // Non-instance objects.
   {
-    Isolate* isolate = Isolate::Current();
-    DARTSCOPE(isolate);
+    DARTSCOPE(Thread::Current());
     Dart_Handle lib1 = Dart_LookupLibrary(dart_core);
     Dart_Handle lib2 = Dart_LookupLibrary(dart_mirrors);
 
@@ -708,19 +707,19 @@
 
 
 TEST_CASE(InstanceGetType) {
-  Isolate* isolate = Isolate::Current();
+  Zone* zone = thread->zone();
   // Get the handle from a valid instance handle.
   Dart_Handle type = Dart_InstanceGetType(Dart_Null());
   EXPECT_VALID(type);
   EXPECT(Dart_IsType(type));
-  const Type& null_type_obj = Api::UnwrapTypeHandle(isolate, type);
+  const Type& null_type_obj = Api::UnwrapTypeHandle(zone, type);
   EXPECT(null_type_obj.raw() == Type::NullType());
 
   Dart_Handle instance = Dart_True();
   type = Dart_InstanceGetType(instance);
   EXPECT_VALID(type);
   EXPECT(Dart_IsType(type));
-  const Type& bool_type_obj = Api::UnwrapTypeHandle(isolate, type);
+  const Type& bool_type_obj = Api::UnwrapTypeHandle(zone, type);
   EXPECT(bool_type_obj.raw() == Type::BoolType());
 
   Dart_Handle cls_name = Dart_TypeName(type);
@@ -1109,13 +1108,22 @@
 
 
 TEST_CASE(MalformedStringToUTF8) {
+  // 1D11E = treble clef
+  // [0] should be high surrogate D834
+  // [1] should be low surrogate DD1E
+  // Strings are allowed to have individual or out of order surrogates, even
+  // if that doesn't make sense as renderable characters.
   const char* kScriptChars =
-      "String testMain() {"
+      "String lowSurrogate() {"
       "  return '\\u{1D11E}'[1];"
-      "}";
+      "}"
+      "String highSurrogate() {"
+      "  return '\\u{1D11E}'[0];"
+      "}"
+      "String reversed() => lowSurrogate() + highSurrogate();";
 
   Dart_Handle lib = TestCase::LoadTestScript(kScriptChars, NULL);
-  Dart_Handle str1 = Dart_Invoke(lib, NewString("testMain"), 0, NULL);
+  Dart_Handle str1 = Dart_Invoke(lib, NewString("lowSurrogate"), 0, NULL);
   EXPECT_VALID(str1);
 
   uint8_t* utf8_encoded = NULL;
@@ -1128,7 +1136,20 @@
   EXPECT_EQ(158, static_cast<intptr_t>(utf8_encoded[2]));
 
   Dart_Handle str2 = Dart_NewStringFromUTF8(utf8_encoded, utf8_length);
-  EXPECT(Dart_IsError(str2));  // Invalid UTF-8.
+  EXPECT_VALID(str2);  // Standalone low surrogate, but still valid
+
+  Dart_Handle reversed = Dart_Invoke(lib, NewString("reversed"), 0, NULL);
+  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);
+  EXPECT_VALID(result);
+  EXPECT_EQ(6, utf8_length_reversed);
+  uint8_t expected[6] = {237, 180, 158, 237, 160, 180};
+  for (int i = 0; i < 6; i++) {
+    EXPECT_EQ(expected[i], utf8_encoded_reversed[i]);
+  }
 }
 
 
@@ -1175,7 +1196,6 @@
 
 
 TEST_CASE(ExternalStringPretenure) {
-  Isolate* isolate = Isolate::Current();
   {
     Dart_EnterScope();
     static const uint8_t big_data8[16*MB] = {0, };
@@ -1206,7 +1226,7 @@
         NULL);
     EXPECT_VALID(small16);
     {
-      DARTSCOPE(isolate);
+      DARTSCOPE(Thread::Current());
       String& handle = String::Handle();
       handle ^= Api::UnwrapHandle(big8);
       EXPECT(handle.IsOld());
@@ -1223,7 +1243,6 @@
 
 
 TEST_CASE(ExternalTypedDataPretenure) {
-  Isolate* isolate = Isolate::Current();
   {
     Dart_EnterScope();
     static const int kBigLength = 16*MB/8;
@@ -1241,7 +1260,7 @@
         kSmallLength);
     EXPECT_VALID(small);
     {
-      DARTSCOPE(isolate);
+      DARTSCOPE(Thread::Current());
       ExternalTypedData& handle = ExternalTypedData::Handle();
       handle ^= Api::UnwrapHandle(big);
       EXPECT(handle.IsOld());
@@ -1368,6 +1387,28 @@
   result = Dart_ListGetAt(list_access_test_obj, 4);
   EXPECT(Dart_IsError(result));
 
+  // Check if we can get a range of values.
+  result = Dart_ListGetRange(list_access_test_obj, 8, 4, NULL);
+  EXPECT(Dart_IsError(result));
+  const int kRangeOffset = 1;
+  const int kRangeLength = 2;
+  Dart_Handle values[kRangeLength];
+
+  result = Dart_ListGetRange(list_access_test_obj, 8, 4, values);
+  EXPECT(Dart_IsError(result));
+
+  result = Dart_ListGetRange(
+      list_access_test_obj, kRangeOffset, kRangeLength, values);
+  EXPECT_VALID(result);
+
+  result = Dart_IntegerToInt64(values[0], &value);
+  EXPECT_VALID(result);
+  EXPECT_EQ(20, value);
+
+  result = Dart_IntegerToInt64(values[1], &value);
+  EXPECT_VALID(result);
+  EXPECT_EQ(30, value);
+
   // Check that we get an exception (and not a fatal error) when
   // calling ListSetAt and ListSetAsBytes with an immutable list.
   list_access_test_obj = Dart_Invoke(lib, NewString("immutable"), 0, NULL);
@@ -2346,7 +2387,7 @@
   Dart_EnterScope();
   {
     EXPECT(state->top_scope() != NULL);
-    DARTSCOPE(isolate);
+    DARTSCOPE(Thread::Current());
     const String& str1 = String::Handle(String::New("Test String"));
     Dart_Handle ref = Api::NewHandle(isolate, str1.raw());
     String& str2 = String::Handle();
@@ -2363,7 +2404,8 @@
   const char* kTestString1 = "Test String1";
   const char* kTestString2 = "Test String2";
   TestCase::CreateTestIsolate();
-  Isolate* isolate = Isolate::Current();
+  Thread* thread = Thread::Current();
+  Isolate* isolate = thread->isolate();
   EXPECT(isolate != NULL);
   ApiState* state = isolate->api_state();
   EXPECT(state != NULL);
@@ -2371,7 +2413,7 @@
   Dart_PersistentHandle handles[2000];
   Dart_EnterScope();
   {
-    DARTSCOPE(isolate);
+    DARTSCOPE(Thread::Current());
     Dart_Handle ref1 = Api::NewHandle(isolate, String::New(kTestString1));
     for (int i = 0; i < 1000; i++) {
       handles[i] = Dart_NewPersistentHandle(ref1);
@@ -2395,8 +2437,8 @@
   }
   Dart_ExitScope();
   {
-    StackZone zone(isolate);
-    HANDLESCOPE(isolate);
+    StackZone zone(thread);
+    HANDLESCOPE(thread);
     for (int i = 0; i < 500; i++) {
       String& str = String::Handle();
       str ^= PersistentHandle::Cast(handles[i])->raw();
@@ -2433,7 +2475,7 @@
   EXPECT(isolate != NULL);
   ApiState* state = isolate->api_state();
   EXPECT(state != NULL);
-  DARTSCOPE(isolate);
+  DARTSCOPE(Thread::Current());
 
   // Start with a known persistent handle.
   Dart_PersistentHandle obj1 = Dart_NewPersistentHandle(Dart_True());
@@ -2464,7 +2506,7 @@
   EXPECT(isolate != NULL);
   ApiState* state = isolate->api_state();
   EXPECT(state != NULL);
-  DARTSCOPE(isolate);
+  DARTSCOPE(Thread::Current());
   String& str = String::Handle();
 
   // Start with a known persistent handle.
@@ -2544,7 +2586,7 @@
     Dart_Handle old_ref;
     {
       Isolate* isolate = Isolate::Current();
-      DARTSCOPE(isolate);
+      DARTSCOPE(Thread::Current());
       old_ref = Api::NewHandle(isolate, String::New("old string", Heap::kOld));
       EXPECT_VALID(old_ref);
     }
@@ -2799,8 +2841,8 @@
     // After the two scavenges above, 'obj' should now be promoted, hence its
     // external size charged to old space.
     {
-      DARTSCOPE(Isolate::Current());
-      String& handle = String::Handle();
+      DARTSCOPE(thread);
+      String& handle = String::Handle(thread->zone());
       handle ^= Api::UnwrapHandle(obj);
       EXPECT(handle.IsOld());
     }
@@ -2910,7 +2952,7 @@
   Dart_EnterScope();
   {
     Isolate* isolate = Isolate::Current();
-    DARTSCOPE(isolate);
+    DARTSCOPE(Thread::Current());
 
     Dart_Handle local = Api::NewHandle(
         isolate, String::New("strongly reachable", Heap::kOld));
@@ -3145,6 +3187,47 @@
 }
 
 
+TEST_CASE(DuplicateWeakReferenceSetEntries) {
+  Isolate* isolate = Isolate::Current();
+  Dart_PersistentHandle strong = NULL;
+  Dart_WeakPersistentHandle weak = NULL;  // A weak handle to strong.
+
+  Dart_EnterScope();
+  {
+    DARTSCOPE(Thread::Current());
+
+    // Strong handle to keep the reference set alive.
+    Dart_Handle local = Api::NewHandle(isolate, String::New("string"));
+    strong = Dart_NewPersistentHandle(local);
+    EXPECT_VALID(AsHandle(strong));
+    EXPECT(!Dart_IsNull(AsHandle(strong)));
+    // Corresponding weak handle to use as key and duplicated value.
+    weak = Dart_NewWeakPersistentHandle(local, NULL, 0, NopCallback);
+    EXPECT_VALID(AsHandle(weak));
+    EXPECT(!Dart_IsNull(AsHandle(weak)));
+  }
+  Dart_ExitScope();
+
+  {
+    Dart_EnterScope();
+    // Create the weak reference set.
+    Dart_WeakReferenceSetBuilder builder = Dart_NewWeakReferenceSetBuilder();
+    EXPECT_NOTNULL(builder);
+    // Register the key and the first copy of the value.
+    Dart_WeakReferenceSet set = Dart_NewWeakReferenceSet(builder, weak, weak);
+    EXPECT_NOTNULL(set);
+    // Add the second copy of the value.
+    Dart_Handle result = Dart_AppendValueToWeakReferenceSet(set, weak);
+    EXPECT_VALID(result);
+
+    // Trigger GC to ensure that we can visit duplicate entries in weak
+    // reference sets.
+    isolate->heap()->CollectGarbage(Heap::kNew);
+    Dart_ExitScope();
+  }
+}
+
+
 static Dart_WeakPersistentHandle old_pwph = NULL;
 static Dart_WeakPersistentHandle new_pwph = NULL;
 
@@ -3164,7 +3247,7 @@
   Dart_EnterScope();
   {
     Isolate* isolate = Isolate::Current();
-    DARTSCOPE(isolate);
+    DARTSCOPE(Thread::Current());
     new_pwph = Dart_NewPrologueWeakPersistentHandle(
         Api::NewHandle(isolate,
                        String::New("new space prologue weak", Heap::kNew)),
@@ -3262,7 +3345,7 @@
   Dart_EnterScope();
   {
     Isolate* isolate = Isolate::Current();
-    DARTSCOPE(isolate);
+    DARTSCOPE(Thread::Current());
 
     Dart_Handle local = Api::NewHandle(
         isolate, String::New("strongly reachable", Heap::kOld));
@@ -3373,7 +3456,7 @@
   Dart_EnterScope();
   {
     Isolate* isolate = Isolate::Current();
-    DARTSCOPE(isolate);
+    DARTSCOPE(Thread::Current());
 
     Dart_Handle local = Api::NewHandle(
         isolate, String::New("strongly reachable", Heap::kOld));
@@ -3629,15 +3712,16 @@
 // scope.
 UNIT_TEST_CASE(LocalHandles) {
   TestCase::CreateTestIsolate();
-  Isolate* isolate = Isolate::Current();
+  Thread* thread = Thread::Current();
+  Isolate* isolate = thread->isolate();
   EXPECT(isolate != NULL);
   ApiState* state = isolate->api_state();
   EXPECT(state != NULL);
   ApiLocalScope* scope = state->top_scope();
   Dart_Handle handles[300];
   {
-    StackZone zone(isolate);
-    HANDLESCOPE(isolate);
+    StackZone zone(thread);
+    HANDLESCOPE(thread);
     Smi& val = Smi::Handle();
 
     // Start a new scope and allocate some local handles.
@@ -3917,7 +4001,7 @@
 }
 
 
-TEST_CASE(TypeGetParamterizedTypes) {
+TEST_CASE(TypeGetParameterizedTypes) {
   const char* kScriptChars =
       "class MyClass0<A, B> {\n"
       "}\n"
@@ -4408,7 +4492,7 @@
   // Invoke a function which returns an object of type NativeFields.
   result = Dart_Invoke(lib, NewString("testMain"), 0, NULL);
   EXPECT_VALID(result);
-  DARTSCOPE(Isolate::Current());
+  DARTSCOPE(Thread::Current());
   Instance& obj = Instance::Handle();
   obj ^= Api::UnwrapHandle(result);
   const Class& cls = Class::Handle(obj.clazz());
@@ -4478,7 +4562,7 @@
   // Invoke a function which returns an object of type NativeFields.
   result = Dart_Invoke(lib, NewString("testMain"), 0, NULL);
   EXPECT_VALID(result);
-  DARTSCOPE(Isolate::Current());
+  DARTSCOPE(Thread::Current());
   Instance& obj = Instance::Handle();
   obj ^= Api::UnwrapHandle(result);
   const Class& cls = Class::Handle(obj.clazz());
@@ -4822,7 +4906,7 @@
       "  return () {};\n"
       "}\n";
   Dart_Handle result;
-  DARTSCOPE(Isolate::Current());
+  DARTSCOPE(Thread::Current());
 
   // Create a test library and Load up a test script in it.
   Dart_Handle lib = TestCase::LoadTestScript(kScriptChars, NULL);
@@ -4900,7 +4984,7 @@
       "  };\n"
       "}\n";
 
-  DARTSCOPE(Isolate::Current());
+  DARTSCOPE(Thread::Current());
 
   // Create a test library and Load up a test script in it.
   Dart_Handle lib = TestCase::LoadTestScript(kScriptChars, NULL);
@@ -5249,10 +5333,10 @@
 
 static Dart_Handle PrivateLibName(Dart_Handle lib, const char* str) {
   EXPECT(Dart_IsLibrary(lib));
-  Isolate* isolate = Isolate::Current();
-  const Library& library_obj = Api::UnwrapLibraryHandle(isolate, lib);
+  Thread* thread = Thread::Current();
+  const Library& library_obj = Api::UnwrapLibraryHandle(thread->zone(), lib);
   const String& name = String::Handle(String::New(str));
-  return Api::NewHandle(isolate, library_obj.PrivateName(name));
+  return Api::NewHandle(thread->isolate(), library_obj.PrivateName(name));
 }
 
 
@@ -5601,7 +5685,7 @@
       "  return InvokeClosure.method2(10);\n"
       "}\n";
   Dart_Handle result;
-  DARTSCOPE(Isolate::Current());
+  DARTSCOPE(Thread::Current());
 
   // Create a test library and Load up a test script in it.
   Dart_Handle lib = TestCase::LoadTestScript(kScriptChars, NULL);
@@ -6802,6 +6886,121 @@
   EXPECT_EQ(42, value);
 }
 
+TEST_CASE(LoadPatchSignatureMismatch) {
+  // 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* kSourceChars =
+      "part of library1_name;\n"
+      "external int foo([int x]);\n"
+      "class 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"
+      "  static addDefault10([x=_UNDEFINED, y=_UNDEFINED]) {\n"
+      "    if (identical(x, _UNDEFINED)) x = 10;\n"
+      "    if (identical(y, _UNDEFINED)) y = 10;\n"
+      "    return x + y;\n"
+      "  }\n"
+      "}";
+
+  bool old_flag_value = FLAG_ignore_patch_signature_mismatch;
+  FLAG_ignore_patch_signature_mismatch = true;
+
+  // Load up a library.
+  Dart_Handle url = NewString("library1_url");
+  Dart_Handle source = NewString(kLibrary1Chars);
+  Dart_Handle lib = Dart_LoadLibrary(url, source, 0, 0);
+  EXPECT_VALID(lib);
+  EXPECT(Dart_IsLibrary(lib));
+
+  url = NewString("source_url");
+  source = NewString(kSourceChars);
+
+  Dart_Handle result = Dart_LoadSource(lib, url, source, 0, 0);
+  EXPECT_VALID(result);
+
+  url = NewString("patch_url");
+  source = NewString(kPatchChars);
+
+  result = Dart_LibraryLoadPatch(lib, url, source);
+  EXPECT_VALID(result);
+  result = Dart_FinalizeLoading(false);
+  EXPECT_VALID(result);
+
+  // Test a top level method
+  {
+    result = Dart_Invoke(lib, NewString("foo"), 0, NULL);
+    EXPECT_VALID(result);
+    EXPECT(Dart_IsInteger(result));
+    int64_t value = 0;
+    EXPECT_VALID(Dart_IntegerToInt64(result, &value));
+    EXPECT_EQ(42, value);
+  }
+
+  {
+    Dart_Handle dart_args[1];
+    dart_args[0] = Dart_Null();
+    result = Dart_Invoke(lib, NewString("foo"), 1, dart_args);
+    EXPECT_VALID(result);
+    EXPECT(Dart_IsNull(result));
+  }
+
+  {
+    Dart_Handle dart_args[1];
+    dart_args[0] = Dart_NewInteger(100);
+    result = Dart_Invoke(lib, NewString("foo"), 1, dart_args);
+    EXPECT_VALID(result);
+    EXPECT(Dart_IsInteger(result));
+    int64_t value = 0;
+    EXPECT_VALID(Dart_IntegerToInt64(result, &value));
+    EXPECT_EQ(100, value);
+  }
+
+  // Test static method
+  Dart_Handle type = Dart_GetType(lib, NewString("Foo"), 0, NULL);
+  EXPECT_VALID(type);
+
+  {
+    result = Dart_Invoke(type, NewString("addDefault10"), 0, NULL);
+    EXPECT_VALID(result);
+    EXPECT(Dart_IsInteger(result));
+    int64_t value = 0;
+    EXPECT_VALID(Dart_IntegerToInt64(result, &value));
+    EXPECT_EQ(20, value);
+  }
+
+  {
+    Dart_Handle dart_args[1];
+    dart_args[0] = Dart_NewInteger(100);
+    result = Dart_Invoke(type, NewString("addDefault10"), 1, dart_args);
+    EXPECT_VALID(result);
+    EXPECT(Dart_IsInteger(result));
+    int64_t value = 0;
+    EXPECT_VALID(Dart_IntegerToInt64(result, &value));
+    EXPECT_EQ(110, value);
+  }
+
+  {
+    Dart_Handle dart_args[2];
+    dart_args[0] = Dart_NewInteger(100);
+    dart_args[1] = Dart_NewInteger(100);
+    result = Dart_Invoke(type, NewString("addDefault10"), 2, dart_args);
+    EXPECT_VALID(result);
+    EXPECT(Dart_IsInteger(result));
+    int64_t value = 0;
+    EXPECT_VALID(Dart_IntegerToInt64(result, &value));
+    EXPECT_EQ(200, value);
+  }
+
+  FLAG_ignore_patch_signature_mismatch = old_flag_value;
+}
+
 
 static void PatchNativeFunction(Dart_NativeArguments args) {
   Dart_EnterScope();
@@ -7364,6 +7563,7 @@
 static Dart_Isolate RunLoopTestCallback(const char* script_name,
                                         const char* main,
                                         const char* package_root,
+                                        const char** package_map,
                                         Dart_IsolateFlags* flags,
                                         void* data,
                                         char** error) {
@@ -7438,7 +7638,7 @@
   Isolate::SetCreateCallback(RunLoopTestCallback);
   Isolate::SetUnhandledExceptionCallback(RunLoopUnhandledExceptionCallback);
   Dart_Isolate isolate = RunLoopTestCallback(
-      NULL, NULL, NULL, NULL, NULL, NULL);
+      NULL, NULL, NULL, NULL, NULL, NULL, NULL);
 
   Dart_EnterIsolate(isolate);
   Dart_EnterScope();
@@ -8194,7 +8394,7 @@
   Isolate* isolate = Isolate::Current();
   Dart_EnterScope();
   {
-    DARTSCOPE(isolate);
+    DARTSCOPE(Thread::Current());
     Dart_Handle str = NewString("a string");
     EXPECT_VALID(str);
     EXPECT(Dart_IsString(str));
@@ -8267,7 +8467,7 @@
   Isolate* isolate = Isolate::Current();
   Dart_EnterScope();
   {
-    DARTSCOPE(isolate);
+    DARTSCOPE(Thread::Current());
     Dart_Handle s1 = NewString("s1");
     EXPECT_VALID(s1);
     EXPECT(Dart_IsString(s1));
@@ -8351,7 +8551,7 @@
   isolate->heap()->CollectGarbage(Heap::kNew);
   isolate->heap()->CollectGarbage(Heap::kNew);
   {
-    DARTSCOPE(isolate);
+    DARTSCOPE(Thread::Current());
     String& handle = String::Handle();
     handle ^= Api::UnwrapHandle(str);
     EXPECT(handle.IsOld());
@@ -8404,7 +8604,7 @@
   Isolate* isolate = Isolate::Current();
   Dart_EnterScope();
   {
-    DARTSCOPE(isolate);
+    DARTSCOPE(Thread::Current());
     Dart_Handle str = Api::NewHandle(isolate, String::New("str", Heap::kOld));
     EXPECT_VALID(str);
     EXPECT(Dart_IsString(str));
@@ -8480,7 +8680,7 @@
   Isolate* isolate = Isolate::Current();
   Dart_EnterScope();
   {
-    DARTSCOPE(isolate);
+    DARTSCOPE(Thread::Current());
     Dart_Handle s1 = Api::NewHandle(isolate, String::New("s1", Heap::kOld));
     EXPECT_VALID(s1);
     EXPECT(Dart_IsString(s1));
@@ -8674,6 +8874,7 @@
       EXPECT_EQ(0x4e8c, ext_utf16_str[i]);
     }
 
+    Zone* zone = thread->zone();
     // Test with a symbol (hash value should be preserved on externalization).
     const char* symbol_ascii = "?unseen";
     expected_length = strlen(symbol_ascii);
@@ -8685,7 +8886,7 @@
     EXPECT(!Dart_IsExternalString(symbol_str));
     EXPECT_VALID(Dart_StringLength(symbol_str, &length));
     EXPECT_EQ(expected_length, length);
-    EXPECT(Api::UnwrapStringHandle(isolate, symbol_str).HasHash());
+    EXPECT(Api::UnwrapStringHandle(zone, symbol_str).HasHash());
 
     uint8_t ext_symbol_ascii[kLength];
     EXPECT_VALID(Dart_StringStorageSize(symbol_str, &size));
@@ -8694,9 +8895,9 @@
                                   size,
                                   &peer8,
                                   MakeExternalCback);
-    EXPECT(Api::UnwrapStringHandle(isolate, str).HasHash());
-    EXPECT(Api::UnwrapStringHandle(isolate, str).Hash() ==
-           Api::UnwrapStringHandle(isolate, symbol_str).Hash());
+    EXPECT(Api::UnwrapStringHandle(zone, str).HasHash());
+    EXPECT(Api::UnwrapStringHandle(zone, str).Hash() ==
+           Api::UnwrapStringHandle(zone, symbol_str).Hash());
     EXPECT(Dart_IsString(str));
     EXPECT(Dart_IsString(symbol_str));
     EXPECT(Dart_IsStringLatin1(str));
@@ -9216,9 +9417,11 @@
   // Add a duration event.
   Dart_TimelineDuration("testDurationEvent", 0, 1);
   // Check that it is in the output.
-  TimelineEventRecorder* recorder = isolate->timeline_event_recorder();
+  TimelineEventRecorder* recorder = Timeline::recorder();
+  Timeline::ReclaimIsolateBlocks();
   JSONStream js;
-  recorder->PrintJSON(&js);
+  IsolateTimelineEventFilter filter(isolate);
+  recorder->PrintJSON(&js, &filter);
   EXPECT_SUBSTRING("testDurationEvent", js.ToCString());
 }
 
@@ -9231,9 +9434,11 @@
   stream->set_enabled(true);
   Dart_TimelineInstant("testInstantEvent");
   // Check that it is in the output.
-  TimelineEventRecorder* recorder = isolate->timeline_event_recorder();
+  TimelineEventRecorder* recorder = Timeline::recorder();
+  Timeline::ReclaimIsolateBlocks();
   JSONStream js;
-  recorder->PrintJSON(&js);
+  IsolateTimelineEventFilter filter(isolate);
+  recorder->PrintJSON(&js, &filter);
   EXPECT_SUBSTRING("testInstantEvent", js.ToCString());
 }
 
@@ -9251,9 +9456,11 @@
   // Call Dart_TimelineAsyncEnd with a negative async_id.
   Dart_TimelineAsyncEnd("testAsyncEvent", async_id);
   // Check that testAsync is not in the output.
-  TimelineEventRecorder* recorder = isolate->timeline_event_recorder();
+  TimelineEventRecorder* recorder = Timeline::recorder();
+  Timeline::ReclaimIsolateBlocks();
   JSONStream js;
-  recorder->PrintJSON(&js);
+  TimelineEventFilter filter;
+  recorder->PrintJSON(&js, &filter);
   EXPECT_NOTSUBSTRING("testAsyncEvent", js.ToCString());
 }
 
@@ -9272,10 +9479,311 @@
   Dart_TimelineAsyncEnd("testAsyncEvent", async_id);
 
   // Check that it is in the output.
-  TimelineEventRecorder* recorder = isolate->timeline_event_recorder();
+  TimelineEventRecorder* recorder = Timeline::recorder();
+  Timeline::ReclaimIsolateBlocks();
   JSONStream js;
-  recorder->PrintJSON(&js);
+  IsolateTimelineEventFilter filter(isolate);
+  recorder->PrintJSON(&js, &filter);
   EXPECT_SUBSTRING("testAsyncEvent", js.ToCString());
 }
 
+
+struct AppendData {
+  uint8_t* buffer;
+  intptr_t buffer_length;
+};
+
+
+static void AppendStreamConsumer(Dart_StreamConsumer_State state,
+                                 const char* stream_name,
+                                 const uint8_t* buffer,
+                                 intptr_t buffer_length,
+                                 void* user_data) {
+  if (state == Dart_StreamConsumer_kFinish) {
+    return;
+  }
+  AppendData* data = reinterpret_cast<AppendData*>(user_data);
+  if (state == Dart_StreamConsumer_kStart) {
+    // Initialize append data.
+    data->buffer = NULL;
+    data->buffer_length = 0;
+    return;
+  }
+  ASSERT(state == Dart_StreamConsumer_kData);
+  // Grow buffer.
+  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);
+  // Update length.
+  data->buffer_length += buffer_length;
+}
+
+
+TEST_CASE(Timeline_Dart_TimelineGetTrace) {
+  const char* kScriptChars =
+    "foo() => 'a';\n"
+    "main() => foo();\n";
+
+  Dart_Handle lib =
+      TestCase::LoadTestScript(kScriptChars, NULL);
+
+  const char* buffer = NULL;
+  intptr_t buffer_length = 0;
+  bool success = false;
+
+  // Enable recording of all streams.
+  Dart_TimelineSetRecordedStreams(DART_TIMELINE_STREAM_ALL);
+
+  // Invoke main, which will be compiled resulting in a compiler event in
+  // the timeline.
+  Dart_Handle result = Dart_Invoke(lib,
+                                   NewString("main"),
+                                   0,
+                                   NULL);
+  EXPECT_VALID(result);
+
+  // Grab the trace.
+  AppendData data;
+  success = Dart_TimelineGetTrace(AppendStreamConsumer, &data);
+  EXPECT(success);
+  buffer = reinterpret_cast<char*>(data.buffer);
+  buffer_length = data.buffer_length;
+  EXPECT(buffer_length > 0);
+  EXPECT(buffer != NULL);
+
+  // Heartbeat test.
+  EXPECT_SUBSTRING("\"cat\":\"Compiler\"", buffer);
+  EXPECT_SUBSTRING("\"name\":\"CompileFunction\"", buffer);
+  EXPECT_SUBSTRING("\"function\":\"::_main\"", buffer);
+
+  // Free buffer allocated by AppendStreamConsumer
+  free(data.buffer);
+}
+
+
+TEST_CASE(Timeline_Dart_TimelineGetTraceOnlyDartEvents) {
+  const char* kScriptChars =
+    "import 'dart:developer';\n"
+    ""
+    "main() {\n"
+    "  Timeline.startSync('DART_NAME');\n"
+    "  Timeline.finishSync();\n"
+    "}\n";
+
+  Dart_Handle lib =
+      TestCase::LoadTestScript(kScriptChars, NULL);
+
+  const char* buffer = NULL;
+  intptr_t buffer_length = 0;
+  bool success = false;
+
+  // Enable recording of the Dart stream.
+  Dart_TimelineSetRecordedStreams(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);
+  EXPECT_VALID(result);
+
+  // Grab the trace.
+  AppendData data;
+  data.buffer = NULL;
+  data.buffer_length = 0;
+  success = Dart_TimelineGetTrace(AppendStreamConsumer, &data);
+  EXPECT(success);
+  buffer = reinterpret_cast<char*>(data.buffer);
+  buffer_length = data.buffer_length;
+  EXPECT(buffer_length > 0);
+  EXPECT(buffer != NULL);
+
+  // Heartbeat test.
+  EXPECT_SUBSTRING("\"cat\":\"Dart\"", buffer);
+  EXPECT_SUBSTRING("\"name\":\"DART_NAME\"", buffer);
+
+  // Free buffer allocated by AppendStreamConsumer
+  free(data.buffer);
+}
+
+
+TEST_CASE(Timeline_Dart_TimelineGetTraceWithDartEvents) {
+  const char* kScriptChars =
+    "import 'dart:developer';\n"
+    "\n"
+    "main() {\n"
+    "  Timeline.startSync('DART_NAME');\n"
+    "  Timeline.finishSync();\n"
+    "}\n";
+
+  Dart_Handle lib =
+      TestCase::LoadTestScript(kScriptChars, NULL);
+
+  const char* buffer = NULL;
+  intptr_t buffer_length = 0;
+  bool success = false;
+
+  // Enable recording of all streams.
+  Dart_TimelineSetRecordedStreams(DART_TIMELINE_STREAM_ALL);
+
+  // Invoke main, which will be compiled resulting in a compiler event in
+  // the timeline.
+  Dart_Handle result = Dart_Invoke(lib,
+                                   NewString("main"),
+                                   0,
+                                   NULL);
+  EXPECT_VALID(result);
+
+  // Grab the trace.
+  AppendData data;
+  success = Dart_TimelineGetTrace(AppendStreamConsumer, &data);
+  EXPECT(success);
+  buffer = reinterpret_cast<char*>(data.buffer);
+  buffer_length = data.buffer_length;
+  EXPECT(buffer_length > 0);
+  EXPECT(buffer != NULL);
+
+  // Heartbeat test.
+  EXPECT_SUBSTRING("\"cat\":\"Compiler\"", buffer);
+  EXPECT_SUBSTRING("\"name\":\"CompileFunction\"", buffer);
+  EXPECT_SUBSTRING("\"function\":\"::_main\"", buffer);
+  EXPECT_SUBSTRING("\"cat\":\"Dart\"", buffer);
+  EXPECT_SUBSTRING("\"name\":\"DART_NAME\"", buffer);
+
+  // Free buffer allocated by AppendStreamConsumer
+  free(data.buffer);
+}
+
+TEST_CASE(Timeline_Dart_TimelineGetTraceGlobalOverride) {
+  const char* kScriptChars =
+    "foo() => 'a';\n"
+    "main() => foo();\n";
+
+  Dart_Handle lib =
+      TestCase::LoadTestScript(kScriptChars, NULL);
+
+  const char* buffer = NULL;
+  intptr_t buffer_length = 0;
+  bool success = false;
+
+  // Enable recording of all streams across the entire vm.
+  Dart_GlobalTimelineSetRecordedStreams(DART_TIMELINE_STREAM_ALL);
+
+  // Invoke main, which will be compiled resulting in a compiler event in
+  // the timeline.
+  Dart_Handle result = Dart_Invoke(lib,
+                                   NewString("main"),
+                                   0,
+                                   NULL);
+  EXPECT_VALID(result);
+
+  // Grab the trace.
+  AppendData data;
+  success = Dart_TimelineGetTrace(AppendStreamConsumer, &data);
+  EXPECT(success);
+  buffer = reinterpret_cast<char*>(data.buffer);
+  buffer_length = data.buffer_length;
+  EXPECT(buffer_length > 0);
+  EXPECT(buffer != NULL);
+
+  // Heartbeat test.
+  EXPECT_SUBSTRING("\"cat\":\"Compiler\"", buffer);
+  EXPECT_SUBSTRING("\"name\":\"CompileFunction\"", buffer);
+  EXPECT_SUBSTRING("\"function\":\"::_main\"", buffer);
+
+  // Free buffer allocated by AppendStreamConsumer
+  free(data.buffer);
+}
+
+
+TEST_CASE(Timeline_Dart_GlobalTimelineGetTrace) {
+  const char* kScriptChars =
+    "bar() => 'z';\n"
+    "foo() => 'a';\n"
+    "main() => foo();\n";
+
+  // Enable all streams.
+  Dart_GlobalTimelineSetRecordedStreams(DART_TIMELINE_STREAM_ALL |
+                                        DART_TIMELINE_STREAM_VM);
+  Dart_Handle lib;
+  {
+    // Add something to the VM stream.
+    TimelineDurationScope tds(Timeline::GetVMStream(),
+                              "TestVMDuration");
+    lib = TestCase::LoadTestScript(kScriptChars, NULL);
+  }
+
+  // Invoke main, which will be compiled resulting in a compiler event in
+  // the timeline.
+  Dart_Handle result = Dart_Invoke(lib,
+                                   NewString("main"),
+                                   0,
+                                   NULL);
+  EXPECT_VALID(result);
+
+  const char* buffer = NULL;
+  intptr_t buffer_length = 0;
+  bool success = false;
+
+  // Grab the global trace.
+  AppendData data;
+  success = Dart_GlobalTimelineGetTrace(AppendStreamConsumer, &data);
+  EXPECT(success);
+  buffer = reinterpret_cast<char*>(data.buffer);
+  buffer_length = data.buffer_length;
+  EXPECT(buffer_length > 0);
+  EXPECT(buffer != NULL);
+
+  // Heartbeat test.
+  EXPECT_SUBSTRING("\"name\":\"TestVMDuration\"", buffer);
+  EXPECT_SUBSTRING("\"cat\":\"Compiler\"", buffer);
+  EXPECT_SUBSTRING("\"name\":\"CompileFunction\"", buffer);
+  EXPECT_SUBSTRING("\"function\":\"::_main\"", buffer);
+  EXPECT_NOTSUBSTRING("\"function\":\"::_bar\"", buffer);
+
+  // Free buffer allocated by AppendStreamConsumer
+  free(data.buffer);
+  data.buffer = NULL;
+  data.buffer_length = 0;
+
+  // Retrieving the global trace resulted in all open blocks being reclaimed.
+  // Add some new events and verify that both sets of events are present
+  // in the resulting trace.
+  {
+    // Add something to the VM stream.
+    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);
+  }
+
+  // Grab the global trace.
+  success = Dart_GlobalTimelineGetTrace(AppendStreamConsumer, &data);
+  EXPECT(success);
+  buffer = reinterpret_cast<char*>(data.buffer);
+  buffer_length = data.buffer_length;
+  EXPECT(buffer_length > 0);
+  EXPECT(buffer != NULL);
+
+  // Heartbeat test for old events.
+  EXPECT_SUBSTRING("\"name\":\"TestVMDuration\"", buffer);
+  EXPECT_SUBSTRING("\"cat\":\"Compiler\"", buffer);
+  EXPECT_SUBSTRING("\"name\":\"CompileFunction\"", buffer);
+  EXPECT_SUBSTRING("\"function\":\"::_main\"", buffer);
+
+  // Heartbeat test for new events.
+  EXPECT_SUBSTRING("\"name\":\"TestVMDuration2\"", buffer);
+  EXPECT_SUBSTRING("\"function\":\"::_bar\"", buffer);
+
+  // Free buffer allocated by AppendStreamConsumer
+  free(data.buffer);
+}
+
 }  // namespace dart
diff --git a/runtime/vm/dart_api_message.cc b/runtime/vm/dart_api_message.cc
index 69fb891..a4e47bb 100644
--- a/runtime/vm/dart_api_message.cc
+++ b/runtime/vm/dart_api_message.cc
@@ -12,14 +12,16 @@
 
 static const int kNumInitialReferences = 4;
 
-ApiMessageReader::ApiMessageReader(const uint8_t* buffer,
-                                   intptr_t length,
-                                   ReAlloc alloc)
+ApiMessageReader::ApiMessageReader(const uint8_t* buffer, intptr_t length)
     : BaseReader(buffer, length),
-      alloc_(alloc),
+      zone_(NULL),
       backward_references_(kNumInitialReferences),
       vm_isolate_references_(kNumInitialReferences),
       vm_symbol_references_(NULL) {
+  // We need to have an enclosing ApiNativeScope.
+  ASSERT(ApiNativeScope::Current() != NULL);
+  zone_ = ApiNativeScope::Current()->zone();
+  ASSERT(zone_ != NULL);
   Init();
 }
 
@@ -54,7 +56,7 @@
 
 Dart_CObject* ApiMessageReader::AllocateDartCObject(Dart_CObject_Type type) {
   Dart_CObject* value =
-      reinterpret_cast<Dart_CObject*>(alloc_(NULL, 0, sizeof(Dart_CObject)));
+      reinterpret_cast<Dart_CObject*>(allocator(sizeof(Dart_CObject)));
   ASSERT(value != NULL);
   value->type = type;
   return value;
@@ -121,7 +123,7 @@
   // up to this area.
   Dart_CObject* value =
       reinterpret_cast<Dart_CObject*>(
-          alloc_(NULL, 0, sizeof(Dart_CObject) + length + 1));
+          allocator(sizeof(Dart_CObject) + length + 1));
   ASSERT(value != NULL);
   value->value.as_string = reinterpret_cast<char*>(value) + sizeof(*value);
   value->type = Dart_CObject_kString;
@@ -162,7 +164,7 @@
   intptr_t length_in_bytes = GetTypedDataSizeInBytes(type) * length;
   Dart_CObject* value =
       reinterpret_cast<Dart_CObject*>(
-          alloc_(NULL, 0, sizeof(Dart_CObject) + length_in_bytes));
+          allocator(sizeof(Dart_CObject) + length_in_bytes));
   ASSERT(value != NULL);
   value->type = Dart_CObject_kTypedData;
   value->value.as_typed_data.type = type;
@@ -183,7 +185,7 @@
   // content is set up to this area.
   Dart_CObject* value =
       reinterpret_cast<Dart_CObject*>(
-          alloc_(NULL, 0, sizeof(Dart_CObject) + length * sizeof(value)));
+          allocator(sizeof(Dart_CObject) + length * sizeof(value)));
   ASSERT(value != NULL);
   value->type = Dart_CObject_kArray;
   value->value.as_array.length = length;
@@ -239,7 +241,7 @@
     Dart_CObject_Internal::Type type) {
   Dart_CObject_Internal* value =
       reinterpret_cast<Dart_CObject_Internal*>(
-          alloc_(NULL, 0, sizeof(Dart_CObject_Internal)));
+          allocator(sizeof(Dart_CObject_Internal)));
   ASSERT(value != NULL);
   value->type = static_cast<Dart_CObject_Type>(type);
   return value;
@@ -255,7 +257,7 @@
     Dart_CObject* reference,
     DeserializeState state) {
   BackRefNode* value =
-      reinterpret_cast<BackRefNode*>(alloc_(NULL, 0, sizeof(BackRefNode)));
+      reinterpret_cast<BackRefNode*>(allocator(sizeof(BackRefNode)));
   value->set_reference(reference);
   value->set_state(state);
   return value;
@@ -405,7 +407,7 @@
     intptr_t size =
         (sizeof(*vm_symbol_references_) * Symbols::kMaxPredefinedId);
     vm_symbol_references_ =
-        reinterpret_cast<Dart_CObject**>(alloc_(NULL, 0, size));
+        reinterpret_cast<Dart_CObject**>(allocator(size));
     memset(vm_symbol_references_, 0, size);
   }
 
@@ -621,7 +623,7 @@
       intptr_t hash = ReadSmiValue();
       USE(hash);
       uint8_t *latin1 =
-          reinterpret_cast<uint8_t*>(::malloc(len * sizeof(uint8_t)));
+          reinterpret_cast<uint8_t*>(allocator(len * sizeof(uint8_t)));
       intptr_t utf8_len = 0;
       for (intptr_t i = 0; i < len; i++) {
         latin1[i] = Read<uint8_t>();
@@ -635,15 +637,14 @@
       }
       *p = '\0';
       ASSERT(p == (object->value.as_string + utf8_len));
-      ::free(latin1);
       return object;
     }
     case kTwoByteStringCid: {
       intptr_t len = ReadSmiValue();
       intptr_t hash = ReadSmiValue();
       USE(hash);
-      uint16_t *utf16 =
-          reinterpret_cast<uint16_t*>(::malloc(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++) {
@@ -670,7 +671,6 @@
       }
       *p = '\0';
       ASSERT(p == (object->value.as_string + utf8_len));
-      ::free(utf16);
       return object;
     }
     case kSendPortCid: {
@@ -794,7 +794,7 @@
       value = AllocateDartCObjectArray(0);
       AddBackRef(object_id, value, kIsDeserialized);
       // Read the content of the GrowableObjectArray.
-      Dart_CObject* content = ReadObjectImpl();
+      Dart_CObject* content = ReadObjectRef();
       ASSERT(content->type == Dart_CObject_kArray);
       // Make the empty array allocated point to the backing store content.
       value->value.as_array.length = len;
@@ -1235,7 +1235,7 @@
       }
 
       WriteIndexedObject(class_id);
-      WriteTags(RawObject::ClassIdTag::update(class_id, 0));
+      WriteTags(0);
       WriteSmi(len);
       switch (class_id) {
         case kTypedDataInt8ArrayCid:
@@ -1269,8 +1269,7 @@
       WriteInlinedHeader(object);
       // Write out the class and tag information.
       WriteIndexedObject(kExternalTypedDataUint8ArrayCid);
-      WriteTags(RawObject::ClassIdTag::update(
-          kExternalTypedDataUint8ArrayCid, 0));
+      WriteTags(0);
       intptr_t length = object->value.as_external_typed_data.length;
       if (length < 0 ||
           length > ExternalTypedData::MaxElements(
diff --git a/runtime/vm/dart_api_message.h b/runtime/vm/dart_api_message.h
index 70d55f9..16a138b 100644
--- a/runtime/vm/dart_api_message.h
+++ b/runtime/vm/dart_api_message.h
@@ -41,14 +41,10 @@
 // Reads a message snapshot into a C structure.
 class ApiMessageReader : public BaseReader {
  public:
-  // The allocator passed is used to allocate memory for the C structure used
-  // to represent the message snapshot. This allocator must keep track of the
-  // memory allocated as there is no way to run through the resulting C
-  // structure and free the individual pieces. Using a zone based allocator is
-  // recommended.
-  ApiMessageReader(const uint8_t* buffer,
-                   intptr_t length,
-                   ReAlloc alloc);
+  // The ApiMessageReader object must be enclosed by an ApiNativeScope.
+  // Allocation of all C Heap objects is done in the zone associated with
+  // the enclosing ApiNativeScope.
+  ApiMessageReader(const uint8_t* buffer, intptr_t length);
   ~ApiMessageReader() { }
 
   Dart_CObject* ReadMessage();
@@ -139,10 +135,11 @@
   Dart_CObject* GetCanonicalMintObject(Dart_CObject_Type type,
                                        int64_t value64);
 
-  // Allocation of the structures for the decoded message happens
-  // either in the supplied zone or using the supplied allocation
-  // function.
-  ReAlloc alloc_;
+  uint8_t* allocator(intptr_t size) {
+    return zone_->Realloc<uint8_t>(NULL, 0, size);
+  }
+
+  Zone* zone_;  // Zone in which C heap objects are allocated.
   ApiGrowableArray<BackRefNode*> backward_references_;
   ApiGrowableArray<Dart_CObject*> vm_isolate_references_;
   Dart_CObject** vm_symbol_references_;
diff --git a/runtime/vm/dart_entry.cc b/runtime/vm/dart_entry.cc
index 211ce7f..2f5a79e 100644
--- a/runtime/vm/dart_entry.cc
+++ b/runtime/vm/dart_entry.cc
@@ -55,19 +55,19 @@
 };
 
 
-// Clears/restores Isolate::long_jump_base on construction/destruction.
+// Clears/restores Thread::long_jump_base on construction/destruction.
 // Ensures that we do not attempt to long jump across Dart frames.
 class SuspendLongJumpScope : public StackResource {
  public:
-  explicit SuspendLongJumpScope(Isolate* isolate)
-      : StackResource(isolate),
-        saved_long_jump_base_(isolate->long_jump_base()) {
-    isolate->set_long_jump_base(NULL);
+  explicit SuspendLongJumpScope(Thread* thread)
+      : StackResource(thread),
+        saved_long_jump_base_(thread->long_jump_base()) {
+    thread->set_long_jump_base(NULL);
   }
 
   ~SuspendLongJumpScope() {
-    ASSERT(isolate()->long_jump_base() == NULL);
-    isolate()->set_long_jump_base(saved_long_jump_base_);
+    ASSERT(thread()->long_jump_base() == NULL);
+    thread()->set_long_jump_base(saved_long_jump_base_);
   }
 
  private:
@@ -84,6 +84,7 @@
   Thread* thread = Thread::Current();
   Zone* zone = thread->zone();
   Isolate* isolate = thread->isolate();
+  ASSERT(isolate->MutatorThreadIsCurrentThread());
   if (!function.HasCode()) {
     const Error& error = Error::Handle(
         zone, Compiler::CompileFunction(thread, function));
@@ -96,31 +97,21 @@
       StubCode::InvokeDartCode_entry()->EntryPoint());
   const Code& code = Code::Handle(zone, function.CurrentCode());
   ASSERT(!code.IsNull());
-  ASSERT(Isolate::Current()->no_callback_scope_depth() == 0);
+  ASSERT(thread->no_callback_scope_depth() == 0);
   ScopedIsolateStackLimits stack_limit(isolate);
-  SuspendLongJumpScope suspend_long_jump_scope(isolate);
+  SuspendLongJumpScope suspend_long_jump_scope(thread);
 #if defined(USING_SIMULATOR)
-#if defined(ARCH_IS_64_BIT)
-  // TODO(zra): Change to intptr_t so we have only one case.
-    return bit_copy<RawObject*, int64_t>(Simulator::Current()->Call(
-        reinterpret_cast<int64_t>(entrypoint),
-        static_cast<int64_t>(code.EntryPoint()),
-        reinterpret_cast<int64_t>(&arguments_descriptor),
-        reinterpret_cast<int64_t>(&arguments),
-        reinterpret_cast<int64_t>(thread)));
+  return bit_copy<RawObject*, int64_t>(Simulator::Current()->Call(
+      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 bit_copy<RawObject*, int64_t>(Simulator::Current()->Call(
-        reinterpret_cast<int32_t>(entrypoint),
-        static_cast<int32_t>(code.EntryPoint()),
-        reinterpret_cast<int32_t>(&arguments_descriptor),
-        reinterpret_cast<int32_t>(&arguments),
-        reinterpret_cast<int32_t>(thread)));
-#endif
-#else
-    return entrypoint(code.EntryPoint(),
-                      arguments_descriptor,
-                      arguments,
-                      thread);
+  return entrypoint(code,
+                    arguments_descriptor,
+                    arguments,
+                    thread);
 #endif
 }
 
@@ -239,9 +230,10 @@
   if (function.IsNull()) {
     ASSERT(!FLAG_lazy_dispatchers);
     // If noSuchMethod(invocation) is not found, call Object::noSuchMethod.
-    Isolate* isolate = Isolate::Current();
+    Thread* thread = Thread::Current();
     function ^= Resolver::ResolveDynamicForReceiverClass(
-        Class::Handle(isolate, isolate->object_store()->object_class()),
+        Class::Handle(thread->zone(),
+                      thread->isolate()->object_store()->object_class()),
         Symbols::NoSuchMethod(),
         args_desc);
   }
@@ -493,10 +485,9 @@
 
 
 RawObject* DartLibraryCalls::LookupHandler(Dart_Port port_id) {
-  Isolate* isolate = Isolate::Current();
-  Function& function =
-      Function::Handle(isolate,
-                       isolate->object_store()->lookup_port_handler());
+  Thread* thread = Thread::Current();
+  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());
@@ -511,7 +502,7 @@
                                        kNumArguments,
                                        Object::empty_array());
     ASSERT(!function.IsNull());
-    isolate->object_store()->set_lookup_port_handler(function);
+    thread->isolate()->object_store()->set_lookup_port_handler(function);
   }
   const Array& args = Array::Handle(Array::New(kNumArguments));
   args.SetAt(0, Integer::Handle(Integer::New(port_id)));
@@ -523,16 +514,18 @@
 
 RawObject* DartLibraryCalls::HandleMessage(const Object& handler,
                                            const Instance& message) {
-  Isolate* isolate = Isolate::Current();
-  Function& function = Function::Handle(isolate,
+  Thread* thread = Thread::Current();
+  Zone* zone = thread->zone();
+  Isolate* isolate = thread->isolate();
+  Function& function = Function::Handle(zone,
       isolate->object_store()->handle_message_function());
   const int kNumArguments = 2;
   if (function.IsNull()) {
-    Library& isolate_lib = Library::Handle(isolate, Library::IsolateLibrary());
+    Library& isolate_lib = Library::Handle(zone, Library::IsolateLibrary());
     ASSERT(!isolate_lib.IsNull());
-    const String& class_name = String::Handle(isolate,
+    const String& class_name = String::Handle(zone,
         isolate_lib.PrivateName(Symbols::_RawReceivePortImpl()));
-    const String& function_name = String::Handle(isolate,
+    const String& function_name = String::Handle(zone,
         isolate_lib.PrivateName(Symbols::_handleMessage()));
     function = Resolver::ResolveStatic(isolate_lib,
                                        class_name,
@@ -542,7 +535,7 @@
     ASSERT(!function.IsNull());
     isolate->object_store()->set_handle_message_function(function);
   }
-  const Array& args = Array::Handle(isolate, Array::New(kNumArguments));
+  const Array& args = Array::Handle(zone, Array::New(kNumArguments));
   args.SetAt(0, handler);
   args.SetAt(1, message);
   if (isolate->debugger()->IsStepping()) {
@@ -551,13 +544,27 @@
     // at the first location the user is interested in.
     isolate->debugger()->SetSingleStep();
   }
-  const Object& result = Object::Handle(isolate,
+  const Object& result = Object::Handle(zone,
       DartEntry::InvokeFunction(function, args));
   ASSERT(result.IsNull() || result.IsError());
   return result.raw();
 }
 
 
+RawObject* DartLibraryCalls::DrainMicrotaskQueue() {
+  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()));
+  ASSERT(result.IsNull() || result.IsError());
+  return result.raw();
+}
+
+
 RawObject* DartLibraryCalls::MapSetAt(const Instance& map,
                                       const Instance& key,
                                       const Instance& value) {
diff --git a/runtime/vm/dart_entry.h b/runtime/vm/dart_entry.h
index f88a416..0f9597f 100644
--- a/runtime/vm/dart_entry.h
+++ b/runtime/vm/dart_entry.h
@@ -60,6 +60,10 @@
   // Initialize the preallocated fixed length arguments descriptors cache.
   static void InitOnce();
 
+  enum {
+    kCachedDescriptorCount = 32
+  };
+
  private:
   // Absolute indexes into the array.
   enum {
@@ -75,10 +79,6 @@
     kNamedEntrySize,
   };
 
-  enum {
-    kCachedDescriptorCount = 32
-  };
-
   static intptr_t LengthFor(intptr_t count) {
     // Add 1 for the terminating null.
     return kFirstNamedEntryIndex + (kNamedEntrySize * count) + 1;
@@ -91,6 +91,8 @@
   // A cache of VM heap allocated arguments descriptors.
   static RawArray* cached_args_descriptors_[kCachedDescriptorCount];
 
+  friend class SnapshotReader;
+  friend class SnapshotWriter;
   DISALLOW_COPY_AND_ASSIGN(ArgumentsDescriptor);
 };
 
@@ -100,7 +102,7 @@
 class DartEntry : public AllStatic {
  public:
   // On success, returns a RawInstance.  On failure, a RawError.
-  typedef RawObject* (*invokestub)(uword entry_point,
+  typedef RawObject* (*invokestub)(const Code& target_code,
                                    const Array& arguments_descriptor,
                                    const Array& arguments,
                                    Thread* thread);
@@ -163,6 +165,9 @@
   static RawObject* HandleMessage(const Object& handler,
                                   const Instance& dart_message);
 
+  // Returns null on success, a RawError on failure.
+  static RawObject* DrainMicrotaskQueue();
+
   // map[key] = value;
   //
   // Returns null on success, a RawError on failure.
diff --git a/runtime/vm/datastream.h b/runtime/vm/datastream.h
index bb46e4f..f47e822 100644
--- a/runtime/vm/datastream.h
+++ b/runtime/vm/datastream.h
@@ -10,6 +10,7 @@
 #include "vm/allocation.h"
 #include "vm/exceptions.h"
 #include "vm/globals.h"
+#include "vm/os.h"
 
 namespace dart {
 
@@ -386,6 +387,12 @@
     current_ += len;
   }
 
+  void Print(const char* format, ...) {
+    va_list args;
+    va_start(args, format);
+    VPrint(format, args);
+  }
+
  private:
   template<typename T>
   void Write(T value) {
@@ -426,6 +433,28 @@
     ASSERT(end_ > *buffer_);
   }
 
+  void VPrint(const char* format, va_list args) {
+    // Measure.
+    va_list measure_args;
+    va_copy(measure_args, args);
+    intptr_t len = OS::VSNPrint(NULL, 0, format, measure_args);
+    va_end(measure_args);
+
+    // Alloc.
+    if ((end_ - current_) < (len + 1)) {
+      Resize(len + 1);
+    }
+    ASSERT((end_ - current_) >= (len + 1));
+
+    // Print.
+    va_list print_args;
+    va_copy(print_args, 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.
+  }
+
  private:
   uint8_t** const buffer_;
   uint8_t* end_;
diff --git a/runtime/vm/debugger.cc b/runtime/vm/debugger.cc
index 5573f4b..3434e01 100644
--- a/runtime/vm/debugger.cc
+++ b/runtime/vm/debugger.cc
@@ -15,6 +15,7 @@
 #include "vm/globals.h"
 #include "vm/longjump.h"
 #include "vm/json_stream.h"
+#include "vm/message_handler.h"
 #include "vm/object.h"
 #include "vm/object_store.h"
 #include "vm/os.h"
@@ -42,6 +43,8 @@
             "handler instead.  This handler dispatches breakpoints to "
             "the VM service.");
 
+DECLARE_FLAG(bool, trace_isolates);
+
 
 Debugger::EventHandler* Debugger::event_handler_ = NULL;
 
@@ -65,7 +68,9 @@
 // Create an unresolved breakpoint in given token range and script.
 BreakpointLocation::BreakpointLocation(const Script& script,
                                        intptr_t token_pos,
-                                       intptr_t end_token_pos)
+                                       intptr_t end_token_pos,
+                                       intptr_t requested_line_number,
+                                       intptr_t requested_column_number)
     : script_(script.raw()),
       url_(script.url()),
       token_pos_(token_pos),
@@ -73,15 +78,19 @@
       is_resolved_(false),
       next_(NULL),
       conditions_(NULL),
+      requested_line_number_(requested_line_number),
+      requested_column_number_(requested_column_number),
       function_(Function::null()),
-      line_number_(-1) {
+      line_number_(-1),
+      column_number_(-1) {
   ASSERT(!script.IsNull());
   ASSERT(token_pos_ >= 0);
 }
 
 // Create a latent breakpoint at given url and line number.
 BreakpointLocation::BreakpointLocation(const String& url,
-                                       intptr_t line_number)
+                                       intptr_t requested_line_number,
+                                       intptr_t requested_column_number)
     : script_(Script::null()),
       url_(url.raw()),
       token_pos_(-1),
@@ -89,9 +98,12 @@
       is_resolved_(false),
       next_(NULL),
       conditions_(NULL),
+      requested_line_number_(requested_line_number),
+      requested_column_number_(requested_column_number),
       function_(Function::null()),
-      line_number_(line_number) {
-  ASSERT(line_number_ >= 0);
+      line_number_(-1),
+      column_number_(-1) {
+  ASSERT(requested_line_number_ >= 0);
 }
 
 
@@ -119,7 +131,6 @@
   function_ = func.raw();
   token_pos_ = token_pos;
   end_token_pos_ = token_pos;
-  line_number_ = -1;  // Recalculate lazily.
   is_resolved_ = true;
 }
 
@@ -129,7 +140,7 @@
 // in more than one library, e.g. the text location of mixin functions.
 void BreakpointLocation::GetCodeLocation(Library* lib,
                                          Script* script,
-                                         intptr_t* pos) {
+                                         intptr_t* pos) const {
   if (IsLatent()) {
     *lib = Library::null();
     *script = Script::null();
@@ -150,8 +161,7 @@
 
 
 intptr_t BreakpointLocation::LineNumber() {
-  // Latent breakpoints must have a requested line number >= 0.
-  ASSERT(!IsLatent() || line_number_ >= 0);
+  ASSERT(IsResolved());
   // Compute line number lazily since it causes scanning of the script.
   if (line_number_ < 0) {
     const Script& script = Script::Handle(this->script());
@@ -161,6 +171,17 @@
 }
 
 
+intptr_t BreakpointLocation::ColumnNumber() {
+  ASSERT(IsResolved());
+  // Compute column number lazily since it causes scanning of the script.
+  if (column_number_ < 0) {
+    const Script& script = Script::Handle(this->script());
+    script.GetTokenLocation(token_pos_, &line_number_, &column_number_);
+  }
+  return column_number_;
+}
+
+
 void Breakpoint::set_bpt_location(BreakpointLocation* new_bpt_location) {
   ASSERT(bpt_location_->IsLatent());  // Only reason to move.
   bpt_location_ = new_bpt_location;
@@ -186,25 +207,23 @@
 
 
 void Breakpoint::PrintJSON(JSONStream* stream) {
-  Isolate* isolate = Isolate::Current();
-
   JSONObject jsobj(stream);
   jsobj.AddProperty("type", "Breakpoint");
 
   jsobj.AddFixedServiceId("breakpoints/%" Pd "", id());
   jsobj.AddProperty("breakpointNumber", id());
   jsobj.AddProperty("resolved", bpt_location_->IsResolved());
-
-  Library& library = Library::Handle(isolate);
-  Script& script = Script::Handle(isolate);
-  intptr_t token_pos;
-  bpt_location_->GetCodeLocation(&library, &script, &token_pos);
-  jsobj.AddLocation(script, token_pos);
+  if (bpt_location_->IsResolved()) {
+    jsobj.AddLocation(bpt_location_);
+  } else {
+    jsobj.AddUnresolvedLocation(bpt_location_);
+  }
 }
 
 
 void CodeBreakpoint::VisitObjectPointers(ObjectPointerVisitor* visitor) {
   visitor->VisitPointer(reinterpret_cast<RawObject**>(&code_));
+  visitor->VisitPointer(reinterpret_cast<RawObject**>(&saved_value_));
 }
 
 
@@ -234,6 +253,11 @@
 }
 
 
+void DebuggerEvent::UpdateTimestamp() {
+  timestamp_ = OS::GetCurrentTimeMillis();
+}
+
+
 bool Debugger::HasEventHandler() {
   return ((event_handler_ != NULL) ||
           Service::isolate_stream.enabled() ||
@@ -286,9 +310,16 @@
 
   if (ServiceNeedsDebuggerEvent(event->type()) && event->IsPauseEvent()) {
     // If we were paused, notify the service that we have resumed.
-    ServiceEvent service_event(event->isolate(), ServiceEvent::kResume);
-    service_event.set_top_frame(event->top_frame());
-    Service::HandleEvent(&service_event);
+    const Error& error = Error::Handle(zone(),
+        isolate_->object_store()->sticky_error());
+    ASSERT(error.IsNull() || error.IsUnwindError());
+
+    // Only send a resume event when the isolate is not unwinding.
+    if (!error.IsUnwindError()) {
+      ServiceEvent service_event(event->isolate(), ServiceEvent::kResume);
+      service_event.set_top_frame(event->top_frame());
+      Service::HandleEvent(&service_event);
+    }
   }
 }
 
@@ -299,8 +330,9 @@
     ASSERT(event.isolate_id() != ILLEGAL_ISOLATE_ID);
     if (type == DebuggerEvent::kIsolateInterrupted) {
       DebuggerStackTrace* trace = CollectStackTrace();
-      ASSERT(trace->Length() > 0);
-      event.set_top_frame(trace->FrameAt(0));
+      if (trace->Length() > 0) {
+        event.set_top_frame(trace->FrameAt(0));
+      }
       ASSERT(stack_trace_ == NULL);
       stack_trace_ = trace;
       resume_action_ = kContinue;
@@ -314,11 +346,29 @@
 }
 
 
-void Debugger::SignalIsolateInterrupted() {
+RawError* Debugger::SignalIsolateInterrupted() {
   if (HasEventHandler()) {
-    Debugger* debugger = Isolate::Current()->debugger();
-    debugger->SignalIsolateEvent(DebuggerEvent::kIsolateInterrupted);
+    SignalIsolateEvent(DebuggerEvent::kIsolateInterrupted);
   }
+  Dart_IsolateInterruptCallback callback = isolate_->InterruptCallback();
+  if (callback != NULL) {
+    if (!(*callback)()) {
+      if (FLAG_trace_isolates) {
+        OS::Print("[!] Embedder api: terminating isolate:\n"
+                  "\tisolate:    %s\n", isolate_->name());
+      }
+      const String& msg =
+          String::Handle(String::New("isolate terminated by embedder"));
+      return UnwindError::New(msg);
+    }
+  }
+
+  // If any error occurred while in the debug message loop, return it here.
+  const Error& error =
+      Error::Handle(zone(), isolate_->object_store()->sticky_error());
+  ASSERT(error.IsNull() || error.IsUnwindError());
+  isolate_->object_store()->clear_sticky_error();
+  return error.raw();
 }
 
 
@@ -398,18 +448,10 @@
   Class& func_class = Class::Handle(func.Owner());
   String& class_name = String::Handle(func_class.Name());
 
-  const char* kFormat = "%s%s%s";
-  intptr_t len = OS::SNPrint(NULL, 0, kFormat,
-      func_class.IsTopLevel() ? "" : class_name.ToCString(),
-      func_class.IsTopLevel() ? "" : ".",
-      func_name.ToCString());
-  len++;  // String terminator.
-  char* chars = Thread::Current()->zone()->Alloc<char>(len);
-  OS::SNPrint(chars, len, kFormat,
-              func_class.IsTopLevel() ? "" : class_name.ToCString(),
+  return OS::SCreate(Thread::Current()->zone(),
+    "%s%s%s", func_class.IsTopLevel() ? "" : class_name.ToCString(),
               func_class.IsTopLevel() ? "" : ".",
               func_name.ToCString());
-  return chars;
 }
 
 
@@ -432,7 +474,7 @@
     // is a user-defined breakpoint that falls into the token
     // range of the function. This may be a false positive: the breakpoint
     // might be inside a local closure.
-    Script& script = Script::Handle(isolate_);
+    Script& script = Script::Handle(zone());
     BreakpointLocation* sbpt = breakpoint_locations_;
     while (sbpt != NULL) {
       script = sbpt->script();
@@ -662,7 +704,6 @@
       return ctx_;
     }
   }
-  UNREACHABLE();
   return Context::ZoneHandle(Context::null());
 }
 
@@ -673,9 +714,14 @@
   for (intptr_t i = 0; i < var_desc_len; i++) {
     RawLocalVarDescriptors::VarInfo var_info;
     var_descriptors_.GetInfo(i, &var_info);
-    const int8_t kind = var_info.kind();
-    if (kind == RawLocalVarDescriptors::kAsyncOperation) {
-      return GetContextVar(var_info.scope_id, var_info.index());
+    if (var_descriptors_.GetName(i) == Symbols::AsyncOperation().raw()) {
+      const int8_t kind = var_info.kind();
+      if (kind == RawLocalVarDescriptors::kStackVar) {
+        return GetStackVar(var_info.index());
+      } else {
+        ASSERT(kind == RawLocalVarDescriptors::kContextVar);
+        return GetContextVar(var_info.scope_id, var_info.index());
+      }
     }
   }
   return Object::null();
@@ -896,8 +942,7 @@
   intptr_t desc_index = desc_indices_[i];
   ASSERT(name != NULL);
 
-  const String& tmp = String::Handle(var_descriptors_.GetName(desc_index));
-  *name ^= String::IdentifierPrettyName(tmp);
+  *name = var_descriptors_.GetName(desc_index);
 
   RawLocalVarDescriptors::VarInfo var_info;
   var_descriptors_.GetInfo(desc_index, &var_info);
@@ -983,6 +1028,11 @@
 }
 
 
+bool IsPrivateVariableName(const String& var_name) {
+  return (var_name.Length() >= 1) && (var_name.CharAt(0) == '_');
+}
+
+
 RawObject* ActivationFrame::Evaluate(const String& expr) {
   GetDescIndices();
   const GrowableObjectArray& param_names =
@@ -996,6 +1046,9 @@
     intptr_t ignore;
     VariableAt(i, &name, &ignore, &ignore, &value);
     if (!name.Equals(Symbols::This())) {
+      if (IsPrivateVariableName(name)) {
+        name = String::IdentifierPrettyName(name);
+      }
       param_names.Add(name);
       param_values.Add(value);
     }
@@ -1059,19 +1112,22 @@
     JSONArray jsvars(jsobj, "vars");
     const int num_vars = NumLocalVariables();
     for (intptr_t v = 0; v < num_vars; v++) {
-      JSONObject jsvar(&jsvars);
       String& var_name = String::Handle();
       Instance& var_value = Instance::Handle();
       intptr_t token_pos;
       intptr_t end_token_pos;
       VariableAt(v, &var_name, &token_pos, &end_token_pos, &var_value);
-      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);
+      if (var_name.raw() != Symbols::AsyncOperation().raw()) {
+        JSONObject jsvar(&jsvars);
+        jsvar.AddProperty("type", "BoundVariable");
+        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);
+      }
     }
   }
 }
@@ -1102,7 +1158,7 @@
       bpt_location_(NULL),
       next_(NULL),
       breakpoint_kind_(kind),
-      saved_value_(0) {
+      saved_value_(Code::null()) {
   ASSERT(!code.IsNull());
   ASSERT(token_pos_ > 0);
   ASSERT(pc_ != 0);
@@ -1377,21 +1433,23 @@
 }
 
 
-RawArray* Debugger::DeoptimizeToArray(Isolate* isolate,
+RawArray* Debugger::DeoptimizeToArray(Thread* thread,
                                       StackFrame* frame,
                                       const Code& code) {
   ASSERT(code.is_optimized());
-
+  Isolate* isolate = thread->isolate();
   // Create the DeoptContext for this deoptimization.
   DeoptContext* deopt_context =
       new DeoptContext(frame, code,
                        DeoptContext::kDestIsAllocated,
-                       NULL, NULL);
+                       NULL,
+                       NULL,
+                       true);
   isolate->set_deopt_context(deopt_context);
 
   deopt_context->FillDestFrame();
   deopt_context->MaterializeDeferredObjects();
-  const Array& dest_frame = Array::Handle(isolate,
+  const Array& dest_frame = Array::Handle(thread->zone(),
                                           deopt_context->DestFrameAsArray());
 
   isolate->set_deopt_context(NULL);
@@ -1402,12 +1460,14 @@
 
 
 DebuggerStackTrace* Debugger::CollectStackTrace() {
-  Isolate* isolate = Isolate::Current();
+  Thread* thread = Thread::Current();
+  Zone* zone = thread->zone();
+  Isolate* isolate = thread->isolate();
   DebuggerStackTrace* stack_trace = new DebuggerStackTrace(8);
   StackFrameIterator iterator(false);
-  Code& code = Code::Handle(isolate);
-  Code& inlined_code = Code::Handle(isolate);
-  Array& deopt_frame = Array::Handle(isolate);
+  Code& code = Code::Handle(zone);
+  Code& inlined_code = Code::Handle(zone);
+  Array& deopt_frame = Array::Handle(zone);
 
   for (StackFrame* frame = iterator.NextFrame();
        frame != NULL;
@@ -1420,14 +1480,14 @@
     if (frame->IsDartFrame()) {
       code = frame->LookupDartCode();
       if (code.is_optimized() && !Compiler::always_optimize()) {
-        deopt_frame = DeoptimizeToArray(isolate, frame, code);
+        deopt_frame = DeoptimizeToArray(thread, frame, code);
         for (InlinedFunctionsIterator it(code, frame->pc());
              !it.Done();
              it.Advance()) {
           inlined_code = it.code();
           if (FLAG_trace_debugger_stacktrace) {
             const Function& function =
-                Function::Handle(isolate, inlined_code.function());
+                Function::Handle(zone, inlined_code.function());
             ASSERT(!function.IsNull());
             OS::PrintErr("CollectStackTrace: visiting inlined function: %s\n",
                          function.ToFullyQualifiedCString());
@@ -1460,7 +1520,7 @@
   while ((frame != NULL) && !frame->IsDartFrame()) {
     frame = iterator.NextFrame();
   }
-  Code& code = Code::Handle(isolate_, frame->LookupDartCode());
+  Code& code = Code::Handle(zone(), frame->LookupDartCode());
   ActivationFrame* activation =
       new ActivationFrame(frame->pc(), frame->fp(), frame->sp(), code,
                           Object::null_array(), 0);
@@ -1597,13 +1657,66 @@
 }
 
 
-// Given a function and a token range, return the best fit
-// token position to set a breakpoint. The best fit is the safe point
-// in the line closest to the beginning of the token range, and within
-// that line, the safe point with the lowest compiled code address.
+// Returns the best fit token position for a breakpoint.
+//
+// Takes a range of tokens [requested_token_pos, last_token_pos] and
+// an optional column (requested_column).  The range of tokens usually
+// represents one line of the program text, but can represent a larger
+// range on recursive calls.
+//
+// The best fit is found in two passes.
+//
+// The first pass finds a candidate token which:
+//
+//   - is a safepoint,
+//   - has the lowest column number compatible with the requested column
+//     if a column has been specified,
+// and:
+//   - has the lowest token position number which satisfies the above.
+//
+// When we consider a column number, we look for the closed token
+// which intersects the desired column.  For example:
+//
+//          1         2         3
+// 12345678901234567890         0
+//
+//   var x = function(function(y));
+//              ^
+//
+// If we request a breakpoint at column 14, the lowest column number
+// compatible with that would for column 11 (beginning of the
+// 'function' token) in the example above.
+//
+// Once this candidate token from the first pass is found, we then
+// have a second pass which considers only those tokens on the same
+// line as the candidate token.
+//
+// The second pass finds a best fit token which:
+//
+//   - is a safepoint,
+//   - has the same column number as the candidate token (perhaps
+//     more than one token has the same column number),
+// and:
+//   - has the lowest code address in the generated code.
+//
+// We prefer the lowest compiled code address, because this tends to
+// select the first subexpression on a line.  For example in a line
+// with nested function calls f(g(x)), the call to g() will have a
+// lower compiled code address than the call to f().
+//
+// If no best fit token can be found, the search is expanded,
+// searching through the rest of the current function by calling this
+// function recursively.
+//
+// TODO(turnidge): Given that we usually call this function with a
+// token range restricted to a single line, this could be a one-pass
+// 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.
 intptr_t Debugger::ResolveBreakpointPos(const Function& func,
                                         intptr_t requested_token_pos,
-                                        intptr_t last_token_pos) {
+                                        intptr_t last_token_pos,
+                                        intptr_t requested_column) {
   ASSERT(func.HasCode());
   ASSERT(!func.HasOptimizedCode());
 
@@ -1614,6 +1727,7 @@
     last_token_pos = func.end_token_pos();
   }
 
+  Script& script = Script::Handle(func.script());
   Code& code = Code::Handle(func.unoptimized_code());
   ASSERT(!code.IsNull());
   PcDescriptors& desc = PcDescriptors::Handle(code.pc_descriptors());
@@ -1621,22 +1735,47 @@
   // First pass: find the safe point which is closest to the beginning
   // of the given token range.
   intptr_t best_fit_pos = INT_MAX;
+  intptr_t best_column = INT_MAX;
   PcDescriptors::Iterator iter(desc, kSafepointKind);
   while (iter.MoveNext()) {
-    const intptr_t desc_token_pos = iter.TokenPos();
-    if ((desc_token_pos != Scanner::kNoSourcePos) &&
-        (desc_token_pos < best_fit_pos) &&
-        (desc_token_pos >= requested_token_pos) &&
-        (desc_token_pos <= last_token_pos)) {
-       best_fit_pos = desc_token_pos;
+    const intptr_t pos = iter.TokenPos();
+    if ((pos == Scanner::kNoSourcePos) ||
+        (pos < requested_token_pos) ||
+        (pos > last_token_pos)) {
+      // Token is not in the target range.
+      continue;
+    }
+
+    intptr_t token_start_column = -1;
+    if (requested_column >= 0) {
+      intptr_t ignored = -1;
+      intptr_t token_len = -1;
+      // TODO(turnidge): GetTokenLocation is a very expensive
+      // operation, and this code will blow up when we are setting
+      // column breakpoints on, for example, a large, single-line
+      // program.  Consider rewriting this code so that it only scans
+      // the program code once and caches the token positions and
+      // lengths.
+      script.GetTokenLocation(pos, &ignored, &token_start_column, &token_len);
+      intptr_t token_end_column = token_start_column + token_len - 1;
+      if ((token_end_column < requested_column) ||
+          (token_start_column > best_column)) {
+        // Prefer the token with the lowest column number compatible
+        // with the requested column.
+        continue;
+      }
+    }
+
+    // Prefer the lowest (first) token pos.
+    if (pos < best_fit_pos) {
+      best_fit_pos = pos;
+      best_column = token_start_column;
     }
   }
-  // Second pass (if we found a safe point in the first pass):
-  // For all token positions on the same line, select the one
-  // with the lowest compiled code address. E.g., in a line with
-  // the nested function calls f(g(x)), the call g() will have a lower
-  // compiled code address but is not the lowest token position in the
-  // line.
+
+  // Second pass (if we found a safe point in the first pass).  Find
+  // the token on the line which is at the best fit column (if column
+  // was specified) and has the lowest code address.
   if (best_fit_pos != INT_MAX) {
     const Script& script = Script::Handle(func.script());
     const TokenStream& tokens = TokenStream::Handle(script.tokens());
@@ -1646,9 +1785,26 @@
     PcDescriptors::Iterator iter(desc, kSafepointKind);
     while (iter.MoveNext()) {
       const intptr_t pos = iter.TokenPos();
-      if ((pos != Scanner::kNoSourcePos) &&
-          (begin_pos <= pos) && (pos <= end_of_line_pos) &&
-          (iter.PcOffset() < lowest_pc_offset)) {
+      if ((pos == Scanner::kNoSourcePos) ||
+          (pos < begin_pos) ||
+          (pos > end_of_line_pos)) {
+        // Token is not on same line as best fit.
+        continue;
+      }
+
+      if (requested_column >= 0) {
+        intptr_t ignored = -1;
+        intptr_t token_start_column = -1;
+        // We look for other tokens at the best column in case there
+        // is more than one token at the same column offset.
+        script.GetTokenLocation(pos, &ignored, &token_start_column);
+        if (token_start_column != best_column) {
+          continue;
+        }
+      }
+
+      // Prefer the lowest pc offset.
+      if (iter.PcOffset() < lowest_pc_offset) {
         lowest_pc_offset = iter.PcOffset();
         best_fit_pos = pos;
       }
@@ -1656,10 +1812,13 @@
     return best_fit_pos;
   }
 
-  // We didn't find a safe point in the given token range. Try and find
-  // a safe point in the remaining source code of the function.
+  // We didn't find a safe point in the given token range. Try and
+  // find a safe point in the remaining source code of the function.
+  // Since we have moved to the next line of the function, we no
+  // longer are requesting a specific column number.
   if (last_token_pos < func.end_token_pos()) {
-    return ResolveBreakpointPos(func, last_token_pos, func.end_token_pos());
+    return ResolveBreakpointPos(func, last_token_pos, func.end_token_pos(),
+                                -1 /* no column */);
   }
   return -1;
 }
@@ -1708,10 +1867,11 @@
                                      intptr_t start_pos,
                                      intptr_t end_pos,
                                      GrowableObjectArray* function_list) {
-  Class& cls = Class::Handle(isolate_);
-  Array& functions = Array::Handle(isolate_);
-  GrowableObjectArray& closures = GrowableObjectArray::Handle(isolate_);
-  Function& function = Function::Handle(isolate_);
+  Zone* zn = zone();
+  Class& cls = Class::Handle(zn);
+  Array& functions = Array::Handle(zn);
+  GrowableObjectArray& closures = GrowableObjectArray::Handle(zn);
+  Function& function = Function::Handle(zn);
 
   const ClassTable& class_table = *isolate_->class_table();
   const intptr_t num_classes = class_table.NumCids();
@@ -1791,12 +1951,13 @@
 
 RawFunction* Debugger::FindBestFit(const Script& script,
                                    intptr_t token_pos) {
-  Class& cls = Class::Handle(isolate_);
-  Array& functions = Array::Handle(isolate_);
-  GrowableObjectArray& closures = GrowableObjectArray::Handle(isolate_);
-  Function& function = Function::Handle(isolate_);
-  Function& best_fit = Function::Handle(isolate_);
-  Error& error = Error::Handle(isolate_);
+  Zone* zn = zone();
+  Class& cls = Class::Handle(zn);
+  Array& functions = Array::Handle(zn);
+  GrowableObjectArray& closures = GrowableObjectArray::Handle(zn);
+  Function& function = Function::Handle(zn);
+  Function& best_fit = Function::Handle(zn);
+  Error& error = Error::Handle(zn);
 
   const ClassTable& class_table = *isolate_->class_table();
   const intptr_t num_classes = class_table.NumCids();
@@ -1813,7 +1974,7 @@
         continue;
       }
       // Parse class definition if not done yet.
-      error = cls.EnsureIsFinalized(isolate_);
+      error = cls.EnsureIsFinalized(Thread::Current());
       if (!error.IsNull()) {
         // Ignore functions in this class.
         // TODO(hausner): Should we propagate this error? How?
@@ -1852,8 +2013,10 @@
 
 BreakpointLocation* Debugger::SetBreakpoint(const Script& script,
                                             intptr_t token_pos,
-                                            intptr_t last_token_pos) {
-  Function& func = Function::Handle(isolate_);
+                                            intptr_t last_token_pos,
+                                            intptr_t requested_line,
+                                            intptr_t requested_column) {
+  Function& func = Function::Handle(zone());
   func = FindBestFit(script, token_pos);
   if (func.IsNull()) {
     return NULL;
@@ -1876,14 +2039,16 @@
     DeoptimizeWorld();
     func ^= functions.At(0);
     intptr_t breakpoint_pos =
-        ResolveBreakpointPos(func, token_pos, last_token_pos);
+        ResolveBreakpointPos(func, token_pos, last_token_pos, requested_column);
     if (breakpoint_pos >= 0) {
-      BreakpointLocation* bpt = GetBreakpointLocation(script, breakpoint_pos);
+      BreakpointLocation* bpt =
+          GetBreakpointLocation(script, breakpoint_pos, requested_column);
       if (bpt != NULL) {
         // A source breakpoint for this location already exists.
         return bpt;
       }
-      bpt = new BreakpointLocation(script, token_pos, last_token_pos);
+      bpt = new BreakpointLocation(script, token_pos, last_token_pos,
+                                   requested_line, requested_column);
       bpt->SetResolved(func, breakpoint_pos);
       RegisterBreakpointLocation(bpt);
 
@@ -1896,11 +2061,12 @@
       }
       if (FLAG_verbose_debug) {
         intptr_t line_number;
-        script.GetTokenLocation(breakpoint_pos, &line_number, NULL);
+        intptr_t column_number;
+        script.GetTokenLocation(breakpoint_pos, &line_number, &column_number);
         OS::Print("Resolved BP for "
-                  "function '%s' at line %" Pd "\n",
+                  "function '%s' at line %" Pd " col %" Pd "\n",
                   func.ToFullyQualifiedCString(),
-                  line_number);
+                  line_number, column_number);
       }
       return bpt;
     }
@@ -1909,15 +2075,18 @@
   // Register an unresolved breakpoint.
   if (FLAG_verbose_debug && !func.IsNull()) {
     intptr_t line_number;
-    script.GetTokenLocation(token_pos, &line_number, NULL);
+    intptr_t column_number;
+    script.GetTokenLocation(token_pos, &line_number, &column_number);
     OS::Print("Registering pending breakpoint for "
-              "uncompiled function '%s' at line %" Pd "\n",
+              "uncompiled function '%s' at line %" Pd " col %" Pd "\n",
               func.ToFullyQualifiedCString(),
-              line_number);
+              line_number, column_number);
   }
-  BreakpointLocation* bpt = GetBreakpointLocation(script, token_pos);
+  BreakpointLocation* bpt =
+      GetBreakpointLocation(script, token_pos, requested_column);
   if (bpt == NULL) {
-    bpt = new BreakpointLocation(script, token_pos, last_token_pos);
+    bpt = new BreakpointLocation(script, token_pos, last_token_pos,
+                                 requested_line, requested_column);
     RegisterBreakpointLocation(bpt);
   }
   return bpt;
@@ -1964,7 +2133,8 @@
   BreakpointLocation* bpt_location =
       SetBreakpoint(script,
                     target_function.token_pos(),
-                    target_function.end_token_pos());
+                    target_function.end_token_pos(),
+                    -1, -1 /* no requested line/col */);
   if (single_shot) {
     return bpt_location->AddSingleShot(this);
   } else {
@@ -1981,7 +2151,8 @@
   const Script& script = Script::Handle(func.script());
   BreakpointLocation* bpt_location = SetBreakpoint(script,
                                                    func.token_pos(),
-                                                   func.end_token_pos());
+                                                   func.end_token_pos(),
+                                                   -1, -1 /* no line/col */);
   return bpt_location->AddPerClosure(this, closure);
 }
 
@@ -2011,7 +2182,8 @@
 
 Breakpoint* Debugger::SetBreakpointAtLine(const String& script_url,
                                           intptr_t line_number) {
-  BreakpointLocation* loc = BreakpointLocationAtLine(script_url, line_number);
+  BreakpointLocation* loc =
+      BreakpointLocationAtLineCol(script_url, line_number, -1 /* no column */);
   if (loc != NULL) {
     return loc->AddRepeated(this);
   }
@@ -2019,14 +2191,29 @@
 }
 
 
-BreakpointLocation* Debugger::BreakpointLocationAtLine(const String& script_url,
-                                                       intptr_t line_number) {
-  Library& lib = Library::Handle(isolate_);
-  Script& script = Script::Handle(isolate_);
+Breakpoint* Debugger::SetBreakpointAtLineCol(const String& script_url,
+                                             intptr_t line_number,
+                                             intptr_t column_number) {
+  BreakpointLocation* loc = BreakpointLocationAtLineCol(script_url,
+                                                        line_number,
+                                                        column_number);
+  if (loc != NULL) {
+    return loc->AddRepeated(this);
+  }
+  return NULL;
+}
+
+
+BreakpointLocation* Debugger::BreakpointLocationAtLineCol(
+    const String& script_url,
+    intptr_t line_number,
+    intptr_t column_number) {
+  Library& lib = Library::Handle(zone());
+  Script& script = Script::Handle(zone());
   const GrowableObjectArray& libs =
       GrowableObjectArray::Handle(isolate_->object_store()->libraries());
   const GrowableObjectArray& scripts =
-    GrowableObjectArray::Handle(isolate_, 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);
@@ -2038,11 +2225,13 @@
     // 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);
+                                                         line_number,
+                                                         column_number);
     if (FLAG_verbose_debug) {
-      OS::Print("Set latent breakpoint in url '%s' at line %" Pd "\n",
+      OS::Print("Set latent breakpoint in url '%s' at "
+                "line %" Pd " col %" Pd "\n",
                 script_url.ToCString(),
-                line_number);
+                line_number, column_number);
     }
     return latent_bpt;
   }
@@ -2074,7 +2263,8 @@
   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);
+    bpt = SetBreakpoint(script, first_token_idx, last_token_idx,
+                        line_number, column_number);
     first_token_idx++;
   }
   if ((bpt == NULL) && FLAG_verbose_debug) {
@@ -2133,7 +2323,7 @@
   const Field& fld = Field::Handle(cls.LookupStaticField(field_name));
   if (!fld.IsNull()) {
     // Return the value in the field if it has been initialized already.
-    const Instance& value = Instance::Handle(fld.value());
+    const Instance& value = Instance::Handle(fld.StaticValue());
     ASSERT(value.raw() != Object::transition_sentinel().raw());
     if (value.raw() != Object::sentinel().raw()) {
       return value.raw();
@@ -2213,10 +2403,10 @@
                                     const String& prefix,
                                     bool include_private_fields) {
   DictionaryIterator it(lib);
-  Object& entry = Object::Handle(isolate_);
-  Field& field = Field::Handle(isolate_);
-  String& field_name = String::Handle(isolate_);
-  PassiveObject& field_value = PassiveObject::Handle(isolate_);
+  Object& entry = Object::Handle(isolate_->current_zone());
+  Field& field = Field::Handle(zone());
+  String& field_name = String::Handle(zone());
+  PassiveObject& field_value = PassiveObject::Handle(isolate_->current_zone());
   while (it.HasNext()) {
     entry = it.GetNext();
     if (entry.IsField()) {
@@ -2230,11 +2420,11 @@
       // If the field is not initialized yet, report the value to be
       // "<not initialized>". We don't want to execute the implicit getter
       // since it may have side effects.
-      if ((field.value() == Object::sentinel().raw()) ||
-          (field.value() == Object::transition_sentinel().raw())) {
+      if ((field.StaticValue() == Object::sentinel().raw()) ||
+          (field.StaticValue() == Object::transition_sentinel().raw())) {
         field_value = Symbols::NotInitialized().raw();
       } else {
-        field_value = field.value();
+        field_value = field.StaticValue();
       }
       if (!prefix.IsNull()) {
         field_name = String::Concat(prefix, field_name);
@@ -2249,7 +2439,7 @@
 RawArray* Debugger::GetLibraryFields(const Library& lib) {
   const GrowableObjectArray& field_list =
       GrowableObjectArray::Handle(GrowableObjectArray::New(8));
-  CollectLibraryFields(field_list, lib, String::Handle(isolate_), true);
+  CollectLibraryFields(field_list, lib, String::Handle(zone()), true);
   return Array::MakeArray(field_list);
 }
 
@@ -2257,16 +2447,16 @@
 RawArray* Debugger::GetGlobalFields(const Library& lib) {
   const GrowableObjectArray& field_list =
       GrowableObjectArray::Handle(GrowableObjectArray::New(8));
-  String& prefix_name = String::Handle(isolate_);
+  String& prefix_name = String::Handle(zone());
   CollectLibraryFields(field_list, lib, prefix_name, true);
-  Library& imported = Library::Handle(isolate_);
+  Library& imported = Library::Handle(zone());
   intptr_t num_imports = lib.num_imports();
   for (intptr_t i = 0; i < num_imports; i++) {
     imported = lib.ImportLibraryAt(i);
     ASSERT(!imported.IsNull());
     CollectLibraryFields(field_list, imported, prefix_name, false);
   }
-  LibraryPrefix& prefix = LibraryPrefix::Handle(isolate_);
+  LibraryPrefix& prefix = LibraryPrefix::Handle(zone());
   LibraryPrefixIterator it(lib);
   while (it.HasNext()) {
     prefix = it.GetNext();
@@ -2314,6 +2504,7 @@
   ASSERT(obj_cache_ == NULL);
 
   pause_event_ = event;
+  pause_event_->UpdateTimestamp();
   obj_cache_ = new RemoteObjectCache(64);
 
   InvokeEventHandler(event);
@@ -2395,18 +2586,32 @@
   event.set_top_frame(top_frame);
   event.set_breakpoint(bpt);
   Object& closure_or_null = Object::Handle(top_frame->GetAsyncOperation());
-  event.set_async_continuation(&closure_or_null);
+  if (!closure_or_null.IsNull()) {
+    ASSERT(closure_or_null.IsInstance());
+    ASSERT(Instance::Cast(closure_or_null).IsClosure());
+    event.set_async_continuation(&closure_or_null);
+    const Script& script = Script::Handle(top_frame->SourceScript());
+    const TokenStream& tokens = TokenStream::Handle(script.tokens());
+    TokenStream::Iterator iter(tokens, top_frame->TokenPos());
+    if ((iter.CurrentTokenKind() == Token::kIDENT) &&
+        ((iter.CurrentLiteral() == Symbols::Await().raw()) ||
+         (iter.CurrentLiteral() == Symbols::YieldKw().raw()))) {
+      event.set_at_async_jump(true);
+    }
+  }
   Pause(&event);
 }
 
 
-void Debugger::DebuggerStepCallback() {
+RawError* Debugger::DebuggerStepCallback() {
   ASSERT(isolate_->single_step());
   // We can't get here unless the debugger event handler enabled
   // single stepping.
   ASSERT(HasEventHandler());
   // Don't pause recursively.
-  if (IsPaused()) return;
+  if (IsPaused()) {
+    return Error::null();
+  }
 
   // Check whether we are in a Dart function that the user is
   // interested in. If we saved the frame pointer of a stack frame
@@ -2422,7 +2627,7 @@
     if (stepping_fp_ > frame->fp()) {
       // We are in a callee of the frame we're interested in.
       // Ignore this stepping break.
-      return;
+      return Error::null();
     } else if (frame->fp() > stepping_fp_) {
       // We returned from the "interesting frame", there can be no more
       // stepping breaks for it. Pause at the next appropriate location
@@ -2432,16 +2637,16 @@
   }
 
   if (!frame->IsDebuggable()) {
-    return;
+    return Error::null();
   }
   if (frame->TokenPos() == Scanner::kNoSourcePos) {
-    return;
+    return Error::null();
   }
 
   // Don't pause for a single step if there is a breakpoint set
   // at this location.
   if (HasActiveBreakpoint(frame->pc())) {
-    return;
+    return Error::null();
   }
 
   if (FLAG_verbose_debug) {
@@ -2457,15 +2662,21 @@
   SignalPausedEvent(frame, NULL);
   HandleSteppingRequest(stack_trace_);
   stack_trace_ = NULL;
+
+  // If any error occurred while in the debug message loop, return it here.
+  const Error& error =
+      Error::Handle(zone(), isolate_->object_store()->sticky_error());
+  isolate_->object_store()->clear_sticky_error();
+  return error.raw();
 }
 
 
-void Debugger::SignalBpReached() {
+RawError* Debugger::SignalBpReached() {
   // We ignore this breakpoint when the VM is executing code invoked
   // by the debugger to evaluate variables values, or when we see a nested
   // breakpoint or exception event.
   if (ignore_breakpoints_ || IsPaused() || !HasEventHandler()) {
-    return;
+    return Error::null();
   }
   DebuggerStackTrace* stack_trace = CollectStackTrace();
   ASSERT(stack_trace->Length() > 0);
@@ -2519,7 +2730,7 @@
   }
 
   if (bpt_hit == NULL) {
-    return;
+    return Error::null();
   }
 
   if (FLAG_verbose_debug) {
@@ -2540,6 +2751,12 @@
   if (cbpt->IsInternal()) {
     RemoveInternalBreakpoints();
   }
+
+  // If any error occurred while in the debug message loop, return it here.
+  const Error& error =
+      Error::Handle(zone(), isolate_->object_store()->sticky_error());
+  isolate_->object_store()->clear_sticky_error();
+  return error.raw();
 }
 
 
@@ -2577,7 +2794,7 @@
   // Use the isolate's control port as the isolate_id for debugging.
   // This port will be used as a unique ID to represent the isolate in the
   // debugger wire protocol messages.
-  isolate_id_ = isolate->main_port();
+  isolate_id_ = isolate_->main_port();
   initialized_ = true;
 }
 
@@ -2594,7 +2811,7 @@
 // the given token position.
 RawFunction* Debugger::FindInnermostClosure(const Function& function,
                                             intptr_t token_pos) {
-  const Class& owner = Class::Handle(isolate_, function.Owner());
+  const Class& owner = Class::Handle(zone(), function.Owner());
   if (owner.closures() == GrowableObjectArray::null()) {
     return Function::null();
   }
@@ -2602,12 +2819,12 @@
   // script as the outer function. We could have closures originating
   // in mixin classes whose source code is contained in a different
   // script.
-  const Script& outer_origin = Script::Handle(isolate_, function.script());
+  const Script& outer_origin = Script::Handle(zone(), function.script());
   const GrowableObjectArray& closures =
-     GrowableObjectArray::Handle(isolate_, owner.closures());
+     GrowableObjectArray::Handle(zone(), owner.closures());
   const intptr_t num_closures = closures.Length();
-  Function& closure = Function::Handle(isolate_);
-  Function& best_fit = Function::Handle(isolate_);
+  Function& closure = Function::Handle(zone());
+  Function& best_fit = Function::Handle(zone());
   for (intptr_t i = 0; i < num_closures; i++) {
     closure ^= closures.At(i);
     if ((function.token_pos() < closure.token_pos()) &&
@@ -2635,13 +2852,13 @@
   }
   // Iterate over all source breakpoints to check whether breakpoints
   // need to be set in the newly compiled function.
-  Script& script = Script::Handle(isolate_);
+  Script& script = Script::Handle(zone());
   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(isolate_);
+      Function& inner_function = Function::Handle(zone());
       inner_function = FindInnermostClosure(func, loc->token_pos());
       if (!inner_function.IsNull()) {
         // The local function of a function we just compiled cannot
@@ -2664,7 +2881,8 @@
       if (!loc->IsResolved()) {
         // Resolve source breakpoint in the newly compiled function.
         intptr_t bp_pos =
-            ResolveBreakpointPos(func, loc->token_pos(), loc->end_token_pos());
+            ResolveBreakpointPos(func, loc->token_pos(), loc->end_token_pos(),
+                                 loc->requested_column_number());
         if (bp_pos < 0) {
           if (FLAG_verbose_debug) {
             OS::Print("Failed resolving breakpoint for function '%s'\n",
@@ -2678,14 +2896,18 @@
         Breakpoint* bpt = loc->breakpoints();
         while (bpt != NULL) {
           if (FLAG_verbose_debug) {
-            OS::Print("Resolved BP %" Pd " to pos %" Pd ", line %" Pd ", "
-                      "function '%s' (requested range %" Pd "-%" Pd ")\n",
+            OS::Print("Resolved BP %" Pd " to pos %" Pd ", "
+                      "line %" Pd " col %" Pd ", "
+                      "function '%s' (requested range %" Pd "-%" Pd ", "
+                      "requested col %" Pd ")\n",
                       bpt->id(),
                       loc->token_pos(),
                       loc->LineNumber(),
+                      loc->ColumnNumber(),
                       func.ToFullyQualifiedCString(),
                       requested_pos,
-                      requested_end_pos);
+                      requested_end_pos,
+                      loc->requested_column_number());
           }
           SignalBpResolved(bpt);
           SendServiceBreakpointEvent(ServiceEvent::kBreakpointResolved, bpt);
@@ -2696,9 +2918,11 @@
       if (FLAG_verbose_debug) {
         Breakpoint* bpt = loc->breakpoints();
         while (bpt != NULL) {
-          OS::Print("Setting breakpoint %" Pd " at line %" Pd " for %s '%s'\n",
+          OS::Print("Setting breakpoint %" Pd " at line %" Pd " col %" Pd ""
+                    " for %s '%s'\n",
                     bpt->id(),
                     loc->LineNumber(),
+                    loc->ColumnNumber(),
                     func.IsClosureFunction() ? "closure" : "function",
                     String::Handle(func.name()).ToCString());
           bpt = bpt->next();
@@ -2715,9 +2939,10 @@
     // Common, fast path.
     return;
   }
-  Library& lib = Library::Handle(isolate_);
-  Script& script = Script::Handle(isolate_);
-  String& url = String::Handle(isolate_);
+  Zone* zn = zone();
+  Library& lib = Library::Handle(zn);
+  Script& script = Script::Handle(zn);
+  String& url = String::Handle(zn);
   BreakpointLocation* loc = latent_locations_;
   BreakpointLocation* prev_loc = NULL;
   const GrowableObjectArray& libs =
@@ -2741,7 +2966,8 @@
         }
         // Now find the token range at the requested line and make a
         // new unresolved source breakpoint.
-        intptr_t line_number = matched_loc->LineNumber();
+        intptr_t line_number = matched_loc->requested_line_number();
+        intptr_t column_number = matched_loc->requested_column_number();
         ASSERT(line_number >= 0);
         intptr_t first_token_pos, last_token_pos;
         script.TokenRangeAtLine(line_number, &first_token_pos, &last_token_pos);
@@ -2768,15 +2994,15 @@
           // If there is one, assert in debug build but silently drop
           // the latent breakpoint in release build.
           BreakpointLocation* existing_loc =
-              GetBreakpointLocation(script, first_token_pos);
+              GetBreakpointLocation(script, first_token_pos, column_number);
           ASSERT(existing_loc == NULL);
           if (existing_loc == NULL) {
             // Create and register a new source breakpoint for the
             // latent breakpoint.
             BreakpointLocation* unresolved_loc =
                 new BreakpointLocation(script,
-                                       first_token_pos,
-                                       last_token_pos);
+                                       first_token_pos, last_token_pos,
+                                       line_number, column_number);
             RegisterBreakpointLocation(unresolved_loc);
 
             // Move breakpoints over.
@@ -2787,10 +3013,10 @@
               bpt->set_bpt_location(unresolved_loc);
               if (FLAG_verbose_debug) {
                 OS::Print("Converted latent breakpoint "
-                          "%" Pd " in '%s' at line %" Pd "\n",
+                          "%" Pd " in '%s' at line %" Pd " col %" Pd "\n",
                           bpt->id(),
                           url.ToCString(),
-                          line_number);
+                          line_number, column_number);
               }
               bpt = bpt->next();
             }
@@ -2848,13 +3074,13 @@
 }
 
 
-uword Debugger::GetPatchedStubAddress(uword breakpoint_address) {
+RawCode* Debugger::GetPatchedStubAddress(uword breakpoint_address) {
   CodeBreakpoint* bpt = GetCodeBreakpoint(breakpoint_address);
   if (bpt != NULL) {
     return bpt->OrigStubAddress();
   }
   UNREACHABLE();
-  return 0L;
+  return Code::null();
 }
 
 
@@ -2954,10 +3180,13 @@
 
 
 BreakpointLocation* Debugger::GetBreakpointLocation(const Script& script,
-                                                    intptr_t token_pos) {
+                                                    intptr_t token_pos,
+                                                    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;
     }
     bpt = bpt->next();
@@ -2983,18 +3212,21 @@
 
 
 BreakpointLocation* Debugger::GetLatentBreakpoint(const String& url,
-                                                  intptr_t line) {
+                                                  intptr_t line,
+                                                  intptr_t column) {
   BreakpointLocation* bpt = latent_locations_;
-  String& bpt_url = String::Handle(isolate_);
+  String& bpt_url = String::Handle(zone());
   while (bpt != NULL) {
     bpt_url = bpt->url();
-    if (bpt_url.Equals(url) && (bpt->LineNumber() == line)) {
+    if (bpt_url.Equals(url) &&
+        (bpt->requested_line_number() == line) &&
+        (bpt->requested_column_number() == column)) {
       return bpt;
     }
     bpt = bpt->next();
   }
-  // No breakpint for this url and line requested. Allocate new one.
-  bpt = new BreakpointLocation(url, line);
+  // No breakpoint for this location requested. Allocate new one.
+  bpt = new BreakpointLocation(url, line, column);
   bpt->set_next(latent_locations_);
   latent_locations_ = bpt;
   return bpt;
diff --git a/runtime/vm/debugger.h b/runtime/vm/debugger.h
index 79a620c..a9d0547 100644
--- a/runtime/vm/debugger.h
+++ b/runtime/vm/debugger.h
@@ -99,10 +99,13 @@
   // Create a new unresolved breakpoint.
   BreakpointLocation(const Script& script,
                      intptr_t token_pos,
-                     intptr_t end_token_pos);
+                     intptr_t end_token_pos,
+                     intptr_t requested_line_number,
+                     intptr_t requested_column_number);
   // Create a new latent breakpoint.
   BreakpointLocation(const String& url,
-                     intptr_t line_number);
+                     intptr_t requested_line_number,
+                     intptr_t requested_column_number);
 
   ~BreakpointLocation();
 
@@ -112,9 +115,16 @@
 
   RawScript* script() const { return script_; }
   RawString* url() const { return url_; }
-  intptr_t LineNumber();
 
-  void GetCodeLocation(Library* lib, Script* script, intptr_t* token_pos);
+  intptr_t requested_line_number() const { return requested_line_number_; }
+  intptr_t requested_column_number() const { return requested_column_number_; }
+
+  intptr_t LineNumber();
+  intptr_t ColumnNumber();
+
+  void GetCodeLocation(Library* lib,
+                       Script* script,
+                       intptr_t* token_pos) const;
 
   Breakpoint* AddRepeated(Debugger* dbg);
   Breakpoint* AddSingleShot(Debugger* dbg);
@@ -144,10 +154,13 @@
   bool is_resolved_;
   BreakpointLocation* next_;
   Breakpoint* conditions_;
+  intptr_t requested_line_number_;
+  intptr_t requested_column_number_;
 
   // Valid for resolved breakpoints:
   RawFunction* function_;
   intptr_t line_number_;
+  intptr_t column_number_;
 
   friend class Debugger;
   DISALLOW_COPY_AND_ASSIGN(BreakpointLocation);
@@ -178,7 +191,7 @@
   void Disable();
   bool IsEnabled() const { return is_enabled_; }
 
-  uword OrigStubAddress() const;
+  RawCode* OrigStubAddress() const;
 
  private:
   void VisitObjectPointers(ObjectPointerVisitor* visitor);
@@ -202,7 +215,7 @@
   CodeBreakpoint* next_;
 
   RawPcDescriptors::Kind breakpoint_kind_;
-  uword saved_value_;
+  RawCode* saved_value_;
 
   friend class Debugger;
   DISALLOW_COPY_AND_ASSIGN(CodeBreakpoint);
@@ -354,7 +367,9 @@
         top_frame_(NULL),
         breakpoint_(NULL),
         exception_(NULL),
-        async_continuation_(NULL) {}
+        async_continuation_(NULL),
+        at_async_jump_(false),
+        timestamp_(-1) {}
 
   Isolate* isolate() const { return isolate_; }
 
@@ -402,10 +417,23 @@
     async_continuation_ = closure;
   }
 
+  bool at_async_jump() const {
+    return at_async_jump_;
+  }
+  void set_at_async_jump(bool value) {
+    at_async_jump_ = value;
+  }
+
   Dart_Port isolate_id() const {
     return isolate_->main_port();
   }
 
+  void UpdateTimestamp();
+
+  int64_t timestamp() const {
+    return timestamp_;
+  }
+
  private:
   Isolate* isolate_;
   EventType type_;
@@ -413,6 +441,8 @@
   Breakpoint* breakpoint_;
   const Object* exception_;
   const Object* async_continuation_;
+  bool at_async_jump_;
+  int64_t timestamp_;
 };
 
 
@@ -443,10 +473,14 @@
   // TODO(turnidge): script_url may no longer be specific enough.
   Breakpoint* SetBreakpointAtLine(const String& script_url,
                                   intptr_t line_number);
+  Breakpoint* SetBreakpointAtLineCol(const String& script_url,
+                                     intptr_t line_number,
+                                     intptr_t column_number);
   RawError* OneTimeBreakAtEntry(const Function& target_function);
 
-  BreakpointLocation* BreakpointLocationAtLine(const String& script_url,
-                                               intptr_t line_number);
+  BreakpointLocation* BreakpointLocationAtLineCol(const String& script_url,
+                                                  intptr_t line_number,
+                                                  intptr_t column_number);
 
 
   void RemoveBreakpoint(intptr_t bp_id);
@@ -522,22 +556,24 @@
   RawObject* GetStaticField(const Class& cls,
                             const String& field_name);
 
-  void SignalBpReached();
-  void DebuggerStepCallback();
+  RawError* SignalBpReached();
+  RawError* DebuggerStepCallback();
+  RawError* SignalIsolateInterrupted();
 
   void BreakHere(const String& msg);
 
   void SignalExceptionThrown(const Instance& exc);
   void SignalIsolateEvent(DebuggerEvent::EventType type);
-  static void SignalIsolateInterrupted();
 
-  uword GetPatchedStubAddress(uword breakpoint_address);
+  RawCode* GetPatchedStubAddress(uword breakpoint_address);
 
   void PrintBreakpointsToJSONArray(JSONArray* jsarr) const;
   void PrintSettingsToJSONObject(JSONObject* jsobj) const;
 
   static bool IsDebuggable(const Function& func);
 
+  intptr_t limitBreakpointId() { return next_id_; }
+
  private:
   enum ResumeAction {
     kContinue,
@@ -558,18 +594,24 @@
                                     intptr_t token_pos);
   intptr_t ResolveBreakpointPos(const Function& func,
                                 intptr_t requested_token_pos,
-                                intptr_t last_token_pos);
+                                intptr_t last_token_pos,
+                                intptr_t requested_column);
   void DeoptimizeWorld();
   BreakpointLocation* SetBreakpoint(const Script& script,
                                     intptr_t token_pos,
-                                    intptr_t last_token_pos);
+                                    intptr_t last_token_pos,
+                                    intptr_t requested_line,
+                                    intptr_t requested_column);
   void RemoveInternalBreakpoints();
   void UnlinkCodeBreakpoints(BreakpointLocation* bpt_location);
-  BreakpointLocation* GetLatentBreakpoint(const String& url, intptr_t line);
+  BreakpointLocation* GetLatentBreakpoint(const String& url,
+                                          intptr_t line,
+                                          intptr_t column);
   void RegisterBreakpointLocation(BreakpointLocation* bpt);
   void RegisterCodeBreakpoint(CodeBreakpoint* bpt);
   BreakpointLocation* GetBreakpointLocation(const Script& script,
-                                            intptr_t token_pos);
+                                            intptr_t token_pos,
+                                            intptr_t requested_column);
   void MakeCodeBreakpointAt(const Function& func,
                             BreakpointLocation* bpt);
   // Returns NULL if no breakpoint exists for the given address.
@@ -584,7 +626,7 @@
                                            const Code& code,
                                            const Array& deopt_frame,
                                            intptr_t deopt_frame_offset);
-  static RawArray* DeoptimizeToArray(Isolate* isolate,
+  static RawArray* DeoptimizeToArray(Thread* thread,
                                      StackFrame* frame,
                                      const Code& code);
   static DebuggerStackTrace* CollectStackTrace();
@@ -608,6 +650,8 @@
 
   void HandleSteppingRequest(DebuggerStackTrace* stack_trace);
 
+  Zone* zone() const { return isolate_->current_zone(); }
+
   Isolate* isolate_;
   Dart_Port isolate_id_;  // A unique ID for the isolate in the debugger.
   bool initialized_;
diff --git a/runtime/vm/debugger_api_impl.cc b/runtime/vm/debugger_api_impl.cc
index 84c245a..bd6883c 100644
--- a/runtime/vm/debugger_api_impl.cc
+++ b/runtime/vm/debugger_api_impl.cc
@@ -15,6 +15,10 @@
 
 namespace dart {
 
+// Facilitate quick access to the current zone once we have the curren thread.
+#define Z (T->zone())
+
+
 #define UNWRAP_AND_CHECK_PARAM(type, var, param)                               \
   type& var = type::Handle();                                                  \
   do {                                                                         \
@@ -51,32 +55,29 @@
 
 
 DART_EXPORT intptr_t Dart_CacheObject(Dart_Handle object_in) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  const Object& obj = Object::Handle(Api::UnwrapHandle(object_in));
+  DARTSCOPE(Thread::Current());
+  const Object& obj = Object::Handle(Z, Api::UnwrapHandle(object_in));
   if (obj.IsApiError()) {
     return -1;
   }
-  return isolate->debugger()->CacheObject(obj);
+  return I->debugger()->CacheObject(obj);
 }
 
 
 DART_EXPORT Dart_Handle Dart_GetCachedObject(intptr_t obj_id) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  if (!isolate->debugger()->IsValidObjectId(obj_id)) {
+  DARTSCOPE(Thread::Current());
+  if (!I->debugger()->IsValidObjectId(obj_id)) {
     return Api::NewError("%s: object id %" Pd " is invalid",
                          CURRENT_FUNC, obj_id);
   }
-  return Api::NewHandle(isolate, isolate->debugger()->GetCachedObject(obj_id));
+  return Api::NewHandle(I, I->debugger()->GetCachedObject(obj_id));
 }
 
 
 DART_EXPORT Dart_Handle Dart_StackTraceLength(
                             Dart_StackTrace trace,
                             intptr_t* length) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
+  DARTSCOPE(Thread::Current());
   CHECK_NOT_NULL(length);
   CHECK_AND_CAST(DebuggerStackTrace, stack_trace, trace);
   *length = stack_trace->Length();
@@ -88,8 +89,7 @@
                             Dart_StackTrace trace,
                             int frame_index,
                             Dart_ActivationFrame* frame) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
+  DARTSCOPE(Thread::Current());
   CHECK_NOT_NULL(frame);
   CHECK_AND_CAST(DebuggerStackTrace, stack_trace, trace);
   if ((frame_index < 0) || (frame_index >= stack_trace->Length())) {
@@ -108,7 +108,8 @@
 
 
 static void DebuggerEventHandler(DebuggerEvent* event) {
-  Isolate* isolate = Isolate::Current();
+  Thread* thread = Thread::Current();
+  Isolate* isolate = thread->isolate();
   ASSERT(isolate != NULL);
   Dart_EnterScope();
   Dart_IsolateId isolate_id = isolate->debugger()->GetIsolateId();
@@ -132,8 +133,9 @@
       Breakpoint* bpt = event->breakpoint();
       ASSERT(bpt != NULL);
       Dart_CodeLocation location;
-      Library& library = Library::Handle(isolate);
-      Script& script = Script::Handle(isolate);
+      Zone* zone = thread->zone();
+      Library& library = Library::Handle(zone);
+      Script& script = Script::Handle(zone);
       intptr_t token_pos;
       bpt->bpt_location()->GetCodeLocation(&library, &script, &token_pos);
       location.script_url = Api::NewHandle(isolate, script.url());
@@ -196,45 +198,41 @@
 
 DART_EXPORT Dart_Handle Dart_SetExceptionPauseInfo(
                             Dart_ExceptionPauseInfo pause_info) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  isolate->debugger()->SetExceptionPauseInfo(pause_info);
+  DARTSCOPE(Thread::Current());
+  I->debugger()->SetExceptionPauseInfo(pause_info);
   return Api::Success();
 }
 
 
 DART_EXPORT Dart_ExceptionPauseInfo Dart_GetExceptionPauseInfo() {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  return isolate->debugger()->GetExceptionPauseInfo();
+  DARTSCOPE(Thread::Current());
+  return I->debugger()->GetExceptionPauseInfo();
 }
 
 
 DART_EXPORT Dart_Handle Dart_GetStackTrace(Dart_StackTrace* trace) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
+  DARTSCOPE(Thread::Current());
   CHECK_NOT_NULL(trace);
   *trace = reinterpret_cast<Dart_StackTrace>(
-      isolate->debugger()->CurrentStackTrace());
+      I->debugger()->CurrentStackTrace());
   return Api::Success();
 }
 
 
 DART_EXPORT Dart_Handle Dart_GetStackTraceFromError(Dart_Handle handle,
                                                     Dart_StackTrace* trace) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
+  DARTSCOPE(Thread::Current());
   CHECK_NOT_NULL(trace);
-  const Object& obj = Object::Handle(isolate, Api::UnwrapHandle(handle));
+  const Object& obj = Object::Handle(Z, Api::UnwrapHandle(handle));
   if (obj.IsUnhandledException()) {
     const UnhandledException& error = UnhandledException::Cast(obj);
-    Stacktrace& dart_stacktrace = Stacktrace::Handle(isolate);
+    Stacktrace& dart_stacktrace = Stacktrace::Handle(Z);
     dart_stacktrace ^= error.stacktrace();
     if (dart_stacktrace.IsNull()) {
       *trace = NULL;
     } else {
       *trace = reinterpret_cast<Dart_StackTrace>(
-        isolate->debugger()->StackTraceFrom(dart_stacktrace));
+        I->debugger()->StackTraceFrom(dart_stacktrace));
     }
     return Api::Success();
   } else {
@@ -250,14 +248,13 @@
                             Dart_Handle* script_url,
                             intptr_t* line_number,
                             intptr_t* column_number) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
+  DARTSCOPE(Thread::Current());
   CHECK_AND_CAST(ActivationFrame, frame, activation_frame);
   if (function_name != NULL) {
-    *function_name = Api::NewHandle(isolate, frame->QualifiedFunctionName());
+    *function_name = Api::NewHandle(I, frame->QualifiedFunctionName());
   }
   if (script_url != NULL) {
-    *script_url = Api::NewHandle(isolate, frame->SourceUrl());
+    *script_url = Api::NewHandle(I, frame->SourceUrl());
   }
   if (line_number != NULL) {
     *line_number = frame->LineNumber();
@@ -276,19 +273,18 @@
                             Dart_CodeLocation* location) {
   // TODO(hausner): Implement a way to recognize when there
   // is no source code for the code in the frame.
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
+  DARTSCOPE(Thread::Current());
   CHECK_AND_CAST(ActivationFrame, frame, activation_frame);
   if (function_name != NULL) {
-    *function_name = Api::NewHandle(isolate, frame->QualifiedFunctionName());
+    *function_name = Api::NewHandle(I, frame->QualifiedFunctionName());
   }
   if (function != NULL) {
-    *function = Api::NewHandle(isolate, frame->function().raw());
+    *function = Api::NewHandle(I, frame->function().raw());
   }
 
   if (location != NULL) {
-    location->script_url = Api::NewHandle(isolate, frame->SourceUrl());
-    const Library& lib = Library::Handle(frame->Library());
+    location->script_url = Api::NewHandle(I, frame->SourceUrl());
+    const Library& lib = Library::Handle(Z, frame->Library());
     location->library_id = lib.index();
     location->token_pos = frame->TokenPos();
   }
@@ -298,8 +294,7 @@
 DART_EXPORT Dart_Handle Dart_ActivationFrameGetFramePointer(
                             Dart_ActivationFrame activation_frame,
                             uintptr_t* frame_pointer) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
+  DARTSCOPE(Thread::Current());
   CHECK_AND_CAST(ActivationFrame, frame, activation_frame);
 
   if (frame_pointer != NULL) {
@@ -310,11 +305,10 @@
 
 
 DART_EXPORT Dart_Handle Dart_GetFunctionOrigin(Dart_Handle function_in) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
+  DARTSCOPE(Thread::Current());
   UNWRAP_AND_CHECK_PARAM(Function, function, function_in);
 
-  const Class& cls = Class::Handle(function.origin());
+  const Class& cls = Class::Handle(Z, function.origin());
   if (!cls.IsTopLevel()) {
     return Dart_NewInteger(cls.id());
   }
@@ -324,21 +318,19 @@
 
 DART_EXPORT Dart_Handle Dart_GetLocalVariables(
                             Dart_ActivationFrame activation_frame) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
+  DARTSCOPE(Thread::Current());
   CHECK_AND_CAST(ActivationFrame, frame, activation_frame);
-  return Api::NewHandle(isolate, frame->GetLocalVariables());
+  return Api::NewHandle(I, frame->GetLocalVariables());
 }
 
 
 DART_EXPORT Dart_Handle Dart_SetBreakpoint(
                             Dart_Handle script_url_in,
                             intptr_t line_number) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
+  DARTSCOPE(Thread::Current());
   UNWRAP_AND_CHECK_PARAM(String, script_url, script_url_in);
 
-  Debugger* debugger = isolate->debugger();
+  Debugger* debugger = I->debugger();
   Breakpoint* bpt =
       debugger->SetBreakpointAtLine(script_url, line_number);
   if (bpt == NULL) {
@@ -350,30 +342,32 @@
 
 
 DART_EXPORT Dart_Handle Dart_GetBreakpointURL(intptr_t bp_id) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  Debugger* debugger = isolate->debugger();
+  DARTSCOPE(Thread::Current());
+  Debugger* debugger = I->debugger();
 
   Breakpoint* bpt = debugger->GetBreakpointById(bp_id);
   if (bpt == NULL) {
     return Api::NewError("%s: breakpoint with id %" Pd " does not exist",
                            CURRENT_FUNC, bp_id);
   }
-  return Api::NewHandle(isolate, bpt->bpt_location()->url());
+  return Api::NewHandle(I, bpt->bpt_location()->url());
 }
 
 
 DART_EXPORT Dart_Handle Dart_GetBreakpointLine(intptr_t bp_id) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  Debugger* debugger = isolate->debugger();
+  DARTSCOPE(Thread::Current());
+  Debugger* debugger = I->debugger();
 
   Breakpoint* bpt = debugger->GetBreakpointById(bp_id);
   if (bpt == NULL) {
     return Api::NewError("%s: breakpoint with id %" Pd " does not exist",
                          CURRENT_FUNC, bp_id);
   }
-  return Dart_NewInteger(bpt->bpt_location()->LineNumber());
+  if (bpt->bpt_location()->IsResolved()) {
+    return Dart_NewInteger(bpt->bpt_location()->LineNumber());
+  } else {
+    return Dart_NewInteger(bpt->bpt_location()->requested_line_number());
+  }
 }
 
 
@@ -381,8 +375,7 @@
                             Dart_Handle library_in,
                             Dart_Handle class_name_in,
                             Dart_Handle function_name_in) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
+  DARTSCOPE(Thread::Current());
   UNWRAP_AND_CHECK_PARAM(Library, library, library_in);
   UNWRAP_AND_CHECK_PARAM(String, class_name, class_name_in);
   UNWRAP_AND_CHECK_PARAM(String, function_name, function_name_in);
@@ -395,7 +388,7 @@
   }
 
   // Resolve the breakpoint target function.
-  Debugger* debugger = isolate->debugger();
+  Debugger* debugger = I->debugger();
   const Function& bp_target = Function::Handle(
       debugger->ResolveFunction(library, class_name, function_name));
   if (bp_target.IsNull()) {
@@ -421,8 +414,7 @@
                             Dart_Handle library_in,
                             Dart_Handle class_name_in,
                             Dart_Handle function_name_in) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
+  DARTSCOPE(Thread::Current());
   UNWRAP_AND_CHECK_PARAM(Library, library, library_in);
   UNWRAP_AND_CHECK_PARAM(String, class_name, class_name_in);
   UNWRAP_AND_CHECK_PARAM(String, function_name, function_name_in);
@@ -435,7 +427,7 @@
   }
 
   // Resolve the breakpoint target function.
-  Debugger* debugger = isolate->debugger();
+  Debugger* debugger = I->debugger();
   const Function& bp_target = Function::Handle(
       debugger->ResolveFunction(library, class_name, function_name));
   if (bp_target.IsNull()) {
@@ -447,111 +439,101 @@
                          function_name.ToCString());
   }
 
-  const Error& error =
-      Error::Handle(isolate, debugger->OneTimeBreakAtEntry(bp_target));
+  const Error& error = Error::Handle(Z,
+      debugger->OneTimeBreakAtEntry(bp_target));
   if (!error.IsNull()) {
-    return Api::NewHandle(isolate, error.raw());
+    return Api::NewHandle(I, error.raw());
   }
   return Api::Success();
 }
 
 
 DART_EXPORT Dart_Handle Dart_RemoveBreakpoint(intptr_t bp_id) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  isolate->debugger()->RemoveBreakpoint(bp_id);
+  DARTSCOPE(Thread::Current());
+  I->debugger()->RemoveBreakpoint(bp_id);
   return Api::Success();
 }
 
 
 DART_EXPORT Dart_Handle Dart_SetStepOver() {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  isolate->debugger()->SetStepOver();
+  DARTSCOPE(Thread::Current());
+  I->debugger()->SetStepOver();
   return Api::Success();
 }
 
 
 DART_EXPORT Dart_Handle Dart_SetStepInto() {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  isolate->debugger()->SetSingleStep();
+  DARTSCOPE(Thread::Current());
+  I->debugger()->SetSingleStep();
   return Api::Success();
 }
 
 
 DART_EXPORT Dart_Handle Dart_SetStepOut() {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  isolate->debugger()->SetStepOut();
+  DARTSCOPE(Thread::Current());
+  I->debugger()->SetStepOut();
   return Api::Success();
 }
 
 
 DART_EXPORT Dart_Handle Dart_GetInstanceFields(Dart_Handle object_in) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
+  DARTSCOPE(Thread::Current());
   UNWRAP_AND_CHECK_PARAM(Instance, obj, object_in);
-  return Api::NewHandle(isolate, isolate->debugger()->GetInstanceFields(obj));
+  return Api::NewHandle(I, I->debugger()->GetInstanceFields(obj));
 }
 
 
 DART_EXPORT Dart_Handle Dart_GetStaticFields(Dart_Handle target) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  const Type& type_obj = Api::UnwrapTypeHandle(isolate, target);
+  DARTSCOPE(Thread::Current());
+  const Type& type_obj = Api::UnwrapTypeHandle(Z, target);
   if (type_obj.IsNull()) {
     return Api::NewError("%s expects argument 'target' to be a type",
                          CURRENT_FUNC);
   }
-  const Class& cls = Class::Handle(isolate, type_obj.type_class());
-  return Api::NewHandle(isolate, isolate->debugger()->GetStaticFields(cls));
+  const Class& cls = Class::Handle(Z, type_obj.type_class());
+  return Api::NewHandle(I, I->debugger()->GetStaticFields(cls));
 }
 
 
 DART_EXPORT Dart_Handle Dart_GetLibraryFields(intptr_t library_id) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
+  DARTSCOPE(Thread::Current());
   const Library& lib =
-      Library::Handle(isolate, Library::GetLibrary(library_id));
+      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::NewHandle(isolate, isolate->debugger()->GetLibraryFields(lib));
+  return Api::NewHandle(I, I->debugger()->GetLibraryFields(lib));
 }
 
 
 DART_EXPORT Dart_Handle Dart_GetGlobalVariables(intptr_t library_id) {
-  Isolate* isolate = Isolate::Current();
-  ASSERT(isolate != NULL);
-  DARTSCOPE(isolate);
-  const Library& lib = Library::Handle(Library::GetLibrary(library_id));
+  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::NewHandle(isolate, isolate->debugger()->GetGlobalFields(lib));
+  return Api::NewHandle(I, I->debugger()->GetGlobalFields(lib));
 }
 
 
 DART_EXPORT Dart_Handle Dart_ActivationFrameEvaluate(
                             Dart_ActivationFrame activation_frame,
                             Dart_Handle expr_in) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
+  DARTSCOPE(Thread::Current());
   CHECK_AND_CAST(ActivationFrame, frame, activation_frame);
   UNWRAP_AND_CHECK_PARAM(String, expr, expr_in);
-  return Api::NewHandle(isolate, frame->Evaluate(expr));
+  return Api::NewHandle(I, frame->Evaluate(expr));
 }
 
 
 DART_EXPORT Dart_Handle Dart_EvaluateExpr(Dart_Handle target_in,
                                           Dart_Handle expr_in) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
+  DARTSCOPE(Thread::Current());
 
-  const Object& target = Object::Handle(isolate, Api::UnwrapHandle(target_in));
+  const Object& target = Object::Handle(Z, Api::UnwrapHandle(target_in));
   if (target.IsError()) return target_in;
   if (target.IsNull()) {
     return Api::NewError("%s expects argument 'target' to be non-null",
@@ -560,42 +542,40 @@
   UNWRAP_AND_CHECK_PARAM(String, expr, expr_in);
   // Type extends Instance, must check first.
   if (target.IsType()) {
-    const Class& cls = Class::Handle(isolate, Type::Cast(target).type_class());
-    return Api::NewHandle(isolate, cls.Evaluate(expr,
-                                                Array::empty_array(),
-                                                Array::empty_array()));
+    const Class& cls = Class::Handle(Z, Type::Cast(target).type_class());
+    return Api::NewHandle(I, cls.Evaluate(expr,
+                                          Array::empty_array(),
+                                          Array::empty_array()));
   } else if (target.IsInstance()) {
     const Instance& inst = Instance::Cast(target);
-    return Api::NewHandle(isolate, inst.Evaluate(expr,
-                                                 Array::empty_array(),
-                                                 Array::empty_array()));
+    return Api::NewHandle(I, inst.Evaluate(expr,
+                                           Array::empty_array(),
+                                           Array::empty_array()));
   } else if (target.IsLibrary()) {
     const Library& lib = Library::Cast(target);
-    return Api::NewHandle(isolate, lib.Evaluate(expr,
-                                                Array::empty_array(),
-                                                Array::empty_array()));
+    return Api::NewHandle(I, lib.Evaluate(expr,
+                                          Array::empty_array(),
+                                          Array::empty_array()));
   } else if (target.IsClass()) {
     const Class& cls = Class::Cast(target);
-    return Api::NewHandle(isolate, cls.Evaluate(expr,
-                                                Array::empty_array(),
-                                                Array::empty_array()));
+    return Api::NewHandle(I, cls.Evaluate(expr,
+                                          Array::empty_array(),
+                                          Array::empty_array()));
   }
   return Api::NewError("%s: unsupported target type", CURRENT_FUNC);
 }
 
 
 DART_EXPORT Dart_Handle Dart_GetObjClass(Dart_Handle object_in) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
+  DARTSCOPE(Thread::Current());
   UNWRAP_AND_CHECK_PARAM(Instance, obj, object_in);
-  return Api::NewHandle(isolate, obj.GetType());
+  return Api::NewHandle(I, obj.GetType());
 }
 
 
 DART_EXPORT Dart_Handle Dart_GetObjClassId(Dart_Handle object_in,
                                            intptr_t* class_id) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
+  DARTSCOPE(Thread::Current());
   UNWRAP_AND_CHECK_PARAM(Instance, obj, object_in);
   CHECK_NOT_NULL(class_id);
   *class_id = obj.GetClassId();
@@ -604,19 +584,17 @@
 
 
 DART_EXPORT Dart_Handle Dart_GetClassFromId(intptr_t class_id) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  if (!isolate->class_table()->IsValidIndex(class_id)) {
+  DARTSCOPE(Thread::Current());
+  if (!I->class_table()->IsValidIndex(class_id)) {
     return Api::NewError("%s: %" Pd " is not a valid class id",
                          CURRENT_FUNC, class_id);
   }
-  return Api::NewHandle(isolate, isolate->class_table()->At(class_id));
+  return Api::NewHandle(I, I->class_table()->At(class_id));
 }
 
 
 DART_EXPORT Dart_Handle Dart_GetSupertype(Dart_Handle type_in) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
+  DARTSCOPE(Thread::Current());
 
   UNWRAP_AND_CHECK_PARAM(Type, type, type_in);
   if (!type.IsFinalized()) {
@@ -635,7 +613,7 @@
     if (type.IsNull()) {
       return Dart_Null();
     }
-    return Api::NewHandle(isolate, type.Canonicalize());
+    return Api::NewHandle(I, type.Canonicalize());
   }
   // Set up the type arguments array for the super class type.
   const Class& super_cls = Class::Handle(cls.SuperClass());
@@ -657,7 +635,7 @@
       Type::New(super_cls, super_type_args_array, Scanner::kNoSourcePos));
   ASSERT(!instantiated_type.IsNull());
   instantiated_type.SetIsFinalized();
-  return Api::NewHandle(isolate, instantiated_type.Canonicalize());
+  return Api::NewHandle(I, instantiated_type.Canonicalize());
 }
 
 
@@ -666,8 +644,7 @@
                             Dart_Handle* name,
                             Dart_Handle* signature,
                             Dart_CodeLocation* location) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
+  DARTSCOPE(Thread::Current());
   UNWRAP_AND_CHECK_PARAM(Instance, instance, closure);
   CHECK_NOT_NULL(location);
 
@@ -677,26 +654,26 @@
   const Function& func = Function::Handle(Closure::function(instance));
   ASSERT(!func.IsNull());
   if (name != NULL) {
-    *name = Api::NewHandle(isolate, func.QualifiedUserVisibleName());
+    *name = Api::NewHandle(I, func.QualifiedUserVisibleName());
   }
   if (signature != NULL) {
-    *signature = Api::NewHandle(isolate, func.UserVisibleSignature());
+    *signature = Api::NewHandle(I, func.UserVisibleSignature());
   }
 
   if (location != NULL) {
     if (func.token_pos() >= 0) {
-      const Class& cls = Class::Handle(func.origin());
+      const Class& cls = Class::Handle(Z, func.origin());
       ASSERT(!cls.IsNull());
-      const Library& lib = Library::Handle(isolate, cls.library());
+      const Library& lib = Library::Handle(Z, cls.library());
       ASSERT(!lib.IsNull());
       // Note func.script() is not the same as cls.script() for eval functions.
-      const Script& script = Script::Handle(func.script());
+      const Script& script = Script::Handle(Z, func.script());
       ASSERT(!script.IsNull());
-      location->script_url = Api::NewHandle(isolate, script.url());
+      location->script_url = Api::NewHandle(I, script.url());
       location->library_id = lib.index();
       location->token_pos = func.token_pos();
     } else {
-      location->script_url = Api::NewHandle(isolate, String::null());
+      location->script_url = Api::NewHandle(I, String::null());
       location->library_id = -1;
       location->token_pos = -1;
     }
@@ -711,30 +688,29 @@
                             intptr_t* library_id,
                             intptr_t* super_class_id,
                             Dart_Handle* static_fields) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  if (!isolate->class_table()->IsValidIndex(cls_id)) {
+  DARTSCOPE(Thread::Current());
+  if (!I->class_table()->IsValidIndex(cls_id)) {
     return Api::NewError("%s: %" Pd " is not a valid class id",
                          CURRENT_FUNC, cls_id);
   }
-  Class& cls = Class::Handle(isolate, isolate->class_table()->At(cls_id));
+  Class& cls = Class::Handle(Z, I->class_table()->At(cls_id));
   if (class_name != NULL) {
-    *class_name = Api::NewHandle(isolate, cls.Name());
+    *class_name = Api::NewHandle(I, cls.Name());
   }
   if (library_id != NULL) {
-    const Library& lib = Library::Handle(isolate, cls.library());
+    const Library& lib = Library::Handle(Z, cls.library());
     *library_id = lib.index();
   }
   if (super_class_id != NULL) {
     *super_class_id = 0;
-    Class& super_cls = Class::Handle(isolate, cls.SuperClass());
+    Class& super_cls = Class::Handle(Z, cls.SuperClass());
     if (!super_cls.IsNull()) {
       *super_class_id = super_cls.id();
     }
   }
   if (static_fields != NULL) {
     *static_fields =
-        Api::NewHandle(isolate, isolate->debugger()->GetStaticFields(cls));
+        Api::NewHandle(I, I->debugger()->GetStaticFields(cls));
   }
   return Api::Success();
 }
@@ -743,8 +719,7 @@
 DART_EXPORT Dart_Handle Dart_ScriptGetSource(
                             intptr_t library_id,
                             Dart_Handle script_url_in) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
+  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",
@@ -757,15 +732,14 @@
                          CURRENT_FUNC, script_url.ToCString(),
                          String::Handle(lib.url()).ToCString());
   }
-  return Api::NewHandle(isolate, script.Source());
+  return Api::NewHandle(I, script.Source());
 }
 
 
 DART_EXPORT Dart_Handle Dart_ScriptGetTokenInfo(
                             intptr_t library_id,
                             Dart_Handle script_url_in) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
+  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",
@@ -781,14 +755,13 @@
 
   const GrowableObjectArray& info =
       GrowableObjectArray::Handle(script.GenerateLineNumberArray());
-  return Api::NewHandle(isolate, Array::MakeArray(info));
+  return Api::NewHandle(I, Array::MakeArray(info));
 }
 
 
 DART_EXPORT Dart_Handle Dart_GenerateScriptSource(Dart_Handle library_url_in,
                                                   Dart_Handle script_url_in) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
+  DARTSCOPE(Thread::Current());
   UNWRAP_AND_CHECK_PARAM(String, library_url, library_url_in);
   UNWRAP_AND_CHECK_PARAM(String, script_url, script_url_in);
 
@@ -805,13 +778,12 @@
                          library_url.ToCString());
   }
 
-  return Api::NewHandle(isolate, script.GenerateSource());
+  return Api::NewHandle(I, script.GenerateSource());
 }
 
 
 DART_EXPORT Dart_Handle Dart_GetScriptURLs(Dart_Handle library_url_in) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
+  DARTSCOPE(Thread::Current());
   UNWRAP_AND_CHECK_PARAM(String, library_url, library_url_in);
 
   const Library& library = Library::Handle(Library::LookupLibrary(library_url));
@@ -830,52 +802,47 @@
     url = script.url();
     script_list.SetAt(i, url);
   }
-  return Api::NewHandle(isolate, script_list.raw());
+  return Api::NewHandle(I, script_list.raw());
 }
 
 
 DART_EXPORT Dart_Handle Dart_GetLibraryIds() {
-  Isolate* isolate = Isolate::Current();
-  ASSERT(isolate != NULL);
-  DARTSCOPE(isolate);
+  DARTSCOPE(Thread::Current());
 
   const GrowableObjectArray& libs =
-      GrowableObjectArray::Handle(isolate->object_store()->libraries());
+      GrowableObjectArray::Handle(Z, I->object_store()->libraries());
   int num_libs = libs.Length();
 
   // Create new list and populate with the url of loaded libraries.
   Library &lib = Library::Handle();
-  const Array& library_id_list = Array::Handle(Array::New(num_libs));
+  const Array& library_id_list = Array::Handle(Z, Array::New(num_libs));
   for (int i = 0; i < num_libs; i++) {
     lib ^= libs.At(i);
     ASSERT(!lib.IsNull());
     ASSERT(Smi::IsValid(lib.index()));
     library_id_list.SetAt(i, Smi::Handle(Smi::New(lib.index())));
   }
-  return Api::NewHandle(isolate, library_id_list.raw());
+  return Api::NewHandle(I, library_id_list.raw());
 }
 
 
 DART_EXPORT Dart_Handle Dart_GetLibraryFromId(intptr_t library_id) {
-  Isolate* isolate = Isolate::Current();
-  ASSERT(isolate != NULL);
-  DARTSCOPE(isolate);
-  const Library& lib = Library::Handle(Library::GetLibrary(library_id));
+  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::NewHandle(isolate, lib.raw());
+  return Api::NewHandle(I, lib.raw());
 }
 
 
 DART_EXPORT Dart_Handle Dart_LibraryId(Dart_Handle library,
                                        intptr_t* library_id) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  const Library& lib = Api::UnwrapLibraryHandle(isolate, library);
+  DARTSCOPE(Thread::Current());
+  const Library& lib = Api::UnwrapLibraryHandle(Z, library);
   if (lib.IsNull()) {
-    RETURN_TYPE_ERROR(isolate, library, Library);
+    RETURN_TYPE_ERROR(Z, library, Library);
   }
   if (library_id == NULL) {
     RETURN_NULL_ERROR(library_id);
@@ -886,9 +853,7 @@
 
 
 DART_EXPORT Dart_Handle Dart_GetLibraryImports(intptr_t library_id) {
-  Isolate* isolate = Isolate::Current();
-  ASSERT(isolate != NULL);
-  DARTSCOPE(isolate);
+  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",
@@ -897,18 +862,18 @@
   const GrowableObjectArray& import_list =
       GrowableObjectArray::Handle(GrowableObjectArray::New(8));
 
-  String& prefix_name = String::Handle(isolate);
-  Library& imported = Library::Handle(isolate);
+  String& prefix_name = String::Handle(Z);
+  Library& imported = Library::Handle(Z);
   intptr_t num_imports = lib.num_imports();
   for (int i = 0; i < num_imports; i++) {
     import_list.Add(prefix_name);  // Null prefix name means no prefix.
     imported = lib.ImportLibraryAt(i);
     ASSERT(!imported.IsNull());
     ASSERT(Smi::IsValid(imported.index()));
-    import_list.Add(Smi::Handle(Smi::New(imported.index())));
+    import_list.Add(Smi::Handle(Z, Smi::New(imported.index())));
   }
   LibraryPrefixIterator it(lib);
-  LibraryPrefix& prefix = LibraryPrefix::Handle(isolate);
+  LibraryPrefix& prefix = LibraryPrefix::Handle(Z);
   while (it.HasNext()) {
     prefix = it.GetNext();
     prefix_name = prefix.name();
@@ -920,28 +885,24 @@
       import_list.Add(Smi::Handle(Smi::New(imported.index())));
     }
   }
-  return Api::NewHandle(isolate, Array::MakeArray(import_list));
+  return Api::NewHandle(I, Array::MakeArray(import_list));
 }
 
 
 DART_EXPORT Dart_Handle Dart_GetLibraryURL(intptr_t library_id) {
-  Isolate* isolate = Isolate::Current();
-  ASSERT(isolate != NULL);
-  DARTSCOPE(isolate);
-  const Library& lib = Library::Handle(Library::GetLibrary(library_id));
+  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::NewHandle(isolate, lib.url());
+  return Api::NewHandle(I, lib.url());
 }
 
 
 DART_EXPORT Dart_Handle Dart_GetLibraryDebuggable(intptr_t library_id,
                                                   bool* is_debuggable) {
-  Isolate* isolate = Isolate::Current();
-  ASSERT(isolate != NULL);
-  DARTSCOPE(isolate);
+  DARTSCOPE(Thread::Current());
   CHECK_NOT_NULL(is_debuggable);
   const Library& lib = Library::Handle(Library::GetLibrary(library_id));
   if (lib.IsNull()) {
@@ -955,10 +916,8 @@
 
 DART_EXPORT Dart_Handle Dart_SetLibraryDebuggable(intptr_t library_id,
                                                   bool is_debuggable) {
-  Isolate* isolate = Isolate::Current();
-  ASSERT(isolate != NULL);
-  DARTSCOPE(isolate);
-  const Library& lib = Library::Handle(Library::GetLibrary(library_id));
+  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);
diff --git a/runtime/vm/debugger_api_impl_test.cc b/runtime/vm/debugger_api_impl_test.cc
index e539374..ca260f2 100644
--- a/runtime/vm/debugger_api_impl_test.cc
+++ b/runtime/vm/debugger_api_impl_test.cc
@@ -663,6 +663,7 @@
       "foo",       // entry
       "foo",       // call f1
         "f1",      // entry
+        "f1",      // return
       "foo",       // call initializer
       "foo",       // call kvmk
         "X.kvmk",  // entry
@@ -832,7 +833,7 @@
   Dart_StackTrace trace;
   Dart_GetStackTrace(&trace);
   const char* expected_bpts[] = {
-      "moo", "foo", "moo", "foo", "moo", "foo", "main"};
+      "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);
@@ -1405,6 +1406,7 @@
   EXPECT(Dart_GetIsolateId(isolate) == test_isolate_id);
   Dart_ExitScope();
   Dart_ShutdownIsolate();
+  Dart_SetIsolateEventHandler(NULL);
   EXPECT(verify_callback == 0x5);  // Only created and shutdown events.
 }
 
@@ -2137,6 +2139,7 @@
       "}\n";
 
   Isolate* isolate = Isolate::Current();
+  Zone* zone = isolate->current_zone();
   LoadScript(kScriptChars);
   ASSERT(script_lib != NULL);
   ASSERT(Dart_IsLibrary(script_lib));
@@ -2187,34 +2190,34 @@
   }
   {
     Dart_Handle super_type = Dart_GetSupertype(Test1_type);
-    const Type& expected_type = Api::UnwrapTypeHandle(isolate, Test_type);
-    const Type& actual_type = Api::UnwrapTypeHandle(isolate, super_type);
+    const Type& expected_type = Api::UnwrapTypeHandle(zone, Test_type);
+    const Type& actual_type = Api::UnwrapTypeHandle(zone, super_type);
     EXPECT(expected_type.raw() == actual_type.raw());
   }
   {
     Dart_Handle super_type = Dart_GetSupertype(Test3_type);
-    const Type& expected_type = Api::UnwrapTypeHandle(isolate, Test2_int_type);
-    const Type& actual_type = Api::UnwrapTypeHandle(isolate, super_type);
+    const Type& expected_type = Api::UnwrapTypeHandle(zone, Test2_int_type);
+    const Type& actual_type = Api::UnwrapTypeHandle(zone, super_type);
     EXPECT(expected_type.raw() == actual_type.raw());
   }
   {
     Dart_Handle super_type = Dart_GetSupertype(Test4_int_type);
-    const Type& expected_type = Api::UnwrapTypeHandle(isolate, Test2_int_type);
-    const Type& actual_type = Api::UnwrapTypeHandle(isolate, super_type);
+    const Type& expected_type = Api::UnwrapTypeHandle(zone, Test2_int_type);
+    const Type& actual_type = Api::UnwrapTypeHandle(zone, super_type);
     EXPECT(expected_type.raw() == actual_type.raw());
   }
   {
     Dart_Handle super_type = Dart_GetSupertype(Test5_int_type);
-    const Type& expected_type = Api::UnwrapTypeHandle(isolate, Test4_int_type);
-    const Type& actual_type = Api::UnwrapTypeHandle(isolate, super_type);
+    const Type& expected_type = Api::UnwrapTypeHandle(zone, Test4_int_type);
+    const Type& actual_type = Api::UnwrapTypeHandle(zone, super_type);
     EXPECT(expected_type.raw() == actual_type.raw());
   }
   {
     Dart_Handle set_type = Dart_GetType(core_lib, set_name, 0, NULL);
     Dart_Handle super_type = Dart_GetSupertype(set_type);
     Dart_Handle iterable_type = Dart_GetType(core_lib, iterable_name, 0, NULL);
-    const Type& expected_type = Api::UnwrapTypeHandle(isolate, iterable_type);
-    const Type& actual_type = Api::UnwrapTypeHandle(isolate, super_type);
+    const Type& expected_type = Api::UnwrapTypeHandle(zone, iterable_type);
+    const Type& actual_type = Api::UnwrapTypeHandle(zone, super_type);
     EXPECT(expected_type.raw() == actual_type.raw());
   }
   {
diff --git a/runtime/vm/debugger_arm.cc b/runtime/vm/debugger_arm.cc
index e0a366d..1322b8d 100644
--- a/runtime/vm/debugger_arm.cc
+++ b/runtime/vm/debugger_arm.cc
@@ -13,21 +13,21 @@
 
 namespace dart {
 
-uword CodeBreakpoint::OrigStubAddress() const {
+RawCode* CodeBreakpoint::OrigStubAddress() const {
   return saved_value_;
 }
 
 
 void CodeBreakpoint::PatchCode() {
   ASSERT(!is_enabled_);
-  uword stub_target = 0;
+  Code& stub_target = Code::Handle();
   switch (breakpoint_kind_) {
     case RawPcDescriptors::kIcCall:
     case RawPcDescriptors::kUnoptStaticCall:
-      stub_target = StubCode::ICCallBreakpoint_entry()->EntryPoint();
+      stub_target = StubCode::ICCallBreakpoint_entry()->code();
       break;
     case RawPcDescriptors::kRuntimeCall:
-      stub_target = StubCode::RuntimeCallBreakpoint_entry()->EntryPoint();
+      stub_target = StubCode::RuntimeCallBreakpoint_entry()->code();
       break;
     default:
       UNREACHABLE();
@@ -46,7 +46,7 @@
     case RawPcDescriptors::kIcCall:
     case RawPcDescriptors::kUnoptStaticCall:
     case RawPcDescriptors::kRuntimeCall: {
-      CodePatcher::PatchStaticCallAt(pc_, code, saved_value_);
+      CodePatcher::PatchStaticCallAt(pc_, code, Code::Handle(saved_value_));
       break;
     }
     default:
diff --git a/runtime/vm/debugger_arm64.cc b/runtime/vm/debugger_arm64.cc
index 8c59d24..bf6423a 100644
--- a/runtime/vm/debugger_arm64.cc
+++ b/runtime/vm/debugger_arm64.cc
@@ -13,21 +13,21 @@
 
 namespace dart {
 
-uword CodeBreakpoint::OrigStubAddress() const {
+RawCode* CodeBreakpoint::OrigStubAddress() const {
   return saved_value_;
 }
 
 
 void CodeBreakpoint::PatchCode() {
   ASSERT(!is_enabled_);
-  uword stub_target = 0;
+  Code& stub_target = Code::Handle();
   switch (breakpoint_kind_) {
     case RawPcDescriptors::kIcCall:
     case RawPcDescriptors::kUnoptStaticCall:
-      stub_target = StubCode::ICCallBreakpoint_entry()->EntryPoint();
+      stub_target = StubCode::ICCallBreakpoint_entry()->code();
       break;
     case RawPcDescriptors::kRuntimeCall: {
-      stub_target = StubCode::RuntimeCallBreakpoint_entry()->EntryPoint();
+      stub_target = StubCode::RuntimeCallBreakpoint_entry()->code();
       break;
     }
     default:
@@ -47,7 +47,8 @@
     case RawPcDescriptors::kIcCall:
     case RawPcDescriptors::kUnoptStaticCall:
     case RawPcDescriptors::kRuntimeCall: {
-      CodePatcher::PatchPoolPointerCallAt(pc_, code, saved_value_);
+      CodePatcher::PatchPoolPointerCallAt(
+          pc_, code, Code::Handle(saved_value_));
       break;
     }
     default:
diff --git a/runtime/vm/debugger_ia32.cc b/runtime/vm/debugger_ia32.cc
index 408c838..cc1c63d 100644
--- a/runtime/vm/debugger_ia32.cc
+++ b/runtime/vm/debugger_ia32.cc
@@ -17,7 +17,7 @@
 
 namespace dart {
 
-uword CodeBreakpoint::OrigStubAddress() const {
+RawCode* CodeBreakpoint::OrigStubAddress() const {
   return saved_value_;
 }
 
@@ -26,25 +26,25 @@
   ASSERT(!is_enabled_);
   const Code& code = Code::Handle(code_);
   const Instructions& instrs = Instructions::Handle(code.instructions());
+  Code& stub_target = Code::Handle();
   {
     WritableInstructionsScope writable(instrs.EntryPoint(), instrs.size());
     switch (breakpoint_kind_) {
       case RawPcDescriptors::kIcCall:
       case RawPcDescriptors::kUnoptStaticCall: {
-        saved_value_ = CodePatcher::GetStaticCallTargetAt(pc_, code);
-        CodePatcher::PatchStaticCallAt(
-            pc_, code, StubCode::ICCallBreakpoint_entry()->EntryPoint());
+        stub_target = StubCode::ICCallBreakpoint_entry()->code();
         break;
       }
       case RawPcDescriptors::kRuntimeCall: {
         saved_value_ = CodePatcher::GetStaticCallTargetAt(pc_, code);
-        CodePatcher::PatchStaticCallAt(
-            pc_, code, StubCode::RuntimeCallBreakpoint_entry()->EntryPoint());
+        stub_target = StubCode::RuntimeCallBreakpoint_entry()->code();
         break;
       }
       default:
         UNREACHABLE();
     }
+    saved_value_ = CodePatcher::GetStaticCallTargetAt(pc_, code);
+    CodePatcher::PatchStaticCallAt(pc_, code, stub_target);
   }
   is_enabled_ = true;
 }
@@ -60,7 +60,7 @@
       case RawPcDescriptors::kIcCall:
       case RawPcDescriptors::kUnoptStaticCall:
       case RawPcDescriptors::kRuntimeCall: {
-        CodePatcher::PatchStaticCallAt(pc_, code, saved_value_);
+        CodePatcher::PatchStaticCallAt(pc_, code, Code::Handle(saved_value_));
         break;
       }
       default:
diff --git a/runtime/vm/debugger_mips.cc b/runtime/vm/debugger_mips.cc
index 651714b..8a02ca8 100644
--- a/runtime/vm/debugger_mips.cc
+++ b/runtime/vm/debugger_mips.cc
@@ -13,21 +13,21 @@
 
 namespace dart {
 
-uword CodeBreakpoint::OrigStubAddress() const {
+RawCode* CodeBreakpoint::OrigStubAddress() const {
   return saved_value_;
 }
 
 
 void CodeBreakpoint::PatchCode() {
   ASSERT(!is_enabled_);
-  uword stub_target = 0;
+  Code& stub_target = Code::Handle();
   switch (breakpoint_kind_) {
     case RawPcDescriptors::kIcCall:
     case RawPcDescriptors::kUnoptStaticCall:
-      stub_target = StubCode::ICCallBreakpoint_entry()->EntryPoint();
+      stub_target = StubCode::ICCallBreakpoint_entry()->code();
       break;
     case RawPcDescriptors::kRuntimeCall:
-      stub_target = StubCode::RuntimeCallBreakpoint_entry()->EntryPoint();
+      stub_target = StubCode::RuntimeCallBreakpoint_entry()->code();
       break;
     default:
       UNREACHABLE();
@@ -46,7 +46,7 @@
     case RawPcDescriptors::kIcCall:
     case RawPcDescriptors::kUnoptStaticCall:
     case RawPcDescriptors::kRuntimeCall: {
-      CodePatcher::PatchStaticCallAt(pc_, code, saved_value_);
+      CodePatcher::PatchStaticCallAt(pc_, code, Code::Handle(saved_value_));
       break;
     }
     default:
diff --git a/runtime/vm/debugger_test.cc b/runtime/vm/debugger_test.cc
index 7393c67..b418cbf 100644
--- a/runtime/vm/debugger_test.cc
+++ b/runtime/vm/debugger_test.cc
@@ -69,18 +69,18 @@
         js.ToCString(),
         "[{\"type\":\"Breakpoint\",\"fixedId\":true,\"id\":\"breakpoints\\/2\","
         "\"breakpointNumber\":2,\"resolved\":false,"
-        "\"location\":{\"type\":\"SourceLocation\","
+        "\"location\":{\"type\":\"UnresolvedSourceLocation\","
         "\"script\":{\"type\":\"@Script\",\"fixedId\":true,"
         "\"id\":\"libraries\\/%" Pd "\\/scripts\\/test-lib\","
         "\"uri\":\"test-lib\","
-        "\"_kind\":\"script\"},\"tokenPos\":14}},"
+        "\"_kind\":\"script\"},\"line\":3}},"
         "{\"type\":\"Breakpoint\",\"fixedId\":true,\"id\":\"breakpoints\\/1\","
         "\"breakpointNumber\":1,\"resolved\":false,"
-        "\"location\":{\"type\":\"SourceLocation\","
+        "\"location\":{\"type\":\"UnresolvedSourceLocation\","
         "\"script\":{\"type\":\"@Script\",\"fixedId\":true,"
         "\"id\":\"libraries\\/%" Pd "\\/scripts\\/test-lib\","
         "\"uri\":\"test-lib\","
-        "\"_kind\":\"script\"},\"tokenPos\":5}}]",
+        "\"_kind\":\"script\"},\"line\":2}}]",
         vmlib.index(), vmlib.index());
   }
 }
diff --git a/runtime/vm/debugger_x64.cc b/runtime/vm/debugger_x64.cc
index 531876d..4fe2e6a 100644
--- a/runtime/vm/debugger_x64.cc
+++ b/runtime/vm/debugger_x64.cc
@@ -15,21 +15,21 @@
 
 namespace dart {
 
-uword CodeBreakpoint::OrigStubAddress() const {
+RawCode* CodeBreakpoint::OrigStubAddress() const {
   return saved_value_;
 }
 
 
 void CodeBreakpoint::PatchCode() {
   ASSERT(!is_enabled_);
-  uword stub_target = 0;
+  Code& stub_target = Code::Handle();
   switch (breakpoint_kind_) {
     case RawPcDescriptors::kIcCall:
     case RawPcDescriptors::kUnoptStaticCall:
-      stub_target = StubCode::ICCallBreakpoint_entry()->EntryPoint();
+      stub_target = StubCode::ICCallBreakpoint_entry()->code();
       break;
     case RawPcDescriptors::kRuntimeCall:
-      stub_target = StubCode::RuntimeCallBreakpoint_entry()->EntryPoint();
+      stub_target = StubCode::RuntimeCallBreakpoint_entry()->code();
       break;
     default:
       UNREACHABLE();
@@ -48,7 +48,8 @@
     case RawPcDescriptors::kIcCall:
     case RawPcDescriptors::kUnoptStaticCall:
     case RawPcDescriptors::kRuntimeCall: {
-      CodePatcher::PatchPoolPointerCallAt(pc_, code, 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 a647af1..3d86592 100644
--- a/runtime/vm/deferred_objects.cc
+++ b/runtime/vm/deferred_objects.cc
@@ -114,7 +114,7 @@
   // Check that deopt_id exists.
   // TODO(vegorov): verify after deoptimization targets as well.
 #ifdef DEBUG
-  ASSERT(Isolate::IsDeoptAfter(deopt_id_) ||
+  ASSERT(Thread::IsDeoptAfter(deopt_id_) ||
          (code.GetPcForDeoptId(deopt_id_, RawPcDescriptors::kDeopt) != 0));
 #endif
 
@@ -161,11 +161,7 @@
   uword* dest_addr = reinterpret_cast<uword*>(slot());
   Function& function = Function::Handle(zone);
   function ^= deopt_context->ObjectAt(index_);
-  if (function.IsNull()) {
-    // Callee's PC marker is not used (pc of Deoptimize stub). Set to 0.
-    *dest_addr = 0;
-    return;
-  }
+  ASSERT(!function.IsNull());
   const Error& error = Error::Handle(zone,
       Compiler::EnsureUnoptimizedCode(thread, function));
   if (!error.IsNull()) {
@@ -174,9 +170,7 @@
   const Code& code = Code::Handle(zone, function.unoptimized_code());
   ASSERT(!code.IsNull());
   ASSERT(function.HasCode());
-  const intptr_t pc_marker =
-      code.EntryPoint() + Assembler::EntryPointToPcMarkerOffset();
-  *dest_addr = pc_marker;
+  *reinterpret_cast<RawObject**>(dest_addr) = code.raw();
 
   if (FLAG_trace_deoptimization_verbose) {
     OS::PrintErr("materializing pc marker at 0x%" Px ": %s, %s\n",
diff --git a/runtime/vm/deopt_instructions.cc b/runtime/vm/deopt_instructions.cc
index d6e2568..134d85c 100644
--- a/runtime/vm/deopt_instructions.cc
+++ b/runtime/vm/deopt_instructions.cc
@@ -26,7 +26,8 @@
                            const Code& code,
                            DestFrameOptions dest_options,
                            fpu_register_t* fpu_registers,
-                           intptr_t* cpu_registers)
+                           intptr_t* cpu_registers,
+                           bool is_lazy_deopt)
     : code_(code.raw()),
       object_pool_(code.GetObjectPool()),
       deopt_info_(TypedData::null()),
@@ -45,7 +46,8 @@
       timeline_event_(NULL),
       deferred_slots_(NULL),
       deferred_objects_count_(0),
-      deferred_objects_(NULL) {
+      deferred_objects_(NULL),
+      is_lazy_deopt_(is_lazy_deopt) {
   const TypedData& deopt_info = TypedData::Handle(
       code.GetDeoptInfoAtPc(frame->pc(), &deopt_reason_, &deopt_flags_));
   ASSERT(!deopt_info.IsNull());
@@ -651,7 +653,16 @@
   }
 
   void Execute(DeoptContext* deopt_context, intptr_t* dest_addr) {
-    *dest_addr = Smi::RawValue(0);
+    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::DeoptimizeLazy_entry()->code()
+          : StubCode::Deoptimize_entry()->code();
+      return;
+    }
+
+    *dest_addr = reinterpret_cast<intptr_t>(Object::null());
     deopt_context->DeferPcMarkerMaterialization(
         object_table_index_, dest_addr);
   }
@@ -815,7 +826,7 @@
       static_cast<DeoptRetAddressInstr*>(instr);
   // The following assert may trigger when displaying a backtrace
   // from the simulator.
-  ASSERT(Isolate::IsDeoptAfter(ret_address_instr->deopt_id()));
+  ASSERT(Thread::IsDeoptAfter(ret_address_instr->deopt_id()));
   ASSERT(!object_table.IsNull());
   Thread* thread = Thread::Current();
   Zone* zone = thread->zone();
diff --git a/runtime/vm/deopt_instructions.h b/runtime/vm/deopt_instructions.h
index 188e95c..cf357d0 100644
--- a/runtime/vm/deopt_instructions.h
+++ b/runtime/vm/deopt_instructions.h
@@ -34,7 +34,8 @@
                const Code& code,
                DestFrameOptions dest_options,
                fpu_register_t* fpu_registers,
-               intptr_t* cpu_registers);
+               intptr_t* cpu_registers,
+               bool is_lazy_deopt);
   virtual ~DeoptContext();
 
   // Returns the offset of the dest fp from the dest sp.  Used in
@@ -94,6 +95,8 @@
 
   RawCode* code() const { return code_; }
 
+  bool is_lazy_deopt() const { return is_lazy_deopt_; }
+
   ICData::DeoptReasonId deopt_reason() const { return deopt_reason_; }
   bool HasDeoptFlag(ICData::DeoptFlags flag) {
     return (deopt_flags_ & flag) != 0;
@@ -228,6 +231,8 @@
   intptr_t deferred_objects_count_;
   DeferredObject** deferred_objects_;
 
+  const bool is_lazy_deopt_;
+
   DISALLOW_COPY_AND_ASSIGN(DeoptContext);
 };
 
diff --git a/runtime/vm/disassembler.cc b/runtime/vm/disassembler.cc
index 1a92450..986b9b2 100644
--- a/runtime/vm/disassembler.cc
+++ b/runtime/vm/disassembler.cc
@@ -21,22 +21,22 @@
                                              uword pc) {
   static const int kHexColumnWidth = 23;
   uint8_t* pc_ptr = reinterpret_cast<uint8_t*>(pc);
-  ISL_Print("%p    %s", pc_ptr, hex_buffer);
+  THR_Print("%p    %s", pc_ptr, hex_buffer);
   int hex_length = strlen(hex_buffer);
   if (hex_length < kHexColumnWidth) {
     for (int i = kHexColumnWidth - hex_length; i > 0; i--) {
-      ISL_Print(" ");
+      THR_Print(" ");
     }
   }
-  ISL_Print("%s", human_buffer);
-  ISL_Print("\n");
+  THR_Print("%s", human_buffer);
+  THR_Print("\n");
 }
 
 
 void DisassembleToStdout::Print(const char* format, ...) {
   va_list args;
   va_start(args, format);
-  ISL_VPrint(format, args);
+  THR_VPrint(format, args);
   va_end(args);
 }
 
@@ -104,7 +104,8 @@
 bool Disassembler::CanFindOldObject(uword addr) {
   FindAddrVisitor visitor(addr);
   NoSafepointScope no_safepoint;
-  return Isolate::Current()->heap()->FindOldObject(&visitor) != Object::null();
+  return Dart::vm_isolate()->heap()->FindOldObject(&visitor) != Object::null()
+      || Isolate::Current()->heap()->FindOldObject(&visitor) != Object::null();
 }
 
 
diff --git a/runtime/vm/disassembler.h b/runtime/vm/disassembler.h
index 86413f8..1becc4d 100644
--- a/runtime/vm/disassembler.h
+++ b/runtime/vm/disassembler.h
@@ -99,13 +99,13 @@
                           uword end,
                           const Code& code) {
     DisassembleToStdout stdout_formatter;
-    LogBlock lb(Isolate::Current());
+    LogBlock lb;
     Disassemble(start, end, &stdout_formatter, code);
   }
 
   static void Disassemble(uword start, uword end) {
     DisassembleToStdout stdout_formatter;
-    LogBlock lb(Isolate::Current());
+    LogBlock lb;
     Disassemble(start, end, &stdout_formatter);
   }
 
diff --git a/runtime/vm/disassembler_arm.cc b/runtime/vm/disassembler_arm.cc
index 63f759b..93ff293 100644
--- a/runtime/vm/disassembler_arm.cc
+++ b/runtime/vm/disassembler_arm.cc
@@ -109,11 +109,11 @@
 
 
 // These register names are defined in a way to match the native disassembler
-// formatting, except for register aliases ctx (r9) and pp (r10).
+// formatting, except for register alias pp (r9).
 // See for example the command "objdump -d <binary file>".
 static const char* reg_names[kNumberOfCpuRegisters] = {
   "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
-  "r8", "ctx", "pp", "fp", "ip", "sp", "lr", "pc",
+  "r8", "pp", "r10", "fp", "ip", "sp", "lr", "pc",
 };
 
 
diff --git a/runtime/vm/disassembler_ia32.cc b/runtime/vm/disassembler_ia32.cc
index 852621b..0f6dc74 100644
--- a/runtime/vm/disassembler_ia32.cc
+++ b/runtime/vm/disassembler_ia32.cc
@@ -473,17 +473,15 @@
       obj.IsClass() ||
       obj.IsFunction() ||
       obj.IsICData() ||
-      obj.IsField()) {
+      obj.IsField() ||
+      obj.IsCode()) {
     return obj.ToCString();
   }
 
   const Class& clazz = Class::Handle(obj.clazz());
   const char* full_class_name = clazz.ToCString();
-  const char* format = "instance of %s";
-  intptr_t len = OS::SNPrint(NULL, 0, format, full_class_name) + 1;
-  char* chars = Thread::Current()->zone()->Alloc<char>(len);
-  OS::SNPrint(chars, len, format, full_class_name);
-  return chars;
+  return OS::SCreate(Thread::Current()->zone(),
+      "instance of %s", full_class_name);
 }
 
 
@@ -496,6 +494,7 @@
       reinterpret_cast<RawObject*>(addr)->IsWellFormed() &&
       reinterpret_cast<RawObject*>(addr)->IsOldObject() &&
       !Isolate::Current()->heap()->CodeContains(addr) &&
+      !Dart::vm_isolate()->heap()->CodeContains(addr) &&
       Disassembler::CanFindOldObject(addr)) {
     NoSafepointScope no_safepoint;
     const Object& obj = Object::Handle(reinterpret_cast<RawObject*>(addr));
@@ -526,16 +525,6 @@
       Print("  [stub: ");
       Print(name_of_stub);
       Print("]");
-    } else {
-      // Print only if jumping to entry point.
-      const Code& code = Code::Handle(Code::LookupCode(addr));
-      if (!code.IsNull() && (code.EntryPoint() == addr)) {
-        const String& name = String::Handle(code.PrettyName());
-        const char* name_c = name.ToCString();
-        Print(" [");
-        Print(name_c);
-        Print("]");
-      }
     }
   }
 }
@@ -1405,17 +1394,17 @@
             data += 5;
           } else if (*(data+2) == 0x80 &&
                      *(data+3) == 0x00 &&
-                     *(data+3) == 0x00 &&
-                     *(data+3) == 0x00 &&
-                     *(data+4) == 0x00) {
+                     *(data+4) == 0x00 &&
+                     *(data+5) == 0x00 &&
+                     *(data+6) == 0x00) {
             Print("nop");
             data += 7;
           } else if (*(data+2) == 0x84 &&
                      *(data+3) == 0x00 &&
-                     *(data+3) == 0x00 &&
-                     *(data+3) == 0x00 &&
-                     *(data+3) == 0x00 &&
-                     *(data+4) == 0x00) {
+                     *(data+4) == 0x00 &&
+                     *(data+5) == 0x00 &&
+                     *(data+6) == 0x00 &&
+                     *(data+7) == 0x00) {
             Print("nop");
             data += 8;
           } else {
diff --git a/runtime/vm/disassembler_x64.cc b/runtime/vm/disassembler_x64.cc
index 9f43a38..4778695 100644
--- a/runtime/vm/disassembler_x64.cc
+++ b/runtime/vm/disassembler_x64.cc
@@ -790,17 +790,15 @@
       obj.IsClass() ||
       obj.IsFunction() ||
       obj.IsICData() ||
-      obj.IsField()) {
+      obj.IsField() ||
+      obj.IsCode()) {
     return obj.ToCString();
   }
 
   const Class& clazz = Class::Handle(obj.clazz());
   const char* full_class_name = clazz.ToCString();
-  const char* format = "instance of %s";
-  intptr_t len = OS::SNPrint(NULL, 0, format, full_class_name) + 1;
-  char* chars = Thread::Current()->zone()->Alloc<char>(len);
-  OS::SNPrint(chars, len, format, full_class_name);
-  return chars;
+  return OS::SCreate(Thread::Current()->zone(),
+      "instance of %s", full_class_name);
 }
 
 
@@ -811,6 +809,7 @@
   if (((addr & kSmiTagMask) == kHeapObjectTag) &&
       reinterpret_cast<RawObject*>(addr)->IsWellFormed() &&
       reinterpret_cast<RawObject*>(addr)->IsOldObject() &&
+      !Dart::vm_isolate()->heap()->CodeContains(addr) &&
       !Isolate::Current()->heap()->CodeContains(addr) &&
       Disassembler::CanFindOldObject(addr)) {
     NoSafepointScope no_safepoint;
@@ -838,14 +837,6 @@
     const char* name_of_stub = StubCode::NameOfStub(addr);
     if (name_of_stub != NULL) {
       AppendToBuffer("  [stub: %s]", name_of_stub);
-    } else {
-      // Print only if jumping to entry point.
-      const Code& code = Code::Handle(Code::LookupCode(addr));
-      if (!code.IsNull() && (code.EntryPoint() == addr)) {
-        const String& name = String::Handle(code.PrettyName());
-        const char* name_c = name.ToCString();
-        AppendToBuffer(" [%s]", name_c);
-      }
     }
   }
 }
diff --git a/runtime/vm/exceptions.cc b/runtime/vm/exceptions.cc
index 9f79640..d5d4b39 100644
--- a/runtime/vm/exceptions.cc
+++ b/runtime/vm/exceptions.cc
@@ -37,11 +37,11 @@
 
 class RegularStacktraceBuilder : public StacktraceBuilder {
  public:
-  explicit RegularStacktraceBuilder(Isolate* isolate)
+  explicit RegularStacktraceBuilder(Zone* zone)
       : code_list_(
-          GrowableObjectArray::Handle(isolate, GrowableObjectArray::New())),
+          GrowableObjectArray::Handle(zone, GrowableObjectArray::New())),
         pc_offset_list_(
-          GrowableObjectArray::Handle(isolate, GrowableObjectArray::New())) { }
+          GrowableObjectArray::Handle(zone, GrowableObjectArray::New())) { }
   ~RegularStacktraceBuilder() { }
 
   const GrowableObjectArray& code_list() const { return code_list_; }
@@ -111,7 +111,7 @@
 }
 
 
-static void BuildStackTrace(Isolate* isolate, StacktraceBuilder* builder) {
+static void BuildStackTrace(StacktraceBuilder* builder) {
   StackFrameIterator frames(StackFrameIterator::kDontValidateFrames);
   StackFrame* frame = frames.NextFrame();
   ASSERT(frame != NULL);  // We expect to find a dart invocation frame.
@@ -132,7 +132,7 @@
 // exception handler. Once found, set the pc, sp and fp so that execution
 // can continue in that frame. Sets 'needs_stacktrace' if there is no
 // cath-all handler or if a stack-trace is specified in the catch.
-static bool FindExceptionHandler(Isolate* isolate,
+static bool FindExceptionHandler(Thread* thread,
                                  uword* handler_pc,
                                  uword* handler_sp,
                                  uword* handler_fp,
@@ -146,7 +146,7 @@
   uword temp_handler_pc = kUwordMax;
   while (!frame->IsEntryFrame()) {
     if (frame->IsDartFrame()) {
-      if (frame->FindExceptionHandler(isolate,
+      if (frame->FindExceptionHandler(thread,
                                       &temp_handler_pc,
                                       needs_stacktrace,
                                       &is_catch_all)) {
@@ -247,18 +247,20 @@
     // 'class Error' is not a predefined class.
     return Field::null();
   }
-  Isolate* isolate = Isolate::Current();
-  Class& error_class = Class::Handle(isolate,
+  Thread* thread = Thread::Current();
+  Zone* zone = thread->zone();
+  Isolate* isolate = thread->isolate();
+  Class& error_class = Class::Handle(zone,
                                      isolate->object_store()->error_class());
   if (error_class.IsNull()) {
-    const Library& core_lib = Library::Handle(isolate, Library::CoreLibrary());
+    const Library& core_lib = Library::Handle(zone, Library::CoreLibrary());
     error_class = core_lib.LookupClass(Symbols::Error());
     ASSERT(!error_class.IsNull());
     isolate->object_store()->set_error_class(error_class);
   }
   // If instance class extends 'class Error' return '_stackTrace' field.
-  Class& test_class = Class::Handle(isolate, instance.clazz());
-  AbstractType& type = AbstractType::Handle(isolate, AbstractType::null());
+  Class& test_class = Class::Handle(zone, instance.clazz());
+  AbstractType& type = AbstractType::Handle(zone, AbstractType::null());
   while (true) {
     if (test_class.raw() == error_class.raw()) {
       return error_class.LookupInstanceField(Symbols::_stackTrace());
@@ -273,14 +275,14 @@
 
 
 RawStacktrace* Exceptions::CurrentStacktrace() {
-  Isolate* isolate = Isolate::Current();
-  RegularStacktraceBuilder frame_builder(isolate);
-  BuildStackTrace(isolate, &frame_builder);
+  Zone* zone = Thread::Current()->zone();
+  RegularStacktraceBuilder frame_builder(zone);
+  BuildStackTrace(&frame_builder);
 
   // Create arrays for code and pc_offset tuples of each frame.
-  const Array& full_code_array = Array::Handle(isolate,
+  const Array& full_code_array = Array::Handle(zone,
       Array::MakeArray(frame_builder.code_list()));
-  const Array& full_pc_offset_array = Array::Handle(isolate,
+  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));
@@ -292,9 +294,10 @@
                                  const Instance& incoming_exception,
                                  const Instance& existing_stacktrace,
                                  const bool is_rethrow) {
+  Zone* zone = thread->zone();
   Isolate* isolate = thread->isolate();
   bool use_preallocated_stacktrace = false;
-  Instance& exception = Instance::Handle(isolate, incoming_exception.raw());
+  Instance& exception = Instance::Handle(zone, incoming_exception.raw());
   if (exception.IsNull()) {
     exception ^= Exceptions::Create(Exceptions::kNullThrown,
                                     Object::empty_array());
@@ -305,29 +308,29 @@
   uword handler_pc = 0;
   uword handler_sp = 0;
   uword handler_fp = 0;
-  Instance& stacktrace = Instance::Handle(isolate);
+  Instance& stacktrace = Instance::Handle(zone);
   bool handler_exists = false;
   bool handler_needs_stacktrace = false;
   if (use_preallocated_stacktrace) {
     stacktrace ^= isolate->object_store()->preallocated_stack_trace();
     PreallocatedStacktraceBuilder frame_builder(stacktrace);
-    handler_exists = FindExceptionHandler(isolate,
+    handler_exists = FindExceptionHandler(thread,
                                           &handler_pc,
                                           &handler_sp,
                                           &handler_fp,
                                           &handler_needs_stacktrace);
     if (handler_needs_stacktrace) {
-      BuildStackTrace(isolate, &frame_builder);
+      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(isolate, LookupStacktraceField(exception));
+        Field::Handle(zone, LookupStacktraceField(exception));
 
     // Find the exception handler and determine if the handler needs a
     // stacktrace.
-    handler_exists = FindExceptionHandler(isolate,
+    handler_exists = FindExceptionHandler(thread,
                                           &handler_pc,
                                           &handler_sp,
                                           &handler_fp,
@@ -379,7 +382,7 @@
     // dart invocation sequence above it, print diagnostics and terminate
     // the isolate etc.).
     const UnhandledException& unhandled_exception = UnhandledException::Handle(
-        isolate, UnhandledException::New(exception, stacktrace));
+        zone, UnhandledException::New(exception, stacktrace));
     stacktrace = Stacktrace::null();
     JumpToExceptionHandler(thread,
                            handler_pc,
@@ -485,7 +488,8 @@
     isolate->debugger()->SignalExceptionThrown(exception);
   }
   // Null object is a valid exception object.
-  ThrowExceptionHelper(thread, exception, Stacktrace::Handle(isolate), false);
+  ThrowExceptionHelper(thread, exception,
+      Stacktrace::Handle(thread->zone()), false);
 }
 
 void Exceptions::ReThrow(Thread* thread,
@@ -499,13 +503,14 @@
 void Exceptions::PropagateError(const Error& error) {
   Thread* thread = Thread::Current();
   Isolate* isolate = thread->isolate();
+  Zone* zone = thread->zone();
   ASSERT(isolate->top_exit_frame_info() != 0);
   if (error.IsUnhandledException()) {
     // If the error object represents an unhandled exception, then
     // rethrow the exception in the normal fashion.
     const UnhandledException& uhe = UnhandledException::Cast(error);
-    const Instance& exc = Instance::Handle(isolate, uhe.exception());
-    const Instance& stk = Instance::Handle(isolate, uhe.stacktrace());
+    const Instance& exc = Instance::Handle(zone, uhe.exception());
+    const Instance& stk = Instance::Handle(zone, uhe.stacktrace());
     Exceptions::ReThrow(thread, exc, stk);
   } else {
     // Return to the invocation stub and return this error object.  The
@@ -516,7 +521,7 @@
     uword handler_fp = 0;
     FindErrorHandler(&handler_pc, &handler_sp, &handler_fp);
     JumpToExceptionHandler(thread, handler_pc, handler_sp, handler_fp, error,
-                           Stacktrace::Handle(isolate));  // Null stacktrace.
+                           Stacktrace::Handle(zone));  // Null stacktrace.
   }
   UNREACHABLE();
 }
@@ -524,8 +529,8 @@
 
 void Exceptions::ThrowByType(ExceptionType type, const Array& arguments) {
   Thread* thread = Thread::Current();
-  Isolate* isolate = thread->isolate();
-  const Object& result = Object::Handle(isolate, Create(type, arguments));
+  const Object& result =
+      Object::Handle(thread->zone(), Create(type, arguments));
   if (result.IsError()) {
     // We got an error while constructing the exception object.
     // Propagate the error instead of throwing the exception.
@@ -541,7 +546,7 @@
   Thread* thread = Thread::Current();
   Isolate* isolate = thread->isolate();
   const Instance& oom = Instance::Handle(
-      isolate, isolate->object_store()->out_of_memory());
+      thread->zone(), isolate->object_store()->out_of_memory());
   Throw(thread, oom);
 }
 
@@ -550,7 +555,7 @@
   Thread* thread = Thread::Current();
   Isolate* isolate = thread->isolate();
   const Instance& stack_overflow = Instance::Handle(
-      isolate, isolate->object_store()->stack_overflow());
+      thread->zone(), isolate->object_store()->stack_overflow());
   Throw(thread, stack_overflow);
 }
 
@@ -571,7 +576,7 @@
   args.SetAt(1, Integer::Handle(Integer::New(expected_from)));
   args.SetAt(2, Integer::Handle(Integer::New(expected_to)));
   args.SetAt(3, String::Handle(String::New(argument_name)));
-  Exceptions::ThrowByType(Exceptions::kRangeRange, args);
+  Exceptions::ThrowByType(Exceptions::kRange, args);
 }
 
 
@@ -588,16 +593,17 @@
     case kRange:
       library = Library::CoreLibrary();
       class_name = &Symbols::RangeError();
-      break;
-    case kRangeRange:
-      library = Library::CoreLibrary();
-      class_name = &Symbols::RangeError();
       constructor_name = &Symbols::DotRange();
       break;
     case kArgument:
       library = Library::CoreLibrary();
       class_name = &Symbols::ArgumentError();
       break;
+    case kArgumentValue:
+      library = Library::CoreLibrary();
+      class_name = &Symbols::ArgumentError();
+      constructor_name = &Symbols::DotValue();
+      break;
     case kNoSuchMethod:
       library = Library::CoreLibrary();
       class_name = &Symbols::NoSuchMethodError();
diff --git a/runtime/vm/exceptions.h b/runtime/vm/exceptions.h
index a2a1cb1..0bd97f8 100644
--- a/runtime/vm/exceptions.h
+++ b/runtime/vm/exceptions.h
@@ -51,8 +51,8 @@
   enum ExceptionType {
     kNone,
     kRange,
-    kRangeRange,
     kArgument,
+    kArgumentValue,
     kNoSuchMethod,
     kFormat,
     kUnsupported,
diff --git a/runtime/vm/find_code_object_test.cc b/runtime/vm/find_code_object_test.cc
index f67b684..96ff8d3 100644
--- a/runtime/vm/find_code_object_test.cc
+++ b/runtime/vm/find_code_object_test.cc
@@ -27,7 +27,7 @@
   Isolate* isolate = Isolate::Current();
   ASSERT(isolate != NULL);
 
-  StackZone zone(isolate);
+  StackZone zone(thread);
   String& url = String::Handle(String::New("dart-test:FindCodeObject"));
   String& source = String::Handle();
   Script& script = Script::Handle();
diff --git a/runtime/vm/flow_graph.cc b/runtime/vm/flow_graph.cc
index 53106a8..a4753f2 100644
--- a/runtime/vm/flow_graph.cc
+++ b/runtime/vm/flow_graph.cc
@@ -185,7 +185,7 @@
 
 
 void FlowGraph::DiscoverBlocks() {
-  StackZone zone(isolate());
+  StackZone zone(thread());
 
   // Initialize state.
   preorder_.Clear();
@@ -921,7 +921,7 @@
         PhiInstr* phi = (*join->phis())[i];
         if (phi != NULL) {
           (*env)[i] = phi;
-          phi->set_ssa_temp_index(alloc_ssa_temp_index());  // New SSA temp.
+          AllocateSSAIndexes(phi);  // New SSA temp.
           if (block_entry->InsideTryBlock() && !phi->is_alive()) {
             // This is a safe approximation.  Inside try{} all locals are
             // used at every call implicitly, so we mark all phis as live
diff --git a/runtime/vm/flow_graph_allocator.cc b/runtime/vm/flow_graph_allocator.cc
index 6f5deb4..208a4af 100644
--- a/runtime/vm/flow_graph_allocator.cc
+++ b/runtime/vm/flow_graph_allocator.cc
@@ -222,11 +222,14 @@
     if (block->IsJoinEntry()) {
       JoinEntryInstr* join = block->AsJoinEntry();
       for (PhiIterator it(join); !it.Done(); it.Advance()) {
-        // TODO(johnmccutchan): Fix handling of PhiInstr with PairLocation.
         PhiInstr* phi = it.Current();
         ASSERT(phi != NULL);
         kill->Add(phi->ssa_temp_index());
         live_in->Remove(phi->ssa_temp_index());
+        if (phi->HasPairRepresentation()) {
+          kill->Add(ToSecondPairVreg(phi->ssa_temp_index()));
+          live_in->Remove(ToSecondPairVreg(phi->ssa_temp_index()));
+        }
 
         // If a phi input is not defined by the corresponding predecessor it
         // must be marked live-in for that predecessor.
@@ -239,6 +242,12 @@
           if (!kill_[pred->postorder_number()]->Contains(use)) {
             live_in_[pred->postorder_number()]->Add(use);
           }
+          if (phi->HasPairRepresentation()) {
+            const intptr_t second_use = ToSecondPairVreg(use);
+            if (!kill_[pred->postorder_number()]->Contains(second_use)) {
+              live_in_[pred->postorder_number()]->Add(second_use);
+            }
+          }
         }
       }
     } else if (block->IsCatchBlockEntry()) {
@@ -450,21 +459,21 @@
     return;
   }
 
-  ISL_Print("  live range v%" Pd " [%" Pd ", %" Pd ") in ", vreg(),
+  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();
-    ISL_Print(" allocated spill slot: %" Pd "", stack_slot);
+    THR_Print(" allocated spill slot: %" Pd "", stack_slot);
   }
-  ISL_Print("\n");
+  THR_Print("\n");
 
   SafepointPosition* safepoint = first_safepoint();
   while (safepoint != NULL) {
-    ISL_Print("    Safepoint [%" Pd "]: ", safepoint->pos());
+    THR_Print("    Safepoint [%" Pd "]: ", safepoint->pos());
     safepoint->locs()->stack_bitmap()->Print();
-    ISL_Print("\n");
+    THR_Print("\n");
     safepoint = safepoint->next();
   }
 
@@ -472,16 +481,16 @@
   for (UseInterval* interval = first_use_interval_;
        interval != NULL;
        interval = interval->next()) {
-    ISL_Print("    use interval [%" Pd ", %" Pd ")\n",
+    THR_Print("    use interval [%" Pd ", %" Pd ")\n",
               interval->start(),
               interval->end());
     while ((use_pos != NULL) && (use_pos->pos() <= interval->end())) {
-      ISL_Print("      use at %" Pd "", use_pos->pos());
+      THR_Print("      use at %" Pd "", use_pos->pos());
       if (use_pos->location_slot() != NULL) {
-        ISL_Print(" as ");
+        THR_Print(" as ");
         use_pos->location_slot()->Print();
       }
-      ISL_Print("\n");
+      THR_Print("\n");
       use_pos = use_pos->next();
     }
   }
@@ -774,20 +783,18 @@
 
   // Search for the index of the current block in the predecessors of
   // the join.
-  const intptr_t pred_idx = join->IndexOfPredecessor(block);
+  const intptr_t pred_index = join->IndexOfPredecessor(block);
 
   // Record the corresponding phi input use for each phi.
-  intptr_t move_idx = 0;
+  intptr_t move_index = 0;
   for (PhiIterator it(join); !it.Done(); it.Advance()) {
-    // TODO(johnmccutchan): Fix handling of PhiInstr with PairLocation.
     PhiInstr* phi = it.Current();
-    Value* val = phi->InputAt(pred_idx);
-    MoveOperands* move = parallel_move->MoveOperandsAt(move_idx);
+    Value* val = phi->InputAt(pred_index);
+    MoveOperands* move = parallel_move->MoveOperandsAt(move_index++);
 
     ConstantInstr* constant = val->definition()->AsConstant();
     if (constant != NULL) {
       move->set_src(Location::Constant(constant));
-      move_idx++;
       continue;
     }
 
@@ -796,8 +803,7 @@
     //                 g  g'
     //      value    --*
     //
-
-    const intptr_t vreg = val->definition()->ssa_temp_index();
+    intptr_t vreg = val->definition()->ssa_temp_index();
     LiveRange* range = GetLiveRange(vreg);
     if (interfere_at_backedge != NULL) interfere_at_backedge->Add(vreg);
 
@@ -806,9 +812,23 @@
         pos,
         move->src_slot(),
         GetLiveRange(phi->ssa_temp_index())->assigned_location_slot());
-
     move->set_src(Location::PrefersRegister());
-    move_idx++;
+
+    if (val->definition()->HasPairRepresentation()) {
+      move = parallel_move->MoveOperandsAt(move_index++);
+      vreg = ToSecondPairVreg(vreg);
+      range = GetLiveRange(vreg);
+      if (interfere_at_backedge != NULL) {
+        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());
+      move->set_src(Location::PrefersRegister());
+    }
   }
 
   // Begin backward iteration with the instruction before the parallel
@@ -826,11 +846,11 @@
   const bool is_loop_header = BlockInfoAt(join->start_pos())->is_loop_header();
   intptr_t move_idx = 0;
   for (PhiIterator it(join); !it.Done(); it.Advance()) {
-    // TODO(johnmccutchan): Fix handling of PhiInstr with PairLocation.
     PhiInstr* phi = it.Current();
     ASSERT(phi != NULL);
     const intptr_t vreg = phi->ssa_temp_index();
     ASSERT(vreg >= 0);
+    const bool is_pair_phi = phi->HasPairRepresentation();
 
     // Expected shape of live range:
     //
@@ -839,9 +859,14 @@
     //
     LiveRange* range = GetLiveRange(vreg);
     range->DefineAt(pos);  // Shorten live range.
-
     if (is_loop_header) range->mark_loop_phi();
 
+    if (is_pair_phi) {
+      LiveRange* second_range = GetLiveRange(ToSecondPairVreg(vreg));
+      second_range->DefineAt(pos);  // Shorten live range.
+      if (is_loop_header) second_range->mark_loop_phi();
+    }
+
     for (intptr_t pred_idx = 0; pred_idx < phi->InputCount(); pred_idx++) {
       BlockEntryInstr* pred = join->PredecessorAt(pred_idx);
       GotoInstr* goto_instr = pred->last_instruction()->AsGoto();
@@ -850,15 +875,26 @@
           goto_instr->parallel_move()->MoveOperandsAt(move_idx);
       move->set_dest(Location::PrefersRegister());
       range->AddUse(pos, move->dest_slot());
+      if (is_pair_phi) {
+        LiveRange* second_range = GetLiveRange(ToSecondPairVreg(vreg));
+        MoveOperands* second_move =
+            goto_instr->parallel_move()->MoveOperandsAt(move_idx + 1);
+        second_move->set_dest(Location::PrefersRegister());
+        second_range->AddUse(pos, second_move->dest_slot());
+      }
     }
 
     // All phi resolution moves are connected. Phi's live range is
     // complete.
     AssignSafepoints(phi, range);
-
     CompleteRange(range, RegisterKindForResult(phi));
+    if (is_pair_phi) {
+      LiveRange* second_range = GetLiveRange(ToSecondPairVreg(vreg));
+      AssignSafepoints(phi, second_range);
+      CompleteRange(second_range, RegisterKindForResult(phi));
+    }
 
-    move_idx++;
+    move_idx += is_pair_phi ? 2 : 1;
   }
 }
 
@@ -1499,10 +1535,11 @@
     // For join entry predecessors create phi resolution moves if
     // necessary. They will be populated by the register allocator.
     JoinEntryInstr* join = block->AsJoinEntry();
-    if ((join != NULL) &&
-        (join->phis() != NULL) &&
-        !join->phis()->is_empty()) {
-      const intptr_t phi_count = join->phis()->length();
+    if (join != NULL) {
+      intptr_t move_count = 0;
+      for (PhiIterator it(join); !it.Done(); it.Advance()) {
+        move_count += it.Current()->HasPairRepresentation() ? 2 : 1;
+      }
       for (intptr_t i = 0; i < block->PredecessorCount(); i++) {
         // Insert the move between the last two instructions of the
         // predecessor block (all such blocks have at least two instructions:
@@ -1513,7 +1550,7 @@
         ParallelMoveInstr* move = last->AsGoto()->GetParallelMove();
 
         // Populate the ParallelMove with empty moves.
-        for (intptr_t j = 0; j < phi_count; j++) {
+        for (intptr_t j = 0; j < move_count; j++) {
           move->AddMove(Location::NoLocation(), Location::NoLocation());
         }
       }
@@ -1784,7 +1821,7 @@
                                 first_safepoint_after_split,
                                 next_sibling_);
 
-  TRACE_ALLOC(ISL_Print("  split sibling [%" Pd ", %" Pd ")\n",
+  TRACE_ALLOC(THR_Print("  split sibling [%" Pd ", %" Pd ")\n",
                         next_sibling_->Start(), next_sibling_->End()));
 
   last_use_interval_ = last_before_split;
@@ -1801,7 +1838,7 @@
 LiveRange* FlowGraphAllocator::SplitBetween(LiveRange* range,
                                             intptr_t from,
                                             intptr_t to) {
-  TRACE_ALLOC(ISL_Print("split v%" Pd " [%" Pd ", %" Pd
+  TRACE_ALLOC(THR_Print("split v%" Pd " [%" Pd ", %" Pd
                         ") between [%" Pd ", %" Pd ")\n",
                         range->vreg(), range->Start(), range->End(), from, to));
 
@@ -1841,7 +1878,7 @@
                                       intptr_t from,
                                       intptr_t to) {
   ASSERT(from < to);
-  TRACE_ALLOC(ISL_Print("spill v%" Pd " [%" Pd ", %" Pd ") "
+  TRACE_ALLOC(THR_Print("spill v%" Pd " [%" Pd ", %" Pd ") "
                         "between [%" Pd ", %" Pd ")\n",
                         range->vreg(), range->Start(), range->End(), from, to));
   LiveRange* tail = range->SplitAt(from);
@@ -1859,7 +1896,7 @@
 
 
 void FlowGraphAllocator::SpillAfter(LiveRange* range, intptr_t from) {
-  TRACE_ALLOC(ISL_Print("spill v%" Pd " [%" Pd ", %" Pd ") after %" Pd "\n",
+  TRACE_ALLOC(THR_Print("spill v%" Pd " [%" Pd ", %" Pd ") after %" Pd "\n",
                         range->vreg(), range->Start(), range->End(), from));
 
   // When spilling the value inside the loop check if this spill can
@@ -1873,7 +1910,7 @@
         RangeHasOnlyUnconstrainedUsesInLoop(range, loop_header->loop_id())) {
       ASSERT(loop_header->entry()->start_pos() <= from);
       from = loop_header->entry()->start_pos();
-      TRACE_ALLOC(ISL_Print("  moved spill position to loop header %" Pd "\n",
+      TRACE_ALLOC(THR_Print("  moved spill position to loop header %" Pd "\n",
                             from));
     }
   }
@@ -2023,7 +2060,6 @@
 
 
 void ReachingDefs::AddPhi(PhiInstr* phi) {
-  // TODO(johnmccutchan): Fix handling of PhiInstr with PairLocation.
   if (phi->reaching_defs() == NULL) {
     Zone* zone = flow_graph_.zone();
     phi->set_reaching_defs(new(zone) BitVector(
@@ -2037,6 +2073,9 @@
         depends_on_phi = true;
       }
       phi->reaching_defs()->Add(input->ssa_temp_index());
+      if (phi->HasPairRepresentation()) {
+        phi->reaching_defs()->Add(ToSecondPairVreg(input->ssa_temp_index()));
+      }
     }
 
     // If this phi depends on another phi then we need fix point iteration.
@@ -2048,7 +2087,6 @@
 void ReachingDefs::Compute() {
   // Transitively collect all phis that are used by the given phi.
   for (intptr_t i = 0; i < phis_.length(); i++) {
-    // TODO(johnmccutchan): Fix handling of PhiInstr with PairLocation.
     PhiInstr* phi = phis_[i];
 
     // Add all phis that affect this phi to the list.
@@ -2105,7 +2143,7 @@
       candidate = hint.register_code();
     }
 
-    TRACE_ALLOC(ISL_Print("found hint %s for v%" Pd ": free until %" Pd "\n",
+    TRACE_ALLOC(THR_Print("found hint %s for v%" Pd ": free until %" Pd "\n",
                           hint.Name(),
                           unallocated->vreg(),
                           free_until));
@@ -2153,22 +2191,31 @@
     for (PhiIterator it(loop_header->entry()->AsJoinEntry());
          !it.Done();
          it.Advance()) {
-      // TODO(johnmccutchan): Fix handling of PhiInstr with PairLocation.
       PhiInstr* phi = it.Current();
       ASSERT(phi->is_alive());
       const intptr_t phi_vreg = phi->ssa_temp_index();
       LiveRange* range = GetLiveRange(phi_vreg);
       if (range->assigned_location().kind() == register_kind_) {
         const intptr_t reg = range->assigned_location().register_code();
-
         if (!reaching_defs_.Get(phi)->Contains(unallocated->vreg())) {
           used_on_backedge[reg] = true;
         }
       }
+      if (phi->HasPairRepresentation()) {
+        const intptr_t second_phi_vreg = ToSecondPairVreg(phi_vreg);
+        LiveRange* second_range = GetLiveRange(second_phi_vreg);
+        if (second_range->assigned_location().kind() == register_kind_) {
+          const intptr_t reg =
+              second_range->assigned_location().register_code();
+          if (!reaching_defs_.Get(phi)->Contains(unallocated->vreg())) {
+            used_on_backedge[reg] = true;
+          }
+        }
+      }
     }
 
     if (used_on_backedge[candidate]) {
-      TRACE_ALLOC(ISL_Print(
+      TRACE_ALLOC(THR_Print(
           "considering %s for v%" Pd ": has interference on the back edge"
           " {loop [%" Pd ", %" Pd ")}\n",
           MakeRegisterLocation(candidate).Name(),
@@ -2187,7 +2234,7 @@
         if (intersection >= free_until) {
           candidate = reg;
           free_until = intersection;
-          TRACE_ALLOC(ISL_Print(
+          TRACE_ALLOC(THR_Print(
               "found %s for v%" Pd " with no interference on the back edge\n",
               MakeRegisterLocation(candidate).Name(),
               candidate));
@@ -2197,13 +2244,13 @@
     }
   }
 
-  TRACE_ALLOC(ISL_Print("assigning free register "));
+  TRACE_ALLOC(THR_Print("assigning free register "));
   TRACE_ALLOC(MakeRegisterLocation(candidate).Print());
-  TRACE_ALLOC(ISL_Print(" to v%" Pd "\n", unallocated->vreg()));
+  TRACE_ALLOC(THR_Print(" to v%" Pd "\n", unallocated->vreg()));
 
   if (free_until != kMaxPosition) {
     // There was an intersection. Split unallocated.
-    TRACE_ALLOC(ISL_Print("  splitting at %" Pd "\n", free_until));
+    TRACE_ALLOC(THR_Print("  splitting at %" Pd "\n", free_until));
     LiveRange* tail = unallocated->SplitAt(free_until);
     AddToUnallocated(tail);
   }
@@ -2302,9 +2349,9 @@
 
   ASSERT(candidate != kNoRegister);
 
-  TRACE_ALLOC(ISL_Print("assigning blocked register "));
+  TRACE_ALLOC(THR_Print("assigning blocked register "));
   TRACE_ALLOC(MakeRegisterLocation(candidate).Print());
-  TRACE_ALLOC(ISL_Print(" to live range v%" Pd " until %" Pd "\n",
+  TRACE_ALLOC(THR_Print(" to live range v%" Pd " until %" Pd "\n",
                         unallocated->vreg(), blocked_at));
 
   if (blocked_at < unallocated->End()) {
@@ -2469,9 +2516,9 @@
   ASSERT(use->location_slot() != NULL);
   Location* slot = use->location_slot();
   ASSERT(slot->IsUnallocated());
-  TRACE_ALLOC(ISL_Print("  use at %" Pd " converted to ", use->pos()));
+  TRACE_ALLOC(THR_Print("  use at %" Pd " converted to ", use->pos()));
   TRACE_ALLOC(loc.Print());
-  TRACE_ALLOC(ISL_Print("\n"));
+  TRACE_ALLOC(THR_Print("\n"));
   *slot = loc;
 }
 
@@ -2482,11 +2529,11 @@
   const Location loc = range->assigned_location();
   ASSERT(!loc.IsInvalid());
 
-  TRACE_ALLOC(ISL_Print("range [%" Pd ", %" Pd ") "
+  TRACE_ALLOC(THR_Print("range [%" Pd ", %" Pd ") "
                         "for v%" Pd " has been allocated to ",
                         range->Start(), range->End(), range->vreg()));
   TRACE_ALLOC(loc.Print());
-  TRACE_ALLOC(ISL_Print(":\n"));
+  TRACE_ALLOC(THR_Print(":\n"));
 
   for (UsePosition* use = range->first_use(); use != NULL; use = use->next()) {
     ConvertUseTo(use, loc);
@@ -2662,7 +2709,7 @@
   while (!unallocated_.is_empty()) {
     LiveRange* range = unallocated_.RemoveLast();
     const intptr_t start = range->Start();
-    TRACE_ALLOC(ISL_Print("Processing live range for v%" Pd " "
+    TRACE_ALLOC(THR_Print("Processing live range for v%" Pd " "
                           "starting at %" Pd "\n",
                           range->vreg(),
                           start));
@@ -2686,7 +2733,7 @@
 
   // Finish allocation.
   AdvanceActiveIntervals(kMaxPosition);
-  TRACE_ALLOC(ISL_Print("Allocation completed\n"));
+  TRACE_ALLOC(THR_Print("Allocation completed\n"));
 }
 
 
@@ -2705,13 +2752,13 @@
 void FlowGraphAllocator::ConnectSplitSiblings(LiveRange* parent,
                                               BlockEntryInstr* source_block,
                                               BlockEntryInstr* target_block) {
-  TRACE_ALLOC(ISL_Print("Connect v%" Pd " on the edge B%" Pd " -> B%" Pd "\n",
+  TRACE_ALLOC(THR_Print("Connect v%" Pd " on the edge B%" Pd " -> B%" Pd "\n",
                         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.
-    TRACE_ALLOC(ISL_Print("range v%" Pd " has no siblings\n", parent->vreg()));
+    TRACE_ALLOC(THR_Print("range v%" Pd " has no siblings\n", parent->vreg()));
     return;
   }
 
@@ -2748,7 +2795,7 @@
     range = range->next_sibling();
   }
 
-  TRACE_ALLOC(ISL_Print("connecting v%" Pd " between [%" Pd ", %" Pd ") {%s} "
+  TRACE_ALLOC(THR_Print("connecting v%" Pd " between [%" Pd ", %" Pd ") {%s} "
                         "to [%" Pd ", %" Pd ") {%s}\n",
                         parent->vreg(),
                         source_cover->Start(),
@@ -2785,13 +2832,13 @@
 
     while (range->next_sibling() != NULL) {
       LiveRange* sibling = range->next_sibling();
-      TRACE_ALLOC(ISL_Print("connecting [%" Pd ", %" Pd ") [",
+      TRACE_ALLOC(THR_Print("connecting [%" Pd ", %" Pd ") [",
                             range->Start(), range->End()));
       TRACE_ALLOC(range->assigned_location().Print());
-      TRACE_ALLOC(ISL_Print("] to [%" Pd ", %" Pd ") [",
+      TRACE_ALLOC(THR_Print("] to [%" Pd ", %" Pd ") [",
                             sibling->Start(), sibling->End()));
       TRACE_ALLOC(sibling->assigned_location().Print());
-      TRACE_ALLOC(ISL_Print("]\n"));
+      TRACE_ALLOC(THR_Print("]\n"));
       if ((range->End() == sibling->Start()) &&
           !TargetLocationIsSpillSlot(range, sibling->assigned_location()) &&
           !range->assigned_location().Equals(sibling->assigned_location()) &&
@@ -2877,11 +2924,12 @@
     if (block->IsJoinEntry()) {
       JoinEntryInstr* join = block->AsJoinEntry();
       for (PhiIterator it(join); !it.Done(); it.Advance()) {
-        // TODO(johnmccutchan): Fix handling of PhiInstr with PairLocation.
         PhiInstr* phi = it.Current();
-        if ((phi != NULL) && (phi->ssa_temp_index() >= 0)) {
-          ASSERT(!phi->HasPairRepresentation());
-          value_representations_[phi->ssa_temp_index()] =
+        ASSERT(phi != NULL && phi->ssa_temp_index() >= 0);
+        value_representations_[phi->ssa_temp_index()] =
+            RepresentationForRange(phi->representation());
+        if (phi->HasPairRepresentation()) {
+          value_representations_[ToSecondPairVreg(phi->ssa_temp_index())] =
               RepresentationForRange(phi->representation());
         }
       }
@@ -2922,16 +2970,16 @@
 
   if (FLAG_print_ssa_liveranges) {
     const Function& function = flow_graph_.function();
-    ISL_Print("-- [before ssa allocator] ranges [%s] ---------\n",
+    THR_Print("-- [before ssa allocator] ranges [%s] ---------\n",
               function.ToFullyQualifiedCString());
     PrintLiveRanges();
-    ISL_Print("----------------------------------------------\n");
+    THR_Print("----------------------------------------------\n");
 
-    ISL_Print("-- [before ssa allocator] ir [%s] -------------\n",
+    THR_Print("-- [before ssa allocator] ir [%s] -------------\n",
               function.ToFullyQualifiedCString());
     FlowGraphPrinter printer(flow_graph_, true);
     printer.PrintBlocks();
-    ISL_Print("----------------------------------------------\n");
+    THR_Print("----------------------------------------------\n");
   }
 
   PrepareForAllocation(Location::kRegister,
@@ -2963,16 +3011,16 @@
   if (FLAG_print_ssa_liveranges) {
     const Function& function = flow_graph_.function();
 
-    ISL_Print("-- [after ssa allocator] ranges [%s] ---------\n",
+    THR_Print("-- [after ssa allocator] ranges [%s] ---------\n",
               function.ToFullyQualifiedCString());
     PrintLiveRanges();
-    ISL_Print("----------------------------------------------\n");
+    THR_Print("----------------------------------------------\n");
 
-    ISL_Print("-- [after ssa allocator] ir [%s] -------------\n",
+    THR_Print("-- [after ssa allocator] ir [%s] -------------\n",
               function.ToFullyQualifiedCString());
     FlowGraphPrinter printer(flow_graph_, true);
     printer.PrintBlocks();
-    ISL_Print("----------------------------------------------\n");
+    THR_Print("----------------------------------------------\n");
   }
 }
 
diff --git a/runtime/vm/flow_graph_builder.cc b/runtime/vm/flow_graph_builder.cc
index ce0fb5a..ea31f96 100644
--- a/runtime/vm/flow_graph_builder.cc
+++ b/runtime/vm/flow_graph_builder.cc
@@ -325,8 +325,7 @@
         nesting_stack_(NULL),
         osr_id_(osr_id),
         jump_count_(0),
-        await_joins_(new(Z) ZoneGrowableArray<JoinEntryInstr*>()),
-        await_levels_(new(Z) ZoneGrowableArray<intptr_t>()) { }
+        await_joins_(new(Z) ZoneGrowableArray<JoinEntryInstr*>()) { }
 
 
 void FlowGraphBuilder::AddCatchEntry(CatchBlockEntryInstr* entry) {
@@ -490,7 +489,7 @@
     if (call_->HasUses()) {
       // Add a phi of the return values.
       PhiInstr* phi = new(Z) PhiInstr(join, num_exits);
-      phi->set_ssa_temp_index(caller_graph_->alloc_ssa_temp_index());
+      caller_graph_->AllocateSSAIndexes(phi);
       phi->mark_alive();
       for (intptr_t i = 0; i < num_exits; ++i) {
         ReturnAt(i)->RemoveEnvironment();
@@ -1607,7 +1606,7 @@
                             &instantiator_type_arguments);
   }
 
-  const intptr_t deopt_id = Isolate::Current()->GetNextDeoptId();
+  const intptr_t deopt_id = Thread::Current()->GetNextDeoptId();
   return new(Z) AssertAssignableInstr(token_pos,
                                       value,
                                       instantiator,
@@ -1618,148 +1617,6 @@
 }
 
 
-void EffectGraphVisitor::BuildSyncYieldJump(LocalVariable* old_context,
-                                            LocalVariable* iterator_param,
-                                            const intptr_t old_ctx_level,
-                                            JoinEntryInstr* target) {
-  // Building a jump consists of the following actions:
-  // * Load the generator body's iterator parameter (:iterator)
-  //   from the current context into a temporary.
-  // * Restore the old context from :await_cxt_var.
-  // * Copy the iterator saved above into the restored context.
-  // * Append a Goto to the target's join.
-  ASSERT((iterator_param != NULL) && iterator_param->is_captured());
-  ASSERT((old_context != NULL) && old_context->is_captured());
-  // Before restoring the context we need to temporarily save the
-  // iterator parameter.
-  LocalVariable* temp_iterator_var =
-      EnterTempLocalScope(Bind(BuildLoadLocal(*iterator_param)));
-
-  // Restore the saved continuation context, i.e. the context that was
-  // saved into :await_ctx_var before the closure suspended.
-  BuildRestoreContext(*old_context);
-
-  // Store the continuation result and continuation error values into
-  // the restored context.
-
-  // FlowGraphBuilder is at top context level, but the continuation
-  // target has possibly been recorded in a nested context (old_ctx_level).
-  // We need to unroll manually here.
-  intptr_t delta =
-      old_ctx_level - iterator_param->owner()->context_level();
-  ASSERT(delta >= 0);
-  Value* context = Bind(BuildCurrentContext());
-  while (delta-- > 0) {
-    context = Bind(new(Z) LoadFieldInstr(
-        context, Context::parent_offset(), Type::ZoneHandle(Z, Type::null()),
-        Scanner::kNoSourcePos));
-  }
-  LocalVariable* temp_context_var = EnterTempLocalScope(context);
-
-  Value* context_val = Bind(new(Z) LoadLocalInstr(*temp_context_var));
-  Value* store_val = Bind(new(Z) LoadLocalInstr(*temp_iterator_var));
-  StoreInstanceFieldInstr* store = new(Z) StoreInstanceFieldInstr(
-      Context::variable_offset(iterator_param->index()),
-      context_val,
-      store_val,
-      kEmitStoreBarrier,
-      Scanner::kNoSourcePos);
-  Do(store);
-
-  Do(ExitTempLocalScope(temp_context_var));
-  Do(ExitTempLocalScope(temp_iterator_var));
-
-  // Goto saved join.
-  Goto(target);
-}
-
-
-void EffectGraphVisitor::BuildAsyncJump(LocalVariable* old_context,
-                                        LocalVariable* continuation_result,
-                                        LocalVariable* continuation_error,
-                                        LocalVariable* continuation_stack_trace,
-                                        const intptr_t old_ctx_level,
-                                        JoinEntryInstr* target) {
-  // Building a jump consists of the following actions:
-  // * Load the current continuation result parameter (:async_result)
-  //   and continuation error parameter (:async_error_param) from
-  //   the current context into temporaries.
-  // * Restore the old context from :await_cxt_var.
-  // * Copy the result and error parameters saved above into the restored
-  //   context.
-  // * Append a Goto to the target's join.
-  ASSERT((continuation_result != NULL) && continuation_result->is_captured());
-  ASSERT((continuation_error != NULL) && continuation_error->is_captured());
-  ASSERT((old_context != NULL) && old_context->is_captured());
-  // Before restoring the continuation context we need to temporary save the
-  // result and error parameter.
-  LocalVariable* temp_result_var =
-      EnterTempLocalScope(Bind(BuildLoadLocal(*continuation_result)));
-  LocalVariable* temp_error_var =
-      EnterTempLocalScope(Bind(BuildLoadLocal(*continuation_error)));
-  LocalVariable* temp_stack_trace_var =
-      EnterTempLocalScope(Bind(BuildLoadLocal(*continuation_stack_trace)));
-
-  // Restore the saved continuation context, i.e. the context that was
-  // saved into :await_ctx_var before the closure suspended.
-  BuildRestoreContext(*old_context);
-
-  // Store the continuation result and continuation error values into
-  // the restored context.
-
-  // FlowGraphBuilder is at top context level, but the await target has possibly
-  // been recorded in a nested context (old_ctx_level). We need to unroll
-  // manually here.
-  intptr_t delta =
-      old_ctx_level - continuation_result->owner()->context_level();
-  ASSERT(delta >= 0);
-  Value* context = Bind(BuildCurrentContext());
-  while (delta-- > 0) {
-    context = Bind(new(Z) LoadFieldInstr(
-        context, Context::parent_offset(), Type::ZoneHandle(Z, Type::null()),
-        Scanner::kNoSourcePos));
-  }
-  LocalVariable* temp_context_var = EnterTempLocalScope(context);
-
-  Value* context_val = Bind(new(Z) LoadLocalInstr(*temp_context_var));
-  Value* store_val = Bind(new(Z) LoadLocalInstr(*temp_result_var));
-  StoreInstanceFieldInstr* store = new(Z) StoreInstanceFieldInstr(
-      Context::variable_offset(continuation_result->index()),
-      context_val,
-      store_val,
-      kEmitStoreBarrier,
-      Scanner::kNoSourcePos);
-  Do(store);
-  context_val = Bind(new(Z) LoadLocalInstr(*temp_context_var));
-  store_val = Bind(new(Z) LoadLocalInstr(*temp_error_var));
-  StoreInstanceFieldInstr* store2 = new(Z) StoreInstanceFieldInstr(
-      Context::variable_offset(continuation_error->index()),
-      context_val,
-      store_val,
-      kEmitStoreBarrier,
-      Scanner::kNoSourcePos);
-  Do(store2);
-
-  context_val = Bind(new(Z) LoadLocalInstr(*temp_context_var));
-  store_val = Bind(new(Z) LoadLocalInstr(*temp_stack_trace_var));
-  StoreInstanceFieldInstr* store3 = new(Z) StoreInstanceFieldInstr(
-      Context::variable_offset(continuation_stack_trace->index()),
-      context_val,
-      store_val,
-      kEmitStoreBarrier,
-      Scanner::kNoSourcePos);
-  Do(store3);
-
-  Do(ExitTempLocalScope(temp_context_var));
-  Do(ExitTempLocalScope(temp_stack_trace_var));
-  Do(ExitTempLocalScope(temp_error_var));
-  Do(ExitTempLocalScope(temp_result_var));
-
-  // Goto saved join.
-  Goto(target);
-}
-
-
 // Used for type casts and to test assignments.
 Value* EffectGraphVisitor::BuildAssignableValue(intptr_t token_pos,
                                                 Value* value,
@@ -1803,7 +1660,8 @@
   const bool negate_result = (node->kind() == Token::kISNOT);
   // All objects are instances of type T if Object type is a subtype of type T.
   const Type& object_type = Type::Handle(Z, Type::ObjectType());
-  if (type.IsInstantiated() && object_type.IsSubtypeOf(type, NULL)) {
+  if (type.IsInstantiated() &&
+      object_type.IsSubtypeOf(type, NULL, Heap::kOld)) {
     // Must evaluate left side.
     EffectGraphVisitor for_left_value(owner());
     node->left()->Visit(&for_left_value);
@@ -2474,10 +2332,11 @@
   // We need to create a new await state which involves:
   // * Increase the jump counter. Sanity check against the list of targets.
   // * Save the current context for resuming.
-  ASSERT(node->scope() != NULL);
-  LocalVariable* jump_var = node->scope()->LookupVariable(
+  ASSERT(node->async_scope() != NULL);
+  ASSERT(node->await_scope() != NULL);
+  LocalVariable* jump_var = node->async_scope()->LookupVariable(
       Symbols::AwaitJumpVar(), false);
-  LocalVariable* ctx_var = node->scope()->LookupVariable(
+  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());
@@ -2492,7 +2351,6 @@
   Do(BuildStoreLocal(*jump_var, jump_val));
   // Save the current context for resuming.
   BuildSaveContext(*ctx_var);
-  owner()->await_levels()->Add(owner()->context_level());
 }
 
 
@@ -2603,7 +2461,7 @@
 
   { LocalVariable* tmp_var = EnterTempLocalScope(array_val);
     const intptr_t class_id = kArrayCid;
-    const intptr_t deopt_id = Isolate::kNoDeoptId;
+    const intptr_t deopt_id = Thread::kNoDeoptId;
     for (int i = 0; i < node->length(); ++i) {
       Value* array = Bind(new(Z) LoadLocalInstr(*tmp_var));
       Value* index =
@@ -2672,14 +2530,17 @@
 static void CollectClosureFunction(const Function& function) {
   if (function.HasCode()) return;
 
-  Isolate* isolate = Isolate::Current();
-  if (isolate->collected_closures() == GrowableObjectArray::null()) {
-    isolate->set_collected_closures(
-        GrowableObjectArray::Handle(GrowableObjectArray::New()));
+  // Although this is only called when precompiling, this can happen before
+  // Dart_Precompile as part of loading code, so check for a non-null work
+  // list.
+  Thread* thread = Thread::Current();
+  Isolate* isolate = thread->isolate();
+  if (isolate->collected_closures() != GrowableObjectArray::null()) {
+    const GrowableObjectArray& functions =
+        GrowableObjectArray::Handle(thread->zone(),
+                                    isolate->collected_closures());
+    functions.Add(function);
   }
-  const GrowableObjectArray& functions =
-      GrowableObjectArray::Handle(isolate, isolate->collected_closures());
-  functions.Add(function);
 }
 
 
@@ -3923,13 +3784,13 @@
     GuardFieldClassInstr* guard_field_class =
         new(Z) GuardFieldClassInstr(store_value,
                                  node->field(),
-                                 isolate()->GetNextDeoptId());
+                                 thread()->GetNextDeoptId());
     AddInstruction(guard_field_class);
     store_value = Bind(BuildLoadExprTemp());
     GuardFieldLengthInstr* guard_field_length =
         new(Z) GuardFieldLengthInstr(store_value,
                                      node->field(),
-                                     isolate()->GetNextDeoptId());
+                                     thread()->GetNextDeoptId());
     AddInstruction(guard_field_length);
     store_value = Bind(BuildLoadExprTemp());
   }
@@ -3947,10 +3808,11 @@
 
 void EffectGraphVisitor::VisitLoadStaticFieldNode(LoadStaticFieldNode* node) {
   if (node->field().is_const()) {
-    ASSERT(node->field().value() != Object::sentinel().raw());
-    ASSERT(node->field().value() != Object::transition_sentinel().raw());
-    Definition* result =
-        new(Z) ConstantInstr(Instance::ZoneHandle(Z, node->field().value()));
+    ASSERT(node->field().StaticValue() != Object::sentinel().raw());
+    ASSERT(node->field().StaticValue() !=
+           Object::transition_sentinel().raw());
+    Definition* result = new(Z) ConstantInstr(
+        Instance::ZoneHandle(Z, node->field().StaticValue()));
     return ReturnDefinition(result);
   }
   Value* field_value = Bind(new(Z) ConstantInstr(node->field()));
@@ -4220,11 +4082,6 @@
   ASSERT((node->label() == NULL) || !is_top_level_sequence);
   NestedBlock nested_block(owner(), node);
 
-  if (FLAG_support_debugger && is_top_level_sequence) {
-    AddInstruction(new(Z) DebugStepCheckInstr(function.token_pos(),
-                                              RawPcDescriptors::kRuntimeCall));
-  }
-
   if (num_context_variables > 0) {
     // The local scope declares variables that are captured.
     // Allocate and chain a new context (Except don't chain when at the function
@@ -4287,6 +4144,27 @@
     }
   }
 
+  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
+    // basic block. Place this check at the last parameter to ensure parameters
+    // are in scope in the debugger at method entry.
+    const int num_params = function.NumParameters();
+    intptr_t check_pos = Scanner::kNoSourcePos;
+    if (num_params > 0) {
+      const LocalVariable& parameter = *scope->VariableAt(num_params - 1);
+      check_pos = parameter.token_pos();
+    }
+    if (check_pos == Scanner::kNoSourcePos) {
+      // No parameters or synthetic parameters.
+      check_pos = node->token_pos();
+    }
+    AddInstruction(new(Z) DebugStepCheckInstr(check_pos,
+                                              RawPcDescriptors::kRuntimeCall));
+  }
+
   // This check may be deleted if the generated code is leaf.
   // Native functions don't need a stack check at entry.
   if (is_top_level_sequence && !function.is_native()) {
@@ -4399,30 +4277,17 @@
       EffectGraphVisitor for_true(owner());
       EffectGraphVisitor for_false(owner());
 
-      if (function.IsAsyncClosure() || function.IsAsyncGenClosure()) {
-        LocalVariable* result_param =
-            top_scope->LookupVariable(Symbols::AsyncOperationParam(), false);
-        LocalVariable* error_param =
-            top_scope->LookupVariable(Symbols::AsyncOperationErrorParam(),
-                                      false);
-        LocalVariable* stack_trace_param =
-            top_scope->LookupVariable(Symbols::AsyncOperationStackTraceParam(),
-                                      false);
-        for_true.BuildAsyncJump(old_context,
-                                result_param,
-                                error_param,
-                                stack_trace_param,
-                                (*owner()->await_levels())[i],
-                                (*owner()->await_joins())[i]);
-      } else {
-        ASSERT(function.IsSyncGenClosure());
-        LocalVariable* iterator_param =
-            top_scope->LookupVariable(Symbols::IteratorParameter(), false);
-        for_true.BuildSyncYieldJump(old_context,
-                                    iterator_param,
-                                    (*owner()->await_levels())[i],
-                                    (*owner()->await_joins())[i]);
-      }
+      // Build async jump or sync yield jump.
+      ASSERT(function.IsAsyncClosure() ||
+             function.IsAsyncGenClosure() ||
+             function.IsSyncGenClosure());
+
+      // Restore the saved continuation context, i.e. the context that was
+      // saved into :await_ctx_var before the closure suspended.
+      for_true.BuildRestoreContext(*old_context);
+
+      // Goto saved join.
+      for_true.Goto((*owner()->await_joins())[i]);
 
       Join(for_test, for_true, for_false);
       if (i == 0) {
@@ -4784,7 +4649,7 @@
 
 
 FlowGraph* FlowGraphBuilder::BuildGraph() {
-  VMTagScope tagScope(Thread::Current()->isolate(),
+  VMTagScope tagScope(Thread::Current(),
                       VMTag::kCompileFlowGraphBuilderTagId,
                       FLAG_profile_vm);
   if (FLAG_print_ast) {
@@ -4808,7 +4673,7 @@
   // 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_ != Isolate::kNoDeoptId) {
+  if (osr_id_ != Thread::kNoDeoptId) {
     PruneUnreachable();
   }
 
@@ -4819,7 +4684,7 @@
 
 
 void FlowGraphBuilder::PruneUnreachable() {
-  ASSERT(osr_id_ != Isolate::kNoDeoptId);
+  ASSERT(osr_id_ != Thread::kNoDeoptId);
   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);
diff --git a/runtime/vm/flow_graph_builder.h b/runtime/vm/flow_graph_builder.h
index 2211da4..109a9a1 100644
--- a/runtime/vm/flow_graph_builder.h
+++ b/runtime/vm/flow_graph_builder.h
@@ -124,7 +124,7 @@
 class FlowGraphBuilder : public ValueObject {
  public:
   // The inlining context is NULL if not inlining.  The osr_id is the deopt
-  // id of the OSR entry or Isolate::kNoDeoptId if not compiling for OSR.
+  // id of the OSR entry or Thread::kNoDeoptId if not compiling for OSR.
   FlowGraphBuilder(const ParsedFunction& parsed_function,
                    const ZoneGrowableArray<const ICData*>& ic_data_array,
                    InlineExitCollector* exit_collector,
@@ -164,7 +164,6 @@
 
   intptr_t next_await_counter() { return jump_count_++; }
 
-  ZoneGrowableArray<intptr_t>* await_levels() const { return await_levels_; }
   ZoneGrowableArray<JoinEntryInstr*>* await_joins() const {
     return await_joins_;
   }
@@ -211,6 +210,7 @@
   // Returns address where the constant 'value' is stored or 0 if not found.
   static uword FindDoubleConstant(double value);
 
+  Thread* thread() const { return parsed_function().thread(); }
   Isolate* isolate() const { return parsed_function().isolate(); }
   Zone* zone() const { return parsed_function().zone(); }
 
@@ -248,13 +248,12 @@
   // A stack of enclosing nested statements.
   NestedStatement* nesting_stack_;
 
-  // The deopt id of the OSR entry or Isolate::kNoDeoptId if not compiling
+  // The deopt id of the OSR entry or Thread::kNoDeoptId if not compiling
   // for OSR.
   const intptr_t osr_id_;
 
   intptr_t jump_count_;
   ZoneGrowableArray<JoinEntryInstr*>* await_joins_;
-  ZoneGrowableArray<intptr_t>* await_levels_;
 
   DISALLOW_IMPLICIT_CONSTRUCTORS(FlowGraphBuilder);
 };
@@ -465,21 +464,10 @@
 
   void BuildLetTempExpressions(LetNode* node);
 
-  void BuildSyncYieldJump(LocalVariable* old_context,
-                          LocalVariable* iterator_param,
-                          const intptr_t old_ctx_level,
-                          JoinEntryInstr* target);
-
-  void BuildAsyncJump(LocalVariable* old_context,
-                      LocalVariable* continuation_result,
-                      LocalVariable* continuation_error,
-                      LocalVariable* continuation_stack_trace,
-                      const intptr_t old_ctx_level,
-                      JoinEntryInstr* target);
-
   void BuildInstanceGetterConditional(InstanceGetterNode* node);
   void BuildInstanceCallConditional(InstanceCallNode* node);
 
+  Thread* thread() const { return owner()->thread(); }
   Isolate* isolate() const { return owner()->isolate(); }
   Zone* zone() const { return owner()->zone(); }
 
diff --git a/runtime/vm/flow_graph_compiler.cc b/runtime/vm/flow_graph_compiler.cc
index c7d3215..dd4adfd 100644
--- a/runtime/vm/flow_graph_compiler.cc
+++ b/runtime/vm/flow_graph_compiler.cc
@@ -28,6 +28,8 @@
 
 namespace dart {
 
+DEFINE_FLAG(bool, allow_absolute_addresses, true,
+    "Allow embedding absolute addresses in generated code.");
 DEFINE_FLAG(bool, always_megamorphic_calls, false,
     "Instance call always as megamorphic.");
 DEFINE_FLAG(bool, enable_simd_inline, true,
@@ -44,6 +46,7 @@
     "Inlining interval diagnostics");
 DEFINE_FLAG(bool, use_megamorphic_stub, true, "Out of line megamorphic lookup");
 
+DECLARE_FLAG(bool, background_compilation);
 DECLARE_FLAG(bool, code_comments);
 DECLARE_FLAG(bool, deoptimize_alot);
 DECLARE_FLAG(int, deoptimize_every);
@@ -51,6 +54,7 @@
 DECLARE_FLAG(bool, disassemble);
 DECLARE_FLAG(bool, disassemble_optimized);
 DECLARE_FLAG(bool, emit_edge_counters);
+DECLARE_FLAG(bool, fields_may_be_reset);
 DECLARE_FLAG(bool, guess_other_cid);
 DECLARE_FLAG(bool, ic_range_profiling);
 DECLARE_FLAG(bool, intrinsify);
@@ -67,10 +71,18 @@
 DECLARE_FLAG(bool, use_osr);
 DECLARE_FLAG(bool, warn_on_javascript_compatibility);
 DECLARE_FLAG(bool, precompile_collect_closures);
+DECLARE_FLAG(bool, print_stop_message);
+DECLARE_FLAG(bool, lazy_dispatchers);
+DECLARE_FLAG(bool, interpret_irregexp);
+DECLARE_FLAG(bool, enable_mirrors);
+DECLARE_FLAG(bool, link_natives_lazily);
 
-
-static void NooptModeHandler(bool value) {
+static void PrecompilationModeHandler(bool value) {
   if (value) {
+#if defined(TARGET_ARCH_IA32)
+    FATAL("Precompilation not supported on IA32");
+#endif
+
     FLAG_always_megamorphic_calls = true;
     FLAG_polymorphic_with_deopt = false;
     FLAG_optimization_counter_threshold = -1;
@@ -83,7 +95,6 @@
     FLAG_load_deferred_eagerly = true;
     FLAG_deoptimize_alot = false;  // Used in some tests.
     FLAG_deoptimize_every = 0;     // Used in some tests.
-    FLAG_collect_code = false;
     FLAG_guess_other_cid = true;
     Compiler::set_always_optimize(true);
     // Triggers assert if we try to recompile (e.g., because of deferred
@@ -93,35 +104,27 @@
     // TODO(srdjan): Enable CHA deoptimization when eager class finalization is
     // implemented, either with precompilation or as a special pass.
     FLAG_use_cha_deopt = false;
-  }
-}
+    // Calling the PrintStopMessage stub is not supported in precompiled code
+    // since it is done at places where no pool pointer is loaded.
+    FLAG_print_stop_message = false;
 
-
-// --noopt disables optimizer and tunes unoptimized code to run as fast
-// as possible.
-DEFINE_FLAG_HANDLER(NooptModeHandler,
-                    noopt,
-                    "Run fast unoptimized code only.");
-
-
-DECLARE_FLAG(bool, lazy_dispatchers);
-DECLARE_FLAG(bool, interpret_irregexp);
-DECLARE_FLAG(bool, enable_mirrors);
-
-
-static void PrecompileModeHandler(bool value) {
-  if (value) {
-    NooptModeHandler(true);
     FLAG_lazy_dispatchers = false;
     FLAG_interpret_irregexp = true;
     FLAG_enable_mirrors = false;
     FLAG_precompile_collect_closures = true;
+    FLAG_link_natives_lazily = true;
+    FLAG_fields_may_be_reset = true;
+    FLAG_allow_absolute_addresses = false;
+
+    // Background compilation relies on two-stage compilation pipeline,
+    // while precompilation has only one.
+    FLAG_background_compilation = false;
   }
 }
 
 
-DEFINE_FLAG_HANDLER(PrecompileModeHandler,
-                    precompile,
+DEFINE_FLAG_HANDLER(PrecompilationModeHandler,
+                    precompilation,
                     "Precompilation mode");
 
 
@@ -162,7 +165,8 @@
     bool is_optimizing,
     const GrowableArray<const Function*>& inline_id_to_function,
     const GrowableArray<intptr_t>& caller_inline_id)
-      : isolate_(Isolate::Current()),
+      : thread_(Thread::Current()),
+        isolate_(Isolate::Current()),
         zone_(Thread::Current()->zone()),
         assembler_(assembler),
         parsed_function_(parsed_function),
@@ -174,8 +178,7 @@
         stackmap_table_builder_(NULL),
         block_info_(block_order_.length()),
         deopt_infos_(),
-        static_calls_target_table_(GrowableObjectArray::ZoneHandle(
-            GrowableObjectArray::New())),
+        static_calls_target_table_(),
         is_optimizing_(is_optimizing),
         may_reoptimize_(false),
         intrinsic_mode_(false),
@@ -194,30 +197,30 @@
                 LookupClass(Symbols::List()))),
         parallel_move_resolver_(this),
         pending_deoptimization_env_(NULL),
-        entry_patch_pc_offset_(Code::kInvalidPc),
-        patch_code_pc_offset_(Code::kInvalidPc),
         lazy_deopt_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),
         caller_inline_id_(caller_inline_id) {
   ASSERT(flow_graph->parsed_function().function().raw() ==
          parsed_function.function().raw());
   if (!is_optimizing) {
-    const intptr_t len = isolate()->deopt_id();
+    const intptr_t len = thread()->deopt_id();
     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;
     }
-    const Array& old_saved_icdata = Array::Handle(zone(),
+    // TODO(fschneider): Abstract iteration into ICDataArrayIterator.
+    const Array& old_saved_ic_data = Array::Handle(zone(),
         flow_graph->function().ic_data_array());
     const intptr_t saved_len =
-        old_saved_icdata.IsNull() ? 0 : old_saved_icdata.Length();
-    for (intptr_t i = 0; i < saved_len; i++) {
-      ICData& icd = ICData::ZoneHandle(zone());
-      icd ^= old_saved_icdata.At(i);
-      (*deopt_id_to_ic_data_)[icd.deopt_id()] = &icd;
+        old_saved_ic_data.IsNull() ? 0 : old_saved_ic_data.Length();
+    for (intptr_t i = 1; i < saved_len; i++) {
+      ICData& ic_data = ICData::ZoneHandle(zone());
+      ic_data ^= old_saved_ic_data.At(i);
+      (*deopt_id_to_ic_data_)[ic_data.deopt_id()] = &ic_data;
     }
   }
   ASSERT(assembler != NULL);
@@ -226,8 +229,8 @@
 
 
 void FlowGraphCompiler::InitCompiler() {
-  pc_descriptors_list_ = new DescriptorList(64);
-  exception_handlers_list_ = new 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.
@@ -238,7 +241,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 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()) {
@@ -272,6 +275,17 @@
     Instruction* first = flow_graph_.graph_entry()->normal_entry()->next();
     if (first->IsCheckStackOverflow()) first->RemoveFromGraph();
   }
+  if (!is_optimizing()) {
+    // Initialize edge counter array.
+    const intptr_t num_counters = flow_graph_.preorder().length();
+    const Array& edge_counters =
+        Array::Handle(Array::New(num_counters, Heap::kOld));
+    const Smi& zero_smi = Smi::Handle(Smi::New(0));
+    for (intptr_t i = 0; i < num_counters; ++i) {
+      edge_counters.SetAt(i, zero_smi);
+    }
+    edge_counters_array_ = edge_counters.raw();
+  }
 }
 
 
@@ -390,15 +404,16 @@
   if ((instr->token_pos() == Scanner::kNoSourcePos) || (instr->env() == NULL)) {
     return;
   }
-  const Function& function =
-      Function::Handle(instr->env()->code().function());
-  const Script& s = Script::Handle(function.script());
+  const Script& script =
+      Script::Handle(zone(), instr->env()->function().script());
   intptr_t line_nr;
   intptr_t column_nr;
-  s.GetTokenLocation(instr->token_pos(), &line_nr, &column_nr);
-  const String& line = String::Handle(s.GetLine(line_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, function.ToFullyQualifiedCString(), line.ToCString());
+      line_nr,
+      instr->env()->function().ToFullyQualifiedCString(),
+      line.ToCString());
 }
 
 
@@ -427,7 +442,7 @@
   intptr_t inlining_id;
   IntervalStruct(intptr_t s, intptr_t id) : start(s), inlining_id(id) {}
   void Dump() {
-    ISL_Print("start: 0x%" Px " iid: %" Pd " ",  start, inlining_id);
+    THR_Print("start: 0x%" Px " iid: %" Pd " ",  start, inlining_id);
   }
 };
 
@@ -516,7 +531,7 @@
   }
 
   if (is_optimizing()) {
-    LogBlock lb(Isolate::Current());
+    LogBlock lb;
     intervals.Add(IntervalStruct(prev_offset, prev_inlining_id));
     inlined_code_intervals_ =
         Array::New(intervals.length() * Code::kInlIntNumEntries, Heap::kOld);
@@ -528,7 +543,7 @@
         const Function& function =
             *inline_id_to_function_.At(intervals[i].inlining_id);
         intervals[i].Dump();
-        ISL_Print(" parent iid %" Pd " %s\n",
+        THR_Print(" parent iid %" Pd " %s\n",
             caller_inline_id_[intervals[i].inlining_id],
             function.ToQualifiedCString());
       }
@@ -545,10 +560,10 @@
   }
   set_current_block(NULL);
   if (FLAG_trace_inlining_intervals && is_optimizing()) {
-    LogBlock lb(Isolate::Current());
-    ISL_Print("Intervals:\n");
+    LogBlock lb;
+    THR_Print("Intervals:\n");
     for (intptr_t cc = 0; cc < caller_inline_id_.length(); cc++) {
-      ISL_Print("  iid: %" Pd " caller iid: %" Pd "\n",
+      THR_Print("  iid: %" Pd " caller iid: %" Pd "\n",
           cc, caller_inline_id_[cc]);
     }
     Smi& temp = Smi::Handle();
@@ -556,9 +571,9 @@
          i += Code::kInlIntNumEntries) {
       temp ^= inlined_code_intervals_.At(i + Code::kInlIntStart);
       ASSERT(!temp.IsNull());
-      ISL_Print("% " Pd " start: 0x%" Px " ", i, temp.Value());
+      THR_Print("% " Pd " start: 0x%" Px " ", i, temp.Value());
       temp ^= inlined_code_intervals_.At(i + Code::kInlIntInliningId);
-      ISL_Print("iid: %" Pd " ", temp.Value());
+      THR_Print("iid: %" Pd " ", temp.Value());
     }
   }
 }
@@ -591,7 +606,7 @@
   // Parameters first.
   intptr_t i = 0;
   const intptr_t num_non_copied_params = flow_graph().num_non_copied_params();
-  ParallelMoveInstr* move_instr = new 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;
@@ -717,26 +732,16 @@
 
 
 void FlowGraphCompiler::AddStaticCallTarget(const Function& func) {
-  ASSERT(Code::kSCallTableEntryLength == 3);
-  ASSERT(Code::kSCallTableOffsetEntry == 0);
+  ASSERT(func.IsZoneHandle());
   static_calls_target_table_.Add(
-      Smi::Handle(Smi::New(assembler()->CodeSize())));
-  ASSERT(Code::kSCallTableFunctionEntry == 1);
-  static_calls_target_table_.Add(func);
-  ASSERT(Code::kSCallTableCodeEntry == 2);
-  static_calls_target_table_.Add(Code::Handle());
+      new(zone()) StaticCallsStruct(assembler()->CodeSize(), &func, NULL));
 }
 
 
 void FlowGraphCompiler::AddStubCallTarget(const Code& code) {
-  ASSERT(Code::kSCallTableEntryLength == 3);
-  ASSERT(Code::kSCallTableOffsetEntry == 0);
+  ASSERT(code.IsZoneHandle());
   static_calls_target_table_.Add(
-      Smi::Handle(Smi::New(assembler()->CodeSize())));
-  ASSERT(Code::kSCallTableFunctionEntry == 1);
-  static_calls_target_table_.Add(Function::Handle());
-  ASSERT(Code::kSCallTableCodeEntry == 2);
-  static_calls_target_table_.Add(code);
+      new(zone()) StaticCallsStruct(assembler()->CodeSize(), NULL, &code));
 }
 
 
@@ -745,10 +750,10 @@
   ASSERT(is_optimizing());
   ASSERT(!intrinsic_mode());
   CompilerDeoptInfo* info =
-      new 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);
 }
@@ -808,9 +813,9 @@
           }
         }
       }
-      // General purpose registers have the lowest register number at the
+      // General purpose registers have the highest register number at the
       // highest address (i.e., first in the stackmap).
-      for (intptr_t i = 0; i < kNumberOfCpuRegisters; ++i) {
+      for (intptr_t i = kNumberOfCpuRegisters - 1; i >= 0; --i) {
         Register reg = static_cast<Register>(i);
         if (locs->live_registers()->ContainsRegister(reg)) {
           bitmap->Set(bitmap->Length(), locs->live_registers()->IsTagged(reg));
@@ -859,9 +864,9 @@
       fpu_reg_slots[i] = -1;
     }
   }
-  // General purpose registers are spilled from lowest to highest register
+  // General purpose registers are spilled from highest to lowest register
   // number.
-  for (intptr_t i = 0; i < kNumberOfCpuRegisters; ++i) {
+  for (intptr_t i = kNumberOfCpuRegisters - 1; i >= 0; --i) {
     Register reg = static_cast<Register>(i);
     if (regs->ContainsRegister(reg)) {
       cpu_reg_slots[i] = next_slot++;
@@ -894,10 +899,10 @@
   ASSERT(!Compiler::always_optimize());
   ASSERT(is_optimizing_);
   CompilerDeoptInfoWithStub* stub =
-      new CompilerDeoptInfoWithStub(deopt_id,
-                                    reason,
-                                    flags,
-                                    pending_deoptimization_env_);
+      new(zone()) CompilerDeoptInfoWithStub(deopt_id,
+                                            reason,
+                                            flags,
+                                            pending_deoptimization_env_);
   deopt_infos_.Add(stub);
   return stub->entry_label();
 }
@@ -908,9 +913,12 @@
   const ExceptionHandlers& handlers = ExceptionHandlers::Handle(
       exception_handlers_list_->FinalizeExceptionHandlers(code.EntryPoint()));
   code.set_exception_handlers(handlers);
-  INC_STAT(isolate(), total_code_size,
-      ExceptionHandlers::InstanceSize(handlers.num_entries()));
-  INC_STAT(isolate(), total_code_size, handlers.num_entries() * sizeof(uword));
+  if (FLAG_compiler_stats) {
+    Thread* thread = Thread::Current();
+    INC_STAT(thread, total_code_size,
+        ExceptionHandlers::InstanceSize(handlers.num_entries()));
+    INC_STAT(thread, total_code_size, handlers.num_entries() * sizeof(uword));
+  }
 }
 
 
@@ -920,8 +928,6 @@
       pc_descriptors_list_->FinalizePcDescriptors(code.EntryPoint()));
   if (!is_optimizing_) descriptors.Verify(parsed_function_.function());
   code.set_pc_descriptors(descriptors);
-  code.set_entry_patch_pc_offset(entry_patch_pc_offset_);
-  code.set_patch_code_pc_offset(patch_code_pc_offset_);
   code.set_lazy_deopt_pc_offset(lazy_deopt_pc_offset_);
 }
 
@@ -1000,16 +1006,32 @@
 
 void FlowGraphCompiler::FinalizeStaticCallTargetsTable(const Code& code) {
   ASSERT(code.static_calls_target_table() == Array::null());
-  const Array& targets =
-      Array::Handle(Array::MakeArray(static_calls_target_table_));
+  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;
+    smi_offset = Smi::New(static_calls_target_table_[i]->offset);
+    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);
+    }
+    if (static_calls_target_table_[i]->code != NULL) {
+      targets.SetAt(target_ix + Code::kSCallTableCodeEntry,
+          *static_calls_target_table_[i]->code);
+    }
+  }
   code.set_static_calls_target_table(targets);
-  INC_STAT(isolate(), total_code_size, targets.Length() * sizeof(uword));
+  INC_STAT(Thread::Current(),
+           total_code_size,
+           targets.Length() * sizeof(uword));
 }
 
 
-// Returns 'true' if code generation for this function is complete, i.e.,
-// no fall-through to regular code is needed.
-void FlowGraphCompiler::TryIntrinsify() {
+// Returns 'true' if regular code generation should be skipped.
+bool FlowGraphCompiler::TryIntrinsify() {
   // Intrinsification skips arguments checks, therefore disable if in checked
   // mode.
   if (FLAG_intrinsify && !isolate()->flags().type_checks()) {
@@ -1026,8 +1048,9 @@
       // Reading from a mutable double box requires allocating a fresh double.
       if (load_node.field().guarded_cid() == kDynamicCid) {
         GenerateInlinedGetter(load_node.field().Offset());
+        return true;
       }
-      return;
+      return false;
     }
     if (parsed_function().function().kind() == RawFunction::kImplicitSetter) {
       // An implicit setter must have a specific AST structure.
@@ -1040,7 +1063,7 @@
           *sequence_node.NodeAt(0)->AsStoreInstanceFieldNode();
       if (store_node.field().guarded_cid() == kDynamicCid) {
         GenerateInlinedSetter(store_node.field().Offset());
-        return;
+        return true;
       }
     }
   }
@@ -1057,6 +1080,7 @@
   // before any deoptimization point.
   ASSERT(!intrinsic_slow_path_label_.IsBound());
   assembler()->Bind(&intrinsic_slow_path_label_);
+  return false;
 }
 
 
diff --git a/runtime/vm/flow_graph_compiler.h b/runtime/vm/flow_graph_compiler.h
index 536720e..df9f7e4 100644
--- a/runtime/vm/flow_graph_compiler.h
+++ b/runtime/vm/flow_graph_compiler.h
@@ -328,7 +328,8 @@
   // Bail out of the flow graph compiler. Does not return to the caller.
   void Bailout(const char* reason);
 
-  void TryIntrinsify();
+  // Returns 'true' if regular code generation should be skipped.
+  bool TryIntrinsify();
 
   void GenerateRuntimeCall(intptr_t token_pos,
                            intptr_t deopt_id,
@@ -387,11 +388,7 @@
 
   bool NeedsEdgeCounter(TargetEntryInstr* block);
 
-  void EmitEdgeCounter();
-
-#if !defined(TARGET_ARCH_ARM64) && !defined(TARGET_ARCH_MIPS)
-  static int32_t EdgeCounterIncrementSizeInBytes();
-#endif  // !TARGET_ARCH_ARM64 && !TARGET_ARCH_MIPS
+  void EmitEdgeCounter(intptr_t edge_id);
 
   void EmitOptimizedInstanceCall(const StubEntry& stub_entry,
                                  const ICData& ic_data,
@@ -528,6 +525,7 @@
     return *deopt_id_to_ic_data_;
   }
 
+  Thread* thread() const { return thread_; }
   Isolate* isolate() const { return isolate_; }
   Zone* zone() const { return zone_; }
 
@@ -537,6 +535,10 @@
     return inlined_code_intervals_;
   }
 
+  RawArray* edge_counters_array() const {
+    return edge_counters_array_.raw();
+  }
+
   RawArray* InliningIdToFunction() const;
 
   RawArray* CallerInliningIdMap() const;
@@ -662,6 +664,25 @@
   void FrameStateClear();
 #endif
 
+  // This struct contains either function or code, the other one being NULL.
+  class StaticCallsStruct : public ZoneAllocated {
+   public:
+    const intptr_t offset;
+    const Function* function;  // Can be NULL.
+    const Code* code;          // Can be NULL.
+    StaticCallsStruct(intptr_t offset_arg,
+                      const Function* function_arg,
+                      const Code* code_arg)
+        : offset(offset_arg), function(function_arg), code(code_arg) {
+      ASSERT((function == NULL) || function->IsZoneHandle());
+      ASSERT((code == NULL) || code->IsZoneHandle());
+    }
+
+   private:
+    DISALLOW_COPY_AND_ASSIGN(StaticCallsStruct);
+  };
+
+  Thread* thread_;
   Isolate* isolate_;
   Zone* zone_;
   Assembler* assembler_;
@@ -683,11 +704,10 @@
   GrowableArray<BlockInfo*> block_info_;
   GrowableArray<CompilerDeoptInfo*> deopt_infos_;
   GrowableArray<SlowPathCode*> slow_path_code_;
-  // Stores: [code offset, function or null, null(code)].
   // Stores static call targets as well as stub targets.
   // TODO(srdjan): Evaluate if we should store allocation stub targets into a
   // separate table?
-  const GrowableObjectArray& static_calls_target_table_;
+  GrowableArray<StaticCallsStruct*> static_calls_target_table_;
   const bool is_optimizing_;
   // Set to true if optimized code has IC calls.
   bool may_reoptimize_;
@@ -710,12 +730,12 @@
   // In future AddDeoptStub should be moved out of the instruction template.
   Environment* pending_deoptimization_env_;
 
-  intptr_t entry_patch_pc_offset_;
-  intptr_t patch_code_pc_offset_;
   intptr_t lazy_deopt_pc_offset_;
 
   ZoneGrowableArray<const ICData*>* deopt_id_to_ic_data_;
 
+  Array& edge_counters_array_;
+
   Array& inlined_code_intervals_;
   const GrowableArray<const Function*>& inline_id_to_function_;
   const GrowableArray<intptr_t>& caller_inline_id_;
diff --git a/runtime/vm/flow_graph_compiler_arm.cc b/runtime/vm/flow_graph_compiler_arm.cc
index f7b1fb4..444a0d8 100644
--- a/runtime/vm/flow_graph_compiler_arm.cc
+++ b/runtime/vm/flow_graph_compiler_arm.cc
@@ -13,6 +13,7 @@
 #include "vm/dart_entry.h"
 #include "vm/deopt_instructions.h"
 #include "vm/il_printer.h"
+#include "vm/instructions.h"
 #include "vm/locations.h"
 #include "vm/object_store.h"
 #include "vm/parser.h"
@@ -100,15 +101,10 @@
 
   Zone* zone = compiler->zone();
 
-  // Current PP, FP, and PC.
-  builder->AddPp(Function::Handle(zone, current->code().function()), slot_ix++);
-  builder->AddCallerFp(slot_ix++);
-  builder->AddReturnAddress(Function::Handle(zone, current->code().function()),
-                            deopt_id(),
-                            slot_ix++);
-
-  // Callee's PC marker is not used anymore. Pass Function::null() to set to 0.
+  builder->AddPp(current->function(), slot_ix++);
   builder->AddPcMarker(Function::Handle(zone), slot_ix++);
+  builder->AddCallerFp(slot_ix++);
+  builder->AddReturnAddress(current->function(), deopt_id(), slot_ix++);
 
   // Emit all values that are needed for materialization as a part of the
   // expression stack for the bottom-most frame. This guarantees that GC
@@ -125,22 +121,17 @@
   Environment* previous = current;
   current = current->outer();
   while (current != NULL) {
-    // PP, FP, and PC.
-    builder->AddPp(
-        Function::Handle(zone, current->code().function()), slot_ix++);
+    builder->AddPp(current->function(), slot_ix++);
+    builder->AddPcMarker(previous->function(), slot_ix++);
     builder->AddCallerFp(slot_ix++);
 
     // For any outer environment the deopt id is that of the call instruction
     // which is recorded in the outer environment.
     builder->AddReturnAddress(
-        Function::Handle(zone, current->code().function()),
-        Isolate::ToDeoptAfter(current->deopt_id()),
+        current->function(),
+        Thread::ToDeoptAfter(current->deopt_id()),
         slot_ix++);
 
-    // PC marker.
-    builder->AddPcMarker(Function::Handle(zone, previous->code().function()),
-                         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--) {
@@ -165,15 +156,12 @@
   // The previous pointer is now the outermost environment.
   ASSERT(previous != NULL);
 
-  // For the outermost environment, set caller PC, caller PP, and caller FP.
+  // Set slots for the outermost environment.
   builder->AddCallerPp(slot_ix++);
+  builder->AddPcMarker(previous->function(), slot_ix++);
   builder->AddCallerFp(slot_ix++);
   builder->AddCallerPc(slot_ix++);
 
-  // PC marker.
-  builder->AddPcMarker(Function::Handle(zone, previous->code().function()),
-                       slot_ix++);
-
   // For the outermost environment, set the incoming arguments.
   for (intptr_t i = previous->fixed_parameter_count() - 1; i >= 0; i--) {
     builder->AddCopy(previous->ValueAt(i), previous->LocationAt(i), slot_ix++);
@@ -200,6 +188,7 @@
   // LR may be live. It will be clobbered by BranchLink, so cache it in IP.
   // It will be restored at the top of the deoptimization stub, specifically in
   // GenerateDeoptimizationSequence in stub_code_arm.cc.
+  __ Push(CODE_REG);
   __ mov(IP, Operand(LR));
   __ BranchLink(*StubCode::Deoptimize_entry());
   set_pc_offset(assem->CodeSize());
@@ -215,8 +204,7 @@
                                            Label* is_true,
                                            Label* is_false) {
   Label fall_through;
-  __ CompareImmediate(bool_register,
-                      reinterpret_cast<intptr_t>(Object::null()));
+  __ CompareObject(bool_register, Object::null_object());
   __ b(&fall_through, EQ);
   __ CompareObject(bool_register, Bool::True());
   __ b(is_true, EQ);
@@ -241,11 +229,11 @@
   __ LoadUniqueObject(R2, type_test_cache);
   if (test_kind == kTestTypeOneArg) {
     ASSERT(type_arguments_reg == kNoRegister);
-    __ LoadImmediate(R1, reinterpret_cast<intptr_t>(Object::null()));
+    __ LoadObject(R1, Object::null_object());
     __ BranchLink(*StubCode::Subtype1TestCache_entry());
   } else if (test_kind == kTestTypeTwoArgs) {
     ASSERT(type_arguments_reg == kNoRegister);
-    __ LoadImmediate(R1, reinterpret_cast<intptr_t>(Object::null()));
+    __ LoadObject(R1, Object::null_object());
     __ BranchLink(*StubCode::Subtype2TestCache_entry());
   } else if (test_kind == kTestTypeThreeArgs) {
     ASSERT(type_arguments_reg == R1);
@@ -277,7 +265,8 @@
   const Register kInstanceReg = R0;
   Error& malformed_error = Error::Handle(zone());
   const Type& int_type = Type::Handle(zone(), Type::IntType());
-  const bool smi_is_ok = int_type.IsSubtypeOf(type, &malformed_error);
+  const bool smi_is_ok =
+      int_type.IsSubtypeOf(type, &malformed_error, Heap::kOld);
   // Malformed type should have been handled at graph construction time.
   ASSERT(smi_is_ok || malformed_error.IsNull());
   __ tst(kInstanceReg, Operand(kSmiTagMask));
@@ -317,7 +306,7 @@
         ASSERT(tp_argument.HasResolvedTypeClass());
         // Check if type argument is dynamic or Object.
         const Type& object_type = Type::Handle(zone(), Type::ObjectType());
-        if (object_type.IsSubtypeOf(tp_argument, NULL)) {
+        if (object_type.IsSubtypeOf(tp_argument, NULL, Heap::kOld)) {
           // Instance class test only necessary.
           return GenerateSubtype1TestCacheLookup(
               token_pos, type_class, is_instance_lbl, is_not_instance_lbl);
@@ -372,7 +361,8 @@
   if (smi_class.IsSubtypeOf(TypeArguments::Handle(zone()),
                             type_class,
                             TypeArguments::Handle(zone()),
-                            NULL)) {
+                            NULL,
+                            Heap::kOld)) {
     __ b(is_instance_lbl, EQ);
   } else {
     __ b(is_not_instance_lbl, EQ);
@@ -395,12 +385,13 @@
     // Check if instance is a closure.
     __ LoadClassById(R3, kClassIdReg);
     __ ldr(R3, FieldAddress(R3, Class::signature_function_offset()));
-    __ CompareImmediate(R3, reinterpret_cast<int32_t>(Object::null()));
+    __ CompareObject(R3, Object::null_object());
     __ b(is_instance_lbl, NE);
   }
   // Custom checking for numbers (Smi, Mint, Bigint and Double).
   // Note that instance is not Smi (checked above).
-  if (type.IsSubtypeOf(Type::Handle(zone(), Type::Number()), NULL)) {
+  if (type.IsSubtypeOf(
+        Type::Handle(zone(), Type::Number()), NULL, Heap::kOld)) {
     GenerateNumberTypeCheck(
         kClassIdReg, type, is_instance_lbl, is_not_instance_lbl);
     return false;
@@ -463,7 +454,7 @@
     __ ldr(R1, Address(SP, 0));  // Get instantiator type arguments.
     // R1: instantiator type arguments.
     // Check if type arguments are null, i.e. equivalent to vector of dynamic.
-    __ CompareImmediate(R1, reinterpret_cast<intptr_t>(Object::null()));
+    __ CompareObject(R1, Object::null_object());
     __ b(is_instance_lbl, EQ);
     __ ldr(R2,
         FieldAddress(R1, TypeArguments::type_at_offset(type_param.index())));
@@ -608,7 +599,7 @@
     // We can only inline this null check if the type is instantiated at compile
     // time, since an uninstantiated type at compile time could be Object or
     // dynamic at run time.
-    __ CompareImmediate(R0, reinterpret_cast<int32_t>(Object::null()));
+    __ CompareObject(R0, Object::null_object());
     __ b(type.IsNullType() ? &is_instance : &is_not_instance, EQ);
   }
 
@@ -684,7 +675,7 @@
   __ PushList((1 << R1) | (1 << R2));
   // A null object is always assignable and is returned as result.
   Label is_assignable, runtime_call;
-  __ CompareImmediate(R0, reinterpret_cast<int32_t>(Object::null()));
+  __ CompareObject(R0, Object::null_object());
   __ b(&is_assignable, EQ);
 
   // Generate throw new TypeError() if the type is malformed or malbounded.
@@ -765,13 +756,13 @@
   const int min_num_pos_args = num_fixed_params;
   const int max_num_pos_args = num_fixed_params + num_opt_pos_params;
 
-  __ ldr(R9, FieldAddress(R4, ArgumentsDescriptor::positional_count_offset()));
+  __ ldr(R10, FieldAddress(R4, ArgumentsDescriptor::positional_count_offset()));
   // Check that min_num_pos_args <= num_pos_args.
   Label wrong_num_arguments;
-  __ CompareImmediate(R9, Smi::RawValue(min_num_pos_args));
+  __ CompareImmediate(R10, Smi::RawValue(min_num_pos_args));
   __ b(&wrong_num_arguments, LT);
   // Check that num_pos_args <= max_num_pos_args.
-  __ CompareImmediate(R9, Smi::RawValue(max_num_pos_args));
+  __ CompareImmediate(R10, Smi::RawValue(max_num_pos_args));
   __ b(&wrong_num_arguments, GT);
 
   // Copy positional arguments.
@@ -779,30 +770,30 @@
   // to fp[kFirstLocalSlotFromFp - i].
 
   __ ldr(R7, FieldAddress(R4, ArgumentsDescriptor::count_offset()));
-  // Since R7 and R9 are Smi, use LSL 1 instead of LSL 2.
+  // Since R7 and R10 are Smi, use LSL 1 instead of LSL 2.
   // Let R7 point to the last passed positional argument, i.e. to
   // fp[kParamEndSlotFromFp + num_args - (num_pos_args - 1)].
-  __ sub(R7, R7, Operand(R9));
+  __ sub(R7, R7, Operand(R10));
   __ add(R7, FP, Operand(R7, LSL, 1));
   __ add(R7, R7, Operand((kParamEndSlotFromFp + 1) * kWordSize));
 
   // Let R6 point to the last copied positional argument, i.e. to
   // fp[kFirstLocalSlotFromFp - (num_pos_args - 1)].
   __ AddImmediate(R6, FP, (kFirstLocalSlotFromFp + 1) * kWordSize);
-  __ sub(R6, R6, Operand(R9, LSL, 1));  // R9 is a Smi.
-  __ SmiUntag(R9);
+  __ sub(R6, R6, Operand(R10, LSL, 1));  // R10 is a Smi.
+  __ SmiUntag(R10);
   Label loop, loop_condition;
   __ b(&loop_condition);
   // We do not use the final allocation index of the variable here, i.e.
   // scope->VariableAt(i)->index(), because captured variables still need
   // to be copied to the context that is not yet allocated.
-  const Address argument_addr(R7, R9, LSL, 2);
-  const Address copy_addr(R6, R9, LSL, 2);
+  const Address argument_addr(R7, R10, LSL, 2);
+  const Address copy_addr(R6, R10, LSL, 2);
   __ Bind(&loop);
   __ ldr(IP, argument_addr);
   __ str(IP, copy_addr);
   __ Bind(&loop_condition);
-  __ subs(R9, R9, Operand(1));
+  __ subs(R10, R10, Operand(1));
   __ b(&loop, PL);
 
   // Copy or initialize optional named arguments.
@@ -833,9 +824,9 @@
     }
     // Generate code handling each optional parameter in alphabetical order.
     __ ldr(R7, FieldAddress(R4, ArgumentsDescriptor::count_offset()));
-    __ ldr(R9,
+    __ ldr(R10,
            FieldAddress(R4, ArgumentsDescriptor::positional_count_offset()));
-    __ SmiUntag(R9);
+    __ SmiUntag(R10);
     // 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, 1));
@@ -864,9 +855,8 @@
       __ b(&assign_optional_parameter);
       __ Bind(&load_default_value);
       // Load R5 with default argument.
-      const Object& value = Object::ZoneHandle(
-          zone(), parsed_function().default_parameter_values().At(
-              param_pos - num_fixed_params));
+      const Instance& value = parsed_function().DefaultParameterValueAt(
+          param_pos - num_fixed_params);
       __ LoadObject(R5, value);
       __ Bind(&assign_optional_parameter);
       // Assign R5 to fp[kFirstLocalSlotFromFp - param_pos].
@@ -883,25 +873,24 @@
       // Check that R6 now points to the null terminator in the arguments
       // descriptor.
       __ ldr(R5, Address(R6, 0));
-      __ CompareImmediate(R5, reinterpret_cast<int32_t>(Object::null()));
+      __ CompareObject(R5, Object::null_object());
       __ b(&all_arguments_processed, EQ);
     }
   } else {
     ASSERT(num_opt_pos_params > 0);
-    __ ldr(R9,
+    __ ldr(R10,
            FieldAddress(R4, ArgumentsDescriptor::positional_count_offset()));
-    __ SmiUntag(R9);
+    __ SmiUntag(R10);
     for (int i = 0; i < num_opt_pos_params; i++) {
       Label next_parameter;
       // Handle this optional positional parameter only if k or fewer positional
       // arguments have been passed, where k is param_pos, the position of this
       // optional parameter in the formal parameter list.
       const int param_pos = num_fixed_params + i;
-      __ CompareImmediate(R9, param_pos);
+      __ CompareImmediate(R10, param_pos);
       __ b(&next_parameter, GT);
       // Load R5 with default argument.
-      const Object& value = Object::ZoneHandle(
-          zone(), parsed_function().default_parameter_values().At(i));
+      const Object& value = parsed_function().DefaultParameterValueAt(i);
       __ LoadObject(R5, value);
       // Assign R5 to fp[kFirstLocalSlotFromFp - param_pos].
       // We do not use the final allocation index of the variable here, i.e.
@@ -915,20 +904,16 @@
     if (check_correct_named_args) {
       __ ldr(R7, FieldAddress(R4, ArgumentsDescriptor::count_offset()));
       __ SmiUntag(R7);
-      // Check that R9 equals R7, i.e. no named arguments passed.
-      __ cmp(R9, Operand(R7));
+      // Check that R10 equals R7, i.e. no named arguments passed.
+      __ cmp(R10, Operand(R7));
       __ b(&all_arguments_processed, EQ);
     }
   }
 
   __ Bind(&wrong_num_arguments);
   if (function.IsClosureFunction()) {
-    ASSERT(assembler()->constant_pool_allowed());
-    __ LeaveDartFrame();  // The arguments are still on the stack.
-    // Do not use caller's pool ptr in branch.
-    ASSERT(!assembler()->constant_pool_allowed());
+    __ LeaveDartFrame(kKeepCalleePP);  // The arguments are still on the stack.
     __ Branch(*StubCode::CallClosureNoSuchMethod_entry());
-    __ set_constant_pool_allowed(true);
     // The noSuchMethod call may return to the caller, but not here.
   } else if (check_correct_named_args) {
     __ Stop("Wrong arguments");
@@ -942,17 +927,17 @@
   // an issue anymore.
 
   // R4 : arguments descriptor array.
-  __ ldr(R9, FieldAddress(R4, ArgumentsDescriptor::count_offset()));
-  __ SmiUntag(R9);
+  __ ldr(R10, FieldAddress(R4, ArgumentsDescriptor::count_offset()));
+  __ SmiUntag(R10);
   __ add(R7, FP, Operand((kParamEndSlotFromFp + 1) * kWordSize));
-  const Address original_argument_addr(R7, R9, LSL, 2);
-  __ LoadImmediate(IP, reinterpret_cast<intptr_t>(Object::null()));
+  const Address original_argument_addr(R7, R10, LSL, 2);
+  __ LoadObject(IP, Object::null_object());
   Label null_args_loop, null_args_loop_condition;
   __ b(&null_args_loop_condition);
   __ Bind(&null_args_loop);
   __ str(IP, original_argument_addr);
   __ Bind(&null_args_loop_condition);
-  __ subs(R9, R9, Operand(1));
+  __ subs(R10, R10, Operand(1));
   __ b(&null_args_loop, PL);
 }
 
@@ -977,11 +962,14 @@
   __ ldr(R0, Address(SP, 1 * kWordSize));  // Receiver.
   __ ldr(R1, Address(SP, 0 * kWordSize));  // Value.
   __ StoreIntoObjectOffset(R0, offset, R1);
-  __ LoadImmediate(R0, reinterpret_cast<intptr_t>(Object::null()));
+  __ LoadObject(R0, Object::null_object());
   __ Ret();
 }
 
 
+static const Register new_pp = R7;
+
+
 void FlowGraphCompiler::EmitFrameEntry() {
   const Function& function = parsed_function().function();
   if (CanOptimizeFunction() &&
@@ -990,33 +978,23 @@
     const Register function_reg = R6;
 
     // The pool pointer is not setup before entering the Dart frame.
-    // Preserve PP of caller.
-    __ mov(R7, Operand(PP));
     // Temporarily setup pool pointer for this dart function.
-    __ LoadPoolPointer();
+    __ LoadPoolPointer(new_pp);
     // Load function object from object pool.
-    __ LoadObject(function_reg, function);  // Uses PP.
-    // Restore PP of caller.
-    __ mov(PP, Operand(R7));
-    __ set_constant_pool_allowed(false);
+    __ LoadFunctionFromCalleePool(function_reg, function, new_pp);
 
-    // Patch point is after the eventually inlined function object.
-    entry_patch_pc_offset_ = assembler()->CodeSize();
-
-    __ ldr(R7, FieldAddress(function_reg,
+    __ 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(R7, R7, Operand(1));
-      __ str(R7, FieldAddress(function_reg,
+      __ add(R3, R3, Operand(1));
+      __ str(R3, FieldAddress(function_reg,
                               Function::usage_counter_offset()));
     }
-    __ CompareImmediate(R7, GetOptimizationThreshold());
+    __ CompareImmediate(R3, GetOptimizationThreshold());
     ASSERT(function_reg == R6);
-    __ Branch(*StubCode::OptimizeFunction_entry(), GE);
-  } else if (!flow_graph().IsCompiledForOsr()) {
-    entry_patch_pc_offset_ = assembler()->CodeSize();
+    __ Branch(*StubCode::OptimizeFunction_entry(), kNotPatchable, new_pp, GE);
   }
   __ Comment("Enter frame");
   if (flow_graph().IsCompiledForOsr()) {
@@ -1042,7 +1020,10 @@
 void FlowGraphCompiler::CompileGraph() {
   InitCompiler();
 
-  TryIntrinsify();
+  if (TryIntrinsify()) {
+    // Skip regular code generation.
+    return;
+  }
 
   EmitFrameEntry();
   ASSERT(assembler()->constant_pool_allowed());
@@ -1079,11 +1060,8 @@
       __ Bind(&wrong_num_arguments);
       if (function.IsClosureFunction()) {
         ASSERT(assembler()->constant_pool_allowed());
-        __ LeaveDartFrame();  // The arguments are still on the stack.
-        // Do not use caller's pool ptr in branch.
-        ASSERT(!assembler()->constant_pool_allowed());
+        __ LeaveDartFrame(kKeepCalleePP);  // Arguments are still on the stack.
         __ Branch(*StubCode::CallClosureNoSuchMethod_entry());
-        __ set_constant_pool_allowed(true);
         // The noSuchMethod call may return to the caller, but not here.
       } else {
         __ Stop("Wrong number of arguments");
@@ -1111,7 +1089,7 @@
     const intptr_t context_index =
         parsed_function().current_context_var()->index();
     if (num_locals > 1) {
-      __ LoadImmediate(R0, reinterpret_cast<intptr_t>(Object::null()));
+      __ LoadObject(R0, Object::null_object());
     }
     for (intptr_t i = 0; i < num_locals; ++i) {
       // Subtract index i (locals lie at lower addresses than FP).
@@ -1136,12 +1114,15 @@
   __ bkpt(0);
   ASSERT(assembler()->constant_pool_allowed());
   GenerateDeferredCode();
-  // Emit function patching code. This will be swapped with the first 3
-  // instructions at entry point.
-  patch_code_pc_offset_ = assembler()->CodeSize();
-  __ BranchPatchable(*StubCode::FixCallersTarget_entry());
 
-  if (is_optimizing()) {
+  if (is_optimizing() && Compiler::allow_recompilation()) {
+    // Leave enough space for patching in case of lazy deoptimization from
+    // deferred code.
+    for (intptr_t i = 0;
+         i < CallPattern::DeoptCallPatternLengthInInstructions();
+         ++i) {
+      __ nop();
+    }
     lazy_deopt_pc_offset_ = assembler()->CodeSize();
     __ Branch(*StubCode::DeoptimizeLazy_entry());
   }
@@ -1153,7 +1134,7 @@
                                      RawPcDescriptors::Kind kind,
                                      LocationSummary* locs) {
   __ BranchLinkPatchable(stub_entry);
-  AddCurrentDescriptor(kind, Isolate::kNoDeoptId, token_pos);
+  AddCurrentDescriptor(kind, Thread::kNoDeoptId, token_pos);
   RecordSafepoint(locs);
 }
 
@@ -1168,7 +1149,7 @@
   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 = Isolate::ToDeoptAfter(deopt_id);
+  const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id);
   if (is_optimizing()) {
     AddDeoptIndexAtCall(deopt_id_after, token_pos);
   } else {
@@ -1188,10 +1169,10 @@
   __ CallRuntime(entry, argument_count);
   AddCurrentDescriptor(RawPcDescriptors::kOther, deopt_id, token_pos);
   RecordSafepoint(locs);
-  if (deopt_id != Isolate::kNoDeoptId) {
+  if (deopt_id != Thread::kNoDeoptId) {
     // Marks either the continuation point in unoptimized code or the
     // deoptimization point in optimized code, after call.
-    const intptr_t deopt_id_after = Isolate::ToDeoptAfter(deopt_id);
+    const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id);
     if (is_optimizing()) {
       AddDeoptIndexAtCall(deopt_id_after, token_pos);
     } else {
@@ -1205,44 +1186,30 @@
 }
 
 
-void FlowGraphCompiler::EmitEdgeCounter() {
+void FlowGraphCompiler::EmitEdgeCounter(intptr_t edge_id) {
   // We do not check for overflow when incrementing the edge counter.  The
   // function should normally be optimized long before the counter can
   // overflow; and though we do not reset the counters when we optimize or
   // deoptimize, there is a bound on the number of
   // optimization/deoptimization cycles we will attempt.
+  ASSERT(!edge_counters_array_.IsNull());
   ASSERT(assembler_->constant_pool_allowed());
-  const Array& counter = Array::ZoneHandle(zone(), Array::New(1, Heap::kOld));
-  counter.SetAt(0, Smi::Handle(zone(), Smi::New(0)));
   __ Comment("Edge counter");
-  __ LoadUniqueObject(R0, counter);
-  intptr_t increment_start = assembler_->CodeSize();
+  __ LoadObject(R0, edge_counters_array_);
 #if defined(DEBUG)
   bool old_use_far_branches = assembler_->use_far_branches();
   assembler_->set_use_far_branches(true);
 #endif  // DEBUG
-  __ ldr(IP, FieldAddress(R0, Array::element_offset(0)));
-  __ add(IP, IP, Operand(Smi::RawValue(1)));
-  __ StoreIntoSmiField(FieldAddress(R0, Array::element_offset(0)), IP);
-  int32_t size = assembler_->CodeSize() - increment_start;
-  if (isolate()->edge_counter_increment_size() == -1) {
-    isolate()->set_edge_counter_increment_size(size);
-  } else {
-    ASSERT(size == isolate()->edge_counter_increment_size());
-  }
+  __ LoadFieldFromOffset(kWord, R1, R0, Array::element_offset(edge_id));
+  __ add(R1, R1, Operand(Smi::RawValue(1)));
+  __ StoreIntoObjectNoBarrierOffset(
+      R0, Array::element_offset(edge_id), R1, Assembler::kOnlySmi);
 #if defined(DEBUG)
   assembler_->set_use_far_branches(old_use_far_branches);
 #endif  // DEBUG
 }
 
 
-int32_t FlowGraphCompiler::EdgeCounterIncrementSizeInBytes() {
-  const int32_t size = Isolate::Current()->edge_counter_increment_size();
-  ASSERT(size != -1);
-  return size;
-}
-
-
 void FlowGraphCompiler::EmitOptimizedInstanceCall(
     const StubEntry& stub_entry,
     const ICData& ic_data,
@@ -1292,13 +1259,12 @@
     intptr_t deopt_id,
     intptr_t token_pos,
     LocationSummary* locs) {
-  MegamorphicCacheTable* table = Isolate::Current()->megamorphic_cache_table();
   const String& name = String::Handle(zone(), ic_data.target_name());
   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(), table->Lookup(name, arguments_descriptor));
+  const MegamorphicCache& cache = MegamorphicCache::ZoneHandle(zone(),
+      MegamorphicCacheTable::Lookup(isolate(), name, arguments_descriptor));
   const Register receiverR = R0;
   const Register cacheR = R1;
   const Register targetR = R1;
@@ -1313,10 +1279,9 @@
   __ LoadObject(R5, ic_data);
   __ LoadObject(R4, arguments_descriptor);
   __ blx(targetR);
-  AddCurrentDescriptor(RawPcDescriptors::kOther,
-      Isolate::kNoDeoptId, token_pos);
+  AddCurrentDescriptor(RawPcDescriptors::kOther, Thread::kNoDeoptId, token_pos);
   RecordSafepoint(locs);
-  const intptr_t deopt_id_after = Isolate::ToDeoptAfter(deopt_id);
+  const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id);
   if (is_optimizing()) {
     AddDeoptIndexAtCall(deopt_id_after, token_pos);
   } else {
@@ -1385,7 +1350,7 @@
     }
     if (token_pos != Scanner::kNoSourcePos) {
       AddCurrentDescriptor(RawPcDescriptors::kRuntimeCall,
-                           Isolate::kNoDeoptId,
+                           Thread::kNoDeoptId,
                            token_pos);
     }
     // Stub returns result in flags (result of a cmp, we need Z computed).
@@ -1414,7 +1379,7 @@
     }
     if (token_pos != Scanner::kNoSourcePos) {
       AddCurrentDescriptor(RawPcDescriptors::kRuntimeCall,
-                           Isolate::kNoDeoptId,
+                           Thread::kNoDeoptId,
                            token_pos);
     }
     // Stub returns result in flags (result of a cmp, we need Z computed).
@@ -1442,8 +1407,8 @@
     // Store fpu registers with the lowest register number at the lowest
     // address.
     intptr_t offset = 0;
-    for (intptr_t reg_idx = 0; reg_idx < kNumberOfFpuRegisters; ++reg_idx) {
-      QRegister fpu_reg = static_cast<QRegister>(reg_idx);
+    for (intptr_t i = 0; i < kNumberOfFpuRegisters; ++i) {
+      QRegister fpu_reg = static_cast<QRegister>(i);
       if (locs->live_registers()->ContainsFpuRegister(fpu_reg)) {
         DRegister d1 = EvenDRegisterOf(fpu_reg);
         DRegister d2 = OddDRegisterOf(fpu_reg);
@@ -1456,36 +1421,40 @@
     ASSERT(offset == (fpu_regs_count * kFpuRegisterSize));
   }
 
-  // Store general purpose registers with the highest register number at the
-  // lowest address. The order in which the registers are pushed must match the
-  // order in which the registers are encoded in the safe point's stack map.
-  // NOTE: Using ARM's multi-register push, pushes the registers in the wrong
-  // order.
-  for (intptr_t reg_idx = 0; reg_idx < kNumberOfCpuRegisters; ++reg_idx) {
-    Register reg = static_cast<Register>(reg_idx);
+  // The order in which the registers are pushed must match the order
+  // in which the registers are encoded in the safe point's stack map.
+  // NOTE: This matches the order of ARM's multi-register push.
+  RegList reg_list = 0;
+  for (intptr_t i = kNumberOfCpuRegisters - 1; i >= 0; --i) {
+    Register reg = static_cast<Register>(i);
     if (locs->live_registers()->ContainsRegister(reg)) {
-      __ Push(reg);
+      reg_list |= (1 << reg);
     }
   }
+  if (reg_list != 0) {
+    __ PushList(reg_list);
+  }
 }
 
 
 void FlowGraphCompiler::RestoreLiveRegisters(LocationSummary* locs) {
-  // General purpose registers have the highest register number at the
-  // lowest address.
-  for (intptr_t reg_idx = kNumberOfCpuRegisters - 1; reg_idx >= 0; --reg_idx) {
-    Register reg = static_cast<Register>(reg_idx);
+  RegList reg_list = 0;
+  for (intptr_t i = kNumberOfCpuRegisters - 1; i >= 0; --i) {
+    Register reg = static_cast<Register>(i);
     if (locs->live_registers()->ContainsRegister(reg)) {
-      __ Pop(reg);
+      reg_list |= (1 << reg);
     }
   }
+  if (reg_list != 0) {
+    __ PopList(reg_list);
+  }
 
   const intptr_t fpu_regs_count = locs->live_registers()->FpuRegisterCount();
   if (fpu_regs_count > 0) {
     // Fpu registers have the lowest register number at the lowest address.
     intptr_t offset = 0;
-    for (intptr_t reg_idx = 0; reg_idx < kNumberOfFpuRegisters; ++reg_idx) {
-      QRegister fpu_reg = static_cast<QRegister>(reg_idx);
+    for (intptr_t i = 0; i < kNumberOfFpuRegisters; ++i) {
+      QRegister fpu_reg = static_cast<QRegister>(i);
       if (locs->live_registers()->ContainsFpuRegister(fpu_reg)) {
         DRegister d1 = EvenDRegisterOf(fpu_reg);
         DRegister d2 = OddDRegisterOf(fpu_reg);
@@ -1555,7 +1524,8 @@
                      *StubCode::CallStaticFunction_entry(),
                      RawPcDescriptors::kOther,
                      locs);
-    const Function& function = Function::Handle(zone(), ic_data.GetTargetAt(0));
+    const Function& function = Function::ZoneHandle(
+        zone(), ic_data.GetTargetAt(0));
     AddStaticCallTarget(function);
     __ Drop(argument_count);
     if (kNumChecks > 1) {
diff --git a/runtime/vm/flow_graph_compiler_arm64.cc b/runtime/vm/flow_graph_compiler_arm64.cc
index a473953..2c9a717 100644
--- a/runtime/vm/flow_graph_compiler_arm64.cc
+++ b/runtime/vm/flow_graph_compiler_arm64.cc
@@ -13,6 +13,7 @@
 #include "vm/dart_entry.h"
 #include "vm/deopt_instructions.h"
 #include "vm/il_printer.h"
+#include "vm/instructions.h"
 #include "vm/locations.h"
 #include "vm/object_store.h"
 #include "vm/parser.h"
@@ -97,13 +98,10 @@
 
   Zone* zone = compiler->zone();
 
-  // Current PP, FP, and PC.
-  builder->AddPp(Function::Handle(zone, current->code().function()), slot_ix++);
+  builder->AddPp(current->function(), slot_ix++);
   builder->AddPcMarker(Function::Handle(zone), slot_ix++);
   builder->AddCallerFp(slot_ix++);
-  builder->AddReturnAddress(Function::Handle(zone, current->code().function()),
-                            deopt_id(),
-                            slot_ix++);
+  builder->AddReturnAddress(current->function(), deopt_id(), slot_ix++);
 
   // Emit all values that are needed for materialization as a part of the
   // expression stack for the bottom-most frame. This guarantees that GC
@@ -120,18 +118,15 @@
   Environment* previous = current;
   current = current->outer();
   while (current != NULL) {
-    // PP, FP, and PC.
-    builder->AddPp(Function::Handle(
-        zone, current->code().function()), slot_ix++);
-    builder->AddPcMarker(Function::Handle(zone, previous->code().function()),
-                         slot_ix++);
+    builder->AddPp(current->function(), slot_ix++);
+    builder->AddPcMarker(previous->function(), slot_ix++);
     builder->AddCallerFp(slot_ix++);
 
     // For any outer environment the deopt id is that of the call instruction
     // which is recorded in the outer environment.
     builder->AddReturnAddress(
-        Function::Handle(zone, current->code().function()),
-        Isolate::ToDeoptAfter(current->deopt_id()),
+        current->function(),
+        Thread::ToDeoptAfter(current->deopt_id()),
         slot_ix++);
 
     // The values of outgoing arguments can be changed from the inlined call so
@@ -158,11 +153,9 @@
   // The previous pointer is now the outermost environment.
   ASSERT(previous != NULL);
 
-  // For the outermost environment, set caller PC, caller PP, and caller FP.
+  // Add slots for the outermost environment.
   builder->AddCallerPp(slot_ix++);
-  // PC marker.
-  builder->AddPcMarker(Function::Handle(zone, previous->code().function()),
-                       slot_ix++);
+  builder->AddPcMarker(previous->function(), slot_ix++);
   builder->AddCallerFp(slot_ix++);
   builder->AddCallerPc(slot_ix++);
 
@@ -188,7 +181,7 @@
   }
 
   ASSERT(deopt_env() != NULL);
-
+  __ Push(CODE_REG);
   __ BranchLink(*StubCode::Deoptimize_entry());
   set_pc_offset(assem->CodeSize());
 #undef __
@@ -264,7 +257,8 @@
   const Register kInstanceReg = R0;
   Error& malformed_error = Error::Handle(zone());
   const Type& int_type = Type::Handle(zone(), Type::IntType());
-  const bool smi_is_ok = int_type.IsSubtypeOf(type, &malformed_error);
+  const bool smi_is_ok =
+      int_type.IsSubtypeOf(type, &malformed_error, Heap::kOld);
   // Malformed type should have been handled at graph construction time.
   ASSERT(smi_is_ok || malformed_error.IsNull());
   __ tsti(kInstanceReg, Immediate(kSmiTagMask));
@@ -304,7 +298,7 @@
         ASSERT(tp_argument.HasResolvedTypeClass());
         // Check if type argument is dynamic or Object.
         const Type& object_type = Type::Handle(zone(), Type::ObjectType());
-        if (object_type.IsSubtypeOf(tp_argument, NULL)) {
+        if (object_type.IsSubtypeOf(tp_argument, NULL, Heap::kOld)) {
           // Instance class test only necessary.
           return GenerateSubtype1TestCacheLookup(
               token_pos, type_class, is_instance_lbl, is_not_instance_lbl);
@@ -359,7 +353,8 @@
   if (smi_class.IsSubtypeOf(TypeArguments::Handle(zone()),
                             type_class,
                             TypeArguments::Handle(zone()),
-                            NULL)) {
+                            NULL,
+                            Heap::kOld)) {
     __ b(is_instance_lbl, EQ);
   } else {
     __ b(is_not_instance_lbl, EQ);
@@ -387,7 +382,8 @@
   }
   // Custom checking for numbers (Smi, Mint, Bigint and Double).
   // Note that instance is not Smi (checked above).
-  if (type.IsSubtypeOf(Type::Handle(zone(), Type::Number()), NULL)) {
+  if (type.IsSubtypeOf(
+          Type::Handle(zone(), Type::Number()), NULL, Heap::kOld)) {
     GenerateNumberTypeCheck(
         kClassIdReg, type, is_instance_lbl, is_not_instance_lbl);
     return false;
@@ -861,9 +857,8 @@
       __ b(&assign_optional_parameter);
       __ Bind(&load_default_value);
       // Load R5 with default argument.
-      const Object& value = Object::ZoneHandle(
-          zone(), parsed_function().default_parameter_values().At(
-              param_pos - num_fixed_params));
+      const Instance& value = parsed_function().DefaultParameterValueAt(
+          param_pos - num_fixed_params);
       __ LoadObject(R5, value);
       __ Bind(&assign_optional_parameter);
       // Assign R5 to fp[kFirstLocalSlotFromFp - param_pos].
@@ -896,8 +891,7 @@
       __ CompareImmediate(R8, param_pos);
       __ b(&next_parameter, GT);
       // Load R5 with default argument.
-      const Object& value = Object::ZoneHandle(
-          zone(), parsed_function().default_parameter_values().At(i));
+      const Object& value = parsed_function().DefaultParameterValueAt(i);
       __ LoadObject(R5, value);
       // Assign R5 to fp[kFirstLocalSlotFromFp - param_pos].
       // We do not use the final allocation index of the variable here, i.e.
@@ -918,12 +912,8 @@
 
   __ Bind(&wrong_num_arguments);
   if (function.IsClosureFunction()) {
-    ASSERT(assembler()->constant_pool_allowed());
-    __ LeaveDartFrame();  // The arguments are still on the stack.
-    // Do not use caller's pool ptr in branch.
-    ASSERT(!assembler()->constant_pool_allowed());
+    __ LeaveDartFrame(kKeepCalleePP);  // The arguments are still on the stack.
     __ BranchPatchable(*StubCode::CallClosureNoSuchMethod_entry());
-    __ set_constant_pool_allowed(true);
     // The noSuchMethod call may return to the caller, but not here.
   } else if (check_correct_named_args) {
     __ Stop("Wrong arguments");
@@ -992,9 +982,6 @@
     // Load function object using the callee's pool pointer.
     __ LoadFunctionFromCalleePool(function_reg, function, new_pp);
 
-    // Patch point is after the eventually inlined function object.
-    entry_patch_pc_offset_ = assembler()->CodeSize();
-
     __ LoadFieldFromOffset(
         R7, function_reg, Function::usage_counter_offset(), kWord);
     // Reoptimization of an optimized function is triggered by counting in
@@ -1008,10 +995,8 @@
     ASSERT(function_reg == R6);
     Label dont_optimize;
     __ b(&dont_optimize, LT);
-    __ Branch(*StubCode::OptimizeFunction_entry());
+    __ Branch(*StubCode::OptimizeFunction_entry(), new_pp);
     __ Bind(&dont_optimize);
-  } else if (!flow_graph().IsCompiledForOsr()) {
-    entry_patch_pc_offset_ = assembler()->CodeSize();
   }
   __ Comment("Enter frame");
   if (flow_graph().IsCompiledForOsr()) {
@@ -1022,7 +1007,7 @@
     __ EnterOsrFrame(extra_slots * kWordSize, new_pp);
   } else {
     ASSERT(StackSize() >= 0);
-    __ EnterDartFrameWithInfo(StackSize() * kWordSize, new_pp);
+    __ EnterDartFrame(StackSize() * kWordSize, new_pp);
   }
 }
 
@@ -1037,7 +1022,10 @@
 void FlowGraphCompiler::CompileGraph() {
   InitCompiler();
 
-  TryIntrinsify();
+  if (TryIntrinsify()) {
+    // Skip regular code generation.
+    return;
+  }
 
   EmitFrameEntry();
   ASSERT(assembler()->constant_pool_allowed());
@@ -1073,12 +1061,8 @@
       __ b(&correct_num_arguments, EQ);
       __ Bind(&wrong_num_arguments);
       if (function.IsClosureFunction()) {
-        ASSERT(assembler()->constant_pool_allowed());
-        __ LeaveDartFrame();  // The arguments are still on the stack.
-        // Do not use caller's pool ptr in branch.
-        ASSERT(!assembler()->constant_pool_allowed());
+        __ LeaveDartFrame(kKeepCalleePP);  // Arguments are still on the stack.
         __ BranchPatchable(*StubCode::CallClosureNoSuchMethod_entry());
-        __ set_constant_pool_allowed(true);
         // The noSuchMethod call may return to the caller, but not here.
       } else {
         __ Stop("Wrong number of arguments");
@@ -1132,12 +1116,14 @@
   ASSERT(assembler()->constant_pool_allowed());
   GenerateDeferredCode();
 
-  // Emit function patching code. This will be swapped with the first 3
-  // instructions at entry point.
-  patch_code_pc_offset_ = assembler()->CodeSize();
-  __ BranchPatchable(*StubCode::FixCallersTarget_entry());
-
-  if (is_optimizing()) {
+  if (is_optimizing() && Compiler::allow_recompilation()) {
+    // Leave enough space for patching in case of lazy deoptimization from
+    // deferred code.
+    for (intptr_t i = 0;
+      i < CallPattern::kDeoptCallLengthInInstructions;
+      ++i) {
+      __ orr(R0, ZR, Operand(R0));  // nop
+    }
     lazy_deopt_pc_offset_ = assembler()->CodeSize();
   __ BranchPatchable(*StubCode::DeoptimizeLazy_entry());
   }
@@ -1149,7 +1135,7 @@
                                      RawPcDescriptors::Kind kind,
                                      LocationSummary* locs) {
   __ BranchLinkPatchable(stub_entry);
-  AddCurrentDescriptor(kind, Isolate::kNoDeoptId, token_pos);
+  AddCurrentDescriptor(kind, Thread::kNoDeoptId, token_pos);
   RecordSafepoint(locs);
 }
 
@@ -1164,7 +1150,7 @@
   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 = Isolate::ToDeoptAfter(deopt_id);
+  const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id);
   if (is_optimizing()) {
     AddDeoptIndexAtCall(deopt_id_after, token_pos);
   } else {
@@ -1183,10 +1169,10 @@
   __ CallRuntime(entry, argument_count);
   AddCurrentDescriptor(RawPcDescriptors::kOther, deopt_id, token_pos);
   RecordSafepoint(locs);
-  if (deopt_id != Isolate::kNoDeoptId) {
+  if (deopt_id != Thread::kNoDeoptId) {
     // Marks either the continuation point in unoptimized code or the
     // deoptimization point in optimized code, after call.
-    const intptr_t deopt_id_after = Isolate::ToDeoptAfter(deopt_id);
+    const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id);
     if (is_optimizing()) {
       AddDeoptIndexAtCall(deopt_id_after, token_pos);
     } else {
@@ -1198,20 +1184,19 @@
 }
 
 
-void FlowGraphCompiler::EmitEdgeCounter() {
+void FlowGraphCompiler::EmitEdgeCounter(intptr_t edge_id) {
   // We do not check for overflow when incrementing the edge counter.  The
   // function should normally be optimized long before the counter can
   // overflow; and though we do not reset the counters when we optimize or
   // deoptimize, there is a bound on the number of
   // optimization/deoptimization cycles we will attempt.
+  ASSERT(!edge_counters_array_.IsNull());
   ASSERT(assembler_->constant_pool_allowed());
-  const Array& counter = Array::ZoneHandle(zone(), Array::New(1, Heap::kOld));
-  counter.SetAt(0, Smi::Handle(zone(), Smi::New(0)));
   __ Comment("Edge counter");
-  __ LoadUniqueObject(R0, counter);
-  __ LoadFieldFromOffset(TMP, R0, Array::element_offset(0));
+  __ LoadObject(R0, edge_counters_array_);
+  __ LoadFieldFromOffset(TMP, R0, Array::element_offset(edge_id));
   __ add(TMP, TMP, Operand(Smi::RawValue(1)));
-  __ StoreFieldToOffset(TMP, R0, Array::element_offset(0));
+  __ StoreFieldToOffset(TMP, R0, Array::element_offset(edge_id));
 }
 
 
@@ -1264,13 +1249,12 @@
     intptr_t deopt_id,
     intptr_t token_pos,
     LocationSummary* locs) {
-  MegamorphicCacheTable* table = Isolate::Current()->megamorphic_cache_table();
   const String& name = String::Handle(zone(), ic_data.target_name());
   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(), table->Lookup(name, arguments_descriptor));
+  const MegamorphicCache& cache = MegamorphicCache::ZoneHandle(zone(),
+      MegamorphicCacheTable::Lookup(isolate(), name, arguments_descriptor));
   const Register receiverR = R0;
   const Register cacheR = R1;
   const Register targetR = R1;
@@ -1286,9 +1270,9 @@
   __ LoadObject(R4, arguments_descriptor);
   __ blr(targetR);
   AddCurrentDescriptor(RawPcDescriptors::kOther,
-      Isolate::kNoDeoptId, token_pos);
+      Thread::kNoDeoptId, token_pos);
   RecordSafepoint(locs);
-  const intptr_t deopt_id_after = Isolate::ToDeoptAfter(deopt_id);
+  const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id);
   if (is_optimizing()) {
     AddDeoptIndexAtCall(deopt_id_after, token_pos);
   } else {
@@ -1356,7 +1340,7 @@
     }
     if (token_pos != Scanner::kNoSourcePos) {
       AddCurrentDescriptor(RawPcDescriptors::kRuntimeCall,
-                           Isolate::kNoDeoptId,
+                           Thread::kNoDeoptId,
                            token_pos);
     }
     // Stub returns result in flags (result of a cmp, we need Z computed).
@@ -1385,7 +1369,7 @@
     }
     if (token_pos != Scanner::kNoSourcePos) {
       AddCurrentDescriptor(RawPcDescriptors::kRuntimeCall,
-                           Isolate::kNoDeoptId,
+                           Thread::kNoDeoptId,
                            token_pos);
     }
     // Stub returns result in flags (result of a cmp, we need Z computed).
@@ -1411,20 +1395,18 @@
   if (fpu_regs_count > 0) {
     // Store fpu registers with the lowest register number at the lowest
     // address.
-    for (intptr_t reg_idx = kNumberOfVRegisters - 1;
-                  reg_idx >= 0; --reg_idx) {
-      VRegister fpu_reg = static_cast<VRegister>(reg_idx);
+    for (intptr_t i = kNumberOfVRegisters - 1; i >= 0; --i) {
+      VRegister fpu_reg = static_cast<VRegister>(i);
       if (locs->live_registers()->ContainsFpuRegister(fpu_reg)) {
         __ PushQuad(fpu_reg);
       }
     }
   }
 
-  // Store general purpose registers with the highest register number at the
-  // lowest address. The order in which the registers are pushed must match the
-  // order in which the registers are encoded in the safe point's stack map.
-  for (intptr_t reg_idx = 0; reg_idx < kNumberOfCpuRegisters; ++reg_idx) {
-    Register reg = static_cast<Register>(reg_idx);
+  // The order in which the registers are pushed must match the order
+  // in which the registers are encoded in the safe point's stack map.
+  for (intptr_t i = kNumberOfCpuRegisters - 1; i >= 0; --i) {
+    Register reg = static_cast<Register>(i);
     if (locs->live_registers()->ContainsRegister(reg)) {
       __ Push(reg);
     }
@@ -1433,10 +1415,8 @@
 
 
 void FlowGraphCompiler::RestoreLiveRegisters(LocationSummary* locs) {
-  // General purpose registers have the highest register number at the
-  // lowest address.
-  for (intptr_t reg_idx = kNumberOfCpuRegisters - 1; reg_idx >= 0; --reg_idx) {
-    Register reg = static_cast<Register>(reg_idx);
+  for (intptr_t i = 0; i < kNumberOfCpuRegisters; ++i) {
+    Register reg = static_cast<Register>(i);
     if (locs->live_registers()->ContainsRegister(reg)) {
       __ Pop(reg);
     }
@@ -1445,8 +1425,8 @@
   const intptr_t fpu_regs_count = locs->live_registers()->FpuRegisterCount();
   if (fpu_regs_count > 0) {
     // Fpu registers have the lowest register number at the lowest address.
-    for (intptr_t reg_idx = 0; reg_idx < kNumberOfVRegisters; ++reg_idx) {
-      VRegister fpu_reg = static_cast<VRegister>(reg_idx);
+    for (intptr_t i = 0; i < kNumberOfVRegisters; ++i) {
+      VRegister fpu_reg = static_cast<VRegister>(i);
       if (locs->live_registers()->ContainsFpuRegister(fpu_reg)) {
         __ PopQuad(fpu_reg);
       }
@@ -1510,7 +1490,8 @@
                      *StubCode::CallStaticFunction_entry(),
                      RawPcDescriptors::kOther,
                      locs);
-    const Function& function = Function::Handle(zone(), ic_data.GetTargetAt(0));
+    const Function& function = Function::ZoneHandle(
+        zone(), ic_data.GetTargetAt(0));
     AddStaticCallTarget(function);
     __ Drop(argument_count);
     if (kNumChecks > 1) {
diff --git a/runtime/vm/flow_graph_compiler_ia32.cc b/runtime/vm/flow_graph_compiler_ia32.cc
index 388b6d1..72dda0a 100644
--- a/runtime/vm/flow_graph_compiler_ia32.cc
+++ b/runtime/vm/flow_graph_compiler_ia32.cc
@@ -15,6 +15,7 @@
 #include "vm/deopt_instructions.h"
 #include "vm/flow_graph_builder.h"
 #include "vm/il_printer.h"
+#include "vm/instructions.h"
 #include "vm/locations.h"
 #include "vm/object_store.h"
 #include "vm/parser.h"
@@ -102,14 +103,9 @@
 
   Zone* zone = compiler->zone();
 
-  // Callee's PC marker is not used anymore. Pass Code::null() to set to 0.
   builder->AddPcMarker(Function::Handle(zone), slot_ix++);
-
-  // Current FP and PC.
   builder->AddCallerFp(slot_ix++);
-  builder->AddReturnAddress(Function::Handle(zone, current->code().function()),
-                            deopt_id(),
-                            slot_ix++);
+  builder->AddReturnAddress(current->function(), deopt_id(), slot_ix++);
 
   // Emit all values that are needed for materialization as a part of the
   // expression stack for the bottom-most frame. This guarantees that GC
@@ -123,9 +119,7 @@
     builder->AddCopy(current->ValueAt(i), current->LocationAt(i), slot_ix++);
   }
 
-  // Current PC marker and caller FP.
-  builder->AddPcMarker(Function::Handle(
-      zone, current->code().function()), slot_ix++);
+  builder->AddPcMarker(current->function(), slot_ix++);
   builder->AddCallerFp(slot_ix++);
 
   Environment* previous = current;
@@ -134,8 +128,8 @@
     // For any outer environment the deopt id is that of the call instruction
     // which is recorded in the outer environment.
     builder->AddReturnAddress(
-        Function::Handle(zone, current->code().function()),
-        Isolate::ToDeoptAfter(current->deopt_id()),
+        current->function(),
+        Thread::ToDeoptAfter(current->deopt_id()),
         slot_ix++);
 
     // The values of outgoing arguments can be changed from the inlined call so
@@ -155,9 +149,7 @@
                        slot_ix++);
     }
 
-    // PC marker and caller FP.
-    builder->AddPcMarker(Function::Handle(zone, current->code().function()),
-                         slot_ix++);
+    builder->AddPcMarker(current->function(), slot_ix++);
     builder->AddCallerFp(slot_ix++);
 
     // Iterate on the outer environment.
@@ -192,7 +184,7 @@
   }
 
   ASSERT(deopt_env() != NULL);
-
+  __ pushl(CODE_REG);
   __ Call(*StubCode::Deoptimize_entry());
   set_pc_offset(assem->CodeSize());
   __ int3();
@@ -277,7 +269,8 @@
   const Register kInstanceReg = EAX;
   Error& malformed_error = Error::Handle(zone());
   const Type& int_type = Type::Handle(zone(), Type::IntType());
-  const bool smi_is_ok = int_type.IsSubtypeOf(type, &malformed_error);
+  const bool smi_is_ok =
+      int_type.IsSubtypeOf(type, &malformed_error, Heap::kOld);
   // Malformed type should have been handled at graph construction time.
   ASSERT(smi_is_ok || malformed_error.IsNull());
   __ testl(kInstanceReg, Immediate(kSmiTagMask));
@@ -317,7 +310,7 @@
         ASSERT(tp_argument.HasResolvedTypeClass());
         // Check if type argument is dynamic or Object.
         const Type& object_type = Type::Handle(zone(), Type::ObjectType());
-        if (object_type.IsSubtypeOf(tp_argument, NULL)) {
+        if (object_type.IsSubtypeOf(tp_argument, NULL, Heap::kOld)) {
           // Instance class test only necessary.
           return GenerateSubtype1TestCacheLookup(
               token_pos, type_class, is_instance_lbl, is_not_instance_lbl);
@@ -371,7 +364,8 @@
   if (smi_class.IsSubtypeOf(TypeArguments::Handle(zone()),
                             type_class,
                             TypeArguments::Handle(zone()),
-                            NULL)) {
+                            NULL,
+                            Heap::kOld)) {
     __ j(ZERO, is_instance_lbl);
   } else {
     __ j(ZERO, is_not_instance_lbl);
@@ -401,7 +395,8 @@
   }
   // Custom checking for numbers (Smi, Mint, Bigint and Double).
   // Note that instance is not Smi (checked above).
-  if (type.IsSubtypeOf(Type::Handle(zone(), Type::Number()), NULL)) {
+  if (type.IsSubtypeOf(
+          Type::Handle(zone(), Type::Number()), NULL, Heap::kOld)) {
     GenerateNumberTypeCheck(
         kClassIdReg, type, is_instance_lbl, is_not_instance_lbl);
     return false;
@@ -756,6 +751,8 @@
     Location value = defn->locs()->out(0);
     if (value.IsRegister()) {
       __ pushl(value.reg());
+    } else if (value.IsConstant()) {
+      __ PushObject(value.constant());
     } else {
       ASSERT(value.IsStackSlot());
       __ pushl(value.ToStackSlotAddress());
@@ -884,9 +881,8 @@
       __ jmp(&assign_optional_parameter, Assembler::kNearJump);
       __ Bind(&load_default_value);
       // Load EAX with default argument.
-      const Object& value = Object::ZoneHandle(zone(),
-          parsed_function().default_parameter_values().At(
-              param_pos - num_fixed_params));
+      const Instance& value = parsed_function().DefaultParameterValueAt(
+          param_pos - num_fixed_params);
       __ LoadObject(EAX, value);
       __ Bind(&assign_optional_parameter);
       // Assign EAX to fp[kFirstLocalSlotFromFp - param_pos].
@@ -919,8 +915,7 @@
       __ cmpl(ECX, Immediate(param_pos));
       __ j(GREATER, &next_parameter, Assembler::kNearJump);
       // Load EAX with default argument.
-      const Object& value = Object::ZoneHandle(zone(),
-          parsed_function().default_parameter_values().At(i));
+      const Object& value = parsed_function().DefaultParameterValueAt(i);
       __ LoadObject(EAX, value);
       // Assign EAX to fp[kFirstLocalSlotFromFp - param_pos].
       // We do not use the final allocation index of the variable here, i.e.
@@ -1005,12 +1000,9 @@
   if (CanOptimizeFunction() &&
       function.IsOptimizable() &&
       (!is_optimizing() || may_reoptimize())) {
-    const Register function_reg = EDI;
+    const Register function_reg = EBX;
     __ LoadObject(function_reg, function);
 
-    // Patch point is after the eventually inlined function object.
-    entry_patch_pc_offset_ = assembler()->CodeSize();
-
     // Reoptimization of an optimized function is triggered by counting in
     // IC stubs, but not at the entry of the function.
     if (!is_optimizing()) {
@@ -1018,10 +1010,8 @@
     }
     __ cmpl(FieldAddress(function_reg, Function::usage_counter_offset()),
             Immediate(GetOptimizationThreshold()));
-    ASSERT(function_reg == EDI);
+    ASSERT(function_reg == EBX);
     __ J(GREATER_EQUAL, *StubCode::OptimizeFunction_entry());
-  } else if (!flow_graph().IsCompiledForOsr()) {
-    entry_patch_pc_offset_ = assembler()->CodeSize();
   }
   __ Comment("Enter frame");
   if (flow_graph().IsCompiledForOsr()) {
@@ -1040,7 +1030,10 @@
 void FlowGraphCompiler::CompileGraph() {
   InitCompiler();
 
-  TryIntrinsify();
+  if (TryIntrinsify()) {
+    // Skip regular code generation.
+    return;
+  }
 
   EmitFrameEntry();
 
@@ -1142,12 +1135,11 @@
 
   __ int3();
   GenerateDeferredCode();
-  // Emit function patching code. This will be swapped with the first 5 bytes
-  // at entry point.
-  patch_code_pc_offset_ = assembler()->CodeSize();
-  __ Jmp(*StubCode::FixCallersTarget_entry());
 
-  if (is_optimizing()) {
+  if (is_optimizing() && Compiler::allow_recompilation()) {
+    // Leave enough space for patching in case of lazy deoptimization from
+    // deferred code.
+    __ nop(CallPattern::pattern_length_in_bytes());
     lazy_deopt_pc_offset_ = assembler()->CodeSize();
     __ Jmp(*StubCode::DeoptimizeLazy_entry());
   }
@@ -1159,7 +1151,7 @@
                                      RawPcDescriptors::Kind kind,
                                      LocationSummary* locs) {
   __ Call(stub_entry);
-  AddCurrentDescriptor(kind, Isolate::kNoDeoptId, token_pos);
+  AddCurrentDescriptor(kind, Thread::kNoDeoptId, token_pos);
   RecordSafepoint(locs);
 }
 
@@ -1174,7 +1166,7 @@
   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 = Isolate::ToDeoptAfter(deopt_id);
+  const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id);
   if (is_optimizing()) {
     AddDeoptIndexAtCall(deopt_id_after, token_pos);
   } else {
@@ -1193,10 +1185,10 @@
   __ CallRuntime(entry, argument_count);
   AddCurrentDescriptor(RawPcDescriptors::kOther, deopt_id, token_pos);
   RecordSafepoint(locs);
-  if (deopt_id != Isolate::kNoDeoptId) {
+  if (deopt_id != Thread::kNoDeoptId) {
     // Marks either the continuation point in unoptimized code or the
     // deoptimization point in optimized code, after call.
-    const intptr_t deopt_id_after = Isolate::ToDeoptAfter(deopt_id);
+    const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id);
     if (is_optimizing()) {
       AddDeoptIndexAtCall(deopt_id_after, token_pos);
     } else {
@@ -1226,31 +1218,16 @@
 }
 
 
-void FlowGraphCompiler::EmitEdgeCounter() {
+void FlowGraphCompiler::EmitEdgeCounter(intptr_t edge_id) {
   // We do not check for overflow when incrementing the edge counter.  The
   // function should normally be optimized long before the counter can
   // overflow; and though we do not reset the counters when we optimize or
   // deoptimize, there is a bound on the number of
   // optimization/deoptimization cycles we will attempt.
-  const Array& counter = Array::ZoneHandle(zone(), Array::New(1, Heap::kOld));
-  counter.SetAt(0, Smi::Handle(zone(), Smi::New(0)));
+  ASSERT(!edge_counters_array_.IsNull());
   __ Comment("Edge counter");
-  __ LoadObject(EAX, counter);
-  intptr_t increment_start = assembler_->CodeSize();
-  __ IncrementSmiField(FieldAddress(EAX, Array::element_offset(0)), 1);
-  int32_t size = assembler_->CodeSize() - increment_start;
-  if (isolate()->edge_counter_increment_size() == -1) {
-    isolate()->set_edge_counter_increment_size(size);
-  } else {
-    ASSERT(size == isolate()->edge_counter_increment_size());
-  }
-}
-
-
-int32_t FlowGraphCompiler::EdgeCounterIncrementSizeInBytes() {
-  const int32_t size = Isolate::Current()->edge_counter_increment_size();
-  ASSERT(size != -1);
-  return size;
+  __ LoadObject(EAX, edge_counters_array_);
+  __ IncrementSmiField(FieldAddress(EAX, Array::element_offset(edge_id)), 1);
 }
 
 
@@ -1268,7 +1245,7 @@
   // top-level function (parsed_function().function()) which could be
   // reoptimized and which counter needs to be incremented.
   // Pass the function explicitly, it is used in IC stub.
-  __ LoadObject(EDI, parsed_function().function());
+  __ LoadObject(EBX, parsed_function().function());
   __ LoadObject(ECX, ic_data);
   GenerateDartCall(deopt_id,
                    token_pos,
@@ -1302,14 +1279,13 @@
     intptr_t deopt_id,
     intptr_t token_pos,
     LocationSummary* locs) {
-  MegamorphicCacheTable* table = isolate()->megamorphic_cache_table();
   const String& name = String::Handle(zone(), ic_data.target_name());
   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(),
-      table->Lookup(name, arguments_descriptor));
-  const Register receiverR = EDI;
+      MegamorphicCacheTable::Lookup(isolate(), name, arguments_descriptor));
+  const Register receiverR = ECX;
   const Register cacheR = EBX;
   const Register targetR = EBX;
   __ movl(receiverR, Address(ESP, (argument_count - 1) * kWordSize));
@@ -1325,9 +1301,9 @@
   __ LoadObject(EDX, arguments_descriptor);
   __ call(targetR);
   AddCurrentDescriptor(RawPcDescriptors::kOther,
-      Isolate::kNoDeoptId, token_pos);
+      Thread::kNoDeoptId, token_pos);
   RecordSafepoint(locs);
-  const intptr_t deopt_id_after = Isolate::ToDeoptAfter(deopt_id);
+  const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id);
   if (is_optimizing()) {
     AddDeoptIndexAtCall(deopt_id_after, token_pos);
   } else {
@@ -1383,7 +1359,7 @@
     }
     if (token_pos != Scanner::kNoSourcePos) {
       AddCurrentDescriptor(RawPcDescriptors::kRuntimeCall,
-                           Isolate::kNoDeoptId,
+                           Thread::kNoDeoptId,
                            token_pos);
     }
     // Stub returns result in flags (result of a cmpl, we need ZF computed).
@@ -1410,7 +1386,7 @@
     }
     if (token_pos != Scanner::kNoSourcePos) {
       AddCurrentDescriptor(RawPcDescriptors::kRuntimeCall,
-                           Isolate::kNoDeoptId,
+                           Thread::kNoDeoptId,
                            token_pos);
     }
     // Stub returns result in flags (result of a cmpl, we need ZF computed).
@@ -1438,8 +1414,8 @@
     // Store XMM registers with the lowest register number at the lowest
     // address.
     intptr_t offset = 0;
-    for (intptr_t reg_idx = 0; reg_idx < kNumberOfXmmRegisters; ++reg_idx) {
-      XmmRegister xmm_reg = static_cast<XmmRegister>(reg_idx);
+    for (intptr_t i = 0; i < kNumberOfXmmRegisters; ++i) {
+      XmmRegister xmm_reg = static_cast<XmmRegister>(i);
       if (locs->live_registers()->ContainsFpuRegister(xmm_reg)) {
         __ movups(Address(ESP, offset), xmm_reg);
         offset += kFpuRegisterSize;
@@ -1448,11 +1424,10 @@
     ASSERT(offset == (xmm_regs_count * kFpuRegisterSize));
   }
 
-  // Store general purpose registers with the highest register number at the
-  // lowest address. The order in which the registers are pushed must match the
-  // order in which the registers are encoded in the safe point's stack map.
-  for (intptr_t reg_idx = 0; reg_idx < kNumberOfCpuRegisters; ++reg_idx) {
-    Register reg = static_cast<Register>(reg_idx);
+  // The order in which the registers are pushed must match the order
+  // in which the registers are encoded in the safe point's stack map.
+  for (intptr_t i = kNumberOfCpuRegisters - 1; i >= 0; --i) {
+    Register reg = static_cast<Register>(i);
     if (locs->live_registers()->ContainsRegister(reg)) {
       __ pushl(reg);
     }
@@ -1461,10 +1436,8 @@
 
 
 void FlowGraphCompiler::RestoreLiveRegisters(LocationSummary* locs) {
-  // General purpose registers have the highest register number at the
-  // lowest address.
-  for (intptr_t reg_idx = kNumberOfCpuRegisters - 1; reg_idx >= 0; --reg_idx) {
-    Register reg = static_cast<Register>(reg_idx);
+  for (intptr_t i = 0; i < kNumberOfCpuRegisters; ++i) {
+    Register reg = static_cast<Register>(i);
     if (locs->live_registers()->ContainsRegister(reg)) {
       __ popl(reg);
     }
@@ -1474,8 +1447,8 @@
   if (xmm_regs_count > 0) {
     // XMM registers have the lowest register number at the lowest address.
     intptr_t offset = 0;
-    for (intptr_t reg_idx = 0; reg_idx < kNumberOfXmmRegisters; ++reg_idx) {
-      XmmRegister xmm_reg = static_cast<XmmRegister>(reg_idx);
+    for (intptr_t i = 0; i < kNumberOfXmmRegisters; ++i) {
+      XmmRegister xmm_reg = static_cast<XmmRegister>(i);
       if (locs->live_registers()->ContainsFpuRegister(xmm_reg)) {
         __ movups(xmm_reg, Address(ESP, offset));
         offset += kFpuRegisterSize;
@@ -1540,7 +1513,8 @@
                      *StubCode::CallStaticFunction_entry(),
                      RawPcDescriptors::kOther,
                      locs);
-    const Function& function = Function::Handle(zone(), ic_data.GetTargetAt(0));
+    const Function& function = Function::ZoneHandle(
+        zone(), ic_data.GetTargetAt(0));
     AddStaticCallTarget(function);
     __ Drop(argument_count);
     if (kNumChecks > 1) {
diff --git a/runtime/vm/flow_graph_compiler_mips.cc b/runtime/vm/flow_graph_compiler_mips.cc
index a717323..d2670eb 100644
--- a/runtime/vm/flow_graph_compiler_mips.cc
+++ b/runtime/vm/flow_graph_compiler_mips.cc
@@ -12,6 +12,7 @@
 #include "vm/dart_entry.h"
 #include "vm/deopt_instructions.h"
 #include "vm/il_printer.h"
+#include "vm/instructions.h"
 #include "vm/locations.h"
 #include "vm/object_store.h"
 #include "vm/parser.h"
@@ -96,15 +97,11 @@
 
   Zone* zone = compiler->zone();
 
-  // Current PP, FP, and PC.
-  builder->AddPp(Function::Handle(zone, current->code().function()), slot_ix++);
-  builder->AddCallerFp(slot_ix++);
-  builder->AddReturnAddress(Function::Handle(zone, current->code().function()),
-                            deopt_id(),
-                            slot_ix++);
-
-  // Callee's PC marker is not used anymore. Pass Code::null() to set to 0.
+  builder->AddPp(current->function(), slot_ix++);
   builder->AddPcMarker(Function::Handle(zone), slot_ix++);
+  builder->AddCallerFp(slot_ix++);
+  builder->AddReturnAddress(current->function(), deopt_id(), slot_ix++);
+
 
   // Emit all values that are needed for materialization as a part of the
   // expression stack for the bottom-most frame. This guarantees that GC
@@ -121,22 +118,17 @@
   Environment* previous = current;
   current = current->outer();
   while (current != NULL) {
-    // PP, FP, and PC.
-    builder->AddPp(
-        Function::Handle(zone, current->code().function()), slot_ix++);
+    builder->AddPp(current->function(), slot_ix++);
+    builder->AddPcMarker(previous->function(), slot_ix++);
     builder->AddCallerFp(slot_ix++);
 
     // For any outer environment the deopt id is that of the call instruction
     // which is recorded in the outer environment.
     builder->AddReturnAddress(
-        Function::Handle(zone, current->code().function()),
-        Isolate::ToDeoptAfter(current->deopt_id()),
+        current->function(),
+        Thread::ToDeoptAfter(current->deopt_id()),
         slot_ix++);
 
-    // PC marker.
-    builder->AddPcMarker(Function::Handle(zone, previous->code().function()),
-                         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--) {
@@ -161,15 +153,12 @@
   // The previous pointer is now the outermost environment.
   ASSERT(previous != NULL);
 
-  // For the outermost environment, set caller PC, caller PP, and caller FP.
+  // Set slots for the outermost environment.
   builder->AddCallerPp(slot_ix++);
+  builder->AddPcMarker(previous->function(), slot_ix++);
   builder->AddCallerFp(slot_ix++);
   builder->AddCallerPc(slot_ix++);
 
-  // PC marker.
-  builder->AddPcMarker(Function::Handle(zone, previous->code().function()),
-                       slot_ix++);
-
   // For the outermost environment, set the incoming arguments.
   for (intptr_t i = previous->fixed_parameter_count() - 1; i >= 0; i--) {
     builder->AddCopy(previous->ValueAt(i), previous->LocationAt(i), slot_ix++);
@@ -192,7 +181,7 @@
   }
 
   ASSERT(deopt_env() != NULL);
-
+  __ Push(CODE_REG);
   __ BranchLink(*StubCode::Deoptimize_entry());
   set_pc_offset(assem->CodeSize());
 #undef __
@@ -232,11 +221,11 @@
   __ LoadUniqueObject(A2, type_test_cache);
   if (test_kind == kTestTypeOneArg) {
     ASSERT(type_arguments_reg == kNoRegister);
-    __ LoadImmediate(A1, reinterpret_cast<int32_t>(Object::null()));
+    __ LoadObject(A1, Object::null_object());
     __ BranchLink(*StubCode::Subtype1TestCache_entry());
   } else if (test_kind == kTestTypeTwoArgs) {
     ASSERT(type_arguments_reg == kNoRegister);
-    __ LoadImmediate(A1, reinterpret_cast<int32_t>(Object::null()));
+    __ LoadObject(A1, Object::null_object());
     __ BranchLink(*StubCode::Subtype2TestCache_entry());
   } else if (test_kind == kTestTypeThreeArgs) {
     ASSERT(type_arguments_reg == A1);
@@ -268,7 +257,8 @@
   const Register kInstanceReg = A0;
   Error& malformed_error = Error::Handle(zone());
   const Type& int_type = Type::Handle(zone(), Type::IntType());
-  const bool smi_is_ok = int_type.IsSubtypeOf(type, &malformed_error);
+  const bool smi_is_ok =
+      int_type.IsSubtypeOf(type, &malformed_error, Heap::kOld);
   // Malformed type should have been handled at graph construction time.
   ASSERT(smi_is_ok || malformed_error.IsNull());
   __ andi(CMPRES1, kInstanceReg, Immediate(kSmiTagMask));
@@ -307,7 +297,7 @@
         ASSERT(tp_argument.HasResolvedTypeClass());
         // Check if type argument is dynamic or Object.
         const Type& object_type = Type::Handle(zone(), Type::ObjectType());
-        if (object_type.IsSubtypeOf(tp_argument, NULL)) {
+        if (object_type.IsSubtypeOf(tp_argument, NULL, Heap::kOld)) {
           // Instance class test only necessary.
           return GenerateSubtype1TestCacheLookup(
               token_pos, type_class, is_instance_lbl, is_not_instance_lbl);
@@ -362,7 +352,8 @@
   if (smi_class.IsSubtypeOf(TypeArguments::Handle(zone()),
                             type_class,
                             TypeArguments::Handle(zone()),
-                            NULL)) {
+                            NULL,
+                            Heap::kOld)) {
     __ beq(T0, ZR, is_instance_lbl);
   } else {
     __ beq(T0, ZR, is_not_instance_lbl);
@@ -388,7 +379,8 @@
   }
   // Custom checking for numbers (Smi, Mint, Bigint and Double).
   // Note that instance is not Smi (checked above).
-  if (type.IsSubtypeOf(Type::Handle(zone(), Type::Number()), NULL)) {
+  if (type.IsSubtypeOf(
+          Type::Handle(zone(), Type::Number()), NULL, Heap::kOld)) {
     GenerateNumberTypeCheck(
         kClassIdReg, type, is_instance_lbl, is_not_instance_lbl);
     return false;
@@ -450,7 +442,7 @@
     __ lw(A1, Address(SP, 0));  // Get instantiator type arguments.
     // A1: instantiator type arguments.
     // Check if type arguments are null, i.e. equivalent to vector of dynamic.
-    __ LoadImmediate(T7, reinterpret_cast<int32_t>(Object::null()));
+    __ LoadObject(T7, Object::null_object());
     __ beq(A1, T7, is_instance_lbl);
     __ lw(T2,
         FieldAddress(A1, TypeArguments::type_at_offset(type_param.index())));
@@ -880,9 +872,8 @@
 
       __ Bind(&load_default_value);
       // Load T3 with default argument.
-      const Object& value = Object::ZoneHandle(zone(),
-          parsed_function().default_parameter_values().At(
-              param_pos - num_fixed_params));
+      const Instance& value = parsed_function().DefaultParameterValueAt(
+          param_pos - num_fixed_params);
       __ LoadObject(T3, value);
       __ Bind(&assign_optional_parameter);
       // Assign T3 to fp[kFirstLocalSlotFromFp - param_pos].
@@ -914,8 +905,7 @@
       const int param_pos = num_fixed_params + i;
       __ BranchSignedGreater(T2, Immediate(param_pos), &next_parameter);
       // Load T3 with default argument.
-      const Object& value = Object::ZoneHandle(zone(),
-          parsed_function().default_parameter_values().At(i));
+      const Object& value = parsed_function().DefaultParameterValueAt(i);
       __ LoadObject(T3, value);
       // Assign T3 to fp[kFirstLocalSlotFromFp - param_pos].
       // We do not use the final allocation index of the variable here, i.e.
@@ -935,7 +925,7 @@
 
   __ Bind(&wrong_num_arguments);
   if (function.IsClosureFunction()) {
-    __ LeaveDartFrame();  // The arguments are still on the stack.
+    __ LeaveDartFrame(kKeepCalleePP);  // Arguments are still on the stack.
     __ Branch(*StubCode::CallClosureNoSuchMethod_entry());
     // The noSuchMethod call may return to the caller, but not here.
   } else if (check_correct_named_args) {
@@ -961,7 +951,7 @@
   __ Bind(&null_args_loop);
   __ addiu(T2, T2, Immediate(-kWordSize));
   __ addu(T3, T1, T2);
-  __ LoadImmediate(T5, reinterpret_cast<int32_t>(Object::null()));
+  __ LoadObject(T5, Object::null_object());
   __ bgtz(T2, &null_args_loop);
   __ delay_slot()->sw(T5, Address(T3));
   __ Bind(&null_args_loop_exit);
@@ -988,11 +978,14 @@
   __ lw(T0, Address(SP, 1 * kWordSize));  // Receiver.
   __ lw(T1, Address(SP, 0 * kWordSize));  // Value.
   __ StoreIntoObjectOffset(T0, offset, T1);
-  __ LoadImmediate(V0, reinterpret_cast<int32_t>(Object::null()));
+  __ LoadObject(V0, Object::null_object());
   __ Ret();
 }
 
 
+static const Register new_pp = T7;
+
+
 void FlowGraphCompiler::EmitFrameEntry() {
   const Function& function = parsed_function().function();
   if (CanOptimizeFunction() &&
@@ -1000,24 +993,10 @@
       (!is_optimizing() || may_reoptimize())) {
     const Register function_reg = T0;
 
-    __ GetNextPC(T2, TMP);
-
-    // Calculate offset of pool pointer from the PC.
-    const intptr_t object_pool_pc_dist =
-       Instructions::HeaderSize() - Instructions::object_pool_offset() +
-       assembler()->CodeSize() - 1 * Instr::kInstrSize;
-
-    // Preserve PP of caller.
-    __ mov(T1, PP);
     // Temporarily setup pool pointer for this dart function.
-    __ lw(PP, Address(T2, -object_pool_pc_dist));
+    __ LoadPoolPointer(new_pp);
     // Load function object from object pool.
-    __ LoadObject(function_reg, function);  // Uses PP.
-    // Restore PP of caller.
-    __ mov(PP, T1);
-
-    // Patch point is after the eventually inlined function object.
-    entry_patch_pc_offset_ = assembler()->CodeSize();
+    __ LoadFunctionFromCalleePool(function_reg, function, new_pp);
 
     __ lw(T1, FieldAddress(function_reg, Function::usage_counter_offset()));
     // Reoptimization of an optimized function is triggered by counting in
@@ -1033,12 +1012,9 @@
         T1, Immediate(GetOptimizationThreshold()), &dont_branch);
 
     ASSERT(function_reg == T0);
-    __ Branch(*StubCode::OptimizeFunction_entry());
+    __ Branch(*StubCode::OptimizeFunction_entry(), new_pp);
 
     __ Bind(&dont_branch);
-
-  } else if (!flow_graph().IsCompiledForOsr()) {
-    entry_patch_pc_offset_ = assembler()->CodeSize();
   }
   __ Comment("Enter frame");
   if (flow_graph().IsCompiledForOsr()) {
@@ -1064,7 +1040,10 @@
 void FlowGraphCompiler::CompileGraph() {
   InitCompiler();
 
-  TryIntrinsify();
+  if (TryIntrinsify()) {
+    // Skip regular code generation.
+    return;
+  }
 
   EmitFrameEntry();
 
@@ -1099,7 +1078,7 @@
       __ beq(T0, T1, &correct_num_arguments);
       __ Bind(&wrong_num_arguments);
       if (function.IsClosureFunction()) {
-        __ LeaveDartFrame();  // The arguments are still on the stack.
+        __ LeaveDartFrame(kKeepCalleePP);  // Arguments are still on the stack.
         __ Branch(*StubCode::CallClosureNoSuchMethod_entry());
         // The noSuchMethod call may return to the caller, but not here.
       } else {
@@ -1128,7 +1107,7 @@
     const intptr_t context_index =
         parsed_function().current_context_var()->index();
     if (num_locals > 1) {
-      __ LoadImmediate(V0, reinterpret_cast<int32_t>(Object::null()));
+      __ LoadObject(V0, Object::null_object());
     }
     for (intptr_t i = 0; i < num_locals; ++i) {
       // Subtract index i (locals lie at lower addresses than FP).
@@ -1152,12 +1131,15 @@
 
   __ break_(0);
   GenerateDeferredCode();
-  // Emit function patching code. This will be swapped with the first 5 bytes
-  // at entry point.
-  patch_code_pc_offset_ = assembler()->CodeSize();
-  __ BranchPatchable(*StubCode::FixCallersTarget_entry());
 
-  if (is_optimizing()) {
+  if (is_optimizing() && Compiler::allow_recompilation()) {
+    // Leave enough space for patching in case of lazy deoptimization from
+    // deferred code.
+    for (intptr_t i = 0;
+      i < CallPattern::kDeoptCallLengthInInstructions;
+      ++i) {
+      __ nop();
+    }
     lazy_deopt_pc_offset_ = assembler()->CodeSize();
     __ Branch(*StubCode::DeoptimizeLazy_entry());
   }
@@ -1169,7 +1151,7 @@
                                      RawPcDescriptors::Kind kind,
                                      LocationSummary* locs) {
   __ BranchLinkPatchable(stub_entry);
-  AddCurrentDescriptor(kind, Isolate::kNoDeoptId, token_pos);
+  AddCurrentDescriptor(kind, Thread::kNoDeoptId, token_pos);
   RecordSafepoint(locs);
 }
 
@@ -1184,7 +1166,7 @@
   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 = Isolate::ToDeoptAfter(deopt_id);
+  const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id);
   if (is_optimizing()) {
     AddDeoptIndexAtCall(deopt_id_after, token_pos);
   } else {
@@ -1205,10 +1187,10 @@
   __ CallRuntime(entry, argument_count);
   AddCurrentDescriptor(RawPcDescriptors::kOther, deopt_id, token_pos);
   RecordSafepoint(locs);
-  if (deopt_id != Isolate::kNoDeoptId) {
+  if (deopt_id != Thread::kNoDeoptId) {
     // Marks either the continuation point in unoptimized code or the
     // deoptimization point in optimized code, after call.
-    const intptr_t deopt_id_after = Isolate::ToDeoptAfter(deopt_id);
+    const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id);
     if (is_optimizing()) {
       AddDeoptIndexAtCall(deopt_id_after, token_pos);
     } else {
@@ -1222,19 +1204,18 @@
 }
 
 
-void FlowGraphCompiler::EmitEdgeCounter() {
+void FlowGraphCompiler::EmitEdgeCounter(intptr_t edge_id) {
   // We do not check for overflow when incrementing the edge counter.  The
   // function should normally be optimized long before the counter can
   // overflow; and though we do not reset the counters when we optimize or
   // deoptimize, there is a bound on the number of
   // optimization/deoptimization cycles we will attempt.
-  const Array& counter = Array::ZoneHandle(zone(), Array::New(1, Heap::kOld));
-  counter.SetAt(0, Smi::Handle(zone(), Smi::New(0)));
+  ASSERT(!edge_counters_array_.IsNull());
   __ Comment("Edge counter");
-  __ LoadUniqueObject(T0, counter);
-  __ lw(T1, FieldAddress(T0, Array::element_offset(0)));
+  __ LoadObject(T0, edge_counters_array_);
+  __ LoadFieldFromOffset(T1, T0, Array::element_offset(edge_id));
   __ AddImmediate(T1, T1, Smi::RawValue(1));
-  __ sw(T1, FieldAddress(T0, Array::element_offset(0)));
+  __ StoreFieldToOffset(T1, T0, Array::element_offset(edge_id));
 }
 
 
@@ -1289,13 +1270,12 @@
     intptr_t deopt_id,
     intptr_t token_pos,
     LocationSummary* locs) {
-  MegamorphicCacheTable* table = Isolate::Current()->megamorphic_cache_table();
   const String& name = String::Handle(zone(), ic_data.target_name());
   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(), table->Lookup(name, arguments_descriptor));
+  const MegamorphicCache& cache = MegamorphicCache::ZoneHandle(zone(),
+      MegamorphicCacheTable::Lookup(isolate(), name, arguments_descriptor));
   __ Comment("MegamorphicInstanceCall");
   const Register receiverR = T0;
   const Register cacheR = T1;
@@ -1312,9 +1292,9 @@
   __ LoadObject(S4, arguments_descriptor);
   __ jalr(targetR);
   AddCurrentDescriptor(RawPcDescriptors::kOther,
-      Isolate::kNoDeoptId, token_pos);
+      Thread::kNoDeoptId, token_pos);
   RecordSafepoint(locs);
-  const intptr_t deopt_id_after = Isolate::ToDeoptAfter(deopt_id);
+  const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id);
   if (is_optimizing()) {
     AddDeoptIndexAtCall(deopt_id_after, token_pos);
   } else {
@@ -1388,7 +1368,7 @@
     }
     if (token_pos != Scanner::kNoSourcePos) {
       AddCurrentDescriptor(RawPcDescriptors::kRuntimeCall,
-                           Isolate::kNoDeoptId,
+                           Thread::kNoDeoptId,
                            token_pos);
     }
     __ Comment("EqualityRegConstCompare return");
@@ -1422,7 +1402,7 @@
     }
     if (token_pos != Scanner::kNoSourcePos) {
       AddCurrentDescriptor(RawPcDescriptors::kRuntimeCall,
-                           Isolate::kNoDeoptId,
+                           Thread::kNoDeoptId,
                            token_pos);
     }
     __ Comment("EqualityRegRegCompare return");
@@ -1454,8 +1434,8 @@
     // Store fpu registers with the lowest register number at the lowest
     // address.
     intptr_t offset = 0;
-    for (intptr_t reg_idx = 0; reg_idx < kNumberOfFpuRegisters; ++reg_idx) {
-      DRegister fpu_reg = static_cast<DRegister>(reg_idx);
+    for (intptr_t i = 0; i < kNumberOfFpuRegisters; ++i) {
+      DRegister fpu_reg = static_cast<DRegister>(i);
       if (locs->live_registers()->ContainsFpuRegister(fpu_reg)) {
         __ StoreDToOffset(fpu_reg, SP, offset);
         offset += kFpuRegisterSize;
@@ -1464,16 +1444,15 @@
     ASSERT(offset == (fpu_regs_count * kFpuRegisterSize));
   }
 
-  // Store general purpose registers with the highest register number at the
-  // lowest address. The order in which the registers are pushed must match the
-  // order in which the registers are encoded in the safe point's stack map.
+  // The order in which the registers are pushed must match the order
+  // in which the registers are encoded in the safe point's stack map.
   const intptr_t cpu_registers = locs->live_registers()->cpu_registers();
   ASSERT((cpu_registers & ~kAllCpuRegistersList) == 0);
   const int register_count = Utils::CountOneBits(cpu_registers);
   if (register_count > 0) {
     __ addiu(SP, SP, Immediate(-register_count * kWordSize));
     intptr_t offset = register_count * kWordSize;
-    for (int i = 0; i < kNumberOfCpuRegisters; i++) {
+    for (int i = kNumberOfCpuRegisters - 1; i >= 0; --i) {
       Register r = static_cast<Register>(i);
       if (locs->live_registers()->ContainsRegister(r)) {
         offset -= kWordSize;
@@ -1486,15 +1465,13 @@
 
 
 void FlowGraphCompiler::RestoreLiveRegisters(LocationSummary* locs) {
-  // General purpose registers have the highest register number at the
-  // lowest address.
   __ Comment("RestoreLiveRegisters");
   const intptr_t cpu_registers = locs->live_registers()->cpu_registers();
   ASSERT((cpu_registers & ~kAllCpuRegistersList) == 0);
   const int register_count = Utils::CountOneBits(cpu_registers);
   if (register_count > 0) {
     intptr_t offset = register_count * kWordSize;
-    for (int i = 0; i < kNumberOfCpuRegisters; i++) {
+    for (int i = kNumberOfCpuRegisters - 1; i >= 0; --i) {
       Register r = static_cast<Register>(i);
       if (locs->live_registers()->ContainsRegister(r)) {
         offset -= kWordSize;
@@ -1509,8 +1486,8 @@
   if (fpu_regs_count > 0) {
     // Fpu registers have the lowest register number at the lowest address.
     intptr_t offset = 0;
-    for (intptr_t reg_idx = 0; reg_idx < kNumberOfFpuRegisters; ++reg_idx) {
-      DRegister fpu_reg = static_cast<DRegister>(reg_idx);
+    for (intptr_t i = 0; i < kNumberOfFpuRegisters; ++i) {
+      DRegister fpu_reg = static_cast<DRegister>(i);
       if (locs->live_registers()->ContainsFpuRegister(fpu_reg)) {
         __ LoadDFromOffset(fpu_reg, SP, offset);
         offset += kFpuRegisterSize;
@@ -1576,7 +1553,8 @@
                      *StubCode::CallStaticFunction_entry(),
                      RawPcDescriptors::kOther,
                      locs);
-    const Function& function = Function::Handle(zone(), ic_data.GetTargetAt(0));
+    const Function& function = Function::ZoneHandle(
+        zone(), ic_data.GetTargetAt(0));
     AddStaticCallTarget(function);
     __ Drop(argument_count);
     if (kNumChecks > 1) {
diff --git a/runtime/vm/flow_graph_compiler_x64.cc b/runtime/vm/flow_graph_compiler_x64.cc
index b28c25a..2a80633 100644
--- a/runtime/vm/flow_graph_compiler_x64.cc
+++ b/runtime/vm/flow_graph_compiler_x64.cc
@@ -12,6 +12,7 @@
 #include "vm/dart_entry.h"
 #include "vm/deopt_instructions.h"
 #include "vm/il_printer.h"
+#include "vm/instructions.h"
 #include "vm/locations.h"
 #include "vm/object_store.h"
 #include "vm/parser.h"
@@ -100,13 +101,10 @@
 
   Zone* zone = compiler->zone();
 
-  // Current PP, FP, and PC.
-  builder->AddPp(Function::Handle(zone, current->code().function()), slot_ix++);
+  builder->AddPp(current->function(), slot_ix++);
   builder->AddPcMarker(Function::Handle(zone), slot_ix++);
   builder->AddCallerFp(slot_ix++);
-  builder->AddReturnAddress(Function::Handle(zone, current->code().function()),
-                            deopt_id(),
-                            slot_ix++);
+  builder->AddReturnAddress(current->function(), deopt_id(), slot_ix++);
 
   // Emit all values that are needed for materialization as a part of the
   // expression stack for the bottom-most frame. This guarantees that GC
@@ -123,18 +121,15 @@
   Environment* previous = current;
   current = current->outer();
   while (current != NULL) {
-    // PP, FP, and PC.
-    builder->AddPp(Function::Handle(zone, current->code().function()),
-                   slot_ix++);
-    builder->AddPcMarker(Function::Handle(zone, previous->code().function()),
-                         slot_ix++);
+    builder->AddPp(current->function(), slot_ix++);
+    builder->AddPcMarker(previous->function(), slot_ix++);
     builder->AddCallerFp(slot_ix++);
 
     // For any outer environment the deopt id is that of the call instruction
     // which is recorded in the outer environment.
     builder->AddReturnAddress(
-        Function::Handle(zone, current->code().function()),
-        Isolate::ToDeoptAfter(current->deopt_id()),
+        current->function(),
+        Thread::ToDeoptAfter(current->deopt_id()),
         slot_ix++);
 
     // The values of outgoing arguments can be changed from the inlined call so
@@ -161,11 +156,9 @@
   // The previous pointer is now the outermost environment.
   ASSERT(previous != NULL);
 
-  // For the outermost environment, set caller PC, caller PP, and caller FP.
+  // Set slots for the outermost environment.
   builder->AddCallerPp(slot_ix++);
-  // PC marker.
-  builder->AddPcMarker(Function::Handle(zone, previous->code().function()),
-                       slot_ix++);
+  builder->AddPcMarker(previous->function(), slot_ix++);
   builder->AddCallerFp(slot_ix++);
   builder->AddCallerPc(slot_ix++);
 
@@ -192,6 +185,7 @@
 
   ASSERT(deopt_env() != NULL);
 
+  __ pushq(CODE_REG);
   __ Call(*StubCode::Deoptimize_entry());
   set_pc_offset(assem->CodeSize());
   __ int3();
@@ -272,7 +266,8 @@
   const Register kInstanceReg = RAX;
   Error& malformed_error = Error::Handle(zone());
   const Type& int_type = Type::Handle(zone(), Type::IntType());
-  const bool smi_is_ok = int_type.IsSubtypeOf(type, &malformed_error);
+  const bool smi_is_ok =
+      int_type.IsSubtypeOf(type, &malformed_error, Heap::kOld);
   // Malformed type should have been handled at graph construction time.
   ASSERT(smi_is_ok || malformed_error.IsNull());
   __ testq(kInstanceReg, Immediate(kSmiTagMask));
@@ -312,7 +307,7 @@
         ASSERT(tp_argument.HasResolvedTypeClass());
         // Check if type argument is dynamic or Object.
         const Type& object_type = Type::Handle(zone(), Type::ObjectType());
-        if (object_type.IsSubtypeOf(tp_argument, NULL)) {
+        if (object_type.IsSubtypeOf(tp_argument, NULL, Heap::kOld)) {
           // Instance class test only necessary.
           return GenerateSubtype1TestCacheLookup(
               token_pos, type_class, is_instance_lbl, is_not_instance_lbl);
@@ -366,7 +361,8 @@
   if (smi_class.IsSubtypeOf(TypeArguments::Handle(zone()),
                             type_class,
                             TypeArguments::Handle(zone()),
-                            NULL)) {
+                            NULL,
+                            Heap::kOld)) {
     __ j(ZERO, is_instance_lbl);
   } else {
     __ j(ZERO, is_not_instance_lbl);
@@ -394,7 +390,8 @@
   }
   // Custom checking for numbers (Smi, Mint, Bigint and Double).
   // Note that instance is not Smi (checked above).
-  if (type.IsSubtypeOf(Type::Handle(zone(), Type::Number()), NULL)) {
+  if (type.IsSubtypeOf(
+      Type::Handle(zone(), Type::Number()), NULL, Heap::kOld)) {
     GenerateNumberTypeCheck(
         kClassIdReg, type, is_instance_lbl, is_not_instance_lbl);
     return false;
@@ -744,6 +741,8 @@
     Location value = defn->locs()->out(0);
     if (value.IsRegister()) {
       __ pushq(value.reg());
+    } else if (value.IsConstant()) {
+      __ PushObject(value.constant());
     } else {
       ASSERT(value.IsStackSlot());
       __ pushq(value.ToStackSlotAddress());
@@ -873,9 +872,8 @@
       __ jmp(&assign_optional_parameter, Assembler::kNearJump);
       __ Bind(&load_default_value);
       // Load RAX with default argument.
-      const Object& value = Object::ZoneHandle(zone(),
-          parsed_function().default_parameter_values().At(
-              param_pos - num_fixed_params));
+      const Instance& value = parsed_function().DefaultParameterValueAt(
+          param_pos - num_fixed_params);
       __ LoadObject(RAX, value);
       __ Bind(&assign_optional_parameter);
       // Assign RAX to fp[kFirstLocalSlotFromFp - param_pos].
@@ -909,8 +907,7 @@
       __ CompareImmediate(RCX, Immediate(param_pos));
       __ j(GREATER, &next_parameter, Assembler::kNearJump);
       // Load RAX with default argument.
-      const Object& value = Object::ZoneHandle(zone(),
-          parsed_function().default_parameter_values().At(i));
+      const Object& value = parsed_function().DefaultParameterValueAt(i);
       __ LoadObject(RAX, value);
       // Assign RAX to fp[kFirstLocalSlotFromFp - param_pos].
       // We do not use the final allocation index of the variable here, i.e.
@@ -932,11 +929,8 @@
 
   __ Bind(&wrong_num_arguments);
   if (function.IsClosureFunction()) {
-    ASSERT(assembler()->constant_pool_allowed());
-    __ LeaveDartFrame();  // The arguments are still on the stack.
-    ASSERT(!assembler()->constant_pool_allowed());
-    __ jmp(*StubCode::CallClosureNoSuchMethod_entry());
-    __ set_constant_pool_allowed(true);
+    __ LeaveDartFrame(kKeepCalleePP);  // The arguments are still on the stack.
+    __ Jmp(*StubCode::CallClosureNoSuchMethod_entry());
     // The noSuchMethod call may return to the caller, but not here.
   } else if (check_correct_named_args) {
     __ Stop("Wrong arguments");
@@ -993,30 +987,19 @@
 // NOTE: If the entry code shape changes, ReturnAddressLocator in profiler.cc
 // needs to be updated to match.
 void FlowGraphCompiler::EmitFrameEntry() {
-  ASSERT(Assembler::EntryPointToPcMarkerOffset() == 0);
-
   const Function& function = parsed_function().function();
-  const Register new_pp = R13;
-  const Register new_pc = R12;
-
-  // Load PC marker.
-  const intptr_t kRIPRelativeLeaqSize = 7;
-  const intptr_t entry_to_rip_offset = __ CodeSize() + kRIPRelativeLeaqSize;
-  __ leaq(new_pc, Address::AddressRIPRelative(-entry_to_rip_offset));
-  ASSERT(__ CodeSize() == entry_to_rip_offset);
-
   // Load pool pointer.
-  const intptr_t object_pool_pc_dist =
-      Instructions::HeaderSize() - Instructions::object_pool_offset();
-  __ movq(new_pp, Address(new_pc, -object_pool_pc_dist));
 
   if (flow_graph().IsCompiledForOsr()) {
     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, new_pc);
+    __ EnterOsrFrame(extra_slots * kWordSize);
   } else {
+    const Register new_pp = R13;
+    __ LoadPoolPointer(new_pp);
+
     if (CanOptimizeFunction() &&
         function.IsOptimizable() &&
         (!is_optimizing() || may_reoptimize())) {
@@ -1024,9 +1007,6 @@
       // Load function object using the callee's pool pointer.
       __ LoadFunctionFromCalleePool(function_reg, function, new_pp);
 
-      // Patch point is after the eventually inlined function object.
-      entry_patch_pc_offset_ = assembler()->CodeSize();
-
       // Reoptimization of an optimized function is triggered by counting in
       // IC stubs, but not at the entry of the function.
       if (!is_optimizing()) {
@@ -1039,12 +1019,10 @@
       __ J(GREATER_EQUAL,
            *StubCode::OptimizeFunction_entry(),
            new_pp);
-    } else {
-      entry_patch_pc_offset_ = assembler()->CodeSize();
     }
     ASSERT(StackSize() >= 0);
     __ Comment("Enter frame");
-    __ EnterDartFrameWithInfo(StackSize() * kWordSize, new_pp, new_pc);
+    __ EnterDartFrame(StackSize() * kWordSize, new_pp);
   }
 }
 
@@ -1052,7 +1030,10 @@
 void FlowGraphCompiler::CompileGraph() {
   InitCompiler();
 
-  TryIntrinsify();
+  if (TryIntrinsify()) {
+    // Skip regular code generation.
+    return;
+  }
 
   EmitFrameEntry();
   ASSERT(assembler()->constant_pool_allowed());
@@ -1089,11 +1070,8 @@
 
       __ Bind(&wrong_num_arguments);
       if (function.IsClosureFunction()) {
-        ASSERT(assembler()->constant_pool_allowed());
-        __ LeaveDartFrame();  // The arguments are still on the stack.
-        ASSERT(!assembler()->constant_pool_allowed());
-        __ jmp(*StubCode::CallClosureNoSuchMethod_entry());
-        __ set_constant_pool_allowed(true);
+        __ LeaveDartFrame(kKeepCalleePP);  // Leave arguments on the stack.
+        __ Jmp(*StubCode::CallClosureNoSuchMethod_entry());
         // The noSuchMethod call may return to the caller, but not here.
       } else {
         __ Stop("Wrong number of arguments");
@@ -1157,12 +1135,11 @@
   GenerateDeferredCode();
   // Emit function patching code. This will be swapped with the first 13 bytes
   // at entry point.
-  patch_code_pc_offset_ = assembler()->CodeSize();
-  // This is patched up to a point in FrameEntry where the PP for the
-  // current function is in R13 instead of PP.
-  __ JmpPatchable(*StubCode::FixCallersTarget_entry(), R13);
 
-  if (is_optimizing()) {
+  if (is_optimizing() && Compiler::allow_recompilation()) {
+    // Leave enough space for patching in case of lazy deoptimization from
+    // deferred code.
+    __ nop(ShortCallPattern::pattern_length_in_bytes());
     lazy_deopt_pc_offset_ = assembler()->CodeSize();
     __ Jmp(*StubCode::DeoptimizeLazy_entry(), PP);
   }
@@ -1174,7 +1151,7 @@
                                      RawPcDescriptors::Kind kind,
                                      LocationSummary* locs) {
   __ Call(stub_entry);
-  AddCurrentDescriptor(kind, Isolate::kNoDeoptId, token_pos);
+  AddCurrentDescriptor(kind, Thread::kNoDeoptId, token_pos);
   RecordSafepoint(locs);
 }
 
@@ -1189,7 +1166,7 @@
   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 = Isolate::ToDeoptAfter(deopt_id);
+  const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id);
   if (is_optimizing()) {
     AddDeoptIndexAtCall(deopt_id_after, token_pos);
   } else {
@@ -1208,10 +1185,10 @@
   __ CallRuntime(entry, argument_count);
   AddCurrentDescriptor(RawPcDescriptors::kOther, deopt_id, token_pos);
   RecordSafepoint(locs);
-  if (deopt_id != Isolate::kNoDeoptId) {
+  if (deopt_id != Thread::kNoDeoptId) {
     // Marks either the continuation point in unoptimized code or the
     // deoptimization point in optimized code, after call.
-    const intptr_t deopt_id_after = Isolate::ToDeoptAfter(deopt_id);
+    const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id);
     if (is_optimizing()) {
       AddDeoptIndexAtCall(deopt_id_after, token_pos);
     } else {
@@ -1241,32 +1218,17 @@
 }
 
 
-void FlowGraphCompiler::EmitEdgeCounter() {
+void FlowGraphCompiler::EmitEdgeCounter(intptr_t edge_id) {
   // We do not check for overflow when incrementing the edge counter.  The
   // function should normally be optimized long before the counter can
   // overflow; and though we do not reset the counters when we optimize or
   // deoptimize, there is a bound on the number of
   // optimization/deoptimization cycles we will attempt.
+  ASSERT(!edge_counters_array_.IsNull());
   ASSERT(assembler_->constant_pool_allowed());
-  const Array& counter = Array::ZoneHandle(zone(), Array::New(1, Heap::kOld));
-  counter.SetAt(0, Smi::Handle(zone(), Smi::New(0)));
   __ Comment("Edge counter");
-  __ LoadUniqueObject(RAX, counter);
-  intptr_t increment_start = assembler_->CodeSize();
-  __ IncrementSmiField(FieldAddress(RAX, Array::element_offset(0)), 1);
-  int32_t size = assembler_->CodeSize() - increment_start;
-  if (isolate()->edge_counter_increment_size() == -1) {
-    isolate()->set_edge_counter_increment_size(size);
-  } else {
-    ASSERT(size == isolate()->edge_counter_increment_size());
-  }
-}
-
-
-int32_t FlowGraphCompiler::EdgeCounterIncrementSizeInBytes() {
-  const int32_t size = Isolate::Current()->edge_counter_increment_size();
-  ASSERT(size != -1);
-  return size;
+  __ LoadObject(RAX, edge_counters_array_);
+  __ IncrementSmiField(FieldAddress(RAX, Array::element_offset(edge_id)), 1);
 }
 
 
@@ -1318,13 +1280,12 @@
     intptr_t deopt_id,
     intptr_t token_pos,
     LocationSummary* locs) {
-  MegamorphicCacheTable* table = isolate()->megamorphic_cache_table();
   const String& name = String::Handle(zone(), ic_data.target_name());
   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(), table->Lookup(name, arguments_descriptor));
+  const MegamorphicCache& cache = MegamorphicCache::ZoneHandle(zone(),
+      MegamorphicCacheTable::Lookup(isolate(), name, arguments_descriptor));
   const Register receiverR = RDI;
   const Register cacheR = RBX;
   const Register targetR = RCX;
@@ -1340,9 +1301,9 @@
   __ LoadObject(R10, arguments_descriptor);
   __ call(targetR);
   AddCurrentDescriptor(RawPcDescriptors::kOther,
-      Isolate::kNoDeoptId, token_pos);
+      Thread::kNoDeoptId, token_pos);
   RecordSafepoint(locs);
-  const intptr_t deopt_id_after = Isolate::ToDeoptAfter(deopt_id);
+  const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id);
   if (is_optimizing()) {
     AddDeoptIndexAtCall(deopt_id_after, token_pos);
   } else {
@@ -1398,7 +1359,7 @@
     }
     if (token_pos != Scanner::kNoSourcePos) {
       AddCurrentDescriptor(RawPcDescriptors::kRuntimeCall,
-                           Isolate::kNoDeoptId,
+                           Thread::kNoDeoptId,
                            token_pos);
     }
     // Stub returns result in flags (result of a cmpq, we need ZF computed).
@@ -1425,7 +1386,7 @@
     }
     if (token_pos != Scanner::kNoSourcePos) {
       AddCurrentDescriptor(RawPcDescriptors::kRuntimeCall,
-                           Isolate::kNoDeoptId,
+                           Thread::kNoDeoptId,
                            token_pos);
     }
     // Stub returns result in flags (result of a cmpq, we need ZF computed).
@@ -1513,7 +1474,8 @@
                      *StubCode::CallStaticFunction_entry(),
                      RawPcDescriptors::kOther,
                      locs);
-    const Function& function = Function::Handle(zone(), ic_data.GetTargetAt(0));
+    const Function& function = Function::ZoneHandle(
+        zone(), ic_data.GetTargetAt(0));
     AddStaticCallTarget(function);
     __ Drop(argument_count, RCX);
     if (kNumChecks > 1) {
diff --git a/runtime/vm/flow_graph_inliner.cc b/runtime/vm/flow_graph_inliner.cc
index a646017..f8bcb22 100644
--- a/runtime/vm/flow_graph_inliner.cc
+++ b/runtime/vm/flow_graph_inliner.cc
@@ -82,10 +82,10 @@
 
 
 // Test if a call is recursive by looking in the deoptimization environment.
-static bool IsCallRecursive(const Code& code, Definition* call) {
+static bool IsCallRecursive(const Function& function, Definition* call) {
   Environment* env = call->env();
   while (env != NULL) {
-    if (code.raw() == env->code().raw()) {
+    if (function.raw() == env->function().raw()) {
       return true;
     }
     env = env->outer();
@@ -97,8 +97,7 @@
 // Helper to get the default value of a formal parameter.
 static ConstantInstr* GetDefaultValue(intptr_t i,
                                       const ParsedFunction& parsed_function) {
-  return new ConstantInstr(Object::ZoneHandle(
-      parsed_function.default_parameter_values().At(i)));
+  return new ConstantInstr(parsed_function.DefaultParameterValueAt(i));
 }
 
 
@@ -564,13 +563,13 @@
                                          inlining_depth_,
                                          &inlined_info_);
     while (collected_call_sites_->HasCalls()) {
-      TRACE_INLINING(ISL_Print("  Depth %" Pd " ----------\n",
+      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) {
-        ISL_Print("**Depth % " Pd " calls to inline %" Pd "\n",
+        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.
@@ -615,7 +614,7 @@
   bool TryInlining(const Function& function,
                    const Array& argument_names,
                    InlinedCallData* call_data) {
-    TRACE_INLINING(ISL_Print("  => %s (deopt count %d)\n",
+    TRACE_INLINING(THR_Print("  => %s (deopt count %d)\n",
                              function.ToCString(),
                              function.deoptimization_counter()));
 
@@ -624,7 +623,7 @@
     const Code& unoptimized_code = Code::Handle(function.unoptimized_code());
     // Abort if the inlinable bit on the function is low.
     if (!function.CanBeInlined()) {
-      TRACE_INLINING(ISL_Print("     Bailout: not inlinable\n"));
+      TRACE_INLINING(THR_Print("     Bailout: not inlinable\n"));
       PRINT_INLINING_TREE("Not inlinable",
           &call_data->caller, &function, call_data->call);
       return false;
@@ -634,7 +633,7 @@
     if (function.deoptimization_counter() >=
         FLAG_deoptimization_counter_threshold) {
       function.set_is_inlinable(false);
-      TRACE_INLINING(ISL_Print("     Bailout: deoptimization threshold\n"));
+      TRACE_INLINING(THR_Print("     Bailout: deoptimization threshold\n"));
       PRINT_INLINING_TREE("Deoptimization threshold exceeded",
           &call_data->caller, &function, call_data->call);
       return false;
@@ -643,7 +642,7 @@
     const char* kNeverInlineAnnotation = "NeverInline";
     if (FLAG_enable_inlining_annotations &&
         HasAnnotation(function, kNeverInlineAnnotation)) {
-      TRACE_INLINING(ISL_Print("     Bailout: NeverInline annotation\n"));
+      TRACE_INLINING(THR_Print("     Bailout: NeverInline annotation\n"));
       return false;
     }
 
@@ -653,7 +652,7 @@
                         function.optimized_instruction_count(),
                         function.optimized_call_site_count(),
                         constant_arguments)) {
-      TRACE_INLINING(ISL_Print("     Bailout: early heuristics with "
+      TRACE_INLINING(THR_Print("     Bailout: early heuristics with "
                                "code size:  %" Pd ", "
                                "call sites: %" Pd ", "
                                "const args: %" Pd "\n",
@@ -668,18 +667,18 @@
     // Abort if this is a recursive occurrence.
     Definition* call = call_data->call;
     // Added 'volatile' works around a possible GCC 4.9 compiler bug.
-    volatile bool is_recursive_call = IsCallRecursive(unoptimized_code, call);
+    volatile bool is_recursive_call = IsCallRecursive(function, call);
     if (is_recursive_call &&
         inlining_recursion_depth_ >= FLAG_inlining_recursion_depth_threshold) {
-      TRACE_INLINING(ISL_Print("     Bailout: recursive function\n"));
+      TRACE_INLINING(THR_Print("     Bailout: recursive function\n"));
       PRINT_INLINING_TREE("Recursive function",
           &call_data->caller, &function, call_data->call);
       return false;
     }
 
     // Save and clear deopt id.
-    const intptr_t prev_deopt_id = isolate()->deopt_id();
-    isolate()->set_deopt_id(0);
+    const intptr_t prev_deopt_id = thread()->deopt_id();
+    thread()->set_deopt_id(0);
     // Install bailout jump.
     LongJumpScope jump;
     if (setjmp(*jump.Set()) == 0) {
@@ -687,14 +686,7 @@
       bool in_cache;
       ParsedFunction* parsed_function;
       {
-        CSTAT_TIMER_SCOPE(isolate(), graphinliner_parse_timer);
-        if (!Compiler::always_optimize()) {
-          const Error& error = Error::Handle(Z,
-              Compiler::EnsureUnoptimizedCode(Thread::Current(), function));
-          if (!error.IsNull()) {
-            Exceptions::PropagateError(error);
-          }
-        }
+        CSTAT_TIMER_SCOPE(thread(), graphinliner_parse_timer);
         parsed_function = GetParsedFunction(function, &in_cache);
       }
 
@@ -709,11 +701,11 @@
       FlowGraphBuilder builder(*parsed_function,
                                *ic_data_array,
                                exit_collector,
-                               Isolate::kNoDeoptId);
+                               Thread::kNoDeoptId);
       builder.SetInitialBlockId(caller_graph_->max_block_id());
       FlowGraph* callee_graph;
       {
-        CSTAT_TIMER_SCOPE(isolate(), graphinliner_build_timer);
+        CSTAT_TIMER_SCOPE(thread(), graphinliner_build_timer);
         callee_graph = builder.BuildGraph();
       }
 
@@ -734,14 +726,14 @@
       // arrays so that actual arguments are in one-to-one with the formal
       // parameters.
       if (function.HasOptionalParameters()) {
-        TRACE_INLINING(ISL_Print("     adjusting for optional parameters\n"));
+        TRACE_INLINING(THR_Print("     adjusting for optional parameters\n"));
         if (!AdjustForOptionalParameters(*parsed_function,
                                          argument_names,
                                          arguments,
                                          param_stubs,
                                          callee_graph)) {
           function.set_is_inlinable(false);
-          TRACE_INLINING(ISL_Print("     Bailout: optional arg mismatch\n"));
+          TRACE_INLINING(THR_Print("     Bailout: optional arg mismatch\n"));
           PRINT_INLINING_TREE("Optional arg mismatch",
               &call_data->caller, &function, call_data->call);
           return false;
@@ -767,7 +759,7 @@
       block_scheduler.AssignEdgeWeights();
 
       {
-        CSTAT_TIMER_SCOPE(isolate(), graphinliner_ssa_timer);
+        CSTAT_TIMER_SCOPE(thread(), graphinliner_ssa_timer);
         // Compute SSA on the callee graph, catching bailouts.
         callee_graph->ComputeSSA(caller_graph_->max_virtual_register_number(),
                                  param_stubs);
@@ -775,7 +767,7 @@
       }
 
       {
-        CSTAT_TIMER_SCOPE(isolate(), graphinliner_opt_timer);
+        CSTAT_TIMER_SCOPE(thread(), graphinliner_opt_timer);
         // TODO(zerny): Do more optimization passes on the callee graph.
         FlowGraphOptimizer optimizer(callee_graph);
         if (Compiler::always_optimize()) {
@@ -792,7 +784,7 @@
 
       if (FLAG_trace_inlining &&
           (FLAG_print_flow_graph || FLAG_print_flow_graph_optimized)) {
-        ISL_Print("Callee graph for inlining %s\n",
+        THR_Print("Callee graph for inlining %s\n",
                   function.ToFullyQualifiedCString());
         FlowGraphPrinter printer(*callee_graph);
         printer.PrintBlocks();
@@ -821,8 +813,8 @@
             (size > FLAG_inlining_constant_arguments_max_size_threshold)) {
           function.set_is_inlinable(false);
         }
-        isolate()->set_deopt_id(prev_deopt_id);
-        TRACE_INLINING(ISL_Print("     Bailout: heuristics with "
+        thread()->set_deopt_id(prev_deopt_id);
+        TRACE_INLINING(THR_Print("     Bailout: heuristics with "
                                  "code size:  %" Pd ", "
                                  "call sites: %" Pd ", "
                                  "const args: %" Pd "\n",
@@ -851,7 +843,7 @@
       if (is_recursive_call) {
         inlined_recursive_call_ = true;
       }
-      isolate()->set_deopt_id(prev_deopt_id);
+      thread()->set_deopt_id(prev_deopt_id);
 
       call_data->callee_graph = callee_graph;
       call_data->parameter_stubs = param_stubs;
@@ -873,7 +865,7 @@
       // We allocate a ZoneHandle for the unoptimized code so that it cannot be
       // disconnected from its function during the rest of compilation.
       Code::ZoneHandle(unoptimized_code.raw());
-      TRACE_INLINING(ISL_Print("     Success\n"));
+      TRACE_INLINING(THR_Print("     Success\n"));
       PRINT_INLINING_TREE(NULL,
           &call_data->caller, &function, call);
       return true;
@@ -881,8 +873,8 @@
       Error& error = Error::Handle();
       error = isolate()->object_store()->sticky_error();
       isolate()->object_store()->clear_sticky_error();
-      isolate()->set_deopt_id(prev_deopt_id);
-      TRACE_INLINING(ISL_Print("     Bailout: %s\n", error.ToErrorCString()));
+      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);
       return false;
@@ -891,7 +883,7 @@
 
   void PrintInlinedInfo(const Function& top) {
     if (inlined_info_.length() > 0) {
-      ISL_Print("Inlining into: '%s' growth: %f (%" Pd " -> %" Pd ")\n",
+      THR_Print("Inlining into: '%s' growth: %f (%" Pd " -> %" Pd ")\n",
           top.ToFullyQualifiedCString(),
           GrowthFactor(),
           initial_size_,
@@ -924,9 +916,9 @@
           (info.caller->raw() == caller.raw()) &&
           !Contains(call_instructions_printed, info.call_instr->GetDeoptId())) {
         for (int t = 0; t < depth; t++) {
-          ISL_Print("  ");
+          THR_Print("  ");
         }
-        ISL_Print("%" Pd " %s\n",
+        THR_Print("%" Pd " %s\n",
             info.call_instr->GetDeoptId(),
             info.inlined->ToQualifiedCString());
         PrintInlinedInfoFor(*info.inlined, depth + 1);
@@ -944,9 +936,9 @@
           (info.caller->raw() == caller.raw()) &&
           !Contains(call_instructions_printed, info.call_instr->GetDeoptId())) {
         for (int t = 0; t < depth; t++) {
-          ISL_Print("  ");
+          THR_Print("  ");
         }
-        ISL_Print("NO %" Pd " %s - %s\n",
+        THR_Print("NO %" Pd " %s - %s\n",
             info.call_instr->GetDeoptId(),
             info.inlined->ToQualifiedCString(),
             info.bailout_reason);
@@ -956,7 +948,7 @@
   }
 
   void InlineCall(InlinedCallData* call_data) {
-    CSTAT_TIMER_SCOPE(Isolate::Current(), graphinliner_subst_timer);
+    CSTAT_TIMER_SCOPE(Thread::Current(), graphinliner_subst_timer);
     FlowGraph* callee_graph = call_data->callee_graph;
     TargetEntryInstr* callee_entry =
         callee_graph->graph_entry()->normal_entry();
@@ -1044,7 +1036,7 @@
   void InlineStaticCalls() {
     const GrowableArray<CallSites::StaticCallInfo>& call_info =
         inlining_call_sites_->static_calls();
-    TRACE_INLINING(ISL_Print("  Static Calls (%" Pd ")\n", call_info.length()));
+    TRACE_INLINING(THR_Print("  Static Calls (%" Pd ")\n", call_info.length()));
     for (intptr_t call_idx = 0; call_idx < call_info.length(); ++call_idx) {
       StaticCallInstr* call = call_info[call_idx].call;
       if (call->function().name() == Symbols::ListFactory().raw()) {
@@ -1062,7 +1054,7 @@
       const Function& target = call->function();
       if (!inliner_->AlwaysInline(target) &&
           (call_info[call_idx].ratio * 100) < FLAG_inlining_hotness) {
-        TRACE_INLINING(ISL_Print(
+        TRACE_INLINING(THR_Print(
             "  => %s (deopt count %d)\n     Bailout: cold %f\n",
             target.ToCString(),
             target.deoptimization_counter(),
@@ -1087,7 +1079,7 @@
   void InlineClosureCalls() {
     const GrowableArray<CallSites::ClosureCallInfo>& call_info =
         inlining_call_sites_->closure_calls();
-    TRACE_INLINING(ISL_Print("  Closure Calls (%" Pd ")\n",
+    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;
@@ -1109,7 +1101,7 @@
       }
 
       if (target.IsNull()) {
-        TRACE_INLINING(ISL_Print("     Bailout: non-closure operator\n"));
+        TRACE_INLINING(THR_Print("     Bailout: non-closure operator\n"));
         continue;
       }
       GrowableArray<Value*> arguments(call->ArgumentCount());
@@ -1130,7 +1122,7 @@
   void InlineInstanceCalls() {
     const GrowableArray<CallSites::InstanceCallInfo>& call_info =
         inlining_call_sites_->instance_calls();
-    TRACE_INLINING(ISL_Print("  Polymorphic Instance Calls (%" Pd ")\n",
+    TRACE_INLINING(THR_Print("  Polymorphic Instance Calls (%" Pd ")\n",
                              call_info.length()));
     for (intptr_t call_idx = 0; call_idx < call_info.length(); ++call_idx) {
       PolymorphicInstanceCallInstr* call = call_info[call_idx].call;
@@ -1149,7 +1141,7 @@
       const Function& target = Function::ZoneHandle(ic_data.GetTargetAt(0));
       if (!inliner_->AlwaysInline(target) &&
           (call_info[call_idx].ratio * 100) < FLAG_inlining_hotness) {
-        TRACE_INLINING(ISL_Print(
+        TRACE_INLINING(THR_Print(
             "  => %s (deopt count %d)\n     Bailout: cold %f\n",
             target.ToCString(),
             target.deoptimization_counter(),
@@ -1200,10 +1192,8 @@
       // For each optional positional parameter without an actual, add its
       // default value.
       for (intptr_t i = arg_count; i < param_count; ++i) {
-        const Object& object =
-            Object::ZoneHandle(
-                parsed_function.default_parameter_values().At(
-                    i - fixed_param_count));
+        const Instance& object =
+            parsed_function.DefaultParameterValueAt(i - fixed_param_count);
         ConstantInstr* constant = new(Z) ConstantInstr(object);
         arguments->Add(NULL);
         param_stubs->Add(constant);
@@ -1230,7 +1220,7 @@
     // Otherwise, build a collection of name/argument pairs.
     GrowableArray<NamedArgument> named_args(argument_names_count);
     for (intptr_t i = 0; i < argument_names.Length(); ++i) {
-      String& arg_name = String::Handle(Isolate::Current());
+      String& arg_name = String::Handle(caller_graph_->zone());
       arg_name ^= argument_names.At(i);
       named_args.Add(
           NamedArgument(&arg_name, (*arguments)[i + fixed_param_count]));
@@ -1507,7 +1497,7 @@
     GraphEntryInstr* graph_entry =
         new(Z) GraphEntryInstr(*temp_parsed_function,
                                entry,
-                               Isolate::kNoDeoptId);  // No OSR id.
+                               Thread::kNoDeoptId);  // No OSR id.
     // Update polymorphic inliner state.
     inlined_entries_.Add(graph_entry);
     exit_collector_->Union(exit_collector);
@@ -1832,7 +1822,7 @@
   const char* kAlwaysInlineAnnotation = "AlwaysInline";
   if (FLAG_enable_inlining_annotations &&
       HasAnnotation(function, kAlwaysInlineAnnotation)) {
-    TRACE_INLINING(ISL_Print("AlwaysInline annotation for %s\n",
+    TRACE_INLINING(THR_Print("AlwaysInline annotation for %s\n",
                              function.ToCString()));
     return true;
   }
@@ -1860,11 +1850,11 @@
     return;
   }
 
-  TRACE_INLINING(ISL_Print("Inlining calls in %s\n", top.ToCString()));
+  TRACE_INLINING(THR_Print("Inlining calls in %s\n", top.ToCString()));
 
   if (trace_inlining() &&
       (FLAG_print_flow_graph || FLAG_print_flow_graph_optimized)) {
-    ISL_Print("Before Inlining of %s\n", flow_graph_->
+    THR_Print("Before Inlining of %s\n", flow_graph_->
               function().ToFullyQualifiedCString());
     FlowGraphPrinter printer(*flow_graph_);
     printer.PrintBlocks();
@@ -1879,9 +1869,9 @@
   if (inliner.inlined()) {
     flow_graph_->DiscoverBlocks();
     if (trace_inlining()) {
-      ISL_Print("Inlining growth factor: %f\n", inliner.GrowthFactor());
+      THR_Print("Inlining growth factor: %f\n", inliner.GrowthFactor());
       if (FLAG_print_flow_graph || FLAG_print_flow_graph_optimized) {
-        ISL_Print("After Inlining of %s\n", flow_graph_->
+        THR_Print("After Inlining of %s\n", flow_graph_->
                   function().ToFullyQualifiedCString());
         FlowGraphPrinter printer(*flow_graph_);
         printer.PrintBlocks();
diff --git a/runtime/vm/flow_graph_optimizer.cc b/runtime/vm/flow_graph_optimizer.cc
index cf07132..4a1aa37 100644
--- a/runtime/vm/flow_graph_optimizer.cc
+++ b/runtime/vm/flow_graph_optimizer.cc
@@ -51,6 +51,7 @@
 
 DECLARE_FLAG(bool, polymorphic_with_deopt);
 DECLARE_FLAG(bool, source_lines);
+DECLARE_FLAG(bool, trace_cha);
 DECLARE_FLAG(bool, trace_field_guards);
 DECLARE_FLAG(bool, trace_type_check_elimination);
 DECLARE_FLAG(bool, warn_on_javascript_compatibility);
@@ -223,6 +224,12 @@
     ArgumentsDescriptor args_desc(args_desc_array);
     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 Function& function = Function::Handle(Z,
         Resolver::ResolveDynamicForReceiverClass(
             receiver_class,
@@ -387,7 +394,7 @@
         Token::kBIT_AND,
         new(Z) Value(left_instr),
         new(Z) Value(right_instr),
-        Isolate::kNoDeoptId);  // BIT_AND cannot deoptimize.
+        Thread::kNoDeoptId);  // BIT_AND cannot deoptimize.
     bit_and_instr->ReplaceWith(smi_op, current_iterator());
   }
 }
@@ -408,7 +415,7 @@
                                       new(Z) Value(index_instr),
                                       index_scale,
                                       cid,
-                                      Isolate::kNoDeoptId,
+                                      Thread::kNoDeoptId,
                                       instr->token_pos());
   instr->ReplaceUsesWith(load);
   flow_graph()->InsertAfter(instr, load, NULL, FlowGraph::kValue);
@@ -619,7 +626,7 @@
                                Definition* replacement) {
   if ((replacement->ssa_temp_index() == -1) &&
       (defn->ssa_temp_index() != -1)) {
-    replacement->set_ssa_temp_index(graph->alloc_ssa_temp_index());
+    graph->AllocateSSAIndexes(replacement);
   }
 }
 
@@ -636,16 +643,16 @@
     EnsureSSATempIndex(graph, current_defn, replacement_defn);
 
     if (FLAG_trace_optimization) {
-      ISL_Print("Replacing v%" Pd " with v%" Pd "\n",
+      THR_Print("Replacing v%" Pd " with v%" Pd "\n",
                 current_defn->ssa_temp_index(),
                 replacement_defn->ssa_temp_index());
     }
   } else if (FLAG_trace_optimization) {
     if (current_defn == NULL) {
-      ISL_Print("Removing %s\n", current->DebugName());
+      THR_Print("Removing %s\n", current->DebugName());
     } else {
       ASSERT(!current_defn->HasUses());
-      ISL_Print("Removing v%" Pd ".\n", current_defn->ssa_temp_index());
+      THR_Print("Removing v%" Pd ".\n", current_defn->ssa_temp_index());
     }
   }
   iterator->RemoveCurrentFromGraph();
@@ -706,7 +713,7 @@
   Definition* converted = NULL;
   if (IsUnboxedInteger(from) && IsUnboxedInteger(to)) {
     const intptr_t deopt_id = (to == kUnboxedInt32) && (deopt_target != NULL) ?
-      deopt_target->DeoptimizationTarget() : Isolate::kNoDeoptId;
+      deopt_target->DeoptimizationTarget() : Thread::kNoDeoptId;
     converted = new(Z) UnboxedIntConverterInstr(from,
                                                 to,
                                                 use->CopyWithType(),
@@ -717,12 +724,12 @@
              (to == kUnboxedDouble) &&
              CanConvertUnboxedMintToDouble()) {
     const intptr_t deopt_id = (deopt_target != NULL) ?
-      deopt_target->DeoptimizationTarget() : Isolate::kNoDeoptId;
+      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() : Isolate::kNoDeoptId;
+      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());
@@ -732,7 +739,7 @@
     // "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() : Isolate::kNoDeoptId;
+      deopt_target->DeoptimizationTarget() : Thread::kNoDeoptId;
     ASSERT(Boxing::Supports(from));
     ASSERT(Boxing::Supports(to));
     Definition* boxed = BoxInstr::Create(from, use->CopyWithType());
@@ -770,7 +777,7 @@
 void FlowGraphOptimizer::ConvertEnvironmentUse(Value* use,
                                                Representation from_rep) {
   const Representation to_rep = kTagged;
-  if (from_rep == to_rep || to_rep == kNoRepresentation) {
+  if (from_rep == to_rep) {
     return;
   }
   InsertConversion(from_rep, to_rep, use, /*is_environment_use=*/ true);
@@ -831,10 +838,10 @@
   if ((kSmiBits < 32) &&
       (unboxed == kTagged) &&
       phi->Type()->IsInt() &&
-      RangeUtils::Fits(phi->range(), RangeBoundary::kRangeBoundaryInt32)) {
+      RangeUtils::Fits(phi->range(), RangeBoundary::kRangeBoundaryInt64)) {
     // On 32-bit platforms conservatively unbox phis that:
     //   - are proven to be of type Int;
-    //   - fit into 32bits range;
+    //   - fit into 64bits range;
     //   - have either constants or Box() operations as inputs;
     //   - have at least one Box() operation as an input;
     //   - are used in at least 1 Unbox() operation.
@@ -843,7 +850,7 @@
       Definition* input = phi->InputAt(i)->definition();
       if (input->IsBox() &&
           RangeUtils::Fits(input->range(),
-                           RangeBoundary::kRangeBoundaryInt32)) {
+                           RangeBoundary::kRangeBoundaryInt64)) {
         should_unbox = true;
       } else if (!input->IsConstant()) {
         should_unbox = false;
@@ -875,7 +882,9 @@
     }
 
     if (should_unbox) {
-      unboxed = kUnboxedInt32;
+      unboxed =
+          RangeUtils::Fits(phi->range(), RangeBoundary::kRangeBoundaryInt32)
+          ? kUnboxedInt32 : kUnboxedMint;
     }
   }
 
@@ -1745,11 +1754,11 @@
                                      index,
                                      &cursor);
 
-  intptr_t deopt_id = Isolate::kNoDeoptId;
+  intptr_t deopt_id = Thread::kNoDeoptId;
   if ((array_cid == kTypedDataInt32ArrayCid) ||
       (array_cid == kTypedDataUint32ArrayCid)) {
     // Deoptimization may be needed if result does not always fit in a Smi.
-    deopt_id = (kSmiBits >= 32) ? Isolate::kNoDeoptId : call->deopt_id();
+    deopt_id = (kSmiBits >= 32) ? Thread::kNoDeoptId : call->deopt_id();
   }
 
   // Array load and return.
@@ -1763,14 +1772,14 @@
   cursor = flow_graph()->AppendTo(
       cursor,
       *last,
-      deopt_id != Isolate::kNoDeoptId ? call->env() : NULL,
+      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,
-                           deopt_id != Isolate::kNoDeoptId ? call->env() : NULL,
+                           deopt_id != Thread::kNoDeoptId ? call->env() : NULL,
                            FlowGraph::kValue);
   }
   return true;
@@ -2299,10 +2308,10 @@
 
 
 // Using field class
-static RawField* GetField(intptr_t class_id, const String& field_name) {
-  Isolate* isolate = Isolate::Current();
-  Class& cls = Class::Handle(isolate, isolate->class_table()->At(class_id));
-  Field& field = Field::Handle(isolate);
+RawField* FlowGraphOptimizer::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()) {
     field = cls.LookupInstanceField(field_name);
     if (!field.IsNull()) {
@@ -2335,6 +2344,11 @@
         : call->function_name();
     const Class& cls = Class::Handle(Z, function.Owner());
     if (!thread()->cha()->HasOverride(cls, name)) {
+      if (FLAG_trace_cha) {
+        THR_Print("  **(CHA) Instance call needs no check, "
+            "no overrides of '%s' '%s'\n",
+            name.ToCString(), cls.ToCString());
+      }
       thread()->cha()->AddToLeafClasses(cls);
       return false;
     }
@@ -2781,7 +2795,7 @@
       new(Z) Value(index),
       Instance::ElementSizeFor(cid),
       cid,
-      Isolate::kNoDeoptId,
+      Thread::kNoDeoptId,
       call->token_pos());
 
   cursor = flow_graph()->AppendTo(cursor,
@@ -3646,11 +3660,11 @@
                                            index,
                                            &cursor);
 
-  intptr_t deopt_id = Isolate::kNoDeoptId;
+  intptr_t deopt_id = Thread::kNoDeoptId;
   if ((array_cid == kTypedDataInt32ArrayCid) ||
       (array_cid == kTypedDataUint32ArrayCid)) {
     // Deoptimization may be needed if result does not always fit in a Smi.
-    deopt_id = (kSmiBits >= 32) ? Isolate::kNoDeoptId : call->deopt_id();
+    deopt_id = (kSmiBits >= 32) ? Thread::kNoDeoptId : call->deopt_id();
   }
 
   *last = new(Z) LoadIndexedInstr(new(Z) Value(array),
@@ -3662,14 +3676,14 @@
   cursor = flow_graph()->AppendTo(
       cursor,
       *last,
-      deopt_id != Isolate::kNoDeoptId ? call->env() : NULL,
+      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,
-                           deopt_id != Isolate::kNoDeoptId ? call->env() : NULL,
+                           deopt_id != Thread::kNoDeoptId ? call->env() : NULL,
                            FlowGraph::kValue);
   }
   return true;
@@ -3722,7 +3736,7 @@
       value_check = ICData::New(flow_graph_->function(),
                                 i_call->function_name(),
                                 Object::empty_array(),  // Dummy args. descr.
-                                Isolate::kNoDeoptId,
+                                Thread::kNoDeoptId,
                                 1);
       value_check.AddReceiverCheck(kSmiCid, target);
       break;
@@ -3734,7 +3748,7 @@
         value_check = ICData::New(flow_graph_->function(),
                                   i_call->function_name(),
                                   Object::empty_array(),  // Dummy args. descr.
-                                  Isolate::kNoDeoptId,
+                                  Thread::kNoDeoptId,
                                   1);
         value_check.AddReceiverCheck(kSmiCid, target);
       }
@@ -3745,7 +3759,7 @@
       value_check = ICData::New(flow_graph_->function(),
                                 i_call->function_name(),
                                 Object::empty_array(),  // Dummy args. descr.
-                                Isolate::kNoDeoptId,
+                                Thread::kNoDeoptId,
                                 1);
       value_check.AddReceiverCheck(kDoubleCid, target);
       break;
@@ -3755,7 +3769,7 @@
       value_check = ICData::New(flow_graph_->function(),
                                 i_call->function_name(),
                                 Object::empty_array(),  // Dummy args. descr.
-                                Isolate::kNoDeoptId,
+                                Thread::kNoDeoptId,
                                 1);
       value_check.AddReceiverCheck(kInt32x4Cid, target);
       break;
@@ -3765,7 +3779,7 @@
       value_check = ICData::New(flow_graph_->function(),
                                 i_call->function_name(),
                                 Object::empty_array(),  // Dummy args. descr.
-                                Isolate::kNoDeoptId,
+                                Thread::kNoDeoptId,
                                 1);
       value_check.AddReceiverCheck(kFloat32x4Cid, target);
       break;
@@ -3820,7 +3834,7 @@
 
   flow_graph()->AppendTo(cursor,
                          *last,
-                         call->deopt_id() != Isolate::kNoDeoptId ?
+                         call->deopt_id() != Thread::kNoDeoptId ?
                             call->env() : NULL,
                          FlowGraph::kEffect);
   return true;
@@ -3996,7 +4010,8 @@
         TypeArguments::Handle(Z),
         type_class,
         TypeArguments::Handle(Z),
-        NULL);
+        NULL,
+        Heap::kOld);
     results->Add(cls.id());
     results->Add(is_subtype);
     if (prev.IsNull()) {
@@ -4029,6 +4044,11 @@
   // Private classes cannot be subclassed by later loaded libs.
   if (!type_class.IsPrivate()) {
     if (FLAG_use_cha_deopt) {
+      if (FLAG_trace_cha) {
+        THR_Print("  **(CHA) Typecheck as class equality since no "
+            "subclasses: %s\n",
+            type_class.ToCString());
+      }
       thread()->cha()->AddToLeafClasses(type_class);
     } else {
       return false;
@@ -4082,7 +4102,8 @@
     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) {
@@ -4169,7 +4190,7 @@
             negate ? Token::kISNOT : Token::kIS,
             new(Z) Value(left),
             *results,
-            can_deopt ? call->deopt_id() : Isolate::kNoDeoptId);
+            can_deopt ? call->deopt_id() : Thread::kNoDeoptId);
         // Remove type.
         ReplaceCall(call, test_cids);
         return;
@@ -4609,7 +4630,7 @@
     }
     if (!unboxed_field) {
       if (FLAG_trace_optimization || FLAG_trace_field_guards) {
-        ISL_Print("Disabling unboxing of %s\n", field.ToCString());
+        THR_Print("Disabling unboxing of %s\n", field.ToCString());
         if (!setter.IsNull()) {
           OS::Print("  setter usage count: %" Pd "\n", setter.usage_counter());
         }
@@ -4838,7 +4859,7 @@
     }
 
     if (FLAG_trace_smi_widening) {
-      ISL_Print("analysing candidate: %s\n", op->ToCString());
+      THR_Print("analysing candidate: %s\n", op->ToCString());
     }
     worklist.Clear();
     worklist.Add(op);
@@ -4850,14 +4871,14 @@
       Definition* defn = worklist.definitions()[j];
 
       if (FLAG_trace_smi_widening) {
-        ISL_Print("> %s\n", defn->ToCString());
+        THR_Print("> %s\n", defn->ToCString());
       }
 
       if (defn->IsBinarySmiOp() &&
           BenefitsFromWidening(defn->AsBinarySmiOp())) {
         gain++;
         if (FLAG_trace_smi_widening) {
-          ISL_Print("^ [%" Pd "] (o) %s\n", gain, defn->ToCString());
+          THR_Print("^ [%" Pd "] (o) %s\n", gain, defn->ToCString());
         }
       }
 
@@ -4875,7 +4896,7 @@
           // Mint operation produces untagged result. We avoid tagging.
           gain++;
           if (FLAG_trace_smi_widening) {
-            ISL_Print("^ [%" Pd "] (i) %s\n", gain, input->ToCString());
+            THR_Print("^ [%" Pd "] (i) %s\n", gain, input->ToCString());
           }
         } else if (defn_loop == loops[input->GetBlock()->preorder_number()] &&
                    (input->Type()->ToCid() == kSmiCid)) {
@@ -4886,7 +4907,7 @@
           // coalesced with untagging. Start coalescing them.
           gain--;
           if (FLAG_trace_smi_widening) {
-            ISL_Print("v [%" Pd "] (i) %s\n", gain, input->ToCString());
+            THR_Print("v [%" Pd "] (i) %s\n", gain, input->ToCString());
           }
         }
       }
@@ -4903,7 +4924,7 @@
           if (!instr->IsReturn() && !instr->IsPushArgument()) {
             gain--;
             if (FLAG_trace_smi_widening) {
-              ISL_Print("v [%" Pd "] (u) %s\n",
+              THR_Print("v [%" Pd "] (u) %s\n",
                         gain,
                         use->instruction()->ToCString());
             }
@@ -4921,14 +4942,14 @@
           // sign extension operation.
           gain++;
           if (FLAG_trace_smi_widening) {
-            ISL_Print("^ [%" Pd "] (u) %s\n",
+            THR_Print("^ [%" Pd "] (u) %s\n",
                       gain,
                       use->instruction()->ToCString());
           }
         } else if (defn_loop == loops[instr->GetBlock()->preorder_number()]) {
           gain--;
           if (FLAG_trace_smi_widening) {
-            ISL_Print("v [%" Pd "] (u) %s\n",
+            THR_Print("v [%" Pd "] (u) %s\n",
                       gain,
                       use->instruction()->ToCString());
           }
@@ -4939,7 +4960,7 @@
     processed->AddAll(worklist.contains_vector());
 
     if (FLAG_trace_smi_widening) {
-      ISL_Print("~ %s gain %" Pd "\n", op->ToCString(), gain);
+      THR_Print("~ %s gain %" Pd "\n", op->ToCString(), gain);
     }
 
     if (gain > 0) {
@@ -5067,7 +5088,7 @@
     current->AsCheckArrayBound()->set_licm_hoisted(true);
   }
   if (FLAG_trace_optimization) {
-    ISL_Print("Hoisting instruction %s:%" Pd " from B%" Pd " to B%" Pd "\n",
+    THR_Print("Hoisting instruction %s:%" Pd " from B%" Pd " to B%" Pd "\n",
               current->DebugName(),
               current->GetDeoptId(),
               current->GetBlock()->block_id(),
@@ -5884,9 +5905,9 @@
          !it.Done();
          it.Advance()) {
       if (comma) {
-        ISL_Print(", ");
+        THR_Print(", ");
       }
-      ISL_Print("%s", places_[it.Current()]->ToCString());
+      THR_Print("%s", places_[it.Current()]->ToCString());
       comma = true;
     }
   }
@@ -5981,16 +6002,16 @@
     }
 
     if (FLAG_trace_load_optimization) {
-      ISL_Print("Aliases KILL sets:\n");
+      THR_Print("Aliases KILL sets:\n");
       for (intptr_t i = 0; i < aliases_.length(); ++i) {
         const Place* alias = aliases_[i];
         BitVector* kill = GetKilledSet(alias->id());
 
-        ISL_Print("%s: ", alias->ToCString());
+        THR_Print("%s: ", alias->ToCString());
         if (kill != NULL) {
           PrintSet(kill);
         }
-        ISL_Print("\n");
+        THR_Print("\n");
       }
     }
   }
@@ -6377,7 +6398,7 @@
       BlockEntryInstr* block = phi->GetBlock();
 
       if (FLAG_trace_optimization) {
-        ISL_Print("phi dependent place %s\n", place->ToCString());
+        THR_Print("phi dependent place %s\n", place->ToCString());
       }
 
       Place input_place(*place);
@@ -6390,7 +6411,7 @@
           map->Insert(result);
           places->Add(result);
           if (FLAG_trace_optimization) {
-            ISL_Print("  adding place %s as %" Pd "\n",
+            THR_Print("  adding place %s as %" Pd "\n",
                       result->ToCString(),
                       result->id());
           }
@@ -6446,7 +6467,7 @@
         places->Add(result);
 
         if (FLAG_trace_optimization) {
-          ISL_Print("numbering %s as %" Pd "\n",
+          THR_Print("numbering %s as %" Pd "\n",
                     result->ToCString(),
                     result->id());
         }
@@ -6715,7 +6736,7 @@
           Definition* replacement = (*out_values)[place_id];
           EnsureSSATempIndex(graph_, defn, replacement);
           if (FLAG_trace_optimization) {
-            ISL_Print("Replacing load v%" Pd " with v%" Pd "\n",
+            THR_Print("Replacing load v%" Pd " with v%" Pd "\n",
                       defn->ssa_temp_index(),
                       replacement->ssa_temp_index());
           }
@@ -6923,18 +6944,18 @@
       }
 
       if (FLAG_trace_load_optimization) {
-        ISL_Print("B%" Pd "\n", block->block_id());
-        ISL_Print("  IN: ");
+        THR_Print("B%" Pd "\n", block->block_id());
+        THR_Print("  IN: ");
         aliased_set_->PrintSet(in_[preorder_number]);
-        ISL_Print("\n");
+        THR_Print("\n");
 
-        ISL_Print("  KILL: ");
+        THR_Print("  KILL: ");
         aliased_set_->PrintSet(kill_[preorder_number]);
-        ISL_Print("\n");
+        THR_Print("\n");
 
-        ISL_Print("  OUT: ");
+        THR_Print("  OUT: ");
         aliased_set_->PrintSet(out_[preorder_number]);
-        ISL_Print("\n");
+        THR_Print("\n");
       }
     }
 
@@ -6987,7 +7008,7 @@
 
       if (FLAG_trace_optimization) {
         for (BitVector::Iterator it(loop_gen); !it.Done(); it.Advance()) {
-          ISL_Print("place %s is loop invariant for B%" Pd "\n",
+          THR_Print("place %s is loop invariant for B%" Pd "\n",
                     aliased_set_->places()[it.Current()]->ToCString(),
                     header->block_id());
         }
@@ -7054,11 +7075,11 @@
       replacement->AddInputUse(input);
     }
 
-    phi->set_ssa_temp_index(graph_->alloc_ssa_temp_index());
+    graph_->AllocateSSAIndexes(phi);
     phis_.Add(phi);  // Postpone phi insertion until after load forwarding.
 
     if (FLAG_trace_load_optimization) {
-      ISL_Print("created pending phi %s for %s at B%" Pd "\n",
+      THR_Print("created pending phi %s for %s at B%" Pd "\n",
                 phi->ToCString(),
                 aliased_set_->places()[place_id]->ToCString(),
                 block->block_id());
@@ -7097,7 +7118,7 @@
           EnsureSSATempIndex(graph_, load, replacement);
 
           if (FLAG_trace_optimization) {
-            ISL_Print("Replacing load v%" Pd " with v%" Pd "\n",
+            THR_Print("Replacing load v%" Pd " with v%" Pd "\n",
                       load->ssa_temp_index(),
                       replacement->ssa_temp_index());
           }
@@ -7286,7 +7307,7 @@
       }
 
       if (FLAG_trace_load_optimization) {
-        ISL_Print("Replacing %s with congruent %s\n",
+        THR_Print("Replacing %s with congruent %s\n",
                   a->ToCString(),
                   b->ToCString());
       }
@@ -7492,7 +7513,7 @@
             if (!live_in->Contains(instr->place_id()) &&
                 CanEliminateStore(instr)) {
               if (FLAG_trace_optimization) {
-                ISL_Print(
+                THR_Print(
                     "Removing dead store to place %" Pd " in block B%" Pd "\n",
                     instr->place_id(), block->block_id());
               }
@@ -7545,7 +7566,7 @@
     }
     if (FLAG_trace_load_optimization) {
       Dump();
-      ISL_Print("---\n");
+      THR_Print("---\n");
     }
   }
 
@@ -7579,7 +7600,7 @@
         if (!live_out->Contains(instr->place_id()) &&
             CanEliminateStore(instr)) {
           if (FLAG_trace_optimization) {
-            ISL_Print("Removing dead store to place %" Pd " block B%" Pd "\n",
+            THR_Print("Removing dead store to place %" Pd " block B%" Pd "\n",
                       instr->place_id(), block->block_id());
           }
           instr->RemoveFromGraph(/* ignored */ false);
@@ -7673,14 +7694,14 @@
             phi->UnuseAllInputs();
             (*join->phis_)[i] = NULL;
             if (FLAG_trace_optimization) {
-              ISL_Print("Removing dead phi v%" Pd "\n", phi->ssa_temp_index());
+              THR_Print("Removing dead phi v%" Pd "\n", phi->ssa_temp_index());
             }
           } else if (phi->IsRedundant()) {
             phi->ReplaceUsesWith(phi->InputAt(0)->definition());
             phi->UnuseAllInputs();
             (*join->phis_)[i] = NULL;
             if (FLAG_trace_optimization) {
-              ISL_Print("Removing redundant phi v%" Pd "\n",
+              THR_Print("Removing redundant phi v%" Pd "\n",
                          phi->ssa_temp_index());
             }
           } else {
@@ -8223,7 +8244,7 @@
        use = use->next_use()) {
     if (!IsSafeUse(use, check_type)) {
       if (FLAG_trace_optimization) {
-        ISL_Print("use of %s at %s is unsafe for allocation sinking\n",
+        THR_Print("use of %s at %s is unsafe for allocation sinking\n",
                   alloc->ToCString(),
                   use->instruction()->ToCString());
       }
@@ -8253,7 +8274,7 @@
   ASSERT(IsAllocationSinkingCandidate(alloc, kStrictCheck));
 
   if (FLAG_trace_optimization) {
-    ISL_Print("removing allocation from the graph: v%" Pd "\n",
+    THR_Print("removing allocation from the graph: v%" Pd "\n",
               alloc->ssa_temp_index());
   }
 
@@ -8334,7 +8355,7 @@
     Definition* alloc = candidates_[i];
     if (alloc->Identity().IsAllocationSinkingCandidate()) {
       if (FLAG_trace_optimization) {
-        ISL_Print("discovered allocation sinking candidate: v%" Pd "\n",
+        THR_Print("discovered allocation sinking candidate: v%" Pd "\n",
                   alloc->ssa_temp_index());
       }
 
@@ -8429,7 +8450,7 @@
     Definition* alloc = candidates_[i];
     if (!alloc->Identity().IsAllocationSinkingCandidate()) {
       if (FLAG_trace_optimization) {
-        ISL_Print("allocation v%" Pd " can't be eliminated\n",
+        THR_Print("allocation v%" Pd " can't be eliminated\n",
                   alloc->ssa_temp_index());
       }
 
diff --git a/runtime/vm/flow_graph_optimizer.h b/runtime/vm/flow_graph_optimizer.h
index 0df970b..d0ae717 100644
--- a/runtime/vm/flow_graph_optimizer.h
+++ b/runtime/vm/flow_graph_optimizer.h
@@ -260,6 +260,8 @@
 
   void InstanceCallNoopt(InstanceCallInstr* instr);
 
+  RawField* GetField(intptr_t class_id, const String& field_name);
+
   Thread* thread() const { return flow_graph_->thread(); }
   Isolate* isolate() const { return flow_graph_->isolate(); }
   Zone* zone() const { return flow_graph_->zone(); }
diff --git a/runtime/vm/flow_graph_range_analysis.cc b/runtime/vm/flow_graph_range_analysis.cc
index cd45479..35a7a5d 100644
--- a/runtime/vm/flow_graph_range_analysis.cc
+++ b/runtime/vm/flow_graph_range_analysis.cc
@@ -184,7 +184,7 @@
         InductionVariableInfo* info = DetectSimpleInductionVariable(current);
         if (info != NULL) {
           if (FLAG_trace_range_analysis) {
-            ISL_Print("Simple loop variable: %s bound <%s>\n",
+            THR_Print("Simple loop variable: %s bound <%s>\n",
                        current->ToCString(),
                        info->limit() != NULL ?
                            info->limit()->ToCString() : "?");
@@ -694,7 +694,7 @@
 
     if (!range.Equals(defn->range())) {
       if (FLAG_trace_range_analysis) {
-        ISL_Print("%c [%" Pd "] %s:  %s => %s\n",
+        THR_Print("%c [%" Pd "] %s:  %s => %s\n",
                   OpPrefix(op),
                   iteration,
                   defn->ToCString(),
@@ -997,7 +997,7 @@
     if (upper_bound == UnwrapConstraint(check->index()->definition())) {
       // Unable to construct upper bound for the index.
       if (FLAG_trace_range_analysis) {
-        ISL_Print("Failed to construct upper bound for %s index\n",
+        THR_Print("Failed to construct upper bound for %s index\n",
                   check->ToCString());
       }
       return;
@@ -1008,7 +1008,7 @@
     // upper bound through scheduler.
     if (!Simplify(&upper_bound, NULL)) {
       if (FLAG_trace_range_analysis) {
-        ISL_Print("Failed to simplify upper bound for %s index\n",
+        THR_Print("Failed to simplify upper bound for %s index\n",
                   check->ToCString());
       }
       return;
@@ -1023,7 +1023,7 @@
     GrowableArray<Definition*> non_positive_symbols;
     if (!FindNonPositiveSymbols(&non_positive_symbols, upper_bound)) {
       if (FLAG_trace_range_analysis) {
-        ISL_Print("Failed to generalize %s index to %s"
+        THR_Print("Failed to generalize %s index to %s"
                   " (can't ensure positivity)\n",
                   check->ToCString(),
                   IndexBoundToCString(upper_bound));
@@ -1057,7 +1057,7 @@
       // Can't prove that lower bound is positive even with additional checks
       // against potentially non-positive symbols. Give up.
       if (FLAG_trace_range_analysis) {
-        ISL_Print("Failed to generalize %s index to %s"
+        THR_Print("Failed to generalize %s index to %s"
                   " (lower bound is not positive)\n",
                   check->ToCString(),
                   IndexBoundToCString(upper_bound));
@@ -1066,7 +1066,7 @@
     }
 
     if (FLAG_trace_range_analysis) {
-      ISL_Print("For %s computed index bounds [%s, %s]\n",
+      THR_Print("For %s computed index bounds [%s, %s]\n",
                 check->ToCString(),
                 IndexBoundToCString(lower_bound),
                 IndexBoundToCString(upper_bound));
@@ -1082,12 +1082,12 @@
       CheckArrayBoundInstr* precondition = new CheckArrayBoundInstr(
           new Value(max_smi),
           new Value(non_positive_symbols[i]),
-          Isolate::kNoDeoptId);
+          Thread::kNoDeoptId);
       precondition->mark_generalized();
       precondition = scheduler_.Emit(precondition, check);
       if (precondition == NULL) {
         if (FLAG_trace_range_analysis) {
-          ISL_Print("  => failed to insert positivity constraint\n");
+          THR_Print("  => failed to insert positivity constraint\n");
         }
         scheduler_.Rollback();
         return;
@@ -1097,11 +1097,11 @@
     CheckArrayBoundInstr* new_check = new CheckArrayBoundInstr(
           new Value(UnwrapConstraint(check->length()->definition())),
           new Value(upper_bound),
-          Isolate::kNoDeoptId);
+          Thread::kNoDeoptId);
     new_check->mark_generalized();
     if (new_check->IsRedundant(array_length)) {
       if (FLAG_trace_range_analysis) {
-        ISL_Print("  => generalized check is redundant\n");
+        THR_Print("  => generalized check is redundant\n");
       }
       RemoveGeneralizedCheck(check);
       return;
@@ -1110,13 +1110,13 @@
     new_check = scheduler_.Emit(new_check, check);
     if (new_check != NULL) {
       if (FLAG_trace_range_analysis) {
-        ISL_Print("  => generalized check was hoisted into B%" Pd "\n",
+        THR_Print("  => generalized check was hoisted into B%" Pd "\n",
                   new_check->GetBlock()->block_id());
       }
       RemoveGeneralizedCheck(check);
     } else {
       if (FLAG_trace_range_analysis) {
-        ISL_Print("  => generalized check can't be hoisted\n");
+        THR_Print("  => generalized check can't be hoisted\n");
       }
       scheduler_.Rollback();
     }
@@ -1138,7 +1138,7 @@
     return new BinarySmiOpInstr(op_kind,
                                 new Value(left),
                                 new Value(right),
-                                Isolate::kNoDeoptId);
+                                Thread::kNoDeoptId);
   }
 
 
@@ -1566,7 +1566,7 @@
       if (target == branch->true_successor()) {
         // True unreachable.
         if (FLAG_trace_constant_propagation) {
-          ISL_Print("Range analysis: True unreachable (B%" Pd ")\n",
+          THR_Print("Range analysis: True unreachable (B%" Pd ")\n",
                     branch->true_successor()->block_id());
         }
         branch->set_constant_target(branch->false_successor());
@@ -1574,7 +1574,7 @@
         ASSERT(target == branch->false_successor());
         // False unreachable.
         if (FLAG_trace_constant_propagation) {
-          ISL_Print("Range analysis: False unreachable (B%" Pd ")\n",
+          THR_Print("Range analysis: False unreachable (B%" Pd ")\n",
                     branch->false_successor()->block_id());
         }
         branch->set_constant_target(branch->true_successor());
@@ -1662,14 +1662,14 @@
 
 void IntegerInstructionSelector::Select() {
   if (FLAG_trace_integer_ir_selection) {
-    ISL_Print("---- starting integer ir selection -------\n");
+    THR_Print("---- starting integer ir selection -------\n");
   }
   FindPotentialUint32Definitions();
   FindUint32NarrowingDefinitions();
   Propagate();
   ReplaceInstructions();
   if (FLAG_trace_integer_ir_selection) {
-    ISL_Print("---- after integer ir selection -------\n");
+    THR_Print("---- after integer ir selection -------\n");
     FlowGraphPrinter printer(*flow_graph_);
     printer.PrintBlocks();
   }
@@ -1690,7 +1690,7 @@
 
 void IntegerInstructionSelector::FindPotentialUint32Definitions() {
   if (FLAG_trace_integer_ir_selection) {
-    ISL_Print("++++ Finding potential Uint32 definitions:\n");
+    THR_Print("++++ Finding potential Uint32 definitions:\n");
   }
 
   for (BlockIterator block_it = flow_graph_->reverse_postorder_iterator();
@@ -1706,7 +1706,7 @@
       if ((defn != NULL) && defn->HasSSATemp()) {
         if (IsPotentialUint32Definition(defn)) {
           if (FLAG_trace_integer_ir_selection) {
-           ISL_Print("Adding %s\n", current->ToCString());
+           THR_Print("Adding %s\n", current->ToCString());
           }
           potential_uint32_defs_.Add(defn);
         }
@@ -1740,14 +1740,14 @@
 void IntegerInstructionSelector::FindUint32NarrowingDefinitions() {
   ASSERT(selected_uint32_defs_ != NULL);
   if (FLAG_trace_integer_ir_selection) {
-    ISL_Print("++++ Selecting Uint32 definitions:\n");
-    ISL_Print("++++ Initial set:\n");
+    THR_Print("++++ Selecting Uint32 definitions:\n");
+    THR_Print("++++ Initial set:\n");
   }
   for (intptr_t i = 0; i < potential_uint32_defs_.length(); i++) {
     Definition* defn = potential_uint32_defs_[i];
     if (IsUint32NarrowingDefinition(defn)) {
       if (FLAG_trace_integer_ir_selection) {
-        ISL_Print("Adding %s\n", defn->ToCString());
+        THR_Print("Adding %s\n", defn->ToCString());
       }
       selected_uint32_defs_->Add(defn->ssa_temp_index());
     }
@@ -1807,7 +1807,7 @@
   intptr_t iteration = 0;
   while (changed) {
     if (FLAG_trace_integer_ir_selection) {
-      ISL_Print("+++ Iteration: %" Pd "\n", iteration++);
+      THR_Print("+++ Iteration: %" Pd "\n", iteration++);
     }
     changed = false;
     for (intptr_t i = 0; i < potential_uint32_defs_.length(); i++) {
@@ -1822,7 +1822,7 @@
       }
       if (CanBecomeUint32(defn)) {
         if (FLAG_trace_integer_ir_selection) {
-          ISL_Print("Adding %s\n", defn->ToCString());
+          THR_Print("Adding %s\n", defn->ToCString());
         }
         // Found a new candidate.
         selected_uint32_defs_->Add(defn->ssa_temp_index());
@@ -1832,7 +1832,7 @@
     }
   }
   if (FLAG_trace_integer_ir_selection) {
-    ISL_Print("Reached fixed point\n");
+    THR_Print("Reached fixed point\n");
   }
 }
 
@@ -1879,7 +1879,7 @@
 
 void IntegerInstructionSelector::ReplaceInstructions() {
   if (FLAG_trace_integer_ir_selection) {
-    ISL_Print("++++ Replacing instructions:\n");
+    THR_Print("++++ Replacing instructions:\n");
   }
   for (intptr_t i = 0; i < potential_uint32_defs_.length(); i++) {
     Definition* defn = potential_uint32_defs_[i];
@@ -1890,7 +1890,7 @@
     Definition* replacement = ConstructReplacementFor(defn);
     ASSERT(replacement != NULL);
     if (FLAG_trace_integer_ir_selection) {
-      ISL_Print("Replacing %s with %s\n", defn->ToCString(),
+      THR_Print("Replacing %s with %s\n", defn->ToCString(),
                                           replacement->ToCString());
     }
     if (!Range::IsUnknown(defn->range())) {
diff --git a/runtime/vm/flow_graph_type_propagator.cc b/runtime/vm/flow_graph_type_propagator.cc
index 6fcd874..3448fd0 100644
--- a/runtime/vm/flow_graph_type_propagator.cc
+++ b/runtime/vm/flow_graph_type_propagator.cc
@@ -15,6 +15,7 @@
             "Trace flow graph type propagation");
 
 DECLARE_FLAG(bool, propagate_types);
+DECLARE_FLAG(bool, trace_cha);
 DECLARE_FLAG(bool, use_cha_deopt);
 
 
@@ -73,13 +74,13 @@
   while (!worklist_.is_empty()) {
     Definition* def = RemoveLastFromWorklist();
     if (FLAG_trace_type_propagation) {
-      ISL_Print("recomputing type of v%" Pd ": %s\n",
+      THR_Print("recomputing type of v%" Pd ": %s\n",
                 def->ssa_temp_index(),
                 def->Type()->ToCString());
     }
     if (def->RecomputeType()) {
       if (FLAG_trace_type_propagation) {
-        ISL_Print("  ... new type %s\n", def->Type()->ToCString());
+        THR_Print("  ... new type %s\n", def->Type()->ToCString());
       }
       for (Value::Iterator it(def->input_use_list());
            !it.Done();
@@ -266,7 +267,7 @@
   value->SetReachingType(type);
 
   if (FLAG_trace_type_propagation) {
-    ISL_Print("reaching type to v%" Pd " for v%" Pd " is %s\n",
+    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(),
@@ -461,9 +462,10 @@
 
   const AbstractType* compile_type = ToAbstractType();
   const AbstractType* other_compile_type = other->ToAbstractType();
-  if (compile_type->IsMoreSpecificThan(*other_compile_type, NULL)) {
+  if (compile_type->IsMoreSpecificThan(*other_compile_type, NULL, Heap::kOld)) {
     type_ = other_compile_type;
-  } else if (other_compile_type->IsMoreSpecificThan(*compile_type, NULL)) {
+  } else if (other_compile_type->
+      IsMoreSpecificThan(*compile_type, NULL, Heap::kOld)) {
   // Nothing to do.
   } else {
   // Can't unify.
@@ -549,6 +551,10 @@
           // Type of a private class cannot change through later loaded libs.
           cid_ = type_class.id();
         } else if (FLAG_use_cha_deopt) {
+          if (FLAG_trace_cha) {
+            THR_Print("  **(CHA) Compile type not subclassed: %s\n",
+                type_class.ToCString());
+          }
           cha->AddToLeafClasses(type_class);
           cid_ = type_class.id();
         } else {
@@ -654,7 +660,7 @@
     return false;
   }
 
-  *is_instance = compile_type.IsMoreSpecificThan(type, NULL);
+  *is_instance = compile_type.IsMoreSpecificThan(type, NULL, Heap::kOld);
   return *is_instance;
 }
 
@@ -669,7 +675,7 @@
     return IsNull();
   }
 
-  return ToAbstractType()->IsMoreSpecificThan(other, NULL);
+  return ToAbstractType()->IsMoreSpecificThan(other, NULL, Heap::kOld);
 }
 
 
@@ -692,7 +698,7 @@
   CompileType result = CompileType::None();
   for (intptr_t i = 0; i < InputCount(); i++) {
     if (FLAG_trace_type_propagation) {
-      ISL_Print("  phi %" Pd " input %" Pd ": v%" Pd " has reaching type %s\n",
+      THR_Print("  phi %" Pd " input %" Pd ": v%" Pd " has reaching type %s\n",
                 ssa_temp_index(),
                 i,
                 InputAt(i)->definition()->ssa_temp_index(),
@@ -748,8 +754,10 @@
     // Set parameter types here in order to prevent unnecessary CheckClassInstr
     // from being generated.
     switch (index()) {
+      case RegExpMacroAssembler::kParamRegExpIndex:
+        return CompileType::FromCid(kJSRegExpCid);
       case RegExpMacroAssembler::kParamStringIndex:
-        return CompileType::FromCid(function.regexp_cid());
+        return CompileType::FromCid(function.string_specialization_cid());
       case RegExpMacroAssembler::kParamStartOffsetIndex:
         return CompileType::FromCid(kSmiCid);
       default: UNREACHABLE();
@@ -786,6 +794,11 @@
           cid = type_class.id();
         } else {
           if (FLAG_use_cha_deopt) {
+            if (FLAG_trace_cha) {
+              THR_Print("  **(CHA) Computing exact type of parameters, "
+                  "no subclasses: %s\n",
+                  type_class.ToCString());
+            }
             thread->cha()->AddToLeafClasses(type_class);
             cid = type_class.id();
           }
@@ -986,7 +999,7 @@
   }
   ASSERT(field.is_static());
   if (field.is_final()) {
-    const Instance& obj = Instance::Handle(field.value());
+    const Instance& obj = Instance::Handle(field.StaticValue());
     if ((obj.raw() != Object::sentinel().raw()) &&
         (obj.raw() != Object::transition_sentinel().raw()) &&
         !obj.IsNull()) {
diff --git a/runtime/vm/gc_marker.cc b/runtime/vm/gc_marker.cc
index 12ad8c4..2e63be3 100644
--- a/runtime/vm/gc_marker.cc
+++ b/runtime/vm/gc_marker.cc
@@ -15,111 +15,19 @@
 #include "vm/pages.h"
 #include "vm/raw_object.h"
 #include "vm/stack_frame.h"
+#include "vm/store_buffer.h"
+#include "vm/thread_barrier.h"
 #include "vm/thread_pool.h"
 #include "vm/visitor.h"
 #include "vm/object_id_ring.h"
 
 namespace dart {
 
-// A simple chunked marking stack.
-class MarkingStack : public ValueObject {
- public:
-  MarkingStack()
-      : head_(new MarkingStackChunk()),
-        empty_chunks_(NULL),
-        marking_stack_(NULL),
-        top_(0) {
-    marking_stack_ = head_->MarkingStackChunkMemory();
-  }
-
-  ~MarkingStack() {
-    // TODO(iposva): Consider caching a couple emtpy marking stack chunks.
-    ASSERT(IsEmpty());
-    delete head_;
-    MarkingStackChunk* next;
-    while (empty_chunks_ != NULL) {
-      next = empty_chunks_->next();
-      delete empty_chunks_;
-      empty_chunks_ = next;
-    }
-  }
-
-  bool IsEmpty() const {
-    return IsMarkingStackChunkEmpty() && (head_->next() == NULL);
-  }
-
-  void Push(RawObject* value) {
-    ASSERT(!IsMarkingStackChunkFull());
-    marking_stack_[top_] = value;
-    top_++;
-    if (IsMarkingStackChunkFull()) {
-      MarkingStackChunk* new_chunk;
-      if (empty_chunks_ == NULL) {
-        new_chunk = new MarkingStackChunk();
-      } else {
-        new_chunk = empty_chunks_;
-        empty_chunks_ = new_chunk->next();
-      }
-      new_chunk->set_next(head_);
-      head_ = new_chunk;
-      marking_stack_ = head_->MarkingStackChunkMemory();
-      top_ = 0;
-    }
-  }
-
-  RawObject* Pop() {
-    ASSERT(head_ != NULL);
-    ASSERT(!IsEmpty());
-    if (IsMarkingStackChunkEmpty()) {
-      MarkingStackChunk* empty_chunk = head_;
-      head_ = head_->next();
-      empty_chunk->set_next(empty_chunks_);
-      empty_chunks_ = empty_chunk;
-      marking_stack_ = head_->MarkingStackChunkMemory();
-      top_ = MarkingStackChunk::kMarkingStackChunkSize;
-    }
-    top_--;
-    return marking_stack_[top_];
-  }
-
- private:
-  class MarkingStackChunk {
-   public:
-    MarkingStackChunk() : next_(NULL) {}
-    ~MarkingStackChunk() {}
-
-    RawObject** MarkingStackChunkMemory() {
-      return &memory_[0];
-    }
-
-    MarkingStackChunk* next() const { return next_; }
-    void set_next(MarkingStackChunk* value) { next_ = value; }
-
-    static const uint32_t kMarkingStackChunkSize = 1024;
-
-   private:
-    RawObject* memory_[kMarkingStackChunkSize];
-    MarkingStackChunk* next_;
-
-    DISALLOW_COPY_AND_ASSIGN(MarkingStackChunk);
-  };
-
-  bool IsMarkingStackChunkFull() const {
-    return top_ == MarkingStackChunk::kMarkingStackChunkSize;
-  }
-
-  bool IsMarkingStackChunkEmpty() const {
-    return top_ == 0;
-  }
-
-  MarkingStackChunk* head_;
-  MarkingStackChunk* empty_chunks_;
-  RawObject** marking_stack_;
-  uint32_t top_;
-
-  DISALLOW_COPY_AND_ASSIGN(MarkingStack);
-};
-
+DEFINE_FLAG(int, marker_tasks, 2,
+            "The number of tasks to spawn during old gen GC marking (0 means "
+            "perform all marking on main thread).");
+DEFINE_FLAG(bool, log_marker_tasks, false,
+            "Log debugging information for old gen GC marking tasks.");
 
 class DelaySet {
  private:
@@ -130,24 +38,33 @@
   DelaySet() : mutex_(new Mutex()) {}
   ~DelaySet() { delete mutex_; }
 
-  // Returns 'true' if this inserted a new key (not just added a value).
-  bool Insert(RawWeakProperty* raw_weak) {
+  // After atomically setting the watched bit on a white key (see
+  // EnsureWatchedIfWhitewhich; this means the mark bit cannot be set
+  // without observing the watched bit), this method atomically
+  // inserts raw_weak if its key is *still* white, so that any future
+  // call to VisitValuesForKey is guaranteed to include its
+  // value. Returns true on success, and false if the key is no longer white.
+  bool InsertIfWhite(RawWeakProperty* raw_weak) {
     MutexLocker ml(mutex_);
     RawObject* raw_key = raw_weak->ptr()->key_;
-    bool new_key = (delay_set_.find(raw_key) == delay_set_.end());
+    if (raw_key->IsMarked()) return false;
+    // The key was white *after* acquiring the lock. Thus any future call to
+    // VisitValuesForKey is guaranteed to include the entry inserted below.
     delay_set_.insert(std::make_pair(raw_key, raw_weak));
-    return new_key;
+    return true;
   }
 
   void ClearReferences() {
     MutexLocker ml(mutex_);
     for (Map::iterator it = delay_set_.begin(); it != delay_set_.end(); ++it) {
+      ASSERT(!it->first->IsMarked());
       WeakProperty::Clear(it->second);
     }
   }
 
-  // Visit all values with a key equal to raw_obj.
+  // Visit all values with a key equal to raw_obj, which must already be marked.
   void VisitValuesForKey(RawObject* raw_obj, ObjectPointerVisitor* visitor) {
+    ASSERT(raw_obj->IsMarked());
     // Extract the range into a temporary vector to iterate over it
     // while delay_set_ may be modified.
     std::vector<MapEntry> temp_copy;
@@ -170,141 +87,12 @@
 };
 
 
-class MarkingVisitor : public ObjectPointerVisitor {
+class SkippedCodeFunctions : public ZoneAllocated {
  public:
-  MarkingVisitor(Isolate* isolate,
-                 Heap* heap,
-                 PageSpace* page_space,
-                 MarkingStack* marking_stack,
-                 DelaySet* delay_set,
-                 bool visit_function_code)
-      : ObjectPointerVisitor(isolate),
-        thread_(Thread::Current()),
-        heap_(heap),
-        vm_heap_(Dart::vm_isolate()->heap()),
-        class_table_(isolate->class_table()),
-        page_space_(page_space),
-        marking_stack_(marking_stack),
-        delay_set_(delay_set),
-        visiting_old_object_(NULL),
-        visit_function_code_(visit_function_code) {
-    ASSERT(heap_ != vm_heap_);
-    ASSERT(thread_->isolate() == isolate);
-  }
+  SkippedCodeFunctions() {}
 
-  ~MarkingVisitor() {
-    // 'Finalize' should be explicitly called before destruction.
-    ASSERT(marking_stack_ == NULL);
-  }
-
-  MarkingStack* marking_stack() const { return marking_stack_; }
-
-  void VisitPointers(RawObject** first, RawObject** last) {
-    for (RawObject** current = first; current <= last; current++) {
-      MarkObject(*current, current);
-    }
-  }
-
-  bool visit_function_code() const { return visit_function_code_; }
-
-  virtual MallocGrowableArray<RawFunction*>* skipped_code_functions() {
-    return &skipped_code_functions_;
-  }
-
-  // Returns the mark bit. Sets the watch bit if unmarked. (The prior value of
-  // the watched bit is returned in 'watched_before' for validation purposes.)
-  // TODO(koda): When synchronizing header bits, this goes in a single CAS loop.
-  static bool EnsureWatchedIfWhite(RawObject* obj, bool* watched_before) {
-    if (obj->IsMarked()) {
-      return false;
-    }
-    if (!obj->IsWatched()) {
-      *watched_before = false;
-      obj->SetWatchedBitUnsynchronized();
-    } else {
-      *watched_before = true;
-    }
-    return true;
-  }
-
-  void ProcessWeakProperty(RawWeakProperty* raw_weak) {
-    // The fate of the weak property is determined by its key.
-    RawObject* raw_key = raw_weak->ptr()->key_;
-    bool watched_before = false;
-    if (raw_key->IsHeapObject() &&
-        raw_key->IsOldObject() &&
-        EnsureWatchedIfWhite(raw_key, &watched_before)) {
-      // Key is white.  Delay the weak property.
-      bool new_key = delay_set_->Insert(raw_weak);
-      ASSERT(new_key == !watched_before);
-    } else {
-      // Key is gray or black.  Make the weak property black.
-      raw_weak->VisitPointers(this);
-    }
-  }
-
-  // Called when all marking is complete.
-  void Finalize() {
-    if (!visit_function_code_) {
-      DetachCode();
-    }
-    // Fail fast on attempts to mark after finalizing.
-    marking_stack_ = NULL;
-  }
-
-  void VisitingOldObject(RawObject* obj) {
-    ASSERT((obj == NULL) || obj->IsOldObject());
-    visiting_old_object_ = obj;
-  }
-
- private:
-  void MarkAndPush(RawObject* raw_obj) {
-    ASSERT(raw_obj->IsHeapObject());
-    ASSERT((FLAG_verify_before_gc || FLAG_verify_before_gc) ?
-           page_space_->Contains(RawObject::ToAddr(raw_obj)) :
-           true);
-
-    // Mark the object and push it on the marking stack.
-    ASSERT(!raw_obj->IsMarked());
-    const bool is_watched = raw_obj->IsWatched();
-    raw_obj->SetMarkBitUnsynchronized();
-    raw_obj->ClearRememberedBitUnsynchronized();
-    raw_obj->ClearWatchedBitUnsynchronized();
-    if (is_watched) {
-      delay_set_->VisitValuesForKey(raw_obj, this);
-    }
-    marking_stack_->Push(raw_obj);
-  }
-
-  void MarkObject(RawObject* raw_obj, RawObject** p) {
-    // Fast exit if the raw object is a Smi.
-    if (!raw_obj->IsHeapObject()) {
-      return;
-    }
-
-    // Fast exit if the raw object is marked.
-    if (raw_obj->IsMarked()) {
-      return;
-    }
-
-    // Skip over new objects, but verify consistency of heap while at it.
-    if (raw_obj->IsNewObject()) {
-      // TODO(iposva): Add consistency check.
-      if ((visiting_old_object_ != NULL) &&
-          !visiting_old_object_->IsRemembered()) {
-        ASSERT(p != NULL);
-        visiting_old_object_->SetRememberedBitUnsynchronized();
-        thread_->StoreBufferAddObjectGC(visiting_old_object_);
-      }
-      return;
-    }
-    if (RawObject::IsVariableSizeClassId(raw_obj->GetClassId())) {
-      class_table_->UpdateLiveOld(raw_obj->GetClassId(), raw_obj->Size());
-    } else {
-      class_table_->UpdateLiveOld(raw_obj->GetClassId(), 0);
-    }
-
-    MarkAndPush(raw_obj);
+  void Add(RawFunction* func) {
+    skipped_code_functions_.Add(func);
   }
 
   void DetachCode() {
@@ -312,14 +100,16 @@
     intptr_t current_code_count = 0;
     for (int i = 0; i < skipped_code_functions_.length(); i++) {
       RawFunction* func = skipped_code_functions_[i];
-      RawCode* code = func->ptr()->instructions_->ptr()->code_;
+      RawCode* code = func->ptr()->code_;
       if (!code->IsMarked()) {
         // 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()->instructions_),
-            StubCode::LazyCompile_entry()->code()->ptr()->instructions_);
+            &(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) {
           // NOTE: This code runs while GC is in progress and runs within
           // a NoHandleScope block. Hence it is not okay to use a regular Zone
@@ -329,7 +119,7 @@
           // helper functions to the raw object interface.
           String name;
           name = func->ptr()->name_;
-          ISL_Print("Detaching code: %s\n", name.ToCString());
+          THR_Print("Detaching code: %s\n", name.ToCString());
           current_code_count++;
         }
       }
@@ -346,29 +136,317 @@
       }
     }
     if (FLAG_log_code_drop) {
-      ISL_Print("  total detached current: %" Pd "\n", current_code_count);
-      ISL_Print("  total detached unoptimized: %" Pd "\n",
+      THR_Print("  total detached current: %" Pd "\n", current_code_count);
+      THR_Print("  total detached unoptimized: %" Pd "\n",
                 unoptimized_code_count);
     }
     // Clean up.
     skipped_code_functions_.Clear();
   }
 
+ private:
+  GrowableArray<RawFunction*> skipped_code_functions_;
+
+  DISALLOW_COPY_AND_ASSIGN(SkippedCodeFunctions);
+};
+
+
+class MarkerWorkList : public ValueObject {
+ public:
+  explicit MarkerWorkList(MarkingStack* marking_stack)
+      : marking_stack_(marking_stack) {
+    work_ = marking_stack_->PopEmptyBlock();
+  }
+
+  ~MarkerWorkList() {
+    ASSERT(work_ == NULL);
+    ASSERT(marking_stack_ == NULL);
+  }
+
+  // Returns NULL if no more work was found.
+  RawObject* Pop() {
+    ASSERT(work_ != NULL);
+    if (work_->IsEmpty()) {
+      // TODO(koda): Track over/underflow events and use in heuristics to
+      // distribute work and prevent degenerate flip-flopping.
+      MarkingStack::Block* new_work = marking_stack_->PopNonEmptyBlock();
+      if (new_work == NULL) {
+        return NULL;
+      }
+      marking_stack_->PushBlock(work_);
+      work_ = new_work;
+    }
+    return work_->Pop();
+  }
+
+  void Push(RawObject* raw_obj) {
+    if (work_->IsFull()) {
+      // TODO(koda): Track over/underflow events and use in heuristics to
+      // distribute work and prevent degenerate flip-flopping.
+      marking_stack_->PushBlock(work_);
+      work_ = marking_stack_->PopEmptyBlock();
+    }
+    work_->Push(raw_obj);
+  }
+
+  void Finalize() {
+    ASSERT(work_->IsEmpty());
+    marking_stack_->PushBlock(work_);
+    work_ = NULL;
+    // Fail fast on attempts to mark after finalizing.
+    marking_stack_ = NULL;
+  }
+
+ private:
+  MarkingStack::Block* work_;
+  MarkingStack* marking_stack_;
+};
+
+
+template<bool sync>
+class MarkingVisitorBase : public ObjectPointerVisitor {
+ public:
+  MarkingVisitorBase(Isolate* isolate,
+                 Heap* heap,
+                 PageSpace* page_space,
+                 MarkingStack* marking_stack,
+                 DelaySet* delay_set,
+                 SkippedCodeFunctions* skipped_code_functions)
+      : ObjectPointerVisitor(isolate),
+        thread_(Thread::Current()),
+        heap_(heap),
+        vm_heap_(Dart::vm_isolate()->heap()),
+        class_stats_count_(isolate->class_table()->NumCids()),
+        class_stats_size_(isolate->class_table()->NumCids()),
+        page_space_(page_space),
+        work_list_(marking_stack),
+        delay_set_(delay_set),
+        visiting_old_object_(NULL),
+        skipped_code_functions_(skipped_code_functions),
+        marked_bytes_(0) {
+    ASSERT(heap_ != vm_heap_);
+    ASSERT(thread_->isolate() == isolate);
+    class_stats_count_.SetLength(isolate->class_table()->NumCids());
+    class_stats_size_.SetLength(isolate->class_table()->NumCids());
+    for (intptr_t i = 0; i < class_stats_count_.length(); ++i) {
+      class_stats_count_[i] = 0;
+      class_stats_size_[i] = 0;
+    }
+  }
+
+  uintptr_t marked_bytes() const { return marked_bytes_; }
+
+  intptr_t live_count(intptr_t class_id) {
+    return class_stats_count_[class_id];
+  }
+
+  intptr_t live_size(intptr_t class_id) {
+    return class_stats_size_[class_id];
+  }
+
+  // Returns true if some non-zero amount of work was performed.
+  bool DrainMarkingStack() {
+    RawObject* raw_obj = work_list_.Pop();
+    if (raw_obj == NULL) {
+      ASSERT(visiting_old_object_ == NULL);
+      return false;
+    }
+    do {
+      VisitingOldObject(raw_obj);
+      const intptr_t class_id = raw_obj->GetClassId();
+      if (class_id != kWeakPropertyCid) {
+        marked_bytes_ += raw_obj->VisitPointers(this);
+      } else {
+        RawWeakProperty* raw_weak = reinterpret_cast<RawWeakProperty*>(raw_obj);
+        marked_bytes_ += raw_weak->Size();
+        ProcessWeakProperty(raw_weak);
+      }
+      raw_obj = work_list_.Pop();
+    } while (raw_obj != NULL);
+    VisitingOldObject(NULL);
+    return true;
+  }
+
+  void VisitPointers(RawObject** first, RawObject** last) {
+    for (RawObject** current = first; current <= last; current++) {
+      MarkObject(*current, current);
+    }
+  }
+
+  bool visit_function_code() const {
+    return skipped_code_functions_ == NULL;
+  }
+
+  virtual void add_skipped_code_function(RawFunction* func) {
+    ASSERT(!visit_function_code());
+    skipped_code_functions_->Add(func);
+  }
+
+  // If unmarked, sets the watch bit and returns true.
+  // If marked, does nothing and returns false.
+  static bool EnsureWatchedIfWhite(RawObject* obj) {
+    if (!sync) {
+      if (obj->IsMarked()) return false;
+      if (!obj->IsWatched()) obj->SetWatchedBitUnsynchronized();
+      return true;
+    }
+    uword tags = obj->ptr()->tags_;
+    uword old_tags;
+    do {
+      old_tags = tags;
+      if (RawObject::MarkBit::decode(tags)) return false;
+      if (RawObject::WatchedBit::decode(tags)) return true;
+      uword new_tags = RawObject::WatchedBit::update(true, old_tags);
+      tags = AtomicOperations::CompareAndSwapWord(
+          &obj->ptr()->tags_, old_tags, new_tags);
+    } while (tags != old_tags);
+    return true;
+  }
+
+  void 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() &&
+        EnsureWatchedIfWhite(raw_key) &&
+        delay_set_->InsertIfWhite(raw_weak)) {
+      // Key was white.  Delayed the weak property.
+    } else {
+      // Key is gray or black.  Make the weak property black.
+      raw_weak->VisitPointers(this);
+    }
+  }
+
+  // Called when all marking is complete.
+  void Finalize() {
+    work_list_.Finalize();
+    if (skipped_code_functions_ != NULL) {
+      skipped_code_functions_->DetachCode();
+    }
+  }
+
+  void VisitingOldObject(RawObject* obj) {
+    ASSERT((obj == NULL) || obj->IsOldObject());
+    visiting_old_object_ = obj;
+  }
+
+ 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);
+
+    // Push the marked object on the marking stack.
+    ASSERT(raw_obj->IsMarked());
+    const bool is_watched = raw_obj->IsWatched();
+    // We acquired the mark bit => no other task is modifying the header.
+    // TODO(koda): For concurrent mutator, this needs synchronization. Consider
+    // clearing these bits already in the CAS for the mark bit.
+    raw_obj->ClearRememberedBitUnsynchronized();
+    raw_obj->ClearWatchedBitUnsynchronized();
+    if (is_watched) {
+      delay_set_->VisitValuesForKey(raw_obj, this);
+    }
+    work_list_.Push(raw_obj);
+  }
+
+  static bool TryAcquireMarkBit(RawObject* raw_obj) {
+    if (!sync) {
+      if (raw_obj->IsMarked()) return false;
+      raw_obj->SetMarkBitUnsynchronized();
+      return true;
+    }
+    return raw_obj->TryAcquireMarkBit();
+  }
+
+  void MarkObject(RawObject* raw_obj, RawObject** p) {
+    // Fast exit if the raw object is a Smi.
+    if (!raw_obj->IsHeapObject()) {
+      return;
+    }
+
+    // Fast exit if the raw object is marked.
+    if (raw_obj->IsMarked()) {
+      return;
+    }
+
+    // TODO(koda): Investigate performance impact of alternative branching:
+    // if (smi or new) <-- can be done as single compare + conditional jump
+    //   if (smi) return;
+    //   else ...
+    // if (marked) return;
+    // ...
+    if (raw_obj->IsNewObject()) {
+      ProcessNewSpaceObject(raw_obj, p);
+      return;
+    }
+
+    if (!TryAcquireMarkBit(raw_obj)) {
+      // Already marked.
+      return;
+    }
+    if (RawObject::IsVariableSizeClassId(raw_obj->GetClassId())) {
+      UpdateLiveOld(raw_obj->GetClassId(), raw_obj->Size());
+    } else {
+      UpdateLiveOld(raw_obj->GetClassId(), 0);
+    }
+
+    PushMarked(raw_obj);
+  }
+
+  static bool TryAcquireRememberedBit(RawObject* raw_obj) {
+    if (!sync) {
+      if (raw_obj->IsRemembered()) return false;
+      raw_obj->SetRememberedBitUnsynchronized();
+      return true;
+    }
+    return raw_obj->TryAcquireRememberedBit();
+  }
+
+  void ProcessNewSpaceObject(RawObject* raw_obj, RawObject** p) {
+    // TODO(iposva): Add consistency check.
+    if ((visiting_old_object_ != NULL) &&
+        TryAcquireRememberedBit(visiting_old_object_)) {
+      // NOTE: We pass in the pointer to the address we are visiting
+      // allows us to get a distance from the object start. At some
+      // point we might want to store exact addresses in store buffers
+      // for locations far enough from the header, so that we do not
+      // need to walk big objects only to find the single new
+      // reference in the last word during scavenge. This doesn't seem
+      // to be a problem though currently.
+      ASSERT(p != NULL);
+      thread_->StoreBufferAddObjectGC(visiting_old_object_);
+    }
+  }
+
+  void UpdateLiveOld(intptr_t class_id, intptr_t size) {
+    // TODO(koda): Support growing the array once mutator runs concurrently.
+    ASSERT(class_id < class_stats_count_.length());
+    class_stats_count_[class_id] += 1;
+    class_stats_size_[class_id] += size;
+  }
+
   Thread* thread_;
   Heap* heap_;
   Heap* vm_heap_;
-  ClassTable* class_table_;
+  GrowableArray<intptr_t> class_stats_count_;
+  GrowableArray<intptr_t> class_stats_size_;
   PageSpace* page_space_;
-  MarkingStack* marking_stack_;
+  MarkerWorkList work_list_;
   DelaySet* delay_set_;
   RawObject* visiting_old_object_;
-  const bool visit_function_code_;
-  MallocGrowableArray<RawFunction*> skipped_code_functions_;
+  SkippedCodeFunctions* skipped_code_functions_;
+  uintptr_t marked_bytes_;
 
-  DISALLOW_IMPLICIT_CONSTRUCTORS(MarkingVisitor);
+  DISALLOW_IMPLICIT_CONSTRUCTORS(MarkingVisitorBase);
 };
 
 
+typedef MarkingVisitorBase<false> UnsyncMarkingVisitor;
+typedef MarkingVisitorBase<true> SyncMarkingVisitor;
+
+
 static bool IsUnreachable(const RawObject* raw_obj) {
   if (!raw_obj->IsHeapObject()) {
     return false;
@@ -385,7 +463,7 @@
 
 class MarkingWeakVisitor : public HandleVisitor {
  public:
-  MarkingWeakVisitor() : HandleVisitor(Isolate::Current()) {
+  MarkingWeakVisitor() : HandleVisitor(Thread::Current()) {
   }
 
   void VisitHandle(uword addr) {
@@ -393,7 +471,7 @@
         reinterpret_cast<FinalizablePersistentHandle*>(addr);
     RawObject* raw_obj = handle->raw();
     if (IsUnreachable(raw_obj)) {
-      handle->UpdateUnreachable(isolate());
+      handle->UpdateUnreachable(thread()->isolate());
     }
   }
 
@@ -421,11 +499,20 @@
 
 void GCMarker::IterateRoots(Isolate* isolate,
                             ObjectPointerVisitor* visitor,
-                            bool visit_prologue_weak_persistent_handles) {
-  isolate->VisitObjectPointers(visitor,
-                               visit_prologue_weak_persistent_handles,
-                               StackFrameIterator::kDontValidateFrames);
-  heap_->new_space()->VisitObjectPointers(visitor);
+                            bool visit_prologue_weak_persistent_handles,
+                            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,
+                                 visit_prologue_weak_persistent_handles,
+                                 StackFrameIterator::kDontValidateFrames);
+  }
+  if ((slice_index == 1) || (num_slices <= 1)) {
+    heap_->new_space()->VisitObjectPointers(visitor);
+  }
+
+  // For now, we just distinguish two parts of the root set, so any remaining
+  // slices are empty.
 }
 
 
@@ -439,8 +526,9 @@
 }
 
 
+template<class MarkingVisitorType>
 void GCMarker::IterateWeakReferences(Isolate* isolate,
-                                     MarkingVisitor* visitor) {
+                                     MarkingVisitorType* visitor) {
   ApiState* state = isolate->api_state();
   ASSERT(state != NULL);
   while (true) {
@@ -483,9 +571,7 @@
         state->DelayWeakReferenceSet(reference_set);
       }
     }
-    if (!visitor->marking_stack()->IsEmpty()) {
-      DrainMarkingStack(isolate, visitor);
-    } else {
+    if (!visitor->DrainMarkingStack()) {
       // Break out of the loop if there has been no forward process.
       // All key objects in the weak reference sets are unreachable
       // so we reset the weak reference sets queue.
@@ -500,27 +586,6 @@
 }
 
 
-void GCMarker::DrainMarkingStack(Isolate* isolate,
-                                 MarkingVisitor* visitor) {
-  while (!visitor->marking_stack()->IsEmpty()) {
-    RawObject* raw_obj = visitor->marking_stack()->Pop();
-    visitor->VisitingOldObject(raw_obj);
-    const intptr_t class_id = raw_obj->GetClassId();
-    // Currently, classes are considered roots (see issue 18284), so at this
-    // point, they should all be marked.
-    ASSERT(isolate->class_table()->At(class_id)->IsMarked());
-    if (class_id != kWeakPropertyCid) {
-      marked_bytes_ += raw_obj->VisitPointers(visitor);
-    } else {
-      RawWeakProperty* raw_weak = reinterpret_cast<RawWeakProperty*>(raw_obj);
-      marked_bytes_ += raw_weak->Size();
-      visitor->ProcessWeakProperty(raw_weak);
-    }
-  }
-  visitor->VisitingOldObject(NULL);
-}
-
-
 void GCMarker::ProcessWeakTables(PageSpace* page_space) {
   for (int sel = 0;
        sel < Heap::kNumWeakSelectors;
@@ -568,26 +633,190 @@
 }
 
 
+class MarkTask : public ThreadPool::Task {
+ public:
+  MarkTask(GCMarker* marker,
+           Isolate* isolate,
+           Heap* heap,
+           PageSpace* page_space,
+           MarkingStack* marking_stack,
+           DelaySet* delay_set,
+           ThreadBarrier* barrier,
+           bool collect_code,
+           bool visit_prologue_weak_persistent_handles,
+           intptr_t task_index,
+           intptr_t num_tasks,
+           uintptr_t* num_busy)
+      : marker_(marker),
+        isolate_(isolate),
+        heap_(heap),
+        page_space_(page_space),
+        marking_stack_(marking_stack),
+        delay_set_(delay_set),
+        barrier_(barrier),
+        collect_code_(collect_code),
+        visit_prologue_weak_persistent_handles_(
+            visit_prologue_weak_persistent_handles),
+        task_index_(task_index),
+        num_tasks_(num_tasks),
+        num_busy_(num_busy) {
+  }
+
+  virtual void Run() {
+    Thread::EnterIsolateAsHelper(isolate_, true);
+    {
+      StackZone stack_zone(Thread::Current());
+      Zone* zone = stack_zone.GetZone();
+      SkippedCodeFunctions* skipped_code_functions =
+          collect_code_ ? new(zone) SkippedCodeFunctions() : NULL;
+      SyncMarkingVisitor visitor(isolate_, heap_, page_space_, marking_stack_,
+                                 delay_set_, skipped_code_functions);
+      // Phase 1: Iterate over roots and drain marking stack in tasks.
+      marker_->IterateRoots(isolate_, &visitor,
+                            visit_prologue_weak_persistent_handles_,
+                            task_index_, num_tasks_);
+      do {
+        visitor.DrainMarkingStack();
+
+        // I can't find more work right now. If no other task is busy,
+        // then there will never be more work (NB: 1 is *before* decrement).
+        if (AtomicOperations::FetchAndDecrement(num_busy_) == 1) break;
+
+        // Wait for some work to appear.
+        // TODO(iposva): Replace busy-waiting with a solution using Monitor,
+        // and redraw the boundaries between stack/visitor/task as needed.
+        while (marking_stack_->IsEmpty() &&
+               AtomicOperations::LoadRelaxed(num_busy_) > 0) {
+        }
+
+        // If no tasks are busy, there will never be more work.
+        if (AtomicOperations::LoadRelaxed(num_busy_) == 0) break;
+
+        // I saw some work; get busy and compete for it.
+        AtomicOperations::FetchAndIncrement(num_busy_);
+      } while (true);
+      ASSERT(AtomicOperations::LoadRelaxed(num_busy_) == 0);
+      barrier_->Sync();
+
+      // Phase 2: Weak processing and follow-up marking on main thread.
+      barrier_->Sync();
+
+      // 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());
+      }
+      marker_->FinalizeResultsFrom(&visitor);
+    }
+    Thread::ExitIsolateAsHelper(true);
+
+    // This task is done. Notify the original thread.
+    barrier_->Exit();
+  }
+
+ private:
+  GCMarker* marker_;
+  Isolate* isolate_;
+  Heap* heap_;
+  PageSpace* page_space_;
+  MarkingStack* marking_stack_;
+  DelaySet* delay_set_;
+  ThreadBarrier* barrier_;
+  bool collect_code_;
+  bool visit_prologue_weak_persistent_handles_;
+  const intptr_t task_index_;
+  const intptr_t num_tasks_;
+  uintptr_t* num_busy_;
+
+  DISALLOW_COPY_AND_ASSIGN(MarkTask);
+};
+
+
+template<class MarkingVisitorType>
+void GCMarker::FinalizeResultsFrom(MarkingVisitorType* visitor) {
+  {
+    MutexLocker ml(&stats_mutex_);
+    marked_bytes_ += visitor->marked_bytes();
+    // Class heap stats are not themselves thread-safe yet, so we update the
+    // stats while holding stats_mutex_.
+    ClassTable* table = heap_->isolate()->class_table();
+    for (intptr_t i = 0; i < table->NumCids(); ++i) {
+      const intptr_t count = visitor->live_count(i);
+      if (count > 0) {
+        const intptr_t size = visitor->live_size(i);
+        table->UpdateLiveOld(i, size, count);
+      }
+    }
+  }
+  visitor->Finalize();
+}
+
+
 void GCMarker::MarkObjects(Isolate* isolate,
                            PageSpace* page_space,
                            bool invoke_api_callbacks,
                            bool collect_code) {
-  const bool visit_function_code = !collect_code;
   Prologue(isolate, invoke_api_callbacks);
   // The API prologue/epilogue may create/destroy zones, so we must not
   // depend on zone allocations surviving beyond the epilogue callback.
   {
-    StackZone zone(isolate);
+    StackZone stack_zone(Thread::Current());
+    Zone* zone = stack_zone.GetZone();
     MarkingStack marking_stack;
     DelaySet delay_set;
-    MarkingVisitor mark(isolate, heap_, page_space, &marking_stack,
-                        &delay_set, visit_function_code);
-    IterateRoots(isolate, &mark, !invoke_api_callbacks);
-    DrainMarkingStack(isolate, &mark);
-    IterateWeakReferences(isolate, &mark);
-    MarkingWeakVisitor mark_weak;
-    IterateWeakRoots(isolate, &mark_weak, invoke_api_callbacks);
-    mark.Finalize();
+    const bool visit_prologue_weak_persistent_handles = !invoke_api_callbacks;
+    marked_bytes_ = 0;
+    const int num_tasks = FLAG_marker_tasks;
+    if (num_tasks == 0) {
+      // Mark everything on main thread.
+      SkippedCodeFunctions* skipped_code_functions =
+          collect_code ? new(zone) SkippedCodeFunctions() : NULL;
+      UnsyncMarkingVisitor mark(isolate, heap_, page_space, &marking_stack,
+                                &delay_set, skipped_code_functions);
+      IterateRoots(isolate, &mark, visit_prologue_weak_persistent_handles,
+                   0, 1);
+      mark.DrainMarkingStack();
+      IterateWeakReferences(isolate, &mark);
+      MarkingWeakVisitor mark_weak;
+      IterateWeakRoots(isolate, &mark_weak,
+                       !visit_prologue_weak_persistent_handles);
+      // All marking done; detach code, etc.
+      FinalizeResultsFrom(&mark);
+    } else {
+      ThreadBarrier barrier(num_tasks + 1);
+      // Used to coordinate draining among tasks; all start out as 'busy'.
+      uintptr_t num_busy = num_tasks;
+      // Phase 1: Iterate over roots and drain marking stack in tasks.
+      for (intptr_t i = 0; i < num_tasks; ++i) {
+        MarkTask* mark_task =
+            new MarkTask(this, isolate, heap_, page_space, &marking_stack,
+                         &delay_set, &barrier, collect_code,
+                         visit_prologue_weak_persistent_handles,
+                         i, num_tasks, &num_busy);
+        ThreadPool* pool = Dart::thread_pool();
+        pool->Run(mark_task);
+      }
+      barrier.Sync();
+
+      // Phase 2: Weak processing and follow-up marking on main thread.
+      SkippedCodeFunctions* skipped_code_functions =
+          collect_code ? new(zone) SkippedCodeFunctions() : NULL;
+      SyncMarkingVisitor mark(isolate, heap_, page_space, &marking_stack,
+                              &delay_set, skipped_code_functions);
+      IterateWeakReferences(isolate, &mark);
+      MarkingWeakVisitor mark_weak;
+      IterateWeakRoots(isolate, &mark_weak,
+                       !visit_prologue_weak_persistent_handles);
+      barrier.Sync();
+
+      // Phase 3: Finalize results from all markers (detach code, etc.).
+      if (FLAG_log_marker_tasks) {
+        THR_Print("Main thread marked %" Pd " bytes.\n",
+                  mark.marked_bytes());
+      }
+      FinalizeResultsFrom(&mark);
+      barrier.Exit();
+    }
     delay_set.ClearReferences();
     ProcessWeakTables(page_space);
     ProcessObjectIdTable(isolate);
diff --git a/runtime/vm/gc_marker.h b/runtime/vm/gc_marker.h
index 978cf3d..93b209a 100644
--- a/runtime/vm/gc_marker.h
+++ b/runtime/vm/gc_marker.h
@@ -6,6 +6,7 @@
 #define VM_GC_MARKER_H_
 
 #include "vm/allocation.h"
+#include "vm/os_thread.h"  // Mutex.
 
 namespace dart {
 
@@ -13,7 +14,6 @@
 class HandleVisitor;
 class Heap;
 class Isolate;
-class MarkingVisitor;
 class ObjectPointerVisitor;
 class PageSpace;
 class RawWeakProperty;
@@ -22,7 +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) { }
+  explicit GCMarker(Heap* heap)
+      : heap_(heap), marked_bytes_(0) { }
   ~GCMarker() { }
 
   void MarkObjects(Isolate* isolate,
@@ -37,19 +38,27 @@
   void Epilogue(Isolate* isolate, bool invoke_api_callbacks);
   void IterateRoots(Isolate* isolate,
                     ObjectPointerVisitor* visitor,
-                    bool visit_prologue_weak_persistent_handles);
+                    bool visit_prologue_weak_persistent_handles,
+                    intptr_t slice_index, intptr_t num_slices);
   void IterateWeakRoots(Isolate* isolate,
                         HandleVisitor* visitor,
                         bool visit_prologue_weak_persistent_handles);
-  void IterateWeakReferences(Isolate* isolate, MarkingVisitor* visitor);
-  void DrainMarkingStack(Isolate* isolate, MarkingVisitor* visitor);
+  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>
+  void FinalizeResultsFrom(MarkingVisitorType* visitor);
 
   Heap* heap_;
+
+  Mutex stats_mutex_;
+  // TODO(koda): Remove after verifying it's redundant w.r.t. ClassHeapStats.
   uintptr_t marked_bytes_;
 
+  friend class MarkTask;
   DISALLOW_IMPLICIT_CONSTRUCTORS(GCMarker);
 };
 
diff --git a/runtime/vm/gc_sweeper.cc b/runtime/vm/gc_sweeper.cc
index 4cd2243..6332dee 100644
--- a/runtime/vm/gc_sweeper.cc
+++ b/runtime/vm/gc_sweeper.cc
@@ -10,6 +10,7 @@
 #include "vm/lockers.h"
 #include "vm/pages.h"
 #include "vm/thread_pool.h"
+#include "vm/thread_registry.h"
 
 namespace dart {
 
@@ -120,6 +121,7 @@
     HeapPage* prev_page = NULL;
 
     while (page != NULL) {
+      task_isolate_->thread_registry()->CheckSafepoint();
       HeapPage* next_page = page->next();
       ASSERT(page->type() == HeapPage::kData);
       bool page_in_use = sweeper.SweepPage(page, freelist_, false);
diff --git a/runtime/vm/globals.h b/runtime/vm/globals.h
index 597756d..dc7932e 100644
--- a/runtime/vm/globals.h
+++ b/runtime/vm/globals.h
@@ -90,6 +90,37 @@
 #endif
 
 
+// Macros to get the contents of the fp register.
+#if defined(TARGET_OS_WINDOWS)
+
+#if defined(HOST_ARCH_IA32)
+#define COPY_FP_REGISTER(fp) __asm { mov fp, ebp };  // NOLINT
+#elif defined(HOST_ARCH_X64)
+#define COPY_FP_REGISTER(fp) UNIMPLEMENTED();
+#else
+#error Unknown host architecture.
+#endif
+
+#else  // !defined(TARGET_OS_WINDOWS))
+
+// Assume GCC-like inline syntax is valid.
+#if defined(HOST_ARCH_IA32)
+#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) );
+#elif defined(HOST_ARCH_ARM)
+#define COPY_FP_REGISTER(fp) asm volatile ("mov %0, r11" : "=r" (fp) );
+#elif defined(HOST_ARCH_ARM64)
+#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) );
+#else
+#error Unknown host architecture.
+#endif
+
+
+#endif  // !defined(TARGET_OS_WINDOWS))
+
 }  // namespace dart
 
 #endif  // VM_GLOBALS_H_
diff --git a/runtime/vm/growable_array.h b/runtime/vm/growable_array.h
index 1e7c204..9023948 100644
--- a/runtime/vm/growable_array.h
+++ b/runtime/vm/growable_array.h
@@ -195,6 +195,61 @@
 };
 
 
+// T must be a Handle type.
+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()));
+  }
+
+  T& operator[](intptr_t index) const {
+    return *array_[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());
+  }
+
+  intptr_t length() const { return array_.length(); }
+
+  const GrowableArray<T*>& growable_array() const { return array_; }
+
+ private:
+  Zone* zone_;
+  GrowableArray<T*> array_;
+
+  DISALLOW_COPY_AND_ASSIGN(BaseGrowableHandlePtrArray);
+};
+
+
+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> {
+ public:
+  ZoneGrowableHandlePtrArray(Zone* zone, intptr_t initial_capacity)
+      : BaseGrowableHandlePtrArray<T, ZoneAllocated>(zone, initial_capacity) {}
+};
+
+
+
 class Malloc : public AllStatic {
  public:
   template <class T>
diff --git a/runtime/vm/growable_array_test.cc b/runtime/vm/growable_array_test.cc
index 09c1605..fedb9c8 100644
--- a/runtime/vm/growable_array_test.cc
+++ b/runtime/vm/growable_array_test.cc
@@ -96,4 +96,20 @@
   EXPECT_EQ(4, g.Last());
 }
 
+
+TEST_CASE(GrowableHandlePtr) {
+  Zone* zone = Thread::Current()->zone();
+  GrowableHandlePtrArray<const String> test1(zone, 1);
+  EXPECT_EQ(0, test1.length());
+  test1.Add(Symbols::Int());
+  EXPECT(test1[0].raw() == Symbols::Int().raw());
+  EXPECT_EQ(1, test1.length());
+
+  ZoneGrowableHandlePtrArray<const String>* test2 =
+      new ZoneGrowableHandlePtrArray<const String>(zone, 1);
+  test2->Add(Symbols::GetterPrefix());
+  EXPECT((*test2)[0].raw() == Symbols::GetterPrefix().raw());
+  EXPECT_EQ(1, test2->length());
+}
+
 }  // namespace dart
diff --git a/runtime/vm/handles.cc b/runtime/vm/handles.cc
index c053542..7057739 100644
--- a/runtime/vm/handles.cc
+++ b/runtime/vm/handles.cc
@@ -109,11 +109,6 @@
 }
 
 
-HandleScope::HandleScope(Isolate* isolate) : StackResource(isolate) {
-  Initialize();
-}
-
-
 HandleScope::~HandleScope() {
   ASSERT(thread()->zone() != NULL);
   VMHandles* handles = thread()->zone()->handles();
@@ -130,13 +125,8 @@
 
 
 #if defined(DEBUG)
-NoHandleScope::NoHandleScope(Isolate* isolate) : StackResource(isolate) {
-  thread()->IncrementNoHandleScopeDepth();
-}
-
-
-NoHandleScope::NoHandleScope() : StackResource(Thread::Current()) {
-  thread()->IncrementNoHandleScopeDepth();
+NoHandleScope::NoHandleScope(Thread* thread) : StackResource(thread) {
+  thread->IncrementNoHandleScopeDepth();
 }
 
 
diff --git a/runtime/vm/handles.h b/runtime/vm/handles.h
index f86d0bb..c5bcac7 100644
--- a/runtime/vm/handles.h
+++ b/runtime/vm/handles.h
@@ -58,21 +58,22 @@
 
 // Forward declarations.
 class ObjectPointerVisitor;
+class Thread;
 
 DECLARE_FLAG(bool, verify_handles);
 DECLARE_DEBUG_FLAG(bool, trace_handles);
 
 class HandleVisitor {
  public:
-  explicit HandleVisitor(Isolate* isolate) : isolate_(isolate) {}
+  explicit HandleVisitor(Thread* thread) : thread_(thread) {}
   virtual ~HandleVisitor() {}
 
-  Isolate* isolate() const { return isolate_; }
+  Thread* thread() const { return thread_; }
 
   virtual void VisitHandle(uword addr) = 0;
 
  private:
-  Isolate* isolate_;
+  Thread* thread_;
 
   DISALLOW_IMPLICIT_CONSTRUCTORS(HandleVisitor);
 };
@@ -238,7 +239,7 @@
   friend class HandleScope;
   friend class Dart;
   friend class ObjectStore;
-  friend class Isolate;
+  friend class Thread;
   DISALLOW_ALLOCATION();
   DISALLOW_COPY_AND_ASSIGN(Handles);
 };
@@ -301,8 +302,6 @@
 class HandleScope : public StackResource {
  public:
   explicit HandleScope(Thread* thread);
-  // DEPRECATED: Use Thread version.
-  explicit HandleScope(Isolate* isolate);
   ~HandleScope();
 
  private:
@@ -337,9 +336,6 @@
 class NoHandleScope : public StackResource {
  public:
   explicit NoHandleScope(Thread* thread);
-  // DEPRECATED: Use Thread version.
-  explicit NoHandleScope(Isolate* isolate);
-  NoHandleScope();
   ~NoHandleScope();
 
  private:
diff --git a/runtime/vm/handles_test.cc b/runtime/vm/handles_test.cc
index cc82f26..b871f97 100644
--- a/runtime/vm/handles_test.cc
+++ b/runtime/vm/handles_test.cc
@@ -49,8 +49,8 @@
   static const int kNumHandles = 65;
   // Create some scoped handles.
   {
-    Isolate* isolate = Isolate::Current();
-    HANDLESCOPE(isolate);
+    Thread* thread = Thread::Current();
+    HANDLESCOPE(thread);
     for (int i = 0; i < kNumHandles; i++) {
       const Smi& handle = Smi::Handle(Smi::New(i));
       EXPECT(handle.IsSmi());
@@ -59,7 +59,7 @@
     EXPECT_EQ((handle_count + kNumHandles), VMHandles::ScopedHandleCount());
     // Create lots of scoped handles in a loop with a nested scope.
     for (int loop = 0; loop < 1000; loop++) {
-      HANDLESCOPE(isolate);
+      HANDLESCOPE(thread);
       for (int i = 0; i < 2; i++) {
         const Smi& handle = Smi::Handle(Smi::New(i + loop));
         EXPECT(handle.IsSmi());
diff --git a/runtime/vm/hash_map.h b/runtime/vm/hash_map.h
index 5c20d04..f2caa9e 100644
--- a/runtime/vm/hash_map.h
+++ b/runtime/vm/hash_map.h
@@ -5,6 +5,8 @@
 #ifndef VM_HASH_MAP_H_
 #define VM_HASH_MAP_H_
 
+#include "vm/zone.h"
+
 namespace dart {
 
 template <typename KeyValueTrait>
diff --git a/runtime/vm/hash_table.h b/runtime/vm/hash_table.h
index 195c6a5..592cf07 100644
--- a/runtime/vm/hash_table.h
+++ b/runtime/vm/hash_table.h
@@ -41,7 +41,7 @@
 // lookup key types (e.g., look up a char* in a set of String objects), and
 // any equality and hash code computation.
 //
-// The classes all wrap an Array handle, and metods like HashSet::Insert can
+// The classes all wrap an Array handle, and methods like HashSet::Insert can
 // trigger growth into a new RawArray, updating the handle. Debug mode asserts
 // that 'Release' was called once to access the final array before destruction.
 // NOTE: The handle returned by 'Release' is cleared by ~HashTable.
@@ -85,20 +85,20 @@
 class HashTable : public ValueObject {
  public:
   typedef KeyTraits Traits;
-  // Uses 'isolate' for handle allocation. 'Release' must be called at the end
+  // Uses 'zone' for handle allocation. 'Release' must be called at the end
   // to obtain the final table after potential growth/shrinkage.
-  HashTable(Isolate* isolate, RawArray* data)
-      : isolate_(isolate),
-        key_handle_(Object::Handle(isolate_)),
-        smi_handle_(Smi::Handle(isolate_)),
-        data_(&Array::Handle(isolate_, data)),
+  HashTable(Zone* zone, RawArray* data)
+      : zone_(zone),
+        key_handle_(Object::Handle(zone_)),
+        smi_handle_(Smi::Handle(zone_)),
+        data_(&Array::Handle(zone_, data)),
         released_data_(NULL) {}
-  // Like above, except uses current isolate.
+  // Like above, except uses current zone.
   explicit HashTable(RawArray* data)
-      : isolate_(Isolate::Current()),
-        key_handle_(Object::Handle(isolate_)),
-        smi_handle_(Smi::Handle(isolate_)),
-        data_(&Array::Handle(isolate_, data)),
+      : zone_(Thread::Current()->zone()),
+        key_handle_(Object::Handle(zone_)),
+        smi_handle_(Smi::Handle(zone_)),
+        data_(&Array::Handle(zone_, data)),
         released_data_(NULL) {}
 
   // Returns the final table. The handle is cleared when this HashTable is
@@ -296,7 +296,7 @@
   }
 
   intptr_t GetSmiValueAt(intptr_t index) const {
-    ASSERT(Object::Handle(isolate(), data_->At(index)).IsSmi());
+    ASSERT(Object::Handle(zone(), data_->At(index)).IsSmi());
     return Smi::Value(Smi::RawCast(data_->At(index)));
   }
 
@@ -309,9 +309,9 @@
     SetSmiValueAt(index, (GetSmiValueAt(index) + delta));
   }
 
-  Isolate* isolate() const { return isolate_; }
+  Zone* zone() const { return zone_; }
 
-  Isolate* isolate_;
+  Zone* zone_;
   Object& key_handle_;
   Smi& smi_handle_;
   // Exactly one of these is non-NULL, depending on whether Release was called.
@@ -329,8 +329,8 @@
   typedef HashTable<KeyTraits, kUserPayloadSize, 0> BaseTable;
   static const intptr_t kPayloadSize = kUserPayloadSize;
   explicit UnorderedHashTable(RawArray* data) : BaseTable(data) {}
-  UnorderedHashTable(Isolate* isolate, RawArray* data)
-      : BaseTable(isolate, data) {}
+  UnorderedHashTable(Zone* zone, RawArray* data)
+      : BaseTable(zone, data) {}
   // Note: Does not check for concurrent modification.
   class Iterator {
    public:
@@ -367,8 +367,8 @@
   typedef HashTable<KeyTraits, kUserPayloadSize + 1, 1> BaseTable;
   static const intptr_t kPayloadSize = kUserPayloadSize;
   static const intptr_t kNextEnumIndex = BaseTable::kMetaDataIndex;
-  EnumIndexHashTable(Isolate* isolate, RawArray* data)
-      : BaseTable(isolate, data) {}
+  EnumIndexHashTable(Zone* zone, RawArray* data)
+      : BaseTable(zone, data) {}
   explicit EnumIndexHashTable(RawArray* data) : BaseTable(data) {}
   // Note: Does not check for concurrent modification.
   class Iterator {
@@ -503,7 +503,7 @@
 class HashMap : public BaseIterTable {
  public:
   explicit HashMap(RawArray* data) : BaseIterTable(data) {}
-  HashMap(Isolate* isolate, RawArray* data) : BaseIterTable(isolate, data) {}
+  HashMap(Zone* zone, RawArray* data) : BaseIterTable(zone, data) {}
   template<typename Key>
   RawObject* GetOrNull(const Key& key, bool* present = NULL) const {
     intptr_t entry = BaseIterTable::FindKey(key);
@@ -589,7 +589,7 @@
  public:
   typedef HashMap<UnorderedHashTable<KeyTraits, 1> > BaseMap;
   explicit UnorderedHashMap(RawArray* data) : BaseMap(data) {}
-  UnorderedHashMap(Isolate* isolate, RawArray* data) : BaseMap(isolate, data) {}
+  UnorderedHashMap(Zone* zone, RawArray* data) : BaseMap(zone, data) {}
 };
 
 
@@ -598,7 +598,7 @@
  public:
   typedef HashMap<EnumIndexHashTable<KeyTraits, 1> > BaseMap;
   explicit EnumIndexHashMap(RawArray* data) : BaseMap(data) {}
-  EnumIndexHashMap(Isolate* isolate, RawArray* data) : BaseMap(isolate, data) {}
+  EnumIndexHashMap(Zone* zone, RawArray* data) : BaseMap(zone, data) {}
 };
 
 
@@ -606,7 +606,7 @@
 class HashSet : public BaseIterTable {
  public:
   explicit HashSet(RawArray* data) : BaseIterTable(data) {}
-  HashSet(Isolate* isolate, RawArray* data) : BaseIterTable(isolate, data) {}
+  HashSet(Zone* zone, RawArray* data) : BaseIterTable(zone, data) {}
   bool Insert(const Object& key) {
     EnsureCapacity();
     intptr_t entry = -1;
@@ -683,7 +683,7 @@
  public:
   typedef HashSet<UnorderedHashTable<KeyTraits, 0> > BaseSet;
   explicit UnorderedHashSet(RawArray* data) : BaseSet(data) {}
-  UnorderedHashSet(Isolate* isolate, RawArray* data) : BaseSet(isolate, data) {}
+  UnorderedHashSet(Zone* zone, RawArray* data) : BaseSet(zone, data) {}
 };
 
 
@@ -692,7 +692,7 @@
  public:
   typedef HashSet<EnumIndexHashTable<KeyTraits, 0> > BaseSet;
   explicit EnumIndexHashSet(RawArray* data) : BaseSet(data) {}
-  EnumIndexHashSet(Isolate* isolate, RawArray* data) : BaseSet(isolate, data) {}
+  EnumIndexHashSet(Zone* zone, RawArray* data) : BaseSet(zone, data) {}
 };
 
 }  // namespace dart
diff --git a/runtime/vm/heap.cc b/runtime/vm/heap.cc
index 6897af8..2b319fd 100644
--- a/runtime/vm/heap.cc
+++ b/runtime/vm/heap.cc
@@ -91,12 +91,6 @@
 
 uword Heap::AllocateOld(intptr_t size, HeapPage::PageType type) {
   ASSERT(Thread::Current()->no_safepoint_scope_depth() == 0);
-#if defined(DEBUG)
-  // Currently, allocation from non-Dart threads must not trigger GC.
-  if (GrowthControlState()) {
-    isolate()->AssertCurrentThreadIsMutator();
-  }
-#endif
   uword addr = old_space_.TryAllocate(size, type);
   if (addr != 0) {
     return addr;
@@ -231,12 +225,15 @@
   MonitorLocker ml(old_space_->tasks_lock());
 #if defined(DEBUG)
   // We currently don't support nesting of HeapIterationScopes.
-  ASSERT(!old_space_->is_iterating_);
-  old_space_->is_iterating_ = true;
+  ASSERT(old_space_->iterating_thread_ != thread());
 #endif
   while (old_space_->tasks() > 0) {
     ml.Wait();
   }
+#if defined(DEBUG)
+  ASSERT(old_space_->iterating_thread_ == NULL);
+  old_space_->iterating_thread_ = thread();
+#endif
   old_space_->set_tasks(1);
 }
 
@@ -244,8 +241,8 @@
 HeapIterationScope::~HeapIterationScope() {
   MonitorLocker ml(old_space_->tasks_lock());
 #if defined(DEBUG)
-  ASSERT(old_space_->is_iterating_);
-  old_space_->is_iterating_ = false;
+  ASSERT(old_space_->iterating_thread_ == thread());
+  old_space_->iterating_thread_ = NULL;
 #endif
   ASSERT(old_space_->tasks() == 1);
   old_space_->set_tasks(0);
@@ -309,18 +306,38 @@
 }
 
 
+bool Heap::gc_in_progress() {
+  MutexLocker ml(&gc_in_progress_mutex_);
+  return gc_in_progress_;
+}
+
+
+void Heap::BeginGC() {
+  MutexLocker ml(&gc_in_progress_mutex_);
+  ASSERT(!gc_in_progress_);
+  gc_in_progress_ = true;
+}
+
+
+void Heap::EndGC() {
+  MutexLocker ml(&gc_in_progress_mutex_);
+  ASSERT(gc_in_progress_);
+  gc_in_progress_ = false;
+}
+
+
 void Heap::CollectGarbage(Space space,
                           ApiCallbacks api_callbacks,
                           GCReason reason) {
-  TIMERSCOPE(isolate(), time_gc);
+  Thread* thread = Thread::Current();
   bool invoke_api_callbacks = (api_callbacks == kInvokeApiCallbacks);
   switch (space) {
     case kNew: {
-      VMTagScope tagScope(isolate(), VMTag::kGCNewSpaceTagId);
-      TimelineDurationScope tds(isolate(),
+      RecordBeforeGC(kNew, reason);
+      VMTagScope tagScope(thread, VMTag::kGCNewSpaceTagId);
+      TimelineDurationScope tds(thread,
                                 isolate()->GetGCStream(),
                                 "CollectNewGeneration");
-      RecordBeforeGC(kNew, reason);
       UpdateClassHeapStatsBeforeGC(kNew);
       new_space_.Scavenge(invoke_api_callbacks);
       isolate()->class_table()->UpdatePromoted();
@@ -335,11 +352,11 @@
     }
     case kOld:
     case kCode: {
-      VMTagScope tagScope(isolate(), VMTag::kGCOldSpaceTagId);
-      TimelineDurationScope tds(isolate(),
+      RecordBeforeGC(kOld, reason);
+      VMTagScope tagScope(thread, VMTag::kGCOldSpaceTagId);
+      TimelineDurationScope tds(thread,
                                 isolate()->GetGCStream(),
                                 "CollectOldGeneration");
-      RecordBeforeGC(kOld, reason);
       UpdateClassHeapStatsBeforeGC(kOld);
       old_space_.MarkSweep(invoke_api_callbacks);
       RecordAfterGC();
@@ -373,13 +390,13 @@
 
 
 void Heap::CollectAllGarbage() {
-  TIMERSCOPE(isolate(), time_gc);
+  Thread* thread = Thread::Current();
   {
-    VMTagScope tagScope(isolate(), VMTag::kGCNewSpaceTagId);
-    TimelineDurationScope tds(isolate(),
+    RecordBeforeGC(kNew, kFull);
+    VMTagScope tagScope(thread, VMTag::kGCNewSpaceTagId);
+    TimelineDurationScope tds(thread,
                               isolate()->GetGCStream(),
                               "CollectNewGeneration");
-    RecordBeforeGC(kNew, kFull);
     UpdateClassHeapStatsBeforeGC(kNew);
     new_space_.Scavenge(kInvokeApiCallbacks);
     isolate()->class_table()->UpdatePromoted();
@@ -388,11 +405,11 @@
     PrintStats();
   }
   {
-    VMTagScope tagScope(isolate(), VMTag::kGCOldSpaceTagId);
-    TimelineDurationScope tds(isolate(),
+    RecordBeforeGC(kOld, kFull);
+    VMTagScope tagScope(thread, VMTag::kGCOldSpaceTagId);
+    TimelineDurationScope tds(thread,
                               isolate()->GetGCStream(),
                               "CollectOldGeneration");
-    RecordBeforeGC(kOld, kFull);
     UpdateClassHeapStatsBeforeGC(kOld);
     old_space_.MarkSweep(kInvokeApiCallbacks);
     RecordAfterGC();
@@ -413,11 +430,12 @@
 void Heap::UpdatePretenurePolicy() {
   if (FLAG_disable_alloc_stubs_after_gc) {
     ClassTable* table = isolate_->class_table();
+    Zone* zone = Thread::Current()->zone();
     for (intptr_t cid = 1; cid < table->NumCids(); ++cid) {
       if (((cid >= kNumPredefinedCids) || (cid == kArrayCid)) &&
           table->IsValidIndex(cid) &&
           table->HasValidClassAt(cid)) {
-        const Class& cls = Class::Handle(isolate_, table->At(cid));
+        const Class& cls = Class::Handle(zone, table->At(cid));
         cls.DisableAllocationStub();
       }
     }
@@ -435,6 +453,16 @@
 }
 
 
+void Heap::UpdateGlobalMaxUsed() {
+  ASSERT(isolate_ != NULL);
+  // We are accessing the used in words count for both new and old space
+  // without synchronizing. The value of this metric is approximate.
+  isolate_->GetHeapGlobalUsedMaxMetric()->SetValue(
+      (UsedInWords(Heap::kNew) * kWordSize) +
+      (UsedInWords(Heap::kOld) * kWordSize));
+}
+
+
 void Heap::SetGrowthControlState(bool state) {
   old_space_.SetGrowthControlState(state);
 }
@@ -550,8 +578,8 @@
 
 
 void Heap::PrintSizes() const {
-  OS::PrintErr("New space (%" Pd "k of %" Pd "k) "
-               "Old space (%" Pd "k of %" Pd "k)\n",
+  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),
@@ -559,21 +587,23 @@
 }
 
 
-intptr_t Heap::UsedInWords(Space space) const {
+int64_t Heap::UsedInWords(Space space) const {
   return space == kNew ? new_space_.UsedInWords() : old_space_.UsedInWords();
 }
 
 
-intptr_t Heap::CapacityInWords(Space space) const {
+int64_t Heap::CapacityInWords(Space space) const {
   return space == kNew ? new_space_.CapacityInWords() :
                          old_space_.CapacityInWords();
 }
 
-intptr_t Heap::ExternalInWords(Space space) const {
+
+int64_t Heap::ExternalInWords(Space space) const {
   return space == kNew ? new_space_.ExternalInWords() :
                          old_space_.ExternalInWords();
 }
 
+
 int64_t Heap::GCTimeInMicros(Space space) const {
   if (space == kNew) {
     return new_space_.gc_time_micros();
@@ -617,8 +647,20 @@
 
 
 int64_t Heap::HashCount() const {
-  return
-      new_weak_tables_[kHashes]->count() + old_weak_tables_[kHashes]->count();
+  return new_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();
+}
+
+
+void Heap::ResetObjectIdTable() {
+  new_weak_tables_[kObjectIds]->Reset();
+  old_weak_tables_[kObjectIds]->Reset();
 }
 
 
@@ -651,8 +693,7 @@
 
 
 void Heap::RecordBeforeGC(Space space, GCReason reason) {
-  ASSERT(!gc_in_progress_);
-  gc_in_progress_ = true;
+  BeginGC();
   stats_.num_++;
   stats_.space_ = space;
   stats_.reason_ = reason;
@@ -682,8 +723,7 @@
   }
   stats_.after_.new_ = new_space_.GetCurrentUsage();
   stats_.after_.old_ = old_space_.GetCurrentUsage();
-  ASSERT(gc_in_progress_);
-  gc_in_progress_ = false;
+  EndGC();
   if (Service::gc_stream.enabled()) {
     ServiceEvent event(Isolate::Current(), ServiceEvent::kGC);
     event.set_gc_stats(&stats_);
@@ -746,18 +786,6 @@
 }
 
 
-#if defined(DEBUG)
-NoSafepointScope::NoSafepointScope() : StackResource(Thread::Current()) {
-  thread()->IncrementNoSafepointScopeDepth();
-}
-
-
-NoSafepointScope::~NoSafepointScope() {
-  thread()->DecrementNoSafepointScopeDepth();
-}
-#endif  // defined(DEBUG)
-
-
 NoHeapGrowthControlScope::NoHeapGrowthControlScope()
     : StackResource(Isolate::Current()) {
     Heap* heap = reinterpret_cast<Isolate*>(isolate())->heap();
@@ -771,4 +799,16 @@
     heap->SetGrowthControlState(current_growth_controller_state_);
 }
 
+
+WritableVMIsolateScope::WritableVMIsolateScope(Thread* thread)
+    : StackResource(thread) {
+  Dart::vm_isolate()->heap()->WriteProtect(false);
+}
+
+
+WritableVMIsolateScope::~WritableVMIsolateScope() {
+  ASSERT(Dart::vm_isolate()->heap()->UsedInWords(Heap::kNew) == 0);
+  Dart::vm_isolate()->heap()->WriteProtect(true);
+}
+
 }  // namespace dart
diff --git a/runtime/vm/heap.h b/runtime/vm/heap.h
index 05e0ef0..22a109e 100644
--- a/runtime/vm/heap.h
+++ b/runtime/vm/heap.h
@@ -42,6 +42,7 @@
   enum WeakSelector {
     kPeers = 0,
     kHashes,
+    kObjectIds,
     kNumWeakSelectors
   };
 
@@ -133,7 +134,8 @@
   void SetGrowthControlState(bool state);
   bool GrowthControlState();
 
-  // Protect access to the heap.
+  // Protect access to the heap. Note: Code pages are made
+  // executable/non-executable when 'read_only' is true/false, respectively.
   void WriteProtect(bool read_only);
   void WriteProtectCode(bool read_only) {
     old_space_.WriteProtectCode(read_only);
@@ -157,9 +159,9 @@
   void PrintSizes() const;
 
   // Return amount of memory used and capacity in a space, excluding external.
-  intptr_t UsedInWords(Space space) const;
-  intptr_t CapacityInWords(Space space) const;
-  intptr_t ExternalInWords(Space space) const;
+  int64_t UsedInWords(Space space) const;
+  int64_t CapacityInWords(Space space) const;
+  int64_t ExternalInWords(Space space) const;
   // Return the amount of GCing in microseconds.
   int64_t GCTimeInMicros(Space space) const;
 
@@ -188,6 +190,17 @@
   }
   int64_t HashCount() const;
 
+  // Associate an id with an object (used when serializing an object).
+  // A non-existant id is equal to 0.
+  void SetObjectId(RawObject* raw_obj, intptr_t object_id) {
+    SetWeakEntry(raw_obj, kObjectIds, object_id);
+  }
+  intptr_t GetObjectId(RawObject* raw_obj) const {
+    return GetWeakEntry(raw_obj, kObjectIds);
+  }
+  int64_t ObjectIdCount() const;
+  void ResetObjectIdTable();
+
   // Used by the GC algorithms to propagate weak entries.
   intptr_t GetWeakEntry(RawObject* raw_obj, WeakSelector sel) const;
   void SetWeakEntry(RawObject* raw_obj, WeakSelector sel, intptr_t val);
@@ -219,7 +232,9 @@
     stats_.data_[id] = value;
   }
 
-  bool gc_in_progress() const { return gc_in_progress_; }
+  bool gc_in_progress();
+
+  void UpdateGlobalMaxUsed();
 
   static bool IsAllocatableInNewSpace(intptr_t size) {
     return size <= kNewAllocatableSize;
@@ -236,6 +251,10 @@
 
   bool ShouldPretenure(intptr_t class_id) const;
 
+  void SetupInstructionsSnapshotPage(void* pointer, uword size) {
+    old_space_.SetupInstructionsSnapshotPage(pointer, size);
+  }
+
  private:
   class GCStats : public ValueObject {
    public:
@@ -297,6 +316,10 @@
   void UpdateClassHeapStatsBeforeGC(Heap::Space space);
   void UpdatePretenurePolicy();
 
+  // Updates gc_in_progress.
+  void BeginGC();
+  void EndGC();
+
   // If this heap is non-empty, updates start and end to the smallest range that
   // contains both the original [start, end) and the [lowest, highest) addresses
   // of this heap.
@@ -318,6 +341,7 @@
   bool read_only_;
 
   // GC on the heap is in progress.
+  Mutex gc_in_progress_mutex_;
   bool gc_in_progress_;
 
   int pretenure_policy_;
@@ -328,26 +352,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)
-class NoSafepointScope : public StackResource {
- public:
-  NoSafepointScope();
-  ~NoSafepointScope();
- private:
-  DISALLOW_COPY_AND_ASSIGN(NoSafepointScope);
-};
-#else  // defined(DEBUG)
-class NoSafepointScope : public ValueObject {
- public:
-  NoSafepointScope() {}
- private:
-  DISALLOW_COPY_AND_ASSIGN(NoSafepointScope);
-};
-#endif  // defined(DEBUG)
-
-
 class HeapIterationScope : public StackResource {
  public:
   HeapIterationScope();
@@ -369,6 +373,14 @@
   DISALLOW_COPY_AND_ASSIGN(NoHeapGrowthControlScope);
 };
 
+
+// Note: During this scope, the code pages are non-executable.
+class WritableVMIsolateScope : StackResource {
+ public:
+  explicit WritableVMIsolateScope(Thread* thread);
+  ~WritableVMIsolateScope();
+};
+
 }  // namespace dart
 
 #endif  // VM_HEAP_H_
diff --git a/runtime/vm/heap_test.cc b/runtime/vm/heap_test.cc
index 47cfafe..e609901 100644
--- a/runtime/vm/heap_test.cc
+++ b/runtime/vm/heap_test.cc
@@ -12,6 +12,8 @@
 
 namespace dart {
 
+DECLARE_FLAG(int, marker_tasks);
+
 TEST_CASE(OldGC) {
   const char* kScriptChars =
   "main() {\n"
@@ -30,6 +32,25 @@
 }
 
 
+TEST_CASE(OldGC_Unsync) {
+  FLAG_marker_tasks = 0;
+  const char* kScriptChars =
+  "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);
+
+  EXPECT_VALID(result);
+  EXPECT(!Dart_IsNull(result));
+  EXPECT(Dart_IsList(result));
+  Isolate* isolate = Isolate::Current();
+  Heap* heap = isolate->heap();
+  heap->CollectGarbage(Heap::kOld);
+}
+
+
 TEST_CASE(LargeSweep) {
   const char* kScriptChars =
   "main() {\n"
diff --git a/runtime/vm/il_printer.cc b/runtime/vm/il_printer.cc
index 9c0a808..30c4a6f 100644
--- a/runtime/vm/il_printer.cc
+++ b/runtime/vm/il_printer.cc
@@ -83,11 +83,11 @@
 
 
 void FlowGraphPrinter::PrintGraph(const char* phase, FlowGraph* flow_graph) {
-  LogBlock lb(Isolate::Current());
-  ISL_Print("*** BEGIN CFG\n%s\n", phase);
+  LogBlock lb;
+  THR_Print("*** BEGIN CFG\n%s\n", phase);
   FlowGraphPrinter printer(*flow_graph);
   printer.PrintBlocks();
-  ISL_Print("*** END CFG\n");
+  THR_Print("*** END CFG\n");
   fflush(stdout);
 }
 
@@ -96,19 +96,19 @@
                                   bool print_locations) {
   // Print the block entry.
   PrintOneInstruction(block, print_locations);
-  ISL_Print("\n");
+  THR_Print("\n");
   // And all the successors in the block.
   for (ForwardInstructionIterator it(block); !it.Done(); it.Advance()) {
     Instruction* current = it.Current();
     PrintOneInstruction(current, print_locations);
-    ISL_Print("\n");
+    THR_Print("\n");
   }
 }
 
 
 void FlowGraphPrinter::PrintBlocks() {
   if (!function_.IsNull()) {
-    ISL_Print("==== %s\n", function_.ToFullyQualifiedCString());
+    THR_Print("==== %s\n", function_.ToFullyQualifiedCString());
   }
 
   for (intptr_t i = 0; i < block_order_.length(); ++i) {
@@ -134,12 +134,12 @@
     instr->locs()->PrintTo(&f);
   }
   if (instr->lifetime_position() != -1) {
-    ISL_Print("%3" Pd ": ", instr->lifetime_position());
+    THR_Print("%3" Pd ": ", instr->lifetime_position());
   }
-  if (!instr->IsBlockEntry()) ISL_Print("    ");
-  ISL_Print("%s", str);
+  if (!instr->IsBlockEntry()) THR_Print("    ");
+  THR_Print("%s", str);
   if (FLAG_trace_inlining_intervals) {
-    ISL_Print(" iid: %" Pd "", instr->inlining_id());
+    THR_Print(" iid: %" Pd "", instr->inlining_id());
   }
 }
 
@@ -154,7 +154,7 @@
     if (value != NULL && value->reaching_type_ != NULL) {
       compile_type_name = value->reaching_type_->ToCString();
     }
-    ISL_Print("%s type check: compile type %s is %s specific than "
+    THR_Print("%s type check: compile type %s is %s specific than "
               "type '%s' of '%s'.\n",
                          eliminated ? "Eliminated" : "Generated",
                          compile_type_name,
@@ -168,7 +168,7 @@
   const char* type_name = "?";
   if ((cid_ != kIllegalCid) && (cid_ != kDynamicCid)) {
     const Class& cls =
-      Class::Handle(Isolate::Current()->class_table()->At(cid_));
+        Class::Handle(Isolate::Current()->class_table()->At(cid_));
     type_name = String::Handle(cls.PrettyName()).ToCString();
   } else if (type_ != NULL &&
              !type_->Equals(Type::Handle(Type::DynamicType()))) {
@@ -228,17 +228,17 @@
   char buffer[1024];
   BufferFormatter f(buffer, sizeof(buffer));
   PrintICDataHelper(&f, ic_data);
-  ISL_Print("%s ", buffer);
+  THR_Print("%s ", buffer);
   const Array& a = Array::Handle(ic_data.arguments_descriptor());
-  ISL_Print(" arg-desc %" Pd "\n", a.Length());
+  THR_Print(" arg-desc %" Pd "\n", a.Length());
 }
 
 
 static void PrintUse(BufferFormatter* f, const Definition& definition) {
   if (definition.HasSSATemp()) {
     if (definition.HasPairRepresentation()) {
-      f->Print("v%" Pd ", v%" Pd "", definition.ssa_temp_index(),
-                                     definition.ssa_temp_index() + 1);
+      f->Print("(v%" Pd ", v%" Pd ")", definition.ssa_temp_index(),
+                                       definition.ssa_temp_index() + 1);
     } else {
       f->Print("v%" Pd "", definition.ssa_temp_index());
     }
@@ -257,7 +257,7 @@
 
 
 void Instruction::PrintTo(BufferFormatter* f) const {
-  if (GetDeoptId() != Isolate::kNoDeoptId) {
+  if (GetDeoptId() != Thread::kNoDeoptId) {
     f->Print("%s:%" Pd "(", DebugName(), GetDeoptId());
   } else {
     f->Print("%s(", DebugName());
@@ -278,7 +278,7 @@
 void Definition::PrintTo(BufferFormatter* f) const {
   PrintUse(f, *this);
   if (HasSSATemp() || HasTemp()) f->Print(" <- ");
-  if (GetDeoptId() != Isolate::kNoDeoptId) {
+  if (GetDeoptId() != Thread::kNoDeoptId) {
     f->Print("%s:%" Pd "(", DebugName(), GetDeoptId());
   } else {
     f->Print("%s(", DebugName());
@@ -1050,7 +1050,12 @@
 
 
 void PhiInstr::PrintTo(BufferFormatter* f) const {
-  f->Print("v%" Pd " <- phi(", ssa_temp_index());
+  if (HasPairRepresentation()) {
+    f->Print("(v%" Pd ", v%" Pd ") <- phi(",
+             ssa_temp_index(), ssa_temp_index() + 1);
+  } else {
+    f->Print("v%" Pd " <- phi(", ssa_temp_index());
+  }
   for (intptr_t i = 0; i < inputs_.length(); ++i) {
     if (inputs_[i] != NULL) inputs_[i]->PrintTo(f);
     if (i < inputs_.length() - 1) f->Print(", ");
@@ -1150,7 +1155,7 @@
     parallel_move()->PrintTo(f);
     f->Print(" ");
   }
-  if (GetDeoptId() != Isolate::kNoDeoptId) {
+  if (GetDeoptId() != Thread::kNoDeoptId) {
     f->Print("goto:%" Pd " B%" Pd "", GetDeoptId(), successor()->block_id());
   } else {
     f->Print("goto: B%" Pd "", successor()->block_id());
@@ -1159,7 +1164,7 @@
 
 
 void IndirectGotoInstr::PrintTo(BufferFormatter* f) const {
-  if (GetDeoptId() != Isolate::kNoDeoptId) {
+  if (GetDeoptId() != Thread::kNoDeoptId) {
     f->Print("igoto:%" Pd "(", GetDeoptId());
   } else {
     f->Print("igoto:(");
diff --git a/runtime/vm/instructions_arm.cc b/runtime/vm/instructions_arm.cc
index 6709c19..eec6cfe 100644
--- a/runtime/vm/instructions_arm.cc
+++ b/runtime/vm/instructions_arm.cc
@@ -16,10 +16,8 @@
 CallPattern::CallPattern(uword pc, const Code& code)
     : object_pool_(ObjectPool::Handle(code.GetObjectPool())),
       end_(pc),
-      args_desc_load_end_(0),
       ic_data_load_end_(0),
-      target_address_pool_index_(-1),
-      args_desc_(Array::Handle()),
+      target_code_pool_index_(-1),
       ic_data_(ICData::Handle()) {
   ASSERT(code.ContainsInstructionAt(pc));
   // Last instruction: blx lr.
@@ -27,23 +25,73 @@
 
   Register reg;
   ic_data_load_end_ =
-      InstructionPattern::DecodeLoadWordFromPool(end_ - Instr::kInstrSize,
+      InstructionPattern::DecodeLoadWordFromPool(end_ - 2 * Instr::kInstrSize,
                                                  &reg,
-                                                 &target_address_pool_index_);
-  ASSERT(reg == LR);
+                                                 &target_code_pool_index_);
+  ASSERT(reg == CODE_REG);
 }
 
 
-int CallPattern::LengthInBytes() {
+int CallPattern::DeoptCallPatternLengthInInstructions() {
   const ARMVersion version = TargetCPUFeatures::arm_version();
   if ((version == ARMv5TE) || (version == ARMv6)) {
-    return 5 * Instr::kInstrSize;
+    return 5;
   } else {
     ASSERT(version == ARMv7);
-    return 3 * Instr::kInstrSize;
+    return 3;
   }
 }
 
+int CallPattern::DeoptCallPatternLengthInBytes() {
+  return DeoptCallPatternLengthInInstructions() * Instr::kInstrSize;
+}
+
+
+NativeCallPattern::NativeCallPattern(uword pc, const Code& code)
+    : object_pool_(ObjectPool::Handle(code.GetObjectPool())),
+      end_(pc),
+      native_function_pool_index_(-1),
+      target_code_pool_index_(-1) {
+  ASSERT(code.ContainsInstructionAt(pc));
+  // Last instruction: blx lr.
+  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_);
+  ASSERT(reg == CODE_REG);
+  InstructionPattern::DecodeLoadWordFromPool(native_function_load_end,
+                                             &reg,
+                                             &native_function_pool_index_);
+  ASSERT(reg == R5);
+}
+
+
+RawCode* NativeCallPattern::target() const {
+  return reinterpret_cast<RawCode*>(
+      object_pool_.ObjectAt(target_code_pool_index_));
+}
+
+
+void NativeCallPattern::set_target(const Code& new_target) const {
+  object_pool_.SetObjectAt(target_code_pool_index_, new_target);
+  // No need to flush the instruction cache, since the code is not modified.
+}
+
+
+NativeFunction NativeCallPattern::native_function() const {
+  return reinterpret_cast<NativeFunction>(
+      object_pool_.RawValueAt(native_function_pool_index_));
+}
+
+
+void NativeCallPattern::set_native_function(NativeFunction func) const {
+  object_pool_.SetRawValueAt(native_function_pool_index_,
+      reinterpret_cast<uword>(func));
+}
+
 
 // Decodes a load sequence ending at 'end' (the last instruction of the load
 // sequence is the instruction before the one at end).  Returns a pointer to
@@ -132,7 +180,7 @@
   uword start = end - Instr::kInstrSize;
   int32_t instr = Instr::At(start)->InstructionBits();
   intptr_t offset = 0;
-  if ((instr & 0xffff0000) == 0xe59a0000) {  // ldr reg, [pp, #+offset]
+  if ((instr & 0xffff0000) == 0xe5990000) {  // ldr reg, [pp, #+offset]
     offset = instr & 0xfff;
     *reg = static_cast<Register>((instr & 0xf000) >> 12);
   } else {
@@ -140,19 +188,17 @@
     offset = instr & 0xfff;
     start -= Instr::kInstrSize;
     instr = Instr::At(start)->InstructionBits();
-    if ((instr & 0xffff0000) == 0xe28a0000) {  // add reg, pp, operand
+    if ((instr & 0xffff0000) == 0xe2890000) {  // add reg, pp, operand
       const intptr_t rot = (instr & 0xf00) >> 7;
       const intptr_t imm8 = instr & 0xff;
       offset += (imm8 >> rot) | (imm8 << (32 - rot));
       *reg = static_cast<Register>((instr & 0xf000) >> 12);
     } else {
-      ASSERT((instr & 0xffff0000) == 0xe08a0000);  // add reg, pp, reg
+      ASSERT((instr & 0xffff0000) == 0xe0890000);  // add reg, pp, reg
       end = DecodeLoadWordImmediate(end, reg, &offset);
     }
   }
-  offset += kHeapObjectTag;
-  ASSERT(Utils::IsAligned(offset, 4));
-  *index = (offset - Array::data_offset()) / 4;
+  *index = ObjectPool::IndexFromOffset(offset);
   return start;
 }
 
@@ -160,43 +206,28 @@
 RawICData* CallPattern::IcData() {
   if (ic_data_.IsNull()) {
     Register reg;
-    args_desc_load_end_ =
-        InstructionPattern::DecodeLoadObject(ic_data_load_end_,
-                                             object_pool_,
-                                             &reg,
-                                             &ic_data_);
+    InstructionPattern::DecodeLoadObject(ic_data_load_end_,
+                                         object_pool_,
+                                         &reg,
+                                         &ic_data_);
     ASSERT(reg == R5);
   }
   return ic_data_.raw();
 }
 
 
-RawArray* CallPattern::ClosureArgumentsDescriptor() {
-  if (args_desc_.IsNull()) {
-    IcData();  // Loading of the ic_data must be decoded first, if not already.
-    Register reg;
-    InstructionPattern::DecodeLoadObject(args_desc_load_end_,
-                                         object_pool_,
-                                         &reg,
-                                         &args_desc_);
-    ASSERT(reg == R4);
-  }
-  return args_desc_.raw();
+RawCode* CallPattern::TargetCode() const {
+  return reinterpret_cast<RawCode*>(
+      object_pool_.ObjectAt(target_code_pool_index_));
 }
 
 
-uword CallPattern::TargetAddress() const {
-  return object_pool_.RawValueAt(target_address_pool_index_);
+void CallPattern::SetTargetCode(const Code& target_code) const {
+  object_pool_.SetObjectAt(target_code_pool_index_, target_code);
 }
 
 
-void CallPattern::SetTargetAddress(uword target_address) const {
-  object_pool_.SetRawValueAt(target_address_pool_index_, target_address);
-  // No need to flush the instruction cache, since the code is not modified.
-}
-
-
-void CallPattern::InsertAt(uword pc, uword target_address) {
+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);
@@ -216,8 +247,8 @@
     *reinterpret_cast<uword*>(pc + (3 * Instr::kInstrSize)) = or3_ip;
     *reinterpret_cast<uword*>(pc + (4 * Instr::kInstrSize)) = blx_ip;
 
-    ASSERT(LengthInBytes() == 5 * Instr::kInstrSize);
-    CPU::FlushICache(pc, LengthInBytes());
+    ASSERT(DeoptCallPatternLengthInBytes() == 5 * Instr::kInstrSize);
+    CPU::FlushICache(pc, DeoptCallPatternLengthInBytes());
   } else {
     ASSERT(version == ARMv7);
     const uint16_t target_lo = target_address & 0xffff;
@@ -233,106 +264,8 @@
     *reinterpret_cast<uword*>(pc + (1 * Instr::kInstrSize)) = movt_ip;
     *reinterpret_cast<uword*>(pc + (2 * Instr::kInstrSize)) = blx_ip;
 
-    ASSERT(LengthInBytes() == 3 * Instr::kInstrSize);
-    CPU::FlushICache(pc, LengthInBytes());
-  }
-}
-
-
-JumpPattern::JumpPattern(uword pc, const Code& code) : pc_(pc) { }
-
-
-int JumpPattern::pattern_length_in_bytes() {
-  const ARMVersion version = TargetCPUFeatures::arm_version();
-  if ((version == ARMv5TE) || (version == ARMv6)) {
-    return 5 * Instr::kInstrSize;
-  } else {
-    ASSERT(version == ARMv7);
-    return 3 * Instr::kInstrSize;
-  }
-}
-
-
-bool JumpPattern::IsValid() const {
-  const ARMVersion version = TargetCPUFeatures::arm_version();
-  if ((version == ARMv5TE) || (version == ARMv6)) {
-    Instr* mov_ip = Instr::At(pc_ + (0 * Instr::kInstrSize));
-    Instr* or1_ip = Instr::At(pc_ + (1 * Instr::kInstrSize));
-    Instr* or2_ip = Instr::At(pc_ + (2 * Instr::kInstrSize));
-    Instr* or3_ip = Instr::At(pc_ + (3 * Instr::kInstrSize));
-    Instr* bx_ip = Instr::At(pc_ + (4 * Instr::kInstrSize));
-    return ((mov_ip->InstructionBits() & 0xffffff00) == 0xe3a0c400) &&
-           ((or1_ip->InstructionBits() & 0xffffff00) == 0xe38cc800) &&
-           ((or2_ip->InstructionBits() & 0xffffff00) == 0xe38ccc00) &&
-           ((or3_ip->InstructionBits() & 0xffffff00) == 0xe38cc000) &&
-           ((bx_ip->InstructionBits() & 0xffffffff) == 0xe12fff1c);
-  } else {
-    ASSERT(version == ARMv7);
-    Instr* movw_ip = Instr::At(pc_ + (0 * Instr::kInstrSize));  // target_lo
-    Instr* movt_ip = Instr::At(pc_ + (1 * Instr::kInstrSize));  // target_hi
-    Instr* bx_ip = Instr::At(pc_ + (2 * Instr::kInstrSize));
-    return (movw_ip->InstructionBits() & 0xfff0f000) == 0xe300c000 &&
-           (movt_ip->InstructionBits() & 0xfff0f000) == 0xe340c000 &&
-           (bx_ip->InstructionBits() & 0xffffffff) == 0xe12fff1c;
-  }
-}
-
-
-uword JumpPattern::TargetAddress() const {
-  const ARMVersion version = TargetCPUFeatures::arm_version();
-  if ((version == ARMv5TE) || (version == ARMv6)) {
-    Instr* mov_ip = Instr::At(pc_ + (0 * Instr::kInstrSize));
-    Instr* or1_ip = Instr::At(pc_ + (1 * Instr::kInstrSize));
-    Instr* or2_ip = Instr::At(pc_ + (2 * Instr::kInstrSize));
-    Instr* or3_ip = Instr::At(pc_ + (3 * Instr::kInstrSize));
-    uword imm = 0;
-    imm |= or3_ip->Immed8Field();
-    imm |= or2_ip->Immed8Field() << 8;
-    imm |= or1_ip->Immed8Field() << 16;
-    imm |= mov_ip->Immed8Field() << 24;
-    return imm;
-  } else {
-    ASSERT(version == ARMv7);
-    Instr* movw_ip = Instr::At(pc_ + (0 * Instr::kInstrSize));  // target_lo
-    Instr* movt_ip = Instr::At(pc_ + (1 * Instr::kInstrSize));  // target_hi
-    uint16_t target_lo = movw_ip->MovwField();
-    uint16_t target_hi = movt_ip->MovwField();
-    return (target_hi << 16) | target_lo;
-  }
-}
-
-
-void JumpPattern::SetTargetAddress(uword target_address) const {
-  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
-
-    *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;
-    CPU::FlushICache(pc_, 4 * Instr::kInstrSize);
-  } 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);
-
-    *reinterpret_cast<uword*>(pc_ + (0 * Instr::kInstrSize)) = movw_ip;
-    *reinterpret_cast<uword*>(pc_ + (1 * Instr::kInstrSize)) = movt_ip;
-    CPU::FlushICache(pc_, 2 * Instr::kInstrSize);
+    ASSERT(DeoptCallPatternLengthInBytes() == 3 * Instr::kInstrSize);
+    CPU::FlushICache(pc, DeoptCallPatternLengthInBytes());
   }
 }
 
diff --git a/runtime/vm/instructions_arm.h b/runtime/vm/instructions_arm.h
index 4d708ca..ad82da1 100644
--- a/runtime/vm/instructions_arm.h
+++ b/runtime/vm/instructions_arm.h
@@ -11,6 +11,7 @@
 #endif
 
 #include "vm/constants_arm.h"
+#include "vm/native_entry.h"
 #include "vm/object.h"
 
 namespace dart {
@@ -52,48 +53,48 @@
   CallPattern(uword pc, const Code& code);
 
   RawICData* IcData();
-  RawArray* ClosureArgumentsDescriptor();
 
-  uword TargetAddress() const;
-  void SetTargetAddress(uword target_address) const;
+  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 LengthInBytes();
+  static int DeoptCallPatternLengthInBytes();
+  static int DeoptCallPatternLengthInInstructions();
 
-  static void InsertAt(uword pc, uword target_address);
+  static void InsertDeoptCallAt(uword pc, uword target_address);
 
  private:
   const ObjectPool& object_pool_;
 
   uword end_;
-  uword args_desc_load_end_;
   uword ic_data_load_end_;
 
-  intptr_t target_address_pool_index_;
-  Array& args_desc_;
+  intptr_t target_code_pool_index_;
   ICData& ic_data_;
 
   DISALLOW_COPY_AND_ASSIGN(CallPattern);
 };
 
 
-class JumpPattern : public ValueObject {
+class NativeCallPattern : public ValueObject {
  public:
-  JumpPattern(uword pc, const Code& code);
+  NativeCallPattern(uword pc, const Code& code);
 
-  static const int kLengthInBytes = 3 * Instr::kInstrSize;
+  RawCode* target() const;
+  void set_target(const Code& target) const;
 
-  static int pattern_length_in_bytes();
-
-  bool IsValid() const;
-  uword TargetAddress() const;
-  void SetTargetAddress(uword target_address) const;
+  NativeFunction native_function() const;
+  void set_native_function(NativeFunction target) const;
 
  private:
-  const uword pc_;
+  const ObjectPool& object_pool_;
 
-  DISALLOW_COPY_AND_ASSIGN(JumpPattern);
+  uword end_;
+  intptr_t native_function_pool_index_;
+  intptr_t target_code_pool_index_;
+
+  DISALLOW_COPY_AND_ASSIGN(NativeCallPattern);
 };
 
 
diff --git a/runtime/vm/instructions_arm64.cc b/runtime/vm/instructions_arm64.cc
index 1690456..62b3ff2 100644
--- a/runtime/vm/instructions_arm64.cc
+++ b/runtime/vm/instructions_arm64.cc
@@ -16,10 +16,8 @@
 CallPattern::CallPattern(uword pc, const Code& code)
     : object_pool_(ObjectPool::Handle(code.GetObjectPool())),
       end_(pc),
-      args_desc_load_end_(0),
       ic_data_load_end_(0),
-      target_address_pool_index_(-1),
-      args_desc_(Array::Handle()),
+      target_code_pool_index_(-1),
       ic_data_(ICData::Handle()) {
   ASSERT(code.ContainsInstructionAt(pc));
   // Last instruction: blr ip0.
@@ -27,10 +25,56 @@
 
   Register reg;
   ic_data_load_end_ =
-      InstructionPattern::DecodeLoadWordFromPool(end_ - Instr::kInstrSize,
+      InstructionPattern::DecodeLoadWordFromPool(end_ - 2 * Instr::kInstrSize,
                                                  &reg,
-                                                 &target_address_pool_index_);
-  ASSERT(reg == IP0);
+                                                 &target_code_pool_index_);
+  ASSERT(reg == CODE_REG);
+}
+
+
+NativeCallPattern::NativeCallPattern(uword pc, const Code& code)
+    : object_pool_(ObjectPool::Handle(code.GetObjectPool())),
+      end_(pc),
+      native_function_pool_index_(-1),
+      target_code_pool_index_(-1) {
+  ASSERT(code.ContainsInstructionAt(pc));
+  // Last instruction: blr ip0.
+  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_);
+  ASSERT(reg == CODE_REG);
+  InstructionPattern::DecodeLoadWordFromPool(native_function_load_end,
+                                             &reg,
+                                             &native_function_pool_index_);
+  ASSERT(reg == R5);
+}
+
+
+RawCode* NativeCallPattern::target() const {
+  return reinterpret_cast<RawCode*>(
+      object_pool_.ObjectAt(target_code_pool_index_));
+}
+
+
+void NativeCallPattern::set_target(const Code& target) const {
+  object_pool_.SetObjectAt(target_code_pool_index_, target);
+  // No need to flush the instruction cache, since the code is not modified.
+}
+
+
+NativeFunction NativeCallPattern::native_function() const {
+  return reinterpret_cast<NativeFunction>(
+      object_pool_.RawValueAt(native_function_pool_index_));
+}
+
+
+void NativeCallPattern::set_native_function(NativeFunction func) const {
+  object_pool_.SetRawValueAt(native_function_pool_index_,
+      reinterpret_cast<uword>(func));
 }
 
 
@@ -208,8 +252,9 @@
       offset |= instr->Imm16Field();
     }
   }
+  // PP is untagged on ARM64.
   ASSERT(Utils::IsAligned(offset, 8));
-  *index = (offset - Array::data_offset()) / 8;
+  *index = ObjectPool::IndexFromOffset(offset - kHeapObjectTag);
   return start;
 }
 
@@ -238,43 +283,29 @@
 RawICData* CallPattern::IcData() {
   if (ic_data_.IsNull()) {
     Register reg;
-    args_desc_load_end_ =
-        InstructionPattern::DecodeLoadObject(ic_data_load_end_,
-                                             object_pool_,
-                                             &reg,
-                                             &ic_data_);
+    InstructionPattern::DecodeLoadObject(ic_data_load_end_,
+                                         object_pool_,
+                                         &reg,
+                                         &ic_data_);
     ASSERT(reg == R5);
   }
   return ic_data_.raw();
 }
 
 
-RawArray* CallPattern::ClosureArgumentsDescriptor() {
-  if (args_desc_.IsNull()) {
-    IcData();  // Loading of the ic_data must be decoded first, if not already.
-    Register reg;
-    InstructionPattern::DecodeLoadObject(args_desc_load_end_,
-                                         object_pool_,
-                                         &reg,
-                                         &args_desc_);
-    ASSERT(reg == R4);
-  }
-  return args_desc_.raw();
+RawCode* CallPattern::TargetCode() const {
+  return reinterpret_cast<RawCode*>(
+      object_pool_.ObjectAt(target_code_pool_index_));
 }
 
 
-uword CallPattern::TargetAddress() const {
-  return object_pool_.RawValueAt(target_address_pool_index_);
-}
-
-
-void CallPattern::SetTargetAddress(uword target_address) const {
-  object_pool_.SetRawValueAt(target_address_pool_index_, target_address);
+void CallPattern::SetTargetCode(const Code& target) const {
+  object_pool_.SetObjectAt(target_code_pool_index_, target);
   // No need to flush the instruction cache, since the code is not modified.
 }
 
 
-void CallPattern::InsertAt(uword pc, uword target_address) {
+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));
@@ -293,68 +324,8 @@
   movk3->SetMoveWideBits(MOVK, IP0, h3, 3, kDoubleWord);
   blr->SetUnconditionalBranchRegBits(BLR, IP0);
 
-  ASSERT(kLengthInBytes == 5 * Instr::kInstrSize);
-  CPU::FlushICache(pc, kLengthInBytes);
-}
-
-
-JumpPattern::JumpPattern(uword pc, const Code& code) : pc_(pc) { }
-
-
-bool JumpPattern::IsValid() const {
-  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* br = Instr::At(pc_ + (4 * Instr::kInstrSize));
-  return (movz0->IsMoveWideOp()) && (movz0->Bits(29, 2) == 2) &&
-         (movk1->IsMoveWideOp()) && (movk1->Bits(29, 2) == 3) &&
-         (movk2->IsMoveWideOp()) && (movk2->Bits(29, 2) == 3) &&
-         (movk3->IsMoveWideOp()) && (movk3->Bits(29, 2) == 3) &&
-         (br->IsUnconditionalBranchRegOp()) && (br->Bits(16, 5) == 31);
-}
-
-
-uword JumpPattern::TargetAddress() const {
-  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));
-  const uint16_t imm0 = movz0->Imm16Field();
-  const uint16_t imm1 = movk1->Imm16Field();
-  const uint16_t imm2 = movk2->Imm16Field();
-  const uint16_t imm3 = movk3->Imm16Field();
-  const int64_t target =
-      (static_cast<int64_t>(imm0)) |
-      (static_cast<int64_t>(imm1) << 16) |
-      (static_cast<int64_t>(imm2) << 32) |
-      (static_cast<int64_t>(imm3) << 48);
-  return target;
-}
-
-
-void JumpPattern::SetTargetAddress(uword target_address) const {
-  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));
-  const int32_t movz0_bits = movz0->InstructionBits();
-  const int32_t movk1_bits = movk1->InstructionBits();
-  const int32_t movk2_bits = movk2->InstructionBits();
-  const int32_t movk3_bits = movk3->InstructionBits();
-
-  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->SetInstructionBits((movz0_bits & ~kImm16Mask) | (h0 << kImm16Shift));
-  movk1->SetInstructionBits((movk1_bits & ~kImm16Mask) | (h1 << kImm16Shift));
-  movk2->SetInstructionBits((movk2_bits & ~kImm16Mask) | (h2 << kImm16Shift));
-  movk3->SetInstructionBits((movk3_bits & ~kImm16Mask) | (h3 << kImm16Shift));
-  CPU::FlushICache(pc_, 4 * Instr::kInstrSize);
+  ASSERT(kDeoptCallLengthInBytes == 5 * Instr::kInstrSize);
+  CPU::FlushICache(pc, kDeoptCallLengthInBytes);
 }
 
 
diff --git a/runtime/vm/instructions_arm64.h b/runtime/vm/instructions_arm64.h
index 568d57e..0d2c96d 100644
--- a/runtime/vm/instructions_arm64.h
+++ b/runtime/vm/instructions_arm64.h
@@ -11,6 +11,7 @@
 #endif
 
 #include "vm/constants_arm64.h"
+#include "vm/native_entry.h"
 #include "vm/object.h"
 
 namespace dart {
@@ -59,50 +60,49 @@
   CallPattern(uword pc, const Code& code);
 
   RawICData* IcData();
-  RawArray* ClosureArgumentsDescriptor();
 
-  uword TargetAddress() const;
-  void SetTargetAddress(uword target_address) const;
+  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 kLengthInBytes = 5 * Instr::kInstrSize;
+  static const int kDeoptCallLengthInInstructions = 5;
+  static const int kDeoptCallLengthInBytes =
+      kDeoptCallLengthInInstructions * Instr::kInstrSize;
 
-  static void InsertAt(uword pc, uword target_address);
+  static void InsertDeoptCallAt(uword pc, uword target_address);
 
  private:
   const ObjectPool& object_pool_;
 
   uword end_;
-  uword args_desc_load_end_;
   uword ic_data_load_end_;
 
-  intptr_t target_address_pool_index_;
-  Array& args_desc_;
+  intptr_t target_code_pool_index_;
   ICData& ic_data_;
 
   DISALLOW_COPY_AND_ASSIGN(CallPattern);
 };
 
 
-class JumpPattern : public ValueObject {
+class NativeCallPattern : public ValueObject {
  public:
-  JumpPattern(uword pc, const Code& code);
+  NativeCallPattern(uword pc, const Code& code);
 
-  static const int kLengthInBytes = 5 * Instr::kInstrSize;
+  RawCode* target() const;
+  void set_target(const Code& target) const;
 
-  int pattern_length_in_bytes() const {
-    return kLengthInBytes;
-  }
-
-  bool IsValid() const;
-  uword TargetAddress() const;
-  void SetTargetAddress(uword target_address) const;
+  NativeFunction native_function() const;
+  void set_native_function(NativeFunction target) const;
 
  private:
-  const uword pc_;
+  const ObjectPool& object_pool_;
 
-  DISALLOW_COPY_AND_ASSIGN(JumpPattern);
+  uword end_;
+  intptr_t native_function_pool_index_;
+  intptr_t target_code_pool_index_;
+
+  DISALLOW_COPY_AND_ASSIGN(NativeCallPattern);
 };
 
 
diff --git a/runtime/vm/instructions_arm64_test.cc b/runtime/vm/instructions_arm64_test.cc
index 924d495..970d271 100644
--- a/runtime/vm/instructions_arm64_test.cc
+++ b/runtime/vm/instructions_arm64_test.cc
@@ -29,42 +29,11 @@
   // before the end of the code buffer.
   CallPattern call(test->entry() + test->code().Size() - Instr::kInstrSize,
                    test->code());
-  EXPECT_EQ(StubCode::InvokeDartCode_entry()->label().address(),
-            call.TargetAddress());
+  EXPECT_EQ(StubCode::InvokeDartCode_entry()->code(),
+            call.TargetCode());
 }
 
 
-ASSEMBLER_TEST_GENERATE(Jump, assembler) {
-  __ BranchPatchable(*StubCode::InvokeDartCode_entry());
-  __ BranchPatchable(*StubCode::AllocateArray_entry());
-}
-
-
-ASSEMBLER_TEST_RUN(Jump, test) {
-  const Code& code = test->code();
-  const Instructions& instrs = Instructions::Handle(code.instructions());
-  bool status =
-      VirtualMemory::Protect(reinterpret_cast<void*>(instrs.EntryPoint()),
-                             instrs.size(),
-                             VirtualMemory::kReadWrite);
-  EXPECT(status);
-  JumpPattern jump1(test->entry(), test->code());
-  EXPECT_EQ(StubCode::InvokeDartCode_entry()->label().address(),
-            jump1.TargetAddress());
-  JumpPattern jump2(test->entry() + jump1.pattern_length_in_bytes(),
-                    test->code());
-  const Code& array_stub =
-      Code::Handle(StubCode::AllocateArray_entry()->code());
-  EXPECT_EQ(array_stub.EntryPoint(), jump2.TargetAddress());
-  uword target1 = jump1.TargetAddress();
-  uword target2 = jump2.TargetAddress();
-  jump1.SetTargetAddress(target2);
-  jump2.SetTargetAddress(target1);
-  EXPECT_EQ(array_stub.EntryPoint(), jump1.TargetAddress());
-  EXPECT_EQ(StubCode::InvokeDartCode_entry()->label().address(),
-            jump2.TargetAddress());
-}
-
 }  // namespace dart
 
 #endif  // defined TARGET_ARCH_ARM64
diff --git a/runtime/vm/instructions_arm_test.cc b/runtime/vm/instructions_arm_test.cc
index 540fd5f..de3ff6f 100644
--- a/runtime/vm/instructions_arm_test.cc
+++ b/runtime/vm/instructions_arm_test.cc
@@ -29,81 +29,9 @@
   // before the end of the code buffer.
   CallPattern call(test->entry() + test->code().Size() - Instr::kInstrSize,
                    test->code());
-  EXPECT_EQ(StubCode::InvokeDartCode_entry()->label().address(),
-            call.TargetAddress());
+  EXPECT_EQ(StubCode::InvokeDartCode_entry()->code(), call.TargetCode());
 }
 
-
-ASSEMBLER_TEST_GENERATE(Jump, assembler) {
-  __ BranchPatchable(*StubCode::InvokeDartCode_entry());
-  __ BranchPatchable(*StubCode::AllocateArray_entry());
-}
-
-
-ASSEMBLER_TEST_RUN(Jump, test) {
-  const Code& code = test->code();
-  const Instructions& instrs = Instructions::Handle(code.instructions());
-  bool status =
-      VirtualMemory::Protect(reinterpret_cast<void*>(instrs.EntryPoint()),
-                             instrs.size(),
-                             VirtualMemory::kReadWrite);
-  EXPECT(status);
-  JumpPattern jump1(test->entry(), test->code());
-  EXPECT_EQ(StubCode::InvokeDartCode_entry()->label().address(),
-            jump1.TargetAddress());
-  JumpPattern jump2(test->entry() + jump1.pattern_length_in_bytes(),
-                    test->code());
-  const Code& array_stub =
-      Code::Handle(StubCode::AllocateArray_entry()->code());
-  EXPECT_EQ(array_stub.EntryPoint(), jump2.TargetAddress());
-  uword target1 = jump1.TargetAddress();
-  uword target2 = jump2.TargetAddress();
-  jump1.SetTargetAddress(target2);
-  jump2.SetTargetAddress(target1);
-  EXPECT_EQ(array_stub.EntryPoint(), jump1.TargetAddress());
-  EXPECT_EQ(StubCode::InvokeDartCode_entry()->label().address(),
-            jump2.TargetAddress());
-}
-
-
-#if defined(USING_SIMULATOR)
-ASSEMBLER_TEST_GENERATE(JumpARMv6, assembler) {
-  // ARMv7 is the default.
-  HostCPUFeatures::set_arm_version(ARMv6);
-  __ BranchPatchable(*StubCode::InvokeDartCode_entry());
-  __ BranchPatchable(*StubCode::AllocateArray_entry());
-  HostCPUFeatures::set_arm_version(ARMv7);
-}
-
-
-ASSEMBLER_TEST_RUN(JumpARMv6, test) {
-  HostCPUFeatures::set_arm_version(ARMv6);
-  const Code& code = test->code();
-  const Instructions& instrs = Instructions::Handle(code.instructions());
-  bool status =
-      VirtualMemory::Protect(reinterpret_cast<void*>(instrs.EntryPoint()),
-                             instrs.size(),
-                             VirtualMemory::kReadWrite);
-  EXPECT(status);
-  JumpPattern jump1(test->entry(), test->code());
-  EXPECT_EQ(StubCode::InvokeDartCode_entry()->label().address(),
-            jump1.TargetAddress());
-  JumpPattern jump2(test->entry() + jump1.pattern_length_in_bytes(),
-                    test->code());
-  const Code& array_stub =
-      Code::Handle(StubCode::AllocateArray_entry()->code());
-  EXPECT_EQ(array_stub.EntryPoint(), jump2.TargetAddress());
-  uword target1 = jump1.TargetAddress();
-  uword target2 = jump2.TargetAddress();
-  jump1.SetTargetAddress(target2);
-  jump2.SetTargetAddress(target1);
-  EXPECT_EQ(array_stub.EntryPoint(), jump1.TargetAddress());
-  EXPECT_EQ(StubCode::InvokeDartCode_entry()->label().address(),
-            jump2.TargetAddress());
-  HostCPUFeatures::set_arm_version(ARMv7);
-}
-#endif
-
 }  // namespace dart
 
 #endif  // defined TARGET_ARCH_ARM
diff --git a/runtime/vm/instructions_ia32.cc b/runtime/vm/instructions_ia32.cc
index 4093e20..84ba433 100644
--- a/runtime/vm/instructions_ia32.cc
+++ b/runtime/vm/instructions_ia32.cc
@@ -11,61 +11,6 @@
 
 namespace dart {
 
-bool InstructionPattern::TestBytesWith(const int* data, int num_bytes) const {
-  ASSERT(data != NULL);
-  const uint8_t* byte_array = reinterpret_cast<const uint8_t*>(start_);
-  for (int i = 0; i < num_bytes; i++) {
-    // Skip comparison for data[i] < 0.
-    if ((data[i] >= 0) && (byte_array[i] != (0xFF & data[i]))) {
-      return false;
-    }
-  }
-  return true;
-}
-
-
-uword CallOrJumpPattern::TargetAddress() const {
-  ASSERT(IsValid());
-  return start() + kLengthInBytes + *reinterpret_cast<uword*>(start() + 1);
-}
-
-
-void CallOrJumpPattern::SetTargetAddress(uword target) const {
-  ASSERT(IsValid());
-  *reinterpret_cast<uword*>(start() + 1) = target - start() - kLengthInBytes;
-  CPU::FlushICache(start() + 1, kWordSize);
-}
-
-
-const int* CallPattern::pattern() const {
-  static const int kCallPattern[kLengthInBytes] = {0xE8, -1, -1, -1, -1};
-  return kCallPattern;
-}
-
-
-const int* JumpPattern::pattern() const {
-  static const int kJumpPattern[kLengthInBytes] = {0xE9, -1, -1, -1, -1};
-  return kJumpPattern;
-}
-
-
-const int* ReturnPattern::pattern() const {
-  static const int kReturnPattern[kLengthInBytes] = { 0xC3 };
-  return kReturnPattern;
-}
-
-
-const int* ProloguePattern::pattern() const {
-  static const int kProloguePattern[kLengthInBytes] = { 0x55, 0x89, 0xe5 };
-  return kProloguePattern;
-}
-
-
-const int* SetFramePointerPattern::pattern() const {
-  static const int kFramePointerPattern[kLengthInBytes] = { 0x89, 0xe5 };
-  return kFramePointerPattern;
-}
-
 }  // namespace dart
 
 #endif  // defined TARGET_ARCH_IA32
diff --git a/runtime/vm/instructions_ia32.h b/runtime/vm/instructions_ia32.h
index c536124..33d648f 100644
--- a/runtime/vm/instructions_ia32.h
+++ b/runtime/vm/instructions_ia32.h
@@ -11,6 +11,7 @@
 #endif
 
 #include "vm/allocation.h"
+#include "vm/cpu.h"
 #include "vm/object.h"
 
 namespace dart {
@@ -20,24 +21,22 @@
 class Immediate;
 class RawObject;
 
-// Abstract class for all instruction pattern classes.
-class InstructionPattern : public ValueObject {
+// 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 {
  public:
   explicit InstructionPattern(uword pc) : start_(pc) {
     ASSERT(pc != 0);
   }
-  virtual ~InstructionPattern() {}
 
   // Call to check if the instruction pattern at 'pc' match the instruction.
-  virtual bool IsValid() const {
-    return TestBytesWith(pattern(), pattern_length_in_bytes());
+  // 'P::pattern()' returns the expected byte pattern in form of an integer
+  // array with length of 'P::pattern_length_in_bytes()'. A '-1' element means
+  // 'any byte'.
+  bool IsValid() const {
+    return TestBytesWith(P::pattern(), P::pattern_length_in_bytes());
   }
 
-  // 'pattern' returns the expected byte pattern in form of an integer array
-  // with length of 'pattern_length_in_bytes'. A '-1' element means 'any byte'.
-  virtual const int* pattern() const = 0;
-  virtual int pattern_length_in_bytes() const = 0;
-
  protected:
   uword start() const { return start_; }
 
@@ -45,7 +44,17 @@
   // Returns true if the 'num_bytes' bytes at 'start_' correspond to
   // array of integers 'data'. 'data' elements are either a byte or -1, which
   // represents any byte.
-  bool TestBytesWith(const int* data, int num_bytes) const;
+  bool TestBytesWith(const int* data, int num_bytes) const {
+    ASSERT(data != NULL);
+    const uint8_t* byte_array = reinterpret_cast<const uint8_t*>(start_);
+    for (int i = 0; i < num_bytes; i++) {
+      // Skip comparison for data[i] < 0.
+      if ((data[i] >= 0) && (byte_array[i] != (0xFF & data[i]))) {
+        return false;
+      }
+    }
+    return true;
+  }
 
   const uword start_;
 
@@ -53,54 +62,45 @@
 };
 
 
-class CallOrJumpPattern : public InstructionPattern {
+class CallPattern : public InstructionPattern<CallPattern> {
  public:
-  virtual int pattern_length_in_bytes() const {
-    return kLengthInBytes;
+  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);
   }
-  uword TargetAddress() const;
-  void SetTargetAddress(uword new_target) const;
 
- protected:
-  explicit CallOrJumpPattern(uword pc) : InstructionPattern(pc) {}
+  void SetTargetAddress(uword new_target) const {
+    ASSERT(this->IsValid());
+    *reinterpret_cast<uword*>(this->start() + 1) =
+        new_target - this->start() - CallPattern::pattern_length_in_bytes();
+    CPU::FlushICache(this->start() + 1, kWordSize);
+  }
+
+  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;
-
- private:
-  DISALLOW_COPY_AND_ASSIGN(CallOrJumpPattern);
-};
-
-
-class CallPattern : public CallOrJumpPattern {
- public:
-  explicit CallPattern(uword pc) : CallOrJumpPattern(pc) {}
-  static int InstructionLength() {
-    return kLengthInBytes;
-  }
-
- private:
-  virtual const int* pattern() const;
-
   DISALLOW_COPY_AND_ASSIGN(CallPattern);
 };
 
 
-class JumpPattern : public CallOrJumpPattern {
- public:
-  JumpPattern(uword pc, const Code& code) : CallOrJumpPattern(pc) {}
-
- private:
-  virtual const int* pattern() const;
-
-  DISALLOW_COPY_AND_ASSIGN(JumpPattern);
-};
-
-
-class ReturnPattern : public InstructionPattern {
+class ReturnPattern : public InstructionPattern<ReturnPattern> {
  public:
   explicit ReturnPattern(uword pc) : InstructionPattern(pc) {}
 
-  virtual const int* pattern() const;
-  virtual int pattern_length_in_bytes() const { return kLengthInBytes; }
+  static const int* pattern() {
+    static const int kReturnPattern[kLengthInBytes] = { 0xC3 };
+    return kReturnPattern;
+  }
+  static int pattern_length_in_bytes() { return kLengthInBytes; }
 
  private:
   static const int kLengthInBytes = 1;
@@ -109,12 +109,16 @@
 
 // push ebp
 // mov ebp, esp
-class ProloguePattern : public InstructionPattern {
+class ProloguePattern : public InstructionPattern<ProloguePattern> {
  public:
   explicit ProloguePattern(uword pc) : InstructionPattern(pc) {}
 
-  virtual const int* pattern() const;
-  virtual int pattern_length_in_bytes() const { return kLengthInBytes; }
+  static const int* pattern() {
+    static const int kProloguePattern[kLengthInBytes] = { 0x55, 0x89, 0xe5 };
+    return kProloguePattern;
+  }
+
+  static int pattern_length_in_bytes() { return kLengthInBytes; }
 
  private:
   static const int kLengthInBytes = 3;
@@ -122,12 +126,17 @@
 
 
 // mov ebp, esp
-class SetFramePointerPattern : public InstructionPattern {
+class SetFramePointerPattern :
+    public InstructionPattern<SetFramePointerPattern> {
  public:
   explicit SetFramePointerPattern(uword pc) : InstructionPattern(pc) {}
 
-  virtual const int* pattern() const;
-  virtual int pattern_length_in_bytes() const { return kLengthInBytes; }
+  static const int* pattern() {
+    static const int kFramePointerPattern[kLengthInBytes] = { 0x89, 0xe5 };
+    return kFramePointerPattern;
+  }
+
+  static int pattern_length_in_bytes() { return kLengthInBytes; }
 
  private:
   static const int kLengthInBytes = 2;
diff --git a/runtime/vm/instructions_ia32_test.cc b/runtime/vm/instructions_ia32_test.cc
index cace229..6b01cdb 100644
--- a/runtime/vm/instructions_ia32_test.cc
+++ b/runtime/vm/instructions_ia32_test.cc
@@ -17,7 +17,7 @@
 #define __ assembler->
 
 ASSEMBLER_TEST_GENERATE(Call, assembler) {
-  __ Call(*StubCode::InvokeDartCode_entry());
+  __ call(&StubCode::InvokeDartCode_entry()->label());
   __ ret();
 }
 
@@ -29,41 +29,6 @@
 }
 
 
-ASSEMBLER_TEST_GENERATE(Jump, assembler) {
-  __ Jmp(*StubCode::InvokeDartCode_entry());
-  const ExternalLabel label(StubCode::AllocateArray_entry()->EntryPoint());
-  __ jmp(&label);
-  __ ret();
-}
-
-
-ASSEMBLER_TEST_RUN(Jump, test) {
-  const Code& code = test->code();
-  const Instructions& instrs = Instructions::Handle(code.instructions());
-  bool status =
-      VirtualMemory::Protect(reinterpret_cast<void*>(instrs.EntryPoint()),
-                             instrs.size(),
-                             VirtualMemory::kReadWrite);
-  EXPECT(status);
-  JumpPattern jump1(test->entry(), test->code());
-  EXPECT_EQ(StubCode::InvokeDartCode_entry()->EntryPoint(),
-            jump1.TargetAddress());
-  JumpPattern jump2(test->entry() + jump1.pattern_length_in_bytes(),
-                    test->code());
-  const Code& array_stub =
-      Code::Handle(StubCode::AllocateArray_entry()->code());
-  EXPECT_EQ(array_stub.EntryPoint(),
-            jump2.TargetAddress());
-  uword target1 = jump1.TargetAddress();
-  uword target2 = jump2.TargetAddress();
-  jump1.SetTargetAddress(target2);
-  jump2.SetTargetAddress(target1);
-  EXPECT_EQ(array_stub.EntryPoint(),
-            jump1.TargetAddress());
-  EXPECT_EQ(StubCode::InvokeDartCode_entry()->EntryPoint(),
-            jump2.TargetAddress());
-}
-
 }  // namespace dart
 
 #endif  // defined TARGET_ARCH_IA32
diff --git a/runtime/vm/instructions_mips.cc b/runtime/vm/instructions_mips.cc
index 34a5c3a..dcca54f 100644
--- a/runtime/vm/instructions_mips.cc
+++ b/runtime/vm/instructions_mips.cc
@@ -15,10 +15,8 @@
 CallPattern::CallPattern(uword pc, const Code& code)
     : object_pool_(ObjectPool::Handle(code.GetObjectPool())),
       end_(pc),
-      args_desc_load_end_(0),
       ic_data_load_end_(0),
-      target_address_pool_index_(-1),
-      args_desc_(Array::Handle()),
+      target_code_pool_index_(-1),
       ic_data_(ICData::Handle()) {
   ASSERT(code.ContainsInstructionAt(pc));
   // Last instruction: jalr RA, T9(=R25).
@@ -26,10 +24,10 @@
   Register reg;
   // The end of the pattern is the instruction after the delay slot of the jalr.
   ic_data_load_end_ =
-      InstructionPattern::DecodeLoadWordFromPool(end_ - (2 * Instr::kInstrSize),
+      InstructionPattern::DecodeLoadWordFromPool(end_ - (3 * Instr::kInstrSize),
                                                  &reg,
-                                                 &target_address_pool_index_);
-  ASSERT(reg == T9);
+                                                 &target_code_pool_index_);
+  ASSERT(reg == CODE_REG);
 }
 
 
@@ -118,9 +116,7 @@
     // Offset is signed, so add the upper 16 bits.
     offset += (instr->UImmField() << 16);
   }
-  offset += kHeapObjectTag;
-  ASSERT(Utils::IsAligned(offset, 4));
-  *index = (offset - Array::data_offset()) / 4;
+  *index = ObjectPool::IndexFromOffset(offset);
   return start;
 }
 
@@ -128,43 +124,75 @@
 RawICData* CallPattern::IcData() {
   if (ic_data_.IsNull()) {
     Register reg;
-    args_desc_load_end_ =
-        InstructionPattern::DecodeLoadObject(ic_data_load_end_,
-                                             object_pool_,
-                                             &reg,
-                                             &ic_data_);
+    InstructionPattern::DecodeLoadObject(ic_data_load_end_,
+                                         object_pool_,
+                                         &reg,
+                                         &ic_data_);
     ASSERT(reg == S5);
   }
   return ic_data_.raw();
 }
 
 
-RawArray* CallPattern::ClosureArgumentsDescriptor() {
-  if (args_desc_.IsNull()) {
-    IcData();  // Loading of the ic_data must be decoded first, if not already.
-    Register reg;
-    InstructionPattern::DecodeLoadObject(args_desc_load_end_,
-                                         object_pool_,
-                                         &reg,
-                                         &args_desc_);
-    ASSERT(reg == S4);
-  }
-  return args_desc_.raw();
+RawCode* CallPattern::TargetCode() const {
+  return reinterpret_cast<RawCode*>(
+      object_pool_.ObjectAt(target_code_pool_index_));
 }
 
 
-uword CallPattern::TargetAddress() const {
-  return object_pool_.RawValueAt(target_address_pool_index_);
-}
-
-
-void CallPattern::SetTargetAddress(uword target_address) const {
-  object_pool_.SetRawValueAt(target_address_pool_index_, target_address);
+void CallPattern::SetTargetCode(const Code& target) const {
+  object_pool_.SetObjectAt(target_code_pool_index_, target);
   // No need to flush the instruction cache, since the code is not modified.
 }
 
 
-void CallPattern::InsertAt(uword pc, uword target_address) {
+NativeCallPattern::NativeCallPattern(uword pc, const Code& code)
+    : object_pool_(ObjectPool::Handle(code.GetObjectPool())),
+      end_(pc),
+      native_function_pool_index_(-1),
+      target_code_pool_index_(-1) {
+  ASSERT(code.ContainsInstructionAt(pc));
+  // Last instruction: jalr RA, T9(=R25).
+  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_);
+  ASSERT(reg == CODE_REG);
+  InstructionPattern::DecodeLoadWordFromPool(native_function_load_end,
+                                             &reg,
+                                             &native_function_pool_index_);
+  ASSERT(reg == T5);
+}
+
+
+RawCode* NativeCallPattern::target() const {
+  return reinterpret_cast<RawCode*>(
+      object_pool_.ObjectAt(target_code_pool_index_));
+}
+
+
+void NativeCallPattern::set_target(const Code& target) const {
+  object_pool_.SetObjectAt(target_code_pool_index_, target);
+  // No need to flush the instruction cache, since the code is not modified.
+}
+
+
+NativeFunction NativeCallPattern::native_function() const {
+  return reinterpret_cast<NativeFunction>(
+      object_pool_.RawValueAt(native_function_pool_index_));
+}
+
+
+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));
@@ -177,46 +205,8 @@
   jr->SetSpecialInstrBits(JALR, T9, ZR, RA);
   nop->SetInstructionBits(Instr::kNopInstruction);
 
-  ASSERT(kFixedLengthInBytes == 4 * Instr::kInstrSize);
-  CPU::FlushICache(pc, kFixedLengthInBytes);
-}
-
-
-JumpPattern::JumpPattern(uword pc, const Code& code) : pc_(pc) { }
-
-
-bool JumpPattern::IsValid() const {
-  Instr* lui = Instr::At(pc_ + (0 * Instr::kInstrSize));
-  Instr* ori = Instr::At(pc_ + (1 * Instr::kInstrSize));
-  Instr* jr = Instr::At(pc_ + (2 * Instr::kInstrSize));
-  Instr* nop = Instr::At(pc_ + (3 * Instr::kInstrSize));
-  return (lui->OpcodeField() == LUI) &&
-         (ori->OpcodeField() == ORI) &&
-         (jr->OpcodeField() == SPECIAL) &&
-         (jr->FunctionField() == JR) &&
-         (nop->InstructionBits() == Instr::kNopInstruction);
-}
-
-
-uword JumpPattern::TargetAddress() const {
-  Instr* lui = Instr::At(pc_ + (0 * Instr::kInstrSize));
-  Instr* ori = Instr::At(pc_ + (1 * Instr::kInstrSize));
-  const uint16_t target_lo = ori->UImmField();
-  const uint16_t target_hi = lui->UImmField();
-  return (target_hi << 16) | target_lo;
-}
-
-
-void JumpPattern::SetTargetAddress(uword target_address) const {
-  Instr* lui = Instr::At(pc_ + (0 * Instr::kInstrSize));
-  Instr* ori = Instr::At(pc_ + (1 * Instr::kInstrSize));
-  const int32_t lui_bits = lui->InstructionBits();
-  const int32_t ori_bits = ori->InstructionBits();
-  const uint16_t target_lo = target_address & 0xffff;
-  const uint16_t target_hi = target_address >> 16;
-
-  lui->SetInstructionBits((lui_bits & 0xffff0000) | target_hi);
-  ori->SetInstructionBits((ori_bits & 0xffff0000) | target_lo);
+  ASSERT(kDeoptCallLengthInBytes == 4 * Instr::kInstrSize);
+  CPU::FlushICache(pc, kDeoptCallLengthInBytes);
 }
 
 
diff --git a/runtime/vm/instructions_mips.h b/runtime/vm/instructions_mips.h
index 0091a95..fb2e22b 100644
--- a/runtime/vm/instructions_mips.h
+++ b/runtime/vm/instructions_mips.h
@@ -11,6 +11,7 @@
 #endif
 
 #include "vm/constants_mips.h"
+#include "vm/native_entry.h"
 #include "vm/object.h"
 
 namespace dart {
@@ -52,51 +53,47 @@
   CallPattern(uword pc, const Code& code);
 
   RawICData* IcData();
-  RawArray* ClosureArgumentsDescriptor();
 
-  uword TargetAddress() const;
-  void SetTargetAddress(uword target_address) const;
+  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 kFixedLengthInBytes = 4 * Instr::kInstrSize;
+  static const int kDeoptCallLengthInInstructions = 4;
+  static const int kDeoptCallLengthInBytes =
+      kDeoptCallLengthInInstructions * Instr::kInstrSize;
 
-  static void InsertAt(uword pc, uword target_address);
+  static void InsertDeoptCallAt(uword pc, uword target_address);
 
  private:
   const ObjectPool& object_pool_;
 
   uword end_;
-  uword args_desc_load_end_;
   uword ic_data_load_end_;
 
-  intptr_t target_address_pool_index_;
-  Array& args_desc_;
+  intptr_t target_code_pool_index_;
   ICData& ic_data_;
 
   DISALLOW_COPY_AND_ASSIGN(CallPattern);
 };
 
 
-class JumpPattern : public ValueObject {
+class NativeCallPattern : public ValueObject {
  public:
-  JumpPattern(uword pc, const Code& code);
+  NativeCallPattern(uword pc, const Code& code);
 
-  // lui; ori; jr; nop (in delay slot) = 4.
-  static const int kLengthInBytes = 4*Instr::kInstrSize;
+  RawCode* target() const;
+  void set_target(const Code& target) const;
 
-  int pattern_length_in_bytes() const {
-    return kLengthInBytes;
-  }
-
-  bool IsValid() const;
-  uword TargetAddress() const;
-  void SetTargetAddress(uword target_address) const;
+  NativeFunction native_function() const;
+  void set_native_function(NativeFunction target) const;
 
  private:
-  const uword pc_;
+  const ObjectPool& object_pool_;
 
-  DISALLOW_COPY_AND_ASSIGN(JumpPattern);
+  uword end_;
+  intptr_t native_function_pool_index_;
+  intptr_t target_code_pool_index_;
+
+  DISALLOW_COPY_AND_ASSIGN(NativeCallPattern);
 };
 
 
diff --git a/runtime/vm/instructions_mips_test.cc b/runtime/vm/instructions_mips_test.cc
index a165485..cf2f7f2 100644
--- a/runtime/vm/instructions_mips_test.cc
+++ b/runtime/vm/instructions_mips_test.cc
@@ -27,42 +27,10 @@
   // return jump.
   CallPattern call(test->entry() + test->code().Size() - (2*Instr::kInstrSize),
                    test->code());
-  EXPECT_EQ(StubCode::InvokeDartCode_entry()->label().address(),
-            call.TargetAddress());
+  EXPECT_EQ(StubCode::InvokeDartCode_entry()->code(), call.TargetCode());
 }
 
 
-ASSEMBLER_TEST_GENERATE(Jump, assembler) {
-  __ BranchPatchable(*StubCode::InvokeDartCode_entry());
-  __ BranchPatchable(*StubCode::AllocateArray_entry());
-}
-
-
-ASSEMBLER_TEST_RUN(Jump, test) {
-  const Code& code = test->code();
-  const Instructions& instrs = Instructions::Handle(code.instructions());
-  bool status =
-      VirtualMemory::Protect(reinterpret_cast<void*>(instrs.EntryPoint()),
-                             instrs.size(),
-                             VirtualMemory::kReadWrite);
-  EXPECT(status);
-  JumpPattern jump1(test->entry(), test->code());
-  EXPECT_EQ(StubCode::InvokeDartCode_entry()->label().address(),
-            jump1.TargetAddress());
-  JumpPattern jump2(test->entry() + jump1.pattern_length_in_bytes(),
-                    test->code());
-  const Code& array_stub =
-      Code::Handle(StubCode::AllocateArray_entry()->code());
-  EXPECT_EQ(array_stub.EntryPoint(), jump2.TargetAddress());
-  uword target1 = jump1.TargetAddress();
-  uword target2 = jump2.TargetAddress();
-  jump1.SetTargetAddress(target2);
-  jump2.SetTargetAddress(target1);
-  EXPECT_EQ(array_stub.EntryPoint(), jump1.TargetAddress());
-  EXPECT_EQ(StubCode::InvokeDartCode_entry()->label().address(),
-            jump2.TargetAddress());
-}
-
 }  // namespace dart
 
 #endif  // defined TARGET_ARCH_MIPS
diff --git a/runtime/vm/instructions_x64.cc b/runtime/vm/instructions_x64.cc
index 51128dd..dc691a4 100644
--- a/runtime/vm/instructions_x64.cc
+++ b/runtime/vm/instructions_x64.cc
@@ -11,54 +11,6 @@
 
 namespace dart {
 
-intptr_t InstructionPattern::IndexFromPPLoad(uword start) {
-  int32_t offset = *reinterpret_cast<int32_t*>(start);
-  return ObjectPool::IndexFromOffset(offset);
-}
-
-
-intptr_t InstructionPattern::OffsetFromPPIndex(intptr_t index) {
-  intptr_t offset = ObjectPool::element_offset(index);
-  return offset - kHeapObjectTag;
-}
-
-
-bool InstructionPattern::TestBytesWith(const int* data, int num_bytes) const {
-  ASSERT(data != NULL);
-  const uint8_t* byte_array = reinterpret_cast<const uint8_t*>(start_);
-  for (int i = 0; i < num_bytes; i++) {
-    // Skip comparison for data[i] < 0.
-    if ((data[i] >= 0) && (byte_array[i] != (0xFF & data[i]))) {
-      return false;
-    }
-  }
-  return true;
-}
-
-
-uword JumpPattern::TargetAddress() const {
-  ASSERT(IsValid());
-  int index = InstructionPattern::IndexFromPPLoad(start() + 3);
-  return object_pool_.RawValueAt(index);
-}
-
-
-void JumpPattern::SetTargetAddress(uword target) const {
-  ASSERT(IsValid());
-  int index = InstructionPattern::IndexFromPPLoad(start() + 3);
-  object_pool_.SetRawValueAt(index, target);
-  // No need to flush the instruction cache, since the code is not modified.
-}
-
-
-const int* JumpPattern::pattern() const {
-  //  07: 41 ff a7 imm32  jmpq [reg + off]
-  static const int kJumpPattern[kLengthInBytes] =
-      {0x41, 0xFF, -1, -1, -1, -1, -1};
-  return kJumpPattern;
-}
-
-
 void ShortCallPattern::SetTargetAddress(uword target) const {
   ASSERT(IsValid());
   *reinterpret_cast<uint32_t*>(start() + 1) = target - start() - kLengthInBytes;
@@ -66,30 +18,6 @@
 }
 
 
-const int* ShortCallPattern::pattern() const {
-  static const int kCallPattern[kLengthInBytes] = {0xE8, -1, -1, -1, -1};
-  return kCallPattern;
-}
-
-
-const int* ReturnPattern::pattern() const {
-  static const int kReturnPattern[kLengthInBytes] = { 0xC3 };
-  return kReturnPattern;
-}
-
-
-const int* ProloguePattern::pattern() const {
-  static const int kProloguePattern[kLengthInBytes] =
-      { 0x55, 0x48, 0x89, 0xe5 };
-  return kProloguePattern;
-}
-
-
-const int* SetFramePointerPattern::pattern() const {
-  static const int kFramePointerPattern[kLengthInBytes] = { 0x48, 0x89, 0xe5 };
-  return kFramePointerPattern;
-}
-
 }  // namespace dart
 
 #endif  // defined TARGET_ARCH_X64
diff --git a/runtime/vm/instructions_x64.h b/runtime/vm/instructions_x64.h
index 8f5cda4..5d7616d 100644
--- a/runtime/vm/instructions_x64.h
+++ b/runtime/vm/instructions_x64.h
@@ -20,27 +20,26 @@
 class Immediate;
 class RawObject;
 
-// Abstract class for all instruction pattern classes.
-class InstructionPattern : public ValueObject {
+
+intptr_t IndexFromPPLoad(uword start);
+
+
+// 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 {
  public:
   explicit InstructionPattern(uword pc) : start_(pc) {
     ASSERT(pc != 0);
   }
-  virtual ~InstructionPattern() {}
 
   // Call to check if the instruction pattern at 'pc' match the instruction.
-  virtual bool IsValid() const {
-    return TestBytesWith(pattern(), pattern_length_in_bytes());
+  // 'P::pattern()' returns the expected byte pattern in form of an integer
+  // array with length of 'P::pattern_length_in_bytes()'. A '-1' element means
+  // 'any byte'.
+  bool IsValid() const {
+    return TestBytesWith(P::pattern(), P::pattern_length_in_bytes());
   }
 
-  // 'pattern' returns the expected byte pattern in form of an integer array
-  // with length of 'pattern_length_in_bytes'. A '-1' element means 'any byte'.
-  virtual const int* pattern() const = 0;
-  virtual int pattern_length_in_bytes() const = 0;
-
-  static intptr_t IndexFromPPLoad(uword start);
-  static intptr_t OffsetFromPPIndex(intptr_t index);
-
  protected:
   uword start() const { return start_; }
 
@@ -48,7 +47,17 @@
   // Returns true if the 'num_bytes' bytes at 'start_' correspond to
   // array of integers 'data'. 'data' elements are either a byte or -1, which
   // represents any byte.
-  bool TestBytesWith(const int* data, int num_bytes) const;
+  bool TestBytesWith(const int* data, int num_bytes) const {
+    ASSERT(data != NULL);
+    const uint8_t* byte_array = reinterpret_cast<const uint8_t*>(start_);
+    for (int i = 0; i < num_bytes; i++) {
+      // Skip comparison for data[i] < 0.
+      if ((data[i] >= 0) && (byte_array[i] != (0xFF & data[i]))) {
+        return false;
+      }
+    }
+    return true;
+  }
 
   const uword start_;
 
@@ -56,57 +65,35 @@
 };
 
 
-class JumpPattern : public InstructionPattern {
- public:
-  JumpPattern(uword pc, const Code& code)
-      : InstructionPattern(pc),
-        object_pool_(ObjectPool::Handle(code.GetObjectPool())) {}
-  static int InstructionLength() {
-    return kLengthInBytes;
-  }
-  uword TargetAddress() const;
-  void SetTargetAddress(uword new_target) const;
-  virtual int pattern_length_in_bytes() const {
-    return kLengthInBytes;
-  }
-
-  static const int kLengthInBytes = 7;
- private:
-  virtual const int* pattern() const;
-  const ObjectPool& object_pool_;
-
-  DISALLOW_COPY_AND_ASSIGN(JumpPattern);
-};
-
-
 // 5 byte call instruction.
-class ShortCallPattern : public InstructionPattern {
+class ShortCallPattern : public InstructionPattern<ShortCallPattern> {
  public:
   explicit ShortCallPattern(uword pc) : InstructionPattern(pc) {}
-  static int InstructionLength() {
-    return kLengthInBytes;
-  }
-
-  virtual int pattern_length_in_bytes() const {
-    return kLengthInBytes;
-  }
 
   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;
-  virtual const int* pattern() const;
-
   DISALLOW_COPY_AND_ASSIGN(ShortCallPattern);
 };
 
 
-class ReturnPattern : public InstructionPattern {
+class ReturnPattern : public InstructionPattern<ReturnPattern> {
  public:
   explicit ReturnPattern(uword pc) : InstructionPattern(pc) {}
 
-  virtual const int* pattern() const;
-  virtual int pattern_length_in_bytes() const { return kLengthInBytes; }
+  static const int* pattern() {
+    static const int kReturnPattern[kLengthInBytes] = { 0xC3 };
+    return kReturnPattern;
+  }
+
+  static int pattern_length_in_bytes() { return kLengthInBytes; }
 
  private:
   static const int kLengthInBytes = 1;
@@ -115,12 +102,17 @@
 
 // push rbp
 // mov rbp, rsp
-class ProloguePattern : public InstructionPattern {
+class ProloguePattern : public InstructionPattern<ProloguePattern> {
  public:
   explicit ProloguePattern(uword pc) : InstructionPattern(pc) {}
 
-  virtual const int* pattern() const;
-  virtual int pattern_length_in_bytes() const { return kLengthInBytes; }
+  static const int* pattern() {
+    static const int kProloguePattern[kLengthInBytes] =
+        { 0x55, 0x48, 0x89, 0xe5 };
+    return kProloguePattern;
+  }
+
+  static int pattern_length_in_bytes() { return kLengthInBytes; }
 
  private:
   static const int kLengthInBytes = 4;
@@ -128,12 +120,18 @@
 
 
 // mov rbp, rsp
-class SetFramePointerPattern : public InstructionPattern {
+class SetFramePointerPattern :
+    public InstructionPattern<SetFramePointerPattern> {
  public:
   explicit SetFramePointerPattern(uword pc) : InstructionPattern(pc) {}
 
-  virtual const int* pattern() const;
-  virtual int pattern_length_in_bytes() const { return kLengthInBytes; }
+  static const int* pattern() {
+    static const int kFramePointerPattern[kLengthInBytes] =
+        { 0x48, 0x89, 0xe5 };
+    return kFramePointerPattern;
+  }
+
+  static int pattern_length_in_bytes() { return kLengthInBytes; }
 
  private:
   static const int kLengthInBytes = 3;
diff --git a/runtime/vm/instructions_x64_test.cc b/runtime/vm/instructions_x64_test.cc
index 0ad8294..3e7fb7d 100644
--- a/runtime/vm/instructions_x64_test.cc
+++ b/runtime/vm/instructions_x64_test.cc
@@ -35,34 +35,6 @@
 }
 
 
-ASSEMBLER_TEST_RUN(Jump, test) {
-  ASSERT(prologue_code_size != -1);
-  const Code& code = test->code();
-  const Instructions& instrs = Instructions::Handle(code.instructions());
-  bool status =
-      VirtualMemory::Protect(reinterpret_cast<void*>(instrs.EntryPoint()),
-                             instrs.size(),
-                             VirtualMemory::kReadWrite);
-  EXPECT(status);
-  JumpPattern jump1(test->entry() + prologue_code_size, test->code());
-  jump1.IsValid();
-  EXPECT_EQ(StubCode::InvokeDartCode_entry()->label().address(),
-            jump1.TargetAddress());
-  JumpPattern jump2((test->entry() +
-                     jump1.pattern_length_in_bytes() + prologue_code_size),
-                    test->code());
-  const Code& array_stub =
-      Code::Handle(StubCode::AllocateArray_entry()->code());
-  EXPECT_EQ(array_stub.EntryPoint(), jump2.TargetAddress());
-  uword target1 = jump1.TargetAddress();
-  uword target2 = jump2.TargetAddress();
-  jump1.SetTargetAddress(target2);
-  jump2.SetTargetAddress(target1);
-  EXPECT_EQ(array_stub.EntryPoint(), jump1.TargetAddress());
-  EXPECT_EQ(StubCode::InvokeDartCode_entry()->label().address(),
-            jump2.TargetAddress());
-}
-
 }  // namespace dart
 
 #endif  // defined TARGET_ARCH_X64
diff --git a/runtime/vm/intermediate_language.cc b/runtime/vm/intermediate_language.cc
index b7bacba..2389dfc 100644
--- a/runtime/vm/intermediate_language.cc
+++ b/runtime/vm/intermediate_language.cc
@@ -37,6 +37,8 @@
     "Generate special IC stubs for two args Smi operations");
 DEFINE_FLAG(bool, unbox_numeric_fields, true,
     "Support unboxed double and float32x4 fields.");
+DEFINE_FLAG(bool, fields_may_be_reset, false,
+            "Don't optimize away static field initialization");
 DECLARE_FLAG(bool, eliminate_type_checks);
 DECLARE_FLAG(bool, trace_optimization);
 DECLARE_FLAG(bool, throw_on_javascript_int_overflow);
@@ -82,7 +84,7 @@
     const ZoneGrowableArray<const ICData*>& ic_data_array) const {
   // The deopt_id can be outside the range of the IC data array for
   // computations added in the optimizing compiler.
-  ASSERT(deopt_id_ != Isolate::kNoDeoptId);
+  ASSERT(deopt_id_ != Thread::kNoDeoptId);
   if (deopt_id_ < ic_data_array.length()) {
     return ic_data_array[deopt_id_];
   }
@@ -383,9 +385,13 @@
 
 Instruction* InitStaticFieldInstr::Canonicalize(FlowGraph* flow_graph) {
   const bool is_initialized =
-      (field_.value() != Object::sentinel().raw()) &&
-      (field_.value() != Object::transition_sentinel().raw());
-  return is_initialized ? NULL : this;
+      (field_.StaticValue() != Object::sentinel().raw()) &&
+      (field_.StaticValue() != Object::transition_sentinel().raw());
+  // When precompiling, the fact that a field is currently initialized does not
+  // make it safe to omit code that checks if the field needs initialization
+  // because the field will be reset so it starts uninitialized in the process
+  // running the precompiled code. We must be prepared to reinitialize fields.
+  return is_initialized && !FLAG_fields_may_be_reset ? NULL : this;
 }
 
 
@@ -398,8 +404,8 @@
   LoadStaticFieldInstr* other_load = other->AsLoadStaticField();
   ASSERT(other_load != NULL);
   // Assert that the field is initialized.
-  ASSERT(StaticField().value() != Object::sentinel().raw());
-  ASSERT(StaticField().value() != Object::transition_sentinel().raw());
+  ASSERT(StaticField().StaticValue() != Object::sentinel().raw());
+  ASSERT(StaticField().StaticValue() != Object::transition_sentinel().raw());
   return StaticField().raw() == other_load->StaticField().raw();
 }
 
@@ -792,7 +798,7 @@
                                           Definition* call,
                                           Definition* result) {
   ASSERT(call->env() != NULL);
-  deopt_id_ = Isolate::ToDeoptAfter(call->deopt_id_);
+  deopt_id_ = Thread::ToDeoptAfter(call->deopt_id_);
   call->env()->DeepCopyAfterTo(flow_graph->zone(),
                                this,
                                call->ArgumentCount(),
@@ -968,6 +974,7 @@
     last = it.Current();
   }
   set_last_instruction(last);
+  if (last->IsGoto()) last->AsGoto()->set_block(this);
 
   return true;
 }
@@ -1630,7 +1637,9 @@
 
   switch (op_kind()) {
     case Token::kNEGATE:
-      result = value.ArithmeticOp(Token::kMUL, Smi::Handle(Smi::New(-1)));
+      result = value.ArithmeticOp(Token::kMUL,
+                                  Smi::Handle(Smi::New(-1)),
+                                  Heap::kOld);
       break;
 
     case Token::kBIT_NOT:
@@ -1675,19 +1684,21 @@
     case Token::kADD:
     case Token::kSUB:
     case Token::kMUL: {
-      result = left.ArithmeticOp(op_kind(), right);
+      result = left.ArithmeticOp(op_kind(), right, Heap::kOld);
       break;
     }
     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));
+        result = Smi::Cast(left).ShiftOp(op_kind(),
+                                         Smi::Cast(right),
+                                         Heap::kOld);
       }
       break;
     case Token::kBIT_AND:
     case Token::kBIT_OR:
     case Token::kBIT_XOR: {
-      result = left.BitOp(op_kind(), right);
+      result = left.BitOp(op_kind(), right, Heap::kOld);
       break;
     }
     case Token::kDIV:
@@ -2022,7 +2033,8 @@
         TypeArguments::Cast(constant_type_args->value());
     Error& bound_error = Error::Handle();
     const AbstractType& new_dst_type = AbstractType::Handle(
-        dst_type().InstantiateFrom(instantiator_type_args, &bound_error));
+        dst_type().InstantiateFrom(
+            instantiator_type_args, &bound_error, NULL, Heap::kOld));
     // If dst_type is instantiated to dynamic or Object, skip the test.
     if (!new_dst_type.IsMalformedOrMalbounded() && bound_error.IsNull() &&
         (new_dst_type.IsDynamicType() || new_dst_type.IsObjectType())) {
@@ -2190,7 +2202,7 @@
           representation(),
           box_defn->value()->CopyWithType(),
           (representation() == kUnboxedInt32) ?
-              GetDeoptId() : Isolate::kNoDeoptId);
+              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
@@ -2253,7 +2265,7 @@
         box_defn->from(),
         representation(),
         box_defn->value()->CopyWithType(),
-        (to() == kUnboxedInt32) ? GetDeoptId() : Isolate::kNoDeoptId);
+        (to() == kUnboxedInt32) ? GetDeoptId() : Thread::kNoDeoptId);
     if ((representation() == kUnboxedInt32) && is_truncating()) {
       converter->mark_truncating();
     }
@@ -2307,7 +2319,7 @@
 
 static bool MaybeNumber(CompileType* type) {
   ASSERT(Type::Handle(Type::Number()).IsMoreSpecificThan(
-         Type::Handle(Type::Number()), NULL));
+         Type::Handle(Type::Number()), NULL, Heap::kOld));
   return type->ToAbstractType()->IsDynamicType()
       || type->ToAbstractType()->IsObjectType()
       || type->ToAbstractType()->IsTypeParameter()
@@ -2715,7 +2727,7 @@
   __ Bind(compiler->GetJumpLabel(this));
   if (!compiler->is_optimizing()) {
     if (compiler->NeedsEdgeCounter(this)) {
-      compiler->EmitEdgeCounter();
+      compiler->EmitEdgeCounter(preorder_number());
     }
     // The deoptimization descriptor points after the edge counter code for
     // uniformity with ARM and MIPS, where we can reuse pattern matching
@@ -2759,7 +2771,6 @@
     }
 
     ASSERT(offset > 0);
-    offset -= Assembler::EntryPointToPcMarkerOffset();
     offsets_.SetInt32(i * element_size, offset);
   }
 }
@@ -2933,7 +2944,7 @@
                       kind,
                       left,
                       right,
-                      Isolate::Current()->GetNextDeoptId()),
+                      Thread::Current()->GetNextDeoptId()),
       needs_number_check_(needs_number_check) {
   ASSERT((kind == Token::kEQ_STRICT) || (kind == Token::kNE_STRICT));
 }
@@ -3161,7 +3172,7 @@
   Environment* env =
       new(zone) Environment(definitions.length(),
                                fixed_parameter_count,
-                               Isolate::kNoDeoptId,
+                               Thread::kNoDeoptId,
                                parsed_function,
                                NULL);
   for (intptr_t i = 0; i < definitions.length(); ++i) {
@@ -3428,50 +3439,52 @@
       !num_elements->BoundConstant().IsSmi()) {
     return this;
   }
-  intptr_t length = Smi::Cast(num_elements->BoundConstant()).Value();
-  GrowableArray<ConstantInstr*> constants(length);
+  const intptr_t length = Smi::Cast(num_elements->BoundConstant()).Value();
+  Zone* zone = Thread::Current()->zone();
+  GrowableHandlePtrArray<const String> pieces(zone, length);
   for (intptr_t i = 0; i < length; i++) {
-    constants.Add(NULL);
+    pieces.Add(Object::null_string());
   }
+
   for (Value::Iterator it(create_array->input_use_list());
        !it.Done();
        it.Advance()) {
     Instruction* curr = it.Current()->instruction();
-    if (curr != this) {
-      StoreIndexedInstr* store = curr->AsStoreIndexed();
-      ASSERT(store != NULL);
-      if (store->value()->definition()->IsConstant()) {
-        ASSERT(store->index()->BindsToConstant());
-        const Object& obj = store->value()->definition()->AsConstant()->value();
-        if (obj.IsNumber() || obj.IsString() || obj.IsBool() || obj.IsNull()) {
-          constants[Smi::Cast(store->index()->BoundConstant()).Value()] =
-              store->value()->definition()->AsConstant();
-        } else {
-          return this;
-        }
+    if (curr == this) continue;
+
+    StoreIndexedInstr* store = curr->AsStoreIndexed();
+    if (!store->index()->BindsToConstant() ||
+        !store->index()->BoundConstant().IsSmi()) {
+      return this;
+    }
+    intptr_t store_index = Smi::Cast(store->index()->BoundConstant()).Value();
+    ASSERT(store_index < length);
+    ASSERT(store != NULL);
+    if (store->value()->definition()->IsConstant()) {
+      ASSERT(store->index()->BindsToConstant());
+      const Object& obj = store->value()->definition()->AsConstant()->value();
+      // TODO(srdjan): Verify if any other types should be converted as well.
+      if (obj.IsString()) {
+        pieces.SetAt(store_index, String::Cast(obj));
+      } else if (obj.IsSmi()) {
+        const char* cstr = obj.ToCString();
+        pieces.SetAt(store_index, String::Handle(zone, Symbols::New(cstr)));
+      } else if (obj.IsBool()) {
+        pieces.SetAt(store_index,
+            Bool::Cast(obj).value() ? Symbols::True() : Symbols::False());
+      } else if (obj.IsNull()) {
+        pieces.SetAt(store_index, Symbols::Null());
       } else {
         return this;
       }
+    } else {
+      return this;
     }
   }
-  // Interpolate string at compile time.
-  const Array& array_argument =
-      Array::Handle(Array::New(length));
-  for (intptr_t i = 0; i < constants.length(); i++) {
-    array_argument.SetAt(i, constants[i]->value());
-  }
-  // Build argument array to pass to the interpolation function.
-  const Array& interpolate_arg = Array::Handle(Array::New(1));
-  interpolate_arg.SetAt(0, array_argument);
-  // Call interpolation function.
-  const Object& result = Object::Handle(
-      DartEntry::InvokeFunction(CallFunction(), interpolate_arg));
-  if (result.IsUnhandledException()) {
-    return this;
-  }
-  ASSERT(result.IsString());
-  const String& concatenated =
-      String::ZoneHandle(Symbols::New(String::Cast(result)));
+
+  ASSERT(pieces.length() == length);
+  const String& concatenated = String::ZoneHandle(zone,
+      Symbols::FromConcatAll(pieces));
   return flow_graph->GetConstant(concatenated);
 }
 
@@ -3518,71 +3531,71 @@
 typedef double (*UnaryMathCFunction) (double x);
 typedef double (*BinaryMathCFunction) (double x, double y);
 
-extern const RuntimeEntry kPowRuntimeEntry(
-    "libc_pow", reinterpret_cast<RuntimeFunction>(
-        static_cast<BinaryMathCFunction>(&pow)), 2, true, true);
+DEFINE_RAW_LEAF_RUNTIME_ENTRY(LibcPow, 2, true /* is_float */,
+    reinterpret_cast<RuntimeFunction>(
+        static_cast<BinaryMathCFunction>(&pow)));
 
-extern const RuntimeEntry kModRuntimeEntry(
-    "DartModulo", reinterpret_cast<RuntimeFunction>(
-        static_cast<BinaryMathCFunction>(&DartModulo)), 2, true, true);
+DEFINE_RAW_LEAF_RUNTIME_ENTRY(DartModulo, 2, true /* is_float */,
+    reinterpret_cast<RuntimeFunction>(
+        static_cast<BinaryMathCFunction>(&DartModulo)));
 
-extern const RuntimeEntry kFloorRuntimeEntry(
-    "libc_floor", reinterpret_cast<RuntimeFunction>(
-        static_cast<UnaryMathCFunction>(&floor)), 1, true, true);
+DEFINE_RAW_LEAF_RUNTIME_ENTRY(LibcFloor, 1, true /* is_float */,
+    reinterpret_cast<RuntimeFunction>(
+        static_cast<UnaryMathCFunction>(&floor)));
 
-extern const RuntimeEntry kCeilRuntimeEntry(
-    "libc_ceil", reinterpret_cast<RuntimeFunction>(
-        static_cast<UnaryMathCFunction>(&ceil)), 1, true, true);
+DEFINE_RAW_LEAF_RUNTIME_ENTRY(LibcCeil, 1, true /* is_float */,
+    reinterpret_cast<RuntimeFunction>(
+        static_cast<UnaryMathCFunction>(&ceil)));
 
-extern const RuntimeEntry kTruncRuntimeEntry(
-    "libc_trunc", reinterpret_cast<RuntimeFunction>(
-        static_cast<UnaryMathCFunction>(&trunc)), 1, true, true);
+DEFINE_RAW_LEAF_RUNTIME_ENTRY(LibcTrunc, 1, true /* is_float */,
+    reinterpret_cast<RuntimeFunction>(
+        static_cast<UnaryMathCFunction>(&trunc)));
 
-extern const RuntimeEntry kRoundRuntimeEntry(
-    "libc_round", reinterpret_cast<RuntimeFunction>(
-        static_cast<UnaryMathCFunction>(&round)), 1, true, true);
+DEFINE_RAW_LEAF_RUNTIME_ENTRY(LibcRound, 1, true /* is_float */,
+    reinterpret_cast<RuntimeFunction>(
+        static_cast<UnaryMathCFunction>(&round)));
 
 
 const RuntimeEntry& InvokeMathCFunctionInstr::TargetFunction() const {
   switch (recognized_kind_) {
     case MethodRecognizer::kDoubleTruncate:
-      return kTruncRuntimeEntry;
+      return kLibcTruncRuntimeEntry;
     case MethodRecognizer::kDoubleRound:
-      return kRoundRuntimeEntry;
+      return kLibcRoundRuntimeEntry;
     case MethodRecognizer::kDoubleFloor:
-      return kFloorRuntimeEntry;
+      return kLibcFloorRuntimeEntry;
     case MethodRecognizer::kDoubleCeil:
-      return kCeilRuntimeEntry;
+      return kLibcCeilRuntimeEntry;
     case MethodRecognizer::kMathDoublePow:
-      return kPowRuntimeEntry;
+      return kLibcPowRuntimeEntry;
     case MethodRecognizer::kDoubleMod:
-      return kModRuntimeEntry;
+      return kDartModuloRuntimeEntry;
     default:
       UNREACHABLE();
   }
-  return kPowRuntimeEntry;
+  return kLibcPowRuntimeEntry;
 }
 
 
-extern const RuntimeEntry kCosRuntimeEntry(
-    "libc_cos", reinterpret_cast<RuntimeFunction>(
-        static_cast<UnaryMathCFunction>(&cos)), 1, true, true);
+DEFINE_RAW_LEAF_RUNTIME_ENTRY(LibcCos, 1, true /* is_float */,
+    reinterpret_cast<RuntimeFunction>(
+        static_cast<UnaryMathCFunction>(&cos)));
 
-extern const RuntimeEntry kSinRuntimeEntry(
-    "libc_sin", reinterpret_cast<RuntimeFunction>(
-        static_cast<UnaryMathCFunction>(&sin)), 1, true, true);
+DEFINE_RAW_LEAF_RUNTIME_ENTRY(LibcSin, 1, true /* is_float */,
+    reinterpret_cast<RuntimeFunction>(
+        static_cast<UnaryMathCFunction>(&sin)));
 
 
 const RuntimeEntry& MathUnaryInstr::TargetFunction() const {
   switch (kind()) {
     case MathUnaryInstr::kSin:
-      return kSinRuntimeEntry;
+      return kLibcSinRuntimeEntry;
     case MathUnaryInstr::kCos:
-      return kCosRuntimeEntry;
+      return kLibcCosRuntimeEntry;
     default:
       UNREACHABLE();
   }
-  return kSinRuntimeEntry;
+  return kLibcSinRuntimeEntry;
 }
 
 
@@ -3598,18 +3611,6 @@
   return "";
 }
 
-typedef RawBool* (*CaseInsensitiveCompareUC16Function) (
-    RawString* string_raw,
-    RawSmi* lhs_index_raw,
-    RawSmi* rhs_index_raw,
-    RawSmi* length_raw);
-
-
-extern const RuntimeEntry kCaseInsensitiveCompareUC16RuntimeEntry(
-    "CaseInsensitiveCompareUC16", reinterpret_cast<RuntimeFunction>(
-        static_cast<CaseInsensitiveCompareUC16Function>(
-        &IRRegExpMacroAssembler::CaseInsensitiveCompareUC16)), 4, true, false);
-
 
 const RuntimeEntry& CaseInsensitiveCompareUC16Instr::TargetFunction() const {
   return kCaseInsensitiveCompareUC16RuntimeEntry;
diff --git a/runtime/vm/intermediate_language.h b/runtime/vm/intermediate_language.h
index 9bae137..7f01ecc 100644
--- a/runtime/vm/intermediate_language.h
+++ b/runtime/vm/intermediate_language.h
@@ -608,15 +608,14 @@
   };
 #undef DECLARE_TAG
 
-  explicit Instruction(intptr_t deopt_id = Isolate::kNoDeoptId)
+  explicit Instruction(intptr_t deopt_id = Thread::kNoDeoptId)
       : deopt_id_(deopt_id),
-        lifetime_position_(-1),
+        lifetime_position_(kNoPlaceId),
         previous_(NULL),
         next_(NULL),
         env_(NULL),
         locs_(NULL),
-        inlining_id_(-1),
-        place_id_(kNoPlaceId) { }
+        inlining_id_(-1) { }
 
   virtual ~Instruction() { }
 
@@ -773,7 +772,7 @@
   // to.
   virtual intptr_t DeoptimizationTarget() const {
     UNREACHABLE();
-    return Isolate::kNoDeoptId;
+    return Thread::kNoDeoptId;
   }
 
   // Returns a replacement for the instruction or NULL if the instruction can
@@ -889,13 +888,15 @@
   };
 
   intptr_t deopt_id_;
-  intptr_t lifetime_position_;  // Position used by register allocator.
+  union {
+    intptr_t lifetime_position_;  // Position used by register allocator.
+    intptr_t place_id_;
+  };
   Instruction* previous_;
   Instruction* next_;
   Environment* env_;
   LocationSummary* locs_;
   intptr_t inlining_id_;
-  intptr_t place_id_;
 
   DISALLOW_COPY_AND_ASSIGN(Instruction);
 };
@@ -944,7 +945,7 @@
          template<typename Default, typename Pure> class CSETrait = NoCSE>
 class TemplateInstruction: public CSETrait<Instruction, PureInstruction>::Base {
  public:
-  explicit TemplateInstruction(intptr_t deopt_id = Isolate::kNoDeoptId)
+  explicit TemplateInstruction(intptr_t deopt_id = Thread::kNoDeoptId)
       : CSETrait<Instruction, PureInstruction>::Base(deopt_id), inputs_() { }
 
   virtual intptr_t InputCount() const { return N; }
@@ -1204,7 +1205,7 @@
 
  protected:
   BlockEntryInstr(intptr_t block_id, intptr_t try_index)
-      : Instruction(Isolate::Current()->GetNextDeoptId()),
+      : Instruction(Thread::Current()->GetNextDeoptId()),
         block_id_(block_id),
         try_index_(try_index),
         preorder_number_(-1),
@@ -1330,7 +1331,7 @@
   }
   ConstantInstr* constant_null();
 
-  bool IsCompiledForOsr() const { return osr_id_ != Isolate::kNoDeoptId; }
+  bool IsCompiledForOsr() const { return osr_id_ != Thread::kNoDeoptId; }
 
   intptr_t entry_count() const { return entry_count_; }
   void set_entry_count(intptr_t count) { entry_count_ = count; }
@@ -1638,7 +1639,7 @@
 // Abstract super-class of all instructions that define a value (Bind, Phi).
 class Definition : public Instruction {
  public:
-  explicit Definition(intptr_t deopt_id = Isolate::kNoDeoptId);
+  explicit Definition(intptr_t deopt_id = Thread::kNoDeoptId);
 
   // Overridden by definitions that have call counts.
   virtual intptr_t CallCount() const {
@@ -1841,7 +1842,7 @@
          template<typename Impure, typename Pure> class CSETrait = NoCSE>
 class TemplateDefinition : public CSETrait<Definition, PureDefinition>::Base {
  public:
-  explicit TemplateDefinition(intptr_t deopt_id = Isolate::kNoDeoptId)
+  explicit TemplateDefinition(intptr_t deopt_id = Thread::kNoDeoptId)
       : CSETrait<Definition, PureDefinition>::Base(deopt_id), inputs_() { }
 
   virtual intptr_t InputCount() const { return N; }
@@ -2048,7 +2049,7 @@
 class ReturnInstr : public TemplateInstruction<1, NoThrow> {
  public:
   ReturnInstr(intptr_t token_pos, Value* value)
-      : TemplateInstruction(Isolate::Current()->GetNextDeoptId()),
+      : TemplateInstruction(Thread::Current()->GetNextDeoptId()),
         token_pos_(token_pos) {
     SetInputAt(0, value);
   }
@@ -2078,7 +2079,7 @@
 class ThrowInstr : public TemplateInstruction<0, Throws> {
  public:
   explicit ThrowInstr(intptr_t token_pos)
-      : TemplateInstruction(Isolate::Current()->GetNextDeoptId()),
+      : TemplateInstruction(Thread::Current()->GetNextDeoptId()),
         token_pos_(token_pos) {
   }
 
@@ -2104,7 +2105,7 @@
   // 'catch_try_index' can be CatchClauseNode::kInvalidTryIndex if the
   // rethrow has been artifically generated by the parser.
   ReThrowInstr(intptr_t token_pos, intptr_t catch_try_index)
-      : TemplateInstruction(Isolate::Current()->GetNextDeoptId()),
+      : TemplateInstruction(Thread::Current()->GetNextDeoptId()),
         token_pos_(token_pos),
         catch_try_index_(catch_try_index) {
   }
@@ -2157,7 +2158,8 @@
 class GotoInstr : public TemplateInstruction<0, NoThrow> {
  public:
   explicit GotoInstr(JoinEntryInstr* entry)
-    : TemplateInstruction(Isolate::Current()->GetNextDeoptId()),
+    : TemplateInstruction(Thread::Current()->GetNextDeoptId()),
+      block_(NULL),
       successor_(entry),
       edge_weight_(0.0),
       parallel_move_(NULL) {
@@ -2165,6 +2167,9 @@
 
   DECLARE_INSTRUCTION(Goto)
 
+  BlockEntryInstr* block() const { return block_; }
+  void set_block(BlockEntryInstr* block) { block_ = block; }
+
   JoinEntryInstr* successor() const { return successor_; }
   void set_successor(JoinEntryInstr* successor) { successor_ = successor; }
   virtual intptr_t SuccessorCount() const;
@@ -2206,6 +2211,7 @@
   virtual void PrintTo(BufferFormatter* f) const;
 
  private:
+  BlockEntryInstr* block_;
   JoinEntryInstr* successor_;
   double edge_weight_;
 
@@ -2316,7 +2322,7 @@
                   Token::Kind kind,
                   Value* left,
                   Value* right,
-                  intptr_t deopt_id = Isolate::kNoDeoptId)
+                  intptr_t deopt_id = Thread::kNoDeoptId)
       : TemplateDefinition(deopt_id),
         token_pos_(token_pos),
         kind_(kind),
@@ -2339,7 +2345,7 @@
 class BranchInstr : public Instruction {
  public:
   explicit BranchInstr(ComparisonInstr* comparison)
-      : Instruction(Isolate::Current()->GetNextDeoptId()),
+      : Instruction(Thread::Current()->GetNextDeoptId()),
         comparison_(comparison),
         is_checked_(false),
         constrained_type_(NULL),
@@ -2647,7 +2653,7 @@
 class AssertBooleanInstr : public TemplateDefinition<1, Throws, Pure> {
  public:
   AssertBooleanInstr(intptr_t token_pos, Value* value)
-      : TemplateDefinition(Isolate::Current()->GetNextDeoptId()),
+      : TemplateDefinition(Thread::Current()->GetNextDeoptId()),
         token_pos_(token_pos) {
     SetInputAt(0, value);
   }
@@ -2678,7 +2684,7 @@
 class CurrentContextInstr : public TemplateDefinition<0, NoThrow> {
  public:
   CurrentContextInstr()
-      : TemplateDefinition(Isolate::Current()->GetNextDeoptId()) {
+      : TemplateDefinition(Thread::Current()->GetNextDeoptId()) {
   }
 
   DECLARE_INSTRUCTION(CurrentContext)
@@ -2700,7 +2706,7 @@
   ClosureCallInstr(Value* function,
                    ClosureCallNode* node,
                    ZoneGrowableArray<PushArgumentInstr*>* arguments)
-      : TemplateDefinition(Isolate::Current()->GetNextDeoptId()),
+      : TemplateDefinition(Thread::Current()->GetNextDeoptId()),
         ast_node_(*node),
         arguments_(arguments) {
     SetInputAt(0, function);
@@ -2742,7 +2748,7 @@
                     const Array& argument_names,
                     intptr_t checked_argument_count,
                     const ZoneGrowableArray<const ICData*>& ic_data_array)
-      : TemplateDefinition(Isolate::Current()->GetNextDeoptId()),
+      : TemplateDefinition(Thread::Current()->GetNextDeoptId()),
         ic_data_(NULL),
         token_pos_(token_pos),
         function_name_(function_name),
@@ -2966,7 +2972,7 @@
   virtual CompileType ComputeType() const;
 
   virtual bool CanDeoptimize() const {
-    return GetDeoptId() != Isolate::kNoDeoptId;
+    return GetDeoptId() != Thread::kNoDeoptId;
   }
 
   virtual Representation RequiredInputRepresentation(intptr_t idx) const {
@@ -3078,7 +3084,7 @@
   IfThenElseInstr(ComparisonInstr* comparison,
                   Value* if_true,
                   Value* if_false)
-      : Definition(Isolate::Current()->GetNextDeoptId()),
+      : Definition(Thread::Current()->GetNextDeoptId()),
         comparison_(comparison),
         if_true_(Smi::Cast(if_true->BoundConstant()).Value()),
         if_false_(Smi::Cast(if_false->BoundConstant()).Value()) {
@@ -3159,7 +3165,7 @@
                   const Array& argument_names,
                   ZoneGrowableArray<PushArgumentInstr*>* arguments,
                   const ZoneGrowableArray<const ICData*>& ic_data_array)
-      : TemplateDefinition(Isolate::Current()->GetNextDeoptId()),
+      : TemplateDefinition(Thread::Current()->GetNextDeoptId()),
         ic_data_(NULL),
         token_pos_(token_pos),
         function_(function),
@@ -3409,6 +3415,10 @@
     return ast_node_.is_bootstrap_native();
   }
 
+  bool link_lazily() const {
+    return ast_node_.link_lazily();
+  }
+
   virtual void PrintOperandsTo(BufferFormatter* f) const;
 
   virtual bool CanDeoptimize() const { return false; }
@@ -3473,7 +3483,7 @@
                           Value* value,
                           StoreBarrierType emit_store_barrier,
                           intptr_t token_pos)
-      : field_(Field::Handle()),
+      : field_(Field::ZoneHandle()),
         offset_in_bytes_(offset_in_bytes),
         emit_store_barrier_(emit_store_barrier),
         token_pos_(token_pos),
@@ -3730,7 +3740,7 @@
   intptr_t class_id() const { return class_id_; }
 
   virtual bool CanDeoptimize() const {
-    return GetDeoptId() != Isolate::kNoDeoptId;
+    return GetDeoptId() != Thread::kNoDeoptId;
   }
 
   virtual Representation representation() const;
@@ -3873,9 +3883,9 @@
 class StringInterpolateInstr : public TemplateDefinition<1, Throws> {
  public:
   StringInterpolateInstr(Value* value, intptr_t token_pos)
-      : TemplateDefinition(Isolate::Current()->GetNextDeoptId()),
+      : TemplateDefinition(Thread::Current()->GetNextDeoptId()),
         token_pos_(token_pos),
-        function_(Function::Handle()) {
+        function_(Function::ZoneHandle()) {
     SetInputAt(0, value);
   }
 
@@ -4240,7 +4250,7 @@
   CreateArrayInstr(intptr_t token_pos,
                    Value* element_type,
                    Value* num_elements)
-      : TemplateDefinition(Isolate::Current()->GetNextDeoptId()),
+      : TemplateDefinition(Thread::Current()->GetNextDeoptId()),
         token_pos_(token_pos),
         identity_(AliasIdentity::Unknown())  {
     SetInputAt(kElementTypePos, element_type);
@@ -4443,7 +4453,7 @@
                        const AbstractType& type,
                        const Class& instantiator_class,
                        Value* instantiator)
-      : TemplateDefinition(Isolate::Current()->GetNextDeoptId()),
+      : TemplateDefinition(Thread::Current()->GetNextDeoptId()),
         token_pos_(token_pos),
         type_(type),
         instantiator_class_(instantiator_class) {
@@ -4480,7 +4490,7 @@
                                 const TypeArguments& type_arguments,
                                 const Class& instantiator_class,
                                 Value* instantiator)
-      : TemplateDefinition(Isolate::Current()->GetNextDeoptId()),
+      : TemplateDefinition(Thread::Current()->GetNextDeoptId()),
         token_pos_(token_pos),
         type_arguments_(type_arguments),
         instantiator_class_(instantiator_class) {
@@ -4544,7 +4554,7 @@
 class InitStaticFieldInstr : public TemplateInstruction<1, Throws> {
  public:
   InitStaticFieldInstr(Value* input, const Field& field)
-      : TemplateInstruction(Isolate::Current()->GetNextDeoptId()),
+      : TemplateInstruction(Thread::Current()->GetNextDeoptId()),
         field_(field) {
     SetInputAt(0, input);
   }
@@ -4568,7 +4578,7 @@
 class CloneContextInstr : public TemplateDefinition<1, NoThrow> {
  public:
   CloneContextInstr(intptr_t token_pos, Value* context_value)
-      : TemplateDefinition(Isolate::Current()->GetNextDeoptId()),
+      : TemplateDefinition(Thread::Current()->GetNextDeoptId()),
         token_pos_(token_pos) {
     SetInputAt(0, context_value);
   }
@@ -4690,7 +4700,7 @@
 
   virtual bool CanDeoptimize() const { return false; }
   virtual intptr_t DeoptimizationTarget() const {
-    return Isolate::kNoDeoptId;
+    return Thread::kNoDeoptId;
   }
 
   virtual Representation RequiredInputRepresentation(intptr_t idx) const {
@@ -7092,7 +7102,7 @@
 class CheckStackOverflowInstr : public TemplateInstruction<0, NoThrow> {
  public:
   CheckStackOverflowInstr(intptr_t token_pos, intptr_t loop_depth)
-      : TemplateInstruction(Isolate::Current()->GetNextDeoptId()),
+      : TemplateInstruction(Thread::Current()->GetNextDeoptId()),
         token_pos_(token_pos),
         loop_depth_(loop_depth) {
   }
@@ -8011,7 +8021,7 @@
     return count;
   }
 
-  const Code& code() const { return parsed_function_.code(); }
+  const Function& function() const { return parsed_function_.function(); }
 
   Environment* DeepCopy(Zone* zone) const {
     return DeepCopy(zone, Length());
diff --git a/runtime/vm/intermediate_language_arm.cc b/runtime/vm/intermediate_language_arm.cc
index cc2ebcd..f7030f8 100644
--- a/runtime/vm/intermediate_language_arm.cc
+++ b/runtime/vm/intermediate_language_arm.cc
@@ -24,6 +24,7 @@
 
 namespace dart {
 
+DECLARE_FLAG(bool, allow_absolute_addresses);
 DECLARE_FLAG(bool, emit_edge_counters);
 DECLARE_FLAG(int, optimization_counter_threshold);
 DECLARE_FLAG(bool, use_osr);
@@ -222,17 +223,17 @@
   // R4: Arguments descriptor.
   // R0: Function.
   ASSERT(locs()->in(0).reg() == R0);
-  __ ldr(R2, FieldAddress(R0, Function::instructions_offset()));
+  __ ldr(CODE_REG, FieldAddress(R0, Function::code_offset()));
+  __ ldr(R2, FieldAddress(R0, Function::entry_point_offset()));
 
-  // R2: instructions.
+  // R2: instructions entry point.
   // R5: Smi 0 (no IC data; the lazy-compile stub expects a GC-safe value).
   __ LoadImmediate(R5, 0);
-  __ AddImmediate(R2, Instructions::HeaderSize() - kHeapObjectTag);
   __ blx(R2);
   compiler->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 = Isolate::ToDeoptAfter(deopt_id());
+  const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id());
   if (compiler->is_optimizing()) {
     compiler->AddDeoptIndexAtCall(deopt_id_after, token_pos());
   }
@@ -938,31 +939,38 @@
   // Compute the effective address. When running under the simulator,
   // this is a redirection address that forces the simulator to call
   // into the runtime system.
-  uword entry = reinterpret_cast<uword>(native_c_function());
+  uword entry;
   const intptr_t argc_tag = NativeArguments::ComputeArgcTag(function());
   const bool is_leaf_call =
     (argc_tag & NativeArguments::AutoSetupScopeMask()) == 0;
-  const StubEntry* stub_entry = NULL;
-  if (is_bootstrap_native() || is_leaf_call) {
+  const StubEntry* stub_entry;
+  if (link_lazily()) {
     stub_entry = StubCode::CallBootstrapCFunction_entry();
-#if defined(USING_SIMULATOR)
-    entry = Simulator::RedirectExternalReference(
-        entry, Simulator::kBootstrapNativeCall, function().NumParameters());
-#endif
+    entry = NativeEntry::LinkNativeCallEntry();
   } else {
-    // In the case of non bootstrap native methods the CallNativeCFunction
-    // stub generates the redirection address when running under the simulator
-    // and hence we do not change 'entry' here.
-    stub_entry = StubCode::CallNativeCFunction_entry();
+    entry = reinterpret_cast<uword>(native_c_function());
+    if (is_bootstrap_native() || is_leaf_call) {
+      stub_entry = StubCode::CallBootstrapCFunction_entry();
 #if defined(USING_SIMULATOR)
-    if (!function().IsNativeAutoSetupScope()) {
       entry = Simulator::RedirectExternalReference(
-          entry, Simulator::kBootstrapNativeCall, function().NumParameters());
-    }
+          entry, Simulator::kBootstrapNativeCall, NativeEntry::kNumArguments);
 #endif
+    } else {
+      // In the case of non bootstrap native methods the CallNativeCFunction
+      // stub generates the redirection address when running under the simulator
+      // and hence we do not change 'entry' here.
+      stub_entry = StubCode::CallNativeCFunction_entry();
+#if defined(USING_SIMULATOR)
+      if (!function().IsNativeAutoSetupScope()) {
+        entry = Simulator::RedirectExternalReference(
+            entry, Simulator::kBootstrapNativeCall, NativeEntry::kNumArguments);
+      }
+#endif
+    }
   }
-  __ LoadImmediate(R5, entry);
   __ LoadImmediate(R1, argc_tag);
+  ExternalLabel label(entry);
+  __ LoadNativeEntry(R5, &label, link_lazily() ? kPatchable : kNotPatchable);
   compiler->GenerateCall(token_pos(),
                          *stub_entry,
                          RawPcDescriptors::kOther,
@@ -986,8 +994,8 @@
   ASSERT(compiler->is_optimizing());
   const Register char_code = locs()->in(0).reg();
   const Register result = locs()->out(0).reg();
-  __ LoadImmediate(result,
-                   reinterpret_cast<uword>(Symbols::PredefinedAddress()));
+
+  __ ldr(result, Address(THR, Thread::predefined_symbols_address_offset()));
   __ AddImmediate(result, Symbols::kNullCharCodeSymbolOffset * kWordSize);
   __ ldr(result, Address(result, char_code, LSL, 1));  // Char code is a smi.
 }
@@ -1693,8 +1701,7 @@
         if (field_cid != kSmiCid) {
           __ CompareImmediate(value_cid_reg, kNullCid);
         } else {
-          __ CompareImmediate(value_reg,
-                              reinterpret_cast<intptr_t>(Object::null()));
+          __ CompareObject(value_reg, Object::null_object());
         }
       }
       __ b(fail, NE);
@@ -1811,16 +1818,14 @@
         result_(result) { }
 
   virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
-    Isolate* isolate = compiler->isolate();
-
     if (Assembler::EmittingComments()) {
       __ Comment("%s slow path allocation of %s",
                  instruction_->DebugName(),
                  String::Handle(cls_.PrettyName()).ToCString());
     }
     __ Bind(entry_label());
-    const Code& stub =
-        Code::Handle(isolate, StubCode::GetAllocationStubForClass(cls_));
+    const Code& stub = Code::ZoneHandle(
+        compiler->zone(), StubCode::GetAllocationStubForClass(cls_));
     const StubEntry stub_entry(stub);
 
     LocationSummary* locs = instruction_->locs();
@@ -2026,8 +2031,7 @@
                              Register temp) {
   Label done;
   __ ldr(box_reg, FieldAddress(instance_reg, offset));
-  __ CompareImmediate(box_reg,
-                      reinterpret_cast<intptr_t>(Object::null()));
+  __ CompareObject(box_reg, Object::null_object());
   __ b(&done, NE);
 
   BoxAllocationSlowPath::Allocate(
@@ -2235,7 +2239,7 @@
 void LoadStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
   const Register field = locs()->in(0).reg();
   const Register result = locs()->out(0).reg();
-  __ LoadFieldFromOffset(kWord, result, field, Field::value_offset());
+  __ LoadFieldFromOffset(kWord, result, field, Field::static_value_offset());
 }
 
 
@@ -2257,10 +2261,12 @@
   __ LoadObject(temp, field());
   if (this->value()->NeedsStoreBuffer()) {
     __ StoreIntoObject(temp,
-        FieldAddress(temp, Field::value_offset()), value, CanValueBeSmi());
+                       FieldAddress(temp, Field::static_value_offset()),
+                       value,
+                       CanValueBeSmi());
   } else {
     __ StoreIntoObjectNoBarrier(
-        temp, FieldAddress(temp, Field::value_offset()), value);
+        temp, FieldAddress(temp, Field::static_value_offset()), value);
   }
 }
 
@@ -2320,7 +2326,7 @@
                       R0,  // instance
                       R3,  // end address
                       R6,
-                      R9);
+                      R10);
   // R0: new object start as a tagged pointer.
   // R3: new object end address.
 
@@ -2337,12 +2343,12 @@
   // Initialize all array elements to raw_null.
   // R0: new object start as a tagged pointer.
   // R3: new object end address.
-  // R9: iterator which initially points to the start of the variable
+  // R10: iterator which initially points to the start of the variable
   // data area to be initialized.
   // R6: null
   if (num_elements > 0) {
     const intptr_t array_size = instance_size - sizeof(RawArray);
-    __ LoadImmediate(R6, reinterpret_cast<intptr_t>(Object::null()));
+    __ LoadObject(R6, Object::null_object());
     if (num_elements >= 2) {
       __ mov(R7, Operand(R6));
     } else {
@@ -2351,12 +2357,12 @@
       __ LoadImmediate(R7, 0x1);
 #endif  // DEBUG
     }
-    __ AddImmediate(R9, R0, sizeof(RawArray) - kHeapObjectTag);
+    __ AddImmediate(R10, R0, sizeof(RawArray) - kHeapObjectTag);
     if (array_size < (kInlineArraySize * kWordSize)) {
-      __ InitializeFieldsNoBarrierUnrolled(R0, R9, 0, num_elements * kWordSize,
+      __ InitializeFieldsNoBarrierUnrolled(R0, R10, 0, num_elements * kWordSize,
                                            R6, R7);
     } else {
-      __ InitializeFieldsNoBarrier(R0, R9, R3, R6, R7);
+      __ InitializeFieldsNoBarrier(R0, R10, R3, R6, R7);
     }
   }
   __ b(done);
@@ -2393,8 +2399,8 @@
       return;
     }
   }
-  const Code& stub = Code::Handle(compiler->isolate(),
-                                  StubCode::AllocateArray_entry()->code());
+  const Code& stub = Code::ZoneHandle(compiler->zone(),
+                                      StubCode::AllocateArray_entry()->code());
   compiler->AddStubCallTarget(stub);
   compiler->GenerateCall(token_pos(),
                          *StubCode::AllocateArray_entry(),
@@ -2611,7 +2617,7 @@
   Label type_arguments_instantiated;
   const intptr_t len = type_arguments().Length();
   if (type_arguments().IsRawInstantiatedRaw(len)) {
-    __ LoadImmediate(IP, reinterpret_cast<intptr_t>(Object::null()));
+    __ LoadObject(IP, Object::null_object());
     __ cmp(instantiator_reg, Operand(IP));
     __ b(&type_arguments_instantiated, EQ);
   }
@@ -2683,8 +2689,8 @@
     compiler->SaveLiveRegisters(locs);
 
     __ LoadImmediate(R1, instruction_->num_context_variables());
-    const Code& stub = Code::Handle(compiler->isolate(),
-                                    StubCode::AllocateContext_entry()->code());
+    const Code& stub = Code::ZoneHandle(
+        compiler->zone(), StubCode::AllocateContext_entry()->code());
     compiler->AddStubCallTarget(stub);
     compiler->GenerateCall(instruction_->token_pos(),
                            *StubCode::AllocateContext_entry(),
@@ -2766,7 +2772,7 @@
   Register temp = locs()->temp(0).reg();
   Label call_runtime, no_call;
 
-  __ ldr(temp, FieldAddress(field, Field::value_offset()));
+  __ ldr(temp, FieldAddress(field, Field::static_value_offset()));
   __ CompareObject(temp, Object::sentinel());
   __ b(&call_runtime, EQ);
 
@@ -2828,8 +2834,8 @@
                                 compiler->assembler()->CodeSize(),
                                 catch_handler_types_,
                                 needs_stacktrace());
-
   // Restore the pool pointer.
+  __ RestoreCodePointer();
   __ LoadPoolPointer();
 
   if (HasParallelMove()) {
@@ -2876,6 +2882,7 @@
       const Register value = instruction_->locs()->temp(0).reg();
       __ Comment("CheckStackOverflowSlowPathOsr");
       __ Bind(osr_entry_label());
+      ASSERT(FLAG_allow_absolute_addresses);
       __ LoadImmediate(IP, flags_address);
       __ LoadImmediate(value, Isolate::kOsrRequest);
       __ str(value, Address(IP));
@@ -2920,7 +2927,7 @@
   CheckStackOverflowSlowPath* slow_path = new CheckStackOverflowSlowPath(this);
   compiler->AddSlowPathCode(slow_path);
 
-  if (compiler->is_optimizing()) {
+  if (compiler->is_optimizing() && FLAG_allow_absolute_addresses) {
     __ LoadImmediate(IP, Isolate::Current()->stack_limit_address());
     __ ldr(IP, Address(IP));
   } else {
@@ -3747,7 +3754,7 @@
 
     if ((value()->Type()->ToNullableCid() == box_cid) &&
         value()->Type()->is_nullable()) {
-      __ CompareImmediate(box, reinterpret_cast<intptr_t>(Object::null()));
+      __ CompareObject(box, Object::null_object());
       __ b(deopt, EQ);
     } else {
       __ tst(box, Operand(kSmiTagMask));
@@ -5906,8 +5913,7 @@
                                         ICData::kDeoptCheckClass,
                                         licm_hoisted_ ? ICData::kHoisted : 0);
   if (IsNullCheck()) {
-    __ CompareImmediate(locs()->in(0).reg(),
-                        reinterpret_cast<intptr_t>(Object::null()));
+    __ CompareObject(locs()->in(0).reg(), Object::null_object());
     ASSERT(DeoptIfNull() || DeoptIfNotNull());
     Condition cond = DeoptIfNull() ? EQ : NE;
     __ b(deopt, cond);
@@ -6215,14 +6221,17 @@
         } else {
           if (shift == 32) {
             __ mov(out_lo, Operand(left_hi));
-          } else {
+          } else if (shift < 64) {
             __ Asr(out_lo, left_hi, Operand(shift - 32));
+          } else {
+            __ Asr(out_lo, left_hi, Operand(31));
           }
           __ Asr(out_hi, left_hi, Operand(31));
         }
         break;
       }
       case Token::kSHL: {
+        ASSERT(shift < 64);
         if (shift < 32) {
           __ Lsr(out_hi, left_lo, Operand(32 - shift));
           __ orr(out_hi, out_hi, Operand(left_hi, LSL, shift));
@@ -6636,13 +6645,10 @@
 void GotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
   if (!compiler->is_optimizing()) {
     if (FLAG_emit_edge_counters) {
-      compiler->EmitEdgeCounter();
+      compiler->EmitEdgeCounter(block()->preorder_number());
     }
     // Add a deoptimization descriptor for deoptimizing instructions that
-    // may be inserted before this instruction.  On ARM this descriptor
-    // points after the edge counter code so that we can reuse the same
-    // pattern matching code as at call sites, which matches backwards from
-    // the end of the pattern.
+    // may be inserted before this instruction.
     compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt,
                                    GetDeoptId(),
                                    Scanner::kNoSourcePos);
@@ -6677,9 +6683,10 @@
 void IndirectGotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
   Register target_address_reg = locs()->temp_slot(0)->reg();
 
-  // Load from [current frame pointer] + kPcMarkerSlotFromFp.
-  __ ldr(target_address_reg, Address(FP, kPcMarkerSlotFromFp * kWordSize));
-
+  // Offset is relative to entry pc.
+  const intptr_t entry_to_pc_offset = __ CodeSize() + Instr::kPCReadOffset;
+  __ mov(target_address_reg, Operand(PC));
+  __ AddImmediate(target_address_reg, target_address_reg, -entry_to_pc_offset);
   // Add the offset.
   Register offset_reg = locs()->in(0).reg();
   Operand offset_opr =
@@ -6811,9 +6818,8 @@
 
 
 void AllocateObjectInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  Isolate* isolate = compiler->isolate();
-  const Code& stub = Code::Handle(isolate,
-                                  StubCode::GetAllocationStubForClass(cls()));
+  const Code& stub = Code::ZoneHandle(
+      compiler->zone(), StubCode::GetAllocationStubForClass(cls()));
   const StubEntry stub_entry(stub);
   compiler->GenerateCall(token_pos(),
                          stub_entry,
diff --git a/runtime/vm/intermediate_language_arm64.cc b/runtime/vm/intermediate_language_arm64.cc
index e126292..892a296 100644
--- a/runtime/vm/intermediate_language_arm64.cc
+++ b/runtime/vm/intermediate_language_arm64.cc
@@ -23,6 +23,7 @@
 
 namespace dart {
 
+DECLARE_FLAG(bool, allow_absolute_addresses);
 DECLARE_FLAG(bool, emit_edge_counters);
 DECLARE_FLAG(int, optimization_counter_threshold);
 DECLARE_FLAG(bool, use_osr);
@@ -218,17 +219,18 @@
   // R4: Arguments descriptor.
   // R0: Function.
   ASSERT(locs()->in(0).reg() == R0);
-  __ LoadFieldFromOffset(R2, R0, Function::instructions_offset());
+  __ LoadFieldFromOffset(CODE_REG, R0, Function::code_offset());
+  __ LoadFieldFromOffset(R2, R0, Function::entry_point_offset());
 
   // R2: instructions.
   // R5: Smi 0 (no IC data; the lazy-compile stub expects a GC-safe value).
   __ LoadImmediate(R5, 0);
-  __ AddImmediate(R2, R2, Instructions::HeaderSize() - kHeapObjectTag);
+  //??
   __ blr(R2);
   compiler->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 = Isolate::ToDeoptAfter(deopt_id());
+  const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id());
   if (compiler->is_optimizing()) {
     compiler->AddDeoptIndexAtCall(deopt_id_after, token_pos());
   }
@@ -791,31 +793,38 @@
   // Compute the effective address. When running under the simulator,
   // this is a redirection address that forces the simulator to call
   // into the runtime system.
-  uword entry = reinterpret_cast<uword>(native_c_function());
+  uword entry;
   const intptr_t argc_tag = NativeArguments::ComputeArgcTag(function());
   const bool is_leaf_call =
     (argc_tag & NativeArguments::AutoSetupScopeMask()) == 0;
-  const StubEntry* stub_entry = NULL;
-  if (is_bootstrap_native() || is_leaf_call) {
+  const StubEntry* stub_entry;
+  if (link_lazily()) {
     stub_entry = StubCode::CallBootstrapCFunction_entry();
-#if defined(USING_SIMULATOR)
-    entry = Simulator::RedirectExternalReference(
-        entry, Simulator::kBootstrapNativeCall, function().NumParameters());
-#endif
+    entry = NativeEntry::LinkNativeCallEntry();
   } else {
-    // In the case of non bootstrap native methods the CallNativeCFunction
-    // stub generates the redirection address when running under the simulator
-    // and hence we do not change 'entry' here.
-    stub_entry = StubCode::CallNativeCFunction_entry();
+    entry = reinterpret_cast<uword>(native_c_function());
+    if (is_bootstrap_native() || is_leaf_call) {
+      stub_entry = StubCode::CallBootstrapCFunction_entry();
 #if defined(USING_SIMULATOR)
-    if (!function().IsNativeAutoSetupScope()) {
       entry = Simulator::RedirectExternalReference(
-          entry, Simulator::kBootstrapNativeCall, function().NumParameters());
-    }
+          entry, Simulator::kBootstrapNativeCall, NativeEntry::kNumArguments);
 #endif
+    } else {
+      // In the case of non bootstrap native methods the CallNativeCFunction
+      // stub generates the redirection address when running under the simulator
+      // and hence we do not change 'entry' here.
+      stub_entry = StubCode::CallNativeCFunction_entry();
+#if defined(USING_SIMULATOR)
+      if (!function().IsNativeAutoSetupScope()) {
+        entry = Simulator::RedirectExternalReference(
+            entry, Simulator::kBootstrapNativeCall, NativeEntry::kNumArguments);
+      }
+#endif
+    }
   }
-  __ LoadImmediate(R5, entry);
   __ LoadImmediate(R1, argc_tag);
+  ExternalLabel label(entry);
+  __ LoadNativeEntry(R5, &label);
   compiler->GenerateCall(token_pos(),
                          *stub_entry,
                          RawPcDescriptors::kOther,
@@ -839,8 +848,8 @@
   ASSERT(compiler->is_optimizing());
   const Register char_code = locs()->in(0).reg();
   const Register result = locs()->out(0).reg();
-  __ LoadImmediate(
-      result, reinterpret_cast<uword>(Symbols::PredefinedAddress()));
+
+  __ ldr(result, Address(THR, Thread::predefined_symbols_address_offset()));
   __ AddImmediate(
       result, result, Symbols::kNullCharCodeSymbolOffset * kWordSize);
   __ SmiUntag(TMP, char_code);  // Untag to use scaled adress mode.
@@ -934,14 +943,8 @@
 void LoadClassIdInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
   const Register object = locs()->in(0).reg();
   const Register result = locs()->out(0).reg();
-  static const intptr_t kSmiCidSource =
-      static_cast<intptr_t>(kSmiCid) << RawObject::kClassIdTagPos;
 
-  __ LoadImmediate(TMP, reinterpret_cast<int64_t>(&kSmiCidSource) + 1);
-  __ tsti(object, Immediate(kSmiTagMask));
-  __ csel(TMP, TMP, object, EQ);
-  __ LoadClassId(result, TMP);
-  __ SmiTag(result);
+  __ LoadTaggedClassIdMayBeSmi(result, object);
 }
 
 
@@ -1667,16 +1670,14 @@
         result_(result) { }
 
   virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
-    Isolate* isolate = compiler->isolate();
-
     if (Assembler::EmittingComments()) {
       __ Comment("%s slow path allocation of %s",
                  instruction_->DebugName(),
                  String::Handle(cls_.PrettyName()).ToCString());
     }
     __ Bind(entry_label());
-    const Code& stub =
-        Code::Handle(isolate, StubCode::GetAllocationStubForClass(cls_));
+    const Code& stub = Code::ZoneHandle(compiler->zone(),
+        StubCode::GetAllocationStubForClass(cls_));
     const StubEntry stub_entry(stub);
 
     LocationSummary* locs = instruction_->locs();
@@ -1959,7 +1960,7 @@
 void LoadStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
   const Register field = locs()->in(0).reg();
   const Register result = locs()->out(0).reg();
-  __ LoadFieldFromOffset(result, field, Field::value_offset());
+  __ LoadFieldFromOffset(result, field, Field::static_value_offset());
 }
 
 
@@ -1981,9 +1982,11 @@
   __ LoadObject(temp, field());
   if (this->value()->NeedsStoreBuffer()) {
     __ StoreIntoObjectOffset(
-        temp, Field::value_offset(), value, CanValueBeSmi());
+        temp, Field::static_value_offset(), value, CanValueBeSmi());
   } else {
-    __ StoreIntoObjectOffsetNoBarrier(temp, Field::value_offset(), value);
+    __ StoreIntoObjectOffsetNoBarrier(temp,
+                                      Field::static_value_offset(),
+                                      value);
   }
 }
 
@@ -2119,8 +2122,8 @@
       return;
     }
   }
-  const Code& stub = Code::Handle(compiler->isolate(),
-                                  StubCode::AllocateArray_entry()->code());
+  const Code& stub = Code::ZoneHandle(compiler->zone(),
+                                      StubCode::AllocateArray_entry()->code());
   compiler->AddStubCallTarget(stub);
   compiler->GenerateCall(token_pos(),
                          *StubCode::AllocateArray_entry(),
@@ -2397,8 +2400,8 @@
     compiler->SaveLiveRegisters(locs);
 
     __ LoadImmediate(R1, instruction_->num_context_variables());
-    const Code& stub = Code::Handle(compiler->isolate(),
-                                    StubCode::AllocateContext_entry()->code());
+    const Code& stub = Code::ZoneHandle(
+        compiler->zone(), StubCode::AllocateContext_entry()->code());
     compiler->AddStubCallTarget(stub);
     compiler->GenerateCall(instruction_->token_pos(),
                            *StubCode::AllocateContext_entry(),
@@ -2480,7 +2483,7 @@
   Register temp = locs()->temp(0).reg();
   Label call_runtime, no_call;
 
-  __ ldr(temp, FieldAddress(field, Field::value_offset()));
+  __ ldr(temp, FieldAddress(field, Field::static_value_offset()));
   __ CompareObject(temp, Object::sentinel());
   __ b(&call_runtime, EQ);
 
@@ -2544,6 +2547,7 @@
                                 needs_stacktrace());
 
   // Restore the pool pointer.
+  __ RestoreCodePointer();
   __ LoadPoolPointer();
 
   if (HasParallelMove()) {
@@ -2588,6 +2592,7 @@
       const Register value = instruction_->locs()->temp(0).reg();
       __ Comment("CheckStackOverflowSlowPathOsr");
       __ Bind(osr_entry_label());
+      ASSERT(FLAG_allow_absolute_addresses);
       __ LoadImmediate(TMP, flags_address);
       __ LoadImmediate(value, Isolate::kOsrRequest);
       __ str(value, Address(TMP));
@@ -2632,7 +2637,7 @@
   CheckStackOverflowSlowPath* slow_path = new CheckStackOverflowSlowPath(this);
   compiler->AddSlowPathCode(slow_path);
 
-  if (compiler->is_optimizing()) {
+  if (compiler->is_optimizing() && FLAG_allow_absolute_addresses) {
     __ LoadImmediate(TMP, Isolate::Current()->stack_limit_address());
     __ ldr(TMP, Address(TMP));
   } else {
@@ -5403,13 +5408,10 @@
 void GotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
   if (!compiler->is_optimizing()) {
     if (FLAG_emit_edge_counters) {
-      compiler->EmitEdgeCounter();
+      compiler->EmitEdgeCounter(block()->preorder_number());
     }
     // Add a deoptimization descriptor for deoptimizing instructions that
-    // may be inserted before this instruction.  On ARM64 this descriptor
-    // points after the edge counter code so that we can reuse the same
-    // pattern matching code as at call sites, which matches backwards from
-    // the end of the pattern.
+    // may be inserted before this instruction.
     compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt,
                                    GetDeoptId(),
                                    Scanner::kNoSourcePos);
@@ -5444,8 +5446,14 @@
 void IndirectGotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
   Register target_address_reg = locs()->temp_slot(0)->reg();
 
-  // Load from [current frame pointer] + kPcMarkerSlotFromFp.
-  __ ldr(target_address_reg, Address(FP, kPcMarkerSlotFromFp * kWordSize));
+  // Load code entry point.
+  const intptr_t entry_offset = __ CodeSize();
+  if (Utils::IsInt(21, -entry_offset)) {
+    __ adr(target_address_reg, Immediate(-entry_offset));
+  } else {
+    __ adr(target_address_reg, Immediate(0));
+    __ AddImmediate(target_address_reg, target_address_reg, -entry_offset);
+  }
 
   // Add the offset.
   Register offset_reg = locs()->in(0).reg();
@@ -5572,9 +5580,8 @@
 
 
 void AllocateObjectInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  Isolate* isolate = compiler->isolate();
-  const Code& stub = Code::Handle(isolate,
-                                  StubCode::GetAllocationStubForClass(cls()));
+  const Code& stub = Code::ZoneHandle(
+      compiler->zone(), StubCode::GetAllocationStubForClass(cls()));
   const StubEntry stub_entry(stub);
   compiler->GenerateCall(token_pos(),
                          stub_entry,
diff --git a/runtime/vm/intermediate_language_ia32.cc b/runtime/vm/intermediate_language_ia32.cc
index 3f4d4dc..eab55fb 100644
--- a/runtime/vm/intermediate_language_ia32.cc
+++ b/runtime/vm/intermediate_language_ia32.cc
@@ -151,15 +151,19 @@
   const intptr_t kNumInputs = 0;
   return LocationSummary::Make(zone,
                                kNumInputs,
-                               Location::RequiresRegister(),
+                               Assembler::IsSafe(value())
+                                   ? Location::Constant(this)
+                                   : Location::RequiresRegister(),
                                LocationSummary::kNoCall);
 }
 
 
 void ConstantInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
   // The register allocator drops constant definitions that have no uses.
-  if (!locs()->out(0).IsInvalid()) {
-    Register result = locs()->out(0).reg();
+  Location out = locs()->out(0);
+  ASSERT(out.IsRegister() || out.IsConstant() || out.IsInvalid());
+  if (out.IsRegister()) {
+    Register result = out.reg();
     __ LoadObjectSafely(result, value());
   }
 }
@@ -828,11 +832,19 @@
   } else {
     __ leal(EAX, Address(EBP, kFirstLocalSlotFromFp * kWordSize));
   }
-  __ movl(ECX, Immediate(reinterpret_cast<uword>(native_c_function())));
   __ movl(EDX, Immediate(argc_tag));
-  const StubEntry* stub_entry = (is_bootstrap_native() || is_leaf_call) ?
-      StubCode::CallBootstrapCFunction_entry() :
-      StubCode::CallNativeCFunction_entry();
+
+  const StubEntry* stub_entry;
+  if (link_lazily()) {
+    stub_entry = StubCode::CallBootstrapCFunction_entry();
+    __ movl(ECX, Immediate(NativeEntry::LinkNativeCallEntry()));
+  } else {
+    stub_entry = (is_bootstrap_native() || is_leaf_call) ?
+        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,
@@ -1648,16 +1660,14 @@
         result_(result) { }
 
   virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
-    Isolate* isolate = compiler->isolate();
-
     if (Assembler::EmittingComments()) {
       __ Comment("%s slow path allocation of %s",
                  instruction_->DebugName(),
                  String::Handle(cls_.PrettyName()).ToCString());
     }
     __ Bind(entry_label());
-    const Code& stub =
-        Code::Handle(isolate, StubCode::GetAllocationStubForClass(cls_));
+    const Code& stub = Code::ZoneHandle(
+        compiler->zone(), StubCode::GetAllocationStubForClass(cls_));
     const StubEntry stub_entry(stub);
 
     LocationSummary* locs = instruction_->locs();
@@ -1965,7 +1975,7 @@
 void LoadStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
   Register field = locs()->in(0).reg();
   Register result = locs()->out(0).reg();
-  __ movl(result, FieldAddress(field, Field::value_offset()));
+  __ movl(result, FieldAddress(field, Field::static_value_offset()));
 }
 
 
@@ -1987,10 +1997,12 @@
   __ LoadObject(temp, field());
   if (this->value()->NeedsStoreBuffer()) {
     __ StoreIntoObject(temp,
-        FieldAddress(temp, Field::value_offset()), value, CanValueBeSmi());
+                       FieldAddress(temp, Field::static_value_offset()),
+                       value,
+                       CanValueBeSmi());
   } else {
     __ StoreIntoObjectNoBarrier(
-        temp, FieldAddress(temp, Field::value_offset()), value);
+        temp, FieldAddress(temp, Field::static_value_offset()), value);
   }
 }
 
@@ -2128,8 +2140,8 @@
   }
 
   __ Bind(&slow_path);
-  const Code& stub = Code::Handle(compiler->isolate(),
-                                  StubCode::AllocateArray_entry()->code());
+  const Code& stub = Code::ZoneHandle(compiler->zone(),
+                                      StubCode::AllocateArray_entry()->code());
   compiler->AddStubCallTarget(stub);
   compiler->GenerateCall(token_pos(),
                          *StubCode::AllocateArray_entry(),
@@ -2403,8 +2415,8 @@
     compiler->SaveLiveRegisters(locs);
 
     __ movl(EDX, Immediate(instruction_->num_context_variables()));
-    const Code& stub = Code::Handle(compiler->isolate(),
-                                    StubCode::AllocateContext_entry()->code());
+    const Code& stub = Code::ZoneHandle(
+        compiler->zone(), StubCode::AllocateContext_entry()->code());
     compiler->AddStubCallTarget(stub);
     compiler->GenerateCall(instruction_->token_pos(),
                            *StubCode::AllocateContext_entry(),
@@ -2487,7 +2499,7 @@
 
   Label call_runtime, no_call;
 
-  __ movl(temp, FieldAddress(field, Field::value_offset()));
+  __ movl(temp, FieldAddress(field, Field::static_value_offset()));
   __ CompareObject(temp, Object::sentinel());
   __ j(EQUAL, &call_runtime);
 
@@ -6076,7 +6088,7 @@
           __ 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 - 32));
+            __ sarl(left_lo, Immediate(shift > 63 ? 31 : shift - 32));
           }
         } else {
           __ shrdl(left_lo, left_hi, Immediate(shift));
@@ -6085,6 +6097,7 @@
         break;
       }
       case Token::kSHL: {
+        ASSERT(shift < 64);
         if (can_overflow()) {
           Register temp1 = locs()->temp(0).reg();
           Register temp2 = locs()->temp(1).reg();
@@ -6534,13 +6547,10 @@
 void GotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
   if (!compiler->is_optimizing()) {
     if (FLAG_emit_edge_counters) {
-      compiler->EmitEdgeCounter();
+      compiler->EmitEdgeCounter(block()->preorder_number());
     }
     // Add a deoptimization descriptor for deoptimizing instructions that
-    // may be inserted before this instruction.  This descriptor points
-    // after the edge counter for uniformity with ARM and MIPS, where we can
-    // reuse pattern matching that matches backwards from the end of the
-    // pattern.
+    // may be inserted before this instruction.
     compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt,
                                    GetDeoptId(),
                                    Scanner::kNoSourcePos);
@@ -6573,20 +6583,22 @@
 
 
 void IndirectGotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  Register target_address_reg = locs()->temp_slot(0)->reg();
+  Register target_reg = locs()->temp_slot(0)->reg();
 
-  // Load from [current frame pointer] + kPcMarkerSlotFromFp.
-  __ movl(target_address_reg, Address(EBP, kPcMarkerSlotFromFp * kWordSize));
+  // Load code object from frame.
+  __ movl(target_reg, Address(EBP, kPcMarkerSlotFromFp * kWordSize));
+  // Load instructions entry point.
+  __ movl(target_reg, FieldAddress(target_reg, Code::entry_point_offset()));
 
   // Add the offset.
   Register offset_reg = locs()->in(0).reg();
   if (offset()->definition()->representation() == kTagged) {
     __ SmiUntag(offset_reg);
   }
-  __ addl(target_address_reg, offset_reg);
+  __ addl(target_reg, offset_reg);
 
   // Jump to the absolute address.
-  __ jmp(target_address_reg);
+  __ jmp(target_reg);
 }
 
 
@@ -6761,18 +6773,17 @@
 
   // EBX: Code (compiled code or lazy compile stub).
   ASSERT(locs()->in(0).reg() == EAX);
-  __ movl(EBX, FieldAddress(EAX, Function::instructions_offset()));
+  __ movl(EBX, FieldAddress(EAX, Function::entry_point_offset()));
 
   // EAX: Function.
   // EDX: Arguments descriptor array.
   // ECX: Smi 0 (no IC data; the lazy-compile stub expects a GC-safe value).
   __ xorl(ECX, ECX);
-  __ addl(EBX, Immediate(Instructions::HeaderSize() - kHeapObjectTag));
   __ call(EBX);
   compiler->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 = Isolate::ToDeoptAfter(deopt_id());
+  const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id());
   if (compiler->is_optimizing()) {
     compiler->AddDeoptIndexAtCall(deopt_id_after, token_pos());
   }
@@ -6815,9 +6826,8 @@
 
 
 void AllocateObjectInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  Isolate* isolate = compiler->isolate();
-  const Code& stub = Code::Handle(isolate,
-                                  StubCode::GetAllocationStubForClass(cls()));
+  const Code& stub = Code::ZoneHandle(
+      compiler->zone(), StubCode::GetAllocationStubForClass(cls()));
   const StubEntry stub_entry(stub);
   compiler->GenerateCall(token_pos(),
                          stub_entry,
diff --git a/runtime/vm/intermediate_language_mips.cc b/runtime/vm/intermediate_language_mips.cc
index 309198c..8c07b90 100644
--- a/runtime/vm/intermediate_language_mips.cc
+++ b/runtime/vm/intermediate_language_mips.cc
@@ -23,6 +23,7 @@
 
 namespace dart {
 
+DECLARE_FLAG(bool, allow_absolute_addresses);
 DECLARE_FLAG(bool, emit_edge_counters);
 DECLARE_FLAG(int, optimization_counter_threshold);
 DECLARE_FLAG(bool, use_osr);
@@ -272,13 +273,13 @@
   // S5: Smi 0 (no IC data; the lazy-compile stub expects a GC-safe value).
   ASSERT(locs()->in(0).reg() == T0);
   __ LoadImmediate(S5, 0);
-  __ lw(T2, FieldAddress(T0, Function::instructions_offset()));
-  __ AddImmediate(T2, Instructions::HeaderSize() - kHeapObjectTag);
+  __ lw(T2, FieldAddress(T0, Function::entry_point_offset()));
+  __ lw(CODE_REG, FieldAddress(T0, Function::code_offset()));
   __ jalr(T2);
   compiler->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 = Isolate::ToDeoptAfter(deopt_id());
+  const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id());
   if (compiler->is_optimizing()) {
     compiler->AddDeoptIndexAtCall(deopt_id_after, token_pos());
   }
@@ -989,31 +990,38 @@
   // Compute the effective address. When running under the simulator,
   // this is a redirection address that forces the simulator to call
   // into the runtime system.
-  uword entry = reinterpret_cast<uword>(native_c_function());
+  uword entry;
   const intptr_t argc_tag = NativeArguments::ComputeArgcTag(function());
   const bool is_leaf_call =
     (argc_tag & NativeArguments::AutoSetupScopeMask()) == 0;
-  const StubEntry* stub_entry = NULL;
-  if (is_bootstrap_native() || is_leaf_call) {
+  const StubEntry* stub_entry;
+  if (link_lazily()) {
     stub_entry = StubCode::CallBootstrapCFunction_entry();
-#if defined(USING_SIMULATOR)
-    entry = Simulator::RedirectExternalReference(
-        entry, Simulator::kBootstrapNativeCall, function().NumParameters());
-#endif
+    entry = NativeEntry::LinkNativeCallEntry();
   } else {
-    // In the case of non bootstrap native methods the CallNativeCFunction
-    // stub generates the redirection address when running under the simulator
-    // and hence we do not change 'entry' here.
-    stub_entry = StubCode::CallNativeCFunction_entry();
+    entry = reinterpret_cast<uword>(native_c_function());
+    if (is_bootstrap_native() || is_leaf_call) {
+      stub_entry = StubCode::CallBootstrapCFunction_entry();
 #if defined(USING_SIMULATOR)
-    if (!function().IsNativeAutoSetupScope()) {
       entry = Simulator::RedirectExternalReference(
-          entry, Simulator::kBootstrapNativeCall, function().NumParameters());
-    }
+          entry, Simulator::kBootstrapNativeCall, NativeEntry::kNumArguments);
 #endif
+    } else {
+      // In the case of non bootstrap native methods the CallNativeCFunction
+      // stub generates the redirection address when running under the simulator
+      // and hence we do not change 'entry' here.
+      stub_entry = StubCode::CallNativeCFunction_entry();
+#if defined(USING_SIMULATOR)
+      if (!function().IsNativeAutoSetupScope()) {
+        entry = Simulator::RedirectExternalReference(
+            entry, Simulator::kBootstrapNativeCall, NativeEntry::kNumArguments);
+      }
+#endif
+    }
   }
-  __ LoadImmediate(T5, entry);
   __ LoadImmediate(A1, argc_tag);
+  ExternalLabel label(entry);
+  __ LoadNativeEntry(T5, &label, kNotPatchable);
   compiler->GenerateCall(token_pos(),
                          *stub_entry,
                          RawPcDescriptors::kOther,
@@ -1040,8 +1048,7 @@
 
   __ Comment("StringFromCharCodeInstr");
 
-  __ LoadImmediate(result,
-                   reinterpret_cast<uword>(Symbols::PredefinedAddress()));
+  __ lw(result, Address(THR, Thread::predefined_symbols_address_offset()));
   __ AddImmediate(result, Symbols::kNullCharCodeSymbolOffset * kWordSize);
   __ sll(TMP, char_code, 1);  // Char code is a smi.
   __ addu(TMP, TMP, result);
@@ -1728,7 +1735,7 @@
           __ LoadImmediate(TMP, kNullCid);
           __ subu(CMPRES1, value_cid_reg, TMP);
         } else {
-          __ LoadImmediate(TMP, reinterpret_cast<int32_t>(Object::null()));
+          __ LoadObject(TMP, Object::null_object());
           __ subu(CMPRES1, value_reg, TMP);
         }
       }
@@ -1837,16 +1844,14 @@
         result_(result) { }
 
   virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
-    Isolate* isolate = compiler->isolate();
-
     if (Assembler::EmittingComments()) {
       __ Comment("%s slow path allocation of %s",
                  instruction_->DebugName(),
                  String::Handle(cls_.PrettyName()).ToCString());
     }
     __ Bind(entry_label());
-    const Code& stub =
-        Code::Handle(isolate, StubCode::GetAllocationStubForClass(cls_));
+    const Code& stub = Code::ZoneHandle(
+        compiler->zone(), StubCode::GetAllocationStubForClass(cls_));
     const StubEntry stub_entry(stub);
 
     LocationSummary* locs = instruction_->locs();
@@ -2084,7 +2089,9 @@
   __ Comment("LoadStaticFieldInstr");
   Register field = locs()->in(0).reg();
   Register result = locs()->out(0).reg();
-  __ LoadFromOffset(result, field, Field::value_offset() - kHeapObjectTag);
+  __ LoadFromOffset(result,
+                    field,
+                    Field::static_value_offset() - kHeapObjectTag);
 }
 
 
@@ -2107,10 +2114,12 @@
   __ LoadObject(temp, field());
   if (this->value()->NeedsStoreBuffer()) {
     __ StoreIntoObject(temp,
-        FieldAddress(temp, Field::value_offset()), value, CanValueBeSmi());
+                       FieldAddress(temp, Field::static_value_offset()),
+                       value,
+                       CanValueBeSmi());
   } else {
     __ StoreIntoObjectNoBarrier(
-        temp, FieldAddress(temp, Field::value_offset()), value);
+        temp, FieldAddress(temp, Field::static_value_offset()), value);
   }
 }
 
@@ -2193,7 +2202,7 @@
   // T7: null.
   if (num_elements > 0) {
     const intptr_t array_size = instance_size - sizeof(RawArray);
-    __ LoadImmediate(T7, reinterpret_cast<int32_t>(Object::null()));
+    __ LoadObject(T7, Object::null_object());
     __ AddImmediate(T2, V0, sizeof(RawArray) - kHeapObjectTag);
     if (array_size < (kInlineArraySize * kWordSize)) {
       intptr_t current_offset = 0;
@@ -2246,8 +2255,8 @@
   }
 
   __ Bind(&slow_path);
-  const Code& stub = Code::Handle(compiler->isolate(),
-                                  StubCode::AllocateArray_entry()->code());
+  const Code& stub = Code::ZoneHandle(compiler->zone(),
+                                      StubCode::AllocateArray_entry()->code());
   compiler->AddStubCallTarget(stub);
   compiler->GenerateCall(token_pos(),
                          *StubCode::AllocateArray_entry(),
@@ -2498,8 +2507,8 @@
     compiler->SaveLiveRegisters(locs);
 
     __ LoadImmediate(T1, instruction_->num_context_variables());
-    const Code& stub = Code::Handle(compiler->isolate(),
-                                    StubCode::AllocateContext_entry()->code());
+    const Code& stub = Code::ZoneHandle(
+        compiler->zone(), StubCode::AllocateContext_entry()->code());
     compiler->AddStubCallTarget(stub);
     compiler->GenerateCall(instruction_->token_pos(),
                            *StubCode::AllocateContext_entry(),
@@ -2584,7 +2593,7 @@
   Label call_runtime, no_call;
   __ Comment("InitStaticFieldInstr");
 
-  __ lw(temp, FieldAddress(field, Field::value_offset()));
+  __ lw(temp, FieldAddress(field, Field::static_value_offset()));
   __ BranchEqual(temp, Object::sentinel(), &call_runtime);
   __ BranchNotEqual(temp, Object::transition_sentinel(), &no_call);
 
@@ -2654,11 +2663,8 @@
                                 catch_handler_types_,
                                 needs_stacktrace());
   // Restore pool pointer.
-  __ GetNextPC(CMPRES1, TMP);
-  const intptr_t object_pool_pc_dist =
-     Instructions::HeaderSize() - Instructions::object_pool_offset() +
-     compiler->assembler()->CodeSize() - 1 * Instr::kInstrSize;
-  __ LoadFromOffset(PP, CMPRES1, -object_pool_pc_dist);
+  __ RestoreCodePointer();
+  __ LoadPoolPointer();
 
   if (HasParallelMove()) {
     compiler->parallel_move_resolver()->EmitNativeCode(parallel_move());
@@ -2704,6 +2710,7 @@
       Register value = instruction_->locs()->temp(0).reg();
       __ Comment("CheckStackOverflowSlowPathOsr");
       __ Bind(osr_entry_label());
+      ASSERT(FLAG_allow_absolute_addresses);
       __ LoadImmediate(TMP, flags_address);
       __ LoadImmediate(value, Isolate::kOsrRequest);
       __ sw(value, Address(TMP));
@@ -2749,7 +2756,7 @@
   CheckStackOverflowSlowPath* slow_path = new CheckStackOverflowSlowPath(this);
   compiler->AddSlowPathCode(slow_path);
 
-  if (compiler->is_optimizing()) {
+  if (compiler->is_optimizing() && FLAG_allow_absolute_addresses) {
     __ LoadImmediate(TMP, Isolate::Current()->stack_limit_address());
     __ lw(CMPRES1, Address(TMP));
   } else {
@@ -4924,12 +4931,19 @@
           __ or_(out_lo, out_lo, TMP);
           __ sra(out_hi, left_hi, shift);
         } else {
-          __ sra(out_lo, left_hi, shift - 32);
+          if (shift == 32) {
+            __ mov(out_lo, left_hi);
+          } else if (shift < 64) {
+            __ sra(out_lo, left_hi, shift - 32);
+          } else {
+            __ sra(out_lo, left_hi, 31);
+          }
           __ sra(out_hi, left_hi, 31);
         }
         break;
       }
       case Token::kSHL: {
+        ASSERT(shift < 64);
         if (shift < 32) {
           __ srl(out_hi, left_lo, 32 - shift);
           __ sll(TMP, left_hi, shift);
@@ -5375,13 +5389,10 @@
   __ Comment("GotoInstr");
   if (!compiler->is_optimizing()) {
     if (FLAG_emit_edge_counters) {
-      compiler->EmitEdgeCounter();
+      compiler->EmitEdgeCounter(block()->preorder_number());
     }
     // Add a deoptimization descriptor for deoptimizing instructions that
-    // may be inserted before this instruction.  On MIPS this descriptor
-    // points after the edge counter code so that we can reuse the same
-    // pattern matching code as at call sites, which matches backwards from
-    // the end of the pattern.
+    // may be inserted before this instruction.
     compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt,
                                    GetDeoptId(),
                                    Scanner::kNoSourcePos);
@@ -5414,20 +5425,22 @@
 
 
 void IndirectGotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  Register target_address_reg = locs()->temp_slot(0)->reg();
+  Register target_reg = locs()->temp_slot(0)->reg();
 
-  // Load from [current frame pointer] + kPcMarkerSlotFromFp.
-  __ lw(target_address_reg, Address(FP, kPcMarkerSlotFromFp * kWordSize));
+  __ GetNextPC(target_reg, TMP);
+  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);
   }
-  __ addu(target_address_reg, target_address_reg, offset_reg);
+  __ addu(target_reg, target_reg, offset_reg);
 
   // Jump to the absolute address.
-  __ jr(target_address_reg);
+  __ jr(target_reg);
 }
 
 
@@ -5545,9 +5558,8 @@
 
 void AllocateObjectInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
   __ Comment("AllocateObjectInstr");
-  Isolate* isolate = compiler->isolate();
-  const Code& stub = Code::Handle(isolate,
-                                  StubCode::GetAllocationStubForClass(cls()));
+  const Code& stub = Code::ZoneHandle(
+      compiler->zone(), StubCode::GetAllocationStubForClass(cls()));
   const StubEntry stub_entry(stub);
   compiler->GenerateCall(token_pos(),
                          stub_entry,
diff --git a/runtime/vm/intermediate_language_x64.cc b/runtime/vm/intermediate_language_x64.cc
index 927c699..cc19675 100644
--- a/runtime/vm/intermediate_language_x64.cc
+++ b/runtime/vm/intermediate_language_x64.cc
@@ -22,6 +22,7 @@
 
 namespace dart {
 
+DECLARE_FLAG(bool, allow_absolute_addresses);
 DECLARE_FLAG(bool, emit_edge_counters);
 DECLARE_FLAG(int, optimization_counter_threshold);
 DECLARE_FLAG(bool, throw_on_javascript_int_overflow);
@@ -237,15 +238,19 @@
   const intptr_t kNumInputs = 0;
   return LocationSummary::Make(zone,
                                kNumInputs,
-                               Location::RequiresRegister(),
+                               Assembler::IsSafe(value())
+                                   ? Location::Constant(this)
+                                   : Location::RequiresRegister(),
                                LocationSummary::kNoCall);
 }
 
 
 void ConstantInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
   // The register allocator drops constant definitions that have no uses.
-  if (!locs()->out(0).IsInvalid()) {
-    Register result = locs()->out(0).reg();
+  Location out = locs()->out(0);
+  ASSERT(out.IsRegister() || out.IsConstant() || out.IsInvalid());
+  if (out.IsRegister()) {
+    Register result = out.reg();
     __ LoadObject(result, value());
   }
 }
@@ -781,14 +786,21 @@
   } else {
     __ leaq(RAX, Address(RBP, kFirstLocalSlotFromFp * kWordSize));
   }
-  __ LoadImmediate(
-      RBX, Immediate(reinterpret_cast<uword>(native_c_function())));
   __ LoadImmediate(R10, Immediate(argc_tag));
-  const StubEntry& stub_entry = (is_bootstrap_native() || is_leaf_call) ?
-      *StubCode::CallBootstrapCFunction_entry() :
-      *StubCode::CallNativeCFunction_entry();
+  const StubEntry* stub_entry;
+  if (link_lazily()) {
+    stub_entry = StubCode::CallBootstrapCFunction_entry();
+    ExternalLabel label(NativeEntry::LinkNativeCallEntry());
+    __ LoadNativeEntry(RBX, &label, kPatchable);
+  } else {
+    stub_entry = (is_bootstrap_native() || is_leaf_call)
+        ? 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,
+                         *stub_entry,
                          RawPcDescriptors::kOther,
                          locs());
   __ popq(result);
@@ -822,8 +834,8 @@
   ASSERT(compiler->is_optimizing());
   Register char_code = locs()->in(0).reg();
   Register result = locs()->out(0).reg();
-  __ LoadImmediate(result,
-      Immediate(reinterpret_cast<uword>(Symbols::PredefinedAddress())));
+
+  __ movq(result, Address(THR, Thread::predefined_symbols_address_offset()));
   __ movq(result, Address(result,
                           char_code,
                           TIMES_HALF_WORD_SIZE,  // Char code is a smi.
@@ -1657,16 +1669,14 @@
         result_(result) { }
 
   virtual void EmitNativeCode(FlowGraphCompiler* compiler) {
-    Isolate* isolate = compiler->isolate();
-
     if (Assembler::EmittingComments()) {
       __ Comment("%s slow path allocation of %s",
                  instruction_->DebugName(),
                  String::Handle(cls_.PrettyName()).ToCString());
     }
     __ Bind(entry_label());
-    const Code& stub =
-        Code::Handle(isolate, StubCode::GetAllocationStubForClass(cls_));
+    const Code& stub = Code::ZoneHandle(compiler->zone(),
+        StubCode::GetAllocationStubForClass(cls_));
     const StubEntry stub_entry(stub);
 
     LocationSummary* locs = instruction_->locs();
@@ -1967,7 +1977,7 @@
 void LoadStaticFieldInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
   Register field = locs()->in(0).reg();
   Register result = locs()->out(0).reg();
-  __ movq(result, FieldAddress(field, Field::value_offset()));
+  __ movq(result, FieldAddress(field, Field::static_value_offset()));
 }
 
 
@@ -1989,10 +1999,12 @@
   __ LoadObject(temp, field());
   if (this->value()->NeedsStoreBuffer()) {
     __ StoreIntoObject(temp,
-        FieldAddress(temp, Field::value_offset()), value, CanValueBeSmi());
+                       FieldAddress(temp, Field::static_value_offset()),
+                       value,
+                       CanValueBeSmi());
   } else {
     __ StoreIntoObjectNoBarrier(
-        temp, FieldAddress(temp, Field::value_offset()), value);
+        temp, FieldAddress(temp, Field::static_value_offset()), value);
   }
 }
 
@@ -2127,8 +2139,8 @@
   }
 
   __ Bind(&slow_path);
-  const Code& stub = Code::Handle(compiler->isolate(),
-                                  StubCode::AllocateArray_entry()->code());
+  const Code& stub = Code::ZoneHandle(compiler->zone(),
+                                      StubCode::AllocateArray_entry()->code());
   compiler->AddStubCallTarget(stub);
   compiler->GenerateCall(token_pos(),
                          *StubCode::AllocateArray_entry(),
@@ -2400,8 +2412,8 @@
     compiler->SaveLiveRegisters(locs);
 
     __ LoadImmediate(R10, Immediate(instruction_->num_context_variables()));
-    const Code& stub = Code::Handle(compiler->isolate(),
-                                    StubCode::AllocateContext_entry()->code());
+    const Code& stub = Code::ZoneHandle(
+        compiler->zone(), StubCode::AllocateContext_entry()->code());
     compiler->AddStubCallTarget(stub);
     compiler->GenerateCall(instruction_->token_pos(),
                            *StubCode::AllocateContext_entry(),
@@ -2483,7 +2495,7 @@
 
   Label call_runtime, no_call;
 
-  __ movq(temp, FieldAddress(field, Field::value_offset()));
+  __ movq(temp, FieldAddress(field, Field::static_value_offset()));
   __ CompareObject(temp, Object::sentinel());
   __ j(EQUAL, &call_runtime);
 
@@ -2547,7 +2559,8 @@
                                 needs_stacktrace());
 
   // Restore the pool pointer.
-  __ LoadPoolPointer();
+  __ RestoreCodePointer();
+  __ LoadPoolPointer(PP);
 
   if (HasParallelMove()) {
     compiler->parallel_move_resolver()->EmitNativeCode(parallel_move());
@@ -2593,6 +2606,7 @@
       Register temp = instruction_->locs()->temp(0).reg();
       __ Comment("CheckStackOverflowSlowPathOsr");
       __ Bind(osr_entry_label());
+      ASSERT(FLAG_allow_absolute_addresses);
       __ LoadImmediate(temp, Immediate(flags_address));
       __ movq(Address(temp, 0), Immediate(Isolate::kOsrRequest));
     }
@@ -2639,7 +2653,7 @@
 
   Register temp = locs()->temp(0).reg();
   // Generate stack overflow check.
-  if (compiler->is_optimizing()) {
+  if (compiler->is_optimizing() && FLAG_allow_absolute_addresses) {
     __ LoadImmediate(
         temp, Immediate(Isolate::Current()->stack_limit_address()));
     __ cmpq(RSP, Address(temp, 0));
@@ -3398,9 +3412,7 @@
 
     if ((value()->Type()->ToNullableCid() == box_cid) &&
         value()->Type()->is_nullable()) {
-      const Immediate& raw_null =
-          Immediate(reinterpret_cast<intptr_t>(Object::null()));
-      __ cmpq(box, raw_null);
+      __ CompareObject(box, Object::null_object());
       __ j(EQUAL, deopt);
     } else {
       __ testq(box, Immediate(kSmiTagMask));
@@ -6174,13 +6186,10 @@
 void GotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
   if (!compiler->is_optimizing()) {
     if (FLAG_emit_edge_counters) {
-      compiler->EmitEdgeCounter();
+      compiler->EmitEdgeCounter(block()->preorder_number());
     }
     // Add a deoptimization descriptor for deoptimizing instructions that
-    // may be inserted before this instruction.  This descriptor points
-    // after the edge counter for uniformity with ARM and MIPS, where we can
-    // reuse pattern matching that matches backwards from the end of the
-    // pattern.
+    // may be inserted before this instruction.
     compiler->AddCurrentDescriptor(RawPcDescriptors::kDeopt,
                                    GetDeoptId(),
                                    Scanner::kNoSourcePos);
@@ -6214,10 +6223,18 @@
 
 void IndirectGotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
   Register offset_reg = locs()->in(0).reg();
-  Register target_address_reg = locs()->temp_slot(0)->reg();
+  Register target_address_reg = locs()->temp(0).reg();
+
+  {
+    const intptr_t kRIPRelativeLeaqSize = 7;
+    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);
+  }
 
   // Load from [current frame pointer] + kPcMarkerSlotFromFp.
-  __ movq(target_address_reg, Address(RBP, kPcMarkerSlotFromFp * kWordSize));
 
   // Calculate the final absolute address.
   if (offset()->definition()->representation() == kTagged) {
@@ -6336,18 +6353,18 @@
 
   // Function in RAX.
   ASSERT(locs()->in(0).reg() == RAX);
-  __ movq(RCX, FieldAddress(RAX, Function::instructions_offset()));
+  __ movq(CODE_REG, FieldAddress(RAX, Function::code_offset()));
+  __ movq(RCX, FieldAddress(RAX, Function::entry_point_offset()));
 
   // RAX: Function.
   // R10: Arguments descriptor array.
   // RBX: Smi 0 (no IC data; the lazy-compile stub expects a GC-safe value).
   __ xorq(RBX, RBX);
-  __ addq(RCX, Immediate(Instructions::HeaderSize() - kHeapObjectTag));
   __ call(RCX);
   compiler->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 = Isolate::ToDeoptAfter(deopt_id());
+  const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id());
   if (compiler->is_optimizing()) {
     compiler->AddDeoptIndexAtCall(deopt_id_after, token_pos());
   }
@@ -6390,9 +6407,8 @@
 
 
 void AllocateObjectInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
-  Isolate* isolate = compiler->isolate();
-  const Code& stub = Code::Handle(isolate,
-                                  StubCode::GetAllocationStubForClass(cls()));
+  const Code& stub = Code::ZoneHandle(
+      compiler->zone(), StubCode::GetAllocationStubForClass(cls()));
   const StubEntry stub_entry(stub);
   compiler->GenerateCall(token_pos(),
                          stub_entry,
@@ -6406,7 +6422,7 @@
 void DebugStepCheckInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
   ASSERT(!compiler->is_optimizing());
   __ CallPatchable(*StubCode::DebugStepCheck_entry());
-  compiler->AddCurrentDescriptor(stub_kind_, Isolate::kNoDeoptId, token_pos());
+  compiler->AddCurrentDescriptor(stub_kind_, Thread::kNoDeoptId, token_pos());
   compiler->RecordSafepoint(locs());
 }
 
diff --git a/runtime/vm/intrinsifier.cc b/runtime/vm/intrinsifier.cc
index 9bfb434..83681cd 100644
--- a/runtime/vm/intrinsifier.cc
+++ b/runtime/vm/intrinsifier.cc
@@ -36,12 +36,13 @@
 
 #if defined(DART_NO_SNAPSHOT)
 void Intrinsifier::InitializeState() {
-  Isolate* isolate = Isolate::Current();
-  Library& lib = Library::Handle(isolate);
-  Class& cls = Class::Handle(isolate);
-  Function& func = Function::Handle(isolate);
-  String& str = String::Handle(isolate);
-  Error& error = Error::Handle(isolate);
+  Thread* thread = Thread::Current();
+  Zone* zone = thread->zone();
+  Library& lib = Library::Handle(zone);
+  Class& cls = Class::Handle(zone);
+  Function& func = Function::Handle(zone);
+  String& str = String::Handle(zone);
+  Error& error = Error::Handle(zone);
 
 #define SETUP_FUNCTION(class_name, function_name, destination, fp)             \
   if (strcmp(#class_name, "::") == 0) {                                        \
@@ -51,7 +52,7 @@
     str = String::New(#class_name);                                            \
     cls = lib.LookupClassAllowPrivate(str);                                    \
     ASSERT(!cls.IsNull());                                                     \
-    error = cls.EnsureIsFinalized(isolate);                                    \
+    error = cls.EnsureIsFinalized(thread);                                     \
     if (!error.IsNull()) {                                                     \
       OS::PrintErr("%s\n", error.ToErrorCString());                            \
     }                                                                          \
@@ -132,14 +133,14 @@
   FlowGraphBuilder builder(parsed_function,
                            *ic_data_array,
                            NULL,  // NULL = not inlining.
-                           Isolate::kNoDeoptId);  // No OSR id.
+                           Thread::kNoDeoptId);  // No OSR id.
 
   intptr_t block_id = builder.AllocateBlockId();
   TargetEntryInstr* normal_entry =
       new TargetEntryInstr(block_id,
                            CatchClauseNode::kInvalidTryIndex);
   GraphEntryInstr* graph_entry = new GraphEntryInstr(
-      parsed_function, normal_entry, Isolate::kNoDeoptId);  // No OSR id.
+      parsed_function, normal_entry, Thread::kNoDeoptId);  // No OSR id.
   FlowGraph* graph = new FlowGraph(parsed_function, graph_entry, block_id);
   const Function& function = parsed_function.function();
   switch (function.recognized_kind()) {
@@ -155,7 +156,7 @@
   }
 
   if (FLAG_print_flow_graph && FlowGraphPrinter::ShouldPrint(function)) {
-    ISL_Print("Intrinsic graph before\n");
+    THR_Print("Intrinsic graph before\n");
     FlowGraphPrinter printer(*graph);
     printer.PrintBlocks();
   }
@@ -165,7 +166,7 @@
   allocator.AllocateRegisters();
 
   if (FLAG_print_flow_graph && FlowGraphPrinter::ShouldPrint(function)) {
-    ISL_Print("Intrinsic graph after\n");
+    THR_Print("Intrinsic graph after\n");
     FlowGraphPrinter printer(*graph);
     printer.PrintBlocks();
   }
@@ -211,6 +212,21 @@
 }
 
 
+static intptr_t CidForRepresentation(Representation rep) {
+  switch (rep) {
+    case kUnboxedDouble:
+      return kDoubleCid;
+    case kUnboxedFloat32x4:
+      return kFloat32x4Cid;
+    case kUnboxedUint32:
+      return kDynamicCid;  // smi or mint.
+    default:
+      UNREACHABLE();
+      return kIllegalCid;
+  }
+}
+
+
 class BlockBuilder : public ValueObject {
  public:
   BlockBuilder(FlowGraph* flow_graph, TargetEntryInstr* entry)
@@ -256,6 +272,16 @@
         new ConstantInstr(Object::ZoneHandle(Object::null())));
   }
 
+  Definition* AddUnboxInstr(Representation rep, Value* value) {
+    Definition* unboxed_value = AddDefinition(
+        UnboxInstr::Create(rep, value, Thread::kNoDeoptId));
+    // Manually adjust reaching type because there is no type propagation
+    // when building intrinsics.
+    unboxed_value->AsUnbox()->value()->SetReachingType(ZoneCompileType::Wrap(
+        CompileType::FromCid(CidForRepresentation(rep))));
+    return unboxed_value;
+  }
+
  private:
   FlowGraph* flow_graph_;
   BlockEntryInstr* entry_;
@@ -270,18 +296,18 @@
   intptr_t token_pos = builder->TokenPos();
   builder->AddInstruction(
       new CheckSmiInstr(new Value(index),
-                        Isolate::kNoDeoptId,
+                        Thread::kNoDeoptId,
                         token_pos));
 
   Definition* length = builder->AddDefinition(
       new LoadFieldInstr(new Value(array),
                          length_offset,
                          Type::ZoneHandle(Type::SmiType()),
-                         true));  // immutable
+                         Scanner::kNoSourcePos));
   builder->AddInstruction(
       new CheckArrayBoundInstr(new Value(length),
                                new Value(index),
-                               Isolate::kNoDeoptId));
+                               Thread::kNoDeoptId));
 }
 
 
@@ -300,7 +326,7 @@
                            new Value(index),
                            Instance::ElementSizeFor(kArrayCid),  // index scale
                            kArrayCid,
-                           Isolate::kNoDeoptId,
+                           Thread::kNoDeoptId,
                            builder.TokenPos()));
   builder.AddIntrinsicReturn(new Value(result));
   return true;
@@ -327,7 +353,7 @@
                            new Value(index),
                            1,  // index scale
                            kTypedDataUint8ArrayCid,
-                           Isolate::kNoDeoptId,
+                           Thread::kNoDeoptId,
                            builder.TokenPos()));
   builder.AddIntrinsicReturn(new Value(result));
   return true;
@@ -352,7 +378,7 @@
                            new Value(index),
                            1,  // index scale
                            kExternalTypedDataUint8ArrayCid,
-                           Isolate::kNoDeoptId,
+                           Thread::kNoDeoptId,
                            builder.TokenPos()));
   builder.AddIntrinsicReturn(new Value(result));
   return true;
@@ -372,7 +398,7 @@
 
   builder.AddInstruction(
       new CheckSmiInstr(new Value(value),
-                        Isolate::kNoDeoptId,
+                        Thread::kNoDeoptId,
                         builder.TokenPos()));
 
   builder.AddInstruction(
@@ -382,7 +408,7 @@
                             kNoStoreBarrier,
                             1,  // index scale
                             kTypedDataUint8ArrayCid,
-                            Isolate::kNoDeoptId,
+                            Thread::kNoDeoptId,
                             builder.TokenPos()));
   // Return null.
   Definition* null_def = builder.AddNullDefinition();
@@ -404,7 +430,7 @@
 
   builder.AddInstruction(
       new CheckSmiInstr(new Value(value),
-                        Isolate::kNoDeoptId,
+                        Thread::kNoDeoptId,
                         builder.TokenPos()));
   Definition* elements = builder.AddDefinition(
       new LoadUntaggedInstr(new Value(array),
@@ -416,7 +442,7 @@
                             kNoStoreBarrier,
                             1,  // index scale
                             kExternalTypedDataUint8ArrayCid,
-                            Isolate::kNoDeoptId,
+                            Thread::kNoDeoptId,
                             builder.TokenPos()));
   // Return null.
   Definition* null_def = builder.AddNullDefinition();
@@ -425,6 +451,60 @@
 }
 
 
+bool Intrinsifier::Build_Uint32ArraySetIndexed(FlowGraph* flow_graph) {
+  GraphEntryInstr* graph_entry = flow_graph->graph_entry();
+  TargetEntryInstr* normal_entry = graph_entry->normal_entry();
+  BlockBuilder builder(flow_graph, normal_entry);
+
+  Definition* value = builder.AddParameter(1);
+  Definition* index = builder.AddParameter(2);
+  Definition* array = builder.AddParameter(3);
+
+  PrepareIndexedOp(&builder, array, index, TypedData::length_offset());
+
+  Definition* unboxed_value =
+      builder.AddUnboxInstr(kUnboxedUint32, new Value(value));
+
+  builder.AddInstruction(
+      new StoreIndexedInstr(new Value(array),
+                            new Value(index),
+                            new Value(unboxed_value),
+                            kNoStoreBarrier,
+                            4,  // index scale
+                            kTypedDataUint32ArrayCid,
+                            Thread::kNoDeoptId,
+                            builder.TokenPos()));
+  // Return null.
+  Definition* null_def = builder.AddNullDefinition();
+  builder.AddIntrinsicReturn(new Value(null_def));
+  return true;
+}
+
+
+bool Intrinsifier::Build_Uint32ArrayGetIndexed(FlowGraph* flow_graph) {
+  GraphEntryInstr* graph_entry = flow_graph->graph_entry();
+  TargetEntryInstr* normal_entry = graph_entry->normal_entry();
+  BlockBuilder builder(flow_graph, normal_entry);
+
+  Definition* index = builder.AddParameter(1);
+  Definition* array = builder.AddParameter(2);
+
+  PrepareIndexedOp(&builder, array, index, TypedData::length_offset());
+
+  Definition* unboxed_value = builder.AddDefinition(
+      new LoadIndexedInstr(new Value(array),
+                           new Value(index),
+                           4,  // index scale
+                           kTypedDataUint32ArrayCid,
+                           Thread::kNoDeoptId,
+                           builder.TokenPos()));
+  Definition* result = builder.AddDefinition(
+      BoxInstr::Create(kUnboxedUint32, new Value(unboxed_value)));
+  builder.AddIntrinsicReturn(new Value(result));
+  return true;
+}
+
+
 bool Intrinsifier::Build_Float64ArraySetIndexed(FlowGraph* flow_graph) {
   if (!FlowGraphCompiler::SupportsUnboxedDoubles()) return false;
 
@@ -442,22 +522,16 @@
       flow_graph->function(),
       String::Handle(flow_graph->function().name()),
       Object::empty_array(),  // Dummy args. descr.
-      Isolate::kNoDeoptId,
+      Thread::kNoDeoptId,
       1));
   value_check.AddReceiverCheck(kDoubleCid, flow_graph->function());
   builder.AddInstruction(
       new CheckClassInstr(new Value(value),
-                          Isolate::kNoDeoptId,
+                          Thread::kNoDeoptId,
                           value_check,
                           builder.TokenPos()));
-  Definition* double_value = builder.AddDefinition(
-      UnboxInstr::Create(kUnboxedDouble,
-                         new Value(value),
-                         Isolate::kNoDeoptId));
-  // Manually adjust reaching type because there is no type propagation
-  // when building intrinsics.
-  double_value->AsUnbox()->value()->SetReachingType(
-      ZoneCompileType::Wrap(CompileType::FromCid(kDoubleCid)));
+  Definition* double_value =
+      builder.AddUnboxInstr(kUnboxedDouble, new Value(value));
 
   builder.AddInstruction(
       new StoreIndexedInstr(new Value(array),
@@ -466,7 +540,7 @@
                             kNoStoreBarrier,
                             8,  // index scale
                             kTypedDataFloat64ArrayCid,
-                            Isolate::kNoDeoptId,
+                            Thread::kNoDeoptId,
                             builder.TokenPos()));
   // Return null.
   Definition* null_def = builder.AddNullDefinition();
@@ -492,7 +566,7 @@
                            new Value(index),
                            8,  // index scale
                            kTypedDataFloat64ArrayCid,
-                           Isolate::kNoDeoptId,
+                           Thread::kNoDeoptId,
                            builder.TokenPos()));
   Definition* result = builder.AddDefinition(
       BoxInstr::Create(kUnboxedDouble, new Value(unboxed_value)));
@@ -501,6 +575,111 @@
 }
 
 
+static bool BuildBinaryFloat32x4Op(FlowGraph* flow_graph, Token::Kind kind) {
+  if (!FlowGraphCompiler::SupportsUnboxedSimd128()) return false;
+
+  GraphEntryInstr* graph_entry = flow_graph->graph_entry();
+  TargetEntryInstr* normal_entry = graph_entry->normal_entry();
+  BlockBuilder builder(flow_graph, normal_entry);
+
+  Definition* right = builder.AddParameter(1);
+  Definition* left = builder.AddParameter(2);
+
+  const ICData& value_check = ICData::ZoneHandle(ICData::New(
+      flow_graph->function(),
+      String::Handle(flow_graph->function().name()),
+      Object::empty_array(),  // Dummy args. descr.
+      Thread::kNoDeoptId,
+      1));
+  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()));
+  Definition* left_simd =
+      builder.AddUnboxInstr(kUnboxedFloat32x4, new Value(left));
+
+  Definition* right_simd =
+      builder.AddUnboxInstr(kUnboxedFloat32x4, new Value(right));
+
+  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));
+  return true;
+}
+
+
+bool Intrinsifier::Build_Float32x4Mul(FlowGraph* flow_graph) {
+  return BuildBinaryFloat32x4Op(flow_graph, Token::kMUL);
+}
+
+
+bool Intrinsifier::Build_Float32x4Sub(FlowGraph* flow_graph) {
+  return BuildBinaryFloat32x4Op(flow_graph, Token::kSUB);
+}
+
+
+bool Intrinsifier::Build_Float32x4Add(FlowGraph* flow_graph) {
+  return BuildBinaryFloat32x4Op(flow_graph, Token::kADD);
+}
+
+
+static bool BuildFloat32x4Shuffle(FlowGraph* flow_graph,
+                                  MethodRecognizer::Kind kind) {
+  if (!FlowGraphCompiler::SupportsUnboxedSimd128()) return false;
+  GraphEntryInstr* graph_entry = flow_graph->graph_entry();
+  TargetEntryInstr* normal_entry = graph_entry->normal_entry();
+  BlockBuilder builder(flow_graph, normal_entry);
+
+  Definition* receiver = builder.AddParameter(1);
+
+  Definition* unboxed_receiver =
+      builder.AddUnboxInstr(kUnboxedFloat32x4, new Value(receiver));
+
+  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)));
+  builder.AddIntrinsicReturn(new Value(result));
+  return true;
+}
+
+
+bool Intrinsifier::Build_Float32x4ShuffleX(FlowGraph* flow_graph) {
+  return BuildFloat32x4Shuffle(flow_graph,
+                               MethodRecognizer::kFloat32x4ShuffleX);
+}
+
+
+bool Intrinsifier::Build_Float32x4ShuffleY(FlowGraph* flow_graph) {
+  return BuildFloat32x4Shuffle(flow_graph,
+                               MethodRecognizer::kFloat32x4ShuffleY);
+}
+
+
+bool Intrinsifier::Build_Float32x4ShuffleZ(FlowGraph* flow_graph) {
+  return BuildFloat32x4Shuffle(flow_graph,
+                               MethodRecognizer::kFloat32x4ShuffleZ);
+}
+
+
+bool Intrinsifier::Build_Float32x4ShuffleW(FlowGraph* flow_graph) {
+  return BuildFloat32x4Shuffle(flow_graph,
+                               MethodRecognizer::kFloat32x4ShuffleW);
+}
+
+
 static bool BuildLoadField(FlowGraph* flow_graph, intptr_t offset) {
   GraphEntryInstr* graph_entry = flow_graph->graph_entry();
   TargetEntryInstr* normal_entry = graph_entry->normal_entry();
@@ -586,7 +765,7 @@
                            new Value(index),
                            Instance::ElementSizeFor(kArrayCid),  // index scale
                            kArrayCid,
-                           Isolate::kNoDeoptId,
+                           Thread::kNoDeoptId,
                            builder.TokenPos()));
   builder.AddIntrinsicReturn(new Value(result));
   return true;
@@ -622,7 +801,7 @@
                             kEmitStoreBarrier,
                             Instance::ElementSizeFor(kArrayCid),  // index scale
                             kArrayCid,
-                            Isolate::kNoDeoptId,
+                            Thread::kNoDeoptId,
                             builder.TokenPos()));
   // Return null.
   Definition* null_def = builder.AddNullDefinition();
@@ -643,12 +822,12 @@
       flow_graph->function(),
       String::Handle(flow_graph->function().name()),
       Object::empty_array(),  // Dummy args. descr.
-      Isolate::kNoDeoptId,
+      Thread::kNoDeoptId,
       1));
   value_check.AddReceiverCheck(kArrayCid, flow_graph->function());
   builder.AddInstruction(
       new CheckClassInstr(new Value(data),
-                          Isolate::kNoDeoptId,
+                          Thread::kNoDeoptId,
                           value_check,
                           builder.TokenPos()));
 
@@ -675,7 +854,7 @@
 
   builder.AddInstruction(
       new CheckSmiInstr(new Value(length),
-                        Isolate::kNoDeoptId,
+                        Thread::kNoDeoptId,
                         builder.TokenPos()));
   builder.AddInstruction(
       new StoreInstanceFieldInstr(GrowableObjectArray::length_offset(),
diff --git a/runtime/vm/intrinsifier_arm.cc b/runtime/vm/intrinsifier_arm.cc
index 70ce883..dd6d509 100644
--- a/runtime/vm/intrinsifier_arm.cc
+++ b/runtime/vm/intrinsifier_arm.cc
@@ -35,57 +35,14 @@
 intptr_t Intrinsifier::ParameterSlotFromSp() { return -1; }
 
 
-static intptr_t ComputeObjectArrayTypeArgumentsOffset() {
-  const Library& core_lib = Library::Handle(Library::CoreLibrary());
-  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();
-  ASSERT(field_offset != Class::kNoTypeArguments);
-  return field_offset;
-}
-
-
 // Intrinsify only for Smi value and index. Non-smi values need a store buffer
 // update. Array length is always a Smi.
 void Intrinsifier::ObjectArraySetIndexed(Assembler* assembler) {
-  Label fall_through;
-
   if (Isolate::Current()->flags().type_checks()) {
-    const intptr_t type_args_field_offset =
-        ComputeObjectArrayTypeArgumentsOffset();
-    // Inline simple tests (Smi, null), fallthrough if not positive.
-    const int32_t raw_null = reinterpret_cast<intptr_t>(Object::null());
-    Label checked_ok;
-    __ ldr(R2, Address(SP, 0 * kWordSize));  // Value.
-
-    // Null value is valid for any type.
-    __ CompareImmediate(R2, raw_null);
-    __ b(&checked_ok, EQ);
-
-    __ ldr(R1, Address(SP, 2 * kWordSize));  // Array.
-    __ ldr(R1, FieldAddress(R1, type_args_field_offset));
-
-    // R1: Type arguments of array.
-    __ CompareImmediate(R1, raw_null);
-    __ b(&checked_ok, EQ);
-
-    // Check if it's dynamic.
-    // Get type at index 0.
-    __ ldr(R0, FieldAddress(R1, TypeArguments::type_at_offset(0)));
-    __ CompareObject(R0, Type::ZoneHandle(Type::DynamicType()));
-    __ b(&checked_ok, EQ);
-
-    // Check for int and num.
-    __ tst(R2, Operand(kSmiTagMask));  // Value is Smi?
-    __ b(&fall_through, NE);  // Non-smi value.
-    __ CompareObject(R0, Type::ZoneHandle(Type::IntType()));
-    __ b(&checked_ok, EQ);
-    __ CompareObject(R0, Type::ZoneHandle(Type::Number()));
-    __ b(&fall_through, NE);
-    __ Bind(&checked_ok);
+    return;
   }
+
+  Label fall_through;
   __ ldr(R1, Address(SP, 1 * kWordSize));  // Index.
   __ tst(R1, Operand(kSmiTagMask));
   // Index not Smi.
@@ -179,8 +136,7 @@
   ASSERT(kSmiTagShift == 1);
   __ add(R1, R2, Operand(R1, LSL, 1));
   __ StoreIntoObject(R2, FieldAddress(R1, Array::data_offset()), R0);
-  const int32_t raw_null = reinterpret_cast<int32_t>(Object::null());
-  __ LoadImmediate(R0, raw_null);
+  __ LoadObject(R0, Object::null_object());
   __ Ret();
   __ Bind(&fall_through);
 }
@@ -551,7 +507,7 @@
   ASSERT(kSmiTagShift == 1);
   ASSERT(kSmiTag == 0);
   Label fall_through;
-
+  __ Push(R10);
   TestBothArgumentsSmis(assembler, &fall_through);
   __ CompareImmediate(R0, Smi::RawValue(Smi::kBits));
   __ b(&fall_through, HI);
@@ -579,10 +535,10 @@
   __ LoadImmediate(R7, 1);
   __ mov(R7, Operand(R7, LSL, R0));  // R7 <- 1 << R0
   __ sub(R7, R7, Operand(1));  // R7 <- R7 - 1
-  __ rsb(R9, R0, Operand(32));  // R9 <- 32 - R0
-  __ mov(R7, Operand(R7, LSL, R9));  // R7 <- R7 << R9
+  __ rsb(R10, R0, Operand(32));  // R10 <- 32 - R0
+  __ mov(R7, Operand(R7, LSL, R10));  // R7 <- R7 << R10
   __ and_(R7, R1, Operand(R7));  // R7 <- R7 & R1
-  __ mov(R7, Operand(R7, LSR, R9));  // R7 <- R7 >> R9
+  __ mov(R7, Operand(R7, LSR, R10));  // R7 <- R7 >> R10
   // Now R7 has the bits that fall off of R1 on a left shift.
   __ mov(R1, Operand(R1, LSL, R0));  // R1 gets the low bits.
 
@@ -593,8 +549,11 @@
 
   __ str(R1, FieldAddress(R0, Mint::value_offset()));
   __ str(R7, FieldAddress(R0, Mint::value_offset() + kWordSize));
+  __ Pop(R10);
   __ Ret();
   __ Bind(&fall_through);
+  ASSERT(CODE_REG == R10);
+  __ Pop(R10);
 }
 
 
@@ -820,12 +779,12 @@
   __ add(R6, R3, Operand(TypedData::data_offset() - kHeapObjectTag));
   // R7 = &x_digits[x_used]
   __ add(R7, R6, Operand(R2, LSL, 1));
-  // R9 = &r_digits[1]
-  __ add(R9, R4, Operand(TypedData::data_offset() - kHeapObjectTag +
+  // R10 = &r_digits[1]
+  __ add(R10, R4, Operand(TypedData::data_offset() - kHeapObjectTag +
                          Bigint::kBytesPerDigit));
-  // R9 = &r_digits[x_used + n ~/ _DIGIT_BITS + 1]
+  // R10 = &r_digits[x_used + n ~/ _DIGIT_BITS + 1]
   __ add(R0, R0, Operand(R2, ASR, 1));
-  __ add(R9, R9, Operand(R0, LSL, 2));
+  __ add(R10, R10, Operand(R0, LSL, 2));
   // R3 = n % _DIGIT_BITS
   __ and_(R3, R5, Operand(31));
   // R2 = 32 - R3
@@ -835,11 +794,11 @@
   __ Bind(&loop);
   __ ldr(R0, Address(R7, -Bigint::kBytesPerDigit, Address::PreIndex));
   __ orr(R1, R1, Operand(R0, LSR, R2));
-  __ str(R1, Address(R9, -Bigint::kBytesPerDigit, Address::PreIndex));
+  __ str(R1, Address(R10, -Bigint::kBytesPerDigit, Address::PreIndex));
   __ mov(R1, Operand(R0, LSL, R3));
   __ teq(R7, Operand(R6));
   __ b(&loop, NE);
-  __ str(R1, Address(R9, -Bigint::kBytesPerDigit, Address::PreIndex));
+  __ str(R1, Address(R10, -Bigint::kBytesPerDigit, Address::PreIndex));
   // Returning Object::null() is not required, since this method is private.
   __ Ret();
 }
@@ -856,15 +815,15 @@
   __ SmiUntag(R5);
   // R0 = n ~/ _DIGIT_BITS
   __ Asr(R0, R5, Operand(5));
-  // R9 = &r_digits[0]
-  __ add(R9, R4, Operand(TypedData::data_offset() - kHeapObjectTag));
+  // R10 = &r_digits[0]
+  __ add(R10, R4, Operand(TypedData::data_offset() - kHeapObjectTag));
   // R7 = &x_digits[n ~/ _DIGIT_BITS]
   __ add(R7, R3, Operand(TypedData::data_offset() - kHeapObjectTag));
   __ add(R7, R7, Operand(R0, LSL, 2));
   // R6 = &r_digits[x_used - n ~/ _DIGIT_BITS - 1]
   __ add(R0, R0, Operand(1));
   __ rsb(R0, R0, Operand(R2, ASR, 1));
-  __ add(R6, R9, Operand(R0, LSL, 2));
+  __ add(R6, R10, Operand(R0, LSL, 2));
   // R3 = n % _DIGIT_BITS
   __ and_(R3, R5, Operand(31));
   // R2 = 32 - R3
@@ -878,12 +837,12 @@
   __ Bind(&loop);
   __ ldr(R0, Address(R7, Bigint::kBytesPerDigit, Address::PostIndex));
   __ orr(R1, R1, Operand(R0, LSL, R2));
-  __ str(R1, Address(R9, Bigint::kBytesPerDigit, Address::PostIndex));
+  __ str(R1, Address(R10, Bigint::kBytesPerDigit, Address::PostIndex));
   __ mov(R1, Operand(R0, LSR, R3));
   __ Bind(&loop_entry);
-  __ teq(R9, Operand(R6));
+  __ teq(R10, Operand(R6));
   __ b(&loop, NE);
-  __ str(R1, Address(R9, 0));
+  __ str(R1, Address(R10, 0));
   // Returning Object::null() is not required, since this method is private.
   __ Ret();
 }
@@ -912,8 +871,8 @@
   // R7 = &digits[a_used >> 1], a_used is Smi.
   __ add(R7, R3, Operand(R4, LSL, 1));
 
-  // R9 = &digits[used >> 1], used is Smi.
-  __ add(R9, R3, Operand(R2, LSL, 1));
+  // R10 = &digits[used >> 1], used is Smi.
+  __ add(R10, R3, Operand(R2, LSL, 1));
 
   __ adds(R0, R0, Operand(0));  // carry flag = 0
   Label add_loop;
@@ -927,7 +886,7 @@
   __ b(&add_loop, NE);
 
   Label last_carry;
-  __ teq(R3, Operand(R9));  // Does not affect carry flag.
+  __ teq(R3, Operand(R10));  // Does not affect carry flag.
   __ b(&last_carry, EQ);  // If used - a_used == 0.
 
   Label carry_loop;
@@ -935,7 +894,7 @@
   // Loop used - a_used times, used - a_used > 0.
   __ ldr(R0, Address(R3, Bigint::kBytesPerDigit, Address::PostIndex));
   __ adcs(R0, R0, Operand(0));
-  __ teq(R3, Operand(R9));  // Does not affect carry flag.
+  __ teq(R3, Operand(R10));  // Does not affect carry flag.
   __ str(R0, Address(R6, Bigint::kBytesPerDigit, Address::PostIndex));
   __ b(&carry_loop, NE);
 
@@ -972,8 +931,8 @@
   // R7 = &digits[a_used >> 1], a_used is Smi.
   __ add(R7, R3, Operand(R4, LSL, 1));
 
-  // R9 = &digits[used >> 1], used is Smi.
-  __ add(R9, R3, Operand(R2, LSL, 1));
+  // R10 = &digits[used >> 1], used is Smi.
+  __ add(R10, R3, Operand(R2, LSL, 1));
 
   __ subs(R0, R0, Operand(0));  // carry flag = 1
   Label sub_loop;
@@ -987,7 +946,7 @@
   __ b(&sub_loop, NE);
 
   Label done;
-  __ teq(R3, Operand(R9));  // Does not affect carry flag.
+  __ teq(R3, Operand(R10));  // Does not affect carry flag.
   __ b(&done, EQ);  // If used - a_used == 0.
 
   Label carry_loop;
@@ -995,7 +954,7 @@
   // Loop used - a_used times, used - a_used > 0.
   __ ldr(R0, Address(R3, Bigint::kBytesPerDigit, Address::PostIndex));
   __ sbcs(R0, R0, Operand(0));
-  __ teq(R3, Operand(R9));  // Does not affect carry flag.
+  __ teq(R3, Operand(R10));  // Does not affect carry flag.
   __ str(R0, Address(R6, Bigint::kBytesPerDigit, Address::PostIndex));
   __ b(&carry_loop, NE);
 
@@ -1164,9 +1123,9 @@
 
   // int n = used - i - 1; while (--n >= 0) ...
   __ ldr(R0, Address(SP, 0 * kWordSize));  // used is Smi
-  __ sub(R9, R0, Operand(R2));
+  __ sub(R10, R0, Operand(R2));
   __ mov(R0, Operand(2));  // n = used - i - 2; if (n >= 0) ... while (--n >= 0)
-  __ rsbs(R9, R0, Operand(R9, ASR, kSmiTagSize));
+  __ rsbs(R10, R0, Operand(R10, ASR, kSmiTagSize));
 
   Label loop, done;
   __ b(&done, MI);
@@ -1177,7 +1136,7 @@
   // ajp: R5
   // c:   R7:R6
   // t:   R2:R1:R0 (not live at loop entry)
-  // n:   R9
+  // n:   R10
 
   // uint32_t xi = *xip++
   __ ldr(R2, Address(R4, Bigint::kBytesPerDigit, Address::PostIndex));
@@ -1200,7 +1159,7 @@
   __ str(R0, Address(R5, Bigint::kBytesPerDigit, Address::PostIndex));
 
   // while (--n >= 0)
-  __ subs(R9, R9, Operand(1));  // --n
+  __ subs(R10, R10, Operand(1));  // --n
   __ b(&loop, PL);
 
   __ Bind(&done);
@@ -1536,14 +1495,16 @@
       random_class.LookupStaticField(Symbols::_A()));
   ASSERT(!random_A_field.IsNull());
   ASSERT(random_A_field.is_const());
-  const Instance& a_value = Instance::Handle(random_A_field.value());
+  const Instance& a_value = Instance::Handle(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);
 
-  __ ldr(R0, Address(SP, 0 * kWordSize));  // Receiver.
-  __ ldr(R1, FieldAddress(R0, state_field.Offset()));  // Field '_state'.
+  // Receiver.
+  __ ldr(R0, Address(SP, 0 * kWordSize));
+  // Field '_state'.
+  __ ldr(R1, FieldAddress(R0, state_field.Offset()));
   // Addresses of _state[0] and _state[1].
 
   const int64_t disp_0 = Instance::DataOffsetFor(kTypedDataUint32ArrayCid);
@@ -1575,17 +1536,13 @@
 // Return type quickly for simple types (not parameterized and not signature).
 void Intrinsifier::ObjectRuntimeType(Assembler* assembler) {
   Label fall_through;
-  static const intptr_t kSmiCidSource = kSmiCid << RawObject::kClassIdTagPos;
   __ ldr(R0, Address(SP, 0 * kWordSize));
-
-  __ LoadImmediate(TMP, reinterpret_cast<int32_t>(&kSmiCidSource) + 1);
-  __ tst(R0, Operand(kSmiTagMask));
-  __ mov(TMP, Operand(R0), NE);
-  __ LoadClassId(R1, TMP);
+  __ LoadClassIdMayBeSmi(R1, R0);
   __ LoadClassById(R2, R1);
+
   // R2: class of instance (R0).
   __ ldr(R3, FieldAddress(R2, Class::signature_function_offset()));
-  __ CompareImmediate(R3, reinterpret_cast<int32_t>(Object::null()));
+  __ CompareObject(R3, Object::null_object());
   __ b(&fall_through, NE);
 
   __ ldrh(R3, FieldAddress(R2, Class::num_type_arguments_offset()));
@@ -1593,7 +1550,7 @@
   __ b(&fall_through, NE);
 
   __ ldr(R0, FieldAddress(R2, Class::canonical_types_offset()));
-  __ CompareImmediate(R0, reinterpret_cast<int32_t>(Object::null()));
+  __ CompareObject(R0, Object::null_object());
   __ b(&fall_through, EQ);
   __ Ret();
 
@@ -1660,14 +1617,7 @@
   __ ldrb(R1, Address(R0, R1));
   __ CompareImmediate(R1, Symbols::kNumberOfOneCharCodeSymbols);
   __ b(&fall_through, GE);
-  const ExternalLabel symbols_label(
-      reinterpret_cast<uword>(Symbols::PredefinedAddress()));
-  __ Push(PP);
-  __ LoadPoolPointer();
-  assembler->set_constant_pool_allowed(true);
-  __ LoadExternalLabel(R0, &symbols_label, kNotPatchable);
-  assembler->set_constant_pool_allowed(false);
-  __ Pop(PP);
+  __ ldr(R0, Address(THR, Thread::predefined_symbols_address_offset()));
   __ AddImmediate(R0, Symbols::kNullCharCodeSymbolOffset * kWordSize);
   __ ldr(R0, Address(R0, R1, LSL, 2));
   __ Ret();
@@ -1680,12 +1630,7 @@
   __ ldrh(R1, Address(R0, R1));
   __ CompareImmediate(R1, Symbols::kNumberOfOneCharCodeSymbols);
   __ b(&fall_through, GE);
-  __ Push(PP);
-  __ LoadPoolPointer();
-  assembler->set_constant_pool_allowed(true);
-  __ LoadExternalLabel(R0, &symbols_label, kNotPatchable);
-  assembler->set_constant_pool_allowed(false);
-  __ Pop(PP);
+  __ ldr(R0, Address(THR, Thread::predefined_symbols_address_offset()));
   __ AddImmediate(R0, Symbols::kNullCharCodeSymbolOffset * kWordSize);
   __ ldr(R0, Address(R0, R1, LSL, 2));
   __ Ret();
@@ -1772,7 +1717,8 @@
                                      Label* failure) {
   const Register length_reg = R2;
   Label fail;
-  __ MaybeTraceAllocation(kOneByteStringCid, R0, failure);
+  __ MaybeTraceAllocation(kOneByteStringCid, R0, failure,
+                          /* inline_isolate = */ false);
   __ mov(R6, Operand(length_reg));  // Save the length register.
   // TODO(koda): Protect against negative length and overflow here.
   __ SmiUntag(length_reg);
@@ -2022,13 +1968,11 @@
 
   // 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.
-  static const intptr_t arg_count = RegExpMacroAssembler::kParamCount;
-  __ LoadObject(R4, Array::Handle(ArgumentsDescriptor::New(arg_count)));
   __ eor(R5, R5, Operand(R5));
 
   // Tail-call the function.
-  __ ldr(R1, FieldAddress(R0, Function::instructions_offset()));
-  __ AddImmediate(R1, Instructions::HeaderSize() - kHeapObjectTag);
+  __ ldr(CODE_REG, FieldAddress(R0, Function::code_offset()));
+  __ ldr(R1, FieldAddress(R0, Function::entry_point_offset()));
   __ bx(R1);
 }
 
diff --git a/runtime/vm/intrinsifier_arm64.cc b/runtime/vm/intrinsifier_arm64.cc
index 4d27700..4441fe2 100644
--- a/runtime/vm/intrinsifier_arm64.cc
+++ b/runtime/vm/intrinsifier_arm64.cc
@@ -33,56 +33,14 @@
 intptr_t Intrinsifier::ParameterSlotFromSp() { return -1; }
 
 
-static intptr_t ComputeObjectArrayTypeArgumentsOffset() {
-  const Library& core_lib = Library::Handle(Library::CoreLibrary());
-  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();
-  ASSERT(field_offset != Class::kNoTypeArguments);
-  return field_offset;
-}
-
-
 // Intrinsify only for Smi value and index. Non-smi values need a store buffer
 // update. Array length is always a Smi.
 void Intrinsifier::ObjectArraySetIndexed(Assembler* assembler) {
-  Label fall_through;
-
   if (Isolate::Current()->flags().type_checks()) {
-    const intptr_t type_args_field_offset =
-        ComputeObjectArrayTypeArgumentsOffset();
-    // Inline simple tests (Smi, null), fallthrough if not positive.
-    Label checked_ok;
-    __ ldr(R2, Address(SP, 0 * kWordSize));  // Value.
-
-    // Null value is valid for any type.
-    __ CompareObject(R2, Object::null_object());
-    __ b(&checked_ok, EQ);
-
-    __ ldr(R1, Address(SP, 2 * kWordSize));  // Array.
-    __ ldr(R1, FieldAddress(R1, type_args_field_offset));
-
-    // R1: Type arguments of array.
-    __ CompareObject(R1, Object::null_object());
-    __ b(&checked_ok, EQ);
-
-    // Check if it's dynamic.
-    // Get type at index 0.
-    __ ldr(R0, FieldAddress(R1, TypeArguments::type_at_offset(0)));
-    __ CompareObject(R0, Type::ZoneHandle(Type::DynamicType()));
-    __ b(&checked_ok, EQ);
-
-    // Check for int and num.
-    __ tsti(R2, Immediate(Immediate(kSmiTagMask)));  // Value is Smi?
-    __ b(&fall_through, NE);  // Non-smi value.
-    __ CompareObject(R0, Type::ZoneHandle(Type::IntType()));
-    __ b(&checked_ok, EQ);
-    __ CompareObject(R0, Type::ZoneHandle(Type::Number()));
-    __ b(&fall_through, NE);
-    __ Bind(&checked_ok);
+    return;
   }
+
+  Label fall_through;
   __ ldr(R1, Address(SP, 1 * kWordSize));  // Index.
   __ tsti(R1, Immediate(kSmiTagMask));
   // Index not Smi.
@@ -229,8 +187,8 @@
   /* R1: potential next object start. */                                       \
   /* R2: allocation size. */                                                   \
   /* R3: heap. */                                                              \
-  __ ldr(R4, Address(R3, Heap::EndOffset(space)));                             \
-  __ cmp(R1, Operand(R4));                                                     \
+  __ ldr(R6, Address(R3, Heap::EndOffset(space)));                             \
+  __ cmp(R1, Operand(R6));                                                     \
   __ b(&fall_through, CS);                                                     \
                                                                                \
   /* Successfully allocated the object(s), now update top to point to */       \
@@ -1617,11 +1575,13 @@
       random_class.LookupStaticField(Symbols::_A()));
   ASSERT(!random_A_field.IsNull());
   ASSERT(random_A_field.is_const());
-  const Instance& a_value = Instance::Handle(random_A_field.value());
+  const Instance& a_value = Instance::Handle(random_A_field.StaticValue());
   const int64_t a_int_value = Integer::Cast(a_value).AsInt64Value();
 
-  __ ldr(R0, Address(SP, 0 * kWordSize));  // Receiver.
-  __ ldr(R1, FieldAddress(R0, state_field.Offset()));  // Field '_state'.
+  // Receiver.
+  __ ldr(R0, Address(SP, 0 * kWordSize));
+  // Field '_state'.
+  __ ldr(R1, FieldAddress(R0, state_field.Offset()));
 
   // Addresses of _state[0].
   const int64_t disp =
@@ -1736,12 +1696,7 @@
   __ ldr(R1, Address(R0, R1), kUnsignedByte);
   __ CompareImmediate(R1, Symbols::kNumberOfOneCharCodeSymbols);
   __ b(&fall_through, GE);
-  const ExternalLabel symbols_label(
-      reinterpret_cast<uword>(Symbols::PredefinedAddress()));
-  __ TagAndPushPP();
-  __ LoadPoolPointer();
-  __ LoadExternalLabel(R0, &symbols_label);
-  __ PopAndUntagPP();
+  __ ldr(R0, Address(THR, Thread::predefined_symbols_address_offset()));
   __ AddImmediate(
       R0, R0, Symbols::kNullCharCodeSymbolOffset * kWordSize);
   __ ldr(R0, Address(R0, R1, UXTX, Address::Scaled));
@@ -1755,10 +1710,7 @@
   __ ldr(R1, Address(R0, R1), kUnsignedHalfword);
   __ CompareImmediate(R1, Symbols::kNumberOfOneCharCodeSymbols);
   __ b(&fall_through, GE);
-  __ TagAndPushPP();
-  __ LoadPoolPointer();
-  __ LoadExternalLabel(R0, &symbols_label);
-  __ PopAndUntagPP();
+  __ ldr(R0, Address(THR, Thread::predefined_symbols_address_offset()));
   __ AddImmediate(
       R0, R0, Symbols::kNullCharCodeSymbolOffset * kWordSize);
   __ ldr(R0, Address(R0, R1, UXTX, Address::Scaled));
@@ -2097,13 +2049,11 @@
 
   // 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.
-  static const intptr_t arg_count = RegExpMacroAssembler::kParamCount;
-  __ LoadObject(R4, Array::Handle(ArgumentsDescriptor::New(arg_count)));
   __ eor(R5, R5, Operand(R5));
 
   // Tail-call the function.
-  __ ldr(R1, FieldAddress(R0, Function::instructions_offset()));
-  __ AddImmediate(R1, R1, Instructions::HeaderSize() - kHeapObjectTag);
+  __ ldr(CODE_REG, FieldAddress(R0, Function::code_offset()));
+  __ ldr(R1, FieldAddress(R0, Function::entry_point_offset()));
   __ br(R1);
 }
 
diff --git a/runtime/vm/intrinsifier_ia32.cc b/runtime/vm/intrinsifier_ia32.cc
index 11f93e6..d39f3b6 100644
--- a/runtime/vm/intrinsifier_ia32.cc
+++ b/runtime/vm/intrinsifier_ia32.cc
@@ -1635,13 +1635,15 @@
       random_class.LookupStaticField(Symbols::_A()));
   ASSERT(!random_A_field.IsNull());
   ASSERT(random_A_field.is_const());
-  const Instance& a_value = Instance::Handle(random_A_field.value());
+  const Instance& a_value = Instance::Handle(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);
-  __ movl(EAX, Address(ESP, + 1 * kWordSize));  // Receiver.
-  __ movl(EBX, FieldAddress(EAX, state_field.Offset()));  // Field '_state'.
+  // Receiver.
+  __ movl(EAX, Address(ESP, + 1 * kWordSize));
+  // Field '_state'.
+  __ movl(EBX, FieldAddress(EAX, state_field.Offset()));
   // Addresses of _state[0] and _state[1].
   const intptr_t scale = Instance::ElementSizeFor(kTypedDataUint32ArrayCid);
   const intptr_t offset = Instance::DataOffsetFor(kTypedDataUint32ArrayCid);
@@ -2108,13 +2110,10 @@
 
   // 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.
-  static const intptr_t arg_count = RegExpMacroAssembler::kParamCount;
-  __ LoadObject(EDX, Array::ZoneHandle(ArgumentsDescriptor::New(arg_count)));
   __ xorl(ECX, ECX);
 
   // Tail-call the function.
-  __ movl(EDI, FieldAddress(EAX, Function::instructions_offset()));
-  __ addl(EDI, Immediate(Instructions::HeaderSize() - kHeapObjectTag));
+  __ movl(EDI, FieldAddress(EAX, Function::entry_point_offset()));
   __ jmp(EDI);
 }
 
diff --git a/runtime/vm/intrinsifier_mips.cc b/runtime/vm/intrinsifier_mips.cc
index d66ffb2..7349e85 100644
--- a/runtime/vm/intrinsifier_mips.cc
+++ b/runtime/vm/intrinsifier_mips.cc
@@ -33,53 +33,14 @@
 intptr_t Intrinsifier::ParameterSlotFromSp() { return -1; }
 
 
-static intptr_t ComputeObjectArrayTypeArgumentsOffset() {
-  const Library& core_lib = Library::Handle(Library::CoreLibrary());
-  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();
-  ASSERT(field_offset != Class::kNoTypeArguments);
-  return field_offset;
-}
-
-
 // Intrinsify only for Smi value and index. Non-smi values need a store buffer
 // update. Array length is always a Smi.
 void Intrinsifier::ObjectArraySetIndexed(Assembler* assembler) {
-  Label fall_through;
-
   if (Isolate::Current()->flags().type_checks()) {
-    const intptr_t type_args_field_offset =
-        ComputeObjectArrayTypeArgumentsOffset();
-    // Inline simple tests (Smi, null), fallthrough if not positive.
-    Label checked_ok;
-    __ lw(T2, Address(SP, 0 * kWordSize));  // Value.
-
-    // Null value is valid for any type.
-    __ LoadImmediate(T7, reinterpret_cast<int32_t>(Object::null()));
-    __ beq(T2, T7, &checked_ok);
-
-    __ lw(T1, Address(SP, 2 * kWordSize));  // Array.
-    __ lw(T1, FieldAddress(T1, type_args_field_offset));
-
-    // T1: Type arguments of array.
-    __ beq(T1, T7, &checked_ok);
-
-    // Check if it's dynamic.
-    // Get type at index 0.
-    __ lw(T0, FieldAddress(T1, TypeArguments::type_at_offset(0)));
-    __ BranchEqual(T0, Type::ZoneHandle(Type::DynamicType()), &checked_ok);
-
-    // Check for int and num.
-    __ andi(CMPRES1, T2, Immediate(kSmiTagMask));
-    __ bne(CMPRES1, ZR, &fall_through);  // Non-smi value.
-
-    __ BranchEqual(T0, Type::ZoneHandle(Type::IntType()), &checked_ok);
-    __ BranchNotEqual(T0, Type::ZoneHandle(Type::Number()), &fall_through);
-    __ Bind(&checked_ok);
+    return;
   }
+
+  Label fall_through;
   __ lw(T1, Address(SP, 1 * kWordSize));  // Index.
   __ andi(CMPRES1, T1, Immediate(kSmiTagMask));
   // Index not Smi.
@@ -169,7 +130,7 @@
   __ StoreIntoObject(T2,
                      FieldAddress(T1, Array::data_offset()),
                      T0);
-  __ LoadImmediate(T7, reinterpret_cast<int32_t>(Object::null()));
+  __ LoadObject(T7, Object::null_object());
   __ Ret();
   __ delay_slot()->mov(V0, T7);
   __ Bind(&fall_through);
@@ -1634,14 +1595,16 @@
       random_class.LookupStaticField(Symbols::_A()));
   ASSERT(!random_A_field.IsNull());
   ASSERT(random_A_field.is_const());
-  const Instance& a_value = Instance::Handle(random_A_field.value());
+  const Instance& a_value = Instance::Handle(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);
 
-  __ lw(T0, Address(SP, 0 * kWordSize));  // Receiver.
-  __ lw(T1, FieldAddress(T0, state_field.Offset()));  // Field '_state'.
+  // Receiver.
+  __ lw(T0, Address(SP, 0 * kWordSize));
+  // Field '_state'.
+  __ lw(T1, FieldAddress(T0, state_field.Offset()));
 
   // Addresses of _state[0] and _state[1].
   const intptr_t scale = Instance::ElementSizeFor(kTypedDataUint32ArrayCid);
@@ -1767,16 +1730,7 @@
   __ lbu(T2, FieldAddress(T2, OneByteString::data_offset()));
   __ BranchUnsignedGreaterEqual(
       T2, Immediate(Symbols::kNumberOfOneCharCodeSymbols), &fall_through);
-  const ExternalLabel symbols_label(
-      reinterpret_cast<uword>(Symbols::PredefinedAddress()));
-  __ Push(PP);
-  __ Push(RA);
-  __ LoadPoolPointer();
-  assembler->set_constant_pool_allowed(true);
-  __ LoadExternalLabel(V0, &symbols_label, kNotPatchable);
-  assembler->set_constant_pool_allowed(false);
-  __ Pop(RA);
-  __ Pop(PP);
+  __ lw(V0, Address(THR, Thread::predefined_symbols_address_offset()));
   __ AddImmediate(V0, Symbols::kNullCharCodeSymbolOffset * kWordSize);
   __ sll(T2, T2, 2);
   __ addu(T2, T2, V0);
@@ -1790,14 +1744,7 @@
   __ lhu(T2, FieldAddress(T2, TwoByteString::data_offset()));
   __ BranchUnsignedGreaterEqual(
       T2, Immediate(Symbols::kNumberOfOneCharCodeSymbols), &fall_through);
-  __ Push(PP);
-  __ Push(RA);
-  __ LoadPoolPointer();
-  assembler->set_constant_pool_allowed(true);
-  __ LoadExternalLabel(V0, &symbols_label, kNotPatchable);
-  assembler->set_constant_pool_allowed(false);
-  __ Pop(RA);
-  __ Pop(PP);
+  __ lw(V0, Address(THR, Thread::predefined_symbols_address_offset()));
   __ AddImmediate(V0, Symbols::kNullCharCodeSymbolOffset * kWordSize);
   __ sll(T2, T2, 2);
   __ addu(T2, T2, V0);
@@ -2136,13 +2083,11 @@
 
   // 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.
-  static const intptr_t arg_count = RegExpMacroAssembler::kParamCount;
-  __ LoadObject(S4, Array::Handle(ArgumentsDescriptor::New(arg_count)));
   __ mov(S5, ZR);
 
   // Tail-call the function.
-  __ lw(T3, FieldAddress(T0, Function::instructions_offset()));
-  __ AddImmediate(T3, Instructions::HeaderSize() - kHeapObjectTag);
+  __ lw(CODE_REG, FieldAddress(T0, Function::code_offset()));
+  __ lw(T3, FieldAddress(T0, Function::entry_point_offset()));
   __ jr(T3);
 }
 
diff --git a/runtime/vm/intrinsifier_x64.cc b/runtime/vm/intrinsifier_x64.cc
index aeea84b..4598ddd 100644
--- a/runtime/vm/intrinsifier_x64.cc
+++ b/runtime/vm/intrinsifier_x64.cc
@@ -37,10 +37,11 @@
   if (Isolate::Current()->flags().type_checks()) {
     return;
   }
+
+  Label fall_through;
   __ movq(RDX, Address(RSP, + 1 * kWordSize));  // Value.
   __ movq(RCX, Address(RSP, + 2 * kWordSize));  // Index.
   __ movq(RAX, Address(RSP, + 3 * kWordSize));  // Array.
-  Label fall_through;
   __ testq(RCX, Immediate(kSmiTagMask));
   __ j(NOT_ZERO, &fall_through);
   // Range check.
@@ -1489,10 +1490,12 @@
       random_class.LookupStaticField(Symbols::_A()));
   ASSERT(!random_A_field.IsNull());
   ASSERT(random_A_field.is_const());
-  const Instance& a_value = Instance::Handle(random_A_field.value());
+  const Instance& a_value = Instance::Handle(random_A_field.StaticValue());
   const int64_t a_int_value = Integer::Cast(a_value).AsInt64Value();
-  __ movq(RAX, Address(RSP, + 1 * kWordSize));  // Receiver.
-  __ movq(RBX, FieldAddress(RAX, state_field.Offset()));  // Field '_state'.
+  // Receiver.
+  __ movq(RAX, Address(RSP, + 1 * kWordSize));
+  // Field '_state'.
+  __ movq(RBX, FieldAddress(RAX, state_field.Offset()));
   // Addresses of _state[0] and _state[1].
   const intptr_t scale = Instance::ElementSizeFor(kTypedDataUint32ArrayCid);
   const intptr_t offset = Instance::DataOffsetFor(kTypedDataUint32ArrayCid);
@@ -1597,25 +1600,18 @@
   __ movq(RCX, Address(RSP, + 1 * kWordSize));  // Index.
   __ movq(RAX, Address(RSP, + 2 * kWordSize));  // String.
   __ testq(RCX, Immediate(kSmiTagMask));
-  __ j(NOT_ZERO, &fall_through, Assembler::kNearJump);  // Non-smi index.
+  __ j(NOT_ZERO, &fall_through);  // Non-smi index.
   // Range check.
   __ cmpq(RCX, FieldAddress(RAX, String::length_offset()));
   // Runtime throws exception.
-  __ j(ABOVE_EQUAL, &fall_through, Assembler::kNearJump);
+  __ j(ABOVE_EQUAL, &fall_through);
   __ CompareClassId(RAX, kOneByteStringCid);
   __ j(NOT_EQUAL, &try_two_byte_string, Assembler::kNearJump);
   __ SmiUntag(RCX);
   __ movzxb(RCX, FieldAddress(RAX, RCX, TIMES_1, OneByteString::data_offset()));
   __ cmpq(RCX, Immediate(Symbols::kNumberOfOneCharCodeSymbols));
   __ j(GREATER_EQUAL, &fall_through);
-  const ExternalLabel symbols_label(
-      reinterpret_cast<uword>(Symbols::PredefinedAddress()));
-  __ pushq(PP);
-  __ LoadPoolPointer();
-  assembler->set_constant_pool_allowed(true);
-  __ LoadExternalLabel(RAX, &symbols_label, kNotPatchable);
-  assembler->set_constant_pool_allowed(false);
-  __ popq(PP);
+  __ movq(RAX, Address(THR, Thread::predefined_symbols_address_offset()));
   __ movq(RAX, Address(RAX,
                        RCX,
                        TIMES_8,
@@ -1624,17 +1620,12 @@
 
   __ Bind(&try_two_byte_string);
   __ CompareClassId(RAX, kTwoByteStringCid);
-  __ j(NOT_EQUAL, &fall_through, Assembler::kNearJump);
+  __ j(NOT_EQUAL, &fall_through);
   ASSERT(kSmiTagShift == 1);
   __ movzxw(RCX, FieldAddress(RAX, RCX, TIMES_1, OneByteString::data_offset()));
   __ cmpq(RCX, Immediate(Symbols::kNumberOfOneCharCodeSymbols));
   __ j(GREATER_EQUAL, &fall_through);
-  __ pushq(PP);
-  __ LoadPoolPointer();
-  assembler->set_constant_pool_allowed(true);
-  __ LoadExternalLabel(RAX, &symbols_label, kNotPatchable);
-  assembler->set_constant_pool_allowed(false);
-  __ popq(PP);
+  __ movq(RAX, Address(THR, Thread::predefined_symbols_address_offset()));
   __ movq(RAX, Address(RAX,
                        RCX,
                        TIMES_8,
@@ -1970,14 +1961,11 @@
 
   // 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.
-  static const intptr_t arg_count = RegExpMacroAssembler::kParamCount;
-  __ LoadObject(R10,
-      Array::ZoneHandle(ArgumentsDescriptor::New(arg_count)));
   __ xorq(RCX, RCX);
 
   // Tail-call the function.
-  __ movq(RDI, FieldAddress(RAX, Function::instructions_offset()));
-  __ addq(RDI, Immediate(Instructions::HeaderSize() - kHeapObjectTag));
+  __ movq(CODE_REG, FieldAddress(RAX, Function::code_offset()));
+  __ movq(RDI, FieldAddress(RAX, Function::entry_point_offset()));
   __ jmp(RDI);
 }
 
diff --git a/runtime/vm/isolate.cc b/runtime/vm/isolate.cc
index 933afd7..f7caee1 100644
--- a/runtime/vm/isolate.cc
+++ b/runtime/vm/isolate.cc
@@ -5,11 +5,15 @@
 #include "vm/isolate.h"
 
 #include "include/dart_api.h"
+#include "include/dart_native_api.h"
 #include "platform/assert.h"
 #include "platform/json.h"
+#include "vm/class_finalizer.h"
 #include "vm/code_observers.h"
+#include "vm/compiler.h"
 #include "vm/compiler_stats.h"
 #include "vm/coverage.h"
+#include "vm/dart_api_message.h"
 #include "vm/dart_api_state.h"
 #include "vm/dart_entry.h"
 #include "vm/debugger.h"
@@ -22,7 +26,6 @@
 #include "vm/object_store.h"
 #include "vm/object.h"
 #include "vm/os_thread.h"
-#include "vm/parser.h"
 #include "vm/port.h"
 #include "vm/profiler.h"
 #include "vm/reusable_handles.h"
@@ -38,12 +41,17 @@
 #include "vm/thread_interrupter.h"
 #include "vm/thread_registry.h"
 #include "vm/timeline.h"
+#include "vm/timeline_analysis.h"
 #include "vm/timer.h"
 #include "vm/visitor.h"
 
 
 namespace dart {
 
+DECLARE_FLAG(bool, print_metrics);
+DECLARE_FLAG(bool, timing);
+DECLARE_FLAG(bool, trace_service);
+
 DEFINE_FLAG(bool, trace_isolates, false,
             "Trace isolate creation and shut down.");
 DEFINE_FLAG(bool, pause_isolates_on_start, false,
@@ -53,13 +61,7 @@
 DEFINE_FLAG(bool, break_at_isolate_spawn, false,
             "Insert a one-time breakpoint at the entrypoint for all spawned "
             "isolates");
-DEFINE_FLAG(charp, isolate_log_filter, NULL,
-            "Log isolates whose name include the filter. "
-            "Default: service isolate log messages are suppressed.");
 
-DEFINE_FLAG(charp, timeline_trace_dir, NULL,
-            "Enable all timeline trace streams and output traces "
-            "into specified directory.");
 DEFINE_FLAG(int, new_gen_semi_max_size, (kWordSize <= 4) ? 16 : 32,
             "Max size of new gen semi space in MB");
 DEFINE_FLAG(int, old_gen_heap_size, 0,
@@ -95,7 +97,8 @@
                     "Enable checked mode.");
 
 
-// Quick access to the locally defined isolate() method.
+// Quick access to the locally defined thread() and isolate() methods.
+#define T (thread())
 #define I (isolate())
 
 #if defined(DEBUG)
@@ -147,6 +150,27 @@
 }
 
 
+void Isolate::SendInternalLibMessage(LibMsgId msg_id, uint64_t capability) {
+  const Array& msg = Array::Handle(Array::New(3));
+  Object& element = Object::Handle();
+
+  element = Smi::New(Message::kIsolateLibOOBMsg);
+  msg.SetAt(0, element);
+  element = Smi::New(msg_id);
+  msg.SetAt(1, element);
+  element = Capability::New(capability);
+  msg.SetAt(2, element);
+
+  uint8_t* data = NULL;
+  MessageWriter writer(&data, &allocator, false);
+  writer.WriteMessage(msg);
+
+  PortMap::PostMessage(new Message(main_port(),
+                                   data, writer.BytesWritten(),
+                                   Message::kOOBPriority));
+}
+
+
 class IsolateMessageHandler : public MessageHandler {
  public:
   explicit IsolateMessageHandler(Isolate* isolate);
@@ -154,7 +178,7 @@
 
   const char* name() const;
   void MessageNotify(Message::Priority priority);
-  bool HandleMessage(Message* message);
+  MessageStatus HandleMessage(Message* message);
   void NotifyPauseOnStart();
   void NotifyPauseOnExit();
 
@@ -166,31 +190,11 @@
   virtual Isolate* isolate() const { return isolate_; }
 
  private:
-  // Keep both these enums in sync with isolate_patch.dart.
-  // The different Isolate API message types.
-  enum {
-    kPauseMsg = 1,
-    kResumeMsg = 2,
-    kPingMsg = 3,
-    kKillMsg = 4,
-    kAddExitMsg = 5,
-    kDelExitMsg = 6,
-    kAddErrorMsg = 7,
-    kDelErrorMsg = 8,
-    kErrorFatalMsg = 9,
-  };
-  // The different Isolate API message priorities for ping and kill messages.
-  enum {
-    kImmediateAction = 0,
-    kBeforeNextEventAction = 1,
-    kAsEventAction = 2
-  };
-
   // A result of false indicates that the isolate should terminate the
   // processing of further events.
-  bool HandleLibMessage(const Array& message);
+  RawError* HandleLibMessage(const Array& message);
 
-  bool ProcessUnhandledException(const Error& result);
+  MessageStatus ProcessUnhandledException(const Error& result);
   Isolate* isolate_;
 };
 
@@ -211,50 +215,51 @@
 // Isolate library OOB messages are fixed sized arrays which have the
 // following format:
 // [ OOB dispatch, Isolate library dispatch, <message specific data> ]
-bool IsolateMessageHandler::HandleLibMessage(const Array& message) {
-  if (message.Length() < 2) return true;
-  const Object& type = Object::Handle(I, message.At(1));
-  if (!type.IsSmi()) return true;
+RawError* IsolateMessageHandler::HandleLibMessage(const Array& message) {
+  if (message.Length() < 2) return Error::null();
+  Zone* zone = I->current_zone();
+  const Object& type = Object::Handle(zone, message.At(1));
+  if (!type.IsSmi()) return Error::null();
   const intptr_t msg_type = Smi::Cast(type).Value();
   switch (msg_type) {
-    case kPauseMsg: {
+    case Isolate::kPauseMsg: {
       // [ OOB, kPauseMsg, pause capability, resume capability ]
-      if (message.Length() != 4) return true;
-      Object& obj = Object::Handle(I, message.At(2));
-      if (!I->VerifyPauseCapability(obj)) return true;
+      if (message.Length() != 4) return Error::null();
+      Object& obj = Object::Handle(zone, message.At(2));
+      if (!I->VerifyPauseCapability(obj)) return Error::null();
       obj = message.At(3);
-      if (!obj.IsCapability()) return true;
+      if (!obj.IsCapability()) return Error::null();
       if (I->AddResumeCapability(Capability::Cast(obj))) {
         increment_paused();
       }
       break;
     }
-    case kResumeMsg: {
+    case Isolate::kResumeMsg: {
       // [ OOB, kResumeMsg, pause capability, resume capability ]
-      if (message.Length() != 4) return true;
-      Object& obj = Object::Handle(I, message.At(2));
-      if (!I->VerifyPauseCapability(obj)) return true;
+      if (message.Length() != 4) return Error::null();
+      Object& obj = Object::Handle(zone, message.At(2));
+      if (!I->VerifyPauseCapability(obj)) return Error::null();
       obj = message.At(3);
-      if (!obj.IsCapability()) return true;
+      if (!obj.IsCapability()) return Error::null();
       if (I->RemoveResumeCapability(Capability::Cast(obj))) {
         decrement_paused();
       }
       break;
     }
-    case kPingMsg: {
+    case Isolate::kPingMsg: {
       // [ OOB, kPingMsg, responsePort, priority, response ]
-      if (message.Length() != 5) return true;
-      const Object& obj2 = Object::Handle(I, message.At(2));
-      if (!obj2.IsSendPort()) return true;
+      if (message.Length() != 5) return Error::null();
+      const Object& obj2 = Object::Handle(zone, message.At(2));
+      if (!obj2.IsSendPort()) return Error::null();
       const SendPort& send_port = SendPort::Cast(obj2);
-      const Object& obj3 = Object::Handle(I, message.At(3));
-      if (!obj3.IsSmi()) return true;
+      const Object& obj3 = Object::Handle(zone, message.At(3));
+      if (!obj3.IsSmi()) return Error::null();
       const intptr_t priority = Smi::Cast(obj3).Value();
-      const Object& obj4 = Object::Handle(I, message.At(4));
-      if (!obj4.IsInstance() && !obj4.IsNull()) return true;
+      const Object& obj4 = Object::Handle(zone, message.At(4));
+      if (!obj4.IsInstance() && !obj4.IsNull()) return Error::null();
       const Instance& response =
           obj4.IsNull() ? Instance::null_instance() : Instance::Cast(obj4);
-      if (priority == kImmediateAction) {
+      if (priority == Isolate::kImmediateAction) {
         uint8_t* data = NULL;
         intptr_t len = 0;
         SerializeObject(response, &data, &len, false);
@@ -262,81 +267,129 @@
                                          data, len,
                                          Message::kNormalPriority));
       } else {
-        ASSERT((priority == kBeforeNextEventAction) ||
-               (priority == kAsEventAction));
+        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(I, Smi::New(Message::kDelayedIsolateLibOOBMsg)));
-        message.SetAt(3, Smi::Handle(I, Smi::New(kImmediateAction)));
+        message.SetAt(0, Smi::Handle(zone,
+            Smi::New(Message::kDelayedIsolateLibOOBMsg)));
+        message.SetAt(3, Smi::Handle(zone,
+            Smi::New(Isolate::kImmediateAction)));
         uint8_t* data = NULL;
         intptr_t len = 0;
         SerializeObject(message, &data, &len, false);
-        this->PostMessage(new Message(Message::kIllegalPort,
-                                      data, len,
-                                      Message::kNormalPriority),
-                          priority == kBeforeNextEventAction /* at_head */);
+        this->PostMessage(
+            new Message(Message::kIllegalPort,
+                        data, len,
+                        Message::kNormalPriority),
+            priority == Isolate::kBeforeNextEventAction /* at_head */);
       }
       break;
     }
-    case kKillMsg: {
+    case Isolate::kKillMsg:
+    case Isolate::kInternalKillMsg:
+    case Isolate::kVMRestartMsg: {
       // [ OOB, kKillMsg, terminate capability, priority ]
-      if (message.Length() != 4) return true;
-      Object& obj = Object::Handle(I, message.At(3));
-      if (!obj.IsSmi()) return true;
+      if (message.Length() != 4) return Error::null();
+      Object& obj = Object::Handle(zone, message.At(3));
+      if (!obj.IsSmi()) return Error::null();
       const intptr_t priority = Smi::Cast(obj).Value();
-      if (priority == kImmediateAction) {
+      if (priority == Isolate::kImmediateAction) {
         obj = message.At(2);
-        // Signal that the isolate should stop execution.
-        return !I->VerifyTerminateCapability(obj);
+        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 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"));
+            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 UnwindError& error =
+                UnwindError::Handle(UnwindError::New(msg));
+            error.set_is_vm_restart(true);
+            return error.raw();
+          } else {
+            UNREACHABLE();
+          }
+        } else {
+          return Error::null();
+        }
       } else {
-        ASSERT((priority == kBeforeNextEventAction) ||
-               (priority == kAsEventAction));
+        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(I, Smi::New(Message::kDelayedIsolateLibOOBMsg)));
-        message.SetAt(3, Smi::Handle(I, Smi::New(kImmediateAction)));
+        message.SetAt(0, Smi::Handle(zone,
+            Smi::New(Message::kDelayedIsolateLibOOBMsg)));
+        message.SetAt(3, Smi::Handle(zone,
+            Smi::New(Isolate::kImmediateAction)));
         uint8_t* data = NULL;
         intptr_t len = 0;
         SerializeObject(message, &data, &len, false);
-        this->PostMessage(new Message(Message::kIllegalPort,
-                                      data, len,
-                                      Message::kNormalPriority),
-                          priority == kBeforeNextEventAction /* at_head */);
+        this->PostMessage(
+            new Message(Message::kIllegalPort,
+                        data, len,
+                        Message::kNormalPriority),
+            priority == Isolate::kBeforeNextEventAction /* at_head */);
       }
       break;
     }
-    case kAddExitMsg:
-    case kDelExitMsg:
-    case kAddErrorMsg:
-    case kDelErrorMsg: {
+    case Isolate::kInterruptMsg: {
+      // [ OOB, kInterruptMsg, pause capability ]
+      if (message.Length() != 3) return Error::null();
+      Object& obj = Object::Handle(zone, message.At(2));
+      if (!I->VerifyPauseCapability(obj)) return Error::null();
+
+      // If we are already paused, don't pause again.
+      if (I->debugger()->PauseEvent() == NULL) {
+        return I->debugger()->SignalIsolateInterrupted();
+      }
+      break;
+    }
+
+    case Isolate::kAddExitMsg:
+    case Isolate::kDelExitMsg:
+    case Isolate::kAddErrorMsg:
+    case Isolate::kDelErrorMsg: {
       // [ OOB, msg, listener port ]
-      if (message.Length() < 3) return true;
-      const Object& obj = Object::Handle(I, message.At(2));
-      if (!obj.IsSendPort()) return true;
+      if (message.Length() < 3) return Error::null();
+      const Object& obj = Object::Handle(zone, message.At(2));
+      if (!obj.IsSendPort()) return Error::null();
       const SendPort& listener = SendPort::Cast(obj);
       switch (msg_type) {
-        case kAddExitMsg: {
-          if (message.Length() != 4) return true;
+        case Isolate::kAddExitMsg: {
+          if (message.Length() != 4) return Error::null();
           // [ OOB, msg, listener port, response object ]
-          const Object& response = Object::Handle(I, message.At(3));
-          if (!response.IsInstance() && !response.IsNull()) return true;
+          const Object& response = Object::Handle(zone, message.At(3));
+          if (!response.IsInstance() && !response.IsNull()) {
+            return Error::null();
+          }
           I->AddExitListener(listener,
                              response.IsNull() ? Instance::null_instance()
                                                : Instance::Cast(response));
           break;
         }
-        case kDelExitMsg:
-          if (message.Length() != 3) return true;
+        case Isolate::kDelExitMsg:
+          if (message.Length() != 3) return Error::null();
           I->RemoveExitListener(listener);
           break;
-        case kAddErrorMsg:
-          if (message.Length() != 3) return true;
+        case Isolate::kAddErrorMsg:
+          if (message.Length() != 3) return Error::null();
           I->AddErrorListener(listener);
           break;
-        case kDelErrorMsg:
-          if (message.Length() != 3) return true;
+        case Isolate::kDelErrorMsg:
+          if (message.Length() != 3) return Error::null();
           I->RemoveErrorListener(listener);
           break;
         default:
@@ -344,15 +397,15 @@
       }
       break;
     }
-    case kErrorFatalMsg: {
+    case Isolate::kErrorFatalMsg: {
       // [ OOB, kErrorFatalMsg, terminate capability, val ]
-      if (message.Length() != 4) return true;
+      if (message.Length() != 4) return Error::null();
       // Check that the terminate capability has been passed correctly.
-      Object& obj = Object::Handle(I, message.At(2));
-      if (!I->VerifyTerminateCapability(obj)) return true;
+      Object& obj = Object::Handle(zone, message.At(2));
+      if (!I->VerifyTerminateCapability(obj)) return Error::null();
       // Get the value to be set.
       obj = message.At(3);
-      if (!obj.IsBool()) return true;
+      if (!obj.IsBool()) return Error::null();
       I->SetErrorsFatal(Bool::Cast(obj).value());
       break;
     }
@@ -363,7 +416,7 @@
       break;
 #endif  // defined(DEBUG)
   }
-  return true;
+  return Error::null();
 }
 
 
@@ -380,20 +433,22 @@
 }
 
 
-bool IsolateMessageHandler::HandleMessage(Message* message) {
-  StackZone zone(I);
-  HandleScope handle_scope(I);
-  TimelineDurationScope tds(I, I->GetIsolateStream(), "HandleMessage");
-
-  // TODO(turnidge): Rework collection total dart execution.  This can
-  // overcount when other things (gc, compilation) are active.
-  TIMERSCOPE(isolate_, time_dart_execution);
+MessageHandler::MessageStatus IsolateMessageHandler::HandleMessage(
+    Message* message) {
+  ASSERT(IsCurrentIsolate());
+  Thread* thread = Thread::Current();
+  StackZone stack_zone(thread);
+  Zone* zone = stack_zone.GetZone();
+  HandleScope handle_scope(thread);
+  TimelineDurationScope tds(thread, I->GetIsolateStream(), "HandleMessage");
+  tds.SetNumArguments(1);
+  tds.CopyArgument(0, "isolateName", I->name());
 
   // If the message is in band we lookup the handler to dispatch to.  If the
   // receive port was closed, we drop the message without deserializing it.
   // Illegal port is a special case for artificially enqueued isolate library
   // messages which are handled in C++ code below.
-  Object& msg_handler = Object::Handle(I);
+  Object& msg_handler = Object::Handle(zone);
   if (!message->IsOOB() && (message->dest_port() != Message::kIllegalPort)) {
     msg_handler = DartLibraryCalls::LookupHandler(message->dest_port());
     if (msg_handler.IsError()) {
@@ -408,15 +463,13 @@
       } else {
         delete message;
       }
-      return true;
+      return kOK;
     }
   }
 
   // Parse the message.
-  MessageSnapshotReader reader(message->data(),
-                               message->len(),
-                               I, zone.GetZone());
-  const Object& msg_obj = Object::Handle(I, reader.ReadObject());
+  MessageSnapshotReader reader(message->data(), message->len(), thread);
+  const Object& msg_obj = Object::Handle(zone, reader.ReadObject());
   if (msg_obj.IsError()) {
     // An error occurred while reading the message.
     delete message;
@@ -431,10 +484,10 @@
     UNREACHABLE();
   }
 
-  Instance& msg = Instance::Handle(I);
+  Instance& msg = Instance::Handle(zone);
   msg ^= msg_obj.raw();  // Can't use Instance::Cast because may be null.
 
-  bool success = true;
+  MessageStatus status = kOK;
   if (message->IsOOB()) {
     // OOB messages are expected to be fixed length arrays where the first
     // element is a Smi describing the OOB destination. Messages that do not
@@ -442,7 +495,7 @@
     if (msg.IsArray()) {
       const Array& oob_msg = Array::Cast(msg);
       if (oob_msg.Length() > 0) {
-        const Object& oob_tag = Object::Handle(I, oob_msg.At(0));
+        const Object& oob_tag = Object::Handle(zone, oob_msg.At(0));
         if (oob_tag.IsSmi()) {
           switch (Smi::Cast(oob_tag).Value()) {
             case Message::kServiceOOBMsg: {
@@ -450,7 +503,10 @@
               break;
             }
             case Message::kIsolateLibOOBMsg: {
-              success = HandleLibMessage(oob_msg);
+              const Error& error = Error::Handle(HandleLibMessage(oob_msg));
+              if (!error.IsNull()) {
+                status = ProcessUnhandledException(error);
+              }
               break;
             }
 #if defined(DEBUG)
@@ -471,45 +527,63 @@
     if (msg.IsArray()) {
       const Array& msg_arr = Array::Cast(msg);
       if (msg_arr.Length() > 0) {
-        const Object& oob_tag = Object::Handle(I, msg_arr.At(0));
+        const Object& oob_tag = Object::Handle(zone, msg_arr.At(0));
         if (oob_tag.IsSmi() &&
             (Smi::Cast(oob_tag).Value() == Message::kDelayedIsolateLibOOBMsg)) {
-          success = HandleLibMessage(Array::Cast(msg_arr));
+          const Error& error = Error::Handle(HandleLibMessage(msg_arr));
+          if (!error.IsNull()) {
+            status = ProcessUnhandledException(error);
+          }
         }
       }
     }
   } else {
-    const Object& result = Object::Handle(I,
+    const Object& result = Object::Handle(zone,
         DartLibraryCalls::HandleMessage(msg_handler, msg));
     if (result.IsError()) {
-      success = ProcessUnhandledException(Error::Cast(result));
+      status = ProcessUnhandledException(Error::Cast(result));
     } else {
       ASSERT(result.IsNull());
     }
   }
   delete message;
-  return success;
+  if (status == kOK) {
+    const Object& result =
+        Object::Handle(zone, I->InvokePendingServiceExtensionCalls());
+    if (result.IsError()) {
+      status = ProcessUnhandledException(Error::Cast(result));
+    } else {
+      ASSERT(result.IsNull());
+    }
+  }
+  return status;
 }
 
 
 void IsolateMessageHandler::NotifyPauseOnStart() {
   if (Service::debug_stream.enabled()) {
-    StartIsolateScope start_isolate(isolate());
-    StackZone zone(I);
-    HandleScope handle_scope(I);
-    ServiceEvent pause_event(isolate(), ServiceEvent::kPauseStart);
+    StartIsolateScope start_isolate(I);
+    StackZone zone(T);
+    HandleScope handle_scope(T);
+    ServiceEvent pause_event(I, ServiceEvent::kPauseStart);
     Service::HandleEvent(&pause_event);
+  } else if (FLAG_trace_service) {
+    OS::Print("vm-service: Dropping event of type PauseStart (%s)\n",
+              I->name());
   }
 }
 
 
 void IsolateMessageHandler::NotifyPauseOnExit() {
   if (Service::debug_stream.enabled()) {
-    StartIsolateScope start_isolate(isolate());
-    StackZone zone(I);
-    HandleScope handle_scope(I);
-    ServiceEvent pause_event(isolate(), ServiceEvent::kPauseExit);
+    StartIsolateScope start_isolate(I);
+    StackZone zone(T);
+    HandleScope handle_scope(T);
+    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());
   }
 }
 
@@ -526,7 +600,25 @@
 }
 
 
-bool IsolateMessageHandler::ProcessUnhandledException(const Error& result) {
+static MessageHandler::MessageStatus StoreError(Isolate* isolate,
+                                                const Error& error) {
+  isolate->object_store()->set_sticky_error(error);
+  if (error.IsUnwindError()) {
+    const UnwindError& unwind = UnwindError::Cast(error);
+    if (!unwind.is_user_initiated()) {
+      if (unwind.is_vm_restart()) {
+        return MessageHandler::kRestart;
+      } else {
+        return MessageHandler::kShutdown;
+      }
+    }
+  }
+  return MessageHandler::kError;
+}
+
+
+MessageHandler::MessageStatus IsolateMessageHandler::ProcessUnhandledException(
+    const Error& result) {
   // Notify the debugger about specific unhandled exceptions which are withheld
   // when being thrown.
   if (result.IsUnhandledException()) {
@@ -548,19 +640,20 @@
   }
 
   // Generate the error and stacktrace strings for the error message.
-  String& exc_str = String::Handle(I);
-  String& stacktrace_str = String::Handle(I);
+  String& exc_str = String::Handle(I->current_zone());
+  String& stacktrace_str = String::Handle(I->current_zone());
   if (result.IsUnhandledException()) {
+    Zone* zone = I->current_zone();
     const UnhandledException& uhe = UnhandledException::Cast(result);
-    const Instance& exception = Instance::Handle(I, uhe.exception());
-    Object& tmp = Object::Handle(I);
+    const Instance& exception = Instance::Handle(zone, uhe.exception());
+    Object& tmp = Object::Handle(zone);
     tmp = DartLibraryCalls::ToString(exception);
     if (!tmp.IsString()) {
       tmp = String::New(exception.ToCString());
     }
     exc_str ^= tmp.raw();
 
-    const Instance& stacktrace = Instance::Handle(I, uhe.stacktrace());
+    const Instance& stacktrace = Instance::Handle(zone, uhe.stacktrace());
     tmp = DartLibraryCalls::ToString(stacktrace);
     if (!tmp.IsString()) {
       tmp = String::New(stacktrace.ToCString());
@@ -569,13 +662,22 @@
   } else {
     exc_str = String::New(result.ToErrorCString());
   }
-  I->NotifyErrorListeners(exc_str, stacktrace_str);
-
-  if (I->ErrorsFatal()) {
-    I->object_store()->set_sticky_error(result);
-    return false;
+  if (result.IsUnwindError()) {
+    // When unwinding we don't notify error listeners and we ignore
+    // whether errors are fatal for the current isolate.
+    return StoreError(I, result);
+  } else {
+    bool has_listener = I->NotifyErrorListeners(exc_str, stacktrace_str);
+    if (I->ErrorsFatal()) {
+      if (has_listener) {
+        I->object_store()->clear_sticky_error();
+      } else {
+        I->object_store()->set_sticky_error(result);
+      }
+      return kError;
+    }
   }
-  return true;
+  return kOK;
 }
 
 
@@ -631,8 +733,15 @@
   object##_handle_(NULL),
 
 Isolate::Isolate(const Dart_IsolateFlags& api_flags)
-  :   vm_tag_(0),
+  :   stack_limit_(0),
       store_buffer_(new StoreBuffer()),
+      heap_(NULL),
+      vm_tag_(0),
+      user_tag_(0),
+      current_tag_(UserTag::null()),
+      default_tag_(UserTag::null()),
+      class_table_(),
+      single_step_(false),
       thread_registry_(new ThreadRegistry()),
       message_notify_callback_(NULL),
       name_(NULL),
@@ -643,7 +752,6 @@
       pause_capability_(0),
       terminate_capability_(0),
       errors_fatal_(true),
-      heap_(NULL),
       object_store_(NULL),
       top_exit_frame_info_(0),
       init_callback_data_(NULL),
@@ -651,17 +759,13 @@
       library_tag_handler_(NULL),
       api_state_(NULL),
       debugger_(NULL),
-      single_step_(false),
       resume_request_(false),
-      has_compiled_(false),
+      last_resume_timestamp_(OS::GetCurrentTimeMillis()),
+      has_compiled_code_(false),
       flags_(),
       random_(),
       simulator_(NULL),
-      long_jump_base_(NULL),
-      timer_list_(),
-      deopt_id_(0),
       mutex_(new Mutex()),
-      stack_limit_(0),
       saved_stack_limit_(0),
       stack_base_(0),
       stack_overflow_flags_(0),
@@ -673,34 +777,28 @@
       gc_epilogue_callback_(NULL),
       defer_finalization_count_(0),
       deopt_context_(NULL),
-      edge_counter_increment_size_(-1),
+      background_compiler_(NULL),
       compiler_stats_(NULL),
       is_service_isolate_(false),
-      log_(new class Log()),
       stacktrace_(NULL),
       stack_frame_index_(-1),
       last_allocationprofile_accumulator_reset_timestamp_(0),
       last_allocationprofile_gc_timestamp_(0),
       object_id_ring_(NULL),
       trace_buffer_(NULL),
-      timeline_event_recorder_(NULL),
       profiler_data_(NULL),
-      thread_state_(NULL),
       tag_table_(GrowableObjectArray::null()),
-      current_tag_(UserTag::null()),
-      default_tag_(UserTag::null()),
       collected_closures_(GrowableObjectArray::null()),
       deoptimized_code_array_(GrowableObjectArray::null()),
+      background_compilation_queue_(GrowableObjectArray::null()),
+      pending_service_extension_calls_(GrowableObjectArray::null()),
+      registered_service_extension_handlers_(GrowableObjectArray::null()),
       metrics_list_head_(NULL),
       compilation_allowed_(true),
-      cha_(NULL),
       next_(NULL),
-      pause_loop_monitor_(NULL),
-      REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_INITIALIZERS)
-      REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_SCOPE_INIT)
-      reusable_handles_() {
+      pause_loop_monitor_(NULL) {
   flags_.CopyFrom(api_flags);
-  set_vm_tag(VMTag::kEmbedderTagId);
+  Thread::Current()->set_vm_tag(VMTag::kEmbedderTagId);
   set_user_tag(UserTags::kDefaultUserTag);
 }
 
@@ -724,8 +822,6 @@
   message_handler_ = NULL;  // Fail fast if we send messages to a dead isolate.
   ASSERT(deopt_context_ == NULL);  // No deopt in progress when isolate deleted.
   delete spawn_state_;
-  delete log_;
-  log_ = NULL;
   delete object_id_ring_;
   object_id_ring_ = NULL;
   delete pause_loop_monitor_;
@@ -734,7 +830,6 @@
     delete compiler_stats_;
     compiler_stats_ = NULL;
   }
-  RemoveTimelineEventRecorder();
   delete thread_registry_;
 }
 
@@ -750,6 +845,7 @@
   create_callback_ = NULL;
   isolates_list_monitor_ = new Monitor();
   ASSERT(isolates_list_monitor_ != NULL);
+  EnableIsolateCreation();
 }
 
 
@@ -765,11 +861,12 @@
   ISOLATE_METRIC_LIST(ISOLATE_METRIC_INIT);
 #undef ISOLATE_METRIC_INIT
 
-  const bool force_streams = FLAG_timeline_trace_dir != NULL;
-
   // Initialize Timeline streams.
 #define ISOLATE_TIMELINE_STREAM_INIT(name, enabled_by_default)                 \
-  result->stream_##name##_.Init(#name, force_streams || enabled_by_default);
+  result->stream_##name##_.Init(#name,                                         \
+                                Timeline::EnableStreamByDefault(#name) ||      \
+                                enabled_by_default,                            \
+                                Timeline::Stream##name##EnabledFlag());
   ISOLATE_TIMELINE_STREAM_LIST(ISOLATE_TIMELINE_STREAM_INIT);
 #undef ISOLATE_TIMELINE_STREAM_INIT
 
@@ -784,12 +881,6 @@
   // the current isolate.
   Thread::EnterIsolate(result);
 
-  // Setup the isolate specific resuable handles.
-#define REUSABLE_HANDLE_ALLOCATION(object)                                     \
-  result->object##_handle_ = result->AllocateReusableHandle<object>();
-  REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_ALLOCATION)
-#undef REUSABLE_HANDLE_ALLOCATION
-
   // Setup the isolate message handler.
   MessageHandler* handler = new IsolateMessageHandler(result);
   ASSERT(handler != NULL);
@@ -824,12 +915,21 @@
                 "\tisolate:    %s\n", result->name());
     }
   }
-  if (FLAG_compiler_stats) {
-    result->compiler_stats_ = new CompilerStats(result);
+
+  result->compiler_stats_ = new CompilerStats(result);
+  if (FLAG_compiler_benchmark) {
+    result->compiler_stats_->EnableBenchmark();
   }
+
   ObjectIdRing::Init(result);
-  // Add to isolate list.
-  AddIsolateTolist(result);
+
+  // Add to isolate list. Shutdown and delete the isolate on failure.
+  if (!AddIsolateToList(result)) {
+    result->LowLevelShutdown();
+    Thread::ExitIsolate();
+    delete result;
+    return NULL;
+  }
 
   return result;
 }
@@ -862,6 +962,22 @@
 }
 
 
+void Isolate::SetupInstructionsSnapshotPage(
+    const uint8_t* instructions_snapshot_buffer) {
+  InstructionsSnapshot snapshot(instructions_snapshot_buffer);
+#if defined(DEBUG)
+  if (FLAG_trace_isolates) {
+    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());
+  }
+#endif
+  heap_->SetupInstructionsSnapshotPage(snapshot.instructions_start(),
+                                       snapshot.instructions_size());
+}
+
+
 void Isolate::set_debugger_name(const char* name) {
   free(debugger_name_);
   debugger_name_ = strdup(name);
@@ -878,27 +994,7 @@
     name_ = strdup(name_prefix);
     return;
   }
-  const char* kFormat = "%s-%lld";
-  intptr_t len = OS::SNPrint(NULL, 0, kFormat, name_prefix, main_port()) + 1;
-  name_ = reinterpret_cast<char*>(malloc(len));
-  OS::SNPrint(name_, len, kFormat, name_prefix, main_port());
-}
-
-
-Log* Isolate::Log() const {
-  if (FLAG_isolate_log_filter == NULL) {
-    if (is_service_isolate_) {
-      // By default, do not log for the service isolate.
-      return Log::NoOpLog();
-    }
-    return log_;
-  }
-  ASSERT(name_ != NULL);
-  if (strstr(name_, FLAG_isolate_log_filter) == NULL) {
-    // Filter does not match, do not log for this isolate.
-    return Log::NoOpLog();
-  }
-  return log_;
+  name_ = OS::SCreate(NULL, "%s-%" Pd64 "", name_prefix, main_port());
 }
 
 
@@ -968,9 +1064,9 @@
 
 
 void Isolate::DoneLoading() {
-  GrowableObjectArray& libs =
-      GrowableObjectArray::Handle(this, object_store()->libraries());
-  Library& lib = Library::Handle(this);
+  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++) {
     lib ^= libs.At(i);
@@ -1011,6 +1107,10 @@
     event->Instant("Runnable");
     event->Complete();
   }
+  if (Service::isolate_stream.enabled()) {
+    ServiceEvent runnableEvent(this, ServiceEvent::kIsolateRunnable);
+    Service::HandleEvent(&runnableEvent);
+  }
   return true;
 }
 
@@ -1034,8 +1134,8 @@
   static const intptr_t kMaxResumeCapabilities = kSmiMax / (6 * kWordSize);
 
   const GrowableObjectArray& caps = GrowableObjectArray::Handle(
-      this, object_store()->resume_capabilities());
-  Capability& current = Capability::Handle(this);
+      current_zone(), object_store()->resume_capabilities());
+  Capability& current = Capability::Handle(current_zone());
   intptr_t insertion_index = -1;
   for (intptr_t i = 0; i < caps.Length(); i++) {
     current ^= caps.At(i);
@@ -1064,8 +1164,8 @@
 
 bool Isolate::RemoveResumeCapability(const Capability& capability) {
   const GrowableObjectArray& caps = GrowableObjectArray::Handle(
-       this, object_store()->resume_capabilities());
-  Capability& current = Capability::Handle(this);
+       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);
     if (!current.IsNull() && (current.Id() == capability.Id())) {
@@ -1087,8 +1187,8 @@
   static const intptr_t kMaxListeners = kSmiMax / (12 * kWordSize);
 
   const GrowableObjectArray& listeners = GrowableObjectArray::Handle(
-       this, object_store()->exit_listeners());
-  SendPort& current = SendPort::Handle(this);
+       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) {
     current ^= listeners.At(i);
@@ -1119,8 +1219,8 @@
 
 void Isolate::RemoveExitListener(const SendPort& listener) {
   const GrowableObjectArray& listeners = GrowableObjectArray::Handle(
-      this, object_store()->exit_listeners());
-  SendPort& current = SendPort::Handle(this);
+      current_zone(), object_store()->exit_listeners());
+  SendPort& current = SendPort::Handle(current_zone());
   for (intptr_t i = 0; i < listeners.Length(); i += 2) {
     current ^= listeners.At(i);
     if (!current.IsNull() && (current.Id() == listener.Id())) {
@@ -1136,11 +1236,11 @@
 
 void Isolate::NotifyExitListeners() {
   const GrowableObjectArray& listeners = GrowableObjectArray::Handle(
-      this, this->object_store()->exit_listeners());
+      current_zone(), this->object_store()->exit_listeners());
   if (listeners.IsNull()) return;
 
-  SendPort& listener = SendPort::Handle(this);
-  Instance& response = Instance::Handle(this);
+  SendPort& listener = SendPort::Handle(current_zone());
+  Instance& response = Instance::Handle(current_zone());
   for (intptr_t i = 0; i < listeners.Length(); i += 2) {
     listener ^= listeners.At(i);
     if (!listener.IsNull()) {
@@ -1161,8 +1261,8 @@
   static const intptr_t kMaxListeners = kSmiMax / (6 * kWordSize);
 
   const GrowableObjectArray& listeners = GrowableObjectArray::Handle(
-      this, object_store()->error_listeners());
-  SendPort& current = SendPort::Handle(this);
+      current_zone(), object_store()->error_listeners());
+  SendPort& current = SendPort::Handle(current_zone());
   intptr_t insertion_index = -1;
   for (intptr_t i = 0; i < listeners.Length(); i++) {
     current ^= listeners.At(i);
@@ -1190,8 +1290,8 @@
 
 void Isolate::RemoveErrorListener(const SendPort& listener) {
   const GrowableObjectArray& listeners = GrowableObjectArray::Handle(
-      this, object_store()->error_listeners());
-  SendPort& current = SendPort::Handle(this);
+      current_zone(), object_store()->error_listeners());
+  SendPort& current = SendPort::Handle(current_zone());
   for (intptr_t i = 0; i < listeners.Length(); i++) {
     current ^= listeners.At(i);
     if (!current.IsNull() && (current.Id() == listener.Id())) {
@@ -1204,16 +1304,16 @@
 }
 
 
-void Isolate::NotifyErrorListeners(const String& msg,
+bool Isolate::NotifyErrorListeners(const String& msg,
                                    const String& stacktrace) {
   const GrowableObjectArray& listeners = GrowableObjectArray::Handle(
-      this, this->object_store()->error_listeners());
-  if (listeners.IsNull()) return;
+      current_zone(), this->object_store()->error_listeners());
+  if (listeners.IsNull()) return false;
 
-  const Array& arr = Array::Handle(this, Array::New(2));
+  const Array& arr = Array::Handle(current_zone(), Array::New(2));
   arr.SetAt(0, msg);
   arr.SetAt(1, stacktrace);
-  SendPort& listener = SendPort::Handle(this);
+  SendPort& listener = SendPort::Handle(current_zone());
   for (intptr_t i = 0; i < listeners.Length(); i++) {
     listener ^= listeners.At(i);
     if (!listener.IsNull()) {
@@ -1225,18 +1325,14 @@
       PortMap::PostMessage(msg);
     }
   }
+  return listeners.Length() > 0;
 }
 
 
-static void StoreError(Isolate* isolate, const Object& obj) {
-  ASSERT(obj.IsError());
-  isolate->object_store()->set_sticky_error(Error::Cast(obj));
-}
-
-
-static bool RunIsolate(uword parameter) {
+static MessageHandler::MessageStatus RunIsolate(uword parameter) {
   Isolate* isolate = reinterpret_cast<Isolate*>(parameter);
   IsolateSpawnState* state = NULL;
+  Thread* thread = Thread::Current();
   {
     // TODO(turnidge): Is this locking required here at all anymore?
     MutexLocker ml(isolate->mutex());
@@ -1244,8 +1340,9 @@
   }
   {
     StartIsolateScope start_scope(isolate);
-    StackZone zone(isolate);
-    HandleScope handle_scope(isolate);
+    ASSERT(thread->isolate() == isolate);
+    StackZone zone(thread);
+    HandleScope handle_scope(thread);
 
     // If particular values were requested for this newly spawned isolate, then
     // they are set here before the isolate starts executing user code.
@@ -1266,18 +1363,22 @@
 
     if (!ClassFinalizer::ProcessPendingClasses()) {
       // Error is in sticky error already.
-      return false;
+#if defined(DEBUG)
+      const Error& error =
+          Error::Handle(isolate->object_store()->sticky_error());
+      ASSERT(!error.IsUnwindError());
+#endif
+      return MessageHandler::kError;
     }
 
     Object& result = Object::Handle();
     result = state->ResolveFunction();
     bool is_spawn_uri = state->is_spawn_uri();
     if (result.IsError()) {
-      StoreError(isolate, result);
-      return false;
+      return StoreError(isolate, Error::Cast(result));
     }
     ASSERT(result.IsFunction());
-    Function& func = Function::Handle(isolate);
+    Function& func = Function::Handle(thread->zone());
     func ^= result.raw();
 
     // TODO(turnidge): Currently we need a way to force a one-time
@@ -1314,8 +1415,8 @@
     const Array& args = Array::Handle(Array::New(7));
     args.SetAt(0, SendPort::Handle(SendPort::New(state->parent_port())));
     args.SetAt(1, Instance::Handle(func.ImplicitStaticClosure()));
-    args.SetAt(2, Instance::Handle(state->BuildArgs(zone.GetZone())));
-    args.SetAt(3, Instance::Handle(state->BuildMessage(zone.GetZone())));
+    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 */)));
@@ -1329,11 +1430,10 @@
 
     result = DartEntry::InvokeFunction(entry_point, args);
     if (result.IsError()) {
-      StoreError(isolate, result);
-      return false;
+      return StoreError(isolate, Error::Cast(result));
     }
   }
-  return true;
+  return MessageHandler::kOK;
 }
 
 
@@ -1342,11 +1442,12 @@
   {
     // Print the error if there is one.  This may execute dart code to
     // print the exception object, so we need to use a StartIsolateScope.
+    Thread* thread = Thread::Current();
     StartIsolateScope start_scope(isolate);
-    StackZone zone(isolate);
-    HandleScope handle_scope(isolate);
-    Error& error = Error::Handle();
-    error = isolate->object_store()->sticky_error();
+    ASSERT(thread->isolate() == isolate);
+    StackZone zone(thread);
+    HandleScope handle_scope(thread);
+    const Error& error = Error::Handle(isolate->object_store()->sticky_error());
     if (!error.IsNull() && !error.IsUnwindError()) {
       OS::PrintErr("in ShutdownIsolate: %s\n", error.ToErrorCString());
     }
@@ -1379,6 +1480,37 @@
 }
 
 
+RawError* Isolate::HandleInterrupts() {
+  uword interrupt_bits = GetAndClearInterrupts();
+  if ((interrupt_bits & kVMInterrupt) != 0) {
+    thread_registry()->CheckSafepoint();
+    if (store_buffer()->Overflowed()) {
+      if (FLAG_verbose_gc) {
+        OS::PrintErr("Scavenge scheduled by store buffer overflow.\n");
+      }
+      heap()->CollectGarbage(Heap::kNew);
+    }
+  }
+  if ((interrupt_bits & kMessageInterrupt) != 0) {
+    MessageHandler::MessageStatus status =
+        message_handler()->HandleOOBMessages();
+    if (status != MessageHandler::kOK) {
+      // 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", name());
+      }
+      const Error& error = Error::Handle(object_store()->sticky_error());
+      ASSERT(!error.IsNull() && error.IsUnwindError());
+      object_store()->clear_sticky_error();
+      return error.raw();
+    }
+  }
+  return Error::null();
+}
+
+
 uword Isolate::GetAndClearStackOverflowFlags() {
   uword stack_overflow_flags = stack_overflow_flags_;
   stack_overflow_flags_ = 0;
@@ -1441,13 +1573,13 @@
 
 class FinalizeWeakPersistentHandlesVisitor : public HandleVisitor {
  public:
-  FinalizeWeakPersistentHandlesVisitor() : HandleVisitor(Isolate::Current()) {
+  FinalizeWeakPersistentHandlesVisitor() : HandleVisitor(Thread::Current()) {
   }
 
   void VisitHandle(uword addr) {
     FinalizablePersistentHandle* handle =
         reinterpret_cast<FinalizablePersistentHandle*>(addr);
-    handle->UpdateUnreachable(I);
+    handle->UpdateUnreachable(thread()->isolate());
   }
 
  private:
@@ -1455,6 +1587,68 @@
 };
 
 
+void Isolate::LowLevelShutdown() {
+  // Ensure we have a zone and handle scope so that we can call VM functions,
+  // but we no longer allocate new heap objects.
+  Thread* thread = Thread::Current();
+  StackZone stack_zone(thread);
+  HandleScope handle_scope(thread);
+  NoSafepointScope no_safepoint_scope;
+
+  // Notify exit listeners that this isolate is shutting down.
+  if (object_store() != NULL) {
+    const Error& error = Error::Handle(object_store()->sticky_error());
+    if (error.IsNull() ||
+        !error.IsUnwindError() ||
+        UnwindError::Cast(error).is_user_initiated()) {
+      NotifyExitListeners();
+    }
+  }
+
+  // Clean up debugger resources.
+  debugger()->Shutdown();
+
+  // Close all the ports owned by this isolate.
+  PortMap::ClosePorts(message_handler());
+
+  // Fail fast if anybody tries to post any more messsages to this isolate.
+  delete message_handler();
+  set_message_handler(NULL);
+
+  // Before analyzing the isolate's timeline blocks- reclaim all cached blocks.
+  ReclaimTimelineBlocks();
+
+  // Dump all timing data for the isolate.
+  if (FLAG_timing) {
+    TimelinePauseTrace tpt;
+    tpt.Print();
+  }
+
+  // Finalize any weak persistent handles with a non-null referent.
+  FinalizeWeakPersistentHandlesVisitor visitor;
+  api_state()->weak_persistent_handles().VisitHandles(&visitor);
+  api_state()->prologue_weak_persistent_handles().VisitHandles(&visitor);
+
+  if (FLAG_trace_isolates) {
+    heap()->PrintSizes();
+    MegamorphicCacheTable::PrintSizes(this);
+    Symbols::DumpStats();
+    OS::Print("[-] Stopping isolate:\n"
+              "\tisolate:    %s\n", name());
+  }
+  if (FLAG_print_metrics) {
+    LogBlock lb;
+    THR_Print("Printing metrics for %s\n", name());
+#define ISOLATE_METRIC_PRINT(type, variable, name, unit)                       \
+  THR_Print("%s\n", metric_##variable##_.ToString());
+
+    ISOLATE_METRIC_LIST(ISOLATE_METRIC_PRINT);
+#undef ISOLATE_METRIC_PRINT
+    THR_Print("\n");
+  }
+}
+
+
 void Isolate::Shutdown() {
   ASSERT(this == Isolate::Current());
   ASSERT(top_resource() == NULL);
@@ -1465,18 +1659,25 @@
   }
 #endif  // DEBUG
 
+  Thread* thread = Thread::Current();
+
   // First, perform higher-level cleanup that may need to allocate.
   {
     // Ensure we have a zone and handle scope so that we can call VM functions.
-    StackZone stack_zone(this);
-    HandleScope handle_scope(this);
+    StackZone stack_zone(thread);
+    HandleScope handle_scope(thread);
 
     // Write out the coverage data if collection has been enabled.
-    CodeCoverage::Write(this);
+    if ((this != Dart::vm_isolate()) &&
+        !ServiceIsolate::IsServiceIsolateDescendant(this)) {
+      CodeCoverage::Write(thread);
+    }
 
-    if ((timeline_event_recorder_ != NULL) &&
-        (FLAG_timeline_trace_dir != NULL)) {
-      timeline_event_recorder_->WriteTo(FLAG_timeline_trace_dir);
+    // Write compiler stats data if enabled.
+    if (FLAG_compiler_stats
+        && !ServiceIsolate::IsServiceIsolateDescendant(this)
+        && (this != Dart::vm_isolate())) {
+      OS::Print("%s", compiler_stats()->PrintToZone());
     }
   }
 
@@ -1495,48 +1696,7 @@
   }
 
   // Then, proceed with low-level teardown.
-  {
-    // Ensure we have a zone and handle scope so that we can call VM functions,
-    // but we no longer allocate new heap objects.
-    StackZone stack_zone(this);
-    HandleScope handle_scope(this);
-    NoSafepointScope no_safepoint_scope;
-
-    if (compiler_stats_ != NULL) {
-      compiler_stats()->Print();
-    }
-
-    // Notify exit listeners that this isolate is shutting down.
-    if (object_store() != NULL) {
-      NotifyExitListeners();
-    }
-
-    // Clean up debugger resources.
-    debugger()->Shutdown();
-
-    // Close all the ports owned by this isolate.
-    PortMap::ClosePorts(message_handler());
-
-    // Fail fast if anybody tries to post any more messsages to this isolate.
-    delete message_handler();
-    set_message_handler(NULL);
-
-    // Dump all accumulated timer data for the isolate.
-    timer_list_.ReportTimers();
-
-    // Finalize any weak persistent handles with a non-null referent.
-    FinalizeWeakPersistentHandlesVisitor visitor;
-    api_state()->weak_persistent_handles().VisitHandles(&visitor);
-    api_state()->prologue_weak_persistent_handles().VisitHandles(&visitor);
-
-    if (FLAG_trace_isolates) {
-      heap()->PrintSizes();
-      megamorphic_cache_table()->PrintSizes();
-      Symbols::DumpStats();
-      OS::Print("[-] Stopping isolate:\n"
-                "\tisolate:    %s\n", name());
-    }
-  }
+  LowLevelShutdown();
 
 #if defined(DEBUG)
   // No concurrent sweeper tasks should be running at this point.
@@ -1547,6 +1707,8 @@
   }
 #endif
 
+  BackgroundCompiler::Stop(background_compiler_);
+
   // TODO(5411455): For now just make sure there are no current isolates
   // as we are shutting down the isolate.
   Thread::ExitIsolate();
@@ -1556,6 +1718,15 @@
 }
 
 
+void Isolate::ReclaimTimelineBlocks() {
+  TimelineEventRecorder* recorder = Timeline::recorder();
+  if (recorder == NULL) {
+    return;
+  }
+  thread_registry_->ReclaimTimelineBlocks();
+}
+
+
 Dart_IsolateCreateCallback Isolate::create_callback_ = NULL;
 Dart_IsolateInterruptCallback Isolate::interrupt_callback_ = NULL;
 Dart_IsolateUnhandledExceptionCallback
@@ -1569,7 +1740,7 @@
 
 Monitor* Isolate::isolates_list_monitor_ = NULL;
 Isolate* Isolate::isolates_list_head_ = NULL;
-
+bool Isolate::creation_enabled_ = false;
 
 void Isolate::IterateObjectPointers(ObjectPointerVisitor* visitor,
                                     bool visit_prologue_weak_handles,
@@ -1590,23 +1761,9 @@
   // Visit objects in the class table.
   class_table()->VisitObjectPointers(visitor);
 
-  // Visit objects in the megamorphic cache.
-  megamorphic_cache_table()->VisitObjectPointers(visitor);
-
   // Visit objects in per isolate stubs.
   StubCode::VisitObjectPointers(visitor);
 
-  // Visit objects in isolate specific handles area.
-  reusable_handles_.VisitObjectPointers(visitor);
-
-  // Iterate over all the stack frames and visit objects on the stack.
-  StackFrameIterator frames_iterator(validate_frames);
-  StackFrame* frame = frames_iterator.NextFrame();
-  while (frame != NULL) {
-    frame->VisitObjectPointers(visitor);
-    frame = frames_iterator.NextFrame();
-  }
-
   // Visit the dart api state for all local and persistent handles.
   if (api_state() != NULL) {
     api_state()->VisitObjectPointers(visitor, visit_prologue_weak_handles);
@@ -1624,10 +1781,21 @@
   // Visit array of closures pending precompilation.
   visitor->VisitPointer(reinterpret_cast<RawObject**>(&collected_closures_));
 
+  visitor->VisitPointer(reinterpret_cast<RawObject**>(
+      &background_compilation_queue_));
+
   // Visit the deoptimized code array which is stored in the isolate.
   visitor->VisitPointer(
       reinterpret_cast<RawObject**>(&deoptimized_code_array_));
 
+  // Visit the pending service extension calls.
+  visitor->VisitPointer(
+      reinterpret_cast<RawObject**>(&pending_service_extension_calls_));
+
+  // Visit the registered service extension handlers.
+  visitor->VisitPointer(
+      reinterpret_cast<RawObject**>(&registered_service_extension_handlers_));
+
   // Visit objects in the debugger.
   debugger()->VisitObjectPointers(visitor);
 
@@ -1636,8 +1804,8 @@
     deopt_context()->VisitObjectPointers(visitor);
   }
 
-  // Visit objects in thread registry (e.g., handles in zones).
-  thread_registry()->VisitObjectPointers(visitor);
+  // Visit objects in thread registry (e.g., Dart stack, handles in zones).
+  thread_registry()->VisitObjectPointers(visitor, validate_frames);
 }
 
 
@@ -1656,18 +1824,18 @@
 }
 
 
-void Isolate::SetTimelineEventRecorder(
-    TimelineEventRecorder* timeline_event_recorder) {
-#define ISOLATE_TIMELINE_STREAM_SET_BUFFER(name, enabled_by_default)           \
-  stream_##name##_.set_recorder(timeline_event_recorder);
-  ISOLATE_TIMELINE_STREAM_LIST(ISOLATE_TIMELINE_STREAM_SET_BUFFER)
-#undef ISOLATE_TIMELINE_STREAM_SET_BUFFER
-  timeline_event_recorder_ = timeline_event_recorder;
-}
-
-void Isolate::RemoveTimelineEventRecorder() {
-  delete timeline_event_recorder_;
-  SetTimelineEventRecorder(NULL);
+static const char* ExceptionPauseInfoToServiceEnum(Dart_ExceptionPauseInfo pi) {
+  switch (pi) {
+    case kPauseOnAllExceptions:
+      return "All";
+    case kNoPauseOnExceptions:
+      return "None";
+    case kPauseOnUnhandledExceptions:
+      return "Unhandled";
+    default:
+      UNIMPLEMENTED();
+      return NULL;
+  }
 }
 
 
@@ -1683,17 +1851,10 @@
   if (ref) {
     return;
   }
+  jsobj.AddPropertyF("_originNumber", "%" Pd "",
+                     static_cast<intptr_t>(origin_id()));
   int64_t start_time_millis = start_time() / kMicrosecondsPerMillisecond;
-  jsobj.AddProperty64("startTime", start_time_millis);
-  IsolateSpawnState* state = spawn_state();
-  if (state != NULL) {
-    const Object& entry = Object::Handle(this, state->ResolveFunction());
-    if (!entry.IsNull() && entry.IsFunction()) {
-      Function& func = Function::Handle(this);
-      func ^= entry.raw();
-      jsobj.AddProperty("entry", func);
-    }
-  }
+  jsobj.AddPropertyTimeMillis("startTime", start_time_millis);
   {
     JSONObject jsheap(&jsobj, "_heaps");
     heap()->PrintToJSONObject(Heap::kNew, &jsheap);
@@ -1711,7 +1872,7 @@
     ASSERT(debugger()->PauseEvent() == NULL);
     ServiceEvent pause_event(this, ServiceEvent::kPauseExit);
     jsobj.AddProperty("pauseEvent", &pause_event);
-  } else if (debugger()->PauseEvent() != NULL) {
+  } else if (debugger()->PauseEvent() != NULL && !resume_request_) {
     ServiceEvent pause_event(debugger()->PauseEvent());
     jsobj.AddProperty("pauseEvent", &pause_event);
   } else {
@@ -1725,17 +1886,22 @@
     jsobj.AddProperty("pauseEvent", &pause_event);
   }
 
+  jsobj.AddProperty("exceptionPauseMode",
+      ExceptionPauseInfoToServiceEnum(debugger()->GetExceptionPauseInfo()));
+
   const Library& lib =
       Library::Handle(object_store()->root_library());
-  jsobj.AddProperty("rootLib", lib);
+  if (!lib.IsNull()) {
+    jsobj.AddProperty("rootLib", lib);
+  }
 
-  timer_list().PrintTimersToJSONProperty(&jsobj);
   {
     JSONObject tagCounters(&jsobj, "_tagCounters");
     vm_tag_counters()->PrintToJSONObject(&tagCounters);
   }
   if (object_store()->sticky_error() != Object::null()) {
-    Error& error = Error::Handle(this, object_store()->sticky_error());
+    Error& error = Error::Handle(current_zone(),
+        object_store()->sticky_error());
     ASSERT(!error.IsNull());
     jsobj.AddProperty("error", error, false);
   }
@@ -1816,7 +1982,8 @@
 
 
 void Isolate::ProfileIdle() {
-  vm_tag_counters_.Increment(vm_tag());
+  // Currently we are only sampling the mutator thread.
+  vm_tag_counters_.Increment(VMTag::kIdleTagId);
 }
 
 
@@ -1848,6 +2015,12 @@
 }
 
 
+void Isolate::set_background_compilation_queue(
+    const GrowableObjectArray& value) {
+  background_compilation_queue_ = value.raw();
+}
+
+
 void Isolate::TrackDeoptimizedCode(const Code& code) {
   ASSERT(!code.IsNull());
   const GrowableObjectArray& deoptimized_code =
@@ -1862,6 +2035,169 @@
 }
 
 
+void Isolate::set_pending_service_extension_calls(
+      const GrowableObjectArray& value) {
+  pending_service_extension_calls_ = value.raw();
+}
+
+
+void Isolate::set_registered_service_extension_handlers(
+    const GrowableObjectArray& value) {
+  registered_service_extension_handlers_ = value.raw();
+}
+
+
+RawObject* Isolate::InvokePendingServiceExtensionCalls() {
+  GrowableObjectArray& calls =
+      GrowableObjectArray::Handle(GetAndClearPendingServiceExtensionCalls());
+  if (calls.IsNull()) {
+    return Object::null();
+  }
+  // Grab run function.
+  const Library& developer_lib = Library::Handle(Library::DeveloperLibrary());
+  ASSERT(!developer_lib.IsNull());
+  const Function& run_extension = Function::Handle(
+      developer_lib.LookupLocalFunction(Symbols::_runExtension()));
+  ASSERT(!run_extension.IsNull());
+
+  const Array& arguments =
+      Array::Handle(Array::New(kPendingEntrySize, Heap::kNew));
+  Object& result = Object::Handle();
+  String& method_name = String::Handle();
+  Instance& closure = Instance::Handle();
+  Array& parameter_keys = Array::Handle();
+  Array& parameter_values = Array::Handle();
+  Instance& reply_port = Instance::Handle();
+  Instance& id = Instance::Handle();
+  for (intptr_t i = 0; i < calls.Length(); i += kPendingEntrySize) {
+    // Grab arguments for call.
+    closure ^= calls.At(i + kPendingHandlerIndex);
+    ASSERT(!closure.IsNull());
+    arguments.SetAt(kPendingHandlerIndex, closure);
+    method_name ^= calls.At(i + kPendingMethodNameIndex);
+    ASSERT(!method_name.IsNull());
+    arguments.SetAt(kPendingMethodNameIndex, method_name);
+    parameter_keys ^= calls.At(i + kPendingKeysIndex);
+    ASSERT(!parameter_keys.IsNull());
+    arguments.SetAt(kPendingKeysIndex, parameter_keys);
+    parameter_values ^= calls.At(i + kPendingValuesIndex);
+    ASSERT(!parameter_values.IsNull());
+    arguments.SetAt(kPendingValuesIndex, parameter_values);
+    reply_port ^= calls.At(i + kPendingReplyPortIndex);
+    ASSERT(!reply_port.IsNull());
+    arguments.SetAt(kPendingReplyPortIndex, reply_port);
+    id ^= calls.At(i + kPendingIdIndex);
+    arguments.SetAt(kPendingIdIndex, id);
+
+    result = DartEntry::InvokeFunction(run_extension, arguments);
+    if (result.IsError()) {
+      if (result.IsUnwindError()) {
+        // Propagate the unwind error. Remaining service extension calls
+        // are dropped.
+        return result.raw();
+      } else {
+        // Send error back over the protocol.
+        Service::PostError(method_name,
+                           parameter_keys,
+                           parameter_values,
+                           reply_port,
+                           id,
+                           Error::Cast(result));
+      }
+    }
+    result = DartLibraryCalls::DrainMicrotaskQueue();
+    if (result.IsError()) {
+      return result.raw();
+    }
+  }
+  return Object::null();
+}
+
+
+RawGrowableObjectArray* Isolate::GetAndClearPendingServiceExtensionCalls() {
+  RawGrowableObjectArray* r = pending_service_extension_calls_;
+  pending_service_extension_calls_ = GrowableObjectArray::null();
+  return r;
+}
+
+
+void Isolate::AppendServiceExtensionCall(const Instance& closure,
+                                         const String& method_name,
+                                         const Array& parameter_keys,
+                                         const Array& parameter_values,
+                                         const Instance& reply_port,
+                                         const Instance& id) {
+  GrowableObjectArray& calls =
+      GrowableObjectArray::Handle(pending_service_extension_calls());
+  if (calls.IsNull()) {
+    calls ^= GrowableObjectArray::New();
+    ASSERT(!calls.IsNull());
+    set_pending_service_extension_calls(calls);
+  }
+  ASSERT(kPendingHandlerIndex == 0);
+  calls.Add(closure);
+  ASSERT(kPendingMethodNameIndex == 1);
+  calls.Add(method_name);
+  ASSERT(kPendingKeysIndex == 2);
+  calls.Add(parameter_keys);
+  ASSERT(kPendingValuesIndex == 3);
+  calls.Add(parameter_values);
+  ASSERT(kPendingReplyPortIndex == 4);
+  calls.Add(reply_port);
+  ASSERT(kPendingIdIndex == 5);
+  calls.Add(id);
+}
+
+
+// This function is written in C++ and not Dart because we must do this
+// operation atomically in the face of random OOB messages. Do not port
+// to Dart code unless you can ensure that the operations will can be
+// done atomically.
+void Isolate::RegisterServiceExtensionHandler(const String& name,
+                                              const Instance& closure) {
+  GrowableObjectArray& handlers =
+      GrowableObjectArray::Handle(registered_service_extension_handlers());
+  if (handlers.IsNull()) {
+    handlers ^= GrowableObjectArray::New(Heap::kOld);
+    set_registered_service_extension_handlers(handlers);
+  }
+#if defined(DEBUG)
+  {
+    // Sanity check.
+    const Instance& existing_handler =
+        Instance::Handle(LookupServiceExtensionHandler(name));
+    ASSERT(existing_handler.IsNull());
+  }
+#endif
+  ASSERT(kRegisteredNameIndex == 0);
+  handlers.Add(name, Heap::kOld);
+  ASSERT(kRegisteredHandlerIndex == 1);
+  handlers.Add(closure, Heap::kOld);
+}
+
+
+// This function is written in C++ and not Dart because we must do this
+// operation atomically in the face of random OOB messages. Do not port
+// to Dart code unless you can ensure that the operations will can be
+// done atomically.
+RawInstance* Isolate::LookupServiceExtensionHandler(const String& name) {
+  const GrowableObjectArray& handlers =
+      GrowableObjectArray::Handle(registered_service_extension_handlers());
+  if (handlers.IsNull()) {
+    return Instance::null();
+  }
+  String& handler_name = String::Handle();
+  for (intptr_t i = 0; i < handlers.Length(); i += kRegisteredEntrySize) {
+    handler_name ^= handlers.At(i + kRegisteredNameIndex);
+    ASSERT(!handler_name.IsNull());
+    if (handler_name.Equals(name)) {
+      return Instance::RawCast(handlers.At(i + kRegisteredHandlerIndex));
+    }
+  }
+  return Instance::null();
+}
+
+
 void Isolate::WakePauseEventHandler(Dart_Isolate isolate) {
   Isolate* iso = reinterpret_cast<Isolate*>(isolate);
   MonitorLocker ml(iso->pause_loop_monitor_);
@@ -1932,12 +2268,16 @@
 }
 
 
-void Isolate::AddIsolateTolist(Isolate* isolate) {
+bool Isolate::AddIsolateToList(Isolate* isolate) {
   MonitorLocker ml(isolates_list_monitor_);
+  if (!creation_enabled_) {
+    return false;
+  }
   ASSERT(isolate != NULL);
   ASSERT(isolate->next_ == NULL);
   isolate->next_ = isolates_list_head_;
   isolates_list_head_ = isolate;
+  return true;
 }
 
 
@@ -1946,6 +2286,9 @@
   ASSERT(isolate != NULL);
   if (isolate == isolates_list_head_) {
     isolates_list_head_ = isolate->next_;
+    if (!creation_enabled_) {
+      ml.Notify();
+    }
     return;
   }
   Isolate* previous = NULL;
@@ -1954,42 +2297,144 @@
     if (current == isolate) {
       ASSERT(previous != NULL);
       previous->next_ = current->next_;
+      if (!creation_enabled_) {
+        ml.Notify();
+      }
       return;
     }
     previous = current;
     current = current->next_;
   }
-  UNREACHABLE();
+  // If we are shutting down the VM, the isolate may not be in the list.
+  ASSERT(!creation_enabled_);
 }
 
 
-template<class T>
-T* Isolate::AllocateReusableHandle() {
-  T* handle = reinterpret_cast<T*>(reusable_handles_.AllocateScopedHandle());
-  T::initializeHandle(handle, T::null());
-  return handle;
+void Isolate::DisableIsolateCreation() {
+  MonitorLocker ml(isolates_list_monitor_);
+  creation_enabled_ = false;
 }
 
 
-static RawInstance* DeserializeObject(Isolate* isolate,
-                                      Zone* zone,
+void Isolate::EnableIsolateCreation() {
+  MonitorLocker ml(isolates_list_monitor_);
+  creation_enabled_ = true;
+}
+
+
+void Isolate::KillLocked(LibMsgId msg_id) {
+  Dart_CObject kill_msg;
+  Dart_CObject* list_values[4];
+  kill_msg.type = Dart_CObject_kArray;
+  kill_msg.value.as_array.length = 4;
+  kill_msg.value.as_array.values = list_values;
+
+  Dart_CObject oob;
+  oob.type = Dart_CObject_kInt32;
+  oob.value.as_int32 = Message::kIsolateLibOOBMsg;
+  list_values[0] = &oob;
+
+  Dart_CObject msg_type;
+  msg_type.type = Dart_CObject_kInt32;
+  msg_type.value.as_int32 = msg_id;
+  list_values[1] = &msg_type;
+
+  Dart_CObject cap;
+  cap.type = Dart_CObject_kCapability;
+  cap.value.as_capability.id = terminate_capability();
+  list_values[2] = &cap;
+
+  Dart_CObject imm;
+  imm.type = Dart_CObject_kInt32;
+  imm.value.as_int32 = Isolate::kImmediateAction;
+  list_values[3] = &imm;
+
+  {
+    uint8_t* buffer = NULL;
+    ApiMessageWriter writer(&buffer, allocator);
+    bool success = writer.WriteCMessage(&kill_msg);
+    ASSERT(success);
+
+    // Post the message at the given port.
+    success = PortMap::PostMessage(new Message(main_port(),
+                                               buffer,
+                                               writer.BytesWritten(),
+                                               Message::kOOBPriority));
+    ASSERT(success);
+  }
+}
+
+
+class IsolateKillerVisitor : public IsolateVisitor {
+ public:
+  explicit IsolateKillerVisitor(Isolate::LibMsgId msg_id)
+      : target_(NULL), msg_id_(msg_id) {}
+
+  IsolateKillerVisitor(Isolate* isolate, Isolate::LibMsgId msg_id)
+      : target_(isolate), msg_id_(msg_id) {
+    ASSERT(isolate != Dart::vm_isolate());
+  }
+
+  virtual ~IsolateKillerVisitor() {}
+
+  void VisitIsolate(Isolate* isolate) {
+    ASSERT(isolate != NULL);
+    if (ShouldKill(isolate)) {
+      isolate->KillLocked(msg_id_);
+    }
+  }
+
+ private:
+  bool ShouldKill(Isolate* isolate) {
+    // If a target_ is specified, then only kill the target_.
+    // Otherwise, don't kill the service isolate or vm isolate.
+    return (((target_ != NULL) && (isolate == target_)) ||
+            ((target_ == NULL) &&
+             !ServiceIsolate::IsServiceIsolateDescendant(isolate) &&
+             (isolate != Dart::vm_isolate())));
+  }
+
+  Isolate* target_;
+  Isolate::LibMsgId msg_id_;
+};
+
+
+void Isolate::KillAllIsolates(LibMsgId msg_id) {
+  IsolateKillerVisitor visitor(msg_id);
+  VisitIsolates(&visitor);
+}
+
+
+void Isolate::KillIfExists(Isolate* isolate, LibMsgId msg_id) {
+  IsolateKillerVisitor visitor(isolate, msg_id);
+  VisitIsolates(&visitor);
+}
+
+
+static RawInstance* DeserializeObject(Thread* thread,
                                       uint8_t* obj_data,
                                       intptr_t obj_len) {
   if (obj_data == NULL) {
     return Instance::null();
   }
-  MessageSnapshotReader reader(obj_data,
-                               obj_len,
-                               isolate,
-                               zone);
-  const Object& obj = Object::Handle(isolate, reader.ReadObject());
+  MessageSnapshotReader reader(obj_data, obj_len, thread);
+  Zone* zone = thread->zone();
+  const Object& obj = Object::Handle(zone, reader.ReadObject());
   ASSERT(!obj.IsError());
-  Instance& instance = Instance::Handle(isolate);
+  Instance& instance = Instance::Handle(zone);
   instance ^= obj.raw();  // Can't use Instance::Cast because may be null.
   return instance.raw();
 }
 
 
+static const char* NewConstChar(const char* chars) {
+  size_t len = strlen(chars);
+  char* mem = new char[len + 1];
+  memmove(mem, chars, len + 1);
+  return mem;
+}
+
+
 IsolateSpawnState::IsolateSpawnState(Dart_Port parent_port,
                                      const Function& func,
                                      const Instance& message,
@@ -2003,6 +2448,7 @@
       on_error_port_(on_error_port),
       script_url_(NULL),
       package_root_(NULL),
+      package_map_(NULL),
       library_url_(NULL),
       class_name_(NULL),
       function_name_(NULL),
@@ -2013,17 +2459,16 @@
       isolate_flags_(),
       paused_(paused),
       errors_are_fatal_(errors_are_fatal) {
-  script_url_ = NULL;
   const Class& cls = Class::Handle(func.Owner());
   const Library& lib = Library::Handle(cls.library());
   const String& lib_url = String::Handle(lib.url());
-  library_url_ = strdup(lib_url.ToCString());
+  library_url_ = NewConstChar(lib_url.ToCString());
 
   const String& func_name = String::Handle(func.name());
-  function_name_ = strdup(func_name.ToCString());
+  function_name_ = NewConstChar(func_name.ToCString());
   if (!cls.IsTopLevel()) {
     const String& class_name = String::Handle(cls.Name());
-    class_name_ = strdup(class_name.ToCString());
+    class_name_ = NewConstChar(class_name.ToCString());
   }
   bool can_send_any_object = true;
   SerializeObject(message,
@@ -2038,6 +2483,7 @@
 IsolateSpawnState::IsolateSpawnState(Dart_Port parent_port,
                                      const char* script_url,
                                      const char* package_root,
+                                     const char** package_map,
                                      const Instance& args,
                                      const Instance& message,
                                      bool paused,
@@ -2048,7 +2494,9 @@
       parent_port_(parent_port),
       on_exit_port_(on_exit_port),
       on_error_port_(on_error_port),
-      package_root_(NULL),
+      script_url_(script_url),
+      package_root_(package_root),
+      package_map_(package_map),
       library_url_(NULL),
       class_name_(NULL),
       function_name_(NULL),
@@ -2059,12 +2507,7 @@
       isolate_flags_(),
       paused_(paused),
       errors_are_fatal_(errors_are_fatal) {
-  script_url_ = strdup(script_url);
-  if (package_root != NULL) {
-    package_root_ = strdup(package_root);
-  }
-  library_url_ = NULL;
-  function_name_ = strdup("main");
+  function_name_ = NewConstChar("main");
   bool can_send_any_object = false;
   SerializeObject(args,
                   &serialized_args_,
@@ -2081,11 +2524,19 @@
 
 
 IsolateSpawnState::~IsolateSpawnState() {
-  free(script_url_);
-  free(package_root_);
-  free(library_url_);
-  free(function_name_);
-  free(class_name_);
+  delete[] script_url_;
+  delete[] package_root_;
+  for (int i = 0; package_map_ != NULL; i++) {
+    if (package_map_[i] != NULL) {
+      delete[] package_map_[i];
+    } else {
+      delete[] package_map_;
+      package_map_ = NULL;
+    }
+  }
+  delete[] library_url_;
+  delete[] class_name_;
+  delete[] function_name_;
   free(serialized_args_);
   free(serialized_message_);
 }
@@ -2159,14 +2610,13 @@
 }
 
 
-RawInstance* IsolateSpawnState::BuildArgs(Zone* zone) {
-  return DeserializeObject(isolate_, zone,
-                           serialized_args_, serialized_args_len_);
+RawInstance* IsolateSpawnState::BuildArgs(Thread* thread) {
+  return DeserializeObject(thread, serialized_args_, serialized_args_len_);
 }
 
 
-RawInstance* IsolateSpawnState::BuildMessage(Zone* zone) {
-  return DeserializeObject(isolate_, zone,
+RawInstance* IsolateSpawnState::BuildMessage(Thread* thread) {
+  return DeserializeObject(thread,
                            serialized_message_, serialized_message_len_);
 }
 
diff --git a/runtime/vm/isolate.h b/runtime/vm/isolate.h
index 9621311..00abb13 100644
--- a/runtime/vm/isolate.h
+++ b/runtime/vm/isolate.h
@@ -7,9 +7,9 @@
 
 #include "include/dart_api.h"
 #include "platform/assert.h"
+#include "vm/atomic.h"
 #include "vm/base_isolate.h"
 #include "vm/class_table.h"
-#include "vm/counters.h"
 #include "vm/handles.h"
 #include "vm/megamorphic_cache_table.h"
 #include "vm/metrics.h"
@@ -24,40 +24,26 @@
 namespace dart {
 
 // Forward declarations.
-class AbstractType;
 class ApiState;
-class Array;
+class BackgroundCompiler;
 class Capability;
-class CHA;
-class Class;
-class Code;
 class CodeIndexTable;
 class CompilerStats;
 class Debugger;
 class DeoptContext;
-class Error;
-class ExceptionHandlers;
-class Field;
-class Function;
-class GrowableObjectArray;
 class HandleScope;
 class HandleVisitor;
 class Heap;
 class ICData;
-class Instance;
 class IsolateProfilerData;
 class IsolateSpawnState;
-class InterruptableThreadState;
-class Library;
 class Log;
-class LongJumpScope;
 class MessageHandler;
 class Mutex;
 class Object;
 class ObjectIdRing;
 class ObjectPointerVisitor;
 class ObjectStore;
-class PcDescriptors;
 class RawInstance;
 class RawArray;
 class RawContext;
@@ -79,8 +65,6 @@
 class StoreBuffer;
 class StubCode;
 class ThreadRegistry;
-class TypeArguments;
-class TypeParameter;
 class UserTag;
 
 
@@ -95,26 +79,34 @@
   DISALLOW_COPY_AND_ASSIGN(IsolateVisitor);
 };
 
-#define REUSABLE_HANDLE_LIST(V)                                                \
-  V(AbstractType)                                                              \
-  V(Array)                                                                     \
-  V(Class)                                                                     \
-  V(Code)                                                                      \
-  V(Error)                                                                     \
-  V(ExceptionHandlers)                                                         \
-  V(Field)                                                                     \
-  V(Function)                                                                  \
-  V(GrowableObjectArray)                                                       \
-  V(Instance)                                                                  \
-  V(Library)                                                                   \
-  V(Object)                                                                    \
-  V(PcDescriptors)                                                             \
-  V(String)                                                                    \
-  V(TypeArguments)                                                             \
-  V(TypeParameter)                                                             \
 
 class Isolate : public BaseIsolate {
  public:
+  // Keep both these enums in sync with isolate_patch.dart.
+  // The different Isolate API message types.
+  enum LibMsgId {
+    kPauseMsg = 1,
+    kResumeMsg = 2,
+    kPingMsg = 3,
+    kKillMsg = 4,
+    kAddExitMsg = 5,
+    kDelExitMsg = 6,
+    kAddErrorMsg = 7,
+    kDelErrorMsg = 8,
+    kErrorFatalMsg = 9,
+
+    // Internal message ids.
+    kInterruptMsg = 10,     // Break in the debugger.
+    kInternalKillMsg = 11,  // Like kill, but does not run exit listeners, etc.
+    kVMRestartMsg = 12,     // Sent to isolates when vm is restarting.
+  };
+  // The different Isolate API message priorities for ping and kill messages.
+  enum LibMsgPriority {
+    kImmediateAction = 0,
+    kBeforeNextEventAction = 1,
+    kAsEventAction = 2
+  };
+
   ~Isolate();
 
   static inline Isolate* Current() {
@@ -146,10 +138,6 @@
     return OFFSET_OF(Isolate, class_table_);
   }
 
-  MegamorphicCacheTable* megamorphic_cache_table() {
-    return &megamorphic_cache_table_;
-  }
-
   Dart_MessageNotifyCallback message_notify_callback() const {
     return message_notify_callback_;
   }
@@ -171,9 +159,6 @@
   const char* debugger_name() const { return debugger_name_; }
   void set_debugger_name(const char* name);
 
-  // TODO(koda): Move to Thread.
-  class Log* Log() const;
-
   int64_t start_time() const { return start_time_; }
 
   Dart_Port main_port() const { return main_port_; }
@@ -194,15 +179,14 @@
   }
   uint64_t terminate_capability() const { return terminate_capability_; }
 
+  void SendInternalLibMessage(LibMsgId msg_id, uint64_t capability);
+
   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_);
-  }
 
   // DEPRECATED: Use Thread's methods instead. During migration, these default
   // to using the mutator thread (which must also be the current thread).
@@ -224,24 +208,9 @@
     mutator_thread_->set_top_exit_frame_info(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(Isolate, vm_tag_);
-  }
-
   ApiState* api_state() const { return api_state_; }
   void set_api_state(ApiState* value) { api_state_ = value; }
 
-  LongJumpScope* long_jump_base() const { return long_jump_base_; }
-  void set_long_jump_base(LongJumpScope* value) { long_jump_base_ = value; }
-
-  TimerList& timer_list() { return timer_list_; }
-
   void set_init_callback_data(void* value) {
     init_callback_data_ = value;
   }
@@ -270,15 +239,31 @@
 
   // Returns the current C++ stack pointer. Equivalent taking the address of a
   // stack allocated local, but plays well with AddressSanitizer.
+  // TODO(koda): Move to Thread.
   static uword GetCurrentStackPointer();
 
+  void SetupInstructionsSnapshotPage(
+      const uint8_t* instructions_snapshot_buffer);
+
+  // Returns true if any of the interrupts specified by 'interrupt_bits' are
+  // currently scheduled for this isolate, but leaves them unchanged.
+  //
+  // NOTE: The read uses relaxed memory ordering, i.e., it is atomic and
+  // an interrupt is guaranteed to be observed eventually, but any further
+  // order guarantees must be ensured by other synchronization. See the
+  // tests in isolate_test.cc for example usage.
+  bool HasInterruptsScheduled(uword interrupt_bits) {
+    ASSERT(interrupt_bits == (interrupt_bits & kInterruptsMask));
+    uword limit = AtomicOperations::LoadRelaxed(&stack_limit_);
+    return (limit != saved_stack_limit_) &&
+        (((limit & kInterruptsMask) & interrupt_bits) != 0);
+  }
+
+  // Access to the current stack limit for generated code.  This may be
+  // overwritten with a special value to trigger interrupts.
   uword stack_limit_address() const {
     return reinterpret_cast<uword>(&stack_limit_);
   }
-
-  // The current stack limit.  This may be overwritten with a special
-  // value to trigger interrupts.
-  uword stack_limit() const { return stack_limit_; }
   static intptr_t stack_limit_offset() {
     return OFFSET_OF(Isolate, stack_limit_);
   }
@@ -315,17 +300,14 @@
 
   // Interrupt bits.
   enum {
-    kApiInterrupt = 0x1,      // An interrupt from Dart_InterruptIsolate.
+    kVMInterrupt = 0x1,  // Internal VM checks: safepoints, store buffers, etc.
     kMessageInterrupt = 0x2,  // An interrupt to process an out of band message.
-    kVMInterrupt = 0x4,  // Internal VM checks: safepoints, store buffers, etc.
 
-    kInterruptsMask =
-        kApiInterrupt |
-        kMessageInterrupt |
-        kVMInterrupt,
+    kInterruptsMask = (kVMInterrupt | kMessageInterrupt),
   };
 
   void ScheduleInterrupts(uword interrupt_bits);
+  RawError* HandleInterrupts();
   uword GetAndClearInterrupts();
 
   // Marks all libraries as loaded.
@@ -343,35 +325,6 @@
   IsolateSpawnState* spawn_state() const { return spawn_state_; }
   void set_spawn_state(IsolateSpawnState* value) { spawn_state_ = value; }
 
-  static const intptr_t kNoDeoptId = -1;
-  static const intptr_t kDeoptIdStep = 2;
-  static const intptr_t kDeoptIdBeforeOffset = 0;
-  static const intptr_t kDeoptIdAfterOffset = 1;
-  intptr_t deopt_id() const { return deopt_id_; }
-  void set_deopt_id(int value) {
-    ASSERT(value >= 0);
-    deopt_id_ = value;
-  }
-  intptr_t GetNextDeoptId() {
-    ASSERT(deopt_id_ != kNoDeoptId);
-    const intptr_t id = deopt_id_;
-    deopt_id_ += kDeoptIdStep;
-    return id;
-  }
-
-  static intptr_t ToDeoptAfter(intptr_t deopt_id) {
-    ASSERT(IsDeoptBefore(deopt_id));
-    return deopt_id + kDeoptIdAfterOffset;
-  }
-
-  static bool IsDeoptBefore(intptr_t deopt_id) {
-    return (deopt_id % kDeoptIdStep) == kDeoptIdBeforeOffset;
-  }
-
-  static bool IsDeoptAfter(intptr_t deopt_id) {
-    return (deopt_id % kDeoptIdStep) == kDeoptIdAfterOffset;
-  }
-
   Mutex* mutex() const { return mutex_; }
 
   Debugger* debugger() const {
@@ -385,8 +338,8 @@
     return OFFSET_OF(Isolate, single_step_);
   }
 
-  void set_has_compiled(bool value) { has_compiled_ = value; }
-  bool has_compiled() const { return has_compiled_; }
+  void set_has_compiled_code(bool value) { has_compiled_code_ = value; }
+  bool has_compiled_code() const { return has_compiled_code_; }
 
   // TODO(iposva): Evaluate whether two different isolate flag structures are
   // needed. Currently it serves as a separation between publicly visible flags
@@ -428,7 +381,7 @@
   // executing generated code. Needs to be called before any code has been
   // compiled.
   void set_strict_compilation() {
-    ASSERT(!has_compiled());
+    ASSERT(!has_compiled_code());
     flags_.type_checks_ = true;
     flags_.asserts_ = true;
     flags_.error_on_bad_type_ = true;
@@ -438,6 +391,15 @@
   // Requests that the debugger resume execution.
   void Resume() {
     resume_request_ = true;
+    set_last_resume_timestamp();
+  }
+
+  void set_last_resume_timestamp() {
+    last_resume_timestamp_ = OS::GetCurrentTimeMillis();
+  }
+
+  int64_t last_resume_timestamp() const {
+    return last_resume_timestamp_;
   }
 
   // Returns whether the vm service has requested that the debugger
@@ -464,7 +426,7 @@
 
   void AddErrorListener(const SendPort& listener);
   void RemoveErrorListener(const SendPort& listener);
-  void NotifyErrorListeners(const String& msg, const String& stacktrace);
+  bool NotifyErrorListeners(const String& msg, const String& stacktrace);
 
   bool ErrorsFatal() const { return errors_fatal_; }
   void SetErrorsFatal(bool val) { errors_fatal_ = val; }
@@ -563,27 +525,17 @@
     return trace_buffer_;
   }
 
-  void SetTimelineEventRecorder(TimelineEventRecorder* timeline_event_recorder);
-
-  TimelineEventRecorder* timeline_event_recorder() const {
-    return timeline_event_recorder_;
-  }
-
-  void RemoveTimelineEventRecorder();
-
   DeoptContext* deopt_context() const { return deopt_context_; }
   void set_deopt_context(DeoptContext* value) {
     ASSERT(value == NULL || deopt_context_ == NULL);
     deopt_context_ = value;
   }
 
-  int32_t edge_counter_increment_size() const {
-    return edge_counter_increment_size_;
+  BackgroundCompiler* background_compiler() const {
+    return background_compiler_;
   }
-  void set_edge_counter_increment_size(int32_t size) {
-    ASSERT(edge_counter_increment_size_ == -1);
-    ASSERT(size >= 0);
-    edge_counter_increment_size_ = size;
+  void set_background_compiler(BackgroundCompiler* value) {
+    background_compiler_ = value;
   }
 
   void UpdateLastAllocationProfileAccumulatorResetTimestamp() {
@@ -661,7 +613,7 @@
   ISOLATE_METRIC_LIST(ISOLATE_METRIC_ACCESSOR);
 #undef ISOLATE_METRIC_ACCESSOR
 
-#define ISOLATE_TIMELINE_STREAM_ACCESSOR(name, enabled_by_default)             \
+#define ISOLATE_TIMELINE_STREAM_ACCESSOR(name, not_used)                       \
   TimelineStream* Get##name##Stream() { return &stream_##name##_; }
   ISOLATE_TIMELINE_STREAM_LIST(ISOLATE_TIMELINE_STREAM_ACCESSOR)
 #undef ISOLATE_TIMELINE_STREAM_ACCESSOR
@@ -682,6 +634,11 @@
   }
   void set_collected_closures(const GrowableObjectArray& value);
 
+  RawGrowableObjectArray* background_compilation_queue() const {
+    return background_compilation_queue_;
+  }
+  void set_background_compilation_queue(const GrowableObjectArray& value);
+
   Metric* metrics_list_head() {
     return metrics_list_head_;
   }
@@ -701,29 +658,19 @@
     compilation_allowed_ = allowed;
   }
 
-#if defined(DEBUG)
-#define REUSABLE_HANDLE_SCOPE_ACCESSORS(object)                                \
-  void set_reusable_##object##_handle_scope_active(bool value) {               \
-    reusable_##object##_handle_scope_active_ = value;                          \
-  }                                                                            \
-  bool reusable_##object##_handle_scope_active() const {                       \
-    return reusable_##object##_handle_scope_active_;                           \
-  }
-  REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_SCOPE_ACCESSORS)
-#undef REUSABLE_HANDLE_SCOPE_ACCESSORS
-#endif  // defined(DEBUG)
-
-#define REUSABLE_HANDLE(object)                                                \
-  object& object##Handle() const {                                             \
-    return *object##_handle_;                                                  \
-  }
-  REUSABLE_HANDLE_LIST(REUSABLE_HANDLE)
-#undef REUSABLE_HANDLE
+  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);
+  void RegisterServiceExtensionHandler(const String& name,
+                                       const Instance& closure);
+  RawInstance* LookupServiceExtensionHandler(const String& name);
 
   static void VisitIsolates(IsolateVisitor* visitor);
 
-  Counters* counters() { return &counters_; }
-
   // Handle service messages until we are told to resume execution.
   void PauseEventHandler();
 
@@ -738,8 +685,17 @@
     mutator_thread_->set_zone(zone);
   }
 
+  bool is_service_isolate() const { return is_service_isolate_; }
+
+  static void KillAllIsolates(LibMsgId msg_id);
+  static void KillIfExists(Isolate* isolate, LibMsgId msg_id);
+
+  static void DisableIsolateCreation();
+  static void EnableIsolateCreation();
+
  private:
   friend class Dart;  // Init, InitOnce, Shutdown.
+  friend class IsolateKillerVisitor;  // Kill().
 
   explicit Isolate(const Dart_IsolateFlags& api_flags);
 
@@ -747,7 +703,13 @@
   static Isolate* Init(const char* name_prefix,
                        const Dart_IsolateFlags& api_flags,
                        bool is_vm_isolate = false);
+
+  // The isolates_list_monitor_ should be held when calling Kill().
+  void KillLocked(LibMsgId msg_id);
+
+  void LowLevelShutdown();
   void Shutdown();
+  void ReclaimTimelineBlocks();
 
   void BuildName(const char* name_prefix);
   void PrintInvokedFunctions();
@@ -764,6 +726,17 @@
     user_tag_ = tag;
   }
 
+  RawGrowableObjectArray* GetAndClearPendingServiceExtensionCalls();
+  RawGrowableObjectArray* pending_service_extension_calls() const {
+    return pending_service_extension_calls_;
+  }
+  void set_pending_service_extension_calls(const GrowableObjectArray& value);
+  RawGrowableObjectArray* registered_service_extension_handlers() const {
+    return registered_service_extension_handlers_;
+  }
+  void set_registered_service_extension_handlers(
+      const GrowableObjectArray& value);
+
   void ClearMutatorThread() {
     mutator_thread_ = NULL;
   }
@@ -776,13 +749,18 @@
   bool IsIsolateOf(Thread* thread);
 #endif  // DEBUG
 
-  template<class T> T* AllocateReusableHandle();
-
-  uword vm_tag_;
+  // Accessed from generated code:
+  uword stack_limit_;
   StoreBuffer* store_buffer_;
-  ThreadRegistry* thread_registry_;
+  Heap* heap_;
+  uword vm_tag_;
+  uword user_tag_;
+  RawUserTag* current_tag_;
+  RawUserTag* default_tag_;
   ClassTable class_table_;
-  MegamorphicCacheTable megamorphic_cache_table_;
+  bool single_step_;
+
+  ThreadRegistry* thread_registry_;
   Dart_MessageNotifyCallback message_notify_callback_;
   char* name_;
   char* debugger_name_;
@@ -792,7 +770,6 @@
   uint64_t pause_capability_;
   uint64_t terminate_capability_;
   bool errors_fatal_;
-  Heap* heap_;
   ObjectStore* object_store_;
   uword top_exit_frame_info_;
   void* init_callback_data_;
@@ -800,17 +777,13 @@
   Dart_LibraryTagHandler library_tag_handler_;
   ApiState* api_state_;
   Debugger* debugger_;
-  bool single_step_;
   bool resume_request_;
-  bool has_compiled_;
+  int64_t last_resume_timestamp_;
+  bool has_compiled_code_;  // Can check that no compilation occured.
   Flags flags_;
   Random random_;
   Simulator* simulator_;
-  LongJumpScope* long_jump_base_;
-  TimerList timer_list_;
-  intptr_t deopt_id_;
   Mutex* mutex_;  // protects stack_limit_ and saved_stack_limit_.
-  uword stack_limit_;
   uword saved_stack_limit_;
   uword stack_base_;
   uword stack_overflow_flags_;
@@ -822,13 +795,11 @@
   Dart_GcEpilogueCallback gc_epilogue_callback_;
   intptr_t defer_finalization_count_;
   DeoptContext* deopt_context_;
-  int32_t edge_counter_increment_size_;
+  BackgroundCompiler* background_compiler_;
 
   CompilerStats* compiler_stats_;
 
-  // Log.
   bool is_service_isolate_;
-  class Log* log_;
 
   // Status support.
   char* stacktrace_;
@@ -844,62 +815,57 @@
   // Trace buffer support.
   TraceBuffer* trace_buffer_;
 
-  // TimelineEvent buffer.
-  TimelineEventRecorder* timeline_event_recorder_;
-
   IsolateProfilerData* profiler_data_;
   Mutex profiler_data_mutex_;
-  InterruptableThreadState* thread_state_;
 
   VMTagCounters vm_tag_counters_;
-  uword user_tag_;
   RawGrowableObjectArray* tag_table_;
-  RawUserTag* current_tag_;
-  RawUserTag* default_tag_;
+
 
   RawGrowableObjectArray* collected_closures_;
   RawGrowableObjectArray* deoptimized_code_array_;
+  RawGrowableObjectArray* background_compilation_queue_;
+
+  // We use 6 list entries for each pending service extension calls.
+  enum {
+    kPendingHandlerIndex = 0,
+    kPendingMethodNameIndex,
+    kPendingKeysIndex,
+    kPendingValuesIndex,
+    kPendingReplyPortIndex,
+    kPendingIdIndex,
+    kPendingEntrySize
+  };
+  RawGrowableObjectArray* pending_service_extension_calls_;
+
+  // We use 2 list entries for each registered extension handler.
+  enum {
+    kRegisteredNameIndex = 0,
+    kRegisteredHandlerIndex,
+    kRegisteredEntrySize
+  };
+  RawGrowableObjectArray* registered_service_extension_handlers_;
 
   Metric* metrics_list_head_;
 
-  Counters counters_;
-
   bool compilation_allowed_;
 
-  // TODO(23153): Move this out of Isolate/Thread.
-  CHA* cha_;
-
   // Isolate list next pointer.
   Isolate* next_;
 
   // Used to wake the isolate when it is in the pause event loop.
   Monitor* pause_loop_monitor_;
 
-  // Reusable handles support.
-#define REUSABLE_HANDLE_FIELDS(object)                                         \
-  object* object##_handle_;
-  REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_FIELDS)
-#undef REUSABLE_HANDLE_FIELDS
-
-#if defined(DEBUG)
-#define REUSABLE_HANDLE_SCOPE_VARIABLE(object)                                 \
-  bool reusable_##object##_handle_scope_active_;
-  REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_SCOPE_VARIABLE);
-#undef REUSABLE_HANDLE_SCOPE_VARIABLE
-#endif  // defined(DEBUG)
-
 #define ISOLATE_METRIC_VARIABLE(type, variable, name, unit)                    \
   type metric_##variable##_;
   ISOLATE_METRIC_LIST(ISOLATE_METRIC_VARIABLE);
 #undef ISOLATE_METRIC_VARIABLE
 
-#define ISOLATE_TIMELINE_STREAM_VARIABLE(name, enabled_by_default)             \
+#define ISOLATE_TIMELINE_STREAM_VARIABLE(name, not_used)                       \
   TimelineStream stream_##name##_;
   ISOLATE_TIMELINE_STREAM_LIST(ISOLATE_TIMELINE_STREAM_VARIABLE)
 #undef ISOLATE_TIMELINE_STREAM_VARIABLE
 
-  VMHandles reusable_handles_;
-
   static Dart_IsolateCreateCallback create_callback_;
   static Dart_IsolateInterruptCallback interrupt_callback_;
   static Dart_IsolateUnhandledExceptionCallback unhandled_exception_callback_;
@@ -914,11 +880,13 @@
   static void WakePauseEventHandler(Dart_Isolate isolate);
 
   // Manage list of existing isolates.
-  static void AddIsolateTolist(Isolate* isolate);
+  static bool AddIsolateToList(Isolate* isolate);
   static void RemoveIsolateFromList(Isolate* isolate);
 
-  static Monitor* isolates_list_monitor_;  // Protects isolates_list_head_
+  // This monitor protects isolates_list_head_, and creation_enabled_.
+  static Monitor* isolates_list_monitor_;
   static Isolate* isolates_list_head_;
+  static bool creation_enabled_;
 
 #define REUSABLE_FRIEND_DECLARATION(name)                                      \
   friend class Reusable##name##HandleScope;
@@ -929,6 +897,7 @@
   friend class Scavenger;  // VisitObjectPointers
   friend class ServiceIsolate;
   friend class Thread;
+  friend class Timeline;
 
   DISALLOW_COPY_AND_ASSIGN(Isolate);
 };
@@ -1029,6 +998,7 @@
   IsolateSpawnState(Dart_Port parent_port,
                     const char* script_url,
                     const char* package_root,
+                    const char** package_map,
                     const Instance& args,
                     const Instance& message,
                     bool paused,
@@ -1043,19 +1013,20 @@
   Dart_Port parent_port() const { return parent_port_; }
   Dart_Port on_exit_port() const { return on_exit_port_; }
   Dart_Port on_error_port() const { return on_error_port_; }
-  char* script_url() const { return script_url_; }
-  char* package_root() const { return package_root_; }
-  char* library_url() const { return library_url_; }
-  char* class_name() const { return class_name_; }
-  char* function_name() const { return function_name_; }
+  const char* script_url() const { return script_url_; }
+  const char* package_root() const { return package_root_; }
+  const char** package_map() const { return package_map_; }
+  const char* library_url() const { return library_url_; }
+  const char* class_name() const { return class_name_; }
+  const char* function_name() const { return function_name_; }
   bool is_spawn_uri() const { return library_url_ == NULL; }
   bool paused() const { return paused_; }
   bool errors_are_fatal() const { return errors_are_fatal_; }
   Isolate::Flags* isolate_flags() { return &isolate_flags_; }
 
   RawObject* ResolveFunction();
-  RawInstance* BuildArgs(Zone* zone);
-  RawInstance* BuildMessage(Zone* zone);
+  RawInstance* BuildArgs(Thread* thread);
+  RawInstance* BuildMessage(Thread* thread);
   void Cleanup();
 
  private:
@@ -1063,11 +1034,12 @@
   Dart_Port parent_port_;
   Dart_Port on_exit_port_;
   Dart_Port on_error_port_;
-  char* script_url_;
-  char* package_root_;
-  char* library_url_;
-  char* class_name_;
-  char* function_name_;
+  const char* script_url_;
+  const char* package_root_;
+  const char** package_map_;
+  const char* library_url_;
+  const char* class_name_;
+  const char* function_name_;
   uint8_t* serialized_args_;
   intptr_t serialized_args_len_;
   uint8_t* serialized_message_;
diff --git a/runtime/vm/isolate_test.cc b/runtime/vm/isolate_test.cc
index f5f0506..8dcc14e 100644
--- a/runtime/vm/isolate_test.cc
+++ b/runtime/vm/isolate_test.cc
@@ -6,6 +6,9 @@
 #include "platform/assert.h"
 #include "vm/globals.h"
 #include "vm/isolate.h"
+#include "vm/lockers.h"
+#include "vm/thread_barrier.h"
+#include "vm/thread_pool.h"
 #include "vm/unit_test.h"
 
 namespace dart {
@@ -80,4 +83,70 @@
   EXPECT_VALID(exception_result);
 }
 
+
+class InterruptChecker : public ThreadPool::Task {
+ public:
+  static const intptr_t kTaskCount;
+  static const intptr_t kIterations;
+
+  InterruptChecker(Isolate* isolate,
+                   ThreadBarrier* barrier)
+    : isolate_(isolate),
+      barrier_(barrier) {
+  }
+
+  virtual void Run() {
+    Thread::EnterIsolateAsHelper(isolate_);
+    // Tell main thread that we are ready.
+    barrier_->Sync();
+    for (intptr_t i = 0; i < kIterations; ++i) {
+      // Busy wait for interrupts.
+      while (!isolate_->HasInterruptsScheduled(Isolate::kVMInterrupt)) {
+        // Do nothing.
+      }
+      // Tell main thread that we observed the interrupt.
+      barrier_->Sync();
+    }
+    Thread::ExitIsolateAsHelper();
+    barrier_->Exit();
+  }
+
+ private:
+  Isolate* isolate_;
+  ThreadBarrier* barrier_;
+};
+
+
+const intptr_t InterruptChecker::kTaskCount = 5;
+const intptr_t InterruptChecker::kIterations = 10;
+
+// Test and document usage of Isolate::HasInterruptsScheduled.
+//
+// Go through a number of rounds of scheduling interrupts and waiting until all
+// unsynchronized busy-waiting tasks observe it (in the current implementation,
+// the exact latency depends on cache coherence). Synchronization is then used
+// to ensure that the response to the interrupt, i.e., starting a new round,
+// happens *after* the interrupt is observed. Without this synchronization, the
+// compiler and/or CPU could reorder operations to make the tasks observe the
+// round update *before* the interrupt is set.
+TEST_CASE(StackLimitInterrupts) {
+  Isolate* isolate = Thread::Current()->isolate();
+  ThreadBarrier barrier(InterruptChecker::kTaskCount + 1);
+  // Start all tasks. They will busy-wait until interrupted in the first round.
+  for (intptr_t task = 0; task < InterruptChecker::kTaskCount; task++) {
+    Dart::thread_pool()->Run(new InterruptChecker(isolate, &barrier));
+  }
+  // Wait for all tasks to get ready for the first round.
+  barrier.Sync();
+  for (intptr_t i = 0; i < InterruptChecker::kIterations; ++i) {
+    isolate->ScheduleInterrupts(Isolate::kVMInterrupt);
+    // Wait for all tasks to observe the interrupt.
+    barrier.Sync();
+    // Continue with next round.
+    uword interrupts = isolate->GetAndClearInterrupts();
+    EXPECT((interrupts & Isolate::kVMInterrupt) != 0);
+  }
+  barrier.Exit();
+}
+
 }  // namespace dart
diff --git a/runtime/vm/json_stream.cc b/runtime/vm/json_stream.cc
index 6fc9e92..0f4f3a6 100644
--- a/runtime/vm/json_stream.cc
+++ b/runtime/vm/json_stream.cc
@@ -10,8 +10,8 @@
 #include "vm/message.h"
 #include "vm/metrics.h"
 #include "vm/object.h"
-#include "vm/service_event.h"
 #include "vm/service.h"
+#include "vm/service_event.h"
 #include "vm/timeline.h"
 #include "vm/unicode.h"
 
@@ -23,15 +23,20 @@
 JSONStream::JSONStream(intptr_t buf_size)
     : open_objects_(0),
       buffer_(buf_size),
-      default_id_zone_(Isolate::Current()->object_id_ring(),
-                       ObjectIdRing::kAllocateId),
+      default_id_zone_(),
       id_zone_(&default_id_zone_),
       reply_port_(ILLEGAL_PORT),
-      seq_(Instance::Handle(Instance::null())),
+      seq_(NULL),
       method_(""),
       param_keys_(NULL),
       param_values_(NULL),
       num_params_(0) {
+  ObjectIdRing* ring = NULL;
+  Isolate* isolate = Isolate::Current();
+  if (isolate != NULL) {
+    ring = isolate->object_id_ring();
+  }
+  default_id_zone_.Init(ring, ObjectIdRing::kAllocateId);
 }
 
 
@@ -46,7 +51,7 @@
                        const Array& param_keys,
                        const Array& param_values) {
   set_reply_port(reply_port);
-  seq_ ^= seq.raw();
+  seq_ = &Instance::ZoneHandle(seq.raw());
   method_ = method.ToCString();
 
   String& string_iterator = String::Handle();
@@ -103,8 +108,7 @@
     case kCannotAddBreakpoint:
       return "Cannot add breakpoint";
     default:
-      UNIMPLEMENTED();
-      return "Unexpected rpc error code";
+      return "Extension error";
   }
 }
 
@@ -154,6 +158,20 @@
 }
 
 
+void JSONStream::PostNullReply(Dart_Port port) {
+  const Object& reply = Object::Handle(Object::null());
+  ASSERT(reply.IsNull());
+
+  uint8_t* data = NULL;
+  MessageWriter writer(&data, &allocator, false);
+  writer.WriteMessage(reply);
+  PortMap::PostMessage(new Message(port,
+                                   data,
+                                   writer.BytesWritten(),
+                                   Message::kNormalPriority));
+}
+
+
 void JSONStream::PostReply() {
   Dart_Port port = reply_port();
   ASSERT(port != ILLEGAL_PORT);
@@ -162,18 +180,19 @@
   if (FLAG_trace_service) {
     process_delta_micros = OS::GetCurrentTimeMicros() - setup_time_micros_;
   }
-
-  if (seq_.IsString()) {
-    const String& str = String::Cast(seq_);
+  ASSERT(seq_ != NULL);
+  if (seq_->IsString()) {
+    const String& str = String::Cast(*seq_);
     PrintProperty("id", str.ToCString());
-  } else if (seq_.IsInteger()) {
-    const Integer& integer = Integer::Cast(seq_);
+  } else if (seq_->IsInteger()) {
+    const Integer& integer = Integer::Cast(*seq_);
     PrintProperty64("id", integer.AsInt64Value());
-  } else if (seq_.IsDouble()) {
-    const Double& dbl = Double::Cast(seq_);
+  } else if (seq_->IsDouble()) {
+    const Double& dbl = Double::Cast(*seq_);
     PrintProperty("id", dbl.value());
-  } else if (seq_.IsNull()) {
+  } else if (seq_->IsNull()) {
     // JSON-RPC 2.0 says that a request with a null ID shouldn't get a reply.
+    PostNullReply(port);
     return;
   }
   buffer_.AddChar('}');
@@ -273,19 +292,28 @@
 
 
 void JSONStream::PrintValue(intptr_t i) {
+  EnsureIntegerIsRepresentableInJavaScript(static_cast<int64_t>(i));
   PrintCommaIfNeeded();
   buffer_.Printf("%" Pd "", i);
 }
 
 
 void JSONStream::PrintValue64(int64_t i) {
+  EnsureIntegerIsRepresentableInJavaScript(i);
   PrintCommaIfNeeded();
   buffer_.Printf("%" Pd64 "", i);
 }
 
 
 void JSONStream::PrintValueTimeMillis(int64_t millis) {
-  PrintValue(static_cast<double>(millis));
+  EnsureIntegerIsRepresentableInJavaScript(millis);
+  PrintValue64(millis);
+}
+
+
+void JSONStream::PrintValueTimeMicros(int64_t micros) {
+  EnsureIntegerIsRepresentableInJavaScript(micros);
+  PrintValue64(micros);
 }
 
 
@@ -415,6 +443,12 @@
 }
 
 
+void JSONStream::PrintValueVM(bool ref) {
+  PrintCommaIfNeeded();
+  Service::PrintJSONForVM(this, ref);
+}
+
+
 void JSONStream::PrintServiceId(const Object& o) {
   ASSERT(id_zone_ != NULL);
   PrintProperty("id", id_zone_->GetServiceId(o));
@@ -428,21 +462,24 @@
 
 
 void JSONStream::PrintProperty(const char* name, intptr_t i) {
-  ASSERT(Utils::IsJavascriptInt(i));
   PrintPropertyName(name);
   PrintValue(i);
 }
 
 
 void JSONStream::PrintProperty64(const char* name, int64_t i) {
-  ASSERT(Utils::IsJavascriptInt64(i));
   PrintPropertyName(name);
   PrintValue64(i);
 }
 
 
 void JSONStream::PrintPropertyTimeMillis(const char* name, int64_t millis) {
-  PrintProperty(name, static_cast<double>(millis));
+  PrintProperty64(name, millis);
+}
+
+
+void JSONStream::PrintPropertyTimeMicros(const char* name, int64_t micros) {
+  PrintProperty64(name, micros);
 }
 
 
@@ -535,6 +572,14 @@
 }
 
 
+void JSONStream::Steal(const char** buffer, intptr_t* buffer_length) {
+  ASSERT(buffer != NULL);
+  ASSERT(buffer_length != NULL);
+  *buffer_length = buffer_.length();
+  *buffer = buffer_.Steal();
+}
+
+
 void JSONStream::set_reply_port(Dart_Port port) {
   reply_port_ = port;
 }
@@ -555,6 +600,12 @@
 }
 
 
+void JSONStream::PrintPropertyVM(const char* name, bool ref) {
+  PrintPropertyName(name);
+  PrintValueVM(ref);
+}
+
+
 void JSONStream::PrintPropertyName(const char* name) {
   ASSERT(name != NULL);
   PrintCommaIfNeeded();
@@ -583,6 +634,17 @@
 }
 
 
+void JSONStream::EnsureIntegerIsRepresentableInJavaScript(int64_t i) {
+#ifdef DEBUG
+  if (!Utils::IsJavascriptInt(i)) {
+    OS::Print("JSONStream::EnsureIntegerIsRepresentableInJavaScript failed on "
+              "%" Pd64 "\n", i);
+    UNREACHABLE();
+  }
+#endif
+}
+
+
 void JSONStream::AddEscapedUTF8String(const char* s) {
   if (s == NULL) {
     return;
@@ -659,7 +721,7 @@
 
 void JSONObject::AddLocation(const Script& script,
                              intptr_t token_pos,
-                             intptr_t end_token_pos) {
+                             intptr_t end_token_pos) const {
   JSONObject location(this, "location");
   location.AddProperty("type", "SourceLocation");
   location.AddProperty("script", script);
@@ -670,6 +732,49 @@
 }
 
 
+void JSONObject::AddLocation(const BreakpointLocation* bpt_loc) const {
+  ASSERT(bpt_loc->IsResolved());
+
+  Zone* zone = Thread::Current()->zone();
+  Library& library = Library::Handle(zone);
+  Script& script = Script::Handle(zone);
+  intptr_t token_pos;
+  bpt_loc->GetCodeLocation(&library, &script, &token_pos);
+  AddLocation(script, token_pos);
+}
+
+
+void JSONObject::AddUnresolvedLocation(
+    const BreakpointLocation* bpt_loc) const {
+  ASSERT(!bpt_loc->IsResolved());
+
+  Zone* zone = Thread::Current()->zone();
+  Library& library = Library::Handle(zone);
+  Script& script = Script::Handle(zone);
+  intptr_t token_pos;
+  bpt_loc->GetCodeLocation(&library, &script, &token_pos);
+
+  JSONObject location(this, "location");
+  location.AddProperty("type", "UnresolvedSourceLocation");
+  if (!script.IsNull()) {
+    location.AddProperty("script", script);
+  } else {
+    const String& scriptUri = String::Handle(zone, bpt_loc->url());
+    location.AddPropertyStr("scriptUri", scriptUri);
+  }
+  if (bpt_loc->requested_line_number() >= 0) {
+    // 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());
+    }
+  } else {
+    // This unresolved breakpoint was requested at some function entry.
+    location.AddProperty("tokenPos", token_pos);
+  }
+}
+
 
 void JSONObject::AddPropertyF(const char* name,
                               const char* format, ...) const {
diff --git a/runtime/vm/json_stream.h b/runtime/vm/json_stream.h
index e581560..cd8fe62 100644
--- a/runtime/vm/json_stream.h
+++ b/runtime/vm/json_stream.h
@@ -15,6 +15,7 @@
 
 class Array;
 class Breakpoint;
+class BreakpointLocation;
 class Field;
 class GrowableObjectArray;
 class Instance;
@@ -42,6 +43,8 @@
   kInvalidParams  = -32602,
   kInternalError  = -32603,
 
+  kExtensionError = -32000,
+
   kFeatureDisabled         = 100,
   kVMMustBePaused          = 101,
   kCannotAddBreakpoint     = 102,
@@ -77,6 +80,8 @@
   TextBuffer* buffer() { return &buffer_; }
   const char* ToCString() { return buffer_.buf(); }
 
+  void Steal(const char** buffer, intptr_t* buffer_length);
+
   void set_reply_port(Dart_Port port);
 
   void SetParams(const char** param_keys, const char** param_values,
@@ -106,6 +111,7 @@
 
  private:
   void Clear();
+  void PostNullReply(Dart_Port port);
 
   void OpenObject(const char* property_name = NULL);
   void CloseObject();
@@ -117,6 +123,7 @@
   void PrintValue(intptr_t i);
   void PrintValue64(int64_t i);
   void PrintValueTimeMillis(int64_t millis);
+  void PrintValueTimeMicros(int64_t micros);
   void PrintValue(double d);
   void PrintValueBase64(const uint8_t* bytes, intptr_t length);
   void PrintValue(const char* s);
@@ -131,12 +138,14 @@
   void PrintValue(Isolate* isolate, bool ref = true);
   bool PrintValueStr(const String& s, intptr_t limit);
   void PrintValue(TimelineEvent* timeline_event);
+  void PrintValueVM(bool ref = true);
 
   void PrintServiceId(const Object& o);
   void PrintPropertyBool(const char* name, bool b);
   void PrintProperty(const char* name, intptr_t i);
   void PrintProperty64(const char* name, int64_t i);
   void PrintPropertyTimeMillis(const char* name, int64_t millis);
+  void PrintPropertyTimeMicros(const char* name, int64_t micros);
   void PrintProperty(const char* name, double d);
   void PrintPropertyBase64(const char* name,
                            const uint8_t* bytes,
@@ -154,6 +163,7 @@
   void PrintProperty(const char* name, MessageQueue* queue);
   void PrintProperty(const char* name, Isolate* isolate);
   void PrintProperty(const char* name, TimelineEvent* timeline_event);
+  void PrintPropertyVM(const char* name, bool ref = true);
   void PrintPropertyName(const char* name);
   void PrintCommaIfNeeded();
   bool NeedComma();
@@ -164,13 +174,16 @@
 
   intptr_t nesting_level() const { return open_objects_; }
 
+  // Debug only fatal assertion.
+  static void EnsureIntegerIsRepresentableInJavaScript(int64_t i);
+
   intptr_t open_objects_;
   TextBuffer buffer_;
   // Default service id zone.
   RingServiceIdZone default_id_zone_;
   ServiceIdZone* id_zone_;
   Dart_Port reply_port_;
-  Instance& seq_;
+  Instance* seq_;
   const char* method_;
   const char** param_keys_;
   const char** param_values_;
@@ -204,7 +217,11 @@
 
   void AddLocation(const Script& script,
                    intptr_t token_pos,
-                   intptr_t end_token_pos = -1);
+                   intptr_t end_token_pos = -1) const;
+
+  void AddLocation(const BreakpointLocation* bpt_loc) const;
+
+  void AddUnresolvedLocation(const BreakpointLocation* bpt_loc) const;
 
   void AddProperty(const char* name, bool b) const {
     stream_->PrintPropertyBool(name, b);
@@ -218,6 +235,9 @@
   void AddPropertyTimeMillis(const char* name, int64_t millis) const {
     stream_->PrintPropertyTimeMillis(name, millis);
   }
+  void AddPropertyTimeMicros(const char* name, int64_t micros) const {
+    stream_->PrintPropertyTimeMicros(name, micros);
+  }
   void AddProperty(const char* name, double d) const {
     stream_->PrintProperty(name, d);
   }
@@ -258,6 +278,9 @@
   void AddProperty(const char* name, TimelineEvent* timeline_event) const {
     stream_->PrintProperty(name, timeline_event);
   }
+  void AddPropertyVM(const char* name, bool ref = true) const {
+    stream_->PrintPropertyVM(name, ref);
+  }
   void AddPropertyF(const char* name, const char* format, ...) const
       PRINTF_ATTRIBUTE(3, 4);
 
@@ -292,6 +315,9 @@
   void AddValueTimeMillis(int64_t millis) const {
     stream_->PrintValueTimeMillis(millis);
   }
+  void AddValueTimeMicros(int64_t micros) const {
+    stream_->PrintValueTimeMicros(micros);
+  }
   void AddValue(double d) const { stream_->PrintValue(d); }
   void AddValue(const char* s) const { stream_->PrintValue(s); }
   void AddValue(const Object& obj, bool ref = true) const {
@@ -315,6 +341,9 @@
   void AddValue(TimelineEvent* timeline_event) const {
     stream_->PrintValue(timeline_event);
   }
+  void AddValueVM(bool ref = true) const {
+    stream_->PrintValueVM(ref);
+  }
   void AddValueF(const char* format, ...) const PRINTF_ATTRIBUTE(2, 3);
 
  private:
diff --git a/runtime/vm/json_test.cc b/runtime/vm/json_test.cc
index 5bce0d39..6ca6760 100644
--- a/runtime/vm/json_test.cc
+++ b/runtime/vm/json_test.cc
@@ -299,8 +299,12 @@
     JSONObject jsobj(&jsarr);
     jsobj.AddProperty("object_key", Object::Handle(Object::null()));
   }
+  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\","
@@ -308,11 +312,13 @@
                "{\"object_key\":"
                "{\"type\":\"@Instance\","
                "\"_vmType\":\"null\","
+               "\"class\":{\"type\":\"@Class\",\"fixedId\":true,\"id\":\"\","
+               "\"name\":\"Null\"},"
                "\"kind\":\"Null\","
                "\"fixedId\":true,"
                "\"id\":\"objects\\/null\","
                "\"valueAsString\":\"null\"}}]",
-               js.ToCString());
+               buffer);
 }
 
 TEST_CASE(JSON_JSONStream_EscapedString) {
diff --git a/runtime/vm/locations.cc b/runtime/vm/locations.cc
index 525855a..e460a2d 100644
--- a/runtime/vm/locations.cc
+++ b/runtime/vm/locations.cc
@@ -225,9 +225,9 @@
 
 void Location::Print() const {
   if (kind() == kStackSlot) {
-    ISL_Print("S%+" Pd "", stack_index());
+    THR_Print("S%+" Pd "", stack_index());
   } else {
-    ISL_Print("%s", Name());
+    THR_Print("%s", Name());
   }
 }
 
diff --git a/runtime/vm/locations.h b/runtime/vm/locations.h
index 48fbd6f..047b663 100644
--- a/runtime/vm/locations.h
+++ b/runtime/vm/locations.h
@@ -148,7 +148,7 @@
     return (value_ & kLocationTagMask) == kConstantTag;
   }
 
-  static Location Constant(ConstantInstr* obj) {
+  static Location Constant(const ConstantInstr* obj) {
     Location loc(reinterpret_cast<uword>(obj) | kConstantTag);
     ASSERT(obj == loc.constant_instruction());
     return loc;
@@ -519,7 +519,7 @@
     for (intptr_t i = 0; i < kNumberOfCpuRegisters; i++) {
       Register r = static_cast<Register>(i);
       if (ContainsRegister(r)) {
-        ISL_Print("%s %s\n", Assembler::RegisterName(r),
+        THR_Print("%s %s\n", Assembler::RegisterName(r),
                            IsTagged(r) ? "tagged" : "untagged");
       }
     }
@@ -527,7 +527,7 @@
     for (intptr_t i = 0; i < kNumberOfFpuRegisters; i++) {
       FpuRegister r = static_cast<FpuRegister>(i);
       if (ContainsFpuRegister(r)) {
-        ISL_Print("%s\n", Assembler::FpuRegisterName(r));
+        THR_Print("%s\n", Assembler::FpuRegisterName(r));
       }
     }
   }
diff --git a/runtime/vm/log.cc b/runtime/vm/log.cc
index 5bb9842..e29432f 100644
--- a/runtime/vm/log.cc
+++ b/runtime/vm/log.cc
@@ -11,6 +11,10 @@
 
 DEFINE_FLAG(bool, force_log_flush, false, "Always flush log messages.");
 
+DEFINE_FLAG(charp, isolate_log_filter, NULL,
+            "Log isolates whose name include the filter. "
+            "Default: service isolate log messages are suppressed.");
+
 Log::Log(LogPrinter printer)
     : printer_(printer),
       manual_flush_(0),
@@ -18,6 +22,23 @@
 }
 
 
+Log::~Log() {
+  // Did someone enable manual flushing and then forgot to Flush?
+  ASSERT(cursor() == 0);
+}
+
+
+Log* Log::Current() {
+  Thread* thread = Thread::Current();
+  Isolate* isolate = thread->isolate();
+  if (isolate != NULL && Log::ShouldLogForIsolate(isolate)) {
+    return thread->log();
+  } else {
+    return Log::NoOpLog();
+  }
+}
+
+
 void Log::Print(const char* format, ...) {
   if (this == NoOpLog()) {
     return;
@@ -92,6 +113,24 @@
 }
 
 
+bool Log::ShouldLogForIsolate(const Isolate* isolate) {
+  if (FLAG_isolate_log_filter == NULL) {
+    if (isolate->is_service_isolate()) {
+      // By default, do not log for the service isolate.
+      return false;
+    }
+    return true;
+  }
+  const char* name = isolate->name();
+  ASSERT(name != NULL);
+  if (strstr(name, FLAG_isolate_log_filter) == NULL) {
+    // Filter does not match, do not log for this isolate.
+    return false;
+  }
+  return true;
+}
+
+
 Log Log::noop_log_;
 Log* Log::NoOpLog() {
   return &noop_log_;
@@ -117,25 +156,14 @@
 }
 
 
-LogBlock::LogBlock(Thread* thread, Log* log)
-    : StackResource(thread),
-      log_(log), cursor_(log->cursor()) {
-  CommonConstructor();
+void LogBlock::Initialize() {
+  log_->EnableManualFlush();
 }
 
 
-LogBlock::LogBlock(Isolate* isolate)
-    : StackResource(isolate),
-      log_(isolate->Log()), cursor_(isolate->Log()->cursor()) {
-  CommonConstructor();
-}
-
-
-LogBlock::LogBlock(Thread* thread)
-    : StackResource(thread),
-      log_(thread->isolate()->Log()),
-      cursor_(thread->isolate()->Log()->cursor()) {
-  CommonConstructor();
+LogBlock::~LogBlock() {
+  log_->Flush(cursor_);
+  log_->DisableManualFlush();
 }
 
 }  // namespace dart
diff --git a/runtime/vm/log.h b/runtime/vm/log.h
index f4c58e9..a2f18fa 100644
--- a/runtime/vm/log.h
+++ b/runtime/vm/log.h
@@ -11,26 +11,28 @@
 
 namespace dart {
 
-class Isolate;
 class LogBlock;
 class Thread;
 
 #if defined(_MSC_VER)
-#define ISL_Print(format, ...) \
-    Isolate::Current()->Log()->Print(format, __VA_ARGS__)
+#define THR_Print(format, ...) \
+    Log::Current()->Print(format, __VA_ARGS__)
 #else
-#define ISL_Print(format, ...) \
-    Isolate::Current()->Log()->Print(format, ##__VA_ARGS__)
+#define THR_Print(format, ...) \
+    Log::Current()->Print(format, ##__VA_ARGS__)
 #endif
 
-#define ISL_VPrint(format, args) \
-    Isolate::Current()->Log()->VPrint(format, args)
+#define THR_VPrint(format, args) \
+    Log::Current()->VPrint(format, args)
 
 typedef void (*LogPrinter)(const char* str, ...);
 
 class Log {
  public:
   explicit Log(LogPrinter printer = OS::Print);
+  ~Log();
+
+  static Log* Current();
 
   // Append a formatted string to the log.
   void Print(const char* format, ...) PRINTF_ATTRIBUTE(2, 3);
@@ -55,6 +57,9 @@
   void EnableManualFlush();
   void DisableManualFlush();
 
+  // Returns false if we should drop log messages related to 'isolate'.
+  static bool ShouldLogForIsolate(const Isolate* isolate);
+
   static Log noop_log_;
   LogPrinter printer_;
   intptr_t manual_flush_;
@@ -70,31 +75,24 @@
 // Can be nested.
 class LogBlock : public StackResource {
  public:
-  LogBlock(Isolate* isolate, Log* log)
-      : StackResource(isolate),
-        log_(log), cursor_(log->cursor()) {
-    CommonConstructor();
+  LogBlock(Thread* thread, Log* log)
+      : StackResource(thread), log_(log), cursor_(log->cursor()) {
+    Initialize();
   }
 
-  explicit LogBlock(Isolate* isolate);
-  explicit LogBlock(Thread* thread);
-
-  LogBlock(Thread* thread, Log* log);
-
-  ~LogBlock() {
-    CommonDestructor();
+  LogBlock()
+      : StackResource(Thread::Current()),
+        log_(Log::Current()),
+        cursor_(Log::Current()->cursor()) {
+    Initialize();
   }
 
+  ~LogBlock();
+
  private:
-  void CommonConstructor() {
-    log_->EnableManualFlush();
-  }
+  void Initialize();
 
-  void CommonDestructor() {
-    log_->Flush(cursor_);
-    log_->DisableManualFlush();
-  }
-  Log* log_;
+  Log* const log_;
   const intptr_t cursor_;
 };
 
diff --git a/runtime/vm/log_test.cc b/runtime/vm/log_test.cc
index 370fefc..84ef855 100644
--- a/runtime/vm/log_test.cc
+++ b/runtime/vm/log_test.cc
@@ -47,13 +47,12 @@
 
 TEST_CASE(Log_Macro) {
   test_output_ = NULL;
-  Isolate* isolate = Isolate::Current();
-  Log* log = isolate->Log();
+  Log* log = Log::Current();
   LogTestHelper::SetPrinter(log, TestPrinter);
 
-  ISL_Print("Hello %s", "World");
+  THR_Print("Hello %s", "World");
   EXPECT_STREQ("Hello World", test_output_);
-  ISL_Print("SingleArgument");
+  THR_Print("SingleArgument");
   EXPECT_STREQ("SingleArgument", test_output_);
 }
 
@@ -72,15 +71,13 @@
   test_output_ = NULL;
   Log* log = new Log(TestPrinter);
 
-  Isolate* isolate = Isolate::Current();
-
   EXPECT_EQ(reinterpret_cast<const char*>(NULL), test_output_);
   {
-    LogBlock ba(isolate, log);
+    LogBlock ba(thread, log);
     log->Print("APPLE");
     EXPECT_EQ(reinterpret_cast<const char*>(NULL), test_output_);
     {
-      LogBlock ba(isolate, log);
+      LogBlock ba(thread, log);
       log->Print("BANANA");
       EXPECT_EQ(reinterpret_cast<const char*>(NULL), test_output_);
     }
diff --git a/runtime/vm/longjump.cc b/runtime/vm/longjump.cc
index 66de5af..e2cf726 100644
--- a/runtime/vm/longjump.cc
+++ b/runtime/vm/longjump.cc
@@ -17,7 +17,7 @@
 
 jmp_buf* LongJumpScope::Set() {
   ASSERT(top_ == NULL);
-  top_ = Isolate::Current()->top_resource();
+  top_ = Thread::Current()->top_resource();
   return &environment_;
 }
 
@@ -25,13 +25,19 @@
 bool LongJumpScope::IsSafeToJump() {
   // We do not want to jump past Dart frames.  Note that this code
   // assumes the stack grows from high to low.
-  Isolate* isolate = Isolate::Current();
+  Thread* thread = Thread::Current();
+  Isolate* isolate = thread->isolate();
   uword jumpbuf_addr = Isolate::GetCurrentStackPointer();
 #if defined(USING_SIMULATOR)
   uword top_exit_frame_info = isolate->simulator()->top_exit_frame_info();
 #else
-  uword top_exit_frame_info = isolate->top_exit_frame_info();
+  uword top_exit_frame_info = thread->top_exit_frame_info();
 #endif
+  if (!isolate->MutatorThreadIsCurrentThread()) {
+    // A helper thread does not execute Dart code, so it's safe to jump.
+    ASSERT(top_exit_frame_info == 0);
+    return true;
+  }
   return ((top_exit_frame_info == 0) || (jumpbuf_addr < top_exit_frame_info));
 }
 
@@ -47,7 +53,7 @@
 
 #if defined(DEBUG)
 #define CHECK_REUSABLE_HANDLE(name)                                            \
-  ASSERT(!isolate->reusable_##name##_handle_scope_active());
+  ASSERT(!thread->reusable_##name##_handle_scope_active());
 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 adf9449..ce4f813 100644
--- a/runtime/vm/longjump.h
+++ b/runtime/vm/longjump.h
@@ -17,14 +17,14 @@
 class LongJumpScope : public StackResource {
  public:
   LongJumpScope()
-    : StackResource(Isolate::Current()),
+    : StackResource(Thread::Current()),
       top_(NULL),
-      base_(Isolate::Current()->long_jump_base()) {
-    Isolate::Current()->set_long_jump_base(this);
+      base_(Thread::Current()->long_jump_base()) {
+    Thread::Current()->set_long_jump_base(this);
   }
 
   ~LongJumpScope() {
-    Isolate::Current()->set_long_jump_base(base_);
+    Thread::Current()->set_long_jump_base(base_);
   }
 
   jmp_buf* Set();
diff --git a/runtime/vm/longjump_test.cc b/runtime/vm/longjump_test.cc
index f23956b..4f48050 100644
--- a/runtime/vm/longjump_test.cc
+++ b/runtime/vm/longjump_test.cc
@@ -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.
 
-#include "vm/isolate.h"
 #include "vm/longjump.h"
+#include "vm/thread.h"
 #include "vm/unit_test.h"
 
 namespace dart {
@@ -18,7 +18,7 @@
 
 
 TEST_CASE(LongJump) {
-  LongJumpScope* base = Isolate::Current()->long_jump_base();
+  LongJumpScope* base = Thread::Current()->long_jump_base();
   {
     LongJumpScope jump;
     if (setjmp(*jump.Set()) == 0) {
@@ -26,7 +26,7 @@
       UNREACHABLE();
     }
   }
-  ASSERT(base == Isolate::Current()->long_jump_base());
+  ASSERT(base == Thread::Current()->long_jump_base());
 }
 
 }  // namespace dart
diff --git a/runtime/vm/megamorphic_cache_table.cc b/runtime/vm/megamorphic_cache_table.cc
index 3291b0f..7f98d3b 100644
--- a/runtime/vm/megamorphic_cache_table.cc
+++ b/runtime/vm/megamorphic_cache_table.cc
@@ -6,55 +6,61 @@
 
 #include <stdlib.h>
 #include "vm/object.h"
+#include "vm/object_store.h"
 #include "vm/stub_code.h"
 #include "vm/symbols.h"
 
 namespace dart {
 
-MegamorphicCacheTable::MegamorphicCacheTable()
-    : miss_handler_function_(NULL),
-      miss_handler_code_(NULL),
-      capacity_(0),
-      length_(0),
-      table_(NULL) {
-}
-
-
-MegamorphicCacheTable::~MegamorphicCacheTable() {
-  free(table_);
-}
-
-
-RawMegamorphicCache* MegamorphicCacheTable::Lookup(const String& name,
+RawMegamorphicCache* MegamorphicCacheTable::Lookup(Isolate* isolate,
+                                                   const String& name,
                                                    const Array& descriptor) {
-  for (intptr_t i = 0; i < length_; ++i) {
-    if ((table_[i].name == name.raw()) &&
-        (table_[i].descriptor == descriptor.raw())) {
-      return table_[i].cache;
+  ASSERT(name.IsSymbol());
+  // TODO(rmacnak): ASSERT(descriptor.IsCanonical());
+
+  // TODO(rmacnak): Make a proper hashtable a la symbol table.
+  GrowableObjectArray& table = GrowableObjectArray::Handle(
+      isolate->object_store()->megamorphic_cache_table());
+  if (table.IsNull()) {
+    table = GrowableObjectArray::New(Heap::kOld);
+    ASSERT((table.Length() % kEntrySize) == 0);
+    isolate->object_store()->set_megamorphic_cache_table(table);
+  } else {
+    for (intptr_t i = 0; i < table.Length(); i += kEntrySize) {
+      if ((table.At(i + kEntryNameOffset) == name.raw()) &&
+          (table.At(i + kEntryDescriptorOffset) == descriptor.raw())) {
+        return MegamorphicCache::RawCast(table.At(i + kEntryCacheOffset));
+      }
     }
   }
 
-  if (length_ == capacity_) {
-    capacity_ += kCapacityIncrement;
-    table_ =
-        reinterpret_cast<Entry*>(realloc(table_, capacity_ * sizeof(*table_)));
-  }
-
-  ASSERT(length_ < capacity_);
   const MegamorphicCache& cache =
       MegamorphicCache::Handle(MegamorphicCache::New());
-  Entry entry = { name.raw(), descriptor.raw(), cache.raw() };
-  table_[length_++] = entry;
+  table.Add(name, Heap::kOld);
+  table.Add(descriptor, Heap::kOld);
+  table.Add(cache, Heap::kOld);
+  ASSERT((table.Length() % kEntrySize) == 0);
   return cache.raw();
 }
 
 
-void MegamorphicCacheTable::InitMissHandler() {
+RawFunction* MegamorphicCacheTable::miss_handler(Isolate* isolate) {
+  ASSERT(isolate->object_store()->megamorphic_miss_function() !=
+         Function::null());
+  return isolate->object_store()->megamorphic_miss_function();
+}
+
+
+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));
+  // 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::Function()).type_class());
   const Function& function =
@@ -69,37 +75,28 @@
                                      0));  // No token position.
   function.set_is_debuggable(false);
   function.set_is_visible(false);
-  miss_handler_code_ = code.raw();
-  miss_handler_function_ = function.raw();
   function.AttachCode(code);
+
+  isolate->object_store()->SetMegamorphicMissHandler(code, function);
 }
 
 
-void MegamorphicCacheTable::VisitObjectPointers(ObjectPointerVisitor* v) {
-  ASSERT(v != NULL);
-  v->VisitPointer(reinterpret_cast<RawObject**>(&miss_handler_code_));
-  v->VisitPointer(reinterpret_cast<RawObject**>(&miss_handler_function_));
-  for (intptr_t i = 0; i < length_; ++i) {
-    v->VisitPointer(reinterpret_cast<RawObject**>(&table_[i].name));
-    v->VisitPointer(reinterpret_cast<RawObject**>(&table_[i].descriptor));
-    v->VisitPointer(reinterpret_cast<RawObject**>(&table_[i].cache));
-  }
-}
-
-
-void MegamorphicCacheTable::PrintSizes() {
-  StackZone zone(Isolate::Current());
+void MegamorphicCacheTable::PrintSizes(Isolate* isolate) {
+  StackZone zone(Thread::Current());
   intptr_t size = 0;
   MegamorphicCache& cache = MegamorphicCache::Handle();
   Array& buckets = Array::Handle();
-  for (intptr_t i = 0; i < length_; ++i) {
-    cache = table_[i].cache;
+  const GrowableObjectArray& table = GrowableObjectArray::Handle(
+      isolate->object_store()->megamorphic_cache_table());
+  if (table.IsNull()) return;
+  for (intptr_t i = 0; i < table.Length(); i += kEntrySize) {
+    cache ^= table.At(i + kEntryCacheOffset);
     buckets = cache.buckets();
     size += MegamorphicCache::InstanceSize();
     size += Array::InstanceSize(buckets.Length());
   }
   OS::Print("%" Pd " megamorphic caches using %" Pd "KB.\n",
-            length_, size / 1024);
+            table.Length() / kEntrySize, size / 1024);
 }
 
 }  // namespace dart
diff --git a/runtime/vm/megamorphic_cache_table.h b/runtime/vm/megamorphic_cache_table.h
index eafb35b..c47d4d8 100644
--- a/runtime/vm/megamorphic_cache_table.h
+++ b/runtime/vm/megamorphic_cache_table.h
@@ -11,6 +11,7 @@
 
 class Array;
 class Function;
+class Isolate;
 class ObjectPointerVisitor;
 class RawArray;
 class RawFunction;
@@ -19,36 +20,24 @@
 class RawString;
 class String;
 
-class MegamorphicCacheTable {
+class MegamorphicCacheTable : public AllStatic {
  public:
-  MegamorphicCacheTable();
-  ~MegamorphicCacheTable();
+  static RawFunction* miss_handler(Isolate* isolate);
+  static void InitMissHandler(Isolate* isolate);
 
-  RawFunction* miss_handler() const { return miss_handler_function_; }
-  void InitMissHandler();
+  static RawMegamorphicCache* Lookup(Isolate* isolate,
+                                     const String& name,
+                                     const Array& descriptor);
 
-  RawMegamorphicCache* Lookup(const String& name, const Array& descriptor);
-
-  void VisitObjectPointers(ObjectPointerVisitor* visitor);
-
-  void PrintSizes();
+  static void PrintSizes(Isolate* isolate);
 
  private:
-  struct Entry {
-    RawString* name;
-    RawArray* descriptor;
-    RawMegamorphicCache* cache;
+  enum {
+    kEntryNameOffset = 0,
+    kEntryDescriptorOffset,
+    kEntryCacheOffset,
+    kEntrySize
   };
-
-  static const int kCapacityIncrement = 128;
-
-  RawFunction* miss_handler_function_;
-  RawCode* miss_handler_code_;
-  intptr_t capacity_;
-  intptr_t length_;
-  Entry* table_;
-
-  DISALLOW_COPY_AND_ASSIGN(MegamorphicCacheTable);
 };
 
 }  // namespace dart
diff --git a/runtime/vm/message.cc b/runtime/vm/message.cc
index 810a348..dc638b2 100644
--- a/runtime/vm/message.cc
+++ b/runtime/vm/message.cc
@@ -181,10 +181,9 @@
 
 
 void MessageQueue::PrintJSON(JSONStream* stream) {
-  Isolate* isolate = Isolate::Current();
   JSONArray messages(stream);
 
-  Object& msg_handler = Object::Handle(isolate);
+  Object& msg_handler = Object::Handle();
 
   MessageQueue::Iterator it(this);
   intptr_t depth = 0;
diff --git a/runtime/vm/message_handler.cc b/runtime/vm/message_handler.cc
index 6a473dd..47ab4b9 100644
--- a/runtime/vm/message_handler.cc
+++ b/runtime/vm/message_handler.cc
@@ -6,9 +6,13 @@
 
 #include "vm/dart.h"
 #include "vm/lockers.h"
+#include "vm/object.h"
+#include "vm/object_store.h"
+#include "vm/os.h"
 #include "vm/port.h"
 #include "vm/thread_interrupter.h"
 
+
 namespace dart {
 
 DECLARE_FLAG(bool, trace_isolates);
@@ -22,6 +26,7 @@
   }
 
   virtual void Run() {
+    ASSERT(handler_ != NULL);
     handler_->TaskCallback();
   }
 
@@ -32,6 +37,24 @@
 };
 
 
+// static
+const char* MessageHandler::MessageStatusString(MessageStatus status) {
+  switch (status) {
+    case kOK:
+      return "OK";
+    case kError:
+      return "Error";
+    case kRestart:
+      return "Restart";
+    case kShutdown:
+      return "Shutdown";
+    default:
+      UNREACHABLE();
+      return "Illegal";
+  }
+}
+
+
 MessageHandler::MessageHandler()
     : queue_(new MessageQueue()),
       oob_queue_(new MessageQueue()),
@@ -42,6 +65,7 @@
       pause_on_exit_(false),
       paused_on_start_(false),
       paused_on_exit_(false),
+      paused_timestamp_(-1),
       pool_(NULL),
       task_(NULL),
       start_callback_(NULL),
@@ -79,6 +103,7 @@
                          StartCallback start_callback,
                          EndCallback end_callback,
                          CallbackData data) {
+  bool task_running;
   MonitorLocker ml(&monitor_);
   if (FLAG_trace_isolates) {
     OS::Print("[+] Starting message handler:\n"
@@ -91,12 +116,14 @@
   end_callback_ = end_callback;
   callback_data_ = data;
   task_ = new MessageHandlerTask(this);
-  pool_->Run(task_);
+  task_running = pool_->Run(task_);
+  ASSERT(task_running);
 }
 
 
 void MessageHandler::PostMessage(Message* message, bool before_events) {
   Message::Priority saved_priority;
+  bool task_running = true;
   {
     MonitorLocker ml(&monitor_);
     if (FLAG_trace_isolates) {
@@ -121,11 +148,13 @@
     }
     message = NULL;  // Do not access message.  May have been deleted.
 
-    if (pool_ != NULL && task_ == NULL) {
+    if ((pool_ != NULL) && (task_ == NULL)) {
       task_ = new MessageHandlerTask(this);
-      pool_->Run(task_);
+      task_running = pool_->Run(task_);
     }
   }
+  ASSERT(task_running);
+
   // Invoke any custom message notification.
   MessageNotify(saved_priority);
 }
@@ -141,19 +170,27 @@
 }
 
 
-bool MessageHandler::HandleMessages(bool allow_normal_messages,
-                                    bool allow_multiple_normal_messages) {
+void MessageHandler::ClearOOBQueue() {
+  oob_queue_->Clear();
+}
+
+
+MessageHandler::MessageStatus MessageHandler::HandleMessages(
+    bool allow_normal_messages,
+    bool allow_multiple_normal_messages) {
+  // TODO(turnidge): Add assert that monitor_ is held here.
+
   // If isolate() returns NULL StartIsolateScope does nothing.
   StartIsolateScope start_isolate(isolate());
 
-  // ThreadInterrupter may have gone to sleep waiting while waiting for
+  // ThreadInterrupter may have gone to sleep while waiting for
   // an isolate to start handling messages.
   ThreadInterrupter::WakeUp();
 
-  // TODO(turnidge): Add assert that monitor_ is held here.
-  bool result = true;
-  Message::Priority min_priority = (allow_normal_messages && !paused()) ?
-      Message::kNormalPriority : Message::kOOBPriority;
+  MessageStatus max_status = kOK;
+  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();
@@ -170,38 +207,50 @@
     monitor_.Exit();
     Message::Priority saved_priority = message->priority();
     Dart_Port saved_dest_port = message->dest_port();
-    result = HandleMessage(message);
+    MessageStatus status = HandleMessage(message);
+    if (status > max_status) {
+      max_status = status;
+    }
     message = NULL;  // May be deleted by now.
     monitor_.Enter();
     if (FLAG_trace_isolates) {
-      OS::Print("[.] Message handled:\n"
+      OS::Print("[.] Message handled (%s):\n"
                 "\tlen:        %" Pd "\n"
                 "\thandler:    %s\n"
                 "\tport:       %" Pd64 "\n",
+                MessageStatusString(status),
                 message_len, name(), saved_dest_port);
     }
-    if (!result) {
-      // If we hit an error, we're done processing messages.
+    // If we are shutting down, do not process any more messages.
+    if (status == kShutdown) {
+      ClearOOBQueue();
       break;
     }
+
     // Some callers want to process only one normal message and then quit. At
     // the same time it is OK to process multiple OOB messages.
     if ((saved_priority == Message::kNormalPriority) &&
         !allow_multiple_normal_messages) {
-      break;
+      // We processed one normal message.  Allow no more.
+      allow_normal_messages = false;
     }
 
-    // Reevaluate the minimum allowable priority as the paused state might
-    // have changed as part of handling the message.
-    min_priority = (allow_normal_messages && !paused()) ?
-        Message::kNormalPriority : Message::kOOBPriority;
+    // Reevaluate the minimum allowable priority.  The paused state
+    // may have changed as part of handling the message.  We may also
+    // have encountered an error during message processsing.
+    //
+    // 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 = DequeueMessage(min_priority);
   }
-  return result;
+  return max_status;
 }
 
 
-bool MessageHandler::HandleNextMessage() {
+MessageHandler::MessageStatus MessageHandler::HandleNextMessage() {
   // We can only call HandleNextMessage when this handler is not
   // assigned to a thread pool.
   MonitorLocker ml(&monitor_);
@@ -213,9 +262,9 @@
 }
 
 
-bool MessageHandler::HandleOOBMessages() {
+MessageHandler::MessageStatus MessageHandler::HandleOOBMessages() {
   if (!oob_message_handling_allowed_) {
-    return true;
+    return kOK;
   }
   MonitorLocker ml(&monitor_);
 #if defined(DEBUG)
@@ -231,68 +280,123 @@
 }
 
 
+static bool ShouldPause(MessageHandler::MessageStatus status) {
+  // If we are restarting or shutting down, we do not want to honor
+  // pause_on_start or pause_on_exit.
+  return (status != MessageHandler::kRestart &&
+          status != MessageHandler::kShutdown);
+}
+
+
 void MessageHandler::TaskCallback() {
   ASSERT(Isolate::Current() == NULL);
-  bool ok = true;
+  MessageStatus status = kOK;
   bool run_end_callback = false;
   {
+    // We will occasionally release and reacquire this monitor in this
+    // function. Whenever we reacquire the monitor we *must* process
+    // all pending OOB messages, or we may miss a request for vm
+    // shutdown.
     MonitorLocker ml(&monitor_);
-    // Initialize the message handler by running its start function,
-    // if we have one.  For an isolate, this will run the isolate's
-    // main() function.
     if (pause_on_start()) {
       if (!paused_on_start_) {
-        NotifyPauseOnStart();
+        // Temporarily release the monitor when calling out to
+        // NotifyPauseOnStart.  This avoids a dead lock that can occur
+        // when this message handler tries to post a message while a
+        // message is being posted to it.
         paused_on_start_ = true;
+        paused_timestamp_ = OS::GetCurrentTimeMillis();
+        monitor_.Exit();
+        NotifyPauseOnStart();
+        monitor_.Enter();
       }
-      HandleMessages(false, false);
-      if (pause_on_start()) {
+      // More messages may have come in before we (re)acquired the monitor.
+      status = HandleMessages(false, false);
+      if (ShouldPause(status) && pause_on_start()) {
         // Still paused.
+        ASSERT(oob_queue_->IsEmpty());
         task_ = NULL;  // No task in queue.
         return;
       } else {
         paused_on_start_ = false;
+        paused_timestamp_ = -1;
       }
     }
 
-    if (start_callback_) {
-      // Release the monitor_ temporarily while we call the start callback.
-      // The monitor was acquired with the MonitorLocker above.
-      monitor_.Exit();
-      ok = start_callback_(callback_data_);
-      ASSERT(Isolate::Current() == NULL);
-      start_callback_ = NULL;
-      monitor_.Enter();
+    if (status == kOK) {
+      if (start_callback_) {
+        // Initialize the message handler by running its start function,
+        // if we have one.  For an isolate, this will run the isolate's
+        // main() function.
+        //
+        // Release the monitor_ temporarily while we call the start callback.
+        monitor_.Exit();
+        status = start_callback_(callback_data_);
+        ASSERT(Isolate::Current() == NULL);
+        start_callback_ = NULL;
+        monitor_.Enter();
+      }
+
+      // Handle any pending messages for this message handler.
+      if (status != kShutdown) {
+        status = HandleMessages((status == kOK), true);
+      }
     }
 
-    // Handle any pending messages for this message handler.
-    if (ok) {
-      ok = HandleMessages(true, true);
-    }
-    task_ = NULL;  // No task in queue.
-
-    if (!ok || !HasLivePorts()) {
-      if (pause_on_exit()) {
+    // The isolate exits when it encounters an error or when it no
+    // longer has live ports.
+    if (status != kOK || !HasLivePorts()) {
+      if (ShouldPause(status) && pause_on_exit()) {
         if (!paused_on_exit_) {
           if (FLAG_trace_service_pause_events) {
             OS::PrintErr("Isolate %s paused before exiting. "
-                       "Use the Observatory to release it.\n", name());
+                         "Use the Observatory to release it.\n", name());
           }
-          NotifyPauseOnExit();
+          // Temporarily release the monitor when calling out to
+          // NotifyPauseOnExit.  This avoids a dead lock that can
+          // occur when this message handler tries to post a message
+          // while a message is being posted to it.
           paused_on_exit_ = true;
+          paused_timestamp_ = OS::GetCurrentTimeMillis();
+          monitor_.Exit();
+          NotifyPauseOnExit();
+          monitor_.Enter();
+
+          // More messages may have come in while we released the monitor.
+          HandleMessages(false, false);
         }
-      } else {
-        if (FLAG_trace_isolates) {
-        OS::Print("[-] Stopping message handler (%s):\n"
-                  "\thandler:    %s\n",
-                  (ok ? "no live ports" : "error"),
-                  name());
+        if (ShouldPause(status) && pause_on_exit()) {
+          // Still paused.
+          ASSERT(oob_queue_->IsEmpty());
+          task_ = NULL;  // No task in queue.
+          return;
+        } else {
+          paused_on_exit_ = false;
+          paused_timestamp_ = -1;
         }
-        pool_ = NULL;
-        run_end_callback = true;
-        paused_on_exit_ = false;
       }
+      if (FLAG_trace_isolates) {
+        if (status != kOK && isolate() != NULL) {
+          const Error& error =
+              Error::Handle(isolate()->object_store()->sticky_error());
+          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());
+        }
+      }
+      pool_ = NULL;
+      run_end_callback = true;
     }
+
+    // Clear the task_ last.  This allows other tasks to potentially start
+    // for this message handler.
+    ASSERT(oob_queue_->IsEmpty());
+    task_ = NULL;
   }
   if (run_end_callback && end_callback_ != NULL) {
     end_callback_(callback_data_);
diff --git a/runtime/vm/message_handler.h b/runtime/vm/message_handler.h
index 07fa5ab..f4d907c 100644
--- a/runtime/vm/message_handler.h
+++ b/runtime/vm/message_handler.h
@@ -18,13 +18,21 @@
   MessageHandler();
 
  public:
+  enum MessageStatus {
+    kOK,        // We successfully handled a message.
+    kError,     // We encountered an error handling a message.
+    kRestart,   // The VM is restarting.
+    kShutdown,  // The VM is shutting down.
+  };
+  static const char* MessageStatusString(MessageStatus status);
+
   virtual ~MessageHandler();
 
   // Allow subclasses to provide a handler name.
   virtual const char* name() const;
 
   typedef uword CallbackData;
-  typedef bool (*StartCallback)(CallbackData data);
+  typedef MessageStatus (*StartCallback)(CallbackData data);
   typedef void (*EndCallback)(CallbackData data);
 
   // Runs this message handler on the thread pool.
@@ -46,13 +54,13 @@
   // or RunBlocking).
   //
   // Returns true on success.
-  bool HandleNextMessage();
+  MessageStatus HandleNextMessage();
 
   // Handles any OOB messages for this message handler.  Can be used
   // even if the message handler is running on the thread pool.
   //
   // Returns true on success.
-  bool HandleOOBMessages();
+  MessageStatus HandleOOBMessages();
 
   // Returns true if there are pending OOB messages for this message
   // handler.
@@ -96,6 +104,11 @@
     return paused_on_exit_;
   }
 
+  // Timestamp of the paused on start or paused on exit.
+  int64_t paused_timestamp() const {
+    return paused_timestamp_;
+  }
+
   class AcquiredQueues : public ValueObject {
    public:
     AcquiredQueues();
@@ -174,11 +187,14 @@
   // Handles a single message.  Provided by subclass.
   //
   // Returns true on success.
-  virtual bool HandleMessage(Message* message) = 0;
+  virtual MessageStatus HandleMessage(Message* message) = 0;
 
   virtual void NotifyPauseOnStart() {}
   virtual void NotifyPauseOnExit() {}
 
+  // TODO(iposva): Set a local field before entering MessageHandler methods.
+  Thread* thread() const { return Thread::Current(); }
+
  private:
   friend class PortMap;
   friend class MessageHandlerTestPeer;
@@ -191,9 +207,11 @@
   // messages from the queue_.
   Message* DequeueMessage(Message::Priority min_priority);
 
+  void ClearOOBQueue();
+
   // Handles any pending messages.
-  bool HandleMessages(bool allow_normal_messages,
-                      bool allow_multiple_normal_messages);
+  MessageStatus HandleMessages(bool allow_normal_messages,
+                               bool allow_multiple_normal_messages);
 
   Monitor monitor_;  // Protects all fields in MessageHandler.
   MessageQueue* queue_;
@@ -207,6 +225,7 @@
   bool pause_on_exit_;
   bool paused_on_start_;
   bool paused_on_exit_;
+  int64_t paused_timestamp_;
   ThreadPool* pool_;
   ThreadPool::Task* task_;
   StartCallback start_callback_;
diff --git a/runtime/vm/message_handler_test.cc b/runtime/vm/message_handler_test.cc
index 7bfcb9a..ae7edab 100644
--- a/runtime/vm/message_handler_test.cc
+++ b/runtime/vm/message_handler_test.cc
@@ -39,7 +39,7 @@
         message_count_(0),
         start_called_(false),
         end_called_(false),
-        result_(true) {
+        results_(NULL) {
   }
 
   ~TestMessageHandler() {
@@ -50,18 +50,23 @@
     notify_count_++;
   }
 
-  bool HandleMessage(Message* message) {
+  MessageStatus HandleMessage(Message* message) {
     // For testing purposes, keep a list of the ports
     // for all messages we receive.
     AddPortToBuffer(message->dest_port());
     delete message;
     message_count_++;
-    return result_;
+    MessageStatus status = kOK;
+    if (results_ != NULL) {
+      status = results_[0];
+      results_++;
+    }
+    return status;
   }
 
-  bool Start() {
+  MessageStatus Start() {
     start_called_ = true;
-    return true;
+    return kOK;
   }
 
   void End() {
@@ -75,7 +80,7 @@
   bool start_called() const { return start_called_; }
   bool end_called() const { return end_called_; }
 
-  void set_result(bool result) { result_ = result; }
+  void set_results(MessageStatus* results) { results_ = results; }
 
  private:
   void AddPortToBuffer(Dart_Port port) {
@@ -101,13 +106,13 @@
   int message_count_;
   bool start_called_;
   bool end_called_;
-  bool result_;
+  MessageStatus* results_;
 
   DISALLOW_COPY_AND_ASSIGN(TestMessageHandler);
 };
 
 
-bool TestStartFunction(uword data) {
+MessageHandler::MessageStatus TestStartFunction(uword data) {
   return (reinterpret_cast<TestMessageHandler*>(data))->Start();
 }
 
@@ -232,7 +237,7 @@
   handler_peer.PostMessage(oob_message2);
 
   // We handle both oob messages and a single normal message.
-  EXPECT(handler.HandleNextMessage());
+  EXPECT_EQ(MessageHandler::kOK, handler.HandleNextMessage());
   EXPECT_EQ(3, handler.message_count());
   Dart_Port* ports = handler.port_buffer();
   EXPECT_EQ(port2, ports[0]);
@@ -242,6 +247,75 @@
 }
 
 
+UNIT_TEST_CASE(MessageHandler_HandleNextMessage_ProcessOOBAfterError) {
+  TestMessageHandler handler;
+  MessageHandler::MessageStatus results[] = {
+    MessageHandler::kError,     // oob_message1
+    MessageHandler::kOK,        // oob_message2
+    MessageHandler::kOK,        // unused
+  };
+  handler.set_results(results);
+  MessageHandlerTestPeer handler_peer(&handler);
+  Dart_Port port1 = PortMap::CreatePort(&handler);
+  Dart_Port port2 = PortMap::CreatePort(&handler);
+  Dart_Port port3 = PortMap::CreatePort(&handler);
+  Message* message1 = new Message(port1, NULL, 0, Message::kNormalPriority);
+  handler_peer.PostMessage(message1);
+  Message* oob_message1 = new Message(port2, NULL, 0, Message::kOOBPriority);
+  handler_peer.PostMessage(oob_message1);
+  Message* oob_message2 = new Message(port3, NULL, 0, Message::kOOBPriority);
+  handler_peer.PostMessage(oob_message2);
+
+  // When we get an error, we continue processing oob messages but
+  // stop handling normal messages.
+  EXPECT_EQ(MessageHandler::kError, handler.HandleNextMessage());
+  EXPECT_EQ(2, handler.message_count());
+  Dart_Port* ports = handler.port_buffer();
+  EXPECT_EQ(port2, ports[0]);  // oob_message1, error
+  EXPECT_EQ(port3, ports[1]);  // oob_message2, ok
+  handler_peer.CloseAllPorts();
+}
+
+
+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
+  };
+  handler.set_results(results);
+  MessageHandlerTestPeer handler_peer(&handler);
+  Dart_Port port1 = PortMap::CreatePort(&handler);
+  Dart_Port port2 = PortMap::CreatePort(&handler);
+  Dart_Port port3 = PortMap::CreatePort(&handler);
+  Dart_Port port4 = PortMap::CreatePort(&handler);
+  Message* message1 = new Message(port1, NULL, 0, Message::kNormalPriority);
+  handler_peer.PostMessage(message1);
+  Message* oob_message1 = new Message(port2, NULL, 0, Message::kOOBPriority);
+  handler_peer.PostMessage(oob_message1);
+  Message* oob_message2 = new Message(port3, NULL, 0, Message::kOOBPriority);
+  handler_peer.PostMessage(oob_message2);
+  Message* oob_message3 = new Message(port4, NULL, 0, Message::kOOBPriority);
+  handler_peer.PostMessage(oob_message3);
+
+  // When we get a shutdown message, we stop processing all messages.
+  EXPECT_EQ(MessageHandler::kShutdown, handler.HandleNextMessage());
+  EXPECT_EQ(2, handler.message_count());
+  Dart_Port* ports = handler.port_buffer();
+  EXPECT_EQ(port2, ports[0]);  // oob_message1, ok
+  EXPECT_EQ(port3, ports[1]);  // oob_message2, shutdown
+  {
+    // The oob queue has been cleared.  oob_message3 is gone.
+    MessageHandler::AcquiredQueues aq;
+    handler.AcquireQueues(&aq);
+    EXPECT(aq.oob_queue()->Length() == 0);
+  }
+  handler_peer.CloseAllPorts();
+}
+
+
 UNIT_TEST_CASE(MessageHandler_HandleOOBMessages) {
   TestMessageHandler handler;
   MessageHandlerTestPeer handler_peer(&handler);
@@ -259,7 +333,7 @@
   handler_peer.PostMessage(oob_message2);
 
   // We handle both oob messages but no normal messages.
-  EXPECT(handler.HandleOOBMessages());
+  EXPECT_EQ(MessageHandler::kOK, handler.HandleOOBMessages());
   EXPECT_EQ(2, handler.message_count());
   Dart_Port* ports = handler.port_buffer();
   EXPECT_EQ(port3, ports[0]);
diff --git a/runtime/vm/method_recognizer.cc b/runtime/vm/method_recognizer.cc
index d0b941e..45a6f59 100644
--- a/runtime/vm/method_recognizer.cc
+++ b/runtime/vm/method_recognizer.cc
@@ -28,7 +28,8 @@
 #define KIND_TO_STRING(class_name, function_name, enum_name, fp)               \
   #enum_name,
 static const char* recognized_list_method_name[] = {
-RECOGNIZED_LIST(KIND_TO_STRING)
+  "Unknown",
+  RECOGNIZED_LIST(KIND_TO_STRING)
 };
 #undef KIND_TO_STRING
 
diff --git a/runtime/vm/method_recognizer.h b/runtime/vm/method_recognizer.h
index eb752f9..5e8e576 100644
--- a/runtime/vm/method_recognizer.h
+++ b/runtime/vm/method_recognizer.h
@@ -64,10 +64,6 @@
   V(Float32x4, Float32x4.fromFloat64x2, Float32x4FromFloat64x2, 1327692716)    \
   V(_Float32x4, shuffle, Float32x4Shuffle, 1636488139)                         \
   V(_Float32x4, shuffleMix, Float32x4ShuffleMix, 654814229)                    \
-  V(_Float32x4, get:x, Float32x4ShuffleX, 384969722)                           \
-  V(_Float32x4, get:y, Float32x4ShuffleY, 1398121942)                          \
-  V(_Float32x4, get:z, Float32x4ShuffleZ, 1178175605)                          \
-  V(_Float32x4, get:w, Float32x4ShuffleW, 480951003)                           \
   V(_Float32x4, get:signMask, Float32x4GetSignMask, 630880675)                 \
   V(_Float32x4, _cmpequal, Float32x4Equal, 571062952)                          \
   V(_Float32x4, _cmpgt, Float32x4GreaterThan, 1613543295)                      \
@@ -134,8 +130,6 @@
   V(_Uint16Array, []=, Uint16ArraySetIndexed, 1594961463)                      \
   V(_Int32Array, [], Int32ArrayGetIndexed, 2052925823)                         \
   V(_Int32Array, []=, Int32ArraySetIndexed, 504626978)                         \
-  V(_Uint32Array, [], Uint32ArrayGetIndexed, 1034114777)                       \
-  V(_Uint32Array, []=, Uint32ArraySetIndexed, 918159348)                       \
   V(_Int64Array, [], Int64ArrayGetIndexed, 297668331)                          \
   V(_Int64Array, []=, Int64ArraySetIndexed, 36465128)                          \
   V(_Float32x4Array, [], Float32x4ArrayGetIndexed, 35821240)                   \
@@ -282,9 +276,18 @@
   V(_Uint8Array, []=, Uint8ArraySetIndexed, 447309008)                         \
   V(_ExternalUint8Array, [], ExternalUint8ArrayGetIndexed, 1293647140)         \
   V(_ExternalUint8Array, []=, ExternalUint8ArraySetIndexed, 1593599192)        \
+  V(_Uint32Array, [], Uint32ArrayGetIndexed, 1034114777)                       \
+  V(_Uint32Array, []=, Uint32ArraySetIndexed, 918159348)                       \
   V(_Float64Array, []=, Float64ArraySetIndexed, 887301703)                     \
   V(_Float64Array, [], Float64ArrayGetIndexed, 1959896670)                     \
   V(_TypedList, get:length, TypedDataLength, 522684521)                        \
+  V(_Float32x4, get:x, Float32x4ShuffleX, 384969722)                           \
+  V(_Float32x4, get:y, Float32x4ShuffleY, 1398121942)                          \
+  V(_Float32x4, get:z, Float32x4ShuffleZ, 1178175605)                          \
+  V(_Float32x4, get:w, Float32x4ShuffleW, 480951003)                           \
+  V(_Float32x4, _mul, Float32x4Mul, 1703784673)                                \
+  V(_Float32x4, _sub, Float32x4Sub, 1302598822)                                \
+  V(_Float32x4, _add, Float32x4Add, 182344215)                                 \
 
 #define GRAPH_CORE_INTRINSICS_LIST(V)                                          \
   V(_List, get:length, ObjectArrayLength, 1181471893)                          \
diff --git a/runtime/vm/metrics.cc b/runtime/vm/metrics.cc
index 0e04e6b..0e15c0f 100644
--- a/runtime/vm/metrics.cc
+++ b/runtime/vm/metrics.cc
@@ -9,9 +9,13 @@
 #include "vm/native_entry.h"
 #include "vm/runtime_entry.h"
 #include "vm/object.h"
+#include "vm/log.h"
 
 namespace dart {
 
+DEFINE_FLAG(bool, print_metrics, false,
+            "Print metrics when isolates (and the VM) are shutdown.");
+
 Metric* Metric::vm_list_head_ = NULL;
 
 Metric::Metric()
@@ -92,6 +96,48 @@
 }
 
 
+char* Metric::ValueToString(int64_t value, Unit unit) {
+  Thread* thread = Thread::Current();
+  ASSERT(thread != NULL);
+  Zone* zone = thread->zone();
+  ASSERT(zone != NULL);
+  switch (unit) {
+    case kCounter:
+      return zone->PrintToString("%" Pd64 "", value);
+    case kByte: {
+      const char* scaled_suffix = "b";
+      double scaled_value = static_cast<double>(value);
+      if (value > KB) {
+        scaled_suffix = "kb";
+        scaled_value /= KB;
+      } else if (value > MB) {
+        scaled_suffix = "mb";
+        scaled_value /= MB;
+      } else if (value > GB) {
+        scaled_suffix = "gb";
+        scaled_value /= GB;
+      }
+      return zone->PrintToString("%.3f %s (%" Pd64 ")",
+                                 scaled_value,
+                                 scaled_suffix,
+                                 value);
+    }
+    default:
+      UNREACHABLE();
+      return NULL;
+  }
+}
+
+
+char* Metric::ToString() {
+  Thread* thread = Thread::Current();
+  ASSERT(thread != NULL);
+  Zone* zone = thread->zone();
+  ASSERT(zone != NULL);
+  return zone->PrintToString("%s %s", name(), ValueToString(value(), unit()));
+}
+
+
 bool Metric::NameExists(Metric* head, const char* name) {
   ASSERT(name != NULL);
   while (head != NULL) {
@@ -230,6 +276,12 @@
 }
 
 
+int64_t MetricHeapUsed::Value() const {
+  ASSERT(isolate() == Isolate::Current());
+  return isolate()->heap()->UsedInWords(Heap::kNew) * kWordSize +
+         isolate()->heap()->UsedInWords(Heap::kOld) * kWordSize;
+}
+
 int64_t MetricIsolateCount::Value() const {
   return Isolate::IsolateListLength();
 }
@@ -247,4 +299,44 @@
 #undef VM_METRIC_INIT
 }
 
+void Metric::Cleanup() {
+  if (FLAG_print_metrics) {
+    // Create a zone to allocate temporary strings in.
+    StackZone sz(Thread::Current());
+    OS::Print("Printing metrics for VM\n");
+    Metric* current = Metric::vm_head();
+    while (current != NULL) {
+      OS::Print("%s\n", current->ToString());
+      current = current->next();
+    }
+    OS::Print("\n");
+  }
+}
+
+
+MaxMetric::MaxMetric()
+    : Metric() {
+  set_value(kMinInt64);
+}
+
+
+void MaxMetric::SetValue(int64_t new_value) {
+  if (new_value > value()) {
+    set_value(new_value);
+  }
+}
+
+
+MinMetric::MinMetric()
+    : Metric() {
+  set_value(kMaxInt64);
+}
+
+
+void MinMetric::SetValue(int64_t new_value) {
+  if (new_value < value()) {
+    set_value(new_value);
+  }
+}
+
 }  // namespace dart
diff --git a/runtime/vm/metrics.h b/runtime/vm/metrics.h
index ab58881..9fde2d8 100644
--- a/runtime/vm/metrics.h
+++ b/runtime/vm/metrics.h
@@ -15,14 +15,20 @@
 // Metrics for each isolate.
 #define ISOLATE_METRIC_LIST(V)                                                 \
   V(MetricHeapOldUsed, HeapOldUsed, "heap.old.used", kByte)                    \
+  V(MaxMetric, HeapOldUsedMax, "heap.old.used.max", kByte)                     \
   V(MetricHeapOldCapacity, HeapOldCapacity, "heap.old.capacity", kByte)        \
+  V(MaxMetric, HeapOldCapacityMax, "heap.old.capacity.max", kByte)             \
   V(MetricHeapOldExternal, HeapOldExternal, "heap.old.external", kByte)        \
   V(MetricHeapNewUsed, HeapNewUsed, "heap.new.used", kByte)                    \
+  V(MaxMetric, HeapNewUsedMax, "heap.new.used.max", kByte)                     \
   V(MetricHeapNewCapacity, HeapNewCapacity, "heap.new.capacity", kByte)        \
+  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)               \
 
 #define VM_METRIC_LIST(V)                                                      \
-  V(MetricIsolateCount, IsolateCount, "vm.isolate.count", kCounter)            \
+  V(MetricIsolateCount, IsolateCount, "vm.isolate.count", kCounter)
 
 class Metric {
  public:
@@ -35,6 +41,8 @@
 
   static void InitOnce();
 
+  static void Cleanup();
+
   // Initialize and register a metric for an isolate.
   void Init(Isolate* isolate,
             const char* name,
@@ -50,6 +58,12 @@
 
   void PrintJSON(JSONStream* stream);
 
+  // Returns a zone allocated string.
+  static char* ValueToString(int64_t value, Unit unit);
+
+  // Returns a zone allocated string.
+  char* ToString();
+
   int64_t value() const { return value_; }
   void set_value(int64_t value) { value_ = value; }
 
@@ -94,6 +108,26 @@
 };
 
 
+// A Metric class that reports the maximum value observed.
+// Initial maximum is kMinInt64.
+class MaxMetric : public Metric {
+ public:
+  MaxMetric();
+
+  void SetValue(int64_t new_value);
+};
+
+
+// A Metric class that reports the minimum value observed.
+// Initial minimum is kMaxInt64.
+class MinMetric : public Metric {
+ public:
+  MinMetric();
+
+  void SetValue(int64_t new_value);
+};
+
+
 class MetricHeapOldUsed : public Metric {
  protected:
   virtual int64_t Value() const;
@@ -136,6 +170,11 @@
 };
 
 
+class MetricHeapUsed : public Metric {
+ protected:
+  virtual int64_t Value() const;
+};
+
 }  // namespace dart
 
 #endif  // VM_METRICS_H_
diff --git a/runtime/vm/metrics_test.cc b/runtime/vm/metrics_test.cc
index 9082739..cb204b9 100644
--- a/runtime/vm/metrics_test.cc
+++ b/runtime/vm/metrics_test.cc
@@ -46,9 +46,9 @@
   Dart_CreateIsolate(
       NULL, NULL, bin::isolate_snapshot_buffer, NULL, NULL, NULL);
   {
-    Isolate* isolate = Isolate::Current();
-    StackZone zone(isolate);
-    HANDLESCOPE(isolate);
+    Thread* thread = Thread::Current();
+    StackZone zone(thread);
+    HANDLESCOPE(thread);
     MyMetric metric;
 
     metric.Init(Isolate::Current(), "a.b.c", "foobar", Metric::kByte);
diff --git a/runtime/vm/mirrors_api_impl.cc b/runtime/vm/mirrors_api_impl.cc
index d775e22..13b896c 100644
--- a/runtime/vm/mirrors_api_impl.cc
+++ b/runtime/vm/mirrors_api_impl.cc
@@ -19,37 +19,38 @@
 
 namespace dart {
 
+// Facilitate quick access to the current zone once we have the curren thread.
+#define Z (T->zone())
+
 
 // --- Classes and Interfaces Reflection ---
 
 DART_EXPORT Dart_Handle Dart_TypeName(Dart_Handle object) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  const Object& obj = Object::Handle(isolate, Api::UnwrapHandle(object));
+  DARTSCOPE(Thread::Current());
+  const Object& obj = Object::Handle(Z, Api::UnwrapHandle(object));
   if (obj.IsType()) {
     const Class& cls = Class::Handle(Type::Cast(obj).type_class());
-    return Api::NewHandle(isolate, cls.UserVisibleName());
+    return Api::NewHandle(I, cls.UserVisibleName());
   } else {
-    RETURN_TYPE_ERROR(isolate, object, Class/Type);
+    RETURN_TYPE_ERROR(Z, object, Class/Type);
   }
 }
 
 
 DART_EXPORT Dart_Handle Dart_QualifiedTypeName(Dart_Handle object) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  const Object& obj = Object::Handle(isolate, Api::UnwrapHandle(object));
+  DARTSCOPE(Thread::Current());
+  const Object& obj = Object::Handle(Z, Api::UnwrapHandle(object));
   if (obj.IsType() || obj.IsClass()) {
     const Class& cls = (obj.IsType()) ?
-        Class::Handle(Type::Cast(obj).type_class()) : Class::Cast(obj);
+        Class::Handle(Z, Type::Cast(obj).type_class()) : Class::Cast(obj);
     const char* str = cls.ToCString();
     if (str == NULL) {
       RETURN_NULL_ERROR(str);
     }
-    CHECK_CALLBACK_STATE(isolate);
-    return Api::NewHandle(isolate, String::New(str));
+    CHECK_CALLBACK_STATE(T);
+    return Api::NewHandle(I, String::New(str));
   } else {
-    RETURN_TYPE_ERROR(isolate, object, Class/Type);
+    RETURN_TYPE_ERROR(Z, object, Class/Type);
   }
 }
 
@@ -69,25 +70,24 @@
 
 
 DART_EXPORT Dart_Handle Dart_GetFunctionNames(Dart_Handle target) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  const Object& obj = Object::Handle(isolate, Api::UnwrapHandle(target));
+  DARTSCOPE(Thread::Current());
+  const Object& obj = Object::Handle(Z, Api::UnwrapHandle(target));
   if (obj.IsError()) {
     return target;
   }
 
   const GrowableObjectArray& names =
-      GrowableObjectArray::Handle(isolate, GrowableObjectArray::New());
-  Function& func = Function::Handle();
-  String& name = String::Handle();
+      GrowableObjectArray::Handle(Z, GrowableObjectArray::New());
+  Function& func = Function::Handle(Z);
+  String& name = String::Handle(Z);
 
   if (obj.IsType()) {
-    const Class& cls = Class::Handle(Type::Cast(obj).type_class());
-    const Error& error = Error::Handle(isolate, cls.EnsureIsFinalized(isolate));
+    const Class& cls = Class::Handle(Z, Type::Cast(obj).type_class());
+    const Error& error = Error::Handle(Z, cls.EnsureIsFinalized(T));
     if (!error.IsNull()) {
-      return Api::NewHandle(isolate, error.raw());
+      return Api::NewHandle(I, error.raw());
     }
-    const Array& func_array = Array::Handle(cls.functions());
+    const Array& func_array = Array::Handle(Z, cls.functions());
 
     // Some special types like 'dynamic' have a null functions list.
     if (!func_array.IsNull()) {
@@ -124,27 +124,26 @@
         "%s expects argument 'target' to be a class or library.",
         CURRENT_FUNC);
   }
-  return Api::NewHandle(isolate, Array::MakeArray(names));
+  return Api::NewHandle(I, Array::MakeArray(names));
 }
 
 
 DART_EXPORT Dart_Handle Dart_LookupFunction(Dart_Handle target,
                                             Dart_Handle function_name) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  const Object& obj = Object::Handle(isolate, Api::UnwrapHandle(target));
+  DARTSCOPE(Thread::Current());
+  const Object& obj = Object::Handle(Z, Api::UnwrapHandle(target));
   if (obj.IsError()) {
     return target;
   }
-  const String& func_name = Api::UnwrapStringHandle(isolate, function_name);
+  const String& func_name = Api::UnwrapStringHandle(Z, function_name);
   if (func_name.IsNull()) {
-    RETURN_TYPE_ERROR(isolate, function_name, String);
+    RETURN_TYPE_ERROR(Z, function_name, String);
   }
 
-  Function& func = Function::Handle(isolate);
-  String& tmp_name = String::Handle(isolate);
+  Function& func = Function::Handle(Z);
+  String& tmp_name = String::Handle(Z);
   if (obj.IsType()) {
-    const Class& cls = Class::Handle(Type::Cast(obj).type_class());
+    const Class& cls = Class::Handle(Z, Type::Cast(obj).type_class());
 
     // Case 1.  Lookup the unmodified function name.
     func = cls.LookupFunctionAllowPrivate(func_name);
@@ -206,60 +205,57 @@
            func_kind == RawFunction::kConstructor);
   }
 #endif
-  return Api::NewHandle(isolate, func.raw());
+  return Api::NewHandle(I, func.raw());
 }
 
 
 DART_EXPORT Dart_Handle Dart_FunctionName(Dart_Handle function) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  const Function& func = Api::UnwrapFunctionHandle(isolate, function);
+  DARTSCOPE(Thread::Current());
+  const Function& func = Api::UnwrapFunctionHandle(Z, function);
   if (func.IsNull()) {
-    RETURN_TYPE_ERROR(isolate, function, Function);
+    RETURN_TYPE_ERROR(Z, function, Function);
   }
-  return Api::NewHandle(isolate, func.UserVisibleName());
+  return Api::NewHandle(I, func.UserVisibleName());
 }
 
 
 DART_EXPORT Dart_Handle Dart_FunctionOwner(Dart_Handle function) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  const Function& func = Api::UnwrapFunctionHandle(isolate, function);
+  DARTSCOPE(Thread::Current());
+  const Function& func = Api::UnwrapFunctionHandle(Z, function);
   if (func.IsNull()) {
-    RETURN_TYPE_ERROR(isolate, function, Function);
+    RETURN_TYPE_ERROR(Z, function, Function);
   }
   if (func.IsNonImplicitClosureFunction()) {
     RawFunction* parent_function = func.parent_function();
-    return Api::NewHandle(isolate, parent_function);
+    return Api::NewHandle(I, parent_function);
   }
-  const Class& owner = Class::Handle(func.Owner());
+  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.
 #if defined(DEBUG)
-    const Library& lib = Library::Handle(owner.library());
+    const Library& lib = Library::Handle(Z, owner.library());
     if (lib.IsNull()) {
       ASSERT(owner.IsDynamicClass() || owner.IsVoidClass());
     }
 #endif
-    return Api::NewHandle(isolate, owner.library());
+    return Api::NewHandle(I, owner.library());
   } else {
-    return Api::NewHandle(isolate, owner.RareType());
+    return Api::NewHandle(I, owner.RareType());
   }
 }
 
 
 DART_EXPORT Dart_Handle Dart_FunctionIsStatic(Dart_Handle function,
                                               bool* is_static) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
+  DARTSCOPE(Thread::Current());
   if (is_static == NULL) {
     RETURN_NULL_ERROR(is_static);
   }
-  const Function& func = Api::UnwrapFunctionHandle(isolate, function);
+  const Function& func = Api::UnwrapFunctionHandle(Z, function);
   if (func.IsNull()) {
-    RETURN_TYPE_ERROR(isolate, function, Function);
+    RETURN_TYPE_ERROR(Z, function, Function);
   }
   *is_static = func.is_static();
   return Api::Success();
@@ -268,14 +264,13 @@
 
 DART_EXPORT Dart_Handle Dart_FunctionIsConstructor(Dart_Handle function,
                                                    bool* is_constructor) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
+  DARTSCOPE(Thread::Current());
   if (is_constructor == NULL) {
     RETURN_NULL_ERROR(is_constructor);
   }
-  const Function& func = Api::UnwrapFunctionHandle(isolate, function);
+  const Function& func = Api::UnwrapFunctionHandle(Z, function);
   if (func.IsNull()) {
-    RETURN_TYPE_ERROR(isolate, function, Function);
+    RETURN_TYPE_ERROR(Z, function, Function);
   }
   *is_constructor = func.kind() == RawFunction::kConstructor;
   return Api::Success();
@@ -284,14 +279,13 @@
 
 DART_EXPORT Dart_Handle Dart_FunctionIsGetter(Dart_Handle function,
                                               bool* is_getter) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
+  DARTSCOPE(Thread::Current());
   if (is_getter == NULL) {
     RETURN_NULL_ERROR(is_getter);
   }
-  const Function& func = Api::UnwrapFunctionHandle(isolate, function);
+  const Function& func = Api::UnwrapFunctionHandle(Z, function);
   if (func.IsNull()) {
-    RETURN_TYPE_ERROR(isolate, function, Function);
+    RETURN_TYPE_ERROR(Z, function, Function);
   }
   *is_getter = func.IsGetterFunction();
   return Api::Success();
@@ -300,14 +294,13 @@
 
 DART_EXPORT Dart_Handle Dart_FunctionIsSetter(Dart_Handle function,
                                               bool* is_setter) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
+  DARTSCOPE(Thread::Current());
   if (is_setter == NULL) {
     RETURN_NULL_ERROR(is_setter);
   }
-  const Function& func = Api::UnwrapFunctionHandle(isolate, function);
+  const Function& func = Api::UnwrapFunctionHandle(Z, function);
   if (func.IsNull()) {
-    RETURN_TYPE_ERROR(isolate, function, Function);
+    RETURN_TYPE_ERROR(Z, function, Function);
   }
   *is_setter = (func.kind() == RawFunction::kSetterFunction);
   return Api::Success();
@@ -317,30 +310,28 @@
 // --- Libraries Reflection ---
 
 DART_EXPORT Dart_Handle Dart_LibraryName(Dart_Handle library) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  const Library& lib = Api::UnwrapLibraryHandle(isolate, library);
+  DARTSCOPE(Thread::Current());
+  const Library& lib = Api::UnwrapLibraryHandle(Z, library);
   if (lib.IsNull()) {
-    RETURN_TYPE_ERROR(isolate, library, Library);
+    RETURN_TYPE_ERROR(Z, library, Library);
   }
-  const String& name = String::Handle(isolate, lib.name());
+  const String& name = String::Handle(Z, lib.name());
   ASSERT(!name.IsNull());
-  return Api::NewHandle(isolate, name.raw());
+  return Api::NewHandle(I, name.raw());
 }
 
 DART_EXPORT Dart_Handle Dart_LibraryGetClassNames(Dart_Handle library) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  const Library& lib = Api::UnwrapLibraryHandle(isolate, library);
+  DARTSCOPE(Thread::Current());
+  const Library& lib = Api::UnwrapLibraryHandle(Z, library);
   if (lib.IsNull()) {
-    RETURN_TYPE_ERROR(isolate, library, Library);
+    RETURN_TYPE_ERROR(Z, library, Library);
   }
 
   const GrowableObjectArray& names =
-      GrowableObjectArray::Handle(isolate, GrowableObjectArray::New());
+      GrowableObjectArray::Handle(Z, GrowableObjectArray::New());
   ClassDictionaryIterator it(lib);
-  Class& cls = Class::Handle();
-  String& name = String::Handle();
+  Class& cls = Class::Handle(Z);
+  String& name = String::Handle(Z);
   while (it.HasNext()) {
     cls = it.GetNextClass();
     if (cls.IsSignatureClass()) {
@@ -356,24 +347,23 @@
       names.Add(name);
     }
   }
-  return Api::NewHandle(isolate, Array::MakeArray(names));
+  return Api::NewHandle(I, Array::MakeArray(names));
 }
 
 
 // --- Closures Reflection ---
 
 DART_EXPORT Dart_Handle Dart_ClosureFunction(Dart_Handle closure) {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  const Instance& closure_obj = Api::UnwrapInstanceHandle(isolate, closure);
+  DARTSCOPE(Thread::Current());
+  const Instance& closure_obj = Api::UnwrapInstanceHandle(Z, closure);
   if (closure_obj.IsNull() || !closure_obj.IsClosure()) {
-    RETURN_TYPE_ERROR(isolate, closure, Instance);
+    RETURN_TYPE_ERROR(Z, closure, Instance);
   }
 
   ASSERT(ClassFinalizer::AllClassesFinalized());
 
   RawFunction* rf = Closure::function(closure_obj);
-  return Api::NewHandle(isolate, rf);
+  return Api::NewHandle(I, rf);
 }
 
 }  // namespace dart
diff --git a/runtime/vm/native_api_impl.cc b/runtime/vm/native_api_impl.cc
index a668897..ce05529 100644
--- a/runtime/vm/native_api_impl.cc
+++ b/runtime/vm/native_api_impl.cc
@@ -11,7 +11,6 @@
 #include "vm/message.h"
 #include "vm/native_message_handler.h"
 #include "vm/port.h"
-#include "vm/precompiler.h"
 
 namespace dart {
 
@@ -72,17 +71,8 @@
 
 static void CompileAll(Isolate* isolate, Dart_Handle* result) {
   ASSERT(isolate != NULL);
-  const Error& error = Error::Handle(isolate, Library::CompileAll());
-  if (error.IsNull()) {
-    *result = Api::Success();
-  } else {
-    *result = Api::NewHandle(isolate, error.raw());
-  }
-}
-
-static void Precompile(Isolate* isolate, Dart_Handle* result) {
-  ASSERT(isolate != NULL);
-  const Error& error = Error::Handle(isolate, Precompiler::CompileAll());
+  const Error& error =
+      Error::Handle(isolate->current_zone(), Library::CompileAll());
   if (error.IsNull()) {
     *result = Api::Success();
   } else {
@@ -92,27 +82,13 @@
 
 
 DART_EXPORT Dart_Handle Dart_CompileAll() {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  Dart_Handle result = Api::CheckAndFinalizePendingClasses(isolate);
+  DARTSCOPE(Thread::Current());
+  Dart_Handle result = Api::CheckAndFinalizePendingClasses(I);
   if (::Dart_IsError(result)) {
     return result;
   }
-  CHECK_CALLBACK_STATE(isolate);
-  CompileAll(isolate, &result);
-  return result;
-}
-
-
-DART_EXPORT Dart_Handle Dart_Precompile() {
-  Isolate* isolate = Isolate::Current();
-  DARTSCOPE(isolate);
-  Dart_Handle result = Api::CheckAndFinalizePendingClasses(isolate);
-  if (::Dart_IsError(result)) {
-    return result;
-  }
-  CHECK_CALLBACK_STATE(isolate);
-  Precompile(isolate, &result);
+  CHECK_CALLBACK_STATE(T);
+  CompileAll(I, &result);
   return result;
 }
 
diff --git a/runtime/vm/native_entry.cc b/runtime/vm/native_entry.cc
index 0180c09..5d5a596 100644
--- a/runtime/vm/native_entry.cc
+++ b/runtime/vm/native_entry.cc
@@ -6,10 +6,14 @@
 
 #include "include/dart_api.h"
 
+#include "vm/bootstrap.h"
+#include "vm/code_patcher.h"
 #include "vm/dart_api_impl.h"
 #include "vm/dart_api_state.h"
 #include "vm/object_store.h"
 #include "vm/reusable_handles.h"
+#include "vm/stack_frame.h"
+#include "vm/symbols.h"
 #include "vm/tags.h"
 
 
@@ -19,10 +23,6 @@
             "Trace invocation of natives (debug mode only)");
 
 
-static ExternalLabel native_call_label(
-    reinterpret_cast<uword>(&NativeEntry::NativeCallWrapper));
-
-
 NativeFunction NativeEntry::ResolveNative(const Library& library,
                                           const String& function_name,
                                           int number_of_arguments,
@@ -56,14 +56,14 @@
 
 
 const uint8_t* NativeEntry::ResolveSymbol(uword pc) {
-  Isolate* isolate = Isolate::Current();
-  REUSABLE_GROWABLE_OBJECT_ARRAY_HANDLESCOPE(isolate);
+  Thread* thread = Thread::Current();
+  REUSABLE_GROWABLE_OBJECT_ARRAY_HANDLESCOPE(thread);
   GrowableObjectArray& libs = reused_growable_object_array_handle.Handle();
-  libs ^= isolate->object_store()->libraries();
+  libs ^= thread->isolate()->object_store()->libraries();
   ASSERT(!libs.IsNull());
   intptr_t num_libs = libs.Length();
   for (intptr_t i = 0; i < num_libs; i++) {
-    REUSABLE_LIBRARY_HANDLESCOPE(isolate);
+    REUSABLE_LIBRARY_HANDLESCOPE(thread);
     Library& lib = reused_library_handle.Handle();
     lib ^= libs.At(i);
     ASSERT(!lib.IsNull());
@@ -76,8 +76,13 @@
 }
 
 
-const ExternalLabel& NativeEntry::NativeCallWrapperLabel() {
-  return native_call_label;
+uword NativeEntry::NativeCallWrapperEntry() {
+  uword entry = reinterpret_cast<uword>(NativeEntry::NativeCallWrapper);
+#if defined(USING_SIMULATOR)
+  entry = Simulator::RedirectExternalReference(
+      entry, Simulator::kNativeCall, NativeEntry::kNumCallWrapperArguments);
+#endif
+  return entry;
 }
 
 
@@ -123,4 +128,150 @@
   VERIFY_ON_TRANSITION;
 }
 
+
+static bool IsNativeKeyword(const TokenStream::Iterator& it) {
+  return Token::IsIdentifier(it.CurrentTokenKind()) &&
+      (it.CurrentLiteral() == Symbols::Native().raw());
+}
+
+
+static NativeFunction ResolveNativeFunction(Zone* zone,
+                                            const Function& func,
+                                            bool* is_bootstrap_native) {
+  const Script& script = Script::Handle(zone, func.script());
+  const Class& cls = Class::Handle(zone, func.Owner());
+  const Library& library = Library::Handle(zone, cls.library());
+
+  *is_bootstrap_native =
+      Bootstrap::IsBootstapResolver(library.native_entry_resolver());
+
+  TokenStream::Iterator it(TokenStream::Handle(zone, script.tokens()),
+                           func.token_pos());
+
+  const intptr_t end_pos = func.end_token_pos();
+  while (!IsNativeKeyword(it) && it.CurrentPosition() <= end_pos) {
+    it.Advance();
+  }
+  ASSERT(IsNativeKeyword(it));
+  it.Advance();
+  ASSERT(it.CurrentTokenKind() == Token::kSTRING);
+  const String& native_name = String::Handle(it.CurrentLiteral());
+
+  const int num_params = NativeArguments::ParameterCountForResolution(func);
+  bool auto_setup_scope = true;
+  return NativeEntry::ResolveNative(
+      library, native_name, num_params, &auto_setup_scope);
+}
+
+
+uword NativeEntry::LinkNativeCallEntry() {
+  uword entry = reinterpret_cast<uword>(NativeEntry::LinkNativeCall);
+#if defined(USING_SIMULATOR)
+  entry = Simulator::RedirectExternalReference(
+      entry, Simulator::kBootstrapNativeCall, NativeEntry::kNumArguments);
+#endif
+  return entry;
+}
+
+
+void NativeEntry::LinkNativeCall(Dart_NativeArguments args) {
+  CHECK_STACK_ALIGNMENT;
+  VERIFY_ON_TRANSITION;
+  NativeArguments* arguments = reinterpret_cast<NativeArguments*>(args);
+  /* Tell MemorySanitizer 'arguments' is initialized by generated code. */
+  MSAN_UNPOISON(arguments, sizeof(*arguments));
+  TRACE_NATIVE_CALL("%s", "LinkNative");
+
+  NativeFunction target_function = NULL;
+  bool call_through_wrapper = false;
+#ifdef USING_SIMULATOR
+  bool is_native_auto_setup_scope = false;
+#endif
+
+  {
+    StackZone zone(arguments->thread());
+
+    DartFrameIterator iterator;
+    StackFrame* caller_frame = iterator.NextFrame();
+
+    const Code& code = Code::Handle(caller_frame->LookupDartCode());
+    const Function& func = Function::Handle(code.function());
+#ifdef USING_SIMULATOR
+    is_native_auto_setup_scope = func.IsNativeAutoSetupScope();
+#endif
+
+    if (FLAG_trace_natives) {
+      OS::Print("Resolving native target for %s\n", func.ToCString());
+    }
+
+    bool is_bootstrap_native = false;
+    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));
+#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)));
+#endif
+      ASSERT(current_trampoline.raw() ==
+             StubCode::CallBootstrapCFunction_entry()->code());
+    }
+#endif
+
+    const intptr_t argc_tag = NativeArguments::ComputeArgcTag(func);
+    const bool is_leaf_call =
+      (argc_tag & NativeArguments::AutoSetupScopeMask()) == 0;
+
+    call_through_wrapper = !is_bootstrap_native && !is_leaf_call;
+
+    const Code& trampoline = 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 || !is_native_auto_setup_scope) {
+      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);
+
+    if (FLAG_trace_natives) {
+      OS::Print("    -> %p (%s, %s)\n",
+                target_function,
+                is_bootstrap_native ? "bootstrap" : "non-bootstrap",
+                is_leaf_call ? "leaf" : "non-leaf");
+    }
+  }
+  VERIFY_ON_TRANSITION;
+
+  // Tail-call resolved target.
+  if (call_through_wrapper) {
+    NativeEntry::NativeCallWrapper(
+        args, reinterpret_cast<Dart_NativeFunction>(target_function));
+  } else {
+    target_function(arguments);
+  }
+}
+
+
 }  // namespace dart
diff --git a/runtime/vm/native_entry.h b/runtime/vm/native_entry.h
index 45dd5c9..25dee39 100644
--- a/runtime/vm/native_entry.h
+++ b/runtime/vm/native_entry.h
@@ -54,7 +54,7 @@
       Thread* thread = arguments->thread();                                    \
       ASSERT(thread == Thread::Current());                                     \
       Isolate* isolate = thread->isolate();                                    \
-      StackZone zone(isolate);                                                 \
+      StackZone zone(thread);                                                  \
       SET_NATIVE_RETVAL(arguments,                                             \
                         DN_Helper##name(isolate,                               \
                                         thread,                                \
@@ -88,7 +88,7 @@
 #define GET_NATIVE_ARGUMENT(type, name, value)                                 \
   const Instance& __##name##_instance__ =                                      \
       Instance::CheckedHandle(zone, value);                                    \
-  type& name = type::Handle(isolate);                                          \
+  type& name = type::Handle(zone);                                             \
   if (!__##name##_instance__.IsNull()) {                                       \
     if (!__##name##_instance__.Is##type()) {                                   \
       const Array& __args__ = Array::Handle(Array::New(1));                    \
@@ -102,6 +102,7 @@
 // Helper class for resolving and handling native functions.
 class NativeEntry : public AllStatic {
  public:
+  static const intptr_t kNumArguments = 1;
   static const intptr_t kNumCallWrapperArguments = 2;
 
   // Resolve specified dart native function to the actual native entrypoint.
@@ -112,9 +113,13 @@
   static const uint8_t* ResolveSymbolInLibrary(const Library& library,
                                                uword pc);
   static const uint8_t* ResolveSymbol(uword pc);
+
+  static uword NativeCallWrapperEntry();
   static void NativeCallWrapper(Dart_NativeArguments args,
                                 Dart_NativeFunction func);
-  static const ExternalLabel& NativeCallWrapperLabel();
+
+  static uword LinkNativeCallEntry();
+  static void LinkNativeCall(Dart_NativeArguments args);
 };
 
 }  // namespace dart
diff --git a/runtime/vm/native_entry_test.cc b/runtime/vm/native_entry_test.cc
index 6d48368..6929913 100644
--- a/runtime/vm/native_entry_test.cc
+++ b/runtime/vm/native_entry_test.cc
@@ -56,7 +56,6 @@
 // Arg0-4: 5 smis or null.
 // Result: a smi representing the sum of all non-null arguments.
 void TestNonNullSmiSum(Dart_NativeArguments args) {
-  Isolate* isolate = Isolate::Current();  // Used by GET_NATIVE_ARGUMENT.
   int64_t result = 0;
   int arg_count = Dart_GetNativeArgumentCount(args);
   // Test the lower level macro GET_NATIVE_ARGUMENT.
diff --git a/runtime/vm/native_entry_test.h b/runtime/vm/native_entry_test.h
index 2c34548..706b4b6 100644
--- a/runtime/vm/native_entry_test.h
+++ b/runtime/vm/native_entry_test.h
@@ -6,6 +6,7 @@
 #define VM_NATIVE_ENTRY_TEST_H_
 
 #include "include/dart_api.h"
+#include "vm/runtime_entry.h"
 
 namespace dart {
 
diff --git a/runtime/vm/native_message_handler.cc b/runtime/vm/native_message_handler.cc
index 08bc7e9..8f8d7a6 100644
--- a/runtime/vm/native_message_handler.cc
+++ b/runtime/vm/native_message_handler.cc
@@ -32,27 +32,21 @@
 #endif
 
 
-static uint8_t* zone_allocator(uint8_t* ptr,
-                               intptr_t old_size,
-                               intptr_t new_size) {
-  Zone* zone = ApiNativeScope::Current()->zone();
-  return zone->Realloc<uint8_t>(ptr, old_size, new_size);
-}
-
-
-bool NativeMessageHandler::HandleMessage(Message* message) {
+MessageHandler::MessageStatus NativeMessageHandler::HandleMessage(
+    Message* message) {
   if (message->IsOOB()) {
     // We currently do not use OOB messages for native ports.
     UNREACHABLE();
   }
-  // Enter a native scope for handling the message. This will create a
-  // zone for allocating the objects for decoding the message.
+  // We create a native scope for handling the message.
+  // All allocation of objects for decoding the message is done in the
+  // zone associated with this scope.
   ApiNativeScope scope;
-  ApiMessageReader reader(message->data(), message->len(), zone_allocator);
+  ApiMessageReader reader(message->data(), message->len());
   Dart_CObject* object = reader.ReadMessage();
   (*func())(message->dest_port(), object);
   delete message;
-  return true;
+  return kOK;
 }
 
 }  // namespace dart
diff --git a/runtime/vm/native_message_handler.h b/runtime/vm/native_message_handler.h
index 777cb7f..9a34c77 100644
--- a/runtime/vm/native_message_handler.h
+++ b/runtime/vm/native_message_handler.h
@@ -21,7 +21,7 @@
   const char* name() const { return name_; }
   Dart_NativeMessageHandler func() const { return func_; }
 
-  bool HandleMessage(Message* message);
+  MessageStatus HandleMessage(Message* message);
 
 #if defined(DEBUG)
   // Check that it is safe to access this handler.
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index 8e2460e..e0247e6 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -62,9 +62,12 @@
 DEFINE_FLAG(bool, throw_on_javascript_int_overflow, false,
     "Throw an exception when the result of an integer calculation will not "
     "fit into a javascript integer.");
+DEFINE_FLAG(bool, trace_cha, false, "Trace CHA operations");
 DEFINE_FLAG(bool, use_field_guards, true, "Guard field cids.");
 DEFINE_FLAG(bool, use_lib_cache, true, "Use library name cache");
 DEFINE_FLAG(bool, trace_field_guards, false, "Trace changes in field's cids.");
+DEFINE_FLAG(bool, ignore_patch_signature_mismatch, false,
+            "Ignore patch file member signature mismatch.");
 
 DECLARE_FLAG(charp, coverage_dir);
 DECLARE_FLAG(bool, load_deferred_eagerly);
@@ -97,6 +100,7 @@
 TypeArguments* Object::null_type_arguments_ = NULL;
 Array* Object::empty_array_ = NULL;
 Array* Object::zero_array_ = NULL;
+ContextScope* Object::empty_context_scope_ = NULL;
 ObjectPool* Object::empty_object_pool_ = NULL;
 PcDescriptors* Object::empty_descriptors_ = NULL;
 LocalVarDescriptors* Object::empty_var_descriptors_ = NULL;
@@ -160,6 +164,34 @@
 const double MegamorphicCache::kLoadFactor = 0.75;
 
 
+static void AppendSubString(Zone* zone,
+                            GrowableArray<const char*>* segments,
+                            const char* name,
+                            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';
+  segments->Add(segment);
+}
+
+
+static const char* MergeSubStrings(Zone* zone,
+                                   const GrowableArray<const char*>& segments,
+                                   intptr_t alloc_len) {
+  char* result = zone->Alloc<char>(alloc_len + 1);  // '\0'-terminated
+  intptr_t pos = 0;
+  for (intptr_t k = 0; k < segments.length(); k++) {
+    const char* piece = segments[k];
+    const intptr_t piece_len = strlen(segments[k]);
+    memmove(result + pos, piece, piece_len);
+    pos += piece_len;
+    ASSERT(pos <= alloc_len);
+  }
+  result[pos] = '\0';
+  return result;
+}
+
+
 // Takes a vm internal name and makes it suitable for external user.
 //
 // Examples:
@@ -171,9 +203,10 @@
 //
 // Private name mangling is removed, possibly multiple times:
 //
-//   _ReceivePortImpl@6be832b -> _ReceivePortImpl
-//   _ReceivePortImpl@6be832b._internal@6be832b -> _ReceivePortImpl._internal
-//   _C@0x2b4ab9cc&_E@0x2b4ab9cc&_F@0x2b4ab9cc -> _C&_E&_F
+//   _ReceivePortImpl@709387912 -> _ReceivePortImpl
+//   _ReceivePortImpl@709387912._internal@709387912 ->
+//      _ReceivePortImpl._internal
+//   _C@6328321&_E@6328321&_F@6328321 -> _C&_E&_F
 //
 // The trailing . on the default constructor name is dropped:
 //
@@ -181,29 +214,31 @@
 //
 // And so forth:
 //
-//   get:foo@6be832b -> foo
-//   _MyClass@6b3832b. -> _MyClass
-//   _MyClass@6b3832b.named -> _MyClass.named
+//   get:foo@6328321 -> foo
+//   _MyClass@6328321. -> _MyClass
+//   _MyClass@6328321.named -> _MyClass.named
 //
 RawString* String::IdentifierPrettyName(const String& name) {
+  Zone* zone = Thread::Current()->zone();
   if (name.Equals(Symbols::TopLevel())) {
     // Name of invisible top-level class.
     return Symbols::Empty().raw();
   }
 
+  const char* cname = name.ToCString();
+  ASSERT(strlen(cname) == static_cast<size_t>(name.Length()));
+  const intptr_t name_len = name.Length();
   // First remove all private name mangling.
-  String& unmangled_name = String::Handle(Symbols::Empty().raw());
-  String& segment = String::Handle();
   intptr_t start_pos = 0;
-  for (intptr_t i = 0; i < name.Length(); i++) {
-    if (name.CharAt(i) == '@' &&
-        (i+1) < name.Length() &&
-        (name.CharAt(i+1) >= '0') &&
-        (name.CharAt(i+1) <= '9')) {
+  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')) {
       // Append the current segment to the unmangled name.
-      segment = String::SubString(name, start_pos, (i - start_pos));
-      unmangled_name = String::Concat(unmangled_name, segment);
-
+      const intptr_t segment_len = i - start_pos;
+      sum_segment_len += segment_len;
+      AppendSubString(zone, &unmangled_segments, cname, start_pos, segment_len);
       // Advance until past the name mangling. The private keys are only
       // numbers so we skip until the first non-number.
       i++;  // Skip the '@'.
@@ -216,21 +251,29 @@
       i--;  // Account for for-loop increment.
     }
   }
+
+  const char* unmangled_name = NULL;
   if (start_pos == 0) {
     // No name unmangling needed, reuse the name that was passed in.
-    unmangled_name = name.raw();
+    unmangled_name = cname;
+    sum_segment_len = name_len;
   } else if (name.Length() != start_pos) {
     // Append the last segment.
-    segment = String::SubString(name, start_pos, (name.Length() - start_pos));
-    unmangled_name = String::Concat(unmangled_name, segment);
+    const intptr_t segment_len = name.Length() - start_pos;
+    sum_segment_len += segment_len;
+    AppendSubString(zone, &unmangled_segments, cname, start_pos, segment_len);
+  }
+  if (unmangled_name == NULL) {
+    // Merge unmangled_segments.
+    unmangled_name = MergeSubStrings(zone, unmangled_segments, sum_segment_len);
   }
 
-  intptr_t len = unmangled_name.Length();
+  intptr_t len = sum_segment_len;
   intptr_t start = 0;
   intptr_t dot_pos = -1;  // Position of '.' in the name, if any.
   bool is_setter = false;
   for (intptr_t i = start; i < len; i++) {
-    if (unmangled_name.CharAt(i) == ':') {
+    if (unmangled_name[i] == ':') {
       if (start != 0) {
         // Reset and break.
         start = 0;
@@ -238,11 +281,11 @@
         break;
       }
       ASSERT(start == 0);  // Only one : is possible in getters or setters.
-      if (unmangled_name.CharAt(0) == 's') {
+      if (unmangled_name[0] == 's') {
         is_setter = true;
       }
       start = i + 1;
-    } else if (unmangled_name.CharAt(i) == '.') {
+    } else if (unmangled_name[i] == '.') {
       if (dot_pos != -1) {
         // Reset and break.
         start = 0;
@@ -256,21 +299,25 @@
 
   if ((start == 0) && (dot_pos == -1)) {
     // This unmangled_name is fine as it is.
-    return unmangled_name.raw();
+    return Symbols::New(unmangled_name, sum_segment_len);
   }
 
   // Drop the trailing dot if needed.
   intptr_t end = ((dot_pos + 1) == len) ? dot_pos : len;
 
-  const String& result =
-      String::Handle(String::SubString(unmangled_name, start, (end - start)));
-
+  unmangled_segments.Clear();
+  intptr_t final_len = end - start;
+  AppendSubString(zone, &unmangled_segments, unmangled_name, start, final_len);
   if (is_setter) {
-    // Setters need to end with '='.
-    return String::Concat(result, Symbols::Equals());
+    const char* equals = Symbols::Equals().ToCString();
+    const intptr_t equals_len = strlen(equals);
+    AppendSubString(zone, &unmangled_segments, equals, 0, equals_len);
+    final_len += equals_len;
   }
 
-  return result.raw();
+  unmangled_name = MergeSubStrings(zone, unmangled_segments, final_len);
+
+  return Symbols::New(unmangled_name);
 }
 
 
@@ -426,6 +473,7 @@
   null_type_arguments_ = TypeArguments::ReadOnlyHandle();
   empty_array_ = Array::ReadOnlyHandle();
   zero_array_ = Array::ReadOnlyHandle();
+  empty_context_scope_ = ContextScope::ReadOnlyHandle();
   empty_object_pool_ = ObjectPool::ReadOnlyHandle();
   empty_descriptors_ = PcDescriptors::ReadOnlyHandle();
   empty_var_descriptors_ = LocalVarDescriptors::ReadOnlyHandle();
@@ -655,6 +703,22 @@
     zero_array_->SetAt(0, smi);
   }
 
+  // Allocate and initialize the canonical empty context scope object.
+  {
+    uword address = heap->Allocate(ContextScope::InstanceSize(0), Heap::kOld);
+    InitializeObject(address,
+                     kContextScopeCid,
+                     ContextScope::InstanceSize(0),
+                     true);
+    ContextScope::initializeHandle(
+        empty_context_scope_,
+        reinterpret_cast<RawContextScope*>(address + kHeapObjectTag));
+    empty_context_scope_->StoreNonPointer(
+        &empty_context_scope_->raw_ptr()->num_variables_, 0);
+    empty_context_scope_->StoreNonPointer(
+        &empty_context_scope_->raw_ptr()->is_implicit_, true);
+  }
+
   // Allocate and initialize the canonical empty object pool object.
   {
     uword address =
@@ -775,6 +839,8 @@
   ASSERT(empty_array_->IsArray());
   ASSERT(!zero_array_->IsSmi());
   ASSERT(zero_array_->IsArray());
+  ASSERT(!empty_context_scope_->IsSmi());
+  ASSERT(empty_context_scope_->IsContextScope());
   ASSERT(!empty_descriptors_->IsSmi());
   ASSERT(empty_descriptors_->IsPcDescriptors());
   ASSERT(!empty_var_descriptors_->IsSmi());
@@ -810,11 +876,16 @@
   explicit PremarkingVisitor(Isolate* isolate) : ObjectVisitor(isolate) {}
 
   void VisitObject(RawObject* obj) {
-    ASSERT(!obj->IsMarked());
     // Free list elements should never be marked.
     if (!obj->IsFreeListElement()) {
       ASSERT(obj->IsVMHeapObject());
-      obj->SetMarkBitUnsynchronized();
+      if (obj->IsMarked()) {
+        // Precompiled instructions are loaded pre-marked.
+        ASSERT(Dart::IsRunningPrecompiledCode());
+        ASSERT(obj->IsInstructions());
+      } else {
+        obj->SetMarkBitUnsynchronized();
+      }
     }
   }
 };
@@ -841,7 +912,7 @@
 
 
   // Set up names for all VM singleton classes.
-  Class& cls = Class::Handle(isolate);
+  Class& cls = Class::Handle();
 
   SET_CLASS_NAME(class, Class);
   SET_CLASS_NAME(dynamic, Dynamic);
@@ -882,12 +953,14 @@
   cls = isolate->object_store()->one_byte_string_class();
   cls.set_name(Symbols::OneByteString());
 
-  // Make the VM isolate read-only after setting all objects as marked.
-  PremarkingVisitor premarker(isolate);
-  isolate->heap()->WriteProtect(false);
-  ASSERT(isolate->heap()->UsedInWords(Heap::kNew) == 0);
-  isolate->heap()->IterateOldObjects(&premarker);
-  isolate->heap()->WriteProtect(true);
+  {
+    ASSERT(isolate == Dart::vm_isolate());
+    WritableVMIsolateScope scope(Thread::Current());
+    PremarkingVisitor premarker(isolate);
+    ASSERT(isolate->heap()->UsedInWords(Heap::kNew) == 0);
+    isolate->heap()->IterateOldObjects(&premarker);
+    // Make the VM isolate read-only again after setting all objects as marked.
+  }
 }
 
 
@@ -950,9 +1023,9 @@
 
 void Object::VerifyBuiltinVtables() {
 #if defined(DEBUG)
-  Isolate* isolate = Isolate::Current();
-  ASSERT(isolate != NULL);
-  Class& cls = Class::Handle(isolate, Class::null());
+  Thread* thread = Thread::Current();
+  Isolate* isolate = thread->isolate();
+  Class& cls = Class::Handle(thread->zone(), Class::null());
   for (intptr_t cid = (kIllegalCid + 1); cid < kNumPredefinedCids; cid++) {
     if (isolate->class_table()->HasValidClassAt(cid)) {
       cls ^= isolate->class_table()->At(cid);
@@ -987,17 +1060,22 @@
 
 
 RawError* Object::Init(Isolate* isolate) {
-  TIMERSCOPE(isolate, time_bootstrap);
+  Thread* thread = Thread::Current();
+  Zone* zone = thread->zone();
+  ASSERT(isolate == thread->isolate());
+  TimelineDurationScope tds(thread,
+                            isolate->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();
 
-  Class& cls = Class::Handle(isolate);
-  Type& type = Type::Handle(isolate);
-  Array& array = Array::Handle(isolate);
-  Library& lib = Library::Handle(isolate);
+  Class& cls = Class::Handle(zone);
+  Type& type = Type::Handle(zone);
+  Array& array = Array::Handle(zone);
+  Library& lib = Library::Handle(zone);
 
   // All RawArray fields will be initialized to an empty array, therefore
   // initialize array class first.
@@ -1025,19 +1103,19 @@
   const intptr_t kInitialCanonicalTypeArgumentsSize = 4;
   array = Array::New(kInitialCanonicalTypeArgumentsSize + 1);
   array.SetAt(kInitialCanonicalTypeArgumentsSize,
-              Smi::Handle(isolate, Smi::New(0)));
+              Smi::Handle(zone, Smi::New(0)));
   object_store->set_canonical_type_arguments(array);
 
   // Setup type class early in the process.
-  const Class& type_cls = Class::Handle(isolate, Class::New<Type>());
-  const Class& type_ref_cls = Class::Handle(isolate, Class::New<TypeRef>());
-  const Class& type_parameter_cls = Class::Handle(isolate,
+  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(isolate,
+  const Class& bounded_type_cls = Class::Handle(zone,
                                                 Class::New<BoundedType>());
-  const Class& mixin_app_type_cls = Class::Handle(isolate,
+  const Class& mixin_app_type_cls = Class::Handle(zone,
                                                   Class::New<MixinAppType>());
-  const Class& library_prefix_cls = Class::Handle(isolate,
+  const Class& library_prefix_cls = Class::Handle(zone,
                                                   Class::New<LibraryPrefix>());
 
   // Pre-allocate the OneByteString class needed by the symbol table.
@@ -1053,33 +1131,37 @@
 
   // Set up the libraries array before initializing the core library.
   const GrowableObjectArray& libraries = GrowableObjectArray::Handle(
-      isolate, GrowableObjectArray::New(Heap::kOld));
+      zone, GrowableObjectArray::New(Heap::kOld));
   object_store->set_libraries(libraries);
 
   // Pre-register the core library.
   Library::InitCoreLibrary(isolate);
 
   // Basic infrastructure has been setup, initialize the class dictionary.
-  const Library& core_lib = Library::Handle(isolate, Library::CoreLibrary());
+  const Library& core_lib = Library::Handle(zone, Library::CoreLibrary());
   ASSERT(!core_lib.IsNull());
 
   const GrowableObjectArray& pending_classes =
-      GrowableObjectArray::Handle(isolate, GrowableObjectArray::New());
+      GrowableObjectArray::Handle(zone, GrowableObjectArray::New());
   object_store->set_pending_classes(pending_classes);
 
-  Context& context = Context::Handle(isolate, Context::New(0, Heap::kOld));
+  Context& context = Context::Handle(zone, Context::New(0, Heap::kOld));
   object_store->set_empty_context(context);
 
   // 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(isolate);
+  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.
-  type ^= Type::New(Object::Handle(isolate, cls.raw()),
-                    TypeArguments::Handle(isolate),
+  // 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),
                     Scanner::kNoSourcePos);
   type.SetIsFinalized();
   type ^= type.Canonicalize();
@@ -1119,7 +1201,7 @@
   // Pre-register the isolate library so the native class implementations
   // can be hooked up before compiling it.
   Library& isolate_lib =
-      Library::Handle(isolate, Library::LookupLibrary(Symbols::DartIsolate()));
+      Library::Handle(zone, Library::LookupLibrary(Symbols::DartIsolate()));
   if (isolate_lib.IsNull()) {
     isolate_lib = Library::NewLibraryHelper(Symbols::DartIsolate(), true);
     isolate_lib.SetLoadRequested();
@@ -1141,7 +1223,7 @@
   RegisterPrivateClass(cls, Symbols::_SendPortImpl(), isolate_lib);
   pending_classes.Add(cls);
 
-  const Class& stacktrace_cls = Class::Handle(isolate,
+  const Class& stacktrace_cls = Class::Handle(zone,
                                               Class::New<Stacktrace>());
   RegisterPrivateClass(stacktrace_cls, Symbols::_StackTrace(), core_lib);
   pending_classes.Add(stacktrace_cls);
@@ -1468,9 +1550,9 @@
   ASSERT(!lib.IsNull());
   cls = lib.LookupClassAllowPrivate(Symbols::ClassID());
   ASSERT(!cls.IsNull());
-  Field& field = Field::Handle(isolate);
-  Smi& value = Smi::Handle(isolate);
-  String& field_name = String::Handle(isolate);
+  Field& field = Field::Handle(zone);
+  Smi& value = Smi::Handle(zone);
+  String& field_name = String::Handle(zone);
 
 #define CLASS_LIST_WITH_NULL(V)                                                \
   V(Null)                                                                      \
@@ -1480,7 +1562,7 @@
   field_name = Symbols::New("cid"#clazz);                                      \
   field = Field::New(field_name, true, false, true, false, cls, 0);            \
   value = Smi::New(k##clazz##Cid);                                             \
-  field.set_value(value);                                                      \
+  field.SetStaticValue(value, true);                                           \
   field.set_type(Type::Handle(Type::IntType()));                               \
   cls.AddField(field);                                                         \
 
@@ -1598,7 +1680,7 @@
   cls = Class::New<MirrorReference>();
   cls = Class::New<UserTag>();
 
-  const Context& context = Context::Handle(isolate,
+  const Context& context = Context::Handle(zone,
                                            Context::New(0, Heap::kOld));
   object_store->set_empty_context(context);
 
@@ -1609,7 +1691,7 @@
 
 
 void Object::Print() const {
-  OS::Print("%s\n", ToCString());
+  THR_Print("%s\n", ToCString());
 }
 
 
@@ -1636,7 +1718,7 @@
   if (!same_type) {
     jsobj->AddProperty("_vmType", vm_type);
   }
-  if (!ref || IsInstance()) {
+  if (!ref || IsInstance() || IsNull()) {
     // TODO(turnidge): Provide the type arguments here too?
     const Class& cls = Class::Handle(this->clazz());
     jsobj->AddProperty("class", cls);
@@ -1683,11 +1765,22 @@
                               intptr_t class_id,
                               intptr_t size,
                               bool is_vm_object) {
-  // TODO(iposva): Get a proper halt instruction from the assembler which
-  // would be needed here for code objects.
-  uword initial_value = reinterpret_cast<uword>(null_);
+  const uword break_instruction_value = Assembler::GetBreakInstructionFiller();
+  const uword null_value = reinterpret_cast<uword>(null_);
+  const bool is_instructions = class_id == kInstructionsCid;
+  uword initial_value =
+      is_instructions ? break_instruction_value : null_value;
   uword cur = address;
   uword end = address + size;
+  if (is_instructions) {
+    // Fill the header with null. The remainder of the Instructions object will
+    // be filled with the break_instruction_value.
+    uword header_end = address + Instructions::HeaderSize();
+    while (cur < header_end) {
+      *reinterpret_cast<uword*>(cur) = null_value;
+      cur += kWordSize;
+    }
+  }
   while (cur < end) {
     *reinterpret_cast<uword*>(cur) = initial_value;
     cur += kWordSize;
@@ -1733,7 +1826,9 @@
   ASSERT(Utils::IsAligned(size, kObjectAlignment));
   Thread* thread = Thread::Current();
   Isolate* isolate = thread->isolate();
-  ASSERT(isolate->no_callback_scope_depth() == 0);
+  // New space allocation allowed only in mutator thread (Dart thread);
+  ASSERT(isolate->MutatorThreadIsCurrentThread() || (space != Heap::kNew));
+  ASSERT(thread->no_callback_scope_depth() == 0);
   Heap* heap = isolate->heap();
 
   uword address = heap->Allocate(size, space);
@@ -1753,7 +1848,7 @@
   }
   const Class& cls = Class::Handle(class_table->At(cls_id));
   if (cls.TraceAllocation(isolate)) {
-    Profiler::RecordAllocation(isolate, cls_id);
+    Profiler::RecordAllocation(thread, cls_id);
   }
   NoSafepointScope no_safepoint;
   InitializeObject(address, cls_id, size, (isolate == Dart::vm_isolate()));
@@ -1858,29 +1953,17 @@
 
 RawType* Class::SignatureType() const {
   ASSERT(IsSignatureClass());
-  const Function& function = Function::Handle(signature_function());
+  Zone* zone = Thread::Current()->zone();
+  const Function& function = Function::Handle(zone, signature_function());
   ASSERT(!function.IsNull());
   if (function.signature_class() != raw()) {
     // This class is a function type alias. Return the canonical signature type.
-    const Class& canonical_class = Class::Handle(function.signature_class());
-    return canonical_class.SignatureType();
+    const Class& canonical_signature_class =
+        Class::Handle(zone, function.signature_class());
+    return canonical_signature_class.SignatureType();
   }
-  // Return the first canonical signature type if already computed at class
-  // finalization time. The optimizer may canonicalize instantiated function
-  // types of the same signature class, but these will be added after the
-  // uninstantiated signature class at index 0.
-  Array& signature_types = Array::Handle();
-  signature_types ^= canonical_types();
-  if (signature_types.IsNull()) {
-    set_canonical_types(empty_array());
-    signature_types ^= canonical_types();
-  }
-  // The canonical_types array is initialized to the empty array.
-  ASSERT(!signature_types.IsNull());
-  if (signature_types.Length() > 0) {
-    Type& signature_type = Type::Handle();
-    signature_type ^= signature_types.At(0);
-    ASSERT(!signature_type.IsNull());
+  const Type& signature_type = Type::Handle(zone, CanonicalType());
+  if (!signature_type.IsNull()) {
     return signature_type.raw();
   }
   // A signature class extends class Instance and is parameterized in the same
@@ -1892,13 +1975,9 @@
   // argument vector. Therefore, we only need to set the type arguments
   // matching the type parameters here.
   const TypeArguments& signature_type_arguments =
-      TypeArguments::Handle(type_parameters());
-  const Type& signature_type = Type::Handle(
-      Type::New(*this, signature_type_arguments, token_pos()));
-
+      TypeArguments::Handle(zone, type_parameters());
   // Return the still unfinalized signature type.
-  ASSERT(!signature_type.IsFinalized());
-  return signature_type.raw();
+  return Type::New(*this, signature_type_arguments, token_pos());
 }
 
 
@@ -2089,7 +2168,7 @@
   ASSERT(!value.IsNull());
   StorePointer(&raw_ptr()->functions_, value.raw());
   const intptr_t len = value.Length();
-  ClassFunctionsSet set(HashTables::New<ClassFunctionsSet>(len));
+  ClassFunctionsSet set(HashTables::New<ClassFunctionsSet>(len, Heap::kOld));
   if (len >= kFunctionLookupHashTreshold) {
     Function& func = Function::Handle();
     for (intptr_t i = 0; i < len; ++i) {
@@ -2105,7 +2184,8 @@
 
 void Class::AddFunction(const Function& function) const {
   const Array& arr = Array::Handle(functions());
-  const Array& new_arr = Array::Handle(Array::Grow(arr, arr.Length() + 1));
+  const Array& new_arr =
+      Array::Handle(Array::Grow(arr, arr.Length() + 1, Heap::kOld));
   new_arr.SetAt(arr.Length(), function);
   StorePointer(&raw_ptr()->functions_, new_arr.raw());
   // Add to hash table, if any.
@@ -2135,14 +2215,14 @@
 
 
 intptr_t Class::FindFunctionIndex(const Function& needle) const {
-  Isolate* isolate = Isolate::Current();
-  if (EnsureIsFinalized(isolate) != Error::null()) {
+  Thread* thread = Thread::Current();
+  if (EnsureIsFinalized(thread) != Error::null()) {
     return -1;
   }
-  REUSABLE_ARRAY_HANDLESCOPE(isolate);
-  REUSABLE_FUNCTION_HANDLESCOPE(isolate);
-  Array& funcs = isolate->ArrayHandle();
-  Function& function = isolate->FunctionHandle();
+  REUSABLE_ARRAY_HANDLESCOPE(thread);
+  REUSABLE_FUNCTION_HANDLESCOPE(thread);
+  Array& funcs = thread->ArrayHandle();
+  Function& function = thread->FunctionHandle();
   funcs ^= functions();
   ASSERT(!funcs.IsNull());
   const intptr_t len = funcs.Length();
@@ -2188,17 +2268,17 @@
 
 
 intptr_t Class::FindImplicitClosureFunctionIndex(const Function& needle) const {
-  Isolate* isolate = Isolate::Current();
-  if (EnsureIsFinalized(isolate) != Error::null()) {
+  Thread* thread = Thread::Current();
+  if (EnsureIsFinalized(thread) != Error::null()) {
     return -1;
   }
-  REUSABLE_ARRAY_HANDLESCOPE(isolate);
-  REUSABLE_FUNCTION_HANDLESCOPE(isolate);
-  Array& funcs = isolate->ArrayHandle();
-  Function& function = isolate->FunctionHandle();
+  REUSABLE_ARRAY_HANDLESCOPE(thread);
+  REUSABLE_FUNCTION_HANDLESCOPE(thread);
+  Array& funcs = thread->ArrayHandle();
+  Function& function = thread->FunctionHandle();
   funcs ^= functions();
   ASSERT(!funcs.IsNull());
-  Function& implicit_closure = Function::Handle(isolate);
+  Function& implicit_closure = Function::Handle(thread->zone());
   const intptr_t len = funcs.Length();
   for (intptr_t i = 0; i < len; i++) {
     function ^= funcs.At(i);
@@ -2219,14 +2299,14 @@
 
 intptr_t Class::FindInvocationDispatcherFunctionIndex(
     const Function& needle) const {
-  Isolate* isolate = Isolate::Current();
-  if (EnsureIsFinalized(isolate) != Error::null()) {
+  Thread* thread = Thread::Current();
+  if (EnsureIsFinalized(thread) != Error::null()) {
     return -1;
   }
-  REUSABLE_ARRAY_HANDLESCOPE(isolate);
-  REUSABLE_OBJECT_HANDLESCOPE(isolate);
-  Array& funcs = isolate->ArrayHandle();
-  Object& object = isolate->ObjectHandle();
+  REUSABLE_ARRAY_HANDLESCOPE(thread);
+  REUSABLE_OBJECT_HANDLESCOPE(thread);
+  Array& funcs = thread->ArrayHandle();
+  Object& object = thread->ObjectHandle();
   funcs ^= invocation_dispatcher_cache();
   ASSERT(!funcs.IsNull());
   const intptr_t len = funcs.Length();
@@ -2247,11 +2327,11 @@
 
 
 RawFunction* Class::InvocationDispatcherFunctionFromIndex(intptr_t idx) const {
-  Isolate* isolate = Isolate::Current();
-  REUSABLE_ARRAY_HANDLESCOPE(isolate);
-  REUSABLE_OBJECT_HANDLESCOPE(isolate);
-  Array& dispatcher_cache = isolate->ArrayHandle();
-  Object& object = isolate->ObjectHandle();
+  Thread* thread = Thread::Current();
+  REUSABLE_ARRAY_HANDLESCOPE(thread);
+  REUSABLE_OBJECT_HANDLESCOPE(thread);
+  Array& dispatcher_cache = thread->ArrayHandle();
+  Object& object = thread->ObjectHandle();
   dispatcher_cache ^= invocation_dispatcher_cache();
   object = dispatcher_cache.At(idx);
   if (!object.IsFunction()) {
@@ -2261,16 +2341,21 @@
 }
 
 
+void Class::set_closures(const GrowableObjectArray& value) const {
+  StorePointer(&raw_ptr()->closure_functions_, value.raw());
+}
+
+
 void Class::AddClosureFunction(const Function& function) const {
   GrowableObjectArray& closures =
       GrowableObjectArray::Handle(raw_ptr()->closure_functions_);
   if (closures.IsNull()) {
-    closures = GrowableObjectArray::New(4);
+    closures = GrowableObjectArray::New(4, Heap::kOld);
     StorePointer(&raw_ptr()->closure_functions_, closures.raw());
   }
   ASSERT(function.IsNonImplicitClosureFunction());
   ASSERT(function.Owner() == this->raw());
-  closures.Add(function);
+  closures.Add(function, Heap::kOld);
 }
 
 
@@ -2306,11 +2391,11 @@
   if (closures() == GrowableObjectArray::null()) {
     return -1;
   }
-  Isolate* isolate = Isolate::Current();
+  Thread* thread = Thread::Current();
   const GrowableObjectArray& closures_array =
-      GrowableObjectArray::Handle(isolate, closures());
-  REUSABLE_FUNCTION_HANDLESCOPE(isolate);
-  Function& closure = isolate->FunctionHandle();
+      GrowableObjectArray::Handle(thread->zone(), closures());
+  REUSABLE_FUNCTION_HANDLESCOPE(thread);
+  Function& closure = thread->FunctionHandle();
   intptr_t num_closures = closures_array.Length();
   for (intptr_t i = 0; i < num_closures; i++) {
     closure ^= closures_array.At(i);
@@ -2357,15 +2442,15 @@
 }
 
 
-intptr_t Class::NumTypeParameters(Isolate* isolate) const {
+intptr_t Class::NumTypeParameters(Thread* thread) const {
   if (IsMixinApplication() && !is_mixin_type_applied()) {
     ClassFinalizer::ApplyMixinType(*this);
   }
   if (type_parameters() == TypeArguments::null()) {
     return 0;
   }
-  REUSABLE_TYPE_ARGUMENTS_HANDLESCOPE(isolate);
-  TypeArguments& type_params = isolate->TypeArgumentsHandle();
+  REUSABLE_TYPE_ARGUMENTS_HANDLESCOPE(thread);
+  TypeArguments& type_params = thread->TypeArgumentsHandle();
   type_params = type_parameters();
   return type_params.Length();
 }
@@ -2376,7 +2461,9 @@
   if (num_own_type_arguments() != kUnknownNumTypeArguments) {
     return num_own_type_arguments();
   }
-  Isolate* isolate = Isolate::Current();
+  Thread* thread = Thread::Current();
+  Isolate* isolate = thread->isolate();
+  Zone* zone = thread->zone();
   const intptr_t num_type_params = NumTypeParameters();
   if (!FLAG_overlap_type_arguments ||
       (num_type_params == 0) ||
@@ -2386,9 +2473,9 @@
     return num_type_params;
   }
   ASSERT(!IsMixinApplication() || is_mixin_type_applied());
-  const AbstractType& sup_type = AbstractType::Handle(isolate, super_type());
+  const AbstractType& sup_type = AbstractType::Handle(zone, super_type());
   const TypeArguments& sup_type_args =
-      TypeArguments::Handle(isolate, sup_type.arguments());
+      TypeArguments::Handle(zone, sup_type.arguments());
   if (sup_type_args.IsNull()) {
     // The super type is raw or the super class is non generic.
     // In either case, overlapping is not possible.
@@ -2405,7 +2492,7 @@
   // The super type may not even be resolved yet. This is not necessary, since
   // we only check for matching type parameters, which are resolved by default.
   const TypeArguments& type_params =
-      TypeArguments::Handle(isolate, type_parameters());
+      TypeArguments::Handle(zone, type_parameters());
   // Determine the maximum overlap of a prefix of the vector consisting of the
   // type parameters of this class with a suffix of the vector consisting of the
   // type arguments of the super type of this class.
@@ -2414,8 +2501,8 @@
   // Attempt to overlap the whole vector of type parameters; reduce the size
   // of the vector (keeping the first type parameter) until it fits or until
   // its size is zero.
-  TypeParameter& type_param = TypeParameter::Handle(isolate);
-  AbstractType& sup_type_arg = AbstractType::Handle(isolate);
+  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;
@@ -2457,14 +2544,16 @@
   // To work properly, this call requires the super class of this class to be
   // resolved, which is checked by the type_class() call on the super type.
   // Note that calling type_class() on a MixinAppType fails.
-  Isolate* isolate = Isolate::Current();
-  Class& cls = Class::Handle(isolate);
-  AbstractType& sup_type = AbstractType::Handle(isolate);
+  Thread* thread = Thread::Current();
+  Zone* zone = thread->zone();
+  Isolate* isolate = thread->isolate();
+  Class& cls = Class::Handle(zone);
+  AbstractType& sup_type = AbstractType::Handle(zone);
   cls = raw();
   intptr_t num_type_args = 0;
   do {
     if (cls.IsSignatureClass()) {
-      Function& signature_fun = Function::Handle(isolate);
+      Function& signature_fun = Function::Handle(zone);
       signature_fun ^= cls.signature_function();
       if (!signature_fun.is_static() &&
           !signature_fun.HasInstantiatedSignature()) {
@@ -2509,13 +2598,13 @@
 // Return null otherwise.
 RawTypeParameter* Class::LookupTypeParameter(const String& type_name) const {
   ASSERT(!type_name.IsNull());
-  Isolate* isolate = Isolate::Current();
-  REUSABLE_TYPE_ARGUMENTS_HANDLESCOPE(isolate);
-  REUSABLE_TYPE_PARAMETER_HANDLESCOPE(isolate);
-  REUSABLE_STRING_HANDLESCOPE(isolate);
-  TypeArguments& type_params = isolate->TypeArgumentsHandle();
-  TypeParameter&  type_param = isolate->TypeParameterHandle();
-  String& type_param_name = isolate->StringHandle();
+  Thread* thread = Thread::Current();
+  REUSABLE_TYPE_ARGUMENTS_HANDLESCOPE(thread);
+  REUSABLE_TYPE_PARAMETER_HANDLESCOPE(thread);
+  REUSABLE_STRING_HANDLESCOPE(thread);
+  TypeArguments& type_params = thread->TypeArgumentsHandle();
+  TypeParameter&  type_param = thread->TypeParameterHandle();
+  String& type_param_name = thread->StringHandle();
 
   type_params ^= type_parameters();
   if (!type_params.IsNull()) {
@@ -2582,7 +2671,8 @@
 
 RawFunction* Class::GetInvocationDispatcher(const String& target_name,
                                             const Array& args_desc,
-                                            RawFunction::Kind kind) const {
+                                            RawFunction::Kind kind,
+                                            bool create_if_absent) const {
   enum {
     kNameIndex = 0,
     kArgsDescIndex,
@@ -2612,7 +2702,7 @@
     }
   }
 
-  if (dispatcher.IsNull()) {
+  if (dispatcher.IsNull() && create_if_absent) {
     if (i == cache.Length()) {
       // Allocate new larger cache.
       intptr_t new_len = (cache.Length() == 0)
@@ -2715,7 +2805,7 @@
   virtual void ReportDeoptimization(const Code& code) {
     if (FLAG_trace_deoptimization || FLAG_trace_deoptimization_verbose) {
       Function& function = Function::Handle(code.function());
-      OS::PrintErr("Deoptimizing %s because CHA optimized (%s).\n",
+      THR_Print("Deoptimizing %s because CHA optimized (%s).\n",
           function.ToFullyQualifiedCString(),
           cls_.ToCString());
     }
@@ -2724,10 +2814,10 @@
   virtual void ReportSwitchingCode(const Code& code) {
     if (FLAG_trace_deoptimization || FLAG_trace_deoptimization_verbose) {
       Function& function = Function::Handle(code.function());
-      OS::PrintErr("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());
     }
   }
 
@@ -2738,6 +2828,10 @@
 
 
 void Class::RegisterCHACode(const Code& code) {
+  if (FLAG_trace_cha) {
+    THR_Print("RegisterCHACode %s class %s\n",
+        Function::Handle(code.function()).ToQualifiedCString(), ToCString());
+  }
   ASSERT(code.is_optimized());
   CHACodeArray a(*this);
   a.Register(code);
@@ -2815,7 +2909,8 @@
         new_functions.Add(orig_func);
       }
     } else if (func.UserVisibleSignature() !=
-               orig_func.UserVisibleSignature()) {
+               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(
@@ -2949,16 +3044,21 @@
 
 
 // Ensure that top level parsing of the class has been done.
-RawError* Class::EnsureIsFinalized(Isolate* isolate) const {
+// TODO(24109): Migrate interface to Thread*.
+RawError* Class::EnsureIsFinalized(Thread* thread) const {
   // Finalized classes have already been parsed.
   if (is_finalized()) {
     return Error::null();
   }
-  ASSERT(isolate != NULL);
-  const Error& error = Error::Handle(isolate, Compiler::CompileClass(*this));
-  if (!error.IsNull() && (isolate->long_jump_base() != NULL)) {
-    Report::LongJump(error);
-    UNREACHABLE();
+  ASSERT(thread != NULL);
+  const Error& error = Error::Handle(
+      thread->zone(), Compiler::CompileClass(*this));
+  if (!error.IsNull()) {
+    ASSERT(thread == Thread::Current());
+    if (thread->long_jump_base() != NULL) {
+      Report::LongJump(error);
+      UNREACHABLE();
+    }
   }
   return error.raw();
 }
@@ -2988,36 +3088,34 @@
 }
 
 
-void Class::AddFields(const GrowableObjectArray& new_fields) const {
-  const intptr_t num_new_fields = new_fields.Length();
+void Class::AddFields(const GrowableArray<const Field*>& new_fields) const {
+  const intptr_t num_new_fields = new_fields.length();
   if (num_new_fields == 0) return;
   const Array& arr = Array::Handle(fields());
   const intptr_t num_old_fields = arr.Length();
   const Array& new_arr = Array::Handle(
       Array::Grow(arr, num_old_fields + num_new_fields, Heap::kOld));
-  Field& field = Field::Handle();
   for (intptr_t i = 0; i < num_new_fields; i++) {
-    field ^= new_fields.At(i);
-    new_arr.SetAt(i + num_old_fields, field);
+    new_arr.SetAt(i + num_old_fields, *new_fields.At(i));
   }
   SetFields(new_arr);
 }
 
 
 intptr_t Class::FindFieldIndex(const Field& needle) const {
-  Isolate* isolate = Isolate::Current();
-  if (EnsureIsFinalized(isolate) != Error::null()) {
+  Thread* thread = Thread::Current();
+  if (EnsureIsFinalized(thread) != Error::null()) {
     return -1;
   }
-  REUSABLE_ARRAY_HANDLESCOPE(isolate);
-  REUSABLE_FIELD_HANDLESCOPE(isolate);
-  REUSABLE_STRING_HANDLESCOPE(isolate);
-  Array& fields_array = isolate->ArrayHandle();
-  Field& field = isolate->FieldHandle();
-  String& field_name = isolate->StringHandle();
+  REUSABLE_ARRAY_HANDLESCOPE(thread);
+  REUSABLE_FIELD_HANDLESCOPE(thread);
+  REUSABLE_STRING_HANDLESCOPE(thread);
+  Array& fields_array = thread->ArrayHandle();
+  Field& field = thread->FieldHandle();
+  String& field_name = thread->StringHandle();
   fields_array ^= fields();
   ASSERT(!fields_array.IsNull());
-  String& needle_name = String::Handle(isolate);
+  String& needle_name = String::Handle(thread->zone());
   needle_name ^= needle.name();
   const intptr_t len = fields_array.Length();
   for (intptr_t i = 0; i < len; i++) {
@@ -3564,7 +3662,7 @@
     ASSERT(direct_subclasses.At(i) != subclass.raw());
   }
 #endif
-  direct_subclasses.Add(subclass);
+  direct_subclasses.Add(subclass, Heap::kOld);
 }
 
 
@@ -3589,40 +3687,54 @@
 }
 
 
-intptr_t Class::NumCanonicalTypes() const {
-  if (CanonicalType() != Type::null()) {
-    return 1;
+RawType* Class::CanonicalType() const {
+  if (NumTypeArguments() == 0) {
+    return reinterpret_cast<RawType*>(raw_ptr()->canonical_types_);
   }
-  const Object& types = Object::Handle(canonical_types());
-  if (types.IsNull()) {
-    return 0;
+  Array& types = Array::Handle();
+  types ^= canonical_types();
+  if (!types.IsNull() && (types.Length() > 0)) {
+    return reinterpret_cast<RawType*>(types.At(0));
   }
-  intptr_t num_types = Array::Cast(types).Length();
-  while ((num_types > 0) &&
-         (Array::Cast(types).At(num_types - 1) == Type::null())) {
-    num_types--;
+  return reinterpret_cast<RawType*>(Object::null());
+}
+
+
+void Class::SetCanonicalType(const Type& type) const {
+  ASSERT(type.IsCanonical());
+  if (NumTypeArguments() == 0) {
+    ASSERT((canonical_types() == Object::null()) ||
+           (canonical_types() == type.raw()));  // Set during own finalization.
+    set_canonical_types(type);
+  } else {
+    Array& types = Array::Handle();
+    types ^= canonical_types();
+    ASSERT(!types.IsNull() && (types.Length() > 1));
+    ASSERT((types.At(0) == Object::null()) || (types.At(0) == type.raw()));
+    types.SetAt(0, type);
   }
-  return num_types;
 }
 
 
 intptr_t Class::FindCanonicalTypeIndex(const Type& needle) const {
-  Isolate* isolate = Isolate::Current();
-  if (EnsureIsFinalized(isolate) != Error::null()) {
+  Thread* thread = Thread::Current();
+  if (EnsureIsFinalized(thread) != Error::null()) {
     return -1;
   }
   if (needle.raw() == CanonicalType()) {
+    // For a generic type or signature type, there exists another index with the
+    // same type. It will never be returned by this function.
     return 0;
   }
-  REUSABLE_OBJECT_HANDLESCOPE(isolate);
-  Object& types = isolate->ObjectHandle();
+  REUSABLE_OBJECT_HANDLESCOPE(thread);
+  Object& types = thread->ObjectHandle();
   types = canonical_types();
   if (types.IsNull()) {
     return -1;
   }
   const intptr_t len = Array::Cast(types).Length();
-  REUSABLE_ABSTRACT_TYPE_HANDLESCOPE(isolate);
-  AbstractType& type = isolate->AbstractTypeHandle();
+  REUSABLE_ABSTRACT_TYPE_HANDLESCOPE(thread);
+  AbstractType& type = thread->AbstractTypeHandle();
   for (intptr_t i = 0; i < len; i++) {
     type ^= Array::Cast(types).At(i);
     if (needle.raw() == type.raw()) {
@@ -3669,9 +3781,9 @@
   if (existing_stub.IsNull()) {
     return;
   }
-  ASSERT(!CodePatcher::IsEntryPatched(existing_stub));
-  // Patch the stub so that the next caller will regenerate the stub.
-  CodePatcher::PatchEntry(existing_stub);
+  ASSERT(!existing_stub.IsDisabled());
+  // Change the stub so that the next caller will regenerate the stub.
+  existing_stub.DisableStubCode();
   // Disassociate the existing stub from class.
   StorePointer(&raw_ptr()->allocation_stub_, Code::null());
 }
@@ -3699,11 +3811,12 @@
                                  const TypeArguments& type_arguments,
                                  const Class& other,
                                  const TypeArguments& other_type_arguments,
-                                 Error* bound_error) {
+                                 Error* bound_error,
+                                 Heap::Space space) {
   // Use the thsi object as if it was the receiver of this method, but instead
   // of recursing reset it to the super class and loop.
-  Isolate* isolate = Isolate::Current();
-  Class& thsi = Class::Handle(isolate, cls.raw());
+  Zone* zone = Thread::Current()->zone();
+  Class& thsi = Class::Handle(zone, cls.raw());
   while (true) {
     ASSERT(!thsi.IsVoidClass());
     // Check for DynamicType.
@@ -3756,11 +3869,12 @@
                                      other_type_arguments,
                                      from_index,
                                      num_type_params,
-                                     bound_error);
+                                     bound_error,
+                                     space);
     }
     const bool other_is_function_class = other.IsFunctionClass();
     if (other.IsSignatureClass() || other_is_function_class) {
-      const Function& other_fun = Function::Handle(isolate,
+      const Function& other_fun = Function::Handle(zone,
                                                    other.signature_function());
       if (thsi.IsSignatureClass()) {
         if (other_is_function_class) {
@@ -3768,20 +3882,20 @@
         }
         // Check for two function types.
         const Function& fun =
-            Function::Handle(isolate, thsi.signature_function());
+            Function::Handle(zone, thsi.signature_function());
         return fun.TypeTest(test_kind,
                             type_arguments,
                             other_fun,
                             other_type_arguments,
-                            bound_error);
+                            bound_error,
+                            space);
       }
       // Check if type S has a call() method of function type T.
       Function& function =
-          Function::Handle(isolate,
-                           thsi.LookupDynamicFunction(Symbols::Call()));
+          Function::Handle(zone, thsi.LookupDynamicFunction(Symbols::Call()));
       if (function.IsNull()) {
         // Walk up the super_class chain.
-        Class& cls = Class::Handle(isolate, thsi.SuperClass());
+        Class& cls = Class::Handle(zone, thsi.SuperClass());
         while (!cls.IsNull() && function.IsNull()) {
           function = cls.LookupDynamicFunction(Symbols::Call());
           cls = cls.SuperClass();
@@ -3793,18 +3907,19 @@
                               type_arguments,
                               other_fun,
                               other_type_arguments,
-                              bound_error)) {
+                              bound_error,
+                              space)) {
               return true;
             }
       }
     }
     // Check for 'direct super type' specified in the implements clause
     // and check for transitivity at the same time.
-    Array& interfaces = Array::Handle(isolate, thsi.interfaces());
-    AbstractType& interface = AbstractType::Handle(isolate);
-    Class& interface_class = Class::Handle(isolate);
-    TypeArguments& interface_args = TypeArguments::Handle(isolate);
-    Error& error = Error::Handle(isolate);
+    Array& interfaces = Array::Handle(zone, thsi.interfaces());
+    AbstractType& interface = AbstractType::Handle(zone);
+    Class& interface_class = Class::Handle(zone);
+    TypeArguments& interface_args = TypeArguments::Handle(zone);
+    Error& error = Error::Handle(zone);
     for (intptr_t i = 0; i < interfaces.Length(); i++) {
       interface ^= interfaces.At(i);
       if (!interface.IsFinalized()) {
@@ -3833,7 +3948,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);
+        interface_args =
+            interface_args.InstantiateFrom(type_arguments, &error, NULL, space);
         if (!error.IsNull()) {
           // Return the first bound error to the caller if it requests it.
           if ((bound_error != NULL) && bound_error->IsNull()) {
@@ -3846,7 +3962,8 @@
                                    interface_args,
                                    other,
                                    other_type_arguments,
-                                   bound_error)) {
+                                   bound_error,
+                                   space)) {
         return true;
       }
     }
@@ -3871,13 +3988,15 @@
                      const TypeArguments& type_arguments,
                      const Class& other,
                      const TypeArguments& other_type_arguments,
-                     Error* bound_error) const {
+                     Error* bound_error,
+                     Heap::Space space) const {
   return TypeTestNonRecursive(*this,
                               test_kind,
                               type_arguments,
                               other,
                               other_type_arguments,
-                              bound_error);
+                              bound_error,
+                              space);
 }
 
 
@@ -3994,21 +4113,21 @@
 
 
 RawFunction* Class::LookupFunction(const String& name, MemberKind kind) const {
-  Isolate* isolate = Isolate::Current();
-  if (EnsureIsFinalized(isolate) != Error::null()) {
+  Thread* thread = Thread::Current();
+  if (EnsureIsFinalized(thread) != Error::null()) {
     return Function::null();
   }
-  REUSABLE_ARRAY_HANDLESCOPE(isolate);
-  REUSABLE_FUNCTION_HANDLESCOPE(isolate);
-  Array& funcs = isolate->ArrayHandle();
+  REUSABLE_ARRAY_HANDLESCOPE(thread);
+  REUSABLE_FUNCTION_HANDLESCOPE(thread);
+  Array& funcs = thread->ArrayHandle();
   funcs ^= functions();
   ASSERT(!funcs.IsNull());
   const intptr_t len = funcs.Length();
-  Function& function = isolate->FunctionHandle();
+  Function& function = thread->FunctionHandle();
   if (len >= kFunctionLookupHashTreshold) {
     ClassFunctionsSet set(raw_ptr()->functions_hash_table_);
-    REUSABLE_STRING_HANDLESCOPE(isolate);
-    function ^= set.GetOrNull(FunctionName(name, &(isolate->StringHandle())));
+    REUSABLE_STRING_HANDLESCOPE(thread);
+    function ^= set.GetOrNull(FunctionName(name, &(thread->StringHandle())));
     // No mutations.
     ASSERT(set.Release().raw() == raw_ptr()->functions_hash_table_);
     return function.IsNull() ? Function::null()
@@ -4024,8 +4143,8 @@
       }
     }
   } else {
-    REUSABLE_STRING_HANDLESCOPE(isolate);
-    String& function_name = isolate->StringHandle();
+    REUSABLE_STRING_HANDLESCOPE(thread);
+    String& function_name = thread->StringHandle();
     for (intptr_t i = 0; i < len; i++) {
       function ^= funcs.At(i);
       function_name ^= function.name();
@@ -4041,19 +4160,19 @@
 
 RawFunction* Class::LookupFunctionAllowPrivate(const String& name,
                                                MemberKind kind) const {
-  Isolate* isolate = Isolate::Current();
-  if (EnsureIsFinalized(isolate) != Error::null()) {
+  Thread* thread = Thread::Current();
+  if (EnsureIsFinalized(thread) != Error::null()) {
     return Function::null();
   }
-  REUSABLE_ARRAY_HANDLESCOPE(isolate);
-  REUSABLE_FUNCTION_HANDLESCOPE(isolate);
-  REUSABLE_STRING_HANDLESCOPE(isolate);
-  Array& funcs = isolate->ArrayHandle();
+  REUSABLE_ARRAY_HANDLESCOPE(thread);
+  REUSABLE_FUNCTION_HANDLESCOPE(thread);
+  REUSABLE_STRING_HANDLESCOPE(thread);
+  Array& funcs = thread->ArrayHandle();
   funcs ^= functions();
   ASSERT(!funcs.IsNull());
   const intptr_t len = funcs.Length();
-  Function& function = isolate->FunctionHandle();
-  String& function_name = isolate->StringHandle();
+  Function& function = thread->FunctionHandle();
+  String& function_name = thread->StringHandle();
   for (intptr_t i = 0; i < len; i++) {
     function ^= funcs.At(i);
     function_name ^= function.name();
@@ -4079,18 +4198,18 @@
 RawFunction* Class::LookupAccessorFunction(const char* prefix,
                                            intptr_t prefix_length,
                                            const String& name) const {
-  Isolate* isolate = Isolate::Current();
-  if (EnsureIsFinalized(isolate) != Error::null()) {
+  Thread* thread = Thread::Current();
+  if (EnsureIsFinalized(thread) != Error::null()) {
     return Function::null();
   }
-  REUSABLE_ARRAY_HANDLESCOPE(isolate);
-  REUSABLE_FUNCTION_HANDLESCOPE(isolate);
-  REUSABLE_STRING_HANDLESCOPE(isolate);
-  Array& funcs = isolate->ArrayHandle();
+  REUSABLE_ARRAY_HANDLESCOPE(thread);
+  REUSABLE_FUNCTION_HANDLESCOPE(thread);
+  REUSABLE_STRING_HANDLESCOPE(thread);
+  Array& funcs = thread->ArrayHandle();
   funcs ^= functions();
   intptr_t len = funcs.Length();
-  Function& function = isolate->FunctionHandle();
-  String& function_name = isolate->StringHandle();
+  Function& function = thread->FunctionHandle();
+  String& function_name = thread->StringHandle();
   for (intptr_t i = 0; i < len; i++) {
     function ^= funcs.At(i);
     function_name ^= function.name();
@@ -4107,16 +4226,17 @@
 RawFunction* Class::LookupFunctionAtToken(intptr_t token_pos) const {
   // TODO(hausner): we can shortcut the negative case if we knew the
   // beginning and end token position of the class.
-  Isolate* isolate = Isolate::Current();
-  if (EnsureIsFinalized(isolate) != Error::null()) {
+  Thread* thread = Thread::Current();
+  Zone* zone = thread->zone();
+  if (EnsureIsFinalized(thread) != Error::null()) {
     return Function::null();
   }
-  Function& func = Function::Handle(isolate);
+  Function& func = Function::Handle(zone);
   func = LookupClosureFunction(token_pos);
   if (!func.IsNull()) {
     return func.raw();
   }
-  Array& funcs = Array::Handle(isolate, functions());
+  Array& funcs = Array::Handle(zone, functions());
   intptr_t len = funcs.Length();
   for (intptr_t i = 0; i < len; i++) {
     func ^= funcs.At(i);
@@ -4146,19 +4266,19 @@
 
 
 RawField* Class::LookupField(const String& name, MemberKind kind) const {
-  Isolate* isolate = Isolate::Current();
-  if (EnsureIsFinalized(isolate) != Error::null()) {
+  Thread* thread = Thread::Current();
+  if (EnsureIsFinalized(thread) != Error::null()) {
     return Field::null();
   }
-  REUSABLE_ARRAY_HANDLESCOPE(isolate);
-  REUSABLE_FIELD_HANDLESCOPE(isolate);
-  REUSABLE_STRING_HANDLESCOPE(isolate);
-  Array& flds = isolate->ArrayHandle();
+  REUSABLE_ARRAY_HANDLESCOPE(thread);
+  REUSABLE_FIELD_HANDLESCOPE(thread);
+  REUSABLE_STRING_HANDLESCOPE(thread);
+  Array& flds = thread->ArrayHandle();
   flds ^= fields();
   ASSERT(!flds.IsNull());
   intptr_t len = flds.Length();
-  Field& field = isolate->FieldHandle();
-  String& field_name = isolate->StringHandle();
+  Field& field = thread->FieldHandle();
+  String& field_name = thread->StringHandle();
   for (intptr_t i = 0; i < len; i++) {
     field ^= flds.At(i);
     field_name ^= field.name();
@@ -4183,9 +4303,9 @@
 
 
 RawLibraryPrefix* Class::LookupLibraryPrefix(const String& name) const {
-  Isolate* isolate = Isolate::Current();
-  const Library& lib = Library::Handle(isolate, library());
-  const Object& obj = Object::Handle(isolate, lib.LookupLocalObject(name));
+  Zone* zone = Thread::Current()->zone();
+  const Library& lib = Library::Handle(zone, library());
+  const Object& obj = Object::Handle(zone, lib.LookupLocalObject(name));
   if (!obj.IsNull() && obj.IsLibraryPrefix()) {
     return LibraryPrefix::Cast(obj).raw();
   }
@@ -4194,14 +4314,12 @@
 
 
 const char* Class::ToCString() const {
-  const char* format = "%s Class: %s";
   const Library& lib = Library::Handle(library());
   const char* library_name = lib.IsNull() ? "" : lib.ToCString();
+  const char* patch_prefix = is_patch() ? "Patch " : "";
   const char* class_name = String::Handle(Name()).ToCString();
-  intptr_t len = OS::SNPrint(NULL, 0, format, library_name, class_name) + 1;
-  char* chars = Thread::Current()->zone()->Alloc<char>(len);
-  OS::SNPrint(chars, len, format, library_name, class_name);
-  return chars;
+  return OS::SCreate(Thread::Current()->zone(),
+      "%s %sClass: %s", library_name, patch_prefix, class_name);
 }
 
 
@@ -4222,7 +4340,7 @@
     return;
   }
 
-  const Error& err = Error::Handle(EnsureIsFinalized(Isolate::Current()));
+  const Error& err = Error::Handle(EnsureIsFinalized(Thread::Current()));
   if (!err.IsNull()) {
     jsobj.AddProperty("error", err);
   }
@@ -4358,10 +4476,12 @@
     const LibraryPrefix& lib_prefix = LibraryPrefix::Handle(library_prefix());
     String& name = String::Handle();
     name = lib_prefix.name();  // Qualifier.
-    name = String::Concat(name, Symbols::Dot());
-    const String& str = String::Handle(ident());
-    name = String::Concat(name, str);
-    return name.raw();
+    Zone* zone = Thread::Current()->zone();
+    GrowableHandlePtrArray<const String> strs(zone, 3);
+    strs.Add(name);
+    strs.Add(Symbols::Dot());
+    strs.Add(String::Handle(zone, ident()));
+    return Symbols::FromConcatAll(strs);
   } else {
     return ident();
   }
@@ -4369,12 +4489,9 @@
 
 
 const char* UnresolvedClass::ToCString() const {
-  const char* format = "unresolved class '%s'";
   const char* cname =  String::Handle(Name()).ToCString();
-  intptr_t len = OS::SNPrint(NULL, 0, format, cname) + 1;
-  char* chars = Thread::Current()->zone()->Alloc<char>(len);
-  OS::SNPrint(chars, len, format, cname);
-  return chars;
+  return OS::SCreate(Thread::Current()->zone(),
+      "unresolved class '%s'", cname);
 }
 
 
@@ -4418,32 +4535,31 @@
 RawString* TypeArguments::SubvectorName(intptr_t from_index,
                                         intptr_t len,
                                         NameVisibility name_visibility) const {
+  Zone* zone = Thread::Current()->zone();
   ASSERT(from_index + len <= Length());
-  String& name = String::Handle();
+  String& name = String::Handle(zone);
   const intptr_t num_strings = (len == 0) ? 2 : 2*len + 1;  // "<""T"", ""T"">".
-  const Array& strings = Array::Handle(Array::New(num_strings));
-  intptr_t s = 0;
-  strings.SetAt(s++, Symbols::LAngleBracket());
+  GrowableHandlePtrArray<const String> pieces(zone, num_strings);
+  pieces.Add(Symbols::LAngleBracket());
   AbstractType& type = AbstractType::Handle();
   for (intptr_t i = 0; i < len; i++) {
     type = TypeAt(from_index + i);
     name = type.BuildName(name_visibility);
-    strings.SetAt(s++, name);
+    pieces.Add(name);
     if (i < len - 1) {
-      strings.SetAt(s++, Symbols::CommaSpace());
+      pieces.Add(Symbols::CommaSpace());
     }
   }
-  strings.SetAt(s++, Symbols::RAngleBracket());
-  ASSERT(s == num_strings);
-  name = String::ConcatAll(strings);
-  return Symbols::New(name);
+  pieces.Add(Symbols::RAngleBracket());
+  ASSERT(pieces.length() == num_strings);
+  return Symbols::FromConcatAll(pieces);
 }
 
 
 bool TypeArguments::IsSubvectorEquivalent(const TypeArguments& other,
                                           intptr_t from_index,
                                           intptr_t len,
-                                          GrowableObjectArray* trail) const {
+                                          TrailPtr trail) const {
   if (this->raw() == other.raw()) {
     return true;
   }
@@ -4514,7 +4630,8 @@
                              const TypeArguments& other,
                              intptr_t from_index,
                              intptr_t len,
-                             Error* bound_error) const {
+                             Error* bound_error,
+                             Heap::Space space) const {
   ASSERT(Length() >= (from_index + len));
   ASSERT(!other.IsNull());
   ASSERT(other.Length() >= (from_index + len));
@@ -4525,7 +4642,7 @@
     ASSERT(!type.IsNull());
     other_type = other.TypeAt(from_index + i);
     ASSERT(!other_type.IsNull());
-    if (!type.TypeTest(test_kind, other_type, bound_error)) {
+    if (!type.TypeTest(test_kind, other_type, bound_error, space)) {
       return false;
     }
   }
@@ -4640,7 +4757,7 @@
 
 bool TypeArguments::IsSubvectorInstantiated(intptr_t from_index,
                                             intptr_t len,
-                                            GrowableObjectArray* trail) const {
+                                            TrailPtr trail) const {
   ASSERT(!IsNull());
   AbstractType& type = AbstractType::Handle();
   for (intptr_t i = 0; i < len; i++) {
@@ -4798,7 +4915,8 @@
 RawTypeArguments* TypeArguments::InstantiateFrom(
     const TypeArguments& instantiator_type_arguments,
     Error* bound_error,
-    GrowableObjectArray* trail) const {
+    TrailPtr trail,
+    Heap::Space space) const {
   ASSERT(!IsInstantiated());
   if (!instantiator_type_arguments.IsNull() &&
       IsUninstantiatedIdentity() &&
@@ -4807,7 +4925,7 @@
   }
   const intptr_t num_types = Length();
   TypeArguments& instantiated_array =
-      TypeArguments::Handle(TypeArguments::New(num_types, Heap::kNew));
+      TypeArguments::Handle(TypeArguments::New(num_types, space));
   AbstractType& type = AbstractType::Handle();
   for (intptr_t i = 0; i < num_types; i++) {
     type = TypeAt(i);
@@ -4820,7 +4938,8 @@
     if (!type.IsNull() && !type.IsInstantiated()) {
       type = type.InstantiateFrom(instantiator_type_arguments,
                                   bound_error,
-                                  trail);
+                                  trail,
+                                  space);
     }
     instantiated_array.SetTypeAt(i, type);
   }
@@ -4921,15 +5040,17 @@
 }
 
 
-static void GrowCanonicalTypeArguments(Isolate* isolate, const Array& table) {
+static void GrowCanonicalTypeArguments(Thread* thread, const Array& table) {
+  Isolate* isolate = thread->isolate();
+  Zone* zone = thread->zone();
   // Last element of the array is the number of used elements.
   const intptr_t table_size = table.Length() - 1;
   const intptr_t new_table_size = table_size * 2;
-  Array& new_table = Array::Handle(isolate, Array::New(new_table_size + 1));
+  Array& new_table = Array::Handle(zone, Array::New(new_table_size + 1));
   // Copy all elements from the original table to the newly allocated
   // array.
-  TypeArguments& element = TypeArguments::Handle(isolate);
-  Object& new_element = Object::Handle(isolate);
+  TypeArguments& element = TypeArguments::Handle(zone);
+  Object& new_element = Object::Handle(zone);
   for (intptr_t i = 0; i < table_size; i++) {
     element ^= table.At(i);
     if (!element.IsNull()) {
@@ -4952,10 +5073,11 @@
 }
 
 
-static void InsertIntoCanonicalTypeArguments(Isolate* isolate,
+static void InsertIntoCanonicalTypeArguments(Thread* thread,
                                              const Array& table,
                                              const TypeArguments& arguments,
                                              intptr_t index) {
+  Zone* zone = thread->zone();
   arguments.SetCanonical();  // Mark object as being canonical.
   table.SetAt(index, arguments);  // Remember the new element.
   // Update used count.
@@ -4963,7 +5085,7 @@
   const intptr_t table_size = table.Length() - 1;
   const intptr_t used_elements =
       Smi::Value(Smi::RawCast(table.At(table_size))) + 1;
-  const Smi& used = Smi::Handle(isolate, Smi::New(used_elements));
+  const Smi& used = Smi::Handle(zone, Smi::New(used_elements));
   table.SetAt(table_size, used);
 
 #ifdef DEBUG
@@ -4986,13 +5108,13 @@
 
   // Rehash if table is 75% full.
   if (used_elements > ((table_size / 4) * 3)) {
-    GrowCanonicalTypeArguments(isolate, table);
+    GrowCanonicalTypeArguments(thread, table);
   }
 }
 
 
 static intptr_t FindIndexInCanonicalTypeArguments(
-    Isolate* isolate,
+    Zone* zone,
     const Array& table,
     const TypeArguments& arguments,
     intptr_t hash) {
@@ -5001,7 +5123,7 @@
   ASSERT(Utils::IsPowerOfTwo(table_size));
   intptr_t index = hash & (table_size - 1);
 
-  TypeArguments& current = TypeArguments::Handle(isolate);
+  TypeArguments& current = TypeArguments::Handle(zone);
   current ^= table.At(index);
   while (!current.IsNull() && !current.Equals(arguments)) {
     index = (index + 1) & (table_size - 1);  // Move to next element.
@@ -5032,7 +5154,7 @@
 
 RawTypeArguments* TypeArguments::CloneUninstantiated(
     const Class& new_owner,
-    GrowableObjectArray* trail) const {
+    TrailPtr trail) const {
   ASSERT(!IsNull());
   ASSERT(IsFinalized());
   ASSERT(!IsInstantiated());
@@ -5052,8 +5174,7 @@
 }
 
 
-RawTypeArguments* TypeArguments::Canonicalize(
-    GrowableObjectArray* trail) const {
+RawTypeArguments* TypeArguments::Canonicalize(TrailPtr trail) const {
   if (IsNull() || IsCanonical()) {
     ASSERT(IsOld());
     return this->raw();
@@ -5062,21 +5183,22 @@
   if (IsRaw(0, num_types)) {
     return TypeArguments::null();
   }
-  Isolate* isolate = Isolate::Current();
+  Thread* thread = Thread::Current();
+  Zone* zone = thread->zone();
+  Isolate* isolate = thread->isolate();
   ObjectStore* object_store = isolate->object_store();
-  Array& table = Array::Handle(isolate,
+  Array& table = Array::Handle(zone,
                                object_store->canonical_type_arguments());
   // Last element of the array is the number of used elements.
   const intptr_t num_used =
       Smi::Value(Smi::RawCast(table.At(table.Length() - 1)));
   const intptr_t hash = Hash();
-  intptr_t index =
-      FindIndexInCanonicalTypeArguments(isolate, table, *this, hash);
-  TypeArguments& result = TypeArguments::Handle(isolate);
+  intptr_t index = FindIndexInCanonicalTypeArguments(zone, table, *this, hash);
+  TypeArguments& result = TypeArguments::Handle(zone);
   result ^= table.At(index);
   if (result.IsNull()) {
     // Canonicalize each type argument.
-    AbstractType& type_arg = AbstractType::Handle(isolate);
+    AbstractType& type_arg = AbstractType::Handle(zone);
     for (intptr_t i = 0; i < num_types; i++) {
       type_arg = TypeAt(i);
       type_arg = type_arg.Canonicalize(trail);
@@ -5094,7 +5216,7 @@
     if ((canonical_hash != hash) ||
         (Smi::Value(Smi::RawCast(table.At(table.Length() - 1))) != num_used)) {
       index = FindIndexInCanonicalTypeArguments(
-          isolate, table, *this, canonical_hash);
+          zone, table, *this, canonical_hash);
       result ^= table.At(index);
     }
     if (result.IsNull()) {
@@ -5105,7 +5227,7 @@
         result ^= this->raw();
       }
       ASSERT(result.IsOld());
-      InsertIntoCanonicalTypeArguments(isolate, table, result, index);
+      InsertIntoCanonicalTypeArguments(thread, table, result, index);
     }
   }
   ASSERT(result.Equals(*this));
@@ -5120,14 +5242,12 @@
   if (IsNull()) {
     return "NULL TypeArguments";
   }
-  const char* format = "%s [%s]";
   const char* prev_cstr = "TypeArguments:";
   for (int i = 0; i < Length(); i++) {
     const AbstractType& type_at = AbstractType::Handle(TypeAt(i));
     const char* type_cstr = type_at.IsNull() ? "null" : type_at.ToCString();
-    intptr_t len = OS::SNPrint(NULL, 0, format, prev_cstr, type_cstr) + 1;
-    char* chars = Thread::Current()->zone()->Alloc<char>(len);
-    OS::SNPrint(chars, len, format, prev_cstr, type_cstr);
+    char* chars = OS::SCreate(Thread::Current()->zone(),
+        "%s [%s]", prev_cstr, type_cstr);
     prev_cstr = chars;
   }
   return prev_cstr;
@@ -5135,13 +5255,10 @@
 
 
 const char* PatchClass::ToCString() const {
-  const char* kFormat = "PatchClass for %s";
   const Class& cls = Class::Handle(patched_class());
   const char* cls_name = cls.ToCString();
-  intptr_t len = OS::SNPrint(NULL, 0, kFormat, cls_name) + 1;
-  char* chars = Thread::Current()->zone()->Alloc<char>(len);
-  OS::SNPrint(chars, len, kFormat, cls_name);
-  return chars;
+  return OS::SCreate(Thread::Current()->zone(),
+      "PatchClass for %s", cls_name);
 }
 
 
@@ -5190,7 +5307,8 @@
 
 
 void Function::SetInstructions(const Code& value) const {
-  StorePointer(&raw_ptr()->instructions_, value.instructions());
+  StorePointer(&raw_ptr()->code_, value.raw());
+  StoreNonPointer(&raw_ptr()->entry_point_, value.EntryPoint());
 }
 
 void Function::AttachCode(const Code& value) const {
@@ -5202,17 +5320,15 @@
 
 
 bool Function::HasCode() const {
-  ASSERT(raw_ptr()->instructions_ != Instructions::null());
-  return raw_ptr()->instructions_ !=
-      StubCode::LazyCompile_entry()->code()->ptr()->instructions_;
+  ASSERT(raw_ptr()->code_ != Code::null());
+  return raw_ptr()->code_ != StubCode::LazyCompile_entry()->code();
 }
 
 
 void Function::ClearCode() const {
-  ASSERT(ic_data_array() == Array::null());
+  ASSERT((usage_counter() != 0) || (ic_data_array() == Array::null()));
   StorePointer(&raw_ptr()->unoptimized_code_, Code::null());
-  StorePointer(&raw_ptr()->instructions_,
-      Code::Handle(StubCode::LazyCompile_entry()->code()).instructions());
+  SetInstructions(Code::Handle(StubCode::LazyCompile_entry()->code()));
 }
 
 
@@ -5224,12 +5340,11 @@
   const Code& current_code = Code::Handle(zone, CurrentCode());
 
   if (FLAG_trace_deoptimization_verbose) {
-    OS::Print("Disabling optimized code: '%s' entry: %#" Px "\n",
+    THR_Print("Disabling optimized code: '%s' entry: %#" Px "\n",
       ToFullyQualifiedCString(),
       current_code.EntryPoint());
   }
-  // Patch entry of the optimized code.
-  CodePatcher::PatchEntry(current_code);
+  current_code.DisableDartCode();
   const Error& error = Error::Handle(zone,
       Compiler::EnsureUnoptimizedCode(thread, *this));
   if (!error.IsNull()) {
@@ -5237,7 +5352,7 @@
   }
   const Code& unopt_code = Code::Handle(zone, unoptimized_code());
   AttachCode(unopt_code);
-  CodePatcher::RestoreEntry(unopt_code);
+  unopt_code.Enable();
   isolate->TrackDeoptimizedCode(current_code);
 }
 
@@ -5554,24 +5669,27 @@
 
 RawJSRegExp* Function::regexp() const {
   ASSERT(kind() == RawFunction::kIrregexpFunction);
-  const Object& obj = Object::Handle(raw_ptr()->data_);
-  return JSRegExp::Cast(obj).raw();
+  const Array& pair = Array::Cast(Object::Handle(raw_ptr()->data_));
+  return JSRegExp::RawCast(pair.At(0));
 }
 
 
-void Function::set_regexp(const JSRegExp& value) const {
+intptr_t Function::string_specialization_cid() const {
   ASSERT(kind() == RawFunction::kIrregexpFunction);
-  ASSERT(raw_ptr()->data_ == Object::null());
-  set_data(value);
+  const Array& pair = Array::Cast(Object::Handle(raw_ptr()->data_));
+  return Smi::Value(Smi::RawCast(pair.At(1)));
 }
 
 
-void Function::set_regexp_cid(intptr_t regexp_cid) const {
-    ASSERT((regexp_cid == kIllegalCid) ||
-           (kind() == RawFunction::kIrregexpFunction));
-    ASSERT((regexp_cid == kIllegalCid) ||
-           RawObject::IsStringClassId(regexp_cid));
-    StoreNonPointer(&raw_ptr()->regexp_cid_, regexp_cid);
+void Function::SetRegExpData(const JSRegExp& regexp,
+                             intptr_t string_specialization_cid) 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)));
+  set_data(pair);
 }
 
 
@@ -5764,7 +5882,9 @@
                   "%" Pd " named passed, at most %" Pd " expected",
                   num_named_arguments,
                   NumOptionalNamedParameters());
-      *error_message = String::New(message_buffer);
+      // Allocate in old space because it can be invoked in background
+      // optimizing compilation.
+      *error_message = String::New(message_buffer, Heap::kOld);
     }
     return false;  // Too many named arguments.
   }
@@ -5784,7 +5904,9 @@
                   num_opt_pos_params > 0 ? " positional" : "",
                   num_opt_pos_params > 0 ? "at most " : "",
                   num_pos_params - num_hidden_params);
-      *error_message = String::New(message_buffer);
+      // Allocate in old space because it can be invoked in background
+      // optimizing compilation.
+      *error_message = String::New(message_buffer, Heap::kOld);
     }
     return false;  // Too many fixed and/or positional arguments.
   }
@@ -5801,7 +5923,9 @@
                   num_opt_pos_params > 0 ? " positional" : "",
                   num_opt_pos_params > 0 ? "at least " : "",
                   num_fixed_parameters() - num_hidden_params);
-      *error_message = String::New(message_buffer);
+      // Allocate in old space because it can be invoked in background
+      // optimizing compilation.
+      *error_message = String::New(message_buffer, Heap::kOld);
     }
     return false;  // Too few fixed and/or positional arguments.
   }
@@ -5820,9 +5944,9 @@
     return false;
   }
   // Verify that all argument names are valid parameter names.
-  Isolate* isolate = Isolate::Current();
-  String& argument_name = String::Handle(isolate);
-  String& parameter_name = String::Handle(isolate);
+  Zone* zone = Thread::Current()->zone();
+  String& argument_name = String::Handle(zone);
+  String& parameter_name = String::Handle(zone);
   for (intptr_t i = 0; i < num_named_arguments; i++) {
     argument_name ^= argument_names.At(i);
     ASSERT(argument_name.IsSymbol());
@@ -5846,7 +5970,9 @@
                     kMessageBufferSize,
                     "no optional formal parameter named '%s'",
                     argument_name.ToCString());
-        *error_message = String::New(message_buffer);
+        // Allocate in old space because it can be invoked in background
+        // optimizing compilation.
+        *error_message = String::New(message_buffer, Heap::kOld);
       }
       return false;
     }
@@ -5866,9 +5992,9 @@
     return false;
   }
   // Verify that all argument names are valid parameter names.
-  Isolate* isolate = Isolate::Current();
-  String& argument_name = String::Handle(isolate);
-  String& parameter_name = String::Handle(isolate);
+  Zone* zone = Thread::Current()->zone();
+  String& argument_name = String::Handle(zone);
+  String& parameter_name = String::Handle(zone);
   for (intptr_t i = 0; i < num_named_arguments; i++) {
     argument_name ^= args_desc.NameAt(i);
     ASSERT(argument_name.IsSymbol());
@@ -5892,7 +6018,9 @@
                     kMessageBufferSize,
                     "no optional formal parameter named '%s'",
                     argument_name.ToCString());
-        *error_message = String::New(message_buffer);
+        // Allocate in old space because it can be invoked in background
+        // optimizing compilation.
+        *error_message = String::New(message_buffer, Heap::kOld);
       }
       return false;
     }
@@ -6006,7 +6134,8 @@
   // 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)) {
+                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(
@@ -6048,12 +6177,15 @@
     const TypeArguments& type_arguments,
     const Function& other,
     const TypeArguments& other_type_arguments,
-    Error* bound_error) const {
+    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);
+                                                        bound_error,
+                                                        NULL,  // trail
+                                                        space);
     ASSERT((bound_error == NULL) || bound_error->IsNull());
   }
   if (other_param_type.IsDynamicType()) {
@@ -6062,20 +6194,21 @@
   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 /*trail*/, space);
     ASSERT((bound_error == NULL) || bound_error->IsNull());
   }
   if (param_type.IsDynamicType()) {
     return test_kind == kIsSubtypeOf;
   }
   if (test_kind == kIsSubtypeOf) {
-    if (!param_type.IsSubtypeOf(other_param_type, bound_error) &&
-        !other_param_type.IsSubtypeOf(param_type, bound_error)) {
+    if (!param_type.IsSubtypeOf(other_param_type, bound_error, space) &&
+        !other_param_type.IsSubtypeOf(param_type, bound_error, space)) {
       return false;
     }
   } else {
     ASSERT(test_kind == kIsMoreSpecificThan);
-    if (!param_type.IsMoreSpecificThan(other_param_type, bound_error)) {
+    if (!param_type.IsMoreSpecificThan(other_param_type, bound_error, space)) {
       return false;
     }
   }
@@ -6087,7 +6220,8 @@
                         const TypeArguments& type_arguments,
                         const Function& other,
                         const TypeArguments& other_type_arguments,
-                        Error* bound_error) const {
+                        Error* bound_error,
+                        Heap::Space space) const {
   const intptr_t num_fixed_params = num_fixed_parameters();
   const intptr_t num_opt_pos_params = NumOptionalPositionalParameters();
   const intptr_t num_opt_named_params = NumOptionalNamedParameters();
@@ -6145,7 +6279,8 @@
     if (!TestParameterType(test_kind,
                            i + num_ignored_params, i + other_num_ignored_params,
                            type_arguments, other, other_type_arguments,
-                           bound_error)) {
+                           bound_error,
+                           space)) {
       return false;
     }
   }
@@ -6176,7 +6311,8 @@
         if (!TestParameterType(test_kind,
                                j, i,
                                type_arguments, other, other_type_arguments,
-                               bound_error)) {
+                               bound_error,
+                               space)) {
           return false;
         }
         break;
@@ -6274,7 +6410,6 @@
   result.set_num_optional_parameters(0);
   result.set_usage_counter(0);
   result.set_deoptimization_counter(0);
-  result.set_regexp_cid(kIllegalCid);
   result.set_optimized_instruction_count(0);
   result.set_optimized_call_site_count(0);
   result.set_is_optimizable(is_native ? false : true);
@@ -6302,7 +6437,6 @@
   clone.ClearCode();
   clone.set_usage_counter(0);
   clone.set_deoptimization_counter(0);
-  clone.set_regexp_cid(kIllegalCid);
   clone.set_optimized_instruction_count(0);
   clone.set_optimized_call_site_count(0);
   if (new_owner.NumTypeParameters() > 0) {
@@ -6378,13 +6512,13 @@
       NewClosureFunction(closure_name, *this, token_pos()));
 
   // Set closure function's context scope.
-  ContextScope& context_scope = ContextScope::Handle();
   if (is_static()) {
-    context_scope = ContextScope::New(0);
+    closure_function.set_context_scope(Object::empty_context_scope());
   } else {
-    context_scope = LocalScope::CreateImplicitClosureScope(*this);
+    const ContextScope& context_scope =
+        ContextScope::Handle(LocalScope::CreateImplicitClosureScope(*this));
+    closure_function.set_context_scope(context_scope);
   }
-  closure_function.set_context_scope(context_scope);
 
   // Set closure function's result type to this result type.
   closure_function.set_result_type(AbstractType::Handle(result_type()));
@@ -6444,6 +6578,9 @@
   } else {
     closure_function.set_signature_class(signature_class);
   }
+  // Finalize types in signature class here, so that the
+  // signature type is not computed twice.
+  ClassFinalizer::FinalizeTypesInClass(signature_class);
   const Type& signature_type = Type::Handle(signature_class.SignatureType());
   if (!signature_type.IsFinalized()) {
     ClassFinalizer::FinalizeType(
@@ -6457,12 +6594,12 @@
 
 
 RawString* Function::UserVisibleFormalParameters() const {
-  const GrowableObjectArray& pieces =
-      GrowableObjectArray::Handle(GrowableObjectArray::New());
+  // Typically 3, 5,.. elements in 'pieces', e.g.:
+  // '_LoadRequest', CommaSpace, '_LoadError'.
+  GrowableHandlePtrArray<const String> pieces(Thread::Current()->zone(), 5);
   const TypeArguments& instantiator = TypeArguments::Handle();
-  BuildSignatureParameters(false, kUserVisibleName, instantiator, pieces);
-  const Array& strings = Array::Handle(Array::MakeArray(pieces));
-  return String::ConcatAll(strings);
+  BuildSignatureParameters(false, kUserVisibleName, instantiator, &pieces);
+  return Symbols::FromConcatAll(pieces);
 }
 
 
@@ -6470,20 +6607,23 @@
     bool instantiate,
     NameVisibility name_visibility,
     const TypeArguments& instantiator,
-    const GrowableObjectArray& pieces) const {
-  AbstractType& param_type = AbstractType::Handle();
+    GrowableHandlePtrArray<const String>* pieces) const {
+  Thread* thread = Thread::Current();
+  Zone* zone = thread->zone();
+
+  AbstractType& param_type = AbstractType::Handle(zone);
   const intptr_t num_params = NumParameters();
   const intptr_t num_fixed_params = num_fixed_parameters();
   const intptr_t num_opt_pos_params = NumOptionalPositionalParameters();
   const intptr_t num_opt_named_params = NumOptionalNamedParameters();
   const intptr_t num_opt_params = num_opt_pos_params + num_opt_named_params;
   ASSERT((num_fixed_params + num_opt_params) == num_params);
-  String& name = String::Handle();
   intptr_t i = 0;
   if (name_visibility == kUserVisibleName) {
     // Hide implicit parameters.
     i = NumImplicitParameters();
   }
+  String& name = String::Handle(zone);
   while (i < num_fixed_params) {
     param_type = ParameterTypeAt(i);
     ASSERT(!param_type.IsNull());
@@ -6491,25 +6631,25 @@
       param_type = param_type.InstantiateFrom(instantiator, NULL);
     }
     name = param_type.BuildName(name_visibility);
-    pieces.Add(name);
+    pieces->Add(name);
     if (i != (num_params - 1)) {
-      pieces.Add(Symbols::CommaSpace());
+      pieces->Add(Symbols::CommaSpace());
     }
     i++;
   }
   if (num_opt_params > 0) {
     if (num_opt_pos_params > 0) {
-      pieces.Add(Symbols::LBracket());
+      pieces->Add(Symbols::LBracket());
     } else {
-      pieces.Add(Symbols::LBrace());
+      pieces->Add(Symbols::LBrace());
     }
     for (intptr_t i = num_fixed_params; i < num_params; i++) {
       // The parameter name of an optional positional parameter does not need
       // to be part of the signature, since it is not used.
       if (num_opt_named_params > 0) {
         name = ParameterNameAt(i);
-        pieces.Add(name);
-        pieces.Add(Symbols::ColonSpace());
+        pieces->Add(name);
+        pieces->Add(Symbols::ColonSpace());
       }
       param_type = ParameterTypeAt(i);
       if (instantiate && !param_type.IsInstantiated()) {
@@ -6517,15 +6657,15 @@
       }
       ASSERT(!param_type.IsNull());
       name = param_type.BuildName(name_visibility);
-      pieces.Add(name);
+      pieces->Add(name);
       if (i != (num_params - 1)) {
-        pieces.Add(Symbols::CommaSpace());
+        pieces->Add(Symbols::CommaSpace());
       }
     }
     if (num_opt_pos_params > 0) {
-      pieces.Add(Symbols::RBracket());
+      pieces->Add(Symbols::RBracket());
     } else {
-      pieces.Add(Symbols::RBrace());
+      pieces->Add(Symbols::RBrace());
     }
   }
 }
@@ -6533,12 +6673,14 @@
 
 RawInstance* Function::ImplicitStaticClosure() const {
   if (implicit_static_closure() == Instance::null()) {
-    Isolate* isolate = Isolate::Current();
+    Thread* thread = Thread::Current();
+    Isolate* isolate = thread->isolate();
+    Zone* zone = thread->zone();
     ObjectStore* object_store = isolate->object_store();
     const Context& context =
-        Context::Handle(isolate, object_store->empty_context());
+        Context::Handle(zone, object_store->empty_context());
     Instance& closure =
-        Instance::Handle(isolate, Closure::New(*this, context, Heap::kOld));
+        Instance::Handle(zone, Closure::New(*this, context, Heap::kOld));
     const char* error_str = NULL;
     closure ^= closure.CheckAndCanonicalize(&error_str);
     ASSERT(!closure.IsNull());
@@ -6566,25 +6708,27 @@
 RawString* Function::BuildSignature(bool instantiate,
                                     NameVisibility name_visibility,
                                     const TypeArguments& instantiator) const {
-  const GrowableObjectArray& pieces =
-      GrowableObjectArray::Handle(GrowableObjectArray::New());
-  String& name = String::Handle();
+  Thread* thread = Thread::Current();
+  Zone* zone = thread->zone();
+  GrowableHandlePtrArray<const String> pieces(zone, 4);
+  String& name = String::Handle(zone);
   if (!instantiate && !is_static() && (name_visibility == kInternalName)) {
     // Prefix the signature with its signature class and type parameters, if any
     // (e.g. "Map<K, V>(K) => bool"). In case of a function type alias, the
     // signature class name is the alias name.
     // The signature of static functions cannot be type parameterized.
-    const Class& function_class = Class::Handle(Owner());
+    const Class& function_class = Class::Handle(zone, Owner());
     ASSERT(!function_class.IsNull());
     const TypeArguments& type_parameters = TypeArguments::Handle(
-        function_class.type_parameters());
+        zone, function_class.type_parameters());
     if (!type_parameters.IsNull()) {
-      const String& function_class_name = String::Handle(function_class.Name());
+      const String& function_class_name =
+          String::Handle(zone, function_class.Name());
       pieces.Add(function_class_name);
       const intptr_t num_type_parameters = type_parameters.Length();
       pieces.Add(Symbols::LAngleBracket());
-      TypeParameter& type_parameter = TypeParameter::Handle();
-      AbstractType& bound = AbstractType::Handle();
+      TypeParameter& type_parameter = TypeParameter::Handle(zone);
+      AbstractType& bound = AbstractType::Handle(zone);
       for (intptr_t i = 0; i < num_type_parameters; i++) {
         type_parameter ^= type_parameters.TypeAt(i);
         name = type_parameter.name();
@@ -6606,16 +6750,15 @@
   BuildSignatureParameters(instantiate,
                            name_visibility,
                            instantiator,
-                           pieces);
+                           &pieces);
   pieces.Add(Symbols::RParenArrow());
-  AbstractType& res_type = AbstractType::Handle(result_type());
+  AbstractType& res_type = AbstractType::Handle(zone, result_type());
   if (instantiate && !res_type.IsInstantiated()) {
     res_type = res_type.InstantiateFrom(instantiator, NULL);
   }
   name = res_type.BuildName(name_visibility);
   pieces.Add(name);
-  const Array& strings = Array::Handle(Array::MakeArray(pieces));
-  return Symbols::New(String::Handle(String::ConcatAll(strings)));
+  return Symbols::FromConcatAll(pieces);
 }
 
 
@@ -6677,8 +6820,7 @@
 
 
 bool Function::HasOptimizedCode() const {
-  return HasCode() &&  Code::Handle(Instructions::Handle(
-      raw_ptr()->instructions_).code()).is_optimized();
+  return HasCode() && Code::Handle(CurrentCode()).is_optimized();
 }
 
 
@@ -6717,9 +6859,9 @@
       tmp = cls.PrettyName();
     }
   }
-  tmp = String::Concat(tmp, Symbols::Dot());
+  tmp = String::Concat(tmp, Symbols::Dot(), Heap::kOld);
   const String& suffix = String::Handle(PrettyName());
-  return String::Concat(tmp, suffix);
+  return String::Concat(tmp, suffix, Heap::kOld);
 }
 
 
@@ -6819,49 +6961,51 @@
 
 
 void Function::SaveICDataMap(
-    const ZoneGrowableArray<const ICData*>& deopt_id_to_ic_data) const {
-  // Compute number of ICData objectsto save.
-  intptr_t count = 0;
+    const ZoneGrowableArray<const ICData*>& deopt_id_to_ic_data,
+    const Array& edge_counters_array) const {
+  // Compute number of ICData objects to save.
+  // Store edge counter array in the first slot.
+  intptr_t count = 1;
   for (intptr_t i = 0; i < deopt_id_to_ic_data.length(); i++) {
     if (deopt_id_to_ic_data[i] != NULL) {
       count++;
     }
   }
-  if (count == 0) {
-    set_ic_data_array(Object::empty_array());
-  } else {
-    const Array& a = Array::Handle(Array::New(count, Heap::kOld));
-    INC_STAT(Isolate::Current(), total_code_size, count * sizeof(uword));
-    count = 0;
-    for (intptr_t i = 0; i < deopt_id_to_ic_data.length(); i++) {
-      if (deopt_id_to_ic_data[i] != NULL) {
-        a.SetAt(count++, *deopt_id_to_ic_data[i]);
-      }
+  const Array& array = Array::Handle(Array::New(count, Heap::kOld));
+  INC_STAT(Thread::Current(), total_code_size, count * sizeof(uword));
+  count = 1;
+  for (intptr_t i = 0; i < deopt_id_to_ic_data.length(); i++) {
+    if (deopt_id_to_ic_data[i] != NULL) {
+      array.SetAt(count++, *deopt_id_to_ic_data[i]);
     }
-    set_ic_data_array(a);
   }
+  array.SetAt(0, edge_counters_array);
+  set_ic_data_array(array);
 }
 
 
 void Function::RestoreICDataMap(
     ZoneGrowableArray<const ICData*>* deopt_id_to_ic_data) const {
+  ASSERT(deopt_id_to_ic_data->is_empty());
   Zone* zone = Thread::Current()->zone();
-  const Array& saved_icd = Array::Handle(zone, ic_data_array());
-  if (saved_icd.IsNull() || (saved_icd.Length() == 0)) {
-    deopt_id_to_ic_data->Clear();
+  const Array& saved_ic_data = Array::Handle(zone, ic_data_array());
+  if (saved_ic_data.IsNull()) {
     return;
   }
-  ICData& icd = ICData::Handle();
-  icd ^= saved_icd.At(saved_icd.Length() - 1);
-  const intptr_t len = icd.deopt_id() + 1;
-  deopt_id_to_ic_data->SetLength(len);
-  for (intptr_t i = 0; i < len; i++) {
-    (*deopt_id_to_ic_data)[i] = NULL;
-  }
-  for (intptr_t i = 0; i < saved_icd.Length(); i++) {
-    ICData& icd = ICData::ZoneHandle(zone);
-    icd ^= saved_icd.At(i);
-    (*deopt_id_to_ic_data)[icd.deopt_id()] = &icd;
+  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;
+    deopt_id_to_ic_data->SetLength(restored_length);
+    for (intptr_t i = 0; i < restored_length; i++) {
+      (*deopt_id_to_ic_data)[i] = NULL;
+    }
+    for (intptr_t i = 1; i < saved_length; i++) {
+      ICData& ic_data = ICData::ZoneHandle(zone);
+      ic_data ^= saved_ic_data.At(i);
+      (*deopt_id_to_ic_data)[ic_data.deopt_id()] = &ic_data;
+    }
   }
 }
 
@@ -6883,12 +7027,12 @@
 
 void Function::SetDeoptReasonForAll(intptr_t deopt_id,
                                     ICData::DeoptReasonId reason) {
-  const Array& icd_array = Array::Handle(ic_data_array());
-  ICData& icd = ICData::Handle();
-  for (intptr_t i = 0; i < icd_array.Length(); i++) {
-    icd ^= icd_array.At(i);
-    if (icd.deopt_id() == deopt_id) {
-      icd.AddDeoptReason(reason);
+  const Array& array = Array::Handle(ic_data_array());
+  ICData& ic_data = ICData::Handle();
+  for (intptr_t i = 1; i < array.Length(); i++) {
+    ic_data ^= array.At(i);
+    if (ic_data.deopt_id() == deopt_id) {
+      ic_data.AddDeoptReason(reason);
     }
   }
 }
@@ -6902,10 +7046,10 @@
       // to replace the old values.
       // sed -i .bak -f /tmp/newkeys runtime/vm/method_recognizer.h
       // sed -i .bak -f /tmp/newkeys runtime/vm/flow_graph_builder.h
-      OS::Print("s/V(%s, %d)/V(%s, %d)/\n",
+      THR_Print("s/V(%s, %d)/V(%s, %d)/\n",
                 prefix, fp, prefix, SourceFingerprint());
     } else {
-      OS::Print("FP mismatch while recognizing method %s:"
+      THR_Print("FP mismatch while recognizing method %s:"
                 " expecting %d found %d\n",
                 ToFullyQualifiedCString(),
                 fp,
@@ -6959,14 +7103,10 @@
     default:
       UNREACHABLE();
   }
-  const char* kFormat = "Function '%s':%s%s%s%s.";
   const char* function_name = String::Handle(name()).ToCString();
-  intptr_t len = OS::SNPrint(NULL, 0, kFormat, function_name,
-                             static_str, abstract_str, kind_str, const_str) + 1;
-  char* chars = Thread::Current()->zone()->Alloc<char>(len);
-  OS::SNPrint(chars, len, kFormat, function_name,
-              static_str, abstract_str, kind_str, const_str);
-  return chars;
+  return OS::SCreate(Thread::Current()->zone(),
+      "Function '%s':%s%s%s%s.",
+      function_name, static_str, abstract_str, kind_str, const_str);
 }
 
 
@@ -7011,7 +7151,7 @@
   Class& cls = Class::Handle(Owner());
   ASSERT(!cls.IsNull());
   Error& err = Error::Handle();
-  err ^= cls.EnsureIsFinalized(Isolate::Current());
+  err ^= cls.EnsureIsFinalized(Thread::Current());
   ASSERT(err.IsNull());
   JSONObject jsobj(stream);
   AddCommonObjectProperties(&jsobj, "Function", ref);
@@ -7148,6 +7288,11 @@
 }
 
 
+RawString* Field::LookupGetterSymbol(const String& field_name) {
+  return Symbols::LookupFromConcat(Symbols::GetterPrefix(), field_name);
+}
+
+
 RawString* Field::SetterName(const String& field_name) {
   return String::Concat(Symbols::SetterPrefix(), field_name);
 }
@@ -7158,13 +7303,20 @@
 }
 
 
+RawString* Field::LookupSetterSymbol(const String& field_name) {
+  return Symbols::LookupFromConcat(Symbols::SetterPrefix(), field_name);
+}
+
+
 RawString* Field::NameFromGetter(const String& getter_name) {
-  return String::SubString(getter_name, strlen(kGetterPrefix));
+  return Symbols::New(getter_name, kGetterPrefixLength,
+      getter_name.Length() - kGetterPrefixLength);
 }
 
 
 RawString* Field::NameFromSetter(const String& setter_name) {
-  return String::SubString(setter_name, strlen(kSetterPrefix));
+  return Symbols::New(setter_name, kSetterPrefixLength,
+      setter_name.Length() - kSetterPrefixLength);
 }
 
 
@@ -7204,18 +7356,6 @@
 }
 
 
-RawInstance* Field::value() const {
-  ASSERT(is_static());  // Valid only for static dart fields.
-  return raw_ptr()->value_;
-}
-
-
-void Field::set_value(const Instance& value) const {
-  ASSERT(is_static());  // Valid only for static dart fields.
-  StorePointer(&raw_ptr()->value_, value.raw());
-}
-
-
 void Field::set_type(const AbstractType& value) const {
   ASSERT(!value.IsNull());
   StorePointer(&raw_ptr()->type_, value.raw());
@@ -7242,9 +7382,7 @@
   const Field& result = Field::Handle(Field::New());
   result.set_name(name);
   result.set_is_static(is_static);
-  if (is_static) {
-    result.set_value(Object::null_instance());
-  } else {
+  if (!is_static) {
     result.SetOffset(0);
   }
   result.set_is_final(is_final);
@@ -7254,7 +7392,6 @@
   result.set_owner(owner);
   result.set_token_pos(token_pos);
   result.set_has_initializer(false);
-  result.set_initializer(Function::Handle());
   result.set_is_unboxing_candidate(true);
   result.set_guarded_cid(FLAG_use_field_guards ? kIllegalCid : kDynamicCid);
   result.set_is_nullable(FLAG_use_field_guards ? false : true);
@@ -7265,7 +7402,6 @@
   } else {
     result.set_guarded_list_length(Field::kNoFixedLength);
   }
-  result.set_dependent_code(Object::null_array());
   return result.raw();
 }
 
@@ -7278,7 +7414,6 @@
   const PatchClass& clone_owner =
       PatchClass::Handle(PatchClass::New(new_owner, owner));
   clone.set_owner(clone_owner);
-  clone.set_dependent_code(Object::null_array());
   if (!clone.is_static()) {
     clone.SetOffset(0);
   }
@@ -7351,15 +7486,11 @@
   const char* kF0 = is_static() ? " static" : "";
   const char* kF1 = is_final() ? " final" : "";
   const char* kF2 = is_const() ? " const" : "";
-  const char* kFormat = "Field <%s.%s>:%s%s%s";
   const char* field_name = String::Handle(name()).ToCString();
   const Class& cls = Class::Handle(owner());
   const char* cls_name = String::Handle(cls.Name()).ToCString();
-  intptr_t len =
-      OS::SNPrint(NULL, 0, kFormat, cls_name, field_name, kF0, kF1, kF2) + 1;
-  char* chars = Thread::Current()->zone()->Alloc<char>(len);
-  OS::SNPrint(chars, len, kFormat, cls_name, field_name, kF0, kF1, kF2);
-  return chars;
+  return OS::SCreate(Thread::Current()->zone(),
+      "Field <%s.%s>:%s%s%s", cls_name, field_name, kF0, kF1, kF2);
 }
 
 void Field::PrintJSONImpl(JSONStream* stream, bool ref) const {
@@ -7389,7 +7520,7 @@
     return;
   }
   if (is_static()) {
-    const Instance& valueObj = Instance::Handle(value());
+    const Instance& valueObj = Instance::Handle(StaticValue());
     jsobj.AddProperty("staticValue", valueObj);
   }
 
@@ -7418,6 +7549,7 @@
   }
 }
 
+
 // Build a closure object that gets (or sets) the contents of a static
 // field f and cache the closure in a newly created static field
 // named #f (or #f= in case of a setter).
@@ -7435,7 +7567,8 @@
   closure_field = field_owner.LookupStaticField(closure_name);
   if (!closure_field.IsNull()) {
     ASSERT(closure_field.is_static());
-    const Instance& closure = Instance::Handle(closure_field.value());
+    const Instance& closure =
+        Instance::Handle(closure_field.StaticValue());
     ASSERT(!closure.IsNull());
     ASSERT(closure.IsClosure());
     return closure.raw();
@@ -7468,7 +7601,7 @@
                              false,  // is_reflectable
                              field_owner,
                              this->token_pos());
-  closure_field.set_value(Instance::Cast(result));
+  closure_field.SetStaticValue(Instance::Cast(result), true);
   closure_field.set_type(Type::Handle(Type::DynamicType()));
   field_owner.AddField(closure_field);
 
@@ -7509,19 +7642,18 @@
   virtual void ReportDeoptimization(const Code& code) {
     if (FLAG_trace_deoptimization || FLAG_trace_deoptimization_verbose) {
       Function& function = Function::Handle(code.function());
-          OS::PrintErr("Deoptimizing %s because guard on field %s failed.\n",
-          function.ToFullyQualifiedCString(),
-          field_.ToCString());
+      THR_Print("Deoptimizing %s because guard on field %s failed.\n",
+                function.ToFullyQualifiedCString(), field_.ToCString());
     }
   }
 
   virtual void ReportSwitchingCode(const Code& code) {
     if (FLAG_trace_deoptimization || FLAG_trace_deoptimization_verbose) {
       Function& function = Function::Handle(code.function());
-      OS::PrintErr("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());
     }
   }
 
@@ -7545,33 +7677,45 @@
 
 
 bool Field::IsUninitialized() const {
-  const Instance& value = Instance::Handle(raw_ptr()->value_);
+  const Instance& value = Instance::Handle(raw_ptr()->value_.static_value_);
   ASSERT(value.raw() != Object::transition_sentinel().raw());
   return value.raw() == Object::sentinel().raw();
 }
 
 
-void Field::set_initializer(const Function& initializer) const {
-  StorePointer(&raw_ptr()->initializer_, initializer.raw());
+void Field::SetPrecompiledInitializer(const Function& initializer) const {
+  StorePointer(&raw_ptr()->initializer_.precompiled_, initializer.raw());
+}
+
+
+bool Field::HasPrecompiledInitializer() const {
+  return raw_ptr()->initializer_.precompiled_->IsHeapObject() &&
+         raw_ptr()->initializer_.precompiled_->IsFunction();
+}
+
+
+void Field::SetSavedInitialStaticValue(const Instance& value) const {
+  ASSERT(!HasPrecompiledInitializer());
+  StorePointer(&raw_ptr()->initializer_.saved_value_, value.raw());
 }
 
 
 void Field::EvaluateInitializer() const {
   ASSERT(is_static());
-  if (value() == Object::sentinel().raw()) {
-    set_value(Object::transition_sentinel());
+  if (StaticValue() == Object::sentinel().raw()) {
+    SetStaticValue(Object::transition_sentinel());
     Object& value = Object::Handle(Compiler::EvaluateStaticInitializer(*this));
     if (value.IsError()) {
-      set_value(Object::null_instance());
+      SetStaticValue(Object::null_instance());
       Exceptions::PropagateError(Error::Cast(value));
       UNREACHABLE();
     }
     ASSERT(value.IsNull() || value.IsInstance());
-    set_value(value.IsNull() ? Instance::null_instance()
-                             : Instance::Cast(value));
+    SetStaticValue(value.IsNull() ? Instance::null_instance()
+                                  : Instance::Cast(value));
     return;
-  } else if (value() == Object::transition_sentinel().raw()) {
-    set_value(Object::null_instance());
+  } 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);
@@ -7686,7 +7830,7 @@
     }
 
     if (FLAG_trace_field_guards) {
-      OS::Print("    => %s\n", GuardedPropertiesAsCString());
+      THR_Print("    => %s\n", GuardedPropertiesAsCString());
     }
 
     return false;
@@ -7741,7 +7885,7 @@
   }
 
   if (FLAG_trace_field_guards) {
-    OS::Print("Store %s %s <- %s\n",
+    THR_Print("Store %s %s <- %s\n",
               ToCString(),
               GuardedPropertiesAsCString(),
               value.ToCString());
@@ -7749,7 +7893,7 @@
 
   if (UpdateGuardedCidAndLength(value)) {
     if (FLAG_trace_field_guards) {
-      OS::Print("    => %s\n", GuardedPropertiesAsCString());
+      THR_Print("    => %s\n", GuardedPropertiesAsCString());
     }
 
     DeoptimizeDependentCode();
@@ -8051,13 +8195,13 @@
   }
   uint8_t* data = reinterpret_cast<uint8_t*>(::malloc(len));
   ASSERT(data != NULL);
-  Isolate* isolate = Isolate::Current();
+  Zone* zone = Thread::Current()->zone();
   const ExternalTypedData& stream = ExternalTypedData::Handle(
-      isolate,
+      zone,
       ExternalTypedData::New(kExternalTypedDataUint8ArrayCid,
                              data, len, Heap::kOld));
   stream.AddFinalizer(data, DataFinalizer);
-  const TokenStream& result = TokenStream::Handle(isolate, TokenStream::New());
+  const TokenStream& result = TokenStream::Handle(zone, TokenStream::New());
   result.SetStream(stream);
   return result.raw();
 }
@@ -8184,7 +8328,7 @@
 
 RawTokenStream* TokenStream::New(const Scanner::GrowableTokenStream& tokens,
                                  const String& private_key) {
-  Isolate* isolate = Isolate::Current();
+  Zone* zone = Thread::Current()->zone();
   // Copy the relevant data out of the scanner into a compressed stream of
   // tokens.
   CompressedTokenStreamData data;
@@ -8204,14 +8348,14 @@
 
   // Create and setup the token stream object.
   const ExternalTypedData& stream = ExternalTypedData::Handle(
-      isolate,
+      zone,
       ExternalTypedData::New(kExternalTypedDataUint8ArrayCid,
                              data.GetStream(), data.Length(), Heap::kOld));
   stream.AddFinalizer(data.GetStream(), DataFinalizer);
-  const TokenStream& result = TokenStream::Handle(isolate, New());
+  const TokenStream& result = TokenStream::Handle(zone, New());
   result.SetPrivateKey(private_key);
   const Array& token_objects =
-      Array::Handle(isolate, data.MakeTokenObjectsArray());
+      Array::Handle(zone, data.MakeTokenObjectsArray());
   {
     NoSafepointScope no_safepoint;
     result.SetStream(stream);
@@ -8399,15 +8543,15 @@
 
 
 RawGrowableObjectArray* Script::GenerateLineNumberArray() const {
-  Isolate* isolate = Isolate::Current();
+  Zone* zone = Thread::Current()->zone();
   const GrowableObjectArray& info =
-      GrowableObjectArray::Handle(isolate, GrowableObjectArray::New());
-  const String& source = String::Handle(isolate, Source());
+      GrowableObjectArray::Handle(zone, GrowableObjectArray::New());
+  const String& source = String::Handle(zone, Source());
   const String& key = Symbols::Empty();
-  const Object& line_separator = Object::Handle(isolate);
-  const TokenStream& tkns = TokenStream::Handle(isolate, tokens());
-  Smi& value = Smi::Handle(isolate);
-  String& tokenValue = String::Handle(isolate);
+  const Object& line_separator = Object::Handle(zone);
+  const TokenStream& tkns = TokenStream::Handle(zone, tokens());
+  Smi& value = Smi::Handle(zone);
+  String& tokenValue = String::Handle(zone);
   ASSERT(!tkns.IsNull());
   TokenStream::Iterator tkit(tkns, 0, TokenStream::Iterator::kAllTokens);
   int current_line = -1;
@@ -8521,21 +8665,22 @@
 
 
 void Script::Tokenize(const String& private_key) const {
-  Isolate* isolate = Isolate::Current();
-  const TokenStream& tkns = TokenStream::Handle(isolate, tokens());
+  Thread* thread = Thread::Current();
+  Zone* zone = thread->zone();
+  const TokenStream& tkns = TokenStream::Handle(zone, tokens());
   if (!tkns.IsNull()) {
     // Already tokenized.
     return;
   }
   // Get the source, scan and allocate the token stream.
-  VMTagScope tagScope(isolate, VMTag::kCompileScannerTagId);
-  CSTAT_TIMER_SCOPE(isolate, scanner_timer);
-  const String& src = String::Handle(isolate, Source());
+  VMTagScope tagScope(thread, VMTag::kCompileScannerTagId);
+  CSTAT_TIMER_SCOPE(thread, scanner_timer);
+  const String& src = String::Handle(zone, Source());
   Scanner scanner(src, private_key);
-  set_tokens(TokenStream::Handle(isolate,
-                                 TokenStream::New(scanner.GetStream(),
-                                                  private_key)));
-  INC_STAT(isolate, src_length, src.Length());
+  const Scanner::GrowableTokenStream& ts = scanner.GetStream();
+  INC_STAT(thread, num_tokens_scanned, ts.length());
+  set_tokens(TokenStream::Handle(zone, TokenStream::New(ts, private_key)));
+  INC_STAT(thread, src_length, src.Length());
 }
 
 
@@ -8550,7 +8695,8 @@
 
 void Script::GetTokenLocation(intptr_t token_pos,
                               intptr_t* line,
-                              intptr_t* column) const {
+                              intptr_t* column,
+                              intptr_t* token_len) const {
   ASSERT(line != NULL);
   const TokenStream& tkns = TokenStream::Handle(tokens());
   if (column == NULL) {
@@ -8572,6 +8718,13 @@
     intptr_t relative_line = scanner.CurrentPosition().line;
     *line = relative_line + line_offset();
     *column = scanner.CurrentPosition().column;
+    if (token_len != NULL) {
+      if (scanner.current_token().literal != NULL) {
+        *token_len = scanner.current_token().literal->Length();
+      } else {
+        *token_len = 1;
+      }
+    }
     // On the first line of the script we must add the column offset.
     if (relative_line == 1) {
       *column += col_offset();
@@ -8628,7 +8781,7 @@
 }
 
 
-RawString* Script::GetLine(intptr_t line_number) const {
+RawString* Script::GetLine(intptr_t line_number, Heap::Space space) const {
   const String& src = String::Handle(Source());
   intptr_t relative_line_number = line_number - line_offset();
   intptr_t current_line = 1;
@@ -8655,7 +8808,8 @@
   if (line_start_idx >= 0) {
     return String::SubString(src,
                              line_start_idx,
-                             last_char_idx - line_start_idx + 1);
+                             last_char_idx - line_start_idx + 1,
+                             space);
   } else {
     return Symbols::Empty().raw();
   }
@@ -8740,9 +8894,11 @@
 
 
 RawLibrary* Script::FindLibrary() const {
-  Isolate* isolate = Isolate::Current();
+  Thread* thread = Thread::Current();
+  Zone* zone = thread->zone();
+  Isolate* isolate = thread->isolate();
   const GrowableObjectArray& libs = GrowableObjectArray::Handle(
-      isolate, isolate->object_store()->libraries());
+      zone, isolate->object_store()->libraries());
   Library& lib = Library::Handle();
   Array& scripts = Array::Handle();
   for (intptr_t i = 0; i < libs.Length(); i++) {
@@ -8767,11 +8923,10 @@
   const String& encoded_uri = String::Handle(String::EncodeIRI(uri));
   ASSERT(!encoded_uri.IsNull());
   const Library& lib = Library::Handle(FindLibrary());
-  if (lib.IsNull()) {
-    ASSERT(kind() == RawScript::kEvaluateTag);
+  if (kind() == RawScript::kEvaluateTag) {
     jsobj.AddServiceId(*this);
   } else {
-    ASSERT(kind() != RawScript::kEvaluateTag);
+    ASSERT(!lib.IsNull());
     jsobj.AddFixedServiceId("libraries/%" Pd "/scripts/%s",
         lib.index(), encoded_uri.ToCString());
   }
@@ -8987,7 +9142,9 @@
   if (LoadError() != Instance::null()) {
     return LoadError();
   }
-  Isolate* isolate = Isolate::Current();
+  Thread* thread = Thread::Current();
+  Isolate* isolate = thread->isolate();
+  Zone* zone = thread->zone();
   ObjectStore* object_store = isolate->object_store();
   LibraryLoadErrorSet set(object_store->library_load_error_table());
   bool present = false;
@@ -8999,10 +9156,10 @@
   set.Insert(*this);
   object_store->set_library_load_error_table(set.Release());
   intptr_t num_imp = num_imports();
-  Library& lib = Library::Handle(isolate);
-  Instance& error = Instance::Handle(isolate);
+  Library& lib = Library::Handle(zone);
+  Instance& error = Instance::Handle(zone);
   for (intptr_t i = 0; i < num_imp; i++) {
-    HANDLESCOPE(isolate);
+    HANDLESCOPE(thread);
     lib = ImportLibraryAt(i);
     error = lib.TransitiveLoadError();
     if (!error.IsNull()) {
@@ -9014,35 +9171,40 @@
 
 
 static RawString* MakeClassMetaName(const Class& cls) {
-  String& cname = String::Handle(cls.Name());
-  return String::Concat(Symbols::At(), cname);
+  return Symbols::FromConcat(Symbols::At(), String::Handle(cls.Name()));
 }
 
 
 static RawString* MakeFieldMetaName(const Field& field) {
   const String& cname =
       String::Handle(MakeClassMetaName(Class::Handle(field.origin())));
-  String& fname = String::Handle(field.name());
-  fname = String::Concat(Symbols::At(), fname);
-  return String::Concat(cname, fname);
+  GrowableHandlePtrArray<const String> pieces(Thread::Current()->zone(), 3);
+  pieces.Add(cname);
+  pieces.Add(Symbols::At());
+  pieces.Add(String::Handle(field.name()));
+  return Symbols::FromConcatAll(pieces);
 }
 
 
 static RawString* MakeFunctionMetaName(const Function& func) {
   const String& cname =
       String::Handle(MakeClassMetaName(Class::Handle(func.origin())));
-  String& fname = String::Handle(func.QualifiedPrettyName());
-  fname = String::Concat(Symbols::At(), fname);
-  return String::Concat(cname, fname);
+  GrowableHandlePtrArray<const String> pieces(Thread::Current()->zone(), 3);
+  pieces.Add(cname);
+  pieces.Add(Symbols::At());
+  pieces.Add(String::Handle(func.QualifiedPrettyName()));
+  return Symbols::FromConcatAll(pieces);
 }
 
 
 static RawString* MakeTypeParameterMetaName(const TypeParameter& param) {
   const String& cname = String::Handle(
       MakeClassMetaName(Class::Handle(param.parameterized_class())));
-  String& pname = String::Handle(param.name());
-  pname = String::Concat(Symbols::At(), pname);
-  return String::Concat(cname, pname);
+  GrowableHandlePtrArray<const String> pieces(Thread::Current()->zone(), 3);
+  pieces.Add(cname);
+  pieces.Add(Symbols::At());
+  pieces.Add(String::Handle(param.name()));
+  return Symbols::FromConcatAll(pieces);
 }
 
 
@@ -9058,7 +9220,7 @@
                                           cls,
                                           token_pos));
   field.set_type(Type::Handle(Type::DynamicType()));
-  field.set_value(Array::empty_array());
+  field.SetStaticValue(Array::empty_array(), true);
   GrowableObjectArray& metadata =
       GrowableObjectArray::Handle(this->metadata());
   metadata.Add(field, Heap::kOld);
@@ -9152,13 +9314,13 @@
     return Object::empty_array().raw();
   }
   Object& metadata = Object::Handle();
-  metadata = field.value();
-  if (field.value() == Object::empty_array().raw()) {
+  metadata = field.StaticValue();
+  if (field.StaticValue() == Object::empty_array().raw()) {
     metadata = Parser::ParseMetadata(Class::Handle(field.owner()),
                                      field.token_pos());
     if (metadata.IsArray()) {
       ASSERT(Array::Cast(metadata).raw() != Object::empty_array().raw());
-      field.set_value(Array::Cast(metadata));
+      field.SetStaticValue(Array::Cast(metadata), true);
     }
   }
   return metadata.raw();
@@ -9352,16 +9514,16 @@
 
 
 RawObject* Library::LookupEntry(const String& name, intptr_t *index) const {
-  Isolate* isolate = Isolate::Current();
-  REUSABLE_ARRAY_HANDLESCOPE(isolate);
-  REUSABLE_OBJECT_HANDLESCOPE(isolate);
-  REUSABLE_STRING_HANDLESCOPE(isolate);
-  Array& dict = isolate->ArrayHandle();
+  Thread* thread = Thread::Current();
+  REUSABLE_ARRAY_HANDLESCOPE(thread);
+  REUSABLE_OBJECT_HANDLESCOPE(thread);
+  REUSABLE_STRING_HANDLESCOPE(thread);
+  Array& dict = thread->ArrayHandle();
   dict ^= dictionary();
   intptr_t dict_size = dict.Length() - 1;
   *index = name.Hash() % dict_size;
-  Object& entry = isolate->ObjectHandle();
-  String& entry_name = isolate->StringHandle();
+  Object& entry = thread->ObjectHandle();
+  String& entry_name = thread->StringHandle();
   entry = dict.At(*index);
   // Search the entry in the hash set.
   while (!entry.IsNull()) {
@@ -9567,11 +9729,12 @@
 
 
 RawObject* Library::LookupLocalObjectAllowPrivate(const String& name) const {
-  Isolate* isolate = Isolate::Current();
-  Object& obj = Object::Handle(isolate, Object::null());
+  Thread* thread = Thread::Current();
+  Zone* zone = thread->zone();
+  Object& obj = Object::Handle(zone, Object::null());
   obj = LookupLocalObject(name);
   if (obj.IsNull() && ShouldBePrivate(name)) {
-    String& private_name = String::Handle(isolate, PrivateName(name));
+    String& private_name = String::Handle(zone, PrivateName(name));
     obj = LookupLocalObject(private_name);
   }
   return obj.raw();
@@ -9670,8 +9833,8 @@
 RawClass* Library::LookupClassAllowPrivate(const String& name) const {
   // See if the class is available in this library or in the top level
   // scope of any imported library.
-  Isolate* isolate = Isolate::Current();
-  const Class& cls = Class::Handle(isolate, LookupClass(name));
+  Zone* zone = Thread::Current()->zone();
+  const Class& cls = Class::Handle(zone, LookupClass(name));
   if (!cls.IsNull()) {
     return cls.raw();
   }
@@ -9679,7 +9842,7 @@
   // Now try to lookup the class using its private name, but only in
   // this library (not in imported libraries).
   if (ShouldBePrivate(name)) {
-    String& private_name = String::Handle(isolate, PrivateName(name));
+    String& private_name = String::Handle(zone, PrivateName(name));
     const Object& obj = Object::Handle(LookupLocalObject(private_name));
     if (obj.IsClass()) {
       return Class::Cast(obj).raw();
@@ -9731,8 +9894,8 @@
 
 
 bool Library::ImportsCorelib() const {
-  Isolate* isolate = Isolate::Current();
-  Library& imported = Library::Handle(isolate);
+  Zone* zone = Thread::Current()->zone();
+  Library& imported = Library::Handle(zone);
   intptr_t count = num_imports();
   for (int i = 0; i < count; i++) {
     imported = ImportLibraryAt(i);
@@ -9740,7 +9903,7 @@
       return true;
     }
   }
-  LibraryPrefix& prefix = LibraryPrefix::Handle(isolate);
+  LibraryPrefix& prefix = LibraryPrefix::Handle(zone);
   LibraryPrefixIterator it(*this);
   while (it.HasNext()) {
     prefix = it.GetNext();
@@ -9938,11 +10101,13 @@
 
 // Returns library with given url in current isolate, or NULL.
 RawLibrary* Library::LookupLibrary(const String &url) {
-  Isolate* isolate = Isolate::Current();
-  Library& lib = Library::Handle(isolate, Library::null());
-  String& lib_url = String::Handle(isolate, String::null());
+  Thread* thread = Thread::Current();
+  Zone* zone = thread->zone();
+  Isolate* isolate = thread->isolate();
+  Library& lib = Library::Handle(zone, Library::null());
+  String& lib_url = String::Handle(zone, String::null());
   GrowableObjectArray& libs = GrowableObjectArray::Handle(
-      isolate, isolate->object_store()->libraries());
+      zone, isolate->object_store()->libraries());
   for (int i = 0; i < libs.Length(); i++) {
     lib ^= libs.At(i);
     lib_url ^= lib.url();
@@ -10018,8 +10183,7 @@
   String& name = String::Handle(class_name.raw());
   if (class_name.CharAt(0) == kPrivateIdentifierStart) {
     // Private identifiers are mangled on a per library basis.
-    name = String::Concat(name, String::Handle(core_lib.private_key()));
-    name = Symbols::New(name);
+    name = Symbols::FromConcat(name, String::Handle(core_lib.private_key()));
   }
   return core_lib.LookupClass(name);
 }
@@ -10032,8 +10196,7 @@
   // ASSERT(strchr(name, '@') == NULL);
   String& str = String::Handle();
   str = name.raw();
-  str = String::Concat(str, String::Handle(this->private_key()));
-  str = Symbols::New(str);
+  str = Symbols::FromConcat(str, String::Handle(this->private_key()));
   return str.raw();
 }
 
@@ -10123,13 +10286,15 @@
 }
 
 
+RawLibrary* Library::VMServiceLibrary() {
+  return Isolate::Current()->object_store()->vmservice_library();
+}
+
+
 const char* Library::ToCString() const {
-  const char* kFormat = "Library:'%s'";
   const String& name = String::Handle(url());
-  intptr_t len = OS::SNPrint(NULL, 0, kFormat, name.ToCString()) + 1;
-  char* chars = Thread::Current()->zone()->Alloc<char>(len);
-  OS::SNPrint(chars, len, kFormat, name.ToCString());
-  return chars;
+  return OS::SCreate(Thread::Current()->zone(),
+      "Library:'%s'", name.ToCString());
 }
 
 
@@ -10274,19 +10439,21 @@
 
 
 RawInstance* LibraryPrefix::LoadError() const {
-  Isolate* isolate = Isolate::Current();
+  Thread* thread = Thread::Current();
+  Isolate* isolate = thread->isolate();
+  Zone* zone = thread->zone();
   ObjectStore* object_store = isolate->object_store();
   GrowableObjectArray& libs =
-      GrowableObjectArray::Handle(isolate, object_store->libraries());
+      GrowableObjectArray::Handle(zone, object_store->libraries());
   ASSERT(!libs.IsNull());
   LibraryLoadErrorSet set(HashTables::New<LibraryLoadErrorSet>(libs.Length()));
   object_store->set_library_load_error_table(set.Release());
-  Library& lib = Library::Handle(isolate);
-  Instance& error = Instance::Handle(isolate);
+  Library& lib = Library::Handle(zone);
+  Instance& error = Instance::Handle(zone);
   for (int32_t i = 0; i < num_imports(); i++) {
     lib = GetLibrary(i);
     ASSERT(!lib.IsNull());
-    HANDLESCOPE(isolate);
+    HANDLESCOPE(thread);
     error = lib.TransitiveLoadError();
     if (!error.IsNull()) {
       break;
@@ -10411,14 +10578,16 @@
     this->set_is_loaded();
     return true;
   } else if (deferred_lib.LoadNotStarted()) {
-    Isolate* isolate = Isolate::Current();
+    Thread* thread = Thread::Current();
+    Isolate* isolate = thread->isolate();
     Api::Scope api_scope(isolate);
+    Zone* zone = thread->zone();
     deferred_lib.SetLoadRequested();
     const GrowableObjectArray& pending_deferred_loads =
         GrowableObjectArray::Handle(
             isolate->object_store()->pending_deferred_loads());
     pending_deferred_loads.Add(deferred_lib);
-    const String& lib_url = String::Handle(isolate, deferred_lib.url());
+    const String& lib_url = String::Handle(zone, deferred_lib.url());
     Dart_LibraryTagHandler handler = isolate->library_tag_handler();
     handler(Dart_kImportTag,
             Api::NewHandle(isolate, importer()),
@@ -10461,11 +10630,11 @@
 
   virtual void ReportSwitchingCode(const Code& code) {
     if (FLAG_trace_deoptimization || FLAG_trace_deoptimization_verbose) {
-      OS::PrintErr("Prefix '%s': disabling %s code for %s function '%s'\n",
-        String::Handle(prefix_.name()).ToCString(),
-        code.is_optimized() ? "optimized" : "unoptimized",
-        CodePatcher::IsEntryPatched(code) ? "patched" : "unpatched",
-        Function::Handle(code.function()).ToCString());
+      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());
     }
   }
 
@@ -10510,7 +10679,6 @@
   result.StoreNonPointer(&result.raw_ptr()->is_loaded_, !deferred_load);
   result.set_imports(Array::Handle(Array::New(kInitialSize)));
   result.AddImport(import);
-  result.set_dependent_code(Object::null_array());
   return result.raw();
 }
 
@@ -10540,12 +10708,9 @@
 
 
 const char* LibraryPrefix::ToCString() const {
-  const char* kFormat = "LibraryPrefix:'%s'";
   const String& prefix = String::Handle(name());
-  intptr_t len = OS::SNPrint(NULL, 0, kFormat, prefix.ToCString()) + 1;
-  char* chars = Thread::Current()->zone()->Alloc<char>(len);
-  OS::SNPrint(chars, len, kFormat, prefix.ToCString());
-  return chars;
+  return OS::SCreate(Thread::Current()->zone(),
+      "LibraryPrefix:'%s'", prefix.ToCString());
 }
 
 
@@ -10569,7 +10734,7 @@
                                           owner_class,
                                           token_pos));
   field.set_type(Type::Handle(Type::DynamicType()));
-  field.set_value(Array::empty_array());
+  field.SetStaticValue(Array::empty_array(), true);
   set_metadata_field(field);
   owner_class.AddField(field);
 }
@@ -10582,13 +10747,13 @@
     return Object::empty_array().raw();
   }
   Object& metadata = Object::Handle();
-  metadata = field.value();
-  if (field.value() == Object::empty_array().raw()) {
+  metadata = field.StaticValue();
+  if (field.StaticValue() == Object::empty_array().raw()) {
     metadata = Parser::ParseMetadata(Class::Handle(field.owner()),
                                      field.token_pos());
     if (metadata.IsArray()) {
       ASSERT(Array::Cast(metadata).raw() != Object::empty_array().raw());
-      field.set_value(Array::Cast(metadata));
+      field.SetStaticValue(Array::Cast(metadata), true);
     }
   }
   return metadata.raw();
@@ -10596,12 +10761,9 @@
 
 
 const char* Namespace::ToCString() const {
-  const char* kFormat = "Namespace for library '%s'";
   const Library& lib = Library::Handle(library());
-  intptr_t len = OS::SNPrint(NULL, 0, kFormat, lib.ToCString()) + 1;
-  char* chars = Thread::Current()->zone()->Alloc<char>(len);
-  OS::SNPrint(chars, len, kFormat, lib.ToCString());
-  return chars;
+  return OS::SCreate(Thread::Current()->zone(),
+      "Namespace for library '%s'", lib.ToCString());
 }
 
 
@@ -10658,18 +10820,25 @@
 // Look up object with given name in library and filter out hidden
 // names. Also look up getters and setters.
 RawObject* Namespace::Lookup(const String& name) const {
-  Isolate* isolate = Isolate::Current();
-  const Library& lib = Library::Handle(isolate, library());
+  Zone* zone = Thread::Current()->zone();
+  const Library& lib = Library::Handle(zone, library());
   intptr_t ignore = 0;
 
   // Lookup the name in the library's symbols.
-  Object& obj = Object::Handle(isolate, lib.LookupEntry(name, &ignore));
+  Object& obj = Object::Handle(zone, lib.LookupEntry(name, &ignore));
   if (!Field::IsGetterName(name) &&
       !Field::IsSetterName(name) &&
       (obj.IsNull() || obj.IsLibraryPrefix())) {
-    obj = lib.LookupEntry(String::Handle(Field::GetterName(name)), &ignore);
+    const String& getter_name = String::Handle(Field::LookupGetterSymbol(name));
+    if (!getter_name.IsNull()) {
+      obj = lib.LookupEntry(getter_name, &ignore);
+    }
     if (obj.IsNull()) {
-      obj = lib.LookupEntry(String::Handle(Field::SetterName(name)), &ignore);
+      const String& setter_name =
+          String::Handle(Field::LookupSetterSymbol(name));
+      if (!setter_name.IsNull()) {
+        obj = lib.LookupEntry(setter_name, &ignore);
+      }
     }
   }
 
@@ -10718,7 +10887,7 @@
     ClassDictionaryIterator it(lib, ClassDictionaryIterator::kIteratePrivate);
     while (it.HasNext()) {
       cls = it.GetNextClass();
-      error = cls.EnsureIsFinalized(Isolate::Current());
+      error = cls.EnsureIsFinalized(Thread::Current());
       if (!error.IsNull()) {
         return error.raw();
       }
@@ -10858,11 +11027,9 @@
   JSONObject jsobj(stream);
   AddCommonObjectProperties(&jsobj, "Object", ref);
   jsobj.AddServiceId(*this);
-  jsobj.AddProperty("_code", Code::Handle(code()));
   if (ref) {
     return;
   }
-  jsobj.AddProperty("_objectPool", ObjectPool::Handle(object_pool()));
 }
 
 
@@ -10943,7 +11110,8 @@
 
 
 const char* ObjectPool::ToCString() const {
-  return "ObjectPool";
+  Zone* zone = Thread::Current()->zone();
+  return zone->PrintToString("ObjectPool len:%" Pd, Length());
 }
 
 
@@ -10961,16 +11129,23 @@
     uword imm;
     Object& obj = Object::Handle();
     for (intptr_t i = 0; i < Length(); i++) {
+      JSONObject jsentry(stream);
+      jsentry.AddProperty("offset", OffsetFromIndex(i));
       switch (InfoAt(i)) {
       case ObjectPool::kTaggedObject:
         obj = ObjectAt(i);
-        jsarr.AddValue(obj);
+        jsentry.AddProperty("kind", "Object");
+        jsentry.AddProperty("value", obj);
         break;
       case ObjectPool::kImmediate:
-        // We might want to distingiush between immediates and addresses
-        // in the future.
         imm = RawValueAt(i);
-        jsarr.AddValue64(imm);
+        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();
@@ -10981,17 +11156,22 @@
 
 
 void ObjectPool::DebugPrint() const {
-  ISL_Print("Object Pool: {\n");
+  THR_Print("Object Pool: {\n");
   for (intptr_t i = 0; i < Length(); i++) {
+    intptr_t offset = OffsetFromIndex(i);
+    THR_Print("  %" Pd " PP+0x%" Px ": ", i, offset);
     if (InfoAt(i) == kTaggedObject) {
-      ISL_Print("  %" Pd ": 0x%" Px " %s (obj)\n", i,
-          reinterpret_cast<uword>(ObjectAt(i)),
-          Object::Handle(ObjectAt(i)).ToCString());
+      RawObject* obj = ObjectAt(i);
+      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 {
-      ISL_Print("  %" Pd ": 0x%" Px " (raw)\n", i, RawValueAt(i));
+      THR_Print("0x%" Px " (raw)\n", RawValueAt(i));
     }
   }
-  ISL_Print("}\n");
+  THR_Print("}\n");
 }
 
 
@@ -11016,15 +11196,15 @@
 
 RawPcDescriptors* PcDescriptors::New(GrowableArray<uint8_t>* data) {
   ASSERT(Object::pc_descriptors_class() != Class::null());
-  Isolate* isolate = Isolate::Current();
-  PcDescriptors& result = PcDescriptors::Handle(isolate);
+  Thread* thread = Thread::Current();
+  PcDescriptors& result = PcDescriptors::Handle(thread->zone());
   {
     uword size = PcDescriptors::InstanceSize(data->length());
     RawObject* raw = Object::Allocate(PcDescriptors::kClassId,
                                       size,
                                       Heap::kOld);
-    INC_STAT(isolate, total_code_size, size);
-    INC_STAT(isolate, pc_desc_size, size);
+    INC_STAT(thread, total_code_size, size);
+    INC_STAT(thread, pc_desc_size, size);
     NoSafepointScope no_safepoint;
     result ^= raw;
     result.SetLength(data->length());
@@ -11036,15 +11216,15 @@
 
 RawPcDescriptors* PcDescriptors::New(intptr_t length) {
   ASSERT(Object::pc_descriptors_class() != Class::null());
-  Isolate* isolate = Isolate::Current();
-  PcDescriptors& result = PcDescriptors::Handle(isolate);
+  Thread* thread = Thread::Current();
+  PcDescriptors& result = PcDescriptors::Handle(thread->zone());
   {
     uword size = PcDescriptors::InstanceSize(length);
     RawObject* raw = Object::Allocate(PcDescriptors::kClassId,
                                       size,
                                       Heap::kOld);
-    INC_STAT(isolate, total_code_size, size);
-    INC_STAT(isolate, pc_desc_size, size);
+    INC_STAT(thread, total_code_size, size);
+    INC_STAT(thread, pc_desc_size, size);
     NoSafepointScope no_safepoint;
     result ^= raw;
     result.SetLength(length);
@@ -11073,27 +11253,26 @@
   const int addr_width = (kBitsPerWord / 4) + 2;
   // "*" in a printf format specifier tells it to read the field width from
   // the printf argument list.
-  ISL_Print("%-*s\tkind    \tdeopt-id\ttok-ix\ttry-ix\n",
+  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.
+#define FORMAT "%#-*" Px "\t%s\t%" Pd "\t\t%" Pd "\t%" Pd "\n"
   if (Length() == 0) {
-    return "No pc descriptors\n";
+    return "empty PcDescriptors\n";
   }
   // 4 bits per hex digit.
   const int addr_width = kBitsPerWord / 4;
-  // "*" in a printf format specifier tells it to read the field width from
-  // the printf argument list.
-  const char* kFormat =
-      "%#-*" Px "\t%s\t%" Pd "\t\t%" Pd "\t%" Pd "\n";
   // First compute the buffer size required.
   intptr_t len = 1;  // Trailing '\0'.
   {
     Iterator iter(*this, RawPcDescriptors::kAnyKind);
     while (iter.MoveNext()) {
-      len += OS::SNPrint(NULL, 0, kFormat, addr_width,
+      len += OS::SNPrint(NULL, 0, FORMAT, addr_width,
                          iter.PcOffset(),
                          KindAsStr(iter.Kind()),
                          iter.DeoptId(),
@@ -11107,7 +11286,7 @@
   intptr_t index = 0;
   Iterator iter(*this, RawPcDescriptors::kAnyKind);
   while (iter.MoveNext()) {
-    index += OS::SNPrint((buffer + index), (len - index), kFormat, addr_width,
+    index += OS::SNPrint((buffer + index), (len - index), FORMAT, addr_width,
                          iter.PcOffset(),
                          KindAsStr(iter.Kind()),
                          iter.DeoptId(),
@@ -11115,6 +11294,7 @@
                          iter.TryIndex());
   }
   return buffer;
+#undef FORMAT
 }
 
 
@@ -11168,7 +11348,7 @@
   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.
-    if (Isolate::IsDeoptAfter(iter.DeoptId())) {
+    if (Thread::IsDeoptAfter(iter.DeoptId())) {
       // TODO(vegorov): some instructions contain multiple calls and have
       // multiple "after" targets recorded. Right now it is benign but might
       // lead to issues in the future. Fix that and enable verification.
@@ -11285,11 +11465,11 @@
 
 
 const char* Stackmap::ToCString() const {
+#define FORMAT "%#x: "
   if (IsNull()) {
     return "{null}";
   } else {
-    const char* kFormat = "%#" Px ": ";
-    intptr_t fixed_length = OS::SNPrint(NULL, 0, kFormat, PcOffset()) + 1;
+    intptr_t fixed_length = OS::SNPrint(NULL, 0, FORMAT, PcOffset()) + 1;
     Thread* thread = Thread::Current();
     // Guard against integer overflow in the computation of alloc_size.
     //
@@ -11300,13 +11480,14 @@
     }
     intptr_t alloc_size = fixed_length + Length();
     char* chars = thread->zone()->Alloc<char>(alloc_size);
-    intptr_t index = OS::SNPrint(chars, alloc_size, kFormat, PcOffset());
+    intptr_t index = OS::SNPrint(chars, alloc_size, FORMAT, PcOffset());
     for (intptr_t i = 0; i < Length(); i++) {
       chars[index++] = IsObject(i) ? '1' : '0';
     }
     chars[index] = '\0';
     return chars;
   }
+#undef FORMAT
 }
 
 
@@ -11339,42 +11520,18 @@
 }
 
 
-static const char* VarKindString(int kind) {
-  switch (kind) {
-    case RawLocalVarDescriptors::kStackVar:
-      return "StackVar";
-      break;
-    case RawLocalVarDescriptors::kContextVar:
-      return "ContextVar";
-      break;
-    case RawLocalVarDescriptors::kContextLevel:
-      return "ContextLevel";
-      break;
-    case RawLocalVarDescriptors::kSavedCurrentContext:
-      return "CurrentCtx";
-      break;
-    case RawLocalVarDescriptors::kAsyncOperation:
-      return "AsyncOperation";
-      break;
-    default:
-      UNREACHABLE();
-      return "Unknown";
-  }
-}
-
-
 static int PrintVarInfo(char* buffer, int len,
                         intptr_t i,
                         const String& var_name,
                         const RawLocalVarDescriptors::VarInfo& info) {
-  const int8_t kind = info.kind();
+  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,
-                       VarKindString(kind),
+                       LocalVarDescriptors::KindToCString(kind),
                        index,
                        info.scope_id,
                        info.begin_pos,
@@ -11384,7 +11541,7 @@
                        "%2" Pd " %-13s level=%-3d index=%-3d"
                        " begin=%-3d end=%-3d name=%s\n",
                        i,
-                       VarKindString(kind),
+                       LocalVarDescriptors::KindToCString(kind),
                        info.scope_id,
                        index,
                        info.begin_pos,
@@ -11395,7 +11552,7 @@
                        "%2" Pd " %-13s scope=%-3d index=%-3d"
                        " begin=%-3d end=%-3d name=%s\n",
                        i,
-                       VarKindString(kind),
+                       LocalVarDescriptors::KindToCString(kind),
                        info.scope_id,
                        index,
                        info.begin_pos,
@@ -11409,6 +11566,9 @@
   if (IsNull()) {
     return "LocalVarDescriptors(NULL)";
   }
+  if (Length() == 0) {
+    return "empty LocalVarDescriptors";
+  }
   intptr_t len = 1;  // Trailing '\0'.
   String& var_name = String::Handle();
   for (intptr_t i = 0; i < Length(); i++) {
@@ -11454,12 +11614,13 @@
     var.AddProperty("beginPos", static_cast<intptr_t>(info.begin_pos));
     var.AddProperty("endPos", static_cast<intptr_t>(info.end_pos));
     var.AddProperty("scopeId", static_cast<intptr_t>(info.scope_id));
-    var.AddProperty("kind", KindToStr(info.kind()));
+    var.AddProperty("kind", KindToCString(info.kind()));
   }
 }
 
 
-const char* LocalVarDescriptors::KindToStr(intptr_t kind) {
+const char* LocalVarDescriptors::KindToCString(
+    RawLocalVarDescriptors::VarInfoKind kind) {
   switch (kind) {
     case RawLocalVarDescriptors::kStackVar:
       return "StackVar";
@@ -11468,9 +11629,7 @@
     case RawLocalVarDescriptors::kContextLevel:
       return "ContextLevel";
     case RawLocalVarDescriptors::kSavedCurrentContext:
-      return "SavedCurrentContext";
-    case RawLocalVarDescriptors::kAsyncOperation:
-      return "AsyncOperation";
+      return "CurrentCtx";
     default:
       UNIMPLEMENTED();
       return NULL;
@@ -11491,8 +11650,8 @@
     RawObject* raw = Object::Allocate(LocalVarDescriptors::kClassId,
                                       size,
                                       Heap::kOld);
-    INC_STAT(Isolate::Current(), total_code_size, size);
-    INC_STAT(Isolate::Current(), vardesc_size, size);
+    INC_STAT(Thread::Current(), total_code_size, size);
+    INC_STAT(Thread::Current(), vardesc_size, size);
     NoSafepointScope no_safepoint;
     result ^= raw;
     result.StoreNonPointer(&result.raw_ptr()->num_entries_, num_variables);
@@ -11604,7 +11763,7 @@
   }
   const Array& handled_types_data = (num_handlers == 0) ?
       Object::empty_array() :
-      Array::Handle(Array::New(num_handlers));
+      Array::Handle(Array::New(num_handlers, Heap::kOld));
   result.set_handled_types_data(handled_types_data);
   return result.raw();
 }
@@ -11634,23 +11793,22 @@
 
 
 const char* ExceptionHandlers::ToCString() const {
+#define FORMAT1 "%" Pd " => %#x  (%" Pd " types) (outer %d)\n"
+#define FORMAT2 "  %d. %s\n"
   if (num_entries() == 0) {
-    return "No exception handlers\n";
+    return "empty ExceptionHandlers\n";
   }
   Array& handled_types = Array::Handle();
   Type& type = Type::Handle();
   RawExceptionHandlers::HandlerInfo info;
   // First compute the buffer size required.
-  const char* kFormat = "%" Pd " => %#" Px "  (%" Pd
-                        " types) (outer %" Pd ")\n";
-  const char* kFormat2 = "  %d. %s\n";
   intptr_t len = 1;  // Trailing '\0'.
   for (intptr_t i = 0; i < num_entries(); i++) {
     GetHandlerInfo(i, &info);
     handled_types = GetHandledTypes(i);
     const intptr_t num_types =
         handled_types.IsNull() ? 0 : handled_types.Length();
-    len += OS::SNPrint(NULL, 0, kFormat,
+    len += OS::SNPrint(NULL, 0, FORMAT1,
                        i,
                        info.handler_pc_offset,
                        num_types,
@@ -11658,7 +11816,7 @@
     for (int k = 0; k < num_types; k++) {
       type ^= handled_types.At(k);
       ASSERT(!type.IsNull());
-      len += OS::SNPrint(NULL, 0, kFormat2, k, type.ToCString());
+      len += OS::SNPrint(NULL, 0, FORMAT2, k, type.ToCString());
     }
   }
   // Allocate the buffer.
@@ -11672,7 +11830,7 @@
         handled_types.IsNull() ? 0 : handled_types.Length();
     num_chars += OS::SNPrint((buffer + num_chars),
                              (len - num_chars),
-                             kFormat,
+                             FORMAT1,
                              i,
                              info.handler_pc_offset,
                              num_types,
@@ -11681,10 +11839,12 @@
       type ^= handled_types.At(k);
       num_chars += OS::SNPrint((buffer + num_chars),
                                (len - num_chars),
-                               kFormat2, k, type.ToCString());
+                               FORMAT2, k, type.ToCString());
     }
   }
   return buffer;
+#undef FORMAT1
+#undef FORMAT2
 }
 
 
@@ -11761,13 +11921,14 @@
 
 const char* DeoptInfo::ToCString(const Array& deopt_table,
                                  const TypedData& packed) {
+#define FORMAT "[%s]"
   GrowableArray<DeoptInstr*> deopt_instrs;
   Unpack(deopt_table, packed, &deopt_instrs);
 
   // Compute the buffer size required.
   intptr_t len = 1;  // Trailing '\0'.
   for (intptr_t i = 0; i < deopt_instrs.length(); i++) {
-    len += OS::SNPrint(NULL, 0, "[%s]", deopt_instrs[i]->ToCString());
+    len += OS::SNPrint(NULL, 0, FORMAT, deopt_instrs[i]->ToCString());
   }
 
   // Allocate the buffer.
@@ -11778,11 +11939,12 @@
   for (intptr_t i = 0; i < deopt_instrs.length(); i++) {
     index += OS::SNPrint((buffer + index),
                          (len - index),
-                         "[%s]",
+                         FORMAT,
                          deopt_instrs[i]->ToCString());
   }
 
   return buffer;
+#undef FORMAT
 }
 
 
@@ -11801,16 +11963,12 @@
 
 
 const char* ICData::ToCString() const {
-  const char* kFormat = "ICData target:'%s' num-args: %" Pd
-                        " num-checks: %" Pd "";
   const String& name = String::Handle(target_name());
   const intptr_t num_args = NumArgsTested();
   const intptr_t num_checks = NumberOfChecks();
-  intptr_t len = OS::SNPrint(NULL, 0, kFormat, name.ToCString(),
-      num_args, num_checks) + 1;
-  char* chars = Thread::Current()->zone()->Alloc<char>(len);
-  OS::SNPrint(chars, len, kFormat, name.ToCString(), num_args, num_checks);
-  return chars;
+  return OS::SCreate(Thread::Current()->zone(),
+      "ICData target:'%s' num-args: %" Pd " num-checks: %" Pd "",
+      name.ToCString(), num_args, num_checks);
 }
 
 
@@ -12344,6 +12502,22 @@
 }
 
 
+RawICData* ICData::New() {
+  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);
+    NoSafepointScope no_safepoint;
+    result ^= raw;
+  }
+  result.set_deopt_id(Thread::kNoDeoptId);
+  result.set_state_bits(0);
+  return result.raw();
+}
+
+
 RawICData* ICData::New(const Function& owner,
                        const String& target_name,
                        const Array& arguments_descriptor,
@@ -12617,7 +12791,7 @@
 void Code::set_stackmaps(const Array& maps) const {
   ASSERT(maps.IsOld());
   StorePointer(&raw_ptr()->stackmaps_, maps.raw());
-  INC_STAT(Isolate::Current(),
+  INC_STAT(Thread::Current(),
            total_code_size,
            maps.IsNull() ? 0 : maps.Length() * sizeof(uword));
 }
@@ -12754,13 +12928,6 @@
 
 
 void Code::Disassemble(DisassemblyFormatter* formatter) const {
-  const bool fix_patch = CodePatcher::CodeIsPatchable(*this) &&
-                         CodePatcher::IsEntryPatched(*this);
-  if (fix_patch) {
-    // The disassembler may choke on illegal instructions if the code has been
-    // patched, un-patch the code before disassembling and re-patch after.
-    CodePatcher::RestoreEntry(*this);
-  }
   const Instructions& instr = Instructions::Handle(instructions());
   uword start = instr.EntryPoint();
   if (formatter == NULL) {
@@ -12768,10 +12935,6 @@
   } else {
     Disassembler::Disassemble(start, start + instr.size(), formatter, *this);
   }
-  if (fix_patch) {
-    // Redo the patch.
-    CodePatcher::PatchEntry(*this);
-  }
 }
 
 
@@ -12893,8 +13056,6 @@
     result.set_is_alive(false);
     result.set_comments(Comments::New(0));
     result.set_compile_timestamp(0);
-    result.set_entry_patch_pc_offset(kInvalidPc);
-    result.set_patch_code_pc_offset(kInvalidPc);
     result.set_lazy_deopt_pc_offset(kInvalidPc);
     result.set_pc_descriptors(Object::empty_descriptors());
   }
@@ -12919,11 +13080,15 @@
   // pages read-only.
   intptr_t pointer_offset_count = assembler->CountPointerOffsets();
   Code& code = Code::ZoneHandle(Code::New(pointer_offset_count));
+#ifdef TARGET_ARCH_IA32
+  assembler->set_code_object(code);
+#endif
   Instructions& instrs =
       Instructions::ZoneHandle(Instructions::New(assembler->CodeSize()));
-  INC_STAT(isolate, total_instr_size, assembler->CodeSize());
-  INC_STAT(isolate, total_code_size, assembler->CodeSize());
+  INC_STAT(Thread::Current(), total_instr_size, assembler->CodeSize());
+  INC_STAT(Thread::Current(), total_code_size, assembler->CodeSize());
 
+  instrs.set_code(code.raw());
   // 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.EntryPoint()),
@@ -12957,14 +13122,14 @@
     }
 
     // Hook up Code and Instructions objects.
-    instrs.set_code(code.raw());
+    code.set_active_instructions(instrs.raw());
     code.set_instructions(instrs.raw());
     code.set_is_alive(true);
 
     // Set object pool in Instructions object.
-    INC_STAT(isolate,
+    INC_STAT(Thread::Current(),
              total_code_size, object_pool.Length() * sizeof(uintptr_t));
-    instrs.set_object_pool(object_pool.raw());
+    code.set_object_pool(object_pool.raw());
 
     if (FLAG_write_protect_code) {
       uword address = RawObject::ToAddr(instrs.raw());
@@ -12983,7 +13148,7 @@
     // pushed onto the stack.
     code.SetPrologueOffset(assembler->CodeSize());
   }
-  INC_STAT(isolate,
+  INC_STAT(Thread::Current(),
            total_code_size, code.comments().comments_.Length());
   return code.raw();
 }
@@ -13005,8 +13170,13 @@
 
 
 // Check if object matches find condition.
-bool Code::FindRawCodeVisitor::FindObject(RawObject* obj) const {
-  return RawInstructions::ContainsPC(obj, pc_);
+bool Code::FindRawCodeVisitor::FindObject(RawObject* raw_obj) const {
+  uword tags = raw_obj->ptr()->tags_;
+  if (RawObject::ClassIdTag::decode(tags) == kInstructionsCid) {
+    RawInstructions* raw_insts = reinterpret_cast<RawInstructions*>(raw_obj);
+    return RawInstructions::ContainsPC(raw_insts, pc_);
+  }
+  return false;
 }
 
 
@@ -13015,12 +13185,17 @@
   NoSafepointScope no_safepoint;
   FindRawCodeVisitor visitor(pc);
   RawInstructions* instr;
+  if (Dart::IsRunningPrecompiledCode()) {
+    // TODO(johnmccutchan): Make code lookup work when running precompiled.
+    UNIMPLEMENTED();
+    return Code::null();
+  }
   if (isolate->heap() == NULL) {
     return Code::null();
   }
   instr = isolate->heap()->FindObjectInCodeSpace(&visitor);
   if (instr != Instructions::null()) {
-    return instr->ptr()->code_;
+    return Instructions::Handle(instr).code();
   }
   return Code::null();
 }
@@ -13092,16 +13267,18 @@
       return iter.DeoptId();
     }
   }
-  return Isolate::kNoDeoptId;
+  return Thread::kNoDeoptId;
 }
 
 
 const char* Code::ToCString() const {
-  const char* kFormat = "Code entry:%p";
-  intptr_t len = OS::SNPrint(NULL, 0, kFormat, EntryPoint()) + 1;
-  char* chars = Thread::Current()->zone()->Alloc<char>(len);
-  OS::SNPrint(chars, len, kFormat, EntryPoint());
-  return chars;
+  Zone* zone = Thread::Current()->zone();
+  if (IsStubCode()) {
+    const char* name = StubCode::NameOfStub(EntryPoint());
+    return zone->PrintToString("[stub: %s]", name);
+  } else {
+    return zone->PrintToString("Code entry:%" Px, EntryPoint());
+  }
 }
 
 
@@ -13167,6 +13344,24 @@
 }
 
 
+void Code::DisableDartCode() const {
+  ASSERT(IsFunctionCode());
+  ASSERT(instructions() == active_instructions());
+  const Code& new_code =
+      Code::Handle(StubCode::FixCallersTarget_entry()->code());
+  set_active_instructions(new_code.instructions());
+}
+
+
+void Code::DisableStubCode() const {
+ASSERT(IsAllocationStubCode());
+  ASSERT(instructions() == active_instructions());
+  const Code& new_code =
+      Code::Handle(StubCode::FixAllocationStubTarget_entry()->code());
+  set_active_instructions(new_code.instructions());
+}
+
+
 void Code::PrintJSONImpl(JSONStream* stream, bool ref) const {
   JSONObject jsobj(stream);
   AddCommonObjectProperties(&jsobj, "Code", ref);
@@ -13259,18 +13454,6 @@
 }
 
 
-uword Code::GetEntryPatchPc() const {
-  return (entry_patch_pc_offset() != kInvalidPc)
-      ? EntryPoint() + entry_patch_pc_offset() : 0;
-}
-
-
-uword Code::GetPatchCodePc() const {
-  return (patch_code_pc_offset() != kInvalidPc)
-      ? EntryPoint() + patch_code_pc_offset() : 0;
-}
-
-
 uword Code::GetLazyDeoptPc() const {
   return (lazy_deopt_pc_offset() != kInvalidPc)
       ? EntryPoint() + lazy_deopt_pc_offset() : 0;
@@ -13360,8 +13543,8 @@
 
 
 void Code::DumpInlinedIntervals() const {
-  LogBlock lb(Isolate::Current());
-  ISL_Print("Inlined intervals:\n");
+  LogBlock lb;
+  THR_Print("Inlined intervals:\n");
   const Array& intervals = Array::Handle(GetInlinedIntervals());
   if (intervals.IsNull() || (intervals.Length() == 0)) return;
   Smi& start = Smi::Handle();
@@ -13373,38 +13556,38 @@
     ASSERT(!start.IsNull());
     if (start.IsNull()) continue;
     inlining_id ^= intervals.At(i + Code::kInlIntInliningId);
-    ISL_Print("  %" Px " iid: %" Pd " ; ", start.Value(), inlining_id.Value());
+    THR_Print("  %" Px " iid: %" Pd " ; ", start.Value(), inlining_id.Value());
     inlined_functions.Clear();
 
-    ISL_Print("inlined: ");
+    THR_Print("inlined: ");
     GetInlinedFunctionsAt(start.Value(), &inlined_functions);
 
     for (intptr_t j = 0; j < inlined_functions.length(); j++) {
       const char* name = inlined_functions[j]->ToQualifiedCString();
-      ISL_Print("  %s <-", name);
+      THR_Print("  %s <-", name);
     }
     if (inlined_functions[inlined_functions.length() - 1]->raw() !=
            inliner.raw()) {
-      ISL_Print(" (ERROR, missing inliner)\n");
+      THR_Print(" (ERROR, missing inliner)\n");
     } else {
-      ISL_Print("\n");
+      THR_Print("\n");
     }
   }
-  ISL_Print("Inlined ids:\n");
+  THR_Print("Inlined ids:\n");
   const Array& id_map = Array::Handle(GetInlinedIdToFunction());
   Function& function = Function::Handle();
   for (intptr_t i = 0; i < id_map.Length(); i++) {
     function ^= id_map.At(i);
     if (!function.IsNull()) {
-      ISL_Print("  %" Pd ": %s\n", i, function.ToQualifiedCString());
+      THR_Print("  %" Pd ": %s\n", i, function.ToQualifiedCString());
     }
   }
-  ISL_Print("Caller Inlining Ids:\n");
+  THR_Print("Caller Inlining Ids:\n");
   const Array& caller_map = Array::Handle(GetInlinedCallerIdMap());
   Smi& smi = Smi::Handle();
   for (intptr_t i = 0; i < caller_map.Length(); i++) {
     smi ^= caller_map.At(i);
-    ISL_Print("  iid: %" Pd " caller iid: %" Pd "\n", i, smi.Value());
+    THR_Print("  iid: %" Pd " caller iid: %" Pd "\n", i, smi.Value());
   }
 }
 
@@ -13451,7 +13634,7 @@
 
 static void IndentN(int count) {
   for (int i = 0; i < count; i++) {
-    OS::PrintErr(" ");
+    THR_Print(" ");
   }
 }
 
@@ -13459,17 +13642,17 @@
 void Context::Dump(int indent) const {
   if (IsNull()) {
     IndentN(indent);
-    OS::PrintErr("Context@null\n");
+    THR_Print("Context@null\n");
     return;
   }
 
   IndentN(indent);
-  OS::PrintErr("Context@%p vars(%" Pd ") {\n", this->raw(), num_variables());
+  THR_Print("Context@%p vars(%" Pd ") {\n", this->raw(), num_variables());
   Object& obj = Object::Handle();
   for (intptr_t i = 0; i < num_variables(); i++) {
     IndentN(indent + 2);
     obj = At(i);
-    OS::PrintErr("[%" Pd "] = %s\n", i, obj.ToCString());
+    THR_Print("[%" Pd "] = %s\n", i, obj.ToCString());
   }
 
   const Context& parent_ctx = Context::Handle(parent());
@@ -13477,7 +13660,7 @@
     parent_ctx.Dump(indent + 2);
   }
   IndentN(indent);
-  OS::PrintErr("}\n");
+  THR_Print("}\n");
 }
 
 
@@ -13509,7 +13692,7 @@
 }
 
 
-RawContextScope* ContextScope::New(intptr_t num_variables) {
+RawContextScope* ContextScope::New(intptr_t num_variables, bool is_implicit) {
   ASSERT(Object::context_scope_class() != Class::null());
   if (num_variables < 0 || num_variables > kMaxElements) {
     // This should be caught before we reach here.
@@ -13525,6 +13708,7 @@
     NoSafepointScope no_safepoint;
     result ^= raw;
     result.set_num_variables(num_variables);
+    result.set_is_implicit(is_implicit);
   }
   return result.raw();
 }
@@ -13624,8 +13808,6 @@
 
 
 const char* ContextScope::ToCString() const {
-  const char* format =
-      "%s\nvar %s  token-pos %" Pd "  ctx lvl %" Pd "  index %" Pd "";
   const char* prev_cstr = "ContextScope:";
   String& name = String::Handle();
   for (int i = 0; i < num_variables(); i++) {
@@ -13634,10 +13816,9 @@
     intptr_t pos = TokenIndexAt(i);
     intptr_t idx = ContextIndexAt(i);
     intptr_t lvl = ContextLevelAt(i);
-    intptr_t len =
-        OS::SNPrint(NULL, 0, format, prev_cstr, cname, pos, lvl, idx) + 1;
-    char* chars = Thread::Current()->zone()->Alloc<char>(len);
-    OS::SNPrint(chars, len, format, prev_cstr, cname, pos, lvl, idx);
+    char* chars = OS::SCreate(Thread::Current()->zone(),
+        "%s\nvar %s  token-pos %" Pd "  ctx lvl %" Pd "  index %" Pd "",
+        prev_cstr, cname, pos, lvl, idx);
     prev_cstr = chars;
   }
   return prev_cstr;
@@ -13691,10 +13872,10 @@
     result ^= raw;
   }
   const intptr_t capacity = kInitialCapacity;
-  const Array& buckets = Array::Handle(Array::New(kEntryLength * capacity));
-  ASSERT(Isolate::Current()->megamorphic_cache_table()->miss_handler() != NULL);
+  const Array& buckets = Array::Handle(
+      Array::New(kEntryLength * capacity, Heap::kOld));
   const Function& handler = Function::Handle(
-      Isolate::Current()->megamorphic_cache_table()->miss_handler());
+      MegamorphicCacheTable::miss_handler(Isolate::Current()));
   for (intptr_t i = 0; i < capacity; ++i) {
     SetEntry(buckets, i, smi_illegal_cid(), handler);
   }
@@ -13715,7 +13896,7 @@
         Array::Handle(Array::New(kEntryLength * new_capacity));
 
     Function& target = Function::Handle(
-        Isolate::Current()->megamorphic_cache_table()->miss_handler());
+        MegamorphicCacheTable::miss_handler(Isolate::Current()));
     for (intptr_t i = 0; i < new_capacity; ++i) {
       SetEntry(new_buckets, i, smi_illegal_cid(), target);
     }
@@ -13757,12 +13938,19 @@
 
 
 const char* MegamorphicCache::ToCString() const {
-  return "";
+  return "MegamorphicCache";
 }
 
 
 void MegamorphicCache::PrintJSONImpl(JSONStream* stream, bool ref) const {
-  Object::PrintJSONImpl(stream, ref);
+  JSONObject jsobj(stream);
+  AddCommonObjectProperties(&jsobj, "Object", ref);
+  jsobj.AddServiceId(*this);
+  if (ref) {
+    return;
+  }
+  jsobj.AddProperty("_buckets", Object::Handle(buckets()));
+  jsobj.AddProperty("_mask", mask());
 }
 
 
@@ -13778,7 +13966,7 @@
     NoSafepointScope no_safepoint;
     result ^= raw;
   }
-  const Array& cache = Array::Handle(Array::New(kTestEntryLength));
+  const Array& cache = Array::Handle(Array::New(kTestEntryLength, Heap::kOld));
   result.set_cache(cache);
   return result.raw();
 }
@@ -13938,7 +14126,8 @@
   result.set_script(script);
   result.set_token_pos(token_pos);
   result.set_kind(kind);
-  result.set_message(String::Handle(String::NewFormattedV(format, args)));
+  result.set_message(String::Handle(
+      String::NewFormattedV(format, args, space)));
   return result.raw();
 }
 
@@ -14095,7 +14284,7 @@
 const char* UnhandledException::ToErrorCString() const {
   Thread* thread = Thread::Current();
   Isolate* isolate = thread->isolate();
-  HANDLESCOPE(isolate);
+  HANDLESCOPE(thread);
   Object& strtmp = Object::Handle();
   const char* exc_str;
   if (exception() == isolate->object_store()->out_of_memory()) {
@@ -14118,11 +14307,8 @@
   if (!strtmp.IsError()) {
     stack_str = strtmp.ToCString();
   }
-  const char* format = "Unhandled exception:\n%s\n%s";
-  intptr_t len = OS::SNPrint(NULL, 0, format, exc_str, stack_str);
-  char* chars = thread->zone()->Alloc<char>(len);
-  OS::SNPrint(chars, len, format, exc_str, stack_str);
-  return chars;
+  return OS::SCreate(thread->zone(),
+      "Unhandled exception:\n%s\n%s", exc_str, stack_str);
 }
 
 
@@ -14161,6 +14347,8 @@
     result ^= raw;
   }
   result.set_message(message);
+  result.set_is_user_initiated(false);
+  result.set_is_vm_restart(false);
   return result.raw();
 }
 
@@ -14170,6 +14358,16 @@
 }
 
 
+void UnwindError::set_is_user_initiated(bool value) const {
+  StoreNonPointer(&raw_ptr()->is_user_initiated_, value);
+}
+
+
+void UnwindError::set_is_vm_restart(bool value) const {
+  StoreNonPointer(&raw_ptr()->is_vm_restart_, value);
+}
+
+
 const char* UnwindError::ToErrorCString() const {
   const String& msg_str = String::Handle(message());
   return msg_str.ToCString();
@@ -14187,6 +14385,8 @@
   jsobj.AddProperty("kind", "TerminationError");
   jsobj.AddServiceId(*this);
   jsobj.AddProperty("message", ToErrorCString());
+  jsobj.AddProperty("_is_user_initiated", is_user_initiated());
+  jsobj.AddProperty("_is_vm_restart", is_vm_restart());
 }
 
 
@@ -14283,11 +14483,8 @@
           this->SetFieldAtOffset(field_offset, obj);
         } else {
           ASSERT(error_str != NULL);
-          const char* kFormat = "field: %s\n";
-          const intptr_t len =
-              OS::SNPrint(NULL, 0, kFormat, obj.ToCString()) + 1;
-          char* chars = Thread::Current()->zone()->Alloc<char>(len);
-          OS::SNPrint(chars, len, kFormat, obj.ToCString());
+          char* chars = OS::SCreate(Thread::Current()->zone(),
+              "field: %s\n", obj.ToCString());
           *error_str = chars;
           return false;
         }
@@ -14313,9 +14510,12 @@
   if (!CheckAndCanonicalizeFields(error_str)) {
     return Instance::null();
   }
-  Instance& result = Instance::Handle();
-  const Class& cls = Class::Handle(this->clazz());
-  Array& constants = Array::Handle(cls.constants());
+  Thread* thread = Thread::Current();
+  Zone* zone = thread->zone();
+  Isolate* isolate = thread->isolate();
+  Instance& result = Instance::Handle(zone);
+  const Class& cls = Class::Handle(zone, this->clazz());
+  Array& constants = Array::Handle(zone, cls.constants());
   const intptr_t constants_len = constants.Length();
   // Linear search to see whether this value is already present in the
   // list of canonicalized constants.
@@ -14334,7 +14534,23 @@
   // The value needs to be added to the list. Grow the list if
   // it is full.
   result ^= this->raw();
-  if (result.IsNew()) {
+  if (result.IsNew() ||
+      (result.InVMHeap() && (isolate != Dart::vm_isolate()))) {
+    /**
+     * When a snapshot is generated on a 64 bit architecture and then read
+     * into a 32 bit architecture, values which are Smi on the 64 bit
+     * architecture could potentially be converted to Mint objects, however
+     * since Smi values do not have any notion of canonical bits we lose
+     * that information when the object becomes a Mint.
+     * Some of these values could be literal values and end up in the
+     * VM isolate heap. Later when these values are referenced in a
+     * constant list we try to ensure that all the objects in the list
+     * are canonical and try to canonicalize them. When these Mint objects
+     * are encountered they do not have the canonical bit set and
+     * canonicalizing them won't work as the VM heap is read only now.
+     * In these cases we clone the object into the isolate and then
+     * canonicalize it.
+     */
     // Create a canonical object in old space.
     result ^= Object::Clone(result, Heap::kOld);
   }
@@ -14350,7 +14566,10 @@
     return Type::NullType();
   }
   const Class& cls = Class::Handle(clazz());
-  Type& type = Type::Handle(cls.CanonicalType());
+  Type& type = Type::Handle();
+  if (cls.NumTypeArguments() == 0) {
+    type = cls.CanonicalType();
+  }
   if (type.IsNull()) {
     TypeArguments& type_arguments = TypeArguments::Handle();
     if (cls.NumTypeArguments() > 0) {
@@ -14393,10 +14612,9 @@
   if (other.IsVoidType()) {
     return false;
   }
-  Isolate* isolate = Isolate::Current();
-  const Class& cls = Class::Handle(isolate, clazz());
-  TypeArguments& type_arguments =
-      TypeArguments::Handle(isolate);
+  Zone* zone = Thread::Current()->zone();
+  const Class& cls = Class::Handle(zone, clazz());
+  TypeArguments& type_arguments = TypeArguments::Handle(zone);
   if (cls.NumTypeArguments() > 0) {
     type_arguments = GetTypeArguments();
     ASSERT(type_arguments.IsNull() || type_arguments.IsCanonical());
@@ -14411,12 +14629,12 @@
     ASSERT(type_arguments.IsNull() ||
            (type_arguments.Length() >= cls.NumTypeArguments()));
   }
-  Class& other_class = Class::Handle(isolate);
-  TypeArguments& other_type_arguments = TypeArguments::Handle(isolate);
+  Class& other_class = Class::Handle(zone);
+  TypeArguments& other_type_arguments = TypeArguments::Handle(zone);
   // Note that we may encounter a bound error in checked mode.
   if (!other.IsInstantiated()) {
     const AbstractType& instantiated_other = AbstractType::Handle(
-        isolate, other.InstantiateFrom(other_instantiator, bound_error));
+        zone, other.InstantiateFrom(other_instantiator, bound_error));
     if ((bound_error != NULL) && !bound_error->IsNull()) {
       ASSERT(Isolate::Current()->flags().type_checks());
       return false;
@@ -14428,7 +14646,7 @@
     other_type_arguments = other.arguments();
   }
   return cls.IsSubtypeOf(type_arguments, other_class, other_type_arguments,
-                         bound_error);
+                         bound_error, Heap::kOld);
 }
 
 
@@ -14522,8 +14740,8 @@
 
 
 RawInstance* Instance::New(const Class& cls, Heap::Space space) {
-  Isolate* isolate = Isolate::Current();
-  if (cls.EnsureIsFinalized(isolate) != Error::null()) {
+  Thread* thread = Thread::Current();
+  if (cls.EnsureIsFinalized(thread) != Error::null()) {
     return Instance::null();
   }
   intptr_t instance_size = cls.instance_size();
@@ -14534,9 +14752,9 @@
 
 
 bool Instance::IsValidFieldOffset(intptr_t offset) const {
-  Isolate* isolate = Isolate::Current();
-  REUSABLE_CLASS_HANDLESCOPE(isolate);
-  Class& cls = isolate->ClassHandle();
+  Thread* thread = Thread::Current();
+  REUSABLE_CLASS_HANDLESCOPE(thread);
+  Class& cls = thread->ClassHandle();
   cls = clazz();
   return (offset >= 0 && offset <= (cls.instance_size() - kWordSize));
 }
@@ -14608,7 +14826,6 @@
     if (IsClosure()) {
       return Closure::ToCString(*this);
     }
-    const char* kFormat = "Instance of '%s'";
     const Class& cls = Class::Handle(clazz());
     TypeArguments& type_arguments = TypeArguments::Handle();
     const intptr_t num_type_arguments = cls.NumTypeArguments();
@@ -14618,11 +14835,8 @@
     const Type& type =
         Type::Handle(Type::New(cls, type_arguments, Scanner::kNoSourcePos));
     const String& type_name = String::Handle(type.UserVisibleName());
-    // Calculate the size of the string.
-    intptr_t len = OS::SNPrint(NULL, 0, kFormat, type_name.ToCString()) + 1;
-    char* chars = Thread::Current()->zone()->Alloc<char>(len);
-    OS::SNPrint(chars, len, kFormat, type_name.ToCString());
-    return chars;
+    return OS::SCreate(Thread::Current()->zone(),
+        "Instance of '%s'", type_name.ToCString());
   }
 }
 
@@ -14648,6 +14862,7 @@
           if (!field.is_static()) {
             fieldValue ^= GetField(field);
             JSONObject jsfield(&jsarr);
+            jsfield.AddProperty("type", "BoundField");
             jsfield.AddProperty("decl", field);
             jsfield.AddProperty("value", fieldValue);
           }
@@ -14753,7 +14968,7 @@
 }
 
 
-bool AbstractType::IsInstantiated(GrowableObjectArray* trail) const {
+bool AbstractType::IsInstantiated(TrailPtr trail) const {
   // AbstractType is an abstract class.
   UNREACHABLE();
   return false;
@@ -14808,8 +15023,7 @@
 }
 
 
-bool AbstractType::IsEquivalent(const Instance& other,
-                                GrowableObjectArray* trail) const {
+bool AbstractType::IsEquivalent(const Instance& other, TrailPtr trail) const {
   // AbstractType is an abstract class.
   UNREACHABLE();
   return false;
@@ -14826,7 +15040,8 @@
 RawAbstractType* AbstractType::InstantiateFrom(
     const TypeArguments& instantiator_type_arguments,
     Error* bound_error,
-    GrowableObjectArray* trail) const {
+    TrailPtr trail,
+    Heap::Space space) const {
   // AbstractType is an abstract class.
   UNREACHABLE();
   return NULL;
@@ -14841,43 +15056,44 @@
 
 
 RawAbstractType* AbstractType::CloneUninstantiated(
-    const Class& new_owner,
-    GrowableObjectArray* trail) const {
+    const Class& new_owner, TrailPtr trail) const {
   // AbstractType is an abstract class.
   UNREACHABLE();
   return NULL;
 }
 
 
-RawAbstractType* AbstractType::Canonicalize(GrowableObjectArray* trail) const {
+RawAbstractType* AbstractType::Canonicalize(TrailPtr trail) const {
   // AbstractType is an abstract class.
   UNREACHABLE();
   return NULL;
 }
 
 
-RawObject* AbstractType::OnlyBuddyInTrail(GrowableObjectArray* trail) const {
+RawAbstractType* AbstractType::OnlyBuddyInTrail(TrailPtr trail) const {
   if (trail == NULL) {
-    return Object::null();
+    return AbstractType::null();
   }
-  const intptr_t len = trail->Length();
+  const intptr_t len = trail->length();
   ASSERT((len % 2) == 0);
   for (intptr_t i = 0; i < len; i += 2) {
-    if (trail->At(i) == this->raw()) {
-      ASSERT(trail->At(i + 1) != Object::null());
-      return trail->At(i + 1);
+    ASSERT(trail->At(i).IsZoneHandle());
+    ASSERT(trail->At(i + 1).IsZoneHandle());
+    if (trail->At(i).raw() == this->raw()) {
+      ASSERT(!trail->At(i + 1).IsNull());
+      return trail->At(i + 1).raw();
     }
   }
-  return Object::null();
+  return AbstractType::null();
 }
 
 
-void AbstractType::AddOnlyBuddyToTrail(GrowableObjectArray** trail,
-                                       const Object& buddy) const {
+void AbstractType::AddOnlyBuddyToTrail(TrailPtr* trail,
+                                       const AbstractType& buddy) const {
   if (*trail == NULL) {
-    *trail = &GrowableObjectArray::ZoneHandle(GrowableObjectArray::New());
+    *trail = new Trail(Thread::Current()->zone(), 4);
   } else {
-    ASSERT(OnlyBuddyInTrail(*trail) == Object::null());
+    ASSERT(OnlyBuddyInTrail(*trail) == AbstractType::null());
   }
   (*trail)->Add(*this);
   (*trail)->Add(buddy);
@@ -14885,6 +15101,7 @@
 
 
 RawString* AbstractType::BuildName(NameVisibility name_visibility) const {
+  Zone* zone = Thread::Current()->zone();
   if (IsBoundedType()) {
     const AbstractType& type = AbstractType::Handle(
         BoundedType::Cast(*this).type());
@@ -14893,38 +15110,41 @@
     } else if (name_visibility == kUserVisibleName) {
       return type.BuildName(kUserVisibleName);
     }
-    String& type_name = String::Handle(type.BuildName(kInternalName));
-    type_name = String::Concat(type_name, Symbols::SpaceExtendsSpace());
+    GrowableHandlePtrArray<const String> pieces(zone, 5);
+    String& type_name = String::Handle(zone, type.BuildName(kInternalName));
+    pieces.Add(type_name);
+    pieces.Add(Symbols::SpaceExtendsSpace());
     // Build the bound name without causing divergence.
     const AbstractType& bound = AbstractType::Handle(
-        BoundedType::Cast(*this).bound());
-    String& bound_name = String::Handle();
+        zone, BoundedType::Cast(*this).bound());
+    String& bound_name = String::Handle(zone);
     if (bound.IsTypeParameter()) {
       bound_name = TypeParameter::Cast(bound).name();
+      pieces.Add(bound_name);
     } else if (bound.IsType()) {
-      const Class& cls = Class::Handle(Type::Cast(bound).type_class());
+      const Class& cls = Class::Handle(zone, Type::Cast(bound).type_class());
       bound_name = cls.Name();
       if (Type::Cast(bound).arguments() != TypeArguments::null()) {
-        bound_name = String::Concat(bound_name, Symbols::OptimizedOut());
+        pieces.Add(bound_name);
+        pieces.Add(Symbols::OptimizedOut());
       }
     } else {
-      bound_name = String::New(Symbols::OptimizedOut());
+      pieces.Add(Symbols::OptimizedOut());
     }
-    type_name = String::Concat(type_name, bound_name);
-    return Symbols::New(type_name);
+    return Symbols::FromConcatAll(pieces);
   }
   if (IsTypeParameter()) {
     return TypeParameter::Cast(*this).name();
   }
   // If the type is still being finalized, we may be reporting an error about
   // a malformed type, so proceed with caution.
-  const TypeArguments& args = TypeArguments::Handle(arguments());
+  const TypeArguments& args = TypeArguments::Handle(zone, arguments());
   const intptr_t num_args = args.IsNull() ? 0 : args.Length();
-  String& class_name = String::Handle();
+  String& class_name = String::Handle(zone);
   intptr_t first_type_param_index;
   intptr_t num_type_params;  // Number of type parameters to print.
   if (HasResolvedTypeClass()) {
-    const Class& cls = Class::Handle(type_class());
+    const Class& cls = Class::Handle(zone, type_class());
     if (IsResolved() || !cls.IsMixinApplication()) {
       // Do not print the full vector, but only the declared type parameters.
       num_type_params = cls.NumTypeParameters();
@@ -14972,7 +15192,7 @@
       // signature class) as a regular, possibly parameterized, class.
       if (cls.IsCanonicalSignatureClass()) {
         const Function& signature_function = Function::Handle(
-            cls.signature_function());
+            zone, cls.signature_function());
         // Signature classes have no super type, however, they take as many
         // type arguments as the owner class of their signature function (if it
         // is non static and generic, see Class::NumTypeArguments()). Therefore,
@@ -14982,26 +15202,28 @@
       }
     }
   } else {
-    const UnresolvedClass& cls = UnresolvedClass::Handle(unresolved_class());
+    const UnresolvedClass& cls =
+        UnresolvedClass::Handle(zone, unresolved_class());
     class_name = cls.Name();
     num_type_params = num_args;
     first_type_param_index = 0;
   }
-  String& type_name = String::Handle();
+  GrowableHandlePtrArray<const String> pieces(zone, 4);
+  pieces.Add(class_name);
   if ((num_type_params == 0) ||
       args.IsRaw(first_type_param_index, num_type_params)) {
-    type_name = class_name.raw();
+    // Do nothing.
   } else {
-    const String& args_name = String::Handle(
+    const String& args_name = String::Handle(zone,
         args.SubvectorName(first_type_param_index,
                            num_type_params,
                            name_visibility));
-    type_name = String::Concat(class_name, args_name);
+    pieces.Add(args_name);
   }
   // The name is only used for type checking and debugging purposes.
   // Unless profiling data shows otherwise, it is not worth caching the name in
   // the type.
-  return Symbols::New(type_name);
+  return Symbols::FromConcatAll(pieces);
 }
 
 
@@ -15082,7 +15304,8 @@
 
 bool AbstractType::TypeTest(TypeTestKind test_kind,
                             const AbstractType& other,
-                            Error* bound_error) const {
+                            Error* bound_error,
+                            Heap::Space space) const {
   ASSERT(IsResolved());
   ASSERT(other.IsResolved());
   if (IsMalformed() || other.IsMalformed()) {
@@ -15151,7 +15374,8 @@
                       TypeArguments::Handle(arguments()),
                       Class::Handle(other.type_class()),
                       TypeArguments::Handle(other.arguments()),
-                      bound_error);
+                      bound_error,
+                      space);
 }
 
 
@@ -15386,7 +15610,7 @@
 }
 
 
-bool Type::IsInstantiated(GrowableObjectArray* trail) const {
+bool Type::IsInstantiated(TrailPtr trail) const {
   if (raw_ptr()->type_state_ == RawType::kFinalizedInstantiated) {
     return true;
   }
@@ -15420,7 +15644,9 @@
 RawAbstractType* Type::InstantiateFrom(
     const TypeArguments& instantiator_type_arguments,
     Error* bound_error,
-    GrowableObjectArray* trail) const {
+    TrailPtr trail,
+    Heap::Space space) const {
+  Zone* zone = Thread::Current()->zone();
   ASSERT(IsFinalized() || IsBeingFinalized());
   ASSERT(!IsInstantiated());
   // Return the uninstantiated type unchanged if malformed. No copy needed.
@@ -15433,7 +15659,7 @@
     return raw();
   }
   // If this type is recursive, we may already be instantiating it.
-  Type& instantiated_type = Type::Handle();
+  Type& instantiated_type = Type::Handle(zone);
   instantiated_type ^= OnlyBuddyInTrail(trail);
   if (!instantiated_type.IsNull()) {
     ASSERT(IsRecursive());
@@ -15442,19 +15668,20 @@
   // Note that the type class has to be resolved at this time, but not
   // necessarily finalized yet. We may be checking bounds at compile time or
   // finalizing the type argument vector of a recursive type.
-  const Class& cls = Class::Handle(type_class());
+  const Class& cls = Class::Handle(zone, type_class());
 
   // This uninstantiated type is not modified, as it can be instantiated
   // with different instantiators. Allocate a new instantiated version of it.
-  instantiated_type = Type::New(cls, TypeArguments::Handle(), token_pos());
-  TypeArguments& type_arguments = TypeArguments::Handle(arguments());
+  instantiated_type = Type::New(cls, TypeArguments::Handle(zone), token_pos());
+  TypeArguments& type_arguments = TypeArguments::Handle(zone, arguments());
   ASSERT(type_arguments.Length() == cls.NumTypeArguments());
   if (type_arguments.IsRecursive()) {
     AddOnlyBuddyToTrail(&trail, instantiated_type);
   }
   type_arguments = type_arguments.InstantiateFrom(instantiator_type_arguments,
                                                   bound_error,
-                                                  trail);
+                                                  trail,
+                                                  space);
   instantiated_type.set_arguments(type_arguments);
   if (IsFinalized()) {
     instantiated_type.SetIsFinalized();
@@ -15466,8 +15693,7 @@
 }
 
 
-bool Type::IsEquivalent(const Instance& other,
-                        GrowableObjectArray* trail) const {
+bool Type::IsEquivalent(const Instance& other, TrailPtr trail) const {
   ASSERT(!IsNull());
   if (raw() == other.raw()) {
     return true;
@@ -15496,18 +15722,19 @@
   if (arguments() == other_type.arguments()) {
     return true;
   }
-  Isolate* isolate = Isolate::Current();
-  const Class& cls = Class::Handle(isolate, type_class());
-  const intptr_t num_type_params = cls.NumTypeParameters(isolate);
+  Thread* thread = Thread::Current();
+  Zone* zone = thread->zone();
+  const Class& cls = Class::Handle(zone, type_class());
+  const intptr_t num_type_params = cls.NumTypeParameters(thread);
   if (num_type_params == 0) {
     // Shortcut unnecessary handle allocation below.
     return true;
   }
   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(isolate, arguments());
+  const TypeArguments& type_args = TypeArguments::Handle(zone, arguments());
   const TypeArguments& other_type_args = TypeArguments::Handle(
-      isolate, other_type.arguments());
+      zone, other_type.arguments());
   if (type_args.IsNull()) {
     // Ignore from_index.
     return other_type_args.IsRaw(0, num_type_args);
@@ -15527,8 +15754,8 @@
     // depend solely on the type parameters that were just verified to match.
     ASSERT(type_args.Length() >= (from_index + num_type_params));
     ASSERT(other_type_args.Length() >= (from_index + num_type_params));
-    AbstractType& type_arg = AbstractType::Handle(isolate);
-    AbstractType& other_type_arg = AbstractType::Handle(isolate);
+    AbstractType& type_arg = AbstractType::Handle(zone);
+    AbstractType& other_type_arg = AbstractType::Handle(zone);
     for (intptr_t i = 0; i < from_index; i++) {
       type_arg = type_args.TypeAt(i);
       other_type_arg = other_type_args.TypeAt(i);
@@ -15562,7 +15789,7 @@
 
 
 RawAbstractType* Type::CloneUninstantiated(const Class& new_owner,
-                                           GrowableObjectArray* trail) const {
+                                           TrailPtr trail) const {
   ASSERT(IsFinalized());
   ASSERT(!IsMalformed());
   if (IsInstantiated()) {
@@ -15589,20 +15816,22 @@
 }
 
 
-RawAbstractType* Type::Canonicalize(GrowableObjectArray* trail) const {
+RawAbstractType* Type::Canonicalize(TrailPtr trail) const {
   ASSERT(IsFinalized());
   if (IsCanonical() || IsMalformed()) {
     ASSERT(IsMalformed() || TypeArguments::Handle(arguments()).IsOld());
     return this->raw();
   }
-  Isolate* isolate = Isolate::Current();
-  Type& type = Type::Handle(isolate);
-  const Class& cls = Class::Handle(isolate, type_class());
+  Thread* thread = Thread::Current();
+  Zone* zone = thread->zone();
+  Isolate* isolate = thread->isolate();
+  Type& type = Type::Handle(zone);
+  const Class& cls = Class::Handle(zone, type_class());
   if (cls.raw() == Object::dynamic_class() && (isolate != Dart::vm_isolate())) {
     return Object::dynamic_type();
   }
   // Fast canonical lookup/registry for simple types.
-  if ((cls.NumTypeArguments() == 0) && !cls.IsSignatureClass()) {
+  if (cls.NumTypeArguments() == 0) {
     type = cls.CanonicalType();
     if (type.IsNull()) {
       ASSERT(!cls.raw()->IsVMHeapObject() || (isolate == Dart::vm_isolate()));
@@ -15615,7 +15844,7 @@
     return type.raw();
   }
 
-  Array& canonical_types = Array::Handle(isolate);
+  Array& canonical_types = Array::Handle(zone);
   canonical_types ^= cls.canonical_types();
   if (canonical_types.IsNull()) {
     canonical_types = empty_array().raw();
@@ -15625,7 +15854,7 @@
   // list of canonicalized types.
   // TODO(asiva): Try to re-factor this lookup code to make sharing
   // easy between the 4 versions of this loop.
-  intptr_t index = 0;
+  intptr_t index = 1;  // Slot 0 is reserved for CanonicalType().
   while (index < length) {
     type ^= canonical_types.At(index);
     if (type.IsNull()) {
@@ -15641,7 +15870,7 @@
   // The type was not found in the table. It is not canonical yet.
 
   // Canonicalize the type arguments.
-  TypeArguments& type_args = TypeArguments::Handle(isolate, arguments());
+  TypeArguments& type_args = TypeArguments::Handle(zone, arguments());
   // In case the type is first canonicalized at runtime, its type argument
   // vector may be longer than necessary. This is not an issue.
   ASSERT(type_args.IsNull() || (type_args.Length() >= cls.NumTypeArguments()));
@@ -15669,19 +15898,20 @@
   }
 
   // The type needs to be added to the list. Grow the list if it is full.
-  if (index == length) {
+  if (index >= length) {
+    ASSERT((index == length) || ((index == 1) && (length == 0)));
     const intptr_t new_length = (length > 64) ?
         (length + 64) :
-        ((length == 0) ? 1 : (length * 2));
+        ((length == 0) ? 2 : (length * 2));
     const Array& new_canonical_types = Array::Handle(
-        isolate, Array::Grow(canonical_types, new_length, Heap::kOld));
+        zone, Array::Grow(canonical_types, new_length, Heap::kOld));
     cls.set_canonical_types(new_canonical_types);
-    new_canonical_types.SetAt(index, *this);
-  } else {
-    canonical_types.SetAt(index, *this);
+    canonical_types = new_canonical_types.raw();
   }
+  canonical_types.SetAt(index, *this);
+  if ((index == 1) && cls.IsCanonicalSignatureClass()) {
+    canonical_types.SetAt(0, *this);  // Also set canonical signature type at 0.
 #ifdef DEBUG
-  if ((index == 0) && cls.IsCanonicalSignatureClass()) {
     // Verify that the first canonical type is the signature type by checking
     // that the type argument vector of the canonical type ends with the
     // uninstantiated type parameters of the signature class. Note that these
@@ -15694,11 +15924,11 @@
     // of the super class of the owner class of its signature function will be
     // prepended to the type argument vector during class finalization.
     const TypeArguments& type_params =
-      TypeArguments::Handle(isolate, cls.type_parameters());
+        TypeArguments::Handle(zone, cls.type_parameters());
     const intptr_t num_type_params = cls.NumTypeParameters();
     const intptr_t num_type_args = cls.NumTypeArguments();
-    AbstractType& type_arg = AbstractType::Handle(isolate);
-    TypeParameter& type_param = TypeParameter::Handle(isolate);
+    AbstractType& type_arg = AbstractType::Handle(zone);
+    TypeParameter& type_param = TypeParameter::Handle(zone);
     for (intptr_t i = 0; i < num_type_params; i++) {
       type_arg = type_args.TypeAt(num_type_args - num_type_params + i);
       while (type_arg.IsBoundedType()) {
@@ -15707,8 +15937,8 @@
       type_param ^= type_params.TypeAt(i);
       ASSERT(type_arg.Equals(type_param));
     }
-  }
 #endif
+  }
   ASSERT(IsOld());
   ASSERT(type_args.IsNull() || type_args.IsOld());
   SetCanonical();
@@ -15782,29 +16012,18 @@
     class_name = UnresolvedClass::Handle(unresolved_class()).ToCString();
   }
   if (type_arguments.IsNull()) {
-    const char* format = "%sType: class '%s'";
-    const intptr_t len =
-        OS::SNPrint(NULL, 0, format, unresolved, class_name) + 1;
-    char* chars = Thread::Current()->zone()->Alloc<char>(len);
-    OS::SNPrint(chars, len, format, unresolved, class_name);
-    return chars;
+    return OS::SCreate(Thread::Current()->zone(),
+        "%sType: class '%s'", unresolved, class_name);
   } else if (IsResolved() && IsFinalized() && IsRecursive()) {
-    const char* format = "Type: (@%" Px " H%" Px ") class '%s', args:[%s]";
     const intptr_t hash = Hash();
     const char* args_cstr = TypeArguments::Handle(arguments()).ToCString();
-    const intptr_t len =
-        OS::SNPrint(NULL, 0, format, raw(), hash, class_name, args_cstr) + 1;
-    char* chars = Thread::Current()->zone()->Alloc<char>(len);
-    OS::SNPrint(chars, len, format, raw(), hash, class_name, args_cstr);
-    return chars;
+    return OS::SCreate(Thread::Current()->zone(),
+        "Type: (@%p H%" Px ") class '%s', args:[%s]",
+        raw(), hash, class_name, args_cstr);
   } else {
-    const char* format = "%sType: class '%s', args:[%s]";
     const char* args_cstr = TypeArguments::Handle(arguments()).ToCString();
-    const intptr_t len =
-        OS::SNPrint(NULL, 0, format, unresolved, class_name, args_cstr) + 1;
-    char* chars = Thread::Current()->zone()->Alloc<char>(len);
-    OS::SNPrint(chars, len, format, unresolved, class_name, args_cstr);
-    return chars;
+    return OS::SCreate(Thread::Current()->zone(),
+        "%sType: class '%s', args:[%s]", unresolved, class_name, args_cstr);
   }
 }
 
@@ -15836,7 +16055,7 @@
 }
 
 
-bool TypeRef::IsInstantiated(GrowableObjectArray* trail) const {
+bool TypeRef::IsInstantiated(TrailPtr trail) const {
   if (TestAndAddToTrail(&trail)) {
     return true;
   }
@@ -15844,12 +16063,14 @@
 }
 
 
-bool TypeRef::IsEquivalent(const Instance& other,
-                           GrowableObjectArray* trail) const {
+bool TypeRef::IsEquivalent(const Instance& other, TrailPtr trail) const {
   if (raw() == other.raw()) {
     return true;
   }
-  if (TestAndAddBuddyToTrail(&trail, other)) {
+  if (!other.IsAbstractType()) {
+    return false;
+  }
+  if (TestAndAddBuddyToTrail(&trail, AbstractType::Cast(other))) {
     return true;
   }
   return AbstractType::Handle(type()).IsEquivalent(other, trail);
@@ -15859,7 +16080,8 @@
 RawTypeRef* TypeRef::InstantiateFrom(
     const TypeArguments& instantiator_type_arguments,
     Error* bound_error,
-    GrowableObjectArray* trail) const {
+    TrailPtr trail,
+    Heap::Space space) const {
   TypeRef& instantiated_type_ref = TypeRef::Handle();
   instantiated_type_ref ^= OnlyBuddyInTrail(trail);
   if (!instantiated_type_ref.IsNull()) {
@@ -15869,7 +16091,7 @@
   ASSERT(!ref_type.IsTypeRef());
   AbstractType& instantiated_ref_type = AbstractType::Handle();
   instantiated_ref_type = ref_type.InstantiateFrom(
-      instantiator_type_arguments, bound_error, trail);
+      instantiator_type_arguments, bound_error, trail, space);
   ASSERT(!instantiated_ref_type.IsTypeRef());
   instantiated_type_ref = TypeRef::New(instantiated_ref_type);
   AddOnlyBuddyToTrail(&trail, instantiated_type_ref);
@@ -15878,7 +16100,7 @@
 
 
 RawTypeRef* TypeRef::CloneUninstantiated(const Class& new_owner,
-                                         GrowableObjectArray* trail) const {
+                                         TrailPtr trail) const {
   TypeRef& cloned_type_ref = TypeRef::Handle();
   cloned_type_ref ^= OnlyBuddyInTrail(trail);
   if (!cloned_type_ref.IsNull()) {
@@ -15906,7 +16128,7 @@
 // Consider the type Derived, where class Derived extends Base<Derived>.
 // The first type argument of its flattened type argument vector is Derived,
 // represented by a TypeRef pointing to itself.
-RawAbstractType* TypeRef::Canonicalize(GrowableObjectArray* trail) const {
+RawAbstractType* TypeRef::Canonicalize(TrailPtr trail) const {
   if (TestAndAddToTrail(&trail)) {
     return raw();
   }
@@ -15927,13 +16149,13 @@
 }
 
 
-bool TypeRef::TestAndAddToTrail(GrowableObjectArray** trail) const {
+bool TypeRef::TestAndAddToTrail(TrailPtr* trail) const {
   if (*trail == NULL) {
-    *trail = &GrowableObjectArray::ZoneHandle(GrowableObjectArray::New());
+    *trail = new Trail(Thread::Current()->zone(), 4);
   } else {
-    const intptr_t len = (*trail)->Length();
+    const intptr_t len = (*trail)->length();
     for (intptr_t i = 0; i < len; i++) {
-      if ((*trail)->At(i) == this->raw()) {
+      if ((*trail)->At(i).raw() == this->raw()) {
         return true;
       }
     }
@@ -15943,16 +16165,16 @@
 }
 
 
-bool TypeRef::TestAndAddBuddyToTrail(GrowableObjectArray** trail,
-                                     const Object& buddy) const {
+bool TypeRef::TestAndAddBuddyToTrail(TrailPtr* trail,
+                                     const AbstractType& buddy) const {
   if (*trail == NULL) {
-    *trail = &GrowableObjectArray::ZoneHandle(GrowableObjectArray::New());
+    *trail = new Trail(Thread::Current()->zone(), 4);
   } else {
-    const intptr_t len = (*trail)->Length();
+    const intptr_t len = (*trail)->length();
     ASSERT((len % 2) == 0);
     for (intptr_t i = 0; i < len; i += 2) {
-      if (((*trail)->At(i) == this->raw()) &&
-          ((*trail)->At(i + 1) == buddy.raw())) {
+      if (((*trail)->At(i).raw() == this->raw()) &&
+          ((*trail)->At(i + 1).raw() == buddy.raw())) {
         return true;
       }
     }
@@ -15983,19 +16205,12 @@
       type_class()).Name()).ToCString();
   AbstractType& ref_type = AbstractType::Handle(type());
   if (ref_type.IsFinalized()) {
-    const char* format = "TypeRef: %s<...> (@%" Px " H%" Px ")";
     const intptr_t hash = ref_type.Hash();
-    const intptr_t len =
-        OS::SNPrint(NULL, 0, format, type_cstr, ref_type.raw(), hash) + 1;
-    char* chars = Thread::Current()->zone()->Alloc<char>(len);
-    OS::SNPrint(chars, len, format, type_cstr, ref_type.raw(), hash);
-    return chars;
+    return OS::SCreate(Thread::Current()->zone(),
+        "TypeRef: %s<...> (@%p H%" Px ")", type_cstr, ref_type.raw(), hash);
   } else {
-    const char* format = "TypeRef: %s<...>";
-    const intptr_t len = OS::SNPrint(NULL, 0, format, type_cstr) + 1;
-    char* chars = Thread::Current()->zone()->Alloc<char>(len);
-    OS::SNPrint(chars, len, format, type_cstr);
-    return chars;
+    return OS::SCreate(Thread::Current()->zone(),
+        "TypeRef: %s<...>", type_cstr);
   }
 }
 
@@ -16021,8 +16236,7 @@
 }
 
 
-bool TypeParameter::IsEquivalent(const Instance& other,
-                                 GrowableObjectArray* trail) const {
+bool TypeParameter::IsEquivalent(const Instance& other, TrailPtr trail) const {
   if (raw() == other.raw()) {
     return true;
   }
@@ -16074,7 +16288,8 @@
 RawAbstractType* TypeParameter::InstantiateFrom(
     const TypeArguments& instantiator_type_arguments,
     Error* bound_error,
-    GrowableObjectArray* trail) const {
+    TrailPtr trail,
+    Heap::Space space) const {
   ASSERT(IsFinalized());
   if (instantiator_type_arguments.IsNull()) {
     return Type::DynamicType();
@@ -16091,12 +16306,13 @@
 
 bool TypeParameter::CheckBound(const AbstractType& bounded_type,
                                const AbstractType& upper_bound,
-                               Error* bound_error) const {
+                               Error* bound_error,
+                               Heap::Space space) const {
   ASSERT((bound_error != NULL) && bound_error->IsNull());
   ASSERT(bounded_type.IsFinalized());
   ASSERT(upper_bound.IsFinalized());
   ASSERT(!bounded_type.IsMalformed());
-  if (bounded_type.IsSubtypeOf(upper_bound, bound_error)) {
+  if (bounded_type.IsSubtypeOf(upper_bound, bound_error, space)) {
     return true;
   }
   // Set bound_error if the caller is interested and if this is the first error.
@@ -16150,8 +16366,7 @@
 
 
 RawAbstractType* TypeParameter::CloneUninstantiated(
-    const Class& new_owner,
-    GrowableObjectArray* trail) const {
+    const Class& new_owner, TrailPtr trail) const {
   ASSERT(IsFinalized());
   AbstractType& upper_bound = AbstractType::Handle(bound());
   upper_bound = upper_bound.CloneUninstantiated(new_owner, trail);
@@ -16274,8 +16489,7 @@
 }
 
 
-bool BoundedType::IsEquivalent(const Instance& other,
-                               GrowableObjectArray* trail) const {
+bool BoundedType::IsEquivalent(const Instance& other, TrailPtr trail) const {
   // BoundedType are not canonicalized, because their bound may get finalized
   // after the BoundedType is created and initialized.
   if (raw() == other.raw()) {
@@ -16339,14 +16553,16 @@
 RawAbstractType* BoundedType::InstantiateFrom(
     const TypeArguments& instantiator_type_arguments,
     Error* bound_error,
-    GrowableObjectArray* trail) const {
+    TrailPtr trail,
+    Heap::Space space) const {
   ASSERT(IsFinalized());
   AbstractType& bounded_type = AbstractType::Handle(type());
   ASSERT(bounded_type.IsFinalized());
   if (!bounded_type.IsInstantiated()) {
     bounded_type = bounded_type.InstantiateFrom(instantiator_type_arguments,
                                                 bound_error,
-                                                trail);
+                                                trail,
+                                                space);
     // In case types of instantiator_type_arguments are not finalized, then
     // the instantiated bounded_type is not finalized either.
     // Note that instantiator_type_arguments must have the final length, though.
@@ -16360,7 +16576,8 @@
     if (!upper_bound.IsInstantiated()) {
       upper_bound = upper_bound.InstantiateFrom(instantiator_type_arguments,
                                                 bound_error,
-                                                trail);
+                                                trail,
+                                                space);
       // Instantiated upper_bound may not be finalized. See comment above.
     }
     if (bound_error->IsNull()) {
@@ -16395,8 +16612,7 @@
 
 
 RawAbstractType* BoundedType::CloneUninstantiated(
-    const Class& new_owner,
-    GrowableObjectArray* trail) const {
+    const Class& new_owner, TrailPtr trail) const {
   if (IsInstantiated()) {
     return raw();
   }
@@ -16752,7 +16968,8 @@
 
 
 RawInteger* Integer::ArithmeticOp(Token::Kind operation,
-                                  const Integer& other) const {
+                                  const Integer& other,
+                                  Heap::Space space) const {
   // In 32-bit mode, the result of any operation between two Smis will fit in a
   // 32-bit signed result, except the product of two Smis, which will be 64-bit.
   // In 64-bit mode, the result of any operation between two Smis will fit in a
@@ -16762,14 +16979,15 @@
     const intptr_t right_value = Smi::Value(Smi::RawCast(other.raw()));
     switch (operation) {
       case Token::kADD:
-        return Integer::New(left_value + right_value);
+        return Integer::New(left_value + right_value, space);
       case Token::kSUB:
-        return Integer::New(left_value - right_value);
+        return Integer::New(left_value - right_value, space);
       case Token::kMUL: {
         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
@@ -16777,24 +16995,24 @@
           ASSERT(sizeof(intptr_t) == sizeof(int64_t));
           if ((Utils::HighestBit(left_value) +
                Utils::HighestBit(right_value)) < 62) {
-            return Integer::New(left_value * right_value);
+            return Integer::New(left_value * right_value, space);
           }
         }
         // Perform a Bigint multiplication below.
         break;
       }
       case Token::kTRUNCDIV:
-        return Integer::New(left_value / right_value);
+        return Integer::New(left_value / right_value, space);
       case Token::kMOD: {
         const intptr_t remainder = left_value % right_value;
         if (remainder < 0) {
           if (right_value < 0) {
-            return Integer::New(remainder - right_value);
+            return Integer::New(remainder - right_value, space);
           } else {
-            return Integer::New(remainder + right_value);
+            return Integer::New(remainder + right_value, space);
           }
         }
-        return Integer::New(remainder);
+        return Integer::New(remainder, space);
       }
       default:
         UNIMPLEMENTED();
@@ -16807,27 +17025,27 @@
       case Token::kADD: {
         if (((left_value < 0) != (right_value < 0)) ||
             ((left_value + right_value) < 0) == (left_value < 0)) {
-          return Integer::New(left_value + right_value);
+          return Integer::New(left_value + right_value, space);
         }
         break;
       }
       case Token::kSUB: {
         if (((left_value < 0) == (right_value < 0)) ||
             ((left_value - right_value) < 0) == (left_value < 0)) {
-          return Integer::New(left_value - right_value);
+          return Integer::New(left_value - right_value, space);
         }
         break;
       }
       case Token::kMUL: {
         if ((Utils::HighestBit(left_value) +
              Utils::HighestBit(right_value)) < 62) {
-          return Integer::New(left_value * right_value);
+          return Integer::New(left_value * right_value, space);
         }
         break;
       }
       case Token::kTRUNCDIV: {
         if ((left_value != Mint::kMinValue) || (right_value != -1)) {
-          return Integer::New(left_value / right_value);
+          return Integer::New(left_value / right_value, space);
         }
         break;
       }
@@ -16835,12 +17053,12 @@
         const int64_t remainder = left_value % right_value;
         if (remainder < 0) {
           if (right_value < 0) {
-            return Integer::New(remainder - right_value);
+            return Integer::New(remainder - right_value, space);
           } else {
-            return Integer::New(remainder + right_value);
+            return Integer::New(remainder + right_value, space);
           }
         }
-        return Integer::New(remainder);
+        return Integer::New(remainder, space);
       }
       default:
         UNIMPLEMENTED();
@@ -16855,7 +17073,8 @@
 }
 
 
-RawInteger* Integer::BitOp(Token::Kind kind, const Integer& other) 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()));
@@ -16880,11 +17099,11 @@
     int64_t b = other.AsInt64Value();
     switch (kind) {
       case Token::kBIT_AND:
-        return Integer::New(a & b);
+        return Integer::New(a & b, space);
       case Token::kBIT_OR:
-        return Integer::New(a | b);
+        return Integer::New(a | b, space);
       case Token::kBIT_XOR:
-        return Integer::New(a ^ b);
+        return Integer::New(a ^ b, space);
       default:
         UNIMPLEMENTED();
     }
@@ -16896,6 +17115,7 @@
 // TODO(srdjan): Clarify handling of negative right operand in a shift op.
 RawInteger* Smi::ShiftOp(Token::Kind kind,
                          const Smi& other,
+                         Heap::Space space,
                          const bool silent) const {
   intptr_t result = 0;
   const intptr_t left_value = Value();
@@ -16910,10 +17130,10 @@
         int cnt = Utils::BitLength(left_value);
         if ((cnt + right_value) > Smi::kBits) {
           if ((cnt + right_value) > Mint::kBits) {
-            return Bigint::NewFromShiftedInt64(left_value, right_value);
+            return Bigint::NewFromShiftedInt64(left_value, right_value, space);
           } else {
             int64_t left_64 = left_value;
-            return Integer::New(left_64 << right_value, Heap::kNew, silent);
+            return Integer::New(left_64 << right_value, space, silent);
           }
         }
       }
@@ -16981,12 +17201,7 @@
 
 
 const char* Smi::ToCString() const {
-  const char* kFormat = "%ld";
-  // Calculate the size of the string.
-  intptr_t len = OS::SNPrint(NULL, 0, kFormat, Value()) + 1;
-  char* chars = Thread::Current()->zone()->Alloc<char>(len);
-  OS::SNPrint(chars, len, kFormat, Value());
-  return chars;
+  return OS::SCreate(Thread::Current()->zone(), "%" Pd "", Value());
 }
 
 
@@ -17112,12 +17327,7 @@
 
 
 const char* Mint::ToCString() const {
-  const char* kFormat = "%lld";
-  // Calculate the size of the string.
-  intptr_t len = OS::SNPrint(NULL, 0, kFormat, value()) + 1;
-  char* chars = Thread::Current()->zone()->Alloc<char>(len);
-  OS::SNPrint(chars, len, kFormat, value());
-  return chars;
+  return OS::SCreate(Thread::Current()->zone(), "%" Pd64 "", value());
 }
 
 
@@ -17362,9 +17572,11 @@
 
 
 RawBigint* Bigint::New(Heap::Space space) {
-  Isolate* isolate = Isolate::Current();
+  Thread* thread = Thread::Current();
+  Zone* zone = thread->zone();
+  Isolate* isolate = thread->isolate();
   ASSERT(isolate->object_store()->bigint_class() != Class::null());
-  Bigint& result = Bigint::Handle(isolate);
+  Bigint& result = Bigint::Handle(zone);
   {
     RawObject* raw = Object::Allocate(Bigint::kClassId,
                                       Bigint::InstanceSize(),
@@ -17375,7 +17587,7 @@
   result.SetNeg(false);
   result.SetUsed(0);
   result.set_digits(
-      TypedData::Handle(isolate, TypedData::EmptyUint32Array(isolate)));
+      TypedData::Handle(zone, TypedData::EmptyUint32Array(isolate)));
   return result.raw();
 }
 
@@ -17384,9 +17596,11 @@
                        Heap::Space space) {
   ASSERT((used == 0) ||
          (!digits.IsNull() && (digits.Length() >= (used + (used & 1)))));
-  Isolate* isolate = Isolate::Current();
+  Thread* thread = Thread::Current();
+  Zone* zone = thread->zone();
+  Isolate* isolate = thread->isolate();
   ASSERT(isolate->object_store()->bigint_class() != Class::null());
-  Bigint& result = Bigint::Handle(isolate);
+  Bigint& result = Bigint::Handle(zone);
   {
     RawObject* raw = Object::Allocate(Bigint::kClassId,
                                       Bigint::InstanceSize(),
@@ -17407,7 +17621,7 @@
   } else {
     neg = false;
     result.set_digits(
-        TypedData::Handle(isolate, TypedData::EmptyUint32Array(isolate)));
+        TypedData::Handle(zone, TypedData::EmptyUint32Array(isolate)));
   }
   result.SetNeg(neg);
   result.SetUsed(used);
@@ -18089,6 +18303,11 @@
 }
 
 
+intptr_t String::Hash(const char* characters, intptr_t len) {
+  return HashImpl(characters, len);
+}
+
+
 intptr_t String::Hash(const uint8_t* characters, intptr_t len) {
   return HashImpl(characters, len);
 }
@@ -18682,7 +18901,18 @@
 }
 
 
-RawString* String::NewFormattedV(const char* format, va_list args) {
+RawString* String::NewFormatted(Heap::Space space, const char* format, ...) {
+  va_list args;
+  va_start(args, format);
+  RawString* result = NewFormattedV(format, args, space);
+  NoSafepointScope no_safepoint;
+  va_end(args);
+  return result;
+}
+
+
+RawString* String::NewFormattedV(const char* format, va_list args,
+                                 Heap::Space space) {
   va_list args_copy;
   va_copy(args_copy, args);
   intptr_t len = OS::VSNPrint(NULL, 0, format, args_copy);
@@ -18692,7 +18922,7 @@
   char* buffer = zone->Alloc<char>(len + 1);
   OS::VSNPrint(buffer, (len + 1), format, args);
 
-  return String::New(buffer);
+  return String::New(buffer, space);
 }
 
 
@@ -19876,17 +20106,17 @@
 RawArray* Array::Grow(const Array& source,
                       intptr_t new_length,
                       Heap::Space space) {
-  Isolate* isolate = Isolate::Current();
-  const Array& result = Array::Handle(isolate, Array::New(new_length, space));
+  Zone* zone = Thread::Current()->zone();
+  const Array& result = Array::Handle(zone, Array::New(new_length, space));
   intptr_t len = 0;
   if (!source.IsNull()) {
     len = source.Length();
     result.SetTypeArguments(
-        TypeArguments::Handle(isolate, source.GetTypeArguments()));
+        TypeArguments::Handle(zone, source.GetTypeArguments()));
   }
   ASSERT(new_length >= len);  // Cannot copy 'source' into new array.
   ASSERT(new_length != len);  // Unnecessary copying of array.
-  PassiveObject& obj = PassiveObject::Handle(isolate);
+  PassiveObject& obj = PassiveObject::Handle(zone);
   for (int i = 0; i < len; i++) {
     obj = source.At(i);
     result.SetAt(i, obj);
@@ -19907,8 +20137,8 @@
     return Object::empty_array().raw();
   }
   intptr_t capacity_len = growable_array.Capacity();
-  Isolate* isolate = Isolate::Current();
-  const Array& array = Array::Handle(isolate, growable_array.data());
+  Zone* zone = Thread::Current()->zone();
+  const Array& array = Array::Handle(zone, growable_array.data());
   array.SetTypeArguments(type_arguments);
   intptr_t capacity_size = Array::InstanceSize(capacity_len);
   intptr_t used_size = Array::InstanceSize(used_len);
@@ -19960,11 +20190,8 @@
         this->SetAt(i, obj);
       } else {
         ASSERT(error_str != NULL);
-        const char* kFormat = "element at index %" Pd ": %s\n";
-        const intptr_t len =
-            OS::SNPrint(NULL, 0, kFormat, i, obj.ToCString()) + 1;
-        char* chars = Thread::Current()->zone()->Alloc<char>(len);
-        OS::SNPrint(chars, len, kFormat, i, obj.ToCString());
+        char* chars = OS::SCreate(Thread::Current()->zone(),
+            "element at index %" Pd ": %s\n", i, obj.ToCString());
         *error_str = chars;
         return false;
       }
@@ -20088,11 +20315,8 @@
   if (IsNull()) {
     return "_GrowableList NULL";
   }
-  const char* format = "Instance(length:%" Pd ") of '_GrowableList'";
-  intptr_t len = OS::SNPrint(NULL, 0, format, Length()) + 1;
-  char* chars = Thread::Current()->zone()->Alloc<char>(len);
-  OS::SNPrint(chars, len, format, Length());
-  return chars;
+  return OS::SCreate(Thread::Current()->zone(),
+      "Instance(length:%" Pd ") of '_GrowableList'", Length());
 }
 
 
@@ -20133,9 +20357,9 @@
     }
     // TODO(koda): Ensure VM classes only produce Smi hash codes, and remove
     // non-Smi cases once Dart-side implementation is complete.
-    Isolate* isolate = Isolate::Current();
-    REUSABLE_INSTANCE_HANDLESCOPE(isolate);
-    Instance& hash_code = isolate->InstanceHandle();
+    Thread* thread = Thread::Current();
+    REUSABLE_INSTANCE_HANDLESCOPE(thread);
+    Instance& hash_code = thread->InstanceHandle();
     hash_code ^= Instance::Cast(obj).HashCode();
     if (hash_code.IsSmi()) {
       // May waste some bits on 64-bit, to ensure consistency with non-Smi case.
@@ -20314,21 +20538,21 @@
 
 
 const char* Float32x4::ToCString() const {
-  const char* kFormat = "[%f, %f, %f, %f]";
   float _x = x();
   float _y = y();
   float _z = z();
   float _w = w();
-  // Calculate the size of the string.
-  intptr_t len = OS::SNPrint(NULL, 0, kFormat, _x, _y, _z, _w) + 1;
-  char* chars = Thread::Current()->zone()->Alloc<char>(len);
-  OS::SNPrint(chars, len, kFormat, _x, _y, _z, _w);
-  return chars;
+  return OS::SCreate(Thread::Current()->zone(),
+      "[%f, %f, %f, %f]", _x, _y, _z, _w);
 }
 
 
 void Float32x4::PrintJSONImpl(JSONStream* stream, bool ref) const {
-  Instance::PrintJSONImpl(stream, ref);
+  JSONObject jsobj(stream);
+  PrintSharedInstanceJSON(&jsobj, ref);
+  jsobj.AddProperty("kind", "Float32x4");
+  jsobj.AddServiceId(*this);
+  jsobj.AddProperty("valueAsString", ToCString());
 }
 
 
@@ -20419,21 +20643,21 @@
 
 
 const char* Int32x4::ToCString() const {
-  const char* kFormat = "[%08x, %08x, %08x, %08x]";
   int32_t _x = x();
   int32_t _y = y();
   int32_t _z = z();
   int32_t _w = w();
-  // Calculate the size of the string.
-  intptr_t len = OS::SNPrint(NULL, 0, kFormat, _x, _y, _z, _w) + 1;
-  char* chars = Thread::Current()->zone()->Alloc<char>(len);
-  OS::SNPrint(chars, len, kFormat, _x, _y, _z, _w);
-  return chars;
+  return OS::SCreate(Thread::Current()->zone(),
+      "[%08x, %08x, %08x, %08x]", _x, _y, _z, _w);
 }
 
 
 void Int32x4::PrintJSONImpl(JSONStream* stream, bool ref) const {
-  Instance::PrintJSONImpl(stream, ref);
+  JSONObject jsobj(stream);
+  PrintSharedInstanceJSON(&jsobj, ref);
+  jsobj.AddProperty("kind", "Int32x4");
+  jsobj.AddServiceId(*this);
+  jsobj.AddProperty("valueAsString", ToCString());
 }
 
 
@@ -20501,19 +20725,18 @@
 
 
 const char* Float64x2::ToCString() const {
-  const char* kFormat = "[%f, %f]";
   double _x = x();
   double _y = y();
-  // Calculate the size of the string.
-  intptr_t len = OS::SNPrint(NULL, 0, kFormat, _x, _y) + 1;
-  char* chars = Thread::Current()->zone()->Alloc<char>(len);
-  OS::SNPrint(chars, len, kFormat, _x, _y);
-  return chars;
+  return OS::SCreate(Thread::Current()->zone(), "[%f, %f]", _x, _y);
 }
 
 
 void Float64x2::PrintJSONImpl(JSONStream* stream, bool ref) const {
-  Instance::PrintJSONImpl(stream, ref);
+  JSONObject jsobj(stream);
+  PrintSharedInstanceJSON(&jsobj, ref);
+  jsobj.AddProperty("kind", "Float64x2");
+  jsobj.AddServiceId(*this);
+  jsobj.AddProperty("valueAsString", ToCString());
 }
 
 
@@ -20591,7 +20814,7 @@
     // Already created.
     return isolate->object_store()->empty_uint32_array();
   }
-  const TypedData& array = TypedData::Handle(isolate,
+  const TypedData& array = TypedData::Handle(isolate->current_zone(),
       TypedData::New(kTypedDataUint32ArrayCid, 0, Heap::kOld));
   isolate->object_store()->set_empty_uint32_array(array);
   return array.raw();
@@ -20703,11 +20926,12 @@
                                  bool is_control_port,
                                  Heap::Space space) {
   ASSERT(id != ILLEGAL_PORT);
-  Isolate* isolate = Isolate::Current();
+  Thread* thread = Thread::Current();
+  Zone* zone = thread->zone();
   const SendPort& send_port =
-      SendPort::Handle(isolate, SendPort::New(id, isolate->origin_id()));
+      SendPort::Handle(zone, SendPort::New(id, thread->isolate()->origin_id()));
 
-  ReceivePort& result = ReceivePort::Handle(isolate);
+  ReceivePort& result = ReceivePort::Handle(zone);
   {
     RawObject* raw = Object::Allocate(ReceivePort::kClassId,
                                       ReceivePort::InstanceSize(),
@@ -20774,11 +20998,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() : "";
-  const char* format = "Closure: %s%s%s";
-  intptr_t len = OS::SNPrint(NULL, 0, format, fun_sig, from, fun_desc) + 1;
-  char* chars = Thread::Current()->zone()->Alloc<char>(len);
-  OS::SNPrint(chars, len, format, fun_sig, from, fun_desc);
-  return chars;
+  return OS::SCreate(Thread::Current()->zone(),
+      "Closure: %s%s%s", fun_sig, from, fun_desc);
 }
 
 
@@ -20875,20 +21096,19 @@
 }
 
 
-RawString* Stacktrace::FullStacktrace() const {
-  intptr_t idx = 0;
-  return String::New(ToCStringInternal(&idx));
-}
-
-
 const char* Stacktrace::ToCString() const {
-  const String& trace = String::Handle(FullStacktrace());
-  return trace.ToCString();
+  intptr_t idx = 0;
+  return ToCStringInternal(&idx);
 }
 
 
 void Stacktrace::PrintJSONImpl(JSONStream* stream, bool ref) const {
-  Instance::PrintJSONImpl(stream, ref);
+  JSONObject jsobj(stream);
+  PrintSharedInstanceJSON(&jsobj, ref);
+  jsobj.AddProperty("kind", "StackTrace");
+  jsobj.AddServiceId(*this);
+  intptr_t idx = 0;
+  jsobj.AddProperty("valueAsString", ToCStringInternal(&idx));
 }
 
 
@@ -20898,9 +21118,6 @@
                                    const Function& function,
                                    const Code& code,
                                    intptr_t frame_index) {
-  const char* kFormatWithCol = "#%-6d %s (%s:%d:%d)\n";
-  const char* kFormatNoCol = "#%-6d %s (%s:%d)\n";
-  const char* kFormatNoLine = "#%-6d %s (%s)\n";
   const intptr_t token_pos = code.GetTokenIndexOfPC(pc);
   const Script& script = Script::Handle(zone, function.script());
   const String& function_name =
@@ -20915,36 +21132,22 @@
       script.GetTokenLocation(token_pos, &line, NULL);
     }
   }
-  intptr_t len = 0;
   char* chars = NULL;
   if (column >= 0) {
-    len = OS::SNPrint(NULL, 0, kFormatWithCol,
-                      frame_index, function_name.ToCString(),
-                      url.ToCString(), line, column);
-    chars = zone->Alloc<char>(len + 1);
-    OS::SNPrint(chars, (len + 1), kFormatWithCol,
-                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) {
-    len = OS::SNPrint(NULL, 0, kFormatNoCol,
-                      frame_index, function_name.ToCString(),
-                      url.ToCString(), line);
-    chars = zone->Alloc<char>(len + 1);
-    OS::SNPrint(chars, (len + 1), kFormatNoCol,
-                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 {
-    len = OS::SNPrint(NULL, 0, kFormatNoLine,
-                      frame_index, function_name.ToCString(),
-                      url.ToCString());
-    chars = zone->Alloc<char>(len + 1);
-    OS::SNPrint(chars, (len + 1), kFormatNoLine,
-                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 len;
+  return strlen(chars);
 }
 
 
@@ -21111,11 +21314,8 @@
 
 const char* JSRegExp::ToCString() const {
   const String& str = String::Handle(pattern());
-  const char* format = "JSRegExp: pattern=%s flags=%s";
-  intptr_t len = OS::SNPrint(NULL, 0, format, str.ToCString(), Flags());
-  char* chars = Thread::Current()->zone()->Alloc<char>(len + 1);
-  OS::SNPrint(chars, (len + 1), format, str.ToCString(), Flags());
-  return chars;
+  return OS::SCreate(Thread::Current()->zone(),
+      "JSRegExp: pattern=%s flags=%s", str.ToCString(), Flags());
 }
 
 
@@ -21131,6 +21331,9 @@
     return;
   }
 
+  jsobj.AddProperty("isCaseSensitive", !is_ignore_case());
+  jsobj.AddProperty("isMultiLine", is_multi_line());
+
   Function& func = Function::Handle();
   func = function(kOneByteStringCid);
   jsobj.AddProperty("_oneByteFunction", func);
@@ -21283,14 +21486,16 @@
 
 
 RawUserTag* UserTag::DefaultTag() {
-  Isolate* isolate = Isolate::Current();
+  Thread* thread = Thread::Current();
+  Zone* zone = thread->zone();
+  Isolate* isolate = thread->isolate();
   ASSERT(isolate != NULL);
   if (isolate->default_tag() != UserTag::null()) {
     // Already created.
     return isolate->default_tag();
   }
   // Create default tag.
-  const UserTag& result = UserTag::Handle(isolate,
+  const UserTag& result = UserTag::Handle(zone,
                                           UserTag::New(Symbols::Default()));
   ASSERT(result.tag() == UserTags::kDefaultUserTag);
   isolate->set_default_tag(result);
@@ -21301,9 +21506,9 @@
 RawUserTag* UserTag::FindTagInIsolate(Isolate* isolate, const String& label) {
   ASSERT(isolate->tag_table() != GrowableObjectArray::null());
   const GrowableObjectArray& tag_table = GrowableObjectArray::Handle(
-      isolate, isolate->tag_table());
-  UserTag& other = UserTag::Handle(isolate);
-  String& tag_label = String::Handle(isolate);
+      isolate->current_zone(), isolate->tag_table());
+  UserTag& other = UserTag::Handle(isolate->current_zone());
+  String& tag_label = String::Handle(isolate->current_zone());
   for (intptr_t i = 0; i < tag_table.Length(); i++) {
     other ^= tag_table.At(i);
     ASSERT(!other.IsNull());
@@ -21320,11 +21525,11 @@
 void UserTag::AddTagToIsolate(Isolate* isolate, const UserTag& tag) {
   ASSERT(isolate->tag_table() != GrowableObjectArray::null());
   const GrowableObjectArray& tag_table = GrowableObjectArray::Handle(
-      isolate, isolate->tag_table());
+      isolate->current_zone(), isolate->tag_table());
   ASSERT(!TagTableIsFull(isolate));
 #if defined(DEBUG)
   // Verify that no existing tag has the same tag id.
-  UserTag& other = UserTag::Handle(isolate);
+  UserTag& other = UserTag::Handle(isolate->current_zone());
   for (intptr_t i = 0; i < tag_table.Length(); i++) {
     other ^= tag_table.At(i);
     ASSERT(!other.IsNull());
@@ -21344,18 +21549,20 @@
 bool UserTag::TagTableIsFull(Isolate* isolate) {
   ASSERT(isolate->tag_table() != GrowableObjectArray::null());
   const GrowableObjectArray& tag_table = GrowableObjectArray::Handle(
-      isolate, isolate->tag_table());
+      isolate->current_zone(), isolate->tag_table());
   ASSERT(tag_table.Length() <= UserTags::kMaxUserTags);
   return tag_table.Length() == UserTags::kMaxUserTags;
 }
 
 
 RawUserTag* UserTag::FindTagById(uword tag_id) {
-  Isolate* isolate = Isolate::Current();
+  Thread* thread = Thread::Current();
+  Zone* zone = thread->zone();
+  Isolate* isolate = thread->isolate();
   ASSERT(isolate->tag_table() != GrowableObjectArray::null());
   const GrowableObjectArray& tag_table = GrowableObjectArray::Handle(
-      isolate, isolate->tag_table());
-  UserTag& tag = UserTag::Handle(isolate);
+      zone, isolate->tag_table());
+  UserTag& tag = UserTag::Handle(zone);
   for (intptr_t i = 0; i < tag_table.Length(); i++) {
     tag ^= tag_table.At(i);
     if (tag.tag() == tag_id) {
diff --git a/runtime/vm/object.h b/runtime/vm/object.h
index 16dc598..1193686 100644
--- a/runtime/vm/object.h
+++ b/runtime/vm/object.h
@@ -12,6 +12,7 @@
 #include "vm/bitmap.h"
 #include "vm/dart.h"
 #include "vm/globals.h"
+#include "vm/growable_array.h"
 #include "vm/handles.h"
 #include "vm/heap.h"
 #include "vm/isolate.h"
@@ -64,20 +65,12 @@
     initializeHandle(obj, raw_ptr);                                            \
     return *obj;                                                               \
   }                                                                            \
-  /* DEPRECATED: Use Zone version. */                                          \
-  static object& Handle(Isolate* isolate, Raw##object* raw_ptr) {              \
-    return Handle(isolate->current_zone(), raw_ptr);                           \
-  }                                                                            \
   static object& Handle() {                                                    \
     return Handle(Thread::Current()->zone(), object::null());                  \
   }                                                                            \
   static object& Handle(Zone* zone) {                                          \
     return Handle(zone, object::null());                                       \
   }                                                                            \
-  /* DEPRECATED: Use Zone version. */                                          \
-  static object& Handle(Isolate* isolate) {                                    \
-    return Handle(isolate->current_zone(), object::null());                    \
-  }                                                                            \
   static object& Handle(Raw##object* raw_ptr) {                                \
     return Handle(Thread::Current()->zone(), raw_ptr);                         \
   }                                                                            \
@@ -179,7 +172,8 @@
   static Raw##object* ReadFrom(SnapshotReader* reader,                         \
                                intptr_t object_id,                             \
                                intptr_t tags,                                  \
-                               Snapshot::Kind);                                \
+                               Snapshot::Kind,                                 \
+                               bool as_reference);                             \
   friend class SnapshotReader;                                                 \
 
 #define OBJECT_IMPLEMENTATION(object, super)                                   \
@@ -202,8 +196,8 @@
     return raw()->ptr();                                                       \
   }                                                                            \
   SNAPSHOT_READER_SUPPORT(object)                                              \
-  friend class Isolate;                                                        \
   friend class StackFrame;                                                     \
+  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)        \
@@ -227,8 +221,8 @@
     return -kWordSize;                                                         \
   }                                                                            \
   SNAPSHOT_READER_SUPPORT(rettype)                                             \
-  friend class Isolate;                                                        \
   friend class StackFrame;                                                     \
+  friend class Thread;                                                         \
 
 #define FINAL_HEAP_OBJECT_IMPLEMENTATION(object, super)                        \
   FINAL_HEAP_OBJECT_IMPLEMENTATION_HELPER(object, object, super)               \
@@ -326,10 +320,6 @@
     initializeHandle(obj, raw_ptr);
     return *obj;
   }
-  // DEPRECATED: Use Zone version.
-  static Object& Handle(Isolate* isolate, RawObject* raw_ptr) {
-    return Handle(isolate->current_zone(), raw_ptr);
-  }
   static Object* ReadOnlyHandle() {
     Object* obj = reinterpret_cast<Object*>(
         Dart::AllocateReadOnlyHandle());
@@ -338,19 +328,15 @@
   }
 
   static Object& Handle() {
-    return Handle(Isolate::Current(), null_);
+    return Handle(Thread::Current()->zone(), null_);
   }
 
   static Object& Handle(Zone* zone) {
     return Handle(zone, null_);
   }
-  // DEPRECATED: Use Zone version.
-  static Object& Handle(Isolate* isolate) {
-    return Handle(isolate->current_zone(), null_);
-  }
 
   static Object& Handle(RawObject* raw_ptr) {
-    return Handle(Isolate::Current(), raw_ptr);
+    return Handle(Thread::Current()->zone(), raw_ptr);
   }
 
   static Object& ZoneHandle(Zone* zone, RawObject* raw_ptr) {
@@ -400,6 +386,11 @@
     return *zero_array_;
   }
 
+  static const ContextScope& empty_context_scope() {
+    ASSERT(empty_context_scope_ != NULL);
+    return *empty_context_scope_;
+  }
+
   static const ObjectPool& empty_object_pool() {
     ASSERT(empty_object_pool_ != NULL);
     return *empty_object_pool_;
@@ -790,6 +781,7 @@
   static TypeArguments* null_type_arguments_;
   static Array* empty_array_;
   static Array* zero_array_;
+  static ContextScope* empty_context_scope_;
   static ObjectPool* empty_object_pool_;
   static PcDescriptors* empty_descriptors_;
   static LocalVarDescriptors* empty_var_descriptors_;
@@ -815,7 +807,8 @@
   friend class TwoByteString;
   friend class ExternalOneByteString;
   friend class ExternalTwoByteString;
-  friend class Isolate;
+  friend class Thread;
+
 #define REUSABLE_FRIEND_DECLARATION(name)                                      \
   friend class Reusable##name##HandleScope;
 REUSABLE_HANDLE_LIST(REUSABLE_FRIEND_DECLARATION)
@@ -842,23 +835,15 @@
     obj->set_vtable(0);
     return *obj;
   }
-  // DEPRECATED - use Zone version.
-  static PassiveObject& Handle(Isolate* I, RawObject* raw_ptr) {
-    return Handle(I->current_zone(), raw_ptr);
-  }
   static PassiveObject& Handle(RawObject* raw_ptr) {
-    return Handle(Isolate::Current(), raw_ptr);
+    return Handle(Thread::Current()->zone(), raw_ptr);
   }
   static PassiveObject& Handle() {
-    return Handle(Isolate::Current(), Object::null());
+    return Handle(Thread::Current()->zone(), Object::null());
   }
   static PassiveObject& Handle(Zone* zone) {
     return Handle(zone, Object::null());
   }
-  // DEPRECATED - use Zone version.
-  static PassiveObject& Handle(Isolate* I) {
-    return Handle(I, Object::null());
-  }
   static PassiveObject& ZoneHandle(Zone* zone, RawObject* raw_ptr) {
     PassiveObject* obj = reinterpret_cast<PassiveObject*>(
         VMHandles::AllocateZoneHandle(zone));
@@ -986,9 +971,9 @@
       return raw_ptr()->type_parameters_;
   }
   void set_type_parameters(const TypeArguments& value) const;
-  intptr_t NumTypeParameters(Isolate* isolate) const;
+  intptr_t NumTypeParameters(Thread* thread) const;
   intptr_t NumTypeParameters() const {
-    return NumTypeParameters(Isolate::Current());
+    return NumTypeParameters(Thread::Current());
   }
   static intptr_t type_parameters_offset() {
     return OFFSET_OF(RawClass, type_parameters_);
@@ -1034,12 +1019,16 @@
     return OFFSET_OF(RawClass, type_arguments_field_offset_in_words_);
   }
 
-  RawType* CanonicalType() const {
-    if ((NumTypeArguments() == 0) && !IsSignatureClass()) {
-      return reinterpret_cast<RawType*>(raw_ptr()->canonical_types_);
-    }
-    return reinterpret_cast<RawType*>(Object::null());
-  }
+  // Returns the cached canonical type of this class, i.e. the canonical type
+  // whose type class is this class and whose type arguments are the
+  // uninstantiated type parameters declared by this class if it is generic,
+  // e.g. Map<K, V>.
+  // Returns Type::null() if the canonical type is not cached yet.
+  RawType* CanonicalType() const;
+
+  // Caches the canonical type of this class.
+  void SetCanonicalType(const Type& type) const;
+
   static intptr_t canonical_types_offset() {
     return OFFSET_OF(RawClass, canonical_types_);
   }
@@ -1115,24 +1104,28 @@
   bool IsSubtypeOf(const TypeArguments& type_arguments,
                    const Class& other,
                    const TypeArguments& other_type_arguments,
-                   Error* bound_error) const {
+                   Error* bound_error,
+                   Heap::Space space = Heap::kNew) const {
     return TypeTest(kIsSubtypeOf,
                     type_arguments,
                     other,
                     other_type_arguments,
-                    bound_error);
+                    bound_error,
+                    space);
   }
 
   // Check the 'more specific' relationship.
   bool IsMoreSpecificThan(const TypeArguments& type_arguments,
                           const Class& other,
                           const TypeArguments& other_type_arguments,
-                          Error* bound_error) const {
+                          Error* bound_error,
+                          Heap::Space space = Heap::kNew) const {
     return TypeTest(kIsMoreSpecificThan,
                     type_arguments,
                     other,
                     other_type_arguments,
-                    bound_error);
+                    bound_error,
+                    space);
   }
 
   // Check if this is the top level class.
@@ -1143,7 +1136,7 @@
   RawArray* fields() const { return raw_ptr()->fields_; }
   void SetFields(const Array& value) const;
   void AddField(const Field& field) const;
-  void AddFields(const GrowableObjectArray& fields) const;
+  void AddFields(const GrowableArray<const Field*>& fields) const;
   intptr_t FindFieldIndex(const Field& field) const;
   RawField* FieldFromIndex(intptr_t idx) const;
 
@@ -1167,6 +1160,7 @@
   RawGrowableObjectArray* closures() const {
     return raw_ptr()->closure_functions_;
   }
+  void set_closures(const GrowableObjectArray& value) const;
   void AddClosureFunction(const Function& function) const;
   RawFunction* LookupClosureFunction(intptr_t token_pos) const;
   intptr_t FindClosureIndex(const Function& function) const;
@@ -1193,7 +1187,6 @@
 
   void InsertCanonicalConstant(intptr_t index, const Instance& constant) const;
 
-  intptr_t NumCanonicalTypes() const;
   intptr_t FindCanonicalTypeIndex(const Type& needle) const;
   RawType* CanonicalTypeFromIndex(intptr_t idx) const;
 
@@ -1299,7 +1292,8 @@
 
   RawFunction* GetInvocationDispatcher(const String& target_name,
                                        const Array& args_desc,
-                                       RawFunction::Kind kind) const;
+                                       RawFunction::Kind kind,
+                                       bool create_if_absent) const;
 
   void Finalize() const;
 
@@ -1316,7 +1310,7 @@
                       const Array& param_names,
                       const Array& param_values) const;
 
-  RawError* EnsureIsFinalized(Isolate* isolate) const;
+  RawError* EnsureIsFinalized(Thread* thread) const;
 
   // Allocate a class used for VM internal objects.
   template <class FakeObject> static RawClass* New();
@@ -1473,7 +1467,8 @@
                 const TypeArguments& type_arguments,
                 const Class& other,
                 const TypeArguments& other_type_arguments,
-                Error* bound_error) const;
+                Error* bound_error,
+                Heap::Space space) const;
 
   static bool TypeTestNonRecursive(
       const Class& cls,
@@ -1481,7 +1476,8 @@
       const TypeArguments& type_arguments,
       const Class& other,
       const TypeArguments& other_type_arguments,
-      Error* bound_error);
+      Error* bound_error,
+      Heap::Space space);
 
   FINAL_HEAP_OBJECT_IMPLEMENTATION(Class, Object);
   friend class AbstractType;
@@ -1524,6 +1520,9 @@
 };
 
 
+typedef ZoneGrowableHandlePtrArray<const AbstractType> Trail;
+typedef ZoneGrowableHandlePtrArray<const AbstractType>* TrailPtr;
+
 // A TypeArguments is an array of AbstractType.
 class TypeArguments : public Object {
  public:
@@ -1571,8 +1570,9 @@
   bool IsSubtypeOf(const TypeArguments& other,
                    intptr_t from_index,
                    intptr_t len,
-                   Error* bound_error) const {
-    return TypeTest(kIsSubtypeOf, other, from_index, len, bound_error);
+                   Error* bound_error,
+                   Heap::Space space = Heap::kNew) const {
+    return TypeTest(kIsSubtypeOf, other, from_index, len, bound_error, space);
   }
 
   // Check the 'more specific' relationship, considering only a subvector of
@@ -1580,8 +1580,10 @@
   bool IsMoreSpecificThan(const TypeArguments& other,
                           intptr_t from_index,
                           intptr_t len,
-                          Error* bound_error) const {
-    return TypeTest(kIsMoreSpecificThan, other, from_index, len, bound_error);
+                          Error* bound_error,
+                          Heap::Space space = Heap::kNew) const {
+    return TypeTest(kIsMoreSpecificThan,
+        other, from_index, len, bound_error, space);
   }
 
   // Check if the vectors are equal (they may be null).
@@ -1589,22 +1591,21 @@
     return IsSubvectorEquivalent(other, 0, IsNull() ? 0 : Length());
   }
 
-  bool IsEquivalent(const TypeArguments& other,
-                    GrowableObjectArray* trail = NULL) const {
+  bool IsEquivalent(const TypeArguments& other, TrailPtr trail = NULL) const {
     return IsSubvectorEquivalent(other, 0, IsNull() ? 0 : Length(), trail);
   }
   bool IsSubvectorEquivalent(const TypeArguments& other,
                              intptr_t from_index,
                              intptr_t len,
-                             GrowableObjectArray* trail = NULL) const;
+                             TrailPtr trail = NULL) const;
 
   // Check if the vector is instantiated (it must not be null).
-  bool IsInstantiated(GrowableObjectArray* trail = NULL) const {
+  bool IsInstantiated(TrailPtr trail = NULL) const {
     return IsSubvectorInstantiated(0, Length(), trail);
   }
   bool IsSubvectorInstantiated(intptr_t from_index,
                                intptr_t len,
-                               GrowableObjectArray* trail = NULL) const;
+                               TrailPtr trail = NULL) const;
   bool IsUninstantiatedIdentity() const;
   bool CanShareInstantiatorTypeArguments(const Class& instantiator_class) const;
 
@@ -1625,11 +1626,10 @@
   // arguments, changing the class owner of type parameters.
   // Instantiated type arguments are shared.
   RawTypeArguments* CloneUninstantiated(
-      const Class& new_owner,
-      GrowableObjectArray* trail = NULL) const;
+      const Class& new_owner, TrailPtr trail = NULL) const;
 
   // Canonicalize only if instantiated, otherwise returns 'this'.
-  RawTypeArguments* Canonicalize(GrowableObjectArray* trail = NULL) const;
+  RawTypeArguments* Canonicalize(TrailPtr trail = NULL) const;
 
   // Return 'this' if this type argument vector is instantiated, i.e. if it does
   // not refer to type parameters. Otherwise, return a new type argument vector
@@ -1639,7 +1639,8 @@
   RawTypeArguments* InstantiateFrom(
       const TypeArguments& instantiator_type_arguments,
       Error* bound_error,
-      GrowableObjectArray* trail = NULL) const;
+      TrailPtr trail = NULL,
+      Heap::Space space = Heap::kNew) const;
 
   // Runtime instantiation with canonicalization. Not to be used during type
   // finalization at compile time.
@@ -1694,7 +1695,8 @@
                 const TypeArguments& other,
                 intptr_t from_index,
                 intptr_t len,
-                Error* bound_error) const;
+                Error* bound_error,
+                Heap::Space space) const;
 
   // Return the internal or public name of a subvector of this type argument
   // vector, e.g. "<T, dynamic, List<T>, int>".
@@ -1722,6 +1724,10 @@
   static intptr_t InstanceSize() {
     return RoundedAllocationSize(sizeof(RawPatchClass));
   }
+  static bool IsInFullSnapshot(RawPatchClass* cls) {
+    NoSafepointScope no_safepoint;
+    return Class::IsInFullSnapshot(cls->ptr()->patched_class_);
+  }
 
   static RawPatchClass* New(const Class& patched_class,
                             const Class& source_class);
@@ -2002,6 +2008,8 @@
                         bool is_static_call) const;
 
  private:
+  static RawICData* New();
+
   RawArray* ic_data() const {
     return raw_ptr()->ic_data_;
   }
@@ -2104,13 +2112,10 @@
   RawClass* origin() const;
   RawScript* script() const;
 
-  void set_regexp(const JSRegExp& value) const;
   RawJSRegExp* regexp() const;
-
-  // Get and set the class id this function is specialized for. Only set for
-  // irregexp functions.
-  intptr_t regexp_cid() const { return raw_ptr()->regexp_cid_; }
-  void set_regexp_cid(intptr_t regexp_cid) const;
+  intptr_t string_specialization_cid() const;
+  void SetRegExpData(const JSRegExp& regexp,
+                     intptr_t string_specialization_cid) const;
 
   RawAbstractType* result_type() const { return raw_ptr()->result_type_; }
   void set_result_type(const AbstractType& value) const;
@@ -2138,15 +2143,19 @@
   // 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()->instructions_->ptr()->code_;
+    return raw_ptr()->code_;
   }
 
   RawCode* unoptimized_code() const { return raw_ptr()->unoptimized_code_; }
   void set_unoptimized_code(const Code& value) const;
   bool HasCode() const;
 
-  static intptr_t instructions_offset() {
-    return OFFSET_OF(RawFunction, instructions_);
+  static intptr_t code_offset() {
+    return OFFSET_OF(RawFunction, code_);
+  }
+
+  static intptr_t entry_point_offset() {
+    return OFFSET_OF(RawFunction, entry_point_);
   }
 
   // Returns true if there is at least one debugger breakpoint
@@ -2406,12 +2415,14 @@
   bool IsSubtypeOf(const TypeArguments& type_arguments,
                    const Function& other,
                    const TypeArguments& other_type_arguments,
-                   Error* bound_error) const {
+                   Error* bound_error,
+                   Heap::Space space = Heap::kNew) const {
     return TypeTest(kIsSubtypeOf,
                     type_arguments,
                     other,
                     other_type_arguments,
-                    bound_error);
+                    bound_error,
+                    space);
   }
 
   // Returns true if the type of this function is more specific than the type of
@@ -2419,12 +2430,14 @@
   bool IsMoreSpecificThan(const TypeArguments& type_arguments,
                           const Function& other,
                           const TypeArguments& other_type_arguments,
-                          Error* bound_error) const {
+                          Error* bound_error,
+                   Heap::Space space = Heap::kNew) const {
     return TypeTest(kIsMoreSpecificThan,
                     type_arguments,
                     other,
                     other_type_arguments,
-                    bound_error);
+                    bound_error,
+                    space);
   }
 
   // Returns true if this function represents an explicit getter function.
@@ -2570,7 +2583,8 @@
 
   // Works with map [deopt-id] -> ICData.
   void SaveICDataMap(
-      const ZoneGrowableArray<const ICData*>& deopt_id_to_ic_data) const;
+      const ZoneGrowableArray<const ICData*>& deopt_id_to_ic_data,
+      const Array& edge_counters_array) const;
   void RestoreICDataMap(
       ZoneGrowableArray<const ICData*>* deopt_id_to_ic_data) const;
 
@@ -2695,10 +2709,11 @@
 
   static RawFunction* New();
 
-  void BuildSignatureParameters(bool instantiate,
-                                NameVisibility name_visibility,
-                                const TypeArguments& instantiator,
-                                const GrowableObjectArray& pieces) const;
+  void BuildSignatureParameters(
+      bool instantiate,
+      NameVisibility name_visibility,
+      const TypeArguments& instantiator,
+      GrowableHandlePtrArray<const String>* pieces) const;
   RawString* BuildSignature(bool instantiate,
                             NameVisibility name_visibility,
                             const TypeArguments& instantiator) const;
@@ -2708,7 +2723,8 @@
                 const TypeArguments& type_arguments,
                 const Function& other,
                 const TypeArguments& other_type_arguments,
-                Error* bound_error) const;
+                Error* bound_error,
+                Heap::Space space) const;
 
   // Checks the type of the formal parameter at the given position for
   // subtyping or 'more specific' relationship between the type of this function
@@ -2719,7 +2735,8 @@
                          const TypeArguments& type_arguments,
                          const Function& other,
                          const TypeArguments& other_type_arguments,
-                         Error* bound_error) const;
+                         Error* bound_error,
+                         Heap::Space space) const;
 
   FINAL_HEAP_OBJECT_IMPLEMENTATION(Function, Object);
   friend class Class;
@@ -2812,10 +2829,11 @@
   }
 
   inline intptr_t Offset() const;
-  inline void SetOffset(intptr_t value_in_bytes) const;
+  inline void SetOffset(intptr_t offset_in_bytes) const;
 
-  RawInstance* value() const;
-  void set_value(const Instance& value) const;
+  inline RawInstance* StaticValue() const;
+  inline void SetStaticValue(const Instance& value,
+                             bool save_initial_value = false) const;
 
   RawClass* owner() const;
   RawClass* origin() const;  // Either mixin class, or same as owner().
@@ -2839,7 +2857,12 @@
   // owner of the clone is new_owner.
   RawField* Clone(const Class& new_owner) const;
 
-  static intptr_t value_offset() { return OFFSET_OF(RawField, value_); }
+  static intptr_t instance_field_offset() {
+    return OFFSET_OF(RawField, value_.offset_);
+  }
+  static intptr_t static_value_offset() {
+    return OFFSET_OF(RawField, value_.static_value_);
+  }
 
   static intptr_t kind_bits_offset() { return OFFSET_OF(RawField, kind_bits_); }
 
@@ -2950,10 +2973,16 @@
 
   void EvaluateInitializer() const;
 
-  RawFunction* initializer() const {
-    return raw_ptr()->initializer_;
+  RawFunction* PrecompiledInitializer() const {
+    return raw_ptr()->initializer_.precompiled_;
   }
-  void set_initializer(const Function& initializer) const;
+  void SetPrecompiledInitializer(const Function& initializer) const;
+  bool HasPrecompiledInitializer() const;
+
+  RawInstance* SavedInitialStaticValue() const {
+    return raw_ptr()->initializer_.saved_value_;
+  }
+  void SetSavedInitialStaticValue(const Instance& value) const;
 
   // For static fields only. Constructs a closure that gets/sets the
   // field value.
@@ -2964,8 +2993,12 @@
   // Constructs getter and setter names for fields and vice versa.
   static RawString* GetterName(const String& field_name);
   static RawString* GetterSymbol(const String& field_name);
+  // Returns String::null() if getter symbol does not exist.
+  static RawString* LookupGetterSymbol(const String& field_name);
   static RawString* SetterName(const String& field_name);
   static RawString* SetterSymbol(const String& field_name);
+  // Returns String::null() if setter symbol does not exist.
+  static RawString* LookupSetterSymbol(const String& field_name);
   static RawString* NameFromGetter(const String& getter_name);
   static RawString* NameFromSetter(const String& setter_name);
   static bool IsGetterName(const String& function_name);
@@ -3025,6 +3058,7 @@
   FINAL_HEAP_OBJECT_IMPLEMENTATION(Field, Object);
   friend class Class;
   friend class HeapProfiler;
+  friend class RawField;
 };
 
 
@@ -3161,7 +3195,8 @@
   void Tokenize(const String& private_key) const;
 
   RawLibrary* FindLibrary() const;
-  RawString* GetLine(intptr_t line_number) const;
+  RawString* GetLine(intptr_t line_number,
+                     Heap::Space space = Heap::kNew) const;
   RawString* GetSnippet(intptr_t from_line,
                         intptr_t from_column,
                         intptr_t to_line,
@@ -3170,7 +3205,9 @@
   void SetLocationOffset(intptr_t line_offset, intptr_t col_offset) const;
 
   void GetTokenLocation(intptr_t token_pos,
-                        intptr_t* line, intptr_t* column) const;
+                        intptr_t* line,
+                        intptr_t* column,
+                        intptr_t* token_len = NULL) const;
 
   // Returns index of first and last token on the given line. Returns both
   // indices < 0 if no token exists on or after the line. If a token exists
@@ -3433,6 +3470,7 @@
   static RawLibrary* NativeWrappersLibrary();
   static RawLibrary* ProfilerLibrary();
   static RawLibrary* TypedDataLibrary();
+  static RawLibrary* VMServiceLibrary();
 
   // Eagerly compile all classes and functions in the library.
   static RawError* CompileAll();
@@ -3551,6 +3589,7 @@
   enum EntryType {
     kTaggedObject,
     kImmediate,
+    kNativeEntry,
   };
 
   struct Entry {
@@ -3625,10 +3664,17 @@
 
   static RawObjectPool* New(intptr_t len);
 
+  // Returns the pool index from the offset relative to a tagged RawObjectPool*,
+  // adjusting for the tag-bit.
   static intptr_t IndexFromOffset(intptr_t offset) {
+    ASSERT(Utils::IsAligned(offset + kHeapObjectTag, kWordSize));
     return (offset + kHeapObjectTag - data_offset()) / kBytesPerElement;
   }
 
+  static intptr_t OffsetFromIndex(intptr_t index) {
+    return element_offset(index) - kHeapObjectTag;
+  }
+
   void DebugPrint() const;
 
  private:
@@ -3647,13 +3693,12 @@
 class Instructions : public Object {
  public:
   intptr_t size() const { return raw_ptr()->size_; }  // Excludes HeaderSize().
-  RawCode* code() const { return raw_ptr()->code_; }
-  static intptr_t code_offset() {
-    return OFFSET_OF(RawInstructions, code_);
-  }
-  RawObjectPool* object_pool() const { return raw_ptr()->object_pool_; }
-  static intptr_t object_pool_offset() {
-    return OFFSET_OF(RawInstructions, object_pool_);
+
+  RawCode* code() const {
+    // This should only be accessed when jitting.
+    // TODO(johnmccutchan): Remove code back pointer.
+    ASSERT(!Dart::IsRunningPrecompiledCode());
+    return raw_ptr()->code_;
   }
 
   uword EntryPoint() const {
@@ -3693,12 +3738,10 @@
   void set_size(intptr_t size) const {
     StoreNonPointer(&raw_ptr()->size_, size);
   }
+
   void set_code(RawCode* code) const {
     StorePointer(&raw_ptr()->code_, code);
   }
-  void set_object_pool(RawObjectPool* object_pool) const {
-    StorePointer(&raw_ptr()->object_pool_, object_pool);
-  }
 
   // New is a private method as RawInstruction and RawCode objects should
   // only be created using the Code::FinalizeCode method. This method creates
@@ -3709,6 +3752,7 @@
   FINAL_HEAP_OBJECT_IMPLEMENTATION(Instructions, Object);
   friend class Class;
   friend class Code;
+  friend class InstructionsWriter;
 };
 
 
@@ -3742,7 +3786,7 @@
 
   static RawLocalVarDescriptors* New(intptr_t num_variables);
 
-  static const char* KindToStr(intptr_t kind);
+  static const char* KindToCString(RawLocalVarDescriptors::VarInfoKind kind);
 
  private:
   FINAL_HEAP_OBJECT_IMPLEMENTATION(LocalVarDescriptors, Object);
@@ -3891,6 +3935,14 @@
     StoreNonPointer(&raw_ptr()->register_bit_count_, register_bit_count);
   }
 
+  bool Equals(const Stackmap& other) const {
+    if (Length() != other.Length()) {
+      return false;
+    }
+    NoSafepointScope no_safepoint;
+    return memcmp(raw_ptr(), other.raw_ptr(), InstanceSize(Length())) == 0;
+  }
+
   static const intptr_t kMaxLengthInBytes = kSmiMax;
 
   static intptr_t InstanceSize() {
@@ -4030,10 +4082,25 @@
 
 class Code : public Object {
  public:
+  RawInstructions* active_instructions() const {
+    return raw_ptr()->active_instructions_;
+  }
+
   RawInstructions* instructions() const { return raw_ptr()->instructions_; }
-  static intptr_t instructions_offset() {
+
+  static intptr_t saved_instructions_offset() {
     return OFFSET_OF(RawCode, instructions_);
   }
+
+  static intptr_t entry_point_offset() {
+    return OFFSET_OF(RawCode, entry_point_);
+  }
+
+  RawObjectPool* object_pool() const { return raw_ptr()->object_pool_; }
+  static intptr_t object_pool_offset() {
+    return OFFSET_OF(RawCode, object_pool_);
+  }
+
   intptr_t pointer_offsets_length() const {
     return PtrOffBits::decode(raw_ptr()->state_bits_);
   }
@@ -4048,16 +4115,14 @@
   void set_is_alive(bool value) const;
 
   uword EntryPoint() const {
-    const Instructions& instr = Instructions::Handle(instructions());
-    return instr.EntryPoint();
+    return Instructions::Handle(instructions()).EntryPoint();
   }
   intptr_t Size() const {
     const Instructions& instr = Instructions::Handle(instructions());
     return instr.size();
   }
   RawObjectPool* GetObjectPool() const {
-    const Instructions& instr = Instructions::Handle(instructions());
-    return instr.object_pool();
+    return object_pool();
   }
   bool ContainsInstructionAt(uword addr) const {
     const Instructions& instr = Instructions::Handle(instructions());
@@ -4252,10 +4317,6 @@
     kInvalidPc = -1
   };
 
-  // Returns 0 if code is not patchable
-  uword GetEntryPatchPc() const;
-  uword GetPatchCodePc() const;
-
   uword GetLazyDeoptPc() const;
 
   // Find pc, return 0 if not found.
@@ -4269,22 +4330,6 @@
     return raw_ptr()->compile_timestamp_;
   }
 
-  intptr_t entry_patch_pc_offset() const {
-    return raw_ptr()->entry_patch_pc_offset_;
-  }
-  void set_entry_patch_pc_offset(intptr_t pc) const {
-    StoreNonPointer(&raw_ptr()->entry_patch_pc_offset_, pc);
-  }
-
-
-  intptr_t patch_code_pc_offset() const {
-    return raw_ptr()->patch_code_pc_offset_;
-  }
-  void set_patch_code_pc_offset(intptr_t pc) const {
-    StoreNonPointer(&raw_ptr()->patch_code_pc_offset_, pc);
-  }
-
-
   intptr_t lazy_deopt_pc_offset() const {
     return raw_ptr()->lazy_deopt_pc_offset_;
   }
@@ -4296,9 +4341,27 @@
   bool IsStubCode() const;
   bool IsFunctionCode() const;
 
+  void DisableDartCode() const;
+
+  void DisableStubCode() const;
+
+  void Enable() const {
+    if (!IsDisabled()) return;
+    ASSERT(instructions() != active_instructions());
+    set_active_instructions(instructions());
+  }
+
+  bool IsDisabled() const {
+    return instructions() != active_instructions();
+  }
+
  private:
   void set_state_bits(intptr_t bits) const;
 
+  void set_object_pool(RawObjectPool* object_pool) const {
+    StorePointer(&raw_ptr()->object_pool_, object_pool);
+  }
+
   friend class RawObject;  // For RawObject::SizeFromClass().
   friend class RawCode;
   enum {
@@ -4319,8 +4382,6 @@
         : FindObjectVisitor(Isolate::Current()), pc_(pc) { }
     virtual ~FindRawCodeVisitor() { }
 
-    virtual uword filter_addr() const { return pc_; }
-
     // Check if object matches find condition.
     virtual bool FindObject(RawObject* obj) const;
 
@@ -4330,15 +4391,26 @@
     DISALLOW_COPY_AND_ASSIGN(FindRawCodeVisitor);
   };
 
+  static bool IsOptimized(RawCode* code) {
+    return Code::OptimizedBit::decode(code->ptr()->state_bits_);
+  }
+
   static const intptr_t kEntrySize = sizeof(int32_t);  // NOLINT
 
   void set_compile_timestamp(int64_t timestamp) const {
     StoreNonPointer(&raw_ptr()->compile_timestamp_, timestamp);
   }
 
-  void set_instructions(RawInstructions* instructions) {
+  void set_active_instructions(RawInstructions* instructions) const {
     // RawInstructions are never allocated in New space and hence a
     // store buffer update is not needed here.
+    StorePointer(&raw_ptr()->active_instructions_, instructions);
+    StoreNonPointer(&raw_ptr()->entry_point_,
+                    reinterpret_cast<uword>(instructions->ptr()) +
+                    Instructions::HeaderSize());
+  }
+
+  void set_instructions(RawInstructions* instructions) const {
     StorePointer(&raw_ptr()->instructions_, instructions);
   }
 
@@ -4372,7 +4444,8 @@
 
   FINAL_HEAP_OBJECT_IMPLEMENTATION(Code, Object);
   friend class Class;
-
+  friend class SnapshotWriter;
+  friend class CodePatcher;  // for set_instructions
   // So that the RawFunction pointer visitor can determine whether code the
   // function points to is optimized.
   friend class RawFunction;
@@ -4443,7 +4516,8 @@
 // by its token position in the source, its name, its type, its allocation index
 // in the context, and its context level. The function nesting level and loop
 // nesting level are not preserved, since they are only used until the context
-// level is assigned.
+// level is assigned. In addition the ContextScope has a field 'is_implicit'
+// which is true if the ContextScope was created for an implicit closure.
 class ContextScope : public Object {
  public:
   intptr_t num_variables() const { return raw_ptr()->num_variables_; }
@@ -4488,13 +4562,17 @@
         sizeof(RawContextScope) + (len * kBytesPerElement));
   }
 
-  static RawContextScope* New(intptr_t num_variables);
+  static RawContextScope* New(intptr_t num_variables, bool is_implicit);
 
  private:
   void set_num_variables(intptr_t num_variables) const {
     StoreNonPointer(&raw_ptr()->num_variables_, num_variables);
   }
 
+  void set_is_implicit(bool is_implicit) const {
+    StoreNonPointer(&raw_ptr()->is_implicit_, is_implicit);
+  }
+
   const RawContextScope::VariableDesc* VariableDescAddr(intptr_t index) const {
     ASSERT((index >= 0) && (index < num_variables()));
     return raw_ptr()->VariableDescAddr(index);
@@ -4502,6 +4580,7 @@
 
   FINAL_HEAP_OBJECT_IMPLEMENTATION(ContextScope, Object);
   friend class Class;
+  friend class Object;
 };
 
 
@@ -4733,6 +4812,12 @@
 
 class UnwindError : public Error {
  public:
+  bool is_user_initiated() const { return raw_ptr()->is_user_initiated_; }
+  void set_is_user_initiated(bool value) const;
+
+  bool is_vm_restart() const { return raw_ptr()->is_vm_restart_; }
+  void set_is_vm_restart(bool value) const;
+
   RawString* message() const { return raw_ptr()->message_; }
 
   static intptr_t InstanceSize() {
@@ -4954,15 +5039,14 @@
   virtual RawUnresolvedClass* unresolved_class() const;
   virtual RawTypeArguments* arguments() const;
   virtual intptr_t token_pos() const;
-  virtual bool IsInstantiated(GrowableObjectArray* trail = NULL) const;
+  virtual bool IsInstantiated(TrailPtr trail = NULL) const;
   virtual bool CanonicalizeEquals(const Instance& other) const {
     return Equals(other);
   }
   virtual bool Equals(const Instance& other) const {
     return IsEquivalent(other);
   }
-  virtual bool IsEquivalent(const Instance& other,
-                            GrowableObjectArray* trail = NULL) const;
+  virtual bool IsEquivalent(const Instance& other, TrailPtr trail = NULL) const;
   virtual bool IsRecursive() const;
 
   // Instantiate this type using the given type argument vector.
@@ -4971,7 +5055,8 @@
   virtual RawAbstractType* InstantiateFrom(
       const TypeArguments& instantiator_type_arguments,
       Error* bound_error,
-      GrowableObjectArray* trail = NULL) const;
+      TrailPtr trail = NULL,
+      Heap::Space space = Heap::kNew) const;
 
   // Return a clone of this unfinalized type or the type itself if it is
   // already finalized. Apply recursively to type arguments, i.e. finalized
@@ -4984,25 +5069,22 @@
   // 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,
-      GrowableObjectArray* trail = NULL) const;
+      const Class& new_owner, TrailPtr trail = NULL) const;
 
   virtual RawInstance* CheckAndCanonicalize(const char** error_str) const {
     return Canonicalize();
   }
 
   // Return the canonical version of this type.
-  virtual RawAbstractType* Canonicalize(
-      GrowableObjectArray* trail = NULL) const;
+  virtual RawAbstractType* Canonicalize(TrailPtr trail = NULL) const;
 
   // Return the object associated with the receiver in the trail or
-  // Object::null() if the receiver is not contained in the trail.
-  RawObject* OnlyBuddyInTrail(GrowableObjectArray* trail) const;
+  // AbstractType::null() if the receiver is not contained in the trail.
+  RawAbstractType* OnlyBuddyInTrail(TrailPtr trail) const;
 
   // If the trail is null, allocate a trail, add the pair <receiver, buddy> to
   // the trail. The receiver may only be added once with its only buddy.
-  void AddOnlyBuddyToTrail(GrowableObjectArray** trail,
-                           const Object& buddy) const;
+  void AddOnlyBuddyToTrail(TrailPtr* trail, const AbstractType& buddy) const;
 
   // The name of this type, including the names of its type arguments, if any.
   virtual RawString* Name() const {
@@ -5074,21 +5156,25 @@
   bool IsFunctionType() const;
 
   // Check the subtype relationship.
-  bool IsSubtypeOf(const AbstractType& other, Error* bound_error) const {
-    return TypeTest(kIsSubtypeOf, other, bound_error);
+  bool IsSubtypeOf(const AbstractType& other,
+                   Error* bound_error,
+                   Heap::Space space = Heap::kNew) const {
+    return TypeTest(kIsSubtypeOf, other, bound_error, space);
   }
 
   // Check the 'more specific' relationship.
   bool IsMoreSpecificThan(const AbstractType& other,
-                          Error* bound_error) const {
-    return TypeTest(kIsMoreSpecificThan, other, bound_error);
+                          Error* bound_error,
+                          Heap::Space space = Heap::kNew) const {
+    return TypeTest(kIsMoreSpecificThan, other, bound_error, space);
   }
 
  private:
   // Check the subtype or 'more specific' relationship.
   bool TypeTest(TypeTestKind test_kind,
                 const AbstractType& other,
-                Error* bound_error) const;
+                Error* bound_error,
+                Heap::Space space) const;
 
   // Return the internal or public name of this type, including the names of its
   // type arguments, if any.
@@ -5141,20 +5227,19 @@
   virtual RawTypeArguments* arguments() const;
   void set_arguments(const TypeArguments& value) const;
   virtual intptr_t token_pos() const { return raw_ptr()->token_pos_; }
-  virtual bool IsInstantiated(GrowableObjectArray* trail = NULL) const;
-  virtual bool IsEquivalent(const Instance& other,
-                            GrowableObjectArray* trail = NULL) const;
+  virtual bool IsInstantiated(TrailPtr trail = NULL) const;
+  virtual bool IsEquivalent(const Instance& other, TrailPtr trail = NULL) const;
   virtual bool IsRecursive() const;
   virtual RawAbstractType* InstantiateFrom(
       const TypeArguments& instantiator_type_arguments,
       Error* malformed_error,
-      GrowableObjectArray* trail = NULL) const;
+      TrailPtr trail = NULL,
+      Heap::Space space = Heap::kNew) const;
   virtual RawAbstractType* CloneUnfinalized() const;
   virtual RawAbstractType* CloneUninstantiated(
       const Class& new_owner,
-      GrowableObjectArray* trail = NULL) const;
-  virtual RawAbstractType* Canonicalize(
-      GrowableObjectArray* trail = NULL) const;
+      TrailPtr trail = NULL) const;
+  virtual RawAbstractType* Canonicalize(TrailPtr trail = NULL) const;
 
   virtual intptr_t Hash() const;
 
@@ -5263,33 +5348,32 @@
   virtual intptr_t token_pos() const {
     return AbstractType::Handle(type()).token_pos();
   }
-  virtual bool IsInstantiated(GrowableObjectArray* trail = NULL) const;
+  virtual bool IsInstantiated(TrailPtr trail = NULL) const;
   virtual bool IsEquivalent(const Instance& other,
-                            GrowableObjectArray* trail = NULL) const;
+                            TrailPtr trail = NULL) const;
   virtual bool IsRecursive() const { return true; }
   virtual RawTypeRef* InstantiateFrom(
       const TypeArguments& instantiator_type_arguments,
       Error* bound_error,
-      GrowableObjectArray* trail = NULL) const;
+      TrailPtr trail = NULL,
+      Heap::Space space = Heap::kNew) const;
   virtual RawTypeRef* CloneUninstantiated(
       const Class& new_owner,
-      GrowableObjectArray* trail = NULL) const;
-  virtual RawAbstractType* Canonicalize(
-      GrowableObjectArray* trail = NULL) const;
+      TrailPtr trail = NULL) const;
+  virtual RawAbstractType* Canonicalize(TrailPtr trail = NULL) const;
 
   virtual intptr_t Hash() const;
 
   // Return true if the receiver is contained in the trail.
   // Otherwise, if the trail is null, allocate a trail, then add the receiver to
   // the trail and return false.
-  bool TestAndAddToTrail(GrowableObjectArray** trail) const;
+  bool TestAndAddToTrail(TrailPtr* trail) const;
 
   // Return true if the pair <receiver, buddy> is contained in the trail.
   // Otherwise, if the trail is null, allocate a trail, add the pair <receiver,
   // buddy> to the trail and return false.
   // The receiver may be added several times, each time with a different buddy.
-  bool TestAndAddBuddyToTrail(GrowableObjectArray** trail,
-                              const Object& buddy) const;
+  bool TestAndAddBuddyToTrail(TrailPtr* trail, const AbstractType& buddy) const;
 
   static intptr_t InstanceSize() {
     return RoundedAllocationSize(sizeof(RawTypeRef));
@@ -5342,24 +5426,23 @@
   // bound cannot be checked yet and this is not an error.
   bool CheckBound(const AbstractType& bounded_type,
                   const AbstractType& upper_bound,
-                  Error* bound_error) const;
+                  Error* bound_error,
+                  Heap::Space space = Heap::kNew) const;
   virtual intptr_t token_pos() const { return raw_ptr()->token_pos_; }
-  virtual bool IsInstantiated(GrowableObjectArray* trail = NULL) const {
+  virtual bool IsInstantiated(TrailPtr trail = NULL) const {
     return false;
   }
-  virtual bool IsEquivalent(const Instance& other,
-                            GrowableObjectArray* trail = NULL) const;
+  virtual bool IsEquivalent(const Instance& other, TrailPtr trail = NULL) const;
   virtual bool IsRecursive() const { return false; }
   virtual RawAbstractType* InstantiateFrom(
       const TypeArguments& instantiator_type_arguments,
       Error* bound_error,
-      GrowableObjectArray* trail = NULL) const;
+      TrailPtr trail = NULL,
+      Heap::Space space = Heap::kNew) const;
   virtual RawAbstractType* CloneUnfinalized() const;
   virtual RawAbstractType* CloneUninstantiated(
-      const Class& new_owner,
-      GrowableObjectArray* trail = NULL) const;
-  virtual RawAbstractType* Canonicalize(
-      GrowableObjectArray* trail = NULL) const {
+      const Class& new_owner, TrailPtr trail = NULL) const;
+  virtual RawAbstractType* Canonicalize(TrailPtr trail = NULL) const {
     return raw();
   }
 
@@ -5427,26 +5510,24 @@
   virtual intptr_t token_pos() const {
     return AbstractType::Handle(type()).token_pos();
   }
-  virtual bool IsInstantiated(GrowableObjectArray* trail = NULL) const {
+  virtual bool IsInstantiated(TrailPtr trail = NULL) const {
     // It is not possible to encounter an instantiated bounded type with an
     // uninstantiated upper bound. Therefore, we do not need to check if the
     // bound is instantiated. Moreover, doing so could lead into cycles, as in
     // class C<T extends C<C>> { }.
     return AbstractType::Handle(type()).IsInstantiated();
   }
-  virtual bool IsEquivalent(const Instance& other,
-                            GrowableObjectArray* trail = NULL) const;
+  virtual bool IsEquivalent(const Instance& other, TrailPtr trail = NULL) const;
   virtual bool IsRecursive() const;
   virtual RawAbstractType* InstantiateFrom(
       const TypeArguments& instantiator_type_arguments,
       Error* bound_error,
-      GrowableObjectArray* trail = NULL) const;
+      TrailPtr trail = NULL,
+      Heap::Space space = Heap::kNew) const;
   virtual RawAbstractType* CloneUnfinalized() const;
   virtual RawAbstractType* CloneUninstantiated(
-      const Class& new_owner,
-      GrowableObjectArray* trail = NULL) const;
-  virtual RawAbstractType* Canonicalize(
-      GrowableObjectArray* trail = NULL) const {
+      const Class& new_owner, TrailPtr trail = NULL) const;
+  virtual RawAbstractType* Canonicalize(TrailPtr trail = NULL) const {
     return raw();
   }
 
@@ -5578,8 +5659,12 @@
   RawInteger* AsValidInteger() const;
 
   // Returns null to indicate that a bigint operation is required.
-  RawInteger* ArithmeticOp(Token::Kind operation, const Integer& other) const;
-  RawInteger* BitOp(Token::Kind operation, const Integer& other) const;
+  RawInteger* ArithmeticOp(Token::Kind operation,
+                           const Integer& other,
+                           Heap::Space space = Heap::kNew) const;
+  RawInteger* BitOp(Token::Kind operation,
+                    const Integer& other,
+                    Heap::Space space = Heap::kNew) const;
 
   // Returns true if the Integer does not fit in a Javascript integer.
   bool CheckJavascriptIntegerOverflow() const;
@@ -5640,6 +5725,7 @@
 
   RawInteger* ShiftOp(Token::Kind kind,
                       const Smi& other,
+                      Heap::Space space = Heap::kNew,
                       const bool silent = false) const;
 
   void operator=(RawSmi* value) {
@@ -5926,7 +6012,7 @@
 
   static intptr_t hash_offset() { return OFFSET_OF(RawString, hash_); }
   static intptr_t Hash(const String& str, intptr_t begin_index, intptr_t len);
-  static intptr_t HashLatin1(const uint8_t* characters, intptr_t len);
+  static intptr_t Hash(const char* characters, intptr_t len);
   static intptr_t Hash(const uint16_t* characters, intptr_t len);
   static intptr_t Hash(const int32_t* characters, intptr_t len);
   static intptr_t HashRawSymbol(const RawString* symbol) {
@@ -6119,7 +6205,10 @@
 
   static RawString* NewFormatted(const char* format, ...)
       PRINTF_ATTRIBUTE(1, 2);
-  static RawString* NewFormattedV(const char* format, va_list args);
+  static RawString* NewFormatted(Heap::Space space, const char* format, ...)
+      PRINTF_ATTRIBUTE(2, 3);
+  static RawString* NewFormattedV(const char* format, va_list args,
+                                  Heap::Space space = Heap::kNew);
 
   static bool ParseDouble(const String& str,
                           intptr_t start,
@@ -6164,8 +6253,8 @@
   friend class TwoByteString;
   friend class ExternalOneByteString;
   friend class ExternalTwoByteString;
-  // So that the MarkingVisitor can print a debug string from a NoHandleScope.
-  friend class MarkingVisitor;
+  // So that SkippedCodeFunctions can print a debug string from a NoHandleScope.
+  friend class SkippedCodeFunctions;
 };
 
 
@@ -6290,10 +6379,12 @@
   static RawOneByteString* ReadFrom(SnapshotReader* reader,
                                     intptr_t object_id,
                                     intptr_t tags,
-                                    Snapshot::Kind kind);
+                                    Snapshot::Kind kind,
+                                    bool as_reference);
 
   friend class Class;
   friend class String;
+  friend class Symbols;
   friend class ExternalOneByteString;
   friend class SnapshotReader;
   friend class StringHasher;
@@ -6404,11 +6495,13 @@
   static RawTwoByteString* ReadFrom(SnapshotReader* reader,
                                     intptr_t object_id,
                                     intptr_t tags,
-                                    Snapshot::Kind kind);
+                                    Snapshot::Kind kind,
+                                    bool as_reference);
 
   friend class Class;
   friend class String;
   friend class SnapshotReader;
+  friend class Symbols;
 };
 
 
@@ -6481,7 +6574,8 @@
   static RawExternalOneByteString* ReadFrom(SnapshotReader* reader,
                                             intptr_t object_id,
                                             intptr_t tags,
-                                            Snapshot::Kind kind);
+                                            Snapshot::Kind kind,
+                                            bool as_reference);
 
   static intptr_t NextFieldOffset() {
     // Indicates this class cannot be extended by dart code.
@@ -6491,6 +6585,7 @@
   friend class Class;
   friend class String;
   friend class SnapshotReader;
+  friend class Symbols;
 };
 
 
@@ -6559,7 +6654,8 @@
   static RawExternalTwoByteString* ReadFrom(SnapshotReader* reader,
                                             intptr_t object_id,
                                             intptr_t tags,
-                                            Snapshot::Kind kind);
+                                            Snapshot::Kind kind,
+                                            bool as_reference);
 
   static intptr_t NextFieldOffset() {
     // Indicates this class cannot be extended by dart code.
@@ -6569,6 +6665,7 @@
   friend class Class;
   friend class String;
   friend class SnapshotReader;
+  friend class Symbols;
 };
 
 
@@ -6730,7 +6827,8 @@
   static RawImmutableArray* ReadFrom(SnapshotReader* reader,
                                      intptr_t object_id,
                                      intptr_t tags,
-                                     Snapshot::Kind kind);
+                                     Snapshot::Kind kind,
+                                     bool as_reference);
 
   static const ClassId kClassId = kImmutableArrayCid;
 
@@ -7638,8 +7736,6 @@
                             const Array& pc_offset_array,
                             Heap::Space space = Heap::kNew);
 
-  RawString* FullStacktrace() const;
-
   // The argument 'max_frames' limits the number of printed frames.
   const char* ToCStringInternal(intptr_t* frame_index,
                                 intptr_t max_frames = kMaxInt32) const;
@@ -7929,17 +8025,34 @@
 
 
 intptr_t Field::Offset() const {
-  ASSERT(!is_static());  // Offset is valid only for instance fields.
-  intptr_t value = Smi::Value(reinterpret_cast<RawSmi*>(raw_ptr()->value_));
+  ASSERT(!is_static());  // Valid only for dart instance fields.
+  intptr_t value = Smi::Value(raw_ptr()->value_.offset_);
   return (value * kWordSize);
 }
 
 
-void Field::SetOffset(intptr_t value_in_bytes) const {
-  ASSERT(!is_static());  // SetOffset is valid only for instance fields.
+void Field::SetOffset(intptr_t offset_in_bytes) const {
+  ASSERT(!is_static());  // Valid only for dart instance fields.
   ASSERT(kWordSize != 0);
-  StorePointer(&raw_ptr()->value_,
-               static_cast<RawInstance*>(Smi::New(value_in_bytes / kWordSize)));
+  StorePointer(&raw_ptr()->value_.offset_,
+               Smi::New(offset_in_bytes / kWordSize));
+}
+
+
+RawInstance* Field::StaticValue() const {
+  ASSERT(is_static());  // Valid only for static dart fields.
+  return raw_ptr()->value_.static_value_;
+}
+
+
+void Field::SetStaticValue(const Instance& value,
+                           bool save_initial_value) const {
+  ASSERT(is_static());  // Valid only for static dart fields.
+  StorePointer(&raw_ptr()->value_.static_value_, value.raw());
+  if (save_initial_value) {
+    ASSERT(!HasPrecompiledInitializer());
+    StorePointer(&raw_ptr()->initializer_.saved_value_, value.raw());
+  }
 }
 
 
diff --git a/runtime/vm/object_arm64_test.cc b/runtime/vm/object_arm64_test.cc
index 9383cc2..4349bb9 100644
--- a/runtime/vm/object_arm64_test.cc
+++ b/runtime/vm/object_arm64_test.cc
@@ -35,12 +35,9 @@
 void GenerateEmbedStringInCode(Assembler* assembler, const char* str) {
   const String& string_object =
       String::ZoneHandle(String::New(str, Heap::kOld));
-  __ mov(SP, CSP);
-  __ TagAndPushPP();  // Save caller's pool pointer and load a new one here.
-  __ LoadPoolPointer();
+  __ EnterStubFrame();
   __ LoadObject(R0, string_object);
-  __ set_constant_pool_allowed(false);
-  __ PopAndUntagPP();  // Restore caller's pool pointer.
+  __ LeaveStubFrame();
   __ ret();
 }
 
diff --git a/runtime/vm/object_graph.cc b/runtime/vm/object_graph.cc
index ad6f861..3a56dc9 100644
--- a/runtime/vm/object_graph.cc
+++ b/runtime/vm/object_graph.cc
@@ -255,7 +255,7 @@
  public:
   // We cannot use a GrowableObjectArray, since we must not trigger GC.
   RetainingPathVisitor(RawObject* obj, const Array& path)
-      : obj_(obj), path_(path), length_(0) {
+      : thread_(Thread::Current()), obj_(obj), path_(path), length_(0) {
     ASSERT(Thread::Current()->no_safepoint_scope_depth() != 0);
   }
 
@@ -281,7 +281,7 @@
         return kProceed;
       }
     } else {
-      HANDLESCOPE(Isolate::Current());
+      HANDLESCOPE(thread_);
       Object& current = Object::Handle();
       Smi& offset_from_parent = Smi::Handle();
       do {
@@ -300,6 +300,7 @@
   }
 
  private:
+  Thread* thread_;
   RawObject* obj_;
   const Array& path_;
   intptr_t length_;
@@ -441,9 +442,9 @@
 
   virtual Direction VisitObject(ObjectGraph::StackIterator* it) {
     RawObject* raw_obj = it->Get();
-    Isolate* isolate = Isolate::Current();
-    REUSABLE_OBJECT_HANDLESCOPE(isolate);
-    Object& obj = isolate->ObjectHandle();
+    Thread* thread = Thread::Current();
+    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_);
diff --git a/runtime/vm/object_graph_test.cc b/runtime/vm/object_graph_test.cc
index 00f7768..3e0259a 100644
--- a/runtime/vm/object_graph_test.cc
+++ b/runtime/vm/object_graph_test.cc
@@ -39,7 +39,7 @@
 
 
 TEST_CASE(ObjectGraph) {
-  Isolate* isolate = Isolate::Current();
+  Isolate* isolate = thread->isolate();
   // Create a simple object graph with objects a, b, c, d:
   //  a+->b+->c
   //  +   +
@@ -99,7 +99,7 @@
     ObjectGraph graph(isolate);
     // A retaining path should end like this: c <- b <- a <- ...
     {
-      HANDLESCOPE(isolate);
+      HANDLESCOPE(thread);
       // Test null, empty, and length 1 array.
       intptr_t null_length = graph.RetainingPath(&c, Object::null_array());
       intptr_t empty_length = graph.RetainingPath(&c, Object::empty_array());
@@ -110,7 +110,7 @@
       EXPECT_LE(3, null_length);
     }
     {
-      HANDLESCOPE(isolate);
+      HANDLESCOPE(thread);
       Array& path = Array::Handle(Array::New(6, Heap::kNew));
       // Trigger a full GC to increase probability of concurrent tasks.
       isolate->heap()->CollectAllGarbage();
diff --git a/runtime/vm/object_id_ring.h b/runtime/vm/object_id_ring.h
index a936a8f..b3ad0c9 100644
--- a/runtime/vm/object_id_ring.h
+++ b/runtime/vm/object_id_ring.h
@@ -36,7 +36,7 @@
 
   static const int32_t kMaxId = 0x3FFFFFFF;
   static const int32_t kInvalidId = -1;
-  static const int32_t kDefaultCapacity = 1024;
+  static const int32_t kDefaultCapacity = 8192;
 
   static void Init(Isolate* isolate, int32_t capacity = kDefaultCapacity);
 
diff --git a/runtime/vm/object_store.cc b/runtime/vm/object_store.cc
index c2c14d539..d8f2f6c 100644
--- a/runtime/vm/object_store.cc
+++ b/runtime/vm/object_store.cc
@@ -71,6 +71,7 @@
     profiler_library_(Library::null()),
     root_library_(Library::null()),
     typed_data_library_(Library::null()),
+    vmservice_library_(Library::null()),
     libraries_(GrowableObjectArray::null()),
     pending_classes_(GrowableObjectArray::null()),
     pending_functions_(GrowableObjectArray::null()),
@@ -87,7 +88,11 @@
     lookup_port_handler_(Function::null()),
     empty_uint32_array_(TypedData::null()),
     handle_message_function_(Function::null()),
-    library_load_error_table_(Array::null()) {
+    library_load_error_table_(Array::null()),
+    compile_time_constants_(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());
   }
@@ -112,7 +117,9 @@
 
 
 bool ObjectStore::PreallocateObjects() {
-  Isolate* isolate = Isolate::Current();
+  Thread* thread = Thread::Current();
+  Isolate* isolate = thread->isolate();
+  Zone* zone = thread->zone();
   ASSERT(isolate != NULL && isolate->object_store() == this);
   if (this->stack_overflow() != Instance::null()) {
     ASSERT(this->out_of_memory() != Instance::null());
@@ -156,14 +163,14 @@
   // pre-allocated OutOfMemoryError.
   const UnhandledException& unhandled_exception = UnhandledException::Handle(
       UnhandledException::New(Instance::Cast(result),
-                              Stacktrace::Handle(isolate)));
+                              Stacktrace::Handle(zone)));
   set_preallocated_unhandled_exception(unhandled_exception);
 
-  const Array& code_array = Array::Handle(isolate,
+  const Array& code_array = Array::Handle(zone,
       Array::New(Stacktrace::kPreallocatedStackdepth, Heap::kOld));
-  const Array& pc_offset_array = Array::Handle(isolate,
+  const Array& pc_offset_array = Array::Handle(zone,
       Array::New(Stacktrace::kPreallocatedStackdepth, Heap::kOld));
-  const Stacktrace& stack_trace = Stacktrace::Handle(isolate,
+  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.
@@ -175,12 +182,14 @@
 
 
 void ObjectStore::InitKnownObjects() {
-  Isolate* isolate = Isolate::Current();
+  Thread* thread = Thread::Current();
+  Zone* zone = thread->zone();
+  Isolate* isolate = thread->isolate();
   ASSERT(isolate != NULL && isolate->object_store() == this);
 
   const Library& async_lib = Library::Handle(async_library());
   ASSERT(!async_lib.IsNull());
-  Class& cls = Class::Handle(isolate);
+  Class& cls = Class::Handle(zone);
   cls = async_lib.LookupClass(Symbols::Future());
   ASSERT(!cls.IsNull());
   set_future_class(cls);
diff --git a/runtime/vm/object_store.h b/runtime/vm/object_store.h
index 5e220e9..805b9b1 100644
--- a/runtime/vm/object_store.h
+++ b/runtime/vm/object_store.h
@@ -32,6 +32,7 @@
     kMirrors,
     kProfiler,
     kTypedData,
+    kVMService,
   };
 
   ~ObjectStore();
@@ -265,6 +266,7 @@
   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_; }
 
   void set_bootstrap_library(BootstrapLibraryId index, const Library& value) {
     switch (index) {
@@ -301,6 +303,9 @@
       case kTypedData:
         typed_data_library_ = value.raw();
         break;
+      case kVMService:
+        vmservice_library_ = value.raw();
+        break;
       default:
         UNREACHABLE();
     }
@@ -426,6 +431,28 @@
     return OFFSET_OF(ObjectStore, library_load_error_table_);
   }
 
+  RawArray* compile_time_constants() const {
+    return compile_time_constants_;
+  }
+  void set_compile_time_constants(const Array& value) {
+    compile_time_constants_ = value.raw();
+  }
+
+  RawGrowableObjectArray* megamorphic_cache_table() const {
+    return megamorphic_cache_table_;
+  }
+  void set_megamorphic_cache_table(const GrowableObjectArray& value) {
+    megamorphic_cache_table_ = value.raw();
+  }
+  RawFunction* megamorphic_miss_function() const {
+    return megamorphic_miss_function_;
+  }
+  void SetMegamorphicMissHandler(const Code& code, const Function& func) {
+    // Hold onto the code so it is traced and not detached from the function.
+    megamorphic_miss_code_ = code.raw();
+    megamorphic_miss_function_ = func.raw();
+  }
+
   // Visit all object pointers.
   void VisitObjectPointers(ObjectPointerVisitor* visitor);
 
@@ -498,6 +525,7 @@
   RawLibrary* profiler_library_;
   RawLibrary* root_library_;
   RawLibrary* typed_data_library_;
+  RawLibrary* vmservice_library_;
   RawGrowableObjectArray* libraries_;
   RawGrowableObjectArray* pending_classes_;
   RawGrowableObjectArray* pending_functions_;
@@ -515,10 +543,18 @@
   RawTypedData* empty_uint32_array_;
   RawFunction* handle_message_function_;
   RawArray* library_load_error_table_;
+  RawArray* compile_time_constants_;
+  RawObject** to_snapshot() {
+    return reinterpret_cast<RawObject**>(&compile_time_constants_);
+  }
+  RawGrowableObjectArray* megamorphic_cache_table_;
+  RawCode* megamorphic_miss_code_;
+  RawFunction* megamorphic_miss_function_;
   RawObject** to() {
-    return reinterpret_cast<RawObject**>(&library_load_error_table_);
+    return reinterpret_cast<RawObject**>(&megamorphic_miss_function_);
   }
 
+  friend class FullSnapshotWriter;
   friend class SnapshotReader;
   friend class VmIsolateSnapshotReader;
 
diff --git a/runtime/vm/object_test.cc b/runtime/vm/object_test.cc
index 764de50..e186ea0 100644
--- a/runtime/vm/object_test.cc
+++ b/runtime/vm/object_test.cc
@@ -1964,9 +1964,9 @@
   Dart_Handle result = Dart_Invoke(lib, NewString("main"), 0, NULL);
   OS::SNPrint(buffer, sizeof(buffer),
       "Unhandled exception:\n"
-      "Invalid argument(s): Length (%" Pd ") must be an integer "
-      "in the range [0..%" Pd "].",
-      length, Array::kMaxElements);
+      "RangeError (length): Invalid value: "
+      "Not in range 0..%" Pd ", inclusive: %" Pd,
+      Array::kMaxElements, length);
   EXPECT_ERROR(result, buffer);
 }
 
@@ -2685,7 +2685,7 @@
 }
 
 
-static Function* CreateFunction(const char* name) {
+static RawFunction* CreateFunction(const char* name) {
   const String& class_name = String::Handle(Symbols::New("ownerClass"));
   const String& lib_name = String::Handle(Symbols::New("ownerLibrary"));
   const Script& script = Script::Handle();
@@ -2695,10 +2695,8 @@
       Library::Handle(CreateDummyLibrary(lib_name));
   owner_class.set_library(owner_library);
   const String& function_name = String::ZoneHandle(Symbols::New(name));
-  Function& function = Function::ZoneHandle(
-      Function::New(function_name, RawFunction::kRegularFunction,
-                    true, false, false, false, false, owner_class, 0));
-  return &function;
+  return Function::New(function_name, RawFunction::kRegularFunction,
+                       true, false, false, false, false, owner_class, 0);
 }
 
 
@@ -2707,20 +2705,15 @@
   extern void GenerateIncrement(Assembler* assembler);
   Assembler _assembler_;
   GenerateIncrement(&_assembler_);
-  Code& code = Code::Handle(Code::FinalizeCode(
-      *CreateFunction("Test_Code"), &_assembler_));
-  Instructions& instructions = Instructions::Handle(code.instructions());
+  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.EntryPoint();
-  intptr_t retval = 0;
-#if defined(USING_SIMULATOR)
-  retval = bit_copy<intptr_t, int64_t>(Simulator::Current()->Call(
-      static_cast<intptr_t>(entry_point), 0, 0, 0, 0));
-#else
-  typedef intptr_t (*IncrementCode)();
-  retval = reinterpret_cast<IncrementCode>(entry_point)();
-#endif
-  EXPECT_EQ(2, retval);
   EXPECT_EQ(instructions.raw(), Instructions::FromEntryPoint(entry_point));
+  const Object& result = Object::Handle(
+      DartEntry::InvokeFunction(function, Array::empty_array()));
+  EXPECT_EQ(1, Smi::Cast(result).Value());
 }
 
 
@@ -2730,22 +2723,14 @@
   extern void GenerateIncrement(Assembler* assembler);
   Assembler _assembler_;
   GenerateIncrement(&_assembler_);
-  Code& code = Code::Handle(Code::FinalizeCode(
-      *CreateFunction("Test_Code"), &_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.EntryPoint();
+  EXPECT_EQ(instructions.raw(), Instructions::FromEntryPoint(entry_point));
   // Try writing into the generated code, expected to crash.
   *(reinterpret_cast<char*>(entry_point) + 1) = 1;
-  intptr_t retval = 0;
-#if defined(USING_SIMULATOR)
-  retval = bit_copy<intptr_t, int64_t>(Simulator::Current()->Call(
-      static_cast<intptr_t>(entry_point), 0, 0, 0, 0));
-#else
-  typedef intptr_t (*IncrementCode)();
-  retval = reinterpret_cast<IncrementCode>(entry_point)();
-#endif
-  EXPECT_EQ(3, retval);
-  EXPECT_EQ(instructions.raw(), Instructions::FromEntryPoint(entry_point));
   if (!FLAG_write_protect_code) {
     // Since this test is expected to crash, crash if write protection of code
     // is switched off.
@@ -2762,20 +2747,15 @@
   word expected_length = static_cast<word>(strlen(kHello));
   Assembler _assembler_;
   GenerateEmbedStringInCode(&_assembler_, kHello);
-  Code& code = Code::Handle(Code::FinalizeCode(
-      *CreateFunction("Test_EmbedStringInCode"), &_assembler_));
-  Instructions& instructions = Instructions::Handle(code.instructions());
-  uword retval = 0;
-#if defined(USING_SIMULATOR)
-  retval = bit_copy<uword, int64_t>(Simulator::Current()->Call(
-      static_cast<intptr_t>(instructions.EntryPoint()), 0, 0, 0, 0));
-#else
-  typedef uword (*EmbedStringCode)();
-  retval = reinterpret_cast<EmbedStringCode>(instructions.EntryPoint())();
-#endif
-  EXPECT((retval & kSmiTagMask) == kHeapObjectTag);
+  const Function& function =
+      Function::Handle(CreateFunction("Test_EmbedStringInCode"));
+  const Code& code = Code::Handle(Code::FinalizeCode(function, &_assembler_));
+  function.AttachCode(code);
+  const Object& result =
+      Object::Handle(DartEntry::InvokeFunction(function, Array::empty_array()));
+  EXPECT(result.raw()->IsHeapObject());
   String& string_object = String::Handle();
-  string_object ^= reinterpret_cast<RawInstructions*>(retval);
+  string_object ^= result.raw();
   EXPECT(string_object.Length() == expected_length);
   for (int i = 0; i < expected_length; i ++) {
     EXPECT(string_object.CharAt(i) == kHello[i]);
@@ -2789,18 +2769,13 @@
   const intptr_t kSmiTestValue = 5;
   Assembler _assembler_;
   GenerateEmbedSmiInCode(&_assembler_, kSmiTestValue);
-  Code& code = Code::Handle(Code::FinalizeCode(
-      *CreateFunction("Test_EmbedSmiInCode"), &_assembler_));
-  Instructions& instructions = Instructions::Handle(code.instructions());
-  intptr_t retval = 0;
-#if defined(USING_SIMULATOR)
-  retval = bit_copy<intptr_t, int64_t>(Simulator::Current()->Call(
-      static_cast<intptr_t>(instructions.EntryPoint()), 0, 0, 0, 0));
-#else
-  typedef intptr_t (*EmbedSmiCode)();
-  retval = reinterpret_cast<EmbedSmiCode>(instructions.EntryPoint())();
-#endif
-  EXPECT((retval >> kSmiTagShift) == kSmiTestValue);
+  const Function& function =
+      Function::Handle(CreateFunction("Test_EmbedSmiInCode"));
+  const Code& code = Code::Handle(Code::FinalizeCode(function, &_assembler_));
+  function.AttachCode(code);
+  const Object& result =
+      Object::Handle(DartEntry::InvokeFunction(function, Array::empty_array()));
+  EXPECT(Smi::Cast(result).Value() == kSmiTestValue);
 }
 
 
@@ -2811,18 +2786,13 @@
   const intptr_t kSmiTestValue = 5L << 32;
   Assembler _assembler_;
   GenerateEmbedSmiInCode(&_assembler_, kSmiTestValue);
-  Code& code = Code::Handle(Code::FinalizeCode(
-      *CreateFunction("Test_EmbedSmiIn64BitCode"), &_assembler_));
-  Instructions& instructions = Instructions::Handle(code.instructions());
-  intptr_t retval = 0;
-#if defined(USING_SIMULATOR)
-  retval = bit_copy<intptr_t, int64_t>(Simulator::Current()->Call(
-      static_cast<intptr_t>(instructions.EntryPoint()), 0, 0, 0, 0));
-#else
-  typedef intptr_t (*EmbedSmiCode)();
-  retval = reinterpret_cast<EmbedSmiCode>(instructions.EntryPoint())();
-#endif
-  EXPECT((retval >> kSmiTagShift) == kSmiTestValue);
+  const Function& function =
+      Function::Handle(CreateFunction("Test_EmbedSmiIn64BitCode"));
+  const Code& code = Code::Handle(Code::FinalizeCode(function, &_assembler_));
+  function.AttachCode(code);
+  const Object& result =
+      Object::Handle(DartEntry::InvokeFunction(function, Array::empty_array()));
+  EXPECT(Smi::Cast(result).Value() == kSmiTestValue);
 }
 #endif  // ARCH_IS_64_BIT
 
@@ -2843,7 +2813,7 @@
   Assembler _assembler_;
   GenerateIncrement(&_assembler_);
   Code& code = Code::Handle(Code::FinalizeCode(
-      *CreateFunction("Test_Code"), &_assembler_));
+      Function::Handle(CreateFunction("Test_Code")), &_assembler_));
   code.set_exception_handlers(exception_handlers);
 
   // Verify the exception handler table entries by accessing them.
@@ -2883,7 +2853,7 @@
   Assembler _assembler_;
   GenerateIncrement(&_assembler_);
   Code& code = Code::Handle(Code::FinalizeCode(
-      *CreateFunction("Test_Code"), &_assembler_));
+      Function::Handle(CreateFunction("Test_Code")), &_assembler_));
   code.set_pc_descriptors(descriptors);
 
   // Verify the PcDescriptor entries by accessing them.
@@ -2940,7 +2910,7 @@
   Assembler _assembler_;
   GenerateIncrement(&_assembler_);
   Code& code = Code::Handle(Code::FinalizeCode(
-      *CreateFunction("Test_Code"), &_assembler_));
+      Function::Handle(CreateFunction("Test_Code")), &_assembler_));
   code.set_pc_descriptors(descriptors);
 
   // Verify the PcDescriptor entries by accessing them.
@@ -3363,7 +3333,7 @@
   WeakProperty& weak = WeakProperty::Handle();
   {
     // Weak property and value in new. Key in old.
-    HANDLESCOPE(isolate);
+    HANDLESCOPE(thread);
     String& key = String::Handle();
     key ^= OneByteString::New("key", Heap::kOld);
     String& value = String::Handle();
@@ -3381,7 +3351,7 @@
   EXPECT(weak.value() != Object::null());
   {
     // Weak property and value in old. Key in new.
-    HANDLESCOPE(isolate);
+    HANDLESCOPE(thread);
     String& key = String::Handle();
     key ^= OneByteString::New("key", Heap::kNew);
     String& value = String::Handle();
@@ -3399,7 +3369,7 @@
   EXPECT(weak.value() != Object::null());
   {
     // Weak property and value in new. Key is a Smi.
-    HANDLESCOPE(isolate);
+    HANDLESCOPE(thread);
     Integer& key = Integer::Handle();
     key ^= Integer::New(31);
     String& value = String::Handle();
@@ -3417,7 +3387,7 @@
   EXPECT(weak.value() != Object::null());
   {
     // Weak property and value in old. Key is a Smi.
-    HANDLESCOPE(isolate);
+    HANDLESCOPE(thread);
     Integer& key = Integer::Handle();
     key ^= Integer::New(32);
     String& value = String::Handle();
@@ -3435,7 +3405,7 @@
   EXPECT(weak.value() != Object::null());
   {
     // Weak property and value in new. Key in VM isolate.
-    HANDLESCOPE(isolate);
+    HANDLESCOPE(thread);
     String& value = String::Handle();
     value ^= OneByteString::New("value", Heap::kNew);
     weak ^= WeakProperty::New(Heap::kNew);
@@ -3452,7 +3422,7 @@
   EXPECT(weak.value() != Object::null());
   {
     // Weak property and value in old. Key in VM isolate.
-    HANDLESCOPE(isolate);
+    HANDLESCOPE(thread);
     String& value = String::Handle();
     value ^= OneByteString::New("value", Heap::kOld);
     weak ^= WeakProperty::New(Heap::kOld);
@@ -3477,7 +3447,7 @@
   WeakProperty& weak = WeakProperty::Handle();
   Array& arr = Array::Handle(Array::New(1));
   {
-    HANDLESCOPE(isolate);
+    HANDLESCOPE(thread);
     String& key = String::Handle();
     key ^= OneByteString::New("key");
     arr.SetAt(0, key);
@@ -3499,7 +3469,7 @@
   String& key = String::Handle();
   key ^= OneByteString::New("key");
   {
-    HANDLESCOPE(isolate);
+    HANDLESCOPE(thread);
     String& value = String::Handle();
     value ^= OneByteString::New("value");
     weak ^= WeakProperty::New();
@@ -3521,7 +3491,7 @@
   String& key2 = String::Handle();
   key2 ^= OneByteString::New("key2");
   {
-    HANDLESCOPE(isolate);
+    HANDLESCOPE(thread);
     String& value1 = String::Handle();
     value1 ^= OneByteString::New("value1");
     weak1 ^= WeakProperty::New();
@@ -3548,7 +3518,7 @@
   String& key = String::Handle();
   key ^= OneByteString::New("key");
   {
-    HANDLESCOPE(isolate);
+    HANDLESCOPE(thread);
     String& value1 = String::Handle();
     value1 ^= OneByteString::New("value1");
     weak1 ^= WeakProperty::New();
@@ -3574,7 +3544,7 @@
   String& key = String::Handle();
   key ^= OneByteString::New("key", Heap::kOld);
   {
-    HANDLESCOPE(isolate);
+    HANDLESCOPE(thread);
     String& value = String::Handle();
     value ^= OneByteString::New("value", Heap::kOld);
     weak ^= WeakProperty::New(Heap::kOld);
@@ -3596,7 +3566,7 @@
   String& key2 = String::Handle();
   key2 ^= OneByteString::New("key2", Heap::kOld);
   {
-    HANDLESCOPE(isolate);
+    HANDLESCOPE(thread);
     String& value1 = String::Handle();
     value1 ^= OneByteString::New("value1", Heap::kOld);
     weak1 ^= WeakProperty::New(Heap::kOld);
@@ -3623,7 +3593,7 @@
   String& key = String::Handle();
   key ^= OneByteString::New("key", Heap::kOld);
   {
-    HANDLESCOPE(isolate);
+    HANDLESCOPE(thread);
     String& value1 = String::Handle();
     value1 ^= OneByteString::New("value1", Heap::kOld);
     weak1 ^= WeakProperty::New(Heap::kOld);
@@ -3647,7 +3617,7 @@
   Isolate* isolate = Isolate::Current();
   WeakProperty& weak = WeakProperty::Handle();
   {
-    HANDLESCOPE(isolate);
+    HANDLESCOPE(thread);
     String& key = String::Handle();
     key ^= OneByteString::New("key");
     String& value = String::Handle();
@@ -3669,7 +3639,7 @@
   WeakProperty& weak1 = WeakProperty::Handle();
   WeakProperty& weak2 = WeakProperty::Handle();
   {
-    HANDLESCOPE(isolate);
+    HANDLESCOPE(thread);
     String& key = String::Handle();
     key ^= OneByteString::New("key");
     String& value1 = String::Handle();
@@ -3695,7 +3665,7 @@
   Isolate* isolate = Isolate::Current();
   WeakProperty& weak = WeakProperty::Handle();
   {
-    HANDLESCOPE(isolate);
+    HANDLESCOPE(thread);
     String& key = String::Handle();
     key ^= OneByteString::New("key", Heap::kOld);
     String& value = String::Handle();
@@ -3717,7 +3687,7 @@
   WeakProperty& weak1 = WeakProperty::Handle();
   WeakProperty& weak2 = WeakProperty::Handle();
   {
-    HANDLESCOPE(isolate);
+    HANDLESCOPE(thread);
     String& key = String::Handle();
     key ^= OneByteString::New("key", Heap::kOld);
     String& value1 = String::Handle();
@@ -3962,7 +3932,8 @@
   Function& invocation_dispatcher = Function::Handle();
   invocation_dispatcher ^=
       cls.GetInvocationDispatcher(invocation_dispatcher_name, args_desc,
-                                  RawFunction::kNoSuchMethodDispatcher);
+                                  RawFunction::kNoSuchMethodDispatcher,
+                                  true /* create_if_absent */);
   EXPECT(!invocation_dispatcher.IsNull());
   // Get index to function.
   intptr_t invocation_dispatcher_index =
@@ -4259,40 +4230,6 @@
 }
 
 
-// Elide a substring which starts with some prefix and ends with a ".
-//
-// This is used to remove non-deterministic or fragile substrings from
-// JSON output.
-//
-// For example:
-//
-//    prefix = "classes"
-//    in = "\"id\":\"classes/46\""
-//
-// Yields:
-//
-//    out = "\"id\":\"\""
-//
-static void elideSubstring(const char* prefix, const char* in, char* out) {
-  const char* pos = strstr(in, prefix);
-  while (pos != NULL) {
-    // Copy up to pos into the output buffer.
-    while (in < pos) {
-      *out++ = *in++;
-    }
-
-    // Skip to the close quote.
-    in += strcspn(in, "\"");
-    pos = strstr(in, prefix);
-  }
-  // Copy the remainder of in to out.
-  while (*in != '\0') {
-    *out++ = *in++;
-  }
-  *out = '\0';
-}
-
-
 TEST_CASE(PrintJSONPrimitives) {
   char buffer[1024];
   Isolate* isolate = Isolate::Current();
@@ -4302,7 +4239,7 @@
     JSONStream js;
     Class& cls = Class::Handle(isolate->object_store()->bool_class());
     cls.PrintJSON(&js, true);
-    elideSubstring("classes", js.ToCString(), buffer);
+    ElideJSONSubstring("classes", js.ToCString(), buffer);
     EXPECT_STREQ(
         "{\"type\":\"@Class\",\"fixedId\":true,\"id\":\"\",\"name\":\"bool\"}",
         buffer);
@@ -4315,7 +4252,7 @@
     Function& func = Function::Handle(cls.LookupFunction(func_name));
     ASSERT(!func.IsNull());
     func.PrintJSON(&js, true);
-    elideSubstring("classes", js.ToCString(), buffer);
+    ElideJSONSubstring("classes", js.ToCString(), buffer);
     EXPECT_STREQ(
         "{\"type\":\"@Function\",\"fixedId\":true,"
         "\"id\":\"\",\"name\":\"toString\","
@@ -4330,7 +4267,7 @@
     JSONStream js;
     Library& lib = Library::Handle(isolate->object_store()->core_library());
     lib.PrintJSON(&js, true);
-    elideSubstring("libraries", js.ToCString(), buffer);
+    ElideJSONSubstring("libraries", js.ToCString(), buffer);
     EXPECT_STREQ(
         "{\"type\":\"@Library\",\"fixedId\":true,\"id\":\"\","
         "\"name\":\"dart.core\",\"uri\":\"dart:core\"}",
@@ -4340,7 +4277,7 @@
   {
     JSONStream js;
     Bool::True().PrintJSON(&js, true);
-    elideSubstring("classes", js.ToCString(), buffer);
+    ElideJSONSubstring("classes", js.ToCString(), buffer);
     EXPECT_STREQ(
         "{\"type\":\"@Instance\","
         "\"_vmType\":\"Bool\","
@@ -4356,8 +4293,8 @@
     JSONStream js;
     const Integer& smi = Integer::Handle(Integer::New(7));
     smi.PrintJSON(&js, true);
-    elideSubstring("classes", js.ToCString(), buffer);
-    elideSubstring("_Smi@", buffer, buffer);
+    ElideJSONSubstring("classes", js.ToCString(), buffer);
+    ElideJSONSubstring("_Smi@", buffer, buffer);
     EXPECT_STREQ(
         "{\"type\":\"@Instance\","
         "\"_vmType\":\"Smi\","
@@ -4374,9 +4311,9 @@
     JSONStream js;
     const Integer& smi = Integer::Handle(Integer::New(Mint::kMinValue));
     smi.PrintJSON(&js, true);
-    elideSubstring("classes", js.ToCString(), buffer);
-    elideSubstring("objects", buffer, buffer);
-    elideSubstring("_Mint@", buffer, buffer);
+    ElideJSONSubstring("classes", js.ToCString(), buffer);
+    ElideJSONSubstring("objects", buffer, buffer);
+    ElideJSONSubstring("_Mint@", buffer, buffer);
     EXPECT_STREQ(
         "{\"type\":\"@Instance\","
         "\"_vmType\":\"Mint\","
@@ -4393,9 +4330,9 @@
         String::Handle(String::New("44444444444444444444444444444444"));
     const Integer& bigint = Integer::Handle(Integer::New(bigint_str));
     bigint.PrintJSON(&js, true);
-    elideSubstring("classes", js.ToCString(), buffer);
-    elideSubstring("objects", buffer, buffer);
-    elideSubstring("_Bigint@", buffer, buffer);
+    ElideJSONSubstring("classes", js.ToCString(), buffer);
+    ElideJSONSubstring("objects", buffer, buffer);
+    ElideJSONSubstring("_Bigint@", buffer, buffer);
     EXPECT_STREQ(
         "{\"type\":\"@Instance\","
         "\"_vmType\":\"Bigint\","
@@ -4410,9 +4347,9 @@
     JSONStream js;
     const Double& dub = Double::Handle(Double::New(0.1234));
     dub.PrintJSON(&js, true);
-    elideSubstring("classes", js.ToCString(), buffer);
-    elideSubstring("objects", buffer, buffer);
-    elideSubstring("_Double@", buffer, buffer);
+    ElideJSONSubstring("classes", js.ToCString(), buffer);
+    ElideJSONSubstring("objects", buffer, buffer);
+    ElideJSONSubstring("_Double@", buffer, buffer);
     EXPECT_STREQ(
         "{\"type\":\"@Instance\","
         "\"_vmType\":\"Double\","
@@ -4427,9 +4364,9 @@
     JSONStream js;
     const String& str = String::Handle(String::New("dw"));
     str.PrintJSON(&js, true);
-    elideSubstring("classes", js.ToCString(), buffer);
-    elideSubstring("objects", buffer, buffer);
-    elideSubstring("_OneByteString@", buffer, buffer);
+    ElideJSONSubstring("classes", js.ToCString(), buffer);
+    ElideJSONSubstring("objects", buffer, buffer);
+    ElideJSONSubstring("_OneByteString@", buffer, buffer);
     EXPECT_STREQ(
         "{\"type\":\"@Instance\","
         "\"_vmType\":\"String\","
@@ -4444,9 +4381,9 @@
     JSONStream js;
     const Array& array = Array::Handle(Array::New(0));
     array.PrintJSON(&js, true);
-    elideSubstring("classes", js.ToCString(), buffer);
-    elideSubstring("objects", buffer, buffer);
-    elideSubstring("_List@", buffer, buffer);
+    ElideJSONSubstring("classes", js.ToCString(), buffer);
+    ElideJSONSubstring("objects", buffer, buffer);
+    ElideJSONSubstring("_List@", buffer, buffer);
     EXPECT_STREQ(
         "{\"type\":\"@Instance\","
         "\"_vmType\":\"Array\","
@@ -4462,9 +4399,9 @@
     const GrowableObjectArray& array =
         GrowableObjectArray::Handle(GrowableObjectArray::New());
     array.PrintJSON(&js, true);
-    elideSubstring("classes", js.ToCString(), buffer);
-    elideSubstring("objects", buffer, buffer);
-    elideSubstring("_GrowableList@", buffer, buffer);
+    ElideJSONSubstring("classes", js.ToCString(), buffer);
+    ElideJSONSubstring("objects", buffer, buffer);
+    ElideJSONSubstring("_GrowableList@", buffer, buffer);
     EXPECT_STREQ(
         "{\"type\":\"@Instance\","
         "\"_vmType\":\"GrowableObjectArray\","
@@ -4481,9 +4418,9 @@
     const LinkedHashMap& array =
         LinkedHashMap::Handle(LinkedHashMap::NewDefault());
     array.PrintJSON(&js, true);
-    elideSubstring("classes", js.ToCString(), buffer);
-    elideSubstring("objects", buffer, buffer);
-    elideSubstring("_InternalLinkedHashMap@", buffer, buffer);
+    ElideJSONSubstring("classes", js.ToCString(), buffer);
+    ElideJSONSubstring("objects", buffer, buffer);
+    ElideJSONSubstring("_InternalLinkedHashMap@", buffer, buffer);
     EXPECT_STREQ(
         "{\"type\":\"@Instance\","
         "\"_vmType\":\"LinkedHashMap\","
@@ -4499,9 +4436,9 @@
     JSONStream js;
     Instance& tag = Instance::Handle(isolate->default_tag());
     tag.PrintJSON(&js, true);
-    elideSubstring("classes", js.ToCString(), buffer);
-    elideSubstring("objects", buffer, buffer);
-    elideSubstring("_UserTag@", buffer, buffer);
+    ElideJSONSubstring("classes", js.ToCString(), buffer);
+    ElideJSONSubstring("objects", buffer, buffer);
+    ElideJSONSubstring("_UserTag@", buffer, buffer);
     EXPECT_STREQ(
         "{\"type\":\"@Instance\","
         "\"_vmType\":\"UserTag\","
@@ -4517,9 +4454,9 @@
     JSONStream js;
     Instance& type = Instance::Handle(isolate->object_store()->bool_type());
     type.PrintJSON(&js, true);
-    elideSubstring("classes", js.ToCString(), buffer);
-    elideSubstring("objects", buffer, buffer);
-    elideSubstring("_Type@", buffer, buffer);
+    ElideJSONSubstring("classes", js.ToCString(), buffer);
+    ElideJSONSubstring("objects", buffer, buffer);
+    ElideJSONSubstring("_Type@", buffer, buffer);
     EXPECT_STREQ(
         "{\"type\":\"@Instance\","
         "\"_vmType\":\"Type\","
@@ -4535,14 +4472,17 @@
   {
     JSONStream js;
     Object::null_object().PrintJSON(&js, true);
+    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\"}",
-        js.ToCString());
+        buffer);
   }
   // Sentinel reference
   {
@@ -4571,7 +4511,7 @@
     JSONStream js;
     LiteralToken& tok = LiteralToken::Handle(LiteralToken::New());
     tok.PrintJSON(&js, true);
-    elideSubstring("objects", js.ToCString(), buffer);
+    ElideJSONSubstring("objects", js.ToCString(), buffer);
     EXPECT_STREQ(
         "{\"type\":\"@Object\",\"_vmType\":\"LiteralToken\",\"id\":\"\"}",
         buffer);
@@ -4739,4 +4679,116 @@
   EXPECT(!iterator.MoveNext());
 }
 
+
+static void CheckConcatAll(const String* data[], intptr_t n) {
+  Zone* zone = Thread::Current()->zone();
+  GrowableHandlePtrArray<const String> pieces(zone, n);
+  const Array& array = Array::Handle(zone, Array::New(n));
+  for (int i = 0; i < n; i++) {
+    pieces.Add(*data[i]);
+    array.SetAt(i, *data[i]);
+  }
+  const String& res1 = String::Handle(zone, Symbols::FromConcatAll(pieces));
+  const String& res2 = String::Handle(zone, String::ConcatAll(array));
+  EXPECT(res1.Equals(res2));
+}
+
+
+TEST_CASE(Symbols_FromConcatAll) {
+  {
+    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));
+
+    const String* data[3] = { &two_str, &Symbols::Dot(), &two_str };
+    CheckConcatAll(data, 3);
+  }
+
+  {
+    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 };
+    CheckConcatAll(data, 3);
+  }
+
+  {
+    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 };
+    CheckConcatAll(data, 3);
+  }
+
+  {
+    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' };
+    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 };
+    CheckConcatAll(data, 3);
+  }
+
+  {
+    const String& empty = String::Handle(String::New(""));
+    const String* data[3] = { &Symbols::FallThroughError(),
+                              &empty,
+                              &Symbols::isPaused() };
+    CheckConcatAll(data, 3);
+  }
+}
+
+
+struct TestResult {
+  const char* in;
+  const char* out;
+};
+
+
+TEST_CASE(String_IdentifierPrettyName) {
+  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"},
+  };
+  String& test = String::Handle();
+  String& result = String::Handle();
+  for (size_t i = 0; i < ARRAY_SIZE(tests); i++) {
+    test = String::New(tests[i].in);
+    result = String::IdentifierPrettyName(test);
+    EXPECT_STREQ(tests[i].out, result.ToCString());
+  }
+}
+
 }  // namespace dart
diff --git a/runtime/vm/object_x64_test.cc b/runtime/vm/object_x64_test.cc
index 639d8d0..e5b1033 100644
--- a/runtime/vm/object_x64_test.cc
+++ b/runtime/vm/object_x64_test.cc
@@ -34,10 +34,9 @@
 void GenerateEmbedStringInCode(Assembler* assembler, const char* str) {
   const String& string_object =
       String::ZoneHandle(String::New(str, Heap::kOld));
-  __ pushq(PP);  // Save caller's pool pointer and load a new one here.
-  __ LoadPoolPointer();
+  __ EnterStubFrame();
   __ LoadObject(RAX, string_object);
-  __ popq(PP);  // Restore caller's pool pointer.
+  __ LeaveStubFrame();
   __ ret();
 }
 
diff --git a/runtime/vm/os.h b/runtime/vm/os.h
index 60456e4..5285ec8 100644
--- a/runtime/vm/os.h
+++ b/runtime/vm/os.h
@@ -14,6 +14,7 @@
 
 // Forward declarations.
 class Isolate;
+class Zone;
 
 // Interface to the underlying OS platform.
 class OS {
@@ -46,6 +47,9 @@
   // from midnight January 1, 1970 UTC.
   static int64_t GetCurrentTimeMicros();
 
+  // Returns the current time used by the tracing infrastructure.
+  static int64_t GetCurrentTraceMicros();
+
   // Returns a cleared aligned array of type T with n entries.
   // Alignment must be >= 16 and a power of two.
   template<typename T>
@@ -120,6 +124,13 @@
                       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
+  // malloc.
+  static char* SCreate(Zone* zone, const char* format, ...)
+      PRINTF_ATTRIBUTE(2, 3);
+  static char* VSCreate(Zone* zone, const char* format, va_list args);
+
   // Converts a C string which represents a valid dart integer into a 64 bit
   // value.
   // Returns false if it is unable to convert the string to a 64 bit value,
diff --git a/runtime/vm/os_android.cc b/runtime/vm/os_android.cc
index 676e278..1d448d0 100644
--- a/runtime/vm/os_android.cc
+++ b/runtime/vm/os_android.cc
@@ -44,12 +44,10 @@
     if (file_open == NULL) {
       return;
     }
-    const char* format = "/tmp/perf-%ld.map";
     intptr_t pid = getpid();
-    intptr_t len = OS::SNPrint(NULL, 0, format, pid);
-    char* filename = new char[len + 1];
-    OS::SNPrint(filename, len + 1, format, pid);
+    char* filename = OS::SCreate(NULL, "/tmp/perf-%" Pd ".map", pid);
     out_file_ = (*file_open)(filename, true);
+    free(filename);
   }
 
   ~PerfCodeObserver() {
@@ -73,12 +71,10 @@
     if ((file_write == NULL) || (out_file_ == NULL)) {
       return;
     }
-    const char* format = "%" Px " %" Px " %s%s\n";
     const char* marker = optimized ? "*" : "";
-    intptr_t len = OS::SNPrint(NULL, 0, format, base, size, marker, name);
-    char* buffer = Thread::Current()->zone()->Alloc<char>(len + 1);
-    OS::SNPrint(buffer, len + 1, format, base, size, marker, name);
-    (*file_write)(buffer, len, out_file_);
+    char* buffer = OS::SCreate(Thread::Current()->zone(),
+        "%" Px " %" Px " %s%s\n", base, size, marker, name);
+    (*file_write)(buffer, strlen(buffer), out_file_);
   }
 
  private:
@@ -107,10 +103,8 @@
       // the prologue sequence is not the first instruction:
       // <name>_entry is used for code preceding the prologue sequence.
       // <name> for rest of the code (first instruction is prologue sequence).
-      const char* kFormat = "%s_%s";
-      intptr_t len = OS::SNPrint(NULL, 0, kFormat, name, "entry");
-      char* pname = Thread::Current()->zone()->Alloc<char>(len + 1);
-      OS::SNPrint(pname, (len + 1), kFormat, name, "entry");
+      char* pname = OS::SCreate(Thread::Current()->zone(),
+          "%s_%s", name, "entry");
       DebugInfo::RegisterSection(pname, base, size);
       DebugInfo::RegisterSection(name,
                                  (base + prologue_offset),
@@ -185,6 +179,20 @@
 }
 
 
+int64_t OS::GetCurrentTraceMicros() {
+  struct timespec ts;
+  if (clock_gettime(CLOCK_MONOTONIC, &ts) != 0) {
+    UNREACHABLE();
+    return 0;
+  }
+  // Convert to microseconds.
+  int64_t result = ts.tv_sec;
+  result *= kMicrosecondsPerSecond;
+  result += (ts.tv_nsec / kNanosecondsPerMicrosecond);
+  return result;
+}
+
+
 void* OS::AlignedAllocate(intptr_t size, intptr_t alignment) {
   const int kMinimumAlignment = 16;
   ASSERT(Utils::IsPowerOfTwo(alignment));
@@ -354,6 +362,39 @@
 }
 
 
+char* OS::SCreate(Zone* zone, const char* format, ...) {
+  va_list args;
+  va_start(args, format);
+  char* buffer = VSCreate(zone, format, args);
+  va_end(args);
+  return buffer;
+}
+
+
+char* OS::VSCreate(Zone* zone, const char* format, va_list args) {
+  // Measure.
+  va_list measure_args;
+  va_copy(measure_args, args);
+  intptr_t len = VSNPrint(NULL, 0, format, measure_args);
+  va_end(measure_args);
+
+  char* buffer;
+  if (zone) {
+    buffer = zone->Alloc<char>(len + 1);
+  } else {
+    buffer = reinterpret_cast<char*>(malloc(len + 1));
+  }
+  ASSERT(buffer != NULL);
+
+  // Print.
+  va_list print_args;
+  va_copy(print_args, args);
+  VSNPrint(buffer, len + 1, format, print_args);
+  va_end(print_args);
+  return buffer;
+}
+
+
 bool OS::StringToInt64(const char* str, int64_t* value) {
   ASSERT(str != NULL && strlen(str) > 0 && value != NULL);
   int32_t base = 10;
diff --git a/runtime/vm/os_linux.cc b/runtime/vm/os_linux.cc
index 288db46..25c64b7 100644
--- a/runtime/vm/os_linux.cc
+++ b/runtime/vm/os_linux.cc
@@ -49,13 +49,10 @@
     if (file_open == NULL) {
       return;
     }
-    const char* format = "/tmp/perf-%" Pd ".map";
     intptr_t pid = getpid();
-    intptr_t len = OS::SNPrint(NULL, 0, format, pid);
-    char* filename = new char[len + 1];
-    OS::SNPrint(filename, len + 1, format, pid);
+    char* filename = OS::SCreate(NULL, "/tmp/perf-%" Pd ".map", pid);
     out_file_ = (*file_open)(filename, true);
-    delete[] filename;
+    free(filename);
   }
 
   ~PerfCodeObserver() {
@@ -79,14 +76,12 @@
     if ((file_write == NULL) || (out_file_ == NULL)) {
       return;
     }
-    const char* format = "%" Px " %" Px " %s%s\n";
     const char* marker = optimized ? "*" : "";
-    intptr_t len = OS::SNPrint(NULL, 0, format, base, size, marker, name);
-    char* buffer = Thread::Current()->zone()->Alloc<char>(len + 1);
-    OS::SNPrint(buffer, len + 1, format, 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, len, out_file_);
+      (*file_write)(buffer, strlen(buffer), out_file_);
     }
   }
 
@@ -116,10 +111,8 @@
       // the prologue sequence is not the first instruction:
       // <name>_entry is used for code preceding the prologue sequence.
       // <name> for rest of the code (first instruction is prologue sequence).
-      const char* kFormat = "%s_%s";
-      intptr_t len = OS::SNPrint(NULL, 0, kFormat, name, "entry");
-      char* pname = Thread::Current()->zone()->Alloc<char>(len + 1);
-      OS::SNPrint(pname, (len + 1), kFormat, name, "entry");
+      char* pname = OS::SCreate(Thread::Current()->zone(),
+          "%s_%s", name, "entry");
       DebugInfo::RegisterSection(pname, base, size);
       DebugInfo::RegisterSection(name,
                                  (base + prologue_offset),
@@ -245,12 +238,8 @@
   };
 
   const char* GenerateCodeName(const char* name, bool optimized) {
-    const char* format = "%s%s";
     const char* marker = optimized ? "*" : "";
-    intptr_t len = OS::SNPrint(NULL, 0, format, marker, name);
-    char* buffer = Thread::Current()->zone()->Alloc<char>(len + 1);
-    OS::SNPrint(buffer, len + 1, format, marker, name);
-    return buffer;
+    return OS::SCreate(Thread::Current()->zone(), "%s%s", marker, name);
   }
 
   uint32_t GetElfMach() {
@@ -407,6 +396,20 @@
 }
 
 
+int64_t OS::GetCurrentTraceMicros() {
+  struct timespec ts;
+  if (clock_gettime(CLOCK_MONOTONIC, &ts) != 0) {
+    UNREACHABLE();
+    return 0;
+  }
+  // Convert to microseconds.
+  int64_t result = ts.tv_sec;
+  result *= kMicrosecondsPerSecond;
+  result += (ts.tv_nsec / kNanosecondsPerMicrosecond);
+  return result;
+}
+
+
 void* OS::AlignedAllocate(intptr_t size, intptr_t alignment) {
   const int kMinimumAlignment = 16;
   ASSERT(Utils::IsPowerOfTwo(alignment));
@@ -549,6 +552,39 @@
 }
 
 
+char* OS::SCreate(Zone* zone, const char* format, ...) {
+  va_list args;
+  va_start(args, format);
+  char* buffer = VSCreate(zone, format, args);
+  va_end(args);
+  return buffer;
+}
+
+
+char* OS::VSCreate(Zone* zone, const char* format, va_list args) {
+  // Measure.
+  va_list measure_args;
+  va_copy(measure_args, args);
+  intptr_t len = VSNPrint(NULL, 0, format, measure_args);
+  va_end(measure_args);
+
+  char* buffer;
+  if (zone) {
+    buffer = zone->Alloc<char>(len + 1);
+  } else {
+    buffer = reinterpret_cast<char*>(malloc(len + 1));
+  }
+  ASSERT(buffer != NULL);
+
+  // Print.
+  va_list print_args;
+  va_copy(print_args, args);
+  VSNPrint(buffer, len + 1, format, print_args);
+  va_end(print_args);
+  return buffer;
+}
+
+
 bool OS::StringToInt64(const char* str, int64_t* value) {
   ASSERT(str != NULL && strlen(str) > 0 && value != NULL);
   int32_t base = 10;
diff --git a/runtime/vm/os_macos.cc b/runtime/vm/os_macos.cc
index efdcd2b..aed5d33 100644
--- a/runtime/vm/os_macos.cc
+++ b/runtime/vm/os_macos.cc
@@ -15,9 +15,13 @@
 #include <sys/time.h>  // NOLINT
 #include <sys/resource.h>  // NOLINT
 #include <unistd.h>  // NOLINT
+#if TARGET_OS_IOS
+#include <sys/sysctl.h>
+#endif
 
 #include "platform/utils.h"
 #include "vm/isolate.h"
+#include "vm/zone.h"
 
 namespace dart {
 
@@ -81,6 +85,43 @@
 }
 
 
+int64_t OS::GetCurrentTraceMicros() {
+#if TARGET_OS_IOS
+  // On iOS mach_absolute_time stops while the device is sleeping. Instead use
+  // now - KERN_BOOTTIME to get a time difference that is not impacted by clock
+  // changes. KERN_BOOTTIME will be updated by the system whenever the system
+  // clock change.
+  struct timeval boottime;
+  int mib[2] = {CTL_KERN, KERN_BOOTTIME};
+  size_t size = sizeof(boottime);
+  int kr = sysctl(mib, sizeof(mib) / sizeof(mib[0]), &boottime, &size, NULL, 0);
+  ASSERT(KERN_SUCCESS == kr);
+  int64_t now = GetCurrentTimeMicros();
+  int64_t origin = boottime.tv_sec * kMicrosecondsPerSecond;
+  origin += boottime.tv_usec;
+  return now - origin;
+#else
+  static mach_timebase_info_data_t timebase_info;
+  if (timebase_info.denom == 0) {
+    // Zero-initialization of statics guarantees that denom will be 0 before
+    // calling mach_timebase_info.  mach_timebase_info will never set denom to
+    // 0 as that would be invalid, so the zero-check can be used to determine
+    // whether mach_timebase_info has already been called.  This is
+    // recommended by Apple's QA1398.
+    kern_return_t kr = mach_timebase_info(&timebase_info);
+    ASSERT(KERN_SUCCESS == kr);
+  }
+
+  // timebase_info converts absolute time tick units into nanoseconds.  Convert
+  // to microseconds.
+  int64_t result = mach_absolute_time() / kNanosecondsPerMicrosecond;
+  result *= timebase_info.numer;
+  result /= timebase_info.denom;
+  return result;
+#endif  // TARGET_OS_IOS
+}
+
+
 void* OS::AlignedAllocate(intptr_t size, intptr_t alignment) {
   const int kMinimumAlignment = 16;
   ASSERT(Utils::IsPowerOfTwo(alignment));
@@ -214,6 +255,39 @@
 }
 
 
+char* OS::SCreate(Zone* zone, const char* format, ...) {
+  va_list args;
+  va_start(args, format);
+  char* buffer = VSCreate(zone, format, args);
+  va_end(args);
+  return buffer;
+}
+
+
+char* OS::VSCreate(Zone* zone, const char* format, va_list args) {
+  // Measure.
+  va_list measure_args;
+  va_copy(measure_args, args);
+  intptr_t len = VSNPrint(NULL, 0, format, measure_args);
+  va_end(measure_args);
+
+  char* buffer;
+  if (zone) {
+    buffer = zone->Alloc<char>(len + 1);
+  } else {
+    buffer = reinterpret_cast<char*>(malloc(len + 1));
+  }
+  ASSERT(buffer != NULL);
+
+  // Print.
+  va_list print_args;
+  va_copy(print_args, args);
+  VSNPrint(buffer, len + 1, format, print_args);
+  va_end(print_args);
+  return buffer;
+}
+
+
 bool OS::StringToInt64(const char* str, int64_t* value) {
   ASSERT(str != NULL && strlen(str) > 0 && value != NULL);
   int32_t base = 10;
diff --git a/runtime/vm/os_thread.h b/runtime/vm/os_thread.h
index c3250d8..d6ae2b5 100644
--- a/runtime/vm/os_thread.h
+++ b/runtime/vm/os_thread.h
@@ -29,6 +29,7 @@
  public:
   static ThreadLocalKey kUnsetThreadLocalKey;
   static ThreadId kInvalidThreadId;
+  static ThreadJoinId kInvalidThreadJoinId;
 
   typedef void (*ThreadStartFunction) (uword parameter);
   typedef void (*ThreadDestructor) (void* parameter);
@@ -47,8 +48,14 @@
   static void SetThreadLocal(ThreadLocalKey key, uword value);
   static intptr_t GetMaxStackSize();
   static ThreadId GetCurrentThreadId();
-  static bool Join(ThreadId id);
+  static ThreadId GetCurrentThreadTraceId();
+  static intptr_t CurrentCurrentThreadIdAsIntPtr() {
+    return ThreadIdToIntPtr(GetCurrentThreadId());
+  }
+  static ThreadJoinId GetCurrentThreadJoinId();
+  static void Join(ThreadJoinId id);
   static intptr_t ThreadIdToIntPtr(ThreadId id);
+  static ThreadId ThreadIdFromIntPtr(intptr_t id);
   static bool Compare(ThreadId a, ThreadId b);
   static void GetThreadCpuUsage(ThreadId thread_id, int64_t* cpu_usage);
 };
@@ -67,7 +74,12 @@
   bool IsOwnedByCurrentThread() const {
     return owner_ == OSThread::GetCurrentThreadId();
   }
-#endif  // defined(DEBUG)
+#else
+  bool IsOwnedByCurrentThread() const {
+    UNREACHABLE();
+    return false;
+  }
+#endif
 
  private:
   MutexData data_;
diff --git a/runtime/vm/os_thread_android.cc b/runtime/vm/os_thread_android.cc
index ae1b9f2..fa87896 100644
--- a/runtime/vm/os_thread_android.cc
+++ b/runtime/vm/os_thread_android.cc
@@ -101,9 +101,6 @@
   int result = pthread_attr_init(&attr);
   RETURN_ON_PTHREAD_FAILURE(result);
 
-  result = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
-  RETURN_ON_PTHREAD_FAILURE(result);
-
   result = pthread_attr_setstacksize(&attr, OSThread::GetMaxStackSize());
   RETURN_ON_PTHREAD_FAILURE(result);
 
@@ -123,6 +120,7 @@
 ThreadLocalKey OSThread::kUnsetThreadLocalKey =
     static_cast<pthread_key_t>(-1);
 ThreadId OSThread::kInvalidThreadId = static_cast<ThreadId>(0);
+ThreadJoinId OSThread::kInvalidThreadJoinId = static_cast<ThreadJoinId>(0);
 
 ThreadLocalKey OSThread::CreateThreadLocal(ThreadDestructor destructor) {
   pthread_key_t key = kUnsetThreadLocalKey;
@@ -158,8 +156,19 @@
 }
 
 
-bool OSThread::Join(ThreadId id) {
-  return false;
+ThreadId OSThread::GetCurrentThreadTraceId() {
+  return GetCurrentThreadId();
+}
+
+
+ThreadJoinId OSThread::GetCurrentThreadJoinId() {
+  return pthread_self();
+}
+
+
+void OSThread::Join(ThreadJoinId id) {
+  int result = pthread_join(id, NULL);
+  ASSERT(result == 0);
 }
 
 
@@ -169,6 +178,11 @@
 }
 
 
+ThreadId OSThread::ThreadIdFromIntPtr(intptr_t id) {
+  return static_cast<ThreadId>(id);
+}
+
+
 bool OSThread::Compare(ThreadId a, ThreadId b) {
   return a == b;
 }
diff --git a/runtime/vm/os_thread_android.h b/runtime/vm/os_thread_android.h
index 5ac0f81..061066e 100644
--- a/runtime/vm/os_thread_android.h
+++ b/runtime/vm/os_thread_android.h
@@ -17,7 +17,8 @@
 namespace dart {
 
 typedef pthread_key_t ThreadLocalKey;
-typedef pthread_t ThreadId;
+typedef pid_t ThreadId;
+typedef pthread_t ThreadJoinId;
 
 class ThreadInlineImpl {
  private:
diff --git a/runtime/vm/os_thread_linux.cc b/runtime/vm/os_thread_linux.cc
index 94bb823..9fb0b23 100644
--- a/runtime/vm/os_thread_linux.cc
+++ b/runtime/vm/os_thread_linux.cc
@@ -9,6 +9,7 @@
 
 #include <errno.h>  // NOLINT
 #include <sys/resource.h>  // NOLINT
+#include <sys/syscall.h>  // NOLINT
 #include <sys/time.h>  // NOLINT
 
 #include "platform/assert.h"
@@ -102,9 +103,6 @@
   int result = pthread_attr_init(&attr);
   RETURN_ON_PTHREAD_FAILURE(result);
 
-  result = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
-  RETURN_ON_PTHREAD_FAILURE(result);
-
   result = pthread_attr_setstacksize(&attr, OSThread::GetMaxStackSize());
   RETURN_ON_PTHREAD_FAILURE(result);
 
@@ -124,6 +122,7 @@
 ThreadLocalKey OSThread::kUnsetThreadLocalKey =
     static_cast<pthread_key_t>(-1);
 ThreadId OSThread::kInvalidThreadId = static_cast<ThreadId>(0);
+ThreadJoinId OSThread::kInvalidThreadJoinId = static_cast<ThreadJoinId>(0);
 
 ThreadLocalKey OSThread::CreateThreadLocal(ThreadDestructor destructor) {
   pthread_key_t key = kUnsetThreadLocalKey;
@@ -159,8 +158,19 @@
 }
 
 
-bool OSThread::Join(ThreadId id) {
-  return false;
+ThreadId OSThread::GetCurrentThreadTraceId() {
+  return syscall(__NR_gettid);
+}
+
+
+ThreadJoinId OSThread::GetCurrentThreadJoinId() {
+  return pthread_self();
+}
+
+
+void OSThread::Join(ThreadJoinId id) {
+  int result = pthread_join(id, NULL);
+  ASSERT(result == 0);
 }
 
 
@@ -170,6 +180,11 @@
 }
 
 
+ThreadId OSThread::ThreadIdFromIntPtr(intptr_t id) {
+  return static_cast<ThreadId>(id);
+}
+
+
 bool OSThread::Compare(ThreadId a, ThreadId b) {
   return pthread_equal(a, b) != 0;
 }
diff --git a/runtime/vm/os_thread_linux.h b/runtime/vm/os_thread_linux.h
index 840b36e..5901214 100644
--- a/runtime/vm/os_thread_linux.h
+++ b/runtime/vm/os_thread_linux.h
@@ -18,6 +18,7 @@
 
 typedef pthread_key_t ThreadLocalKey;
 typedef pthread_t ThreadId;
+typedef pthread_t ThreadJoinId;
 
 class ThreadInlineImpl {
  private:
diff --git a/runtime/vm/os_thread_macos.cc b/runtime/vm/os_thread_macos.cc
index 6a9aca2..e7c7c90 100644
--- a/runtime/vm/os_thread_macos.cc
+++ b/runtime/vm/os_thread_macos.cc
@@ -94,9 +94,6 @@
   int result = pthread_attr_init(&attr);
   RETURN_ON_PTHREAD_FAILURE(result);
 
-  result = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
-  RETURN_ON_PTHREAD_FAILURE(result);
-
   result = pthread_attr_setstacksize(&attr, OSThread::GetMaxStackSize());
   RETURN_ON_PTHREAD_FAILURE(result);
 
@@ -116,6 +113,8 @@
 ThreadLocalKey OSThread::kUnsetThreadLocalKey =
     static_cast<pthread_key_t>(-1);
 ThreadId OSThread::kInvalidThreadId = reinterpret_cast<ThreadId>(NULL);
+ThreadJoinId OSThread::kInvalidThreadJoinId =
+    reinterpret_cast<ThreadJoinId>(NULL);
 
 ThreadLocalKey OSThread::CreateThreadLocal(ThreadDestructor destructor) {
   pthread_key_t key = kUnsetThreadLocalKey;
@@ -151,8 +150,19 @@
 }
 
 
-bool OSThread::Join(ThreadId id) {
-  return false;
+ThreadId OSThread::GetCurrentThreadTraceId() {
+  return ThreadIdFromIntPtr(pthread_mach_thread_np(pthread_self()));
+}
+
+
+ThreadJoinId OSThread::GetCurrentThreadJoinId() {
+  return pthread_self();
+}
+
+
+void OSThread::Join(ThreadJoinId id) {
+  int result = pthread_join(id, NULL);
+  ASSERT(result == 0);
 }
 
 
@@ -162,6 +172,11 @@
 }
 
 
+ThreadId OSThread::ThreadIdFromIntPtr(intptr_t id) {
+  return reinterpret_cast<ThreadId>(id);
+}
+
+
 bool OSThread::Compare(ThreadId a, ThreadId b) {
   return pthread_equal(a, b) != 0;
 }
diff --git a/runtime/vm/os_thread_macos.h b/runtime/vm/os_thread_macos.h
index d2b9143..63b4f02 100644
--- a/runtime/vm/os_thread_macos.h
+++ b/runtime/vm/os_thread_macos.h
@@ -18,6 +18,7 @@
 
 typedef pthread_key_t ThreadLocalKey;
 typedef pthread_t ThreadId;
+typedef pthread_t ThreadJoinId;
 
 class ThreadInlineImpl {
  private:
diff --git a/runtime/vm/os_thread_win.cc b/runtime/vm/os_thread_win.cc
index cdcf36c..a71d4b6 100644
--- a/runtime/vm/os_thread_win.cc
+++ b/runtime/vm/os_thread_win.cc
@@ -71,6 +71,7 @@
 
 ThreadLocalKey OSThread::kUnsetThreadLocalKey = TLS_OUT_OF_INDEXES;
 ThreadId OSThread::kInvalidThreadId = 0;
+ThreadJoinId OSThread::kInvalidThreadJoinId = 0;
 
 ThreadLocalKey OSThread::CreateThreadLocal(ThreadDestructor unused) {
   ThreadLocalKey key = TlsAlloc();
@@ -101,14 +102,33 @@
 }
 
 
-bool OSThread::Join(ThreadId id) {
+ThreadId OSThread::GetCurrentThreadTraceId() {
+  return ::GetCurrentThreadId();
+}
+
+
+ThreadJoinId OSThread::GetCurrentThreadJoinId() {
+  return ::GetCurrentThreadId();
+}
+
+
+void OSThread::Join(ThreadJoinId id) {
   HANDLE handle = OpenThread(SYNCHRONIZE, false, id);
-  if (handle == INVALID_HANDLE_VALUE) {
-    return false;
+
+  // TODO(zra): OSThread::Start() closes the handle to the thread. Thus, by the
+  // time we try to join the thread, its resources may have already been
+  // reclaimed, and joining will fail. This can be avoided in a couple of ways.
+  // First, GetCurrentThreadJoinId could call OpenThread and return a handle.
+  // This is bad, because each of those handles would have to be closed.
+  // Second OSThread could be refactored to no longer be AllStatic. Then the
+  // handle could be cached in the object by the Start method.
+  if (handle == NULL) {
+    return;
   }
+
   DWORD res = WaitForSingleObject(handle, INFINITE);
   CloseHandle(handle);
-  return res == WAIT_OBJECT_0;
+  ASSERT(res == WAIT_OBJECT_0);
 }
 
 
@@ -118,6 +138,11 @@
 }
 
 
+ThreadId OSThread::ThreadIdFromIntPtr(intptr_t id) {
+  return static_cast<ThreadId>(id);
+}
+
+
 bool OSThread::Compare(ThreadId a, ThreadId b) {
   return a == b;
 }
diff --git a/runtime/vm/os_thread_win.h b/runtime/vm/os_thread_win.h
index 27a5b14..5dc9b18 100644
--- a/runtime/vm/os_thread_win.h
+++ b/runtime/vm/os_thread_win.h
@@ -16,7 +16,7 @@
 
 typedef DWORD ThreadLocalKey;
 typedef DWORD ThreadId;
-
+typedef DWORD ThreadJoinId;
 
 class ThreadInlineImpl {
  private:
diff --git a/runtime/vm/os_win.cc b/runtime/vm/os_win.cc
index 1f66ad4..0e07cdf 100644
--- a/runtime/vm/os_win.cc
+++ b/runtime/vm/os_win.cc
@@ -15,6 +15,7 @@
 #include "platform/assert.h"
 #include "vm/os_thread.h"
 #include "vm/vtune.h"
+#include "vm/zone.h"
 
 namespace dart {
 
@@ -120,6 +121,26 @@
 }
 
 
+static int64_t qpc_ticks_per_second = 0;
+
+int64_t OS::GetCurrentTraceMicros() {
+  if (qpc_ticks_per_second == 0) {
+    // QueryPerformanceCounter not supported, fallback.
+    return GetCurrentTimeMicros();
+  }
+  // Grab performance counter value.
+  LARGE_INTEGER now;
+  QueryPerformanceCounter(&now);
+  int64_t qpc_value = static_cast<int64_t>(now.QuadPart);
+  // Convert to microseconds.
+  int64_t seconds = qpc_value / qpc_ticks_per_second;
+  int64_t leftover_ticks = qpc_value - (seconds * qpc_ticks_per_second);
+  int64_t result = seconds * kMicrosecondsPerSecond;
+  result += ((leftover_ticks * kMicrosecondsPerSecond) / qpc_ticks_per_second);
+  return result;
+}
+
+
 void* OS::AlignedAllocate(intptr_t size, intptr_t alignment) {
   const int kMinimumAlignment = 16;
   ASSERT(Utils::IsPowerOfTwo(alignment));
@@ -271,6 +292,39 @@
 }
 
 
+char* OS::SCreate(Zone* zone, const char* format, ...) {
+  va_list args;
+  va_start(args, format);
+  char* buffer = VSCreate(zone, format, args);
+  va_end(args);
+  return buffer;
+}
+
+
+char* OS::VSCreate(Zone* zone, const char* format, va_list args) {
+  // Measure.
+  va_list measure_args;
+  va_copy(measure_args, args);
+  intptr_t len = VSNPrint(NULL, 0, format, measure_args);
+  va_end(measure_args);
+
+  char* buffer;
+  if (zone) {
+    buffer = zone->Alloc<char>(len + 1);
+  } else {
+    buffer = reinterpret_cast<char*>(malloc(len + 1));
+  }
+  ASSERT(buffer != NULL);
+
+  // Print.
+  va_list print_args;
+  va_copy(print_args, args);
+  VSNPrint(buffer, len + 1, format, print_args);
+  va_end(print_args);
+  return buffer;
+}
+
+
 bool OS::StringToInt64(const char* str, int64_t* value) {
   ASSERT(str != NULL && strlen(str) > 0 && value != NULL);
   int32_t base = 10;
@@ -316,6 +370,12 @@
   _set_abort_behavior(0, _WRITE_ABORT_MSG);
   MonitorWaitData::monitor_wait_data_key_ = OSThread::CreateThreadLocal();
   MonitorData::GetMonitorWaitDataForThread();
+  LARGE_INTEGER ticks_per_sec;
+  if (!QueryPerformanceFrequency(&ticks_per_sec)) {
+    qpc_ticks_per_second = 0;
+  } else {
+    qpc_ticks_per_second = static_cast<int64_t>(ticks_per_sec.QuadPart);
+  }
 }
 
 
diff --git a/runtime/vm/pages.cc b/runtime/vm/pages.cc
index b6f0b2e..da7ec80 100644
--- a/runtime/vm/pages.cc
+++ b/runtime/vm/pages.cc
@@ -11,6 +11,7 @@
 #include "vm/lockers.h"
 #include "vm/object.h"
 #include "vm/os_thread.h"
+#include "vm/thread_registry.h"
 #include "vm/verified_memory.h"
 #include "vm/virtual_memory.h"
 
@@ -135,7 +136,6 @@
       prot = VirtualMemory::kReadOnly;
     }
   } else {
-    // TODO(23217): Should this really make all pages non-executable?
     prot = VirtualMemory::kReadWrite;
   }
   bool status = memory_->Protect(prot);
@@ -161,7 +161,7 @@
       tasks_lock_(new Monitor()),
       tasks_(0),
 #if defined(DEBUG)
-      is_iterating_(false),
+      iterating_thread_(NULL),
 #endif
       page_space_controller_(heap,
                              FLAG_old_gen_growth_space_ratio,
@@ -169,6 +169,9 @@
                              FLAG_old_gen_growth_time_ratio),
       gc_time_micros_(0),
       collections_(0) {
+  // We aren't holding the lock but no one can reference us yet.
+  UpdateMaxCapacityLocked();
+  UpdateMaxUsed();
 }
 
 
@@ -211,6 +214,10 @@
     }
     pages_tail_ = page;
   } else {
+    // Should not allocate executable pages when running from a precompiled
+    // snapshot.
+    ASSERT(!Dart::IsRunningPrecompiledCode());
+
     if (exec_pages_ == NULL) {
       exec_pages_ = page;
     } else {
@@ -528,6 +535,32 @@
 }
 
 
+void PageSpace::UpdateMaxCapacityLocked() {
+  if (heap_ == NULL) {
+    // Some unit tests.
+    return;
+  }
+  ASSERT(heap_ != NULL);
+  ASSERT(heap_->isolate() != NULL);
+  Isolate* isolate = heap_->isolate();
+  isolate->GetHeapOldCapacityMaxMetric()->SetValue(
+      static_cast<int64_t>(usage_.capacity_in_words) * kWordSize);
+}
+
+
+void PageSpace::UpdateMaxUsed() {
+  if (heap_ == NULL) {
+    // Some unit tests.
+    return;
+  }
+  ASSERT(heap_ != NULL);
+  ASSERT(heap_->isolate() != NULL);
+  Isolate* isolate = heap_->isolate();
+  isolate->GetHeapOldUsedMaxMetric()->SetValue(
+      UsedInWords() * kWordSize);
+}
+
+
 bool PageSpace::Contains(uword addr) const {
   for (ExclusivePageIterator it(this); !it.Done(); it.Advance()) {
     if (it.page()->Contains(addr)) {
@@ -643,9 +676,9 @@
   space.AddProperty("name", "old");
   space.AddProperty("vmName", "PageSpace");
   space.AddProperty("collections", collections());
-  space.AddProperty("used", UsedInWords() * kWordSize);
-  space.AddProperty("capacity", CapacityInWords() * kWordSize);
-  space.AddProperty("external", ExternalInWords() * kWordSize);
+  space.AddProperty64("used", UsedInWords() * kWordSize);
+  space.AddProperty64("capacity", CapacityInWords() * kWordSize);
+  space.AddProperty64("external", ExternalInWords() * kWordSize);
   space.AddProperty("time", MicrosecondsToSeconds(gc_time_micros()));
   if (collections() > 0) {
     int64_t run_time = OS::GetCurrentTimeMicros() - isolate->start_time();
@@ -767,11 +800,17 @@
     }
     set_tasks(1);
   }
+  // Ensure that all threads for this isolate are at a safepoint (either stopped
+  // or in native code). If two threads are racing at this point, the loser
+  // will continue with its collection after waiting for the winner to complete.
+  // TODO(koda): Consider moving SafepointThreads into allocation failure/retry
+  // logic to avoid needless collections.
+  isolate->thread_registry()->SafepointThreads();
 
   // Perform various cleanup that relies on no tasks interfering.
   isolate->class_table()->FreeOldTables();
 
-  NoHandleScope no_handles(isolate);
+  NoSafepointScope no_safepoints;
 
   if (FLAG_print_free_list_before_gc) {
     OS::Print("Data Freelist (before GC):\n");
@@ -907,6 +946,13 @@
     freelist_[HeapPage::kExecutable].Print();
   }
 
+  UpdateMaxUsed();
+  if (heap_ != NULL) {
+    heap_->UpdateGlobalMaxUsed();
+  }
+
+  isolate->thread_registry()->ResumeAllThreads();
+
   // Done, reset the task count.
   {
     MonitorLocker ml(tasks_lock());
@@ -1013,6 +1059,35 @@
 }
 
 
+void PageSpace::SetupInstructionsSnapshotPage(void* pointer, uword size) {
+  // Setup a HeapPage so precompiled Instructions can be traversed.
+  // Instructions are contiguous at [pointer, pointer + size). HeapPage
+  // expects to find objects at [memory->start() + ObjectStartOffset,
+  // memory->end()).
+  uword offset = HeapPage::ObjectStartOffset();
+  pointer = reinterpret_cast<void*>(reinterpret_cast<uword>(pointer) - offset);
+  size += offset;
+
+  ASSERT(Utils::IsAligned(pointer, OS::PreferredCodeAlignment()));
+
+  VirtualMemory* memory = VirtualMemory::ForInstructionsSnapshot(pointer, size);
+  ASSERT(memory != NULL);
+  HeapPage* page = reinterpret_cast<HeapPage*>(malloc(sizeof(HeapPage)));
+  page->memory_ = memory;
+  page->next_ = NULL;
+  page->object_end_ = memory->end();
+  page->executable_ = true;
+
+  MutexLocker ml(pages_lock_);
+  if (exec_pages_ == NULL) {
+    exec_pages_ = page;
+  } else {
+    exec_pages_tail_->set_next(page);
+  }
+  exec_pages_tail_ = page;
+}
+
+
 PageSpaceController::PageSpaceController(Heap* heap,
                                          int heap_growth_ratio,
                                          int heap_growth_max,
diff --git a/runtime/vm/pages.h b/runtime/vm/pages.h
index ca10ee0..39ef84e 100644
--- a/runtime/vm/pages.h
+++ b/runtime/vm/pages.h
@@ -42,7 +42,7 @@
   }
 
   uword object_start() const {
-    return (reinterpret_cast<uword>(this) + ObjectStartOffset());
+    return memory_->start() + ObjectStartOffset();
   }
   uword object_end() const {
     return object_end_;
@@ -218,8 +218,8 @@
            NeedsExternalGC();
   }
 
-  intptr_t UsedInWords() const { return usage_.used_in_words; }
-  intptr_t CapacityInWords() const {
+  int64_t UsedInWords() const { return usage_.used_in_words; }
+  int64_t CapacityInWords() const {
     MutexLocker ml(pages_lock_);
     return usage_.capacity_in_words;
   }
@@ -230,8 +230,13 @@
   void IncreaseCapacityInWordsLocked(intptr_t increase_in_words) {
     DEBUG_ASSERT(pages_lock_->IsOwnedByCurrentThread());
     usage_.capacity_in_words += increase_in_words;
+    UpdateMaxCapacityLocked();
   }
-  intptr_t ExternalInWords() const {
+
+  void UpdateMaxCapacityLocked();
+  void UpdateMaxUsed();
+
+  int64_t ExternalInWords() const {
     return usage_.external_in_words;
   }
   SpaceUsage GetCurrentUsage() const {
@@ -277,7 +282,8 @@
         (ExternalInWords() > max_external_in_words_);
   }
 
-  // TODO(koda): Unify protection handling.
+  // Note: Code pages are made executable/non-executable when 'read_only' is
+  // true/false, respectively.
   void WriteProtect(bool read_only);
   void WriteProtectCode(bool read_only);
 
@@ -340,6 +346,8 @@
   static intptr_t top_offset() { return OFFSET_OF(PageSpace, bump_top_); }
   static intptr_t end_offset() { return OFFSET_OF(PageSpace, bump_end_); }
 
+  void SetupInstructionsSnapshotPage(void* pointer, uword size);
+
  private:
   // Ids for time and data records in Heap::GCStats.
   enum {
@@ -427,7 +435,7 @@
   Monitor* tasks_lock_;
   intptr_t tasks_;
 #if defined(DEBUG)
-  bool is_iterating_;
+  Thread* iterating_thread_;
 #endif
   PageSpaceController page_space_controller_;
 
diff --git a/runtime/vm/parser.cc b/runtime/vm/parser.cc
index fed3ae5..ec199ea 100644
--- a/runtime/vm/parser.cc
+++ b/runtime/vm/parser.cc
@@ -16,6 +16,7 @@
 #include "vm/flags.h"
 #include "vm/growable_array.h"
 #include "vm/handles.h"
+#include "vm/hash_table.h"
 #include "vm/heap.h"
 #include "vm/isolate.h"
 #include "vm/longjump.h"
@@ -43,8 +44,9 @@
 DEFINE_FLAG(bool, load_deferred_eagerly, false,
     "Load deferred libraries eagerly.");
 DEFINE_FLAG(bool, trace_parser, false, "Trace parser operations.");
-DEFINE_FLAG(bool, supermixin, false, "Allow super calls in mixins.");
 DEFINE_FLAG(bool, warn_mixin_typedef, true, "Warning on legacy mixin typedef.");
+DEFINE_FLAG(bool, link_natives_lazily, false, "Link native calls lazily");
+DEFINE_FLAG(bool, move_super, false, "Move super initializer to end of list");
 
 DECLARE_FLAG(bool, lazy_dispatchers);
 DECLARE_FLAG(bool, load_deferred_eagerly);
@@ -52,7 +54,8 @@
 DECLARE_FLAG(bool, throw_on_javascript_int_overflow);
 DECLARE_FLAG(bool, warn_on_javascript_compatibility);
 
-// Quick access to the current isolate and zone.
+// Quick access to the current thread, isolate and zone.
+#define T (thread())
 #define I (isolate())
 #define Z (zone())
 
@@ -115,13 +118,12 @@
 };
 
 
-static RawTypeArguments* NewTypeArguments(const GrowableObjectArray& objs) {
+static RawTypeArguments* NewTypeArguments(
+    const GrowableArray<AbstractType*>& objs) {
   const TypeArguments& a =
-      TypeArguments::Handle(TypeArguments::New(objs.Length()));
-  AbstractType& type = AbstractType::Handle();
-  for (int i = 0; i < objs.Length(); i++) {
-    type ^= objs.At(i);
-    a.SetTypeAt(i, type);
+      TypeArguments::Handle(TypeArguments::New(objs.length()));
+  for (int i = 0; i < objs.length(); i++) {
+    a.SetTypeAt(i, *objs.At(i));
   }
   // Cannot canonicalize TypeArgument yet as its types may not have been
   // finalized yet.
@@ -445,10 +447,10 @@
 
 void Parser::ParseCompilationUnit(const Library& library,
                                   const Script& script) {
-  Isolate* isolate = Isolate::Current();
-  ASSERT(isolate->long_jump_base()->IsSafeToJump());
-  CSTAT_TIMER_SCOPE(isolate, parser_timer);
-  VMTagScope tagScope(isolate, VMTag::kCompileTopLevelTagId);
+  Thread* thread = Thread::Current();
+  ASSERT(thread->long_jump_base()->IsSafeToJump());
+  CSTAT_TIMER_SCOPE(thread, parser_timer);
+  VMTagScope tagScope(thread, VMTag::kCompileTopLevelTagId);
   Parser parser(script, library, 0);
   parser.ParseTopLevel();
 }
@@ -464,8 +466,6 @@
 
 
 Token::Kind Parser::LookaheadToken(int num_tokens) {
-  INC_STAT(I, num_tokens_lookahead, 1);
-  INC_STAT(I, num_token_checks, 1);
   return tokens_iterator_.LookaheadTokenKind(num_tokens);
 }
 
@@ -514,7 +514,7 @@
   const AbstractType* type;
   intptr_t name_pos;
   const String* name;
-  const Object* default_value;  // NULL if not an optional parameter.
+  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.
   bool is_final;
@@ -683,30 +683,32 @@
 
 class ClassDesc : public ValueObject {
  public:
-  ClassDesc(const Class& cls,
+  ClassDesc(Zone* zone,
+            const Class& cls,
             const String& cls_name,
             bool is_interface,
             intptr_t token_pos)
-      : clazz_(cls),
+      : zone_(zone),
+        clazz_(cls),
         class_name_(cls_name),
         token_pos_(token_pos),
-        functions_(GrowableObjectArray::Handle(GrowableObjectArray::New())),
-        fields_(GrowableObjectArray::Handle(GrowableObjectArray::New())) {
+        functions_(zone, 4),
+        fields_(zone, 4) {
   }
 
   void AddFunction(const Function& function) {
-    functions_.Add(function);
+    functions_.Add(&Function::ZoneHandle(zone_, function.raw()));
   }
 
-  const GrowableObjectArray& functions() const {
+  const GrowableArray<const Function*>& functions() const {
     return functions_;
   }
 
   void AddField(const Field& field) {
-    fields_.Add(field);
+    fields_.Add(&Field::ZoneHandle(zone_, field.raw()));
   }
 
-  const GrowableObjectArray& fields() const {
+  const GrowableArray<const Field*>& fields() const {
     return fields_;
   }
 
@@ -719,10 +721,9 @@
   }
 
   bool has_constructor() const {
-    Function& func = Function::Handle();
-    for (int i = 0; i < functions_.Length(); i++) {
-      func ^= functions_.At(i);
-      if (func.kind() == RawFunction::kConstructor) {
+    for (int i = 0; i < functions_.length(); i++) {
+      const Function* func = functions_.At(i);
+      if (func->kind() == RawFunction::kConstructor) {
         return true;
       }
     }
@@ -750,44 +751,77 @@
     return NULL;
   }
 
+  RawArray* MakeFunctionsArray() {
+    const intptr_t len = functions_.length();
+    const Array& res = Array::Handle(zone_, Array::New(len, Heap::kOld));
+    for (intptr_t i = 0; i < len; i++) {
+      res.SetAt(i, *functions_[i]);
+    }
+    return res.raw();
+  }
+
  private:
+  Zone* zone_;
   const Class& clazz_;
   const String& class_name_;
   intptr_t token_pos_;   // Token index of "class" keyword.
-  GrowableObjectArray& functions_;
-  GrowableObjectArray& fields_;
+  GrowableArray<const Function*> functions_;
+  GrowableArray<const Field*> fields_;
   GrowableArray<MemberDesc> members_;
 };
 
 
-struct TopLevel {
-  TopLevel() :
-      fields(GrowableObjectArray::Handle(GrowableObjectArray::New())),
-      functions(GrowableObjectArray::Handle(GrowableObjectArray::New())) { }
+class TopLevel : public ValueObject {
+ public:
+  explicit TopLevel(Zone* zone) :
+      zone_(zone),
+      fields_(zone, 4),
+      functions_(zone, 4) { }
 
-  GrowableObjectArray& fields;
-  GrowableObjectArray& functions;
+  void AddField(const Field& field) {
+    fields_.Add(&Field::ZoneHandle(zone_, field.raw()));
+  }
+
+  void AddFunction(const Function& function) {
+    functions_.Add(&Function::ZoneHandle(zone_, function.raw()));
+  }
+
+  const GrowableArray<const Field*>& fields() const {
+    return fields_;
+  }
+
+  const GrowableArray<const Function*>& functions() const {
+    return functions_;
+  }
+
+ private:
+  Zone* zone_;
+  GrowableArray<const Field*> fields_;
+  GrowableArray<const Function*> functions_;
 };
 
 
 void Parser::ParseClass(const Class& cls) {
+  Thread* thread = Thread::Current();
+  Zone* zone = thread->zone();
+  const int64_t num_tokes_before = STAT_VALUE(thread, num_tokens_consumed);
   if (!cls.is_synthesized_class()) {
-    Isolate* isolate = Isolate::Current();
-    CSTAT_TIMER_SCOPE(isolate, parser_timer);
-    ASSERT(isolate->long_jump_base()->IsSafeToJump());
-    const Script& script = Script::Handle(isolate, cls.script());
-    const Library& lib = Library::Handle(isolate, cls.library());
+    ASSERT(thread->long_jump_base()->IsSafeToJump());
+    CSTAT_TIMER_SCOPE(thread, parser_timer);
+    const Script& script = Script::Handle(zone, cls.script());
+    const Library& lib = Library::Handle(zone, cls.library());
     Parser parser(script, lib, cls.token_pos());
     parser.ParseClassDefinition(cls);
   } else if (cls.is_enum_class()) {
-    Isolate* isolate = Isolate::Current();
-    CSTAT_TIMER_SCOPE(isolate, parser_timer);
-    ASSERT(isolate->long_jump_base()->IsSafeToJump());
-    const Script& script = Script::Handle(isolate, cls.script());
-    const Library& lib = Library::Handle(isolate, cls.library());
+    ASSERT(thread->long_jump_base()->IsSafeToJump());
+    CSTAT_TIMER_SCOPE(thread, parser_timer);
+    const Script& script = Script::Handle(zone, cls.script());
+    const Library& lib = Library::Handle(zone, cls.library());
     Parser parser(script, lib, cls.token_pos());
     parser.ParseEnumDefinition(cls);
   }
+  const int64_t num_tokes_after = STAT_VALUE(thread, num_tokens_consumed);
+  INC_STAT(thread, num_class_tokens, num_tokes_after - num_tokes_before);
 }
 
 
@@ -795,7 +829,7 @@
   ASSERT(!func.IsNull());
   Thread* thread = Thread::Current();
   Isolate* isolate = thread->isolate();
-  StackZone stack_zone(isolate);
+  StackZone stack_zone(thread);
   Zone* zone = stack_zone.GetZone();
   LongJumpScope jump;
   if (setjmp(*jump.Set()) == 0) {
@@ -872,30 +906,30 @@
 
 
 void Parser::ParseFunction(ParsedFunction* parsed_function) {
-  Isolate* isolate = parsed_function->isolate();
-  Zone* zone = parsed_function->zone();
-  CSTAT_TIMER_SCOPE(isolate, parser_timer);
-  INC_STAT(isolate, num_functions_compiled, 1);
-  VMTagScope tagScope(isolate, VMTag::kCompileParseFunctionTagId,
+  Thread* thread = parsed_function->thread();
+  ASSERT(thread == Thread::Current());
+  Zone* zone = thread->zone();
+  CSTAT_TIMER_SCOPE(thread, parser_timer);
+  INC_STAT(thread, num_functions_parsed, 1);
+  VMTagScope tagScope(thread, VMTag::kCompileParseFunctionTagId,
                       FLAG_profile_vm);
 
-  ASSERT(isolate->long_jump_base()->IsSafeToJump());
+  ASSERT(thread->long_jump_base()->IsSafeToJump());
   ASSERT(parsed_function != NULL);
   const Function& func = parsed_function->function();
   const Script& script = Script::Handle(zone, func.script());
   Parser parser(script, parsed_function, func.token_pos());
   SequenceNode* node_sequence = NULL;
-  Array& default_parameter_values = Array::ZoneHandle(zone, Array::null());
   switch (func.kind()) {
     case RawFunction::kClosureFunction:
       if (func.IsImplicitClosureFunction()) {
         node_sequence =
-            parser.ParseImplicitClosure(func, &default_parameter_values);
+            parser.ParseImplicitClosure(func);
         break;
       }
       if (func.IsConstructorClosureFunction()) {
         node_sequence =
-            parser.ParseConstructorClosure(func, &default_parameter_values);
+            parser.ParseConstructorClosure(func);
         break;
       }
       // Fall-through: Handle non-implicit closures.
@@ -908,7 +942,7 @@
       if (!func.IsImplicitConstructor()) {
         parser.SkipFunctionPreamble();
       }
-      node_sequence = parser.ParseFunc(func, &default_parameter_values);
+      node_sequence = parser.ParseFunc(func);
       break;
     case RawFunction::kImplicitGetter:
       ASSERT(!func.is_static());
@@ -920,18 +954,19 @@
       break;
     case RawFunction::kImplicitStaticFinalGetter:
       node_sequence = parser.ParseStaticFinalGetter(func);
-      INC_STAT(isolate, num_implicit_final_getters, 1);
+      INC_STAT(thread, num_implicit_final_getters, 1);
       break;
     case RawFunction::kMethodExtractor:
       node_sequence = parser.ParseMethodExtractor(func);
+      INC_STAT(thread, num_method_extractors, 1);
       break;
     case RawFunction::kNoSuchMethodDispatcher:
       node_sequence =
-          parser.ParseNoSuchMethodDispatcher(func, &default_parameter_values);
+          parser.ParseNoSuchMethodDispatcher(func);
       break;
     case RawFunction::kInvokeFieldDispatcher:
       node_sequence =
-          parser.ParseInvokeFieldDispatcher(func, &default_parameter_values);
+          parser.ParseInvokeFieldDispatcher(func);
       break;
     case RawFunction::kIrregexpFunction:
       UNREACHABLE();  // Irregexp functions have their own parser.
@@ -968,15 +1003,13 @@
       parsed_function->set_instantiator(instantiator);
     }
   }
-
-  parsed_function->set_default_parameter_values(default_parameter_values);
 }
 
 
 RawObject* Parser::ParseMetadata(const Class& cls, intptr_t token_pos) {
   Thread* thread = Thread::Current();
   Isolate* isolate = thread->isolate();
-  StackZone stack_zone(isolate);
+  StackZone stack_zone(thread);
   Zone* zone = stack_zone.GetZone();
   LongJumpScope jump;
   if (setjmp(*jump.Set()) == 0) {
@@ -1017,7 +1050,7 @@
 RawArray* Parser::EvaluateMetadata() {
   CheckToken(Token::kAT, "Metadata character '@' expected");
   GrowableObjectArray& meta_values =
-      GrowableObjectArray::Handle(Z, GrowableObjectArray::New());
+      GrowableObjectArray::Handle(Z, GrowableObjectArray::New(Heap::kOld));
   while (CurrentToken() == Token::kAT) {
     ConsumeToken();
     intptr_t expr_pos = TokenPos();
@@ -1086,7 +1119,7 @@
       ReportError(expr_pos, "expression must be a compile-time constant");
     }
     const Instance& val = EvaluateConstExpr(expr_pos, expr);
-    meta_values.Add(val);
+    meta_values.Add(val, Heap::kOld);
   }
   return Array::MakeArray(meta_values);
 }
@@ -1116,18 +1149,23 @@
 
   const String& field_name = String::Handle(zone, field.name());
   String& init_name = String::Handle(zone,
-      String::Concat(Symbols::InitPrefix(), field_name));
-  init_name = Symbols::New(init_name);
+      Symbols::FromConcat(Symbols::InitPrefix(), field_name));
+
+  Object& initializer_owner = Object::Handle(field.owner());
+  if (field.owner() != field.origin()) {
+    initializer_owner =
+        PatchClass::New(Class::Handle(field.owner()), script_cls);
+  }
 
   const Function& initializer = Function::ZoneHandle(zone,
       Function::New(init_name,
-                    RawFunction::kRegularFunction,
+                    RawFunction::kImplicitStaticFinalGetter,
                     true,   // static
                     false,  // !const
                     false,  // !abstract
                     false,  // !external
                     false,  // !native
-                    Class::Handle(field.owner()),
+                    initializer_owner,
                     field.token_pos()));
   initializer.set_result_type(AbstractType::Handle(zone, field.type()));
   // Static initializer functions are hidden from the user.
@@ -1144,7 +1182,6 @@
 
   SequenceNode* body = parser.ParseStaticInitializer();
   parsed_function->SetNodeSequence(body);
-  parsed_function->set_default_parameter_values(Object::null_array());
 
   if (parsed_function->has_expression_temp_var()) {
     body->scope()->AddVariable(parsed_function->expression_temp_var());
@@ -1160,44 +1197,6 @@
 }
 
 
-RawObject* Parser::ParseFunctionFromSource(const Class& owning_class,
-                                           const String& source) {
-  Thread* thread = Thread::Current();
-  Isolate* isolate = thread->isolate();
-  StackZone stack_zone(isolate);
-  LongJumpScope jump;
-  if (setjmp(*jump.Set()) == 0) {
-    const String& uri = String::Handle(Symbols::New("dynamically-added"));
-    const Script& script = Script::Handle(
-        Script::New(uri, source, RawScript::kSourceTag));
-    const Library& owning_library = Library::Handle(owning_class.library());
-    const String& private_key = String::Handle(owning_library.private_key());
-    script.Tokenize(private_key);
-    const intptr_t token_pos = 0;
-    Parser parser(script, owning_library, token_pos);
-    parser.is_top_level_ = true;
-    parser.set_current_class(owning_class);
-    const String& class_name = String::Handle(owning_class.Name());
-    ClassDesc members(owning_class, class_name, false, token_pos);
-    const intptr_t metadata_pos = parser.SkipMetadata();
-    parser.ParseClassMemberDefinition(&members, metadata_pos);
-    ASSERT(members.functions().Length() == 1);
-    const Function& func =
-        Function::ZoneHandle(Function::RawCast(members.functions().At(0)));
-    func.set_eval_script(script);
-    ParsedFunction* parsed_function = new ParsedFunction(thread, func);
-    Parser::ParseFunction(parsed_function);
-    return func.raw();
-  } else {
-    const Error& error = Error::Handle(isolate->object_store()->sticky_error());
-    isolate->object_store()->clear_sticky_error();
-    return error.raw();
-  }
-  UNREACHABLE();
-  return Object::null();
-}
-
-
 SequenceNode* Parser::ParseStaticFinalGetter(const Function& func) {
   TRACE_PARSER("ParseStaticFinalGetter");
   ParamList params;
@@ -1214,6 +1213,7 @@
   const Class& field_class = Class::Handle(Z, func.Owner());
   const Field& field =
       Field::ZoneHandle(Z, field_class.LookupStaticField(field_name));
+  ASSERT(!field.IsNull());
 
   // Static final fields must have an initializer.
   ExpectToken(Token::kASSIGN);
@@ -1330,8 +1330,7 @@
 }
 
 
-SequenceNode* Parser::ParseConstructorClosure(const Function& func,
-                                              Array* default_values) {
+SequenceNode* Parser::ParseConstructorClosure(const Function& func) {
   TRACE_PARSER("ParseConstructorClosure");
   const intptr_t token_pos = func.token_pos();
 
@@ -1353,7 +1352,7 @@
   // Replace the types parsed from the constructor.
   params.EraseParameterTypes();
 
-  SetupDefaultsForOptionalParams(&params, default_values);
+  SetupDefaultsForOptionalParams(params);
   ASSERT(func.num_fixed_parameters() == params.num_fixed_parameters);
   ASSERT(func.NumOptionalParameters() == params.num_optional_parameters);
 
@@ -1385,8 +1384,7 @@
 }
 
 
-SequenceNode* Parser::ParseImplicitClosure(const Function& func,
-                                           Array* default_values) {
+SequenceNode* Parser::ParseImplicitClosure(const Function& func) {
   TRACE_PARSER("ParseImplicitClosure");
   intptr_t token_pos = func.token_pos();
 
@@ -1415,7 +1413,7 @@
     const bool allow_explicit_default_values = true;
     SkipFunctionPreamble();
     ParseFormalParameterList(allow_explicit_default_values, false, &params);
-    SetupDefaultsForOptionalParams(&params, default_values);
+    SetupDefaultsForOptionalParams(params);
   }
 
   // Populate function scope with the formal parameters.
@@ -1481,8 +1479,7 @@
 
 
 void Parser::BuildDispatcherScope(const Function& func,
-                                  const ArgumentsDescriptor& desc,
-                                  Array* default_values) {
+                                  const ArgumentsDescriptor& desc) {
   ParamList params;
   // Receiver first.
   intptr_t token_pos = func.token_pos();
@@ -1506,25 +1503,24 @@
     intptr_t index = i - desc.PositionalCount();
     p.name = &String::ZoneHandle(Z, desc.NameAt(index));
     p.type = &Type::ZoneHandle(Z, Type::DynamicType());
-    p.default_value = &Object::null_object();
+    p.default_value = &Object::null_instance();
     params.parameters->Add(p);
     params.num_optional_parameters++;
     params.has_optional_named_parameters = true;
   }
   ASSERT(desc.NamedCount() == params.num_optional_parameters);
 
-  SetupDefaultsForOptionalParams(&params, default_values);
+  SetupDefaultsForOptionalParams(params);
 
   // Build local scope for function and populate with the formal parameters.
   OpenFunctionBlock(func);
   AddFormalParamsToScope(&params, current_block_->scope);
 }
 
-SequenceNode* Parser::ParseNoSuchMethodDispatcher(const Function& func,
-                                                  Array* default_values) {
+
+SequenceNode* Parser::ParseNoSuchMethodDispatcher(const Function& func) {
   TRACE_PARSER("ParseNoSuchMethodDispatcher");
   ASSERT(FLAG_lazy_dispatchers);
-
   ASSERT(func.IsNoSuchMethodDispatcher());
   intptr_t token_pos = func.token_pos();
   ASSERT(func.token_pos() == 0);
@@ -1534,7 +1530,7 @@
   ASSERT(desc.Count() > 0);
 
   // Set up scope for this function.
-  BuildDispatcherScope(func, desc, default_values);
+  BuildDispatcherScope(func, desc);
 
   // Receiver is local 0.
   LocalScope* scope = current_block_->scope;
@@ -1545,7 +1541,7 @@
 
   if (desc.NamedCount() > 0) {
     const Array& arg_names =
-        Array::ZoneHandle(Z, Array::New(desc.NamedCount()));
+        Array::ZoneHandle(Z, Array::New(desc.NamedCount(), Heap::kOld));
     for (intptr_t i = 0; i < arg_names.Length(); ++i) {
       arg_names.SetAt(i, String::Handle(Z, desc.NameAt(i)));
     }
@@ -1578,11 +1574,8 @@
 }
 
 
-SequenceNode* Parser::ParseInvokeFieldDispatcher(const Function& func,
-                                                 Array* default_values) {
+SequenceNode* Parser::ParseInvokeFieldDispatcher(const Function& func) {
   TRACE_PARSER("ParseInvokeFieldDispatcher");
-  ASSERT(FLAG_lazy_dispatchers);
-
   ASSERT(func.IsInvokeFieldDispatcher());
   intptr_t token_pos = func.token_pos();
   ASSERT(func.token_pos() == 0);
@@ -1593,7 +1586,7 @@
   ASSERT(desc.Count() > 0);
 
   // Set up scope for this function.
-  BuildDispatcherScope(func, desc, default_values);
+  BuildDispatcherScope(func, desc);
 
   // Receiver is local 0.
   LocalScope* scope = current_block_->scope;
@@ -1611,7 +1604,7 @@
     function_object = receiver;
   } else {
     const String& getter_name = String::ZoneHandle(Z,
-        Symbols::New(String::Handle(Z, Field::GetterName(name))));
+        Symbols::New(String::Handle(Z, Field::GetterSymbol(name))));
     function_object = new(Z) InstanceCallNode(
         token_pos, receiver, getter_name, no_args);
   }
@@ -1888,12 +1881,14 @@
         signature_function.set_signature_class(signature_class);
       }
       ASSERT(signature_function.signature_class() == signature_class.raw());
-      Type& signature_type =
-          Type::ZoneHandle(Z, signature_class.SignatureType());
-      if (!is_top_level_ && !signature_type.IsFinalized()) {
-        signature_type ^= ClassFinalizer::FinalizeType(
-            signature_class, signature_type, ClassFinalizer::kCanonicalize);
+      if (!is_top_level_) {
+        // Finalize types in signature class here, so that the
+        // signature type is not computed twice.
+        ClassFinalizer::FinalizeTypesInClass(signature_class);
       }
+      const Type& signature_type =
+          Type::ZoneHandle(Z, signature_class.SignatureType());
+      ASSERT(is_top_level_ || signature_type.IsFinalized());
       // A signature type itself cannot be malformed or malbounded, only its
       // signature function's result type or parameter types may be.
       ASSERT(!signature_type.IsMalformed());
@@ -1920,7 +1915,7 @@
       // Skip default value parsing.
       SkipExpr();
     } else {
-      const Object& const_value = ParseConstExpr()->literal();
+      const Instance& const_value = ParseConstExpr()->literal();
       parameter.default_value = &const_value;
     }
   } else {
@@ -1928,7 +1923,7 @@
         params->has_optional_named_parameters) {
       // Implicit default value is null.
       params->num_optional_parameters++;
-      parameter.default_value = &Object::null_object();
+      parameter.default_value = &Object::null_instance();
     } else {
       params->num_fixed_parameters++;
       ASSERT(params->num_optional_parameters == 0);
@@ -2299,14 +2294,18 @@
   AstNode* implicit_argument = LoadReceiver(field_pos);
 
   const String& getter_name =
-      String::ZoneHandle(Z, Field::GetterName(field_name));
-  const Function& super_getter = Function::ZoneHandle(Z,
-      Resolver::ResolveDynamicAnyArgs(super_class, getter_name));
+      String::ZoneHandle(Z, Field::LookupGetterSymbol(field_name));
+  Function& super_getter = Function::ZoneHandle(Z);
+  if (!getter_name.IsNull()) {
+    super_getter = Resolver::ResolveDynamicAnyArgs(super_class, getter_name);
+  }
   if (super_getter.IsNull()) {
     const String& setter_name =
-        String::ZoneHandle(Z, Field::SetterName(field_name));
-    const Function& super_setter = Function::ZoneHandle(Z,
-        Resolver::ResolveDynamicAnyArgs(super_class, setter_name));
+        String::ZoneHandle(Z, Field::LookupSetterSymbol(field_name));
+    Function& super_setter = Function::ZoneHandle(Z);
+    if (!setter_name.IsNull()) {
+      super_setter = Resolver::ResolveDynamicAnyArgs(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
@@ -2330,11 +2329,12 @@
 }
 
 
-void Parser::GenerateSuperConstructorCall(const Class& cls,
-                                          intptr_t supercall_pos,
-                                          LocalVariable* receiver,
-                                          AstNode* phase_parameter,
-                                          ArgumentListNode* forwarding_args) {
+StaticCallNode* Parser::GenerateSuperConstructorCall(
+      const Class& cls,
+      intptr_t supercall_pos,
+      LocalVariable* receiver,
+      AstNode* phase_parameter,
+      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
@@ -2342,10 +2342,10 @@
   if (super_class.IsNull() ||
       (super_class.num_native_fields() > 0 &&
        Class::Handle(Z, super_class.SuperClass()).IsObjectClass())) {
-    return;
+    return NULL;
   }
   String& super_ctor_name = String::Handle(Z, super_class.Name());
-  super_ctor_name = String::Concat(super_ctor_name, Symbols::Dot());
+  super_ctor_name = Symbols::FromConcat(super_ctor_name, Symbols::Dot());
 
   ArgumentListNode* arguments = new ArgumentListNode(supercall_pos);
   // Implicit 'this' parameter is the first argument.
@@ -2366,8 +2366,9 @@
     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.
-      ctor_name = String::SubString(ctor_name, class_name.Length() + 1);
-      super_ctor_name = String::Concat(super_ctor_name, ctor_name);
+      const intptr_t kLen =  class_name.Length() + 1;
+      ctor_name = Symbols::New(ctor_name, kLen, ctor_name.Length() - kLen);
+      super_ctor_name = Symbols::FromConcat(super_ctor_name, ctor_name);
     }
   }
 
@@ -2392,13 +2393,12 @@
                 String::Handle(Z, super_class.Name()).ToCString(),
                 error_message.ToCString());
   }
-  current_block_->statements->Add(
-      new StaticCallNode(supercall_pos, super_ctor, arguments));
+  return new StaticCallNode(supercall_pos, super_ctor, arguments);
 }
 
 
-AstNode* Parser::ParseSuperInitializer(const Class& cls,
-                                       LocalVariable* receiver) {
+StaticCallNode* Parser::ParseSuperInitializer(const Class& cls,
+                                              LocalVariable* receiver) {
   TRACE_PARSER("ParseSuperInitializer");
   ASSERT(CurrentToken() == Token::kSUPER);
   const intptr_t supercall_pos = TokenPos();
@@ -2406,11 +2406,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 = String::Concat(ctor_name, Symbols::Dot());
+  ctor_name = Symbols::FromConcat(ctor_name, Symbols::Dot());
   if (CurrentToken() == Token::kPERIOD) {
     ConsumeToken();
-    ctor_name = String::Concat(ctor_name,
-                               *ExpectIdentifier("constructor name expected"));
+    ctor_name = Symbols::FromConcat(
+        ctor_name, *ExpectIdentifier("constructor name expected"));
   }
   CheckToken(Token::kLPAREN, "parameter list expected");
 
@@ -2552,9 +2552,12 @@
   } else {
     init_expr = ParseExpr(kAllowConst, kConsumeCascades);
     if (init_expr->EvalConstExpr() != NULL) {
-      init_expr =
-          new LiteralNode(field.token_pos(),
-                          EvaluateConstExpr(expr_pos, init_expr));
+      Instance& expr_value = Instance::ZoneHandle(Z);
+      if (!GetCachedConstant(expr_pos, &expr_value)) {
+        expr_value = EvaluateConstExpr(expr_pos, init_expr).raw();
+        CacheConstantValue(expr_pos, expr_value);
+      }
+      init_expr = new(Z) LiteralNode(field.token_pos(), expr_value);
     }
   }
   set_current_class(saved_class);
@@ -2598,8 +2601,12 @@
           intptr_t expr_pos = TokenPos();
           init_expr = ParseExpr(kAllowConst, kConsumeCascades);
           if (init_expr->EvalConstExpr() != NULL) {
-            init_expr = new LiteralNode(field.token_pos(),
-                                        EvaluateConstExpr(expr_pos, init_expr));
+            Instance& expr_value = Instance::ZoneHandle(Z);
+            if (!GetCachedConstant(expr_pos, &expr_value)) {
+              expr_value = EvaluateConstExpr(expr_pos, init_expr).raw();
+              CacheConstantValue(expr_pos, expr_value);
+            }
+            init_expr = new(Z) LiteralNode(field.token_pos(), expr_value);
           }
         }
       }
@@ -2722,30 +2729,67 @@
                                LocalVariable* receiver,
                                GrowableArray<Field*>* initialized_fields) {
   TRACE_PARSER("ParseInitializers");
-  bool super_init_seen = false;
+  bool super_init_is_last = false;
+  intptr_t super_init_index = -1;
+  StaticCallNode* super_init_call = NULL;
   if (CurrentToken() == Token::kCOLON) {
     do {
       ConsumeToken();  // Colon or comma.
-      AstNode* init_statement;
       if (CurrentToken() == Token::kSUPER) {
-        if (super_init_seen) {
+        if (super_init_call != NULL) {
           ReportError("duplicate call to super constructor");
         }
-        init_statement = ParseSuperInitializer(cls, receiver);
-        super_init_seen = true;
+        super_init_call = ParseSuperInitializer(cls, receiver);
+        super_init_index = current_block_->statements->length();
+        current_block_->statements->Add(super_init_call);
+        super_init_is_last = true;
       } else {
-        init_statement = ParseInitializer(cls, receiver, initialized_fields);
+        AstNode* init_statement =
+            ParseInitializer(cls, receiver, initialized_fields);
+        super_init_is_last = false;
+        current_block_->statements->Add(init_statement);
       }
-      current_block_->statements->Add(init_statement);
     } while (CurrentToken() == Token::kCOMMA);
   }
-  if (!super_init_seen) {
+  if (super_init_call == NULL) {
     // Generate implicit super() if we haven't seen an explicit super call
     // or constructor redirection.
     AstNode* phase_parameter = new LiteralNode(
         TokenPos(), Smi::ZoneHandle(Z, Smi::New(Function::kCtorPhaseAll)));
-    GenerateSuperConstructorCall(
+    super_init_call = GenerateSuperConstructorCall(
         cls, TokenPos(), receiver, phase_parameter, NULL);
+    if (super_init_call != NULL) {
+      super_init_index = current_block_->statements->length();
+      current_block_->statements->Add(super_init_call);
+      super_init_is_last = true;
+    }
+  }
+  if (FLAG_move_super && (super_init_call != NULL) && !super_init_is_last) {
+    // If the super initializer call is not at the end of the initializer
+    // list, implicitly move it to the end. The actual parameter values
+    // are evaluated at the original position in the list and preserved
+    // in temporary variables. (The following initializer expressions
+    // could have side effects that alter the arguments to the super
+    // initializer.) E.g:
+    // A(x) : super(x), f = x++ { ... }
+    // is transformed to:
+    // A(x) : temp = x, f = x++, super(temp) { ... }
+    ReportWarning("Super initizlizer not at end");
+    ASSERT(super_init_index >= 0);
+    ArgumentListNode* ctor_args = super_init_call->arguments();
+    LetNode* saved_args = new(Z) LetNode(super_init_call->token_pos());
+    // The super initializer call has at least 2 arguments: the
+    // implicit receiver, and the hidden construction phase.
+    ASSERT(ctor_args->length() >= 2);
+    for (int i = 2; 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);
+      saved_args->AddNode(save_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);
   }
   CheckFieldsInitialized(cls);
 }
@@ -2759,13 +2803,14 @@
   const intptr_t call_pos = TokenPos();
   ConsumeToken();
   String& ctor_name = String::Handle(Z, cls.Name());
-
-  ctor_name = String::Concat(ctor_name, Symbols::Dot());
+  GrowableHandlePtrArray<const String> pieces(Z, 3);
+  pieces.Add(ctor_name);
+  pieces.Add(Symbols::Dot());
   if (CurrentToken() == Token::kPERIOD) {
     ConsumeToken();
-    ctor_name = String::Concat(ctor_name,
-                               *ExpectIdentifier("constructor name expected"));
+    pieces.Add(*ExpectIdentifier("constructor name expected"));
   }
+  ctor_name = Symbols::FromConcatAll(pieces);
   CheckToken(Token::kLPAREN, "parameter list expected");
 
   ArgumentListNode* arguments = new ArgumentListNode(call_pos);
@@ -2867,12 +2912,15 @@
     }
   }
 
-  GenerateSuperConstructorCall(
+  AstNode* super_call = GenerateSuperConstructorCall(
       current_class(),
       Scanner::kNoSourcePos,
       receiver,
       new LoadLocalNode(Scanner::kNoSourcePos, phase_parameter),
       forwarding_args);
+  if (super_call != NULL) {
+    current_block_->statements->Add(super_call);
+  }
   CheckFieldsInitialized(current_class());
 
   // Empty constructor body.
@@ -2901,8 +2949,7 @@
 
 // Parser is at the opening parenthesis of the formal parameter declaration
 // of function. Parse the formal parameters, initializers and code.
-SequenceNode* Parser::ParseConstructor(const Function& func,
-                                       Array* default_parameter_values) {
+SequenceNode* Parser::ParseConstructor(const Function& func) {
   TRACE_PARSER("ParseConstructor");
   ASSERT(func.IsGenerativeConstructor());
   ASSERT(!func.IsFactory());
@@ -2944,7 +2991,7 @@
   }
   ParseFormalParameterList(allow_explicit_default_values, false, &params);
 
-  SetupDefaultsForOptionalParams(&params, default_parameter_values);
+  SetupDefaultsForOptionalParams(params);
   ASSERT(AbstractType::Handle(Z, func.result_type()).IsResolved());
   ASSERT(func.NumParameters() == params.parameters->length());
 
@@ -3085,6 +3132,7 @@
     }
   }
   if (super_call != NULL) {
+    ASSERT(!FLAG_move_super);
     // Generate an implicit call to the super constructor's body.
     // We need to patch the super _initializer_ call so that it
     // saves the evaluated actual arguments in temporary variables.
@@ -3113,6 +3161,7 @@
 
   // Insert the implicit super call to the super constructor body.
   if (super_call != NULL) {
+    ASSERT(!FLAG_move_super);
     ArgumentListNode* initializer_args = super_call->arguments();
     const Function& super_ctor = super_call->function();
     // Patch the initializer call so it only executes the super initializer.
@@ -3210,8 +3259,7 @@
 // Parser is at the opening parenthesis of the formal parameter
 // declaration of the function or constructor.
 // Parse the formal parameters and code.
-SequenceNode* Parser::ParseFunc(const Function& func,
-                                Array* default_parameter_values) {
+SequenceNode* Parser::ParseFunc(const Function& func) {
   TRACE_PARSER("ParseFunc");
   Function& saved_innermost_function =
       Function::Handle(Z, innermost_function().raw());
@@ -3226,7 +3274,7 @@
   LocalScope* saved_async_temp_scope = async_temp_scope_;
 
   if (func.IsGenerativeConstructor()) {
-    SequenceNode* statements = ParseConstructor(func, default_parameter_values);
+    SequenceNode* statements = ParseConstructor(func);
     innermost_function_ = saved_innermost_function.raw();
     last_used_try_index_ = saved_try_index;
     return statements;
@@ -3270,7 +3318,7 @@
     AddFormalParamsToScope(&params, current_block_->scope);
   } else if (func.IsAsyncClosure()) {
     AddAsyncClosureParameters(&params);
-    SetupDefaultsForOptionalParams(&params, default_parameter_values);
+    SetupDefaultsForOptionalParams(params);
     AddFormalParamsToScope(&params, current_block_->scope);
     ASSERT(AbstractType::Handle(Z, func.result_type()).IsResolved());
     ASSERT(func.NumParameters() == params.parameters->length());
@@ -3284,7 +3332,7 @@
     }
   } else if (func.IsSyncGenClosure()) {
     AddSyncGenClosureParameters(&params);
-    SetupDefaultsForOptionalParams(&params, default_parameter_values);
+    SetupDefaultsForOptionalParams(params);
     AddFormalParamsToScope(&params, current_block_->scope);
     ASSERT(AbstractType::Handle(Z, func.result_type()).IsResolved());
     if (!Function::Handle(func.parent_function()).IsGetterFunction()) {
@@ -3297,7 +3345,7 @@
     }
   } else if (func.IsAsyncGenClosure()) {
     AddAsyncGenClosureParameters(&params);
-    SetupDefaultsForOptionalParams(&params, default_parameter_values);
+    SetupDefaultsForOptionalParams(params);
     AddFormalParamsToScope(&params, current_block_->scope);
     ASSERT(AbstractType::Handle(Z, func.result_type()).IsResolved());
     ASSERT(func.NumParameters() == params.parameters->length());
@@ -3317,7 +3365,7 @@
     if (func.IsLocalFunction()) {
       AddFormalParamsToFunction(&params, func);
     }
-    SetupDefaultsForOptionalParams(&params, default_parameter_values);
+    SetupDefaultsForOptionalParams(params);
     ASSERT(AbstractType::Handle(Z, func.result_type()).IsResolved());
     ASSERT(func.NumParameters() == params.parameters->length());
 
@@ -3460,7 +3508,7 @@
     body = CloseSyncGenFunction(generated_body_closure, body);
     generated_body_closure.set_end_token_pos(end_token_pos);
   } else if (func.IsSyncGenClosure()) {
-    body->scope()->RecursivelyCaptureAllVariables();
+    // body is unchanged.
   } else if (func.IsAsyncGenerator()) {
     body = CloseAsyncGeneratorFunction(generated_body_closure, body);
     generated_body_closure.set_end_token_pos(end_token_pos);
@@ -3661,7 +3709,7 @@
       ASSERT(method->IsSetter());
       expected_num_parameters = (method->has_static) ? 1 : 2;
       method->dict_name = &String::ZoneHandle(Z,
-          String::Concat(*method->name, Symbols::Equals()));
+          Symbols::FromConcat(*method->name, Symbols::Equals()));
       method->name = &String::ZoneHandle(Z, Field::SetterSymbol(*method->name));
     }
     if ((method->params.num_fixed_parameters != expected_num_parameters) ||
@@ -3738,13 +3786,16 @@
       }
       ConsumeToken();  // Colon.
       ExpectToken(Token::kTHIS);
-      String& redir_name = String::ZoneHandle(Z,
-          String::Concat(members->class_name(), Symbols::Dot()));
+      GrowableHandlePtrArray<const String> pieces(Z, 3);
+      pieces.Add(members->class_name());
+      pieces.Add(Symbols::Dot());
       if (CurrentToken() == Token::kPERIOD) {
         ConsumeToken();
-        redir_name = String::Concat(redir_name,
-            *ExpectIdentifier("constructor name expected"));
+        pieces.Add(*ExpectIdentifier("constructor name expected"));
       }
+      String& redir_name =
+          String::ZoneHandle(Z, Symbols::FromConcatAll(pieces));
+
       method->redirect_name = &redir_name;
       CheckToken(Token::kLPAREN);
       SkipToMatchingParenthesis();
@@ -4019,7 +4070,7 @@
     // For static final fields (this includes static const fields), set value to
     // "uninitialized" and create a kImplicitStaticFinalGetter getter method.
     if (field->has_static && has_initializer) {
-      class_field.set_value(init_value);
+      class_field.SetStaticValue(init_value, true);
       if (!has_simple_literal) {
         String& getter_name =
             String::Handle(Z, Field::GetterSymbol(*field->name));
@@ -4260,16 +4311,16 @@
 
     // We must be dealing with a constructor or named constructor.
     member.kind = RawFunction::kConstructor;
-    *member.name = String::Concat(*member.name, Symbols::Dot());
+    GrowableHandlePtrArray<const String> to_concat(Z, 3);
+    to_concat.Add(*member.name);
+    to_concat.Add(Symbols::Dot());
     if (CurrentToken() == Token::kPERIOD) {
       // Named constructor.
       ConsumeToken();
       member.dict_name = ExpectIdentifier("identifier expected");
-      *member.name = String::Concat(*member.name, *member.dict_name);
+      to_concat.Add(*member.dict_name);
     }
-    // Ensure that names are symbols.
-    *member.name = Symbols::New(*member.name);
-
+    *member.name = Symbols::FromConcatAll(to_concat);
     CheckToken(Token::kLPAREN);
   } else if ((CurrentToken() == Token::kGET) && !member.has_var &&
              (LookaheadToken(1) != Token::kLPAREN) &&
@@ -4601,7 +4652,7 @@
 
 void Parser::ParseClassDefinition(const Class& cls) {
   TRACE_PARSER("ParseClassDefinition");
-  INC_STAT(I, num_classes_compiled, 1);
+  INC_STAT(thread(), num_classes_parsed, 1);
   set_current_class(cls);
   is_top_level_ = true;
   String& class_name = String::Handle(Z, cls.Name());
@@ -4615,7 +4666,7 @@
   }
   ExpectToken(Token::kCLASS);
   const intptr_t class_pos = TokenPos();
-  ClassDesc members(cls, class_name, false, class_pos);
+  ClassDesc members(Z, cls, class_name, false, class_pos);
   while (CurrentToken() != Token::kLBRACE) {
     ConsumeToken();
   }
@@ -4636,7 +4687,7 @@
   cls.AddFields(members.fields());
 
   // Creating a new array for functions marks the class as parsed.
-  const Array& array = Array::Handle(Z, Array::MakeArray(members.functions()));
+  Array& array = Array::Handle(Z, members.MakeFunctionsArray());
   cls.SetFunctions(array);
 
   // Add an implicit constructor if no explicit constructor is present.
@@ -4661,13 +4712,13 @@
 
 void Parser::ParseEnumDefinition(const Class& cls) {
   TRACE_PARSER("ParseEnumDefinition");
-  INC_STAT(I, num_classes_compiled, 1);
+  INC_STAT(thread(), num_classes_parsed, 1);
 
   SkipMetadata();
   ExpectToken(Token::kENUM);
 
   const String& enum_name = String::Handle(Z, cls.Name());
-  ClassDesc enum_members(cls, enum_name, false, cls.token_pos());
+  ClassDesc enum_members(Z, cls, enum_name, false, cls.token_pos());
 
   // Add instance field 'final int index'.
   Field& index_field = Field::ZoneHandle(Z);
@@ -4758,7 +4809,7 @@
     // Initialize the field with the ordinal value. It will be patched
     // later with the enum constant instance.
     const Smi& ordinal_value = Smi::Handle(Z, Smi::New(i));
-    enum_value.set_value(ordinal_value);
+    enum_value.SetStaticValue(ordinal_value, true);
     enum_value.RecordStore(ordinal_value);
     i++;
 
@@ -4796,7 +4847,7 @@
   // 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));
-  values_field.set_value(values_array);
+  values_field.SetStaticValue(values_array, true);
   values_field.RecordStore(values_array);
 
   // Create a static field that contains the list of enumeration names.
@@ -4807,7 +4858,7 @@
   names_field = names_field.Clone(cls);
   enum_members.AddField(names_field);
   const Array& names_array = Array::Handle(Array::MakeArray(enum_names));
-  names_field.set_value(names_array);
+  names_field.SetStaticValue(names_array, true);
   names_field.RecordStore(names_array);
 
   // Clone the toString() function from the helper class.
@@ -4818,15 +4869,14 @@
   enum_members.AddFunction(to_string_func);
 
   // Clone the hashCode getter function from the helper class.
-  Function& hash_code_func = Function::Handle(I,
+  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);
 
   cls.AddFields(enum_members.fields());
-  const Array& functions =
-      Array::Handle(Z, Array::MakeArray(enum_members.functions()));
+  const Array& functions = Array::Handle(Z, enum_members.MakeFunctionsArray());
   cls.SetFunctions(functions);
 }
 
@@ -4835,8 +4885,7 @@
 void Parser::AddImplicitConstructor(const Class& cls) {
   // The implicit constructor is unnamed, has no explicit parameter.
   String& ctor_name = String::ZoneHandle(Z, cls.Name());
-  ctor_name = String::Concat(ctor_name, Symbols::Dot());
-  ctor_name = Symbols::New(ctor_name);
+  ctor_name = Symbols::FromConcat(ctor_name, Symbols::Dot());
   // 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.
@@ -5208,8 +5257,7 @@
 void Parser::ParseTypeParameters(const Class& cls) {
   TRACE_PARSER("ParseTypeParameters");
   if (CurrentToken() == Token::kLT) {
-    const GrowableObjectArray& type_parameters_array =
-        GrowableObjectArray::Handle(Z, GrowableObjectArray::New());
+    GrowableArray<AbstractType*> type_parameters_array(Z, 2);
     intptr_t index = 0;
     TypeParameter& type_parameter = TypeParameter::Handle(Z);
     TypeParameter& existing_type_parameter = TypeParameter::Handle(Z);
@@ -5225,7 +5273,7 @@
           *ExpectUserDefinedTypeIdentifier("type parameter expected");
       // Check for duplicate type parameters.
       for (intptr_t i = 0; i < index; i++) {
-        existing_type_parameter ^= type_parameters_array.At(i);
+        existing_type_parameter ^= type_parameters_array.At(i)->raw();
         existing_type_parameter_name = existing_type_parameter.name();
         if (existing_type_parameter_name.Equals(type_parameter_name)) {
           ReportError(type_parameter_pos, "duplicate type parameter '%s'",
@@ -5247,7 +5295,8 @@
                                           type_parameter_name,
                                           type_parameter_bound,
                                           declaration_pos);
-      type_parameters_array.Add(type_parameter);
+      type_parameters_array.Add(
+          &AbstractType::ZoneHandle(Z, type_parameter.raw()));
       if (metadata_pos >= 0) {
         library_.AddTypeParameterMetadata(type_parameter, metadata_pos);
       }
@@ -5282,8 +5331,7 @@
     ClassFinalizer::FinalizationKind finalization) {
   TRACE_PARSER("ParseTypeArguments");
   if (CurrentToken() == Token::kLT) {
-    const GrowableObjectArray& types =
-        GrowableObjectArray::Handle(Z, GrowableObjectArray::New());
+    GrowableArray<AbstractType*> types;
     AbstractType& type = AbstractType::Handle(Z);
     do {
       ConsumeToken();
@@ -5292,7 +5340,7 @@
       if (type.IsMalformed()) {
         type = Type::DynamicType();
       }
-      types.Add(type);
+      types.Add(&AbstractType::ZoneHandle(Z, type.raw()));
     } while (CurrentToken() == Token::kCOMMA);
     Token::Kind token = CurrentToken();
     if ((token == Token::kGT) || (token == Token::kSHR)) {
@@ -5403,8 +5451,8 @@
     field = Field::New(var_name, is_static, is_final, is_const, is_reflectable,
                        current_class(), name_pos);
     field.set_type(type);
-    field.set_value(Instance::Handle(Z, Instance::null()));
-    top_level->fields.Add(field);
+    field.SetStaticValue(Object::null_instance(), true);
+    top_level->AddField(field);
     library_.AddObject(field, var_name);
     if (metadata_pos >= 0) {
       library_.AddFieldMetadata(field, metadata_pos);
@@ -5417,7 +5465,7 @@
         has_simple_literal = IsSimpleLiteral(type, &field_value);
       }
       SkipExpr();
-      field.set_value(field_value);
+      field.SetStaticValue(field_value, true);
       field.set_has_initializer(true);
 
       if (!has_simple_literal) {
@@ -5437,7 +5485,7 @@
         if (library_.is_dart_scheme() && library_.IsPrivate(var_name)) {
           getter.set_is_reflectable(false);
         }
-        top_level->functions.Add(getter);
+        top_level->AddFunction(getter);
       }
     } else if (is_final) {
       ReportError(name_pos, "missing initializer for final or const variable");
@@ -5582,7 +5630,7 @@
     func.set_is_reflectable(false);
   }
   AddFormalParamsToFunction(&params, func);
-  top_level->functions.Add(func);
+  top_level->AddFunction(func);
   if (!is_patch) {
     library_.AddObject(func, func_name);
   } else {
@@ -5736,7 +5784,7 @@
     func.set_is_reflectable(false);
   }
   AddFormalParamsToFunction(&params, func);
-  top_level->functions.Add(func);
+  top_level->AddFunction(func);
   if (!is_patch) {
     library_.AddObject(func, accessor_name);
   } else {
@@ -5790,13 +5838,14 @@
   ConsumeToken();
   String& lib_name = *ExpectIdentifier("library name expected");
   if (CurrentToken() == Token::kPERIOD) {
+    GrowableHandlePtrArray<const String> pieces(Z, 3);
+    pieces.Add(lib_name);
     while (CurrentToken() == Token::kPERIOD) {
       ConsumeToken();
-      lib_name = String::Concat(lib_name, Symbols::Dot());
-      lib_name = String::Concat(lib_name,
-          *ExpectIdentifier("malformed library name"));
+      pieces.Add(Symbols::Dot());
+      pieces.Add(*ExpectIdentifier("malformed library name"));
     }
-    lib_name = Symbols::New(lib_name);
+    lib_name = Symbols::FromConcatAll(pieces);
   }
   library_.SetName(lib_name);
   ExpectSemicolon();
@@ -6047,7 +6096,7 @@
       GrowableObjectArray::Handle(Z, object_store->pending_classes());
   SetPosition(0);
   is_top_level_ = true;
-  TopLevel top_level;
+  TopLevel top_level(Z);
   Class& toplevel_class = Class::Handle(Z,
       Class::New(Symbols::TopLevel(), script_, TokenPos()));
   toplevel_class.set_library(library_);
@@ -6094,13 +6143,15 @@
   }
 
   if ((library_.num_anonymous_classes() == 0) ||
-    (top_level.fields.Length() > 0) || (top_level.functions.Length() > 0)) {
-    toplevel_class.AddFields(top_level.fields);
-
-    const Array& array = Array::Handle(Z,
-                                       Array::MakeArray(top_level.functions));
+      (top_level.fields().length() > 0) ||
+      (top_level.functions().length() > 0)) {
+    toplevel_class.AddFields(top_level.fields());
+    const intptr_t len = top_level.functions().length();
+    const Array& array = Array::Handle(Z, Array::New(len, Heap::kOld));
+    for (intptr_t i = 0; i < len; i++) {
+      array.SetAt(i, *top_level.functions()[i]);
+    }
     toplevel_class.SetFunctions(array);
-
     library_.AddAnonymousClass(toplevel_class);
     pending_classes.Add(toplevel_class, Heap::kOld);
   }
@@ -6290,8 +6341,8 @@
             no_args));
 
     // Suspend after the close.
-    AwaitMarkerNode* await_marker = new(Z) AwaitMarkerNode();
-    await_marker->set_scope(current_block_->scope);
+    AwaitMarkerNode* await_marker =
+        new(Z) AwaitMarkerNode(async_temp_scope_, current_block_->scope);
     current_block_->statements->Add(await_marker);
     ReturnNode* continuation_ret = new(Z) ReturnNode(try_end_pos);
     continuation_ret->set_return_type(ReturnNode::kContinuationTarget);
@@ -6317,7 +6368,7 @@
   }
 
   const GrowableObjectArray& handler_types =
-      GrowableObjectArray::Handle(Z, GrowableObjectArray::New());
+      GrowableObjectArray::Handle(Z, GrowableObjectArray::New(Heap::kOld));
   handler_types.Add(dynamic_type);  // Catch block handles all exceptions.
 
   CatchClauseNode* catch_clause = new(Z) CatchClauseNode(
@@ -6434,7 +6485,7 @@
   SequenceNode* catch_handler_list = CloseBlock();
 
   const GrowableObjectArray& handler_types =
-      GrowableObjectArray::Handle(Z, GrowableObjectArray::New());
+      GrowableObjectArray::Handle(Z, GrowableObjectArray::New(Heap::kOld));
   handler_types.SetLength(0);
   handler_types.Add(*exception_param.type);
 
@@ -6563,30 +6614,31 @@
       library_.AddClass(sig_cls);
     }
     body.set_signature_class(sig_cls);
+    // Finalize types in signature class here, so that the
+    // signature type is not computed twice.
+    ClassFinalizer::FinalizeTypesInClass(sig_cls);
     const Type& sig_type = Type::Handle(Z, sig_cls.SignatureType());
-    if (!sig_type.IsFinalized()) {
-      ClassFinalizer::FinalizeType(
-          sig_cls, sig_type, ClassFinalizer::kCanonicalize);
-    }
+    ASSERT(sig_type.IsFinalized());
     ASSERT(AbstractType::Handle(Z, body.result_type()).IsResolved());
     ASSERT(body.NumParameters() == closure_params.parameters->length());
   }
 
   OpenFunctionBlock(body);
   AddFormalParamsToScope(&closure_params, current_block_->scope);
-  OpenBlock();
   async_temp_scope_ = current_block_->scope;
   return body.raw();
 }
 
 SequenceNode* Parser::CloseSyncGenFunction(const Function& closure,
                                            SequenceNode* closure_body) {
-  // The block for the closure body has already been closed. Close the
-  // corresponding function block.
-  CloseBlock();
-
-  closure_body->scope()->LookupVariable(Symbols::AwaitJumpVar(), false);
-  closure_body->scope()->LookupVariable(Symbols::AwaitContextVar(), false);
+  // Explicitly reference variables of the sync generator function from the
+  // closure body in order to mark them as captured.
+  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);
+  ASSERT((existing_var != NULL) && existing_var->is_captured());
 
   // :await_jump_var = -1;
   LocalVariable* jump_var =
@@ -6678,9 +6730,9 @@
     const String& async_func_name =
         String::Handle(Z, innermost_function().name());
     String& closure_name = String::Handle(Z,
-        String::NewFormatted("<%s_async_body>", async_func_name.ToCString()));
+        Symbols::NewFormatted("<%s_async_body>", async_func_name.ToCString()));
     closure = Function::NewClosureFunction(
-        String::Handle(Z, Symbols::New(closure_name)),
+        closure_name,
         innermost_function(),
         async_func_pos);
     closure.set_is_generated_body(true);
@@ -6703,17 +6755,16 @@
       library_.AddClass(sig_cls);
     }
     closure.set_signature_class(sig_cls);
+    // Finalize types in signature class here, so that the
+    // signature type is not computed twice.
+    ClassFinalizer::FinalizeTypesInClass(sig_cls);
     const Type& sig_type = Type::Handle(Z, sig_cls.SignatureType());
-    if (!sig_type.IsFinalized()) {
-      ClassFinalizer::FinalizeType(
-          sig_cls, sig_type, ClassFinalizer::kCanonicalize);
-    }
+    ASSERT(sig_type.IsFinalized());
     ASSERT(AbstractType::Handle(Z, closure.result_type()).IsResolved());
     ASSERT(closure.NumParameters() == closure_params.parameters->length());
   }
   OpenFunctionBlock(closure);
   AddFormalParamsToScope(&closure_params, current_block_->scope);
-  OpenBlock();
   async_temp_scope_ = current_block_->scope;
   return closure.raw();
 }
@@ -6727,31 +6778,31 @@
   LocalVariable* await_jump_var = new (Z) LocalVariable(
       Scanner::kNoSourcePos, Symbols::AwaitJumpVar(), dynamic_type);
   current_block_->scope->AddVariable(await_jump_var);
-  current_block_->scope->CaptureVariable(Symbols::AwaitJumpVar());
-  await_jump_var->set_is_captured();
   LocalVariable* await_ctx_var = new (Z) LocalVariable(
       Scanner::kNoSourcePos, Symbols::AwaitContextVar(), dynamic_type);
   current_block_->scope->AddVariable(await_ctx_var);
-  current_block_->scope->CaptureVariable(Symbols::AwaitContextVar());
-  await_ctx_var->set_is_captured();
 }
 
 
 void Parser::AddAsyncClosureVariables() {
   // Add to current block's scope:
   //   var :async_op;
+  //   var :async_then_callback;
+  //   var :async_catch_error_callback;
   //   var :async_completer;
   const Type& dynamic_type = Type::ZoneHandle(Z, Type::DynamicType());
   LocalVariable* async_op_var = new(Z) LocalVariable(
       Scanner::kNoSourcePos, Symbols::AsyncOperation(), dynamic_type);
   current_block_->scope->AddVariable(async_op_var);
-  current_block_->scope->CaptureVariable(Symbols::AsyncOperation());
-  async_op_var->set_is_captured();
+  LocalVariable* async_then_callback_var = new(Z) LocalVariable(
+      Scanner::kNoSourcePos, Symbols::AsyncThenCallback(), dynamic_type);
+  current_block_->scope->AddVariable(async_then_callback_var);
+  LocalVariable* async_catch_error_callback_var = new(Z) LocalVariable(
+      Scanner::kNoSourcePos, Symbols::AsyncCatchErrorCallback(), dynamic_type);
+  current_block_->scope->AddVariable(async_catch_error_callback_var);
   LocalVariable* async_completer = new(Z) LocalVariable(
       Scanner::kNoSourcePos, Symbols::AsyncCompleter(), dynamic_type);
   current_block_->scope->AddVariable(async_completer);
-  current_block_->scope->CaptureVariable(Symbols::AsyncCompleter());
-  async_completer->set_is_captured();
 }
 
 
@@ -6762,20 +6813,23 @@
   // store the StreamController object to which the yielded expressions
   // are added.
   //   var :async_op;
-  // This variable is used to store the async generator closure containing
-  // the body of the async* function. It is used by the await operator.
+  //   var :async_then_callback;
+  //   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.
   const Type& dynamic_type = Type::ZoneHandle(Z, Type::DynamicType());
   LocalVariable* controller_var = new(Z) LocalVariable(
       Scanner::kNoSourcePos, Symbols::Controller(), dynamic_type);
   current_block_->scope->AddVariable(controller_var);
-  current_block_->scope->CaptureVariable(Symbols::Controller());
-  controller_var->set_is_captured();
-
   LocalVariable* async_op_var = new(Z) LocalVariable(
       Scanner::kNoSourcePos, Symbols::AsyncOperation(), dynamic_type);
   current_block_->scope->AddVariable(async_op_var);
-  current_block_->scope->CaptureVariable(Symbols::AsyncOperation());
-  async_op_var->set_is_captured();
+  LocalVariable* async_then_callback_var = new(Z) LocalVariable(
+      Scanner::kNoSourcePos, Symbols::AsyncThenCallback(), dynamic_type);
+  current_block_->scope->AddVariable(async_then_callback_var);
+  LocalVariable* async_catch_error_callback_var = new(Z) LocalVariable(
+      Scanner::kNoSourcePos, Symbols::AsyncCatchErrorCallback(), dynamic_type);
+  current_block_->scope->AddVariable(async_catch_error_callback_var);
 }
 
 
@@ -6830,18 +6884,17 @@
       library_.AddClass(sig_cls);
     }
     closure.set_signature_class(sig_cls);
+    // Finalize types in signature class here, so that the
+    // signature type is not computed twice.
+    ClassFinalizer::FinalizeTypesInClass(sig_cls);
     const Type& sig_type = Type::Handle(Z, sig_cls.SignatureType());
-    if (!sig_type.IsFinalized()) {
-      ClassFinalizer::FinalizeType(
-          sig_cls, sig_type, ClassFinalizer::kCanonicalize);
-    }
+    ASSERT(sig_type.IsFinalized());
     ASSERT(AbstractType::Handle(Z, closure.result_type()).IsResolved());
     ASSERT(closure.NumParameters() == closure_params.parameters->length());
   }
 
   OpenFunctionBlock(closure);
   AddFormalParamsToScope(&closure_params, current_block_->scope);
-  OpenBlock();
   async_temp_scope_ = current_block_->scope;
   return closure.raw();
 }
@@ -6857,6 +6910,8 @@
 //     ... source code of f ...
 //   }
 //   var :async_op = f_async_body;
+//   var :async_then_callback = _asyncThenWrapperHelper(:async_op);
+//   var :async_catch_error_callback = _asyncCatchErrorWrapperHelper(:async_op);
 //   :controller = new _AsyncStarStreamController(:async_op);
 //   return :controller.stream;
 // }
@@ -6866,19 +6921,32 @@
   ASSERT(!closure_func.IsNull());
   ASSERT(closure_body != NULL);
 
-  // The block for the async closure body has already been closed. Close the
-  // corresponding function block.
-  CloseBlock();
+  // 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);
+  ASSERT((existing_var != NULL) && existing_var->is_captured());
+  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);
+  ASSERT((existing_var != NULL) && existing_var->is_captured());
+  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);
+  ASSERT((existing_var != NULL) && existing_var->is_captured());
+  existing_var = closure_body->scope()->LookupVariable(
+      Symbols::AsyncCatchErrorCallback(), false);
+  ASSERT((existing_var != NULL) && existing_var->is_captured());
 
-  // Make sure the implicit variables of the async generator function
-  // are captured.
-  closure_body->scope()->LookupVariable(Symbols::AwaitJumpVar(), false);
-  closure_body->scope()->LookupVariable(Symbols::AwaitContextVar(), false);
-  closure_body->scope()->LookupVariable(Symbols::Controller(), false);
-  closure_body->scope()->LookupVariable(Symbols::AsyncOperation(), false);
+  const Library& async_lib = Library::Handle(Library::AsyncLibrary());
 
   const Class& controller_class = Class::Handle(Z,
-      Library::LookupCoreClass(Symbols::_AsyncStarStreamController()));
+      async_lib.LookupClassAllowPrivate(
+          Symbols::_AsyncStarStreamController()));
   ASSERT(!controller_class.IsNull());
   const Function& controller_constructor = Function::ZoneHandle(Z,
       controller_class.LookupConstructorAllowPrivate(
@@ -6902,8 +6970,56 @@
       Scanner::kNoSourcePos,
       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()));
+  ASSERT(!async_then_wrapper_helper.IsNull());
+  ArgumentListNode* async_then_wrapper_helper_args = new (Z) ArgumentListNode(
+      Scanner::kNoSourcePos);
+  async_then_wrapper_helper_args->Add(
+      new (Z) LoadLocalNode(Scanner::kNoSourcePos, async_op_var));
+  StaticCallNode* then_wrapper_call = new (Z) StaticCallNode(
+      Scanner::kNoSourcePos,
+      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(
+      Scanner::kNoSourcePos,
+      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()));
+  ASSERT(!async_error_wrapper_helper.IsNull());
+  ArgumentListNode* async_error_wrapper_helper_args = new (Z) ArgumentListNode(
+      Scanner::kNoSourcePos);
+  async_error_wrapper_helper_args->Add(
+      new (Z) LoadLocalNode(Scanner::kNoSourcePos, async_op_var));
+  StaticCallNode* error_wrapper_call = new (Z) StaticCallNode(
+      Scanner::kNoSourcePos,
+      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(
+      Scanner::kNoSourcePos,
+      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(Scanner::kNoSourcePos);
   arguments->Add(new (Z) LoadLocalNode(Scanner::kNoSourcePos, async_op_var));
@@ -6944,18 +7060,6 @@
   SequenceNode* new_body = CloseAsyncGeneratorTryBlock(body);
   ASSERT(new_body != NULL);
   ASSERT(new_body->scope() != NULL);
-
-  // Implicitly mark those variables below as captured. We currently mark all
-  // variables of all scopes as captured, but as soon as we do something
-  // smarter we rely on these internal variables to be available.
-  new_body->scope()->LookupVariable(Symbols::AwaitJumpVar(), false);
-  new_body->scope()->LookupVariable(Symbols::AwaitContextVar(), false);
-  new_body->scope()->LookupVariable(Symbols::Controller(), false);
-  new_body->scope()->LookupVariable(Symbols::AsyncOperationParam(), false);
-  new_body->scope()->LookupVariable(Symbols::AsyncOperationErrorParam(), false);
-  new_body->scope()->LookupVariable(
-      Symbols::AsyncOperationStackTraceParam(), false);
-  new_body->scope()->RecursivelyCaptureAllVariables();
   return new_body;
 }
 
@@ -6995,20 +7099,24 @@
   ASSERT(!closure.IsNull());
   ASSERT(closure_body != NULL);
 
-  // The block for the async closure body has already been closed. Close the
-  // corresponding function block.
-  CloseBlock();
-
-  closure_body->scope()->LookupVariable(Symbols::AwaitJumpVar(), false);
-  closure_body->scope()->LookupVariable(Symbols::AwaitContextVar(), false);
-  closure_body->scope()->CaptureVariable(Symbols::AsyncCompleter());
+  // Explicitly reference variables of the async function from the
+  // closure body in order to mark them as captured.
+  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);
+  ASSERT((existing_var != NULL) && existing_var->is_captured());
+  existing_var =
+      closure_body->scope()->LookupVariable(Symbols::AsyncCompleter(), false);
+  ASSERT((existing_var != NULL) && existing_var->is_captured());
 
   // Create and return a new future that executes a closure with the current
   // body.
 
   // 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 funtion's block).
+  // a nested block (contained in the async function's block).
   const Class& future =
       Class::ZoneHandle(Z, I->object_store()->future_class());
   ASSERT(!future.IsNull());
@@ -7019,14 +7127,14 @@
       Class::ZoneHandle(Z, I->object_store()->completer_class());
   ASSERT(!completer.IsNull());
   const Function& completer_constructor = Function::ZoneHandle(Z,
-      completer.LookupFunction(Symbols::CompleterConstructor()));
+      completer.LookupFunction(Symbols::CompleterSyncConstructor()));
   ASSERT(!completer_constructor.IsNull());
 
   LocalVariable* async_completer = current_block_->scope->LookupVariable(
       Symbols::AsyncCompleter(), false);
 
   // Add to AST:
-  //   :async_completer = new Completer();
+  //   :async_completer = new Completer.sync();
   ArgumentListNode* empty_args =
       new (Z) ArgumentListNode(Scanner::kNoSourcePos);
   ConstructorCallNode* completer_constructor_node = new (Z) ConstructorCallNode(
@@ -7060,6 +7168,54 @@
       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()));
+  ASSERT(!async_then_wrapper_helper.IsNull());
+  ArgumentListNode* async_then_wrapper_helper_args = new (Z) ArgumentListNode(
+      Scanner::kNoSourcePos);
+  async_then_wrapper_helper_args->Add(
+      new (Z) LoadLocalNode(Scanner::kNoSourcePos, async_op_var));
+  StaticCallNode* then_wrapper_call = new (Z) StaticCallNode(
+      Scanner::kNoSourcePos,
+      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(
+      Scanner::kNoSourcePos,
+      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()));
+  ASSERT(!async_error_wrapper_helper.IsNull());
+  ArgumentListNode* async_error_wrapper_helper_args = new (Z) ArgumentListNode(
+      Scanner::kNoSourcePos);
+  async_error_wrapper_helper_args->Add(
+      new (Z) LoadLocalNode(Scanner::kNoSourcePos, async_op_var));
+  StaticCallNode* error_wrapper_call = new (Z) StaticCallNode(
+      Scanner::kNoSourcePos,
+      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(
+      Scanner::kNoSourcePos,
+      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(Scanner::kNoSourcePos);
@@ -7088,33 +7244,30 @@
 SequenceNode* Parser::CloseAsyncClosure(SequenceNode* body) {
   // We need a temporary expression to store intermediate return values.
   parsed_function()->EnsureExpressionTemp();
-  // Implicitly mark those variables below as captured. We currently mark all
-  // variables of all scopes as captured (below), but as soon as we do something
-  // smarter we rely on these internal variables to be available.
+
   SequenceNode* new_body = CloseAsyncTryBlock(body);
   ASSERT(new_body != NULL);
   ASSERT(new_body->scope() != NULL);
-  new_body->scope()->LookupVariable(Symbols::AwaitJumpVar(), false);
-  new_body->scope()->LookupVariable(Symbols::AwaitContextVar(), false);
-  new_body->scope()->LookupVariable(Symbols::AsyncCompleter(), false);
-  new_body->scope()->RecursivelyCaptureAllVariables();
   return new_body;
 }
 
 
 // Set up default values for all optional parameters to the function.
-void Parser::SetupDefaultsForOptionalParams(const ParamList* params,
-                                            Array* default_values) {
-  if (params->num_optional_parameters > 0) {
+void Parser::SetupDefaultsForOptionalParams(const ParamList& params) {
+  if ((current_function().raw() == innermost_function().raw()) &&
+      (params.num_optional_parameters > 0)) {
+    ZoneGrowableArray<const Instance*>* default_values =
+        new ZoneGrowableArray<const Instance*>(zone(),
+                                               params.num_optional_parameters);
     // Build array of default parameter values.
-    ParamDesc* param =
-      params->parameters->data() + params->num_fixed_parameters;
-    *default_values = Array::New(params->num_optional_parameters);
-    for (int i = 0; i < params->num_optional_parameters; i++) {
-      ASSERT(param->default_value != NULL);
-      default_values->SetAt(i, *param->default_value);
-      param++;
+    const ZoneGrowableArray<ParamDesc>& parameters = *params.parameters;
+    const int first_opt_param_offset = params.num_fixed_parameters;
+    for (int i = 0; i < params.num_optional_parameters; i++) {
+      const Instance* default_value =
+          parameters[i + first_opt_param_offset].default_value;
+      default_values->Add(default_value);
     }
+    parsed_function()->set_default_parameter_values(default_values);
   }
 }
 
@@ -7214,7 +7367,8 @@
           native_name,
           native_function,
           current_block_->scope,
-          is_bootstrap_native)));
+          is_bootstrap_native,
+          FLAG_link_natives_lazily)));
 }
 
 
@@ -7241,14 +7395,10 @@
 
 void Parser::CaptureInstantiator() {
   ASSERT(current_block_->scope->function_level() > 0);
-  bool found = false;
-  if (current_function().IsInFactoryScope()) {
-    found = current_block_->scope->CaptureVariable(
-        Symbols::TypeArgumentsParameter());
-  } else {
-    found = current_block_->scope->CaptureVariable(Symbols::This());
-  }
-  ASSERT(found);
+  const String* variable_name = current_function().IsInFactoryScope() ?
+      &Symbols::TypeArgumentsParameter() : &Symbols::This();
+  current_block_->scope->CaptureVariable(
+      current_block_->scope->LookupVariable(*variable_name, true));
 }
 
 
@@ -7336,14 +7486,10 @@
     LocalVariable* existing_var =
         current_block_->scope->LookupVariable(variable->name(), true);
     ASSERT(existing_var != NULL);
-    if (existing_var->owner() == current_block_->scope) {
-      ReportError(ident_pos, "identifier '%s' already defined",
-                  variable->name().ToCString());
-    } else {
-      ReportError(ident_pos, "'%s' from outer scope has already been used, "
-                  "cannot redefine",
-                  variable->name().ToCString());
-    }
+    // Use before define cases have already been detected and reported above.
+    ASSERT(existing_var->owner() == current_block_->scope);
+    ReportError(ident_pos, "identifier '%s' already defined",
+                variable->name().ToCString());
   }
   if (is_final || is_const) {
     variable->set_is_final();
@@ -7536,22 +7682,16 @@
           current_block_->scope->LookupVariable(function_variable->name(),
                                                 true);
       ASSERT(existing_var != NULL);
-      if (existing_var->owner() == current_block_->scope) {
-        ReportError(function_pos, "identifier '%s' already defined",
-                    function_variable->name().ToCString());
-      } else {
-        ReportError(function_pos,
-                    "'%s' from outer scope has already been used, "
-                    "cannot redefine",
-                    function_variable->name().ToCString());
-      }
+      // Use before define cases have already been detected and reported above.
+      ASSERT(existing_var->owner() == current_block_->scope);
+      ReportError(function_pos, "identifier '%s' already defined",
+                  function_variable->name().ToCString());
     }
   }
 
   // Parse the local function.
-  Array& default_parameter_values = Array::Handle(Z);
-  SequenceNode* statements = Parser::ParseFunc(function,
-                                               &default_parameter_values);
+  SequenceNode* statements = Parser::ParseFunc(function);
+  INC_STAT(thread(), num_functions_parsed, 1);
 
   // Now that the local function has formal parameters, lookup the signature
   // class in the current library (but not in its imports) and only create a new
@@ -7590,27 +7730,11 @@
     CaptureInstantiator();
   }
 
-  // Since the signature type is cached by the signature class, it may have
-  // been finalized already.
-  Type& signature_type =
-      Type::Handle(Z, signature_class.SignatureType());
-  TypeArguments& signature_type_arguments =
-      TypeArguments::Handle(Z, signature_type.arguments());
-
-  if (!signature_type.IsFinalized()) {
-    signature_type ^= ClassFinalizer::FinalizeType(
-        signature_class, signature_type, ClassFinalizer::kCanonicalize);
-
-    // The call to ClassFinalizer::FinalizeType may have
-    // extended the vector of type arguments.
-    signature_type_arguments = signature_type.arguments();
-    ASSERT(signature_type_arguments.IsNull() ||
-           (signature_type_arguments.Length() ==
-            signature_class.NumTypeArguments()));
-
-    // The signature_class should not have changed.
-    ASSERT(signature_type.type_class() == signature_class.raw());
-  }
+  // Finalize types in signature class here, so that the
+  // signature type is not computed twice.
+  ClassFinalizer::FinalizeTypesInClass(signature_class);
+  const Type& signature_type = Type::Handle(Z, signature_class.SignatureType());
+  ASSERT(signature_type.IsFinalized());
 
   // A signature type itself cannot be malformed or malbounded, only its
   // signature function's result type or parameter types may be.
@@ -7620,7 +7744,8 @@
   if (variable_name != NULL) {
     // Patch the function type of the variable now that the signature is known.
     function_type.set_type_class(signature_class);
-    function_type.set_arguments(signature_type_arguments);
+    function_type.set_arguments(
+        TypeArguments::Handle(Z, signature_type.arguments()));
 
     // The function type was initially marked as instantiated, but it may
     // actually be uninstantiated.
@@ -8394,13 +8519,12 @@
 static LocalVariable* LookupAsyncSavedTryContextVar(LocalScope* scope,
                                                     uint16_t try_index) {
   const String& async_saved_try_ctx_name =
-      String::ZoneHandle(Symbols::New(String::Handle(
-          String::NewFormatted(
-              "%s%d",
-              Symbols::AsyncSavedTryCtxVarPrefix().ToCString(),
-              try_index))));
+      String::ZoneHandle(Symbols::NewFormatted(
+          "%s%d",
+          Symbols::AsyncSavedTryCtxVarPrefix().ToCString(),
+          try_index));
   LocalVariable* var = scope->LocalLookupVariable(async_saved_try_ctx_name);
-  ASSERT((var != NULL) && var->is_captured());\
+  ASSERT(var != NULL);
   return var;
 }
 
@@ -8436,7 +8560,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(scope, try_index);
+      *async_saved_try_ctx = LookupAsyncSavedTryContextVar(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.
@@ -8445,7 +8570,7 @@
         if (scope->function_level() == current_function_level) {
           *outer_saved_try_ctx = LookupSavedTryContextVar(scope->parent());
           *outer_async_saved_try_ctx =
-              LookupAsyncSavedTryContextVar(scope, try_index);
+              LookupAsyncSavedTryContextVar(async_temp_scope_, try_index);
         }
       }
     }
@@ -8469,9 +8594,8 @@
       Z, lib.LookupFunctionAllowPrivate(Symbols::print()));
   ASSERT(!print_fn.IsNull());
   ArgumentListNode* one_arg = new(Z) ArgumentListNode(Scanner::kNoSourcePos);
-  String& msg = String::Handle(String::NewFormatted("%s", str));
-  one_arg->Add(new(Z) LiteralNode(Scanner::kNoSourcePos,
-               String::ZoneHandle(Symbols::New(msg))));
+  String& msg = String::ZoneHandle(Symbols::NewFormatted("%s", str));
+  one_arg->Add(new(Z) LiteralNode(Scanner::kNoSourcePos, msg));
   AstNode* print_call =
       new(Z) StaticCallNode(Scanner::kNoSourcePos, print_fn, one_arg);
   return print_call;
@@ -8591,14 +8715,15 @@
       new(Z) LoadLocalNode(stream_pos, iterator_var),
                            Symbols::MoveNext(),
                            no_args);
+  OpenBlock();
   AstNode* await_moveNext =
       new(Z) AwaitNode(stream_pos,
                        iterator_moveNext,
                        saved_try_ctx,
                        async_saved_try_ctx,
                        outer_saved_try_ctx,
-                       outer_async_saved_try_ctx);
-  OpenBlock();
+                       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();
@@ -9007,7 +9132,7 @@
   ConsumeToken();  // Consume assert keyword.
   ExpectToken(Token::kLPAREN);
   const intptr_t condition_pos = TokenPos();
-  if (!I->flags().asserts() && !I->flags().type_checks()) {
+  if (!I->flags().asserts()) {
     SkipExpr();
     ExpectToken(Token::kRPAREN);
     return NULL;
@@ -9117,7 +9242,7 @@
         LocalVariable* saved_try_ctx =
             LookupSavedTryContextVar(scope->parent());
         LocalVariable* async_saved_try_ctx =
-            LookupAsyncSavedTryContextVar(scope->parent(),
+            LookupAsyncSavedTryContextVar(async_temp_scope_,
                                           try_stack_->try_index());
         current_block_->statements->Add(
             new (Z) StoreLocalNode(
@@ -9391,7 +9516,7 @@
         LocalVariable* saved_try_ctx =
             LookupSavedTryContextVar(scope->parent());
         LocalVariable* async_saved_try_ctx =
-            LookupAsyncSavedTryContextVar(scope->parent(),
+            LookupAsyncSavedTryContextVar(async_temp_scope_,
                                           try_block->try_index());
         async_code->Add(
             new (Z) StoreLocalNode(
@@ -9420,20 +9545,15 @@
 
 void Parser::SetupSavedTryContext(LocalVariable* saved_try_context) {
   const String& async_saved_try_ctx_name = String::ZoneHandle(Z,
-      Symbols::New(String::Handle(Z,
-          String::NewFormatted("%s%d",
-                               Symbols::AsyncSavedTryCtxVarPrefix().ToCString(),
-                               last_used_try_index_ - 1))));
+      Symbols::NewFormatted("%s%d",
+                           Symbols::AsyncSavedTryCtxVarPrefix().ToCString(),
+                           last_used_try_index_ - 1));
   LocalVariable* async_saved_try_ctx = new (Z) LocalVariable(
       Scanner::kNoSourcePos,
       async_saved_try_ctx_name,
       Type::ZoneHandle(Z, Type::DynamicType()));
   ASSERT(async_temp_scope_ != NULL);
   async_temp_scope_->AddVariable(async_saved_try_ctx);
-  async_saved_try_ctx->set_is_captured();
-  async_saved_try_ctx = current_block_->scope->LookupVariable(
-      async_saved_try_ctx_name, false);
-  ASSERT(async_saved_try_ctx != NULL);
   ASSERT(saved_try_context != NULL);
   current_block_->statements->Add(new(Z) StoreLocalNode(
       Scanner::kNoSourcePos,
@@ -9569,7 +9689,7 @@
   try_stack_->enter_catch();
   const intptr_t handler_pos = TokenPos();
   const GrowableObjectArray& handler_types =
-      GrowableObjectArray::Handle(Z, GrowableObjectArray::New());
+      GrowableObjectArray::Handle(Z, GrowableObjectArray::New(Heap::kOld));
   bool needs_stack_trace = false;
   SequenceNode* catch_handler_list =
       ParseCatchClauses(handler_pos,
@@ -9767,8 +9887,8 @@
               new(Z) LiteralNode(TokenPos(), Bool::True()));
       yield->AddNode(set_is_yield_each);
     }
-    AwaitMarkerNode* await_marker = new(Z) AwaitMarkerNode();
-    await_marker->set_scope(current_block_->scope);
+    AwaitMarkerNode* await_marker =
+        new(Z) AwaitMarkerNode(async_temp_scope_, current_block_->scope);
     yield->AddNode(await_marker);
     // Return true to indicate that a value has been generated.
     ReturnNode* return_true = new(Z) ReturnNode(yield_pos,
@@ -9835,8 +9955,8 @@
        new(Z) IfNode(Scanner::kNoSourcePos, add_call, true_branch, NULL);
     yield->AddNode(if_is_cancelled);
 
-    AwaitMarkerNode* await_marker = new(Z) AwaitMarkerNode();
-    await_marker->set_scope(current_block_->scope);
+    AwaitMarkerNode* await_marker =
+        new(Z) AwaitMarkerNode(async_temp_scope_, current_block_->scope);
     yield->AddNode(await_marker);
     ReturnNode* continuation_return = new(Z) ReturnNode(yield_pos);
     continuation_return->set_return_type(ReturnNode::kContinuationTarget);
@@ -10493,9 +10613,9 @@
 
 // Evaluates the value of the compile time constant expression
 // and returns a literal node for the value.
-AstNode* Parser::FoldConstExpr(intptr_t expr_pos, AstNode* expr) {
+LiteralNode* Parser::FoldConstExpr(intptr_t expr_pos, AstNode* expr) {
   if (expr->IsLiteralNode()) {
-    return expr;
+    return expr->AsLiteralNode();
   }
   if (expr->EvalConstExpr() == NULL) {
     ReportError(expr_pos, "expression is not a valid compile-time constant");
@@ -10688,10 +10808,11 @@
     const Field& field = expr->AsLoadStaticFieldNode()->field();
     if (field.is_const() &&
         !expr->AsLoadStaticFieldNode()->is_deferred_reference()) {
-      ASSERT(field.value() != Object::sentinel().raw());
-      ASSERT(field.value() != Object::transition_sentinel().raw());
-      return new(zone) LiteralNode(expr->token_pos(),
-                                   Instance::ZoneHandle(zone, field.value()));
+      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 expr;
@@ -10742,13 +10863,27 @@
     AstNode* expr = ParseExpr(require_compiletime_const, consume_cascades);
     return new(Z) ThrowNode(expr_pos, expr, NULL);
   }
+
+  if (require_compiletime_const) {
+    // Check whether we already have evaluated a compile-time constant
+    // at this source location.
+    Instance& existing_const = Instance::ZoneHandle(Z);
+    if (GetCachedConstant(expr_pos, &existing_const)) {
+      SkipConditionalExpr();
+      return new(Z) LiteralNode(expr_pos, existing_const);
+    }
+  }
+
   AstNode* expr = ParseConditionalExpr();
   if (!Token::IsAssignmentOperator(CurrentToken())) {
     if ((CurrentToken() == Token::kCASCADE) && consume_cascades) {
       return ParseCascades(expr);
     }
     if (require_compiletime_const) {
-      expr = FoldConstExpr(expr_pos, expr);
+      const bool use_cache = !expr->IsLiteralNode();
+      LiteralNode* const_value = FoldConstExpr(expr_pos, expr);
+      if (use_cache) CacheConstantValue(expr_pos, const_value->literal());
+      expr = const_value;
     } else {
       expr = LiteralIfStaticConst(Z, expr);
     }
@@ -10842,7 +10977,8 @@
                              saved_try_ctx,
                              async_saved_try_ctx,
                              outer_saved_try_ctx,
-                             outer_async_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) {
@@ -11045,7 +11181,8 @@
   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::GetterName(field_name));
+  const String& getter_name =
+      String::Handle(Z, Field::GetterSymbol(field_name));
   const Function& getter = Function::Handle(Z,
       field_owner.LookupStaticFunction(getter_name));
   // Never load field directly if there is a getter (deterministic AST).
@@ -11440,7 +11577,7 @@
       is_setter_name = true;
     }
   } else if (Token::CanBeOverloaded(CurrentToken())) {
-    extractor_name = String::New(Token::Str(CurrentToken()));
+    extractor_name = Symbols::New(Token::Str(CurrentToken()));
     ConsumeToken();
   } else {
     ReportError("identifier or operator expected");
@@ -11554,11 +11691,13 @@
   }
 
   // Closurization of instance getter, setter, method or operator.
+  GrowableHandlePtrArray<const String> pieces(Z, 3);
+  pieces.Add(Symbols::HashMark());
   if (is_setter_name) {
-    extractor_name = String::Concat(Symbols::SetterPrefix(), extractor_name);
+    pieces.Add(Symbols::SetterPrefix());
   }
-  extractor_name = String::Concat(Symbols::HashMark(), extractor_name);
-  extractor_name = Symbols::New(extractor_name);
+  pieces.Add(extractor_name);
+  extractor_name = Symbols::FromConcatAll(pieces);
   return new(Z) InstanceGetterNode(property_pos, primary, extractor_name);
 }
 
@@ -11738,16 +11877,21 @@
 
 const AbstractType* Parser::ReceiverType(const Class& cls) {
   ASSERT(!cls.IsNull());
-  const TypeArguments& type_arguments = TypeArguments::Handle(
-      Z,
-      (cls.NumTypeParameters() > 0) ?
-          cls.type_parameters() : TypeArguments::null());
-  AbstractType& type = AbstractType::ZoneHandle(
-      Z, Type::New(cls, type_arguments, cls.token_pos()));
+  Type& type = Type::ZoneHandle(Z, cls.CanonicalType());
+  if (!type.IsNull()) {
+    return &type;
+  }
+  if (cls.IsSignatureClass()) {
+    type = cls.SignatureType();
+  } else {
+    type = Type::New(cls,
+        TypeArguments::Handle(Z, cls.type_parameters()), cls.token_pos());
+  }
   if (cls.is_type_finalized()) {
     type ^= ClassFinalizer::FinalizeType(
         cls, type, ClassFinalizer::kCanonicalizeWellFormed);
     // Note that the receiver type may now be a malbounded type.
+    cls.SetCanonicalType(type);
   }
   return &type;
 }
@@ -11763,6 +11907,71 @@
 }
 
 
+class ConstMapKeyEqualsTraits {
+ public:
+  static bool IsMatch(const Object& a, const Object& b) {
+    return String::Cast(a).Equals(String::Cast(b));
+  }
+  static bool IsMatch(const char* key, const Object& b) {
+    return String::Cast(b).Equals(key);
+  }
+  static uword Hash(const Object& obj) {
+    return String::Cast(obj).Hash();
+  }
+  static uword Hash(const char* key) {
+    return String::Hash(key, strlen(key));
+  }
+};
+typedef UnorderedHashMap<ConstMapKeyEqualsTraits> ConstantsMap;
+
+
+void Parser::CacheConstantValue(intptr_t token_pos, const Instance& value) {
+  String& key = String::Handle(Z, script_.url());
+  String& suffix =
+      String::Handle(Z, String::NewFormatted("_%" Pd "", token_pos));
+  key = Symbols::FromConcat(key, suffix);
+  if (isolate()->object_store()->compile_time_constants() == Array::null()) {
+    const intptr_t kInitialConstMapSize = 16;
+    isolate()->object_store()->set_compile_time_constants(
+        Array::Handle(Z, HashTables::New<ConstantsMap>(kInitialConstMapSize,
+                                                       Heap::kNew)));
+  }
+  ConstantsMap constants(isolate()->object_store()->compile_time_constants());
+  constants.UpdateOrInsert(key, value);
+  if (FLAG_compiler_stats) {
+    isolate_->compiler_stats()->num_cached_consts = constants.NumOccupied();
+  }
+  isolate()->object_store()->set_compile_time_constants(constants.Release());
+}
+
+
+bool Parser::GetCachedConstant(intptr_t token_pos, Instance* value) {
+  if (isolate()->object_store()->compile_time_constants() == Array::null()) {
+    return false;
+  }
+  // We don't want to allocate anything in the heap here since this code
+  // is called from the optimizing compiler in the background thread. Allocate
+  // the key value in the zone instead.
+  // const char* key = Z->PrintToString("%s_%" Pd "",
+  //     String::Handle(Z, script_.url()).ToCString(),
+  //    token_pos);
+
+  const String& key = String::Handle(Z,
+      Symbols::NewFormatted("%s_%" Pd "",
+          String::Handle(Z, script_.url()).ToCString(),
+          token_pos));
+  ConstantsMap constants(isolate()->object_store()->compile_time_constants());
+  bool is_present = false;
+  *value ^= constants.GetOrNull(key, &is_present);
+  ASSERT(constants.Release().raw() ==
+      isolate()->object_store()->compile_time_constants());
+  if (FLAG_compiler_stats && is_present) {
+    isolate_->compiler_stats()->num_const_cache_hits++;
+  }
+  return is_present;
+}
+
+
 RawInstance* Parser::TryCanonicalize(const Instance& instance,
                                      intptr_t token_pos) {
   if (instance.IsNull()) {
@@ -11786,10 +11995,11 @@
   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::GetterName(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 Instance& value = Instance::Handle(Z, field.value());
+  const Instance& value = Instance::Handle(Z, field.StaticValue());
   if (value.raw() == Object::transition_sentinel().raw()) {
     if (field.is_const()) {
       ReportError("circular dependency while initializing static field '%s'",
@@ -11804,7 +12014,7 @@
     // not been evaluated. If the field is const, call the static getter method
     // to evaluate the expression and canonicalize the value.
     if (field.is_const()) {
-      field.set_value(Object::transition_sentinel());
+      field.SetStaticValue(Object::transition_sentinel());
       const int kNumArguments = 0;  // no arguments.
       const Function& func = Function::Handle(Z,
           Resolver::ResolveStatic(field_owner,
@@ -11814,10 +12024,7 @@
       ASSERT(!func.IsNull());
       ASSERT(func.kind() == RawFunction::kImplicitStaticFinalGetter);
       Object& const_value = Object::Handle(Z);
-      {
-        PAUSETIMERSCOPE(I, time_compilation);
-        const_value = DartEntry::InvokeFunction(func, Object::empty_array());
-      }
+      const_value = DartEntry::InvokeFunction(func, Object::empty_array());
       if (const_value.IsError()) {
         const Error& error = Error::Cast(const_value);
         if (error.IsUnhandledException()) {
@@ -11825,7 +12032,7 @@
           // generated AST is not deterministic. Therefore mark the function as
           // not optimizable.
           current_function().SetIsOptimizable(false);
-          field.set_value(Object::null_instance());
+          field.SetStaticValue(Object::null_instance());
           // 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());
@@ -11842,7 +12049,7 @@
       Instance& instance = Instance::Handle(Z);
       instance ^= const_value.raw();
       instance = TryCanonicalize(instance, field_ref_pos);
-      field.set_value(instance);
+      field.SetStaticValue(instance);
       return NULL;   // Constant
     } else {
       return new(Z) StaticGetterNode(
@@ -11868,7 +12075,8 @@
   // Constructors have 2 extra arguments: rcvr and construction phase.
   const int kNumExtraArgs = constructor.IsFactory() ? 1 : 2;
   const int num_arguments = arguments->length() + kNumExtraArgs;
-  const Array& arg_values = Array::Handle(Z, Array::New(num_arguments));
+  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);
@@ -11895,11 +12103,7 @@
   const Array& args_descriptor = Array::Handle(Z,
       ArgumentsDescriptor::New(num_arguments, arguments->names()));
   Object& result = Object::Handle(Z);
-  {
-    PAUSETIMERSCOPE(I, time_compilation);
-    result = DartEntry::InvokeFunction(
-        constructor, arg_values, args_descriptor);
-  }
+  result = 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
@@ -11908,7 +12112,7 @@
       if (result.IsUnhandledException()) {
         return result.raw();
       } else {
-        I->long_jump_base()->Jump(1, Error::Cast(result));
+        thread()->long_jump_base()->Jump(1, Error::Cast(result));
         UNREACHABLE();
         return Object::null();
       }
@@ -12033,7 +12237,7 @@
 AstNode* Parser::ResolveIdentInCurrentLibraryScope(intptr_t ident_pos,
                                                    const String& ident) {
   TRACE_PARSER("ResolveIdentInCurrentLibraryScope");
-  HANDLESCOPE(I);
+  HANDLESCOPE(thread());
   const Object& obj = Object::Handle(Z, library_.ResolveName(ident));
   if (obj.IsClass()) {
     const Class& cls = Class::Cast(obj);
@@ -12080,7 +12284,7 @@
                                            const LibraryPrefix& prefix,
                                            const String& ident) {
   TRACE_PARSER("ResolveIdentInPrefixScope");
-  HANDLESCOPE(I);
+  HANDLESCOPE(thread());
   if (ident.CharAt(0) == Library::kPrivateIdentifierStart) {
     // Private names are not exported by libraries. The name mangling
     // of private names with a library-specific suffix usually ensures
@@ -12385,6 +12589,15 @@
   ASSERT(type_pos >= 0);
   ASSERT(CurrentToken() == Token::kLBRACK || CurrentToken() == Token::kINDEX);
   const intptr_t literal_pos = TokenPos();
+
+  if (is_const) {
+    Instance& existing_const = Instance::ZoneHandle(Z);
+    if (GetCachedConstant(literal_pos, &existing_const)) {
+      SkipListLiteral();
+      return new(Z) LiteralNode(literal_pos, existing_const);
+    }
+  }
+
   bool is_empty_literal = CurrentToken() == Token::kINDEX;
   ConsumeToken();
 
@@ -12452,8 +12665,8 @@
 
   if (is_const) {
     // Allocate and initialize the const list at compile time.
-    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& malformed_error = Error::Handle(Z);
@@ -12485,6 +12698,7 @@
     }
     const_list.MakeImmutable();
     const_list ^= TryCanonicalize(const_list, literal_pos);
+    CacheConstantValue(literal_pos, const_list);
     return new(Z) LiteralNode(literal_pos, const_list);
   } else {
     // Factory call at runtime.
@@ -12578,8 +12792,16 @@
   ASSERT(type_pos >= 0);
   ASSERT(CurrentToken() == Token::kLBRACE);
   const intptr_t literal_pos = TokenPos();
-  ConsumeToken();
 
+  if (is_const) {
+    Instance& existing_const = Instance::ZoneHandle(Z);
+    if (GetCachedConstant(literal_pos, &existing_const)) {
+      SkipMapLiteral();
+      return new(Z) LiteralNode(literal_pos, existing_const);
+    }
+  }
+
+  ConsumeToken();  // Opening brace.
   AbstractType& key_type = Type::ZoneHandle(Z, Type::DynamicType());
   AbstractType& value_type = Type::ZoneHandle(Z, Type::DynamicType());
   TypeArguments& map_type_arguments =
@@ -12736,6 +12958,7 @@
                    "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()));
     }
@@ -12817,29 +13040,36 @@
   ASSERT(CurrentToken() == Token::kHASH);
   ConsumeToken();
   intptr_t symbol_pos = TokenPos();
-  String& symbol = String::Handle(Z);
+  String& symbol = String::ZoneHandle(Z);
   if (IsIdentifier()) {
     symbol = CurrentLiteral()->raw();
     ConsumeToken();
+    GrowableHandlePtrArray<const String> pieces(Z, 3);
+    pieces.Add(symbol);
     while (CurrentToken() == Token::kPERIOD) {
-      symbol = String::Concat(symbol, Symbols::Dot());
+      pieces.Add(Symbols::Dot());
       ConsumeToken();
-      symbol = String::Concat(symbol,
-                              *ExpectIdentifier("identifier expected"));
+      pieces.Add(*ExpectIdentifier("identifier expected"));
     }
+    symbol = Symbols::FromConcatAll(pieces);
   } else if (Token::CanBeOverloaded(CurrentToken())) {
-    symbol = String::New(Token::Str(CurrentToken()));
+    symbol = Symbols::New(Token::Str(CurrentToken()));
     ConsumeToken();
   } else {
     ReportError("illegal symbol literal");
   }
+  ASSERT(symbol.IsSymbol());
+
+  Instance& symbol_instance = Instance::ZoneHandle(Z);
+  if (GetCachedConstant(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, String::ZoneHandle(Z, Symbols::New(symbol))));
+  constr_args->Add(new(Z) LiteralNode(symbol_pos, symbol));
   const Function& constr = Function::ZoneHandle(Z,
       symbol_class.LookupConstructor(Symbols::SymbolCtor()));
   ASSERT(!constr.IsNull());
@@ -12853,9 +13083,9 @@
                  script_, symbol_pos,
                  "error executing const Symbol constructor");
   }
-  const Instance& instance = Instance::Cast(result);
-  return new(Z) LiteralNode(symbol_pos,
-                            Instance::ZoneHandle(Z, instance.raw()));
+  symbol_instance ^= result.raw();
+  CacheConstantValue(symbol_pos, symbol_instance);
+  return new(Z) LiteralNode(symbol_pos, symbol_instance);
 }
 
 
@@ -12900,14 +13130,13 @@
     library_.AddClass(sig_cls);
   }
   closure.set_signature_class(sig_cls);
+  // Finalize types in signature class here, so that the
+  // signature type is not computed twice.
+  ClassFinalizer::FinalizeTypesInClass(sig_cls);
   const Type& sig_type = Type::Handle(Z, sig_cls.SignatureType());
-  if (!sig_type.IsFinalized()) {
-    // Finalization would be premature when top-level parsing.
-    ASSERT(!is_top_level_);
-    ClassFinalizer::FinalizeType(sig_cls,
-                                 sig_type,
-                                 ClassFinalizer::kCanonicalize);
-  }
+  ASSERT(sig_type.IsFinalized());
+  // Finalization would be premature when top-level parsing.
+  ASSERT(!is_top_level_);
   return closure.raw();
 }
 
@@ -12919,9 +13148,10 @@
   // unnamed constructor for class 'A' is labeled 'A.'.
   // This convention prevents users from explicitly calling constructors.
   String& constructor_name =
-      String::Handle(String::Concat(type_class_name, Symbols::Dot()));
+      String::Handle(Symbols::FromConcat(type_class_name, Symbols::Dot()));
   if (named_constructor != NULL) {
-    constructor_name = String::Concat(constructor_name, *named_constructor);
+    constructor_name =
+        Symbols::FromConcat(constructor_name, *named_constructor);
   }
   return constructor_name;
 }
@@ -12972,7 +13202,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, Heap::kOld);
         ASSERT(error.IsNull());
       }
       *type_arguments = type.arguments();
@@ -13134,7 +13364,11 @@
         // 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);
+        redirect_type ^= redirect_type.InstantiateFrom(
+            type_arguments,
+            &error,
+            NULL,  // trail
+            Heap::kOld);
         if (!error.IsNull()) {
           redirect_type = ClassFinalizer::NewFinalizedMalformedType(
               error,
@@ -13172,7 +13406,8 @@
         }
         return ThrowTypeError(redirect_type.token_pos(), redirect_type);
       }
-      if (I->flags().type_checks() && !redirect_type.IsSubtypeOf(type, NULL)) {
+      if (I->flags().type_checks() &&
+              !redirect_type.IsSubtypeOf(type, NULL, Heap::kOld)) {
         // Additional type checking of the result is necessary.
         type_bound = type.raw();
       }
@@ -13278,41 +13513,43 @@
                   "const object creation",
                   external_constructor_name.ToCString());
     }
-    const 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,
-                   "error while evaluating const constructor");
+
+    Instance& const_instance = Instance::ZoneHandle(Z);
+    if (GetCachedConstant(new_pos, &const_instance)) {
+      // Cache hit, nothing else to do.
     } else {
-      // Const constructors can return null in the case where a const native
-      // factory returns a null value. Thus we cannot use a Instance::Cast here.
-      Instance& const_instance = Instance::Handle(Z);
-      const_instance ^= constructor_result.raw();
-      new_object = new(Z) LiteralNode(
-          new_pos, Instance::ZoneHandle(Z, const_instance.raw()));
-      if (!type_bound.IsNull()) {
-        ASSERT(!type_bound.IsMalformed());
-        Error& malformed_error = Error::Handle(Z);
-        ASSERT(!is_top_level_);  // We cannot check unresolved types.
-        if (!const_instance.IsInstanceOf(type_bound,
-                                         TypeArguments::Handle(Z),
-                                         &malformed_error)) {
-          type_bound = ClassFinalizer::NewFinalizedMalformedType(
-              malformed_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);
-        }
-        type_bound = AbstractType::null();
+      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,
+                     "error while evaluating const constructor");
       }
+      const_instance ^= constructor_result.raw();
+      CacheConstantValue(new_pos, const_instance);
+    }
+    new_object = new(Z) LiteralNode(new_pos, const_instance);
+    if (!type_bound.IsNull()) {
+      ASSERT(!type_bound.IsMalformed());
+      Error& malformed_error = Error::Handle(Z);
+      ASSERT(!is_top_level_);  // We cannot check unresolved types.
+      if (!const_instance.IsInstanceOf(type_bound,
+                                       TypeArguments::Handle(Z),
+                                       &malformed_error)) {
+        type_bound = ClassFinalizer::NewFinalizedMalformedType(
+            malformed_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);
+      }
+      type_bound = AbstractType::null();
     }
   } else {
     CheckConstructorCallTypeArguments(new_pos, constructor, type_arguments);
@@ -13344,22 +13581,20 @@
   ASSERT(!func.IsNull());
 
   // Build the array of literal values to interpolate.
-  const Array& value_arr = Array::Handle(Z, Array::New(values.length()));
+  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());
   }
 
   // Build argument array to pass to the interpolation function.
-  const Array& interpolate_arg = Array::Handle(Z, Array::New(1));
+  const Array& interpolate_arg = Array::Handle(Z, Array::New(1, Heap::kOld));
   interpolate_arg.SetAt(0, value_arr);
 
   // Call interpolation function.
   Object& result = Object::Handle(Z);
-  {
-    PAUSETIMERSCOPE(I, time_compilation);
-    result = DartEntry::InvokeFunction(func, interpolate_arg);
-  }
+  result = DartEntry::InvokeFunction(func, interpolate_arg);
   if (result.IsUnhandledException()) {
     ReportError("%s", Error::Cast(result).ToErrorCString());
   }
@@ -13391,6 +13626,16 @@
     return primary;
   }
   // String interpolation needed.
+
+  // First, check whether we've cached a compile-time constant for this
+  // string interpolation.
+  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()));
+  }
+
   bool is_compiletime_const = true;
   bool has_interpolation = false;
   GrowableArray<AstNode*> values_list;
@@ -13443,18 +13688,20 @@
   }
   if (is_compiletime_const) {
     if (has_interpolation) {
-      primary = new(Z) LiteralNode(literal_start, Interpolate(values_list));
+      const String& interpolated_string = Interpolate(values_list);
+      primary = new(Z) LiteralNode(literal_start, interpolated_string);
+      CacheConstantValue(literal_start, interpolated_string);
     } else {
-      const Array& strings = Array::Handle(Z, Array::New(values_list.length()));
+      GrowableHandlePtrArray<const String> pieces(Z, values_list.length());
       for (int i = 0; i < values_list.length(); i++) {
         const Instance& part = values_list[i]->AsLiteralNode()->literal();
         ASSERT(part.IsString());
-        strings.SetAt(i, String::Cast(part));
+        pieces.Add(String::Cast(part));
       }
-      String& lit = String::ZoneHandle(Z,
-                                       String::ConcatAll(strings, Heap::kOld));
-      lit = Symbols::New(lit);
+      const String& lit = String::ZoneHandle(Z, Symbols::FromConcatAll(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(
@@ -13536,10 +13783,12 @@
           // 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.
-          String& qualified_name = String::ZoneHandle(Z, prefix.name());
-          qualified_name = String::Concat(qualified_name, Symbols::Dot());
-          qualified_name = String::Concat(qualified_name, ident);
-          qualified_name = Symbols::New(qualified_name);
+          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(pieces));
           InvocationMirror::Type call_type =
               CurrentToken() == Token::kLPAREN ?
                   InvocationMirror::kMethod : InvocationMirror::kGetter;
@@ -13555,8 +13804,7 @@
         // primary != NULL.
         String& qualified_name = String::ZoneHandle(Z, prefix.name());
         qualified_name = String::Concat(qualified_name, Symbols::Dot());
-        qualified_name = String::Concat(qualified_name, ident);
-        qualified_name = Symbols::New(qualified_name);
+        qualified_name = Symbols::FromConcat(qualified_name, ident);
         InvocationMirror::Type call_type =
             CurrentToken() == Token::kLPAREN ?
                 InvocationMirror::kMethod : InvocationMirror::kGetter;
@@ -13637,16 +13885,6 @@
       ReportError("class '%s' does not have a superclass",
                   String::Handle(Z, current_class().Name()).ToCString());
     }
-    if (!FLAG_supermixin) {
-      if (current_class().IsMixinApplication()) {
-        const Type& mixin_type = Type::Handle(Z, current_class().mixin());
-        if (mixin_type.type_class() == current_function().origin()) {
-          ReportError("method of mixin class '%s' may not refer to 'super'",
-                      String::Handle(Z, Class::Handle(Z,
-                          current_function().origin()).Name()).ToCString());
-        }
-      }
-    }
     const intptr_t super_pos = TokenPos();
     ConsumeToken();
     if (CurrentToken() == Token::kPERIOD) {
@@ -13687,9 +13925,9 @@
     // We already checked that this field is const and has been
     // initialized.
     ASSERT(field.is_const());
-    ASSERT(field.value() != Object::sentinel().raw());
-    ASSERT(field.value() != Object::transition_sentinel().raw());
-    return Instance::ZoneHandle(Z, field.value());
+    ASSERT(field.StaticValue() != Object::sentinel().raw());
+    ASSERT(field.StaticValue() != Object::transition_sentinel().raw());
+    return Instance::ZoneHandle(Z, field.StaticValue());
   } else {
     ASSERT(expr->EvalConstExpr() != NULL);
     ReturnNode* ret = new(Z) ReturnNode(expr->token_pos(), expr);
diff --git a/runtime/vm/parser.h b/runtime/vm/parser.h
index 5199cb6..433a0c4 100644
--- a/runtime/vm/parser.h
+++ b/runtime/vm/parser.h
@@ -35,7 +35,7 @@
 struct MemberDesc;
 struct ParamList;
 struct QualIdent;
-struct TopLevel;
+class TopLevel;
 
 // The class ParsedFunction holds the result of parsing a function.
 class ParsedFunction : public ZoneAllocated {
@@ -47,12 +47,12 @@
         node_sequence_(NULL),
         regexp_compile_data_(NULL),
         instantiator_(NULL),
-        default_parameter_values_(Array::ZoneHandle(zone(), Array::null())),
         current_context_var_(NULL),
         expression_temp_var_(NULL),
         finally_return_temp_var_(NULL),
         deferred_prefixes_(new ZoneGrowableArray<const LibraryPrefix*>()),
         guarded_fields_(new ZoneGrowableArray<const Field*>()),
+        default_parameter_values_(NULL),
         first_parameter_index_(0),
         first_stack_local_index_(0),
         num_copied_params_(0),
@@ -85,13 +85,24 @@
     instantiator_ = instantiator;
   }
 
-  const Array& default_parameter_values() const {
-    return default_parameter_values_;
+  void set_default_parameter_values(ZoneGrowableArray<const Instance*>* list) {
+    default_parameter_values_ = list;
+#if defined(DEBUG)
+    if (list == NULL) return;
+    for (intptr_t i = 0; i < list->length(); i++) {
+      ASSERT(list->At(i)->IsZoneHandle() || list->At(i)->InVMHeap());
+    }
+#endif
   }
-  void set_default_parameter_values(const Array& default_parameter_values) {
-    ASSERT(default_parameter_values.IsZoneHandle() ||
-           default_parameter_values.InVMHeap());
-    default_parameter_values_ = default_parameter_values.raw();
+
+
+  const Instance& DefaultParameterValueAt(intptr_t i) const {
+    ASSERT(default_parameter_values_ != NULL);
+    return *default_parameter_values_->At(i);
+  }
+
+  ZoneGrowableArray<const Instance*>* default_parameter_values() const {
+    return default_parameter_values_;
   }
 
   LocalVariable* current_context_var() const {
@@ -150,6 +161,7 @@
   void record_await() { have_seen_await_expr_ = true; }
   bool have_seen_await() const { return have_seen_await_expr_; }
 
+  Thread* thread() const { return thread_; }
   Isolate* isolate() const { return thread_->isolate(); }
   Zone* zone() const { return thread_->zone(); }
 
@@ -160,12 +172,12 @@
   SequenceNode* node_sequence_;
   RegExpCompileData* regexp_compile_data_;
   LocalVariable* instantiator_;
-  Array& default_parameter_values_;
   LocalVariable* current_context_var_;
   LocalVariable* expression_temp_var_;
   LocalVariable* finally_return_temp_var_;
   ZoneGrowableArray<const LibraryPrefix*>* deferred_prefixes_;
   ZoneGrowableArray<const Field*>* guarded_fields_;
+  ZoneGrowableArray<const Instance*>* default_parameter_values_;
 
   int first_parameter_index_;
   int first_stack_local_index_;
@@ -199,10 +211,6 @@
   // given static field.
   static ParsedFunction* ParseStaticFieldInitializer(const Field& field);
 
-  // Returns a RawFunction or RawError.
-  static RawObject* ParseFunctionFromSource(const Class& owning_class,
-                                            const String& source);
-
   // Parse a function to retrieve parameter information that is not retained in
   // the dart::Function object. Returns either an error if the parse fails
   // (which could be the case for local functions), or a flat array of entries
@@ -291,7 +299,6 @@
     if (token_kind_ == Token::kILLEGAL) {
       ComputeCurrentToken();
     }
-    INC_STAT(isolate_, num_token_checks, 1);
     return token_kind_;
   }
 
@@ -311,7 +318,7 @@
     // Reset cache and advance the token.
     token_kind_ = Token::kILLEGAL;
     tokens_iterator_.Advance();
-    INC_STAT(isolate_, num_tokens_consumed, 1);
+    INC_STAT(thread(), num_tokens_consumed, 1);
   }
   void ConsumeRightAngleBracket();
   void CheckToken(Token::Kind token_expected, const char* msg = NULL);
@@ -387,7 +394,7 @@
                                           const TypeArguments& type_arguments,
                                           const Function& constructor,
                                           ArgumentListNode* arguments);
-  AstNode* FoldConstExpr(intptr_t expr_pos, AstNode* expr);
+  LiteralNode* FoldConstExpr(intptr_t expr_pos, AstNode* expr);
 
   // Support for parsing of scripts.
   void ParseTopLevel();
@@ -469,12 +476,15 @@
       AstNode* instance,
       Field* field,
       AstNode* init_value);
-  void GenerateSuperConstructorCall(const Class& cls,
-                                    intptr_t supercall_pos,
-                                    LocalVariable* receiver,
-                                    AstNode* phase_parameter,
-                                    ArgumentListNode* forwarding_args);
-  AstNode* ParseSuperInitializer(const Class& cls, LocalVariable* receiver);
+  StaticCallNode* GenerateSuperConstructorCall(
+      const Class& cls,
+      intptr_t supercall_pos,
+      LocalVariable* receiver,
+      AstNode* phase_parameter,
+      ArgumentListNode* forwarding_args);
+  StaticCallNode* ParseSuperInitializer(
+      const Class& cls,
+      LocalVariable* receiver);
   AstNode* ParseInitializer(const Class& cls,
                             LocalVariable* receiver,
                             GrowableArray<Field*>* initialized_fields);
@@ -511,8 +521,7 @@
 
   static bool ParseFormalParameters(const Function& func, ParamList* params);
 
-  static void SetupDefaultsForOptionalParams(const ParamList* params,
-                                             Array* default_values);
+  void SetupDefaultsForOptionalParams(const ParamList& params);
   ClosureNode* CreateImplicitClosureNode(const Function& func,
                                          intptr_t token_pos,
                                          AstNode* receiver);
@@ -520,10 +529,8 @@
                                         const Function& func);
   void AddFormalParamsToScope(const ParamList* params, LocalScope* scope);
 
-  SequenceNode* ParseConstructor(const Function& func,
-                                 Array* default_parameter_values);
-  SequenceNode* ParseFunc(const Function& func,
-                          Array* default_parameter_values);
+  SequenceNode* ParseConstructor(const Function& func);
+  SequenceNode* ParseFunc(const Function& func);
 
   void ParseNativeFunctionBlock(const ParamList* params, const Function& func);
 
@@ -532,18 +539,13 @@
   SequenceNode* ParseStaticFinalGetter(const Function& func);
   SequenceNode* ParseStaticInitializer();
   SequenceNode* ParseMethodExtractor(const Function& func);
-  SequenceNode* ParseNoSuchMethodDispatcher(const Function& func,
-                                            Array* default_values);
-  SequenceNode* ParseInvokeFieldDispatcher(const Function& func,
-                                           Array* default_values);
-  SequenceNode* ParseImplicitClosure(const Function& func,
-                                     Array* default_values);
-  SequenceNode* ParseConstructorClosure(const Function& func,
-                                        Array* default_values);
+  SequenceNode* ParseNoSuchMethodDispatcher(const Function& func);
+  SequenceNode* ParseInvokeFieldDispatcher(const Function& func);
+  SequenceNode* ParseImplicitClosure(const Function& func);
+  SequenceNode* ParseConstructorClosure(const Function& func);
 
   void BuildDispatcherScope(const Function& func,
-                            const ArgumentsDescriptor& desc,
-                            Array* default_values);
+                            const ArgumentsDescriptor& desc);
 
   void EnsureHasReturnStatement(SequenceNode* seq, intptr_t return_pos);
   void ChainNewBlock(LocalScope* outer_scope);
@@ -816,7 +818,10 @@
                             ArgumentListNode* arguments);
 
   RawInstance* TryCanonicalize(const Instance& instance, intptr_t token_pos);
+  void CacheConstantValue(intptr_t token_pos, const Instance& value);
+  bool GetCachedConstant(intptr_t token_pos, Instance* value);
 
+  Thread* thread() const { return thread_; }
   Isolate* isolate() const { return isolate_; }
   Zone* zone() const { return thread_->zone(); }
 
diff --git a/runtime/vm/port_test.cc b/runtime/vm/port_test.cc
index 34272d1..165d19c 100644
--- a/runtime/vm/port_test.cc
+++ b/runtime/vm/port_test.cc
@@ -38,7 +38,7 @@
     notify_count++;
   }
 
-  bool HandleMessage(Message* message) { return true; }
+  MessageStatus HandleMessage(Message* message) { return kOK; }
 
   int notify_count;
 };
diff --git a/runtime/vm/precompiler.cc b/runtime/vm/precompiler.cc
index 52287f3..f061da0 100644
--- a/runtime/vm/precompiler.cc
+++ b/runtime/vm/precompiler.cc
@@ -4,8 +4,10 @@
 
 #include "vm/precompiler.h"
 
+#include "vm/code_patcher.h"
 #include "vm/compiler.h"
 #include "vm/isolate.h"
+#include "vm/log.h"
 #include "vm/longjump.h"
 #include "vm/object.h"
 #include "vm/object_store.h"
@@ -23,15 +25,17 @@
 
 
 static void Jump(const Error& error) {
-  Isolate::Current()->long_jump_base()->Jump(1, error);
+  Thread::Current()->long_jump_base()->Jump(1, error);
 }
 
 
-RawError* Precompiler::CompileAll() {
+RawError* Precompiler::CompileAll(
+    Dart_QualifiedFunctionName embedder_entry_points[],
+    bool reset_fields) {
   LongJumpScope jump;
   if (setjmp(*jump.Set()) == 0) {
-    Precompiler precompiler(Thread::Current());
-    precompiler.DoCompileAll();
+    Precompiler precompiler(Thread::Current(), reset_fields);
+    precompiler.DoCompileAll(embedder_entry_points);
     return Error::null();
   } else {
     Isolate* isolate = Isolate::Current();
@@ -42,29 +46,35 @@
 }
 
 
-Precompiler::Precompiler(Thread* thread) :
-  thread_(thread),
-  zone_(thread->zone()),
-  isolate_(thread->isolate()),
-  changed_(false),
-  function_count_(0),
-  class_count_(0),
-  libraries_(GrowableObjectArray::Handle(Z, I->object_store()->libraries())),
-  pending_functions_(GrowableObjectArray::Handle(Z,
-                                                 GrowableObjectArray::New())),
-  collected_closures_(GrowableObjectArray::Handle(Z, I->collected_closures())),
-  sent_selectors_(GrowableObjectArray::Handle(Z, GrowableObjectArray::New())),
-  error_(Error::Handle(Z)) {
+Precompiler::Precompiler(Thread* thread, bool reset_fields) :
+    thread_(thread),
+    zone_(thread->zone()),
+    isolate_(thread->isolate()),
+    reset_fields_(reset_fields),
+    changed_(false),
+    function_count_(0),
+    class_count_(0),
+    selector_count_(0),
+    dropped_function_count_(0),
+    libraries_(GrowableObjectArray::Handle(Z, I->object_store()->libraries())),
+    pending_functions_(
+        GrowableObjectArray::Handle(Z, GrowableObjectArray::New())),
+    collected_closures_(
+        GrowableObjectArray::Handle(Z, GrowableObjectArray::New())),
+    sent_selectors_(),
+    error_(Error::Handle(Z)) {
+  I->set_collected_closures(collected_closures_);
 }
 
 
-void Precompiler::DoCompileAll() {
+void Precompiler::DoCompileAll(
+    Dart_QualifiedFunctionName embedder_entry_points[]) {
   // Drop all existing code so we can use the presence of code as an indicator
   // that we have already looked for the function's callees.
   ClearAllCode();
 
   // Start with the allocations and invocations that happen from C++.
-  AddRoots();
+  AddRoots(embedder_entry_points);
 
   // TODO(rmacnak): Eagerly add field-invocation functions to all signature
   // classes so closure calls don't go through the runtime.
@@ -76,11 +86,12 @@
   CleanUp();
 
   if (FLAG_trace_precompiler) {
-    OS::Print("Precompiled %" Pd " functions, %" Pd " dynamic types,"
-              " %" Pd " dynamic selectors\n",
+    THR_Print("Precompiled %" Pd " functions, %" Pd " dynamic types,"
+              " %" Pd " dynamic selectors.\n Dropped %" Pd " functions.\n",
               function_count_,
               class_count_,
-              sent_selectors_.Length());
+              selector_count_,
+              dropped_function_count_);
   }
 
   I->set_compilation_allowed(false);
@@ -88,39 +99,17 @@
 
 
 void Precompiler::ClearAllCode() {
-  Library& lib = Library::Handle(Z);
-  Class& cls = Class::Handle(Z);
-  Array& functions = Array::Handle(Z);
-  Function& function = Function::Handle(Z);
-
-  for (intptr_t i = 0; i < libraries_.Length(); i++) {
-    lib ^= libraries_.At(i);
-    ClassDictionaryIterator it(lib, ClassDictionaryIterator::kIteratePrivate);
-    while (it.HasNext()) {
-      cls = it.GetNextClass();
-      error_ = cls.EnsureIsFinalized(I);
-      if (!error_.IsNull()) {
-        Jump(error_);
-      }
+  class CodeCodeFunctionVisitor : public FunctionVisitor {
+    void VisitFunction(const Function& function) {
+      function.ClearCode();
     }
-  }
-
-  for (intptr_t i = 0; i < libraries_.Length(); i++) {
-    lib ^= libraries_.At(i);
-    ClassDictionaryIterator it(lib, ClassDictionaryIterator::kIteratePrivate);
-    while (it.HasNext()) {
-      cls = it.GetNextClass();
-      functions = cls.functions();
-      for (intptr_t i = 0; i < functions.Length(); i++) {
-        function ^= functions.At(i);
-        function.ClearCode();
-      }
-    }
-  }
+  };
+  CodeCodeFunctionVisitor visitor;
+  VisitFunctions(&visitor);
 }
 
 
-void Precompiler::AddRoots() {
+void Precompiler::AddRoots(Dart_QualifiedFunctionName embedder_entry_points[]) {
   // Note that <rootlibrary>.main is not a root. The appropriate main will be
   // discovered through _getMainClosure.
 
@@ -195,82 +184,66 @@
     AddClass(cls);
   }
 
-  static const struct {
-    const char* library_;
-    const char* class_;
-    const char* function_;
-  } kExternallyCalled[] = {
-    { "dart:_builtin", "::", "_getMainClosure" },
-    { "dart:_builtin", "::", "_getPrintClosure" },
-    { "dart:_builtin", "::", "_getUriBaseClosure" },
-    { "dart:_builtin", "::", "_resolveUri" },
-    { "dart:_builtin", "::", "_setWorkingDirectory" },
+  Dart_QualifiedFunctionName vm_entry_points[] = {
     { "dart:async", "::", "_setScheduleImmediateClosure" },
+    { "dart:core", "AbstractClassInstantiationError",
+                   "AbstractClassInstantiationError._create" },
+    { "dart:core", "ArgumentError", "ArgumentError." },
+    { "dart:core", "AssertionError", "AssertionError." },
+    { "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", "_CastError", "_CastError._create" },
     { "dart:core", "_InternalError", "_InternalError." },
     { "dart:core", "_InvocationMirror", "_allocateInvocationMirror" },
-    { "dart:io", "::", "_makeUint8ListView" },
-    { "dart:io", "::", "_makeDatagram" },
-    { "dart:io", "CertificateException", "CertificateException." },
-    { "dart:io", "HandshakeException", "HandshakeException." },
-    { "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:core", "_JavascriptCompatibilityError",
+                   "_JavascriptCompatibilityError." },
+    { "dart:core", "_JavascriptIntegerOverflowError",
+                   "_JavascriptIntegerOverflowError." },
+    { "dart:core", "_TypeError", "_TypeError._create" },
+    { "dart:isolate", "IsolateSpawnException", "IsolateSpawnException." },
+    { "dart:isolate", "_IsolateUnhandledException",
+                      "_IsolateUnhandledException." },
     { "dart:isolate", "::", "_getIsolateScheduleImmediateClosure" },
+    { "dart:isolate", "::", "_setupHooks" },
     { "dart:isolate", "::", "_startMainIsolate" },
     { "dart:isolate", "_RawReceivePortImpl", "_handleMessage" },
     { "dart:isolate", "_RawReceivePortImpl", "_lookupHandler" },
     { "dart:vmservice", "::", "_registerIsolate" },
     { "dart:vmservice", "::", "boot" },
-    { "dart:vmservice_io", "::", "_addResource" },
-    { "dart:vmservice_io", "::", "main" },
-
-    // Cf. Exceptions::Create
-    { "dart:core", "RangeError", "RangeError." },
-    { "dart:core", "RangeError", "RangeError.range" },
-    { "dart:core", "ArgumentError", "ArgumentError." },
-    { "dart:core", "NoSuchMethodError", "NoSuchMethodError._withType" },
-    { "dart:core", "FormatException", "FormatException." },
-    { "dart:core", "UnsupportedError", "UnsupportedError." },
-    { "dart:core", "NullThrownError", "NullThrownError." },
-    { "dart:isolate", "IsolateSpawnException", "IsolateSpawnException." },
-    { "dart:isolate", "_IsolateUnhandledException",
-                      "_IsolateUnhandledException." },
-    { "dart:core", "_JavascriptIntegerOverflowError",
-                   "_JavascriptIntegerOverflowError." },
-    { "dart:core", "_JavascriptCompatibilityError",
-                   "_JavascriptCompatibilityError." },
-    { "dart:core", "AssertionError", "AssertionError." },
-    { "dart:core", "_CastError", "_CastError._create" },
-    { "dart:core", "_TypeError", "_TypeError._create" },
-    { "dart:core", "FallThroughError", "FallThroughError._create" },
-    { "dart:core", "AbstractClassInstantiationError",
-                   "AbstractClassInstantiationError._create" },
-    { "dart:core", "CyclicInitializationError",
-                   "CyclicInitializationError." },
-    { "dart:core", "StackOverflowError", "StackOverflowError." },
-    { "dart:core", "OutOfMemoryError", "OutOfMemoryError." },
-    { NULL, NULL, NULL }
+    { NULL, NULL, NULL }  // Must be terminated with NULL entries.
   };
 
+  AddEntryPoints(vm_entry_points);
+  AddEntryPoints(embedder_entry_points);
+}
+
+
+void Precompiler::AddEntryPoints(Dart_QualifiedFunctionName entry_points[]) {
   Library& lib = Library::Handle(Z);
+  Class& cls = Class::Handle(Z);
   Function& func = Function::Handle(Z);
-  String& library_name = String::Handle(Z);
+  String& library_uri = String::Handle(Z);
   String& class_name = String::Handle(Z);
   String& function_name = String::Handle(Z);
-  for (intptr_t i = 0; kExternallyCalled[i].library_ != NULL; i++) {
-    library_name = Symbols::New(kExternallyCalled[i].library_);
-    class_name = Symbols::New(kExternallyCalled[i].class_);
-    function_name = Symbols::New(kExternallyCalled[i].function_);
 
-    lib = Library::LookupLibrary(library_name);
+  for (intptr_t i = 0; entry_points[i].library_uri != NULL; i++) {
+    library_uri = Symbols::New(entry_points[i].library_uri);
+    class_name = Symbols::New(entry_points[i].class_name);
+    function_name = Symbols::New(entry_points[i].function_name);
+
+    lib = Library::LookupLibrary(library_uri);
     if (lib.IsNull()) {
       if (FLAG_trace_precompiler) {
-        OS::Print("WARNING: Missing %s\n", kExternallyCalled[i].library_);
+        THR_Print("WARNING: Missing %s\n", entry_points[i].library_uri);
       }
       continue;
     }
@@ -281,9 +254,9 @@
       cls = lib.LookupClassAllowPrivate(class_name);
       if (cls.IsNull()) {
         if (FLAG_trace_precompiler) {
-          OS::Print("WARNING: Missing %s %s\n",
-                    kExternallyCalled[i].library_,
-                    kExternallyCalled[i].class_);
+          THR_Print("WARNING: Missing %s %s\n",
+                    entry_points[i].library_uri,
+                    entry_points[i].class_name);
         }
         continue;
       }
@@ -294,10 +267,10 @@
 
     if (func.IsNull()) {
       if (FLAG_trace_precompiler) {
-        OS::Print("WARNING: Missing %s %s %s\n",
-                  kExternallyCalled[i].library_,
-                  kExternallyCalled[i].class_,
-                  kExternallyCalled[i].function_);
+        THR_Print("WARNING: Missing %s %s %s\n",
+                  entry_points[i].library_uri,
+                  entry_points[i].class_name,
+                  entry_points[i].function_name);
       }
       continue;
     }
@@ -333,7 +306,13 @@
 void Precompiler::CleanUp() {
   I->set_collected_closures(GrowableObjectArray::Handle(Z));
 
-  // TODO(rmacnak): Drop functions without code, classes without functions, etc.
+  DropUncompiledFunctions();
+
+  // TODO(rmacnak): DropEmptyClasses();
+
+  BindStaticCalls();
+
+  DedupStackmaps();
 }
 
 
@@ -342,7 +321,7 @@
     function_count_++;
 
     if (FLAG_trace_precompiler) {
-      OS::Print("Precompiling %" Pd " %s (%" Pd ", %s)\n",
+      THR_Print("Precompiling %" Pd " %s (%" Pd ", %s)\n",
                 function_count_,
                 function.ToLibNamePrefixedQualifiedCString(),
                 function.token_pos(),
@@ -407,6 +386,10 @@
           // A dynamic call.
           selector = call_site.target_name();
           AddSelector(selector);
+          if (selector.raw() == Symbols::Call().raw()) {
+            // Potential closure call.
+            AddClosureCall(call_site);
+          }
         }
       } else if (entry.IsField()) {
         // Potential need for field initializer.
@@ -422,23 +405,48 @@
 }
 
 
+void Precompiler::AddClosureCall(const ICData& call_site) {
+  const Array& arguments_descriptor =
+      Array::Handle(Z, call_site.arguments_descriptor());
+  const Type& function_impl =
+      Type::Handle(Z, I->object_store()->function_impl_type());
+  const Class& cache_class =
+      Class::Handle(Z, function_impl.type_class());
+  const Function& dispatcher = Function::Handle(Z,
+      cache_class.GetInvocationDispatcher(Symbols::Call(),
+                                          arguments_descriptor,
+                                          RawFunction::kInvokeFieldDispatcher,
+                                          true /* create_if_absent */));
+  AddFunction(dispatcher);
+}
+
+
 void Precompiler::AddField(const Field& field) {
   if (field.is_static()) {
     // Potential const object. Uninitialized field will harmlessly do a
     // redundant add of the Null class.
-    const Object& value = Object::Handle(Z, field.value());
+    const Object& value = Object::Handle(Z, field.StaticValue());
     const Class& cls = Class::Handle(Z, value.clazz());
     AddClass(cls);
 
     if (field.has_initializer()) {
-      if (field.initializer() != Function::null()) return;
+      // Should not be in the middle of initialization while precompiling.
+      ASSERT(value.raw() != Object::transition_sentinel().raw());
+
+      const bool is_initialized = value.raw() != Object::sentinel().raw();
+      if (is_initialized && !reset_fields_) return;
+
+      if (field.HasPrecompiledInitializer()) return;
 
       if (FLAG_trace_precompiler) {
-        OS::Print("Precompiling initializer for %s\n", field.ToCString());
+        THR_Print("Precompiling initializer for %s\n", field.ToCString());
       }
+      ASSERT(!Dart::IsRunningPrecompiledCode());
+      field.SetStaticValue(Instance::Handle(field.SavedInitialStaticValue()));
       Compiler::CompileStaticInitializer(field);
 
-      const Function& function = Function::Handle(Z, field.initializer());
+      const Function& function =
+          Function::Handle(Z, field.PrecompiledInitializer());
       AddCalleesOf(function);
     }
   }
@@ -454,37 +462,25 @@
 
 
 bool Precompiler::IsSent(const String& selector) {
-  ASSERT(selector.IsSymbol());
-
-  // TODO(rmacnak): Use a proper set.
-  for (intptr_t i = 0; i < sent_selectors_.Length(); i++) {
-    if (sent_selectors_.At(i) == selector.raw()) {
-      return true;
-    }
+  if (selector.IsNull()) {
+    return false;
   }
-
-  return false;
+  return sent_selectors_.Lookup(&selector) != NULL;
 }
 
 
 void Precompiler::AddSelector(const String& selector) {
-  if (!IsSent(selector)) {
-    if (FLAG_trace_precompiler) {
-      OS::Print("Enqueueing selector %" Pd " %s\n",
-                sent_selectors_.Length(),
-                selector.ToCString());
-    }
+  ASSERT(!selector.IsNull());
 
-    sent_selectors_.Add(selector);
+  if (!IsSent(selector)) {
+    sent_selectors_.Insert(&String::ZoneHandle(Z, selector.raw()));
+    selector_count_++;
     changed_ = true;
 
-    if (!Field::IsGetterName(selector) &&
-        !Field::IsSetterName(selector)) {
-      // Regular method may be call-through-getter.
-      // TODO(rmacnak): Do not create the symbol if it does not already exist.
-      String& getter = String::Handle(Field::GetterName(selector));
-      getter = Symbols::New(getter);
-      AddSelector(getter);
+    if (FLAG_trace_precompiler) {
+      THR_Print("Enqueueing selector %" Pd " %s\n",
+                selector_count_,
+                selector.ToCString());
     }
   }
 }
@@ -498,7 +494,7 @@
   changed_ = true;
 
   if (FLAG_trace_precompiler) {
-    OS::Print("Allocation %" Pd " %s\n", class_count_, cls.ToCString());
+    THR_Print("Allocation %" Pd " %s\n", class_count_, cls.ToCString());
   }
 
   const Class& superclass = Class::Handle(cls.SuperClass());
@@ -513,7 +509,10 @@
   Class& cls = Class::Handle(Z);
   Array& functions = Array::Handle(Z);
   Function& function = Function::Handle(Z);
+  Function& function2 = Function::Handle(Z);
   String& selector = String::Handle(Z);
+  String& selector2 = String::Handle(Z);
+  String& selector3 = String::Handle(Z);
 
   for (intptr_t i = 0; i < libraries_.Length(); i++) {
     lib ^= libraries_.At(i);
@@ -574,17 +573,251 @@
           AddFunction(function);
         }
 
-        if (function.kind() == RawFunction::kRegularFunction &&
-            !Field::IsGetterName(selector) &&
-            !Field::IsSetterName(selector)) {
-          // TODO(rmacnak): Do not create the symbol if it does not already
-          // exist.
-          selector = Field::GetterName(selector);
-          selector = Symbols::New(selector);
-          if (IsSent(selector)) {
-            function = function.ImplicitClosureFunction();
+        // Handle the implicit call type conversions.
+        if (Field::IsGetterName(selector)) {
+          selector2 = Field::NameFromGetter(selector);
+          selector3 = Symbols::Lookup(selector2);
+          if (IsSent(selector2)) {
+            // Call-through-getter.
+            // Function is get:foo and somewhere foo is called.
             AddFunction(function);
           }
+          selector3 = Symbols::LookupFromConcat(Symbols::ClosurizePrefix(),
+                                                selector2);
+          if (IsSent(selector3)) {
+            // Hash-closurization.
+            // Function is get:foo and somewhere get:#foo is called.
+            AddFunction(function);
+
+            function2 = function.ImplicitClosureFunction();
+            AddFunction(function2);
+          }
+        } else if (Field::IsSetterName(selector)) {
+          selector2 = Symbols::LookupFromConcat(Symbols::ClosurizePrefix(),
+                                                selector);
+          if (IsSent(selector2)) {
+            // Hash-closurization.
+            // Function is set:foo and somewhere get:#set:foo is called.
+            AddFunction(function);
+
+            function2 = function.ImplicitClosureFunction();
+            AddFunction(function2);
+          }
+        } else if (function.kind() == RawFunction::kRegularFunction) {
+          selector2 = Field::LookupGetterSymbol(selector);
+          if (IsSent(selector2)) {
+            // Closurization.
+            // Function is foo and somewhere get:foo is called.
+            function2 = function.ImplicitClosureFunction();
+            AddFunction(function2);
+          }
+          selector2 = Symbols::LookupFromConcat(Symbols::ClosurizePrefix(),
+                                                selector);
+          if (IsSent(selector2)) {
+            // Hash-closurization.
+            // Function is foo and somewhere get:#foo is called.
+            function2 = function.ImplicitClosureFunction();
+            AddFunction(function2);
+          }
+        }
+      }
+    }
+  }
+}
+
+
+void Precompiler::DropUncompiledFunctions() {
+  Library& lib = Library::Handle(Z);
+  Class& cls = Class::Handle(Z);
+  Array& functions = Array::Handle(Z);
+  Function& function = Function::Handle(Z);
+  GrowableObjectArray& retained_functions = GrowableObjectArray::Handle(Z);
+  GrowableObjectArray& closures = GrowableObjectArray::Handle(Z);
+
+  for (intptr_t i = 0; i < libraries_.Length(); i++) {
+    lib ^= libraries_.At(i);
+    ClassDictionaryIterator it(lib, ClassDictionaryIterator::kIteratePrivate);
+    while (it.HasNext()) {
+      cls = it.GetNextClass();
+      if (cls.IsDynamicClass()) {
+        continue;  // class 'dynamic' is in the read-only VM isolate.
+      }
+
+      functions = cls.functions();
+      retained_functions = GrowableObjectArray::New();
+      for (intptr_t j = 0; j < functions.Length(); j++) {
+        function ^= functions.At(j);
+        if (function.HasCode()) {
+          retained_functions.Add(function);
+        } else {
+          dropped_function_count_++;
+          if (FLAG_trace_precompiler) {
+            THR_Print("Precompilation dropping %s\n",
+                      function.ToLibNamePrefixedQualifiedCString());
+          }
+        }
+      }
+
+      functions = Array::New(retained_functions.Length(), Heap::kOld);
+      for (intptr_t j = 0; j < retained_functions.Length(); j++) {
+        function ^= retained_functions.At(j);
+        functions.SetAt(j, function);
+      }
+      cls.SetFunctions(functions);
+
+      closures = cls.closures();
+      if (!closures.IsNull()) {
+        retained_functions = GrowableObjectArray::New();
+        for (intptr_t j = 0; j < closures.Length(); j++) {
+          function ^= closures.At(j);
+          if (function.HasCode()) {
+            retained_functions.Add(function);
+          } else {
+            dropped_function_count_++;
+            if (FLAG_trace_precompiler) {
+              THR_Print("Precompilation dropping %s\n",
+                        function.ToLibNamePrefixedQualifiedCString());
+            }
+          }
+        }
+        cls.set_closures(retained_functions);
+      }
+    }
+  }
+}
+
+
+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)) {
+    }
+
+    void VisitFunction(const Function& function) {
+      ASSERT(function.HasCode());
+      code_ = function.CurrentCode();
+      table_ = code_.static_calls_target_table();
+
+      for (intptr_t i = 0;
+           i < table_.Length();
+           i += Code::kSCallTableEntryLength) {
+        pc_offset_ ^= table_.At(i + Code::kSCallTableOffsetEntry);
+        target_ ^= table_.At(i + Code::kSCallTableFunctionEntry);
+        if (target_.IsNull()) {
+          target_code_ ^= table_.At(i + Code::kSCallTableCodeEntry);
+          ASSERT(!target_code_.IsNull());
+          ASSERT(!target_code_.IsFunctionCode());
+          // Allocation stub or AllocateContext or AllocateArray or ...
+        } else {
+          // Static calls initially call the CallStaticFunction stub because
+          // their target might not be compiled yet. After tree shaking, all
+          // static call targets are compiled.
+          // Cf. runtime entry PatchStaticCall called from CallStaticFunction
+          // stub.
+          ASSERT(target_.HasCode());
+          target_code_ ^= target_.CurrentCode();
+          uword pc = pc_offset_.Value() + code_.EntryPoint();
+          CodePatcher::PatchStaticCallAt(pc, code_, target_code_);
+        }
+      }
+
+      // We won't patch static calls anymore, so drop the static call table to
+      // save space.
+      code_.set_static_calls_target_table(Object::empty_array());
+    }
+
+   private:
+    Code& code_;
+    Array& table_;
+    Smi& pc_offset_;
+    Function& target_;
+    Code& target_code_;
+  };
+
+  BindStaticCallsVisitor visitor(Z);
+  VisitFunctions(&visitor);
+}
+
+
+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)) {
+    }
+
+    void VisitFunction(const Function& function) {
+      code_ = function.CurrentCode();
+      stackmaps_ = code_.stackmaps();
+      if (stackmaps_.IsNull()) return;
+      for (intptr_t i = 0; i < stackmaps_.Length(); i++) {
+        stackmap_ ^= stackmaps_.At(i);
+        stackmap_ = DedupStackmap(stackmap_);
+        stackmaps_.SetAt(i, stackmap_);
+      }
+    }
+
+    RawStackmap* DedupStackmap(const Stackmap& stackmap) {
+      const Stackmap* canonical_stackmap =
+          canonical_stackmaps_.Lookup(&stackmap);
+      if (canonical_stackmap == NULL) {
+        canonical_stackmaps_.Insert(
+            &Stackmap::ZoneHandle(zone_, stackmap.raw()));
+        return stackmap.raw();
+      } else {
+        return canonical_stackmap->raw();
+      }
+    }
+
+   private:
+    Zone* zone_;
+    StackmapSet canonical_stackmaps_;
+    Code& code_;
+    Array& stackmaps_;
+    Stackmap& stackmap_;
+  };
+
+  DedupStackmapsVisitor visitor(Z);
+  VisitFunctions(&visitor);
+}
+
+
+void Precompiler::VisitFunctions(FunctionVisitor* visitor) {
+  Library& lib = Library::Handle(Z);
+  Class& cls = Class::Handle(Z);
+  Array& functions = Array::Handle(Z);
+  Function& function = Function::Handle(Z);
+  GrowableObjectArray& closures = GrowableObjectArray::Handle(Z);
+
+  for (intptr_t i = 0; i < libraries_.Length(); i++) {
+    lib ^= libraries_.At(i);
+    ClassDictionaryIterator it(lib, ClassDictionaryIterator::kIteratePrivate);
+    while (it.HasNext()) {
+      cls = it.GetNextClass();
+      if (cls.IsDynamicClass()) {
+        continue;  // class 'dynamic' is in the read-only VM isolate.
+      }
+
+      functions = cls.functions();
+      for (intptr_t j = 0; j < functions.Length(); j++) {
+        function ^= functions.At(j);
+        visitor->VisitFunction(function);
+      }
+
+      closures = cls.closures();
+      if (!closures.IsNull()) {
+        for (intptr_t j = 0; j < closures.Length(); j++) {
+          function ^= closures.At(j);
+          visitor->VisitFunction(function);
         }
       }
     }
diff --git a/runtime/vm/precompiler.h b/runtime/vm/precompiler.h
index 158a8ba..5051ead 100644
--- a/runtime/vm/precompiler.h
+++ b/runtime/vm/precompiler.h
@@ -6,6 +6,8 @@
 #define VM_PRECOMPILER_H_
 
 #include "vm/allocation.h"
+#include "vm/hash_map.h"
+#include "vm/object.h"
 
 namespace dart {
 
@@ -18,20 +20,69 @@
 class RawError;
 class String;
 
+class SymbolKeyValueTrait {
+ public:
+  // Typedefs needed for the DirectChainedHashMap template.
+  typedef const String* Key;
+  typedef const String* Value;
+  typedef const String* Pair;
+
+  static Key KeyOf(Pair kv) { return kv; }
+
+  static Value ValueOf(Pair kv) { return kv; }
+
+  static inline intptr_t Hashcode(Key key) {
+    return key->Hash();
+  }
+
+  static inline bool IsKeyEqual(Pair pair, Key key) {
+    return pair->raw() == key->raw();
+  }
+};
+
+typedef DirectChainedHashMap<SymbolKeyValueTrait> SymbolSet;
+
+class StackmapKeyValueTrait {
+ public:
+  // Typedefs needed for the DirectChainedHashMap template.
+  typedef const Stackmap* Key;
+  typedef const Stackmap* Value;
+  typedef const Stackmap* Pair;
+
+  static Key KeyOf(Pair kv) { return kv; }
+
+  static Value ValueOf(Pair kv) { return kv; }
+
+  static inline intptr_t Hashcode(Key key) {
+    return key->PcOffset();
+  }
+
+  static inline bool IsKeyEqual(Pair pair, Key key) {
+    return pair->Equals(*key);
+  }
+};
+
+typedef DirectChainedHashMap<StackmapKeyValueTrait> StackmapSet;
+
+
 class Precompiler : public ValueObject {
  public:
-  static RawError* CompileAll();
+  static RawError* CompileAll(
+      Dart_QualifiedFunctionName embedder_entry_points[],
+      bool reset_fields);
 
  private:
-  explicit Precompiler(Thread* thread);
+  Precompiler(Thread* thread, bool reset_fields);
 
-  void DoCompileAll();
+  void DoCompileAll(Dart_QualifiedFunctionName embedder_entry_points[]);
   void ClearAllCode();
-  void AddRoots();
+  void AddRoots(Dart_QualifiedFunctionName embedder_entry_points[]);
+  void AddEntryPoints(Dart_QualifiedFunctionName entry_points[]);
   void Iterate();
   void CleanUp();
 
   void AddCalleesOf(const Function& function);
+  void AddClosureCall(const ICData& call_site);
   void AddField(const Field& field);
   void AddFunction(const Function& function);
   void AddClass(const Class& cls);
@@ -41,6 +92,18 @@
   void ProcessFunction(const Function& function);
   void CheckForNewDynamicFunctions();
 
+  void DropUncompiledFunctions();
+  void BindStaticCalls();
+  void DedupStackmaps();
+
+  class FunctionVisitor : public ValueObject {
+   public:
+    virtual ~FunctionVisitor() {}
+    virtual void VisitFunction(const Function& function) = 0;
+  };
+
+  void VisitFunctions(FunctionVisitor* visitor);
+
   Thread* thread() const { return thread_; }
   Zone* zone() const { return zone_; }
   Isolate* isolate() const { return isolate_; }
@@ -49,14 +112,18 @@
   Zone* zone_;
   Isolate* isolate_;
 
+  const bool reset_fields_;
+
   bool changed_;
   intptr_t function_count_;
   intptr_t class_count_;
+  intptr_t selector_count_;
+  intptr_t dropped_function_count_;
 
   const GrowableObjectArray& libraries_;
   const GrowableObjectArray& pending_functions_;
   const GrowableObjectArray& collected_closures_;
-  const GrowableObjectArray& sent_selectors_;
+  SymbolSet sent_selectors_;
   Error& error_;
 };
 
diff --git a/runtime/vm/profiler.cc b/runtime/vm/profiler.cc
index 0ace0cc..1515eed 100644
--- a/runtime/vm/profiler.cc
+++ b/runtime/vm/profiler.cc
@@ -25,6 +25,8 @@
 namespace dart {
 
 
+static const intptr_t kSampleSize = 8;
+
 DECLARE_FLAG(bool, trace_profiler);
 
 DEFINE_FLAG(bool, profile, true, "Enable Sampling Profiler");
@@ -38,7 +40,7 @@
   DEFINE_FLAG(int, profile_period, 1000,
               "Time between profiler samples in microseconds. Minimum 50.");
 #endif
-DEFINE_FLAG(int, profile_depth, 8,
+DEFINE_FLAG(int, max_profile_depth, kSampleSize,
             "Maximum number stack frames walked. Minimum 1. Maximum 255.");
 #if defined(USING_SIMULATOR)
 DEFINE_FLAG(bool, profile_vm, true,
@@ -51,18 +53,11 @@
 bool Profiler::initialized_ = false;
 SampleBuffer* Profiler::sample_buffer_ = NULL;
 
-static intptr_t NumberOfFramesToCollect() {
-  if (FLAG_profile_depth <= 0) {
-    return 0;
-  }
-  // Subtract to reserve space for the possible missing frame.
-  return FLAG_profile_depth - 1;
-}
 
 void Profiler::InitOnce() {
   // Place some sane restrictions on user controlled flags.
   SetSamplePeriod(FLAG_profile_period);
-  SetSampleDepth(FLAG_profile_depth);
+  SetSampleDepth(FLAG_max_profile_depth);
   Sample::InitOnce();
   if (!FLAG_profile) {
     return;
@@ -90,11 +85,11 @@
   const int kMinimumDepth = 2;
   const int kMaximumDepth = 255;
   if (depth < kMinimumDepth) {
-    FLAG_profile_depth = kMinimumDepth;
+    FLAG_max_profile_depth = kMinimumDepth;
   } else if (depth > kMaximumDepth) {
-    FLAG_profile_depth = kMaximumDepth;
+    FLAG_max_profile_depth = kMaximumDepth;
   } else {
-    FLAG_profile_depth = depth;
+    FLAG_max_profile_depth = depth;
   }
 }
 
@@ -170,7 +165,7 @@
     return;
   }
   Thread* thread = Thread::Current();
-  thread->SetThreadInterrupter(RecordSampleInterruptCallback, isolate);
+  thread->SetThreadInterrupter(RecordSampleInterruptCallback, thread);
   ThreadInterrupter::WakeUp();
 }
 
@@ -228,8 +223,7 @@
 
 
 void Sample::InitOnce() {
-  ASSERT(FLAG_profile_depth >= 2);
-  pcs_length_ = FLAG_profile_depth;
+  pcs_length_ = kSampleSize;
   instance_size_ =
       sizeof(Sample) + (sizeof(uword) * pcs_length_);  // NOLINT.
 }
@@ -265,14 +259,31 @@
 }
 
 
-Sample* SampleBuffer::ReserveSample() {
+intptr_t SampleBuffer::ReserveSampleSlot() {
   ASSERT(samples_ != NULL);
   uintptr_t cursor = AtomicOperations::FetchAndIncrement(&cursor_);
   // Map back into sample buffer range.
   cursor = cursor % capacity_;
-  return At(cursor);
+  return cursor;
 }
 
+Sample* SampleBuffer::ReserveSample() {
+  return At(ReserveSampleSlot());
+}
+
+
+Sample* SampleBuffer::ReserveSampleAndLink(Sample* previous) {
+  ASSERT(previous != NULL);
+  intptr_t next_index = ReserveSampleSlot();
+  Sample* next = At(next_index);
+  next->Init(previous->isolate(), previous->timestamp(), previous->tid());
+  next->set_head_sample(false);
+  // Mark that previous continues at next.
+  previous->SetContinuationIndex(next_index);
+  return next;
+}
+
+
 // Attempts to find the true return address when a Dart frame is being setup
 // or torn down.
 // NOTE: Architecture specific implementations below.
@@ -407,50 +418,96 @@
 }
 
 
-// Given an exit frame, walk the Dart stack.
-class ProfilerDartExitStackWalker : public ValueObject {
+class ProfilerStackWalker : public ValueObject {
  public:
-  ProfilerDartExitStackWalker(Isolate* isolate, Sample* sample)
-      : sample_(sample),
-        frame_iterator_(isolate) {
+  ProfilerStackWalker(Isolate* isolate,
+                      Sample* head_sample,
+                      SampleBuffer* sample_buffer)
+    : isolate_(isolate),
+      sample_(head_sample),
+      sample_buffer_(sample_buffer),
+      frame_index_(0),
+      total_frames_(0) {
+    ASSERT(isolate_ != NULL);
     ASSERT(sample_ != NULL);
+    ASSERT(sample_buffer_ != NULL);
+    ASSERT(sample_->head_sample());
+  }
+
+  bool Append(uword pc) {
+    if (total_frames_ >= FLAG_max_profile_depth) {
+      sample_->set_truncated_trace(true);
+      return false;
+    }
+    ASSERT(sample_ != NULL);
+    if (frame_index_ == kSampleSize) {
+      Sample* new_sample = sample_buffer_->ReserveSampleAndLink(sample_);
+      if (new_sample == NULL) {
+        // Could not reserve new sample- mark this as truncated.
+        sample_->set_truncated_trace(true);
+        return false;
+      }
+      frame_index_ = 0;
+      sample_ = new_sample;
+    }
+    ASSERT(frame_index_ < kSampleSize);
+    sample_->SetAt(frame_index_, pc);
+    frame_index_++;
+    total_frames_++;
+    return true;
+  }
+
+ protected:
+  Isolate* isolate_;
+  Sample* sample_;
+  SampleBuffer* sample_buffer_;
+  intptr_t frame_index_;
+  intptr_t total_frames_;
+};
+
+
+// Given an exit frame, walk the Dart stack.
+class ProfilerDartExitStackWalker : public ProfilerStackWalker {
+ public:
+  ProfilerDartExitStackWalker(Isolate* isolate,
+                              Sample* sample,
+                              SampleBuffer* sample_buffer)
+      : ProfilerStackWalker(isolate, sample, sample_buffer),
+        frame_iterator_(isolate) {
   }
 
   void walk() {
     // Mark that this sample was collected from an exit frame.
     sample_->set_exit_frame_sample(true);
-    intptr_t frame_index = 0;
+
     StackFrame* frame = frame_iterator_.NextFrame();
     while (frame != NULL) {
-      sample_->SetAt(frame_index, frame->pc());
-      frame_index++;
-      if (frame_index >= NumberOfFramesToCollect()) {
-        sample_->set_truncated_trace(true);
-        break;
+      if (!Append(frame->pc())) {
+        return;
       }
       frame = frame_iterator_.NextFrame();
     }
   }
 
  private:
-  Sample* sample_;
   DartFrameIterator frame_iterator_;
 };
 
 
 // Executing Dart code, walk the stack.
-class ProfilerDartStackWalker : public ValueObject {
+class ProfilerDartStackWalker : public ProfilerStackWalker {
  public:
-  ProfilerDartStackWalker(Sample* sample,
+  ProfilerDartStackWalker(Isolate* isolate,
+                          Sample* sample,
+                          SampleBuffer* sample_buffer,
                           uword stack_lower,
                           uword stack_upper,
                           uword pc,
                           uword fp,
                           uword sp)
-      : sample_(sample),
+      : ProfilerStackWalker(isolate, sample, sample_buffer),
         stack_upper_(stack_upper),
         stack_lower_(stack_lower) {
-    ASSERT(sample_ != NULL);
     pc_ = reinterpret_cast<uword*>(pc);
     fp_ = reinterpret_cast<uword*>(fp);
     sp_ = reinterpret_cast<uword*>(sp);
@@ -474,13 +531,14 @@
         return;
       }
     }
-    for (int i = 0; i < NumberOfFramesToCollect(); i++) {
-      sample_->SetAt(i, reinterpret_cast<uword>(pc_));
+    while (true) {
+      if (!Append(reinterpret_cast<uword>(pc_))) {
+        return;
+      }
       if (!Next()) {
         return;
       }
     }
-    sample_->set_truncated_trace(true);
   }
 
  private:
@@ -583,7 +641,6 @@
   uword* pc_;
   uword* fp_;
   uword* sp_;
-  Sample* sample_;
   const uword stack_upper_;
   uword stack_lower_;
 };
@@ -593,27 +650,28 @@
 // recent GCC versions with optimizing enabled) the stack walking code may
 // fail.
 //
-class ProfilerNativeStackWalker : public ValueObject {
+class ProfilerNativeStackWalker : public ProfilerStackWalker {
  public:
-  ProfilerNativeStackWalker(Sample* sample,
+  ProfilerNativeStackWalker(Isolate* isolate,
+                            Sample* sample,
+                            SampleBuffer* sample_buffer,
                             uword stack_lower,
                             uword stack_upper,
                             uword pc,
                             uword fp,
                             uword sp)
-      : sample_(sample),
+      : ProfilerStackWalker(isolate, sample, sample_buffer),
         stack_upper_(stack_upper),
         original_pc_(pc),
         original_fp_(fp),
         original_sp_(sp),
         lower_bound_(stack_lower) {
-    ASSERT(sample_ != NULL);
   }
 
   void walk() {
     const uword kMaxStep = VirtualMemory::PageSize();
 
-    sample_->SetAt(0, original_pc_);
+    Append(original_pc_);
 
     uword* pc = reinterpret_cast<uword*>(original_pc_);
     uword* fp = reinterpret_cast<uword*>(original_fp_);
@@ -630,8 +688,10 @@
       return;
     }
 
-    for (int i = 0; i < NumberOfFramesToCollect(); i++) {
-      sample_->SetAt(i, reinterpret_cast<uword>(pc));
+    while (true) {
+      if (!Append(reinterpret_cast<uword>(pc))) {
+        return;
+      }
 
       pc = CallerPC(fp);
       previous_fp = fp;
@@ -660,8 +720,6 @@
       // Move the lower bound up.
       lower_bound_ = reinterpret_cast<uword>(fp);
     }
-
-    sample_->set_truncated_trace(true);
   }
 
  private:
@@ -693,7 +751,6 @@
     return r;
   }
 
-  Sample* sample_;
   const uword stack_upper_;
   const uword original_pc_;
   const uword original_fp_;
@@ -702,35 +759,8 @@
 };
 
 
-static void CopyPCMarkerIfSafe(Sample* sample, uword fp_addr, uword sp_addr) {
-  ASSERT(sample != NULL);
-
-  if (sample->vm_tag() != VMTag::kDartTagId) {
-    // We can only trust the stack pointer if we are executing Dart code.
-    // See http://dartbug.com/20421 for details.
-    return;
-  }
-  uword* fp = reinterpret_cast<uword*>(fp_addr);
-  uword* sp = reinterpret_cast<uword*>(sp_addr);
-
-  // If FP == SP, the pc marker hasn't been pushed.
-  if (fp > sp) {
-    uword* pc_marker_ptr = fp + kPcMarkerSlotFromFp;
-    // MSan/ASan are unaware of frames initialized by generated code.
-    MSAN_UNPOISON(pc_marker_ptr, kWordSize);
-    ASAN_UNPOISON(pc_marker_ptr, kWordSize);
-    sample->set_pc_marker(*pc_marker_ptr);
-  }
-}
-
-
 static void CopyStackBuffer(Sample* sample, uword sp_addr) {
   ASSERT(sample != NULL);
-  if (sample->vm_tag() != VMTag::kDartTagId) {
-    // We can only trust the stack pointer if we are executing Dart code.
-    // See http://dartbug.com/20421 for details.
-    return;
-  }
   uword* sp = reinterpret_cast<uword*>(sp_addr);
   uword* buffer = sample->GetStackBuffer();
   if (sp != NULL) {
@@ -777,8 +807,11 @@
   __try {
 #endif
 
-  CopyStackBuffer(sample, sp);
-  CopyPCMarkerIfSafe(sample, fp, 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.
@@ -817,40 +850,116 @@
 }
 
 
-void Profiler::RecordAllocation(Isolate* isolate, intptr_t cid) {
-  if ((isolate == NULL) || (Dart::vm_isolate() == NULL)) {
-    // No isolate.
-    return;
+// Is |thread| executing Dart code?
+static bool ExecutingDart(Thread* thread) {
+  ASSERT(thread != NULL);
+  return (thread->top_exit_frame_info() == 0) &&
+         (thread->vm_tag() == VMTag::kDartTagId);
+}
+
+
+// Has |thread| exited Dart code?
+static bool ExitedDart(Thread* thread) {
+  return (thread->top_exit_frame_info() != 0) &&
+         (thread->vm_tag() != VMTag::kDartTagId);
+}
+
+
+// Get |isolate|'s stack boundary and verify that |sp| and |fp| are within
+// it. Return |false| if anything looks suspicious.
+static bool GetAndValidateIsolateStackBounds(Thread* thread,
+                                             uintptr_t sp,
+                                             uintptr_t fp,
+                                             uword* stack_lower,
+                                             uword* stack_upper) {
+  ASSERT(thread != NULL);
+  Isolate* isolate = thread->isolate();
+  ASSERT(isolate != NULL);
+  ASSERT(stack_lower != NULL);
+  ASSERT(stack_upper != NULL);
+#if defined(USING_SIMULATOR)
+  const bool in_dart_code = ExecutingDart(thread);
+  if (in_dart_code) {
+    Simulator* simulator = isolate->simulator();
+    *stack_lower = simulator->StackBase();
+    *stack_upper = simulator->StackTop();
+  } else if (!isolate->GetProfilerStackBounds(stack_lower, stack_upper)) {
+    // Could not get stack boundary.
+    return false;
   }
-  ASSERT(isolate != Dart::vm_isolate());
-
-  const bool exited_dart_code = (isolate->top_exit_frame_info() != 0) &&
-                                (isolate->vm_tag() != VMTag::kDartTagId);
-
-  if (!exited_dart_code) {
-    // No Dart frames on stack.
-    // TODO(johnmccutchan): Support collecting native stack.
-    return;
+  if ((*stack_lower == 0) || (*stack_upper == 0)) {
+    return false;
+  }
+#else
+  if (!isolate->GetProfilerStackBounds(stack_lower, stack_upper) ||
+      (*stack_lower == 0) || (*stack_upper == 0)) {
+    // Could not get stack boundary.
+    return false;
+  }
+#endif
+  if (sp > *stack_lower) {
+    // The stack pointer gives us a tighter lower bound.
+    *stack_lower = sp;
   }
 
+  if (*stack_lower >= *stack_upper) {
+    // Stack boundary is invalid.
+    return false;
+  }
+
+  if ((sp < *stack_lower) || (sp >= *stack_upper)) {
+    // Stack pointer is outside isolate stack boundary.
+    return false;
+  }
+
+  if ((fp < *stack_lower) || (fp >= *stack_upper)) {
+    // Frame pointer is outside isolate stack boundary.
+    return false;
+  }
+
+  return true;
+}
+
+
+// Some simple sanity checking of |pc|, |sp|, and |fp|.
+static bool InitialRegisterCheck(uintptr_t pc, uintptr_t sp, uintptr_t fp) {
+  if ((sp == 0) || (fp == 0) || (pc == 0)) {
+    // None of these registers should be zero.
+    return false;
+  }
+
+  if (sp > fp) {
+    // Assuming the stack grows down, we should never have a stack pointer above
+    // the frame pointer.
+    return false;
+  }
+
+  return true;
+}
+
+
+// Return |isolate|'s sample buffer.
+static SampleBuffer* GetSampleBuffer(Isolate* isolate) {
   IsolateProfilerData* profiler_data = isolate->profiler_data();
   if (profiler_data == NULL) {
     // Profiler not initialized.
-    return;
+    return NULL;
   }
-
   SampleBuffer* sample_buffer = profiler_data->sample_buffer();
-  if (sample_buffer == NULL) {
-    // Profiler not initialized.
-    return;
-  }
+  return sample_buffer;
+}
 
-  const ThreadId thread_id = OSThread::GetCurrentThreadId();
-  // Setup sample.
+
+static Sample* SetupSample(Thread* thread,
+                           SampleBuffer* sample_buffer,
+                           ThreadId tid) {
+  ASSERT(thread != NULL);
+  Isolate* isolate = thread->isolate();
+  ASSERT(sample_buffer != NULL);
   Sample* sample = sample_buffer->ReserveSample();
-  sample->Init(isolate, OS::GetCurrentTimeMicros(), thread_id);
-  uword vm_tag = isolate->vm_tag();
-  #if defined(USING_SIMULATOR)
+  sample->Init(isolate, OS::GetCurrentTimeMicros(), tid);
+  uword vm_tag = thread->vm_tag();
+#if defined(USING_SIMULATOR)
   // When running in the simulator, the runtime entry function address
   // (stored as the vm tag) is the address of a redirect function.
   // Attempt to find the real runtime entry function address and use that.
@@ -858,36 +967,131 @@
   if (redirect_vm_tag != 0) {
     vm_tag = redirect_vm_tag;
   }
-  #endif
+#endif
   sample->set_vm_tag(vm_tag);
   sample->set_user_tag(isolate->user_tag());
-  sample->SetAllocationCid(cid);
+  return sample;
+}
 
-  ProfilerDartExitStackWalker dart_exit_stack_walker(isolate, sample);
-  dart_exit_stack_walker.walk();
+
+static bool CheckIsolate(Isolate* isolate) {
+  if ((isolate == NULL) || (Dart::vm_isolate() == NULL)) {
+    // No isolate.
+    return false;
+  }
+  ASSERT(isolate != Dart::vm_isolate());
+  return true;
+}
+
+
+#if defined(TARGET_OS_WINDOWS)
+__declspec(noinline)
+static uintptr_t GetProgramCounter() {
+  return reinterpret_cast<uintptr_t>(_ReturnAddress());
+}
+#else
+static uintptr_t __attribute__((noinline)) GetProgramCounter() {
+  return reinterpret_cast<uintptr_t>(
+      __builtin_extract_return_addr(__builtin_return_address(0)));
+}
+#endif
+
+void Profiler::RecordAllocation(Thread* thread, intptr_t cid) {
+  ASSERT(thread != NULL);
+  Isolate* isolate = thread->isolate();
+  if (!CheckIsolate(isolate)) {
+    return;
+  }
+
+  const bool exited_dart_code = ExitedDart(thread);
+
+  SampleBuffer* sample_buffer = GetSampleBuffer(isolate);
+  if (sample_buffer == NULL) {
+    // Profiler not initialized.
+    return;
+  }
+
+  if (FLAG_profile_vm) {
+    uintptr_t sp = Isolate::GetCurrentStackPointer();
+    uintptr_t fp = 0;
+    uintptr_t pc = GetProgramCounter();
+
+    COPY_FP_REGISTER(fp);
+
+    uword stack_lower = 0;
+    uword stack_upper = 0;
+
+    if (!InitialRegisterCheck(pc, sp, fp)) {
+      return;
+    }
+
+    if (!GetAndValidateIsolateStackBounds(thread,
+                                          sp,
+                                          fp,
+                                          &stack_lower,
+                                          &stack_upper)) {
+      // Could not get stack boundary.
+      return;
+    }
+
+    Sample* sample = SetupSample(thread,
+                                 sample_buffer,
+                                 OSThread::GetCurrentThreadId());
+    sample->SetAllocationCid(cid);
+    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,
+                                 OSThread::GetCurrentThreadId());
+    sample->SetAllocationCid(cid);
+    ProfilerDartExitStackWalker dart_exit_stack_walker(isolate,
+                                                       sample,
+                                                       sample_buffer);
+    dart_exit_stack_walker.walk();
+  } else {
+    // Fall back.
+    uintptr_t pc = GetProgramCounter();
+    Sample* sample = SetupSample(thread,
+                                 sample_buffer,
+                                 OSThread::GetCurrentThreadId());
+    sample->SetAllocationCid(cid);
+    sample->set_vm_tag(VMTag::kEmbedderTagId);
+    sample->SetAt(0, pc);
+  }
 }
 
 
 void Profiler::RecordSampleInterruptCallback(
     const InterruptedThreadState& state,
     void* data) {
-  Isolate* isolate = reinterpret_cast<Isolate*>(data);
+  Thread* thread = reinterpret_cast<Thread*>(data);
+  Isolate* isolate = thread->isolate();
   if ((isolate == NULL) || (Dart::vm_isolate() == NULL)) {
     // No isolate.
     return;
   }
-
   ASSERT(isolate != Dart::vm_isolate());
 
-  const bool exited_dart_code = (isolate->top_exit_frame_info() != 0) &&
-                                (isolate->vm_tag() != VMTag::kDartTagId);
-  const bool in_dart_code = (isolate->top_exit_frame_info() == 0) &&
-                            (isolate->vm_tag() == VMTag::kDartTagId);
+  SampleBuffer* sample_buffer = GetSampleBuffer(isolate);
+  if (sample_buffer == NULL) {
+    // Profiler not initialized.
+    return;
+  }
+
+  const bool exited_dart_code = ExitedDart(thread);
+  const bool in_dart_code = ExecutingDart(thread);
 
   uintptr_t sp = 0;
   uintptr_t fp = state.fp;
   uintptr_t pc = state.pc;
-  uintptr_t lr = state.lr;
 #if defined(USING_SIMULATOR)
   Simulator* simulator = NULL;
 #endif
@@ -899,7 +1103,6 @@
     sp = simulator->get_register(SPREG);
     fp = simulator->get_register(FPREG);
     pc = simulator->get_pc();
-    lr = simulator->get_register(LRREG);
 #else
     sp = state.dsp;
 #endif
@@ -908,26 +1111,7 @@
     sp = state.csp;
   }
 
-  IsolateProfilerData* profiler_data = isolate->profiler_data();
-  if (profiler_data == NULL) {
-    // Profiler not initialized.
-    return;
-  }
-
-  SampleBuffer* sample_buffer = profiler_data->sample_buffer();
-  if (sample_buffer == NULL) {
-    // Profiler not initialized.
-    return;
-  }
-
-  if ((sp == 0) || (fp == 0) || (pc == 0)) {
-    // None of these registers should be zero.
-    return;
-  }
-
-  if (sp > fp) {
-    // Assuming the stack grows down, we should never have a stack pointer above
-    // the frame pointer.
+  if (!InitialRegisterCheck(pc, sp, fp)) {
     return;
   }
 
@@ -940,79 +1124,43 @@
 
   uword stack_lower = 0;
   uword stack_upper = 0;
-#if defined(USING_SIMULATOR)
-  if (in_dart_code) {
-    stack_lower = simulator->StackBase();
-    stack_upper = simulator->StackTop();
-  } else if (!isolate->GetProfilerStackBounds(&stack_lower, &stack_upper)) {
+  if (!GetAndValidateIsolateStackBounds(thread,
+                                        sp,
+                                        fp,
+                                        &stack_lower,
+                                        &stack_upper)) {
     // Could not get stack boundary.
     return;
   }
-  if ((stack_lower == 0) || (stack_upper == 0)) {
-    return;
-  }
-#else
-  if (!isolate->GetProfilerStackBounds(&stack_lower, &stack_upper) ||
-      (stack_lower == 0) || (stack_upper == 0)) {
-    // Could not get stack boundary.
-    return;
-  }
-#endif
-
-  if (sp > stack_lower) {
-    // The stack pointer gives us a tighter lower bound.
-    stack_lower = sp;
-  }
-
-  if (stack_lower >= stack_upper) {
-    // Stack boundary is invalid.
-    return;
-  }
-
-  if ((sp < stack_lower) || (sp >= stack_upper)) {
-    // Stack pointer is outside isolate stack boundary.
-    return;
-  }
-
-  if ((fp < stack_lower) || (fp >= stack_upper)) {
-    // Frame pointer is outside isolate stack boundary.
-    return;
-  }
 
   // At this point we have a valid stack boundary for this isolate and
   // know that our initial stack and frame pointers are within the boundary.
 
   // Setup sample.
-  Sample* sample = sample_buffer->ReserveSample();
-  sample->Init(isolate, OS::GetCurrentTimeMicros(), state.tid);
-  uword vm_tag = isolate->vm_tag();
-#if defined(USING_SIMULATOR)
-  // When running in the simulator, the runtime entry function address
-  // (stored as the vm tag) is the address of a redirect function.
-  // Attempt to find the real runtime entry function address and use that.
-  uword redirect_vm_tag = Simulator::FunctionForRedirect(vm_tag);
-  if (redirect_vm_tag != 0) {
-    vm_tag = redirect_vm_tag;
-  }
-#endif
+  Sample* sample = SetupSample(thread,
+                               sample_buffer,
+                               OSThread::GetCurrentThreadId());
   // Increment counter for vm tag.
   VMTagCounters* counters = isolate->vm_tag_counters();
   ASSERT(counters != NULL);
-  counters->Increment(vm_tag);
-  sample->set_vm_tag(vm_tag);
-  sample->set_user_tag(isolate->user_tag());
-  sample->set_lr(lr);
+  counters->Increment(sample->vm_tag());
 
-  ProfilerNativeStackWalker native_stack_walker(sample,
+  ProfilerNativeStackWalker native_stack_walker(isolate,
+                                                sample,
+                                                sample_buffer,
                                                 stack_lower,
                                                 stack_upper,
                                                 pc,
                                                 fp,
                                                 sp);
 
-  ProfilerDartExitStackWalker dart_exit_stack_walker(isolate, sample);
+  ProfilerDartExitStackWalker dart_exit_stack_walker(isolate,
+                                                     sample,
+                                                     sample_buffer);
 
-  ProfilerDartStackWalker dart_stack_walker(sample,
+  ProfilerDartStackWalker dart_stack_walker(isolate,
+                                            sample,
+                                            sample_buffer,
                                             stack_lower,
                                             stack_upper,
                                             pc,
@@ -1048,6 +1196,10 @@
       // Bad sample.
       continue;
     }
+    if (!sample->head_sample()) {
+        // An inner sample in a chain of samples.
+        continue;
+      }
     if (sample->isolate() != filter->isolate()) {
       // Another isolate.
       continue;
@@ -1089,7 +1241,7 @@
   bool truncated = false;
   Sample* current = sample;
   while (current != NULL) {
-    for (intptr_t i = 0; i < FLAG_profile_depth; i++) {
+    for (intptr_t i = 0; i < kSampleSize; i++) {
       if (current->At(i) == 0) {
         break;
       }
@@ -1097,13 +1249,12 @@
     }
 
     truncated = truncated || current->truncated_trace();
-    current = Next(sample);
+    current = Next(current);
   }
 
   if (!sample->exit_frame_sample()) {
-    Isolate* isolate = thread->isolate();
     Isolate* vm_isolate = Dart::vm_isolate();
-    processed_sample->FixupCaller(isolate,
+    processed_sample->FixupCaller(thread,
                                   vm_isolate,
                                   sample->pc_marker(),
                                   sample->GetStackBuffer());
@@ -1115,13 +1266,27 @@
 
 
 Sample* SampleBuffer::Next(Sample* sample) {
-  // TODO(johnmccutchan): Support chaining samples for complete stack traces.
-  return NULL;
+  if (!sample->is_continuation_sample())
+    return NULL;
+  Sample* next_sample = At(sample->continuation_index());
+  // Sanity check.
+  ASSERT(sample != next_sample);
+  // Detect invalid chaining.
+  if (sample->isolate() != next_sample->isolate()) {
+    return NULL;
+  }
+  if (sample->timestamp() != next_sample->timestamp()) {
+    return NULL;
+  }
+  if (sample->tid() != next_sample->tid()) {
+    return NULL;
+  }
+  return next_sample;
 }
 
 
 ProcessedSample::ProcessedSample()
-    : pcs_(FLAG_profile_depth),
+    : pcs_(kSampleSize),
       timestamp_(0),
       vm_tag_(0),
       user_tag_(0),
@@ -1130,14 +1295,14 @@
 }
 
 
-void ProcessedSample::FixupCaller(Isolate* isolate,
+void ProcessedSample::FixupCaller(Thread* thread,
                                   Isolate* vm_isolate,
                                   uword pc_marker,
                                   uword* stack_buffer) {
-  REUSABLE_CODE_HANDLESCOPE(isolate);
+  REUSABLE_CODE_HANDLESCOPE(thread);
   // Lookup code object for leaf frame.
   Code& code = reused_code_handle.Handle();
-  code = FindCodeForPC(isolate, vm_isolate, At(0));
+  code = FindCodeForPC(thread->isolate(), vm_isolate, At(0));
   if (code.IsNull()) {
     return;
   }
@@ -1145,7 +1310,8 @@
     // Code compiled after sample. Ignore.
     return;
   }
-  CheckForMissingDartFrame(isolate, vm_isolate, code, pc_marker, stack_buffer);
+  CheckForMissingDartFrame(
+      thread->isolate(), vm_isolate, code, pc_marker, stack_buffer);
 }
 
 
diff --git a/runtime/vm/profiler.h b/runtime/vm/profiler.h
index d7406a2..ff8e148 100644
--- a/runtime/vm/profiler.h
+++ b/runtime/vm/profiler.h
@@ -44,7 +44,7 @@
     return sample_buffer_;
   }
 
-  static void RecordAllocation(Isolate* isolate, intptr_t cid);
+  static void RecordAllocation(Thread* thread, intptr_t cid);
 
  private:
   static bool initialized_;
@@ -155,6 +155,11 @@
     return isolate_;
   }
 
+  // Thread sample was taken on.
+  ThreadId tid() const {
+    return tid_;
+  }
+
   void Clear() {
     isolate_ = NULL;
     pc_marker_ = 0;
@@ -166,10 +171,12 @@
     lr_ = 0;
     metadata_ = 0;
     state_ = 0;
+    continuation_index_ = -1;
     uword* pcs = GetPCArray();
     for (intptr_t i = 0; i < pcs_length_; i++) {
       pcs[i] = 0;
     }
+    set_head_sample(true);
   }
 
   // Timestamp sample was taken at.
@@ -229,30 +236,6 @@
     lr_ = link_register;
   }
 
-  void InsertCallerForTopFrame(uword pc) {
-    if (pcs_length_ == 1) {
-      // Only sampling top frame.
-      return;
-    }
-    uword* pcs = GetPCArray();
-    // The caller for the top frame is store at index 1.
-    // Shift all entries down by one.
-    for (intptr_t i = pcs_length_ - 1; i >= 2; i--) {
-      pcs[i] = pcs[i - 1];
-    }
-    // Insert caller for top frame.
-    pcs[1] = pc;
-    set_missing_frame_inserted(true);
-  }
-
-  bool processed() const {
-    return ProcessedBit::decode(state_);
-  }
-
-  void set_processed(bool processed) {
-    state_ = ProcessedBit::update(processed, state_);
-  }
-
   bool leaf_frame_is_dart() const {
     return LeafFrameIsDart::decode(state_);
   }
@@ -301,11 +284,36 @@
     state_ = ClassAllocationSampleBit::update(allocation_sample, state_);
   }
 
+  bool is_continuation_sample() const {
+    return ContinuationSampleBit::decode(state_);
+  }
+
+  void SetContinuationIndex(intptr_t index) {
+    ASSERT(!is_continuation_sample());
+    ASSERT(continuation_index_ == -1);
+    state_ = ContinuationSampleBit::update(true, state_);
+    continuation_index_ = index;
+    ASSERT(is_continuation_sample());
+  }
+
+  intptr_t continuation_index() const {
+    ASSERT(is_continuation_sample());
+    return continuation_index_;
+  }
+
   intptr_t allocation_cid() const {
     ASSERT(is_allocation_sample());
     return metadata_;
   }
 
+  void set_head_sample(bool head_sample) {
+    state_ = HeadSampleBit::update(head_sample, state_);
+  }
+
+  bool head_sample() const {
+    return HeadSampleBit::decode(state_);
+  }
+
   void set_metadata(intptr_t metadata) {
     metadata_ = metadata;
   }
@@ -332,23 +340,26 @@
   static intptr_t instance_size_;
   static intptr_t pcs_length_;
   enum StateBits {
-    kProcessedBit = 0,
+    kHeadSampleBit = 0,
     kLeafFrameIsDartBit = 1,
     kIgnoreBit = 2,
     kExitFrameBit = 3,
     kMissingFrameInsertedBit = 4,
-    kTruncatedTrace = 5,
-    kClassAllocationSample = 6,
+    kTruncatedTraceBit = 5,
+    kClassAllocationSampleBit = 6,
+    kContinuationSampleBit = 7,
   };
-  class ProcessedBit : public BitField<bool, kProcessedBit, 1> {};
+  class HeadSampleBit : public BitField<bool, kHeadSampleBit, 1> {};
   class LeafFrameIsDart : public BitField<bool, kLeafFrameIsDartBit, 1> {};
   class IgnoreBit : public BitField<bool, kIgnoreBit, 1> {};
   class ExitFrameBit : public BitField<bool, kExitFrameBit, 1> {};
   class MissingFrameInsertedBit
-    : public BitField<bool, kMissingFrameInsertedBit, 1> {};
-  class TruncatedTraceBit : public BitField<bool, kTruncatedTrace, 1> {};
+      : public BitField<bool, kMissingFrameInsertedBit, 1> {};
+  class TruncatedTraceBit : public BitField<bool, kTruncatedTraceBit, 1> {};
   class ClassAllocationSampleBit
-      : public BitField<bool, kClassAllocationSample, 1> {};
+      : public BitField<bool, kClassAllocationSampleBit, 1> {};
+  class ContinuationSampleBit
+      : public BitField<bool, kContinuationSampleBit, 1> {};
 
   int64_t timestamp_;
   ThreadId tid_;
@@ -360,6 +371,7 @@
   uword metadata_;
   uword lr_;
   uword state_;
+  intptr_t continuation_index_;
 
   /* There are a variable number of words that follow, the words hold the
    * sampled pc values. Access via GetPCArray() */
@@ -387,13 +399,19 @@
   intptr_t capacity() const { return capacity_; }
 
   Sample* At(intptr_t idx) const;
+  intptr_t ReserveSampleSlot();
   Sample* ReserveSample();
+  Sample* ReserveSampleAndLink(Sample* previous);
 
   void VisitSamples(SampleVisitor* visitor) {
     ASSERT(visitor != NULL);
     const intptr_t length = capacity();
     for (intptr_t i = 0; i < length; i++) {
       Sample* sample = At(i);
+      if (!sample->head_sample()) {
+        // An inner sample in a chain of samples.
+        continue;
+      }
       if (sample->ignore_sample()) {
         // Bad sample.
         continue;
@@ -487,7 +505,7 @@
   }
 
  private:
-  void FixupCaller(Isolate* isolate,
+  void FixupCaller(Thread* thread,
                    Isolate* vm_isolate,
                    uword pc_marker,
                    uword* stack_buffer);
diff --git a/runtime/vm/profiler_service.cc b/runtime/vm/profiler_service.cc
index e773e95..6419707 100644
--- a/runtime/vm/profiler_service.cc
+++ b/runtime/vm/profiler_service.cc
@@ -14,7 +14,7 @@
 
 namespace dart {
 
-DECLARE_FLAG(int, profile_depth);
+DECLARE_FLAG(int, max_profile_depth);
 DECLARE_FLAG(int, profile_period);
 
 DEFINE_FLAG(bool, trace_profiler, false, "Trace profiler.");
@@ -58,7 +58,7 @@
       return false;
     }
     NoSafepointScope no_safepoint_scope;
-    for (intptr_t i = 0; array.Length(); i++) {
+    for (intptr_t i = 0; i < array.Length(); i++) {
       if (code.raw() == array.At(i)) {
         return true;
       }
@@ -1845,7 +1845,7 @@
   ProfileCode* CreateProfileCode(uword pc) {
     const intptr_t kDartCodeAlignment = OS::PreferredCodeAlignment();
     const intptr_t kDartCodeAlignmentMask = ~(kDartCodeAlignment - 1);
-    Code& code = Code::Handle(isolate_);
+    Code& code = Code::Handle(isolate_->current_zone());
 
     // Check current isolate for pc.
     if (isolate_->heap()->CodeContains(pc)) {
@@ -2043,7 +2043,7 @@
   obj.AddProperty("samplePeriod",
                   static_cast<intptr_t>(FLAG_profile_period));
   obj.AddProperty("stackDepth",
-                  static_cast<intptr_t>(FLAG_profile_depth));
+                  static_cast<intptr_t>(FLAG_max_profile_depth));
   obj.AddProperty("sampleCount", sample_count());
   obj.AddProperty("timeSpan", MicrosecondsToSeconds(GetTimeSpan()));
   {
@@ -2194,11 +2194,12 @@
 }
 
 
-void ProfilerService::PrintJSONImpl(Isolate* isolate,
+void ProfilerService::PrintJSONImpl(Thread* thread,
                                     JSONStream* stream,
                                     Profile::TagOrder tag_order,
                                     intptr_t extra_tags,
                                     SampleFilter* filter) {
+  Isolate* isolate = thread->isolate();
   // Disable profile interrupts while processing the buffer.
   Profiler::EndExecution(isolate);
 
@@ -2212,8 +2213,8 @@
   }
 
   {
-    StackZone zone(isolate);
-    HANDLESCOPE(isolate);
+    StackZone zone(thread);
+    HANDLESCOPE(thread);
     Profile profile(isolate);
     profile.Build(filter, tag_order, extra_tags);
     profile.PrintJSON(stream);
@@ -2239,9 +2240,10 @@
 void ProfilerService::PrintJSON(JSONStream* stream,
                                 Profile::TagOrder tag_order,
                                 intptr_t extra_tags) {
-  Isolate* isolate = Isolate::Current();
+  Thread* thread = Thread::Current();
+  Isolate* isolate = thread->isolate();
   NoAllocationSampleFilter filter(isolate);
-  PrintJSONImpl(isolate, stream, tag_order, extra_tags, &filter);
+  PrintJSONImpl(thread, stream, tag_order, extra_tags, &filter);
 }
 
 
@@ -2266,9 +2268,10 @@
 void ProfilerService::PrintAllocationJSON(JSONStream* stream,
                                           Profile::TagOrder tag_order,
                                           const Class& cls) {
-  Isolate* isolate = Isolate::Current();
+  Thread* thread = Thread::Current();
+  Isolate* isolate = thread->isolate();
   ClassAllocationSampleFilter filter(isolate, cls);
-  PrintJSONImpl(isolate, stream, tag_order, kNoExtraTags, &filter);
+  PrintJSONImpl(thread, stream, tag_order, kNoExtraTags, &filter);
 }
 
 
diff --git a/runtime/vm/profiler_service.h b/runtime/vm/profiler_service.h
index 7f0b9a3..621db01 100644
--- a/runtime/vm/profiler_service.h
+++ b/runtime/vm/profiler_service.h
@@ -387,7 +387,7 @@
   static void ClearSamples();
 
  private:
-  static void PrintJSONImpl(Isolate* isolate,
+  static void PrintJSONImpl(Thread* thread,
                             JSONStream* stream,
                             Profile::TagOrder tag_order,
                             intptr_t extra_tags,
diff --git a/runtime/vm/profiler_test.cc b/runtime/vm/profiler_test.cc
index 965d6b3..bc43d5f 100644
--- a/runtime/vm/profiler_test.cc
+++ b/runtime/vm/profiler_test.cc
@@ -13,6 +13,43 @@
 
 namespace dart {
 
+DECLARE_FLAG(bool, profile_vm);
+DECLARE_FLAG(int, max_profile_depth);
+
+// Some tests are written assuming native stack trace profiling is disabled.
+class DisableNativeProfileScope : public ValueObject {
+ public:
+  DisableNativeProfileScope()
+      : FLAG_profile_vm_(FLAG_profile_vm) {
+    FLAG_profile_vm = false;
+  }
+
+  ~DisableNativeProfileScope() {
+    FLAG_profile_vm = FLAG_profile_vm_;
+  }
+
+ private:
+  const bool FLAG_profile_vm_;
+};
+
+
+// Temporarily adjust the maximum profile depth.
+class MaxProfileDepthScope : public ValueObject {
+ public:
+  explicit MaxProfileDepthScope(intptr_t new_max_depth)
+      : FLAG_max_profile_depth_(FLAG_max_profile_depth) {
+    Profiler::SetSampleDepth(new_max_depth);
+  }
+
+  ~MaxProfileDepthScope() {
+    Profiler::SetSampleDepth(FLAG_max_profile_depth_);
+  }
+
+ private:
+  const intptr_t FLAG_max_profile_depth_;
+};
+
+
 class ProfileSampleBufferTestHelper {
  public:
   static intptr_t IterateCount(const Isolate* isolate,
@@ -113,19 +150,32 @@
  public:
   explicit AllocationFilter(Isolate* isolate, intptr_t cid)
       : SampleFilter(isolate),
-        cid_(cid) {
+        cid_(cid),
+        enable_embedder_ticks_(false) {
   }
 
   bool FilterSample(Sample* sample) {
-    return sample->is_allocation_sample() && (sample->allocation_cid() == cid_);
+    if (!enable_embedder_ticks_ &&
+        (sample->vm_tag() == VMTag::kEmbedderTagId)) {
+      // We don't want to see embedder ticks in the test.
+      return false;
+    }
+    return sample->is_allocation_sample() &&
+           (sample->allocation_cid() == cid_);
+  }
+
+  void set_enable_embedder_ticks(bool enable) {
+    enable_embedder_ticks_ = enable;
   }
 
  private:
   intptr_t cid_;
+  bool enable_embedder_ticks_;
 };
 
 
 TEST_CASE(Profiler_TrivialRecordAllocation) {
+  DisableNativeProfileScope dnps;
   const char* kScript =
       "class A {\n"
       "  var a;\n"
@@ -154,9 +204,10 @@
 
 
   {
-    Isolate* isolate = Isolate::Current();
-    StackZone zone(isolate);
-    HANDLESCOPE(isolate);
+    Thread* thread = Thread::Current();
+    Isolate* isolate = thread->isolate();
+    StackZone zone(thread);
+    HANDLESCOPE(thread);
     Profile profile(isolate);
     AllocationFilter filter(isolate, class_a.id());
     profile.Build(&filter, Profile::kNoTags);
@@ -204,6 +255,7 @@
 
 
 TEST_CASE(Profiler_ToggleRecordAllocation) {
+  DisableNativeProfileScope dnps;
   const char* kScript =
       "class A {\n"
       "  var a;\n"
@@ -231,9 +283,10 @@
 
 
   {
-    Isolate* isolate = Isolate::Current();
-    StackZone zone(isolate);
-    HANDLESCOPE(isolate);
+    Thread* thread = Thread::Current();
+    Isolate* isolate = thread->isolate();
+    StackZone zone(thread);
+    HANDLESCOPE(thread);
     Profile profile(isolate);
     AllocationFilter filter(isolate, class_a.id());
     profile.Build(&filter, Profile::kNoTags);
@@ -248,9 +301,10 @@
   EXPECT_VALID(result);
 
   {
-    Isolate* isolate = Isolate::Current();
-    StackZone zone(isolate);
-    HANDLESCOPE(isolate);
+    Thread* thread = Thread::Current();
+    Isolate* isolate = thread->isolate();
+    StackZone zone(thread);
+    HANDLESCOPE(thread);
     Profile profile(isolate);
     AllocationFilter filter(isolate, class_a.id());
     profile.Build(&filter, Profile::kNoTags);
@@ -302,9 +356,10 @@
   EXPECT_VALID(result);
 
   {
-    Isolate* isolate = Isolate::Current();
-    StackZone zone(isolate);
-    HANDLESCOPE(isolate);
+    Thread* thread = Thread::Current();
+    Isolate* isolate = thread->isolate();
+    StackZone zone(thread);
+    HANDLESCOPE(thread);
     Profile profile(isolate);
     AllocationFilter filter(isolate, class_a.id());
     profile.Build(&filter, Profile::kNoTags);
@@ -315,6 +370,7 @@
 
 
 TEST_CASE(Profiler_CodeTicks) {
+  DisableNativeProfileScope dnps;
   const char* kScript =
       "class A {\n"
       "  var a;\n"
@@ -341,9 +397,10 @@
   EXPECT_VALID(result);
 
   {
-    Isolate* isolate = Isolate::Current();
-    StackZone zone(isolate);
-    HANDLESCOPE(isolate);
+    Thread* thread = Thread::Current();
+    Isolate* isolate = thread->isolate();
+    StackZone zone(thread);
+    HANDLESCOPE(thread);
     Profile profile(isolate);
     AllocationFilter filter(isolate, class_a.id());
     profile.Build(&filter, Profile::kNoTags);
@@ -363,9 +420,10 @@
   EXPECT_VALID(result);
 
   {
-    Isolate* isolate = Isolate::Current();
-    StackZone zone(isolate);
-    HANDLESCOPE(isolate);
+    Thread* thread = Thread::Current();
+    Isolate* isolate = thread->isolate();
+    StackZone zone(thread);
+    HANDLESCOPE(thread);
     Profile profile(isolate);
     AllocationFilter filter(isolate, class_a.id());
     profile.Build(&filter, Profile::kNoTags);
@@ -407,6 +465,7 @@
 
 
 TEST_CASE(Profiler_FunctionTicks) {
+  DisableNativeProfileScope dnps;
   const char* kScript =
       "class A {\n"
       "  var a;\n"
@@ -433,9 +492,10 @@
   EXPECT_VALID(result);
 
   {
-    Isolate* isolate = Isolate::Current();
-    StackZone zone(isolate);
-    HANDLESCOPE(isolate);
+    Thread* thread = Thread::Current();
+    Isolate* isolate = thread->isolate();
+    StackZone zone(thread);
+    HANDLESCOPE(thread);
     Profile profile(isolate);
     AllocationFilter filter(isolate, class_a.id());
     profile.Build(&filter, Profile::kNoTags);
@@ -455,9 +515,10 @@
   EXPECT_VALID(result);
 
   {
-    Isolate* isolate = Isolate::Current();
-    StackZone zone(isolate);
-    HANDLESCOPE(isolate);
+    Thread* thread = Thread::Current();
+    Isolate* isolate = thread->isolate();
+    StackZone zone(thread);
+    HANDLESCOPE(thread);
     Profile profile(isolate);
     AllocationFilter filter(isolate, class_a.id());
     profile.Build(&filter, Profile::kNoTags);
@@ -499,12 +560,13 @@
 
 
 TEST_CASE(Profiler_IntrinsicAllocation) {
+  DisableNativeProfileScope dnps;
   const char* kScript = "double foo(double a, double b) => a + b;";
   Dart_Handle lib = TestCase::LoadTestScript(kScript, NULL);
   EXPECT_VALID(lib);
   Library& root_library = Library::Handle();
   root_library ^= Api::UnwrapHandle(lib);
-  Isolate* isolate = Isolate::Current();
+  Isolate* isolate = thread->isolate();
 
   const Class& double_class =
       Class::Handle(isolate->object_store()->double_class());
@@ -516,8 +578,8 @@
   EXPECT_VALID(result);
 
   {
-    StackZone zone(isolate);
-    HANDLESCOPE(isolate);
+    StackZone zone(thread);
+    HANDLESCOPE(thread);
     Profile profile(isolate);
     AllocationFilter filter(isolate, double_class.id());
     profile.Build(&filter, Profile::kNoTags);
@@ -530,8 +592,8 @@
   EXPECT_VALID(result);
 
   {
-    StackZone zone(isolate);
-    HANDLESCOPE(isolate);
+    StackZone zone(thread);
+    HANDLESCOPE(thread);
     Profile profile(isolate);
     AllocationFilter filter(isolate, double_class.id());
     profile.Build(&filter, Profile::kNoTags);
@@ -554,8 +616,8 @@
   EXPECT_VALID(result);
 
   {
-    StackZone zone(isolate);
-    HANDLESCOPE(isolate);
+    StackZone zone(thread);
+    HANDLESCOPE(thread);
     Profile profile(isolate);
     AllocationFilter filter(isolate, double_class.id());
     profile.Build(&filter, Profile::kNoTags);
@@ -566,6 +628,7 @@
 
 
 TEST_CASE(Profiler_ArrayAllocation) {
+  DisableNativeProfileScope dnps;
   const char* kScript =
       "List foo() => new List(4);\n"
       "List bar() => new List();\n";
@@ -573,7 +636,7 @@
   EXPECT_VALID(lib);
   Library& root_library = Library::Handle();
   root_library ^= Api::UnwrapHandle(lib);
-  Isolate* isolate = Isolate::Current();
+  Isolate* isolate = thread->isolate();
 
   const Class& array_class =
       Class::Handle(isolate->object_store()->array_class());
@@ -583,8 +646,8 @@
   EXPECT_VALID(result);
 
   {
-    StackZone zone(isolate);
-    HANDLESCOPE(isolate);
+    StackZone zone(thread);
+    HANDLESCOPE(thread);
     Profile profile(isolate);
     AllocationFilter filter(isolate, array_class.id());
     profile.Build(&filter, Profile::kNoTags);
@@ -597,8 +660,8 @@
   EXPECT_VALID(result);
 
   {
-    StackZone zone(isolate);
-    HANDLESCOPE(isolate);
+    StackZone zone(thread);
+    HANDLESCOPE(thread);
     Profile profile(isolate);
     AllocationFilter filter(isolate, array_class.id());
     profile.Build(&filter, Profile::kNoTags);
@@ -621,8 +684,8 @@
   EXPECT_VALID(result);
 
   {
-    StackZone zone(isolate);
-    HANDLESCOPE(isolate);
+    StackZone zone(thread);
+    HANDLESCOPE(thread);
     Profile profile(isolate);
     AllocationFilter filter(isolate, array_class.id());
     profile.Build(&filter, Profile::kNoTags);
@@ -645,8 +708,8 @@
   EXPECT_VALID(result);
 
   {
-    StackZone zone(isolate);
-    HANDLESCOPE(isolate);
+    StackZone zone(thread);
+    HANDLESCOPE(thread);
     Profile profile(isolate);
     AllocationFilter filter(isolate, array_class.id());
     profile.Build(&filter, Profile::kNoTags);
@@ -668,7 +731,148 @@
 }
 
 
+TEST_CASE(Profiler_ContextAllocation) {
+  DisableNativeProfileScope dnps;
+  const char* kScript =
+      "var msg1 = 'a';\n"
+      "foo() {\n"
+      "  var msg = msg1 + msg1;\n"
+      "  return (x) { return '$msg + $msg'; }(msg);\n"
+      "}\n";
+  Dart_Handle lib = TestCase::LoadTestScript(kScript, NULL);
+  EXPECT_VALID(lib);
+  Library& root_library = Library::Handle();
+  root_library ^= Api::UnwrapHandle(lib);
+  Isolate* isolate = thread->isolate();
+
+  const Class& context_class =
+      Class::Handle(Object::context_class());
+  EXPECT(!context_class.IsNull());
+
+  Dart_Handle result = Dart_Invoke(lib, NewString("foo"), 0, NULL);
+  EXPECT_VALID(result);
+
+  {
+    StackZone zone(thread);
+    HANDLESCOPE(thread);
+    Profile profile(isolate);
+    AllocationFilter filter(isolate, context_class.id());
+    profile.Build(&filter, Profile::kNoTags);
+    // We should have no allocation samples.
+    EXPECT_EQ(0, profile.sample_count());
+  }
+
+  context_class.SetTraceAllocation(true);
+  result = Dart_Invoke(lib, NewString("foo"), 0, NULL);
+  EXPECT_VALID(result);
+
+  {
+    StackZone zone(thread);
+    HANDLESCOPE(thread);
+    Profile profile(isolate);
+    AllocationFilter filter(isolate, context_class.id());
+    profile.Build(&filter, Profile::kNoTags);
+    // We should have one allocation sample.
+    EXPECT_EQ(1, profile.sample_count());
+    ProfileTrieWalker walker(&profile);
+
+    walker.Reset(Profile::kExclusiveCode);
+    EXPECT(walker.Down());
+    EXPECT_STREQ("foo", walker.CurrentName());
+    EXPECT(!walker.Down());
+  }
+
+  context_class.SetTraceAllocation(false);
+  result = Dart_Invoke(lib, NewString("foo"), 0, NULL);
+  EXPECT_VALID(result);
+
+  {
+    StackZone zone(thread);
+    HANDLESCOPE(thread);
+    Profile profile(isolate);
+    AllocationFilter filter(isolate, context_class.id());
+    profile.Build(&filter, Profile::kNoTags);
+    // We should still only have one allocation sample.
+    EXPECT_EQ(1, profile.sample_count());
+  }
+}
+
+
+TEST_CASE(Profiler_ClassAllocation) {
+  DisableNativeProfileScope dnps;
+  const char* kScript =
+      "var msg1 = 'a';\n"
+      "\n"
+      "foo() {\n"
+      "  var msg = msg1 + msg1;\n"
+      "  var msg2 = msg + msg;\n"
+      "  return (x, y, z, w) { return '$x + $y + $z'; }(msg, msg2, msg, msg);\n"
+      "}\n"
+      "bar() {\n"
+      "  var msg = msg1 + msg1;\n"
+      "  var msg2 = msg + msg;\n"
+      "  return (x, y) { return '$x + $y'; }(msg, msg2);\n"
+      "}\n";
+
+  Dart_Handle lib = TestCase::LoadTestScript(kScript, NULL);
+  EXPECT_VALID(lib);
+  Library& root_library = Library::Handle();
+  root_library ^= Api::UnwrapHandle(lib);
+  Isolate* isolate = thread->isolate();
+
+  const Class& class_class =
+      Class::Handle(Object::class_class());
+  EXPECT(!class_class.IsNull());
+  class_class.SetTraceAllocation(true);
+
+  // Invoke "foo" which during compilation, triggers a closure class allocation.
+  Dart_Handle result = Dart_Invoke(lib, NewString("foo"), 0, NULL);
+  EXPECT_VALID(result);
+
+  {
+    StackZone zone(thread);
+    HANDLESCOPE(thread);
+    Profile profile(isolate);
+    AllocationFilter filter(isolate, class_class.id());
+    filter.set_enable_embedder_ticks(true);
+    profile.Build(&filter, Profile::kNoTags);
+    // We should have one allocation sample.
+    EXPECT_EQ(1, profile.sample_count());
+    ProfileTrieWalker walker(&profile);
+
+    walker.Reset(Profile::kExclusiveCode);
+    EXPECT(walker.Down());
+#if defined(TARGET_OS_WINDOWS)
+    // TODO(johnmccutchan): Hookup native symbol resolver on Windows.
+    EXPECT_SUBSTRING("[Native]", walker.CurrentName());
+#else
+    EXPECT_SUBSTRING("dart::Profiler::RecordAllocation", walker.CurrentName());
+#endif
+    EXPECT(!walker.Down());
+  }
+
+  // Disable allocation tracing for Class.
+  class_class.SetTraceAllocation(false);
+
+  // Invoke "bar" which during compilation, triggers a closure class allocation.
+  result = Dart_Invoke(lib, NewString("bar"), 0, NULL);
+  EXPECT_VALID(result);
+
+  {
+    StackZone zone(thread);
+    HANDLESCOPE(thread);
+    Profile profile(isolate);
+    AllocationFilter filter(isolate, class_class.id());
+    filter.set_enable_embedder_ticks(true);
+    profile.Build(&filter, Profile::kNoTags);
+    // We should still only have one allocation sample.
+    EXPECT_EQ(1, profile.sample_count());
+  }
+}
+
+
 TEST_CASE(Profiler_TypedArrayAllocation) {
+  DisableNativeProfileScope dnps;
   const char* kScript =
       "import 'dart:typed_data';\n"
       "List foo() => new Float32List(4);\n";
@@ -676,7 +880,7 @@
   EXPECT_VALID(lib);
   Library& root_library = Library::Handle();
   root_library ^= Api::UnwrapHandle(lib);
-  Isolate* isolate = Isolate::Current();
+  Isolate* isolate = thread->isolate();
 
   const Library& typed_data_library =
       Library::Handle(isolate->object_store()->typed_data_library());
@@ -689,8 +893,8 @@
   EXPECT_VALID(result);
 
   {
-    StackZone zone(isolate);
-    HANDLESCOPE(isolate);
+    StackZone zone(thread);
+    HANDLESCOPE(thread);
     Profile profile(isolate);
     AllocationFilter filter(isolate, float32_list_class.id());
     profile.Build(&filter, Profile::kNoTags);
@@ -703,8 +907,8 @@
   EXPECT_VALID(result);
 
   {
-    StackZone zone(isolate);
-    HANDLESCOPE(isolate);
+    StackZone zone(thread);
+    HANDLESCOPE(thread);
     Profile profile(isolate);
     AllocationFilter filter(isolate, float32_list_class.id());
     profile.Build(&filter, Profile::kNoTags);
@@ -729,8 +933,8 @@
   EXPECT_VALID(result);
 
   {
-    StackZone zone(isolate);
-    HANDLESCOPE(isolate);
+    StackZone zone(thread);
+    HANDLESCOPE(thread);
     Profile profile(isolate);
     AllocationFilter filter(isolate, float32_list_class.id());
     profile.Build(&filter, Profile::kNoTags);
@@ -743,8 +947,8 @@
   EXPECT_VALID(result);
 
   {
-    StackZone zone(isolate);
-    HANDLESCOPE(isolate);
+    StackZone zone(thread);
+    HANDLESCOPE(thread);
     Profile profile(isolate);
     AllocationFilter filter(isolate, float32_list_class.id());
     profile.Build(&filter, Profile::kNoTags);
@@ -755,12 +959,13 @@
 
 
 TEST_CASE(Profiler_StringAllocation) {
+  DisableNativeProfileScope dnps;
   const char* kScript = "String foo(String a, String b) => a + b;";
   Dart_Handle lib = TestCase::LoadTestScript(kScript, NULL);
   EXPECT_VALID(lib);
   Library& root_library = Library::Handle();
   root_library ^= Api::UnwrapHandle(lib);
-  Isolate* isolate = Isolate::Current();
+  Isolate* isolate = thread->isolate();
 
   const Class& one_byte_string_class =
       Class::Handle(isolate->object_store()->one_byte_string_class());
@@ -772,8 +977,8 @@
   EXPECT_VALID(result);
 
   {
-    StackZone zone(isolate);
-    HANDLESCOPE(isolate);
+    StackZone zone(thread);
+    HANDLESCOPE(thread);
     Profile profile(isolate);
     AllocationFilter filter(isolate, one_byte_string_class.id());
     profile.Build(&filter, Profile::kNoTags);
@@ -786,8 +991,8 @@
   EXPECT_VALID(result);
 
   {
-    StackZone zone(isolate);
-    HANDLESCOPE(isolate);
+    StackZone zone(thread);
+    HANDLESCOPE(thread);
     Profile profile(isolate);
     AllocationFilter filter(isolate, one_byte_string_class.id());
     profile.Build(&filter, Profile::kNoTags);
@@ -808,8 +1013,8 @@
   EXPECT_VALID(result);
 
   {
-    StackZone zone(isolate);
-    HANDLESCOPE(isolate);
+    StackZone zone(thread);
+    HANDLESCOPE(thread);
     Profile profile(isolate);
     AllocationFilter filter(isolate, one_byte_string_class.id());
     profile.Build(&filter, Profile::kNoTags);
@@ -822,8 +1027,8 @@
   EXPECT_VALID(result);
 
   {
-    StackZone zone(isolate);
-    HANDLESCOPE(isolate);
+    StackZone zone(thread);
+    HANDLESCOPE(thread);
     Profile profile(isolate);
     AllocationFilter filter(isolate, one_byte_string_class.id());
     profile.Build(&filter, Profile::kNoTags);
@@ -834,12 +1039,13 @@
 
 
 TEST_CASE(Profiler_StringInterpolation) {
+  DisableNativeProfileScope dnps;
   const char* kScript = "String foo(String a, String b) => '$a | $b';";
   Dart_Handle lib = TestCase::LoadTestScript(kScript, NULL);
   EXPECT_VALID(lib);
   Library& root_library = Library::Handle();
   root_library ^= Api::UnwrapHandle(lib);
-  Isolate* isolate = Isolate::Current();
+  Isolate* isolate = thread->isolate();
 
   const Class& one_byte_string_class =
       Class::Handle(isolate->object_store()->one_byte_string_class());
@@ -851,8 +1057,8 @@
   EXPECT_VALID(result);
 
   {
-    StackZone zone(isolate);
-    HANDLESCOPE(isolate);
+    StackZone zone(thread);
+    HANDLESCOPE(thread);
     Profile profile(isolate);
     AllocationFilter filter(isolate, one_byte_string_class.id());
     profile.Build(&filter, Profile::kNoTags);
@@ -865,8 +1071,8 @@
   EXPECT_VALID(result);
 
   {
-    StackZone zone(isolate);
-    HANDLESCOPE(isolate);
+    StackZone zone(thread);
+    HANDLESCOPE(thread);
     Profile profile(isolate);
     AllocationFilter filter(isolate, one_byte_string_class.id());
     profile.Build(&filter, Profile::kNoTags);
@@ -891,8 +1097,8 @@
   EXPECT_VALID(result);
 
   {
-    StackZone zone(isolate);
-    HANDLESCOPE(isolate);
+    StackZone zone(thread);
+    HANDLESCOPE(thread);
     Profile profile(isolate);
     AllocationFilter filter(isolate, one_byte_string_class.id());
     profile.Build(&filter, Profile::kNoTags);
@@ -905,8 +1111,8 @@
   EXPECT_VALID(result);
 
   {
-    StackZone zone(isolate);
-    HANDLESCOPE(isolate);
+    StackZone zone(thread);
+    HANDLESCOPE(thread);
     Profile profile(isolate);
     AllocationFilter filter(isolate, one_byte_string_class.id());
     profile.Build(&filter, Profile::kNoTags);
@@ -917,6 +1123,7 @@
 
 
 TEST_CASE(Profiler_FunctionInline) {
+  DisableNativeProfileScope dnps;
   const char* kScript =
       "class A {\n"
       "  var a;\n"
@@ -960,9 +1167,10 @@
   // At this point B.boo should be optimized and inlined B.foo and B.choo.
 
   {
-    Isolate* isolate = Isolate::Current();
-    StackZone zone(isolate);
-    HANDLESCOPE(isolate);
+    Thread* thread = Thread::Current();
+    Isolate* isolate = thread->isolate();
+    StackZone zone(thread);
+    HANDLESCOPE(thread);
     Profile profile(isolate);
     AllocationFilter filter(isolate, class_a.id());
     profile.Build(&filter, Profile::kNoTags);
@@ -978,9 +1186,10 @@
   EXPECT_VALID(result);
 
   {
-    Isolate* isolate = Isolate::Current();
-    StackZone zone(isolate);
-    HANDLESCOPE(isolate);
+    Thread* thread = Thread::Current();
+    Isolate* isolate = thread->isolate();
+    StackZone zone(thread);
+    HANDLESCOPE(thread);
     Profile profile(isolate);
     AllocationFilter filter(isolate, class_a.id());
     profile.Build(&filter, Profile::kNoTags);
@@ -1079,9 +1288,10 @@
 
   // Test code transition tags.
   {
-    Isolate* isolate = Isolate::Current();
-    StackZone zone(isolate);
-    HANDLESCOPE(isolate);
+    Thread* thread = Thread::Current();
+    Isolate* isolate = thread->isolate();
+    StackZone zone(thread);
+    HANDLESCOPE(thread);
     Profile profile(isolate);
     AllocationFilter filter(isolate, class_a.id());
     profile.Build(&filter,
@@ -1157,5 +1367,115 @@
   }
 }
 
+
+TEST_CASE(Profiler_ChainedSamples) {
+  MaxProfileDepthScope mpds(32);
+  DisableNativeProfileScope dnps;
+
+  // Each sample holds 8 stack frames.
+  // This chain is 20 stack frames deep.
+  const char* kScript =
+      "class A {\n"
+      "  var a;\n"
+      "  var b;\n"
+      "}\n"
+      "class B {\n"
+      "  static boo() {\n"
+      "    return new A();\n"
+      "  }\n"
+      "}\n"
+      "go() => init();\n"
+      "init() => secondInit();\n"
+      "secondInit() => apple();\n"
+      "apple() => banana();\n"
+      "banana() => cantaloupe();\n"
+      "cantaloupe() => dog();\n"
+      "dog() => elephant();\n"
+      "elephant() => fred();\n"
+      "fred() => granola();\n"
+      "granola() => haystack();\n"
+      "haystack() => ice();\n"
+      "ice() => jeep();\n"
+      "jeep() => kindle();\n"
+      "kindle() => lemon();\n"
+      "lemon() => mayo();\n"
+      "mayo() => napkin();\n"
+      "napkin() => orange();\n"
+      "orange() => B.boo();\n"
+      "main() {\n"
+      "  return go();\n"
+      "}\n";
+
+  Dart_Handle lib = TestCase::LoadTestScript(kScript, NULL);
+  EXPECT_VALID(lib);
+  Library& root_library = Library::Handle();
+  root_library ^= Api::UnwrapHandle(lib);
+
+  const Class& class_a = Class::Handle(GetClass(root_library, "A"));
+  EXPECT(!class_a.IsNull());
+  class_a.SetTraceAllocation(true);
+
+  Dart_Handle result = Dart_Invoke(lib, NewString("main"), 0, NULL);
+  EXPECT_VALID(result);
+
+
+  {
+    Thread* thread = Thread::Current();
+    Isolate* isolate = thread->isolate();
+    StackZone zone(thread);
+    HANDLESCOPE(thread);
+    Profile profile(isolate);
+    AllocationFilter filter(isolate, class_a.id());
+    profile.Build(&filter, Profile::kNoTags);
+    // We should have 1 allocation sample.
+    EXPECT_EQ(1, profile.sample_count());
+    ProfileTrieWalker walker(&profile);
+
+    walker.Reset(Profile::kExclusiveCode);
+    // Move down from the root.
+    EXPECT(walker.Down());
+    EXPECT_STREQ("B.boo", walker.CurrentName());
+    EXPECT(walker.Down());
+    EXPECT_STREQ("orange", walker.CurrentName());
+    EXPECT(walker.Down());
+    EXPECT_STREQ("napkin", walker.CurrentName());
+    EXPECT(walker.Down());
+    EXPECT_STREQ("mayo", walker.CurrentName());
+    EXPECT(walker.Down());
+    EXPECT_STREQ("lemon", walker.CurrentName());
+    EXPECT(walker.Down());
+    EXPECT_STREQ("kindle", walker.CurrentName());
+    EXPECT(walker.Down());
+    EXPECT_STREQ("jeep", walker.CurrentName());
+    EXPECT(walker.Down());
+    EXPECT_STREQ("ice", walker.CurrentName());
+    EXPECT(walker.Down());
+    EXPECT_STREQ("haystack", walker.CurrentName());
+    EXPECT(walker.Down());
+    EXPECT_STREQ("granola", walker.CurrentName());
+    EXPECT(walker.Down());
+    EXPECT_STREQ("fred", walker.CurrentName());
+    EXPECT(walker.Down());
+    EXPECT_STREQ("elephant", walker.CurrentName());
+    EXPECT(walker.Down());
+    EXPECT_STREQ("dog", walker.CurrentName());
+    EXPECT(walker.Down());
+    EXPECT_STREQ("cantaloupe", walker.CurrentName());
+    EXPECT(walker.Down());
+    EXPECT_STREQ("banana", walker.CurrentName());
+    EXPECT(walker.Down());
+    EXPECT_STREQ("apple", walker.CurrentName());
+    EXPECT(walker.Down());
+    EXPECT_STREQ("secondInit", walker.CurrentName());
+    EXPECT(walker.Down());
+    EXPECT_STREQ("init", walker.CurrentName());
+    EXPECT(walker.Down());
+    EXPECT_STREQ("go", walker.CurrentName());
+    EXPECT(walker.Down());
+    EXPECT_STREQ("main", walker.CurrentName());
+    EXPECT(!walker.Down());
+  }
+}
+
 }  // namespace dart
 
diff --git a/runtime/vm/random.cc b/runtime/vm/random.cc
index 18703d0..6f1b6eb 100644
--- a/runtime/vm/random.cc
+++ b/runtime/vm/random.cc
@@ -25,6 +25,12 @@
     // We did not get a seed so far. As a fallback we do use the current time.
     seed = OS::GetCurrentTimeMicros();
   }
+  Initialize(seed);
+}
+
+
+void Random::Initialize(uint64_t seed) {
+  ASSERT(seed != 0);
   // Crank the next state a couple of times.
   _state = seed;
   NextState();
@@ -33,6 +39,12 @@
   NextState();
 }
 
+
+Random::Random(uint64_t seed) {
+  Initialize(seed);
+}
+
+
 Random::~Random() {
   // Nothing to be done here.
 }
diff --git a/runtime/vm/random.h b/runtime/vm/random.h
index cda8dd8..f5614de 100644
--- a/runtime/vm/random.h
+++ b/runtime/vm/random.h
@@ -13,6 +13,8 @@
 class Random {
  public:
   Random();
+  // Seed must be non-zero.
+  explicit Random(uint64_t seed);
   ~Random();
 
   uint32_t NextUInt32();
@@ -23,6 +25,7 @@
 
  private:
   void NextState();
+  void Initialize(uint64_t seed);
 
   uint64_t _state;
 
diff --git a/runtime/vm/raw_object.cc b/runtime/vm/raw_object.cc
index 61c2994..47fa009 100644
--- a/runtime/vm/raw_object.cc
+++ b/runtime/vm/raw_object.cc
@@ -231,7 +231,6 @@
 
 intptr_t RawObject::VisitPointers(ObjectPointerVisitor* visitor) {
   intptr_t size = 0;
-  NoHandleScope no_handles(visitor->isolate());
 
   // Only reasonable to be called on heap objects.
   ASSERT(IsHeapObject());
@@ -440,18 +439,18 @@
   }
   visitor->VisitPointers(raw_obj->from(), raw_obj->to_no_code());
 
-  if (ShouldVisitCode(raw_obj->ptr()->instructions_->ptr()->code_)) {
+  if (ShouldVisitCode(raw_obj->ptr()->code_)) {
     visitor->VisitPointer(
-        reinterpret_cast<RawObject**>(&raw_obj->ptr()->instructions_));
+        reinterpret_cast<RawObject**>(&raw_obj->ptr()->code_));
   } else {
-    visitor->skipped_code_functions()->Add(raw_obj);
+    visitor->add_skipped_code_function(raw_obj);
   }
 
   if (ShouldVisitCode(raw_obj->ptr()->unoptimized_code_)) {
     visitor->VisitPointer(
         reinterpret_cast<RawObject**>(&raw_obj->ptr()->unoptimized_code_));
   } else {
-    visitor->skipped_code_functions()->Add(raw_obj);
+    visitor->add_skipped_code_function(raw_obj);
   }
   return Function::InstanceSize();
 }
@@ -506,6 +505,16 @@
 }
 
 
+bool RawCode::ContainsPC(RawObject* raw_obj, uword pc) {
+  uword tags = raw_obj->ptr()->tags_;
+  if (RawObject::ClassIdTag::decode(tags) == kCodeCid) {
+    RawCode* raw_code = reinterpret_cast<RawCode*>(raw_obj);
+    return RawInstructions::ContainsPC(raw_code->ptr()->instructions_, pc);
+  }
+  return false;
+}
+
+
 intptr_t RawCode::VisitCodePointers(RawCode* raw_obj,
                                     ObjectPointerVisitor* visitor) {
   visitor->VisitPointers(raw_obj->from(), raw_obj->to());
@@ -547,24 +556,19 @@
 intptr_t RawInstructions::VisitInstructionsPointers(
     RawInstructions* raw_obj, ObjectPointerVisitor* visitor) {
   RawInstructions* obj = raw_obj->ptr();
-  visitor->VisitPointers(raw_obj->from(), raw_obj->to());
+  if (!Dart::IsRunningPrecompiledCode()) {
+    visitor->VisitPointers(raw_obj->from(), raw_obj->to());
+  }
   return Instructions::InstanceSize(obj->size_);
 }
 
 
-bool RawInstructions::ContainsPC(RawObject* raw_obj, uword pc) {
-  uword tags = raw_obj->ptr()->tags_;
-  if (RawObject::ClassIdTag::decode(tags) == kInstructionsCid) {
-    RawInstructions* raw_instr = reinterpret_cast<RawInstructions*>(raw_obj);
-    uword start_pc =
-        reinterpret_cast<uword>(raw_instr->ptr()) + Instructions::HeaderSize();
-    uword end_pc = start_pc + raw_instr->ptr()->size_;
-    ASSERT(end_pc > start_pc);
-    if ((pc >= start_pc) && (pc < end_pc)) {
-      return true;
-    }
-  }
-  return false;
+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_;
+  ASSERT(end_pc > start_pc);
+  return (pc >= start_pc) && (pc < end_pc);
 }
 
 
diff --git a/runtime/vm/raw_object.h b/runtime/vm/raw_object.h
index 517379b..bc68552 100644
--- a/runtime/vm/raw_object.h
+++ b/runtime/vm/raw_object.h
@@ -194,7 +194,8 @@
 
 #define SNAPSHOT_WRITER_SUPPORT()                                              \
   void WriteTo(                                                                \
-      SnapshotWriter* writer, intptr_t object_id, Snapshot::Kind kind);        \
+      SnapshotWriter* writer, intptr_t object_id,                              \
+      Snapshot::Kind kind, bool as_reference);                                 \
   friend class SnapshotWriter;                                                 \
 
 #define VISITOR_SUPPORT(object)                                                \
@@ -344,6 +345,11 @@
     ASSERT(IsMarked());
     UpdateTagBit<MarkBit>(false);
   }
+  // 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>();
+  }
 
   // Support for GC watched bit.
   // TODO(iposva): Get rid of this.
@@ -397,6 +403,11 @@
     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 IsDartInstance() {
     return (!IsHeapObject() || (GetClassId() >= kInstanceCid));
@@ -410,6 +421,12 @@
   bool IsFunction() {
     return ((GetClassId() == kFunctionCid));
   }
+  bool IsInstructions() {
+    return ((GetClassId() == kInstructionsCid));
+  }
+  bool IsCode() {
+    return ((GetClassId() == kCodeCid));
+  }
 
   intptr_t Size() const {
     uword tags = ptr()->tags_;
@@ -511,6 +528,20 @@
     } while (tags != old_tags);
   }
 
+  template<class TagBitField>
+  bool TryAcquireTagBit() {
+    uword tags = ptr()->tags_;
+    uword old_tags;
+    do {
+      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);
+    } while (tags != old_tags);
+    return true;
+  }
+
   // All writes to heap objects should ultimately pass through one of the
   // methods below or their counterparts in Object, to ensure that the
   // write barrier is correctly applied.
@@ -571,10 +602,11 @@
   friend class Heap;
   friend class HeapMapAsJSONVisitor;
   friend class ClassStatsVisitor;
-  friend class MarkingVisitor;
+  template<bool> friend class MarkingVisitorBase;
   friend class Mint;
   friend class Object;
   friend class OneByteString;  // StoreSmi
+  friend class RawCode;
   friend class RawExternalTypedData;
   friend class RawInstructions;
   friend class RawInstance;
@@ -583,6 +615,9 @@
   friend class ScavengerVisitor;
   friend class SizeExcludingClassVisitor;  // GetClassId
   friend class RetainingPathVisitor;  // GetClassId
+  friend class SkippedCodeFunctions;  // StorePointer
+  friend class InstructionsReader;  // tags_ check
+  friend class InstructionsWriter;
   friend class SnapshotReader;
   friend class SnapshotWriter;
   friend class String;
@@ -590,6 +625,7 @@
   friend class TypedDataView;
   friend class WeakProperty;  // StorePointer
   friend class Instance;  // StorePointer
+  friend class StackFrame;  // GetCodeObject assertion.
 
   DISALLOW_ALLOCATION();
   DISALLOW_IMPLICIT_CONSTRUCTORS(RawObject);
@@ -743,8 +779,8 @@
   };
 
  private:
-  // So that the MarkingVisitor::DetachCode can null out the code fields.
-  friend class MarkingVisitor;
+  // So that the SkippedCodeFunctions::DetachCode can null out the code fields.
+  friend class SkippedCodeFunctions;
   friend class Class;
   RAW_HEAP_OBJECT_IMPLEMENTATION(Function);
   static bool ShouldVisitCode(RawCode* raw_code);
@@ -761,16 +797,16 @@
   RawObject** to_snapshot() {
     return reinterpret_cast<RawObject**>(&ptr()->data_);
   }
-  // Fields below are not part of the snapshot.
   RawArray* ic_data_array_;  // ICData of unoptimized code.
   RawObject** to_no_code() {
     return reinterpret_cast<RawObject**>(&ptr()->ic_data_array_);
   }
-  RawInstructions* instructions_;  // Instructions of currently active code.
+  RawCode* code_;  // Currently active code.
   RawCode* unoptimized_code_;  // Unoptimized code, keep it after optimization.
   RawObject** to() {
     return reinterpret_cast<RawObject**>(&ptr()->unoptimized_code_);
   }
+  uword entry_point_;
 
   int32_t token_pos_;
   int32_t end_token_pos_;
@@ -778,7 +814,6 @@
   int16_t num_fixed_parameters_;
   int16_t num_optional_parameters_;  // > 0: positional; < 0: named.
   int16_t deoptimization_counter_;
-  classid_t regexp_cid_;
   uint32_t kind_tag_;  // See Function::KindTagBits.
   uint16_t optimized_instruction_count_;
   uint16_t optimized_call_site_count_;
@@ -828,9 +863,20 @@
   RawObject* owner_;  // Class or patch class or mixin class
                       // where this field is defined.
   RawAbstractType* type_;
-  RawInstance* value_;  // Offset in words for instance and value for static.
+  union {
+    RawInstance* static_value_;  // Value for static fields.
+    RawSmi* offset_;  // Offset in words for instance fields.
+  } value_;
   RawArray* dependent_code_;
-  RawFunction* initializer_;
+  union {
+    // When precompiling we need to save the static initializer function here
+    // so that code for it can be generated.
+    RawFunction* precompiled_;  // Static initializer function - precompiling.
+    // When generating script snapshots after running the application it is
+    // necessary to save the initial value of static fields so that we can
+    // restore the value back to the original initial value.
+    RawInstance* saved_value_;  // Saved initial value - static fields.
+  } initializer_;
   RawSmi* guarded_list_length_;
   RawObject** to() {
     return reinterpret_cast<RawObject**>(&ptr()->guarded_list_length_);
@@ -928,16 +974,19 @@
   RawScript* script_;
   RawString* private_key_;
   RawArray* dictionary_;         // Top-level names in this library.
-  RawArray* resolved_names_;     // Cache of resolved names in library scope.
   RawGrowableObjectArray* metadata_;  // Metadata on classes, methods etc.
   RawArray* anonymous_classes_;  // Classes containing top-level elements.
   RawArray* imports_;            // List of Namespaces imported without prefix.
   RawArray* exports_;            // List of re-exported Namespaces.
-  RawArray* loaded_scripts_;     // Array of scripts loaded in this library.
   RawInstance* load_error_;      // Error iff load_state_ == kLoadError.
-  RawObject** to() {
+  RawObject** to_snapshot() {
     return reinterpret_cast<RawObject**>(&ptr()->load_error_);
   }
+  RawArray* resolved_names_;     // Cache of resolved names in library scope.
+  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_;
@@ -982,10 +1031,14 @@
 
   RAW_HEAP_OBJECT_IMPLEMENTATION(Code);
 
+  uword entry_point_;
+
   RawObject** from() {
-    return reinterpret_cast<RawObject**>(&ptr()->instructions_);
+    return reinterpret_cast<RawObject**>(&ptr()->active_instructions_);
   }
+  RawInstructions* active_instructions_;
   RawInstructions* instructions_;
+  RawObjectPool* object_pool_;
   // 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.
   // Else, owner_ is a regular Dart Function.
@@ -998,11 +1051,11 @@
   RawLocalVarDescriptors* var_descriptors_;
   RawArray* inlined_metadata_;
   RawArray* comments_;
-  // If return_address_info_ is a Smi, it is the offset to the prologue.
-  // Else, return_address_info_ is null.
+  // If return_address_metadata_ is a Smi, it is the offset to the prologue.
+  // Else, return_address_metadata_ is null.
   RawObject* return_address_metadata_;
   RawObject** to() {
-    return reinterpret_cast<RawObject**>(&ptr()->comments_);
+    return reinterpret_cast<RawObject**>(&ptr()->return_address_metadata_);
   }
 
   // Compilation timestamp.
@@ -1015,17 +1068,19 @@
   int32_t state_bits_;
 
   // PC offsets for code patching.
-  int32_t entry_patch_pc_offset_;
-  int32_t patch_code_pc_offset_;
   int32_t lazy_deopt_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); }
 
+  static bool ContainsPC(RawObject* raw_obj, uword pc);
+
   friend class Function;
-  friend class MarkingVisitor;
+  template<bool> friend class MarkingVisitorBase;
+  friend class SkippedCodeFunctions;
   friend class StackFrame;
+  friend class Profiler;
 };
 
 
@@ -1047,6 +1102,7 @@
   Entry* first_entry() { return &ptr()->data()[0]; }
 
   friend class Object;
+  friend class SnapshotReader;
 };
 
 
@@ -1057,10 +1113,10 @@
     return reinterpret_cast<RawObject**>(&ptr()->code_);
   }
   RawCode* code_;
-  RawObjectPool* object_pool_;
   RawObject** to() {
-    return reinterpret_cast<RawObject**>(&ptr()->object_pool_);
+    return reinterpret_cast<RawObject**>(&ptr()->code_);
   }
+
   int32_t size_;
 
   // Variable length data follows here.
@@ -1069,14 +1125,17 @@
   // Private helper function used while visiting stack frames. The
   // code which iterates over dart frames is also called during GC and
   // is not allowed to create handles.
-  static bool ContainsPC(RawObject* raw_obj, uword pc);
+  static bool ContainsPC(RawInstructions* raw_instr, uword pc);
 
   friend class RawCode;
   friend class RawFunction;
   friend class Code;
   friend class StackFrame;
-  friend class MarkingVisitor;
+  template<bool> friend class MarkingVisitorBase;
+  friend class SkippedCodeFunctions;
   friend class Function;
+  friend class InstructionsReader;
+  friend class InstructionsWriter;
 };
 
 
@@ -1134,6 +1193,7 @@
   const uint8_t* data() const { OPEN_ARRAY_START(uint8_t, intptr_t); }
 
   friend class Object;
+  friend class SnapshotReader;
 };
 
 
@@ -1141,9 +1201,8 @@
 // PC. The stack map representation consists of a bit map which marks each
 // live object index starting from the base of the frame.
 //
-// The Stackmap also consists of a link to the code object corresponding to
-// the frame which the stack map is describing.  The bit map representation
-// is optimized for dense and small bit maps, without any upper bound.
+// The bit map representation is optimized for dense and small bit maps, without
+// any upper bound.
 class RawStackmap : public RawObject {
   RAW_HEAP_OBJECT_IMPLEMENTATION(Stackmap);
 
@@ -1161,6 +1220,8 @@
   // Variable length data follows here (bitmap of the stack layout).
   uint8_t* data() { OPEN_ARRAY_START(uint8_t, uint8_t); }
   const uint8_t* data() const { OPEN_ARRAY_START(uint8_t, uint8_t); }
+
+  friend class SnapshotReader;
 };
 
 
@@ -1171,7 +1232,6 @@
     kContextVar,
     kContextLevel,
     kSavedCurrentContext,
-    kAsyncOperation
   };
 
   enum {
@@ -1235,6 +1295,7 @@
   }
 
   friend class Object;
+  friend class SnapshotReader;
 };
 
 
@@ -1264,6 +1325,7 @@
   HandlerInfo* data() { OPEN_ARRAY_START(HandlerInfo, intptr_t); }
 
   friend class Object;
+  friend class SnapshotReader;
 };
 
 
@@ -1307,6 +1369,7 @@
   };
 
   int32_t num_variables_;
+  bool is_implicit_;  // true, if this context scope is for an implicit closure.
 
   RawObject** from() {
     VariableDesc* begin = const_cast<VariableDesc*>(ptr()->VariableDescAddr(0));
@@ -1324,6 +1387,10 @@
     // 'end' is the address just beyond the last descriptor, so step back.
     return reinterpret_cast<RawObject**>(end - kWordSize);
   }
+
+  friend class Object;
+  friend class RawClosureData;
+  friend class SnapshotReader;
 };
 
 
@@ -1428,6 +1495,8 @@
   RawObject** to() {
     return reinterpret_cast<RawObject**>(&ptr()->message_);
   }
+  bool is_user_initiated_;
+  bool is_vm_restart_;
 };
 
 
@@ -1569,11 +1638,12 @@
 class RawMint : public RawInteger {
   RAW_HEAP_OBJECT_IMPLEMENTATION(Mint);
 
-  int64_t value_;
+  ALIGN8 int64_t value_;
 
   friend class Api;
   friend class SnapshotReader;
 };
+COMPILE_ASSERT(sizeof(RawMint) == 16);
 
 
 class RawBigint : public RawInteger {
@@ -1590,11 +1660,12 @@
 class RawDouble : public RawNumber {
   RAW_HEAP_OBJECT_IMPLEMENTATION(Double);
 
-  double value_;
+  ALIGN8 double value_;
 
   friend class Api;
   friend class SnapshotReader;
 };
+COMPILE_ASSERT(sizeof(RawDouble) == 16);
 
 
 class RawString : public RawInstance {
@@ -1940,7 +2011,7 @@
 
   friend class DelaySet;
   friend class GCMarker;
-  friend class MarkingVisitor;
+  template<bool> friend class MarkingVisitorBase;
   friend class Scavenger;
   friend class ScavengerVisitor;
 };
diff --git a/runtime/vm/raw_object_snapshot.cc b/runtime/vm/raw_object_snapshot.cc
index 0cff97a..8a65fdb 100644
--- a/runtime/vm/raw_object_snapshot.cc
+++ b/runtime/vm/raw_object_snapshot.cc
@@ -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.
 
+#include "vm/native_entry.h"
 #include "vm/object.h"
 #include "vm/object_store.h"
 #include "vm/snapshot.h"
@@ -11,6 +12,8 @@
 
 namespace dart {
 
+DECLARE_FLAG(int, optimization_counter_threshold);
+
 #define NEW_OBJECT(type)                                                       \
   ((kind == Snapshot::kFull) ? reader->New##type() : type::New())
 
@@ -24,10 +27,23 @@
 #define OFFSET_OF_FROM(obj)                                                    \
   obj.raw()->from() - reinterpret_cast<RawObject**>(obj.raw()->ptr())
 
+// TODO(18854): Need to assert No GC can happen here, even though
+// allocations may happen.
+#define READ_OBJECT_FIELDS(object, from, to, as_reference)                     \
+  intptr_t num_flds = (to) - (from);                                           \
+  intptr_t from_offset = OFFSET_OF_FROM(object);                               \
+  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());                 \
+  }
+
 RawClass* Class::ReadFrom(SnapshotReader* reader,
                           intptr_t object_id,
                           intptr_t tags,
-                          Snapshot::Kind kind) {
+                          Snapshot::Kind kind,
+                          bool as_reference) {
   ASSERT(reader != NULL);
 
   Class& cls = Class::ZoneHandle(reader->zone(), Class::null());
@@ -64,16 +80,8 @@
     cls.set_state_bits(reader->Read<uint16_t>());
 
     // Set all the object fields.
-    // TODO(5411462): Need to assert No GC can happen here, even though
-    // allocations may happen.
-    intptr_t num_flds = (cls.raw()->to() - cls.raw()->from());
-    intptr_t from_offset = OFFSET_OF_FROM(cls);
-    for (intptr_t i = 0; i <= num_flds; i++) {
-      (*reader->PassiveObjectHandle()) =
-          reader->ReadObjectImpl(kAsReference, object_id, (i + from_offset));
-      cls.StorePointer((cls.raw()->from() + i),
-                       reader->PassiveObjectHandle()->raw());
-    }
+    READ_OBJECT_FIELDS(cls, cls.raw()->from(), cls.raw()->to(), kAsReference);
+
     ASSERT(!cls.IsInFullSnapshot() || (kind == Snapshot::kFull));
   } else {
     cls ^= reader->ReadClassId(object_id);
@@ -85,7 +93,8 @@
 
 void RawClass::WriteTo(SnapshotWriter* writer,
                        intptr_t object_id,
-                       Snapshot::Kind kind) {
+                       Snapshot::Kind kind,
+                       bool as_reference) {
   ASSERT(writer != NULL);
   bool is_in_fullsnapshot = Class::IsInFullSnapshot(this);
 
@@ -122,7 +131,7 @@
     writer->Write<uint16_t>(ptr()->state_bits_);
 
     // Write out all the object pointer fields.
-    SnapshotWriterVisitor visitor(writer);
+    SnapshotWriterVisitor visitor(writer, kAsReference);
     visitor.VisitPointers(from(), to());
   } else {
     if (writer->can_send_any_object() ||
@@ -141,7 +150,8 @@
 RawUnresolvedClass* UnresolvedClass::ReadFrom(SnapshotReader* reader,
                                               intptr_t object_id,
                                               intptr_t tags,
-                                              Snapshot::Kind kind) {
+                                              Snapshot::Kind kind,
+                                              bool as_reference) {
   ASSERT(reader != NULL);
 
   // Allocate unresolved class object.
@@ -153,22 +163,19 @@
   unresolved_class.set_token_pos(reader->Read<int32_t>());
 
   // Set all the object fields.
-  // TODO(5411462): Need to assert No GC can happen here, even though
-  // allocations may happen.
-  intptr_t num_flds = (unresolved_class.raw()->to() -
-                       unresolved_class.raw()->from());
-  for (intptr_t i = 0; i <= num_flds; i++) {
-    (*reader->PassiveObjectHandle()) = reader->ReadObjectImpl(kAsReference);
-    unresolved_class.StorePointer((unresolved_class.raw()->from() + i),
-                                  reader->PassiveObjectHandle()->raw());
-  }
+  READ_OBJECT_FIELDS(unresolved_class,
+                     unresolved_class.raw()->from(),
+                     unresolved_class.raw()->to(),
+                     kAsReference);
+
   return unresolved_class.raw();
 }
 
 
 void RawUnresolvedClass::WriteTo(SnapshotWriter* writer,
                                  intptr_t object_id,
-                                 Snapshot::Kind kind) {
+                                 Snapshot::Kind kind,
+                                 bool as_reference) {
   ASSERT(writer != NULL);
 
   // Write out the serialization header value for this object.
@@ -182,7 +189,7 @@
   writer->Write<int32_t>(ptr()->token_pos_);
 
   // Write out all the object pointer fields.
-  SnapshotWriterVisitor visitor(writer);
+  SnapshotWriterVisitor visitor(writer, kAsReference);
   visitor.VisitPointers(from(), to());
 }
 
@@ -190,7 +197,8 @@
 RawAbstractType* AbstractType::ReadFrom(SnapshotReader* reader,
                                         intptr_t object_id,
                                         intptr_t tags,
-                                        Snapshot::Kind kind) {
+                                        Snapshot::Kind kind,
+                                        bool as_reference) {
   UNREACHABLE();  // AbstractType is an abstract class.
   return NULL;
 }
@@ -198,7 +206,8 @@
 
 void RawAbstractType::WriteTo(SnapshotWriter* writer,
                               intptr_t object_id,
-                              Snapshot::Kind kind) {
+                              Snapshot::Kind kind,
+                              bool as_reference) {
   UNREACHABLE();  // AbstractType is an abstract class.
 }
 
@@ -206,7 +215,8 @@
 RawType* Type::ReadFrom(SnapshotReader* reader,
                         intptr_t object_id,
                         intptr_t tags,
-                        Snapshot::Kind kind) {
+                        Snapshot::Kind kind,
+                        bool as_reference) {
   ASSERT(reader != NULL);
 
   // Determine if the type class of this type is in the full snapshot.
@@ -224,16 +234,7 @@
   type.set_type_state(reader->Read<int8_t>());
 
   // Set all the object fields.
-  // TODO(5411462): Need to assert No GC can happen here, even though
-  // allocations may happen.
-  intptr_t num_flds = (type.raw()->to() - type.raw()->from());
-  intptr_t from_offset = OFFSET_OF_FROM(type);
-  for (intptr_t i = 0; i <= num_flds; i++) {
-    (*reader->PassiveObjectHandle()) =
-        reader->ReadObjectImpl(kAsReference, object_id, (i + from_offset));
-    type.StorePointer((type.raw()->from() + i),
-                      reader->PassiveObjectHandle()->raw());
-  }
+  READ_OBJECT_FIELDS(type, type.raw()->from(), type.raw()->to(), kAsReference);
 
   // Set the canonical bit.
   if (!defer_canonicalization && RawObject::IsCanonical(tags)) {
@@ -246,7 +247,8 @@
 
 void RawType::WriteTo(SnapshotWriter* writer,
                       intptr_t object_id,
-                      Snapshot::Kind kind) {
+                      Snapshot::Kind kind,
+                      bool as_reference) {
   ASSERT(writer != NULL);
 
   // Only resolved and finalized types should be written to a snapshot.
@@ -277,7 +279,7 @@
   // the type object when reading it back we should write out all the fields
   // inline and not as references.
   ASSERT(ptr()->type_class_ != Object::null());
-  SnapshotWriterVisitor visitor(writer);
+  SnapshotWriterVisitor visitor(writer, kAsReference);
   visitor.VisitPointers(from(), to());
 }
 
@@ -285,7 +287,8 @@
 RawTypeRef* TypeRef::ReadFrom(SnapshotReader* reader,
                               intptr_t object_id,
                               intptr_t tags,
-                              Snapshot::Kind kind) {
+                              Snapshot::Kind kind,
+                              bool as_reference) {
   ASSERT(reader != NULL);
 
   // Allocate type ref object.
@@ -294,16 +297,9 @@
   reader->AddBackRef(object_id, &type_ref, kIsDeserialized);
 
   // Set all the object fields.
-  // TODO(5411462): Need to assert No GC can happen here, even though
-  // allocations may happen.
-  intptr_t num_flds = (type_ref.raw()->to() - type_ref.raw()->from());
-  intptr_t from_offset = OFFSET_OF_FROM(type_ref);
-  for (intptr_t i = 0; i <= num_flds; i++) {
-    (*reader->PassiveObjectHandle()) =
-        reader->ReadObjectImpl(kAsReference, object_id, (i + from_offset));
-    type_ref.StorePointer((type_ref.raw()->from() + i),
-                          reader->PassiveObjectHandle()->raw());
-  }
+  READ_OBJECT_FIELDS(type_ref,
+                     type_ref.raw()->from(), type_ref.raw()->to(),
+                     kAsReference);
 
   return type_ref.raw();
 }
@@ -311,7 +307,8 @@
 
 void RawTypeRef::WriteTo(SnapshotWriter* writer,
                          intptr_t object_id,
-                         Snapshot::Kind kind) {
+                         Snapshot::Kind kind,
+                         bool as_reference) {
   ASSERT(writer != NULL);
 
   // Write out the serialization header value for this object.
@@ -322,7 +319,7 @@
   writer->WriteTags(writer->GetObjectTags(this));
 
   // Write out all the object pointer fields.
-  SnapshotWriterVisitor visitor(writer);
+  SnapshotWriterVisitor visitor(writer, kAsReference);
   visitor.VisitPointers(from(), to());
 }
 
@@ -330,7 +327,8 @@
 RawTypeParameter* TypeParameter::ReadFrom(SnapshotReader* reader,
                                           intptr_t object_id,
                                           intptr_t tags,
-                                          Snapshot::Kind kind) {
+                                          Snapshot::Kind kind,
+                                          bool as_reference) {
   ASSERT(reader != NULL);
 
   // Allocate type parameter object.
@@ -344,17 +342,9 @@
   type_parameter.set_type_state(reader->Read<int8_t>());
 
   // Set all the object fields.
-  // TODO(5411462): Need to assert No GC can happen here, even though
-  // allocations may happen.
-  intptr_t num_flds = (type_parameter.raw()->to() -
-                       type_parameter.raw()->from());
-  intptr_t from_offset = OFFSET_OF_FROM(type_parameter);
-  for (intptr_t i = 0; i <= num_flds; i++) {
-    (*reader->PassiveObjectHandle()) =
-        reader->ReadObjectImpl(kAsReference, object_id, (i + from_offset));
-    type_parameter.StorePointer((type_parameter.raw()->from() + i),
-                                reader->PassiveObjectHandle()->raw());
-  }
+  READ_OBJECT_FIELDS(type_parameter,
+                     type_parameter.raw()->from(), type_parameter.raw()->to(),
+                     kAsReference);
 
   return type_parameter.raw();
 }
@@ -362,7 +352,8 @@
 
 void RawTypeParameter::WriteTo(SnapshotWriter* writer,
                                intptr_t object_id,
-                               Snapshot::Kind kind) {
+                               Snapshot::Kind kind,
+                               bool as_reference) {
   ASSERT(writer != NULL);
 
   // Only finalized type parameters should be written to a snapshot.
@@ -381,7 +372,7 @@
   writer->Write<int8_t>(ptr()->type_state_);
 
   // Write out all the object pointer fields.
-  SnapshotWriterVisitor visitor(writer);
+  SnapshotWriterVisitor visitor(writer, kAsReference);
   visitor.VisitPointers(from(), to());
 }
 
@@ -389,7 +380,8 @@
 RawBoundedType* BoundedType::ReadFrom(SnapshotReader* reader,
                                       intptr_t object_id,
                                       intptr_t tags,
-                                      Snapshot::Kind kind) {
+                                      Snapshot::Kind kind,
+                                      bool as_reference) {
   ASSERT(reader != NULL);
 
   // Allocate bounded type object.
@@ -398,17 +390,9 @@
   reader->AddBackRef(object_id, &bounded_type, kIsDeserialized);
 
   // Set all the object fields.
-  // TODO(5411462): Need to assert No GC can happen here, even though
-  // allocations may happen.
-  intptr_t num_flds = (bounded_type.raw()->to() -
-                       bounded_type.raw()->from());
-  intptr_t from_offset = OFFSET_OF_FROM(bounded_type);
-  for (intptr_t i = 0; i <= num_flds; i++) {
-    (*reader->PassiveObjectHandle()) =
-        reader->ReadObjectImpl(kAsReference, object_id, (i + from_offset));
-    bounded_type.StorePointer((bounded_type.raw()->from() + i),
-                              reader->PassiveObjectHandle()->raw());
-  }
+  READ_OBJECT_FIELDS(bounded_type,
+                     bounded_type.raw()->from(), bounded_type.raw()->to(),
+                     kAsReference);
 
   return bounded_type.raw();
 }
@@ -416,7 +400,8 @@
 
 void RawBoundedType::WriteTo(SnapshotWriter* writer,
                              intptr_t object_id,
-                             Snapshot::Kind kind) {
+                             Snapshot::Kind kind,
+                             bool as_reference) {
   ASSERT(writer != NULL);
 
   // Write out the serialization header value for this object.
@@ -427,7 +412,7 @@
   writer->WriteTags(writer->GetObjectTags(this));
 
   // Write out all the object pointer fields.
-  SnapshotWriterVisitor visitor(writer);
+  SnapshotWriterVisitor visitor(writer, kAsReference);
   visitor.VisitPointers(from(), to());
 }
 
@@ -435,7 +420,8 @@
 RawMixinAppType* MixinAppType::ReadFrom(SnapshotReader* reader,
                                         intptr_t object_id,
                                         intptr_t tags,
-                                        Snapshot::Kind kind) {
+                                        Snapshot::Kind kind,
+                                        bool as_reference) {
   UNREACHABLE();  // MixinAppType objects do not survive finalization.
   return MixinAppType::null();
 }
@@ -443,7 +429,8 @@
 
 void RawMixinAppType::WriteTo(SnapshotWriter* writer,
                               intptr_t object_id,
-                              Snapshot::Kind kind) {
+                              Snapshot::Kind kind,
+                              bool as_reference) {
   UNREACHABLE();  // MixinAppType objects do not survive finalization.
 }
 
@@ -451,7 +438,8 @@
 RawTypeArguments* TypeArguments::ReadFrom(SnapshotReader* reader,
                                           intptr_t object_id,
                                           intptr_t tags,
-                                          Snapshot::Kind kind) {
+                                          Snapshot::Kind kind,
+                                          bool as_reference) {
   ASSERT(reader != NULL);
 
   // Read the length so that we can determine instance size to allocate.
@@ -494,7 +482,8 @@
 
 void RawTypeArguments::WriteTo(SnapshotWriter* writer,
                                intptr_t object_id,
-                               Snapshot::Kind kind) {
+                               Snapshot::Kind kind,
+                               bool as_reference) {
   ASSERT(writer != NULL);
 
   // Write out the serialization header value for this object.
@@ -523,7 +512,8 @@
 RawPatchClass* PatchClass::ReadFrom(SnapshotReader* reader,
                                     intptr_t object_id,
                                     intptr_t tags,
-                                    Snapshot::Kind kind) {
+                                    Snapshot::Kind kind,
+                                    bool as_reference) {
   ASSERT(reader != NULL);
 
   // Allocate function object.
@@ -532,25 +522,17 @@
   reader->AddBackRef(object_id, &cls, kIsDeserialized);
 
   // Set all the object fields.
-  // TODO(5411462): Need to assert No GC can happen here, even though
-  // allocations may happen.
-  intptr_t num_flds = (cls.raw()->to() - cls.raw()->from());
-  for (intptr_t i = 0; i <= num_flds; i++) {
-    (*reader->PassiveObjectHandle()) = reader->ReadObjectImpl(kAsReference);
-    cls.StorePointer((cls.raw()->from() + i),
-                     reader->PassiveObjectHandle()->raw());
-  }
-  ASSERT(((kind == Snapshot::kScript) &&
-          !Class::IsInFullSnapshot(cls.source_class())) ||
-         (kind == Snapshot::kFull));
+  READ_OBJECT_FIELDS(cls, cls.raw()->from(), cls.raw()->to(), kAsReference);
 
+  ASSERT((kind == Snapshot::kScript) || (kind == Snapshot::kFull));
   return cls.raw();
 }
 
 
 void RawPatchClass::WriteTo(SnapshotWriter* writer,
                             intptr_t object_id,
-                            Snapshot::Kind kind) {
+                            Snapshot::Kind kind,
+                            bool as_reference) {
   ASSERT(writer != NULL);
   ASSERT((kind == Snapshot::kScript) || (kind == Snapshot::kFull));
 
@@ -561,7 +543,7 @@
   writer->WriteVMIsolateObject(kPatchClassCid);
   writer->WriteTags(writer->GetObjectTags(this));
   // Write out all the object pointer fields.
-  SnapshotWriterVisitor visitor(writer);
+  SnapshotWriterVisitor visitor(writer, kAsReference);
   visitor.VisitPointers(from(), to());
 }
 
@@ -569,7 +551,8 @@
 RawClosureData* ClosureData::ReadFrom(SnapshotReader* reader,
                                       intptr_t object_id,
                                       intptr_t tags,
-                                      Snapshot::Kind kind) {
+                                      Snapshot::Kind kind,
+                                      bool as_reference) {
   ASSERT(reader != NULL);
   ASSERT((kind == Snapshot::kScript) || (kind == Snapshot::kFull));
 
@@ -579,12 +562,9 @@
   reader->AddBackRef(object_id, &data, kIsDeserialized);
 
   // Set all the object fields.
-  // TODO(5411462): Need to assert No GC can happen here, even though
-  // allocations may happen.
-  intptr_t num_flds = (data.raw()->to() - data.raw()->from());
-  for (intptr_t i = 0; i <= num_flds; i++) {
-    *(data.raw()->from() + i) = reader->ReadObjectImpl(kAsReference);
-  }
+  READ_OBJECT_FIELDS(data,
+                     data.raw()->from(), data.raw()->to(),
+                     kAsInlinedObject);
 
   return data.raw();
 }
@@ -592,7 +572,8 @@
 
 void RawClosureData::WriteTo(SnapshotWriter* writer,
                              intptr_t object_id,
-                             Snapshot::Kind kind) {
+                             Snapshot::Kind kind,
+                             bool as_reference) {
   ASSERT(writer != NULL);
   ASSERT((kind == Snapshot::kScript) || (kind == Snapshot::kFull));
 
@@ -604,8 +585,16 @@
   writer->WriteTags(writer->GetObjectTags(this));
 
   // Context scope.
-  // We don't write the context scope in the snapshot.
-  writer->WriteObjectImpl(Object::null(), kAsInlinedObject);
+  if (ptr()->context_scope_ == Object::empty_context_scope().raw()) {
+    writer->WriteVMIsolateObject(kEmptyContextScopeObject);
+  } else {
+    if (ptr()->context_scope_->ptr()->is_implicit_) {
+      writer->WriteObjectImpl(ptr()->context_scope_, kAsInlinedObject);
+    } else {
+      // We don't write non implicit context scopes in the snapshot.
+      writer->WriteVMIsolateObject(kNullObject);
+    }
+  }
 
   // Parent function.
   writer->WriteObjectImpl(ptr()->parent_function_, kAsInlinedObject);
@@ -615,14 +604,15 @@
 
   // Static closure/Closure allocation stub.
   // We don't write the closure or allocation stub in the snapshot.
-  writer->WriteObjectImpl(Object::null(), kAsInlinedObject);
+  writer->WriteVMIsolateObject(kNullObject);
 }
 
 
 RawRedirectionData* RedirectionData::ReadFrom(SnapshotReader* reader,
                                               intptr_t object_id,
                                               intptr_t tags,
-                                              Snapshot::Kind kind) {
+                                              Snapshot::Kind kind,
+                                              bool as_reference) {
   ASSERT(reader != NULL);
   ASSERT((kind == Snapshot::kScript) || (kind == Snapshot::kFull));
 
@@ -632,16 +622,9 @@
   reader->AddBackRef(object_id, &data, kIsDeserialized);
 
   // Set all the object fields.
-  // TODO(5411462): Need to assert No GC can happen here, even though
-  // allocations may happen.
-  intptr_t num_flds = (data.raw()->to() - data.raw()->from());
-  intptr_t from_offset = OFFSET_OF_FROM(data);
-  for (intptr_t i = 0; i <= num_flds; i++) {
-    (*reader->PassiveObjectHandle()) =
-        reader->ReadObjectImpl(kAsReference, object_id, (i + from_offset));
-    data.StorePointer((data.raw()->from() + i),
-                      reader->PassiveObjectHandle()->raw());
-  }
+  READ_OBJECT_FIELDS(data,
+                     data.raw()->from(), data.raw()->to(),
+                     kAsReference);
 
   return data.raw();
 }
@@ -649,7 +632,8 @@
 
 void RawRedirectionData::WriteTo(SnapshotWriter* writer,
                                  intptr_t object_id,
-                                 Snapshot::Kind kind) {
+                                 Snapshot::Kind kind,
+                                 bool as_reference) {
   ASSERT(writer != NULL);
   ASSERT((kind == Snapshot::kScript) || (kind == Snapshot::kFull));
 
@@ -661,7 +645,7 @@
   writer->WriteTags(writer->GetObjectTags(this));
 
   // Write out all the object pointer fields.
-  SnapshotWriterVisitor visitor(writer);
+  SnapshotWriterVisitor visitor(writer, kAsReference);
   visitor.VisitPointers(from(), to());
 }
 
@@ -669,51 +653,75 @@
 RawFunction* Function::ReadFrom(SnapshotReader* reader,
                                 intptr_t object_id,
                                 intptr_t tags,
-                                Snapshot::Kind kind) {
+                                Snapshot::Kind kind,
+                                bool as_reference) {
   ASSERT(reader != NULL);
   ASSERT((kind == Snapshot::kScript) || (kind == Snapshot::kFull));
 
-  // Allocate function object.
-  Function& func = Function::ZoneHandle(
-      reader->zone(), NEW_OBJECT(Function));
-  reader->AddBackRef(object_id, &func, kIsDeserialized);
+  bool is_in_fullsnapshot = reader->Read<bool>();
+  if ((kind == Snapshot::kFull) || !is_in_fullsnapshot) {
+    // Allocate function object.
+    Function& func = Function::ZoneHandle(
+        reader->zone(), NEW_OBJECT(Function));
+    reader->AddBackRef(object_id, &func, kIsDeserialized);
 
-  // Set all the non object fields.
-  func.set_token_pos(reader->Read<int32_t>());
-  func.set_end_token_pos(reader->Read<int32_t>());
-  func.set_usage_counter(reader->Read<int32_t>());
-  func.set_num_fixed_parameters(reader->Read<int16_t>());
-  func.set_num_optional_parameters(reader->Read<int16_t>());
-  func.set_deoptimization_counter(reader->Read<int16_t>());
-  func.set_regexp_cid(reader->ReadClassIDValue());
-  func.set_kind_tag(reader->Read<uint32_t>());
-  func.set_optimized_instruction_count(reader->Read<uint16_t>());
-  func.set_optimized_call_site_count(reader->Read<uint16_t>());
+    // Set all the non object fields.
+    func.set_token_pos(reader->Read<int32_t>());
+    func.set_end_token_pos(reader->Read<int32_t>());
+    func.set_usage_counter(reader->Read<int32_t>());
+    func.set_num_fixed_parameters(reader->Read<int16_t>());
+    func.set_num_optional_parameters(reader->Read<int16_t>());
+    func.set_deoptimization_counter(reader->Read<int16_t>());
+    func.set_kind_tag(reader->Read<uint32_t>());
+    func.set_optimized_instruction_count(reader->Read<uint16_t>());
+    func.set_optimized_call_site_count(reader->Read<uint16_t>());
 
-  // Set all the object fields.
-  // TODO(5411462): Need to assert No GC can happen here, even though
-  // allocations may happen.
-  intptr_t num_flds = (func.raw()->to_snapshot() - func.raw()->from());
-  intptr_t from_offset = OFFSET_OF_FROM(func);
-  for (intptr_t i = 0; i <= num_flds; i++) {
-    (*reader->PassiveObjectHandle()) =
-        reader->ReadObjectImpl(kAsReference, object_id, (i + from_offset));
-    func.StorePointer((func.raw()->from() + i),
-                      reader->PassiveObjectHandle()->raw());
+    // Set all the object fields.
+    READ_OBJECT_FIELDS(func,
+                       func.raw()->from(), func.raw()->to_snapshot(),
+                       kAsReference);
+    // Initialize all fields that are not part of the snapshot.
+    if (reader->snapshot_code()) {
+      func.ClearICDataArray();
+      func.ClearCode();
+      // Read the code object and fixup entry point.
+      (*reader->CodeHandle()) ^= reader->ReadObjectImpl(kAsInlinedObject);
+      func.SetInstructions(*reader->CodeHandle());
+    } else {
+      bool is_optimized = func.usage_counter() != 0;
+      if (is_optimized) {
+        // Read the ic data array as the function is an optimized one.
+        (*reader->ArrayHandle()) ^= reader->ReadObjectImpl(kAsReference);
+        func.set_ic_data_array(*reader->ArrayHandle());
+      } else {
+        func.ClearICDataArray();
+      }
+      func.ClearCode();
+    }
+    return func.raw();
+  } else {
+    return reader->ReadFunctionId(object_id);
   }
-
-  // Initialize all fields that are not part of the snapshot.
-  func.ClearICDataArray();
-  func.ClearCode();
-  return func.raw();
 }
 
 
 void RawFunction::WriteTo(SnapshotWriter* writer,
                           intptr_t object_id,
-                          Snapshot::Kind kind) {
+                          Snapshot::Kind kind,
+                          bool as_reference) {
   ASSERT(writer != NULL);
   ASSERT((kind == Snapshot::kScript) || (kind == Snapshot::kFull));
+  bool is_in_fullsnapshot = false;
+  bool owner_is_class = false;
+  if (kind == Snapshot::kScript) {
+    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_));
+  }
 
   // Write out the serialization header value for this object.
   writer->WriteInlinedObjectHeader(object_id);
@@ -722,28 +730,54 @@
   writer->WriteVMIsolateObject(kFunctionCid);
   writer->WriteTags(writer->GetObjectTags(this));
 
-  // Write out all the non object fields.
-  writer->Write<int32_t>(ptr()->token_pos_);
-  writer->Write<int32_t>(ptr()->end_token_pos_);
-  writer->Write<int32_t>(ptr()->usage_counter_);
-  writer->Write<int16_t>(ptr()->num_fixed_parameters_);
-  writer->Write<int16_t>(ptr()->num_optional_parameters_);
-  writer->Write<int16_t>(ptr()->deoptimization_counter_);
-  writer->WriteClassIDValue(ptr()->regexp_cid_);
-  writer->Write<uint32_t>(ptr()->kind_tag_);
-  writer->Write<uint16_t>(ptr()->optimized_instruction_count_);
-  writer->Write<uint16_t>(ptr()->optimized_call_site_count_);
+  // Write out the boolean is_in_fullsnapshot first as this will
+  // help the reader decide how the rest of the information needs
+  // to be interpreted.
+  writer->Write<bool>(is_in_fullsnapshot);
 
-  // Write out all the object pointer fields.
-  SnapshotWriterVisitor visitor(writer);
-  visitor.VisitPointers(from(), to_snapshot());
+  if (kind == Snapshot::kFull || !is_in_fullsnapshot) {
+    bool is_optimized = Code::IsOptimized(ptr()->code_);
+
+    // Write out all the non object fields.
+    writer->Write<int32_t>(ptr()->token_pos_);
+    writer->Write<int32_t>(ptr()->end_token_pos_);
+    if (is_optimized) {
+      writer->Write<int32_t>(FLAG_optimization_counter_threshold);
+    } else {
+      writer->Write<int32_t>(0);
+    }
+    writer->Write<int16_t>(ptr()->num_fixed_parameters_);
+    writer->Write<int16_t>(ptr()->num_optional_parameters_);
+    writer->Write<int16_t>(ptr()->deoptimization_counter_);
+    writer->Write<uint32_t>(ptr()->kind_tag_);
+    writer->Write<uint16_t>(ptr()->optimized_instruction_count_);
+    writer->Write<uint16_t>(ptr()->optimized_call_site_count_);
+
+    // Write out all the object pointer fields.
+    SnapshotWriterVisitor visitor(writer, kAsReference);
+    visitor.VisitPointers(from(), to_snapshot());
+    if (writer->snapshot_code()) {
+      ASSERT(ptr()->ic_data_array_ == Array::null());
+      ASSERT((ptr()->code_ == ptr()->unoptimized_code_) ||
+             (ptr()->unoptimized_code_ == Code::null()));
+      // Write out the code object as we are generating a precompiled snapshot.
+      writer->WriteObjectImpl(ptr()->code_, kAsInlinedObject);
+    } else if (is_optimized) {
+      // Write out the ic data array as the function is optimized or
+      // we are generating a precompiled snapshot.
+      writer->WriteObjectImpl(ptr()->ic_data_array_, kAsReference);
+    }
+  } else {
+    writer->WriteFunctionId(this, owner_is_class);
+  }
 }
 
 
 RawField* Field::ReadFrom(SnapshotReader* reader,
                           intptr_t object_id,
                           intptr_t tags,
-                          Snapshot::Kind kind) {
+                          Snapshot::Kind kind,
+                          bool as_reference) {
   ASSERT(reader != NULL);
   ASSERT((kind == Snapshot::kScript) || (kind == Snapshot::kFull));
 
@@ -758,16 +792,9 @@
   field.set_kind_bits(reader->Read<uint8_t>());
 
   // Set all the object fields.
-  // TODO(5411462): Need to assert No GC can happen here, even though
-  // allocations may happen.
-  intptr_t num_flds = (field.raw()->to() - field.raw()->from());
-  intptr_t from_offset = OFFSET_OF_FROM(field);
-  for (intptr_t i = 0; i <= num_flds; i++) {
-    (*reader->PassiveObjectHandle()) =
-        reader->ReadObjectImpl(kAsReference, object_id, (i + from_offset));
-    field.StorePointer((field.raw()->from() + i),
-                       reader->PassiveObjectHandle()->raw());
-  }
+  READ_OBJECT_FIELDS(field,
+                     field.raw()->from(), field.raw()->to(),
+                     kAsReference);
 
   field.InitializeGuardedListLengthInObjectOffset();
 
@@ -777,7 +804,8 @@
 
 void RawField::WriteTo(SnapshotWriter* writer,
                        intptr_t object_id,
-                       Snapshot::Kind kind) {
+                       Snapshot::Kind kind,
+                       bool as_reference) {
   ASSERT(writer != NULL);
   ASSERT((kind == Snapshot::kScript) || (kind == Snapshot::kFull));
 
@@ -794,16 +822,43 @@
   writer->Write<int32_t>(ptr()->is_nullable_);
   writer->Write<uint8_t>(ptr()->kind_bits_);
 
-  // Write out all the object pointer fields.
-  SnapshotWriterVisitor visitor(writer);
-  visitor.VisitPointers(from(), to());
+  // Write out the name.
+  writer->WriteObjectImpl(ptr()->name_, kAsReference);
+  // Write out the owner.
+  writer->WriteObjectImpl(ptr()->owner_, kAsReference);
+  // Write out the type.
+  writer->WriteObjectImpl(ptr()->type_, kAsReference);
+  // Write out the initial static value or field offset.
+  if (Field::StaticBit::decode(ptr()->kind_bits_)) {
+    if (writer->snapshot_code()) {
+      // For precompiled static fields, the value was already reset and
+      // initializer_ now contains a Function.
+      writer->WriteObjectImpl(ptr()->value_.static_value_, kAsReference);
+    } else {
+      // Otherwise, for static fields we write out the initial static value.
+      writer->WriteObjectImpl(ptr()->initializer_.saved_value_, kAsReference);
+    }
+  } else {
+    writer->WriteObjectImpl(ptr()->value_.offset_, kAsReference);
+  }
+  // Write out the dependent code.
+  writer->WriteObjectImpl(ptr()->dependent_code_, kAsReference);
+  // Write out the initializer function or saved initial value.
+  if (writer->snapshot_code()) {
+    writer->WriteObjectImpl(ptr()->initializer_.precompiled_, kAsReference);
+  } else {
+    writer->WriteObjectImpl(ptr()->initializer_.saved_value_, kAsReference);
+  }
+  // Write out the guarded list length.
+  writer->WriteObjectImpl(ptr()->guarded_list_length_, kAsReference);
 }
 
 
 RawLiteralToken* LiteralToken::ReadFrom(SnapshotReader* reader,
                                         intptr_t object_id,
                                         intptr_t tags,
-                                        Snapshot::Kind kind) {
+                                        Snapshot::Kind kind,
+                                        bool as_reference) {
   ASSERT(reader != NULL);
   ASSERT(kind != Snapshot::kMessage);
 
@@ -817,14 +872,9 @@
   literal_token.set_kind(token_kind);
 
   // Set all the object fields.
-  // TODO(5411462): Need to assert No GC can happen here, even though
-  // allocations may happen.
-  intptr_t num_flds = (literal_token.raw()->to() - literal_token.raw()->from());
-  for (intptr_t i = 0; i <= num_flds; i++) {
-    (*reader->PassiveObjectHandle()) = reader->ReadObjectImpl(kAsReference);
-    literal_token.StorePointer((literal_token.raw()->from() + i),
-                               reader->PassiveObjectHandle()->raw());
-  }
+  READ_OBJECT_FIELDS(literal_token,
+                     literal_token.raw()->from(), literal_token.raw()->to(),
+                     kAsReference);
 
   return literal_token.raw();
 }
@@ -832,7 +882,8 @@
 
 void RawLiteralToken::WriteTo(SnapshotWriter* writer,
                               intptr_t object_id,
-                              Snapshot::Kind kind) {
+                              Snapshot::Kind kind,
+                              bool as_reference) {
   ASSERT(writer != NULL);
   ASSERT(kind != Snapshot::kMessage);
 
@@ -847,7 +898,7 @@
   writer->Write<int32_t>(ptr()->kind_);
 
   // Write out all the object pointer fields.
-  SnapshotWriterVisitor visitor(writer);
+  SnapshotWriterVisitor visitor(writer, kAsReference);
   visitor.VisitPointers(from(), to());
 }
 
@@ -855,7 +906,8 @@
 RawTokenStream* TokenStream::ReadFrom(SnapshotReader* reader,
                                       intptr_t object_id,
                                       intptr_t tags,
-                                      Snapshot::Kind kind) {
+                                      Snapshot::Kind kind,
+                                      bool as_reference) {
   ASSERT(reader != NULL);
   ASSERT((kind == Snapshot::kScript) || (kind == Snapshot::kFull));
 
@@ -888,7 +940,8 @@
 
 void RawTokenStream::WriteTo(SnapshotWriter* writer,
                              intptr_t object_id,
-                             Snapshot::Kind kind) {
+                             Snapshot::Kind kind,
+                             bool as_reference) {
   ASSERT(writer != NULL);
   ASSERT((kind == Snapshot::kScript) || (kind == Snapshot::kFull));
 
@@ -915,7 +968,8 @@
 RawScript* Script::ReadFrom(SnapshotReader* reader,
                             intptr_t object_id,
                             intptr_t tags,
-                            Snapshot::Kind kind) {
+                            Snapshot::Kind kind,
+                            bool as_reference) {
   ASSERT(reader != NULL);
   ASSERT((kind == Snapshot::kScript) || (kind == Snapshot::kFull));
 
@@ -949,7 +1003,8 @@
 
 void RawScript::WriteTo(SnapshotWriter* writer,
                         intptr_t object_id,
-                        Snapshot::Kind kind) {
+                        Snapshot::Kind kind,
+                        bool as_reference) {
   ASSERT(writer != NULL);
   ASSERT(tokens_ != TokenStream::null());
   ASSERT((kind == Snapshot::kScript) || (kind == Snapshot::kFull));
@@ -967,7 +1022,7 @@
   writer->Write<int8_t>(ptr()->kind_);
 
   // Write out all the object pointer fields.
-  SnapshotWriterVisitor visitor(writer);
+  SnapshotWriterVisitor visitor(writer, kAsReference);
   visitor.VisitPointers(from(), to_snapshot());
 }
 
@@ -975,7 +1030,8 @@
 RawLibrary* Library::ReadFrom(SnapshotReader* reader,
                               intptr_t object_id,
                               intptr_t tags,
-                              Snapshot::Kind kind) {
+                              Snapshot::Kind kind,
+                              bool as_reference) {
   ASSERT(reader != NULL);
   ASSERT(kind != Snapshot::kMessage);
 
@@ -1021,13 +1077,18 @@
     // Set all the object fields.
     // TODO(5411462): Need to assert No GC can happen here, even though
     // allocations may happen.
-    intptr_t num_flds = (library.raw()->to() - library.raw()->from());
+    RawObject** toobj = (kind == Snapshot::kFull) ?
+        library.raw()->to() : library.raw()->to_snapshot();
+    intptr_t num_flds = (toobj - library.raw()->from());
     for (intptr_t i = 0; i <= num_flds; i++) {
       (*reader->PassiveObjectHandle()) = reader->ReadObjectImpl(kAsReference);
       library.StorePointer((library.raw()->from() + i),
                            reader->PassiveObjectHandle()->raw());
     }
     if (kind != Snapshot::kFull) {
+      // The cache of resolved names in library scope is not serialized.
+      const intptr_t kInitialNameCacheSize = 64;
+      library.InitResolvedNamesCache(kInitialNameCacheSize);
       library.Register();
     }
   }
@@ -1037,7 +1098,8 @@
 
 void RawLibrary::WriteTo(SnapshotWriter* writer,
                          intptr_t object_id,
-                         Snapshot::Kind kind) {
+                         Snapshot::Kind kind,
+                         bool as_reference) {
   ASSERT(writer != NULL);
   ASSERT(kind != Snapshot::kMessage);
 
@@ -1073,8 +1135,9 @@
     // be rebuilt lazily.
 
     // Write out all the object pointer fields.
-    SnapshotWriterVisitor visitor(writer);
-    visitor.VisitPointers(from(), to());
+    RawObject** toobj = (kind == Snapshot::kFull) ? to() : to_snapshot();
+    SnapshotWriterVisitor visitor(writer, kAsReference);
+    visitor.VisitPointers(from(), toobj);
   }
 }
 
@@ -1082,7 +1145,8 @@
 RawLibraryPrefix* LibraryPrefix::ReadFrom(SnapshotReader* reader,
                                           intptr_t object_id,
                                           intptr_t tags,
-                                          Snapshot::Kind kind) {
+                                          Snapshot::Kind kind,
+                                          bool as_reference) {
   ASSERT(reader != NULL);
   ASSERT((kind == Snapshot::kScript) || (kind == Snapshot::kFull));
 
@@ -1099,14 +1163,9 @@
   prefix.StoreNonPointer(&prefix.raw_ptr()->is_loaded_, reader->Read<bool>());
 
   // Set all the object fields.
-  // TODO(5411462): Need to assert No GC can happen here, even though
-  // allocations may happen.
-  intptr_t num_flds = (prefix.raw()->to() - prefix.raw()->from());
-  for (intptr_t i = 0; i <= num_flds; i++) {
-    (*reader->PassiveObjectHandle()) = reader->ReadObjectImpl(kAsReference);
-    prefix.StorePointer((prefix.raw()->from() + i),
-                         reader->PassiveObjectHandle()->raw());
-  }
+  READ_OBJECT_FIELDS(prefix,
+                     prefix.raw()->from(), prefix.raw()->to(),
+                     kAsReference);
 
   return prefix.raw();
 }
@@ -1114,7 +1173,8 @@
 
 void RawLibraryPrefix::WriteTo(SnapshotWriter* writer,
                                intptr_t object_id,
-                               Snapshot::Kind kind) {
+                               Snapshot::Kind kind,
+                               bool as_reference) {
   ASSERT(writer != NULL);
   ASSERT((kind == Snapshot::kScript) || (kind == Snapshot::kFull));
 
@@ -1131,7 +1191,7 @@
   writer->Write<bool>(ptr()->is_loaded_);
 
   // Write out all the object pointer fields.
-  SnapshotWriterVisitor visitor(writer);
+  SnapshotWriterVisitor visitor(writer, kAsReference);
   visitor.VisitPointers(from(), to());
 }
 
@@ -1139,7 +1199,8 @@
 RawNamespace* Namespace::ReadFrom(SnapshotReader* reader,
                                   intptr_t object_id,
                                   intptr_t tags,
-                                  Snapshot::Kind kind) {
+                                  Snapshot::Kind kind,
+                                  bool as_reference) {
   ASSERT(reader != NULL);
   ASSERT((kind == Snapshot::kScript) || (kind == Snapshot::kFull));
 
@@ -1149,14 +1210,7 @@
   reader->AddBackRef(object_id, &ns, kIsDeserialized);
 
   // Set all the object fields.
-  // TODO(5411462): Need to assert No GC can happen here, even though
-  // allocations may happen.
-  intptr_t num_flds = (ns.raw()->to() - ns.raw()->from());
-  for (intptr_t i = 0; i <= num_flds; i++) {
-    (*reader->PassiveObjectHandle()) = reader->ReadObjectImpl(kAsReference);
-    ns.StorePointer((ns.raw()->from() + i),
-                    reader->PassiveObjectHandle()->raw());
-  }
+  READ_OBJECT_FIELDS(ns, ns.raw()->from(), ns.raw()->to(), kAsReference);
 
   return ns.raw();
 }
@@ -1164,7 +1218,8 @@
 
 void RawNamespace::WriteTo(SnapshotWriter* writer,
                            intptr_t object_id,
-                           Snapshot::Kind kind) {
+                           Snapshot::Kind kind,
+                           bool as_reference) {
   ASSERT(writer != NULL);
   ASSERT((kind == Snapshot::kScript) || (kind == Snapshot::kFull));
 
@@ -1176,7 +1231,7 @@
   writer->WriteTags(writer->GetObjectTags(this));
 
   // Write out all the object pointer fields.
-  SnapshotWriterVisitor visitor(writer);
+  SnapshotWriterVisitor visitor(writer, kAsReference);
   visitor.VisitPointers(from(), to());
 }
 
@@ -1184,62 +1239,239 @@
 RawCode* Code::ReadFrom(SnapshotReader* reader,
                         intptr_t object_id,
                         intptr_t tags,
-                        Snapshot::Kind kind) {
-  UNREACHABLE();
-  return Code::null();
+                        Snapshot::Kind kind,
+                        bool as_reference) {
+  ASSERT(reader->snapshot_code());
+  ASSERT(kind == Snapshot::kFull);
+
+  Code& result = Code::ZoneHandle(reader->zone(), NEW_OBJECT_WITH_LEN(Code, 0));
+  reader->AddBackRef(object_id, &result, kIsDeserialized);
+
+  result.set_compile_timestamp(reader->Read<int64_t>());
+  result.set_state_bits(reader->Read<int32_t>());
+  result.set_lazy_deopt_pc_offset(reader->Read<int32_t>());
+
+  // Set all the object fields.
+  READ_OBJECT_FIELDS(result,
+                     result.raw()->from(), result.raw()->to(),
+                     kAsReference);
+
+  // Fix entry point.
+  uword new_entry = result.EntryPoint();
+  ASSERT(Dart::vm_isolate()->heap()->CodeContains(new_entry));
+  result.StoreNonPointer(&result.raw_ptr()->entry_point_, new_entry);
+
+  return result.raw();
 }
 
 
 void RawCode::WriteTo(SnapshotWriter* writer,
                       intptr_t object_id,
-                      Snapshot::Kind kind) {
-  // We have already checked for this and written a NULL object, hence we
-  // should not reach here.
-  UNREACHABLE();
+                      Snapshot::Kind kind,
+                      bool as_reference) {
+  ASSERT(writer->snapshot_code());
+  ASSERT(kind == Snapshot::kFull);
+
+  intptr_t pointer_offsets_length =
+      Code::PtrOffBits::decode(ptr()->state_bits_);
+  if (pointer_offsets_length != 0) {
+    // Should only be IA32.
+    FATAL("Serializing embedded pointer offsets unimplemented");
+  }
+
+  // Write out the serialization header value for this object.
+  writer->WriteInlinedObjectHeader(object_id);
+
+  // Write out the class and tags information.
+  writer->WriteVMIsolateObject(kCodeCid);
+  writer->WriteTags(writer->GetObjectTags(this));
+
+  // Write out all the non object fields.
+  writer->Write<int64_t>(ptr()->compile_timestamp_);
+  writer->Write<int32_t>(ptr()->state_bits_);
+  writer->Write<int32_t>(ptr()->lazy_deopt_pc_offset_);
+
+  // Write out all the object pointer fields.
+  SnapshotWriterVisitor visitor(writer, kAsReference);
+  visitor.VisitPointers(from(), to());
+
+  writer->SetInstructionsCode(ptr()->instructions_, this);
 }
 
 
 RawInstructions* Instructions::ReadFrom(SnapshotReader* reader,
                                         intptr_t object_id,
                                         intptr_t tags,
-                                        Snapshot::Kind kind) {
-  UNREACHABLE();
-  return Instructions::null();
+                                        Snapshot::Kind kind,
+                                        bool as_reference) {
+  ASSERT(reader->snapshot_code());
+  ASSERT(kind == Snapshot::kFull);
+
+  intptr_t full_tags = static_cast<uword>(reader->Read<intptr_t>());
+  intptr_t offset = reader->Read<int32_t>();
+  Instructions& result =
+      Instructions::ZoneHandle(reader->zone(),
+                               reader->GetInstructionsAt(offset, full_tags));
+  reader->AddBackRef(object_id, &result, kIsDeserialized);
+
+  return result.raw();
 }
 
 
 void RawInstructions::WriteTo(SnapshotWriter* writer,
                               intptr_t object_id,
-                              Snapshot::Kind kind) {
-  UNREACHABLE();
+                              Snapshot::Kind kind,
+                              bool as_reference) {
+  ASSERT(writer->snapshot_code());
+  ASSERT(kind == Snapshot::kFull);
+
+  writer->WriteInlinedObjectHeader(object_id);
+  writer->WriteVMIsolateObject(kInstructionsCid);
+  writer->WriteTags(writer->GetObjectTags(this));
+
+  // Instructions will be written pre-marked and in the VM heap. Write out
+  // the tags we expect to find when reading the snapshot for a sanity check
+  // that our offsets/alignment didn't get out of sync.
+  uword written_tags = writer->GetObjectTags(this);
+  written_tags = RawObject::VMHeapObjectTag::update(true, written_tags);
+  written_tags = RawObject::MarkBit::update(true, written_tags);
+  writer->Write<intptr_t>(written_tags);
+
+  writer->Write<int32_t>(writer->GetInstructionsId(this));
 }
 
 
 RawObjectPool* ObjectPool::ReadFrom(SnapshotReader* reader,
                                     intptr_t object_id,
                                     intptr_t tags,
-                                    Snapshot::Kind kind) {
-  UNREACHABLE();
-  return ObjectPool::null();
+                                    Snapshot::Kind kind,
+                                    bool as_reference) {
+  ASSERT(reader->snapshot_code());
+  ASSERT(kind == Snapshot::kFull);
+
+  intptr_t length = reader->Read<intptr_t>();
+
+  ObjectPool* result =
+      reinterpret_cast<ObjectPool*>(reader->GetBackRef(object_id));
+  if (result == NULL) {
+    result =
+        &(ObjectPool::ZoneHandle(reader->zone(),
+                                 NEW_OBJECT_WITH_LEN(ObjectPool, length)));
+    reader->AddBackRef(object_id, result, kIsDeserialized);
+  }
+
+  const TypedData& info_array =
+      TypedData::Handle(reader->NewTypedData(kTypedDataInt8ArrayCid, length));
+  result->set_info_array(info_array);
+
+  NoSafepointScope no_safepoint;
+  for (intptr_t i = 0; i < length; i++) {
+    ObjectPool::EntryType entry_type =
+        static_cast<ObjectPool::EntryType>(reader->Read<int8_t>());
+    *reinterpret_cast<int8_t*>(info_array.DataAddr(i)) = entry_type;
+    switch (entry_type) {
+      case ObjectPool::kTaggedObject: {
+        (*reader->PassiveObjectHandle()) =
+            reader->ReadObjectImpl(kAsReference);
+        result->SetObjectAt(i, *(reader->PassiveObjectHandle()));
+        break;
+      }
+      case ObjectPool::kImmediate: {
+        intptr_t raw_value = reader->Read<intptr_t>();
+        result->SetRawValueAt(i, raw_value);
+        break;
+      }
+      case ObjectPool::kNativeEntry: {
+        // Read nothing. Initialize with the lazy link entry.
+        uword new_entry = NativeEntry::LinkNativeCallEntry();
+        result->SetRawValueAt(i, static_cast<intptr_t>(new_entry));
+        break;
+      }
+      default:
+        UNREACHABLE();
+    }
+  }
+
+  return result->raw();
 }
 
 
 void RawObjectPool::WriteTo(SnapshotWriter* writer,
                             intptr_t object_id,
-                            Snapshot::Kind kind) {
-  UNREACHABLE();
+                            Snapshot::Kind kind,
+                            bool as_reference) {
+  ASSERT(writer->snapshot_code());
+  ASSERT(kind == Snapshot::kFull);
+  intptr_t tags = writer->GetObjectTags(this);
+  intptr_t length = ptr()->length_;
+
+  if (as_reference) {
+    // Write out the serialization header value for this object.
+    writer->WriteInlinedObjectHeader(kOmittedObjectId);
+
+    // Write out the class information.
+    writer->WriteVMIsolateObject(kObjectPoolCid);
+    writer->WriteTags(tags);
+
+    // Write out the length field.
+    writer->Write<intptr_t>(length);
+  } else {
+    // Write out the serialization header value for this object.
+    writer->WriteInlinedObjectHeader(object_id);
+
+    // Write out the class and tags information.
+    writer->WriteVMIsolateObject(kObjectPoolCid);
+    writer->WriteTags(tags);
+
+    RawTypedData* info_array = ptr()->info_array_->ptr();
+    ASSERT(info_array != TypedData::null());
+
+    writer->Write<intptr_t>(length);
+    for (intptr_t i = 0; i < length; i++) {
+      ObjectPool::EntryType entry_type =
+          static_cast<ObjectPool::EntryType>(info_array->data()[i]);
+      writer->Write<int8_t>(entry_type);
+      Entry& entry = ptr()->data()[i];
+      switch (entry_type) {
+        case ObjectPool::kTaggedObject: {
+          if (entry.raw_obj_ == StubCode::CallNativeCFunction_entry()->code()) {
+            // Natives can run while precompiling, becoming linked and switching
+            // their stub. Reset to the initial stub used for lazy-linking.
+            writer->WriteObjectImpl(
+                StubCode::CallBootstrapCFunction_entry()->code(), kAsReference);
+          } else {
+            writer->WriteObjectImpl(entry.raw_obj_, kAsReference);
+          }
+          break;
+        }
+        case ObjectPool::kImmediate: {
+          writer->Write<intptr_t>(entry.raw_value_);
+          break;
+        }
+        case ObjectPool::kNativeEntry: {
+          // Write nothing. Will initialize with the lazy link entry.
+          break;
+        }
+        default:
+          UNREACHABLE();
+      }
+    }
+  }
 }
 
 
 RawPcDescriptors* PcDescriptors::ReadFrom(SnapshotReader* reader,
                                           intptr_t object_id,
                                           intptr_t tags,
-                                          Snapshot::Kind kind) {
-  ASSERT(reader->allow_code());
+                                          Snapshot::Kind kind,
+                                          bool as_reference) {
+  ASSERT(reader->snapshot_code());
+  ASSERT(kind == Snapshot::kFull);
 
   const int32_t length = reader->Read<int32_t>();
-  PcDescriptors& result = PcDescriptors::ZoneHandle(reader->zone(),
-                                                    PcDescriptors::New(length));
+  PcDescriptors& result =
+      PcDescriptors::ZoneHandle(reader->zone(),
+                                NEW_OBJECT_WITH_LEN(PcDescriptors, length));
   reader->AddBackRef(object_id, &result, kIsDeserialized);
 
   if (result.Length() > 0) {
@@ -1255,8 +1487,10 @@
 
 void RawPcDescriptors::WriteTo(SnapshotWriter* writer,
                                intptr_t object_id,
-                               Snapshot::Kind kind) {
-  ASSERT(writer->allow_code());
+                               Snapshot::Kind kind,
+                               bool as_reference) {
+  ASSERT(writer->snapshot_code());
+  ASSERT(kind == Snapshot::kFull);
 
   // Write out the serialization header value for this object.
   writer->WriteInlinedObjectHeader(object_id);
@@ -1274,19 +1508,21 @@
 RawStackmap* Stackmap::ReadFrom(SnapshotReader* reader,
                                 intptr_t object_id,
                                 intptr_t tags,
-                                Snapshot::Kind kind) {
-  ASSERT(reader->allow_code());
+                                Snapshot::Kind kind,
+                                bool as_reference) {
+  ASSERT(reader->snapshot_code());
+  ASSERT(kind == Snapshot::kFull);
 
   const int32_t length = reader->Read<int32_t>();
-  const int32_t register_bit_count = reader->Read<int32_t>();
-  const uword pc_offset = reader->Read<uint32_t>();
-
   Stackmap& result =
       Stackmap::ZoneHandle(reader->zone(),
-        Stackmap::New(length, register_bit_count, pc_offset));
+                           reader->NewStackmap(length));
   reader->AddBackRef(object_id, &result, kIsDeserialized);
 
-  if (result.Length() > 0) {
+  result.SetRegisterBitCount(reader->Read<int32_t>());
+  result.SetPcOffset(reader->Read<uint32_t>());
+
+  if (length > 0) {
     NoSafepointScope no_safepoint;
     intptr_t len = (result.Length() + 7) / 8;
     uint8_t* data = result.UnsafeMutableNonPointer(result.raw_ptr()->data());
@@ -1299,13 +1535,16 @@
 
 void RawStackmap::WriteTo(SnapshotWriter* writer,
                           intptr_t object_id,
-                          Snapshot::Kind kind) {
-  ASSERT(writer->allow_code());
+                          Snapshot::Kind kind,
+                          bool as_reference) {
+  ASSERT(writer->snapshot_code());
+  ASSERT(kind == Snapshot::kFull);
 
   // Write out the serialization header value for this object.
   writer->WriteInlinedObjectHeader(object_id);
   writer->WriteIndexedObject(kStackmapCid);
   writer->WriteTags(writer->GetObjectTags(this));
+
   writer->Write<int32_t>(ptr()->length_);
   writer->Write<int32_t>(ptr()->register_bit_count_);
   writer->Write<uint32_t>(ptr()->pc_offset_);
@@ -1320,14 +1559,17 @@
 RawLocalVarDescriptors* LocalVarDescriptors::ReadFrom(SnapshotReader* reader,
                                                       intptr_t object_id,
                                                       intptr_t tags,
-                                                      Snapshot::Kind kind) {
-  ASSERT(reader->allow_code());
+                                                      Snapshot::Kind kind,
+                                                      bool as_reference) {
+  ASSERT(reader->snapshot_code());
+  ASSERT(kind == Snapshot::kFull);
 
   const int32_t num_entries = reader->Read<int32_t>();
 
   LocalVarDescriptors& result =
       LocalVarDescriptors::ZoneHandle(reader->zone(),
-        LocalVarDescriptors::New(num_entries));
+                                      NEW_OBJECT_WITH_LEN(LocalVarDescriptors,
+                                                          num_entries));
   reader->AddBackRef(object_id, &result, kIsDeserialized);
 
   for (intptr_t i = 0; i < num_entries; i++) {
@@ -1350,8 +1592,10 @@
 
 void RawLocalVarDescriptors::WriteTo(SnapshotWriter* writer,
                                      intptr_t object_id,
-                                     Snapshot::Kind kind) {
-  ASSERT(writer->allow_code());
+                                     Snapshot::Kind kind,
+                                     bool as_reference) {
+  ASSERT(writer->snapshot_code());
+  ASSERT(kind == Snapshot::kFull);
 
   // Write out the serialization header value for this object.
   writer->WriteInlinedObjectHeader(object_id);
@@ -1359,7 +1603,7 @@
   writer->WriteTags(writer->GetObjectTags(this));
   writer->Write<int32_t>(ptr()->num_entries_);
   for (intptr_t i = 0; i < ptr()->num_entries_; i++) {
-    writer->WriteObjectImpl(ptr()->names()[i], kAsInlinedObject);
+    writer->WriteObjectImpl(ptr()->names()[i], kAsReference);
   }
   if (ptr()->num_entries_ > 0) {
     intptr_t len = ptr()->num_entries_ * sizeof(VarInfo);
@@ -1372,15 +1616,16 @@
 RawExceptionHandlers* ExceptionHandlers::ReadFrom(SnapshotReader* reader,
                                                   intptr_t object_id,
                                                   intptr_t tags,
-                                                  Snapshot::Kind kind) {
-  ASSERT(reader->allow_code());
+                                                  Snapshot::Kind kind,
+                                                  bool as_reference) {
+  ASSERT(reader->snapshot_code());
+  ASSERT(kind == Snapshot::kFull);
 
-  // handled_types_data.
-  *(reader->ArrayHandle()) ^= reader->ReadObjectImpl(kAsInlinedObject);
-
+  const int32_t num_entries = reader->Read<int32_t>();
   ExceptionHandlers& result =
       ExceptionHandlers::ZoneHandle(reader->zone(),
-        ExceptionHandlers::New(*reader->ArrayHandle()));
+                                    NEW_OBJECT_WITH_LEN(ExceptionHandlers,
+                                                        num_entries));
   reader->AddBackRef(object_id, &result, kIsDeserialized);
 
   if (result.num_entries() > 0) {
@@ -1392,33 +1637,42 @@
     reader->ReadBytes(data, len);
   }
 
+  *(reader->ArrayHandle()) ^= reader->ReadObjectImpl(kAsInlinedObject);
+  result.StorePointer(&result.raw_ptr()->handled_types_data_,
+                      reader->ArrayHandle()->raw());
+
   return result.raw();
 }
 
 
 void RawExceptionHandlers::WriteTo(SnapshotWriter* writer,
                                    intptr_t object_id,
-                                   Snapshot::Kind kind) {
-  ASSERT(writer->allow_code());
+                                   Snapshot::Kind kind,
+                                   bool as_reference) {
+  ASSERT(writer->snapshot_code());
+  ASSERT(kind == Snapshot::kFull);
 
   // Write out the serialization header value for this object.
   writer->WriteInlinedObjectHeader(object_id);
   writer->WriteIndexedObject(kExceptionHandlersCid);
   writer->WriteTags(writer->GetObjectTags(this));
-  writer->WriteObjectImpl(ptr()->handled_types_data_, kAsInlinedObject);
+  writer->Write<int32_t>(ptr()->num_entries_);
 
   if (ptr()->num_entries_ > 0) {
     intptr_t len = ptr()->num_entries_ * sizeof(HandlerInfo);
     uint8_t* data = reinterpret_cast<uint8_t*>(ptr()->data());
     writer->WriteBytes(data, len);
   }
+
+  writer->WriteObjectImpl(ptr()->handled_types_data_, kAsInlinedObject);
 }
 
 
 RawContext* Context::ReadFrom(SnapshotReader* reader,
                               intptr_t object_id,
                               intptr_t tags,
-                              Snapshot::Kind kind) {
+                              Snapshot::Kind kind,
+                              bool as_reference) {
   ASSERT(reader != NULL);
 
   // Allocate context object.
@@ -1446,7 +1700,8 @@
 
 void RawContext::WriteTo(SnapshotWriter* writer,
                          intptr_t object_id,
-                         Snapshot::Kind kind) {
+                         Snapshot::Kind kind,
+                         bool as_reference) {
   ASSERT(writer != NULL);
 
   // Write out the serialization header value for this object.
@@ -1461,7 +1716,7 @@
   writer->Write<int32_t>(num_variables);
   if (num_variables != 0) {
     // Write out all the object pointer fields.
-    SnapshotWriterVisitor visitor(writer);
+    SnapshotWriterVisitor visitor(writer, kAsReference);
     visitor.VisitPointers(from(), to(num_variables));
   }
 }
@@ -1470,7 +1725,34 @@
 RawContextScope* ContextScope::ReadFrom(SnapshotReader* reader,
                                         intptr_t object_id,
                                         intptr_t tags,
-                                        Snapshot::Kind kind) {
+                                        Snapshot::Kind kind,
+                                        bool as_reference) {
+  ASSERT(reader != NULL);
+
+  // Allocate context object.
+  bool is_implicit = reader->Read<bool>();
+  if (is_implicit) {
+    ContextScope& context_scope = ContextScope::ZoneHandle();
+    if (kind == Snapshot::kFull) {
+      context_scope = reader->NewContextScope(1);
+      context_scope.set_is_implicit(true);
+    } else {
+      context_scope = ContextScope::New(1, true);
+    }
+    reader->AddBackRef(object_id, &context_scope, kIsDeserialized);
+
+    *reader->TypeHandle() ^= reader->ReadObjectImpl(kAsInlinedObject);
+
+    // Create a descriptor for 'this' variable.
+    context_scope.SetTokenIndexAt(0, 0);
+    context_scope.SetNameAt(0, Symbols::This());
+    context_scope.SetIsFinalAt(0, true);
+    context_scope.SetIsConstAt(0, false);
+    context_scope.SetTypeAt(0, *reader->TypeHandle());
+    context_scope.SetContextIndexAt(0, 0);
+    context_scope.SetContextLevelAt(0, 0);
+    return context_scope.raw();
+  }
   UNREACHABLE();
   return NULL;
 }
@@ -1478,7 +1760,29 @@
 
 void RawContextScope::WriteTo(SnapshotWriter* writer,
                               intptr_t object_id,
-                              Snapshot::Kind kind) {
+                              Snapshot::Kind kind,
+                              bool as_reference) {
+  ASSERT(writer != NULL);
+
+  if (ptr()->is_implicit_) {
+    ASSERT(ptr()->num_variables_ == 1);
+    const VariableDesc* var = ptr()->VariableDescAddr(0);
+
+    // Write out the serialization header value for this object.
+    writer->WriteInlinedObjectHeader(object_id);
+
+    // Write out the class and tags information.
+    writer->WriteVMIsolateObject(kContextScopeCid);
+    writer->WriteTags(writer->GetObjectTags(this));
+
+    // Write out is_implicit flag for the context scope.
+    writer->Write<bool>(true);
+
+    // Write out the type of 'this' the variable.
+    writer->WriteObjectImpl(var->type, kAsInlinedObject);
+
+    return;
+  }
   UNREACHABLE();
 }
 
@@ -1486,55 +1790,143 @@
 RawICData* ICData::ReadFrom(SnapshotReader* reader,
                             intptr_t object_id,
                             intptr_t tags,
-                            Snapshot::Kind kind) {
-  UNREACHABLE();
-  return NULL;
+                            Snapshot::Kind kind,
+                            bool as_reference) {
+  ASSERT((kind == Snapshot::kScript) || (kind == Snapshot::kFull));
+
+  ICData& result = ICData::ZoneHandle(reader->zone(), NEW_OBJECT(ICData));
+  reader->AddBackRef(object_id, &result, kIsDeserialized);
+
+  result.set_deopt_id(reader->Read<int32_t>());
+  result.set_state_bits(reader->Read<uint32_t>());
+
+  // Set all the object fields.
+  READ_OBJECT_FIELDS(result,
+                     result.raw()->from(), result.raw()->to(),
+                     kAsReference);
+
+  return result.raw();
 }
 
 
 void RawICData::WriteTo(SnapshotWriter* writer,
                         intptr_t object_id,
-                        Snapshot::Kind kind) {
-  UNREACHABLE();
+                        Snapshot::Kind kind,
+                        bool as_reference) {
+  ASSERT((kind == Snapshot::kScript) || (kind == Snapshot::kFull));
+
+  // Write out the serialization header value for this object.
+  writer->WriteInlinedObjectHeader(object_id);
+
+  // Write out the class and tags information.
+  writer->WriteVMIsolateObject(kICDataCid);
+  writer->WriteTags(writer->GetObjectTags(this));
+
+  // Write out all the non object fields.
+  writer->Write<int32_t>(ptr()->deopt_id_);
+  writer->Write<uint32_t>(ptr()->state_bits_);
+
+  // Write out all the object pointer fields.
+  SnapshotWriterVisitor visitor(writer, kAsReference);
+  visitor.VisitPointers(from(), to());
 }
 
 
 RawMegamorphicCache* MegamorphicCache::ReadFrom(SnapshotReader* reader,
                                                 intptr_t object_id,
                                                 intptr_t tags,
-                                                Snapshot::Kind kind) {
-  UNREACHABLE();
-  return NULL;
+                                                Snapshot::Kind kind,
+                                                bool as_reference) {
+  ASSERT(reader->snapshot_code());
+  ASSERT(kind == Snapshot::kFull);
+
+  MegamorphicCache& result =
+      MegamorphicCache::ZoneHandle(reader->zone(),
+                                   NEW_OBJECT(MegamorphicCache));
+  reader->AddBackRef(object_id, &result, kIsDeserialized);
+
+  result.set_filled_entry_count(reader->Read<int32_t>());
+
+  // Set all the object fields.
+  READ_OBJECT_FIELDS(result,
+                     result.raw()->from(), result.raw()->to(),
+                     kAsReference);
+
+  return result.raw();
 }
 
 
 void RawMegamorphicCache::WriteTo(SnapshotWriter* writer,
                                   intptr_t object_id,
-                                  Snapshot::Kind kind) {
-  UNREACHABLE();
+                                  Snapshot::Kind kind,
+                                  bool as_reference) {
+  ASSERT(writer->snapshot_code());
+  ASSERT(kind == Snapshot::kFull);
+
+  // Write out the serialization header value for this object.
+  writer->WriteInlinedObjectHeader(object_id);
+
+  // Write out the class and tags information.
+  writer->WriteVMIsolateObject(kMegamorphicCacheCid);
+  writer->WriteTags(writer->GetObjectTags(this));
+
+  // Write out all the non object fields.
+  writer->Write<int32_t>(ptr()->filled_entry_count_);
+
+  // Write out all the object pointer fields.
+  SnapshotWriterVisitor visitor(writer, kAsReference);
+  visitor.VisitPointers(from(), to());
 }
 
 
 RawSubtypeTestCache* SubtypeTestCache::ReadFrom(SnapshotReader* reader,
                                                 intptr_t object_id,
                                                 intptr_t tags,
-                                                Snapshot::Kind kind) {
-  UNREACHABLE();
-  return NULL;
+                                                Snapshot::Kind kind,
+                                                bool as_reference) {
+  ASSERT(reader->snapshot_code());
+  ASSERT(kind == Snapshot::kFull);
+
+  SubtypeTestCache& result =
+      SubtypeTestCache::ZoneHandle(reader->zone(),
+                                   NEW_OBJECT(SubtypeTestCache));
+  reader->AddBackRef(object_id, &result, kIsDeserialized);
+
+  // Set all the object fields.
+  // TODO(5411462): Need to assert No GC can happen here, even though
+  // allocations may happen.
+  (*reader->ArrayHandle()) ^= reader->ReadObjectImpl(kAsReference);
+  result.StorePointer(&result.raw_ptr()->cache_,
+                      reader->ArrayHandle()->raw());
+
+  return result.raw();
 }
 
 
 void RawSubtypeTestCache::WriteTo(SnapshotWriter* writer,
                                   intptr_t object_id,
-                                  Snapshot::Kind kind) {
-  UNREACHABLE();
+                                  Snapshot::Kind kind,
+                                  bool as_reference) {
+  ASSERT(writer->snapshot_code());
+  ASSERT(kind == Snapshot::kFull);
+
+  // Write out the serialization header value for this object.
+  writer->WriteInlinedObjectHeader(object_id);
+
+  // Write out the class and tags information.
+  writer->WriteVMIsolateObject(kSubtypeTestCacheCid);
+  writer->WriteTags(writer->GetObjectTags(this));
+
+  // Write out all the object pointer fields.
+  writer->WriteObjectImpl(ptr()->cache_, kAsReference);
 }
 
 
 RawError* Error::ReadFrom(SnapshotReader* reader,
                           intptr_t object_id,
                           intptr_t tags,
-                          Snapshot::Kind kind) {
+                          Snapshot::Kind kind,
+                          bool as_referenec) {
   UNREACHABLE();
   return Error::null();  // Error is an abstract class.
 }
@@ -1542,7 +1934,8 @@
 
 void RawError::WriteTo(SnapshotWriter* writer,
                        intptr_t object_id,
-                       Snapshot::Kind kind) {
+                       Snapshot::Kind kind,
+                       bool as_reference) {
   UNREACHABLE();  // Error is an abstract class.
 }
 
@@ -1550,7 +1943,8 @@
 RawApiError* ApiError::ReadFrom(SnapshotReader* reader,
                                 intptr_t object_id,
                                 intptr_t tags,
-                                Snapshot::Kind kind) {
+                                Snapshot::Kind kind,
+                                bool as_reference) {
   ASSERT(reader != NULL);
 
   // Allocate ApiError object.
@@ -1559,14 +1953,9 @@
   reader->AddBackRef(object_id, &api_error, kIsDeserialized);
 
   // Set all the object fields.
-  // TODO(5411462): Need to assert No GC can happen here, even though
-  // allocations may happen.
-  intptr_t num_flds = (api_error.raw()->to() - api_error.raw()->from());
-  for (intptr_t i = 0; i <= num_flds; i++) {
-    (*reader->PassiveObjectHandle()) = reader->ReadObjectImpl(kAsReference);
-    api_error.StorePointer((api_error.raw()->from() + i),
-                           reader->PassiveObjectHandle()->raw());
-  }
+  READ_OBJECT_FIELDS(api_error,
+                     api_error.raw()->from(), api_error.raw()->to(),
+                     kAsReference);
 
   return api_error.raw();
 }
@@ -1574,7 +1963,8 @@
 
 void RawApiError::WriteTo(SnapshotWriter* writer,
                           intptr_t object_id,
-                          Snapshot::Kind kind) {
+                          Snapshot::Kind kind,
+                          bool as_reference) {
   ASSERT(writer != NULL);
 
   // Write out the serialization header value for this object.
@@ -1585,7 +1975,7 @@
   writer->WriteTags(writer->GetObjectTags(this));
 
   // Write out all the object pointer fields.
-  SnapshotWriterVisitor visitor(writer);
+  SnapshotWriterVisitor visitor(writer, kAsReference);
   visitor.VisitPointers(from(), to());
 }
 
@@ -1593,7 +1983,8 @@
 RawLanguageError* LanguageError::ReadFrom(SnapshotReader* reader,
                                           intptr_t object_id,
                                           intptr_t tags,
-                                          Snapshot::Kind kind) {
+                                          Snapshot::Kind kind,
+                                          bool as_reference) {
   ASSERT(reader != NULL);
 
   // Allocate LanguageError object.
@@ -1606,15 +1997,9 @@
   language_error.set_kind(reader->Read<uint8_t>());
 
   // Set all the object fields.
-  // TODO(5411462): Need to assert No GC can happen here, even though
-  // allocations may happen.
-  intptr_t num_flds =
-      (language_error.raw()->to() - language_error.raw()->from());
-  for (intptr_t i = 0; i <= num_flds; i++) {
-    (*reader->PassiveObjectHandle()) = reader->ReadObjectImpl(kAsReference);
-    language_error.StorePointer((language_error.raw()->from() + i),
-                                reader->PassiveObjectHandle()->raw());
-  }
+  READ_OBJECT_FIELDS(language_error,
+                     language_error.raw()->from(), language_error.raw()->to(),
+                     kAsReference);
 
   return language_error.raw();
 }
@@ -1622,7 +2007,8 @@
 
 void RawLanguageError::WriteTo(SnapshotWriter* writer,
                                intptr_t object_id,
-                               Snapshot::Kind kind) {
+                               Snapshot::Kind kind,
+                               bool as_reference) {
   ASSERT(writer != NULL);
 
   // Write out the serialization header value for this object.
@@ -1637,7 +2023,7 @@
   writer->Write<uint8_t>(ptr()->kind_);
 
   // Write out all the object pointer fields.
-  SnapshotWriterVisitor visitor(writer);
+  SnapshotWriterVisitor visitor(writer, kAsReference);
   visitor.VisitPointers(from(), to());
 }
 
@@ -1645,20 +2031,16 @@
 RawUnhandledException* UnhandledException::ReadFrom(SnapshotReader* reader,
                                                     intptr_t object_id,
                                                     intptr_t tags,
-                                                    Snapshot::Kind kind) {
+                                                    Snapshot::Kind kind,
+                                                    bool as_reference) {
   UnhandledException& result = UnhandledException::ZoneHandle(
       reader->zone(), NEW_OBJECT(UnhandledException));
   reader->AddBackRef(object_id, &result, kIsDeserialized);
 
   // Set all the object fields.
-  // TODO(5411462): Need to assert No GC can happen here, even though
-  // allocations may happen.
-  intptr_t num_flds = (result.raw()->to() - result.raw()->from());
-  for (intptr_t i = 0; i <= num_flds; i++) {
-    (*reader->PassiveObjectHandle()) = reader->ReadObjectImpl(kAsReference);
-    result.StorePointer((result.raw()->from() + i),
-                         reader->PassiveObjectHandle()->raw());
-  }
+  READ_OBJECT_FIELDS(result,
+                     result.raw()->from(), result.raw()->to(),
+                     kAsReference);
 
   return result.raw();
 }
@@ -1666,7 +2048,8 @@
 
 void RawUnhandledException::WriteTo(SnapshotWriter* writer,
                                     intptr_t object_id,
-                                    Snapshot::Kind kind) {
+                                    Snapshot::Kind kind,
+                                    bool as_reference) {
   // Write out the serialization header value for this object.
   writer->WriteInlinedObjectHeader(object_id);
 
@@ -1674,7 +2057,7 @@
   writer->WriteVMIsolateObject(kUnhandledExceptionCid);
   writer->WriteTags(writer->GetObjectTags(this));
   // Write out all the object pointer fields.
-  SnapshotWriterVisitor visitor(writer);
+  SnapshotWriterVisitor visitor(writer, kAsReference);
   visitor.VisitPointers(from(), to());
 }
 
@@ -1682,7 +2065,8 @@
 RawUnwindError* UnwindError::ReadFrom(SnapshotReader* reader,
                                       intptr_t object_id,
                                       intptr_t tags,
-                                      Snapshot::Kind kind) {
+                                      Snapshot::Kind kind,
+                                      bool as_reference) {
   UNREACHABLE();
   return UnwindError::null();
 }
@@ -1690,7 +2074,8 @@
 
 void RawUnwindError::WriteTo(SnapshotWriter* writer,
                              intptr_t object_id,
-                             Snapshot::Kind kind) {
+                             Snapshot::Kind kind,
+                             bool as_reference) {
   UNREACHABLE();
 }
 
@@ -1698,7 +2083,8 @@
 RawInstance* Instance::ReadFrom(SnapshotReader* reader,
                                 intptr_t object_id,
                                 intptr_t tags,
-                                Snapshot::Kind kind) {
+                                Snapshot::Kind kind,
+                                bool as_reference) {
   ASSERT(reader != NULL);
 
   // Create an Instance object or get canonical one if it is a canonical
@@ -1726,7 +2112,8 @@
 
 void RawInstance::WriteTo(SnapshotWriter* writer,
                           intptr_t object_id,
-                          Snapshot::Kind kind) {
+                          Snapshot::Kind kind,
+                          bool as_reference) {
   ASSERT(writer != NULL);
 
   // Write out the serialization header value for this object.
@@ -1741,7 +2128,8 @@
 RawInteger* Mint::ReadFrom(SnapshotReader* reader,
                            intptr_t object_id,
                            intptr_t tags,
-                           Snapshot::Kind kind) {
+                           Snapshot::Kind kind,
+                           bool as_reference) {
   ASSERT(reader != NULL);
 
   // Read the 64 bit value for the object.
@@ -1784,7 +2172,8 @@
 
 void RawMint::WriteTo(SnapshotWriter* writer,
                       intptr_t object_id,
-                      Snapshot::Kind kind) {
+                      Snapshot::Kind kind,
+                      bool as_reference) {
   ASSERT(writer != NULL);
 
   // Write out the serialization header value for this object.
@@ -1802,7 +2191,8 @@
 RawBigint* Bigint::ReadFrom(SnapshotReader* reader,
                             intptr_t object_id,
                             intptr_t tags,
-                            Snapshot::Kind kind) {
+                            Snapshot::Kind kind,
+                            bool as_reference) {
   ASSERT(reader != NULL);
 
   // Allocate bigint object.
@@ -1810,14 +2200,7 @@
   reader->AddBackRef(object_id, &obj, kIsDeserialized);
 
   // Set all the object fields.
-  // TODO(5411462): Need to assert No GC can happen here, even though
-  // allocations may happen.
-  intptr_t num_flds = (obj.raw()->to() - obj.raw()->from());
-  for (intptr_t i = 0; i <= num_flds; i++) {
-    (*reader->PassiveObjectHandle()) = reader->ReadObjectImpl(kAsInlinedObject);
-    obj.StorePointer(obj.raw()->from() + i,
-                     reader->PassiveObjectHandle()->raw());
-  }
+  READ_OBJECT_FIELDS(obj, obj.raw()->from(), obj.raw()->to(), kAsInlinedObject);
 
   // If it is a canonical constant make it one.
   // When reading a full snapshot we don't need to canonicalize the object
@@ -1840,7 +2223,8 @@
 
 void RawBigint::WriteTo(SnapshotWriter* writer,
                         intptr_t object_id,
-                        Snapshot::Kind kind) {
+                        Snapshot::Kind kind,
+                        bool as_reference) {
   ASSERT(writer != NULL);
 
   // Write out the serialization header value for this object.
@@ -1851,7 +2235,7 @@
   writer->WriteTags(writer->GetObjectTags(this));
 
   // Write out all the object pointer fields.
-  SnapshotWriterVisitor visitor(writer, false);
+  SnapshotWriterVisitor visitor(writer, kAsInlinedObject);
   visitor.VisitPointers(from(), to());
 }
 
@@ -1859,7 +2243,8 @@
 RawDouble* Double::ReadFrom(SnapshotReader* reader,
                             intptr_t object_id,
                             intptr_t tags,
-                            Snapshot::Kind kind) {
+                            Snapshot::Kind kind,
+                            bool as_reference) {
   ASSERT(reader != NULL);
   ASSERT(kind != Snapshot::kMessage);
   // Read the double value for the object.
@@ -1892,7 +2277,8 @@
 
 void RawDouble::WriteTo(SnapshotWriter* writer,
                         intptr_t object_id,
-                        Snapshot::Kind kind) {
+                        Snapshot::Kind kind,
+                        bool as_reference) {
   ASSERT(writer != NULL);
 
   // Write out the serialization header value for this object.
@@ -1910,7 +2296,8 @@
 RawString* String::ReadFrom(SnapshotReader* reader,
                             intptr_t object_id,
                             intptr_t tags,
-                            Snapshot::Kind kind) {
+                            Snapshot::Kind kind,
+                            bool as_reference) {
   UNREACHABLE();  // String is an abstract class.
   return String::null();
 }
@@ -1918,7 +2305,8 @@
 
 void RawString::WriteTo(SnapshotWriter* writer,
                         intptr_t object_id,
-                        Snapshot::Kind kind) {
+                        Snapshot::Kind kind,
+                        bool as_reference) {
   UNREACHABLE();  // String is an abstract class.
 }
 
@@ -1959,12 +2347,13 @@
 RawOneByteString* OneByteString::ReadFrom(SnapshotReader* reader,
                                           intptr_t object_id,
                                           intptr_t tags,
-                                          Snapshot::Kind kind) {
+                                          Snapshot::Kind kind,
+                                          bool as_reference) {
   // Read the length so that we can determine instance size to allocate.
   ASSERT(reader != NULL);
   intptr_t len = reader->ReadSmiValue();
   intptr_t hash = reader->ReadSmiValue();
-  String& str_obj = String::Handle(reader->zone(), String::null());
+  String& str_obj = String::ZoneHandle(reader->zone(), String::null());
 
   if (kind == Snapshot::kFull) {
     // We currently only expect the Dart mutator to read snapshots.
@@ -1993,12 +2382,13 @@
 RawTwoByteString* TwoByteString::ReadFrom(SnapshotReader* reader,
                                           intptr_t object_id,
                                           intptr_t tags,
-                                          Snapshot::Kind kind) {
+                                          Snapshot::Kind kind,
+                                          bool as_reference) {
   // Read the length so that we can determine instance size to allocate.
   ASSERT(reader != NULL);
   intptr_t len = reader->ReadSmiValue();
   intptr_t hash = reader->ReadSmiValue();
-  String& str_obj = String::Handle(reader->zone(), String::null());
+  String& str_obj = String::ZoneHandle(reader->zone(), String::null());
 
   if (kind == Snapshot::kFull) {
     RawTwoByteString* obj = reader->NewTwoByteString(len);
@@ -2064,7 +2454,8 @@
 
 void RawOneByteString::WriteTo(SnapshotWriter* writer,
                                intptr_t object_id,
-                               Snapshot::Kind kind) {
+                               Snapshot::Kind kind,
+                               bool as_reference) {
   StringWriteTo(writer,
                 object_id,
                 kind,
@@ -2078,7 +2469,8 @@
 
 void RawTwoByteString::WriteTo(SnapshotWriter* writer,
                                intptr_t object_id,
-                               Snapshot::Kind kind) {
+                               Snapshot::Kind kind,
+                               bool as_reference) {
   StringWriteTo(writer,
                 object_id,
                 kind,
@@ -2094,7 +2486,8 @@
     SnapshotReader* reader,
     intptr_t object_id,
     intptr_t tags,
-    Snapshot::Kind kind) {
+    Snapshot::Kind kind,
+    bool as_reference) {
   UNREACHABLE();
   return ExternalOneByteString::null();
 }
@@ -2104,7 +2497,8 @@
     SnapshotReader* reader,
     intptr_t object_id,
     intptr_t tags,
-    Snapshot::Kind kind) {
+    Snapshot::Kind kind,
+    bool as_reference) {
   UNREACHABLE();
   return ExternalTwoByteString::null();
 }
@@ -2112,7 +2506,8 @@
 
 void RawExternalOneByteString::WriteTo(SnapshotWriter* writer,
                                        intptr_t object_id,
-                                       Snapshot::Kind kind) {
+                                       Snapshot::Kind kind,
+                                       bool as_reference) {
   // Serialize as a non-external one byte string.
   StringWriteTo(writer,
                 object_id,
@@ -2127,7 +2522,8 @@
 
 void RawExternalTwoByteString::WriteTo(SnapshotWriter* writer,
                                        intptr_t object_id,
-                                       Snapshot::Kind kind) {
+                                       Snapshot::Kind kind,
+                                       bool as_reference) {
   // Serialize as a non-external two byte string.
   StringWriteTo(writer,
                 object_id,
@@ -2143,7 +2539,8 @@
 RawBool* Bool::ReadFrom(SnapshotReader* reader,
                         intptr_t object_id,
                         intptr_t tags,
-                        Snapshot::Kind kind) {
+                        Snapshot::Kind kind,
+                        bool as_reference) {
   UNREACHABLE();
   return Bool::null();
 }
@@ -2151,7 +2548,8 @@
 
 void RawBool::WriteTo(SnapshotWriter* writer,
                       intptr_t object_id,
-                      Snapshot::Kind kind) {
+                      Snapshot::Kind kind,
+                      bool as_reference) {
   UNREACHABLE();
 }
 
@@ -2159,7 +2557,8 @@
 RawArray* Array::ReadFrom(SnapshotReader* reader,
                           intptr_t object_id,
                           intptr_t tags,
-                          Snapshot::Kind kind) {
+                          Snapshot::Kind kind,
+                          bool as_reference) {
   ASSERT(reader != NULL);
 
   // Read the length so that we can determine instance size to allocate.
@@ -2180,7 +2579,8 @@
 RawImmutableArray* ImmutableArray::ReadFrom(SnapshotReader* reader,
                                             intptr_t object_id,
                                             intptr_t tags,
-                                            Snapshot::Kind kind) {
+                                            Snapshot::Kind kind,
+                                            bool as_reference) {
   ASSERT(reader != NULL);
 
   // Read the length so that we can determine instance size to allocate.
@@ -2206,33 +2606,38 @@
 
 void RawArray::WriteTo(SnapshotWriter* writer,
                        intptr_t object_id,
-                       Snapshot::Kind kind) {
-  ASSERT(!RawObject::IsCanonical(writer->GetObjectTags(this)));
+                       Snapshot::Kind kind,
+                       bool as_reference) {
+  ASSERT(!this->IsCanonical());
   writer->ArrayWriteTo(object_id,
                        kArrayCid,
                        writer->GetObjectTags(this),
                        ptr()->length_,
                        ptr()->type_arguments_,
-                       ptr()->data());
+                       ptr()->data(),
+                       as_reference);
 }
 
 
 void RawImmutableArray::WriteTo(SnapshotWriter* writer,
                                 intptr_t object_id,
-                                Snapshot::Kind kind) {
+                                Snapshot::Kind kind,
+                                bool as_reference) {
   writer->ArrayWriteTo(object_id,
                        kImmutableArrayCid,
                        writer->GetObjectTags(this),
                        ptr()->length_,
                        ptr()->type_arguments_,
-                       ptr()->data());
+                       ptr()->data(),
+                       as_reference);
 }
 
 
 RawGrowableObjectArray* GrowableObjectArray::ReadFrom(SnapshotReader* reader,
                                                       intptr_t object_id,
                                                       intptr_t tags,
-                                                      Snapshot::Kind kind) {
+                                                      Snapshot::Kind kind,
+                                                      bool as_reference) {
   ASSERT(reader != NULL);
 
   // Read the length so that we can determine instance size to allocate.
@@ -2257,7 +2662,7 @@
   array.SetLength(reader->ReadSmiValue());
 
   // Read the backing array of growable array object.
-  *(reader->ArrayHandle()) ^= reader->ReadObjectImpl(kAsInlinedObject);
+  *(reader->ArrayHandle()) ^= reader->ReadObjectImpl(kAsReference);
   array.SetData(*(reader->ArrayHandle()));
 
   return array.raw();
@@ -2266,7 +2671,8 @@
 
 void RawGrowableObjectArray::WriteTo(SnapshotWriter* writer,
                                      intptr_t object_id,
-                                     Snapshot::Kind kind) {
+                                     Snapshot::Kind kind,
+                                     bool as_reference) {
   ASSERT(writer != NULL);
 
   // Write out the serialization header value for this object.
@@ -2283,25 +2689,31 @@
   writer->Write<RawObject*>(ptr()->length_);
 
   // Write out the Array object.
-  writer->WriteObjectImpl(ptr()->data_, kAsInlinedObject);
+  writer->WriteObjectImpl(ptr()->data_, kAsReference);
 }
 
 
 RawLinkedHashMap* LinkedHashMap::ReadFrom(SnapshotReader* reader,
                                           intptr_t object_id,
                                           intptr_t tags,
-                                          Snapshot::Kind kind) {
+                                          Snapshot::Kind kind,
+                                          bool as_reference) {
   ASSERT(reader != NULL);
 
   LinkedHashMap& map = LinkedHashMap::ZoneHandle(
       reader->zone(), LinkedHashMap::null());
-  if (kind == Snapshot::kFull || kind == Snapshot::kScript) {
+  if ((kind == Snapshot::kFull && !reader->snapshot_code()) ||
+      kind == Snapshot::kScript) {
     // The immutable maps that seed map literals are not yet VM-internal, so
     // we don't reach this.
     UNREACHABLE();
   } else {
     // Since the map might contain itself as a key or value, allocate first.
-    map = LinkedHashMap::NewUninitialized(HEAP_SPACE(kind));
+    if (kind == Snapshot::kFull) {
+      map = reader->NewLinkedHashMap();
+    } else {
+      map = LinkedHashMap::NewUninitialized(HEAP_SPACE(kind));
+    }
   }
   reader->AddBackRef(object_id, &map, kIsDeserialized);
 
@@ -2322,7 +2734,9 @@
       Utils::RoundUpToPowerOfTwo(used_data),
       static_cast<uintptr_t>(LinkedHashMap::kInitialIndexSize));
   Array& data = Array::ZoneHandle(reader->zone(),
-                                  Array::New(data_size, HEAP_SPACE(kind)));
+                                  NEW_OBJECT_WITH_LEN_SPACE(Array,
+                                                            data_size,
+                                                            kind));
   map.SetData(data);
   map.SetDeletedKeys(0);
 
@@ -2334,9 +2748,9 @@
   map.SetHashMask(0);  // Prefer sentinel 0 over null for better type feedback.
 
   // Read the keys and values.
-  bool as_reference = RawObject::IsCanonical(tags) ? false : true;
+  bool read_as_reference = RawObject::IsCanonical(tags) ? false : true;
   for (intptr_t i = 0; i < used_data; i++) {
-    *reader->PassiveObjectHandle() = reader->ReadObjectImpl(as_reference);
+    *reader->PassiveObjectHandle() = reader->ReadObjectImpl(read_as_reference);
     data.SetAt(i, *reader->PassiveObjectHandle());
   }
   return map.raw();
@@ -2345,11 +2759,12 @@
 
 void RawLinkedHashMap::WriteTo(SnapshotWriter* writer,
                                intptr_t object_id,
-                               Snapshot::Kind kind) {
-  if (kind == Snapshot::kFull || kind == Snapshot::kScript) {
+                               Snapshot::Kind kind,
+                               bool as_reference) {
+  if ((kind == Snapshot::kFull && !writer->snapshot_code()) ||
+      kind == Snapshot::kScript) {
     // The immutable maps that seed map literals are not yet VM-internal, so
     // we don't reach this.
-    UNREACHABLE();
   }
   ASSERT(writer != NULL);
 
@@ -2358,8 +2773,7 @@
 
   // Write out the class and tags information.
   writer->WriteIndexedObject(kLinkedHashMapCid);
-  const uword tags = writer->GetObjectTags(this);
-  writer->WriteTags(tags);
+  writer->WriteTags(writer->GetObjectTags(this));
 
   // Write out the type arguments.
   writer->WriteObjectImpl(ptr()->type_arguments_, kAsInlinedObject);
@@ -2372,7 +2786,7 @@
   writer->Write<RawObject*>(Smi::New((used_data >> 1) - deleted_keys));
 
   // Write out the keys and values.
-  const bool as_reference = RawObject::IsCanonical(tags) ? false : true;
+  const bool write_as_reference = this->IsCanonical() ? false : true;
   RawArray* data_array = ptr()->data_;
   RawObject** data_elements = data_array->ptr()->data();
   ASSERT(used_data <= Smi::Value(data_array->ptr()->length_));
@@ -2388,8 +2802,8 @@
       continue;
     }
     RawObject* value = data_elements[i + 1];
-    writer->WriteObjectImpl(key, as_reference);
-    writer->WriteObjectImpl(value, as_reference);
+    writer->WriteObjectImpl(key, write_as_reference);
+    writer->WriteObjectImpl(value, write_as_reference);
   }
   DEBUG_ASSERT(deleted_keys_found == deleted_keys);
 }
@@ -2398,7 +2812,8 @@
 RawFloat32x4* Float32x4::ReadFrom(SnapshotReader* reader,
                                   intptr_t object_id,
                                   intptr_t tags,
-                                  Snapshot::Kind kind) {
+                                  Snapshot::Kind kind,
+                                  bool as_reference) {
   ASSERT(reader != NULL);
   // Read the values.
   float value0 = reader->Read<float>();
@@ -2421,7 +2836,8 @@
 
 void RawFloat32x4::WriteTo(SnapshotWriter* writer,
                            intptr_t object_id,
-                           Snapshot::Kind kind) {
+                           Snapshot::Kind kind,
+                           bool as_reference) {
   ASSERT(writer != NULL);
 
   // Write out the serialization header value for this object.
@@ -2442,7 +2858,8 @@
 RawInt32x4* Int32x4::ReadFrom(SnapshotReader* reader,
                               intptr_t object_id,
                               intptr_t tags,
-                              Snapshot::Kind kind) {
+                              Snapshot::Kind kind,
+                              bool as_reference) {
   ASSERT(reader != NULL);
   // Read the values.
   uint32_t value0 = reader->Read<uint32_t>();
@@ -2465,7 +2882,8 @@
 
 void RawInt32x4::WriteTo(SnapshotWriter* writer,
                          intptr_t object_id,
-                         Snapshot::Kind kind) {
+                         Snapshot::Kind kind,
+                         bool as_reference) {
   ASSERT(writer != NULL);
 
   // Write out the serialization header value for this object.
@@ -2486,7 +2904,8 @@
 RawFloat64x2* Float64x2::ReadFrom(SnapshotReader* reader,
                                   intptr_t object_id,
                                   intptr_t tags,
-                                  Snapshot::Kind kind) {
+                                  Snapshot::Kind kind,
+                                  bool as_reference) {
   ASSERT(reader != NULL);
   // Read the values.
   double value0 = reader->Read<double>();
@@ -2507,7 +2926,8 @@
 
 void RawFloat64x2::WriteTo(SnapshotWriter* writer,
                            intptr_t object_id,
-                           Snapshot::Kind kind) {
+                           Snapshot::Kind kind,
+                           bool as_reference) {
   ASSERT(writer != NULL);
 
   // Write out the serialization header value for this object.
@@ -2532,7 +2952,8 @@
 RawTypedData* TypedData::ReadFrom(SnapshotReader* reader,
                                   intptr_t object_id,
                                   intptr_t tags,
-                                  Snapshot::Kind kind) {
+                                  Snapshot::Kind kind,
+                                  bool as_reference) {
   ASSERT(reader != NULL);
 
   intptr_t cid = RawObject::ClassIdTag::decode(tags);
@@ -2589,12 +3010,13 @@
 RawExternalTypedData* ExternalTypedData::ReadFrom(SnapshotReader* reader,
                                                   intptr_t object_id,
                                                   intptr_t tags,
-                                                  Snapshot::Kind kind) {
+                                                  Snapshot::Kind kind,
+                                                  bool as_reference) {
   ASSERT(kind != Snapshot::kFull);
   intptr_t cid = RawObject::ClassIdTag::decode(tags);
   intptr_t length = reader->ReadSmiValue();
   uint8_t* data = reinterpret_cast<uint8_t*>(reader->ReadRawPointerValue());
-  ExternalTypedData& obj = ExternalTypedData::Handle(
+  ExternalTypedData& obj = ExternalTypedData::ZoneHandle(
       ExternalTypedData::New(cid, data, length));
   reader->AddBackRef(object_id, &obj, kIsDeserialized);
   void* peer = reinterpret_cast<void*>(reader->ReadRawPointerValue());
@@ -2617,10 +3039,10 @@
 
 void RawTypedData::WriteTo(SnapshotWriter* writer,
                            intptr_t object_id,
-                           Snapshot::Kind kind) {
+                           Snapshot::Kind kind,
+                           bool as_reference) {
   ASSERT(writer != NULL);
-  intptr_t tags = writer->GetObjectTags(this);
-  intptr_t cid = ClassIdTag::decode(tags);
+  intptr_t cid = this->GetClassId();
   intptr_t len = Smi::Value(ptr()->length_);
 
   // Write out the serialization header value for this object.
@@ -2628,7 +3050,7 @@
 
   // Write out the class and tags information.
   writer->WriteIndexedObject(cid);
-  writer->WriteTags(tags);
+  writer->WriteTags(writer->GetObjectTags(this));
 
   // Write out the length field.
   writer->Write<RawObject*>(ptr()->length_);
@@ -2683,17 +3105,17 @@
 
 #define EXT_TYPED_DATA_WRITE(cid, type)                                        \
   writer->WriteIndexedObject(cid);                                             \
-  writer->WriteTags(RawObject::ClassIdTag::update(cid, tags));                 \
+  writer->WriteTags(writer->GetObjectTags(this));                              \
   writer->Write<RawObject*>(ptr()->length_);                                   \
   TYPED_EXT_DATA_WRITE(type)                                                   \
 
 
 void RawExternalTypedData::WriteTo(SnapshotWriter* writer,
                                    intptr_t object_id,
-                                   Snapshot::Kind kind) {
+                                   Snapshot::Kind kind,
+                                   bool as_reference) {
   ASSERT(writer != NULL);
-  intptr_t tags = writer->GetObjectTags(this);
-  intptr_t cid = ClassIdTag::decode(tags);
+  intptr_t cid = this->GetClassId();
   intptr_t len = Smi::Value(ptr()->length_);
 
   // Write out the serialization header value for this object.
@@ -2744,7 +3166,8 @@
 RawCapability* Capability::ReadFrom(SnapshotReader* reader,
                                     intptr_t object_id,
                                     intptr_t tags,
-                                    Snapshot::Kind kind) {
+                                    Snapshot::Kind kind,
+                                    bool as_reference) {
   uint64_t id = reader->Read<uint64_t>();
 
   Capability& result = Capability::ZoneHandle(reader->zone(),
@@ -2756,7 +3179,8 @@
 
 void RawCapability::WriteTo(SnapshotWriter* writer,
                             intptr_t object_id,
-                            Snapshot::Kind kind) {
+                            Snapshot::Kind kind,
+                            bool as_reference) {
   // Write out the serialization header value for this object.
   writer->WriteInlinedObjectHeader(object_id);
 
@@ -2771,7 +3195,8 @@
 RawReceivePort* ReceivePort::ReadFrom(SnapshotReader* reader,
                                       intptr_t object_id,
                                       intptr_t tags,
-                                      Snapshot::Kind kind) {
+                                      Snapshot::Kind kind,
+                                      bool as_reference) {
   UNREACHABLE();
   return ReceivePort::null();
 }
@@ -2779,7 +3204,8 @@
 
 void RawReceivePort::WriteTo(SnapshotWriter* writer,
                              intptr_t object_id,
-                             Snapshot::Kind kind) {
+                             Snapshot::Kind kind,
+                             bool as_reference) {
   if (kind == Snapshot::kMessage) {
     // We do not allow objects with native fields in an isolate message.
     writer->SetWriteException(Exceptions::kArgument,
@@ -2794,12 +3220,20 @@
 RawSendPort* SendPort::ReadFrom(SnapshotReader* reader,
                                 intptr_t object_id,
                                 intptr_t tags,
-                                Snapshot::Kind kind) {
+                                Snapshot::Kind kind,
+                                bool as_reference) {
+  ASSERT(kind == Snapshot::kMessage || reader->snapshot_code());
+
   uint64_t id = reader->Read<uint64_t>();
   uint64_t origin_id = reader->Read<uint64_t>();
 
-  SendPort& result = SendPort::ZoneHandle(reader->zone(),
-                                          SendPort::New(id, origin_id));
+  SendPort& result = SendPort::ZoneHandle(reader->zone());
+  if (reader->snapshot_code()) {
+    // TODO(rmacnak): Reset fields in precompiled snapshots and assert
+    // this is unreachable.
+  } else {
+    result = SendPort::New(id, origin_id);
+  }
   reader->AddBackRef(object_id, &result, kIsDeserialized);
   return result.raw();
 }
@@ -2807,7 +3241,8 @@
 
 void RawSendPort::WriteTo(SnapshotWriter* writer,
                           intptr_t object_id,
-                          Snapshot::Kind kind) {
+                          Snapshot::Kind kind,
+                          bool as_reference) {
   // Write out the serialization header value for this object.
   writer->WriteInlinedObjectHeader(object_id);
 
@@ -2823,25 +3258,21 @@
 RawStacktrace* Stacktrace::ReadFrom(SnapshotReader* reader,
                                     intptr_t object_id,
                                     intptr_t tags,
-                                    Snapshot::Kind kind) {
+                                    Snapshot::Kind kind,
+                                    bool as_reference) {
   if (kind == Snapshot::kFull) {
     Stacktrace& result = Stacktrace::ZoneHandle(reader->zone(),
                                                 reader->NewStacktrace());
     reader->AddBackRef(object_id, &result, kIsDeserialized);
 
-    // Set all the object fields.
-    // TODO(5411462): Need to assert No GC can happen here, even though
-    // allocations may happen.
-    intptr_t num_flds = (result.raw()->to() - result.raw()->from());
-    for (intptr_t i = 0; i <= num_flds; i++) {
-      (*reader->PassiveObjectHandle()) = reader->ReadObjectImpl(kAsReference);
-      result.StorePointer((result.raw()->from() + i),
-                          reader->PassiveObjectHandle()->raw());
-    }
-
     bool expand_inlined = reader->Read<bool>();
     result.set_expand_inlined(expand_inlined);
 
+    // Set all the object fields.
+    READ_OBJECT_FIELDS(result,
+                       result.raw()->from(), result.raw()->to(),
+                       kAsReference);
+
     return result.raw();
   }
   UNREACHABLE();  // Stacktraces are not sent in a snapshot.
@@ -2851,7 +3282,8 @@
 
 void RawStacktrace::WriteTo(SnapshotWriter* writer,
                             intptr_t object_id,
-                            Snapshot::Kind kind) {
+                            Snapshot::Kind kind,
+                            bool as_reference) {
   if (kind == Snapshot::kFull) {
     ASSERT(writer != NULL);
     ASSERT(this == Isolate::Current()->object_store()->
@@ -2864,11 +3296,11 @@
     writer->WriteIndexedObject(kStacktraceCid);
     writer->WriteTags(writer->GetObjectTags(this));
 
-    // Write out all the object pointer fields.
-    SnapshotWriterVisitor visitor(writer);
-    visitor.VisitPointers(from(), to());
-
     writer->Write(ptr()->expand_inlined_);
+
+    // Write out all the object pointer fields.
+    SnapshotWriterVisitor visitor(writer, kAsReference);
+    visitor.VisitPointers(from(), to());
   } else {
     // Stacktraces are not allowed in other snapshot forms.
     writer->SetWriteException(Exceptions::kArgument,
@@ -2881,7 +3313,8 @@
 RawJSRegExp* JSRegExp::ReadFrom(SnapshotReader* reader,
                                 intptr_t object_id,
                                 intptr_t tags,
-                                Snapshot::Kind kind) {
+                                Snapshot::Kind kind,
+                                bool as_reference) {
   ASSERT(reader != NULL);
   ASSERT(kind == Snapshot::kMessage);
 
@@ -2907,7 +3340,8 @@
 
 void RawJSRegExp::WriteTo(SnapshotWriter* writer,
                           intptr_t object_id,
-                          Snapshot::Kind kind) {
+                          Snapshot::Kind kind,
+                          bool as_reference) {
   ASSERT(writer != NULL);
   ASSERT(kind == Snapshot::kMessage);
 
@@ -2929,7 +3363,8 @@
 RawWeakProperty* WeakProperty::ReadFrom(SnapshotReader* reader,
                                         intptr_t object_id,
                                         intptr_t tags,
-                                        Snapshot::Kind kind) {
+                                        Snapshot::Kind kind,
+                                        bool as_reference) {
   ASSERT(reader != NULL);
 
   // Allocate the weak property object.
@@ -2938,23 +3373,18 @@
   reader->AddBackRef(object_id, &weak_property, kIsDeserialized);
 
   // Set all the object fields.
-  // TODO(5411462): Need to assert No GC can happen here, even though
-  // allocations may happen.
-  intptr_t num_flds = (weak_property.raw()->to() -
-                       weak_property.raw()->from());
-  for (intptr_t i = 0; i <= num_flds; i++) {
-    (*reader->PassiveObjectHandle()) = reader->ReadObjectImpl(kAsReference);
-    weak_property.StorePointer((weak_property.raw()->from() + i),
-                               reader->PassiveObjectHandle()->raw());
-  }
+  READ_OBJECT_FIELDS(weak_property,
+                     weak_property.raw()->from(), weak_property.raw()->to(),
+                     kAsReference);
 
   return weak_property.raw();
 }
 
 
 void RawWeakProperty::WriteTo(SnapshotWriter* writer,
-                          intptr_t object_id,
-                          Snapshot::Kind kind) {
+                              intptr_t object_id,
+                              Snapshot::Kind kind,
+                              bool as_reference) {
   ASSERT(writer != NULL);
 
   // Write out the serialization header value for this object.
@@ -2965,15 +3395,16 @@
   writer->WriteTags(writer->GetObjectTags(this));
 
   // Write out all the object pointer fields.
-  SnapshotWriterVisitor visitor(writer);
+  SnapshotWriterVisitor visitor(writer, kAsReference);
   visitor.VisitPointers(from(), to());
 }
 
 
 RawMirrorReference* MirrorReference::ReadFrom(SnapshotReader* reader,
-                                          intptr_t object_id,
-                                          intptr_t tags,
-                                          Snapshot::Kind kind) {
+                                              intptr_t object_id,
+                                              intptr_t tags,
+                                              Snapshot::Kind kind,
+                                              bool as_referenec) {
   UNREACHABLE();
   return MirrorReference::null();
 }
@@ -2981,7 +3412,8 @@
 
 void RawMirrorReference::WriteTo(SnapshotWriter* writer,
                                  intptr_t object_id,
-                                 Snapshot::Kind kind) {
+                                 Snapshot::Kind kind,
+                                 bool as_reference) {
   if (kind == Snapshot::kMessage) {
     // We do not allow objects with native fields in an isolate message.
     writer->SetWriteException(Exceptions::kArgument,
@@ -2996,7 +3428,8 @@
 RawUserTag* UserTag::ReadFrom(SnapshotReader* reader,
                               intptr_t object_id,
                               intptr_t tags,
-                              Snapshot::Kind kind) {
+                              Snapshot::Kind kind,
+                              bool as_reference) {
   UNREACHABLE();
   return UserTag::null();
 }
@@ -3004,7 +3437,8 @@
 
 void RawUserTag::WriteTo(SnapshotWriter* writer,
                          intptr_t object_id,
-                         Snapshot::Kind kind) {
+                         Snapshot::Kind kind,
+                         bool as_reference) {
   if (kind == Snapshot::kMessage) {
     // We do not allow objects with native fields in an isolate message.
     writer->SetWriteException(Exceptions::kArgument,
diff --git a/runtime/vm/regexp.cc b/runtime/vm/regexp.cc
index db115a5..f58137c 100644
--- a/runtime/vm/regexp.cc
+++ b/runtime/vm/regexp.cc
@@ -5017,7 +5017,7 @@
   Zone* zone = Thread::Current()->zone();
 
   const Function& function = parsed_function->function();
-  const intptr_t specialization_cid = function.regexp_cid();
+  const intptr_t specialization_cid = function.string_specialization_cid();
   const bool is_one_byte = (specialization_cid == kOneByteStringCid ||
                             specialization_cid == kExternalOneByteStringCid);
   JSRegExp& regexp = JSRegExp::Handle(zone, function.regexp());
@@ -5275,17 +5275,24 @@
                                                            Heap::kOld)));
   fn.set_parameter_names(Array::Handle(zone, Array::New(kParamCount,
                                                            Heap::kOld)));
-  fn.SetParameterTypeAt(0, Type::Handle(zone, Type::DynamicType()));
-  fn.SetParameterNameAt(0, Symbols::string_param());
-  fn.SetParameterTypeAt(1, Type::Handle(zone, Type::DynamicType()));
-  fn.SetParameterNameAt(1, Symbols::start_index_param());
+  fn.SetParameterTypeAt(RegExpMacroAssembler::kParamRegExpIndex,
+                        Type::Handle(zone, Type::DynamicType()));
+  fn.SetParameterNameAt(RegExpMacroAssembler::kParamRegExpIndex,
+                        Symbols::This());
+  fn.SetParameterTypeAt(RegExpMacroAssembler::kParamStringIndex,
+                        Type::Handle(zone, Type::DynamicType()));
+  fn.SetParameterNameAt(RegExpMacroAssembler::kParamStringIndex,
+                        Symbols::string_param());
+  fn.SetParameterTypeAt(RegExpMacroAssembler::kParamStartOffsetIndex,
+                        Type::Handle(zone, Type::DynamicType()));
+  fn.SetParameterNameAt(RegExpMacroAssembler::kParamStartOffsetIndex,
+                        Symbols::start_index_param());
   fn.set_result_type(Type::Handle(zone, Type::ArrayType()));
 
   // Cache the result.
   regexp.set_function(specialization_cid, fn);
 
-  fn.set_regexp(regexp);
-  fn.set_regexp_cid(specialization_cid);
+  fn.SetRegExpData(regexp, specialization_cid);
   fn.set_is_debuggable(false);
 
   // The function is compiled lazily during the first call.
diff --git a/runtime/vm/regexp_assembler.h b/runtime/vm/regexp_assembler.h
index 821f054..5d0ee47 100644
--- a/runtime/vm/regexp_assembler.h
+++ b/runtime/vm/regexp_assembler.h
@@ -99,7 +99,8 @@
   static const intptr_t kTableMask = kTableSize - 1;
 
   enum {
-    kParamStringIndex = 0,
+    kParamRegExpIndex = 0,
+    kParamStringIndex,
     kParamStartOffsetIndex,
     kParamCount
   };
diff --git a/runtime/vm/regexp_assembler_ir.cc b/runtime/vm/regexp_assembler_ir.cc
index 6851926..82c314f 100644
--- a/runtime/vm/regexp_assembler_ir.cc
+++ b/runtime/vm/regexp_assembler_ir.cc
@@ -12,6 +12,7 @@
 #include "vm/object_store.h"
 #include "vm/regexp.h"
 #include "vm/resolver.h"
+#include "vm/runtime_entry.h"
 #include "vm/stack_frame.h"
 #include "vm/unibrow-inl.h"
 #include "vm/unicode.h"
@@ -111,7 +112,7 @@
       new(zone) GraphEntryInstr(
         *parsed_function_,
         new(zone) TargetEntryInstr(block_id_.Alloc(), kInvalidTryIndex),
-        Isolate::kNoDeoptId);
+        Thread::kNoDeoptId);
   start_block_ =
       new(zone) JoinEntryInstr(block_id_.Alloc(), kInvalidTryIndex);
   success_block_ =
@@ -161,8 +162,10 @@
   index_temp_ = Local(Symbols::index_temp());
   result_ = Local(Symbols::result());
 
-  string_param_ = Parameter(Symbols::string_param(), 0);
-  start_index_param_ = Parameter(Symbols::start_index_param(), 1);
+  string_param_ = Parameter(Symbols::string_param(),
+                            RegExpMacroAssembler::kParamStringIndex);
+  start_index_param_ = Parameter(Symbols::start_index_param(),
+                                 RegExpMacroAssembler::kParamStartOffsetIndex);
 }
 
 
@@ -306,19 +309,24 @@
 
 
 RawArray* IRRegExpMacroAssembler::Execute(
-    const Function& function,
+    const JSRegExp& regexp,
     const String& input,
     const Smi& start_offset,
     Zone* zone) {
+  const intptr_t cid = input.GetClassId();
+  const Function& fun = Function::Handle(regexp.function(cid));
+  ASSERT(!fun.IsNull());
   // Create the argument list.
-  const Array& args = Array::Handle(Array::New(2));
-  args.SetAt(0, input);
-  args.SetAt(1, start_offset);
+  const Array& args =
+      Array::Handle(Array::New(RegExpMacroAssembler::kParamCount));
+  args.SetAt(RegExpMacroAssembler::kParamRegExpIndex, regexp);
+  args.SetAt(RegExpMacroAssembler::kParamStringIndex, input);
+  args.SetAt(RegExpMacroAssembler::kParamStartOffsetIndex, start_offset);
 
   // And finally call the generated code.
 
   const Object& retval =
-      Object::Handle(zone, DartEntry::InvokeFunction(function, args));
+      Object::Handle(zone, DartEntry::InvokeFunction(fun, args));
   if (retval.IsError()) {
     const Error& error = Error::Cast(retval);
     OS::Print("%s\n", error.ToErrorCString());
@@ -335,11 +343,10 @@
 }
 
 
-RawBool* IRRegExpMacroAssembler::CaseInsensitiveCompareUC16(
-    RawString* str_raw,
-    RawSmi* lhs_index_raw,
-    RawSmi* rhs_index_raw,
-    RawSmi* length_raw) {
+static RawBool* CaseInsensitiveCompareUC16(RawString* str_raw,
+                                           RawSmi* lhs_index_raw,
+                                           RawSmi* rhs_index_raw,
+                                           RawSmi* length_raw) {
   const String& str = String::Handle(str_raw);
   const Smi& lhs_index = Smi::Handle(lhs_index_raw);
   const Smi& rhs_index = Smi::Handle(rhs_index_raw);
@@ -368,6 +375,11 @@
 }
 
 
+DEFINE_RAW_LEAF_RUNTIME_ENTRY(
+    CaseInsensitiveCompareUC16, 4, false /* is_float */,
+    reinterpret_cast<RuntimeFunction>(&CaseInsensitiveCompareUC16));
+
+
 LocalVariable* IRRegExpMacroAssembler::Parameter(const String& name,
                                                  intptr_t index) const {
   const Type& local_type = Type::ZoneHandle(Z, Type::DynamicType());
@@ -428,7 +440,7 @@
   ASSERT(!word_character_field.IsUninitialized());
 
   return new(Z) ConstantInstr(
-        Instance::ZoneHandle(Z, word_character_field.value()));
+        Instance::ZoneHandle(Z, word_character_field.StaticValue()));
 }
 
 
diff --git a/runtime/vm/regexp_assembler_ir.h b/runtime/vm/regexp_assembler_ir.h
index 77d09d5..eeb9f26 100644
--- a/runtime/vm/regexp_assembler_ir.h
+++ b/runtime/vm/regexp_assembler_ir.h
@@ -37,15 +37,7 @@
 
   virtual bool CanReadUnaligned();
 
-  // Compares two-byte strings case insensitively.
-  // Called from generated RegExp code.
-  static RawBool* CaseInsensitiveCompareUC16(
-      RawString* str_raw,
-      RawSmi* lhs_index_raw,
-      RawSmi* rhs_index_raw,
-      RawSmi* length_raw);
-
-  static RawArray* Execute(const Function& function,
+  static RawArray* Execute(const JSRegExp& regexp,
                            const String& input,
                            const Smi& start_offset,
                            Zone* zone);
diff --git a/runtime/vm/regexp_parser.cc b/runtime/vm/regexp_parser.cc
index 716afa4..b24e8ca 100644
--- a/runtime/vm/regexp_parser.cc
+++ b/runtime/vm/regexp_parser.cc
@@ -217,7 +217,7 @@
 
 
 bool RegExpParser::ParseFunction(ParsedFunction *parsed_function) {
-  VMTagScope tagScope(Thread::Current()->isolate(),
+  VMTagScope tagScope(parsed_function->thread(),
                       VMTag::kCompileParseRegExpTagId);
   Zone* zone = parsed_function->zone();
   JSRegExp& regexp = JSRegExp::Handle(parsed_function->function().regexp());
diff --git a/runtime/vm/regexp_test.cc b/runtime/vm/regexp_test.cc
index 7b33982..d75dac4 100644
--- a/runtime/vm/regexp_test.cc
+++ b/runtime/vm/regexp_test.cc
@@ -16,11 +16,8 @@
   Zone* zone = Thread::Current()->zone();
   const JSRegExp& regexp = JSRegExp::Handle(
       RegExpEngine::CreateJSRegExp(zone, pat, false, false));
-  const intptr_t cid = str.GetClassId();
-  const Function& fn = Function::Handle(regexp.function(cid));
-  EXPECT(!fn.IsNull());
   const Smi& idx = Smi::Handle(Smi::New(0));
-  return IRRegExpMacroAssembler::Execute(fn, str, idx, zone);
+  return IRRegExpMacroAssembler::Execute(regexp, str, idx, zone);
 }
 
 TEST_CASE(RegExp_OneByteString) {
diff --git a/runtime/vm/report.cc b/runtime/vm/report.cc
index 4ef7362..e65391d 100644
--- a/runtime/vm/report.cc
+++ b/runtime/vm/report.cc
@@ -46,49 +46,61 @@
       // Only report the line position if we have the original source. We still
       // need to get a valid column so that we can report the ^ mark below the
       // snippet.
+      // Allocate formatted strings in old sapce as they may be created during
+      // optimizing compilation. Those strings are created rarely and should not
+      // polute old space.
       if (script.HasSource()) {
-        result = String::NewFormatted("'%s': %s: line %" Pd " pos %" Pd ": ",
+        result = String::NewFormatted(Heap::kOld,
+                                      "'%s': %s: line %" Pd " pos %" Pd ": ",
                                       script_url.ToCString(),
                                       message_header,
                                       line,
                                       column);
       } else {
-        result = String::NewFormatted("'%s': %s: line %" Pd ": ",
+        result = String::NewFormatted(Heap::kOld,
+                                      "'%s': %s: line %" Pd ": ",
                                       script_url.ToCString(),
                                       message_header,
                                       line);
       }
       // Append the formatted error or warning message.
-      result = String::Concat(result, message);
+      GrowableHandlePtrArray<const String> strs(Thread::Current()->zone(), 5);
+      strs.Add(result);
+      strs.Add(message);
       // Append the source line.
-      const String& script_line = String::Handle(script.GetLine(line));
+      const String& script_line = String::Handle(
+          script.GetLine(line, Heap::kOld));
       ASSERT(!script_line.IsNull());
-      result = String::Concat(result, Symbols::NewLine());
-      result = String::Concat(result, script_line);
-      result = String::Concat(result, Symbols::NewLine());
+      strs.Add(Symbols::NewLine());
+      strs.Add(script_line);
+      strs.Add(Symbols::NewLine());
       // Append the column marker.
       const String& column_line = String::Handle(
-          String::NewFormatted("%*s\n", static_cast<int>(column), "^"));
-      result = String::Concat(result, column_line);
+          String::NewFormatted(Heap::kOld,
+                               "%*s\n", static_cast<int>(column), "^"));
+      strs.Add(column_line);
+      // TODO(srdjan): Use Strings::FromConcatAll in old space, once
+      // implemented.
+      result = Symbols::FromConcatAll(strs);
     } else {
       // Token position is unknown.
-      result = String::NewFormatted("'%s': %s: ",
+      result = String::NewFormatted(Heap::kOld, "'%s': %s: ",
                                     script_url.ToCString(),
                                     message_header);
-      result = String::Concat(result, message);
+      result = String::Concat(result, message, Heap::kOld);
     }
   } else {
     // Script is unknown.
     // Append the formatted error or warning message.
-    result = String::NewFormatted("%s: ", message_header);
-    result = String::Concat(result, message);
+    result = String::NewFormatted(Heap::kOld, "%s: ", message_header);
+    result = String::Concat(result, message, Heap::kOld);
   }
   return result.raw();
 }
 
 
 void Report::LongJump(const Error& error) {
-  Isolate::Current()->long_jump_base()->Jump(1, error);
+  Thread::Current()->long_jump_base()->Jump(1, error);
   UNREACHABLE();
 }
 
@@ -212,14 +224,14 @@
   ASSERT(caller_frame != NULL);
   ASSERT(FLAG_warn_on_javascript_compatibility);
   if (FLAG_silent_warnings) return;
-  Isolate* isolate = Isolate::Current();
-  const Code& caller_code = Code::Handle(isolate,
+  Zone* zone = Thread::Current()->zone();
+  const Code& caller_code = Code::Handle(zone,
                                          caller_frame->LookupDartCode());
   ASSERT(!caller_code.IsNull());
   const uword caller_pc = caller_frame->pc();
   const intptr_t token_pos = caller_code.GetTokenIndexOfPC(caller_pc);
-  const Function& caller = Function::Handle(isolate, caller_code.function());
-  const Script& script = Script::Handle(isolate, caller.script());
+  const Function& caller = Function::Handle(zone, caller_code.function());
+  const Script& script = Script::Handle(zone, caller.script());
   MessageF(kJSWarning, script, token_pos, "%s", msg);
 }
 
diff --git a/runtime/vm/report_test.cc b/runtime/vm/report_test.cc
index 73f2108..6338f5b 100644
--- a/runtime/vm/report_test.cc
+++ b/runtime/vm/report_test.cc
@@ -9,12 +9,13 @@
 namespace dart {
 
 TEST_CASE(TraceJSWarning) {
-  Isolate* isolate = Isolate::Current();
+  Zone* zone = thread->zone();
+  Isolate* isolate = thread->isolate();
   TraceBuffer::Init(isolate, 3);
   TraceBuffer* trace_buffer = isolate->trace_buffer();
-  const String& url = String::Handle(isolate, String::New("Plug"));
-  const String& source = String::Handle(isolate, String::New("240 100"));
-  const Script& script = Script::Handle(isolate,
+  const String& url = String::Handle(zone, String::New("Plug"));
+  const String& source = String::Handle(zone, String::New("240 100"));
+  const Script& script = Script::Handle(zone,
       Script::New(url, source, RawScript::kEvaluateTag));
   script.Tokenize(String::Handle(String::New("")));
   {
diff --git a/runtime/vm/reusable_handles.h b/runtime/vm/reusable_handles.h
index c1b5301..8f057ea 100644
--- a/runtime/vm/reusable_handles.h
+++ b/runtime/vm/reusable_handles.h
@@ -30,41 +30,42 @@
 // }
 //
 
+
 #if defined(DEBUG)
 #define REUSABLE_SCOPE(name)                                                   \
   class Reusable##name##HandleScope : public ValueObject {                     \
-    public:                                                                    \
-    explicit Reusable##name##HandleScope(Isolate* isolate)                     \
-        : isolate_(isolate) {                                                  \
-      ASSERT(!isolate->reusable_##name##_handle_scope_active());               \
-      isolate->set_reusable_##name##_handle_scope_active(true);                \
+   public:                                                                     \
+    explicit Reusable##name##HandleScope(Thread* thread)                       \
+        : thread_(thread) {                                                    \
+      ASSERT(!thread->reusable_##name##_handle_scope_active());                \
+      thread->set_reusable_##name##_handle_scope_active(true);                 \
     }                                                                          \
-    Reusable##name##HandleScope() : isolate_(Isolate::Current()) {             \
-      ASSERT(!isolate_->reusable_##name##_handle_scope_active());              \
-      isolate_->set_reusable_##name##_handle_scope_active(true);               \
+    Reusable##name##HandleScope() : thread_(Thread::Current()) {               \
+      ASSERT(!thread_->reusable_##name##_handle_scope_active());               \
+      thread_->set_reusable_##name##_handle_scope_active(true);                \
     }                                                                          \
     ~Reusable##name##HandleScope() {                                           \
-      ASSERT(isolate_->reusable_##name##_handle_scope_active());               \
-      isolate_->set_reusable_##name##_handle_scope_active(false);              \
+      ASSERT(thread_->reusable_##name##_handle_scope_active());                \
+      thread_->set_reusable_##name##_handle_scope_active(false);               \
       Handle().raw_ = name::null();                                            \
     }                                                                          \
     name& Handle() const {                                                     \
-      ASSERT(isolate_->name##_handle_ != NULL);                                \
-      return *isolate_->name##_handle_;                                        \
+      ASSERT(thread_->name##_handle_ != NULL);                                 \
+      return *thread_->name##_handle_;                                         \
     }                                                                          \
-    private:                                                                   \
-    Isolate* isolate_;                                                         \
+   private:                                                                    \
+    Thread* thread_;                                                           \
     DISALLOW_COPY_AND_ASSIGN(Reusable##name##HandleScope);                     \
   };
 #else
 #define REUSABLE_SCOPE(name)                                                   \
   class Reusable##name##HandleScope : public ValueObject {                     \
-    public:                                                                    \
-    explicit Reusable##name##HandleScope(Isolate* isolate)                     \
-        : handle_(isolate->name##_handle_) {                                   \
+   public:                                                                     \
+    explicit Reusable##name##HandleScope(Thread* thread)                       \
+        : handle_(thread->name##_handle_) {                                    \
     }                                                                          \
     Reusable##name##HandleScope()                                              \
-        : handle_(Isolate::Current()->name##_handle_) {                        \
+        : handle_(Thread::Current()->name##_handle_) {                         \
     }                                                                          \
     ~Reusable##name##HandleScope() {                                           \
       handle_->raw_ = name::null();                                            \
@@ -73,7 +74,7 @@
       ASSERT(handle_ != NULL);                                                 \
       return *handle_;                                                         \
     }                                                                          \
-    private:                                                                   \
+   private:                                                                    \
     name* handle_;                                                             \
     DISALLOW_COPY_AND_ASSIGN(Reusable##name##HandleScope);                     \
   };
@@ -81,41 +82,40 @@
 REUSABLE_HANDLE_LIST(REUSABLE_SCOPE)
 #undef REUSABLE_SCOPE
 
-#define REUSABLE_ABSTRACT_TYPE_HANDLESCOPE(isolate)                            \
-  ReusableAbstractTypeHandleScope reused_abstract_type(isolate);
-#define REUSABLE_ARRAY_HANDLESCOPE(isolate)                                    \
-  ReusableArrayHandleScope reused_array_handle(isolate);
-#define REUSABLE_CLASS_HANDLESCOPE(isolate)                                    \
-  ReusableClassHandleScope reused_class_handle(isolate);
-#define REUSABLE_CODE_HANDLESCOPE(isolate)                                     \
-  ReusableCodeHandleScope reused_code_handle(isolate);
-#define REUSABLE_ERROR_HANDLESCOPE(isolate)                                    \
-  ReusableErrorHandleScope reused_error_handle(isolate);
-#define REUSABLE_EXCEPTION_HANDLERS_HANDLESCOPE(isolate)                       \
+#define REUSABLE_ABSTRACT_TYPE_HANDLESCOPE(thread)                             \
+  ReusableAbstractTypeHandleScope reused_abstract_type(thread);
+#define REUSABLE_ARRAY_HANDLESCOPE(thread)                                     \
+  ReusableArrayHandleScope reused_array_handle(thread);
+#define REUSABLE_CLASS_HANDLESCOPE(thread)                                     \
+  ReusableClassHandleScope reused_class_handle(thread);
+#define REUSABLE_CODE_HANDLESCOPE(thread)                                      \
+  ReusableCodeHandleScope reused_code_handle(thread);
+#define REUSABLE_ERROR_HANDLESCOPE(thread)                                     \
+  ReusableErrorHandleScope reused_error_handle(thread);
+#define REUSABLE_EXCEPTION_HANDLERS_HANDLESCOPE(thread)                        \
   ReusableExceptionHandlersHandleScope                                         \
-      reused_exception_handlers_handle(isolate);
-#define REUSABLE_FIELD_HANDLESCOPE(isolate)                                    \
-  ReusableFieldHandleScope reused_field_handle(isolate);
-#define REUSABLE_FUNCTION_HANDLESCOPE(isolate)                                 \
-  ReusableFunctionHandleScope reused_function_handle(isolate);
-#define REUSABLE_GROWABLE_OBJECT_ARRAY_HANDLESCOPE(isolate)                    \
+      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(isolate)
-#define REUSABLE_INSTANCE_HANDLESCOPE(isolate)                                 \
-  ReusableInstanceHandleScope reused_instance_handle(isolate);
-#define REUSABLE_LIBRARY_HANDLESCOPE(isolate)                                  \
-  ReusableLibraryHandleScope reused_library_handle(isolate);
-#define REUSABLE_OBJECT_HANDLESCOPE(isolate)                                   \
-  ReusableObjectHandleScope reused_object_handle(isolate);
-#define REUSABLE_PC_DESCRIPTORS_HANDLESCOPE(isolate)                           \
-  ReusablePcDescriptorsHandleScope reused_pc_descriptors_handle(isolate);
-#define REUSABLE_STRING_HANDLESCOPE(isolate)                                   \
-  ReusableStringHandleScope reused_string_handle(isolate);
-#define REUSABLE_TYPE_ARGUMENTS_HANDLESCOPE(isolate)                           \
-  ReusableTypeArgumentsHandleScope reused_type_arguments_handle(isolate);
-#define REUSABLE_TYPE_PARAMETER_HANDLESCOPE(isolate)                           \
-  ReusableTypeParameterHandleScope reused_type_parameter(isolate);
-
+      reused_growable_object_array_handle(thread)
+#define REUSABLE_INSTANCE_HANDLESCOPE(thread)                                  \
+  ReusableInstanceHandleScope reused_instance_handle(thread);
+#define REUSABLE_LIBRARY_HANDLESCOPE(thread)                                   \
+  ReusableLibraryHandleScope reused_library_handle(thread);
+#define REUSABLE_OBJECT_HANDLESCOPE(thread)                                    \
+  ReusableObjectHandleScope reused_object_handle(thread);
+#define REUSABLE_PC_DESCRIPTORS_HANDLESCOPE(thread)                            \
+  ReusablePcDescriptorsHandleScope reused_pc_descriptors_handle(thread);
+#define REUSABLE_STRING_HANDLESCOPE(thread)                                    \
+  ReusableStringHandleScope reused_string_handle(thread);
+#define REUSABLE_TYPE_ARGUMENTS_HANDLESCOPE(thread)                            \
+  ReusableTypeArgumentsHandleScope reused_type_arguments_handle(thread);
+#define REUSABLE_TYPE_PARAMETER_HANDLESCOPE(thread)                            \
+  ReusableTypeParameterHandleScope reused_type_parameter(thread);
 
 }  // namespace dart
 
diff --git a/runtime/vm/runtime_entry.cc b/runtime/vm/runtime_entry.cc
new file mode 100644
index 0000000..f177a10
--- /dev/null
+++ b/runtime/vm/runtime_entry.cc
@@ -0,0 +1,34 @@
+// 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.
+
+#include "vm/runtime_entry.h"
+
+#include "vm/object.h"
+#include "vm/symbols.h"
+#include "vm/verifier.h"
+
+namespace dart {
+
+
+// Add function to a class and that class to the class dictionary so that
+// frame walking can be used.
+const Function& RegisterFakeFunction(const char* name, const Code& code) {
+  const String& class_name = String::Handle(Symbols::New("ownerClass"));
+  const Script& script = Script::Handle();
+  const Class& owner_class =
+      Class::Handle(Class::New(class_name, script, Scanner::kNoSourcePos));
+  const String& function_name = String::ZoneHandle(Symbols::New(name));
+  const Function& function = Function::ZoneHandle(
+      Function::New(function_name, RawFunction::kRegularFunction,
+                    true, false, false, false, false, owner_class, 0));
+  const Array& functions = Array::Handle(Array::New(1));
+  functions.SetAt(0, function);
+  owner_class.SetFunctions(functions);
+  Library& lib = Library::Handle(Library::CoreLibrary());
+  lib.AddClass(owner_class);
+  function.AttachCode(code);
+  return function;
+}
+
+}  // namespace dart
diff --git a/runtime/vm/runtime_entry.h b/runtime/vm/runtime_entry.h
index 27c9619..97b5623 100644
--- a/runtime/vm/runtime_entry.h
+++ b/runtime/vm/runtime_entry.h
@@ -6,17 +6,31 @@
 #define VM_RUNTIME_ENTRY_H_
 
 #include "vm/allocation.h"
-#include "vm/assembler.h"
 #include "vm/flags.h"
 #include "vm/native_arguments.h"
+#include "vm/runtime_entry_list.h"
 #include "vm/tags.h"
 
 namespace dart {
 
+class Assembler;
+
 DECLARE_FLAG(bool, trace_runtime_calls);
 
 typedef void (*RuntimeFunction)(NativeArguments arguments);
 
+enum RuntimeFunctionId {
+  kNoRuntimeFunctionId = -1,
+#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)
+#undef DECLARE_LEAF_ENUM_VALUE
+};
 
 // Class RuntimeEntry is used to encapsulate runtime functions, it includes
 // the entry point for the runtime function and the number of arguments expected
@@ -41,7 +55,7 @@
   intptr_t argument_count() const { return argument_count_; }
   bool is_leaf() const { return is_leaf_; }
   bool is_float() const { return is_float_; }
-  uword GetEntryPoint() const { return reinterpret_cast<uword>(function()); }
+  uword GetEntryPoint() const;
 
   // Generate code to call the runtime entry.
   void Call(Assembler* assembler, intptr_t argument_count) const;
@@ -49,6 +63,9 @@
   void set_next(const RuntimeEntry* next) { next_ = next; }
   const RuntimeEntry* next() const { return next_; }
 
+  static inline uword AddressFromId(RuntimeFunctionId id);
+  static inline RuntimeFunctionId RuntimeFunctionIdFromAddress(uword address);
+
  private:
   const char* name_;
   const RuntimeFunction function_;
@@ -80,8 +97,8 @@
       Thread* thread = arguments.thread();                                     \
       ASSERT(thread == Thread::Current());                                     \
       Isolate* isolate = thread->isolate();                                    \
-      StackZone zone(isolate);                                                 \
-      HANDLESCOPE(isolate);                                                    \
+      StackZone zone(thread);                                                  \
+      HANDLESCOPE(thread);                                                     \
       DRT_Helper##name(isolate, thread, zone.GetZone(), arguments);            \
     }                                                                          \
     VERIFY_ON_TRANSITION;                                                      \
@@ -92,7 +109,8 @@
                                NativeArguments arguments)
 
 #define DECLARE_RUNTIME_ENTRY(name)                                            \
-  extern const RuntimeEntry k##name##RuntimeEntry
+  extern const RuntimeEntry k##name##RuntimeEntry;                             \
+  extern void DRT_##name(NativeArguments arguments);                           \
 
 #define DEFINE_LEAF_RUNTIME_ENTRY(type, name, argument_count, ...)             \
   extern "C" type DLRT_##name(__VA_ARGS__);                                    \
@@ -105,9 +123,57 @@
 
 #define END_LEAF_RUNTIME_ENTRY }
 
+// TODO(rmacnak): Fix alignment issue on simarm and simmips and use
+// 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)                     \
+
 #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.
+RUNTIME_ENTRY_LIST(DECLARE_RUNTIME_ENTRY)
+LEAF_RUNTIME_ENTRY_LIST(DECLARE_LEAF_RUNTIME_ENTRY)
+
+
+// Declare all runtime functions here.
+RUNTIME_ENTRY_LIST(DECLARE_RUNTIME_ENTRY)
+LEAF_RUNTIME_ENTRY_LIST(DECLARE_LEAF_RUNTIME_ENTRY)
+
+
+uword RuntimeEntry::AddressFromId(RuntimeFunctionId id) {
+    switch (id) {
+#define DEFINE_RUNTIME_CASE(name)                                              \
+    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();
+    LEAF_RUNTIME_ENTRY_LIST(DEFINE_LEAF_RUNTIME_CASE)
+#undef DEFINE_LEAF_RUNTIME_CASE
+    default:
+      break;
+  }
+  return 0;
+}
+
+
+RuntimeFunctionId RuntimeEntry::RuntimeFunctionIdFromAddress(uword address) {
+#define CHECK_RUNTIME_ADDRESS(name)                                            \
+  if (address == k##name##RuntimeEntry.GetEntryPoint()) return k##name##Id;
+  RUNTIME_ENTRY_LIST(CHECK_RUNTIME_ADDRESS)
+#undef CHECK_RUNTIME_ADDRESS
+
+#define CHECK_LEAF_RUNTIME_ADDRESS(type, name, ...)                            \
+  if (address == k##name##RuntimeEntry.GetEntryPoint()) return k##name##Id;
+  LEAF_RUNTIME_ENTRY_LIST(CHECK_LEAF_RUNTIME_ADDRESS)
+#undef CHECK_LEAF_RUNTIME_ADDRESS
+  return kNoRuntimeFunctionId;
+}
 
 }  // namespace dart
 
diff --git a/runtime/vm/runtime_entry_arm.cc b/runtime/vm/runtime_entry_arm.cc
index d355254..a2c9d49 100644
--- a/runtime/vm/runtime_entry_arm.cc
+++ b/runtime/vm/runtime_entry_arm.cc
@@ -16,38 +16,42 @@
 #define __ assembler->
 
 
+uword RuntimeEntry::GetEntryPoint() const {
+  // Compute the effective address. When running under the simulator,
+  // this is a redirection address that forces the simulator to call
+  // into the runtime system.
+  uword entry = reinterpret_cast<uword>(function());
+#if defined(USING_SIMULATOR)
+  // 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)) ||
+         (argument_count() <= 2));
+  Simulator::CallKind call_kind =
+      is_leaf() ? (is_float() ? Simulator::kLeafFloatRuntimeCall
+                              : Simulator::kLeafRuntimeCall)
+                : Simulator::kRuntimeCall;
+  entry =
+      Simulator::RedirectExternalReference(entry, call_kind, argument_count());
+#endif
+  return entry;
+}
+
+
 // Generate code to call into the stub which will call the runtime
 // function. Input for the stub is as follows:
 //   SP : points to the arguments and return value array.
 //   R5 : address of the runtime function to call.
 //   R4 : number of arguments to the call.
 void RuntimeEntry::Call(Assembler* assembler, intptr_t argument_count) const {
-  // Compute the effective address. When running under the simulator,
-  // this is a redirection address that forces the simulator to call
-  // into the runtime system.
-  uword entry = GetEntryPoint();
-#if defined(USING_SIMULATOR)
-  // Redirection to leaf runtime calls supports a maximum of 4 arguments passed
-  // in registers (maximum 2 double arguments for leaf float runtime calls).
-  ASSERT(argument_count >= 0);
-  ASSERT(!is_leaf() ||
-         (!is_float() && (argument_count <= 4)) ||
-         (argument_count <= 2));
-  Simulator::CallKind call_kind =
-      is_leaf() ? (is_float() ? Simulator::kLeafFloatRuntimeCall
-                              : Simulator::kLeafRuntimeCall)
-                : Simulator::kRuntimeCall;
-  entry =
-      Simulator::RedirectExternalReference(entry, call_kind, argument_count);
-#endif
-  ExternalLabel label(entry);
   if (is_leaf()) {
     ASSERT(argument_count == this->argument_count());
-    __ BranchLink(&label);
+    __ BranchLinkOffset(THR, Thread::OffsetFromThread(this));
   } else {
     // Argument count is not checked here, but in the runtime entry for a more
     // informative error message.
-    __ LoadExternalLabel(R5, &label, kNotPatchable);
+    __ LoadFromOffset(kWord, R5, THR, Thread::OffsetFromThread(this));
     __ LoadImmediate(R4, argument_count);
     __ BranchLink(*StubCode::CallToRuntime_entry(), kNotPatchable);
   }
diff --git a/runtime/vm/runtime_entry_arm64.cc b/runtime/vm/runtime_entry_arm64.cc
index 38dbe43..626d940 100644
--- a/runtime/vm/runtime_entry_arm64.cc
+++ b/runtime/vm/runtime_entry_arm64.cc
@@ -15,29 +15,36 @@
 
 #define __ assembler->
 
+
+uword RuntimeEntry::GetEntryPoint() const {
+  // Compute the effective address. When running under the simulator,
+  // this is a redirection address that forces the simulator to call
+  // into the runtime system.
+  uword entry = reinterpret_cast<uword>(function());
+#if defined(USING_SIMULATOR)
+  // 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)) ||
+         (argument_count() <= 2));
+  Simulator::CallKind call_kind =
+      is_leaf() ? (is_float() ? Simulator::kLeafFloatRuntimeCall
+                              : Simulator::kLeafRuntimeCall)
+                : Simulator::kRuntimeCall;
+  entry =
+      Simulator::RedirectExternalReference(entry, call_kind, argument_count());
+#endif
+  return entry;
+}
+
+
 // Generate code to call into the stub which will call the runtime
 // function. Input for the stub is as follows:
 //   SP : points to the arguments and return value array.
 //   R5 : address of the runtime function to call.
 //   R4 : number of arguments to the call.
 void RuntimeEntry::Call(Assembler* assembler, intptr_t argument_count) const {
-  // Compute the effective address. When running under the simulator,
-  // this is a redirection address that forces the simulator to call
-  // into the runtime system.
-  uword entry = GetEntryPoint();
-#if defined(USING_SIMULATOR)
-  // Redirection to leaf runtime calls supports a maximum of 8 arguments passed
-  // in registers.
-  ASSERT(argument_count >= 0);
-  ASSERT(!is_leaf() || (argument_count <= 8));
-  Simulator::CallKind call_kind =
-      is_leaf() ? (is_float() ? Simulator::kLeafFloatRuntimeCall
-                              : Simulator::kLeafRuntimeCall)
-                : Simulator::kRuntimeCall;
-  entry =
-      Simulator::RedirectExternalReference(entry, call_kind, argument_count);
-#endif
-  ExternalLabel label(entry);
   if (is_leaf()) {
     ASSERT(argument_count == this->argument_count());
     // Since we are entering C++ code, we must restore the C stack pointer from
@@ -49,13 +56,14 @@
     __ mov(R26, SP);
     __ ReserveAlignedFrameSpace(0);
     __ mov(CSP, SP);
-    __ BranchLink(&label);
+    __ ldr(TMP, Address(THR, Thread::OffsetFromThread(this)));
+    __ blr(TMP);
     __ mov(SP, R26);
     __ mov(CSP, R25);
   } else {
     // Argument count is not checked here, but in the runtime entry for a more
     // informative error message.
-    __ LoadExternalLabel(R5, &label);
+    __ ldr(R5, Address(THR, Thread::OffsetFromThread(this)));
     __ LoadImmediate(R4, argument_count);
     __ BranchLink(*StubCode::CallToRuntime_entry());
   }
diff --git a/runtime/vm/runtime_entry_ia32.cc b/runtime/vm/runtime_entry_ia32.cc
index 33b0e5a..f16db03 100644
--- a/runtime/vm/runtime_entry_ia32.cc
+++ b/runtime/vm/runtime_entry_ia32.cc
@@ -15,6 +15,11 @@
 #define __ assembler->
 
 
+uword RuntimeEntry::GetEntryPoint() const {
+  return reinterpret_cast<uword>(function());
+}
+
+
 // Generate code to call into the stub which will call the runtime
 // function. Input for the stub is as follows:
 // For regular runtime calls -
diff --git a/runtime/vm/runtime_entry_list.h b/runtime/vm/runtime_entry_list.h
new file mode 100644
index 0000000..e44d0d4
--- /dev/null
+++ b/runtime/vm/runtime_entry_list.h
@@ -0,0 +1,66 @@
+// 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.
+
+#ifndef VM_RUNTIME_ENTRY_LIST_H_
+#define VM_RUNTIME_ENTRY_LIST_H_
+
+namespace dart {
+
+#define RUNTIME_ENTRY_LIST(V)                                                  \
+  V(AllocateArray)                                                             \
+  V(AllocateContext)                                                           \
+  V(AllocateObject)                                                            \
+  V(BreakpointRuntimeHandler)                                                  \
+  V(SingleStepHandler)                                                         \
+  V(CloneContext)                                                              \
+  V(FixCallersTarget)                                                          \
+  V(FixAllocationStubTarget)                                                   \
+  V(InlineCacheMissHandlerOneArg)                                              \
+  V(InlineCacheMissHandlerTwoArgs)                                             \
+  V(InlineCacheMissHandlerThreeArgs)                                           \
+  V(StaticCallMissHandlerOneArg)                                               \
+  V(StaticCallMissHandlerTwoArgs)                                              \
+  V(Instanceof)                                                                \
+  V(TypeCheck)                                                                 \
+  V(BadTypeError)                                                              \
+  V(NonBoolTypeError)                                                          \
+  V(InstantiateType)                                                           \
+  V(InstantiateTypeArguments)                                                  \
+  V(InvokeClosureNoSuchMethod)                                                 \
+  V(InvokeNoSuchMethodDispatcher)                                              \
+  V(MegamorphicCacheMissHandler)                                               \
+  V(OptimizeInvokedFunction)                                                   \
+  V(TraceICCall)                                                               \
+  V(PatchStaticCall)                                                           \
+  V(ReThrow)                                                                   \
+  V(StackOverflow)                                                             \
+  V(Throw)                                                                     \
+  V(TraceFunctionEntry)                                                        \
+  V(TraceFunctionExit)                                                         \
+  V(DeoptimizeMaterialize)                                                     \
+  V(UpdateFieldCid)                                                            \
+  V(InitStaticField)                                                           \
+  V(GrowRegExpStack)                                                           \
+  V(CompileFunction)                                                           \
+
+#define LEAF_RUNTIME_ENTRY_LIST(V)                                             \
+  V(void, PrintStopMessage, const char*)                                       \
+  V(intptr_t, DeoptimizeCopyFrame, uword, uword)                               \
+  V(void, DeoptimizeFillFrame, uword)                                          \
+  V(void, StoreBufferBlockProcess, Thread*)                                    \
+  V(intptr_t, BigintCompare, RawBigint*, RawBigint*)                           \
+  V(double, LibcPow, double, double)                                           \
+  V(double, DartModulo, double, double)                                        \
+  V(double, LibcFloor, double)                                                 \
+  V(double, LibcCeil, double)                                                  \
+  V(double, LibcTrunc, double)                                                 \
+  V(double, LibcRound, double)                                                 \
+  V(double, LibcCos, double)                                                   \
+  V(double, LibcSin, double)                                                   \
+  V(RawBool*, CaseInsensitiveCompareUC16,                                      \
+    RawString*, RawSmi*, RawSmi*, RawSmi*)                                     \
+
+}  // namespace dart
+
+#endif  // VM_RUNTIME_ENTRY_LIST_H_
diff --git a/runtime/vm/runtime_entry_mips.cc b/runtime/vm/runtime_entry_mips.cc
index 03cfa1f..31970fe 100644
--- a/runtime/vm/runtime_entry_mips.cc
+++ b/runtime/vm/runtime_entry_mips.cc
@@ -16,38 +16,43 @@
 #define __ assembler->
 
 
+uword RuntimeEntry::GetEntryPoint() const {
+  // Compute the effective address. When running under the simulator,
+  // this is a redirection address that forces the simulator to call
+  // into the runtime system.
+  uword entry = reinterpret_cast<uword>(function());
+#if defined(USING_SIMULATOR)
+  // 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)) ||
+         (argument_count() <= 2));
+  Simulator::CallKind call_kind =
+      is_leaf() ? (is_float() ? Simulator::kLeafFloatRuntimeCall
+                              : Simulator::kLeafRuntimeCall)
+                : Simulator::kRuntimeCall;
+  entry =
+      Simulator::RedirectExternalReference(entry, call_kind, argument_count());
+#endif
+  return entry;
+}
+
+
 // Generate code to call into the stub which will call the runtime
 // function. Input for the stub is as follows:
 //   SP : points to the arguments and return value array.
 //   S5 : address of the runtime function to call.
 //   S4 : number of arguments to the call.
 void RuntimeEntry::Call(Assembler* assembler, intptr_t argument_count) const {
-  // Compute the effective address. When running under the simulator,
-  // this is a redirection address that forces the simulator to call
-  // into the runtime system.
-  uword entry = GetEntryPoint();
-#if defined(USING_SIMULATOR)
-  // Redirection to leaf runtime calls supports a maximum of 4 arguments passed
-  // in registers (maximum 2 double arguments for leaf float runtime calls).
-  ASSERT(argument_count >= 0);
-  ASSERT(!is_leaf() ||
-         (!is_float() && (argument_count <= 4)) ||
-         (argument_count <= 2));
-  Simulator::CallKind call_kind =
-      is_leaf() ? (is_float() ? Simulator::kLeafFloatRuntimeCall
-                              : Simulator::kLeafRuntimeCall)
-                : Simulator::kRuntimeCall;
-  entry =
-      Simulator::RedirectExternalReference(entry, call_kind, argument_count);
-#endif
-  ExternalLabel label(entry);
   if (is_leaf()) {
     ASSERT(argument_count == this->argument_count());
-    __ BranchLink(&label);
+    __ lw(T9, Address(THR, Thread::OffsetFromThread(this)));
+    __ jalr(T9);
   } else {
     // Argument count is not checked here, but in the runtime entry for a more
     // informative error message.
-    __ LoadExternalLabel(S5, &label, kNotPatchable);
+    __ lw(S5, Address(THR, Thread::OffsetFromThread(this)));
     __ LoadImmediate(S4, argument_count);
     __ BranchLink(*StubCode::CallToRuntime_entry(), kNotPatchable);
   }
diff --git a/runtime/vm/runtime_entry_test.cc b/runtime/vm/runtime_entry_test.cc
deleted file mode 100644
index b0b04c5..0000000
--- a/runtime/vm/runtime_entry_test.cc
+++ /dev/null
@@ -1,61 +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.
-
-#include "vm/runtime_entry.h"
-
-#include "vm/object.h"
-#include "vm/symbols.h"
-#include "vm/verifier.h"
-
-namespace dart {
-
-// Add function to a class and that class to the class dictionary so that
-// frame walking can be used.
-const Function& RegisterFakeFunction(const char* name, const Code& code) {
-  const String& class_name = String::Handle(Symbols::New("ownerClass"));
-  const Script& script = Script::Handle();
-  const Class& owner_class =
-      Class::Handle(Class::New(class_name, script, Scanner::kNoSourcePos));
-  const String& function_name = String::ZoneHandle(Symbols::New(name));
-  const Function& function = Function::ZoneHandle(
-      Function::New(function_name, RawFunction::kRegularFunction,
-                    true, false, false, false, false, owner_class, 0));
-  const Array& functions = Array::Handle(Array::New(1));
-  functions.SetAt(0, function);
-  owner_class.SetFunctions(functions);
-  Library& lib = Library::Handle(Library::CoreLibrary());
-  lib.AddClass(owner_class);
-  function.AttachCode(code);
-  return function;
-}
-
-
-// A runtime call for test purposes.
-// Arg0: a smi.
-// Arg1: a smi.
-// Result: a smi representing arg0 - arg1.
-DEFINE_RUNTIME_ENTRY(TestSmiSub, 2) {
-  const Smi& left = Smi::CheckedHandle(arguments.ArgAt(0));
-  const Smi& right = Smi::CheckedHandle(arguments.ArgAt(1));
-  // Ignoring overflow in the calculation below.
-  intptr_t result = left.Value() - right.Value();
-  arguments.SetReturn(Smi::Handle(Smi::New(result)));
-}
-
-
-// A leaf runtime call for test purposes.
-// arg0: a smi.
-// arg1: a smi.
-// returns a smi representing arg0 + arg1.
-DEFINE_LEAF_RUNTIME_ENTRY(RawObject*, TestLeafSmiAdd, 2,
-                          RawObject* arg0, RawObject* arg1) {
-  // Ignoring overflow in the calculation below and using the internal
-  // representation of Smi directly without using any handlized code.
-  intptr_t result = reinterpret_cast<intptr_t>(arg0) +
-      reinterpret_cast<intptr_t>(arg1);
-  return reinterpret_cast<RawObject*>(result);
-}
-END_LEAF_RUNTIME_ENTRY
-
-}  // namespace dart
diff --git a/runtime/vm/runtime_entry_x64.cc b/runtime/vm/runtime_entry_x64.cc
index df24e70..c3afdd8 100644
--- a/runtime/vm/runtime_entry_x64.cc
+++ b/runtime/vm/runtime_entry_x64.cc
@@ -15,6 +15,11 @@
 #define __ assembler->
 
 
+uword RuntimeEntry::GetEntryPoint() const {
+  return reinterpret_cast<uword>(function());
+}
+
+
 // Generate code to call into the stub which will call the runtime
 // function. Input for the stub is as follows:
 //   RSP : points to the arguments and return value array.
@@ -23,13 +28,13 @@
 void RuntimeEntry::Call(Assembler* assembler, intptr_t argument_count) const {
   if (is_leaf()) {
     ASSERT(argument_count == this->argument_count());
-    ExternalLabel label(GetEntryPoint());
-    __ CallCFunction(&label);
+    COMPILE_ASSERT(CallingConventions::kVolatileCpuRegisters & (1 << RAX));
+    __ movq(RAX, Address(THR, Thread::OffsetFromThread(this)));
+    __ CallCFunction(RAX);
   } else {
     // Argument count is not checked here, but in the runtime entry for a more
     // informative error message.
-    ExternalLabel label(GetEntryPoint());
-    __ LoadExternalLabel(RBX, &label, kNotPatchable);
+    __ movq(RBX, Address(THR, Thread::OffsetFromThread(this)));
     __ movq(R10, Immediate(argument_count));
     __ Call(*StubCode::CallToRuntime_entry());
   }
diff --git a/runtime/vm/scanner.cc b/runtime/vm/scanner.cc
index 3e7f028..50073cd 100644
--- a/runtime/vm/scanner.cc
+++ b/runtime/vm/scanner.cc
@@ -331,8 +331,7 @@
       String::ZoneHandle(Z, Symbols::New(source_, ident_pos, ident_length));
   if (ident_char0 == Library::kPrivateIdentifierStart) {
     // Private identifiers are mangled on a per library basis.
-    literal = String::Concat(literal, private_key_);
-    literal = Symbols::New(literal);
+    literal = Symbols::FromConcat(literal, private_key_);
   }
   current_token_.literal = &literal;
 }
@@ -386,9 +385,8 @@
   }
   if (current_token_.kind != Token::kILLEGAL) {
     intptr_t len = lookahead_pos_ - token_start_;
-    String& str = String::ZoneHandle(Z,
-        String::SubString(source_, token_start_, len, Heap::kOld));
-    str = Symbols::New(str);
+    const String& str =
+        String::ZoneHandle(Z, Symbols::New(source_, token_start_, len));
     current_token_.literal = &str;
   }
 }
diff --git a/runtime/vm/scavenger.cc b/runtime/vm/scavenger.cc
index ecf1ed0..c2822b5 100644
--- a/runtime/vm/scavenger.cc
+++ b/runtime/vm/scavenger.cc
@@ -16,6 +16,7 @@
 #include "vm/object_id_ring.h"
 #include "vm/stack_frame.h"
 #include "vm/store_buffer.h"
+#include "vm/thread_registry.h"
 #include "vm/verified_memory.h"
 #include "vm/verifier.h"
 #include "vm/visitor.h"
@@ -78,12 +79,13 @@
 
 class ScavengerVisitor : public ObjectPointerVisitor {
  public:
-  explicit ScavengerVisitor(Isolate* isolate, Scavenger* scavenger)
+  explicit ScavengerVisitor(Isolate* isolate,
+                            Scavenger* scavenger,
+                            SemiSpace* from)
       : ObjectPointerVisitor(isolate),
         thread_(Thread::Current()),
         scavenger_(scavenger),
-        from_start_(scavenger_->from_->start()),
-        from_size_(scavenger_->from_->end() - scavenger_->from_->start()),
+        from_(from),
         heap_(scavenger->heap_),
         vm_heap_(Dart::vm_isolate()->heap()),
         page_space_(scavenger->heap_->old_space()),
@@ -156,17 +158,9 @@
       return;
     }
 
-    // The scavenger is only interested in objects located in the from space.
-    //
-    // We are using address math here and relying on the unsigned underflow
-    // in the code below to avoid having two checks.
-    uword obj_offset = reinterpret_cast<uword>(raw_obj) - from_start_;
-    if (obj_offset > from_size_) {
-      ASSERT(scavenger_->to_->Contains(RawObject::ToAddr(raw_obj)));
-      return;
-    }
-
     uword raw_addr = RawObject::ToAddr(raw_obj);
+    // The scavenger is only expects objects located in the from space.
+    ASSERT(from_->Contains(raw_addr));
     // Read the header word of the object and determine if the object has
     // already been copied.
     uword header = *reinterpret_cast<uword*>(raw_addr);
@@ -242,8 +236,7 @@
 
   Thread* thread_;
   Scavenger* scavenger_;
-  uword from_start_;
-  uword from_size_;
+  SemiSpace* from_;
   Heap* heap_;
   Heap* vm_heap_;
   PageSpace* page_space_;
@@ -265,9 +258,10 @@
   // 'prologue_weak_were_strong' is currently only used for sanity checking.
   explicit ScavengerWeakVisitor(Scavenger* scavenger,
                                 bool prologue_weak_were_strong)
-      :  HandleVisitor(scavenger->heap_->isolate()),
+      :  HandleVisitor(Thread::Current()),
          scavenger_(scavenger),
          prologue_weak_were_strong_(prologue_weak_were_strong) {
+    ASSERT(scavenger->heap_->isolate() == Thread::Current()->isolate());
   }
 
   void VisitHandle(uword addr) {
@@ -277,9 +271,9 @@
     if (scavenger_->IsUnreachable(p)) {
       ASSERT(!handle->IsPrologueWeakPersistent() ||
              !prologue_weak_were_strong_);
-      handle->UpdateUnreachable(isolate());
+      handle->UpdateUnreachable(thread()->isolate());
     } else {
-      handle->UpdateRelocated(isolate());
+      handle->UpdateRelocated(thread()->isolate());
     }
   }
 
@@ -422,20 +416,23 @@
   if (to_ == NULL) {
     FATAL("Out of memory.\n");
   }
-  from_ = NULL;
-
   // Setup local fields.
   top_ = FirstObjectStart();
   resolved_top_ = top_;
   end_ = to_->end();
 
   survivor_end_ = FirstObjectStart();
+
+  UpdateMaxHeapCapacity();
+  UpdateMaxHeapUsage();
+  if (heap_ != NULL) {
+    heap_->UpdateGlobalMaxUsed();
+  }
 }
 
 
 Scavenger::~Scavenger() {
   ASSERT(!scavenging_);
-  ASSERT(from_ == NULL);
   to_->Delete();
 }
 
@@ -454,27 +451,30 @@
 }
 
 
-void Scavenger::Prologue(Isolate* isolate, bool invoke_api_callbacks) {
+SemiSpace* Scavenger::Prologue(Isolate* isolate, bool invoke_api_callbacks) {
   if (invoke_api_callbacks && (isolate->gc_prologue_callback() != NULL)) {
     (isolate->gc_prologue_callback())();
   }
   Thread::PrepareForGC();
   // Flip the two semi-spaces so that to_ is always the space for allocating
   // objects.
-  from_ = to_;
-  to_ = SemiSpace::New(NewSizeInWords(from_->size_in_words()));
+  SemiSpace* from = to_;
+  to_ = SemiSpace::New(NewSizeInWords(from->size_in_words()));
   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");
   }
+  UpdateMaxHeapCapacity();
   top_ = FirstObjectStart();
   resolved_top_ = top_;
   end_ = to_->end();
+  return from;
 }
 
 
 void Scavenger::Epilogue(Isolate* isolate,
+                         SemiSpace* from,
                          bool invoke_api_callbacks) {
   // All objects in the to space have been copied from the from space at this
   // moment.
@@ -506,8 +506,11 @@
     }
   }
 #endif  // defined(DEBUG)
-  from_->Delete();
-  from_ = NULL;
+  from->Delete();
+  UpdateMaxHeapUsage();
+  if (heap_ != NULL) {
+    heap_->UpdateGlobalMaxUsed();
+  }
   if (invoke_api_callbacks && (isolate->gc_epilogue_callback() != NULL)) {
     (isolate->gc_epilogue_callback())();
   }
@@ -534,7 +537,8 @@
       raw_object->VisitPointers(visitor);
     }
     pending->Reset();
-    isolate->store_buffer()->PushBlock(pending);
+    // Return the emptied block for recycling (no need to check threshold).
+    isolate->store_buffer()->PushBlock(pending, StoreBuffer::kIgnoreThreshold);
     pending = next;
   }
   heap_->RecordData(kStoreBufferEntries, total_count);
@@ -583,7 +587,7 @@
     return false;
   }
   uword raw_addr = RawObject::ToAddr(raw_obj);
-  if (!from_->Contains(raw_addr)) {
+  if (to_->Contains(raw_addr)) {
     return false;
   }
   uword header = *reinterpret_cast<uword*>(raw_addr);
@@ -624,7 +628,16 @@
       for (intptr_t k = 0; k < num_keys; ++k) {
         if (!IsUnreachable(reference_set->get_key(k))) {
           for (intptr_t v = 0; v < num_values; ++v) {
-            visitor->VisitPointer(reference_set->get_value(v));
+            RawObject** raw_obj_addr = reference_set->get_value(v);
+            RawObject* raw_obj = *raw_obj_addr;
+            // Only visit heap objects which are in from space, aka new objects
+            // not in to space. This avoids visiting a value multiple times
+            // during a scavenge.
+            if (raw_obj->IsHeapObject() &&
+                raw_obj->IsNewObject() &&
+                !to_->Contains(RawObject::ToAddr(raw_obj))) {
+              visitor->VisitPointer(raw_obj_addr);
+            }
           }
           is_unreachable = false;
           // Since we have found a key object that is reachable and all
@@ -703,6 +716,33 @@
 }
 
 
+void Scavenger::UpdateMaxHeapCapacity() {
+  if (heap_ == NULL) {
+    // Some unit tests.
+    return;
+  }
+  ASSERT(to_ != NULL);
+  ASSERT(heap_ != NULL);
+  Isolate* isolate = heap_->isolate();
+  ASSERT(isolate != NULL);
+  isolate->GetHeapNewCapacityMaxMetric()->SetValue(
+      to_->size_in_words() * kWordSize);
+}
+
+
+void Scavenger::UpdateMaxHeapUsage() {
+  if (heap_ == NULL) {
+    // Some unit tests.
+    return;
+  }
+  ASSERT(to_ != NULL);
+  ASSERT(heap_ != NULL);
+  Isolate* isolate = heap_->isolate();
+  ASSERT(isolate != NULL);
+  isolate->GetHeapNewUsedMaxMetric()->SetValue(UsedInWords() * kWordSize);
+}
+
+
 uword Scavenger::ProcessWeakProperty(RawWeakProperty* raw_weak,
                                      ScavengerVisitor* visitor) {
   // The fate of the weak property is determined by its key.
@@ -799,12 +839,20 @@
 
 
 void Scavenger::Scavenge(bool invoke_api_callbacks) {
+  Isolate* isolate = heap_->isolate();
+  // Ensure that all threads for this isolate are at a safepoint (either stopped
+  // or in native code). If two threads are racing at this point, the loser
+  // will continue with its scavenge after waiting for the winner to complete.
+  // TODO(koda): Consider moving SafepointThreads into allocation failure/retry
+  // logic to avoid needless collections.
+  isolate->thread_registry()->SafepointThreads();
+
   // Scavenging is not reentrant. Make sure that is the case.
   ASSERT(!scavenging_);
   scavenging_ = true;
-  Isolate* isolate = heap_->isolate();
+
   PageSpace* page_space = heap_->old_space();
-  NoHandleScope no_handles(isolate);
+  NoSafepointScope no_safepoints;
 
   // TODO(koda): Make verification more compatible with concurrent sweep.
   if (FLAG_verify_before_gc && !FLAG_concurrent_sweep) {
@@ -817,13 +865,13 @@
   SpaceUsage usage_before = GetCurrentUsage();
   intptr_t promo_candidate_words =
       (survivor_end_ - FirstObjectStart()) / kWordSize;
-  Prologue(isolate, invoke_api_callbacks);
+  SemiSpace* from = Prologue(isolate, invoke_api_callbacks);
   // The API prologue/epilogue may create/destroy zones, so we must not
   // depend on zone allocations surviving beyond the epilogue callback.
   {
-    StackZone zone(isolate);
+    StackZone zone(Thread::Current());
     // Setup the visitor and run the scavenge.
-    ScavengerVisitor visitor(isolate, this);
+    ScavengerVisitor visitor(isolate, this, from);
     page_space->AcquireDataLock();
     const bool prologue_weak_are_strong = !invoke_api_callbacks;
     IterateRoots(isolate, &visitor, prologue_weak_are_strong);
@@ -849,7 +897,7 @@
                       promo_candidate_words,
                       visitor.bytes_promoted() >> kWordSizeLog2));
   }
-  Epilogue(isolate, invoke_api_callbacks);
+  Epilogue(isolate, from, invoke_api_callbacks);
 
   // TODO(koda): Make verification more compatible with concurrent sweep.
   if (FLAG_verify_after_gc && !FLAG_concurrent_sweep) {
@@ -861,12 +909,13 @@
   // Done scavenging. Reset the marker.
   ASSERT(scavenging_);
   scavenging_ = false;
+
+  isolate->thread_registry()->ResumeAllThreads();
 }
 
 
 void Scavenger::WriteProtect(bool read_only) {
   ASSERT(!scavenging_);
-  ASSERT(from_ == NULL);
   to_->WriteProtect(read_only);
 }
 
@@ -890,9 +939,9 @@
   } else {
     space.AddProperty("avgCollectionPeriodMillis", 0.0);
   }
-  space.AddProperty("used", UsedInWords() * kWordSize);
-  space.AddProperty("capacity", CapacityInWords() * kWordSize);
-  space.AddProperty("external", ExternalInWords() * kWordSize);
+  space.AddProperty64("used", UsedInWords() * kWordSize);
+  space.AddProperty64("capacity", CapacityInWords() * kWordSize);
+  space.AddProperty64("external", ExternalInWords() * kWordSize);
   space.AddProperty("time", MicrosecondsToSeconds(gc_time_micros()));
 }
 
diff --git a/runtime/vm/scavenger.h b/runtime/vm/scavenger.h
index d1e9a24..af3f129 100644
--- a/runtime/vm/scavenger.h
+++ b/runtime/vm/scavenger.h
@@ -121,10 +121,6 @@
   // During a scavenge this function only returns true for addresses that will
   // be part of the surviving objects.
   bool Contains(uword addr) const {
-    // No reasonable algorithm should be checking for objects in from space. At
-    // least unless it is debugging code. This might need to be relaxed later,
-    // but currently it helps prevent dumb bugs.
-    ASSERT(from_ == NULL || !from_->Contains(addr));
     return to_->Contains(addr);
   }
 
@@ -168,13 +164,13 @@
   static intptr_t top_offset() { return OFFSET_OF(Scavenger, top_); }
   static intptr_t end_offset() { return OFFSET_OF(Scavenger, end_); }
 
-  intptr_t UsedInWords() const {
+  int64_t UsedInWords() const {
     return (top_ - FirstObjectStart()) >> kWordSizeLog2;
   }
-  intptr_t CapacityInWords() const {
+  int64_t CapacityInWords() const {
     return to_->size_in_words();
   }
-  intptr_t ExternalInWords() const {
+  int64_t ExternalInWords() const {
     return external_size_ >> kWordSizeLog2;
   }
   SpaceUsage GetCurrentUsage() const {
@@ -232,7 +228,7 @@
   };
 
   uword FirstObjectStart() const { return to_->start() | object_alignment_; }
-  void Prologue(Isolate* isolate, bool invoke_api_callbacks);
+  SemiSpace* Prologue(Isolate* isolate, bool invoke_api_callbacks);
   void IterateStoreBuffers(Isolate* isolate, ScavengerVisitor* visitor);
   void IterateObjectIdTable(Isolate* isolate, ScavengerVisitor* visitor);
   void IterateRoots(Isolate* isolate,
@@ -246,8 +242,7 @@
   void ProcessToSpace(ScavengerVisitor* visitor);
   uword ProcessWeakProperty(RawWeakProperty* raw_weak,
                             ScavengerVisitor* visitor);
-  void Epilogue(Isolate* isolate,
-                bool invoke_api_callbacks);
+  void Epilogue(Isolate* isolate, SemiSpace* from, bool invoke_api_callbacks);
 
   bool IsUnreachable(RawObject** p);
 
@@ -273,20 +268,22 @@
     return end_ < to_->end();
   }
 
+  void UpdateMaxHeapCapacity();
+  void UpdateMaxHeapUsage();
+
   void ProcessWeakTables();
 
   intptr_t NewSizeInWords(intptr_t old_size_in_words) const;
 
-  SemiSpace* from_;
-  SemiSpace* to_;
-
-  Heap* heap_;
-
   // Current allocation top and end. These values are being accessed directly
   // from generated code.
   uword top_;
   uword end_;
 
+  SemiSpace* to_;
+
+  Heap* heap_;
+
   // A pointer to the first unscanned object.  Scanning completes when
   // this value meets the allocation top.
   uword resolved_top_;
diff --git a/runtime/vm/scopes.cc b/runtime/vm/scopes.cc
index 0d4233a..0881b87 100644
--- a/runtime/vm/scopes.cc
+++ b/runtime/vm/scopes.cc
@@ -250,8 +250,12 @@
 
 
 // The parser creates internal variables that start with ":"
-static bool IsInternalIdentifier(const String& str) {
+static bool IsFilteredIdentifier(const String& str) {
   ASSERT(str.Length() > 0);
+  if (str.raw() == Symbols::AsyncOperation().raw()) {
+    // Keep :async_op for asynchronous debugging.
+    return false;
+  }
   return str.CharAt(0) == ':';
 }
 
@@ -266,10 +270,8 @@
     for (int i = 0; i < context_scope.num_variables(); i++) {
       String& name = String::Handle(context_scope.NameAt(i));
       RawLocalVarDescriptors::VarInfoKind kind;
-      if (!IsInternalIdentifier(name)) {
+      if (!IsFilteredIdentifier(name)) {
         kind = RawLocalVarDescriptors::kContextVar;
-      } else if (name.raw() == Symbols::AsyncOperation().raw()) {
-        kind = RawLocalVarDescriptors::kAsyncOperation;
       } else {
         continue;
       }
@@ -319,7 +321,18 @@
   for (int i = 0; i < this->variables_.length(); i++) {
     LocalVariable* var = variables_[i];
     if ((var->owner() == this) && !var->is_invisible()) {
-      if (!IsInternalIdentifier(var->name())) {
+      if (var->name().raw() == Symbols::CurrentContextVar().raw()) {
+        // This is the local variable in which the function saves its
+        // own context before calling a closure function.
+        VarDesc desc;
+        desc.name = &var->name();
+        desc.info.set_kind(RawLocalVarDescriptors::kSavedCurrentContext);
+        desc.info.scope_id = 0;
+        desc.info.begin_pos = 0;
+        desc.info.end_pos = 0;
+        desc.info.set_index(var->index());
+        vars->Add(desc);
+      } else if (!IsFilteredIdentifier(var->name())) {
         // This is a regular Dart variable, either stack-based or captured.
         VarDesc desc;
         desc.name = &var->name();
@@ -336,34 +349,6 @@
         desc.info.end_pos = var->owner()->end_token_pos();
         desc.info.set_index(var->index());
         vars->Add(desc);
-      } else if (var->name().raw() == Symbols::CurrentContextVar().raw()) {
-        // This is the local variable in which the function saves its
-        // own context before calling a closure function.
-        VarDesc desc;
-        desc.name = &var->name();
-        desc.info.set_kind(RawLocalVarDescriptors::kSavedCurrentContext);
-        desc.info.scope_id = 0;
-        desc.info.begin_pos = 0;
-        desc.info.end_pos = 0;
-        desc.info.set_index(var->index());
-        vars->Add(desc);
-      } else if (var->name().raw() == Symbols::AsyncOperation().raw()) {
-        // The async continuation.
-        ASSERT(var->is_captured());
-        VarDesc desc;
-        desc.name = &var->name();
-        desc.info.set_kind(RawLocalVarDescriptors::kAsyncOperation);
-        if (var->is_captured()) {
-          ASSERT(var->owner() != NULL);
-          ASSERT(var->owner()->context_level() >= 0);
-          desc.info.scope_id = var->owner()->context_level();
-        } else {
-          desc.info.scope_id = *scope_id;
-        }
-        desc.info.begin_pos = 0;
-        desc.info.end_pos = 0;
-        desc.info.set_index(var->index());
-        vars->Add(desc);
       }
     }
   }
@@ -404,18 +389,10 @@
   LocalScope* current_scope = this;
   while (current_scope != NULL) {
     LocalVariable* var = current_scope->LocalLookupVariable(name);
-    if ((var != NULL) && !var->is_invisible_) {
-      if (!test_only) {
-        if (var->owner()->function_level() != function_level()) {
-          var->set_is_captured();
-        }
-        // Insert aliases of the variable in intermediate scopes.
-        LocalScope* intermediate_scope = this;
-        while (intermediate_scope != current_scope) {
-          intermediate_scope->variables_.Add(var);
-          ASSERT(var->owner() != intermediate_scope);  // Item is an alias.
-          intermediate_scope = intermediate_scope->parent();
-        }
+    // If testing only, return the variable even if invisible.
+    if ((var != NULL) && (!var->is_invisible_ || test_only)) {
+      if (!test_only && (var->owner()->function_level() != function_level())) {
+        CaptureVariable(var);
       }
       return var;
     }
@@ -425,27 +402,29 @@
 }
 
 
-bool LocalScope::CaptureVariable(const String& name) {
-  ASSERT(name.IsSymbol());
-  LocalScope* current_scope = this;
-  while (current_scope != NULL) {
-    LocalVariable* var = current_scope->LocalLookupVariable(name);
-    if (var != NULL) {
-      if (var->owner()->function_level() != function_level()) {
-        var->set_is_captured();
-      }
-      // Insert aliases of the variable in intermediate scopes.
-      LocalScope* intermediate_scope = this;
-      while (intermediate_scope != current_scope) {
-        intermediate_scope->variables_.Add(var);
-        ASSERT(var->owner() != intermediate_scope);  // Item is an alias.
-        intermediate_scope = intermediate_scope->parent();
-      }
-      return true;
+void LocalScope::CaptureVariable(LocalVariable* variable) {
+  ASSERT(variable != NULL);
+  // The variable must exist in an enclosing scope, not necessarily in this one.
+  variable->set_is_captured();
+  const int variable_function_level = variable->owner()->function_level();
+  LocalScope* scope = this;
+  while (scope->function_level() != variable_function_level) {
+    // Insert an alias of the variable in the top scope of each function
+    // level so that the variable is found in the context.
+    LocalScope* parent_scope = scope->parent();
+    while ((parent_scope != NULL) &&
+           (parent_scope->function_level() == scope->function_level())) {
+      scope = parent_scope;
+      parent_scope = scope->parent();
     }
-    current_scope = current_scope->parent();
+    // An alias may already have been added in this scope, and in that case,
+    // in parent scopes as needed. If so, we are done.
+    if (!scope->AddVariable(variable)) {
+      return;
+    }
+    ASSERT(variable->owner() != scope);  // Item is an alias.
+    scope = parent_scope;
   }
-  return false;
 }
 
 
@@ -520,9 +499,10 @@
 
 int LocalScope::NumCapturedVariables() const {
   // It is not necessary to traverse parent scopes, since we are only interested
-  // in the captured variables referenced in this scope. If this scope
-  // references a captured variable declared in a parent scope, it will contain
-  // an alias for that variable.
+  // in the captured variables referenced in this scope. If this scope is the
+  // top scope at function level 1 and it (or its children scopes) references a
+  // captured variable declared in a parent scope at function level 0, it will
+  // contain an alias for that variable.
 
   // Since code generation for nested functions is postponed until first
   // invocation, the function level of the closure scope can only be 1.
@@ -553,7 +533,7 @@
 
   // Create a ContextScope with space for num_captured_vars descriptors.
   const ContextScope& context_scope =
-      ContextScope::Handle(ContextScope::New(num_captured_vars));
+      ContextScope::Handle(ContextScope::New(num_captured_vars, false));
 
   // Create a descriptor for each referenced captured variable of enclosing
   // functions to preserve its name and its context allocation information.
@@ -622,24 +602,23 @@
 }
 
 
-void LocalScope::RecursivelyCaptureAllVariables() {
-  bool found = false;
-  for (intptr_t i = 0; i < num_variables(); i++) {
-    if ((VariableAt(i)->name().raw() == Symbols::StackTraceVar().raw()) ||
-        (VariableAt(i)->name().raw() == Symbols::ExceptionVar().raw()) ||
-        (VariableAt(i)->name().raw() == Symbols::SavedTryContextVar().raw())) {
-      // Don't capture those variables because the VM expects them to be on the
-      // stack.
-      continue;
+void LocalScope::CaptureLocalVariables(LocalScope* top_scope) {
+  ASSERT(top_scope->function_level() == function_level());
+  LocalScope* scope = this;
+  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()) ||
+          (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
+        // the stack.
+        continue;
+      }
+      scope->CaptureVariable(variable);
     }
-    found = CaptureVariable(VariableAt(i)->name());
-    // Also manually set the variable as captured as CaptureVariable() does not
-    // handle capturing variables on the same scope level.
-    VariableAt(i)->set_is_captured();
-    ASSERT(found);
+    scope = scope->parent();
   }
-  if (sibling() != NULL) { sibling()->RecursivelyCaptureAllVariables(); }
-  if (child() != NULL) { child()->RecursivelyCaptureAllVariables(); }
 }
 
 
@@ -648,7 +627,7 @@
 
   // Create a ContextScope with space for kNumCapturedVars descriptors.
   const ContextScope& context_scope =
-      ContextScope::Handle(ContextScope::New(kNumCapturedVars));
+      ContextScope::Handle(ContextScope::New(kNumCapturedVars, true));
 
   // Create a descriptor for 'this' variable.
   context_scope.SetTokenIndexAt(0, func.token_pos());
diff --git a/runtime/vm/scopes.h b/runtime/vm/scopes.h
index bc6d263..5faf502 100644
--- a/runtime/vm/scopes.h
+++ b/runtime/vm/scopes.h
@@ -279,10 +279,8 @@
   // Returns NULL if this scope is not embedded in a switch.
   LocalScope* LookupSwitchScope();
 
-  // Looks up variable in this scope and mark as captured if applicable.
-  // Finds the variable even if it is marked invisible. Returns true if
-  // the variable was found, false if it was not found.
-  bool CaptureVariable(const String& name);
+  // Mark this variable as captured by this scope.
+  void CaptureVariable(LocalVariable* variable);
 
   // Look for unresolved forward references to labels in this scope.
   // If there are any, propagate the forward reference to the next
@@ -329,10 +327,9 @@
   // from this scope and belonging to outer scopes.
   RawContextScope* PreserveOuterScope(int current_context_level) const;
 
-
-  // Recursively traverses all siblings and children and marks all variables as
-  // captured.
-  void RecursivelyCaptureAllVariables();
+  // Mark all local variables that are accessible from this scope up to
+  // top_scope (included) as captured.
+  void CaptureLocalVariables(LocalScope* top_scope);
 
   // Creates a LocalScope representing the outer scope of a local function to be
   // compiled. This outer scope contains the variables captured by the function
diff --git a/runtime/vm/service.cc b/runtime/vm/service.cc
index 89cf1fa..450aadc 100644
--- a/runtime/vm/service.cc
+++ b/runtime/vm/service.cc
@@ -37,8 +37,26 @@
 
 namespace dart {
 
+#define Z (T->zone())
+
+
 DECLARE_FLAG(bool, trace_service);
 DECLARE_FLAG(bool, trace_service_pause_events);
+DEFINE_FLAG(charp, vm_name, "vm",
+            "The default name of this vm as reported by the VM service "
+            "protocol");
+
+// The name of this of this vm as reported by the VM service protocol.
+static char* vm_name = NULL;
+
+
+static const char* GetVMName() {
+  if (vm_name == NULL) {
+    return FLAG_vm_name;
+  }
+  return vm_name;
+}
+
 
 ServiceIdZone::ServiceIdZone() {
 }
@@ -48,11 +66,9 @@
 }
 
 
-RingServiceIdZone::RingServiceIdZone(
-    ObjectIdRing* ring, ObjectIdRing::IdPolicy policy)
-        : ring_(ring),
-          policy_(policy) {
-  ASSERT(ring_ != NULL);
+RingServiceIdZone::RingServiceIdZone()
+    : ring_(NULL),
+      policy_(ObjectIdRing::kAllocateId) {
 }
 
 
@@ -60,7 +76,15 @@
 }
 
 
+void RingServiceIdZone::Init(
+    ObjectIdRing* ring, ObjectIdRing::IdPolicy policy) {
+  ring_ = ring;
+  policy_ = policy;
+}
+
+
 char* RingServiceIdZone::GetServiceId(const Object& obj) {
+  ASSERT(ring_ != NULL);
   Thread* thread = Thread::Current();
   Zone* zone = thread->zone();
   ASSERT(zone != NULL);
@@ -82,6 +106,7 @@
 
 
 // These are the set of streams known to the core VM.
+StreamInfo Service::vm_stream("VM");
 StreamInfo Service::isolate_stream("Isolate");
 StreamInfo Service::debug_stream("Debug");
 StreamInfo Service::gc_stream("GC");
@@ -90,6 +115,7 @@
 StreamInfo Service::logging_stream("_Logging");
 
 static StreamInfo* streams_[] = {
+  &Service::vm_stream,
   &Service::isolate_stream,
   &Service::debug_stream,
   &Service::gc_stream,
@@ -499,20 +525,41 @@
 }
 
 
-void Service::InvokeMethod(Isolate* isolate, const Array& msg) {
-  ASSERT(isolate != NULL);
+void Service::PostError(const String& method_name,
+                        const Array& parameter_keys,
+                        const Array& parameter_values,
+                        const Instance& reply_port,
+                        const Instance& id,
+                        const Error& error) {
+  Thread* T = Thread::Current();
+  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.PostReply();
+}
+
+
+void Service::InvokeMethod(Isolate* I, const Array& msg) {
+  Thread* T = Thread::Current();
+  ASSERT(I == T->isolate());
+  ASSERT(I != NULL);
   ASSERT(!msg.IsNull());
   ASSERT(msg.Length() == 6);
 
   {
-    StackZone zone(isolate);
-    HANDLESCOPE(isolate);
+    StackZone zone(T);
+    HANDLESCOPE(T);
 
-    Instance& reply_port = Instance::Handle(isolate);
-    Instance& seq = String::Handle(isolate);
-    String& method_name = String::Handle(isolate);
-    Array& param_keys = Array::Handle(isolate);
-    Array& param_values = Array::Handle(isolate);
+    Instance& reply_port = Instance::Handle(Z);
+    Instance& seq = String::Handle(Z);
+    String& method_name = String::Handle(Z);
+    Array& param_keys = Array::Handle(Z);
+    Array& param_values = Array::Handle(Z);
     reply_port ^= msg.At(1);
     seq ^= msg.At(2);
     method_name ^= msg.At(3);
@@ -564,7 +611,7 @@
         js.PostReply();
         return;
       }
-      if (method->entry(isolate, &js)) {
+      if (method->entry(I, &js)) {
         js.PostReply();
       } else {
         // NOTE(turnidge): All message handlers currently return true,
@@ -585,6 +632,20 @@
       return;
     }
 
+    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);
+      // Schedule was successful. Extension code will post a reply
+      // asynchronously.
+      return;
+    }
+
     PrintUnrecognizedMethodError(&js);
     js.PostReply();
     return;
@@ -607,13 +668,14 @@
 void Service::SendEvent(const char* stream_id,
                         const char* event_type,
                         const Object& event_message) {
-  ASSERT(!ServiceIsolate::IsServiceIsolateDescendant(Isolate::Current()));
+  Thread* thread = Thread::Current();
+  Isolate* isolate = thread->isolate();
+  ASSERT(isolate != NULL);
+  ASSERT(!ServiceIsolate::IsServiceIsolateDescendant(isolate));
   if (!ServiceIsolate::IsRunning()) {
     return;
   }
-  Isolate* isolate = Isolate::Current();
-  ASSERT(isolate != NULL);
-  HANDLESCOPE(isolate);
+  HANDLESCOPE(thread);
 
   const Array& list = Array::Handle(Array::New(2));
   ASSERT(!list.IsNull());
@@ -627,9 +689,9 @@
   writer.WriteMessage(list);
   intptr_t len = writer.BytesWritten();
   if (FLAG_trace_service) {
-    OS::Print(
-        "vm-service: Pushing event of type %s to stream %s, len %" Pd "\n",
-        event_type, stream_id, len);
+    OS::Print("vm-service: Pushing ServiceEvent(isolate='%s', kind='%s',"
+              " len=%" Pd ") to stream %s\n",
+              isolate->name(), event_type, len, stream_id);
   }
   // TODO(turnidge): For now we ignore failure to send an event.  Revisit?
   PortMap::PostMessage(
@@ -670,7 +732,8 @@
 
 
 void Service::HandleEvent(ServiceEvent* event) {
-  if (ServiceIsolate::IsServiceIsolateDescendant(event->isolate())) {
+  if (event->isolate() != NULL &&
+      ServiceIsolate::IsServiceIsolateDescendant(event->isolate())) {
     return;
   }
   if (!ServiceIsolate::IsRunning()) {
@@ -720,8 +783,14 @@
   list_values[1] = &json_cobj;
 
   if (FLAG_trace_service) {
-    OS::Print(
-        "vm-service: Pushing event of type %s to stream %s\n", kind, stream_id);
+    Isolate* isolate = Isolate::Current();
+    const char* isolate_name = "<no current isolate>";
+    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);
   }
 
   Dart_PostCObject(ServiceIsolate::Port(), &list_cobj);
@@ -869,6 +938,28 @@
 }
 
 
+void Service::ScheduleExtensionHandler(const Instance& handler,
+                                       const String& method_name,
+                                       const Array& parameter_keys,
+                                       const Array& parameter_values,
+                                       const Instance& reply_port,
+                                       const Instance& id) {
+  ASSERT(!handler.IsNull());
+  ASSERT(!method_name.IsNull());
+  ASSERT(!parameter_keys.IsNull());
+  ASSERT(!parameter_values.IsNull());
+  ASSERT(!reply_port.IsNull());
+  Isolate* isolate = Isolate::Current();
+  ASSERT(isolate != NULL);
+  isolate->AppendServiceExtensionCall(handler,
+                                      method_name,
+                                      parameter_keys,
+                                      parameter_values,
+                                      reply_port,
+                                      id);
+}
+
+
 static const MethodParameter* get_isolate_params[] = {
   ISOLATE_PARAMETER,
   NULL,
@@ -943,6 +1034,7 @@
         if (text != NULL) {
           event.AddProperty("text", text);
         }
+        event.AddPropertyTimeMillis("timestamp", OS::GetCurrentTimeMillis());
       }
     }
   }
@@ -968,7 +1060,8 @@
   ObjectIdRing* ring = isolate->object_id_ring();
   ASSERT(ring != NULL);
   // When printing the ObjectIdRing, force object id reuse policy.
-  RingServiceIdZone reuse_zone(ring, ObjectIdRing::kReuseId);
+  RingServiceIdZone reuse_zone;
+  reuse_zone.Init(ring, ObjectIdRing::kReuseId);
   js->set_id_zone(&reuse_zone);
   ring->PrintJSON(js);
   return true;
@@ -1020,8 +1113,8 @@
       *kind = ObjectIdRing::kInvalid;
       return Object::null();
     }
-    const Integer& obj =
-        Integer::Handle(isolate, Smi::New(static_cast<intptr_t>(value)));
+    const Integer& obj = Integer::Handle(isolate->current_zone(),
+        Smi::New(static_cast<intptr_t>(value)));
     return obj.raw();
   } else if (strcmp(arg, "bool-true") == 0) {
     return Bool::True().raw();
@@ -1145,7 +1238,8 @@
       return Object::sentinel().raw();
     }
     const char* encoded_id = parts[3];
-    String& id = String::Handle(isolate, String::New(encoded_id));
+    String& id = String::Handle(isolate->current_zone(),
+        String::New(encoded_id));
     id = String::DecodeIRI(id);
     if (id.IsNull()) {
       return Object::sentinel().raw();
@@ -1279,6 +1373,29 @@
 }
 
 
+static RawObject* LookupHeapObjectMessage(Isolate* isolate,
+                                          char** parts, int num_parts) {
+  if (num_parts != 2) {
+    return Object::sentinel().raw();
+  }
+  uword message_id = 0;
+  if (!GetUnsignedIntegerId(parts[1], &message_id, 16)) {
+    return Object::sentinel().raw();
+  }
+  MessageHandler::AcquiredQueues aq;
+  isolate->message_handler()->AcquireQueues(&aq);
+  Message* message = aq.queue()->FindMessageById(message_id);
+  if (message == NULL) {
+    // The user may try to load an expired message.
+    return Object::sentinel().raw();
+  }
+  MessageSnapshotReader reader(message->data(),
+                               message->len(),
+                               Thread::Current());
+  return reader.ReadObject();
+}
+
+
 static RawObject* LookupHeapObject(Isolate* isolate,
                                    const char* id_original,
                                    ObjectIdRing::LookupResult* result) {
@@ -1312,7 +1429,7 @@
 
   if (strcmp(parts[0], "objects") == 0) {
     // Object ids look like "objects/1123"
-    Object& obj = Object::Handle(isolate);
+    Object& obj = Object::Handle(isolate->current_zone());
     ObjectIdRing::LookupResult lookup_result;
     obj = LookupObjectId(isolate, parts[1], &lookup_result);
     if (lookup_result != ObjectIdRing::kValid) {
@@ -1331,6 +1448,8 @@
     return LookupHeapObjectTypeArguments(isolate, parts, num_parts);
   } else if (strcmp(parts[0], "code") == 0) {
     return LookupHeapObjectCode(isolate, parts, num_parts);
+  } else if (strcmp(parts[0], "messages") == 0) {
+    return LookupHeapObjectMessage(isolate, parts, num_parts);
   }
 
   // Not found.
@@ -1368,7 +1487,10 @@
 }
 
 
-static Breakpoint* LookupBreakpoint(Isolate* isolate, const char* id) {
+static Breakpoint* LookupBreakpoint(Isolate* isolate,
+                                    const char* id,
+                                    ObjectIdRing::LookupResult* result) {
+  *result = ObjectIdRing::kInvalid;
   size_t end_pos = strcspn(id, "/");
   if (end_pos == strlen(id)) {
     return NULL;
@@ -1379,47 +1501,20 @@
     Breakpoint* bpt = NULL;
     if (GetIntegerId(rest, &bpt_id)) {
       bpt = isolate->debugger()->GetBreakpointById(bpt_id);
+      if (bpt) {
+        *result = ObjectIdRing::kValid;
+        return bpt;
+      }
+      if (bpt_id < isolate->debugger()->limitBreakpointId()) {
+        *result = ObjectIdRing::kCollected;
+        return NULL;
+      }
     }
-    return bpt;
   }
   return NULL;
 }
 
 
-// Scans |isolate|'s message queue looking for a message with |id|.
-// If found, the message is printed to |js| and true is returned.
-// If not found, false is returned.
-static bool PrintMessage(JSONStream* js, Isolate* isolate, const char* id) {
-  size_t end_pos = strcspn(id, "/");
-  if (end_pos == strlen(id)) {
-    return false;
-  }
-  const char* rest = id + end_pos + 1;  // +1 for '/'.
-  if (strncmp("messages", id, end_pos) == 0) {
-    uword message_id = 0;
-    if (GetUnsignedIntegerId(rest, &message_id, 16)) {
-      MessageHandler::AcquiredQueues aq;
-      isolate->message_handler()->AcquireQueues(&aq);
-      Message* message = aq.queue()->FindMessageById(message_id);
-      if (message == NULL) {
-        // The user may try to load an expired message, so we treat
-        // unrecognized ids as if they are expired.
-        PrintSentinel(js, kExpiredSentinel);
-        return true;
-      }
-      MessageSnapshotReader reader(message->data(),
-                                   message->len(),
-                                   isolate,
-                                   Thread::Current()->zone());
-      const Object& msg_obj = Object::Handle(reader.ReadObject());
-      msg_obj.PrintJSON(js);
-      return true;
-    }
-  }
-  return false;
-}
-
-
 static bool PrintInboundReferences(Isolate* isolate,
                                    Object* target,
                                    intptr_t limit,
@@ -1443,19 +1538,21 @@
       slot_offset ^= path.At((i * 2) + 1);
 
       jselement.AddProperty("source", source);
-      jselement.AddProperty("slot", "<unknown>");
       if (source.IsArray()) {
         intptr_t element_index = slot_offset.Value() -
             (Array::element_offset(0) >> kWordSizeLog2);
-        jselement.AddProperty("slot", element_index);
+        jselement.AddProperty("parentListIndex", element_index);
       } else if (source.IsInstance()) {
         source_class ^= source.clazz();
         parent_field_map = source_class.OffsetToFieldMap();
         intptr_t offset = slot_offset.Value();
         if (offset > 0 && offset < parent_field_map.Length()) {
           field ^= parent_field_map.At(offset);
-          jselement.AddProperty("slot", field);
+          jselement.AddProperty("parentField", field);
         }
+      } else {
+        intptr_t element_index = slot_offset.Value();
+        jselement.AddProperty("_parentWordOffset", element_index);
       }
 
       // We nil out the array after generating the response to prevent
@@ -1475,6 +1572,9 @@
 
 
 static bool GetInboundReferences(Isolate* isolate, JSONStream* js) {
+  Thread* thread = Thread::Current();
+  ASSERT(isolate == thread->isolate());
+
   const char* target_id = js->LookupParam("targetId");
   if (target_id == NULL) {
     PrintMissingParamError(js, "targetId");
@@ -1491,10 +1591,10 @@
     return true;
   }
 
-  Object& obj = Object::Handle(isolate);
+  Object& obj = Object::Handle(thread->zone());
   ObjectIdRing::LookupResult lookup_result;
   {
-    HANDLESCOPE(isolate);
+    HANDLESCOPE(thread);
     obj = LookupHeapObject(isolate, target_id, &lookup_result);
   }
   if (obj.raw() == Object::sentinel().raw()) {
@@ -1574,6 +1674,9 @@
 
 
 static bool GetRetainingPath(Isolate* isolate, JSONStream* js) {
+  Thread* thread = Thread::Current();
+  ASSERT(isolate == thread->isolate());
+
   const char* target_id = js->LookupParam("targetId");
   if (target_id == NULL) {
     PrintMissingParamError(js, "targetId");
@@ -1590,10 +1693,10 @@
     return true;
   }
 
-  Object& obj = Object::Handle(isolate);
+  Object& obj = Object::Handle(thread->zone());
   ObjectIdRing::LookupResult lookup_result;
   {
-    HANDLESCOPE(isolate);
+    HANDLESCOPE(thread);
     obj = LookupHeapObject(isolate, target_id, &lookup_result);
   }
   if (obj.raw() == Object::sentinel().raw()) {
@@ -1661,6 +1764,11 @@
 
 
 static bool Evaluate(Isolate* isolate, JSONStream* js) {
+  if (!isolate->compilation_allowed()) {
+    js->PrintError(kFeatureDisabled,
+                   "Cannot evaluate when running a precompiled program.");
+    return true;
+  }
   const char* target_id = js->LookupParam("targetId");
   if (target_id == NULL) {
     PrintMissingParamError(js, "targetId");
@@ -1671,7 +1779,8 @@
     PrintMissingParamError(js, "expression");
     return true;
   }
-  const String& expr_str = String::Handle(isolate, String::New(expr));
+  const String& expr_str =
+      String::Handle(isolate->current_zone(), String::New(expr));
   ObjectIdRing::LookupResult lookup_result;
   Object& obj = Object::Handle(LookupHeapObject(isolate, target_id,
                                                 &lookup_result));
@@ -1704,7 +1813,7 @@
   if ((obj.IsInstance() || obj.IsNull()) &&
       !ContainsNonInstance(obj)) {
     // We don't use Instance::Cast here because it doesn't allow null.
-    Instance& instance = Instance::Handle(isolate);
+    Instance& instance = Instance::Handle(isolate->current_zone());
     instance ^= obj.raw();
     const Object& result =
         Object::Handle(instance.Evaluate(expr_str,
@@ -1730,6 +1839,11 @@
 
 
 static bool EvaluateInFrame(Isolate* isolate, JSONStream* js) {
+  if (!isolate->compilation_allowed()) {
+    js->PrintError(kFeatureDisabled,
+                   "Cannot evaluate when running a precompiled program.");
+    return true;
+  }
   DebuggerStackTrace* stack = isolate->debugger()->StackTrace();
   intptr_t framePos = UIntParameter::Parse(js->LookupParam("frameIndex"));
   if (framePos > stack->Length()) {
@@ -1739,7 +1853,8 @@
   ActivationFrame* frame = stack->FrameAt(framePos);
 
   const char* expr = js->LookupParam("expression");
-  const String& expr_str = String::Handle(isolate, String::New(expr));
+  const String& expr_str = String::Handle(isolate->current_zone(),
+      String::New(expr));
 
   const Object& result = Object::Handle(frame->Evaluate(expr_str));
   result.PrintJSON(js, true);
@@ -1757,9 +1872,9 @@
     if (raw_obj->IsFreeListElement()) {
       return kProceed;
     }
-    Isolate* isolate = Isolate::Current();
-    REUSABLE_OBJECT_HANDLESCOPE(isolate);
-    Object& obj = isolate->ObjectHandle();
+    Thread* thread = Thread::Current();
+    REUSABLE_OBJECT_HANDLESCOPE(thread);
+    Object& obj = thread->ObjectHandle();
     obj = raw_obj;
     if (obj.GetClassId() == cls_.id()) {
       if (!storage_.IsNull() && count_ < storage_.Length()) {
@@ -1828,7 +1943,7 @@
     JSONArray samples(&jsobj, "samples");
     for (int i = 0; i < storage.Length(); i++) {
       const Object& sample = Object::Handle(storage.At(i));
-      samples.AddValue(Instance::Cast(sample));
+      samples.AddValue(sample);
     }
   }
   return true;
@@ -1893,8 +2008,9 @@
 
 
 static bool GetHitsOrSites(Isolate* isolate, JSONStream* js, bool as_sites) {
+  Thread* thread = Thread::Current();
   if (!js->HasParam("targetId")) {
-    CodeCoverage::PrintJSON(isolate, js, NULL, as_sites);
+    CodeCoverage::PrintJSON(thread, js, NULL, as_sites);
     return true;
   }
   const char* target_id = js->LookupParam("targetId");
@@ -1905,22 +2021,22 @@
   }
   if (obj.IsScript()) {
     ScriptCoverageFilter sf(Script::Cast(obj));
-    CodeCoverage::PrintJSON(isolate, js, &sf, as_sites);
+    CodeCoverage::PrintJSON(thread, js, &sf, as_sites);
     return true;
   }
   if (obj.IsLibrary()) {
     LibraryCoverageFilter lf(Library::Cast(obj));
-    CodeCoverage::PrintJSON(isolate, js, &lf, as_sites);
+    CodeCoverage::PrintJSON(thread, js, &lf, as_sites);
     return true;
   }
   if (obj.IsClass()) {
     ClassCoverageFilter cf(Class::Cast(obj));
-    CodeCoverage::PrintJSON(isolate, js, &cf, as_sites);
+    CodeCoverage::PrintJSON(thread, js, &cf, as_sites);
     return true;
   }
   if (obj.IsFunction()) {
     FunctionCoverageFilter ff(Function::Cast(obj));
-    CodeCoverage::PrintJSON(isolate, js, &ff, as_sites);
+    CodeCoverage::PrintJSON(thread, js, &ff, as_sites);
     return true;
   }
   js->PrintError(kInvalidParams,
@@ -1957,27 +2073,24 @@
 }
 
 
-static const MethodParameter* add_breakpoint_params[] = {
-  ISOLATE_PARAMETER,
-  new IdParameter("scriptId", true),
-  new UIntParameter("line", true),
-  NULL,
-};
-
-
-static bool AddBreakpoint(Isolate* isolate, JSONStream* js) {
+static bool AddBreakpointCommon(Isolate* isolate,
+                                JSONStream* js,
+                                const String& script_uri) {
   const char* line_param = js->LookupParam("line");
   intptr_t line = UIntParameter::Parse(line_param);
-  const char* script_id = js->LookupParam("scriptId");
-  Object& obj = Object::Handle(LookupHeapObject(isolate, script_id, NULL));
-  if (obj.raw() == Object::sentinel().raw() || !obj.IsScript()) {
-    PrintInvalidParamError(js, "scriptId");
-    return true;
+  const char* col_param = js->LookupParam("column");
+  intptr_t col = -1;
+  if (col_param != NULL) {
+    col = UIntParameter::Parse(col_param);
+    if (col == 0) {
+      // Column number is 1-based.
+      PrintInvalidParamError(js, "column");
+      return true;
+    }
   }
-  const Script& script = Script::Cast(obj);
-  const String& script_url = String::Handle(script.url());
-  Breakpoint* bpt =
-      isolate->debugger()->SetBreakpointAtLine(script_url, line);
+  ASSERT(!script_uri.IsNull());
+  Breakpoint* bpt = NULL;
+  bpt = isolate->debugger()->SetBreakpointAtLineCol(script_uri, line, col);
   if (bpt == NULL) {
     js->PrintError(kCannotAddBreakpoint,
                    "%s: Cannot add breakpoint at line '%s'",
@@ -1989,6 +2102,46 @@
 }
 
 
+static const MethodParameter* add_breakpoint_params[] = {
+  ISOLATE_PARAMETER,
+  new IdParameter("scriptId", true),
+  new UIntParameter("line", true),
+  new UIntParameter("column", false),
+  NULL,
+};
+
+
+static bool AddBreakpoint(Isolate* isolate, JSONStream* js) {
+  const char* script_id_param = js->LookupParam("scriptId");
+  Object& obj =
+      Object::Handle(LookupHeapObject(isolate, script_id_param, NULL));
+  if (obj.raw() == Object::sentinel().raw() || !obj.IsScript()) {
+    PrintInvalidParamError(js, "scriptId");
+    return true;
+  }
+  const Script& script = Script::Cast(obj);
+  const String& script_uri = String::Handle(script.url());
+  ASSERT(!script_uri.IsNull());
+  return AddBreakpointCommon(isolate, js, script_uri);
+}
+
+
+static const MethodParameter* add_breakpoint_with_script_uri_params[] = {
+  ISOLATE_PARAMETER,
+  new IdParameter("scriptUri", true),
+  new UIntParameter("line", true),
+  new UIntParameter("column", false),
+  NULL,
+};
+
+
+static bool AddBreakpointWithScriptUri(Isolate* isolate, JSONStream* js) {
+  const char* script_uri_param = js->LookupParam("scriptUri");
+  const String& script_uri = String::Handle(String::New(script_uri_param));
+  return AddBreakpointCommon(isolate, js, script_uri);
+}
+
+
 static const MethodParameter* add_breakpoint_at_entry_params[] = {
   ISOLATE_PARAMETER,
   new IdParameter("functionId", true),
@@ -2057,7 +2210,10 @@
     return true;
   }
   const char* bpt_id = js->LookupParam("breakpointId");
-  Breakpoint* bpt = LookupBreakpoint(isolate, bpt_id);
+  ObjectIdRing::LookupResult lookup_result;
+  Breakpoint* bpt = LookupBreakpoint(isolate, bpt_id, &lookup_result);
+  // TODO(turnidge): Should we return a different error for bpts whic
+  // have been already removed?
   if (bpt == NULL) {
     PrintInvalidParamError(js, "breakpointId");
     return true;
@@ -2069,14 +2225,15 @@
 
 
 static RawClass* GetMetricsClass(Isolate* isolate) {
+  Zone* zone = isolate->current_zone();
   const Library& prof_lib =
-      Library::Handle(isolate, Library::DeveloperLibrary());
+      Library::Handle(zone, Library::DeveloperLibrary());
   ASSERT(!prof_lib.IsNull());
   const String& metrics_cls_name =
-      String::Handle(isolate, String::New("Metrics"));
+      String::Handle(zone, String::New("Metrics"));
   ASSERT(!metrics_cls_name.IsNull());
   const Class& metrics_cls =
-      Class::Handle(isolate, prof_lib.LookupClass(metrics_cls_name));
+      Class::Handle(zone, prof_lib.LookupClass(metrics_cls_name));
   ASSERT(!metrics_cls.IsNull());
   return metrics_cls.raw();
 }
@@ -2117,17 +2274,18 @@
 
 
 static bool HandleDartMetricsList(Isolate* isolate, JSONStream* js) {
-  const Class& metrics_cls = Class::Handle(isolate, GetMetricsClass(isolate));
+  Zone* zone = isolate->current_zone();
+  const Class& metrics_cls = Class::Handle(zone, GetMetricsClass(isolate));
   const String& print_metrics_name =
       String::Handle(String::New("_printMetrics"));
   ASSERT(!print_metrics_name.IsNull());
   const Function& print_metrics = Function::Handle(
-      isolate,
+      zone,
       metrics_cls.LookupStaticFunctionAllowPrivate(print_metrics_name));
   ASSERT(!print_metrics.IsNull());
   const Array& args = Object::empty_array();
   const Object& result =
-      Object::Handle(isolate, DartEntry::InvokeFunction(print_metrics, args));
+      Object::Handle(zone, DartEntry::InvokeFunction(print_metrics, args));
   ASSERT(!result.IsNull());
   ASSERT(result.IsString());
   TextBuffer* buffer = js->buffer();
@@ -2137,12 +2295,13 @@
 
 
 static bool HandleDartMetric(Isolate* isolate, JSONStream* js, const char* id) {
-  const Class& metrics_cls = Class::Handle(isolate, GetMetricsClass(isolate));
+  Zone* zone = isolate->current_zone();
+  const Class& metrics_cls = Class::Handle(zone, GetMetricsClass(isolate));
   const String& print_metric_name =
       String::Handle(String::New("_printMetric"));
   ASSERT(!print_metric_name.IsNull());
   const Function& print_metric = Function::Handle(
-      isolate,
+      zone,
       metrics_cls.LookupStaticFunctionAllowPrivate(print_metric_name));
   ASSERT(!print_metric.IsNull());
   const String& arg0 = String::Handle(String::New(id));
@@ -2151,7 +2310,7 @@
   ASSERT(!args.IsNull());
   args.SetAt(0, arg0);
   const Object& result =
-      Object::Handle(isolate, DartEntry::InvokeFunction(print_metric, args));
+      Object::Handle(zone, DartEntry::InvokeFunction(print_metric, args));
   if (!result.IsNull()) {
     ASSERT(result.IsString());
     TextBuffer* buffer = js->buffer();
@@ -2265,6 +2424,7 @@
       isolate->debugger()->EnterSingleStepMode();
     }
     isolate->message_handler()->set_pause_on_start(false);
+    isolate->set_last_resume_timestamp();
     if (Service::debug_stream.enabled()) {
       ServiceEvent event(isolate, ServiceEvent::kResume);
       Service::HandleEvent(&event);
@@ -2308,8 +2468,12 @@
 
 
 static bool Pause(Isolate* isolate, JSONStream* js) {
-  // TODO(turnidge): Don't double-interrupt the isolate here.
-  isolate->ScheduleInterrupts(Isolate::kApiInterrupt);
+  // TODO(turnidge): This interrupt message could have been sent from
+  // the service isolate directly, but would require some special case
+  // code.  That would prevent this isolate getting double-interrupted
+  // with OOB messages.
+  isolate->SendInternalLibMessage(Isolate::kInterruptMsg,
+                                  isolate->pause_capability());
   PrintSuccess(js);
   return true;
 }
@@ -2499,6 +2663,7 @@
           event.AddProperty("type", "Event");
           event.AddProperty("kind", "_Graph");
           event.AddProperty("isolate", isolate);
+          event.AddPropertyTimeMillis("timestamp", OS::GetCurrentTimeMillis());
 
           event.AddProperty("chunkIndex", i);
           event.AddProperty("chunkCount", num_chunks);
@@ -2599,7 +2764,7 @@
 
 
 static RawObject* GetObjectHelper(Isolate* isolate, uword addr) {
-  Object& object = Object::Handle(isolate);
+  Object& object = Object::Handle(isolate->current_zone());
 
   {
     NoSafepointScope no_safepoint;
@@ -2635,7 +2800,8 @@
     return true;
   }
   bool ref = js->HasParam("ref") && js->ParamIs("ref", "true");
-  const Object& obj = Object::Handle(isolate, GetObjectHelper(isolate, addr));
+  const Object& obj = Object::Handle(isolate->current_zone(),
+      GetObjectHelper(isolate, addr));
   if (obj.IsNull()) {
     PrintSentinel(js, kFreeSentinel);
   } else {
@@ -2710,13 +2876,12 @@
   }
 
   // Handle non-heap objects.
-  Breakpoint* bpt = LookupBreakpoint(isolate, id);
+  Breakpoint* bpt = LookupBreakpoint(isolate, id, &lookup_result);
   if (bpt != NULL) {
     bpt->PrintJSON(js);
     return true;
-  }
-
-  if (PrintMessage(js, isolate, id)) {
+  } else if (lookup_result == ObjectIdRing::kCollected) {
+    PrintSentinel(js, kCollectedSentinel);
     return true;
   }
 
@@ -2782,7 +2947,7 @@
 static bool GetVersion(Isolate* isolate, JSONStream* js) {
   JSONObject jsobj(js);
   jsobj.AddProperty("type", "Version");
-  jsobj.AddProperty("major", static_cast<intptr_t>(2));
+  jsobj.AddProperty("major", static_cast<intptr_t>(3));
   jsobj.AddProperty("minor", static_cast<intptr_t>(0));
   jsobj.AddProperty("_privateMajor", static_cast<intptr_t>(0));
   jsobj.AddProperty("_privateMinor", static_cast<intptr_t>(0));
@@ -2816,59 +2981,85 @@
 };
 
 
-static bool GetVM(Isolate* isolate, JSONStream* js) {
+void Service::PrintJSONForVM(JSONStream* js, bool ref) {
   JSONObject jsobj(js);
-  jsobj.AddProperty("type", "VM");
+  jsobj.AddProperty("type", (ref ? "@VM" : "VM"));
+  jsobj.AddProperty("name", GetVMName());
+  if (ref) {
+    return;
+  }
+  Isolate* vm_isolate = Dart::vm_isolate();
   jsobj.AddProperty("architectureBits", static_cast<intptr_t>(kBitsPerWord));
   jsobj.AddProperty("targetCPU", CPU::Id());
   jsobj.AddProperty("hostCPU", HostCPUFeatures::hardware());
   jsobj.AddProperty("version", Version::String());
-  // Send pid as a string because it allows us to avoid any issues with
-  // pids > 53-bits (when consumed by JavaScript).
-  // TODO(johnmccutchan): Codify how integers are sent across the service.
-  jsobj.AddPropertyF("pid", "%" Pd "", OS::ProcessId());
-  jsobj.AddProperty("_assertsEnabled", isolate->flags().asserts());
-  jsobj.AddProperty("_typeChecksEnabled", isolate->flags().type_checks());
-  int64_t start_time_millis = (Dart::vm_isolate()->start_time() /
+  jsobj.AddProperty("pid", OS::ProcessId());
+  int64_t start_time_millis = (vm_isolate->start_time() /
                                kMicrosecondsPerMillisecond);
-  jsobj.AddProperty64("startTime", start_time_millis);
+  jsobj.AddPropertyTimeMillis("startTime", start_time_millis);
   // Construct the isolate list.
   {
     JSONArray jsarr(&jsobj, "isolates");
     ServiceIsolateVisitor visitor(&jsarr);
     Isolate::VisitIsolates(&visitor);
   }
+}
+
+
+static bool GetVM(Isolate* isolate, JSONStream* js) {
+  Service::PrintJSONForVM(js, false);
   return true;
 }
 
 
-static const MethodParameter* set_exception_pause_info_params[] = {
-  ISOLATE_PARAMETER,
+static const MethodParameter* restart_vm_params[] = {
+  NO_ISOLATE_PARAMETER,
   NULL,
 };
 
 
-static bool SetExceptionPauseInfo(Isolate* isolate, JSONStream* js) {
-  const char* exceptions = js->LookupParam("exceptions");
-  if (exceptions == NULL) {
-    PrintMissingParamError(js, "exceptions");
+static bool RestartVM(Isolate* isolate, JSONStream* js) {
+  Isolate::KillAllIsolates(Isolate::kVMRestartMsg);
+  PrintSuccess(js);
+  return true;
+}
+
+
+static const char* exception_pause_mode_names[] = {
+  "All",
+  "None",
+  "Unhandled",
+  NULL,
+};
+
+
+static Dart_ExceptionPauseInfo exception_pause_mode_values[] = {
+  kPauseOnAllExceptions,
+  kNoPauseOnExceptions,
+  kPauseOnUnhandledExceptions,
+  kInvalidExceptionPauseInfo,
+};
+
+
+static const MethodParameter* set_exception_pause_mode_params[] = {
+  ISOLATE_PARAMETER,
+  new EnumParameter("mode", true, exception_pause_mode_names),
+  NULL,
+};
+
+
+static bool SetExceptionPauseMode(Isolate* isolate, JSONStream* js) {
+  const char* mode = js->LookupParam("mode");
+  if (mode == NULL) {
+    PrintMissingParamError(js, "mode");
     return true;
   }
-
-  Dart_ExceptionPauseInfo info = kNoPauseOnExceptions;
-  if (strcmp(exceptions, "none") == 0) {
-    info = kNoPauseOnExceptions;
-  } else if (strcmp(exceptions, "all") == 0) {
-    info = kPauseOnAllExceptions;
-  } else if (strcmp(exceptions, "unhandled") == 0) {
-    info = kPauseOnUnhandledExceptions;
-  } else {
-    JSONObject jsobj(js);
-    jsobj.AddProperty("type", "Error");
-    jsobj.AddProperty("message", "illegal value for parameter 'exceptions'");
+  Dart_ExceptionPauseInfo info =
+      EnumMapper(mode, exception_pause_mode_names, exception_pause_mode_values);
+  if (info == kInvalidExceptionPauseInfo) {
+    PrintInvalidParamError(js, "mode");
     return true;
   }
-
   isolate->debugger()->SetExceptionPauseInfo(info);
   if (Service::debug_stream.enabled()) {
     ServiceEvent event(isolate, ServiceEvent::kDebuggerSettingsUpdate);
@@ -2965,6 +3156,25 @@
 }
 
 
+static const MethodParameter* set_vm_name_params[] = {
+  new MethodParameter("name", true),
+  NULL,
+};
+
+
+static bool SetVMName(Isolate* isolate, JSONStream* js) {
+  const char* name_param = js->LookupParam("name");
+  free(vm_name);
+  vm_name = strdup(name_param);
+  if (Service::vm_stream.enabled()) {
+    ServiceEvent event(NULL, ServiceEvent::kVMUpdate);
+    Service::HandleEvent(&event);
+  }
+  PrintSuccess(js);
+  return true;
+}
+
+
 static const MethodParameter* set_trace_class_allocation_params[] = {
   ISOLATE_PARAMETER,
   new IdParameter("classId", true),
@@ -3002,6 +3212,8 @@
     NULL },
   { "addBreakpoint", AddBreakpoint,
     add_breakpoint_params },
+  { "addBreakpointWithScriptUri", AddBreakpointWithScriptUri,
+    add_breakpoint_with_script_uri_params },
   { "addBreakpointAtEntry", AddBreakpointAtEntry,
     add_breakpoint_at_entry_params },
   { "_addBreakpointAtActivation", AddBreakpointAtActivation,
@@ -3066,12 +3278,14 @@
     pause_params },
   { "removeBreakpoint", RemoveBreakpoint,
     remove_breakpoint_params },
+  { "_restartVM", RestartVM,
+    restart_vm_params },
   { "resume", Resume,
     resume_params },
   { "_requestHeapSnapshot", RequestHeapSnapshot,
     request_heap_snapshot_params },
-  { "_setExceptionPauseInfo", SetExceptionPauseInfo,
-    set_exception_pause_info_params },
+  { "setExceptionPauseMode", SetExceptionPauseMode,
+    set_exception_pause_mode_params },
   { "_setFlag", SetFlag,
     set_flags_params },
   { "setLibraryDebuggable", SetLibraryDebuggable,
@@ -3080,6 +3294,8 @@
     set_name_params },
   { "_setTraceClassAllocation", SetTraceClassAllocation,
     set_trace_class_allocation_params },
+  { "setVMName", SetVMName,
+    set_vm_name_params },
 };
 
 
diff --git a/runtime/vm/service.h b/runtime/vm/service.h
index 3b23f6d..3fe90fe 100644
--- a/runtime/vm/service.h
+++ b/runtime/vm/service.h
@@ -15,6 +15,7 @@
 
 class Array;
 class EmbedderServiceHandler;
+class Error;
 class GCEvent;
 class GrowableObjectArray;
 class Instance;
@@ -39,9 +40,11 @@
 
 class RingServiceIdZone : public ServiceIdZone {
  public:
-  explicit RingServiceIdZone(ObjectIdRing* ring, ObjectIdRing::IdPolicy policy);
+  RingServiceIdZone();
   virtual ~RingServiceIdZone();
 
+  void Init(ObjectIdRing* ring, ObjectIdRing::IdPolicy policy);
+
   // Returned string will be zone allocated.
   virtual char* GetServiceId(const Object& obj);
 
@@ -118,7 +121,15 @@
                            const Object& error,
                            const Instance& stack_trace);
 
+  static void PostError(const String& method_name,
+                        const Array& parameter_keys,
+                        const Array& parameter_values,
+                        const Instance& reply_port,
+                        const Instance& id,
+                        const Error& error);
+
   // Well-known streams.
+  static StreamInfo vm_stream;
   static StreamInfo isolate_stream;
   static StreamInfo debug_stream;
   static StreamInfo gc_stream;
@@ -136,6 +147,8 @@
     return stream_cancel_callback_;
   }
 
+  static void PrintJSONForVM(JSONStream* js, bool ref);
+
  private:
   static void InvokeMethod(Isolate* isolate, const Array& message);
 
@@ -144,7 +157,12 @@
 
   static EmbedderServiceHandler* FindIsolateEmbedderHandler(const char* name);
   static EmbedderServiceHandler* FindRootEmbedderHandler(const char* name);
-
+  static void ScheduleExtensionHandler(const Instance& handler,
+                                       const String& method_name,
+                                       const Array& parameter_keys,
+                                       const Array& parameter_values,
+                                       const Instance& reply_port,
+                                       const Instance& id);
   static void SendEvent(const char* stream_id,
                         const char* event_type,
                         const Object& eventMessage);
diff --git a/runtime/vm/service/client.dart b/runtime/vm/service/client.dart
deleted file mode 100644
index c8a374a..0000000
--- a/runtime/vm/service/client.dart
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-part of vmservice;
-
-// A service client.
-abstract class Client {
-  final VMService service;
-  final bool sendEvents;
-  final Set<String> streams = new Set<String>();
-
-  Client(this.service, { bool sendEvents: true })
-      : this.sendEvents = sendEvents {
-    service._addClient(this);
-  }
-
-  /// When implementing, call [close] when the network connection closes.
-  void close() {
-    service._removeClient(this);
-  }
-
-  /// Call to process a message. Response will be posted with 'seq'.
-  void onMessage(var seq, Message message) {
-    try {
-      // Send message to service.
-      service.route(message).then((response) {
-        // Call post when the response arrives.
-        post(response);
-      });
-    } catch (e, st) {
-      message.setErrorResponse('Internal error: $e');
-      post(message.response);
-    }
-  }
-
-  // Sends a result to the client.  Implemented in subclasses.
-  void post(dynamic result);
-
-  dynamic toJson() {
-    return {
-    };
-  }
-}
diff --git a/runtime/vm/service/constants.dart b/runtime/vm/service/constants.dart
deleted file mode 100644
index 92390e6..0000000
--- a/runtime/vm/service/constants.dart
+++ /dev/null
@@ -1,12 +0,0 @@
-// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-part of vmservice;
-
-// These must be kept in sync with runtime/vm/service.cc.
-class Constants {
-  static const int SERVICE_EXIT_MESSAGE_ID = 0;
-  static const int ISOLATE_STARTUP_MESSAGE_ID = 1;
-  static const int ISOLATE_SHUTDOWN_MESSAGE_ID = 2;
-}
diff --git a/runtime/vm/service/message.dart b/runtime/vm/service/message.dart
deleted file mode 100644
index f27a48b..0000000
--- a/runtime/vm/service/message.dart
+++ /dev/null
@@ -1,165 +0,0 @@
-// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-part of vmservice;
-
-class Message {
-  final Completer _completer = new Completer.sync();
-  bool get completed => _completer.isCompleted;
-  /// Future of response.
-  Future<String> get response => _completer.future;
-  Client client;
-
-  // Client-side identifier for this message.
-  final serial;
-
-  // In new messages.
-  final String method;
-
-  // In old messages.
-  final List path = new List();
-
-  final Map params = new Map();
-
-  void _setPath(List<String> pathSegments) {
-    if (pathSegments == null) {
-      return;
-    }
-    pathSegments.forEach((String segment) {
-      if (segment == null || segment == '') {
-        return;
-      }
-      path.add(segment);
-    });
-  }
-
-  Message.fromJsonRpc(this.client, Map map)
-      : serial = map['id'], method = map['method'] {
-    if (map['params'] != null) {
-      params.addAll(map['params']);
-    }
-  }
-
-  static String _methodNameFromUri(Uri uri) {
-    if (uri == null) {
-      return '';
-    }
-    if (uri.pathSegments.length == 0) {
-      return '';
-    }
-    return uri.pathSegments[0];
-  }
-
-  Message.fromUri(this.client, Uri uri)
-      : serial = '', method = _methodNameFromUri(uri) {
-    params.addAll(uri.queryParameters);
-  }
-
-  Message.forIsolate(this.client, Uri uri, RunningIsolate isolate)
-      : serial = '', method = _methodNameFromUri(uri) {
-    params.addAll(uri.queryParameters);
-    params['isolateId'] = isolate.serviceId;
-  }
-
-  Uri toUri() {
-    return new Uri(path: method, queryParameters: params);
-  }
-
-  dynamic toJson() {
-    return {
-      'path': path,
-      'params': params
-    };
-  }
-
-  // Calls toString on all non-String elements of [list]. We do this so all
-  // elements in the list are strings, making consumption by C++ simpler.
-  // This has a side effect that boolean literal values like true become 'true'
-  // and thus indistinguishable from the string literal 'true'.
-  List _makeAllString(List list) {
-    if (list == null) {
-      return null;
-    }
-    for (var i = 0; i < list.length; i++) {
-      if (list[i] is String) {
-        continue;
-      }
-      list[i] = list[i].toString();
-    }
-    return list;
-  }
-
-  Future<String> send(SendPort sendPort) {
-    final receivePort = new RawReceivePort();
-    receivePort.handler = (value) {
-      receivePort.close();
-      assert(value is String);
-      _completer.complete(value);
-    };
-    var keys = _makeAllString(params.keys.toList(growable:false));
-    var values = _makeAllString(params.values.toList(growable:false));
-    var request = new List(6)
-        ..[0] = 0  // Make room for OOB message type.
-        ..[1] = receivePort.sendPort
-        ..[2] = serial
-        ..[3] = method
-        ..[4] = keys
-        ..[5] = values;
-    if (!sendIsolateServiceMessage(sendPort, request)) {
-      _completer.complete(JSON.encode({
-          'type': 'ServiceError',
-          'id': '',
-          'kind': 'InternalError',
-          'message': 'could not send message [${serial}] to isolate',
-      }));
-    }
-    return _completer.future;
-  }
-
-  Future<String> sendToVM() {
-    final receivePort = new RawReceivePort();
-    receivePort.handler = (value) {
-      receivePort.close();
-      assert(value is String);
-      _completer.complete(value);
-    };
-    var keys = _makeAllString(params.keys.toList(growable:false));
-    var values = _makeAllString(params.values.toList(growable:false));
-    var request = new List(6)
-        ..[0] = 0  // Make room for OOB message type.
-        ..[1] = receivePort.sendPort
-        ..[2] = serial
-        ..[3] = method
-        ..[4] = keys
-        ..[5] = values;
-    sendRootServiceMessage(request);
-    return _completer.future;
-  }
-
-  void setResponse(String response) {
-    _completer.complete(response);
-  }
-
-  void setErrorResponse(String message) {
-    var response = {
-      'jsonrpc': '2.0',
-      'id': serial,
-      'result' : {
-        'type': 'Error',
-        'message': message,
-        'request': {
-          'method': method,
-          'params': params
-        }
-      }
-    };
-    _completer.complete(JSON.encode(response));
-  }
-}
-
-bool sendIsolateServiceMessage(SendPort sp, List m)
-    native "VMService_SendIsolateServiceMessage";
-
-void sendRootServiceMessage(List m)
-    native "VMService_SendRootServiceMessage";
diff --git a/runtime/vm/service/message_router.dart b/runtime/vm/service/message_router.dart
deleted file mode 100644
index 6f8a1ea..0000000
--- a/runtime/vm/service/message_router.dart
+++ /dev/null
@@ -1,9 +0,0 @@
-// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-part of vmservice;
-
-abstract class MessageRouter {
-  Future<String> route(Message message);
-}
diff --git a/runtime/vm/service/running_isolate.dart b/runtime/vm/service/running_isolate.dart
deleted file mode 100644
index 48eec0d..0000000
--- a/runtime/vm/service/running_isolate.dart
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-part of vmservice;
-
-class RunningIsolate implements MessageRouter {
-  final int portId;
-  final SendPort sendPort;
-  final String name;
-
-  RunningIsolate(this.portId, this.sendPort, this.name);
-
-  String get serviceId => 'isolates/$portId';
-
-  Future<String> route(Message message) {
-    // Send message to isolate.
-    return message.send(sendPort);
-  }
-}
diff --git a/runtime/vm/service/running_isolates.dart b/runtime/vm/service/running_isolates.dart
deleted file mode 100644
index 12ca0b7..0000000
--- a/runtime/vm/service/running_isolates.dart
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-part of vmservice;
-
-class RunningIsolates implements MessageRouter {
-  final Map<int, RunningIsolate> isolates = new Map<int, RunningIsolate>();
-  int _rootPortId;
-
-  RunningIsolates();
-
-  void isolateStartup(int portId, SendPort sp, String name) {
-    if (_rootPortId == null) {
-      _rootPortId = portId;
-    }
-    var ri = new RunningIsolate(portId, sp, name);
-    isolates[portId] = ri;
-  }
-
-  void isolateShutdown(int portId, SendPort sp) {
-    if (_rootPortId == portId) {
-      _rootPortId = null;
-    }
-    isolates.remove(portId);
-  }
-
-  Future<String> route(Message message) {
-    String isolateParam = message.params['isolateId'];
-    int isolateId;
-    if (!isolateParam.startsWith('isolates/')) {
-      message.setErrorResponse('Malformed isolate id $isolateParam');
-      return message.response;
-    }
-    isolateParam = isolateParam.substring('isolates/'.length);
-    if (isolateParam == 'root') {
-      isolateId = _rootPortId;
-    } else {
-      try {
-        isolateId = int.parse(isolateParam);
-      } catch (e) {
-        message.setErrorResponse('Could not parse isolate id: $e');
-        return message.response;
-      }
-    }
-    var isolate = isolates[isolateId];
-    if (isolate == null) {
-      message.setErrorResponse('Cannot find isolate id: $isolateId');
-      return message.response;
-    }
-    return isolate.route(message);
-  }
-}
diff --git a/runtime/vm/service/service.md b/runtime/vm/service/service.md
index f05214d..d0466ef 100644
--- a/runtime/vm/service/service.md
+++ b/runtime/vm/service/service.md
@@ -1,8 +1,8 @@
-# Dart VM Service Protocol 2.0
+# Dart VM Service Protocol 3.0
 
 > Please post feedback to the [observatory-discuss group][discuss-list]
 
-This document describes of _version 2.0_ of the Dart VM Service Protocol. This
+This document describes of _version 3.0_ of the Dart VM Service Protocol. This
 protocol is used to communicate with a running Dart Virtual Machine.
 
 To use the Service Protocol, start the VM with the *--observe* flag.
@@ -25,6 +25,7 @@
 - [Private RPCs, Types, and Properties](#private-rpcs-types-and-properties)
 - [Public RPCs](#public-rpcs)
 	- [addBreakpoint](#addbreakpoint)
+	- [addBreakpointWithScriptUri](#addbreakpointwithscripturi)
 	- [addBreakpointAtEntry](#addbreakpointatentry)
 	- [evaluate](#evaluate)
 	- [evaluateInFrame](#evaluateinframe)
@@ -37,8 +38,10 @@
 	- [pause](#pause)
 	- [removeBreakpoint](#removebreakpoint)
 	- [resume](#resume)
-	- [setName](#setname)
+	- [setExceptionPauseMode](#setexceptionpausemode)
 	- [setLibraryDebuggable](#setlibrarydebuggable)
+	- [setName](#setname)
+	- [setVMName](#setvmname)
 	- [streamCancel](#streamcancel)
 	- [streamListen](#streamlisten)
 - [Public Types](#public-types)
@@ -68,6 +71,7 @@
 	- [Message](#message)
 	- [Null](#null)
 	- [Object](#object)
+	- [Response](#response)
 	- [Sentinel](#sentinel)
 	- [SentinelKind](#sentinelkind)
 	- [Script](#script)
@@ -76,7 +80,7 @@
 	- [StepOption](#stepoption)
 	- [Success](#success)
 	- [TypeArguments](#typearguments)
-	- [Response](#response)
+	- [UresolvedSourceLocation](#unresolvedsourcelocation)
 	- [Version](#version)
 	- [VM](#vm)
 - [Revision History](#revision-history)
@@ -109,7 +113,7 @@
   "jsonrpc": "2.0",
   "result": {
     "type": "Version",
-    "major": 2,
+    "major": 3,
     "minor": 0
   }
   "id": "1"
@@ -299,7 +303,7 @@
 ```
   "result": {
     "type": "Version",
-    "major": 2,
+    "major": 3,
     "minor": 0
   }
 ```
@@ -372,12 +376,60 @@
 ```
 Breakpoint addBreakpoint(string isolateId,
                          string scriptId,
-                         int line)
+                         int line,
+                         int column [optional])
 ```
 
 The _addBreakpoint_ RPC is used to add a breakpoint at a specific line
 of some script.
 
+The _scriptId_ parameter is used to specify the target script.
+
+The _line_ parameter is used to specify the target line for the
+breakpoint. If there are multiple possible breakpoints on the target
+line, then the VM will place the breakpoint at the location which
+would execute soonest. If it is not possible to set a breakpoint at
+the target line, the breakpoint will be added at the next possible
+breakpoint location within the same function.
+
+The _column_ parameter may be optionally specified.  This is useful
+for targeting a specific breakpoint on a line with multiple possible
+breakpoints.
+
+If no breakpoint is possible at that line, the _102_ (Cannot add
+breakpoint) error code is returned.
+
+Note that breakpoints are added and removed on a per-isolate basis.
+
+See [Breakpoint](#breakpoint).
+
+### addBreakpointWithScriptUri
+
+```
+Breakpoint addBreakpointWithScriptUri(string isolateId,
+                                      string scriptUri,
+                                      int line,
+                                      int column [optional])
+```
+
+The _addBreakpoint_ RPC is used to add a breakpoint at a specific line
+of some script.  This RPC is useful when a script has not yet been
+assigned an id, for example, if a script is in a deferred library
+which has not yet been loaded.
+
+The _scriptUri_ parameter is used to specify the target script.
+
+The _line_ parameter is used to specify the target line for the
+breakpoint. If there are multiple possible breakpoints on the target
+line, then the VM will place the breakpoint at the location which
+would execute soonest. If it is not possible to set a breakpoint at
+the target line, the breakpoint will be added at the next possible
+breakpoint location within the same function.
+
+The _column_ parameter may be optionally specified.  This is useful
+for targeting a specific breakpoint on a line with multiple possible
+breakpoints.
+
 If no breakpoint is possible at that line, the _102_ (Cannot add
 breakpoint) error code is returned.
 
@@ -461,18 +513,21 @@
 ### getIsolate
 
 ```
-Isolate getIsolate(string isolateId)
+Isolate|Sentinel getIsolate(string isolateId)
 ```
 
 The _getIsolate_ RPC is used to lookup an _Isolate_ object by its _id_.
 
+If _isolateId_ refers to an isolate which has exited, then the
+_Collected_ [Sentinel](#sentinel) is returned.
+
 See [Isolate](#isolate).
 
 ### getObject
 
 ```
-Object|Sentinel  getObject(string isolateId,
-                           string objectId)
+Object|Sentinel getObject(string isolateId,
+                          string objectId)
 ```
 
 The _getObject_ RPC is used to lookup an _object_ from some isolate by
@@ -481,10 +536,13 @@
 If _objectId_ is a temporary id which has expired, then then _Expired_
 [Sentinel](#sentinel) is returned.
 
-If _objectId_ refers to an object which has been collected by the VM's
+If _objectId_ refers to a heap object which has been collected by the VM's
 garbage collector, then the _Collected_ [Sentinel](#sentinel) is
 returned.
 
+If _objectId_ refers to a non-heap object which has been deleted, then
+the _Collected_ [Sentinel](#sentinel) is returned.
+
 If the object handle has not expired and the object has not been
 collected, then an [Object](#object) will be returned.
 
@@ -567,16 +625,22 @@
 
 See [Success](#success), [StepOption](#StepOption).
 
-### setName
+### setExceptionPauseMode
 
 ```
-Success setName(string isolateId,
-                string name)
+Success setExceptionPauseMode(string isolateId,
+                              ExceptionPauseMode mode)
 ```
 
-The _setName_ RPC is used to change the debugging name for an isolate.
+The _setExceptionPauseMode_ RPC is used to control if an isolate pauses when
+an exception is thrown.
 
-See [Success](#success).
+mode | meaning
+---- | -------
+None | Do not pause isolate on thrown exceptions
+Unhandled | Pause isolate on unhandled exceptions
+All  | Pause isolate on all thrown exceptions
+
 
 ### setLibraryDebuggable
 
@@ -591,6 +655,27 @@
 
 See [Success](#success).
 
+### setName
+
+```
+Success setName(string isolateId,
+                string name)
+```
+
+The _setName_ RPC is used to change the debugging name for an isolate.
+
+See [Success](#success).
+
+### setVMName
+
+```
+Success setVMName(string name)
+```
+
+The _setVMName_ RPC is used to change the debugging name for the vm.
+
+See [Success](#success).
+
 ### streamCancel
 
 ```
@@ -620,7 +705,8 @@
 
 streamId | event types provided
 -------- | -----------
-Isolate | IsolateStart, IsolateExit, IsolateUpdate
+VM | VMUpdate
+Isolate | IsolateStart, IsolateRunnable, IsolateExit, IsolateUpdate
 Debug | PauseStart, PauseExit, PauseBreakpoint, PauseInterrupted, PauseException, Resume, BreakpointAdded, BreakpointResolved, BreakpointRemoved, Inspect
 GC | GC
 
@@ -701,6 +787,13 @@
   PropertyType1|PropertyType2 complexProperty;
 ```
 
+We also allow parenthesis on type expressions.  This is useful when a property
+is an _Array_ of multiple independent types:
+
+```
+  (PropertyType1|PropertyType2)[]
+```
+
 When a string is only permitted to take one of a certain set of values,
 we indicate this by the use of the _enum_ format:
 
@@ -756,15 +849,26 @@
 ### Breakpoint
 
 ```
-class Breakpoint extends Response {
+class Breakpoint extends Object {
+  // A number identifying this breakpoint to the user.
   int breakpointNumber;
+
+  // Has this breakpoint been assigned to a specific program location?
   bool resolved;
-  SourceLocation location;
+
+  // SourceLocation when breakpoint is resolved, UnresolvedSourceLocation
+  // when a breakpoint is not resolved.
+  SourceLocation|UnresolvedSourceLocation location;
 }
 ```
 
 A _Breakpoint_ describes a debugger breakpoint.
 
+A breakpoint is _resolved_ when it has been assigned to a specific
+program location.  A breakpoint my remain unresolved when it is in
+code which has not yet been compiled or in a library which has not
+been loaded (i.e. a deferred library).
+
 ### Class
 
 ```
@@ -782,7 +886,7 @@
   string name;
 
   // The error which occurred during class finalization, if it exists.
-  @Instance error [optional];
+  @Error error [optional];
 
   // Is this an abstract class?
   bool abstract;
@@ -790,15 +894,6 @@
   // Is this a const class?
   bool const;
 
-  // Has this class been finalized?
-  bool finalized;
-
-  // Is this class implemented?
-  bool implemented;
-
-  // Is this a vm patch class?
-  bool patch;
-
   // The library which contains this class.
   @Library library;
 
@@ -877,14 +972,14 @@
 ### Context
 
 ```
-class @Context {
+class @Context extends @Object {
   // The number of variables in this context.
   int length;
 }
 ```
 
 ```
-class Context {
+class Context extends Object {
   // The number of variables in this context.
   int length;
 
@@ -896,6 +991,9 @@
 }
 ```
 
+A _Context_ is a data structure which holds the captured variables for
+some closure.
+
 ### ContextElement
 
 ```
@@ -966,7 +1064,21 @@
   EventKind kind;
 
   // The isolate with which this event is associated.
-  @Isolate isolate;
+  //
+  // This is provided for all event kinds except for:
+  //   VMUpdate
+  @Isolate isolate [optional];
+
+  // The vm with which this event is associated.
+  //
+  // This is provided for the event kind:
+  //   VMUpdate
+  @VM vm [optional];
+
+  // The timestamp (in milliseconds since the epoch) associated with this event.
+  // For some isolate pause events, the timestamp is from when the isolate was
+  // paused. For other events, the timestamp is from when the event was created.
+  int timestamp;
 
   // The breakpoint which was added, removed, or resolved.
   //
@@ -997,6 +1109,9 @@
   //   PauseInterrupted
   //   PauseException
   //
+  // For PauseInterrupted events, there will be no top frame if the
+  // isolate is idle (waiting in the message loop).
+  //
   // For the Resume event, the top frame is provided at
   // all times except for the initial resume event that is delivered
   // when an isolate begins execution.
@@ -1023,9 +1138,16 @@
 
 ```
 enum EventKind {
+  // Notification that VM identifying information has changed. Currently used
+  // to notify of changes to the VM debugging name via setVMName.
+  VMUpdate,
+
   // Notification that a new isolate has started.
   IsolateStart,
 
+  // Notification that an isolate is ready to run.
+  IsolateRunnable,
+
   // Notification that an isolate has exited.
   IsolateExit,
 
@@ -1164,11 +1286,8 @@
 
 ```
 class FlagList extends Response {
-  // A list of all flags which are set to default values.
-  Flag[] unmodifiedFlags;
-
-  // A list of all flags which have been modified by the user.
-  Flag[] modifiedFlags;
+  // A list of all flags in the VM.
+  Flag[] flags;
 }
 ```
 
@@ -1181,8 +1300,7 @@
   int index;
   @Function function;
   @Code code;
-  @Script script;
-  int tokenPos;
+  SourceLocation location;
   BoundVariable[] vars;
 }
 ```
@@ -1246,6 +1364,10 @@
   //   Double (suitable for passing to Double.parse())
   //   Int (suitable for passing to int.parse())
   //   String (value may be truncated)
+  //   Float32x4
+  //   Float64x2
+  //   Int32x4
+  //   StackTrace
   string valueAsString [optional];
 
   // The valueAsString for String references may be truncated. If so,
@@ -1294,9 +1416,11 @@
 
   // The pattern of a RegExp instance.
   //
+  // The pattern is always an instance of kind String.
+  //
   // Provided for instance kinds:
   //   RegExp
-  String pattern [optional];
+  @Instance pattern [optional];
 }
 ```
 
@@ -1363,13 +1487,13 @@
   @Class parameterizedClass [optional];
 
   // The fields of this Instance.
-  BoundField fields [optional];
+  BoundField[] fields [optional];
 
   // The elements of a List instance.
   //
   // Provided for instance kinds:
   //   List
-  @Instance|Sentinel[] elements [optional];
+  (@Instance|Sentinel)[] elements [optional];
 
   // The elements of a List instance.
   //
@@ -1379,6 +1503,8 @@
 
   // The bytes of a TypedData instance.
   //
+  // The data is provided as a Base64 encoded string.
+  //
   // Provided for instance kinds:
   //   Uint8ClampedList
   //   Uint8List
@@ -1394,7 +1520,7 @@
   //   Int32x4List
   //   Float32x4List
   //   Float64x2List
-  int[] bytes [optional];
+  string bytes [optional];
 
   // The function associated with a Closure instance.
   //
@@ -1406,7 +1532,7 @@
   //
   // Provided for instance kinds:
   //   Closure
-  @Function closureContext [optional];
+  @Context closureContext [optional];
 
   // The referent of a MirrorReference instance.
   //
@@ -1420,6 +1546,18 @@
   //   RegExp
   String pattern [optional];
 
+  // Whether this regular expression is case sensitive.
+  //
+  // Provided for instance kinds:
+  //   RegExp
+  bool isCaseSensitive [optional];
+
+  // Whether this regular expression matches multiple lines.
+  //
+  // Provided for instance kinds:
+  //   RegExp
+  bool isMultiLine [optional];
+
   // The key for a WeakProperty instance.
   //
   // Provided for instance kinds:
@@ -1500,6 +1638,11 @@
   // Maps will be PlainInstance.
   Map,
 
+  // Vector instance kinds.
+  Float32x4,
+  Float64x2,
+  Int32x4
+
   // An instance of the built-in VM TypedData implementations.  User-defined
   // TypedDatas will be PlainInstance.
   Uint8ClampedList,
@@ -1517,6 +1660,9 @@
   Float32x4List,
   Float64x2List,
 
+  // An instance of the Dart class StackTrace.
+  StackTrace,
+
   // An instance of the built-in VM Closure implementation. User-defined
   // Closures will be PlainInstance.
   Closure,
@@ -1582,9 +1728,6 @@
   // Suitable to pass to DateTime.fromMillisecondsSinceEpoch.
   int startTime;
 
-  // The entry function for this isolate.
-  @Function entry [optional];
-
   // The number of live ports for this isolate.
   int livePorts;
 
@@ -1595,17 +1738,21 @@
   // running, this will be a resume event.
   Event pauseEvent;
 
-  // The error that is causing this isolate to exit, if applicable.
-  Error error [optional];
-
   // The root library for this isolate.
-  @Library rootLib;
+  //
+  // Guaranteed to be initialized when the IsolateRunnable event fires.
+  @Library rootLib [optional];
 
   // A list of all libraries for this isolate.
+  //
+  // Guaranteed to be initialized when the IsolateRunnable event fires.
   @Library[] libraries;
 
   // A list of all breakpoints for this isolate.
   Breakpoint[] breakpoints;
+
+  // The error that is causing this isolate to exit, if applicable.
+  Error error [optional];
 }
 ```
 
@@ -1690,15 +1837,32 @@
 
 ```
 class Message extends Response {
+  // The index in the isolate's message queue. The 0th message being the next
+  // message to be processed.
   int index;
+
+  // An advisory name describing this message.
   string name;
+
+  // An instance id for the decoded message. This id can be passed to other
+  // RPCs, for example, getObject or evaluate.
   string messageObjectId;
+
+  // The size (bytes) of the encoded message.
   int size;
+
+  // A reference to the function that will be invoked to handle this message.
   @Function handler [optional];
+
+  // The source location of handler.
   SourceLocation location [optional];
 }
 ```
 
+A _Message_ provides information about a pending isolate message and the
+function that will be invoked to handle it.
+
+
 ### Null
 
 ```
@@ -1762,6 +1926,21 @@
 
 An _Object_ is a  persistent object that is owned by some isolate.
 
+### Response
+
+```
+class Response {
+  // Every response returned by the VM Service has the
+  // type property. This allows the client distinguish
+  // between different kinds of responses.
+  string type;
+}
+```
+
+Every non-error response returned by the Service Protocol extends _Response_.
+By using the _type_ property, the client can determine which [type](#types)
+of response has been provided.
+
 ### Sentinel
 
 ```
@@ -1882,6 +2061,19 @@
 }
 ```
 
+### ExceptionPauseMode
+
+```
+enum ExceptionPauseMode {
+  None,
+  Unhandled,
+  All,
+}
+```
+
+An _ExceptionPauseMode_ indicates how the isolate pauses when an exception
+is thrown.
+
 ### StepOption
 
 ```
@@ -1930,20 +2122,42 @@
 A _TypeArguments_ object represents the type argument vector for some
 instantiated generic type.
 
-### Response
+### UnresolvedSourceLocation
 
 ```
-class Response {
-  // Every response returned by the VM Service has the
-  // type property. This allows the client distinguish
-  // between different kinds of responses.
-  string type;
+class UnresolvedSourceLocation extends Response {
+  // The script containing the source location if the script has been loaded.
+  @Script script [optional];
+
+  // The uri of the script containing the source location if the script
+  // has yet to be loaded.
+  string scriptUri [optional];
+
+  // An approximate token position for the source location.  This may
+  // change when the location is resolved.
+  int tokenPos [optional];
+
+  // An approximate line number for the source location.  This may
+  // change when the location is resolved.
+  int line [optional];
+
+  // An approximate column number for the source location.  This may
+  // change when the location is resolved.
+  int column [optional];
+
 }
 ```
 
-Every non-error response returned by the Service Protocol extends _Response_.
-By using the _type_ property, the client can determine which [type](#types)
-of response has been provided.
+The _UnresolvedSourceLocation_ class is used to refer to an unresolved
+breakpoint location.  As such, it is meant to approximate the final
+location of the breakpoint but it is not exact.
+
+Either the _script_ or the _scriptUri_ field will be present.
+
+Either the _tokenPos_ or the _line_ field will be present.
+
+The _column_ field will only be present when the breakpoint was
+specified with a specific column number.
 
 ### Version
 
@@ -1964,6 +2178,15 @@
 ### VM
 
 ```
+class @VM extends Response {
+  // A name identifying this vm. Not guaranteed to be unique.
+  string name;
+}
+```
+
+_@VM_ is a reference to a _VM_ object.
+
+```
 class VM extends Response {
   // Word length on target architecture (e.g. 32, 64).
   int architectureBits;
@@ -1978,7 +2201,7 @@
   string version;
 
   // The process id for the VM.
-  string pid;
+  int pid;
 
   // The time that the VM started in milliseconds since the epoch.
   //
@@ -1994,7 +2217,9 @@
 
 version | comments
 ------- | --------
-1.0 draft 1 | initial revision
+1.0 | initial revision
+2.0 | Describe protocol version 2.0.
+3.0 | Describe protocol version 3.0.  Added UnresolvedSourceLocation.  Added Sentinel return to getIsolate.  Add AddedBreakpointWithScriptUri.  Removed Isolate.entry. The type of VM.pid was changed from string to int.  Added VMUpdate events.
 
 
 [discuss-list]: https://groups.google.com/a/dartlang.org/forum/#!forum/observatory-discuss
diff --git a/runtime/vm/service/vmservice.dart b/runtime/vm/service/vmservice.dart
deleted file mode 100644
index 2be15b6..0000000
--- a/runtime/vm/service/vmservice.dart
+++ /dev/null
@@ -1,327 +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 vmservice;
-
-import 'dart:async';
-import 'dart:convert';
-import 'dart:isolate';
-import 'dart:typed_data';
-
-part 'client.dart';
-part 'constants.dart';
-part 'running_isolate.dart';
-part 'running_isolates.dart';
-part 'message.dart';
-part 'message_router.dart';
-
-final RawReceivePort isolateLifecyclePort = new RawReceivePort();
-final RawReceivePort scriptLoadPort = new RawReceivePort();
-
-typedef ShutdownCallback();
-
-class VMService extends MessageRouter {
-  static VMService _instance;
-
-  /// Collection of currently connected clients.
-  final Set<Client> clients = new Set<Client>();
-
-  /// Collection of currently running isolates.
-  RunningIsolates runningIsolates = new RunningIsolates();
-
-  /// A port used to receive events from the VM.
-  final RawReceivePort eventPort;
-
-  ShutdownCallback onShutdown;
-
-  void _addClient(Client client) {
-    assert(client.streams.isEmpty);
-    clients.add(client);
-  }
-
-  void _removeClient(Client client) {
-    clients.remove(client);
-    for (var streamId in client.streams) {
-      if (!_isAnyClientSubscribed(streamId)) {
-        _vmCancelStream(streamId);
-      }
-    }
-  }
-
-  void _eventMessageHandler(List eventMessage) {
-    var streamId = eventMessage[0];
-    var event = eventMessage[1];
-    for (var client in clients) {
-      if (client.sendEvents && client.streams.contains(streamId)) {
-        client.post(event);
-      }
-    }
-  }
-
-  void _controlMessageHandler(int code,
-                              int portId,
-                              SendPort sp,
-                              String name) {
-    switch (code) {
-      case Constants.ISOLATE_STARTUP_MESSAGE_ID:
-        runningIsolates.isolateStartup(portId, sp, name);
-      break;
-      case Constants.ISOLATE_SHUTDOWN_MESSAGE_ID:
-        runningIsolates.isolateShutdown(portId, sp);
-      break;
-    }
-  }
-
-  void _exit() {
-    isolateLifecyclePort.close();
-    scriptLoadPort.close();
-    // Create a copy of the set as a list because client.close() alters the set.
-    var clientsList = clients.toList();
-    for (var client in clientsList) {
-      client.close();
-    }
-    // Call embedder shutdown hook after the internal shutdown.
-    if (onShutdown != null) {
-      onShutdown();
-    }
-    _onExit();
-  }
-
-  void messageHandler(message) {
-    if (message is List) {
-      if (message.length == 2) {
-        // This is an event.
-        assert(message[0] is String);
-        assert(message[1] is String || message[1] is Uint8List);
-        _eventMessageHandler(message);
-        return;
-      }
-      if (message.length == 1) {
-        // This is a control message directing the vm service to exit.
-        assert(message[0] == Constants.SERVICE_EXIT_MESSAGE_ID);
-        _exit();
-        return;
-      }
-      if (message.length == 4) {
-        // This is a message informing us of the birth or death of an
-        // isolate.
-        _controlMessageHandler(message[0], message[1], message[2], message[3]);
-        return;
-      }
-    }
-    Logger.root.severe(
-        'Internal vm-service error: ignoring illegal message: $message');
-  }
-
-  void _notSupported(_) {
-    throw new UnimplementedError('Service script loading not supported.');
-  }
-
-  VMService._internal()
-      : eventPort = isolateLifecyclePort {
-    scriptLoadPort.handler = _notSupported;
-    eventPort.handler = messageHandler;
-  }
-
-  factory VMService() {
-    if (VMService._instance == null) {
-      VMService._instance = new VMService._internal();
-      _onStart();
-    }
-    return _instance;
-  }
-
-  void _clientCollection(Message message) {
-    var members = [];
-    var result = {};
-    clients.forEach((client) {
-      members.add(client.toJson());
-    });
-    result['type'] = 'ClientList';
-    result['members'] = members;
-    message.setResponse(JSON.encode(result));
-  }
-
-  // These must be kept in sync with the declarations in vm/json_stream.h.
-  static const _kInvalidParams = -32602;
-  static const _kStreamAlreadySubscribed = 103;
-  static const _kStreamNotSubscribed = 104;
-
-  var _errorMessages = {
-    _kInvalidParams: 'Invalid params"',
-    _kStreamAlreadySubscribed: 'Stream already subscribed',
-    _kStreamNotSubscribed: 'Stream not subscribed',
-  };
-
-  String _encodeError(Message message, int code, {String details}) {
-    var response = {
-      'jsonrpc': '2.0',
-      'id' : message.serial,
-      'error' : {
-        'code': code,
-        'message': _errorMessages[code],
-      },
-    };
-    if (details != null) {
-      response['error']['data'] = {
-        'details': details,
-      };
-    }
-    return JSON.encode(response);
-  }
-
-  String _encodeResult(Message message, Map result) {
-    var response = {
-      'jsonrpc': '2.0',
-      'id' : message.serial,
-      'result' : result,
-    };
-    return JSON.encode(response);
-  }
-
-  bool _isAnyClientSubscribed(String streamId) {
-    for (var client in clients) {
-      if (client.streams.contains(streamId)) {
-        return true;
-      }
-    }
-    return false;
-  }
-
-  Future<String> _streamListen(Message message) async {
-    var client = message.client;
-    var streamId = message.params['streamId'];
-
-    if (client.streams.contains(streamId)) {
-      return _encodeError(message, _kStreamAlreadySubscribed);
-    }
-    if (!_isAnyClientSubscribed(streamId)) {
-      if (!_vmListenStream(streamId)) {
-        return _encodeError(
-            message, _kInvalidParams,
-            details:"streamListen: invalid 'streamId' parameter: ${streamId}");
-      }
-    }
-    client.streams.add(streamId);
-
-    var result = { 'type' : 'Success' };
-    return _encodeResult(message, result);
-  }
-
-  Future<String> _streamCancel(Message message) async {
-    var client = message.client;
-    var streamId = message.params['streamId'];
-
-    if (!client.streams.contains(streamId)) {
-      return _encodeError(message, _kStreamNotSubscribed);
-    }
-    client.streams.remove(streamId);
-    if (!_isAnyClientSubscribed(streamId)) {
-      _vmCancelStream(streamId);
-    }
-
-    var result = { 'type' : 'Success' };
-    return _encodeResult(message, result);
-  }
-
-  // TODO(johnmccutchan): Turn this into a command line tool that uses the
-  // service library.
-  Future<String> _getCrashDump(Message message) async {
-    var client = message.client;
-    final perIsolateRequests = [
-        // ?isolateId=<isolate id> will be appended to each of these requests.
-        // Isolate information.
-        Uri.parse('getIsolate'),
-        // State of heap.
-        Uri.parse('_getAllocationProfile'),
-        // Call stack + local variables.
-        Uri.parse('getStack?_full=true'),
-    ];
-
-    // Snapshot of running isolates.
-    var isolates = runningIsolates.isolates.values.toList();
-
-    // Collect the mapping from request uris to responses.
-    var responses = {
-    };
-
-    // Request VM.
-    var getVM = Uri.parse('getVM');
-    var getVmResponse = JSON.decode(
-        await new Message.fromUri(client, getVM).sendToVM());
-    responses[getVM.toString()] = getVmResponse['result'];
-
-    // Request command line flags.
-    var getFlagList = Uri.parse('getFlagList');
-    var getFlagListResponse = JSON.decode(
-        await new Message.fromUri(client, getFlagList).sendToVM());
-    responses[getFlagList.toString()] = getFlagListResponse['result'];
-
-    // Make requests to each isolate.
-    for (var isolate in isolates) {
-      for (var request in perIsolateRequests) {
-        var message = new Message.forIsolate(client, request, isolate);
-        // Decode the JSON and and insert it into the map. The map key
-        // is the request Uri.
-        var response = JSON.decode(await isolate.route(message));
-        responses[message.toUri().toString()] = response['result'];
-      }
-      // Dump the object id ring requests.
-      var message =
-          new Message.forIsolate(client, Uri.parse('_dumpIdZone'), isolate);
-      var response = JSON.decode(await isolate.route(message));
-      // Insert getObject requests into responses map.
-      for (var object in response['result']['objects']) {
-        final requestUri =
-            'getObject&isolateId=${isolate.serviceId}?objectId=${object["id"]}';
-        responses[requestUri] = object;
-      }
-    }
-
-    // Encode the entire crash dump.
-    return _encodeResult(message, responses);
-  }
-
-  Future<String> route(Message message) {
-    if (message.completed) {
-      return message.response;
-    }
-    // TODO(turnidge): Update to json rpc.  BEFORE SUBMIT.
-    if ((message.path.length == 1) && (message.path[0] == 'clients')) {
-      _clientCollection(message);
-      return message.response;
-    }
-    if (message.method == '_getCrashDump') {
-      return _getCrashDump(message);
-    }
-    if (message.method == 'streamListen') {
-      return _streamListen(message);
-    }
-    if (message.method == 'streamCancel') {
-      return _streamCancel(message);
-    }
-    if (message.params['isolateId'] != null) {
-      return runningIsolates.route(message);
-    }
-    return message.sendToVM();
-  }
-}
-
-RawReceivePort boot() {
-  // Return the port we expect isolate startup and shutdown messages on.
-  return isolateLifecyclePort;
-}
-
-void _registerIsolate(int port_id, SendPort sp, String name) {
-  var service = new VMService();
-  service.runningIsolates.isolateStartup(port_id, sp, name);
-}
-
-void _onStart() native "VMService_OnStart";
-
-void _onExit() native "VMService_OnExit";
-
-bool _vmListenStream(String streamId) native "VMService_ListenStream";
-
-void _vmCancelStream(String streamId) native "VMService_CancelStream";
diff --git a/runtime/vm/service_event.cc b/runtime/vm/service_event.cc
index d704091..1023043 100644
--- a/runtime/vm/service_event.cc
+++ b/runtime/vm/service_event.cc
@@ -4,6 +4,8 @@
 
 #include "vm/service_event.h"
 
+#include "vm/message_handler.h"
+
 namespace dart {
 
 // Translate from the legacy DebugEvent to a ServiceEvent.
@@ -30,6 +32,31 @@
     }
 }
 
+
+ServiceEvent::ServiceEvent(Isolate* isolate, EventKind event_kind)
+    : isolate_(isolate),
+      kind_(event_kind),
+      embedder_kind_(NULL),
+      embedder_stream_id_(NULL),
+      breakpoint_(NULL),
+      top_frame_(NULL),
+      exception_(NULL),
+      async_continuation_(NULL),
+      at_async_jump_(false),
+      inspectee_(NULL),
+      gc_stats_(NULL),
+      bytes_(NULL),
+      bytes_length_(0),
+      timestamp_(OS::GetCurrentTimeMillis()) {
+  if ((event_kind == ServiceEvent::kPauseStart) ||
+      (event_kind == ServiceEvent::kPauseExit)) {
+    timestamp_ = isolate->message_handler()->paused_timestamp();
+  } else if (event_kind == ServiceEvent::kResume) {
+    timestamp_ = isolate->last_resume_timestamp();
+  }
+}
+
+
 ServiceEvent::ServiceEvent(const DebuggerEvent* debugger_event)
     : isolate_(debugger_event->isolate()),
       kind_(TranslateEventKind(debugger_event->type())),
@@ -40,11 +67,13 @@
       inspectee_(NULL),
       gc_stats_(NULL),
       bytes_(NULL),
-      bytes_length_(0) {
+      bytes_length_(0),
+      timestamp_(OS::GetCurrentTimeMillis()) {
   DebuggerEvent::EventType type = debugger_event->type();
   if (type == DebuggerEvent::kBreakpointReached) {
     set_breakpoint(debugger_event->breakpoint());
     set_async_continuation(debugger_event->async_continuation());
+    set_at_async_jump(debugger_event->at_async_jump());
   }
   if (type == DebuggerEvent::kExceptionThrown) {
     set_exception(debugger_event->exception());
@@ -54,13 +83,20 @@
       type == DebuggerEvent::kExceptionThrown) {
     set_top_frame(debugger_event->top_frame());
   }
+  if (debugger_event->timestamp() != -1) {
+    timestamp_ = debugger_event->timestamp();
+  }
 }
 
 
 const char* ServiceEvent::KindAsCString() const {
   switch (kind()) {
+    case kVMUpdate:
+      return "VMUpdate";
     case kIsolateStart:
       return "IsolateStart";
+    case kIsolateRunnable:
+      return "IsolateRunnable";
     case kIsolateExit:
       return "IsolateExit";
     case kIsolateUpdate:
@@ -104,7 +140,11 @@
 
 const char* ServiceEvent::stream_id() const {
   switch (kind()) {
+    case kVMUpdate:
+      return Service::vm_stream.id();
+
     case kIsolateStart:
+    case kIsolateRunnable:
     case kIsolateExit:
     case kIsolateUpdate:
       return Service::isolate_stream.id();
@@ -168,6 +208,7 @@
   }
   if (async_continuation() != NULL && !async_continuation()->IsNull()) {
     jsobj.AddProperty("_asyncContinuation", *(async_continuation()));
+    jsobj.AddProperty("_atAsyncJump", at_async_jump());
   }
   if (inspectee() != NULL) {
     jsobj.AddProperty("inspectee", *(inspectee()));
@@ -198,7 +239,13 @@
   ASSERT(jsobj != NULL);
   jsobj->AddProperty("type", "Event");
   jsobj->AddProperty("kind", KindAsCString());
-  jsobj->AddProperty("isolate", isolate());
+  if (kind() == kVMUpdate) {
+    jsobj->AddPropertyVM("vm");
+  } else {
+    jsobj->AddProperty("isolate", isolate());
+  }
+  ASSERT(timestamp_ != -1);
+  jsobj->AddPropertyTimeMillis("timestamp", timestamp_);
 }
 
 }  // namespace dart
diff --git a/runtime/vm/service_event.h b/runtime/vm/service_event.h
index 6ebc211..71516a6 100644
--- a/runtime/vm/service_event.h
+++ b/runtime/vm/service_event.h
@@ -14,7 +14,10 @@
 class ServiceEvent {
  public:
   enum EventKind {
+    kVMUpdate,           // VM identity information has changed
+
     kIsolateStart,       // New isolate has started
+    kIsolateRunnable,    // Isolate is ready to run
     kIsolateExit,        // Isolate has exited
     kIsolateUpdate,      // Isolate identity information has changed
 
@@ -50,19 +53,7 @@
     const Instance* stack_trace;
   };
 
-  ServiceEvent(Isolate* isolate, EventKind event_kind)
-      : isolate_(isolate),
-        kind_(event_kind),
-        embedder_kind_(NULL),
-        embedder_stream_id_(NULL),
-        breakpoint_(NULL),
-        top_frame_(NULL),
-        exception_(NULL),
-        async_continuation_(NULL),
-        inspectee_(NULL),
-        gc_stats_(NULL),
-        bytes_(NULL),
-        bytes_length_(0) {}
+  ServiceEvent(Isolate* isolate, EventKind event_kind);
 
   explicit ServiceEvent(const DebuggerEvent* debugger_event);
 
@@ -122,6 +113,13 @@
     async_continuation_ = closure;
   }
 
+  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_;
   }
@@ -155,6 +153,10 @@
     log_record_ = log_record;
   }
 
+  int64_t timestamp() const {
+    return timestamp_;
+  }
+
   void PrintJSON(JSONStream* js) const;
 
   void PrintJSONHeader(JSONObject* jsobj) const;
@@ -168,11 +170,13 @@
   ActivationFrame* top_frame_;
   const Object* exception_;
   const Object* async_continuation_;
+  bool at_async_jump_;
   const Object* inspectee_;
   const Heap::GCStats* gc_stats_;
   const uint8_t* bytes_;
   intptr_t bytes_length_;
   LogRecord log_record_;
+  int64_t timestamp_;
 };
 
 }  // namespace dart
diff --git a/runtime/vm/service_isolate.cc b/runtime/vm/service_isolate.cc
index 3779905..cb92d3a 100644
--- a/runtime/vm/service_isolate.cc
+++ b/runtime/vm/service_isolate.cc
@@ -22,99 +22,21 @@
 
 namespace dart {
 
+DECLARE_FLAG(bool, shutdown);
+
+#define Z (T->zone())
+
+
 DEFINE_FLAG(bool, trace_service, false, "Trace VM service requests.");
 DEFINE_FLAG(bool, trace_service_pause_events, false,
             "Trace VM service isolate pause events.");
 
-struct ResourcesEntry {
-  const char* path_;
-  const char* resource_;
-  int length_;
-};
-
-extern ResourcesEntry __service_resources_[];
-
-class Resources {
- public:
-  static const int kNoSuchInstance = -1;
-  static int ResourceLookup(const char* path, const char** resource) {
-    ResourcesEntry* table = ResourceTable();
-    for (int i = 0; table[i].path_ != NULL; i++) {
-      const ResourcesEntry& entry = table[i];
-      if (strcmp(path, entry.path_) == 0) {
-        *resource = entry.resource_;
-        ASSERT(entry.length_ > 0);
-        return entry.length_;
-      }
-    }
-    return kNoSuchInstance;
-  }
-
-  static const char* Path(int idx) {
-    ASSERT(idx >= 0);
-    ResourcesEntry* entry = At(idx);
-    if (entry == NULL) {
-      return NULL;
-    }
-    ASSERT(entry->path_ != NULL);
-    return entry->path_;
-  }
-
-  static int Length(int idx) {
-    ASSERT(idx >= 0);
-    ResourcesEntry* entry = At(idx);
-    if (entry == NULL) {
-      return kNoSuchInstance;
-    }
-    ASSERT(entry->path_ != NULL);
-    return entry->length_;
-  }
-
-  static const uint8_t* Resource(int idx) {
-    ASSERT(idx >= 0);
-    ResourcesEntry* entry = At(idx);
-    if (entry == NULL) {
-      return NULL;
-    }
-    return reinterpret_cast<const uint8_t*>(entry->resource_);
-  }
-
- private:
-  static ResourcesEntry* At(int idx) {
-    ASSERT(idx >= 0);
-    ResourcesEntry* table = ResourceTable();
-    for (int i = 0; table[i].path_ != NULL; i++) {
-      if (idx == i) {
-        return &table[i];
-      }
-    }
-    return NULL;
-  }
-
-  static ResourcesEntry* ResourceTable() {
-    return &__service_resources_[0];
-  }
-
-  DISALLOW_ALLOCATION();
-  DISALLOW_IMPLICIT_CONSTRUCTORS(Resources);
-};
-
-
 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);
   return reinterpret_cast<uint8_t*>(new_ptr);
 }
 
 
-static Dart_Port ExtractPort(Isolate* isolate, Dart_Handle receivePort) {
-  const ReceivePort& rp = Api::UnwrapReceivePortHandle(isolate, receivePort);
-  if (rp.IsNull()) {
-    return ILLEGAL_PORT;
-  }
-  return rp.Id();
-}
-
-
 // These must be kept in sync with service/constants.dart
 #define VM_SERVICE_ISOLATE_EXIT_MESSAGE_ID 0
 #define VM_SERVICE_ISOLATE_STARTUP_MESSAGE_ID 1
@@ -158,215 +80,6 @@
 bool ServiceIsolate::shutting_down_ = false;
 
 
-class RegisterRunningIsolatesVisitor : public IsolateVisitor {
- public:
-  explicit RegisterRunningIsolatesVisitor(Isolate* service_isolate)
-      : IsolateVisitor(),
-        register_function_(Function::Handle(service_isolate)),
-        service_isolate_(service_isolate) {
-    ASSERT(ServiceIsolate::IsServiceIsolate(Isolate::Current()));
-    // Get library.
-    const String& library_url = Symbols::DartVMService();
-    ASSERT(!library_url.IsNull());
-    const Library& library =
-        Library::Handle(Library::LookupLibrary(library_url));
-    ASSERT(!library.IsNull());
-    // Get function.
-    const String& function_name =
-        String::Handle(String::New("_registerIsolate"));
-    ASSERT(!function_name.IsNull());
-    register_function_ = library.LookupFunctionAllowPrivate(function_name);
-    ASSERT(!register_function_.IsNull());
-  }
-
-  virtual void VisitIsolate(Isolate* isolate) {
-    ASSERT(ServiceIsolate::IsServiceIsolate(Isolate::Current()));
-    if (ServiceIsolate::IsServiceIsolateDescendant(isolate) ||
-        (isolate == Dart::vm_isolate())) {
-      // We do not register the service (and descendants) or the vm-isolate.
-      return;
-    }
-    // Setup arguments for call.
-    Dart_Port port_id = isolate->main_port();
-    const Integer& port_int = Integer::Handle(Integer::New(port_id));
-    ASSERT(!port_int.IsNull());
-    const SendPort& send_port = SendPort::Handle(SendPort::New(port_id));
-    const String& name = String::Handle(String::New(isolate->name()));
-    ASSERT(!name.IsNull());
-    const Array& args = Array::Handle(Array::New(3));
-    ASSERT(!args.IsNull());
-    args.SetAt(0, port_int);
-    args.SetAt(1, send_port);
-    args.SetAt(2, name);
-    Object& r = Object::Handle(service_isolate_);
-    r = DartEntry::InvokeFunction(register_function_, args);
-    if (FLAG_trace_service) {
-      OS::Print("vm-service: Isolate %s %" Pd64 " registered.\n",
-                name.ToCString(),
-                port_id);
-    }
-    ASSERT(!r.IsError());
-  }
-
- private:
-  Function& register_function_;
-  Isolate* service_isolate_;
-};
-
-
-
-class ServiceIsolateNatives : public AllStatic {
- public:
-  static void SendIsolateServiceMessage(Dart_NativeArguments args) {
-    NativeArguments* arguments = reinterpret_cast<NativeArguments*>(args);
-    Isolate* isolate = arguments->thread()->isolate();
-    StackZone stack_zone(isolate);
-    Zone* zone = stack_zone.GetZone();  // Used by GET_NON_NULL_NATIVE_ARGUMENT.
-    HANDLESCOPE(isolate);
-    GET_NON_NULL_NATIVE_ARGUMENT(SendPort, sp, arguments->NativeArgAt(0));
-    GET_NON_NULL_NATIVE_ARGUMENT(Array, message, arguments->NativeArgAt(1));
-
-    // Set the type of the OOB message.
-    message.SetAt(0, Smi::Handle(isolate, Smi::New(Message::kServiceOOBMsg)));
-
-    // Serialize message.
-    uint8_t* data = NULL;
-    MessageWriter writer(&data, &allocator, false);
-    writer.WriteMessage(message);
-
-    // TODO(turnidge): Throw an exception when the return value is false?
-    bool result = PortMap::PostMessage(
-        new Message(sp.Id(), data, writer.BytesWritten(),
-                    Message::kOOBPriority));
-    arguments->SetReturn(Bool::Get(result));
-  }
-
-  static void SendRootServiceMessage(Dart_NativeArguments args) {
-    NativeArguments* arguments = reinterpret_cast<NativeArguments*>(args);
-    Isolate* isolate = arguments->thread()->isolate();
-    StackZone stack_zone(isolate);
-    Zone* zone = stack_zone.GetZone();  // Used by GET_NON_NULL_NATIVE_ARGUMENT.
-    HANDLESCOPE(isolate);
-    GET_NON_NULL_NATIVE_ARGUMENT(Array, message, arguments->NativeArgAt(0));
-    Service::HandleRootMessage(message);
-  }
-
-  static void OnStart(Dart_NativeArguments args) {
-    NativeArguments* arguments = reinterpret_cast<NativeArguments*>(args);
-    Isolate* isolate = arguments->thread()->isolate();
-    StackZone zone(isolate);
-    HANDLESCOPE(isolate);
-    {
-      if (FLAG_trace_service) {
-        OS::Print("vm-service: Booting dart:vmservice library.\n");
-      }
-      // Boot the dart:vmservice library.
-      Dart_EnterScope();
-      Dart_Handle url_str =
-          Dart_NewStringFromCString(Symbols::Name(Symbols::kDartVMServiceId));
-      Dart_Handle library = Dart_LookupLibrary(url_str);
-      ASSERT(Dart_IsLibrary(library));
-      Dart_Handle result =
-          Dart_Invoke(library, Dart_NewStringFromCString("boot"), 0, NULL);
-      ASSERT(!Dart_IsError(result));
-      Dart_Port port = ExtractPort(isolate, result);
-      ASSERT(port != ILLEGAL_PORT);
-      ServiceIsolate::SetServicePort(port);
-      Dart_ExitScope();
-    }
-
-    {
-      if (FLAG_trace_service) {
-        OS::Print("vm-service: Registering running isolates.\n");
-      }
-      // Register running isolates with service.
-      RegisterRunningIsolatesVisitor register_isolates(isolate);
-      Isolate::VisitIsolates(&register_isolates);
-    }
-  }
-
-  static void OnExit(Dart_NativeArguments args) {
-    NativeArguments* arguments = reinterpret_cast<NativeArguments*>(args);
-    Isolate* isolate = arguments->thread()->isolate();
-    StackZone zone(isolate);
-    HANDLESCOPE(isolate);
-    {
-      if (FLAG_trace_service) {
-        OS::Print("vm-service: processed exit message.\n");
-      }
-    }
-  }
-
-  static void ListenStream(Dart_NativeArguments args) {
-    NativeArguments* arguments = reinterpret_cast<NativeArguments*>(args);
-    Isolate* isolate = arguments->thread()->isolate();
-    StackZone stack_zone(isolate);
-    Zone* zone = stack_zone.GetZone();  // Used by GET_NON_NULL_NATIVE_ARGUMENT.
-    HANDLESCOPE(isolate);
-    GET_NON_NULL_NATIVE_ARGUMENT(String, stream_id, arguments->NativeArgAt(0));
-    bool result = Service::ListenStream(stream_id.ToCString());
-    arguments->SetReturn(Bool::Get(result));
-  }
-
-  static void CancelStream(Dart_NativeArguments args) {
-    NativeArguments* arguments = reinterpret_cast<NativeArguments*>(args);
-    Isolate* isolate = arguments->thread()->isolate();
-    StackZone stack_zone(isolate);
-    Zone* zone = stack_zone.GetZone();  // Used by GET_NON_NULL_NATIVE_ARGUMENT.
-    HANDLESCOPE(isolate);
-    GET_NON_NULL_NATIVE_ARGUMENT(String, stream_id, arguments->NativeArgAt(0));
-    Service::CancelStream(stream_id.ToCString());
-  }
-};
-
-
-struct ServiceNativeEntry {
-  const char* name;
-  int num_arguments;
-  Dart_NativeFunction function;
-};
-
-
-static ServiceNativeEntry _ServiceNativeEntries[] = {
-  {"VMService_SendIsolateServiceMessage", 2,
-    ServiceIsolateNatives::SendIsolateServiceMessage},
-  {"VMService_SendRootServiceMessage", 1,
-    ServiceIsolateNatives::SendRootServiceMessage},
-  {"VMService_OnStart", 0,
-    ServiceIsolateNatives::OnStart },
-  {"VMService_OnExit", 0,
-    ServiceIsolateNatives::OnExit },
-  {"VMService_ListenStream", 1,
-    ServiceIsolateNatives::ListenStream },
-  {"VMService_CancelStream", 1,
-    ServiceIsolateNatives::CancelStream },
-};
-
-
-static Dart_NativeFunction ServiceNativeResolver(Dart_Handle name,
-                                                 int num_arguments,
-                                                 bool* auto_setup_scope) {
-  const Object& obj = Object::Handle(Api::UnwrapHandle(name));
-  if (!obj.IsString()) {
-    return NULL;
-  }
-  const char* function_name = obj.ToCString();
-  ASSERT(function_name != NULL);
-  ASSERT(auto_setup_scope != NULL);
-  *auto_setup_scope = true;
-  intptr_t n = sizeof(_ServiceNativeEntries) /
-               sizeof(_ServiceNativeEntries[0]);
-  for (intptr_t i = 0; i < n; i++) {
-    ServiceNativeEntry entry = _ServiceNativeEntries[i];
-    if ((strcmp(function_name, entry.name) == 0) &&
-        (num_arguments == entry.num_arguments)) {
-      return entry.function;
-    }
-  }
-  return NULL;
-}
-
-
 bool ServiceIsolate::NameEquals(const char* name) {
   ASSERT(name != NULL);
   return strcmp(name, kName) == 0;
@@ -424,12 +137,13 @@
   if (!IsRunning()) {
     return false;
   }
-  Isolate* isolate = Isolate::Current();
+  Thread* thread = Thread::Current();
+  Isolate* isolate = thread->isolate();
   if (IsServiceIsolateDescendant(isolate)) {
     return false;
   }
   ASSERT(isolate != NULL);
-  HANDLESCOPE(isolate);
+  HANDLESCOPE(thread);
   const String& name = String::Handle(String::New(isolate->name()));
   ASSERT(!name.IsNull());
   const Array& list = Array::Handle(
@@ -455,12 +169,13 @@
   if (!IsRunning()) {
     return false;
   }
-  Isolate* isolate = Isolate::Current();
+  Thread* thread = Thread::Current();
+  Isolate* isolate = thread->isolate();
   if (IsServiceIsolateDescendant(isolate)) {
     return false;
   }
   ASSERT(isolate != NULL);
-  HANDLESCOPE(isolate);
+  HANDLESCOPE(thread);
   const String& name = String::Handle(String::New(isolate->name()));
   ASSERT(!name.IsNull());
   const Array& list = Array::Handle(
@@ -511,8 +226,6 @@
   if (isolate_ != NULL) {
     isolate_->is_service_isolate_ = true;
     origin_ = isolate_->origin_id();
-  } else {
-    origin_ = ILLEGAL_PORT;
   }
 }
 
@@ -522,10 +235,12 @@
 }
 
 
-void ServiceIsolate::MaybeInjectVMServiceLibrary(Isolate* isolate) {
-  ASSERT(isolate != NULL);
-  ASSERT(isolate->name() != NULL);
-  if (!ServiceIsolate::NameEquals(isolate->name())) {
+void ServiceIsolate::MaybeMakeServiceIsolate(Isolate* I) {
+  Thread* T = Thread::Current();
+  ASSERT(I == T->isolate());
+  ASSERT(I != NULL);
+  ASSERT(I->name() != NULL);
+  if (!ServiceIsolate::NameEquals(I->name())) {
     // Not service isolate.
     return;
   }
@@ -533,60 +248,22 @@
     // Service isolate already exists.
     return;
   }
-  SetServiceIsolate(isolate);
-
-  StackZone zone(isolate);
-  HANDLESCOPE(isolate);
-
-  // Register dart:vmservice library.
-  const String& url_str = String::Handle(Symbols::DartVMService().raw());
-  const Library& library = Library::Handle(Library::New(url_str));
-  library.Register();
-  library.set_native_entry_resolver(ServiceNativeResolver);
-
-  // Temporarily install our library tag handler.
-  isolate->set_library_tag_handler(LibraryTagHandler);
-
-  // Get script source.
-  const char* resource = NULL;
-  const char* path = "/vmservice.dart";
-  intptr_t r = Resources::ResourceLookup(path, &resource);
-  ASSERT(r != Resources::kNoSuchInstance);
-  ASSERT(resource != NULL);
-  const String& source_str = String::Handle(
-      String::FromUTF8(reinterpret_cast<const uint8_t*>(resource), r));
-  ASSERT(!source_str.IsNull());
-  const Script& script = Script::Handle(
-    isolate, Script::New(url_str, source_str, RawScript::kLibraryTag));
-
-  // Compile script.
-  Dart_EnterScope();  // Need to enter scope for tag handler.
-  library.SetLoadInProgress();
-  const Error& error = Error::Handle(isolate,
-                                     Compiler::Compile(library, script));
-  if (!error.IsNull()) {
-    OS::PrintErr("vm-service: Isolate creation error: %s\n",
-          error.ToErrorCString());
-  }
-  ASSERT(error.IsNull());
-  Dart_Handle result = Dart_FinalizeLoading(false);
-  ASSERT(!Dart_IsError(result));
-  Dart_ExitScope();
-
-  // Uninstall our library tag handler.
-  isolate->set_library_tag_handler(NULL);
+  SetServiceIsolate(I);
 }
 
 
-void ServiceIsolate::ConstructExitMessageAndCache(Isolate* isolate) {
+void ServiceIsolate::ConstructExitMessageAndCache(Isolate* I) {
   // Construct and cache exit message here so we can send it without needing an
   // isolate.
-  StartIsolateScope iso_scope(isolate);
-  StackZone zone(isolate);
-  HANDLESCOPE(isolate);
+  StartIsolateScope iso_scope(I);
+  Thread* T = Thread::Current();
+  ASSERT(I == T->isolate());
+  ASSERT(I != NULL);
+  StackZone zone(T);
+  HANDLESCOPE(T);
   ASSERT(exit_message_ == NULL);
   ASSERT(exit_message_length_ == 0);
-  const Array& list = Array::Handle(MakeServiceExitMessage());
+  const Array& list = Array::Handle(Z, MakeServiceExitMessage());
   ASSERT(!list.IsNull());
   MessageWriter writer(&exit_message_, &allocator, false);
   writer.WriteMessage(list);
@@ -614,6 +291,8 @@
  public:
   virtual void Run() {
     ASSERT(Isolate::Current() == NULL);
+    TimelineDurationScope tds(Timeline::GetVMStream(),
+                              "ServiceIsolateStartup");
     char* error = NULL;
     Isolate* isolate = NULL;
 
@@ -634,6 +313,7 @@
         reinterpret_cast<Isolate*>(create_callback(ServiceIsolate::kName,
                                                    NULL,
                                                    NULL,
+                                                   NULL,
                                                    &api_flags,
                                                    NULL,
                                                    &error));
@@ -643,7 +323,6 @@
       return;
     }
 
-    isolate->RemoveTimelineEventRecorder();
 
     Thread::ExitIsolate();
 
@@ -661,41 +340,45 @@
 
  protected:
   static void ShutdownIsolate(uword parameter) {
-    Isolate* isolate = reinterpret_cast<Isolate*>(parameter);
-    ASSERT(ServiceIsolate::IsServiceIsolate(isolate));
+    Isolate* I = reinterpret_cast<Isolate*>(parameter);
+    ASSERT(ServiceIsolate::IsServiceIsolate(I));
+    ServiceIsolate::SetServiceIsolate(NULL);
+    ServiceIsolate::SetServicePort(ILLEGAL_PORT);
     {
       // Print the error if there is one.  This may execute dart code to
       // print the exception object, so we need to use a StartIsolateScope.
-      StartIsolateScope start_scope(isolate);
-      StackZone zone(isolate);
-      HandleScope handle_scope(isolate);
-      Error& error = Error::Handle();
-      error = isolate->object_store()->sticky_error();
-      if (!error.IsNull()) {
+      StartIsolateScope start_scope(I);
+      Thread* T = Thread::Current();
+      ASSERT(I == T->isolate());
+      StackZone zone(T);
+      HandleScope handle_scope(T);
+      Error& error = Error::Handle(Z);
+      error = I->object_store()->sticky_error();
+      if (!error.IsNull() && !error.IsUnwindError()) {
         OS::PrintErr("vm-service: Error: %s\n", error.ToErrorCString());
       }
       Dart::RunShutdownCallback();
     }
     {
       // Shut the isolate down.
-      SwitchIsolateScope switch_scope(isolate);
+      SwitchIsolateScope switch_scope(I);
       Dart::ShutdownIsolate();
     }
-    ServiceIsolate::SetServiceIsolate(NULL);
-    ServiceIsolate::SetServicePort(ILLEGAL_PORT);
     if (FLAG_trace_service) {
       OS::Print("vm-service: Shutdown.\n");
     }
     ServiceIsolate::FinishedExiting();
   }
 
-  void RunMain(Isolate* isolate) {
-    StartIsolateScope iso_scope(isolate);
-    StackZone zone(isolate);
-    HANDLESCOPE(isolate);
+  void RunMain(Isolate* I) {
+    StartIsolateScope iso_scope(I);
+    Thread* T = Thread::Current();
+    ASSERT(I == T->isolate());
+    StackZone zone(T);
+    HANDLESCOPE(T);
     // Invoke main which will return the loadScriptPort.
-    const Library& root_library =
-        Library::Handle(isolate, isolate->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.");
@@ -704,11 +387,10 @@
       return;
     }
     ASSERT(!root_library.IsNull());
-    const String& entry_name = String::Handle(isolate, String::New("main"));
+    const String& entry_name = String::Handle(Z, String::New("main"));
     ASSERT(!entry_name.IsNull());
-    const Function& entry =
-        Function::Handle(isolate,
-                         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) {
@@ -717,10 +399,8 @@
       return;
     }
     ASSERT(!entry.IsNull());
-    const Object& result =
-        Object::Handle(isolate,
-                       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.
@@ -749,8 +429,33 @@
 }
 
 
+void ServiceIsolate::KillServiceIsolate() {
+  if (!FLAG_shutdown) {
+    return;
+  }
+  {
+    MonitorLocker ml(monitor_);
+    shutting_down_ = true;
+  }
+  Isolate::KillIfExists(isolate_, Isolate::kInternalKillMsg);
+  {
+    MonitorLocker ml(monitor_);
+    while (shutting_down_) {
+      ml.Wait();
+    }
+  }
+}
+
+
 void ServiceIsolate::Shutdown() {
   if (!IsRunning()) {
+    if (isolate_ != NULL) {
+      // TODO(johnmccutchan,turnidge) When it is possible to properly create
+      // the VMService object and set up its shutdown handler in the service
+      // isolate's main() function, this case will no longer be possible and
+      // can be removed.
+      KillServiceIsolate();
+    }
     return;
   }
   {
@@ -767,50 +472,25 @@
 }
 
 
-Dart_Handle ServiceIsolate::GetSource(const char* name) {
-  ASSERT(name != NULL);
-  int i = 0;
-  while (true) {
-    const char* path = Resources::Path(i);
-    if (path == NULL) {
-      break;
-    }
-    ASSERT(*path != '\0');
-    // Skip the '/'.
-    path++;
-    if (strcmp(name, path) == 0) {
-      const uint8_t* str = Resources::Resource(i);
-      intptr_t length = Resources::Length(i);
-      return Dart_NewStringFromUTF8(str, length);
-    }
-    i++;
+void ServiceIsolate::BootVmServiceLibrary() {
+  const Library& vmservice_library =
+      Library::Handle(Library::LookupLibrary(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));
+  ASSERT(!boot_function.IsNull());
+  const Object& result =
+      Object::Handle(
+          DartEntry::InvokeFunction(boot_function, Object::empty_array()));
+  ASSERT(!result.IsNull());
+  Dart_Port port = ILLEGAL_PORT;
+  if (result.IsReceivePort()) {
+    port = ReceivePort::Cast(result).Id();
   }
-  FATAL1("vm-service: Could not find embedded source file: %s ", name);
-  return Dart_Null();
-}
-
-
-Dart_Handle ServiceIsolate::LibraryTagHandler(Dart_LibraryTag tag,
-                                              Dart_Handle library,
-                                              Dart_Handle url) {
-  if (tag == Dart_kCanonicalizeUrl) {
-    // url is already canonicalized.
-    return url;
-  }
-  if (tag != Dart_kSourceTag) {
-    FATAL("ServiceIsolate::LibraryTagHandler encountered an unexpected tag.");
-  }
-  ASSERT(tag == Dart_kSourceTag);
-  const char* url_string = NULL;
-  Dart_Handle result = Dart_StringToCString(url, &url_string);
-  if (Dart_IsError(result)) {
-    return result;
-  }
-  Dart_Handle source = GetSource(url_string);
-  if (Dart_IsError(source)) {
-    return source;
-  }
-  return Dart_LoadSource(library, url, source, 0, 0);
+  ASSERT(port != ILLEGAL_PORT);
+  ServiceIsolate::SetServicePort(port);
 }
 
 }  // namespace dart
diff --git a/runtime/vm/service_isolate.h b/runtime/vm/service_isolate.h
index fbcd136..a942ec1 100644
--- a/runtime/vm/service_isolate.h
+++ b/runtime/vm/service_isolate.h
@@ -32,6 +32,11 @@
   static void SendServiceExitMessage();
   static void Shutdown();
 
+  static void BootVmServiceLibrary();
+
+ private:
+  static void KillServiceIsolate();
+
  protected:
   static void SetServicePort(Dart_Port port);
   static void SetServiceIsolate(Isolate* isolate);
@@ -39,15 +44,11 @@
   static void ConstructExitMessageAndCache(Isolate* isolate);
   static void FinishedExiting();
   static void FinishedInitializing();
-  static void MaybeInjectVMServiceLibrary(Isolate* isolate);
+  static void MaybeMakeServiceIsolate(Isolate* isolate);
   static Dart_IsolateCreateCallback create_callback() {
     return create_callback_;
   }
 
-  static Dart_Handle GetSource(const char* name);
-  static Dart_Handle LibraryTagHandler(Dart_LibraryTag tag, Dart_Handle library,
-                                       Dart_Handle url);
-
   static Dart_IsolateCreateCallback create_callback_;
   static uint8_t* exit_message_;
   static intptr_t exit_message_length_;
diff --git a/runtime/vm/service_test.cc b/runtime/vm/service_test.cc
index 310305a..de6a0d8 100644
--- a/runtime/vm/service_test.cc
+++ b/runtime/vm/service_test.cc
@@ -29,21 +29,19 @@
     free(_msg);
   }
 
-  bool HandleMessage(Message* message) {
+  MessageStatus HandleMessage(Message* message) {
     if (_msg != NULL) {
       free(_msg);
     }
 
     // Parse the message.
-    MessageSnapshotReader reader(message->data(),
-                                 message->len(),
-                                 Isolate::Current(),
-                                 Thread::Current()->zone());
+    Thread* thread = Thread::Current();
+    MessageSnapshotReader reader(message->data(), message->len(), thread);
     const Object& response_obj = Object::Handle(reader.ReadObject());
     String& response = String::Handle();
     response ^= response_obj.raw();
     _msg = strdup(response.ToCString());
-    return true;
+    return kOK;
   }
 
   const char* msg() const { return _msg; }
@@ -57,9 +55,9 @@
   const String& dummy_isolate_id = String::Handle(String::New("isolateId"));
   Dart_Handle expr_val = Dart_EvaluateExpr(lib, NewString(expr));
   EXPECT_VALID(expr_val);
-  Isolate* isolate = Isolate::Current();
+  Zone* zone = Thread::Current()->zone();
   const GrowableObjectArray& value =
-      Api::UnwrapGrowableObjectArrayHandle(isolate, expr_val);
+      Api::UnwrapGrowableObjectArrayHandle(zone, expr_val);
   const Array& result = Array::Handle(Array::MakeArray(value));
   GrowableObjectArray& growable = GrowableObjectArray::Handle();
   growable ^= result.At(4);
@@ -109,18 +107,20 @@
 
 
 TEST_CASE(Service_IdZones) {
-  Isolate* isolate = Isolate::Current();
+  Zone* zone = thread->zone();
+  Isolate* isolate = thread->isolate();
   ObjectIdRing* ring = isolate->object_id_ring();
 
-  const String& test_a = String::Handle(isolate, String::New("a"));
-  const String& test_b = String::Handle(isolate, String::New("b"));
-  const String& test_c = String::Handle(isolate, String::New("c"));
-  const String& test_d = String::Handle(isolate, String::New("d"));
+  const String& test_a = String::Handle(zone, String::New("a"));
+  const String& test_b = String::Handle(zone, String::New("b"));
+  const String& test_c = String::Handle(zone, String::New("c"));
+  const String& test_d = String::Handle(zone, String::New("d"));
 
   // Both RingServiceIdZones share the same backing store and id space.
 
   // Always allocate a new id.
-  RingServiceIdZone always_new_zone(ring, ObjectIdRing::kAllocateId);
+  RingServiceIdZone always_new_zone;
+  always_new_zone.Init(ring, ObjectIdRing::kAllocateId);
   EXPECT_STREQ("objects/0", always_new_zone.GetServiceId(test_a));
   EXPECT_STREQ("objects/1", always_new_zone.GetServiceId(test_a));
   EXPECT_STREQ("objects/2", always_new_zone.GetServiceId(test_a));
@@ -128,7 +128,8 @@
   EXPECT_STREQ("objects/4", always_new_zone.GetServiceId(test_c));
 
   // Reuse an existing id or allocate a new id.
-  RingServiceIdZone reuse_zone(ring, ObjectIdRing::kReuseId);
+  RingServiceIdZone reuse_zone;
+  reuse_zone.Init(ring, ObjectIdRing::kReuseId);
   EXPECT_STREQ("objects/0", reuse_zone.GetServiceId(test_a));
   EXPECT_STREQ("objects/0", reuse_zone.GetServiceId(test_a));
   EXPECT_STREQ("objects/3", reuse_zone.GetServiceId(test_b));
@@ -191,7 +192,7 @@
   service_msg =
       Eval(lib, "[0, port, '0', 'getObject', ['objectId'], ['code/0']]");
   Service::HandleIsolateMessage(isolate, service_msg);
-  handler.HandleNextMessage();
+  EXPECT_EQ(MessageHandler::kOK, handler.HandleNextMessage());
   EXPECT_SUBSTRING("\"error\"", handler.msg());
 
   // The following test checks that a code object can be found only
@@ -201,7 +202,7 @@
                       compile_timestamp,
                       entry);
   Service::HandleIsolateMessage(isolate, service_msg);
-  handler.HandleNextMessage();
+  EXPECT_EQ(MessageHandler::kOK, handler.HandleNextMessage());
   EXPECT_SUBSTRING("\"type\":\"Code\"", handler.msg());
   {
     // Only perform a partial match.
@@ -222,7 +223,7 @@
                       compile_timestamp,
                       address);
   Service::HandleIsolateMessage(isolate, service_msg);
-  handler.HandleNextMessage();
+  EXPECT_EQ(MessageHandler::kOK, handler.HandleNextMessage());
   EXPECT_SUBSTRING("\"error\"", handler.msg());
 
   // Request code object at (compile_timestamp - 1)-code.EntryPoint()
@@ -233,7 +234,7 @@
                       compile_timestamp - 1,
                       address);
   Service::HandleIsolateMessage(isolate, service_msg);
-  handler.HandleNextMessage();
+  EXPECT_EQ(MessageHandler::kOK, handler.HandleNextMessage());
   EXPECT_SUBSTRING("\"error\"", handler.msg());
 
   // Request native code at address. Expect the null code object back.
@@ -242,7 +243,7 @@
                       "['objectId'], ['code/native-%" Px "']]",
                       address);
   Service::HandleIsolateMessage(isolate, service_msg);
-  handler.HandleNextMessage();
+  EXPECT_EQ(MessageHandler::kOK, handler.HandleNextMessage());
   // TODO(turnidge): It is pretty broken to return an Instance here.  Fix.
   EXPECT_SUBSTRING("\"kind\":\"Null\"",
                    handler.msg());
@@ -252,7 +253,7 @@
                       "['code/native%" Px "']]",
                       address);
   Service::HandleIsolateMessage(isolate, service_msg);
-  handler.HandleNextMessage();
+  EXPECT_EQ(MessageHandler::kOK, handler.HandleNextMessage());
   EXPECT_SUBSTRING("\"error\"", handler.msg());
 }
 
@@ -295,7 +296,7 @@
   service_msg = EvalF(lib, "[0, port, '0', 'getObject', "
                       "['objectId'], ['objects/%" Pd "']]", id);
   Service::HandleIsolateMessage(isolate, service_msg);
-  handler.HandleNextMessage();
+  EXPECT_EQ(MessageHandler::kOK, handler.HandleNextMessage());
 
   // Check type.
   EXPECT_SUBSTRING("\"type\":\"Object\"", handler.msg());
@@ -357,7 +358,7 @@
   service_msg = EvalF(lib, "[0, port, '0', 'getObject', "
                       "['objectId'], ['objects/%" Pd "']]", id);
   Service::HandleIsolateMessage(isolate, service_msg);
-  handler.HandleNextMessage();
+  EXPECT_EQ(MessageHandler::kOK, handler.HandleNextMessage());
   // Check type.
   EXPECT_SUBSTRING("\"type\":\"Object\"", handler.msg());
   EXPECT_SUBSTRING("\"_vmType\":\"PcDescriptors\"", handler.msg());
@@ -418,7 +419,7 @@
   service_msg = EvalF(lib, "[0, port, '0', 'getObject', "
                       "['objectId'], ['objects/%" Pd "']]", id);
   Service::HandleIsolateMessage(isolate, service_msg);
-  handler.HandleNextMessage();
+  EXPECT_EQ(MessageHandler::kOK, handler.HandleNextMessage());
   // Check type.
   EXPECT_SUBSTRING("\"type\":\"Object\"", handler.msg());
   EXPECT_SUBSTRING("\"_vmType\":\"LocalVarDescriptors\"", handler.msg());
@@ -463,7 +464,7 @@
                 addr);
     service_msg = Eval(lib, buf);
     Service::HandleIsolateMessage(isolate, service_msg);
-    handler.HandleNextMessage();
+    EXPECT_EQ(MessageHandler::kOK, handler.HandleNextMessage());
     EXPECT_SUBSTRING(ref ? "\"type\":\"@Instance\"" :
                            "\"type\":\"Instance\"",
                      handler.msg());
@@ -474,7 +475,7 @@
   service_msg = Eval(lib, "[0, port, '0', '_getObjectByAddress', "
                      "['address'], ['7']]");
   Service::HandleIsolateMessage(isolate, service_msg);
-  handler.HandleNextMessage();
+  EXPECT_EQ(MessageHandler::kOK, handler.HandleNextMessage());
   // TODO(turnidge): Should this be a ServiceException instead?
   EXPECT_SUBSTRING("{\"type\":\"Sentinel\",\"kind\":\"Free\","
                    "\"valueAsString\":\"<free>\"",
@@ -532,12 +533,12 @@
   Array& service_msg = Array::Handle();
   service_msg = Eval(lib, "[0, port, '\"', 'alpha', [], []]");
   Service::HandleRootMessage(service_msg);
-  handler.HandleNextMessage();
+  EXPECT_EQ(MessageHandler::kOK, handler.HandleNextMessage());
   EXPECT_STREQ("{\"jsonrpc\":\"2.0\", \"result\":alpha,\"id\":\"\\\"\"}",
                handler.msg());
   service_msg = Eval(lib, "[0, port, 1, 'beta', [], []]");
   Service::HandleRootMessage(service_msg);
-  handler.HandleNextMessage();
+  EXPECT_EQ(MessageHandler::kOK, handler.HandleNextMessage());
   EXPECT_STREQ("{\"jsonrpc\":\"2.0\", \"result\":beta,\"id\":1}",
                handler.msg());
 }
@@ -572,12 +573,12 @@
   Array& service_msg = Array::Handle();
   service_msg = Eval(lib, "[0, port, '0', 'alpha', [], []]");
   Service::HandleIsolateMessage(isolate, service_msg);
-  handler.HandleNextMessage();
+  EXPECT_EQ(MessageHandler::kOK, handler.HandleNextMessage());
   EXPECT_STREQ("{\"jsonrpc\":\"2.0\", \"result\":alpha,\"id\":\"0\"}",
                handler.msg());
   service_msg = Eval(lib, "[0, port, '0', 'beta', [], []]");
   Service::HandleIsolateMessage(isolate, service_msg);
-  handler.HandleNextMessage();
+  EXPECT_EQ(MessageHandler::kOK, handler.HandleNextMessage());
   EXPECT_STREQ("{\"jsonrpc\":\"2.0\", \"result\":beta,\"id\":\"0\"}",
                handler.msg());
 }
@@ -611,21 +612,21 @@
   Array& service_msg = Array::Handle();
   service_msg = Eval(lib, "[0, port, '0', '_getCpuProfile', [], []]");
   Service::HandleIsolateMessage(isolate, service_msg);
-  handler.HandleNextMessage();
+  EXPECT_EQ(MessageHandler::kOK, handler.HandleNextMessage());
   // Expect error (tags required).
   EXPECT_SUBSTRING("\"error\"", handler.msg());
 
   service_msg =
       Eval(lib, "[0, port, '0', '_getCpuProfile', ['tags'], ['None']]");
   Service::HandleIsolateMessage(isolate, service_msg);
-  handler.HandleNextMessage();
+  EXPECT_EQ(MessageHandler::kOK, handler.HandleNextMessage());
   // Expect profile
   EXPECT_SUBSTRING("\"type\":\"_CpuProfile\"", handler.msg());
 
   service_msg =
       Eval(lib, "[0, port, '0', '_getCpuProfile', ['tags'], ['Bogus']]");
   Service::HandleIsolateMessage(isolate, service_msg);
-  handler.HandleNextMessage();
+  EXPECT_EQ(MessageHandler::kOK, handler.HandleNextMessage());
   // Expect error.
   EXPECT_SUBSTRING("\"error\"", handler.msg());
 }
diff --git a/runtime/vm/simulator_arm.cc b/runtime/vm/simulator_arm.cc
index 45ae49a..5419aaa 100644
--- a/runtime/vm/simulator_arm.cc
+++ b/runtime/vm/simulator_arm.cc
@@ -1578,6 +1578,7 @@
             set_register(R1, r1);
           }
         } else if (redirection->call_kind() == kBootstrapNativeCall) {
+          ASSERT(redirection->argument_count() == 1);
           NativeArguments* arguments;
           arguments = reinterpret_cast<NativeArguments*>(get_register(R0));
           SimulatorBootstrapNativeCall target =
@@ -3867,7 +3868,7 @@
   set_register(FP, static_cast<int32_t>(fp));
   set_register(THR, reinterpret_cast<uword>(thread));
   // Set the tag.
-  isolate->set_vm_tag(VMTag::kDartTagId);
+  thread->set_vm_tag(VMTag::kDartTagId);
   // Clear top exit frame.
   isolate->set_top_exit_frame_info(0);
 
diff --git a/runtime/vm/simulator_arm.h b/runtime/vm/simulator_arm.h
index 5e0d1ed..3976c0c 100644
--- a/runtime/vm/simulator_arm.h
+++ b/runtime/vm/simulator_arm.h
@@ -88,7 +88,7 @@
   // Call on program start.
   static void InitOnce();
 
-  // Dart generally calls into generated code with 5 parameters. This is a
+  // Dart generally calls into generated code with 4 parameters. This is a
   // convenience function, which sets up the simulator state and grabs the
   // result on return. When fp_return is true the return value is the D0
   // floating point register. Otherwise, the return value is R1:R0.
diff --git a/runtime/vm/simulator_arm64.cc b/runtime/vm/simulator_arm64.cc
index 9663fdc..ac6fe18 100644
--- a/runtime/vm/simulator_arm64.cc
+++ b/runtime/vm/simulator_arm64.cc
@@ -1626,6 +1626,7 @@
       set_vregisterd(V0, 0, bit_cast<int64_t, double>(res));
       set_vregisterd(V0, 1, 0);
     } else if (redirection->call_kind() == kBootstrapNativeCall) {
+      ASSERT(redirection->argument_count() == 1);
       NativeArguments* arguments;
       arguments = reinterpret_cast<NativeArguments*>(get_register(R0));
       SimulatorBootstrapNativeCall target =
@@ -3527,7 +3528,7 @@
   set_register(NULL, FP, static_cast<int64_t>(fp));
   set_register(NULL, THR, reinterpret_cast<int64_t>(thread));
   // Set the tag.
-  isolate->set_vm_tag(VMTag::kDartTagId);
+  thread->set_vm_tag(VMTag::kDartTagId);
   // Clear top exit frame.
   isolate->set_top_exit_frame_info(0);
 
diff --git a/runtime/vm/simulator_arm64.h b/runtime/vm/simulator_arm64.h
index ceecb49..d23e83b 100644
--- a/runtime/vm/simulator_arm64.h
+++ b/runtime/vm/simulator_arm64.h
@@ -85,7 +85,7 @@
   // Call on program start.
   static void InitOnce();
 
-  // Dart generally calls into generated code with 5 parameters. This is a
+  // Dart generally calls into generated code with 4 parameters. This is a
   // convenience function, which sets up the simulator state and grabs the
   // result on return. The return value is R0. The parameters are placed in
   // R0-3.
diff --git a/runtime/vm/simulator_mips.cc b/runtime/vm/simulator_mips.cc
index fdcdcf2..a6bd8de 100644
--- a/runtime/vm/simulator_mips.cc
+++ b/runtime/vm/simulator_mips.cc
@@ -1268,6 +1268,7 @@
         d0 = target(d6, d7);
         set_fregister_double(F0, d0);
       } else if (redirection->call_kind() == kBootstrapNativeCall) {
+        ASSERT(redirection->argument_count() == 1);
         NativeArguments* arguments;
         arguments = reinterpret_cast<NativeArguments*>(get_register(A0));
         SimulatorBootstrapNativeCall target =
@@ -2475,7 +2476,7 @@
   set_register(FP, static_cast<int32_t>(fp));
   set_register(THR, reinterpret_cast<int32_t>(thread));
   // Set the tag.
-  isolate->set_vm_tag(VMTag::kDartTagId);
+  thread->set_vm_tag(VMTag::kDartTagId);
   // Clear top exit frame.
   isolate->set_top_exit_frame_info(0);
 
diff --git a/runtime/vm/simulator_mips.h b/runtime/vm/simulator_mips.h
index 4243072..b4807bf 100644
--- a/runtime/vm/simulator_mips.h
+++ b/runtime/vm/simulator_mips.h
@@ -104,7 +104,7 @@
   // Call on program start.
   static void InitOnce();
 
-  // Dart generally calls into generated code with 5 parameters. This is a
+  // Dart generally calls into generated code with 4 parameters. This is a
   // convenience function, which sets up the simulator state and grabs the
   // result on return. When fp_return is true the return value is the D0
   // floating point register. Otherwise, the return value is V1:V0.
diff --git a/runtime/vm/snapshot.cc b/runtime/vm/snapshot.cc
index 4b92acd..d496aaa 100644
--- a/runtime/vm/snapshot.cc
+++ b/runtime/vm/snapshot.cc
@@ -16,6 +16,7 @@
 #include "vm/object.h"
 #include "vm/object_store.h"
 #include "vm/snapshot_ids.h"
+#include "vm/stub_code.h"
 #include "vm/symbols.h"
 #include "vm/verified_memory.h"
 #include "vm/version.h"
@@ -23,7 +24,7 @@
 // We currently only expect the Dart mutator to read snapshots.
 #define ASSERT_NO_SAFEPOINT_SCOPE()                            \
     isolate()->AssertCurrentThreadIsMutator();                 \
-    ASSERT(Thread::Current()->no_safepoint_scope_depth() != 0)
+    ASSERT(thread()->no_safepoint_scope_depth() != 0)
 
 namespace dart {
 
@@ -64,6 +65,7 @@
   return class_id >= kNumPredefinedCids ||
          class_id == kArrayCid ||
          class_id == kImmutableArrayCid ||
+         class_id == kObjectPoolCid ||
          RawObject::IsImplicitFieldClassId(class_id);
 }
 
@@ -171,34 +173,43 @@
 SnapshotReader::SnapshotReader(
     const uint8_t* buffer,
     intptr_t size,
+    const uint8_t* instructions_buffer,
     Snapshot::Kind kind,
     ZoneGrowableArray<BackRefNode>* backward_refs,
-    Isolate* isolate,
-    Zone* zone)
+    Thread* thread)
     : BaseReader(buffer, size),
+      instructions_buffer_(instructions_buffer),
       kind_(kind),
-      isolate_(isolate),
-      zone_(zone),
-      heap_(isolate->heap()),
-      old_space_(isolate->heap()->old_space()),
-      cls_(Class::Handle(isolate)),
-      obj_(Object::Handle(isolate)),
-      pobj_(PassiveObject::Handle(isolate)),
-      array_(Array::Handle(isolate)),
-      field_(Field::Handle(isolate)),
-      str_(String::Handle(isolate)),
-      library_(Library::Handle(isolate)),
-      type_(AbstractType::Handle(isolate)),
-      type_arguments_(TypeArguments::Handle(isolate)),
-      tokens_(Array::Handle(isolate)),
-      stream_(TokenStream::Handle(isolate)),
-      data_(ExternalTypedData::Handle(isolate)),
-      typed_data_(TypedData::Handle(isolate)),
-      error_(UnhandledException::Handle(isolate)),
+      snapshot_code_(instructions_buffer != NULL),
+      thread_(thread),
+      zone_(thread->zone()),
+      heap_(isolate()->heap()),
+      old_space_(thread_->isolate()->heap()->old_space()),
+      cls_(Class::Handle(zone_)),
+      obj_(Object::Handle(zone_)),
+      pobj_(PassiveObject::Handle(zone_)),
+      array_(Array::Handle(zone_)),
+      field_(Field::Handle(zone_)),
+      str_(String::Handle(zone_)),
+      library_(Library::Handle(zone_)),
+      type_(AbstractType::Handle(zone_)),
+      type_arguments_(TypeArguments::Handle(zone_)),
+      tokens_(Array::Handle(zone_)),
+      stream_(TokenStream::Handle(zone_)),
+      data_(ExternalTypedData::Handle(zone_)),
+      typed_data_(TypedData::Handle(zone_)),
+      code_(Code::Handle(zone_)),
+      function_(Function::Handle(zone_)),
+      megamorphic_cache_(MegamorphicCache::Handle(zone_)),
+      error_(UnhandledException::Handle(zone_)),
       max_vm_isolate_object_id_(
           (kind == Snapshot::kFull) ?
               Object::vm_isolate_snapshot_object_table().Length() : 0),
-      backward_references_(backward_refs) {
+      backward_references_(backward_refs),
+      instructions_reader_(NULL) {
+  if (instructions_buffer != NULL) {
+    instructions_reader_ = new InstructionsReader(instructions_buffer);
+  }
 }
 
 
@@ -207,7 +218,7 @@
   LongJumpScope jump;
   if (setjmp(*jump.Set()) == 0) {
     PassiveObject& obj =
-        PassiveObject::Handle(isolate(), ReadObjectImpl(kAsInlinedObject));
+        PassiveObject::Handle(zone(), ReadObjectImpl(kAsInlinedObject));
     for (intptr_t i = 0; i < backward_references_->length(); i++) {
       if (!(*backward_references_)[i].is_deserialized()) {
         ReadObjectImpl(kAsInlinedObject);
@@ -249,18 +260,55 @@
   if (cls.IsNull()) {
     SetReadException("Invalid object found in message.");
   }
-  cls.EnsureIsFinalized(isolate());
+  cls.EnsureIsFinalized(thread());
   return cls.raw();
 }
 
 
+RawFunction* SnapshotReader::ReadFunctionId(intptr_t object_id) {
+  ASSERT(kind_ == Snapshot::kScript);
+  // Read the function header information and lookup the function.
+  intptr_t func_header = Read<int32_t>();
+  ASSERT((func_header & kSmiTagMask) != kSmiTag);
+  ASSERT(!IsVMIsolateObject(func_header) ||
+         !IsSingletonClassId(GetVMIsolateObjectId(func_header)));
+  ASSERT((SerializedHeaderTag::decode(func_header) != kObjectId) ||
+         !IsObjectStoreClassId(SerializedHeaderData::decode(func_header)));
+  Function& func = Function::ZoneHandle(zone(), Function::null());
+  AddBackRef(object_id, &func, kIsDeserialized);
+  // Read the library/class/function information and lookup the function.
+  str_ ^= ReadObjectImpl(func_header, kAsInlinedObject, kInvalidPatchIndex, 0);
+  library_ = Library::LookupLibrary(str_);
+  if (library_.IsNull() || !library_.Loaded()) {
+    SetReadException("Expected a library name, but found an invalid name.");
+  }
+  str_ ^= ReadObjectImpl(kAsInlinedObject);
+  if (str_.Equals(Symbols::TopLevel(), 0, Symbols::TopLevel().Length())) {
+    str_ ^= ReadObjectImpl(kAsInlinedObject);
+    func ^= library_.LookupLocalFunction(str_);
+  } else {
+    cls_ = library_.LookupClass(str_);
+    if (cls_.IsNull()) {
+      SetReadException("Expected a class name, but found an invalid name.");
+    }
+    cls_.EnsureIsFinalized(thread());
+    str_ ^= ReadObjectImpl(kAsInlinedObject);
+    func ^= cls_.LookupFunctionAllowPrivate(str_);
+  }
+  if (func.IsNull()) {
+    SetReadException("Expected a function name, but found an invalid name.");
+  }
+  return func.raw();
+}
+
+
 RawObject* SnapshotReader::ReadStaticImplicitClosure(intptr_t object_id,
                                                      intptr_t class_header) {
-  ASSERT(kind_ == Snapshot::kMessage);
+  ASSERT(kind_ != Snapshot::kFull);
 
   // First create a function object and associate it with the specified
   // 'object_id'.
-  Function& func = Function::Handle(isolate(), Function::null());
+  Function& func = Function::Handle(zone(), Function::null());
   Instance& obj = Instance::ZoneHandle(zone(), Instance::null());
   AddBackRef(object_id, &obj, kIsDeserialized);
 
@@ -280,7 +328,7 @@
       OS::Print("Name of class not found %s\n", str_.ToCString());
       SetReadException("Invalid Class object found in message.");
     }
-    cls_.EnsureIsFinalized(isolate());
+    cls_.EnsureIsFinalized(thread());
     str_ ^= ReadObjectImpl(kAsInlinedObject);
     func = cls_.LookupFunctionAllowPrivate(str_);
   }
@@ -303,20 +351,19 @@
 
 
 void SnapshotReader::SetReadException(const char* msg) {
-  Isolate* isolate = Isolate::Current();
-  const String& error_str = String::Handle(isolate, String::New(msg));
-  const Array& args = Array::Handle(isolate, Array::New(1));
+  const String& error_str = String::Handle(zone(), String::New(msg));
+  const Array& args = Array::Handle(zone(), Array::New(1));
   args.SetAt(0, error_str);
-  Object& result = Object::Handle(isolate);
-  const Library& library = Library::Handle(isolate, Library::CoreLibrary());
+  Object& result = Object::Handle(zone());
+  const Library& library = Library::Handle(zone(), Library::CoreLibrary());
   result = DartLibraryCalls::InstanceCreate(library,
                                             Symbols::ArgumentError(),
                                             Symbols::Dot(),
                                             args);
-  const Stacktrace& stacktrace = Stacktrace::Handle(isolate);
+  const Stacktrace& stacktrace = Stacktrace::Handle(zone());
   const UnhandledException& error = UnhandledException::Handle(
-      isolate, UnhandledException::New(Instance::Cast(result), stacktrace));
-  isolate->long_jump_base()->Jump(1, error);
+      zone(), UnhandledException::New(Instance::Cast(result), stacktrace));
+  thread()->long_jump_base()->Jump(1, error);
 }
 
 
@@ -326,7 +373,7 @@
 
 
 bool SnapshotReader::is_vm_isolate() const {
-  return isolate_ == Dart::vm_isolate();
+  return isolate() == Dart::vm_isolate();
 }
 
 
@@ -438,12 +485,22 @@
 
     return array.raw();
   }
+  if (class_id == kObjectPoolCid) {
+    ASSERT(kind_ == Snapshot::kFull);
+    // Read the length and allocate an object based on the len.
+    intptr_t len = Read<intptr_t>();
+    ObjectPool& pool = ObjectPool::ZoneHandle(zone(),
+                                              NewObjectPool(len));
+    AddBackRef(object_id, &pool, kIsNotDeserialized);
+
+    return pool.raw();
+  }
 
   // For all other internal VM classes we read the object inline.
   switch (class_id) {
 #define SNAPSHOT_READ(clazz)                                                   \
     case clazz::kClassId: {                                                    \
-      pobj_ = clazz::ReadFrom(this, object_id, tags, kind_);                   \
+      pobj_ = clazz::ReadFrom(this, object_id, tags, kind_, true);             \
       break;                                                                   \
     }
     CLASS_LIST_NO_OBJECT(SNAPSHOT_READ)
@@ -453,7 +510,7 @@
 
     CLASS_LIST_TYPED_DATA(SNAPSHOT_READ) {
       tags = RawObject::ClassIdTag::update(class_id, tags);
-      pobj_ = TypedData::ReadFrom(this, object_id, tags, kind_);
+      pobj_ = TypedData::ReadFrom(this, object_id, tags, kind_, true);
       break;
     }
 #undef SNAPSHOT_READ
@@ -462,7 +519,7 @@
 
     CLASS_LIST_TYPED_DATA(SNAPSHOT_READ) {
       tags = RawObject::ClassIdTag::update(class_id, tags);
-      pobj_ = ExternalTypedData::ReadFrom(this, object_id, tags, kind_);
+      pobj_ = ExternalTypedData::ReadFrom(this, object_id, tags, kind_, true);
       break;
     }
 #undef SNAPSHOT_READ
@@ -503,7 +560,9 @@
       ASSERT(!cls_.IsNull());
       instance_size = cls_.instance_size();
     }
-    intptr_t next_field_offset = cls_.next_field_offset();
+    intptr_t next_field_offset = Class::IsSignatureClass(cls_.raw())
+      ? Closure::InstanceSize() : cls_.next_field_offset();
+
     intptr_t type_argument_field_offset = cls_.type_arguments_field_offset();
     ASSERT(next_field_offset > 0);
     // Instance::NextFieldOffset() returns the offset of the first field in
@@ -559,7 +618,7 @@
   switch (class_id) {
 #define SNAPSHOT_READ(clazz)                                                   \
     case clazz::kClassId: {                                                    \
-      pobj_ = clazz::ReadFrom(this, object_id, tags, kind_);                   \
+      pobj_ = clazz::ReadFrom(this, object_id, tags, kind_, false);            \
       break;                                                                   \
     }
     CLASS_LIST_NO_OBJECT(SNAPSHOT_READ)
@@ -569,7 +628,7 @@
 
     CLASS_LIST_TYPED_DATA(SNAPSHOT_READ) {
       tags = RawObject::ClassIdTag::update(class_id, tags);
-      pobj_ = TypedData::ReadFrom(this, object_id, tags, kind_);
+      pobj_ = TypedData::ReadFrom(this, object_id, tags, kind_, false);
       break;
     }
 #undef SNAPSHOT_READ
@@ -578,7 +637,7 @@
 
     CLASS_LIST_TYPED_DATA(SNAPSHOT_READ) {
       tags = RawObject::ClassIdTag::update(class_id, tags);
-      pobj_ = ExternalTypedData::ReadFrom(this, object_id, tags, kind_);
+      pobj_ = ExternalTypedData::ReadFrom(this, object_id, tags, kind_, false);
       break;
     }
 #undef SNAPSHOT_READ
@@ -651,7 +710,9 @@
     HeapLocker hl(isolate, old_space());
 
     // Read in all the objects stored in the object store.
-    intptr_t num_flds = (object_store->to() - object_store->from());
+    RawObject** toobj = snapshot_code() ? object_store->to()
+                                        : object_store->to_snapshot();
+    intptr_t num_flds = (toobj - object_store->from());
     for (intptr_t i = 0; i <= num_flds; i++) {
       *(object_store->from() + i) = ReadObjectImpl(kAsInlinedObject);
     }
@@ -776,6 +837,82 @@
 }
 
 
+RawObjectPool* SnapshotReader::NewObjectPool(intptr_t len) {
+  ASSERT(kind_ == Snapshot::kFull);
+  ASSERT_NO_SAFEPOINT_SCOPE();
+  RawObjectPool* obj = reinterpret_cast<RawObjectPool*>(
+      AllocateUninitialized(kObjectPoolCid, ObjectPool::InstanceSize(len)));
+  obj->ptr()->length_ = len;
+  return obj;
+}
+
+
+RawLocalVarDescriptors* SnapshotReader::NewLocalVarDescriptors(
+    intptr_t num_entries) {
+  ASSERT(kind_ == Snapshot::kFull);
+  ASSERT_NO_SAFEPOINT_SCOPE();
+  RawLocalVarDescriptors* obj = reinterpret_cast<RawLocalVarDescriptors*>(
+      AllocateUninitialized(kLocalVarDescriptorsCid,
+                            LocalVarDescriptors::InstanceSize(num_entries)));
+  obj->ptr()->num_entries_ = num_entries;
+  return obj;
+}
+
+
+RawExceptionHandlers* SnapshotReader::NewExceptionHandlers(
+    intptr_t num_entries) {
+  ASSERT(kind_ == Snapshot::kFull);
+  ASSERT_NO_SAFEPOINT_SCOPE();
+  RawExceptionHandlers* obj = reinterpret_cast<RawExceptionHandlers*>(
+      AllocateUninitialized(kExceptionHandlersCid,
+                            ExceptionHandlers::InstanceSize(num_entries)));
+  obj->ptr()->num_entries_ = num_entries;
+  return obj;
+}
+
+
+RawPcDescriptors* SnapshotReader::NewPcDescriptors(intptr_t len) {
+  ASSERT(kind_ == Snapshot::kFull);
+  ASSERT_NO_SAFEPOINT_SCOPE();
+  RawPcDescriptors* obj = reinterpret_cast<RawPcDescriptors*>(
+      AllocateUninitialized(kPcDescriptorsCid,
+                            PcDescriptors::InstanceSize(len)));
+  obj->ptr()->length_ = len;
+  return obj;
+}
+
+
+RawStackmap* SnapshotReader::NewStackmap(intptr_t len) {
+  ASSERT(kind_ == Snapshot::kFull);
+  ASSERT_NO_SAFEPOINT_SCOPE();
+  RawStackmap* obj = reinterpret_cast<RawStackmap*>(
+      AllocateUninitialized(kStackmapCid, Stackmap::InstanceSize(len)));
+  obj->ptr()->length_ = len;
+  return obj;
+}
+
+
+RawContextScope* SnapshotReader::NewContextScope(intptr_t num_variables) {
+  ASSERT(kind_ == Snapshot::kFull);
+  ASSERT_NO_SAFEPOINT_SCOPE();
+  RawContextScope* obj = reinterpret_cast<RawContextScope*>(
+      AllocateUninitialized(kContextScopeCid,
+                            ContextScope::InstanceSize(num_variables)));
+  obj->ptr()->num_variables_ = num_variables;
+  return obj;
+}
+
+
+RawCode* SnapshotReader::NewCode(intptr_t pointer_offsets_length) {
+  ASSERT(pointer_offsets_length == 0);
+  ASSERT(kind_ == Snapshot::kFull);
+  ASSERT_NO_SAFEPOINT_SCOPE();
+  RawCode* obj = reinterpret_cast<RawCode*>(
+      AllocateUninitialized(kCodeCid, Code::InstanceSize(0)));
+  return obj;
+}
+
+
 RawTokenStream* SnapshotReader::NewTokenStream(intptr_t len) {
   ASSERT(kind_ == Snapshot::kFull);
   ASSERT_NO_SAFEPOINT_SCOPE();
@@ -925,6 +1062,26 @@
 }
 
 
+RawICData* SnapshotReader::NewICData() {
+  ALLOC_NEW_OBJECT(ICData);
+}
+
+
+RawLinkedHashMap* SnapshotReader::NewLinkedHashMap() {
+  ALLOC_NEW_OBJECT(LinkedHashMap);
+}
+
+
+RawMegamorphicCache* SnapshotReader::NewMegamorphicCache() {
+  ALLOC_NEW_OBJECT(MegamorphicCache);
+}
+
+
+RawSubtypeTestCache* SnapshotReader::NewSubtypeTestCache() {
+  ALLOC_NEW_OBJECT(SubtypeTestCache);
+}
+
+
 RawField* SnapshotReader::NewField() {
   ALLOC_NEW_OBJECT(Field);
 }
@@ -1032,6 +1189,147 @@
 }
 
 
+int32_t InstructionsWriter::GetOffsetFor(RawInstructions* instructions) {
+  intptr_t heap_size = instructions->Size();
+  intptr_t offset = next_offset_;
+  next_offset_ += heap_size;
+  instructions_.Add(InstructionsData(instructions));
+  return offset;
+}
+
+
+static void EnsureIdentifier(char* label) {
+  for (char c = *label; c != '\0'; c = *++label) {
+    if (((c >= 'a') && (c <= 'z')) ||
+        ((c >= 'A') && (c <= 'Z')) ||
+        ((c >= '0') && (c <= '9'))) {
+      continue;
+    }
+    *label = '_';
+  }
+}
+
+
+void InstructionsWriter::WriteAssembly() {
+  Zone* Z = Thread::Current()->zone();
+
+  // Handlify collected raw pointers as building the names below
+  // will allocate on the Dart heap.
+  for (intptr_t i = 0; i < instructions_.length(); i++) {
+    InstructionsData& data = instructions_[i];
+    data.insns_ = &Instructions::Handle(Z, data.raw_insns_);
+    ASSERT(data.raw_code_ != NULL);
+    data.code_ = &Code::Handle(Z, data.raw_code_);
+  }
+
+  stream_.Print(".text\n");
+  stream_.Print(".globl _kInstructionsSnapshot\n");
+  stream_.Print(".balign %" Pd ", 0\n", OS::kMaxPreferredCodeAlignment);
+  stream_.Print("_kInstructionsSnapshot:\n");
+
+  // This head also provides the gap to make the instructions snapshot
+  // look like a HeapPage.
+  intptr_t instructions_length = next_offset_;
+  WriteWordLiteral(instructions_length);
+  intptr_t header_words = InstructionsSnapshot::kHeaderSize / sizeof(uword);
+  for (intptr_t i = 1; i < header_words; i++) {
+    WriteWordLiteral(0);
+  }
+
+  Object& owner = Object::Handle(Z);
+  String& str = String::Handle(Z);
+
+  for (intptr_t i = 0; i < instructions_.length(); i++) {
+    const Instructions& insns = *instructions_[i].insns_;
+    const Code& code = *instructions_[i].code_;
+
+    ASSERT(insns.raw()->Size() % sizeof(uint64_t) == 0);
+
+    {
+      // 1. Write from the header to the entry point.
+      NoSafepointScope no_safepoint;
+
+      uword beginning = reinterpret_cast<uword>(insns.raw_ptr());
+      uword entry = beginning + Instructions::HeaderSize();
+
+      ASSERT(Utils::IsAligned(beginning, sizeof(uint64_t)));
+      ASSERT(Utils::IsAligned(entry, sizeof(uint64_t)));
+
+      // Write Instructions with the mark and VM heap bits set.
+      uword marked_tags = insns.raw_ptr()->tags_;
+      marked_tags = RawObject::VMHeapObjectTag::update(true, marked_tags);
+      marked_tags = RawObject::MarkBit::update(true, marked_tags);
+
+      WriteWordLiteral(marked_tags);
+      beginning += sizeof(uword);
+
+      for (uword* cursor = reinterpret_cast<uword*>(beginning);
+           cursor < reinterpret_cast<uword*>(entry);
+           cursor++) {
+        WriteWordLiteral(*cursor);
+      }
+    }
+
+    // 2. Write a label at the entry point.
+    owner = code.owner();
+    if (owner.IsNull()) {
+      const char* name = StubCode::NameOfStub(insns.EntryPoint());
+      stream_.Print("Precompiled_Stub_%s:\n", name);
+    } else if (owner.IsClass()) {
+      str = Class::Cast(owner).Name();
+      const char* name = str.ToCString();
+      EnsureIdentifier(const_cast<char*>(name));
+      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));
+      stream_.Print("Precompiled_%s_%" Pd ":\n", name, i);
+    } else {
+      UNREACHABLE();
+    }
+
+    {
+      // 3. Write from the entry point to the end.
+      NoSafepointScope no_safepoint;
+      uword beginning = reinterpret_cast<uword>(insns.raw()) - kHeapObjectTag;
+      uword entry = beginning + Instructions::HeaderSize();
+      uword end = beginning + insns.raw()->Size();
+
+      ASSERT(Utils::IsAligned(beginning, sizeof(uint64_t)));
+      ASSERT(Utils::IsAligned(entry, sizeof(uint64_t)));
+      ASSERT(Utils::IsAligned(end, sizeof(uint64_t)));
+
+      for (uword* cursor = reinterpret_cast<uword*>(entry);
+           cursor < reinterpret_cast<uword*>(end);
+           cursor++) {
+        WriteWordLiteral(*cursor);
+      }
+    }
+  }
+}
+
+
+RawInstructions* InstructionsReader::GetInstructionsAt(int32_t offset,
+                                                       uword expected_tags) {
+  ASSERT(Utils::IsAligned(offset, OS::PreferredCodeAlignment()));
+
+  RawInstructions* result =
+      reinterpret_cast<RawInstructions*>(
+          reinterpret_cast<uword>(buffer_) + offset + kHeapObjectTag);
+
+  uword actual_tags = result->ptr()->tags_;
+  if (actual_tags != expected_tags) {
+    FATAL2("Instructions tag mismatch: expected %" Pd ", saw %" Pd,
+           expected_tags,
+           actual_tags);
+  }
+
+  ASSERT(result->IsMarked());
+
+  return result;
+}
+
+
 intptr_t SnapshotReader::LookupInternalClass(intptr_t class_header) {
   // If the header is an object Id, lookup singleton VM classes or classes
   // stored in the object store.
@@ -1042,7 +1340,7 @@
   }
   ASSERT(SerializedHeaderTag::decode(class_header) == kObjectId);
   intptr_t class_id = SerializedHeaderData::decode(class_header);
-  ASSERT(IsObjectStoreClassId(class_id));
+  ASSERT(IsObjectStoreClassId(class_id) || IsSingletonClassId(class_id));
   return class_id;
 }
 
@@ -1065,7 +1363,7 @@
     // read part and return the error object back.
     const UnhandledException& error = UnhandledException::Handle(
         object_store()->preallocated_unhandled_exception());
-    Isolate::Current()->long_jump_base()->Jump(1, error);
+    thread()->long_jump_base()->Jump(1, error);
   }
   VerifiedMemory::Accept(address, size);
 
@@ -1080,46 +1378,59 @@
 }
 
 
+#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);
-  if (object_id == kNullObject) {
-    // This is a singleton null object, return it.
-    return Object::null();
-  }
-  if (object_id == kSentinelObject) {
-    return Object::sentinel().raw();
-  }
-  if (object_id == kEmptyArrayObject) {
-    return Object::empty_array().raw();
-  }
-  if (object_id == kZeroArrayObject) {
-    return Object::zero_array().raw();
-  }
-  if (object_id == kDynamicType) {
-    return Object::dynamic_type();
-  }
-  if (object_id == kVoidType) {
-    return Object::void_type();
-  }
-  if (object_id == kTrueValue) {
-    return Bool::True().raw();
-  }
-  if (object_id == kFalseValue) {
-    return Bool::False().raw();
-  }
+
+  // First check if it is one of the singleton objects.
+  READ_VM_SINGLETON_OBJ(kNullObject, Object::null());
+  READ_VM_SINGLETON_OBJ(kSentinelObject, Object::sentinel().raw());
+  READ_VM_SINGLETON_OBJ(kTransitionSentinelObject,
+                        Object::transition_sentinel().raw());
+  READ_VM_SINGLETON_OBJ(kEmptyArrayObject, Object::empty_array().raw());
+  READ_VM_SINGLETON_OBJ(kZeroArrayObject, Object::zero_array().raw());
+  READ_VM_SINGLETON_OBJ(kDynamicType, Object::dynamic_type());
+  READ_VM_SINGLETON_OBJ(kVoidType, Object::void_type());
+  READ_VM_SINGLETON_OBJ(kTrueValue, Bool::True().raw());
+  READ_VM_SINGLETON_OBJ(kFalseValue, Bool::False().raw());
+  READ_VM_SINGLETON_OBJ(kExtractorParameterTypes,
+                        Object::extractor_parameter_types().raw());
+  READ_VM_SINGLETON_OBJ(kExtractorParameterNames,
+                        Object::extractor_parameter_names().raw());
+  READ_VM_SINGLETON_OBJ(kEmptyContextScopeObject,
+                        Object::empty_context_scope().raw());
+  READ_VM_SINGLETON_OBJ(kEmptyObjectPool, Object::empty_object_pool().raw());
+  READ_VM_SINGLETON_OBJ(kEmptyDescriptors, Object::empty_descriptors().raw());
+  READ_VM_SINGLETON_OBJ(kEmptyVarDescriptors,
+                        Object::empty_var_descriptors().raw());
+  READ_VM_SINGLETON_OBJ(kEmptyExceptionHandlers,
+                        Object::empty_exception_handlers().raw());
+
+  // Check if it is a double.
   if (object_id == kDoubleObject) {
     ASSERT(kind_ == Snapshot::kMessage);
     return Double::New(ReadDouble());
   }
+
+  // Check it is a singleton class object.
   intptr_t class_id = ClassIdFromObjectId(object_id);
   if (IsSingletonClassId(class_id)) {
     return isolate()->class_table()->At(class_id);  // get singleton class.
-  } else {
-    ASSERT(Symbols::IsVMSymbolId(object_id));
-    return Symbols::GetVMSymbol(object_id);  // return VM symbol.
   }
-  UNREACHABLE();
-  return Object::null();
+
+  // Check if it is a singleton Argument descriptor object.
+  for (intptr_t i = 0; i < ArgumentsDescriptor::kCachedDescriptorCount; i++) {
+    if (object_id == (kCachedArgumentsDescriptor0 + i)) {
+      return ArgumentsDescriptor::cached_args_descriptors_[i];
+    }
+  }
+
+  ASSERT(Symbols::IsVMSymbolId(object_id));
+  return Symbols::GetVMSymbol(object_id);  // return VM symbol.
 }
 
 
@@ -1228,16 +1539,18 @@
 }
 
 
-VmIsolateSnapshotReader::VmIsolateSnapshotReader(const uint8_t* buffer,
-                                                 intptr_t size,
-                                                 Zone* zone)
-    : SnapshotReader(buffer,
-                     size,
-                     Snapshot::kFull,
-                     new ZoneGrowableArray<BackRefNode>(
-                         kNumVmIsolateSnapshotReferences),
-                     Dart::vm_isolate(),
-                     zone) {
+VmIsolateSnapshotReader::VmIsolateSnapshotReader(
+    const uint8_t* buffer,
+    intptr_t size,
+    const uint8_t* instructions_buffer,
+    Thread* thread)
+      : SnapshotReader(buffer,
+                       size,
+                       instructions_buffer,
+                       Snapshot::kFull,
+                       new ZoneGrowableArray<BackRefNode>(
+                           kNumVmIsolateSnapshotReferences),
+                       thread) {
 }
 
 
@@ -1250,6 +1563,7 @@
         i, *(backrefs->At(i).reference()));
   }
   ResetBackwardReferenceTable();
+  Dart::set_instructions_snapshot_buffer(instructions_buffer_);
 }
 
 
@@ -1283,6 +1597,10 @@
     // only memory.
     *(ArrayHandle()) ^= ReadObject();
 
+    if (snapshot_code()) {
+      StubCode::ReadFrom(this);
+    }
+
     // Validate the class table.
 #if defined(DEBUG)
     isolate->ValidateClassTable();
@@ -1295,15 +1613,16 @@
 
 IsolateSnapshotReader::IsolateSnapshotReader(const uint8_t* buffer,
                                              intptr_t size,
-                                             Isolate* isolate,
-                                             Zone* zone)
+                                             const uint8_t* instructions_buffer,
+                                             Thread* thread)
     : SnapshotReader(buffer,
                      size,
+                     instructions_buffer,
                      Snapshot::kFull,
                      new ZoneGrowableArray<BackRefNode>(
                          kNumInitialReferencesInFullSnapshot),
-                     isolate,
-                     zone) {
+                     thread) {
+  isolate()->set_compilation_allowed(instructions_buffer_ == NULL);
 }
 
 
@@ -1314,14 +1633,13 @@
 
 ScriptSnapshotReader::ScriptSnapshotReader(const uint8_t* buffer,
                                            intptr_t size,
-                                           Isolate* isolate,
-                                           Zone* zone)
+                                           Thread* thread)
     : SnapshotReader(buffer,
                      size,
+                     NULL, /* instructions_buffer */
                      Snapshot::kScript,
                      new ZoneGrowableArray<BackRefNode>(kNumInitialReferences),
-                     isolate,
-                     zone) {
+                     thread) {
 }
 
 
@@ -1332,14 +1650,13 @@
 
 MessageSnapshotReader::MessageSnapshotReader(const uint8_t* buffer,
                                              intptr_t size,
-                                             Isolate* isolate,
-                                             Zone* zone)
+                                             Thread* thread)
     : SnapshotReader(buffer,
                      size,
+                     NULL, /* instructions_buffer */
                      Snapshot::kMessage,
                      new ZoneGrowableArray<BackRefNode>(kNumInitialReferences),
-                     isolate,
-                     zone) {
+                     thread) {
 }
 
 
@@ -1349,21 +1666,28 @@
 
 
 SnapshotWriter::SnapshotWriter(Snapshot::Kind kind,
+                               Thread* thread,
                                uint8_t** buffer,
                                ReAlloc alloc,
                                intptr_t initial_size,
                                ForwardList* forward_list,
-                               bool can_send_any_object)
+                               InstructionsWriter* instructions_writer,
+                               bool can_send_any_object,
+                               bool snapshot_code,
+                               bool vm_isolate_is_symbolic)
     : BaseWriter(buffer, alloc, initial_size),
       kind_(kind),
-      isolate_(Isolate::Current()),
-      object_store_(isolate_->object_store()),
-      class_table_(isolate_->class_table()),
+      thread_(thread),
+      object_store_(isolate()->object_store()),
+      class_table_(isolate()->class_table()),
       forward_list_(forward_list),
+      instructions_writer_(instructions_writer),
       exception_type_(Exceptions::kNone),
       exception_msg_(NULL),
       unmarked_objects_(false),
-      can_send_any_object_(can_send_any_object) {
+      can_send_any_object_(can_send_any_object),
+      snapshot_code_(snapshot_code),
+      vm_isolate_is_symbolic_(vm_isolate_is_symbolic) {
   ASSERT(forward_list_ != NULL);
 }
 
@@ -1373,68 +1697,57 @@
   WriteForwardedObjects();
 }
 
+
+uword SnapshotWriter::GetObjectTags(RawObject* raw) {
+  return raw->ptr()->tags_;
+}
+
+
 #define VM_OBJECT_CLASS_LIST(V)                                                \
   V(OneByteString)                                                             \
   V(Mint)                                                                      \
   V(Bigint)                                                                    \
   V(Double)                                                                    \
+  V(ImmutableArray)                                                            \
 
 #define VM_OBJECT_WRITE(clazz)                                                 \
   case clazz::kClassId: {                                                      \
-    object_id = forward_list_->AddObject(rawobj, kIsSerialized);               \
+    object_id = forward_list_->AddObject(zone(), rawobj, kIsSerialized);       \
     Raw##clazz* raw_obj = reinterpret_cast<Raw##clazz*>(rawobj);               \
-    raw_obj->WriteTo(this, object_id, kind());                                 \
-    return;                                                                    \
+        raw_obj->WriteTo(this, object_id, kind(), false);                      \
+    return true;                                                               \
   }                                                                            \
 
-void SnapshotWriter::HandleVMIsolateObject(RawObject* rawobj) {
-  // Check if it is a singleton null object.
-  if (rawobj == Object::null()) {
-    WriteVMIsolateObject(kNullObject);
-    return;
-  }
+#define WRITE_VM_SINGLETON_OBJ(obj, id)                                        \
+  if (rawobj == obj) {                                                         \
+    WriteVMIsolateObject(id);                                                  \
+    return true;                                                               \
+  }                                                                            \
 
-  // Check if it is a singleton sentinel object.
-  if (rawobj == Object::sentinel().raw()) {
-    WriteVMIsolateObject(kSentinelObject);
-    return;
-  }
-
-  // Check if it is a singleton empty array object.
-  if (rawobj == Object::empty_array().raw()) {
-    WriteVMIsolateObject(kEmptyArrayObject);
-    return;
-  }
-
-  // Check if it is a singleton zero array object.
-  if (rawobj == Object::zero_array().raw()) {
-    WriteVMIsolateObject(kZeroArrayObject);
-    return;
-  }
-
-  // Check if it is a singleton dyanmic Type object.
-  if (rawobj == Object::dynamic_type()) {
-    WriteVMIsolateObject(kDynamicType);
-    return;
-  }
-
-  // Check if it is a singleton void Type object.
-  if (rawobj == Object::void_type()) {
-    WriteVMIsolateObject(kVoidType);
-    return;
-  }
-
-  // Check if it is a singleton boolean true object.
-  if (rawobj == Bool::True().raw()) {
-    WriteVMIsolateObject(kTrueValue);
-    return;
-  }
-
-  // Check if it is a singleton boolean false object.
-  if (rawobj == Bool::False().raw()) {
-    WriteVMIsolateObject(kFalseValue);
-    return;
-  }
+bool SnapshotWriter::HandleVMIsolateObject(RawObject* rawobj) {
+  // Check if it is one of the singleton VM objects.
+  WRITE_VM_SINGLETON_OBJ(Object::null(), kNullObject);
+  WRITE_VM_SINGLETON_OBJ(Object::sentinel().raw(), kSentinelObject);
+  WRITE_VM_SINGLETON_OBJ(Object::transition_sentinel().raw(),
+                         kTransitionSentinelObject);
+  WRITE_VM_SINGLETON_OBJ(Object::empty_array().raw(), kEmptyArrayObject);
+  WRITE_VM_SINGLETON_OBJ(Object::zero_array().raw(), kZeroArrayObject);
+  WRITE_VM_SINGLETON_OBJ(Object::dynamic_type(), kDynamicType);
+  WRITE_VM_SINGLETON_OBJ(Object::void_type(), kVoidType);
+  WRITE_VM_SINGLETON_OBJ(Bool::True().raw(), kTrueValue);
+  WRITE_VM_SINGLETON_OBJ(Bool::False().raw(), kFalseValue);
+  WRITE_VM_SINGLETON_OBJ(Object::extractor_parameter_types().raw(),
+                         kExtractorParameterTypes);
+  WRITE_VM_SINGLETON_OBJ(Object::extractor_parameter_names().raw(),
+                         kExtractorParameterNames);
+  WRITE_VM_SINGLETON_OBJ(Object::empty_context_scope().raw(),
+                         kEmptyContextScopeObject);
+  WRITE_VM_SINGLETON_OBJ(Object::empty_object_pool().raw(), kEmptyObjectPool);
+  WRITE_VM_SINGLETON_OBJ(Object::empty_descriptors().raw(), kEmptyDescriptors);
+  WRITE_VM_SINGLETON_OBJ(Object::empty_var_descriptors().raw(),
+                         kEmptyVarDescriptors);
+  WRITE_VM_SINGLETON_OBJ(Object::empty_exception_handlers().raw(),
+                         kEmptyExceptionHandlers);
 
   // Check if it is a singleton class object which is shared by
   // all isolates.
@@ -1445,7 +1758,15 @@
     if (IsSingletonClassId(class_id)) {
       intptr_t object_id = ObjectIdFromClassId(class_id);
       WriteVMIsolateObject(object_id);
-      return;
+      return true;
+    }
+  }
+
+  // Check if it is a singleton Argument descriptor object.
+  for (intptr_t i = 0; i < ArgumentsDescriptor::kCachedDescriptorCount; i++) {
+    if (rawobj == ArgumentsDescriptor::cached_args_descriptors_[i]) {
+      WriteVMIsolateObject(kCachedArgumentsDescriptor0 + i);
+      return true;
     }
   }
 
@@ -1454,14 +1775,14 @@
     id = Symbols::LookupVMSymbol(rawobj);
     if (id != kInvalidIndex) {
       WriteVMIsolateObject(id);
-      return;
+      return true;
     }
 
     // Check if it is an object from the vm isolate snapshot object table.
     id = FindVmSnapshotObject(rawobj);
     if (id != kInvalidIndex) {
       WriteIndexedObject(id);
-      return;
+      return true;
     }
   } else {
     // In the case of script snapshots or for messages we do not use
@@ -1470,15 +1791,15 @@
     intptr_t object_id = forward_list_->FindObject(rawobj);
     if (object_id != -1) {
       WriteIndexedObject(object_id);
-      return;
+      return true;
     } else {
       switch (id) {
         VM_OBJECT_CLASS_LIST(VM_OBJECT_WRITE)
         case kTypedDataUint32ArrayCid: {
-          object_id = forward_list_->AddObject(rawobj, kIsSerialized);
+          object_id = forward_list_->AddObject(zone(), rawobj, kIsSerialized);
           RawTypedData* raw_obj = reinterpret_cast<RawTypedData*>(rawobj);
-          raw_obj->WriteTo(this, object_id, kind());
-          return;
+          raw_obj->WriteTo(this, object_id, kind(), false);
+          return true;
         }
         default:
           OS::Print("class id = %" Pd "\n", id);
@@ -1486,7 +1807,14 @@
       }
     }
   }
-  UNREACHABLE();
+
+  if (!vm_isolate_is_symbolic()) {
+    return false;
+  }
+
+  const Object& obj = Object::Handle(rawobj);
+  FATAL1("Unexpected reference to object in VM isolate: %s\n", obj.ToCString());
+  return false;
 }
 
 #undef VM_OBJECT_WRITE
@@ -1500,13 +1828,13 @@
  public:
   explicit ScriptVisitor(Isolate* isolate) :
       ObjectVisitor(isolate),
-      objHandle_(Object::Handle(isolate)),
+      objHandle_(Object::Handle(isolate->current_zone())),
       count_(0),
       scripts_(NULL) {}
 
   ScriptVisitor(Isolate* isolate, const Array* scripts) :
       ObjectVisitor(isolate),
-      objHandle_(Object::Handle(isolate)),
+      objHandle_(Object::Handle(isolate->current_zone())),
       count_(0),
       scripts_(scripts) {}
 
@@ -1531,49 +1859,62 @@
 
 FullSnapshotWriter::FullSnapshotWriter(uint8_t** vm_isolate_snapshot_buffer,
                                        uint8_t** isolate_snapshot_buffer,
-                                       ReAlloc alloc)
-    : isolate_(Isolate::Current()),
+                                       uint8_t** instructions_snapshot_buffer,
+                                       ReAlloc alloc,
+                                       bool snapshot_code,
+                                       bool vm_isolate_is_symbolic)
+    : thread_(Thread::Current()),
       vm_isolate_snapshot_buffer_(vm_isolate_snapshot_buffer),
       isolate_snapshot_buffer_(isolate_snapshot_buffer),
+      instructions_snapshot_buffer_(instructions_snapshot_buffer),
       alloc_(alloc),
       vm_isolate_snapshot_size_(0),
       isolate_snapshot_size_(0),
+      instructions_snapshot_size_(0),
       forward_list_(NULL),
-      scripts_(Array::Handle(isolate_)),
-      symbol_table_(Array::Handle(isolate_)) {
+      instructions_writer_(NULL),
+      scripts_(Array::Handle(zone())),
+      symbol_table_(Array::Handle(zone())),
+      snapshot_code_(snapshot_code),
+      vm_isolate_is_symbolic_(vm_isolate_is_symbolic) {
   ASSERT(isolate_snapshot_buffer_ != NULL);
   ASSERT(alloc_ != NULL);
-  ASSERT(isolate_ != NULL);
+  ASSERT(isolate() != NULL);
   ASSERT(ClassFinalizer::AllClassesFinalized());
-  ObjectStore* object_store = isolate_->object_store();
+  ASSERT(isolate() != NULL);
+  ASSERT(heap() != NULL);
+  ObjectStore* object_store = isolate()->object_store();
   ASSERT(object_store != NULL);
-  Heap* heap = isolate_->heap();
-  ASSERT(heap != NULL);
   // Ensure the class table is valid.
 #if defined(DEBUG)
-  isolate_->ValidateClassTable();
+  isolate()->ValidateClassTable();
 #endif
 
   // Collect all the script objects and their accompanying 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 script objects, allocate an array
   // and then fill it up with the script objects.
-  ASSERT(isolate_ != NULL);
-  ScriptVisitor scripts_counter(isolate_);
-  heap->IterateOldObjects(&scripts_counter);
+  ScriptVisitor scripts_counter(isolate());
+  heap()->IterateOldObjects(&scripts_counter);
   intptr_t count = scripts_counter.count();
   scripts_ = Array::New(count, Heap::kOld);
-  ScriptVisitor script_visitor(isolate_, &scripts_);
-  heap->IterateOldObjects(&script_visitor);
+  ScriptVisitor script_visitor(isolate(), &scripts_);
+  heap()->IterateOldObjects(&script_visitor);
 
   // Stash the symbol table away for writing and reading into the vm isolate,
   // and reset the symbol table for the regular isolate so that we do not
   // write these symbols into the snapshot of a regular dart isolate.
   symbol_table_ = object_store->symbol_table();
-  Symbols::SetupSymbolTable(isolate_);
+  Symbols::SetupSymbolTable(isolate());
 
-  forward_list_ = new ForwardList(SnapshotWriter::FirstObjectId());
+  forward_list_ = new ForwardList(thread(), SnapshotWriter::FirstObjectId());
   ASSERT(forward_list_ != NULL);
+
+  if (instructions_snapshot_buffer != NULL) {
+    instructions_writer_ = new InstructionsWriter(instructions_snapshot_buffer,
+                                                  alloc,
+                                                  kInitialSize);
+  }
 }
 
 
@@ -1587,11 +1928,15 @@
 void FullSnapshotWriter::WriteVmIsolateSnapshot() {
   ASSERT(vm_isolate_snapshot_buffer_ != NULL);
   SnapshotWriter writer(Snapshot::kFull,
+                        thread(),
                         vm_isolate_snapshot_buffer_,
                         alloc_,
                         kInitialSize,
                         forward_list_,
-                        true);  // Can send any kind of object.
+                        instructions_writer_,
+                        true, /* can_send_any_object */
+                        snapshot_code_,
+                        vm_isolate_is_symbolic_);
   // Write full snapshot for the VM isolate.
   // Setup for long jump in case there is an exception while writing
   // the snapshot.
@@ -1617,8 +1962,11 @@
     // read only memory.
     writer.WriteObject(scripts_.raw());
 
-    // Write out all forwarded objects.
-    writer.WriteForwardedObjects();
+    if (snapshot_code_) {
+      ASSERT(!vm_isolate_is_symbolic_);
+      StubCode::WriteTo(&writer);
+    }
+
 
     writer.FillHeader(writer.kind());
 
@@ -1631,12 +1979,16 @@
 
 void FullSnapshotWriter::WriteIsolateFullSnapshot() {
   SnapshotWriter writer(Snapshot::kFull,
+                        thread(),
                         isolate_snapshot_buffer_,
                         alloc_,
                         kInitialSize,
                         forward_list_,
-                        true);
-  ObjectStore* object_store = isolate_->object_store();
+                        instructions_writer_,
+                        true, /* can_send_any_object */
+                        snapshot_code_,
+                        true /* vm_isolate_is_symbolic */);
+  ObjectStore* object_store = isolate()->object_store();
   ASSERT(object_store != NULL);
 
   // Write full snapshot for a regular isolate.
@@ -1655,13 +2007,14 @@
     // Write out all the objects in the object store of the isolate which
     // is the root set for all dart allocated objects at this point.
     SnapshotWriterVisitor visitor(&writer, false);
-    object_store->VisitObjectPointers(&visitor);
+    visitor.VisitPointers(object_store->from(),
+                          snapshot_code_ ? object_store->to()
+                                         : object_store->to_snapshot());
 
     // Write out all forwarded objects.
     writer.WriteForwardedObjects();
 
     writer.FillHeader(writer.kind());
-    writer.UnmarkAll();
 
     isolate_snapshot_size_ = writer.BytesWritten();
   } else {
@@ -1675,94 +2028,66 @@
     WriteVmIsolateSnapshot();
   }
   WriteIsolateFullSnapshot();
-}
-
-
-uword SnapshotWriter::GetObjectTags(RawObject* raw) {
-  uword tags = raw->ptr()->tags_;
-  if (SerializedHeaderTag::decode(tags) == kObjectId) {
-    intptr_t id = SerializedHeaderData::decode(tags);
-    return forward_list_->NodeForObjectId(id)->tags();
-  } else {
-    return tags;
+  if (snapshot_code_) {
+    instructions_writer_->WriteAssembly();
+    instructions_snapshot_size_ = instructions_writer_->BytesWritten();
   }
 }
 
 
-ForwardList::ForwardList(intptr_t first_object_id)
-    : first_object_id_(first_object_id),
+PrecompiledSnapshotWriter::PrecompiledSnapshotWriter(
+    uint8_t** vm_isolate_snapshot_buffer,
+    uint8_t** isolate_snapshot_buffer,
+    uint8_t** instructions_snapshot_buffer,
+    ReAlloc alloc)
+  : FullSnapshotWriter(vm_isolate_snapshot_buffer,
+                       isolate_snapshot_buffer,
+                       instructions_snapshot_buffer,
+                       alloc,
+                       true, /* snapshot_code */
+                       false /* vm_isolate_is_symbolic */) {
+}
+
+
+PrecompiledSnapshotWriter::~PrecompiledSnapshotWriter() {}
+
+
+ForwardList::ForwardList(Thread* thread, intptr_t first_object_id)
+    : thread_(thread),
+      first_object_id_(first_object_id),
       nodes_(),
       first_unprocessed_object_id_(first_object_id) {
-  // The ForwardList encodes information in the header tag word. There cannot
-  // be any concurrent GC tasks while it is in use.
-  Thread* thread = Thread::Current();
-  Isolate* isolate = thread->isolate();
-  PageSpace* page_space = isolate->heap()->old_space();
-  MonitorLocker ml(page_space->tasks_lock());
-  while (page_space->tasks() > 0) {
-    ml.Wait();
-  }
-  // Ensure that no GC happens while we are writing out the full snapshot.
-  thread->IncrementNoSafepointScopeDepth();
 }
 
 
 ForwardList::~ForwardList() {
+  heap()->ResetObjectIdTable();
 }
 
 
-intptr_t ForwardList::MarkAndAddObject(RawObject* raw, SerializeState state) {
+intptr_t ForwardList::AddObject(Zone* zone,
+                                RawObject* raw,
+                                SerializeState state) {
   NoSafepointScope no_safepoint;
   intptr_t object_id = next_object_id();
   ASSERT(object_id > 0 && object_id <= kMaxObjectId);
-  uword value = 0;
-  value = SerializedHeaderTag::update(kObjectId, value);
-  value = SerializedHeaderData::update(object_id, value);
-  uword tags = raw->ptr()->tags_;
-  ASSERT(SerializedHeaderTag::decode(tags) != kObjectId);
-  raw->ptr()->tags_ = value;
-  Node* node = new Node(raw, tags, state);
+  const Object& obj = Object::ZoneHandle(zone, raw);
+  Node* node = new Node(&obj, state);
   ASSERT(node != NULL);
   nodes_.Add(node);
-  return object_id;
-}
-
-
-intptr_t ForwardList::AddObject(RawObject* raw, SerializeState state) {
-  NoSafepointScope no_safepoint;
-  intptr_t object_id = next_object_id();
-  ASSERT(object_id > 0 && object_id <= kMaxObjectId);
-  uword tags = raw->ptr()->tags_;
-  ASSERT(SerializedHeaderTag::decode(tags) != kObjectId);
-  Node* node = new Node(raw, tags, state);
-  ASSERT(node != NULL);
-  nodes_.Add(node);
+  ASSERT(SnapshotWriter::FirstObjectId() > 0);
+  ASSERT(object_id != 0);
+  heap()->SetObjectId(raw, object_id);
   return object_id;
 }
 
 
 intptr_t ForwardList::FindObject(RawObject* raw) {
   NoSafepointScope no_safepoint;
-  intptr_t id;
-  for (id = first_object_id(); id < next_object_id(); ++id) {
-    const Node* node = NodeForObjectId(id);
-    if (raw == node->raw()) {
-      return id;
-    }
-  }
-  return kInvalidIndex;
-}
-
-
-void ForwardList::UnmarkAll() const {
-  for (intptr_t id = first_object_id(); id < next_object_id(); ++id) {
-    const Node* node = NodeForObjectId(id);
-    RawObject* raw = node->raw();
-    if (SerializedHeaderTag::decode(raw->ptr()->tags_) == kObjectId) {
-      raw->ptr()->tags_ = node->tags();  // Restore original tags.
-    }
-  }
-  Thread::Current()->DecrementNoSafepointScopeDepth();
+  ASSERT(SnapshotWriter::FirstObjectId() > 0);
+  intptr_t id = heap()->GetObjectId(raw);
+  ASSERT(id == 0 || NodeForObjectId(id)->obj()->raw() == raw);
+  return (id == 0) ? static_cast<intptr_t>(kInvalidIndex) : id;
 }
 
 
@@ -1791,24 +2116,22 @@
 
   // Check if object has already been serialized, in that case just write
   // the object id out.
-  uword tags = rawobj->ptr()->tags_;
-  if (SerializedHeaderTag::decode(tags) == kObjectId) {
-    intptr_t id = SerializedHeaderData::decode(tags);
-    WriteIndexedObject(id);
+  intptr_t object_id = forward_list_->FindObject(rawobj);
+  if (object_id != kInvalidIndex) {
+    WriteIndexedObject(object_id);
     return true;
   }
 
   // Now check if it is an object from the VM isolate (NOTE: premarked objects
   // are considered to be objects in the VM isolate). These objects are shared
   // by all isolates.
-  if (rawobj->IsVMHeapObject()) {
-    HandleVMIsolateObject(rawobj);
+  if (rawobj->IsVMHeapObject() && HandleVMIsolateObject(rawobj)) {
     return true;
   }
 
   // Check if it is a code object in that case just write a Null object
   // as we do not want code objects in the snapshot.
-  if (cid == kCodeCid) {
+  if (cid == kCodeCid && !snapshot_code()) {
     WriteVMIsolateObject(kNullObject);
     return true;
   }
@@ -1846,119 +2169,47 @@
     return;
   }
 
-  if (as_reference && !raw->IsCanonical()) {
-    WriteObjectRef(raw);
-  } else {
-    // Object is being serialized, add it to the forward ref list and mark
-    // it so that future references to this object in the snapshot will use
-    // an object id, instead of trying to serialize it again.
-    forward_list_->MarkAndAddObject(raw, kIsSerialized);
+  // When we know that we are dealing with leaf or shallow objects we write
+  // these objects inline even when 'as_reference' is true.
+  const bool write_as_reference = as_reference && !raw->IsCanonical();
+  intptr_t tags = raw->ptr()->tags_;
 
-    WriteInlinedObject(raw);
-  }
-}
-
-
-void SnapshotWriter::WriteObjectRef(RawObject* raw) {
-  NoSafepointScope no_safepoint;
-  RawClass* cls = class_table_->At(raw->GetClassId());
-  intptr_t class_id = cls->ptr()->id_;
-  ASSERT(class_id == raw->GetClassId());
-  if (class_id >= kNumPredefinedCids ||
-      RawObject::IsImplicitFieldClassId(class_id)) {
-    WriteInstanceRef(raw, cls);
-    return;
-  }
-  if (class_id == kArrayCid || class_id == kImmutableArrayCid) {
-    intptr_t tags = GetObjectTags(raw);
-
-    // Object is being referenced, add it to the forward ref list and mark
-    // it so that future references to this object in the snapshot will use
-    // this object id. Mark it as not having been serialized yet so that we
-    // will serialize the object when we go through the forward list.
-    forward_list_->MarkAndAddObject(raw, kIsNotSerialized);
-
-    RawArray* rawarray = reinterpret_cast<RawArray*>(raw);
-
-    // Write out the serialization header value for this object.
-    WriteInlinedObjectHeader(kOmittedObjectId);
-
-    // Write out the class information.
-    WriteIndexedObject(class_id);
-    WriteTags(tags);
-
-    // Write out the length field.
-    Write<RawObject*>(rawarray->ptr()->length_);
-
-    return;
-  }
   // Add object to the forward ref list and mark it so that future references
-  // to this object in the snapshot will use this object id. Mark it as having
-  // been serialized so that we do not serialize the object when we go through
+  // to this object in the snapshot will use this object id. Mark the
+  // serialization state so that we do the right thing when we go through
   // the forward list.
-  forward_list_->MarkAndAddObject(raw, kIsSerialized);
-  switch (class_id) {
-#define SNAPSHOT_WRITE(clazz)                                                  \
-    case clazz::kClassId: {                                                    \
-      Raw##clazz* raw_obj = reinterpret_cast<Raw##clazz*>(raw);                \
-      raw_obj->WriteTo(this, kOmittedObjectId, kind_);                         \
-      return;                                                                  \
-    }                                                                          \
-
-    CLASS_LIST_NO_OBJECT(SNAPSHOT_WRITE)
-#undef SNAPSHOT_WRITE
-#define SNAPSHOT_WRITE(clazz)                                                  \
-    case kTypedData##clazz##Cid:                                               \
-
-    CLASS_LIST_TYPED_DATA(SNAPSHOT_WRITE) {
-      RawTypedData* raw_obj = reinterpret_cast<RawTypedData*>(raw);
-      raw_obj->WriteTo(this, kOmittedObjectId, kind_);
-      return;
-    }
-#undef SNAPSHOT_WRITE
-#define SNAPSHOT_WRITE(clazz)                                                  \
-    case kExternalTypedData##clazz##Cid:                                       \
-
-    CLASS_LIST_TYPED_DATA(SNAPSHOT_WRITE) {
-      RawExternalTypedData* raw_obj =
-        reinterpret_cast<RawExternalTypedData*>(raw);
-      raw_obj->WriteTo(this, kOmittedObjectId, kind_);
-      return;
-    }
-#undef SNAPSHOT_WRITE
-    default: break;
+  intptr_t class_id = raw->GetClassId();
+  intptr_t object_id;
+  if (write_as_reference && IsSplitClassId(class_id)) {
+    object_id = forward_list_->AddObject(zone(), raw, kIsNotSerialized);
+  } else {
+    object_id = forward_list_->AddObject(zone(), raw, kIsSerialized);
   }
-  UNREACHABLE();
-}
-
-
-void SnapshotWriter::WriteInlinedObject(RawObject* raw) {
-  // Now write the object out inline in the stream as follows:
-  // - Object is seen for the first time (inlined as follows):
-  //    (object size in multiples of kObjectAlignment | 0x1)
-  //    serialized fields of the object
-  //    ......
-  NoSafepointScope no_safepoint;
-  uword tags = raw->ptr()->tags_;
-  ASSERT(SerializedHeaderTag::decode(tags) == kObjectId);
-  intptr_t object_id = SerializedHeaderData::decode(tags);
-  tags = forward_list_->NodeForObjectId(object_id)->tags();
-  RawClass* cls = class_table_->At(RawObject::ClassIdTag::decode(tags));
-  intptr_t class_id = cls->ptr()->id_;
-
-  if (!IsSplitClassId(class_id)) {
+  if (write_as_reference || !IsSplitClassId(class_id)) {
     object_id = kOmittedObjectId;
   }
+  WriteMarkedObjectImpl(raw, tags, object_id, write_as_reference);
+}
 
-  if (class_id >= kNumPredefinedCids) {
-    WriteInstance(object_id, raw, cls, tags);
+
+void SnapshotWriter::WriteMarkedObjectImpl(RawObject* raw,
+                                           intptr_t tags,
+                                           intptr_t object_id,
+                                           bool as_reference) {
+  NoSafepointScope no_safepoint;
+  RawClass* cls = class_table_->At(RawObject::ClassIdTag::decode(tags));
+  intptr_t class_id = cls->ptr()->id_;
+  ASSERT(class_id == RawObject::ClassIdTag::decode(tags));
+  if (class_id >= kNumPredefinedCids ||
+      RawObject::IsImplicitFieldClassId(class_id)) {
+    WriteInstance(raw, cls, tags, object_id, as_reference);
     return;
   }
   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_);                                \
+          raw_obj->WriteTo(this, object_id, kind_, as_reference);              \
       return;                                                                  \
     }                                                                          \
 
@@ -1969,7 +2220,7 @@
 
     CLASS_LIST_TYPED_DATA(SNAPSHOT_WRITE) {
       RawTypedData* raw_obj = reinterpret_cast<RawTypedData*>(raw);
-      raw_obj->WriteTo(this, object_id, kind_);
+      raw_obj->WriteTo(this, object_id, kind_, as_reference);
       return;
     }
 #undef SNAPSHOT_WRITE
@@ -1979,22 +2230,15 @@
     CLASS_LIST_TYPED_DATA(SNAPSHOT_WRITE) {
       RawExternalTypedData* raw_obj =
         reinterpret_cast<RawExternalTypedData*>(raw);
-      raw_obj->WriteTo(this, object_id, kind_);
-      return;
-    }
-#undef SNAPSHOT_WRITE
-#define SNAPSHOT_WRITE(clazz)                                                  \
-    case kTypedData##clazz##ViewCid:                                           \
-
-    CLASS_LIST_TYPED_DATA(SNAPSHOT_WRITE)
-    case kByteDataViewCid: {
-      WriteInstance(object_id, raw, cls, tags);
+      raw_obj->WriteTo(this, object_id, kind_, as_reference);
       return;
     }
 #undef SNAPSHOT_WRITE
     default: break;
   }
-  UNREACHABLE();
+
+  const Object& obj = Object::Handle(raw);
+  FATAL1("Unexpected object: %s\n", obj.ToCString());
 }
 
 
@@ -2004,7 +2248,10 @@
       : ObjectVisitor(Isolate::Current()), writer_(writer) {}
 
   virtual void VisitObject(RawObject* obj) {
-    writer_->WriteInlinedObject(obj);
+    intptr_t object_id = writer_->forward_list_->FindObject(obj);
+    ASSERT(object_id != kInvalidIndex);
+    intptr_t tags = writer_->GetObjectTags(obj);
+    writer_->WriteMarkedObjectImpl(obj, tags, object_id, kAsInlinedObject);
   }
 
  private:
@@ -2034,7 +2281,7 @@
        ++id) {
     if (!NodeForObjectId(id)->is_serialized()) {
       // Write the object out in the stream.
-      RawObject* raw = NodeForObjectId(id)->raw();
+      RawObject* raw = NodeForObjectId(id)->obj()->raw();
       writer->VisitObject(raw);
 
       // Mark object as serialized.
@@ -2058,6 +2305,22 @@
 }
 
 
+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_;
+
+  // Write out the library url and class name.
+  RawLibrary* library = cls->ptr()->library_;
+  ASSERT(library != Library::null());
+  WriteObjectImpl(library->ptr()->url_, kAsInlinedObject);
+  WriteObjectImpl(cls->ptr()->name_, kAsInlinedObject);
+  WriteObjectImpl(func->ptr()->name_, kAsInlinedObject);
+}
+
+
 void SnapshotWriter::WriteStaticImplicitClosure(intptr_t object_id,
                                                 RawFunction* func,
                                                 intptr_t tags) {
@@ -2086,26 +2349,39 @@
                                   intptr_t tags,
                                   RawSmi* length,
                                   RawTypeArguments* type_arguments,
-                                  RawObject* data[]) {
-  intptr_t len = Smi::Value(length);
+                                  RawObject* data[],
+                                  bool as_reference) {
+  if (as_reference) {
+    // Write out the serialization header value for this object.
+    WriteInlinedObjectHeader(kOmittedObjectId);
 
-  // Write out the serialization header value for this object.
-  WriteInlinedObjectHeader(object_id);
+    // Write out the class information.
+    WriteIndexedObject(array_kind);
+    WriteTags(tags);
 
-  // Write out the class and tags information.
-  WriteIndexedObject(array_kind);
-  WriteTags(tags);
+    // Write out the length field.
+    Write<RawObject*>(length);
+  } else {
+    intptr_t len = Smi::Value(length);
 
-  // Write out the length field.
-  Write<RawObject*>(length);
+    // Write out the serialization header value for this object.
+    WriteInlinedObjectHeader(object_id);
 
-  // Write out the type arguments.
-  WriteObjectImpl(type_arguments, kAsInlinedObject);
+    // Write out the class and tags information.
+    WriteIndexedObject(array_kind);
+    WriteTags(tags);
 
-  // Write out the individual object ids.
-  bool as_reference = RawObject::IsCanonical(tags) ? false : true;
-  for (intptr_t i = 0; i < len; i++) {
-    WriteObjectImpl(data[i], as_reference);
+    // Write out the length field.
+    Write<RawObject*>(length);
+
+    // Write out the type arguments.
+    WriteObjectImpl(type_arguments, kAsInlinedObject);
+
+    // Write out the individual object ids.
+    bool write_as_reference = RawObject::IsCanonical(tags) ? false : true;
+    for (intptr_t i = 0; i < len; i++) {
+      WriteObjectImpl(data[i], write_as_reference);
+    }
   }
 }
 
@@ -2125,20 +2401,16 @@
     }
     // Not a closure of a top level method or static function, throw an
     // exception as we do not allow these objects to be serialized.
-    HANDLESCOPE(isolate());
+    HANDLESCOPE(thread());
 
-    const Class& clazz = Class::Handle(isolate(), cls);
-    const Function& errorFunc = Function::Handle(isolate(), func);
+    const Class& clazz = Class::Handle(zone(), cls);
+    const Function& errorFunc = Function::Handle(zone(), func);
     ASSERT(!errorFunc.IsNull());
 
     // All other closures are errors.
-    const char* format = "Illegal argument in isolate message"
-        " : (object is a closure - %s %s)";
-    UnmarkAll();  // Unmark objects now as we are about to print stuff.
-    intptr_t len = OS::SNPrint(NULL, 0, format,
-                               clazz.ToCString(), errorFunc.ToCString()) + 1;
-    char* chars = Thread::Current()->zone()->Alloc<char>(len);
-    OS::SNPrint(chars, len, format, clazz.ToCString(), errorFunc.ToCString());
+    char* chars = OS::SCreate(thread()->zone(),
+        "Illegal argument in isolate message : (object is a closure - %s %s)",
+        clazz.ToCString(), errorFunc.ToCString());
     SetWriteException(Exceptions::kArgument, chars);
   }
   return Function::null();
@@ -2160,14 +2432,12 @@
 void SnapshotWriter::CheckForNativeFields(RawClass* cls) {
   if (cls->ptr()->num_native_fields_ != 0) {
     // We do not allow objects with native fields in an isolate message.
-    HANDLESCOPE(isolate());
-    const char* format = "Illegal argument in isolate message"
-                         " : (object extends NativeWrapper - %s)";
-    UnmarkAll();  // Unmark objects now as we are about to print stuff.
-    const Class& clazz = Class::Handle(isolate(), cls);
-    intptr_t len = OS::SNPrint(NULL, 0, format, clazz.ToCString()) + 1;
-    char* chars = Thread::Current()->zone()->Alloc<char>(len);
-    OS::SNPrint(chars, len, format, clazz.ToCString());
+    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());
     SetWriteException(Exceptions::kArgument, chars);
   }
 }
@@ -2178,101 +2448,79 @@
   set_exception_type(type);
   set_exception_msg(msg);
   // The more specific error is set up in SnapshotWriter::ThrowException().
-  isolate()->long_jump_base()->
+  thread()->long_jump_base()->
       Jump(1, Object::snapshot_writer_error());
 }
 
 
-void SnapshotWriter::WriteInstance(intptr_t object_id,
-                                   RawObject* raw,
+void SnapshotWriter::WriteInstance(RawObject* raw,
                                    RawClass* cls,
-                                   intptr_t tags) {
+                                   intptr_t tags,
+                                   intptr_t object_id,
+                                   bool as_reference) {
   // Check if the instance has native fields and throw an exception if it does.
   CheckForNativeFields(cls);
 
-  // Check if object is a closure that is serializable, if the object is a
-  // closure that is not serializable this will throw an exception.
-  RawFunction* func = IsSerializableClosure(cls, raw);
-  if (func != Function::null()) {
-    WriteStaticImplicitClosure(object_id, func, tags);
-    return;
+  if ((kind() == Snapshot::kMessage) || (kind() == Snapshot::kScript)) {
+    // Check if object is a closure that is serializable, if the object is a
+    // closure that is not serializable this will throw an exception.
+    RawFunction* func = IsSerializableClosure(cls, raw);
+    if (func != Function::null()) {
+      forward_list_->SetState(object_id, kIsSerialized);
+      WriteStaticImplicitClosure(object_id, func, tags);
+      return;
+    }
   }
 
   // Object is regular dart instance.
-  intptr_t next_field_offset = Class::IsSignatureClass(cls) ?
-      Closure::InstanceSize() :
-      cls->ptr()->next_field_offset_in_words_ << kWordSizeLog2;
-  ASSERT(next_field_offset > 0);
+  if (as_reference) {
+    // Write out the serialization header value for this object.
+    WriteInlinedObjectHeader(kOmittedObjectId);
 
-  // Write out the serialization header value for this object.
-  WriteInlinedObjectHeader(object_id);
+    // Indicate this is an instance object.
+    Write<int32_t>(SerializedHeaderData::encode(kInstanceObjectId));
+    WriteTags(tags);
 
-  // Indicate this is an instance object.
-  Write<int32_t>(SerializedHeaderData::encode(kInstanceObjectId));
+    // Write out the class information for this object.
+    WriteObjectImpl(cls, kAsInlinedObject);
+  } else {
+    intptr_t next_field_offset = Class::IsSignatureClass(cls) ?
+        Closure::InstanceSize() :
+        cls->ptr()->next_field_offset_in_words_ << kWordSizeLog2;
+    ASSERT(next_field_offset > 0);
 
-  // Write out the tags.
-  WriteTags(tags);
+    // Write out the serialization header value for this object.
+    WriteInlinedObjectHeader(object_id);
 
-  // Write out the class information for this object.
-  WriteObjectImpl(cls, kAsInlinedObject);
+    // Indicate this is an instance object.
+    Write<int32_t>(SerializedHeaderData::encode(kInstanceObjectId));
 
-  // Write out all the fields for the object.
-  // Instance::NextFieldOffset() returns the offset of the first field in
-  // a Dart object.
-  bool as_reference = RawObject::IsCanonical(tags) ? false : true;
-  intptr_t offset = Instance::NextFieldOffset();
-  while (offset < next_field_offset) {
-    RawObject* raw_obj = *reinterpret_cast<RawObject**>(
-        reinterpret_cast<uword>(raw->ptr()) + offset);
-    WriteObjectImpl(raw_obj, as_reference);
-    offset += kWordSize;
+    // Write out the tags.
+    WriteTags(tags);
+
+    // Write out the class information for this object.
+    WriteObjectImpl(cls, kAsInlinedObject);
+
+    // Write out all the fields for the object.
+    // Instance::NextFieldOffset() returns the offset of the first field in
+    // a Dart object.
+    bool write_as_reference = RawObject::IsCanonical(tags) ? false : true;
+    intptr_t offset = Instance::NextFieldOffset();
+    while (offset < next_field_offset) {
+      RawObject* raw_obj = *reinterpret_cast<RawObject**>(
+          reinterpret_cast<uword>(raw->ptr()) + offset);
+      WriteObjectImpl(raw_obj, write_as_reference);
+      offset += kWordSize;
+    }
   }
   return;
 }
 
 
-void SnapshotWriter::WriteInstanceRef(RawObject* raw, RawClass* cls) {
-  // Check if the instance has native fields and throw an exception if it does.
-  CheckForNativeFields(cls);
-
-  // Check if object is a closure that is serializable, if the object is a
-  // closure that is not serializable this will throw an exception.
-  RawFunction* func = IsSerializableClosure(cls, raw);
-  if (func != Function::null()) {
-    // Add object to the forward ref list and mark it so that future references
-    // to this object in the snapshot will use this object id. Mark it as having
-    // been serialized so that we do not serialize the object when we go through
-    // the forward list.
-    forward_list_->MarkAndAddObject(raw, kIsSerialized);
-    uword tags = raw->ptr()->tags_;
-    ASSERT(SerializedHeaderTag::decode(tags) == kObjectId);
-    intptr_t object_id = SerializedHeaderData::decode(tags);
-    tags = forward_list_->NodeForObjectId(object_id)->tags();
-    WriteStaticImplicitClosure(object_id, func, tags);
-    return;
-  }
-
-  // Object is being referenced, add it to the forward ref list and mark
-  // it so that future references to this object in the snapshot will use
-  // this object id. Mark it as not having been serialized yet so that we
-  // will serialize the object when we go through the forward list.
-  intptr_t tags = raw->ptr()->tags_;
-  forward_list_->MarkAndAddObject(raw, kIsNotSerialized);
-
-  // Write out the serialization header value for this object.
-  WriteInlinedObjectHeader(kOmittedObjectId);
-
-  // Indicate this is an instance object.
-  Write<int32_t>(SerializedHeaderData::encode(kInstanceObjectId));
-  WriteTags(tags);
-
-  // Write out the class information for this object.
-  WriteObjectImpl(cls, kAsInlinedObject);
-}
-
-
 bool SnapshotWriter::AllowObjectsInDartLibrary(RawLibrary* library) {
-  return library == object_store()->typed_data_library();
+  return (library == object_store()->collection_library() ||
+          library == object_store()->core_library() ||
+          library == object_store()->typed_data_library());
 }
 
 
@@ -2290,7 +2538,6 @@
 void SnapshotWriter::ThrowException(Exceptions::ExceptionType type,
                                     const char* msg) {
   object_store()->clear_sticky_error();
-  UnmarkAll();
   if (msg != NULL) {
     const String& msg_obj = String::Handle(String::New(msg));
     const Array& args = Array::Handle(Array::New(1));
@@ -2321,12 +2568,16 @@
 ScriptSnapshotWriter::ScriptSnapshotWriter(uint8_t** buffer,
                                            ReAlloc alloc)
     : SnapshotWriter(Snapshot::kScript,
+                     Thread::Current(),
                      buffer,
                      alloc,
                      kInitialSize,
                      &forward_list_,
-                     true),
-      forward_list_(kMaxPredefinedObjectIds) {
+                     NULL, /* instructions_writer */
+                     true, /* can_send_any_object */
+                     false, /* snapshot_code */
+                     true /* vm_isolate_is_symbolic */),
+      forward_list_(thread(), kMaxPredefinedObjectIds) {
   ASSERT(buffer != NULL);
   ASSERT(alloc != NULL);
 }
@@ -2355,7 +2606,6 @@
       WriteObject(lib.raw());
 
       FillHeader(kind());
-      UnmarkAll();
     }
   } else {
     ThrowException(exception_type(), exception_msg());
@@ -2375,12 +2625,16 @@
                              ReAlloc alloc,
                              bool can_send_any_object)
     : SnapshotWriter(Snapshot::kMessage,
+                     Thread::Current(),
                      buffer,
                      alloc,
                      kInitialSize,
                      &forward_list_,
-                     can_send_any_object),
-      forward_list_(kMaxPredefinedObjectIds) {
+                     NULL, /* instructions_writer */
+                     can_send_any_object,
+                     false, /* snapshot_code */
+                     true /* vm_isolate_is_symbolic */),
+      forward_list_(thread(), kMaxPredefinedObjectIds) {
   ASSERT(buffer != NULL);
   ASSERT(alloc != NULL);
 }
@@ -2396,7 +2650,6 @@
   if (setjmp(*jump.Set()) == 0) {
     NoSafepointScope no_safepoint;
     WriteObject(obj.raw());
-    UnmarkAll();
   } else {
     ThrowException(exception_type(), exception_msg());
   }
diff --git a/runtime/vm/snapshot.h b/runtime/vm/snapshot.h
index 4b3a278..949f897 100644
--- a/runtime/vm/snapshot.h
+++ b/runtime/vm/snapshot.h
@@ -22,14 +22,17 @@
 class Array;
 class Class;
 class ClassTable;
+class Code;
 class ExternalTypedData;
 class GrowableObjectArray;
 class Heap;
+class Instructions;
 class LanguageError;
 class Library;
 class Object;
 class PassiveObject;
 class ObjectStore;
+class MegamorphicCache;
 class PageSpace;
 class RawApiError;
 class RawArray;
@@ -39,32 +42,42 @@
 class RawClass;
 class RawClosureData;
 class RawContext;
+class RawContextScope;
 class RawDouble;
+class RawExceptionHandlers;
 class RawField;
 class RawFloat32x4;
 class RawFloat64x2;
 class RawFunction;
 class RawGrowableObjectArray;
+class RawICData;
 class RawImmutableArray;
+class RawInstructions;
 class RawInt32x4;
 class RawLanguageError;
 class RawLibrary;
 class RawLibraryPrefix;
 class RawLinkedHashMap;
 class RawLiteralToken;
+class RawLocalVarDescriptors;
+class RawMegamorphicCache;
 class RawMint;
 class RawMixinAppType;
 class RawBigint;
 class RawNamespace;
 class RawObject;
+class RawObjectPool;
 class RawOneByteString;
 class RawPatchClass;
+class RawPcDescriptors;
 class RawReceivePort;
 class RawRedirectionData;
 class RawScript;
 class RawSendPort;
 class RawSmi;
+class RawStackmap;
 class RawStacktrace;
+class RawSubtypeTestCache;
 class RawTokenStream;
 class RawTwoByteString;
 class RawType;
@@ -183,6 +196,32 @@
 };
 
 
+class InstructionsSnapshot : ValueObject {
+ public:
+  explicit InstructionsSnapshot(const void* 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);
+  }
+
+  uword instructions_size() {
+    uword snapshot_size = *reinterpret_cast<const uword*>(raw_memory_);
+    return snapshot_size - kHeaderSize;
+  }
+
+  static const intptr_t kHeaderSize = OS::kMaxPreferredCodeAlignment;
+
+ private:
+  const void* raw_memory_;  // The symbol kInstructionsSnapshot.
+
+  DISALLOW_COPY_AND_ASSIGN(InstructionsSnapshot);
+};
+
+
 class BaseReader {
  public:
   BaseReader(const uint8_t* buffer, intptr_t size) : stream_(buffer, size) {}
@@ -290,14 +329,33 @@
 };
 
 
+class InstructionsReader : public ZoneAllocated {
+ public:
+  explicit InstructionsReader(const uint8_t* buffer)
+    : buffer_(buffer) {
+    ASSERT(buffer != NULL);
+    ASSERT(Utils::IsAligned(reinterpret_cast<uword>(buffer),
+                            OS::PreferredCodeAlignment()));
+  }
+
+  RawInstructions* GetInstructionsAt(int32_t offset, uword expected_tags);
+
+ private:
+  const uint8_t* buffer_;
+
+  DISALLOW_COPY_AND_ASSIGN(InstructionsReader);
+};
+
+
 // Reads a snapshot into objects.
 class SnapshotReader : public BaseReader {
  public:
+  Thread* thread() const { return thread_; }
   Zone* zone() const { return zone_; }
-  Isolate* isolate() const { return isolate_; }
+  Isolate* isolate() const { return thread_->isolate(); }
   Heap* heap() const { return heap_; }
-  ObjectStore* object_store() const { return isolate_->object_store(); }
-  ClassTable* class_table() const { return isolate_->class_table(); }
+  ObjectStore* object_store() const { return isolate()->object_store(); }
+  ClassTable* class_table() const { return isolate()->class_table(); }
   PassiveObject* PassiveObjectHandle() { return &pobj_; }
   Array* ArrayHandle() { return &array_; }
   String* StringHandle() { return &str_; }
@@ -307,8 +365,11 @@
   TokenStream* StreamHandle() { return &stream_; }
   ExternalTypedData* DataHandle() { return &data_; }
   TypedData* TypedDataHandle() { return &typed_data_; }
+  Code* CodeHandle() { return &code_; }
+  Function* FunctionHandle() { return &function_; }
+  MegamorphicCache* MegamorphicCacheHandle() { return &megamorphic_cache_; }
   Snapshot::Kind kind() const { return kind_; }
-  bool allow_code() const { return false; }
+  bool snapshot_code() const { return snapshot_code_; }
 
   // Reads an object.
   RawObject* ReadObject();
@@ -357,6 +418,17 @@
   RawClosureData* NewClosureData();
   RawRedirectionData* NewRedirectionData();
   RawFunction* NewFunction();
+  RawCode* NewCode(intptr_t pointer_offsets_length);
+  RawObjectPool* NewObjectPool(intptr_t length);
+  RawPcDescriptors* NewPcDescriptors(intptr_t length);
+  RawLocalVarDescriptors* NewLocalVarDescriptors(intptr_t num_entries);
+  RawExceptionHandlers* NewExceptionHandlers(intptr_t num_entries);
+  RawStackmap* NewStackmap(intptr_t length);
+  RawContextScope* NewContextScope(intptr_t num_variables);
+  RawICData* NewICData();
+  RawMegamorphicCache* NewMegamorphicCache();
+  RawSubtypeTestCache* NewSubtypeTestCache();
+  RawLinkedHashMap* NewLinkedHashMap();
   RawField* NewField();
   RawLibrary* NewLibrary();
   RawLibraryPrefix* NewLibraryPrefix();
@@ -373,13 +445,19 @@
   RawObject* NewInteger(int64_t value);
   RawStacktrace* NewStacktrace();
 
+  RawInstructions* GetInstructionsAt(int32_t offset, uword expected_tags) {
+    return instructions_reader_->GetInstructionsAt(offset, expected_tags);
+  }
+
+  const uint8_t* instructions_buffer_;
+
  protected:
   SnapshotReader(const uint8_t* buffer,
                  intptr_t size,
+                 const uint8_t* instructions_buffer,
                  Snapshot::Kind kind,
                  ZoneGrowableArray<BackRefNode>* backward_references,
-                 Isolate* isolate,
-                 Zone* zone);
+                 Thread* thread);
   ~SnapshotReader() { }
 
   ZoneGrowableArray<BackRefNode>* GetBackwardReferenceTable() const {
@@ -393,6 +471,7 @@
   RawObject* AllocateUninitialized(intptr_t class_id, intptr_t size);
 
   RawClass* ReadClassId(intptr_t object_id);
+  RawFunction* ReadFunctionId(intptr_t object_id);
   RawObject* ReadStaticImplicitClosure(intptr_t object_id, intptr_t cls_header);
 
   // Implementation to read an object.
@@ -453,7 +532,8 @@
   bool is_vm_isolate() const;
 
   Snapshot::Kind kind_;  // Indicates type of snapshot(full, script, message).
-  Isolate* isolate_;  // Current isolate.
+  bool snapshot_code_;
+  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.
@@ -470,52 +550,65 @@
   TokenStream& stream_;  // Temporary token stream handle.
   ExternalTypedData& data_;  // Temporary stream data handle.
   TypedData& typed_data_;  // Temporary typed data handle.
+  Code& code_;  // Temporary code handle.
+  Function& function_;  // Temporary function handle.
+  MegamorphicCache& megamorphic_cache_;  // Temporary megamorphic cache handle.
   UnhandledException& error_;  // Error handle.
   intptr_t max_vm_isolate_object_id_;
   ZoneGrowableArray<BackRefNode>* backward_references_;
+  InstructionsReader* instructions_reader_;
 
   friend class ApiError;
   friend class Array;
+  friend class Bigint;
   friend class BoundedType;
-  friend class MixinAppType;
   friend class Class;
+  friend class ClosureData;
+  friend class Code;
   friend class Context;
   friend class ContextScope;
+  friend class ExceptionHandlers;
   friend class Field;
-  friend class ClosureData;
-  friend class RedirectionData;
   friend class Function;
   friend class GrowableObjectArray;
-  friend class LinkedHashMap;
+  friend class ICData;
   friend class ImmutableArray;
+  friend class Instructions;
   friend class JSRegExp;
   friend class LanguageError;
   friend class Library;
   friend class LibraryPrefix;
-  friend class Namespace;
-  friend class Bigint;
+  friend class LinkedHashMap;
   friend class LiteralToken;
+  friend class LocalVarDescriptors;
+  friend class MegamorphicCache;
+  friend class MirrorReference;
+  friend class MixinAppType;
+  friend class Namespace;
+  friend class ObjectPool;
   friend class PatchClass;
+  friend class RedirectionData;
   friend class Script;
   friend class Stacktrace;
+  friend class SubtypeTestCache;
   friend class TokenStream;
   friend class Type;
   friend class TypeArguments;
   friend class TypeParameter;
   friend class TypeRef;
-  friend class UnresolvedClass;
   friend class UnhandledException;
+  friend class UnresolvedClass;
   friend class WeakProperty;
-  friend class MirrorReference;
-  friend class ExceptionHandlers;
-  friend class LocalVarDescriptors;
   DISALLOW_COPY_AND_ASSIGN(SnapshotReader);
 };
 
 
 class VmIsolateSnapshotReader : public SnapshotReader {
  public:
-  VmIsolateSnapshotReader(const uint8_t* buffer, intptr_t size, Zone* zone);
+  VmIsolateSnapshotReader(const uint8_t* buffer,
+                          intptr_t size,
+                          const uint8_t* instructions_buffer,
+                          Thread* thread);
   ~VmIsolateSnapshotReader();
 
   RawApiError* ReadVmIsolateSnapshot();
@@ -529,8 +622,8 @@
  public:
   IsolateSnapshotReader(const uint8_t* buffer,
                         intptr_t size,
-                        Isolate* isolate,
-                        Zone* zone);
+                        const uint8_t* instructions_buffer,
+                        Thread* thread);
   ~IsolateSnapshotReader();
 
  private:
@@ -542,8 +635,7 @@
  public:
   ScriptSnapshotReader(const uint8_t* buffer,
                        intptr_t size,
-                       Isolate* isolate,
-                       Zone* zone);
+                       Thread* thread);
   ~ScriptSnapshotReader();
 
  private:
@@ -555,8 +647,7 @@
  public:
   MessageSnapshotReader(const uint8_t* buffer,
                         intptr_t size,
-                        Isolate* isolate,
-                        Zone* zone);
+                        Thread* thread);
   ~MessageSnapshotReader();
 
  private:
@@ -659,23 +750,20 @@
 
 class ForwardList {
  public:
-  explicit ForwardList(intptr_t first_object_id);
+  explicit ForwardList(Thread* thread, intptr_t first_object_id);
   ~ForwardList();
 
   class Node : public ZoneAllocated {
    public:
-    Node(RawObject* raw, uword tags, SerializeState state)
-        : raw_(raw), tags_(tags), state_(state) {}
-    RawObject* raw() const { return raw_; }
-    uword tags() const { return tags_; }
+    Node(const Object* obj, SerializeState state) : obj_(obj), state_(state) {}
+    const Object* obj() const { return obj_; }
     bool is_serialized() const { return state_ == kIsSerialized; }
 
    private:
     // Private to ensure the invariant of first_unprocessed_object_id_.
     void set_state(SerializeState value) { state_ = value; }
 
-    RawObject* raw_;
-    uword tags_;
+    const Object* obj_;
     SerializeState state_;
 
     friend class ForwardList;
@@ -687,10 +775,7 @@
   }
 
   // Returns the id for the added object.
-  intptr_t MarkAndAddObject(RawObject* raw, SerializeState state);
-
-  // Returns the id for the added object without marking it.
-  intptr_t AddObject(RawObject* raw, SerializeState state);
+  intptr_t AddObject(Zone* zone, RawObject* raw, SerializeState state);
 
   // Returns the id for the object it it exists in the list.
   intptr_t FindObject(RawObject* raw);
@@ -699,13 +784,17 @@
   // concurrently add more objects.
   void SerializeAll(ObjectVisitor* writer);
 
-  // Restores the tags of all objects in this list.
-  void UnmarkAll() const;
+  // Set state of object in forward list.
+  void SetState(intptr_t object_id, SerializeState state) {
+    NodeForObjectId(object_id)->set_state(state);
+  }
 
  private:
   intptr_t first_object_id() const { return first_object_id_; }
   intptr_t next_object_id() const { return nodes_.length() + first_object_id_; }
+  Heap* heap() const { return thread_->isolate()->heap(); }
 
+  Thread* thread_;
   const intptr_t first_object_id_;
   GrowableArray<Node*> nodes_;
   intptr_t first_unprocessed_object_id_;
@@ -715,19 +804,87 @@
 };
 
 
+class InstructionsWriter : public ZoneAllocated {
+ public:
+  InstructionsWriter(uint8_t** buffer,
+                     ReAlloc alloc,
+                     intptr_t initial_size)
+    : stream_(buffer, alloc, initial_size),
+      next_offset_(InstructionsSnapshot::kHeaderSize),
+      instructions_() {
+    ASSERT(buffer != NULL);
+    ASSERT(alloc != NULL);
+  }
+
+  // Size of the snapshot.
+  intptr_t BytesWritten() const { return stream_.bytes_written(); }
+
+  int32_t GetOffsetFor(RawInstructions* instructions);
+
+  void SetInstructionsCode(RawInstructions* insns, RawCode* code) {
+    for (intptr_t i = 0; i < instructions_.length(); i++) {
+      if (instructions_[i].raw_insns_ == insns) {
+        instructions_[i].raw_code_ = code;
+        return;
+      }
+    }
+    UNREACHABLE();
+  }
+
+  void WriteAssembly();
+
+ private:
+  struct InstructionsData {
+    explicit InstructionsData(RawInstructions* insns)
+        : raw_insns_(insns), raw_code_(NULL) { }
+
+    union {
+      RawInstructions* raw_insns_;
+      const Instructions* insns_;
+    };
+    union {
+      RawCode* raw_code_;
+      const Code* code_;
+    };
+  };
+
+  void WriteWordLiteral(uword value) {
+    // Padding is helpful for comparing the .S with --disassemble.
+#if defined(ARCH_IS_64_BIT)
+    stream_.Print(".quad 0x%0.16" Px "\n", value);
+#else
+    stream_.Print(".long 0x%0.8" Px "\n", value);
+#endif
+  }
+
+  WriteStream stream_;
+  intptr_t next_offset_;
+  GrowableArray<InstructionsData> instructions_;
+
+  DISALLOW_COPY_AND_ASSIGN(InstructionsWriter);
+};
+
+
 class SnapshotWriter : public BaseWriter {
  protected:
   SnapshotWriter(Snapshot::Kind kind,
+                 Thread* thread,
                  uint8_t** buffer,
                  ReAlloc alloc,
                  intptr_t initial_size,
                  ForwardList* forward_list,
-                 bool can_send_any_object);
+                 InstructionsWriter* instructions_writer,
+                 bool can_send_any_object,
+                 bool snapshot_code,
+                 bool vm_isolate_is_symbolic);
 
  public:
   // Snapshot kind.
   Snapshot::Kind kind() const { return kind_; }
-  bool allow_code() const { return false; }
+  Thread* thread() const { return thread_; }
+  Zone* zone() const { return thread_->zone(); }
+  Isolate* isolate() const { return thread_->isolate(); }
+  Heap* heap() const { return isolate()->heap(); }
 
   // Serialize an object into the buffer.
   void WriteObject(RawObject* raw);
@@ -745,6 +902,8 @@
     exception_msg_ = msg;
   }
   bool can_send_any_object() const { return can_send_any_object_; }
+  bool snapshot_code() const { return snapshot_code_; }
+  bool vm_isolate_is_symbolic() const { return vm_isolate_is_symbolic_; }
   void ThrowException(Exceptions::ExceptionType type, const char* msg);
 
   // Write a version string for the snapshot.
@@ -752,40 +911,46 @@
 
   static intptr_t FirstObjectId();
 
- protected:
-  void UnmarkAll() {
-    if (!unmarked_objects_ && forward_list_ != NULL) {
-      forward_list_->UnmarkAll();
-      unmarked_objects_ = true;
-    }
+  int32_t GetInstructionsId(RawInstructions* instructions) {
+    return instructions_writer_->GetOffsetFor(instructions);
   }
 
+  void SetInstructionsCode(RawInstructions* instructions, RawCode* code) {
+    return instructions_writer_->SetInstructionsCode(instructions, code);
+  }
+
+  void WriteFunctionId(RawFunction* func, bool owner_is_class);
+
+ protected:
   bool CheckAndWritePredefinedObject(RawObject* raw);
-  void HandleVMIsolateObject(RawObject* raw);
+  bool HandleVMIsolateObject(RawObject* raw);
 
   void WriteClassId(RawClass* cls);
   void WriteStaticImplicitClosure(intptr_t object_id,
                                   RawFunction* func,
                                   intptr_t tags);
   void WriteObjectImpl(RawObject* raw, bool as_reference);
-  void WriteObjectRef(RawObject* raw);
-  void WriteInlinedObject(RawObject* raw);
+  void WriteMarkedObjectImpl(RawObject* raw,
+                             intptr_t tags,
+                             intptr_t object_id,
+                             bool as_reference);
   void WriteForwardedObjects();
   void ArrayWriteTo(intptr_t object_id,
                     intptr_t array_kind,
                     intptr_t tags,
                     RawSmi* length,
                     RawTypeArguments* type_arguments,
-                    RawObject* data[]);
+                    RawObject* data[],
+                    bool as_reference);
   RawFunction* IsSerializableClosure(RawClass* cls, RawObject* obj);
   RawClass* GetFunctionOwner(RawFunction* func);
   void CheckForNativeFields(RawClass* cls);
   void SetWriteException(Exceptions::ExceptionType type, const char* msg);
-  void WriteInstance(intptr_t object_id,
-                     RawObject* raw,
+  void WriteInstance(RawObject* raw,
                      RawClass* cls,
-                     intptr_t tags);
-  void WriteInstanceRef(RawObject* raw, RawClass* cls);
+                     intptr_t tags,
+                     intptr_t object_id,
+                     bool as_reference);
   bool AllowObjectsInDartLibrary(RawLibrary* library);
   intptr_t FindVmSnapshotObject(RawObject* rawobj);
 
@@ -798,39 +963,47 @@
     forward_list_ = NULL;
   }
 
-  Isolate* isolate() const { return isolate_; }
   ObjectStore* object_store() const { return object_store_; }
 
  private:
   Snapshot::Kind kind_;
-  Isolate* isolate_;
+  Thread* thread_;
   ObjectStore* object_store_;  // Object store for common classes.
   ClassTable* class_table_;  // Class table for the class index to class lookup.
   ForwardList* forward_list_;
+  InstructionsWriter* instructions_writer_;
   Exceptions::ExceptionType exception_type_;  // Exception type.
   const char* exception_msg_;  // Message associated with exception.
   bool unmarked_objects_;  // True if marked objects have been unmarked.
   bool can_send_any_object_;  // True if any Dart instance can be sent.
+  bool snapshot_code_;
+  bool vm_isolate_is_symbolic_;
 
   friend class FullSnapshotWriter;
   friend class RawArray;
   friend class RawClass;
   friend class RawClosureData;
+  friend class RawContextScope;
+  friend class RawExceptionHandlers;
+  friend class RawField;
+  friend class RawFunction;
   friend class RawGrowableObjectArray;
-  friend class RawLinkedHashMap;
   friend class RawImmutableArray;
+  friend class RawInstructions;
   friend class RawJSRegExp;
   friend class RawLibrary;
+  friend class RawLinkedHashMap;
   friend class RawLiteralToken;
+  friend class RawLocalVarDescriptors;
   friend class RawMirrorReference;
+  friend class RawObjectPool;
   friend class RawReceivePort;
   friend class RawScript;
   friend class RawStacktrace;
+  friend class RawSubtypeTestCache;
   friend class RawTokenStream;
   friend class RawTypeArguments;
   friend class RawUserTag;
-  friend class RawExceptionHandlers;
-  friend class RawLocalVarDescriptors;
   friend class SnapshotWriterVisitor;
   friend class WriteInlinedObjectVisitor;
   DISALLOW_COPY_AND_ASSIGN(SnapshotWriter);
@@ -842,7 +1015,10 @@
   static const intptr_t kInitialSize = 64 * KB;
   FullSnapshotWriter(uint8_t** vm_isolate_snapshot_buffer,
                      uint8_t** isolate_snapshot_buffer,
-                     ReAlloc alloc);
+                     uint8_t** instructions_snapshot_buffer,
+                     ReAlloc alloc,
+                     bool snapshot_code,
+                     bool vm_isolate_is_symbolic);
   ~FullSnapshotWriter();
 
   uint8_t** vm_isolate_snapshot_buffer() {
@@ -853,6 +1029,11 @@
     return isolate_snapshot_buffer_;
   }
 
+  Thread* thread() const { return thread_; }
+  Zone* zone() const { return thread_->zone(); }
+  Isolate* isolate() const { return thread_->isolate(); }
+  Heap* heap() const { return isolate()->heap(); }
+
   // Writes a full snapshot of the Isolate.
   void WriteFullSnapshot();
 
@@ -862,6 +1043,9 @@
   intptr_t IsolateSnapshotSize() const {
     return isolate_snapshot_size_;
   }
+  intptr_t InstructionsSnapshotSize() const {
+    return instructions_snapshot_size_;
+  }
 
  private:
   // Writes a snapshot of the VM Isolate.
@@ -870,20 +1054,35 @@
   // Writes a full snapshot of a regular Dart Isolate.
   void WriteIsolateFullSnapshot();
 
-  Isolate* isolate_;
+  Thread* thread_;
   uint8_t** vm_isolate_snapshot_buffer_;
   uint8_t** isolate_snapshot_buffer_;
+  uint8_t** instructions_snapshot_buffer_;
   ReAlloc alloc_;
   intptr_t vm_isolate_snapshot_size_;
   intptr_t isolate_snapshot_size_;
+  intptr_t instructions_snapshot_size_;
   ForwardList* forward_list_;
+  InstructionsWriter* instructions_writer_;
   Array& scripts_;
   Array& symbol_table_;
+  bool snapshot_code_;
+  bool vm_isolate_is_symbolic_;
 
   DISALLOW_COPY_AND_ASSIGN(FullSnapshotWriter);
 };
 
 
+class PrecompiledSnapshotWriter : public FullSnapshotWriter {
+ public:
+  PrecompiledSnapshotWriter(uint8_t** vm_isolate_snapshot_buffer,
+                            uint8_t** isolate_snapshot_buffer,
+                            uint8_t** instructions_snapshot_buffer,
+                            ReAlloc alloc);
+  ~PrecompiledSnapshotWriter();
+};
+
+
 class ScriptSnapshotWriter : public SnapshotWriter {
  public:
   static const intptr_t kInitialSize = 64 * KB;
@@ -919,11 +1118,6 @@
 // objects to a snap shot.
 class SnapshotWriterVisitor : public ObjectPointerVisitor {
  public:
-  explicit SnapshotWriterVisitor(SnapshotWriter* writer)
-      : ObjectPointerVisitor(Isolate::Current()),
-        writer_(writer),
-        as_references_(true) {}
-
   SnapshotWriterVisitor(SnapshotWriter* writer, bool as_references)
       : ObjectPointerVisitor(Isolate::Current()),
         writer_(writer),
diff --git a/runtime/vm/snapshot_ids.h b/runtime/vm/snapshot_ids.h
index dc1500e..856887d 100644
--- a/runtime/vm/snapshot_ids.h
+++ b/runtime/vm/snapshot_ids.h
@@ -6,6 +6,7 @@
 #define VM_SNAPSHOT_IDS_H_
 
 #include "vm/raw_object.h"
+#include "vm/dart_entry.h"
 
 namespace dart {
 
@@ -13,6 +14,7 @@
 enum {
   kNullObject = 0,
   kSentinelObject,
+  kTransitionSentinelObject,
   kEmptyArrayObject,
   kZeroArrayObject,
   kTrueValue,
@@ -41,6 +43,18 @@
   kStringType,
   kArrayType,
 
+  kExtractorParameterTypes,
+  kExtractorParameterNames,
+  kEmptyContextScopeObject,
+  kImplicitClosureScopeObject,
+  kEmptyObjectPool,
+  kEmptyDescriptors,
+  kEmptyVarDescriptors,
+  kEmptyExceptionHandlers,
+  kCachedArgumentsDescriptor0,
+  kCachedArgumentsDescriptorN = (kCachedArgumentsDescriptor0 +
+      ArgumentsDescriptor::kCachedDescriptorCount - 1),
+
   kInstanceObjectId,
   kStaticImplicitClosureObjectId,
   kMaxPredefinedObjectIds,
diff --git a/runtime/vm/snapshot_test.cc b/runtime/vm/snapshot_test.cc
index 0c4ccaa..5103296 100644
--- a/runtime/vm/snapshot_test.cc
+++ b/runtime/vm/snapshot_test.cc
@@ -135,7 +135,7 @@
   ApiMessageWriter writer(&buffer, &malloc_allocator);
   writer.WriteCMessage(root);
 
-  ApiMessageReader api_reader(buffer, writer.BytesWritten(), &zone_allocator);
+  ApiMessageReader api_reader(buffer, writer.BytesWritten());
   Dart_CObject* new_root = api_reader.ReadMessage();
 
   // Check that the two messages are the same.
@@ -152,7 +152,7 @@
 
 
 TEST_CASE(SerializeNull) {
-  StackZone zone(Isolate::Current());
+  StackZone zone(thread);
 
   // Write snapshot with object content.
   const Object& null_object = Object::Handle();
@@ -162,16 +162,13 @@
   intptr_t buffer_len = writer.BytesWritten();
 
   // Read object back from the snapshot.
-  MessageSnapshotReader reader(buffer,
-                               buffer_len,
-                               Isolate::Current(),
-                               zone.GetZone());
+  MessageSnapshotReader reader(buffer, buffer_len, thread);
   const Object& serialized_object = Object::Handle(reader.ReadObject());
   EXPECT(Equals(null_object, serialized_object));
 
   // Read object back from the snapshot into a C structure.
   ApiNativeScope scope;
-  ApiMessageReader api_reader(buffer, buffer_len, &zone_allocator);
+  ApiMessageReader api_reader(buffer, buffer_len);
   Dart_CObject* root = api_reader.ReadMessage();
   EXPECT_NOTNULL(root);
   EXPECT_EQ(Dart_CObject_kNull, root->type);
@@ -180,7 +177,7 @@
 
 
 TEST_CASE(SerializeSmi1) {
-  StackZone zone(Isolate::Current());
+  StackZone zone(thread);
 
   // Write snapshot with object content.
   const Smi& smi = Smi::Handle(Smi::New(124));
@@ -190,16 +187,13 @@
   intptr_t buffer_len = writer.BytesWritten();
 
   // Read object back from the snapshot.
-  MessageSnapshotReader reader(buffer,
-                               buffer_len,
-                               Isolate::Current(),
-                               zone.GetZone());
+  MessageSnapshotReader reader(buffer, buffer_len, thread);
   const Object& serialized_object = Object::Handle(reader.ReadObject());
   EXPECT(Equals(smi, serialized_object));
 
   // Read object back from the snapshot into a C structure.
   ApiNativeScope scope;
-  ApiMessageReader api_reader(buffer, buffer_len, &zone_allocator);
+  ApiMessageReader api_reader(buffer, buffer_len);
   Dart_CObject* root = api_reader.ReadMessage();
   EXPECT_NOTNULL(root);
   EXPECT_EQ(Dart_CObject_kInt32, root->type);
@@ -209,7 +203,7 @@
 
 
 TEST_CASE(SerializeSmi2) {
-  StackZone zone(Isolate::Current());
+  StackZone zone(thread);
 
   // Write snapshot with object content.
   const Smi& smi = Smi::Handle(Smi::New(-1));
@@ -219,16 +213,13 @@
   intptr_t buffer_len = writer.BytesWritten();
 
   // Read object back from the snapshot.
-  MessageSnapshotReader reader(buffer,
-                               buffer_len,
-                               Isolate::Current(),
-                               zone.GetZone());
+  MessageSnapshotReader reader(buffer, buffer_len, thread);
   const Object& serialized_object = Object::Handle(reader.ReadObject());
   EXPECT(Equals(smi, serialized_object));
 
   // Read object back from the snapshot into a C structure.
   ApiNativeScope scope;
-  ApiMessageReader api_reader(buffer, buffer_len, &zone_allocator);
+  ApiMessageReader api_reader(buffer, buffer_len);
   Dart_CObject* root = api_reader.ReadMessage();
   EXPECT_NOTNULL(root);
   EXPECT_EQ(Dart_CObject_kInt32, root->type);
@@ -246,18 +237,16 @@
 
   {
     // Switch to a regular zone, where VM handle allocation is allowed.
-    StackZone zone(Isolate::Current());
+    Thread* thread = Thread::Current();
+    StackZone zone(thread);
     // Read object back from the snapshot.
-    MessageSnapshotReader reader(buffer,
-                                 buffer_len,
-                                 Isolate::Current(),
-                                 Thread::Current()->zone());
+    MessageSnapshotReader reader(buffer, buffer_len, thread);
     const Object& serialized_object = Object::Handle(reader.ReadObject());
     EXPECT(serialized_object.IsMint());
   }
 
   // Read object back from the snapshot into a C structure.
-  ApiMessageReader api_reader(buffer, buffer_len, &zone_allocator);
+  ApiMessageReader api_reader(buffer, buffer_len);
   Dart_CObject* root = api_reader.ReadMessage();
   EXPECT_NOTNULL(root);
   CheckEncodeDecodeMessage(root);
@@ -266,11 +255,11 @@
 
 
 void CheckMint(int64_t value) {
-  StackZone zone(Isolate::Current());
+  ApiNativeScope scope;
+  StackZone zone(Thread::Current());
 
   Mint& mint = Mint::Handle();
   mint ^= Integer::New(value);
-  ApiNativeScope scope;
   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
@@ -312,7 +301,7 @@
 
 
 TEST_CASE(SerializeDouble) {
-  StackZone zone(Isolate::Current());
+  StackZone zone(thread);
 
   // Write snapshot with object content.
   const Double& dbl = Double::Handle(Double::New(101.29));
@@ -322,16 +311,13 @@
   intptr_t buffer_len = writer.BytesWritten();
 
   // Read object back from the snapshot.
-  MessageSnapshotReader reader(buffer,
-                               buffer_len,
-                               Isolate::Current(),
-                               zone.GetZone());
+  MessageSnapshotReader reader(buffer, buffer_len, thread);
   const Object& serialized_object = Object::Handle(reader.ReadObject());
   EXPECT(Equals(dbl, serialized_object));
 
   // Read object back from the snapshot into a C structure.
   ApiNativeScope scope;
-  ApiMessageReader api_reader(buffer, buffer_len, &zone_allocator);
+  ApiMessageReader api_reader(buffer, buffer_len);
   Dart_CObject* root = api_reader.ReadMessage();
   EXPECT_NOTNULL(root);
   EXPECT_EQ(Dart_CObject_kDouble, root->type);
@@ -341,7 +327,7 @@
 
 
 TEST_CASE(SerializeTrue) {
-  StackZone zone(Isolate::Current());
+  StackZone zone(thread);
 
   // Write snapshot with true object.
   const Bool& bl = Bool::True();
@@ -351,10 +337,7 @@
   intptr_t buffer_len = writer.BytesWritten();
 
   // Read object back from the snapshot.
-  MessageSnapshotReader reader(buffer,
-                               buffer_len,
-                               Isolate::Current(),
-                               zone.GetZone());
+  MessageSnapshotReader reader(buffer, buffer_len, thread);
   const Object& serialized_object = Object::Handle(reader.ReadObject());
   fprintf(stderr, "%s / %s\n", bl.ToCString(), serialized_object.ToCString());
 
@@ -362,7 +345,7 @@
 
   // Read object back from the snapshot into a C structure.
   ApiNativeScope scope;
-  ApiMessageReader api_reader(buffer, buffer_len, &zone_allocator);
+  ApiMessageReader api_reader(buffer, buffer_len);
   Dart_CObject* root = api_reader.ReadMessage();
   EXPECT_NOTNULL(root);
   EXPECT_EQ(Dart_CObject_kBool, root->type);
@@ -372,7 +355,7 @@
 
 
 TEST_CASE(SerializeFalse) {
-  StackZone zone(Isolate::Current());
+  StackZone zone(thread);
 
   // Write snapshot with false object.
   const Bool& bl = Bool::False();
@@ -382,16 +365,13 @@
   intptr_t buffer_len = writer.BytesWritten();
 
   // Read object back from the snapshot.
-  MessageSnapshotReader reader(buffer,
-                               buffer_len,
-                               Isolate::Current(),
-                               zone.GetZone());
+  MessageSnapshotReader reader(buffer, buffer_len, thread);
   const Object& serialized_object = Object::Handle(reader.ReadObject());
   EXPECT(Equals(bl, serialized_object));
 
   // Read object back from the snapshot into a C structure.
   ApiNativeScope scope;
-  ApiMessageReader api_reader(buffer, buffer_len, &zone_allocator);
+  ApiMessageReader api_reader(buffer, buffer_len);
   Dart_CObject* root = api_reader.ReadMessage();
   EXPECT_NOTNULL(root);
   EXPECT_EQ(Dart_CObject_kBool, root->type);
@@ -406,8 +386,6 @@
 
 
 TEST_CASE(SerializeCapability) {
-  StackZone zone(Isolate::Current());
-
   // Write snapshot with object content.
   const Capability& capability = Capability::Handle(Capability::New(12345));
   uint8_t* buffer;
@@ -416,10 +394,7 @@
   intptr_t buffer_len = writer.BytesWritten();
 
   // Read object back from the snapshot.
-  MessageSnapshotReader reader(buffer,
-                               buffer_len,
-                               Isolate::Current(),
-                               zone.GetZone());
+  MessageSnapshotReader reader(buffer, buffer_len, thread);
   Capability& obj = Capability::Handle();
   obj ^= reader.ReadObject();
 
@@ -427,7 +402,7 @@
 
   // Read object back from the snapshot into a C structure.
   ApiNativeScope scope;
-  ApiMessageReader api_reader(buffer, buffer_len, &zone_allocator);
+  ApiMessageReader api_reader(buffer, buffer_len);
   Dart_CObject* root = api_reader.ReadMessage();
   EXPECT_NOTNULL(root);
   EXPECT_EQ(Dart_CObject_kCapability, root->type);
@@ -438,8 +413,6 @@
 
 
 TEST_CASE(SerializeBigint) {
-  StackZone zone(Isolate::Current());
-
   // Write snapshot with object content.
   const char* cstr = "0x270FFFFFFFFFFFFFD8F0";
   const String& str = String::Handle(String::New(cstr));
@@ -451,10 +424,7 @@
   intptr_t buffer_len = writer.BytesWritten();
 
   // Read object back from the snapshot.
-  MessageSnapshotReader reader(buffer,
-                               buffer_len,
-                               Isolate::Current(),
-                               zone.GetZone());
+  MessageSnapshotReader reader(buffer, buffer_len, thread);
   Bigint& obj = Bigint::Handle();
   obj ^= reader.ReadObject();
 
@@ -462,7 +432,7 @@
 
   // Read object back from the snapshot into a C structure.
   ApiNativeScope scope;
-  ApiMessageReader api_reader(buffer, buffer_len, &zone_allocator);
+  ApiMessageReader api_reader(buffer, buffer_len);
   Dart_CObject* root = api_reader.ReadMessage();
   EXPECT_NOTNULL(root);
   EXPECT_EQ(Dart_CObject_kBigint, root->type);
@@ -482,12 +452,10 @@
 
   {
     // Switch to a regular zone, where VM handle allocation is allowed.
-    StackZone zone(Isolate::Current());
+    Thread* thread = Thread::Current();
+    StackZone zone(thread);
     // Read object back from the snapshot.
-    MessageSnapshotReader reader(buffer,
-                                 buffer_len,
-                                 Isolate::Current(),
-                                 Thread::Current()->zone());
+    MessageSnapshotReader reader(buffer, buffer_len, thread);
     Bigint& serialized_bigint = Bigint::Handle();
     serialized_bigint ^= reader.ReadObject();
     const char* str1 = bigint.ToHexCString(allocator);
@@ -498,7 +466,7 @@
   }
 
   // Read object back from the snapshot into a C structure.
-  ApiMessageReader api_reader(buffer, buffer_len, &zone_allocator);
+  ApiMessageReader api_reader(buffer, buffer_len);
   Dart_CObject* root = api_reader.ReadMessage();
   // Bigint not supported.
   EXPECT_NOTNULL(root);
@@ -508,10 +476,10 @@
 
 
 void CheckBigint(const char* bigint_value) {
-  StackZone zone(Isolate::Current());
+  ApiNativeScope scope;
+  StackZone zone(Thread::Current());
   Bigint& bigint = Bigint::Handle();
   bigint ^= Bigint::NewFromCString(bigint_value);
-  ApiNativeScope scope;
   Dart_CObject* bigint_cobject = SerializeAndDeserializeBigint(bigint);
   EXPECT_EQ(Dart_CObject_kBigint, bigint_cobject->type);
   char* hex_value = TestCase::BigintToHexValue(bigint_cobject);
@@ -550,10 +518,7 @@
   intptr_t buffer_len = writer.BytesWritten();
 
   // Read object back from the snapshot.
-  MessageSnapshotReader reader(buffer,
-                                 buffer_len,
-                                 Isolate::Current(),
-                                 Thread::Current()->zone());
+  MessageSnapshotReader reader(buffer, buffer_len, thread);
   EXPECT(Object::class_class() == reader.ReadObject());
   EXPECT(Object::type_arguments_class() == reader.ReadObject());
   EXPECT(Object::function_class() == reader.ReadObject());
@@ -573,7 +538,7 @@
 
 
 static void TestString(const char* cstr) {
-  StackZone zone(Isolate::Current());
+  Thread* thread = Thread::Current();
   EXPECT(Utf8::IsValid(reinterpret_cast<const uint8_t*>(cstr), strlen(cstr)));
   // Write snapshot with object content.
   String& str = String::Handle(String::New(cstr));
@@ -583,17 +548,14 @@
   intptr_t buffer_len = writer.BytesWritten();
 
   // Read object back from the snapshot.
-  MessageSnapshotReader reader(buffer,
-                               buffer_len,
-                               Isolate::Current(),
-                               zone.GetZone());
+  MessageSnapshotReader reader(buffer, buffer_len, thread);
   String& serialized_str = String::Handle();
   serialized_str ^= reader.ReadObject();
   EXPECT(str.Equals(serialized_str));
 
   // Read object back from the snapshot into a C structure.
   ApiNativeScope scope;
-  ApiMessageReader api_reader(buffer, buffer_len, &zone_allocator);
+  ApiMessageReader api_reader(buffer, buffer_len);
   Dart_CObject* root = api_reader.ReadMessage();
   EXPECT_EQ(Dart_CObject_kString, root->type);
   EXPECT_STREQ(cstr, root->value.as_string);
@@ -617,8 +579,6 @@
 
 
 TEST_CASE(SerializeArray) {
-  StackZone zone(Isolate::Current());
-
   // Write snapshot with object content.
   const int kArrayLength = 10;
   Array& array = Array::Handle(Array::New(kArrayLength));
@@ -633,17 +593,14 @@
   intptr_t buffer_len = writer.BytesWritten();
 
   // Read object back from the snapshot.
-  MessageSnapshotReader reader(buffer,
-                               buffer_len,
-                               Isolate::Current(),
-                               zone.GetZone());
+  MessageSnapshotReader reader(buffer, buffer_len, thread);
   Array& serialized_array = Array::Handle();
   serialized_array ^= reader.ReadObject();
   EXPECT(array.CanonicalizeEquals(serialized_array));
 
   // Read object back from the snapshot into a C structure.
   ApiNativeScope scope;
-  ApiMessageReader api_reader(buffer, buffer_len, &zone_allocator);
+  ApiMessageReader api_reader(buffer, buffer_len);
   Dart_CObject* root = api_reader.ReadMessage();
   EXPECT_EQ(Dart_CObject_kArray, root->type);
   EXPECT_EQ(kArrayLength, root->value.as_array.length);
@@ -709,8 +666,6 @@
 
 
 TEST_CASE(SerializeEmptyArray) {
-  StackZone zone(Isolate::Current());
-
   // Write snapshot with object content.
   const int kArrayLength = 0;
   Array& array = Array::Handle(Array::New(kArrayLength));
@@ -720,17 +675,14 @@
   intptr_t buffer_len = writer.BytesWritten();
 
   // Read object back from the snapshot.
-  MessageSnapshotReader reader(buffer,
-                               buffer_len,
-                               Isolate::Current(),
-                               zone.GetZone());
+  MessageSnapshotReader reader(buffer, buffer_len, thread);
   Array& serialized_array = Array::Handle();
   serialized_array ^= reader.ReadObject();
   EXPECT(array.CanonicalizeEquals(serialized_array));
 
   // Read object back from the snapshot into a C structure.
   ApiNativeScope scope;
-  ApiMessageReader api_reader(buffer, buffer_len, &zone_allocator);
+  ApiMessageReader api_reader(buffer, buffer_len);
   Dart_CObject* root = api_reader.ReadMessage();
   EXPECT_EQ(Dart_CObject_kArray, root->type);
   EXPECT_EQ(kArrayLength, root->value.as_array.length);
@@ -740,8 +692,6 @@
 
 
 TEST_CASE(SerializeByteArray) {
-  StackZone zone(Isolate::Current());
-
   // Write snapshot with object content.
   const int kTypedDataLength = 256;
   TypedData& typed_data = TypedData::Handle(
@@ -755,17 +705,14 @@
   intptr_t buffer_len = writer.BytesWritten();
 
   // Read object back from the snapshot.
-  MessageSnapshotReader reader(buffer,
-                               buffer_len,
-                               Isolate::Current(),
-                               zone.GetZone());
+  MessageSnapshotReader reader(buffer, buffer_len, thread);
   TypedData& serialized_typed_data = TypedData::Handle();
   serialized_typed_data ^= reader.ReadObject();
   EXPECT(serialized_typed_data.IsTypedData());
 
   // Read object back from the snapshot into a C structure.
   ApiNativeScope scope;
-  ApiMessageReader api_reader(buffer, buffer_len, &zone_allocator);
+  ApiMessageReader api_reader(buffer, buffer_len);
   Dart_CObject* root = api_reader.ReadMessage();
   EXPECT_EQ(Dart_CObject_kTypedData, root->type);
   EXPECT_EQ(kTypedDataLength, root->value.as_typed_data.length);
@@ -776,54 +723,50 @@
 }
 
 
-#define TEST_TYPED_ARRAY(darttype, ctype)                                     \
-  {                                                                           \
-    StackZone zone(Isolate::Current());                                       \
-    const int kArrayLength = 127;                                             \
-    TypedData& array = TypedData::Handle(                                     \
-        TypedData::New(kTypedData##darttype##ArrayCid, kArrayLength));        \
-    intptr_t scale = array.ElementSizeInBytes();                              \
-    for (int i = 0; i < kArrayLength; i++) {                                  \
-      array.Set##darttype((i * scale), i);                                    \
-    }                                                                         \
-    uint8_t* buffer;                                                          \
-    MessageWriter writer(&buffer, &zone_allocator, true);                     \
-    writer.WriteMessage(array);                                               \
-    intptr_t buffer_len = writer.BytesWritten();                              \
-    MessageSnapshotReader reader(buffer, buffer_len,                          \
-                          Isolate::Current(),                                 \
-                          zone.GetZone());                                    \
-    TypedData& serialized_array = TypedData::Handle();                        \
-    serialized_array ^= reader.ReadObject();                                  \
-    for (int i = 0; i < kArrayLength; i++) {                                  \
-      EXPECT_EQ(static_cast<ctype>(i),                                        \
-                serialized_array.Get##darttype(i*scale));                     \
-    }                                                                         \
+#define TEST_TYPED_ARRAY(darttype, ctype)                                      \
+  {                                                                            \
+    StackZone zone(thread);                                                    \
+    const int kArrayLength = 127;                                              \
+    TypedData& array = TypedData::Handle(                                      \
+        TypedData::New(kTypedData##darttype##ArrayCid, kArrayLength));         \
+    intptr_t scale = array.ElementSizeInBytes();                               \
+    for (int i = 0; i < kArrayLength; i++) {                                   \
+      array.Set##darttype((i * scale), i);                                     \
+    }                                                                          \
+    uint8_t* buffer;                                                           \
+    MessageWriter writer(&buffer, &zone_allocator, true);                      \
+    writer.WriteMessage(array);                                                \
+    intptr_t buffer_len = writer.BytesWritten();                               \
+    MessageSnapshotReader reader(buffer, buffer_len, thread);                  \
+    TypedData& serialized_array = TypedData::Handle();                         \
+    serialized_array ^= reader.ReadObject();                                   \
+    for (int i = 0; i < kArrayLength; i++) {                                   \
+      EXPECT_EQ(static_cast<ctype>(i),                                         \
+                serialized_array.Get##darttype(i*scale));                      \
+    }                                                                          \
   }
 
 
-#define TEST_EXTERNAL_TYPED_ARRAY(darttype, ctype)                            \
-  {                                                                           \
-    StackZone zone(Isolate::Current());                                       \
-    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,        \
-                               reinterpret_cast<uint8_t*>(data), length));    \
-    intptr_t scale = array.ElementSizeInBytes();                              \
-    uint8_t* buffer;                                                          \
-    MessageWriter writer(&buffer, &zone_allocator, true);                     \
-    writer.WriteMessage(array);                                               \
-    intptr_t buffer_len = writer.BytesWritten();                              \
-    MessageSnapshotReader reader(buffer, buffer_len,                          \
-                          Isolate::Current(),                                 \
-                          zone.GetZone());                                    \
-    TypedData& serialized_array = TypedData::Handle();                        \
-    serialized_array ^= reader.ReadObject();                                  \
-    for (int i = 0; i < length; i++) {                                        \
-      EXPECT_EQ(static_cast<ctype>(data[i]),                                  \
-                serialized_array.Get##darttype(i*scale));                     \
-    }                                                                         \
+#define TEST_EXTERNAL_TYPED_ARRAY(darttype, ctype)                             \
+  {                                                                            \
+    StackZone zone(thread);                                                    \
+    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,         \
+                               reinterpret_cast<uint8_t*>(data), length));     \
+    intptr_t scale = array.ElementSizeInBytes();                               \
+    uint8_t* buffer;                                                           \
+    MessageWriter writer(&buffer, &zone_allocator, true);                      \
+    writer.WriteMessage(array);                                                \
+    intptr_t buffer_len = writer.BytesWritten();                               \
+    MessageSnapshotReader reader(buffer, buffer_len, thread);                  \
+    TypedData& serialized_array = TypedData::Handle();                         \
+    serialized_array ^= reader.ReadObject();                                   \
+    for (int i = 0; i < length; i++) {                                         \
+      EXPECT_EQ(static_cast<ctype>(data[i]),                                   \
+                serialized_array.Get##darttype(i*scale));                      \
+    }                                                                          \
   }
 
 
@@ -856,8 +799,6 @@
 
 
 TEST_CASE(SerializeEmptyByteArray) {
-  StackZone zone(Isolate::Current());
-
   // Write snapshot with object content.
   const int kTypedDataLength = 0;
   TypedData& typed_data = TypedData::Handle(
@@ -868,17 +809,14 @@
   intptr_t buffer_len = writer.BytesWritten();
 
   // Read object back from the snapshot.
-  MessageSnapshotReader reader(buffer,
-                               buffer_len,
-                               Isolate::Current(),
-                               zone.GetZone());
+  MessageSnapshotReader reader(buffer, buffer_len, thread);
   TypedData& serialized_typed_data = TypedData::Handle();
   serialized_typed_data ^= reader.ReadObject();
   EXPECT(serialized_typed_data.IsTypedData());
 
   // Read object back from the snapshot into a C structure.
   ApiNativeScope scope;
-  ApiMessageReader api_reader(buffer, buffer_len, &zone_allocator);
+  ApiMessageReader api_reader(buffer, buffer_len);
   Dart_CObject* root = api_reader.ReadMessage();
   EXPECT_EQ(Dart_CObject_kTypedData, root->type);
   EXPECT_EQ(Dart_TypedData_kUint8, root->value.as_typed_data.type);
@@ -893,12 +831,16 @@
   static const intptr_t kInitialSize = 64 * KB;
   TestSnapshotWriter(uint8_t** buffer, ReAlloc alloc)
       : SnapshotWriter(Snapshot::kScript,
+                       Thread::Current(),
                        buffer,
                        alloc,
                        kInitialSize,
                        &forward_list_,
-                       true),
-        forward_list_(kMaxPredefinedObjectIds) {
+                       NULL, /* test_writer */
+                       true, /* can_send_any_object */
+                       false, /* snapshot_code */
+                       true /* vm_isolate_is_symbolic */),
+        forward_list_(thread(), kMaxPredefinedObjectIds) {
     ASSERT(buffer != NULL);
     ASSERT(alloc != NULL);
   }
@@ -907,7 +849,6 @@
   // Writes just a script object
   void WriteScript(const Script& script) {
     WriteObject(script.raw());
-    UnmarkAll();
   }
 
  private:
@@ -1009,11 +950,8 @@
   writer.WriteScript(script);
 
   // Read object back from the snapshot.
-  ScriptSnapshotReader reader(buffer,
-                              writer.BytesWritten(),
-                              Isolate::Current(),
-                              Thread::Current()->zone());
-  Script& serialized_script = Script::Handle();
+  ScriptSnapshotReader reader(buffer, writer.BytesWritten(), thread);
+  Script& serialized_script = Script::Handle(thread->zone());
   serialized_script ^= reader.ReadObject();
 
   // Check if the serialized script object matches the original script.
@@ -1181,9 +1119,10 @@
 }
 
 TEST_CASE(GenerateSource) {
-  Isolate* isolate = Isolate::Current();
+  Zone* zone = thread->zone();
+  Isolate* isolate = thread->isolate();
   const GrowableObjectArray& libs = GrowableObjectArray::Handle(
-      isolate, isolate->object_store()->libraries());
+      zone, isolate->object_store()->libraries());
   Library& lib = Library::Handle();
   String& uri = String::Handle();
   for (intptr_t i = 0; i < libs.Length(); i++) {
@@ -1230,13 +1169,13 @@
   {
     TestIsolateScope __test_isolate__;
 
-    Isolate* isolate = Isolate::Current();
-    StackZone zone(isolate);
-    HandleScope scope(isolate);
+    Thread* thread = Thread::Current();
+    StackZone zone(thread);
+    HandleScope scope(thread);
 
     // Create a test library and Load up a test script in it.
     TestCase::LoadTestScript(kScriptChars, NULL);
-    EXPECT_VALID(Api::CheckAndFinalizePendingClasses(isolate));
+    EXPECT_VALID(Api::CheckAndFinalizePendingClasses(thread->isolate()));
     timer1.Stop();
     OS::PrintErr("Without Snapshot: %" Pd64 "us\n", timer1.TotalElapsedTime());
 
@@ -1244,7 +1183,10 @@
     {
       FullSnapshotWriter writer(NULL,
                                 &isolate_snapshot_buffer,
-                                &malloc_allocator);
+                                NULL, /* instructions_snapshot_buffer */
+                                &malloc_allocator,
+                                false, /* snapshot_code */
+                                true);
       writer.WriteFullSnapshot();
     }
   }
@@ -1288,13 +1230,13 @@
   {
     TestIsolateScope __test_isolate__;
 
-    Isolate* isolate = Isolate::Current();
-    StackZone zone(isolate);
-    HandleScope scope(isolate);
+    Thread* thread = Thread::Current();
+    StackZone zone(thread);
+    HandleScope scope(thread);
 
     // Create a test library and Load up a test script in it.
     Dart_Handle lib = TestCase::LoadTestScript(kScriptChars, NULL);
-    EXPECT_VALID(Api::CheckAndFinalizePendingClasses(isolate));
+    EXPECT_VALID(Api::CheckAndFinalizePendingClasses(thread->isolate()));
     timer1.Stop();
     OS::PrintErr("Without Snapshot: %" Pd64 "us\n", timer1.TotalElapsedTime());
 
@@ -1302,7 +1244,10 @@
     {
       FullSnapshotWriter writer(NULL,
                                 &isolate_snapshot_buffer,
-                                &malloc_allocator);
+                                NULL, /* instructions_snapshot_buffer */
+                                &malloc_allocator,
+                                false, /* snapshot_code */
+                                true /* vm_isolate_is_symbolic */);
       writer.WriteFullSnapshot();
     }
 
@@ -1716,7 +1661,7 @@
 
 
 TEST_CASE(IntArrayMessage) {
-  StackZone zone(Isolate::Current());
+  StackZone zone(Thread::Current());
   uint8_t* buffer = NULL;
   ApiMessageWriter writer(&buffer, &zone_allocator);
 
@@ -1727,9 +1672,7 @@
 
   // Read object back from the snapshot into a C structure.
   ApiNativeScope scope;
-  ApiMessageReader api_reader(buffer,
-                              writer.BytesWritten(),
-                              &zone_allocator);
+  ApiMessageReader api_reader(buffer, writer.BytesWritten());
   Dart_CObject* root = api_reader.ReadMessage();
   EXPECT_EQ(Dart_CObject_kArray, root->type);
   EXPECT_EQ(kArrayLength, root->value.as_array.length);
@@ -1763,13 +1706,13 @@
 // Helper function to deserialize the result into a Dart_CObject structure.
 static Dart_CObject* GetDeserialized(uint8_t* buffer, intptr_t buffer_len) {
   // Read object back from the snapshot into a C structure.
-  ApiMessageReader api_reader(buffer, buffer_len, &zone_allocator);
+  ApiMessageReader api_reader(buffer, buffer_len);
   return api_reader.ReadMessage();
 }
 
 
 static void CheckString(Dart_Handle dart_string, const char* expected) {
-  StackZone zone(Isolate::Current());
+  StackZone zone(Thread::Current());
   String& str = String::Handle();
   str ^= Api::UnwrapHandle(dart_string);
   uint8_t* buffer;
@@ -1779,7 +1722,7 @@
 
   // Read object back from the snapshot into a C structure.
   ApiNativeScope scope;
-  ApiMessageReader api_reader(buffer, buffer_len, &zone_allocator);
+  ApiMessageReader api_reader(buffer, buffer_len);
   Dart_CObject* root = api_reader.ReadMessage();
   EXPECT_NOTNULL(root);
   EXPECT_EQ(Dart_CObject_kString, root->type);
@@ -1789,7 +1732,7 @@
 
 
 static void CheckStringInvalid(Dart_Handle dart_string) {
-  StackZone zone(Isolate::Current());
+  StackZone zone(Thread::Current());
   String& str = String::Handle();
   str ^= Api::UnwrapHandle(dart_string);
   uint8_t* buffer;
@@ -1799,7 +1742,7 @@
 
   // Read object back from the snapshot into a C structure.
   ApiNativeScope scope;
-  ApiMessageReader api_reader(buffer, buffer_len, &zone_allocator);
+  ApiMessageReader api_reader(buffer, buffer_len);
   Dart_CObject* root = api_reader.ReadMessage();
   EXPECT_NOTNULL(root);
   EXPECT_EQ(Dart_CObject_kUnsupported, root->type);
@@ -1896,10 +1839,10 @@
   EXPECT(Dart_IsString(crappy_string_result));
 
   {
-    DARTSCOPE(isolate);
+    DARTSCOPE(Thread::Current());
 
     {
-      StackZone zone(Isolate::Current());
+      StackZone zone(Thread::Current());
       Smi& smi = Smi::Handle();
       smi ^= Api::UnwrapHandle(smi_result);
       uint8_t* buffer;
@@ -1909,7 +1852,7 @@
 
       // Read object back from the snapshot into a C structure.
       ApiNativeScope scope;
-      ApiMessageReader api_reader(buffer, buffer_len, &zone_allocator);
+      ApiMessageReader api_reader(buffer, buffer_len);
       Dart_CObject* root = api_reader.ReadMessage();
       EXPECT_NOTNULL(root);
       EXPECT_EQ(Dart_CObject_kInt32, root->type);
@@ -1917,7 +1860,7 @@
       CheckEncodeDecodeMessage(root);
     }
     {
-      StackZone zone(Isolate::Current());
+      StackZone zone(Thread::Current());
       Bigint& bigint = Bigint::Handle();
       bigint ^= Api::UnwrapHandle(bigint_result);
       uint8_t* buffer;
@@ -1927,7 +1870,7 @@
 
       // Read object back from the snapshot into a C structure.
       ApiNativeScope scope;
-      ApiMessageReader api_reader(buffer, buffer_len, &zone_allocator);
+      ApiMessageReader api_reader(buffer, buffer_len);
       Dart_CObject* root = api_reader.ReadMessage();
       EXPECT_NOTNULL(root);
       EXPECT_EQ(Dart_CObject_kBigint, root->type);
@@ -1980,16 +1923,16 @@
       "}\n";
 
   TestCase::CreateTestIsolate();
-  Isolate* isolate = Isolate::Current();
-  EXPECT(isolate != NULL);
+  Thread* thread = Thread::Current();
+  EXPECT(thread->isolate() != NULL);
   Dart_EnterScope();
 
   Dart_Handle lib = TestCase::LoadTestScript(kScriptChars, NULL);
   EXPECT_VALID(lib);
 
   {
-    DARTSCOPE(isolate);
-    StackZone zone(isolate);
+    DARTSCOPE(thread);
+    StackZone zone(thread);
     intptr_t buf_len = 0;
     {
       // Generate a list of nulls from Dart code.
@@ -2104,16 +2047,16 @@
       "}\n";
 
   TestCase::CreateTestIsolate();
-  Isolate* isolate = Isolate::Current();
-  EXPECT(isolate != NULL);
+  Thread* thread = Thread::Current();
+  EXPECT(thread->isolate() != NULL);
   Dart_EnterScope();
 
   Dart_Handle lib = TestCase::LoadTestScript(kScriptChars, NULL);
   EXPECT_VALID(lib);
 
   {
-    DARTSCOPE(isolate);
-    StackZone zone(isolate);
+    DARTSCOPE(thread);
+    StackZone zone(thread);
     intptr_t buf_len = 0;
     {
       // Generate a list of nulls from Dart code.
@@ -2343,16 +2286,16 @@
       "}\n";
 
   TestCase::CreateTestIsolate();
-  Isolate* isolate = Isolate::Current();
-  EXPECT(isolate != NULL);
+  Thread* thread = Thread::Current();
+  EXPECT(thread->isolate() != NULL);
   Dart_EnterScope();
 
   Dart_Handle lib = TestCase::LoadTestScript(kScriptChars, NULL);
   EXPECT_VALID(lib);
 
   {
-    DARTSCOPE(isolate);
-    StackZone zone(isolate);
+    DARTSCOPE(thread);
+    StackZone zone(thread);
     intptr_t buf_len = 0;
     {
       // Generate a list of strings from Dart code.
@@ -2568,16 +2511,16 @@
       "}\n";
 
   TestCase::CreateTestIsolate();
-  Isolate* isolate = Isolate::Current();
-  EXPECT(isolate != NULL);
+  Thread* thread = Thread::Current();
+  EXPECT(thread->isolate() != NULL);
   Dart_EnterScope();
 
   Dart_Handle lib = TestCase::LoadTestScript(kScriptChars, NULL);
   EXPECT_VALID(lib);
 
   {
-    DARTSCOPE(isolate);
-    StackZone zone(isolate);
+    DARTSCOPE(thread);
+    StackZone zone(thread);
     intptr_t buf_len = 0;
     {
       // Generate a list of strings from Dart code.
@@ -2809,16 +2752,16 @@
       "}\n";
 
   TestCase::CreateTestIsolate();
-  Isolate* isolate = Isolate::Current();
-  EXPECT(isolate != NULL);
+  Thread* thread = Thread::Current();
+  EXPECT(thread->isolate() != NULL);
   Dart_EnterScope();
 
   Dart_Handle lib = TestCase::LoadTestScript(kScriptChars, NULL);
   EXPECT_VALID(lib);
 
   {
-    DARTSCOPE(isolate);
-    StackZone zone(isolate);
+    DARTSCOPE(thread);
+    StackZone zone(thread);
     intptr_t buf_len = 0;
     {
       // Generate a list of Uint8Lists from Dart code.
@@ -3050,7 +2993,7 @@
 
 
 TEST_CASE(OmittedObjectEncodingLength) {
-  StackZone zone(Isolate::Current());
+  StackZone zone(Thread::Current());
   uint8_t* buffer;
   MessageWriter writer(&buffer, &zone_allocator, true);
   writer.WriteInlinedObjectHeader(kOmittedObjectId);
diff --git a/runtime/vm/stack_frame.cc b/runtime/vm/stack_frame.cc
index bf5a05d..7594b91 100644
--- a/runtime/vm/stack_frame.cc
+++ b/runtime/vm/stack_frame.cc
@@ -22,9 +22,15 @@
 
 bool StackFrame::IsStubFrame() const {
   ASSERT(!(IsEntryFrame() || IsExitFrame()));
-  uword saved_pc =
-      *(reinterpret_cast<uword*>(fp() + (kPcMarkerSlotFromFp * kWordSize)));
-  return (saved_pc == 0);
+#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.
+  NoSafepointScope no_safepoint;
+#endif
+  RawCode* code = GetCodeObject();
+  intptr_t cid = code->ptr()->owner_->GetClassId();
+  ASSERT(cid == kNullCid || cid == kClassCid || cid == kFunctionCid);
+  return cid == kNullCid || cid == kClassCid;
 }
 
 
@@ -173,37 +179,35 @@
   // 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.
   NoSafepointScope no_safepoint;
+#endif
   RawCode* code = GetCodeObject();
-  ASSERT(code == Code::null() || code->ptr()->owner_ != Function::null());
-  return code;
-}
-
-
-RawCode* StackFrame::GetCodeObject() 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.
-  NoSafepointScope no_safepoint;
-  const uword pc_marker =
-      *(reinterpret_cast<uword*>(fp() + (kPcMarkerSlotFromFp * kWordSize)));
-  if (pc_marker != 0) {
-    const uword entry_point =
-        (pc_marker - Assembler::EntryPointToPcMarkerOffset());
-    RawInstructions* instr = Instructions::FromEntryPoint(entry_point);
-    if (instr != Instructions::null()) {
-      return instr->ptr()->code_;
-    }
+  if ((code != Code::null()) &&
+      (code->ptr()->owner_->GetClassId() == kFunctionCid)) {
+    return code;
   }
   return Code::null();
 }
 
 
-bool StackFrame::FindExceptionHandler(Isolate* isolate,
+RawCode* StackFrame::GetCodeObject() const {
+  const uword pc_marker =
+      *(reinterpret_cast<uword*>(fp() + (kPcMarkerSlotFromFp * kWordSize)));
+  ASSERT(pc_marker != 0);
+  ASSERT(reinterpret_cast<RawObject*>(pc_marker)->GetClassId() == kCodeCid ||
+         reinterpret_cast<RawObject*>(pc_marker) == Object::null());
+  return reinterpret_cast<RawCode*>(pc_marker);
+}
+
+
+bool StackFrame::FindExceptionHandler(Thread* thread,
                                       uword* handler_pc,
                                       bool* needs_stacktrace,
                                       bool* has_catch_all) const {
-  REUSABLE_CODE_HANDLESCOPE(isolate);
+  REUSABLE_CODE_HANDLESCOPE(thread);
   Code& code = reused_code_handle.Handle();
   code = LookupDartCode();
   if (code.IsNull()) {
@@ -211,7 +215,7 @@
   }
   uword pc_offset = pc() - code.EntryPoint();
 
-  REUSABLE_EXCEPTION_HANDLERS_HANDLESCOPE(isolate);
+  REUSABLE_EXCEPTION_HANDLERS_HANDLESCOPE(thread);
   ExceptionHandlers& handlers = reused_exception_handlers_handle.Handle();
   handlers = code.exception_handlers();
   if (handlers.num_entries() == 0) {
@@ -219,7 +223,7 @@
   }
 
   // Find pc descriptor for the current pc.
-  REUSABLE_PC_DESCRIPTORS_HANDLESCOPE(isolate);
+  REUSABLE_PC_DESCRIPTORS_HANDLESCOPE(thread);
   PcDescriptors& descriptors = reused_pc_descriptors_handle.Handle();
   descriptors = code.pc_descriptors();
   PcDescriptors::Iterator iter(descriptors, RawPcDescriptors::kAnyKind);
diff --git a/runtime/vm/stack_frame.h b/runtime/vm/stack_frame.h
index 94ba9d3..2889a1e 100644
--- a/runtime/vm/stack_frame.h
+++ b/runtime/vm/stack_frame.h
@@ -50,7 +50,12 @@
   }
 
   void set_pc(uword value) {
-    *reinterpret_cast<uword*>(sp_ + (kSavedPcSlotFromSp * kWordSize)) = value;
+    *reinterpret_cast<uword*>(sp() + (kSavedPcSlotFromSp * kWordSize)) = value;
+  }
+
+  void set_pc_marker(RawCode* code) {
+    *reinterpret_cast<RawCode**>(fp() + (kPcMarkerSlotFromFp * kWordSize)) =
+        code;
   }
 
   // Visit objects in the frame.
@@ -72,7 +77,7 @@
 
   RawFunction* LookupDartFunction() const;
   RawCode* LookupDartCode() const;
-  bool FindExceptionHandler(Isolate* isolate,
+  bool FindExceptionHandler(Thread* thread,
                             uword* handler_pc,
                             bool* needs_stacktrace,
                             bool* is_catch_all) const;
diff --git a/runtime/vm/stack_frame_arm.h b/runtime/vm/stack_frame_arm.h
index e391334..8f22815 100644
--- a/runtime/vm/stack_frame_arm.h
+++ b/runtime/vm/stack_frame_arm.h
@@ -12,16 +12,16 @@
                |                    | <- TOS
 Callee frame   | ...                |
                | saved PP           |    (PP of current frame)
+               | code object        |
                | saved FP           |    (FP of current frame)
                | saved LR           |    (PC of current frame)
-               | callee's PC marker |
                +--------------------+
 Current frame  | ...               T| <- SP of current frame
                | first local       T|
                | caller's PP       T|
+               | code object       T|    (current frame's code object)
                | caller's FP        | <- FP of current frame
                | caller's LR        |    (PC of caller frame)
-               | PC marker          |    (current frame's code entry + offset)
                +--------------------+
 Caller frame   | last parameter     | <- SP of caller frame
                |  ...               |
@@ -30,20 +30,20 @@
 */
 
 static const int kDartFrameFixedSize = 4;  // PP, FP, LR, PC marker.
-static const int kSavedPcSlotFromSp = -2;
+static const int kSavedPcSlotFromSp = -1;
 
 static const int kFirstObjectSlotFromFp = -1;  // Used by GC to traverse stack.
 
-static const int kFirstLocalSlotFromFp = -2;
-static const int kSavedCallerPpSlotFromFp = -1;
+static const int kFirstLocalSlotFromFp = -3;
+static const int kSavedCallerPpSlotFromFp = -2;
+static const int kPcMarkerSlotFromFp = -1;
 static const int kSavedCallerFpSlotFromFp = 0;
 static const int kSavedCallerPcSlotFromFp = 1;
-static const int kPcMarkerSlotFromFp = 2;
-static const int kParamEndSlotFromFp = 2;  // One slot past last parameter.
-static const int kCallerSpSlotFromFp = 3;
+static const int kParamEndSlotFromFp = 1;  // One slot past last parameter.
+static const int kCallerSpSlotFromFp = 2;
 
 // Entry and exit frame layout.
-static const int kExitLinkSlotFromEntryFp = -26;
+static const int kExitLinkSlotFromEntryFp = -27;
 
 }  // namespace dart
 
diff --git a/runtime/vm/stack_frame_arm64.h b/runtime/vm/stack_frame_arm64.h
index f252897..6733724 100644
--- a/runtime/vm/stack_frame_arm64.h
+++ b/runtime/vm/stack_frame_arm64.h
@@ -11,14 +11,14 @@
                |                    | <- TOS
 Callee frame   | ...                |
                | saved PP           |
-               | callee's PC marker |
+               | code object        |
                | saved FP           |    (FP of current frame)
                | saved PC           |    (PC of current frame)
                +--------------------+
 Current frame  | ...               T| <- SP of current frame
                | first local       T|
                | caller's PP       T|
-               | PC marker          |    (current frame's code entry + offset)
+               | code object       T|    (current frame's code object)
                | caller's FP        | <- FP of current frame
                | caller's LR        |    (PC of caller frame)
                +--------------------+
@@ -31,7 +31,7 @@
 static const int kDartFrameFixedSize = 4;  // PP, FP, LR, PC marker.
 static const int kSavedPcSlotFromSp = -1;
 
-static const int kFirstObjectSlotFromFp = -2;  // Used by GC to traverse stack.
+static const int kFirstObjectSlotFromFp = -1;  // Used by GC to traverse stack.
 
 static const int kFirstLocalSlotFromFp = -3;
 static const int kSavedCallerPpSlotFromFp = -2;
@@ -44,7 +44,7 @@
 static const int kSavedAboveReturnAddress = 3;  // Saved above return address.
 
 // Entry and exit frame layout.
-static const int kExitLinkSlotFromEntryFp = -21;
+static const int kExitLinkSlotFromEntryFp = -22;
 
 }  // namespace dart
 
diff --git a/runtime/vm/stack_frame_ia32.h b/runtime/vm/stack_frame_ia32.h
index f1a379b..a331aef 100644
--- a/runtime/vm/stack_frame_ia32.h
+++ b/runtime/vm/stack_frame_ia32.h
@@ -16,7 +16,7 @@
                +--------------------+
 Current frame  | ...               T| <- ESP of current frame
                | first local       T|
-               | PC marker          |    (current frame's code entry + offset)
+               | code object       T|    (current frame's code object)
                | caller's EBP       | <- EBP of current frame
                | caller's ret addr  |    (PC of caller frame)
                +--------------------+
@@ -29,7 +29,7 @@
 static const int kDartFrameFixedSize = 3;  // PC marker, EBP, PC.
 static const int kSavedPcSlotFromSp = -1;
 
-static const int kFirstObjectSlotFromFp = -2;  // Used by GC to traverse stack.
+static const int kFirstObjectSlotFromFp = -1;  // Used by GC to traverse stack.
 
 static const int kFirstLocalSlotFromFp = -2;
 static const int kPcMarkerSlotFromFp = -1;
@@ -42,7 +42,7 @@
 static const int kSavedCallerPpSlotFromFp = kSavedCallerFpSlotFromFp;
 
 // Entry and exit frame layout.
-static const int kExitLinkSlotFromEntryFp = -6;
+static const int kExitLinkSlotFromEntryFp = -7;
 
 }  // namespace dart
 
diff --git a/runtime/vm/stack_frame_mips.h b/runtime/vm/stack_frame_mips.h
index 142ed61..3f7c7e5 100644
--- a/runtime/vm/stack_frame_mips.h
+++ b/runtime/vm/stack_frame_mips.h
@@ -17,9 +17,9 @@
 Current frame  | ...               T| <- SP of current frame
                | first local       T|
                | caller's PP       T|
+               | CODE_REG          T|    (current frame's code object)
                | caller's FP        | <- FP of current frame
                | caller's RA        |    (PC of caller frame)
-               | PC marker          |    (current frame's code entry + offset)
                +--------------------+
 Caller frame   | last parameter     | <- SP of caller frame
                |  ...               |
@@ -28,20 +28,20 @@
 */
 
 static const int kDartFrameFixedSize = 4;  // PP, FP, RA, PC marker.
-static const int kSavedPcSlotFromSp = -2;
+static const int kSavedPcSlotFromSp = -1;
 
 static const int kFirstObjectSlotFromFp = -1;  // Used by GC to traverse stack.
 
-static const int kFirstLocalSlotFromFp = -2;
-static const int kSavedCallerPpSlotFromFp = -1;
+static const int kFirstLocalSlotFromFp = -3;
+static const int kSavedCallerPpSlotFromFp = -2;
+static const int kPcMarkerSlotFromFp = -1;
 static const int kSavedCallerFpSlotFromFp = 0;
 static const int kSavedCallerPcSlotFromFp = 1;
-static const int kPcMarkerSlotFromFp = 2;
-static const int kParamEndSlotFromFp = 2;  // One slot past last parameter.
-static const int kCallerSpSlotFromFp = 3;
+static const int kParamEndSlotFromFp = 1;  // One slot past last parameter.
+static const int kCallerSpSlotFromFp = 2;
 
 // Entry and exit frame layout.
-static const int kExitLinkSlotFromEntryFp = -23;
+static const int kExitLinkSlotFromEntryFp = -24;
 
 }  // namespace dart
 
diff --git a/runtime/vm/stack_frame_test.cc b/runtime/vm/stack_frame_test.cc
index 426ede7..c5f280a 100644
--- a/runtime/vm/stack_frame_test.cc
+++ b/runtime/vm/stack_frame_test.cc
@@ -101,10 +101,8 @@
       const Library& lib = Library::Handle(Library::LookupLibrary(url));
       ASSERT(!lib.IsNull());
       const char* lib_name = String::Handle(lib.url()).ToCString();
-      intptr_t length = OS::SNPrint(NULL, 0, "%s_%s", lib_name, expected_name);
-      char* full_name = Thread::Current()->zone()->Alloc<char>(length + 1);
-      ASSERT(full_name != NULL);
-      OS::SNPrint(full_name, (length + 1), "%s_%s", lib_name, expected_name);
+      char* full_name = OS::SCreate(Thread::Current()->zone(),
+          "%s_%s", lib_name, expected_name);
       if (strcmp(full_name, name) != 0) {
         FATAL("StackFrame_validateFrame fails, incorrect frame.\n");
       }
diff --git a/runtime/vm/stack_frame_x64.h b/runtime/vm/stack_frame_x64.h
index 3d87d27..8fc20a4 100644
--- a/runtime/vm/stack_frame_x64.h
+++ b/runtime/vm/stack_frame_x64.h
@@ -12,14 +12,14 @@
                |                    | <- TOS
 Callee frame   | ...                |
                | saved PP           |
-               | callee's PC marker |
+               | code object        |
                | saved RBP          |    (RBP of current frame)
                | saved PC           |    (PC of current frame)
                +--------------------+
 Current frame  | ...               T| <- RSP of current frame
                | first local       T|
                | caller's PP       T|
-               | PC marker          |    (current frame's code entry + offset)
+               | code object       T|    (current frame's code object)
                | caller's RBP       | <- RBP of current frame
                | caller's ret addr  |    (PC of caller frame)
                +--------------------+
@@ -32,7 +32,7 @@
 static const int kDartFrameFixedSize = 4;  // PC marker, RBP, PP, PC.
 static const int kSavedPcSlotFromSp = -1;
 
-static const int kFirstObjectSlotFromFp = -2;  // Used by GC to traverse stack.
+static const int kFirstObjectSlotFromFp = -1;  // Used by GC to traverse stack.
 
 static const int kFirstLocalSlotFromFp = -3;
 static const int kSavedCallerPpSlotFromFp = -2;
@@ -46,9 +46,9 @@
 
 // Entry and exit frame layout.
 #if defined(_WIN64)
-static const int kExitLinkSlotFromEntryFp = -31;
+static const int kExitLinkSlotFromEntryFp = -32;
 #else
-static const int kExitLinkSlotFromEntryFp = -9;
+static const int kExitLinkSlotFromEntryFp = -10;
 #endif  // defined(_WIN64)
 
 }  // namespace dart
diff --git a/runtime/vm/store_buffer.cc b/runtime/vm/store_buffer.cc
index fee1281..cc0a816 100644
--- a/runtime/vm/store_buffer.cc
+++ b/runtime/vm/store_buffer.cc
@@ -11,49 +11,56 @@
 namespace dart {
 
 DEFINE_LEAF_RUNTIME_ENTRY(void, StoreBufferBlockProcess, 1, Thread* thread) {
-  thread->StoreBufferBlockProcess(true);
+  thread->StoreBufferBlockProcess(StoreBuffer::kCheckThreshold);
 }
 END_LEAF_RUNTIME_ENTRY
 
-
-StoreBuffer::List* StoreBuffer::global_empty_ = NULL;
-Mutex* StoreBuffer::global_mutex_ = NULL;
+template<int BlockSize>
+typename BlockStack<BlockSize>::List*
+BlockStack<BlockSize>::global_empty_ = NULL;
+template<int BlockSize>
+Mutex* BlockStack<BlockSize>::global_mutex_ = NULL;
 
 
-void StoreBuffer::InitOnce() {
+template<int BlockSize>
+void BlockStack<BlockSize>::InitOnce() {
   global_empty_ = new List();
   global_mutex_ = new Mutex();
 }
 
 
-void StoreBuffer::ShutDown() {
+template<int BlockSize>
+void BlockStack<BlockSize>::ShutDown() {
   delete global_empty_;
   delete global_mutex_;
 }
 
 
-StoreBuffer::StoreBuffer() : mutex_(new Mutex()) {
+template<int BlockSize>
+BlockStack<BlockSize>::BlockStack() : mutex_(new Mutex()) {
 }
 
 
-StoreBuffer::~StoreBuffer() {
+template<int BlockSize>
+BlockStack<BlockSize>::~BlockStack() {
   Reset();
   delete mutex_;
 }
 
 
-void StoreBuffer::Reset() {
+template<int BlockSize>
+void BlockStack<BlockSize>::Reset() {
   MutexLocker local_mutex_locker(mutex_);
   {
     // Empty all blocks and move them to the global cache.
     MutexLocker global_mutex_locker(global_mutex_);
     while (!full_.IsEmpty()) {
-      StoreBufferBlock* block = full_.Pop();
+      Block* block = full_.Pop();
       block->Reset();
       global_empty_->Push(block);
     }
     while (!partial_.IsEmpty()) {
-      StoreBufferBlock* block = partial_.Pop();
+      Block* block = partial_.Pop();
       block->Reset();
       global_empty_->Push(block);
     }
@@ -62,7 +69,8 @@
 }
 
 
-StoreBufferBlock* StoreBuffer::Blocks() {
+template<int BlockSize>
+typename BlockStack<BlockSize>::Block* BlockStack<BlockSize>::Blocks() {
   MutexLocker ml(mutex_);
   while (!partial_.IsEmpty()) {
     full_.Push(partial_.Pop());
@@ -71,7 +79,8 @@
 }
 
 
-void StoreBuffer::PushBlock(StoreBufferBlock* block, bool check_threshold) {
+template<int BlockSize>
+void BlockStack<BlockSize>::PushBlockImpl(Block* block) {
   ASSERT(block->next() == NULL);  // Should be just a single block.
   if (block->IsFull()) {
     MutexLocker ml(mutex_);
@@ -84,7 +93,12 @@
     MutexLocker ml(mutex_);
     partial_.Push(block);
   }
-  if (check_threshold && Overflowed()) {
+}
+
+
+void StoreBuffer::PushBlock(Block* block, ThresholdPolicy policy) {
+  BlockStack<Block::kSize>::PushBlockImpl(block);
+  if ((policy == kCheckThreshold) && Overflowed()) {
     MutexLocker ml(mutex_);
     Isolate* isolate = Isolate::Current();
     // Sanity check: it makes no sense to schedule the GC in another isolate.
@@ -96,7 +110,9 @@
 }
 
 
-StoreBufferBlock* StoreBuffer::PopBlock() {
+template<int BlockSize>
+typename BlockStack<BlockSize>::Block*
+BlockStack<BlockSize>::PopNonFullBlock() {
   {
     MutexLocker ml(mutex_);
     if (!partial_.IsEmpty()) {
@@ -107,26 +123,50 @@
 }
 
 
-StoreBufferBlock* StoreBuffer::PopEmptyBlock() {
+template<int BlockSize>
+typename BlockStack<BlockSize>::Block* BlockStack<BlockSize>::PopEmptyBlock() {
   {
     MutexLocker ml(global_mutex_);
     if (!global_empty_->IsEmpty()) {
       return global_empty_->Pop();
     }
   }
-  return new StoreBufferBlock();
+  return new Block();
 }
 
 
-StoreBuffer::List::~List() {
+template<int BlockSize>
+typename BlockStack<BlockSize>::Block*
+BlockStack<BlockSize>::PopNonEmptyBlock() {
+  MutexLocker ml(mutex_);
+  if (!full_.IsEmpty()) {
+    return full_.Pop();
+  } else if (!partial_.IsEmpty()) {
+    return partial_.Pop();
+  } else {
+    return NULL;
+  }
+}
+
+
+template<int BlockSize>
+bool BlockStack<BlockSize>::IsEmpty() {
+  MutexLocker ml(mutex_);
+  return full_.IsEmpty() && partial_.IsEmpty();
+}
+
+
+template<int BlockSize>
+BlockStack<BlockSize>::List::~List() {
   while (!IsEmpty()) {
     delete Pop();
   }
 }
 
 
-StoreBufferBlock* StoreBuffer::List::Pop() {
-  StoreBufferBlock* result = head_;
+template<int BlockSize>
+typename BlockStack<BlockSize>::Block* BlockStack<BlockSize>::List::Pop() {
+  Block* result = head_;
   head_ = head_->next_;
   --length_;
   result->next_ = NULL;
@@ -134,15 +174,17 @@
 }
 
 
-StoreBufferBlock* StoreBuffer::List::PopAll() {
-  StoreBufferBlock* result = head_;
+template<int BlockSize>
+typename BlockStack<BlockSize>::Block* BlockStack<BlockSize>::List::PopAll() {
+  Block* result = head_;
   head_ = NULL;
   length_ = 0;
   return result;
 }
 
 
-void StoreBuffer::List::Push(StoreBufferBlock* block) {
+template<int BlockSize>
+void BlockStack<BlockSize>::List::Push(Block* block) {
   ASSERT(block->next_ == NULL);
   block->next_ = head_;
   head_ = block;
@@ -156,11 +198,16 @@
 }
 
 
-void StoreBuffer::TrimGlobalEmpty() {
+template<int BlockSize>
+void BlockStack<BlockSize>::TrimGlobalEmpty() {
   DEBUG_ASSERT(global_mutex_->IsOwnedByCurrentThread());
   while (global_empty_->length() > kMaxGlobalEmpty) {
     delete global_empty_->Pop();
   }
 }
 
+
+template class BlockStack<kStoreBufferBlockSize>;
+template class BlockStack<kMarkingStackBlockSize>;
+
 }  // namespace dart
diff --git a/runtime/vm/store_buffer.h b/runtime/vm/store_buffer.h
index 12a0535..36f17bc 100644
--- a/runtime/vm/store_buffer.h
+++ b/runtime/vm/store_buffer.h
@@ -16,17 +16,17 @@
 class RawObject;
 
 // A set of RawObject*. Must be emptied before destruction (using Pop/Reset).
-class StoreBufferBlock {
+template<int Size>
+class PointerBlock {
  public:
-  // Each full block contains kSize pointers.
-  static const int32_t kSize = 1024;
+  enum { kSize = Size };
 
   void Reset() {
     top_ = 0;
     next_ = NULL;
   }
 
-  StoreBufferBlock* next() const { return next_; }
+  PointerBlock<Size>* next() const { return next_; }
 
   intptr_t Count() const { return top_; }
   bool IsFull() const { return Count() == kSize; }
@@ -53,70 +53,74 @@
   }
 #endif  // TESTING
 
-  static intptr_t top_offset() { return OFFSET_OF(StoreBufferBlock, top_); }
+  static intptr_t top_offset() { return OFFSET_OF(PointerBlock<Size>, top_); }
   static intptr_t pointers_offset() {
-    return OFFSET_OF(StoreBufferBlock, pointers_);
+    return OFFSET_OF(PointerBlock<Size>, pointers_);
   }
 
  private:
-  StoreBufferBlock() : next_(NULL), top_(0) {}
-  ~StoreBufferBlock() {
+  PointerBlock() : next_(NULL), top_(0) {}
+  ~PointerBlock() {
     ASSERT(IsEmpty());  // Guard against unintentionally discarding pointers.
   }
 
-  StoreBufferBlock* next_;
+  PointerBlock<Size>* next_;
   int32_t top_;
   RawObject* pointers_[kSize];
 
-  friend class StoreBuffer;
+  template<int> friend class BlockStack;
 
-  DISALLOW_COPY_AND_ASSIGN(StoreBufferBlock);
+  DISALLOW_COPY_AND_ASSIGN(PointerBlock);
 };
 
 
-class StoreBuffer {
+// 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>
+class BlockStack {
  public:
-  StoreBuffer();
-  ~StoreBuffer();
+  typedef PointerBlock<BlockSize> Block;
+
+  BlockStack();
+  ~BlockStack();
   static void InitOnce();
   static void ShutDown();
 
-  // Interrupt when crossing this threshold of non-empty blocks in the buffer.
-  static const intptr_t kMaxNonEmpty = 100;
-
-  // Adds and transfers ownership of the block to the buffer.
-  void PushBlock(StoreBufferBlock* block, bool check_threshold = true);
   // Partially filled blocks can be reused, and there is an "inifite" supply
   // of empty blocks (reused or newly allocated). In any case, the caller
   // takes ownership of the returned block.
-  StoreBufferBlock* PopBlock();
-  StoreBufferBlock* PopEmptyBlock();
+  Block* PopNonFullBlock();
+  Block* PopEmptyBlock();
+  Block* PopNonEmptyBlock();
 
   // Pops and returns all non-empty blocks as a linked list (owned by caller).
-  StoreBufferBlock* Blocks();
+  Block* Blocks();
 
-  // Discards the contents of this store buffer.
+  // Discards the contents of all non-empty blocks.
   void Reset();
 
-  // Check whether non-empty blocks have exceeded kMaxNonEmpty.
-  bool Overflowed();
+  bool IsEmpty();
 
- private:
+ protected:
   class List {
    public:
     List() : head_(NULL), length_(0) {}
     ~List();
-    void Push(StoreBufferBlock* block);
-    StoreBufferBlock* Pop();
+    void Push(Block* block);
+    Block* Pop();
     intptr_t length() const { return length_; }
     bool IsEmpty() const { return head_ == NULL; }
-    StoreBufferBlock* PopAll();
+    Block* PopAll();
    private:
-    StoreBufferBlock* head_;
+    Block* head_;
     intptr_t length_;
     DISALLOW_COPY_AND_ASSIGN(List);
   };
 
+  // Adds and transfers ownership of the block to the buffer.
+  void PushBlockImpl(Block* block);
+
   // If needed, trims the the global cache of empty blocks.
   static void TrimGlobalEmpty();
 
@@ -124,13 +128,51 @@
   List partial_;
   Mutex* mutex_;
 
+  // Note: This is shared on the basis of block size.
   static const intptr_t kMaxGlobalEmpty = 100;
   static List* global_empty_;
   static Mutex* global_mutex_;
 
-  DISALLOW_COPY_AND_ASSIGN(StoreBuffer);
+ private:
+  DISALLOW_COPY_AND_ASSIGN(BlockStack);
 };
 
+
+static const int kStoreBufferBlockSize = 1024;
+class StoreBuffer : public BlockStack<kStoreBufferBlockSize> {
+ public:
+  // Interrupt when crossing this threshold of non-empty blocks in the buffer.
+  static const intptr_t kMaxNonEmpty = 100;
+
+  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
+  // interrupt on the current isolate if so.
+  void PushBlock(Block* block, ThresholdPolicy policy);
+
+  // Check whether non-empty blocks have exceeded kMaxNonEmpty (but takes no
+  // action).
+  bool Overflowed();
+};
+
+
+typedef StoreBuffer::Block StoreBufferBlock;
+
+
+static const int kMarkingStackBlockSize = 64;
+class MarkingStack : public BlockStack<kMarkingStackBlockSize> {
+ public:
+  // Adds and transfers ownership of the block to the buffer.
+  void PushBlock(Block* block) {
+    BlockStack<Block::kSize>::PushBlockImpl(block);
+  }
+};
+
+
 }  // namespace dart
 
 #endif  // VM_STORE_BUFFER_H_
diff --git a/runtime/vm/stub_code.cc b/runtime/vm/stub_code.cc
index 486531a..7c8fe78 100644
--- a/runtime/vm/stub_code.cc
+++ b/runtime/vm/stub_code.cc
@@ -10,6 +10,7 @@
 #include "vm/disassembler.h"
 #include "vm/flags.h"
 #include "vm/object_store.h"
+#include "vm/snapshot.h"
 #include "vm/virtual_memory.h"
 #include "vm/visitor.h"
 
@@ -53,6 +54,24 @@
 #undef STUB_CODE_GENERATE
 
 
+void StubCode::ReadFrom(SnapshotReader* reader) {
+#define READ_STUB(name)                                                        \
+  *(reader->CodeHandle()) ^= reader->ReadObject();                             \
+  name##_entry_ = new StubEntry(*(reader->CodeHandle()));
+  VM_STUB_CODE_LIST(READ_STUB);
+#undef READ_STUB
+}
+
+void StubCode::WriteTo(SnapshotWriter* writer) {
+  // TODO(rmacnak): Consider writing only the instructions to avoid
+  // vm_isolate_is_symbolic.
+#define WRITE_STUB(name)                                                       \
+  writer->WriteObject(StubCode::name##_entry()->code());
+  VM_STUB_CODE_LIST(WRITE_STUB);
+#undef WRITE_STUB
+}
+
+
 void StubCode::Init(Isolate* isolate) { }
 
 
@@ -75,35 +94,30 @@
 
 
 RawCode* StubCode::GetAllocationStubForClass(const Class& cls) {
-  Isolate* isolate = Isolate::Current();
-  const Error& error = Error::Handle(isolate, cls.EnsureIsFinalized(isolate));
+  Thread* thread = Thread::Current();
+  Zone* zone = thread->zone();
+  const Error& error = Error::Handle(zone, cls.EnsureIsFinalized(thread));
   ASSERT(error.IsNull());
   if (cls.id() == kArrayCid) {
     return AllocateArray_entry()->code();
   }
-  Code& stub = Code::Handle(isolate, cls.allocation_stub());
+  Code& stub = Code::Handle(zone, cls.allocation_stub());
   if (stub.IsNull()) {
     Assembler assembler;
     const char* name = cls.ToCString();
-    uword patch_code_offset = 0;
-    uword entry_patch_offset = 0;
-    StubCode::GenerateAllocationStubForClass(
-        &assembler, cls, &entry_patch_offset, &patch_code_offset);
+    StubCode::GenerateAllocationStubForClass(&assembler, cls);
     stub ^= Code::FinalizeCode(name, &assembler);
     stub.set_owner(cls);
     cls.set_allocation_stub(stub);
     if (FLAG_disassemble_stubs) {
-      LogBlock lb(Isolate::Current());
-      ISL_Print("Code for allocation stub '%s': {\n", name);
+      LogBlock lb;
+      THR_Print("Code for allocation stub '%s': {\n", name);
       DisassembleToStdout formatter;
       stub.Disassemble(&formatter);
-      ISL_Print("}\n");
-      const ObjectPool& object_pool = ObjectPool::Handle(
-          Instructions::Handle(stub.instructions()).object_pool());
+      THR_Print("}\n");
+      const ObjectPool& object_pool = ObjectPool::Handle(stub.object_pool());
       object_pool.DebugPrint();
     }
-    stub.set_entry_patch_pc_offset(entry_patch_offset);
-    stub.set_patch_code_pc_offset(patch_code_offset);
   }
   return stub.raw();
 }
@@ -131,13 +145,12 @@
   GenerateStub(&assembler);
   const Code& code = Code::Handle(Code::FinalizeCode(name, &assembler));
   if (FLAG_disassemble_stubs) {
-    LogBlock lb(Isolate::Current());
-    ISL_Print("Code for stub '%s': {\n", name);
+    LogBlock lb;
+    THR_Print("Code for stub '%s': {\n", name);
     DisassembleToStdout formatter;
     code.Disassemble(&formatter);
-    ISL_Print("}\n");
-    const ObjectPool& object_pool = ObjectPool::Handle(
-        Instructions::Handle(code.instructions()).object_pool());
+    THR_Print("}\n");
+    const ObjectPool& object_pool = ObjectPool::Handle(code.object_pool());
     object_pool.DebugPrint();
   }
   return code.raw();
diff --git a/runtime/vm/stub_code.h b/runtime/vm/stub_code.h
index 3a5ffc1..e7da564 100644
--- a/runtime/vm/stub_code.h
+++ b/runtime/vm/stub_code.h
@@ -15,6 +15,8 @@
 class Isolate;
 class ObjectPointerVisitor;
 class RawCode;
+class SnapshotReader;
+class SnapshotWriter;
 
 
 // List of stubs created in the VM isolate, these stubs are shared by different
@@ -98,6 +100,9 @@
   // only once and the stub code resides in the vm_isolate heap.
   static void InitOnce();
 
+  static void ReadFrom(SnapshotReader* reader);
+  static void WriteTo(SnapshotWriter* writer);
+
   // Generate all stubs which are generated on a per isolate basis as they
   // have embedded objects which are isolate specific.
   static void Init(Isolate* isolate);
@@ -160,9 +165,8 @@
                            void (*GenerateStub)(Assembler* assembler));
 
   static void GenerateMegamorphicMissStub(Assembler* assembler);
-  static void GenerateAllocationStubForClass(
-      Assembler* assembler, const Class& cls,
-      uword* entry_patch_offset, uword* patch_code_pc_offset);
+  static void GenerateAllocationStubForClass(Assembler* assembler,
+                                             const Class& cls);
   static void GenerateNArgsCheckInlineCacheStub(
       Assembler* assembler,
       intptr_t num_args,
@@ -175,6 +179,12 @@
   static void GenerateOptimizedUsageCounterIncrement(Assembler* assembler);
 };
 
+
+enum DeoptStubKind {
+  kLazyDeopt,
+  kEagerDeopt
+};
+
 }  // namespace dart
 
 #endif  // VM_STUB_CODE_H_
diff --git a/runtime/vm/stub_code_arm.cc b/runtime/vm/stub_code_arm.cc
index 2625200..5acd669 100644
--- a/runtime/vm/stub_code_arm.cc
+++ b/runtime/vm/stub_code_arm.cc
@@ -42,13 +42,9 @@
   const intptr_t argc_tag_offset = NativeArguments::argc_tag_offset();
   const intptr_t argv_offset = NativeArguments::argv_offset();
   const intptr_t retval_offset = NativeArguments::retval_offset();
-  const intptr_t exitframe_last_param_slot_from_fp = 2;
 
   __ EnterStubFrame();
 
-  COMPILE_ASSERT((kAbiPreservedCpuRegs & (1 << R9)) != 0);
-  __ LoadIsolate(R9);
-
   // Save exit frame information to enable stack walking as we are about
   // to transition to Dart VM C++ code.
   __ StoreToOffset(kWord, FP, THR, Thread::top_exit_frame_info_offset());
@@ -56,7 +52,7 @@
 #if defined(DEBUG)
   { Label ok;
     // Check that we are always entering from Dart code.
-    __ LoadFromOffset(kWord, R6, R9, Isolate::vm_tag_offset());
+    __ LoadFromOffset(kWord, R6, THR, Thread::vm_tag_offset());
     __ CompareImmediate(R6, VMTag::kDartTagId);
     __ b(&ok, EQ);
     __ Stop("Not coming from Dart code.");
@@ -64,8 +60,8 @@
   }
 #endif
 
-  // Mark that the isolate is executing VM code.
-  __ StoreToOffset(kWord, R5, R9, Isolate::vm_tag_offset());
+  // Mark that the thread is executing VM code.
+  __ StoreToOffset(kWord, R5, THR, Thread::vm_tag_offset());
 
   // Reserve space for arguments and align frame before entering C++ world.
   // NativeArguments are passed in registers.
@@ -87,7 +83,7 @@
   ASSERT(argv_offset == 2 * kWordSize);
   __ add(R2, FP, Operand(R4, LSL, 2));  // Compute argv.
   // Set argv in NativeArguments.
-  __ AddImmediate(R2, exitframe_last_param_slot_from_fp * kWordSize);
+  __ AddImmediate(R2, kParamEndSlotFromFp * kWordSize);
 
   ASSERT(retval_offset == 3 * kWordSize);
   __ add(R3, R2, Operand(kWordSize));  // Retval is next to 1st argument.
@@ -95,9 +91,9 @@
   // Call runtime or redirection via simulator.
   __ blx(R5);
 
-  // Mark that the isolate is executing Dart code.
+  // Mark that the thread is executing Dart code.
   __ LoadImmediate(R2, VMTag::kDartTagId);
-  __ StoreToOffset(kWord, R2, R9, Isolate::vm_tag_offset());
+  __ StoreToOffset(kWord, R2, THR, Thread::vm_tag_offset());
 
   // Reset exit frame information in Isolate structure.
   __ LoadImmediate(R2, 0);
@@ -141,9 +137,6 @@
 
   __ EnterStubFrame();
 
-  COMPILE_ASSERT((kAbiPreservedCpuRegs & (1 << R9)) != 0);
-  __ LoadIsolate(R9);
-
   // Save exit frame information to enable stack walking as we are about
   // to transition to native code.
   __ StoreToOffset(kWord, FP, THR, Thread::top_exit_frame_info_offset());
@@ -151,7 +144,7 @@
 #if defined(DEBUG)
   { Label ok;
     // Check that we are always entering from Dart code.
-    __ LoadFromOffset(kWord, R6, R9, Isolate::vm_tag_offset());
+    __ LoadFromOffset(kWord, R6, THR, Thread::vm_tag_offset());
     __ CompareImmediate(R6, VMTag::kDartTagId);
     __ b(&ok, EQ);
     __ Stop("Not coming from Dart code.");
@@ -159,8 +152,8 @@
   }
 #endif
 
-  // Mark that the isolate is executing Native code.
-  __ StoreToOffset(kWord, R5, R9, Isolate::vm_tag_offset());
+  // Mark that the thread is executing native code.
+  __ StoreToOffset(kWord, R5, THR, Thread::vm_tag_offset());
 
   // Reserve space for the native arguments structure passed on the stack (the
   // outgoing pointer parameter to the native arguments structure is passed in
@@ -183,7 +176,8 @@
   // Set argv in NativeArguments: R2 already contains argv.
 
   ASSERT(retval_offset == 3 * kWordSize);
-  __ add(R3, FP, Operand(3 * kWordSize));  // Set retval in NativeArgs.
+  // Set retval in NativeArgs.
+  __ add(R3, FP, Operand(kCallerSpSlotFromFp * kWordSize));
 
   // Passing the structure by value as in runtime calls would require changing
   // Dart API for native functions.
@@ -192,20 +186,14 @@
   __ mov(R0, Operand(SP));  // Pass the pointer to the NativeArguments.
 
   __ mov(R1, Operand(R5));  // Pass the function entrypoint to call.
-  // Call native function invocation wrapper or redirection via simulator.
-#if defined(USING_SIMULATOR)
-  uword entry = reinterpret_cast<uword>(NativeEntry::NativeCallWrapper);
-  entry = Simulator::RedirectExternalReference(
-      entry, Simulator::kNativeCall, NativeEntry::kNumCallWrapperArguments);
-  __ LoadImmediate(R2, entry);
-  __ blx(R2);
-#else
-  __ BranchLink(&NativeEntry::NativeCallWrapperLabel());
-#endif
 
-  // Mark that the isolate is executing Dart code.
+  // Call native function invocation wrapper or redirection via simulator.
+  __ ldr(LR, Address(THR, Thread::native_call_wrapper_entry_point_offset()));
+  __ blx(LR);
+
+  // Mark that the thread is executing Dart code.
   __ LoadImmediate(R2, VMTag::kDartTagId);
-  __ StoreToOffset(kWord, R2, R9, Isolate::vm_tag_offset());
+  __ StoreToOffset(kWord, R2, THR, Thread::vm_tag_offset());
 
   // Reset exit frame information in Isolate structure.
   __ LoadImmediate(R2, 0);
@@ -230,9 +218,6 @@
 
   __ EnterStubFrame();
 
-  COMPILE_ASSERT((kAbiPreservedCpuRegs & (1 << R9)) != 0);
-  __ LoadIsolate(R9);
-
   // Save exit frame information to enable stack walking as we are about
   // to transition to native code.
   __ StoreToOffset(kWord, FP, THR, Thread::top_exit_frame_info_offset());
@@ -240,7 +225,7 @@
 #if defined(DEBUG)
   { Label ok;
     // Check that we are always entering from Dart code.
-    __ LoadFromOffset(kWord, R6, R9, Isolate::vm_tag_offset());
+    __ LoadFromOffset(kWord, R6, THR, Thread::vm_tag_offset());
     __ CompareImmediate(R6, VMTag::kDartTagId);
     __ b(&ok, EQ);
     __ Stop("Not coming from Dart code.");
@@ -248,8 +233,8 @@
   }
 #endif
 
-  // Mark that the isolate is executing Native code.
-  __ StoreToOffset(kWord, R5, R9, Isolate::vm_tag_offset());
+  // Mark that the thread is executing native code.
+  __ StoreToOffset(kWord, R5, THR, Thread::vm_tag_offset());
 
   // Reserve space for the native arguments structure passed on the stack (the
   // outgoing pointer parameter to the native arguments structure is passed in
@@ -272,7 +257,8 @@
   // Set argv in NativeArguments: R2 already contains argv.
 
   ASSERT(retval_offset == 3 * kWordSize);
-  __ add(R3, FP, Operand(3 * kWordSize));  // Set retval in NativeArgs.
+  // Set retval in NativeArgs.
+  __ add(R3, FP, Operand(kCallerSpSlotFromFp * kWordSize));
 
   // Passing the structure by value as in runtime calls would require changing
   // Dart API for native functions.
@@ -283,9 +269,9 @@
   // Call native function or redirection via simulator.
   __ blx(R5);
 
-  // Mark that the isolate is executing Dart code.
+  // Mark that the thread is executing Dart code.
   __ LoadImmediate(R2, VMTag::kDartTagId);
-  __ StoreToOffset(kWord, R2, R9, Isolate::vm_tag_offset());
+  __ StoreToOffset(kWord, R2, THR, Thread::vm_tag_offset());
 
   // Reset exit frame information in Isolate structure.
   __ LoadImmediate(R2, 0);
@@ -303,7 +289,7 @@
   // calling into the runtime.
   __ EnterStubFrame();
   // Setup space on stack for return value and preserve arguments descriptor.
-  __ LoadImmediate(R0, reinterpret_cast<intptr_t>(Object::null()));
+  __ LoadObject(R0, Object::null_object());
   __ PushList((1 << R0) | (1 << R4));
   __ CallRuntime(kPatchStaticCallRuntimeEntry, 0);
   // Get Code object result and restore arguments descriptor array.
@@ -311,8 +297,8 @@
   // Remove the stub frame.
   __ LeaveStubFrame();
   // Jump to the dart function.
-  __ ldr(R0, FieldAddress(R0, Code::instructions_offset()));
-  __ AddImmediate(R0, R0, Instructions::HeaderSize() - kHeapObjectTag);
+  __ mov(CODE_REG, Operand(R0));
+  __ ldr(R0, FieldAddress(R0, Code::entry_point_offset()));
   __ bx(R0);
 }
 
@@ -321,11 +307,15 @@
 // (invalid because its function was optimized or deoptimized).
 // R4: arguments descriptor array.
 void StubCode::GenerateFixCallersTargetStub(Assembler* assembler) {
+  // Load code pointer to this stub from the thread:
+  // The one that is passed in, is not correct - it points to the code object
+  // that needs to be replaced.
+  __ ldr(CODE_REG, Address(THR, Thread::fix_callers_target_code_offset()));
   // Create a stub frame as we are pushing some objects on the stack before
   // calling into the runtime.
   __ EnterStubFrame();
   // Setup space on stack for return value and preserve arguments descriptor.
-  __ LoadImmediate(R0, reinterpret_cast<intptr_t>(Object::null()));
+  __ LoadObject(R0, Object::null_object());
   __ PushList((1 << R0) | (1 << R4));
   __ CallRuntime(kFixCallersTargetRuntimeEntry, 0);
   // Get Code object result and restore arguments descriptor array.
@@ -333,8 +323,8 @@
   // Remove the stub frame.
   __ LeaveStubFrame();
   // Jump to the dart function.
-  __ ldr(R0, FieldAddress(R0, Code::instructions_offset()));
-  __ AddImmediate(R0, R0, Instructions::HeaderSize() - kHeapObjectTag);
+  __ mov(CODE_REG, Operand(R0));
+  __ ldr(R0, FieldAddress(R0, Code::entry_point_offset()));
   __ bx(R0);
 }
 
@@ -342,9 +332,13 @@
 // Called from object allocate instruction when the allocation stub has been
 // disabled.
 void StubCode::GenerateFixAllocationStubTargetStub(Assembler* assembler) {
+  // Load code pointer to this stub from the thread:
+  // The one that is passed in, is not correct - it points to the code object
+  // that needs to be replaced.
+  __ ldr(CODE_REG, Address(THR, Thread::fix_allocation_stub_code_offset()));
   __ EnterStubFrame();
   // Setup space on stack for return value.
-  __ LoadImmediate(R0, reinterpret_cast<intptr_t>(Object::null()));
+  __ LoadObject(R0, Object::null_object());
   __ Push(R0);
   __ CallRuntime(kFixAllocationStubTargetRuntimeEntry, 0);
   // Get Code object result.
@@ -352,8 +346,8 @@
   // Remove the stub frame.
   __ LeaveStubFrame();
   // Jump to the dart function.
-  __ ldr(R0, FieldAddress(R0, Code::instructions_offset()));
-  __ AddImmediate(R0, R0, Instructions::HeaderSize() - kHeapObjectTag);
+  __ mov(CODE_REG, Operand(R0));
+  __ ldr(R0, FieldAddress(R0, Code::entry_point_offset()));
   __ bx(R0);
 }
 
@@ -363,7 +357,7 @@
 //   FP[kParamEndSlotFromFp + 1]: last argument.
 static void PushArgumentsArray(Assembler* assembler) {
   // Allocate array to store arguments of caller.
-  __ LoadImmediate(R1, reinterpret_cast<intptr_t>(Object::null()));
+  __ LoadObject(R1, Object::null_object());
   // R1: null element type for raw Array.
   // R2: smi-tagged argument count, may be zero.
   __ BranchLink(*StubCode::AllocateArray_entry());
@@ -387,13 +381,6 @@
 }
 
 
-DECLARE_LEAF_RUNTIME_ENTRY(intptr_t, DeoptimizeCopyFrame,
-                           intptr_t deopt_reason,
-                           uword saved_registers_address);
-
-DECLARE_LEAF_RUNTIME_ENTRY(void, DeoptimizeFillFrame, uword last_fp);
-
-
 // Used by eager and lazy deoptimization. Preserve result in R0 if necessary.
 // This stub translates optimized frame into unoptimized frame. The optimized
 // frame can contain values in registers and on stack, the unoptimized
@@ -413,13 +400,15 @@
 //   +------------------+
 //   | Saved LR         |  (deoptimization point)
 //   +------------------+
-//   | PC marker        |
+//   | pc marker        |
+//   +------------------+
+//   | Saved CODE_REG   |
 //   +------------------+
 //   | ...              | <- SP of optimized frame
 //
 // Parts of the code cannot GC, part of the code can GC.
 static void GenerateDeoptimizationSequence(Assembler* assembler,
-                                           bool preserve_result) {
+                                           DeoptStubKind kind) {
   // DeoptimizeCopyFrame 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.
 
@@ -429,18 +418,9 @@
   __ eor(LR, IP, Operand(LR));
   __ eor(IP, IP, Operand(LR));
 
-  // Set up the frame manually. We can't use EnterFrame because we can't
-  // clobber LR (or any other register) with 0, yet.
-  __ sub(SP, SP, Operand(kWordSize));  // Make room for PC marker of 0.
-  __ Push(IP);  // Push return address.
-  __ Push(FP);
-  __ mov(FP, Operand(SP));
-  __ Push(PP);
-
-  // Now that IP holding the return address has been written to the stack,
-  // we can clobber it with 0 to write the null PC marker.
-  __ mov(IP, Operand(0));
-  __ str(IP, Address(SP, +3 * kWordSize));
+  // Set up the frame manually with return address now stored in IP.
+  __ EnterFrame((1 << PP) | (1 << CODE_REG) | (1 << FP) | (1 << IP), 0);
+  __ LoadPoolPointer();
 
   // The code in this frame may not cause GC. kDeoptimizeCopyFrameRuntimeEntry
   // and kDeoptimizeFillFrameRuntimeEntry are leaf runtime calls.
@@ -450,7 +430,17 @@
 
   // Push registers in their enumeration order: lowest register number at
   // lowest address.
-  __ PushList(kAllCpuRegistersList);
+  for (intptr_t i = kNumberOfCpuRegisters - 1; i >= 0; --i) {
+    if (i == CODE_REG) {
+      // Save the original value of CODE_REG pushed before invoking this stub
+      // instead of the value used to call this stub.
+      COMPILE_ASSERT(IP > CODE_REG);  // Assert IP is pushed first.
+      __ ldr(IP, Address(FP, kCallerSpSlotFromFp * kWordSize));
+      __ Push(IP);
+    } else {
+      __ Push(static_cast<Register>(i));
+    }
+  }
 
   if (TargetCPUFeatures::vfp_supported()) {
     ASSERT(kFpuRegisterSize == 4 * kWordSize);
@@ -465,23 +455,24 @@
   }
 
   __ mov(R0, Operand(SP));  // Pass address of saved registers block.
+  __ mov(R1, Operand(kind == kLazyDeopt ? 1 : 0));
   __ ReserveAlignedFrameSpace(0);
-  __ CallRuntime(kDeoptimizeCopyFrameRuntimeEntry, 1);
+  __ CallRuntime(kDeoptimizeCopyFrameRuntimeEntry, 2);
   // Result (R0) is stack-size (FP - SP) in bytes.
 
+  const bool preserve_result = (kind == kLazyDeopt);
   if (preserve_result) {
     // Restore result into R1 temporarily.
     __ ldr(R1, Address(FP, saved_result_slot_from_fp * kWordSize));
   }
 
+  __ RestoreCodePointer();
   __ LeaveDartFrame();
   __ sub(SP, FP, Operand(R0));
 
   // 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.
-  __ mov(IP, Operand(LR));
-  __ mov(LR, Operand(0));
-  __ EnterFrame((1 << PP) | (1 << FP) | (1 << IP) | (1 << LR), 0);
+  __ EnterStubFrame();
   __ mov(R0, Operand(FP));  // Get last FP address.
   if (preserve_result) {
     __ Push(R1);  // Preserve result as first local.
@@ -493,7 +484,8 @@
     __ ldr(R1, Address(FP, kFirstLocalSlotFromFp * kWordSize));
   }
   // Code above cannot cause GC.
-  __ LeaveDartFrame();
+  __ RestoreCodePointer();
+  __ LeaveStubFrame();
 
   // Frame is fully rewritten at this point and it is safe to perform a GC.
   // Materialize any objects that were deferred by FillFrame because they
@@ -521,13 +513,16 @@
 void StubCode::GenerateDeoptimizeLazyStub(Assembler* assembler) {
   // Correct return address to point just after the call that is being
   // deoptimized.
-  __ AddImmediate(LR, -CallPattern::LengthInBytes());
-  GenerateDeoptimizationSequence(assembler, true);  // Preserve R0.
+  __ AddImmediate(LR, -CallPattern::DeoptCallPatternLengthInBytes());
+  // Push zap value instead of CODE_REG for lazy deopt.
+  __ LoadImmediate(IP, 0xf1f1f1f1);
+  __ Push(IP);
+  GenerateDeoptimizationSequence(assembler, kLazyDeopt);
 }
 
 
 void StubCode::GenerateDeoptimizeStub(Assembler* assembler) {
-  GenerateDeoptimizationSequence(assembler, false);  // Don't preserve R0.
+  GenerateDeoptimizationSequence(assembler, kEagerDeopt);
 }
 
 
@@ -573,7 +568,7 @@
   // Push the receiver.
   // Push IC data object.
   // Push arguments descriptor array.
-  __ LoadImmediate(IP, reinterpret_cast<intptr_t>(Object::null()));
+  __ LoadObject(IP, Object::null_object());
   __ PushList((1 << R4) | (1 << R5) | (1 << R6) | (1 << IP));
   __ CallRuntime(kMegamorphicCacheMissHandlerRuntimeEntry, 3);
   // Remove arguments.
@@ -583,6 +578,7 @@
   // Restore IC data and arguments descriptor.
   __ PopList((1 << R4) | (1 << R5));
 
+  __ RestoreCodePointer();
   __ LeaveStubFrame();
 
   if (!FLAG_lazy_dispatchers) {
@@ -592,8 +588,8 @@
   }
 
   // Tail-call to target function.
-  __ ldr(R2, FieldAddress(R0, Function::instructions_offset()));
-  __ AddImmediate(R2, Instructions::HeaderSize() - kHeapObjectTag);
+  __ ldr(CODE_REG, FieldAddress(R0, Function::code_offset()));
+  __ ldr(R2, FieldAddress(R0, Function::entry_point_offset()));
   __ bx(R2);
 }
 
@@ -631,24 +627,24 @@
                           /* inline_isolate = */ false);
 
   const intptr_t fixed_size = sizeof(RawArray) + kObjectAlignment - 1;
-  __ LoadImmediate(R9, fixed_size);
-  __ add(R9, R9, Operand(R3, LSL, 1));  // R3 is  a Smi.
+  __ LoadImmediate(R5, fixed_size);
+  __ add(R5, R5, Operand(R3, LSL, 1));  // R3 is  a Smi.
   ASSERT(kSmiTagShift == 1);
-  __ bic(R9, R9, Operand(kObjectAlignment - 1));
+  __ bic(R5, R5, Operand(kObjectAlignment - 1));
 
-  // R9: Allocation size.
+  // R5: Allocation size.
   Heap::Space space = Heap::SpaceForAllocation(cid);
   __ LoadIsolate(R6);
   __ ldr(R6, Address(R6, Isolate::heap_offset()));
   // Potential new object start.
   __ ldr(R0, Address(R6, Heap::TopOffset(space)));
-  __ adds(R7, R0, Operand(R9));  // Potential next object start.
+  __ adds(R7, R0, Operand(R5));  // Potential next object start.
   __ b(&slow_case, CS);  // Branch if unsigned overflow.
 
   // Check if the allocation fits into the remaining space.
   // R0: potential new object start.
   // R7: potential next object start.
-  // R9: allocation size.
+  // R5: allocation size.
   __ ldr(R3, Address(R6, Heap::EndOffset(space)));
   __ cmp(R7, Operand(R3));
   __ b(&slow_case, CS);
@@ -663,12 +659,12 @@
   // R0: new object start as a tagged pointer.
   // R3: allocation stats address.
   // R7: new object end address.
-  // R9: allocation size.
+  // R5: allocation size.
   {
     const intptr_t shift = RawObject::kSizeTagPos - kObjectAlignmentLog2;
 
-    __ CompareImmediate(R9, RawObject::SizeTag::kMaxSizeTag);
-    __ mov(R6, Operand(R9, LSL, shift), LS);
+    __ CompareImmediate(R5, RawObject::SizeTag::kMaxSizeTag);
+    __ mov(R6, Operand(R5, LSL, shift), LS);
     __ mov(R6, Operand(0), HI);
 
     // Get the class index and insert it into the tags.
@@ -697,13 +693,13 @@
   // R6: iterator which initially points to the start of the variable
   // data area to be initialized.
   // R7: new object end address.
-  // R9: allocation size.
+  // R5: allocation size.
+  __ IncrementAllocationStatsWithSize(R3, R5, space);
 
-  __ LoadImmediate(R4, reinterpret_cast<intptr_t>(Object::null()));
+  __ LoadObject(R4, Object::null_object());
   __ mov(R5, Operand(R4));
   __ AddImmediate(R6, R0, sizeof(RawArray) - kHeapObjectTag);
   __ InitializeFieldsNoBarrier(R0, R6, R7, R4, R5);
-  __ IncrementAllocationStatsWithSize(R3, R9, space);
   __ Ret();  // Returns the newly allocated object in R0.
   // Unable to allocate the array using the fast inline code, just call
   // into the runtime.
@@ -712,7 +708,7 @@
   // Create a stub frame as we are pushing some objects on the stack before
   // calling into the runtime.
   __ EnterStubFrame();
-  __ LoadImmediate(IP, reinterpret_cast<intptr_t>(Object::null()));
+  __ LoadObject(IP, Object::null_object());
   // Setup space on stack for return value.
   // Push array length as Smi and element type.
   __ PushList((1 << R1) | (1 << R2) | (1 << IP));
@@ -728,7 +724,7 @@
 // Called when invoking Dart code from C++ (VM code).
 // Input parameters:
 //   LR : points to return address.
-//   R0 : entrypoint of the Dart function to call.
+//   R0 : code object of the Dart function to call.
 //   R1 : arguments descriptor array.
 //   R2 : arguments array.
 //   R3 : current thread.
@@ -736,6 +732,10 @@
   // Save frame pointer coming in.
   __ EnterFrame((1 << FP) | (1 << LR), 0);
 
+  // Push code object to PC marker slot.
+  __ ldr(IP, Address(R3, Thread::invoke_dart_code_stub_offset()));
+  __ Push(IP);
+
   // Save new context and C++ ABI callee-saved registers.
   __ PushList(kAbiPreservedCpuRegs);
 
@@ -748,24 +748,18 @@
     __ sub(SP, SP, Operand(kAbiPreservedFpuRegCount * kFpuRegisterSize));
   }
 
-  // We now load the pool pointer(PP) as we are about to invoke dart code and we
-  // could potentially invoke some intrinsic functions which need the PP to be
-  // set up.
-  __ LoadPoolPointer();
-
   // Set up THR, which caches the current thread in Dart code.
   if (THR != R3) {
     __ mov(THR, Operand(R3));
   }
-  __ LoadIsolate(R9);
 
   // Save the current VMTag on the stack.
-  __ LoadFromOffset(kWord, R5, R9, Isolate::vm_tag_offset());
+  __ LoadFromOffset(kWord, R5, THR, Thread::vm_tag_offset());
   __ Push(R5);
 
-  // Mark that the isolate is executing Dart code.
+  // Mark that the thread is executing Dart code.
   __ LoadImmediate(R5, VMTag::kDartTagId);
-  __ StoreToOffset(kWord, R5, R9, Isolate::vm_tag_offset());
+  __ StoreToOffset(kWord, R5, THR, Thread::vm_tag_offset());
 
   // Save top resource and top exit frame info. Use R4-6 as temporary registers.
   // StackFrameIterator reads the top exit frame info saved in this frame.
@@ -777,7 +771,7 @@
 
   // kExitLinkSlotFromEntryFp must be kept in sync with the code below.
   __ Push(R4);
-  ASSERT(kExitLinkSlotFromEntryFp == -26);
+  ASSERT(kExitLinkSlotFromEntryFp == -27);
   __ Push(R5);
 
   // Load arguments descriptor array into R4, which is passed to Dart code.
@@ -807,12 +801,14 @@
   __ Bind(&done_push_arguments);
 
   // Call the Dart code entrypoint.
+  __ LoadImmediate(PP, 0);  // GC safe value into PP.
+  __ ldr(CODE_REG, Address(R0, VMHandles::kOffsetOfRawPtrInHandle));
+  __ ldr(R0, FieldAddress(CODE_REG, Code::entry_point_offset()));
   __ blx(R0);  // R4 is the arguments descriptor array.
 
   // Get rid of arguments pushed on the stack.
   __ AddImmediate(SP, FP, kExitLinkSlotFromEntryFp * kWordSize);
 
-  __ LoadIsolate(R9);
   // Restore the saved top exit frame info and top resource back into the
   // Isolate structure. Uses R5 as a temporary register for this.
   __ Pop(R5);
@@ -822,7 +818,7 @@
 
   // Restore the current VMTag from the stack.
   __ Pop(R4);
-  __ StoreToOffset(kWord, R4, R9, Isolate::vm_tag_offset());
+  __ StoreToOffset(kWord, R4, THR, Thread::vm_tag_offset());
 
   // Restore C++ ABI callee-saved registers.
   if (TargetCPUFeatures::vfp_supported()) {
@@ -925,7 +921,7 @@
     // R2: object size.
     // R3: next object start.
     // R6: allocation stats address.
-    __ LoadImmediate(R4, reinterpret_cast<intptr_t>(Object::null()));
+    __ LoadObject(R4, Object::null_object());
     __ InitializeFieldNoBarrier(R0, FieldAddress(R0, Context::parent_offset()),
                                 R4);
 
@@ -951,7 +947,7 @@
   // calling into the runtime.
   __ EnterStubFrame();
   // Setup space on stack for return value.
-  __ LoadImmediate(R2, reinterpret_cast<intptr_t>(Object::null()));
+  __ LoadObject(R2, Object::null_object());
   __ SmiTag(R1);
   __ PushList((1 << R1) | (1 << R2));
   __ CallRuntime(kAllocateContextRuntimeEntry, 1);  // Allocate context.
@@ -964,8 +960,6 @@
 }
 
 
-DECLARE_LEAF_RUNTIME_ENTRY(void, StoreBufferBlockProcess, Isolate* isolate);
-
 // Helper stub to implement Assembler::StoreIntoObject.
 // Input parameters:
 //   R0: address (i.e. object) being stored into.
@@ -1043,12 +1037,11 @@
 // Input parameters:
 //   LR : return address.
 //   SP + 0 : type arguments object (only if class is parameterized).
-// 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,
-    uword* entry_patch_offset, uword* patch_code_pc_offset) {
-  *entry_patch_offset = assembler->CodeSize();
+void StubCode::GenerateAllocationStubForClass(Assembler* assembler,
+                                              const Class& cls) {
+  // Must load pool pointer before being able to patch.
+  Register new_pp = R7;
+  __ LoadPoolPointer(new_pp);
   // The generated code is different if the class is parameterized.
   const bool is_cls_parameterized = cls.NumTypeArguments() > 0;
   ASSERT(!is_cls_parameterized ||
@@ -1099,7 +1092,7 @@
     __ add(R0, R0, Operand(kHeapObjectTag));
 
     // Initialize the remaining words of the object.
-    __ LoadImmediate(R2, reinterpret_cast<intptr_t>(Object::null()));
+    __ LoadObject(R2, Object::null_object());
 
     // R2: raw null.
     // R0: new object (tagged).
@@ -1157,7 +1150,7 @@
   // 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.
-  __ LoadImmediate(R2, reinterpret_cast<intptr_t>(Object::null()));
+  __ LoadObject(R2, Object::null_object());
   __ Push(R2);  // Setup space on stack for return value.
   __ PushObject(cls);  // Push class of object to be allocated.
   if (is_cls_parameterized) {
@@ -1174,8 +1167,6 @@
   // Restore the frame pointer.
   __ LeaveStubFrame();
   __ Ret();
-  *patch_code_pc_offset = assembler->CodeSize();
-  __ BranchPatchable(*StubCode::FixAllocationStubTarget_entry());
 }
 
 
@@ -1197,7 +1188,7 @@
   // Push space for the return value.
   // Push the receiver.
   // Push arguments descriptor array.
-  __ LoadImmediate(IP, reinterpret_cast<intptr_t>(Object::null()));
+  __ LoadObject(IP, Object::null_object());
   __ PushList((1 << R4) | (1 << R6) | (1 << IP));
 
   // R2: Smi-tagged arguments array length.
@@ -1330,6 +1321,7 @@
     Token::Kind kind,
     RangeCollectionMode range_collection_mode,
     bool optimized) {
+  __ CheckCodePointer();
   ASSERT(num_args > 0);
 #if defined(DEBUG)
   { Label ok;
@@ -1437,7 +1429,7 @@
   // Create a stub frame as we are pushing some objects on the stack before
   // calling into the runtime.
   __ EnterStubFrame();
-  __ LoadImmediate(R0, reinterpret_cast<intptr_t>(Object::null()));
+  __ LoadObject(R0, Object::null_object());
   // Preserve IC data object and arguments descriptor array and
   // setup space on stack for result (target code object).
   __ PushList((1 << R0) | (1 << R4) | (1 << R5));
@@ -1454,6 +1446,9 @@
   // Pop returned function object into R0.
   // Restore arguments descriptor array and IC data array.
   __ PopList((1 << R0) | (1 << R4) | (1 << R5));
+  if (range_collection_mode == kCollectRanges) {
+    __ RestoreCodePointer();
+  }
   __ LeaveStubFrame();
   Label call_target_function;
   if (!FLAG_lazy_dispatchers) {
@@ -1479,8 +1474,7 @@
   __ Comment("Call target");
   __ Bind(&call_target_function);
   // R0: target function.
-  __ ldr(R2, FieldAddress(R0, Function::instructions_offset()));
-  __ AddImmediate(R2, Instructions::HeaderSize() - kHeapObjectTag);
+  __ ldr(R2, FieldAddress(R0, Function::entry_point_offset()));
   if (range_collection_mode == kCollectRanges) {
     __ ldr(R1, Address(SP, 0 * kWordSize));
     if (num_args == 2) {
@@ -1492,15 +1486,18 @@
     } else {
       __ PushList((1 << R1) | (1 << R5));
     }
+    __ ldr(CODE_REG, FieldAddress(R0, Function::code_offset()));
     __ blx(R2);
 
     Label done;
     __ ldr(R5, Address(FP, kFirstLocalSlotFromFp * kWordSize));
     __ UpdateRangeFeedback(R0, 2, R5, R1, R4, &done);
     __ Bind(&done);
+    __ RestoreCodePointer();
     __ LeaveStubFrame();
     __ Ret();
   } else {
+    __ ldr(CODE_REG, FieldAddress(R0, Function::code_offset()));
     __ bx(R2);
   }
 
@@ -1510,6 +1507,7 @@
     __ Push(R5);  // Preserve IC data.
     __ CallRuntime(kSingleStepHandlerRuntimeEntry, 0);
     __ Pop(R5);
+    __ RestoreCodePointer();
     __ LeaveStubFrame();
     __ b(&done_stepping);
   }
@@ -1660,11 +1658,8 @@
 
   // Get function and call it, if possible.
   __ LoadFromOffset(kWord, R0, R6, target_offset);
-  __ ldr(R2, FieldAddress(R0, Function::instructions_offset()));
-
-  // R0: function.
-  // R2: target instructions.
-  __ AddImmediate(R2, Instructions::HeaderSize() - kHeapObjectTag);
+  __ ldr(CODE_REG, FieldAddress(R0, Function::code_offset()));
+  __ ldr(R2, FieldAddress(R0, Function::entry_point_offset()));
   __ bx(R2);
 
   if (FLAG_support_debugger) {
@@ -1673,6 +1668,7 @@
     __ Push(R5);  // Preserve IC data.
     __ CallRuntime(kSingleStepHandlerRuntimeEntry, 0);
     __ Pop(R5);
+    __ RestoreCodePointer();
     __ LeaveStubFrame();
     __ b(&done_stepping);
   }
@@ -1709,8 +1705,8 @@
   __ PopList((1 << R4) | (1 << R5));  // Restore arg desc. and IC data.
   __ LeaveStubFrame();
 
-  __ ldr(R2, FieldAddress(R0, Function::instructions_offset()));
-  __ AddImmediate(R2, Instructions::HeaderSize() - kHeapObjectTag);
+  __ ldr(CODE_REG, FieldAddress(R0, Function::code_offset()));
+  __ ldr(R2, FieldAddress(R0, Function::entry_point_offset()));
   __ bx(R2);
 }
 
@@ -1718,24 +1714,27 @@
 // R5: Contains an ICData.
 void StubCode::GenerateICCallBreakpointStub(Assembler* assembler) {
   __ EnterStubFrame();
-  __ LoadImmediate(R0, reinterpret_cast<intptr_t>(Object::null()));
+  __ LoadObject(R0, Object::null_object());
   // Preserve arguments descriptor and make room for result.
   __ PushList((1 << R0) | (1 << R5));
   __ CallRuntime(kBreakpointRuntimeHandlerRuntimeEntry, 0);
   __ PopList((1 << R0) | (1 << R5));
   __ LeaveStubFrame();
+  __ mov(CODE_REG, Operand(R0));
+  __ ldr(R0, FieldAddress(CODE_REG, Code::entry_point_offset()));
   __ bx(R0);
 }
 
 
 void StubCode::GenerateRuntimeCallBreakpointStub(Assembler* assembler) {
   __ EnterStubFrame();
-  __ LoadImmediate(R0, reinterpret_cast<intptr_t>(Object::null()));
+  __ LoadObject(R0, Object::null_object());
   // Make room for result.
   __ PushList((1 << R0));
   __ CallRuntime(kBreakpointRuntimeHandlerRuntimeEntry, 0);
-  __ PopList((1 << R0));
+  __ PopList((1 << CODE_REG));
   __ LeaveStubFrame();
+  __ ldr(R0, FieldAddress(CODE_REG, Code::entry_point_offset()));
   __ bx(R0);
 }
 
@@ -1773,7 +1772,7 @@
     __ LoadClass(R3, R0, R4);
     // Compute instance type arguments into R4.
     Label has_no_type_arguments;
-    __ LoadImmediate(R4, reinterpret_cast<intptr_t>(Object::null()));
+    __ LoadObject(R4, Object::null_object());
     __ ldr(R5, FieldAddress(R3,
         Class::type_arguments_field_offset_in_words_offset()));
     __ CompareImmediate(R5, Class::kNoTypeArguments);
@@ -1798,7 +1797,7 @@
   __ SmiTag(R3);
   __ Bind(&loop);
   __ ldr(R5, Address(R2, kWordSize * SubtypeTestCache::kInstanceClassId));
-  __ CompareImmediate(R5, reinterpret_cast<intptr_t>(Object::null()));
+  __ CompareObject(R5, Object::null_object());
   __ b(&not_found, EQ);
   __ cmp(R5, Operand(R3));
   if (n == 1) {
@@ -1823,7 +1822,7 @@
   __ b(&loop);
   // Fall through to not found.
   __ Bind(&not_found);
-  __ LoadImmediate(R1, reinterpret_cast<intptr_t>(Object::null()));
+  __ LoadObject(R1, Object::null_object());
   __ Ret();
 
   __ Bind(&found);
@@ -1891,10 +1890,9 @@
   __ ldr(THR, Address(SP, 4));  // Thread.
   __ mov(FP, Operand(R2));  // Frame_pointer.
   __ mov(SP, Operand(IP));  // Set Stack pointer.
-  __ LoadIsolate(R3);
   // Set the tag.
   __ LoadImmediate(R2, VMTag::kDartTagId);
-  __ StoreToOffset(kWord, R2, R3, Isolate::vm_tag_offset());
+  __ StoreToOffset(kWord, R2, THR, Thread::vm_tag_offset());
   // Clear top exit frame.
   __ LoadImmediate(R2, 0);
   __ StoreToOffset(kWord, R2, THR, Thread::top_exit_frame_info_offset());
@@ -1908,27 +1906,21 @@
 void StubCode::GenerateOptimizeFunctionStub(Assembler* assembler) {
   __ EnterStubFrame();
   __ Push(R4);
-  __ LoadImmediate(IP, reinterpret_cast<intptr_t>(Object::null()));
+  __ LoadObject(IP, Object::null_object());
   __ Push(IP);  // Setup space on stack for return value.
   __ Push(R6);
   __ CallRuntime(kOptimizeInvokedFunctionRuntimeEntry, 1);
   __ Pop(R0);  // Discard argument.
   __ Pop(R0);  // Get Code object
   __ Pop(R4);  // Restore argument descriptor.
-  __ ldr(R0, FieldAddress(R0, Code::instructions_offset()));
-  __ AddImmediate(R0, Instructions::HeaderSize() - kHeapObjectTag);
   __ LeaveStubFrame();
+  __ mov(CODE_REG, Operand(R0));
+  __ ldr(R0, FieldAddress(R0, Code::entry_point_offset()));
   __ bx(R0);
   __ bkpt(0);
 }
 
 
-DECLARE_LEAF_RUNTIME_ENTRY(intptr_t,
-                           BigintCompare,
-                           RawBigint* left,
-                           RawBigint* right);
-
-
 // Does identical check (object references are equal or not equal) with special
 // checks for boxed numbers.
 // LR: return address.
@@ -2025,6 +2017,7 @@
     __ Bind(&stepping);
     __ EnterStubFrame();
     __ CallRuntime(kSingleStepHandlerRuntimeEntry, 0);
+    __ RestoreCodePointer();
     __ LeaveStubFrame();
     __ b(&done_stepping);
   }
@@ -2084,10 +2077,8 @@
   // be invoked as a normal Dart function.
   __ add(IP, R2, Operand(R3, LSL, 2));
   __ ldr(R0, FieldAddress(IP, base + kWordSize));
-  __ ldr(target, FieldAddress(R0, Function::instructions_offset()));
-  // TODO(srdjan): Evaluate performance impact of moving the instruction below
-  // to the call site, instead of having it here.
-  __ AddImmediate(target, Instructions::HeaderSize() - kHeapObjectTag);
+  __ ldr(CODE_REG, FieldAddress(R0, Function::code_offset()));
+  __ ldr(target, FieldAddress(R0, Function::entry_point_offset()));
 }
 
 
diff --git a/runtime/vm/stub_code_arm64.cc b/runtime/vm/stub_code_arm64.cc
index c8ef95a..facc08c 100644
--- a/runtime/vm/stub_code_arm64.cc
+++ b/runtime/vm/stub_code_arm64.cc
@@ -41,15 +41,11 @@
   const intptr_t argc_tag_offset = NativeArguments::argc_tag_offset();
   const intptr_t argv_offset = NativeArguments::argv_offset();
   const intptr_t retval_offset = NativeArguments::retval_offset();
-  const intptr_t exitframe_last_param_slot_from_fp = 1;
 
   __ SetPrologueOffset();
   __ Comment("CallToRuntimeStub");
   __ EnterStubFrame();
 
-  COMPILE_ASSERT((kAbiPreservedCpuRegs & (1 << R28)) != 0);
-  __ LoadIsolate(R28);
-
   // Save exit frame information to enable stack walking as we are about
   // to transition to Dart VM C++ code.
   __ StoreToOffset(FP, THR, Thread::top_exit_frame_info_offset());
@@ -57,7 +53,7 @@
 #if defined(DEBUG)
   { Label ok;
     // Check that we are always entering from Dart code.
-    __ LoadFromOffset(R8, R28, Isolate::vm_tag_offset());
+    __ LoadFromOffset(R8, THR, Thread::vm_tag_offset());
     __ CompareImmediate(R8, VMTag::kDartTagId);
     __ b(&ok, EQ);
     __ Stop("Not coming from Dart code.");
@@ -65,8 +61,8 @@
   }
 #endif
 
-  // Mark that the isolate is executing VM code.
-  __ StoreToOffset(R5, R28, Isolate::vm_tag_offset());
+  // Mark that the thread is executing VM code.
+  __ StoreToOffset(R5, THR, Thread::vm_tag_offset());
 
   // Reserve space for arguments and align frame before entering C++ world.
   // NativeArguments are passed in registers.
@@ -91,7 +87,7 @@
   __ add(R2, ZR, Operand(R4, LSL, 3));
   __ add(R2, FP, Operand(R2));  // Compute argv.
   // Set argv in NativeArguments.
-  __ AddImmediate(R2, R2, exitframe_last_param_slot_from_fp * kWordSize);
+  __ AddImmediate(R2, R2, kParamEndSlotFromFp * kWordSize);
 
     ASSERT(retval_offset == 3 * kWordSize);
   __ AddImmediate(R3, R2, kWordSize);
@@ -116,9 +112,9 @@
   __ mov(CSP, R26);
 
   // Retval is next to 1st argument.
-  // Mark that the isolate is executing Dart code.
+  // Mark that the thread is executing Dart code.
   __ LoadImmediate(R2, VMTag::kDartTagId);
-  __ StoreToOffset(R2, R28, Isolate::vm_tag_offset());
+  __ StoreToOffset(R2, THR, Thread::vm_tag_offset());
 
   // Reset exit frame information in Isolate structure.
   __ StoreToOffset(ZR, THR, Thread::top_exit_frame_info_offset());
@@ -128,6 +124,13 @@
 }
 
 
+// Print the stop message.
+DEFINE_LEAF_RUNTIME_ENTRY(void, PrintStopMessage, 1, const char* message) {
+  OS::Print("Stop message: %s\n", message);
+}
+END_LEAF_RUNTIME_ENTRY
+
+
 void StubCode::GeneratePrintStopMessageStub(Assembler* assembler) {
   __ Stop("GeneratePrintStopMessageStub");
 }
@@ -147,9 +150,6 @@
 
   __ EnterStubFrame();
 
-  COMPILE_ASSERT((kAbiPreservedCpuRegs & (1 << R28)) != 0);
-  __ LoadIsolate(R28);
-
   // Save exit frame information to enable stack walking as we are about
   // to transition to native code.
   __ StoreToOffset(FP, THR, Thread::top_exit_frame_info_offset());
@@ -157,7 +157,7 @@
 #if defined(DEBUG)
   { Label ok;
     // Check that we are always entering from Dart code.
-    __ LoadFromOffset(R6, R28, Isolate::vm_tag_offset());
+    __ LoadFromOffset(R6, THR, Thread::vm_tag_offset());
     __ CompareImmediate(R6, VMTag::kDartTagId);
     __ b(&ok, EQ);
     __ Stop("Not coming from Dart code.");
@@ -165,8 +165,8 @@
   }
 #endif
 
-  // Mark that the isolate is executing Native code.
-  __ StoreToOffset(R5, R28, Isolate::vm_tag_offset());
+  // Mark that the thread is executing native code.
+  __ StoreToOffset(R5, THR, Thread::vm_tag_offset());
 
   // Reserve space for the native arguments structure passed on the stack (the
   // outgoing pointer parameter to the native arguments structure is passed in
@@ -208,24 +208,18 @@
   __ mov(CSP, SP);
 
   __ mov(R1, R5);  // Pass the function entrypoint to call.
+
   // Call native function invocation wrapper or redirection via simulator.
-#if defined(USING_SIMULATOR)
-  uword entry = reinterpret_cast<uword>(NativeEntry::NativeCallWrapper);
-  entry = Simulator::RedirectExternalReference(
-      entry, Simulator::kNativeCall, NativeEntry::kNumCallWrapperArguments);
-  __ LoadImmediate(R2, entry);
-  __ blr(R2);
-#else
-  __ BranchLink(&NativeEntry::NativeCallWrapperLabel());
-#endif
+  __ ldr(LR, Address(THR, Thread::native_call_wrapper_entry_point_offset()));
+  __ blr(LR);
 
   // Restore SP and CSP.
   __ mov(SP, CSP);
   __ mov(CSP, R26);
 
-  // Mark that the isolate is executing Dart code.
+  // Mark that the thread is executing Dart code.
   __ LoadImmediate(R2, VMTag::kDartTagId);
-  __ StoreToOffset(R2, R28, Isolate::vm_tag_offset());
+  __ StoreToOffset(R2, THR, Thread::vm_tag_offset());
 
   // Reset exit frame information in Isolate structure.
   __ StoreToOffset(ZR, THR, Thread::top_exit_frame_info_offset());
@@ -249,9 +243,6 @@
 
   __ EnterStubFrame();
 
-  COMPILE_ASSERT((kAbiPreservedCpuRegs & (1 << R28)) != 0);
-  __ LoadIsolate(R28);
-
   // Save exit frame information to enable stack walking as we are about
   // to transition to native code.
   __ StoreToOffset(FP, THR, Thread::top_exit_frame_info_offset());
@@ -259,7 +250,7 @@
 #if defined(DEBUG)
   { Label ok;
     // Check that we are always entering from Dart code.
-    __ LoadFromOffset(R6, R28, Isolate::vm_tag_offset());
+    __ LoadFromOffset(R6, THR, Thread::vm_tag_offset());
     __ CompareImmediate(R6, VMTag::kDartTagId);
     __ b(&ok, EQ);
     __ Stop("Not coming from Dart code.");
@@ -267,8 +258,8 @@
   }
 #endif
 
-  // Mark that the isolate is executing Native code.
-  __ StoreToOffset(R5, R28, Isolate::vm_tag_offset());
+  // Mark that the thread is executing native code.
+  __ StoreToOffset(R5, THR, Thread::vm_tag_offset());
 
   // Reserve space for the native arguments structure passed on the stack (the
   // outgoing pointer parameter to the native arguments structure is passed in
@@ -316,9 +307,9 @@
   __ mov(SP, CSP);
   __ mov(CSP, R26);
 
-  // Mark that the isolate is executing Dart code.
+  // Mark that the thread is executing Dart code.
   __ LoadImmediate(R2, VMTag::kDartTagId);
-  __ StoreToOffset(R2, R28, Isolate::vm_tag_offset());
+  __ StoreToOffset(R2, THR, Thread::vm_tag_offset());
 
   // Reset exit frame information in Isolate structure.
   __ StoreToOffset(ZR, THR, Thread::top_exit_frame_info_offset());
@@ -339,13 +330,12 @@
   __ PushObject(Object::null_object());
   __ CallRuntime(kPatchStaticCallRuntimeEntry, 0);
   // Get Code object result and restore arguments descriptor array.
-  __ Pop(R0);
+  __ Pop(CODE_REG);
   __ Pop(R4);
   // Remove the stub frame.
   __ LeaveStubFrame();
   // Jump to the dart function.
-  __ LoadFieldFromOffset(R0, R0, Code::instructions_offset());
-  __ AddImmediate(R0, R0, Instructions::HeaderSize() - kHeapObjectTag);
+  __ LoadFieldFromOffset(R0, CODE_REG, Code::entry_point_offset());
   __ br(R0);
 }
 
@@ -354,6 +344,10 @@
 // (invalid because its function was optimized or deoptimized).
 // R4: arguments descriptor array.
 void StubCode::GenerateFixCallersTargetStub(Assembler* assembler) {
+  // Load code pointer to this stub from the thread:
+  // The one that is passed in, is not correct - it points to the code object
+  // that needs to be replaced.
+  __ ldr(CODE_REG, Address(THR, Thread::fix_callers_target_code_offset()));
   // Create a stub frame as we are pushing some objects on the stack before
   // calling into the runtime.
   __ EnterStubFrame();
@@ -362,13 +356,12 @@
   __ PushObject(Object::null_object());
   __ CallRuntime(kFixCallersTargetRuntimeEntry, 0);
   // Get Code object result and restore arguments descriptor array.
-  __ Pop(R0);
+  __ Pop(CODE_REG);
   __ Pop(R4);
   // Remove the stub frame.
   __ LeaveStubFrame();
   // Jump to the dart function.
-  __ LoadFieldFromOffset(R0, R0, Code::instructions_offset());
-  __ AddImmediate(R0, R0, Instructions::HeaderSize() - kHeapObjectTag);
+  __ LoadFieldFromOffset(R0, CODE_REG, Code::entry_point_offset());
   __ br(R0);
 }
 
@@ -376,17 +369,20 @@
 // Called from object allocate instruction when the allocation stub has been
 // disabled.
 void StubCode::GenerateFixAllocationStubTargetStub(Assembler* assembler) {
+  // Load code pointer to this stub from the thread:
+  // The one that is passed in, is not correct - it points to the code object
+  // that needs to be replaced.
+  __ ldr(CODE_REG, Address(THR, Thread::fix_allocation_stub_code_offset()));
   __ EnterStubFrame();
   // Setup space on stack for return value.
   __ PushObject(Object::null_object());
   __ CallRuntime(kFixAllocationStubTargetRuntimeEntry, 0);
   // Get Code object result.
-  __ Pop(R0);
+  __ Pop(CODE_REG);
   // Remove the stub frame.
   __ LeaveStubFrame();
   // Jump to the dart function.
-  __ LoadFieldFromOffset(R0, R0, Code::instructions_offset());
-  __ AddImmediate(R0, R0, Instructions::HeaderSize() - kHeapObjectTag);
+  __ LoadFieldFromOffset(R0, CODE_REG, Code::entry_point_offset());
   __ br(R0);
 }
 
@@ -423,13 +419,6 @@
 }
 
 
-DECLARE_LEAF_RUNTIME_ENTRY(intptr_t, DeoptimizeCopyFrame,
-                           intptr_t deopt_reason,
-                           uword saved_registers_address);
-
-DECLARE_LEAF_RUNTIME_ENTRY(void, DeoptimizeFillFrame, uword last_fp);
-
-
 // Used by eager and lazy deoptimization. Preserve result in RAX if necessary.
 // This stub translates optimized frame into unoptimized frame. The optimized
 // frame can contain values in registers and on stack, the unoptimized
@@ -451,15 +440,16 @@
 //   +------------------+
 //   | return-address   |  (deoptimization point)
 //   +------------------+
+//   | Saved CODE_REG   |
+//   +------------------+
 //   | ...              | <- SP of optimized frame
 //
 // Parts of the code cannot GC, part of the code can GC.
 static void GenerateDeoptimizationSequence(Assembler* assembler,
-                                           bool preserve_result) {
+                                           DeoptStubKind kind) {
   // DeoptimizeCopyFrame 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.
-  __ EnterFrame(0);
-  __ TagAndPushPPAndPcMarker(ZR);
+  __ EnterStubFrame();
 
   // The code in this frame may not cause GC. kDeoptimizeCopyFrameRuntimeEntry
   // and kDeoptimizeFillFrameRuntimeEntry are leaf runtime calls.
@@ -471,7 +461,15 @@
   // lowest address.
   for (intptr_t i = kNumberOfCpuRegisters - 1; i >= 0; i--) {
     const Register r = static_cast<Register>(i);
-    __ str(r, Address(SP, -1 * kWordSize, Address::PreIndex));
+    if (r == CODE_REG) {
+      // Save the original value of CODE_REG pushed before invoking this stub
+      // instead of the value used to call this stub.
+      COMPILE_ASSERT(R25 > CODE_REG);
+      __ ldr(R25, Address(FP, 2 * kWordSize));
+      __ str(R25, Address(SP, -1 * kWordSize, Address::PreIndex));
+    } else {
+      __ str(r, Address(SP, -1 * kWordSize, Address::PreIndex));
+    }
   }
 
   for (intptr_t reg_idx = kNumberOfVRegisters - 1; reg_idx >= 0; reg_idx--) {
@@ -480,23 +478,25 @@
   }
 
   __ mov(R0, SP);  // Pass address of saved registers block.
+  __ LoadImmediate(R1, kind == kLazyDeopt ? 1 : 0);
   __ ReserveAlignedFrameSpace(0);
-  __ CallRuntime(kDeoptimizeCopyFrameRuntimeEntry, 1);
+  __ CallRuntime(kDeoptimizeCopyFrameRuntimeEntry, 2);
   // Result (R0) is stack-size (FP - SP) in bytes.
 
+  const bool preserve_result = (kind == kLazyDeopt);
   if (preserve_result) {
     // Restore result into R1 temporarily.
     __ LoadFromOffset(R1, FP, saved_result_slot_from_fp * kWordSize);
   }
 
   // There is a Dart Frame on the stack. We must restore PP and leave frame.
-  __ LeaveDartFrame();
+  __ RestoreCodePointer();
+  __ LeaveStubFrame();
   __ sub(SP, FP, Operand(R0));
 
   // 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.
-  __ EnterFrame(0);
-  __ TagAndPushPPAndPcMarker(ZR);
+  __ EnterStubFrame();
 
   if (preserve_result) {
     __ Push(R1);  // Preserve result as first local.
@@ -510,7 +510,8 @@
   }
   // Code above cannot cause GC.
   // There is a Dart Frame on the stack. We must restore PP and leave frame.
-  __ LeaveDartFrame();
+  __ RestoreCodePointer();
+  __ LeaveStubFrame();
 
   // Frame is fully rewritten at this point and it is safe to perform a GC.
   // Materialize any objects that were deferred by FillFrame because they
@@ -518,7 +519,6 @@
   // Enter stub frame with loading PP. The caller's PP is not materialized yet.
   __ EnterStubFrame();
   if (preserve_result) {
-    __ Push(ZR);  // Workaround for dropped stack slot during GC.
     __ Push(R1);  // Preserve result, it will be GC-d here.
   }
   __ Push(ZR);  // Space for the result.
@@ -529,7 +529,6 @@
   __ SmiUntag(R1);
   if (preserve_result) {
     __ Pop(R0);  // Restore result.
-    __ Drop(1);  // Workaround for dropped stack slot during GC.
   }
   __ LeaveStubFrame();
   // Remove materialization arguments.
@@ -541,13 +540,16 @@
 void StubCode::GenerateDeoptimizeLazyStub(Assembler* assembler) {
   // Correct return address to point just after the call that is being
   // deoptimized.
-  __ AddImmediate(LR, LR, -CallPattern::kLengthInBytes);
-  GenerateDeoptimizationSequence(assembler, true);  // Preserve R0.
+  __ AddImmediate(LR, LR, -CallPattern::kDeoptCallLengthInBytes);
+  // Push zap value instead of CODE_REG for lazy deopt.
+  __ LoadImmediate(TMP, 0xf1f1f1f1);
+  __ Push(TMP);
+  GenerateDeoptimizationSequence(assembler, kLazyDeopt);
 }
 
 
 void StubCode::GenerateDeoptimizeStub(Assembler* assembler) {
-  GenerateDeoptimizationSequence(assembler, false);  // Don't preserve R0.
+  GenerateDeoptimizationSequence(assembler, kEagerDeopt);
 }
 
 
@@ -608,6 +610,7 @@
   __ Pop(R4);
   __ Pop(R5);
 
+  __ RestoreCodePointer();
   __ LeaveStubFrame();
 
   if (!FLAG_lazy_dispatchers) {
@@ -617,8 +620,8 @@
   }
 
   // Tail-call to target function.
-  __ LoadFieldFromOffset(R2, R0, Function::instructions_offset());
-  __ AddImmediate(R2, R2, Instructions::HeaderSize() - kHeapObjectTag);
+  __ LoadFieldFromOffset(CODE_REG, R0, Function::code_offset());
+  __ LoadFieldFromOffset(R2, R0, Function::entry_point_offset());
   __ br(R2);
 }
 
@@ -774,7 +777,7 @@
 // Called when invoking Dart code from C++ (VM code).
 // Input parameters:
 //   LR : points to return address.
-//   R0 : entrypoint of the Dart function to call.
+//   R0 : code object of the Dart function to call.
 //   R1 : arguments descriptor array.
 //   R2 : arguments array.
 //   R3 : current thread.
@@ -786,6 +789,10 @@
   __ SetupDartSP(Isolate::GetSpecifiedStackSize());
   __ EnterFrame(0);
 
+  // Push code object to PC marker slot.
+  __ ldr(TMP, Address(R3, Thread::invoke_dart_code_stub_offset()));
+  __ Push(TMP);
+
   // Save the callee-saved registers.
   for (int i = kAbiFirstPreservedCpuReg; i <= kAbiLastPreservedCpuReg; i++) {
     const Register r = static_cast<Register>(i);
@@ -801,25 +808,18 @@
     __ PushDouble(r);
   }
 
-  // We now load the pool pointer(PP) as we are about to invoke dart code and we
-  // could potentially invoke some intrinsic functions which need the PP to be
-  // set up.
-  __ LoadPoolPointer();
-
   // Set up THR, which caches the current thread in Dart code.
   if (THR != R3) {
     __ mov(THR, R3);
   }
-  // Load Isolate pointer into temporary register R5.
-  __ LoadIsolate(R5);
 
   // Save the current VMTag on the stack.
-  __ LoadFromOffset(R4, R5, Isolate::vm_tag_offset());
+  __ LoadFromOffset(R4, THR, Thread::vm_tag_offset());
   __ Push(R4);
 
-  // Mark that the isolate is executing Dart code.
+  // Mark that the thread is executing Dart code.
   __ LoadImmediate(R6, VMTag::kDartTagId);
-  __ StoreToOffset(R6, R5, Isolate::vm_tag_offset());
+  __ StoreToOffset(R6, THR, Thread::vm_tag_offset());
 
   // Save top resource and top exit frame info. Use R6 as a temporary register.
   // StackFrameIterator reads the top exit frame info saved in this frame.
@@ -829,7 +829,7 @@
   __ LoadFromOffset(R6, THR, Thread::top_exit_frame_info_offset());
   __ StoreToOffset(ZR, THR, Thread::top_exit_frame_info_offset());
   // kExitLinkSlotFromEntryFp must be kept in sync with the code below.
-  ASSERT(kExitLinkSlotFromEntryFp == -21);
+  ASSERT(kExitLinkSlotFromEntryFp == -22);
   __ Push(R6);
 
   // Load arguments descriptor array into R4, which is passed to Dart code.
@@ -858,18 +858,20 @@
   __ b(&push_arguments, LT);
   __ Bind(&done_push_arguments);
 
+  // We now load the pool pointer(PP) with a GC safe value as we are about to
+  // invoke dart code. We don't need a real object pool here.
+  // Smi zero does not work because ARM64 assumes PP to be untagged.
+  __ LoadObject(PP, Object::null_object());
+
   // Call the Dart code entrypoint.
+  __ ldr(CODE_REG, Address(R0, VMHandles::kOffsetOfRawPtrInHandle));
+  __ ldr(R0, FieldAddress(CODE_REG, Code::entry_point_offset()));
   __ blr(R0);  // R4 is the arguments descriptor array.
   __ Comment("InvokeDartCodeStub return");
 
-  // Restore constant pool pointer after return.
-  __ LoadPoolPointer();
-
   // Get rid of arguments pushed on the stack.
   __ AddImmediate(SP, FP, kExitLinkSlotFromEntryFp * kWordSize);
 
-  __ LoadIsolate(R28);
-
   // Restore the saved top exit frame info and top resource back into the
   // Isolate structure. Uses R6 as a temporary register for this.
   __ Pop(R6);
@@ -879,7 +881,7 @@
 
   // Restore the current VMTag from the stack.
   __ Pop(R4);
-  __ StoreToOffset(R4, R28, Isolate::vm_tag_offset());
+  __ StoreToOffset(R4, THR, Thread::vm_tag_offset());
 
   // Restore the bottom 64-bits of callee-saved V registers.
   for (int i = kAbiLastPreservedFpuReg; i >= kAbiFirstPreservedFpuReg; i--) {
@@ -896,7 +898,6 @@
     // using it as the stack pointer.
     __ ldr(r, Address(SP, 1 * kWordSize, Address::PostIndex));
   }
-  __ set_constant_pool_allowed(false);
 
   // Restore the frame pointer and C stack pointer and return.
   __ LeaveFrame();
@@ -1023,8 +1024,6 @@
 }
 
 
-DECLARE_LEAF_RUNTIME_ENTRY(void, StoreBufferBlockProcess, Isolate* isolate);
-
 // Helper stub to implement Assembler::StoreIntoObject.
 // Input parameters:
 //   R0: Address being stored
@@ -1084,10 +1083,8 @@
 // Input parameters:
 //   LR : return address.
 //   SP + 0 : type arguments object (only if class is parameterized).
-void StubCode::GenerateAllocationStubForClass(
-    Assembler* assembler, const Class& cls,
-    uword* entry_patch_offset, uword* patch_code_pc_offset) {
-  *entry_patch_offset = assembler->CodeSize();
+void StubCode::GenerateAllocationStubForClass(Assembler* assembler,
+                                              const Class& cls) {
   // The generated code is different if the class is parameterized.
   const bool is_cls_parameterized = cls.NumTypeArguments() > 0;
   ASSERT(!is_cls_parameterized ||
@@ -1207,8 +1204,6 @@
   // Restore the frame pointer.
   __ LeaveStubFrame();
   __ ret();
-  *patch_code_pc_offset = assembler->CodeSize();
-  __ BranchPatchable(*StubCode::FixAllocationStubTarget_entry());
 }
 
 
@@ -1525,6 +1520,9 @@
   __ Pop(R0);  // Pop returned function object into R0.
   __ Pop(R5);  // Restore IC Data.
   __ Pop(R4);  // Restore arguments descriptor array.
+  if (range_collection_mode == kCollectRanges) {
+    __ RestoreCodePointer();
+  }
   __ LeaveStubFrame();
   Label call_target_function;
   if (!FLAG_lazy_dispatchers) {
@@ -1552,10 +1550,8 @@
   __ Comment("Call target");
   __ Bind(&call_target_function);
   // R0: target function.
-  __ LoadFieldFromOffset(R2, R0, Function::instructions_offset());
-  __ AddImmediate(
-      R2, R2, Instructions::HeaderSize() - kHeapObjectTag);
   if (range_collection_mode == kCollectRanges) {
+    __ LoadFieldFromOffset(R2, R0, Function::entry_point_offset());
     __ ldr(R1, Address(SP, 0 * kWordSize));
     if (num_args == 2) {
       __ ldr(R3, Address(SP, 1 * kWordSize));
@@ -1566,6 +1562,7 @@
       __ Push(R3);
     }
     __ Push(R1);
+    __ LoadFieldFromOffset(CODE_REG, R0, Function::code_offset());
     __ blr(R2);
 
     Label done;
@@ -1575,6 +1572,8 @@
     __ LeaveStubFrame();
     __ ret();
   } else {
+    __ LoadFieldFromOffset(CODE_REG, R0, Function::code_offset());
+    __ LoadFieldFromOffset(R2, R0, Function::entry_point_offset());
     __ br(R2);
   }
 
@@ -1584,6 +1583,7 @@
     __ Push(R5);  // Preserve IC data.
     __ CallRuntime(kSingleStepHandlerRuntimeEntry, 0);
     __ Pop(R5);
+    __ RestoreCodePointer();
     __ LeaveStubFrame();
     __ b(&done_stepping);
   }
@@ -1728,12 +1728,8 @@
 
   // Get function and call it, if possible.
   __ LoadFromOffset(R0, R6, target_offset);
-  __ LoadFieldFromOffset(R2, R0, Function::instructions_offset());
-
-  // R0: function.
-  // R2: target instructons.
-  __ AddImmediate(
-      R2, R2, Instructions::HeaderSize() - kHeapObjectTag);
+  __ LoadFieldFromOffset(CODE_REG, R0, Function::code_offset());
+  __ LoadFieldFromOffset(R2, R0, Function::entry_point_offset());
   __ br(R2);
 
   if (FLAG_support_debugger) {
@@ -1742,6 +1738,7 @@
     __ Push(R5);  // Preserve IC data.
     __ CallRuntime(kSingleStepHandlerRuntimeEntry, 0);
     __ Pop(R5);
+    __ RestoreCodePointer();
     __ LeaveStubFrame();
     __ b(&done_stepping);
   }
@@ -1780,9 +1777,8 @@
   __ Pop(R5);  // Restore IC Data.
   __ LeaveStubFrame();
 
-  __ LoadFieldFromOffset(R2, R0, Function::instructions_offset());
-  __ AddImmediate(
-      R2, R2, Instructions::HeaderSize() - kHeapObjectTag);
+  __ LoadFieldFromOffset(CODE_REG, R0, Function::code_offset());
+  __ LoadFieldFromOffset(R2, R0, Function::entry_point_offset());
   __ br(R2);
 }
 
@@ -1793,9 +1789,10 @@
   __ Push(R5);
   __ PushObject(Object::null_object());  // Space for result.
   __ CallRuntime(kBreakpointRuntimeHandlerRuntimeEntry, 0);
-  __ Pop(R0);
+  __ Pop(CODE_REG);
   __ Pop(R5);
   __ LeaveStubFrame();
+  __ LoadFieldFromOffset(R0, CODE_REG, Code::entry_point_offset());
   __ br(R0);
 }
 
@@ -1804,8 +1801,9 @@
   __ EnterStubFrame();
   __ PushObject(Object::null_object());  // Space for result.
   __ CallRuntime(kBreakpointRuntimeHandlerRuntimeEntry, 0);
-  __ Pop(R0);
+  __ Pop(CODE_REG);
   __ LeaveStubFrame();
+  __ LoadFieldFromOffset(R0, CODE_REG, Code::entry_point_offset());
   __ br(R0);
 }
 
@@ -1962,10 +1960,9 @@
   __ mov(R0, R3);  // Exception object.
   __ mov(R1, R4);  // StackTrace object.
   __ mov(THR, R5);
-  __ LoadIsolate(R5);
   // Set the tag.
   __ LoadImmediate(R2, VMTag::kDartTagId);
-  __ StoreToOffset(R2, R5, Isolate::vm_tag_offset());
+  __ StoreToOffset(R2, THR, Thread::vm_tag_offset());
   // Clear top exit frame.
   __ StoreToOffset(ZR, THR, Thread::top_exit_frame_info_offset());
   __ ret();  // Jump to the exception handler code.
@@ -1983,22 +1980,15 @@
   __ Push(R6);
   __ CallRuntime(kOptimizeInvokedFunctionRuntimeEntry, 1);
   __ Pop(R0);  // Discard argument.
-  __ Pop(R0);  // Get Code object
+  __ Pop(CODE_REG);  // Get Code object
   __ Pop(R4);  // Restore argument descriptor.
-  __ LoadFieldFromOffset(R0, R0, Code::instructions_offset());
-  __ AddImmediate(R0, R0, Instructions::HeaderSize() - kHeapObjectTag);
+  __ LoadFieldFromOffset(R0, CODE_REG, Code::entry_point_offset());
   __ LeaveStubFrame();
   __ br(R0);
   __ brk(0);
 }
 
 
-DECLARE_LEAF_RUNTIME_ENTRY(intptr_t,
-                           BigintCompare,
-                           RawBigint* left,
-                           RawBigint* right);
-
-
 // Does identical check (object references are equal or not equal) with special
 // checks for boxed numbers.
 // Left and right are pushed on stack.
@@ -2085,6 +2075,7 @@
     __ Bind(&stepping);
     __ EnterStubFrame();
     __ CallRuntime(kSingleStepHandlerRuntimeEntry, 0);
+    __ RestoreCodePointer();
     __ LeaveStubFrame();
     __ b(&done_stepping);
   }
@@ -2143,10 +2134,8 @@
   // be invoked as a normal Dart function.
   __ add(TMP, R2, Operand(R3, LSL, 3));
   __ LoadFieldFromOffset(R0, TMP, base + kWordSize);
-  __ LoadFieldFromOffset(R1, R0, Function::instructions_offset());
-  // TODO(srdjan): Evaluate performance impact of moving the instruction below
-  // to the call site, instead of having it here.
-  __ AddImmediate(target, R1, Instructions::HeaderSize() - kHeapObjectTag);
+  __ LoadFieldFromOffset(CODE_REG, R0, Function::code_offset());
+  __ LoadFieldFromOffset(R1, R0, Function::entry_point_offset());
 }
 
 
diff --git a/runtime/vm/stub_code_arm64_test.cc b/runtime/vm/stub_code_arm64_test.cc
index 142a824..eba3949 100644
--- a/runtime/vm/stub_code_arm64_test.cc
+++ b/runtime/vm/stub_code_arm64_test.cc
@@ -19,10 +19,6 @@
 
 namespace dart {
 
-DECLARE_RUNTIME_ENTRY(TestSmiSub);
-DECLARE_LEAF_RUNTIME_ENTRY(RawObject*, TestLeafSmiAdd, RawObject*, RawObject*);
-
-
 static Function* CreateFunction(const char* name) {
   const String& class_name = String::Handle(Symbols::New("ownerClass"));
   const Script& script = Script::Handle();
@@ -40,16 +36,15 @@
 
 // Test calls to stub code which calls into the runtime.
 static void GenerateCallToCallRuntimeStub(Assembler* assembler,
-                                          int value1, int value2) {
+                                          int length) {
   const int argc = 2;
-  const Smi& smi1 = Smi::ZoneHandle(Smi::New(value1));
-  const Smi& smi2 = Smi::ZoneHandle(Smi::New(value2));
+  const Smi& smi_length = Smi::ZoneHandle(Smi::New(length));
   __ EnterDartFrame(0);
   __ PushObject(Object::null_object());  // Push Null obj for return value.
-  __ PushObject(smi1);  // Push argument 1 smi1.
-  __ PushObject(smi2);  // Push argument 2 smi2.
-  ASSERT(kTestSmiSubRuntimeEntry.argument_count() == argc);
-  __ CallRuntime(kTestSmiSubRuntimeEntry, argc);  // Call SmiSub runtime func.
+  __ PushObject(smi_length);             // Push argument 1: length.
+  __ PushObject(Object::null_object());  // Push argument 2: type arguments.
+  ASSERT(kAllocateArrayRuntimeEntry.argument_count() == argc);
+  __ CallRuntime(kAllocateArrayRuntimeEntry, argc);
   __ add(SP, SP, Operand(argc * kWordSize));
   __ Pop(R0);  // Pop return value from return slot.
   __ LeaveDartFrame();
@@ -60,31 +55,33 @@
 TEST_CASE(CallRuntimeStubCode) {
   extern const Function& RegisterFakeFunction(const char* name,
                                               const Code& code);
-  const int value1 = 10;
-  const int value2 = 20;
+  const int length = 10;
   const char* kName = "Test_CallRuntimeStubCode";
   Assembler _assembler_;
-  GenerateCallToCallRuntimeStub(&_assembler_, value1, value2);
+  GenerateCallToCallRuntimeStub(&_assembler_, length);
   const Code& code = Code::Handle(Code::FinalizeCode(
       *CreateFunction("Test_CallRuntimeStubCode"), &_assembler_));
   const Function& function = RegisterFakeFunction(kName, code);
-  Smi& result = Smi::Handle();
+  Array& result = Array::Handle();
   result ^= DartEntry::InvokeFunction(function, Object::empty_array());
-  EXPECT_EQ((value1 - value2), result.Value());
+  EXPECT_EQ(length, result.Length());
 }
 
 
 // Test calls to stub code which calls into a leaf runtime entry.
 static void GenerateCallToCallLeafRuntimeStub(Assembler* assembler,
-                                              int value1,
-                                              int value2) {
-  const Smi& smi1 = Smi::ZoneHandle(Smi::New(value1));
-  const Smi& smi2 = Smi::ZoneHandle(Smi::New(value2));
+                                              const char* value1,
+                                              const char* value2) {
+  const Bigint& bigint1 =
+      Bigint::ZoneHandle(Bigint::NewFromCString(value1, Heap::kOld));
+  const Bigint& bigint2 =
+      Bigint::ZoneHandle(Bigint::NewFromCString(value2, Heap::kOld));
   __ EnterDartFrame(0);
   __ ReserveAlignedFrameSpace(0);
-  __ LoadObject(R0, smi1);  // Set up argument 1 smi1.
-  __ LoadObject(R1, smi2);  // Set up argument 2 smi2.
-  __ CallRuntime(kTestLeafSmiAddRuntimeEntry, 2);  // Call SmiAdd runtime func.
+  __ LoadObject(R0, bigint1);  // Set up argument 1 bigint1.
+  __ LoadObject(R1, bigint2);  // Set up argument 2 bigint2.
+  __ CallRuntime(kBigintCompareRuntimeEntry, 2);
+  __ SmiTag(R0);
   __ LeaveDartFrame();
   __ ret();  // Return value is in R0.
 }
@@ -93,8 +90,8 @@
 TEST_CASE(CallLeafRuntimeStubCode) {
   extern const Function& RegisterFakeFunction(const char* name,
                                               const Code& code);
-  const int value1 = 10;
-  const int value2 = 20;
+  const char* value1 = "0xAAABBCCDDAABBCCDD";
+  const char* value2 = "0xAABBCCDDAABBCCDD";
   const char* kName = "Test_CallLeafRuntimeStubCode";
   Assembler _assembler_;
   GenerateCallToCallLeafRuntimeStub(&_assembler_, value1, value2);
@@ -103,7 +100,7 @@
   const Function& function = RegisterFakeFunction(kName, code);
   Smi& result = Smi::Handle();
   result ^= DartEntry::InvokeFunction(function, Object::empty_array());
-  EXPECT_EQ((value1 + value2), result.Value());
+  EXPECT_EQ(1, result.Value());
 }
 
 }  // namespace dart
diff --git a/runtime/vm/stub_code_arm_test.cc b/runtime/vm/stub_code_arm_test.cc
index 986007f..39aa9e6 100644
--- a/runtime/vm/stub_code_arm_test.cc
+++ b/runtime/vm/stub_code_arm_test.cc
@@ -19,10 +19,6 @@
 
 namespace dart {
 
-DECLARE_RUNTIME_ENTRY(TestSmiSub);
-DECLARE_LEAF_RUNTIME_ENTRY(RawObject*, TestLeafSmiAdd, RawObject*, RawObject*);
-
-
 static Function* CreateFunction(const char* name) {
   const String& class_name = String::Handle(Symbols::New("ownerClass"));
   const Script& script = Script::Handle();
@@ -40,16 +36,15 @@
 
 // Test calls to stub code which calls into the runtime.
 static void GenerateCallToCallRuntimeStub(Assembler* assembler,
-                                          int value1, int value2) {
+                                          int length) {
   const int argc = 2;
-  const Smi& smi1 = Smi::ZoneHandle(Smi::New(value1));
-  const Smi& smi2 = Smi::ZoneHandle(Smi::New(value2));
+  const Smi& smi_length = Smi::ZoneHandle(Smi::New(length));
   __ EnterDartFrame(0);
   __ PushObject(Object::null_object());  // Push Null object for return value.
-  __ PushObject(smi1);  // Push argument 1 smi1.
-  __ PushObject(smi2);  // Push argument 2 smi2.
-  ASSERT(kTestSmiSubRuntimeEntry.argument_count() == argc);
-  __ CallRuntime(kTestSmiSubRuntimeEntry, argc);  // Call SmiSub runtime func.
+  __ PushObject(smi_length);             // Push argument 1: length.
+  __ PushObject(Object::null_object());  // Push argument 2: type arguments.
+  ASSERT(kAllocateArrayRuntimeEntry.argument_count() == argc);
+  __ CallRuntime(kAllocateArrayRuntimeEntry, argc);
   __ AddImmediate(SP, argc * kWordSize);
   __ Pop(R0);  // Pop return value from return slot.
   __ LeaveDartFrame();
@@ -60,31 +55,33 @@
 TEST_CASE(CallRuntimeStubCode) {
   extern const Function& RegisterFakeFunction(const char* name,
                                               const Code& code);
-  const int value1 = 10;
-  const int value2 = 20;
+  const int length = 10;
   const char* kName = "Test_CallRuntimeStubCode";
   Assembler _assembler_;
-  GenerateCallToCallRuntimeStub(&_assembler_, value1, value2);
+  GenerateCallToCallRuntimeStub(&_assembler_, length);
   const Code& code = Code::Handle(Code::FinalizeCode(
       *CreateFunction("Test_CallRuntimeStubCode"), &_assembler_));
   const Function& function = RegisterFakeFunction(kName, code);
-  Smi& result = Smi::Handle();
+  Array& result = Array::Handle();
   result ^= DartEntry::InvokeFunction(function, Object::empty_array());
-  EXPECT_EQ((value1 - value2), result.Value());
+  EXPECT_EQ(length, result.Length());
 }
 
 
 // Test calls to stub code which calls into a leaf runtime entry.
 static void GenerateCallToCallLeafRuntimeStub(Assembler* assembler,
-                                              int value1,
-                                              int value2) {
-  const Smi& smi1 = Smi::ZoneHandle(Smi::New(value1));
-  const Smi& smi2 = Smi::ZoneHandle(Smi::New(value2));
+                                              const char* value1,
+                                              const char* value2) {
+  const Bigint& bigint1 =
+      Bigint::ZoneHandle(Bigint::NewFromCString(value1, Heap::kOld));
+  const Bigint& bigint2 =
+      Bigint::ZoneHandle(Bigint::NewFromCString(value2, Heap::kOld));
   __ EnterDartFrame(0);
   __ ReserveAlignedFrameSpace(0);
-  __ LoadObject(R0, smi1);  // Set up argument 1 smi1.
-  __ LoadObject(R1, smi2);  // Set up argument 2 smi2.
-  __ CallRuntime(kTestLeafSmiAddRuntimeEntry, 2);  // Call SmiAdd runtime func.
+  __ LoadObject(R0, bigint1);  // Set up argument 1 bigint1.
+  __ LoadObject(R1, bigint2);  // Set up argument 2 bigint2.
+  __ CallRuntime(kBigintCompareRuntimeEntry, 2);
+  __ SmiTag(R0);
   __ LeaveDartFrame();
   __ Ret();  // Return value is in R0.
 }
@@ -93,8 +90,8 @@
 TEST_CASE(CallLeafRuntimeStubCode) {
   extern const Function& RegisterFakeFunction(const char* name,
                                               const Code& code);
-  const int value1 = 10;
-  const int value2 = 20;
+  const char* value1 = "0xAAABBCCDDAABBCCDD";
+  const char* value2 = "0xAABBCCDDAABBCCDD";
   const char* kName = "Test_CallLeafRuntimeStubCode";
   Assembler _assembler_;
   GenerateCallToCallLeafRuntimeStub(&_assembler_, value1, value2);
@@ -103,7 +100,7 @@
   const Function& function = RegisterFakeFunction(kName, code);
   Smi& result = Smi::Handle();
   result ^= DartEntry::InvokeFunction(function, Object::empty_array());
-  EXPECT_EQ((value1 + value2), result.Value());
+  EXPECT_EQ(1, result.Value());
 }
 
 }  // namespace dart
diff --git a/runtime/vm/stub_code_ia32.cc b/runtime/vm/stub_code_ia32.cc
index 5469d45..8ca11ef 100644
--- a/runtime/vm/stub_code_ia32.cc
+++ b/runtime/vm/stub_code_ia32.cc
@@ -49,8 +49,6 @@
 
   __ EnterFrame(0);
 
-  __ LoadIsolate(EDI);
-
   // Save exit frame information to enable stack walking as we are about
   // to transition to Dart VM C++ code.
   __ movl(Address(THR, Thread::top_exit_frame_info_offset()), EBP);
@@ -58,16 +56,15 @@
 #if defined(DEBUG)
   { Label ok;
     // Check that we are always entering from Dart code.
-    __ cmpl(Address(EDI, Isolate::vm_tag_offset()),
-            Immediate(VMTag::kDartTagId));
+    __ cmpl(Assembler::VMTagAddress(), Immediate(VMTag::kDartTagId));
     __ j(EQUAL, &ok, Assembler::kNearJump);
     __ Stop("Not coming from Dart code.");
     __ Bind(&ok);
   }
 #endif
 
-  // Mark that the isolate is executing VM code.
-  __ movl(Address(EDI, Isolate::vm_tag_offset()), ECX);
+  // Mark that the thread is executing VM code.
+  __ movl(Assembler::VMTagAddress(), ECX);
 
   // Reserve space for arguments and align frame before entering C++ world.
   __ AddImmediate(ESP, Immediate(-INT32_SIZEOF(NativeArguments)));
@@ -80,15 +77,14 @@
   // There are no runtime calls to closures, so we do not need to set the tag
   // bits kClosureFunctionBit and kInstanceFunctionBit in argc_tag_.
   __ movl(Address(ESP, argc_tag_offset), EDX);  // Set argc in NativeArguments.
-  __ leal(EAX, Address(EBP, EDX, TIMES_4, 1 * kWordSize));  // Compute argv.
+  // 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, retval_offset), EAX);  // Set retval in NativeArguments.
   __ call(ECX);
 
-  // Mark that the isolate is executing Dart code. EDI is callee saved.
-  __ movl(Address(EDI, Isolate::vm_tag_offset()),
-          Immediate(VMTag::kDartTagId));
+  __ movl(Assembler::VMTagAddress(), Immediate(VMTag::kDartTagId));
 
   // Reset exit frame information in Isolate structure.
   __ movl(Address(THR, Thread::top_exit_frame_info_offset()), Immediate(0));
@@ -124,7 +120,6 @@
 //   EAX : address of first argument in argument array.
 //   ECX : address of the native function to call.
 //   EDX : argc_tag including number of arguments and function kind.
-// Uses EDI.
 void StubCode::GenerateCallNativeCFunctionStub(Assembler* assembler) {
   const intptr_t native_args_struct_offset =
       NativeEntry::kNumCallWrapperArguments * kWordSize;
@@ -139,7 +134,6 @@
 
   __ EnterFrame(0);
 
-  __ LoadIsolate(EDI);
 
   // Save exit frame information to enable stack walking as we are about
   // to transition to dart VM code.
@@ -148,16 +142,15 @@
 #if defined(DEBUG)
   { Label ok;
     // Check that we are always entering from Dart code.
-    __ cmpl(Address(EDI, Isolate::vm_tag_offset()),
-            Immediate(VMTag::kDartTagId));
+    __ cmpl(Assembler::VMTagAddress(), Immediate(VMTag::kDartTagId));
     __ j(EQUAL, &ok, Assembler::kNearJump);
     __ Stop("Not coming from Dart code.");
     __ Bind(&ok);
   }
 #endif
 
-  // Mark that the isolate is executing Native code.
-  __ movl(Address(EDI, Isolate::vm_tag_offset()), ECX);
+  // Mark that the thread is executing native code.
+  __ movl(Assembler::VMTagAddress(), ECX);
 
   // Reserve space for the native arguments structure, the outgoing parameters
   // (pointer to the native arguments structure, the C function entry point)
@@ -178,11 +171,10 @@
   __ movl(Address(ESP, 0), EAX);  // Pass the pointer to the NativeArguments.
 
   __ movl(Address(ESP, kWordSize), ECX);  // Function to call.
-  __ call(&NativeEntry::NativeCallWrapperLabel());
+  ExternalLabel label(NativeEntry::NativeCallWrapperEntry());
+  __ call(&label);
 
-  // Mark that the isolate is executing Dart code. EDI is callee saved.
-  __ movl(Address(EDI, Isolate::vm_tag_offset()),
-          Immediate(VMTag::kDartTagId));
+  __ movl(Assembler::VMTagAddress(), Immediate(VMTag::kDartTagId));
 
   // Reset exit frame information in Isolate structure.
   __ movl(Address(THR, Thread::top_exit_frame_info_offset()), Immediate(0));
@@ -198,7 +190,6 @@
 //   EAX : address of first argument in argument array.
 //   ECX : address of the native function to call.
 //   EDX : argc_tag including number of arguments and function kind.
-// Uses EDI.
 void StubCode::GenerateCallBootstrapCFunctionStub(Assembler* assembler) {
   const intptr_t native_args_struct_offset = kWordSize;
   const intptr_t thread_offset =
@@ -212,8 +203,6 @@
 
   __ EnterFrame(0);
 
-  __ LoadIsolate(EDI);
-
   // Save exit frame information to enable stack walking as we are about
   // to transition to dart VM code.
   __ movl(Address(THR, Thread::top_exit_frame_info_offset()), EBP);
@@ -221,16 +210,15 @@
 #if defined(DEBUG)
   { Label ok;
     // Check that we are always entering from Dart code.
-    __ cmpl(Address(EDI, Isolate::vm_tag_offset()),
-            Immediate(VMTag::kDartTagId));
+    __ cmpl(Assembler::VMTagAddress(), Immediate(VMTag::kDartTagId));
     __ j(EQUAL, &ok, Assembler::kNearJump);
     __ Stop("Not coming from Dart code.");
     __ Bind(&ok);
   }
 #endif
 
-  // Mark that the isolate is executing Native code.
-  __ movl(Address(EDI, Isolate::vm_tag_offset()), ECX);
+  // Mark that the thread is executing native code.
+  __ movl(Assembler::VMTagAddress(), ECX);
 
   // Reserve space for the native arguments structure, the outgoing parameter
   // (pointer to the native arguments structure) and align frame before
@@ -250,9 +238,7 @@
   __ movl(Address(ESP, 0), EAX);  // Pass the pointer to the NativeArguments.
   __ call(ECX);
 
-  // Mark that the isolate is executing Dart code. EDI is callee saved.
-  __ movl(Address(EDI, Isolate::vm_tag_offset()),
-          Immediate(VMTag::kDartTagId));
+  __ movl(Assembler::VMTagAddress(), Immediate(VMTag::kDartTagId));
 
   // Reset exit frame information in Isolate structure.
   __ movl(Address(THR, Thread::top_exit_frame_info_offset()), Immediate(0));
@@ -276,8 +262,7 @@
   // Remove the stub frame as we are about to jump to the dart function.
   __ LeaveFrame();
 
-  __ movl(ECX, FieldAddress(EAX, Code::instructions_offset()));
-  __ addl(ECX, Immediate(Instructions::HeaderSize() - kHeapObjectTag));
+  __ movl(ECX, FieldAddress(EAX, Code::entry_point_offset()));
   __ jmp(ECX);
 }
 
@@ -296,8 +281,7 @@
   __ CallRuntime(kFixCallersTargetRuntimeEntry, 0);
   __ popl(EAX);  // Get Code object.
   __ popl(EDX);  // Restore arguments descriptor array.
-  __ movl(EAX, FieldAddress(EAX, Code::instructions_offset()));
-  __ addl(EAX, Immediate(Instructions::HeaderSize() - kHeapObjectTag));
+  __ movl(EAX, FieldAddress(EAX, Code::entry_point_offset()));
   __ LeaveFrame();
   __ jmp(EAX);
   __ int3();
@@ -313,8 +297,7 @@
   __ pushl(raw_null);  // Setup space on stack for return value.
   __ CallRuntime(kFixAllocationStubTargetRuntimeEntry, 0);
   __ popl(EAX);  // Get Code object.
-  __ movl(EAX, FieldAddress(EAX, Code::instructions_offset()));
-  __ addl(EAX, Immediate(Instructions::HeaderSize() - kHeapObjectTag));
+  __ movl(EAX, FieldAddress(EAX, Code::entry_point_offset()));
   __ LeaveFrame();
   __ jmp(EAX);
   __ int3();
@@ -353,13 +336,6 @@
 }
 
 
-DECLARE_LEAF_RUNTIME_ENTRY(intptr_t, DeoptimizeCopyFrame,
-                           intptr_t deopt_reason,
-                           uword saved_registers_address);
-
-DECLARE_LEAF_RUNTIME_ENTRY(void, DeoptimizeFillFrame, uword last_fp);
-
-
 // Used by eager and lazy deoptimization. Preserve result in EAX if necessary.
 // This stub translates optimized frame into unoptimized frame. The optimized
 // frame can contain values in registers and on stack, the unoptimized
@@ -379,11 +355,13 @@
 //   +------------------+
 //   | return-address   |  (deoptimization point)
 //   +------------------+
+//   | Saved CODE_REG   |
+//   +------------------+
 //   | ...              | <- SP of optimized frame
 //
 // Parts of the code cannot GC, part of the code can GC.
 static void GenerateDeoptimizationSequence(Assembler* assembler,
-                                           bool preserve_result) {
+                                           DeoptStubKind kind) {
   // Leaf runtime function DeoptimizeCopyFrame expects a Dart frame.
   __ EnterDartFrame(0);
   // The code in this frame may not cause GC. kDeoptimizeCopyFrameRuntimeEntry
@@ -395,7 +373,13 @@
   // Push registers in their enumeration order: lowest register number at
   // lowest address.
   for (intptr_t i = kNumberOfCpuRegisters - 1; i >= 0; i--) {
-    __ pushl(static_cast<Register>(i));
+    if (i == CODE_REG) {
+      // Save the original value of CODE_REG pushed before invoking this stub
+      // instead of the value used to call this stub.
+      __ pushl(Address(EBP, 2 * kWordSize));
+    } else {
+      __ pushl(static_cast<Register>(i));
+    }
   }
   __ subl(ESP, Immediate(kNumberOfXmmRegisters * kFpuRegisterSize));
   intptr_t offset = 0;
@@ -406,11 +390,13 @@
   }
 
   __ movl(ECX, ESP);  // Preserve saved registers block.
-  __ ReserveAlignedFrameSpace(1 * kWordSize);
-  __ movl(Address(ESP, 0), ECX);  // Start of register block.
-  __ CallRuntime(kDeoptimizeCopyFrameRuntimeEntry, 1);
+  __ ReserveAlignedFrameSpace(2 * kWordSize);
+  __ movl(Address(ESP, 0 * kWordSize), ECX);  // Start of register block.
+  __ movl(Address(ESP, 1 * kWordSize), Immediate(kind == kLazyDeopt ? 1 : 0));
+  __ CallRuntime(kDeoptimizeCopyFrameRuntimeEntry, 2);
   // Result (EAX) is stack-size (FP - SP) in bytes.
 
+  const bool preserve_result = (kind == kLazyDeopt);
   if (preserve_result) {
     // Restore result into EBX temporarily.
     __ movl(EBX, Address(EBP, saved_result_slot_from_fp * kWordSize));
@@ -468,14 +454,14 @@
   // Correct return address to point just after the call that is being
   // deoptimized.
   __ popl(EBX);
-  __ subl(EBX, Immediate(CallPattern::InstructionLength()));
+  __ subl(EBX, Immediate(CallPattern::pattern_length_in_bytes()));
   __ pushl(EBX);
-  GenerateDeoptimizationSequence(assembler, true);  // Preserve EAX.
+  GenerateDeoptimizationSequence(assembler, kLazyDeopt);
 }
 
 
 void StubCode::GenerateDeoptimizeStub(Assembler* assembler) {
-  GenerateDeoptimizationSequence(assembler, false);  // Don't preserve EAX.
+  GenerateDeoptimizationSequence(assembler, kEagerDeopt);
 }
 
 
@@ -543,8 +529,7 @@
     __ Bind(&call_target_function);
   }
 
-  __ movl(EBX, FieldAddress(EAX, Function::instructions_offset()));
-  __ addl(EBX, Immediate(Instructions::HeaderSize() - kHeapObjectTag));
+  __ movl(EBX, FieldAddress(EAX, Function::entry_point_offset()));
   __ jmp(EBX);
 }
 
@@ -695,13 +680,13 @@
 // Called when invoking dart code from C++ (VM code).
 // Input parameters:
 //   ESP : points to return address.
-//   ESP + 4 : entrypoint of the dart function to call.
+//   ESP + 4 : code object of the dart function to call.
 //   ESP + 8 : arguments descriptor array.
 //   ESP + 12 : arguments array.
 //   ESP + 16 : current thread.
 // Uses EAX, EDX, ECX, EDI as temporary registers.
 void StubCode::GenerateInvokeDartCodeStub(Assembler* assembler) {
-  const intptr_t kEntryPointOffset = 2 * kWordSize;
+  const intptr_t kTargetCodeOffset = 2 * kWordSize;
   const intptr_t kArgumentsDescOffset = 3 * kWordSize;
   const intptr_t kArgumentsOffset = 4 * kWordSize;
   const intptr_t kThreadOffset = 5 * kWordSize;
@@ -709,22 +694,24 @@
   // Save frame pointer coming in.
   __ EnterFrame(0);
 
+  // Push code object to PC marker slot.
+  __ movl(EAX, Address(EBP, kThreadOffset));
+  __ pushl(Address(EAX, Thread::invoke_dart_code_stub_offset()));
+
   // Save C++ ABI callee-saved registers.
   __ pushl(EBX);
   __ pushl(ESI);
   __ pushl(EDI);
 
   // Set up THR, which caches the current thread in Dart code.
-  __ movl(THR, Address(EBP, kThreadOffset));
-  __ LoadIsolate(EDI);
+  __ movl(THR, EAX);
 
   // Save the current VMTag on the stack.
-  __ movl(ECX, Address(EDI, Isolate::vm_tag_offset()));
+  __ movl(ECX, Assembler::VMTagAddress());
   __ pushl(ECX);
 
-  // Mark that the isolate is executing Dart code.
-  __ movl(Address(EDI, Isolate::vm_tag_offset()),
-          Immediate(VMTag::kDartTagId));
+  // Mark that the thread is executing Dart code.
+  __ movl(Assembler::VMTagAddress(), Immediate(VMTag::kDartTagId));
 
   // Save top resource and top exit frame info. Use EDX as a temporary register.
   // StackFrameIterator reads the top exit frame info saved in this frame.
@@ -733,7 +720,7 @@
   __ movl(Address(THR, Thread::top_resource_offset()), Immediate(0));
   // The constant kExitLinkSlotFromEntryFp must be kept in sync with the
   // code below.
-  ASSERT(kExitLinkSlotFromEntryFp == -6);
+  ASSERT(kExitLinkSlotFromEntryFp == -7);
   __ movl(EDX, Address(THR, Thread::top_exit_frame_info_offset()));
   __ pushl(EDX);
   __ movl(Address(THR, Thread::top_exit_frame_info_offset()), Immediate(0));
@@ -767,7 +754,9 @@
   __ Bind(&done_push_arguments);
 
   // Call the dart code entrypoint.
-  __ call(Address(EBP, kEntryPointOffset));
+  __ movl(EAX, Address(EBP, kTargetCodeOffset));
+  __ movl(EAX, Address(EAX, VMHandles::kOffsetOfRawPtrInHandle));
+  __ call(FieldAddress(EAX, Code::entry_point_offset()));
 
   // Reread the arguments descriptor array to obtain the number of passed
   // arguments.
@@ -779,12 +768,11 @@
 
   // Restore the saved top exit frame info and top resource back into the
   // Isolate structure.
-  __ LoadIsolate(EDI);
   __ popl(Address(THR, Thread::top_exit_frame_info_offset()));
   __ popl(Address(THR, Thread::top_resource_offset()));
 
   // Restore the current VMTag from the stack.
-  __ popl(Address(EDI, Isolate::vm_tag_offset()));
+  __ popl(Assembler::VMTagAddress());
 
   // Restore C++ ABI callee-saved registers.
   __ popl(EDI);
@@ -935,7 +923,6 @@
   __ ret();
 }
 
-DECLARE_LEAF_RUNTIME_ENTRY(void, StoreBufferBlockProcess, Isolate* isolate);
 
 // Helper stub to implement Assembler::StoreIntoObject.
 // Input parameters:
@@ -1013,9 +1000,7 @@
 // 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,
-    uword* entry_patch_offset, uword* patch_code_pc_offset) {
-  *entry_patch_offset = assembler->CodeSize();
+    Assembler* assembler, const Class& cls) {
   const intptr_t kObjectTypeArgumentsOffset = 1 * kWordSize;
   const Immediate& raw_null =
       Immediate(reinterpret_cast<intptr_t>(Object::null()));
@@ -1137,10 +1122,6 @@
   // Restore the frame pointer.
   __ LeaveFrame();
   __ ret();
-  // Emit function patching code. This will be swapped with the first 5 bytes
-  // at entry point.
-  *patch_code_pc_offset = assembler->CodeSize();
-  __ Jmp(*StubCode::FixAllocationStubTarget_entry());
 }
 
 
@@ -1180,7 +1161,7 @@
 // function and not the top-scope function.
 void StubCode::GenerateOptimizedUsageCounterIncrement(Assembler* assembler) {
   Register ic_reg = ECX;
-  Register func_reg = EDI;
+  Register func_reg = EBX;
   if (FLAG_trace_optimized_ic_calls) {
     __ EnterStubFrame();
     __ pushl(func_reg);     // Preserve
@@ -1459,8 +1440,7 @@
   __ Bind(&call_target_function);
   __ Comment("Call target");
   // EAX: Target function.
-  __ movl(EBX, FieldAddress(EAX, Function::instructions_offset()));
-  __ addl(EBX, Immediate(Instructions::HeaderSize() - kHeapObjectTag));
+  __ movl(EBX, FieldAddress(EAX, Function::entry_point_offset()));
   if (range_collection_mode == kCollectRanges) {
     __ EnterStubFrame();
     __ pushl(ECX);
@@ -1653,10 +1633,7 @@
 
   // Get function and call it, if possible.
   __ movl(EAX, Address(EBX, target_offset));
-  __ movl(EBX, FieldAddress(EAX, Function::instructions_offset()));
-
-  // EBX: Target instructions.
-  __ addl(EBX, Immediate(Instructions::HeaderSize() - kHeapObjectTag));
+  __ movl(EBX, FieldAddress(EAX, Function::entry_point_offset()));
   __ jmp(EBX);
 
   if (FLAG_support_debugger) {
@@ -1704,8 +1681,7 @@
   __ popl(EDX);  // Restore arguments descriptor array.
   __ LeaveFrame();
 
-  __ movl(EAX, FieldAddress(EAX, Function::instructions_offset()));
-  __ addl(EAX, Immediate(Instructions::HeaderSize() - kHeapObjectTag));
+  __ movl(EAX, FieldAddress(EAX, Function::entry_point_offset()));
   __ jmp(EAX);
 }
 
@@ -1721,10 +1697,12 @@
       Immediate(reinterpret_cast<intptr_t>(Object::null()));
   __ pushl(raw_null);  // Room for result.
   __ CallRuntime(kBreakpointRuntimeHandlerRuntimeEntry, 0);
-  __ popl(EAX);  // Address of original stub.
+  __ popl(EAX);  // Code of original stub.
   __ popl(ECX);  // Restore IC data.
   __ LeaveFrame();
-  __ jmp(EAX);   // Jump to original stub.
+  // Jump to original stub.
+  __ movl(EAX, FieldAddress(EAX, Code::entry_point_offset()));
+  __ jmp(EAX);
 }
 
 
@@ -1736,9 +1714,11 @@
       Immediate(reinterpret_cast<intptr_t>(Object::null()));
   __ pushl(raw_null);  // Room for result.
   __ CallRuntime(kBreakpointRuntimeHandlerRuntimeEntry, 0);
-  __ popl(EAX);  // Address of original stub.
+  __ popl(EAX);  // Code of the original stub
   __ LeaveFrame();
-  __ jmp(EAX);   // Jump to original stub.
+  // Jump to original stub.
+  __ movl(EAX, FieldAddress(EAX, Code::entry_point_offset()));
+  __ jmp(EAX);
 }
 
 
@@ -1898,11 +1878,8 @@
   __ 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.
-  // TODO(koda): Pass thread instead of isolate.
-  __ LoadIsolate(EDI);
   // Set tag.
-  __ movl(Address(EDI, Isolate::vm_tag_offset()),
-          Immediate(VMTag::kDartTagId));
+  __ movl(Assembler::VMTagAddress(), Immediate(VMTag::kDartTagId));
   // Clear top exit frame.
   __ movl(Address(THR, Thread::top_exit_frame_info_offset()), Immediate(0));
   __ jmp(EBX);  // Jump to the exception handler code.
@@ -1910,7 +1887,7 @@
 
 
 // Calls to the runtime to optimize the given function.
-// EDI: function to be reoptimized.
+// EBX: function to be reoptimized.
 // EDX: argument descriptor (preserved).
 void StubCode::GenerateOptimizeFunctionStub(Assembler* assembler) {
   const Immediate& raw_null =
@@ -1918,25 +1895,18 @@
   __ EnterStubFrame();
   __ pushl(EDX);
   __ pushl(raw_null);  // Setup space on stack for return value.
-  __ pushl(EDI);
+  __ pushl(EBX);
   __ CallRuntime(kOptimizeInvokedFunctionRuntimeEntry, 1);
   __ popl(EAX);  // Discard argument.
   __ popl(EAX);  // Get Code object
   __ popl(EDX);  // Restore argument descriptor.
-  __ movl(EAX, FieldAddress(EAX, Code::instructions_offset()));
-  __ addl(EAX, Immediate(Instructions::HeaderSize() - kHeapObjectTag));
+  __ movl(EAX, FieldAddress(EAX, Code::entry_point_offset()));
   __ LeaveFrame();
   __ jmp(EAX);
   __ int3();
 }
 
 
-DECLARE_LEAF_RUNTIME_ENTRY(intptr_t,
-                           BigintCompare,
-                           RawBigint* left,
-                           RawBigint* right);
-
-
 // Does identical check (object references are equal or not equal) with special
 // checks for boxed numbers.
 // Return ZF set.
@@ -2087,20 +2057,17 @@
   // illegal class id was found, the target is a cache miss handler that can
   // be invoked as a normal Dart function.
   __ movl(EAX, FieldAddress(EDI, ECX, TIMES_4, base + kWordSize));
-  __ movl(target, FieldAddress(EAX, Function::instructions_offset()));
-  // TODO(srdjan): Evaluate performance impact of moving the instruction below
-  // to the call site, instead of having it here.
-  __ addl(target, Immediate(Instructions::HeaderSize() - kHeapObjectTag));
+  __ movl(target, FieldAddress(EAX, Function::entry_point_offset()));
 }
 
 
 // Called from megamorphic calls.
-//  EDI: receiver.
+//  ECX: receiver.
 //  EBX: lookup cache.
 // Result:
 //  EBX: entry point.
 void StubCode::GenerateMegamorphicLookupStub(Assembler* assembler) {
-  EmitMegamorphicLookup(assembler, EDI, EBX, EBX);
+  EmitMegamorphicLookup(assembler, ECX, EBX, EBX);
   __ ret();
 }
 
diff --git a/runtime/vm/stub_code_ia32_test.cc b/runtime/vm/stub_code_ia32_test.cc
index ce07b83..1ab200b 100644
--- a/runtime/vm/stub_code_ia32_test.cc
+++ b/runtime/vm/stub_code_ia32_test.cc
@@ -19,10 +19,6 @@
 
 namespace dart {
 
-DECLARE_RUNTIME_ENTRY(TestSmiSub);
-DECLARE_LEAF_RUNTIME_ENTRY(RawObject*, TestLeafSmiAdd, RawObject*, RawObject*);
-
-
 static Function* CreateFunction(const char* name) {
   const String& class_name = String::Handle(Symbols::New("ownerClass"));
   const Script& script = Script::Handle();
@@ -40,16 +36,15 @@
 
 // Test calls to stub code which calls into the runtime.
 static void GenerateCallToCallRuntimeStub(Assembler* assembler,
-                                          int value1, int value2) {
+                                          int length) {
   const int argc = 2;
-  const Smi& smi1 = Smi::ZoneHandle(Smi::New(value1));
-  const Smi& smi2 = Smi::ZoneHandle(Smi::New(value2));
+  const Smi& smi_length = Smi::ZoneHandle(Smi::New(length));
   __ enter(Immediate(0));
   __ PushObject(Object::null_object());  // Push Null object for return value.
-  __ PushObject(smi1);  // Push argument 1 smi1.
-  __ PushObject(smi2);  // Push argument 2 smi2.
-  ASSERT(kTestSmiSubRuntimeEntry.argument_count() == argc);
-  __ CallRuntime(kTestSmiSubRuntimeEntry, argc);  // Call SmiSub runtime func.
+  __ PushObject(smi_length);             // Push argument 1: length.
+  __ PushObject(Object::null_object());  // Push argument 2: type arguments.
+  ASSERT(kAllocateArrayRuntimeEntry.argument_count() == argc);
+  __ CallRuntime(kAllocateArrayRuntimeEntry, argc);
   __ AddImmediate(ESP, Immediate(argc * kWordSize));
   __ popl(EAX);  // Pop return value from return slot.
   __ leave();
@@ -60,33 +55,35 @@
 TEST_CASE(CallRuntimeStubCode) {
   extern const Function& RegisterFakeFunction(const char* name,
                                               const Code& code);
-  const int value1 = 10;
-  const int value2 = 20;
+  const int length = 10;
   const char* kName = "Test_CallRuntimeStubCode";
   Assembler _assembler_;
-  GenerateCallToCallRuntimeStub(&_assembler_, value1, value2);
+  GenerateCallToCallRuntimeStub(&_assembler_, length);
   const Code& code = Code::Handle(Code::FinalizeCode(
       *CreateFunction("Test_CallRuntimeStubCode"), &_assembler_));
   const Function& function = RegisterFakeFunction(kName, code);
-  Smi& result = Smi::Handle();
+  Array& result = Array::Handle();
   result ^= DartEntry::InvokeFunction(function, Object::empty_array());
-  EXPECT_EQ((value1 - value2), result.Value());
+  EXPECT_EQ(length, result.Length());
 }
 
 
 // Test calls to stub code which calls into a leaf runtime entry.
 static void GenerateCallToCallLeafRuntimeStub(Assembler* assembler,
-                                              int value1,
-                                              int value2) {
-  const Smi& smi1 = Smi::ZoneHandle(Smi::New(value1));
-  const Smi& smi2 = Smi::ZoneHandle(Smi::New(value2));
+                                              const char* value1,
+                                              const char* value2) {
+  const Bigint& bigint1 =
+      Bigint::ZoneHandle(Bigint::NewFromCString(value1, Heap::kOld));
+  const Bigint& bigint2 =
+      Bigint::ZoneHandle(Bigint::NewFromCString(value2, Heap::kOld));
   __ enter(Immediate(0));
   __ ReserveAlignedFrameSpace(2 * kWordSize);
-  __ LoadObject(EAX, smi1);
-  __ movl(Address(ESP, 0), EAX);  // Push argument 1 smi1.
-  __ LoadObject(EAX, smi2);
-  __ movl(Address(ESP, kWordSize), EAX);  // Push argument 2 smi2.
-  __ CallRuntime(kTestLeafSmiAddRuntimeEntry, 2);  // Call SmiAdd runtime func.
+  __ LoadObject(EAX, bigint1);
+  __ movl(Address(ESP, 0), EAX);  // Push argument 1 bigint1.
+  __ LoadObject(EAX, bigint2);
+  __ movl(Address(ESP, kWordSize), EAX);  // Push argument 2 bigint2.
+  __ CallRuntime(kBigintCompareRuntimeEntry, 2);
+  __ SmiTag(EAX);
   __ leave();
   __ ret();  // Return value is in EAX.
 }
@@ -95,8 +92,8 @@
 TEST_CASE(CallLeafRuntimeStubCode) {
   extern const Function& RegisterFakeFunction(const char* name,
                                               const Code& code);
-  const int value1 = 10;
-  const int value2 = 20;
+  const char* value1 = "0xAAABBCCDDAABBCCDD";
+  const char* value2 = "0xAABBCCDDAABBCCDD";
   const char* kName = "Test_CallLeafRuntimeStubCode";
   Assembler _assembler_;
   GenerateCallToCallLeafRuntimeStub(&_assembler_, value1, value2);
@@ -105,7 +102,7 @@
   const Function& function = RegisterFakeFunction(kName, code);
   Smi& result = Smi::Handle();
   result ^= DartEntry::InvokeFunction(function, Object::empty_array());
-  EXPECT_EQ((value1 + value2), result.Value());
+  EXPECT_EQ(1, result.Value());
 }
 
 }  // namespace dart
diff --git a/runtime/vm/stub_code_mips.cc b/runtime/vm/stub_code_mips.cc
index 73a0ba4..30a7cdf 100644
--- a/runtime/vm/stub_code_mips.cc
+++ b/runtime/vm/stub_code_mips.cc
@@ -41,15 +41,11 @@
   const intptr_t argc_tag_offset = NativeArguments::argc_tag_offset();
   const intptr_t argv_offset = NativeArguments::argv_offset();
   const intptr_t retval_offset = NativeArguments::retval_offset();
-  const intptr_t exitframe_last_param_slot_from_fp = 2;
 
   __ SetPrologueOffset();
   __ Comment("CallToRuntimeStub");
   __ EnterStubFrame();
 
-  COMPILE_ASSERT((kAbiPreservedCpuRegs & (1 << S6)) != 0);
-  __ LoadIsolate(S6);
-
   // Save exit frame information to enable stack walking as we are about
   // to transition to Dart VM C++ code.
   __ sw(FP, Address(THR, Thread::top_exit_frame_info_offset()));
@@ -57,15 +53,15 @@
 #if defined(DEBUG)
   { Label ok;
     // Check that we are always entering from Dart code.
-    __ lw(T0, Address(S6, Isolate::vm_tag_offset()));
+    __ lw(T0, Assembler::VMTagAddress());
     __ BranchEqual(T0, Immediate(VMTag::kDartTagId), &ok);
     __ Stop("Not coming from Dart code.");
     __ Bind(&ok);
   }
 #endif
 
-  // Mark that the isolate is executing VM code.
-  __ sw(S5, Address(S6, Isolate::vm_tag_offset()));
+  // Mark that the thread is executing VM code.
+  __ sw(S5, Assembler::VMTagAddress());
 
   // Reserve space for arguments and align frame before entering C++ world.
   // NativeArguments are passed in registers.
@@ -88,7 +84,7 @@
   __ sll(A2, S4, 2);
   __ addu(A2, FP, A2);  // Compute argv.
   // Set argv in NativeArguments.
-  __ addiu(A2, A2, Immediate(exitframe_last_param_slot_from_fp * kWordSize));
+  __ addiu(A2, A2, Immediate(kParamEndSlotFromFp * kWordSize));
 
 
   // Call runtime or redirection via simulator.
@@ -102,9 +98,9 @@
   __ delay_slot()->addiu(A3, A2, Immediate(kWordSize));
   __ Comment("CallToRuntimeStub return");
 
-  // Mark that the isolate is executing Dart code.
+  // Mark that the thread is executing Dart code.
   __ LoadImmediate(A2, VMTag::kDartTagId);
-  __ sw(A2, Address(S6, Isolate::vm_tag_offset()));
+  __ sw(A2, Assembler::VMTagAddress());
 
   // Reset exit frame information in Isolate structure.
   __ sw(ZR, Address(THR, Thread::top_exit_frame_info_offset()));
@@ -148,9 +144,6 @@
   __ Comment("CallNativeCFunctionStub");
   __ EnterStubFrame();
 
-  COMPILE_ASSERT((kAbiPreservedCpuRegs & (1 << S6)) != 0);
-  __ LoadIsolate(S6);
-
   // Save exit frame information to enable stack walking as we are about
   // to transition to native code.
   __ sw(FP, Address(THR, Thread::top_exit_frame_info_offset()));
@@ -158,15 +151,15 @@
 #if defined(DEBUG)
   { Label ok;
     // Check that we are always entering from Dart code.
-    __ lw(T0, Address(S6, Isolate::vm_tag_offset()));
+    __ lw(T0, Assembler::VMTagAddress());
     __ BranchEqual(T0, Immediate(VMTag::kDartTagId), &ok);
     __ Stop("Not coming from Dart code.");
     __ Bind(&ok);
   }
 #endif
 
-  // Mark that the isolate is executing Native code.
-  __ sw(T5, Address(S6, Isolate::vm_tag_offset()));
+  // Mark that the thread is executing native code.
+  __ sw(T5, Assembler::VMTagAddress());
 
   // Initialize NativeArguments structure and call native function.
   // Registers A0, A1, A2, and A3 are used.
@@ -184,7 +177,8 @@
   // Set argv in NativeArguments: A2 already contains argv.
 
   ASSERT(retval_offset == 3 * kWordSize);
-  __ addiu(A3, FP, Immediate(3 * kWordSize));  // Set retval in NativeArgs.
+  // Set retval in NativeArgs.
+  __ addiu(A3, FP, Immediate(kCallerSpSlotFromFp * kWordSize));
 
   // Passing the structure by value as in runtime calls would require changing
   // Dart API for native functions.
@@ -199,21 +193,15 @@
 
   __ mov(A1, T5);  // Pass the function entrypoint.
   __ ReserveAlignedFrameSpace(2 * kWordSize);  // Just passing A0, A1.
+
   // Call native wrapper function or redirection via simulator.
-#if defined(USING_SIMULATOR)
-  uword entry = reinterpret_cast<uword>(NativeEntry::NativeCallWrapper);
-  entry = Simulator::RedirectExternalReference(
-      entry, Simulator::kNativeCall, NativeEntry::kNumCallWrapperArguments);
-  __ LoadImmediate(T9, entry);
+  __ lw(T9, Address(THR, Thread::native_call_wrapper_entry_point_offset()));
   __ jalr(T9);
-#else
-  __ BranchLink(&NativeEntry::NativeCallWrapperLabel());
-#endif
   __ Comment("CallNativeCFunctionStub return");
 
-  // Mark that the isolate is executing Dart code.
+  // Mark that the thread is executing Dart code.
   __ LoadImmediate(A2, VMTag::kDartTagId);
-  __ sw(A2, Address(S6, Isolate::vm_tag_offset()));
+  __ sw(A2, Assembler::VMTagAddress());
 
   // Reset exit frame information in Isolate structure.
   __ sw(ZR, Address(THR, Thread::top_exit_frame_info_offset()));
@@ -238,9 +226,6 @@
   __ Comment("CallNativeCFunctionStub");
   __ EnterStubFrame();
 
-  COMPILE_ASSERT((kAbiPreservedCpuRegs & (1 << S6)) != 0);
-  __ LoadIsolate(S6);
-
   // Save exit frame information to enable stack walking as we are about
   // to transition to native code.
   __ sw(FP, Address(THR, Thread::top_exit_frame_info_offset()));
@@ -248,15 +233,15 @@
 #if defined(DEBUG)
   { Label ok;
     // Check that we are always entering from Dart code.
-    __ lw(T0, Address(S6, Isolate::vm_tag_offset()));
+    __ lw(T0, Assembler::VMTagAddress());
     __ BranchEqual(T0, Immediate(VMTag::kDartTagId), &ok);
     __ Stop("Not coming from Dart code.");
     __ Bind(&ok);
   }
 #endif
 
-  // Mark that the isolate is executing Native code.
-  __ sw(T5, Address(S6, Isolate::vm_tag_offset()));
+  // Mark that the thread is executing native code.
+  __ sw(T5, Assembler::VMTagAddress());
 
   // Initialize NativeArguments structure and call native function.
   // Registers A0, A1, A2, and A3 are used.
@@ -274,7 +259,8 @@
   // Set argv in NativeArguments: A2 already contains argv.
 
   ASSERT(retval_offset == 3 * kWordSize);
-  __ addiu(A3, FP, Immediate(3 * kWordSize));  // Set retval in NativeArgs.
+  // Set retval in NativeArgs.
+  __ addiu(A3, FP, Immediate(kCallerSpSlotFromFp * kWordSize));
 
   // Passing the structure by value as in runtime calls would require changing
   // Dart API for native functions.
@@ -296,9 +282,9 @@
   __ jalr(T9);
   __ Comment("CallNativeCFunctionStub return");
 
-  // Mark that the isolate is executing Dart code.
+  // Mark that the thread is executing Dart code.
   __ LoadImmediate(A2, VMTag::kDartTagId);
-  __ sw(A2, Address(S6, Isolate::vm_tag_offset()));
+  __ sw(A2, Assembler::VMTagAddress());
 
   // Reset exit frame information in Isolate structure.
   __ sw(ZR, Address(THR, Thread::top_exit_frame_info_offset()));
@@ -316,19 +302,18 @@
 
   __ addiu(SP, SP, Immediate(-2 * kWordSize));
   __ sw(S4, Address(SP, 1 * kWordSize));
-  __ LoadImmediate(TMP, reinterpret_cast<intptr_t>(Object::null()));
+  __ LoadObject(TMP, Object::null_object());
   __ sw(TMP, Address(SP, 0 * kWordSize));
 
   __ CallRuntime(kPatchStaticCallRuntimeEntry, 0);
   __ Comment("CallStaticFunctionStub return");
 
   // Get Code object result and restore arguments descriptor array.
-  __ lw(T0, Address(SP, 0 * kWordSize));
+  __ lw(CODE_REG, Address(SP, 0 * kWordSize));
   __ lw(S4, Address(SP, 1 * kWordSize));
   __ addiu(SP, SP, Immediate(2 * kWordSize));
 
-  __ lw(T0, FieldAddress(T0, Code::instructions_offset()));
-  __ AddImmediate(T0, Instructions::HeaderSize() - kHeapObjectTag);
+  __ lw(T0, FieldAddress(CODE_REG, Code::entry_point_offset()));
 
   // Remove the stub frame as we are about to jump to the dart function.
   __ LeaveStubFrameAndReturn(T0);
@@ -339,24 +324,26 @@
 // (invalid because its function was optimized or deoptimized).
 // S4: arguments descriptor array.
 void StubCode::GenerateFixCallersTargetStub(Assembler* assembler) {
+  // Load code pointer to this stub from the thread:
+  // The one that is passed in, is not correct - it points to the code object
+  // that needs to be replaced.
+  __ lw(CODE_REG, Address(THR, Thread::fix_callers_target_code_offset()));
   // Create a stub frame as we are pushing some objects on the stack before
   // calling into the runtime.
-  __ Comment("FixCallersTarget");
   __ EnterStubFrame();
   // Setup space on stack for return value and preserve arguments descriptor.
   __ addiu(SP, SP, Immediate(-2 * kWordSize));
   __ sw(S4, Address(SP, 1 * kWordSize));
-  __ LoadImmediate(TMP, reinterpret_cast<intptr_t>(Object::null()));
+  __ LoadObject(TMP, Object::null_object());
   __ sw(TMP, Address(SP, 0 * kWordSize));
   __ CallRuntime(kFixCallersTargetRuntimeEntry, 0);
   // Get Code object result and restore arguments descriptor array.
-  __ lw(T0, Address(SP, 0 * kWordSize));
+  __ lw(CODE_REG, Address(SP, 0 * kWordSize));
   __ lw(S4, Address(SP, 1 * kWordSize));
   __ addiu(SP, SP, Immediate(2 * kWordSize));
 
   // Jump to the dart function.
-  __ lw(T0, FieldAddress(T0, Code::instructions_offset()));
-  __ AddImmediate(T0, T0, Instructions::HeaderSize() - kHeapObjectTag);
+  __ lw(T0, FieldAddress(CODE_REG, Code::entry_point_offset()));
 
   // Remove the stub frame.
   __ LeaveStubFrameAndReturn(T0);
@@ -366,20 +353,22 @@
 // Called from object allocate instruction when the allocation stub has been
 // disabled.
 void StubCode::GenerateFixAllocationStubTargetStub(Assembler* assembler) {
-  __ Comment("FixAllocationStubTarget");
+  // Load code pointer to this stub from the thread:
+  // The one that is passed in, is not correct - it points to the code object
+  // that needs to be replaced.
+  __ lw(CODE_REG, Address(THR, Thread::fix_allocation_stub_code_offset()));
   __ EnterStubFrame();
   // Setup space on stack for return value.
   __ addiu(SP, SP, Immediate(-1 * kWordSize));
-  __ LoadImmediate(TMP, reinterpret_cast<intptr_t>(Object::null()));
+  __ LoadObject(TMP, Object::null_object());
   __ sw(TMP, Address(SP, 0 * kWordSize));
   __ CallRuntime(kFixAllocationStubTargetRuntimeEntry, 0);
   // Get Code object result.
-  __ lw(T0, Address(SP, 0 * kWordSize));
+  __ lw(CODE_REG, Address(SP, 0 * kWordSize));
   __ addiu(SP, SP, Immediate(1 * kWordSize));
 
   // Jump to the dart function.
-  __ lw(T0, FieldAddress(T0, Code::instructions_offset()));
-  __ AddImmediate(T0, T0, Instructions::HeaderSize() - kHeapObjectTag);
+  __ lw(T0, FieldAddress(CODE_REG, Code::entry_point_offset()));
 
   // Remove the stub frame.
   __ LeaveStubFrameAndReturn(T0);
@@ -392,7 +381,7 @@
 static void PushArgumentsArray(Assembler* assembler) {
   __ Comment("PushArgumentsArray");
   // Allocate array to store arguments of caller.
-  __ LoadImmediate(A0, reinterpret_cast<intptr_t>(Object::null()));
+  __ LoadObject(A0, Object::null_object());
   // A0: Null element type for raw Array.
   // A1: Smi-tagged argument count, may be zero.
   __ BranchLink(*StubCode::AllocateArray_entry());
@@ -421,13 +410,6 @@
 }
 
 
-DECLARE_LEAF_RUNTIME_ENTRY(intptr_t, DeoptimizeCopyFrame,
-                           intptr_t deopt_reason,
-                           uword saved_registers_address);
-
-DECLARE_LEAF_RUNTIME_ENTRY(void, DeoptimizeFillFrame, uword last_fp);
-
-
 // Used by eager and lazy deoptimization. Preserve result in V0 if necessary.
 // This stub translates optimized frame into unoptimized frame. The optimized
 // frame can contain values in registers and on stack, the unoptimized
@@ -443,32 +425,26 @@
 //   +------------------+
 //   | Saved PP         | <- TOS
 //   +------------------+
+//   | Saved CODE_REG   |
+//   +------------------+
 //   | Saved FP         | <- FP of stub
 //   +------------------+
 //   | Saved LR         |  (deoptimization point)
 //   +------------------+
-//   | PC marker        |
+//   | Saved CODE_REG   |
 //   +------------------+
 //   | ...              | <- SP of optimized frame
 //
 // Parts of the code cannot GC, part of the code can GC.
 static void GenerateDeoptimizationSequence(Assembler* assembler,
-                                           bool preserve_result) {
+                                           DeoptStubKind kind) {
   const intptr_t kPushedRegistersSize =
-      kNumberOfCpuRegisters * kWordSize +
-      4 * kWordSize +  // PP, FP, RA, PC marker.
-      kNumberOfFRegisters * kWordSize;
+      kNumberOfCpuRegisters * kWordSize + kNumberOfFRegisters * kWordSize;
 
   __ SetPrologueOffset();
   __ Comment("GenerateDeoptimizationSequence");
-  // DeoptimizeCopyFrame 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.
-  __ addiu(SP, SP, Immediate(-kPushedRegistersSize * kWordSize));
-  __ sw(ZR, Address(SP, kPushedRegistersSize - 1 * kWordSize));
-  __ sw(RA, Address(SP, kPushedRegistersSize - 2 * kWordSize));
-  __ sw(FP, Address(SP, kPushedRegistersSize - 3 * kWordSize));
-  __ sw(PP, Address(SP, kPushedRegistersSize - 4 * kWordSize));
-  __ addiu(FP, SP, Immediate(kPushedRegistersSize - 3 * kWordSize));
+  // DeoptimizeCopyFrame expects a Dart frame.
+  __ EnterStubFrame(kPushedRegistersSize);
 
   // The code in this frame may not cause GC. kDeoptimizeCopyFrameRuntimeEntry
   // and kDeoptimizeFillFrameRuntimeEntry are leaf runtime calls.
@@ -479,41 +455,44 @@
   // Push registers in their enumeration order: lowest register number at
   // lowest address.
   for (int i = 0; i < kNumberOfCpuRegisters; i++) {
-    const int slot = 4 + kNumberOfCpuRegisters - i;
+    const int slot = kNumberOfCpuRegisters - i;
     Register reg = static_cast<Register>(i);
-    __ sw(reg, Address(SP, kPushedRegistersSize - slot * kWordSize));
+    if (reg == CODE_REG) {
+      // Save the original value of CODE_REG pushed before invoking this stub
+      // instead of the value used to call this stub.
+      COMPILE_ASSERT(TMP < CODE_REG);  // Assert TMP is pushed first.
+      __ lw(TMP, Address(FP, kCallerSpSlotFromFp * kWordSize));
+      __ sw(TMP, Address(SP, kPushedRegistersSize - slot * kWordSize));
+    } else {
+      __ sw(reg, Address(SP, kPushedRegistersSize - slot * kWordSize));
+    }
   }
   for (int i = 0; i < kNumberOfFRegisters; i++) {
     // These go below the CPU registers.
-    const int slot = 4 + kNumberOfCpuRegisters + kNumberOfFRegisters - i;
+    const int slot = kNumberOfCpuRegisters + kNumberOfFRegisters - i;
     FRegister reg = static_cast<FRegister>(i);
     __ swc1(reg, Address(SP, kPushedRegistersSize - slot * kWordSize));
   }
 
   __ mov(A0, SP);  // Pass address of saved registers block.
+  __ LoadImmediate(A1, (kind == kLazyDeopt) ? 1 : 0);
   __ ReserveAlignedFrameSpace(1 * kWordSize);
-  __ CallRuntime(kDeoptimizeCopyFrameRuntimeEntry, 1);
+  __ CallRuntime(kDeoptimizeCopyFrameRuntimeEntry, 2);
   // Result (V0) is stack-size (FP - SP) in bytes, incl. the return address.
 
+  const bool preserve_result = (kind == kLazyDeopt);
   if (preserve_result) {
     // Restore result into T1 temporarily.
     __ lw(T1, Address(FP, saved_result_slot_from_fp * kWordSize));
   }
 
-  __ addiu(SP, FP, Immediate(-kWordSize));
-  __ lw(RA, Address(SP, 2 * kWordSize));
-  __ lw(FP, Address(SP, 1 * kWordSize));
-  __ lw(PP, Address(SP, 0 * kWordSize));
+  __ RestoreCodePointer();
+  __ LeaveDartFrame();
   __ subu(SP, FP, V0);
 
   // 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.
-  __ addiu(SP, SP, Immediate(-4 * kWordSize));
-  __ sw(ZR, Address(SP, 3 * kWordSize));
-  __ sw(RA, Address(SP, 2 * kWordSize));
-  __ sw(FP, Address(SP, 1 * kWordSize));
-  __ sw(PP, Address(SP, 0 * kWordSize));
-  __ addiu(FP, SP, Immediate(kWordSize));
+  __ EnterStubFrame();
 
   __ mov(A0, FP);  // Get last FP address.
   if (preserve_result) {
@@ -526,11 +505,8 @@
     __ lw(T1, Address(FP, kFirstLocalSlotFromFp * kWordSize));
   }
   // Code above cannot cause GC.
-  __ addiu(SP, FP, Immediate(-kWordSize));
-  __ lw(RA, Address(SP, 2 * kWordSize));
-  __ lw(FP, Address(SP, 1 * kWordSize));
-  __ lw(PP, Address(SP, 0 * kWordSize));
-  __ addiu(SP, SP, Immediate(4 * kWordSize));
+  __ RestoreCodePointer();
+  __ LeaveStubFrame();
 
   // Frame is fully rewritten at this point and it is safe to perform a GC.
   // Materialize any objects that were deferred by FillFrame because they
@@ -559,13 +535,16 @@
 void StubCode::GenerateDeoptimizeLazyStub(Assembler* assembler) {
   // Correct return address to point just after the call that is being
   // deoptimized.
-  __ AddImmediate(RA, -CallPattern::kFixedLengthInBytes);
-  GenerateDeoptimizationSequence(assembler, true);  // Preserve V0.
+  __ AddImmediate(RA, -CallPattern::kDeoptCallLengthInBytes);
+  // Push zap value instead of CODE_REG for lazy deopt.
+  __ LoadImmediate(TMP, 0xf1f1f1f1);
+  __ Push(TMP);
+  GenerateDeoptimizationSequence(assembler, kLazyDeopt);
 }
 
 
 void StubCode::GenerateDeoptimizeStub(Assembler* assembler) {
-  GenerateDeoptimizationSequence(assembler, false);  // Don't preserve V0.
+  GenerateDeoptimizationSequence(assembler, kEagerDeopt);
 }
 
 
@@ -588,7 +567,7 @@
   // Push arguments descriptor array.
   // Push original arguments array.
   __ addiu(SP, SP, Immediate(-4 * kWordSize));
-  __ LoadImmediate(TMP, reinterpret_cast<intptr_t>(Object::null()));
+  __ LoadObject(TMP, Object::null_object());
   __ sw(TMP, Address(SP, 3 * kWordSize));
   __ sw(T6, Address(SP, 2 * kWordSize));
   __ sw(S5, Address(SP, 1 * kWordSize));
@@ -622,7 +601,7 @@
   // Push the receiver.
   // Push IC data object.
   // Push arguments descriptor array.
-  __ LoadImmediate(TMP, reinterpret_cast<intptr_t>(Object::null()));
+  __ LoadObject(TMP, Object::null_object());
   __ sw(TMP, Address(SP, 3 * kWordSize));
   __ sw(T6, Address(SP, 2 * kWordSize));
   __ sw(S5, Address(SP, 1 * kWordSize));
@@ -635,6 +614,7 @@
   __ lw(S5, Address(SP, 5 * kWordSize));  // Restore IC data.
   __ addiu(SP, SP, Immediate(6 * kWordSize));
 
+  __ RestoreCodePointer();
   __ LeaveStubFrame();
 
   if (!FLAG_lazy_dispatchers) {
@@ -643,8 +623,8 @@
     __ Bind(&call_target_function);
   }
 
-  __ lw(T2, FieldAddress(T0, Function::instructions_offset()));
-  __ AddImmediate(T2, Instructions::HeaderSize() - kHeapObjectTag);
+  __ lw(CODE_REG, FieldAddress(T0, Function::code_offset()));
+  __ lw(T2, FieldAddress(T0, Function::entry_point_offset()));
   __ jr(T2);
 }
 
@@ -752,7 +732,7 @@
                               FieldAddress(T0, Array::length_offset()),
                               A1);
 
-  __ LoadImmediate(T7, reinterpret_cast<int32_t>(Object::null()));
+  __ LoadObject(T7, Object::null_object());
   // Initialize all array elements to raw_null.
   // T0: new object start as a tagged pointer.
   // T1: new object end address.
@@ -782,7 +762,7 @@
   // Setup space on stack for return value.
   // Push array length as Smi and element type.
   __ addiu(SP, SP, Immediate(-3 * kWordSize));
-  __ LoadImmediate(TMP, reinterpret_cast<intptr_t>(Object::null()));
+  __ LoadObject(TMP, Object::null_object());
   __ sw(TMP, Address(SP, 2 * kWordSize));
   __ sw(A1, Address(SP, 1 * kWordSize));
   __ sw(A0, Address(SP, 0 * kWordSize));
@@ -801,7 +781,7 @@
 // Called when invoking Dart code from C++ (VM code).
 // Input parameters:
 //   RA : points to return address.
-//   A0 : entrypoint of the Dart function to call.
+//   A0 : code object of the Dart function to call.
 //   A1 : arguments descriptor array.
 //   A2 : arguments array.
 //   A3 : current thread.
@@ -810,6 +790,10 @@
   __ Comment("InvokeDartCodeStub");
   __ EnterFrame();
 
+  // Push code object to PC marker slot.
+  __ lw(TMP, Address(A3, Thread::invoke_dart_code_stub_offset()));
+  __ Push(TMP);
+
   // Save new context and C++ ABI callee-saved registers.
 
   // The saved vm tag, top resource, and top exit frame info.
@@ -834,24 +818,22 @@
     __ swc1(r, Address(SP, slot * kWordSize));
   }
 
-  // We now load the pool pointer(PP) as we are about to invoke dart code and we
-  // could potentially invoke some intrinsic functions which need the PP to be
-  // set up.
-  __ LoadPoolPointer();
+  // We now load the pool pointer(PP) with a GC safe value as we are about
+  // to invoke dart code.
+  __ LoadImmediate(PP, 0);
 
   // Set up THR, which caches the current thread in Dart code.
   if (THR != A3) {
     __ mov(THR, A3);
   }
-  __ LoadIsolate(T2);
 
   // Save the current VMTag on the stack.
-  __ lw(T1, Address(T2, Isolate::vm_tag_offset()));
+  __ lw(T1, Assembler::VMTagAddress());
   __ sw(T1, Address(SP, 2 * kWordSize));
 
-  // Mark that the isolate is executing Dart code.
+  // Mark that the thread is executing Dart code.
   __ LoadImmediate(T0, VMTag::kDartTagId);
-  __ sw(T0, Address(T2, Isolate::vm_tag_offset()));
+  __ sw(T0, Assembler::VMTagAddress());
 
   // Save top resource and top exit frame info. Use T0 as a temporary register.
   // StackFrameIterator reads the top exit frame info saved in this frame.
@@ -861,7 +843,7 @@
   __ lw(T0, Address(THR, Thread::top_exit_frame_info_offset()));
   __ sw(ZR, Address(THR, Thread::top_exit_frame_info_offset()));
   // kExitLinkSlotFromEntryFp must be kept in sync with the code below.
-  ASSERT(kExitLinkSlotFromEntryFp == -23);
+  ASSERT(kExitLinkSlotFromEntryFp == -24);
   __ sw(T0, Address(SP, 0 * kWordSize));
 
   // After the call, The stack pointer is restored to this location.
@@ -896,17 +878,18 @@
   // Call the Dart code entrypoint.
   // We are calling into Dart code, here, so there is no need to call through
   // T9 to match the ABI.
+  __ lw(CODE_REG, Address(A0, VMHandles::kOffsetOfRawPtrInHandle));
+  __ lw(A0, FieldAddress(CODE_REG, Code::entry_point_offset()));
   __ jalr(A0);  // S4 is the arguments descriptor array.
   __ Comment("InvokeDartCodeStub return");
 
   // Get rid of arguments pushed on the stack.
   __ AddImmediate(SP, FP, kExitLinkSlotFromEntryFp * kWordSize);
 
-  __ LoadIsolate(S6);
 
   // Restore the current VMTag from the stack.
   __ lw(T1, Address(SP, 2 * kWordSize));
-  __ sw(T1, Address(S6, Isolate::vm_tag_offset()));
+  __ sw(T1, Assembler::VMTagAddress());
 
   // Restore the saved top resource and top exit frame info back into the
   // Isolate structure. Uses T0 as a temporary register for this.
@@ -1016,7 +999,7 @@
     // T1: number of context variables as integer value (not object).
     __ sw(T1, FieldAddress(V0, Context::num_variables_offset()));
 
-    __ LoadImmediate(T7, reinterpret_cast<intptr_t>(Object::null()));
+    __ LoadObject(T7, Object::null_object());
 
     // Initialize the context variables.
     // V0: new object.
@@ -1046,7 +1029,7 @@
   // Setup space on stack for return value.
   __ SmiTag(T1);
   __ addiu(SP, SP, Immediate(-2 * kWordSize));
-  __ LoadImmediate(TMP, reinterpret_cast<intptr_t>(Object::null()));
+  __ LoadObject(TMP, Object::null_object());
   __ sw(TMP, Address(SP, 1 * kWordSize));  // Store null.
   __ sw(T1, Address(SP, 0 * kWordSize));
   __ CallRuntime(kAllocateContextRuntimeEntry, 1);  // Allocate context.
@@ -1059,9 +1042,6 @@
 }
 
 
-DECLARE_LEAF_RUNTIME_ENTRY(void, StoreBufferBlockProcess, Isolate* isolate);
-
-
 // Helper stub to implement Assembler::StoreIntoObject.
 // Input parameters:
 //   T0: Address (i.e. object) being stored into.
@@ -1132,13 +1112,9 @@
 // Input parameters:
 //   RA : return address.
 //   SP + 0 : type arguments object (only if class is parameterized).
-// 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,
-    uword* entry_patch_offset, uword* patch_code_pc_offset) {
+void StubCode::GenerateAllocationStubForClass(Assembler* assembler,
+                                              const Class& cls) {
   __ Comment("AllocationStubForClass");
-  *entry_patch_offset = assembler->CodeSize();
   // The generated code is different if the class is parameterized.
   const bool is_cls_parameterized = cls.NumTypeArguments() > 0;
   ASSERT(!is_cls_parameterized ||
@@ -1191,7 +1167,7 @@
     __ LoadImmediate(T0, tags);
     __ sw(T0, Address(T2, Instance::tags_offset()));
 
-    __ LoadImmediate(T7, reinterpret_cast<intptr_t>(Object::null()));
+    __ LoadObject(T7, Object::null_object());
 
     // Initialize the remaining words of the object.
     // T2: new object start.
@@ -1242,7 +1218,7 @@
 
   __ addiu(SP, SP, Immediate(-3 * kWordSize));
   // Space on stack for return value.
-  __ LoadImmediate(T7, reinterpret_cast<intptr_t>(Object::null()));
+  __ LoadObject(T7, Object::null_object());
   __ sw(T7, Address(SP, 2 * kWordSize));
   __ sw(TMP, Address(SP, 1 * kWordSize));  // Class of object to be allocated.
 
@@ -1261,8 +1237,6 @@
   // V0: new object
   // Restore the frame pointer and return.
   __ LeaveStubFrameAndReturn(RA);
-  *patch_code_pc_offset = assembler->CodeSize();
-  __ BranchPatchable(*StubCode::FixAllocationStubTarget_entry());
 }
 
 
@@ -1287,7 +1261,7 @@
   // Push arguments descriptor array.
   const intptr_t kNumArgs = 3;
   __ addiu(SP, SP, Immediate(-kNumArgs * kWordSize));
-  __ LoadImmediate(TMP, reinterpret_cast<intptr_t>(Object::null()));
+  __ LoadObject(TMP, Object::null_object());
   __ sw(TMP, Address(SP, 2 * kWordSize));
   __ sw(T6, Address(SP, 1 * kWordSize));
   __ sw(S4, Address(SP, 0 * kWordSize));
@@ -1563,7 +1537,7 @@
   __ addiu(SP, SP, Immediate(-num_slots * kWordSize));
   __ sw(S5, Address(SP, (num_slots - 1) * kWordSize));
   __ sw(S4, Address(SP, (num_slots - 2) * kWordSize));
-  __ LoadImmediate(TMP, reinterpret_cast<intptr_t>(Object::null()));
+  __ LoadObject(TMP, Object::null_object());
   __ sw(TMP, Address(SP, (num_slots - 3) * kWordSize));
   // Push call arguments.
   for (intptr_t i = 0; i < num_args; i++) {
@@ -1582,6 +1556,9 @@
   // Remove the call arguments pushed earlier, including the IC data object
   // and the arguments descriptor array.
   __ addiu(SP, SP, Immediate(num_slots * kWordSize));
+  if (range_collection_mode == kCollectRanges) {
+    __ RestoreCodePointer();
+  }
   __ LeaveStubFrame();
 
   Label call_target_function;
@@ -1614,8 +1591,7 @@
   // T0 <- T3: Target function.
   __ mov(T0, T3);
   Label is_compiled;
-  __ lw(T4, FieldAddress(T0, Function::instructions_offset()));
-  __ AddImmediate(T4, Instructions::HeaderSize() - kHeapObjectTag);
+  __ lw(T4, FieldAddress(T0, Function::entry_point_offset()));
   if (range_collection_mode == kCollectRanges) {
     const intptr_t frame_size = num_args + 2;
     __ lw(T3, Address(SP, 0 * kWordSize));
@@ -1630,6 +1606,7 @@
     if (num_args == 2) {
       __ sw(T1, Address(SP, 1 * kWordSize));
     }
+    __ lw(CODE_REG, FieldAddress(T0, Function::code_offset()));
     __ jalr(T4);
     __ lw(S5, Address(SP, (frame_size - 2) * kWordSize));
     __ lw(RA, Address(SP, (frame_size - 1) * kWordSize));
@@ -1637,9 +1614,11 @@
     __ UpdateRangeFeedback(V0, 2, S5, T1, &done);
     __ Bind(&done);
     __ addiu(SP, SP, Immediate(frame_size * kWordSize));
+    __ RestoreCodePointer();
     __ LeaveStubFrame();
     __ Ret();
   } else {
+    __ lw(CODE_REG, FieldAddress(T0, Function::code_offset()));
     __ jr(T4);
   }
 
@@ -1654,6 +1633,7 @@
     __ lw(RA, Address(SP, 0 * kWordSize));
     __ lw(S5, Address(SP, 1 * kWordSize));
     __ addiu(SP, SP, Immediate(2 * kWordSize));
+    __ RestoreCodePointer();
     __ LeaveStubFrame();
     __ b(&done_stepping);
   }
@@ -1799,10 +1779,8 @@
 
   // Get function and call it, if possible.
   __ lw(T0, Address(T0, target_offset));
-  __ lw(T4, FieldAddress(T0, Function::instructions_offset()));
-
-  // T4: target instructions.
-  __ AddImmediate(T4, Instructions::HeaderSize() - kHeapObjectTag);
+  __ lw(CODE_REG, FieldAddress(T0, Function::code_offset()));
+  __ lw(T4, FieldAddress(T0, Function::entry_point_offset()));
   __ jr(T4);
 
   // Call single step callback in debugger.
@@ -1816,6 +1794,7 @@
     __ lw(RA, Address(SP, 0 * kWordSize));
     __ lw(S5, Address(SP, 1 * kWordSize));
     __ addiu(SP, SP, Immediate(2 * kWordSize));
+    __ RestoreCodePointer();
     __ LeaveStubFrame();
     __ b(&done_stepping);
   }
@@ -1855,8 +1834,8 @@
   __ addiu(SP, SP, Immediate(3 * kWordSize));
   __ LeaveStubFrame();
 
-  __ lw(T2, FieldAddress(T0, Function::instructions_offset()));
-  __ AddImmediate(T2, Instructions::HeaderSize() - kHeapObjectTag);
+  __ lw(CODE_REG, FieldAddress(T0, Function::code_offset()));
+  __ lw(T2, FieldAddress(T0, Function::entry_point_offset()));
   __ jr(T2);
 }
 
@@ -1867,15 +1846,16 @@
   __ EnterStubFrame();
   __ addiu(SP, SP, Immediate(-2 * kWordSize));
   __ sw(S5, Address(SP, 1 * kWordSize));
-  __ LoadImmediate(TMP, reinterpret_cast<intptr_t>(Object::null()));
+  __ LoadObject(TMP, Object::null_object());
   __ sw(TMP, Address(SP, 0 * kWordSize));
 
   __ CallRuntime(kBreakpointRuntimeHandlerRuntimeEntry, 0);
 
   __ lw(S5, Address(SP, 1 * kWordSize));
-  __ lw(T0, Address(SP, 0 * kWordSize));
+  __ lw(CODE_REG, Address(SP, 0 * kWordSize));
   __ addiu(SP, SP, Immediate(2 * kWordSize));
   __ LeaveStubFrame();
+  __ lw(T0, FieldAddress(CODE_REG, Code::entry_point_offset()));
   __ jr(T0);
 }
 
@@ -1884,14 +1864,15 @@
   __ Comment("RuntimeCallBreakpoint stub");
   __ EnterStubFrame();
   __ addiu(SP, SP, Immediate(-1 * kWordSize));
-  __ LoadImmediate(TMP, reinterpret_cast<intptr_t>(Object::null()));
+  __ LoadObject(TMP, Object::null_object());
   __ sw(TMP, Address(SP, 0 * kWordSize));
 
   __ CallRuntime(kBreakpointRuntimeHandlerRuntimeEntry, 0);
 
-  __ lw(T0, Address(SP, 0 * kWordSize));
+  __ lw(CODE_REG, Address(SP, 0 * kWordSize));
   __ addiu(SP, SP, Immediate(3 * kWordSize));
   __ LeaveStubFrame();
+  __ lw(T0, FieldAddress(CODE_REG, Code::entry_point_offset()));
   __ jr(T0);
 }
 
@@ -1935,7 +1916,7 @@
     __ LoadClass(T0, A0);
     // Compute instance type arguments into T1.
     Label has_no_type_arguments;
-    __ LoadImmediate(T1, reinterpret_cast<intptr_t>(Object::null()));
+    __ LoadObject(T1, Object::null_object());
     __ lw(T2, FieldAddress(T0,
         Class::type_arguments_field_offset_in_words_offset()));
     __ BranchEqual(
@@ -1954,7 +1935,7 @@
   __ lw(T2, FieldAddress(A2, SubtypeTestCache::cache_offset()));
   __ AddImmediate(T2, Array::data_offset() - kHeapObjectTag);
 
-  __ LoadImmediate(T7, reinterpret_cast<intptr_t>(Object::null()));
+  __ LoadObject(T7, Object::null_object());
 
   Label loop, found, not_found, next_iteration;
   // T0: instance class id.
@@ -2056,10 +2037,9 @@
   __ lw(V1, Address(SP, 4 * kWordSize));  // StackTrace object.
   __ mov(FP, A2);  // Frame_pointer.
   __ lw(THR, Address(SP, 5 * kWordSize));  // Thread.
-  __ LoadIsolate(A3);
   // Set tag.
   __ LoadImmediate(A2, VMTag::kDartTagId);
-  __ sw(A2, Address(A3, Isolate::vm_tag_offset()));
+  __ sw(A2, Assembler::VMTagAddress());
   // Clear top exit frame.
   __ sw(ZR, Address(THR, Thread::top_exit_frame_info_offset()));
 
@@ -2077,28 +2057,21 @@
   __ addiu(SP, SP, Immediate(-3 * kWordSize));
   __ sw(S4, Address(SP, 2 * kWordSize));
   // Setup space on stack for return value.
-  __ LoadImmediate(TMP, reinterpret_cast<intptr_t>(Object::null()));
+  __ LoadObject(TMP, Object::null_object());
   __ sw(TMP, Address(SP, 1 * kWordSize));
   __ sw(T0, Address(SP, 0 * kWordSize));
   __ CallRuntime(kOptimizeInvokedFunctionRuntimeEntry, 1);
   __ Comment("OptimizeFunctionStub return");
-  __ lw(T0, Address(SP, 1 * kWordSize));  // Get Code object
+  __ lw(CODE_REG, Address(SP, 1 * kWordSize));  // Get Code object
   __ lw(S4, Address(SP, 2 * kWordSize));  // Restore argument descriptor.
   __ addiu(SP, SP, Immediate(3 * kWordSize));  // Discard argument.
 
-  __ lw(T0, FieldAddress(T0, Code::instructions_offset()));
-  __ AddImmediate(T0, Instructions::HeaderSize() - kHeapObjectTag);
+  __ lw(T0, FieldAddress(CODE_REG, Code::entry_point_offset()));
   __ LeaveStubFrameAndReturn(T0);
   __ break_(0);
 }
 
 
-DECLARE_LEAF_RUNTIME_ENTRY(intptr_t,
-                           BigintCompare,
-                           RawBigint* left,
-                           RawBigint* right);
-
-
 // Does identical check (object references are equal or not equal) with special
 // checks for boxed numbers.
 // Returns: CMPRES1 is zero if equal, non-zero otherwise.
@@ -2214,6 +2187,7 @@
     __ CallRuntime(kSingleStepHandlerRuntimeEntry, 0);
     __ lw(RA, Address(SP, 0 * kWordSize));
     __ addiu(SP, SP, Immediate(1 * kWordSize));
+    __ RestoreCodePointer();
     __ LeaveStubFrame();
     __ b(&done_stepping);
   }
@@ -2274,10 +2248,8 @@
   __ addu(T1, T2, T1);
   __ lw(T0, FieldAddress(T1, base + kWordSize));
 
-  __ lw(target, FieldAddress(T0, Function::instructions_offset()));
-  // TODO(srdjan): Evaluate performance impact of moving the instruction below
-  // to the call site, instead of having it here.
-  __ AddImmediate(target, Instructions::HeaderSize() - kHeapObjectTag);
+  __ lw(CODE_REG, FieldAddress(T0, Function::code_offset()));
+  __ lw(target, FieldAddress(T0, Function::entry_point_offset()));
 }
 
 
diff --git a/runtime/vm/stub_code_mips_test.cc b/runtime/vm/stub_code_mips_test.cc
index 7a87baf..512baaf 100644
--- a/runtime/vm/stub_code_mips_test.cc
+++ b/runtime/vm/stub_code_mips_test.cc
@@ -19,10 +19,6 @@
 
 namespace dart {
 
-DECLARE_RUNTIME_ENTRY(TestSmiSub);
-DECLARE_LEAF_RUNTIME_ENTRY(RawObject*, TestLeafSmiAdd, RawObject*, RawObject*);
-
-
 static Function* CreateFunction(const char* name) {
   const String& class_name = String::Handle(Symbols::New("ownerClass"));
   const Script& script = Script::Handle();
@@ -40,16 +36,15 @@
 
 // Test calls to stub code which calls into the runtime.
 static void GenerateCallToCallRuntimeStub(Assembler* assembler,
-                                          int value1, int value2) {
+                                          int length) {
   const int argc = 2;
-  const Smi& smi1 = Smi::ZoneHandle(Smi::New(value1));
-  const Smi& smi2 = Smi::ZoneHandle(Smi::New(value2));
+  const Smi& smi_length = Smi::ZoneHandle(Smi::New(length));
   __ EnterDartFrame(0);
   __ PushObject(Object::null_object());  // Push Null object for return value.
-  __ PushObject(smi1);  // Push argument 1 smi1.
-  __ PushObject(smi2);  // Push argument 2 smi2.
-  ASSERT(kTestSmiSubRuntimeEntry.argument_count() == argc);
-  __ CallRuntime(kTestSmiSubRuntimeEntry, argc);  // Call SmiSub runtime func.
+  __ PushObject(smi_length);             // Push argument 1: length.
+  __ PushObject(Object::null_object());  // Push argument 2: type arguments.
+  ASSERT(kAllocateArrayRuntimeEntry.argument_count() == argc);
+  __ CallRuntime(kAllocateArrayRuntimeEntry, argc);
   __ addiu(SP, SP, Immediate(argc * kWordSize));
   __ Pop(V0);  // Pop return value from return slot.
   __ LeaveDartFrameAndReturn();
@@ -59,31 +54,33 @@
 TEST_CASE(CallRuntimeStubCode) {
   extern const Function& RegisterFakeFunction(const char* name,
                                               const Code& code);
-  const int value1 = 10;
-  const int value2 = 20;
+  const int length = 10;
   const char* kName = "Test_CallRuntimeStubCode";
   Assembler _assembler_;
-  GenerateCallToCallRuntimeStub(&_assembler_, value1, value2);
+  GenerateCallToCallRuntimeStub(&_assembler_, length);
   const Code& code = Code::Handle(Code::FinalizeCode(
       *CreateFunction("Test_CallRuntimeStubCode"), &_assembler_));
   const Function& function = RegisterFakeFunction(kName, code);
-  Smi& result = Smi::Handle();
+  Array& result = Array::Handle();
   result ^= DartEntry::InvokeFunction(function, Object::empty_array());
-  EXPECT_EQ((value1 - value2), result.Value());
+  EXPECT_EQ(length, result.Length());
 }
 
 
 // Test calls to stub code which calls into a leaf runtime entry.
 static void GenerateCallToCallLeafRuntimeStub(Assembler* assembler,
-                                              int value1,
-                                              int value2) {
-  const Smi& smi1 = Smi::ZoneHandle(Smi::New(value1));
-  const Smi& smi2 = Smi::ZoneHandle(Smi::New(value2));
+                                              const char* value1,
+                                              const char* value2) {
+  const Bigint& bigint1 =
+      Bigint::ZoneHandle(Bigint::NewFromCString(value1, Heap::kOld));
+  const Bigint& bigint2 =
+      Bigint::ZoneHandle(Bigint::NewFromCString(value2, Heap::kOld));
   __ EnterDartFrame(0);
   __ ReserveAlignedFrameSpace(0);
-  __ LoadObject(A0, smi1);  // Set up argument 1 smi1.
-  __ LoadObject(A1, smi2);  // Set up argument 2 smi2.
-  __ CallRuntime(kTestLeafSmiAddRuntimeEntry, 2);  // Call SmiAdd runtime func.
+  __ LoadObject(A0, bigint1);  // Set up argument 1 bigint1.
+  __ LoadObject(A1, bigint2);  // Set up argument 2 bigint2.
+  __ CallRuntime(kBigintCompareRuntimeEntry, 2);
+  __ SmiTag(V0);
   __ LeaveDartFrameAndReturn();  // Return value is in V0.
 }
 
@@ -91,8 +88,8 @@
 TEST_CASE(CallLeafRuntimeStubCode) {
   extern const Function& RegisterFakeFunction(const char* name,
                                               const Code& code);
-  const int value1 = 10;
-  const int value2 = 20;
+  const char* value1 = "0xAAABBCCDDAABBCCDD";
+  const char* value2 = "0xAABBCCDDAABBCCDD";
   const char* kName = "Test_CallLeafRuntimeStubCode";
   Assembler _assembler_;
   GenerateCallToCallLeafRuntimeStub(&_assembler_, value1, value2);
@@ -101,7 +98,7 @@
   const Function& function = RegisterFakeFunction(kName, code);
   Smi& result = Smi::Handle();
   result ^= DartEntry::InvokeFunction(function, Object::empty_array());
-  EXPECT_EQ((value1 + value2), result.Value());
+  EXPECT_EQ(1, result.Value());
 }
 
 }  // namespace dart
diff --git a/runtime/vm/stub_code_x64.cc b/runtime/vm/stub_code_x64.cc
index 877d750..44d5f96 100644
--- a/runtime/vm/stub_code_x64.cc
+++ b/runtime/vm/stub_code_x64.cc
@@ -46,10 +46,6 @@
 
   __ EnterStubFrame();
 
-  COMPILE_ASSERT(
-      (CallingConventions::kCalleeSaveCpuRegisters & (1 << R12)) != 0);
-  __ LoadIsolate(R12);
-
   // Save exit frame information to enable stack walking as we are about
   // to transition to Dart VM C++ code.
   __ movq(Address(THR, Thread::top_exit_frame_info_offset()), RBP);
@@ -58,15 +54,15 @@
   { Label ok;
     // Check that we are always entering from Dart code.
     __ movq(RAX, Immediate(VMTag::kDartTagId));
-    __ cmpq(RAX, Address(R12, Isolate::vm_tag_offset()));
+    __ cmpq(RAX, Assembler::VMTagAddress());
     __ j(EQUAL, &ok, Assembler::kNearJump);
     __ Stop("Not coming from Dart code.");
     __ Bind(&ok);
   }
 #endif
 
-  // Mark that the isolate is executing VM code.
-  __ movq(Address(R12, Isolate::vm_tag_offset()), RBX);
+  // Mark that the thread is executing VM code.
+  __ movq(Assembler::VMTagAddress(), RBX);
 
   // Reserve space for arguments and align frame before entering C++ world.
   __ subq(RSP, Immediate(sizeof(NativeArguments)));
@@ -79,7 +75,8 @@
   // There are no runtime calls to closures, so we do not need to set the tag
   // bits kClosureFunctionBit and kInstanceFunctionBit in argc_tag_.
   __ movq(Address(RSP, argc_tag_offset), R10);  // Set argc in NativeArguments.
-  __ leaq(RAX, Address(RBP, R10, TIMES_8, 1 * kWordSize));  // Compute argv.
+  // 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, retval_offset), RAX);  // Set retval in NativeArguments.
@@ -89,9 +86,8 @@
 #endif
   __ CallCFunction(RBX);
 
-  // Mark that the isolate is executing Dart code.
-  __ movq(Address(R12, Isolate::vm_tag_offset()),
-          Immediate(VMTag::kDartTagId));
+  // Mark that the thread is executing Dart code.
+  __ movq(Assembler::VMTagAddress(), Immediate(VMTag::kDartTagId));
 
   // Reset exit frame information in Isolate structure.
   __ movq(Address(THR, Thread::top_exit_frame_info_offset()), Immediate(0));
@@ -143,10 +139,6 @@
 
   __ EnterStubFrame();
 
-  COMPILE_ASSERT(
-      (CallingConventions::kCalleeSaveCpuRegisters & (1 << R12)) != 0);
-  __ LoadIsolate(R12);
-
   // Save exit frame information to enable stack walking as we are about
   // to transition to native code.
   __ movq(Address(THR, Thread::top_exit_frame_info_offset()), RBP);
@@ -155,15 +147,15 @@
   { Label ok;
     // Check that we are always entering from Dart code.
     __ movq(R8, Immediate(VMTag::kDartTagId));
-    __ cmpq(R8, Address(R12, Isolate::vm_tag_offset()));
+    __ cmpq(R8, Assembler::VMTagAddress());
     __ j(EQUAL, &ok, Assembler::kNearJump);
     __ Stop("Not coming from Dart code.");
     __ Bind(&ok);
   }
 #endif
 
-  // Mark that the isolate is executing Native code.
-  __ movq(Address(R12, Isolate::vm_tag_offset()), RBX);
+  // Mark that the thread is executing native code.
+  __ movq(Assembler::VMTagAddress(), RBX);
 
   // Reserve space for the native arguments structure passed on the stack (the
   // outgoing pointer parameter to the native arguments structure is passed in
@@ -184,11 +176,12 @@
   __ movq(CallingConventions::kArg1Reg, RSP);
   // Pass pointer to function entrypoint.
   __ movq(CallingConventions::kArg2Reg, RBX);
-  __ CallCFunction(&NativeEntry::NativeCallWrapperLabel());
 
-  // Mark that the isolate is executing Dart code.
-  __ movq(Address(R12, Isolate::vm_tag_offset()),
-          Immediate(VMTag::kDartTagId));
+  __ movq(RAX, Address(THR, Thread::native_call_wrapper_entry_point_offset()));
+  __ CallCFunction(RAX);
+
+  // Mark that the thread is executing Dart code.
+  __ movq(Assembler::VMTagAddress(), Immediate(VMTag::kDartTagId));
 
   // Reset exit frame information in Isolate structure.
   __ movq(Address(THR, Thread::top_exit_frame_info_offset()), Immediate(0));
@@ -217,10 +210,6 @@
 
   __ EnterStubFrame();
 
-  COMPILE_ASSERT(
-      (CallingConventions::kCalleeSaveCpuRegisters & (1 << R12)) != 0);
-  __ LoadIsolate(R12);
-
   // Save exit frame information to enable stack walking as we are about
   // to transition to native code.
   __ movq(Address(THR, Thread::top_exit_frame_info_offset()), RBP);
@@ -229,15 +218,15 @@
   { Label ok;
     // Check that we are always entering from Dart code.
     __ movq(R8, Immediate(VMTag::kDartTagId));
-    __ cmpq(R8, Address(R12, Isolate::vm_tag_offset()));
+    __ cmpq(R8, Assembler::VMTagAddress());
     __ j(EQUAL, &ok, Assembler::kNearJump);
     __ Stop("Not coming from Dart code.");
     __ Bind(&ok);
   }
 #endif
 
-  // Mark that the isolate is executing Native code.
-  __ movq(Address(R12, Isolate::vm_tag_offset()), RBX);
+  // Mark that the thread is executing native code.
+  __ movq(Assembler::VMTagAddress(), RBX);
 
   // Reserve space for the native arguments structure passed on the stack (the
   // outgoing pointer parameter to the native arguments structure is passed in
@@ -258,9 +247,8 @@
   __ movq(CallingConventions::kArg1Reg, RSP);
   __ CallCFunction(RBX);
 
-  // Mark that the isolate is executing Dart code.
-  __ movq(Address(R12, Isolate::vm_tag_offset()),
-          Immediate(VMTag::kDartTagId));
+  // Mark that the thread is executing Dart code.
+  __ movq(Assembler::VMTagAddress(), Immediate(VMTag::kDartTagId));
 
   // Reset exit frame information in Isolate structure.
   __ movq(Address(THR, Thread::top_exit_frame_info_offset()), Immediate(0));
@@ -278,13 +266,12 @@
   // Setup space on stack for return value.
   __ PushObject(Object::null_object());
   __ CallRuntime(kPatchStaticCallRuntimeEntry, 0);
-  __ popq(RAX);  // Get Code object result.
+  __ popq(CODE_REG);  // Get Code object result.
   __ popq(R10);  // Restore arguments descriptor array.
   // Remove the stub frame as we are about to jump to the dart function.
   __ LeaveStubFrame();
 
-  __ movq(RBX, FieldAddress(RAX, Code::instructions_offset()));
-  __ addq(RBX, Immediate(Instructions::HeaderSize() - kHeapObjectTag));
+  __ movq(RBX, FieldAddress(CODE_REG, Code::entry_point_offset()));
   __ jmp(RBX);
 }
 
@@ -293,15 +280,18 @@
 // (invalid because its function was optimized or deoptimized).
 // R10: arguments descriptor array.
 void StubCode::GenerateFixCallersTargetStub(Assembler* assembler) {
+  // Load code pointer to this stub from the thread:
+  // The one that is passed in, is not correct - it points to the code object
+  // that needs to be replaced.
+  __ movq(CODE_REG, Address(THR, Thread::fix_callers_target_code_offset()));
   __ EnterStubFrame();
   __ pushq(R10);  // Preserve arguments descriptor array.
   // Setup space on stack for return value.
   __ PushObject(Object::null_object());
   __ CallRuntime(kFixCallersTargetRuntimeEntry, 0);
-  __ popq(RAX);  // Get Code object.
+  __ popq(CODE_REG);  // Get Code object.
   __ popq(R10);  // Restore arguments descriptor array.
-  __ movq(RAX, FieldAddress(RAX, Code::instructions_offset()));
-  __ addq(RAX, Immediate(Instructions::HeaderSize() - kHeapObjectTag));
+  __ movq(RAX, FieldAddress(CODE_REG, Code::entry_point_offset()));
   __ LeaveStubFrame();
   __ jmp(RAX);
   __ int3();
@@ -311,13 +301,16 @@
 // Called from object allocate instruction when the allocation stub has been
 // disabled.
 void StubCode::GenerateFixAllocationStubTargetStub(Assembler* assembler) {
+  // Load code pointer to this stub from the thread:
+  // The one that is passed in, is not correct - it points to the code object
+  // that needs to be replaced.
+  __ movq(CODE_REG, Address(THR, Thread::fix_allocation_stub_code_offset()));
   __ EnterStubFrame();
   // Setup space on stack for return value.
   __ PushObject(Object::null_object());
   __ CallRuntime(kFixAllocationStubTargetRuntimeEntry, 0);
-  __ popq(RAX);  // Get Code object.
-  __ movq(RAX, FieldAddress(RAX, Code::instructions_offset()));
-  __ addq(RAX, Immediate(Instructions::HeaderSize() - kHeapObjectTag));
+  __ popq(CODE_REG);  // Get Code object.
+  __ movq(RAX, FieldAddress(CODE_REG, Code::entry_point_offset()));
   __ LeaveStubFrame();
   __ jmp(RAX);
   __ int3();
@@ -359,13 +352,6 @@
 }
 
 
-DECLARE_LEAF_RUNTIME_ENTRY(intptr_t, DeoptimizeCopyFrame,
-                           intptr_t deopt_reason,
-                           uword saved_registers_address);
-
-DECLARE_LEAF_RUNTIME_ENTRY(void, DeoptimizeFillFrame, uword last_fp);
-
-
 // Used by eager and lazy deoptimization. Preserve result in RAX if necessary.
 // This stub translates optimized frame into unoptimized frame. The optimized
 // frame can contain values in registers and on stack, the unoptimized
@@ -387,16 +373,16 @@
 //   +------------------+
 //   | return-address   |  (deoptimization point)
 //   +------------------+
+//   | Saved CODE_REG   |
+//   +------------------+
 //   | ...              | <- SP of optimized frame
 //
 // Parts of the code cannot GC, part of the code can GC.
 static void GenerateDeoptimizationSequence(Assembler* assembler,
-                                           bool preserve_result) {
+                                           DeoptStubKind kind) {
   // DeoptimizeCopyFrame 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.
-  __ EnterFrame(0);
-  __ pushq(Immediate(0));
-  __ pushq(PP);
+  __ EnterStubFrame();
 
   // The code in this frame may not cause GC. kDeoptimizeCopyFrameRuntimeEntry
   // and kDeoptimizeFillFrameRuntimeEntry are leaf runtime calls.
@@ -407,7 +393,13 @@
   // Push registers in their enumeration order: lowest register number at
   // lowest address.
   for (intptr_t i = kNumberOfCpuRegisters - 1; i >= 0; i--) {
-    __ pushq(static_cast<Register>(i));
+    if (i == CODE_REG) {
+      // Save the original value of CODE_REG pushed before invoking this stub
+      // instead of the value used to call this stub.
+      __ pushq(Address(RBP, 2 * kWordSize));
+    } else {
+      __ pushq(static_cast<Register>(i));
+    }
   }
   __ subq(RSP, Immediate(kNumberOfXmmRegisters * kFpuRegisterSize));
   intptr_t offset = 0;
@@ -419,17 +411,20 @@
 
   // Pass address of saved registers block.
   __ movq(CallingConventions::kArg1Reg, RSP);
+  __ movq(CallingConventions::kArg2Reg, Immediate(kind == kLazyDeopt ? 1 : 0));
   __ ReserveAlignedFrameSpace(0);  // Ensure stack is aligned before the call.
-  __ CallRuntime(kDeoptimizeCopyFrameRuntimeEntry, 1);
+  __ CallRuntime(kDeoptimizeCopyFrameRuntimeEntry, 2);
   // Result (RAX) is stack-size (FP - SP) in bytes.
 
+  const bool preserve_result = (kind == kLazyDeopt);
   if (preserve_result) {
     // Restore result into RBX temporarily.
     __ movq(RBX, Address(RBP, saved_result_slot_from_fp * kWordSize));
   }
 
   // There is a Dart Frame on the stack. We must restore PP and leave frame.
-  __ LeaveDartFrame();
+  __ RestoreCodePointer();
+  __ LeaveStubFrame();
 
   __ popq(RCX);   // Preserve return address.
   __ movq(RSP, RBP);  // Discard optimized frame.
@@ -438,9 +433,7 @@
 
   // 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.
-  __ EnterFrame(0);
-  __ pushq(Immediate(0));
-  __ pushq(PP);
+  __ EnterStubFrame();
 
   if (preserve_result) {
     __ pushq(RBX);  // Preserve result as first local.
@@ -455,7 +448,8 @@
   }
   // Code above cannot cause GC.
   // There is a Dart Frame on the stack. We must restore PP and leave frame.
-  __ LeaveDartFrame();
+  __ RestoreCodePointer();
+  __ LeaveStubFrame();
 
   // Frame is fully rewritten at this point and it is safe to perform a GC.
   // Materialize any objects that were deferred by FillFrame because they
@@ -463,7 +457,6 @@
   // Enter stub frame with loading PP. The caller's PP is not materialized yet.
   __ EnterStubFrame();
   if (preserve_result) {
-    __ pushq(Immediate(0));  // Workaround for dropped stack slot during GC.
     __ pushq(RBX);  // Preserve result, it will be GC-d here.
   }
   __ pushq(Immediate(Smi::RawValue(0)));  // Space for the result.
@@ -474,7 +467,6 @@
   __ SmiUntag(RBX);
   if (preserve_result) {
     __ popq(RAX);  // Restore result.
-    __ Drop(1);  // Workaround for dropped stack slot during GC.
   }
   __ LeaveStubFrame();
 
@@ -491,14 +483,16 @@
   // Correct return address to point just after the call that is being
   // deoptimized.
   __ popq(RBX);
-  __ subq(RBX, Immediate(ShortCallPattern::InstructionLength()));
+  __ subq(RBX, Immediate(ShortCallPattern::pattern_length_in_bytes()));
+  // Push zap value instead of CODE_REG for lazy deopt.
+  __ pushq(Immediate(0xf1f1f1f1));
   __ pushq(RBX);
-  GenerateDeoptimizationSequence(assembler, true);  // Preserve RAX.
+  GenerateDeoptimizationSequence(assembler, kLazyDeopt);
 }
 
 
 void StubCode::GenerateDeoptimizeStub(Assembler* assembler) {
-  GenerateDeoptimizationSequence(assembler, false);  // Don't preserve RAX.
+  GenerateDeoptimizationSequence(assembler, kEagerDeopt);
 }
 
 
@@ -507,16 +501,14 @@
   __ Comment("NoSuchMethodDispatch");
   // When lazily generated invocation dispatchers are disabled, the
   // miss-handler may return null.
-  const Immediate& raw_null =
-      Immediate(reinterpret_cast<intptr_t>(Object::null()));
-  __ cmpq(RAX, raw_null);
+  __ CompareObject(RAX, Object::null_object());
   __ j(NOT_EQUAL, call_target_function);
   __ EnterStubFrame();
   // Load the receiver.
   __ movq(RDI, FieldAddress(R10, ArgumentsDescriptor::count_offset()));
   __ movq(RAX, Address(
       RBP, RDI, TIMES_HALF_WORD_SIZE, kParamEndSlotFromFp * kWordSize));
-  __ pushq(raw_null);  // Setup space on stack for result.
+  __ PushObject(Object::null_object());  // Setup space on stack for result.
   __ pushq(RAX);  // Receiver.
   __ pushq(RBX);
   __ pushq(R10);  // Arguments descriptor array.
@@ -558,16 +550,15 @@
   __ popq(RAX);  // Return value from the runtime call (function).
   __ popq(R10);  // Restore arguments descriptor.
   __ popq(RBX);  // Restore IC data.
+  __ RestoreCodePointer();
   __ LeaveStubFrame();
-
   if (!FLAG_lazy_dispatchers) {
     Label call_target_function;
     GenerateDispatcherCode(assembler, &call_target_function);
     __ Bind(&call_target_function);
   }
-
-  __ movq(RCX, FieldAddress(RAX, Function::instructions_offset()));
-  __ addq(RCX, Immediate(Instructions::HeaderSize() - kHeapObjectTag));
+  __ movq(CODE_REG, FieldAddress(RAX, Function::code_offset()));
+  __ movq(RCX, FieldAddress(RAX, Function::entry_point_offset()));
   __ jmp(RCX);
 }
 
@@ -710,7 +701,7 @@
 // Called when invoking Dart code from C++ (VM code).
 // Input parameters:
 //   RSP : points to return address.
-//   RDI : entrypoint of the Dart function to call.
+//   RDI : target code
 //   RSI : arguments descriptor array.
 //   RDX : arguments array.
 //   RCX : current thread.
@@ -718,16 +709,20 @@
   // Save frame pointer coming in.
   __ EnterFrame(0);
 
-  const Register kEntryPointReg = CallingConventions::kArg1Reg;
+  const Register kTargetCodeReg = CallingConventions::kArg1Reg;
   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()));
+
   // At this point, the stack looks like:
+  // | stub code object
   // | saved RBP                                      | <-- RBP
   // | saved PC (return to DartEntry::InvokeFunction) |
 
-  const intptr_t kInitialOffset = 1;
+  const intptr_t kInitialOffset = 2;
   // Save arguments descriptor array.
   const intptr_t kArgumentsDescOffset = -(kInitialOffset) * kWordSize;
   __ pushq(kArgDescReg);
@@ -736,11 +731,6 @@
   __ PushRegisters(CallingConventions::kCalleeSaveCpuRegisters,
                    CallingConventions::kCalleeSaveXmmRegisters);
 
-  // We now load the pool pointer(PP) as we are about to invoke dart code and we
-  // could potentially invoke some intrinsic functions which need the PP to be
-  // set up.
-  __ LoadPoolPointer();
-
   // If any additional (or fewer) values are pushed, the offsets in
   // kExitLinkSlotFromEntryFp will need to be changed.
 
@@ -748,17 +738,13 @@
   if (THR != kThreadReg) {
     __ movq(THR, kThreadReg);
   }
-  // Load Isolate pointer into kIsolateReg.
-  const Register kIsolateReg = RBX;
-  __ LoadIsolate(kIsolateReg);
 
   // Save the current VMTag on the stack.
-  __ movq(RAX, Address(kIsolateReg, Isolate::vm_tag_offset()));
+  __ movq(RAX, Assembler::VMTagAddress());
   __ pushq(RAX);
 
-  // Mark that the isolate is executing Dart code.
-  __ movq(Address(kIsolateReg, Isolate::vm_tag_offset()),
-          Immediate(VMTag::kDartTagId));
+  // Mark that the thread is executing Dart code.
+  __ movq(Assembler::VMTagAddress(), Immediate(VMTag::kDartTagId));
 
   // Save top resource and top exit frame info. Use RAX as a temporary register.
   // StackFrameIterator reads the top exit frame info saved in this frame.
@@ -780,14 +766,15 @@
     __ Bind(&ok);
   }
 #endif
+
   __ 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));
 
-  // Push arguments. At this point we only need to preserve kEntryPointReg.
-  ASSERT(kEntryPointReg != RDX);
+  // Push arguments. At this point we only need to preserve kTargetCodeReg.
+  ASSERT(kTargetCodeReg != RDX);
 
   // Load number of arguments into RBX.
   __ movq(RBX, FieldAddress(R10, ArgumentsDescriptor::count_offset()));
@@ -811,7 +798,11 @@
   __ Bind(&done_push_arguments);
 
   // Call the Dart code entrypoint.
-  __ call(kEntryPointReg);  // R10 is the arguments descriptor array.
+  __ xorq(PP, PP);  // GC-safe value into PP.
+  __ movq(CODE_REG,
+          Address(kTargetCodeReg, VMHandles::kOffsetOfRawPtrInHandle));
+  __ movq(kTargetCodeReg, FieldAddress(CODE_REG, Code::entry_point_offset()));
+  __ call(kTargetCodeReg);  // R10 is the arguments descriptor array.
 
   // Read the saved arguments descriptor array to obtain the number of passed
   // arguments.
@@ -823,12 +814,11 @@
 
   // Restore the saved top exit frame info and top resource back into the
   // Isolate structure.
-  __ LoadIsolate(kIsolateReg);
   __ popq(Address(THR, Thread::top_exit_frame_info_offset()));
   __ popq(Address(THR, Thread::top_resource_offset()));
 
   // Restore the current VMTag from the stack.
-  __ popq(Address(kIsolateReg, Isolate::vm_tag_offset()));
+  __ popq(Assembler::VMTagAddress());
 
   // Restore C++ ABI callee-saved registers.
   __ PopRegisters(CallingConventions::kCalleeSaveCpuRegisters,
@@ -848,7 +838,7 @@
 // Output:
 // RAX: new allocated RawContext object.
 void StubCode::GenerateAllocateContextStub(Assembler* assembler) {
-  __ LoadObject(R12, Object::null_object());
+  __ LoadObject(R9, Object::null_object());
   if (FLAG_inline_alloc) {
     Label slow_case;
     // First compute the rounded instance size.
@@ -932,7 +922,7 @@
     // No generational barrier needed, since we are storing null.
     __ InitializeFieldNoBarrier(RAX,
                                 FieldAddress(RAX, Context::parent_offset()),
-                                R12);
+                                R9);
 
     // Initialize the context variables.
     // RAX: new object.
@@ -951,7 +941,7 @@
       // No generational barrier needed, since we are storing null.
       __ InitializeFieldNoBarrier(RAX,
                                   Address(R13, R10, TIMES_8, 0),
-                                  R12);
+                                  R9);
       __ Bind(&entry);
       __ cmpq(R10, Immediate(0));
       __ j(NOT_EQUAL, &loop, Assembler::kNearJump);
@@ -965,7 +955,7 @@
   }
   // Create a stub frame.
   __ EnterStubFrame();
-  __ pushq(R12);  // Setup space on stack for the return value.
+  __ pushq(R9);  // Setup space on stack for the return value.
   __ SmiTag(R10);
   __ pushq(R10);  // Push number of context variables.
   __ CallRuntime(kAllocateContextRuntimeEntry, 1);  // Allocate context.
@@ -978,8 +968,6 @@
 }
 
 
-DECLARE_LEAF_RUNTIME_ENTRY(void, StoreBufferBlockProcess, Isolate* isolate);
-
 // Helper stub to implement Assembler::StoreIntoObject.
 // Input parameters:
 //   RDX: Address being stored
@@ -1047,14 +1035,8 @@
 // Input parameters:
 //   RSP + 8 : type arguments object (only if class is parameterized).
 //   RSP : points to return address.
-void StubCode::GenerateAllocationStubForClass(
-    Assembler* assembler, const Class& cls,
-    uword* entry_patch_offset, uword* patch_code_pc_offset) {
-  // Must load pool pointer before being able to patch.
-  Register new_pp = R13;
-  __ LoadPoolPointer(new_pp);
-  *entry_patch_offset = assembler->CodeSize();
-
+void StubCode::GenerateAllocationStubForClass(Assembler* assembler,
+                                              const Class& cls) {
   const intptr_t kObjectTypeArgumentsOffset = 1 * kWordSize;
   // The generated code is different if the class is parameterized.
   const bool is_cls_parameterized = cls.NumTypeArguments() > 0;
@@ -1066,7 +1048,7 @@
   const int kInlineInstanceSize = 12;  // In words.
   const intptr_t instance_size = cls.instance_size();
   ASSERT(instance_size > 0);
-  __ LoadObject(R12, Object::null_object());
+  __ LoadObject(R9, Object::null_object());
   if (is_cls_parameterized) {
     __ movq(RDX, Address(RSP, kObjectTypeArgumentsOffset));
     // RDX: instantiated type arguments.
@@ -1110,7 +1092,7 @@
     // RAX: new object (tagged).
     // RBX: next object start.
     // RDX: new object type arguments (if is_cls_parameterized).
-    // R12: raw null.
+    // R9: raw null.
     // First try inlining the initialization without a loop.
     if (instance_size < (kInlineInstanceSize * kWordSize)) {
       // Check if the object contains any non-header fields.
@@ -1120,7 +1102,7 @@
            current_offset += kWordSize) {
         __ InitializeFieldNoBarrier(RAX,
                                     FieldAddress(RAX, current_offset),
-                                    R12);
+                                    R9);
       }
     } else {
       __ leaq(RCX, FieldAddress(RAX, Instance::NextFieldOffset()));
@@ -1139,7 +1121,7 @@
       static const bool kJumpLength = Assembler::kNearJump;
 #endif  // DEBUG
       __ j(ABOVE_EQUAL, &done, kJumpLength);
-      __ InitializeFieldNoBarrier(RAX, Address(RCX, 0), R12);
+      __ InitializeFieldNoBarrier(RAX, Address(RCX, 0), R9);
       __ addq(RCX, Immediate(kWordSize));
       __ jmp(&init_loop, Assembler::kNearJump);
       __ Bind(&done);
@@ -1160,12 +1142,12 @@
   // RDX: new object type arguments.
   // Create a stub frame.
   __ EnterStubFrame();  // Uses PP to access class object.
-  __ pushq(R12);  // Setup space on stack for return value.
+  __ 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 {
-    __ pushq(R12);  // Push null type arguments.
+    __ pushq(R9);  // Push null type arguments.
   }
   __ CallRuntime(kAllocateObjectRuntimeEntry, 2);  // Allocate object.
   __ popq(RAX);  // Pop argument (type arguments of object).
@@ -1175,8 +1157,6 @@
   // Restore the frame pointer.
   __ LeaveStubFrame();
   __ ret();
-  *patch_code_pc_offset = assembler->CodeSize();
-  __ JmpPatchable(*StubCode::FixAllocationStubTarget_entry(), new_pp);
 }
 
 
@@ -1262,9 +1242,9 @@
   ASSERT(num_args == 2);
   __ movq(RCX, Address(RSP, + 1 * kWordSize));  // Right
   __ movq(RAX, Address(RSP, + 2 * kWordSize));  // Left.
-  __ movq(R12, RCX);
-  __ orq(R12, RAX);
-  __ testq(R12, Immediate(kSmiTagMask));
+  __ movq(R13, RCX);
+  __ orq(R13, RAX);
+  __ testq(R13, Immediate(kSmiTagMask));
   __ j(NOT_ZERO, not_smi_or_overflow);
   switch (kind) {
     case Token::kADD: {
@@ -1300,18 +1280,18 @@
   }
 
   // RBX: IC data object (preserved).
-  __ movq(R12, FieldAddress(RBX, ICData::ic_data_offset()));
-  // R12: ic_data_array with check entries: classes and target functions.
-  __ leaq(R12, FieldAddress(R12, Array::data_offset()));
-  // R12: points directly to the first ic data array element.
+  __ 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.
 #if defined(DEBUG)
   // Check that first entry is for Smi/Smi.
   Label error, ok;
   const Immediate& imm_smi_cid =
       Immediate(reinterpret_cast<intptr_t>(Smi::New(kSmiCid)));
-  __ cmpq(Address(R12, 0 * kWordSize), imm_smi_cid);
+  __ cmpq(Address(R13, 0 * kWordSize), imm_smi_cid);
   __ j(NOT_EQUAL, &error, Assembler::kNearJump);
-  __ cmpq(Address(R12, 1 * kWordSize), imm_smi_cid);
+  __ cmpq(Address(R13, 1 * kWordSize), imm_smi_cid);
   __ j(EQUAL, &ok, Assembler::kNearJump);
   __ Bind(&error);
   __ Stop("Incorrect IC data");
@@ -1321,11 +1301,11 @@
   if (FLAG_optimization_counter_threshold >= 0) {
     const intptr_t count_offset = ICData::CountIndexFor(num_args) * kWordSize;
     // Update counter.
-    __ movq(R8, Address(R12, count_offset));
+    __ movq(R8, Address(R13, count_offset));
     __ addq(R8, Immediate(Smi::RawValue(1)));
-    __ movq(R13, Immediate(Smi::RawValue(Smi::kMaxValue)));
-    __ cmovnoq(R13, R8);
-    __ StoreIntoSmiField(Address(R12, count_offset), R13);
+    __ movq(R9, Immediate(Smi::RawValue(Smi::kMaxValue)));
+    __ cmovnoq(R9, R8);
+    __ StoreIntoSmiField(Address(R13, count_offset), R9);
   }
 
   __ ret();
@@ -1401,18 +1381,18 @@
   // Loop that checks if there is an IC data match.
   Label loop, update, test, found;
   // RBX: IC data object (preserved).
-  __ movq(R12, FieldAddress(RBX, ICData::ic_data_offset()));
-  // R12: ic_data_array with check entries: classes and target functions.
-  __ leaq(R12, FieldAddress(R12, Array::data_offset()));
-  // R12: points directly to the first ic data array element.
+  __ 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.
 
   // Get the receiver's class ID (first read number of arguments from
   // arguments descriptor array and then access the receiver from the stack).
   __ movq(RAX, FieldAddress(R10, ArgumentsDescriptor::count_offset()));
-  __ movq(R13, Address(RSP, RAX, TIMES_4, 0));  // RAX (argument count) is Smi.
-  __ LoadTaggedClassIdMayBeSmi(RAX, R13);
+  __ movq(R9, Address(RSP, RAX, TIMES_4, 0));  // RAX (argument count) is Smi.
+  __ LoadTaggedClassIdMayBeSmi(RAX, R9);
   // RAX: receiver's class ID as smi.
-  __ movq(R13, Address(R12, 0));  // First class ID (Smi) to check.
+  __ movq(R9, Address(R13, 0));  // First class ID (Smi) to check.
   __ jmp(&test);
 
   __ Comment("ICData loop");
@@ -1421,13 +1401,13 @@
     if (i > 0) {
       // If not the first, load the next argument's class ID.
       __ movq(RAX, FieldAddress(R10, ArgumentsDescriptor::count_offset()));
-      __ movq(R13, Address(RSP, RAX, TIMES_4, - i * kWordSize));
-      __ LoadTaggedClassIdMayBeSmi(RAX, R13);
+      __ movq(R9, Address(RSP, RAX, TIMES_4, - i * kWordSize));
+      __ LoadTaggedClassIdMayBeSmi(RAX, R9);
       // RAX: next argument class ID (smi).
-      __ movq(R13, Address(R12, i * kWordSize));
-      // R13: next class ID to check (smi).
+      __ movq(R9, Address(R13, i * kWordSize));
+      // R9: next class ID to check (smi).
     }
-    __ cmpq(RAX, R13);  // Class id match?
+    __ cmpq(RAX, R9);  // Class id match?
     if (i < (num_args - 1)) {
       __ j(NOT_EQUAL, &update);  // Continue.
     } else {
@@ -1439,20 +1419,20 @@
   // Reload receiver class ID.  It has not been destroyed when num_args == 1.
   if (num_args > 1) {
     __ movq(RAX, FieldAddress(R10, ArgumentsDescriptor::count_offset()));
-    __ movq(R13, Address(RSP, RAX, TIMES_4, 0));
-    __ LoadTaggedClassIdMayBeSmi(RAX, R13);
+    __ movq(R9, Address(RSP, RAX, TIMES_4, 0));
+    __ LoadTaggedClassIdMayBeSmi(RAX, R9);
   }
 
   const intptr_t entry_size = ICData::TestEntryLengthFor(num_args) * kWordSize;
-  __ addq(R12, Immediate(entry_size));  // Next entry.
-  __ movq(R13, Address(R12, 0));  // Next class ID.
+  __ addq(R13, Immediate(entry_size));  // Next entry.
+  __ movq(R9, Address(R13, 0));  // Next class ID.
 
   __ Bind(&test);
-  __ cmpq(R13, Immediate(Smi::RawValue(kIllegalCid)));  // Done?
+  __ cmpq(R9, Immediate(Smi::RawValue(kIllegalCid)));  // Done?
   __ j(NOT_EQUAL, &loop, Assembler::kNearJump);
 
   __ Comment("IC miss");
-  __ LoadObject(R12, Object::null_object());
+  __ LoadObject(R13, Object::null_object());
   // Compute address of arguments (first read number of arguments from
   // arguments descriptor array and then compute address on the stack).
   __ movq(RAX, FieldAddress(R10, ArgumentsDescriptor::count_offset()));
@@ -1460,7 +1440,7 @@
   __ EnterStubFrame();
   __ pushq(R10);  // Preserve arguments descriptor array.
   __ pushq(RBX);  // Preserve IC data object.
-  __ pushq(R12);  // Setup space on stack for result (target code object).
+  __ pushq(R13);  // Setup space on stack for result (target code object).
   // Push call arguments.
   for (intptr_t i = 0; i < num_args; i++) {
     __ movq(RCX, Address(RAX, -kWordSize * i));
@@ -1475,6 +1455,9 @@
   __ popq(RAX);  // Pop returned function object into RAX.
   __ popq(RBX);  // Restore IC data array.
   __ popq(R10);  // Restore arguments descriptor array.
+  if (range_collection_mode == kCollectRanges) {
+    __ RestoreCodePointer();
+  }
   __ LeaveStubFrame();
   Label call_target_function;
   if (!FLAG_lazy_dispatchers) {
@@ -1484,38 +1467,39 @@
   }
 
   __ Bind(&found);
-  // R12: Pointer to an IC data check group.
+  // R13: Pointer to an IC data check group.
   const intptr_t target_offset = ICData::TargetIndexFor(num_args) * kWordSize;
   const intptr_t count_offset = ICData::CountIndexFor(num_args) * kWordSize;
-  __ movq(RAX, Address(R12, target_offset));
+  __ movq(RAX, Address(R13, target_offset));
 
   if (FLAG_optimization_counter_threshold >= 0) {
     // Update counter.
     __ Comment("Update caller's counter");
-    __ movq(R8, Address(R12, count_offset));
+    __ movq(R8, Address(R13, count_offset));
     __ addq(R8, Immediate(Smi::RawValue(1)));
-    __ movq(R13, Immediate(Smi::RawValue(Smi::kMaxValue)));
-    __ cmovnoq(R13, R8);
-    __ StoreIntoSmiField(Address(R12, count_offset), R13);
+    __ movq(R9, Immediate(Smi::RawValue(Smi::kMaxValue)));
+    __ cmovnoq(R9, R8);
+    __ StoreIntoSmiField(Address(R13, count_offset), R9);
   }
 
   __ Comment("Call target");
   __ Bind(&call_target_function);
   // RAX: Target function.
   Label is_compiled;
-  __ movq(RCX, FieldAddress(RAX, Function::instructions_offset()));
-  __ addq(RCX, Immediate(Instructions::HeaderSize() - kHeapObjectTag));
   if (range_collection_mode == kCollectRanges) {
+    __ movq(R13, FieldAddress(RAX, Function::code_offset()));
+    __ movq(RCX, FieldAddress(RAX, Function::entry_point_offset()));
     __ movq(R8, Address(RSP, + 1 * kWordSize));
     if (num_args == 2) {
-      __ movq(R13, Address(RSP, + 2 * kWordSize));
+      __ movq(R9, Address(RSP, + 2 * kWordSize));
     }
     __ EnterStubFrame();
     __ pushq(RBX);
     if (num_args == 2) {
-      __ pushq(R13);
+      __ pushq(R9);
     }
     __ pushq(R8);
+    __ movq(CODE_REG, R13);
     __ call(RCX);
 
     Label done;
@@ -1526,6 +1510,8 @@
     __ LeaveStubFrame();
     __ ret();
   } else {
+    __ movq(CODE_REG, FieldAddress(RAX, Function::code_offset()));
+    __ movq(RCX, FieldAddress(RAX, Function::entry_point_offset()));
     __ jmp(RCX);
   }
 
@@ -1535,6 +1521,7 @@
     __ pushq(RBX);
     __ CallRuntime(kSingleStepHandlerRuntimeEntry, 0);
     __ popq(RBX);
+    __ RestoreCodePointer();
     __ LeaveStubFrame();
     __ jmp(&done_stepping);
   }
@@ -1703,9 +1690,8 @@
 
   // Get function and call it, if possible.
   __ movq(RAX, Address(R12, target_offset));
-  __ movq(RCX, FieldAddress(RAX, Function::instructions_offset()));
-  // RCX: Target instructions.
-  __ addq(RCX, Immediate(Instructions::HeaderSize() - kHeapObjectTag));
+  __ movq(CODE_REG, FieldAddress(RAX, Function::code_offset()));
+  __ movq(RCX, FieldAddress(RAX, Function::entry_point_offset()));
   __ jmp(RCX);
 
   if (FLAG_support_debugger) {
@@ -1714,6 +1700,7 @@
     __ pushq(RBX);  // Preserve IC data object.
     __ CallRuntime(kSingleStepHandlerRuntimeEntry, 0);
     __ popq(RBX);
+    __ RestoreCodePointer();
     __ LeaveStubFrame();
     __ jmp(&done_stepping, Assembler::kNearJump);
   }
@@ -1756,8 +1743,8 @@
   __ popq(R10);  // Restore arguments descriptor array.
   __ LeaveStubFrame();
 
-  __ movq(RAX, FieldAddress(RAX, Function::instructions_offset()));
-  __ addq(RAX, Immediate(Instructions::HeaderSize() - kHeapObjectTag));
+  __ movq(CODE_REG, FieldAddress(RAX, Function::code_offset()));
+  __ movq(RAX, FieldAddress(RAX, Function::entry_point_offset()));
   __ jmp(RAX);
 }
 
@@ -1773,9 +1760,11 @@
   __ LoadObject(R12, Object::null_object());
   __ pushq(R12);  // Room for result.
   __ CallRuntime(kBreakpointRuntimeHandlerRuntimeEntry, 0);
-  __ popq(RAX);  // Address of original.
+  __ popq(CODE_REG);  // Address of original.
   __ popq(RBX);  // Restore IC data.
   __ LeaveStubFrame();
+
+  __ movq(RAX, FieldAddress(CODE_REG, Code::entry_point_offset()));
   __ jmp(RAX);   // Jump to original stub.
 }
 
@@ -1788,8 +1777,10 @@
   __ LoadObject(R12, Object::null_object());
   __ pushq(R12);  // Room for result.
   __ CallRuntime(kBreakpointRuntimeHandlerRuntimeEntry, 0);
-  __ popq(RAX);  // Address of original.
+  __ popq(CODE_REG);  // Address of original.
   __ LeaveStubFrame();
+
+  __ movq(RAX, FieldAddress(CODE_REG, Code::entry_point_offset()));
   __ jmp(RAX);   // Jump to original stub.
 }
 
@@ -1825,12 +1816,12 @@
   const intptr_t kInstanceOffsetInBytes = 2 * kWordSize;
   const intptr_t kCacheOffsetInBytes = 3 * kWordSize;
   __ movq(RAX, Address(RSP, kInstanceOffsetInBytes));
-  __ LoadObject(R12, Object::null_object());
+  __ LoadObject(R9, Object::null_object());
   if (n > 1) {
     __ LoadClass(R10, RAX);
     // Compute instance type arguments into R13.
     Label has_no_type_arguments;
-    __ movq(R13, R12);
+    __ movq(R13, R9);
     __ movl(RDI, FieldAddress(R10,
         Class::type_arguments_field_offset_in_words_offset()));
     __ cmpl(RDI, Immediate(Class::kNoTypeArguments));
@@ -1852,7 +1843,7 @@
   __ SmiTag(R10);
   __ Bind(&loop);
   __ movq(RDI, Address(RDX, kWordSize * SubtypeTestCache::kInstanceClassId));
-  __ cmpq(RDI, R12);
+  __ cmpq(RDI, R9);
   __ j(EQUAL, &not_found, Assembler::kNearJump);
   __ cmpq(RDI, R10);
   if (n == 1) {
@@ -1879,7 +1870,7 @@
   __ jmp(&loop, Assembler::kNearJump);
   // Fall through to not found.
   __ Bind(&not_found);
-  __ movq(RCX, R12);
+  __ movq(RCX, R9);
   __ ret();
 
   __ Bind(&found);
@@ -1950,20 +1941,16 @@
   Register stacktrace_reg = RBX;
   __ movq(stacktrace_reg, Address(RSP, 5 * kWordSize));
   __ movq(THR, Address(RSP, 6 * kWordSize));
-  Register isolate_reg = RDI;
 #else
   Register stacktrace_reg = CallingConventions::kArg5Reg;
   __ movq(THR, CallingConventions::kArg6Reg);
-  Register isolate_reg = CallingConventions::kArg6Reg;
 #endif
-  __ LoadIsolate(isolate_reg);
   __ movq(RBP, CallingConventions::kArg3Reg);
   __ movq(RSP, CallingConventions::kArg2Reg);
   __ movq(kStackTraceObjectReg, stacktrace_reg);
   __ movq(kExceptionObjectReg, CallingConventions::kArg4Reg);
   // Set the tag.
-  __ movq(Address(isolate_reg, Isolate::vm_tag_offset()),
-          Immediate(VMTag::kDartTagId));
+  __ movq(Assembler::VMTagAddress(), Immediate(VMTag::kDartTagId));
   // Clear top exit frame.
   __ movq(Address(THR, Thread::top_exit_frame_info_offset()),
           Immediate(0));
@@ -1982,22 +1969,15 @@
   __ pushq(RDI);
   __ CallRuntime(kOptimizeInvokedFunctionRuntimeEntry, 1);
   __ popq(RAX);  // Disard argument.
-  __ popq(RAX);  // Get Code object.
+  __ popq(CODE_REG);  // Get Code object.
   __ popq(R10);  // Restore argument descriptor.
-  __ movq(RAX, FieldAddress(RAX, Code::instructions_offset()));
-  __ addq(RAX, Immediate(Instructions::HeaderSize() - kHeapObjectTag));
+  __ movq(RAX, FieldAddress(CODE_REG, Code::entry_point_offset()));
   __ LeaveStubFrame();
   __ jmp(RAX);
   __ int3();
 }
 
 
-DECLARE_LEAF_RUNTIME_ENTRY(intptr_t,
-                           BigintCompare,
-                           RawBigint* left,
-                           RawBigint* right);
-
-
 // Does identical check (object references are equal or not equal) with special
 // checks for boxed numbers.
 // Left and right are pushed on stack.
@@ -2018,27 +1998,27 @@
   __ CompareClassId(left, kDoubleCid);
   __ j(NOT_EQUAL, &check_mint, Assembler::kNearJump);
   __ CompareClassId(right, kDoubleCid);
-  __ j(NOT_EQUAL, &done, Assembler::kNearJump);
+  __ j(NOT_EQUAL, &done, Assembler::kFarJump);
 
   // Double values bitwise compare.
   __ movq(left, FieldAddress(left, Double::value_offset()));
   __ cmpq(left, FieldAddress(right, Double::value_offset()));
-  __ jmp(&done, Assembler::kNearJump);
+  __ jmp(&done, Assembler::kFarJump);
 
   __ Bind(&check_mint);
   __ CompareClassId(left, kMintCid);
   __ j(NOT_EQUAL, &check_bigint, Assembler::kNearJump);
   __ CompareClassId(right, kMintCid);
-  __ j(NOT_EQUAL, &done, Assembler::kNearJump);
+  __ j(NOT_EQUAL, &done, Assembler::kFarJump);
   __ movq(left, FieldAddress(left, Mint::value_offset()));
   __ cmpq(left, FieldAddress(right, Mint::value_offset()));
-  __ jmp(&done, Assembler::kNearJump);
+  __ jmp(&done, Assembler::kFarJump);
 
   __ Bind(&check_bigint);
   __ CompareClassId(left, kBigintCid);
-  __ j(NOT_EQUAL, &reference_compare, Assembler::kNearJump);
+  __ j(NOT_EQUAL, &reference_compare, Assembler::kFarJump);
   __ CompareClassId(right, kBigintCid);
-  __ j(NOT_EQUAL, &done, Assembler::kNearJump);
+  __ j(NOT_EQUAL, &done, Assembler::kFarJump);
   __ EnterStubFrame();
   __ ReserveAlignedFrameSpace(0);
   __ movq(CallingConventions::kArg1Reg, left);
@@ -2084,6 +2064,7 @@
     __ Bind(&stepping);
     __ EnterStubFrame();
     __ CallRuntime(kSingleStepHandlerRuntimeEntry, 0);
+    __ RestoreCodePointer();
     __ LeaveStubFrame();
     __ jmp(&done_stepping);
   }
@@ -2141,11 +2122,8 @@
   // illegal class id was found, the target is a cache miss handler that can
   // be invoked as a normal Dart function.
   __ movq(RAX, FieldAddress(RDI, RCX, TIMES_8, base + kWordSize));
-  __ movq(target, FieldAddress(RAX, Function::instructions_offset()));
-  // TODO(srdjan): Evaluate performance impact of moving the instruction below
-  // to the call site, instead of having it here.
-  __ AddImmediate(
-      target, Immediate(Instructions::HeaderSize() - kHeapObjectTag));
+  __ movq(CODE_REG, FieldAddress(RAX, Function::code_offset()));
+  __ movq(target, FieldAddress(RAX, Function::entry_point_offset()));
 }
 
 
diff --git a/runtime/vm/stub_code_x64_test.cc b/runtime/vm/stub_code_x64_test.cc
index 4f67eed..ff020e7 100644
--- a/runtime/vm/stub_code_x64_test.cc
+++ b/runtime/vm/stub_code_x64_test.cc
@@ -19,10 +19,6 @@
 
 namespace dart {
 
-DECLARE_RUNTIME_ENTRY(TestSmiSub);
-DECLARE_LEAF_RUNTIME_ENTRY(RawObject*, TestLeafSmiAdd, RawObject*, RawObject*);
-
-
 static Function* CreateFunction(const char* name) {
   const String& class_name = String::Handle(Symbols::New("ownerClass"));
   const Script& script = Script::Handle();
@@ -40,16 +36,15 @@
 
 // Test calls to stub code which calls into the runtime.
 static void GenerateCallToCallRuntimeStub(Assembler* assembler,
-                                          int value1, int value2) {
+                                          int length) {
   const int argc = 2;
-  const Smi& smi1 = Smi::ZoneHandle(Smi::New(value1));
-  const Smi& smi2 = Smi::ZoneHandle(Smi::New(value2));
+  const Smi& smi_length = Smi::ZoneHandle(Smi::New(length));
   __ EnterStubFrame();
   __ PushObject(Object::null_object());  // Push Null obj for return value.
-  __ PushObject(smi1);  // Push argument 1 smi1.
-  __ PushObject(smi2);  // Push argument 2 smi2.
-  ASSERT(kTestSmiSubRuntimeEntry.argument_count() == argc);
-  __ CallRuntime(kTestSmiSubRuntimeEntry, argc);  // Call SmiSub runtime func.
+  __ PushObject(smi_length);             // Push argument 1: length.
+  __ PushObject(Object::null_object());  // Push argument 2: type arguments.
+  ASSERT(kAllocateArrayRuntimeEntry.argument_count() == argc);
+  __ CallRuntime(kAllocateArrayRuntimeEntry, argc);
   __ AddImmediate(RSP, Immediate(argc * kWordSize));
   __ popq(RAX);  // Pop return value from return slot.
   __ LeaveStubFrame();
@@ -60,32 +55,34 @@
 TEST_CASE(CallRuntimeStubCode) {
   extern const Function& RegisterFakeFunction(const char* name,
                                               const Code& code);
-  const int value1 = 10;
-  const int value2 = 20;
+  const int length = 10;
   const char* kName = "Test_CallRuntimeStubCode";
   Assembler _assembler_;
-  GenerateCallToCallRuntimeStub(&_assembler_, value1, value2);
+  GenerateCallToCallRuntimeStub(&_assembler_, length);
   const Code& code = Code::Handle(Code::FinalizeCode(
       *CreateFunction("Test_CallRuntimeStubCode"), &_assembler_));
   const Function& function = RegisterFakeFunction(kName, code);
-  Smi& result = Smi::Handle();
+  Array& result = Array::Handle();
   result ^= DartEntry::InvokeFunction(function, Object::empty_array());
-  EXPECT_EQ((value1 - value2), result.Value());
+  EXPECT_EQ(length, result.Length());
 }
 
 
 // Test calls to stub code which calls into a leaf runtime entry.
 static void GenerateCallToCallLeafRuntimeStub(Assembler* assembler,
-                                              int value1,
-                                              int value2) {
-  const Smi& smi1 = Smi::ZoneHandle(Smi::New(value1));
-  const Smi& smi2 = Smi::ZoneHandle(Smi::New(value2));
-  __ enter(Immediate(0));
+                                              const char* value1,
+                                              const char* value2) {
+  const Bigint& bigint1 =
+      Bigint::ZoneHandle(Bigint::NewFromCString(value1, Heap::kOld));
+  const Bigint& bigint2 =
+      Bigint::ZoneHandle(Bigint::NewFromCString(value2, Heap::kOld));
+  __ EnterStubFrame();
   __ ReserveAlignedFrameSpace(0);
-  __ LoadObject(CallingConventions::kArg1Reg, smi1);
-  __ LoadObject(CallingConventions::kArg2Reg, smi2);
-  __ CallRuntime(kTestLeafSmiAddRuntimeEntry, 2);  // Call SmiAdd runtime func.
-  __ leave();
+  __ LoadObject(CallingConventions::kArg1Reg, bigint1);
+  __ LoadObject(CallingConventions::kArg2Reg, bigint2);
+  __ CallRuntime(kBigintCompareRuntimeEntry, 2);
+  __ SmiTag(RAX);
+  __ LeaveStubFrame();
   __ ret();  // Return value is in RAX.
 }
 
@@ -93,8 +90,8 @@
 TEST_CASE(CallLeafRuntimeStubCode) {
   extern const Function& RegisterFakeFunction(const char* name,
                                               const Code& code);
-  const int value1 = 10;
-  const int value2 = 20;
+  const char* value1 = "0xAAABBCCDDAABBCCDD";
+  const char* value2 = "0xAABBCCDDAABBCCDD";
   const char* kName = "Test_CallLeafRuntimeStubCode";
   Assembler _assembler_;
   GenerateCallToCallLeafRuntimeStub(&_assembler_, value1, value2);
@@ -103,7 +100,7 @@
   const Function& function = RegisterFakeFunction(kName, code);
   Smi& result = Smi::Handle();
   result ^= DartEntry::InvokeFunction(function, Object::empty_array());
-  EXPECT_EQ((value1 + value2), result.Value());
+  EXPECT_EQ(1, result.Value());
 }
 
 }  // namespace dart
diff --git a/runtime/vm/symbols.cc b/runtime/vm/symbols.cc
index 7cafda2..e984c1b 100644
--- a/runtime/vm/symbols.cc
+++ b/runtime/vm/symbols.cc
@@ -197,6 +197,7 @@
   // Should only be run by the vm isolate.
   ASSERT(Isolate::Current() == Dart::vm_isolate());
   ASSERT(vm_isolate == Dart::vm_isolate());
+  Zone* zone = Thread::Current()->zone();
 
   // Create and setup a symbol table in the vm isolate.
   SetupSymbolTable(vm_isolate);
@@ -204,7 +205,7 @@
   // Create all predefined symbols.
   ASSERT((sizeof(names) / sizeof(const char*)) == Symbols::kNullCharId);
 
-  SymbolTable table(vm_isolate, vm_isolate->object_store()->symbol_table());
+  SymbolTable table(zone, vm_isolate->object_store()->symbol_table());
 
   // First set up all the predefined string symbols.
   // Create symbols for language keywords. Some keywords are equal to
@@ -244,8 +245,9 @@
   // Should only be run by the vm isolate.
   ASSERT(Isolate::Current() == Dart::vm_isolate());
   ASSERT(vm_isolate == Dart::vm_isolate());
+  Zone* zone = Thread::Current()->zone();
 
-  SymbolTable table(vm_isolate, vm_isolate->object_store()->symbol_table());
+  SymbolTable table(zone, vm_isolate->object_store()->symbol_table());
 
   // Lookup all the predefined string symbols and language keyword symbols
   // and cache them in the read only handles for fast access.
@@ -282,11 +284,13 @@
 
 void Symbols::AddPredefinedSymbolsToIsolate() {
   // Should only be run by regular Dart isolates.
-  Isolate* isolate = Isolate::Current();
+  Thread* thread = Thread::Current();
+  Isolate* isolate = thread->isolate();
+  Zone* zone = thread->zone();
   ASSERT(isolate != Dart::vm_isolate());
-  String& str = String::Handle(isolate);
+  String& str = String::Handle(zone);
 
-  SymbolTable table(isolate, isolate->object_store()->symbol_table());
+  SymbolTable table(zone, isolate->object_store()->symbol_table());
 
   // Set up all the predefined string symbols and create symbols for
   // language keywords.
@@ -329,7 +333,7 @@
 
 void Symbols::GetStats(Isolate* isolate, intptr_t* size, intptr_t* capacity) {
   ASSERT(isolate != NULL);
-  SymbolTable table(isolate, isolate->object_store()->symbol_table());
+  SymbolTable table(isolate->object_store()->symbol_table());
   *size = table.NumOccupied();
   *capacity = table.NumEntries();
   table.Release();
@@ -379,23 +383,106 @@
 
 
 RawString* Symbols::FromConcat(const String& str1, const String& str2) {
-  return NewSymbol(ConcatString(str1, str2));
+  if (str1.Length() == 0) {
+    return New(str2);
+  } else if (str2.Length() == 0) {
+    return New(str1);
+  } else {
+    return NewSymbol(ConcatString(str1, str2));
+  }
+}
+
+
+// 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(
+    const GrowableHandlePtrArray<const String>& strs) {
+  const intptr_t strs_length = strs.length();
+  GrowableArray<intptr_t> lengths(strs_length);
+
+  intptr_t len_sum = 0;
+  const intptr_t kOneByteChar = 1;
+  intptr_t char_size = kOneByteChar;
+
+  for (intptr_t i = 0; i < strs_length; i++) {
+    const String& str = strs[i];
+    const intptr_t str_len = str.Length();
+    if ((String::kMaxElements - len_sum) < str_len) {
+      Exceptions::ThrowOOM();
+      UNREACHABLE();
+    }
+    len_sum += str_len;
+    lengths.Add(str_len);
+    char_size = Utils::Maximum(char_size, str.CharSize());
+  }
+  const bool is_one_byte_string = char_size == kOneByteChar;
+
+  Zone* zone = Thread::Current()->zone();
+  if (is_one_byte_string) {
+    uint8_t* buffer = zone->Alloc<uint8_t>(len_sum);
+    const uint8_t* const orig_buffer = buffer;
+    for (intptr_t i = 0; i < strs_length; i++) {
+      NoSafepointScope no_safepoint;
+      intptr_t str_len = lengths[i];
+      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);
+        memmove(buffer, src_p, str_len);
+        buffer += str_len;
+      }
+    }
+    ASSERT(len_sum == buffer - orig_buffer);
+    return Symbols::FromLatin1(orig_buffer, len_sum);
+  } else {
+    uint16_t* buffer = zone->Alloc<uint16_t>(len_sum);
+    const uint16_t* const orig_buffer = buffer;
+    for (intptr_t i = 0; i < strs_length; i++) {
+      NoSafepointScope no_safepoint;
+      intptr_t str_len = lengths[i];
+      if (str_len > 0) {
+        const String& str = strs[i];
+        if (str.IsTwoByteString()) {
+          memmove(buffer, TwoByteString::CharAddr(str, 0), str_len * 2);
+        } else if (str.IsExternalTwoByteString()) {
+          memmove(buffer, ExternalTwoByteString::CharAddr(str, 0), str_len * 2);
+        } 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);
+          for (int n = 0; n < str_len; n++) {
+            buffer[n] = src_p[n];
+          }
+        }
+        buffer += str_len;
+      }
+    }
+    ASSERT(len_sum == buffer - orig_buffer);
+    return Symbols::FromUTF16(orig_buffer, len_sum);
+  }
 }
 
 
 // StringType can be StringSlice, ConcatString, or {Latin1,UTF16,UTF32}Array.
 template<typename StringType>
 RawString* Symbols::NewSymbol(const StringType& str) {
-  Isolate* isolate = Isolate::Current();
-  String& symbol = String::Handle(isolate);
+  Thread* thread = Thread::Current();
+  Isolate* isolate = thread->isolate();
+  Zone* zone = thread->zone();
+  String& symbol = String::Handle(zone);
   {
     Isolate* vm_isolate = Dart::vm_isolate();
-    SymbolTable table(isolate, vm_isolate->object_store()->symbol_table());
+    SymbolTable table(zone, vm_isolate->object_store()->symbol_table());
     symbol ^= table.GetOrNull(str);
     table.Release();
   }
   if (symbol.IsNull()) {
-    SymbolTable table(isolate, isolate->object_store()->symbol_table());
+    SymbolTable table(zone, isolate->object_store()->symbol_table());
     symbol ^= table.InsertNewOrGet(str);
     isolate->object_store()->set_symbol_table(table.Release());
   }
@@ -405,6 +492,41 @@
 }
 
 
+template<typename StringType>
+RawString* Symbols::Lookup(const StringType& str) {
+  Thread* thread = Thread::Current();
+  Isolate* isolate = thread->isolate();
+  Zone* zone = thread->zone();
+  String& symbol = String::Handle(zone);
+  {
+    Isolate* vm_isolate = Dart::vm_isolate();
+    SymbolTable table(zone, vm_isolate->object_store()->symbol_table());
+    symbol ^= table.GetOrNull(str);
+    table.Release();
+  }
+  if (symbol.IsNull()) {
+    SymbolTable table(zone, isolate->object_store()->symbol_table());
+    symbol ^= table.GetOrNull(str);
+    table.Release();
+  }
+
+  ASSERT(symbol.IsNull() || symbol.IsSymbol());
+  ASSERT(symbol.IsNull() || symbol.HasHash());
+  return symbol.raw();
+}
+
+
+RawString* Symbols::LookupFromConcat(const String& str1, const String& str2) {
+  if (str1.Length() == 0) {
+    return Lookup(str2);
+  } else if (str2.Length() == 0) {
+    return Lookup(str1);
+  } else {
+    return Lookup(ConcatString(str1, str2));
+  }
+}
+
+
 RawString* Symbols::New(const String& str) {
   if (str.IsSymbol()) {
     return str.raw();
@@ -418,6 +540,31 @@
 }
 
 
+
+RawString* Symbols::NewFormatted(const char* format, ...) {
+  va_list args;
+  va_start(args, format);
+  RawString* result = NewFormattedV(format, args);
+  NoSafepointScope no_safepoint;
+  va_end(args);
+  return result;
+}
+
+
+RawString* Symbols::NewFormattedV(const char* format, va_list args) {
+  va_list args_copy;
+  va_copy(args_copy, args);
+  intptr_t len = OS::VSNPrint(NULL, 0, format, args_copy);
+  va_end(args_copy);
+
+  Zone* zone = Thread::Current()->zone();
+  char* buffer = zone->Alloc<char>(len + 1);
+  OS::VSNPrint(buffer, (len + 1), format, args);
+
+  return Symbols::New(buffer);
+}
+
+
 RawString* Symbols::FromCharCode(int32_t char_code) {
   if (char_code > kMaxOneCharCodeSymbol) {
     return FromUTF32(&char_code, 1);
diff --git a/runtime/vm/symbols.h b/runtime/vm/symbols.h
index 2cdaf9e..d59ea20a 100644
--- a/runtime/vm/symbols.h
+++ b/runtime/vm/symbols.h
@@ -5,6 +5,7 @@
 #ifndef VM_SYMBOLS_H_
 #define VM_SYMBOLS_H_
 
+#include "vm/growable_array.h"
 #include "vm/object.h"
 #include "vm/snapshot_ids.h"
 
@@ -103,12 +104,18 @@
   V(YieldKw, "yield")                                                          \
   V(AsyncCompleter, ":async_completer")                                        \
   V(AsyncOperation, ":async_op")                                               \
+  V(AsyncThenCallback, ":async_op_then")                                       \
+  V(AsyncCatchErrorCallback, ":async_op_catch_error")                          \
   V(AsyncOperationParam, ":async_result")                                      \
   V(AsyncOperationErrorParam, ":async_error_param")                            \
   V(AsyncOperationStackTraceParam, ":async_stack_trace_param")                 \
   V(AsyncSavedTryCtxVarPrefix, ":async_saved_try_ctx_var_")                    \
   V(AsyncCatchHelper, "_asyncCatchHelper")                                     \
+  V(AsyncThenWrapperHelper, "_asyncThenWrapperHelper")                         \
+  V(AsyncErrorWrapperHelper, "_asyncErrorWrapperHelper")                       \
+  V(AsyncAwaitHelper, "_awaitHelper")                                          \
   V(Await, "await")                                                            \
+  V(AwaitTempVarPrefix, ":await_temp_var_")                                    \
   V(AwaitContextVar, ":await_ctx_var")                                         \
   V(AwaitJumpVar, ":await_jump_var")                                           \
   V(Future, "Future")                                                          \
@@ -119,7 +126,7 @@
   V(Completer, "Completer")                                                    \
   V(CompleterComplete, "complete")                                             \
   V(CompleterCompleteError, "completeError")                                   \
-  V(CompleterConstructor, "Completer.")                                        \
+  V(CompleterSyncConstructor, "Completer.sync")                                \
   V(CompleterFuture, "future")                                                 \
   V(StreamIterator, "StreamIterator")                                          \
   V(StreamIteratorConstructor, "StreamIterator.")                              \
@@ -291,6 +298,7 @@
   V(RangeError, "RangeError")                                                  \
   V(DotRange, ".range")                                                        \
   V(ArgumentError, "ArgumentError")                                            \
+  V(DotValue, ".value")                                                        \
   V(FormatException, "FormatException")                                        \
   V(UnsupportedError, "UnsupportedError")                                      \
   V(StackOverflowError, "StackOverflowError")                                  \
@@ -319,6 +327,7 @@
   V(_instanceOfString, "_instanceOfString")                                    \
   V(_as, "_as")                                                                \
   V(GetterPrefix, "get:")                                                      \
+  V(ClosurizePrefix, "get:#")                                                  \
   V(SetterPrefix, "set:")                                                      \
   V(InitPrefix, "init:")                                                       \
   V(_New, "_new")                                                              \
@@ -334,7 +343,7 @@
   V(DartIsolate, "dart:isolate")                                               \
   V(DartMirrors, "dart:mirrors")                                               \
   V(DartTypedData, "dart:typed_data")                                          \
-  V(DartVMService, "dart:vmservice")                                           \
+  V(DartVMService, "dart:_vmservice")                                          \
   V(DartIOLibName, "dart.io")                                                  \
   V(EvalSourceUri, "evaluate:source")                                          \
   V(_Random, "_Random")                                                        \
@@ -390,6 +399,8 @@
   V(removeLast, "removeLast")                                                  \
   V(add, "add")                                                                \
   V(ConstructorClosurePrefix, "new#")                                          \
+  V(_runExtension, "_runExtension")                                            \
+  V(_runPendingImmediateCallback, "_runPendingImmediateCallback")              \
 
 
 // Contains a list of frequently used strings in a canonicalized form. This
@@ -585,8 +596,15 @@
                         intptr_t begin_index,
                         intptr_t length);
 
+  static RawString* NewFormatted(const char* format, ...)
+      PRINTF_ATTRIBUTE(1, 2);
+  static RawString* NewFormattedV(const char* format, va_list args);
+
   static RawString* FromConcat(const String& str1, const String& str2);
 
+  static RawString* FromConcatAll(
+      const GrowableHandlePtrArray<const String>& strs);
+
   // Returns char* of predefined symbol.
   static const char* Name(SymbolId symbol);
 
@@ -598,6 +616,13 @@
 
   static void DumpStats();
 
+  // Returns Symbol::Null if no symbol is found.
+  template<typename StringType>
+  static RawString* Lookup(const StringType& str);
+
+  // Returns Symbol::Null if no symbol is found.
+  static RawString* LookupFromConcat(const String& str1, const String& str2);
+
  private:
   enum {
     kInitialVMIsolateSymtabSize = 1024,
diff --git a/runtime/vm/tags.cc b/runtime/vm/tags.cc
index ffd224f..0a82be3 100644
--- a/runtime/vm/tags.cc
+++ b/runtime/vm/tags.cc
@@ -81,19 +81,19 @@
 };
 
 
-VMTagScope::VMTagScope(Isolate* base_isolate, uword tag, bool conditional_set)
-    : StackResource(base_isolate) {
+VMTagScope::VMTagScope(Thread* thread, uword tag, bool conditional_set)
+    : StackResource(thread) {
   ASSERT(isolate() != NULL);
-  previous_tag_ = isolate()->vm_tag();
+  previous_tag_ = thread->vm_tag();
   if (conditional_set) {
-    isolate()->set_vm_tag(tag);
+    thread->set_vm_tag(tag);
   }
 }
 
 
 VMTagScope::~VMTagScope() {
   ASSERT(isolate() != NULL);
-  isolate()->set_vm_tag(previous_tag_);
+  thread()->set_vm_tag(previous_tag_);
 }
 
 
@@ -145,11 +145,11 @@
 const char* UserTags::TagName(uword tag_id) {
   ASSERT(tag_id >= kUserTagIdOffset);
   ASSERT(tag_id < kUserTagIdOffset + kMaxUserTags);
-  Isolate* isolate = Isolate::Current();
+  Zone* zone = Thread::Current()->zone();
   const UserTag& tag =
-      UserTag::Handle(isolate, UserTag::FindTagById(tag_id));
+      UserTag::Handle(zone, UserTag::FindTagById(tag_id));
   ASSERT(!tag.IsNull());
-  const String& label = String::Handle(isolate, tag.label());
+  const String& label = String::Handle(zone, tag.label());
   return label.ToCString();
 }
 
diff --git a/runtime/vm/tags.h b/runtime/vm/tags.h
index 6b16be3..926aed8 100644
--- a/runtime/vm/tags.h
+++ b/runtime/vm/tags.h
@@ -41,9 +41,13 @@
     VM_TAG_LIST(DEFINE_VM_TAG_ID)
 #undef DEFINE_VM_TAG_KIND
     kNumVMTags,
+    //
+    // All tags below |kNumVMTags| are special meta-data tags and do not
+    // indicate the state of the VM during a sample.
+    //
     kRootTagId,       // Special tag used as root of all profiles.
     kTruncatedTagId,  // Special tag used to indicate a truncated call stack.
-    // ProfileInfo tags.
+    // Code transition tags (used by unit tests).
     kNoneCodeTagId,
     kOptimizedCodeTagId,
     kUnoptimizedCodeTagId,
@@ -75,7 +79,7 @@
 
 class VMTagScope : StackResource {
  public:
-  VMTagScope(Isolate* isolate, uword tag, bool conditional_set = true);
+  VMTagScope(Thread* thread, uword tag, bool conditional_set = true);
   ~VMTagScope();
  private:
   uword previous_tag_;
diff --git a/runtime/vm/thread.cc b/runtime/vm/thread.cc
index 09a0774..46da230 100644
--- a/runtime/vm/thread.cc
+++ b/runtime/vm/thread.cc
@@ -7,10 +7,14 @@
 #include "vm/growable_array.h"
 #include "vm/isolate.h"
 #include "vm/lockers.h"
+#include "vm/log.h"
+#include "vm/native_entry.h"
 #include "vm/object.h"
 #include "vm/os_thread.h"
 #include "vm/profiler.h"
+#include "vm/runtime_entry.h"
 #include "vm/stub_code.h"
+#include "vm/symbols.h"
 #include "vm/thread_interrupter.h"
 #include "vm/thread_registry.h"
 
@@ -18,9 +22,9 @@
 
 // The single thread local key which stores all the thread local data
 // for a thread.
-// TODO(koda): Can we merge this with ThreadInterrupter::thread_state_key_?
 ThreadLocalKey Thread::thread_key_ = OSThread::kUnsetThreadLocalKey;
-
+Thread* Thread::thread_list_head_ = NULL;
+Mutex* Thread::thread_list_lock_ = NULL;
 
 // Remove |thread| from each isolate's thread registry.
 class ThreadPruner : public IsolateVisitor {
@@ -40,21 +44,92 @@
 };
 
 
+void Thread::AddThreadToList(Thread* thread) {
+  ASSERT(thread != NULL);
+  ASSERT(thread->isolate() == NULL);
+  ASSERT(thread_list_lock_ != NULL);
+  MutexLocker ml(thread_list_lock_);
+
+  ASSERT(thread->thread_list_next_ == NULL);
+
+#if defined(DEBUG)
+  {
+    // Ensure that we aren't already in the list.
+    Thread* current = thread_list_head_;
+    while (current != NULL) {
+      ASSERT(current != thread);
+      current = current->thread_list_next_;
+    }
+  }
+#endif
+
+  // Insert at head of list.
+  thread->thread_list_next_ = thread_list_head_;
+  thread_list_head_ = thread;
+}
+
+
+void Thread::RemoveThreadFromList(Thread* thread) {
+  ASSERT(thread != NULL);
+  ASSERT(thread->isolate() == NULL);
+  ASSERT(thread_list_lock_ != NULL);
+  MutexLocker ml(thread_list_lock_);
+
+  // Handle case where |thread| is head of list.
+  if (thread_list_head_ == thread) {
+    thread_list_head_ = thread->thread_list_next_;
+    thread->thread_list_next_ = NULL;
+    return;
+  }
+
+  Thread* current = thread_list_head_;
+  Thread* previous = NULL;
+
+  // Scan across list and remove |thread|.
+  while (current != NULL) {
+    previous = current;
+    current = current->thread_list_next_;
+    if (current == thread) {
+      // We found |thread|, remove from list.
+      previous->thread_list_next_ = current->thread_list_next_;
+      thread->thread_list_next_ = NULL;
+      return;
+    }
+  }
+
+  UNREACHABLE();
+}
+
+
 static void DeleteThread(void* thread) {
   delete reinterpret_cast<Thread*>(thread);
 }
 
 
+void Thread::Shutdown() {
+  if (thread_list_lock_ != NULL) {
+    delete thread_list_lock_;
+    thread_list_lock_ = NULL;
+  }
+}
+
+
 Thread::~Thread() {
   // We should cleanly exit any isolate before destruction.
   ASSERT(isolate_ == NULL);
   // Clear |this| from all isolate's thread registry.
   ThreadPruner pruner(this);
   Isolate::VisitIsolates(&pruner);
+  delete log_;
+  log_ = NULL;
+  RemoveThreadFromList(this);
 }
 
 
 void Thread::InitOnceBeforeIsolate() {
+  ASSERT(thread_list_lock_ == NULL);
+  thread_list_lock_ = new Mutex();
+  ASSERT(thread_list_lock_ != NULL);
   ASSERT(thread_key_ == OSThread::kUnsetThreadLocalKey);
   thread_key_ = OSThread::CreateThreadLocal(DeleteThread);
   ASSERT(thread_key_ != OSThread::kUnsetThreadLocalKey);
@@ -94,12 +169,22 @@
 void Thread::CleanUp() {
   Thread* current = Current();
   if (current != NULL) {
+    SetCurrent(NULL);
     delete current;
   }
-  SetCurrent(NULL);
 }
 #endif
 
+#if defined(DEBUG)
+#define REUSABLE_HANDLE_SCOPE_INIT(object)                                     \
+  reusable_##object##_handle_scope_active_(false),
+#else
+#define REUSABLE_HANDLE_SCOPE_INIT(object)
+#endif  // defined(DEBUG)
+
+#define REUSABLE_HANDLE_INITIALIZERS(object)                                   \
+  object##_handle_(NULL),
+
 
 Thread::Thread(bool init_vm_constants)
     : id_(OSThread::GetCurrentThreadId()),
@@ -107,16 +192,38 @@
       thread_interrupt_data_(NULL),
       isolate_(NULL),
       heap_(NULL),
-      store_buffer_block_(NULL) {
+      store_buffer_block_(NULL),
+      log_(new class Log()),
+      deopt_id_(0),
+      vm_tag_(0),
+      REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_INITIALIZERS)
+      REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_SCOPE_INIT)
+      reusable_handles_(),
+      cha_(NULL),
+      no_callback_scope_depth_(0),
+      thread_list_next_(NULL) {
   ClearState();
+
 #define DEFAULT_INIT(type_name, member_name, init_expr, default_init_value)    \
   member_name = default_init_value;
 CACHED_CONSTANTS_LIST(DEFAULT_INIT)
 #undef 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)
+#undef DEFAULT_INIT
+
   if (init_vm_constants) {
     InitVMConstants();
   }
   SetCurrent(this);
+  AddThreadToList(this);
 }
 
 
@@ -131,22 +238,40 @@
   member_name = (init_expr);
 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)
+#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)
+#undef INIT_VALUE
+
+  // Setup the thread specific reusable handles.
+#define REUSABLE_HANDLE_ALLOCATION(object)                                     \
+  this->object##_handle_ = this->AllocateReusableHandle<object>();
+  REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_ALLOCATION)
+#undef REUSABLE_HANDLE_ALLOCATION
 }
 
 
-void Thread::Schedule(Isolate* isolate) {
+void Thread::Schedule(Isolate* isolate, bool bypass_safepoint) {
   State st;
-  if (isolate->thread_registry()->RestoreStateTo(this, &st)) {
+  if (isolate->thread_registry()->RestoreStateTo(this, &st, bypass_safepoint)) {
     ASSERT(isolate->thread_registry()->Contains(this));
     state_ = st;
   }
 }
 
 
-void Thread::Unschedule() {
+void Thread::Unschedule(bool bypass_safepoint) {
   ThreadRegistry* reg = isolate_->thread_registry();
   ASSERT(reg->Contains(this));
-  reg->SaveStateFrom(this, state_);
+  reg->SaveStateFrom(this, state_, bypass_safepoint);
   ClearState();
 }
 
@@ -158,9 +283,9 @@
   ASSERT(!isolate->HasMutatorThread());
   thread->isolate_ = isolate;
   isolate->MakeCurrentThreadMutator(thread);
-  isolate->set_vm_tag(VMTag::kVMTagId);
+  thread->set_vm_tag(VMTag::kVMTagId);
   ASSERT(thread->store_buffer_block_ == NULL);
-  thread->store_buffer_block_ = isolate->store_buffer()->PopBlock();
+  thread->StoreBufferAcquire();
   ASSERT(isolate->heap() != NULL);
   thread->heap_ = isolate->heap();
   thread->Schedule(isolate);
@@ -173,16 +298,20 @@
   Thread* thread = Thread::Current();
   // TODO(koda): Audit callers; they should know whether they're in an isolate.
   if (thread == NULL || thread->isolate() == NULL) return;
+#if defined(DEBUG)
+  ASSERT(!thread->IsAnyReusableHandleScopeActive());
+#endif  // DEBUG
+  // Clear since GC will not visit the thread once it is unscheduled.
+  thread->ClearReusableHandles();
   Isolate* isolate = thread->isolate();
   Profiler::EndExecution(isolate);
   thread->Unschedule();
-  StoreBufferBlock* block = thread->store_buffer_block_;
-  thread->store_buffer_block_ = NULL;
-  isolate->store_buffer()->PushBlock(block);
+  // TODO(koda): Move store_buffer_block_ into State.
+  thread->StoreBufferRelease();
   if (isolate->is_runnable()) {
-    isolate->set_vm_tag(VMTag::kIdleTagId);
+    thread->set_vm_tag(VMTag::kIdleTagId);
   } else {
-    isolate->set_vm_tag(VMTag::kLoadWaitTagId);
+    thread->set_vm_tag(VMTag::kLoadWaitTagId);
   }
   isolate->ClearMutatorThread();
   thread->isolate_ = NULL;
@@ -191,58 +320,62 @@
 }
 
 
-void Thread::EnterIsolateAsHelper(Isolate* isolate) {
+void Thread::EnterIsolateAsHelper(Isolate* isolate, bool bypass_safepoint) {
   Thread* thread = Thread::Current();
   ASSERT(thread != NULL);
   ASSERT(thread->isolate() == NULL);
   thread->isolate_ = isolate;
+  ASSERT(thread->store_buffer_block_ == NULL);
+  // TODO(koda): Use StoreBufferAcquire once we properly flush before Scavenge.
+  thread->store_buffer_block_ =
+      thread->isolate()->store_buffer()->PopEmptyBlock();
   ASSERT(isolate->heap() != NULL);
   thread->heap_ = isolate->heap();
+  ASSERT(thread->thread_interrupt_callback_ == NULL);
+  ASSERT(thread->thread_interrupt_data_ == NULL);
   // Do not update isolate->mutator_thread, but perform sanity check:
   // this thread should not be both the main mutator and helper.
   ASSERT(!isolate->MutatorThreadIsCurrentThread());
-  thread->Schedule(isolate);
+  thread->Schedule(isolate, bypass_safepoint);
 }
 
 
-void Thread::ExitIsolateAsHelper() {
+void Thread::ExitIsolateAsHelper(bool bypass_safepoint) {
   Thread* thread = Thread::Current();
-  // If the helper thread chose to use the store buffer, check that it has
-  // already been flushed manually.
-  ASSERT(thread->store_buffer_block_ == NULL);
   Isolate* isolate = thread->isolate();
   ASSERT(isolate != NULL);
-  thread->Unschedule();
+  thread->Unschedule(bypass_safepoint);
+  // TODO(koda): Move store_buffer_block_ into State.
+  thread->StoreBufferRelease();
   thread->isolate_ = NULL;
   thread->heap_ = NULL;
   ASSERT(!isolate->MutatorThreadIsCurrentThread());
 }
 
 
+// TODO(koda): Make non-static and invoke in SafepointThreads.
 void Thread::PrepareForGC() {
   Thread* thread = Thread::Current();
-  StoreBuffer* sb = thread->isolate()->store_buffer();
-  StoreBufferBlock* block = thread->store_buffer_block_;
-  thread->store_buffer_block_ = NULL;
-  const bool kCheckThreshold = false;  // Prevent scheduling another GC.
-  sb->PushBlock(block, kCheckThreshold);
-  thread->store_buffer_block_ = sb->PopEmptyBlock();
+  // Prevent scheduling another GC.
+  thread->StoreBufferRelease(StoreBuffer::kIgnoreThreshold);
+  // Make sure to get an *empty* block; the isolate needs all entries
+  // at GC time.
+  // TODO(koda): Replace with an epilogue (PrepareAfterGC) that acquires.
+  thread->store_buffer_block_ =
+      thread->isolate()->store_buffer()->PopEmptyBlock();
 }
 
 
-void Thread::StoreBufferBlockProcess(bool check_threshold) {
-  StoreBuffer* sb = isolate()->store_buffer();
-  StoreBufferBlock* block = store_buffer_block_;
-  store_buffer_block_ = NULL;
-  sb->PushBlock(block, check_threshold);
-  store_buffer_block_ = sb->PopBlock();
+void Thread::StoreBufferBlockProcess(StoreBuffer::ThresholdPolicy policy) {
+  StoreBufferRelease(policy);
+  StoreBufferAcquire();
 }
 
 
 void Thread::StoreBufferAddObject(RawObject* obj) {
   store_buffer_block_->Push(obj);
   if (store_buffer_block_->IsFull()) {
-    StoreBufferBlockProcess(true);
+    StoreBufferBlockProcess(StoreBuffer::kCheckThreshold);
   }
 }
 
@@ -250,20 +383,61 @@
 void Thread::StoreBufferAddObjectGC(RawObject* obj) {
   store_buffer_block_->Push(obj);
   if (store_buffer_block_->IsFull()) {
-    StoreBufferBlockProcess(false);
+    StoreBufferBlockProcess(StoreBuffer::kIgnoreThreshold);
   }
 }
 
 
+void Thread::StoreBufferRelease(StoreBuffer::ThresholdPolicy policy) {
+  StoreBufferBlock* block = store_buffer_block_;
+  store_buffer_block_ = NULL;
+  isolate_->store_buffer()->PushBlock(block, policy);
+}
+
+
+void Thread::StoreBufferAcquire() {
+  store_buffer_block_ = isolate()->store_buffer()->PopNonFullBlock();
+}
+
+
 CHA* Thread::cha() const {
   ASSERT(isolate_ != NULL);
-  return isolate_->cha_;
+  return cha_;
 }
 
 
 void Thread::set_cha(CHA* value) {
   ASSERT(isolate_ != NULL);
-  isolate_->cha_ = value;
+  cha_ = value;
+}
+
+
+Log* Thread::log() const {
+  return log_;
+}
+
+
+template<class C>
+C* Thread::AllocateReusableHandle() {
+  C* handle = reinterpret_cast<C*>(reusable_handles_.AllocateScopedHandle());
+  C::initializeHandle(handle, C::null());
+  return handle;
+}
+
+
+void Thread::ClearReusableHandles() {
+#define CLEAR_REUSABLE_HANDLE(object)                                          \
+  *object##_handle_ = object::null();
+  REUSABLE_HANDLE_LIST(CLEAR_REUSABLE_HANDLE)
+#undef CLEAR_REUSABLE_HANDLE
+}
+
+
+void Thread::VisitObjectPointers(ObjectPointerVisitor* visitor) {
+  ASSERT(visitor != NULL);
+
+  // Visit objects in thread specific handles area.
+  reusable_handles_.VisitObjectPointers(visitor);
 }
 
 
@@ -312,4 +486,56 @@
   return -1;
 }
 
+
+intptr_t Thread::OffsetFromThread(const RuntimeEntry* runtime_entry) {
+#define COMPUTE_OFFSET(name)                                                   \
+  if (runtime_entry->function() == k##name##RuntimeEntry.function())         { \
+    return Thread::name##_entry_point_offset();                                \
+  }
+RUNTIME_ENTRY_LIST(COMPUTE_OFFSET)
+#undef COMPUTE_OFFSET
+
+#define COMPUTE_OFFSET(returntype, name, ...)                                  \
+  if (runtime_entry->function() == k##name##RuntimeEntry.function())         { \
+    return Thread::name##_entry_point_offset();                                \
+  }
+LEAF_RUNTIME_ENTRY_LIST(COMPUTE_OFFSET)
+#undef COMPUTE_OFFSET
+
+  UNREACHABLE();
+  return -1;
+}
+
+
+ThreadIterator::ThreadIterator() {
+  ASSERT(Thread::thread_list_lock_ != NULL);
+  // Lock the thread list while iterating.
+  Thread::thread_list_lock_->Lock();
+  next_ = Thread::thread_list_head_;
+}
+
+
+ThreadIterator::~ThreadIterator() {
+  ASSERT(Thread::thread_list_lock_ != NULL);
+  // Unlock the thread list when done.
+  Thread::thread_list_lock_->Unlock();
+}
+
+
+bool ThreadIterator::HasNext() const {
+  ASSERT(Thread::thread_list_lock_ != NULL);
+  ASSERT(Thread::thread_list_lock_->IsOwnedByCurrentThread());
+  return next_ != NULL;
+}
+
+
+Thread* ThreadIterator::Next() {
+  ASSERT(Thread::thread_list_lock_ != NULL);
+  ASSERT(Thread::thread_list_lock_->IsOwnedByCurrentThread());
+  Thread* current = next_;
+  next_ = next_->thread_list_next_;
+  return current;
+}
+
+
 }  // namespace dart
diff --git a/runtime/vm/thread.h b/runtime/vm/thread.h
index 557b862..210fef1 100644
--- a/runtime/vm/thread.h
+++ b/runtime/vm/thread.h
@@ -6,35 +6,89 @@
 #define VM_THREAD_H_
 
 #include "vm/globals.h"
+#include "vm/handles.h"
 #include "vm/os_thread.h"
 #include "vm/store_buffer.h"
+#include "vm/runtime_entry_list.h"
 
 namespace dart {
 
+class AbstractType;
+class Array;
 class CHA;
+class Class;
+class Code;
+class Error;
+class ExceptionHandlers;
+class Field;
+class Function;
+class GrowableObjectArray;
 class HandleScope;
 class Heap;
+class Instance;
 class Isolate;
+class Library;
+class Log;
+class LongJumpScope;
 class Object;
+class PcDescriptors;
 class RawBool;
 class RawObject;
+class RawCode;
+class RawString;
+class RuntimeEntry;
 class StackResource;
+class String;
+class TimelineEventBlock;
+class TypeArguments;
+class TypeParameter;
 class Zone;
 
+#define REUSABLE_HANDLE_LIST(V)                                                \
+  V(AbstractType)                                                              \
+  V(Array)                                                                     \
+  V(Class)                                                                     \
+  V(Code)                                                                      \
+  V(Error)                                                                     \
+  V(ExceptionHandlers)                                                         \
+  V(Field)                                                                     \
+  V(Function)                                                                  \
+  V(GrowableObjectArray)                                                       \
+  V(Instance)                                                                  \
+  V(Library)                                                                   \
+  V(Object)                                                                    \
+  V(PcDescriptors)                                                             \
+  V(String)                                                                    \
+  V(TypeArguments)                                                             \
+  V(TypeParameter)                                                             \
+
 
 // List of VM-global objects/addresses cached in each Thread object.
 #define CACHED_VM_OBJECTS_LIST(V)                                              \
   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)                   \
+  V(RawCode*, update_store_buffer_code_,                                       \
+    StubCode::UpdateStoreBuffer_entry()->code(), NULL)                         \
+  V(RawCode*, fix_callers_target_code_,                                        \
+    StubCode::FixCallersTarget_entry()->code(), NULL)                          \
+  V(RawCode*, fix_allocation_stub_code_,                                       \
+    StubCode::FixAllocationStubTarget_entry()->code(), NULL)                   \
+  V(RawCode*, invoke_dart_code_stub_,                                          \
+    StubCode::InvokeDartCode_entry()->code(), NULL)                            \
+
 
 #define CACHED_ADDRESSES_LIST(V)                                               \
   V(uword, update_store_buffer_entry_point_,                                   \
-    StubCode::UpdateStoreBuffer_entry()->EntryPoint(), 0)
+    StubCode::UpdateStoreBuffer_entry()->EntryPoint(), 0)                      \
+  V(uword, native_call_wrapper_entry_point_,                                   \
+    NativeEntry::NativeCallWrapperEntry(), 0)                                  \
+  V(RawString**, predefined_symbols_address_,                                  \
+    Symbols::PredefinedAddress(), NULL)                                        \
 
 #define CACHED_CONSTANTS_LIST(V)                                               \
   CACHED_VM_OBJECTS_LIST(V)                                                    \
-  CACHED_ADDRESSES_LIST(V)
+  CACHED_ADDRESSES_LIST(V)                                                     \
 
 struct InterruptedThreadState {
   ThreadId tid;
@@ -81,8 +135,9 @@
   // "helper" to gain limited concurrent access to the isolate. One example is
   // SweeperTask (which uses the class table, which is copy-on-write).
   // TODO(koda): Properly synchronize heap access to expand allowed operations.
-  static void EnterIsolateAsHelper(Isolate* isolate);
-  static void ExitIsolateAsHelper();
+  static void EnterIsolateAsHelper(Isolate* isolate,
+                                   bool bypass_safepoint = false);
+  static void ExitIsolateAsHelper(bool bypass_safepoint = false);
 
   // Called when the current thread transitions from mutator to collector.
   // Empties the store buffer block into the isolate.
@@ -98,6 +153,8 @@
   static void InitOnceBeforeIsolate();
   static void InitOnceAfterObjectAndStubCode();
 
+  // Called at VM shutdown
+  static void Shutdown();
   ~Thread();
 
   // The topmost zone used for allocation in this thread.
@@ -109,11 +166,24 @@
     return OFFSET_OF(Thread, isolate_);
   }
 
-  // The (topmost) CHA for the compilation in the isolate of this thread.
-  // TODO(23153): Move this out of Isolate/Thread.
+  // The (topmost) CHA for the compilation in this thread.
   CHA* cha() const;
   void set_cha(CHA* value);
 
+  int32_t no_callback_scope_depth() const {
+    return no_callback_scope_depth_;
+  }
+
+  void IncrementNoCallbackScopeDepth() {
+    ASSERT(no_callback_scope_depth_ < INT_MAX);
+    no_callback_scope_depth_ += 1;
+  }
+
+  void DecrementNoCallbackScopeDepth() {
+    ASSERT(no_callback_scope_depth_ > 0);
+    no_callback_scope_depth_ -= 1;
+  }
+
   void StoreBufferAddObject(RawObject* obj);
   void StoreBufferAddObjectGC(RawObject* obj);
 #if defined(TESTING)
@@ -121,7 +191,7 @@
     return store_buffer_block_->Contains(obj);
   }
 #endif
-  void StoreBufferBlockProcess(bool check_threshold);
+  void StoreBufferBlockProcess(StoreBuffer::ThresholdPolicy policy);
   static intptr_t store_buffer_block_offset() {
     return OFFSET_OF(Thread, store_buffer_block_);
   }
@@ -207,6 +277,8 @@
     Zone* zone;
     uword top_exit_frame_info;
     StackResource* top_resource;
+    TimelineEventBlock* timeline_block;
+    LongJumpScope* long_jump_base;
 #if defined(DEBUG)
     HandleScope* top_handle_scope;
     intptr_t no_handle_scope_depth;
@@ -221,8 +293,83 @@
 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)
+#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)
+#undef DEFINE_OFFSET_METHOD
+
   static bool CanLoadFromThread(const Object& object);
   static intptr_t OffsetFromThread(const Object& object);
+  static intptr_t OffsetFromThread(const RuntimeEntry* runtime_entry);
+
+  Mutex* timeline_block_lock() {
+    return &timeline_block_lock_;
+  }
+
+  // Only safe to access when holding |timeline_block_lock_|.
+  TimelineEventBlock* timeline_block() const {
+    return state_.timeline_block;
+  }
+
+  // Only safe to access when holding |timeline_block_lock_|.
+  void set_timeline_block(TimelineEventBlock* block) {
+    state_.timeline_block = block;
+  }
+
+  class Log* log() const;
+
+  static const intptr_t kNoDeoptId = -1;
+  static const intptr_t kDeoptIdStep = 2;
+  static const intptr_t kDeoptIdBeforeOffset = 0;
+  static const intptr_t kDeoptIdAfterOffset = 1;
+  intptr_t deopt_id() const { return deopt_id_; }
+  void set_deopt_id(int value) {
+    ASSERT(value >= 0);
+    deopt_id_ = value;
+  }
+  intptr_t GetNextDeoptId() {
+    ASSERT(deopt_id_ != kNoDeoptId);
+    const intptr_t id = deopt_id_;
+    deopt_id_ += kDeoptIdStep;
+    return id;
+  }
+
+  static intptr_t ToDeoptAfter(intptr_t deopt_id) {
+    ASSERT(IsDeoptBefore(deopt_id));
+    return deopt_id + kDeoptIdAfterOffset;
+  }
+
+  static bool IsDeoptBefore(intptr_t deopt_id) {
+    return (deopt_id % kDeoptIdStep) == kDeoptIdBeforeOffset;
+  }
+
+  static bool IsDeoptAfter(intptr_t deopt_id) {
+    return (deopt_id % kDeoptIdStep) == kDeoptIdAfterOffset;
+  }
+
+  LongJumpScope* long_jump_base() const { return state_.long_jump_base; }
+  void set_long_jump_base(LongJumpScope* value) {
+    state_.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_);
+  }
 
   ThreadId id() const {
     ASSERT(id_ != OSThread::kInvalidThreadId);
@@ -234,7 +381,40 @@
   bool IsThreadInterrupterEnabled(ThreadInterruptCallback* callback,
                                   void** data) const;
 
+#if defined(DEBUG)
+#define REUSABLE_HANDLE_SCOPE_ACCESSORS(object)                                \
+  void set_reusable_##object##_handle_scope_active(bool value) {               \
+    reusable_##object##_handle_scope_active_ = value;                          \
+  }                                                                            \
+  bool reusable_##object##_handle_scope_active() const {                       \
+    return reusable_##object##_handle_scope_active_;                           \
+  }
+  REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_SCOPE_ACCESSORS)
+#undef REUSABLE_HANDLE_SCOPE_ACCESSORS
+
+  bool IsAnyReusableHandleScopeActive() const {
+#define IS_REUSABLE_HANDLE_SCOPE_ACTIVE(object)                                \
+    if (reusable_##object##_handle_scope_active_) return true;
+    REUSABLE_HANDLE_LIST(IS_REUSABLE_HANDLE_SCOPE_ACTIVE)
+    return false;
+#undef IS_REUSABLE_HANDLE_SCOPE_ACTIVE
+  }
+#endif  // defined(DEBUG)
+
+  void ClearReusableHandles();
+
+#define REUSABLE_HANDLE(object)                                                \
+  object& object##Handle() const {                                             \
+    return *object##_handle_;                                                  \
+  }
+  REUSABLE_HANDLE_LIST(REUSABLE_HANDLE)
+#undef REUSABLE_HANDLE
+
+  void VisitObjectPointers(ObjectPointerVisitor* visitor);
+
  private:
+  template<class T> T* AllocateReusableHandle();
+
   static ThreadLocalKey thread_key_;
 
   const ThreadId id_;
@@ -243,12 +423,53 @@
   Isolate* isolate_;
   Heap* heap_;
   State state_;
+  Mutex timeline_block_lock_;
   StoreBufferBlock* store_buffer_block_;
+  class Log* log_;
+  intptr_t deopt_id_;  // Compilation specific counter.
+  uword vm_tag_;
 #define DECLARE_MEMBERS(type_name, member_name, expr, default_init_value)      \
   type_name member_name;
 CACHED_CONSTANTS_LIST(DECLARE_MEMBERS)
 #undef 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)
+#undef DECLARE_MEMBERS
+
+  // Reusable handles support.
+#define REUSABLE_HANDLE_FIELDS(object)                                         \
+  object* object##_handle_;
+  REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_FIELDS)
+#undef REUSABLE_HANDLE_FIELDS
+
+#if defined(DEBUG)
+#define REUSABLE_HANDLE_SCOPE_VARIABLE(object)                                 \
+  bool reusable_##object##_handle_scope_active_;
+  REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_SCOPE_VARIABLE);
+#undef REUSABLE_HANDLE_SCOPE_VARIABLE
+#endif  // defined(DEBUG)
+
+  VMHandles reusable_handles_;
+
+  CHA* cha_;
+  int32_t no_callback_scope_depth_;
+
+  // All |Thread|s are registered in the thread list.
+  Thread* thread_list_next_;
+
+  static Thread* thread_list_head_;
+  static Mutex* thread_list_lock_;
+
+  static void AddThreadToList(Thread* thread);
+  static void RemoveThreadFromList(Thread* thread);
+
   explicit Thread(bool init_vm_constants = true);
 
   void InitVMConstants();
@@ -257,6 +478,10 @@
     memset(&state_, 0, sizeof(state_));
   }
 
+  void StoreBufferRelease(
+      StoreBuffer::ThresholdPolicy policy = StoreBuffer::kCheckThreshold);
+  void StoreBufferAcquire();
+
   void set_zone(Zone* zone) {
     state_.zone = zone;
   }
@@ -267,15 +492,42 @@
 
   static void SetCurrent(Thread* current);
 
-  void Schedule(Isolate* isolate);
-  void Unschedule();
+  void Schedule(Isolate* isolate, bool bypass_safepoint = false);
+  void Unschedule(bool bypass_safepoint = false);
+
+#define REUSABLE_FRIEND_DECLARATION(name)                                      \
+  friend class Reusable##name##HandleScope;
+REUSABLE_HANDLE_LIST(REUSABLE_FRIEND_DECLARATION)
+#undef REUSABLE_FRIEND_DECLARATION
 
   friend class ApiZone;
   friend class Isolate;
   friend class StackZone;
+  friend class ThreadIterator;
+  friend class ThreadIteratorTestHelper;
+  friend class ThreadRegistry;
+
   DISALLOW_COPY_AND_ASSIGN(Thread);
 };
 
+
+// Note that this takes the thread list lock, prohibiting threads from coming
+// on- or off-line.
+class ThreadIterator : public ValueObject {
+ public:
+  ThreadIterator();
+  ~ThreadIterator();
+
+  // Returns false when there are no more threads left.
+  bool HasNext() const;
+
+  // Returns the current thread and moves forward.
+  Thread* Next();
+
+ private:
+  Thread* next_;
+};
+
 }  // namespace dart
 
 #endif  // VM_THREAD_H_
diff --git a/runtime/vm/thread_barrier.h b/runtime/vm/thread_barrier.h
new file mode 100644
index 0000000..9cc1d97
--- /dev/null
+++ b/runtime/vm/thread_barrier.h
@@ -0,0 +1,116 @@
+// 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 VM_THREAD_BARRIER_H_
+#define VM_THREAD_BARRIER_H_
+
+#include "vm/globals.h"
+#include "vm/os_thread.h"
+#include "vm/lockers.h"
+
+namespace dart {
+
+// Thread barrier with:
+// * fixed (at construction) number n of participating threads {T1,T2,T3,...,Tn}
+// * unknown number of rounds.
+// Requirements:
+// * there is some R such that each participating thread makes
+//   R calls to Sync() followed by its one and only call to Exit().
+// Guarantees:
+// * for any two threads Ti and Tj and round number r <= R,
+//   everything done by Ti before its r'th call to Sync() happens before
+//   everything done by Tj after its r'th call to Sync().
+// Note:
+// * it's not required that the thread that constructs the barrier participates.
+//
+// Example usage with 3 threads (1 controller + 2 workers) and 3 rounds:
+//
+// T1:
+// ThreadBarrier barrier(3);
+// Dart::thread_pool()->Run(              T2:
+//     new FooTask(&barrier));            fooSetup();
+// Dart::thread_pool()->Run(              ...                T3:
+//     new BarTask(&barrier));            ...                barSetup();
+// barrier.Sync();                        barrier_->Sync();  barrier_->Sync();
+// /* Both tasks have finished setup */   ...                ...
+// prepareWorkForTasks();                 ...                ...
+// barrier.Sync();                        barrier_->Sync();  barrier_->Sync();
+// /* Idle while tasks are working */     fooWork();         barWork();
+// barrier.Sync();                        barrier_->Sync();  barrier_->Sync();
+// collectResultsFromTasks();             barrier_->Exit();  barrier_->Exit();
+// barrier.Exit();
+//
+// Note that the calls to Sync() "line up" in time, but there is no such
+// guarantee for Exit().
+//
+class ThreadBarrier {
+ public:
+  explicit ThreadBarrier(intptr_t num_threads)
+    : num_threads_(num_threads),
+      remaining_(num_threads),
+      parity_(false),
+      done_(false) {
+    ASSERT(remaining_ > 0);
+  }
+
+  void Sync() {
+    MonitorLocker ml(&monitor_);
+    ASSERT(remaining_ > 0);
+    if (--remaining_ > 0) {
+      // I'm not last to arrive; wait until next round.
+      bool old_parity = parity_;
+      while (parity_ == old_parity) {
+        ml.Wait();
+      }
+    } else {
+      // Last one to arrive initiates the next round.
+      remaining_ = num_threads_;
+      parity_ = !parity_;
+      // Tell everyone else about the new round.
+      ml.NotifyAll();
+    }
+  }
+
+  void Exit() {
+    bool last = false;
+    {
+      MonitorLocker ml(&monitor_);
+      ASSERT(remaining_ > 0);
+      last = (--remaining_ == 0);
+    }
+    if (last) {
+      // Last one to exit sets done_.
+      MonitorLocker ml(&done_monitor_);
+      ASSERT(!done_);
+      done_ = true;
+      // Tell the destructor in case it's already waiting.
+      ml.Notify();
+    }
+  }
+
+  ~ThreadBarrier() {
+    MonitorLocker ml(&done_monitor_);
+    // Wait for everyone to exit before destroying the monitors.
+    while (!done_) {
+      ml.Wait();
+    }
+    ASSERT(remaining_ == 0);
+  }
+
+ private:
+  const intptr_t num_threads_;
+
+  Monitor monitor_;
+  intptr_t remaining_;
+  bool parity_;
+
+  Monitor done_monitor_;  // TODO(koda): Try to optimize this away.
+  bool done_;
+
+  DISALLOW_COPY_AND_ASSIGN(ThreadBarrier);
+};
+
+}  // namespace dart
+
+#endif  // VM_THREAD_BARRIER_H_
diff --git a/runtime/vm/thread_barrier_test.cc b/runtime/vm/thread_barrier_test.cc
new file mode 100644
index 0000000..4517e18
--- /dev/null
+++ b/runtime/vm/thread_barrier_test.cc
@@ -0,0 +1,59 @@
+// 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.
+
+#include "platform/assert.h"
+#include "vm/random.h"
+#include "vm/thread_barrier.h"
+#include "vm/thread_pool.h"
+#include "vm/unit_test.h"
+
+namespace dart {
+
+class FuzzTask : public ThreadPool::Task {
+ public:
+  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) {
+      RandomSleep();
+      barrier_->Sync();
+    }
+    barrier_->Exit();
+  }
+
+ private:
+  void RandomSleep() {
+    int64_t ms = rng_.NextUInt32() % 4;
+    if (ms > 0) {
+      OS::Sleep(ms);
+    }
+  }
+
+  const intptr_t num_rounds_;
+  ThreadBarrier* barrier_;
+  Random rng_;
+};
+
+
+UNIT_TEST_CASE(ThreadBarrier) {
+  static const intptr_t kNumTasks = 5;
+  static const intptr_t kNumRounds = 500;
+
+  ThreadBarrier barrier(kNumTasks + 1);
+  for (intptr_t i = 0; i < kNumTasks; ++i) {
+    Dart::thread_pool()->Run(new FuzzTask(kNumRounds, &barrier, i + 1));
+  }
+  for (intptr_t i = 0; i < kNumRounds; ++i) {
+    barrier.Sync();
+  }
+  barrier.Exit();
+}
+
+}  // namespace dart
diff --git a/runtime/vm/thread_interrupter.cc b/runtime/vm/thread_interrupter.cc
index b28bf25..58c94be 100644
--- a/runtime/vm/thread_interrupter.cc
+++ b/runtime/vm/thread_interrupter.cc
@@ -51,20 +51,15 @@
 bool ThreadInterrupter::initialized_ = false;
 bool ThreadInterrupter::shutdown_ = false;
 bool ThreadInterrupter::thread_running_ = false;
-ThreadId ThreadInterrupter::interrupter_thread_id_ =
-    OSThread::kInvalidThreadId;
+ThreadJoinId ThreadInterrupter::interrupter_thread_id_ =
+    OSThread::kInvalidThreadJoinId;
 Monitor* ThreadInterrupter::monitor_ = NULL;
 intptr_t ThreadInterrupter::interrupt_period_ = 1000;
 intptr_t ThreadInterrupter::current_wait_time_ = Monitor::kNoTimeout;
-ThreadLocalKey ThreadInterrupter::thread_state_key_ =
-    OSThread::kUnsetThreadLocalKey;
 
 
 void ThreadInterrupter::InitOnce() {
   ASSERT(!initialized_);
-  ASSERT(thread_state_key_ == OSThread::kUnsetThreadLocalKey);
-  thread_state_key_ = OSThread::CreateThreadLocal();
-  ASSERT(thread_state_key_ != OSThread::kUnsetThreadLocalKey);
   monitor_ = new Monitor();
   ASSERT(monitor_ != NULL);
   initialized_ = true;
@@ -76,7 +71,7 @@
   if (FLAG_trace_thread_interrupter) {
     OS::Print("ThreadInterrupter starting up.\n");
   }
-  ASSERT(interrupter_thread_id_ == OSThread::kInvalidThreadId);
+  ASSERT(interrupter_thread_id_ == OSThread::kInvalidThreadJoinId);
   {
     MonitorLocker startup_ml(monitor_);
     OSThread::Start(ThreadMain, 0);
@@ -84,7 +79,7 @@
       startup_ml.Wait();
     }
   }
-  ASSERT(interrupter_thread_id_ != OSThread::kInvalidThreadId);
+  ASSERT(interrupter_thread_id_ != OSThread::kInvalidThreadJoinId);
   if (FLAG_trace_thread_interrupter) {
     OS::Print("ThreadInterrupter running.\n");
   }
@@ -106,24 +101,12 @@
       OS::Print("ThreadInterrupter shutting down.\n");
     }
   }
-#if defined(TARGET_OS_WINDOWS)
-  // On Windows, a thread's exit-code can leak into the process's exit-code,
-  // if exiting 'at same time' as the process ends. By joining with the thread
-  // here, we avoid this race condition.
-  ASSERT(interrupter_thread_id_ != OSThread::kInvalidThreadId);
+
+  // Join the thread.
+  ASSERT(interrupter_thread_id_ != OSThread::kInvalidThreadJoinId);
   OSThread::Join(interrupter_thread_id_);
-  interrupter_thread_id_ = OSThread::kInvalidThreadId;
-#else
-  // On non-Windows platforms, just wait for the thread interrupter to signal
-  // that it has exited the loop.
-  {
-    MonitorLocker shutdown_ml(monitor_);
-    while (thread_running_) {
-      // Wait for thread to exit.
-      shutdown_ml.Wait();
-    }
-  }
-#endif
+  interrupter_thread_id_ = OSThread::kInvalidThreadJoinId;
+
   if (FLAG_trace_thread_interrupter) {
     OS::Print("ThreadInterrupter shut down.\n");
   }
@@ -192,7 +175,7 @@
   {
     // Signal to main thread we are ready.
     MonitorLocker startup_ml(monitor_);
-    interrupter_thread_id_ = OSThread::GetCurrentThreadId();
+    interrupter_thread_id_ = OSThread::GetCurrentThreadJoinId();
     thread_running_ = true;
     startup_ml.Notify();
   }
@@ -203,6 +186,10 @@
     while (!shutdown_) {
       intptr_t r = wait_ml.WaitMicros(current_wait_time_);
 
+      if ((r == Monitor::kNotified) && shutdown_) {
+        break;
+      }
+
       if ((r == Monitor::kNotified) && InDeepSleep()) {
         // Woken up from deep sleep.
         ASSERT(visitor.profiled_thread_count() == 0);
diff --git a/runtime/vm/thread_interrupter.h b/runtime/vm/thread_interrupter.h
index 2e84b13..9d3ccab 100644
--- a/runtime/vm/thread_interrupter.h
+++ b/runtime/vm/thread_interrupter.h
@@ -40,11 +40,10 @@
   static bool initialized_;
   static bool shutdown_;
   static bool thread_running_;
-  static ThreadId interrupter_thread_id_;
+  static ThreadJoinId interrupter_thread_id_;
   static Monitor* monitor_;
   static intptr_t interrupt_period_;
   static intptr_t current_wait_time_;
-  static ThreadLocalKey thread_state_key_;
 
   static bool InDeepSleep() {
     return current_wait_time_ == Monitor::kNoTimeout;
diff --git a/runtime/vm/thread_interrupter_win.cc b/runtime/vm/thread_interrupter_win.cc
index 72220ed..70a5e8c 100644
--- a/runtime/vm/thread_interrupter_win.cc
+++ b/runtime/vm/thread_interrupter_win.cc
@@ -21,29 +21,29 @@
   static bool GrabRegisters(HANDLE handle, InterruptedThreadState* state) {
     CONTEXT context;
     memset(&context, 0, sizeof(context));
-#if defined(TARGET_ARCH_IA32)
+#if defined(HOST_ARCH_IA32)
     // On IA32, CONTEXT_CONTROL includes Eip, Ebp, and Esp.
     context.ContextFlags = CONTEXT_CONTROL;
-#elif defined(TARGET_ARCH_X64)
+#elif defined(HOST_ARCH_X64)
     // On X64, CONTEXT_CONTROL includes Rip and Rsp. Rbp is classified
     // as an "integer" register.
     context.ContextFlags = CONTEXT_CONTROL | CONTEXT_INTEGER;
 #else
-    UNIMPLEMENTED();
+#error Unsupported architecture.
 #endif
     if (GetThreadContext(handle, &context) != 0) {
-#if defined(TARGET_ARCH_IA32)
+#if defined(HOST_ARCH_IA32)
       state->pc = static_cast<uintptr_t>(context.Eip);
       state->fp = static_cast<uintptr_t>(context.Ebp);
       state->csp = static_cast<uintptr_t>(context.Esp);
       state->dsp = static_cast<uintptr_t>(context.Esp);
-#elif defined(TARGET_ARCH_X64)
+#elif defined(HOST_ARCH_X64)
       state->pc = static_cast<uintptr_t>(context.Rip);
       state->fp = static_cast<uintptr_t>(context.Rbp);
       state->csp = static_cast<uintptr_t>(context.Rsp);
       state->dsp = static_cast<uintptr_t>(context.Rsp);
 #else
-      UNIMPLEMENTED();
+#error Unsupported architecture.
 #endif
       return true;
     }
diff --git a/runtime/vm/thread_pool.cc b/runtime/vm/thread_pool.cc
index 5b3a713..e4453d8 100644
--- a/runtime/vm/thread_pool.cc
+++ b/runtime/vm/thread_pool.cc
@@ -12,9 +12,6 @@
 DEFINE_FLAG(int, worker_timeout_millis, 5000,
             "Free workers when they have been idle for this amount of time.");
 
-Monitor* ThreadPool::exit_monitor_ = NULL;
-int* ThreadPool::exit_count_ = NULL;
-
 ThreadPool::ThreadPool()
   : shutting_down_(false),
     all_workers_(NULL),
@@ -22,7 +19,9 @@
     count_started_(0),
     count_stopped_(0),
     count_running_(0),
-    count_idle_(0) {
+    count_idle_(0),
+    shutting_down_workers_(NULL),
+    join_list_(NULL) {
 }
 
 
@@ -31,7 +30,7 @@
 }
 
 
-void ThreadPool::Run(Task* task) {
+bool ThreadPool::Run(Task* task) {
   Worker* worker = NULL;
   bool new_worker = false;
   {
@@ -39,7 +38,7 @@
     // ThreadPool state.
     MutexLocker ml(&mutex_);
     if (shutting_down_) {
-      return;
+      return false;
     }
     if (idle_workers_ == NULL) {
       worker = new Worker(this);
@@ -51,15 +50,17 @@
       worker->all_next_ = all_workers_;
       all_workers_ = worker;
       worker->owned_ = true;
+      count_running_++;
     } else {
       // Get the first worker from the idle worker list.
       worker = idle_workers_;
       idle_workers_ = worker->idle_next_;
       worker->idle_next_ = NULL;
       count_idle_--;
+      count_running_++;
     }
-    count_running_++;
   }
+
   // Release ThreadPool::mutex_ before calling Worker functions.
   ASSERT(worker != NULL);
   worker->SetTask(task);
@@ -67,6 +68,7 @@
     // Call StartThread after we've assigned the first task.
     worker->StartThread();
   }
+  return true;
 }
 
 
@@ -94,15 +96,48 @@
   }
   // Release ThreadPool::mutex_ before calling Worker functions.
 
-  Worker* current = saved;
-  while (current != NULL) {
-    // We may access all_next_ without holding ThreadPool::mutex_ here
-    // because the worker is no longer owned by the ThreadPool.
-    Worker* next = current->all_next_;
-    current->all_next_ = NULL;
-    current->Shutdown();
-    current = next;
+  {
+    MonitorLocker eml(&exit_monitor_);
+
+    // First tell all the workers to shut down.
+    Worker* current = saved;
+    ThreadId id = OSThread::GetCurrentThreadId();
+    while (current != NULL) {
+      Worker* next = current->all_next_;
+      ThreadId currentId = current->id();
+      if (currentId != id) {
+        AddWorkerToShutdownList(current);
+      }
+      current->Shutdown();
+      current = next;
+    }
+    saved = NULL;
+
+    // Wait until all workers will exit.
+    while (shutting_down_workers_ != NULL) {
+      // Here, we are waiting for workers to exit. When a worker exits we will
+      // be notified.
+      eml.Wait();
+    }
   }
+
+  // Extract the join list, and join on the threads.
+  JoinList* list = NULL;
+  {
+    MutexLocker ml(&mutex_);
+    list = join_list_;
+    join_list_ = NULL;
+  }
+
+  // Join non-idle threads.
+  JoinList::Join(&list);
+
+#if defined(DEBUG)
+  {
+    MutexLocker ml(&mutex_);
+    ASSERT(join_list_ == NULL);
+  }
+#endif
 }
 
 
@@ -156,7 +191,7 @@
     all_workers_ = worker->all_next_;
     worker->all_next_ = NULL;
     worker->owned_ = false;
-    worker->pool_ = NULL;
+    worker->done_ = true;
     return true;
   }
 
@@ -174,16 +209,24 @@
 }
 
 
-void ThreadPool::SetIdle(Worker* worker) {
-  MutexLocker ml(&mutex_);
-  if (shutting_down_) {
-    return;
+void ThreadPool::SetIdleAndReapExited(Worker* worker) {
+  JoinList* list = NULL;
+  {
+    MutexLocker ml(&mutex_);
+    if (shutting_down_) {
+      return;
+    }
+    ASSERT(worker->owned_ && !IsIdle(worker));
+    worker->idle_next_ = idle_workers_;
+    idle_workers_ = worker;
+    count_idle_++;
+    count_running_--;
+
+    // While we have the lock, opportunistically grab and clear the join_list_.
+    list = join_list_;
+    join_list_ = NULL;
   }
-  ASSERT(worker->owned_ && !IsIdle(worker));
-  worker->idle_next_ = idle_workers_;
-  idle_workers_ = worker;
-  count_idle_++;
-  count_running_--;
+  JoinList::Join(&list);
 }
 
 
@@ -200,12 +243,62 @@
   bool found = RemoveWorkerFromAllList(worker);
   ASSERT(found);
 
+  // The thread for worker will exit. Add its ThreadId to the join_list_
+  // so that we can join on it at the next opportunity.
+  JoinList::AddLocked(OSThread::GetCurrentThreadJoinId(), &join_list_);
   count_stopped_++;
   count_idle_--;
   return true;
 }
 
 
+// Only call while holding the exit_monitor_
+void ThreadPool::AddWorkerToShutdownList(Worker* worker) {
+  worker->shutdown_next_ = shutting_down_workers_;
+  shutting_down_workers_ = worker;
+}
+
+
+// Only call while holding the exit_monitor_
+bool ThreadPool::RemoveWorkerFromShutdownList(Worker* worker) {
+  ASSERT(worker != NULL);
+  ASSERT(shutting_down_workers_ != NULL);
+
+  // Special case head of list.
+  if (shutting_down_workers_ == worker) {
+    shutting_down_workers_ = worker->shutdown_next_;
+    worker->shutdown_next_ = NULL;
+    return true;
+  }
+
+  for (Worker* current = shutting_down_workers_;
+       current->shutdown_next_ != NULL;
+       current = current->shutdown_next_) {
+    if (current->shutdown_next_ == worker) {
+      current->shutdown_next_ = worker->shutdown_next_;
+      worker->shutdown_next_ = NULL;
+      return true;
+    }
+  }
+  return false;
+}
+
+
+void ThreadPool::JoinList::AddLocked(ThreadJoinId id, JoinList** list) {
+  *list = new JoinList(id, *list);
+}
+
+
+void ThreadPool::JoinList::Join(JoinList** list) {
+  while (*list != NULL) {
+    JoinList* current = *list;
+    *list = current->next();
+    OSThread::Join(current->id());
+    delete current;
+  }
+}
+
+
 ThreadPool::Task::Task() {
 }
 
@@ -217,9 +310,18 @@
 ThreadPool::Worker::Worker(ThreadPool* pool)
   : pool_(pool),
     task_(NULL),
+    id_(OSThread::kInvalidThreadId),
+    done_(false),
     owned_(false),
     all_next_(NULL),
-    idle_next_(NULL) {
+    idle_next_(NULL),
+    shutdown_next_(NULL) {
+}
+
+
+ThreadId ThreadPool::Worker::id() {
+  MonitorLocker ml(&monitor_);
+  return id_;
 }
 
 
@@ -264,7 +366,7 @@
 }
 
 
-void ThreadPool::Worker::Loop() {
+bool ThreadPool::Worker::Loop() {
   MonitorLocker ml(&monitor_);
   int64_t idle_start;
   while (true) {
@@ -281,10 +383,10 @@
 
     ASSERT(task_ == NULL);
     if (IsDone()) {
-      return;
+      return false;
     }
-    ASSERT(pool_ != NULL);
-    pool_->SetIdle(this);
+    ASSERT(!done_);
+    pool_->SetIdleAndReapExited(this);
     idle_start = OS::GetCurrentTimeMillis();
     while (true) {
       Monitor::WaitResult result = ml.Wait(ComputeTimeout(idle_start));
@@ -294,21 +396,21 @@
         break;
       }
       if (IsDone()) {
-        return;
+        return false;
       }
-      if (result == Monitor::kTimedOut &&
-          pool_->ReleaseIdleWorker(this)) {
-        return;
+      if ((result == Monitor::kTimedOut) && pool_->ReleaseIdleWorker(this)) {
+        return true;
       }
     }
   }
   UNREACHABLE();
+  return false;
 }
 
 
 void ThreadPool::Worker::Shutdown() {
   MonitorLocker ml(&monitor_);
-  pool_ = NULL;  // Fail fast if someone tries to access pool_.
+  done_ = true;
   ml.Notify();
 }
 
@@ -317,20 +419,58 @@
 void ThreadPool::Worker::Main(uword args) {
   Thread::EnsureInit();
   Worker* worker = reinterpret_cast<Worker*>(args);
-  worker->Loop();
+  ThreadId id = OSThread::GetCurrentThreadId();
+  ThreadJoinId join_id = OSThread::GetCurrentThreadJoinId();
+  ThreadPool* pool;
+
+  {
+    MonitorLocker ml(&worker->monitor_);
+    ASSERT(worker->task_);
+    worker->id_ = id;
+    pool = worker->pool_;
+  }
+
+  bool released = worker->Loop();
 
   // It should be okay to access these unlocked here in this assert.
-  ASSERT(!worker->owned_ &&
-         worker->all_next_ == NULL &&
-         worker->idle_next_ == NULL);
+  // worker->all_next_ is retained by the pool for shutdown monitoring.
+  ASSERT(!worker->owned_ && (worker->idle_next_ == NULL));
 
-  // The exit monitor is only used during testing.
-  if (ThreadPool::exit_monitor_) {
-    MonitorLocker ml(ThreadPool::exit_monitor_);
-    (*ThreadPool::exit_count_)++;
-    ml.Notify();
+  if (!released) {
+    // This worker is exiting because the thread pool is being shut down.
+    // Inform the thread pool that we are exiting. We remove this worker from
+    // shutting_down_workers_ list because there will be no need for the
+    // ThreadPool to take action for this worker.
+    {
+      MutexLocker ml(&pool->mutex_);
+      JoinList::AddLocked(join_id, &pool->join_list_);
+    }
+
+    // worker->id_ should never be read again, so set to invalid in debug mode
+    // for asserts.
+#if defined(DEBUG)
+    {
+      MonitorLocker ml(&worker->monitor_);
+      worker->id_ = OSThread::kInvalidThreadId;
+    }
+#endif
+
+    // Remove from the shutdown list, delete, and notify the thread pool.
+    {
+      MonitorLocker eml(&pool->exit_monitor_);
+      pool->RemoveWorkerFromShutdownList(worker);
+      delete worker;
+      eml.Notify();
+    }
+  } else {
+    // This worker is going down because it was idle for too long. This case
+    // is not due to a ThreadPool Shutdown. Thus, we simply delete the worker.
+    // The worker's id is added to the thread pool's join list by
+    // ReleaseIdleWorker, so in the case that the thread pool begins shutting
+    // down immediately after returning from worker->Loop() above, we still
+    // wait for the thread to exit by joining on it in Shutdown().
+    delete worker;
   }
-  delete worker;
 #if defined(TARGET_OS_WINDOWS)
   Thread::CleanUp();
 #endif
diff --git a/runtime/vm/thread_pool.h b/runtime/vm/thread_pool.h
index 792aef7..1713781 100644
--- a/runtime/vm/thread_pool.h
+++ b/runtime/vm/thread_pool.h
@@ -5,6 +5,7 @@
 #ifndef VM_THREAD_POOL_H_
 #define VM_THREAD_POOL_H_
 
+#include "vm/allocation.h"
 #include "vm/globals.h"
 #include "vm/os_thread.h"
 
@@ -29,12 +30,12 @@
 
   ThreadPool();
 
-  // Shuts down this thread pool.  Causes workers to terminate
+  // Shuts down this thread pool. Causes workers to terminate
   // themselves when they are active again.
   ~ThreadPool();
 
   // Runs a task on the thread pool.
-  void Run(Task* task);
+  bool Run(Task* task);
 
   // Some simple stats.
   uint64_t workers_running() const { return count_running_; }
@@ -43,8 +44,6 @@
   uint64_t workers_stopped() const { return count_stopped_; }
 
  private:
-  friend class ThreadPoolTestPeer;
-
   class Worker {
    public:
     explicit Worker(ThreadPool* pool);
@@ -56,24 +55,30 @@
     // after a task has been set by the initial call to SetTask().
     void StartThread();
 
-    // Main loop for a worker.
-    void Loop();
+    // Main loop for a worker. Returns true if worker is removed from thread
+    // lists, false otherwise.
+    bool Loop();
 
     // Causes worker to terminate eventually.
     void Shutdown();
 
+    // Get the Worker's thread id.
+    ThreadId id();
+
    private:
     friend class ThreadPool;
 
     // The main entry point for new worker threads.
     static void Main(uword args);
 
-    bool IsDone() const { return pool_ == NULL; }
+    bool IsDone() const { return done_; }
 
     // Fields owned by Worker.
     Monitor monitor_;
     ThreadPool* pool_;
     Task* task_;
+    ThreadId id_;
+    bool done_;
 
     // Fields owned by ThreadPool.  Workers should not look at these
     // directly.  It's like looking at the sun.
@@ -81,9 +86,31 @@
     Worker* all_next_;   // Protected by ThreadPool::mutex_
     Worker* idle_next_;  // Protected by ThreadPool::mutex_
 
+    Worker* shutdown_next_;  // Protected by ThreadPool::exit_monitor
+
     DISALLOW_COPY_AND_ASSIGN(Worker);
   };
 
+  class JoinList {
+   public:
+    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);
+
+    static void Join(JoinList** list);
+
+    ThreadJoinId id() const { return id_; }
+    JoinList* next() const { return next_; }
+
+   private:
+    ThreadJoinId id_;
+    JoinList* next_;
+
+    DISALLOW_COPY_AND_ASSIGN(JoinList);
+  };
+
   void Shutdown();
 
   // Expensive.  Use only in assertions.
@@ -92,8 +119,13 @@
   bool RemoveWorkerFromIdleList(Worker* worker);
   bool RemoveWorkerFromAllList(Worker* worker);
 
+  void AddWorkerToShutdownList(Worker* worker);
+  bool RemoveWorkerFromShutdownList(Worker* worker);
+
+  void ReapExitedIdleThreads();
+
   // Worker operations.
-  void SetIdle(Worker* worker);
+  void SetIdleAndReapExited(Worker* worker);
   bool ReleaseIdleWorker(Worker* worker);
 
   Mutex mutex_;
@@ -105,8 +137,9 @@
   uint64_t count_running_;
   uint64_t count_idle_;
 
-  static Monitor* exit_monitor_;  // Used only in testing.
-  static int* exit_count_;        // Used only in testing.
+  Monitor exit_monitor_;
+  Worker* shutting_down_workers_;
+  JoinList* join_list_;
 
   DISALLOW_COPY_AND_ASSIGN(ThreadPool);
 };
diff --git a/runtime/vm/thread_pool_test.cc b/runtime/vm/thread_pool_test.cc
index 35a6127..48d2125 100644
--- a/runtime/vm/thread_pool_test.cc
+++ b/runtime/vm/thread_pool_test.cc
@@ -12,18 +12,6 @@
 DECLARE_FLAG(int, worker_timeout_millis);
 
 
-class ThreadPoolTestPeer {
- public:
-  // When the pool has an exit monitor, workers notify a monitor just
-  // before they exit.  This is only used in tests to make sure that
-  // Shutdown works.
-  static void SetExitMonitor(Monitor* exit_monitor, int* exit_count) {
-    ThreadPool::exit_monitor_ = exit_monitor;
-    ThreadPool::exit_count_ = exit_count;
-  }
-};
-
-
 UNIT_TEST_CASE(ThreadPool_Create) {
   ThreadPool thread_pool;
 }
@@ -88,40 +76,73 @@
 
 class SleepTask : public ThreadPool::Task {
  public:
-  explicit SleepTask(int millis)
-      : millis_(millis) {
+  SleepTask(Monitor* sync, int* started_count, int* slept_count, int millis)
+      : sync_(sync),
+        started_count_(started_count),
+        slept_count_(slept_count),
+        millis_(millis) {
   }
 
   virtual void Run() {
+    {
+      MonitorLocker ml(sync_);
+      *started_count_ = *started_count_ + 1;
+      ml.Notify();
+    }
+    // Sleep so we can be sure the ThreadPool destructor blocks until we're
+    // done.
     OS::Sleep(millis_);
+    {
+      MonitorLocker ml(sync_);
+      *slept_count_ = *slept_count_ + 1;
+      // No notification here. The main thread is blocked in ThreadPool
+      // shutdown waiting for this thread to finish.
+    }
   }
 
  private:
+  Monitor* sync_;
+  int* started_count_;
+  int* slept_count_;
   int millis_;
 };
 
 
 UNIT_TEST_CASE(ThreadPool_WorkerShutdown) {
-  Monitor exit_sync;
-  int exit_count = 0;
-  MonitorLocker ml(&exit_sync);
+  const int kTaskCount = 10;
+  Monitor sync;
+  int slept_count = 0;
+  int started_count = 0;
 
   // Set up the ThreadPool so that workers notify before they exit.
   ThreadPool* thread_pool = new ThreadPool();
-  ThreadPoolTestPeer::SetExitMonitor(&exit_sync, &exit_count);
 
   // Run a single task.
-  thread_pool->Run(new SleepTask(2));
+  for (int i = 0; i < kTaskCount; i++) {
+    thread_pool->Run(new SleepTask(&sync, &started_count, &slept_count, 2));
+  }
 
-  // Kill the thread pool.
+  {
+    // Wait for everybody to start.
+    MonitorLocker ml(&sync);
+    while (started_count < kTaskCount) {
+      ml.Wait();
+    }
+  }
+
+  // Kill the thread pool while the workers are sleeping.
   delete thread_pool;
   thread_pool = NULL;
 
-  // Wait for the workers to terminate.
-  while (exit_count == 0) {
-    ml.Wait();
+  int final_count = 0;
+  {
+    MonitorLocker ml(&sync);
+    final_count = slept_count;
   }
-  EXPECT_EQ(1, exit_count);
+
+  // We should have waited for all the workers to finish, so they all should
+  // have had a chance to increment slept_count.
+  EXPECT_EQ(kTaskCount, final_count);
 }
 
 
@@ -172,12 +193,11 @@
 
     // 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_));
+      pool_->Run(new SpawnTask(pool_, sync_, child_todo, total_, done_));
     }
 
     {
@@ -214,5 +234,4 @@
   EXPECT_EQ(kTotalTasks, done);
 }
 
-
 }  // namespace dart
diff --git a/runtime/vm/thread_registry.cc b/runtime/vm/thread_registry.cc
index 23e22b7..44c0d13 100644
--- a/runtime/vm/thread_registry.cc
+++ b/runtime/vm/thread_registry.cc
@@ -10,6 +10,8 @@
 namespace dart {
 
 ThreadRegistry::~ThreadRegistry() {
+  ReclaimTimelineBlocks();
+  // Delete monitor.
   delete monitor_;
 }
 
@@ -65,6 +67,14 @@
   if (found_index < 0) {
     return;
   }
+  {
+    TimelineEventRecorder* recorder = Timeline::recorder();
+    if (recorder != NULL) {
+      // Cleanup entry.
+      Entry& entry_to_remove = entries_[found_index];
+      ReclaimTimelineBlockLocked(&entry_to_remove);
+    }
+  }
   if (found_index != (length - 1)) {
     // Swap with last entry.
     entries_.Swap(found_index, length - 1);
@@ -73,6 +83,41 @@
 }
 
 
+void ThreadRegistry::ReclaimTimelineBlocks() {
+  // Each thread that is scheduled in this isolate may have a cached timeline
+  // block. Mark these timeline blocks as finished.
+  MonitorLocker ml(monitor_);
+  TimelineEventRecorder* recorder = Timeline::recorder();
+  if (recorder != NULL) {
+    for (intptr_t i = 0; i < entries_.length(); i++) {
+      // NOTE: It is only safe to access |entry.state| here.
+      Entry& entry = entries_[i];
+      ReclaimTimelineBlockLocked(&entry);
+    }
+  }
+}
+
+
+void ThreadRegistry::ReclaimTimelineBlockLocked(Entry* entry) {
+  if (entry == NULL) {
+    return;
+  }
+  TimelineEventRecorder* recorder = Timeline::recorder();
+  if (!entry->scheduled && (entry->state.timeline_block != NULL)) {
+    // Currently unscheduled thread.
+    recorder->FinishBlock(entry->state.timeline_block);
+    entry->state.timeline_block = NULL;
+  } else if (entry->scheduled) {
+    // Currently scheduled thread.
+    Thread* thread = entry->thread;
+    // Take |Thread| lock.
+    MutexLocker thread_lock(thread->timeline_block_lock());
+    recorder->FinishBlock(thread->timeline_block());
+    thread->set_timeline_block(NULL);
+  }
+}
+
+
 ThreadRegistry::EntryIterator::EntryIterator(ThreadRegistry* registry)
     : index_(0),
       registry_(NULL) {
diff --git a/runtime/vm/thread_registry.h b/runtime/vm/thread_registry.h
index abe669a..90d83f0 100644
--- a/runtime/vm/thread_registry.h
+++ b/runtime/vm/thread_registry.h
@@ -9,6 +9,7 @@
 #include "vm/growable_array.h"
 #include "vm/isolate.h"
 #include "vm/lockers.h"
+#include "vm/stack_frame.h"
 #include "vm/thread.h"
 
 namespace dart {
@@ -47,10 +48,11 @@
     CheckSafepointLocked();
   }
 
-  bool RestoreStateTo(Thread* thread, Thread::State* state) {
+  bool RestoreStateTo(Thread* thread, Thread::State* state,
+                      bool bypass_safepoint) {
     MonitorLocker ml(monitor_);
     // Wait for any rendezvous in progress.
-    while (in_rendezvous_) {
+    while (!bypass_safepoint && in_rendezvous_) {
       ml.Wait(Monitor::kNoTimeout);
     }
     Entry* entry = FindEntry(thread);
@@ -82,14 +84,15 @@
     return false;
   }
 
-  void SaveStateFrom(Thread* thread, const Thread::State& state) {
+  void SaveStateFrom(Thread* thread, const Thread::State& state,
+                     bool bypass_safepoint) {
     MonitorLocker ml(monitor_);
     Entry* entry = FindEntry(thread);
     ASSERT(entry != NULL);
     ASSERT(entry->scheduled);
     entry->scheduled = false;
     entry->state = state;
-    if (in_rendezvous_) {
+    if (!bypass_safepoint && in_rendezvous_) {
       // Don't wait for this thread.
       ASSERT(remaining_ > 0);
       if (--remaining_ == 0) {
@@ -116,20 +119,39 @@
     }
   }
 
-  void VisitObjectPointers(ObjectPointerVisitor* visitor) {
+  void VisitObjectPointers(ObjectPointerVisitor* visitor,
+                           bool validate_frames) {
     MonitorLocker ml(monitor_);
     for (int i = 0; i < entries_.length(); ++i) {
       const Entry& entry = entries_[i];
-      Zone* zone = entry.scheduled ? entry.thread->zone() : entry.state.zone;
-      if (zone != NULL) {
-        zone->VisitObjectPointers(visitor);
+      const Thread::State& state =
+          entry.scheduled ? entry.thread->state_ : entry.state;
+      if (state.zone != NULL) {
+        state.zone->VisitObjectPointers(visitor);
+      }
+      if (entry.scheduled) {
+        ASSERT(entry.thread != NULL);
+        entry.thread->VisitObjectPointers(visitor);
+      }
+      // Iterate over all the stack frames and visit objects on the stack.
+      StackFrameIterator frames_iterator(state.top_exit_frame_info,
+                                         validate_frames);
+      StackFrame* frame = frames_iterator.NextFrame();
+      while (frame != NULL) {
+        frame->VisitObjectPointers(visitor);
+        frame = frames_iterator.NextFrame();
       }
     }
   }
 
   void PruneThread(Thread* thread);
 
+  void ReclaimTimelineBlocks();
+
   struct Entry {
+    // NOTE: |thread| is deleted automatically when the thread exits.
+    // In other words, it is not safe to dereference |thread| unless you are on
+    // the thread itself.
     Thread* thread;
     bool scheduled;
     Thread::State state;
@@ -166,6 +188,9 @@
     return NULL;
   }
 
+  // NOTE: Lock should be taken before this function is called.
+  void ReclaimTimelineBlockLocked(Entry* entry);
+
   // Note: Lock should be taken before this function is called.
   void CheckSafepointLocked();
 
diff --git a/runtime/vm/thread_test.cc b/runtime/vm/thread_test.cc
index 39bec07..8e78dca 100644
--- a/runtime/vm/thread_test.cc
+++ b/runtime/vm/thread_test.cc
@@ -131,12 +131,15 @@
       const intptr_t unique_smi = id_ + 928327281;
       Smi& smi = Smi::Handle(zone, Smi::New(unique_smi));
       EXPECT(smi.Value() == unique_smi);
-      ObjectCounter counter(isolate_, &smi);
-      // Ensure that our particular zone is visited.
-      // TODO(koda): Remove "->thread_registry()" after updating stack walker.
-      isolate_->thread_registry()->VisitObjectPointers(&counter);
-      EXPECT_EQ(1, counter.count());
-
+      {
+        ObjectCounter counter(isolate_, &smi);
+        // Ensure that our particular zone is visited.
+        isolate_->IterateObjectPointers(
+            &counter,
+            /* visit_prologue_weak_handles = */ true,
+            StackFrameIterator::kValidateFrames);
+        EXPECT_EQ(1, counter.count());
+      }
       char* unique_chars = zone->PrintToString("unique_str_%" Pd, id_);
       String& unique_str = String::Handle(zone);
       {
@@ -146,12 +149,16 @@
         unique_str = String::New(unique_chars, Heap::kOld);
       }
       EXPECT(unique_str.Equals(unique_chars));
-      ObjectCounter str_counter(isolate_, &unique_str);
-      // Ensure that our particular zone is visited.
-      // TODO(koda): Remove "->thread_registry()" after updating stack walker.
-      isolate_->thread_registry()->VisitObjectPointers(&str_counter);
-      // We should visit the string object exactly once.
-      EXPECT_EQ(1, str_counter.count());
+      {
+        ObjectCounter str_counter(isolate_, &unique_str);
+        // Ensure that our particular zone is visited.
+        isolate_->IterateObjectPointers(
+            &str_counter,
+            /* visit_prologue_weak_handles = */ true,
+            StackFrameIterator::kValidateFrames);
+        // We should visit the string object exactly once.
+        EXPECT_EQ(1, str_counter.count());
+      }
     }
     Thread::ExitIsolateAsHelper();
     {
@@ -272,7 +279,10 @@
         // But occasionally, organize a rendezvous.
         isolate_->thread_registry()->SafepointThreads();
         ObjectCounter counter(isolate_, &smi);
-        isolate_->thread_registry()->VisitObjectPointers(&counter);
+        isolate_->IterateObjectPointers(
+            &counter,
+            /* visit_prologue_weak_handles = */ true,
+            StackFrameIterator::kValidateFrames);
         {
           MutexLocker ml(mutex_);
           EXPECT_EQ(*expected_count_, counter.count());
@@ -348,7 +358,7 @@
 #endif  // USING_SIMULATOR
   char buffer[1024];
   OS::SNPrint(buffer, sizeof(buffer),
-      "import 'dart:profiler';\n"
+      "import 'dart:developer';\n"
       "int dummy = 0;\n"
       "main() {\n"
       "  new UserTag('foo').makeCurrent();\n"
@@ -375,7 +385,6 @@
 // organized by
 // - helpers.
 TEST_CASE(SafepointTestVM) {
-  Thread* thread = Thread::Current();
   Isolate* isolate = thread->isolate();
   Mutex mutex;
   intptr_t expected_count = 0;
@@ -398,6 +407,115 @@
 }
 
 
+TEST_CASE(ThreadIterator_Count) {
+  intptr_t thread_count_0 = 0;
+  intptr_t thread_count_1 = 0;
+
+  {
+    ThreadIterator ti;
+    while (ti.HasNext()) {
+      Thread* thread = ti.Next();
+      EXPECT(thread != NULL);
+      thread_count_0++;
+    }
+  }
+
+  {
+    ThreadIterator ti;
+    while (ti.HasNext()) {
+      Thread* thread = ti.Next();
+      EXPECT(thread != NULL);
+      thread_count_1++;
+    }
+  }
+
+  EXPECT(thread_count_0 > 0);
+  EXPECT(thread_count_1 > 0);
+  EXPECT(thread_count_0 >= thread_count_1);
+}
+
+
+static bool ThreadInList(Thread* thread) {
+  ThreadIterator it;
+  while (it.HasNext()) {
+    Thread* t = it.Next();
+    if (t == thread) {
+      return true;
+    }
+  }
+  return false;
+}
+
+
+TEST_CASE(ThreadIterator_FindSelf) {
+  Thread* current = Thread::Current();
+  EXPECT(ThreadInList(current));
+}
+
+
+struct ThreadIteratorTestParams {
+  Isolate* isolate;
+  Thread* spawned_thread;
+  ThreadJoinId spawned_thread_join_id;
+  Monitor* monitor;
+};
+
+
+void ThreadIteratorTestMain(uword parameter) {
+  Thread::EnsureInit();
+  ThreadIteratorTestParams* params =
+      reinterpret_cast<ThreadIteratorTestParams*>(parameter);
+  Isolate* isolate = params->isolate;
+  EXPECT(isolate != NULL);
+  Thread* thread = Thread::Current();
+  EXPECT(thread != NULL);
+
+  MonitorLocker ml(params->monitor);
+  params->spawned_thread = thread;
+  params->spawned_thread_join_id = OSThread::GetCurrentThreadJoinId();
+  EXPECT(params->spawned_thread_join_id != OSThread::kInvalidThreadJoinId);
+  EXPECT(ThreadInList(thread));
+  ml.Notify();
+}
+
+
+TEST_CASE(ThreadIterator_AddFindRemove) {
+  Isolate* isolate = thread->isolate();
+  ThreadIteratorTestParams params;
+  params.isolate = isolate;
+  params.spawned_thread = NULL;
+  params.spawned_thread_join_id = OSThread::kInvalidThreadJoinId;
+  params.monitor = new Monitor();
+
+  {
+    MonitorLocker ml(params.monitor);
+    EXPECT(params.spawned_thread_join_id == OSThread::kInvalidThreadJoinId);
+    EXPECT(params.spawned_thread == NULL);
+    // Spawn thread and wait to receive the thread join id.
+    OSThread::Start(ThreadIteratorTestMain, reinterpret_cast<uword>(&params));
+    while (params.spawned_thread_join_id == OSThread::kInvalidThreadJoinId) {
+      ml.Wait();
+    }
+    EXPECT(params.spawned_thread_join_id != OSThread::kInvalidThreadJoinId);
+    EXPECT(params.spawned_thread != NULL);
+    // Join thread.
+    OSThread::Join(params.spawned_thread_join_id);
+  }
+
+  for (intptr_t i = 0; i < 10; i++) {
+    // Sleep for 10 milliseconds.
+    OS::Sleep(10);
+    if (!ThreadInList(params.spawned_thread)) {
+      break;
+    }
+  }
+
+  EXPECT(!ThreadInList(params.spawned_thread))
+
+  delete params.monitor;
+}
+
+
 // Test rendezvous of:
 // - helpers in VM code, and
 // - main thread in VM code,
@@ -405,7 +523,6 @@
 // - main thread, and
 // - helpers.
 TEST_CASE(SafepointTestVM2) {
-  Thread* thread = Thread::Current();
   Isolate* isolate = thread->isolate();
   Mutex mutex;
   intptr_t expected_count = 0;
@@ -438,4 +555,64 @@
   }
 }
 
+
+class AllocAndGCTask : public ThreadPool::Task {
+ public:
+  AllocAndGCTask(Isolate* isolate,
+                 Monitor* done_monitor,
+                 bool* done)
+    : isolate_(isolate),
+      done_monitor_(done_monitor),
+      done_(done) {
+  }
+
+  virtual void Run() {
+    Thread::EnterIsolateAsHelper(isolate_);
+    {
+      Thread* thread = Thread::Current();
+      StackZone stack_zone(thread);
+      Zone* zone = stack_zone.GetZone();
+      HANDLESCOPE(thread);
+      String& old_str = String::Handle(zone, String::New("old", Heap::kOld));
+      isolate_->heap()->CollectAllGarbage();
+      EXPECT(old_str.Equals("old"));
+    }
+    Thread::ExitIsolateAsHelper();
+    // Tell main thread that we are ready.
+    {
+      MonitorLocker ml(done_monitor_);
+      ASSERT(!*done_);
+      *done_ = true;
+      ml.Notify();
+    }
+  }
+
+ private:
+  Isolate* isolate_;
+  Monitor* done_monitor_;
+  bool* done_;
+};
+
+
+TEST_CASE(HelperAllocAndGC) {
+  Monitor done_monitor;
+  bool done = false;
+  Isolate* isolate = Thread::Current()->isolate();
+  // Flush store buffers, etc.
+  // TODO(koda): Currently, the GC only does this for the current thread, (i.e,
+  // the helper, in this test), but it should be done for all *threads*
+  // while reaching a safepoint.
+  Thread::PrepareForGC();
+  Dart::thread_pool()->Run(new AllocAndGCTask(isolate, &done_monitor, &done));
+  {
+    while (true) {
+      isolate->thread_registry()->CheckSafepoint();
+      MonitorLocker ml(&done_monitor);
+      if (done) {
+        break;
+      }
+    }
+  }
+}
+
 }  // namespace dart
diff --git a/runtime/vm/timeline.cc b/runtime/vm/timeline.cc
index 4c3fb9b..6b96b16 100644
--- a/runtime/vm/timeline.cc
+++ b/runtime/vm/timeline.cc
@@ -4,15 +4,182 @@
 
 #include <cstdlib>
 
+#include "vm/atomic.h"
 #include "vm/isolate.h"
 #include "vm/json_stream.h"
+#include "vm/lockers.h"
+#include "vm/log.h"
 #include "vm/object.h"
 #include "vm/thread.h"
 #include "vm/timeline.h"
 
 namespace dart {
 
-DEFINE_FLAG(bool, trace_timeline, false, "Timeline trace");
+DEFINE_FLAG(bool, complete_timeline, false, "Record the complete timeline");
+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,
+            "Dump isolate timing information from timeline.");
+DEFINE_FLAG(charp, timeline_dir, NULL,
+            "Enable all timeline trace streams and output VM global trace "
+            "into specified directory.");
+
+// Implementation notes:
+//
+// Writing events:
+// |TimelineEvent|s are written into |TimelineEventBlock|s. Each |Thread| caches
+// a |TimelineEventBlock| in TLS so that it can write events without
+// synchronizing with other threads in the system. Even though the |Thread| owns
+// the |TimelineEventBlock| the block may need to be reclaimed by the reporting
+// system. To support that, a |Thread| must hold its |timeline_block_lock_|
+// when operating on the |TimelineEventBlock|. This lock will only ever be
+// busy if blocks are being reclaimed by the reporting system.
+//
+// Reporting:
+// When requested, the timeline is serialized in the trace-event format
+// (https://goo.gl/hDZw5M). The request can be for a VM-wide timeline or an
+// isolate specific timeline. In both cases it may be that a thread has
+// a |TimelineEventBlock| cached in TLS. In order to report a complete timeline
+// the cached |TimelineEventBlock|s need to be reclaimed.
+//
+// Reclaiming open |TimelineEventBlock|s for an isolate:
+//
+// Cached |TimelineEventBlock|s can be in two places:
+// 1) In a |Thread| (Thread currently in an |Isolate|)
+// 2) In a |Thread::State| (Thread not currently in an |Isolate|).
+//
+// As a |Thread| enters and exits an |Isolate|, a |TimelineEventBlock|
+// will move between (1) and (2).
+//
+// The first case occurs for |Thread|s that are currently running inside an
+// isolate. The second case occurs for |Thread|s that are not currently
+// running inside an isolate.
+//
+// To reclaim the first case, we take the |Thread|'s |timeline_block_lock_|
+// and reclaim the cached block.
+//
+// To reclaim the second case, we can take the |ThreadRegistry| lock and
+// reclaim these blocks.
+//
+// |Timeline::ReclaimIsolateBlocks| and |Timeline::ReclaimAllBlocks| are
+// the two utility methods used to reclaim blocks before reporting.
+//
+// Locking notes:
+// The following locks are used by the timeline system:
+// - |TimelineEventRecorder::lock_| This lock is held whenever a
+// |TimelineEventBlock| is being requested or reclaimed.
+// - |Thread::timeline_block_lock_| This lock is held whenever a |Thread|'s
+// cached block is being operated on.
+// - |ThreadRegistry::monitor_| This lock protects the cached block for
+// unscheduled threads of an isolate.
+// - |Isolate::isolates_list_monitor_| This lock protects the list of
+// isolates in the system.
+//
+// Locks must always be taken in the following order:
+// |Isolate::isolates_list_monitor_|
+//   |ThreadRegistry::monitor_|
+//     |Thread::timeline_block_lock_|
+//       |TimelineEventRecorder::lock_|
+//
+
+void Timeline::InitOnce() {
+  ASSERT(recorder_ == NULL);
+  // Default to ring recorder being enabled.
+  const bool use_ring_recorder = true;
+  // Some flags require that we use the endless recorder.
+  const bool use_endless_recorder =
+      (FLAG_timeline_dir != NULL) || FLAG_timing;
+  if (use_endless_recorder) {
+    recorder_ = new TimelineEventEndlessRecorder();
+  } else if (use_ring_recorder) {
+    recorder_ = new TimelineEventRingRecorder();
+  }
+  vm_stream_ = new TimelineStream();
+  vm_stream_->Init("VM", EnableStreamByDefault("VM"), NULL);
+  // Global overrides.
+#define ISOLATE_TIMELINE_STREAM_FLAG_DEFAULT(name, not_used)                   \
+  stream_##name##_enabled_ = false;
+  ISOLATE_TIMELINE_STREAM_LIST(ISOLATE_TIMELINE_STREAM_FLAG_DEFAULT)
+#undef ISOLATE_TIMELINE_STREAM_FLAG_DEFAULT
+}
+
+
+void Timeline::Shutdown() {
+  ASSERT(recorder_ != NULL);
+  if (FLAG_timeline_dir != NULL) {
+    recorder_->WriteTo(FLAG_timeline_dir);
+  }
+  delete recorder_;
+  recorder_ = NULL;
+  delete vm_stream_;
+  vm_stream_ = NULL;
+}
+
+
+TimelineEventRecorder* Timeline::recorder() {
+  return recorder_;
+}
+
+
+bool Timeline::EnableStreamByDefault(const char* stream_name) {
+  // TODO(johnmccutchan): Allow for command line control over streams.
+  return (FLAG_timeline_dir != NULL) || FLAG_timing;
+}
+
+
+TimelineStream* Timeline::GetVMStream() {
+  ASSERT(vm_stream_ != NULL);
+  return vm_stream_;
+}
+
+
+void Timeline::ReclaimIsolateBlocks() {
+  ReclaimBlocksForIsolate(Isolate::Current());
+}
+
+
+class ReclaimBlocksIsolateVisitor : public IsolateVisitor {
+ public:
+  ReclaimBlocksIsolateVisitor() {}
+
+  virtual void VisitIsolate(Isolate* isolate) {
+    Timeline::ReclaimBlocksForIsolate(isolate);
+  }
+
+ private:
+};
+
+
+void Timeline::ReclaimAllBlocks() {
+  if (recorder() == NULL) {
+    return;
+  }
+  // Reclaim all blocks cached for all isolates.
+  ReclaimBlocksIsolateVisitor visitor;
+  Isolate::VisitIsolates(&visitor);
+  // Reclaim the global VM block.
+  recorder()->ReclaimGlobalBlock();
+}
+
+
+void Timeline::ReclaimBlocksForIsolate(Isolate* isolate) {
+  if (recorder() == NULL) {
+    return;
+  }
+  ASSERT(isolate != NULL);
+  isolate->ReclaimTimelineBlocks();
+}
+
+
+TimelineEventRecorder* Timeline::recorder_ = NULL;
+TimelineStream* Timeline::vm_stream_ = NULL;
+
+#define ISOLATE_TIMELINE_STREAM_DEFINE_FLAG(name, enabled_by_default)          \
+  bool Timeline::stream_##name##_enabled_ = false;
+  ISOLATE_TIMELINE_STREAM_LIST(ISOLATE_TIMELINE_STREAM_DEFINE_FLAG)
+#undef ISOLATE_TIMELINE_STREAM_DEFINE_FLAG
 
 TimelineEvent::TimelineEvent()
     : timestamp0_(0),
@@ -21,8 +188,8 @@
       arguments_length_(0),
       state_(0),
       label_(NULL),
-      stream_(NULL),
-      thread_(NULL) {
+      category_(""),
+      thread_(OSThread::kInvalidThreadId) {
 }
 
 
@@ -33,28 +200,26 @@
 
 void TimelineEvent::Reset() {
   set_event_type(kNone);
-  thread_ = NULL;
-  stream_ = NULL;
+  thread_ = OSThread::kInvalidThreadId;
+  isolate_ = NULL;
+  category_ = "";
   label_ = NULL;
   FreeArguments();
 }
 
 
-int64_t TimelineEvent::AsyncBegin(const char* label) {
+void TimelineEvent::AsyncBegin(const char* label, int64_t async_id) {
   Init(kAsyncBegin, label);
-  timestamp0_ = OS::GetCurrentTimeMicros();
-  ASSERT(stream_ != NULL);
-  int64_t async_id = stream_->GetNextSeq();
+  timestamp0_ = OS::GetCurrentTraceMicros();
   // Overload timestamp1_ with the async_id.
   timestamp1_ = async_id;
-  return async_id;
 }
 
 
 void TimelineEvent::AsyncInstant(const char* label,
                                  int64_t async_id) {
   Init(kAsyncInstant, label);
-  timestamp0_ = OS::GetCurrentTimeMicros();
+  timestamp0_ = OS::GetCurrentTraceMicros();
   // Overload timestamp1_ with the async_id.
   timestamp1_ = async_id;
 }
@@ -63,7 +228,7 @@
 void TimelineEvent::AsyncEnd(const char* label,
                              int64_t async_id) {
   Init(kAsyncEnd, label);
-  timestamp0_ = OS::GetCurrentTimeMicros();
+  timestamp0_ = OS::GetCurrentTraceMicros();
   // Overload timestamp1_ with the async_id.
   timestamp1_ = async_id;
 }
@@ -71,18 +236,18 @@
 
 void TimelineEvent::DurationBegin(const char* label) {
   Init(kDuration, label);
-  timestamp0_ = OS::GetCurrentTimeMicros();
+  timestamp0_ = OS::GetCurrentTraceMicros();
 }
 
 
 void TimelineEvent::DurationEnd() {
-  timestamp1_ = OS::GetCurrentTimeMicros();
+  timestamp1_ = OS::GetCurrentTraceMicros();
 }
 
 
 void TimelineEvent::Instant(const char* label) {
   Init(kInstant, label);
-  timestamp0_ = OS::GetCurrentTimeMicros();
+  timestamp0_ = OS::GetCurrentTraceMicros();
 }
 
 
@@ -95,10 +260,27 @@
 }
 
 
+void TimelineEvent::Begin(const char* label,
+                          int64_t micros) {
+  Init(kBegin, label);
+  timestamp0_ = micros;
+}
+
+
+void TimelineEvent::End(const char* label,
+                        int64_t micros) {
+  Init(kEnd, label);
+  timestamp0_ = micros;
+}
+
+
 void TimelineEvent::SetNumArguments(intptr_t length) {
   // Cannot call this twice.
   ASSERT(arguments_ == NULL);
   ASSERT(arguments_length_ == 0);
+  if (length == 0) {
+    return;
+  }
   arguments_length_ = length;
   arguments_ = reinterpret_cast<TimelineEventArgument*>(
       calloc(sizeof(TimelineEventArgument), length));
@@ -139,8 +321,18 @@
 }
 
 
+void TimelineEvent::StealArguments(intptr_t arguments_length,
+                                   TimelineEventArgument* arguments) {
+  arguments_length_ = arguments_length;
+  arguments_ = arguments;
+}
+
+
 void TimelineEvent::Complete() {
-  stream_->CompleteEvent(this);
+  TimelineEventRecorder* recorder = Timeline::recorder();
+  if (recorder != NULL) {
+    recorder->CompleteEvent(this);
+  }
 }
 
 
@@ -158,8 +350,11 @@
 
 
 void TimelineEvent::StreamInit(TimelineStream* stream) {
-  ASSERT(stream != NULL);
-  stream_ = stream;
+  if (stream != NULL) {
+    category_ = stream->name();
+  } else {
+    category_ = "";
+  }
 }
 
 
@@ -169,40 +364,35 @@
   set_event_type(event_type);
   timestamp0_ = 0;
   timestamp1_ = 0;
-  thread_ = Thread::Current();
+  thread_ = OSThread::GetCurrentThreadTraceId();
+  isolate_ = Isolate::Current();
   label_ = label;
   FreeArguments();
 }
 
 
-static int64_t GetPid(Isolate* isolate) {
-  // Some mapping from Isolate* to an integer process id.
-  // TODO(Cutch): Investigate if process ids can be strings.
-  return static_cast<int64_t>(reinterpret_cast<uintptr_t>(isolate));
-}
-
-
-static int64_t GetTid(Thread* thread) {
-  // Some mapping from Thread* to an integer thread id.
-  // TODO(Cutch): Investigate if process ids can be strings.
-  return static_cast<int64_t>(reinterpret_cast<uintptr_t>(thread));
-}
-
-
 void TimelineEvent::PrintJSON(JSONStream* stream) const {
   JSONObject obj(stream);
-  int64_t pid = GetPid(Isolate::Current());
-  int64_t tid = GetTid(thread_);
+  int64_t pid = OS::ProcessId();
+  int64_t tid = OSThread::ThreadIdToIntPtr(thread_);
   obj.AddProperty("name", label_);
-  obj.AddProperty("cat", stream_->name());
+  obj.AddProperty("cat", category_);
   obj.AddProperty64("tid", tid);
   obj.AddProperty64("pid", pid);
-  obj.AddPropertyTimeMillis("ts", TimeOrigin());
+  obj.AddPropertyTimeMicros("ts", TimeOrigin());
 
   switch (event_type()) {
+    case kBegin: {
+      obj.AddProperty("ph", "B");
+    }
+    break;
+    case kEnd: {
+      obj.AddProperty("ph", "E");
+    }
+    break;
     case kDuration: {
       obj.AddProperty("ph", "X");
-      obj.AddPropertyTimeMillis("dur", TimeDuration());
+      obj.AddPropertyTimeMicros("dur", TimeDuration());
     }
     break;
     case kInstant: {
@@ -251,46 +441,35 @@
 int64_t TimelineEvent::TimeDuration() const {
   if (timestamp1_ == 0) {
     // This duration is still open, use current time as end.
-    return OS::GetCurrentTimeMicros() - timestamp0_;
+    return OS::GetCurrentTraceMicros() - timestamp0_;
   }
   return timestamp1_ - timestamp0_;
 }
 
 
 TimelineStream::TimelineStream()
-    : recorder_(NULL),
-      name_(NULL),
+    : name_(NULL),
       enabled_(false),
-      seq_(0) {
+      globally_enabled_(NULL) {
 }
 
 
-void TimelineStream::Init(const char* name, bool enabled) {
+void TimelineStream::Init(const char* name,
+                          bool enabled,
+                          const bool* globally_enabled) {
   name_ = name;
   enabled_ = enabled;
-}
-
-
-TimelineEvent* TimelineStream::StartEvent(const Object& obj) {
-  if (!enabled_ || (recorder_ == NULL)) {
-    return NULL;
-  }
-  ASSERT(name_ != NULL);
-  ASSERT(recorder_ != NULL);
-  TimelineEvent* event = recorder_->StartEvent(obj);
-  if (event != NULL) {
-    event->StreamInit(this);
-  }
-  return event;
+  globally_enabled_ = globally_enabled;
 }
 
 
 TimelineEvent* TimelineStream::StartEvent() {
-  if (!enabled_ || (recorder_ == NULL)) {
+  TimelineEventRecorder* recorder = Timeline::recorder();
+  if (!Enabled() || (recorder == NULL)) {
     return NULL;
   }
   ASSERT(name_ != NULL);
-  TimelineEvent* event = recorder_->StartEvent();
+  TimelineEvent* event = recorder->StartEvent();
   if (event != NULL) {
     event->StreamInit(this);
   }
@@ -298,27 +477,106 @@
 }
 
 
-void TimelineStream::CompleteEvent(TimelineEvent* event) {
-  if (!enabled_ || (recorder_ == NULL)) {
-    return;
-  }
-  recorder_->CompleteEvent(event);
+TimelineDurationScope::TimelineDurationScope(TimelineStream* stream,
+                                             const char* label)
+    : StackResource(reinterpret_cast<Thread*>(NULL)),
+      timestamp_(0),
+      stream_(stream),
+      label_(label),
+      arguments_(NULL),
+      arguments_length_(0),
+      enabled_(false) {
+  Init();
 }
 
 
-int64_t TimelineStream::GetNextSeq() {
-  seq_++;
-  if (seq_ < 0) {
-    seq_ = 0;
+TimelineDurationScope::TimelineDurationScope(Thread* thread,
+                                             TimelineStream* stream,
+                                             const char* label)
+    : StackResource(thread),
+      timestamp_(0),
+      stream_(stream),
+      label_(label),
+      arguments_(NULL),
+      arguments_length_(0),
+      enabled_(false) {
+  ASSERT(thread != NULL);
+  Init();
+}
+
+
+TimelineDurationScope::~TimelineDurationScope() {
+  if (!enabled_) {
+    FreeArguments();
+    return;
   }
-  return seq_;
+  TimelineEvent* event = stream_->StartEvent();
+  ASSERT(event != NULL);
+  event->Duration(label_, timestamp_, OS::GetCurrentTraceMicros());
+  event->StealArguments(arguments_length_, arguments_);
+  event->Complete();
+  arguments_length_ = 0;
+  arguments_ = NULL;
+}
+
+
+void TimelineDurationScope::Init() {
+  ASSERT(enabled_ == false);
+  ASSERT(label_ != NULL);
+  ASSERT(stream_ != NULL);
+  if (!stream_->Enabled()) {
+    // Stream is not enabled, do nothing.
+    return;
+  }
+  timestamp_ = OS::GetCurrentTraceMicros();
+  enabled_ = true;
+}
+
+
+void TimelineDurationScope::SetNumArguments(intptr_t length) {
+  if (!enabled()) {
+    return;
+  }
+  ASSERT(arguments_ == NULL);
+  ASSERT(arguments_length_ == 0);
+  arguments_length_ = length;
+  if (arguments_length_ == 0) {
+    return;
+  }
+  arguments_ = reinterpret_cast<TimelineEventArgument*>(
+      calloc(sizeof(TimelineEventArgument), length));
+}
+
+
+// |name| must be a compile time constant. Takes ownership of |argumentp|.
+void TimelineDurationScope::SetArgument(intptr_t i,
+                                        const char* name,
+                                        char* argument) {
+  if (!enabled()) {
+    return;
+  }
+  ASSERT(i >= 0);
+  ASSERT(i < arguments_length_);
+  arguments_[i].name = name;
+  arguments_[i].value = argument;
+}
+
+
+// |name| must be a compile time constant. Copies |argument|.
+void TimelineDurationScope::CopyArgument(intptr_t i,
+                                         const char* name,
+                                         const char* argument) {
+  if (!enabled()) {
+    return;
+  }
+  SetArgument(i, name, strdup(argument));
 }
 
 
 void TimelineDurationScope::FormatArgument(intptr_t i,
                                            const char* name,
                                            const char* fmt, ...) {
-  if (event_ == NULL) {
+  if (!enabled()) {
     return;
   }
   va_list args;
@@ -332,144 +590,466 @@
   OS::VSNPrint(buffer, (len + 1), fmt, args2);
   va_end(args2);
 
-  event_->SetArgument(i, name, buffer);
+  SetArgument(i, name, buffer);
 }
 
 
-TimelineEventRecorder::TimelineEventRecorder() {
+void TimelineDurationScope::FreeArguments() {
+  if (arguments_ == NULL) {
+    return;
+  }
+  for (intptr_t i = 0; i < arguments_length_; i++) {
+    free(arguments_[i].value);
+  }
+  free(arguments_);
+  arguments_ = NULL;
+  arguments_length_ = 0;
 }
 
 
-void TimelineEventRecorder::PrintJSONMeta(JSONArray* events) const {
-  Isolate* isolate = Isolate::Current();
-  JSONObject obj(events);
-  int64_t pid = GetPid(isolate);
-  obj.AddProperty("ph", "M");
-  obj.AddProperty64("pid", pid);
-  obj.AddProperty("name", "process_name");
-  {
-    JSONObject args(&obj, "args");
-    args.AddProperty("name", isolate->debugger_name());
+TimelineEventFilter::TimelineEventFilter() {
+}
+
+
+TimelineEventFilter::~TimelineEventFilter() {
+}
+
+
+IsolateTimelineEventFilter::IsolateTimelineEventFilter(Isolate* isolate)
+    : isolate_(isolate) {
+}
+
+
+DartTimelineEvent::DartTimelineEvent()
+    : isolate_(NULL),
+      event_as_json_(NULL) {
+}
+
+
+DartTimelineEvent::~DartTimelineEvent() {
+  Clear();
+}
+
+
+void DartTimelineEvent::Clear() {
+  if (isolate_ != NULL) {
+    isolate_ = NULL;
+  }
+  if (event_as_json_ != NULL) {
+    free(event_as_json_);
+    event_as_json_ = NULL;
   }
 }
 
 
-void TimelineEventRecorder::WriteTo(const char* directory) {
-  Isolate* isolate = Isolate::Current();
+void DartTimelineEvent::Init(Isolate* isolate, const char* event) {
+  ASSERT(isolate_ == NULL);
+  ASSERT(event != NULL);
+  isolate_ = isolate;
+  event_as_json_ = strdup(event);
+}
 
+
+TimelineEventRecorder::TimelineEventRecorder()
+    : global_block_(NULL),
+      async_id_(0) {
+}
+
+
+void TimelineEventRecorder::PrintJSONMeta(JSONArray* events) const {
+}
+
+
+TimelineEvent* TimelineEventRecorder::ThreadBlockStartEvent() {
+  // Grab the current thread.
+  Thread* thread = Thread::Current();
+  ASSERT(thread != NULL);
+  ASSERT(thread->isolate() != NULL);
+  Mutex* thread_block_lock = thread->timeline_block_lock();
+  ASSERT(thread_block_lock != NULL);
+  // We are accessing the thread's timeline block- so take the lock here.
+  // This lock will be held until the call to |CompleteEvent| is made.
+  thread_block_lock->Lock();
+
+  TimelineEventBlock* thread_block = thread->timeline_block();
+
+  if ((thread_block != NULL) && thread_block->IsFull()) {
+    MutexLocker ml(&lock_);
+    // Thread has a block and it is full:
+    // 1) Mark it as finished.
+    thread_block->Finish();
+    // 2) Allocate a new block.
+    thread_block = GetNewBlockLocked(thread->isolate());
+    thread->set_timeline_block(thread_block);
+  } else if (thread_block == NULL) {
+    MutexLocker ml(&lock_);
+    // Thread has no block. Attempt to allocate one.
+    thread_block = GetNewBlockLocked(thread->isolate());
+    thread->set_timeline_block(thread_block);
+  }
+  if (thread_block != NULL) {
+    // NOTE: We are exiting this function with the thread's block lock held.
+    ASSERT(!thread_block->IsFull());
+    TimelineEvent* event = thread_block->StartEvent();
+    if (event != NULL) {
+      event->set_global_block(false);
+    }
+    return event;
+  }
+  // Drop lock here as no event is being handed out.
+  thread_block_lock->Unlock();
+  return NULL;
+}
+
+
+TimelineEvent* TimelineEventRecorder::GlobalBlockStartEvent() {
+  // Take recorder lock. This lock will be held until the call to
+  // |CompleteEvent| is made.
+  lock_.Lock();
+  if (FLAG_trace_timeline) {
+    OS::Print("GlobalBlockStartEvent in block %p for thread %" Px "\n",
+              global_block_, OSThread::CurrentCurrentThreadIdAsIntPtr());
+  }
+  if ((global_block_ != NULL) && global_block_->IsFull()) {
+    // Global block is full.
+    global_block_->Finish();
+    global_block_ = NULL;
+  }
+  if (global_block_ == NULL) {
+    // Allocate a new block.
+    global_block_ = GetNewBlockLocked(NULL);
+    ASSERT(global_block_ != NULL);
+  }
+  if (global_block_ != NULL) {
+    // NOTE: We are exiting this function with the recorder's lock held.
+    ASSERT(!global_block_->IsFull());
+    TimelineEvent* event = global_block_->StartEvent();
+    if (event != NULL) {
+      event->set_global_block(true);
+    }
+    return event;
+  }
+  // Drop lock here as no event is being handed out.
+  lock_.Unlock();
+  return NULL;
+}
+
+
+void TimelineEventRecorder::ThreadBlockCompleteEvent(TimelineEvent* event) {
+  if (event == NULL) {
+    return;
+  }
+  ASSERT(!event->global_block());
+  // Grab the current thread.
+  Thread* thread = Thread::Current();
+  ASSERT(thread != NULL);
+  ASSERT(thread->isolate() != NULL);
+  // This event came from the isolate's thread local block. Unlock the
+  // thread's block lock.
+  Mutex* thread_block_lock = thread->timeline_block_lock();
+  ASSERT(thread_block_lock != NULL);
+  thread_block_lock->Unlock();
+}
+
+
+void TimelineEventRecorder::GlobalBlockCompleteEvent(TimelineEvent* event) {
+  if (event == NULL) {
+    return;
+  }
+  ASSERT(event->global_block());
+  // This event came from the global block, unlock the recorder's lock now
+  // that the event is filled.
+  lock_.Unlock();
+}
+
+
+// Trims the ']' character.
+static void TrimOutput(char* output,
+                       intptr_t* output_length) {
+  ASSERT(output != NULL);
+  ASSERT(output_length != NULL);
+  ASSERT(*output_length >= 2);
+  // We expect the first character to be the opening of an array.
+  ASSERT(output[0] == '[');
+  // We expect the last character to be the closing of an array.
+  ASSERT(output[*output_length - 1] == ']');
+  // Skip the ].
+  *output_length -= 1;
+}
+
+
+void TimelineEventRecorder::WriteTo(const char* directory) {
   Dart_FileOpenCallback file_open = Isolate::file_open_callback();
   Dart_FileWriteCallback file_write = Isolate::file_write_callback();
   Dart_FileCloseCallback file_close = Isolate::file_close_callback();
   if ((file_open == NULL) || (file_write == NULL) || (file_close == NULL)) {
     return;
   }
+  Thread* T = Thread::Current();
+  StackZone zone(T);
 
-  JSONStream js;
-  PrintJSON(&js);
+  Timeline::ReclaimAllBlocks();
 
-  const char* format = "%s/dart-timeline-%" Pd "-%" Pd ".json";
   intptr_t pid = OS::ProcessId();
-  intptr_t len = OS::SNPrint(NULL, 0, format,
-                             directory, pid, isolate->main_port());
-  char* filename = Thread::Current()->zone()->Alloc<char>(len + 1);
-  OS::SNPrint(filename, len + 1, format,
-              directory, pid, isolate->main_port());
+  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);
+    free(filename);
     return;
   }
-  (*file_write)(js.buffer()->buf(), js.buffer()->length(), file);
+  free(filename);
+
+  JSONStream js;
+  TimelineEventFilter filter;
+  PrintTraceEvent(&js, &filter);
+  // Steal output from JSONStream.
+  char* output = NULL;
+  intptr_t output_length = 0;
+  js.Steal(const_cast<const char**>(&output), &output_length);
+  TrimOutput(output, &output_length);
+  ASSERT(output_length >= 1);
+  (*file_write)(output, output_length, file);
+  // Free the stolen output.
+  free(output);
+
+  const char* dart_events =
+      DartTimelineEventIterator::PrintTraceEvents(this,
+                                                  zone.GetZone(),
+                                                  NULL);
+
+  // If we wrote out vm events and have dart events, write out the comma.
+  if ((output_length > 1) && (dart_events != NULL)) {
+    // Write out the ',' character.
+    const char* comma = ",";
+    (*file_write)(comma, 1, file);
+  }
+
+  // Write out the Dart events.
+  if (dart_events != NULL) {
+    (*file_write)(dart_events, strlen(dart_events), file);
+  }
+
+  // Write out the ']' character.
+  const char* array_close = "]";
+  (*file_write)(array_close, 1, file);
   (*file_close)(file);
+
+  return;
 }
 
 
-intptr_t TimelineEventRingRecorder::SizeForCapacity(intptr_t capacity) {
-  return sizeof(TimelineEvent) * capacity;
+void TimelineEventRecorder::ReclaimGlobalBlock() {
+  MutexLocker ml(&lock_);
+  if (global_block_ != NULL) {
+    global_block_->Finish();
+    global_block_ = NULL;
+  }
+}
+
+
+int64_t TimelineEventRecorder::GetNextAsyncId() {
+  // TODO(johnmccutchan): Gracefully handle wrap around.
+  uint32_t next = static_cast<uint32_t>(
+      AtomicOperations::FetchAndIncrement(&async_id_));
+  return static_cast<int64_t>(next);
+}
+
+
+void TimelineEventRecorder::FinishBlock(TimelineEventBlock* block) {
+  if (block == NULL) {
+    return;
+  }
+  MutexLocker ml(&lock_);
+  block->Finish();
+}
+
+
+TimelineEventBlock* TimelineEventRecorder::GetNewBlock() {
+  MutexLocker ml(&lock_);
+  return GetNewBlockLocked(Isolate::Current());
 }
 
 
 TimelineEventRingRecorder::TimelineEventRingRecorder(intptr_t capacity)
-    : events_(NULL),
-      event_objects_(Array::null()),
-      cursor_(0),
-      capacity_(capacity) {
-  if (FLAG_trace_timeline) {
-    // 32-bit: 262,144 bytes per isolate.
-    // 64-bit: 393,216 bytes per isolate.
-    // NOTE: Internal isolates (vm and service) do not have a timeline
-    // event buffer.
-    OS::Print("TimelineEventRingRecorder is %" Pd " bytes (%" Pd " events)\n",
-              SizeForCapacity(capacity),
-              capacity);
+    : blocks_(NULL),
+      capacity_(capacity),
+      num_blocks_(0),
+      block_cursor_(0),
+      dart_events_(NULL),
+      dart_events_capacity_(capacity),
+      dart_events_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*)));
+  // Allocate each block.
+  for (intptr_t i = 0; i < num_blocks_; i++) {
+    blocks_[i] = new TimelineEventBlock(i);
   }
-  events_ =
-      reinterpret_cast<TimelineEvent*>(calloc(capacity, sizeof(TimelineEvent)));
-  const Array& array = Array::Handle(Array::New(capacity, Heap::kOld));
-  event_objects_ = array.raw();
+  // Chain blocks together.
+  for (intptr_t i = 0; i < num_blocks_ - 1; i++) {
+    blocks_[i]->set_next(blocks_[i + 1]);
+  }
+  // Pre-allocate DartTimelineEvents.
+  dart_events_ =
+      reinterpret_cast<DartTimelineEvent**>(
+          calloc(dart_events_capacity_, sizeof(DartTimelineEvent*)));
+  for (intptr_t i = 0; i < dart_events_capacity_; i++) {
+    dart_events_[i] = new DartTimelineEvent();
+  }
 }
 
 
 TimelineEventRingRecorder::~TimelineEventRingRecorder() {
-  for (intptr_t i = 0; i < capacity_; i++) {
-    // Clear any extra data.
-    events_[i].Reset();
+  // Delete all blocks.
+  for (intptr_t i = 0; i < num_blocks_; i++) {
+    TimelineEventBlock* block = blocks_[i];
+    delete block;
   }
-  free(events_);
-  event_objects_ = Array::null();
+  free(blocks_);
+  // Delete all DartTimelineEvents.
+  for (intptr_t i = 0; i < dart_events_capacity_; i++) {
+    DartTimelineEvent* event = dart_events_[i];
+    delete event;
+  }
+  free(dart_events_);
 }
 
 
-void TimelineEventRingRecorder::PrintJSONEvents(JSONArray* events) const {
-  for (intptr_t i = 0; i < capacity_; i++) {
-    if (events_[i].IsValid()) {
-      events->AddValue(&events_[i]);
+void TimelineEventRingRecorder::PrintJSONEvents(
+    JSONArray* events,
+    TimelineEventFilter* filter) const {
+  intptr_t block_offset = FindOldestBlockIndex();
+  if (block_offset == -1) {
+    // All blocks are empty.
+    return;
+  }
+  for (intptr_t block_idx = 0; block_idx < num_blocks_; block_idx++) {
+    TimelineEventBlock* block =
+        blocks_[(block_idx + block_offset) % num_blocks_];
+    if (!filter->IncludeBlock(block)) {
+      continue;
+    }
+    for (intptr_t event_idx = 0; event_idx < block->length(); event_idx++) {
+      TimelineEvent* event = block->At(event_idx);
+      if (filter->IncludeEvent(event)) {
+        events->AddValue(event);
+      }
     }
   }
 }
 
 
-void TimelineEventRingRecorder::PrintJSON(JSONStream* js) const {
+void TimelineEventRingRecorder::PrintJSON(JSONStream* js,
+                                          TimelineEventFilter* filter) {
+  MutexLocker ml(&lock_);
   JSONObject topLevel(js);
   topLevel.AddProperty("type", "_Timeline");
   {
     JSONArray events(&topLevel, "traceEvents");
     PrintJSONMeta(&events);
-    PrintJSONEvents(&events);
+    PrintJSONEvents(&events, filter);
   }
 }
 
 
-intptr_t TimelineEventRingRecorder::GetNextIndex() {
-  uintptr_t cursor = AtomicOperations::FetchAndIncrement(&cursor_);
-  return cursor % capacity_;
+void TimelineEventRingRecorder::AppendDartEvent(Isolate* isolate,
+                                                const char* event) {
+  MutexLocker ml(&lock_);
+  // TODO(johnmccutchan): If locking becomes an issue, use the Isolate to store
+  // the events.
+  if (dart_events_cursor_ == dart_events_capacity_) {
+    dart_events_cursor_ = 0;
+  }
+  ASSERT(dart_events_[dart_events_cursor_] != NULL);
+  dart_events_[dart_events_cursor_]->Clear();
+  dart_events_[dart_events_cursor_]->Init(isolate, event);
+  dart_events_cursor_++;
 }
 
 
-void TimelineEventRingRecorder::VisitObjectPointers(
-    ObjectPointerVisitor* visitor) {
-  visitor->VisitPointer(reinterpret_cast<RawObject**>(&event_objects_));
+intptr_t TimelineEventRingRecorder::NumDartEventsLocked() {
+  return dart_events_capacity_;
 }
 
 
-TimelineEvent* TimelineEventRingRecorder::StartEvent(const Object& obj) {
-  ASSERT(events_ != NULL);
-  uintptr_t index = GetNextIndex();
-  const Array& event_objects = Array::Handle(event_objects_);
-  event_objects.SetAt(index, obj);
-  return &events_[index];
+DartTimelineEvent* TimelineEventRingRecorder::DartEventAtLocked(intptr_t i) {
+  ASSERT(i >= 0);
+  ASSERT(i < dart_events_capacity_);
+  return dart_events_[i];
+}
+
+
+void TimelineEventRingRecorder::PrintTraceEvent(JSONStream* js,
+                                                TimelineEventFilter* filter) {
+  JSONArray events(js);
+  PrintJSONEvents(&events, filter);
+}
+
+
+TimelineEventBlock* TimelineEventRingRecorder::GetHeadBlockLocked() {
+  return blocks_[0];
+}
+
+
+TimelineEventBlock* TimelineEventRingRecorder::GetNewBlockLocked(
+    Isolate* isolate) {
+  // TODO(johnmccutchan): This function should only hand out blocks
+  // which have been marked as finished.
+  if (block_cursor_ == num_blocks_) {
+    block_cursor_ = 0;
+  }
+  TimelineEventBlock* block = blocks_[block_cursor_++];
+  block->Reset();
+  block->Open(isolate);
+  return block;
+}
+
+
+intptr_t TimelineEventRingRecorder::FindOldestBlockIndex() const {
+  int64_t earliest_time = kMaxInt64;
+  intptr_t earliest_index = -1;
+  for (intptr_t block_idx = 0; block_idx < num_blocks_; block_idx++) {
+    TimelineEventBlock* block = blocks_[block_idx];
+    if (block->IsEmpty()) {
+      // Skip empty blocks.
+      continue;
+    }
+    if (block->LowerTimeBound() < earliest_time) {
+      earliest_time = block->LowerTimeBound();
+      earliest_index = block_idx;
+    }
+  }
+  return earliest_index;
 }
 
 
 TimelineEvent* TimelineEventRingRecorder::StartEvent() {
-  ASSERT(events_ != NULL);
-  uintptr_t index = GetNextIndex();
-  return &events_[index];
+  // Grab the current thread.
+  Thread* thread = Thread::Current();
+  ASSERT(thread != NULL);
+  if (thread->isolate() == NULL) {
+    // Non-isolate thread case. This should be infrequent.
+    return GlobalBlockStartEvent();
+  }
+  return ThreadBlockStartEvent();
 }
 
+
 void TimelineEventRingRecorder::CompleteEvent(TimelineEvent* event) {
-  ASSERT(events_ != NULL);
-  // no-op.
+  if (event == NULL) {
+    return;
+  }
+  if (event->global_block()) {
+    GlobalBlockCompleteEvent(event);
+  } else {
+    ThreadBlockCompleteEvent(event);
+  }
 }
 
 
@@ -481,7 +1061,8 @@
 }
 
 
-void TimelineEventStreamingRecorder::PrintJSON(JSONStream* js) const {
+void TimelineEventStreamingRecorder::PrintJSON(JSONStream* js,
+                                               TimelineEventFilter* filter) {
   JSONObject topLevel(js);
   topLevel.AddProperty("type", "_Timeline");
   {
@@ -490,16 +1071,30 @@
   }
 }
 
-void TimelineEventStreamingRecorder::VisitObjectPointers(
-    ObjectPointerVisitor* visitor) {
-  // no-op.
+
+void TimelineEventStreamingRecorder::PrintTraceEvent(
+    JSONStream* js,
+    TimelineEventFilter* filter) {
+  JSONArray events(js);
 }
 
 
-TimelineEvent* TimelineEventStreamingRecorder::StartEvent(
-    const Object& object) {
-  // The streaming recorder does not track Dart objects.
-  return StartEvent();
+void TimelineEventStreamingRecorder::AppendDartEvent(Isolate* isolate,
+                                                     const char* event) {
+  if (event != NULL) {
+    StreamDartEvent(event);
+  }
+}
+
+
+intptr_t TimelineEventStreamingRecorder::NumDartEventsLocked() {
+  return 0;
+}
+
+
+DartTimelineEvent* TimelineEventStreamingRecorder::DartEventAtLocked(
+    intptr_t i) {
+  return NULL;
 }
 
 
@@ -514,4 +1109,363 @@
   delete event;
 }
 
+
+TimelineEventEndlessRecorder::TimelineEventEndlessRecorder()
+    : head_(NULL),
+      block_index_(0),
+      dart_events_(NULL),
+      dart_events_capacity_(0),
+      dart_events_cursor_(0) {
+}
+
+
+void TimelineEventEndlessRecorder::PrintJSON(JSONStream* js,
+                                             TimelineEventFilter* filter) {
+  MutexLocker ml(&lock_);
+  JSONObject topLevel(js);
+  topLevel.AddProperty("type", "_Timeline");
+  {
+    JSONArray events(&topLevel, "traceEvents");
+    PrintJSONMeta(&events);
+    PrintJSONEvents(&events, filter);
+  }
+}
+
+
+void TimelineEventEndlessRecorder::PrintTraceEvent(
+    JSONStream* js,
+    TimelineEventFilter* filter) {
+  JSONArray events(js);
+  PrintJSONEvents(&events, filter);
+}
+
+
+void TimelineEventEndlessRecorder::AppendDartEvent(Isolate* isolate,
+                                                   const char* event) {
+  MutexLocker ml(&lock_);
+  // TODO(johnmccutchan): If locking becomes an issue, use the Isolate to store
+  // the events.
+  if (dart_events_cursor_ == dart_events_capacity_) {
+    // Grow.
+    intptr_t new_capacity =
+        (dart_events_capacity_ == 0) ? 16 : dart_events_capacity_ * 2;
+    dart_events_ = reinterpret_cast<DartTimelineEvent**>(
+        realloc(dart_events_, new_capacity * sizeof(DartTimelineEvent*)));
+    for (intptr_t i = dart_events_capacity_; i < new_capacity; i++) {
+      // Fill with NULLs.
+      dart_events_[i] = NULL;
+    }
+    dart_events_capacity_ = new_capacity;
+  }
+  ASSERT(dart_events_cursor_ < dart_events_capacity_);
+  DartTimelineEvent* dart_event = new DartTimelineEvent();
+  dart_event->Init(isolate, event);
+  ASSERT(dart_events_[dart_events_cursor_] == NULL);
+  dart_events_[dart_events_cursor_++] = dart_event;
+}
+
+
+TimelineEventBlock* TimelineEventEndlessRecorder::GetHeadBlockLocked() {
+  return head_;
+}
+
+
+TimelineEvent* TimelineEventEndlessRecorder::StartEvent() {
+  // Grab the current thread.
+  Thread* thread = Thread::Current();
+  ASSERT(thread != NULL);
+  if (thread->isolate() == NULL) {
+    // Non-isolate thread case. This should be infrequent.
+    return GlobalBlockStartEvent();
+  }
+  return ThreadBlockStartEvent();
+}
+
+
+void TimelineEventEndlessRecorder::CompleteEvent(TimelineEvent* event) {
+  if (event == NULL) {
+    return;
+  }
+  if (event->global_block()) {
+    GlobalBlockCompleteEvent(event);
+  } else {
+    ThreadBlockCompleteEvent(event);
+  }
+}
+
+
+TimelineEventBlock* TimelineEventEndlessRecorder::GetNewBlockLocked(
+    Isolate* isolate) {
+  TimelineEventBlock* block = new TimelineEventBlock(block_index_++);
+  block->set_next(head_);
+  block->Open(isolate);
+  head_ = block;
+  if (FLAG_trace_timeline) {
+    if (isolate != NULL) {
+      OS::Print("Created new isolate block %p for %s\n",
+                block, isolate->name());
+    } else {
+      OS::Print("Created new global block %p\n", block);
+    }
+  }
+  return head_;
+}
+
+
+intptr_t TimelineEventEndlessRecorder::NumDartEventsLocked() {
+  return dart_events_cursor_;
+}
+
+
+DartTimelineEvent* TimelineEventEndlessRecorder::DartEventAtLocked(
+    intptr_t i) {
+  ASSERT(i >= 0);
+  ASSERT(i < dart_events_cursor_);
+  return dart_events_[i];
+}
+
+
+void TimelineEventEndlessRecorder::PrintJSONEvents(
+    JSONArray* events,
+    TimelineEventFilter* filter) const {
+  TimelineEventBlock* current = head_;
+
+  while (current != NULL) {
+    if (!filter->IncludeBlock(current)) {
+      current = current->next();
+      continue;
+    }
+    intptr_t length = current->length();
+    for (intptr_t i = 0; i < length; i++) {
+      TimelineEvent* event = current->At(i);
+      if (!filter->IncludeEvent(event)) {
+        continue;
+      }
+      events->AddValue(event);
+    }
+    current = current->next();
+  }
+}
+
+
+void TimelineEventEndlessRecorder::Clear() {
+  TimelineEventBlock* current = head_;
+  while (current != NULL) {
+    TimelineEventBlock* next = current->next();
+    delete current;
+    current = next;
+  }
+  head_ = NULL;
+  block_index_ = 0;
+  Thread* thread = Thread::Current();
+  thread->set_timeline_block(NULL);
+}
+
+
+TimelineEventBlock::TimelineEventBlock(intptr_t block_index)
+    : next_(NULL),
+      length_(0),
+      block_index_(block_index),
+      isolate_(NULL),
+      in_use_(false) {
+}
+
+
+TimelineEventBlock::~TimelineEventBlock() {
+  Reset();
+}
+
+
+TimelineEvent* TimelineEventBlock::StartEvent() {
+  ASSERT(!IsFull());
+  if (FLAG_trace_timeline) {
+    OS::Print("StartEvent in block %p for thread %" Px "\n",
+              this, OSThread::CurrentCurrentThreadIdAsIntPtr());
+  }
+  return &events_[length_++];
+}
+
+
+ThreadId TimelineEventBlock::thread() const {
+  ASSERT(length_ > 0);
+  return events_[0].thread();
+}
+
+
+int64_t TimelineEventBlock::LowerTimeBound() const {
+  ASSERT(length_ > 0);
+  return events_[0].TimeOrigin();
+}
+
+
+bool TimelineEventBlock::CheckBlock() {
+  if (length() == 0) {
+    return true;
+  }
+
+  // - events in the block come from one thread.
+  ThreadId tid = thread();
+  for (intptr_t i = 0; i < length(); i++) {
+    if (At(i)->thread() != tid) {
+      return false;
+    }
+  }
+
+  // - events have monotonically increasing timestamps.
+  int64_t last_time = LowerTimeBound();
+  for (intptr_t i = 0; i < length(); i++) {
+    if (last_time > At(i)->TimeOrigin()) {
+      return false;
+    }
+    last_time = At(i)->TimeOrigin();
+  }
+
+  return true;
+}
+
+
+void TimelineEventBlock::Reset() {
+  for (intptr_t i = 0; i < kBlockSize; i++) {
+    // Clear any extra data.
+    events_[i].Reset();
+  }
+  length_ = 0;
+  isolate_ = NULL;
+  in_use_ = false;
+}
+
+
+void TimelineEventBlock::Open(Isolate* isolate) {
+  isolate_ = isolate;
+  in_use_ = true;
+}
+
+
+void TimelineEventBlock::Finish() {
+  if (FLAG_trace_timeline) {
+    OS::Print("Finish block %p\n", this);
+  }
+  in_use_ = false;
+}
+
+
+TimelineEventBlockIterator::TimelineEventBlockIterator(
+    TimelineEventRecorder* recorder)
+    : current_(NULL),
+      recorder_(NULL) {
+  Reset(recorder);
+}
+
+
+TimelineEventBlockIterator::~TimelineEventBlockIterator() {
+  Reset(NULL);
+}
+
+
+void TimelineEventBlockIterator::Reset(TimelineEventRecorder* recorder) {
+  // Clear current.
+  current_ = NULL;
+  if (recorder_ != NULL) {
+    // Unlock old recorder.
+    recorder_->lock_.Unlock();
+  }
+  recorder_ = recorder;
+  if (recorder_ == NULL) {
+    return;
+  }
+  // Lock new recorder.
+  recorder_->lock_.Lock();
+  // Queue up first block.
+  current_ = recorder_->GetHeadBlockLocked();
+}
+
+
+bool TimelineEventBlockIterator::HasNext() const {
+  return current_ != NULL;
+}
+
+
+TimelineEventBlock* TimelineEventBlockIterator::Next() {
+  ASSERT(current_ != NULL);
+  TimelineEventBlock* r = current_;
+  current_ = current_->next();
+  return r;
+}
+
+
+DartTimelineEventIterator::DartTimelineEventIterator(
+    TimelineEventRecorder* recorder)
+    : cursor_(0),
+      num_events_(0),
+      recorder_(NULL) {
+  Reset(recorder);
+}
+
+
+DartTimelineEventIterator::~DartTimelineEventIterator() {
+  Reset(NULL);
+}
+
+
+void DartTimelineEventIterator::Reset(TimelineEventRecorder* recorder) {
+  // Clear state.
+  cursor_ = 0;
+  num_events_ = 0;
+  if (recorder_ != NULL) {
+    // Unlock old recorder.
+    recorder_->lock_.Unlock();
+  }
+  recorder_ = recorder;
+  if (recorder_ == NULL) {
+    return;
+  }
+  // Lock new recorder.
+  recorder_->lock_.Lock();
+  cursor_ = 0;
+  num_events_ = recorder_->NumDartEventsLocked();
+}
+
+
+bool DartTimelineEventIterator::HasNext() const {
+  return cursor_ < num_events_;
+}
+
+
+DartTimelineEvent* DartTimelineEventIterator::Next() {
+  ASSERT(cursor_ < num_events_);
+  DartTimelineEvent* r = recorder_->DartEventAtLocked(cursor_);
+  cursor_++;
+  return r;
+}
+
+const char* DartTimelineEventIterator::PrintTraceEvents(
+    TimelineEventRecorder* recorder,
+    Zone* zone,
+    Isolate* isolate) {
+  if (recorder == NULL) {
+    return NULL;
+  }
+
+  if (zone == NULL) {
+    return NULL;
+  }
+
+  char* result = NULL;
+  DartTimelineEventIterator iterator(recorder);
+  while (iterator.HasNext()) {
+    DartTimelineEvent* event = iterator.Next();
+    if (!event->IsValid()) {
+      // Skip invalid
+      continue;
+    }
+    if ((isolate != NULL) && (isolate != event->isolate())) {
+      // If an isolate was specified, skip events from other isolates.
+      continue;
+    }
+    ASSERT(event->event_as_json() != NULL);
+    result = zone->ConcatStrings(result, event->event_as_json());
+  }
+  return result;
+}
+
 }  // namespace dart
diff --git a/runtime/vm/timeline.h b/runtime/vm/timeline.h
index 81977ad..82ceb18 100644
--- a/runtime/vm/timeline.h
+++ b/runtime/vm/timeline.h
@@ -5,17 +5,88 @@
 #ifndef VM_TIMELINE_H_
 #define VM_TIMELINE_H_
 
+#include "vm/allocation.h"
 #include "vm/bitfield.h"
+#include "vm/os.h"
 
 namespace dart {
 
+class JSONArray;
+class JSONObject;
 class JSONStream;
 class Object;
+class ObjectPointerVisitor;
+class Isolate;
 class RawArray;
 class Thread;
 class TimelineEvent;
+class TimelineEventBlock;
 class TimelineEventRecorder;
 class TimelineStream;
+class Zone;
+
+// (name, enabled by default for isolate).
+#define ISOLATE_TIMELINE_STREAM_LIST(V)                                        \
+  V(API, false)                                                                \
+  V(Compiler, false)                                                           \
+  V(Dart, false)                                                               \
+  V(Embedder, false)                                                           \
+  V(GC, false)                                                                 \
+  V(Isolate, false)                                                            \
+
+class Timeline : public AllStatic {
+ public:
+  // Initialize timeline system. Not thread safe.
+  static void InitOnce();
+
+  // Shutdown timeline system. Not thread safe.
+  static void Shutdown();
+
+  // Access the global recorder. Not thread safe.
+  static TimelineEventRecorder* recorder();
+
+  static bool EnableStreamByDefault(const char* stream_name);
+
+  static TimelineStream* GetVMStream();
+
+  // Reclaim all |TimelineEventBlock|s that are owned by the current isolate.
+  static void ReclaimIsolateBlocks();
+
+  // Reclaim all |TimelineEventBlocks|s that are owned by all isolates and
+  // the global block owned by the VM.
+  static void ReclaimAllBlocks();
+
+#define ISOLATE_TIMELINE_STREAM_FLAGS(name, not_used)                          \
+  static const bool* Stream##name##EnabledFlag() {                             \
+    return &stream_##name##_enabled_;                                          \
+  }                                                                            \
+  static void SetStream##name##Enabled(bool enabled) {                         \
+    stream_##name##_enabled_ = enabled;                                        \
+  }
+  ISOLATE_TIMELINE_STREAM_LIST(ISOLATE_TIMELINE_STREAM_FLAGS)
+#undef ISOLATE_TIMELINE_STREAM_FLAGS
+
+ private:
+  static void ReclaimBlocksForIsolate(Isolate* isolate);
+
+  static TimelineEventRecorder* recorder_;
+  static TimelineStream* vm_stream_;
+
+#define ISOLATE_TIMELINE_STREAM_DECLARE_FLAG(name, not_used)                   \
+  static bool stream_##name##_enabled_;
+  ISOLATE_TIMELINE_STREAM_LIST(ISOLATE_TIMELINE_STREAM_DECLARE_FLAG)
+#undef ISOLATE_TIMELINE_STREAM_DECLARE_FLAG
+
+  friend class TimelineRecorderOverride;
+  friend class ReclaimBlocksIsolateVisitor;
+};
+
+
+struct TimelineEventArgument {
+  const char* name;
+  char* value;
+};
+
 
 // You should get a |TimelineEvent| from a |TimelineStream|.
 class TimelineEvent {
@@ -23,6 +94,8 @@
   // Keep in sync with StateBits below.
   enum EventType {
     kNone,
+    kBegin,
+    kEnd,
     kDuration,
     kInstant,
     kAsyncBegin,
@@ -40,9 +113,8 @@
     return (event_type() > kNone) && (event_type() < kNumEventTypes);
   }
 
-  // Marks the beginning of an asynchronous operation.
-  // Returns |async_id| which must be passed to |AsyncInstant| and |AsyncEnd|.
-  int64_t AsyncBegin(const char* label);
+  // Marks the beginning of an asynchronous operation with |async_id|.
+  void AsyncBegin(const char* label, int64_t async_id);
   // Marks an instantaneous event associated with |async_id|.
   void AsyncInstant(const char* label,
                     int64_t async_id);
@@ -58,6 +130,12 @@
                 int64_t start_micros,
                 int64_t end_micros);
 
+  void Begin(const char* label,
+             int64_t micros = OS::GetCurrentTraceMicros());
+
+  void End(const char* label,
+           int64_t micros = OS::GetCurrentTraceMicros());
+
   // Set the number of arguments in the event.
   void SetNumArguments(intptr_t length);
   // |name| must be a compile time constant. Takes ownership of |argumentp|.
@@ -69,6 +147,8 @@
                       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();
 
@@ -76,26 +156,89 @@
     return EventTypeField::decode(state_);
   }
 
+  bool IsFinishedDuration() const {
+    return (event_type() == kDuration) && (timestamp1_ > timestamp0_);
+  }
+
   int64_t TimeOrigin() const;
   int64_t AsyncId() const;
   int64_t TimeDuration() const;
+  int64_t TimeEnd() const {
+    ASSERT(IsFinishedDuration());
+    return timestamp1_;
+  }
 
   void PrintJSON(JSONStream* stream) const;
 
- private:
-  struct TimelineEventArgument {
-    const char* name;
-    char* value;
-  };
+  ThreadId thread() const {
+    return thread_;
+  }
 
+  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 IsBegin() const {
+    return (event_type() == kBegin);
+  }
+
+  bool IsEnd() const {
+    return (event_type() == kEnd);
+  }
+
+  // Is this event a synchronous begin or end event?
+  bool IsBeginOrEnd() const {
+    return IsBegin() || IsEnd();
+  }
+
+  // Does this duration fully contain |other| ?
+  bool DurationContains(TimelineEvent* other) const {
+    ASSERT(IsFinishedDuration());
+    if (other->IsBegin()) {
+      if (other->TimeOrigin() < TimeOrigin()) {
+        return false;
+      }
+      if (other->TimeOrigin() > TimeEnd()) {
+        return false;
+      }
+      return true;
+    } else {
+      ASSERT(other->IsFinishedDuration());
+      if (other->TimeOrigin() < TimeOrigin()) {
+        return false;
+      }
+      if (other->TimeEnd() < TimeOrigin()) {
+        return false;
+      }
+      if (other->TimeOrigin() > TimeEnd()) {
+        return false;
+      }
+      if (other->TimeEnd() > TimeEnd()) {
+        return false;
+      }
+      return true;
+    }
+  }
+
+ private:
   int64_t timestamp0_;
   int64_t timestamp1_;
   TimelineEventArgument* arguments_;
   intptr_t arguments_length_;
   uword state_;
   const char* label_;
-  TimelineStream* stream_;
-  Thread* thread_;
+  const char* category_;
+  ThreadId thread_;
+  Isolate* isolate_;
 
   void FreeArguments();
 
@@ -103,35 +246,57 @@
   void Init(EventType event_type, const char* label);
 
   void set_event_type(EventType event_type) {
+    // We only reserve 4 bits to hold the event type.
+    COMPILE_ASSERT(kNumEventTypes < 16);
     state_ = EventTypeField::update(event_type, state_);
   }
 
+  void set_global_block(bool global_block) {
+    state_ = GlobalBlockField::update(global_block, state_);
+  }
+
+  bool global_block() const {
+    return GlobalBlockField::decode(state_);
+  }
+
   enum StateBits {
-    kEventTypeBit = 0,
-    // reserve 4 bits for type.
-    kNextBit = 4,
+    kEventTypeBit = 0,  // reserve 4 bits for type.
+    // Was this event allocated from the global block?
+    kGlobalBlockBit = 4,
+    kNextBit = 5,
   };
 
   class EventTypeField : public BitField<EventType, kEventTypeBit, 4> {};
+  class GlobalBlockField : public BitField<bool, kGlobalBlockBit, 1> {};
 
-  friend class TimelineTestHelper;
+  friend class TimelineEventRecorder;
+  friend class TimelineEventEndlessRecorder;
+  friend class TimelineEventRingRecorder;
   friend class TimelineStream;
+  friend class TimelineTestHelper;
   DISALLOW_COPY_AND_ASSIGN(TimelineEvent);
 };
 
 
 // A stream of timeline events. A stream has a name and can be enabled or
-// disabled.
+// disabled (globally and per isolate).
 class TimelineStream {
  public:
   TimelineStream();
 
-  void Init(const char* name, bool enabled);
+  void Init(const char* name,
+            bool enabled,
+            const bool* globally_enabled = NULL);
 
   const char* name() const {
     return name_;
   }
 
+  bool Enabled() const {
+    return ((globally_enabled_ != NULL) && *globally_enabled_) ||
+           enabled();
+  }
+
   bool enabled() const {
     return enabled_;
   }
@@ -140,109 +305,236 @@
     enabled_ = enabled;
   }
 
-  TimelineEventRecorder* recorder() const {
-    return recorder_;
-  }
-
-  // TODO(johnmccutchan): Disallow setting recorder after Init?
-  void set_recorder(TimelineEventRecorder* recorder) {
-    recorder_ = recorder;
-  }
-
   // Records an event. Will return |NULL| if not enabled. The returned
   // |TimelineEvent| is in an undefined state and must be initialized.
-  // |obj| is associated with the returned |TimelineEvent|.
-  TimelineEvent* StartEvent(const Object& obj);
-
-  // Records an event. Will return |NULL| if not enabled. The returned
-  // |TimelineEvent| is in an undefined state and must be initialized.
+  // NOTE: It is not allowed to call StartEvent again without completing
+  // the first event.
   TimelineEvent* StartEvent();
 
-  void CompleteEvent(TimelineEvent* event);
-
-  int64_t GetNextSeq();
-
  private:
-  TimelineEventRecorder* recorder_;
   const char* name_;
   bool enabled_;
-  int64_t seq_;
+  const bool* globally_enabled_;
 };
 
-
-// (name, enabled by default).
-#define ISOLATE_TIMELINE_STREAM_LIST(V)                                        \
-  V(API, false)                                                                \
-  V(Compiler, false)                                                           \
-  V(Embedder, false)                                                           \
-  V(GC, false)                                                                 \
-  V(Isolate, false)                                                            \
-
-
-#define TIMELINE_FUNCTION_COMPILATION_DURATION(isolate, suffix, function)      \
-  TimelineDurationScope tds(isolate,                                           \
-                            isolate->GetCompilerStream(),                      \
-                            "Compile"#suffix);                                 \
+#define TIMELINE_FUNCTION_COMPILATION_DURATION(thread, suffix, function)       \
+  TimelineDurationScope tds(thread,                                            \
+                            thread->isolate()->GetCompilerStream(),            \
+                            "Compile" suffix);                                 \
   if (tds.enabled()) {                                                         \
     tds.SetNumArguments(1);                                                    \
     tds.CopyArgument(                                                          \
         0,                                                                     \
         "function",                                                            \
-        const_cast<char*>(function.QualifiedUserVisibleNameCString()));        \
+        const_cast<char*>(function.ToLibNamePrefixedQualifiedCString()));      \
   }
 
+
 class TimelineDurationScope : public StackResource {
  public:
-  TimelineDurationScope(Isolate* isolate,
+  TimelineDurationScope(TimelineStream* stream,
+                        const char* label);
+
+  TimelineDurationScope(Thread* thread,
                         TimelineStream* stream,
-                        const char* label)
-      : StackResource(isolate) {
-    event_ = stream->StartEvent();
-    if (event_ == NULL) {
-      return;
-    }
-    event_->DurationBegin(label);
-  }
+                        const char* label);
+
+  ~TimelineDurationScope();
 
   bool enabled() const {
-    return event_ != NULL;
+    return enabled_;
   }
 
-  void SetNumArguments(intptr_t length) {
-    if (event_ == NULL) {
-      return;
-    }
-    event_->SetNumArguments(length);
-  }
+  void SetNumArguments(intptr_t length);
 
-  void SetArgument(intptr_t i, const char* name, char* argument) {
-    if (event_ == NULL) {
-      return;
-    }
-    event_->SetArgument(i, name, argument);
-  }
+  void SetArgument(intptr_t i, const char* name, char* argument);
 
-  void CopyArgument(intptr_t i, const char* name, const char* argument) {
-    if (event_ == NULL) {
-      return;
-    }
-    event_->CopyArgument(i, name, argument);
-  }
+  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);
 
-  ~TimelineDurationScope() {
-    if (event_ == NULL) {
-      return;
+ private:
+  void Init();
+  void FreeArguments();
+
+  int64_t timestamp_;
+  TimelineStream* stream_;
+  const char* label_;
+  TimelineEventArgument* arguments_;
+  intptr_t arguments_length_;
+  bool enabled_;
+
+  DISALLOW_COPY_AND_ASSIGN(TimelineDurationScope);
+};
+
+
+// A block of |TimelineEvent|s. Not thread safe.
+class TimelineEventBlock {
+ public:
+  static const intptr_t kBlockSize = 64;
+
+  explicit TimelineEventBlock(intptr_t index);
+  ~TimelineEventBlock();
+
+  TimelineEventBlock* next() const {
+    return next_;
+  }
+  void set_next(TimelineEventBlock* next) {
+    next_ = next;
+  }
+
+  intptr_t length() const {
+    return length_;
+  }
+
+  intptr_t block_index() const {
+    return block_index_;
+  }
+
+  bool IsEmpty() const {
+    return length_ == 0;
+  }
+
+  bool IsFull() const {
+    return length_ == kBlockSize;
+  }
+
+  TimelineEvent* At(intptr_t index) {
+    ASSERT(index >= 0);
+    ASSERT(index < kBlockSize);
+    return &events_[index];
+  }
+
+  const TimelineEvent* At(intptr_t index) const {
+    ASSERT(index >= 0);
+    ASSERT(index < kBlockSize);
+    return &events_[index];
+  }
+
+  // Attempt to sniff a thread id from the first event.
+  ThreadId thread() const;
+  // Attempt to sniff the timestamp from the first event.
+  int64_t LowerTimeBound() const;
+
+  // Returns false if |this| violates any of the following invariants:
+  // - events in the block come from one thread.
+  // - events have monotonically increasing timestamps.
+  bool CheckBlock();
+
+  // Call Reset on all events and set length to 0.
+  void Reset();
+
+  // Only safe to access under the recorder's lock.
+  bool in_use() const {
+    return in_use_;
+  }
+
+  // Only safe to access under the recorder's lock.
+  Isolate* isolate() const {
+    return isolate_;
+  }
+
+ protected:
+  TimelineEvent* StartEvent();
+
+  TimelineEvent events_[kBlockSize];
+  TimelineEventBlock* next_;
+  intptr_t length_;
+  intptr_t block_index_;
+
+  // Only accessed under the recorder's lock.
+  Isolate* isolate_;
+  bool in_use_;
+
+  void Open(Isolate* isolate);
+  void Finish();
+
+  friend class Thread;
+  friend class ThreadRegistry;
+  friend class TimelineEventRecorder;
+  friend class TimelineEventRingRecorder;
+  friend class TimelineEventEndlessRecorder;
+  friend class TimelineTestHelper;
+
+ private:
+  DISALLOW_COPY_AND_ASSIGN(TimelineEventBlock);
+};
+
+
+class TimelineEventFilter : public ValueObject {
+ public:
+  TimelineEventFilter();
+  virtual ~TimelineEventFilter();
+
+  virtual bool IncludeBlock(TimelineEventBlock* block) {
+    if (block == NULL) {
+      return false;
     }
-    event_->DurationEnd();
-    event_->Complete();
+    // Not empty and not in use.
+    return !block->IsEmpty() && !block->in_use();
+  }
+
+  virtual bool IncludeEvent(TimelineEvent* event) {
+    if (event == NULL) {
+      return false;
+    }
+    return event->IsValid();
   }
 
  private:
-  TimelineEvent* event_;
+};
+
+
+class IsolateTimelineEventFilter : public TimelineEventFilter {
+ public:
+  explicit IsolateTimelineEventFilter(Isolate* isolate);
+
+  bool IncludeBlock(TimelineEventBlock* block) {
+    if (block == NULL) {
+      return false;
+    }
+    // Not empty, not in use, and isolate match.
+    return !block->IsEmpty() && !block->in_use() &&
+           (block->isolate() == isolate_);
+  }
+
+ private:
+  Isolate* isolate_;
+};
+
+
+// Timeline events from Dart code are eagerly converted to JSON and stored
+// as a C string.
+class DartTimelineEvent {
+ public:
+  DartTimelineEvent();
+  ~DartTimelineEvent();
+
+  void Clear();
+
+  // This function makes a copy of |event|.
+  void Init(Isolate* isolate, const char* event);
+
+  bool IsValid() const {
+    return (isolate_ != NULL) &&
+           (event_as_json_ != NULL);
+  }
+
+  Isolate* isolate() const {
+    return isolate_;
+  }
+
+  char* event_as_json() const {
+    return event_as_json_;
+  }
+
+ private:
+  Isolate* isolate_;
+  char* event_as_json_;
+
+  DISALLOW_COPY_AND_ASSIGN(DartTimelineEvent);
 };
 
 
@@ -252,23 +544,50 @@
   TimelineEventRecorder();
   virtual ~TimelineEventRecorder() {}
 
-  // Interface method(s) which must be implemented.
-  virtual void PrintJSON(JSONStream* js) const = 0;
+  TimelineEventBlock* GetNewBlock();
 
-  void WriteTo(const char* directory);
+  // Interface method(s) which must be implemented.
+  virtual void PrintJSON(JSONStream* js, TimelineEventFilter* filter) = 0;
+  virtual void PrintTraceEvent(JSONStream* js, TimelineEventFilter* filter) = 0;
+
+  int64_t GetNextAsyncId();
+
+  void FinishBlock(TimelineEventBlock* block);
+
+  // Interface method(s) which must be implemented.
+  virtual void AppendDartEvent(Isolate* isolate, const char* event) = 0;
 
  protected:
+  void WriteTo(const char* directory);
+
   // Interface method(s) which must be implemented.
-  virtual void VisitObjectPointers(ObjectPointerVisitor* visitor) = 0;
-  virtual TimelineEvent* StartEvent(const Object& object) = 0;
   virtual TimelineEvent* StartEvent() = 0;
   virtual void CompleteEvent(TimelineEvent* event) = 0;
+  virtual TimelineEventBlock* GetHeadBlockLocked() = 0;
+  virtual TimelineEventBlock* GetNewBlockLocked(Isolate* isolate) = 0;
+  virtual intptr_t NumDartEventsLocked() = 0;
+  virtual DartTimelineEvent* DartEventAtLocked(intptr_t i) = 0;
 
   // Utility method(s).
   void PrintJSONMeta(JSONArray* array) const;
+  TimelineEvent* ThreadBlockStartEvent();
+  TimelineEvent* GlobalBlockStartEvent();
+  void ThreadBlockCompleteEvent(TimelineEvent* event);
+  void GlobalBlockCompleteEvent(TimelineEvent* event);
 
+  Mutex lock_;
+  // Only accessed under |lock_|.
+  TimelineEventBlock* global_block_;
+  void ReclaimGlobalBlock();
+
+  uintptr_t async_id_;
+
+  friend class DartTimelineEventIterator;
+  friend class TimelineEvent;
+  friend class TimelineEventBlockIterator;
   friend class TimelineStream;
-  friend class Isolate;
+  friend class TimelineTestHelper;
+  friend class Timeline;
 
  private:
   DISALLOW_COPY_AND_ASSIGN(TimelineEventRecorder);
@@ -280,51 +599,148 @@
  public:
   static const intptr_t kDefaultCapacity = 8192;
 
-  static intptr_t SizeForCapacity(intptr_t capacity);
-
   explicit TimelineEventRingRecorder(intptr_t capacity = kDefaultCapacity);
   ~TimelineEventRingRecorder();
 
-  void PrintJSON(JSONStream* js) const;
+  void PrintJSON(JSONStream* js, TimelineEventFilter* filter);
+  void PrintTraceEvent(JSONStream* js, TimelineEventFilter* filter);
+
+  void AppendDartEvent(Isolate* isolate, const char* event);
 
  protected:
-  void VisitObjectPointers(ObjectPointerVisitor* visitor);
-  TimelineEvent* StartEvent(const Object& object);
   TimelineEvent* StartEvent();
   void CompleteEvent(TimelineEvent* event);
+  TimelineEventBlock* GetHeadBlockLocked();
+  intptr_t FindOldestBlockIndex() const;
+  TimelineEventBlock* GetNewBlockLocked(Isolate* isolate);
+  intptr_t NumDartEventsLocked();
+  DartTimelineEvent* DartEventAtLocked(intptr_t i);
 
-  void PrintJSONEvents(JSONArray* array) const;
+  void PrintJSONEvents(JSONArray* array, TimelineEventFilter* filter) const;
 
-  intptr_t GetNextIndex();
-
-  // events_[i] and event_objects_[i] are indexed together.
-  TimelineEvent* events_;
-  RawArray* event_objects_;
-  uintptr_t cursor_;
+  TimelineEventBlock** blocks_;
   intptr_t capacity_;
+  intptr_t num_blocks_;
+  intptr_t block_cursor_;
+
+  DartTimelineEvent** dart_events_;
+  intptr_t dart_events_capacity_;
+  intptr_t dart_events_cursor_;
 };
 
 
 // An abstract recorder that calls |StreamEvent| whenever an event is complete.
-// This recorder does not track Dart objects.
 class TimelineEventStreamingRecorder : public TimelineEventRecorder {
  public:
   TimelineEventStreamingRecorder();
   ~TimelineEventStreamingRecorder();
 
-  void PrintJSON(JSONStream* js) const;
+  void PrintJSON(JSONStream* js, TimelineEventFilter* filter);
+  void PrintTraceEvent(JSONStream* js, TimelineEventFilter* filter);
+
+  void AppendDartEvent(Isolate* isolate, const char* event);
 
   // Called when |event| is ready to be streamed. It is unsafe to keep a
   // reference to |event| as it may be freed as soon as this function returns.
   virtual void StreamEvent(TimelineEvent* event) = 0;
+  virtual void StreamDartEvent(const char* event) = 0;
 
  protected:
-  void VisitObjectPointers(ObjectPointerVisitor* visitor);
-  TimelineEvent* StartEvent(const Object& object);
+  TimelineEventBlock* GetNewBlockLocked(Isolate* isolate) {
+    return NULL;
+  }
+  TimelineEventBlock* GetHeadBlockLocked() {
+    return NULL;
+  }
+  intptr_t NumDartEventsLocked();
+  DartTimelineEvent* DartEventAtLocked(intptr_t i);
   TimelineEvent* StartEvent();
   void CompleteEvent(TimelineEvent* event);
 };
 
+
+// A recorder that stores events in chains of blocks of events.
+// NOTE: This recorder will continue to allocate blocks until it exhausts
+// memory.
+class TimelineEventEndlessRecorder : public TimelineEventRecorder {
+ public:
+  TimelineEventEndlessRecorder();
+
+  void PrintJSON(JSONStream* js, TimelineEventFilter* filter);
+  void PrintTraceEvent(JSONStream* js, TimelineEventFilter* filter);
+
+  void AppendDartEvent(Isolate* isolate, const char* event);
+
+ protected:
+  TimelineEvent* StartEvent();
+  void CompleteEvent(TimelineEvent* event);
+  TimelineEventBlock* GetNewBlockLocked(Isolate* isolate);
+  TimelineEventBlock* GetHeadBlockLocked();
+  intptr_t NumDartEventsLocked();
+  DartTimelineEvent* DartEventAtLocked(intptr_t i);
+
+  void PrintJSONEvents(JSONArray* array, TimelineEventFilter* filter) const;
+
+  // Useful only for testing. Only works for one thread.
+  void Clear();
+
+  TimelineEventBlock* head_;
+  intptr_t block_index_;
+
+  DartTimelineEvent** dart_events_;
+  intptr_t dart_events_capacity_;
+  intptr_t dart_events_cursor_;
+
+  friend class TimelineTestHelper;
+};
+
+
+// An iterator for blocks.
+class TimelineEventBlockIterator {
+ public:
+  explicit TimelineEventBlockIterator(TimelineEventRecorder* recorder);
+  ~TimelineEventBlockIterator();
+
+  void Reset(TimelineEventRecorder* recorder);
+
+  // Returns false when there are no more blocks.
+  bool HasNext() const;
+
+  // Returns the next block and moves forward.
+  TimelineEventBlock* Next();
+
+ private:
+  TimelineEventBlock* current_;
+  TimelineEventRecorder* recorder_;
+};
+
+
+// An iterator for timeline events.
+class DartTimelineEventIterator {
+ public:
+  explicit DartTimelineEventIterator(TimelineEventRecorder* recorder);
+  ~DartTimelineEventIterator();
+
+  void Reset(TimelineEventRecorder* recorder);
+
+  // Returns true if there is another event.
+  bool HasNext() const;
+
+  // Returns the next event and moves forward.
+  DartTimelineEvent* Next();
+
+  // Returns a zone allocated string of all trace events for isolate.
+  // If isolate is NULL, all isolates' events will be included.
+  static const char* PrintTraceEvents(TimelineEventRecorder* recorder,
+                                      Zone* zone,
+                                      Isolate* isolate);
+
+ private:
+  intptr_t cursor_;
+  intptr_t num_events_;
+  TimelineEventRecorder* recorder_;
+};
+
 }  // namespace dart
 
 #endif  // VM_TIMELINE_H_
diff --git a/runtime/vm/timeline_analysis.cc b/runtime/vm/timeline_analysis.cc
new file mode 100644
index 0000000..faf2f5e
--- /dev/null
+++ b/runtime/vm/timeline_analysis.cc
@@ -0,0 +1,632 @@
+// 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.
+
+#include "vm/timeline_analysis.h"
+
+#include "vm/flags.h"
+#include "vm/log.h"
+#include "vm/os_thread.h"
+
+namespace dart {
+
+DECLARE_FLAG(bool, trace_timeline_analysis);
+DECLARE_FLAG(bool, timing);
+
+TimelineAnalysisThread::TimelineAnalysisThread(ThreadId id)
+    : id_(id) {
+}
+
+
+TimelineAnalysisThread::~TimelineAnalysisThread() {
+}
+
+
+void TimelineAnalysisThread::AddBlock(TimelineEventBlock* block) {
+  blocks_.Add(block);
+}
+
+
+static int CompareBlocksLowerTimeBound(TimelineEventBlock* const* a,
+                                       TimelineEventBlock* const* b) {
+  ASSERT(a != NULL);
+  ASSERT(*a != NULL);
+  ASSERT(b != NULL);
+  ASSERT(*b != NULL);
+  return (*a)->LowerTimeBound() - (*b)->LowerTimeBound();
+}
+
+
+void TimelineAnalysisThread::Finalize() {
+  blocks_.Sort(CompareBlocksLowerTimeBound);
+  if (FLAG_trace_timeline_analysis) {
+    THR_Print("Thread %" Px " has %" Pd " blocks\n",
+              OSThread::ThreadIdToIntPtr(id_),
+              blocks_.length());
+  }
+}
+
+
+TimelineAnalysisThreadEventIterator::TimelineAnalysisThreadEventIterator(
+    TimelineAnalysisThread* thread) {
+  Reset(thread);
+}
+
+
+TimelineAnalysisThreadEventIterator::~TimelineAnalysisThreadEventIterator() {
+  Reset(NULL);
+}
+
+
+void TimelineAnalysisThreadEventIterator::Reset(
+    TimelineAnalysisThread* thread) {
+  current_ = NULL;
+  thread_ = thread;
+  block_cursor_ = 0;
+  event_cursor_ = 0;
+  if (thread_ == NULL) {
+    return;
+  }
+  if (thread_->NumBlocks() == 0) {
+    return;
+  }
+  TimelineEventBlock* block = thread_->At(block_cursor_);
+  ASSERT(!block->IsEmpty());
+  current_ = block->At(event_cursor_++);
+}
+
+
+bool TimelineAnalysisThreadEventIterator::HasNext() const {
+  return current_ != NULL;
+}
+
+
+TimelineEvent* TimelineAnalysisThreadEventIterator::Next() {
+  ASSERT(current_ != NULL);
+  TimelineEvent* r = current_;
+  current_ = NULL;
+
+  TimelineEventBlock* block = thread_->At(block_cursor_);
+  if (event_cursor_ == block->length()) {
+    // Reached the end of this block, move to the next.
+    block_cursor_++;
+    if (block_cursor_ == thread_->NumBlocks()) {
+      // Exhausted our supply of blocks.
+      return r;
+    }
+    // Grab next block.
+    block = thread_->At(block_cursor_);
+    event_cursor_ = 0;
+    ASSERT(!block->IsEmpty());
+  }
+  current_ = block->At(event_cursor_++);
+  return r;
+}
+
+
+TimelineAnalysis::TimelineAnalysis(Zone* zone,
+                                   Isolate* isolate,
+                                   TimelineEventRecorder* recorder)
+    : zone_(zone),
+      isolate_(isolate),
+      recorder_(recorder),
+      has_error_(false),
+      error_msg_(NULL) {
+  ASSERT(zone_ != NULL);
+  ASSERT(isolate_ != NULL);
+  ASSERT(recorder_ != NULL);
+}
+
+
+TimelineAnalysis::~TimelineAnalysis() {
+}
+
+
+void TimelineAnalysis::BuildThreads() {
+  DiscoverThreads();
+  FinalizeThreads();
+}
+
+
+TimelineAnalysisThread* TimelineAnalysis::GetThread(ThreadId tid) {
+  // Linear lookup because we expect N (# of threads in an isolate) to be small.
+  for (intptr_t i = 0; i < threads_.length(); i++) {
+    TimelineAnalysisThread* thread = threads_.At(i);
+    ASSERT(thread != NULL);
+    if (thread->id() == tid) {
+      return thread;
+    }
+  }
+  return NULL;
+}
+
+
+TimelineAnalysisThread* TimelineAnalysis::GetOrAddThread(ThreadId tid) {
+  TimelineAnalysisThread* thread = GetThread(tid);
+  if (thread != NULL) {
+    return thread;
+  }
+  // New thread.
+  thread = new TimelineAnalysisThread(tid);
+  threads_.Add(thread);
+  return thread;
+}
+
+
+void TimelineAnalysis::DiscoverThreads() {
+  TimelineEventBlockIterator it(recorder_);
+  while (it.HasNext()) {
+    TimelineEventBlock* block = it.Next();
+    ASSERT(block != NULL);
+    if (block->IsEmpty()) {
+      // Skip empty blocks.
+      continue;
+    }
+    if (block->isolate() != isolate_) {
+      // Skip blocks for other isolates.
+      continue;
+    }
+    if (!block->CheckBlock()) {
+      if (FLAG_trace_timeline_analysis) {
+        THR_Print("DiscoverThreads block %" Pd " "
+                  "violates invariants.\n", block->block_index());
+      }
+      SetError("Block %" Pd " violates invariants. See "
+               "TimelineEventBlock::CheckBlock", block->block_index());
+      return;
+    }
+    TimelineAnalysisThread* thread = GetOrAddThread(block->thread());
+    ASSERT(thread != NULL);
+    thread->AddBlock(block);
+  }
+}
+
+
+void TimelineAnalysis::FinalizeThreads() {
+  for (intptr_t i = 0; i < threads_.length(); i++) {
+    TimelineAnalysisThread* thread = threads_.At(i);
+    ASSERT(thread != NULL);
+    thread->Finalize();
+  }
+}
+
+
+void TimelineAnalysis::SetError(const char* format, ...) {
+  ASSERT(!has_error_);
+  ASSERT(error_msg_ == NULL);
+  has_error_ = true;
+  va_list args;
+  va_start(args, format);
+  error_msg_ = zone_->VPrint(format, args);
+  ASSERT(error_msg_ != NULL);
+  if (FLAG_trace_timeline_analysis) {
+    OS::Print("TimelineAnalysis error = %s\n", error_msg_);
+  }
+}
+
+
+TimelineLabelPauseInfo::TimelineLabelPauseInfo(const char* name)
+    : name_(name),
+      inclusive_micros_(0),
+      exclusive_micros_(0),
+      max_inclusive_micros_(0),
+      max_exclusive_micros_(0) {
+  ASSERT(name_ != NULL);
+}
+
+
+void TimelineLabelPauseInfo::OnPush(int64_t micros, bool already_on_stack) {
+  UpdateInclusiveMicros(micros, already_on_stack);
+}
+
+
+void TimelineLabelPauseInfo::OnPop(int64_t exclusive_micros) {
+  UpdateExclusiveMicros(exclusive_micros);
+}
+
+
+void TimelineLabelPauseInfo::OnBeginPop(int64_t inclusive_micros,
+                                        int64_t exclusive_micros,
+                                        bool already_on_stack) {
+  UpdateInclusiveMicros(inclusive_micros, already_on_stack);
+  UpdateExclusiveMicros(exclusive_micros);
+}
+
+
+void TimelineLabelPauseInfo::UpdateInclusiveMicros(int64_t inclusive_micros,
+                                                   bool already_on_stack) {
+  if (!already_on_stack) {
+    // Only adjust inclusive counts if we aren't already on the stack.
+    add_inclusive_micros(inclusive_micros);
+    if (inclusive_micros > max_inclusive_micros_) {
+      max_inclusive_micros_ = inclusive_micros;
+    }
+  }
+}
+
+
+void TimelineLabelPauseInfo::UpdateExclusiveMicros(int64_t exclusive_micros) {
+  add_exclusive_micros(exclusive_micros);
+  if (exclusive_micros > max_exclusive_micros_) {
+    max_exclusive_micros_ = exclusive_micros;
+  }
+}
+
+
+void TimelineLabelPauseInfo::Aggregate(
+    const TimelineLabelPauseInfo* thread_pause_info) {
+  ASSERT(thread_pause_info != NULL);
+  inclusive_micros_ += thread_pause_info->inclusive_micros_;
+  exclusive_micros_ += thread_pause_info->exclusive_micros_;
+  if (max_inclusive_micros_ < thread_pause_info->max_inclusive_micros_) {
+    max_inclusive_micros_ = thread_pause_info->max_inclusive_micros_;
+  }
+  if (max_exclusive_micros_ < thread_pause_info->max_exclusive_micros_) {
+    max_exclusive_micros_ = thread_pause_info->max_exclusive_micros_;
+  }
+}
+
+
+TimelinePauses::TimelinePauses(Zone* zone,
+                               Isolate* isolate,
+                               TimelineEventRecorder* recorder)
+    : TimelineAnalysis(zone, isolate, recorder) {
+}
+
+
+void TimelinePauses::Setup() {
+  BuildThreads();
+}
+
+
+void TimelinePauses::CalculatePauseTimesForThread(ThreadId tid) {
+  if (has_error()) {
+    return;
+  }
+  TimelineAnalysisThread* thread = GetThread(tid);
+  if (thread == NULL) {
+    SetError("Thread %" Px " does not exist.", OSThread::ThreadIdToIntPtr(tid));
+    return;
+  }
+  ProcessThread(thread);
+}
+
+
+TimelineLabelPauseInfo* TimelinePauses::GetLabelPauseInfo(
+    const char* name) const {
+  ASSERT(name != NULL);
+  // Linear lookup because we expect N (# of labels in an isolate) to be small.
+  for (intptr_t i = 0; i < labels_.length(); i++) {
+    TimelineLabelPauseInfo* label = labels_.At(i);
+    if (strcmp(label->name(), name) == 0) {
+      return label;
+    }
+  }
+  return NULL;
+}
+
+
+int64_t TimelinePauses::InclusiveTime(const char* name) const {
+  TimelineLabelPauseInfo* pause_info = GetLabelPauseInfo(name);
+  ASSERT(pause_info != NULL);
+  return pause_info->inclusive_micros();
+}
+
+
+int64_t TimelinePauses::ExclusiveTime(const char* name) const {
+  TimelineLabelPauseInfo* pause_info = GetLabelPauseInfo(name);
+  ASSERT(pause_info != NULL);
+  return pause_info->exclusive_micros();
+}
+
+
+int64_t TimelinePauses::MaxInclusiveTime(const char* name) const {
+  TimelineLabelPauseInfo* pause_info = GetLabelPauseInfo(name);
+  ASSERT(pause_info != NULL);
+  return pause_info->max_inclusive_micros();
+}
+
+
+int64_t TimelinePauses::MaxExclusiveTime(const char* name) const {
+  TimelineLabelPauseInfo* pause_info = GetLabelPauseInfo(name);
+  ASSERT(pause_info != NULL);
+  return pause_info->max_exclusive_micros();
+}
+
+
+void TimelinePauses::ProcessThread(TimelineAnalysisThread* thread) {
+  ASSERT(thread != NULL);
+  stack_.Clear();
+  labels_.Clear();
+
+  TimelineAnalysisThreadEventIterator it(thread);
+  if (FLAG_trace_timeline_analysis) {
+    THR_Print(">>> TimelinePauses::ProcessThread %" Px "\n",
+              OSThread::ThreadIdToIntPtr(thread->id()));
+  }
+  intptr_t event_count = 0;
+  while (!has_error() && it.HasNext()) {
+    TimelineEvent* event = it.Next();
+    if (event->IsFinishedDuration()) {
+      int64_t start = event->TimeOrigin();
+      PopFinishedDurations(start);
+      if (!CheckStack(event)) {
+        SetError("Duration check fail.");
+        return;
+      }
+      event_count++;
+      Push(event);
+    } else if (event->IsBeginOrEnd()) {
+      event_count++;
+      if (event->IsBegin()) {
+        PopFinishedDurations(event->TimeOrigin());
+        Push(event);
+      } else {
+        ASSERT(event->IsEnd());
+        PopFinishedDurations(event->TimeOrigin());
+        PopBegin(event->label(), event->TimeOrigin());
+      }
+    } else {
+      // Skip other event kinds.
+    }
+  }
+  // Pop remaining duration stack.
+  PopFinishedDurations(kMaxInt64);
+  if (FLAG_trace_timeline_analysis) {
+    THR_Print("<<< TimelinePauses::ProcessThread %" Px " had %" Pd " events\n",
+              OSThread::ThreadIdToIntPtr(thread->id()),
+              event_count);
+  }
+}
+
+
+// Verify that |event| is contained within all parent events on the stack.
+bool TimelinePauses::CheckStack(TimelineEvent* event) {
+  ASSERT(event != NULL);
+  for (intptr_t i = 0; i < stack_.length(); i++) {
+    const StackItem& slot = stack_.At(i);
+    if (slot.event->IsDuration()) {
+      if (!slot.event->DurationContains(event)) {
+        return false;
+      }
+    } else {
+      ASSERT(slot.event->IsBegin());
+      if (slot.event->TimeOrigin() > event->TimeOrigin()) {
+        return false;
+      }
+    }
+  }
+  return true;
+}
+
+
+void TimelinePauses::PopFinishedDurations(int64_t start) {
+  while (stack_.length() > 0) {
+    const StackItem& top = stack_.Last();
+    if (top.event->IsDuration() && top.event->DurationFinishedBefore(start)) {
+      top.pause_info->OnPop(top.exclusive_micros);
+      // 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);
+      }
+    } else {
+      return;
+    }
+  }
+}
+
+
+void TimelinePauses::PopBegin(const char* label, int64_t end) {
+  if (stack_.length() == 0) {
+    SetError("PopBegin(%s, ...) called with empty stack.", label);
+    return;
+  }
+  ASSERT(stack_.length() > 0);
+  const StackItem& top = stack_.Last();
+  const char* top_label = top.event->label();
+  const bool top_is_begin = top.event->IsBegin();
+  const int64_t start = top.event->TimeOrigin();
+  if (start > end) {
+    SetError("Bad time stamps for PopBegin(%s, ...) %" Pd64 " > %" Pd64 "",
+             label, start, end);
+    return;
+  }
+  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());
+    return;
+  }
+  if (!top_is_begin) {
+    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);
+  }
+  const int64_t exclusive_micros = top.exclusive_micros + duration;
+  stack_.RemoveLast();
+  top.pause_info->OnBeginPop(duration,
+                             exclusive_micros,
+                             IsLabelOnStack(top_label));
+  if (StackDepth() > 0) {
+    StackItem& top = GetStackTop();
+    // |top| is under the popped |event|'s shadow, adjust the exclusive micros.
+    top.exclusive_micros -= duration;
+  }
+}
+
+
+void TimelinePauses::Push(TimelineEvent* event) {
+  TimelineLabelPauseInfo* pause_info = GetOrAddLabelPauseInfo(event->label());
+  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(),
+              event->TimeDuration());
+  }
+  if (event->IsDuration()) {
+    pause_info->OnPush(event->TimeDuration(), IsLabelOnStack(event->label()));
+    if (StackDepth() > 0) {
+      StackItem& top = GetStackTop();
+      // |top| is under |event|'s shadow, adjust the exclusive micros.
+      top.exclusive_micros -= event->TimeDuration();
+    }
+    // Push onto the stack.
+    StackItem item;
+    item.event = event;
+    item.pause_info = pause_info;
+    item.exclusive_micros = event->TimeDuration();
+    stack_.Add(item);
+  } else {
+    ASSERT(event->IsBegin());
+    pause_info->OnPush(0, IsLabelOnStack(event->label()));
+    // Push onto the stack.
+    StackItem item;
+    item.event = event;
+    item.pause_info = pause_info;
+    item.exclusive_micros = 0;
+    stack_.Add(item);
+  }
+}
+
+
+bool TimelinePauses::IsLabelOnStack(const char* label) const {
+  ASSERT(label != NULL);
+  for (intptr_t i = 0; i < stack_.length(); i++) {
+    const StackItem& slot = stack_.At(i);
+    if (strcmp(slot.event->label(), label) == 0) {
+      return true;
+    }
+  }
+  return false;
+}
+
+
+intptr_t TimelinePauses::StackDepth() const {
+  return stack_.length();
+}
+
+
+TimelinePauses::StackItem& TimelinePauses::GetStackTop() {
+  ASSERT(stack_.length() > 0);
+  return stack_.Last();
+}
+
+
+TimelineLabelPauseInfo* TimelinePauses::GetOrAddLabelPauseInfo(
+    const char* name) {
+  ASSERT(name != NULL);
+  TimelineLabelPauseInfo* pause_info = GetLabelPauseInfo(name);
+  if (pause_info != NULL) {
+    return pause_info;
+  }
+  // New label.
+  pause_info = new TimelineLabelPauseInfo(name);
+  labels_.Add(pause_info);
+  return pause_info;
+}
+
+
+TimelinePauseTrace::TimelinePauseTrace() {
+}
+
+
+TimelinePauseTrace::~TimelinePauseTrace() {
+}
+
+
+void TimelinePauseTrace::Print() {
+  Thread* thread = Thread::Current();
+  ASSERT(thread != NULL);
+  Isolate* isolate = thread->isolate();
+  ASSERT(isolate != NULL);
+  Zone* zone = thread->zone();
+  ASSERT(zone != NULL);
+  TimelineEventRecorder* recorder = Timeline::recorder();
+  ASSERT(recorder != NULL);
+  TimelinePauses pauses(zone, isolate, recorder);
+  pauses.Setup();
+
+  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,
+              OSThread::ThreadIdToIntPtr(tat->id()));
+    for (intptr_t j = 0; j < pauses.NumPauseInfos(); j++) {
+      const TimelineLabelPauseInfo* pause_info = pauses.PauseInfoAt(j);
+      ASSERT(pause_info != NULL);
+      Aggregate(pause_info);
+      PrintPauseInfo(pause_info);
+    }
+    THR_Print("\n");
+  }
+  THR_Print("Totals:\n");
+  for (intptr_t i = 0; i < isolate_labels_.length(); i++) {
+    TimelineLabelPauseInfo* pause_info = isolate_labels_.At(i);
+    ASSERT(pause_info != NULL);
+    PrintPauseInfo(pause_info);
+  }
+  THR_Print("\n");
+}
+
+
+TimelineLabelPauseInfo* TimelinePauseTrace::GetOrAddLabelPauseInfo(
+    const char* name) {
+  ASSERT(name != NULL);
+  // Linear lookup because we expect N (# of labels in an isolate) to be small.
+  for (intptr_t i = 0; i < isolate_labels_.length(); i++) {
+    TimelineLabelPauseInfo* label = isolate_labels_.At(i);
+    if (strcmp(label->name(), name) == 0) {
+      return label;
+    }
+  }
+  // New label.
+  TimelineLabelPauseInfo* pause_info = new TimelineLabelPauseInfo(name);
+  isolate_labels_.Add(pause_info);
+  return pause_info;
+}
+
+
+void TimelinePauseTrace::Aggregate(
+    const TimelineLabelPauseInfo* thread_pause_info) {
+  ASSERT(thread_pause_info != NULL);
+  TimelineLabelPauseInfo* isolate_pause_info =
+      GetOrAddLabelPauseInfo(thread_pause_info->name());
+  ASSERT(isolate_pause_info != NULL);
+  isolate_pause_info->Aggregate(thread_pause_info);
+}
+
+
+void TimelinePauseTrace::PrintPauseInfo(
+    const TimelineLabelPauseInfo* pause_info) {
+  ASSERT(pause_info != NULL);
+  THR_Print("%s : ", pause_info->name());
+  THR_Print("%.3f ms total on stack; ",
+            MicrosecondsToMilliseconds(pause_info->inclusive_micros()));
+  THR_Print("%.3f ms total executing; ",
+            MicrosecondsToMilliseconds(pause_info->exclusive_micros()));
+  THR_Print("%.3f ms max on stack; ",
+            MicrosecondsToMilliseconds(pause_info->max_inclusive_micros()));
+  THR_Print("%.3f ms max executing.\n",
+            MicrosecondsToMilliseconds(pause_info->max_exclusive_micros()));
+}
+
+}  // namespace dart
diff --git a/runtime/vm/timeline_analysis.h b/runtime/vm/timeline_analysis.h
new file mode 100644
index 0000000..4f733a6
--- /dev/null
+++ b/runtime/vm/timeline_analysis.h
@@ -0,0 +1,239 @@
+// 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 VM_TIMELINE_ANALYSIS_H_
+#define VM_TIMELINE_ANALYSIS_H_
+
+#include "vm/growable_array.h"
+#include "vm/timeline.h"
+
+namespace dart {
+
+class TimelineAnalysisThread : public ZoneAllocated {
+ public:
+  explicit TimelineAnalysisThread(ThreadId id);
+  ~TimelineAnalysisThread();
+
+  ThreadId id() const {
+    return id_;
+  }
+
+  intptr_t NumBlocks() const {
+    return blocks_.length();
+  }
+
+  TimelineEventBlock* At(intptr_t i) const {
+    return blocks_.At(i);
+  }
+
+ private:
+  void AddBlock(TimelineEventBlock* block);
+  void Finalize();
+
+  const ThreadId id_;
+  ZoneGrowableArray<TimelineEventBlock*> blocks_;
+
+  friend class TimelineAnalysis;
+};
+
+
+class TimelineAnalysisThreadEventIterator : public ValueObject {
+ public:
+  explicit TimelineAnalysisThreadEventIterator(TimelineAnalysisThread* thread);
+  ~TimelineAnalysisThreadEventIterator();
+
+  void Reset(TimelineAnalysisThread* thread);
+
+  bool HasNext() const;
+
+  TimelineEvent* Next();
+
+ private:
+  TimelineAnalysisThread* thread_;
+  TimelineEvent* current_;
+  intptr_t block_cursor_;
+  intptr_t event_cursor_;
+};
+
+
+// Base of all timeline analysis classes. Base functionality:
+// - discovery of all thread ids in a recording.
+// - collecting all ThreadEventBlocks by thread id.
+class TimelineAnalysis : public ValueObject {
+ public:
+  TimelineAnalysis(Zone* zone,
+                   Isolate* isolate,
+                   TimelineEventRecorder* recorder);
+  ~TimelineAnalysis();
+
+  void BuildThreads();
+
+  intptr_t NumThreads() const {
+    return threads_.length();
+  }
+
+  TimelineAnalysisThread* At(intptr_t i) const {
+    return threads_[i];
+  }
+
+  TimelineAnalysisThread* GetThread(ThreadId tid);
+
+  bool has_error() const {
+    return has_error_;
+  }
+
+  const char* error_msg() const {
+    return error_msg_;
+  }
+
+ protected:
+  TimelineAnalysisThread* GetOrAddThread(ThreadId tid);
+
+  void DiscoverThreads();
+  void FinalizeThreads();
+
+  void SetError(const char* format, ...);
+
+  Zone* zone_;
+  Isolate* isolate_;
+  TimelineEventRecorder* recorder_;
+  bool has_error_;
+  const char* error_msg_;
+
+  ZoneGrowableArray<TimelineAnalysisThread*> threads_;
+};
+
+
+class TimelineLabelPauseInfo : public ZoneAllocated {
+ public:
+  explicit TimelineLabelPauseInfo(const char* name);
+
+  const char* name() const {
+    return name_;
+  }
+
+  int64_t inclusive_micros() const {
+    return inclusive_micros_;
+  }
+
+  int64_t exclusive_micros() const {
+    return exclusive_micros_;
+  }
+
+  int64_t max_inclusive_micros() const {
+    return max_inclusive_micros_;
+  }
+
+  int64_t max_exclusive_micros() const {
+    return max_exclusive_micros_;
+  }
+
+ private:
+  // Adjusts |inclusive_micros_| and |exclusive_micros_| by |micros|.
+  // Also, may adjust, max_inclusive_micros_.
+  void OnPush(int64_t micros, bool already_on_stack);
+
+  // Adjusts |exclusive_micros_| by |exclusive_micros|.
+  // Also, may adjust |max_exclusive_micros_|.
+  void OnPop(int64_t exclusive_micros);
+
+  // Adjusts |inclusive_micros_| and |exclusive_micros_| by |micros|.
+  // Also, may adjust, |max_inclusive_micros_|.
+  void OnBeginPop(int64_t inclusive_micros,
+                  int64_t exclusive_micros,
+                  bool already_on_stack);
+
+  void UpdateInclusiveMicros(int64_t inclusive_micros, bool already_on_stack);
+  void UpdateExclusiveMicros(int64_t exclusive_micros);
+
+  // Adjust inclusive micros.
+  void add_inclusive_micros(int64_t delta_micros) {
+    inclusive_micros_ += delta_micros;
+    ASSERT(inclusive_micros_ >= 0);
+  }
+
+  // Adjust exclusive micros.
+  void add_exclusive_micros(int64_t delta_micros) {
+    exclusive_micros_ += delta_micros;
+    ASSERT(exclusive_micros_ >= 0);
+  }
+
+  void Aggregate(const TimelineLabelPauseInfo* thread_pause_info);
+
+  const char* name_;
+  int64_t inclusive_micros_;
+  int64_t exclusive_micros_;
+  int64_t max_inclusive_micros_;
+  int64_t max_exclusive_micros_;
+
+  friend class TimelinePauses;
+  friend class TimelinePauseTrace;
+};
+
+
+class TimelinePauses : public TimelineAnalysis {
+ public:
+  TimelinePauses(Zone* zone,
+                 Isolate* isolate,
+                 TimelineEventRecorder* recorder);
+
+  void Setup();
+
+  void CalculatePauseTimesForThread(ThreadId tid);
+
+  TimelineLabelPauseInfo* GetLabelPauseInfo(const char* name) const;
+
+  int64_t InclusiveTime(const char* name) const;
+  int64_t ExclusiveTime(const char* name) const;
+  int64_t MaxInclusiveTime(const char* name) const;
+  int64_t MaxExclusiveTime(const char* name) const;
+
+  intptr_t NumPauseInfos() const {
+    return labels_.length();
+  }
+
+  const TimelineLabelPauseInfo* PauseInfoAt(intptr_t i) const {
+    return labels_.At(i);
+  }
+
+ private:
+  struct StackItem {
+    TimelineEvent* event;
+    TimelineLabelPauseInfo* pause_info;
+    int64_t exclusive_micros;
+  };
+
+  void ProcessThread(TimelineAnalysisThread* thread);
+  bool CheckStack(TimelineEvent* event);
+  void PopFinishedDurations(int64_t start);
+  void PopBegin(const char* label, int64_t end);
+  void Push(TimelineEvent* event);
+  bool IsLabelOnStack(const char* label) const;
+  intptr_t StackDepth() const;
+  StackItem& GetStackTop();
+  TimelineLabelPauseInfo* GetOrAddLabelPauseInfo(const char* name);
+
+  ZoneGrowableArray<StackItem> stack_;
+  ZoneGrowableArray<TimelineLabelPauseInfo*> labels_;
+};
+
+
+class TimelinePauseTrace : public ValueObject {
+ public:
+  TimelinePauseTrace();
+  ~TimelinePauseTrace();
+
+  void Print();
+
+ private:
+  TimelineLabelPauseInfo* GetOrAddLabelPauseInfo(const char* name);
+  void Aggregate(const TimelineLabelPauseInfo* thread_pause_info);
+  void PrintPauseInfo(const TimelineLabelPauseInfo* pause_info);
+
+  ZoneGrowableArray<TimelineLabelPauseInfo*> isolate_labels_;
+};
+
+}  // namespace dart
+
+#endif  // VM_TIMELINE_ANALYSIS_H_
diff --git a/runtime/vm/timeline_test.cc b/runtime/vm/timeline_test.cc
index 38f907b..17fea5d 100644
--- a/runtime/vm/timeline_test.cc
+++ b/runtime/vm/timeline_test.cc
@@ -2,21 +2,103 @@
 // for 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 <cstring>
+
 #include "platform/assert.h"
 
 #include "vm/dart_api_impl.h"
 #include "vm/dart_api_state.h"
 #include "vm/globals.h"
 #include "vm/timeline.h"
+#include "vm/timeline_analysis.h"
 #include "vm/unit_test.h"
 
 namespace dart {
 
+class TimelineRecorderOverride : public ValueObject {
+ public:
+  explicit TimelineRecorderOverride(TimelineEventRecorder* new_recorder)
+      : recorder_(Timeline::recorder()) {
+    Timeline::recorder_ = new_recorder;
+  }
+
+  ~TimelineRecorderOverride() {
+    Timeline::recorder_ = recorder_;
+  }
+
+ private:
+  TimelineEventRecorder* recorder_;
+};
+
+
 class TimelineTestHelper : public AllStatic {
  public:
   static void SetStream(TimelineEvent* event, TimelineStream* stream) {
     event->StreamInit(stream);
   }
+
+  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);
+    event->thread_ = OSThread::ThreadIdFromIntPtr(ftid);
+    if (stream != NULL) {
+      event->StreamInit(stream);
+    }
+  }
+
+  static void FakeDuration(
+      TimelineEventRecorder* recorder,
+      const char* label,
+      int64_t start,
+      int64_t end) {
+    ASSERT(recorder != NULL);
+    ASSERT(start < end);
+    ASSERT(label != NULL);
+    TimelineEvent* event = recorder->StartEvent();
+    ASSERT(event != NULL);
+    event->Duration(label, start, end);
+    event->Complete();
+  }
+
+  static void FakeBegin(
+      TimelineEventRecorder* recorder,
+      const char* label,
+      int64_t start) {
+    ASSERT(recorder != NULL);
+    ASSERT(label != NULL);
+    ASSERT(start >= 0);
+    TimelineEvent* event = recorder->StartEvent();
+    ASSERT(event != NULL);
+    event->Begin(label, start);
+    event->Complete();
+  }
+
+  static void FakeEnd(
+      TimelineEventRecorder* recorder,
+      const char* label,
+      int64_t end) {
+    ASSERT(recorder != NULL);
+    ASSERT(label != NULL);
+    ASSERT(end >= 0);
+    TimelineEvent* event = recorder->StartEvent();
+    ASSERT(event != NULL);
+    event->End(label, end);
+    event->Complete();
+  }
+
+  static void Clear(TimelineEventEndlessRecorder* recorder) {
+    ASSERT(recorder != NULL);
+    recorder->Clear();
+  }
+
+  static void FinishBlock(TimelineEventBlock* block) {
+    block->Finish();
+  }
 };
 
 
@@ -136,10 +218,10 @@
 
 
 TEST_CASE(TimelineEventBufferPrintJSON) {
-  Isolate* isolate = Isolate::Current();
-  TimelineEventRecorder* recorder = isolate->timeline_event_recorder();
+  TimelineEventRecorder* recorder = Timeline::recorder();
   JSONStream js;
-  recorder->PrintJSON(&js);
+  TimelineEventFilter filter;
+  recorder->PrintJSON(&js, &filter);
   // Check the type. This test will fail if we ever make Timeline public.
   EXPECT_SUBSTRING("\"type\":\"_Timeline\"", js.ToCString());
   // Check that there is a traceEvents array.
@@ -160,6 +242,10 @@
     counts_[event->event_type()]++;
   }
 
+  void StreamDartEvent(const char* event) {
+    // NOOP.
+  }
+
   intptr_t CountFor(TimelineEvent::EventType type) {
     return counts_[type];
   }
@@ -171,6 +257,7 @@
 
 TEST_CASE(TimelineEventStreamingRecorderBasic) {
   EventCounterRecorder* recorder = new EventCounterRecorder();
+  TimelineRecorderOverride override(recorder);
 
   // Initial counts are all zero.
   for (intptr_t i = TimelineEvent::kNone + 1;
@@ -182,7 +269,6 @@
   // Create a test stream.
   TimelineStream stream;
   stream.Init("testStream", true);
-  stream.set_recorder(recorder);
 
   TimelineEvent* event = NULL;
 
@@ -204,8 +290,9 @@
 
   event = stream.StartEvent();
   EXPECT_EQ(0, recorder->CountFor(TimelineEvent::kAsyncBegin));
-  int64_t async_id = event->AsyncBegin("asyncBeginCabbage");
+  int64_t async_id = recorder->GetNextAsyncId();
   EXPECT(async_id >= 0);
+  event->AsyncBegin("asyncBeginCabbage", async_id);
   EXPECT_EQ(0, recorder->CountFor(TimelineEvent::kAsyncBegin));
   event->Complete();
   EXPECT_EQ(1, recorder->CountFor(TimelineEvent::kAsyncBegin));
@@ -225,4 +312,535 @@
   EXPECT_EQ(1, recorder->CountFor(TimelineEvent::kAsyncEnd));
 }
 
+
+static bool LabelMatch(TimelineEvent* event, const char* label) {
+  ASSERT(event != NULL);
+  return strcmp(event->label(), label) == 0;
+}
+
+
+TEST_CASE(TimelineAnalysis_ThreadBlockCount) {
+  TimelineEventEndlessRecorder* recorder = new TimelineEventEndlessRecorder();
+  ASSERT(recorder != NULL);
+  // Blocks owned by thread "1".
+  TimelineEventBlock* block_1_0 = recorder->GetNewBlock();
+  TimelineEventBlock* block_1_1 = recorder->GetNewBlock();
+  TimelineEventBlock* block_1_2 = recorder->GetNewBlock();
+  // Blocks owned by thread "2".
+  TimelineEventBlock* block_2_0 = recorder->GetNewBlock();
+  // Blocks owned by thread "3".
+  TimelineEventBlock* block_3_0 = recorder->GetNewBlock();
+  USE(block_3_0);
+
+  // Add events to each block for thread 1.
+  TimelineTestHelper::FakeThreadEvent(block_1_2, 1, "B1");
+  TimelineTestHelper::FakeThreadEvent(block_1_2, 1, "B2");
+  TimelineTestHelper::FakeThreadEvent(block_1_2, 1, "B3");
+  // Sleep to ensure timestamps differ.
+  OS::Sleep(1);
+  TimelineTestHelper::FakeThreadEvent(block_1_0, 1, "A1");
+  OS::Sleep(1);
+  TimelineTestHelper::FakeThreadEvent(block_1_1, 1, "C1");
+  TimelineTestHelper::FakeThreadEvent(block_1_1, 1, "C2");
+  OS::Sleep(1);
+
+  // Add events to each block for thread 2.
+  TimelineTestHelper::FakeThreadEvent(block_2_0, 2, "A");
+  TimelineTestHelper::FakeThreadEvent(block_2_0, 2, "B");
+  TimelineTestHelper::FakeThreadEvent(block_2_0, 2, "C");
+  TimelineTestHelper::FakeThreadEvent(block_2_0, 2, "D");
+  TimelineTestHelper::FakeThreadEvent(block_2_0, 2, "E");
+  TimelineTestHelper::FakeThreadEvent(block_2_0, 2, "F");
+
+  Zone* zone = thread->zone();
+  Isolate* isolate = thread->isolate();
+
+  // Discover threads in recorder.
+  TimelineAnalysis ta(zone, isolate, recorder);
+  ta.BuildThreads();
+  // block_3_0 is never used by a thread, so we only have two threads.
+  EXPECT_EQ(2, ta.NumThreads());
+
+  // Extract both threads.
+  TimelineAnalysisThread* thread_1 =
+      ta.GetThread(OSThread::ThreadIdFromIntPtr(1));
+  TimelineAnalysisThread* thread_2 =
+      ta.GetThread(OSThread::ThreadIdFromIntPtr(2));
+  EXPECT_EQ(OSThread::ThreadIdFromIntPtr(1), thread_1->id());
+  EXPECT_EQ(OSThread::ThreadIdFromIntPtr(2), thread_2->id());
+
+  // Thread "1" should have three blocks.
+  EXPECT_EQ(3, thread_1->NumBlocks());
+
+  // Verify that blocks for thread "1" are sorted based on start time.
+  EXPECT_EQ(thread_1->At(0), block_1_2);
+  EXPECT_EQ(thread_1->At(1), block_1_0);
+  EXPECT_EQ(thread_1->At(2), block_1_1);
+
+  // Verify that block_1_2 has three events.
+  EXPECT_EQ(3, block_1_2->length());
+
+  // Verify that block_1_0 has one events.
+  EXPECT_EQ(1, block_1_0->length());
+
+  // Verify that block_1_1 has two events.
+  EXPECT_EQ(2, block_1_1->length());
+
+  // Thread '2" should have one block.'
+  EXPECT_EQ(1, thread_2->NumBlocks());
+  EXPECT_EQ(thread_2->At(0), block_2_0);
+  // Verify that block_2_0 has six events.
+  EXPECT_EQ(6, block_2_0->length());
+
+  {
+    TimelineAnalysisThreadEventIterator it(thread_1);
+    // Six events spread across three blocks.
+    EXPECT(it.HasNext());
+    EXPECT(LabelMatch(it.Next(), "B1"));
+    EXPECT(it.HasNext());
+    EXPECT(LabelMatch(it.Next(), "B2"));
+    EXPECT(it.HasNext());
+    EXPECT(LabelMatch(it.Next(), "B3"));
+    EXPECT(it.HasNext());
+    EXPECT(LabelMatch(it.Next(), "A1"));
+    EXPECT(it.HasNext());
+    EXPECT(LabelMatch(it.Next(), "C1"));
+    EXPECT(it.HasNext());
+    EXPECT(LabelMatch(it.Next(), "C2"));
+    EXPECT(!it.HasNext());
+  }
+
+  {
+    TimelineAnalysisThreadEventIterator it(thread_2);
+    // Six events spread across three blocks.
+    EXPECT(it.HasNext());
+    EXPECT(LabelMatch(it.Next(), "A"));
+    EXPECT(it.HasNext());
+    EXPECT(LabelMatch(it.Next(), "B"));
+    EXPECT(it.HasNext());
+    EXPECT(LabelMatch(it.Next(), "C"));
+    EXPECT(it.HasNext());
+    EXPECT(LabelMatch(it.Next(), "D"));
+    EXPECT(it.HasNext());
+    EXPECT(LabelMatch(it.Next(), "E"));
+    EXPECT(it.HasNext());
+    EXPECT(LabelMatch(it.Next(), "F"));
+    EXPECT(!it.HasNext());
+  }
+}
+
+
+TEST_CASE(TimelineRingRecorderJSONOrder) {
+  TimelineStream stream;
+  stream.Init("testStream", true);
+
+  TimelineEventRingRecorder* recorder =
+      new TimelineEventRingRecorder(TimelineEventBlock::kBlockSize * 2);
+
+  TimelineEventBlock* block_0 = recorder->GetNewBlock();
+  EXPECT(block_0 != NULL);
+  TimelineEventBlock* block_1 = recorder->GetNewBlock();
+  EXPECT(block_1 != NULL);
+  // Test that we wrapped.
+  EXPECT(block_0 == recorder->GetNewBlock());
+
+  // Emit the earlier event into block_1.
+  TimelineTestHelper::FakeThreadEvent(block_1, 2, "Alpha", &stream);
+  OS::Sleep(1);
+  // Emit the later event into block_0.
+  TimelineTestHelper::FakeThreadEvent(block_0, 2, "Beta", &stream);
+
+  TimelineTestHelper::FinishBlock(block_0);
+  TimelineTestHelper::FinishBlock(block_1);
+
+  JSONStream js;
+  TimelineEventFilter filter;
+  recorder->PrintJSON(&js, &filter);
+  // trace-event has a requirement that events for a thread must have
+  // monotonically increasing timestamps.
+  // Verify that "Alpha" comes before "Beta" even though "Beta" is in the first
+  // block.
+  const char* alpha = strstr(js.ToCString(), "Alpha");
+  const char* beta = strstr(js.ToCString(), "Beta");
+  EXPECT(alpha < beta);
+}
+
+
+TEST_CASE(TimelinePauses_Basic) {
+  TimelineEventEndlessRecorder* recorder = new TimelineEventEndlessRecorder();
+  ASSERT(recorder != NULL);
+  Zone* zone = thread->zone();
+  Isolate* isolate = thread->isolate();
+  ThreadId tid = OSThread::GetCurrentThreadTraceId();
+
+  // Test case.
+  TimelineTestHelper::FakeDuration(recorder, "a", 0, 10);
+  {
+    TimelinePauses pauses(zone, isolate, recorder);
+    pauses.Setup();
+    pauses.CalculatePauseTimesForThread(tid);
+    EXPECT(!pauses.has_error());
+    EXPECT_EQ(10, pauses.InclusiveTime("a"));
+    EXPECT_EQ(10, pauses.ExclusiveTime("a"));
+    EXPECT_EQ(10, pauses.MaxInclusiveTime("a"));
+    EXPECT_EQ(10, pauses.MaxExclusiveTime("a"));
+  }
+  TimelineTestHelper::Clear(recorder);
+
+  // Test case.
+  TimelineTestHelper::FakeDuration(recorder, "a", 0, 10);
+  TimelineTestHelper::FakeDuration(recorder, "b", 0, 10);
+  {
+    TimelinePauses pauses(zone, isolate, recorder);
+    pauses.Setup();
+    pauses.CalculatePauseTimesForThread(tid);
+    EXPECT(!pauses.has_error());
+    EXPECT_EQ(10, pauses.InclusiveTime("a"));
+    EXPECT_EQ(0, pauses.ExclusiveTime("a"));
+    EXPECT_EQ(10, pauses.MaxInclusiveTime("a"));
+    EXPECT_EQ(0, pauses.MaxExclusiveTime("a"));
+    EXPECT_EQ(10, pauses.InclusiveTime("b"));
+    EXPECT_EQ(10, pauses.ExclusiveTime("b"));
+    EXPECT_EQ(10, pauses.MaxInclusiveTime("b"));
+    EXPECT_EQ(10, pauses.MaxExclusiveTime("b"));
+  }
+  TimelineTestHelper::Clear(recorder);
+
+  // Test case.
+  TimelineTestHelper::FakeDuration(recorder, "a", 0, 10);
+  TimelineTestHelper::FakeDuration(recorder, "b", 1, 8);
+  {
+    TimelinePauses pauses(zone, isolate, recorder);
+    pauses.Setup();
+    pauses.CalculatePauseTimesForThread(tid);
+    EXPECT(!pauses.has_error());
+    EXPECT_EQ(10, pauses.InclusiveTime("a"));
+    EXPECT_EQ(3, pauses.ExclusiveTime("a"));
+    EXPECT_EQ(10, pauses.MaxInclusiveTime("a"));
+    EXPECT_EQ(3, pauses.MaxExclusiveTime("a"));
+    EXPECT_EQ(7, pauses.InclusiveTime("b"));
+    EXPECT_EQ(7, pauses.ExclusiveTime("b"));
+    EXPECT_EQ(7, pauses.MaxInclusiveTime("b"));
+    EXPECT_EQ(7, pauses.MaxExclusiveTime("b"));
+  }
+  TimelineTestHelper::Clear(recorder);
+
+  // Test case.
+  TimelineTestHelper::FakeDuration(recorder, "a", 0, 10);
+  TimelineTestHelper::FakeDuration(recorder, "b", 0, 1);
+  TimelineTestHelper::FakeDuration(recorder, "b", 1, 2);
+  TimelineTestHelper::FakeDuration(recorder, "b", 2, 3);
+  TimelineTestHelper::FakeDuration(recorder, "b", 3, 4);
+  TimelineTestHelper::FakeDuration(recorder, "b", 4, 5);
+  TimelineTestHelper::FakeDuration(recorder, "b", 5, 6);
+  TimelineTestHelper::FakeDuration(recorder, "b", 6, 7);
+  TimelineTestHelper::FakeDuration(recorder, "b", 7, 8);
+  TimelineTestHelper::FakeDuration(recorder, "b", 8, 9);
+  TimelineTestHelper::FakeDuration(recorder, "b", 9, 10);
+  {
+    TimelinePauses pauses(zone, isolate, recorder);
+    pauses.Setup();
+    pauses.CalculatePauseTimesForThread(tid);
+    EXPECT(!pauses.has_error());
+    EXPECT_EQ(10, pauses.InclusiveTime("a"));
+    EXPECT_EQ(0, pauses.ExclusiveTime("a"));
+    EXPECT_EQ(10, pauses.MaxInclusiveTime("a"));
+    EXPECT_EQ(0, pauses.MaxExclusiveTime("a"));
+    EXPECT_EQ(10, pauses.InclusiveTime("b"));
+    EXPECT_EQ(10, pauses.ExclusiveTime("b"));
+    EXPECT_EQ(1, pauses.MaxInclusiveTime("b"));
+    EXPECT_EQ(1, pauses.MaxExclusiveTime("b"));
+  }
+  TimelineTestHelper::Clear(recorder);
+
+  // Test case.
+  TimelineTestHelper::FakeDuration(recorder, "a", 0, 10);
+  TimelineTestHelper::FakeDuration(recorder, "b", 0, 5);
+  TimelineTestHelper::FakeDuration(recorder, "c", 1, 4);
+  TimelineTestHelper::FakeDuration(recorder, "d", 5, 10);
+
+  {
+    TimelinePauses pauses(zone, isolate, recorder);
+    pauses.Setup();
+    pauses.CalculatePauseTimesForThread(tid);
+    EXPECT(!pauses.has_error());
+    EXPECT_EQ(10, pauses.InclusiveTime("a"));
+    EXPECT_EQ(0, pauses.ExclusiveTime("a"));
+    EXPECT_EQ(10, pauses.MaxInclusiveTime("a"));
+    EXPECT_EQ(0, pauses.MaxExclusiveTime("a"));
+    EXPECT_EQ(5, pauses.InclusiveTime("b"));
+    EXPECT_EQ(2, pauses.ExclusiveTime("b"));
+    EXPECT_EQ(5, pauses.MaxInclusiveTime("b"));
+    EXPECT_EQ(2, pauses.MaxExclusiveTime("b"));
+    EXPECT_EQ(3, pauses.InclusiveTime("c"));
+    EXPECT_EQ(3, pauses.ExclusiveTime("c"));
+    EXPECT_EQ(3, pauses.MaxInclusiveTime("c"));
+    EXPECT_EQ(3, pauses.MaxExclusiveTime("c"));
+    EXPECT_EQ(5, pauses.InclusiveTime("d"));
+    EXPECT_EQ(5, pauses.ExclusiveTime("d"));
+    EXPECT_EQ(5, pauses.MaxInclusiveTime("d"));
+    EXPECT_EQ(5, pauses.MaxExclusiveTime("d"));
+  }
+  TimelineTestHelper::Clear(recorder);
+
+  // Test case.
+  TimelineTestHelper::FakeDuration(recorder, "a", 0, 10);
+  TimelineTestHelper::FakeDuration(recorder, "b", 1, 9);
+  TimelineTestHelper::FakeDuration(recorder, "c", 2, 8);
+  TimelineTestHelper::FakeDuration(recorder, "d", 3, 7);
+  TimelineTestHelper::FakeDuration(recorder, "e", 4, 6);
+
+  {
+    TimelinePauses pauses(zone, isolate, recorder);
+    pauses.Setup();
+    pauses.CalculatePauseTimesForThread(tid);
+    EXPECT(!pauses.has_error());
+    EXPECT_EQ(10, pauses.InclusiveTime("a"));
+    EXPECT_EQ(2, pauses.ExclusiveTime("a"));
+    EXPECT_EQ(10, pauses.MaxInclusiveTime("a"));
+    EXPECT_EQ(2, pauses.MaxExclusiveTime("a"));
+    EXPECT_EQ(8, pauses.InclusiveTime("b"));
+    EXPECT_EQ(2, pauses.ExclusiveTime("b"));
+    EXPECT_EQ(8, pauses.MaxInclusiveTime("b"));
+    EXPECT_EQ(2, pauses.MaxExclusiveTime("b"));
+    EXPECT_EQ(6, pauses.InclusiveTime("c"));
+    EXPECT_EQ(2, pauses.ExclusiveTime("c"));
+    EXPECT_EQ(6, pauses.MaxInclusiveTime("c"));
+    EXPECT_EQ(2, pauses.MaxExclusiveTime("c"));
+    EXPECT_EQ(4, pauses.InclusiveTime("d"));
+    EXPECT_EQ(2, pauses.ExclusiveTime("d"));
+    EXPECT_EQ(4, pauses.MaxInclusiveTime("d"));
+    EXPECT_EQ(2, pauses.MaxExclusiveTime("d"));
+    EXPECT_EQ(2, pauses.InclusiveTime("e"));
+    EXPECT_EQ(2, pauses.ExclusiveTime("e"));
+    EXPECT_EQ(2, pauses.MaxInclusiveTime("e"));
+    EXPECT_EQ(2, pauses.MaxExclusiveTime("e"));
+  }
+  TimelineTestHelper::Clear(recorder);
+
+  // Test case.
+  TimelineTestHelper::FakeDuration(recorder, "a", 0, 10);
+  TimelineTestHelper::FakeDuration(recorder, "a", 1, 9);
+
+  {
+    TimelinePauses pauses(zone, isolate, recorder);
+    pauses.Setup();
+    pauses.CalculatePauseTimesForThread(tid);
+    EXPECT(!pauses.has_error());
+    EXPECT_EQ(10, pauses.InclusiveTime("a"));
+    EXPECT_EQ(10, pauses.ExclusiveTime("a"));
+    EXPECT_EQ(10, pauses.MaxInclusiveTime("a"));
+    EXPECT_EQ(8, pauses.MaxExclusiveTime("a"));
+  }
+  TimelineTestHelper::Clear(recorder);
+}
+
+
+TEST_CASE(TimelinePauses_BeginEnd) {
+  TimelineEventEndlessRecorder* recorder = new TimelineEventEndlessRecorder();
+  ASSERT(recorder != NULL);
+  Zone* zone = thread->zone();
+  Isolate* isolate = thread->isolate();
+  ThreadId tid = OSThread::GetCurrentThreadTraceId();
+
+  // Test case.
+  TimelineTestHelper::FakeBegin(recorder, "a", 0);
+  TimelineTestHelper::FakeEnd(recorder, "a", 10);
+
+  {
+    TimelinePauses pauses(zone, isolate, recorder);
+    pauses.Setup();
+    pauses.CalculatePauseTimesForThread(tid);
+    EXPECT(!pauses.has_error());
+    EXPECT_EQ(10, pauses.InclusiveTime("a"));
+    EXPECT_EQ(10, pauses.ExclusiveTime("a"));
+    EXPECT_EQ(10, pauses.MaxInclusiveTime("a"));
+    EXPECT_EQ(10, pauses.MaxExclusiveTime("a"));
+  }
+  TimelineTestHelper::Clear(recorder);
+
+  // Test case.
+  TimelineTestHelper::FakeBegin(recorder, "a", 0);
+  TimelineTestHelper::FakeBegin(recorder, "b", 0);
+  TimelineTestHelper::FakeEnd(recorder, "b", 10);
+  TimelineTestHelper::FakeEnd(recorder, "a", 10);
+
+  {
+    TimelinePauses pauses(zone, isolate, recorder);
+    pauses.Setup();
+    pauses.CalculatePauseTimesForThread(tid);
+    EXPECT(!pauses.has_error());
+    EXPECT_EQ(10, pauses.InclusiveTime("a"));
+    EXPECT_EQ(0, pauses.ExclusiveTime("a"));
+    EXPECT_EQ(10, pauses.MaxInclusiveTime("a"));
+    EXPECT_EQ(0, pauses.MaxExclusiveTime("a"));
+    EXPECT_EQ(10, pauses.InclusiveTime("b"));
+    EXPECT_EQ(10, pauses.ExclusiveTime("b"));
+    EXPECT_EQ(10, pauses.MaxInclusiveTime("b"));
+    EXPECT_EQ(10, pauses.MaxExclusiveTime("b"));
+  }
+  TimelineTestHelper::Clear(recorder);
+
+  // Test case.
+  TimelineTestHelper::FakeBegin(recorder, "a", 0);
+  TimelineTestHelper::FakeBegin(recorder, "b", 1);
+  TimelineTestHelper::FakeEnd(recorder, "b", 8);
+  TimelineTestHelper::FakeEnd(recorder, "a", 10);
+
+  {
+    TimelinePauses pauses(zone, isolate, recorder);
+    pauses.Setup();
+    pauses.CalculatePauseTimesForThread(tid);
+    EXPECT(!pauses.has_error());
+    EXPECT_EQ(10, pauses.InclusiveTime("a"));
+    EXPECT_EQ(3, pauses.ExclusiveTime("a"));
+    EXPECT_EQ(10, pauses.MaxInclusiveTime("a"));
+    EXPECT_EQ(3, pauses.MaxExclusiveTime("a"));
+    EXPECT_EQ(7, pauses.InclusiveTime("b"));
+    EXPECT_EQ(7, pauses.ExclusiveTime("b"));
+    EXPECT_EQ(7, pauses.MaxInclusiveTime("b"));
+    EXPECT_EQ(7, pauses.MaxExclusiveTime("b"));
+  }
+  TimelineTestHelper::Clear(recorder);
+
+  // Test case.
+  TimelineTestHelper::FakeBegin(recorder, "a", 0);
+  TimelineTestHelper::FakeDuration(recorder, "b", 0, 1);
+  TimelineTestHelper::FakeDuration(recorder, "b", 1, 2);
+  TimelineTestHelper::FakeDuration(recorder, "b", 2, 3);
+  TimelineTestHelper::FakeBegin(recorder, "b", 3);
+  TimelineTestHelper::FakeEnd(recorder, "b", 4);
+  TimelineTestHelper::FakeDuration(recorder, "b", 4, 5);
+  TimelineTestHelper::FakeDuration(recorder, "b", 5, 6);
+  TimelineTestHelper::FakeDuration(recorder, "b", 6, 7);
+  TimelineTestHelper::FakeBegin(recorder, "b", 7);
+  TimelineTestHelper::FakeEnd(recorder, "b", 8);
+  TimelineTestHelper::FakeBegin(recorder, "b", 8);
+  TimelineTestHelper::FakeEnd(recorder, "b", 9);
+  TimelineTestHelper::FakeDuration(recorder, "b", 9, 10);
+  TimelineTestHelper::FakeEnd(recorder, "a", 10);
+
+  {
+    TimelinePauses pauses(zone, isolate, recorder);
+    pauses.Setup();
+    pauses.CalculatePauseTimesForThread(tid);
+    EXPECT(!pauses.has_error());
+    EXPECT_EQ(10, pauses.InclusiveTime("a"));
+    EXPECT_EQ(0, pauses.ExclusiveTime("a"));
+    EXPECT_EQ(10, pauses.MaxInclusiveTime("a"));
+    EXPECT_EQ(0, pauses.MaxExclusiveTime("a"));
+    EXPECT_EQ(10, pauses.InclusiveTime("b"));
+    EXPECT_EQ(10, pauses.ExclusiveTime("b"));
+    EXPECT_EQ(1, pauses.MaxInclusiveTime("b"));
+    EXPECT_EQ(1, pauses.MaxExclusiveTime("b"));
+  }
+  TimelineTestHelper::Clear(recorder);
+
+  // Test case.
+  TimelineTestHelper::FakeBegin(recorder, "a", 0);
+  TimelineTestHelper::FakeBegin(recorder, "b", 0);
+  TimelineTestHelper::FakeBegin(recorder, "c", 1);
+  TimelineTestHelper::FakeEnd(recorder, "c", 4);
+  TimelineTestHelper::FakeEnd(recorder, "b", 5);
+  TimelineTestHelper::FakeBegin(recorder, "d", 5);
+  TimelineTestHelper::FakeEnd(recorder, "d", 10);
+  TimelineTestHelper::FakeEnd(recorder, "a", 10);
+
+  {
+    TimelinePauses pauses(zone, isolate, recorder);
+    pauses.Setup();
+    pauses.CalculatePauseTimesForThread(tid);
+    EXPECT(!pauses.has_error());
+    EXPECT_EQ(10, pauses.InclusiveTime("a"));
+    EXPECT_EQ(0, pauses.ExclusiveTime("a"));
+    EXPECT_EQ(10, pauses.MaxInclusiveTime("a"));
+    EXPECT_EQ(0, pauses.MaxExclusiveTime("a"));
+    EXPECT_EQ(5, pauses.InclusiveTime("b"));
+    EXPECT_EQ(2, pauses.ExclusiveTime("b"));
+    EXPECT_EQ(5, pauses.MaxInclusiveTime("b"));
+    EXPECT_EQ(2, pauses.MaxExclusiveTime("b"));
+    EXPECT_EQ(3, pauses.InclusiveTime("c"));
+    EXPECT_EQ(3, pauses.ExclusiveTime("c"));
+    EXPECT_EQ(3, pauses.MaxInclusiveTime("c"));
+    EXPECT_EQ(3, pauses.MaxExclusiveTime("c"));
+    EXPECT_EQ(5, pauses.InclusiveTime("d"));
+    EXPECT_EQ(5, pauses.ExclusiveTime("d"));
+    EXPECT_EQ(5, pauses.MaxInclusiveTime("d"));
+    EXPECT_EQ(5, pauses.MaxExclusiveTime("d"));
+  }
+  TimelineTestHelper::Clear(recorder);
+
+  // Test case.
+  TimelineTestHelper::FakeBegin(recorder, "a", 0);
+  TimelineTestHelper::FakeBegin(recorder, "b", 1);
+  TimelineTestHelper::FakeBegin(recorder, "c", 2);
+  TimelineTestHelper::FakeBegin(recorder, "d", 3);
+  TimelineTestHelper::FakeBegin(recorder, "e", 4);
+  TimelineTestHelper::FakeEnd(recorder, "e", 6);
+  TimelineTestHelper::FakeEnd(recorder, "d", 7);
+  TimelineTestHelper::FakeEnd(recorder, "c", 8);
+  TimelineTestHelper::FakeEnd(recorder, "b", 9);
+  TimelineTestHelper::FakeEnd(recorder, "a", 10);
+
+  {
+    TimelinePauses pauses(zone, isolate, recorder);
+    pauses.Setup();
+    pauses.CalculatePauseTimesForThread(tid);
+    EXPECT(!pauses.has_error());
+    EXPECT_EQ(10, pauses.InclusiveTime("a"));
+    EXPECT_EQ(2, pauses.ExclusiveTime("a"));
+    EXPECT_EQ(10, pauses.MaxInclusiveTime("a"));
+    EXPECT_EQ(2, pauses.MaxExclusiveTime("a"));
+    EXPECT_EQ(8, pauses.InclusiveTime("b"));
+    EXPECT_EQ(2, pauses.ExclusiveTime("b"));
+    EXPECT_EQ(8, pauses.MaxInclusiveTime("b"));
+    EXPECT_EQ(2, pauses.MaxExclusiveTime("b"));
+    EXPECT_EQ(6, pauses.InclusiveTime("c"));
+    EXPECT_EQ(2, pauses.ExclusiveTime("c"));
+    EXPECT_EQ(6, pauses.MaxInclusiveTime("c"));
+    EXPECT_EQ(2, pauses.MaxExclusiveTime("c"));
+    EXPECT_EQ(4, pauses.InclusiveTime("d"));
+    EXPECT_EQ(2, pauses.ExclusiveTime("d"));
+    EXPECT_EQ(4, pauses.MaxInclusiveTime("d"));
+    EXPECT_EQ(2, pauses.MaxExclusiveTime("d"));
+    EXPECT_EQ(2, pauses.InclusiveTime("e"));
+    EXPECT_EQ(2, pauses.ExclusiveTime("e"));
+    EXPECT_EQ(2, pauses.MaxInclusiveTime("e"));
+    EXPECT_EQ(2, pauses.MaxExclusiveTime("e"));
+  }
+  TimelineTestHelper::Clear(recorder);
+
+  // Test case.
+  TimelineTestHelper::FakeBegin(recorder, "a", 0);
+  TimelineTestHelper::FakeBegin(recorder, "a", 1);
+  TimelineTestHelper::FakeEnd(recorder, "a", 9);
+  TimelineTestHelper::FakeEnd(recorder, "a", 10);
+
+  {
+    TimelinePauses pauses(zone, isolate, recorder);
+    pauses.Setup();
+    pauses.CalculatePauseTimesForThread(tid);
+    EXPECT(!pauses.has_error());
+    EXPECT_EQ(10, pauses.InclusiveTime("a"));
+    EXPECT_EQ(10, pauses.ExclusiveTime("a"));
+    EXPECT_EQ(10, pauses.MaxInclusiveTime("a"));
+    EXPECT_EQ(8, pauses.MaxExclusiveTime("a"));
+  }
+  TimelineTestHelper::Clear(recorder);
+
+  // Test case.
+  TimelineTestHelper::FakeBegin(recorder, "a", 0);
+  TimelineTestHelper::FakeBegin(recorder, "b", 1);
+  // Pop "a" without popping "b" first.
+  TimelineTestHelper::FakeEnd(recorder, "a", 10);
+
+  {
+    TimelinePauses pauses(zone, isolate, recorder);
+    pauses.Setup();
+    pauses.CalculatePauseTimesForThread(tid);
+    EXPECT(pauses.has_error());
+  }
+  TimelineTestHelper::Clear(recorder);
+}
+
 }  // namespace dart
diff --git a/runtime/vm/timer.cc b/runtime/vm/timer.cc
index a0b8707c..5b76b48 100644
--- a/runtime/vm/timer.cc
+++ b/runtime/vm/timer.cc
@@ -8,50 +8,6 @@
 
 namespace dart {
 
-// Define timer command line flags.
-#define DEFINE_TIMER_FLAG(name, msg)                                           \
-  DEFINE_FLAG(bool, name, false, ""#name);
-TIMER_LIST(DEFINE_TIMER_FLAG)
-#undef DEFINE_TIMER_FLAG
-DEFINE_FLAG(bool, time_all, false, "Time all functionality");
 
 
-// Maintains a list of timers per isolate.
-#define INIT_TIMERS(name, msg)                                                 \
-  name##_((FLAG_##name || FLAG_time_all), msg),
-TimerList::TimerList()
-    : TIMER_LIST(INIT_TIMERS)
-      padding_(false) {
-}
-#undef INIT_TIMERS
-
-
-#define TIMER_FIELD_REPORT(name, msg)                                          \
-  if (name().report() && name().message() != NULL) {                           \
-    OS::Print("%s :  %.3f ms total; %.3f ms max.\n",                           \
-              name().message(),                                                \
-              MicrosecondsToMilliseconds(name().TotalElapsedTime()),           \
-              MicrosecondsToMilliseconds(name().MaxContiguous()));             \
-  }
-void TimerList::ReportTimers() {
-  TIMER_LIST(TIMER_FIELD_REPORT);
-}
-#undef TIMER_FIELD_REPORT
-
-
-#define JSON_TIMER(name, msg)                                                  \
-  {                                                                            \
-    JSONObject jsobj(&jsarr);                                                  \
-    jsobj.AddProperty("name", #name);                                          \
-    jsobj.AddProperty("time",                                                  \
-                      MicrosecondsToSeconds(name().TotalElapsedTime()));       \
-    jsobj.AddProperty("max_contiguous",                                        \
-                      MicrosecondsToSeconds(name().MaxContiguous()));          \
-  }
-void TimerList::PrintTimersToJSONProperty(JSONObject* jsobj) {
-  JSONArray jsarr(jsobj, "timers");
-  TIMER_LIST(JSON_TIMER);
-}
-#undef JSON_TIMER
-
 }  // namespace dart
diff --git a/runtime/vm/timer.h b/runtime/vm/timer.h
index 6cb0a20..4738efa 100644
--- a/runtime/vm/timer.h
+++ b/runtime/vm/timer.h
@@ -90,41 +90,6 @@
   DISALLOW_COPY_AND_ASSIGN(Timer);
 };
 
-// List of per isolate timers.
-#define TIMER_LIST(V)                                                          \
-  V(time_script_loading, "Script Loading")                                     \
-  V(time_creating_snapshot, "Snapshot Creation")                               \
-  V(time_isolate_initialization, "Isolate initialization")                     \
-  V(time_compilation, "Function compilation")                                  \
-  V(time_bootstrap, "Bootstrap of core classes")                               \
-  V(time_dart_execution, "Dart execution")                                     \
-  V(time_total_runtime, "Total runtime for isolate")                           \
-  V(time_gc, "Garbage collection")                                             \
-
-// Maintains a list of timers per isolate.
-class TimerList : public ValueObject {
- public:
-  TimerList();
-  ~TimerList() {}
-
-  // Accessors.
-#define TIMER_FIELD_ACCESSOR(name, msg)                                        \
-  Timer& name() { return name##_; }
-  TIMER_LIST(TIMER_FIELD_ACCESSOR)
-#undef TIMER_FIELD_ACCESSOR
-
-  void ReportTimers();
-
-  void PrintTimersToJSONProperty(JSONObject* jsobj);
-
- private:
-#define TIMER_FIELD(name, msg) Timer name##_;
-  TIMER_LIST(TIMER_FIELD)
-#undef TIMER_FIELD
-  bool padding_;
-  DISALLOW_COPY_AND_ASSIGN(TimerList);
-};
-
 
 // The class TimerScope is used to start and stop a timer within a scope.
 // It is used as follows:
@@ -136,10 +101,21 @@
 // }
 class TimerScope : public StackResource {
  public:
+  TimerScope(bool flag, Timer* timer, Thread* thread = NULL)
+      : StackResource(thread),
+        nested_(false),
+        timer_(flag ? timer : NULL) {
+    Init();
+  }
+
   TimerScope(bool flag, Timer* timer, Isolate* isolate = NULL)
       : StackResource(isolate),
         nested_(false),
         timer_(flag ? timer : NULL) {
+    Init();
+  }
+
+  void Init() {
     if (timer_ != NULL) {
       if (!timer_->running()) {
         timer_->Start();
@@ -167,8 +143,8 @@
 
 class PauseTimerScope : public StackResource {
  public:
-  PauseTimerScope(bool flag, Timer* timer, Isolate* isolate = NULL)
-      : StackResource(isolate),
+  PauseTimerScope(bool flag, Timer* timer, Thread* thread = NULL)
+      : StackResource(thread),
         nested_(false),
         timer_(flag ? timer : NULL) {
     if (timer_) {
@@ -196,20 +172,6 @@
 };
 
 
-// Macros to deal with named timers in the isolate.
-#define START_TIMER(isolate, name)                                             \
-isolate->timer_list().name().Start();
-
-#define STOP_TIMER(isolate, name)                                              \
-isolate->timer_list().name().Stop();
-
-#define TIMERSCOPE(isolate, name)                                              \
-  TimerScope vm_internal_timer_(true, &(isolate->timer_list().name()), isolate)
-
-#define PAUSETIMERSCOPE(isolate, name)                                         \
-PauseTimerScope vm_internal_timer_(true,                                       \
-                                   &(isolate->timer_list().name()),            \
-                                   isolate)
 
 }  // namespace dart
 
diff --git a/runtime/vm/unicode.cc b/runtime/vm/unicode.cc
index 615e87b..8e1649e 100644
--- a/runtime/vm/unicode.cc
+++ b/runtime/vm/unicode.cc
@@ -102,8 +102,7 @@
       if (!((is_malformed == false) &&
             (j == num_trail_bytes) &&
             !Utf::IsOutOfRange(ch) &&
-            !IsNonShortestForm(ch, j) &&
-            !Utf16::IsSurrogate(ch))) {
+            !IsNonShortestForm(ch, j))) {
         return false;
       }
     }
@@ -201,8 +200,7 @@
     if (!((is_malformed == false) &&
           (i == num_trail_bytes) &&
           !Utf::IsOutOfRange(ch) &&
-          !IsNonShortestForm(ch, i) &&
-          !Utf16::IsSurrogate(ch))) {
+          !IsNonShortestForm(ch, i))) {
       *dst = -1;
       return 0;
     }
diff --git a/runtime/vm/unicode_test.cc b/runtime/vm/unicode_test.cc
index 582a2a6..36fdf85 100644
--- a/runtime/vm/unicode_test.cc
+++ b/runtime/vm/unicode_test.cc
@@ -832,6 +832,8 @@
   }
 
   // 5.1 - Single UTF-16 surrogates
+  // UTF-8 suggests single surrogates are invalid, but both JS and
+  // Dart allow them and make use of them.
 
   // 5.1.1 - U+D800 = ed a0 80 = "\xED\xA0\x80"
   {
@@ -840,8 +842,8 @@
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
-    EXPECT(!is_valid);
-    EXPECT(memcmp(expected, dst, sizeof(expected)));
+    EXPECT(is_valid);
+    EXPECT(!memcmp(expected, dst, sizeof(expected)));
   }
 
   // 5.1.2 - U+DB7F = ed ad bf = "\xED\xAD\xBF"
@@ -851,8 +853,8 @@
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
-    EXPECT(!is_valid);
-    EXPECT(memcmp(expected, dst, sizeof(expected)));
+    EXPECT(is_valid);
+    EXPECT(!memcmp(expected, dst, sizeof(expected)));
   }
 
   // 5.1.3 - U+DB80 = ed ae 80 = "\xED\xAE\x80"
@@ -862,8 +864,8 @@
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
-    EXPECT(!is_valid);
-    EXPECT(memcmp(expected, dst, sizeof(expected)));
+    EXPECT(is_valid);
+    EXPECT(!memcmp(expected, dst, sizeof(expected)));
   }
 
   // 5.1.4 - U+DBFF = ed af bf = "\xED\xAF\xBF"
@@ -873,8 +875,8 @@
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
-    EXPECT(!is_valid);
-    EXPECT(memcmp(expected, dst, sizeof(expected)));
+    EXPECT(is_valid);
+    EXPECT(!memcmp(expected, dst, sizeof(expected)));
   }
 
   // 5.1.5 - U+DC00 = ed b0 80 = "\xED\xB0\x80"
@@ -884,8 +886,8 @@
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
-    EXPECT(!is_valid);
-    EXPECT(memcmp(expected, dst, sizeof(expected)));
+    EXPECT(is_valid);
+    EXPECT(!memcmp(expected, dst, sizeof(expected)));
   }
 
   // 5.1.6 - U+DF80 = ed be 80 = "\xED\xBE\x80"
@@ -895,8 +897,8 @@
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
-    EXPECT(!is_valid);
-    EXPECT(memcmp(expected, dst, sizeof(expected)));
+    EXPECT(is_valid);
+    EXPECT(!memcmp(expected, dst, sizeof(expected)));
   }
 
   // 5.1.7 - U+DFFF = ed bf bf = "\xED\xBF\xBF"
@@ -906,11 +908,16 @@
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
-    EXPECT(!is_valid);
-    EXPECT(memcmp(expected, dst, sizeof(expected)));
+    EXPECT(is_valid);
+    EXPECT(!memcmp(expected, dst, sizeof(expected)));
   }
 
   // 5.2 Paired UTF-16 surrogates
+  // Also not a valid string, but accepted in Dart, even if it doesn't make
+  // sense. e.g.
+  // var s =  new String.fromCharCodes([0xd800, 0xDC00]);
+  // print(s.runes);  // (65536) (0x10000)
+  // print(s.codeUnits); // [55296, 56320]
 
   // 5.2.1 - U+D800 U+DC00 = ed a0 80 ed b0 80 = "\xED\xA0\x80\xED\xB0\x80"
   {
@@ -919,8 +926,8 @@
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
-    EXPECT(!is_valid);
-    EXPECT(memcmp(expected, dst, sizeof(expected)));
+    EXPECT(is_valid);
+    EXPECT(!memcmp(expected, dst, sizeof(expected)));
   }
 
   // 5.2.2 - U+D800 U+DFFF = ed a0 80 ed bf bf = "\xED\xA0\x80\xED\xBF\xBF"
@@ -930,8 +937,8 @@
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
-    EXPECT(!is_valid);
-    EXPECT(memcmp(expected, dst, sizeof(expected)));
+    EXPECT(is_valid);
+    EXPECT(!memcmp(expected, dst, sizeof(expected)));
   }
 
   // 5.2.3 - U+DB7F U+DC00 = ed a0 80 ed bf bf = "\xED\xAD\xBF\xED\xB0\x80"
@@ -941,8 +948,8 @@
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
-    EXPECT(!is_valid);
-    EXPECT(memcmp(expected, dst, sizeof(expected)));
+    EXPECT(is_valid);
+    EXPECT(!memcmp(expected, dst, sizeof(expected)));
   }
 
   // 5.2.4 - U+DB7F U+DFFF = ed ad bf ed bf bf = "\xED\xAD\xBF\xED\xBF\xBF"
@@ -952,8 +959,8 @@
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
-    EXPECT(!is_valid);
-    EXPECT(memcmp(expected, dst, sizeof(expected)));
+    EXPECT(is_valid);
+    EXPECT(!memcmp(expected, dst, sizeof(expected)));
   }
 
   // 5.2.5 - U+DB80 U+DC00 = ed ae 80 ed b0 80 = "\xED\xAE\x80\xED\xB0\x80"
@@ -963,8 +970,8 @@
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
-    EXPECT(!is_valid);
-    EXPECT(memcmp(expected, dst, sizeof(expected)));
+    EXPECT(is_valid);
+    EXPECT(!memcmp(expected, dst, sizeof(expected)));
   }
 
   // 5.2.6 - U+DB80 U+DFFF = ed ae 80 ed bf bf = "\xED\xAE\x80\xED\xBF\xBF"
@@ -974,8 +981,8 @@
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
-    EXPECT(!is_valid);
-    EXPECT(memcmp(expected, dst, sizeof(expected)));
+    EXPECT(is_valid);
+    EXPECT(!memcmp(expected, dst, sizeof(expected)));
   }
 
   // 5.2.7 - U+DBFF U+DC00 = ed af bf ed b0 80 = "\xED\xAF\xBF\xED\xB0\x80"
@@ -985,8 +992,8 @@
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
-    EXPECT(!is_valid);
-    EXPECT(memcmp(expected, dst, sizeof(expected)));
+    EXPECT(is_valid);
+    EXPECT(!memcmp(expected, dst, sizeof(expected)));
   }
 
   // 5.2.8 - U+DBFF U+DFFF = ed af bf ed bf bf = "\xED\xAF\xBF\xED\xBF\xBF"
@@ -996,8 +1003,8 @@
     int32_t dst[ARRAY_SIZE(expected)];
     memset(dst, 0, sizeof(dst));
     bool is_valid = Utf8::DecodeCStringToUTF32(src, dst, ARRAY_SIZE(dst));
-    EXPECT(!is_valid);
-    EXPECT(memcmp(expected, dst, sizeof(expected)));
+    EXPECT(is_valid);
+    EXPECT(!memcmp(expected, dst, sizeof(expected)));
   }
 
   // 5.3 - Other illegal code positions
diff --git a/runtime/vm/unit_test.cc b/runtime/vm/unit_test.cc
index 3b58c7a..9694527 100644
--- a/runtime/vm/unit_test.cc
+++ b/runtime/vm/unit_test.cc
@@ -215,8 +215,6 @@
     Disassembler::Disassemble(start, start + assembler_->CodeSize());
     OS::Print("}\n");
   }
-  const Instructions& instructions = Instructions::Handle(code_.instructions());
-  entry_ = instructions.EntryPoint();
 }
 
 
@@ -224,7 +222,7 @@
   : function_(Function::ZoneHandle()),
     node_sequence_(new SequenceNode(Scanner::kNoSourcePos,
                                     new LocalScope(NULL, 0, 0))),
-    default_parameter_values_(Array::ZoneHandle()) {
+    default_parameter_values_(new ZoneGrowableArray<const Instance*> ()) {
   ASSERT(name != NULL);
   const String& function_name = String::ZoneHandle(Symbols::New(name));
   // Add function to a class and that class to the class dictionary so that
@@ -284,4 +282,24 @@
 }
 
 
+void ElideJSONSubstring(const char* prefix, const char* in, char* out) {
+  const char* pos = strstr(in, prefix);
+  while (pos != NULL) {
+    // Copy up to pos into the output buffer.
+    while (in < pos) {
+      *out++ = *in++;
+    }
+
+    // Skip to the close quote.
+    in += strcspn(in, "\"");
+    pos = strstr(in, prefix);
+  }
+  // Copy the remainder of in to out.
+  while (*in != '\0') {
+    *out++ = *in++;
+  }
+  *out = '\0';
+}
+
+
 }  // namespace dart
diff --git a/runtime/vm/unit_test.h b/runtime/vm/unit_test.h
index 01ba009..6e1ca5c 100644
--- a/runtime/vm/unit_test.h
+++ b/runtime/vm/unit_test.h
@@ -30,15 +30,17 @@
 // The TEST_CASE macro is used for tests that need an isolate and zone
 // in order to test its functionality.
 #define TEST_CASE(name)                                                        \
-  static void Dart_TestHelper##name();                                         \
+  static void Dart_TestHelper##name(Thread* thread);                           \
   UNIT_TEST_CASE(name)                                                         \
   {                                                                            \
     TestIsolateScope __test_isolate__;                                         \
-    StackZone __zone__(__test_isolate__.isolate());                            \
-    HandleScope __hs__(__test_isolate__.isolate());                            \
-    Dart_TestHelper##name();                                                   \
+    Thread* __thread__ = Thread::Current();                                    \
+    ASSERT(__thread__->isolate() == __test_isolate__.isolate());               \
+    StackZone __zone__(__thread__);                                            \
+    HandleScope __hs__(__thread__);                                            \
+    Dart_TestHelper##name(__thread__);                                         \
   }                                                                            \
-  static void Dart_TestHelper##name()
+  static void Dart_TestHelper##name(Thread* thread)
 
 // The ASSEMBLER_TEST_GENERATE macro is used to generate a unit test
 // for the assembler.
@@ -321,6 +323,26 @@
 };
 
 
+template<typename T> struct is_void {
+  static const bool value = false;
+};
+
+
+template<> struct is_void<void> {
+  static const bool value = true;
+};
+
+
+template<typename T> struct is_double {
+  static const bool value = false;
+};
+
+
+template<> struct is_double<double> {
+  static const bool value = true;
+};
+
+
 class AssemblerTest {
  public:
   AssemblerTest(const char* name, Assembler* assembler)
@@ -336,16 +358,89 @@
 
   const Code& code() const { return code_; }
 
-  uword entry() const { return entry_; }
+  uword entry() const { return code_.EntryPoint(); }
 
-  // Assemble test and set code_ and entry_.
+  // Invoke/InvokeWithCode 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)
+
+#if defined(ARCH_IS_64_BIT)
+  // TODO(fschneider): Make InvokeWithCode<> more general and work on 32-bit.
+  // Since Simulator::Call always return a int64_t, bit_cast does not work
+  // 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 InvokeWithCode() {
+    const bool fp_return = is_double<ResultType>::value;
+    const bool fp_args = false;
+    return bit_cast<ResultType, int64_t>(Simulator::Current()->Call(
+        bit_cast<intptr_t, uword>(entry()),
+        reinterpret_cast<intptr_t>(&code_), 0, 0, 0, fp_return, fp_args));
+  }
+  template<typename ResultType, typename Arg1Type>
+  ResultType InvokeWithCode(Arg1Type arg1) {
+    const bool fp_return = is_double<ResultType>::value;
+    const bool fp_args = is_double<Arg1Type>::value;
+    // TODO(fschneider): Support double arguments for simulator calls.
+    COMPILE_ASSERT(!fp_args);
+    return bit_cast<ResultType, int64_t>(Simulator::Current()->Call(
+        bit_cast<intptr_t, uword>(entry()),
+        reinterpret_cast<intptr_t>(&code_),
+        reinterpret_cast<intptr_t>(arg1),
+        0, 0, fp_return, fp_args));
+  }
+#endif  // ARCH_IS_64_BIT
+
+  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);
+    COMPILE_ASSERT(!is_double<Arg1Type>::value);
+    COMPILE_ASSERT(!is_double<Arg2Type>::value);
+    COMPILE_ASSERT(!is_double<Arg3Type>::value);
+    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);
+  }
+#else
+  template<typename ResultType> ResultType InvokeWithCode() {
+    typedef ResultType (*FunctionType) (const Code&);
+    return reinterpret_cast<FunctionType>(entry())(code_);
+  }
+
+  template<typename ResultType, typename Arg1Type>
+  ResultType InvokeWithCode(Arg1Type arg1) {
+    typedef ResultType (*FunctionType) (const Code&, Arg1Type);
+    return reinterpret_cast<FunctionType>(entry())(code_, arg1);
+  }
+
+  template<typename ResultType,
+           typename Arg1Type,
+           typename Arg2Type,
+           typename Arg3Type>
+  ResultType Invoke(Arg1Type arg1, Arg2Type arg2, Arg3Type arg3) {
+    typedef ResultType (*FunctionType) (Arg1Type, Arg2Type, Arg3Type);
+    return reinterpret_cast<FunctionType>(entry())(arg1, arg2, arg3);
+  }
+#endif  // USING_SIMULATOR
+
+  // Assemble test and set code_.
   void Assemble();
 
  private:
   const char* name_;
   Assembler* assembler_;
   Code& code_;
-  uword entry_;
 
   DISALLOW_COPY_AND_ASSIGN(AssemblerTest);
 };
@@ -361,8 +456,8 @@
 
   SequenceNode* node_sequence() const { return node_sequence_; }
 
-  void set_default_parameter_values(const Array& value) {
-    default_parameter_values_ = value.raw();
+  void set_default_parameter_values(ZoneGrowableArray<const Instance*>* value) {
+    default_parameter_values_ = value;
   }
 
   // Compile test and set code in function.
@@ -371,7 +466,7 @@
  private:
   Function& function_;
   SequenceNode* node_sequence_;
-  Array& default_parameter_values_;
+  ZoneGrowableArray<const Instance*>* default_parameter_values_;
 
   DISALLOW_COPY_AND_ASSIGN(CodeGenTest);
 };
@@ -428,6 +523,24 @@
     }                                                                          \
   } while (0)
 
+
+// Elide a substring which starts with some prefix and ends with a ".
+//
+// This is used to remove non-deterministic or fragile substrings from
+// JSON output.
+//
+// For example:
+//
+//    prefix = "classes"
+//    in = "\"id\":\"classes/46\""
+//
+// Yields:
+//
+//    out = "\"id\":\"\""
+//
+void ElideJSONSubstring(const char* prefix, const char* in, char* out);
+
+
 }  // namespace dart
 
 #endif  // VM_UNIT_TEST_H_
diff --git a/runtime/vm/verified_memory_test.cc b/runtime/vm/verified_memory_test.cc
index 6d97216..21978e7 100644
--- a/runtime/vm/verified_memory_test.cc
+++ b/runtime/vm/verified_memory_test.cc
@@ -15,12 +15,22 @@
 }
 
 
+void Shutdown() {
+#if defined(DEBUG)
+  // We must reset this to false to avoid checking some assumptions in
+  // VM shutdown that are left violated by these tests.
+  FLAG_verified_mem = false;
+#endif
+}
+
+
 UNIT_TEST_CASE(VerifiedMemoryReserve) {
   Init();
   const intptr_t kReservationSize = 64 * KB;
   VirtualMemory* vm = VerifiedMemory::Reserve(kReservationSize);
   EXPECT_EQ(kReservationSize, vm->size());
   delete vm;
+  Shutdown();
 }
 
 
@@ -31,6 +41,7 @@
   EXPECT_EQ(kReservationSize, vm->size());
   vm->Commit(false);
   delete vm;
+  Shutdown();
 }
 
 
@@ -53,6 +64,7 @@
   *unverified = 123;
   VerifiedMemory::Verify(reinterpret_cast<uword>(addr), 3 * sizeof(double));
   delete vm;
+  Shutdown();
 }
 
 
@@ -72,6 +84,7 @@
   VerifiedMemory::Accept(reinterpret_cast<uword>(addr), 2 * sizeof(double));
   VerifiedMemory::Verify(reinterpret_cast<uword>(addr), 3 * sizeof(double));
   delete vm;
+  Shutdown();
 }
 
 
@@ -86,6 +99,7 @@
   double* addr = reinterpret_cast<double*>(vm->address());
   addr[0] = 0.5;  // Forget to use Write.
   VerifiedMemory::Write(&addr[0], 1.5);
+  Shutdown();
 }
 
 
@@ -101,6 +115,7 @@
   addr[1] = 3.5;  // Forget to use Write.
   VerifiedMemory::Write(&addr[2], 2.5);
   VerifiedMemory::Verify(reinterpret_cast<uword>(addr), 3 * sizeof(double));
+  Shutdown();
 }
 
 }  // namespace dart
diff --git a/runtime/vm/verifier.h b/runtime/vm/verifier.h
index aaee19b..99b6056 100644
--- a/runtime/vm/verifier.h
+++ b/runtime/vm/verifier.h
@@ -66,7 +66,7 @@
 class VerifyWeakPointersVisitor : public HandleVisitor {
  public:
   explicit VerifyWeakPointersVisitor(VerifyPointersVisitor* visitor)
-      :  HandleVisitor(Isolate::Current()),
+      :  HandleVisitor(Thread::Current()),
          visitor_(visitor) {
   }
 
diff --git a/runtime/vm/version_in.cc b/runtime/vm/version_in.cc
index 34d7fc6..d196310 100644
--- a/runtime/vm/version_in.cc
+++ b/runtime/vm/version_in.cc
@@ -14,14 +14,9 @@
 
 const char* Version::String() {
   if (formatted_version == NULL) {
-    const char* format = "%s on \"%s_%s\"";
     const char* os = OS::Name();
     const char* arch = CPU::Id();
-
-    intptr_t len = OS::SNPrint(NULL, 0, format, str_, os, arch);
-    char* buffer = reinterpret_cast<char*>(malloc(len + 1));
-    OS::SNPrint(buffer, (len + 1), format, str_, os, arch);
-    formatted_version = buffer;
+    formatted_version = OS::SCreate(NULL, "%s on \"%s_%s\"", str_, os, arch);
   }
   return formatted_version;
 }
diff --git a/runtime/vm/virtual_memory.cc b/runtime/vm/virtual_memory.cc
index 050c83d..2f2c1bc 100644
--- a/runtime/vm/virtual_memory.cc
+++ b/runtime/vm/virtual_memory.cc
@@ -27,4 +27,13 @@
   region_.Subregion(region_, 0, new_size);
 }
 
+
+VirtualMemory* VirtualMemory::ForInstructionsSnapshot(void* pointer,
+                                                      uword size) {
+  // Memory for precompilated instructions was allocated by the embedder, so
+  // create a VirtualMemory without allocating.
+  MemoryRegion region(pointer, size);
+  return new VirtualMemory(region);
+}
+
 }  // namespace dart
diff --git a/runtime/vm/virtual_memory.h b/runtime/vm/virtual_memory.h
index 607e6b2..44f3491 100644
--- a/runtime/vm/virtual_memory.h
+++ b/runtime/vm/virtual_memory.h
@@ -69,6 +69,8 @@
   // Commit a reserved memory area, so that the memory can be accessed.
   bool Commit(uword addr, intptr_t size, bool is_executable);
 
+  static VirtualMemory* ForInstructionsSnapshot(void* pointer, uword size);
+
  private:
   static VirtualMemory* ReserveInternal(intptr_t size);
 
diff --git a/runtime/vm/visitor.h b/runtime/vm/visitor.h
index 70fe619..9e8780b 100644
--- a/runtime/vm/visitor.h
+++ b/runtime/vm/visitor.h
@@ -5,6 +5,7 @@
 #ifndef VM_VISITOR_H_
 #define VM_VISITOR_H_
 
+#include "vm/allocation.h"
 #include "vm/globals.h"
 #include "vm/growable_array.h"
 
@@ -26,8 +27,8 @@
   virtual void VisitPointers(RawObject** first, RawObject** last) = 0;
 
   virtual bool visit_function_code() const { return true; }
-  virtual MallocGrowableArray<RawFunction*>* skipped_code_functions() {
-    return NULL;
+  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) {
@@ -38,6 +39,7 @@
 
  private:
   Isolate* isolate_;
+  NoSafepointScope no_safepoints_;
 
   DISALLOW_IMPLICIT_CONSTRUCTORS(ObjectPointerVisitor);
 };
diff --git a/runtime/vm/vm.gypi b/runtime/vm/vm.gypi
index e298592..9771a91 100644
--- a/runtime/vm/vm.gypi
+++ b/runtime/vm/vm.gypi
@@ -26,30 +26,24 @@
     'mirrors_cc_file': '<(gen_source_dir)/mirrors_gen.cc',
     'mirrors_patch_cc_file': '<(gen_source_dir)/mirrors_patch_gen.cc',
     'profiler_cc_file': '<(gen_source_dir)/profiler_gen.cc',
-    'service_cc_file': '<(gen_source_dir)/service_gen.cc',
     'snapshot_test_dat_file': '<(gen_source_dir)/snapshot_test.dat',
     'snapshot_test_in_dat_file': 'snapshot_test_in.dat',
     'snapshot_test_dart_file': 'snapshot_test.dart',
     'typed_data_cc_file': '<(gen_source_dir)/typed_data_gen.cc',
     'typed_data_patch_cc_file': '<(gen_source_dir)/typed_data_patch_gen.cc',
+    'vmservice_cc_file': '<(gen_source_dir)/vmservice_gen.cc',
+    'vmservice_patch_cc_file': '<(gen_source_dir)/vmservice_patch_gen.cc',
   },
   'targets': [
     {
       'target_name': 'libdart_vm',
       'type': 'static_library',
       'toolsets':['host', 'target'],
-      'dependencies': [
-        'generate_service_cc_file#host'
-      ],
       'includes': [
         'vm_sources.gypi',
         '../platform/platform_headers.gypi',
         '../platform/platform_sources.gypi',
       ],
-      'sources': [
-        # Include generated source files.
-        '<(service_cc_file)',
-      ],
       'sources/': [
         # Exclude all _test.[cc|h] files.
         ['exclude', '_test\\.(cc|h)$'],
@@ -105,18 +99,11 @@
       'target_name': 'libdart_vm_nosnapshot',
       'type': 'static_library',
       'toolsets':['host', 'target'],
-      'dependencies': [
-        'generate_service_cc_file#host'
-      ],
       'includes': [
         'vm_sources.gypi',
         '../platform/platform_headers.gypi',
         '../platform/platform_sources.gypi',
       ],
-      'sources': [
-        # Include generated source files.
-        '<(service_cc_file)',
-      ],
       'sources/': [
         # Exclude all _test.[cc|h] files.
         ['exclude', '_test\\.(cc|h)$'],
@@ -197,6 +184,8 @@
         'generate_profiler_cc_file#host',
         'generate_typed_data_cc_file#host',
         'generate_typed_data_patch_cc_file#host',
+        'generate_vmservice_cc_file#host',
+        'generate_vmservice_patch_cc_file#host',
       ],
       'includes': [
         '../lib/async_sources.gypi',
@@ -208,6 +197,7 @@
         '../lib/math_sources.gypi',
         '../lib/mirrors_sources.gypi',
         '../lib/typed_data_sources.gypi',
+        '../lib/vmservice_sources.gypi',
       ],
       'sources': [
         'bootstrap.cc',
@@ -233,6 +223,8 @@
         '<(profiler_cc_file)',
         '<(typed_data_cc_file)',
         '<(typed_data_patch_cc_file)',
+        '<(vmservice_cc_file)',
+        '<(vmservice_patch_cc_file)',
       ],
       'include_dirs': [
         '..',
@@ -252,6 +244,7 @@
         '../lib/math_sources.gypi',
         '../lib/mirrors_sources.gypi',
         '../lib/typed_data_sources.gypi',
+        '../lib/vmservice_sources.gypi',
       ],
       'sources': [
         'bootstrap_nocore.cc',
@@ -1128,32 +1121,82 @@
       ]
     },
     {
-      'target_name': 'generate_service_cc_file',
+      'target_name': 'generate_vmservice_cc_file',
       'type': 'none',
       'toolsets':['host'],
       'includes': [
-        'service_sources.gypi',
+        # Load the shared library sources.
+        '../../sdk/lib/vmservice/vmservice_sources.gypi',
+      ],
+      'sources/': [
+        # Exclude all .[cc|h] files.
+        # This is only here for reference. Excludes happen after
+        # variable expansion, so the script has to do its own
+        # exclude processing of the sources being passed.
+        ['exclude', '\\.cc|h$'],
       ],
       'actions': [
         {
-          'action_name': 'generate_service_cc',
+          'action_name': 'generate_vmservice_cc',
           'inputs': [
-            '../tools/create_resources.py',
+            '../tools/gen_library_src_paths.py',
+            '<(libgen_in_cc_file)',
             '<@(_sources)',
           ],
           'outputs': [
-            '<(service_cc_file)',
+            '<(vmservice_cc_file)',
           ],
           'action': [
             'python',
-            'tools/create_resources.py',
-            '--output', '<(service_cc_file)',
-            '--outer_namespace', 'dart',
-            '--table_name', 'service',
-            '--root_prefix', 'vm/service/',
-            '<@(_sources)'
+            'tools/gen_library_src_paths.py',
+            '--output', '<(vmservice_cc_file)',
+            '--input_cc', '<(libgen_in_cc_file)',
+            '--include', 'vm/bootstrap.h',
+            '--var_name', 'dart::Bootstrap::_vmservice_source_paths_',
+            '--library_name', 'dart:_vmservice',
+            '<@(_sources)',
           ],
-          'message': 'Generating ''<(service_cc_file)'' file.'
+          'message': 'Generating ''<(vmservice_cc_file)'' file.'
+        },
+      ]
+    },
+    {
+      'target_name': 'generate_vmservice_patch_cc_file',
+      'type': 'none',
+      'toolsets':['host'],
+      'includes': [
+        # Load the runtime implementation sources.
+        '../lib/vmservice_sources.gypi',
+      ],
+      'sources/': [
+        # Exclude all .[cc|h] files.
+        # This is only here for reference. Excludes happen after
+        # variable expansion, so the script has to do its own
+        # exclude processing of the sources being passed.
+        ['exclude', '\\.cc|h$'],
+      ],
+      'actions': [
+        {
+          'action_name': 'generate_vmservice_patch_cc',
+          'inputs': [
+            '../tools/gen_library_src_paths.py',
+            '<(libgen_in_cc_file)',
+            '<@(_sources)',
+          ],
+          'outputs': [
+            '<(vmservice_patch_cc_file)',
+          ],
+          'action': [
+            'python',
+            'tools/gen_library_src_paths.py',
+            '--output', '<(vmservice_patch_cc_file)',
+            '--input_cc', '<(libgen_in_cc_file)',
+            '--include', 'vm/bootstrap.h',
+            '--var_name', 'dart::Bootstrap::_vmservice_patch_paths_',
+            '--library_name', 'dart:_vmservice',
+            '<@(_sources)',
+          ],
+          'message': 'Generating ''<(vmservice_patch_cc_file)'' file.'
         },
       ]
     },
diff --git a/runtime/vm/vm_sources.gypi b/runtime/vm/vm_sources.gypi
index 52dc222..5f5fc57 100644
--- a/runtime/vm/vm_sources.gypi
+++ b/runtime/vm/vm_sources.gypi
@@ -41,6 +41,7 @@
     'atomic_linux.h',
     'atomic_macos.h',
     'atomic_simulator.h',
+    'atomic_test.cc',
     'atomic_win.h',
     'base_isolate.h',
     'benchmark_test.cc',
@@ -102,8 +103,6 @@
     'constants_ia32.h',
     'constants_mips.h',
     'constants_x64.h',
-    'counters.cc',
-    'counters.h',
     'coverage.cc',
     'coverage.h',
     'coverage_test.cc',
@@ -376,11 +375,12 @@
     'ring_buffer.h',
     'ring_buffer_test.cc',
     'runtime_entry.h',
+    'runtime_entry_list.h',
     'runtime_entry_arm.cc',
     'runtime_entry_arm64.cc',
     'runtime_entry_ia32.cc',
     'runtime_entry_mips.cc',
-    'runtime_entry_test.cc',
+    'runtime_entry.cc',
     'runtime_entry_x64.cc',
     'scanner.cc',
     'scanner.h',
@@ -444,6 +444,8 @@
     'tags.h',
     'thread.cc',
     'thread.h',
+    'thread_barrier.h',
+    'thread_barrier_test.cc',
     'thread_interrupter.cc',
     'thread_interrupter.h',
     'thread_interrupter_android.cc',
@@ -459,6 +461,8 @@
     'thread_test.cc',
     'timeline.cc',
     'timeline.h',
+    'timeline_analysis.cc',
+    'timeline_analysis.h',
     'timeline_test.cc',
     'timer.cc',
     'timer.h',
diff --git a/runtime/vm/weak_code.cc b/runtime/vm/weak_code.cc
index 3177ba6..cf1e132 100644
--- a/runtime/vm/weak_code.cc
+++ b/runtime/vm/weak_code.cc
@@ -115,17 +115,15 @@
       // function is invoked, it will be compiled again.
       function.ClearCode();
       // Invalidate the old code object so existing references to it
-      // (from optimized code) will fail when invoked.
-      if (!CodePatcher::IsEntryPatched(code)) {
-        CodePatcher::PatchEntry(code);
+      // (from optimized code) will be patched when invoked.
+      if (!code.IsDisabled()) {
+        code.DisableDartCode();
       }
     } else {
       // Make non-OSR code non-entrant.
-      if (code.GetEntryPatchPc() != 0) {
-        if (!CodePatcher::IsEntryPatched(code)) {
-          ReportSwitchingCode(code);
-          CodePatcher::PatchEntry(code);
-        }
+      if (!code.IsDisabled()) {
+        ReportSwitchingCode(code);
+        code.DisableDartCode();
       }
     }
   }
diff --git a/runtime/vm/weak_table.cc b/runtime/vm/weak_table.cc
index cb45d2e..e45e9c8 100644
--- a/runtime/vm/weak_table.cc
+++ b/runtime/vm/weak_table.cc
@@ -75,6 +75,16 @@
 }
 
 
+void WeakTable::Reset() {
+  intptr_t* old_data = data_;
+  used_ = 0;
+  count_ = 0;
+  size_ = kMinSize;
+  data_ = reinterpret_cast<intptr_t*>(calloc(size_, kEntrySize * kWordSize));
+  free(old_data);
+}
+
+
 void WeakTable::Rehash() {
   intptr_t old_size = size();
   intptr_t* old_data = data_;
diff --git a/runtime/vm/weak_table.h b/runtime/vm/weak_table.h
index cc7f54d..aca86fc 100644
--- a/runtime/vm/weak_table.h
+++ b/runtime/vm/weak_table.h
@@ -92,6 +92,8 @@
     return 0;
   }
 
+  void Reset();
+
  private:
   enum {
     kObjectOffset = 0,
diff --git a/runtime/vm/zone.cc b/runtime/vm/zone.cc
index 58fb1d1..7cb7977 100644
--- a/runtime/vm/zone.cc
+++ b/runtime/vm/zone.cc
@@ -178,6 +178,21 @@
 }
 
 
+char* Zone::ConcatStrings(const char* a, const char* b, char join) {
+  intptr_t a_len = (a == NULL) ? 0 : strlen(a);
+  const intptr_t b_len = strlen(b) + 1;  // '\0'-terminated.
+  const intptr_t len = a_len + b_len;
+  char* copy = Alloc<char>(len);
+  if (a_len > 0) {
+    strncpy(copy, a, a_len);
+    // Insert join character.
+    copy[a_len++] = join;
+  }
+  strncpy(&copy[a_len], b, b_len);
+  return copy;
+}
+
+
 #if defined(DEBUG)
 void Zone::DumpZoneSizes() {
   intptr_t size = 0;
@@ -203,16 +218,15 @@
 char* Zone::PrintToString(const char* format, ...) {
   va_list args;
   va_start(args, format);
-  intptr_t len = OS::VSNPrint(NULL, 0, format, args);
+  char* buffer = OS::VSCreate(this, format, args);
   va_end(args);
-
-  char* buffer = Alloc<char>(len + 1);
-  va_list args2;
-  va_start(args2, format);
-  OS::VSNPrint(buffer, (len + 1), format, args2);
-  va_end(args2);
-
   return buffer;
 }
 
+
+char* Zone::VPrint(const char* format, va_list args) {
+  return OS::VSCreate(this, format, args);
+}
+
+
 }  // namespace dart
diff --git a/runtime/vm/zone.h b/runtime/vm/zone.h
index ee0add5..2008ee9 100644
--- a/runtime/vm/zone.h
+++ b/runtime/vm/zone.h
@@ -8,6 +8,7 @@
 #include "platform/utils.h"
 #include "vm/allocation.h"
 #include "vm/handles.h"
+#include "vm/thread.h"
 #include "vm/memory_region.h"
 
 namespace dart {
@@ -46,8 +47,17 @@
   // Make a copy of the string in the zone allocated area.
   char* MakeCopyOfString(const char* str);
 
+  // Concatenate strings |a| and |b|. |a| may be NULL. If |a| is not NULL,
+  // |join| will be inserted between |a| and |b|.
+  char* ConcatStrings(const char* a, const char* b, char join = ',');
+
+  // TODO(zra): Remove these calls and replace them with calls to OS::SCreate
+  // and OS::VSCreate.
+  // These calls are deprecated. Do not add further calls to these functions.
+  // instead use OS::SCreate and OS::VSCreate.
   // Make a zone-allocated string based on printf format and args.
   char* PrintToString(const char* format, ...) PRINTF_ATTRIBUTE(2, 3);
+  char* VPrint(const char* format, va_list args);
 
   // Compute the total size of this zone. This includes wasted space that is
   // due to internal fragmentation in the segments.
@@ -176,13 +186,15 @@
  public:
   // Create an empty zone and set is at the current zone for the Thread.
   explicit StackZone(Thread* thread) : StackResource(thread), zone_() {
-    Initialize();
-  }
-
-  // DEPRECATED: Use Thread-based interface. During migration, this defaults
-  // to using the mutator thread (which must also be the current thread).
-  explicit StackZone(Isolate* isolate) : StackResource(isolate), zone_() {
-    Initialize();
+#ifdef DEBUG
+    if (FLAG_trace_zones) {
+      OS::PrintErr("*** Starting a new Stack zone 0x%" Px "(0x%" Px ")\n",
+                   reinterpret_cast<intptr_t>(this),
+                   reinterpret_cast<intptr_t>(&zone_));
+    }
+#endif
+    zone_.Link(thread->zone());
+    thread->set_zone(&zone_);
   }
 
   // Delete all memory associated with the zone.
@@ -207,18 +219,6 @@
  private:
   Zone zone_;
 
-  void Initialize() {
-#ifdef DEBUG
-    if (FLAG_trace_zones) {
-      OS::PrintErr("*** Starting a new Stack zone 0x%" Px "(0x%" Px ")\n",
-                   reinterpret_cast<intptr_t>(this),
-                   reinterpret_cast<intptr_t>(&zone_));
-    }
-#endif
-    zone_.Link(thread()->zone());
-    thread()->set_zone(&zone_);
-  }
-
   template<typename T> friend class GrowableArray;
   template<typename T> friend class ZoneGrowableArray;
 
diff --git a/runtime/vm/zone_test.cc b/runtime/vm/zone_test.cc
index da5f208..dceddbf 100644
--- a/runtime/vm/zone_test.cc
+++ b/runtime/vm/zone_test.cc
@@ -18,11 +18,11 @@
 #endif
   Dart_CreateIsolate(
       NULL, NULL, bin::isolate_snapshot_buffer, NULL, NULL, NULL);
-  Isolate* isolate = Isolate::Current();
-  EXPECT(isolate->current_zone() == NULL);
+  Thread* thread = Thread::Current();
+  EXPECT(thread->zone() == NULL);
   {
-    StackZone stack_zone(isolate);
-    EXPECT(isolate->current_zone() != NULL);
+    StackZone stack_zone(thread);
+    EXPECT(thread->zone() != NULL);
     Zone* zone = stack_zone.GetZone();
     intptr_t allocated_size = 0;
 
@@ -69,7 +69,7 @@
     allocated_size += (kSegmentSize + kWordSize);
     EXPECT_LE(allocated_size, zone->SizeInBytes());
   }
-  EXPECT(isolate->current_zone() == NULL);
+  EXPECT(thread->zone() == NULL);
   Dart_ShutdownIsolate();
 }
 
@@ -80,11 +80,11 @@
 #endif
   Dart_CreateIsolate(
       NULL, NULL, bin::isolate_snapshot_buffer, NULL, NULL, NULL);
-  Isolate* isolate = Isolate::Current();
-  EXPECT(isolate->current_zone() == NULL);
+  Thread* thread = Thread::Current();
+  EXPECT(thread->zone() == NULL);
   {
-    StackZone zone(isolate);
-    EXPECT(isolate->current_zone() != NULL);
+    StackZone zone(thread);
+    EXPECT(thread->zone() != NULL);
     intptr_t allocated_size = 0;
 
     const intptr_t kNumElements = 1000;
@@ -92,7 +92,7 @@
     allocated_size += sizeof(uint32_t) * kNumElements;
     EXPECT_LE(allocated_size, zone.SizeInBytes());
   }
-  EXPECT(isolate->current_zone() == NULL);
+  EXPECT(thread->zone() == NULL);
   Dart_ShutdownIsolate();
 }
 
@@ -104,11 +104,11 @@
 #endif
   Dart_CreateIsolate(
       NULL, NULL, bin::isolate_snapshot_buffer, NULL, NULL, NULL);
-  Isolate* isolate = Isolate::Current();
-  EXPECT(isolate->current_zone() == NULL);
+  Thread* thread = Thread::Current();
+  EXPECT(thread->zone() == NULL);
   {
-    StackZone zone(isolate);
-    EXPECT(isolate->current_zone() != NULL);
+    StackZone zone(thread);
+    EXPECT(thread->zone() != NULL);
 
     const intptr_t kNumElements = (kIntptrMax / sizeof(uint32_t)) + 1;
     zone.GetZone()->Alloc<uint32_t>(kNumElements);
@@ -123,8 +123,8 @@
 #endif
   Dart_CreateIsolate(
       NULL, NULL, bin::isolate_snapshot_buffer, NULL, NULL, NULL);
-  Isolate* isolate = Isolate::Current();
-  EXPECT(isolate->current_zone() == NULL);
+  Thread* thread = Thread::Current();
+  EXPECT(thread->zone() == NULL);
   static int marker;
 
   class SimpleZoneObject : public ZoneAllocated {
@@ -140,7 +140,7 @@
 
   // Create a few zone allocated objects.
   {
-    StackZone zone(isolate);
+    StackZone zone(thread);
     EXPECT_EQ(0, zone.SizeInBytes());
     SimpleZoneObject* first = new SimpleZoneObject();
     EXPECT(first != NULL);
@@ -160,13 +160,13 @@
     EXPECT_EQ(42, first->slot);
     EXPECT_EQ(87, second->slot);
   }
-  EXPECT(isolate->current_zone() == NULL);
+  EXPECT(thread->zone() == NULL);
   Dart_ShutdownIsolate();
 }
 
 
 TEST_CASE(PrintToString) {
-  StackZone zone(Isolate::Current());
+  StackZone zone(Thread::Current());
   const char* result = zone.GetZone()->PrintToString("Hello %s!", "World");
   EXPECT_STREQ("Hello World!", result);
 }
diff --git a/sdk/bin/dart b/sdk/bin/dart
index 675963f..3de8c25 100755
--- a/sdk/bin/dart
+++ b/sdk/bin/dart
@@ -18,16 +18,40 @@
 # Handle the case where dart-sdk/bin has been symlinked to.
 CUR_DIR="$(cd "${PROG_NAME%/*}" ; pwd -P)"
 
-if [ -z "$DART_CONFIGURATION" ];
-then
-  DART_CONFIGURATION="ReleaseIA32"
-fi
-
 if [[ `uname` == 'Darwin' ]];
 then
-  BIN_DIR="$CUR_DIR"/../../xcodebuild/$DART_CONFIGURATION
+  OUT_DIR="$CUR_DIR"/../../xcodebuild/
 else
-  BIN_DIR="$CUR_DIR"/../../out/$DART_CONFIGURATION
+  OUT_DIR="$CUR_DIR"/../../out/
 fi
 
+if [ -z "$DART_CONFIGURATION" ];
+then
+  DIRS=$( ls "$OUT_DIR" )
+  # list of possible configurations in decreasing desirability
+  CONFIGS=("ReleaseIA32" "ReleaseX64" "DebugIA32" "DebugX64"
+    "ReleaseARM"    "ReleaseARM64"    "ReleaseARMV5TE"    "ReleaseMIPS"
+    "DebugARM"      "DebugARM64"      "DebugARMV5TE"      "DebugMIPS")
+  DART_CONFIGURATION="None"
+  for CONFIG in ${CONFIGS[*]}
+  do
+    for DIR in $DIRS;
+    do
+      if [ "$CONFIG" = "$DIR" ];
+      then
+        # choose most desirable configuration that is available and break
+        DART_CONFIGURATION="$DIR"
+        break 2
+      fi
+    done
+  done
+  if [ "$DART_CONFIGURATION" = "None" ]
+  then
+    echo "No valid dart configuration found in $OUT_DIR"
+    exit 1
+  fi
+fi
+
+BIN_DIR="$OUT_DIR$DART_CONFIGURATION"
+
 exec "$BIN_DIR"/dart "$@"
diff --git a/sdk/bin/dartanalyzer b/sdk/bin/dartanalyzer
index ea69738..9b4a2ab 100755
--- a/sdk/bin/dartanalyzer
+++ b/sdk/bin/dartanalyzer
@@ -45,17 +45,42 @@
 
 ANALYZER="$DART_ROOT/third_party/pkg/analyzer_cli/bin/analyzer.dart"
 
-if [ -z "$DART_CONFIGURATION" ];
+if [[ `uname` == 'Darwin' ]];
 then
-  DART_CONFIGURATION="ReleaseIA32"
+  OUT_DIR="$DART_ROOT/xcodebuild/"
+else
+  OUT_DIR="$DART_ROOT/out/"
 fi
 
-if [[ `uname` == 'Darwin' ]]; then
-  BUILD_DIR="$DART_ROOT/xcodebuild/$DART_CONFIGURATION"
-else
-  BUILD_DIR="$DART_ROOT/out/$DART_CONFIGURATION"
+if [ -z "$DART_CONFIGURATION" ];
+then
+  DIRS=$( ls "$OUT_DIR" )
+  # list of possible configurations in decreasing desirability
+  CONFIGS=("ReleaseIA32" "ReleaseX64" "DebugIA32" "DebugX64"
+    "ReleaseARM"    "ReleaseARM64"    "ReleaseARMV5TE"    "ReleaseMIPS"
+    "DebugARM"      "DebugARM64"      "DebugARMV5TE"      "DebugMIPS")
+  DART_CONFIGURATION="None"
+  for CONFIG in ${CONFIGS[*]}
+  do
+    for DIR in $DIRS;
+    do
+      if [ "$CONFIG" = "$DIR" ];
+      then
+        # choose most desirable configuration that is available and break
+        DART_CONFIGURATION="$DIR"
+        break 2
+      fi
+    done
+  done
+  if [ "$DART_CONFIGURATION" = "None" ]
+  then
+    echo "No valid dart configuration found in $OUT_DIR"
+    exit 1
+  fi
 fi
 
+BUILD_DIR="$OUT_DIR$DART_CONFIGURATION"
+
 PACKAGE_ROOT="$BUILD_DIR/packages/"
 
 exec "$DART" "${EXTRA_VM_OPTIONS[@]}" "--package-root=$PACKAGE_ROOT" "$ANALYZER" "$SDK_ARG" "$@"
diff --git a/sdk/bin/dartdocgen b/sdk/bin/dartdocgen
deleted file mode 100755
index bf807ad..0000000
--- a/sdk/bin/dartdocgen
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/bin/bash
-# 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.
-
-function follow_links() {
-  file="$1"
-  while [ -h "$file" ]; do
-    # On Mac OS, readlink -f doesn't work.
-    file="$(readlink "$file")"
-  done
-  echo "$file"
-}
-
-# Unlike $0, $BASH_SOURCE points to the absolute path of this file.
-PROG_NAME="$(follow_links "$BASH_SOURCE")"
-
-# Handle the case where dart-sdk/bin has been symlinked to.
-BIN_DIR="$(cd "${PROG_NAME%/*}" ; pwd -P)"
-
-SDK_DIR="$(cd "${BIN_DIR}/.." ; pwd -P)"
-
-unset SNAPSHOT
-
-SNAPSHOT="$BIN_DIR/snapshots/utils_wrapper.dart.snapshot"
-
-if test -f "$SNAPSHOT"; then
-  exec "$BIN_DIR"/dart \
-      "--package-root=$BIN_DIR/../packages/" "--old_gen_heap_size=1024" \
-      "$SNAPSHOT" \
-       docgen "--sdk=$SDK_DIR" "$@"
-else
-  exec "$BIN_DIR"/dart \
-      "--package-root=$BIN_DIR/../packages/" "--old_gen_heap_size=1024" \
-      "$BIN_DIR/../../pkg/docgen/bin/docgen.dart" "--sdk=$SDK_DIR" "$@"
-fi
diff --git a/sdk/bin/dartdocgen.bat b/sdk/bin/dartdocgen.bat
deleted file mode 100644
index 136b7f9..0000000
--- a/sdk/bin/dartdocgen.bat
+++ /dev/null
@@ -1,49 +0,0 @@
-@echo off
-REM Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
-REM for details. All rights reserved. Use of this source code is governed by a
-REM BSD-style license that can be found in the LICENSE file.
-
-setlocal
-rem Handle the case where dart-sdk/bin has been symlinked to.
-set DIR_NAME_WITH_SLASH=%~dp0
-set DIR_NAME=%DIR_NAME_WITH_SLASH:~0,-1%%
-call :follow_links "%DIR_NAME%", RETURNED_BIN_DIR
-rem Get rid of surrounding quotes.
-for %%i in ("%RETURNED_BIN_DIR%") do set BIN_DIR=%%~fi
-
-rem Get absolute full name for SDK_DIR.
-for %%i in ("%BIN_DIR%\..\") do set SDK_DIR=%%~fi
-
-rem Remove trailing backslash if there is one
-IF %SDK_DIR:~-1%==\ set SDK_DIR=%SDK_DIR:~0,-1%
-
-set DOCGEN=%SDK_DIR%\pkg\docgen\bin\docgen.dart
-set DART=%BIN_DIR%\dart
-set SNAPSHOT=%BIN_DIR%\snapshots\utils_wrapper.dart.snapshot
-
-if not defined DART_CONFIGURATION set DART_CONFIGURATION=ReleaseIA32
-
-set BUILD_DIR=%SDK_DIR%\..\build\%DART_CONFIGURATION%
-if exist "%SNAPSHOT%" (
-  "%DART%" "%SNAPSHOT%" "docgen" "--sdk=%SDK_DIR%" %*
-) else (
-  "%BUILD_DIR%\dart-sdk\bin\dart" "--package-root=%BUILD_DIR%\packages" "%DOCGEN%" "--sdk=%SDK_DIR%" %*
-)
-
-endlocal
-
-exit /b %errorlevel%
-
-:follow_links
-setlocal
-for %%i in (%1) do set result=%%~fi
-set current=
-for /f "tokens=2 delims=[]" %%i in ('dir /a:l ^"%~dp1^" 2^>nul ^
-                                     ^| find ">     %~n1 ["') do (
-  set current=%%i
-)
-if not "%current%"=="" call :follow_links "%current%", result
-endlocal & set %~2=%result%
-goto :eof
-
-:end
diff --git a/sdk/bin/docgen b/sdk/bin/docgen
deleted file mode 100755
index c6c5455..0000000
--- a/sdk/bin/docgen
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-# 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.
-
-echo "The 'docgen' name is deprecated. Prefer 'dartdocgen' instead."
-dartdocgen "$@"
diff --git a/sdk/bin/docgen.bat b/sdk/bin/docgen.bat
deleted file mode 100644
index 63a214f..0000000
--- a/sdk/bin/docgen.bat
+++ /dev/null
@@ -1,7 +0,0 @@
-@echo off
-REM Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
-REM for details. All rights reserved. Use of this source code is governed by a
-REM BSD-style license that can be found in the LICENSE file.
-
-echo "The 'docgen.bat' name is deprecated. Prefer 'dartdocgen.bat' instead."
-dartdocgen %*
diff --git a/sdk/lib/_blink/dartium/_blink_dartium.dart b/sdk/lib/_blink/dartium/_blink_dartium.dart
index a3d3f8d..4f88a3d 100644
--- a/sdk/lib/_blink/dartium/_blink_dartium.dart
+++ b/sdk/lib/_blink/dartium/_blink_dartium.dart
@@ -5,6 +5,9 @@
 // WARNING: Do not edit - generated code.
 library dart.dom._blink;
 
+import 'dart:js' as js;
+import 'dart:html' show DomException;
+
 // This is a place to put custom renames if we need them.
 final resolverMap = {
 };
@@ -627,153 +630,75 @@
 class BlinkANGLEInstancedArrays {
   static final instance = new BlinkANGLEInstancedArrays();
 
-  static drawArraysInstancedANGLE_Callback_2(mthis, __arg_0, __arg_1) native "ANGLEInstancedArrays_drawArraysInstancedANGLE_Callback";
-  drawArraysInstancedANGLE_Callback_2_(mthis, __arg_0, __arg_1) => drawArraysInstancedANGLE_Callback_2(mthis, __arg_0, __arg_1);
+  drawArraysInstancedANGLE_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "drawArraysInstancedANGLE", [__arg_0, __arg_1]);
 
-  static drawArraysInstancedANGLE_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "ANGLEInstancedArrays_drawArraysInstancedANGLE_Callback";
-  drawArraysInstancedANGLE_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => drawArraysInstancedANGLE_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  drawArraysInstancedANGLE_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "drawArraysInstancedANGLE", [__arg_0, __arg_1, __arg_2]);
 
-  static drawArraysInstancedANGLE_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "ANGLEInstancedArrays_drawArraysInstancedANGLE_Callback";
-  drawArraysInstancedANGLE_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => drawArraysInstancedANGLE_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  drawArraysInstancedANGLE_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "drawArraysInstancedANGLE", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static drawArraysInstancedANGLE_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "ANGLEInstancedArrays_drawArraysInstancedANGLE_Callback";
-  drawArraysInstancedANGLE_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => drawArraysInstancedANGLE_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  drawElementsInstancedANGLE_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "drawElementsInstancedANGLE", [__arg_0, __arg_1, __arg_2]);
 
-  static drawArraysInstancedANGLE_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "ANGLEInstancedArrays_drawArraysInstancedANGLE_Callback";
-  drawArraysInstancedANGLE_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => drawArraysInstancedANGLE_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  drawElementsInstancedANGLE_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "drawElementsInstancedANGLE", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static drawElementsInstancedANGLE_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "ANGLEInstancedArrays_drawElementsInstancedANGLE_Callback";
-  drawElementsInstancedANGLE_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => drawElementsInstancedANGLE_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  drawElementsInstancedANGLE_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => Blink_JsNative_DomException.callMethod(mthis, "drawElementsInstancedANGLE", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4]);
 
-  static drawElementsInstancedANGLE_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "ANGLEInstancedArrays_drawElementsInstancedANGLE_Callback";
-  drawElementsInstancedANGLE_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => drawElementsInstancedANGLE_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  vertexAttribDivisorANGLE_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "vertexAttribDivisorANGLE", []);
 
-  static drawElementsInstancedANGLE_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "ANGLEInstancedArrays_drawElementsInstancedANGLE_Callback";
-  drawElementsInstancedANGLE_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => drawElementsInstancedANGLE_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  vertexAttribDivisorANGLE_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "vertexAttribDivisorANGLE", [__arg_0]);
 
-  static drawElementsInstancedANGLE_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "ANGLEInstancedArrays_drawElementsInstancedANGLE_Callback";
-  drawElementsInstancedANGLE_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => drawElementsInstancedANGLE_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
-
-  static drawElementsInstancedANGLE_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) native "ANGLEInstancedArrays_drawElementsInstancedANGLE_Callback";
-  drawElementsInstancedANGLE_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => drawElementsInstancedANGLE_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6);
-
-  static vertexAttribDivisorANGLE_Callback_0(mthis) native "ANGLEInstancedArrays_vertexAttribDivisorANGLE_Callback";
-  vertexAttribDivisorANGLE_Callback_0_(mthis) => vertexAttribDivisorANGLE_Callback_0(mthis);
-
-  static vertexAttribDivisorANGLE_Callback_1(mthis, __arg_0) native "ANGLEInstancedArrays_vertexAttribDivisorANGLE_Callback";
-  vertexAttribDivisorANGLE_Callback_1_(mthis, __arg_0) => vertexAttribDivisorANGLE_Callback_1(mthis, __arg_0);
-
-  static vertexAttribDivisorANGLE_Callback_2(mthis, __arg_0, __arg_1) native "ANGLEInstancedArrays_vertexAttribDivisorANGLE_Callback";
-  vertexAttribDivisorANGLE_Callback_2_(mthis, __arg_0, __arg_1) => vertexAttribDivisorANGLE_Callback_2(mthis, __arg_0, __arg_1);
-
-  static vertexAttribDivisorANGLE_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "ANGLEInstancedArrays_vertexAttribDivisorANGLE_Callback";
-  vertexAttribDivisorANGLE_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => vertexAttribDivisorANGLE_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static vertexAttribDivisorANGLE_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "ANGLEInstancedArrays_vertexAttribDivisorANGLE_Callback";
-  vertexAttribDivisorANGLE_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => vertexAttribDivisorANGLE_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  vertexAttribDivisorANGLE_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "vertexAttribDivisorANGLE", [__arg_0, __arg_1]);
 
 }
 
 class BlinkAnalyserNode extends BlinkAudioNode {
   static final instance = new BlinkAnalyserNode();
 
-  static fftSize_Getter(mthis) native "AnalyserNode_fftSize_Getter";
-  fftSize_Getter_(mthis) => fftSize_Getter(mthis);
+  fftSize_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "fftSize");
 
-  static fftSize_Setter(mthis, __arg_0) native "AnalyserNode_fftSize_Setter";
-  fftSize_Setter_(mthis, __arg_0) => fftSize_Setter(mthis, __arg_0);
+  fftSize_Setter_(mthis, __arg_0) => mthis["fftSize"] = __arg_0;
 
-  static frequencyBinCount_Getter(mthis) native "AnalyserNode_frequencyBinCount_Getter";
-  frequencyBinCount_Getter_(mthis) => frequencyBinCount_Getter(mthis);
+  frequencyBinCount_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "frequencyBinCount");
 
-  static getByteFrequencyData_Callback_0(mthis) native "AnalyserNode_getByteFrequencyData_Callback";
-  getByteFrequencyData_Callback_0_(mthis) => getByteFrequencyData_Callback_0(mthis);
+  getByteFrequencyData_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getByteFrequencyData", []);
 
-  static getByteFrequencyData_Callback_1(mthis, __arg_0) native "AnalyserNode_getByteFrequencyData_Callback";
-  getByteFrequencyData_Callback_1_(mthis, __arg_0) => getByteFrequencyData_Callback_1(mthis, __arg_0);
+  getByteFrequencyData_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getByteFrequencyData", [__arg_0]);
 
-  static getByteFrequencyData_Callback_2(mthis, __arg_0, __arg_1) native "AnalyserNode_getByteFrequencyData_Callback";
-  getByteFrequencyData_Callback_2_(mthis, __arg_0, __arg_1) => getByteFrequencyData_Callback_2(mthis, __arg_0, __arg_1);
+  getByteTimeDomainData_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getByteTimeDomainData", []);
 
-  static getByteFrequencyData_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "AnalyserNode_getByteFrequencyData_Callback";
-  getByteFrequencyData_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getByteFrequencyData_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  getByteTimeDomainData_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getByteTimeDomainData", [__arg_0]);
 
-  static getByteTimeDomainData_Callback_0(mthis) native "AnalyserNode_getByteTimeDomainData_Callback";
-  getByteTimeDomainData_Callback_0_(mthis) => getByteTimeDomainData_Callback_0(mthis);
+  getFloatFrequencyData_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getFloatFrequencyData", []);
 
-  static getByteTimeDomainData_Callback_1(mthis, __arg_0) native "AnalyserNode_getByteTimeDomainData_Callback";
-  getByteTimeDomainData_Callback_1_(mthis, __arg_0) => getByteTimeDomainData_Callback_1(mthis, __arg_0);
+  getFloatFrequencyData_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getFloatFrequencyData", [__arg_0]);
 
-  static getByteTimeDomainData_Callback_2(mthis, __arg_0, __arg_1) native "AnalyserNode_getByteTimeDomainData_Callback";
-  getByteTimeDomainData_Callback_2_(mthis, __arg_0, __arg_1) => getByteTimeDomainData_Callback_2(mthis, __arg_0, __arg_1);
+  getFloatTimeDomainData_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getFloatTimeDomainData", []);
 
-  static getByteTimeDomainData_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "AnalyserNode_getByteTimeDomainData_Callback";
-  getByteTimeDomainData_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getByteTimeDomainData_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  getFloatTimeDomainData_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getFloatTimeDomainData", [__arg_0]);
 
-  static getFloatFrequencyData_Callback_0(mthis) native "AnalyserNode_getFloatFrequencyData_Callback";
-  getFloatFrequencyData_Callback_0_(mthis) => getFloatFrequencyData_Callback_0(mthis);
+  maxDecibels_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "maxDecibels");
 
-  static getFloatFrequencyData_Callback_1(mthis, __arg_0) native "AnalyserNode_getFloatFrequencyData_Callback";
-  getFloatFrequencyData_Callback_1_(mthis, __arg_0) => getFloatFrequencyData_Callback_1(mthis, __arg_0);
+  maxDecibels_Setter_(mthis, __arg_0) => mthis["maxDecibels"] = __arg_0;
 
-  static getFloatFrequencyData_Callback_2(mthis, __arg_0, __arg_1) native "AnalyserNode_getFloatFrequencyData_Callback";
-  getFloatFrequencyData_Callback_2_(mthis, __arg_0, __arg_1) => getFloatFrequencyData_Callback_2(mthis, __arg_0, __arg_1);
+  minDecibels_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "minDecibels");
 
-  static getFloatFrequencyData_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "AnalyserNode_getFloatFrequencyData_Callback";
-  getFloatFrequencyData_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getFloatFrequencyData_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  minDecibels_Setter_(mthis, __arg_0) => mthis["minDecibels"] = __arg_0;
 
-  static getFloatTimeDomainData_Callback_0(mthis) native "AnalyserNode_getFloatTimeDomainData_Callback";
-  getFloatTimeDomainData_Callback_0_(mthis) => getFloatTimeDomainData_Callback_0(mthis);
+  smoothingTimeConstant_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "smoothingTimeConstant");
 
-  static getFloatTimeDomainData_Callback_1(mthis, __arg_0) native "AnalyserNode_getFloatTimeDomainData_Callback";
-  getFloatTimeDomainData_Callback_1_(mthis, __arg_0) => getFloatTimeDomainData_Callback_1(mthis, __arg_0);
-
-  static getFloatTimeDomainData_Callback_2(mthis, __arg_0, __arg_1) native "AnalyserNode_getFloatTimeDomainData_Callback";
-  getFloatTimeDomainData_Callback_2_(mthis, __arg_0, __arg_1) => getFloatTimeDomainData_Callback_2(mthis, __arg_0, __arg_1);
-
-  static getFloatTimeDomainData_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "AnalyserNode_getFloatTimeDomainData_Callback";
-  getFloatTimeDomainData_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getFloatTimeDomainData_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static maxDecibels_Getter(mthis) native "AnalyserNode_maxDecibels_Getter";
-  maxDecibels_Getter_(mthis) => maxDecibels_Getter(mthis);
-
-  static maxDecibels_Setter(mthis, __arg_0) native "AnalyserNode_maxDecibels_Setter";
-  maxDecibels_Setter_(mthis, __arg_0) => maxDecibels_Setter(mthis, __arg_0);
-
-  static minDecibels_Getter(mthis) native "AnalyserNode_minDecibels_Getter";
-  minDecibels_Getter_(mthis) => minDecibels_Getter(mthis);
-
-  static minDecibels_Setter(mthis, __arg_0) native "AnalyserNode_minDecibels_Setter";
-  minDecibels_Setter_(mthis, __arg_0) => minDecibels_Setter(mthis, __arg_0);
-
-  static smoothingTimeConstant_Getter(mthis) native "AnalyserNode_smoothingTimeConstant_Getter";
-  smoothingTimeConstant_Getter_(mthis) => smoothingTimeConstant_Getter(mthis);
-
-  static smoothingTimeConstant_Setter(mthis, __arg_0) native "AnalyserNode_smoothingTimeConstant_Setter";
-  smoothingTimeConstant_Setter_(mthis, __arg_0) => smoothingTimeConstant_Setter(mthis, __arg_0);
+  smoothingTimeConstant_Setter_(mthis, __arg_0) => mthis["smoothingTimeConstant"] = __arg_0;
 
 }
 
 class BlinkAnimation extends BlinkAnimationNode {
   static final instance = new BlinkAnimation();
 
-  static constructorCallback_0() native "Animation_constructorCallback";
-  constructorCallback_0_() => constructorCallback_0();
+  constructorCallback_0_() => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "Animation"), []);
 
-  static constructorCallback_1(__arg_0) native "Animation_constructorCallback";
-  constructorCallback_1_(__arg_0) => constructorCallback_1(__arg_0);
+  constructorCallback_1_(__arg_0) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "Animation"), [__arg_0]);
 
-  static constructorCallback_2(__arg_0, __arg_1) native "Animation_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  constructorCallback_2_(__arg_0, __arg_1) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "Animation"), [__arg_0, __arg_1]);
 
-  static constructorCallback_3(__arg_0, __arg_1, __arg_2) native "Animation_constructorCallback";
-  constructorCallback_3_(__arg_0, __arg_1, __arg_2) => constructorCallback_3(__arg_0, __arg_1, __arg_2);
-
-  static constructorCallback_4(__arg_0, __arg_1, __arg_2, __arg_3) native "Animation_constructorCallback";
-  constructorCallback_4_(__arg_0, __arg_1, __arg_2, __arg_3) => constructorCallback_4(__arg_0, __arg_1, __arg_2, __arg_3);
-
-  static constructorCallback_5(__arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "Animation_constructorCallback";
-  constructorCallback_5_(__arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => constructorCallback_5(__arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  constructorCallback_3_(__arg_0, __arg_1, __arg_2) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "Animation"), [__arg_0, __arg_1, __arg_2]);
 
 }
 
@@ -785,900 +710,445 @@
 class BlinkAnimationNode {
   static final instance = new BlinkAnimationNode();
 
-  static activeDuration_Getter(mthis) native "AnimationNode_activeDuration_Getter";
-  activeDuration_Getter_(mthis) => activeDuration_Getter(mthis);
+  activeDuration_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "activeDuration");
 
-  static currentIteration_Getter(mthis) native "AnimationNode_currentIteration_Getter";
-  currentIteration_Getter_(mthis) => currentIteration_Getter(mthis);
+  currentIteration_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "currentIteration");
 
-  static duration_Getter(mthis) native "AnimationNode_duration_Getter";
-  duration_Getter_(mthis) => duration_Getter(mthis);
+  duration_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "duration");
 
-  static endTime_Getter(mthis) native "AnimationNode_endTime_Getter";
-  endTime_Getter_(mthis) => endTime_Getter(mthis);
+  endTime_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "endTime");
 
-  static localTime_Getter(mthis) native "AnimationNode_localTime_Getter";
-  localTime_Getter_(mthis) => localTime_Getter(mthis);
+  localTime_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "localTime");
 
-  static player_Getter(mthis) native "AnimationNode_player_Getter";
-  player_Getter_(mthis) => player_Getter(mthis);
+  player_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "player");
 
-  static startTime_Getter(mthis) native "AnimationNode_startTime_Getter";
-  startTime_Getter_(mthis) => startTime_Getter(mthis);
+  startTime_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "startTime");
 
-  static timing_Getter(mthis) native "AnimationNode_timing_Getter";
-  timing_Getter_(mthis) => timing_Getter(mthis);
+  timing_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "timing");
 
 }
 
 class BlinkAnimationPlayer extends BlinkEventTarget {
   static final instance = new BlinkAnimationPlayer();
 
-  static cancel_Callback_0(mthis) native "AnimationPlayer_cancel_Callback";
-  cancel_Callback_0_(mthis) => cancel_Callback_0(mthis);
+  cancel_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "cancel", []);
 
-  static cancel_Callback_1(mthis, __arg_0) native "AnimationPlayer_cancel_Callback";
-  cancel_Callback_1_(mthis, __arg_0) => cancel_Callback_1(mthis, __arg_0);
+  currentTime_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "currentTime");
 
-  static cancel_Callback_2(mthis, __arg_0, __arg_1) native "AnimationPlayer_cancel_Callback";
-  cancel_Callback_2_(mthis, __arg_0, __arg_1) => cancel_Callback_2(mthis, __arg_0, __arg_1);
+  currentTime_Setter_(mthis, __arg_0) => mthis["currentTime"] = __arg_0;
 
-  static currentTime_Getter(mthis) native "AnimationPlayer_currentTime_Getter";
-  currentTime_Getter_(mthis) => currentTime_Getter(mthis);
+  finish_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "finish", []);
 
-  static currentTime_Setter(mthis, __arg_0) native "AnimationPlayer_currentTime_Setter";
-  currentTime_Setter_(mthis, __arg_0) => currentTime_Setter(mthis, __arg_0);
+  onfinish_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onfinish");
 
-  static finish_Callback_0(mthis) native "AnimationPlayer_finish_Callback";
-  finish_Callback_0_(mthis) => finish_Callback_0(mthis);
+  onfinish_Setter_(mthis, __arg_0) => mthis["onfinish"] = __arg_0;
 
-  static finish_Callback_1(mthis, __arg_0) native "AnimationPlayer_finish_Callback";
-  finish_Callback_1_(mthis, __arg_0) => finish_Callback_1(mthis, __arg_0);
+  pause_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "pause", []);
 
-  static finish_Callback_2(mthis, __arg_0, __arg_1) native "AnimationPlayer_finish_Callback";
-  finish_Callback_2_(mthis, __arg_0, __arg_1) => finish_Callback_2(mthis, __arg_0, __arg_1);
+  playState_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "playState");
 
-  static onfinish_Getter(mthis) native "AnimationPlayer_onfinish_Getter";
-  onfinish_Getter_(mthis) => onfinish_Getter(mthis);
+  play_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "play", []);
 
-  static onfinish_Setter(mthis, __arg_0) native "AnimationPlayer_onfinish_Setter";
-  onfinish_Setter_(mthis, __arg_0) => onfinish_Setter(mthis, __arg_0);
+  playbackRate_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "playbackRate");
 
-  static pause_Callback_0(mthis) native "AnimationPlayer_pause_Callback";
-  pause_Callback_0_(mthis) => pause_Callback_0(mthis);
+  playbackRate_Setter_(mthis, __arg_0) => mthis["playbackRate"] = __arg_0;
 
-  static pause_Callback_1(mthis, __arg_0) native "AnimationPlayer_pause_Callback";
-  pause_Callback_1_(mthis, __arg_0) => pause_Callback_1(mthis, __arg_0);
+  reverse_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "reverse", []);
 
-  static pause_Callback_2(mthis, __arg_0, __arg_1) native "AnimationPlayer_pause_Callback";
-  pause_Callback_2_(mthis, __arg_0, __arg_1) => pause_Callback_2(mthis, __arg_0, __arg_1);
+  source_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "source");
 
-  static playState_Getter(mthis) native "AnimationPlayer_playState_Getter";
-  playState_Getter_(mthis) => playState_Getter(mthis);
+  source_Setter_(mthis, __arg_0) => mthis["source"] = __arg_0;
 
-  static play_Callback_0(mthis) native "AnimationPlayer_play_Callback";
-  play_Callback_0_(mthis) => play_Callback_0(mthis);
+  startTime_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "startTime");
 
-  static play_Callback_1(mthis, __arg_0) native "AnimationPlayer_play_Callback";
-  play_Callback_1_(mthis, __arg_0) => play_Callback_1(mthis, __arg_0);
-
-  static play_Callback_2(mthis, __arg_0, __arg_1) native "AnimationPlayer_play_Callback";
-  play_Callback_2_(mthis, __arg_0, __arg_1) => play_Callback_2(mthis, __arg_0, __arg_1);
-
-  static playbackRate_Getter(mthis) native "AnimationPlayer_playbackRate_Getter";
-  playbackRate_Getter_(mthis) => playbackRate_Getter(mthis);
-
-  static playbackRate_Setter(mthis, __arg_0) native "AnimationPlayer_playbackRate_Setter";
-  playbackRate_Setter_(mthis, __arg_0) => playbackRate_Setter(mthis, __arg_0);
-
-  static reverse_Callback_0(mthis) native "AnimationPlayer_reverse_Callback";
-  reverse_Callback_0_(mthis) => reverse_Callback_0(mthis);
-
-  static reverse_Callback_1(mthis, __arg_0) native "AnimationPlayer_reverse_Callback";
-  reverse_Callback_1_(mthis, __arg_0) => reverse_Callback_1(mthis, __arg_0);
-
-  static reverse_Callback_2(mthis, __arg_0, __arg_1) native "AnimationPlayer_reverse_Callback";
-  reverse_Callback_2_(mthis, __arg_0, __arg_1) => reverse_Callback_2(mthis, __arg_0, __arg_1);
-
-  static source_Getter(mthis) native "AnimationPlayer_source_Getter";
-  source_Getter_(mthis) => source_Getter(mthis);
-
-  static source_Setter(mthis, __arg_0) native "AnimationPlayer_source_Setter";
-  source_Setter_(mthis, __arg_0) => source_Setter(mthis, __arg_0);
-
-  static startTime_Getter(mthis) native "AnimationPlayer_startTime_Getter";
-  startTime_Getter_(mthis) => startTime_Getter(mthis);
-
-  static startTime_Setter(mthis, __arg_0) native "AnimationPlayer_startTime_Setter";
-  startTime_Setter_(mthis, __arg_0) => startTime_Setter(mthis, __arg_0);
+  startTime_Setter_(mthis, __arg_0) => mthis["startTime"] = __arg_0;
 
 }
 
 class BlinkAnimationPlayerEvent extends BlinkEvent {
   static final instance = new BlinkAnimationPlayerEvent();
 
-  static constructorCallback_2(__arg_0, __arg_1) native "AnimationPlayerEvent_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  constructorCallback_2_(__arg_0, __arg_1) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "AnimationPlayerEvent"), [__arg_0, __arg_1]);
 
-  static currentTime_Getter(mthis) native "AnimationPlayerEvent_currentTime_Getter";
-  currentTime_Getter_(mthis) => currentTime_Getter(mthis);
+  currentTime_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "currentTime");
 
-  static timelineTime_Getter(mthis) native "AnimationPlayerEvent_timelineTime_Getter";
-  timelineTime_Getter_(mthis) => timelineTime_Getter(mthis);
+  timelineTime_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "timelineTime");
 
 }
 
 class BlinkAnimationTimeline {
   static final instance = new BlinkAnimationTimeline();
 
-  static currentTime_Getter(mthis) native "AnimationTimeline_currentTime_Getter";
-  currentTime_Getter_(mthis) => currentTime_Getter(mthis);
+  currentTime_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "currentTime");
 
-  static getAnimationPlayers_Callback_0(mthis) native "AnimationTimeline_getAnimationPlayers_Callback";
-  getAnimationPlayers_Callback_0_(mthis) => getAnimationPlayers_Callback_0(mthis);
+  getAnimationPlayers_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getAnimationPlayers", []);
 
-  static getAnimationPlayers_Callback_1(mthis, __arg_0) native "AnimationTimeline_getAnimationPlayers_Callback";
-  getAnimationPlayers_Callback_1_(mthis, __arg_0) => getAnimationPlayers_Callback_1(mthis, __arg_0);
+  play_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "play", []);
 
-  static getAnimationPlayers_Callback_2(mthis, __arg_0, __arg_1) native "AnimationTimeline_getAnimationPlayers_Callback";
-  getAnimationPlayers_Callback_2_(mthis, __arg_0, __arg_1) => getAnimationPlayers_Callback_2(mthis, __arg_0, __arg_1);
-
-  static play_Callback_0(mthis) native "AnimationTimeline_play_Callback";
-  play_Callback_0_(mthis) => play_Callback_0(mthis);
-
-  static play_Callback_1(mthis, __arg_0) native "AnimationTimeline_play_Callback";
-  play_Callback_1_(mthis, __arg_0) => play_Callback_1(mthis, __arg_0);
-
-  static play_Callback_2(mthis, __arg_0, __arg_1) native "AnimationTimeline_play_Callback";
-  play_Callback_2_(mthis, __arg_0, __arg_1) => play_Callback_2(mthis, __arg_0, __arg_1);
-
-  static play_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "AnimationTimeline_play_Callback";
-  play_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => play_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  play_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "play", [__arg_0]);
 
 }
 
 class BlinkApplicationCache extends BlinkEventTarget {
   static final instance = new BlinkApplicationCache();
 
-  static abort_Callback_0(mthis) native "ApplicationCache_abort_Callback";
-  abort_Callback_0_(mthis) => abort_Callback_0(mthis);
+  abort_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "abort", []);
 
-  static abort_Callback_1(mthis, __arg_0) native "ApplicationCache_abort_Callback";
-  abort_Callback_1_(mthis, __arg_0) => abort_Callback_1(mthis, __arg_0);
+  oncached_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "oncached");
 
-  static abort_Callback_2(mthis, __arg_0, __arg_1) native "ApplicationCache_abort_Callback";
-  abort_Callback_2_(mthis, __arg_0, __arg_1) => abort_Callback_2(mthis, __arg_0, __arg_1);
+  oncached_Setter_(mthis, __arg_0) => mthis["oncached"] = __arg_0;
 
-  static oncached_Getter(mthis) native "ApplicationCache_oncached_Getter";
-  oncached_Getter_(mthis) => oncached_Getter(mthis);
+  onchecking_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onchecking");
 
-  static oncached_Setter(mthis, __arg_0) native "ApplicationCache_oncached_Setter";
-  oncached_Setter_(mthis, __arg_0) => oncached_Setter(mthis, __arg_0);
+  onchecking_Setter_(mthis, __arg_0) => mthis["onchecking"] = __arg_0;
 
-  static onchecking_Getter(mthis) native "ApplicationCache_onchecking_Getter";
-  onchecking_Getter_(mthis) => onchecking_Getter(mthis);
+  ondownloading_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ondownloading");
 
-  static onchecking_Setter(mthis, __arg_0) native "ApplicationCache_onchecking_Setter";
-  onchecking_Setter_(mthis, __arg_0) => onchecking_Setter(mthis, __arg_0);
+  ondownloading_Setter_(mthis, __arg_0) => mthis["ondownloading"] = __arg_0;
 
-  static ondownloading_Getter(mthis) native "ApplicationCache_ondownloading_Getter";
-  ondownloading_Getter_(mthis) => ondownloading_Getter(mthis);
+  onerror_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onerror");
 
-  static ondownloading_Setter(mthis, __arg_0) native "ApplicationCache_ondownloading_Setter";
-  ondownloading_Setter_(mthis, __arg_0) => ondownloading_Setter(mthis, __arg_0);
+  onerror_Setter_(mthis, __arg_0) => mthis["onerror"] = __arg_0;
 
-  static onerror_Getter(mthis) native "ApplicationCache_onerror_Getter";
-  onerror_Getter_(mthis) => onerror_Getter(mthis);
+  onnoupdate_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onnoupdate");
 
-  static onerror_Setter(mthis, __arg_0) native "ApplicationCache_onerror_Setter";
-  onerror_Setter_(mthis, __arg_0) => onerror_Setter(mthis, __arg_0);
+  onnoupdate_Setter_(mthis, __arg_0) => mthis["onnoupdate"] = __arg_0;
 
-  static onnoupdate_Getter(mthis) native "ApplicationCache_onnoupdate_Getter";
-  onnoupdate_Getter_(mthis) => onnoupdate_Getter(mthis);
+  onobsolete_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onobsolete");
 
-  static onnoupdate_Setter(mthis, __arg_0) native "ApplicationCache_onnoupdate_Setter";
-  onnoupdate_Setter_(mthis, __arg_0) => onnoupdate_Setter(mthis, __arg_0);
+  onobsolete_Setter_(mthis, __arg_0) => mthis["onobsolete"] = __arg_0;
 
-  static onobsolete_Getter(mthis) native "ApplicationCache_onobsolete_Getter";
-  onobsolete_Getter_(mthis) => onobsolete_Getter(mthis);
+  onprogress_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onprogress");
 
-  static onobsolete_Setter(mthis, __arg_0) native "ApplicationCache_onobsolete_Setter";
-  onobsolete_Setter_(mthis, __arg_0) => onobsolete_Setter(mthis, __arg_0);
+  onprogress_Setter_(mthis, __arg_0) => mthis["onprogress"] = __arg_0;
 
-  static onprogress_Getter(mthis) native "ApplicationCache_onprogress_Getter";
-  onprogress_Getter_(mthis) => onprogress_Getter(mthis);
+  onupdateready_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onupdateready");
 
-  static onprogress_Setter(mthis, __arg_0) native "ApplicationCache_onprogress_Setter";
-  onprogress_Setter_(mthis, __arg_0) => onprogress_Setter(mthis, __arg_0);
+  onupdateready_Setter_(mthis, __arg_0) => mthis["onupdateready"] = __arg_0;
 
-  static onupdateready_Getter(mthis) native "ApplicationCache_onupdateready_Getter";
-  onupdateready_Getter_(mthis) => onupdateready_Getter(mthis);
+  status_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "status");
 
-  static onupdateready_Setter(mthis, __arg_0) native "ApplicationCache_onupdateready_Setter";
-  onupdateready_Setter_(mthis, __arg_0) => onupdateready_Setter(mthis, __arg_0);
+  swapCache_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "swapCache", []);
 
-  static status_Getter(mthis) native "ApplicationCache_status_Getter";
-  status_Getter_(mthis) => status_Getter(mthis);
-
-  static swapCache_Callback_0(mthis) native "ApplicationCache_swapCache_Callback";
-  swapCache_Callback_0_(mthis) => swapCache_Callback_0(mthis);
-
-  static swapCache_Callback_1(mthis, __arg_0) native "ApplicationCache_swapCache_Callback";
-  swapCache_Callback_1_(mthis, __arg_0) => swapCache_Callback_1(mthis, __arg_0);
-
-  static swapCache_Callback_2(mthis, __arg_0, __arg_1) native "ApplicationCache_swapCache_Callback";
-  swapCache_Callback_2_(mthis, __arg_0, __arg_1) => swapCache_Callback_2(mthis, __arg_0, __arg_1);
-
-  static update_Callback_0(mthis) native "ApplicationCache_update_Callback";
-  update_Callback_0_(mthis) => update_Callback_0(mthis);
-
-  static update_Callback_1(mthis, __arg_0) native "ApplicationCache_update_Callback";
-  update_Callback_1_(mthis, __arg_0) => update_Callback_1(mthis, __arg_0);
-
-  static update_Callback_2(mthis, __arg_0, __arg_1) native "ApplicationCache_update_Callback";
-  update_Callback_2_(mthis, __arg_0, __arg_1) => update_Callback_2(mthis, __arg_0, __arg_1);
+  update_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "update", []);
 
 }
 
 class BlinkApplicationCacheErrorEvent extends BlinkEvent {
   static final instance = new BlinkApplicationCacheErrorEvent();
 
-  static constructorCallback_2(__arg_0, __arg_1) native "ApplicationCacheErrorEvent_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  constructorCallback_2_(__arg_0, __arg_1) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "ApplicationCacheErrorEvent"), [__arg_0, __arg_1]);
 
-  static message_Getter(mthis) native "ApplicationCacheErrorEvent_message_Getter";
-  message_Getter_(mthis) => message_Getter(mthis);
+  message_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "message");
 
-  static reason_Getter(mthis) native "ApplicationCacheErrorEvent_reason_Getter";
-  reason_Getter_(mthis) => reason_Getter(mthis);
+  reason_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "reason");
 
-  static status_Getter(mthis) native "ApplicationCacheErrorEvent_status_Getter";
-  status_Getter_(mthis) => status_Getter(mthis);
+  status_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "status");
 
-  static url_Getter(mthis) native "ApplicationCacheErrorEvent_url_Getter";
-  url_Getter_(mthis) => url_Getter(mthis);
+  url_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "url");
 
 }
 
 class BlinkAttr extends BlinkNode {
   static final instance = new BlinkAttr();
 
-  static localName_Getter(mthis) native "Attr_localName_Getter";
-  localName_Getter_(mthis) => localName_Getter(mthis);
+  localName_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "localName");
 
-  static name_Getter(mthis) native "Attr_name_Getter";
-  name_Getter_(mthis) => name_Getter(mthis);
+  name_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "name");
 
-  static namespaceURI_Getter(mthis) native "Attr_namespaceURI_Getter";
-  namespaceURI_Getter_(mthis) => namespaceURI_Getter(mthis);
+  namespaceURI_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "namespaceURI");
 
-  static nodeValue_Getter(mthis) native "Attr_nodeValue_Getter";
-  nodeValue_Getter_(mthis) => nodeValue_Getter(mthis);
+  nodeValue_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "nodeValue");
 
-  static nodeValue_Setter(mthis, __arg_0) native "Attr_nodeValue_Setter";
-  nodeValue_Setter_(mthis, __arg_0) => nodeValue_Setter(mthis, __arg_0);
+  nodeValue_Setter_(mthis, __arg_0) => mthis["nodeValue"] = __arg_0;
 
-  static ownerElement_Getter(mthis) native "Attr_ownerElement_Getter";
-  ownerElement_Getter_(mthis) => ownerElement_Getter(mthis);
+  ownerElement_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ownerElement");
 
-  static prefix_Getter(mthis) native "Attr_prefix_Getter";
-  prefix_Getter_(mthis) => prefix_Getter(mthis);
+  prefix_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "prefix");
 
-  static specified_Getter(mthis) native "Attr_specified_Getter";
-  specified_Getter_(mthis) => specified_Getter(mthis);
+  specified_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "specified");
 
-  static textContent_Getter(mthis) native "Attr_textContent_Getter";
-  textContent_Getter_(mthis) => textContent_Getter(mthis);
+  textContent_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "textContent");
 
-  static textContent_Setter(mthis, __arg_0) native "Attr_textContent_Setter";
-  textContent_Setter_(mthis, __arg_0) => textContent_Setter(mthis, __arg_0);
+  textContent_Setter_(mthis, __arg_0) => mthis["textContent"] = __arg_0;
 
-  static value_Getter(mthis) native "Attr_value_Getter";
-  value_Getter_(mthis) => value_Getter(mthis);
+  value_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "value");
 
-  static value_Setter(mthis, __arg_0) native "Attr_value_Setter";
-  value_Setter_(mthis, __arg_0) => value_Setter(mthis, __arg_0);
+  value_Setter_(mthis, __arg_0) => mthis["value"] = __arg_0;
 
 }
 
 class BlinkAudioBuffer {
   static final instance = new BlinkAudioBuffer();
 
-  static duration_Getter(mthis) native "AudioBuffer_duration_Getter";
-  duration_Getter_(mthis) => duration_Getter(mthis);
+  duration_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "duration");
 
-  static getChannelData_Callback_0(mthis) native "AudioBuffer_getChannelData_Callback";
-  getChannelData_Callback_0_(mthis) => getChannelData_Callback_0(mthis);
+  getChannelData_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getChannelData", []);
 
-  static getChannelData_Callback_1(mthis, __arg_0) native "AudioBuffer_getChannelData_Callback";
-  getChannelData_Callback_1_(mthis, __arg_0) => getChannelData_Callback_1(mthis, __arg_0);
+  getChannelData_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getChannelData", [__arg_0]);
 
-  static getChannelData_Callback_2(mthis, __arg_0, __arg_1) native "AudioBuffer_getChannelData_Callback";
-  getChannelData_Callback_2_(mthis, __arg_0, __arg_1) => getChannelData_Callback_2(mthis, __arg_0, __arg_1);
+  length_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "length");
 
-  static getChannelData_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "AudioBuffer_getChannelData_Callback";
-  getChannelData_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getChannelData_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  numberOfChannels_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "numberOfChannels");
 
-  static length_Getter(mthis) native "AudioBuffer_length_Getter";
-  length_Getter_(mthis) => length_Getter(mthis);
-
-  static numberOfChannels_Getter(mthis) native "AudioBuffer_numberOfChannels_Getter";
-  numberOfChannels_Getter_(mthis) => numberOfChannels_Getter(mthis);
-
-  static sampleRate_Getter(mthis) native "AudioBuffer_sampleRate_Getter";
-  sampleRate_Getter_(mthis) => sampleRate_Getter(mthis);
+  sampleRate_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "sampleRate");
 
 }
 
 class BlinkAudioBufferSourceNode extends BlinkAudioSourceNode {
   static final instance = new BlinkAudioBufferSourceNode();
 
-  static buffer_Getter(mthis) native "AudioBufferSourceNode_buffer_Getter";
-  buffer_Getter_(mthis) => buffer_Getter(mthis);
+  buffer_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "buffer");
 
-  static buffer_Setter(mthis, __arg_0) native "AudioBufferSourceNode_buffer_Setter";
-  buffer_Setter_(mthis, __arg_0) => buffer_Setter(mthis, __arg_0);
+  buffer_Setter_(mthis, __arg_0) => mthis["buffer"] = __arg_0;
 
-  static loopEnd_Getter(mthis) native "AudioBufferSourceNode_loopEnd_Getter";
-  loopEnd_Getter_(mthis) => loopEnd_Getter(mthis);
+  loopEnd_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "loopEnd");
 
-  static loopEnd_Setter(mthis, __arg_0) native "AudioBufferSourceNode_loopEnd_Setter";
-  loopEnd_Setter_(mthis, __arg_0) => loopEnd_Setter(mthis, __arg_0);
+  loopEnd_Setter_(mthis, __arg_0) => mthis["loopEnd"] = __arg_0;
 
-  static loopStart_Getter(mthis) native "AudioBufferSourceNode_loopStart_Getter";
-  loopStart_Getter_(mthis) => loopStart_Getter(mthis);
+  loopStart_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "loopStart");
 
-  static loopStart_Setter(mthis, __arg_0) native "AudioBufferSourceNode_loopStart_Setter";
-  loopStart_Setter_(mthis, __arg_0) => loopStart_Setter(mthis, __arg_0);
+  loopStart_Setter_(mthis, __arg_0) => mthis["loopStart"] = __arg_0;
 
-  static loop_Getter(mthis) native "AudioBufferSourceNode_loop_Getter";
-  loop_Getter_(mthis) => loop_Getter(mthis);
+  loop_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "loop");
 
-  static loop_Setter(mthis, __arg_0) native "AudioBufferSourceNode_loop_Setter";
-  loop_Setter_(mthis, __arg_0) => loop_Setter(mthis, __arg_0);
+  loop_Setter_(mthis, __arg_0) => mthis["loop"] = __arg_0;
 
-  static onended_Getter(mthis) native "AudioBufferSourceNode_onended_Getter";
-  onended_Getter_(mthis) => onended_Getter(mthis);
+  onended_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onended");
 
-  static onended_Setter(mthis, __arg_0) native "AudioBufferSourceNode_onended_Setter";
-  onended_Setter_(mthis, __arg_0) => onended_Setter(mthis, __arg_0);
+  onended_Setter_(mthis, __arg_0) => mthis["onended"] = __arg_0;
 
-  static playbackRate_Getter(mthis) native "AudioBufferSourceNode_playbackRate_Getter";
-  playbackRate_Getter_(mthis) => playbackRate_Getter(mthis);
+  playbackRate_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "playbackRate");
 
-  static start_Callback_0(mthis) native "AudioBufferSourceNode_start_Callback";
-  start_Callback_0_(mthis) => start_Callback_0(mthis);
+  start_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "start", []);
 
-  static start_Callback_1(mthis, __arg_0) native "AudioBufferSourceNode_start_Callback";
-  start_Callback_1_(mthis, __arg_0) => start_Callback_1(mthis, __arg_0);
+  start_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "start", [__arg_0]);
 
-  static start_Callback_2(mthis, __arg_0, __arg_1) native "AudioBufferSourceNode_start_Callback";
-  start_Callback_2_(mthis, __arg_0, __arg_1) => start_Callback_2(mthis, __arg_0, __arg_1);
+  start_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "start", [__arg_0, __arg_1]);
 
-  static start_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "AudioBufferSourceNode_start_Callback";
-  start_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => start_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  start_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "start", [__arg_0, __arg_1, __arg_2]);
 
-  static start_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "AudioBufferSourceNode_start_Callback";
-  start_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => start_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  stop_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "stop", []);
 
-  static start_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "AudioBufferSourceNode_start_Callback";
-  start_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => start_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
-
-  static stop_Callback_0(mthis) native "AudioBufferSourceNode_stop_Callback";
-  stop_Callback_0_(mthis) => stop_Callback_0(mthis);
-
-  static stop_Callback_1(mthis, __arg_0) native "AudioBufferSourceNode_stop_Callback";
-  stop_Callback_1_(mthis, __arg_0) => stop_Callback_1(mthis, __arg_0);
-
-  static stop_Callback_2(mthis, __arg_0, __arg_1) native "AudioBufferSourceNode_stop_Callback";
-  stop_Callback_2_(mthis, __arg_0, __arg_1) => stop_Callback_2(mthis, __arg_0, __arg_1);
-
-  static stop_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "AudioBufferSourceNode_stop_Callback";
-  stop_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => stop_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  stop_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "stop", [__arg_0]);
 
 }
 
 class BlinkAudioContext extends BlinkEventTarget {
   static final instance = new BlinkAudioContext();
 
-  static constructorCallback_0() native "AudioContext_constructorCallback";
-  constructorCallback_0_() => constructorCallback_0();
+  constructorCallback_0_() => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "AudioContext"), []);
 
-  static constructorCallback_1(__arg_0) native "AudioContext_constructorCallback";
-  constructorCallback_1_(__arg_0) => constructorCallback_1(__arg_0);
+  createAnalyser_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createAnalyser", []);
 
-  static constructorCallback_2(__arg_0, __arg_1) native "AudioContext_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  createBiquadFilter_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createBiquadFilter", []);
 
-  static createAnalyser_Callback_0(mthis) native "AudioContext_createAnalyser_Callback";
-  createAnalyser_Callback_0_(mthis) => createAnalyser_Callback_0(mthis);
+  createBufferSource_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createBufferSource", []);
 
-  static createAnalyser_Callback_1(mthis, __arg_0) native "AudioContext_createAnalyser_Callback";
-  createAnalyser_Callback_1_(mthis, __arg_0) => createAnalyser_Callback_1(mthis, __arg_0);
+  createBuffer_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "createBuffer", [__arg_0]);
 
-  static createAnalyser_Callback_2(mthis, __arg_0, __arg_1) native "AudioContext_createAnalyser_Callback";
-  createAnalyser_Callback_2_(mthis, __arg_0, __arg_1) => createAnalyser_Callback_2(mthis, __arg_0, __arg_1);
+  createBuffer_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "createBuffer", [__arg_0, __arg_1]);
 
-  static createBiquadFilter_Callback_0(mthis) native "AudioContext_createBiquadFilter_Callback";
-  createBiquadFilter_Callback_0_(mthis) => createBiquadFilter_Callback_0(mthis);
+  createBuffer_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "createBuffer", [__arg_0, __arg_1, __arg_2]);
 
-  static createBiquadFilter_Callback_1(mthis, __arg_0) native "AudioContext_createBiquadFilter_Callback";
-  createBiquadFilter_Callback_1_(mthis, __arg_0) => createBiquadFilter_Callback_1(mthis, __arg_0);
+  createChannelMerger_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createChannelMerger", []);
 
-  static createBiquadFilter_Callback_2(mthis, __arg_0, __arg_1) native "AudioContext_createBiquadFilter_Callback";
-  createBiquadFilter_Callback_2_(mthis, __arg_0, __arg_1) => createBiquadFilter_Callback_2(mthis, __arg_0, __arg_1);
+  createChannelMerger_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "createChannelMerger", [__arg_0]);
 
-  static createBufferSource_Callback_0(mthis) native "AudioContext_createBufferSource_Callback";
-  createBufferSource_Callback_0_(mthis) => createBufferSource_Callback_0(mthis);
+  createChannelSplitter_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createChannelSplitter", []);
 
-  static createBufferSource_Callback_1(mthis, __arg_0) native "AudioContext_createBufferSource_Callback";
-  createBufferSource_Callback_1_(mthis, __arg_0) => createBufferSource_Callback_1(mthis, __arg_0);
+  createChannelSplitter_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "createChannelSplitter", [__arg_0]);
 
-  static createBufferSource_Callback_2(mthis, __arg_0, __arg_1) native "AudioContext_createBufferSource_Callback";
-  createBufferSource_Callback_2_(mthis, __arg_0, __arg_1) => createBufferSource_Callback_2(mthis, __arg_0, __arg_1);
+  createConvolver_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createConvolver", []);
 
-  static createBuffer_Callback_1(mthis, __arg_0) native "AudioContext_createBuffer_Callback";
-  createBuffer_Callback_1_(mthis, __arg_0) => createBuffer_Callback_1(mthis, __arg_0);
+  createDelay_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createDelay", []);
 
-  static createBuffer_Callback_2(mthis, __arg_0, __arg_1) native "AudioContext_createBuffer_Callback";
-  createBuffer_Callback_2_(mthis, __arg_0, __arg_1) => createBuffer_Callback_2(mthis, __arg_0, __arg_1);
+  createDelay_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "createDelay", [__arg_0]);
 
-  static createBuffer_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "AudioContext_createBuffer_Callback";
-  createBuffer_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => createBuffer_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  createDynamicsCompressor_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createDynamicsCompressor", []);
 
-  static createBuffer_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "AudioContext_createBuffer_Callback";
-  createBuffer_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => createBuffer_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  createGain_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createGain", []);
 
-  static createBuffer_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "AudioContext_createBuffer_Callback";
-  createBuffer_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => createBuffer_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  createMediaElementSource_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createMediaElementSource", []);
 
-  static createChannelMerger_Callback_0(mthis) native "AudioContext_createChannelMerger_Callback";
-  createChannelMerger_Callback_0_(mthis) => createChannelMerger_Callback_0(mthis);
+  createMediaElementSource_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "createMediaElementSource", [__arg_0]);
 
-  static createChannelMerger_Callback_1(mthis, __arg_0) native "AudioContext_createChannelMerger_Callback";
-  createChannelMerger_Callback_1_(mthis, __arg_0) => createChannelMerger_Callback_1(mthis, __arg_0);
+  createMediaStreamDestination_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createMediaStreamDestination", []);
 
-  static createChannelMerger_Callback_2(mthis, __arg_0, __arg_1) native "AudioContext_createChannelMerger_Callback";
-  createChannelMerger_Callback_2_(mthis, __arg_0, __arg_1) => createChannelMerger_Callback_2(mthis, __arg_0, __arg_1);
+  createMediaStreamSource_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createMediaStreamSource", []);
 
-  static createChannelMerger_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "AudioContext_createChannelMerger_Callback";
-  createChannelMerger_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => createChannelMerger_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  createMediaStreamSource_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "createMediaStreamSource", [__arg_0]);
 
-  static createChannelSplitter_Callback_0(mthis) native "AudioContext_createChannelSplitter_Callback";
-  createChannelSplitter_Callback_0_(mthis) => createChannelSplitter_Callback_0(mthis);
+  createOscillator_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createOscillator", []);
 
-  static createChannelSplitter_Callback_1(mthis, __arg_0) native "AudioContext_createChannelSplitter_Callback";
-  createChannelSplitter_Callback_1_(mthis, __arg_0) => createChannelSplitter_Callback_1(mthis, __arg_0);
+  createPanner_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createPanner", []);
 
-  static createChannelSplitter_Callback_2(mthis, __arg_0, __arg_1) native "AudioContext_createChannelSplitter_Callback";
-  createChannelSplitter_Callback_2_(mthis, __arg_0, __arg_1) => createChannelSplitter_Callback_2(mthis, __arg_0, __arg_1);
+  createPeriodicWave_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createPeriodicWave", []);
 
-  static createChannelSplitter_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "AudioContext_createChannelSplitter_Callback";
-  createChannelSplitter_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => createChannelSplitter_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  createPeriodicWave_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "createPeriodicWave", [__arg_0]);
 
-  static createConvolver_Callback_0(mthis) native "AudioContext_createConvolver_Callback";
-  createConvolver_Callback_0_(mthis) => createConvolver_Callback_0(mthis);
+  createPeriodicWave_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "createPeriodicWave", [__arg_0, __arg_1]);
 
-  static createConvolver_Callback_1(mthis, __arg_0) native "AudioContext_createConvolver_Callback";
-  createConvolver_Callback_1_(mthis, __arg_0) => createConvolver_Callback_1(mthis, __arg_0);
+  createScriptProcessor_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createScriptProcessor", []);
 
-  static createConvolver_Callback_2(mthis, __arg_0, __arg_1) native "AudioContext_createConvolver_Callback";
-  createConvolver_Callback_2_(mthis, __arg_0, __arg_1) => createConvolver_Callback_2(mthis, __arg_0, __arg_1);
+  createScriptProcessor_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "createScriptProcessor", [__arg_0]);
 
-  static createDelay_Callback_0(mthis) native "AudioContext_createDelay_Callback";
-  createDelay_Callback_0_(mthis) => createDelay_Callback_0(mthis);
+  createScriptProcessor_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "createScriptProcessor", [__arg_0, __arg_1]);
 
-  static createDelay_Callback_1(mthis, __arg_0) native "AudioContext_createDelay_Callback";
-  createDelay_Callback_1_(mthis, __arg_0) => createDelay_Callback_1(mthis, __arg_0);
+  createScriptProcessor_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "createScriptProcessor", [__arg_0, __arg_1, __arg_2]);
 
-  static createDelay_Callback_2(mthis, __arg_0, __arg_1) native "AudioContext_createDelay_Callback";
-  createDelay_Callback_2_(mthis, __arg_0, __arg_1) => createDelay_Callback_2(mthis, __arg_0, __arg_1);
+  createWaveShaper_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createWaveShaper", []);
 
-  static createDelay_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "AudioContext_createDelay_Callback";
-  createDelay_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => createDelay_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  currentTime_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "currentTime");
 
-  static createDynamicsCompressor_Callback_0(mthis) native "AudioContext_createDynamicsCompressor_Callback";
-  createDynamicsCompressor_Callback_0_(mthis) => createDynamicsCompressor_Callback_0(mthis);
+  decodeAudioData_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "decodeAudioData", []);
 
-  static createDynamicsCompressor_Callback_1(mthis, __arg_0) native "AudioContext_createDynamicsCompressor_Callback";
-  createDynamicsCompressor_Callback_1_(mthis, __arg_0) => createDynamicsCompressor_Callback_1(mthis, __arg_0);
+  decodeAudioData_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "decodeAudioData", [__arg_0]);
 
-  static createDynamicsCompressor_Callback_2(mthis, __arg_0, __arg_1) native "AudioContext_createDynamicsCompressor_Callback";
-  createDynamicsCompressor_Callback_2_(mthis, __arg_0, __arg_1) => createDynamicsCompressor_Callback_2(mthis, __arg_0, __arg_1);
+  decodeAudioData_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "decodeAudioData", [__arg_0, __arg_1]);
 
-  static createGain_Callback_0(mthis) native "AudioContext_createGain_Callback";
-  createGain_Callback_0_(mthis) => createGain_Callback_0(mthis);
+  decodeAudioData_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "decodeAudioData", [__arg_0, __arg_1, __arg_2]);
 
-  static createGain_Callback_1(mthis, __arg_0) native "AudioContext_createGain_Callback";
-  createGain_Callback_1_(mthis, __arg_0) => createGain_Callback_1(mthis, __arg_0);
+  destination_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "destination");
 
-  static createGain_Callback_2(mthis, __arg_0, __arg_1) native "AudioContext_createGain_Callback";
-  createGain_Callback_2_(mthis, __arg_0, __arg_1) => createGain_Callback_2(mthis, __arg_0, __arg_1);
+  listener_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "listener");
 
-  static createMediaElementSource_Callback_0(mthis) native "AudioContext_createMediaElementSource_Callback";
-  createMediaElementSource_Callback_0_(mthis) => createMediaElementSource_Callback_0(mthis);
+  oncomplete_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "oncomplete");
 
-  static createMediaElementSource_Callback_1(mthis, __arg_0) native "AudioContext_createMediaElementSource_Callback";
-  createMediaElementSource_Callback_1_(mthis, __arg_0) => createMediaElementSource_Callback_1(mthis, __arg_0);
+  oncomplete_Setter_(mthis, __arg_0) => mthis["oncomplete"] = __arg_0;
 
-  static createMediaElementSource_Callback_2(mthis, __arg_0, __arg_1) native "AudioContext_createMediaElementSource_Callback";
-  createMediaElementSource_Callback_2_(mthis, __arg_0, __arg_1) => createMediaElementSource_Callback_2(mthis, __arg_0, __arg_1);
+  sampleRate_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "sampleRate");
 
-  static createMediaElementSource_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "AudioContext_createMediaElementSource_Callback";
-  createMediaElementSource_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => createMediaElementSource_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static createMediaStreamDestination_Callback_0(mthis) native "AudioContext_createMediaStreamDestination_Callback";
-  createMediaStreamDestination_Callback_0_(mthis) => createMediaStreamDestination_Callback_0(mthis);
-
-  static createMediaStreamDestination_Callback_1(mthis, __arg_0) native "AudioContext_createMediaStreamDestination_Callback";
-  createMediaStreamDestination_Callback_1_(mthis, __arg_0) => createMediaStreamDestination_Callback_1(mthis, __arg_0);
-
-  static createMediaStreamDestination_Callback_2(mthis, __arg_0, __arg_1) native "AudioContext_createMediaStreamDestination_Callback";
-  createMediaStreamDestination_Callback_2_(mthis, __arg_0, __arg_1) => createMediaStreamDestination_Callback_2(mthis, __arg_0, __arg_1);
-
-  static createMediaStreamSource_Callback_0(mthis) native "AudioContext_createMediaStreamSource_Callback";
-  createMediaStreamSource_Callback_0_(mthis) => createMediaStreamSource_Callback_0(mthis);
-
-  static createMediaStreamSource_Callback_1(mthis, __arg_0) native "AudioContext_createMediaStreamSource_Callback";
-  createMediaStreamSource_Callback_1_(mthis, __arg_0) => createMediaStreamSource_Callback_1(mthis, __arg_0);
-
-  static createMediaStreamSource_Callback_2(mthis, __arg_0, __arg_1) native "AudioContext_createMediaStreamSource_Callback";
-  createMediaStreamSource_Callback_2_(mthis, __arg_0, __arg_1) => createMediaStreamSource_Callback_2(mthis, __arg_0, __arg_1);
-
-  static createMediaStreamSource_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "AudioContext_createMediaStreamSource_Callback";
-  createMediaStreamSource_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => createMediaStreamSource_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static createOscillator_Callback_0(mthis) native "AudioContext_createOscillator_Callback";
-  createOscillator_Callback_0_(mthis) => createOscillator_Callback_0(mthis);
-
-  static createOscillator_Callback_1(mthis, __arg_0) native "AudioContext_createOscillator_Callback";
-  createOscillator_Callback_1_(mthis, __arg_0) => createOscillator_Callback_1(mthis, __arg_0);
-
-  static createOscillator_Callback_2(mthis, __arg_0, __arg_1) native "AudioContext_createOscillator_Callback";
-  createOscillator_Callback_2_(mthis, __arg_0, __arg_1) => createOscillator_Callback_2(mthis, __arg_0, __arg_1);
-
-  static createPanner_Callback_0(mthis) native "AudioContext_createPanner_Callback";
-  createPanner_Callback_0_(mthis) => createPanner_Callback_0(mthis);
-
-  static createPanner_Callback_1(mthis, __arg_0) native "AudioContext_createPanner_Callback";
-  createPanner_Callback_1_(mthis, __arg_0) => createPanner_Callback_1(mthis, __arg_0);
-
-  static createPanner_Callback_2(mthis, __arg_0, __arg_1) native "AudioContext_createPanner_Callback";
-  createPanner_Callback_2_(mthis, __arg_0, __arg_1) => createPanner_Callback_2(mthis, __arg_0, __arg_1);
-
-  static createPeriodicWave_Callback_0(mthis) native "AudioContext_createPeriodicWave_Callback";
-  createPeriodicWave_Callback_0_(mthis) => createPeriodicWave_Callback_0(mthis);
-
-  static createPeriodicWave_Callback_1(mthis, __arg_0) native "AudioContext_createPeriodicWave_Callback";
-  createPeriodicWave_Callback_1_(mthis, __arg_0) => createPeriodicWave_Callback_1(mthis, __arg_0);
-
-  static createPeriodicWave_Callback_2(mthis, __arg_0, __arg_1) native "AudioContext_createPeriodicWave_Callback";
-  createPeriodicWave_Callback_2_(mthis, __arg_0, __arg_1) => createPeriodicWave_Callback_2(mthis, __arg_0, __arg_1);
-
-  static createPeriodicWave_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "AudioContext_createPeriodicWave_Callback";
-  createPeriodicWave_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => createPeriodicWave_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static createPeriodicWave_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "AudioContext_createPeriodicWave_Callback";
-  createPeriodicWave_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => createPeriodicWave_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static createScriptProcessor_Callback_0(mthis) native "AudioContext_createScriptProcessor_Callback";
-  createScriptProcessor_Callback_0_(mthis) => createScriptProcessor_Callback_0(mthis);
-
-  static createScriptProcessor_Callback_1(mthis, __arg_0) native "AudioContext_createScriptProcessor_Callback";
-  createScriptProcessor_Callback_1_(mthis, __arg_0) => createScriptProcessor_Callback_1(mthis, __arg_0);
-
-  static createScriptProcessor_Callback_2(mthis, __arg_0, __arg_1) native "AudioContext_createScriptProcessor_Callback";
-  createScriptProcessor_Callback_2_(mthis, __arg_0, __arg_1) => createScriptProcessor_Callback_2(mthis, __arg_0, __arg_1);
-
-  static createScriptProcessor_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "AudioContext_createScriptProcessor_Callback";
-  createScriptProcessor_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => createScriptProcessor_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static createScriptProcessor_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "AudioContext_createScriptProcessor_Callback";
-  createScriptProcessor_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => createScriptProcessor_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static createScriptProcessor_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "AudioContext_createScriptProcessor_Callback";
-  createScriptProcessor_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => createScriptProcessor_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
-
-  static createWaveShaper_Callback_0(mthis) native "AudioContext_createWaveShaper_Callback";
-  createWaveShaper_Callback_0_(mthis) => createWaveShaper_Callback_0(mthis);
-
-  static createWaveShaper_Callback_1(mthis, __arg_0) native "AudioContext_createWaveShaper_Callback";
-  createWaveShaper_Callback_1_(mthis, __arg_0) => createWaveShaper_Callback_1(mthis, __arg_0);
-
-  static createWaveShaper_Callback_2(mthis, __arg_0, __arg_1) native "AudioContext_createWaveShaper_Callback";
-  createWaveShaper_Callback_2_(mthis, __arg_0, __arg_1) => createWaveShaper_Callback_2(mthis, __arg_0, __arg_1);
-
-  static currentTime_Getter(mthis) native "AudioContext_currentTime_Getter";
-  currentTime_Getter_(mthis) => currentTime_Getter(mthis);
-
-  static decodeAudioData_Callback_0(mthis) native "AudioContext_decodeAudioData_Callback";
-  decodeAudioData_Callback_0_(mthis) => decodeAudioData_Callback_0(mthis);
-
-  static decodeAudioData_Callback_1(mthis, __arg_0) native "AudioContext_decodeAudioData_Callback";
-  decodeAudioData_Callback_1_(mthis, __arg_0) => decodeAudioData_Callback_1(mthis, __arg_0);
-
-  static decodeAudioData_Callback_2(mthis, __arg_0, __arg_1) native "AudioContext_decodeAudioData_Callback";
-  decodeAudioData_Callback_2_(mthis, __arg_0, __arg_1) => decodeAudioData_Callback_2(mthis, __arg_0, __arg_1);
-
-  static decodeAudioData_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "AudioContext_decodeAudioData_Callback";
-  decodeAudioData_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => decodeAudioData_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static decodeAudioData_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "AudioContext_decodeAudioData_Callback";
-  decodeAudioData_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => decodeAudioData_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static decodeAudioData_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "AudioContext_decodeAudioData_Callback";
-  decodeAudioData_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => decodeAudioData_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
-
-  static destination_Getter(mthis) native "AudioContext_destination_Getter";
-  destination_Getter_(mthis) => destination_Getter(mthis);
-
-  static listener_Getter(mthis) native "AudioContext_listener_Getter";
-  listener_Getter_(mthis) => listener_Getter(mthis);
-
-  static oncomplete_Getter(mthis) native "AudioContext_oncomplete_Getter";
-  oncomplete_Getter_(mthis) => oncomplete_Getter(mthis);
-
-  static oncomplete_Setter(mthis, __arg_0) native "AudioContext_oncomplete_Setter";
-  oncomplete_Setter_(mthis, __arg_0) => oncomplete_Setter(mthis, __arg_0);
-
-  static sampleRate_Getter(mthis) native "AudioContext_sampleRate_Getter";
-  sampleRate_Getter_(mthis) => sampleRate_Getter(mthis);
-
-  static startRendering_Callback_0(mthis) native "AudioContext_startRendering_Callback";
-  startRendering_Callback_0_(mthis) => startRendering_Callback_0(mthis);
-
-  static startRendering_Callback_1(mthis, __arg_0) native "AudioContext_startRendering_Callback";
-  startRendering_Callback_1_(mthis, __arg_0) => startRendering_Callback_1(mthis, __arg_0);
-
-  static startRendering_Callback_2(mthis, __arg_0, __arg_1) native "AudioContext_startRendering_Callback";
-  startRendering_Callback_2_(mthis, __arg_0, __arg_1) => startRendering_Callback_2(mthis, __arg_0, __arg_1);
+  startRendering_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "startRendering", []);
 
 }
 
 class BlinkAudioDestinationNode extends BlinkAudioNode {
   static final instance = new BlinkAudioDestinationNode();
 
-  static maxChannelCount_Getter(mthis) native "AudioDestinationNode_maxChannelCount_Getter";
-  maxChannelCount_Getter_(mthis) => maxChannelCount_Getter(mthis);
+  maxChannelCount_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "maxChannelCount");
 
 }
 
 class BlinkAudioListener {
   static final instance = new BlinkAudioListener();
 
-  static dopplerFactor_Getter(mthis) native "AudioListener_dopplerFactor_Getter";
-  dopplerFactor_Getter_(mthis) => dopplerFactor_Getter(mthis);
+  dopplerFactor_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "dopplerFactor");
 
-  static dopplerFactor_Setter(mthis, __arg_0) native "AudioListener_dopplerFactor_Setter";
-  dopplerFactor_Setter_(mthis, __arg_0) => dopplerFactor_Setter(mthis, __arg_0);
+  dopplerFactor_Setter_(mthis, __arg_0) => mthis["dopplerFactor"] = __arg_0;
 
-  static setOrientation_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "AudioListener_setOrientation_Callback";
-  setOrientation_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => setOrientation_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  setOrientation_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "setOrientation", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static setOrientation_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "AudioListener_setOrientation_Callback";
-  setOrientation_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => setOrientation_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  setOrientation_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => Blink_JsNative_DomException.callMethod(mthis, "setOrientation", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4]);
 
-  static setOrientation_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "AudioListener_setOrientation_Callback";
-  setOrientation_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => setOrientation_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  setOrientation_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => Blink_JsNative_DomException.callMethod(mthis, "setOrientation", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5]);
 
-  static setOrientation_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) native "AudioListener_setOrientation_Callback";
-  setOrientation_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => setOrientation_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6);
+  setPosition_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "setPosition", [__arg_0]);
 
-  static setOrientation_Callback_8(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) native "AudioListener_setOrientation_Callback";
-  setOrientation_Callback_8_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) => setOrientation_Callback_8(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7);
+  setPosition_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "setPosition", [__arg_0, __arg_1]);
 
-  static setPosition_Callback_1(mthis, __arg_0) native "AudioListener_setPosition_Callback";
-  setPosition_Callback_1_(mthis, __arg_0) => setPosition_Callback_1(mthis, __arg_0);
+  setPosition_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "setPosition", [__arg_0, __arg_1, __arg_2]);
 
-  static setPosition_Callback_2(mthis, __arg_0, __arg_1) native "AudioListener_setPosition_Callback";
-  setPosition_Callback_2_(mthis, __arg_0, __arg_1) => setPosition_Callback_2(mthis, __arg_0, __arg_1);
+  setVelocity_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "setVelocity", [__arg_0]);
 
-  static setPosition_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "AudioListener_setPosition_Callback";
-  setPosition_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => setPosition_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  setVelocity_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "setVelocity", [__arg_0, __arg_1]);
 
-  static setPosition_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "AudioListener_setPosition_Callback";
-  setPosition_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => setPosition_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  setVelocity_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "setVelocity", [__arg_0, __arg_1, __arg_2]);
 
-  static setPosition_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "AudioListener_setPosition_Callback";
-  setPosition_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => setPosition_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  speedOfSound_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "speedOfSound");
 
-  static setVelocity_Callback_1(mthis, __arg_0) native "AudioListener_setVelocity_Callback";
-  setVelocity_Callback_1_(mthis, __arg_0) => setVelocity_Callback_1(mthis, __arg_0);
-
-  static setVelocity_Callback_2(mthis, __arg_0, __arg_1) native "AudioListener_setVelocity_Callback";
-  setVelocity_Callback_2_(mthis, __arg_0, __arg_1) => setVelocity_Callback_2(mthis, __arg_0, __arg_1);
-
-  static setVelocity_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "AudioListener_setVelocity_Callback";
-  setVelocity_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => setVelocity_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static setVelocity_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "AudioListener_setVelocity_Callback";
-  setVelocity_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => setVelocity_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static setVelocity_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "AudioListener_setVelocity_Callback";
-  setVelocity_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => setVelocity_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
-
-  static speedOfSound_Getter(mthis) native "AudioListener_speedOfSound_Getter";
-  speedOfSound_Getter_(mthis) => speedOfSound_Getter(mthis);
-
-  static speedOfSound_Setter(mthis, __arg_0) native "AudioListener_speedOfSound_Setter";
-  speedOfSound_Setter_(mthis, __arg_0) => speedOfSound_Setter(mthis, __arg_0);
+  speedOfSound_Setter_(mthis, __arg_0) => mthis["speedOfSound"] = __arg_0;
 
 }
 
 class BlinkAudioNode extends BlinkEventTarget {
   static final instance = new BlinkAudioNode();
 
-  static channelCountMode_Getter(mthis) native "AudioNode_channelCountMode_Getter";
-  channelCountMode_Getter_(mthis) => channelCountMode_Getter(mthis);
+  channelCountMode_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "channelCountMode");
 
-  static channelCountMode_Setter(mthis, __arg_0) native "AudioNode_channelCountMode_Setter";
-  channelCountMode_Setter_(mthis, __arg_0) => channelCountMode_Setter(mthis, __arg_0);
+  channelCountMode_Setter_(mthis, __arg_0) => mthis["channelCountMode"] = __arg_0;
 
-  static channelCount_Getter(mthis) native "AudioNode_channelCount_Getter";
-  channelCount_Getter_(mthis) => channelCount_Getter(mthis);
+  channelCount_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "channelCount");
 
-  static channelCount_Setter(mthis, __arg_0) native "AudioNode_channelCount_Setter";
-  channelCount_Setter_(mthis, __arg_0) => channelCount_Setter(mthis, __arg_0);
+  channelCount_Setter_(mthis, __arg_0) => mthis["channelCount"] = __arg_0;
 
-  static channelInterpretation_Getter(mthis) native "AudioNode_channelInterpretation_Getter";
-  channelInterpretation_Getter_(mthis) => channelInterpretation_Getter(mthis);
+  channelInterpretation_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "channelInterpretation");
 
-  static channelInterpretation_Setter(mthis, __arg_0) native "AudioNode_channelInterpretation_Setter";
-  channelInterpretation_Setter_(mthis, __arg_0) => channelInterpretation_Setter(mthis, __arg_0);
+  channelInterpretation_Setter_(mthis, __arg_0) => mthis["channelInterpretation"] = __arg_0;
 
-  static connect_Callback_0(mthis) native "AudioNode_connect_Callback";
-  connect_Callback_0_(mthis) => connect_Callback_0(mthis);
+  connect_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "connect", []);
 
-  static connect_Callback_1(mthis, __arg_0) native "AudioNode_connect_Callback";
-  connect_Callback_1_(mthis, __arg_0) => connect_Callback_1(mthis, __arg_0);
+  connect_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "connect", [__arg_0]);
 
-  static connect_Callback_2(mthis, __arg_0, __arg_1) native "AudioNode_connect_Callback";
-  connect_Callback_2_(mthis, __arg_0, __arg_1) => connect_Callback_2(mthis, __arg_0, __arg_1);
+  connect_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "connect", [__arg_0, __arg_1]);
 
-  static connect_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "AudioNode_connect_Callback";
-  connect_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => connect_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  connect_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "connect", [__arg_0, __arg_1, __arg_2]);
 
-  static connect_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "AudioNode_connect_Callback";
-  connect_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => connect_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  context_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "context");
 
-  static connect_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "AudioNode_connect_Callback";
-  connect_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => connect_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  disconnect_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "disconnect", []);
 
-  static context_Getter(mthis) native "AudioNode_context_Getter";
-  context_Getter_(mthis) => context_Getter(mthis);
+  disconnect_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "disconnect", [__arg_0]);
 
-  static disconnect_Callback_0(mthis) native "AudioNode_disconnect_Callback";
-  disconnect_Callback_0_(mthis) => disconnect_Callback_0(mthis);
+  numberOfInputs_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "numberOfInputs");
 
-  static disconnect_Callback_1(mthis, __arg_0) native "AudioNode_disconnect_Callback";
-  disconnect_Callback_1_(mthis, __arg_0) => disconnect_Callback_1(mthis, __arg_0);
-
-  static disconnect_Callback_2(mthis, __arg_0, __arg_1) native "AudioNode_disconnect_Callback";
-  disconnect_Callback_2_(mthis, __arg_0, __arg_1) => disconnect_Callback_2(mthis, __arg_0, __arg_1);
-
-  static disconnect_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "AudioNode_disconnect_Callback";
-  disconnect_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => disconnect_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static numberOfInputs_Getter(mthis) native "AudioNode_numberOfInputs_Getter";
-  numberOfInputs_Getter_(mthis) => numberOfInputs_Getter(mthis);
-
-  static numberOfOutputs_Getter(mthis) native "AudioNode_numberOfOutputs_Getter";
-  numberOfOutputs_Getter_(mthis) => numberOfOutputs_Getter(mthis);
+  numberOfOutputs_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "numberOfOutputs");
 
 }
 
 class BlinkAudioParam {
   static final instance = new BlinkAudioParam();
 
-  static cancelScheduledValues_Callback_0(mthis) native "AudioParam_cancelScheduledValues_Callback";
-  cancelScheduledValues_Callback_0_(mthis) => cancelScheduledValues_Callback_0(mthis);
+  cancelScheduledValues_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "cancelScheduledValues", []);
 
-  static cancelScheduledValues_Callback_1(mthis, __arg_0) native "AudioParam_cancelScheduledValues_Callback";
-  cancelScheduledValues_Callback_1_(mthis, __arg_0) => cancelScheduledValues_Callback_1(mthis, __arg_0);
+  cancelScheduledValues_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "cancelScheduledValues", [__arg_0]);
 
-  static cancelScheduledValues_Callback_2(mthis, __arg_0, __arg_1) native "AudioParam_cancelScheduledValues_Callback";
-  cancelScheduledValues_Callback_2_(mthis, __arg_0, __arg_1) => cancelScheduledValues_Callback_2(mthis, __arg_0, __arg_1);
+  defaultValue_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "defaultValue");
 
-  static cancelScheduledValues_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "AudioParam_cancelScheduledValues_Callback";
-  cancelScheduledValues_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => cancelScheduledValues_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  exponentialRampToValueAtTime_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "exponentialRampToValueAtTime", []);
 
-  static defaultValue_Getter(mthis) native "AudioParam_defaultValue_Getter";
-  defaultValue_Getter_(mthis) => defaultValue_Getter(mthis);
+  exponentialRampToValueAtTime_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "exponentialRampToValueAtTime", [__arg_0]);
 
-  static exponentialRampToValueAtTime_Callback_0(mthis) native "AudioParam_exponentialRampToValueAtTime_Callback";
-  exponentialRampToValueAtTime_Callback_0_(mthis) => exponentialRampToValueAtTime_Callback_0(mthis);
+  exponentialRampToValueAtTime_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "exponentialRampToValueAtTime", [__arg_0, __arg_1]);
 
-  static exponentialRampToValueAtTime_Callback_1(mthis, __arg_0) native "AudioParam_exponentialRampToValueAtTime_Callback";
-  exponentialRampToValueAtTime_Callback_1_(mthis, __arg_0) => exponentialRampToValueAtTime_Callback_1(mthis, __arg_0);
+  linearRampToValueAtTime_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "linearRampToValueAtTime", []);
 
-  static exponentialRampToValueAtTime_Callback_2(mthis, __arg_0, __arg_1) native "AudioParam_exponentialRampToValueAtTime_Callback";
-  exponentialRampToValueAtTime_Callback_2_(mthis, __arg_0, __arg_1) => exponentialRampToValueAtTime_Callback_2(mthis, __arg_0, __arg_1);
+  linearRampToValueAtTime_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "linearRampToValueAtTime", [__arg_0]);
 
-  static exponentialRampToValueAtTime_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "AudioParam_exponentialRampToValueAtTime_Callback";
-  exponentialRampToValueAtTime_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => exponentialRampToValueAtTime_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  linearRampToValueAtTime_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "linearRampToValueAtTime", [__arg_0, __arg_1]);
 
-  static exponentialRampToValueAtTime_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "AudioParam_exponentialRampToValueAtTime_Callback";
-  exponentialRampToValueAtTime_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => exponentialRampToValueAtTime_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  setTargetAtTime_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "setTargetAtTime", [__arg_0]);
 
-  static linearRampToValueAtTime_Callback_0(mthis) native "AudioParam_linearRampToValueAtTime_Callback";
-  linearRampToValueAtTime_Callback_0_(mthis) => linearRampToValueAtTime_Callback_0(mthis);
+  setTargetAtTime_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "setTargetAtTime", [__arg_0, __arg_1]);
 
-  static linearRampToValueAtTime_Callback_1(mthis, __arg_0) native "AudioParam_linearRampToValueAtTime_Callback";
-  linearRampToValueAtTime_Callback_1_(mthis, __arg_0) => linearRampToValueAtTime_Callback_1(mthis, __arg_0);
+  setTargetAtTime_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "setTargetAtTime", [__arg_0, __arg_1, __arg_2]);
 
-  static linearRampToValueAtTime_Callback_2(mthis, __arg_0, __arg_1) native "AudioParam_linearRampToValueAtTime_Callback";
-  linearRampToValueAtTime_Callback_2_(mthis, __arg_0, __arg_1) => linearRampToValueAtTime_Callback_2(mthis, __arg_0, __arg_1);
+  setValueAtTime_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "setValueAtTime", []);
 
-  static linearRampToValueAtTime_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "AudioParam_linearRampToValueAtTime_Callback";
-  linearRampToValueAtTime_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => linearRampToValueAtTime_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  setValueAtTime_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "setValueAtTime", [__arg_0]);
 
-  static linearRampToValueAtTime_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "AudioParam_linearRampToValueAtTime_Callback";
-  linearRampToValueAtTime_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => linearRampToValueAtTime_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  setValueAtTime_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "setValueAtTime", [__arg_0, __arg_1]);
 
-  static setTargetAtTime_Callback_1(mthis, __arg_0) native "AudioParam_setTargetAtTime_Callback";
-  setTargetAtTime_Callback_1_(mthis, __arg_0) => setTargetAtTime_Callback_1(mthis, __arg_0);
+  setValueCurveAtTime_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "setValueCurveAtTime", [__arg_0]);
 
-  static setTargetAtTime_Callback_2(mthis, __arg_0, __arg_1) native "AudioParam_setTargetAtTime_Callback";
-  setTargetAtTime_Callback_2_(mthis, __arg_0, __arg_1) => setTargetAtTime_Callback_2(mthis, __arg_0, __arg_1);
+  setValueCurveAtTime_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "setValueCurveAtTime", [__arg_0, __arg_1]);
 
-  static setTargetAtTime_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "AudioParam_setTargetAtTime_Callback";
-  setTargetAtTime_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => setTargetAtTime_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  setValueCurveAtTime_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "setValueCurveAtTime", [__arg_0, __arg_1, __arg_2]);
 
-  static setTargetAtTime_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "AudioParam_setTargetAtTime_Callback";
-  setTargetAtTime_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => setTargetAtTime_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  value_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "value");
 
-  static setTargetAtTime_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "AudioParam_setTargetAtTime_Callback";
-  setTargetAtTime_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => setTargetAtTime_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
-
-  static setValueAtTime_Callback_0(mthis) native "AudioParam_setValueAtTime_Callback";
-  setValueAtTime_Callback_0_(mthis) => setValueAtTime_Callback_0(mthis);
-
-  static setValueAtTime_Callback_1(mthis, __arg_0) native "AudioParam_setValueAtTime_Callback";
-  setValueAtTime_Callback_1_(mthis, __arg_0) => setValueAtTime_Callback_1(mthis, __arg_0);
-
-  static setValueAtTime_Callback_2(mthis, __arg_0, __arg_1) native "AudioParam_setValueAtTime_Callback";
-  setValueAtTime_Callback_2_(mthis, __arg_0, __arg_1) => setValueAtTime_Callback_2(mthis, __arg_0, __arg_1);
-
-  static setValueAtTime_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "AudioParam_setValueAtTime_Callback";
-  setValueAtTime_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => setValueAtTime_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static setValueAtTime_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "AudioParam_setValueAtTime_Callback";
-  setValueAtTime_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => setValueAtTime_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static setValueCurveAtTime_Callback_1(mthis, __arg_0) native "AudioParam_setValueCurveAtTime_Callback";
-  setValueCurveAtTime_Callback_1_(mthis, __arg_0) => setValueCurveAtTime_Callback_1(mthis, __arg_0);
-
-  static setValueCurveAtTime_Callback_2(mthis, __arg_0, __arg_1) native "AudioParam_setValueCurveAtTime_Callback";
-  setValueCurveAtTime_Callback_2_(mthis, __arg_0, __arg_1) => setValueCurveAtTime_Callback_2(mthis, __arg_0, __arg_1);
-
-  static setValueCurveAtTime_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "AudioParam_setValueCurveAtTime_Callback";
-  setValueCurveAtTime_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => setValueCurveAtTime_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static setValueCurveAtTime_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "AudioParam_setValueCurveAtTime_Callback";
-  setValueCurveAtTime_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => setValueCurveAtTime_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static setValueCurveAtTime_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "AudioParam_setValueCurveAtTime_Callback";
-  setValueCurveAtTime_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => setValueCurveAtTime_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
-
-  static value_Getter(mthis) native "AudioParam_value_Getter";
-  value_Getter_(mthis) => value_Getter(mthis);
-
-  static value_Setter(mthis, __arg_0) native "AudioParam_value_Setter";
-  value_Setter_(mthis, __arg_0) => value_Setter(mthis, __arg_0);
+  value_Setter_(mthis, __arg_0) => mthis["value"] = __arg_0;
 
 }
 
 class BlinkAudioProcessingEvent extends BlinkEvent {
   static final instance = new BlinkAudioProcessingEvent();
 
-  static inputBuffer_Getter(mthis) native "AudioProcessingEvent_inputBuffer_Getter";
-  inputBuffer_Getter_(mthis) => inputBuffer_Getter(mthis);
+  inputBuffer_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "inputBuffer");
 
-  static outputBuffer_Getter(mthis) native "AudioProcessingEvent_outputBuffer_Getter";
-  outputBuffer_Getter_(mthis) => outputBuffer_Getter(mthis);
+  outputBuffer_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "outputBuffer");
 
-  static playbackTime_Getter(mthis) native "AudioProcessingEvent_playbackTime_Getter";
-  playbackTime_Getter_(mthis) => playbackTime_Getter(mthis);
+  playbackTime_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "playbackTime");
 
 }
 
@@ -1690,270 +1160,159 @@
 class BlinkAudioTrack {
   static final instance = new BlinkAudioTrack();
 
-  static enabled_Getter(mthis) native "AudioTrack_enabled_Getter";
-  enabled_Getter_(mthis) => enabled_Getter(mthis);
+  enabled_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "enabled");
 
-  static enabled_Setter(mthis, __arg_0) native "AudioTrack_enabled_Setter";
-  enabled_Setter_(mthis, __arg_0) => enabled_Setter(mthis, __arg_0);
+  enabled_Setter_(mthis, __arg_0) => mthis["enabled"] = __arg_0;
 
-  static id_Getter(mthis) native "AudioTrack_id_Getter";
-  id_Getter_(mthis) => id_Getter(mthis);
+  id_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "id");
 
-  static kind_Getter(mthis) native "AudioTrack_kind_Getter";
-  kind_Getter_(mthis) => kind_Getter(mthis);
+  kind_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "kind");
 
-  static label_Getter(mthis) native "AudioTrack_label_Getter";
-  label_Getter_(mthis) => label_Getter(mthis);
+  label_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "label");
 
-  static language_Getter(mthis) native "AudioTrack_language_Getter";
-  language_Getter_(mthis) => language_Getter(mthis);
+  language_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "language");
 
 }
 
 class BlinkAudioTrackList extends BlinkEventTarget {
   static final instance = new BlinkAudioTrackList();
 
-  static $__getter___Callback_1(mthis, __arg_0) native "AudioTrackList___getter___Callback";
-  $__getter___Callback_1_(mthis, __arg_0) => $__getter___Callback_1(mthis, __arg_0);
+  $__getter___Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "__getter__", [__arg_0]);
 
-  static getTrackById_Callback_0(mthis) native "AudioTrackList_getTrackById_Callback";
-  getTrackById_Callback_0_(mthis) => getTrackById_Callback_0(mthis);
+  getTrackById_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getTrackById", []);
 
-  static getTrackById_Callback_1(mthis, __arg_0) native "AudioTrackList_getTrackById_Callback";
-  getTrackById_Callback_1_(mthis, __arg_0) => getTrackById_Callback_1(mthis, __arg_0);
+  getTrackById_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getTrackById", [__arg_0]);
 
-  static getTrackById_Callback_2(mthis, __arg_0, __arg_1) native "AudioTrackList_getTrackById_Callback";
-  getTrackById_Callback_2_(mthis, __arg_0, __arg_1) => getTrackById_Callback_2(mthis, __arg_0, __arg_1);
+  length_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "length");
 
-  static getTrackById_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "AudioTrackList_getTrackById_Callback";
-  getTrackById_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getTrackById_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  onaddtrack_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onaddtrack");
 
-  static length_Getter(mthis) native "AudioTrackList_length_Getter";
-  length_Getter_(mthis) => length_Getter(mthis);
+  onaddtrack_Setter_(mthis, __arg_0) => mthis["onaddtrack"] = __arg_0;
 
-  static onaddtrack_Getter(mthis) native "AudioTrackList_onaddtrack_Getter";
-  onaddtrack_Getter_(mthis) => onaddtrack_Getter(mthis);
+  onchange_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onchange");
 
-  static onaddtrack_Setter(mthis, __arg_0) native "AudioTrackList_onaddtrack_Setter";
-  onaddtrack_Setter_(mthis, __arg_0) => onaddtrack_Setter(mthis, __arg_0);
+  onchange_Setter_(mthis, __arg_0) => mthis["onchange"] = __arg_0;
 
-  static onchange_Getter(mthis) native "AudioTrackList_onchange_Getter";
-  onchange_Getter_(mthis) => onchange_Getter(mthis);
+  onremovetrack_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onremovetrack");
 
-  static onchange_Setter(mthis, __arg_0) native "AudioTrackList_onchange_Setter";
-  onchange_Setter_(mthis, __arg_0) => onchange_Setter(mthis, __arg_0);
-
-  static onremovetrack_Getter(mthis) native "AudioTrackList_onremovetrack_Getter";
-  onremovetrack_Getter_(mthis) => onremovetrack_Getter(mthis);
-
-  static onremovetrack_Setter(mthis, __arg_0) native "AudioTrackList_onremovetrack_Setter";
-  onremovetrack_Setter_(mthis, __arg_0) => onremovetrack_Setter(mthis, __arg_0);
+  onremovetrack_Setter_(mthis, __arg_0) => mthis["onremovetrack"] = __arg_0;
 
 }
 
 class BlinkAutocompleteErrorEvent extends BlinkEvent {
   static final instance = new BlinkAutocompleteErrorEvent();
 
-  static constructorCallback_2(__arg_0, __arg_1) native "AutocompleteErrorEvent_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  constructorCallback_2_(__arg_0, __arg_1) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "AutocompleteErrorEvent"), [__arg_0, __arg_1]);
 
-  static reason_Getter(mthis) native "AutocompleteErrorEvent_reason_Getter";
-  reason_Getter_(mthis) => reason_Getter(mthis);
+  reason_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "reason");
 
 }
 
 class BlinkBarProp {
   static final instance = new BlinkBarProp();
 
-  static visible_Getter(mthis) native "BarProp_visible_Getter";
-  visible_Getter_(mthis) => visible_Getter(mthis);
+  visible_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "visible");
 
 }
 
 class BlinkBatteryManager extends BlinkEventTarget {
   static final instance = new BlinkBatteryManager();
 
-  static chargingTime_Getter(mthis) native "BatteryManager_chargingTime_Getter";
-  chargingTime_Getter_(mthis) => chargingTime_Getter(mthis);
+  chargingTime_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "chargingTime");
 
-  static charging_Getter(mthis) native "BatteryManager_charging_Getter";
-  charging_Getter_(mthis) => charging_Getter(mthis);
+  charging_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "charging");
 
-  static dischargingTime_Getter(mthis) native "BatteryManager_dischargingTime_Getter";
-  dischargingTime_Getter_(mthis) => dischargingTime_Getter(mthis);
+  dischargingTime_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "dischargingTime");
 
-  static level_Getter(mthis) native "BatteryManager_level_Getter";
-  level_Getter_(mthis) => level_Getter(mthis);
+  level_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "level");
 
-  static onchargingchange_Getter(mthis) native "BatteryManager_onchargingchange_Getter";
-  onchargingchange_Getter_(mthis) => onchargingchange_Getter(mthis);
+  onchargingchange_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onchargingchange");
 
-  static onchargingchange_Setter(mthis, __arg_0) native "BatteryManager_onchargingchange_Setter";
-  onchargingchange_Setter_(mthis, __arg_0) => onchargingchange_Setter(mthis, __arg_0);
+  onchargingchange_Setter_(mthis, __arg_0) => mthis["onchargingchange"] = __arg_0;
 
-  static onchargingtimechange_Getter(mthis) native "BatteryManager_onchargingtimechange_Getter";
-  onchargingtimechange_Getter_(mthis) => onchargingtimechange_Getter(mthis);
+  onchargingtimechange_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onchargingtimechange");
 
-  static onchargingtimechange_Setter(mthis, __arg_0) native "BatteryManager_onchargingtimechange_Setter";
-  onchargingtimechange_Setter_(mthis, __arg_0) => onchargingtimechange_Setter(mthis, __arg_0);
+  onchargingtimechange_Setter_(mthis, __arg_0) => mthis["onchargingtimechange"] = __arg_0;
 
-  static ondischargingtimechange_Getter(mthis) native "BatteryManager_ondischargingtimechange_Getter";
-  ondischargingtimechange_Getter_(mthis) => ondischargingtimechange_Getter(mthis);
+  ondischargingtimechange_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ondischargingtimechange");
 
-  static ondischargingtimechange_Setter(mthis, __arg_0) native "BatteryManager_ondischargingtimechange_Setter";
-  ondischargingtimechange_Setter_(mthis, __arg_0) => ondischargingtimechange_Setter(mthis, __arg_0);
+  ondischargingtimechange_Setter_(mthis, __arg_0) => mthis["ondischargingtimechange"] = __arg_0;
 
-  static onlevelchange_Getter(mthis) native "BatteryManager_onlevelchange_Getter";
-  onlevelchange_Getter_(mthis) => onlevelchange_Getter(mthis);
+  onlevelchange_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onlevelchange");
 
-  static onlevelchange_Setter(mthis, __arg_0) native "BatteryManager_onlevelchange_Setter";
-  onlevelchange_Setter_(mthis, __arg_0) => onlevelchange_Setter(mthis, __arg_0);
+  onlevelchange_Setter_(mthis, __arg_0) => mthis["onlevelchange"] = __arg_0;
 
 }
 
 class BlinkBeforeUnloadEvent extends BlinkEvent {
   static final instance = new BlinkBeforeUnloadEvent();
 
-  static returnValue_Getter(mthis) native "BeforeUnloadEvent_returnValue_Getter";
-  returnValue_Getter_(mthis) => returnValue_Getter(mthis);
+  returnValue_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "returnValue");
 
-  static returnValue_Setter(mthis, __arg_0) native "BeforeUnloadEvent_returnValue_Setter";
-  returnValue_Setter_(mthis, __arg_0) => returnValue_Setter(mthis, __arg_0);
+  returnValue_Setter_(mthis, __arg_0) => mthis["returnValue"] = __arg_0;
 
 }
 
 class BlinkBiquadFilterNode extends BlinkAudioNode {
   static final instance = new BlinkBiquadFilterNode();
 
-  static Q_Getter(mthis) native "BiquadFilterNode_Q_Getter";
-  Q_Getter_(mthis) => Q_Getter(mthis);
+  Q_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "Q");
 
-  static detune_Getter(mthis) native "BiquadFilterNode_detune_Getter";
-  detune_Getter_(mthis) => detune_Getter(mthis);
+  detune_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "detune");
 
-  static frequency_Getter(mthis) native "BiquadFilterNode_frequency_Getter";
-  frequency_Getter_(mthis) => frequency_Getter(mthis);
+  frequency_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "frequency");
 
-  static gain_Getter(mthis) native "BiquadFilterNode_gain_Getter";
-  gain_Getter_(mthis) => gain_Getter(mthis);
+  gain_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "gain");
 
-  static getFrequencyResponse_Callback_1(mthis, __arg_0) native "BiquadFilterNode_getFrequencyResponse_Callback";
-  getFrequencyResponse_Callback_1_(mthis, __arg_0) => getFrequencyResponse_Callback_1(mthis, __arg_0);
+  getFrequencyResponse_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getFrequencyResponse", [__arg_0]);
 
-  static getFrequencyResponse_Callback_2(mthis, __arg_0, __arg_1) native "BiquadFilterNode_getFrequencyResponse_Callback";
-  getFrequencyResponse_Callback_2_(mthis, __arg_0, __arg_1) => getFrequencyResponse_Callback_2(mthis, __arg_0, __arg_1);
+  getFrequencyResponse_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "getFrequencyResponse", [__arg_0, __arg_1]);
 
-  static getFrequencyResponse_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "BiquadFilterNode_getFrequencyResponse_Callback";
-  getFrequencyResponse_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getFrequencyResponse_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  getFrequencyResponse_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "getFrequencyResponse", [__arg_0, __arg_1, __arg_2]);
 
-  static getFrequencyResponse_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "BiquadFilterNode_getFrequencyResponse_Callback";
-  getFrequencyResponse_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => getFrequencyResponse_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  type_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "type");
 
-  static getFrequencyResponse_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "BiquadFilterNode_getFrequencyResponse_Callback";
-  getFrequencyResponse_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => getFrequencyResponse_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
-
-  static type_Getter(mthis) native "BiquadFilterNode_type_Getter";
-  type_Getter_(mthis) => type_Getter(mthis);
-
-  static type_Setter(mthis, __arg_0) native "BiquadFilterNode_type_Setter";
-  type_Setter_(mthis, __arg_0) => type_Setter(mthis, __arg_0);
+  type_Setter_(mthis, __arg_0) => mthis["type"] = __arg_0;
 
 }
 
 class BlinkBlob {
   static final instance = new BlinkBlob();
 
-  static close_Callback_0(mthis) native "Blob_close_Callback";
-  close_Callback_0_(mthis) => close_Callback_0(mthis);
+  close_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "close", []);
 
-  static close_Callback_1(mthis, __arg_0) native "Blob_close_Callback";
-  close_Callback_1_(mthis, __arg_0) => close_Callback_1(mthis, __arg_0);
+  constructorCallback_0_() => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "Blob"), []);
 
-  static close_Callback_2(mthis, __arg_0, __arg_1) native "Blob_close_Callback";
-  close_Callback_2_(mthis, __arg_0, __arg_1) => close_Callback_2(mthis, __arg_0, __arg_1);
+  constructorCallback_1_(__arg_0) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "Blob"), [__arg_0]);
 
-  static constructorCallback_0() native "Blob_constructorCallback";
-  constructorCallback_0_() => constructorCallback_0();
+  constructorCallback_2_(__arg_0, __arg_1) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "Blob"), [__arg_0, __arg_1]);
 
-  static constructorCallback_1(__arg_0) native "Blob_constructorCallback";
-  constructorCallback_1_(__arg_0) => constructorCallback_1(__arg_0);
+  size_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "size");
 
-  static constructorCallback_2(__arg_0, __arg_1) native "Blob_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  slice_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "slice", []);
 
-  static constructorCallback_3(__arg_0, __arg_1, __arg_2) native "Blob_constructorCallback";
-  constructorCallback_3_(__arg_0, __arg_1, __arg_2) => constructorCallback_3(__arg_0, __arg_1, __arg_2);
+  slice_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "slice", [__arg_0]);
 
-  static constructorCallback_4(__arg_0, __arg_1, __arg_2, __arg_3) native "Blob_constructorCallback";
-  constructorCallback_4_(__arg_0, __arg_1, __arg_2, __arg_3) => constructorCallback_4(__arg_0, __arg_1, __arg_2, __arg_3);
+  slice_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "slice", [__arg_0, __arg_1]);
 
-  static size_Getter(mthis) native "Blob_size_Getter";
-  size_Getter_(mthis) => size_Getter(mthis);
+  slice_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "slice", [__arg_0, __arg_1, __arg_2]);
 
-  static slice_Callback_0(mthis) native "Blob_slice_Callback";
-  slice_Callback_0_(mthis) => slice_Callback_0(mthis);
-
-  static slice_Callback_1(mthis, __arg_0) native "Blob_slice_Callback";
-  slice_Callback_1_(mthis, __arg_0) => slice_Callback_1(mthis, __arg_0);
-
-  static slice_Callback_2(mthis, __arg_0, __arg_1) native "Blob_slice_Callback";
-  slice_Callback_2_(mthis, __arg_0, __arg_1) => slice_Callback_2(mthis, __arg_0, __arg_1);
-
-  static slice_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Blob_slice_Callback";
-  slice_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => slice_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static slice_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Blob_slice_Callback";
-  slice_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => slice_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static slice_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "Blob_slice_Callback";
-  slice_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => slice_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
-
-  static type_Getter(mthis) native "Blob_type_Getter";
-  type_Getter_(mthis) => type_Getter(mthis);
+  type_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "type");
 
 }
 
 class BlinkBody {
   static final instance = new BlinkBody();
 
-  static arrayBuffer_Callback_0(mthis) native "Body_arrayBuffer_Callback";
-  arrayBuffer_Callback_0_(mthis) => arrayBuffer_Callback_0(mthis);
+  arrayBuffer_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "arrayBuffer", []);
 
-  static arrayBuffer_Callback_1(mthis, __arg_0) native "Body_arrayBuffer_Callback";
-  arrayBuffer_Callback_1_(mthis, __arg_0) => arrayBuffer_Callback_1(mthis, __arg_0);
+  blob_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "blob", []);
 
-  static arrayBuffer_Callback_2(mthis, __arg_0, __arg_1) native "Body_arrayBuffer_Callback";
-  arrayBuffer_Callback_2_(mthis, __arg_0, __arg_1) => arrayBuffer_Callback_2(mthis, __arg_0, __arg_1);
+  bodyUsed_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "bodyUsed");
 
-  static blob_Callback_0(mthis) native "Body_blob_Callback";
-  blob_Callback_0_(mthis) => blob_Callback_0(mthis);
+  json_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "json", []);
 
-  static blob_Callback_1(mthis, __arg_0) native "Body_blob_Callback";
-  blob_Callback_1_(mthis, __arg_0) => blob_Callback_1(mthis, __arg_0);
-
-  static blob_Callback_2(mthis, __arg_0, __arg_1) native "Body_blob_Callback";
-  blob_Callback_2_(mthis, __arg_0, __arg_1) => blob_Callback_2(mthis, __arg_0, __arg_1);
-
-  static bodyUsed_Getter(mthis) native "Body_bodyUsed_Getter";
-  bodyUsed_Getter_(mthis) => bodyUsed_Getter(mthis);
-
-  static json_Callback_0(mthis) native "Body_json_Callback";
-  json_Callback_0_(mthis) => json_Callback_0(mthis);
-
-  static json_Callback_1(mthis, __arg_0) native "Body_json_Callback";
-  json_Callback_1_(mthis, __arg_0) => json_Callback_1(mthis, __arg_0);
-
-  static json_Callback_2(mthis, __arg_0, __arg_1) native "Body_json_Callback";
-  json_Callback_2_(mthis, __arg_0, __arg_1) => json_Callback_2(mthis, __arg_0, __arg_1);
-
-  static text_Callback_0(mthis) native "Body_text_Callback";
-  text_Callback_0_(mthis) => text_Callback_0(mthis);
-
-  static text_Callback_1(mthis, __arg_0) native "Body_text_Callback";
-  text_Callback_1_(mthis, __arg_0) => text_Callback_1(mthis, __arg_0);
-
-  static text_Callback_2(mthis, __arg_0, __arg_1) native "Body_text_Callback";
-  text_Callback_2_(mthis, __arg_0, __arg_1) => text_Callback_2(mthis, __arg_0, __arg_1);
+  text_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "text", []);
 
 }
 
@@ -1965,516 +1324,269 @@
 class BlinkCSS {
   static final instance = new BlinkCSS();
 
-  static supports_Callback_0(mthis) native "CSS_supports_Callback";
-  supports_Callback_0_(mthis) => supports_Callback_0(mthis);
+  supports_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "supports", []);
 
-  static supports_Callback_1(mthis, __arg_0) native "CSS_supports_Callback";
-  supports_Callback_1_(mthis, __arg_0) => supports_Callback_1(mthis, __arg_0);
+  supports_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "supports", [__arg_0]);
 
-  static supports_Callback_2(mthis, __arg_0, __arg_1) native "CSS_supports_Callback";
-  supports_Callback_2_(mthis, __arg_0, __arg_1) => supports_Callback_2(mthis, __arg_0, __arg_1);
-
-  static supports_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "CSS_supports_Callback";
-  supports_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => supports_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static supports_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "CSS_supports_Callback";
-  supports_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => supports_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  supports_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "supports", [__arg_0, __arg_1]);
 
 }
 
 class BlinkCSSCharsetRule extends BlinkCSSRule {
   static final instance = new BlinkCSSCharsetRule();
 
-  static encoding_Getter(mthis) native "CSSCharsetRule_encoding_Getter";
-  encoding_Getter_(mthis) => encoding_Getter(mthis);
+  encoding_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "encoding");
 
-  static encoding_Setter(mthis, __arg_0) native "CSSCharsetRule_encoding_Setter";
-  encoding_Setter_(mthis, __arg_0) => encoding_Setter(mthis, __arg_0);
+  encoding_Setter_(mthis, __arg_0) => mthis["encoding"] = __arg_0;
 
 }
 
 class BlinkCSSFontFaceRule extends BlinkCSSRule {
   static final instance = new BlinkCSSFontFaceRule();
 
-  static style_Getter(mthis) native "CSSFontFaceRule_style_Getter";
-  style_Getter_(mthis) => style_Getter(mthis);
+  style_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "style");
 
 }
 
 class BlinkCSSImportRule extends BlinkCSSRule {
   static final instance = new BlinkCSSImportRule();
 
-  static href_Getter(mthis) native "CSSImportRule_href_Getter";
-  href_Getter_(mthis) => href_Getter(mthis);
+  href_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "href");
 
-  static media_Getter(mthis) native "CSSImportRule_media_Getter";
-  media_Getter_(mthis) => media_Getter(mthis);
+  media_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "media");
 
-  static styleSheet_Getter(mthis) native "CSSImportRule_styleSheet_Getter";
-  styleSheet_Getter_(mthis) => styleSheet_Getter(mthis);
+  styleSheet_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "styleSheet");
 
 }
 
 class BlinkCSSKeyframeRule extends BlinkCSSRule {
   static final instance = new BlinkCSSKeyframeRule();
 
-  static keyText_Getter(mthis) native "CSSKeyframeRule_keyText_Getter";
-  keyText_Getter_(mthis) => keyText_Getter(mthis);
+  keyText_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "keyText");
 
-  static keyText_Setter(mthis, __arg_0) native "CSSKeyframeRule_keyText_Setter";
-  keyText_Setter_(mthis, __arg_0) => keyText_Setter(mthis, __arg_0);
+  keyText_Setter_(mthis, __arg_0) => mthis["keyText"] = __arg_0;
 
-  static style_Getter(mthis) native "CSSKeyframeRule_style_Getter";
-  style_Getter_(mthis) => style_Getter(mthis);
+  style_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "style");
 
 }
 
 class BlinkCSSKeyframesRule extends BlinkCSSRule {
   static final instance = new BlinkCSSKeyframesRule();
 
-  static $__getter___Callback_1(mthis, __arg_0) native "CSSKeyframesRule___getter___Callback";
-  $__getter___Callback_1_(mthis, __arg_0) => $__getter___Callback_1(mthis, __arg_0);
+  $__getter___Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "__getter__", [__arg_0]);
 
-  static cssRules_Getter(mthis) native "CSSKeyframesRule_cssRules_Getter";
-  cssRules_Getter_(mthis) => cssRules_Getter(mthis);
+  cssRules_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "cssRules");
 
-  static deleteRule_Callback_0(mthis) native "CSSKeyframesRule_deleteRule_Callback";
-  deleteRule_Callback_0_(mthis) => deleteRule_Callback_0(mthis);
+  deleteRule_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "deleteRule", []);
 
-  static deleteRule_Callback_1(mthis, __arg_0) native "CSSKeyframesRule_deleteRule_Callback";
-  deleteRule_Callback_1_(mthis, __arg_0) => deleteRule_Callback_1(mthis, __arg_0);
+  deleteRule_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "deleteRule", [__arg_0]);
 
-  static deleteRule_Callback_2(mthis, __arg_0, __arg_1) native "CSSKeyframesRule_deleteRule_Callback";
-  deleteRule_Callback_2_(mthis, __arg_0, __arg_1) => deleteRule_Callback_2(mthis, __arg_0, __arg_1);
+  findRule_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "findRule", []);
 
-  static deleteRule_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "CSSKeyframesRule_deleteRule_Callback";
-  deleteRule_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => deleteRule_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  findRule_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "findRule", [__arg_0]);
 
-  static findRule_Callback_0(mthis) native "CSSKeyframesRule_findRule_Callback";
-  findRule_Callback_0_(mthis) => findRule_Callback_0(mthis);
+  insertRule_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "insertRule", []);
 
-  static findRule_Callback_1(mthis, __arg_0) native "CSSKeyframesRule_findRule_Callback";
-  findRule_Callback_1_(mthis, __arg_0) => findRule_Callback_1(mthis, __arg_0);
+  insertRule_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "insertRule", [__arg_0]);
 
-  static findRule_Callback_2(mthis, __arg_0, __arg_1) native "CSSKeyframesRule_findRule_Callback";
-  findRule_Callback_2_(mthis, __arg_0, __arg_1) => findRule_Callback_2(mthis, __arg_0, __arg_1);
+  name_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "name");
 
-  static findRule_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "CSSKeyframesRule_findRule_Callback";
-  findRule_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => findRule_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static insertRule_Callback_0(mthis) native "CSSKeyframesRule_insertRule_Callback";
-  insertRule_Callback_0_(mthis) => insertRule_Callback_0(mthis);
-
-  static insertRule_Callback_1(mthis, __arg_0) native "CSSKeyframesRule_insertRule_Callback";
-  insertRule_Callback_1_(mthis, __arg_0) => insertRule_Callback_1(mthis, __arg_0);
-
-  static insertRule_Callback_2(mthis, __arg_0, __arg_1) native "CSSKeyframesRule_insertRule_Callback";
-  insertRule_Callback_2_(mthis, __arg_0, __arg_1) => insertRule_Callback_2(mthis, __arg_0, __arg_1);
-
-  static insertRule_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "CSSKeyframesRule_insertRule_Callback";
-  insertRule_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => insertRule_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static name_Getter(mthis) native "CSSKeyframesRule_name_Getter";
-  name_Getter_(mthis) => name_Getter(mthis);
-
-  static name_Setter(mthis, __arg_0) native "CSSKeyframesRule_name_Setter";
-  name_Setter_(mthis, __arg_0) => name_Setter(mthis, __arg_0);
+  name_Setter_(mthis, __arg_0) => mthis["name"] = __arg_0;
 
 }
 
 class BlinkCSSMediaRule extends BlinkCSSRule {
   static final instance = new BlinkCSSMediaRule();
 
-  static cssRules_Getter(mthis) native "CSSMediaRule_cssRules_Getter";
-  cssRules_Getter_(mthis) => cssRules_Getter(mthis);
+  cssRules_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "cssRules");
 
-  static deleteRule_Callback_0(mthis) native "CSSMediaRule_deleteRule_Callback";
-  deleteRule_Callback_0_(mthis) => deleteRule_Callback_0(mthis);
+  deleteRule_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "deleteRule", []);
 
-  static deleteRule_Callback_1(mthis, __arg_0) native "CSSMediaRule_deleteRule_Callback";
-  deleteRule_Callback_1_(mthis, __arg_0) => deleteRule_Callback_1(mthis, __arg_0);
+  deleteRule_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "deleteRule", [__arg_0]);
 
-  static deleteRule_Callback_2(mthis, __arg_0, __arg_1) native "CSSMediaRule_deleteRule_Callback";
-  deleteRule_Callback_2_(mthis, __arg_0, __arg_1) => deleteRule_Callback_2(mthis, __arg_0, __arg_1);
+  insertRule_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "insertRule", []);
 
-  static deleteRule_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "CSSMediaRule_deleteRule_Callback";
-  deleteRule_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => deleteRule_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  insertRule_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "insertRule", [__arg_0]);
 
-  static insertRule_Callback_0(mthis) native "CSSMediaRule_insertRule_Callback";
-  insertRule_Callback_0_(mthis) => insertRule_Callback_0(mthis);
+  insertRule_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "insertRule", [__arg_0, __arg_1]);
 
-  static insertRule_Callback_1(mthis, __arg_0) native "CSSMediaRule_insertRule_Callback";
-  insertRule_Callback_1_(mthis, __arg_0) => insertRule_Callback_1(mthis, __arg_0);
-
-  static insertRule_Callback_2(mthis, __arg_0, __arg_1) native "CSSMediaRule_insertRule_Callback";
-  insertRule_Callback_2_(mthis, __arg_0, __arg_1) => insertRule_Callback_2(mthis, __arg_0, __arg_1);
-
-  static insertRule_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "CSSMediaRule_insertRule_Callback";
-  insertRule_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => insertRule_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static insertRule_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "CSSMediaRule_insertRule_Callback";
-  insertRule_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => insertRule_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static media_Getter(mthis) native "CSSMediaRule_media_Getter";
-  media_Getter_(mthis) => media_Getter(mthis);
+  media_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "media");
 
 }
 
 class BlinkCSSPageRule extends BlinkCSSRule {
   static final instance = new BlinkCSSPageRule();
 
-  static selectorText_Getter(mthis) native "CSSPageRule_selectorText_Getter";
-  selectorText_Getter_(mthis) => selectorText_Getter(mthis);
+  selectorText_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "selectorText");
 
-  static selectorText_Setter(mthis, __arg_0) native "CSSPageRule_selectorText_Setter";
-  selectorText_Setter_(mthis, __arg_0) => selectorText_Setter(mthis, __arg_0);
+  selectorText_Setter_(mthis, __arg_0) => mthis["selectorText"] = __arg_0;
 
-  static style_Getter(mthis) native "CSSPageRule_style_Getter";
-  style_Getter_(mthis) => style_Getter(mthis);
+  style_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "style");
 
 }
 
 class BlinkCSSPrimitiveValue extends BlinkCSSValue {
   static final instance = new BlinkCSSPrimitiveValue();
 
-  static getCounterValue_Callback_0(mthis) native "CSSPrimitiveValue_getCounterValue_Callback";
-  getCounterValue_Callback_0_(mthis) => getCounterValue_Callback_0(mthis);
+  getCounterValue_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getCounterValue", []);
 
-  static getCounterValue_Callback_1(mthis, __arg_0) native "CSSPrimitiveValue_getCounterValue_Callback";
-  getCounterValue_Callback_1_(mthis, __arg_0) => getCounterValue_Callback_1(mthis, __arg_0);
+  getFloatValue_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getFloatValue", []);
 
-  static getCounterValue_Callback_2(mthis, __arg_0, __arg_1) native "CSSPrimitiveValue_getCounterValue_Callback";
-  getCounterValue_Callback_2_(mthis, __arg_0, __arg_1) => getCounterValue_Callback_2(mthis, __arg_0, __arg_1);
+  getFloatValue_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getFloatValue", [__arg_0]);
 
-  static getFloatValue_Callback_0(mthis) native "CSSPrimitiveValue_getFloatValue_Callback";
-  getFloatValue_Callback_0_(mthis) => getFloatValue_Callback_0(mthis);
+  getRGBColorValue_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getRGBColorValue", []);
 
-  static getFloatValue_Callback_1(mthis, __arg_0) native "CSSPrimitiveValue_getFloatValue_Callback";
-  getFloatValue_Callback_1_(mthis, __arg_0) => getFloatValue_Callback_1(mthis, __arg_0);
+  getRectValue_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getRectValue", []);
 
-  static getFloatValue_Callback_2(mthis, __arg_0, __arg_1) native "CSSPrimitiveValue_getFloatValue_Callback";
-  getFloatValue_Callback_2_(mthis, __arg_0, __arg_1) => getFloatValue_Callback_2(mthis, __arg_0, __arg_1);
+  getStringValue_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getStringValue", []);
 
-  static getFloatValue_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "CSSPrimitiveValue_getFloatValue_Callback";
-  getFloatValue_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getFloatValue_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  primitiveType_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "primitiveType");
 
-  static getRGBColorValue_Callback_0(mthis) native "CSSPrimitiveValue_getRGBColorValue_Callback";
-  getRGBColorValue_Callback_0_(mthis) => getRGBColorValue_Callback_0(mthis);
+  setFloatValue_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "setFloatValue", []);
 
-  static getRGBColorValue_Callback_1(mthis, __arg_0) native "CSSPrimitiveValue_getRGBColorValue_Callback";
-  getRGBColorValue_Callback_1_(mthis, __arg_0) => getRGBColorValue_Callback_1(mthis, __arg_0);
+  setFloatValue_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "setFloatValue", [__arg_0]);
 
-  static getRGBColorValue_Callback_2(mthis, __arg_0, __arg_1) native "CSSPrimitiveValue_getRGBColorValue_Callback";
-  getRGBColorValue_Callback_2_(mthis, __arg_0, __arg_1) => getRGBColorValue_Callback_2(mthis, __arg_0, __arg_1);
+  setFloatValue_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "setFloatValue", [__arg_0, __arg_1]);
 
-  static getRectValue_Callback_0(mthis) native "CSSPrimitiveValue_getRectValue_Callback";
-  getRectValue_Callback_0_(mthis) => getRectValue_Callback_0(mthis);
+  setStringValue_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "setStringValue", []);
 
-  static getRectValue_Callback_1(mthis, __arg_0) native "CSSPrimitiveValue_getRectValue_Callback";
-  getRectValue_Callback_1_(mthis, __arg_0) => getRectValue_Callback_1(mthis, __arg_0);
+  setStringValue_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "setStringValue", [__arg_0]);
 
-  static getRectValue_Callback_2(mthis, __arg_0, __arg_1) native "CSSPrimitiveValue_getRectValue_Callback";
-  getRectValue_Callback_2_(mthis, __arg_0, __arg_1) => getRectValue_Callback_2(mthis, __arg_0, __arg_1);
-
-  static getStringValue_Callback_0(mthis) native "CSSPrimitiveValue_getStringValue_Callback";
-  getStringValue_Callback_0_(mthis) => getStringValue_Callback_0(mthis);
-
-  static getStringValue_Callback_1(mthis, __arg_0) native "CSSPrimitiveValue_getStringValue_Callback";
-  getStringValue_Callback_1_(mthis, __arg_0) => getStringValue_Callback_1(mthis, __arg_0);
-
-  static getStringValue_Callback_2(mthis, __arg_0, __arg_1) native "CSSPrimitiveValue_getStringValue_Callback";
-  getStringValue_Callback_2_(mthis, __arg_0, __arg_1) => getStringValue_Callback_2(mthis, __arg_0, __arg_1);
-
-  static primitiveType_Getter(mthis) native "CSSPrimitiveValue_primitiveType_Getter";
-  primitiveType_Getter_(mthis) => primitiveType_Getter(mthis);
-
-  static setFloatValue_Callback_0(mthis) native "CSSPrimitiveValue_setFloatValue_Callback";
-  setFloatValue_Callback_0_(mthis) => setFloatValue_Callback_0(mthis);
-
-  static setFloatValue_Callback_1(mthis, __arg_0) native "CSSPrimitiveValue_setFloatValue_Callback";
-  setFloatValue_Callback_1_(mthis, __arg_0) => setFloatValue_Callback_1(mthis, __arg_0);
-
-  static setFloatValue_Callback_2(mthis, __arg_0, __arg_1) native "CSSPrimitiveValue_setFloatValue_Callback";
-  setFloatValue_Callback_2_(mthis, __arg_0, __arg_1) => setFloatValue_Callback_2(mthis, __arg_0, __arg_1);
-
-  static setFloatValue_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "CSSPrimitiveValue_setFloatValue_Callback";
-  setFloatValue_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => setFloatValue_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static setFloatValue_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "CSSPrimitiveValue_setFloatValue_Callback";
-  setFloatValue_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => setFloatValue_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static setStringValue_Callback_0(mthis) native "CSSPrimitiveValue_setStringValue_Callback";
-  setStringValue_Callback_0_(mthis) => setStringValue_Callback_0(mthis);
-
-  static setStringValue_Callback_1(mthis, __arg_0) native "CSSPrimitiveValue_setStringValue_Callback";
-  setStringValue_Callback_1_(mthis, __arg_0) => setStringValue_Callback_1(mthis, __arg_0);
-
-  static setStringValue_Callback_2(mthis, __arg_0, __arg_1) native "CSSPrimitiveValue_setStringValue_Callback";
-  setStringValue_Callback_2_(mthis, __arg_0, __arg_1) => setStringValue_Callback_2(mthis, __arg_0, __arg_1);
-
-  static setStringValue_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "CSSPrimitiveValue_setStringValue_Callback";
-  setStringValue_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => setStringValue_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static setStringValue_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "CSSPrimitiveValue_setStringValue_Callback";
-  setStringValue_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => setStringValue_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  setStringValue_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "setStringValue", [__arg_0, __arg_1]);
 
 }
 
 class BlinkCSSRule {
   static final instance = new BlinkCSSRule();
 
-  static cssText_Getter(mthis) native "CSSRule_cssText_Getter";
-  cssText_Getter_(mthis) => cssText_Getter(mthis);
+  cssText_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "cssText");
 
-  static cssText_Setter(mthis, __arg_0) native "CSSRule_cssText_Setter";
-  cssText_Setter_(mthis, __arg_0) => cssText_Setter(mthis, __arg_0);
+  cssText_Setter_(mthis, __arg_0) => mthis["cssText"] = __arg_0;
 
-  static parentRule_Getter(mthis) native "CSSRule_parentRule_Getter";
-  parentRule_Getter_(mthis) => parentRule_Getter(mthis);
+  parentRule_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "parentRule");
 
-  static parentStyleSheet_Getter(mthis) native "CSSRule_parentStyleSheet_Getter";
-  parentStyleSheet_Getter_(mthis) => parentStyleSheet_Getter(mthis);
+  parentStyleSheet_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "parentStyleSheet");
 
-  static type_Getter(mthis) native "CSSRule_type_Getter";
-  type_Getter_(mthis) => type_Getter(mthis);
+  type_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "type");
 
 }
 
 class BlinkCSSRuleList {
   static final instance = new BlinkCSSRuleList();
 
-  static $__getter___Callback_1(mthis, __arg_0) native "CSSRuleList___getter___Callback";
-  $__getter___Callback_1_(mthis, __arg_0) => $__getter___Callback_1(mthis, __arg_0);
+  $__getter___Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "__getter__", [__arg_0]);
 
-  static item_Callback_0(mthis) native "CSSRuleList_item_Callback";
-  item_Callback_0_(mthis) => item_Callback_0(mthis);
+  item_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "item", []);
 
-  static item_Callback_1(mthis, __arg_0) native "CSSRuleList_item_Callback";
-  item_Callback_1_(mthis, __arg_0) => item_Callback_1(mthis, __arg_0);
+  item_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "item", [__arg_0]);
 
-  static item_Callback_2(mthis, __arg_0, __arg_1) native "CSSRuleList_item_Callback";
-  item_Callback_2_(mthis, __arg_0, __arg_1) => item_Callback_2(mthis, __arg_0, __arg_1);
-
-  static item_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "CSSRuleList_item_Callback";
-  item_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => item_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static length_Getter(mthis) native "CSSRuleList_length_Getter";
-  length_Getter_(mthis) => length_Getter(mthis);
+  length_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "length");
 
 }
 
 class BlinkCSSStyleDeclaration {
   static final instance = new BlinkCSSStyleDeclaration();
 
-  static $__getter___Callback_1(mthis, __arg_0) native "CSSStyleDeclaration___getter___Callback";
-  $__getter___Callback_1_(mthis, __arg_0) => $__getter___Callback_1(mthis, __arg_0);
+  $__getter___Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "__getter__", [__arg_0]);
 
-  static $__propertyQuery___Callback_1(mthis, __arg_0) native "CSSStyleDeclaration___propertyQuery___Callback";
-  $__propertyQuery___Callback_1_(mthis, __arg_0) => $__propertyQuery___Callback_1(mthis, __arg_0);
+  $__propertyQuery___Callback_1_(mthis, __arg_0) => mthis[__arg_0];
 
-  static $__setter___Callback_2(mthis, __arg_0, __arg_1) native "CSSStyleDeclaration___setter___Callback";
-  $__setter___Callback_2_(mthis, __arg_0, __arg_1) => $__setter___Callback_2(mthis, __arg_0, __arg_1);
+  $__setter___Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "__setter__", [__arg_0, __arg_1]);
 
-  static cssText_Getter(mthis) native "CSSStyleDeclaration_cssText_Getter";
-  cssText_Getter_(mthis) => cssText_Getter(mthis);
+  cssText_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "cssText");
 
-  static cssText_Setter(mthis, __arg_0) native "CSSStyleDeclaration_cssText_Setter";
-  cssText_Setter_(mthis, __arg_0) => cssText_Setter(mthis, __arg_0);
+  cssText_Setter_(mthis, __arg_0) => mthis["cssText"] = __arg_0;
 
-  static getPropertyPriority_Callback_0(mthis) native "CSSStyleDeclaration_getPropertyPriority_Callback";
-  getPropertyPriority_Callback_0_(mthis) => getPropertyPriority_Callback_0(mthis);
+  getPropertyPriority_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getPropertyPriority", []);
 
-  static getPropertyPriority_Callback_1(mthis, __arg_0) native "CSSStyleDeclaration_getPropertyPriority_Callback";
-  getPropertyPriority_Callback_1_(mthis, __arg_0) => getPropertyPriority_Callback_1(mthis, __arg_0);
+  getPropertyPriority_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getPropertyPriority", [__arg_0]);
 
-  static getPropertyPriority_Callback_2(mthis, __arg_0, __arg_1) native "CSSStyleDeclaration_getPropertyPriority_Callback";
-  getPropertyPriority_Callback_2_(mthis, __arg_0, __arg_1) => getPropertyPriority_Callback_2(mthis, __arg_0, __arg_1);
+  getPropertyValue_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getPropertyValue", []);
 
-  static getPropertyPriority_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "CSSStyleDeclaration_getPropertyPriority_Callback";
-  getPropertyPriority_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getPropertyPriority_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  getPropertyValue_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getPropertyValue", [__arg_0]);
 
-  static getPropertyValue_Callback_0(mthis) native "CSSStyleDeclaration_getPropertyValue_Callback";
-  getPropertyValue_Callback_0_(mthis) => getPropertyValue_Callback_0(mthis);
+  item_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "item", []);
 
-  static getPropertyValue_Callback_1(mthis, __arg_0) native "CSSStyleDeclaration_getPropertyValue_Callback";
-  getPropertyValue_Callback_1_(mthis, __arg_0) => getPropertyValue_Callback_1(mthis, __arg_0);
+  item_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "item", [__arg_0]);
 
-  static getPropertyValue_Callback_2(mthis, __arg_0, __arg_1) native "CSSStyleDeclaration_getPropertyValue_Callback";
-  getPropertyValue_Callback_2_(mthis, __arg_0, __arg_1) => getPropertyValue_Callback_2(mthis, __arg_0, __arg_1);
+  length_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "length");
 
-  static getPropertyValue_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "CSSStyleDeclaration_getPropertyValue_Callback";
-  getPropertyValue_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getPropertyValue_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  parentRule_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "parentRule");
 
-  static item_Callback_0(mthis) native "CSSStyleDeclaration_item_Callback";
-  item_Callback_0_(mthis) => item_Callback_0(mthis);
+  removeProperty_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "removeProperty", []);
 
-  static item_Callback_1(mthis, __arg_0) native "CSSStyleDeclaration_item_Callback";
-  item_Callback_1_(mthis, __arg_0) => item_Callback_1(mthis, __arg_0);
+  removeProperty_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "removeProperty", [__arg_0]);
 
-  static item_Callback_2(mthis, __arg_0, __arg_1) native "CSSStyleDeclaration_item_Callback";
-  item_Callback_2_(mthis, __arg_0, __arg_1) => item_Callback_2(mthis, __arg_0, __arg_1);
+  setProperty_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "setProperty", []);
 
-  static item_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "CSSStyleDeclaration_item_Callback";
-  item_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => item_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  setProperty_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "setProperty", [__arg_0]);
 
-  static length_Getter(mthis) native "CSSStyleDeclaration_length_Getter";
-  length_Getter_(mthis) => length_Getter(mthis);
+  setProperty_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "setProperty", [__arg_0, __arg_1]);
 
-  static parentRule_Getter(mthis) native "CSSStyleDeclaration_parentRule_Getter";
-  parentRule_Getter_(mthis) => parentRule_Getter(mthis);
-
-  static removeProperty_Callback_0(mthis) native "CSSStyleDeclaration_removeProperty_Callback";
-  removeProperty_Callback_0_(mthis) => removeProperty_Callback_0(mthis);
-
-  static removeProperty_Callback_1(mthis, __arg_0) native "CSSStyleDeclaration_removeProperty_Callback";
-  removeProperty_Callback_1_(mthis, __arg_0) => removeProperty_Callback_1(mthis, __arg_0);
-
-  static removeProperty_Callback_2(mthis, __arg_0, __arg_1) native "CSSStyleDeclaration_removeProperty_Callback";
-  removeProperty_Callback_2_(mthis, __arg_0, __arg_1) => removeProperty_Callback_2(mthis, __arg_0, __arg_1);
-
-  static removeProperty_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "CSSStyleDeclaration_removeProperty_Callback";
-  removeProperty_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => removeProperty_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static setProperty_Callback_0(mthis) native "CSSStyleDeclaration_setProperty_Callback";
-  setProperty_Callback_0_(mthis) => setProperty_Callback_0(mthis);
-
-  static setProperty_Callback_1(mthis, __arg_0) native "CSSStyleDeclaration_setProperty_Callback";
-  setProperty_Callback_1_(mthis, __arg_0) => setProperty_Callback_1(mthis, __arg_0);
-
-  static setProperty_Callback_2(mthis, __arg_0, __arg_1) native "CSSStyleDeclaration_setProperty_Callback";
-  setProperty_Callback_2_(mthis, __arg_0, __arg_1) => setProperty_Callback_2(mthis, __arg_0, __arg_1);
-
-  static setProperty_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "CSSStyleDeclaration_setProperty_Callback";
-  setProperty_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => setProperty_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static setProperty_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "CSSStyleDeclaration_setProperty_Callback";
-  setProperty_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => setProperty_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static setProperty_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "CSSStyleDeclaration_setProperty_Callback";
-  setProperty_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => setProperty_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  setProperty_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "setProperty", [__arg_0, __arg_1, __arg_2]);
 
 }
 
 class BlinkCSSStyleRule extends BlinkCSSRule {
   static final instance = new BlinkCSSStyleRule();
 
-  static selectorText_Getter(mthis) native "CSSStyleRule_selectorText_Getter";
-  selectorText_Getter_(mthis) => selectorText_Getter(mthis);
+  selectorText_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "selectorText");
 
-  static selectorText_Setter(mthis, __arg_0) native "CSSStyleRule_selectorText_Setter";
-  selectorText_Setter_(mthis, __arg_0) => selectorText_Setter(mthis, __arg_0);
+  selectorText_Setter_(mthis, __arg_0) => mthis["selectorText"] = __arg_0;
 
-  static style_Getter(mthis) native "CSSStyleRule_style_Getter";
-  style_Getter_(mthis) => style_Getter(mthis);
+  style_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "style");
 
 }
 
 class BlinkCSSStyleSheet extends BlinkStyleSheet {
   static final instance = new BlinkCSSStyleSheet();
 
-  static addRule_Callback_0(mthis) native "CSSStyleSheet_addRule_Callback";
-  addRule_Callback_0_(mthis) => addRule_Callback_0(mthis);
+  addRule_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "addRule", []);
 
-  static addRule_Callback_1(mthis, __arg_0) native "CSSStyleSheet_addRule_Callback";
-  addRule_Callback_1_(mthis, __arg_0) => addRule_Callback_1(mthis, __arg_0);
+  addRule_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "addRule", [__arg_0]);
 
-  static addRule_Callback_2(mthis, __arg_0, __arg_1) native "CSSStyleSheet_addRule_Callback";
-  addRule_Callback_2_(mthis, __arg_0, __arg_1) => addRule_Callback_2(mthis, __arg_0, __arg_1);
+  addRule_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "addRule", [__arg_0, __arg_1]);
 
-  static addRule_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "CSSStyleSheet_addRule_Callback";
-  addRule_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => addRule_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  addRule_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "addRule", [__arg_0, __arg_1, __arg_2]);
 
-  static addRule_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "CSSStyleSheet_addRule_Callback";
-  addRule_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => addRule_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  cssRules_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "cssRules");
 
-  static addRule_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "CSSStyleSheet_addRule_Callback";
-  addRule_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => addRule_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  deleteRule_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "deleteRule", []);
 
-  static cssRules_Getter(mthis) native "CSSStyleSheet_cssRules_Getter";
-  cssRules_Getter_(mthis) => cssRules_Getter(mthis);
+  deleteRule_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "deleteRule", [__arg_0]);
 
-  static deleteRule_Callback_0(mthis) native "CSSStyleSheet_deleteRule_Callback";
-  deleteRule_Callback_0_(mthis) => deleteRule_Callback_0(mthis);
+  insertRule_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "insertRule", []);
 
-  static deleteRule_Callback_1(mthis, __arg_0) native "CSSStyleSheet_deleteRule_Callback";
-  deleteRule_Callback_1_(mthis, __arg_0) => deleteRule_Callback_1(mthis, __arg_0);
+  insertRule_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "insertRule", [__arg_0]);
 
-  static deleteRule_Callback_2(mthis, __arg_0, __arg_1) native "CSSStyleSheet_deleteRule_Callback";
-  deleteRule_Callback_2_(mthis, __arg_0, __arg_1) => deleteRule_Callback_2(mthis, __arg_0, __arg_1);
+  insertRule_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "insertRule", [__arg_0, __arg_1]);
 
-  static deleteRule_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "CSSStyleSheet_deleteRule_Callback";
-  deleteRule_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => deleteRule_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  ownerRule_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ownerRule");
 
-  static insertRule_Callback_0(mthis) native "CSSStyleSheet_insertRule_Callback";
-  insertRule_Callback_0_(mthis) => insertRule_Callback_0(mthis);
+  removeRule_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "removeRule", []);
 
-  static insertRule_Callback_1(mthis, __arg_0) native "CSSStyleSheet_insertRule_Callback";
-  insertRule_Callback_1_(mthis, __arg_0) => insertRule_Callback_1(mthis, __arg_0);
+  removeRule_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "removeRule", [__arg_0]);
 
-  static insertRule_Callback_2(mthis, __arg_0, __arg_1) native "CSSStyleSheet_insertRule_Callback";
-  insertRule_Callback_2_(mthis, __arg_0, __arg_1) => insertRule_Callback_2(mthis, __arg_0, __arg_1);
-
-  static insertRule_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "CSSStyleSheet_insertRule_Callback";
-  insertRule_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => insertRule_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static insertRule_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "CSSStyleSheet_insertRule_Callback";
-  insertRule_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => insertRule_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static ownerRule_Getter(mthis) native "CSSStyleSheet_ownerRule_Getter";
-  ownerRule_Getter_(mthis) => ownerRule_Getter(mthis);
-
-  static removeRule_Callback_0(mthis) native "CSSStyleSheet_removeRule_Callback";
-  removeRule_Callback_0_(mthis) => removeRule_Callback_0(mthis);
-
-  static removeRule_Callback_1(mthis, __arg_0) native "CSSStyleSheet_removeRule_Callback";
-  removeRule_Callback_1_(mthis, __arg_0) => removeRule_Callback_1(mthis, __arg_0);
-
-  static removeRule_Callback_2(mthis, __arg_0, __arg_1) native "CSSStyleSheet_removeRule_Callback";
-  removeRule_Callback_2_(mthis, __arg_0, __arg_1) => removeRule_Callback_2(mthis, __arg_0, __arg_1);
-
-  static removeRule_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "CSSStyleSheet_removeRule_Callback";
-  removeRule_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => removeRule_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static rules_Getter(mthis) native "CSSStyleSheet_rules_Getter";
-  rules_Getter_(mthis) => rules_Getter(mthis);
+  rules_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "rules");
 
 }
 
 class BlinkCSSSupportsRule extends BlinkCSSRule {
   static final instance = new BlinkCSSSupportsRule();
 
-  static conditionText_Getter(mthis) native "CSSSupportsRule_conditionText_Getter";
-  conditionText_Getter_(mthis) => conditionText_Getter(mthis);
+  conditionText_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "conditionText");
 
-  static cssRules_Getter(mthis) native "CSSSupportsRule_cssRules_Getter";
-  cssRules_Getter_(mthis) => cssRules_Getter(mthis);
+  cssRules_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "cssRules");
 
-  static deleteRule_Callback_0(mthis) native "CSSSupportsRule_deleteRule_Callback";
-  deleteRule_Callback_0_(mthis) => deleteRule_Callback_0(mthis);
+  deleteRule_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "deleteRule", []);
 
-  static deleteRule_Callback_1(mthis, __arg_0) native "CSSSupportsRule_deleteRule_Callback";
-  deleteRule_Callback_1_(mthis, __arg_0) => deleteRule_Callback_1(mthis, __arg_0);
+  deleteRule_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "deleteRule", [__arg_0]);
 
-  static deleteRule_Callback_2(mthis, __arg_0, __arg_1) native "CSSSupportsRule_deleteRule_Callback";
-  deleteRule_Callback_2_(mthis, __arg_0, __arg_1) => deleteRule_Callback_2(mthis, __arg_0, __arg_1);
+  insertRule_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "insertRule", []);
 
-  static deleteRule_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "CSSSupportsRule_deleteRule_Callback";
-  deleteRule_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => deleteRule_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  insertRule_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "insertRule", [__arg_0]);
 
-  static insertRule_Callback_0(mthis) native "CSSSupportsRule_insertRule_Callback";
-  insertRule_Callback_0_(mthis) => insertRule_Callback_0(mthis);
-
-  static insertRule_Callback_1(mthis, __arg_0) native "CSSSupportsRule_insertRule_Callback";
-  insertRule_Callback_1_(mthis, __arg_0) => insertRule_Callback_1(mthis, __arg_0);
-
-  static insertRule_Callback_2(mthis, __arg_0, __arg_1) native "CSSSupportsRule_insertRule_Callback";
-  insertRule_Callback_2_(mthis, __arg_0, __arg_1) => insertRule_Callback_2(mthis, __arg_0, __arg_1);
-
-  static insertRule_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "CSSSupportsRule_insertRule_Callback";
-  insertRule_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => insertRule_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static insertRule_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "CSSSupportsRule_insertRule_Callback";
-  insertRule_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => insertRule_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  insertRule_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "insertRule", [__arg_0, __arg_1]);
 
 }
 
@@ -2486,1038 +1598,463 @@
 class BlinkCSSValue {
   static final instance = new BlinkCSSValue();
 
-  static cssText_Getter(mthis) native "CSSValue_cssText_Getter";
-  cssText_Getter_(mthis) => cssText_Getter(mthis);
+  cssText_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "cssText");
 
-  static cssText_Setter(mthis, __arg_0) native "CSSValue_cssText_Setter";
-  cssText_Setter_(mthis, __arg_0) => cssText_Setter(mthis, __arg_0);
+  cssText_Setter_(mthis, __arg_0) => mthis["cssText"] = __arg_0;
 
-  static cssValueType_Getter(mthis) native "CSSValue_cssValueType_Getter";
-  cssValueType_Getter_(mthis) => cssValueType_Getter(mthis);
+  cssValueType_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "cssValueType");
 
 }
 
 class BlinkCSSValueList extends BlinkCSSValue {
   static final instance = new BlinkCSSValueList();
 
-  static $__getter___Callback_1(mthis, __arg_0) native "CSSValueList___getter___Callback";
-  $__getter___Callback_1_(mthis, __arg_0) => $__getter___Callback_1(mthis, __arg_0);
+  $__getter___Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "__getter__", [__arg_0]);
 
-  static item_Callback_0(mthis) native "CSSValueList_item_Callback";
-  item_Callback_0_(mthis) => item_Callback_0(mthis);
+  item_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "item", []);
 
-  static item_Callback_1(mthis, __arg_0) native "CSSValueList_item_Callback";
-  item_Callback_1_(mthis, __arg_0) => item_Callback_1(mthis, __arg_0);
+  item_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "item", [__arg_0]);
 
-  static item_Callback_2(mthis, __arg_0, __arg_1) native "CSSValueList_item_Callback";
-  item_Callback_2_(mthis, __arg_0, __arg_1) => item_Callback_2(mthis, __arg_0, __arg_1);
-
-  static item_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "CSSValueList_item_Callback";
-  item_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => item_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static length_Getter(mthis) native "CSSValueList_length_Getter";
-  length_Getter_(mthis) => length_Getter(mthis);
+  length_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "length");
 
 }
 
 class BlinkCSSViewportRule extends BlinkCSSRule {
   static final instance = new BlinkCSSViewportRule();
 
-  static style_Getter(mthis) native "CSSViewportRule_style_Getter";
-  style_Getter_(mthis) => style_Getter(mthis);
+  style_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "style");
 
 }
 
 class BlinkCache {
   static final instance = new BlinkCache();
 
-  static addAll_Callback_0(mthis) native "Cache_addAll_Callback";
-  addAll_Callback_0_(mthis) => addAll_Callback_0(mthis);
+  addAll_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "addAll", []);
 
-  static addAll_Callback_1(mthis, __arg_0) native "Cache_addAll_Callback";
-  addAll_Callback_1_(mthis, __arg_0) => addAll_Callback_1(mthis, __arg_0);
+  addAll_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "addAll", [__arg_0]);
 
-  static addAll_Callback_2(mthis, __arg_0, __arg_1) native "Cache_addAll_Callback";
-  addAll_Callback_2_(mthis, __arg_0, __arg_1) => addAll_Callback_2(mthis, __arg_0, __arg_1);
+  add_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "add", []);
 
-  static addAll_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Cache_addAll_Callback";
-  addAll_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => addAll_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  add_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "add", [__arg_0]);
 
-  static add_Callback_0(mthis) native "Cache_add_Callback";
-  add_Callback_0_(mthis) => add_Callback_0(mthis);
+  delete_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "delete", []);
 
-  static add_Callback_1(mthis, __arg_0) native "Cache_add_Callback";
-  add_Callback_1_(mthis, __arg_0) => add_Callback_1(mthis, __arg_0);
+  delete_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "delete", [__arg_0]);
 
-  static add_Callback_2(mthis, __arg_0, __arg_1) native "Cache_add_Callback";
-  add_Callback_2_(mthis, __arg_0, __arg_1) => add_Callback_2(mthis, __arg_0, __arg_1);
+  delete_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "delete", [__arg_0, __arg_1]);
 
-  static add_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Cache_add_Callback";
-  add_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => add_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  keys_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "keys", []);
 
-  static delete_Callback_0(mthis) native "Cache_delete_Callback";
-  delete_Callback_0_(mthis) => delete_Callback_0(mthis);
+  keys_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "keys", [__arg_0]);
 
-  static delete_Callback_1(mthis, __arg_0) native "Cache_delete_Callback";
-  delete_Callback_1_(mthis, __arg_0) => delete_Callback_1(mthis, __arg_0);
+  keys_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "keys", [__arg_0, __arg_1]);
 
-  static delete_Callback_2(mthis, __arg_0, __arg_1) native "Cache_delete_Callback";
-  delete_Callback_2_(mthis, __arg_0, __arg_1) => delete_Callback_2(mthis, __arg_0, __arg_1);
+  matchAll_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "matchAll", []);
 
-  static delete_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Cache_delete_Callback";
-  delete_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => delete_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  matchAll_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "matchAll", [__arg_0]);
 
-  static delete_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Cache_delete_Callback";
-  delete_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => delete_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  matchAll_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "matchAll", [__arg_0, __arg_1]);
 
-  static keys_Callback_0(mthis) native "Cache_keys_Callback";
-  keys_Callback_0_(mthis) => keys_Callback_0(mthis);
+  match_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "match", []);
 
-  static keys_Callback_1(mthis, __arg_0) native "Cache_keys_Callback";
-  keys_Callback_1_(mthis, __arg_0) => keys_Callback_1(mthis, __arg_0);
+  match_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "match", [__arg_0]);
 
-  static keys_Callback_2(mthis, __arg_0, __arg_1) native "Cache_keys_Callback";
-  keys_Callback_2_(mthis, __arg_0, __arg_1) => keys_Callback_2(mthis, __arg_0, __arg_1);
+  match_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "match", [__arg_0, __arg_1]);
 
-  static keys_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Cache_keys_Callback";
-  keys_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => keys_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  put_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "put", []);
 
-  static keys_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Cache_keys_Callback";
-  keys_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => keys_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  put_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "put", [__arg_0]);
 
-  static matchAll_Callback_0(mthis) native "Cache_matchAll_Callback";
-  matchAll_Callback_0_(mthis) => matchAll_Callback_0(mthis);
-
-  static matchAll_Callback_1(mthis, __arg_0) native "Cache_matchAll_Callback";
-  matchAll_Callback_1_(mthis, __arg_0) => matchAll_Callback_1(mthis, __arg_0);
-
-  static matchAll_Callback_2(mthis, __arg_0, __arg_1) native "Cache_matchAll_Callback";
-  matchAll_Callback_2_(mthis, __arg_0, __arg_1) => matchAll_Callback_2(mthis, __arg_0, __arg_1);
-
-  static matchAll_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Cache_matchAll_Callback";
-  matchAll_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => matchAll_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static matchAll_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Cache_matchAll_Callback";
-  matchAll_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => matchAll_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static match_Callback_0(mthis) native "Cache_match_Callback";
-  match_Callback_0_(mthis) => match_Callback_0(mthis);
-
-  static match_Callback_1(mthis, __arg_0) native "Cache_match_Callback";
-  match_Callback_1_(mthis, __arg_0) => match_Callback_1(mthis, __arg_0);
-
-  static match_Callback_2(mthis, __arg_0, __arg_1) native "Cache_match_Callback";
-  match_Callback_2_(mthis, __arg_0, __arg_1) => match_Callback_2(mthis, __arg_0, __arg_1);
-
-  static match_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Cache_match_Callback";
-  match_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => match_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static match_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Cache_match_Callback";
-  match_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => match_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static put_Callback_0(mthis) native "Cache_put_Callback";
-  put_Callback_0_(mthis) => put_Callback_0(mthis);
-
-  static put_Callback_1(mthis, __arg_0) native "Cache_put_Callback";
-  put_Callback_1_(mthis, __arg_0) => put_Callback_1(mthis, __arg_0);
-
-  static put_Callback_2(mthis, __arg_0, __arg_1) native "Cache_put_Callback";
-  put_Callback_2_(mthis, __arg_0, __arg_1) => put_Callback_2(mthis, __arg_0, __arg_1);
-
-  static put_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Cache_put_Callback";
-  put_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => put_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static put_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Cache_put_Callback";
-  put_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => put_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  put_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "put", [__arg_0, __arg_1]);
 
 }
 
 class BlinkCacheStorage {
   static final instance = new BlinkCacheStorage();
 
-  static create_Callback_0(mthis) native "CacheStorage_create_Callback";
-  create_Callback_0_(mthis) => create_Callback_0(mthis);
+  create_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "create", []);
 
-  static create_Callback_1(mthis, __arg_0) native "CacheStorage_create_Callback";
-  create_Callback_1_(mthis, __arg_0) => create_Callback_1(mthis, __arg_0);
+  create_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "create", [__arg_0]);
 
-  static create_Callback_2(mthis, __arg_0, __arg_1) native "CacheStorage_create_Callback";
-  create_Callback_2_(mthis, __arg_0, __arg_1) => create_Callback_2(mthis, __arg_0, __arg_1);
+  delete_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "delete", []);
 
-  static create_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "CacheStorage_create_Callback";
-  create_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => create_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  delete_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "delete", [__arg_0]);
 
-  static delete_Callback_0(mthis) native "CacheStorage_delete_Callback";
-  delete_Callback_0_(mthis) => delete_Callback_0(mthis);
+  get_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "get", []);
 
-  static delete_Callback_1(mthis, __arg_0) native "CacheStorage_delete_Callback";
-  delete_Callback_1_(mthis, __arg_0) => delete_Callback_1(mthis, __arg_0);
+  get_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "get", [__arg_0]);
 
-  static delete_Callback_2(mthis, __arg_0, __arg_1) native "CacheStorage_delete_Callback";
-  delete_Callback_2_(mthis, __arg_0, __arg_1) => delete_Callback_2(mthis, __arg_0, __arg_1);
+  has_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "has", []);
 
-  static delete_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "CacheStorage_delete_Callback";
-  delete_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => delete_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  has_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "has", [__arg_0]);
 
-  static get_Callback_0(mthis) native "CacheStorage_get_Callback";
-  get_Callback_0_(mthis) => get_Callback_0(mthis);
-
-  static get_Callback_1(mthis, __arg_0) native "CacheStorage_get_Callback";
-  get_Callback_1_(mthis, __arg_0) => get_Callback_1(mthis, __arg_0);
-
-  static get_Callback_2(mthis, __arg_0, __arg_1) native "CacheStorage_get_Callback";
-  get_Callback_2_(mthis, __arg_0, __arg_1) => get_Callback_2(mthis, __arg_0, __arg_1);
-
-  static get_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "CacheStorage_get_Callback";
-  get_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => get_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static has_Callback_0(mthis) native "CacheStorage_has_Callback";
-  has_Callback_0_(mthis) => has_Callback_0(mthis);
-
-  static has_Callback_1(mthis, __arg_0) native "CacheStorage_has_Callback";
-  has_Callback_1_(mthis, __arg_0) => has_Callback_1(mthis, __arg_0);
-
-  static has_Callback_2(mthis, __arg_0, __arg_1) native "CacheStorage_has_Callback";
-  has_Callback_2_(mthis, __arg_0, __arg_1) => has_Callback_2(mthis, __arg_0, __arg_1);
-
-  static has_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "CacheStorage_has_Callback";
-  has_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => has_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static keys_Callback_0(mthis) native "CacheStorage_keys_Callback";
-  keys_Callback_0_(mthis) => keys_Callback_0(mthis);
-
-  static keys_Callback_1(mthis, __arg_0) native "CacheStorage_keys_Callback";
-  keys_Callback_1_(mthis, __arg_0) => keys_Callback_1(mthis, __arg_0);
-
-  static keys_Callback_2(mthis, __arg_0, __arg_1) native "CacheStorage_keys_Callback";
-  keys_Callback_2_(mthis, __arg_0, __arg_1) => keys_Callback_2(mthis, __arg_0, __arg_1);
+  keys_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "keys", []);
 
 }
 
 class BlinkCanvas2DContextAttributes {
   static final instance = new BlinkCanvas2DContextAttributes();
 
-  static alpha_Getter(mthis) native "Canvas2DContextAttributes_alpha_Getter";
-  alpha_Getter_(mthis) => alpha_Getter(mthis);
+  alpha_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "alpha");
 
-  static alpha_Setter(mthis, __arg_0) native "Canvas2DContextAttributes_alpha_Setter";
-  alpha_Setter_(mthis, __arg_0) => alpha_Setter(mthis, __arg_0);
+  alpha_Setter_(mthis, __arg_0) => mthis["alpha"] = __arg_0;
 
-  static storage_Getter(mthis) native "Canvas2DContextAttributes_storage_Getter";
-  storage_Getter_(mthis) => storage_Getter(mthis);
+  storage_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "storage");
 
-  static storage_Setter(mthis, __arg_0) native "Canvas2DContextAttributes_storage_Setter";
-  storage_Setter_(mthis, __arg_0) => storage_Setter(mthis, __arg_0);
+  storage_Setter_(mthis, __arg_0) => mthis["storage"] = __arg_0;
 
 }
 
 class BlinkCanvasGradient {
   static final instance = new BlinkCanvasGradient();
 
-  static addColorStop_Callback_0(mthis) native "CanvasGradient_addColorStop_Callback";
-  addColorStop_Callback_0_(mthis) => addColorStop_Callback_0(mthis);
+  addColorStop_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "addColorStop", []);
 
-  static addColorStop_Callback_1(mthis, __arg_0) native "CanvasGradient_addColorStop_Callback";
-  addColorStop_Callback_1_(mthis, __arg_0) => addColorStop_Callback_1(mthis, __arg_0);
+  addColorStop_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "addColorStop", [__arg_0]);
 
-  static addColorStop_Callback_2(mthis, __arg_0, __arg_1) native "CanvasGradient_addColorStop_Callback";
-  addColorStop_Callback_2_(mthis, __arg_0, __arg_1) => addColorStop_Callback_2(mthis, __arg_0, __arg_1);
-
-  static addColorStop_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "CanvasGradient_addColorStop_Callback";
-  addColorStop_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => addColorStop_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static addColorStop_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "CanvasGradient_addColorStop_Callback";
-  addColorStop_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => addColorStop_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  addColorStop_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "addColorStop", [__arg_0, __arg_1]);
 
 }
 
 class BlinkCanvasPattern {
   static final instance = new BlinkCanvasPattern();
 
-  static setTransform_Callback_0(mthis) native "CanvasPattern_setTransform_Callback";
-  setTransform_Callback_0_(mthis) => setTransform_Callback_0(mthis);
+  setTransform_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "setTransform", []);
 
-  static setTransform_Callback_1(mthis, __arg_0) native "CanvasPattern_setTransform_Callback";
-  setTransform_Callback_1_(mthis, __arg_0) => setTransform_Callback_1(mthis, __arg_0);
-
-  static setTransform_Callback_2(mthis, __arg_0, __arg_1) native "CanvasPattern_setTransform_Callback";
-  setTransform_Callback_2_(mthis, __arg_0, __arg_1) => setTransform_Callback_2(mthis, __arg_0, __arg_1);
-
-  static setTransform_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "CanvasPattern_setTransform_Callback";
-  setTransform_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => setTransform_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  setTransform_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "setTransform", [__arg_0]);
 
 }
 
 class BlinkCanvasRenderingContext2D {
   static final instance = new BlinkCanvasRenderingContext2D();
 
-  static addHitRegion_Callback_0(mthis) native "CanvasRenderingContext2D_addHitRegion_Callback";
-  addHitRegion_Callback_0_(mthis) => addHitRegion_Callback_0(mthis);
+  addHitRegion_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "addHitRegion", []);
 
-  static addHitRegion_Callback_1(mthis, __arg_0) native "CanvasRenderingContext2D_addHitRegion_Callback";
-  addHitRegion_Callback_1_(mthis, __arg_0) => addHitRegion_Callback_1(mthis, __arg_0);
+  addHitRegion_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "addHitRegion", [__arg_0]);
 
-  static addHitRegion_Callback_2(mthis, __arg_0, __arg_1) native "CanvasRenderingContext2D_addHitRegion_Callback";
-  addHitRegion_Callback_2_(mthis, __arg_0, __arg_1) => addHitRegion_Callback_2(mthis, __arg_0, __arg_1);
+  arcTo_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "arcTo", [__arg_0, __arg_1, __arg_2]);
 
-  static addHitRegion_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "CanvasRenderingContext2D_addHitRegion_Callback";
-  addHitRegion_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => addHitRegion_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  arcTo_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "arcTo", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static arcTo_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "CanvasRenderingContext2D_arcTo_Callback";
-  arcTo_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => arcTo_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  arcTo_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => Blink_JsNative_DomException.callMethod(mthis, "arcTo", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4]);
 
-  static arcTo_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "CanvasRenderingContext2D_arcTo_Callback";
-  arcTo_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => arcTo_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  arc_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "arc", [__arg_0, __arg_1, __arg_2]);
 
-  static arcTo_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "CanvasRenderingContext2D_arcTo_Callback";
-  arcTo_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => arcTo_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  arc_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "arc", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static arcTo_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "CanvasRenderingContext2D_arcTo_Callback";
-  arcTo_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => arcTo_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  arc_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => Blink_JsNative_DomException.callMethod(mthis, "arc", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4]);
 
-  static arcTo_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) native "CanvasRenderingContext2D_arcTo_Callback";
-  arcTo_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => arcTo_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6);
+  arc_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => Blink_JsNative_DomException.callMethod(mthis, "arc", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5]);
 
-  static arc_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "CanvasRenderingContext2D_arc_Callback";
-  arc_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => arc_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  beginPath_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "beginPath", []);
 
-  static arc_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "CanvasRenderingContext2D_arc_Callback";
-  arc_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => arc_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  bezierCurveTo_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "bezierCurveTo", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static arc_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "CanvasRenderingContext2D_arc_Callback";
-  arc_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => arc_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  bezierCurveTo_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => Blink_JsNative_DomException.callMethod(mthis, "bezierCurveTo", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4]);
 
-  static arc_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "CanvasRenderingContext2D_arc_Callback";
-  arc_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => arc_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  bezierCurveTo_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => Blink_JsNative_DomException.callMethod(mthis, "bezierCurveTo", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5]);
 
-  static arc_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) native "CanvasRenderingContext2D_arc_Callback";
-  arc_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => arc_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6);
+  canvas_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "canvas");
 
-  static arc_Callback_8(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) native "CanvasRenderingContext2D_arc_Callback";
-  arc_Callback_8_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) => arc_Callback_8(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7);
+  clearHitRegions_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "clearHitRegions", []);
 
-  static beginPath_Callback_0(mthis) native "CanvasRenderingContext2D_beginPath_Callback";
-  beginPath_Callback_0_(mthis) => beginPath_Callback_0(mthis);
+  clearRect_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "clearRect", [__arg_0, __arg_1]);
 
-  static beginPath_Callback_1(mthis, __arg_0) native "CanvasRenderingContext2D_beginPath_Callback";
-  beginPath_Callback_1_(mthis, __arg_0) => beginPath_Callback_1(mthis, __arg_0);
+  clearRect_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "clearRect", [__arg_0, __arg_1, __arg_2]);
 
-  static beginPath_Callback_2(mthis, __arg_0, __arg_1) native "CanvasRenderingContext2D_beginPath_Callback";
-  beginPath_Callback_2_(mthis, __arg_0, __arg_1) => beginPath_Callback_2(mthis, __arg_0, __arg_1);
+  clearRect_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "clearRect", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static bezierCurveTo_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "CanvasRenderingContext2D_bezierCurveTo_Callback";
-  bezierCurveTo_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => bezierCurveTo_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  clip_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "clip", []);
 
-  static bezierCurveTo_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "CanvasRenderingContext2D_bezierCurveTo_Callback";
-  bezierCurveTo_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => bezierCurveTo_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  clip_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "clip", [__arg_0]);
 
-  static bezierCurveTo_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "CanvasRenderingContext2D_bezierCurveTo_Callback";
-  bezierCurveTo_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => bezierCurveTo_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  clip_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "clip", [__arg_0, __arg_1]);
 
-  static bezierCurveTo_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) native "CanvasRenderingContext2D_bezierCurveTo_Callback";
-  bezierCurveTo_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => bezierCurveTo_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6);
+  closePath_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "closePath", []);
 
-  static bezierCurveTo_Callback_8(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) native "CanvasRenderingContext2D_bezierCurveTo_Callback";
-  bezierCurveTo_Callback_8_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) => bezierCurveTo_Callback_8(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7);
+  createImageData_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createImageData", []);
 
-  static canvas_Getter(mthis) native "CanvasRenderingContext2D_canvas_Getter";
-  canvas_Getter_(mthis) => canvas_Getter(mthis);
+  createImageData_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "createImageData", [__arg_0]);
 
-  static clearHitRegions_Callback_0(mthis) native "CanvasRenderingContext2D_clearHitRegions_Callback";
-  clearHitRegions_Callback_0_(mthis) => clearHitRegions_Callback_0(mthis);
+  createImageData_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "createImageData", [__arg_0, __arg_1]);
 
-  static clearHitRegions_Callback_1(mthis, __arg_0) native "CanvasRenderingContext2D_clearHitRegions_Callback";
-  clearHitRegions_Callback_1_(mthis, __arg_0) => clearHitRegions_Callback_1(mthis, __arg_0);
+  createLinearGradient_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "createLinearGradient", [__arg_0, __arg_1]);
 
-  static clearHitRegions_Callback_2(mthis, __arg_0, __arg_1) native "CanvasRenderingContext2D_clearHitRegions_Callback";
-  clearHitRegions_Callback_2_(mthis, __arg_0, __arg_1) => clearHitRegions_Callback_2(mthis, __arg_0, __arg_1);
+  createLinearGradient_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "createLinearGradient", [__arg_0, __arg_1, __arg_2]);
 
-  static clearRect_Callback_2(mthis, __arg_0, __arg_1) native "CanvasRenderingContext2D_clearRect_Callback";
-  clearRect_Callback_2_(mthis, __arg_0, __arg_1) => clearRect_Callback_2(mthis, __arg_0, __arg_1);
+  createLinearGradient_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "createLinearGradient", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static clearRect_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "CanvasRenderingContext2D_clearRect_Callback";
-  clearRect_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => clearRect_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  createPattern_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createPattern", []);
 
-  static clearRect_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "CanvasRenderingContext2D_clearRect_Callback";
-  clearRect_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => clearRect_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  createPattern_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "createPattern", [__arg_0]);
 
-  static clearRect_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "CanvasRenderingContext2D_clearRect_Callback";
-  clearRect_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => clearRect_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  createPattern_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "createPattern", [__arg_0, __arg_1]);
 
-  static clearRect_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "CanvasRenderingContext2D_clearRect_Callback";
-  clearRect_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => clearRect_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  createRadialGradient_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "createRadialGradient", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static clip_Callback_0(mthis) native "CanvasRenderingContext2D_clip_Callback";
-  clip_Callback_0_(mthis) => clip_Callback_0(mthis);
+  createRadialGradient_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => Blink_JsNative_DomException.callMethod(mthis, "createRadialGradient", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4]);
 
-  static clip_Callback_1(mthis, __arg_0) native "CanvasRenderingContext2D_clip_Callback";
-  clip_Callback_1_(mthis, __arg_0) => clip_Callback_1(mthis, __arg_0);
+  createRadialGradient_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => Blink_JsNative_DomException.callMethod(mthis, "createRadialGradient", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5]);
 
-  static clip_Callback_2(mthis, __arg_0, __arg_1) native "CanvasRenderingContext2D_clip_Callback";
-  clip_Callback_2_(mthis, __arg_0, __arg_1) => clip_Callback_2(mthis, __arg_0, __arg_1);
+  currentTransform_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "currentTransform");
 
-  static clip_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "CanvasRenderingContext2D_clip_Callback";
-  clip_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => clip_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  currentTransform_Setter_(mthis, __arg_0) => mthis["currentTransform"] = __arg_0;
 
-  static clip_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "CanvasRenderingContext2D_clip_Callback";
-  clip_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => clip_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  direction_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "direction");
 
-  static closePath_Callback_0(mthis) native "CanvasRenderingContext2D_closePath_Callback";
-  closePath_Callback_0_(mthis) => closePath_Callback_0(mthis);
+  direction_Setter_(mthis, __arg_0) => mthis["direction"] = __arg_0;
 
-  static closePath_Callback_1(mthis, __arg_0) native "CanvasRenderingContext2D_closePath_Callback";
-  closePath_Callback_1_(mthis, __arg_0) => closePath_Callback_1(mthis, __arg_0);
+  drawFocusIfNeeded_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "drawFocusIfNeeded", []);
 
-  static closePath_Callback_2(mthis, __arg_0, __arg_1) native "CanvasRenderingContext2D_closePath_Callback";
-  closePath_Callback_2_(mthis, __arg_0, __arg_1) => closePath_Callback_2(mthis, __arg_0, __arg_1);
+  drawFocusIfNeeded_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "drawFocusIfNeeded", [__arg_0]);
 
-  static createImageData_Callback_0(mthis) native "CanvasRenderingContext2D_createImageData_Callback";
-  createImageData_Callback_0_(mthis) => createImageData_Callback_0(mthis);
+  drawFocusIfNeeded_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "drawFocusIfNeeded", [__arg_0, __arg_1]);
 
-  static createImageData_Callback_1(mthis, __arg_0) native "CanvasRenderingContext2D_createImageData_Callback";
-  createImageData_Callback_1_(mthis, __arg_0) => createImageData_Callback_1(mthis, __arg_0);
+  drawImage_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "drawImage", [__arg_0]);
 
-  static createImageData_Callback_2(mthis, __arg_0, __arg_1) native "CanvasRenderingContext2D_createImageData_Callback";
-  createImageData_Callback_2_(mthis, __arg_0, __arg_1) => createImageData_Callback_2(mthis, __arg_0, __arg_1);
+  drawImage_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "drawImage", [__arg_0, __arg_1]);
 
-  static createImageData_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "CanvasRenderingContext2D_createImageData_Callback";
-  createImageData_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => createImageData_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  drawImage_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "drawImage", [__arg_0, __arg_1, __arg_2]);
 
-  static createImageData_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "CanvasRenderingContext2D_createImageData_Callback";
-  createImageData_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => createImageData_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  drawImage_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "drawImage", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static createLinearGradient_Callback_2(mthis, __arg_0, __arg_1) native "CanvasRenderingContext2D_createLinearGradient_Callback";
-  createLinearGradient_Callback_2_(mthis, __arg_0, __arg_1) => createLinearGradient_Callback_2(mthis, __arg_0, __arg_1);
+  drawImage_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => Blink_JsNative_DomException.callMethod(mthis, "drawImage", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4]);
 
-  static createLinearGradient_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "CanvasRenderingContext2D_createLinearGradient_Callback";
-  createLinearGradient_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => createLinearGradient_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  drawImage_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => Blink_JsNative_DomException.callMethod(mthis, "drawImage", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6]);
 
-  static createLinearGradient_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "CanvasRenderingContext2D_createLinearGradient_Callback";
-  createLinearGradient_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => createLinearGradient_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  drawImage_Callback_8_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) => Blink_JsNative_DomException.callMethod(mthis, "drawImage", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7]);
 
-  static createLinearGradient_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "CanvasRenderingContext2D_createLinearGradient_Callback";
-  createLinearGradient_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => createLinearGradient_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  drawImage_Callback_9_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8) => Blink_JsNative_DomException.callMethod(mthis, "drawImage", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8]);
 
-  static createLinearGradient_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "CanvasRenderingContext2D_createLinearGradient_Callback";
-  createLinearGradient_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => createLinearGradient_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  ellipse_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => Blink_JsNative_DomException.callMethod(mthis, "ellipse", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4]);
 
-  static createPattern_Callback_0(mthis) native "CanvasRenderingContext2D_createPattern_Callback";
-  createPattern_Callback_0_(mthis) => createPattern_Callback_0(mthis);
+  ellipse_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => Blink_JsNative_DomException.callMethod(mthis, "ellipse", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5]);
 
-  static createPattern_Callback_1(mthis, __arg_0) native "CanvasRenderingContext2D_createPattern_Callback";
-  createPattern_Callback_1_(mthis, __arg_0) => createPattern_Callback_1(mthis, __arg_0);
+  ellipse_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => Blink_JsNative_DomException.callMethod(mthis, "ellipse", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6]);
 
-  static createPattern_Callback_2(mthis, __arg_0, __arg_1) native "CanvasRenderingContext2D_createPattern_Callback";
-  createPattern_Callback_2_(mthis, __arg_0, __arg_1) => createPattern_Callback_2(mthis, __arg_0, __arg_1);
+  ellipse_Callback_8_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) => Blink_JsNative_DomException.callMethod(mthis, "ellipse", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7]);
 
-  static createPattern_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "CanvasRenderingContext2D_createPattern_Callback";
-  createPattern_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => createPattern_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  fillRect_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "fillRect", [__arg_0, __arg_1]);
 
-  static createPattern_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "CanvasRenderingContext2D_createPattern_Callback";
-  createPattern_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => createPattern_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  fillRect_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "fillRect", [__arg_0, __arg_1, __arg_2]);
 
-  static createRadialGradient_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "CanvasRenderingContext2D_createRadialGradient_Callback";
-  createRadialGradient_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => createRadialGradient_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  fillRect_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "fillRect", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static createRadialGradient_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "CanvasRenderingContext2D_createRadialGradient_Callback";
-  createRadialGradient_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => createRadialGradient_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  fillStyle_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "fillStyle");
 
-  static createRadialGradient_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "CanvasRenderingContext2D_createRadialGradient_Callback";
-  createRadialGradient_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => createRadialGradient_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  fillStyle_Setter_(mthis, __arg_0) => mthis["fillStyle"] = __arg_0;
 
-  static createRadialGradient_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) native "CanvasRenderingContext2D_createRadialGradient_Callback";
-  createRadialGradient_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => createRadialGradient_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6);
+  fillText_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "fillText", [__arg_0]);
 
-  static createRadialGradient_Callback_8(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) native "CanvasRenderingContext2D_createRadialGradient_Callback";
-  createRadialGradient_Callback_8_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) => createRadialGradient_Callback_8(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7);
+  fillText_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "fillText", [__arg_0, __arg_1]);
 
-  static currentTransform_Getter(mthis) native "CanvasRenderingContext2D_currentTransform_Getter";
-  currentTransform_Getter_(mthis) => currentTransform_Getter(mthis);
+  fillText_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "fillText", [__arg_0, __arg_1, __arg_2]);
 
-  static currentTransform_Setter(mthis, __arg_0) native "CanvasRenderingContext2D_currentTransform_Setter";
-  currentTransform_Setter_(mthis, __arg_0) => currentTransform_Setter(mthis, __arg_0);
+  fillText_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "fillText", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static direction_Getter(mthis) native "CanvasRenderingContext2D_direction_Getter";
-  direction_Getter_(mthis) => direction_Getter(mthis);
+  fill_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "fill", []);
 
-  static direction_Setter(mthis, __arg_0) native "CanvasRenderingContext2D_direction_Setter";
-  direction_Setter_(mthis, __arg_0) => direction_Setter(mthis, __arg_0);
+  fill_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "fill", [__arg_0]);
 
-  static drawFocusIfNeeded_Callback_0(mthis) native "CanvasRenderingContext2D_drawFocusIfNeeded_Callback";
-  drawFocusIfNeeded_Callback_0_(mthis) => drawFocusIfNeeded_Callback_0(mthis);
+  fill_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "fill", [__arg_0, __arg_1]);
 
-  static drawFocusIfNeeded_Callback_1(mthis, __arg_0) native "CanvasRenderingContext2D_drawFocusIfNeeded_Callback";
-  drawFocusIfNeeded_Callback_1_(mthis, __arg_0) => drawFocusIfNeeded_Callback_1(mthis, __arg_0);
+  font_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "font");
 
-  static drawFocusIfNeeded_Callback_2(mthis, __arg_0, __arg_1) native "CanvasRenderingContext2D_drawFocusIfNeeded_Callback";
-  drawFocusIfNeeded_Callback_2_(mthis, __arg_0, __arg_1) => drawFocusIfNeeded_Callback_2(mthis, __arg_0, __arg_1);
+  font_Setter_(mthis, __arg_0) => mthis["font"] = __arg_0;
 
-  static drawFocusIfNeeded_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "CanvasRenderingContext2D_drawFocusIfNeeded_Callback";
-  drawFocusIfNeeded_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => drawFocusIfNeeded_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  getContextAttributes_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getContextAttributes", []);
 
-  static drawFocusIfNeeded_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "CanvasRenderingContext2D_drawFocusIfNeeded_Callback";
-  drawFocusIfNeeded_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => drawFocusIfNeeded_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  getImageData_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "getImageData", [__arg_0, __arg_1]);
 
-  static drawImage_Callback_1(mthis, __arg_0) native "CanvasRenderingContext2D_drawImage_Callback";
-  drawImage_Callback_1_(mthis, __arg_0) => drawImage_Callback_1(mthis, __arg_0);
+  getImageData_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "getImageData", [__arg_0, __arg_1, __arg_2]);
 
-  static drawImage_Callback_10(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9) native "CanvasRenderingContext2D_drawImage_Callback";
-  drawImage_Callback_10_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9) => drawImage_Callback_10(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9);
+  getImageData_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "getImageData", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static drawImage_Callback_11(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10) native "CanvasRenderingContext2D_drawImage_Callback";
-  drawImage_Callback_11_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10) => drawImage_Callback_11(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10);
+  getLineDash_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getLineDash", []);
 
-  static drawImage_Callback_2(mthis, __arg_0, __arg_1) native "CanvasRenderingContext2D_drawImage_Callback";
-  drawImage_Callback_2_(mthis, __arg_0, __arg_1) => drawImage_Callback_2(mthis, __arg_0, __arg_1);
+  globalAlpha_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "globalAlpha");
 
-  static drawImage_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "CanvasRenderingContext2D_drawImage_Callback";
-  drawImage_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => drawImage_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  globalAlpha_Setter_(mthis, __arg_0) => mthis["globalAlpha"] = __arg_0;
 
-  static drawImage_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "CanvasRenderingContext2D_drawImage_Callback";
-  drawImage_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => drawImage_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  globalCompositeOperation_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "globalCompositeOperation");
 
-  static drawImage_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "CanvasRenderingContext2D_drawImage_Callback";
-  drawImage_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => drawImage_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  globalCompositeOperation_Setter_(mthis, __arg_0) => mthis["globalCompositeOperation"] = __arg_0;
 
-  static drawImage_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "CanvasRenderingContext2D_drawImage_Callback";
-  drawImage_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => drawImage_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  imageSmoothingEnabled_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "imageSmoothingEnabled");
 
-  static drawImage_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) native "CanvasRenderingContext2D_drawImage_Callback";
-  drawImage_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => drawImage_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6);
+  imageSmoothingEnabled_Setter_(mthis, __arg_0) => mthis["imageSmoothingEnabled"] = __arg_0;
 
-  static drawImage_Callback_8(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) native "CanvasRenderingContext2D_drawImage_Callback";
-  drawImage_Callback_8_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) => drawImage_Callback_8(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7);
+  isContextLost_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "isContextLost", []);
 
-  static drawImage_Callback_9(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8) native "CanvasRenderingContext2D_drawImage_Callback";
-  drawImage_Callback_9_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8) => drawImage_Callback_9(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8);
+  isPointInPath_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "isPointInPath", []);
 
-  static ellipse_Callback_10(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9) native "CanvasRenderingContext2D_ellipse_Callback";
-  ellipse_Callback_10_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9) => ellipse_Callback_10(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9);
+  isPointInPath_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "isPointInPath", [__arg_0]);
 
-  static ellipse_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "CanvasRenderingContext2D_ellipse_Callback";
-  ellipse_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => ellipse_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  isPointInPath_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "isPointInPath", [__arg_0, __arg_1]);
 
-  static ellipse_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "CanvasRenderingContext2D_ellipse_Callback";
-  ellipse_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => ellipse_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  isPointInPath_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "isPointInPath", [__arg_0, __arg_1, __arg_2]);
 
-  static ellipse_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) native "CanvasRenderingContext2D_ellipse_Callback";
-  ellipse_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => ellipse_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6);
+  isPointInPath_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "isPointInPath", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static ellipse_Callback_8(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) native "CanvasRenderingContext2D_ellipse_Callback";
-  ellipse_Callback_8_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) => ellipse_Callback_8(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7);
+  isPointInStroke_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "isPointInStroke", []);
 
-  static ellipse_Callback_9(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8) native "CanvasRenderingContext2D_ellipse_Callback";
-  ellipse_Callback_9_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8) => ellipse_Callback_9(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8);
+  isPointInStroke_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "isPointInStroke", [__arg_0]);
 
-  static fillRect_Callback_2(mthis, __arg_0, __arg_1) native "CanvasRenderingContext2D_fillRect_Callback";
-  fillRect_Callback_2_(mthis, __arg_0, __arg_1) => fillRect_Callback_2(mthis, __arg_0, __arg_1);
+  isPointInStroke_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "isPointInStroke", [__arg_0, __arg_1]);
 
-  static fillRect_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "CanvasRenderingContext2D_fillRect_Callback";
-  fillRect_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => fillRect_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  isPointInStroke_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "isPointInStroke", [__arg_0, __arg_1, __arg_2]);
 
-  static fillRect_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "CanvasRenderingContext2D_fillRect_Callback";
-  fillRect_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => fillRect_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  lineCap_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "lineCap");
 
-  static fillRect_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "CanvasRenderingContext2D_fillRect_Callback";
-  fillRect_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => fillRect_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  lineCap_Setter_(mthis, __arg_0) => mthis["lineCap"] = __arg_0;
 
-  static fillRect_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "CanvasRenderingContext2D_fillRect_Callback";
-  fillRect_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => fillRect_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  lineDashOffset_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "lineDashOffset");
 
-  static fillStyle_Getter(mthis) native "CanvasRenderingContext2D_fillStyle_Getter";
-  fillStyle_Getter_(mthis) => fillStyle_Getter(mthis);
+  lineDashOffset_Setter_(mthis, __arg_0) => mthis["lineDashOffset"] = __arg_0;
 
-  static fillStyle_Setter(mthis, __arg_0) native "CanvasRenderingContext2D_fillStyle_Setter";
-  fillStyle_Setter_(mthis, __arg_0) => fillStyle_Setter(mthis, __arg_0);
+  lineJoin_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "lineJoin");
 
-  static fillText_Callback_1(mthis, __arg_0) native "CanvasRenderingContext2D_fillText_Callback";
-  fillText_Callback_1_(mthis, __arg_0) => fillText_Callback_1(mthis, __arg_0);
+  lineJoin_Setter_(mthis, __arg_0) => mthis["lineJoin"] = __arg_0;
 
-  static fillText_Callback_2(mthis, __arg_0, __arg_1) native "CanvasRenderingContext2D_fillText_Callback";
-  fillText_Callback_2_(mthis, __arg_0, __arg_1) => fillText_Callback_2(mthis, __arg_0, __arg_1);
+  lineTo_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "lineTo", []);
 
-  static fillText_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "CanvasRenderingContext2D_fillText_Callback";
-  fillText_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => fillText_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  lineTo_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "lineTo", [__arg_0]);
 
-  static fillText_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "CanvasRenderingContext2D_fillText_Callback";
-  fillText_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => fillText_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  lineTo_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "lineTo", [__arg_0, __arg_1]);
 
-  static fillText_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "CanvasRenderingContext2D_fillText_Callback";
-  fillText_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => fillText_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  lineWidth_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "lineWidth");
 
-  static fillText_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "CanvasRenderingContext2D_fillText_Callback";
-  fillText_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => fillText_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  lineWidth_Setter_(mthis, __arg_0) => mthis["lineWidth"] = __arg_0;
 
-  static fill_Callback_0(mthis) native "CanvasRenderingContext2D_fill_Callback";
-  fill_Callback_0_(mthis) => fill_Callback_0(mthis);
+  measureText_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "measureText", []);
 
-  static fill_Callback_1(mthis, __arg_0) native "CanvasRenderingContext2D_fill_Callback";
-  fill_Callback_1_(mthis, __arg_0) => fill_Callback_1(mthis, __arg_0);
+  measureText_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "measureText", [__arg_0]);
 
-  static fill_Callback_2(mthis, __arg_0, __arg_1) native "CanvasRenderingContext2D_fill_Callback";
-  fill_Callback_2_(mthis, __arg_0, __arg_1) => fill_Callback_2(mthis, __arg_0, __arg_1);
+  miterLimit_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "miterLimit");
 
-  static fill_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "CanvasRenderingContext2D_fill_Callback";
-  fill_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => fill_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  miterLimit_Setter_(mthis, __arg_0) => mthis["miterLimit"] = __arg_0;
 
-  static fill_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "CanvasRenderingContext2D_fill_Callback";
-  fill_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => fill_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  moveTo_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "moveTo", []);
 
-  static font_Getter(mthis) native "CanvasRenderingContext2D_font_Getter";
-  font_Getter_(mthis) => font_Getter(mthis);
+  moveTo_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "moveTo", [__arg_0]);
 
-  static font_Setter(mthis, __arg_0) native "CanvasRenderingContext2D_font_Setter";
-  font_Setter_(mthis, __arg_0) => font_Setter(mthis, __arg_0);
+  moveTo_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "moveTo", [__arg_0, __arg_1]);
 
-  static getContextAttributes_Callback_0(mthis) native "CanvasRenderingContext2D_getContextAttributes_Callback";
-  getContextAttributes_Callback_0_(mthis) => getContextAttributes_Callback_0(mthis);
+  putImageData_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "putImageData", [__arg_0]);
 
-  static getContextAttributes_Callback_1(mthis, __arg_0) native "CanvasRenderingContext2D_getContextAttributes_Callback";
-  getContextAttributes_Callback_1_(mthis, __arg_0) => getContextAttributes_Callback_1(mthis, __arg_0);
+  putImageData_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "putImageData", [__arg_0, __arg_1]);
 
-  static getContextAttributes_Callback_2(mthis, __arg_0, __arg_1) native "CanvasRenderingContext2D_getContextAttributes_Callback";
-  getContextAttributes_Callback_2_(mthis, __arg_0, __arg_1) => getContextAttributes_Callback_2(mthis, __arg_0, __arg_1);
+  putImageData_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "putImageData", [__arg_0, __arg_1, __arg_2]);
 
-  static getImageData_Callback_2(mthis, __arg_0, __arg_1) native "CanvasRenderingContext2D_getImageData_Callback";
-  getImageData_Callback_2_(mthis, __arg_0, __arg_1) => getImageData_Callback_2(mthis, __arg_0, __arg_1);
+  putImageData_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => Blink_JsNative_DomException.callMethod(mthis, "putImageData", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4]);
 
-  static getImageData_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "CanvasRenderingContext2D_getImageData_Callback";
-  getImageData_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getImageData_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  putImageData_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => Blink_JsNative_DomException.callMethod(mthis, "putImageData", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5]);
 
-  static getImageData_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "CanvasRenderingContext2D_getImageData_Callback";
-  getImageData_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => getImageData_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  putImageData_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => Blink_JsNative_DomException.callMethod(mthis, "putImageData", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6]);
 
-  static getImageData_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "CanvasRenderingContext2D_getImageData_Callback";
-  getImageData_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => getImageData_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  quadraticCurveTo_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "quadraticCurveTo", [__arg_0, __arg_1]);
 
-  static getImageData_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "CanvasRenderingContext2D_getImageData_Callback";
-  getImageData_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => getImageData_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  quadraticCurveTo_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "quadraticCurveTo", [__arg_0, __arg_1, __arg_2]);
 
-  static getLineDash_Callback_0(mthis) native "CanvasRenderingContext2D_getLineDash_Callback";
-  getLineDash_Callback_0_(mthis) => getLineDash_Callback_0(mthis);
+  quadraticCurveTo_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "quadraticCurveTo", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static getLineDash_Callback_1(mthis, __arg_0) native "CanvasRenderingContext2D_getLineDash_Callback";
-  getLineDash_Callback_1_(mthis, __arg_0) => getLineDash_Callback_1(mthis, __arg_0);
+  rect_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "rect", [__arg_0, __arg_1]);
 
-  static getLineDash_Callback_2(mthis, __arg_0, __arg_1) native "CanvasRenderingContext2D_getLineDash_Callback";
-  getLineDash_Callback_2_(mthis, __arg_0, __arg_1) => getLineDash_Callback_2(mthis, __arg_0, __arg_1);
+  rect_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "rect", [__arg_0, __arg_1, __arg_2]);
 
-  static globalAlpha_Getter(mthis) native "CanvasRenderingContext2D_globalAlpha_Getter";
-  globalAlpha_Getter_(mthis) => globalAlpha_Getter(mthis);
+  rect_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "rect", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static globalAlpha_Setter(mthis, __arg_0) native "CanvasRenderingContext2D_globalAlpha_Setter";
-  globalAlpha_Setter_(mthis, __arg_0) => globalAlpha_Setter(mthis, __arg_0);
+  removeHitRegion_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "removeHitRegion", []);
 
-  static globalCompositeOperation_Getter(mthis) native "CanvasRenderingContext2D_globalCompositeOperation_Getter";
-  globalCompositeOperation_Getter_(mthis) => globalCompositeOperation_Getter(mthis);
+  removeHitRegion_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "removeHitRegion", [__arg_0]);
 
-  static globalCompositeOperation_Setter(mthis, __arg_0) native "CanvasRenderingContext2D_globalCompositeOperation_Setter";
-  globalCompositeOperation_Setter_(mthis, __arg_0) => globalCompositeOperation_Setter(mthis, __arg_0);
+  resetTransform_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "resetTransform", []);
 
-  static imageSmoothingEnabled_Getter(mthis) native "CanvasRenderingContext2D_imageSmoothingEnabled_Getter";
-  imageSmoothingEnabled_Getter_(mthis) => imageSmoothingEnabled_Getter(mthis);
+  restore_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "restore", []);
 
-  static imageSmoothingEnabled_Setter(mthis, __arg_0) native "CanvasRenderingContext2D_imageSmoothingEnabled_Setter";
-  imageSmoothingEnabled_Setter_(mthis, __arg_0) => imageSmoothingEnabled_Setter(mthis, __arg_0);
+  rotate_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "rotate", []);
 
-  static isContextLost_Callback_0(mthis) native "CanvasRenderingContext2D_isContextLost_Callback";
-  isContextLost_Callback_0_(mthis) => isContextLost_Callback_0(mthis);
+  rotate_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "rotate", [__arg_0]);
 
-  static isContextLost_Callback_1(mthis, __arg_0) native "CanvasRenderingContext2D_isContextLost_Callback";
-  isContextLost_Callback_1_(mthis, __arg_0) => isContextLost_Callback_1(mthis, __arg_0);
+  save_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "save", []);
 
-  static isContextLost_Callback_2(mthis, __arg_0, __arg_1) native "CanvasRenderingContext2D_isContextLost_Callback";
-  isContextLost_Callback_2_(mthis, __arg_0, __arg_1) => isContextLost_Callback_2(mthis, __arg_0, __arg_1);
+  scale_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "scale", []);
 
-  static isPointInPath_Callback_0(mthis) native "CanvasRenderingContext2D_isPointInPath_Callback";
-  isPointInPath_Callback_0_(mthis) => isPointInPath_Callback_0(mthis);
+  scale_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "scale", [__arg_0]);
 
-  static isPointInPath_Callback_1(mthis, __arg_0) native "CanvasRenderingContext2D_isPointInPath_Callback";
-  isPointInPath_Callback_1_(mthis, __arg_0) => isPointInPath_Callback_1(mthis, __arg_0);
-
-  static isPointInPath_Callback_2(mthis, __arg_0, __arg_1) native "CanvasRenderingContext2D_isPointInPath_Callback";
-  isPointInPath_Callback_2_(mthis, __arg_0, __arg_1) => isPointInPath_Callback_2(mthis, __arg_0, __arg_1);
-
-  static isPointInPath_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "CanvasRenderingContext2D_isPointInPath_Callback";
-  isPointInPath_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => isPointInPath_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static isPointInPath_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "CanvasRenderingContext2D_isPointInPath_Callback";
-  isPointInPath_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => isPointInPath_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static isPointInPath_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "CanvasRenderingContext2D_isPointInPath_Callback";
-  isPointInPath_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => isPointInPath_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
-
-  static isPointInPath_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "CanvasRenderingContext2D_isPointInPath_Callback";
-  isPointInPath_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => isPointInPath_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
-
-  static isPointInStroke_Callback_0(mthis) native "CanvasRenderingContext2D_isPointInStroke_Callback";
-  isPointInStroke_Callback_0_(mthis) => isPointInStroke_Callback_0(mthis);
-
-  static isPointInStroke_Callback_1(mthis, __arg_0) native "CanvasRenderingContext2D_isPointInStroke_Callback";
-  isPointInStroke_Callback_1_(mthis, __arg_0) => isPointInStroke_Callback_1(mthis, __arg_0);
-
-  static isPointInStroke_Callback_2(mthis, __arg_0, __arg_1) native "CanvasRenderingContext2D_isPointInStroke_Callback";
-  isPointInStroke_Callback_2_(mthis, __arg_0, __arg_1) => isPointInStroke_Callback_2(mthis, __arg_0, __arg_1);
-
-  static isPointInStroke_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "CanvasRenderingContext2D_isPointInStroke_Callback";
-  isPointInStroke_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => isPointInStroke_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static isPointInStroke_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "CanvasRenderingContext2D_isPointInStroke_Callback";
-  isPointInStroke_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => isPointInStroke_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static isPointInStroke_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "CanvasRenderingContext2D_isPointInStroke_Callback";
-  isPointInStroke_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => isPointInStroke_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
-
-  static lineCap_Getter(mthis) native "CanvasRenderingContext2D_lineCap_Getter";
-  lineCap_Getter_(mthis) => lineCap_Getter(mthis);
-
-  static lineCap_Setter(mthis, __arg_0) native "CanvasRenderingContext2D_lineCap_Setter";
-  lineCap_Setter_(mthis, __arg_0) => lineCap_Setter(mthis, __arg_0);
-
-  static lineDashOffset_Getter(mthis) native "CanvasRenderingContext2D_lineDashOffset_Getter";
-  lineDashOffset_Getter_(mthis) => lineDashOffset_Getter(mthis);
-
-  static lineDashOffset_Setter(mthis, __arg_0) native "CanvasRenderingContext2D_lineDashOffset_Setter";
-  lineDashOffset_Setter_(mthis, __arg_0) => lineDashOffset_Setter(mthis, __arg_0);
-
-  static lineJoin_Getter(mthis) native "CanvasRenderingContext2D_lineJoin_Getter";
-  lineJoin_Getter_(mthis) => lineJoin_Getter(mthis);
-
-  static lineJoin_Setter(mthis, __arg_0) native "CanvasRenderingContext2D_lineJoin_Setter";
-  lineJoin_Setter_(mthis, __arg_0) => lineJoin_Setter(mthis, __arg_0);
-
-  static lineTo_Callback_0(mthis) native "CanvasRenderingContext2D_lineTo_Callback";
-  lineTo_Callback_0_(mthis) => lineTo_Callback_0(mthis);
-
-  static lineTo_Callback_1(mthis, __arg_0) native "CanvasRenderingContext2D_lineTo_Callback";
-  lineTo_Callback_1_(mthis, __arg_0) => lineTo_Callback_1(mthis, __arg_0);
-
-  static lineTo_Callback_2(mthis, __arg_0, __arg_1) native "CanvasRenderingContext2D_lineTo_Callback";
-  lineTo_Callback_2_(mthis, __arg_0, __arg_1) => lineTo_Callback_2(mthis, __arg_0, __arg_1);
-
-  static lineTo_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "CanvasRenderingContext2D_lineTo_Callback";
-  lineTo_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => lineTo_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static lineTo_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "CanvasRenderingContext2D_lineTo_Callback";
-  lineTo_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => lineTo_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static lineWidth_Getter(mthis) native "CanvasRenderingContext2D_lineWidth_Getter";
-  lineWidth_Getter_(mthis) => lineWidth_Getter(mthis);
-
-  static lineWidth_Setter(mthis, __arg_0) native "CanvasRenderingContext2D_lineWidth_Setter";
-  lineWidth_Setter_(mthis, __arg_0) => lineWidth_Setter(mthis, __arg_0);
-
-  static measureText_Callback_0(mthis) native "CanvasRenderingContext2D_measureText_Callback";
-  measureText_Callback_0_(mthis) => measureText_Callback_0(mthis);
-
-  static measureText_Callback_1(mthis, __arg_0) native "CanvasRenderingContext2D_measureText_Callback";
-  measureText_Callback_1_(mthis, __arg_0) => measureText_Callback_1(mthis, __arg_0);
-
-  static measureText_Callback_2(mthis, __arg_0, __arg_1) native "CanvasRenderingContext2D_measureText_Callback";
-  measureText_Callback_2_(mthis, __arg_0, __arg_1) => measureText_Callback_2(mthis, __arg_0, __arg_1);
-
-  static measureText_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "CanvasRenderingContext2D_measureText_Callback";
-  measureText_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => measureText_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static miterLimit_Getter(mthis) native "CanvasRenderingContext2D_miterLimit_Getter";
-  miterLimit_Getter_(mthis) => miterLimit_Getter(mthis);
-
-  static miterLimit_Setter(mthis, __arg_0) native "CanvasRenderingContext2D_miterLimit_Setter";
-  miterLimit_Setter_(mthis, __arg_0) => miterLimit_Setter(mthis, __arg_0);
-
-  static moveTo_Callback_0(mthis) native "CanvasRenderingContext2D_moveTo_Callback";
-  moveTo_Callback_0_(mthis) => moveTo_Callback_0(mthis);
-
-  static moveTo_Callback_1(mthis, __arg_0) native "CanvasRenderingContext2D_moveTo_Callback";
-  moveTo_Callback_1_(mthis, __arg_0) => moveTo_Callback_1(mthis, __arg_0);
-
-  static moveTo_Callback_2(mthis, __arg_0, __arg_1) native "CanvasRenderingContext2D_moveTo_Callback";
-  moveTo_Callback_2_(mthis, __arg_0, __arg_1) => moveTo_Callback_2(mthis, __arg_0, __arg_1);
-
-  static moveTo_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "CanvasRenderingContext2D_moveTo_Callback";
-  moveTo_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => moveTo_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static moveTo_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "CanvasRenderingContext2D_moveTo_Callback";
-  moveTo_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => moveTo_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static putImageData_Callback_1(mthis, __arg_0) native "CanvasRenderingContext2D_putImageData_Callback";
-  putImageData_Callback_1_(mthis, __arg_0) => putImageData_Callback_1(mthis, __arg_0);
-
-  static putImageData_Callback_2(mthis, __arg_0, __arg_1) native "CanvasRenderingContext2D_putImageData_Callback";
-  putImageData_Callback_2_(mthis, __arg_0, __arg_1) => putImageData_Callback_2(mthis, __arg_0, __arg_1);
-
-  static putImageData_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "CanvasRenderingContext2D_putImageData_Callback";
-  putImageData_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => putImageData_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static putImageData_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "CanvasRenderingContext2D_putImageData_Callback";
-  putImageData_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => putImageData_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static putImageData_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "CanvasRenderingContext2D_putImageData_Callback";
-  putImageData_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => putImageData_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
-
-  static putImageData_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "CanvasRenderingContext2D_putImageData_Callback";
-  putImageData_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => putImageData_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
-
-  static putImageData_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) native "CanvasRenderingContext2D_putImageData_Callback";
-  putImageData_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => putImageData_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6);
-
-  static putImageData_Callback_8(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) native "CanvasRenderingContext2D_putImageData_Callback";
-  putImageData_Callback_8_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) => putImageData_Callback_8(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7);
-
-  static putImageData_Callback_9(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8) native "CanvasRenderingContext2D_putImageData_Callback";
-  putImageData_Callback_9_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8) => putImageData_Callback_9(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8);
-
-  static quadraticCurveTo_Callback_2(mthis, __arg_0, __arg_1) native "CanvasRenderingContext2D_quadraticCurveTo_Callback";
-  quadraticCurveTo_Callback_2_(mthis, __arg_0, __arg_1) => quadraticCurveTo_Callback_2(mthis, __arg_0, __arg_1);
-
-  static quadraticCurveTo_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "CanvasRenderingContext2D_quadraticCurveTo_Callback";
-  quadraticCurveTo_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => quadraticCurveTo_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static quadraticCurveTo_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "CanvasRenderingContext2D_quadraticCurveTo_Callback";
-  quadraticCurveTo_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => quadraticCurveTo_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static quadraticCurveTo_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "CanvasRenderingContext2D_quadraticCurveTo_Callback";
-  quadraticCurveTo_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => quadraticCurveTo_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
-
-  static quadraticCurveTo_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "CanvasRenderingContext2D_quadraticCurveTo_Callback";
-  quadraticCurveTo_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => quadraticCurveTo_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
-
-  static rect_Callback_2(mthis, __arg_0, __arg_1) native "CanvasRenderingContext2D_rect_Callback";
-  rect_Callback_2_(mthis, __arg_0, __arg_1) => rect_Callback_2(mthis, __arg_0, __arg_1);
-
-  static rect_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "CanvasRenderingContext2D_rect_Callback";
-  rect_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => rect_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static rect_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "CanvasRenderingContext2D_rect_Callback";
-  rect_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => rect_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static rect_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "CanvasRenderingContext2D_rect_Callback";
-  rect_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => rect_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
-
-  static rect_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "CanvasRenderingContext2D_rect_Callback";
-  rect_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => rect_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
-
-  static removeHitRegion_Callback_0(mthis) native "CanvasRenderingContext2D_removeHitRegion_Callback";
-  removeHitRegion_Callback_0_(mthis) => removeHitRegion_Callback_0(mthis);
-
-  static removeHitRegion_Callback_1(mthis, __arg_0) native "CanvasRenderingContext2D_removeHitRegion_Callback";
-  removeHitRegion_Callback_1_(mthis, __arg_0) => removeHitRegion_Callback_1(mthis, __arg_0);
-
-  static removeHitRegion_Callback_2(mthis, __arg_0, __arg_1) native "CanvasRenderingContext2D_removeHitRegion_Callback";
-  removeHitRegion_Callback_2_(mthis, __arg_0, __arg_1) => removeHitRegion_Callback_2(mthis, __arg_0, __arg_1);
-
-  static removeHitRegion_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "CanvasRenderingContext2D_removeHitRegion_Callback";
-  removeHitRegion_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => removeHitRegion_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static resetTransform_Callback_0(mthis) native "CanvasRenderingContext2D_resetTransform_Callback";
-  resetTransform_Callback_0_(mthis) => resetTransform_Callback_0(mthis);
-
-  static resetTransform_Callback_1(mthis, __arg_0) native "CanvasRenderingContext2D_resetTransform_Callback";
-  resetTransform_Callback_1_(mthis, __arg_0) => resetTransform_Callback_1(mthis, __arg_0);
-
-  static resetTransform_Callback_2(mthis, __arg_0, __arg_1) native "CanvasRenderingContext2D_resetTransform_Callback";
-  resetTransform_Callback_2_(mthis, __arg_0, __arg_1) => resetTransform_Callback_2(mthis, __arg_0, __arg_1);
-
-  static restore_Callback_0(mthis) native "CanvasRenderingContext2D_restore_Callback";
-  restore_Callback_0_(mthis) => restore_Callback_0(mthis);
-
-  static restore_Callback_1(mthis, __arg_0) native "CanvasRenderingContext2D_restore_Callback";
-  restore_Callback_1_(mthis, __arg_0) => restore_Callback_1(mthis, __arg_0);
-
-  static restore_Callback_2(mthis, __arg_0, __arg_1) native "CanvasRenderingContext2D_restore_Callback";
-  restore_Callback_2_(mthis, __arg_0, __arg_1) => restore_Callback_2(mthis, __arg_0, __arg_1);
-
-  static rotate_Callback_0(mthis) native "CanvasRenderingContext2D_rotate_Callback";
-  rotate_Callback_0_(mthis) => rotate_Callback_0(mthis);
-
-  static rotate_Callback_1(mthis, __arg_0) native "CanvasRenderingContext2D_rotate_Callback";
-  rotate_Callback_1_(mthis, __arg_0) => rotate_Callback_1(mthis, __arg_0);
-
-  static rotate_Callback_2(mthis, __arg_0, __arg_1) native "CanvasRenderingContext2D_rotate_Callback";
-  rotate_Callback_2_(mthis, __arg_0, __arg_1) => rotate_Callback_2(mthis, __arg_0, __arg_1);
-
-  static rotate_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "CanvasRenderingContext2D_rotate_Callback";
-  rotate_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => rotate_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static save_Callback_0(mthis) native "CanvasRenderingContext2D_save_Callback";
-  save_Callback_0_(mthis) => save_Callback_0(mthis);
-
-  static save_Callback_1(mthis, __arg_0) native "CanvasRenderingContext2D_save_Callback";
-  save_Callback_1_(mthis, __arg_0) => save_Callback_1(mthis, __arg_0);
-
-  static save_Callback_2(mthis, __arg_0, __arg_1) native "CanvasRenderingContext2D_save_Callback";
-  save_Callback_2_(mthis, __arg_0, __arg_1) => save_Callback_2(mthis, __arg_0, __arg_1);
-
-  static scale_Callback_0(mthis) native "CanvasRenderingContext2D_scale_Callback";
-  scale_Callback_0_(mthis) => scale_Callback_0(mthis);
-
-  static scale_Callback_1(mthis, __arg_0) native "CanvasRenderingContext2D_scale_Callback";
-  scale_Callback_1_(mthis, __arg_0) => scale_Callback_1(mthis, __arg_0);
-
-  static scale_Callback_2(mthis, __arg_0, __arg_1) native "CanvasRenderingContext2D_scale_Callback";
-  scale_Callback_2_(mthis, __arg_0, __arg_1) => scale_Callback_2(mthis, __arg_0, __arg_1);
-
-  static scale_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "CanvasRenderingContext2D_scale_Callback";
-  scale_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => scale_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static scale_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "CanvasRenderingContext2D_scale_Callback";
-  scale_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => scale_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static scrollPathIntoView_Callback_0(mthis) native "CanvasRenderingContext2D_scrollPathIntoView_Callback";
-  scrollPathIntoView_Callback_0_(mthis) => scrollPathIntoView_Callback_0(mthis);
-
-  static scrollPathIntoView_Callback_1(mthis, __arg_0) native "CanvasRenderingContext2D_scrollPathIntoView_Callback";
-  scrollPathIntoView_Callback_1_(mthis, __arg_0) => scrollPathIntoView_Callback_1(mthis, __arg_0);
-
-  static scrollPathIntoView_Callback_2(mthis, __arg_0, __arg_1) native "CanvasRenderingContext2D_scrollPathIntoView_Callback";
-  scrollPathIntoView_Callback_2_(mthis, __arg_0, __arg_1) => scrollPathIntoView_Callback_2(mthis, __arg_0, __arg_1);
-
-  static scrollPathIntoView_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "CanvasRenderingContext2D_scrollPathIntoView_Callback";
-  scrollPathIntoView_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => scrollPathIntoView_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static setLineDash_Callback_0(mthis) native "CanvasRenderingContext2D_setLineDash_Callback";
-  setLineDash_Callback_0_(mthis) => setLineDash_Callback_0(mthis);
-
-  static setLineDash_Callback_1(mthis, __arg_0) native "CanvasRenderingContext2D_setLineDash_Callback";
-  setLineDash_Callback_1_(mthis, __arg_0) => setLineDash_Callback_1(mthis, __arg_0);
-
-  static setLineDash_Callback_2(mthis, __arg_0, __arg_1) native "CanvasRenderingContext2D_setLineDash_Callback";
-  setLineDash_Callback_2_(mthis, __arg_0, __arg_1) => setLineDash_Callback_2(mthis, __arg_0, __arg_1);
-
-  static setLineDash_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "CanvasRenderingContext2D_setLineDash_Callback";
-  setLineDash_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => setLineDash_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static setTransform_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "CanvasRenderingContext2D_setTransform_Callback";
-  setTransform_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => setTransform_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static setTransform_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "CanvasRenderingContext2D_setTransform_Callback";
-  setTransform_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => setTransform_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
-
-  static setTransform_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "CanvasRenderingContext2D_setTransform_Callback";
-  setTransform_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => setTransform_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
-
-  static setTransform_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) native "CanvasRenderingContext2D_setTransform_Callback";
-  setTransform_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => setTransform_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6);
-
-  static setTransform_Callback_8(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) native "CanvasRenderingContext2D_setTransform_Callback";
-  setTransform_Callback_8_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) => setTransform_Callback_8(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7);
-
-  static shadowBlur_Getter(mthis) native "CanvasRenderingContext2D_shadowBlur_Getter";
-  shadowBlur_Getter_(mthis) => shadowBlur_Getter(mthis);
-
-  static shadowBlur_Setter(mthis, __arg_0) native "CanvasRenderingContext2D_shadowBlur_Setter";
-  shadowBlur_Setter_(mthis, __arg_0) => shadowBlur_Setter(mthis, __arg_0);
-
-  static shadowColor_Getter(mthis) native "CanvasRenderingContext2D_shadowColor_Getter";
-  shadowColor_Getter_(mthis) => shadowColor_Getter(mthis);
+  scale_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "scale", [__arg_0, __arg_1]);
 
-  static shadowColor_Setter(mthis, __arg_0) native "CanvasRenderingContext2D_shadowColor_Setter";
-  shadowColor_Setter_(mthis, __arg_0) => shadowColor_Setter(mthis, __arg_0);
+  scrollPathIntoView_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "scrollPathIntoView", []);
 
-  static shadowOffsetX_Getter(mthis) native "CanvasRenderingContext2D_shadowOffsetX_Getter";
-  shadowOffsetX_Getter_(mthis) => shadowOffsetX_Getter(mthis);
+  scrollPathIntoView_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "scrollPathIntoView", [__arg_0]);
 
-  static shadowOffsetX_Setter(mthis, __arg_0) native "CanvasRenderingContext2D_shadowOffsetX_Setter";
-  shadowOffsetX_Setter_(mthis, __arg_0) => shadowOffsetX_Setter(mthis, __arg_0);
+  setLineDash_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "setLineDash", []);
 
-  static shadowOffsetY_Getter(mthis) native "CanvasRenderingContext2D_shadowOffsetY_Getter";
-  shadowOffsetY_Getter_(mthis) => shadowOffsetY_Getter(mthis);
+  setLineDash_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "setLineDash", [__arg_0]);
 
-  static shadowOffsetY_Setter(mthis, __arg_0) native "CanvasRenderingContext2D_shadowOffsetY_Setter";
-  shadowOffsetY_Setter_(mthis, __arg_0) => shadowOffsetY_Setter(mthis, __arg_0);
+  setTransform_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "setTransform", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static strokeRect_Callback_2(mthis, __arg_0, __arg_1) native "CanvasRenderingContext2D_strokeRect_Callback";
-  strokeRect_Callback_2_(mthis, __arg_0, __arg_1) => strokeRect_Callback_2(mthis, __arg_0, __arg_1);
+  setTransform_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => Blink_JsNative_DomException.callMethod(mthis, "setTransform", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4]);
 
-  static strokeRect_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "CanvasRenderingContext2D_strokeRect_Callback";
-  strokeRect_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => strokeRect_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  setTransform_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => Blink_JsNative_DomException.callMethod(mthis, "setTransform", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5]);
 
-  static strokeRect_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "CanvasRenderingContext2D_strokeRect_Callback";
-  strokeRect_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => strokeRect_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  shadowBlur_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "shadowBlur");
 
-  static strokeRect_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "CanvasRenderingContext2D_strokeRect_Callback";
-  strokeRect_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => strokeRect_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  shadowBlur_Setter_(mthis, __arg_0) => mthis["shadowBlur"] = __arg_0;
 
-  static strokeRect_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "CanvasRenderingContext2D_strokeRect_Callback";
-  strokeRect_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => strokeRect_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  shadowColor_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "shadowColor");
 
-  static strokeStyle_Getter(mthis) native "CanvasRenderingContext2D_strokeStyle_Getter";
-  strokeStyle_Getter_(mthis) => strokeStyle_Getter(mthis);
+  shadowColor_Setter_(mthis, __arg_0) => mthis["shadowColor"] = __arg_0;
 
-  static strokeStyle_Setter(mthis, __arg_0) native "CanvasRenderingContext2D_strokeStyle_Setter";
-  strokeStyle_Setter_(mthis, __arg_0) => strokeStyle_Setter(mthis, __arg_0);
+  shadowOffsetX_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "shadowOffsetX");
 
-  static strokeText_Callback_1(mthis, __arg_0) native "CanvasRenderingContext2D_strokeText_Callback";
-  strokeText_Callback_1_(mthis, __arg_0) => strokeText_Callback_1(mthis, __arg_0);
+  shadowOffsetX_Setter_(mthis, __arg_0) => mthis["shadowOffsetX"] = __arg_0;
 
-  static strokeText_Callback_2(mthis, __arg_0, __arg_1) native "CanvasRenderingContext2D_strokeText_Callback";
-  strokeText_Callback_2_(mthis, __arg_0, __arg_1) => strokeText_Callback_2(mthis, __arg_0, __arg_1);
+  shadowOffsetY_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "shadowOffsetY");
 
-  static strokeText_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "CanvasRenderingContext2D_strokeText_Callback";
-  strokeText_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => strokeText_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  shadowOffsetY_Setter_(mthis, __arg_0) => mthis["shadowOffsetY"] = __arg_0;
 
-  static strokeText_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "CanvasRenderingContext2D_strokeText_Callback";
-  strokeText_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => strokeText_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  strokeRect_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "strokeRect", [__arg_0, __arg_1]);
 
-  static strokeText_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "CanvasRenderingContext2D_strokeText_Callback";
-  strokeText_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => strokeText_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  strokeRect_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "strokeRect", [__arg_0, __arg_1, __arg_2]);
 
-  static strokeText_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "CanvasRenderingContext2D_strokeText_Callback";
-  strokeText_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => strokeText_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  strokeRect_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "strokeRect", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static stroke_Callback_0(mthis) native "CanvasRenderingContext2D_stroke_Callback";
-  stroke_Callback_0_(mthis) => stroke_Callback_0(mthis);
+  strokeStyle_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "strokeStyle");
 
-  static stroke_Callback_1(mthis, __arg_0) native "CanvasRenderingContext2D_stroke_Callback";
-  stroke_Callback_1_(mthis, __arg_0) => stroke_Callback_1(mthis, __arg_0);
+  strokeStyle_Setter_(mthis, __arg_0) => mthis["strokeStyle"] = __arg_0;
 
-  static stroke_Callback_2(mthis, __arg_0, __arg_1) native "CanvasRenderingContext2D_stroke_Callback";
-  stroke_Callback_2_(mthis, __arg_0, __arg_1) => stroke_Callback_2(mthis, __arg_0, __arg_1);
+  strokeText_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "strokeText", [__arg_0]);
 
-  static stroke_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "CanvasRenderingContext2D_stroke_Callback";
-  stroke_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => stroke_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  strokeText_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "strokeText", [__arg_0, __arg_1]);
 
-  static textAlign_Getter(mthis) native "CanvasRenderingContext2D_textAlign_Getter";
-  textAlign_Getter_(mthis) => textAlign_Getter(mthis);
+  strokeText_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "strokeText", [__arg_0, __arg_1, __arg_2]);
 
-  static textAlign_Setter(mthis, __arg_0) native "CanvasRenderingContext2D_textAlign_Setter";
-  textAlign_Setter_(mthis, __arg_0) => textAlign_Setter(mthis, __arg_0);
+  strokeText_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "strokeText", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static textBaseline_Getter(mthis) native "CanvasRenderingContext2D_textBaseline_Getter";
-  textBaseline_Getter_(mthis) => textBaseline_Getter(mthis);
+  stroke_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "stroke", []);
 
-  static textBaseline_Setter(mthis, __arg_0) native "CanvasRenderingContext2D_textBaseline_Setter";
-  textBaseline_Setter_(mthis, __arg_0) => textBaseline_Setter(mthis, __arg_0);
+  stroke_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "stroke", [__arg_0]);
 
-  static transform_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "CanvasRenderingContext2D_transform_Callback";
-  transform_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => transform_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  textAlign_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "textAlign");
 
-  static transform_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "CanvasRenderingContext2D_transform_Callback";
-  transform_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => transform_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  textAlign_Setter_(mthis, __arg_0) => mthis["textAlign"] = __arg_0;
 
-  static transform_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "CanvasRenderingContext2D_transform_Callback";
-  transform_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => transform_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  textBaseline_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "textBaseline");
 
-  static transform_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) native "CanvasRenderingContext2D_transform_Callback";
-  transform_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => transform_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6);
+  textBaseline_Setter_(mthis, __arg_0) => mthis["textBaseline"] = __arg_0;
 
-  static transform_Callback_8(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) native "CanvasRenderingContext2D_transform_Callback";
-  transform_Callback_8_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) => transform_Callback_8(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7);
+  transform_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "transform", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static translate_Callback_0(mthis) native "CanvasRenderingContext2D_translate_Callback";
-  translate_Callback_0_(mthis) => translate_Callback_0(mthis);
+  transform_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => Blink_JsNative_DomException.callMethod(mthis, "transform", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4]);
 
-  static translate_Callback_1(mthis, __arg_0) native "CanvasRenderingContext2D_translate_Callback";
-  translate_Callback_1_(mthis, __arg_0) => translate_Callback_1(mthis, __arg_0);
+  transform_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => Blink_JsNative_DomException.callMethod(mthis, "transform", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5]);
 
-  static translate_Callback_2(mthis, __arg_0, __arg_1) native "CanvasRenderingContext2D_translate_Callback";
-  translate_Callback_2_(mthis, __arg_0, __arg_1) => translate_Callback_2(mthis, __arg_0, __arg_1);
+  translate_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "translate", []);
 
-  static translate_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "CanvasRenderingContext2D_translate_Callback";
-  translate_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => translate_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  translate_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "translate", [__arg_0]);
 
-  static translate_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "CanvasRenderingContext2D_translate_Callback";
-  translate_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => translate_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  translate_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "translate", [__arg_0, __arg_1]);
 
 }
 
@@ -3534,3440 +2071,1846 @@
 class BlinkCharacterData extends BlinkNode {
   static final instance = new BlinkCharacterData();
 
-  static appendData_Callback_0(mthis) native "CharacterData_appendData_Callback";
-  appendData_Callback_0_(mthis) => appendData_Callback_0(mthis);
+  appendData_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "appendData", []);
 
-  static appendData_Callback_1(mthis, __arg_0) native "CharacterData_appendData_Callback";
-  appendData_Callback_1_(mthis, __arg_0) => appendData_Callback_1(mthis, __arg_0);
+  appendData_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "appendData", [__arg_0]);
 
-  static appendData_Callback_2(mthis, __arg_0, __arg_1) native "CharacterData_appendData_Callback";
-  appendData_Callback_2_(mthis, __arg_0, __arg_1) => appendData_Callback_2(mthis, __arg_0, __arg_1);
+  data_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "data");
 
-  static appendData_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "CharacterData_appendData_Callback";
-  appendData_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => appendData_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  data_Setter_(mthis, __arg_0) => mthis["data"] = __arg_0;
 
-  static data_Getter(mthis) native "CharacterData_data_Getter";
-  data_Getter_(mthis) => data_Getter(mthis);
+  deleteData_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "deleteData", []);
 
-  static data_Setter(mthis, __arg_0) native "CharacterData_data_Setter";
-  data_Setter_(mthis, __arg_0) => data_Setter(mthis, __arg_0);
+  deleteData_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "deleteData", [__arg_0]);
 
-  static deleteData_Callback_0(mthis) native "CharacterData_deleteData_Callback";
-  deleteData_Callback_0_(mthis) => deleteData_Callback_0(mthis);
+  deleteData_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "deleteData", [__arg_0, __arg_1]);
 
-  static deleteData_Callback_1(mthis, __arg_0) native "CharacterData_deleteData_Callback";
-  deleteData_Callback_1_(mthis, __arg_0) => deleteData_Callback_1(mthis, __arg_0);
+  insertData_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "insertData", []);
 
-  static deleteData_Callback_2(mthis, __arg_0, __arg_1) native "CharacterData_deleteData_Callback";
-  deleteData_Callback_2_(mthis, __arg_0, __arg_1) => deleteData_Callback_2(mthis, __arg_0, __arg_1);
+  insertData_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "insertData", [__arg_0]);
 
-  static deleteData_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "CharacterData_deleteData_Callback";
-  deleteData_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => deleteData_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  insertData_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "insertData", [__arg_0, __arg_1]);
 
-  static deleteData_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "CharacterData_deleteData_Callback";
-  deleteData_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => deleteData_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  length_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "length");
 
-  static insertData_Callback_0(mthis) native "CharacterData_insertData_Callback";
-  insertData_Callback_0_(mthis) => insertData_Callback_0(mthis);
+  nextElementSibling_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "nextElementSibling");
 
-  static insertData_Callback_1(mthis, __arg_0) native "CharacterData_insertData_Callback";
-  insertData_Callback_1_(mthis, __arg_0) => insertData_Callback_1(mthis, __arg_0);
+  previousElementSibling_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "previousElementSibling");
 
-  static insertData_Callback_2(mthis, __arg_0, __arg_1) native "CharacterData_insertData_Callback";
-  insertData_Callback_2_(mthis, __arg_0, __arg_1) => insertData_Callback_2(mthis, __arg_0, __arg_1);
+  replaceData_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "replaceData", [__arg_0]);
 
-  static insertData_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "CharacterData_insertData_Callback";
-  insertData_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => insertData_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  replaceData_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "replaceData", [__arg_0, __arg_1]);
 
-  static insertData_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "CharacterData_insertData_Callback";
-  insertData_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => insertData_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  replaceData_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "replaceData", [__arg_0, __arg_1, __arg_2]);
 
-  static length_Getter(mthis) native "CharacterData_length_Getter";
-  length_Getter_(mthis) => length_Getter(mthis);
+  substringData_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "substringData", []);
 
-  static nextElementSibling_Getter(mthis) native "CharacterData_nextElementSibling_Getter";
-  nextElementSibling_Getter_(mthis) => nextElementSibling_Getter(mthis);
+  substringData_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "substringData", [__arg_0]);
 
-  static previousElementSibling_Getter(mthis) native "CharacterData_previousElementSibling_Getter";
-  previousElementSibling_Getter_(mthis) => previousElementSibling_Getter(mthis);
-
-  static replaceData_Callback_1(mthis, __arg_0) native "CharacterData_replaceData_Callback";
-  replaceData_Callback_1_(mthis, __arg_0) => replaceData_Callback_1(mthis, __arg_0);
-
-  static replaceData_Callback_2(mthis, __arg_0, __arg_1) native "CharacterData_replaceData_Callback";
-  replaceData_Callback_2_(mthis, __arg_0, __arg_1) => replaceData_Callback_2(mthis, __arg_0, __arg_1);
-
-  static replaceData_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "CharacterData_replaceData_Callback";
-  replaceData_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => replaceData_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static replaceData_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "CharacterData_replaceData_Callback";
-  replaceData_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => replaceData_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static replaceData_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "CharacterData_replaceData_Callback";
-  replaceData_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => replaceData_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
-
-  static substringData_Callback_0(mthis) native "CharacterData_substringData_Callback";
-  substringData_Callback_0_(mthis) => substringData_Callback_0(mthis);
-
-  static substringData_Callback_1(mthis, __arg_0) native "CharacterData_substringData_Callback";
-  substringData_Callback_1_(mthis, __arg_0) => substringData_Callback_1(mthis, __arg_0);
-
-  static substringData_Callback_2(mthis, __arg_0, __arg_1) native "CharacterData_substringData_Callback";
-  substringData_Callback_2_(mthis, __arg_0, __arg_1) => substringData_Callback_2(mthis, __arg_0, __arg_1);
-
-  static substringData_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "CharacterData_substringData_Callback";
-  substringData_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => substringData_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static substringData_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "CharacterData_substringData_Callback";
-  substringData_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => substringData_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  substringData_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "substringData", [__arg_0, __arg_1]);
 
 }
 
 class BlinkCircularGeofencingRegion extends BlinkGeofencingRegion {
   static final instance = new BlinkCircularGeofencingRegion();
 
-  static constructorCallback_0() native "CircularGeofencingRegion_constructorCallback";
-  constructorCallback_0_() => constructorCallback_0();
+  constructorCallback_0_() => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "CircularGeofencingRegion"), []);
 
-  static constructorCallback_1(__arg_0) native "CircularGeofencingRegion_constructorCallback";
-  constructorCallback_1_(__arg_0) => constructorCallback_1(__arg_0);
+  constructorCallback_1_(__arg_0) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "CircularGeofencingRegion"), [__arg_0]);
 
-  static constructorCallback_2(__arg_0, __arg_1) native "CircularGeofencingRegion_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  latitude_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "latitude");
 
-  static constructorCallback_3(__arg_0, __arg_1, __arg_2) native "CircularGeofencingRegion_constructorCallback";
-  constructorCallback_3_(__arg_0, __arg_1, __arg_2) => constructorCallback_3(__arg_0, __arg_1, __arg_2);
+  longitude_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "longitude");
 
-  static latitude_Getter(mthis) native "CircularGeofencingRegion_latitude_Getter";
-  latitude_Getter_(mthis) => latitude_Getter(mthis);
-
-  static longitude_Getter(mthis) native "CircularGeofencingRegion_longitude_Getter";
-  longitude_Getter_(mthis) => longitude_Getter(mthis);
-
-  static radius_Getter(mthis) native "CircularGeofencingRegion_radius_Getter";
-  radius_Getter_(mthis) => radius_Getter(mthis);
+  radius_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "radius");
 
 }
 
 class BlinkClientRect {
   static final instance = new BlinkClientRect();
 
-  static bottom_Getter(mthis) native "ClientRect_bottom_Getter";
-  bottom_Getter_(mthis) => bottom_Getter(mthis);
+  bottom_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "bottom");
 
-  static height_Getter(mthis) native "ClientRect_height_Getter";
-  height_Getter_(mthis) => height_Getter(mthis);
+  height_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "height");
 
-  static left_Getter(mthis) native "ClientRect_left_Getter";
-  left_Getter_(mthis) => left_Getter(mthis);
+  left_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "left");
 
-  static right_Getter(mthis) native "ClientRect_right_Getter";
-  right_Getter_(mthis) => right_Getter(mthis);
+  right_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "right");
 
-  static top_Getter(mthis) native "ClientRect_top_Getter";
-  top_Getter_(mthis) => top_Getter(mthis);
+  top_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "top");
 
-  static width_Getter(mthis) native "ClientRect_width_Getter";
-  width_Getter_(mthis) => width_Getter(mthis);
+  width_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "width");
 
 }
 
 class BlinkClientRectList {
   static final instance = new BlinkClientRectList();
 
-  static $__getter___Callback_1(mthis, __arg_0) native "ClientRectList___getter___Callback";
-  $__getter___Callback_1_(mthis, __arg_0) => $__getter___Callback_1(mthis, __arg_0);
+  $__getter___Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "__getter__", [__arg_0]);
 
-  static item_Callback_0(mthis) native "ClientRectList_item_Callback";
-  item_Callback_0_(mthis) => item_Callback_0(mthis);
+  item_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "item", []);
 
-  static item_Callback_1(mthis, __arg_0) native "ClientRectList_item_Callback";
-  item_Callback_1_(mthis, __arg_0) => item_Callback_1(mthis, __arg_0);
+  item_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "item", [__arg_0]);
 
-  static item_Callback_2(mthis, __arg_0, __arg_1) native "ClientRectList_item_Callback";
-  item_Callback_2_(mthis, __arg_0, __arg_1) => item_Callback_2(mthis, __arg_0, __arg_1);
-
-  static item_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "ClientRectList_item_Callback";
-  item_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => item_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static length_Getter(mthis) native "ClientRectList_length_Getter";
-  length_Getter_(mthis) => length_Getter(mthis);
+  length_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "length");
 
 }
 
 class BlinkCloseEvent extends BlinkEvent {
   static final instance = new BlinkCloseEvent();
 
-  static code_Getter(mthis) native "CloseEvent_code_Getter";
-  code_Getter_(mthis) => code_Getter(mthis);
+  code_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "code");
 
-  static constructorCallback_2(__arg_0, __arg_1) native "CloseEvent_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  constructorCallback_2_(__arg_0, __arg_1) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "CloseEvent"), [__arg_0, __arg_1]);
 
-  static reason_Getter(mthis) native "CloseEvent_reason_Getter";
-  reason_Getter_(mthis) => reason_Getter(mthis);
+  reason_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "reason");
 
-  static wasClean_Getter(mthis) native "CloseEvent_wasClean_Getter";
-  wasClean_Getter_(mthis) => wasClean_Getter(mthis);
+  wasClean_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "wasClean");
 
 }
 
 class BlinkComment extends BlinkCharacterData {
   static final instance = new BlinkComment();
 
-  static constructorCallback_0() native "Comment_constructorCallback";
-  constructorCallback_0_() => constructorCallback_0();
+  constructorCallback_0_() => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "Comment"), []);
 
-  static constructorCallback_1(__arg_0) native "Comment_constructorCallback";
-  constructorCallback_1_(__arg_0) => constructorCallback_1(__arg_0);
-
-  static constructorCallback_2(__arg_0, __arg_1) native "Comment_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
-
-  static constructorCallback_3(__arg_0, __arg_1, __arg_2) native "Comment_constructorCallback";
-  constructorCallback_3_(__arg_0, __arg_1, __arg_2) => constructorCallback_3(__arg_0, __arg_1, __arg_2);
+  constructorCallback_1_(__arg_0) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "Comment"), [__arg_0]);
 
 }
 
 class BlinkCompositionEvent extends BlinkUIEvent {
   static final instance = new BlinkCompositionEvent();
 
-  static activeSegmentEnd_Getter(mthis) native "CompositionEvent_activeSegmentEnd_Getter";
-  activeSegmentEnd_Getter_(mthis) => activeSegmentEnd_Getter(mthis);
+  activeSegmentEnd_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "activeSegmentEnd");
 
-  static activeSegmentStart_Getter(mthis) native "CompositionEvent_activeSegmentStart_Getter";
-  activeSegmentStart_Getter_(mthis) => activeSegmentStart_Getter(mthis);
+  activeSegmentStart_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "activeSegmentStart");
 
-  static constructorCallback_2(__arg_0, __arg_1) native "CompositionEvent_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  constructorCallback_2_(__arg_0, __arg_1) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "CompositionEvent"), [__arg_0, __arg_1]);
 
-  static data_Getter(mthis) native "CompositionEvent_data_Getter";
-  data_Getter_(mthis) => data_Getter(mthis);
+  data_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "data");
 
-  static getSegments_Callback_0(mthis) native "CompositionEvent_getSegments_Callback";
-  getSegments_Callback_0_(mthis) => getSegments_Callback_0(mthis);
+  getSegments_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getSegments", []);
 
-  static getSegments_Callback_1(mthis, __arg_0) native "CompositionEvent_getSegments_Callback";
-  getSegments_Callback_1_(mthis, __arg_0) => getSegments_Callback_1(mthis, __arg_0);
+  initCompositionEvent_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "initCompositionEvent", []);
 
-  static getSegments_Callback_2(mthis, __arg_0, __arg_1) native "CompositionEvent_getSegments_Callback";
-  getSegments_Callback_2_(mthis, __arg_0, __arg_1) => getSegments_Callback_2(mthis, __arg_0, __arg_1);
+  initCompositionEvent_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "initCompositionEvent", [__arg_0]);
 
-  static initCompositionEvent_Callback_0(mthis) native "CompositionEvent_initCompositionEvent_Callback";
-  initCompositionEvent_Callback_0_(mthis) => initCompositionEvent_Callback_0(mthis);
+  initCompositionEvent_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "initCompositionEvent", [__arg_0, __arg_1]);
 
-  static initCompositionEvent_Callback_1(mthis, __arg_0) native "CompositionEvent_initCompositionEvent_Callback";
-  initCompositionEvent_Callback_1_(mthis, __arg_0) => initCompositionEvent_Callback_1(mthis, __arg_0);
+  initCompositionEvent_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "initCompositionEvent", [__arg_0, __arg_1, __arg_2]);
 
-  static initCompositionEvent_Callback_2(mthis, __arg_0, __arg_1) native "CompositionEvent_initCompositionEvent_Callback";
-  initCompositionEvent_Callback_2_(mthis, __arg_0, __arg_1) => initCompositionEvent_Callback_2(mthis, __arg_0, __arg_1);
+  initCompositionEvent_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "initCompositionEvent", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static initCompositionEvent_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "CompositionEvent_initCompositionEvent_Callback";
-  initCompositionEvent_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => initCompositionEvent_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static initCompositionEvent_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "CompositionEvent_initCompositionEvent_Callback";
-  initCompositionEvent_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => initCompositionEvent_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static initCompositionEvent_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "CompositionEvent_initCompositionEvent_Callback";
-  initCompositionEvent_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => initCompositionEvent_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
-
-  static initCompositionEvent_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "CompositionEvent_initCompositionEvent_Callback";
-  initCompositionEvent_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => initCompositionEvent_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
-
-  static initCompositionEvent_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) native "CompositionEvent_initCompositionEvent_Callback";
-  initCompositionEvent_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => initCompositionEvent_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6);
+  initCompositionEvent_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => Blink_JsNative_DomException.callMethod(mthis, "initCompositionEvent", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4]);
 
 }
 
 class BlinkConsole extends BlinkConsoleBase {
   static final instance = new BlinkConsole();
 
-  static memory_Getter(mthis) native "Console_memory_Getter";
-  memory_Getter_(mthis) => memory_Getter(mthis);
+  memory_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "memory");
 
 }
 
 class BlinkConsoleBase {
   static final instance = new BlinkConsoleBase();
 
-  static assert_Callback_0(mthis) native "ConsoleBase_assert_Callback";
-  assert_Callback_0_(mthis) => assert_Callback_0(mthis);
+  assert_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "assert", []);
 
-  static assert_Callback_1(mthis, __arg_0) native "ConsoleBase_assert_Callback";
-  assert_Callback_1_(mthis, __arg_0) => assert_Callback_1(mthis, __arg_0);
+  assert_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "assert", [__arg_0]);
 
-  static assert_Callback_2(mthis, __arg_0, __arg_1) native "ConsoleBase_assert_Callback";
-  assert_Callback_2_(mthis, __arg_0, __arg_1) => assert_Callback_2(mthis, __arg_0, __arg_1);
+  clear_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "clear", []);
 
-  static assert_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "ConsoleBase_assert_Callback";
-  assert_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => assert_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  clear_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "clear", [__arg_0]);
 
-  static clear_Callback_0(mthis) native "ConsoleBase_clear_Callback";
-  clear_Callback_0_(mthis) => clear_Callback_0(mthis);
+  count_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "count", []);
 
-  static clear_Callback_1(mthis, __arg_0) native "ConsoleBase_clear_Callback";
-  clear_Callback_1_(mthis, __arg_0) => clear_Callback_1(mthis, __arg_0);
+  count_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "count", [__arg_0]);
 
-  static clear_Callback_2(mthis, __arg_0, __arg_1) native "ConsoleBase_clear_Callback";
-  clear_Callback_2_(mthis, __arg_0, __arg_1) => clear_Callback_2(mthis, __arg_0, __arg_1);
+  debug_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "debug", []);
 
-  static count_Callback_0(mthis) native "ConsoleBase_count_Callback";
-  count_Callback_0_(mthis) => count_Callback_0(mthis);
+  debug_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "debug", [__arg_0]);
 
-  static count_Callback_1(mthis, __arg_0) native "ConsoleBase_count_Callback";
-  count_Callback_1_(mthis, __arg_0) => count_Callback_1(mthis, __arg_0);
+  dir_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "dir", []);
 
-  static count_Callback_2(mthis, __arg_0, __arg_1) native "ConsoleBase_count_Callback";
-  count_Callback_2_(mthis, __arg_0, __arg_1) => count_Callback_2(mthis, __arg_0, __arg_1);
+  dir_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "dir", [__arg_0]);
 
-  static debug_Callback_0(mthis) native "ConsoleBase_debug_Callback";
-  debug_Callback_0_(mthis) => debug_Callback_0(mthis);
+  dirxml_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "dirxml", []);
 
-  static debug_Callback_1(mthis, __arg_0) native "ConsoleBase_debug_Callback";
-  debug_Callback_1_(mthis, __arg_0) => debug_Callback_1(mthis, __arg_0);
+  dirxml_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "dirxml", [__arg_0]);
 
-  static debug_Callback_2(mthis, __arg_0, __arg_1) native "ConsoleBase_debug_Callback";
-  debug_Callback_2_(mthis, __arg_0, __arg_1) => debug_Callback_2(mthis, __arg_0, __arg_1);
+  error_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "error", []);
 
-  static dir_Callback_0(mthis) native "ConsoleBase_dir_Callback";
-  dir_Callback_0_(mthis) => dir_Callback_0(mthis);
+  error_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "error", [__arg_0]);
 
-  static dir_Callback_1(mthis, __arg_0) native "ConsoleBase_dir_Callback";
-  dir_Callback_1_(mthis, __arg_0) => dir_Callback_1(mthis, __arg_0);
+  groupCollapsed_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "groupCollapsed", []);
 
-  static dir_Callback_2(mthis, __arg_0, __arg_1) native "ConsoleBase_dir_Callback";
-  dir_Callback_2_(mthis, __arg_0, __arg_1) => dir_Callback_2(mthis, __arg_0, __arg_1);
+  groupCollapsed_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "groupCollapsed", [__arg_0]);
 
-  static dirxml_Callback_0(mthis) native "ConsoleBase_dirxml_Callback";
-  dirxml_Callback_0_(mthis) => dirxml_Callback_0(mthis);
+  groupEnd_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "groupEnd", []);
 
-  static dirxml_Callback_1(mthis, __arg_0) native "ConsoleBase_dirxml_Callback";
-  dirxml_Callback_1_(mthis, __arg_0) => dirxml_Callback_1(mthis, __arg_0);
+  group_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "group", []);
 
-  static dirxml_Callback_2(mthis, __arg_0, __arg_1) native "ConsoleBase_dirxml_Callback";
-  dirxml_Callback_2_(mthis, __arg_0, __arg_1) => dirxml_Callback_2(mthis, __arg_0, __arg_1);
+  group_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "group", [__arg_0]);
 
-  static error_Callback_0(mthis) native "ConsoleBase_error_Callback";
-  error_Callback_0_(mthis) => error_Callback_0(mthis);
+  info_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "info", []);
 
-  static error_Callback_1(mthis, __arg_0) native "ConsoleBase_error_Callback";
-  error_Callback_1_(mthis, __arg_0) => error_Callback_1(mthis, __arg_0);
+  info_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "info", [__arg_0]);
 
-  static error_Callback_2(mthis, __arg_0, __arg_1) native "ConsoleBase_error_Callback";
-  error_Callback_2_(mthis, __arg_0, __arg_1) => error_Callback_2(mthis, __arg_0, __arg_1);
+  log_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "log", []);
 
-  static groupCollapsed_Callback_0(mthis) native "ConsoleBase_groupCollapsed_Callback";
-  groupCollapsed_Callback_0_(mthis) => groupCollapsed_Callback_0(mthis);
+  log_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "log", [__arg_0]);
 
-  static groupCollapsed_Callback_1(mthis, __arg_0) native "ConsoleBase_groupCollapsed_Callback";
-  groupCollapsed_Callback_1_(mthis, __arg_0) => groupCollapsed_Callback_1(mthis, __arg_0);
+  markTimeline_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "markTimeline", []);
 
-  static groupCollapsed_Callback_2(mthis, __arg_0, __arg_1) native "ConsoleBase_groupCollapsed_Callback";
-  groupCollapsed_Callback_2_(mthis, __arg_0, __arg_1) => groupCollapsed_Callback_2(mthis, __arg_0, __arg_1);
+  markTimeline_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "markTimeline", [__arg_0]);
 
-  static groupEnd_Callback_0(mthis) native "ConsoleBase_groupEnd_Callback";
-  groupEnd_Callback_0_(mthis) => groupEnd_Callback_0(mthis);
+  profileEnd_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "profileEnd", []);
 
-  static groupEnd_Callback_1(mthis, __arg_0) native "ConsoleBase_groupEnd_Callback";
-  groupEnd_Callback_1_(mthis, __arg_0) => groupEnd_Callback_1(mthis, __arg_0);
+  profileEnd_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "profileEnd", [__arg_0]);
 
-  static groupEnd_Callback_2(mthis, __arg_0, __arg_1) native "ConsoleBase_groupEnd_Callback";
-  groupEnd_Callback_2_(mthis, __arg_0, __arg_1) => groupEnd_Callback_2(mthis, __arg_0, __arg_1);
+  profile_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "profile", []);
 
-  static group_Callback_0(mthis) native "ConsoleBase_group_Callback";
-  group_Callback_0_(mthis) => group_Callback_0(mthis);
+  profile_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "profile", [__arg_0]);
 
-  static group_Callback_1(mthis, __arg_0) native "ConsoleBase_group_Callback";
-  group_Callback_1_(mthis, __arg_0) => group_Callback_1(mthis, __arg_0);
+  table_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "table", []);
 
-  static group_Callback_2(mthis, __arg_0, __arg_1) native "ConsoleBase_group_Callback";
-  group_Callback_2_(mthis, __arg_0, __arg_1) => group_Callback_2(mthis, __arg_0, __arg_1);
+  table_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "table", [__arg_0]);
 
-  static info_Callback_0(mthis) native "ConsoleBase_info_Callback";
-  info_Callback_0_(mthis) => info_Callback_0(mthis);
+  timeEnd_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "timeEnd", []);
 
-  static info_Callback_1(mthis, __arg_0) native "ConsoleBase_info_Callback";
-  info_Callback_1_(mthis, __arg_0) => info_Callback_1(mthis, __arg_0);
+  timeEnd_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "timeEnd", [__arg_0]);
 
-  static info_Callback_2(mthis, __arg_0, __arg_1) native "ConsoleBase_info_Callback";
-  info_Callback_2_(mthis, __arg_0, __arg_1) => info_Callback_2(mthis, __arg_0, __arg_1);
+  timeStamp_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "timeStamp", []);
 
-  static log_Callback_0(mthis) native "ConsoleBase_log_Callback";
-  log_Callback_0_(mthis) => log_Callback_0(mthis);
+  timeStamp_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "timeStamp", [__arg_0]);
 
-  static log_Callback_1(mthis, __arg_0) native "ConsoleBase_log_Callback";
-  log_Callback_1_(mthis, __arg_0) => log_Callback_1(mthis, __arg_0);
+  time_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "time", []);
 
-  static log_Callback_2(mthis, __arg_0, __arg_1) native "ConsoleBase_log_Callback";
-  log_Callback_2_(mthis, __arg_0, __arg_1) => log_Callback_2(mthis, __arg_0, __arg_1);
+  time_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "time", [__arg_0]);
 
-  static markTimeline_Callback_0(mthis) native "ConsoleBase_markTimeline_Callback";
-  markTimeline_Callback_0_(mthis) => markTimeline_Callback_0(mthis);
+  timelineEnd_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "timelineEnd", []);
 
-  static markTimeline_Callback_1(mthis, __arg_0) native "ConsoleBase_markTimeline_Callback";
-  markTimeline_Callback_1_(mthis, __arg_0) => markTimeline_Callback_1(mthis, __arg_0);
-
-  static markTimeline_Callback_2(mthis, __arg_0, __arg_1) native "ConsoleBase_markTimeline_Callback";
-  markTimeline_Callback_2_(mthis, __arg_0, __arg_1) => markTimeline_Callback_2(mthis, __arg_0, __arg_1);
-
-  static markTimeline_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "ConsoleBase_markTimeline_Callback";
-  markTimeline_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => markTimeline_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static profileEnd_Callback_0(mthis) native "ConsoleBase_profileEnd_Callback";
-  profileEnd_Callback_0_(mthis) => profileEnd_Callback_0(mthis);
-
-  static profileEnd_Callback_1(mthis, __arg_0) native "ConsoleBase_profileEnd_Callback";
-  profileEnd_Callback_1_(mthis, __arg_0) => profileEnd_Callback_1(mthis, __arg_0);
-
-  static profileEnd_Callback_2(mthis, __arg_0, __arg_1) native "ConsoleBase_profileEnd_Callback";
-  profileEnd_Callback_2_(mthis, __arg_0, __arg_1) => profileEnd_Callback_2(mthis, __arg_0, __arg_1);
-
-  static profileEnd_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "ConsoleBase_profileEnd_Callback";
-  profileEnd_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => profileEnd_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static profile_Callback_0(mthis) native "ConsoleBase_profile_Callback";
-  profile_Callback_0_(mthis) => profile_Callback_0(mthis);
-
-  static profile_Callback_1(mthis, __arg_0) native "ConsoleBase_profile_Callback";
-  profile_Callback_1_(mthis, __arg_0) => profile_Callback_1(mthis, __arg_0);
-
-  static profile_Callback_2(mthis, __arg_0, __arg_1) native "ConsoleBase_profile_Callback";
-  profile_Callback_2_(mthis, __arg_0, __arg_1) => profile_Callback_2(mthis, __arg_0, __arg_1);
-
-  static profile_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "ConsoleBase_profile_Callback";
-  profile_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => profile_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static table_Callback_0(mthis) native "ConsoleBase_table_Callback";
-  table_Callback_0_(mthis) => table_Callback_0(mthis);
-
-  static table_Callback_1(mthis, __arg_0) native "ConsoleBase_table_Callback";
-  table_Callback_1_(mthis, __arg_0) => table_Callback_1(mthis, __arg_0);
-
-  static table_Callback_2(mthis, __arg_0, __arg_1) native "ConsoleBase_table_Callback";
-  table_Callback_2_(mthis, __arg_0, __arg_1) => table_Callback_2(mthis, __arg_0, __arg_1);
-
-  static timeEnd_Callback_0(mthis) native "ConsoleBase_timeEnd_Callback";
-  timeEnd_Callback_0_(mthis) => timeEnd_Callback_0(mthis);
-
-  static timeEnd_Callback_1(mthis, __arg_0) native "ConsoleBase_timeEnd_Callback";
-  timeEnd_Callback_1_(mthis, __arg_0) => timeEnd_Callback_1(mthis, __arg_0);
-
-  static timeEnd_Callback_2(mthis, __arg_0, __arg_1) native "ConsoleBase_timeEnd_Callback";
-  timeEnd_Callback_2_(mthis, __arg_0, __arg_1) => timeEnd_Callback_2(mthis, __arg_0, __arg_1);
-
-  static timeEnd_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "ConsoleBase_timeEnd_Callback";
-  timeEnd_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => timeEnd_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static timeStamp_Callback_0(mthis) native "ConsoleBase_timeStamp_Callback";
-  timeStamp_Callback_0_(mthis) => timeStamp_Callback_0(mthis);
-
-  static timeStamp_Callback_1(mthis, __arg_0) native "ConsoleBase_timeStamp_Callback";
-  timeStamp_Callback_1_(mthis, __arg_0) => timeStamp_Callback_1(mthis, __arg_0);
-
-  static timeStamp_Callback_2(mthis, __arg_0, __arg_1) native "ConsoleBase_timeStamp_Callback";
-  timeStamp_Callback_2_(mthis, __arg_0, __arg_1) => timeStamp_Callback_2(mthis, __arg_0, __arg_1);
-
-  static timeStamp_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "ConsoleBase_timeStamp_Callback";
-  timeStamp_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => timeStamp_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static time_Callback_0(mthis) native "ConsoleBase_time_Callback";
-  time_Callback_0_(mthis) => time_Callback_0(mthis);
-
-  static time_Callback_1(mthis, __arg_0) native "ConsoleBase_time_Callback";
-  time_Callback_1_(mthis, __arg_0) => time_Callback_1(mthis, __arg_0);
-
-  static time_Callback_2(mthis, __arg_0, __arg_1) native "ConsoleBase_time_Callback";
-  time_Callback_2_(mthis, __arg_0, __arg_1) => time_Callback_2(mthis, __arg_0, __arg_1);
-
-  static time_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "ConsoleBase_time_Callback";
-  time_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => time_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static timelineEnd_Callback_0(mthis) native "ConsoleBase_timelineEnd_Callback";
-  timelineEnd_Callback_0_(mthis) => timelineEnd_Callback_0(mthis);
-
-  static timelineEnd_Callback_1(mthis, __arg_0) native "ConsoleBase_timelineEnd_Callback";
-  timelineEnd_Callback_1_(mthis, __arg_0) => timelineEnd_Callback_1(mthis, __arg_0);
-
-  static timelineEnd_Callback_2(mthis, __arg_0, __arg_1) native "ConsoleBase_timelineEnd_Callback";
-  timelineEnd_Callback_2_(mthis, __arg_0, __arg_1) => timelineEnd_Callback_2(mthis, __arg_0, __arg_1);
-
-  static timelineEnd_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "ConsoleBase_timelineEnd_Callback";
-  timelineEnd_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => timelineEnd_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static timeline_Callback_0(mthis) native "ConsoleBase_timeline_Callback";
-  timeline_Callback_0_(mthis) => timeline_Callback_0(mthis);
-
-  static timeline_Callback_1(mthis, __arg_0) native "ConsoleBase_timeline_Callback";
-  timeline_Callback_1_(mthis, __arg_0) => timeline_Callback_1(mthis, __arg_0);
-
-  static timeline_Callback_2(mthis, __arg_0, __arg_1) native "ConsoleBase_timeline_Callback";
-  timeline_Callback_2_(mthis, __arg_0, __arg_1) => timeline_Callback_2(mthis, __arg_0, __arg_1);
-
-  static timeline_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "ConsoleBase_timeline_Callback";
-  timeline_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => timeline_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  timelineEnd_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "timelineEnd", [__arg_0]);
 
-  static trace_Callback_0(mthis) native "ConsoleBase_trace_Callback";
-  trace_Callback_0_(mthis) => trace_Callback_0(mthis);
+  timeline_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "timeline", []);
 
-  static trace_Callback_1(mthis, __arg_0) native "ConsoleBase_trace_Callback";
-  trace_Callback_1_(mthis, __arg_0) => trace_Callback_1(mthis, __arg_0);
+  timeline_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "timeline", [__arg_0]);
 
-  static trace_Callback_2(mthis, __arg_0, __arg_1) native "ConsoleBase_trace_Callback";
-  trace_Callback_2_(mthis, __arg_0, __arg_1) => trace_Callback_2(mthis, __arg_0, __arg_1);
+  trace_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "trace", []);
 
-  static warn_Callback_0(mthis) native "ConsoleBase_warn_Callback";
-  warn_Callback_0_(mthis) => warn_Callback_0(mthis);
+  trace_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "trace", [__arg_0]);
 
-  static warn_Callback_1(mthis, __arg_0) native "ConsoleBase_warn_Callback";
-  warn_Callback_1_(mthis, __arg_0) => warn_Callback_1(mthis, __arg_0);
+  warn_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "warn", []);
 
-  static warn_Callback_2(mthis, __arg_0, __arg_1) native "ConsoleBase_warn_Callback";
-  warn_Callback_2_(mthis, __arg_0, __arg_1) => warn_Callback_2(mthis, __arg_0, __arg_1);
+  warn_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "warn", [__arg_0]);
 
 }
 
 class BlinkConvolverNode extends BlinkAudioNode {
   static final instance = new BlinkConvolverNode();
 
-  static buffer_Getter(mthis) native "ConvolverNode_buffer_Getter";
-  buffer_Getter_(mthis) => buffer_Getter(mthis);
+  buffer_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "buffer");
 
-  static buffer_Setter(mthis, __arg_0) native "ConvolverNode_buffer_Setter";
-  buffer_Setter_(mthis, __arg_0) => buffer_Setter(mthis, __arg_0);
+  buffer_Setter_(mthis, __arg_0) => mthis["buffer"] = __arg_0;
 
-  static normalize_Getter(mthis) native "ConvolverNode_normalize_Getter";
-  normalize_Getter_(mthis) => normalize_Getter(mthis);
+  normalize_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "normalize");
 
-  static normalize_Setter(mthis, __arg_0) native "ConvolverNode_normalize_Setter";
-  normalize_Setter_(mthis, __arg_0) => normalize_Setter(mthis, __arg_0);
+  normalize_Setter_(mthis, __arg_0) => mthis["normalize"] = __arg_0;
 
 }
 
 class BlinkCoordinates {
   static final instance = new BlinkCoordinates();
 
-  static accuracy_Getter(mthis) native "Coordinates_accuracy_Getter";
-  accuracy_Getter_(mthis) => accuracy_Getter(mthis);
+  accuracy_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "accuracy");
 
-  static altitudeAccuracy_Getter(mthis) native "Coordinates_altitudeAccuracy_Getter";
-  altitudeAccuracy_Getter_(mthis) => altitudeAccuracy_Getter(mthis);
+  altitudeAccuracy_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "altitudeAccuracy");
 
-  static altitude_Getter(mthis) native "Coordinates_altitude_Getter";
-  altitude_Getter_(mthis) => altitude_Getter(mthis);
+  altitude_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "altitude");
 
-  static heading_Getter(mthis) native "Coordinates_heading_Getter";
-  heading_Getter_(mthis) => heading_Getter(mthis);
+  heading_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "heading");
 
-  static latitude_Getter(mthis) native "Coordinates_latitude_Getter";
-  latitude_Getter_(mthis) => latitude_Getter(mthis);
+  latitude_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "latitude");
 
-  static longitude_Getter(mthis) native "Coordinates_longitude_Getter";
-  longitude_Getter_(mthis) => longitude_Getter(mthis);
+  longitude_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "longitude");
 
-  static speed_Getter(mthis) native "Coordinates_speed_Getter";
-  speed_Getter_(mthis) => speed_Getter(mthis);
+  speed_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "speed");
 
 }
 
 class BlinkCounter {
   static final instance = new BlinkCounter();
 
-  static identifier_Getter(mthis) native "Counter_identifier_Getter";
-  identifier_Getter_(mthis) => identifier_Getter(mthis);
+  identifier_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "identifier");
 
-  static listStyle_Getter(mthis) native "Counter_listStyle_Getter";
-  listStyle_Getter_(mthis) => listStyle_Getter(mthis);
+  listStyle_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "listStyle");
 
-  static separator_Getter(mthis) native "Counter_separator_Getter";
-  separator_Getter_(mthis) => separator_Getter(mthis);
+  separator_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "separator");
 
 }
 
 class BlinkCredential {
   static final instance = new BlinkCredential();
 
-  static avatarURL_Getter(mthis) native "Credential_avatarURL_Getter";
-  avatarURL_Getter_(mthis) => avatarURL_Getter(mthis);
+  avatarURL_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "avatarURL");
 
-  static id_Getter(mthis) native "Credential_id_Getter";
-  id_Getter_(mthis) => id_Getter(mthis);
+  id_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "id");
 
-  static name_Getter(mthis) native "Credential_name_Getter";
-  name_Getter_(mthis) => name_Getter(mthis);
+  name_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "name");
 
 }
 
 class BlinkCredentialsContainer {
   static final instance = new BlinkCredentialsContainer();
 
-  static notifyFailedSignIn_Callback_0(mthis) native "CredentialsContainer_notifyFailedSignIn_Callback";
-  notifyFailedSignIn_Callback_0_(mthis) => notifyFailedSignIn_Callback_0(mthis);
+  notifyFailedSignIn_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "notifyFailedSignIn", []);
 
-  static notifyFailedSignIn_Callback_1(mthis, __arg_0) native "CredentialsContainer_notifyFailedSignIn_Callback";
-  notifyFailedSignIn_Callback_1_(mthis, __arg_0) => notifyFailedSignIn_Callback_1(mthis, __arg_0);
+  notifyFailedSignIn_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "notifyFailedSignIn", [__arg_0]);
 
-  static notifyFailedSignIn_Callback_2(mthis, __arg_0, __arg_1) native "CredentialsContainer_notifyFailedSignIn_Callback";
-  notifyFailedSignIn_Callback_2_(mthis, __arg_0, __arg_1) => notifyFailedSignIn_Callback_2(mthis, __arg_0, __arg_1);
+  notifySignedIn_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "notifySignedIn", []);
 
-  static notifyFailedSignIn_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "CredentialsContainer_notifyFailedSignIn_Callback";
-  notifyFailedSignIn_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => notifyFailedSignIn_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  notifySignedIn_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "notifySignedIn", [__arg_0]);
 
-  static notifySignedIn_Callback_0(mthis) native "CredentialsContainer_notifySignedIn_Callback";
-  notifySignedIn_Callback_0_(mthis) => notifySignedIn_Callback_0(mthis);
+  notifySignedOut_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "notifySignedOut", []);
 
-  static notifySignedIn_Callback_1(mthis, __arg_0) native "CredentialsContainer_notifySignedIn_Callback";
-  notifySignedIn_Callback_1_(mthis, __arg_0) => notifySignedIn_Callback_1(mthis, __arg_0);
+  request_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "request", []);
 
-  static notifySignedIn_Callback_2(mthis, __arg_0, __arg_1) native "CredentialsContainer_notifySignedIn_Callback";
-  notifySignedIn_Callback_2_(mthis, __arg_0, __arg_1) => notifySignedIn_Callback_2(mthis, __arg_0, __arg_1);
-
-  static notifySignedIn_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "CredentialsContainer_notifySignedIn_Callback";
-  notifySignedIn_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => notifySignedIn_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static notifySignedOut_Callback_0(mthis) native "CredentialsContainer_notifySignedOut_Callback";
-  notifySignedOut_Callback_0_(mthis) => notifySignedOut_Callback_0(mthis);
-
-  static notifySignedOut_Callback_1(mthis, __arg_0) native "CredentialsContainer_notifySignedOut_Callback";
-  notifySignedOut_Callback_1_(mthis, __arg_0) => notifySignedOut_Callback_1(mthis, __arg_0);
-
-  static notifySignedOut_Callback_2(mthis, __arg_0, __arg_1) native "CredentialsContainer_notifySignedOut_Callback";
-  notifySignedOut_Callback_2_(mthis, __arg_0, __arg_1) => notifySignedOut_Callback_2(mthis, __arg_0, __arg_1);
-
-  static request_Callback_0(mthis) native "CredentialsContainer_request_Callback";
-  request_Callback_0_(mthis) => request_Callback_0(mthis);
-
-  static request_Callback_1(mthis, __arg_0) native "CredentialsContainer_request_Callback";
-  request_Callback_1_(mthis, __arg_0) => request_Callback_1(mthis, __arg_0);
-
-  static request_Callback_2(mthis, __arg_0, __arg_1) native "CredentialsContainer_request_Callback";
-  request_Callback_2_(mthis, __arg_0, __arg_1) => request_Callback_2(mthis, __arg_0, __arg_1);
-
-  static request_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "CredentialsContainer_request_Callback";
-  request_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => request_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  request_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "request", [__arg_0]);
 
 }
 
 class BlinkCrypto {
   static final instance = new BlinkCrypto();
 
-  static getRandomValues_Callback_0(mthis) native "Crypto_getRandomValues_Callback";
-  getRandomValues_Callback_0_(mthis) => getRandomValues_Callback_0(mthis);
+  getRandomValues_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getRandomValues", []);
 
-  static getRandomValues_Callback_1(mthis, __arg_0) native "Crypto_getRandomValues_Callback";
-  getRandomValues_Callback_1_(mthis, __arg_0) => getRandomValues_Callback_1(mthis, __arg_0);
+  getRandomValues_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getRandomValues", [__arg_0]);
 
-  static getRandomValues_Callback_2(mthis, __arg_0, __arg_1) native "Crypto_getRandomValues_Callback";
-  getRandomValues_Callback_2_(mthis, __arg_0, __arg_1) => getRandomValues_Callback_2(mthis, __arg_0, __arg_1);
-
-  static getRandomValues_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Crypto_getRandomValues_Callback";
-  getRandomValues_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getRandomValues_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static subtle_Getter(mthis) native "Crypto_subtle_Getter";
-  subtle_Getter_(mthis) => subtle_Getter(mthis);
+  subtle_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "subtle");
 
 }
 
 class BlinkCryptoKey {
   static final instance = new BlinkCryptoKey();
 
-  static algorithm_Getter(mthis) native "CryptoKey_algorithm_Getter";
-  algorithm_Getter_(mthis) => algorithm_Getter(mthis);
+  algorithm_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "algorithm");
 
-  static extractable_Getter(mthis) native "CryptoKey_extractable_Getter";
-  extractable_Getter_(mthis) => extractable_Getter(mthis);
+  extractable_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "extractable");
 
-  static type_Getter(mthis) native "CryptoKey_type_Getter";
-  type_Getter_(mthis) => type_Getter(mthis);
+  type_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "type");
 
-  static usages_Getter(mthis) native "CryptoKey_usages_Getter";
-  usages_Getter_(mthis) => usages_Getter(mthis);
+  usages_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "usages");
 
 }
 
 class BlinkCustomEvent extends BlinkEvent {
   static final instance = new BlinkCustomEvent();
 
-  static constructorCallback_2(__arg_0, __arg_1) native "CustomEvent_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  constructorCallback_2_(__arg_0, __arg_1) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "CustomEvent"), [__arg_0, __arg_1]);
 
-  static detail_Getter(mthis) native "CustomEvent_detail_Getter";
-  detail_Getter_(mthis) => detail_Getter(mthis);
+  detail_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "detail");
 
-  static initCustomEvent_Callback_0(mthis) native "CustomEvent_initCustomEvent_Callback";
-  initCustomEvent_Callback_0_(mthis) => initCustomEvent_Callback_0(mthis);
+  initCustomEvent_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "initCustomEvent", []);
 
-  static initCustomEvent_Callback_1(mthis, __arg_0) native "CustomEvent_initCustomEvent_Callback";
-  initCustomEvent_Callback_1_(mthis, __arg_0) => initCustomEvent_Callback_1(mthis, __arg_0);
+  initCustomEvent_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "initCustomEvent", [__arg_0]);
 
-  static initCustomEvent_Callback_2(mthis, __arg_0, __arg_1) native "CustomEvent_initCustomEvent_Callback";
-  initCustomEvent_Callback_2_(mthis, __arg_0, __arg_1) => initCustomEvent_Callback_2(mthis, __arg_0, __arg_1);
+  initCustomEvent_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "initCustomEvent", [__arg_0, __arg_1]);
 
-  static initCustomEvent_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "CustomEvent_initCustomEvent_Callback";
-  initCustomEvent_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => initCustomEvent_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  initCustomEvent_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "initCustomEvent", [__arg_0, __arg_1, __arg_2]);
 
-  static initCustomEvent_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "CustomEvent_initCustomEvent_Callback";
-  initCustomEvent_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => initCustomEvent_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static initCustomEvent_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "CustomEvent_initCustomEvent_Callback";
-  initCustomEvent_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => initCustomEvent_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
-
-  static initCustomEvent_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "CustomEvent_initCustomEvent_Callback";
-  initCustomEvent_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => initCustomEvent_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  initCustomEvent_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "initCustomEvent", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
 }
 
 class BlinkDOMError {
   static final instance = new BlinkDOMError();
 
-  static constructorCallback_0() native "DOMError_constructorCallback";
-  constructorCallback_0_() => constructorCallback_0();
+  constructorCallback_0_() => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "DOMError"), []);
 
-  static constructorCallback_1(__arg_0) native "DOMError_constructorCallback";
-  constructorCallback_1_(__arg_0) => constructorCallback_1(__arg_0);
+  constructorCallback_1_(__arg_0) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "DOMError"), [__arg_0]);
 
-  static constructorCallback_2(__arg_0, __arg_1) native "DOMError_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  constructorCallback_2_(__arg_0, __arg_1) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "DOMError"), [__arg_0, __arg_1]);
 
-  static constructorCallback_3(__arg_0, __arg_1, __arg_2) native "DOMError_constructorCallback";
-  constructorCallback_3_(__arg_0, __arg_1, __arg_2) => constructorCallback_3(__arg_0, __arg_1, __arg_2);
+  message_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "message");
 
-  static constructorCallback_4(__arg_0, __arg_1, __arg_2, __arg_3) native "DOMError_constructorCallback";
-  constructorCallback_4_(__arg_0, __arg_1, __arg_2, __arg_3) => constructorCallback_4(__arg_0, __arg_1, __arg_2, __arg_3);
-
-  static message_Getter(mthis) native "DOMError_message_Getter";
-  message_Getter_(mthis) => message_Getter(mthis);
-
-  static name_Getter(mthis) native "DOMError_name_Getter";
-  name_Getter_(mthis) => name_Getter(mthis);
+  name_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "name");
 
 }
 
 class BlinkDOMException {
   static final instance = new BlinkDOMException();
 
-  static message_Getter(mthis) native "DOMException_message_Getter";
-  message_Getter_(mthis) => message_Getter(mthis);
+  message_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "message");
 
-  static name_Getter(mthis) native "DOMException_name_Getter";
-  name_Getter_(mthis) => name_Getter(mthis);
+  name_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "name");
 
-  static toString_Callback_0(mthis) native "DOMException_toString_Callback";
-  toString_Callback_0_(mthis) => toString_Callback_0(mthis);
-
-  static toString_Callback_1(mthis, __arg_0) native "DOMException_toString_Callback";
-  toString_Callback_1_(mthis, __arg_0) => toString_Callback_1(mthis, __arg_0);
-
-  static toString_Callback_2(mthis, __arg_0, __arg_1) native "DOMException_toString_Callback";
-  toString_Callback_2_(mthis, __arg_0, __arg_1) => toString_Callback_2(mthis, __arg_0, __arg_1);
+  toString_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "toString", []);
 
 }
 
 class BlinkDOMFileSystem {
   static final instance = new BlinkDOMFileSystem();
 
-  static name_Getter(mthis) native "DOMFileSystem_name_Getter";
-  name_Getter_(mthis) => name_Getter(mthis);
+  name_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "name");
 
-  static root_Getter(mthis) native "DOMFileSystem_root_Getter";
-  root_Getter_(mthis) => root_Getter(mthis);
+  root_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "root");
 
 }
 
 class BlinkDOMFileSystemSync {
   static final instance = new BlinkDOMFileSystemSync();
 
-  static name_Getter(mthis) native "DOMFileSystemSync_name_Getter";
-  name_Getter_(mthis) => name_Getter(mthis);
+  name_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "name");
 
-  static root_Getter(mthis) native "DOMFileSystemSync_root_Getter";
-  root_Getter_(mthis) => root_Getter(mthis);
+  root_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "root");
 
 }
 
 class BlinkDOMImplementation {
   static final instance = new BlinkDOMImplementation();
 
-  static createDocumentType_Callback_1(mthis, __arg_0) native "DOMImplementation_createDocumentType_Callback";
-  createDocumentType_Callback_1_(mthis, __arg_0) => createDocumentType_Callback_1(mthis, __arg_0);
+  createDocumentType_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "createDocumentType", [__arg_0]);
 
-  static createDocumentType_Callback_2(mthis, __arg_0, __arg_1) native "DOMImplementation_createDocumentType_Callback";
-  createDocumentType_Callback_2_(mthis, __arg_0, __arg_1) => createDocumentType_Callback_2(mthis, __arg_0, __arg_1);
+  createDocumentType_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "createDocumentType", [__arg_0, __arg_1]);
 
-  static createDocumentType_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "DOMImplementation_createDocumentType_Callback";
-  createDocumentType_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => createDocumentType_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  createDocumentType_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "createDocumentType", [__arg_0, __arg_1, __arg_2]);
 
-  static createDocumentType_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "DOMImplementation_createDocumentType_Callback";
-  createDocumentType_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => createDocumentType_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  createDocument_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createDocument", []);
 
-  static createDocumentType_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "DOMImplementation_createDocumentType_Callback";
-  createDocumentType_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => createDocumentType_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  createDocument_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "createDocument", [__arg_0]);
 
-  static createDocument_Callback_0(mthis) native "DOMImplementation_createDocument_Callback";
-  createDocument_Callback_0_(mthis) => createDocument_Callback_0(mthis);
+  createDocument_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "createDocument", [__arg_0, __arg_1]);
 
-  static createDocument_Callback_1(mthis, __arg_0) native "DOMImplementation_createDocument_Callback";
-  createDocument_Callback_1_(mthis, __arg_0) => createDocument_Callback_1(mthis, __arg_0);
+  createDocument_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "createDocument", [__arg_0, __arg_1, __arg_2]);
 
-  static createDocument_Callback_2(mthis, __arg_0, __arg_1) native "DOMImplementation_createDocument_Callback";
-  createDocument_Callback_2_(mthis, __arg_0, __arg_1) => createDocument_Callback_2(mthis, __arg_0, __arg_1);
+  createHTMLDocument_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createHTMLDocument", []);
 
-  static createDocument_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "DOMImplementation_createDocument_Callback";
-  createDocument_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => createDocument_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  createHTMLDocument_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "createHTMLDocument", [__arg_0]);
 
-  static createDocument_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "DOMImplementation_createDocument_Callback";
-  createDocument_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => createDocument_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  hasFeature_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "hasFeature", []);
 
-  static createDocument_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "DOMImplementation_createDocument_Callback";
-  createDocument_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => createDocument_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  hasFeature_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "hasFeature", [__arg_0]);
 
-  static createHTMLDocument_Callback_0(mthis) native "DOMImplementation_createHTMLDocument_Callback";
-  createHTMLDocument_Callback_0_(mthis) => createHTMLDocument_Callback_0(mthis);
-
-  static createHTMLDocument_Callback_1(mthis, __arg_0) native "DOMImplementation_createHTMLDocument_Callback";
-  createHTMLDocument_Callback_1_(mthis, __arg_0) => createHTMLDocument_Callback_1(mthis, __arg_0);
-
-  static createHTMLDocument_Callback_2(mthis, __arg_0, __arg_1) native "DOMImplementation_createHTMLDocument_Callback";
-  createHTMLDocument_Callback_2_(mthis, __arg_0, __arg_1) => createHTMLDocument_Callback_2(mthis, __arg_0, __arg_1);
-
-  static createHTMLDocument_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "DOMImplementation_createHTMLDocument_Callback";
-  createHTMLDocument_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => createHTMLDocument_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static hasFeature_Callback_0(mthis) native "DOMImplementation_hasFeature_Callback";
-  hasFeature_Callback_0_(mthis) => hasFeature_Callback_0(mthis);
-
-  static hasFeature_Callback_1(mthis, __arg_0) native "DOMImplementation_hasFeature_Callback";
-  hasFeature_Callback_1_(mthis, __arg_0) => hasFeature_Callback_1(mthis, __arg_0);
-
-  static hasFeature_Callback_2(mthis, __arg_0, __arg_1) native "DOMImplementation_hasFeature_Callback";
-  hasFeature_Callback_2_(mthis, __arg_0, __arg_1) => hasFeature_Callback_2(mthis, __arg_0, __arg_1);
-
-  static hasFeature_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "DOMImplementation_hasFeature_Callback";
-  hasFeature_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => hasFeature_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static hasFeature_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "DOMImplementation_hasFeature_Callback";
-  hasFeature_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => hasFeature_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  hasFeature_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "hasFeature", [__arg_0, __arg_1]);
 
 }
 
 class BlinkDOMMatrix extends BlinkDOMMatrixReadOnly {
   static final instance = new BlinkDOMMatrix();
 
-  static a_Getter(mthis) native "DOMMatrix_a_Getter";
-  a_Getter_(mthis) => a_Getter(mthis);
+  a_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "a");
 
-  static a_Setter(mthis, __arg_0) native "DOMMatrix_a_Setter";
-  a_Setter_(mthis, __arg_0) => a_Setter(mthis, __arg_0);
+  a_Setter_(mthis, __arg_0) => mthis["a"] = __arg_0;
 
-  static b_Getter(mthis) native "DOMMatrix_b_Getter";
-  b_Getter_(mthis) => b_Getter(mthis);
+  b_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "b");
 
-  static b_Setter(mthis, __arg_0) native "DOMMatrix_b_Setter";
-  b_Setter_(mthis, __arg_0) => b_Setter(mthis, __arg_0);
+  b_Setter_(mthis, __arg_0) => mthis["b"] = __arg_0;
 
-  static c_Getter(mthis) native "DOMMatrix_c_Getter";
-  c_Getter_(mthis) => c_Getter(mthis);
+  c_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "c");
 
-  static c_Setter(mthis, __arg_0) native "DOMMatrix_c_Setter";
-  c_Setter_(mthis, __arg_0) => c_Setter(mthis, __arg_0);
+  c_Setter_(mthis, __arg_0) => mthis["c"] = __arg_0;
 
-  static constructorCallback_0() native "DOMMatrix_constructorCallback";
-  constructorCallback_0_() => constructorCallback_0();
+  constructorCallback_0_() => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "DOMMatrix"), []);
 
-  static constructorCallback_1(__arg_0) native "DOMMatrix_constructorCallback";
-  constructorCallback_1_(__arg_0) => constructorCallback_1(__arg_0);
+  constructorCallback_1_(__arg_0) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "DOMMatrix"), [__arg_0]);
 
-  static constructorCallback_2(__arg_0, __arg_1) native "DOMMatrix_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  d_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "d");
 
-  static constructorCallback_3(__arg_0, __arg_1, __arg_2) native "DOMMatrix_constructorCallback";
-  constructorCallback_3_(__arg_0, __arg_1, __arg_2) => constructorCallback_3(__arg_0, __arg_1, __arg_2);
+  d_Setter_(mthis, __arg_0) => mthis["d"] = __arg_0;
 
-  static d_Getter(mthis) native "DOMMatrix_d_Getter";
-  d_Getter_(mthis) => d_Getter(mthis);
+  e_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "e");
 
-  static d_Setter(mthis, __arg_0) native "DOMMatrix_d_Setter";
-  d_Setter_(mthis, __arg_0) => d_Setter(mthis, __arg_0);
+  e_Setter_(mthis, __arg_0) => mthis["e"] = __arg_0;
 
-  static e_Getter(mthis) native "DOMMatrix_e_Getter";
-  e_Getter_(mthis) => e_Getter(mthis);
+  f_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "f");
 
-  static e_Setter(mthis, __arg_0) native "DOMMatrix_e_Setter";
-  e_Setter_(mthis, __arg_0) => e_Setter(mthis, __arg_0);
+  f_Setter_(mthis, __arg_0) => mthis["f"] = __arg_0;
 
-  static f_Getter(mthis) native "DOMMatrix_f_Getter";
-  f_Getter_(mthis) => f_Getter(mthis);
+  m11_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "m11");
 
-  static f_Setter(mthis, __arg_0) native "DOMMatrix_f_Setter";
-  f_Setter_(mthis, __arg_0) => f_Setter(mthis, __arg_0);
+  m11_Setter_(mthis, __arg_0) => mthis["m11"] = __arg_0;
 
-  static m11_Getter(mthis) native "DOMMatrix_m11_Getter";
-  m11_Getter_(mthis) => m11_Getter(mthis);
+  m12_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "m12");
 
-  static m11_Setter(mthis, __arg_0) native "DOMMatrix_m11_Setter";
-  m11_Setter_(mthis, __arg_0) => m11_Setter(mthis, __arg_0);
+  m12_Setter_(mthis, __arg_0) => mthis["m12"] = __arg_0;
 
-  static m12_Getter(mthis) native "DOMMatrix_m12_Getter";
-  m12_Getter_(mthis) => m12_Getter(mthis);
+  m13_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "m13");
 
-  static m12_Setter(mthis, __arg_0) native "DOMMatrix_m12_Setter";
-  m12_Setter_(mthis, __arg_0) => m12_Setter(mthis, __arg_0);
+  m13_Setter_(mthis, __arg_0) => mthis["m13"] = __arg_0;
 
-  static m13_Getter(mthis) native "DOMMatrix_m13_Getter";
-  m13_Getter_(mthis) => m13_Getter(mthis);
+  m14_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "m14");
 
-  static m13_Setter(mthis, __arg_0) native "DOMMatrix_m13_Setter";
-  m13_Setter_(mthis, __arg_0) => m13_Setter(mthis, __arg_0);
+  m14_Setter_(mthis, __arg_0) => mthis["m14"] = __arg_0;
 
-  static m14_Getter(mthis) native "DOMMatrix_m14_Getter";
-  m14_Getter_(mthis) => m14_Getter(mthis);
+  m21_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "m21");
 
-  static m14_Setter(mthis, __arg_0) native "DOMMatrix_m14_Setter";
-  m14_Setter_(mthis, __arg_0) => m14_Setter(mthis, __arg_0);
+  m21_Setter_(mthis, __arg_0) => mthis["m21"] = __arg_0;
 
-  static m21_Getter(mthis) native "DOMMatrix_m21_Getter";
-  m21_Getter_(mthis) => m21_Getter(mthis);
+  m22_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "m22");
 
-  static m21_Setter(mthis, __arg_0) native "DOMMatrix_m21_Setter";
-  m21_Setter_(mthis, __arg_0) => m21_Setter(mthis, __arg_0);
+  m22_Setter_(mthis, __arg_0) => mthis["m22"] = __arg_0;
 
-  static m22_Getter(mthis) native "DOMMatrix_m22_Getter";
-  m22_Getter_(mthis) => m22_Getter(mthis);
+  m23_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "m23");
 
-  static m22_Setter(mthis, __arg_0) native "DOMMatrix_m22_Setter";
-  m22_Setter_(mthis, __arg_0) => m22_Setter(mthis, __arg_0);
+  m23_Setter_(mthis, __arg_0) => mthis["m23"] = __arg_0;
 
-  static m23_Getter(mthis) native "DOMMatrix_m23_Getter";
-  m23_Getter_(mthis) => m23_Getter(mthis);
+  m24_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "m24");
 
-  static m23_Setter(mthis, __arg_0) native "DOMMatrix_m23_Setter";
-  m23_Setter_(mthis, __arg_0) => m23_Setter(mthis, __arg_0);
+  m24_Setter_(mthis, __arg_0) => mthis["m24"] = __arg_0;
 
-  static m24_Getter(mthis) native "DOMMatrix_m24_Getter";
-  m24_Getter_(mthis) => m24_Getter(mthis);
+  m31_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "m31");
 
-  static m24_Setter(mthis, __arg_0) native "DOMMatrix_m24_Setter";
-  m24_Setter_(mthis, __arg_0) => m24_Setter(mthis, __arg_0);
+  m31_Setter_(mthis, __arg_0) => mthis["m31"] = __arg_0;
 
-  static m31_Getter(mthis) native "DOMMatrix_m31_Getter";
-  m31_Getter_(mthis) => m31_Getter(mthis);
+  m32_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "m32");
 
-  static m31_Setter(mthis, __arg_0) native "DOMMatrix_m31_Setter";
-  m31_Setter_(mthis, __arg_0) => m31_Setter(mthis, __arg_0);
+  m32_Setter_(mthis, __arg_0) => mthis["m32"] = __arg_0;
 
-  static m32_Getter(mthis) native "DOMMatrix_m32_Getter";
-  m32_Getter_(mthis) => m32_Getter(mthis);
+  m33_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "m33");
 
-  static m32_Setter(mthis, __arg_0) native "DOMMatrix_m32_Setter";
-  m32_Setter_(mthis, __arg_0) => m32_Setter(mthis, __arg_0);
+  m33_Setter_(mthis, __arg_0) => mthis["m33"] = __arg_0;
 
-  static m33_Getter(mthis) native "DOMMatrix_m33_Getter";
-  m33_Getter_(mthis) => m33_Getter(mthis);
+  m34_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "m34");
 
-  static m33_Setter(mthis, __arg_0) native "DOMMatrix_m33_Setter";
-  m33_Setter_(mthis, __arg_0) => m33_Setter(mthis, __arg_0);
+  m34_Setter_(mthis, __arg_0) => mthis["m34"] = __arg_0;
 
-  static m34_Getter(mthis) native "DOMMatrix_m34_Getter";
-  m34_Getter_(mthis) => m34_Getter(mthis);
+  m41_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "m41");
 
-  static m34_Setter(mthis, __arg_0) native "DOMMatrix_m34_Setter";
-  m34_Setter_(mthis, __arg_0) => m34_Setter(mthis, __arg_0);
+  m41_Setter_(mthis, __arg_0) => mthis["m41"] = __arg_0;
 
-  static m41_Getter(mthis) native "DOMMatrix_m41_Getter";
-  m41_Getter_(mthis) => m41_Getter(mthis);
+  m42_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "m42");
 
-  static m41_Setter(mthis, __arg_0) native "DOMMatrix_m41_Setter";
-  m41_Setter_(mthis, __arg_0) => m41_Setter(mthis, __arg_0);
-
-  static m42_Getter(mthis) native "DOMMatrix_m42_Getter";
-  m42_Getter_(mthis) => m42_Getter(mthis);
-
-  static m42_Setter(mthis, __arg_0) native "DOMMatrix_m42_Setter";
-  m42_Setter_(mthis, __arg_0) => m42_Setter(mthis, __arg_0);
-
-  static m43_Getter(mthis) native "DOMMatrix_m43_Getter";
-  m43_Getter_(mthis) => m43_Getter(mthis);
-
-  static m43_Setter(mthis, __arg_0) native "DOMMatrix_m43_Setter";
-  m43_Setter_(mthis, __arg_0) => m43_Setter(mthis, __arg_0);
-
-  static m44_Getter(mthis) native "DOMMatrix_m44_Getter";
-  m44_Getter_(mthis) => m44_Getter(mthis);
-
-  static m44_Setter(mthis, __arg_0) native "DOMMatrix_m44_Setter";
-  m44_Setter_(mthis, __arg_0) => m44_Setter(mthis, __arg_0);
-
-  static multiplySelf_Callback_0(mthis) native "DOMMatrix_multiplySelf_Callback";
-  multiplySelf_Callback_0_(mthis) => multiplySelf_Callback_0(mthis);
-
-  static multiplySelf_Callback_1(mthis, __arg_0) native "DOMMatrix_multiplySelf_Callback";
-  multiplySelf_Callback_1_(mthis, __arg_0) => multiplySelf_Callback_1(mthis, __arg_0);
-
-  static multiplySelf_Callback_2(mthis, __arg_0, __arg_1) native "DOMMatrix_multiplySelf_Callback";
-  multiplySelf_Callback_2_(mthis, __arg_0, __arg_1) => multiplySelf_Callback_2(mthis, __arg_0, __arg_1);
-
-  static multiplySelf_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "DOMMatrix_multiplySelf_Callback";
-  multiplySelf_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => multiplySelf_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static preMultiplySelf_Callback_0(mthis) native "DOMMatrix_preMultiplySelf_Callback";
-  preMultiplySelf_Callback_0_(mthis) => preMultiplySelf_Callback_0(mthis);
-
-  static preMultiplySelf_Callback_1(mthis, __arg_0) native "DOMMatrix_preMultiplySelf_Callback";
-  preMultiplySelf_Callback_1_(mthis, __arg_0) => preMultiplySelf_Callback_1(mthis, __arg_0);
-
-  static preMultiplySelf_Callback_2(mthis, __arg_0, __arg_1) native "DOMMatrix_preMultiplySelf_Callback";
-  preMultiplySelf_Callback_2_(mthis, __arg_0, __arg_1) => preMultiplySelf_Callback_2(mthis, __arg_0, __arg_1);
-
-  static preMultiplySelf_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "DOMMatrix_preMultiplySelf_Callback";
-  preMultiplySelf_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => preMultiplySelf_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  m42_Setter_(mthis, __arg_0) => mthis["m42"] = __arg_0;
 
-  static scale3dSelf_Callback_0(mthis) native "DOMMatrix_scale3dSelf_Callback";
-  scale3dSelf_Callback_0_(mthis) => scale3dSelf_Callback_0(mthis);
+  m43_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "m43");
 
-  static scale3dSelf_Callback_1(mthis, __arg_0) native "DOMMatrix_scale3dSelf_Callback";
-  scale3dSelf_Callback_1_(mthis, __arg_0) => scale3dSelf_Callback_1(mthis, __arg_0);
+  m43_Setter_(mthis, __arg_0) => mthis["m43"] = __arg_0;
 
-  static scale3dSelf_Callback_2(mthis, __arg_0, __arg_1) native "DOMMatrix_scale3dSelf_Callback";
-  scale3dSelf_Callback_2_(mthis, __arg_0, __arg_1) => scale3dSelf_Callback_2(mthis, __arg_0, __arg_1);
+  m44_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "m44");
 
-  static scale3dSelf_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "DOMMatrix_scale3dSelf_Callback";
-  scale3dSelf_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => scale3dSelf_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  m44_Setter_(mthis, __arg_0) => mthis["m44"] = __arg_0;
 
-  static scale3dSelf_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "DOMMatrix_scale3dSelf_Callback";
-  scale3dSelf_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => scale3dSelf_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  multiplySelf_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "multiplySelf", []);
 
-  static scale3dSelf_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "DOMMatrix_scale3dSelf_Callback";
-  scale3dSelf_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => scale3dSelf_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  multiplySelf_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "multiplySelf", [__arg_0]);
 
-  static scale3dSelf_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "DOMMatrix_scale3dSelf_Callback";
-  scale3dSelf_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => scale3dSelf_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  preMultiplySelf_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "preMultiplySelf", []);
 
-  static scaleNonUniformSelf_Callback_0(mthis) native "DOMMatrix_scaleNonUniformSelf_Callback";
-  scaleNonUniformSelf_Callback_0_(mthis) => scaleNonUniformSelf_Callback_0(mthis);
+  preMultiplySelf_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "preMultiplySelf", [__arg_0]);
 
-  static scaleNonUniformSelf_Callback_1(mthis, __arg_0) native "DOMMatrix_scaleNonUniformSelf_Callback";
-  scaleNonUniformSelf_Callback_1_(mthis, __arg_0) => scaleNonUniformSelf_Callback_1(mthis, __arg_0);
+  scale3dSelf_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "scale3dSelf", []);
 
-  static scaleNonUniformSelf_Callback_2(mthis, __arg_0, __arg_1) native "DOMMatrix_scaleNonUniformSelf_Callback";
-  scaleNonUniformSelf_Callback_2_(mthis, __arg_0, __arg_1) => scaleNonUniformSelf_Callback_2(mthis, __arg_0, __arg_1);
+  scale3dSelf_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "scale3dSelf", [__arg_0]);
 
-  static scaleNonUniformSelf_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "DOMMatrix_scaleNonUniformSelf_Callback";
-  scaleNonUniformSelf_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => scaleNonUniformSelf_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  scale3dSelf_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "scale3dSelf", [__arg_0, __arg_1]);
 
-  static scaleNonUniformSelf_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "DOMMatrix_scaleNonUniformSelf_Callback";
-  scaleNonUniformSelf_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => scaleNonUniformSelf_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  scale3dSelf_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "scale3dSelf", [__arg_0, __arg_1, __arg_2]);
 
-  static scaleNonUniformSelf_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "DOMMatrix_scaleNonUniformSelf_Callback";
-  scaleNonUniformSelf_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => scaleNonUniformSelf_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  scale3dSelf_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "scale3dSelf", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static scaleNonUniformSelf_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "DOMMatrix_scaleNonUniformSelf_Callback";
-  scaleNonUniformSelf_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => scaleNonUniformSelf_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  scaleNonUniformSelf_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "scaleNonUniformSelf", []);
 
-  static scaleNonUniformSelf_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) native "DOMMatrix_scaleNonUniformSelf_Callback";
-  scaleNonUniformSelf_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => scaleNonUniformSelf_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6);
+  scaleNonUniformSelf_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "scaleNonUniformSelf", [__arg_0]);
 
-  static scaleNonUniformSelf_Callback_8(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) native "DOMMatrix_scaleNonUniformSelf_Callback";
-  scaleNonUniformSelf_Callback_8_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) => scaleNonUniformSelf_Callback_8(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7);
+  scaleNonUniformSelf_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "scaleNonUniformSelf", [__arg_0, __arg_1]);
 
-  static scaleSelf_Callback_0(mthis) native "DOMMatrix_scaleSelf_Callback";
-  scaleSelf_Callback_0_(mthis) => scaleSelf_Callback_0(mthis);
+  scaleNonUniformSelf_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "scaleNonUniformSelf", [__arg_0, __arg_1, __arg_2]);
 
-  static scaleSelf_Callback_1(mthis, __arg_0) native "DOMMatrix_scaleSelf_Callback";
-  scaleSelf_Callback_1_(mthis, __arg_0) => scaleSelf_Callback_1(mthis, __arg_0);
+  scaleNonUniformSelf_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "scaleNonUniformSelf", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static scaleSelf_Callback_2(mthis, __arg_0, __arg_1) native "DOMMatrix_scaleSelf_Callback";
-  scaleSelf_Callback_2_(mthis, __arg_0, __arg_1) => scaleSelf_Callback_2(mthis, __arg_0, __arg_1);
+  scaleNonUniformSelf_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => Blink_JsNative_DomException.callMethod(mthis, "scaleNonUniformSelf", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4]);
 
-  static scaleSelf_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "DOMMatrix_scaleSelf_Callback";
-  scaleSelf_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => scaleSelf_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  scaleNonUniformSelf_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => Blink_JsNative_DomException.callMethod(mthis, "scaleNonUniformSelf", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5]);
 
-  static scaleSelf_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "DOMMatrix_scaleSelf_Callback";
-  scaleSelf_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => scaleSelf_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  scaleSelf_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "scaleSelf", []);
 
-  static scaleSelf_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "DOMMatrix_scaleSelf_Callback";
-  scaleSelf_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => scaleSelf_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  scaleSelf_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "scaleSelf", [__arg_0]);
 
-  static translateSelf_Callback_0(mthis) native "DOMMatrix_translateSelf_Callback";
-  translateSelf_Callback_0_(mthis) => translateSelf_Callback_0(mthis);
+  scaleSelf_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "scaleSelf", [__arg_0, __arg_1]);
 
-  static translateSelf_Callback_1(mthis, __arg_0) native "DOMMatrix_translateSelf_Callback";
-  translateSelf_Callback_1_(mthis, __arg_0) => translateSelf_Callback_1(mthis, __arg_0);
+  scaleSelf_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "scaleSelf", [__arg_0, __arg_1, __arg_2]);
 
-  static translateSelf_Callback_2(mthis, __arg_0, __arg_1) native "DOMMatrix_translateSelf_Callback";
-  translateSelf_Callback_2_(mthis, __arg_0, __arg_1) => translateSelf_Callback_2(mthis, __arg_0, __arg_1);
+  translateSelf_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "translateSelf", []);
 
-  static translateSelf_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "DOMMatrix_translateSelf_Callback";
-  translateSelf_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => translateSelf_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  translateSelf_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "translateSelf", [__arg_0]);
 
-  static translateSelf_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "DOMMatrix_translateSelf_Callback";
-  translateSelf_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => translateSelf_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  translateSelf_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "translateSelf", [__arg_0, __arg_1]);
 
-  static translateSelf_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "DOMMatrix_translateSelf_Callback";
-  translateSelf_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => translateSelf_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  translateSelf_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "translateSelf", [__arg_0, __arg_1, __arg_2]);
 
 }
 
 class BlinkDOMMatrixReadOnly {
   static final instance = new BlinkDOMMatrixReadOnly();
 
-  static a_Getter(mthis) native "DOMMatrixReadOnly_a_Getter";
-  a_Getter_(mthis) => a_Getter(mthis);
+  a_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "a");
 
-  static b_Getter(mthis) native "DOMMatrixReadOnly_b_Getter";
-  b_Getter_(mthis) => b_Getter(mthis);
+  b_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "b");
 
-  static c_Getter(mthis) native "DOMMatrixReadOnly_c_Getter";
-  c_Getter_(mthis) => c_Getter(mthis);
+  c_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "c");
 
-  static d_Getter(mthis) native "DOMMatrixReadOnly_d_Getter";
-  d_Getter_(mthis) => d_Getter(mthis);
+  d_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "d");
 
-  static e_Getter(mthis) native "DOMMatrixReadOnly_e_Getter";
-  e_Getter_(mthis) => e_Getter(mthis);
+  e_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "e");
 
-  static f_Getter(mthis) native "DOMMatrixReadOnly_f_Getter";
-  f_Getter_(mthis) => f_Getter(mthis);
+  f_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "f");
 
-  static is2D_Getter(mthis) native "DOMMatrixReadOnly_is2D_Getter";
-  is2D_Getter_(mthis) => is2D_Getter(mthis);
+  is2D_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "is2D");
 
-  static isIdentity_Getter(mthis) native "DOMMatrixReadOnly_isIdentity_Getter";
-  isIdentity_Getter_(mthis) => isIdentity_Getter(mthis);
+  isIdentity_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "isIdentity");
 
-  static m11_Getter(mthis) native "DOMMatrixReadOnly_m11_Getter";
-  m11_Getter_(mthis) => m11_Getter(mthis);
+  m11_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "m11");
 
-  static m12_Getter(mthis) native "DOMMatrixReadOnly_m12_Getter";
-  m12_Getter_(mthis) => m12_Getter(mthis);
+  m12_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "m12");
 
-  static m13_Getter(mthis) native "DOMMatrixReadOnly_m13_Getter";
-  m13_Getter_(mthis) => m13_Getter(mthis);
+  m13_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "m13");
 
-  static m14_Getter(mthis) native "DOMMatrixReadOnly_m14_Getter";
-  m14_Getter_(mthis) => m14_Getter(mthis);
+  m14_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "m14");
 
-  static m21_Getter(mthis) native "DOMMatrixReadOnly_m21_Getter";
-  m21_Getter_(mthis) => m21_Getter(mthis);
+  m21_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "m21");
 
-  static m22_Getter(mthis) native "DOMMatrixReadOnly_m22_Getter";
-  m22_Getter_(mthis) => m22_Getter(mthis);
+  m22_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "m22");
 
-  static m23_Getter(mthis) native "DOMMatrixReadOnly_m23_Getter";
-  m23_Getter_(mthis) => m23_Getter(mthis);
+  m23_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "m23");
 
-  static m24_Getter(mthis) native "DOMMatrixReadOnly_m24_Getter";
-  m24_Getter_(mthis) => m24_Getter(mthis);
+  m24_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "m24");
 
-  static m31_Getter(mthis) native "DOMMatrixReadOnly_m31_Getter";
-  m31_Getter_(mthis) => m31_Getter(mthis);
+  m31_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "m31");
 
-  static m32_Getter(mthis) native "DOMMatrixReadOnly_m32_Getter";
-  m32_Getter_(mthis) => m32_Getter(mthis);
+  m32_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "m32");
 
-  static m33_Getter(mthis) native "DOMMatrixReadOnly_m33_Getter";
-  m33_Getter_(mthis) => m33_Getter(mthis);
+  m33_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "m33");
 
-  static m34_Getter(mthis) native "DOMMatrixReadOnly_m34_Getter";
-  m34_Getter_(mthis) => m34_Getter(mthis);
+  m34_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "m34");
 
-  static m41_Getter(mthis) native "DOMMatrixReadOnly_m41_Getter";
-  m41_Getter_(mthis) => m41_Getter(mthis);
+  m41_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "m41");
 
-  static m42_Getter(mthis) native "DOMMatrixReadOnly_m42_Getter";
-  m42_Getter_(mthis) => m42_Getter(mthis);
+  m42_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "m42");
 
-  static m43_Getter(mthis) native "DOMMatrixReadOnly_m43_Getter";
-  m43_Getter_(mthis) => m43_Getter(mthis);
+  m43_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "m43");
 
-  static m44_Getter(mthis) native "DOMMatrixReadOnly_m44_Getter";
-  m44_Getter_(mthis) => m44_Getter(mthis);
+  m44_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "m44");
 
-  static multiply_Callback_0(mthis) native "DOMMatrixReadOnly_multiply_Callback";
-  multiply_Callback_0_(mthis) => multiply_Callback_0(mthis);
+  multiply_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "multiply", []);
 
-  static multiply_Callback_1(mthis, __arg_0) native "DOMMatrixReadOnly_multiply_Callback";
-  multiply_Callback_1_(mthis, __arg_0) => multiply_Callback_1(mthis, __arg_0);
+  multiply_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "multiply", [__arg_0]);
 
-  static multiply_Callback_2(mthis, __arg_0, __arg_1) native "DOMMatrixReadOnly_multiply_Callback";
-  multiply_Callback_2_(mthis, __arg_0, __arg_1) => multiply_Callback_2(mthis, __arg_0, __arg_1);
+  scale3d_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "scale3d", []);
 
-  static multiply_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "DOMMatrixReadOnly_multiply_Callback";
-  multiply_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => multiply_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  scale3d_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "scale3d", [__arg_0]);
 
-  static scale3d_Callback_0(mthis) native "DOMMatrixReadOnly_scale3d_Callback";
-  scale3d_Callback_0_(mthis) => scale3d_Callback_0(mthis);
+  scale3d_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "scale3d", [__arg_0, __arg_1]);
 
-  static scale3d_Callback_1(mthis, __arg_0) native "DOMMatrixReadOnly_scale3d_Callback";
-  scale3d_Callback_1_(mthis, __arg_0) => scale3d_Callback_1(mthis, __arg_0);
+  scale3d_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "scale3d", [__arg_0, __arg_1, __arg_2]);
 
-  static scale3d_Callback_2(mthis, __arg_0, __arg_1) native "DOMMatrixReadOnly_scale3d_Callback";
-  scale3d_Callback_2_(mthis, __arg_0, __arg_1) => scale3d_Callback_2(mthis, __arg_0, __arg_1);
+  scale3d_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "scale3d", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static scale3d_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "DOMMatrixReadOnly_scale3d_Callback";
-  scale3d_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => scale3d_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  scaleNonUniform_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "scaleNonUniform", []);
 
-  static scale3d_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "DOMMatrixReadOnly_scale3d_Callback";
-  scale3d_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => scale3d_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  scaleNonUniform_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "scaleNonUniform", [__arg_0]);
 
-  static scale3d_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "DOMMatrixReadOnly_scale3d_Callback";
-  scale3d_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => scale3d_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  scaleNonUniform_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "scaleNonUniform", [__arg_0, __arg_1]);
 
-  static scale3d_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "DOMMatrixReadOnly_scale3d_Callback";
-  scale3d_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => scale3d_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  scaleNonUniform_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "scaleNonUniform", [__arg_0, __arg_1, __arg_2]);
 
-  static scaleNonUniform_Callback_0(mthis) native "DOMMatrixReadOnly_scaleNonUniform_Callback";
-  scaleNonUniform_Callback_0_(mthis) => scaleNonUniform_Callback_0(mthis);
+  scaleNonUniform_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "scaleNonUniform", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static scaleNonUniform_Callback_1(mthis, __arg_0) native "DOMMatrixReadOnly_scaleNonUniform_Callback";
-  scaleNonUniform_Callback_1_(mthis, __arg_0) => scaleNonUniform_Callback_1(mthis, __arg_0);
+  scaleNonUniform_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => Blink_JsNative_DomException.callMethod(mthis, "scaleNonUniform", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4]);
 
-  static scaleNonUniform_Callback_2(mthis, __arg_0, __arg_1) native "DOMMatrixReadOnly_scaleNonUniform_Callback";
-  scaleNonUniform_Callback_2_(mthis, __arg_0, __arg_1) => scaleNonUniform_Callback_2(mthis, __arg_0, __arg_1);
+  scaleNonUniform_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => Blink_JsNative_DomException.callMethod(mthis, "scaleNonUniform", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5]);
 
-  static scaleNonUniform_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "DOMMatrixReadOnly_scaleNonUniform_Callback";
-  scaleNonUniform_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => scaleNonUniform_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  scale_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "scale", []);
 
-  static scaleNonUniform_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "DOMMatrixReadOnly_scaleNonUniform_Callback";
-  scaleNonUniform_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => scaleNonUniform_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  scale_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "scale", [__arg_0]);
 
-  static scaleNonUniform_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "DOMMatrixReadOnly_scaleNonUniform_Callback";
-  scaleNonUniform_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => scaleNonUniform_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  scale_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "scale", [__arg_0, __arg_1]);
 
-  static scaleNonUniform_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "DOMMatrixReadOnly_scaleNonUniform_Callback";
-  scaleNonUniform_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => scaleNonUniform_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  scale_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "scale", [__arg_0, __arg_1, __arg_2]);
 
-  static scaleNonUniform_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) native "DOMMatrixReadOnly_scaleNonUniform_Callback";
-  scaleNonUniform_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => scaleNonUniform_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6);
+  toFloat32Array_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "toFloat32Array", []);
 
-  static scaleNonUniform_Callback_8(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) native "DOMMatrixReadOnly_scaleNonUniform_Callback";
-  scaleNonUniform_Callback_8_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) => scaleNonUniform_Callback_8(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7);
+  toFloat64Array_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "toFloat64Array", []);
 
-  static scale_Callback_0(mthis) native "DOMMatrixReadOnly_scale_Callback";
-  scale_Callback_0_(mthis) => scale_Callback_0(mthis);
+  translate_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "translate", []);
 
-  static scale_Callback_1(mthis, __arg_0) native "DOMMatrixReadOnly_scale_Callback";
-  scale_Callback_1_(mthis, __arg_0) => scale_Callback_1(mthis, __arg_0);
+  translate_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "translate", [__arg_0]);
 
-  static scale_Callback_2(mthis, __arg_0, __arg_1) native "DOMMatrixReadOnly_scale_Callback";
-  scale_Callback_2_(mthis, __arg_0, __arg_1) => scale_Callback_2(mthis, __arg_0, __arg_1);
+  translate_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "translate", [__arg_0, __arg_1]);
 
-  static scale_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "DOMMatrixReadOnly_scale_Callback";
-  scale_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => scale_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static scale_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "DOMMatrixReadOnly_scale_Callback";
-  scale_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => scale_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static scale_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "DOMMatrixReadOnly_scale_Callback";
-  scale_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => scale_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
-
-  static toFloat32Array_Callback_0(mthis) native "DOMMatrixReadOnly_toFloat32Array_Callback";
-  toFloat32Array_Callback_0_(mthis) => toFloat32Array_Callback_0(mthis);
-
-  static toFloat32Array_Callback_1(mthis, __arg_0) native "DOMMatrixReadOnly_toFloat32Array_Callback";
-  toFloat32Array_Callback_1_(mthis, __arg_0) => toFloat32Array_Callback_1(mthis, __arg_0);
-
-  static toFloat32Array_Callback_2(mthis, __arg_0, __arg_1) native "DOMMatrixReadOnly_toFloat32Array_Callback";
-  toFloat32Array_Callback_2_(mthis, __arg_0, __arg_1) => toFloat32Array_Callback_2(mthis, __arg_0, __arg_1);
-
-  static toFloat64Array_Callback_0(mthis) native "DOMMatrixReadOnly_toFloat64Array_Callback";
-  toFloat64Array_Callback_0_(mthis) => toFloat64Array_Callback_0(mthis);
-
-  static toFloat64Array_Callback_1(mthis, __arg_0) native "DOMMatrixReadOnly_toFloat64Array_Callback";
-  toFloat64Array_Callback_1_(mthis, __arg_0) => toFloat64Array_Callback_1(mthis, __arg_0);
-
-  static toFloat64Array_Callback_2(mthis, __arg_0, __arg_1) native "DOMMatrixReadOnly_toFloat64Array_Callback";
-  toFloat64Array_Callback_2_(mthis, __arg_0, __arg_1) => toFloat64Array_Callback_2(mthis, __arg_0, __arg_1);
-
-  static translate_Callback_0(mthis) native "DOMMatrixReadOnly_translate_Callback";
-  translate_Callback_0_(mthis) => translate_Callback_0(mthis);
-
-  static translate_Callback_1(mthis, __arg_0) native "DOMMatrixReadOnly_translate_Callback";
-  translate_Callback_1_(mthis, __arg_0) => translate_Callback_1(mthis, __arg_0);
-
-  static translate_Callback_2(mthis, __arg_0, __arg_1) native "DOMMatrixReadOnly_translate_Callback";
-  translate_Callback_2_(mthis, __arg_0, __arg_1) => translate_Callback_2(mthis, __arg_0, __arg_1);
-
-  static translate_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "DOMMatrixReadOnly_translate_Callback";
-  translate_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => translate_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static translate_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "DOMMatrixReadOnly_translate_Callback";
-  translate_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => translate_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static translate_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "DOMMatrixReadOnly_translate_Callback";
-  translate_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => translate_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  translate_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "translate", [__arg_0, __arg_1, __arg_2]);
 
 }
 
 class BlinkDOMParser {
   static final instance = new BlinkDOMParser();
 
-  static constructorCallback_0() native "DOMParser_constructorCallback";
-  constructorCallback_0_() => constructorCallback_0();
+  constructorCallback_0_() => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "DOMParser"), []);
 
-  static constructorCallback_1(__arg_0) native "DOMParser_constructorCallback";
-  constructorCallback_1_(__arg_0) => constructorCallback_1(__arg_0);
+  parseFromString_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "parseFromString", []);
 
-  static constructorCallback_2(__arg_0, __arg_1) native "DOMParser_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  parseFromString_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "parseFromString", [__arg_0]);
 
-  static parseFromString_Callback_0(mthis) native "DOMParser_parseFromString_Callback";
-  parseFromString_Callback_0_(mthis) => parseFromString_Callback_0(mthis);
-
-  static parseFromString_Callback_1(mthis, __arg_0) native "DOMParser_parseFromString_Callback";
-  parseFromString_Callback_1_(mthis, __arg_0) => parseFromString_Callback_1(mthis, __arg_0);
-
-  static parseFromString_Callback_2(mthis, __arg_0, __arg_1) native "DOMParser_parseFromString_Callback";
-  parseFromString_Callback_2_(mthis, __arg_0, __arg_1) => parseFromString_Callback_2(mthis, __arg_0, __arg_1);
-
-  static parseFromString_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "DOMParser_parseFromString_Callback";
-  parseFromString_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => parseFromString_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static parseFromString_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "DOMParser_parseFromString_Callback";
-  parseFromString_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => parseFromString_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  parseFromString_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "parseFromString", [__arg_0, __arg_1]);
 
 }
 
 class BlinkDOMPoint extends BlinkDOMPointReadOnly {
   static final instance = new BlinkDOMPoint();
 
-  static constructorCallback_0() native "DOMPoint_constructorCallback";
-  constructorCallback_0_() => constructorCallback_0();
+  constructorCallback_0_() => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "DOMPoint"), []);
 
-  static constructorCallback_1(__arg_0) native "DOMPoint_constructorCallback";
-  constructorCallback_1_(__arg_0) => constructorCallback_1(__arg_0);
+  constructorCallback_1_(__arg_0) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "DOMPoint"), [__arg_0]);
 
-  static constructorCallback_2(__arg_0, __arg_1) native "DOMPoint_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  constructorCallback_2_(__arg_0, __arg_1) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "DOMPoint"), [__arg_0, __arg_1]);
 
-  static constructorCallback_3(__arg_0, __arg_1, __arg_2) native "DOMPoint_constructorCallback";
-  constructorCallback_3_(__arg_0, __arg_1, __arg_2) => constructorCallback_3(__arg_0, __arg_1, __arg_2);
+  constructorCallback_3_(__arg_0, __arg_1, __arg_2) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "DOMPoint"), [__arg_0, __arg_1, __arg_2]);
 
-  static constructorCallback_4(__arg_0, __arg_1, __arg_2, __arg_3) native "DOMPoint_constructorCallback";
-  constructorCallback_4_(__arg_0, __arg_1, __arg_2, __arg_3) => constructorCallback_4(__arg_0, __arg_1, __arg_2, __arg_3);
+  constructorCallback_4_(__arg_0, __arg_1, __arg_2, __arg_3) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "DOMPoint"), [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static constructorCallback_5(__arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "DOMPoint_constructorCallback";
-  constructorCallback_5_(__arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => constructorCallback_5(__arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  w_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "w");
 
-  static constructorCallback_6(__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "DOMPoint_constructorCallback";
-  constructorCallback_6_(__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => constructorCallback_6(__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  w_Setter_(mthis, __arg_0) => mthis["w"] = __arg_0;
 
-  static w_Getter(mthis) native "DOMPoint_w_Getter";
-  w_Getter_(mthis) => w_Getter(mthis);
+  x_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "x");
 
-  static w_Setter(mthis, __arg_0) native "DOMPoint_w_Setter";
-  w_Setter_(mthis, __arg_0) => w_Setter(mthis, __arg_0);
+  x_Setter_(mthis, __arg_0) => mthis["x"] = __arg_0;
 
-  static x_Getter(mthis) native "DOMPoint_x_Getter";
-  x_Getter_(mthis) => x_Getter(mthis);
+  y_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "y");
 
-  static x_Setter(mthis, __arg_0) native "DOMPoint_x_Setter";
-  x_Setter_(mthis, __arg_0) => x_Setter(mthis, __arg_0);
+  y_Setter_(mthis, __arg_0) => mthis["y"] = __arg_0;
 
-  static y_Getter(mthis) native "DOMPoint_y_Getter";
-  y_Getter_(mthis) => y_Getter(mthis);
+  z_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "z");
 
-  static y_Setter(mthis, __arg_0) native "DOMPoint_y_Setter";
-  y_Setter_(mthis, __arg_0) => y_Setter(mthis, __arg_0);
-
-  static z_Getter(mthis) native "DOMPoint_z_Getter";
-  z_Getter_(mthis) => z_Getter(mthis);
-
-  static z_Setter(mthis, __arg_0) native "DOMPoint_z_Setter";
-  z_Setter_(mthis, __arg_0) => z_Setter(mthis, __arg_0);
+  z_Setter_(mthis, __arg_0) => mthis["z"] = __arg_0;
 
 }
 
 class BlinkDOMPointReadOnly {
   static final instance = new BlinkDOMPointReadOnly();
 
-  static constructorCallback_2(__arg_0, __arg_1) native "DOMPointReadOnly_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  constructorCallback_2_(__arg_0, __arg_1) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "DOMPointReadOnly"), [__arg_0, __arg_1]);
 
-  static constructorCallback_3(__arg_0, __arg_1, __arg_2) native "DOMPointReadOnly_constructorCallback";
-  constructorCallback_3_(__arg_0, __arg_1, __arg_2) => constructorCallback_3(__arg_0, __arg_1, __arg_2);
+  constructorCallback_3_(__arg_0, __arg_1, __arg_2) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "DOMPointReadOnly"), [__arg_0, __arg_1, __arg_2]);
 
-  static constructorCallback_4(__arg_0, __arg_1, __arg_2, __arg_3) native "DOMPointReadOnly_constructorCallback";
-  constructorCallback_4_(__arg_0, __arg_1, __arg_2, __arg_3) => constructorCallback_4(__arg_0, __arg_1, __arg_2, __arg_3);
+  constructorCallback_4_(__arg_0, __arg_1, __arg_2, __arg_3) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "DOMPointReadOnly"), [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static constructorCallback_5(__arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "DOMPointReadOnly_constructorCallback";
-  constructorCallback_5_(__arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => constructorCallback_5(__arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  w_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "w");
 
-  static constructorCallback_6(__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "DOMPointReadOnly_constructorCallback";
-  constructorCallback_6_(__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => constructorCallback_6(__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  x_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "x");
 
-  static w_Getter(mthis) native "DOMPointReadOnly_w_Getter";
-  w_Getter_(mthis) => w_Getter(mthis);
+  y_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "y");
 
-  static x_Getter(mthis) native "DOMPointReadOnly_x_Getter";
-  x_Getter_(mthis) => x_Getter(mthis);
-
-  static y_Getter(mthis) native "DOMPointReadOnly_y_Getter";
-  y_Getter_(mthis) => y_Getter(mthis);
-
-  static z_Getter(mthis) native "DOMPointReadOnly_z_Getter";
-  z_Getter_(mthis) => z_Getter(mthis);
+  z_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "z");
 
 }
 
 class BlinkDOMRect extends BlinkDOMRectReadOnly {
   static final instance = new BlinkDOMRect();
 
-  static constructorCallback_0() native "DOMRect_constructorCallback";
-  constructorCallback_0_() => constructorCallback_0();
+  constructorCallback_0_() => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "DOMRect"), []);
 
-  static constructorCallback_1(__arg_0) native "DOMRect_constructorCallback";
-  constructorCallback_1_(__arg_0) => constructorCallback_1(__arg_0);
+  constructorCallback_1_(__arg_0) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "DOMRect"), [__arg_0]);
 
-  static constructorCallback_2(__arg_0, __arg_1) native "DOMRect_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  constructorCallback_2_(__arg_0, __arg_1) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "DOMRect"), [__arg_0, __arg_1]);
 
-  static constructorCallback_3(__arg_0, __arg_1, __arg_2) native "DOMRect_constructorCallback";
-  constructorCallback_3_(__arg_0, __arg_1, __arg_2) => constructorCallback_3(__arg_0, __arg_1, __arg_2);
+  constructorCallback_3_(__arg_0, __arg_1, __arg_2) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "DOMRect"), [__arg_0, __arg_1, __arg_2]);
 
-  static constructorCallback_4(__arg_0, __arg_1, __arg_2, __arg_3) native "DOMRect_constructorCallback";
-  constructorCallback_4_(__arg_0, __arg_1, __arg_2, __arg_3) => constructorCallback_4(__arg_0, __arg_1, __arg_2, __arg_3);
+  constructorCallback_4_(__arg_0, __arg_1, __arg_2, __arg_3) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "DOMRect"), [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static constructorCallback_5(__arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "DOMRect_constructorCallback";
-  constructorCallback_5_(__arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => constructorCallback_5(__arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  height_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "height");
 
-  static constructorCallback_6(__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "DOMRect_constructorCallback";
-  constructorCallback_6_(__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => constructorCallback_6(__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  height_Setter_(mthis, __arg_0) => mthis["height"] = __arg_0;
 
-  static height_Getter(mthis) native "DOMRect_height_Getter";
-  height_Getter_(mthis) => height_Getter(mthis);
+  width_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "width");
 
-  static height_Setter(mthis, __arg_0) native "DOMRect_height_Setter";
-  height_Setter_(mthis, __arg_0) => height_Setter(mthis, __arg_0);
+  width_Setter_(mthis, __arg_0) => mthis["width"] = __arg_0;
 
-  static width_Getter(mthis) native "DOMRect_width_Getter";
-  width_Getter_(mthis) => width_Getter(mthis);
+  x_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "x");
 
-  static width_Setter(mthis, __arg_0) native "DOMRect_width_Setter";
-  width_Setter_(mthis, __arg_0) => width_Setter(mthis, __arg_0);
+  x_Setter_(mthis, __arg_0) => mthis["x"] = __arg_0;
 
-  static x_Getter(mthis) native "DOMRect_x_Getter";
-  x_Getter_(mthis) => x_Getter(mthis);
+  y_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "y");
 
-  static x_Setter(mthis, __arg_0) native "DOMRect_x_Setter";
-  x_Setter_(mthis, __arg_0) => x_Setter(mthis, __arg_0);
-
-  static y_Getter(mthis) native "DOMRect_y_Getter";
-  y_Getter_(mthis) => y_Getter(mthis);
-
-  static y_Setter(mthis, __arg_0) native "DOMRect_y_Setter";
-  y_Setter_(mthis, __arg_0) => y_Setter(mthis, __arg_0);
+  y_Setter_(mthis, __arg_0) => mthis["y"] = __arg_0;
 
 }
 
 class BlinkDOMRectReadOnly {
   static final instance = new BlinkDOMRectReadOnly();
 
-  static bottom_Getter(mthis) native "DOMRectReadOnly_bottom_Getter";
-  bottom_Getter_(mthis) => bottom_Getter(mthis);
+  bottom_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "bottom");
 
-  static constructorCallback_2(__arg_0, __arg_1) native "DOMRectReadOnly_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  constructorCallback_2_(__arg_0, __arg_1) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "DOMRectReadOnly"), [__arg_0, __arg_1]);
 
-  static constructorCallback_3(__arg_0, __arg_1, __arg_2) native "DOMRectReadOnly_constructorCallback";
-  constructorCallback_3_(__arg_0, __arg_1, __arg_2) => constructorCallback_3(__arg_0, __arg_1, __arg_2);
+  constructorCallback_3_(__arg_0, __arg_1, __arg_2) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "DOMRectReadOnly"), [__arg_0, __arg_1, __arg_2]);
 
-  static constructorCallback_4(__arg_0, __arg_1, __arg_2, __arg_3) native "DOMRectReadOnly_constructorCallback";
-  constructorCallback_4_(__arg_0, __arg_1, __arg_2, __arg_3) => constructorCallback_4(__arg_0, __arg_1, __arg_2, __arg_3);
+  constructorCallback_4_(__arg_0, __arg_1, __arg_2, __arg_3) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "DOMRectReadOnly"), [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static constructorCallback_5(__arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "DOMRectReadOnly_constructorCallback";
-  constructorCallback_5_(__arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => constructorCallback_5(__arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  height_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "height");
 
-  static constructorCallback_6(__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "DOMRectReadOnly_constructorCallback";
-  constructorCallback_6_(__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => constructorCallback_6(__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  left_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "left");
 
-  static height_Getter(mthis) native "DOMRectReadOnly_height_Getter";
-  height_Getter_(mthis) => height_Getter(mthis);
+  right_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "right");
 
-  static left_Getter(mthis) native "DOMRectReadOnly_left_Getter";
-  left_Getter_(mthis) => left_Getter(mthis);
+  top_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "top");
 
-  static right_Getter(mthis) native "DOMRectReadOnly_right_Getter";
-  right_Getter_(mthis) => right_Getter(mthis);
+  width_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "width");
 
-  static top_Getter(mthis) native "DOMRectReadOnly_top_Getter";
-  top_Getter_(mthis) => top_Getter(mthis);
+  x_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "x");
 
-  static width_Getter(mthis) native "DOMRectReadOnly_width_Getter";
-  width_Getter_(mthis) => width_Getter(mthis);
-
-  static x_Getter(mthis) native "DOMRectReadOnly_x_Getter";
-  x_Getter_(mthis) => x_Getter(mthis);
-
-  static y_Getter(mthis) native "DOMRectReadOnly_y_Getter";
-  y_Getter_(mthis) => y_Getter(mthis);
+  y_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "y");
 
 }
 
 class BlinkDOMSettableTokenList extends BlinkDOMTokenList {
   static final instance = new BlinkDOMSettableTokenList();
 
-  static $__getter___Callback_1(mthis, __arg_0) native "DOMSettableTokenList___getter___Callback";
-  $__getter___Callback_1_(mthis, __arg_0) => $__getter___Callback_1(mthis, __arg_0);
+  $__getter___Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "__getter__", [__arg_0]);
 
-  static value_Getter(mthis) native "DOMSettableTokenList_value_Getter";
-  value_Getter_(mthis) => value_Getter(mthis);
+  value_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "value");
 
-  static value_Setter(mthis, __arg_0) native "DOMSettableTokenList_value_Setter";
-  value_Setter_(mthis, __arg_0) => value_Setter(mthis, __arg_0);
+  value_Setter_(mthis, __arg_0) => mthis["value"] = __arg_0;
 
 }
 
 class BlinkDOMStringList {
   static final instance = new BlinkDOMStringList();
 
-  static $__getter___Callback_1(mthis, __arg_0) native "DOMStringList___getter___Callback";
-  $__getter___Callback_1_(mthis, __arg_0) => $__getter___Callback_1(mthis, __arg_0);
+  $__getter___Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "__getter__", [__arg_0]);
 
-  static contains_Callback_0(mthis) native "DOMStringList_contains_Callback";
-  contains_Callback_0_(mthis) => contains_Callback_0(mthis);
+  contains_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "contains", []);
 
-  static contains_Callback_1(mthis, __arg_0) native "DOMStringList_contains_Callback";
-  contains_Callback_1_(mthis, __arg_0) => contains_Callback_1(mthis, __arg_0);
+  contains_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "contains", [__arg_0]);
 
-  static contains_Callback_2(mthis, __arg_0, __arg_1) native "DOMStringList_contains_Callback";
-  contains_Callback_2_(mthis, __arg_0, __arg_1) => contains_Callback_2(mthis, __arg_0, __arg_1);
+  item_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "item", []);
 
-  static contains_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "DOMStringList_contains_Callback";
-  contains_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => contains_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  item_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "item", [__arg_0]);
 
-  static item_Callback_0(mthis) native "DOMStringList_item_Callback";
-  item_Callback_0_(mthis) => item_Callback_0(mthis);
-
-  static item_Callback_1(mthis, __arg_0) native "DOMStringList_item_Callback";
-  item_Callback_1_(mthis, __arg_0) => item_Callback_1(mthis, __arg_0);
-
-  static item_Callback_2(mthis, __arg_0, __arg_1) native "DOMStringList_item_Callback";
-  item_Callback_2_(mthis, __arg_0, __arg_1) => item_Callback_2(mthis, __arg_0, __arg_1);
-
-  static item_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "DOMStringList_item_Callback";
-  item_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => item_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static length_Getter(mthis) native "DOMStringList_length_Getter";
-  length_Getter_(mthis) => length_Getter(mthis);
+  length_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "length");
 
 }
 
 class BlinkDOMStringMap {
   static final instance = new BlinkDOMStringMap();
 
-  static $__delete___Callback_1(mthis, __arg_0) native "DOMStringMap___delete___Callback";
-  $__delete___Callback_1_(mthis, __arg_0) => $__delete___Callback_1(mthis, __arg_0);
+  $__delete___Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "__delete__", [__arg_0]);
 
-  static $__getter___Callback_1(mthis, __arg_0) native "DOMStringMap___getter___Callback";
-  $__getter___Callback_1_(mthis, __arg_0) => $__getter___Callback_1(mthis, __arg_0);
+  $__getter___Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "__getter__", [__arg_0]);
 
-  static $__setter___Callback_2(mthis, __arg_0, __arg_1) native "DOMStringMap___setter___Callback";
-  $__setter___Callback_2_(mthis, __arg_0, __arg_1) => $__setter___Callback_2(mthis, __arg_0, __arg_1);
+  $__setter___Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "__setter__", [__arg_0, __arg_1]);
 
 }
 
 class BlinkDOMTokenList {
   static final instance = new BlinkDOMTokenList();
 
-  static $__getter___Callback_1(mthis, __arg_0) native "DOMTokenList___getter___Callback";
-  $__getter___Callback_1_(mthis, __arg_0) => $__getter___Callback_1(mthis, __arg_0);
+  $__getter___Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "__getter__", [__arg_0]);
 
-  static add_Callback_0(mthis) native "DOMTokenList_add_Callback";
-  add_Callback_0_(mthis) => add_Callback_0(mthis);
+  add_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "add", []);
 
-  static add_Callback_1(mthis, __arg_0) native "DOMTokenList_add_Callback";
-  add_Callback_1_(mthis, __arg_0) => add_Callback_1(mthis, __arg_0);
+  add_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "add", [__arg_0]);
 
-  static add_Callback_2(mthis, __arg_0, __arg_1) native "DOMTokenList_add_Callback";
-  add_Callback_2_(mthis, __arg_0, __arg_1) => add_Callback_2(mthis, __arg_0, __arg_1);
+  contains_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "contains", []);
 
-  static add_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "DOMTokenList_add_Callback";
-  add_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => add_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  contains_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "contains", [__arg_0]);
 
-  static contains_Callback_0(mthis) native "DOMTokenList_contains_Callback";
-  contains_Callback_0_(mthis) => contains_Callback_0(mthis);
+  item_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "item", []);
 
-  static contains_Callback_1(mthis, __arg_0) native "DOMTokenList_contains_Callback";
-  contains_Callback_1_(mthis, __arg_0) => contains_Callback_1(mthis, __arg_0);
+  item_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "item", [__arg_0]);
 
-  static contains_Callback_2(mthis, __arg_0, __arg_1) native "DOMTokenList_contains_Callback";
-  contains_Callback_2_(mthis, __arg_0, __arg_1) => contains_Callback_2(mthis, __arg_0, __arg_1);
+  length_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "length");
 
-  static contains_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "DOMTokenList_contains_Callback";
-  contains_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => contains_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  remove_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "remove", []);
 
-  static item_Callback_0(mthis) native "DOMTokenList_item_Callback";
-  item_Callback_0_(mthis) => item_Callback_0(mthis);
+  remove_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "remove", [__arg_0]);
 
-  static item_Callback_1(mthis, __arg_0) native "DOMTokenList_item_Callback";
-  item_Callback_1_(mthis, __arg_0) => item_Callback_1(mthis, __arg_0);
+  toggle_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "toggle", []);
 
-  static item_Callback_2(mthis, __arg_0, __arg_1) native "DOMTokenList_item_Callback";
-  item_Callback_2_(mthis, __arg_0, __arg_1) => item_Callback_2(mthis, __arg_0, __arg_1);
+  toggle_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "toggle", [__arg_0]);
 
-  static item_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "DOMTokenList_item_Callback";
-  item_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => item_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static length_Getter(mthis) native "DOMTokenList_length_Getter";
-  length_Getter_(mthis) => length_Getter(mthis);
-
-  static remove_Callback_0(mthis) native "DOMTokenList_remove_Callback";
-  remove_Callback_0_(mthis) => remove_Callback_0(mthis);
-
-  static remove_Callback_1(mthis, __arg_0) native "DOMTokenList_remove_Callback";
-  remove_Callback_1_(mthis, __arg_0) => remove_Callback_1(mthis, __arg_0);
-
-  static remove_Callback_2(mthis, __arg_0, __arg_1) native "DOMTokenList_remove_Callback";
-  remove_Callback_2_(mthis, __arg_0, __arg_1) => remove_Callback_2(mthis, __arg_0, __arg_1);
-
-  static remove_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "DOMTokenList_remove_Callback";
-  remove_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => remove_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static toggle_Callback_0(mthis) native "DOMTokenList_toggle_Callback";
-  toggle_Callback_0_(mthis) => toggle_Callback_0(mthis);
-
-  static toggle_Callback_1(mthis, __arg_0) native "DOMTokenList_toggle_Callback";
-  toggle_Callback_1_(mthis, __arg_0) => toggle_Callback_1(mthis, __arg_0);
-
-  static toggle_Callback_2(mthis, __arg_0, __arg_1) native "DOMTokenList_toggle_Callback";
-  toggle_Callback_2_(mthis, __arg_0, __arg_1) => toggle_Callback_2(mthis, __arg_0, __arg_1);
-
-  static toggle_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "DOMTokenList_toggle_Callback";
-  toggle_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => toggle_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static toggle_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "DOMTokenList_toggle_Callback";
-  toggle_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => toggle_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  toggle_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "toggle", [__arg_0, __arg_1]);
 
 }
 
 class BlinkDataTransfer {
   static final instance = new BlinkDataTransfer();
 
-  static clearData_Callback_0(mthis) native "DataTransfer_clearData_Callback";
-  clearData_Callback_0_(mthis) => clearData_Callback_0(mthis);
+  clearData_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "clearData", []);
 
-  static clearData_Callback_1(mthis, __arg_0) native "DataTransfer_clearData_Callback";
-  clearData_Callback_1_(mthis, __arg_0) => clearData_Callback_1(mthis, __arg_0);
+  clearData_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "clearData", [__arg_0]);
 
-  static clearData_Callback_2(mthis, __arg_0, __arg_1) native "DataTransfer_clearData_Callback";
-  clearData_Callback_2_(mthis, __arg_0, __arg_1) => clearData_Callback_2(mthis, __arg_0, __arg_1);
+  dropEffect_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "dropEffect");
 
-  static clearData_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "DataTransfer_clearData_Callback";
-  clearData_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => clearData_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  dropEffect_Setter_(mthis, __arg_0) => mthis["dropEffect"] = __arg_0;
 
-  static dropEffect_Getter(mthis) native "DataTransfer_dropEffect_Getter";
-  dropEffect_Getter_(mthis) => dropEffect_Getter(mthis);
+  effectAllowed_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "effectAllowed");
 
-  static dropEffect_Setter(mthis, __arg_0) native "DataTransfer_dropEffect_Setter";
-  dropEffect_Setter_(mthis, __arg_0) => dropEffect_Setter(mthis, __arg_0);
+  effectAllowed_Setter_(mthis, __arg_0) => mthis["effectAllowed"] = __arg_0;
 
-  static effectAllowed_Getter(mthis) native "DataTransfer_effectAllowed_Getter";
-  effectAllowed_Getter_(mthis) => effectAllowed_Getter(mthis);
+  files_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "files");
 
-  static effectAllowed_Setter(mthis, __arg_0) native "DataTransfer_effectAllowed_Setter";
-  effectAllowed_Setter_(mthis, __arg_0) => effectAllowed_Setter(mthis, __arg_0);
+  getData_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getData", []);
 
-  static files_Getter(mthis) native "DataTransfer_files_Getter";
-  files_Getter_(mthis) => files_Getter(mthis);
+  getData_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getData", [__arg_0]);
 
-  static getData_Callback_0(mthis) native "DataTransfer_getData_Callback";
-  getData_Callback_0_(mthis) => getData_Callback_0(mthis);
+  items_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "items");
 
-  static getData_Callback_1(mthis, __arg_0) native "DataTransfer_getData_Callback";
-  getData_Callback_1_(mthis, __arg_0) => getData_Callback_1(mthis, __arg_0);
+  setData_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "setData", []);
 
-  static getData_Callback_2(mthis, __arg_0, __arg_1) native "DataTransfer_getData_Callback";
-  getData_Callback_2_(mthis, __arg_0, __arg_1) => getData_Callback_2(mthis, __arg_0, __arg_1);
+  setData_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "setData", [__arg_0]);
 
-  static getData_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "DataTransfer_getData_Callback";
-  getData_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getData_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  setData_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "setData", [__arg_0, __arg_1]);
 
-  static items_Getter(mthis) native "DataTransfer_items_Getter";
-  items_Getter_(mthis) => items_Getter(mthis);
+  setDragImage_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "setDragImage", [__arg_0]);
 
-  static setData_Callback_0(mthis) native "DataTransfer_setData_Callback";
-  setData_Callback_0_(mthis) => setData_Callback_0(mthis);
+  setDragImage_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "setDragImage", [__arg_0, __arg_1]);
 
-  static setData_Callback_1(mthis, __arg_0) native "DataTransfer_setData_Callback";
-  setData_Callback_1_(mthis, __arg_0) => setData_Callback_1(mthis, __arg_0);
+  setDragImage_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "setDragImage", [__arg_0, __arg_1, __arg_2]);
 
-  static setData_Callback_2(mthis, __arg_0, __arg_1) native "DataTransfer_setData_Callback";
-  setData_Callback_2_(mthis, __arg_0, __arg_1) => setData_Callback_2(mthis, __arg_0, __arg_1);
-
-  static setData_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "DataTransfer_setData_Callback";
-  setData_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => setData_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static setData_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "DataTransfer_setData_Callback";
-  setData_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => setData_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static setDragImage_Callback_1(mthis, __arg_0) native "DataTransfer_setDragImage_Callback";
-  setDragImage_Callback_1_(mthis, __arg_0) => setDragImage_Callback_1(mthis, __arg_0);
-
-  static setDragImage_Callback_2(mthis, __arg_0, __arg_1) native "DataTransfer_setDragImage_Callback";
-  setDragImage_Callback_2_(mthis, __arg_0, __arg_1) => setDragImage_Callback_2(mthis, __arg_0, __arg_1);
-
-  static setDragImage_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "DataTransfer_setDragImage_Callback";
-  setDragImage_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => setDragImage_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static setDragImage_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "DataTransfer_setDragImage_Callback";
-  setDragImage_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => setDragImage_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static setDragImage_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "DataTransfer_setDragImage_Callback";
-  setDragImage_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => setDragImage_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
-
-  static types_Getter(mthis) native "DataTransfer_types_Getter";
-  types_Getter_(mthis) => types_Getter(mthis);
+  types_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "types");
 
 }
 
 class BlinkDataTransferItem {
   static final instance = new BlinkDataTransferItem();
 
-  static getAsFile_Callback_0(mthis) native "DataTransferItem_getAsFile_Callback";
-  getAsFile_Callback_0_(mthis) => getAsFile_Callback_0(mthis);
+  getAsFile_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getAsFile", []);
 
-  static getAsFile_Callback_1(mthis, __arg_0) native "DataTransferItem_getAsFile_Callback";
-  getAsFile_Callback_1_(mthis, __arg_0) => getAsFile_Callback_1(mthis, __arg_0);
+  getAsString_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getAsString", []);
 
-  static getAsFile_Callback_2(mthis, __arg_0, __arg_1) native "DataTransferItem_getAsFile_Callback";
-  getAsFile_Callback_2_(mthis, __arg_0, __arg_1) => getAsFile_Callback_2(mthis, __arg_0, __arg_1);
+  getAsString_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getAsString", [__arg_0]);
 
-  static getAsString_Callback_0(mthis) native "DataTransferItem_getAsString_Callback";
-  getAsString_Callback_0_(mthis) => getAsString_Callback_0(mthis);
+  kind_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "kind");
 
-  static getAsString_Callback_1(mthis, __arg_0) native "DataTransferItem_getAsString_Callback";
-  getAsString_Callback_1_(mthis, __arg_0) => getAsString_Callback_1(mthis, __arg_0);
+  type_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "type");
 
-  static getAsString_Callback_2(mthis, __arg_0, __arg_1) native "DataTransferItem_getAsString_Callback";
-  getAsString_Callback_2_(mthis, __arg_0, __arg_1) => getAsString_Callback_2(mthis, __arg_0, __arg_1);
-
-  static getAsString_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "DataTransferItem_getAsString_Callback";
-  getAsString_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getAsString_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static kind_Getter(mthis) native "DataTransferItem_kind_Getter";
-  kind_Getter_(mthis) => kind_Getter(mthis);
-
-  static type_Getter(mthis) native "DataTransferItem_type_Getter";
-  type_Getter_(mthis) => type_Getter(mthis);
-
-  static webkitGetAsEntry_Callback_0(mthis) native "DataTransferItem_webkitGetAsEntry_Callback";
-  webkitGetAsEntry_Callback_0_(mthis) => webkitGetAsEntry_Callback_0(mthis);
-
-  static webkitGetAsEntry_Callback_1(mthis, __arg_0) native "DataTransferItem_webkitGetAsEntry_Callback";
-  webkitGetAsEntry_Callback_1_(mthis, __arg_0) => webkitGetAsEntry_Callback_1(mthis, __arg_0);
-
-  static webkitGetAsEntry_Callback_2(mthis, __arg_0, __arg_1) native "DataTransferItem_webkitGetAsEntry_Callback";
-  webkitGetAsEntry_Callback_2_(mthis, __arg_0, __arg_1) => webkitGetAsEntry_Callback_2(mthis, __arg_0, __arg_1);
+  webkitGetAsEntry_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "webkitGetAsEntry", []);
 
 }
 
 class BlinkDataTransferItemList {
   static final instance = new BlinkDataTransferItemList();
 
-  static $__getter___Callback_1(mthis, __arg_0) native "DataTransferItemList___getter___Callback";
-  $__getter___Callback_1_(mthis, __arg_0) => $__getter___Callback_1(mthis, __arg_0);
+  $__getter___Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "__getter__", [__arg_0]);
 
-  static add_Callback_0(mthis) native "DataTransferItemList_add_Callback";
-  add_Callback_0_(mthis) => add_Callback_0(mthis);
+  add_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "add", []);
 
-  static add_Callback_1(mthis, __arg_0) native "DataTransferItemList_add_Callback";
-  add_Callback_1_(mthis, __arg_0) => add_Callback_1(mthis, __arg_0);
+  add_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "add", [__arg_0]);
 
-  static add_Callback_2(mthis, __arg_0, __arg_1) native "DataTransferItemList_add_Callback";
-  add_Callback_2_(mthis, __arg_0, __arg_1) => add_Callback_2(mthis, __arg_0, __arg_1);
+  add_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "add", [__arg_0, __arg_1]);
 
-  static add_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "DataTransferItemList_add_Callback";
-  add_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => add_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  clear_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "clear", []);
 
-  static add_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "DataTransferItemList_add_Callback";
-  add_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => add_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  length_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "length");
 
-  static clear_Callback_0(mthis) native "DataTransferItemList_clear_Callback";
-  clear_Callback_0_(mthis) => clear_Callback_0(mthis);
+  remove_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "remove", []);
 
-  static clear_Callback_1(mthis, __arg_0) native "DataTransferItemList_clear_Callback";
-  clear_Callback_1_(mthis, __arg_0) => clear_Callback_1(mthis, __arg_0);
-
-  static clear_Callback_2(mthis, __arg_0, __arg_1) native "DataTransferItemList_clear_Callback";
-  clear_Callback_2_(mthis, __arg_0, __arg_1) => clear_Callback_2(mthis, __arg_0, __arg_1);
-
-  static length_Getter(mthis) native "DataTransferItemList_length_Getter";
-  length_Getter_(mthis) => length_Getter(mthis);
-
-  static remove_Callback_0(mthis) native "DataTransferItemList_remove_Callback";
-  remove_Callback_0_(mthis) => remove_Callback_0(mthis);
-
-  static remove_Callback_1(mthis, __arg_0) native "DataTransferItemList_remove_Callback";
-  remove_Callback_1_(mthis, __arg_0) => remove_Callback_1(mthis, __arg_0);
-
-  static remove_Callback_2(mthis, __arg_0, __arg_1) native "DataTransferItemList_remove_Callback";
-  remove_Callback_2_(mthis, __arg_0, __arg_1) => remove_Callback_2(mthis, __arg_0, __arg_1);
-
-  static remove_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "DataTransferItemList_remove_Callback";
-  remove_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => remove_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  remove_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "remove", [__arg_0]);
 
 }
 
 class BlinkDatabase {
   static final instance = new BlinkDatabase();
 
-  static changeVersion_Callback_0(mthis) native "Database_changeVersion_Callback";
-  changeVersion_Callback_0_(mthis) => changeVersion_Callback_0(mthis);
+  changeVersion_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "changeVersion", []);
 
-  static changeVersion_Callback_1(mthis, __arg_0) native "Database_changeVersion_Callback";
-  changeVersion_Callback_1_(mthis, __arg_0) => changeVersion_Callback_1(mthis, __arg_0);
+  changeVersion_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "changeVersion", [__arg_0]);
 
-  static changeVersion_Callback_2(mthis, __arg_0, __arg_1) native "Database_changeVersion_Callback";
-  changeVersion_Callback_2_(mthis, __arg_0, __arg_1) => changeVersion_Callback_2(mthis, __arg_0, __arg_1);
+  changeVersion_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "changeVersion", [__arg_0, __arg_1]);
 
-  static changeVersion_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Database_changeVersion_Callback";
-  changeVersion_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => changeVersion_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  changeVersion_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "changeVersion", [__arg_0, __arg_1, __arg_2]);
 
-  static changeVersion_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Database_changeVersion_Callback";
-  changeVersion_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => changeVersion_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  changeVersion_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "changeVersion", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static changeVersion_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "Database_changeVersion_Callback";
-  changeVersion_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => changeVersion_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  changeVersion_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => Blink_JsNative_DomException.callMethod(mthis, "changeVersion", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4]);
 
-  static changeVersion_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "Database_changeVersion_Callback";
-  changeVersion_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => changeVersion_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  readTransaction_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "readTransaction", []);
 
-  static changeVersion_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) native "Database_changeVersion_Callback";
-  changeVersion_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => changeVersion_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6);
+  readTransaction_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "readTransaction", [__arg_0]);
 
-  static readTransaction_Callback_0(mthis) native "Database_readTransaction_Callback";
-  readTransaction_Callback_0_(mthis) => readTransaction_Callback_0(mthis);
+  readTransaction_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "readTransaction", [__arg_0, __arg_1]);
 
-  static readTransaction_Callback_1(mthis, __arg_0) native "Database_readTransaction_Callback";
-  readTransaction_Callback_1_(mthis, __arg_0) => readTransaction_Callback_1(mthis, __arg_0);
+  readTransaction_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "readTransaction", [__arg_0, __arg_1, __arg_2]);
 
-  static readTransaction_Callback_2(mthis, __arg_0, __arg_1) native "Database_readTransaction_Callback";
-  readTransaction_Callback_2_(mthis, __arg_0, __arg_1) => readTransaction_Callback_2(mthis, __arg_0, __arg_1);
+  transaction_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "transaction", []);
 
-  static readTransaction_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Database_readTransaction_Callback";
-  readTransaction_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => readTransaction_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  transaction_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "transaction", [__arg_0]);
 
-  static readTransaction_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Database_readTransaction_Callback";
-  readTransaction_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => readTransaction_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  transaction_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "transaction", [__arg_0, __arg_1]);
 
-  static readTransaction_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "Database_readTransaction_Callback";
-  readTransaction_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => readTransaction_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  transaction_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "transaction", [__arg_0, __arg_1, __arg_2]);
 
-  static transaction_Callback_0(mthis) native "Database_transaction_Callback";
-  transaction_Callback_0_(mthis) => transaction_Callback_0(mthis);
-
-  static transaction_Callback_1(mthis, __arg_0) native "Database_transaction_Callback";
-  transaction_Callback_1_(mthis, __arg_0) => transaction_Callback_1(mthis, __arg_0);
-
-  static transaction_Callback_2(mthis, __arg_0, __arg_1) native "Database_transaction_Callback";
-  transaction_Callback_2_(mthis, __arg_0, __arg_1) => transaction_Callback_2(mthis, __arg_0, __arg_1);
-
-  static transaction_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Database_transaction_Callback";
-  transaction_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => transaction_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static transaction_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Database_transaction_Callback";
-  transaction_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => transaction_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static transaction_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "Database_transaction_Callback";
-  transaction_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => transaction_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
-
-  static version_Getter(mthis) native "Database_version_Getter";
-  version_Getter_(mthis) => version_Getter(mthis);
+  version_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "version");
 
 }
 
 class BlinkDedicatedWorkerGlobalScope extends BlinkWorkerGlobalScope {
   static final instance = new BlinkDedicatedWorkerGlobalScope();
 
-  static onmessage_Getter(mthis) native "DedicatedWorkerGlobalScope_onmessage_Getter";
-  onmessage_Getter_(mthis) => onmessage_Getter(mthis);
+  onmessage_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onmessage");
 
-  static onmessage_Setter(mthis, __arg_0) native "DedicatedWorkerGlobalScope_onmessage_Setter";
-  onmessage_Setter_(mthis, __arg_0) => onmessage_Setter(mthis, __arg_0);
+  onmessage_Setter_(mthis, __arg_0) => mthis["onmessage"] = __arg_0;
 
-  static postMessage_Callback_0(mthis) native "DedicatedWorkerGlobalScope_postMessage_Callback";
-  postMessage_Callback_0_(mthis) => postMessage_Callback_0(mthis);
+  postMessage_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "postMessage", []);
 
-  static postMessage_Callback_1(mthis, __arg_0) native "DedicatedWorkerGlobalScope_postMessage_Callback";
-  postMessage_Callback_1_(mthis, __arg_0) => postMessage_Callback_1(mthis, __arg_0);
+  postMessage_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "postMessage", [__arg_0]);
 
-  static postMessage_Callback_2(mthis, __arg_0, __arg_1) native "DedicatedWorkerGlobalScope_postMessage_Callback";
-  postMessage_Callback_2_(mthis, __arg_0, __arg_1) => postMessage_Callback_2(mthis, __arg_0, __arg_1);
-
-  static postMessage_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "DedicatedWorkerGlobalScope_postMessage_Callback";
-  postMessage_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => postMessage_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static postMessage_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "DedicatedWorkerGlobalScope_postMessage_Callback";
-  postMessage_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => postMessage_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  postMessage_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "postMessage", [__arg_0, __arg_1]);
 
 }
 
 class BlinkDelayNode extends BlinkAudioNode {
   static final instance = new BlinkDelayNode();
 
-  static delayTime_Getter(mthis) native "DelayNode_delayTime_Getter";
-  delayTime_Getter_(mthis) => delayTime_Getter(mthis);
+  delayTime_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "delayTime");
 
 }
 
 class BlinkDeprecatedStorageInfo {
   static final instance = new BlinkDeprecatedStorageInfo();
 
-  static queryUsageAndQuota_Callback_0(mthis) native "DeprecatedStorageInfo_queryUsageAndQuota_Callback";
-  queryUsageAndQuota_Callback_0_(mthis) => queryUsageAndQuota_Callback_0(mthis);
+  queryUsageAndQuota_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "queryUsageAndQuota", []);
 
-  static queryUsageAndQuota_Callback_1(mthis, __arg_0) native "DeprecatedStorageInfo_queryUsageAndQuota_Callback";
-  queryUsageAndQuota_Callback_1_(mthis, __arg_0) => queryUsageAndQuota_Callback_1(mthis, __arg_0);
+  queryUsageAndQuota_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "queryUsageAndQuota", [__arg_0]);
 
-  static queryUsageAndQuota_Callback_2(mthis, __arg_0, __arg_1) native "DeprecatedStorageInfo_queryUsageAndQuota_Callback";
-  queryUsageAndQuota_Callback_2_(mthis, __arg_0, __arg_1) => queryUsageAndQuota_Callback_2(mthis, __arg_0, __arg_1);
+  queryUsageAndQuota_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "queryUsageAndQuota", [__arg_0, __arg_1]);
 
-  static queryUsageAndQuota_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "DeprecatedStorageInfo_queryUsageAndQuota_Callback";
-  queryUsageAndQuota_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => queryUsageAndQuota_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  queryUsageAndQuota_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "queryUsageAndQuota", [__arg_0, __arg_1, __arg_2]);
 
-  static queryUsageAndQuota_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "DeprecatedStorageInfo_queryUsageAndQuota_Callback";
-  queryUsageAndQuota_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => queryUsageAndQuota_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  requestQuota_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "requestQuota", []);
 
-  static queryUsageAndQuota_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "DeprecatedStorageInfo_queryUsageAndQuota_Callback";
-  queryUsageAndQuota_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => queryUsageAndQuota_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  requestQuota_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "requestQuota", [__arg_0]);
 
-  static requestQuota_Callback_0(mthis) native "DeprecatedStorageInfo_requestQuota_Callback";
-  requestQuota_Callback_0_(mthis) => requestQuota_Callback_0(mthis);
+  requestQuota_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "requestQuota", [__arg_0, __arg_1]);
 
-  static requestQuota_Callback_1(mthis, __arg_0) native "DeprecatedStorageInfo_requestQuota_Callback";
-  requestQuota_Callback_1_(mthis, __arg_0) => requestQuota_Callback_1(mthis, __arg_0);
+  requestQuota_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "requestQuota", [__arg_0, __arg_1, __arg_2]);
 
-  static requestQuota_Callback_2(mthis, __arg_0, __arg_1) native "DeprecatedStorageInfo_requestQuota_Callback";
-  requestQuota_Callback_2_(mthis, __arg_0, __arg_1) => requestQuota_Callback_2(mthis, __arg_0, __arg_1);
-
-  static requestQuota_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "DeprecatedStorageInfo_requestQuota_Callback";
-  requestQuota_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => requestQuota_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static requestQuota_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "DeprecatedStorageInfo_requestQuota_Callback";
-  requestQuota_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => requestQuota_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static requestQuota_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "DeprecatedStorageInfo_requestQuota_Callback";
-  requestQuota_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => requestQuota_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
-
-  static requestQuota_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "DeprecatedStorageInfo_requestQuota_Callback";
-  requestQuota_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => requestQuota_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  requestQuota_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "requestQuota", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
 }
 
 class BlinkDeprecatedStorageQuota {
   static final instance = new BlinkDeprecatedStorageQuota();
 
-  static queryUsageAndQuota_Callback_0(mthis) native "DeprecatedStorageQuota_queryUsageAndQuota_Callback";
-  queryUsageAndQuota_Callback_0_(mthis) => queryUsageAndQuota_Callback_0(mthis);
+  queryUsageAndQuota_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "queryUsageAndQuota", []);
 
-  static queryUsageAndQuota_Callback_1(mthis, __arg_0) native "DeprecatedStorageQuota_queryUsageAndQuota_Callback";
-  queryUsageAndQuota_Callback_1_(mthis, __arg_0) => queryUsageAndQuota_Callback_1(mthis, __arg_0);
+  queryUsageAndQuota_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "queryUsageAndQuota", [__arg_0]);
 
-  static queryUsageAndQuota_Callback_2(mthis, __arg_0, __arg_1) native "DeprecatedStorageQuota_queryUsageAndQuota_Callback";
-  queryUsageAndQuota_Callback_2_(mthis, __arg_0, __arg_1) => queryUsageAndQuota_Callback_2(mthis, __arg_0, __arg_1);
+  queryUsageAndQuota_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "queryUsageAndQuota", [__arg_0, __arg_1]);
 
-  static queryUsageAndQuota_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "DeprecatedStorageQuota_queryUsageAndQuota_Callback";
-  queryUsageAndQuota_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => queryUsageAndQuota_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  requestQuota_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "requestQuota", []);
 
-  static queryUsageAndQuota_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "DeprecatedStorageQuota_queryUsageAndQuota_Callback";
-  queryUsageAndQuota_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => queryUsageAndQuota_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  requestQuota_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "requestQuota", [__arg_0]);
 
-  static requestQuota_Callback_0(mthis) native "DeprecatedStorageQuota_requestQuota_Callback";
-  requestQuota_Callback_0_(mthis) => requestQuota_Callback_0(mthis);
+  requestQuota_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "requestQuota", [__arg_0, __arg_1]);
 
-  static requestQuota_Callback_1(mthis, __arg_0) native "DeprecatedStorageQuota_requestQuota_Callback";
-  requestQuota_Callback_1_(mthis, __arg_0) => requestQuota_Callback_1(mthis, __arg_0);
-
-  static requestQuota_Callback_2(mthis, __arg_0, __arg_1) native "DeprecatedStorageQuota_requestQuota_Callback";
-  requestQuota_Callback_2_(mthis, __arg_0, __arg_1) => requestQuota_Callback_2(mthis, __arg_0, __arg_1);
-
-  static requestQuota_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "DeprecatedStorageQuota_requestQuota_Callback";
-  requestQuota_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => requestQuota_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static requestQuota_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "DeprecatedStorageQuota_requestQuota_Callback";
-  requestQuota_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => requestQuota_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static requestQuota_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "DeprecatedStorageQuota_requestQuota_Callback";
-  requestQuota_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => requestQuota_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  requestQuota_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "requestQuota", [__arg_0, __arg_1, __arg_2]);
 
 }
 
 class BlinkDeviceAcceleration {
   static final instance = new BlinkDeviceAcceleration();
 
-  static x_Getter(mthis) native "DeviceAcceleration_x_Getter";
-  x_Getter_(mthis) => x_Getter(mthis);
+  x_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "x");
 
-  static y_Getter(mthis) native "DeviceAcceleration_y_Getter";
-  y_Getter_(mthis) => y_Getter(mthis);
+  y_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "y");
 
-  static z_Getter(mthis) native "DeviceAcceleration_z_Getter";
-  z_Getter_(mthis) => z_Getter(mthis);
+  z_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "z");
 
 }
 
 class BlinkDeviceLightEvent extends BlinkEvent {
   static final instance = new BlinkDeviceLightEvent();
 
-  static constructorCallback_2(__arg_0, __arg_1) native "DeviceLightEvent_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  constructorCallback_2_(__arg_0, __arg_1) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "DeviceLightEvent"), [__arg_0, __arg_1]);
 
-  static value_Getter(mthis) native "DeviceLightEvent_value_Getter";
-  value_Getter_(mthis) => value_Getter(mthis);
+  value_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "value");
 
 }
 
 class BlinkDeviceMotionEvent extends BlinkEvent {
   static final instance = new BlinkDeviceMotionEvent();
 
-  static accelerationIncludingGravity_Getter(mthis) native "DeviceMotionEvent_accelerationIncludingGravity_Getter";
-  accelerationIncludingGravity_Getter_(mthis) => accelerationIncludingGravity_Getter(mthis);
+  accelerationIncludingGravity_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "accelerationIncludingGravity");
 
-  static acceleration_Getter(mthis) native "DeviceMotionEvent_acceleration_Getter";
-  acceleration_Getter_(mthis) => acceleration_Getter(mthis);
+  acceleration_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "acceleration");
 
-  static initDeviceMotionEvent_Callback_0(mthis) native "DeviceMotionEvent_initDeviceMotionEvent_Callback";
-  initDeviceMotionEvent_Callback_0_(mthis) => initDeviceMotionEvent_Callback_0(mthis);
+  initDeviceMotionEvent_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "initDeviceMotionEvent", []);
 
-  static initDeviceMotionEvent_Callback_1(mthis, __arg_0) native "DeviceMotionEvent_initDeviceMotionEvent_Callback";
-  initDeviceMotionEvent_Callback_1_(mthis, __arg_0) => initDeviceMotionEvent_Callback_1(mthis, __arg_0);
+  initDeviceMotionEvent_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "initDeviceMotionEvent", [__arg_0]);
 
-  static initDeviceMotionEvent_Callback_2(mthis, __arg_0, __arg_1) native "DeviceMotionEvent_initDeviceMotionEvent_Callback";
-  initDeviceMotionEvent_Callback_2_(mthis, __arg_0, __arg_1) => initDeviceMotionEvent_Callback_2(mthis, __arg_0, __arg_1);
+  initDeviceMotionEvent_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "initDeviceMotionEvent", [__arg_0, __arg_1]);
 
-  static initDeviceMotionEvent_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "DeviceMotionEvent_initDeviceMotionEvent_Callback";
-  initDeviceMotionEvent_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => initDeviceMotionEvent_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  initDeviceMotionEvent_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "initDeviceMotionEvent", [__arg_0, __arg_1, __arg_2]);
 
-  static initDeviceMotionEvent_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "DeviceMotionEvent_initDeviceMotionEvent_Callback";
-  initDeviceMotionEvent_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => initDeviceMotionEvent_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  initDeviceMotionEvent_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "initDeviceMotionEvent", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static initDeviceMotionEvent_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "DeviceMotionEvent_initDeviceMotionEvent_Callback";
-  initDeviceMotionEvent_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => initDeviceMotionEvent_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  initDeviceMotionEvent_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => Blink_JsNative_DomException.callMethod(mthis, "initDeviceMotionEvent", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4]);
 
-  static initDeviceMotionEvent_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "DeviceMotionEvent_initDeviceMotionEvent_Callback";
-  initDeviceMotionEvent_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => initDeviceMotionEvent_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  initDeviceMotionEvent_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => Blink_JsNative_DomException.callMethod(mthis, "initDeviceMotionEvent", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5]);
 
-  static initDeviceMotionEvent_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) native "DeviceMotionEvent_initDeviceMotionEvent_Callback";
-  initDeviceMotionEvent_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => initDeviceMotionEvent_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6);
+  initDeviceMotionEvent_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => Blink_JsNative_DomException.callMethod(mthis, "initDeviceMotionEvent", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6]);
 
-  static initDeviceMotionEvent_Callback_8(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) native "DeviceMotionEvent_initDeviceMotionEvent_Callback";
-  initDeviceMotionEvent_Callback_8_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) => initDeviceMotionEvent_Callback_8(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7);
+  interval_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "interval");
 
-  static initDeviceMotionEvent_Callback_9(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8) native "DeviceMotionEvent_initDeviceMotionEvent_Callback";
-  initDeviceMotionEvent_Callback_9_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8) => initDeviceMotionEvent_Callback_9(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8);
-
-  static interval_Getter(mthis) native "DeviceMotionEvent_interval_Getter";
-  interval_Getter_(mthis) => interval_Getter(mthis);
-
-  static rotationRate_Getter(mthis) native "DeviceMotionEvent_rotationRate_Getter";
-  rotationRate_Getter_(mthis) => rotationRate_Getter(mthis);
+  rotationRate_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "rotationRate");
 
 }
 
 class BlinkDeviceOrientationEvent extends BlinkEvent {
   static final instance = new BlinkDeviceOrientationEvent();
 
-  static absolute_Getter(mthis) native "DeviceOrientationEvent_absolute_Getter";
-  absolute_Getter_(mthis) => absolute_Getter(mthis);
+  absolute_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "absolute");
 
-  static alpha_Getter(mthis) native "DeviceOrientationEvent_alpha_Getter";
-  alpha_Getter_(mthis) => alpha_Getter(mthis);
+  alpha_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "alpha");
 
-  static beta_Getter(mthis) native "DeviceOrientationEvent_beta_Getter";
-  beta_Getter_(mthis) => beta_Getter(mthis);
+  beta_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "beta");
 
-  static gamma_Getter(mthis) native "DeviceOrientationEvent_gamma_Getter";
-  gamma_Getter_(mthis) => gamma_Getter(mthis);
+  gamma_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "gamma");
 
-  static initDeviceOrientationEvent_Callback_0(mthis) native "DeviceOrientationEvent_initDeviceOrientationEvent_Callback";
-  initDeviceOrientationEvent_Callback_0_(mthis) => initDeviceOrientationEvent_Callback_0(mthis);
+  initDeviceOrientationEvent_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "initDeviceOrientationEvent", []);
 
-  static initDeviceOrientationEvent_Callback_1(mthis, __arg_0) native "DeviceOrientationEvent_initDeviceOrientationEvent_Callback";
-  initDeviceOrientationEvent_Callback_1_(mthis, __arg_0) => initDeviceOrientationEvent_Callback_1(mthis, __arg_0);
+  initDeviceOrientationEvent_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "initDeviceOrientationEvent", [__arg_0]);
 
-  static initDeviceOrientationEvent_Callback_2(mthis, __arg_0, __arg_1) native "DeviceOrientationEvent_initDeviceOrientationEvent_Callback";
-  initDeviceOrientationEvent_Callback_2_(mthis, __arg_0, __arg_1) => initDeviceOrientationEvent_Callback_2(mthis, __arg_0, __arg_1);
+  initDeviceOrientationEvent_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "initDeviceOrientationEvent", [__arg_0, __arg_1]);
 
-  static initDeviceOrientationEvent_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "DeviceOrientationEvent_initDeviceOrientationEvent_Callback";
-  initDeviceOrientationEvent_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => initDeviceOrientationEvent_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  initDeviceOrientationEvent_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "initDeviceOrientationEvent", [__arg_0, __arg_1, __arg_2]);
 
-  static initDeviceOrientationEvent_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "DeviceOrientationEvent_initDeviceOrientationEvent_Callback";
-  initDeviceOrientationEvent_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => initDeviceOrientationEvent_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  initDeviceOrientationEvent_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "initDeviceOrientationEvent", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static initDeviceOrientationEvent_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "DeviceOrientationEvent_initDeviceOrientationEvent_Callback";
-  initDeviceOrientationEvent_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => initDeviceOrientationEvent_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  initDeviceOrientationEvent_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => Blink_JsNative_DomException.callMethod(mthis, "initDeviceOrientationEvent", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4]);
 
-  static initDeviceOrientationEvent_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "DeviceOrientationEvent_initDeviceOrientationEvent_Callback";
-  initDeviceOrientationEvent_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => initDeviceOrientationEvent_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  initDeviceOrientationEvent_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => Blink_JsNative_DomException.callMethod(mthis, "initDeviceOrientationEvent", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5]);
 
-  static initDeviceOrientationEvent_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) native "DeviceOrientationEvent_initDeviceOrientationEvent_Callback";
-  initDeviceOrientationEvent_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => initDeviceOrientationEvent_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6);
-
-  static initDeviceOrientationEvent_Callback_8(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) native "DeviceOrientationEvent_initDeviceOrientationEvent_Callback";
-  initDeviceOrientationEvent_Callback_8_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) => initDeviceOrientationEvent_Callback_8(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7);
-
-  static initDeviceOrientationEvent_Callback_9(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8) native "DeviceOrientationEvent_initDeviceOrientationEvent_Callback";
-  initDeviceOrientationEvent_Callback_9_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8) => initDeviceOrientationEvent_Callback_9(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8);
+  initDeviceOrientationEvent_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => Blink_JsNative_DomException.callMethod(mthis, "initDeviceOrientationEvent", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6]);
 
 }
 
 class BlinkDeviceRotationRate {
   static final instance = new BlinkDeviceRotationRate();
 
-  static alpha_Getter(mthis) native "DeviceRotationRate_alpha_Getter";
-  alpha_Getter_(mthis) => alpha_Getter(mthis);
+  alpha_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "alpha");
 
-  static beta_Getter(mthis) native "DeviceRotationRate_beta_Getter";
-  beta_Getter_(mthis) => beta_Getter(mthis);
+  beta_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "beta");
 
-  static gamma_Getter(mthis) native "DeviceRotationRate_gamma_Getter";
-  gamma_Getter_(mthis) => gamma_Getter(mthis);
+  gamma_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "gamma");
 
 }
 
 class BlinkDirectoryEntry extends BlinkEntry {
   static final instance = new BlinkDirectoryEntry();
 
-  static createReader_Callback_0(mthis) native "DirectoryEntry_createReader_Callback";
-  createReader_Callback_0_(mthis) => createReader_Callback_0(mthis);
+  createReader_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createReader", []);
 
-  static createReader_Callback_1(mthis, __arg_0) native "DirectoryEntry_createReader_Callback";
-  createReader_Callback_1_(mthis, __arg_0) => createReader_Callback_1(mthis, __arg_0);
+  getDirectory_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getDirectory", []);
 
-  static createReader_Callback_2(mthis, __arg_0, __arg_1) native "DirectoryEntry_createReader_Callback";
-  createReader_Callback_2_(mthis, __arg_0, __arg_1) => createReader_Callback_2(mthis, __arg_0, __arg_1);
+  getDirectory_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getDirectory", [__arg_0]);
 
-  static getDirectory_Callback_0(mthis) native "DirectoryEntry_getDirectory_Callback";
-  getDirectory_Callback_0_(mthis) => getDirectory_Callback_0(mthis);
+  getDirectory_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "getDirectory", [__arg_0, __arg_1]);
 
-  static getDirectory_Callback_1(mthis, __arg_0) native "DirectoryEntry_getDirectory_Callback";
-  getDirectory_Callback_1_(mthis, __arg_0) => getDirectory_Callback_1(mthis, __arg_0);
+  getDirectory_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "getDirectory", [__arg_0, __arg_1, __arg_2]);
 
-  static getDirectory_Callback_2(mthis, __arg_0, __arg_1) native "DirectoryEntry_getDirectory_Callback";
-  getDirectory_Callback_2_(mthis, __arg_0, __arg_1) => getDirectory_Callback_2(mthis, __arg_0, __arg_1);
+  getDirectory_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "getDirectory", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static getDirectory_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "DirectoryEntry_getDirectory_Callback";
-  getDirectory_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getDirectory_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  getFile_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getFile", []);
 
-  static getDirectory_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "DirectoryEntry_getDirectory_Callback";
-  getDirectory_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => getDirectory_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  getFile_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getFile", [__arg_0]);
 
-  static getDirectory_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "DirectoryEntry_getDirectory_Callback";
-  getDirectory_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => getDirectory_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  getFile_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "getFile", [__arg_0, __arg_1]);
 
-  static getDirectory_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "DirectoryEntry_getDirectory_Callback";
-  getDirectory_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => getDirectory_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  getFile_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "getFile", [__arg_0, __arg_1, __arg_2]);
 
-  static getFile_Callback_0(mthis) native "DirectoryEntry_getFile_Callback";
-  getFile_Callback_0_(mthis) => getFile_Callback_0(mthis);
+  getFile_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "getFile", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static getFile_Callback_1(mthis, __arg_0) native "DirectoryEntry_getFile_Callback";
-  getFile_Callback_1_(mthis, __arg_0) => getFile_Callback_1(mthis, __arg_0);
+  removeRecursively_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "removeRecursively", []);
 
-  static getFile_Callback_2(mthis, __arg_0, __arg_1) native "DirectoryEntry_getFile_Callback";
-  getFile_Callback_2_(mthis, __arg_0, __arg_1) => getFile_Callback_2(mthis, __arg_0, __arg_1);
+  removeRecursively_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "removeRecursively", [__arg_0]);
 
-  static getFile_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "DirectoryEntry_getFile_Callback";
-  getFile_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getFile_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static getFile_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "DirectoryEntry_getFile_Callback";
-  getFile_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => getFile_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static getFile_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "DirectoryEntry_getFile_Callback";
-  getFile_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => getFile_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
-
-  static getFile_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "DirectoryEntry_getFile_Callback";
-  getFile_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => getFile_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
-
-  static removeRecursively_Callback_0(mthis) native "DirectoryEntry_removeRecursively_Callback";
-  removeRecursively_Callback_0_(mthis) => removeRecursively_Callback_0(mthis);
-
-  static removeRecursively_Callback_1(mthis, __arg_0) native "DirectoryEntry_removeRecursively_Callback";
-  removeRecursively_Callback_1_(mthis, __arg_0) => removeRecursively_Callback_1(mthis, __arg_0);
-
-  static removeRecursively_Callback_2(mthis, __arg_0, __arg_1) native "DirectoryEntry_removeRecursively_Callback";
-  removeRecursively_Callback_2_(mthis, __arg_0, __arg_1) => removeRecursively_Callback_2(mthis, __arg_0, __arg_1);
-
-  static removeRecursively_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "DirectoryEntry_removeRecursively_Callback";
-  removeRecursively_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => removeRecursively_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static removeRecursively_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "DirectoryEntry_removeRecursively_Callback";
-  removeRecursively_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => removeRecursively_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  removeRecursively_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "removeRecursively", [__arg_0, __arg_1]);
 
 }
 
 class BlinkDirectoryEntrySync extends BlinkEntrySync {
   static final instance = new BlinkDirectoryEntrySync();
 
-  static createReader_Callback_0(mthis) native "DirectoryEntrySync_createReader_Callback";
-  createReader_Callback_0_(mthis) => createReader_Callback_0(mthis);
+  createReader_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createReader", []);
 
-  static createReader_Callback_1(mthis, __arg_0) native "DirectoryEntrySync_createReader_Callback";
-  createReader_Callback_1_(mthis, __arg_0) => createReader_Callback_1(mthis, __arg_0);
+  getDirectory_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getDirectory", []);
 
-  static createReader_Callback_2(mthis, __arg_0, __arg_1) native "DirectoryEntrySync_createReader_Callback";
-  createReader_Callback_2_(mthis, __arg_0, __arg_1) => createReader_Callback_2(mthis, __arg_0, __arg_1);
+  getDirectory_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getDirectory", [__arg_0]);
 
-  static getDirectory_Callback_0(mthis) native "DirectoryEntrySync_getDirectory_Callback";
-  getDirectory_Callback_0_(mthis) => getDirectory_Callback_0(mthis);
+  getDirectory_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "getDirectory", [__arg_0, __arg_1]);
 
-  static getDirectory_Callback_1(mthis, __arg_0) native "DirectoryEntrySync_getDirectory_Callback";
-  getDirectory_Callback_1_(mthis, __arg_0) => getDirectory_Callback_1(mthis, __arg_0);
+  getFile_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getFile", []);
 
-  static getDirectory_Callback_2(mthis, __arg_0, __arg_1) native "DirectoryEntrySync_getDirectory_Callback";
-  getDirectory_Callback_2_(mthis, __arg_0, __arg_1) => getDirectory_Callback_2(mthis, __arg_0, __arg_1);
+  getFile_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getFile", [__arg_0]);
 
-  static getDirectory_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "DirectoryEntrySync_getDirectory_Callback";
-  getDirectory_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getDirectory_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  getFile_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "getFile", [__arg_0, __arg_1]);
 
-  static getDirectory_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "DirectoryEntrySync_getDirectory_Callback";
-  getDirectory_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => getDirectory_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static getFile_Callback_0(mthis) native "DirectoryEntrySync_getFile_Callback";
-  getFile_Callback_0_(mthis) => getFile_Callback_0(mthis);
-
-  static getFile_Callback_1(mthis, __arg_0) native "DirectoryEntrySync_getFile_Callback";
-  getFile_Callback_1_(mthis, __arg_0) => getFile_Callback_1(mthis, __arg_0);
-
-  static getFile_Callback_2(mthis, __arg_0, __arg_1) native "DirectoryEntrySync_getFile_Callback";
-  getFile_Callback_2_(mthis, __arg_0, __arg_1) => getFile_Callback_2(mthis, __arg_0, __arg_1);
-
-  static getFile_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "DirectoryEntrySync_getFile_Callback";
-  getFile_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getFile_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static getFile_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "DirectoryEntrySync_getFile_Callback";
-  getFile_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => getFile_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static removeRecursively_Callback_0(mthis) native "DirectoryEntrySync_removeRecursively_Callback";
-  removeRecursively_Callback_0_(mthis) => removeRecursively_Callback_0(mthis);
-
-  static removeRecursively_Callback_1(mthis, __arg_0) native "DirectoryEntrySync_removeRecursively_Callback";
-  removeRecursively_Callback_1_(mthis, __arg_0) => removeRecursively_Callback_1(mthis, __arg_0);
-
-  static removeRecursively_Callback_2(mthis, __arg_0, __arg_1) native "DirectoryEntrySync_removeRecursively_Callback";
-  removeRecursively_Callback_2_(mthis, __arg_0, __arg_1) => removeRecursively_Callback_2(mthis, __arg_0, __arg_1);
+  removeRecursively_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "removeRecursively", []);
 
 }
 
 class BlinkDirectoryReader {
   static final instance = new BlinkDirectoryReader();
 
-  static readEntries_Callback_0(mthis) native "DirectoryReader_readEntries_Callback";
-  readEntries_Callback_0_(mthis) => readEntries_Callback_0(mthis);
+  readEntries_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "readEntries", []);
 
-  static readEntries_Callback_1(mthis, __arg_0) native "DirectoryReader_readEntries_Callback";
-  readEntries_Callback_1_(mthis, __arg_0) => readEntries_Callback_1(mthis, __arg_0);
+  readEntries_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "readEntries", [__arg_0]);
 
-  static readEntries_Callback_2(mthis, __arg_0, __arg_1) native "DirectoryReader_readEntries_Callback";
-  readEntries_Callback_2_(mthis, __arg_0, __arg_1) => readEntries_Callback_2(mthis, __arg_0, __arg_1);
-
-  static readEntries_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "DirectoryReader_readEntries_Callback";
-  readEntries_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => readEntries_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static readEntries_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "DirectoryReader_readEntries_Callback";
-  readEntries_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => readEntries_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  readEntries_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "readEntries", [__arg_0, __arg_1]);
 
 }
 
 class BlinkDirectoryReaderSync {
   static final instance = new BlinkDirectoryReaderSync();
 
-  static readEntries_Callback_0(mthis) native "DirectoryReaderSync_readEntries_Callback";
-  readEntries_Callback_0_(mthis) => readEntries_Callback_0(mthis);
-
-  static readEntries_Callback_1(mthis, __arg_0) native "DirectoryReaderSync_readEntries_Callback";
-  readEntries_Callback_1_(mthis, __arg_0) => readEntries_Callback_1(mthis, __arg_0);
-
-  static readEntries_Callback_2(mthis, __arg_0, __arg_1) native "DirectoryReaderSync_readEntries_Callback";
-  readEntries_Callback_2_(mthis, __arg_0, __arg_1) => readEntries_Callback_2(mthis, __arg_0, __arg_1);
+  readEntries_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "readEntries", []);
 
 }
 
 class BlinkDocument extends BlinkNode {
   static final instance = new BlinkDocument();
 
-  static URL_Getter(mthis) native "Document_URL_Getter";
-  URL_Getter_(mthis) => URL_Getter(mthis);
+  URL_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "URL");
 
-  static activeElement_Getter(mthis) native "Document_activeElement_Getter";
-  activeElement_Getter_(mthis) => activeElement_Getter(mthis);
+  activeElement_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "activeElement");
 
-  static adoptNode_Callback_0(mthis) native "Document_adoptNode_Callback";
-  adoptNode_Callback_0_(mthis) => adoptNode_Callback_0(mthis);
+  adoptNode_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "adoptNode", []);
 
-  static adoptNode_Callback_1(mthis, __arg_0) native "Document_adoptNode_Callback";
-  adoptNode_Callback_1_(mthis, __arg_0) => adoptNode_Callback_1(mthis, __arg_0);
+  adoptNode_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "adoptNode", [__arg_0]);
 
-  static adoptNode_Callback_2(mthis, __arg_0, __arg_1) native "Document_adoptNode_Callback";
-  adoptNode_Callback_2_(mthis, __arg_0, __arg_1) => adoptNode_Callback_2(mthis, __arg_0, __arg_1);
+  anchors_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "anchors");
 
-  static adoptNode_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Document_adoptNode_Callback";
-  adoptNode_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => adoptNode_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  body_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "body");
 
-  static anchors_Getter(mthis) native "Document_anchors_Getter";
-  anchors_Getter_(mthis) => anchors_Getter(mthis);
+  body_Setter_(mthis, __arg_0) => mthis["body"] = __arg_0;
 
-  static body_Getter(mthis) native "Document_body_Getter";
-  body_Getter_(mthis) => body_Getter(mthis);
+  caretRangeFromPoint_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "caretRangeFromPoint", []);
 
-  static body_Setter(mthis, __arg_0) native "Document_body_Setter";
-  body_Setter_(mthis, __arg_0) => body_Setter(mthis, __arg_0);
+  caretRangeFromPoint_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "caretRangeFromPoint", [__arg_0]);
 
-  static caretRangeFromPoint_Callback_0(mthis) native "Document_caretRangeFromPoint_Callback";
-  caretRangeFromPoint_Callback_0_(mthis) => caretRangeFromPoint_Callback_0(mthis);
+  caretRangeFromPoint_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "caretRangeFromPoint", [__arg_0, __arg_1]);
 
-  static caretRangeFromPoint_Callback_1(mthis, __arg_0) native "Document_caretRangeFromPoint_Callback";
-  caretRangeFromPoint_Callback_1_(mthis, __arg_0) => caretRangeFromPoint_Callback_1(mthis, __arg_0);
+  characterSet_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "characterSet");
 
-  static caretRangeFromPoint_Callback_2(mthis, __arg_0, __arg_1) native "Document_caretRangeFromPoint_Callback";
-  caretRangeFromPoint_Callback_2_(mthis, __arg_0, __arg_1) => caretRangeFromPoint_Callback_2(mthis, __arg_0, __arg_1);
+  charset_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "charset");
 
-  static caretRangeFromPoint_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Document_caretRangeFromPoint_Callback";
-  caretRangeFromPoint_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => caretRangeFromPoint_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  charset_Setter_(mthis, __arg_0) => mthis["charset"] = __arg_0;
 
-  static caretRangeFromPoint_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Document_caretRangeFromPoint_Callback";
-  caretRangeFromPoint_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => caretRangeFromPoint_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  childElementCount_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "childElementCount");
 
-  static characterSet_Getter(mthis) native "Document_characterSet_Getter";
-  characterSet_Getter_(mthis) => characterSet_Getter(mthis);
+  children_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "children");
 
-  static charset_Getter(mthis) native "Document_charset_Getter";
-  charset_Getter_(mthis) => charset_Getter(mthis);
+  compatMode_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "compatMode");
 
-  static charset_Setter(mthis, __arg_0) native "Document_charset_Setter";
-  charset_Setter_(mthis, __arg_0) => charset_Setter(mthis, __arg_0);
+  contentType_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "contentType");
 
-  static childElementCount_Getter(mthis) native "Document_childElementCount_Getter";
-  childElementCount_Getter_(mthis) => childElementCount_Getter(mthis);
+  cookie_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "cookie");
 
-  static children_Getter(mthis) native "Document_children_Getter";
-  children_Getter_(mthis) => children_Getter(mthis);
+  cookie_Setter_(mthis, __arg_0) => mthis["cookie"] = __arg_0;
 
-  static compatMode_Getter(mthis) native "Document_compatMode_Getter";
-  compatMode_Getter_(mthis) => compatMode_Getter(mthis);
+  createCDATASection_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createCDATASection", []);
 
-  static contentType_Getter(mthis) native "Document_contentType_Getter";
-  contentType_Getter_(mthis) => contentType_Getter(mthis);
+  createCDATASection_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "createCDATASection", [__arg_0]);
 
-  static cookie_Getter(mthis) native "Document_cookie_Getter";
-  cookie_Getter_(mthis) => cookie_Getter(mthis);
+  createDocumentFragment_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createDocumentFragment", []);
 
-  static cookie_Setter(mthis, __arg_0) native "Document_cookie_Setter";
-  cookie_Setter_(mthis, __arg_0) => cookie_Setter(mthis, __arg_0);
+  createElementNS_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createElementNS", []);
 
-  static createCDATASection_Callback_0(mthis) native "Document_createCDATASection_Callback";
-  createCDATASection_Callback_0_(mthis) => createCDATASection_Callback_0(mthis);
+  createElementNS_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "createElementNS", [__arg_0]);
 
-  static createCDATASection_Callback_1(mthis, __arg_0) native "Document_createCDATASection_Callback";
-  createCDATASection_Callback_1_(mthis, __arg_0) => createCDATASection_Callback_1(mthis, __arg_0);
+  createElementNS_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "createElementNS", [__arg_0, __arg_1]);
 
-  static createCDATASection_Callback_2(mthis, __arg_0, __arg_1) native "Document_createCDATASection_Callback";
-  createCDATASection_Callback_2_(mthis, __arg_0, __arg_1) => createCDATASection_Callback_2(mthis, __arg_0, __arg_1);
+  createElementNS_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "createElementNS", [__arg_0, __arg_1, __arg_2]);
 
-  static createCDATASection_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Document_createCDATASection_Callback";
-  createCDATASection_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => createCDATASection_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  createElement_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createElement", []);
 
-  static createDocumentFragment_Callback_0(mthis) native "Document_createDocumentFragment_Callback";
-  createDocumentFragment_Callback_0_(mthis) => createDocumentFragment_Callback_0(mthis);
+  createElement_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "createElement", [__arg_0]);
 
-  static createDocumentFragment_Callback_1(mthis, __arg_0) native "Document_createDocumentFragment_Callback";
-  createDocumentFragment_Callback_1_(mthis, __arg_0) => createDocumentFragment_Callback_1(mthis, __arg_0);
+  createElement_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "createElement", [__arg_0, __arg_1]);
 
-  static createDocumentFragment_Callback_2(mthis, __arg_0, __arg_1) native "Document_createDocumentFragment_Callback";
-  createDocumentFragment_Callback_2_(mthis, __arg_0, __arg_1) => createDocumentFragment_Callback_2(mthis, __arg_0, __arg_1);
+  createEvent_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createEvent", []);
 
-  static createElementNS_Callback_0(mthis) native "Document_createElementNS_Callback";
-  createElementNS_Callback_0_(mthis) => createElementNS_Callback_0(mthis);
+  createEvent_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "createEvent", [__arg_0]);
 
-  static createElementNS_Callback_1(mthis, __arg_0) native "Document_createElementNS_Callback";
-  createElementNS_Callback_1_(mthis, __arg_0) => createElementNS_Callback_1(mthis, __arg_0);
+  createNodeIterator_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createNodeIterator", []);
 
-  static createElementNS_Callback_2(mthis, __arg_0, __arg_1) native "Document_createElementNS_Callback";
-  createElementNS_Callback_2_(mthis, __arg_0, __arg_1) => createElementNS_Callback_2(mthis, __arg_0, __arg_1);
+  createNodeIterator_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "createNodeIterator", [__arg_0]);
 
-  static createElementNS_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Document_createElementNS_Callback";
-  createElementNS_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => createElementNS_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  createNodeIterator_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "createNodeIterator", [__arg_0, __arg_1]);
 
-  static createElementNS_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Document_createElementNS_Callback";
-  createElementNS_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => createElementNS_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  createNodeIterator_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "createNodeIterator", [__arg_0, __arg_1, __arg_2]);
 
-  static createElementNS_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "Document_createElementNS_Callback";
-  createElementNS_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => createElementNS_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  createRange_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createRange", []);
 
-  static createElement_Callback_0(mthis) native "Document_createElement_Callback";
-  createElement_Callback_0_(mthis) => createElement_Callback_0(mthis);
+  createTextNode_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createTextNode", []);
 
-  static createElement_Callback_1(mthis, __arg_0) native "Document_createElement_Callback";
-  createElement_Callback_1_(mthis, __arg_0) => createElement_Callback_1(mthis, __arg_0);
+  createTextNode_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "createTextNode", [__arg_0]);
 
-  static createElement_Callback_2(mthis, __arg_0, __arg_1) native "Document_createElement_Callback";
-  createElement_Callback_2_(mthis, __arg_0, __arg_1) => createElement_Callback_2(mthis, __arg_0, __arg_1);
+  createTouchList_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createTouchList", []);
 
-  static createElement_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Document_createElement_Callback";
-  createElement_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => createElement_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  createTouchList_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "createTouchList", [__arg_0]);
 
-  static createElement_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Document_createElement_Callback";
-  createElement_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => createElement_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  createTouch_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createTouch", []);
 
-  static createEvent_Callback_0(mthis) native "Document_createEvent_Callback";
-  createEvent_Callback_0_(mthis) => createEvent_Callback_0(mthis);
+  createTouch_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "createTouch", [__arg_0]);
 
-  static createEvent_Callback_1(mthis, __arg_0) native "Document_createEvent_Callback";
-  createEvent_Callback_1_(mthis, __arg_0) => createEvent_Callback_1(mthis, __arg_0);
+  createTouch_Callback_10_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9) => Blink_JsNative_DomException.callMethod(mthis, "createTouch", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9]);
 
-  static createEvent_Callback_2(mthis, __arg_0, __arg_1) native "Document_createEvent_Callback";
-  createEvent_Callback_2_(mthis, __arg_0, __arg_1) => createEvent_Callback_2(mthis, __arg_0, __arg_1);
+  createTouch_Callback_11_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10) => Blink_JsNative_DomException.callMethod(mthis, "createTouch", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10]);
 
-  static createEvent_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Document_createEvent_Callback";
-  createEvent_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => createEvent_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  createTouch_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "createTouch", [__arg_0, __arg_1]);
 
-  static createNodeIterator_Callback_0(mthis) native "Document_createNodeIterator_Callback";
-  createNodeIterator_Callback_0_(mthis) => createNodeIterator_Callback_0(mthis);
+  createTouch_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "createTouch", [__arg_0, __arg_1, __arg_2]);
 
-  static createNodeIterator_Callback_1(mthis, __arg_0) native "Document_createNodeIterator_Callback";
-  createNodeIterator_Callback_1_(mthis, __arg_0) => createNodeIterator_Callback_1(mthis, __arg_0);
+  createTouch_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "createTouch", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static createNodeIterator_Callback_2(mthis, __arg_0, __arg_1) native "Document_createNodeIterator_Callback";
-  createNodeIterator_Callback_2_(mthis, __arg_0, __arg_1) => createNodeIterator_Callback_2(mthis, __arg_0, __arg_1);
+  createTouch_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => Blink_JsNative_DomException.callMethod(mthis, "createTouch", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4]);
 
-  static createNodeIterator_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Document_createNodeIterator_Callback";
-  createNodeIterator_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => createNodeIterator_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  createTouch_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => Blink_JsNative_DomException.callMethod(mthis, "createTouch", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5]);
 
-  static createNodeIterator_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Document_createNodeIterator_Callback";
-  createNodeIterator_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => createNodeIterator_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  createTouch_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => Blink_JsNative_DomException.callMethod(mthis, "createTouch", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6]);
 
-  static createNodeIterator_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "Document_createNodeIterator_Callback";
-  createNodeIterator_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => createNodeIterator_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  createTouch_Callback_8_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) => Blink_JsNative_DomException.callMethod(mthis, "createTouch", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7]);
 
-  static createRange_Callback_0(mthis) native "Document_createRange_Callback";
-  createRange_Callback_0_(mthis) => createRange_Callback_0(mthis);
+  createTouch_Callback_9_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8) => Blink_JsNative_DomException.callMethod(mthis, "createTouch", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8]);
 
-  static createRange_Callback_1(mthis, __arg_0) native "Document_createRange_Callback";
-  createRange_Callback_1_(mthis, __arg_0) => createRange_Callback_1(mthis, __arg_0);
+  createTreeWalker_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createTreeWalker", []);
 
-  static createRange_Callback_2(mthis, __arg_0, __arg_1) native "Document_createRange_Callback";
-  createRange_Callback_2_(mthis, __arg_0, __arg_1) => createRange_Callback_2(mthis, __arg_0, __arg_1);
+  createTreeWalker_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "createTreeWalker", [__arg_0]);
 
-  static createTextNode_Callback_0(mthis) native "Document_createTextNode_Callback";
-  createTextNode_Callback_0_(mthis) => createTextNode_Callback_0(mthis);
+  createTreeWalker_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "createTreeWalker", [__arg_0, __arg_1]);
 
-  static createTextNode_Callback_1(mthis, __arg_0) native "Document_createTextNode_Callback";
-  createTextNode_Callback_1_(mthis, __arg_0) => createTextNode_Callback_1(mthis, __arg_0);
+  createTreeWalker_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "createTreeWalker", [__arg_0, __arg_1, __arg_2]);
 
-  static createTextNode_Callback_2(mthis, __arg_0, __arg_1) native "Document_createTextNode_Callback";
-  createTextNode_Callback_2_(mthis, __arg_0, __arg_1) => createTextNode_Callback_2(mthis, __arg_0, __arg_1);
+  currentScript_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "currentScript");
 
-  static createTextNode_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Document_createTextNode_Callback";
-  createTextNode_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => createTextNode_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  defaultCharset_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "defaultCharset");
 
-  static createTouchList_Callback_0(mthis) native "Document_createTouchList_Callback";
-  createTouchList_Callback_0_(mthis) => createTouchList_Callback_0(mthis);
+  defaultView_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "defaultView");
 
-  static createTouchList_Callback_1(mthis, __arg_0) native "Document_createTouchList_Callback";
-  createTouchList_Callback_1_(mthis, __arg_0) => createTouchList_Callback_1(mthis, __arg_0);
+  doctype_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "doctype");
 
-  static createTouchList_Callback_2(mthis, __arg_0, __arg_1) native "Document_createTouchList_Callback";
-  createTouchList_Callback_2_(mthis, __arg_0, __arg_1) => createTouchList_Callback_2(mthis, __arg_0, __arg_1);
+  documentElement_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "documentElement");
 
-  static createTouchList_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Document_createTouchList_Callback";
-  createTouchList_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => createTouchList_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  documentURI_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "documentURI");
 
-  static createTouch_Callback_0(mthis) native "Document_createTouch_Callback";
-  createTouch_Callback_0_(mthis) => createTouch_Callback_0(mthis);
+  domain_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "domain");
 
-  static createTouch_Callback_1(mthis, __arg_0) native "Document_createTouch_Callback";
-  createTouch_Callback_1_(mthis, __arg_0) => createTouch_Callback_1(mthis, __arg_0);
+  domain_Setter_(mthis, __arg_0) => mthis["domain"] = __arg_0;
 
-  static createTouch_Callback_10(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9) native "Document_createTouch_Callback";
-  createTouch_Callback_10_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9) => createTouch_Callback_10(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9);
+  elementFromPoint_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "elementFromPoint", []);
 
-  static createTouch_Callback_11(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10) native "Document_createTouch_Callback";
-  createTouch_Callback_11_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10) => createTouch_Callback_11(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10);
+  elementFromPoint_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "elementFromPoint", [__arg_0]);
 
-  static createTouch_Callback_12(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10, __arg_11) native "Document_createTouch_Callback";
-  createTouch_Callback_12_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10, __arg_11) => createTouch_Callback_12(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10, __arg_11);
+  elementFromPoint_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "elementFromPoint", [__arg_0, __arg_1]);
 
-  static createTouch_Callback_13(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10, __arg_11, __arg_12) native "Document_createTouch_Callback";
-  createTouch_Callback_13_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10, __arg_11, __arg_12) => createTouch_Callback_13(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10, __arg_11, __arg_12);
+  embeds_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "embeds");
 
-  static createTouch_Callback_2(mthis, __arg_0, __arg_1) native "Document_createTouch_Callback";
-  createTouch_Callback_2_(mthis, __arg_0, __arg_1) => createTouch_Callback_2(mthis, __arg_0, __arg_1);
+  execCommand_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "execCommand", []);
 
-  static createTouch_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Document_createTouch_Callback";
-  createTouch_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => createTouch_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  execCommand_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "execCommand", [__arg_0]);
 
-  static createTouch_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Document_createTouch_Callback";
-  createTouch_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => createTouch_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  execCommand_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "execCommand", [__arg_0, __arg_1]);
 
-  static createTouch_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "Document_createTouch_Callback";
-  createTouch_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => createTouch_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  execCommand_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "execCommand", [__arg_0, __arg_1, __arg_2]);
 
-  static createTouch_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "Document_createTouch_Callback";
-  createTouch_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => createTouch_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  exitFullscreen_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "exitFullscreen", []);
 
-  static createTouch_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) native "Document_createTouch_Callback";
-  createTouch_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => createTouch_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6);
+  exitPointerLock_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "exitPointerLock", []);
 
-  static createTouch_Callback_8(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) native "Document_createTouch_Callback";
-  createTouch_Callback_8_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) => createTouch_Callback_8(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7);
+  firstElementChild_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "firstElementChild");
 
-  static createTouch_Callback_9(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8) native "Document_createTouch_Callback";
-  createTouch_Callback_9_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8) => createTouch_Callback_9(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8);
+  fonts_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "fonts");
 
-  static createTreeWalker_Callback_0(mthis) native "Document_createTreeWalker_Callback";
-  createTreeWalker_Callback_0_(mthis) => createTreeWalker_Callback_0(mthis);
+  forms_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "forms");
 
-  static createTreeWalker_Callback_1(mthis, __arg_0) native "Document_createTreeWalker_Callback";
-  createTreeWalker_Callback_1_(mthis, __arg_0) => createTreeWalker_Callback_1(mthis, __arg_0);
+  fullscreenElement_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "fullscreenElement");
 
-  static createTreeWalker_Callback_2(mthis, __arg_0, __arg_1) native "Document_createTreeWalker_Callback";
-  createTreeWalker_Callback_2_(mthis, __arg_0, __arg_1) => createTreeWalker_Callback_2(mthis, __arg_0, __arg_1);
+  fullscreenEnabled_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "fullscreenEnabled");
 
-  static createTreeWalker_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Document_createTreeWalker_Callback";
-  createTreeWalker_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => createTreeWalker_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  getCSSCanvasContext_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "getCSSCanvasContext", [__arg_0, __arg_1]);
 
-  static createTreeWalker_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Document_createTreeWalker_Callback";
-  createTreeWalker_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => createTreeWalker_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  getCSSCanvasContext_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "getCSSCanvasContext", [__arg_0, __arg_1, __arg_2]);
 
-  static createTreeWalker_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "Document_createTreeWalker_Callback";
-  createTreeWalker_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => createTreeWalker_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  getCSSCanvasContext_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "getCSSCanvasContext", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static currentScript_Getter(mthis) native "Document_currentScript_Getter";
-  currentScript_Getter_(mthis) => currentScript_Getter(mthis);
+  getElementById_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getElementById", []);
 
-  static defaultCharset_Getter(mthis) native "Document_defaultCharset_Getter";
-  defaultCharset_Getter_(mthis) => defaultCharset_Getter(mthis);
+  getElementById_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getElementById", [__arg_0]);
 
-  static defaultView_Getter(mthis) native "Document_defaultView_Getter";
-  defaultView_Getter_(mthis) => defaultView_Getter(mthis);
+  getElementsByClassName_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getElementsByClassName", []);
 
-  static doctype_Getter(mthis) native "Document_doctype_Getter";
-  doctype_Getter_(mthis) => doctype_Getter(mthis);
+  getElementsByClassName_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getElementsByClassName", [__arg_0]);
 
-  static documentElement_Getter(mthis) native "Document_documentElement_Getter";
-  documentElement_Getter_(mthis) => documentElement_Getter(mthis);
+  getElementsByName_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getElementsByName", []);
 
-  static documentURI_Getter(mthis) native "Document_documentURI_Getter";
-  documentURI_Getter_(mthis) => documentURI_Getter(mthis);
+  getElementsByName_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getElementsByName", [__arg_0]);
 
-  static domain_Getter(mthis) native "Document_domain_Getter";
-  domain_Getter_(mthis) => domain_Getter(mthis);
+  getElementsByTagName_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getElementsByTagName", []);
 
-  static domain_Setter(mthis, __arg_0) native "Document_domain_Setter";
-  domain_Setter_(mthis, __arg_0) => domain_Setter(mthis, __arg_0);
+  getElementsByTagName_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getElementsByTagName", [__arg_0]);
 
-  static elementFromPoint_Callback_0(mthis) native "Document_elementFromPoint_Callback";
-  elementFromPoint_Callback_0_(mthis) => elementFromPoint_Callback_0(mthis);
+  head_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "head");
 
-  static elementFromPoint_Callback_1(mthis, __arg_0) native "Document_elementFromPoint_Callback";
-  elementFromPoint_Callback_1_(mthis, __arg_0) => elementFromPoint_Callback_1(mthis, __arg_0);
+  hidden_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "hidden");
 
-  static elementFromPoint_Callback_2(mthis, __arg_0, __arg_1) native "Document_elementFromPoint_Callback";
-  elementFromPoint_Callback_2_(mthis, __arg_0, __arg_1) => elementFromPoint_Callback_2(mthis, __arg_0, __arg_1);
+  implementation_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "implementation");
 
-  static elementFromPoint_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Document_elementFromPoint_Callback";
-  elementFromPoint_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => elementFromPoint_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  importNode_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "importNode", []);
 
-  static elementFromPoint_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Document_elementFromPoint_Callback";
-  elementFromPoint_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => elementFromPoint_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  importNode_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "importNode", [__arg_0]);
 
-  static embeds_Getter(mthis) native "Document_embeds_Getter";
-  embeds_Getter_(mthis) => embeds_Getter(mthis);
+  importNode_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "importNode", [__arg_0, __arg_1]);
 
-  static execCommand_Callback_0(mthis) native "Document_execCommand_Callback";
-  execCommand_Callback_0_(mthis) => execCommand_Callback_0(mthis);
+  inputEncoding_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "inputEncoding");
 
-  static execCommand_Callback_1(mthis, __arg_0) native "Document_execCommand_Callback";
-  execCommand_Callback_1_(mthis, __arg_0) => execCommand_Callback_1(mthis, __arg_0);
+  lastElementChild_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "lastElementChild");
 
-  static execCommand_Callback_2(mthis, __arg_0, __arg_1) native "Document_execCommand_Callback";
-  execCommand_Callback_2_(mthis, __arg_0, __arg_1) => execCommand_Callback_2(mthis, __arg_0, __arg_1);
+  lastModified_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "lastModified");
 
-  static execCommand_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Document_execCommand_Callback";
-  execCommand_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => execCommand_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  links_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "links");
 
-  static execCommand_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Document_execCommand_Callback";
-  execCommand_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => execCommand_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  onabort_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onabort");
 
-  static execCommand_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "Document_execCommand_Callback";
-  execCommand_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => execCommand_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  onabort_Setter_(mthis, __arg_0) => mthis["onabort"] = __arg_0;
 
-  static exitFullscreen_Callback_0(mthis) native "Document_exitFullscreen_Callback";
-  exitFullscreen_Callback_0_(mthis) => exitFullscreen_Callback_0(mthis);
+  onautocomplete_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onautocomplete");
 
-  static exitFullscreen_Callback_1(mthis, __arg_0) native "Document_exitFullscreen_Callback";
-  exitFullscreen_Callback_1_(mthis, __arg_0) => exitFullscreen_Callback_1(mthis, __arg_0);
+  onautocomplete_Setter_(mthis, __arg_0) => mthis["onautocomplete"] = __arg_0;
 
-  static exitFullscreen_Callback_2(mthis, __arg_0, __arg_1) native "Document_exitFullscreen_Callback";
-  exitFullscreen_Callback_2_(mthis, __arg_0, __arg_1) => exitFullscreen_Callback_2(mthis, __arg_0, __arg_1);
+  onautocompleteerror_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onautocompleteerror");
 
-  static exitPointerLock_Callback_0(mthis) native "Document_exitPointerLock_Callback";
-  exitPointerLock_Callback_0_(mthis) => exitPointerLock_Callback_0(mthis);
+  onautocompleteerror_Setter_(mthis, __arg_0) => mthis["onautocompleteerror"] = __arg_0;
 
-  static exitPointerLock_Callback_1(mthis, __arg_0) native "Document_exitPointerLock_Callback";
-  exitPointerLock_Callback_1_(mthis, __arg_0) => exitPointerLock_Callback_1(mthis, __arg_0);
+  onbeforecopy_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onbeforecopy");
 
-  static exitPointerLock_Callback_2(mthis, __arg_0, __arg_1) native "Document_exitPointerLock_Callback";
-  exitPointerLock_Callback_2_(mthis, __arg_0, __arg_1) => exitPointerLock_Callback_2(mthis, __arg_0, __arg_1);
+  onbeforecopy_Setter_(mthis, __arg_0) => mthis["onbeforecopy"] = __arg_0;
 
-  static firstElementChild_Getter(mthis) native "Document_firstElementChild_Getter";
-  firstElementChild_Getter_(mthis) => firstElementChild_Getter(mthis);
+  onbeforecut_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onbeforecut");
 
-  static fonts_Getter(mthis) native "Document_fonts_Getter";
-  fonts_Getter_(mthis) => fonts_Getter(mthis);
+  onbeforecut_Setter_(mthis, __arg_0) => mthis["onbeforecut"] = __arg_0;
 
-  static forms_Getter(mthis) native "Document_forms_Getter";
-  forms_Getter_(mthis) => forms_Getter(mthis);
+  onbeforepaste_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onbeforepaste");
 
-  static fullscreenElement_Getter(mthis) native "Document_fullscreenElement_Getter";
-  fullscreenElement_Getter_(mthis) => fullscreenElement_Getter(mthis);
+  onbeforepaste_Setter_(mthis, __arg_0) => mthis["onbeforepaste"] = __arg_0;
 
-  static fullscreenEnabled_Getter(mthis) native "Document_fullscreenEnabled_Getter";
-  fullscreenEnabled_Getter_(mthis) => fullscreenEnabled_Getter(mthis);
+  onblur_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onblur");
 
-  static getCSSCanvasContext_Callback_2(mthis, __arg_0, __arg_1) native "Document_getCSSCanvasContext_Callback";
-  getCSSCanvasContext_Callback_2_(mthis, __arg_0, __arg_1) => getCSSCanvasContext_Callback_2(mthis, __arg_0, __arg_1);
+  onblur_Setter_(mthis, __arg_0) => mthis["onblur"] = __arg_0;
 
-  static getCSSCanvasContext_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Document_getCSSCanvasContext_Callback";
-  getCSSCanvasContext_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getCSSCanvasContext_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  oncancel_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "oncancel");
 
-  static getCSSCanvasContext_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Document_getCSSCanvasContext_Callback";
-  getCSSCanvasContext_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => getCSSCanvasContext_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  oncancel_Setter_(mthis, __arg_0) => mthis["oncancel"] = __arg_0;
 
-  static getCSSCanvasContext_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "Document_getCSSCanvasContext_Callback";
-  getCSSCanvasContext_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => getCSSCanvasContext_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  oncanplay_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "oncanplay");
 
-  static getCSSCanvasContext_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "Document_getCSSCanvasContext_Callback";
-  getCSSCanvasContext_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => getCSSCanvasContext_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  oncanplay_Setter_(mthis, __arg_0) => mthis["oncanplay"] = __arg_0;
 
-  static getElementById_Callback_0(mthis) native "Document_getElementById_Callback";
-  getElementById_Callback_0_(mthis) => getElementById_Callback_0(mthis);
+  oncanplaythrough_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "oncanplaythrough");
 
-  static getElementById_Callback_1(mthis, __arg_0) native "Document_getElementById_Callback";
-  getElementById_Callback_1_(mthis, __arg_0) => getElementById_Callback_1(mthis, __arg_0);
+  oncanplaythrough_Setter_(mthis, __arg_0) => mthis["oncanplaythrough"] = __arg_0;
 
-  static getElementById_Callback_2(mthis, __arg_0, __arg_1) native "Document_getElementById_Callback";
-  getElementById_Callback_2_(mthis, __arg_0, __arg_1) => getElementById_Callback_2(mthis, __arg_0, __arg_1);
+  onchange_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onchange");
 
-  static getElementById_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Document_getElementById_Callback";
-  getElementById_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getElementById_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  onchange_Setter_(mthis, __arg_0) => mthis["onchange"] = __arg_0;
 
-  static getElementsByClassName_Callback_0(mthis) native "Document_getElementsByClassName_Callback";
-  getElementsByClassName_Callback_0_(mthis) => getElementsByClassName_Callback_0(mthis);
+  onclick_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onclick");
 
-  static getElementsByClassName_Callback_1(mthis, __arg_0) native "Document_getElementsByClassName_Callback";
-  getElementsByClassName_Callback_1_(mthis, __arg_0) => getElementsByClassName_Callback_1(mthis, __arg_0);
+  onclick_Setter_(mthis, __arg_0) => mthis["onclick"] = __arg_0;
 
-  static getElementsByClassName_Callback_2(mthis, __arg_0, __arg_1) native "Document_getElementsByClassName_Callback";
-  getElementsByClassName_Callback_2_(mthis, __arg_0, __arg_1) => getElementsByClassName_Callback_2(mthis, __arg_0, __arg_1);
+  onclose_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onclose");
 
-  static getElementsByClassName_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Document_getElementsByClassName_Callback";
-  getElementsByClassName_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getElementsByClassName_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  onclose_Setter_(mthis, __arg_0) => mthis["onclose"] = __arg_0;
 
-  static getElementsByName_Callback_0(mthis) native "Document_getElementsByName_Callback";
-  getElementsByName_Callback_0_(mthis) => getElementsByName_Callback_0(mthis);
+  oncontextmenu_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "oncontextmenu");
 
-  static getElementsByName_Callback_1(mthis, __arg_0) native "Document_getElementsByName_Callback";
-  getElementsByName_Callback_1_(mthis, __arg_0) => getElementsByName_Callback_1(mthis, __arg_0);
+  oncontextmenu_Setter_(mthis, __arg_0) => mthis["oncontextmenu"] = __arg_0;
 
-  static getElementsByName_Callback_2(mthis, __arg_0, __arg_1) native "Document_getElementsByName_Callback";
-  getElementsByName_Callback_2_(mthis, __arg_0, __arg_1) => getElementsByName_Callback_2(mthis, __arg_0, __arg_1);
+  oncopy_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "oncopy");
 
-  static getElementsByName_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Document_getElementsByName_Callback";
-  getElementsByName_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getElementsByName_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  oncopy_Setter_(mthis, __arg_0) => mthis["oncopy"] = __arg_0;
 
-  static getElementsByTagName_Callback_0(mthis) native "Document_getElementsByTagName_Callback";
-  getElementsByTagName_Callback_0_(mthis) => getElementsByTagName_Callback_0(mthis);
+  oncuechange_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "oncuechange");
 
-  static getElementsByTagName_Callback_1(mthis, __arg_0) native "Document_getElementsByTagName_Callback";
-  getElementsByTagName_Callback_1_(mthis, __arg_0) => getElementsByTagName_Callback_1(mthis, __arg_0);
+  oncuechange_Setter_(mthis, __arg_0) => mthis["oncuechange"] = __arg_0;
 
-  static getElementsByTagName_Callback_2(mthis, __arg_0, __arg_1) native "Document_getElementsByTagName_Callback";
-  getElementsByTagName_Callback_2_(mthis, __arg_0, __arg_1) => getElementsByTagName_Callback_2(mthis, __arg_0, __arg_1);
+  oncut_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "oncut");
 
-  static getElementsByTagName_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Document_getElementsByTagName_Callback";
-  getElementsByTagName_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getElementsByTagName_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  oncut_Setter_(mthis, __arg_0) => mthis["oncut"] = __arg_0;
 
-  static head_Getter(mthis) native "Document_head_Getter";
-  head_Getter_(mthis) => head_Getter(mthis);
+  ondblclick_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ondblclick");
 
-  static hidden_Getter(mthis) native "Document_hidden_Getter";
-  hidden_Getter_(mthis) => hidden_Getter(mthis);
+  ondblclick_Setter_(mthis, __arg_0) => mthis["ondblclick"] = __arg_0;
 
-  static implementation_Getter(mthis) native "Document_implementation_Getter";
-  implementation_Getter_(mthis) => implementation_Getter(mthis);
+  ondrag_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ondrag");
 
-  static importNode_Callback_0(mthis) native "Document_importNode_Callback";
-  importNode_Callback_0_(mthis) => importNode_Callback_0(mthis);
+  ondrag_Setter_(mthis, __arg_0) => mthis["ondrag"] = __arg_0;
 
-  static importNode_Callback_1(mthis, __arg_0) native "Document_importNode_Callback";
-  importNode_Callback_1_(mthis, __arg_0) => importNode_Callback_1(mthis, __arg_0);
+  ondragend_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ondragend");
 
-  static importNode_Callback_2(mthis, __arg_0, __arg_1) native "Document_importNode_Callback";
-  importNode_Callback_2_(mthis, __arg_0, __arg_1) => importNode_Callback_2(mthis, __arg_0, __arg_1);
+  ondragend_Setter_(mthis, __arg_0) => mthis["ondragend"] = __arg_0;
 
-  static importNode_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Document_importNode_Callback";
-  importNode_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => importNode_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  ondragenter_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ondragenter");
 
-  static importNode_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Document_importNode_Callback";
-  importNode_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => importNode_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  ondragenter_Setter_(mthis, __arg_0) => mthis["ondragenter"] = __arg_0;
 
-  static inputEncoding_Getter(mthis) native "Document_inputEncoding_Getter";
-  inputEncoding_Getter_(mthis) => inputEncoding_Getter(mthis);
+  ondragleave_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ondragleave");
 
-  static lastElementChild_Getter(mthis) native "Document_lastElementChild_Getter";
-  lastElementChild_Getter_(mthis) => lastElementChild_Getter(mthis);
+  ondragleave_Setter_(mthis, __arg_0) => mthis["ondragleave"] = __arg_0;
 
-  static lastModified_Getter(mthis) native "Document_lastModified_Getter";
-  lastModified_Getter_(mthis) => lastModified_Getter(mthis);
+  ondragover_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ondragover");
 
-  static links_Getter(mthis) native "Document_links_Getter";
-  links_Getter_(mthis) => links_Getter(mthis);
+  ondragover_Setter_(mthis, __arg_0) => mthis["ondragover"] = __arg_0;
 
-  static onabort_Getter(mthis) native "Document_onabort_Getter";
-  onabort_Getter_(mthis) => onabort_Getter(mthis);
+  ondragstart_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ondragstart");
 
-  static onabort_Setter(mthis, __arg_0) native "Document_onabort_Setter";
-  onabort_Setter_(mthis, __arg_0) => onabort_Setter(mthis, __arg_0);
+  ondragstart_Setter_(mthis, __arg_0) => mthis["ondragstart"] = __arg_0;
 
-  static onautocomplete_Getter(mthis) native "Document_onautocomplete_Getter";
-  onautocomplete_Getter_(mthis) => onautocomplete_Getter(mthis);
+  ondrop_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ondrop");
 
-  static onautocomplete_Setter(mthis, __arg_0) native "Document_onautocomplete_Setter";
-  onautocomplete_Setter_(mthis, __arg_0) => onautocomplete_Setter(mthis, __arg_0);
+  ondrop_Setter_(mthis, __arg_0) => mthis["ondrop"] = __arg_0;
 
-  static onautocompleteerror_Getter(mthis) native "Document_onautocompleteerror_Getter";
-  onautocompleteerror_Getter_(mthis) => onautocompleteerror_Getter(mthis);
+  ondurationchange_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ondurationchange");
 
-  static onautocompleteerror_Setter(mthis, __arg_0) native "Document_onautocompleteerror_Setter";
-  onautocompleteerror_Setter_(mthis, __arg_0) => onautocompleteerror_Setter(mthis, __arg_0);
+  ondurationchange_Setter_(mthis, __arg_0) => mthis["ondurationchange"] = __arg_0;
 
-  static onbeforecopy_Getter(mthis) native "Document_onbeforecopy_Getter";
-  onbeforecopy_Getter_(mthis) => onbeforecopy_Getter(mthis);
+  onemptied_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onemptied");
 
-  static onbeforecopy_Setter(mthis, __arg_0) native "Document_onbeforecopy_Setter";
-  onbeforecopy_Setter_(mthis, __arg_0) => onbeforecopy_Setter(mthis, __arg_0);
+  onemptied_Setter_(mthis, __arg_0) => mthis["onemptied"] = __arg_0;
 
-  static onbeforecut_Getter(mthis) native "Document_onbeforecut_Getter";
-  onbeforecut_Getter_(mthis) => onbeforecut_Getter(mthis);
+  onended_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onended");
 
-  static onbeforecut_Setter(mthis, __arg_0) native "Document_onbeforecut_Setter";
-  onbeforecut_Setter_(mthis, __arg_0) => onbeforecut_Setter(mthis, __arg_0);
+  onended_Setter_(mthis, __arg_0) => mthis["onended"] = __arg_0;
 
-  static onbeforepaste_Getter(mthis) native "Document_onbeforepaste_Getter";
-  onbeforepaste_Getter_(mthis) => onbeforepaste_Getter(mthis);
+  onerror_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onerror");
 
-  static onbeforepaste_Setter(mthis, __arg_0) native "Document_onbeforepaste_Setter";
-  onbeforepaste_Setter_(mthis, __arg_0) => onbeforepaste_Setter(mthis, __arg_0);
+  onerror_Setter_(mthis, __arg_0) => mthis["onerror"] = __arg_0;
 
-  static onblur_Getter(mthis) native "Document_onblur_Getter";
-  onblur_Getter_(mthis) => onblur_Getter(mthis);
+  onfocus_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onfocus");
 
-  static onblur_Setter(mthis, __arg_0) native "Document_onblur_Setter";
-  onblur_Setter_(mthis, __arg_0) => onblur_Setter(mthis, __arg_0);
+  onfocus_Setter_(mthis, __arg_0) => mthis["onfocus"] = __arg_0;
 
-  static oncancel_Getter(mthis) native "Document_oncancel_Getter";
-  oncancel_Getter_(mthis) => oncancel_Getter(mthis);
+  onfullscreenchange_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onfullscreenchange");
 
-  static oncancel_Setter(mthis, __arg_0) native "Document_oncancel_Setter";
-  oncancel_Setter_(mthis, __arg_0) => oncancel_Setter(mthis, __arg_0);
+  onfullscreenchange_Setter_(mthis, __arg_0) => mthis["onfullscreenchange"] = __arg_0;
 
-  static oncanplay_Getter(mthis) native "Document_oncanplay_Getter";
-  oncanplay_Getter_(mthis) => oncanplay_Getter(mthis);
+  onfullscreenerror_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onfullscreenerror");
 
-  static oncanplay_Setter(mthis, __arg_0) native "Document_oncanplay_Setter";
-  oncanplay_Setter_(mthis, __arg_0) => oncanplay_Setter(mthis, __arg_0);
+  onfullscreenerror_Setter_(mthis, __arg_0) => mthis["onfullscreenerror"] = __arg_0;
 
-  static oncanplaythrough_Getter(mthis) native "Document_oncanplaythrough_Getter";
-  oncanplaythrough_Getter_(mthis) => oncanplaythrough_Getter(mthis);
+  oninput_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "oninput");
 
-  static oncanplaythrough_Setter(mthis, __arg_0) native "Document_oncanplaythrough_Setter";
-  oncanplaythrough_Setter_(mthis, __arg_0) => oncanplaythrough_Setter(mthis, __arg_0);
+  oninput_Setter_(mthis, __arg_0) => mthis["oninput"] = __arg_0;
 
-  static onchange_Getter(mthis) native "Document_onchange_Getter";
-  onchange_Getter_(mthis) => onchange_Getter(mthis);
+  oninvalid_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "oninvalid");
 
-  static onchange_Setter(mthis, __arg_0) native "Document_onchange_Setter";
-  onchange_Setter_(mthis, __arg_0) => onchange_Setter(mthis, __arg_0);
+  oninvalid_Setter_(mthis, __arg_0) => mthis["oninvalid"] = __arg_0;
 
-  static onclick_Getter(mthis) native "Document_onclick_Getter";
-  onclick_Getter_(mthis) => onclick_Getter(mthis);
+  onkeydown_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onkeydown");
 
-  static onclick_Setter(mthis, __arg_0) native "Document_onclick_Setter";
-  onclick_Setter_(mthis, __arg_0) => onclick_Setter(mthis, __arg_0);
+  onkeydown_Setter_(mthis, __arg_0) => mthis["onkeydown"] = __arg_0;
 
-  static onclose_Getter(mthis) native "Document_onclose_Getter";
-  onclose_Getter_(mthis) => onclose_Getter(mthis);
+  onkeypress_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onkeypress");
 
-  static onclose_Setter(mthis, __arg_0) native "Document_onclose_Setter";
-  onclose_Setter_(mthis, __arg_0) => onclose_Setter(mthis, __arg_0);
+  onkeypress_Setter_(mthis, __arg_0) => mthis["onkeypress"] = __arg_0;
 
-  static oncontextmenu_Getter(mthis) native "Document_oncontextmenu_Getter";
-  oncontextmenu_Getter_(mthis) => oncontextmenu_Getter(mthis);
+  onkeyup_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onkeyup");
 
-  static oncontextmenu_Setter(mthis, __arg_0) native "Document_oncontextmenu_Setter";
-  oncontextmenu_Setter_(mthis, __arg_0) => oncontextmenu_Setter(mthis, __arg_0);
+  onkeyup_Setter_(mthis, __arg_0) => mthis["onkeyup"] = __arg_0;
 
-  static oncopy_Getter(mthis) native "Document_oncopy_Getter";
-  oncopy_Getter_(mthis) => oncopy_Getter(mthis);
+  onload_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onload");
 
-  static oncopy_Setter(mthis, __arg_0) native "Document_oncopy_Setter";
-  oncopy_Setter_(mthis, __arg_0) => oncopy_Setter(mthis, __arg_0);
+  onload_Setter_(mthis, __arg_0) => mthis["onload"] = __arg_0;
 
-  static oncuechange_Getter(mthis) native "Document_oncuechange_Getter";
-  oncuechange_Getter_(mthis) => oncuechange_Getter(mthis);
+  onloadeddata_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onloadeddata");
 
-  static oncuechange_Setter(mthis, __arg_0) native "Document_oncuechange_Setter";
-  oncuechange_Setter_(mthis, __arg_0) => oncuechange_Setter(mthis, __arg_0);
+  onloadeddata_Setter_(mthis, __arg_0) => mthis["onloadeddata"] = __arg_0;
 
-  static oncut_Getter(mthis) native "Document_oncut_Getter";
-  oncut_Getter_(mthis) => oncut_Getter(mthis);
+  onloadedmetadata_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onloadedmetadata");
 
-  static oncut_Setter(mthis, __arg_0) native "Document_oncut_Setter";
-  oncut_Setter_(mthis, __arg_0) => oncut_Setter(mthis, __arg_0);
+  onloadedmetadata_Setter_(mthis, __arg_0) => mthis["onloadedmetadata"] = __arg_0;
 
-  static ondblclick_Getter(mthis) native "Document_ondblclick_Getter";
-  ondblclick_Getter_(mthis) => ondblclick_Getter(mthis);
+  onloadstart_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onloadstart");
 
-  static ondblclick_Setter(mthis, __arg_0) native "Document_ondblclick_Setter";
-  ondblclick_Setter_(mthis, __arg_0) => ondblclick_Setter(mthis, __arg_0);
+  onloadstart_Setter_(mthis, __arg_0) => mthis["onloadstart"] = __arg_0;
 
-  static ondrag_Getter(mthis) native "Document_ondrag_Getter";
-  ondrag_Getter_(mthis) => ondrag_Getter(mthis);
+  onmousedown_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onmousedown");
 
-  static ondrag_Setter(mthis, __arg_0) native "Document_ondrag_Setter";
-  ondrag_Setter_(mthis, __arg_0) => ondrag_Setter(mthis, __arg_0);
+  onmousedown_Setter_(mthis, __arg_0) => mthis["onmousedown"] = __arg_0;
 
-  static ondragend_Getter(mthis) native "Document_ondragend_Getter";
-  ondragend_Getter_(mthis) => ondragend_Getter(mthis);
+  onmouseenter_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onmouseenter");
 
-  static ondragend_Setter(mthis, __arg_0) native "Document_ondragend_Setter";
-  ondragend_Setter_(mthis, __arg_0) => ondragend_Setter(mthis, __arg_0);
+  onmouseenter_Setter_(mthis, __arg_0) => mthis["onmouseenter"] = __arg_0;
 
-  static ondragenter_Getter(mthis) native "Document_ondragenter_Getter";
-  ondragenter_Getter_(mthis) => ondragenter_Getter(mthis);
+  onmouseleave_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onmouseleave");
 
-  static ondragenter_Setter(mthis, __arg_0) native "Document_ondragenter_Setter";
-  ondragenter_Setter_(mthis, __arg_0) => ondragenter_Setter(mthis, __arg_0);
-
-  static ondragleave_Getter(mthis) native "Document_ondragleave_Getter";
-  ondragleave_Getter_(mthis) => ondragleave_Getter(mthis);
-
-  static ondragleave_Setter(mthis, __arg_0) native "Document_ondragleave_Setter";
-  ondragleave_Setter_(mthis, __arg_0) => ondragleave_Setter(mthis, __arg_0);
-
-  static ondragover_Getter(mthis) native "Document_ondragover_Getter";
-  ondragover_Getter_(mthis) => ondragover_Getter(mthis);
-
-  static ondragover_Setter(mthis, __arg_0) native "Document_ondragover_Setter";
-  ondragover_Setter_(mthis, __arg_0) => ondragover_Setter(mthis, __arg_0);
-
-  static ondragstart_Getter(mthis) native "Document_ondragstart_Getter";
-  ondragstart_Getter_(mthis) => ondragstart_Getter(mthis);
-
-  static ondragstart_Setter(mthis, __arg_0) native "Document_ondragstart_Setter";
-  ondragstart_Setter_(mthis, __arg_0) => ondragstart_Setter(mthis, __arg_0);
-
-  static ondrop_Getter(mthis) native "Document_ondrop_Getter";
-  ondrop_Getter_(mthis) => ondrop_Getter(mthis);
-
-  static ondrop_Setter(mthis, __arg_0) native "Document_ondrop_Setter";
-  ondrop_Setter_(mthis, __arg_0) => ondrop_Setter(mthis, __arg_0);
-
-  static ondurationchange_Getter(mthis) native "Document_ondurationchange_Getter";
-  ondurationchange_Getter_(mthis) => ondurationchange_Getter(mthis);
-
-  static ondurationchange_Setter(mthis, __arg_0) native "Document_ondurationchange_Setter";
-  ondurationchange_Setter_(mthis, __arg_0) => ondurationchange_Setter(mthis, __arg_0);
-
-  static onemptied_Getter(mthis) native "Document_onemptied_Getter";
-  onemptied_Getter_(mthis) => onemptied_Getter(mthis);
-
-  static onemptied_Setter(mthis, __arg_0) native "Document_onemptied_Setter";
-  onemptied_Setter_(mthis, __arg_0) => onemptied_Setter(mthis, __arg_0);
-
-  static onended_Getter(mthis) native "Document_onended_Getter";
-  onended_Getter_(mthis) => onended_Getter(mthis);
-
-  static onended_Setter(mthis, __arg_0) native "Document_onended_Setter";
-  onended_Setter_(mthis, __arg_0) => onended_Setter(mthis, __arg_0);
-
-  static onerror_Getter(mthis) native "Document_onerror_Getter";
-  onerror_Getter_(mthis) => onerror_Getter(mthis);
-
-  static onerror_Setter(mthis, __arg_0) native "Document_onerror_Setter";
-  onerror_Setter_(mthis, __arg_0) => onerror_Setter(mthis, __arg_0);
-
-  static onfocus_Getter(mthis) native "Document_onfocus_Getter";
-  onfocus_Getter_(mthis) => onfocus_Getter(mthis);
-
-  static onfocus_Setter(mthis, __arg_0) native "Document_onfocus_Setter";
-  onfocus_Setter_(mthis, __arg_0) => onfocus_Setter(mthis, __arg_0);
-
-  static onfullscreenchange_Getter(mthis) native "Document_onfullscreenchange_Getter";
-  onfullscreenchange_Getter_(mthis) => onfullscreenchange_Getter(mthis);
-
-  static onfullscreenchange_Setter(mthis, __arg_0) native "Document_onfullscreenchange_Setter";
-  onfullscreenchange_Setter_(mthis, __arg_0) => onfullscreenchange_Setter(mthis, __arg_0);
-
-  static onfullscreenerror_Getter(mthis) native "Document_onfullscreenerror_Getter";
-  onfullscreenerror_Getter_(mthis) => onfullscreenerror_Getter(mthis);
-
-  static onfullscreenerror_Setter(mthis, __arg_0) native "Document_onfullscreenerror_Setter";
-  onfullscreenerror_Setter_(mthis, __arg_0) => onfullscreenerror_Setter(mthis, __arg_0);
-
-  static oninput_Getter(mthis) native "Document_oninput_Getter";
-  oninput_Getter_(mthis) => oninput_Getter(mthis);
-
-  static oninput_Setter(mthis, __arg_0) native "Document_oninput_Setter";
-  oninput_Setter_(mthis, __arg_0) => oninput_Setter(mthis, __arg_0);
-
-  static oninvalid_Getter(mthis) native "Document_oninvalid_Getter";
-  oninvalid_Getter_(mthis) => oninvalid_Getter(mthis);
-
-  static oninvalid_Setter(mthis, __arg_0) native "Document_oninvalid_Setter";
-  oninvalid_Setter_(mthis, __arg_0) => oninvalid_Setter(mthis, __arg_0);
-
-  static onkeydown_Getter(mthis) native "Document_onkeydown_Getter";
-  onkeydown_Getter_(mthis) => onkeydown_Getter(mthis);
-
-  static onkeydown_Setter(mthis, __arg_0) native "Document_onkeydown_Setter";
-  onkeydown_Setter_(mthis, __arg_0) => onkeydown_Setter(mthis, __arg_0);
-
-  static onkeypress_Getter(mthis) native "Document_onkeypress_Getter";
-  onkeypress_Getter_(mthis) => onkeypress_Getter(mthis);
-
-  static onkeypress_Setter(mthis, __arg_0) native "Document_onkeypress_Setter";
-  onkeypress_Setter_(mthis, __arg_0) => onkeypress_Setter(mthis, __arg_0);
-
-  static onkeyup_Getter(mthis) native "Document_onkeyup_Getter";
-  onkeyup_Getter_(mthis) => onkeyup_Getter(mthis);
-
-  static onkeyup_Setter(mthis, __arg_0) native "Document_onkeyup_Setter";
-  onkeyup_Setter_(mthis, __arg_0) => onkeyup_Setter(mthis, __arg_0);
-
-  static onload_Getter(mthis) native "Document_onload_Getter";
-  onload_Getter_(mthis) => onload_Getter(mthis);
-
-  static onload_Setter(mthis, __arg_0) native "Document_onload_Setter";
-  onload_Setter_(mthis, __arg_0) => onload_Setter(mthis, __arg_0);
-
-  static onloadeddata_Getter(mthis) native "Document_onloadeddata_Getter";
-  onloadeddata_Getter_(mthis) => onloadeddata_Getter(mthis);
-
-  static onloadeddata_Setter(mthis, __arg_0) native "Document_onloadeddata_Setter";
-  onloadeddata_Setter_(mthis, __arg_0) => onloadeddata_Setter(mthis, __arg_0);
-
-  static onloadedmetadata_Getter(mthis) native "Document_onloadedmetadata_Getter";
-  onloadedmetadata_Getter_(mthis) => onloadedmetadata_Getter(mthis);
-
-  static onloadedmetadata_Setter(mthis, __arg_0) native "Document_onloadedmetadata_Setter";
-  onloadedmetadata_Setter_(mthis, __arg_0) => onloadedmetadata_Setter(mthis, __arg_0);
-
-  static onloadstart_Getter(mthis) native "Document_onloadstart_Getter";
-  onloadstart_Getter_(mthis) => onloadstart_Getter(mthis);
-
-  static onloadstart_Setter(mthis, __arg_0) native "Document_onloadstart_Setter";
-  onloadstart_Setter_(mthis, __arg_0) => onloadstart_Setter(mthis, __arg_0);
-
-  static onmousedown_Getter(mthis) native "Document_onmousedown_Getter";
-  onmousedown_Getter_(mthis) => onmousedown_Getter(mthis);
-
-  static onmousedown_Setter(mthis, __arg_0) native "Document_onmousedown_Setter";
-  onmousedown_Setter_(mthis, __arg_0) => onmousedown_Setter(mthis, __arg_0);
-
-  static onmouseenter_Getter(mthis) native "Document_onmouseenter_Getter";
-  onmouseenter_Getter_(mthis) => onmouseenter_Getter(mthis);
-
-  static onmouseenter_Setter(mthis, __arg_0) native "Document_onmouseenter_Setter";
-  onmouseenter_Setter_(mthis, __arg_0) => onmouseenter_Setter(mthis, __arg_0);
-
-  static onmouseleave_Getter(mthis) native "Document_onmouseleave_Getter";
-  onmouseleave_Getter_(mthis) => onmouseleave_Getter(mthis);
-
-  static onmouseleave_Setter(mthis, __arg_0) native "Document_onmouseleave_Setter";
-  onmouseleave_Setter_(mthis, __arg_0) => onmouseleave_Setter(mthis, __arg_0);
-
-  static onmousemove_Getter(mthis) native "Document_onmousemove_Getter";
-  onmousemove_Getter_(mthis) => onmousemove_Getter(mthis);
-
-  static onmousemove_Setter(mthis, __arg_0) native "Document_onmousemove_Setter";
-  onmousemove_Setter_(mthis, __arg_0) => onmousemove_Setter(mthis, __arg_0);
-
-  static onmouseout_Getter(mthis) native "Document_onmouseout_Getter";
-  onmouseout_Getter_(mthis) => onmouseout_Getter(mthis);
-
-  static onmouseout_Setter(mthis, __arg_0) native "Document_onmouseout_Setter";
-  onmouseout_Setter_(mthis, __arg_0) => onmouseout_Setter(mthis, __arg_0);
-
-  static onmouseover_Getter(mthis) native "Document_onmouseover_Getter";
-  onmouseover_Getter_(mthis) => onmouseover_Getter(mthis);
-
-  static onmouseover_Setter(mthis, __arg_0) native "Document_onmouseover_Setter";
-  onmouseover_Setter_(mthis, __arg_0) => onmouseover_Setter(mthis, __arg_0);
-
-  static onmouseup_Getter(mthis) native "Document_onmouseup_Getter";
-  onmouseup_Getter_(mthis) => onmouseup_Getter(mthis);
-
-  static onmouseup_Setter(mthis, __arg_0) native "Document_onmouseup_Setter";
-  onmouseup_Setter_(mthis, __arg_0) => onmouseup_Setter(mthis, __arg_0);
-
-  static onmousewheel_Getter(mthis) native "Document_onmousewheel_Getter";
-  onmousewheel_Getter_(mthis) => onmousewheel_Getter(mthis);
-
-  static onmousewheel_Setter(mthis, __arg_0) native "Document_onmousewheel_Setter";
-  onmousewheel_Setter_(mthis, __arg_0) => onmousewheel_Setter(mthis, __arg_0);
-
-  static onpaste_Getter(mthis) native "Document_onpaste_Getter";
-  onpaste_Getter_(mthis) => onpaste_Getter(mthis);
-
-  static onpaste_Setter(mthis, __arg_0) native "Document_onpaste_Setter";
-  onpaste_Setter_(mthis, __arg_0) => onpaste_Setter(mthis, __arg_0);
-
-  static onpause_Getter(mthis) native "Document_onpause_Getter";
-  onpause_Getter_(mthis) => onpause_Getter(mthis);
-
-  static onpause_Setter(mthis, __arg_0) native "Document_onpause_Setter";
-  onpause_Setter_(mthis, __arg_0) => onpause_Setter(mthis, __arg_0);
-
-  static onplay_Getter(mthis) native "Document_onplay_Getter";
-  onplay_Getter_(mthis) => onplay_Getter(mthis);
-
-  static onplay_Setter(mthis, __arg_0) native "Document_onplay_Setter";
-  onplay_Setter_(mthis, __arg_0) => onplay_Setter(mthis, __arg_0);
-
-  static onplaying_Getter(mthis) native "Document_onplaying_Getter";
-  onplaying_Getter_(mthis) => onplaying_Getter(mthis);
-
-  static onplaying_Setter(mthis, __arg_0) native "Document_onplaying_Setter";
-  onplaying_Setter_(mthis, __arg_0) => onplaying_Setter(mthis, __arg_0);
-
-  static onpointerlockchange_Getter(mthis) native "Document_onpointerlockchange_Getter";
-  onpointerlockchange_Getter_(mthis) => onpointerlockchange_Getter(mthis);
-
-  static onpointerlockchange_Setter(mthis, __arg_0) native "Document_onpointerlockchange_Setter";
-  onpointerlockchange_Setter_(mthis, __arg_0) => onpointerlockchange_Setter(mthis, __arg_0);
-
-  static onpointerlockerror_Getter(mthis) native "Document_onpointerlockerror_Getter";
-  onpointerlockerror_Getter_(mthis) => onpointerlockerror_Getter(mthis);
-
-  static onpointerlockerror_Setter(mthis, __arg_0) native "Document_onpointerlockerror_Setter";
-  onpointerlockerror_Setter_(mthis, __arg_0) => onpointerlockerror_Setter(mthis, __arg_0);
+  onmouseleave_Setter_(mthis, __arg_0) => mthis["onmouseleave"] = __arg_0;
 
-  static onprogress_Getter(mthis) native "Document_onprogress_Getter";
-  onprogress_Getter_(mthis) => onprogress_Getter(mthis);
+  onmousemove_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onmousemove");
 
-  static onprogress_Setter(mthis, __arg_0) native "Document_onprogress_Setter";
-  onprogress_Setter_(mthis, __arg_0) => onprogress_Setter(mthis, __arg_0);
+  onmousemove_Setter_(mthis, __arg_0) => mthis["onmousemove"] = __arg_0;
 
-  static onratechange_Getter(mthis) native "Document_onratechange_Getter";
-  onratechange_Getter_(mthis) => onratechange_Getter(mthis);
+  onmouseout_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onmouseout");
 
-  static onratechange_Setter(mthis, __arg_0) native "Document_onratechange_Setter";
-  onratechange_Setter_(mthis, __arg_0) => onratechange_Setter(mthis, __arg_0);
+  onmouseout_Setter_(mthis, __arg_0) => mthis["onmouseout"] = __arg_0;
 
-  static onreadystatechange_Getter(mthis) native "Document_onreadystatechange_Getter";
-  onreadystatechange_Getter_(mthis) => onreadystatechange_Getter(mthis);
+  onmouseover_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onmouseover");
 
-  static onreadystatechange_Setter(mthis, __arg_0) native "Document_onreadystatechange_Setter";
-  onreadystatechange_Setter_(mthis, __arg_0) => onreadystatechange_Setter(mthis, __arg_0);
+  onmouseover_Setter_(mthis, __arg_0) => mthis["onmouseover"] = __arg_0;
 
-  static onreset_Getter(mthis) native "Document_onreset_Getter";
-  onreset_Getter_(mthis) => onreset_Getter(mthis);
+  onmouseup_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onmouseup");
 
-  static onreset_Setter(mthis, __arg_0) native "Document_onreset_Setter";
-  onreset_Setter_(mthis, __arg_0) => onreset_Setter(mthis, __arg_0);
+  onmouseup_Setter_(mthis, __arg_0) => mthis["onmouseup"] = __arg_0;
 
-  static onresize_Getter(mthis) native "Document_onresize_Getter";
-  onresize_Getter_(mthis) => onresize_Getter(mthis);
+  onmousewheel_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onmousewheel");
 
-  static onresize_Setter(mthis, __arg_0) native "Document_onresize_Setter";
-  onresize_Setter_(mthis, __arg_0) => onresize_Setter(mthis, __arg_0);
+  onmousewheel_Setter_(mthis, __arg_0) => mthis["onmousewheel"] = __arg_0;
 
-  static onscroll_Getter(mthis) native "Document_onscroll_Getter";
-  onscroll_Getter_(mthis) => onscroll_Getter(mthis);
+  onpaste_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onpaste");
 
-  static onscroll_Setter(mthis, __arg_0) native "Document_onscroll_Setter";
-  onscroll_Setter_(mthis, __arg_0) => onscroll_Setter(mthis, __arg_0);
+  onpaste_Setter_(mthis, __arg_0) => mthis["onpaste"] = __arg_0;
 
-  static onsearch_Getter(mthis) native "Document_onsearch_Getter";
-  onsearch_Getter_(mthis) => onsearch_Getter(mthis);
+  onpause_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onpause");
 
-  static onsearch_Setter(mthis, __arg_0) native "Document_onsearch_Setter";
-  onsearch_Setter_(mthis, __arg_0) => onsearch_Setter(mthis, __arg_0);
+  onpause_Setter_(mthis, __arg_0) => mthis["onpause"] = __arg_0;
 
-  static onsecuritypolicyviolation_Getter(mthis) native "Document_onsecuritypolicyviolation_Getter";
-  onsecuritypolicyviolation_Getter_(mthis) => onsecuritypolicyviolation_Getter(mthis);
+  onplay_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onplay");
 
-  static onsecuritypolicyviolation_Setter(mthis, __arg_0) native "Document_onsecuritypolicyviolation_Setter";
-  onsecuritypolicyviolation_Setter_(mthis, __arg_0) => onsecuritypolicyviolation_Setter(mthis, __arg_0);
+  onplay_Setter_(mthis, __arg_0) => mthis["onplay"] = __arg_0;
 
-  static onseeked_Getter(mthis) native "Document_onseeked_Getter";
-  onseeked_Getter_(mthis) => onseeked_Getter(mthis);
+  onplaying_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onplaying");
 
-  static onseeked_Setter(mthis, __arg_0) native "Document_onseeked_Setter";
-  onseeked_Setter_(mthis, __arg_0) => onseeked_Setter(mthis, __arg_0);
+  onplaying_Setter_(mthis, __arg_0) => mthis["onplaying"] = __arg_0;
 
-  static onseeking_Getter(mthis) native "Document_onseeking_Getter";
-  onseeking_Getter_(mthis) => onseeking_Getter(mthis);
+  onpointerlockchange_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onpointerlockchange");
 
-  static onseeking_Setter(mthis, __arg_0) native "Document_onseeking_Setter";
-  onseeking_Setter_(mthis, __arg_0) => onseeking_Setter(mthis, __arg_0);
+  onpointerlockchange_Setter_(mthis, __arg_0) => mthis["onpointerlockchange"] = __arg_0;
 
-  static onselect_Getter(mthis) native "Document_onselect_Getter";
-  onselect_Getter_(mthis) => onselect_Getter(mthis);
+  onpointerlockerror_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onpointerlockerror");
 
-  static onselect_Setter(mthis, __arg_0) native "Document_onselect_Setter";
-  onselect_Setter_(mthis, __arg_0) => onselect_Setter(mthis, __arg_0);
+  onpointerlockerror_Setter_(mthis, __arg_0) => mthis["onpointerlockerror"] = __arg_0;
 
-  static onselectionchange_Getter(mthis) native "Document_onselectionchange_Getter";
-  onselectionchange_Getter_(mthis) => onselectionchange_Getter(mthis);
+  onprogress_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onprogress");
 
-  static onselectionchange_Setter(mthis, __arg_0) native "Document_onselectionchange_Setter";
-  onselectionchange_Setter_(mthis, __arg_0) => onselectionchange_Setter(mthis, __arg_0);
+  onprogress_Setter_(mthis, __arg_0) => mthis["onprogress"] = __arg_0;
 
-  static onselectstart_Getter(mthis) native "Document_onselectstart_Getter";
-  onselectstart_Getter_(mthis) => onselectstart_Getter(mthis);
+  onratechange_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onratechange");
 
-  static onselectstart_Setter(mthis, __arg_0) native "Document_onselectstart_Setter";
-  onselectstart_Setter_(mthis, __arg_0) => onselectstart_Setter(mthis, __arg_0);
+  onratechange_Setter_(mthis, __arg_0) => mthis["onratechange"] = __arg_0;
 
-  static onshow_Getter(mthis) native "Document_onshow_Getter";
-  onshow_Getter_(mthis) => onshow_Getter(mthis);
+  onreadystatechange_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onreadystatechange");
 
-  static onshow_Setter(mthis, __arg_0) native "Document_onshow_Setter";
-  onshow_Setter_(mthis, __arg_0) => onshow_Setter(mthis, __arg_0);
+  onreadystatechange_Setter_(mthis, __arg_0) => mthis["onreadystatechange"] = __arg_0;
 
-  static onstalled_Getter(mthis) native "Document_onstalled_Getter";
-  onstalled_Getter_(mthis) => onstalled_Getter(mthis);
+  onreset_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onreset");
 
-  static onstalled_Setter(mthis, __arg_0) native "Document_onstalled_Setter";
-  onstalled_Setter_(mthis, __arg_0) => onstalled_Setter(mthis, __arg_0);
+  onreset_Setter_(mthis, __arg_0) => mthis["onreset"] = __arg_0;
 
-  static onsubmit_Getter(mthis) native "Document_onsubmit_Getter";
-  onsubmit_Getter_(mthis) => onsubmit_Getter(mthis);
+  onresize_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onresize");
 
-  static onsubmit_Setter(mthis, __arg_0) native "Document_onsubmit_Setter";
-  onsubmit_Setter_(mthis, __arg_0) => onsubmit_Setter(mthis, __arg_0);
+  onresize_Setter_(mthis, __arg_0) => mthis["onresize"] = __arg_0;
 
-  static onsuspend_Getter(mthis) native "Document_onsuspend_Getter";
-  onsuspend_Getter_(mthis) => onsuspend_Getter(mthis);
+  onscroll_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onscroll");
 
-  static onsuspend_Setter(mthis, __arg_0) native "Document_onsuspend_Setter";
-  onsuspend_Setter_(mthis, __arg_0) => onsuspend_Setter(mthis, __arg_0);
+  onscroll_Setter_(mthis, __arg_0) => mthis["onscroll"] = __arg_0;
 
-  static ontimeupdate_Getter(mthis) native "Document_ontimeupdate_Getter";
-  ontimeupdate_Getter_(mthis) => ontimeupdate_Getter(mthis);
+  onsearch_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onsearch");
 
-  static ontimeupdate_Setter(mthis, __arg_0) native "Document_ontimeupdate_Setter";
-  ontimeupdate_Setter_(mthis, __arg_0) => ontimeupdate_Setter(mthis, __arg_0);
+  onsearch_Setter_(mthis, __arg_0) => mthis["onsearch"] = __arg_0;
 
-  static ontoggle_Getter(mthis) native "Document_ontoggle_Getter";
-  ontoggle_Getter_(mthis) => ontoggle_Getter(mthis);
+  onsecuritypolicyviolation_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onsecuritypolicyviolation");
 
-  static ontoggle_Setter(mthis, __arg_0) native "Document_ontoggle_Setter";
-  ontoggle_Setter_(mthis, __arg_0) => ontoggle_Setter(mthis, __arg_0);
+  onsecuritypolicyviolation_Setter_(mthis, __arg_0) => mthis["onsecuritypolicyviolation"] = __arg_0;
 
-  static ontouchcancel_Getter(mthis) native "Document_ontouchcancel_Getter";
-  ontouchcancel_Getter_(mthis) => ontouchcancel_Getter(mthis);
+  onseeked_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onseeked");
 
-  static ontouchcancel_Setter(mthis, __arg_0) native "Document_ontouchcancel_Setter";
-  ontouchcancel_Setter_(mthis, __arg_0) => ontouchcancel_Setter(mthis, __arg_0);
+  onseeked_Setter_(mthis, __arg_0) => mthis["onseeked"] = __arg_0;
 
-  static ontouchend_Getter(mthis) native "Document_ontouchend_Getter";
-  ontouchend_Getter_(mthis) => ontouchend_Getter(mthis);
+  onseeking_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onseeking");
 
-  static ontouchend_Setter(mthis, __arg_0) native "Document_ontouchend_Setter";
-  ontouchend_Setter_(mthis, __arg_0) => ontouchend_Setter(mthis, __arg_0);
+  onseeking_Setter_(mthis, __arg_0) => mthis["onseeking"] = __arg_0;
 
-  static ontouchmove_Getter(mthis) native "Document_ontouchmove_Getter";
-  ontouchmove_Getter_(mthis) => ontouchmove_Getter(mthis);
+  onselect_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onselect");
 
-  static ontouchmove_Setter(mthis, __arg_0) native "Document_ontouchmove_Setter";
-  ontouchmove_Setter_(mthis, __arg_0) => ontouchmove_Setter(mthis, __arg_0);
+  onselect_Setter_(mthis, __arg_0) => mthis["onselect"] = __arg_0;
 
-  static ontouchstart_Getter(mthis) native "Document_ontouchstart_Getter";
-  ontouchstart_Getter_(mthis) => ontouchstart_Getter(mthis);
+  onselectionchange_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onselectionchange");
 
-  static ontouchstart_Setter(mthis, __arg_0) native "Document_ontouchstart_Setter";
-  ontouchstart_Setter_(mthis, __arg_0) => ontouchstart_Setter(mthis, __arg_0);
+  onselectionchange_Setter_(mthis, __arg_0) => mthis["onselectionchange"] = __arg_0;
 
-  static onvolumechange_Getter(mthis) native "Document_onvolumechange_Getter";
-  onvolumechange_Getter_(mthis) => onvolumechange_Getter(mthis);
+  onselectstart_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onselectstart");
 
-  static onvolumechange_Setter(mthis, __arg_0) native "Document_onvolumechange_Setter";
-  onvolumechange_Setter_(mthis, __arg_0) => onvolumechange_Setter(mthis, __arg_0);
+  onselectstart_Setter_(mthis, __arg_0) => mthis["onselectstart"] = __arg_0;
 
-  static onwaiting_Getter(mthis) native "Document_onwaiting_Getter";
-  onwaiting_Getter_(mthis) => onwaiting_Getter(mthis);
+  onshow_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onshow");
 
-  static onwaiting_Setter(mthis, __arg_0) native "Document_onwaiting_Setter";
-  onwaiting_Setter_(mthis, __arg_0) => onwaiting_Setter(mthis, __arg_0);
+  onshow_Setter_(mthis, __arg_0) => mthis["onshow"] = __arg_0;
 
-  static onwebkitfullscreenchange_Getter(mthis) native "Document_onwebkitfullscreenchange_Getter";
-  onwebkitfullscreenchange_Getter_(mthis) => onwebkitfullscreenchange_Getter(mthis);
+  onstalled_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onstalled");
 
-  static onwebkitfullscreenchange_Setter(mthis, __arg_0) native "Document_onwebkitfullscreenchange_Setter";
-  onwebkitfullscreenchange_Setter_(mthis, __arg_0) => onwebkitfullscreenchange_Setter(mthis, __arg_0);
+  onstalled_Setter_(mthis, __arg_0) => mthis["onstalled"] = __arg_0;
 
-  static onwebkitfullscreenerror_Getter(mthis) native "Document_onwebkitfullscreenerror_Getter";
-  onwebkitfullscreenerror_Getter_(mthis) => onwebkitfullscreenerror_Getter(mthis);
+  onsubmit_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onsubmit");
 
-  static onwebkitfullscreenerror_Setter(mthis, __arg_0) native "Document_onwebkitfullscreenerror_Setter";
-  onwebkitfullscreenerror_Setter_(mthis, __arg_0) => onwebkitfullscreenerror_Setter(mthis, __arg_0);
+  onsubmit_Setter_(mthis, __arg_0) => mthis["onsubmit"] = __arg_0;
 
-  static onwheel_Getter(mthis) native "Document_onwheel_Getter";
-  onwheel_Getter_(mthis) => onwheel_Getter(mthis);
+  onsuspend_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onsuspend");
 
-  static onwheel_Setter(mthis, __arg_0) native "Document_onwheel_Setter";
-  onwheel_Setter_(mthis, __arg_0) => onwheel_Setter(mthis, __arg_0);
+  onsuspend_Setter_(mthis, __arg_0) => mthis["onsuspend"] = __arg_0;
 
-  static plugins_Getter(mthis) native "Document_plugins_Getter";
-  plugins_Getter_(mthis) => plugins_Getter(mthis);
+  ontimeupdate_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ontimeupdate");
 
-  static pointerLockElement_Getter(mthis) native "Document_pointerLockElement_Getter";
-  pointerLockElement_Getter_(mthis) => pointerLockElement_Getter(mthis);
+  ontimeupdate_Setter_(mthis, __arg_0) => mthis["ontimeupdate"] = __arg_0;
 
-  static preferredStylesheetSet_Getter(mthis) native "Document_preferredStylesheetSet_Getter";
-  preferredStylesheetSet_Getter_(mthis) => preferredStylesheetSet_Getter(mthis);
+  ontoggle_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ontoggle");
 
-  static queryCommandEnabled_Callback_0(mthis) native "Document_queryCommandEnabled_Callback";
-  queryCommandEnabled_Callback_0_(mthis) => queryCommandEnabled_Callback_0(mthis);
+  ontoggle_Setter_(mthis, __arg_0) => mthis["ontoggle"] = __arg_0;
 
-  static queryCommandEnabled_Callback_1(mthis, __arg_0) native "Document_queryCommandEnabled_Callback";
-  queryCommandEnabled_Callback_1_(mthis, __arg_0) => queryCommandEnabled_Callback_1(mthis, __arg_0);
+  ontouchcancel_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ontouchcancel");
 
-  static queryCommandEnabled_Callback_2(mthis, __arg_0, __arg_1) native "Document_queryCommandEnabled_Callback";
-  queryCommandEnabled_Callback_2_(mthis, __arg_0, __arg_1) => queryCommandEnabled_Callback_2(mthis, __arg_0, __arg_1);
+  ontouchcancel_Setter_(mthis, __arg_0) => mthis["ontouchcancel"] = __arg_0;
 
-  static queryCommandEnabled_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Document_queryCommandEnabled_Callback";
-  queryCommandEnabled_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => queryCommandEnabled_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  ontouchend_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ontouchend");
 
-  static queryCommandIndeterm_Callback_0(mthis) native "Document_queryCommandIndeterm_Callback";
-  queryCommandIndeterm_Callback_0_(mthis) => queryCommandIndeterm_Callback_0(mthis);
+  ontouchend_Setter_(mthis, __arg_0) => mthis["ontouchend"] = __arg_0;
 
-  static queryCommandIndeterm_Callback_1(mthis, __arg_0) native "Document_queryCommandIndeterm_Callback";
-  queryCommandIndeterm_Callback_1_(mthis, __arg_0) => queryCommandIndeterm_Callback_1(mthis, __arg_0);
+  ontouchmove_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ontouchmove");
 
-  static queryCommandIndeterm_Callback_2(mthis, __arg_0, __arg_1) native "Document_queryCommandIndeterm_Callback";
-  queryCommandIndeterm_Callback_2_(mthis, __arg_0, __arg_1) => queryCommandIndeterm_Callback_2(mthis, __arg_0, __arg_1);
+  ontouchmove_Setter_(mthis, __arg_0) => mthis["ontouchmove"] = __arg_0;
 
-  static queryCommandIndeterm_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Document_queryCommandIndeterm_Callback";
-  queryCommandIndeterm_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => queryCommandIndeterm_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  ontouchstart_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ontouchstart");
 
-  static queryCommandState_Callback_0(mthis) native "Document_queryCommandState_Callback";
-  queryCommandState_Callback_0_(mthis) => queryCommandState_Callback_0(mthis);
+  ontouchstart_Setter_(mthis, __arg_0) => mthis["ontouchstart"] = __arg_0;
 
-  static queryCommandState_Callback_1(mthis, __arg_0) native "Document_queryCommandState_Callback";
-  queryCommandState_Callback_1_(mthis, __arg_0) => queryCommandState_Callback_1(mthis, __arg_0);
+  onvolumechange_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onvolumechange");
 
-  static queryCommandState_Callback_2(mthis, __arg_0, __arg_1) native "Document_queryCommandState_Callback";
-  queryCommandState_Callback_2_(mthis, __arg_0, __arg_1) => queryCommandState_Callback_2(mthis, __arg_0, __arg_1);
+  onvolumechange_Setter_(mthis, __arg_0) => mthis["onvolumechange"] = __arg_0;
 
-  static queryCommandState_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Document_queryCommandState_Callback";
-  queryCommandState_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => queryCommandState_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  onwaiting_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onwaiting");
 
-  static queryCommandSupported_Callback_0(mthis) native "Document_queryCommandSupported_Callback";
-  queryCommandSupported_Callback_0_(mthis) => queryCommandSupported_Callback_0(mthis);
+  onwaiting_Setter_(mthis, __arg_0) => mthis["onwaiting"] = __arg_0;
 
-  static queryCommandSupported_Callback_1(mthis, __arg_0) native "Document_queryCommandSupported_Callback";
-  queryCommandSupported_Callback_1_(mthis, __arg_0) => queryCommandSupported_Callback_1(mthis, __arg_0);
+  onwebkitfullscreenchange_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onwebkitfullscreenchange");
 
-  static queryCommandSupported_Callback_2(mthis, __arg_0, __arg_1) native "Document_queryCommandSupported_Callback";
-  queryCommandSupported_Callback_2_(mthis, __arg_0, __arg_1) => queryCommandSupported_Callback_2(mthis, __arg_0, __arg_1);
+  onwebkitfullscreenchange_Setter_(mthis, __arg_0) => mthis["onwebkitfullscreenchange"] = __arg_0;
 
-  static queryCommandSupported_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Document_queryCommandSupported_Callback";
-  queryCommandSupported_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => queryCommandSupported_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  onwebkitfullscreenerror_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onwebkitfullscreenerror");
 
-  static queryCommandValue_Callback_0(mthis) native "Document_queryCommandValue_Callback";
-  queryCommandValue_Callback_0_(mthis) => queryCommandValue_Callback_0(mthis);
+  onwebkitfullscreenerror_Setter_(mthis, __arg_0) => mthis["onwebkitfullscreenerror"] = __arg_0;
 
-  static queryCommandValue_Callback_1(mthis, __arg_0) native "Document_queryCommandValue_Callback";
-  queryCommandValue_Callback_1_(mthis, __arg_0) => queryCommandValue_Callback_1(mthis, __arg_0);
+  onwheel_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onwheel");
 
-  static queryCommandValue_Callback_2(mthis, __arg_0, __arg_1) native "Document_queryCommandValue_Callback";
-  queryCommandValue_Callback_2_(mthis, __arg_0, __arg_1) => queryCommandValue_Callback_2(mthis, __arg_0, __arg_1);
+  onwheel_Setter_(mthis, __arg_0) => mthis["onwheel"] = __arg_0;
 
-  static queryCommandValue_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Document_queryCommandValue_Callback";
-  queryCommandValue_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => queryCommandValue_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  plugins_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "plugins");
 
-  static querySelectorAll_Callback_0(mthis) native "Document_querySelectorAll_Callback";
-  querySelectorAll_Callback_0_(mthis) => querySelectorAll_Callback_0(mthis);
+  pointerLockElement_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "pointerLockElement");
 
-  static querySelectorAll_Callback_1(mthis, __arg_0) native "Document_querySelectorAll_Callback";
-  querySelectorAll_Callback_1_(mthis, __arg_0) => querySelectorAll_Callback_1(mthis, __arg_0);
+  preferredStylesheetSet_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "preferredStylesheetSet");
 
-  static querySelectorAll_Callback_2(mthis, __arg_0, __arg_1) native "Document_querySelectorAll_Callback";
-  querySelectorAll_Callback_2_(mthis, __arg_0, __arg_1) => querySelectorAll_Callback_2(mthis, __arg_0, __arg_1);
+  queryCommandEnabled_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "queryCommandEnabled", []);
 
-  static querySelectorAll_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Document_querySelectorAll_Callback";
-  querySelectorAll_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => querySelectorAll_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  queryCommandEnabled_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "queryCommandEnabled", [__arg_0]);
 
-  static querySelector_Callback_0(mthis) native "Document_querySelector_Callback";
-  querySelector_Callback_0_(mthis) => querySelector_Callback_0(mthis);
+  queryCommandIndeterm_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "queryCommandIndeterm", []);
 
-  static querySelector_Callback_1(mthis, __arg_0) native "Document_querySelector_Callback";
-  querySelector_Callback_1_(mthis, __arg_0) => querySelector_Callback_1(mthis, __arg_0);
+  queryCommandIndeterm_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "queryCommandIndeterm", [__arg_0]);
 
-  static querySelector_Callback_2(mthis, __arg_0, __arg_1) native "Document_querySelector_Callback";
-  querySelector_Callback_2_(mthis, __arg_0, __arg_1) => querySelector_Callback_2(mthis, __arg_0, __arg_1);
+  queryCommandState_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "queryCommandState", []);
 
-  static querySelector_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Document_querySelector_Callback";
-  querySelector_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => querySelector_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  queryCommandState_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "queryCommandState", [__arg_0]);
 
-  static readyState_Getter(mthis) native "Document_readyState_Getter";
-  readyState_Getter_(mthis) => readyState_Getter(mthis);
+  queryCommandSupported_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "queryCommandSupported", []);
 
-  static referrer_Getter(mthis) native "Document_referrer_Getter";
-  referrer_Getter_(mthis) => referrer_Getter(mthis);
+  queryCommandSupported_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "queryCommandSupported", [__arg_0]);
 
-  static registerElement_Callback_0(mthis) native "Document_registerElement_Callback";
-  registerElement_Callback_0_(mthis) => registerElement_Callback_0(mthis);
+  queryCommandValue_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "queryCommandValue", []);
 
-  static registerElement_Callback_1(mthis, __arg_0) native "Document_registerElement_Callback";
-  registerElement_Callback_1_(mthis, __arg_0) => registerElement_Callback_1(mthis, __arg_0);
+  queryCommandValue_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "queryCommandValue", [__arg_0]);
 
-  static registerElement_Callback_2(mthis, __arg_0, __arg_1) native "Document_registerElement_Callback";
-  registerElement_Callback_2_(mthis, __arg_0, __arg_1) => registerElement_Callback_2(mthis, __arg_0, __arg_1);
+  querySelectorAll_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "querySelectorAll", []);
 
-  static registerElement_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Document_registerElement_Callback";
-  registerElement_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => registerElement_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  querySelectorAll_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "querySelectorAll", [__arg_0]);
 
-  static registerElement_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Document_registerElement_Callback";
-  registerElement_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => registerElement_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  querySelector_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "querySelector", []);
 
-  static rootElement_Getter(mthis) native "Document_rootElement_Getter";
-  rootElement_Getter_(mthis) => rootElement_Getter(mthis);
+  querySelector_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "querySelector", [__arg_0]);
 
-  static scripts_Getter(mthis) native "Document_scripts_Getter";
-  scripts_Getter_(mthis) => scripts_Getter(mthis);
+  readyState_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "readyState");
 
-  static selectedStylesheetSet_Getter(mthis) native "Document_selectedStylesheetSet_Getter";
-  selectedStylesheetSet_Getter_(mthis) => selectedStylesheetSet_Getter(mthis);
+  referrer_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "referrer");
 
-  static selectedStylesheetSet_Setter(mthis, __arg_0) native "Document_selectedStylesheetSet_Setter";
-  selectedStylesheetSet_Setter_(mthis, __arg_0) => selectedStylesheetSet_Setter(mthis, __arg_0);
+  registerElement_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "registerElement", []);
 
-  static styleSheets_Getter(mthis) native "Document_styleSheets_Getter";
-  styleSheets_Getter_(mthis) => styleSheets_Getter(mthis);
+  registerElement_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "registerElement", [__arg_0]);
 
-  static timeline_Getter(mthis) native "Document_timeline_Getter";
-  timeline_Getter_(mthis) => timeline_Getter(mthis);
+  registerElement_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "registerElement", [__arg_0, __arg_1]);
 
-  static title_Getter(mthis) native "Document_title_Getter";
-  title_Getter_(mthis) => title_Getter(mthis);
+  rootElement_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "rootElement");
 
-  static title_Setter(mthis, __arg_0) native "Document_title_Setter";
-  title_Setter_(mthis, __arg_0) => title_Setter(mthis, __arg_0);
+  scripts_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "scripts");
 
-  static transformDocumentToTreeView_Callback_0(mthis) native "Document_transformDocumentToTreeView_Callback";
-  transformDocumentToTreeView_Callback_0_(mthis) => transformDocumentToTreeView_Callback_0(mthis);
+  selectedStylesheetSet_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "selectedStylesheetSet");
 
-  static transformDocumentToTreeView_Callback_1(mthis, __arg_0) native "Document_transformDocumentToTreeView_Callback";
-  transformDocumentToTreeView_Callback_1_(mthis, __arg_0) => transformDocumentToTreeView_Callback_1(mthis, __arg_0);
+  selectedStylesheetSet_Setter_(mthis, __arg_0) => mthis["selectedStylesheetSet"] = __arg_0;
 
-  static transformDocumentToTreeView_Callback_2(mthis, __arg_0, __arg_1) native "Document_transformDocumentToTreeView_Callback";
-  transformDocumentToTreeView_Callback_2_(mthis, __arg_0, __arg_1) => transformDocumentToTreeView_Callback_2(mthis, __arg_0, __arg_1);
+  styleSheets_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "styleSheets");
 
-  static transformDocumentToTreeView_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Document_transformDocumentToTreeView_Callback";
-  transformDocumentToTreeView_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => transformDocumentToTreeView_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  timeline_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "timeline");
 
-  static visibilityState_Getter(mthis) native "Document_visibilityState_Getter";
-  visibilityState_Getter_(mthis) => visibilityState_Getter(mthis);
+  title_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "title");
 
-  static webkitCancelFullScreen_Callback_0(mthis) native "Document_webkitCancelFullScreen_Callback";
-  webkitCancelFullScreen_Callback_0_(mthis) => webkitCancelFullScreen_Callback_0(mthis);
+  title_Setter_(mthis, __arg_0) => mthis["title"] = __arg_0;
 
-  static webkitCancelFullScreen_Callback_1(mthis, __arg_0) native "Document_webkitCancelFullScreen_Callback";
-  webkitCancelFullScreen_Callback_1_(mthis, __arg_0) => webkitCancelFullScreen_Callback_1(mthis, __arg_0);
+  transformDocumentToTreeView_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "transformDocumentToTreeView", []);
 
-  static webkitCancelFullScreen_Callback_2(mthis, __arg_0, __arg_1) native "Document_webkitCancelFullScreen_Callback";
-  webkitCancelFullScreen_Callback_2_(mthis, __arg_0, __arg_1) => webkitCancelFullScreen_Callback_2(mthis, __arg_0, __arg_1);
+  transformDocumentToTreeView_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "transformDocumentToTreeView", [__arg_0]);
 
-  static webkitExitFullscreen_Callback_0(mthis) native "Document_webkitExitFullscreen_Callback";
-  webkitExitFullscreen_Callback_0_(mthis) => webkitExitFullscreen_Callback_0(mthis);
+  visibilityState_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "visibilityState");
 
-  static webkitExitFullscreen_Callback_1(mthis, __arg_0) native "Document_webkitExitFullscreen_Callback";
-  webkitExitFullscreen_Callback_1_(mthis, __arg_0) => webkitExitFullscreen_Callback_1(mthis, __arg_0);
+  webkitCancelFullScreen_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "webkitCancelFullScreen", []);
 
-  static webkitExitFullscreen_Callback_2(mthis, __arg_0, __arg_1) native "Document_webkitExitFullscreen_Callback";
-  webkitExitFullscreen_Callback_2_(mthis, __arg_0, __arg_1) => webkitExitFullscreen_Callback_2(mthis, __arg_0, __arg_1);
+  webkitExitFullscreen_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "webkitExitFullscreen", []);
 
-  static webkitFullscreenElement_Getter(mthis) native "Document_webkitFullscreenElement_Getter";
-  webkitFullscreenElement_Getter_(mthis) => webkitFullscreenElement_Getter(mthis);
+  webkitFullscreenElement_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "webkitFullscreenElement");
 
-  static webkitFullscreenEnabled_Getter(mthis) native "Document_webkitFullscreenEnabled_Getter";
-  webkitFullscreenEnabled_Getter_(mthis) => webkitFullscreenEnabled_Getter(mthis);
+  webkitFullscreenEnabled_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "webkitFullscreenEnabled");
 
-  static webkitHidden_Getter(mthis) native "Document_webkitHidden_Getter";
-  webkitHidden_Getter_(mthis) => webkitHidden_Getter(mthis);
+  webkitHidden_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "webkitHidden");
 
-  static webkitIsFullScreen_Getter(mthis) native "Document_webkitIsFullScreen_Getter";
-  webkitIsFullScreen_Getter_(mthis) => webkitIsFullScreen_Getter(mthis);
+  webkitIsFullScreen_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "webkitIsFullScreen");
 
-  static webkitVisibilityState_Getter(mthis) native "Document_webkitVisibilityState_Getter";
-  webkitVisibilityState_Getter_(mthis) => webkitVisibilityState_Getter(mthis);
+  webkitVisibilityState_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "webkitVisibilityState");
 
-  static xmlEncoding_Getter(mthis) native "Document_xmlEncoding_Getter";
-  xmlEncoding_Getter_(mthis) => xmlEncoding_Getter(mthis);
+  xmlEncoding_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "xmlEncoding");
 
 }
 
 class BlinkDocumentFragment extends BlinkNode {
   static final instance = new BlinkDocumentFragment();
 
-  static childElementCount_Getter(mthis) native "DocumentFragment_childElementCount_Getter";
-  childElementCount_Getter_(mthis) => childElementCount_Getter(mthis);
+  childElementCount_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "childElementCount");
 
-  static constructorCallback_0() native "DocumentFragment_constructorCallback";
-  constructorCallback_0_() => constructorCallback_0();
+  constructorCallback_0_() => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "DocumentFragment"), []);
 
-  static constructorCallback_1(__arg_0) native "DocumentFragment_constructorCallback";
-  constructorCallback_1_(__arg_0) => constructorCallback_1(__arg_0);
+  firstElementChild_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "firstElementChild");
 
-  static constructorCallback_2(__arg_0, __arg_1) native "DocumentFragment_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  getElementById_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getElementById", []);
 
-  static firstElementChild_Getter(mthis) native "DocumentFragment_firstElementChild_Getter";
-  firstElementChild_Getter_(mthis) => firstElementChild_Getter(mthis);
+  getElementById_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getElementById", [__arg_0]);
 
-  static getElementById_Callback_0(mthis) native "DocumentFragment_getElementById_Callback";
-  getElementById_Callback_0_(mthis) => getElementById_Callback_0(mthis);
+  lastElementChild_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "lastElementChild");
 
-  static getElementById_Callback_1(mthis, __arg_0) native "DocumentFragment_getElementById_Callback";
-  getElementById_Callback_1_(mthis, __arg_0) => getElementById_Callback_1(mthis, __arg_0);
+  querySelectorAll_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "querySelectorAll", []);
 
-  static getElementById_Callback_2(mthis, __arg_0, __arg_1) native "DocumentFragment_getElementById_Callback";
-  getElementById_Callback_2_(mthis, __arg_0, __arg_1) => getElementById_Callback_2(mthis, __arg_0, __arg_1);
+  querySelectorAll_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "querySelectorAll", [__arg_0]);
 
-  static getElementById_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "DocumentFragment_getElementById_Callback";
-  getElementById_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getElementById_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  querySelector_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "querySelector", []);
 
-  static lastElementChild_Getter(mthis) native "DocumentFragment_lastElementChild_Getter";
-  lastElementChild_Getter_(mthis) => lastElementChild_Getter(mthis);
-
-  static querySelectorAll_Callback_0(mthis) native "DocumentFragment_querySelectorAll_Callback";
-  querySelectorAll_Callback_0_(mthis) => querySelectorAll_Callback_0(mthis);
-
-  static querySelectorAll_Callback_1(mthis, __arg_0) native "DocumentFragment_querySelectorAll_Callback";
-  querySelectorAll_Callback_1_(mthis, __arg_0) => querySelectorAll_Callback_1(mthis, __arg_0);
-
-  static querySelectorAll_Callback_2(mthis, __arg_0, __arg_1) native "DocumentFragment_querySelectorAll_Callback";
-  querySelectorAll_Callback_2_(mthis, __arg_0, __arg_1) => querySelectorAll_Callback_2(mthis, __arg_0, __arg_1);
-
-  static querySelectorAll_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "DocumentFragment_querySelectorAll_Callback";
-  querySelectorAll_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => querySelectorAll_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static querySelector_Callback_0(mthis) native "DocumentFragment_querySelector_Callback";
-  querySelector_Callback_0_(mthis) => querySelector_Callback_0(mthis);
-
-  static querySelector_Callback_1(mthis, __arg_0) native "DocumentFragment_querySelector_Callback";
-  querySelector_Callback_1_(mthis, __arg_0) => querySelector_Callback_1(mthis, __arg_0);
-
-  static querySelector_Callback_2(mthis, __arg_0, __arg_1) native "DocumentFragment_querySelector_Callback";
-  querySelector_Callback_2_(mthis, __arg_0, __arg_1) => querySelector_Callback_2(mthis, __arg_0, __arg_1);
-
-  static querySelector_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "DocumentFragment_querySelector_Callback";
-  querySelector_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => querySelector_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  querySelector_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "querySelector", [__arg_0]);
 
 }
 
@@ -6979,23 +3922,17 @@
 class BlinkDynamicsCompressorNode extends BlinkAudioNode {
   static final instance = new BlinkDynamicsCompressorNode();
 
-  static attack_Getter(mthis) native "DynamicsCompressorNode_attack_Getter";
-  attack_Getter_(mthis) => attack_Getter(mthis);
+  attack_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "attack");
 
-  static knee_Getter(mthis) native "DynamicsCompressorNode_knee_Getter";
-  knee_Getter_(mthis) => knee_Getter(mthis);
+  knee_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "knee");
 
-  static ratio_Getter(mthis) native "DynamicsCompressorNode_ratio_Getter";
-  ratio_Getter_(mthis) => ratio_Getter(mthis);
+  ratio_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ratio");
 
-  static reduction_Getter(mthis) native "DynamicsCompressorNode_reduction_Getter";
-  reduction_Getter_(mthis) => reduction_Getter(mthis);
+  reduction_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "reduction");
 
-  static release_Getter(mthis) native "DynamicsCompressorNode_release_Getter";
-  release_Getter_(mthis) => release_Getter(mthis);
+  release_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "release");
 
-  static threshold_Getter(mthis) native "DynamicsCompressorNode_threshold_Getter";
-  threshold_Getter_(mthis) => threshold_Getter(mthis);
+  threshold_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "threshold");
 
 }
 
@@ -7022,2248 +3959,1154 @@
 class BlinkElement extends BlinkNode {
   static final instance = new BlinkElement();
 
-  static animate_Callback_0(mthis) native "Element_animate_Callback";
-  animate_Callback_0_(mthis) => animate_Callback_0(mthis);
+  animate_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "animate", []);
 
-  static animate_Callback_1(mthis, __arg_0) native "Element_animate_Callback";
-  animate_Callback_1_(mthis, __arg_0) => animate_Callback_1(mthis, __arg_0);
+  animate_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "animate", [__arg_0]);
 
-  static animate_Callback_2(mthis, __arg_0, __arg_1) native "Element_animate_Callback";
-  animate_Callback_2_(mthis, __arg_0, __arg_1) => animate_Callback_2(mthis, __arg_0, __arg_1);
+  animate_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "animate", [__arg_0, __arg_1]);
 
-  static animate_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Element_animate_Callback";
-  animate_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => animate_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  attributes_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "attributes");
 
-  static animate_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Element_animate_Callback";
-  animate_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => animate_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  blur_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "blur", []);
 
-  static attributes_Getter(mthis) native "Element_attributes_Getter";
-  attributes_Getter_(mthis) => attributes_Getter(mthis);
+  childElementCount_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "childElementCount");
 
-  static blur_Callback_0(mthis) native "Element_blur_Callback";
-  blur_Callback_0_(mthis) => blur_Callback_0(mthis);
+  children_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "children");
 
-  static blur_Callback_1(mthis, __arg_0) native "Element_blur_Callback";
-  blur_Callback_1_(mthis, __arg_0) => blur_Callback_1(mthis, __arg_0);
+  classList_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "classList");
 
-  static blur_Callback_2(mthis, __arg_0, __arg_1) native "Element_blur_Callback";
-  blur_Callback_2_(mthis, __arg_0, __arg_1) => blur_Callback_2(mthis, __arg_0, __arg_1);
+  className_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "className");
 
-  static childElementCount_Getter(mthis) native "Element_childElementCount_Getter";
-  childElementCount_Getter_(mthis) => childElementCount_Getter(mthis);
+  className_Setter_(mthis, __arg_0) => mthis["className"] = __arg_0;
 
-  static children_Getter(mthis) native "Element_children_Getter";
-  children_Getter_(mthis) => children_Getter(mthis);
+  clientHeight_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "clientHeight");
 
-  static classList_Getter(mthis) native "Element_classList_Getter";
-  classList_Getter_(mthis) => classList_Getter(mthis);
+  clientLeft_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "clientLeft");
 
-  static className_Getter(mthis) native "Element_className_Getter";
-  className_Getter_(mthis) => className_Getter(mthis);
+  clientTop_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "clientTop");
 
-  static className_Setter(mthis, __arg_0) native "Element_className_Setter";
-  className_Setter_(mthis, __arg_0) => className_Setter(mthis, __arg_0);
+  clientWidth_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "clientWidth");
 
-  static clientHeight_Getter(mthis) native "Element_clientHeight_Getter";
-  clientHeight_Getter_(mthis) => clientHeight_Getter(mthis);
+  createShadowRoot_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createShadowRoot", []);
 
-  static clientLeft_Getter(mthis) native "Element_clientLeft_Getter";
-  clientLeft_Getter_(mthis) => clientLeft_Getter(mthis);
+  firstElementChild_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "firstElementChild");
 
-  static clientTop_Getter(mthis) native "Element_clientTop_Getter";
-  clientTop_Getter_(mthis) => clientTop_Getter(mthis);
+  focus_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "focus", []);
 
-  static clientWidth_Getter(mthis) native "Element_clientWidth_Getter";
-  clientWidth_Getter_(mthis) => clientWidth_Getter(mthis);
+  getAnimationPlayers_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getAnimationPlayers", []);
 
-  static createShadowRoot_Callback_0(mthis) native "Element_createShadowRoot_Callback";
-  createShadowRoot_Callback_0_(mthis) => createShadowRoot_Callback_0(mthis);
+  getAttributeNS_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getAttributeNS", []);
 
-  static createShadowRoot_Callback_1(mthis, __arg_0) native "Element_createShadowRoot_Callback";
-  createShadowRoot_Callback_1_(mthis, __arg_0) => createShadowRoot_Callback_1(mthis, __arg_0);
+  getAttributeNS_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getAttributeNS", [__arg_0]);
 
-  static createShadowRoot_Callback_2(mthis, __arg_0, __arg_1) native "Element_createShadowRoot_Callback";
-  createShadowRoot_Callback_2_(mthis, __arg_0, __arg_1) => createShadowRoot_Callback_2(mthis, __arg_0, __arg_1);
+  getAttributeNS_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "getAttributeNS", [__arg_0, __arg_1]);
 
-  static firstElementChild_Getter(mthis) native "Element_firstElementChild_Getter";
-  firstElementChild_Getter_(mthis) => firstElementChild_Getter(mthis);
+  getAttribute_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getAttribute", []);
 
-  static focus_Callback_0(mthis) native "Element_focus_Callback";
-  focus_Callback_0_(mthis) => focus_Callback_0(mthis);
+  getAttribute_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getAttribute", [__arg_0]);
 
-  static focus_Callback_1(mthis, __arg_0) native "Element_focus_Callback";
-  focus_Callback_1_(mthis, __arg_0) => focus_Callback_1(mthis, __arg_0);
+  getBoundingClientRect_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getBoundingClientRect", []);
 
-  static focus_Callback_2(mthis, __arg_0, __arg_1) native "Element_focus_Callback";
-  focus_Callback_2_(mthis, __arg_0, __arg_1) => focus_Callback_2(mthis, __arg_0, __arg_1);
+  getClientRects_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getClientRects", []);
 
-  static getAnimationPlayers_Callback_0(mthis) native "Element_getAnimationPlayers_Callback";
-  getAnimationPlayers_Callback_0_(mthis) => getAnimationPlayers_Callback_0(mthis);
+  getDestinationInsertionPoints_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getDestinationInsertionPoints", []);
 
-  static getAnimationPlayers_Callback_1(mthis, __arg_0) native "Element_getAnimationPlayers_Callback";
-  getAnimationPlayers_Callback_1_(mthis, __arg_0) => getAnimationPlayers_Callback_1(mthis, __arg_0);
+  getElementsByClassName_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getElementsByClassName", []);
 
-  static getAnimationPlayers_Callback_2(mthis, __arg_0, __arg_1) native "Element_getAnimationPlayers_Callback";
-  getAnimationPlayers_Callback_2_(mthis, __arg_0, __arg_1) => getAnimationPlayers_Callback_2(mthis, __arg_0, __arg_1);
+  getElementsByClassName_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getElementsByClassName", [__arg_0]);
 
-  static getAttributeNS_Callback_0(mthis) native "Element_getAttributeNS_Callback";
-  getAttributeNS_Callback_0_(mthis) => getAttributeNS_Callback_0(mthis);
+  getElementsByTagName_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getElementsByTagName", []);
 
-  static getAttributeNS_Callback_1(mthis, __arg_0) native "Element_getAttributeNS_Callback";
-  getAttributeNS_Callback_1_(mthis, __arg_0) => getAttributeNS_Callback_1(mthis, __arg_0);
+  getElementsByTagName_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getElementsByTagName", [__arg_0]);
 
-  static getAttributeNS_Callback_2(mthis, __arg_0, __arg_1) native "Element_getAttributeNS_Callback";
-  getAttributeNS_Callback_2_(mthis, __arg_0, __arg_1) => getAttributeNS_Callback_2(mthis, __arg_0, __arg_1);
+  hasAttributeNS_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "hasAttributeNS", []);
 
-  static getAttributeNS_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Element_getAttributeNS_Callback";
-  getAttributeNS_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getAttributeNS_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  hasAttributeNS_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "hasAttributeNS", [__arg_0]);
 
-  static getAttributeNS_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Element_getAttributeNS_Callback";
-  getAttributeNS_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => getAttributeNS_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  hasAttributeNS_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "hasAttributeNS", [__arg_0, __arg_1]);
 
-  static getAttribute_Callback_0(mthis) native "Element_getAttribute_Callback";
-  getAttribute_Callback_0_(mthis) => getAttribute_Callback_0(mthis);
+  hasAttribute_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "hasAttribute", []);
 
-  static getAttribute_Callback_1(mthis, __arg_0) native "Element_getAttribute_Callback";
-  getAttribute_Callback_1_(mthis, __arg_0) => getAttribute_Callback_1(mthis, __arg_0);
+  hasAttribute_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "hasAttribute", [__arg_0]);
 
-  static getAttribute_Callback_2(mthis, __arg_0, __arg_1) native "Element_getAttribute_Callback";
-  getAttribute_Callback_2_(mthis, __arg_0, __arg_1) => getAttribute_Callback_2(mthis, __arg_0, __arg_1);
+  hasAttributes_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "hasAttributes", []);
 
-  static getAttribute_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Element_getAttribute_Callback";
-  getAttribute_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getAttribute_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  id_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "id");
 
-  static getBoundingClientRect_Callback_0(mthis) native "Element_getBoundingClientRect_Callback";
-  getBoundingClientRect_Callback_0_(mthis) => getBoundingClientRect_Callback_0(mthis);
+  id_Setter_(mthis, __arg_0) => mthis["id"] = __arg_0;
 
-  static getBoundingClientRect_Callback_1(mthis, __arg_0) native "Element_getBoundingClientRect_Callback";
-  getBoundingClientRect_Callback_1_(mthis, __arg_0) => getBoundingClientRect_Callback_1(mthis, __arg_0);
+  innerHTML_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "innerHTML");
 
-  static getBoundingClientRect_Callback_2(mthis, __arg_0, __arg_1) native "Element_getBoundingClientRect_Callback";
-  getBoundingClientRect_Callback_2_(mthis, __arg_0, __arg_1) => getBoundingClientRect_Callback_2(mthis, __arg_0, __arg_1);
+  innerHTML_Setter_(mthis, __arg_0) => mthis["innerHTML"] = __arg_0;
 
-  static getClientRects_Callback_0(mthis) native "Element_getClientRects_Callback";
-  getClientRects_Callback_0_(mthis) => getClientRects_Callback_0(mthis);
+  insertAdjacentElement_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "insertAdjacentElement", []);
 
-  static getClientRects_Callback_1(mthis, __arg_0) native "Element_getClientRects_Callback";
-  getClientRects_Callback_1_(mthis, __arg_0) => getClientRects_Callback_1(mthis, __arg_0);
+  insertAdjacentElement_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "insertAdjacentElement", [__arg_0]);
 
-  static getClientRects_Callback_2(mthis, __arg_0, __arg_1) native "Element_getClientRects_Callback";
-  getClientRects_Callback_2_(mthis, __arg_0, __arg_1) => getClientRects_Callback_2(mthis, __arg_0, __arg_1);
+  insertAdjacentElement_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "insertAdjacentElement", [__arg_0, __arg_1]);
 
-  static getDestinationInsertionPoints_Callback_0(mthis) native "Element_getDestinationInsertionPoints_Callback";
-  getDestinationInsertionPoints_Callback_0_(mthis) => getDestinationInsertionPoints_Callback_0(mthis);
+  insertAdjacentHTML_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "insertAdjacentHTML", []);
 
-  static getDestinationInsertionPoints_Callback_1(mthis, __arg_0) native "Element_getDestinationInsertionPoints_Callback";
-  getDestinationInsertionPoints_Callback_1_(mthis, __arg_0) => getDestinationInsertionPoints_Callback_1(mthis, __arg_0);
+  insertAdjacentHTML_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "insertAdjacentHTML", [__arg_0]);
 
-  static getDestinationInsertionPoints_Callback_2(mthis, __arg_0, __arg_1) native "Element_getDestinationInsertionPoints_Callback";
-  getDestinationInsertionPoints_Callback_2_(mthis, __arg_0, __arg_1) => getDestinationInsertionPoints_Callback_2(mthis, __arg_0, __arg_1);
+  insertAdjacentHTML_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "insertAdjacentHTML", [__arg_0, __arg_1]);
 
-  static getElementsByClassName_Callback_0(mthis) native "Element_getElementsByClassName_Callback";
-  getElementsByClassName_Callback_0_(mthis) => getElementsByClassName_Callback_0(mthis);
+  insertAdjacentText_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "insertAdjacentText", []);
 
-  static getElementsByClassName_Callback_1(mthis, __arg_0) native "Element_getElementsByClassName_Callback";
-  getElementsByClassName_Callback_1_(mthis, __arg_0) => getElementsByClassName_Callback_1(mthis, __arg_0);
+  insertAdjacentText_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "insertAdjacentText", [__arg_0]);
 
-  static getElementsByClassName_Callback_2(mthis, __arg_0, __arg_1) native "Element_getElementsByClassName_Callback";
-  getElementsByClassName_Callback_2_(mthis, __arg_0, __arg_1) => getElementsByClassName_Callback_2(mthis, __arg_0, __arg_1);
+  insertAdjacentText_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "insertAdjacentText", [__arg_0, __arg_1]);
 
-  static getElementsByClassName_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Element_getElementsByClassName_Callback";
-  getElementsByClassName_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getElementsByClassName_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  lastElementChild_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "lastElementChild");
 
-  static getElementsByTagName_Callback_0(mthis) native "Element_getElementsByTagName_Callback";
-  getElementsByTagName_Callback_0_(mthis) => getElementsByTagName_Callback_0(mthis);
+  localName_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "localName");
 
-  static getElementsByTagName_Callback_1(mthis, __arg_0) native "Element_getElementsByTagName_Callback";
-  getElementsByTagName_Callback_1_(mthis, __arg_0) => getElementsByTagName_Callback_1(mthis, __arg_0);
+  matches_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "matches", []);
 
-  static getElementsByTagName_Callback_2(mthis, __arg_0, __arg_1) native "Element_getElementsByTagName_Callback";
-  getElementsByTagName_Callback_2_(mthis, __arg_0, __arg_1) => getElementsByTagName_Callback_2(mthis, __arg_0, __arg_1);
+  matches_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "matches", [__arg_0]);
 
-  static getElementsByTagName_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Element_getElementsByTagName_Callback";
-  getElementsByTagName_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getElementsByTagName_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  namespaceURI_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "namespaceURI");
 
-  static hasAttributeNS_Callback_0(mthis) native "Element_hasAttributeNS_Callback";
-  hasAttributeNS_Callback_0_(mthis) => hasAttributeNS_Callback_0(mthis);
+  nextElementSibling_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "nextElementSibling");
 
-  static hasAttributeNS_Callback_1(mthis, __arg_0) native "Element_hasAttributeNS_Callback";
-  hasAttributeNS_Callback_1_(mthis, __arg_0) => hasAttributeNS_Callback_1(mthis, __arg_0);
+  offsetHeight_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "offsetHeight");
 
-  static hasAttributeNS_Callback_2(mthis, __arg_0, __arg_1) native "Element_hasAttributeNS_Callback";
-  hasAttributeNS_Callback_2_(mthis, __arg_0, __arg_1) => hasAttributeNS_Callback_2(mthis, __arg_0, __arg_1);
+  offsetLeft_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "offsetLeft");
 
-  static hasAttributeNS_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Element_hasAttributeNS_Callback";
-  hasAttributeNS_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => hasAttributeNS_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  offsetParent_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "offsetParent");
 
-  static hasAttributeNS_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Element_hasAttributeNS_Callback";
-  hasAttributeNS_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => hasAttributeNS_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  offsetTop_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "offsetTop");
 
-  static hasAttribute_Callback_0(mthis) native "Element_hasAttribute_Callback";
-  hasAttribute_Callback_0_(mthis) => hasAttribute_Callback_0(mthis);
+  offsetWidth_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "offsetWidth");
 
-  static hasAttribute_Callback_1(mthis, __arg_0) native "Element_hasAttribute_Callback";
-  hasAttribute_Callback_1_(mthis, __arg_0) => hasAttribute_Callback_1(mthis, __arg_0);
+  onbeforecopy_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onbeforecopy");
 
-  static hasAttribute_Callback_2(mthis, __arg_0, __arg_1) native "Element_hasAttribute_Callback";
-  hasAttribute_Callback_2_(mthis, __arg_0, __arg_1) => hasAttribute_Callback_2(mthis, __arg_0, __arg_1);
+  onbeforecopy_Setter_(mthis, __arg_0) => mthis["onbeforecopy"] = __arg_0;
 
-  static hasAttribute_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Element_hasAttribute_Callback";
-  hasAttribute_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => hasAttribute_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  onbeforecut_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onbeforecut");
 
-  static hasAttributes_Callback_0(mthis) native "Element_hasAttributes_Callback";
-  hasAttributes_Callback_0_(mthis) => hasAttributes_Callback_0(mthis);
+  onbeforecut_Setter_(mthis, __arg_0) => mthis["onbeforecut"] = __arg_0;
 
-  static hasAttributes_Callback_1(mthis, __arg_0) native "Element_hasAttributes_Callback";
-  hasAttributes_Callback_1_(mthis, __arg_0) => hasAttributes_Callback_1(mthis, __arg_0);
+  onbeforepaste_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onbeforepaste");
 
-  static hasAttributes_Callback_2(mthis, __arg_0, __arg_1) native "Element_hasAttributes_Callback";
-  hasAttributes_Callback_2_(mthis, __arg_0, __arg_1) => hasAttributes_Callback_2(mthis, __arg_0, __arg_1);
+  onbeforepaste_Setter_(mthis, __arg_0) => mthis["onbeforepaste"] = __arg_0;
 
-  static id_Getter(mthis) native "Element_id_Getter";
-  id_Getter_(mthis) => id_Getter(mthis);
+  oncopy_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "oncopy");
 
-  static id_Setter(mthis, __arg_0) native "Element_id_Setter";
-  id_Setter_(mthis, __arg_0) => id_Setter(mthis, __arg_0);
+  oncopy_Setter_(mthis, __arg_0) => mthis["oncopy"] = __arg_0;
 
-  static innerHTML_Getter(mthis) native "Element_innerHTML_Getter";
-  innerHTML_Getter_(mthis) => innerHTML_Getter(mthis);
+  oncut_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "oncut");
 
-  static innerHTML_Setter(mthis, __arg_0) native "Element_innerHTML_Setter";
-  innerHTML_Setter_(mthis, __arg_0) => innerHTML_Setter(mthis, __arg_0);
+  oncut_Setter_(mthis, __arg_0) => mthis["oncut"] = __arg_0;
 
-  static insertAdjacentElement_Callback_0(mthis) native "Element_insertAdjacentElement_Callback";
-  insertAdjacentElement_Callback_0_(mthis) => insertAdjacentElement_Callback_0(mthis);
+  onpaste_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onpaste");
 
-  static insertAdjacentElement_Callback_1(mthis, __arg_0) native "Element_insertAdjacentElement_Callback";
-  insertAdjacentElement_Callback_1_(mthis, __arg_0) => insertAdjacentElement_Callback_1(mthis, __arg_0);
+  onpaste_Setter_(mthis, __arg_0) => mthis["onpaste"] = __arg_0;
 
-  static insertAdjacentElement_Callback_2(mthis, __arg_0, __arg_1) native "Element_insertAdjacentElement_Callback";
-  insertAdjacentElement_Callback_2_(mthis, __arg_0, __arg_1) => insertAdjacentElement_Callback_2(mthis, __arg_0, __arg_1);
+  onsearch_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onsearch");
 
-  static insertAdjacentElement_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Element_insertAdjacentElement_Callback";
-  insertAdjacentElement_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => insertAdjacentElement_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  onsearch_Setter_(mthis, __arg_0) => mthis["onsearch"] = __arg_0;
 
-  static insertAdjacentElement_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Element_insertAdjacentElement_Callback";
-  insertAdjacentElement_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => insertAdjacentElement_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  onselectstart_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onselectstart");
 
-  static insertAdjacentHTML_Callback_0(mthis) native "Element_insertAdjacentHTML_Callback";
-  insertAdjacentHTML_Callback_0_(mthis) => insertAdjacentHTML_Callback_0(mthis);
+  onselectstart_Setter_(mthis, __arg_0) => mthis["onselectstart"] = __arg_0;
 
-  static insertAdjacentHTML_Callback_1(mthis, __arg_0) native "Element_insertAdjacentHTML_Callback";
-  insertAdjacentHTML_Callback_1_(mthis, __arg_0) => insertAdjacentHTML_Callback_1(mthis, __arg_0);
+  ontouchcancel_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ontouchcancel");
 
-  static insertAdjacentHTML_Callback_2(mthis, __arg_0, __arg_1) native "Element_insertAdjacentHTML_Callback";
-  insertAdjacentHTML_Callback_2_(mthis, __arg_0, __arg_1) => insertAdjacentHTML_Callback_2(mthis, __arg_0, __arg_1);
+  ontouchcancel_Setter_(mthis, __arg_0) => mthis["ontouchcancel"] = __arg_0;
 
-  static insertAdjacentHTML_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Element_insertAdjacentHTML_Callback";
-  insertAdjacentHTML_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => insertAdjacentHTML_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  ontouchend_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ontouchend");
 
-  static insertAdjacentHTML_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Element_insertAdjacentHTML_Callback";
-  insertAdjacentHTML_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => insertAdjacentHTML_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  ontouchend_Setter_(mthis, __arg_0) => mthis["ontouchend"] = __arg_0;
 
-  static insertAdjacentText_Callback_0(mthis) native "Element_insertAdjacentText_Callback";
-  insertAdjacentText_Callback_0_(mthis) => insertAdjacentText_Callback_0(mthis);
+  ontouchmove_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ontouchmove");
 
-  static insertAdjacentText_Callback_1(mthis, __arg_0) native "Element_insertAdjacentText_Callback";
-  insertAdjacentText_Callback_1_(mthis, __arg_0) => insertAdjacentText_Callback_1(mthis, __arg_0);
+  ontouchmove_Setter_(mthis, __arg_0) => mthis["ontouchmove"] = __arg_0;
 
-  static insertAdjacentText_Callback_2(mthis, __arg_0, __arg_1) native "Element_insertAdjacentText_Callback";
-  insertAdjacentText_Callback_2_(mthis, __arg_0, __arg_1) => insertAdjacentText_Callback_2(mthis, __arg_0, __arg_1);
+  ontouchstart_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ontouchstart");
 
-  static insertAdjacentText_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Element_insertAdjacentText_Callback";
-  insertAdjacentText_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => insertAdjacentText_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  ontouchstart_Setter_(mthis, __arg_0) => mthis["ontouchstart"] = __arg_0;
 
-  static insertAdjacentText_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Element_insertAdjacentText_Callback";
-  insertAdjacentText_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => insertAdjacentText_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  onwebkitfullscreenchange_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onwebkitfullscreenchange");
 
-  static lastElementChild_Getter(mthis) native "Element_lastElementChild_Getter";
-  lastElementChild_Getter_(mthis) => lastElementChild_Getter(mthis);
+  onwebkitfullscreenchange_Setter_(mthis, __arg_0) => mthis["onwebkitfullscreenchange"] = __arg_0;
 
-  static localName_Getter(mthis) native "Element_localName_Getter";
-  localName_Getter_(mthis) => localName_Getter(mthis);
+  onwebkitfullscreenerror_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onwebkitfullscreenerror");
 
-  static matches_Callback_0(mthis) native "Element_matches_Callback";
-  matches_Callback_0_(mthis) => matches_Callback_0(mthis);
+  onwebkitfullscreenerror_Setter_(mthis, __arg_0) => mthis["onwebkitfullscreenerror"] = __arg_0;
 
-  static matches_Callback_1(mthis, __arg_0) native "Element_matches_Callback";
-  matches_Callback_1_(mthis, __arg_0) => matches_Callback_1(mthis, __arg_0);
+  onwheel_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onwheel");
 
-  static matches_Callback_2(mthis, __arg_0, __arg_1) native "Element_matches_Callback";
-  matches_Callback_2_(mthis, __arg_0, __arg_1) => matches_Callback_2(mthis, __arg_0, __arg_1);
+  onwheel_Setter_(mthis, __arg_0) => mthis["onwheel"] = __arg_0;
 
-  static matches_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Element_matches_Callback";
-  matches_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => matches_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  outerHTML_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "outerHTML");
 
-  static namespaceURI_Getter(mthis) native "Element_namespaceURI_Getter";
-  namespaceURI_Getter_(mthis) => namespaceURI_Getter(mthis);
+  outerHTML_Setter_(mthis, __arg_0) => mthis["outerHTML"] = __arg_0;
 
-  static nextElementSibling_Getter(mthis) native "Element_nextElementSibling_Getter";
-  nextElementSibling_Getter_(mthis) => nextElementSibling_Getter(mthis);
+  prefix_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "prefix");
 
-  static offsetHeight_Getter(mthis) native "Element_offsetHeight_Getter";
-  offsetHeight_Getter_(mthis) => offsetHeight_Getter(mthis);
+  prefix_Setter_(mthis, __arg_0) => mthis["prefix"] = __arg_0;
 
-  static offsetLeft_Getter(mthis) native "Element_offsetLeft_Getter";
-  offsetLeft_Getter_(mthis) => offsetLeft_Getter(mthis);
+  previousElementSibling_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "previousElementSibling");
 
-  static offsetParent_Getter(mthis) native "Element_offsetParent_Getter";
-  offsetParent_Getter_(mthis) => offsetParent_Getter(mthis);
+  querySelectorAll_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "querySelectorAll", []);
 
-  static offsetTop_Getter(mthis) native "Element_offsetTop_Getter";
-  offsetTop_Getter_(mthis) => offsetTop_Getter(mthis);
-
-  static offsetWidth_Getter(mthis) native "Element_offsetWidth_Getter";
-  offsetWidth_Getter_(mthis) => offsetWidth_Getter(mthis);
-
-  static onbeforecopy_Getter(mthis) native "Element_onbeforecopy_Getter";
-  onbeforecopy_Getter_(mthis) => onbeforecopy_Getter(mthis);
-
-  static onbeforecopy_Setter(mthis, __arg_0) native "Element_onbeforecopy_Setter";
-  onbeforecopy_Setter_(mthis, __arg_0) => onbeforecopy_Setter(mthis, __arg_0);
-
-  static onbeforecut_Getter(mthis) native "Element_onbeforecut_Getter";
-  onbeforecut_Getter_(mthis) => onbeforecut_Getter(mthis);
-
-  static onbeforecut_Setter(mthis, __arg_0) native "Element_onbeforecut_Setter";
-  onbeforecut_Setter_(mthis, __arg_0) => onbeforecut_Setter(mthis, __arg_0);
-
-  static onbeforepaste_Getter(mthis) native "Element_onbeforepaste_Getter";
-  onbeforepaste_Getter_(mthis) => onbeforepaste_Getter(mthis);
-
-  static onbeforepaste_Setter(mthis, __arg_0) native "Element_onbeforepaste_Setter";
-  onbeforepaste_Setter_(mthis, __arg_0) => onbeforepaste_Setter(mthis, __arg_0);
-
-  static oncopy_Getter(mthis) native "Element_oncopy_Getter";
-  oncopy_Getter_(mthis) => oncopy_Getter(mthis);
-
-  static oncopy_Setter(mthis, __arg_0) native "Element_oncopy_Setter";
-  oncopy_Setter_(mthis, __arg_0) => oncopy_Setter(mthis, __arg_0);
-
-  static oncut_Getter(mthis) native "Element_oncut_Getter";
-  oncut_Getter_(mthis) => oncut_Getter(mthis);
-
-  static oncut_Setter(mthis, __arg_0) native "Element_oncut_Setter";
-  oncut_Setter_(mthis, __arg_0) => oncut_Setter(mthis, __arg_0);
-
-  static onpaste_Getter(mthis) native "Element_onpaste_Getter";
-  onpaste_Getter_(mthis) => onpaste_Getter(mthis);
-
-  static onpaste_Setter(mthis, __arg_0) native "Element_onpaste_Setter";
-  onpaste_Setter_(mthis, __arg_0) => onpaste_Setter(mthis, __arg_0);
-
-  static onsearch_Getter(mthis) native "Element_onsearch_Getter";
-  onsearch_Getter_(mthis) => onsearch_Getter(mthis);
-
-  static onsearch_Setter(mthis, __arg_0) native "Element_onsearch_Setter";
-  onsearch_Setter_(mthis, __arg_0) => onsearch_Setter(mthis, __arg_0);
-
-  static onselectstart_Getter(mthis) native "Element_onselectstart_Getter";
-  onselectstart_Getter_(mthis) => onselectstart_Getter(mthis);
-
-  static onselectstart_Setter(mthis, __arg_0) native "Element_onselectstart_Setter";
-  onselectstart_Setter_(mthis, __arg_0) => onselectstart_Setter(mthis, __arg_0);
-
-  static ontouchcancel_Getter(mthis) native "Element_ontouchcancel_Getter";
-  ontouchcancel_Getter_(mthis) => ontouchcancel_Getter(mthis);
-
-  static ontouchcancel_Setter(mthis, __arg_0) native "Element_ontouchcancel_Setter";
-  ontouchcancel_Setter_(mthis, __arg_0) => ontouchcancel_Setter(mthis, __arg_0);
-
-  static ontouchend_Getter(mthis) native "Element_ontouchend_Getter";
-  ontouchend_Getter_(mthis) => ontouchend_Getter(mthis);
-
-  static ontouchend_Setter(mthis, __arg_0) native "Element_ontouchend_Setter";
-  ontouchend_Setter_(mthis, __arg_0) => ontouchend_Setter(mthis, __arg_0);
-
-  static ontouchmove_Getter(mthis) native "Element_ontouchmove_Getter";
-  ontouchmove_Getter_(mthis) => ontouchmove_Getter(mthis);
-
-  static ontouchmove_Setter(mthis, __arg_0) native "Element_ontouchmove_Setter";
-  ontouchmove_Setter_(mthis, __arg_0) => ontouchmove_Setter(mthis, __arg_0);
-
-  static ontouchstart_Getter(mthis) native "Element_ontouchstart_Getter";
-  ontouchstart_Getter_(mthis) => ontouchstart_Getter(mthis);
-
-  static ontouchstart_Setter(mthis, __arg_0) native "Element_ontouchstart_Setter";
-  ontouchstart_Setter_(mthis, __arg_0) => ontouchstart_Setter(mthis, __arg_0);
-
-  static onwebkitfullscreenchange_Getter(mthis) native "Element_onwebkitfullscreenchange_Getter";
-  onwebkitfullscreenchange_Getter_(mthis) => onwebkitfullscreenchange_Getter(mthis);
-
-  static onwebkitfullscreenchange_Setter(mthis, __arg_0) native "Element_onwebkitfullscreenchange_Setter";
-  onwebkitfullscreenchange_Setter_(mthis, __arg_0) => onwebkitfullscreenchange_Setter(mthis, __arg_0);
-
-  static onwebkitfullscreenerror_Getter(mthis) native "Element_onwebkitfullscreenerror_Getter";
-  onwebkitfullscreenerror_Getter_(mthis) => onwebkitfullscreenerror_Getter(mthis);
-
-  static onwebkitfullscreenerror_Setter(mthis, __arg_0) native "Element_onwebkitfullscreenerror_Setter";
-  onwebkitfullscreenerror_Setter_(mthis, __arg_0) => onwebkitfullscreenerror_Setter(mthis, __arg_0);
-
-  static onwheel_Getter(mthis) native "Element_onwheel_Getter";
-  onwheel_Getter_(mthis) => onwheel_Getter(mthis);
-
-  static onwheel_Setter(mthis, __arg_0) native "Element_onwheel_Setter";
-  onwheel_Setter_(mthis, __arg_0) => onwheel_Setter(mthis, __arg_0);
-
-  static outerHTML_Getter(mthis) native "Element_outerHTML_Getter";
-  outerHTML_Getter_(mthis) => outerHTML_Getter(mthis);
-
-  static outerHTML_Setter(mthis, __arg_0) native "Element_outerHTML_Setter";
-  outerHTML_Setter_(mthis, __arg_0) => outerHTML_Setter(mthis, __arg_0);
-
-  static prefix_Getter(mthis) native "Element_prefix_Getter";
-  prefix_Getter_(mthis) => prefix_Getter(mthis);
-
-  static prefix_Setter(mthis, __arg_0) native "Element_prefix_Setter";
-  prefix_Setter_(mthis, __arg_0) => prefix_Setter(mthis, __arg_0);
-
-  static previousElementSibling_Getter(mthis) native "Element_previousElementSibling_Getter";
-  previousElementSibling_Getter_(mthis) => previousElementSibling_Getter(mthis);
-
-  static querySelectorAll_Callback_0(mthis) native "Element_querySelectorAll_Callback";
-  querySelectorAll_Callback_0_(mthis) => querySelectorAll_Callback_0(mthis);
-
-  static querySelectorAll_Callback_1(mthis, __arg_0) native "Element_querySelectorAll_Callback";
-  querySelectorAll_Callback_1_(mthis, __arg_0) => querySelectorAll_Callback_1(mthis, __arg_0);
-
-  static querySelectorAll_Callback_2(mthis, __arg_0, __arg_1) native "Element_querySelectorAll_Callback";
-  querySelectorAll_Callback_2_(mthis, __arg_0, __arg_1) => querySelectorAll_Callback_2(mthis, __arg_0, __arg_1);
-
-  static querySelectorAll_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Element_querySelectorAll_Callback";
-  querySelectorAll_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => querySelectorAll_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static querySelector_Callback_0(mthis) native "Element_querySelector_Callback";
-  querySelector_Callback_0_(mthis) => querySelector_Callback_0(mthis);
-
-  static querySelector_Callback_1(mthis, __arg_0) native "Element_querySelector_Callback";
-  querySelector_Callback_1_(mthis, __arg_0) => querySelector_Callback_1(mthis, __arg_0);
-
-  static querySelector_Callback_2(mthis, __arg_0, __arg_1) native "Element_querySelector_Callback";
-  querySelector_Callback_2_(mthis, __arg_0, __arg_1) => querySelector_Callback_2(mthis, __arg_0, __arg_1);
-
-  static querySelector_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Element_querySelector_Callback";
-  querySelector_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => querySelector_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static removeAttributeNS_Callback_0(mthis) native "Element_removeAttributeNS_Callback";
-  removeAttributeNS_Callback_0_(mthis) => removeAttributeNS_Callback_0(mthis);
-
-  static removeAttributeNS_Callback_1(mthis, __arg_0) native "Element_removeAttributeNS_Callback";
-  removeAttributeNS_Callback_1_(mthis, __arg_0) => removeAttributeNS_Callback_1(mthis, __arg_0);
-
-  static removeAttributeNS_Callback_2(mthis, __arg_0, __arg_1) native "Element_removeAttributeNS_Callback";
-  removeAttributeNS_Callback_2_(mthis, __arg_0, __arg_1) => removeAttributeNS_Callback_2(mthis, __arg_0, __arg_1);
-
-  static removeAttributeNS_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Element_removeAttributeNS_Callback";
-  removeAttributeNS_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => removeAttributeNS_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static removeAttributeNS_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Element_removeAttributeNS_Callback";
-  removeAttributeNS_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => removeAttributeNS_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static removeAttribute_Callback_0(mthis) native "Element_removeAttribute_Callback";
-  removeAttribute_Callback_0_(mthis) => removeAttribute_Callback_0(mthis);
-
-  static removeAttribute_Callback_1(mthis, __arg_0) native "Element_removeAttribute_Callback";
-  removeAttribute_Callback_1_(mthis, __arg_0) => removeAttribute_Callback_1(mthis, __arg_0);
-
-  static removeAttribute_Callback_2(mthis, __arg_0, __arg_1) native "Element_removeAttribute_Callback";
-  removeAttribute_Callback_2_(mthis, __arg_0, __arg_1) => removeAttribute_Callback_2(mthis, __arg_0, __arg_1);
-
-  static removeAttribute_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Element_removeAttribute_Callback";
-  removeAttribute_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => removeAttribute_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static remove_Callback_0(mthis) native "Element_remove_Callback";
-  remove_Callback_0_(mthis) => remove_Callback_0(mthis);
-
-  static remove_Callback_1(mthis, __arg_0) native "Element_remove_Callback";
-  remove_Callback_1_(mthis, __arg_0) => remove_Callback_1(mthis, __arg_0);
-
-  static remove_Callback_2(mthis, __arg_0, __arg_1) native "Element_remove_Callback";
-  remove_Callback_2_(mthis, __arg_0, __arg_1) => remove_Callback_2(mthis, __arg_0, __arg_1);
-
-  static requestFullscreen_Callback_0(mthis) native "Element_requestFullscreen_Callback";
-  requestFullscreen_Callback_0_(mthis) => requestFullscreen_Callback_0(mthis);
-
-  static requestFullscreen_Callback_1(mthis, __arg_0) native "Element_requestFullscreen_Callback";
-  requestFullscreen_Callback_1_(mthis, __arg_0) => requestFullscreen_Callback_1(mthis, __arg_0);
-
-  static requestFullscreen_Callback_2(mthis, __arg_0, __arg_1) native "Element_requestFullscreen_Callback";
-  requestFullscreen_Callback_2_(mthis, __arg_0, __arg_1) => requestFullscreen_Callback_2(mthis, __arg_0, __arg_1);
-
-  static requestPointerLock_Callback_0(mthis) native "Element_requestPointerLock_Callback";
-  requestPointerLock_Callback_0_(mthis) => requestPointerLock_Callback_0(mthis);
-
-  static requestPointerLock_Callback_1(mthis, __arg_0) native "Element_requestPointerLock_Callback";
-  requestPointerLock_Callback_1_(mthis, __arg_0) => requestPointerLock_Callback_1(mthis, __arg_0);
-
-  static requestPointerLock_Callback_2(mthis, __arg_0, __arg_1) native "Element_requestPointerLock_Callback";
-  requestPointerLock_Callback_2_(mthis, __arg_0, __arg_1) => requestPointerLock_Callback_2(mthis, __arg_0, __arg_1);
-
-  static scrollHeight_Getter(mthis) native "Element_scrollHeight_Getter";
-  scrollHeight_Getter_(mthis) => scrollHeight_Getter(mthis);
-
-  static scrollIntoViewIfNeeded_Callback_0(mthis) native "Element_scrollIntoViewIfNeeded_Callback";
-  scrollIntoViewIfNeeded_Callback_0_(mthis) => scrollIntoViewIfNeeded_Callback_0(mthis);
+  querySelectorAll_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "querySelectorAll", [__arg_0]);
 
-  static scrollIntoViewIfNeeded_Callback_1(mthis, __arg_0) native "Element_scrollIntoViewIfNeeded_Callback";
-  scrollIntoViewIfNeeded_Callback_1_(mthis, __arg_0) => scrollIntoViewIfNeeded_Callback_1(mthis, __arg_0);
+  querySelector_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "querySelector", []);
 
-  static scrollIntoViewIfNeeded_Callback_2(mthis, __arg_0, __arg_1) native "Element_scrollIntoViewIfNeeded_Callback";
-  scrollIntoViewIfNeeded_Callback_2_(mthis, __arg_0, __arg_1) => scrollIntoViewIfNeeded_Callback_2(mthis, __arg_0, __arg_1);
+  querySelector_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "querySelector", [__arg_0]);
 
-  static scrollIntoViewIfNeeded_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Element_scrollIntoViewIfNeeded_Callback";
-  scrollIntoViewIfNeeded_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => scrollIntoViewIfNeeded_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  removeAttributeNS_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "removeAttributeNS", []);
 
-  static scrollIntoView_Callback_0(mthis) native "Element_scrollIntoView_Callback";
-  scrollIntoView_Callback_0_(mthis) => scrollIntoView_Callback_0(mthis);
+  removeAttributeNS_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "removeAttributeNS", [__arg_0]);
 
-  static scrollIntoView_Callback_1(mthis, __arg_0) native "Element_scrollIntoView_Callback";
-  scrollIntoView_Callback_1_(mthis, __arg_0) => scrollIntoView_Callback_1(mthis, __arg_0);
+  removeAttributeNS_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "removeAttributeNS", [__arg_0, __arg_1]);
 
-  static scrollIntoView_Callback_2(mthis, __arg_0, __arg_1) native "Element_scrollIntoView_Callback";
-  scrollIntoView_Callback_2_(mthis, __arg_0, __arg_1) => scrollIntoView_Callback_2(mthis, __arg_0, __arg_1);
+  removeAttribute_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "removeAttribute", []);
 
-  static scrollIntoView_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Element_scrollIntoView_Callback";
-  scrollIntoView_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => scrollIntoView_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  removeAttribute_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "removeAttribute", [__arg_0]);
 
-  static scrollLeft_Getter(mthis) native "Element_scrollLeft_Getter";
-  scrollLeft_Getter_(mthis) => scrollLeft_Getter(mthis);
+  remove_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "remove", []);
 
-  static scrollLeft_Setter(mthis, __arg_0) native "Element_scrollLeft_Setter";
-  scrollLeft_Setter_(mthis, __arg_0) => scrollLeft_Setter(mthis, __arg_0);
+  requestFullscreen_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "requestFullscreen", []);
 
-  static scrollTop_Getter(mthis) native "Element_scrollTop_Getter";
-  scrollTop_Getter_(mthis) => scrollTop_Getter(mthis);
+  requestPointerLock_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "requestPointerLock", []);
 
-  static scrollTop_Setter(mthis, __arg_0) native "Element_scrollTop_Setter";
-  scrollTop_Setter_(mthis, __arg_0) => scrollTop_Setter(mthis, __arg_0);
+  scrollHeight_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "scrollHeight");
 
-  static scrollWidth_Getter(mthis) native "Element_scrollWidth_Getter";
-  scrollWidth_Getter_(mthis) => scrollWidth_Getter(mthis);
+  scrollIntoViewIfNeeded_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "scrollIntoViewIfNeeded", []);
 
-  static setAttributeNS_Callback_1(mthis, __arg_0) native "Element_setAttributeNS_Callback";
-  setAttributeNS_Callback_1_(mthis, __arg_0) => setAttributeNS_Callback_1(mthis, __arg_0);
+  scrollIntoViewIfNeeded_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "scrollIntoViewIfNeeded", [__arg_0]);
 
-  static setAttributeNS_Callback_2(mthis, __arg_0, __arg_1) native "Element_setAttributeNS_Callback";
-  setAttributeNS_Callback_2_(mthis, __arg_0, __arg_1) => setAttributeNS_Callback_2(mthis, __arg_0, __arg_1);
+  scrollIntoView_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "scrollIntoView", []);
 
-  static setAttributeNS_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Element_setAttributeNS_Callback";
-  setAttributeNS_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => setAttributeNS_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  scrollIntoView_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "scrollIntoView", [__arg_0]);
 
-  static setAttributeNS_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Element_setAttributeNS_Callback";
-  setAttributeNS_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => setAttributeNS_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  scrollLeft_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "scrollLeft");
 
-  static setAttributeNS_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "Element_setAttributeNS_Callback";
-  setAttributeNS_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => setAttributeNS_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  scrollLeft_Setter_(mthis, __arg_0) => mthis["scrollLeft"] = __arg_0;
 
-  static setAttribute_Callback_0(mthis) native "Element_setAttribute_Callback";
-  setAttribute_Callback_0_(mthis) => setAttribute_Callback_0(mthis);
+  scrollTop_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "scrollTop");
 
-  static setAttribute_Callback_1(mthis, __arg_0) native "Element_setAttribute_Callback";
-  setAttribute_Callback_1_(mthis, __arg_0) => setAttribute_Callback_1(mthis, __arg_0);
+  scrollTop_Setter_(mthis, __arg_0) => mthis["scrollTop"] = __arg_0;
 
-  static setAttribute_Callback_2(mthis, __arg_0, __arg_1) native "Element_setAttribute_Callback";
-  setAttribute_Callback_2_(mthis, __arg_0, __arg_1) => setAttribute_Callback_2(mthis, __arg_0, __arg_1);
+  scrollWidth_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "scrollWidth");
 
-  static setAttribute_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Element_setAttribute_Callback";
-  setAttribute_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => setAttribute_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  setAttributeNS_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "setAttributeNS", [__arg_0]);
 
-  static setAttribute_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Element_setAttribute_Callback";
-  setAttribute_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => setAttribute_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  setAttributeNS_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "setAttributeNS", [__arg_0, __arg_1]);
 
-  static shadowRoot_Getter(mthis) native "Element_shadowRoot_Getter";
-  shadowRoot_Getter_(mthis) => shadowRoot_Getter(mthis);
+  setAttributeNS_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "setAttributeNS", [__arg_0, __arg_1, __arg_2]);
 
-  static style_Getter(mthis) native "Element_style_Getter";
-  style_Getter_(mthis) => style_Getter(mthis);
+  setAttribute_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "setAttribute", []);
 
-  static tagName_Getter(mthis) native "Element_tagName_Getter";
-  tagName_Getter_(mthis) => tagName_Getter(mthis);
+  setAttribute_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "setAttribute", [__arg_0]);
 
-  static webkitRequestFullScreen_Callback_0(mthis) native "Element_webkitRequestFullScreen_Callback";
-  webkitRequestFullScreen_Callback_0_(mthis) => webkitRequestFullScreen_Callback_0(mthis);
+  setAttribute_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "setAttribute", [__arg_0, __arg_1]);
 
-  static webkitRequestFullScreen_Callback_1(mthis, __arg_0) native "Element_webkitRequestFullScreen_Callback";
-  webkitRequestFullScreen_Callback_1_(mthis, __arg_0) => webkitRequestFullScreen_Callback_1(mthis, __arg_0);
+  shadowRoot_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "shadowRoot");
 
-  static webkitRequestFullScreen_Callback_2(mthis, __arg_0, __arg_1) native "Element_webkitRequestFullScreen_Callback";
-  webkitRequestFullScreen_Callback_2_(mthis, __arg_0, __arg_1) => webkitRequestFullScreen_Callback_2(mthis, __arg_0, __arg_1);
+  style_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "style");
 
-  static webkitRequestFullScreen_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Element_webkitRequestFullScreen_Callback";
-  webkitRequestFullScreen_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => webkitRequestFullScreen_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  tagName_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "tagName");
 
-  static webkitRequestFullscreen_Callback_0(mthis) native "Element_webkitRequestFullscreen_Callback";
-  webkitRequestFullscreen_Callback_0_(mthis) => webkitRequestFullscreen_Callback_0(mthis);
+  webkitRequestFullScreen_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "webkitRequestFullScreen", []);
 
-  static webkitRequestFullscreen_Callback_1(mthis, __arg_0) native "Element_webkitRequestFullscreen_Callback";
-  webkitRequestFullscreen_Callback_1_(mthis, __arg_0) => webkitRequestFullscreen_Callback_1(mthis, __arg_0);
+  webkitRequestFullScreen_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "webkitRequestFullScreen", [__arg_0]);
 
-  static webkitRequestFullscreen_Callback_2(mthis, __arg_0, __arg_1) native "Element_webkitRequestFullscreen_Callback";
-  webkitRequestFullscreen_Callback_2_(mthis, __arg_0, __arg_1) => webkitRequestFullscreen_Callback_2(mthis, __arg_0, __arg_1);
+  webkitRequestFullscreen_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "webkitRequestFullscreen", []);
 
 }
 
 class BlinkEntry {
   static final instance = new BlinkEntry();
 
-  static copyTo_Callback_0(mthis) native "Entry_copyTo_Callback";
-  copyTo_Callback_0_(mthis) => copyTo_Callback_0(mthis);
+  copyTo_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "copyTo", []);
 
-  static copyTo_Callback_1(mthis, __arg_0) native "Entry_copyTo_Callback";
-  copyTo_Callback_1_(mthis, __arg_0) => copyTo_Callback_1(mthis, __arg_0);
+  copyTo_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "copyTo", [__arg_0]);
 
-  static copyTo_Callback_2(mthis, __arg_0, __arg_1) native "Entry_copyTo_Callback";
-  copyTo_Callback_2_(mthis, __arg_0, __arg_1) => copyTo_Callback_2(mthis, __arg_0, __arg_1);
+  copyTo_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "copyTo", [__arg_0, __arg_1]);
 
-  static copyTo_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Entry_copyTo_Callback";
-  copyTo_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => copyTo_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  copyTo_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "copyTo", [__arg_0, __arg_1, __arg_2]);
 
-  static copyTo_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Entry_copyTo_Callback";
-  copyTo_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => copyTo_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  copyTo_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "copyTo", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static copyTo_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "Entry_copyTo_Callback";
-  copyTo_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => copyTo_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  filesystem_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "filesystem");
 
-  static copyTo_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "Entry_copyTo_Callback";
-  copyTo_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => copyTo_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  fullPath_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "fullPath");
 
-  static filesystem_Getter(mthis) native "Entry_filesystem_Getter";
-  filesystem_Getter_(mthis) => filesystem_Getter(mthis);
+  getMetadata_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getMetadata", []);
 
-  static fullPath_Getter(mthis) native "Entry_fullPath_Getter";
-  fullPath_Getter_(mthis) => fullPath_Getter(mthis);
+  getMetadata_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getMetadata", [__arg_0]);
 
-  static getMetadata_Callback_0(mthis) native "Entry_getMetadata_Callback";
-  getMetadata_Callback_0_(mthis) => getMetadata_Callback_0(mthis);
+  getMetadata_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "getMetadata", [__arg_0, __arg_1]);
 
-  static getMetadata_Callback_1(mthis, __arg_0) native "Entry_getMetadata_Callback";
-  getMetadata_Callback_1_(mthis, __arg_0) => getMetadata_Callback_1(mthis, __arg_0);
+  getParent_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getParent", []);
 
-  static getMetadata_Callback_2(mthis, __arg_0, __arg_1) native "Entry_getMetadata_Callback";
-  getMetadata_Callback_2_(mthis, __arg_0, __arg_1) => getMetadata_Callback_2(mthis, __arg_0, __arg_1);
+  getParent_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getParent", [__arg_0]);
 
-  static getMetadata_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Entry_getMetadata_Callback";
-  getMetadata_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getMetadata_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  getParent_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "getParent", [__arg_0, __arg_1]);
 
-  static getMetadata_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Entry_getMetadata_Callback";
-  getMetadata_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => getMetadata_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  isDirectory_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "isDirectory");
 
-  static getParent_Callback_0(mthis) native "Entry_getParent_Callback";
-  getParent_Callback_0_(mthis) => getParent_Callback_0(mthis);
+  isFile_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "isFile");
 
-  static getParent_Callback_1(mthis, __arg_0) native "Entry_getParent_Callback";
-  getParent_Callback_1_(mthis, __arg_0) => getParent_Callback_1(mthis, __arg_0);
+  moveTo_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "moveTo", []);
 
-  static getParent_Callback_2(mthis, __arg_0, __arg_1) native "Entry_getParent_Callback";
-  getParent_Callback_2_(mthis, __arg_0, __arg_1) => getParent_Callback_2(mthis, __arg_0, __arg_1);
+  moveTo_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "moveTo", [__arg_0]);
 
-  static getParent_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Entry_getParent_Callback";
-  getParent_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getParent_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  moveTo_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "moveTo", [__arg_0, __arg_1]);
 
-  static getParent_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Entry_getParent_Callback";
-  getParent_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => getParent_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  moveTo_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "moveTo", [__arg_0, __arg_1, __arg_2]);
 
-  static isDirectory_Getter(mthis) native "Entry_isDirectory_Getter";
-  isDirectory_Getter_(mthis) => isDirectory_Getter(mthis);
+  moveTo_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "moveTo", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static isFile_Getter(mthis) native "Entry_isFile_Getter";
-  isFile_Getter_(mthis) => isFile_Getter(mthis);
+  name_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "name");
 
-  static moveTo_Callback_0(mthis) native "Entry_moveTo_Callback";
-  moveTo_Callback_0_(mthis) => moveTo_Callback_0(mthis);
+  remove_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "remove", []);
 
-  static moveTo_Callback_1(mthis, __arg_0) native "Entry_moveTo_Callback";
-  moveTo_Callback_1_(mthis, __arg_0) => moveTo_Callback_1(mthis, __arg_0);
+  remove_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "remove", [__arg_0]);
 
-  static moveTo_Callback_2(mthis, __arg_0, __arg_1) native "Entry_moveTo_Callback";
-  moveTo_Callback_2_(mthis, __arg_0, __arg_1) => moveTo_Callback_2(mthis, __arg_0, __arg_1);
+  remove_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "remove", [__arg_0, __arg_1]);
 
-  static moveTo_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Entry_moveTo_Callback";
-  moveTo_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => moveTo_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static moveTo_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Entry_moveTo_Callback";
-  moveTo_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => moveTo_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static moveTo_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "Entry_moveTo_Callback";
-  moveTo_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => moveTo_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
-
-  static moveTo_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "Entry_moveTo_Callback";
-  moveTo_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => moveTo_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
-
-  static name_Getter(mthis) native "Entry_name_Getter";
-  name_Getter_(mthis) => name_Getter(mthis);
-
-  static remove_Callback_0(mthis) native "Entry_remove_Callback";
-  remove_Callback_0_(mthis) => remove_Callback_0(mthis);
-
-  static remove_Callback_1(mthis, __arg_0) native "Entry_remove_Callback";
-  remove_Callback_1_(mthis, __arg_0) => remove_Callback_1(mthis, __arg_0);
-
-  static remove_Callback_2(mthis, __arg_0, __arg_1) native "Entry_remove_Callback";
-  remove_Callback_2_(mthis, __arg_0, __arg_1) => remove_Callback_2(mthis, __arg_0, __arg_1);
-
-  static remove_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Entry_remove_Callback";
-  remove_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => remove_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static remove_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Entry_remove_Callback";
-  remove_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => remove_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static toURL_Callback_0(mthis) native "Entry_toURL_Callback";
-  toURL_Callback_0_(mthis) => toURL_Callback_0(mthis);
-
-  static toURL_Callback_1(mthis, __arg_0) native "Entry_toURL_Callback";
-  toURL_Callback_1_(mthis, __arg_0) => toURL_Callback_1(mthis, __arg_0);
-
-  static toURL_Callback_2(mthis, __arg_0, __arg_1) native "Entry_toURL_Callback";
-  toURL_Callback_2_(mthis, __arg_0, __arg_1) => toURL_Callback_2(mthis, __arg_0, __arg_1);
+  toURL_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "toURL", []);
 
 }
 
 class BlinkEntrySync {
   static final instance = new BlinkEntrySync();
 
-  static copyTo_Callback_0(mthis) native "EntrySync_copyTo_Callback";
-  copyTo_Callback_0_(mthis) => copyTo_Callback_0(mthis);
+  copyTo_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "copyTo", []);
 
-  static copyTo_Callback_1(mthis, __arg_0) native "EntrySync_copyTo_Callback";
-  copyTo_Callback_1_(mthis, __arg_0) => copyTo_Callback_1(mthis, __arg_0);
+  copyTo_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "copyTo", [__arg_0]);
 
-  static copyTo_Callback_2(mthis, __arg_0, __arg_1) native "EntrySync_copyTo_Callback";
-  copyTo_Callback_2_(mthis, __arg_0, __arg_1) => copyTo_Callback_2(mthis, __arg_0, __arg_1);
+  copyTo_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "copyTo", [__arg_0, __arg_1]);
 
-  static copyTo_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "EntrySync_copyTo_Callback";
-  copyTo_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => copyTo_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  filesystem_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "filesystem");
 
-  static copyTo_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "EntrySync_copyTo_Callback";
-  copyTo_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => copyTo_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  fullPath_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "fullPath");
 
-  static filesystem_Getter(mthis) native "EntrySync_filesystem_Getter";
-  filesystem_Getter_(mthis) => filesystem_Getter(mthis);
+  getMetadata_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getMetadata", []);
 
-  static fullPath_Getter(mthis) native "EntrySync_fullPath_Getter";
-  fullPath_Getter_(mthis) => fullPath_Getter(mthis);
+  getParent_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getParent", []);
 
-  static getMetadata_Callback_0(mthis) native "EntrySync_getMetadata_Callback";
-  getMetadata_Callback_0_(mthis) => getMetadata_Callback_0(mthis);
+  isDirectory_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "isDirectory");
 
-  static getMetadata_Callback_1(mthis, __arg_0) native "EntrySync_getMetadata_Callback";
-  getMetadata_Callback_1_(mthis, __arg_0) => getMetadata_Callback_1(mthis, __arg_0);
+  isFile_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "isFile");
 
-  static getMetadata_Callback_2(mthis, __arg_0, __arg_1) native "EntrySync_getMetadata_Callback";
-  getMetadata_Callback_2_(mthis, __arg_0, __arg_1) => getMetadata_Callback_2(mthis, __arg_0, __arg_1);
+  moveTo_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "moveTo", []);
 
-  static getParent_Callback_0(mthis) native "EntrySync_getParent_Callback";
-  getParent_Callback_0_(mthis) => getParent_Callback_0(mthis);
+  moveTo_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "moveTo", [__arg_0]);
 
-  static getParent_Callback_1(mthis, __arg_0) native "EntrySync_getParent_Callback";
-  getParent_Callback_1_(mthis, __arg_0) => getParent_Callback_1(mthis, __arg_0);
+  moveTo_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "moveTo", [__arg_0, __arg_1]);
 
-  static getParent_Callback_2(mthis, __arg_0, __arg_1) native "EntrySync_getParent_Callback";
-  getParent_Callback_2_(mthis, __arg_0, __arg_1) => getParent_Callback_2(mthis, __arg_0, __arg_1);
+  name_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "name");
 
-  static isDirectory_Getter(mthis) native "EntrySync_isDirectory_Getter";
-  isDirectory_Getter_(mthis) => isDirectory_Getter(mthis);
+  remove_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "remove", []);
 
-  static isFile_Getter(mthis) native "EntrySync_isFile_Getter";
-  isFile_Getter_(mthis) => isFile_Getter(mthis);
-
-  static moveTo_Callback_0(mthis) native "EntrySync_moveTo_Callback";
-  moveTo_Callback_0_(mthis) => moveTo_Callback_0(mthis);
-
-  static moveTo_Callback_1(mthis, __arg_0) native "EntrySync_moveTo_Callback";
-  moveTo_Callback_1_(mthis, __arg_0) => moveTo_Callback_1(mthis, __arg_0);
-
-  static moveTo_Callback_2(mthis, __arg_0, __arg_1) native "EntrySync_moveTo_Callback";
-  moveTo_Callback_2_(mthis, __arg_0, __arg_1) => moveTo_Callback_2(mthis, __arg_0, __arg_1);
-
-  static moveTo_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "EntrySync_moveTo_Callback";
-  moveTo_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => moveTo_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static moveTo_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "EntrySync_moveTo_Callback";
-  moveTo_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => moveTo_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static name_Getter(mthis) native "EntrySync_name_Getter";
-  name_Getter_(mthis) => name_Getter(mthis);
-
-  static remove_Callback_0(mthis) native "EntrySync_remove_Callback";
-  remove_Callback_0_(mthis) => remove_Callback_0(mthis);
-
-  static remove_Callback_1(mthis, __arg_0) native "EntrySync_remove_Callback";
-  remove_Callback_1_(mthis, __arg_0) => remove_Callback_1(mthis, __arg_0);
-
-  static remove_Callback_2(mthis, __arg_0, __arg_1) native "EntrySync_remove_Callback";
-  remove_Callback_2_(mthis, __arg_0, __arg_1) => remove_Callback_2(mthis, __arg_0, __arg_1);
-
-  static toURL_Callback_0(mthis) native "EntrySync_toURL_Callback";
-  toURL_Callback_0_(mthis) => toURL_Callback_0(mthis);
-
-  static toURL_Callback_1(mthis, __arg_0) native "EntrySync_toURL_Callback";
-  toURL_Callback_1_(mthis, __arg_0) => toURL_Callback_1(mthis, __arg_0);
-
-  static toURL_Callback_2(mthis, __arg_0, __arg_1) native "EntrySync_toURL_Callback";
-  toURL_Callback_2_(mthis, __arg_0, __arg_1) => toURL_Callback_2(mthis, __arg_0, __arg_1);
+  toURL_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "toURL", []);
 
 }
 
 class BlinkErrorEvent extends BlinkEvent {
   static final instance = new BlinkErrorEvent();
 
-  static colno_Getter(mthis) native "ErrorEvent_colno_Getter";
-  colno_Getter_(mthis) => colno_Getter(mthis);
+  colno_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "colno");
 
-  static constructorCallback_2(__arg_0, __arg_1) native "ErrorEvent_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  constructorCallback_2_(__arg_0, __arg_1) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "ErrorEvent"), [__arg_0, __arg_1]);
 
-  static error_Getter(mthis) native "ErrorEvent_error_Getter";
-  error_Getter_(mthis) => error_Getter(mthis);
+  error_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "error");
 
-  static filename_Getter(mthis) native "ErrorEvent_filename_Getter";
-  filename_Getter_(mthis) => filename_Getter(mthis);
+  filename_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "filename");
 
-  static lineno_Getter(mthis) native "ErrorEvent_lineno_Getter";
-  lineno_Getter_(mthis) => lineno_Getter(mthis);
+  lineno_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "lineno");
 
-  static message_Getter(mthis) native "ErrorEvent_message_Getter";
-  message_Getter_(mthis) => message_Getter(mthis);
+  message_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "message");
 
 }
 
 class BlinkEvent {
   static final instance = new BlinkEvent();
 
-  static bubbles_Getter(mthis) native "Event_bubbles_Getter";
-  bubbles_Getter_(mthis) => bubbles_Getter(mthis);
+  bubbles_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "bubbles");
 
-  static cancelBubble_Getter(mthis) native "Event_cancelBubble_Getter";
-  cancelBubble_Getter_(mthis) => cancelBubble_Getter(mthis);
+  cancelBubble_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "cancelBubble");
 
-  static cancelBubble_Setter(mthis, __arg_0) native "Event_cancelBubble_Setter";
-  cancelBubble_Setter_(mthis, __arg_0) => cancelBubble_Setter(mthis, __arg_0);
+  cancelBubble_Setter_(mthis, __arg_0) => mthis["cancelBubble"] = __arg_0;
 
-  static cancelable_Getter(mthis) native "Event_cancelable_Getter";
-  cancelable_Getter_(mthis) => cancelable_Getter(mthis);
+  cancelable_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "cancelable");
 
-  static clipboardData_Getter(mthis) native "Event_clipboardData_Getter";
-  clipboardData_Getter_(mthis) => clipboardData_Getter(mthis);
+  clipboardData_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "clipboardData");
 
-  static constructorCallback_2(__arg_0, __arg_1) native "Event_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  constructorCallback_2_(__arg_0, __arg_1) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "Event"), [__arg_0, __arg_1]);
 
-  static currentTarget_Getter(mthis) native "Event_currentTarget_Getter";
-  currentTarget_Getter_(mthis) => currentTarget_Getter(mthis);
+  currentTarget_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "currentTarget");
 
-  static defaultPrevented_Getter(mthis) native "Event_defaultPrevented_Getter";
-  defaultPrevented_Getter_(mthis) => defaultPrevented_Getter(mthis);
+  defaultPrevented_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "defaultPrevented");
 
-  static eventPhase_Getter(mthis) native "Event_eventPhase_Getter";
-  eventPhase_Getter_(mthis) => eventPhase_Getter(mthis);
+  eventPhase_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "eventPhase");
 
-  static initEvent_Callback_0(mthis) native "Event_initEvent_Callback";
-  initEvent_Callback_0_(mthis) => initEvent_Callback_0(mthis);
+  initEvent_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "initEvent", []);
 
-  static initEvent_Callback_1(mthis, __arg_0) native "Event_initEvent_Callback";
-  initEvent_Callback_1_(mthis, __arg_0) => initEvent_Callback_1(mthis, __arg_0);
+  initEvent_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "initEvent", [__arg_0]);
 
-  static initEvent_Callback_2(mthis, __arg_0, __arg_1) native "Event_initEvent_Callback";
-  initEvent_Callback_2_(mthis, __arg_0, __arg_1) => initEvent_Callback_2(mthis, __arg_0, __arg_1);
+  initEvent_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "initEvent", [__arg_0, __arg_1]);
 
-  static initEvent_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Event_initEvent_Callback";
-  initEvent_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => initEvent_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  initEvent_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "initEvent", [__arg_0, __arg_1, __arg_2]);
 
-  static initEvent_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Event_initEvent_Callback";
-  initEvent_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => initEvent_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  path_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "path");
 
-  static initEvent_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "Event_initEvent_Callback";
-  initEvent_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => initEvent_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  preventDefault_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "preventDefault", []);
 
-  static path_Getter(mthis) native "Event_path_Getter";
-  path_Getter_(mthis) => path_Getter(mthis);
+  returnValue_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "returnValue");
 
-  static preventDefault_Callback_0(mthis) native "Event_preventDefault_Callback";
-  preventDefault_Callback_0_(mthis) => preventDefault_Callback_0(mthis);
+  returnValue_Setter_(mthis, __arg_0) => mthis["returnValue"] = __arg_0;
 
-  static preventDefault_Callback_1(mthis, __arg_0) native "Event_preventDefault_Callback";
-  preventDefault_Callback_1_(mthis, __arg_0) => preventDefault_Callback_1(mthis, __arg_0);
+  stopImmediatePropagation_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "stopImmediatePropagation", []);
 
-  static preventDefault_Callback_2(mthis, __arg_0, __arg_1) native "Event_preventDefault_Callback";
-  preventDefault_Callback_2_(mthis, __arg_0, __arg_1) => preventDefault_Callback_2(mthis, __arg_0, __arg_1);
+  stopPropagation_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "stopPropagation", []);
 
-  static returnValue_Getter(mthis) native "Event_returnValue_Getter";
-  returnValue_Getter_(mthis) => returnValue_Getter(mthis);
+  target_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "target");
 
-  static returnValue_Setter(mthis, __arg_0) native "Event_returnValue_Setter";
-  returnValue_Setter_(mthis, __arg_0) => returnValue_Setter(mthis, __arg_0);
+  timeStamp_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "timeStamp");
 
-  static stopImmediatePropagation_Callback_0(mthis) native "Event_stopImmediatePropagation_Callback";
-  stopImmediatePropagation_Callback_0_(mthis) => stopImmediatePropagation_Callback_0(mthis);
-
-  static stopImmediatePropagation_Callback_1(mthis, __arg_0) native "Event_stopImmediatePropagation_Callback";
-  stopImmediatePropagation_Callback_1_(mthis, __arg_0) => stopImmediatePropagation_Callback_1(mthis, __arg_0);
-
-  static stopImmediatePropagation_Callback_2(mthis, __arg_0, __arg_1) native "Event_stopImmediatePropagation_Callback";
-  stopImmediatePropagation_Callback_2_(mthis, __arg_0, __arg_1) => stopImmediatePropagation_Callback_2(mthis, __arg_0, __arg_1);
-
-  static stopPropagation_Callback_0(mthis) native "Event_stopPropagation_Callback";
-  stopPropagation_Callback_0_(mthis) => stopPropagation_Callback_0(mthis);
-
-  static stopPropagation_Callback_1(mthis, __arg_0) native "Event_stopPropagation_Callback";
-  stopPropagation_Callback_1_(mthis, __arg_0) => stopPropagation_Callback_1(mthis, __arg_0);
-
-  static stopPropagation_Callback_2(mthis, __arg_0, __arg_1) native "Event_stopPropagation_Callback";
-  stopPropagation_Callback_2_(mthis, __arg_0, __arg_1) => stopPropagation_Callback_2(mthis, __arg_0, __arg_1);
-
-  static target_Getter(mthis) native "Event_target_Getter";
-  target_Getter_(mthis) => target_Getter(mthis);
-
-  static timeStamp_Getter(mthis) native "Event_timeStamp_Getter";
-  timeStamp_Getter_(mthis) => timeStamp_Getter(mthis);
-
-  static type_Getter(mthis) native "Event_type_Getter";
-  type_Getter_(mthis) => type_Getter(mthis);
+  type_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "type");
 
 }
 
 class BlinkEventSource extends BlinkEventTarget {
   static final instance = new BlinkEventSource();
 
-  static close_Callback_0(mthis) native "EventSource_close_Callback";
-  close_Callback_0_(mthis) => close_Callback_0(mthis);
+  close_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "close", []);
 
-  static close_Callback_1(mthis, __arg_0) native "EventSource_close_Callback";
-  close_Callback_1_(mthis, __arg_0) => close_Callback_1(mthis, __arg_0);
+  constructorCallback_0_() => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "EventSource"), []);
 
-  static close_Callback_2(mthis, __arg_0, __arg_1) native "EventSource_close_Callback";
-  close_Callback_2_(mthis, __arg_0, __arg_1) => close_Callback_2(mthis, __arg_0, __arg_1);
+  constructorCallback_1_(__arg_0) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "EventSource"), [__arg_0]);
 
-  static constructorCallback_0() native "EventSource_constructorCallback";
-  constructorCallback_0_() => constructorCallback_0();
+  constructorCallback_2_(__arg_0, __arg_1) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "EventSource"), [__arg_0, __arg_1]);
 
-  static constructorCallback_1(__arg_0) native "EventSource_constructorCallback";
-  constructorCallback_1_(__arg_0) => constructorCallback_1(__arg_0);
+  onerror_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onerror");
 
-  static constructorCallback_2(__arg_0, __arg_1) native "EventSource_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  onerror_Setter_(mthis, __arg_0) => mthis["onerror"] = __arg_0;
 
-  static constructorCallback_3(__arg_0, __arg_1, __arg_2) native "EventSource_constructorCallback";
-  constructorCallback_3_(__arg_0, __arg_1, __arg_2) => constructorCallback_3(__arg_0, __arg_1, __arg_2);
+  onmessage_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onmessage");
 
-  static constructorCallback_4(__arg_0, __arg_1, __arg_2, __arg_3) native "EventSource_constructorCallback";
-  constructorCallback_4_(__arg_0, __arg_1, __arg_2, __arg_3) => constructorCallback_4(__arg_0, __arg_1, __arg_2, __arg_3);
+  onmessage_Setter_(mthis, __arg_0) => mthis["onmessage"] = __arg_0;
 
-  static onerror_Getter(mthis) native "EventSource_onerror_Getter";
-  onerror_Getter_(mthis) => onerror_Getter(mthis);
+  onopen_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onopen");
 
-  static onerror_Setter(mthis, __arg_0) native "EventSource_onerror_Setter";
-  onerror_Setter_(mthis, __arg_0) => onerror_Setter(mthis, __arg_0);
+  onopen_Setter_(mthis, __arg_0) => mthis["onopen"] = __arg_0;
 
-  static onmessage_Getter(mthis) native "EventSource_onmessage_Getter";
-  onmessage_Getter_(mthis) => onmessage_Getter(mthis);
+  readyState_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "readyState");
 
-  static onmessage_Setter(mthis, __arg_0) native "EventSource_onmessage_Setter";
-  onmessage_Setter_(mthis, __arg_0) => onmessage_Setter(mthis, __arg_0);
+  url_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "url");
 
-  static onopen_Getter(mthis) native "EventSource_onopen_Getter";
-  onopen_Getter_(mthis) => onopen_Getter(mthis);
-
-  static onopen_Setter(mthis, __arg_0) native "EventSource_onopen_Setter";
-  onopen_Setter_(mthis, __arg_0) => onopen_Setter(mthis, __arg_0);
-
-  static readyState_Getter(mthis) native "EventSource_readyState_Getter";
-  readyState_Getter_(mthis) => readyState_Getter(mthis);
-
-  static url_Getter(mthis) native "EventSource_url_Getter";
-  url_Getter_(mthis) => url_Getter(mthis);
-
-  static withCredentials_Getter(mthis) native "EventSource_withCredentials_Getter";
-  withCredentials_Getter_(mthis) => withCredentials_Getter(mthis);
+  withCredentials_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "withCredentials");
 
 }
 
 class BlinkEventTarget {
   static final instance = new BlinkEventTarget();
 
-  static addEventListener_Callback_0(mthis) native "EventTarget_addEventListener_Callback";
-  addEventListener_Callback_0_(mthis) => addEventListener_Callback_0(mthis);
+  addEventListener_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "addEventListener", []);
 
-  static addEventListener_Callback_1(mthis, __arg_0) native "EventTarget_addEventListener_Callback";
-  addEventListener_Callback_1_(mthis, __arg_0) => addEventListener_Callback_1(mthis, __arg_0);
+  addEventListener_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "addEventListener", [__arg_0]);
 
-  static addEventListener_Callback_2(mthis, __arg_0, __arg_1) native "EventTarget_addEventListener_Callback";
-  addEventListener_Callback_2_(mthis, __arg_0, __arg_1) => addEventListener_Callback_2(mthis, __arg_0, __arg_1);
+  addEventListener_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "addEventListener", [__arg_0, __arg_1]);
 
-  static addEventListener_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "EventTarget_addEventListener_Callback";
-  addEventListener_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => addEventListener_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  addEventListener_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "addEventListener", [__arg_0, __arg_1, __arg_2]);
 
-  static addEventListener_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "EventTarget_addEventListener_Callback";
-  addEventListener_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => addEventListener_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  dispatchEvent_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "dispatchEvent", []);
 
-  static addEventListener_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "EventTarget_addEventListener_Callback";
-  addEventListener_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => addEventListener_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  dispatchEvent_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "dispatchEvent", [__arg_0]);
 
-  static dispatchEvent_Callback_0(mthis) native "EventTarget_dispatchEvent_Callback";
-  dispatchEvent_Callback_0_(mthis) => dispatchEvent_Callback_0(mthis);
+  removeEventListener_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "removeEventListener", []);
 
-  static dispatchEvent_Callback_1(mthis, __arg_0) native "EventTarget_dispatchEvent_Callback";
-  dispatchEvent_Callback_1_(mthis, __arg_0) => dispatchEvent_Callback_1(mthis, __arg_0);
+  removeEventListener_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "removeEventListener", [__arg_0]);
 
-  static dispatchEvent_Callback_2(mthis, __arg_0, __arg_1) native "EventTarget_dispatchEvent_Callback";
-  dispatchEvent_Callback_2_(mthis, __arg_0, __arg_1) => dispatchEvent_Callback_2(mthis, __arg_0, __arg_1);
+  removeEventListener_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "removeEventListener", [__arg_0, __arg_1]);
 
-  static dispatchEvent_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "EventTarget_dispatchEvent_Callback";
-  dispatchEvent_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => dispatchEvent_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static removeEventListener_Callback_0(mthis) native "EventTarget_removeEventListener_Callback";
-  removeEventListener_Callback_0_(mthis) => removeEventListener_Callback_0(mthis);
-
-  static removeEventListener_Callback_1(mthis, __arg_0) native "EventTarget_removeEventListener_Callback";
-  removeEventListener_Callback_1_(mthis, __arg_0) => removeEventListener_Callback_1(mthis, __arg_0);
-
-  static removeEventListener_Callback_2(mthis, __arg_0, __arg_1) native "EventTarget_removeEventListener_Callback";
-  removeEventListener_Callback_2_(mthis, __arg_0, __arg_1) => removeEventListener_Callback_2(mthis, __arg_0, __arg_1);
-
-  static removeEventListener_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "EventTarget_removeEventListener_Callback";
-  removeEventListener_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => removeEventListener_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static removeEventListener_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "EventTarget_removeEventListener_Callback";
-  removeEventListener_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => removeEventListener_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static removeEventListener_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "EventTarget_removeEventListener_Callback";
-  removeEventListener_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => removeEventListener_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  removeEventListener_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "removeEventListener", [__arg_0, __arg_1, __arg_2]);
 
 }
 
 class BlinkExtendableEvent extends BlinkEvent {
   static final instance = new BlinkExtendableEvent();
 
-  static waitUntil_Callback_0(mthis) native "ExtendableEvent_waitUntil_Callback";
-  waitUntil_Callback_0_(mthis) => waitUntil_Callback_0(mthis);
+  waitUntil_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "waitUntil", []);
 
-  static waitUntil_Callback_1(mthis, __arg_0) native "ExtendableEvent_waitUntil_Callback";
-  waitUntil_Callback_1_(mthis, __arg_0) => waitUntil_Callback_1(mthis, __arg_0);
-
-  static waitUntil_Callback_2(mthis, __arg_0, __arg_1) native "ExtendableEvent_waitUntil_Callback";
-  waitUntil_Callback_2_(mthis, __arg_0, __arg_1) => waitUntil_Callback_2(mthis, __arg_0, __arg_1);
-
-  static waitUntil_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "ExtendableEvent_waitUntil_Callback";
-  waitUntil_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => waitUntil_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  waitUntil_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "waitUntil", [__arg_0]);
 
 }
 
 class BlinkFederatedCredential extends BlinkCredential {
   static final instance = new BlinkFederatedCredential();
 
-  static constructorCallback_2(__arg_0, __arg_1) native "FederatedCredential_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  constructorCallback_2_(__arg_0, __arg_1) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "FederatedCredential"), [__arg_0, __arg_1]);
 
-  static constructorCallback_3(__arg_0, __arg_1, __arg_2) native "FederatedCredential_constructorCallback";
-  constructorCallback_3_(__arg_0, __arg_1, __arg_2) => constructorCallback_3(__arg_0, __arg_1, __arg_2);
+  constructorCallback_3_(__arg_0, __arg_1, __arg_2) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "FederatedCredential"), [__arg_0, __arg_1, __arg_2]);
 
-  static constructorCallback_4(__arg_0, __arg_1, __arg_2, __arg_3) native "FederatedCredential_constructorCallback";
-  constructorCallback_4_(__arg_0, __arg_1, __arg_2, __arg_3) => constructorCallback_4(__arg_0, __arg_1, __arg_2, __arg_3);
+  constructorCallback_4_(__arg_0, __arg_1, __arg_2, __arg_3) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "FederatedCredential"), [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static constructorCallback_5(__arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "FederatedCredential_constructorCallback";
-  constructorCallback_5_(__arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => constructorCallback_5(__arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
-
-  static constructorCallback_6(__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "FederatedCredential_constructorCallback";
-  constructorCallback_6_(__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => constructorCallback_6(__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
-
-  static federation_Getter(mthis) native "FederatedCredential_federation_Getter";
-  federation_Getter_(mthis) => federation_Getter(mthis);
+  federation_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "federation");
 
 }
 
 class BlinkFetchEvent extends BlinkEvent {
   static final instance = new BlinkFetchEvent();
 
-  static isReload_Getter(mthis) native "FetchEvent_isReload_Getter";
-  isReload_Getter_(mthis) => isReload_Getter(mthis);
+  isReload_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "isReload");
 
-  static request_Getter(mthis) native "FetchEvent_request_Getter";
-  request_Getter_(mthis) => request_Getter(mthis);
+  request_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "request");
 
-  static respondWith_Callback_0(mthis) native "FetchEvent_respondWith_Callback";
-  respondWith_Callback_0_(mthis) => respondWith_Callback_0(mthis);
+  respondWith_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "respondWith", []);
 
-  static respondWith_Callback_1(mthis, __arg_0) native "FetchEvent_respondWith_Callback";
-  respondWith_Callback_1_(mthis, __arg_0) => respondWith_Callback_1(mthis, __arg_0);
-
-  static respondWith_Callback_2(mthis, __arg_0, __arg_1) native "FetchEvent_respondWith_Callback";
-  respondWith_Callback_2_(mthis, __arg_0, __arg_1) => respondWith_Callback_2(mthis, __arg_0, __arg_1);
-
-  static respondWith_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "FetchEvent_respondWith_Callback";
-  respondWith_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => respondWith_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  respondWith_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "respondWith", [__arg_0]);
 
 }
 
 class BlinkFile extends BlinkBlob {
   static final instance = new BlinkFile();
 
-  static constructorCallback_0() native "File_constructorCallback";
-  constructorCallback_0_() => constructorCallback_0();
+  constructorCallback_0_() => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "File"), []);
 
-  static constructorCallback_1(__arg_0) native "File_constructorCallback";
-  constructorCallback_1_(__arg_0) => constructorCallback_1(__arg_0);
+  constructorCallback_1_(__arg_0) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "File"), [__arg_0]);
 
-  static constructorCallback_2(__arg_0, __arg_1) native "File_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  constructorCallback_2_(__arg_0, __arg_1) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "File"), [__arg_0, __arg_1]);
 
-  static constructorCallback_3(__arg_0, __arg_1, __arg_2) native "File_constructorCallback";
-  constructorCallback_3_(__arg_0, __arg_1, __arg_2) => constructorCallback_3(__arg_0, __arg_1, __arg_2);
+  constructorCallback_3_(__arg_0, __arg_1, __arg_2) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "File"), [__arg_0, __arg_1, __arg_2]);
 
-  static constructorCallback_4(__arg_0, __arg_1, __arg_2, __arg_3) native "File_constructorCallback";
-  constructorCallback_4_(__arg_0, __arg_1, __arg_2, __arg_3) => constructorCallback_4(__arg_0, __arg_1, __arg_2, __arg_3);
+  lastModifiedDate_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "lastModifiedDate");
 
-  static constructorCallback_5(__arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "File_constructorCallback";
-  constructorCallback_5_(__arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => constructorCallback_5(__arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  lastModified_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "lastModified");
 
-  static lastModifiedDate_Getter(mthis) native "File_lastModifiedDate_Getter";
-  lastModifiedDate_Getter_(mthis) => lastModifiedDate_Getter(mthis);
+  name_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "name");
 
-  static lastModified_Getter(mthis) native "File_lastModified_Getter";
-  lastModified_Getter_(mthis) => lastModified_Getter(mthis);
-
-  static name_Getter(mthis) native "File_name_Getter";
-  name_Getter_(mthis) => name_Getter(mthis);
-
-  static webkitRelativePath_Getter(mthis) native "File_webkitRelativePath_Getter";
-  webkitRelativePath_Getter_(mthis) => webkitRelativePath_Getter(mthis);
+  webkitRelativePath_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "webkitRelativePath");
 
 }
 
 class BlinkFileEntry extends BlinkEntry {
   static final instance = new BlinkFileEntry();
 
-  static createWriter_Callback_0(mthis) native "FileEntry_createWriter_Callback";
-  createWriter_Callback_0_(mthis) => createWriter_Callback_0(mthis);
+  createWriter_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createWriter", []);
 
-  static createWriter_Callback_1(mthis, __arg_0) native "FileEntry_createWriter_Callback";
-  createWriter_Callback_1_(mthis, __arg_0) => createWriter_Callback_1(mthis, __arg_0);
+  createWriter_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "createWriter", [__arg_0]);
 
-  static createWriter_Callback_2(mthis, __arg_0, __arg_1) native "FileEntry_createWriter_Callback";
-  createWriter_Callback_2_(mthis, __arg_0, __arg_1) => createWriter_Callback_2(mthis, __arg_0, __arg_1);
+  createWriter_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "createWriter", [__arg_0, __arg_1]);
 
-  static createWriter_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "FileEntry_createWriter_Callback";
-  createWriter_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => createWriter_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  file_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "file", []);
 
-  static createWriter_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "FileEntry_createWriter_Callback";
-  createWriter_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => createWriter_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  file_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "file", [__arg_0]);
 
-  static file_Callback_0(mthis) native "FileEntry_file_Callback";
-  file_Callback_0_(mthis) => file_Callback_0(mthis);
-
-  static file_Callback_1(mthis, __arg_0) native "FileEntry_file_Callback";
-  file_Callback_1_(mthis, __arg_0) => file_Callback_1(mthis, __arg_0);
-
-  static file_Callback_2(mthis, __arg_0, __arg_1) native "FileEntry_file_Callback";
-  file_Callback_2_(mthis, __arg_0, __arg_1) => file_Callback_2(mthis, __arg_0, __arg_1);
-
-  static file_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "FileEntry_file_Callback";
-  file_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => file_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static file_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "FileEntry_file_Callback";
-  file_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => file_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  file_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "file", [__arg_0, __arg_1]);
 
 }
 
 class BlinkFileEntrySync extends BlinkEntrySync {
   static final instance = new BlinkFileEntrySync();
 
-  static createWriter_Callback_0(mthis) native "FileEntrySync_createWriter_Callback";
-  createWriter_Callback_0_(mthis) => createWriter_Callback_0(mthis);
+  createWriter_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createWriter", []);
 
-  static createWriter_Callback_1(mthis, __arg_0) native "FileEntrySync_createWriter_Callback";
-  createWriter_Callback_1_(mthis, __arg_0) => createWriter_Callback_1(mthis, __arg_0);
-
-  static createWriter_Callback_2(mthis, __arg_0, __arg_1) native "FileEntrySync_createWriter_Callback";
-  createWriter_Callback_2_(mthis, __arg_0, __arg_1) => createWriter_Callback_2(mthis, __arg_0, __arg_1);
-
-  static file_Callback_0(mthis) native "FileEntrySync_file_Callback";
-  file_Callback_0_(mthis) => file_Callback_0(mthis);
-
-  static file_Callback_1(mthis, __arg_0) native "FileEntrySync_file_Callback";
-  file_Callback_1_(mthis, __arg_0) => file_Callback_1(mthis, __arg_0);
-
-  static file_Callback_2(mthis, __arg_0, __arg_1) native "FileEntrySync_file_Callback";
-  file_Callback_2_(mthis, __arg_0, __arg_1) => file_Callback_2(mthis, __arg_0, __arg_1);
+  file_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "file", []);
 
 }
 
 class BlinkFileError extends BlinkDOMError {
   static final instance = new BlinkFileError();
 
-  static code_Getter(mthis) native "FileError_code_Getter";
-  code_Getter_(mthis) => code_Getter(mthis);
+  code_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "code");
 
 }
 
 class BlinkFileList {
   static final instance = new BlinkFileList();
 
-  static $__getter___Callback_1(mthis, __arg_0) native "FileList___getter___Callback";
-  $__getter___Callback_1_(mthis, __arg_0) => $__getter___Callback_1(mthis, __arg_0);
+  $__getter___Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "__getter__", [__arg_0]);
 
-  static item_Callback_0(mthis) native "FileList_item_Callback";
-  item_Callback_0_(mthis) => item_Callback_0(mthis);
+  item_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "item", []);
 
-  static item_Callback_1(mthis, __arg_0) native "FileList_item_Callback";
-  item_Callback_1_(mthis, __arg_0) => item_Callback_1(mthis, __arg_0);
+  item_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "item", [__arg_0]);
 
-  static item_Callback_2(mthis, __arg_0, __arg_1) native "FileList_item_Callback";
-  item_Callback_2_(mthis, __arg_0, __arg_1) => item_Callback_2(mthis, __arg_0, __arg_1);
-
-  static item_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "FileList_item_Callback";
-  item_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => item_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static length_Getter(mthis) native "FileList_length_Getter";
-  length_Getter_(mthis) => length_Getter(mthis);
+  length_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "length");
 
 }
 
 class BlinkFileReader extends BlinkEventTarget {
   static final instance = new BlinkFileReader();
 
-  static abort_Callback_0(mthis) native "FileReader_abort_Callback";
-  abort_Callback_0_(mthis) => abort_Callback_0(mthis);
+  abort_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "abort", []);
 
-  static abort_Callback_1(mthis, __arg_0) native "FileReader_abort_Callback";
-  abort_Callback_1_(mthis, __arg_0) => abort_Callback_1(mthis, __arg_0);
+  constructorCallback_0_() => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "FileReader"), []);
 
-  static abort_Callback_2(mthis, __arg_0, __arg_1) native "FileReader_abort_Callback";
-  abort_Callback_2_(mthis, __arg_0, __arg_1) => abort_Callback_2(mthis, __arg_0, __arg_1);
+  error_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "error");
 
-  static constructorCallback_0() native "FileReader_constructorCallback";
-  constructorCallback_0_() => constructorCallback_0();
+  onabort_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onabort");
 
-  static constructorCallback_1(__arg_0) native "FileReader_constructorCallback";
-  constructorCallback_1_(__arg_0) => constructorCallback_1(__arg_0);
+  onabort_Setter_(mthis, __arg_0) => mthis["onabort"] = __arg_0;
 
-  static constructorCallback_2(__arg_0, __arg_1) native "FileReader_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  onerror_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onerror");
 
-  static error_Getter(mthis) native "FileReader_error_Getter";
-  error_Getter_(mthis) => error_Getter(mthis);
+  onerror_Setter_(mthis, __arg_0) => mthis["onerror"] = __arg_0;
 
-  static onabort_Getter(mthis) native "FileReader_onabort_Getter";
-  onabort_Getter_(mthis) => onabort_Getter(mthis);
+  onload_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onload");
 
-  static onabort_Setter(mthis, __arg_0) native "FileReader_onabort_Setter";
-  onabort_Setter_(mthis, __arg_0) => onabort_Setter(mthis, __arg_0);
+  onload_Setter_(mthis, __arg_0) => mthis["onload"] = __arg_0;
 
-  static onerror_Getter(mthis) native "FileReader_onerror_Getter";
-  onerror_Getter_(mthis) => onerror_Getter(mthis);
+  onloadend_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onloadend");
 
-  static onerror_Setter(mthis, __arg_0) native "FileReader_onerror_Setter";
-  onerror_Setter_(mthis, __arg_0) => onerror_Setter(mthis, __arg_0);
+  onloadend_Setter_(mthis, __arg_0) => mthis["onloadend"] = __arg_0;
 
-  static onload_Getter(mthis) native "FileReader_onload_Getter";
-  onload_Getter_(mthis) => onload_Getter(mthis);
+  onloadstart_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onloadstart");
 
-  static onload_Setter(mthis, __arg_0) native "FileReader_onload_Setter";
-  onload_Setter_(mthis, __arg_0) => onload_Setter(mthis, __arg_0);
+  onloadstart_Setter_(mthis, __arg_0) => mthis["onloadstart"] = __arg_0;
 
-  static onloadend_Getter(mthis) native "FileReader_onloadend_Getter";
-  onloadend_Getter_(mthis) => onloadend_Getter(mthis);
+  onprogress_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onprogress");
 
-  static onloadend_Setter(mthis, __arg_0) native "FileReader_onloadend_Setter";
-  onloadend_Setter_(mthis, __arg_0) => onloadend_Setter(mthis, __arg_0);
+  onprogress_Setter_(mthis, __arg_0) => mthis["onprogress"] = __arg_0;
 
-  static onloadstart_Getter(mthis) native "FileReader_onloadstart_Getter";
-  onloadstart_Getter_(mthis) => onloadstart_Getter(mthis);
+  readAsArrayBuffer_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "readAsArrayBuffer", []);
 
-  static onloadstart_Setter(mthis, __arg_0) native "FileReader_onloadstart_Setter";
-  onloadstart_Setter_(mthis, __arg_0) => onloadstart_Setter(mthis, __arg_0);
+  readAsArrayBuffer_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "readAsArrayBuffer", [__arg_0]);
 
-  static onprogress_Getter(mthis) native "FileReader_onprogress_Getter";
-  onprogress_Getter_(mthis) => onprogress_Getter(mthis);
+  readAsBinaryString_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "readAsBinaryString", []);
 
-  static onprogress_Setter(mthis, __arg_0) native "FileReader_onprogress_Setter";
-  onprogress_Setter_(mthis, __arg_0) => onprogress_Setter(mthis, __arg_0);
+  readAsBinaryString_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "readAsBinaryString", [__arg_0]);
 
-  static readAsArrayBuffer_Callback_0(mthis) native "FileReader_readAsArrayBuffer_Callback";
-  readAsArrayBuffer_Callback_0_(mthis) => readAsArrayBuffer_Callback_0(mthis);
+  readAsDataURL_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "readAsDataURL", []);
 
-  static readAsArrayBuffer_Callback_1(mthis, __arg_0) native "FileReader_readAsArrayBuffer_Callback";
-  readAsArrayBuffer_Callback_1_(mthis, __arg_0) => readAsArrayBuffer_Callback_1(mthis, __arg_0);
+  readAsDataURL_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "readAsDataURL", [__arg_0]);
 
-  static readAsArrayBuffer_Callback_2(mthis, __arg_0, __arg_1) native "FileReader_readAsArrayBuffer_Callback";
-  readAsArrayBuffer_Callback_2_(mthis, __arg_0, __arg_1) => readAsArrayBuffer_Callback_2(mthis, __arg_0, __arg_1);
+  readAsText_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "readAsText", []);
 
-  static readAsArrayBuffer_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "FileReader_readAsArrayBuffer_Callback";
-  readAsArrayBuffer_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => readAsArrayBuffer_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  readAsText_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "readAsText", [__arg_0]);
 
-  static readAsBinaryString_Callback_0(mthis) native "FileReader_readAsBinaryString_Callback";
-  readAsBinaryString_Callback_0_(mthis) => readAsBinaryString_Callback_0(mthis);
+  readAsText_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "readAsText", [__arg_0, __arg_1]);
 
-  static readAsBinaryString_Callback_1(mthis, __arg_0) native "FileReader_readAsBinaryString_Callback";
-  readAsBinaryString_Callback_1_(mthis, __arg_0) => readAsBinaryString_Callback_1(mthis, __arg_0);
+  readyState_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "readyState");
 
-  static readAsBinaryString_Callback_2(mthis, __arg_0, __arg_1) native "FileReader_readAsBinaryString_Callback";
-  readAsBinaryString_Callback_2_(mthis, __arg_0, __arg_1) => readAsBinaryString_Callback_2(mthis, __arg_0, __arg_1);
-
-  static readAsBinaryString_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "FileReader_readAsBinaryString_Callback";
-  readAsBinaryString_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => readAsBinaryString_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static readAsDataURL_Callback_0(mthis) native "FileReader_readAsDataURL_Callback";
-  readAsDataURL_Callback_0_(mthis) => readAsDataURL_Callback_0(mthis);
-
-  static readAsDataURL_Callback_1(mthis, __arg_0) native "FileReader_readAsDataURL_Callback";
-  readAsDataURL_Callback_1_(mthis, __arg_0) => readAsDataURL_Callback_1(mthis, __arg_0);
-
-  static readAsDataURL_Callback_2(mthis, __arg_0, __arg_1) native "FileReader_readAsDataURL_Callback";
-  readAsDataURL_Callback_2_(mthis, __arg_0, __arg_1) => readAsDataURL_Callback_2(mthis, __arg_0, __arg_1);
-
-  static readAsDataURL_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "FileReader_readAsDataURL_Callback";
-  readAsDataURL_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => readAsDataURL_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static readAsText_Callback_0(mthis) native "FileReader_readAsText_Callback";
-  readAsText_Callback_0_(mthis) => readAsText_Callback_0(mthis);
-
-  static readAsText_Callback_1(mthis, __arg_0) native "FileReader_readAsText_Callback";
-  readAsText_Callback_1_(mthis, __arg_0) => readAsText_Callback_1(mthis, __arg_0);
-
-  static readAsText_Callback_2(mthis, __arg_0, __arg_1) native "FileReader_readAsText_Callback";
-  readAsText_Callback_2_(mthis, __arg_0, __arg_1) => readAsText_Callback_2(mthis, __arg_0, __arg_1);
-
-  static readAsText_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "FileReader_readAsText_Callback";
-  readAsText_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => readAsText_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static readAsText_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "FileReader_readAsText_Callback";
-  readAsText_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => readAsText_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static readyState_Getter(mthis) native "FileReader_readyState_Getter";
-  readyState_Getter_(mthis) => readyState_Getter(mthis);
-
-  static result_Getter(mthis) native "FileReader_result_Getter";
-  result_Getter_(mthis) => result_Getter(mthis);
+  result_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "result");
 
 }
 
 class BlinkFileReaderSync {
   static final instance = new BlinkFileReaderSync();
 
-  static constructorCallback_0() native "FileReaderSync_constructorCallback";
-  constructorCallback_0_() => constructorCallback_0();
+  constructorCallback_0_() => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "FileReaderSync"), []);
 
-  static constructorCallback_1(__arg_0) native "FileReaderSync_constructorCallback";
-  constructorCallback_1_(__arg_0) => constructorCallback_1(__arg_0);
+  readAsArrayBuffer_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "readAsArrayBuffer", []);
 
-  static constructorCallback_2(__arg_0, __arg_1) native "FileReaderSync_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  readAsArrayBuffer_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "readAsArrayBuffer", [__arg_0]);
 
-  static readAsArrayBuffer_Callback_0(mthis) native "FileReaderSync_readAsArrayBuffer_Callback";
-  readAsArrayBuffer_Callback_0_(mthis) => readAsArrayBuffer_Callback_0(mthis);
+  readAsBinaryString_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "readAsBinaryString", []);
 
-  static readAsArrayBuffer_Callback_1(mthis, __arg_0) native "FileReaderSync_readAsArrayBuffer_Callback";
-  readAsArrayBuffer_Callback_1_(mthis, __arg_0) => readAsArrayBuffer_Callback_1(mthis, __arg_0);
+  readAsBinaryString_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "readAsBinaryString", [__arg_0]);
 
-  static readAsArrayBuffer_Callback_2(mthis, __arg_0, __arg_1) native "FileReaderSync_readAsArrayBuffer_Callback";
-  readAsArrayBuffer_Callback_2_(mthis, __arg_0, __arg_1) => readAsArrayBuffer_Callback_2(mthis, __arg_0, __arg_1);
+  readAsDataURL_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "readAsDataURL", []);
 
-  static readAsArrayBuffer_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "FileReaderSync_readAsArrayBuffer_Callback";
-  readAsArrayBuffer_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => readAsArrayBuffer_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  readAsDataURL_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "readAsDataURL", [__arg_0]);
 
-  static readAsBinaryString_Callback_0(mthis) native "FileReaderSync_readAsBinaryString_Callback";
-  readAsBinaryString_Callback_0_(mthis) => readAsBinaryString_Callback_0(mthis);
+  readAsText_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "readAsText", []);
 
-  static readAsBinaryString_Callback_1(mthis, __arg_0) native "FileReaderSync_readAsBinaryString_Callback";
-  readAsBinaryString_Callback_1_(mthis, __arg_0) => readAsBinaryString_Callback_1(mthis, __arg_0);
+  readAsText_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "readAsText", [__arg_0]);
 
-  static readAsBinaryString_Callback_2(mthis, __arg_0, __arg_1) native "FileReaderSync_readAsBinaryString_Callback";
-  readAsBinaryString_Callback_2_(mthis, __arg_0, __arg_1) => readAsBinaryString_Callback_2(mthis, __arg_0, __arg_1);
-
-  static readAsBinaryString_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "FileReaderSync_readAsBinaryString_Callback";
-  readAsBinaryString_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => readAsBinaryString_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static readAsDataURL_Callback_0(mthis) native "FileReaderSync_readAsDataURL_Callback";
-  readAsDataURL_Callback_0_(mthis) => readAsDataURL_Callback_0(mthis);
-
-  static readAsDataURL_Callback_1(mthis, __arg_0) native "FileReaderSync_readAsDataURL_Callback";
-  readAsDataURL_Callback_1_(mthis, __arg_0) => readAsDataURL_Callback_1(mthis, __arg_0);
-
-  static readAsDataURL_Callback_2(mthis, __arg_0, __arg_1) native "FileReaderSync_readAsDataURL_Callback";
-  readAsDataURL_Callback_2_(mthis, __arg_0, __arg_1) => readAsDataURL_Callback_2(mthis, __arg_0, __arg_1);
-
-  static readAsDataURL_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "FileReaderSync_readAsDataURL_Callback";
-  readAsDataURL_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => readAsDataURL_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static readAsText_Callback_0(mthis) native "FileReaderSync_readAsText_Callback";
-  readAsText_Callback_0_(mthis) => readAsText_Callback_0(mthis);
-
-  static readAsText_Callback_1(mthis, __arg_0) native "FileReaderSync_readAsText_Callback";
-  readAsText_Callback_1_(mthis, __arg_0) => readAsText_Callback_1(mthis, __arg_0);
-
-  static readAsText_Callback_2(mthis, __arg_0, __arg_1) native "FileReaderSync_readAsText_Callback";
-  readAsText_Callback_2_(mthis, __arg_0, __arg_1) => readAsText_Callback_2(mthis, __arg_0, __arg_1);
-
-  static readAsText_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "FileReaderSync_readAsText_Callback";
-  readAsText_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => readAsText_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static readAsText_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "FileReaderSync_readAsText_Callback";
-  readAsText_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => readAsText_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  readAsText_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "readAsText", [__arg_0, __arg_1]);
 
 }
 
 class BlinkFileWriter extends BlinkEventTarget {
   static final instance = new BlinkFileWriter();
 
-  static abort_Callback_0(mthis) native "FileWriter_abort_Callback";
-  abort_Callback_0_(mthis) => abort_Callback_0(mthis);
+  abort_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "abort", []);
 
-  static abort_Callback_1(mthis, __arg_0) native "FileWriter_abort_Callback";
-  abort_Callback_1_(mthis, __arg_0) => abort_Callback_1(mthis, __arg_0);
+  error_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "error");
 
-  static abort_Callback_2(mthis, __arg_0, __arg_1) native "FileWriter_abort_Callback";
-  abort_Callback_2_(mthis, __arg_0, __arg_1) => abort_Callback_2(mthis, __arg_0, __arg_1);
+  length_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "length");
 
-  static error_Getter(mthis) native "FileWriter_error_Getter";
-  error_Getter_(mthis) => error_Getter(mthis);
+  onabort_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onabort");
 
-  static length_Getter(mthis) native "FileWriter_length_Getter";
-  length_Getter_(mthis) => length_Getter(mthis);
+  onabort_Setter_(mthis, __arg_0) => mthis["onabort"] = __arg_0;
 
-  static onabort_Getter(mthis) native "FileWriter_onabort_Getter";
-  onabort_Getter_(mthis) => onabort_Getter(mthis);
+  onerror_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onerror");
 
-  static onabort_Setter(mthis, __arg_0) native "FileWriter_onabort_Setter";
-  onabort_Setter_(mthis, __arg_0) => onabort_Setter(mthis, __arg_0);
+  onerror_Setter_(mthis, __arg_0) => mthis["onerror"] = __arg_0;
 
-  static onerror_Getter(mthis) native "FileWriter_onerror_Getter";
-  onerror_Getter_(mthis) => onerror_Getter(mthis);
+  onprogress_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onprogress");
 
-  static onerror_Setter(mthis, __arg_0) native "FileWriter_onerror_Setter";
-  onerror_Setter_(mthis, __arg_0) => onerror_Setter(mthis, __arg_0);
+  onprogress_Setter_(mthis, __arg_0) => mthis["onprogress"] = __arg_0;
 
-  static onprogress_Getter(mthis) native "FileWriter_onprogress_Getter";
-  onprogress_Getter_(mthis) => onprogress_Getter(mthis);
+  onwrite_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onwrite");
 
-  static onprogress_Setter(mthis, __arg_0) native "FileWriter_onprogress_Setter";
-  onprogress_Setter_(mthis, __arg_0) => onprogress_Setter(mthis, __arg_0);
+  onwrite_Setter_(mthis, __arg_0) => mthis["onwrite"] = __arg_0;
 
-  static onwrite_Getter(mthis) native "FileWriter_onwrite_Getter";
-  onwrite_Getter_(mthis) => onwrite_Getter(mthis);
+  onwriteend_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onwriteend");
 
-  static onwrite_Setter(mthis, __arg_0) native "FileWriter_onwrite_Setter";
-  onwrite_Setter_(mthis, __arg_0) => onwrite_Setter(mthis, __arg_0);
+  onwriteend_Setter_(mthis, __arg_0) => mthis["onwriteend"] = __arg_0;
 
-  static onwriteend_Getter(mthis) native "FileWriter_onwriteend_Getter";
-  onwriteend_Getter_(mthis) => onwriteend_Getter(mthis);
+  onwritestart_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onwritestart");
 
-  static onwriteend_Setter(mthis, __arg_0) native "FileWriter_onwriteend_Setter";
-  onwriteend_Setter_(mthis, __arg_0) => onwriteend_Setter(mthis, __arg_0);
+  onwritestart_Setter_(mthis, __arg_0) => mthis["onwritestart"] = __arg_0;
 
-  static onwritestart_Getter(mthis) native "FileWriter_onwritestart_Getter";
-  onwritestart_Getter_(mthis) => onwritestart_Getter(mthis);
+  position_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "position");
 
-  static onwritestart_Setter(mthis, __arg_0) native "FileWriter_onwritestart_Setter";
-  onwritestart_Setter_(mthis, __arg_0) => onwritestart_Setter(mthis, __arg_0);
+  readyState_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "readyState");
 
-  static position_Getter(mthis) native "FileWriter_position_Getter";
-  position_Getter_(mthis) => position_Getter(mthis);
+  seek_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "seek", []);
 
-  static readyState_Getter(mthis) native "FileWriter_readyState_Getter";
-  readyState_Getter_(mthis) => readyState_Getter(mthis);
+  seek_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "seek", [__arg_0]);
 
-  static seek_Callback_0(mthis) native "FileWriter_seek_Callback";
-  seek_Callback_0_(mthis) => seek_Callback_0(mthis);
+  truncate_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "truncate", []);
 
-  static seek_Callback_1(mthis, __arg_0) native "FileWriter_seek_Callback";
-  seek_Callback_1_(mthis, __arg_0) => seek_Callback_1(mthis, __arg_0);
+  truncate_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "truncate", [__arg_0]);
 
-  static seek_Callback_2(mthis, __arg_0, __arg_1) native "FileWriter_seek_Callback";
-  seek_Callback_2_(mthis, __arg_0, __arg_1) => seek_Callback_2(mthis, __arg_0, __arg_1);
+  write_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "write", []);
 
-  static seek_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "FileWriter_seek_Callback";
-  seek_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => seek_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static truncate_Callback_0(mthis) native "FileWriter_truncate_Callback";
-  truncate_Callback_0_(mthis) => truncate_Callback_0(mthis);
-
-  static truncate_Callback_1(mthis, __arg_0) native "FileWriter_truncate_Callback";
-  truncate_Callback_1_(mthis, __arg_0) => truncate_Callback_1(mthis, __arg_0);
-
-  static truncate_Callback_2(mthis, __arg_0, __arg_1) native "FileWriter_truncate_Callback";
-  truncate_Callback_2_(mthis, __arg_0, __arg_1) => truncate_Callback_2(mthis, __arg_0, __arg_1);
-
-  static truncate_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "FileWriter_truncate_Callback";
-  truncate_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => truncate_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static write_Callback_0(mthis) native "FileWriter_write_Callback";
-  write_Callback_0_(mthis) => write_Callback_0(mthis);
-
-  static write_Callback_1(mthis, __arg_0) native "FileWriter_write_Callback";
-  write_Callback_1_(mthis, __arg_0) => write_Callback_1(mthis, __arg_0);
-
-  static write_Callback_2(mthis, __arg_0, __arg_1) native "FileWriter_write_Callback";
-  write_Callback_2_(mthis, __arg_0, __arg_1) => write_Callback_2(mthis, __arg_0, __arg_1);
-
-  static write_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "FileWriter_write_Callback";
-  write_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => write_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  write_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "write", [__arg_0]);
 
 }
 
 class BlinkFileWriterSync {
   static final instance = new BlinkFileWriterSync();
 
-  static length_Getter(mthis) native "FileWriterSync_length_Getter";
-  length_Getter_(mthis) => length_Getter(mthis);
+  length_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "length");
 
-  static position_Getter(mthis) native "FileWriterSync_position_Getter";
-  position_Getter_(mthis) => position_Getter(mthis);
+  position_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "position");
 
-  static seek_Callback_0(mthis) native "FileWriterSync_seek_Callback";
-  seek_Callback_0_(mthis) => seek_Callback_0(mthis);
+  seek_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "seek", []);
 
-  static seek_Callback_1(mthis, __arg_0) native "FileWriterSync_seek_Callback";
-  seek_Callback_1_(mthis, __arg_0) => seek_Callback_1(mthis, __arg_0);
+  seek_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "seek", [__arg_0]);
 
-  static seek_Callback_2(mthis, __arg_0, __arg_1) native "FileWriterSync_seek_Callback";
-  seek_Callback_2_(mthis, __arg_0, __arg_1) => seek_Callback_2(mthis, __arg_0, __arg_1);
+  truncate_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "truncate", []);
 
-  static seek_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "FileWriterSync_seek_Callback";
-  seek_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => seek_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  truncate_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "truncate", [__arg_0]);
 
-  static truncate_Callback_0(mthis) native "FileWriterSync_truncate_Callback";
-  truncate_Callback_0_(mthis) => truncate_Callback_0(mthis);
+  write_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "write", []);
 
-  static truncate_Callback_1(mthis, __arg_0) native "FileWriterSync_truncate_Callback";
-  truncate_Callback_1_(mthis, __arg_0) => truncate_Callback_1(mthis, __arg_0);
-
-  static truncate_Callback_2(mthis, __arg_0, __arg_1) native "FileWriterSync_truncate_Callback";
-  truncate_Callback_2_(mthis, __arg_0, __arg_1) => truncate_Callback_2(mthis, __arg_0, __arg_1);
-
-  static truncate_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "FileWriterSync_truncate_Callback";
-  truncate_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => truncate_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static write_Callback_0(mthis) native "FileWriterSync_write_Callback";
-  write_Callback_0_(mthis) => write_Callback_0(mthis);
-
-  static write_Callback_1(mthis, __arg_0) native "FileWriterSync_write_Callback";
-  write_Callback_1_(mthis, __arg_0) => write_Callback_1(mthis, __arg_0);
-
-  static write_Callback_2(mthis, __arg_0, __arg_1) native "FileWriterSync_write_Callback";
-  write_Callback_2_(mthis, __arg_0, __arg_1) => write_Callback_2(mthis, __arg_0, __arg_1);
-
-  static write_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "FileWriterSync_write_Callback";
-  write_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => write_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  write_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "write", [__arg_0]);
 
 }
 
 class BlinkFocusEvent extends BlinkUIEvent {
   static final instance = new BlinkFocusEvent();
 
-  static constructorCallback_2(__arg_0, __arg_1) native "FocusEvent_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  constructorCallback_2_(__arg_0, __arg_1) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "FocusEvent"), [__arg_0, __arg_1]);
 
-  static relatedTarget_Getter(mthis) native "FocusEvent_relatedTarget_Getter";
-  relatedTarget_Getter_(mthis) => relatedTarget_Getter(mthis);
+  relatedTarget_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "relatedTarget");
 
 }
 
 class BlinkFontFace {
   static final instance = new BlinkFontFace();
 
-  static constructorCallback_0() native "FontFace_constructorCallback";
-  constructorCallback_0_() => constructorCallback_0();
+  constructorCallback_0_() => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "FontFace"), []);
 
-  static constructorCallback_1(__arg_0) native "FontFace_constructorCallback";
-  constructorCallback_1_(__arg_0) => constructorCallback_1(__arg_0);
+  constructorCallback_1_(__arg_0) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "FontFace"), [__arg_0]);
 
-  static constructorCallback_2(__arg_0, __arg_1) native "FontFace_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  constructorCallback_2_(__arg_0, __arg_1) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "FontFace"), [__arg_0, __arg_1]);
 
-  static constructorCallback_3(__arg_0, __arg_1, __arg_2) native "FontFace_constructorCallback";
-  constructorCallback_3_(__arg_0, __arg_1, __arg_2) => constructorCallback_3(__arg_0, __arg_1, __arg_2);
+  constructorCallback_3_(__arg_0, __arg_1, __arg_2) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "FontFace"), [__arg_0, __arg_1, __arg_2]);
 
-  static constructorCallback_4(__arg_0, __arg_1, __arg_2, __arg_3) native "FontFace_constructorCallback";
-  constructorCallback_4_(__arg_0, __arg_1, __arg_2, __arg_3) => constructorCallback_4(__arg_0, __arg_1, __arg_2, __arg_3);
+  family_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "family");
 
-  static constructorCallback_5(__arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "FontFace_constructorCallback";
-  constructorCallback_5_(__arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => constructorCallback_5(__arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  family_Setter_(mthis, __arg_0) => mthis["family"] = __arg_0;
 
-  static family_Getter(mthis) native "FontFace_family_Getter";
-  family_Getter_(mthis) => family_Getter(mthis);
+  featureSettings_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "featureSettings");
 
-  static family_Setter(mthis, __arg_0) native "FontFace_family_Setter";
-  family_Setter_(mthis, __arg_0) => family_Setter(mthis, __arg_0);
+  featureSettings_Setter_(mthis, __arg_0) => mthis["featureSettings"] = __arg_0;
 
-  static featureSettings_Getter(mthis) native "FontFace_featureSettings_Getter";
-  featureSettings_Getter_(mthis) => featureSettings_Getter(mthis);
+  load_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "load", []);
 
-  static featureSettings_Setter(mthis, __arg_0) native "FontFace_featureSettings_Setter";
-  featureSettings_Setter_(mthis, __arg_0) => featureSettings_Setter(mthis, __arg_0);
+  loaded_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "loaded");
 
-  static load_Callback_0(mthis) native "FontFace_load_Callback";
-  load_Callback_0_(mthis) => load_Callback_0(mthis);
+  status_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "status");
 
-  static load_Callback_1(mthis, __arg_0) native "FontFace_load_Callback";
-  load_Callback_1_(mthis, __arg_0) => load_Callback_1(mthis, __arg_0);
+  stretch_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "stretch");
 
-  static load_Callback_2(mthis, __arg_0, __arg_1) native "FontFace_load_Callback";
-  load_Callback_2_(mthis, __arg_0, __arg_1) => load_Callback_2(mthis, __arg_0, __arg_1);
+  stretch_Setter_(mthis, __arg_0) => mthis["stretch"] = __arg_0;
 
-  static loaded_Getter(mthis) native "FontFace_loaded_Getter";
-  loaded_Getter_(mthis) => loaded_Getter(mthis);
+  style_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "style");
 
-  static status_Getter(mthis) native "FontFace_status_Getter";
-  status_Getter_(mthis) => status_Getter(mthis);
+  style_Setter_(mthis, __arg_0) => mthis["style"] = __arg_0;
 
-  static stretch_Getter(mthis) native "FontFace_stretch_Getter";
-  stretch_Getter_(mthis) => stretch_Getter(mthis);
+  unicodeRange_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "unicodeRange");
 
-  static stretch_Setter(mthis, __arg_0) native "FontFace_stretch_Setter";
-  stretch_Setter_(mthis, __arg_0) => stretch_Setter(mthis, __arg_0);
+  unicodeRange_Setter_(mthis, __arg_0) => mthis["unicodeRange"] = __arg_0;
 
-  static style_Getter(mthis) native "FontFace_style_Getter";
-  style_Getter_(mthis) => style_Getter(mthis);
+  variant_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "variant");
 
-  static style_Setter(mthis, __arg_0) native "FontFace_style_Setter";
-  style_Setter_(mthis, __arg_0) => style_Setter(mthis, __arg_0);
+  variant_Setter_(mthis, __arg_0) => mthis["variant"] = __arg_0;
 
-  static unicodeRange_Getter(mthis) native "FontFace_unicodeRange_Getter";
-  unicodeRange_Getter_(mthis) => unicodeRange_Getter(mthis);
+  weight_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "weight");
 
-  static unicodeRange_Setter(mthis, __arg_0) native "FontFace_unicodeRange_Setter";
-  unicodeRange_Setter_(mthis, __arg_0) => unicodeRange_Setter(mthis, __arg_0);
-
-  static variant_Getter(mthis) native "FontFace_variant_Getter";
-  variant_Getter_(mthis) => variant_Getter(mthis);
-
-  static variant_Setter(mthis, __arg_0) native "FontFace_variant_Setter";
-  variant_Setter_(mthis, __arg_0) => variant_Setter(mthis, __arg_0);
-
-  static weight_Getter(mthis) native "FontFace_weight_Getter";
-  weight_Getter_(mthis) => weight_Getter(mthis);
-
-  static weight_Setter(mthis, __arg_0) native "FontFace_weight_Setter";
-  weight_Setter_(mthis, __arg_0) => weight_Setter(mthis, __arg_0);
+  weight_Setter_(mthis, __arg_0) => mthis["weight"] = __arg_0;
 
 }
 
 class BlinkFontFaceSet extends BlinkEventTarget {
   static final instance = new BlinkFontFaceSet();
 
-  static add_Callback_0(mthis) native "FontFaceSet_add_Callback";
-  add_Callback_0_(mthis) => add_Callback_0(mthis);
+  add_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "add", []);
 
-  static add_Callback_1(mthis, __arg_0) native "FontFaceSet_add_Callback";
-  add_Callback_1_(mthis, __arg_0) => add_Callback_1(mthis, __arg_0);
+  add_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "add", [__arg_0]);
 
-  static add_Callback_2(mthis, __arg_0, __arg_1) native "FontFaceSet_add_Callback";
-  add_Callback_2_(mthis, __arg_0, __arg_1) => add_Callback_2(mthis, __arg_0, __arg_1);
+  check_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "check", []);
 
-  static add_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "FontFaceSet_add_Callback";
-  add_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => add_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  check_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "check", [__arg_0]);
 
-  static check_Callback_0(mthis) native "FontFaceSet_check_Callback";
-  check_Callback_0_(mthis) => check_Callback_0(mthis);
+  check_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "check", [__arg_0, __arg_1]);
 
-  static check_Callback_1(mthis, __arg_0) native "FontFaceSet_check_Callback";
-  check_Callback_1_(mthis, __arg_0) => check_Callback_1(mthis, __arg_0);
+  clear_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "clear", []);
 
-  static check_Callback_2(mthis, __arg_0, __arg_1) native "FontFaceSet_check_Callback";
-  check_Callback_2_(mthis, __arg_0, __arg_1) => check_Callback_2(mthis, __arg_0, __arg_1);
+  delete_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "delete", []);
 
-  static check_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "FontFaceSet_check_Callback";
-  check_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => check_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  delete_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "delete", [__arg_0]);
 
-  static check_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "FontFaceSet_check_Callback";
-  check_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => check_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  forEach_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "forEach", []);
 
-  static clear_Callback_0(mthis) native "FontFaceSet_clear_Callback";
-  clear_Callback_0_(mthis) => clear_Callback_0(mthis);
+  forEach_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "forEach", [__arg_0]);
 
-  static clear_Callback_1(mthis, __arg_0) native "FontFaceSet_clear_Callback";
-  clear_Callback_1_(mthis, __arg_0) => clear_Callback_1(mthis, __arg_0);
+  forEach_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "forEach", [__arg_0, __arg_1]);
 
-  static clear_Callback_2(mthis, __arg_0, __arg_1) native "FontFaceSet_clear_Callback";
-  clear_Callback_2_(mthis, __arg_0, __arg_1) => clear_Callback_2(mthis, __arg_0, __arg_1);
+  has_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "has", []);
 
-  static delete_Callback_0(mthis) native "FontFaceSet_delete_Callback";
-  delete_Callback_0_(mthis) => delete_Callback_0(mthis);
+  has_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "has", [__arg_0]);
 
-  static delete_Callback_1(mthis, __arg_0) native "FontFaceSet_delete_Callback";
-  delete_Callback_1_(mthis, __arg_0) => delete_Callback_1(mthis, __arg_0);
+  onloading_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onloading");
 
-  static delete_Callback_2(mthis, __arg_0, __arg_1) native "FontFaceSet_delete_Callback";
-  delete_Callback_2_(mthis, __arg_0, __arg_1) => delete_Callback_2(mthis, __arg_0, __arg_1);
+  onloading_Setter_(mthis, __arg_0) => mthis["onloading"] = __arg_0;
 
-  static delete_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "FontFaceSet_delete_Callback";
-  delete_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => delete_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  onloadingdone_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onloadingdone");
 
-  static forEach_Callback_0(mthis) native "FontFaceSet_forEach_Callback";
-  forEach_Callback_0_(mthis) => forEach_Callback_0(mthis);
+  onloadingdone_Setter_(mthis, __arg_0) => mthis["onloadingdone"] = __arg_0;
 
-  static forEach_Callback_1(mthis, __arg_0) native "FontFaceSet_forEach_Callback";
-  forEach_Callback_1_(mthis, __arg_0) => forEach_Callback_1(mthis, __arg_0);
+  onloadingerror_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onloadingerror");
 
-  static forEach_Callback_2(mthis, __arg_0, __arg_1) native "FontFaceSet_forEach_Callback";
-  forEach_Callback_2_(mthis, __arg_0, __arg_1) => forEach_Callback_2(mthis, __arg_0, __arg_1);
+  onloadingerror_Setter_(mthis, __arg_0) => mthis["onloadingerror"] = __arg_0;
 
-  static forEach_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "FontFaceSet_forEach_Callback";
-  forEach_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => forEach_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  size_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "size");
 
-  static forEach_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "FontFaceSet_forEach_Callback";
-  forEach_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => forEach_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static has_Callback_0(mthis) native "FontFaceSet_has_Callback";
-  has_Callback_0_(mthis) => has_Callback_0(mthis);
-
-  static has_Callback_1(mthis, __arg_0) native "FontFaceSet_has_Callback";
-  has_Callback_1_(mthis, __arg_0) => has_Callback_1(mthis, __arg_0);
-
-  static has_Callback_2(mthis, __arg_0, __arg_1) native "FontFaceSet_has_Callback";
-  has_Callback_2_(mthis, __arg_0, __arg_1) => has_Callback_2(mthis, __arg_0, __arg_1);
-
-  static has_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "FontFaceSet_has_Callback";
-  has_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => has_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static onloading_Getter(mthis) native "FontFaceSet_onloading_Getter";
-  onloading_Getter_(mthis) => onloading_Getter(mthis);
-
-  static onloading_Setter(mthis, __arg_0) native "FontFaceSet_onloading_Setter";
-  onloading_Setter_(mthis, __arg_0) => onloading_Setter(mthis, __arg_0);
-
-  static onloadingdone_Getter(mthis) native "FontFaceSet_onloadingdone_Getter";
-  onloadingdone_Getter_(mthis) => onloadingdone_Getter(mthis);
-
-  static onloadingdone_Setter(mthis, __arg_0) native "FontFaceSet_onloadingdone_Setter";
-  onloadingdone_Setter_(mthis, __arg_0) => onloadingdone_Setter(mthis, __arg_0);
-
-  static onloadingerror_Getter(mthis) native "FontFaceSet_onloadingerror_Getter";
-  onloadingerror_Getter_(mthis) => onloadingerror_Getter(mthis);
-
-  static onloadingerror_Setter(mthis, __arg_0) native "FontFaceSet_onloadingerror_Setter";
-  onloadingerror_Setter_(mthis, __arg_0) => onloadingerror_Setter(mthis, __arg_0);
-
-  static size_Getter(mthis) native "FontFaceSet_size_Getter";
-  size_Getter_(mthis) => size_Getter(mthis);
-
-  static status_Getter(mthis) native "FontFaceSet_status_Getter";
-  status_Getter_(mthis) => status_Getter(mthis);
+  status_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "status");
 
 }
 
 class BlinkFontFaceSetLoadEvent extends BlinkEvent {
   static final instance = new BlinkFontFaceSetLoadEvent();
 
-  static fontfaces_Getter(mthis) native "FontFaceSetLoadEvent_fontfaces_Getter";
-  fontfaces_Getter_(mthis) => fontfaces_Getter(mthis);
+  fontfaces_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "fontfaces");
 
 }
 
 class BlinkFormData {
   static final instance = new BlinkFormData();
 
-  static append_Callback_0(mthis) native "FormData_append_Callback";
-  append_Callback_0_(mthis) => append_Callback_0(mthis);
+  append_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "append", []);
 
-  static append_Callback_1(mthis, __arg_0) native "FormData_append_Callback";
-  append_Callback_1_(mthis, __arg_0) => append_Callback_1(mthis, __arg_0);
+  append_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "append", [__arg_0]);
 
-  static append_Callback_2(mthis, __arg_0, __arg_1) native "FormData_append_Callback";
-  append_Callback_2_(mthis, __arg_0, __arg_1) => append_Callback_2(mthis, __arg_0, __arg_1);
+  append_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "append", [__arg_0, __arg_1]);
 
-  static append_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "FormData_append_Callback";
-  append_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => append_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  append_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "append", [__arg_0, __arg_1, __arg_2]);
 
-  static append_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "FormData_append_Callback";
-  append_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => append_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  constructorCallback_0_() => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "FormData"), []);
 
-  static append_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "FormData_append_Callback";
-  append_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => append_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
-
-  static constructorCallback_0() native "FormData_constructorCallback";
-  constructorCallback_0_() => constructorCallback_0();
-
-  static constructorCallback_1(__arg_0) native "FormData_constructorCallback";
-  constructorCallback_1_(__arg_0) => constructorCallback_1(__arg_0);
-
-  static constructorCallback_2(__arg_0, __arg_1) native "FormData_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
-
-  static constructorCallback_3(__arg_0, __arg_1, __arg_2) native "FormData_constructorCallback";
-  constructorCallback_3_(__arg_0, __arg_1, __arg_2) => constructorCallback_3(__arg_0, __arg_1, __arg_2);
+  constructorCallback_1_(__arg_0) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "FormData"), [__arg_0]);
 
 }
 
 class BlinkGainNode extends BlinkAudioNode {
   static final instance = new BlinkGainNode();
 
-  static gain_Getter(mthis) native "GainNode_gain_Getter";
-  gain_Getter_(mthis) => gain_Getter(mthis);
+  gain_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "gain");
 
 }
 
 class BlinkGamepad {
   static final instance = new BlinkGamepad();
 
-  static axes_Getter(mthis) native "Gamepad_axes_Getter";
-  axes_Getter_(mthis) => axes_Getter(mthis);
+  axes_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "axes");
 
-  static connected_Getter(mthis) native "Gamepad_connected_Getter";
-  connected_Getter_(mthis) => connected_Getter(mthis);
+  connected_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "connected");
 
-  static id_Getter(mthis) native "Gamepad_id_Getter";
-  id_Getter_(mthis) => id_Getter(mthis);
+  id_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "id");
 
-  static index_Getter(mthis) native "Gamepad_index_Getter";
-  index_Getter_(mthis) => index_Getter(mthis);
+  index_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "index");
 
-  static mapping_Getter(mthis) native "Gamepad_mapping_Getter";
-  mapping_Getter_(mthis) => mapping_Getter(mthis);
+  mapping_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "mapping");
 
-  static timestamp_Getter(mthis) native "Gamepad_timestamp_Getter";
-  timestamp_Getter_(mthis) => timestamp_Getter(mthis);
+  timestamp_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "timestamp");
 
 }
 
 class BlinkGamepadButton {
   static final instance = new BlinkGamepadButton();
 
-  static pressed_Getter(mthis) native "GamepadButton_pressed_Getter";
-  pressed_Getter_(mthis) => pressed_Getter(mthis);
+  pressed_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "pressed");
 
-  static value_Getter(mthis) native "GamepadButton_value_Getter";
-  value_Getter_(mthis) => value_Getter(mthis);
+  value_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "value");
 
 }
 
 class BlinkGamepadEvent extends BlinkEvent {
   static final instance = new BlinkGamepadEvent();
 
-  static constructorCallback_2(__arg_0, __arg_1) native "GamepadEvent_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  constructorCallback_2_(__arg_0, __arg_1) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "GamepadEvent"), [__arg_0, __arg_1]);
 
-  static gamepad_Getter(mthis) native "GamepadEvent_gamepad_Getter";
-  gamepad_Getter_(mthis) => gamepad_Getter(mthis);
+  gamepad_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "gamepad");
 
 }
 
 class BlinkGamepadList {
   static final instance = new BlinkGamepadList();
 
-  static $__getter___Callback_1(mthis, __arg_0) native "GamepadList___getter___Callback";
-  $__getter___Callback_1_(mthis, __arg_0) => $__getter___Callback_1(mthis, __arg_0);
+  $__getter___Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "__getter__", [__arg_0]);
 
-  static item_Callback_0(mthis) native "GamepadList_item_Callback";
-  item_Callback_0_(mthis) => item_Callback_0(mthis);
+  item_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "item", []);
 
-  static item_Callback_1(mthis, __arg_0) native "GamepadList_item_Callback";
-  item_Callback_1_(mthis, __arg_0) => item_Callback_1(mthis, __arg_0);
+  item_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "item", [__arg_0]);
 
-  static item_Callback_2(mthis, __arg_0, __arg_1) native "GamepadList_item_Callback";
-  item_Callback_2_(mthis, __arg_0, __arg_1) => item_Callback_2(mthis, __arg_0, __arg_1);
-
-  static item_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "GamepadList_item_Callback";
-  item_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => item_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static length_Getter(mthis) native "GamepadList_length_Getter";
-  length_Getter_(mthis) => length_Getter(mthis);
+  length_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "length");
 
 }
 
 class BlinkGeofencing {
   static final instance = new BlinkGeofencing();
 
-  static getRegisteredRegions_Callback_0(mthis) native "Geofencing_getRegisteredRegions_Callback";
-  getRegisteredRegions_Callback_0_(mthis) => getRegisteredRegions_Callback_0(mthis);
+  getRegisteredRegions_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getRegisteredRegions", []);
 
-  static getRegisteredRegions_Callback_1(mthis, __arg_0) native "Geofencing_getRegisteredRegions_Callback";
-  getRegisteredRegions_Callback_1_(mthis, __arg_0) => getRegisteredRegions_Callback_1(mthis, __arg_0);
+  registerRegion_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "registerRegion", []);
 
-  static getRegisteredRegions_Callback_2(mthis, __arg_0, __arg_1) native "Geofencing_getRegisteredRegions_Callback";
-  getRegisteredRegions_Callback_2_(mthis, __arg_0, __arg_1) => getRegisteredRegions_Callback_2(mthis, __arg_0, __arg_1);
+  registerRegion_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "registerRegion", [__arg_0]);
 
-  static registerRegion_Callback_0(mthis) native "Geofencing_registerRegion_Callback";
-  registerRegion_Callback_0_(mthis) => registerRegion_Callback_0(mthis);
+  unregisterRegion_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "unregisterRegion", []);
 
-  static registerRegion_Callback_1(mthis, __arg_0) native "Geofencing_registerRegion_Callback";
-  registerRegion_Callback_1_(mthis, __arg_0) => registerRegion_Callback_1(mthis, __arg_0);
-
-  static registerRegion_Callback_2(mthis, __arg_0, __arg_1) native "Geofencing_registerRegion_Callback";
-  registerRegion_Callback_2_(mthis, __arg_0, __arg_1) => registerRegion_Callback_2(mthis, __arg_0, __arg_1);
-
-  static registerRegion_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Geofencing_registerRegion_Callback";
-  registerRegion_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => registerRegion_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static unregisterRegion_Callback_0(mthis) native "Geofencing_unregisterRegion_Callback";
-  unregisterRegion_Callback_0_(mthis) => unregisterRegion_Callback_0(mthis);
-
-  static unregisterRegion_Callback_1(mthis, __arg_0) native "Geofencing_unregisterRegion_Callback";
-  unregisterRegion_Callback_1_(mthis, __arg_0) => unregisterRegion_Callback_1(mthis, __arg_0);
-
-  static unregisterRegion_Callback_2(mthis, __arg_0, __arg_1) native "Geofencing_unregisterRegion_Callback";
-  unregisterRegion_Callback_2_(mthis, __arg_0, __arg_1) => unregisterRegion_Callback_2(mthis, __arg_0, __arg_1);
-
-  static unregisterRegion_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Geofencing_unregisterRegion_Callback";
-  unregisterRegion_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => unregisterRegion_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  unregisterRegion_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "unregisterRegion", [__arg_0]);
 
 }
 
 class BlinkGeofencingRegion {
   static final instance = new BlinkGeofencingRegion();
 
-  static id_Getter(mthis) native "GeofencingRegion_id_Getter";
-  id_Getter_(mthis) => id_Getter(mthis);
+  id_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "id");
 
 }
 
 class BlinkGeolocation {
   static final instance = new BlinkGeolocation();
 
-  static clearWatch_Callback_0(mthis) native "Geolocation_clearWatch_Callback";
-  clearWatch_Callback_0_(mthis) => clearWatch_Callback_0(mthis);
+  clearWatch_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "clearWatch", []);
 
-  static clearWatch_Callback_1(mthis, __arg_0) native "Geolocation_clearWatch_Callback";
-  clearWatch_Callback_1_(mthis, __arg_0) => clearWatch_Callback_1(mthis, __arg_0);
+  clearWatch_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "clearWatch", [__arg_0]);
 
-  static clearWatch_Callback_2(mthis, __arg_0, __arg_1) native "Geolocation_clearWatch_Callback";
-  clearWatch_Callback_2_(mthis, __arg_0, __arg_1) => clearWatch_Callback_2(mthis, __arg_0, __arg_1);
+  getCurrentPosition_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getCurrentPosition", []);
 
-  static clearWatch_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Geolocation_clearWatch_Callback";
-  clearWatch_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => clearWatch_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  getCurrentPosition_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getCurrentPosition", [__arg_0]);
 
-  static getCurrentPosition_Callback_0(mthis) native "Geolocation_getCurrentPosition_Callback";
-  getCurrentPosition_Callback_0_(mthis) => getCurrentPosition_Callback_0(mthis);
+  getCurrentPosition_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "getCurrentPosition", [__arg_0, __arg_1]);
 
-  static getCurrentPosition_Callback_1(mthis, __arg_0) native "Geolocation_getCurrentPosition_Callback";
-  getCurrentPosition_Callback_1_(mthis, __arg_0) => getCurrentPosition_Callback_1(mthis, __arg_0);
+  getCurrentPosition_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "getCurrentPosition", [__arg_0, __arg_1, __arg_2]);
 
-  static getCurrentPosition_Callback_2(mthis, __arg_0, __arg_1) native "Geolocation_getCurrentPosition_Callback";
-  getCurrentPosition_Callback_2_(mthis, __arg_0, __arg_1) => getCurrentPosition_Callback_2(mthis, __arg_0, __arg_1);
+  watchPosition_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "watchPosition", []);
 
-  static getCurrentPosition_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Geolocation_getCurrentPosition_Callback";
-  getCurrentPosition_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getCurrentPosition_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  watchPosition_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "watchPosition", [__arg_0]);
 
-  static getCurrentPosition_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Geolocation_getCurrentPosition_Callback";
-  getCurrentPosition_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => getCurrentPosition_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  watchPosition_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "watchPosition", [__arg_0, __arg_1]);
 
-  static getCurrentPosition_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "Geolocation_getCurrentPosition_Callback";
-  getCurrentPosition_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => getCurrentPosition_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
-
-  static watchPosition_Callback_0(mthis) native "Geolocation_watchPosition_Callback";
-  watchPosition_Callback_0_(mthis) => watchPosition_Callback_0(mthis);
-
-  static watchPosition_Callback_1(mthis, __arg_0) native "Geolocation_watchPosition_Callback";
-  watchPosition_Callback_1_(mthis, __arg_0) => watchPosition_Callback_1(mthis, __arg_0);
-
-  static watchPosition_Callback_2(mthis, __arg_0, __arg_1) native "Geolocation_watchPosition_Callback";
-  watchPosition_Callback_2_(mthis, __arg_0, __arg_1) => watchPosition_Callback_2(mthis, __arg_0, __arg_1);
-
-  static watchPosition_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Geolocation_watchPosition_Callback";
-  watchPosition_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => watchPosition_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static watchPosition_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Geolocation_watchPosition_Callback";
-  watchPosition_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => watchPosition_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static watchPosition_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "Geolocation_watchPosition_Callback";
-  watchPosition_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => watchPosition_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  watchPosition_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "watchPosition", [__arg_0, __arg_1, __arg_2]);
 
 }
 
 class BlinkGeoposition {
   static final instance = new BlinkGeoposition();
 
-  static coords_Getter(mthis) native "Geoposition_coords_Getter";
-  coords_Getter_(mthis) => coords_Getter(mthis);
+  coords_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "coords");
 
-  static timestamp_Getter(mthis) native "Geoposition_timestamp_Getter";
-  timestamp_Getter_(mthis) => timestamp_Getter(mthis);
+  timestamp_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "timestamp");
 
 }
 
 class BlinkHTMLAllCollection {
   static final instance = new BlinkHTMLAllCollection();
 
-  static $__getter___Callback_1(mthis, __arg_0) native "HTMLAllCollection___getter___Callback";
-  $__getter___Callback_1_(mthis, __arg_0) => $__getter___Callback_1(mthis, __arg_0);
+  $__getter___Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "__getter__", [__arg_0]);
 
-  static item_Callback_0(mthis) native "HTMLAllCollection_item_Callback";
-  item_Callback_0_(mthis) => item_Callback_0(mthis);
+  item_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "item", []);
 
-  static item_Callback_1(mthis, __arg_0) native "HTMLAllCollection_item_Callback";
-  item_Callback_1_(mthis, __arg_0) => item_Callback_1(mthis, __arg_0);
+  item_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "item", [__arg_0]);
 
-  static item_Callback_2(mthis, __arg_0, __arg_1) native "HTMLAllCollection_item_Callback";
-  item_Callback_2_(mthis, __arg_0, __arg_1) => item_Callback_2(mthis, __arg_0, __arg_1);
+  length_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "length");
 
-  static item_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "HTMLAllCollection_item_Callback";
-  item_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => item_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  namedItem_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "namedItem", []);
 
-  static length_Getter(mthis) native "HTMLAllCollection_length_Getter";
-  length_Getter_(mthis) => length_Getter(mthis);
-
-  static namedItem_Callback_0(mthis) native "HTMLAllCollection_namedItem_Callback";
-  namedItem_Callback_0_(mthis) => namedItem_Callback_0(mthis);
-
-  static namedItem_Callback_1(mthis, __arg_0) native "HTMLAllCollection_namedItem_Callback";
-  namedItem_Callback_1_(mthis, __arg_0) => namedItem_Callback_1(mthis, __arg_0);
-
-  static namedItem_Callback_2(mthis, __arg_0, __arg_1) native "HTMLAllCollection_namedItem_Callback";
-  namedItem_Callback_2_(mthis, __arg_0, __arg_1) => namedItem_Callback_2(mthis, __arg_0, __arg_1);
-
-  static namedItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "HTMLAllCollection_namedItem_Callback";
-  namedItem_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => namedItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  namedItem_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "namedItem", [__arg_0]);
 
 }
 
 class BlinkHTMLAnchorElement extends BlinkHTMLElement {
   static final instance = new BlinkHTMLAnchorElement();
 
-  static download_Getter(mthis) native "HTMLAnchorElement_download_Getter";
-  download_Getter_(mthis) => download_Getter(mthis);
+  download_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "download");
 
-  static download_Setter(mthis, __arg_0) native "HTMLAnchorElement_download_Setter";
-  download_Setter_(mthis, __arg_0) => download_Setter(mthis, __arg_0);
+  download_Setter_(mthis, __arg_0) => mthis["download"] = __arg_0;
 
-  static hash_Getter(mthis) native "HTMLAnchorElement_hash_Getter";
-  hash_Getter_(mthis) => hash_Getter(mthis);
+  hash_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "hash");
 
-  static hash_Setter(mthis, __arg_0) native "HTMLAnchorElement_hash_Setter";
-  hash_Setter_(mthis, __arg_0) => hash_Setter(mthis, __arg_0);
+  hash_Setter_(mthis, __arg_0) => mthis["hash"] = __arg_0;
 
-  static host_Getter(mthis) native "HTMLAnchorElement_host_Getter";
-  host_Getter_(mthis) => host_Getter(mthis);
+  host_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "host");
 
-  static host_Setter(mthis, __arg_0) native "HTMLAnchorElement_host_Setter";
-  host_Setter_(mthis, __arg_0) => host_Setter(mthis, __arg_0);
+  host_Setter_(mthis, __arg_0) => mthis["host"] = __arg_0;
 
-  static hostname_Getter(mthis) native "HTMLAnchorElement_hostname_Getter";
-  hostname_Getter_(mthis) => hostname_Getter(mthis);
+  hostname_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "hostname");
 
-  static hostname_Setter(mthis, __arg_0) native "HTMLAnchorElement_hostname_Setter";
-  hostname_Setter_(mthis, __arg_0) => hostname_Setter(mthis, __arg_0);
+  hostname_Setter_(mthis, __arg_0) => mthis["hostname"] = __arg_0;
 
-  static href_Getter(mthis) native "HTMLAnchorElement_href_Getter";
-  href_Getter_(mthis) => href_Getter(mthis);
+  href_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "href");
 
-  static href_Setter(mthis, __arg_0) native "HTMLAnchorElement_href_Setter";
-  href_Setter_(mthis, __arg_0) => href_Setter(mthis, __arg_0);
+  href_Setter_(mthis, __arg_0) => mthis["href"] = __arg_0;
 
-  static hreflang_Getter(mthis) native "HTMLAnchorElement_hreflang_Getter";
-  hreflang_Getter_(mthis) => hreflang_Getter(mthis);
+  hreflang_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "hreflang");
 
-  static hreflang_Setter(mthis, __arg_0) native "HTMLAnchorElement_hreflang_Setter";
-  hreflang_Setter_(mthis, __arg_0) => hreflang_Setter(mthis, __arg_0);
+  hreflang_Setter_(mthis, __arg_0) => mthis["hreflang"] = __arg_0;
 
-  static integrity_Getter(mthis) native "HTMLAnchorElement_integrity_Getter";
-  integrity_Getter_(mthis) => integrity_Getter(mthis);
+  integrity_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "integrity");
 
-  static integrity_Setter(mthis, __arg_0) native "HTMLAnchorElement_integrity_Setter";
-  integrity_Setter_(mthis, __arg_0) => integrity_Setter(mthis, __arg_0);
+  integrity_Setter_(mthis, __arg_0) => mthis["integrity"] = __arg_0;
 
-  static name_Getter(mthis) native "HTMLAnchorElement_name_Getter";
-  name_Getter_(mthis) => name_Getter(mthis);
+  name_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "name");
 
-  static name_Setter(mthis, __arg_0) native "HTMLAnchorElement_name_Setter";
-  name_Setter_(mthis, __arg_0) => name_Setter(mthis, __arg_0);
+  name_Setter_(mthis, __arg_0) => mthis["name"] = __arg_0;
 
-  static origin_Getter(mthis) native "HTMLAnchorElement_origin_Getter";
-  origin_Getter_(mthis) => origin_Getter(mthis);
+  origin_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "origin");
 
-  static password_Getter(mthis) native "HTMLAnchorElement_password_Getter";
-  password_Getter_(mthis) => password_Getter(mthis);
+  password_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "password");
 
-  static password_Setter(mthis, __arg_0) native "HTMLAnchorElement_password_Setter";
-  password_Setter_(mthis, __arg_0) => password_Setter(mthis, __arg_0);
+  password_Setter_(mthis, __arg_0) => mthis["password"] = __arg_0;
 
-  static pathname_Getter(mthis) native "HTMLAnchorElement_pathname_Getter";
-  pathname_Getter_(mthis) => pathname_Getter(mthis);
+  pathname_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "pathname");
 
-  static pathname_Setter(mthis, __arg_0) native "HTMLAnchorElement_pathname_Setter";
-  pathname_Setter_(mthis, __arg_0) => pathname_Setter(mthis, __arg_0);
+  pathname_Setter_(mthis, __arg_0) => mthis["pathname"] = __arg_0;
 
-  static ping_Getter(mthis) native "HTMLAnchorElement_ping_Getter";
-  ping_Getter_(mthis) => ping_Getter(mthis);
+  ping_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ping");
 
-  static ping_Setter(mthis, __arg_0) native "HTMLAnchorElement_ping_Setter";
-  ping_Setter_(mthis, __arg_0) => ping_Setter(mthis, __arg_0);
+  ping_Setter_(mthis, __arg_0) => mthis["ping"] = __arg_0;
 
-  static port_Getter(mthis) native "HTMLAnchorElement_port_Getter";
-  port_Getter_(mthis) => port_Getter(mthis);
+  port_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "port");
 
-  static port_Setter(mthis, __arg_0) native "HTMLAnchorElement_port_Setter";
-  port_Setter_(mthis, __arg_0) => port_Setter(mthis, __arg_0);
+  port_Setter_(mthis, __arg_0) => mthis["port"] = __arg_0;
 
-  static protocol_Getter(mthis) native "HTMLAnchorElement_protocol_Getter";
-  protocol_Getter_(mthis) => protocol_Getter(mthis);
+  protocol_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "protocol");
 
-  static protocol_Setter(mthis, __arg_0) native "HTMLAnchorElement_protocol_Setter";
-  protocol_Setter_(mthis, __arg_0) => protocol_Setter(mthis, __arg_0);
+  protocol_Setter_(mthis, __arg_0) => mthis["protocol"] = __arg_0;
 
-  static rel_Getter(mthis) native "HTMLAnchorElement_rel_Getter";
-  rel_Getter_(mthis) => rel_Getter(mthis);
+  rel_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "rel");
 
-  static rel_Setter(mthis, __arg_0) native "HTMLAnchorElement_rel_Setter";
-  rel_Setter_(mthis, __arg_0) => rel_Setter(mthis, __arg_0);
+  rel_Setter_(mthis, __arg_0) => mthis["rel"] = __arg_0;
 
-  static search_Getter(mthis) native "HTMLAnchorElement_search_Getter";
-  search_Getter_(mthis) => search_Getter(mthis);
+  search_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "search");
 
-  static search_Setter(mthis, __arg_0) native "HTMLAnchorElement_search_Setter";
-  search_Setter_(mthis, __arg_0) => search_Setter(mthis, __arg_0);
+  search_Setter_(mthis, __arg_0) => mthis["search"] = __arg_0;
 
-  static target_Getter(mthis) native "HTMLAnchorElement_target_Getter";
-  target_Getter_(mthis) => target_Getter(mthis);
+  target_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "target");
 
-  static target_Setter(mthis, __arg_0) native "HTMLAnchorElement_target_Setter";
-  target_Setter_(mthis, __arg_0) => target_Setter(mthis, __arg_0);
+  target_Setter_(mthis, __arg_0) => mthis["target"] = __arg_0;
 
-  static toString_Callback_0(mthis) native "HTMLAnchorElement_toString_Callback";
-  toString_Callback_0_(mthis) => toString_Callback_0(mthis);
+  toString_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "toString", []);
 
-  static toString_Callback_1(mthis, __arg_0) native "HTMLAnchorElement_toString_Callback";
-  toString_Callback_1_(mthis, __arg_0) => toString_Callback_1(mthis, __arg_0);
+  type_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "type");
 
-  static toString_Callback_2(mthis, __arg_0, __arg_1) native "HTMLAnchorElement_toString_Callback";
-  toString_Callback_2_(mthis, __arg_0, __arg_1) => toString_Callback_2(mthis, __arg_0, __arg_1);
+  type_Setter_(mthis, __arg_0) => mthis["type"] = __arg_0;
 
-  static type_Getter(mthis) native "HTMLAnchorElement_type_Getter";
-  type_Getter_(mthis) => type_Getter(mthis);
+  username_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "username");
 
-  static type_Setter(mthis, __arg_0) native "HTMLAnchorElement_type_Setter";
-  type_Setter_(mthis, __arg_0) => type_Setter(mthis, __arg_0);
-
-  static username_Getter(mthis) native "HTMLAnchorElement_username_Getter";
-  username_Getter_(mthis) => username_Getter(mthis);
-
-  static username_Setter(mthis, __arg_0) native "HTMLAnchorElement_username_Setter";
-  username_Setter_(mthis, __arg_0) => username_Setter(mthis, __arg_0);
+  username_Setter_(mthis, __arg_0) => mthis["username"] = __arg_0;
 
 }
 
 class BlinkHTMLAppletElement extends BlinkHTMLElement {
   static final instance = new BlinkHTMLAppletElement();
 
-  static $__getter___Callback_1(mthis, __arg_0) native "HTMLAppletElement___getter___Callback";
-  $__getter___Callback_1_(mthis, __arg_0) => $__getter___Callback_1(mthis, __arg_0);
+  $__getter___Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "__getter__", [__arg_0]);
 
-  static $__setter___Callback_2(mthis, __arg_0, __arg_1) native "HTMLAppletElement___setter___Callback";
-  $__setter___Callback_2_(mthis, __arg_0, __arg_1) => $__setter___Callback_2(mthis, __arg_0, __arg_1);
+  $__setter___Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "__setter__", [__arg_0, __arg_1]);
 
 }
 
 class BlinkHTMLAreaElement extends BlinkHTMLElement {
   static final instance = new BlinkHTMLAreaElement();
 
-  static alt_Getter(mthis) native "HTMLAreaElement_alt_Getter";
-  alt_Getter_(mthis) => alt_Getter(mthis);
+  alt_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "alt");
 
-  static alt_Setter(mthis, __arg_0) native "HTMLAreaElement_alt_Setter";
-  alt_Setter_(mthis, __arg_0) => alt_Setter(mthis, __arg_0);
+  alt_Setter_(mthis, __arg_0) => mthis["alt"] = __arg_0;
 
-  static coords_Getter(mthis) native "HTMLAreaElement_coords_Getter";
-  coords_Getter_(mthis) => coords_Getter(mthis);
+  coords_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "coords");
 
-  static coords_Setter(mthis, __arg_0) native "HTMLAreaElement_coords_Setter";
-  coords_Setter_(mthis, __arg_0) => coords_Setter(mthis, __arg_0);
+  coords_Setter_(mthis, __arg_0) => mthis["coords"] = __arg_0;
 
-  static hash_Getter(mthis) native "HTMLAreaElement_hash_Getter";
-  hash_Getter_(mthis) => hash_Getter(mthis);
+  hash_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "hash");
 
-  static hash_Setter(mthis, __arg_0) native "HTMLAreaElement_hash_Setter";
-  hash_Setter_(mthis, __arg_0) => hash_Setter(mthis, __arg_0);
+  hash_Setter_(mthis, __arg_0) => mthis["hash"] = __arg_0;
 
-  static host_Getter(mthis) native "HTMLAreaElement_host_Getter";
-  host_Getter_(mthis) => host_Getter(mthis);
+  host_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "host");
 
-  static host_Setter(mthis, __arg_0) native "HTMLAreaElement_host_Setter";
-  host_Setter_(mthis, __arg_0) => host_Setter(mthis, __arg_0);
+  host_Setter_(mthis, __arg_0) => mthis["host"] = __arg_0;
 
-  static hostname_Getter(mthis) native "HTMLAreaElement_hostname_Getter";
-  hostname_Getter_(mthis) => hostname_Getter(mthis);
+  hostname_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "hostname");
 
-  static hostname_Setter(mthis, __arg_0) native "HTMLAreaElement_hostname_Setter";
-  hostname_Setter_(mthis, __arg_0) => hostname_Setter(mthis, __arg_0);
+  hostname_Setter_(mthis, __arg_0) => mthis["hostname"] = __arg_0;
 
-  static href_Getter(mthis) native "HTMLAreaElement_href_Getter";
-  href_Getter_(mthis) => href_Getter(mthis);
+  href_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "href");
 
-  static href_Setter(mthis, __arg_0) native "HTMLAreaElement_href_Setter";
-  href_Setter_(mthis, __arg_0) => href_Setter(mthis, __arg_0);
+  href_Setter_(mthis, __arg_0) => mthis["href"] = __arg_0;
 
-  static origin_Getter(mthis) native "HTMLAreaElement_origin_Getter";
-  origin_Getter_(mthis) => origin_Getter(mthis);
+  origin_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "origin");
 
-  static password_Getter(mthis) native "HTMLAreaElement_password_Getter";
-  password_Getter_(mthis) => password_Getter(mthis);
+  password_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "password");
 
-  static password_Setter(mthis, __arg_0) native "HTMLAreaElement_password_Setter";
-  password_Setter_(mthis, __arg_0) => password_Setter(mthis, __arg_0);
+  password_Setter_(mthis, __arg_0) => mthis["password"] = __arg_0;
 
-  static pathname_Getter(mthis) native "HTMLAreaElement_pathname_Getter";
-  pathname_Getter_(mthis) => pathname_Getter(mthis);
+  pathname_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "pathname");
 
-  static pathname_Setter(mthis, __arg_0) native "HTMLAreaElement_pathname_Setter";
-  pathname_Setter_(mthis, __arg_0) => pathname_Setter(mthis, __arg_0);
+  pathname_Setter_(mthis, __arg_0) => mthis["pathname"] = __arg_0;
 
-  static ping_Getter(mthis) native "HTMLAreaElement_ping_Getter";
-  ping_Getter_(mthis) => ping_Getter(mthis);
+  ping_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ping");
 
-  static ping_Setter(mthis, __arg_0) native "HTMLAreaElement_ping_Setter";
-  ping_Setter_(mthis, __arg_0) => ping_Setter(mthis, __arg_0);
+  ping_Setter_(mthis, __arg_0) => mthis["ping"] = __arg_0;
 
-  static port_Getter(mthis) native "HTMLAreaElement_port_Getter";
-  port_Getter_(mthis) => port_Getter(mthis);
+  port_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "port");
 
-  static port_Setter(mthis, __arg_0) native "HTMLAreaElement_port_Setter";
-  port_Setter_(mthis, __arg_0) => port_Setter(mthis, __arg_0);
+  port_Setter_(mthis, __arg_0) => mthis["port"] = __arg_0;
 
-  static protocol_Getter(mthis) native "HTMLAreaElement_protocol_Getter";
-  protocol_Getter_(mthis) => protocol_Getter(mthis);
+  protocol_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "protocol");
 
-  static protocol_Setter(mthis, __arg_0) native "HTMLAreaElement_protocol_Setter";
-  protocol_Setter_(mthis, __arg_0) => protocol_Setter(mthis, __arg_0);
+  protocol_Setter_(mthis, __arg_0) => mthis["protocol"] = __arg_0;
 
-  static search_Getter(mthis) native "HTMLAreaElement_search_Getter";
-  search_Getter_(mthis) => search_Getter(mthis);
+  search_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "search");
 
-  static search_Setter(mthis, __arg_0) native "HTMLAreaElement_search_Setter";
-  search_Setter_(mthis, __arg_0) => search_Setter(mthis, __arg_0);
+  search_Setter_(mthis, __arg_0) => mthis["search"] = __arg_0;
 
-  static shape_Getter(mthis) native "HTMLAreaElement_shape_Getter";
-  shape_Getter_(mthis) => shape_Getter(mthis);
+  shape_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "shape");
 
-  static shape_Setter(mthis, __arg_0) native "HTMLAreaElement_shape_Setter";
-  shape_Setter_(mthis, __arg_0) => shape_Setter(mthis, __arg_0);
+  shape_Setter_(mthis, __arg_0) => mthis["shape"] = __arg_0;
 
-  static target_Getter(mthis) native "HTMLAreaElement_target_Getter";
-  target_Getter_(mthis) => target_Getter(mthis);
+  target_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "target");
 
-  static target_Setter(mthis, __arg_0) native "HTMLAreaElement_target_Setter";
-  target_Setter_(mthis, __arg_0) => target_Setter(mthis, __arg_0);
+  target_Setter_(mthis, __arg_0) => mthis["target"] = __arg_0;
 
-  static toString_Callback_0(mthis) native "HTMLAreaElement_toString_Callback";
-  toString_Callback_0_(mthis) => toString_Callback_0(mthis);
+  toString_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "toString", []);
 
-  static toString_Callback_1(mthis, __arg_0) native "HTMLAreaElement_toString_Callback";
-  toString_Callback_1_(mthis, __arg_0) => toString_Callback_1(mthis, __arg_0);
+  username_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "username");
 
-  static toString_Callback_2(mthis, __arg_0, __arg_1) native "HTMLAreaElement_toString_Callback";
-  toString_Callback_2_(mthis, __arg_0, __arg_1) => toString_Callback_2(mthis, __arg_0, __arg_1);
-
-  static username_Getter(mthis) native "HTMLAreaElement_username_Getter";
-  username_Getter_(mthis) => username_Getter(mthis);
-
-  static username_Setter(mthis, __arg_0) native "HTMLAreaElement_username_Setter";
-  username_Setter_(mthis, __arg_0) => username_Setter(mthis, __arg_0);
+  username_Setter_(mthis, __arg_0) => mthis["username"] = __arg_0;
 
 }
 
 class BlinkHTMLAudioElement extends BlinkHTMLMediaElement {
   static final instance = new BlinkHTMLAudioElement();
 
-  static constructorCallback_0() native "HTMLAudioElement_constructorCallback";
-  constructorCallback_0_() => constructorCallback_0();
+  constructorCallback_0_() => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "Audio"), []);
 
-  static constructorCallback_1(__arg_0) native "HTMLAudioElement_constructorCallback";
-  constructorCallback_1_(__arg_0) => constructorCallback_1(__arg_0);
-
-  static constructorCallback_2(__arg_0, __arg_1) native "HTMLAudioElement_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
-
-  static constructorCallback_3(__arg_0, __arg_1, __arg_2) native "HTMLAudioElement_constructorCallback";
-  constructorCallback_3_(__arg_0, __arg_1, __arg_2) => constructorCallback_3(__arg_0, __arg_1, __arg_2);
+  constructorCallback_1_(__arg_0) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "Audio"), [__arg_0]);
 
 }
 
@@ -9275,333 +5118,204 @@
 class BlinkHTMLBaseElement extends BlinkHTMLElement {
   static final instance = new BlinkHTMLBaseElement();
 
-  static href_Getter(mthis) native "HTMLBaseElement_href_Getter";
-  href_Getter_(mthis) => href_Getter(mthis);
+  href_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "href");
 
-  static href_Setter(mthis, __arg_0) native "HTMLBaseElement_href_Setter";
-  href_Setter_(mthis, __arg_0) => href_Setter(mthis, __arg_0);
+  href_Setter_(mthis, __arg_0) => mthis["href"] = __arg_0;
 
-  static target_Getter(mthis) native "HTMLBaseElement_target_Getter";
-  target_Getter_(mthis) => target_Getter(mthis);
+  target_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "target");
 
-  static target_Setter(mthis, __arg_0) native "HTMLBaseElement_target_Setter";
-  target_Setter_(mthis, __arg_0) => target_Setter(mthis, __arg_0);
+  target_Setter_(mthis, __arg_0) => mthis["target"] = __arg_0;
 
 }
 
 class BlinkHTMLBodyElement extends BlinkHTMLElement {
   static final instance = new BlinkHTMLBodyElement();
 
-  static onbeforeunload_Getter(mthis) native "HTMLBodyElement_onbeforeunload_Getter";
-  onbeforeunload_Getter_(mthis) => onbeforeunload_Getter(mthis);
+  onbeforeunload_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onbeforeunload");
 
-  static onbeforeunload_Setter(mthis, __arg_0) native "HTMLBodyElement_onbeforeunload_Setter";
-  onbeforeunload_Setter_(mthis, __arg_0) => onbeforeunload_Setter(mthis, __arg_0);
+  onbeforeunload_Setter_(mthis, __arg_0) => mthis["onbeforeunload"] = __arg_0;
 
-  static onblur_Getter(mthis) native "HTMLBodyElement_onblur_Getter";
-  onblur_Getter_(mthis) => onblur_Getter(mthis);
+  onblur_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onblur");
 
-  static onblur_Setter(mthis, __arg_0) native "HTMLBodyElement_onblur_Setter";
-  onblur_Setter_(mthis, __arg_0) => onblur_Setter(mthis, __arg_0);
+  onblur_Setter_(mthis, __arg_0) => mthis["onblur"] = __arg_0;
 
-  static onerror_Getter(mthis) native "HTMLBodyElement_onerror_Getter";
-  onerror_Getter_(mthis) => onerror_Getter(mthis);
+  onerror_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onerror");
 
-  static onerror_Setter(mthis, __arg_0) native "HTMLBodyElement_onerror_Setter";
-  onerror_Setter_(mthis, __arg_0) => onerror_Setter(mthis, __arg_0);
+  onerror_Setter_(mthis, __arg_0) => mthis["onerror"] = __arg_0;
 
-  static onfocus_Getter(mthis) native "HTMLBodyElement_onfocus_Getter";
-  onfocus_Getter_(mthis) => onfocus_Getter(mthis);
+  onfocus_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onfocus");
 
-  static onfocus_Setter(mthis, __arg_0) native "HTMLBodyElement_onfocus_Setter";
-  onfocus_Setter_(mthis, __arg_0) => onfocus_Setter(mthis, __arg_0);
+  onfocus_Setter_(mthis, __arg_0) => mthis["onfocus"] = __arg_0;
 
-  static onhashchange_Getter(mthis) native "HTMLBodyElement_onhashchange_Getter";
-  onhashchange_Getter_(mthis) => onhashchange_Getter(mthis);
+  onhashchange_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onhashchange");
 
-  static onhashchange_Setter(mthis, __arg_0) native "HTMLBodyElement_onhashchange_Setter";
-  onhashchange_Setter_(mthis, __arg_0) => onhashchange_Setter(mthis, __arg_0);
+  onhashchange_Setter_(mthis, __arg_0) => mthis["onhashchange"] = __arg_0;
 
-  static onlanguagechange_Getter(mthis) native "HTMLBodyElement_onlanguagechange_Getter";
-  onlanguagechange_Getter_(mthis) => onlanguagechange_Getter(mthis);
+  onlanguagechange_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onlanguagechange");
 
-  static onlanguagechange_Setter(mthis, __arg_0) native "HTMLBodyElement_onlanguagechange_Setter";
-  onlanguagechange_Setter_(mthis, __arg_0) => onlanguagechange_Setter(mthis, __arg_0);
+  onlanguagechange_Setter_(mthis, __arg_0) => mthis["onlanguagechange"] = __arg_0;
 
-  static onload_Getter(mthis) native "HTMLBodyElement_onload_Getter";
-  onload_Getter_(mthis) => onload_Getter(mthis);
+  onload_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onload");
 
-  static onload_Setter(mthis, __arg_0) native "HTMLBodyElement_onload_Setter";
-  onload_Setter_(mthis, __arg_0) => onload_Setter(mthis, __arg_0);
+  onload_Setter_(mthis, __arg_0) => mthis["onload"] = __arg_0;
 
-  static onmessage_Getter(mthis) native "HTMLBodyElement_onmessage_Getter";
-  onmessage_Getter_(mthis) => onmessage_Getter(mthis);
+  onmessage_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onmessage");
 
-  static onmessage_Setter(mthis, __arg_0) native "HTMLBodyElement_onmessage_Setter";
-  onmessage_Setter_(mthis, __arg_0) => onmessage_Setter(mthis, __arg_0);
+  onmessage_Setter_(mthis, __arg_0) => mthis["onmessage"] = __arg_0;
 
-  static onoffline_Getter(mthis) native "HTMLBodyElement_onoffline_Getter";
-  onoffline_Getter_(mthis) => onoffline_Getter(mthis);
+  onoffline_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onoffline");
 
-  static onoffline_Setter(mthis, __arg_0) native "HTMLBodyElement_onoffline_Setter";
-  onoffline_Setter_(mthis, __arg_0) => onoffline_Setter(mthis, __arg_0);
+  onoffline_Setter_(mthis, __arg_0) => mthis["onoffline"] = __arg_0;
 
-  static ononline_Getter(mthis) native "HTMLBodyElement_ononline_Getter";
-  ononline_Getter_(mthis) => ononline_Getter(mthis);
+  ononline_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ononline");
 
-  static ononline_Setter(mthis, __arg_0) native "HTMLBodyElement_ononline_Setter";
-  ononline_Setter_(mthis, __arg_0) => ononline_Setter(mthis, __arg_0);
+  ononline_Setter_(mthis, __arg_0) => mthis["ononline"] = __arg_0;
 
-  static onorientationchange_Getter(mthis) native "HTMLBodyElement_onorientationchange_Getter";
-  onorientationchange_Getter_(mthis) => onorientationchange_Getter(mthis);
+  onorientationchange_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onorientationchange");
 
-  static onorientationchange_Setter(mthis, __arg_0) native "HTMLBodyElement_onorientationchange_Setter";
-  onorientationchange_Setter_(mthis, __arg_0) => onorientationchange_Setter(mthis, __arg_0);
+  onorientationchange_Setter_(mthis, __arg_0) => mthis["onorientationchange"] = __arg_0;
 
-  static onpagehide_Getter(mthis) native "HTMLBodyElement_onpagehide_Getter";
-  onpagehide_Getter_(mthis) => onpagehide_Getter(mthis);
+  onpagehide_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onpagehide");
 
-  static onpagehide_Setter(mthis, __arg_0) native "HTMLBodyElement_onpagehide_Setter";
-  onpagehide_Setter_(mthis, __arg_0) => onpagehide_Setter(mthis, __arg_0);
+  onpagehide_Setter_(mthis, __arg_0) => mthis["onpagehide"] = __arg_0;
 
-  static onpageshow_Getter(mthis) native "HTMLBodyElement_onpageshow_Getter";
-  onpageshow_Getter_(mthis) => onpageshow_Getter(mthis);
+  onpageshow_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onpageshow");
 
-  static onpageshow_Setter(mthis, __arg_0) native "HTMLBodyElement_onpageshow_Setter";
-  onpageshow_Setter_(mthis, __arg_0) => onpageshow_Setter(mthis, __arg_0);
+  onpageshow_Setter_(mthis, __arg_0) => mthis["onpageshow"] = __arg_0;
 
-  static onpopstate_Getter(mthis) native "HTMLBodyElement_onpopstate_Getter";
-  onpopstate_Getter_(mthis) => onpopstate_Getter(mthis);
+  onpopstate_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onpopstate");
 
-  static onpopstate_Setter(mthis, __arg_0) native "HTMLBodyElement_onpopstate_Setter";
-  onpopstate_Setter_(mthis, __arg_0) => onpopstate_Setter(mthis, __arg_0);
+  onpopstate_Setter_(mthis, __arg_0) => mthis["onpopstate"] = __arg_0;
 
-  static onresize_Getter(mthis) native "HTMLBodyElement_onresize_Getter";
-  onresize_Getter_(mthis) => onresize_Getter(mthis);
+  onresize_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onresize");
 
-  static onresize_Setter(mthis, __arg_0) native "HTMLBodyElement_onresize_Setter";
-  onresize_Setter_(mthis, __arg_0) => onresize_Setter(mthis, __arg_0);
+  onresize_Setter_(mthis, __arg_0) => mthis["onresize"] = __arg_0;
 
-  static onscroll_Getter(mthis) native "HTMLBodyElement_onscroll_Getter";
-  onscroll_Getter_(mthis) => onscroll_Getter(mthis);
+  onscroll_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onscroll");
 
-  static onscroll_Setter(mthis, __arg_0) native "HTMLBodyElement_onscroll_Setter";
-  onscroll_Setter_(mthis, __arg_0) => onscroll_Setter(mthis, __arg_0);
+  onscroll_Setter_(mthis, __arg_0) => mthis["onscroll"] = __arg_0;
 
-  static onstorage_Getter(mthis) native "HTMLBodyElement_onstorage_Getter";
-  onstorage_Getter_(mthis) => onstorage_Getter(mthis);
+  onstorage_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onstorage");
 
-  static onstorage_Setter(mthis, __arg_0) native "HTMLBodyElement_onstorage_Setter";
-  onstorage_Setter_(mthis, __arg_0) => onstorage_Setter(mthis, __arg_0);
+  onstorage_Setter_(mthis, __arg_0) => mthis["onstorage"] = __arg_0;
 
-  static onunload_Getter(mthis) native "HTMLBodyElement_onunload_Getter";
-  onunload_Getter_(mthis) => onunload_Getter(mthis);
+  onunload_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onunload");
 
-  static onunload_Setter(mthis, __arg_0) native "HTMLBodyElement_onunload_Setter";
-  onunload_Setter_(mthis, __arg_0) => onunload_Setter(mthis, __arg_0);
+  onunload_Setter_(mthis, __arg_0) => mthis["onunload"] = __arg_0;
 
 }
 
 class BlinkHTMLButtonElement extends BlinkHTMLElement {
   static final instance = new BlinkHTMLButtonElement();
 
-  static autofocus_Getter(mthis) native "HTMLButtonElement_autofocus_Getter";
-  autofocus_Getter_(mthis) => autofocus_Getter(mthis);
+  autofocus_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "autofocus");
 
-  static autofocus_Setter(mthis, __arg_0) native "HTMLButtonElement_autofocus_Setter";
-  autofocus_Setter_(mthis, __arg_0) => autofocus_Setter(mthis, __arg_0);
+  autofocus_Setter_(mthis, __arg_0) => mthis["autofocus"] = __arg_0;
 
-  static checkValidity_Callback_0(mthis) native "HTMLButtonElement_checkValidity_Callback";
-  checkValidity_Callback_0_(mthis) => checkValidity_Callback_0(mthis);
+  checkValidity_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "checkValidity", []);
 
-  static checkValidity_Callback_1(mthis, __arg_0) native "HTMLButtonElement_checkValidity_Callback";
-  checkValidity_Callback_1_(mthis, __arg_0) => checkValidity_Callback_1(mthis, __arg_0);
+  disabled_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "disabled");
 
-  static checkValidity_Callback_2(mthis, __arg_0, __arg_1) native "HTMLButtonElement_checkValidity_Callback";
-  checkValidity_Callback_2_(mthis, __arg_0, __arg_1) => checkValidity_Callback_2(mthis, __arg_0, __arg_1);
+  disabled_Setter_(mthis, __arg_0) => mthis["disabled"] = __arg_0;
 
-  static disabled_Getter(mthis) native "HTMLButtonElement_disabled_Getter";
-  disabled_Getter_(mthis) => disabled_Getter(mthis);
+  formAction_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "formAction");
 
-  static disabled_Setter(mthis, __arg_0) native "HTMLButtonElement_disabled_Setter";
-  disabled_Setter_(mthis, __arg_0) => disabled_Setter(mthis, __arg_0);
+  formAction_Setter_(mthis, __arg_0) => mthis["formAction"] = __arg_0;
 
-  static formAction_Getter(mthis) native "HTMLButtonElement_formAction_Getter";
-  formAction_Getter_(mthis) => formAction_Getter(mthis);
+  formEnctype_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "formEnctype");
 
-  static formAction_Setter(mthis, __arg_0) native "HTMLButtonElement_formAction_Setter";
-  formAction_Setter_(mthis, __arg_0) => formAction_Setter(mthis, __arg_0);
+  formEnctype_Setter_(mthis, __arg_0) => mthis["formEnctype"] = __arg_0;
 
-  static formEnctype_Getter(mthis) native "HTMLButtonElement_formEnctype_Getter";
-  formEnctype_Getter_(mthis) => formEnctype_Getter(mthis);
+  formMethod_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "formMethod");
 
-  static formEnctype_Setter(mthis, __arg_0) native "HTMLButtonElement_formEnctype_Setter";
-  formEnctype_Setter_(mthis, __arg_0) => formEnctype_Setter(mthis, __arg_0);
+  formMethod_Setter_(mthis, __arg_0) => mthis["formMethod"] = __arg_0;
 
-  static formMethod_Getter(mthis) native "HTMLButtonElement_formMethod_Getter";
-  formMethod_Getter_(mthis) => formMethod_Getter(mthis);
+  formNoValidate_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "formNoValidate");
 
-  static formMethod_Setter(mthis, __arg_0) native "HTMLButtonElement_formMethod_Setter";
-  formMethod_Setter_(mthis, __arg_0) => formMethod_Setter(mthis, __arg_0);
+  formNoValidate_Setter_(mthis, __arg_0) => mthis["formNoValidate"] = __arg_0;
 
-  static formNoValidate_Getter(mthis) native "HTMLButtonElement_formNoValidate_Getter";
-  formNoValidate_Getter_(mthis) => formNoValidate_Getter(mthis);
+  formTarget_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "formTarget");
 
-  static formNoValidate_Setter(mthis, __arg_0) native "HTMLButtonElement_formNoValidate_Setter";
-  formNoValidate_Setter_(mthis, __arg_0) => formNoValidate_Setter(mthis, __arg_0);
+  formTarget_Setter_(mthis, __arg_0) => mthis["formTarget"] = __arg_0;
 
-  static formTarget_Getter(mthis) native "HTMLButtonElement_formTarget_Getter";
-  formTarget_Getter_(mthis) => formTarget_Getter(mthis);
+  form_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "form");
 
-  static formTarget_Setter(mthis, __arg_0) native "HTMLButtonElement_formTarget_Setter";
-  formTarget_Setter_(mthis, __arg_0) => formTarget_Setter(mthis, __arg_0);
+  labels_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "labels");
 
-  static form_Getter(mthis) native "HTMLButtonElement_form_Getter";
-  form_Getter_(mthis) => form_Getter(mthis);
+  name_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "name");
 
-  static labels_Getter(mthis) native "HTMLButtonElement_labels_Getter";
-  labels_Getter_(mthis) => labels_Getter(mthis);
+  name_Setter_(mthis, __arg_0) => mthis["name"] = __arg_0;
 
-  static name_Getter(mthis) native "HTMLButtonElement_name_Getter";
-  name_Getter_(mthis) => name_Getter(mthis);
+  setCustomValidity_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "setCustomValidity", []);
 
-  static name_Setter(mthis, __arg_0) native "HTMLButtonElement_name_Setter";
-  name_Setter_(mthis, __arg_0) => name_Setter(mthis, __arg_0);
+  setCustomValidity_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "setCustomValidity", [__arg_0]);
 
-  static setCustomValidity_Callback_0(mthis) native "HTMLButtonElement_setCustomValidity_Callback";
-  setCustomValidity_Callback_0_(mthis) => setCustomValidity_Callback_0(mthis);
+  type_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "type");
 
-  static setCustomValidity_Callback_1(mthis, __arg_0) native "HTMLButtonElement_setCustomValidity_Callback";
-  setCustomValidity_Callback_1_(mthis, __arg_0) => setCustomValidity_Callback_1(mthis, __arg_0);
+  type_Setter_(mthis, __arg_0) => mthis["type"] = __arg_0;
 
-  static setCustomValidity_Callback_2(mthis, __arg_0, __arg_1) native "HTMLButtonElement_setCustomValidity_Callback";
-  setCustomValidity_Callback_2_(mthis, __arg_0, __arg_1) => setCustomValidity_Callback_2(mthis, __arg_0, __arg_1);
+  validationMessage_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "validationMessage");
 
-  static setCustomValidity_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "HTMLButtonElement_setCustomValidity_Callback";
-  setCustomValidity_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => setCustomValidity_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  validity_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "validity");
 
-  static type_Getter(mthis) native "HTMLButtonElement_type_Getter";
-  type_Getter_(mthis) => type_Getter(mthis);
+  value_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "value");
 
-  static type_Setter(mthis, __arg_0) native "HTMLButtonElement_type_Setter";
-  type_Setter_(mthis, __arg_0) => type_Setter(mthis, __arg_0);
+  value_Setter_(mthis, __arg_0) => mthis["value"] = __arg_0;
 
-  static validationMessage_Getter(mthis) native "HTMLButtonElement_validationMessage_Getter";
-  validationMessage_Getter_(mthis) => validationMessage_Getter(mthis);
-
-  static validity_Getter(mthis) native "HTMLButtonElement_validity_Getter";
-  validity_Getter_(mthis) => validity_Getter(mthis);
-
-  static value_Getter(mthis) native "HTMLButtonElement_value_Getter";
-  value_Getter_(mthis) => value_Getter(mthis);
-
-  static value_Setter(mthis, __arg_0) native "HTMLButtonElement_value_Setter";
-  value_Setter_(mthis, __arg_0) => value_Setter(mthis, __arg_0);
-
-  static willValidate_Getter(mthis) native "HTMLButtonElement_willValidate_Getter";
-  willValidate_Getter_(mthis) => willValidate_Getter(mthis);
+  willValidate_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "willValidate");
 
 }
 
 class BlinkHTMLCanvasElement extends BlinkHTMLElement {
   static final instance = new BlinkHTMLCanvasElement();
 
-  static getContext_Callback_0(mthis) native "HTMLCanvasElement_getContext_Callback";
-  getContext_Callback_0_(mthis) => getContext_Callback_0(mthis);
+  getContext_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getContext", []);
 
-  static getContext_Callback_1(mthis, __arg_0) native "HTMLCanvasElement_getContext_Callback";
-  getContext_Callback_1_(mthis, __arg_0) => getContext_Callback_1(mthis, __arg_0);
+  getContext_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getContext", [__arg_0]);
 
-  static getContext_Callback_2(mthis, __arg_0, __arg_1) native "HTMLCanvasElement_getContext_Callback";
-  getContext_Callback_2_(mthis, __arg_0, __arg_1) => getContext_Callback_2(mthis, __arg_0, __arg_1);
+  getContext_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "getContext", [__arg_0, __arg_1]);
 
-  static getContext_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "HTMLCanvasElement_getContext_Callback";
-  getContext_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getContext_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  height_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "height");
 
-  static getContext_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "HTMLCanvasElement_getContext_Callback";
-  getContext_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => getContext_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  height_Setter_(mthis, __arg_0) => mthis["height"] = __arg_0;
 
-  static height_Getter(mthis) native "HTMLCanvasElement_height_Getter";
-  height_Getter_(mthis) => height_Getter(mthis);
+  toDataURL_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "toDataURL", []);
 
-  static height_Setter(mthis, __arg_0) native "HTMLCanvasElement_height_Setter";
-  height_Setter_(mthis, __arg_0) => height_Setter(mthis, __arg_0);
+  toDataURL_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "toDataURL", [__arg_0]);
 
-  static toDataURL_Callback_0(mthis) native "HTMLCanvasElement_toDataURL_Callback";
-  toDataURL_Callback_0_(mthis) => toDataURL_Callback_0(mthis);
+  toDataURL_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "toDataURL", [__arg_0, __arg_1]);
 
-  static toDataURL_Callback_1(mthis, __arg_0) native "HTMLCanvasElement_toDataURL_Callback";
-  toDataURL_Callback_1_(mthis, __arg_0) => toDataURL_Callback_1(mthis, __arg_0);
+  width_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "width");
 
-  static toDataURL_Callback_2(mthis, __arg_0, __arg_1) native "HTMLCanvasElement_toDataURL_Callback";
-  toDataURL_Callback_2_(mthis, __arg_0, __arg_1) => toDataURL_Callback_2(mthis, __arg_0, __arg_1);
-
-  static toDataURL_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "HTMLCanvasElement_toDataURL_Callback";
-  toDataURL_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => toDataURL_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static toDataURL_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "HTMLCanvasElement_toDataURL_Callback";
-  toDataURL_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => toDataURL_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static width_Getter(mthis) native "HTMLCanvasElement_width_Getter";
-  width_Getter_(mthis) => width_Getter(mthis);
-
-  static width_Setter(mthis, __arg_0) native "HTMLCanvasElement_width_Setter";
-  width_Setter_(mthis, __arg_0) => width_Setter(mthis, __arg_0);
+  width_Setter_(mthis, __arg_0) => mthis["width"] = __arg_0;
 
 }
 
 class BlinkHTMLCollection {
   static final instance = new BlinkHTMLCollection();
 
-  static $__getter___Callback_1(mthis, __arg_0) native "HTMLCollection___getter___Callback";
-  $__getter___Callback_1_(mthis, __arg_0) => $__getter___Callback_1(mthis, __arg_0);
+  $__getter___Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "__getter__", [__arg_0]);
 
-  static item_Callback_0(mthis) native "HTMLCollection_item_Callback";
-  item_Callback_0_(mthis) => item_Callback_0(mthis);
+  item_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "item", []);
 
-  static item_Callback_1(mthis, __arg_0) native "HTMLCollection_item_Callback";
-  item_Callback_1_(mthis, __arg_0) => item_Callback_1(mthis, __arg_0);
+  item_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "item", [__arg_0]);
 
-  static item_Callback_2(mthis, __arg_0, __arg_1) native "HTMLCollection_item_Callback";
-  item_Callback_2_(mthis, __arg_0, __arg_1) => item_Callback_2(mthis, __arg_0, __arg_1);
+  length_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "length");
 
-  static item_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "HTMLCollection_item_Callback";
-  item_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => item_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  namedItem_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "namedItem", []);
 
-  static length_Getter(mthis) native "HTMLCollection_length_Getter";
-  length_Getter_(mthis) => length_Getter(mthis);
-
-  static namedItem_Callback_0(mthis) native "HTMLCollection_namedItem_Callback";
-  namedItem_Callback_0_(mthis) => namedItem_Callback_0(mthis);
-
-  static namedItem_Callback_1(mthis, __arg_0) native "HTMLCollection_namedItem_Callback";
-  namedItem_Callback_1_(mthis, __arg_0) => namedItem_Callback_1(mthis, __arg_0);
-
-  static namedItem_Callback_2(mthis, __arg_0, __arg_1) native "HTMLCollection_namedItem_Callback";
-  namedItem_Callback_2_(mthis, __arg_0, __arg_1) => namedItem_Callback_2(mthis, __arg_0, __arg_1);
-
-  static namedItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "HTMLCollection_namedItem_Callback";
-  namedItem_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => namedItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  namedItem_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "namedItem", [__arg_0]);
 
 }
 
 class BlinkHTMLContentElement extends BlinkHTMLElement {
   static final instance = new BlinkHTMLContentElement();
 
-  static getDistributedNodes_Callback_0(mthis) native "HTMLContentElement_getDistributedNodes_Callback";
-  getDistributedNodes_Callback_0_(mthis) => getDistributedNodes_Callback_0(mthis);
+  getDistributedNodes_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getDistributedNodes", []);
 
-  static getDistributedNodes_Callback_1(mthis, __arg_0) native "HTMLContentElement_getDistributedNodes_Callback";
-  getDistributedNodes_Callback_1_(mthis, __arg_0) => getDistributedNodes_Callback_1(mthis, __arg_0);
+  select_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "select");
 
-  static getDistributedNodes_Callback_2(mthis, __arg_0, __arg_1) native "HTMLContentElement_getDistributedNodes_Callback";
-  getDistributedNodes_Callback_2_(mthis, __arg_0, __arg_1) => getDistributedNodes_Callback_2(mthis, __arg_0, __arg_1);
-
-  static select_Getter(mthis) native "HTMLContentElement_select_Getter";
-  select_Getter_(mthis) => select_Getter(mthis);
-
-  static select_Setter(mthis, __arg_0) native "HTMLContentElement_select_Setter";
-  select_Setter_(mthis, __arg_0) => select_Setter(mthis, __arg_0);
+  select_Setter_(mthis, __arg_0) => mthis["select"] = __arg_0;
 
 }
 
@@ -9613,66 +5327,37 @@
 class BlinkHTMLDataListElement extends BlinkHTMLElement {
   static final instance = new BlinkHTMLDataListElement();
 
-  static options_Getter(mthis) native "HTMLDataListElement_options_Getter";
-  options_Getter_(mthis) => options_Getter(mthis);
+  options_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "options");
 
 }
 
 class BlinkHTMLDetailsElement extends BlinkHTMLElement {
   static final instance = new BlinkHTMLDetailsElement();
 
-  static open_Getter(mthis) native "HTMLDetailsElement_open_Getter";
-  open_Getter_(mthis) => open_Getter(mthis);
+  open_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "open");
 
-  static open_Setter(mthis, __arg_0) native "HTMLDetailsElement_open_Setter";
-  open_Setter_(mthis, __arg_0) => open_Setter(mthis, __arg_0);
+  open_Setter_(mthis, __arg_0) => mthis["open"] = __arg_0;
 
 }
 
 class BlinkHTMLDialogElement extends BlinkHTMLElement {
   static final instance = new BlinkHTMLDialogElement();
 
-  static close_Callback_0(mthis) native "HTMLDialogElement_close_Callback";
-  close_Callback_0_(mthis) => close_Callback_0(mthis);
+  close_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "close", []);
 
-  static close_Callback_1(mthis, __arg_0) native "HTMLDialogElement_close_Callback";
-  close_Callback_1_(mthis, __arg_0) => close_Callback_1(mthis, __arg_0);
+  close_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "close", [__arg_0]);
 
-  static close_Callback_2(mthis, __arg_0, __arg_1) native "HTMLDialogElement_close_Callback";
-  close_Callback_2_(mthis, __arg_0, __arg_1) => close_Callback_2(mthis, __arg_0, __arg_1);
+  open_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "open");
 
-  static close_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "HTMLDialogElement_close_Callback";
-  close_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => close_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  open_Setter_(mthis, __arg_0) => mthis["open"] = __arg_0;
 
-  static open_Getter(mthis) native "HTMLDialogElement_open_Getter";
-  open_Getter_(mthis) => open_Getter(mthis);
+  returnValue_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "returnValue");
 
-  static open_Setter(mthis, __arg_0) native "HTMLDialogElement_open_Setter";
-  open_Setter_(mthis, __arg_0) => open_Setter(mthis, __arg_0);
+  returnValue_Setter_(mthis, __arg_0) => mthis["returnValue"] = __arg_0;
 
-  static returnValue_Getter(mthis) native "HTMLDialogElement_returnValue_Getter";
-  returnValue_Getter_(mthis) => returnValue_Getter(mthis);
+  showModal_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "showModal", []);
 
-  static returnValue_Setter(mthis, __arg_0) native "HTMLDialogElement_returnValue_Setter";
-  returnValue_Setter_(mthis, __arg_0) => returnValue_Setter(mthis, __arg_0);
-
-  static showModal_Callback_0(mthis) native "HTMLDialogElement_showModal_Callback";
-  showModal_Callback_0_(mthis) => showModal_Callback_0(mthis);
-
-  static showModal_Callback_1(mthis, __arg_0) native "HTMLDialogElement_showModal_Callback";
-  showModal_Callback_1_(mthis, __arg_0) => showModal_Callback_1(mthis, __arg_0);
-
-  static showModal_Callback_2(mthis, __arg_0, __arg_1) native "HTMLDialogElement_showModal_Callback";
-  showModal_Callback_2_(mthis, __arg_0, __arg_1) => showModal_Callback_2(mthis, __arg_0, __arg_1);
-
-  static show_Callback_0(mthis) native "HTMLDialogElement_show_Callback";
-  show_Callback_0_(mthis) => show_Callback_0(mthis);
-
-  static show_Callback_1(mthis, __arg_0) native "HTMLDialogElement_show_Callback";
-  show_Callback_1_(mthis, __arg_0) => show_Callback_1(mthis, __arg_0);
-
-  static show_Callback_2(mthis, __arg_0, __arg_1) native "HTMLDialogElement_show_Callback";
-  show_Callback_2_(mthis, __arg_0, __arg_1) => show_Callback_2(mthis, __arg_0, __arg_1);
+  show_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "show", []);
 
 }
 
@@ -9689,695 +5374,426 @@
 class BlinkHTMLDocument extends BlinkDocument {
   static final instance = new BlinkHTMLDocument();
 
-  static alinkColor_Getter(mthis) native "HTMLDocument_alinkColor_Getter";
-  alinkColor_Getter_(mthis) => alinkColor_Getter(mthis);
+  alinkColor_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "alinkColor");
 
-  static alinkColor_Setter(mthis, __arg_0) native "HTMLDocument_alinkColor_Setter";
-  alinkColor_Setter_(mthis, __arg_0) => alinkColor_Setter(mthis, __arg_0);
+  alinkColor_Setter_(mthis, __arg_0) => mthis["alinkColor"] = __arg_0;
 
-  static bgColor_Getter(mthis) native "HTMLDocument_bgColor_Getter";
-  bgColor_Getter_(mthis) => bgColor_Getter(mthis);
+  bgColor_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "bgColor");
 
-  static bgColor_Setter(mthis, __arg_0) native "HTMLDocument_bgColor_Setter";
-  bgColor_Setter_(mthis, __arg_0) => bgColor_Setter(mthis, __arg_0);
+  bgColor_Setter_(mthis, __arg_0) => mthis["bgColor"] = __arg_0;
 
-  static captureEvents_Callback_0(mthis) native "HTMLDocument_captureEvents_Callback";
-  captureEvents_Callback_0_(mthis) => captureEvents_Callback_0(mthis);
+  captureEvents_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "captureEvents", []);
 
-  static captureEvents_Callback_1(mthis, __arg_0) native "HTMLDocument_captureEvents_Callback";
-  captureEvents_Callback_1_(mthis, __arg_0) => captureEvents_Callback_1(mthis, __arg_0);
+  clear_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "clear", []);
 
-  static captureEvents_Callback_2(mthis, __arg_0, __arg_1) native "HTMLDocument_captureEvents_Callback";
-  captureEvents_Callback_2_(mthis, __arg_0, __arg_1) => captureEvents_Callback_2(mthis, __arg_0, __arg_1);
+  close_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "close", []);
 
-  static clear_Callback_0(mthis) native "HTMLDocument_clear_Callback";
-  clear_Callback_0_(mthis) => clear_Callback_0(mthis);
+  compatMode_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "compatMode");
 
-  static clear_Callback_1(mthis, __arg_0) native "HTMLDocument_clear_Callback";
-  clear_Callback_1_(mthis, __arg_0) => clear_Callback_1(mthis, __arg_0);
+  fgColor_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "fgColor");
 
-  static clear_Callback_2(mthis, __arg_0, __arg_1) native "HTMLDocument_clear_Callback";
-  clear_Callback_2_(mthis, __arg_0, __arg_1) => clear_Callback_2(mthis, __arg_0, __arg_1);
+  fgColor_Setter_(mthis, __arg_0) => mthis["fgColor"] = __arg_0;
 
-  static close_Callback_0(mthis) native "HTMLDocument_close_Callback";
-  close_Callback_0_(mthis) => close_Callback_0(mthis);
+  linkColor_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "linkColor");
 
-  static close_Callback_1(mthis, __arg_0) native "HTMLDocument_close_Callback";
-  close_Callback_1_(mthis, __arg_0) => close_Callback_1(mthis, __arg_0);
+  linkColor_Setter_(mthis, __arg_0) => mthis["linkColor"] = __arg_0;
 
-  static close_Callback_2(mthis, __arg_0, __arg_1) native "HTMLDocument_close_Callback";
-  close_Callback_2_(mthis, __arg_0, __arg_1) => close_Callback_2(mthis, __arg_0, __arg_1);
+  open_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "open", []);
 
-  static compatMode_Getter(mthis) native "HTMLDocument_compatMode_Getter";
-  compatMode_Getter_(mthis) => compatMode_Getter(mthis);
+  releaseEvents_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "releaseEvents", []);
 
-  static fgColor_Getter(mthis) native "HTMLDocument_fgColor_Getter";
-  fgColor_Getter_(mthis) => fgColor_Getter(mthis);
+  vlinkColor_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "vlinkColor");
 
-  static fgColor_Setter(mthis, __arg_0) native "HTMLDocument_fgColor_Setter";
-  fgColor_Setter_(mthis, __arg_0) => fgColor_Setter(mthis, __arg_0);
+  vlinkColor_Setter_(mthis, __arg_0) => mthis["vlinkColor"] = __arg_0;
 
-  static linkColor_Getter(mthis) native "HTMLDocument_linkColor_Getter";
-  linkColor_Getter_(mthis) => linkColor_Getter(mthis);
+  write_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "write", []);
 
-  static linkColor_Setter(mthis, __arg_0) native "HTMLDocument_linkColor_Setter";
-  linkColor_Setter_(mthis, __arg_0) => linkColor_Setter(mthis, __arg_0);
+  write_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "write", [__arg_0]);
 
-  static open_Callback_0(mthis) native "HTMLDocument_open_Callback";
-  open_Callback_0_(mthis) => open_Callback_0(mthis);
+  writeln_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "writeln", []);
 
-  static open_Callback_1(mthis, __arg_0) native "HTMLDocument_open_Callback";
-  open_Callback_1_(mthis, __arg_0) => open_Callback_1(mthis, __arg_0);
-
-  static open_Callback_2(mthis, __arg_0, __arg_1) native "HTMLDocument_open_Callback";
-  open_Callback_2_(mthis, __arg_0, __arg_1) => open_Callback_2(mthis, __arg_0, __arg_1);
-
-  static releaseEvents_Callback_0(mthis) native "HTMLDocument_releaseEvents_Callback";
-  releaseEvents_Callback_0_(mthis) => releaseEvents_Callback_0(mthis);
-
-  static releaseEvents_Callback_1(mthis, __arg_0) native "HTMLDocument_releaseEvents_Callback";
-  releaseEvents_Callback_1_(mthis, __arg_0) => releaseEvents_Callback_1(mthis, __arg_0);
-
-  static releaseEvents_Callback_2(mthis, __arg_0, __arg_1) native "HTMLDocument_releaseEvents_Callback";
-  releaseEvents_Callback_2_(mthis, __arg_0, __arg_1) => releaseEvents_Callback_2(mthis, __arg_0, __arg_1);
-
-  static vlinkColor_Getter(mthis) native "HTMLDocument_vlinkColor_Getter";
-  vlinkColor_Getter_(mthis) => vlinkColor_Getter(mthis);
-
-  static vlinkColor_Setter(mthis, __arg_0) native "HTMLDocument_vlinkColor_Setter";
-  vlinkColor_Setter_(mthis, __arg_0) => vlinkColor_Setter(mthis, __arg_0);
-
-  static write_Callback_0(mthis) native "HTMLDocument_write_Callback";
-  write_Callback_0_(mthis) => write_Callback_0(mthis);
-
-  static write_Callback_1(mthis, __arg_0) native "HTMLDocument_write_Callback";
-  write_Callback_1_(mthis, __arg_0) => write_Callback_1(mthis, __arg_0);
-
-  static write_Callback_2(mthis, __arg_0, __arg_1) native "HTMLDocument_write_Callback";
-  write_Callback_2_(mthis, __arg_0, __arg_1) => write_Callback_2(mthis, __arg_0, __arg_1);
-
-  static write_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "HTMLDocument_write_Callback";
-  write_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => write_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static writeln_Callback_0(mthis) native "HTMLDocument_writeln_Callback";
-  writeln_Callback_0_(mthis) => writeln_Callback_0(mthis);
-
-  static writeln_Callback_1(mthis, __arg_0) native "HTMLDocument_writeln_Callback";
-  writeln_Callback_1_(mthis, __arg_0) => writeln_Callback_1(mthis, __arg_0);
-
-  static writeln_Callback_2(mthis, __arg_0, __arg_1) native "HTMLDocument_writeln_Callback";
-  writeln_Callback_2_(mthis, __arg_0, __arg_1) => writeln_Callback_2(mthis, __arg_0, __arg_1);
-
-  static writeln_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "HTMLDocument_writeln_Callback";
-  writeln_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => writeln_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  writeln_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "writeln", [__arg_0]);
 
 }
 
 class BlinkHTMLElement extends BlinkElement {
   static final instance = new BlinkHTMLElement();
 
-  static accessKey_Getter(mthis) native "HTMLElement_accessKey_Getter";
-  accessKey_Getter_(mthis) => accessKey_Getter(mthis);
+  accessKey_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "accessKey");
 
-  static accessKey_Setter(mthis, __arg_0) native "HTMLElement_accessKey_Setter";
-  accessKey_Setter_(mthis, __arg_0) => accessKey_Setter(mthis, __arg_0);
+  accessKey_Setter_(mthis, __arg_0) => mthis["accessKey"] = __arg_0;
 
-  static click_Callback_0(mthis) native "HTMLElement_click_Callback";
-  click_Callback_0_(mthis) => click_Callback_0(mthis);
+  click_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "click", []);
 
-  static click_Callback_1(mthis, __arg_0) native "HTMLElement_click_Callback";
-  click_Callback_1_(mthis, __arg_0) => click_Callback_1(mthis, __arg_0);
+  contentEditable_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "contentEditable");
 
-  static click_Callback_2(mthis, __arg_0, __arg_1) native "HTMLElement_click_Callback";
-  click_Callback_2_(mthis, __arg_0, __arg_1) => click_Callback_2(mthis, __arg_0, __arg_1);
+  contentEditable_Setter_(mthis, __arg_0) => mthis["contentEditable"] = __arg_0;
 
-  static contentEditable_Getter(mthis) native "HTMLElement_contentEditable_Getter";
-  contentEditable_Getter_(mthis) => contentEditable_Getter(mthis);
+  contextMenu_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "contextMenu");
 
-  static contentEditable_Setter(mthis, __arg_0) native "HTMLElement_contentEditable_Setter";
-  contentEditable_Setter_(mthis, __arg_0) => contentEditable_Setter(mthis, __arg_0);
+  contextMenu_Setter_(mthis, __arg_0) => mthis["contextMenu"] = __arg_0;
 
-  static contextMenu_Getter(mthis) native "HTMLElement_contextMenu_Getter";
-  contextMenu_Getter_(mthis) => contextMenu_Getter(mthis);
+  dir_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "dir");
 
-  static contextMenu_Setter(mthis, __arg_0) native "HTMLElement_contextMenu_Setter";
-  contextMenu_Setter_(mthis, __arg_0) => contextMenu_Setter(mthis, __arg_0);
+  dir_Setter_(mthis, __arg_0) => mthis["dir"] = __arg_0;
 
-  static dir_Getter(mthis) native "HTMLElement_dir_Getter";
-  dir_Getter_(mthis) => dir_Getter(mthis);
+  draggable_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "draggable");
 
-  static dir_Setter(mthis, __arg_0) native "HTMLElement_dir_Setter";
-  dir_Setter_(mthis, __arg_0) => dir_Setter(mthis, __arg_0);
+  draggable_Setter_(mthis, __arg_0) => mthis["draggable"] = __arg_0;
 
-  static draggable_Getter(mthis) native "HTMLElement_draggable_Getter";
-  draggable_Getter_(mthis) => draggable_Getter(mthis);
+  hidden_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "hidden");
 
-  static draggable_Setter(mthis, __arg_0) native "HTMLElement_draggable_Setter";
-  draggable_Setter_(mthis, __arg_0) => draggable_Setter(mthis, __arg_0);
+  hidden_Setter_(mthis, __arg_0) => mthis["hidden"] = __arg_0;
 
-  static hidden_Getter(mthis) native "HTMLElement_hidden_Getter";
-  hidden_Getter_(mthis) => hidden_Getter(mthis);
+  innerText_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "innerText");
 
-  static hidden_Setter(mthis, __arg_0) native "HTMLElement_hidden_Setter";
-  hidden_Setter_(mthis, __arg_0) => hidden_Setter(mthis, __arg_0);
+  innerText_Setter_(mthis, __arg_0) => mthis["innerText"] = __arg_0;
 
-  static innerText_Getter(mthis) native "HTMLElement_innerText_Getter";
-  innerText_Getter_(mthis) => innerText_Getter(mthis);
+  inputMethodContext_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "inputMethodContext");
 
-  static innerText_Setter(mthis, __arg_0) native "HTMLElement_innerText_Setter";
-  innerText_Setter_(mthis, __arg_0) => innerText_Setter(mthis, __arg_0);
+  isContentEditable_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "isContentEditable");
 
-  static inputMethodContext_Getter(mthis) native "HTMLElement_inputMethodContext_Getter";
-  inputMethodContext_Getter_(mthis) => inputMethodContext_Getter(mthis);
+  lang_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "lang");
 
-  static isContentEditable_Getter(mthis) native "HTMLElement_isContentEditable_Getter";
-  isContentEditable_Getter_(mthis) => isContentEditable_Getter(mthis);
+  lang_Setter_(mthis, __arg_0) => mthis["lang"] = __arg_0;
 
-  static lang_Getter(mthis) native "HTMLElement_lang_Getter";
-  lang_Getter_(mthis) => lang_Getter(mthis);
+  onabort_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onabort");
 
-  static lang_Setter(mthis, __arg_0) native "HTMLElement_lang_Setter";
-  lang_Setter_(mthis, __arg_0) => lang_Setter(mthis, __arg_0);
+  onabort_Setter_(mthis, __arg_0) => mthis["onabort"] = __arg_0;
 
-  static onabort_Getter(mthis) native "HTMLElement_onabort_Getter";
-  onabort_Getter_(mthis) => onabort_Getter(mthis);
+  onautocomplete_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onautocomplete");
 
-  static onabort_Setter(mthis, __arg_0) native "HTMLElement_onabort_Setter";
-  onabort_Setter_(mthis, __arg_0) => onabort_Setter(mthis, __arg_0);
+  onautocomplete_Setter_(mthis, __arg_0) => mthis["onautocomplete"] = __arg_0;
 
-  static onautocomplete_Getter(mthis) native "HTMLElement_onautocomplete_Getter";
-  onautocomplete_Getter_(mthis) => onautocomplete_Getter(mthis);
+  onautocompleteerror_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onautocompleteerror");
 
-  static onautocomplete_Setter(mthis, __arg_0) native "HTMLElement_onautocomplete_Setter";
-  onautocomplete_Setter_(mthis, __arg_0) => onautocomplete_Setter(mthis, __arg_0);
+  onautocompleteerror_Setter_(mthis, __arg_0) => mthis["onautocompleteerror"] = __arg_0;
 
-  static onautocompleteerror_Getter(mthis) native "HTMLElement_onautocompleteerror_Getter";
-  onautocompleteerror_Getter_(mthis) => onautocompleteerror_Getter(mthis);
+  onblur_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onblur");
 
-  static onautocompleteerror_Setter(mthis, __arg_0) native "HTMLElement_onautocompleteerror_Setter";
-  onautocompleteerror_Setter_(mthis, __arg_0) => onautocompleteerror_Setter(mthis, __arg_0);
+  onblur_Setter_(mthis, __arg_0) => mthis["onblur"] = __arg_0;
 
-  static onblur_Getter(mthis) native "HTMLElement_onblur_Getter";
-  onblur_Getter_(mthis) => onblur_Getter(mthis);
+  oncancel_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "oncancel");
 
-  static onblur_Setter(mthis, __arg_0) native "HTMLElement_onblur_Setter";
-  onblur_Setter_(mthis, __arg_0) => onblur_Setter(mthis, __arg_0);
+  oncancel_Setter_(mthis, __arg_0) => mthis["oncancel"] = __arg_0;
 
-  static oncancel_Getter(mthis) native "HTMLElement_oncancel_Getter";
-  oncancel_Getter_(mthis) => oncancel_Getter(mthis);
+  oncanplay_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "oncanplay");
 
-  static oncancel_Setter(mthis, __arg_0) native "HTMLElement_oncancel_Setter";
-  oncancel_Setter_(mthis, __arg_0) => oncancel_Setter(mthis, __arg_0);
+  oncanplay_Setter_(mthis, __arg_0) => mthis["oncanplay"] = __arg_0;
 
-  static oncanplay_Getter(mthis) native "HTMLElement_oncanplay_Getter";
-  oncanplay_Getter_(mthis) => oncanplay_Getter(mthis);
+  oncanplaythrough_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "oncanplaythrough");
 
-  static oncanplay_Setter(mthis, __arg_0) native "HTMLElement_oncanplay_Setter";
-  oncanplay_Setter_(mthis, __arg_0) => oncanplay_Setter(mthis, __arg_0);
+  oncanplaythrough_Setter_(mthis, __arg_0) => mthis["oncanplaythrough"] = __arg_0;
 
-  static oncanplaythrough_Getter(mthis) native "HTMLElement_oncanplaythrough_Getter";
-  oncanplaythrough_Getter_(mthis) => oncanplaythrough_Getter(mthis);
+  onchange_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onchange");
 
-  static oncanplaythrough_Setter(mthis, __arg_0) native "HTMLElement_oncanplaythrough_Setter";
-  oncanplaythrough_Setter_(mthis, __arg_0) => oncanplaythrough_Setter(mthis, __arg_0);
+  onchange_Setter_(mthis, __arg_0) => mthis["onchange"] = __arg_0;
 
-  static onchange_Getter(mthis) native "HTMLElement_onchange_Getter";
-  onchange_Getter_(mthis) => onchange_Getter(mthis);
+  onclick_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onclick");
 
-  static onchange_Setter(mthis, __arg_0) native "HTMLElement_onchange_Setter";
-  onchange_Setter_(mthis, __arg_0) => onchange_Setter(mthis, __arg_0);
+  onclick_Setter_(mthis, __arg_0) => mthis["onclick"] = __arg_0;
 
-  static onclick_Getter(mthis) native "HTMLElement_onclick_Getter";
-  onclick_Getter_(mthis) => onclick_Getter(mthis);
+  onclose_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onclose");
 
-  static onclick_Setter(mthis, __arg_0) native "HTMLElement_onclick_Setter";
-  onclick_Setter_(mthis, __arg_0) => onclick_Setter(mthis, __arg_0);
+  onclose_Setter_(mthis, __arg_0) => mthis["onclose"] = __arg_0;
 
-  static onclose_Getter(mthis) native "HTMLElement_onclose_Getter";
-  onclose_Getter_(mthis) => onclose_Getter(mthis);
+  oncontextmenu_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "oncontextmenu");
 
-  static onclose_Setter(mthis, __arg_0) native "HTMLElement_onclose_Setter";
-  onclose_Setter_(mthis, __arg_0) => onclose_Setter(mthis, __arg_0);
+  oncontextmenu_Setter_(mthis, __arg_0) => mthis["oncontextmenu"] = __arg_0;
 
-  static oncontextmenu_Getter(mthis) native "HTMLElement_oncontextmenu_Getter";
-  oncontextmenu_Getter_(mthis) => oncontextmenu_Getter(mthis);
+  oncuechange_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "oncuechange");
 
-  static oncontextmenu_Setter(mthis, __arg_0) native "HTMLElement_oncontextmenu_Setter";
-  oncontextmenu_Setter_(mthis, __arg_0) => oncontextmenu_Setter(mthis, __arg_0);
+  oncuechange_Setter_(mthis, __arg_0) => mthis["oncuechange"] = __arg_0;
 
-  static oncuechange_Getter(mthis) native "HTMLElement_oncuechange_Getter";
-  oncuechange_Getter_(mthis) => oncuechange_Getter(mthis);
+  ondblclick_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ondblclick");
 
-  static oncuechange_Setter(mthis, __arg_0) native "HTMLElement_oncuechange_Setter";
-  oncuechange_Setter_(mthis, __arg_0) => oncuechange_Setter(mthis, __arg_0);
+  ondblclick_Setter_(mthis, __arg_0) => mthis["ondblclick"] = __arg_0;
 
-  static ondblclick_Getter(mthis) native "HTMLElement_ondblclick_Getter";
-  ondblclick_Getter_(mthis) => ondblclick_Getter(mthis);
+  ondrag_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ondrag");
 
-  static ondblclick_Setter(mthis, __arg_0) native "HTMLElement_ondblclick_Setter";
-  ondblclick_Setter_(mthis, __arg_0) => ondblclick_Setter(mthis, __arg_0);
+  ondrag_Setter_(mthis, __arg_0) => mthis["ondrag"] = __arg_0;
 
-  static ondrag_Getter(mthis) native "HTMLElement_ondrag_Getter";
-  ondrag_Getter_(mthis) => ondrag_Getter(mthis);
+  ondragend_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ondragend");
 
-  static ondrag_Setter(mthis, __arg_0) native "HTMLElement_ondrag_Setter";
-  ondrag_Setter_(mthis, __arg_0) => ondrag_Setter(mthis, __arg_0);
+  ondragend_Setter_(mthis, __arg_0) => mthis["ondragend"] = __arg_0;
 
-  static ondragend_Getter(mthis) native "HTMLElement_ondragend_Getter";
-  ondragend_Getter_(mthis) => ondragend_Getter(mthis);
+  ondragenter_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ondragenter");
 
-  static ondragend_Setter(mthis, __arg_0) native "HTMLElement_ondragend_Setter";
-  ondragend_Setter_(mthis, __arg_0) => ondragend_Setter(mthis, __arg_0);
+  ondragenter_Setter_(mthis, __arg_0) => mthis["ondragenter"] = __arg_0;
 
-  static ondragenter_Getter(mthis) native "HTMLElement_ondragenter_Getter";
-  ondragenter_Getter_(mthis) => ondragenter_Getter(mthis);
+  ondragleave_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ondragleave");
 
-  static ondragenter_Setter(mthis, __arg_0) native "HTMLElement_ondragenter_Setter";
-  ondragenter_Setter_(mthis, __arg_0) => ondragenter_Setter(mthis, __arg_0);
+  ondragleave_Setter_(mthis, __arg_0) => mthis["ondragleave"] = __arg_0;
 
-  static ondragleave_Getter(mthis) native "HTMLElement_ondragleave_Getter";
-  ondragleave_Getter_(mthis) => ondragleave_Getter(mthis);
+  ondragover_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ondragover");
 
-  static ondragleave_Setter(mthis, __arg_0) native "HTMLElement_ondragleave_Setter";
-  ondragleave_Setter_(mthis, __arg_0) => ondragleave_Setter(mthis, __arg_0);
+  ondragover_Setter_(mthis, __arg_0) => mthis["ondragover"] = __arg_0;
 
-  static ondragover_Getter(mthis) native "HTMLElement_ondragover_Getter";
-  ondragover_Getter_(mthis) => ondragover_Getter(mthis);
+  ondragstart_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ondragstart");
 
-  static ondragover_Setter(mthis, __arg_0) native "HTMLElement_ondragover_Setter";
-  ondragover_Setter_(mthis, __arg_0) => ondragover_Setter(mthis, __arg_0);
+  ondragstart_Setter_(mthis, __arg_0) => mthis["ondragstart"] = __arg_0;
 
-  static ondragstart_Getter(mthis) native "HTMLElement_ondragstart_Getter";
-  ondragstart_Getter_(mthis) => ondragstart_Getter(mthis);
+  ondrop_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ondrop");
 
-  static ondragstart_Setter(mthis, __arg_0) native "HTMLElement_ondragstart_Setter";
-  ondragstart_Setter_(mthis, __arg_0) => ondragstart_Setter(mthis, __arg_0);
+  ondrop_Setter_(mthis, __arg_0) => mthis["ondrop"] = __arg_0;
 
-  static ondrop_Getter(mthis) native "HTMLElement_ondrop_Getter";
-  ondrop_Getter_(mthis) => ondrop_Getter(mthis);
+  ondurationchange_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ondurationchange");
 
-  static ondrop_Setter(mthis, __arg_0) native "HTMLElement_ondrop_Setter";
-  ondrop_Setter_(mthis, __arg_0) => ondrop_Setter(mthis, __arg_0);
+  ondurationchange_Setter_(mthis, __arg_0) => mthis["ondurationchange"] = __arg_0;
 
-  static ondurationchange_Getter(mthis) native "HTMLElement_ondurationchange_Getter";
-  ondurationchange_Getter_(mthis) => ondurationchange_Getter(mthis);
+  onemptied_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onemptied");
 
-  static ondurationchange_Setter(mthis, __arg_0) native "HTMLElement_ondurationchange_Setter";
-  ondurationchange_Setter_(mthis, __arg_0) => ondurationchange_Setter(mthis, __arg_0);
+  onemptied_Setter_(mthis, __arg_0) => mthis["onemptied"] = __arg_0;
 
-  static onemptied_Getter(mthis) native "HTMLElement_onemptied_Getter";
-  onemptied_Getter_(mthis) => onemptied_Getter(mthis);
+  onended_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onended");
 
-  static onemptied_Setter(mthis, __arg_0) native "HTMLElement_onemptied_Setter";
-  onemptied_Setter_(mthis, __arg_0) => onemptied_Setter(mthis, __arg_0);
+  onended_Setter_(mthis, __arg_0) => mthis["onended"] = __arg_0;
 
-  static onended_Getter(mthis) native "HTMLElement_onended_Getter";
-  onended_Getter_(mthis) => onended_Getter(mthis);
+  onerror_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onerror");
 
-  static onended_Setter(mthis, __arg_0) native "HTMLElement_onended_Setter";
-  onended_Setter_(mthis, __arg_0) => onended_Setter(mthis, __arg_0);
+  onerror_Setter_(mthis, __arg_0) => mthis["onerror"] = __arg_0;
 
-  static onerror_Getter(mthis) native "HTMLElement_onerror_Getter";
-  onerror_Getter_(mthis) => onerror_Getter(mthis);
+  onfocus_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onfocus");
 
-  static onerror_Setter(mthis, __arg_0) native "HTMLElement_onerror_Setter";
-  onerror_Setter_(mthis, __arg_0) => onerror_Setter(mthis, __arg_0);
+  onfocus_Setter_(mthis, __arg_0) => mthis["onfocus"] = __arg_0;
 
-  static onfocus_Getter(mthis) native "HTMLElement_onfocus_Getter";
-  onfocus_Getter_(mthis) => onfocus_Getter(mthis);
+  oninput_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "oninput");
 
-  static onfocus_Setter(mthis, __arg_0) native "HTMLElement_onfocus_Setter";
-  onfocus_Setter_(mthis, __arg_0) => onfocus_Setter(mthis, __arg_0);
+  oninput_Setter_(mthis, __arg_0) => mthis["oninput"] = __arg_0;
 
-  static oninput_Getter(mthis) native "HTMLElement_oninput_Getter";
-  oninput_Getter_(mthis) => oninput_Getter(mthis);
+  oninvalid_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "oninvalid");
 
-  static oninput_Setter(mthis, __arg_0) native "HTMLElement_oninput_Setter";
-  oninput_Setter_(mthis, __arg_0) => oninput_Setter(mthis, __arg_0);
+  oninvalid_Setter_(mthis, __arg_0) => mthis["oninvalid"] = __arg_0;
 
-  static oninvalid_Getter(mthis) native "HTMLElement_oninvalid_Getter";
-  oninvalid_Getter_(mthis) => oninvalid_Getter(mthis);
+  onkeydown_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onkeydown");
 
-  static oninvalid_Setter(mthis, __arg_0) native "HTMLElement_oninvalid_Setter";
-  oninvalid_Setter_(mthis, __arg_0) => oninvalid_Setter(mthis, __arg_0);
+  onkeydown_Setter_(mthis, __arg_0) => mthis["onkeydown"] = __arg_0;
 
-  static onkeydown_Getter(mthis) native "HTMLElement_onkeydown_Getter";
-  onkeydown_Getter_(mthis) => onkeydown_Getter(mthis);
+  onkeypress_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onkeypress");
 
-  static onkeydown_Setter(mthis, __arg_0) native "HTMLElement_onkeydown_Setter";
-  onkeydown_Setter_(mthis, __arg_0) => onkeydown_Setter(mthis, __arg_0);
+  onkeypress_Setter_(mthis, __arg_0) => mthis["onkeypress"] = __arg_0;
 
-  static onkeypress_Getter(mthis) native "HTMLElement_onkeypress_Getter";
-  onkeypress_Getter_(mthis) => onkeypress_Getter(mthis);
-
-  static onkeypress_Setter(mthis, __arg_0) native "HTMLElement_onkeypress_Setter";
-  onkeypress_Setter_(mthis, __arg_0) => onkeypress_Setter(mthis, __arg_0);
-
-  static onkeyup_Getter(mthis) native "HTMLElement_onkeyup_Getter";
-  onkeyup_Getter_(mthis) => onkeyup_Getter(mthis);
+  onkeyup_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onkeyup");
 
-  static onkeyup_Setter(mthis, __arg_0) native "HTMLElement_onkeyup_Setter";
-  onkeyup_Setter_(mthis, __arg_0) => onkeyup_Setter(mthis, __arg_0);
+  onkeyup_Setter_(mthis, __arg_0) => mthis["onkeyup"] = __arg_0;
 
-  static onload_Getter(mthis) native "HTMLElement_onload_Getter";
-  onload_Getter_(mthis) => onload_Getter(mthis);
+  onload_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onload");
 
-  static onload_Setter(mthis, __arg_0) native "HTMLElement_onload_Setter";
-  onload_Setter_(mthis, __arg_0) => onload_Setter(mthis, __arg_0);
+  onload_Setter_(mthis, __arg_0) => mthis["onload"] = __arg_0;
 
-  static onloadeddata_Getter(mthis) native "HTMLElement_onloadeddata_Getter";
-  onloadeddata_Getter_(mthis) => onloadeddata_Getter(mthis);
+  onloadeddata_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onloadeddata");
 
-  static onloadeddata_Setter(mthis, __arg_0) native "HTMLElement_onloadeddata_Setter";
-  onloadeddata_Setter_(mthis, __arg_0) => onloadeddata_Setter(mthis, __arg_0);
+  onloadeddata_Setter_(mthis, __arg_0) => mthis["onloadeddata"] = __arg_0;
 
-  static onloadedmetadata_Getter(mthis) native "HTMLElement_onloadedmetadata_Getter";
-  onloadedmetadata_Getter_(mthis) => onloadedmetadata_Getter(mthis);
+  onloadedmetadata_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onloadedmetadata");
 
-  static onloadedmetadata_Setter(mthis, __arg_0) native "HTMLElement_onloadedmetadata_Setter";
-  onloadedmetadata_Setter_(mthis, __arg_0) => onloadedmetadata_Setter(mthis, __arg_0);
+  onloadedmetadata_Setter_(mthis, __arg_0) => mthis["onloadedmetadata"] = __arg_0;
 
-  static onloadstart_Getter(mthis) native "HTMLElement_onloadstart_Getter";
-  onloadstart_Getter_(mthis) => onloadstart_Getter(mthis);
+  onloadstart_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onloadstart");
 
-  static onloadstart_Setter(mthis, __arg_0) native "HTMLElement_onloadstart_Setter";
-  onloadstart_Setter_(mthis, __arg_0) => onloadstart_Setter(mthis, __arg_0);
+  onloadstart_Setter_(mthis, __arg_0) => mthis["onloadstart"] = __arg_0;
 
-  static onmousedown_Getter(mthis) native "HTMLElement_onmousedown_Getter";
-  onmousedown_Getter_(mthis) => onmousedown_Getter(mthis);
+  onmousedown_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onmousedown");
 
-  static onmousedown_Setter(mthis, __arg_0) native "HTMLElement_onmousedown_Setter";
-  onmousedown_Setter_(mthis, __arg_0) => onmousedown_Setter(mthis, __arg_0);
+  onmousedown_Setter_(mthis, __arg_0) => mthis["onmousedown"] = __arg_0;
 
-  static onmouseenter_Getter(mthis) native "HTMLElement_onmouseenter_Getter";
-  onmouseenter_Getter_(mthis) => onmouseenter_Getter(mthis);
+  onmouseenter_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onmouseenter");
 
-  static onmouseenter_Setter(mthis, __arg_0) native "HTMLElement_onmouseenter_Setter";
-  onmouseenter_Setter_(mthis, __arg_0) => onmouseenter_Setter(mthis, __arg_0);
+  onmouseenter_Setter_(mthis, __arg_0) => mthis["onmouseenter"] = __arg_0;
 
-  static onmouseleave_Getter(mthis) native "HTMLElement_onmouseleave_Getter";
-  onmouseleave_Getter_(mthis) => onmouseleave_Getter(mthis);
+  onmouseleave_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onmouseleave");
 
-  static onmouseleave_Setter(mthis, __arg_0) native "HTMLElement_onmouseleave_Setter";
-  onmouseleave_Setter_(mthis, __arg_0) => onmouseleave_Setter(mthis, __arg_0);
+  onmouseleave_Setter_(mthis, __arg_0) => mthis["onmouseleave"] = __arg_0;
 
-  static onmousemove_Getter(mthis) native "HTMLElement_onmousemove_Getter";
-  onmousemove_Getter_(mthis) => onmousemove_Getter(mthis);
+  onmousemove_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onmousemove");
 
-  static onmousemove_Setter(mthis, __arg_0) native "HTMLElement_onmousemove_Setter";
-  onmousemove_Setter_(mthis, __arg_0) => onmousemove_Setter(mthis, __arg_0);
+  onmousemove_Setter_(mthis, __arg_0) => mthis["onmousemove"] = __arg_0;
 
-  static onmouseout_Getter(mthis) native "HTMLElement_onmouseout_Getter";
-  onmouseout_Getter_(mthis) => onmouseout_Getter(mthis);
+  onmouseout_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onmouseout");
 
-  static onmouseout_Setter(mthis, __arg_0) native "HTMLElement_onmouseout_Setter";
-  onmouseout_Setter_(mthis, __arg_0) => onmouseout_Setter(mthis, __arg_0);
+  onmouseout_Setter_(mthis, __arg_0) => mthis["onmouseout"] = __arg_0;
 
-  static onmouseover_Getter(mthis) native "HTMLElement_onmouseover_Getter";
-  onmouseover_Getter_(mthis) => onmouseover_Getter(mthis);
+  onmouseover_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onmouseover");
 
-  static onmouseover_Setter(mthis, __arg_0) native "HTMLElement_onmouseover_Setter";
-  onmouseover_Setter_(mthis, __arg_0) => onmouseover_Setter(mthis, __arg_0);
+  onmouseover_Setter_(mthis, __arg_0) => mthis["onmouseover"] = __arg_0;
 
-  static onmouseup_Getter(mthis) native "HTMLElement_onmouseup_Getter";
-  onmouseup_Getter_(mthis) => onmouseup_Getter(mthis);
+  onmouseup_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onmouseup");
 
-  static onmouseup_Setter(mthis, __arg_0) native "HTMLElement_onmouseup_Setter";
-  onmouseup_Setter_(mthis, __arg_0) => onmouseup_Setter(mthis, __arg_0);
+  onmouseup_Setter_(mthis, __arg_0) => mthis["onmouseup"] = __arg_0;
 
-  static onmousewheel_Getter(mthis) native "HTMLElement_onmousewheel_Getter";
-  onmousewheel_Getter_(mthis) => onmousewheel_Getter(mthis);
+  onmousewheel_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onmousewheel");
 
-  static onmousewheel_Setter(mthis, __arg_0) native "HTMLElement_onmousewheel_Setter";
-  onmousewheel_Setter_(mthis, __arg_0) => onmousewheel_Setter(mthis, __arg_0);
+  onmousewheel_Setter_(mthis, __arg_0) => mthis["onmousewheel"] = __arg_0;
 
-  static onpause_Getter(mthis) native "HTMLElement_onpause_Getter";
-  onpause_Getter_(mthis) => onpause_Getter(mthis);
+  onpause_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onpause");
 
-  static onpause_Setter(mthis, __arg_0) native "HTMLElement_onpause_Setter";
-  onpause_Setter_(mthis, __arg_0) => onpause_Setter(mthis, __arg_0);
+  onpause_Setter_(mthis, __arg_0) => mthis["onpause"] = __arg_0;
 
-  static onplay_Getter(mthis) native "HTMLElement_onplay_Getter";
-  onplay_Getter_(mthis) => onplay_Getter(mthis);
+  onplay_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onplay");
 
-  static onplay_Setter(mthis, __arg_0) native "HTMLElement_onplay_Setter";
-  onplay_Setter_(mthis, __arg_0) => onplay_Setter(mthis, __arg_0);
+  onplay_Setter_(mthis, __arg_0) => mthis["onplay"] = __arg_0;
 
-  static onplaying_Getter(mthis) native "HTMLElement_onplaying_Getter";
-  onplaying_Getter_(mthis) => onplaying_Getter(mthis);
+  onplaying_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onplaying");
 
-  static onplaying_Setter(mthis, __arg_0) native "HTMLElement_onplaying_Setter";
-  onplaying_Setter_(mthis, __arg_0) => onplaying_Setter(mthis, __arg_0);
+  onplaying_Setter_(mthis, __arg_0) => mthis["onplaying"] = __arg_0;
 
-  static onprogress_Getter(mthis) native "HTMLElement_onprogress_Getter";
-  onprogress_Getter_(mthis) => onprogress_Getter(mthis);
+  onprogress_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onprogress");
 
-  static onprogress_Setter(mthis, __arg_0) native "HTMLElement_onprogress_Setter";
-  onprogress_Setter_(mthis, __arg_0) => onprogress_Setter(mthis, __arg_0);
+  onprogress_Setter_(mthis, __arg_0) => mthis["onprogress"] = __arg_0;
 
-  static onratechange_Getter(mthis) native "HTMLElement_onratechange_Getter";
-  onratechange_Getter_(mthis) => onratechange_Getter(mthis);
+  onratechange_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onratechange");
 
-  static onratechange_Setter(mthis, __arg_0) native "HTMLElement_onratechange_Setter";
-  onratechange_Setter_(mthis, __arg_0) => onratechange_Setter(mthis, __arg_0);
+  onratechange_Setter_(mthis, __arg_0) => mthis["onratechange"] = __arg_0;
 
-  static onreset_Getter(mthis) native "HTMLElement_onreset_Getter";
-  onreset_Getter_(mthis) => onreset_Getter(mthis);
+  onreset_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onreset");
 
-  static onreset_Setter(mthis, __arg_0) native "HTMLElement_onreset_Setter";
-  onreset_Setter_(mthis, __arg_0) => onreset_Setter(mthis, __arg_0);
+  onreset_Setter_(mthis, __arg_0) => mthis["onreset"] = __arg_0;
 
-  static onresize_Getter(mthis) native "HTMLElement_onresize_Getter";
-  onresize_Getter_(mthis) => onresize_Getter(mthis);
+  onresize_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onresize");
 
-  static onresize_Setter(mthis, __arg_0) native "HTMLElement_onresize_Setter";
-  onresize_Setter_(mthis, __arg_0) => onresize_Setter(mthis, __arg_0);
+  onresize_Setter_(mthis, __arg_0) => mthis["onresize"] = __arg_0;
 
-  static onscroll_Getter(mthis) native "HTMLElement_onscroll_Getter";
-  onscroll_Getter_(mthis) => onscroll_Getter(mthis);
+  onscroll_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onscroll");
 
-  static onscroll_Setter(mthis, __arg_0) native "HTMLElement_onscroll_Setter";
-  onscroll_Setter_(mthis, __arg_0) => onscroll_Setter(mthis, __arg_0);
+  onscroll_Setter_(mthis, __arg_0) => mthis["onscroll"] = __arg_0;
 
-  static onseeked_Getter(mthis) native "HTMLElement_onseeked_Getter";
-  onseeked_Getter_(mthis) => onseeked_Getter(mthis);
+  onseeked_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onseeked");
 
-  static onseeked_Setter(mthis, __arg_0) native "HTMLElement_onseeked_Setter";
-  onseeked_Setter_(mthis, __arg_0) => onseeked_Setter(mthis, __arg_0);
+  onseeked_Setter_(mthis, __arg_0) => mthis["onseeked"] = __arg_0;
 
-  static onseeking_Getter(mthis) native "HTMLElement_onseeking_Getter";
-  onseeking_Getter_(mthis) => onseeking_Getter(mthis);
+  onseeking_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onseeking");
 
-  static onseeking_Setter(mthis, __arg_0) native "HTMLElement_onseeking_Setter";
-  onseeking_Setter_(mthis, __arg_0) => onseeking_Setter(mthis, __arg_0);
+  onseeking_Setter_(mthis, __arg_0) => mthis["onseeking"] = __arg_0;
 
-  static onselect_Getter(mthis) native "HTMLElement_onselect_Getter";
-  onselect_Getter_(mthis) => onselect_Getter(mthis);
+  onselect_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onselect");
 
-  static onselect_Setter(mthis, __arg_0) native "HTMLElement_onselect_Setter";
-  onselect_Setter_(mthis, __arg_0) => onselect_Setter(mthis, __arg_0);
+  onselect_Setter_(mthis, __arg_0) => mthis["onselect"] = __arg_0;
 
-  static onshow_Getter(mthis) native "HTMLElement_onshow_Getter";
-  onshow_Getter_(mthis) => onshow_Getter(mthis);
+  onshow_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onshow");
 
-  static onshow_Setter(mthis, __arg_0) native "HTMLElement_onshow_Setter";
-  onshow_Setter_(mthis, __arg_0) => onshow_Setter(mthis, __arg_0);
+  onshow_Setter_(mthis, __arg_0) => mthis["onshow"] = __arg_0;
 
-  static onstalled_Getter(mthis) native "HTMLElement_onstalled_Getter";
-  onstalled_Getter_(mthis) => onstalled_Getter(mthis);
+  onstalled_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onstalled");
 
-  static onstalled_Setter(mthis, __arg_0) native "HTMLElement_onstalled_Setter";
-  onstalled_Setter_(mthis, __arg_0) => onstalled_Setter(mthis, __arg_0);
+  onstalled_Setter_(mthis, __arg_0) => mthis["onstalled"] = __arg_0;
 
-  static onsubmit_Getter(mthis) native "HTMLElement_onsubmit_Getter";
-  onsubmit_Getter_(mthis) => onsubmit_Getter(mthis);
+  onsubmit_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onsubmit");
 
-  static onsubmit_Setter(mthis, __arg_0) native "HTMLElement_onsubmit_Setter";
-  onsubmit_Setter_(mthis, __arg_0) => onsubmit_Setter(mthis, __arg_0);
+  onsubmit_Setter_(mthis, __arg_0) => mthis["onsubmit"] = __arg_0;
 
-  static onsuspend_Getter(mthis) native "HTMLElement_onsuspend_Getter";
-  onsuspend_Getter_(mthis) => onsuspend_Getter(mthis);
+  onsuspend_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onsuspend");
 
-  static onsuspend_Setter(mthis, __arg_0) native "HTMLElement_onsuspend_Setter";
-  onsuspend_Setter_(mthis, __arg_0) => onsuspend_Setter(mthis, __arg_0);
+  onsuspend_Setter_(mthis, __arg_0) => mthis["onsuspend"] = __arg_0;
 
-  static ontimeupdate_Getter(mthis) native "HTMLElement_ontimeupdate_Getter";
-  ontimeupdate_Getter_(mthis) => ontimeupdate_Getter(mthis);
+  ontimeupdate_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ontimeupdate");
 
-  static ontimeupdate_Setter(mthis, __arg_0) native "HTMLElement_ontimeupdate_Setter";
-  ontimeupdate_Setter_(mthis, __arg_0) => ontimeupdate_Setter(mthis, __arg_0);
+  ontimeupdate_Setter_(mthis, __arg_0) => mthis["ontimeupdate"] = __arg_0;
 
-  static ontoggle_Getter(mthis) native "HTMLElement_ontoggle_Getter";
-  ontoggle_Getter_(mthis) => ontoggle_Getter(mthis);
+  ontoggle_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ontoggle");
 
-  static ontoggle_Setter(mthis, __arg_0) native "HTMLElement_ontoggle_Setter";
-  ontoggle_Setter_(mthis, __arg_0) => ontoggle_Setter(mthis, __arg_0);
+  ontoggle_Setter_(mthis, __arg_0) => mthis["ontoggle"] = __arg_0;
 
-  static onvolumechange_Getter(mthis) native "HTMLElement_onvolumechange_Getter";
-  onvolumechange_Getter_(mthis) => onvolumechange_Getter(mthis);
+  onvolumechange_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onvolumechange");
 
-  static onvolumechange_Setter(mthis, __arg_0) native "HTMLElement_onvolumechange_Setter";
-  onvolumechange_Setter_(mthis, __arg_0) => onvolumechange_Setter(mthis, __arg_0);
+  onvolumechange_Setter_(mthis, __arg_0) => mthis["onvolumechange"] = __arg_0;
 
-  static onwaiting_Getter(mthis) native "HTMLElement_onwaiting_Getter";
-  onwaiting_Getter_(mthis) => onwaiting_Getter(mthis);
+  onwaiting_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onwaiting");
 
-  static onwaiting_Setter(mthis, __arg_0) native "HTMLElement_onwaiting_Setter";
-  onwaiting_Setter_(mthis, __arg_0) => onwaiting_Setter(mthis, __arg_0);
+  onwaiting_Setter_(mthis, __arg_0) => mthis["onwaiting"] = __arg_0;
 
-  static outerText_Getter(mthis) native "HTMLElement_outerText_Getter";
-  outerText_Getter_(mthis) => outerText_Getter(mthis);
+  outerText_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "outerText");
 
-  static outerText_Setter(mthis, __arg_0) native "HTMLElement_outerText_Setter";
-  outerText_Setter_(mthis, __arg_0) => outerText_Setter(mthis, __arg_0);
+  outerText_Setter_(mthis, __arg_0) => mthis["outerText"] = __arg_0;
 
-  static spellcheck_Getter(mthis) native "HTMLElement_spellcheck_Getter";
-  spellcheck_Getter_(mthis) => spellcheck_Getter(mthis);
+  spellcheck_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "spellcheck");
 
-  static spellcheck_Setter(mthis, __arg_0) native "HTMLElement_spellcheck_Setter";
-  spellcheck_Setter_(mthis, __arg_0) => spellcheck_Setter(mthis, __arg_0);
+  spellcheck_Setter_(mthis, __arg_0) => mthis["spellcheck"] = __arg_0;
 
-  static tabIndex_Getter(mthis) native "HTMLElement_tabIndex_Getter";
-  tabIndex_Getter_(mthis) => tabIndex_Getter(mthis);
+  tabIndex_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "tabIndex");
 
-  static tabIndex_Setter(mthis, __arg_0) native "HTMLElement_tabIndex_Setter";
-  tabIndex_Setter_(mthis, __arg_0) => tabIndex_Setter(mthis, __arg_0);
+  tabIndex_Setter_(mthis, __arg_0) => mthis["tabIndex"] = __arg_0;
 
-  static title_Getter(mthis) native "HTMLElement_title_Getter";
-  title_Getter_(mthis) => title_Getter(mthis);
+  title_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "title");
 
-  static title_Setter(mthis, __arg_0) native "HTMLElement_title_Setter";
-  title_Setter_(mthis, __arg_0) => title_Setter(mthis, __arg_0);
+  title_Setter_(mthis, __arg_0) => mthis["title"] = __arg_0;
 
-  static translate_Getter(mthis) native "HTMLElement_translate_Getter";
-  translate_Getter_(mthis) => translate_Getter(mthis);
+  translate_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "translate");
 
-  static translate_Setter(mthis, __arg_0) native "HTMLElement_translate_Setter";
-  translate_Setter_(mthis, __arg_0) => translate_Setter(mthis, __arg_0);
+  translate_Setter_(mthis, __arg_0) => mthis["translate"] = __arg_0;
 
-  static webkitdropzone_Getter(mthis) native "HTMLElement_webkitdropzone_Getter";
-  webkitdropzone_Getter_(mthis) => webkitdropzone_Getter(mthis);
+  webkitdropzone_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "webkitdropzone");
 
-  static webkitdropzone_Setter(mthis, __arg_0) native "HTMLElement_webkitdropzone_Setter";
-  webkitdropzone_Setter_(mthis, __arg_0) => webkitdropzone_Setter(mthis, __arg_0);
+  webkitdropzone_Setter_(mthis, __arg_0) => mthis["webkitdropzone"] = __arg_0;
 
 }
 
 class BlinkHTMLEmbedElement extends BlinkHTMLElement {
   static final instance = new BlinkHTMLEmbedElement();
 
-  static $__getter___Callback_1(mthis, __arg_0) native "HTMLEmbedElement___getter___Callback";
-  $__getter___Callback_1_(mthis, __arg_0) => $__getter___Callback_1(mthis, __arg_0);
+  $__getter___Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "__getter__", [__arg_0]);
 
-  static $__setter___Callback_2(mthis, __arg_0, __arg_1) native "HTMLEmbedElement___setter___Callback";
-  $__setter___Callback_2_(mthis, __arg_0, __arg_1) => $__setter___Callback_2(mthis, __arg_0, __arg_1);
+  $__setter___Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "__setter__", [__arg_0, __arg_1]);
 
-  static align_Getter(mthis) native "HTMLEmbedElement_align_Getter";
-  align_Getter_(mthis) => align_Getter(mthis);
+  align_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "align");
 
-  static align_Setter(mthis, __arg_0) native "HTMLEmbedElement_align_Setter";
-  align_Setter_(mthis, __arg_0) => align_Setter(mthis, __arg_0);
+  align_Setter_(mthis, __arg_0) => mthis["align"] = __arg_0;
 
-  static getSVGDocument_Callback_0(mthis) native "HTMLEmbedElement_getSVGDocument_Callback";
-  getSVGDocument_Callback_0_(mthis) => getSVGDocument_Callback_0(mthis);
+  getSVGDocument_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getSVGDocument", []);
 
-  static getSVGDocument_Callback_1(mthis, __arg_0) native "HTMLEmbedElement_getSVGDocument_Callback";
-  getSVGDocument_Callback_1_(mthis, __arg_0) => getSVGDocument_Callback_1(mthis, __arg_0);
+  height_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "height");
 
-  static getSVGDocument_Callback_2(mthis, __arg_0, __arg_1) native "HTMLEmbedElement_getSVGDocument_Callback";
-  getSVGDocument_Callback_2_(mthis, __arg_0, __arg_1) => getSVGDocument_Callback_2(mthis, __arg_0, __arg_1);
+  height_Setter_(mthis, __arg_0) => mthis["height"] = __arg_0;
 
-  static height_Getter(mthis) native "HTMLEmbedElement_height_Getter";
-  height_Getter_(mthis) => height_Getter(mthis);
+  integrity_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "integrity");
 
-  static height_Setter(mthis, __arg_0) native "HTMLEmbedElement_height_Setter";
-  height_Setter_(mthis, __arg_0) => height_Setter(mthis, __arg_0);
+  integrity_Setter_(mthis, __arg_0) => mthis["integrity"] = __arg_0;
 
-  static integrity_Getter(mthis) native "HTMLEmbedElement_integrity_Getter";
-  integrity_Getter_(mthis) => integrity_Getter(mthis);
+  name_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "name");
 
-  static integrity_Setter(mthis, __arg_0) native "HTMLEmbedElement_integrity_Setter";
-  integrity_Setter_(mthis, __arg_0) => integrity_Setter(mthis, __arg_0);
+  name_Setter_(mthis, __arg_0) => mthis["name"] = __arg_0;
 
-  static name_Getter(mthis) native "HTMLEmbedElement_name_Getter";
-  name_Getter_(mthis) => name_Getter(mthis);
+  src_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "src");
 
-  static name_Setter(mthis, __arg_0) native "HTMLEmbedElement_name_Setter";
-  name_Setter_(mthis, __arg_0) => name_Setter(mthis, __arg_0);
+  src_Setter_(mthis, __arg_0) => mthis["src"] = __arg_0;
 
-  static src_Getter(mthis) native "HTMLEmbedElement_src_Getter";
-  src_Getter_(mthis) => src_Getter(mthis);
+  type_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "type");
 
-  static src_Setter(mthis, __arg_0) native "HTMLEmbedElement_src_Setter";
-  src_Setter_(mthis, __arg_0) => src_Setter(mthis, __arg_0);
+  type_Setter_(mthis, __arg_0) => mthis["type"] = __arg_0;
 
-  static type_Getter(mthis) native "HTMLEmbedElement_type_Getter";
-  type_Getter_(mthis) => type_Getter(mthis);
+  width_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "width");
 
-  static type_Setter(mthis, __arg_0) native "HTMLEmbedElement_type_Setter";
-  type_Setter_(mthis, __arg_0) => type_Setter(mthis, __arg_0);
-
-  static width_Getter(mthis) native "HTMLEmbedElement_width_Getter";
-  width_Getter_(mthis) => width_Getter(mthis);
-
-  static width_Setter(mthis, __arg_0) native "HTMLEmbedElement_width_Setter";
-  width_Setter_(mthis, __arg_0) => width_Setter(mthis, __arg_0);
+  width_Setter_(mthis, __arg_0) => mthis["width"] = __arg_0;
 
 }
 
 class BlinkHTMLFieldSetElement extends BlinkHTMLElement {
   static final instance = new BlinkHTMLFieldSetElement();
 
-  static checkValidity_Callback_0(mthis) native "HTMLFieldSetElement_checkValidity_Callback";
-  checkValidity_Callback_0_(mthis) => checkValidity_Callback_0(mthis);
+  checkValidity_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "checkValidity", []);
 
-  static checkValidity_Callback_1(mthis, __arg_0) native "HTMLFieldSetElement_checkValidity_Callback";
-  checkValidity_Callback_1_(mthis, __arg_0) => checkValidity_Callback_1(mthis, __arg_0);
+  disabled_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "disabled");
 
-  static checkValidity_Callback_2(mthis, __arg_0, __arg_1) native "HTMLFieldSetElement_checkValidity_Callback";
-  checkValidity_Callback_2_(mthis, __arg_0, __arg_1) => checkValidity_Callback_2(mthis, __arg_0, __arg_1);
+  disabled_Setter_(mthis, __arg_0) => mthis["disabled"] = __arg_0;
 
-  static disabled_Getter(mthis) native "HTMLFieldSetElement_disabled_Getter";
-  disabled_Getter_(mthis) => disabled_Getter(mthis);
+  elements_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "elements");
 
-  static disabled_Setter(mthis, __arg_0) native "HTMLFieldSetElement_disabled_Setter";
-  disabled_Setter_(mthis, __arg_0) => disabled_Setter(mthis, __arg_0);
+  form_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "form");
 
-  static elements_Getter(mthis) native "HTMLFieldSetElement_elements_Getter";
-  elements_Getter_(mthis) => elements_Getter(mthis);
+  name_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "name");
 
-  static form_Getter(mthis) native "HTMLFieldSetElement_form_Getter";
-  form_Getter_(mthis) => form_Getter(mthis);
+  name_Setter_(mthis, __arg_0) => mthis["name"] = __arg_0;
 
-  static name_Getter(mthis) native "HTMLFieldSetElement_name_Getter";
-  name_Getter_(mthis) => name_Getter(mthis);
+  setCustomValidity_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "setCustomValidity", []);
 
-  static name_Setter(mthis, __arg_0) native "HTMLFieldSetElement_name_Setter";
-  name_Setter_(mthis, __arg_0) => name_Setter(mthis, __arg_0);
+  setCustomValidity_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "setCustomValidity", [__arg_0]);
 
-  static setCustomValidity_Callback_0(mthis) native "HTMLFieldSetElement_setCustomValidity_Callback";
-  setCustomValidity_Callback_0_(mthis) => setCustomValidity_Callback_0(mthis);
+  type_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "type");
 
-  static setCustomValidity_Callback_1(mthis, __arg_0) native "HTMLFieldSetElement_setCustomValidity_Callback";
-  setCustomValidity_Callback_1_(mthis, __arg_0) => setCustomValidity_Callback_1(mthis, __arg_0);
+  validationMessage_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "validationMessage");
 
-  static setCustomValidity_Callback_2(mthis, __arg_0, __arg_1) native "HTMLFieldSetElement_setCustomValidity_Callback";
-  setCustomValidity_Callback_2_(mthis, __arg_0, __arg_1) => setCustomValidity_Callback_2(mthis, __arg_0, __arg_1);
+  validity_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "validity");
 
-  static setCustomValidity_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "HTMLFieldSetElement_setCustomValidity_Callback";
-  setCustomValidity_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => setCustomValidity_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static type_Getter(mthis) native "HTMLFieldSetElement_type_Getter";
-  type_Getter_(mthis) => type_Getter(mthis);
-
-  static validationMessage_Getter(mthis) native "HTMLFieldSetElement_validationMessage_Getter";
-  validationMessage_Getter_(mthis) => validationMessage_Getter(mthis);
-
-  static validity_Getter(mthis) native "HTMLFieldSetElement_validity_Getter";
-  validity_Getter_(mthis) => validity_Getter(mthis);
-
-  static willValidate_Getter(mthis) native "HTMLFieldSetElement_willValidate_Getter";
-  willValidate_Getter_(mthis) => willValidate_Getter(mthis);
+  willValidate_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "willValidate");
 
 }
 
@@ -10389,124 +5805,66 @@
 class BlinkHTMLFormControlsCollection extends BlinkHTMLCollection {
   static final instance = new BlinkHTMLFormControlsCollection();
 
-  static $__getter___Callback_1(mthis, __arg_0) native "HTMLFormControlsCollection___getter___Callback";
-  $__getter___Callback_1_(mthis, __arg_0) => $__getter___Callback_1(mthis, __arg_0);
+  $__getter___Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "__getter__", [__arg_0]);
 
-  static namedItem_Callback_0(mthis) native "HTMLFormControlsCollection_namedItem_Callback";
-  namedItem_Callback_0_(mthis) => namedItem_Callback_0(mthis);
+  namedItem_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "namedItem", []);
 
-  static namedItem_Callback_1(mthis, __arg_0) native "HTMLFormControlsCollection_namedItem_Callback";
-  namedItem_Callback_1_(mthis, __arg_0) => namedItem_Callback_1(mthis, __arg_0);
-
-  static namedItem_Callback_2(mthis, __arg_0, __arg_1) native "HTMLFormControlsCollection_namedItem_Callback";
-  namedItem_Callback_2_(mthis, __arg_0, __arg_1) => namedItem_Callback_2(mthis, __arg_0, __arg_1);
-
-  static namedItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "HTMLFormControlsCollection_namedItem_Callback";
-  namedItem_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => namedItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  namedItem_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "namedItem", [__arg_0]);
 
 }
 
 class BlinkHTMLFormElement extends BlinkHTMLElement {
   static final instance = new BlinkHTMLFormElement();
 
-  static $__getter___Callback_1(mthis, __arg_0) native "HTMLFormElement___getter___Callback";
-  $__getter___Callback_1_(mthis, __arg_0) => $__getter___Callback_1(mthis, __arg_0);
+  $__getter___Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "__getter__", [__arg_0]);
 
-  static acceptCharset_Getter(mthis) native "HTMLFormElement_acceptCharset_Getter";
-  acceptCharset_Getter_(mthis) => acceptCharset_Getter(mthis);
+  acceptCharset_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "acceptCharset");
 
-  static acceptCharset_Setter(mthis, __arg_0) native "HTMLFormElement_acceptCharset_Setter";
-  acceptCharset_Setter_(mthis, __arg_0) => acceptCharset_Setter(mthis, __arg_0);
+  acceptCharset_Setter_(mthis, __arg_0) => mthis["acceptCharset"] = __arg_0;
 
-  static action_Getter(mthis) native "HTMLFormElement_action_Getter";
-  action_Getter_(mthis) => action_Getter(mthis);
+  action_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "action");
 
-  static action_Setter(mthis, __arg_0) native "HTMLFormElement_action_Setter";
-  action_Setter_(mthis, __arg_0) => action_Setter(mthis, __arg_0);
+  action_Setter_(mthis, __arg_0) => mthis["action"] = __arg_0;
 
-  static autocomplete_Getter(mthis) native "HTMLFormElement_autocomplete_Getter";
-  autocomplete_Getter_(mthis) => autocomplete_Getter(mthis);
+  autocomplete_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "autocomplete");
 
-  static autocomplete_Setter(mthis, __arg_0) native "HTMLFormElement_autocomplete_Setter";
-  autocomplete_Setter_(mthis, __arg_0) => autocomplete_Setter(mthis, __arg_0);
+  autocomplete_Setter_(mthis, __arg_0) => mthis["autocomplete"] = __arg_0;
 
-  static checkValidity_Callback_0(mthis) native "HTMLFormElement_checkValidity_Callback";
-  checkValidity_Callback_0_(mthis) => checkValidity_Callback_0(mthis);
+  checkValidity_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "checkValidity", []);
 
-  static checkValidity_Callback_1(mthis, __arg_0) native "HTMLFormElement_checkValidity_Callback";
-  checkValidity_Callback_1_(mthis, __arg_0) => checkValidity_Callback_1(mthis, __arg_0);
+  elements_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "elements");
 
-  static checkValidity_Callback_2(mthis, __arg_0, __arg_1) native "HTMLFormElement_checkValidity_Callback";
-  checkValidity_Callback_2_(mthis, __arg_0, __arg_1) => checkValidity_Callback_2(mthis, __arg_0, __arg_1);
+  encoding_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "encoding");
 
-  static elements_Getter(mthis) native "HTMLFormElement_elements_Getter";
-  elements_Getter_(mthis) => elements_Getter(mthis);
+  encoding_Setter_(mthis, __arg_0) => mthis["encoding"] = __arg_0;
 
-  static encoding_Getter(mthis) native "HTMLFormElement_encoding_Getter";
-  encoding_Getter_(mthis) => encoding_Getter(mthis);
+  enctype_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "enctype");
 
-  static encoding_Setter(mthis, __arg_0) native "HTMLFormElement_encoding_Setter";
-  encoding_Setter_(mthis, __arg_0) => encoding_Setter(mthis, __arg_0);
+  enctype_Setter_(mthis, __arg_0) => mthis["enctype"] = __arg_0;
 
-  static enctype_Getter(mthis) native "HTMLFormElement_enctype_Getter";
-  enctype_Getter_(mthis) => enctype_Getter(mthis);
+  length_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "length");
 
-  static enctype_Setter(mthis, __arg_0) native "HTMLFormElement_enctype_Setter";
-  enctype_Setter_(mthis, __arg_0) => enctype_Setter(mthis, __arg_0);
+  method_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "method");
 
-  static length_Getter(mthis) native "HTMLFormElement_length_Getter";
-  length_Getter_(mthis) => length_Getter(mthis);
+  method_Setter_(mthis, __arg_0) => mthis["method"] = __arg_0;
 
-  static method_Getter(mthis) native "HTMLFormElement_method_Getter";
-  method_Getter_(mthis) => method_Getter(mthis);
+  name_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "name");
 
-  static method_Setter(mthis, __arg_0) native "HTMLFormElement_method_Setter";
-  method_Setter_(mthis, __arg_0) => method_Setter(mthis, __arg_0);
+  name_Setter_(mthis, __arg_0) => mthis["name"] = __arg_0;
 
-  static name_Getter(mthis) native "HTMLFormElement_name_Getter";
-  name_Getter_(mthis) => name_Getter(mthis);
+  noValidate_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "noValidate");
 
-  static name_Setter(mthis, __arg_0) native "HTMLFormElement_name_Setter";
-  name_Setter_(mthis, __arg_0) => name_Setter(mthis, __arg_0);
+  noValidate_Setter_(mthis, __arg_0) => mthis["noValidate"] = __arg_0;
 
-  static noValidate_Getter(mthis) native "HTMLFormElement_noValidate_Getter";
-  noValidate_Getter_(mthis) => noValidate_Getter(mthis);
+  requestAutocomplete_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "requestAutocomplete", []);
 
-  static noValidate_Setter(mthis, __arg_0) native "HTMLFormElement_noValidate_Setter";
-  noValidate_Setter_(mthis, __arg_0) => noValidate_Setter(mthis, __arg_0);
+  reset_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "reset", []);
 
-  static requestAutocomplete_Callback_0(mthis) native "HTMLFormElement_requestAutocomplete_Callback";
-  requestAutocomplete_Callback_0_(mthis) => requestAutocomplete_Callback_0(mthis);
+  submit_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "submit", []);
 
-  static requestAutocomplete_Callback_1(mthis, __arg_0) native "HTMLFormElement_requestAutocomplete_Callback";
-  requestAutocomplete_Callback_1_(mthis, __arg_0) => requestAutocomplete_Callback_1(mthis, __arg_0);
+  target_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "target");
 
-  static requestAutocomplete_Callback_2(mthis, __arg_0, __arg_1) native "HTMLFormElement_requestAutocomplete_Callback";
-  requestAutocomplete_Callback_2_(mthis, __arg_0, __arg_1) => requestAutocomplete_Callback_2(mthis, __arg_0, __arg_1);
-
-  static reset_Callback_0(mthis) native "HTMLFormElement_reset_Callback";
-  reset_Callback_0_(mthis) => reset_Callback_0(mthis);
-
-  static reset_Callback_1(mthis, __arg_0) native "HTMLFormElement_reset_Callback";
-  reset_Callback_1_(mthis, __arg_0) => reset_Callback_1(mthis, __arg_0);
-
-  static reset_Callback_2(mthis, __arg_0, __arg_1) native "HTMLFormElement_reset_Callback";
-  reset_Callback_2_(mthis, __arg_0, __arg_1) => reset_Callback_2(mthis, __arg_0, __arg_1);
-
-  static submit_Callback_0(mthis) native "HTMLFormElement_submit_Callback";
-  submit_Callback_0_(mthis) => submit_Callback_0(mthis);
-
-  static submit_Callback_1(mthis, __arg_0) native "HTMLFormElement_submit_Callback";
-  submit_Callback_1_(mthis, __arg_0) => submit_Callback_1(mthis, __arg_0);
-
-  static submit_Callback_2(mthis, __arg_0, __arg_1) native "HTMLFormElement_submit_Callback";
-  submit_Callback_2_(mthis, __arg_0, __arg_1) => submit_Callback_2(mthis, __arg_0, __arg_1);
-
-  static target_Getter(mthis) native "HTMLFormElement_target_Getter";
-  target_Getter_(mthis) => target_Getter(mthis);
-
-  static target_Setter(mthis, __arg_0) native "HTMLFormElement_target_Setter";
-  target_Setter_(mthis, __arg_0) => target_Setter(mthis, __arg_0);
+  target_Setter_(mthis, __arg_0) => mthis["target"] = __arg_0;
 
 }
 
@@ -10518,19 +5876,16 @@
 class BlinkHTMLFrameSetElement extends BlinkHTMLElement {
   static final instance = new BlinkHTMLFrameSetElement();
 
-  static $__getter___Callback_1(mthis, __arg_0) native "HTMLFrameSetElement___getter___Callback";
-  $__getter___Callback_1_(mthis, __arg_0) => $__getter___Callback_1(mthis, __arg_0);
+  $__getter___Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "__getter__", [__arg_0]);
 
 }
 
 class BlinkHTMLHRElement extends BlinkHTMLElement {
   static final instance = new BlinkHTMLHRElement();
 
-  static color_Getter(mthis) native "HTMLHRElement_color_Getter";
-  color_Getter_(mthis) => color_Getter(mthis);
+  color_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "color");
 
-  static color_Setter(mthis, __arg_0) native "HTMLHRElement_color_Setter";
-  color_Setter_(mthis, __arg_0) => color_Setter(mthis, __arg_0);
+  color_Setter_(mthis, __arg_0) => mthis["color"] = __arg_0;
 
 }
 
@@ -10552,744 +5907,467 @@
 class BlinkHTMLIFrameElement extends BlinkHTMLElement {
   static final instance = new BlinkHTMLIFrameElement();
 
-  static allowFullscreen_Getter(mthis) native "HTMLIFrameElement_allowFullscreen_Getter";
-  allowFullscreen_Getter_(mthis) => allowFullscreen_Getter(mthis);
+  allowFullscreen_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "allowFullscreen");
 
-  static allowFullscreen_Setter(mthis, __arg_0) native "HTMLIFrameElement_allowFullscreen_Setter";
-  allowFullscreen_Setter_(mthis, __arg_0) => allowFullscreen_Setter(mthis, __arg_0);
+  allowFullscreen_Setter_(mthis, __arg_0) => mthis["allowFullscreen"] = __arg_0;
 
-  static contentDocument_Getter(mthis) native "HTMLIFrameElement_contentDocument_Getter";
-  contentDocument_Getter_(mthis) => contentDocument_Getter(mthis);
+  contentDocument_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "contentDocument");
 
-  static contentWindow_Getter(mthis) native "HTMLIFrameElement_contentWindow_Getter";
-  contentWindow_Getter_(mthis) => contentWindow_Getter(mthis);
+  contentWindow_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "contentWindow");
 
-  static getSVGDocument_Callback_0(mthis) native "HTMLIFrameElement_getSVGDocument_Callback";
-  getSVGDocument_Callback_0_(mthis) => getSVGDocument_Callback_0(mthis);
+  getSVGDocument_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getSVGDocument", []);
 
-  static getSVGDocument_Callback_1(mthis, __arg_0) native "HTMLIFrameElement_getSVGDocument_Callback";
-  getSVGDocument_Callback_1_(mthis, __arg_0) => getSVGDocument_Callback_1(mthis, __arg_0);
+  height_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "height");
 
-  static getSVGDocument_Callback_2(mthis, __arg_0, __arg_1) native "HTMLIFrameElement_getSVGDocument_Callback";
-  getSVGDocument_Callback_2_(mthis, __arg_0, __arg_1) => getSVGDocument_Callback_2(mthis, __arg_0, __arg_1);
+  height_Setter_(mthis, __arg_0) => mthis["height"] = __arg_0;
 
-  static height_Getter(mthis) native "HTMLIFrameElement_height_Getter";
-  height_Getter_(mthis) => height_Getter(mthis);
+  integrity_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "integrity");
 
-  static height_Setter(mthis, __arg_0) native "HTMLIFrameElement_height_Setter";
-  height_Setter_(mthis, __arg_0) => height_Setter(mthis, __arg_0);
+  integrity_Setter_(mthis, __arg_0) => mthis["integrity"] = __arg_0;
 
-  static integrity_Getter(mthis) native "HTMLIFrameElement_integrity_Getter";
-  integrity_Getter_(mthis) => integrity_Getter(mthis);
+  name_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "name");
 
-  static integrity_Setter(mthis, __arg_0) native "HTMLIFrameElement_integrity_Setter";
-  integrity_Setter_(mthis, __arg_0) => integrity_Setter(mthis, __arg_0);
+  name_Setter_(mthis, __arg_0) => mthis["name"] = __arg_0;
 
-  static name_Getter(mthis) native "HTMLIFrameElement_name_Getter";
-  name_Getter_(mthis) => name_Getter(mthis);
+  sandbox_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "sandbox");
 
-  static name_Setter(mthis, __arg_0) native "HTMLIFrameElement_name_Setter";
-  name_Setter_(mthis, __arg_0) => name_Setter(mthis, __arg_0);
+  sandbox_Setter_(mthis, __arg_0) => mthis["sandbox"] = __arg_0;
 
-  static sandbox_Getter(mthis) native "HTMLIFrameElement_sandbox_Getter";
-  sandbox_Getter_(mthis) => sandbox_Getter(mthis);
+  src_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "src");
 
-  static sandbox_Setter(mthis, __arg_0) native "HTMLIFrameElement_sandbox_Setter";
-  sandbox_Setter_(mthis, __arg_0) => sandbox_Setter(mthis, __arg_0);
+  src_Setter_(mthis, __arg_0) => mthis["src"] = __arg_0;
 
-  static src_Getter(mthis) native "HTMLIFrameElement_src_Getter";
-  src_Getter_(mthis) => src_Getter(mthis);
+  srcdoc_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "srcdoc");
 
-  static src_Setter(mthis, __arg_0) native "HTMLIFrameElement_src_Setter";
-  src_Setter_(mthis, __arg_0) => src_Setter(mthis, __arg_0);
+  srcdoc_Setter_(mthis, __arg_0) => mthis["srcdoc"] = __arg_0;
 
-  static srcdoc_Getter(mthis) native "HTMLIFrameElement_srcdoc_Getter";
-  srcdoc_Getter_(mthis) => srcdoc_Getter(mthis);
+  width_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "width");
 
-  static srcdoc_Setter(mthis, __arg_0) native "HTMLIFrameElement_srcdoc_Setter";
-  srcdoc_Setter_(mthis, __arg_0) => srcdoc_Setter(mthis, __arg_0);
-
-  static width_Getter(mthis) native "HTMLIFrameElement_width_Getter";
-  width_Getter_(mthis) => width_Getter(mthis);
-
-  static width_Setter(mthis, __arg_0) native "HTMLIFrameElement_width_Setter";
-  width_Setter_(mthis, __arg_0) => width_Setter(mthis, __arg_0);
+  width_Setter_(mthis, __arg_0) => mthis["width"] = __arg_0;
 
 }
 
 class BlinkHTMLImageElement extends BlinkHTMLElement {
   static final instance = new BlinkHTMLImageElement();
 
-  static alt_Getter(mthis) native "HTMLImageElement_alt_Getter";
-  alt_Getter_(mthis) => alt_Getter(mthis);
+  alt_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "alt");
 
-  static alt_Setter(mthis, __arg_0) native "HTMLImageElement_alt_Setter";
-  alt_Setter_(mthis, __arg_0) => alt_Setter(mthis, __arg_0);
+  alt_Setter_(mthis, __arg_0) => mthis["alt"] = __arg_0;
 
-  static border_Getter(mthis) native "HTMLImageElement_border_Getter";
-  border_Getter_(mthis) => border_Getter(mthis);
+  border_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "border");
 
-  static border_Setter(mthis, __arg_0) native "HTMLImageElement_border_Setter";
-  border_Setter_(mthis, __arg_0) => border_Setter(mthis, __arg_0);
+  border_Setter_(mthis, __arg_0) => mthis["border"] = __arg_0;
 
-  static complete_Getter(mthis) native "HTMLImageElement_complete_Getter";
-  complete_Getter_(mthis) => complete_Getter(mthis);
+  complete_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "complete");
 
-  static constructorCallback_0() native "HTMLImageElement_constructorCallback";
-  constructorCallback_0_() => constructorCallback_0();
+  constructorCallback_0_() => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "Image"), []);
 
-  static constructorCallback_1(__arg_0) native "HTMLImageElement_constructorCallback";
-  constructorCallback_1_(__arg_0) => constructorCallback_1(__arg_0);
+  constructorCallback_1_(__arg_0) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "Image"), [__arg_0]);
 
-  static constructorCallback_2(__arg_0, __arg_1) native "HTMLImageElement_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  constructorCallback_2_(__arg_0, __arg_1) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "Image"), [__arg_0, __arg_1]);
 
-  static constructorCallback_3(__arg_0, __arg_1, __arg_2) native "HTMLImageElement_constructorCallback";
-  constructorCallback_3_(__arg_0, __arg_1, __arg_2) => constructorCallback_3(__arg_0, __arg_1, __arg_2);
+  crossOrigin_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "crossOrigin");
 
-  static constructorCallback_4(__arg_0, __arg_1, __arg_2, __arg_3) native "HTMLImageElement_constructorCallback";
-  constructorCallback_4_(__arg_0, __arg_1, __arg_2, __arg_3) => constructorCallback_4(__arg_0, __arg_1, __arg_2, __arg_3);
+  crossOrigin_Setter_(mthis, __arg_0) => mthis["crossOrigin"] = __arg_0;
 
-  static crossOrigin_Getter(mthis) native "HTMLImageElement_crossOrigin_Getter";
-  crossOrigin_Getter_(mthis) => crossOrigin_Getter(mthis);
+  currentSrc_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "currentSrc");
 
-  static crossOrigin_Setter(mthis, __arg_0) native "HTMLImageElement_crossOrigin_Setter";
-  crossOrigin_Setter_(mthis, __arg_0) => crossOrigin_Setter(mthis, __arg_0);
+  height_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "height");
 
-  static currentSrc_Getter(mthis) native "HTMLImageElement_currentSrc_Getter";
-  currentSrc_Getter_(mthis) => currentSrc_Getter(mthis);
+  height_Setter_(mthis, __arg_0) => mthis["height"] = __arg_0;
 
-  static height_Getter(mthis) native "HTMLImageElement_height_Getter";
-  height_Getter_(mthis) => height_Getter(mthis);
+  integrity_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "integrity");
 
-  static height_Setter(mthis, __arg_0) native "HTMLImageElement_height_Setter";
-  height_Setter_(mthis, __arg_0) => height_Setter(mthis, __arg_0);
+  integrity_Setter_(mthis, __arg_0) => mthis["integrity"] = __arg_0;
 
-  static integrity_Getter(mthis) native "HTMLImageElement_integrity_Getter";
-  integrity_Getter_(mthis) => integrity_Getter(mthis);
+  isMap_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "isMap");
 
-  static integrity_Setter(mthis, __arg_0) native "HTMLImageElement_integrity_Setter";
-  integrity_Setter_(mthis, __arg_0) => integrity_Setter(mthis, __arg_0);
+  isMap_Setter_(mthis, __arg_0) => mthis["isMap"] = __arg_0;
 
-  static isMap_Getter(mthis) native "HTMLImageElement_isMap_Getter";
-  isMap_Getter_(mthis) => isMap_Getter(mthis);
+  lowsrc_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "lowsrc");
 
-  static isMap_Setter(mthis, __arg_0) native "HTMLImageElement_isMap_Setter";
-  isMap_Setter_(mthis, __arg_0) => isMap_Setter(mthis, __arg_0);
+  lowsrc_Setter_(mthis, __arg_0) => mthis["lowsrc"] = __arg_0;
 
-  static lowsrc_Getter(mthis) native "HTMLImageElement_lowsrc_Getter";
-  lowsrc_Getter_(mthis) => lowsrc_Getter(mthis);
+  naturalHeight_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "naturalHeight");
 
-  static lowsrc_Setter(mthis, __arg_0) native "HTMLImageElement_lowsrc_Setter";
-  lowsrc_Setter_(mthis, __arg_0) => lowsrc_Setter(mthis, __arg_0);
+  naturalWidth_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "naturalWidth");
 
-  static naturalHeight_Getter(mthis) native "HTMLImageElement_naturalHeight_Getter";
-  naturalHeight_Getter_(mthis) => naturalHeight_Getter(mthis);
+  sizes_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "sizes");
 
-  static naturalWidth_Getter(mthis) native "HTMLImageElement_naturalWidth_Getter";
-  naturalWidth_Getter_(mthis) => naturalWidth_Getter(mthis);
+  sizes_Setter_(mthis, __arg_0) => mthis["sizes"] = __arg_0;
 
-  static sizes_Getter(mthis) native "HTMLImageElement_sizes_Getter";
-  sizes_Getter_(mthis) => sizes_Getter(mthis);
+  src_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "src");
 
-  static sizes_Setter(mthis, __arg_0) native "HTMLImageElement_sizes_Setter";
-  sizes_Setter_(mthis, __arg_0) => sizes_Setter(mthis, __arg_0);
+  src_Setter_(mthis, __arg_0) => mthis["src"] = __arg_0;
 
-  static src_Getter(mthis) native "HTMLImageElement_src_Getter";
-  src_Getter_(mthis) => src_Getter(mthis);
+  srcset_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "srcset");
 
-  static src_Setter(mthis, __arg_0) native "HTMLImageElement_src_Setter";
-  src_Setter_(mthis, __arg_0) => src_Setter(mthis, __arg_0);
+  srcset_Setter_(mthis, __arg_0) => mthis["srcset"] = __arg_0;
 
-  static srcset_Getter(mthis) native "HTMLImageElement_srcset_Getter";
-  srcset_Getter_(mthis) => srcset_Getter(mthis);
+  useMap_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "useMap");
 
-  static srcset_Setter(mthis, __arg_0) native "HTMLImageElement_srcset_Setter";
-  srcset_Setter_(mthis, __arg_0) => srcset_Setter(mthis, __arg_0);
+  useMap_Setter_(mthis, __arg_0) => mthis["useMap"] = __arg_0;
 
-  static useMap_Getter(mthis) native "HTMLImageElement_useMap_Getter";
-  useMap_Getter_(mthis) => useMap_Getter(mthis);
+  width_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "width");
 
-  static useMap_Setter(mthis, __arg_0) native "HTMLImageElement_useMap_Setter";
-  useMap_Setter_(mthis, __arg_0) => useMap_Setter(mthis, __arg_0);
+  width_Setter_(mthis, __arg_0) => mthis["width"] = __arg_0;
 
-  static width_Getter(mthis) native "HTMLImageElement_width_Getter";
-  width_Getter_(mthis) => width_Getter(mthis);
+  x_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "x");
 
-  static width_Setter(mthis, __arg_0) native "HTMLImageElement_width_Setter";
-  width_Setter_(mthis, __arg_0) => width_Setter(mthis, __arg_0);
-
-  static x_Getter(mthis) native "HTMLImageElement_x_Getter";
-  x_Getter_(mthis) => x_Getter(mthis);
-
-  static y_Getter(mthis) native "HTMLImageElement_y_Getter";
-  y_Getter_(mthis) => y_Getter(mthis);
+  y_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "y");
 
 }
 
 class BlinkHTMLInputElement extends BlinkHTMLElement {
   static final instance = new BlinkHTMLInputElement();
 
-  static accept_Getter(mthis) native "HTMLInputElement_accept_Getter";
-  accept_Getter_(mthis) => accept_Getter(mthis);
+  accept_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "accept");
 
-  static accept_Setter(mthis, __arg_0) native "HTMLInputElement_accept_Setter";
-  accept_Setter_(mthis, __arg_0) => accept_Setter(mthis, __arg_0);
+  accept_Setter_(mthis, __arg_0) => mthis["accept"] = __arg_0;
 
-  static alt_Getter(mthis) native "HTMLInputElement_alt_Getter";
-  alt_Getter_(mthis) => alt_Getter(mthis);
+  alt_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "alt");
 
-  static alt_Setter(mthis, __arg_0) native "HTMLInputElement_alt_Setter";
-  alt_Setter_(mthis, __arg_0) => alt_Setter(mthis, __arg_0);
+  alt_Setter_(mthis, __arg_0) => mthis["alt"] = __arg_0;
 
-  static autocomplete_Getter(mthis) native "HTMLInputElement_autocomplete_Getter";
-  autocomplete_Getter_(mthis) => autocomplete_Getter(mthis);
+  autocomplete_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "autocomplete");
 
-  static autocomplete_Setter(mthis, __arg_0) native "HTMLInputElement_autocomplete_Setter";
-  autocomplete_Setter_(mthis, __arg_0) => autocomplete_Setter(mthis, __arg_0);
+  autocomplete_Setter_(mthis, __arg_0) => mthis["autocomplete"] = __arg_0;
 
-  static autofocus_Getter(mthis) native "HTMLInputElement_autofocus_Getter";
-  autofocus_Getter_(mthis) => autofocus_Getter(mthis);
+  autofocus_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "autofocus");
 
-  static autofocus_Setter(mthis, __arg_0) native "HTMLInputElement_autofocus_Setter";
-  autofocus_Setter_(mthis, __arg_0) => autofocus_Setter(mthis, __arg_0);
+  autofocus_Setter_(mthis, __arg_0) => mthis["autofocus"] = __arg_0;
 
-  static capture_Getter(mthis) native "HTMLInputElement_capture_Getter";
-  capture_Getter_(mthis) => capture_Getter(mthis);
+  capture_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "capture");
 
-  static capture_Setter(mthis, __arg_0) native "HTMLInputElement_capture_Setter";
-  capture_Setter_(mthis, __arg_0) => capture_Setter(mthis, __arg_0);
+  capture_Setter_(mthis, __arg_0) => mthis["capture"] = __arg_0;
 
-  static checkValidity_Callback_0(mthis) native "HTMLInputElement_checkValidity_Callback";
-  checkValidity_Callback_0_(mthis) => checkValidity_Callback_0(mthis);
+  checkValidity_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "checkValidity", []);
 
-  static checkValidity_Callback_1(mthis, __arg_0) native "HTMLInputElement_checkValidity_Callback";
-  checkValidity_Callback_1_(mthis, __arg_0) => checkValidity_Callback_1(mthis, __arg_0);
+  checked_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "checked");
 
-  static checkValidity_Callback_2(mthis, __arg_0, __arg_1) native "HTMLInputElement_checkValidity_Callback";
-  checkValidity_Callback_2_(mthis, __arg_0, __arg_1) => checkValidity_Callback_2(mthis, __arg_0, __arg_1);
+  checked_Setter_(mthis, __arg_0) => mthis["checked"] = __arg_0;
 
-  static checked_Getter(mthis) native "HTMLInputElement_checked_Getter";
-  checked_Getter_(mthis) => checked_Getter(mthis);
+  defaultChecked_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "defaultChecked");
 
-  static checked_Setter(mthis, __arg_0) native "HTMLInputElement_checked_Setter";
-  checked_Setter_(mthis, __arg_0) => checked_Setter(mthis, __arg_0);
+  defaultChecked_Setter_(mthis, __arg_0) => mthis["defaultChecked"] = __arg_0;
 
-  static defaultChecked_Getter(mthis) native "HTMLInputElement_defaultChecked_Getter";
-  defaultChecked_Getter_(mthis) => defaultChecked_Getter(mthis);
+  defaultValue_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "defaultValue");
 
-  static defaultChecked_Setter(mthis, __arg_0) native "HTMLInputElement_defaultChecked_Setter";
-  defaultChecked_Setter_(mthis, __arg_0) => defaultChecked_Setter(mthis, __arg_0);
+  defaultValue_Setter_(mthis, __arg_0) => mthis["defaultValue"] = __arg_0;
 
-  static defaultValue_Getter(mthis) native "HTMLInputElement_defaultValue_Getter";
-  defaultValue_Getter_(mthis) => defaultValue_Getter(mthis);
+  dirName_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "dirName");
 
-  static defaultValue_Setter(mthis, __arg_0) native "HTMLInputElement_defaultValue_Setter";
-  defaultValue_Setter_(mthis, __arg_0) => defaultValue_Setter(mthis, __arg_0);
+  dirName_Setter_(mthis, __arg_0) => mthis["dirName"] = __arg_0;
 
-  static dirName_Getter(mthis) native "HTMLInputElement_dirName_Getter";
-  dirName_Getter_(mthis) => dirName_Getter(mthis);
+  disabled_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "disabled");
 
-  static dirName_Setter(mthis, __arg_0) native "HTMLInputElement_dirName_Setter";
-  dirName_Setter_(mthis, __arg_0) => dirName_Setter(mthis, __arg_0);
+  disabled_Setter_(mthis, __arg_0) => mthis["disabled"] = __arg_0;
 
-  static disabled_Getter(mthis) native "HTMLInputElement_disabled_Getter";
-  disabled_Getter_(mthis) => disabled_Getter(mthis);
+  files_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "files");
 
-  static disabled_Setter(mthis, __arg_0) native "HTMLInputElement_disabled_Setter";
-  disabled_Setter_(mthis, __arg_0) => disabled_Setter(mthis, __arg_0);
+  files_Setter_(mthis, __arg_0) => mthis["files"] = __arg_0;
 
-  static files_Getter(mthis) native "HTMLInputElement_files_Getter";
-  files_Getter_(mthis) => files_Getter(mthis);
+  formAction_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "formAction");
 
-  static files_Setter(mthis, __arg_0) native "HTMLInputElement_files_Setter";
-  files_Setter_(mthis, __arg_0) => files_Setter(mthis, __arg_0);
+  formAction_Setter_(mthis, __arg_0) => mthis["formAction"] = __arg_0;
 
-  static formAction_Getter(mthis) native "HTMLInputElement_formAction_Getter";
-  formAction_Getter_(mthis) => formAction_Getter(mthis);
+  formEnctype_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "formEnctype");
 
-  static formAction_Setter(mthis, __arg_0) native "HTMLInputElement_formAction_Setter";
-  formAction_Setter_(mthis, __arg_0) => formAction_Setter(mthis, __arg_0);
+  formEnctype_Setter_(mthis, __arg_0) => mthis["formEnctype"] = __arg_0;
 
-  static formEnctype_Getter(mthis) native "HTMLInputElement_formEnctype_Getter";
-  formEnctype_Getter_(mthis) => formEnctype_Getter(mthis);
+  formMethod_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "formMethod");
 
-  static formEnctype_Setter(mthis, __arg_0) native "HTMLInputElement_formEnctype_Setter";
-  formEnctype_Setter_(mthis, __arg_0) => formEnctype_Setter(mthis, __arg_0);
+  formMethod_Setter_(mthis, __arg_0) => mthis["formMethod"] = __arg_0;
 
-  static formMethod_Getter(mthis) native "HTMLInputElement_formMethod_Getter";
-  formMethod_Getter_(mthis) => formMethod_Getter(mthis);
+  formNoValidate_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "formNoValidate");
 
-  static formMethod_Setter(mthis, __arg_0) native "HTMLInputElement_formMethod_Setter";
-  formMethod_Setter_(mthis, __arg_0) => formMethod_Setter(mthis, __arg_0);
+  formNoValidate_Setter_(mthis, __arg_0) => mthis["formNoValidate"] = __arg_0;
 
-  static formNoValidate_Getter(mthis) native "HTMLInputElement_formNoValidate_Getter";
-  formNoValidate_Getter_(mthis) => formNoValidate_Getter(mthis);
+  formTarget_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "formTarget");
 
-  static formNoValidate_Setter(mthis, __arg_0) native "HTMLInputElement_formNoValidate_Setter";
-  formNoValidate_Setter_(mthis, __arg_0) => formNoValidate_Setter(mthis, __arg_0);
+  formTarget_Setter_(mthis, __arg_0) => mthis["formTarget"] = __arg_0;
 
-  static formTarget_Getter(mthis) native "HTMLInputElement_formTarget_Getter";
-  formTarget_Getter_(mthis) => formTarget_Getter(mthis);
+  form_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "form");
 
-  static formTarget_Setter(mthis, __arg_0) native "HTMLInputElement_formTarget_Setter";
-  formTarget_Setter_(mthis, __arg_0) => formTarget_Setter(mthis, __arg_0);
+  height_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "height");
 
-  static form_Getter(mthis) native "HTMLInputElement_form_Getter";
-  form_Getter_(mthis) => form_Getter(mthis);
+  height_Setter_(mthis, __arg_0) => mthis["height"] = __arg_0;
 
-  static height_Getter(mthis) native "HTMLInputElement_height_Getter";
-  height_Getter_(mthis) => height_Getter(mthis);
+  incremental_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "incremental");
 
-  static height_Setter(mthis, __arg_0) native "HTMLInputElement_height_Setter";
-  height_Setter_(mthis, __arg_0) => height_Setter(mthis, __arg_0);
+  incremental_Setter_(mthis, __arg_0) => mthis["incremental"] = __arg_0;
 
-  static incremental_Getter(mthis) native "HTMLInputElement_incremental_Getter";
-  incremental_Getter_(mthis) => incremental_Getter(mthis);
+  indeterminate_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "indeterminate");
 
-  static incremental_Setter(mthis, __arg_0) native "HTMLInputElement_incremental_Setter";
-  incremental_Setter_(mthis, __arg_0) => incremental_Setter(mthis, __arg_0);
+  indeterminate_Setter_(mthis, __arg_0) => mthis["indeterminate"] = __arg_0;
 
-  static indeterminate_Getter(mthis) native "HTMLInputElement_indeterminate_Getter";
-  indeterminate_Getter_(mthis) => indeterminate_Getter(mthis);
+  inputMode_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "inputMode");
 
-  static indeterminate_Setter(mthis, __arg_0) native "HTMLInputElement_indeterminate_Setter";
-  indeterminate_Setter_(mthis, __arg_0) => indeterminate_Setter(mthis, __arg_0);
+  inputMode_Setter_(mthis, __arg_0) => mthis["inputMode"] = __arg_0;
 
-  static inputMode_Getter(mthis) native "HTMLInputElement_inputMode_Getter";
-  inputMode_Getter_(mthis) => inputMode_Getter(mthis);
+  labels_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "labels");
 
-  static inputMode_Setter(mthis, __arg_0) native "HTMLInputElement_inputMode_Setter";
-  inputMode_Setter_(mthis, __arg_0) => inputMode_Setter(mthis, __arg_0);
+  list_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "list");
 
-  static labels_Getter(mthis) native "HTMLInputElement_labels_Getter";
-  labels_Getter_(mthis) => labels_Getter(mthis);
+  maxLength_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "maxLength");
 
-  static list_Getter(mthis) native "HTMLInputElement_list_Getter";
-  list_Getter_(mthis) => list_Getter(mthis);
+  maxLength_Setter_(mthis, __arg_0) => mthis["maxLength"] = __arg_0;
 
-  static maxLength_Getter(mthis) native "HTMLInputElement_maxLength_Getter";
-  maxLength_Getter_(mthis) => maxLength_Getter(mthis);
+  max_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "max");
 
-  static maxLength_Setter(mthis, __arg_0) native "HTMLInputElement_maxLength_Setter";
-  maxLength_Setter_(mthis, __arg_0) => maxLength_Setter(mthis, __arg_0);
+  max_Setter_(mthis, __arg_0) => mthis["max"] = __arg_0;
 
-  static max_Getter(mthis) native "HTMLInputElement_max_Getter";
-  max_Getter_(mthis) => max_Getter(mthis);
+  min_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "min");
 
-  static max_Setter(mthis, __arg_0) native "HTMLInputElement_max_Setter";
-  max_Setter_(mthis, __arg_0) => max_Setter(mthis, __arg_0);
+  min_Setter_(mthis, __arg_0) => mthis["min"] = __arg_0;
 
-  static min_Getter(mthis) native "HTMLInputElement_min_Getter";
-  min_Getter_(mthis) => min_Getter(mthis);
+  multiple_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "multiple");
 
-  static min_Setter(mthis, __arg_0) native "HTMLInputElement_min_Setter";
-  min_Setter_(mthis, __arg_0) => min_Setter(mthis, __arg_0);
+  multiple_Setter_(mthis, __arg_0) => mthis["multiple"] = __arg_0;
 
-  static multiple_Getter(mthis) native "HTMLInputElement_multiple_Getter";
-  multiple_Getter_(mthis) => multiple_Getter(mthis);
+  name_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "name");
 
-  static multiple_Setter(mthis, __arg_0) native "HTMLInputElement_multiple_Setter";
-  multiple_Setter_(mthis, __arg_0) => multiple_Setter(mthis, __arg_0);
+  name_Setter_(mthis, __arg_0) => mthis["name"] = __arg_0;
 
-  static name_Getter(mthis) native "HTMLInputElement_name_Getter";
-  name_Getter_(mthis) => name_Getter(mthis);
+  pattern_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "pattern");
 
-  static name_Setter(mthis, __arg_0) native "HTMLInputElement_name_Setter";
-  name_Setter_(mthis, __arg_0) => name_Setter(mthis, __arg_0);
+  pattern_Setter_(mthis, __arg_0) => mthis["pattern"] = __arg_0;
 
-  static pattern_Getter(mthis) native "HTMLInputElement_pattern_Getter";
-  pattern_Getter_(mthis) => pattern_Getter(mthis);
+  placeholder_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "placeholder");
 
-  static pattern_Setter(mthis, __arg_0) native "HTMLInputElement_pattern_Setter";
-  pattern_Setter_(mthis, __arg_0) => pattern_Setter(mthis, __arg_0);
+  placeholder_Setter_(mthis, __arg_0) => mthis["placeholder"] = __arg_0;
 
-  static placeholder_Getter(mthis) native "HTMLInputElement_placeholder_Getter";
-  placeholder_Getter_(mthis) => placeholder_Getter(mthis);
+  readOnly_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "readOnly");
 
-  static placeholder_Setter(mthis, __arg_0) native "HTMLInputElement_placeholder_Setter";
-  placeholder_Setter_(mthis, __arg_0) => placeholder_Setter(mthis, __arg_0);
+  readOnly_Setter_(mthis, __arg_0) => mthis["readOnly"] = __arg_0;
 
-  static readOnly_Getter(mthis) native "HTMLInputElement_readOnly_Getter";
-  readOnly_Getter_(mthis) => readOnly_Getter(mthis);
-
-  static readOnly_Setter(mthis, __arg_0) native "HTMLInputElement_readOnly_Setter";
-  readOnly_Setter_(mthis, __arg_0) => readOnly_Setter(mthis, __arg_0);
-
-  static required_Getter(mthis) native "HTMLInputElement_required_Getter";
-  required_Getter_(mthis) => required_Getter(mthis);
-
-  static required_Setter(mthis, __arg_0) native "HTMLInputElement_required_Setter";
-  required_Setter_(mthis, __arg_0) => required_Setter(mthis, __arg_0);
-
-  static select_Callback_0(mthis) native "HTMLInputElement_select_Callback";
-  select_Callback_0_(mthis) => select_Callback_0(mthis);
-
-  static select_Callback_1(mthis, __arg_0) native "HTMLInputElement_select_Callback";
-  select_Callback_1_(mthis, __arg_0) => select_Callback_1(mthis, __arg_0);
-
-  static select_Callback_2(mthis, __arg_0, __arg_1) native "HTMLInputElement_select_Callback";
-  select_Callback_2_(mthis, __arg_0, __arg_1) => select_Callback_2(mthis, __arg_0, __arg_1);
-
-  static selectionDirection_Getter(mthis) native "HTMLInputElement_selectionDirection_Getter";
-  selectionDirection_Getter_(mthis) => selectionDirection_Getter(mthis);
-
-  static selectionDirection_Setter(mthis, __arg_0) native "HTMLInputElement_selectionDirection_Setter";
-  selectionDirection_Setter_(mthis, __arg_0) => selectionDirection_Setter(mthis, __arg_0);
-
-  static selectionEnd_Getter(mthis) native "HTMLInputElement_selectionEnd_Getter";
-  selectionEnd_Getter_(mthis) => selectionEnd_Getter(mthis);
-
-  static selectionEnd_Setter(mthis, __arg_0) native "HTMLInputElement_selectionEnd_Setter";
-  selectionEnd_Setter_(mthis, __arg_0) => selectionEnd_Setter(mthis, __arg_0);
-
-  static selectionStart_Getter(mthis) native "HTMLInputElement_selectionStart_Getter";
-  selectionStart_Getter_(mthis) => selectionStart_Getter(mthis);
-
-  static selectionStart_Setter(mthis, __arg_0) native "HTMLInputElement_selectionStart_Setter";
-  selectionStart_Setter_(mthis, __arg_0) => selectionStart_Setter(mthis, __arg_0);
-
-  static setCustomValidity_Callback_0(mthis) native "HTMLInputElement_setCustomValidity_Callback";
-  setCustomValidity_Callback_0_(mthis) => setCustomValidity_Callback_0(mthis);
-
-  static setCustomValidity_Callback_1(mthis, __arg_0) native "HTMLInputElement_setCustomValidity_Callback";
-  setCustomValidity_Callback_1_(mthis, __arg_0) => setCustomValidity_Callback_1(mthis, __arg_0);
+  required_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "required");
 
-  static setCustomValidity_Callback_2(mthis, __arg_0, __arg_1) native "HTMLInputElement_setCustomValidity_Callback";
-  setCustomValidity_Callback_2_(mthis, __arg_0, __arg_1) => setCustomValidity_Callback_2(mthis, __arg_0, __arg_1);
+  required_Setter_(mthis, __arg_0) => mthis["required"] = __arg_0;
 
-  static setCustomValidity_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "HTMLInputElement_setCustomValidity_Callback";
-  setCustomValidity_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => setCustomValidity_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  select_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "select", []);
 
-  static setRangeText_Callback_0(mthis) native "HTMLInputElement_setRangeText_Callback";
-  setRangeText_Callback_0_(mthis) => setRangeText_Callback_0(mthis);
+  selectionDirection_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "selectionDirection");
 
-  static setRangeText_Callback_1(mthis, __arg_0) native "HTMLInputElement_setRangeText_Callback";
-  setRangeText_Callback_1_(mthis, __arg_0) => setRangeText_Callback_1(mthis, __arg_0);
+  selectionDirection_Setter_(mthis, __arg_0) => mthis["selectionDirection"] = __arg_0;
 
-  static setRangeText_Callback_2(mthis, __arg_0, __arg_1) native "HTMLInputElement_setRangeText_Callback";
-  setRangeText_Callback_2_(mthis, __arg_0, __arg_1) => setRangeText_Callback_2(mthis, __arg_0, __arg_1);
+  selectionEnd_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "selectionEnd");
 
-  static setRangeText_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "HTMLInputElement_setRangeText_Callback";
-  setRangeText_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => setRangeText_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  selectionEnd_Setter_(mthis, __arg_0) => mthis["selectionEnd"] = __arg_0;
 
-  static setRangeText_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "HTMLInputElement_setRangeText_Callback";
-  setRangeText_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => setRangeText_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  selectionStart_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "selectionStart");
 
-  static setRangeText_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "HTMLInputElement_setRangeText_Callback";
-  setRangeText_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => setRangeText_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  selectionStart_Setter_(mthis, __arg_0) => mthis["selectionStart"] = __arg_0;
 
-  static setRangeText_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "HTMLInputElement_setRangeText_Callback";
-  setRangeText_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => setRangeText_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  setCustomValidity_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "setCustomValidity", []);
 
-  static setSelectionRange_Callback_0(mthis) native "HTMLInputElement_setSelectionRange_Callback";
-  setSelectionRange_Callback_0_(mthis) => setSelectionRange_Callback_0(mthis);
+  setCustomValidity_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "setCustomValidity", [__arg_0]);
 
-  static setSelectionRange_Callback_1(mthis, __arg_0) native "HTMLInputElement_setSelectionRange_Callback";
-  setSelectionRange_Callback_1_(mthis, __arg_0) => setSelectionRange_Callback_1(mthis, __arg_0);
+  setRangeText_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "setRangeText", []);
 
-  static setSelectionRange_Callback_2(mthis, __arg_0, __arg_1) native "HTMLInputElement_setSelectionRange_Callback";
-  setSelectionRange_Callback_2_(mthis, __arg_0, __arg_1) => setSelectionRange_Callback_2(mthis, __arg_0, __arg_1);
+  setRangeText_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "setRangeText", [__arg_0]);
 
-  static setSelectionRange_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "HTMLInputElement_setSelectionRange_Callback";
-  setSelectionRange_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => setSelectionRange_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  setRangeText_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "setRangeText", [__arg_0, __arg_1]);
 
-  static setSelectionRange_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "HTMLInputElement_setSelectionRange_Callback";
-  setSelectionRange_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => setSelectionRange_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  setRangeText_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "setRangeText", [__arg_0, __arg_1, __arg_2]);
 
-  static setSelectionRange_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "HTMLInputElement_setSelectionRange_Callback";
-  setSelectionRange_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => setSelectionRange_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  setRangeText_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "setRangeText", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static size_Getter(mthis) native "HTMLInputElement_size_Getter";
-  size_Getter_(mthis) => size_Getter(mthis);
+  setSelectionRange_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "setSelectionRange", []);
 
-  static size_Setter(mthis, __arg_0) native "HTMLInputElement_size_Setter";
-  size_Setter_(mthis, __arg_0) => size_Setter(mthis, __arg_0);
+  setSelectionRange_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "setSelectionRange", [__arg_0]);
 
-  static src_Getter(mthis) native "HTMLInputElement_src_Getter";
-  src_Getter_(mthis) => src_Getter(mthis);
+  setSelectionRange_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "setSelectionRange", [__arg_0, __arg_1]);
 
-  static src_Setter(mthis, __arg_0) native "HTMLInputElement_src_Setter";
-  src_Setter_(mthis, __arg_0) => src_Setter(mthis, __arg_0);
+  setSelectionRange_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "setSelectionRange", [__arg_0, __arg_1, __arg_2]);
 
-  static stepDown_Callback_0(mthis) native "HTMLInputElement_stepDown_Callback";
-  stepDown_Callback_0_(mthis) => stepDown_Callback_0(mthis);
+  size_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "size");
 
-  static stepDown_Callback_1(mthis, __arg_0) native "HTMLInputElement_stepDown_Callback";
-  stepDown_Callback_1_(mthis, __arg_0) => stepDown_Callback_1(mthis, __arg_0);
+  size_Setter_(mthis, __arg_0) => mthis["size"] = __arg_0;
 
-  static stepDown_Callback_2(mthis, __arg_0, __arg_1) native "HTMLInputElement_stepDown_Callback";
-  stepDown_Callback_2_(mthis, __arg_0, __arg_1) => stepDown_Callback_2(mthis, __arg_0, __arg_1);
+  src_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "src");
 
-  static stepDown_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "HTMLInputElement_stepDown_Callback";
-  stepDown_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => stepDown_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  src_Setter_(mthis, __arg_0) => mthis["src"] = __arg_0;
 
-  static stepUp_Callback_0(mthis) native "HTMLInputElement_stepUp_Callback";
-  stepUp_Callback_0_(mthis) => stepUp_Callback_0(mthis);
+  stepDown_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "stepDown", []);
 
-  static stepUp_Callback_1(mthis, __arg_0) native "HTMLInputElement_stepUp_Callback";
-  stepUp_Callback_1_(mthis, __arg_0) => stepUp_Callback_1(mthis, __arg_0);
+  stepDown_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "stepDown", [__arg_0]);
 
-  static stepUp_Callback_2(mthis, __arg_0, __arg_1) native "HTMLInputElement_stepUp_Callback";
-  stepUp_Callback_2_(mthis, __arg_0, __arg_1) => stepUp_Callback_2(mthis, __arg_0, __arg_1);
+  stepUp_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "stepUp", []);
 
-  static stepUp_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "HTMLInputElement_stepUp_Callback";
-  stepUp_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => stepUp_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  stepUp_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "stepUp", [__arg_0]);
 
-  static step_Getter(mthis) native "HTMLInputElement_step_Getter";
-  step_Getter_(mthis) => step_Getter(mthis);
+  step_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "step");
 
-  static step_Setter(mthis, __arg_0) native "HTMLInputElement_step_Setter";
-  step_Setter_(mthis, __arg_0) => step_Setter(mthis, __arg_0);
+  step_Setter_(mthis, __arg_0) => mthis["step"] = __arg_0;
 
-  static type_Getter(mthis) native "HTMLInputElement_type_Getter";
-  type_Getter_(mthis) => type_Getter(mthis);
+  type_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "type");
 
-  static type_Setter(mthis, __arg_0) native "HTMLInputElement_type_Setter";
-  type_Setter_(mthis, __arg_0) => type_Setter(mthis, __arg_0);
+  type_Setter_(mthis, __arg_0) => mthis["type"] = __arg_0;
 
-  static useMap_Getter(mthis) native "HTMLInputElement_useMap_Getter";
-  useMap_Getter_(mthis) => useMap_Getter(mthis);
+  useMap_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "useMap");
 
-  static useMap_Setter(mthis, __arg_0) native "HTMLInputElement_useMap_Setter";
-  useMap_Setter_(mthis, __arg_0) => useMap_Setter(mthis, __arg_0);
+  useMap_Setter_(mthis, __arg_0) => mthis["useMap"] = __arg_0;
 
-  static validationMessage_Getter(mthis) native "HTMLInputElement_validationMessage_Getter";
-  validationMessage_Getter_(mthis) => validationMessage_Getter(mthis);
+  validationMessage_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "validationMessage");
 
-  static validity_Getter(mthis) native "HTMLInputElement_validity_Getter";
-  validity_Getter_(mthis) => validity_Getter(mthis);
+  validity_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "validity");
 
-  static valueAsDate_Getter(mthis) native "HTMLInputElement_valueAsDate_Getter";
-  valueAsDate_Getter_(mthis) => valueAsDate_Getter(mthis);
+  valueAsDate_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "valueAsDate");
 
-  static valueAsDate_Setter(mthis, __arg_0) native "HTMLInputElement_valueAsDate_Setter";
-  valueAsDate_Setter_(mthis, __arg_0) => valueAsDate_Setter(mthis, __arg_0);
+  valueAsDate_Setter_(mthis, __arg_0) => mthis["valueAsDate"] = __arg_0;
 
-  static valueAsNumber_Getter(mthis) native "HTMLInputElement_valueAsNumber_Getter";
-  valueAsNumber_Getter_(mthis) => valueAsNumber_Getter(mthis);
+  valueAsNumber_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "valueAsNumber");
 
-  static valueAsNumber_Setter(mthis, __arg_0) native "HTMLInputElement_valueAsNumber_Setter";
-  valueAsNumber_Setter_(mthis, __arg_0) => valueAsNumber_Setter(mthis, __arg_0);
+  valueAsNumber_Setter_(mthis, __arg_0) => mthis["valueAsNumber"] = __arg_0;
 
-  static value_Getter(mthis) native "HTMLInputElement_value_Getter";
-  value_Getter_(mthis) => value_Getter(mthis);
+  value_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "value");
 
-  static value_Setter(mthis, __arg_0) native "HTMLInputElement_value_Setter";
-  value_Setter_(mthis, __arg_0) => value_Setter(mthis, __arg_0);
+  value_Setter_(mthis, __arg_0) => mthis["value"] = __arg_0;
 
-  static webkitEntries_Getter(mthis) native "HTMLInputElement_webkitEntries_Getter";
-  webkitEntries_Getter_(mthis) => webkitEntries_Getter(mthis);
+  webkitEntries_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "webkitEntries");
 
-  static webkitdirectory_Getter(mthis) native "HTMLInputElement_webkitdirectory_Getter";
-  webkitdirectory_Getter_(mthis) => webkitdirectory_Getter(mthis);
+  webkitdirectory_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "webkitdirectory");
 
-  static webkitdirectory_Setter(mthis, __arg_0) native "HTMLInputElement_webkitdirectory_Setter";
-  webkitdirectory_Setter_(mthis, __arg_0) => webkitdirectory_Setter(mthis, __arg_0);
+  webkitdirectory_Setter_(mthis, __arg_0) => mthis["webkitdirectory"] = __arg_0;
 
-  static width_Getter(mthis) native "HTMLInputElement_width_Getter";
-  width_Getter_(mthis) => width_Getter(mthis);
+  width_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "width");
 
-  static width_Setter(mthis, __arg_0) native "HTMLInputElement_width_Setter";
-  width_Setter_(mthis, __arg_0) => width_Setter(mthis, __arg_0);
+  width_Setter_(mthis, __arg_0) => mthis["width"] = __arg_0;
 
-  static willValidate_Getter(mthis) native "HTMLInputElement_willValidate_Getter";
-  willValidate_Getter_(mthis) => willValidate_Getter(mthis);
+  willValidate_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "willValidate");
 
 }
 
 class BlinkHTMLKeygenElement extends BlinkHTMLElement {
   static final instance = new BlinkHTMLKeygenElement();
 
-  static autofocus_Getter(mthis) native "HTMLKeygenElement_autofocus_Getter";
-  autofocus_Getter_(mthis) => autofocus_Getter(mthis);
+  autofocus_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "autofocus");
 
-  static autofocus_Setter(mthis, __arg_0) native "HTMLKeygenElement_autofocus_Setter";
-  autofocus_Setter_(mthis, __arg_0) => autofocus_Setter(mthis, __arg_0);
+  autofocus_Setter_(mthis, __arg_0) => mthis["autofocus"] = __arg_0;
 
-  static challenge_Getter(mthis) native "HTMLKeygenElement_challenge_Getter";
-  challenge_Getter_(mthis) => challenge_Getter(mthis);
+  challenge_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "challenge");
 
-  static challenge_Setter(mthis, __arg_0) native "HTMLKeygenElement_challenge_Setter";
-  challenge_Setter_(mthis, __arg_0) => challenge_Setter(mthis, __arg_0);
+  challenge_Setter_(mthis, __arg_0) => mthis["challenge"] = __arg_0;
 
-  static checkValidity_Callback_0(mthis) native "HTMLKeygenElement_checkValidity_Callback";
-  checkValidity_Callback_0_(mthis) => checkValidity_Callback_0(mthis);
+  checkValidity_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "checkValidity", []);
 
-  static checkValidity_Callback_1(mthis, __arg_0) native "HTMLKeygenElement_checkValidity_Callback";
-  checkValidity_Callback_1_(mthis, __arg_0) => checkValidity_Callback_1(mthis, __arg_0);
+  disabled_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "disabled");
 
-  static checkValidity_Callback_2(mthis, __arg_0, __arg_1) native "HTMLKeygenElement_checkValidity_Callback";
-  checkValidity_Callback_2_(mthis, __arg_0, __arg_1) => checkValidity_Callback_2(mthis, __arg_0, __arg_1);
+  disabled_Setter_(mthis, __arg_0) => mthis["disabled"] = __arg_0;
 
-  static disabled_Getter(mthis) native "HTMLKeygenElement_disabled_Getter";
-  disabled_Getter_(mthis) => disabled_Getter(mthis);
+  form_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "form");
 
-  static disabled_Setter(mthis, __arg_0) native "HTMLKeygenElement_disabled_Setter";
-  disabled_Setter_(mthis, __arg_0) => disabled_Setter(mthis, __arg_0);
+  keytype_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "keytype");
 
-  static form_Getter(mthis) native "HTMLKeygenElement_form_Getter";
-  form_Getter_(mthis) => form_Getter(mthis);
+  keytype_Setter_(mthis, __arg_0) => mthis["keytype"] = __arg_0;
 
-  static keytype_Getter(mthis) native "HTMLKeygenElement_keytype_Getter";
-  keytype_Getter_(mthis) => keytype_Getter(mthis);
+  labels_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "labels");
 
-  static keytype_Setter(mthis, __arg_0) native "HTMLKeygenElement_keytype_Setter";
-  keytype_Setter_(mthis, __arg_0) => keytype_Setter(mthis, __arg_0);
+  name_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "name");
 
-  static labels_Getter(mthis) native "HTMLKeygenElement_labels_Getter";
-  labels_Getter_(mthis) => labels_Getter(mthis);
+  name_Setter_(mthis, __arg_0) => mthis["name"] = __arg_0;
 
-  static name_Getter(mthis) native "HTMLKeygenElement_name_Getter";
-  name_Getter_(mthis) => name_Getter(mthis);
+  setCustomValidity_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "setCustomValidity", []);
 
-  static name_Setter(mthis, __arg_0) native "HTMLKeygenElement_name_Setter";
-  name_Setter_(mthis, __arg_0) => name_Setter(mthis, __arg_0);
+  setCustomValidity_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "setCustomValidity", [__arg_0]);
 
-  static setCustomValidity_Callback_0(mthis) native "HTMLKeygenElement_setCustomValidity_Callback";
-  setCustomValidity_Callback_0_(mthis) => setCustomValidity_Callback_0(mthis);
+  type_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "type");
 
-  static setCustomValidity_Callback_1(mthis, __arg_0) native "HTMLKeygenElement_setCustomValidity_Callback";
-  setCustomValidity_Callback_1_(mthis, __arg_0) => setCustomValidity_Callback_1(mthis, __arg_0);
+  validationMessage_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "validationMessage");
 
-  static setCustomValidity_Callback_2(mthis, __arg_0, __arg_1) native "HTMLKeygenElement_setCustomValidity_Callback";
-  setCustomValidity_Callback_2_(mthis, __arg_0, __arg_1) => setCustomValidity_Callback_2(mthis, __arg_0, __arg_1);
+  validity_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "validity");
 
-  static setCustomValidity_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "HTMLKeygenElement_setCustomValidity_Callback";
-  setCustomValidity_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => setCustomValidity_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static type_Getter(mthis) native "HTMLKeygenElement_type_Getter";
-  type_Getter_(mthis) => type_Getter(mthis);
-
-  static validationMessage_Getter(mthis) native "HTMLKeygenElement_validationMessage_Getter";
-  validationMessage_Getter_(mthis) => validationMessage_Getter(mthis);
-
-  static validity_Getter(mthis) native "HTMLKeygenElement_validity_Getter";
-  validity_Getter_(mthis) => validity_Getter(mthis);
-
-  static willValidate_Getter(mthis) native "HTMLKeygenElement_willValidate_Getter";
-  willValidate_Getter_(mthis) => willValidate_Getter(mthis);
+  willValidate_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "willValidate");
 
 }
 
 class BlinkHTMLLIElement extends BlinkHTMLElement {
   static final instance = new BlinkHTMLLIElement();
 
-  static type_Getter(mthis) native "HTMLLIElement_type_Getter";
-  type_Getter_(mthis) => type_Getter(mthis);
+  type_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "type");
 
-  static type_Setter(mthis, __arg_0) native "HTMLLIElement_type_Setter";
-  type_Setter_(mthis, __arg_0) => type_Setter(mthis, __arg_0);
+  type_Setter_(mthis, __arg_0) => mthis["type"] = __arg_0;
 
-  static value_Getter(mthis) native "HTMLLIElement_value_Getter";
-  value_Getter_(mthis) => value_Getter(mthis);
+  value_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "value");
 
-  static value_Setter(mthis, __arg_0) native "HTMLLIElement_value_Setter";
-  value_Setter_(mthis, __arg_0) => value_Setter(mthis, __arg_0);
+  value_Setter_(mthis, __arg_0) => mthis["value"] = __arg_0;
 
 }
 
 class BlinkHTMLLabelElement extends BlinkHTMLElement {
   static final instance = new BlinkHTMLLabelElement();
 
-  static control_Getter(mthis) native "HTMLLabelElement_control_Getter";
-  control_Getter_(mthis) => control_Getter(mthis);
+  control_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "control");
 
-  static form_Getter(mthis) native "HTMLLabelElement_form_Getter";
-  form_Getter_(mthis) => form_Getter(mthis);
+  form_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "form");
 
-  static htmlFor_Getter(mthis) native "HTMLLabelElement_htmlFor_Getter";
-  htmlFor_Getter_(mthis) => htmlFor_Getter(mthis);
+  htmlFor_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "htmlFor");
 
-  static htmlFor_Setter(mthis, __arg_0) native "HTMLLabelElement_htmlFor_Setter";
-  htmlFor_Setter_(mthis, __arg_0) => htmlFor_Setter(mthis, __arg_0);
+  htmlFor_Setter_(mthis, __arg_0) => mthis["htmlFor"] = __arg_0;
 
 }
 
 class BlinkHTMLLegendElement extends BlinkHTMLElement {
   static final instance = new BlinkHTMLLegendElement();
 
-  static form_Getter(mthis) native "HTMLLegendElement_form_Getter";
-  form_Getter_(mthis) => form_Getter(mthis);
+  form_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "form");
 
 }
 
 class BlinkHTMLLinkElement extends BlinkHTMLElement {
   static final instance = new BlinkHTMLLinkElement();
 
-  static crossOrigin_Getter(mthis) native "HTMLLinkElement_crossOrigin_Getter";
-  crossOrigin_Getter_(mthis) => crossOrigin_Getter(mthis);
+  crossOrigin_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "crossOrigin");
 
-  static crossOrigin_Setter(mthis, __arg_0) native "HTMLLinkElement_crossOrigin_Setter";
-  crossOrigin_Setter_(mthis, __arg_0) => crossOrigin_Setter(mthis, __arg_0);
+  crossOrigin_Setter_(mthis, __arg_0) => mthis["crossOrigin"] = __arg_0;
 
-  static disabled_Getter(mthis) native "HTMLLinkElement_disabled_Getter";
-  disabled_Getter_(mthis) => disabled_Getter(mthis);
+  disabled_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "disabled");
 
-  static disabled_Setter(mthis, __arg_0) native "HTMLLinkElement_disabled_Setter";
-  disabled_Setter_(mthis, __arg_0) => disabled_Setter(mthis, __arg_0);
+  disabled_Setter_(mthis, __arg_0) => mthis["disabled"] = __arg_0;
 
-  static href_Getter(mthis) native "HTMLLinkElement_href_Getter";
-  href_Getter_(mthis) => href_Getter(mthis);
+  href_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "href");
 
-  static href_Setter(mthis, __arg_0) native "HTMLLinkElement_href_Setter";
-  href_Setter_(mthis, __arg_0) => href_Setter(mthis, __arg_0);
+  href_Setter_(mthis, __arg_0) => mthis["href"] = __arg_0;
 
-  static hreflang_Getter(mthis) native "HTMLLinkElement_hreflang_Getter";
-  hreflang_Getter_(mthis) => hreflang_Getter(mthis);
+  hreflang_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "hreflang");
 
-  static hreflang_Setter(mthis, __arg_0) native "HTMLLinkElement_hreflang_Setter";
-  hreflang_Setter_(mthis, __arg_0) => hreflang_Setter(mthis, __arg_0);
+  hreflang_Setter_(mthis, __arg_0) => mthis["hreflang"] = __arg_0;
 
-  static import_Getter(mthis) native "HTMLLinkElement_import_Getter";
-  import_Getter_(mthis) => import_Getter(mthis);
+  import_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "import");
 
-  static integrity_Getter(mthis) native "HTMLLinkElement_integrity_Getter";
-  integrity_Getter_(mthis) => integrity_Getter(mthis);
+  integrity_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "integrity");
 
-  static integrity_Setter(mthis, __arg_0) native "HTMLLinkElement_integrity_Setter";
-  integrity_Setter_(mthis, __arg_0) => integrity_Setter(mthis, __arg_0);
+  integrity_Setter_(mthis, __arg_0) => mthis["integrity"] = __arg_0;
 
-  static media_Getter(mthis) native "HTMLLinkElement_media_Getter";
-  media_Getter_(mthis) => media_Getter(mthis);
+  media_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "media");
 
-  static media_Setter(mthis, __arg_0) native "HTMLLinkElement_media_Setter";
-  media_Setter_(mthis, __arg_0) => media_Setter(mthis, __arg_0);
+  media_Setter_(mthis, __arg_0) => mthis["media"] = __arg_0;
 
-  static rel_Getter(mthis) native "HTMLLinkElement_rel_Getter";
-  rel_Getter_(mthis) => rel_Getter(mthis);
+  rel_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "rel");
 
-  static rel_Setter(mthis, __arg_0) native "HTMLLinkElement_rel_Setter";
-  rel_Setter_(mthis, __arg_0) => rel_Setter(mthis, __arg_0);
+  rel_Setter_(mthis, __arg_0) => mthis["rel"] = __arg_0;
 
-  static sheet_Getter(mthis) native "HTMLLinkElement_sheet_Getter";
-  sheet_Getter_(mthis) => sheet_Getter(mthis);
+  sheet_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "sheet");
 
-  static sizes_Getter(mthis) native "HTMLLinkElement_sizes_Getter";
-  sizes_Getter_(mthis) => sizes_Getter(mthis);
+  sizes_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "sizes");
 
-  static sizes_Setter(mthis, __arg_0) native "HTMLLinkElement_sizes_Setter";
-  sizes_Setter_(mthis, __arg_0) => sizes_Setter(mthis, __arg_0);
+  sizes_Setter_(mthis, __arg_0) => mthis["sizes"] = __arg_0;
 
-  static type_Getter(mthis) native "HTMLLinkElement_type_Getter";
-  type_Getter_(mthis) => type_Getter(mthis);
+  type_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "type");
 
-  static type_Setter(mthis, __arg_0) native "HTMLLinkElement_type_Setter";
-  type_Setter_(mthis, __arg_0) => type_Setter(mthis, __arg_0);
+  type_Setter_(mthis, __arg_0) => mthis["type"] = __arg_0;
 
 }
 
 class BlinkHTMLMapElement extends BlinkHTMLElement {
   static final instance = new BlinkHTMLMapElement();
 
-  static areas_Getter(mthis) native "HTMLMapElement_areas_Getter";
-  areas_Getter_(mthis) => areas_Getter(mthis);
+  areas_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "areas");
 
-  static name_Getter(mthis) native "HTMLMapElement_name_Getter";
-  name_Getter_(mthis) => name_Getter(mthis);
+  name_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "name");
 
-  static name_Setter(mthis, __arg_0) native "HTMLMapElement_name_Setter";
-  name_Setter_(mthis, __arg_0) => name_Setter(mthis, __arg_0);
+  name_Setter_(mthis, __arg_0) => mthis["name"] = __arg_0;
 
 }
 
@@ -11301,720 +6379,440 @@
 class BlinkHTMLMediaElement extends BlinkHTMLElement {
   static final instance = new BlinkHTMLMediaElement();
 
-  static addTextTrack_Callback_0(mthis) native "HTMLMediaElement_addTextTrack_Callback";
-  addTextTrack_Callback_0_(mthis) => addTextTrack_Callback_0(mthis);
+  addTextTrack_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "addTextTrack", []);
 
-  static addTextTrack_Callback_1(mthis, __arg_0) native "HTMLMediaElement_addTextTrack_Callback";
-  addTextTrack_Callback_1_(mthis, __arg_0) => addTextTrack_Callback_1(mthis, __arg_0);
+  addTextTrack_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "addTextTrack", [__arg_0]);
 
-  static addTextTrack_Callback_2(mthis, __arg_0, __arg_1) native "HTMLMediaElement_addTextTrack_Callback";
-  addTextTrack_Callback_2_(mthis, __arg_0, __arg_1) => addTextTrack_Callback_2(mthis, __arg_0, __arg_1);
+  addTextTrack_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "addTextTrack", [__arg_0, __arg_1]);
 
-  static addTextTrack_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "HTMLMediaElement_addTextTrack_Callback";
-  addTextTrack_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => addTextTrack_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  addTextTrack_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "addTextTrack", [__arg_0, __arg_1, __arg_2]);
 
-  static addTextTrack_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "HTMLMediaElement_addTextTrack_Callback";
-  addTextTrack_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => addTextTrack_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  audioTracks_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "audioTracks");
 
-  static addTextTrack_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "HTMLMediaElement_addTextTrack_Callback";
-  addTextTrack_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => addTextTrack_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  autoplay_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "autoplay");
 
-  static audioTracks_Getter(mthis) native "HTMLMediaElement_audioTracks_Getter";
-  audioTracks_Getter_(mthis) => audioTracks_Getter(mthis);
+  autoplay_Setter_(mthis, __arg_0) => mthis["autoplay"] = __arg_0;
 
-  static autoplay_Getter(mthis) native "HTMLMediaElement_autoplay_Getter";
-  autoplay_Getter_(mthis) => autoplay_Getter(mthis);
+  buffered_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "buffered");
 
-  static autoplay_Setter(mthis, __arg_0) native "HTMLMediaElement_autoplay_Setter";
-  autoplay_Setter_(mthis, __arg_0) => autoplay_Setter(mthis, __arg_0);
+  canPlayType_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "canPlayType", []);
 
-  static buffered_Getter(mthis) native "HTMLMediaElement_buffered_Getter";
-  buffered_Getter_(mthis) => buffered_Getter(mthis);
+  canPlayType_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "canPlayType", [__arg_0]);
 
-  static canPlayType_Callback_0(mthis) native "HTMLMediaElement_canPlayType_Callback";
-  canPlayType_Callback_0_(mthis) => canPlayType_Callback_0(mthis);
+  canPlayType_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "canPlayType", [__arg_0, __arg_1]);
 
-  static canPlayType_Callback_1(mthis, __arg_0) native "HTMLMediaElement_canPlayType_Callback";
-  canPlayType_Callback_1_(mthis, __arg_0) => canPlayType_Callback_1(mthis, __arg_0);
+  controller_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "controller");
 
-  static canPlayType_Callback_2(mthis, __arg_0, __arg_1) native "HTMLMediaElement_canPlayType_Callback";
-  canPlayType_Callback_2_(mthis, __arg_0, __arg_1) => canPlayType_Callback_2(mthis, __arg_0, __arg_1);
+  controller_Setter_(mthis, __arg_0) => mthis["controller"] = __arg_0;
 
-  static canPlayType_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "HTMLMediaElement_canPlayType_Callback";
-  canPlayType_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => canPlayType_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  controls_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "controls");
 
-  static canPlayType_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "HTMLMediaElement_canPlayType_Callback";
-  canPlayType_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => canPlayType_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  controls_Setter_(mthis, __arg_0) => mthis["controls"] = __arg_0;
 
-  static controller_Getter(mthis) native "HTMLMediaElement_controller_Getter";
-  controller_Getter_(mthis) => controller_Getter(mthis);
+  crossOrigin_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "crossOrigin");
 
-  static controller_Setter(mthis, __arg_0) native "HTMLMediaElement_controller_Setter";
-  controller_Setter_(mthis, __arg_0) => controller_Setter(mthis, __arg_0);
+  crossOrigin_Setter_(mthis, __arg_0) => mthis["crossOrigin"] = __arg_0;
 
-  static controls_Getter(mthis) native "HTMLMediaElement_controls_Getter";
-  controls_Getter_(mthis) => controls_Getter(mthis);
+  currentSrc_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "currentSrc");
 
-  static controls_Setter(mthis, __arg_0) native "HTMLMediaElement_controls_Setter";
-  controls_Setter_(mthis, __arg_0) => controls_Setter(mthis, __arg_0);
+  currentTime_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "currentTime");
 
-  static crossOrigin_Getter(mthis) native "HTMLMediaElement_crossOrigin_Getter";
-  crossOrigin_Getter_(mthis) => crossOrigin_Getter(mthis);
+  currentTime_Setter_(mthis, __arg_0) => mthis["currentTime"] = __arg_0;
 
-  static crossOrigin_Setter(mthis, __arg_0) native "HTMLMediaElement_crossOrigin_Setter";
-  crossOrigin_Setter_(mthis, __arg_0) => crossOrigin_Setter(mthis, __arg_0);
+  defaultMuted_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "defaultMuted");
 
-  static currentSrc_Getter(mthis) native "HTMLMediaElement_currentSrc_Getter";
-  currentSrc_Getter_(mthis) => currentSrc_Getter(mthis);
+  defaultMuted_Setter_(mthis, __arg_0) => mthis["defaultMuted"] = __arg_0;
 
-  static currentTime_Getter(mthis) native "HTMLMediaElement_currentTime_Getter";
-  currentTime_Getter_(mthis) => currentTime_Getter(mthis);
+  defaultPlaybackRate_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "defaultPlaybackRate");
 
-  static currentTime_Setter(mthis, __arg_0) native "HTMLMediaElement_currentTime_Setter";
-  currentTime_Setter_(mthis, __arg_0) => currentTime_Setter(mthis, __arg_0);
+  defaultPlaybackRate_Setter_(mthis, __arg_0) => mthis["defaultPlaybackRate"] = __arg_0;
 
-  static defaultMuted_Getter(mthis) native "HTMLMediaElement_defaultMuted_Getter";
-  defaultMuted_Getter_(mthis) => defaultMuted_Getter(mthis);
+  duration_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "duration");
 
-  static defaultMuted_Setter(mthis, __arg_0) native "HTMLMediaElement_defaultMuted_Setter";
-  defaultMuted_Setter_(mthis, __arg_0) => defaultMuted_Setter(mthis, __arg_0);
+  ended_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ended");
 
-  static defaultPlaybackRate_Getter(mthis) native "HTMLMediaElement_defaultPlaybackRate_Getter";
-  defaultPlaybackRate_Getter_(mthis) => defaultPlaybackRate_Getter(mthis);
+  error_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "error");
 
-  static defaultPlaybackRate_Setter(mthis, __arg_0) native "HTMLMediaElement_defaultPlaybackRate_Setter";
-  defaultPlaybackRate_Setter_(mthis, __arg_0) => defaultPlaybackRate_Setter(mthis, __arg_0);
+  integrity_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "integrity");
 
-  static duration_Getter(mthis) native "HTMLMediaElement_duration_Getter";
-  duration_Getter_(mthis) => duration_Getter(mthis);
+  integrity_Setter_(mthis, __arg_0) => mthis["integrity"] = __arg_0;
 
-  static ended_Getter(mthis) native "HTMLMediaElement_ended_Getter";
-  ended_Getter_(mthis) => ended_Getter(mthis);
+  load_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "load", []);
 
-  static error_Getter(mthis) native "HTMLMediaElement_error_Getter";
-  error_Getter_(mthis) => error_Getter(mthis);
+  loop_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "loop");
 
-  static integrity_Getter(mthis) native "HTMLMediaElement_integrity_Getter";
-  integrity_Getter_(mthis) => integrity_Getter(mthis);
+  loop_Setter_(mthis, __arg_0) => mthis["loop"] = __arg_0;
 
-  static integrity_Setter(mthis, __arg_0) native "HTMLMediaElement_integrity_Setter";
-  integrity_Setter_(mthis, __arg_0) => integrity_Setter(mthis, __arg_0);
+  mediaGroup_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "mediaGroup");
 
-  static load_Callback_0(mthis) native "HTMLMediaElement_load_Callback";
-  load_Callback_0_(mthis) => load_Callback_0(mthis);
+  mediaGroup_Setter_(mthis, __arg_0) => mthis["mediaGroup"] = __arg_0;
 
-  static load_Callback_1(mthis, __arg_0) native "HTMLMediaElement_load_Callback";
-  load_Callback_1_(mthis, __arg_0) => load_Callback_1(mthis, __arg_0);
+  mediaKeys_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "mediaKeys");
 
-  static load_Callback_2(mthis, __arg_0, __arg_1) native "HTMLMediaElement_load_Callback";
-  load_Callback_2_(mthis, __arg_0, __arg_1) => load_Callback_2(mthis, __arg_0, __arg_1);
+  muted_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "muted");
 
-  static loop_Getter(mthis) native "HTMLMediaElement_loop_Getter";
-  loop_Getter_(mthis) => loop_Getter(mthis);
+  muted_Setter_(mthis, __arg_0) => mthis["muted"] = __arg_0;
 
-  static loop_Setter(mthis, __arg_0) native "HTMLMediaElement_loop_Setter";
-  loop_Setter_(mthis, __arg_0) => loop_Setter(mthis, __arg_0);
+  networkState_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "networkState");
 
-  static mediaGroup_Getter(mthis) native "HTMLMediaElement_mediaGroup_Getter";
-  mediaGroup_Getter_(mthis) => mediaGroup_Getter(mthis);
+  onneedkey_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onneedkey");
 
-  static mediaGroup_Setter(mthis, __arg_0) native "HTMLMediaElement_mediaGroup_Setter";
-  mediaGroup_Setter_(mthis, __arg_0) => mediaGroup_Setter(mthis, __arg_0);
+  onneedkey_Setter_(mthis, __arg_0) => mthis["onneedkey"] = __arg_0;
 
-  static mediaKeys_Getter(mthis) native "HTMLMediaElement_mediaKeys_Getter";
-  mediaKeys_Getter_(mthis) => mediaKeys_Getter(mthis);
+  onwebkitkeyadded_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onwebkitkeyadded");
 
-  static muted_Getter(mthis) native "HTMLMediaElement_muted_Getter";
-  muted_Getter_(mthis) => muted_Getter(mthis);
+  onwebkitkeyadded_Setter_(mthis, __arg_0) => mthis["onwebkitkeyadded"] = __arg_0;
 
-  static muted_Setter(mthis, __arg_0) native "HTMLMediaElement_muted_Setter";
-  muted_Setter_(mthis, __arg_0) => muted_Setter(mthis, __arg_0);
+  onwebkitkeyerror_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onwebkitkeyerror");
 
-  static networkState_Getter(mthis) native "HTMLMediaElement_networkState_Getter";
-  networkState_Getter_(mthis) => networkState_Getter(mthis);
+  onwebkitkeyerror_Setter_(mthis, __arg_0) => mthis["onwebkitkeyerror"] = __arg_0;
 
-  static onneedkey_Getter(mthis) native "HTMLMediaElement_onneedkey_Getter";
-  onneedkey_Getter_(mthis) => onneedkey_Getter(mthis);
+  onwebkitkeymessage_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onwebkitkeymessage");
 
-  static onneedkey_Setter(mthis, __arg_0) native "HTMLMediaElement_onneedkey_Setter";
-  onneedkey_Setter_(mthis, __arg_0) => onneedkey_Setter(mthis, __arg_0);
+  onwebkitkeymessage_Setter_(mthis, __arg_0) => mthis["onwebkitkeymessage"] = __arg_0;
 
-  static onwebkitkeyadded_Getter(mthis) native "HTMLMediaElement_onwebkitkeyadded_Getter";
-  onwebkitkeyadded_Getter_(mthis) => onwebkitkeyadded_Getter(mthis);
+  onwebkitneedkey_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onwebkitneedkey");
 
-  static onwebkitkeyadded_Setter(mthis, __arg_0) native "HTMLMediaElement_onwebkitkeyadded_Setter";
-  onwebkitkeyadded_Setter_(mthis, __arg_0) => onwebkitkeyadded_Setter(mthis, __arg_0);
+  onwebkitneedkey_Setter_(mthis, __arg_0) => mthis["onwebkitneedkey"] = __arg_0;
 
-  static onwebkitkeyerror_Getter(mthis) native "HTMLMediaElement_onwebkitkeyerror_Getter";
-  onwebkitkeyerror_Getter_(mthis) => onwebkitkeyerror_Getter(mthis);
-
-  static onwebkitkeyerror_Setter(mthis, __arg_0) native "HTMLMediaElement_onwebkitkeyerror_Setter";
-  onwebkitkeyerror_Setter_(mthis, __arg_0) => onwebkitkeyerror_Setter(mthis, __arg_0);
-
-  static onwebkitkeymessage_Getter(mthis) native "HTMLMediaElement_onwebkitkeymessage_Getter";
-  onwebkitkeymessage_Getter_(mthis) => onwebkitkeymessage_Getter(mthis);
-
-  static onwebkitkeymessage_Setter(mthis, __arg_0) native "HTMLMediaElement_onwebkitkeymessage_Setter";
-  onwebkitkeymessage_Setter_(mthis, __arg_0) => onwebkitkeymessage_Setter(mthis, __arg_0);
-
-  static onwebkitneedkey_Getter(mthis) native "HTMLMediaElement_onwebkitneedkey_Getter";
-  onwebkitneedkey_Getter_(mthis) => onwebkitneedkey_Getter(mthis);
-
-  static onwebkitneedkey_Setter(mthis, __arg_0) native "HTMLMediaElement_onwebkitneedkey_Setter";
-  onwebkitneedkey_Setter_(mthis, __arg_0) => onwebkitneedkey_Setter(mthis, __arg_0);
-
-  static pause_Callback_0(mthis) native "HTMLMediaElement_pause_Callback";
-  pause_Callback_0_(mthis) => pause_Callback_0(mthis);
-
-  static pause_Callback_1(mthis, __arg_0) native "HTMLMediaElement_pause_Callback";
-  pause_Callback_1_(mthis, __arg_0) => pause_Callback_1(mthis, __arg_0);
-
-  static pause_Callback_2(mthis, __arg_0, __arg_1) native "HTMLMediaElement_pause_Callback";
-  pause_Callback_2_(mthis, __arg_0, __arg_1) => pause_Callback_2(mthis, __arg_0, __arg_1);
-
-  static paused_Getter(mthis) native "HTMLMediaElement_paused_Getter";
-  paused_Getter_(mthis) => paused_Getter(mthis);
-
-  static play_Callback_0(mthis) native "HTMLMediaElement_play_Callback";
-  play_Callback_0_(mthis) => play_Callback_0(mthis);
-
-  static play_Callback_1(mthis, __arg_0) native "HTMLMediaElement_play_Callback";
-  play_Callback_1_(mthis, __arg_0) => play_Callback_1(mthis, __arg_0);
-
-  static play_Callback_2(mthis, __arg_0, __arg_1) native "HTMLMediaElement_play_Callback";
-  play_Callback_2_(mthis, __arg_0, __arg_1) => play_Callback_2(mthis, __arg_0, __arg_1);
-
-  static playbackRate_Getter(mthis) native "HTMLMediaElement_playbackRate_Getter";
-  playbackRate_Getter_(mthis) => playbackRate_Getter(mthis);
-
-  static playbackRate_Setter(mthis, __arg_0) native "HTMLMediaElement_playbackRate_Setter";
-  playbackRate_Setter_(mthis, __arg_0) => playbackRate_Setter(mthis, __arg_0);
-
-  static played_Getter(mthis) native "HTMLMediaElement_played_Getter";
-  played_Getter_(mthis) => played_Getter(mthis);
-
-  static preload_Getter(mthis) native "HTMLMediaElement_preload_Getter";
-  preload_Getter_(mthis) => preload_Getter(mthis);
-
-  static preload_Setter(mthis, __arg_0) native "HTMLMediaElement_preload_Setter";
-  preload_Setter_(mthis, __arg_0) => preload_Setter(mthis, __arg_0);
-
-  static readyState_Getter(mthis) native "HTMLMediaElement_readyState_Getter";
-  readyState_Getter_(mthis) => readyState_Getter(mthis);
+  pause_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "pause", []);
 
-  static seekable_Getter(mthis) native "HTMLMediaElement_seekable_Getter";
-  seekable_Getter_(mthis) => seekable_Getter(mthis);
+  paused_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "paused");
 
-  static seeking_Getter(mthis) native "HTMLMediaElement_seeking_Getter";
-  seeking_Getter_(mthis) => seeking_Getter(mthis);
+  play_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "play", []);
 
-  static setMediaKeys_Callback_0(mthis) native "HTMLMediaElement_setMediaKeys_Callback";
-  setMediaKeys_Callback_0_(mthis) => setMediaKeys_Callback_0(mthis);
+  playbackRate_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "playbackRate");
 
-  static setMediaKeys_Callback_1(mthis, __arg_0) native "HTMLMediaElement_setMediaKeys_Callback";
-  setMediaKeys_Callback_1_(mthis, __arg_0) => setMediaKeys_Callback_1(mthis, __arg_0);
+  playbackRate_Setter_(mthis, __arg_0) => mthis["playbackRate"] = __arg_0;
 
-  static setMediaKeys_Callback_2(mthis, __arg_0, __arg_1) native "HTMLMediaElement_setMediaKeys_Callback";
-  setMediaKeys_Callback_2_(mthis, __arg_0, __arg_1) => setMediaKeys_Callback_2(mthis, __arg_0, __arg_1);
+  played_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "played");
 
-  static setMediaKeys_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "HTMLMediaElement_setMediaKeys_Callback";
-  setMediaKeys_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => setMediaKeys_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  preload_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "preload");
 
-  static src_Getter(mthis) native "HTMLMediaElement_src_Getter";
-  src_Getter_(mthis) => src_Getter(mthis);
+  preload_Setter_(mthis, __arg_0) => mthis["preload"] = __arg_0;
 
-  static src_Setter(mthis, __arg_0) native "HTMLMediaElement_src_Setter";
-  src_Setter_(mthis, __arg_0) => src_Setter(mthis, __arg_0);
+  readyState_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "readyState");
 
-  static textTracks_Getter(mthis) native "HTMLMediaElement_textTracks_Getter";
-  textTracks_Getter_(mthis) => textTracks_Getter(mthis);
+  seekable_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "seekable");
 
-  static videoTracks_Getter(mthis) native "HTMLMediaElement_videoTracks_Getter";
-  videoTracks_Getter_(mthis) => videoTracks_Getter(mthis);
+  seeking_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "seeking");
 
-  static volume_Getter(mthis) native "HTMLMediaElement_volume_Getter";
-  volume_Getter_(mthis) => volume_Getter(mthis);
+  setMediaKeys_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "setMediaKeys", []);
 
-  static volume_Setter(mthis, __arg_0) native "HTMLMediaElement_volume_Setter";
-  volume_Setter_(mthis, __arg_0) => volume_Setter(mthis, __arg_0);
+  setMediaKeys_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "setMediaKeys", [__arg_0]);
 
-  static webkitAddKey_Callback_0(mthis) native "HTMLMediaElement_webkitAddKey_Callback";
-  webkitAddKey_Callback_0_(mthis) => webkitAddKey_Callback_0(mthis);
+  src_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "src");
 
-  static webkitAddKey_Callback_1(mthis, __arg_0) native "HTMLMediaElement_webkitAddKey_Callback";
-  webkitAddKey_Callback_1_(mthis, __arg_0) => webkitAddKey_Callback_1(mthis, __arg_0);
+  src_Setter_(mthis, __arg_0) => mthis["src"] = __arg_0;
 
-  static webkitAddKey_Callback_2(mthis, __arg_0, __arg_1) native "HTMLMediaElement_webkitAddKey_Callback";
-  webkitAddKey_Callback_2_(mthis, __arg_0, __arg_1) => webkitAddKey_Callback_2(mthis, __arg_0, __arg_1);
+  textTracks_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "textTracks");
 
-  static webkitAddKey_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "HTMLMediaElement_webkitAddKey_Callback";
-  webkitAddKey_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => webkitAddKey_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  videoTracks_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "videoTracks");
 
-  static webkitAddKey_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "HTMLMediaElement_webkitAddKey_Callback";
-  webkitAddKey_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => webkitAddKey_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  volume_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "volume");
 
-  static webkitAddKey_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "HTMLMediaElement_webkitAddKey_Callback";
-  webkitAddKey_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => webkitAddKey_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  volume_Setter_(mthis, __arg_0) => mthis["volume"] = __arg_0;
 
-  static webkitAddKey_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "HTMLMediaElement_webkitAddKey_Callback";
-  webkitAddKey_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => webkitAddKey_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  webkitAddKey_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "webkitAddKey", []);
 
-  static webkitAudioDecodedByteCount_Getter(mthis) native "HTMLMediaElement_webkitAudioDecodedByteCount_Getter";
-  webkitAudioDecodedByteCount_Getter_(mthis) => webkitAudioDecodedByteCount_Getter(mthis);
+  webkitAddKey_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "webkitAddKey", [__arg_0]);
 
-  static webkitCancelKeyRequest_Callback_0(mthis) native "HTMLMediaElement_webkitCancelKeyRequest_Callback";
-  webkitCancelKeyRequest_Callback_0_(mthis) => webkitCancelKeyRequest_Callback_0(mthis);
+  webkitAddKey_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "webkitAddKey", [__arg_0, __arg_1]);
 
-  static webkitCancelKeyRequest_Callback_1(mthis, __arg_0) native "HTMLMediaElement_webkitCancelKeyRequest_Callback";
-  webkitCancelKeyRequest_Callback_1_(mthis, __arg_0) => webkitCancelKeyRequest_Callback_1(mthis, __arg_0);
+  webkitAddKey_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "webkitAddKey", [__arg_0, __arg_1, __arg_2]);
 
-  static webkitCancelKeyRequest_Callback_2(mthis, __arg_0, __arg_1) native "HTMLMediaElement_webkitCancelKeyRequest_Callback";
-  webkitCancelKeyRequest_Callback_2_(mthis, __arg_0, __arg_1) => webkitCancelKeyRequest_Callback_2(mthis, __arg_0, __arg_1);
+  webkitAddKey_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "webkitAddKey", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static webkitCancelKeyRequest_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "HTMLMediaElement_webkitCancelKeyRequest_Callback";
-  webkitCancelKeyRequest_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => webkitCancelKeyRequest_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  webkitAudioDecodedByteCount_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "webkitAudioDecodedByteCount");
 
-  static webkitCancelKeyRequest_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "HTMLMediaElement_webkitCancelKeyRequest_Callback";
-  webkitCancelKeyRequest_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => webkitCancelKeyRequest_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  webkitCancelKeyRequest_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "webkitCancelKeyRequest", []);
 
-  static webkitGenerateKeyRequest_Callback_0(mthis) native "HTMLMediaElement_webkitGenerateKeyRequest_Callback";
-  webkitGenerateKeyRequest_Callback_0_(mthis) => webkitGenerateKeyRequest_Callback_0(mthis);
+  webkitCancelKeyRequest_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "webkitCancelKeyRequest", [__arg_0]);
 
-  static webkitGenerateKeyRequest_Callback_1(mthis, __arg_0) native "HTMLMediaElement_webkitGenerateKeyRequest_Callback";
-  webkitGenerateKeyRequest_Callback_1_(mthis, __arg_0) => webkitGenerateKeyRequest_Callback_1(mthis, __arg_0);
+  webkitCancelKeyRequest_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "webkitCancelKeyRequest", [__arg_0, __arg_1]);
 
-  static webkitGenerateKeyRequest_Callback_2(mthis, __arg_0, __arg_1) native "HTMLMediaElement_webkitGenerateKeyRequest_Callback";
-  webkitGenerateKeyRequest_Callback_2_(mthis, __arg_0, __arg_1) => webkitGenerateKeyRequest_Callback_2(mthis, __arg_0, __arg_1);
+  webkitGenerateKeyRequest_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "webkitGenerateKeyRequest", []);
 
-  static webkitGenerateKeyRequest_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "HTMLMediaElement_webkitGenerateKeyRequest_Callback";
-  webkitGenerateKeyRequest_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => webkitGenerateKeyRequest_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  webkitGenerateKeyRequest_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "webkitGenerateKeyRequest", [__arg_0]);
 
-  static webkitGenerateKeyRequest_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "HTMLMediaElement_webkitGenerateKeyRequest_Callback";
-  webkitGenerateKeyRequest_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => webkitGenerateKeyRequest_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  webkitGenerateKeyRequest_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "webkitGenerateKeyRequest", [__arg_0, __arg_1]);
 
-  static webkitVideoDecodedByteCount_Getter(mthis) native "HTMLMediaElement_webkitVideoDecodedByteCount_Getter";
-  webkitVideoDecodedByteCount_Getter_(mthis) => webkitVideoDecodedByteCount_Getter(mthis);
+  webkitVideoDecodedByteCount_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "webkitVideoDecodedByteCount");
 
 }
 
 class BlinkHTMLMenuElement extends BlinkHTMLElement {
   static final instance = new BlinkHTMLMenuElement();
 
-  static label_Getter(mthis) native "HTMLMenuElement_label_Getter";
-  label_Getter_(mthis) => label_Getter(mthis);
+  label_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "label");
 
-  static label_Setter(mthis, __arg_0) native "HTMLMenuElement_label_Setter";
-  label_Setter_(mthis, __arg_0) => label_Setter(mthis, __arg_0);
+  label_Setter_(mthis, __arg_0) => mthis["label"] = __arg_0;
 
-  static type_Getter(mthis) native "HTMLMenuElement_type_Getter";
-  type_Getter_(mthis) => type_Getter(mthis);
+  type_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "type");
 
-  static type_Setter(mthis, __arg_0) native "HTMLMenuElement_type_Setter";
-  type_Setter_(mthis, __arg_0) => type_Setter(mthis, __arg_0);
+  type_Setter_(mthis, __arg_0) => mthis["type"] = __arg_0;
 
 }
 
 class BlinkHTMLMenuItemElement extends BlinkHTMLElement {
   static final instance = new BlinkHTMLMenuItemElement();
 
-  static checked_Getter(mthis) native "HTMLMenuItemElement_checked_Getter";
-  checked_Getter_(mthis) => checked_Getter(mthis);
+  checked_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "checked");
 
-  static checked_Setter(mthis, __arg_0) native "HTMLMenuItemElement_checked_Setter";
-  checked_Setter_(mthis, __arg_0) => checked_Setter(mthis, __arg_0);
+  checked_Setter_(mthis, __arg_0) => mthis["checked"] = __arg_0;
 
-  static default_Getter(mthis) native "HTMLMenuItemElement_default_Getter";
-  default_Getter_(mthis) => default_Getter(mthis);
+  default_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "default");
 
-  static default_Setter(mthis, __arg_0) native "HTMLMenuItemElement_default_Setter";
-  default_Setter_(mthis, __arg_0) => default_Setter(mthis, __arg_0);
+  default_Setter_(mthis, __arg_0) => mthis["default"] = __arg_0;
 
-  static disabled_Getter(mthis) native "HTMLMenuItemElement_disabled_Getter";
-  disabled_Getter_(mthis) => disabled_Getter(mthis);
+  disabled_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "disabled");
 
-  static disabled_Setter(mthis, __arg_0) native "HTMLMenuItemElement_disabled_Setter";
-  disabled_Setter_(mthis, __arg_0) => disabled_Setter(mthis, __arg_0);
+  disabled_Setter_(mthis, __arg_0) => mthis["disabled"] = __arg_0;
 
-  static label_Getter(mthis) native "HTMLMenuItemElement_label_Getter";
-  label_Getter_(mthis) => label_Getter(mthis);
+  label_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "label");
 
-  static label_Setter(mthis, __arg_0) native "HTMLMenuItemElement_label_Setter";
-  label_Setter_(mthis, __arg_0) => label_Setter(mthis, __arg_0);
+  label_Setter_(mthis, __arg_0) => mthis["label"] = __arg_0;
 
-  static type_Getter(mthis) native "HTMLMenuItemElement_type_Getter";
-  type_Getter_(mthis) => type_Getter(mthis);
+  type_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "type");
 
-  static type_Setter(mthis, __arg_0) native "HTMLMenuItemElement_type_Setter";
-  type_Setter_(mthis, __arg_0) => type_Setter(mthis, __arg_0);
+  type_Setter_(mthis, __arg_0) => mthis["type"] = __arg_0;
 
 }
 
 class BlinkHTMLMetaElement extends BlinkHTMLElement {
   static final instance = new BlinkHTMLMetaElement();
 
-  static content_Getter(mthis) native "HTMLMetaElement_content_Getter";
-  content_Getter_(mthis) => content_Getter(mthis);
+  content_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "content");
 
-  static content_Setter(mthis, __arg_0) native "HTMLMetaElement_content_Setter";
-  content_Setter_(mthis, __arg_0) => content_Setter(mthis, __arg_0);
+  content_Setter_(mthis, __arg_0) => mthis["content"] = __arg_0;
 
-  static httpEquiv_Getter(mthis) native "HTMLMetaElement_httpEquiv_Getter";
-  httpEquiv_Getter_(mthis) => httpEquiv_Getter(mthis);
+  httpEquiv_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "httpEquiv");
 
-  static httpEquiv_Setter(mthis, __arg_0) native "HTMLMetaElement_httpEquiv_Setter";
-  httpEquiv_Setter_(mthis, __arg_0) => httpEquiv_Setter(mthis, __arg_0);
+  httpEquiv_Setter_(mthis, __arg_0) => mthis["httpEquiv"] = __arg_0;
 
-  static name_Getter(mthis) native "HTMLMetaElement_name_Getter";
-  name_Getter_(mthis) => name_Getter(mthis);
+  name_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "name");
 
-  static name_Setter(mthis, __arg_0) native "HTMLMetaElement_name_Setter";
-  name_Setter_(mthis, __arg_0) => name_Setter(mthis, __arg_0);
+  name_Setter_(mthis, __arg_0) => mthis["name"] = __arg_0;
 
 }
 
 class BlinkHTMLMeterElement extends BlinkHTMLElement {
   static final instance = new BlinkHTMLMeterElement();
 
-  static high_Getter(mthis) native "HTMLMeterElement_high_Getter";
-  high_Getter_(mthis) => high_Getter(mthis);
+  high_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "high");
 
-  static high_Setter(mthis, __arg_0) native "HTMLMeterElement_high_Setter";
-  high_Setter_(mthis, __arg_0) => high_Setter(mthis, __arg_0);
+  high_Setter_(mthis, __arg_0) => mthis["high"] = __arg_0;
 
-  static labels_Getter(mthis) native "HTMLMeterElement_labels_Getter";
-  labels_Getter_(mthis) => labels_Getter(mthis);
+  labels_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "labels");
 
-  static low_Getter(mthis) native "HTMLMeterElement_low_Getter";
-  low_Getter_(mthis) => low_Getter(mthis);
+  low_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "low");
 
-  static low_Setter(mthis, __arg_0) native "HTMLMeterElement_low_Setter";
-  low_Setter_(mthis, __arg_0) => low_Setter(mthis, __arg_0);
+  low_Setter_(mthis, __arg_0) => mthis["low"] = __arg_0;
 
-  static max_Getter(mthis) native "HTMLMeterElement_max_Getter";
-  max_Getter_(mthis) => max_Getter(mthis);
+  max_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "max");
 
-  static max_Setter(mthis, __arg_0) native "HTMLMeterElement_max_Setter";
-  max_Setter_(mthis, __arg_0) => max_Setter(mthis, __arg_0);
+  max_Setter_(mthis, __arg_0) => mthis["max"] = __arg_0;
 
-  static min_Getter(mthis) native "HTMLMeterElement_min_Getter";
-  min_Getter_(mthis) => min_Getter(mthis);
+  min_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "min");
 
-  static min_Setter(mthis, __arg_0) native "HTMLMeterElement_min_Setter";
-  min_Setter_(mthis, __arg_0) => min_Setter(mthis, __arg_0);
+  min_Setter_(mthis, __arg_0) => mthis["min"] = __arg_0;
 
-  static optimum_Getter(mthis) native "HTMLMeterElement_optimum_Getter";
-  optimum_Getter_(mthis) => optimum_Getter(mthis);
+  optimum_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "optimum");
 
-  static optimum_Setter(mthis, __arg_0) native "HTMLMeterElement_optimum_Setter";
-  optimum_Setter_(mthis, __arg_0) => optimum_Setter(mthis, __arg_0);
+  optimum_Setter_(mthis, __arg_0) => mthis["optimum"] = __arg_0;
 
-  static value_Getter(mthis) native "HTMLMeterElement_value_Getter";
-  value_Getter_(mthis) => value_Getter(mthis);
+  value_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "value");
 
-  static value_Setter(mthis, __arg_0) native "HTMLMeterElement_value_Setter";
-  value_Setter_(mthis, __arg_0) => value_Setter(mthis, __arg_0);
+  value_Setter_(mthis, __arg_0) => mthis["value"] = __arg_0;
 
 }
 
 class BlinkHTMLModElement extends BlinkHTMLElement {
   static final instance = new BlinkHTMLModElement();
 
-  static cite_Getter(mthis) native "HTMLModElement_cite_Getter";
-  cite_Getter_(mthis) => cite_Getter(mthis);
+  cite_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "cite");
 
-  static cite_Setter(mthis, __arg_0) native "HTMLModElement_cite_Setter";
-  cite_Setter_(mthis, __arg_0) => cite_Setter(mthis, __arg_0);
+  cite_Setter_(mthis, __arg_0) => mthis["cite"] = __arg_0;
 
-  static dateTime_Getter(mthis) native "HTMLModElement_dateTime_Getter";
-  dateTime_Getter_(mthis) => dateTime_Getter(mthis);
+  dateTime_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "dateTime");
 
-  static dateTime_Setter(mthis, __arg_0) native "HTMLModElement_dateTime_Setter";
-  dateTime_Setter_(mthis, __arg_0) => dateTime_Setter(mthis, __arg_0);
+  dateTime_Setter_(mthis, __arg_0) => mthis["dateTime"] = __arg_0;
 
 }
 
 class BlinkHTMLOListElement extends BlinkHTMLElement {
   static final instance = new BlinkHTMLOListElement();
 
-  static reversed_Getter(mthis) native "HTMLOListElement_reversed_Getter";
-  reversed_Getter_(mthis) => reversed_Getter(mthis);
+  reversed_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "reversed");
 
-  static reversed_Setter(mthis, __arg_0) native "HTMLOListElement_reversed_Setter";
-  reversed_Setter_(mthis, __arg_0) => reversed_Setter(mthis, __arg_0);
+  reversed_Setter_(mthis, __arg_0) => mthis["reversed"] = __arg_0;
 
-  static start_Getter(mthis) native "HTMLOListElement_start_Getter";
-  start_Getter_(mthis) => start_Getter(mthis);
+  start_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "start");
 
-  static start_Setter(mthis, __arg_0) native "HTMLOListElement_start_Setter";
-  start_Setter_(mthis, __arg_0) => start_Setter(mthis, __arg_0);
+  start_Setter_(mthis, __arg_0) => mthis["start"] = __arg_0;
 
-  static type_Getter(mthis) native "HTMLOListElement_type_Getter";
-  type_Getter_(mthis) => type_Getter(mthis);
+  type_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "type");
 
-  static type_Setter(mthis, __arg_0) native "HTMLOListElement_type_Setter";
-  type_Setter_(mthis, __arg_0) => type_Setter(mthis, __arg_0);
+  type_Setter_(mthis, __arg_0) => mthis["type"] = __arg_0;
 
 }
 
 class BlinkHTMLObjectElement extends BlinkHTMLElement {
   static final instance = new BlinkHTMLObjectElement();
 
-  static $__getter___Callback_1(mthis, __arg_0) native "HTMLObjectElement___getter___Callback";
-  $__getter___Callback_1_(mthis, __arg_0) => $__getter___Callback_1(mthis, __arg_0);
+  $__getter___Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "__getter__", [__arg_0]);
 
-  static $__setter___Callback_2(mthis, __arg_0, __arg_1) native "HTMLObjectElement___setter___Callback";
-  $__setter___Callback_2_(mthis, __arg_0, __arg_1) => $__setter___Callback_2(mthis, __arg_0, __arg_1);
+  $__setter___Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "__setter__", [__arg_0, __arg_1]);
 
-  static checkValidity_Callback_0(mthis) native "HTMLObjectElement_checkValidity_Callback";
-  checkValidity_Callback_0_(mthis) => checkValidity_Callback_0(mthis);
+  checkValidity_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "checkValidity", []);
 
-  static checkValidity_Callback_1(mthis, __arg_0) native "HTMLObjectElement_checkValidity_Callback";
-  checkValidity_Callback_1_(mthis, __arg_0) => checkValidity_Callback_1(mthis, __arg_0);
+  code_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "code");
 
-  static checkValidity_Callback_2(mthis, __arg_0, __arg_1) native "HTMLObjectElement_checkValidity_Callback";
-  checkValidity_Callback_2_(mthis, __arg_0, __arg_1) => checkValidity_Callback_2(mthis, __arg_0, __arg_1);
+  code_Setter_(mthis, __arg_0) => mthis["code"] = __arg_0;
 
-  static code_Getter(mthis) native "HTMLObjectElement_code_Getter";
-  code_Getter_(mthis) => code_Getter(mthis);
+  contentDocument_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "contentDocument");
 
-  static code_Setter(mthis, __arg_0) native "HTMLObjectElement_code_Setter";
-  code_Setter_(mthis, __arg_0) => code_Setter(mthis, __arg_0);
+  data_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "data");
 
-  static contentDocument_Getter(mthis) native "HTMLObjectElement_contentDocument_Getter";
-  contentDocument_Getter_(mthis) => contentDocument_Getter(mthis);
+  data_Setter_(mthis, __arg_0) => mthis["data"] = __arg_0;
 
-  static data_Getter(mthis) native "HTMLObjectElement_data_Getter";
-  data_Getter_(mthis) => data_Getter(mthis);
+  form_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "form");
 
-  static data_Setter(mthis, __arg_0) native "HTMLObjectElement_data_Setter";
-  data_Setter_(mthis, __arg_0) => data_Setter(mthis, __arg_0);
+  getSVGDocument_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getSVGDocument", []);
 
-  static form_Getter(mthis) native "HTMLObjectElement_form_Getter";
-  form_Getter_(mthis) => form_Getter(mthis);
+  height_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "height");
 
-  static getSVGDocument_Callback_0(mthis) native "HTMLObjectElement_getSVGDocument_Callback";
-  getSVGDocument_Callback_0_(mthis) => getSVGDocument_Callback_0(mthis);
+  height_Setter_(mthis, __arg_0) => mthis["height"] = __arg_0;
 
-  static getSVGDocument_Callback_1(mthis, __arg_0) native "HTMLObjectElement_getSVGDocument_Callback";
-  getSVGDocument_Callback_1_(mthis, __arg_0) => getSVGDocument_Callback_1(mthis, __arg_0);
+  integrity_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "integrity");
 
-  static getSVGDocument_Callback_2(mthis, __arg_0, __arg_1) native "HTMLObjectElement_getSVGDocument_Callback";
-  getSVGDocument_Callback_2_(mthis, __arg_0, __arg_1) => getSVGDocument_Callback_2(mthis, __arg_0, __arg_1);
+  integrity_Setter_(mthis, __arg_0) => mthis["integrity"] = __arg_0;
 
-  static height_Getter(mthis) native "HTMLObjectElement_height_Getter";
-  height_Getter_(mthis) => height_Getter(mthis);
+  name_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "name");
 
-  static height_Setter(mthis, __arg_0) native "HTMLObjectElement_height_Setter";
-  height_Setter_(mthis, __arg_0) => height_Setter(mthis, __arg_0);
+  name_Setter_(mthis, __arg_0) => mthis["name"] = __arg_0;
 
-  static integrity_Getter(mthis) native "HTMLObjectElement_integrity_Getter";
-  integrity_Getter_(mthis) => integrity_Getter(mthis);
+  setCustomValidity_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "setCustomValidity", []);
 
-  static integrity_Setter(mthis, __arg_0) native "HTMLObjectElement_integrity_Setter";
-  integrity_Setter_(mthis, __arg_0) => integrity_Setter(mthis, __arg_0);
+  setCustomValidity_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "setCustomValidity", [__arg_0]);
 
-  static name_Getter(mthis) native "HTMLObjectElement_name_Getter";
-  name_Getter_(mthis) => name_Getter(mthis);
+  type_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "type");
 
-  static name_Setter(mthis, __arg_0) native "HTMLObjectElement_name_Setter";
-  name_Setter_(mthis, __arg_0) => name_Setter(mthis, __arg_0);
+  type_Setter_(mthis, __arg_0) => mthis["type"] = __arg_0;
 
-  static setCustomValidity_Callback_0(mthis) native "HTMLObjectElement_setCustomValidity_Callback";
-  setCustomValidity_Callback_0_(mthis) => setCustomValidity_Callback_0(mthis);
+  useMap_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "useMap");
 
-  static setCustomValidity_Callback_1(mthis, __arg_0) native "HTMLObjectElement_setCustomValidity_Callback";
-  setCustomValidity_Callback_1_(mthis, __arg_0) => setCustomValidity_Callback_1(mthis, __arg_0);
+  useMap_Setter_(mthis, __arg_0) => mthis["useMap"] = __arg_0;
 
-  static setCustomValidity_Callback_2(mthis, __arg_0, __arg_1) native "HTMLObjectElement_setCustomValidity_Callback";
-  setCustomValidity_Callback_2_(mthis, __arg_0, __arg_1) => setCustomValidity_Callback_2(mthis, __arg_0, __arg_1);
+  validationMessage_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "validationMessage");
 
-  static setCustomValidity_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "HTMLObjectElement_setCustomValidity_Callback";
-  setCustomValidity_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => setCustomValidity_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  validity_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "validity");
 
-  static type_Getter(mthis) native "HTMLObjectElement_type_Getter";
-  type_Getter_(mthis) => type_Getter(mthis);
+  width_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "width");
 
-  static type_Setter(mthis, __arg_0) native "HTMLObjectElement_type_Setter";
-  type_Setter_(mthis, __arg_0) => type_Setter(mthis, __arg_0);
+  width_Setter_(mthis, __arg_0) => mthis["width"] = __arg_0;
 
-  static useMap_Getter(mthis) native "HTMLObjectElement_useMap_Getter";
-  useMap_Getter_(mthis) => useMap_Getter(mthis);
-
-  static useMap_Setter(mthis, __arg_0) native "HTMLObjectElement_useMap_Setter";
-  useMap_Setter_(mthis, __arg_0) => useMap_Setter(mthis, __arg_0);
-
-  static validationMessage_Getter(mthis) native "HTMLObjectElement_validationMessage_Getter";
-  validationMessage_Getter_(mthis) => validationMessage_Getter(mthis);
-
-  static validity_Getter(mthis) native "HTMLObjectElement_validity_Getter";
-  validity_Getter_(mthis) => validity_Getter(mthis);
-
-  static width_Getter(mthis) native "HTMLObjectElement_width_Getter";
-  width_Getter_(mthis) => width_Getter(mthis);
-
-  static width_Setter(mthis, __arg_0) native "HTMLObjectElement_width_Setter";
-  width_Setter_(mthis, __arg_0) => width_Setter(mthis, __arg_0);
-
-  static willValidate_Getter(mthis) native "HTMLObjectElement_willValidate_Getter";
-  willValidate_Getter_(mthis) => willValidate_Getter(mthis);
+  willValidate_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "willValidate");
 
 }
 
 class BlinkHTMLOptGroupElement extends BlinkHTMLElement {
   static final instance = new BlinkHTMLOptGroupElement();
 
-  static disabled_Getter(mthis) native "HTMLOptGroupElement_disabled_Getter";
-  disabled_Getter_(mthis) => disabled_Getter(mthis);
+  disabled_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "disabled");
 
-  static disabled_Setter(mthis, __arg_0) native "HTMLOptGroupElement_disabled_Setter";
-  disabled_Setter_(mthis, __arg_0) => disabled_Setter(mthis, __arg_0);
+  disabled_Setter_(mthis, __arg_0) => mthis["disabled"] = __arg_0;
 
-  static label_Getter(mthis) native "HTMLOptGroupElement_label_Getter";
-  label_Getter_(mthis) => label_Getter(mthis);
+  label_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "label");
 
-  static label_Setter(mthis, __arg_0) native "HTMLOptGroupElement_label_Setter";
-  label_Setter_(mthis, __arg_0) => label_Setter(mthis, __arg_0);
+  label_Setter_(mthis, __arg_0) => mthis["label"] = __arg_0;
 
 }
 
 class BlinkHTMLOptionElement extends BlinkHTMLElement {
   static final instance = new BlinkHTMLOptionElement();
 
-  static constructorCallback_0() native "HTMLOptionElement_constructorCallback";
-  constructorCallback_0_() => constructorCallback_0();
+  constructorCallback_0_() => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "Option"), []);
 
-  static constructorCallback_1(__arg_0) native "HTMLOptionElement_constructorCallback";
-  constructorCallback_1_(__arg_0) => constructorCallback_1(__arg_0);
+  constructorCallback_1_(__arg_0) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "Option"), [__arg_0]);
 
-  static constructorCallback_2(__arg_0, __arg_1) native "HTMLOptionElement_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  constructorCallback_2_(__arg_0, __arg_1) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "Option"), [__arg_0, __arg_1]);
 
-  static constructorCallback_3(__arg_0, __arg_1, __arg_2) native "HTMLOptionElement_constructorCallback";
-  constructorCallback_3_(__arg_0, __arg_1, __arg_2) => constructorCallback_3(__arg_0, __arg_1, __arg_2);
+  constructorCallback_3_(__arg_0, __arg_1, __arg_2) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "Option"), [__arg_0, __arg_1, __arg_2]);
 
-  static constructorCallback_4(__arg_0, __arg_1, __arg_2, __arg_3) native "HTMLOptionElement_constructorCallback";
-  constructorCallback_4_(__arg_0, __arg_1, __arg_2, __arg_3) => constructorCallback_4(__arg_0, __arg_1, __arg_2, __arg_3);
+  constructorCallback_4_(__arg_0, __arg_1, __arg_2, __arg_3) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "Option"), [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static constructorCallback_5(__arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "HTMLOptionElement_constructorCallback";
-  constructorCallback_5_(__arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => constructorCallback_5(__arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  defaultSelected_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "defaultSelected");
 
-  static constructorCallback_6(__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "HTMLOptionElement_constructorCallback";
-  constructorCallback_6_(__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => constructorCallback_6(__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  defaultSelected_Setter_(mthis, __arg_0) => mthis["defaultSelected"] = __arg_0;
 
-  static defaultSelected_Getter(mthis) native "HTMLOptionElement_defaultSelected_Getter";
-  defaultSelected_Getter_(mthis) => defaultSelected_Getter(mthis);
+  disabled_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "disabled");
 
-  static defaultSelected_Setter(mthis, __arg_0) native "HTMLOptionElement_defaultSelected_Setter";
-  defaultSelected_Setter_(mthis, __arg_0) => defaultSelected_Setter(mthis, __arg_0);
+  disabled_Setter_(mthis, __arg_0) => mthis["disabled"] = __arg_0;
 
-  static disabled_Getter(mthis) native "HTMLOptionElement_disabled_Getter";
-  disabled_Getter_(mthis) => disabled_Getter(mthis);
+  form_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "form");
 
-  static disabled_Setter(mthis, __arg_0) native "HTMLOptionElement_disabled_Setter";
-  disabled_Setter_(mthis, __arg_0) => disabled_Setter(mthis, __arg_0);
+  index_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "index");
 
-  static form_Getter(mthis) native "HTMLOptionElement_form_Getter";
-  form_Getter_(mthis) => form_Getter(mthis);
+  label_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "label");
 
-  static index_Getter(mthis) native "HTMLOptionElement_index_Getter";
-  index_Getter_(mthis) => index_Getter(mthis);
+  label_Setter_(mthis, __arg_0) => mthis["label"] = __arg_0;
 
-  static label_Getter(mthis) native "HTMLOptionElement_label_Getter";
-  label_Getter_(mthis) => label_Getter(mthis);
+  selected_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "selected");
 
-  static label_Setter(mthis, __arg_0) native "HTMLOptionElement_label_Setter";
-  label_Setter_(mthis, __arg_0) => label_Setter(mthis, __arg_0);
+  selected_Setter_(mthis, __arg_0) => mthis["selected"] = __arg_0;
 
-  static selected_Getter(mthis) native "HTMLOptionElement_selected_Getter";
-  selected_Getter_(mthis) => selected_Getter(mthis);
+  value_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "value");
 
-  static selected_Setter(mthis, __arg_0) native "HTMLOptionElement_selected_Setter";
-  selected_Setter_(mthis, __arg_0) => selected_Setter(mthis, __arg_0);
-
-  static value_Getter(mthis) native "HTMLOptionElement_value_Getter";
-  value_Getter_(mthis) => value_Getter(mthis);
-
-  static value_Setter(mthis, __arg_0) native "HTMLOptionElement_value_Setter";
-  value_Setter_(mthis, __arg_0) => value_Setter(mthis, __arg_0);
+  value_Setter_(mthis, __arg_0) => mthis["value"] = __arg_0;
 
 }
 
 class BlinkHTMLOptionsCollection extends BlinkHTMLCollection {
   static final instance = new BlinkHTMLOptionsCollection();
 
-  static $__getter___Callback_1(mthis, __arg_0) native "HTMLOptionsCollection___getter___Callback";
-  $__getter___Callback_1_(mthis, __arg_0) => $__getter___Callback_1(mthis, __arg_0);
+  $__getter___Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "__getter__", [__arg_0]);
 
-  static $__setter___Callback_2(mthis, __arg_0, __arg_1) native "HTMLOptionsCollection___setter___Callback";
-  $__setter___Callback_2_(mthis, __arg_0, __arg_1) => $__setter___Callback_2(mthis, __arg_0, __arg_1);
+  $__setter___Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "__setter__", [__arg_0, __arg_1]);
 
 }
 
 class BlinkHTMLOutputElement extends BlinkHTMLElement {
   static final instance = new BlinkHTMLOutputElement();
 
-  static checkValidity_Callback_0(mthis) native "HTMLOutputElement_checkValidity_Callback";
-  checkValidity_Callback_0_(mthis) => checkValidity_Callback_0(mthis);
+  checkValidity_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "checkValidity", []);
 
-  static checkValidity_Callback_1(mthis, __arg_0) native "HTMLOutputElement_checkValidity_Callback";
-  checkValidity_Callback_1_(mthis, __arg_0) => checkValidity_Callback_1(mthis, __arg_0);
+  defaultValue_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "defaultValue");
 
-  static checkValidity_Callback_2(mthis, __arg_0, __arg_1) native "HTMLOutputElement_checkValidity_Callback";
-  checkValidity_Callback_2_(mthis, __arg_0, __arg_1) => checkValidity_Callback_2(mthis, __arg_0, __arg_1);
+  defaultValue_Setter_(mthis, __arg_0) => mthis["defaultValue"] = __arg_0;
 
-  static defaultValue_Getter(mthis) native "HTMLOutputElement_defaultValue_Getter";
-  defaultValue_Getter_(mthis) => defaultValue_Getter(mthis);
+  form_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "form");
 
-  static defaultValue_Setter(mthis, __arg_0) native "HTMLOutputElement_defaultValue_Setter";
-  defaultValue_Setter_(mthis, __arg_0) => defaultValue_Setter(mthis, __arg_0);
+  htmlFor_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "htmlFor");
 
-  static form_Getter(mthis) native "HTMLOutputElement_form_Getter";
-  form_Getter_(mthis) => form_Getter(mthis);
+  htmlFor_Setter_(mthis, __arg_0) => mthis["htmlFor"] = __arg_0;
 
-  static htmlFor_Getter(mthis) native "HTMLOutputElement_htmlFor_Getter";
-  htmlFor_Getter_(mthis) => htmlFor_Getter(mthis);
+  labels_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "labels");
 
-  static htmlFor_Setter(mthis, __arg_0) native "HTMLOutputElement_htmlFor_Setter";
-  htmlFor_Setter_(mthis, __arg_0) => htmlFor_Setter(mthis, __arg_0);
+  name_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "name");
 
-  static labels_Getter(mthis) native "HTMLOutputElement_labels_Getter";
-  labels_Getter_(mthis) => labels_Getter(mthis);
+  name_Setter_(mthis, __arg_0) => mthis["name"] = __arg_0;
 
-  static name_Getter(mthis) native "HTMLOutputElement_name_Getter";
-  name_Getter_(mthis) => name_Getter(mthis);
+  setCustomValidity_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "setCustomValidity", []);
 
-  static name_Setter(mthis, __arg_0) native "HTMLOutputElement_name_Setter";
-  name_Setter_(mthis, __arg_0) => name_Setter(mthis, __arg_0);
+  setCustomValidity_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "setCustomValidity", [__arg_0]);
 
-  static setCustomValidity_Callback_0(mthis) native "HTMLOutputElement_setCustomValidity_Callback";
-  setCustomValidity_Callback_0_(mthis) => setCustomValidity_Callback_0(mthis);
+  type_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "type");
 
-  static setCustomValidity_Callback_1(mthis, __arg_0) native "HTMLOutputElement_setCustomValidity_Callback";
-  setCustomValidity_Callback_1_(mthis, __arg_0) => setCustomValidity_Callback_1(mthis, __arg_0);
+  validationMessage_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "validationMessage");
 
-  static setCustomValidity_Callback_2(mthis, __arg_0, __arg_1) native "HTMLOutputElement_setCustomValidity_Callback";
-  setCustomValidity_Callback_2_(mthis, __arg_0, __arg_1) => setCustomValidity_Callback_2(mthis, __arg_0, __arg_1);
+  validity_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "validity");
 
-  static setCustomValidity_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "HTMLOutputElement_setCustomValidity_Callback";
-  setCustomValidity_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => setCustomValidity_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  value_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "value");
 
-  static type_Getter(mthis) native "HTMLOutputElement_type_Getter";
-  type_Getter_(mthis) => type_Getter(mthis);
+  value_Setter_(mthis, __arg_0) => mthis["value"] = __arg_0;
 
-  static validationMessage_Getter(mthis) native "HTMLOutputElement_validationMessage_Getter";
-  validationMessage_Getter_(mthis) => validationMessage_Getter(mthis);
-
-  static validity_Getter(mthis) native "HTMLOutputElement_validity_Getter";
-  validity_Getter_(mthis) => validity_Getter(mthis);
-
-  static value_Getter(mthis) native "HTMLOutputElement_value_Getter";
-  value_Getter_(mthis) => value_Getter(mthis);
-
-  static value_Setter(mthis, __arg_0) native "HTMLOutputElement_value_Setter";
-  value_Setter_(mthis, __arg_0) => value_Setter(mthis, __arg_0);
-
-  static willValidate_Getter(mthis) native "HTMLOutputElement_willValidate_Getter";
-  willValidate_Getter_(mthis) => willValidate_Getter(mthis);
+  willValidate_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "willValidate");
 
 }
 
@@ -12026,17 +6824,13 @@
 class BlinkHTMLParamElement extends BlinkHTMLElement {
   static final instance = new BlinkHTMLParamElement();
 
-  static name_Getter(mthis) native "HTMLParamElement_name_Getter";
-  name_Getter_(mthis) => name_Getter(mthis);
+  name_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "name");
 
-  static name_Setter(mthis, __arg_0) native "HTMLParamElement_name_Setter";
-  name_Setter_(mthis, __arg_0) => name_Setter(mthis, __arg_0);
+  name_Setter_(mthis, __arg_0) => mthis["name"] = __arg_0;
 
-  static value_Getter(mthis) native "HTMLParamElement_value_Getter";
-  value_Getter_(mthis) => value_Getter(mthis);
+  value_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "value");
 
-  static value_Setter(mthis, __arg_0) native "HTMLParamElement_value_Setter";
-  value_Setter_(mthis, __arg_0) => value_Setter(mthis, __arg_0);
+  value_Setter_(mthis, __arg_0) => mthis["value"] = __arg_0;
 
 }
 
@@ -12053,297 +6847,184 @@
 class BlinkHTMLProgressElement extends BlinkHTMLElement {
   static final instance = new BlinkHTMLProgressElement();
 
-  static labels_Getter(mthis) native "HTMLProgressElement_labels_Getter";
-  labels_Getter_(mthis) => labels_Getter(mthis);
+  labels_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "labels");
 
-  static max_Getter(mthis) native "HTMLProgressElement_max_Getter";
-  max_Getter_(mthis) => max_Getter(mthis);
+  max_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "max");
 
-  static max_Setter(mthis, __arg_0) native "HTMLProgressElement_max_Setter";
-  max_Setter_(mthis, __arg_0) => max_Setter(mthis, __arg_0);
+  max_Setter_(mthis, __arg_0) => mthis["max"] = __arg_0;
 
-  static position_Getter(mthis) native "HTMLProgressElement_position_Getter";
-  position_Getter_(mthis) => position_Getter(mthis);
+  position_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "position");
 
-  static value_Getter(mthis) native "HTMLProgressElement_value_Getter";
-  value_Getter_(mthis) => value_Getter(mthis);
+  value_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "value");
 
-  static value_Setter(mthis, __arg_0) native "HTMLProgressElement_value_Setter";
-  value_Setter_(mthis, __arg_0) => value_Setter(mthis, __arg_0);
+  value_Setter_(mthis, __arg_0) => mthis["value"] = __arg_0;
 
 }
 
 class BlinkHTMLQuoteElement extends BlinkHTMLElement {
   static final instance = new BlinkHTMLQuoteElement();
 
-  static cite_Getter(mthis) native "HTMLQuoteElement_cite_Getter";
-  cite_Getter_(mthis) => cite_Getter(mthis);
+  cite_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "cite");
 
-  static cite_Setter(mthis, __arg_0) native "HTMLQuoteElement_cite_Setter";
-  cite_Setter_(mthis, __arg_0) => cite_Setter(mthis, __arg_0);
+  cite_Setter_(mthis, __arg_0) => mthis["cite"] = __arg_0;
 
 }
 
 class BlinkHTMLScriptElement extends BlinkHTMLElement {
   static final instance = new BlinkHTMLScriptElement();
 
-  static async_Getter(mthis) native "HTMLScriptElement_async_Getter";
-  async_Getter_(mthis) => async_Getter(mthis);
+  async_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "async");
 
-  static async_Setter(mthis, __arg_0) native "HTMLScriptElement_async_Setter";
-  async_Setter_(mthis, __arg_0) => async_Setter(mthis, __arg_0);
+  async_Setter_(mthis, __arg_0) => mthis["async"] = __arg_0;
 
-  static charset_Getter(mthis) native "HTMLScriptElement_charset_Getter";
-  charset_Getter_(mthis) => charset_Getter(mthis);
+  charset_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "charset");
 
-  static charset_Setter(mthis, __arg_0) native "HTMLScriptElement_charset_Setter";
-  charset_Setter_(mthis, __arg_0) => charset_Setter(mthis, __arg_0);
+  charset_Setter_(mthis, __arg_0) => mthis["charset"] = __arg_0;
 
-  static crossOrigin_Getter(mthis) native "HTMLScriptElement_crossOrigin_Getter";
-  crossOrigin_Getter_(mthis) => crossOrigin_Getter(mthis);
+  crossOrigin_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "crossOrigin");
 
-  static crossOrigin_Setter(mthis, __arg_0) native "HTMLScriptElement_crossOrigin_Setter";
-  crossOrigin_Setter_(mthis, __arg_0) => crossOrigin_Setter(mthis, __arg_0);
+  crossOrigin_Setter_(mthis, __arg_0) => mthis["crossOrigin"] = __arg_0;
 
-  static defer_Getter(mthis) native "HTMLScriptElement_defer_Getter";
-  defer_Getter_(mthis) => defer_Getter(mthis);
+  defer_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "defer");
 
-  static defer_Setter(mthis, __arg_0) native "HTMLScriptElement_defer_Setter";
-  defer_Setter_(mthis, __arg_0) => defer_Setter(mthis, __arg_0);
+  defer_Setter_(mthis, __arg_0) => mthis["defer"] = __arg_0;
 
-  static event_Getter(mthis) native "HTMLScriptElement_event_Getter";
-  event_Getter_(mthis) => event_Getter(mthis);
+  event_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "event");
 
-  static event_Setter(mthis, __arg_0) native "HTMLScriptElement_event_Setter";
-  event_Setter_(mthis, __arg_0) => event_Setter(mthis, __arg_0);
+  event_Setter_(mthis, __arg_0) => mthis["event"] = __arg_0;
 
-  static htmlFor_Getter(mthis) native "HTMLScriptElement_htmlFor_Getter";
-  htmlFor_Getter_(mthis) => htmlFor_Getter(mthis);
+  htmlFor_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "htmlFor");
 
-  static htmlFor_Setter(mthis, __arg_0) native "HTMLScriptElement_htmlFor_Setter";
-  htmlFor_Setter_(mthis, __arg_0) => htmlFor_Setter(mthis, __arg_0);
+  htmlFor_Setter_(mthis, __arg_0) => mthis["htmlFor"] = __arg_0;
 
-  static integrity_Getter(mthis) native "HTMLScriptElement_integrity_Getter";
-  integrity_Getter_(mthis) => integrity_Getter(mthis);
+  integrity_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "integrity");
 
-  static integrity_Setter(mthis, __arg_0) native "HTMLScriptElement_integrity_Setter";
-  integrity_Setter_(mthis, __arg_0) => integrity_Setter(mthis, __arg_0);
+  integrity_Setter_(mthis, __arg_0) => mthis["integrity"] = __arg_0;
 
-  static nonce_Getter(mthis) native "HTMLScriptElement_nonce_Getter";
-  nonce_Getter_(mthis) => nonce_Getter(mthis);
+  nonce_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "nonce");
 
-  static nonce_Setter(mthis, __arg_0) native "HTMLScriptElement_nonce_Setter";
-  nonce_Setter_(mthis, __arg_0) => nonce_Setter(mthis, __arg_0);
+  nonce_Setter_(mthis, __arg_0) => mthis["nonce"] = __arg_0;
 
-  static src_Getter(mthis) native "HTMLScriptElement_src_Getter";
-  src_Getter_(mthis) => src_Getter(mthis);
+  src_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "src");
 
-  static src_Setter(mthis, __arg_0) native "HTMLScriptElement_src_Setter";
-  src_Setter_(mthis, __arg_0) => src_Setter(mthis, __arg_0);
+  src_Setter_(mthis, __arg_0) => mthis["src"] = __arg_0;
 
-  static type_Getter(mthis) native "HTMLScriptElement_type_Getter";
-  type_Getter_(mthis) => type_Getter(mthis);
+  type_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "type");
 
-  static type_Setter(mthis, __arg_0) native "HTMLScriptElement_type_Setter";
-  type_Setter_(mthis, __arg_0) => type_Setter(mthis, __arg_0);
+  type_Setter_(mthis, __arg_0) => mthis["type"] = __arg_0;
 
 }
 
 class BlinkHTMLSelectElement extends BlinkHTMLElement {
   static final instance = new BlinkHTMLSelectElement();
 
-  static $__getter___Callback_1(mthis, __arg_0) native "HTMLSelectElement___getter___Callback";
-  $__getter___Callback_1_(mthis, __arg_0) => $__getter___Callback_1(mthis, __arg_0);
+  $__getter___Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "__getter__", [__arg_0]);
 
-  static $__setter___Callback_2(mthis, __arg_0, __arg_1) native "HTMLSelectElement___setter___Callback";
-  $__setter___Callback_2_(mthis, __arg_0, __arg_1) => $__setter___Callback_2(mthis, __arg_0, __arg_1);
+  $__setter___Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "__setter__", [__arg_0, __arg_1]);
 
-  static add_Callback_0(mthis) native "HTMLSelectElement_add_Callback";
-  add_Callback_0_(mthis) => add_Callback_0(mthis);
+  add_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "add", []);
 
-  static add_Callback_1(mthis, __arg_0) native "HTMLSelectElement_add_Callback";
-  add_Callback_1_(mthis, __arg_0) => add_Callback_1(mthis, __arg_0);
+  add_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "add", [__arg_0]);
 
-  static add_Callback_2(mthis, __arg_0, __arg_1) native "HTMLSelectElement_add_Callback";
-  add_Callback_2_(mthis, __arg_0, __arg_1) => add_Callback_2(mthis, __arg_0, __arg_1);
+  add_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "add", [__arg_0, __arg_1]);
 
-  static add_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "HTMLSelectElement_add_Callback";
-  add_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => add_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  autofocus_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "autofocus");
 
-  static add_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "HTMLSelectElement_add_Callback";
-  add_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => add_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  autofocus_Setter_(mthis, __arg_0) => mthis["autofocus"] = __arg_0;
 
-  static autofocus_Getter(mthis) native "HTMLSelectElement_autofocus_Getter";
-  autofocus_Getter_(mthis) => autofocus_Getter(mthis);
+  checkValidity_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "checkValidity", []);
 
-  static autofocus_Setter(mthis, __arg_0) native "HTMLSelectElement_autofocus_Setter";
-  autofocus_Setter_(mthis, __arg_0) => autofocus_Setter(mthis, __arg_0);
+  disabled_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "disabled");
 
-  static checkValidity_Callback_0(mthis) native "HTMLSelectElement_checkValidity_Callback";
-  checkValidity_Callback_0_(mthis) => checkValidity_Callback_0(mthis);
+  disabled_Setter_(mthis, __arg_0) => mthis["disabled"] = __arg_0;
 
-  static checkValidity_Callback_1(mthis, __arg_0) native "HTMLSelectElement_checkValidity_Callback";
-  checkValidity_Callback_1_(mthis, __arg_0) => checkValidity_Callback_1(mthis, __arg_0);
+  form_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "form");
 
-  static checkValidity_Callback_2(mthis, __arg_0, __arg_1) native "HTMLSelectElement_checkValidity_Callback";
-  checkValidity_Callback_2_(mthis, __arg_0, __arg_1) => checkValidity_Callback_2(mthis, __arg_0, __arg_1);
+  item_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "item", []);
 
-  static disabled_Getter(mthis) native "HTMLSelectElement_disabled_Getter";
-  disabled_Getter_(mthis) => disabled_Getter(mthis);
+  item_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "item", [__arg_0]);
 
-  static disabled_Setter(mthis, __arg_0) native "HTMLSelectElement_disabled_Setter";
-  disabled_Setter_(mthis, __arg_0) => disabled_Setter(mthis, __arg_0);
+  labels_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "labels");
 
-  static form_Getter(mthis) native "HTMLSelectElement_form_Getter";
-  form_Getter_(mthis) => form_Getter(mthis);
+  length_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "length");
 
-  static item_Callback_0(mthis) native "HTMLSelectElement_item_Callback";
-  item_Callback_0_(mthis) => item_Callback_0(mthis);
+  length_Setter_(mthis, __arg_0) => mthis["length"] = __arg_0;
 
-  static item_Callback_1(mthis, __arg_0) native "HTMLSelectElement_item_Callback";
-  item_Callback_1_(mthis, __arg_0) => item_Callback_1(mthis, __arg_0);
+  multiple_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "multiple");
 
-  static item_Callback_2(mthis, __arg_0, __arg_1) native "HTMLSelectElement_item_Callback";
-  item_Callback_2_(mthis, __arg_0, __arg_1) => item_Callback_2(mthis, __arg_0, __arg_1);
+  multiple_Setter_(mthis, __arg_0) => mthis["multiple"] = __arg_0;
 
-  static item_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "HTMLSelectElement_item_Callback";
-  item_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => item_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  name_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "name");
 
-  static labels_Getter(mthis) native "HTMLSelectElement_labels_Getter";
-  labels_Getter_(mthis) => labels_Getter(mthis);
+  name_Setter_(mthis, __arg_0) => mthis["name"] = __arg_0;
 
-  static length_Getter(mthis) native "HTMLSelectElement_length_Getter";
-  length_Getter_(mthis) => length_Getter(mthis);
+  namedItem_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "namedItem", []);
 
-  static length_Setter(mthis, __arg_0) native "HTMLSelectElement_length_Setter";
-  length_Setter_(mthis, __arg_0) => length_Setter(mthis, __arg_0);
+  namedItem_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "namedItem", [__arg_0]);
 
-  static multiple_Getter(mthis) native "HTMLSelectElement_multiple_Getter";
-  multiple_Getter_(mthis) => multiple_Getter(mthis);
+  required_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "required");
 
-  static multiple_Setter(mthis, __arg_0) native "HTMLSelectElement_multiple_Setter";
-  multiple_Setter_(mthis, __arg_0) => multiple_Setter(mthis, __arg_0);
+  required_Setter_(mthis, __arg_0) => mthis["required"] = __arg_0;
 
-  static name_Getter(mthis) native "HTMLSelectElement_name_Getter";
-  name_Getter_(mthis) => name_Getter(mthis);
+  selectedIndex_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "selectedIndex");
 
-  static name_Setter(mthis, __arg_0) native "HTMLSelectElement_name_Setter";
-  name_Setter_(mthis, __arg_0) => name_Setter(mthis, __arg_0);
+  selectedIndex_Setter_(mthis, __arg_0) => mthis["selectedIndex"] = __arg_0;
 
-  static namedItem_Callback_0(mthis) native "HTMLSelectElement_namedItem_Callback";
-  namedItem_Callback_0_(mthis) => namedItem_Callback_0(mthis);
+  setCustomValidity_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "setCustomValidity", []);
 
-  static namedItem_Callback_1(mthis, __arg_0) native "HTMLSelectElement_namedItem_Callback";
-  namedItem_Callback_1_(mthis, __arg_0) => namedItem_Callback_1(mthis, __arg_0);
+  setCustomValidity_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "setCustomValidity", [__arg_0]);
 
-  static namedItem_Callback_2(mthis, __arg_0, __arg_1) native "HTMLSelectElement_namedItem_Callback";
-  namedItem_Callback_2_(mthis, __arg_0, __arg_1) => namedItem_Callback_2(mthis, __arg_0, __arg_1);
+  size_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "size");
 
-  static namedItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "HTMLSelectElement_namedItem_Callback";
-  namedItem_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => namedItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  size_Setter_(mthis, __arg_0) => mthis["size"] = __arg_0;
 
-  static required_Getter(mthis) native "HTMLSelectElement_required_Getter";
-  required_Getter_(mthis) => required_Getter(mthis);
+  type_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "type");
 
-  static required_Setter(mthis, __arg_0) native "HTMLSelectElement_required_Setter";
-  required_Setter_(mthis, __arg_0) => required_Setter(mthis, __arg_0);
+  validationMessage_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "validationMessage");
 
-  static selectedIndex_Getter(mthis) native "HTMLSelectElement_selectedIndex_Getter";
-  selectedIndex_Getter_(mthis) => selectedIndex_Getter(mthis);
+  validity_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "validity");
 
-  static selectedIndex_Setter(mthis, __arg_0) native "HTMLSelectElement_selectedIndex_Setter";
-  selectedIndex_Setter_(mthis, __arg_0) => selectedIndex_Setter(mthis, __arg_0);
+  value_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "value");
 
-  static setCustomValidity_Callback_0(mthis) native "HTMLSelectElement_setCustomValidity_Callback";
-  setCustomValidity_Callback_0_(mthis) => setCustomValidity_Callback_0(mthis);
+  value_Setter_(mthis, __arg_0) => mthis["value"] = __arg_0;
 
-  static setCustomValidity_Callback_1(mthis, __arg_0) native "HTMLSelectElement_setCustomValidity_Callback";
-  setCustomValidity_Callback_1_(mthis, __arg_0) => setCustomValidity_Callback_1(mthis, __arg_0);
-
-  static setCustomValidity_Callback_2(mthis, __arg_0, __arg_1) native "HTMLSelectElement_setCustomValidity_Callback";
-  setCustomValidity_Callback_2_(mthis, __arg_0, __arg_1) => setCustomValidity_Callback_2(mthis, __arg_0, __arg_1);
-
-  static setCustomValidity_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "HTMLSelectElement_setCustomValidity_Callback";
-  setCustomValidity_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => setCustomValidity_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static size_Getter(mthis) native "HTMLSelectElement_size_Getter";
-  size_Getter_(mthis) => size_Getter(mthis);
-
-  static size_Setter(mthis, __arg_0) native "HTMLSelectElement_size_Setter";
-  size_Setter_(mthis, __arg_0) => size_Setter(mthis, __arg_0);
-
-  static type_Getter(mthis) native "HTMLSelectElement_type_Getter";
-  type_Getter_(mthis) => type_Getter(mthis);
-
-  static validationMessage_Getter(mthis) native "HTMLSelectElement_validationMessage_Getter";
-  validationMessage_Getter_(mthis) => validationMessage_Getter(mthis);
-
-  static validity_Getter(mthis) native "HTMLSelectElement_validity_Getter";
-  validity_Getter_(mthis) => validity_Getter(mthis);
-
-  static value_Getter(mthis) native "HTMLSelectElement_value_Getter";
-  value_Getter_(mthis) => value_Getter(mthis);
-
-  static value_Setter(mthis, __arg_0) native "HTMLSelectElement_value_Setter";
-  value_Setter_(mthis, __arg_0) => value_Setter(mthis, __arg_0);
-
-  static willValidate_Getter(mthis) native "HTMLSelectElement_willValidate_Getter";
-  willValidate_Getter_(mthis) => willValidate_Getter(mthis);
+  willValidate_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "willValidate");
 
 }
 
 class BlinkHTMLShadowElement extends BlinkHTMLElement {
   static final instance = new BlinkHTMLShadowElement();
 
-  static getDistributedNodes_Callback_0(mthis) native "HTMLShadowElement_getDistributedNodes_Callback";
-  getDistributedNodes_Callback_0_(mthis) => getDistributedNodes_Callback_0(mthis);
-
-  static getDistributedNodes_Callback_1(mthis, __arg_0) native "HTMLShadowElement_getDistributedNodes_Callback";
-  getDistributedNodes_Callback_1_(mthis, __arg_0) => getDistributedNodes_Callback_1(mthis, __arg_0);
-
-  static getDistributedNodes_Callback_2(mthis, __arg_0, __arg_1) native "HTMLShadowElement_getDistributedNodes_Callback";
-  getDistributedNodes_Callback_2_(mthis, __arg_0, __arg_1) => getDistributedNodes_Callback_2(mthis, __arg_0, __arg_1);
+  getDistributedNodes_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getDistributedNodes", []);
 
 }
 
 class BlinkHTMLSourceElement extends BlinkHTMLElement {
   static final instance = new BlinkHTMLSourceElement();
 
-  static integrity_Getter(mthis) native "HTMLSourceElement_integrity_Getter";
-  integrity_Getter_(mthis) => integrity_Getter(mthis);
+  integrity_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "integrity");
 
-  static integrity_Setter(mthis, __arg_0) native "HTMLSourceElement_integrity_Setter";
-  integrity_Setter_(mthis, __arg_0) => integrity_Setter(mthis, __arg_0);
+  integrity_Setter_(mthis, __arg_0) => mthis["integrity"] = __arg_0;
 
-  static media_Getter(mthis) native "HTMLSourceElement_media_Getter";
-  media_Getter_(mthis) => media_Getter(mthis);
+  media_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "media");
 
-  static media_Setter(mthis, __arg_0) native "HTMLSourceElement_media_Setter";
-  media_Setter_(mthis, __arg_0) => media_Setter(mthis, __arg_0);
+  media_Setter_(mthis, __arg_0) => mthis["media"] = __arg_0;
 
-  static sizes_Getter(mthis) native "HTMLSourceElement_sizes_Getter";
-  sizes_Getter_(mthis) => sizes_Getter(mthis);
+  sizes_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "sizes");
 
-  static sizes_Setter(mthis, __arg_0) native "HTMLSourceElement_sizes_Setter";
-  sizes_Setter_(mthis, __arg_0) => sizes_Setter(mthis, __arg_0);
+  sizes_Setter_(mthis, __arg_0) => mthis["sizes"] = __arg_0;
 
-  static src_Getter(mthis) native "HTMLSourceElement_src_Getter";
-  src_Getter_(mthis) => src_Getter(mthis);
+  src_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "src");
 
-  static src_Setter(mthis, __arg_0) native "HTMLSourceElement_src_Setter";
-  src_Setter_(mthis, __arg_0) => src_Setter(mthis, __arg_0);
+  src_Setter_(mthis, __arg_0) => mthis["src"] = __arg_0;
 
-  static srcset_Getter(mthis) native "HTMLSourceElement_srcset_Getter";
-  srcset_Getter_(mthis) => srcset_Getter(mthis);
+  srcset_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "srcset");
 
-  static srcset_Setter(mthis, __arg_0) native "HTMLSourceElement_srcset_Setter";
-  srcset_Setter_(mthis, __arg_0) => srcset_Setter(mthis, __arg_0);
+  srcset_Setter_(mthis, __arg_0) => mthis["srcset"] = __arg_0;
 
-  static type_Getter(mthis) native "HTMLSourceElement_type_Getter";
-  type_Getter_(mthis) => type_Getter(mthis);
+  type_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "type");
 
-  static type_Setter(mthis, __arg_0) native "HTMLSourceElement_type_Setter";
-  type_Setter_(mthis, __arg_0) => type_Setter(mthis, __arg_0);
+  type_Setter_(mthis, __arg_0) => mthis["type"] = __arg_0;
 
 }
 
@@ -12355,26 +7036,19 @@
 class BlinkHTMLStyleElement extends BlinkHTMLElement {
   static final instance = new BlinkHTMLStyleElement();
 
-  static disabled_Getter(mthis) native "HTMLStyleElement_disabled_Getter";
-  disabled_Getter_(mthis) => disabled_Getter(mthis);
+  disabled_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "disabled");
 
-  static disabled_Setter(mthis, __arg_0) native "HTMLStyleElement_disabled_Setter";
-  disabled_Setter_(mthis, __arg_0) => disabled_Setter(mthis, __arg_0);
+  disabled_Setter_(mthis, __arg_0) => mthis["disabled"] = __arg_0;
 
-  static media_Getter(mthis) native "HTMLStyleElement_media_Getter";
-  media_Getter_(mthis) => media_Getter(mthis);
+  media_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "media");
 
-  static media_Setter(mthis, __arg_0) native "HTMLStyleElement_media_Setter";
-  media_Setter_(mthis, __arg_0) => media_Setter(mthis, __arg_0);
+  media_Setter_(mthis, __arg_0) => mthis["media"] = __arg_0;
 
-  static sheet_Getter(mthis) native "HTMLStyleElement_sheet_Getter";
-  sheet_Getter_(mthis) => sheet_Getter(mthis);
+  sheet_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "sheet");
 
-  static type_Getter(mthis) native "HTMLStyleElement_type_Getter";
-  type_Getter_(mthis) => type_Getter(mthis);
+  type_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "type");
 
-  static type_Setter(mthis, __arg_0) native "HTMLStyleElement_type_Setter";
-  type_Setter_(mthis, __arg_0) => type_Setter(mthis, __arg_0);
+  type_Setter_(mthis, __arg_0) => mthis["type"] = __arg_0;
 
 }
 
@@ -12386,434 +7060,229 @@
 class BlinkHTMLTableCellElement extends BlinkHTMLElement {
   static final instance = new BlinkHTMLTableCellElement();
 
-  static cellIndex_Getter(mthis) native "HTMLTableCellElement_cellIndex_Getter";
-  cellIndex_Getter_(mthis) => cellIndex_Getter(mthis);
+  cellIndex_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "cellIndex");
 
-  static colSpan_Getter(mthis) native "HTMLTableCellElement_colSpan_Getter";
-  colSpan_Getter_(mthis) => colSpan_Getter(mthis);
+  colSpan_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "colSpan");
 
-  static colSpan_Setter(mthis, __arg_0) native "HTMLTableCellElement_colSpan_Setter";
-  colSpan_Setter_(mthis, __arg_0) => colSpan_Setter(mthis, __arg_0);
+  colSpan_Setter_(mthis, __arg_0) => mthis["colSpan"] = __arg_0;
 
-  static headers_Getter(mthis) native "HTMLTableCellElement_headers_Getter";
-  headers_Getter_(mthis) => headers_Getter(mthis);
+  headers_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "headers");
 
-  static headers_Setter(mthis, __arg_0) native "HTMLTableCellElement_headers_Setter";
-  headers_Setter_(mthis, __arg_0) => headers_Setter(mthis, __arg_0);
+  headers_Setter_(mthis, __arg_0) => mthis["headers"] = __arg_0;
 
-  static rowSpan_Getter(mthis) native "HTMLTableCellElement_rowSpan_Getter";
-  rowSpan_Getter_(mthis) => rowSpan_Getter(mthis);
+  rowSpan_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "rowSpan");
 
-  static rowSpan_Setter(mthis, __arg_0) native "HTMLTableCellElement_rowSpan_Setter";
-  rowSpan_Setter_(mthis, __arg_0) => rowSpan_Setter(mthis, __arg_0);
+  rowSpan_Setter_(mthis, __arg_0) => mthis["rowSpan"] = __arg_0;
 
 }
 
 class BlinkHTMLTableColElement extends BlinkHTMLElement {
   static final instance = new BlinkHTMLTableColElement();
 
-  static span_Getter(mthis) native "HTMLTableColElement_span_Getter";
-  span_Getter_(mthis) => span_Getter(mthis);
+  span_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "span");
 
-  static span_Setter(mthis, __arg_0) native "HTMLTableColElement_span_Setter";
-  span_Setter_(mthis, __arg_0) => span_Setter(mthis, __arg_0);
+  span_Setter_(mthis, __arg_0) => mthis["span"] = __arg_0;
 
 }
 
 class BlinkHTMLTableElement extends BlinkHTMLElement {
   static final instance = new BlinkHTMLTableElement();
 
-  static border_Getter(mthis) native "HTMLTableElement_border_Getter";
-  border_Getter_(mthis) => border_Getter(mthis);
+  border_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "border");
 
-  static border_Setter(mthis, __arg_0) native "HTMLTableElement_border_Setter";
-  border_Setter_(mthis, __arg_0) => border_Setter(mthis, __arg_0);
+  border_Setter_(mthis, __arg_0) => mthis["border"] = __arg_0;
 
-  static caption_Getter(mthis) native "HTMLTableElement_caption_Getter";
-  caption_Getter_(mthis) => caption_Getter(mthis);
+  caption_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "caption");
 
-  static caption_Setter(mthis, __arg_0) native "HTMLTableElement_caption_Setter";
-  caption_Setter_(mthis, __arg_0) => caption_Setter(mthis, __arg_0);
+  caption_Setter_(mthis, __arg_0) => mthis["caption"] = __arg_0;
 
-  static createCaption_Callback_0(mthis) native "HTMLTableElement_createCaption_Callback";
-  createCaption_Callback_0_(mthis) => createCaption_Callback_0(mthis);
+  createCaption_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createCaption", []);
 
-  static createCaption_Callback_1(mthis, __arg_0) native "HTMLTableElement_createCaption_Callback";
-  createCaption_Callback_1_(mthis, __arg_0) => createCaption_Callback_1(mthis, __arg_0);
+  createTBody_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createTBody", []);
 
-  static createCaption_Callback_2(mthis, __arg_0, __arg_1) native "HTMLTableElement_createCaption_Callback";
-  createCaption_Callback_2_(mthis, __arg_0, __arg_1) => createCaption_Callback_2(mthis, __arg_0, __arg_1);
+  createTFoot_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createTFoot", []);
 
-  static createTBody_Callback_0(mthis) native "HTMLTableElement_createTBody_Callback";
-  createTBody_Callback_0_(mthis) => createTBody_Callback_0(mthis);
+  createTHead_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createTHead", []);
 
-  static createTBody_Callback_1(mthis, __arg_0) native "HTMLTableElement_createTBody_Callback";
-  createTBody_Callback_1_(mthis, __arg_0) => createTBody_Callback_1(mthis, __arg_0);
+  deleteCaption_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "deleteCaption", []);
 
-  static createTBody_Callback_2(mthis, __arg_0, __arg_1) native "HTMLTableElement_createTBody_Callback";
-  createTBody_Callback_2_(mthis, __arg_0, __arg_1) => createTBody_Callback_2(mthis, __arg_0, __arg_1);
+  deleteRow_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "deleteRow", []);
 
-  static createTFoot_Callback_0(mthis) native "HTMLTableElement_createTFoot_Callback";
-  createTFoot_Callback_0_(mthis) => createTFoot_Callback_0(mthis);
+  deleteRow_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "deleteRow", [__arg_0]);
 
-  static createTFoot_Callback_1(mthis, __arg_0) native "HTMLTableElement_createTFoot_Callback";
-  createTFoot_Callback_1_(mthis, __arg_0) => createTFoot_Callback_1(mthis, __arg_0);
+  deleteTFoot_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "deleteTFoot", []);
 
-  static createTFoot_Callback_2(mthis, __arg_0, __arg_1) native "HTMLTableElement_createTFoot_Callback";
-  createTFoot_Callback_2_(mthis, __arg_0, __arg_1) => createTFoot_Callback_2(mthis, __arg_0, __arg_1);
+  deleteTHead_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "deleteTHead", []);
 
-  static createTHead_Callback_0(mthis) native "HTMLTableElement_createTHead_Callback";
-  createTHead_Callback_0_(mthis) => createTHead_Callback_0(mthis);
+  insertRow_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "insertRow", []);
 
-  static createTHead_Callback_1(mthis, __arg_0) native "HTMLTableElement_createTHead_Callback";
-  createTHead_Callback_1_(mthis, __arg_0) => createTHead_Callback_1(mthis, __arg_0);
+  insertRow_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "insertRow", [__arg_0]);
 
-  static createTHead_Callback_2(mthis, __arg_0, __arg_1) native "HTMLTableElement_createTHead_Callback";
-  createTHead_Callback_2_(mthis, __arg_0, __arg_1) => createTHead_Callback_2(mthis, __arg_0, __arg_1);
+  rows_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "rows");
 
-  static deleteCaption_Callback_0(mthis) native "HTMLTableElement_deleteCaption_Callback";
-  deleteCaption_Callback_0_(mthis) => deleteCaption_Callback_0(mthis);
+  tBodies_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "tBodies");
 
-  static deleteCaption_Callback_1(mthis, __arg_0) native "HTMLTableElement_deleteCaption_Callback";
-  deleteCaption_Callback_1_(mthis, __arg_0) => deleteCaption_Callback_1(mthis, __arg_0);
+  tFoot_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "tFoot");
 
-  static deleteCaption_Callback_2(mthis, __arg_0, __arg_1) native "HTMLTableElement_deleteCaption_Callback";
-  deleteCaption_Callback_2_(mthis, __arg_0, __arg_1) => deleteCaption_Callback_2(mthis, __arg_0, __arg_1);
+  tFoot_Setter_(mthis, __arg_0) => mthis["tFoot"] = __arg_0;
 
-  static deleteRow_Callback_0(mthis) native "HTMLTableElement_deleteRow_Callback";
-  deleteRow_Callback_0_(mthis) => deleteRow_Callback_0(mthis);
+  tHead_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "tHead");
 
-  static deleteRow_Callback_1(mthis, __arg_0) native "HTMLTableElement_deleteRow_Callback";
-  deleteRow_Callback_1_(mthis, __arg_0) => deleteRow_Callback_1(mthis, __arg_0);
-
-  static deleteRow_Callback_2(mthis, __arg_0, __arg_1) native "HTMLTableElement_deleteRow_Callback";
-  deleteRow_Callback_2_(mthis, __arg_0, __arg_1) => deleteRow_Callback_2(mthis, __arg_0, __arg_1);
-
-  static deleteRow_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "HTMLTableElement_deleteRow_Callback";
-  deleteRow_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => deleteRow_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static deleteTFoot_Callback_0(mthis) native "HTMLTableElement_deleteTFoot_Callback";
-  deleteTFoot_Callback_0_(mthis) => deleteTFoot_Callback_0(mthis);
-
-  static deleteTFoot_Callback_1(mthis, __arg_0) native "HTMLTableElement_deleteTFoot_Callback";
-  deleteTFoot_Callback_1_(mthis, __arg_0) => deleteTFoot_Callback_1(mthis, __arg_0);
-
-  static deleteTFoot_Callback_2(mthis, __arg_0, __arg_1) native "HTMLTableElement_deleteTFoot_Callback";
-  deleteTFoot_Callback_2_(mthis, __arg_0, __arg_1) => deleteTFoot_Callback_2(mthis, __arg_0, __arg_1);
-
-  static deleteTHead_Callback_0(mthis) native "HTMLTableElement_deleteTHead_Callback";
-  deleteTHead_Callback_0_(mthis) => deleteTHead_Callback_0(mthis);
-
-  static deleteTHead_Callback_1(mthis, __arg_0) native "HTMLTableElement_deleteTHead_Callback";
-  deleteTHead_Callback_1_(mthis, __arg_0) => deleteTHead_Callback_1(mthis, __arg_0);
-
-  static deleteTHead_Callback_2(mthis, __arg_0, __arg_1) native "HTMLTableElement_deleteTHead_Callback";
-  deleteTHead_Callback_2_(mthis, __arg_0, __arg_1) => deleteTHead_Callback_2(mthis, __arg_0, __arg_1);
-
-  static insertRow_Callback_0(mthis) native "HTMLTableElement_insertRow_Callback";
-  insertRow_Callback_0_(mthis) => insertRow_Callback_0(mthis);
-
-  static insertRow_Callback_1(mthis, __arg_0) native "HTMLTableElement_insertRow_Callback";
-  insertRow_Callback_1_(mthis, __arg_0) => insertRow_Callback_1(mthis, __arg_0);
-
-  static insertRow_Callback_2(mthis, __arg_0, __arg_1) native "HTMLTableElement_insertRow_Callback";
-  insertRow_Callback_2_(mthis, __arg_0, __arg_1) => insertRow_Callback_2(mthis, __arg_0, __arg_1);
-
-  static insertRow_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "HTMLTableElement_insertRow_Callback";
-  insertRow_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => insertRow_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static rows_Getter(mthis) native "HTMLTableElement_rows_Getter";
-  rows_Getter_(mthis) => rows_Getter(mthis);
-
-  static tBodies_Getter(mthis) native "HTMLTableElement_tBodies_Getter";
-  tBodies_Getter_(mthis) => tBodies_Getter(mthis);
-
-  static tFoot_Getter(mthis) native "HTMLTableElement_tFoot_Getter";
-  tFoot_Getter_(mthis) => tFoot_Getter(mthis);
-
-  static tFoot_Setter(mthis, __arg_0) native "HTMLTableElement_tFoot_Setter";
-  tFoot_Setter_(mthis, __arg_0) => tFoot_Setter(mthis, __arg_0);
-
-  static tHead_Getter(mthis) native "HTMLTableElement_tHead_Getter";
-  tHead_Getter_(mthis) => tHead_Getter(mthis);
-
-  static tHead_Setter(mthis, __arg_0) native "HTMLTableElement_tHead_Setter";
-  tHead_Setter_(mthis, __arg_0) => tHead_Setter(mthis, __arg_0);
+  tHead_Setter_(mthis, __arg_0) => mthis["tHead"] = __arg_0;
 
 }
 
 class BlinkHTMLTableRowElement extends BlinkHTMLElement {
   static final instance = new BlinkHTMLTableRowElement();
 
-  static cells_Getter(mthis) native "HTMLTableRowElement_cells_Getter";
-  cells_Getter_(mthis) => cells_Getter(mthis);
+  cells_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "cells");
 
-  static deleteCell_Callback_0(mthis) native "HTMLTableRowElement_deleteCell_Callback";
-  deleteCell_Callback_0_(mthis) => deleteCell_Callback_0(mthis);
+  deleteCell_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "deleteCell", []);
 
-  static deleteCell_Callback_1(mthis, __arg_0) native "HTMLTableRowElement_deleteCell_Callback";
-  deleteCell_Callback_1_(mthis, __arg_0) => deleteCell_Callback_1(mthis, __arg_0);
+  deleteCell_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "deleteCell", [__arg_0]);
 
-  static deleteCell_Callback_2(mthis, __arg_0, __arg_1) native "HTMLTableRowElement_deleteCell_Callback";
-  deleteCell_Callback_2_(mthis, __arg_0, __arg_1) => deleteCell_Callback_2(mthis, __arg_0, __arg_1);
+  insertCell_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "insertCell", []);
 
-  static deleteCell_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "HTMLTableRowElement_deleteCell_Callback";
-  deleteCell_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => deleteCell_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  insertCell_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "insertCell", [__arg_0]);
 
-  static insertCell_Callback_0(mthis) native "HTMLTableRowElement_insertCell_Callback";
-  insertCell_Callback_0_(mthis) => insertCell_Callback_0(mthis);
+  rowIndex_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "rowIndex");
 
-  static insertCell_Callback_1(mthis, __arg_0) native "HTMLTableRowElement_insertCell_Callback";
-  insertCell_Callback_1_(mthis, __arg_0) => insertCell_Callback_1(mthis, __arg_0);
-
-  static insertCell_Callback_2(mthis, __arg_0, __arg_1) native "HTMLTableRowElement_insertCell_Callback";
-  insertCell_Callback_2_(mthis, __arg_0, __arg_1) => insertCell_Callback_2(mthis, __arg_0, __arg_1);
-
-  static insertCell_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "HTMLTableRowElement_insertCell_Callback";
-  insertCell_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => insertCell_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static rowIndex_Getter(mthis) native "HTMLTableRowElement_rowIndex_Getter";
-  rowIndex_Getter_(mthis) => rowIndex_Getter(mthis);
-
-  static sectionRowIndex_Getter(mthis) native "HTMLTableRowElement_sectionRowIndex_Getter";
-  sectionRowIndex_Getter_(mthis) => sectionRowIndex_Getter(mthis);
+  sectionRowIndex_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "sectionRowIndex");
 
 }
 
 class BlinkHTMLTableSectionElement extends BlinkHTMLElement {
   static final instance = new BlinkHTMLTableSectionElement();
 
-  static deleteRow_Callback_0(mthis) native "HTMLTableSectionElement_deleteRow_Callback";
-  deleteRow_Callback_0_(mthis) => deleteRow_Callback_0(mthis);
+  deleteRow_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "deleteRow", []);
 
-  static deleteRow_Callback_1(mthis, __arg_0) native "HTMLTableSectionElement_deleteRow_Callback";
-  deleteRow_Callback_1_(mthis, __arg_0) => deleteRow_Callback_1(mthis, __arg_0);
+  deleteRow_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "deleteRow", [__arg_0]);
 
-  static deleteRow_Callback_2(mthis, __arg_0, __arg_1) native "HTMLTableSectionElement_deleteRow_Callback";
-  deleteRow_Callback_2_(mthis, __arg_0, __arg_1) => deleteRow_Callback_2(mthis, __arg_0, __arg_1);
+  insertRow_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "insertRow", []);
 
-  static deleteRow_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "HTMLTableSectionElement_deleteRow_Callback";
-  deleteRow_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => deleteRow_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  insertRow_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "insertRow", [__arg_0]);
 
-  static insertRow_Callback_0(mthis) native "HTMLTableSectionElement_insertRow_Callback";
-  insertRow_Callback_0_(mthis) => insertRow_Callback_0(mthis);
-
-  static insertRow_Callback_1(mthis, __arg_0) native "HTMLTableSectionElement_insertRow_Callback";
-  insertRow_Callback_1_(mthis, __arg_0) => insertRow_Callback_1(mthis, __arg_0);
-
-  static insertRow_Callback_2(mthis, __arg_0, __arg_1) native "HTMLTableSectionElement_insertRow_Callback";
-  insertRow_Callback_2_(mthis, __arg_0, __arg_1) => insertRow_Callback_2(mthis, __arg_0, __arg_1);
-
-  static insertRow_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "HTMLTableSectionElement_insertRow_Callback";
-  insertRow_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => insertRow_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static rows_Getter(mthis) native "HTMLTableSectionElement_rows_Getter";
-  rows_Getter_(mthis) => rows_Getter(mthis);
+  rows_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "rows");
 
 }
 
 class BlinkHTMLTemplateElement extends BlinkHTMLElement {
   static final instance = new BlinkHTMLTemplateElement();
 
-  static content_Getter(mthis) native "HTMLTemplateElement_content_Getter";
-  content_Getter_(mthis) => content_Getter(mthis);
+  content_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "content");
 
 }
 
 class BlinkHTMLTextAreaElement extends BlinkHTMLElement {
   static final instance = new BlinkHTMLTextAreaElement();
 
-  static autofocus_Getter(mthis) native "HTMLTextAreaElement_autofocus_Getter";
-  autofocus_Getter_(mthis) => autofocus_Getter(mthis);
+  autofocus_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "autofocus");
 
-  static autofocus_Setter(mthis, __arg_0) native "HTMLTextAreaElement_autofocus_Setter";
-  autofocus_Setter_(mthis, __arg_0) => autofocus_Setter(mthis, __arg_0);
+  autofocus_Setter_(mthis, __arg_0) => mthis["autofocus"] = __arg_0;
 
-  static checkValidity_Callback_0(mthis) native "HTMLTextAreaElement_checkValidity_Callback";
-  checkValidity_Callback_0_(mthis) => checkValidity_Callback_0(mthis);
+  checkValidity_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "checkValidity", []);
 
-  static checkValidity_Callback_1(mthis, __arg_0) native "HTMLTextAreaElement_checkValidity_Callback";
-  checkValidity_Callback_1_(mthis, __arg_0) => checkValidity_Callback_1(mthis, __arg_0);
+  cols_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "cols");
 
-  static checkValidity_Callback_2(mthis, __arg_0, __arg_1) native "HTMLTextAreaElement_checkValidity_Callback";
-  checkValidity_Callback_2_(mthis, __arg_0, __arg_1) => checkValidity_Callback_2(mthis, __arg_0, __arg_1);
+  cols_Setter_(mthis, __arg_0) => mthis["cols"] = __arg_0;
 
-  static cols_Getter(mthis) native "HTMLTextAreaElement_cols_Getter";
-  cols_Getter_(mthis) => cols_Getter(mthis);
+  defaultValue_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "defaultValue");
 
-  static cols_Setter(mthis, __arg_0) native "HTMLTextAreaElement_cols_Setter";
-  cols_Setter_(mthis, __arg_0) => cols_Setter(mthis, __arg_0);
+  defaultValue_Setter_(mthis, __arg_0) => mthis["defaultValue"] = __arg_0;
 
-  static defaultValue_Getter(mthis) native "HTMLTextAreaElement_defaultValue_Getter";
-  defaultValue_Getter_(mthis) => defaultValue_Getter(mthis);
+  dirName_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "dirName");
 
-  static defaultValue_Setter(mthis, __arg_0) native "HTMLTextAreaElement_defaultValue_Setter";
-  defaultValue_Setter_(mthis, __arg_0) => defaultValue_Setter(mthis, __arg_0);
+  dirName_Setter_(mthis, __arg_0) => mthis["dirName"] = __arg_0;
 
-  static dirName_Getter(mthis) native "HTMLTextAreaElement_dirName_Getter";
-  dirName_Getter_(mthis) => dirName_Getter(mthis);
+  disabled_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "disabled");
 
-  static dirName_Setter(mthis, __arg_0) native "HTMLTextAreaElement_dirName_Setter";
-  dirName_Setter_(mthis, __arg_0) => dirName_Setter(mthis, __arg_0);
+  disabled_Setter_(mthis, __arg_0) => mthis["disabled"] = __arg_0;
 
-  static disabled_Getter(mthis) native "HTMLTextAreaElement_disabled_Getter";
-  disabled_Getter_(mthis) => disabled_Getter(mthis);
+  form_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "form");
 
-  static disabled_Setter(mthis, __arg_0) native "HTMLTextAreaElement_disabled_Setter";
-  disabled_Setter_(mthis, __arg_0) => disabled_Setter(mthis, __arg_0);
+  inputMode_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "inputMode");
 
-  static form_Getter(mthis) native "HTMLTextAreaElement_form_Getter";
-  form_Getter_(mthis) => form_Getter(mthis);
+  inputMode_Setter_(mthis, __arg_0) => mthis["inputMode"] = __arg_0;
 
-  static inputMode_Getter(mthis) native "HTMLTextAreaElement_inputMode_Getter";
-  inputMode_Getter_(mthis) => inputMode_Getter(mthis);
+  labels_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "labels");
 
-  static inputMode_Setter(mthis, __arg_0) native "HTMLTextAreaElement_inputMode_Setter";
-  inputMode_Setter_(mthis, __arg_0) => inputMode_Setter(mthis, __arg_0);
+  maxLength_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "maxLength");
 
-  static labels_Getter(mthis) native "HTMLTextAreaElement_labels_Getter";
-  labels_Getter_(mthis) => labels_Getter(mthis);
+  maxLength_Setter_(mthis, __arg_0) => mthis["maxLength"] = __arg_0;
 
-  static maxLength_Getter(mthis) native "HTMLTextAreaElement_maxLength_Getter";
-  maxLength_Getter_(mthis) => maxLength_Getter(mthis);
+  name_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "name");
 
-  static maxLength_Setter(mthis, __arg_0) native "HTMLTextAreaElement_maxLength_Setter";
-  maxLength_Setter_(mthis, __arg_0) => maxLength_Setter(mthis, __arg_0);
+  name_Setter_(mthis, __arg_0) => mthis["name"] = __arg_0;
 
-  static name_Getter(mthis) native "HTMLTextAreaElement_name_Getter";
-  name_Getter_(mthis) => name_Getter(mthis);
+  placeholder_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "placeholder");
 
-  static name_Setter(mthis, __arg_0) native "HTMLTextAreaElement_name_Setter";
-  name_Setter_(mthis, __arg_0) => name_Setter(mthis, __arg_0);
+  placeholder_Setter_(mthis, __arg_0) => mthis["placeholder"] = __arg_0;
 
-  static placeholder_Getter(mthis) native "HTMLTextAreaElement_placeholder_Getter";
-  placeholder_Getter_(mthis) => placeholder_Getter(mthis);
+  readOnly_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "readOnly");
 
-  static placeholder_Setter(mthis, __arg_0) native "HTMLTextAreaElement_placeholder_Setter";
-  placeholder_Setter_(mthis, __arg_0) => placeholder_Setter(mthis, __arg_0);
+  readOnly_Setter_(mthis, __arg_0) => mthis["readOnly"] = __arg_0;
 
-  static readOnly_Getter(mthis) native "HTMLTextAreaElement_readOnly_Getter";
-  readOnly_Getter_(mthis) => readOnly_Getter(mthis);
+  required_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "required");
 
-  static readOnly_Setter(mthis, __arg_0) native "HTMLTextAreaElement_readOnly_Setter";
-  readOnly_Setter_(mthis, __arg_0) => readOnly_Setter(mthis, __arg_0);
+  required_Setter_(mthis, __arg_0) => mthis["required"] = __arg_0;
 
-  static required_Getter(mthis) native "HTMLTextAreaElement_required_Getter";
-  required_Getter_(mthis) => required_Getter(mthis);
+  rows_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "rows");
 
-  static required_Setter(mthis, __arg_0) native "HTMLTextAreaElement_required_Setter";
-  required_Setter_(mthis, __arg_0) => required_Setter(mthis, __arg_0);
+  rows_Setter_(mthis, __arg_0) => mthis["rows"] = __arg_0;
 
-  static rows_Getter(mthis) native "HTMLTextAreaElement_rows_Getter";
-  rows_Getter_(mthis) => rows_Getter(mthis);
+  select_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "select", []);
 
-  static rows_Setter(mthis, __arg_0) native "HTMLTextAreaElement_rows_Setter";
-  rows_Setter_(mthis, __arg_0) => rows_Setter(mthis, __arg_0);
+  selectionDirection_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "selectionDirection");
 
-  static select_Callback_0(mthis) native "HTMLTextAreaElement_select_Callback";
-  select_Callback_0_(mthis) => select_Callback_0(mthis);
+  selectionDirection_Setter_(mthis, __arg_0) => mthis["selectionDirection"] = __arg_0;
 
-  static select_Callback_1(mthis, __arg_0) native "HTMLTextAreaElement_select_Callback";
-  select_Callback_1_(mthis, __arg_0) => select_Callback_1(mthis, __arg_0);
+  selectionEnd_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "selectionEnd");
 
-  static select_Callback_2(mthis, __arg_0, __arg_1) native "HTMLTextAreaElement_select_Callback";
-  select_Callback_2_(mthis, __arg_0, __arg_1) => select_Callback_2(mthis, __arg_0, __arg_1);
+  selectionEnd_Setter_(mthis, __arg_0) => mthis["selectionEnd"] = __arg_0;
 
-  static selectionDirection_Getter(mthis) native "HTMLTextAreaElement_selectionDirection_Getter";
-  selectionDirection_Getter_(mthis) => selectionDirection_Getter(mthis);
+  selectionStart_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "selectionStart");
 
-  static selectionDirection_Setter(mthis, __arg_0) native "HTMLTextAreaElement_selectionDirection_Setter";
-  selectionDirection_Setter_(mthis, __arg_0) => selectionDirection_Setter(mthis, __arg_0);
+  selectionStart_Setter_(mthis, __arg_0) => mthis["selectionStart"] = __arg_0;
 
-  static selectionEnd_Getter(mthis) native "HTMLTextAreaElement_selectionEnd_Getter";
-  selectionEnd_Getter_(mthis) => selectionEnd_Getter(mthis);
+  setCustomValidity_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "setCustomValidity", []);
 
-  static selectionEnd_Setter(mthis, __arg_0) native "HTMLTextAreaElement_selectionEnd_Setter";
-  selectionEnd_Setter_(mthis, __arg_0) => selectionEnd_Setter(mthis, __arg_0);
+  setCustomValidity_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "setCustomValidity", [__arg_0]);
 
-  static selectionStart_Getter(mthis) native "HTMLTextAreaElement_selectionStart_Getter";
-  selectionStart_Getter_(mthis) => selectionStart_Getter(mthis);
+  setRangeText_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "setRangeText", []);
 
-  static selectionStart_Setter(mthis, __arg_0) native "HTMLTextAreaElement_selectionStart_Setter";
-  selectionStart_Setter_(mthis, __arg_0) => selectionStart_Setter(mthis, __arg_0);
+  setRangeText_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "setRangeText", [__arg_0]);
 
-  static setCustomValidity_Callback_0(mthis) native "HTMLTextAreaElement_setCustomValidity_Callback";
-  setCustomValidity_Callback_0_(mthis) => setCustomValidity_Callback_0(mthis);
+  setRangeText_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "setRangeText", [__arg_0, __arg_1]);
 
-  static setCustomValidity_Callback_1(mthis, __arg_0) native "HTMLTextAreaElement_setCustomValidity_Callback";
-  setCustomValidity_Callback_1_(mthis, __arg_0) => setCustomValidity_Callback_1(mthis, __arg_0);
+  setRangeText_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "setRangeText", [__arg_0, __arg_1, __arg_2]);
 
-  static setCustomValidity_Callback_2(mthis, __arg_0, __arg_1) native "HTMLTextAreaElement_setCustomValidity_Callback";
-  setCustomValidity_Callback_2_(mthis, __arg_0, __arg_1) => setCustomValidity_Callback_2(mthis, __arg_0, __arg_1);
+  setRangeText_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "setRangeText", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static setCustomValidity_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "HTMLTextAreaElement_setCustomValidity_Callback";
-  setCustomValidity_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => setCustomValidity_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  setSelectionRange_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "setSelectionRange", []);
 
-  static setRangeText_Callback_0(mthis) native "HTMLTextAreaElement_setRangeText_Callback";
-  setRangeText_Callback_0_(mthis) => setRangeText_Callback_0(mthis);
+  setSelectionRange_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "setSelectionRange", [__arg_0]);
 
-  static setRangeText_Callback_1(mthis, __arg_0) native "HTMLTextAreaElement_setRangeText_Callback";
-  setRangeText_Callback_1_(mthis, __arg_0) => setRangeText_Callback_1(mthis, __arg_0);
+  setSelectionRange_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "setSelectionRange", [__arg_0, __arg_1]);
 
-  static setRangeText_Callback_2(mthis, __arg_0, __arg_1) native "HTMLTextAreaElement_setRangeText_Callback";
-  setRangeText_Callback_2_(mthis, __arg_0, __arg_1) => setRangeText_Callback_2(mthis, __arg_0, __arg_1);
+  setSelectionRange_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "setSelectionRange", [__arg_0, __arg_1, __arg_2]);
 
-  static setRangeText_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "HTMLTextAreaElement_setRangeText_Callback";
-  setRangeText_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => setRangeText_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  textLength_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "textLength");
 
-  static setRangeText_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "HTMLTextAreaElement_setRangeText_Callback";
-  setRangeText_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => setRangeText_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  type_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "type");
 
-  static setRangeText_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "HTMLTextAreaElement_setRangeText_Callback";
-  setRangeText_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => setRangeText_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  validationMessage_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "validationMessage");
 
-  static setRangeText_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "HTMLTextAreaElement_setRangeText_Callback";
-  setRangeText_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => setRangeText_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  validity_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "validity");
 
-  static setSelectionRange_Callback_0(mthis) native "HTMLTextAreaElement_setSelectionRange_Callback";
-  setSelectionRange_Callback_0_(mthis) => setSelectionRange_Callback_0(mthis);
+  value_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "value");
 
-  static setSelectionRange_Callback_1(mthis, __arg_0) native "HTMLTextAreaElement_setSelectionRange_Callback";
-  setSelectionRange_Callback_1_(mthis, __arg_0) => setSelectionRange_Callback_1(mthis, __arg_0);
+  value_Setter_(mthis, __arg_0) => mthis["value"] = __arg_0;
 
-  static setSelectionRange_Callback_2(mthis, __arg_0, __arg_1) native "HTMLTextAreaElement_setSelectionRange_Callback";
-  setSelectionRange_Callback_2_(mthis, __arg_0, __arg_1) => setSelectionRange_Callback_2(mthis, __arg_0, __arg_1);
+  willValidate_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "willValidate");
 
-  static setSelectionRange_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "HTMLTextAreaElement_setSelectionRange_Callback";
-  setSelectionRange_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => setSelectionRange_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  wrap_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "wrap");
 
-  static setSelectionRange_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "HTMLTextAreaElement_setSelectionRange_Callback";
-  setSelectionRange_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => setSelectionRange_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static setSelectionRange_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "HTMLTextAreaElement_setSelectionRange_Callback";
-  setSelectionRange_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => setSelectionRange_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
-
-  static textLength_Getter(mthis) native "HTMLTextAreaElement_textLength_Getter";
-  textLength_Getter_(mthis) => textLength_Getter(mthis);
-
-  static type_Getter(mthis) native "HTMLTextAreaElement_type_Getter";
-  type_Getter_(mthis) => type_Getter(mthis);
-
-  static validationMessage_Getter(mthis) native "HTMLTextAreaElement_validationMessage_Getter";
-  validationMessage_Getter_(mthis) => validationMessage_Getter(mthis);
-
-  static validity_Getter(mthis) native "HTMLTextAreaElement_validity_Getter";
-  validity_Getter_(mthis) => validity_Getter(mthis);
-
-  static value_Getter(mthis) native "HTMLTextAreaElement_value_Getter";
-  value_Getter_(mthis) => value_Getter(mthis);
-
-  static value_Setter(mthis, __arg_0) native "HTMLTextAreaElement_value_Setter";
-  value_Setter_(mthis, __arg_0) => value_Setter(mthis, __arg_0);
-
-  static willValidate_Getter(mthis) native "HTMLTextAreaElement_willValidate_Getter";
-  willValidate_Getter_(mthis) => willValidate_Getter(mthis);
-
-  static wrap_Getter(mthis) native "HTMLTextAreaElement_wrap_Getter";
-  wrap_Getter_(mthis) => wrap_Getter(mthis);
-
-  static wrap_Setter(mthis, __arg_0) native "HTMLTextAreaElement_wrap_Setter";
-  wrap_Setter_(mthis, __arg_0) => wrap_Setter(mthis, __arg_0);
+  wrap_Setter_(mthis, __arg_0) => mthis["wrap"] = __arg_0;
 
 }
 
@@ -12825,47 +7294,33 @@
 class BlinkHTMLTrackElement extends BlinkHTMLElement {
   static final instance = new BlinkHTMLTrackElement();
 
-  static default_Getter(mthis) native "HTMLTrackElement_default_Getter";
-  default_Getter_(mthis) => default_Getter(mthis);
+  default_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "default");
 
-  static default_Setter(mthis, __arg_0) native "HTMLTrackElement_default_Setter";
-  default_Setter_(mthis, __arg_0) => default_Setter(mthis, __arg_0);
+  default_Setter_(mthis, __arg_0) => mthis["default"] = __arg_0;
 
-  static integrity_Getter(mthis) native "HTMLTrackElement_integrity_Getter";
-  integrity_Getter_(mthis) => integrity_Getter(mthis);
+  integrity_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "integrity");
 
-  static integrity_Setter(mthis, __arg_0) native "HTMLTrackElement_integrity_Setter";
-  integrity_Setter_(mthis, __arg_0) => integrity_Setter(mthis, __arg_0);
+  integrity_Setter_(mthis, __arg_0) => mthis["integrity"] = __arg_0;
 
-  static kind_Getter(mthis) native "HTMLTrackElement_kind_Getter";
-  kind_Getter_(mthis) => kind_Getter(mthis);
+  kind_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "kind");
 
-  static kind_Setter(mthis, __arg_0) native "HTMLTrackElement_kind_Setter";
-  kind_Setter_(mthis, __arg_0) => kind_Setter(mthis, __arg_0);
+  kind_Setter_(mthis, __arg_0) => mthis["kind"] = __arg_0;
 
-  static label_Getter(mthis) native "HTMLTrackElement_label_Getter";
-  label_Getter_(mthis) => label_Getter(mthis);
+  label_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "label");
 
-  static label_Setter(mthis, __arg_0) native "HTMLTrackElement_label_Setter";
-  label_Setter_(mthis, __arg_0) => label_Setter(mthis, __arg_0);
+  label_Setter_(mthis, __arg_0) => mthis["label"] = __arg_0;
 
-  static readyState_Getter(mthis) native "HTMLTrackElement_readyState_Getter";
-  readyState_Getter_(mthis) => readyState_Getter(mthis);
+  readyState_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "readyState");
 
-  static src_Getter(mthis) native "HTMLTrackElement_src_Getter";
-  src_Getter_(mthis) => src_Getter(mthis);
+  src_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "src");
 
-  static src_Setter(mthis, __arg_0) native "HTMLTrackElement_src_Setter";
-  src_Setter_(mthis, __arg_0) => src_Setter(mthis, __arg_0);
+  src_Setter_(mthis, __arg_0) => mthis["src"] = __arg_0;
 
-  static srclang_Getter(mthis) native "HTMLTrackElement_srclang_Getter";
-  srclang_Getter_(mthis) => srclang_Getter(mthis);
+  srclang_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "srclang");
 
-  static srclang_Setter(mthis, __arg_0) native "HTMLTrackElement_srclang_Setter";
-  srclang_Setter_(mthis, __arg_0) => srclang_Setter(mthis, __arg_0);
+  srclang_Setter_(mthis, __arg_0) => mthis["srclang"] = __arg_0;
 
-  static track_Getter(mthis) native "HTMLTrackElement_track_Getter";
-  track_Getter_(mthis) => track_Getter(mthis);
+  track_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "track");
 
 }
 
@@ -12882,3802 +7337,1889 @@
 class BlinkHTMLVideoElement extends BlinkHTMLMediaElement {
   static final instance = new BlinkHTMLVideoElement();
 
-  static getVideoPlaybackQuality_Callback_0(mthis) native "HTMLVideoElement_getVideoPlaybackQuality_Callback";
-  getVideoPlaybackQuality_Callback_0_(mthis) => getVideoPlaybackQuality_Callback_0(mthis);
+  getVideoPlaybackQuality_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getVideoPlaybackQuality", []);
 
-  static getVideoPlaybackQuality_Callback_1(mthis, __arg_0) native "HTMLVideoElement_getVideoPlaybackQuality_Callback";
-  getVideoPlaybackQuality_Callback_1_(mthis, __arg_0) => getVideoPlaybackQuality_Callback_1(mthis, __arg_0);
+  height_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "height");
 
-  static getVideoPlaybackQuality_Callback_2(mthis, __arg_0, __arg_1) native "HTMLVideoElement_getVideoPlaybackQuality_Callback";
-  getVideoPlaybackQuality_Callback_2_(mthis, __arg_0, __arg_1) => getVideoPlaybackQuality_Callback_2(mthis, __arg_0, __arg_1);
+  height_Setter_(mthis, __arg_0) => mthis["height"] = __arg_0;
 
-  static height_Getter(mthis) native "HTMLVideoElement_height_Getter";
-  height_Getter_(mthis) => height_Getter(mthis);
+  poster_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "poster");
 
-  static height_Setter(mthis, __arg_0) native "HTMLVideoElement_height_Setter";
-  height_Setter_(mthis, __arg_0) => height_Setter(mthis, __arg_0);
+  poster_Setter_(mthis, __arg_0) => mthis["poster"] = __arg_0;
 
-  static poster_Getter(mthis) native "HTMLVideoElement_poster_Getter";
-  poster_Getter_(mthis) => poster_Getter(mthis);
+  videoHeight_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "videoHeight");
 
-  static poster_Setter(mthis, __arg_0) native "HTMLVideoElement_poster_Setter";
-  poster_Setter_(mthis, __arg_0) => poster_Setter(mthis, __arg_0);
+  videoWidth_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "videoWidth");
 
-  static videoHeight_Getter(mthis) native "HTMLVideoElement_videoHeight_Getter";
-  videoHeight_Getter_(mthis) => videoHeight_Getter(mthis);
+  webkitDecodedFrameCount_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "webkitDecodedFrameCount");
 
-  static videoWidth_Getter(mthis) native "HTMLVideoElement_videoWidth_Getter";
-  videoWidth_Getter_(mthis) => videoWidth_Getter(mthis);
+  webkitDisplayingFullscreen_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "webkitDisplayingFullscreen");
 
-  static webkitDecodedFrameCount_Getter(mthis) native "HTMLVideoElement_webkitDecodedFrameCount_Getter";
-  webkitDecodedFrameCount_Getter_(mthis) => webkitDecodedFrameCount_Getter(mthis);
+  webkitDroppedFrameCount_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "webkitDroppedFrameCount");
 
-  static webkitDisplayingFullscreen_Getter(mthis) native "HTMLVideoElement_webkitDisplayingFullscreen_Getter";
-  webkitDisplayingFullscreen_Getter_(mthis) => webkitDisplayingFullscreen_Getter(mthis);
+  webkitEnterFullScreen_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "webkitEnterFullScreen", []);
 
-  static webkitDroppedFrameCount_Getter(mthis) native "HTMLVideoElement_webkitDroppedFrameCount_Getter";
-  webkitDroppedFrameCount_Getter_(mthis) => webkitDroppedFrameCount_Getter(mthis);
+  webkitEnterFullscreen_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "webkitEnterFullscreen", []);
 
-  static webkitEnterFullScreen_Callback_0(mthis) native "HTMLVideoElement_webkitEnterFullScreen_Callback";
-  webkitEnterFullScreen_Callback_0_(mthis) => webkitEnterFullScreen_Callback_0(mthis);
+  webkitExitFullScreen_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "webkitExitFullScreen", []);
 
-  static webkitEnterFullScreen_Callback_1(mthis, __arg_0) native "HTMLVideoElement_webkitEnterFullScreen_Callback";
-  webkitEnterFullScreen_Callback_1_(mthis, __arg_0) => webkitEnterFullScreen_Callback_1(mthis, __arg_0);
+  webkitExitFullscreen_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "webkitExitFullscreen", []);
 
-  static webkitEnterFullScreen_Callback_2(mthis, __arg_0, __arg_1) native "HTMLVideoElement_webkitEnterFullScreen_Callback";
-  webkitEnterFullScreen_Callback_2_(mthis, __arg_0, __arg_1) => webkitEnterFullScreen_Callback_2(mthis, __arg_0, __arg_1);
+  webkitSupportsFullscreen_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "webkitSupportsFullscreen");
 
-  static webkitEnterFullscreen_Callback_0(mthis) native "HTMLVideoElement_webkitEnterFullscreen_Callback";
-  webkitEnterFullscreen_Callback_0_(mthis) => webkitEnterFullscreen_Callback_0(mthis);
+  width_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "width");
 
-  static webkitEnterFullscreen_Callback_1(mthis, __arg_0) native "HTMLVideoElement_webkitEnterFullscreen_Callback";
-  webkitEnterFullscreen_Callback_1_(mthis, __arg_0) => webkitEnterFullscreen_Callback_1(mthis, __arg_0);
-
-  static webkitEnterFullscreen_Callback_2(mthis, __arg_0, __arg_1) native "HTMLVideoElement_webkitEnterFullscreen_Callback";
-  webkitEnterFullscreen_Callback_2_(mthis, __arg_0, __arg_1) => webkitEnterFullscreen_Callback_2(mthis, __arg_0, __arg_1);
-
-  static webkitExitFullScreen_Callback_0(mthis) native "HTMLVideoElement_webkitExitFullScreen_Callback";
-  webkitExitFullScreen_Callback_0_(mthis) => webkitExitFullScreen_Callback_0(mthis);
-
-  static webkitExitFullScreen_Callback_1(mthis, __arg_0) native "HTMLVideoElement_webkitExitFullScreen_Callback";
-  webkitExitFullScreen_Callback_1_(mthis, __arg_0) => webkitExitFullScreen_Callback_1(mthis, __arg_0);
-
-  static webkitExitFullScreen_Callback_2(mthis, __arg_0, __arg_1) native "HTMLVideoElement_webkitExitFullScreen_Callback";
-  webkitExitFullScreen_Callback_2_(mthis, __arg_0, __arg_1) => webkitExitFullScreen_Callback_2(mthis, __arg_0, __arg_1);
-
-  static webkitExitFullscreen_Callback_0(mthis) native "HTMLVideoElement_webkitExitFullscreen_Callback";
-  webkitExitFullscreen_Callback_0_(mthis) => webkitExitFullscreen_Callback_0(mthis);
-
-  static webkitExitFullscreen_Callback_1(mthis, __arg_0) native "HTMLVideoElement_webkitExitFullscreen_Callback";
-  webkitExitFullscreen_Callback_1_(mthis, __arg_0) => webkitExitFullscreen_Callback_1(mthis, __arg_0);
-
-  static webkitExitFullscreen_Callback_2(mthis, __arg_0, __arg_1) native "HTMLVideoElement_webkitExitFullscreen_Callback";
-  webkitExitFullscreen_Callback_2_(mthis, __arg_0, __arg_1) => webkitExitFullscreen_Callback_2(mthis, __arg_0, __arg_1);
-
-  static webkitSupportsFullscreen_Getter(mthis) native "HTMLVideoElement_webkitSupportsFullscreen_Getter";
-  webkitSupportsFullscreen_Getter_(mthis) => webkitSupportsFullscreen_Getter(mthis);
-
-  static width_Getter(mthis) native "HTMLVideoElement_width_Getter";
-  width_Getter_(mthis) => width_Getter(mthis);
-
-  static width_Setter(mthis, __arg_0) native "HTMLVideoElement_width_Setter";
-  width_Setter_(mthis, __arg_0) => width_Setter(mthis, __arg_0);
+  width_Setter_(mthis, __arg_0) => mthis["width"] = __arg_0;
 
 }
 
 class BlinkHashChangeEvent extends BlinkEvent {
   static final instance = new BlinkHashChangeEvent();
 
-  static constructorCallback_2(__arg_0, __arg_1) native "HashChangeEvent_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  constructorCallback_2_(__arg_0, __arg_1) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "HashChangeEvent"), [__arg_0, __arg_1]);
 
-  static initHashChangeEvent_Callback_0(mthis) native "HashChangeEvent_initHashChangeEvent_Callback";
-  initHashChangeEvent_Callback_0_(mthis) => initHashChangeEvent_Callback_0(mthis);
+  initHashChangeEvent_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "initHashChangeEvent", []);
 
-  static initHashChangeEvent_Callback_1(mthis, __arg_0) native "HashChangeEvent_initHashChangeEvent_Callback";
-  initHashChangeEvent_Callback_1_(mthis, __arg_0) => initHashChangeEvent_Callback_1(mthis, __arg_0);
+  initHashChangeEvent_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "initHashChangeEvent", [__arg_0]);
 
-  static initHashChangeEvent_Callback_2(mthis, __arg_0, __arg_1) native "HashChangeEvent_initHashChangeEvent_Callback";
-  initHashChangeEvent_Callback_2_(mthis, __arg_0, __arg_1) => initHashChangeEvent_Callback_2(mthis, __arg_0, __arg_1);
+  initHashChangeEvent_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "initHashChangeEvent", [__arg_0, __arg_1]);
 
-  static initHashChangeEvent_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "HashChangeEvent_initHashChangeEvent_Callback";
-  initHashChangeEvent_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => initHashChangeEvent_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  initHashChangeEvent_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "initHashChangeEvent", [__arg_0, __arg_1, __arg_2]);
 
-  static initHashChangeEvent_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "HashChangeEvent_initHashChangeEvent_Callback";
-  initHashChangeEvent_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => initHashChangeEvent_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  initHashChangeEvent_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "initHashChangeEvent", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static initHashChangeEvent_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "HashChangeEvent_initHashChangeEvent_Callback";
-  initHashChangeEvent_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => initHashChangeEvent_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  initHashChangeEvent_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => Blink_JsNative_DomException.callMethod(mthis, "initHashChangeEvent", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4]);
 
-  static initHashChangeEvent_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "HashChangeEvent_initHashChangeEvent_Callback";
-  initHashChangeEvent_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => initHashChangeEvent_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  newURL_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "newURL");
 
-  static initHashChangeEvent_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) native "HashChangeEvent_initHashChangeEvent_Callback";
-  initHashChangeEvent_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => initHashChangeEvent_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6);
-
-  static newURL_Getter(mthis) native "HashChangeEvent_newURL_Getter";
-  newURL_Getter_(mthis) => newURL_Getter(mthis);
-
-  static oldURL_Getter(mthis) native "HashChangeEvent_oldURL_Getter";
-  oldURL_Getter_(mthis) => oldURL_Getter(mthis);
+  oldURL_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "oldURL");
 
 }
 
 class BlinkHeaders {
   static final instance = new BlinkHeaders();
 
-  static append_Callback_0(mthis) native "Headers_append_Callback";
-  append_Callback_0_(mthis) => append_Callback_0(mthis);
+  append_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "append", []);
 
-  static append_Callback_1(mthis, __arg_0) native "Headers_append_Callback";
-  append_Callback_1_(mthis, __arg_0) => append_Callback_1(mthis, __arg_0);
+  append_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "append", [__arg_0]);
 
-  static append_Callback_2(mthis, __arg_0, __arg_1) native "Headers_append_Callback";
-  append_Callback_2_(mthis, __arg_0, __arg_1) => append_Callback_2(mthis, __arg_0, __arg_1);
+  append_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "append", [__arg_0, __arg_1]);
 
-  static append_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Headers_append_Callback";
-  append_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => append_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  constructorCallback_0_() => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "Headers"), []);
 
-  static append_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Headers_append_Callback";
-  append_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => append_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  constructorCallback_1_(__arg_0) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "Headers"), [__arg_0]);
 
-  static constructorCallback_0() native "Headers_constructorCallback";
-  constructorCallback_0_() => constructorCallback_0();
+  delete_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "delete", []);
 
-  static constructorCallback_1(__arg_0) native "Headers_constructorCallback";
-  constructorCallback_1_(__arg_0) => constructorCallback_1(__arg_0);
+  delete_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "delete", [__arg_0]);
 
-  static constructorCallback_2(__arg_0, __arg_1) native "Headers_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  forEach_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "forEach", []);
 
-  static constructorCallback_3(__arg_0, __arg_1, __arg_2) native "Headers_constructorCallback";
-  constructorCallback_3_(__arg_0, __arg_1, __arg_2) => constructorCallback_3(__arg_0, __arg_1, __arg_2);
+  forEach_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "forEach", [__arg_0]);
 
-  static delete_Callback_0(mthis) native "Headers_delete_Callback";
-  delete_Callback_0_(mthis) => delete_Callback_0(mthis);
+  forEach_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "forEach", [__arg_0, __arg_1]);
 
-  static delete_Callback_1(mthis, __arg_0) native "Headers_delete_Callback";
-  delete_Callback_1_(mthis, __arg_0) => delete_Callback_1(mthis, __arg_0);
+  getAll_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getAll", []);
 
-  static delete_Callback_2(mthis, __arg_0, __arg_1) native "Headers_delete_Callback";
-  delete_Callback_2_(mthis, __arg_0, __arg_1) => delete_Callback_2(mthis, __arg_0, __arg_1);
+  getAll_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getAll", [__arg_0]);
 
-  static delete_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Headers_delete_Callback";
-  delete_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => delete_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  get_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "get", []);
 
-  static forEach_Callback_0(mthis) native "Headers_forEach_Callback";
-  forEach_Callback_0_(mthis) => forEach_Callback_0(mthis);
+  get_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "get", [__arg_0]);
 
-  static forEach_Callback_1(mthis, __arg_0) native "Headers_forEach_Callback";
-  forEach_Callback_1_(mthis, __arg_0) => forEach_Callback_1(mthis, __arg_0);
+  has_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "has", []);
 
-  static forEach_Callback_2(mthis, __arg_0, __arg_1) native "Headers_forEach_Callback";
-  forEach_Callback_2_(mthis, __arg_0, __arg_1) => forEach_Callback_2(mthis, __arg_0, __arg_1);
+  has_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "has", [__arg_0]);
 
-  static forEach_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Headers_forEach_Callback";
-  forEach_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => forEach_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  set_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "set", []);
 
-  static forEach_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Headers_forEach_Callback";
-  forEach_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => forEach_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  set_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "set", [__arg_0]);
 
-  static getAll_Callback_0(mthis) native "Headers_getAll_Callback";
-  getAll_Callback_0_(mthis) => getAll_Callback_0(mthis);
+  set_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "set", [__arg_0, __arg_1]);
 
-  static getAll_Callback_1(mthis, __arg_0) native "Headers_getAll_Callback";
-  getAll_Callback_1_(mthis, __arg_0) => getAll_Callback_1(mthis, __arg_0);
-
-  static getAll_Callback_2(mthis, __arg_0, __arg_1) native "Headers_getAll_Callback";
-  getAll_Callback_2_(mthis, __arg_0, __arg_1) => getAll_Callback_2(mthis, __arg_0, __arg_1);
-
-  static getAll_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Headers_getAll_Callback";
-  getAll_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getAll_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static get_Callback_0(mthis) native "Headers_get_Callback";
-  get_Callback_0_(mthis) => get_Callback_0(mthis);
-
-  static get_Callback_1(mthis, __arg_0) native "Headers_get_Callback";
-  get_Callback_1_(mthis, __arg_0) => get_Callback_1(mthis, __arg_0);
-
-  static get_Callback_2(mthis, __arg_0, __arg_1) native "Headers_get_Callback";
-  get_Callback_2_(mthis, __arg_0, __arg_1) => get_Callback_2(mthis, __arg_0, __arg_1);
-
-  static get_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Headers_get_Callback";
-  get_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => get_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static has_Callback_0(mthis) native "Headers_has_Callback";
-  has_Callback_0_(mthis) => has_Callback_0(mthis);
-
-  static has_Callback_1(mthis, __arg_0) native "Headers_has_Callback";
-  has_Callback_1_(mthis, __arg_0) => has_Callback_1(mthis, __arg_0);
-
-  static has_Callback_2(mthis, __arg_0, __arg_1) native "Headers_has_Callback";
-  has_Callback_2_(mthis, __arg_0, __arg_1) => has_Callback_2(mthis, __arg_0, __arg_1);
-
-  static has_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Headers_has_Callback";
-  has_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => has_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static set_Callback_0(mthis) native "Headers_set_Callback";
-  set_Callback_0_(mthis) => set_Callback_0(mthis);
-
-  static set_Callback_1(mthis, __arg_0) native "Headers_set_Callback";
-  set_Callback_1_(mthis, __arg_0) => set_Callback_1(mthis, __arg_0);
-
-  static set_Callback_2(mthis, __arg_0, __arg_1) native "Headers_set_Callback";
-  set_Callback_2_(mthis, __arg_0, __arg_1) => set_Callback_2(mthis, __arg_0, __arg_1);
-
-  static set_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Headers_set_Callback";
-  set_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => set_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static set_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Headers_set_Callback";
-  set_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => set_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static size_Getter(mthis) native "Headers_size_Getter";
-  size_Getter_(mthis) => size_Getter(mthis);
+  size_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "size");
 
 }
 
 class BlinkHistory {
   static final instance = new BlinkHistory();
 
-  static back_Callback_0(mthis) native "History_back_Callback";
-  back_Callback_0_(mthis) => back_Callback_0(mthis);
+  back_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "back", []);
 
-  static back_Callback_1(mthis, __arg_0) native "History_back_Callback";
-  back_Callback_1_(mthis, __arg_0) => back_Callback_1(mthis, __arg_0);
+  forward_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "forward", []);
 
-  static back_Callback_2(mthis, __arg_0, __arg_1) native "History_back_Callback";
-  back_Callback_2_(mthis, __arg_0, __arg_1) => back_Callback_2(mthis, __arg_0, __arg_1);
+  go_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "go", []);
 
-  static forward_Callback_0(mthis) native "History_forward_Callback";
-  forward_Callback_0_(mthis) => forward_Callback_0(mthis);
+  go_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "go", [__arg_0]);
 
-  static forward_Callback_1(mthis, __arg_0) native "History_forward_Callback";
-  forward_Callback_1_(mthis, __arg_0) => forward_Callback_1(mthis, __arg_0);
+  length_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "length");
 
-  static forward_Callback_2(mthis, __arg_0, __arg_1) native "History_forward_Callback";
-  forward_Callback_2_(mthis, __arg_0, __arg_1) => forward_Callback_2(mthis, __arg_0, __arg_1);
+  pushState_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "pushState", []);
 
-  static go_Callback_0(mthis) native "History_go_Callback";
-  go_Callback_0_(mthis) => go_Callback_0(mthis);
+  pushState_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "pushState", [__arg_0]);
 
-  static go_Callback_1(mthis, __arg_0) native "History_go_Callback";
-  go_Callback_1_(mthis, __arg_0) => go_Callback_1(mthis, __arg_0);
+  pushState_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "pushState", [__arg_0, __arg_1]);
 
-  static go_Callback_2(mthis, __arg_0, __arg_1) native "History_go_Callback";
-  go_Callback_2_(mthis, __arg_0, __arg_1) => go_Callback_2(mthis, __arg_0, __arg_1);
+  pushState_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "pushState", [__arg_0, __arg_1, __arg_2]);
 
-  static go_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "History_go_Callback";
-  go_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => go_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  replaceState_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "replaceState", []);
 
-  static length_Getter(mthis) native "History_length_Getter";
-  length_Getter_(mthis) => length_Getter(mthis);
+  replaceState_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "replaceState", [__arg_0]);
 
-  static pushState_Callback_0(mthis) native "History_pushState_Callback";
-  pushState_Callback_0_(mthis) => pushState_Callback_0(mthis);
+  replaceState_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "replaceState", [__arg_0, __arg_1]);
 
-  static pushState_Callback_1(mthis, __arg_0) native "History_pushState_Callback";
-  pushState_Callback_1_(mthis, __arg_0) => pushState_Callback_1(mthis, __arg_0);
+  replaceState_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "replaceState", [__arg_0, __arg_1, __arg_2]);
 
-  static pushState_Callback_2(mthis, __arg_0, __arg_1) native "History_pushState_Callback";
-  pushState_Callback_2_(mthis, __arg_0, __arg_1) => pushState_Callback_2(mthis, __arg_0, __arg_1);
-
-  static pushState_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "History_pushState_Callback";
-  pushState_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => pushState_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static pushState_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "History_pushState_Callback";
-  pushState_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => pushState_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static pushState_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "History_pushState_Callback";
-  pushState_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => pushState_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
-
-  static replaceState_Callback_0(mthis) native "History_replaceState_Callback";
-  replaceState_Callback_0_(mthis) => replaceState_Callback_0(mthis);
-
-  static replaceState_Callback_1(mthis, __arg_0) native "History_replaceState_Callback";
-  replaceState_Callback_1_(mthis, __arg_0) => replaceState_Callback_1(mthis, __arg_0);
-
-  static replaceState_Callback_2(mthis, __arg_0, __arg_1) native "History_replaceState_Callback";
-  replaceState_Callback_2_(mthis, __arg_0, __arg_1) => replaceState_Callback_2(mthis, __arg_0, __arg_1);
-
-  static replaceState_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "History_replaceState_Callback";
-  replaceState_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => replaceState_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static replaceState_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "History_replaceState_Callback";
-  replaceState_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => replaceState_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static replaceState_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "History_replaceState_Callback";
-  replaceState_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => replaceState_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
-
-  static state_Getter(mthis) native "History_state_Getter";
-  state_Getter_(mthis) => state_Getter(mthis);
+  state_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "state");
 
 }
 
 class BlinkIDBCursor {
   static final instance = new BlinkIDBCursor();
 
-  static advance_Callback_0(mthis) native "IDBCursor_advance_Callback";
-  advance_Callback_0_(mthis) => advance_Callback_0(mthis);
+  advance_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "advance", []);
 
-  static advance_Callback_1(mthis, __arg_0) native "IDBCursor_advance_Callback";
-  advance_Callback_1_(mthis, __arg_0) => advance_Callback_1(mthis, __arg_0);
+  advance_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "advance", [__arg_0]);
 
-  static advance_Callback_2(mthis, __arg_0, __arg_1) native "IDBCursor_advance_Callback";
-  advance_Callback_2_(mthis, __arg_0, __arg_1) => advance_Callback_2(mthis, __arg_0, __arg_1);
+  continuePrimaryKey_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "continuePrimaryKey", []);
 
-  static advance_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "IDBCursor_advance_Callback";
-  advance_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => advance_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  continuePrimaryKey_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "continuePrimaryKey", [__arg_0]);
 
-  static continuePrimaryKey_Callback_0(mthis) native "IDBCursor_continuePrimaryKey_Callback";
-  continuePrimaryKey_Callback_0_(mthis) => continuePrimaryKey_Callback_0(mthis);
+  continuePrimaryKey_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "continuePrimaryKey", [__arg_0, __arg_1]);
 
-  static continuePrimaryKey_Callback_1(mthis, __arg_0) native "IDBCursor_continuePrimaryKey_Callback";
-  continuePrimaryKey_Callback_1_(mthis, __arg_0) => continuePrimaryKey_Callback_1(mthis, __arg_0);
+  continue_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "continue", []);
 
-  static continuePrimaryKey_Callback_2(mthis, __arg_0, __arg_1) native "IDBCursor_continuePrimaryKey_Callback";
-  continuePrimaryKey_Callback_2_(mthis, __arg_0, __arg_1) => continuePrimaryKey_Callback_2(mthis, __arg_0, __arg_1);
+  continue_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "continue", [__arg_0]);
 
-  static continuePrimaryKey_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "IDBCursor_continuePrimaryKey_Callback";
-  continuePrimaryKey_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => continuePrimaryKey_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  delete_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "delete", []);
 
-  static continuePrimaryKey_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "IDBCursor_continuePrimaryKey_Callback";
-  continuePrimaryKey_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => continuePrimaryKey_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  direction_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "direction");
 
-  static continue_Callback_0(mthis) native "IDBCursor_continue_Callback";
-  continue_Callback_0_(mthis) => continue_Callback_0(mthis);
+  key_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "key");
 
-  static continue_Callback_1(mthis, __arg_0) native "IDBCursor_continue_Callback";
-  continue_Callback_1_(mthis, __arg_0) => continue_Callback_1(mthis, __arg_0);
+  primaryKey_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "primaryKey");
 
-  static continue_Callback_2(mthis, __arg_0, __arg_1) native "IDBCursor_continue_Callback";
-  continue_Callback_2_(mthis, __arg_0, __arg_1) => continue_Callback_2(mthis, __arg_0, __arg_1);
+  source_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "source");
 
-  static continue_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "IDBCursor_continue_Callback";
-  continue_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => continue_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  update_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "update", []);
 
-  static delete_Callback_0(mthis) native "IDBCursor_delete_Callback";
-  delete_Callback_0_(mthis) => delete_Callback_0(mthis);
-
-  static delete_Callback_1(mthis, __arg_0) native "IDBCursor_delete_Callback";
-  delete_Callback_1_(mthis, __arg_0) => delete_Callback_1(mthis, __arg_0);
-
-  static delete_Callback_2(mthis, __arg_0, __arg_1) native "IDBCursor_delete_Callback";
-  delete_Callback_2_(mthis, __arg_0, __arg_1) => delete_Callback_2(mthis, __arg_0, __arg_1);
-
-  static direction_Getter(mthis) native "IDBCursor_direction_Getter";
-  direction_Getter_(mthis) => direction_Getter(mthis);
-
-  static key_Getter(mthis) native "IDBCursor_key_Getter";
-  key_Getter_(mthis) => key_Getter(mthis);
-
-  static primaryKey_Getter(mthis) native "IDBCursor_primaryKey_Getter";
-  primaryKey_Getter_(mthis) => primaryKey_Getter(mthis);
-
-  static source_Getter(mthis) native "IDBCursor_source_Getter";
-  source_Getter_(mthis) => source_Getter(mthis);
-
-  static update_Callback_0(mthis) native "IDBCursor_update_Callback";
-  update_Callback_0_(mthis) => update_Callback_0(mthis);
-
-  static update_Callback_1(mthis, __arg_0) native "IDBCursor_update_Callback";
-  update_Callback_1_(mthis, __arg_0) => update_Callback_1(mthis, __arg_0);
-
-  static update_Callback_2(mthis, __arg_0, __arg_1) native "IDBCursor_update_Callback";
-  update_Callback_2_(mthis, __arg_0, __arg_1) => update_Callback_2(mthis, __arg_0, __arg_1);
-
-  static update_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "IDBCursor_update_Callback";
-  update_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => update_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  update_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "update", [__arg_0]);
 
 }
 
 class BlinkIDBCursorWithValue extends BlinkIDBCursor {
   static final instance = new BlinkIDBCursorWithValue();
 
-  static value_Getter(mthis) native "IDBCursorWithValue_value_Getter";
-  value_Getter_(mthis) => value_Getter(mthis);
+  value_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "value");
 
 }
 
 class BlinkIDBDatabase extends BlinkEventTarget {
   static final instance = new BlinkIDBDatabase();
 
-  static close_Callback_0(mthis) native "IDBDatabase_close_Callback";
-  close_Callback_0_(mthis) => close_Callback_0(mthis);
+  close_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "close", []);
 
-  static close_Callback_1(mthis, __arg_0) native "IDBDatabase_close_Callback";
-  close_Callback_1_(mthis, __arg_0) => close_Callback_1(mthis, __arg_0);
+  createObjectStore_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createObjectStore", []);
 
-  static close_Callback_2(mthis, __arg_0, __arg_1) native "IDBDatabase_close_Callback";
-  close_Callback_2_(mthis, __arg_0, __arg_1) => close_Callback_2(mthis, __arg_0, __arg_1);
+  createObjectStore_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "createObjectStore", [__arg_0]);
 
-  static createObjectStore_Callback_0(mthis) native "IDBDatabase_createObjectStore_Callback";
-  createObjectStore_Callback_0_(mthis) => createObjectStore_Callback_0(mthis);
+  createObjectStore_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "createObjectStore", [__arg_0, __arg_1]);
 
-  static createObjectStore_Callback_1(mthis, __arg_0) native "IDBDatabase_createObjectStore_Callback";
-  createObjectStore_Callback_1_(mthis, __arg_0) => createObjectStore_Callback_1(mthis, __arg_0);
+  deleteObjectStore_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "deleteObjectStore", []);
 
-  static createObjectStore_Callback_2(mthis, __arg_0, __arg_1) native "IDBDatabase_createObjectStore_Callback";
-  createObjectStore_Callback_2_(mthis, __arg_0, __arg_1) => createObjectStore_Callback_2(mthis, __arg_0, __arg_1);
+  deleteObjectStore_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "deleteObjectStore", [__arg_0]);
 
-  static createObjectStore_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "IDBDatabase_createObjectStore_Callback";
-  createObjectStore_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => createObjectStore_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  name_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "name");
 
-  static createObjectStore_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "IDBDatabase_createObjectStore_Callback";
-  createObjectStore_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => createObjectStore_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  objectStoreNames_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "objectStoreNames");
 
-  static deleteObjectStore_Callback_0(mthis) native "IDBDatabase_deleteObjectStore_Callback";
-  deleteObjectStore_Callback_0_(mthis) => deleteObjectStore_Callback_0(mthis);
+  onabort_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onabort");
 
-  static deleteObjectStore_Callback_1(mthis, __arg_0) native "IDBDatabase_deleteObjectStore_Callback";
-  deleteObjectStore_Callback_1_(mthis, __arg_0) => deleteObjectStore_Callback_1(mthis, __arg_0);
+  onabort_Setter_(mthis, __arg_0) => mthis["onabort"] = __arg_0;
 
-  static deleteObjectStore_Callback_2(mthis, __arg_0, __arg_1) native "IDBDatabase_deleteObjectStore_Callback";
-  deleteObjectStore_Callback_2_(mthis, __arg_0, __arg_1) => deleteObjectStore_Callback_2(mthis, __arg_0, __arg_1);
+  onclose_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onclose");
 
-  static deleteObjectStore_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "IDBDatabase_deleteObjectStore_Callback";
-  deleteObjectStore_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => deleteObjectStore_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  onclose_Setter_(mthis, __arg_0) => mthis["onclose"] = __arg_0;
 
-  static name_Getter(mthis) native "IDBDatabase_name_Getter";
-  name_Getter_(mthis) => name_Getter(mthis);
+  onerror_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onerror");
 
-  static objectStoreNames_Getter(mthis) native "IDBDatabase_objectStoreNames_Getter";
-  objectStoreNames_Getter_(mthis) => objectStoreNames_Getter(mthis);
+  onerror_Setter_(mthis, __arg_0) => mthis["onerror"] = __arg_0;
 
-  static onabort_Getter(mthis) native "IDBDatabase_onabort_Getter";
-  onabort_Getter_(mthis) => onabort_Getter(mthis);
+  onversionchange_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onversionchange");
 
-  static onabort_Setter(mthis, __arg_0) native "IDBDatabase_onabort_Setter";
-  onabort_Setter_(mthis, __arg_0) => onabort_Setter(mthis, __arg_0);
+  onversionchange_Setter_(mthis, __arg_0) => mthis["onversionchange"] = __arg_0;
 
-  static onclose_Getter(mthis) native "IDBDatabase_onclose_Getter";
-  onclose_Getter_(mthis) => onclose_Getter(mthis);
+  transaction_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "transaction", []);
 
-  static onclose_Setter(mthis, __arg_0) native "IDBDatabase_onclose_Setter";
-  onclose_Setter_(mthis, __arg_0) => onclose_Setter(mthis, __arg_0);
+  transaction_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "transaction", [__arg_0]);
 
-  static onerror_Getter(mthis) native "IDBDatabase_onerror_Getter";
-  onerror_Getter_(mthis) => onerror_Getter(mthis);
+  transaction_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "transaction", [__arg_0, __arg_1]);
 
-  static onerror_Setter(mthis, __arg_0) native "IDBDatabase_onerror_Setter";
-  onerror_Setter_(mthis, __arg_0) => onerror_Setter(mthis, __arg_0);
-
-  static onversionchange_Getter(mthis) native "IDBDatabase_onversionchange_Getter";
-  onversionchange_Getter_(mthis) => onversionchange_Getter(mthis);
-
-  static onversionchange_Setter(mthis, __arg_0) native "IDBDatabase_onversionchange_Setter";
-  onversionchange_Setter_(mthis, __arg_0) => onversionchange_Setter(mthis, __arg_0);
-
-  static transaction_Callback_0(mthis) native "IDBDatabase_transaction_Callback";
-  transaction_Callback_0_(mthis) => transaction_Callback_0(mthis);
-
-  static transaction_Callback_1(mthis, __arg_0) native "IDBDatabase_transaction_Callback";
-  transaction_Callback_1_(mthis, __arg_0) => transaction_Callback_1(mthis, __arg_0);
-
-  static transaction_Callback_2(mthis, __arg_0, __arg_1) native "IDBDatabase_transaction_Callback";
-  transaction_Callback_2_(mthis, __arg_0, __arg_1) => transaction_Callback_2(mthis, __arg_0, __arg_1);
-
-  static transaction_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "IDBDatabase_transaction_Callback";
-  transaction_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => transaction_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static transaction_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "IDBDatabase_transaction_Callback";
-  transaction_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => transaction_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static version_Getter(mthis) native "IDBDatabase_version_Getter";
-  version_Getter_(mthis) => version_Getter(mthis);
+  version_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "version");
 
 }
 
 class BlinkIDBFactory {
   static final instance = new BlinkIDBFactory();
 
-  static cmp_Callback_0(mthis) native "IDBFactory_cmp_Callback";
-  cmp_Callback_0_(mthis) => cmp_Callback_0(mthis);
+  cmp_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "cmp", []);
 
-  static cmp_Callback_1(mthis, __arg_0) native "IDBFactory_cmp_Callback";
-  cmp_Callback_1_(mthis, __arg_0) => cmp_Callback_1(mthis, __arg_0);
+  cmp_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "cmp", [__arg_0]);
 
-  static cmp_Callback_2(mthis, __arg_0, __arg_1) native "IDBFactory_cmp_Callback";
-  cmp_Callback_2_(mthis, __arg_0, __arg_1) => cmp_Callback_2(mthis, __arg_0, __arg_1);
+  cmp_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "cmp", [__arg_0, __arg_1]);
 
-  static cmp_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "IDBFactory_cmp_Callback";
-  cmp_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => cmp_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  deleteDatabase_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "deleteDatabase", []);
 
-  static cmp_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "IDBFactory_cmp_Callback";
-  cmp_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => cmp_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  deleteDatabase_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "deleteDatabase", [__arg_0]);
 
-  static deleteDatabase_Callback_0(mthis) native "IDBFactory_deleteDatabase_Callback";
-  deleteDatabase_Callback_0_(mthis) => deleteDatabase_Callback_0(mthis);
+  open_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "open", []);
 
-  static deleteDatabase_Callback_1(mthis, __arg_0) native "IDBFactory_deleteDatabase_Callback";
-  deleteDatabase_Callback_1_(mthis, __arg_0) => deleteDatabase_Callback_1(mthis, __arg_0);
+  open_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "open", [__arg_0]);
 
-  static deleteDatabase_Callback_2(mthis, __arg_0, __arg_1) native "IDBFactory_deleteDatabase_Callback";
-  deleteDatabase_Callback_2_(mthis, __arg_0, __arg_1) => deleteDatabase_Callback_2(mthis, __arg_0, __arg_1);
+  open_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "open", [__arg_0, __arg_1]);
 
-  static deleteDatabase_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "IDBFactory_deleteDatabase_Callback";
-  deleteDatabase_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => deleteDatabase_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static open_Callback_0(mthis) native "IDBFactory_open_Callback";
-  open_Callback_0_(mthis) => open_Callback_0(mthis);
-
-  static open_Callback_1(mthis, __arg_0) native "IDBFactory_open_Callback";
-  open_Callback_1_(mthis, __arg_0) => open_Callback_1(mthis, __arg_0);
-
-  static open_Callback_2(mthis, __arg_0, __arg_1) native "IDBFactory_open_Callback";
-  open_Callback_2_(mthis, __arg_0, __arg_1) => open_Callback_2(mthis, __arg_0, __arg_1);
-
-  static open_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "IDBFactory_open_Callback";
-  open_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => open_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static open_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "IDBFactory_open_Callback";
-  open_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => open_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static webkitGetDatabaseNames_Callback_0(mthis) native "IDBFactory_webkitGetDatabaseNames_Callback";
-  webkitGetDatabaseNames_Callback_0_(mthis) => webkitGetDatabaseNames_Callback_0(mthis);
-
-  static webkitGetDatabaseNames_Callback_1(mthis, __arg_0) native "IDBFactory_webkitGetDatabaseNames_Callback";
-  webkitGetDatabaseNames_Callback_1_(mthis, __arg_0) => webkitGetDatabaseNames_Callback_1(mthis, __arg_0);
-
-  static webkitGetDatabaseNames_Callback_2(mthis, __arg_0, __arg_1) native "IDBFactory_webkitGetDatabaseNames_Callback";
-  webkitGetDatabaseNames_Callback_2_(mthis, __arg_0, __arg_1) => webkitGetDatabaseNames_Callback_2(mthis, __arg_0, __arg_1);
+  webkitGetDatabaseNames_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "webkitGetDatabaseNames", []);
 
 }
 
 class BlinkIDBIndex {
   static final instance = new BlinkIDBIndex();
 
-  static count_Callback_0(mthis) native "IDBIndex_count_Callback";
-  count_Callback_0_(mthis) => count_Callback_0(mthis);
+  count_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "count", []);
 
-  static count_Callback_1(mthis, __arg_0) native "IDBIndex_count_Callback";
-  count_Callback_1_(mthis, __arg_0) => count_Callback_1(mthis, __arg_0);
+  count_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "count", [__arg_0]);
 
-  static count_Callback_2(mthis, __arg_0, __arg_1) native "IDBIndex_count_Callback";
-  count_Callback_2_(mthis, __arg_0, __arg_1) => count_Callback_2(mthis, __arg_0, __arg_1);
+  getKey_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getKey", []);
 
-  static count_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "IDBIndex_count_Callback";
-  count_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => count_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  getKey_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getKey", [__arg_0]);
 
-  static getKey_Callback_0(mthis) native "IDBIndex_getKey_Callback";
-  getKey_Callback_0_(mthis) => getKey_Callback_0(mthis);
+  get_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "get", []);
 
-  static getKey_Callback_1(mthis, __arg_0) native "IDBIndex_getKey_Callback";
-  getKey_Callback_1_(mthis, __arg_0) => getKey_Callback_1(mthis, __arg_0);
+  get_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "get", [__arg_0]);
 
-  static getKey_Callback_2(mthis, __arg_0, __arg_1) native "IDBIndex_getKey_Callback";
-  getKey_Callback_2_(mthis, __arg_0, __arg_1) => getKey_Callback_2(mthis, __arg_0, __arg_1);
+  keyPath_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "keyPath");
 
-  static getKey_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "IDBIndex_getKey_Callback";
-  getKey_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getKey_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  multiEntry_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "multiEntry");
 
-  static get_Callback_0(mthis) native "IDBIndex_get_Callback";
-  get_Callback_0_(mthis) => get_Callback_0(mthis);
+  name_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "name");
 
-  static get_Callback_1(mthis, __arg_0) native "IDBIndex_get_Callback";
-  get_Callback_1_(mthis, __arg_0) => get_Callback_1(mthis, __arg_0);
+  objectStore_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "objectStore");
 
-  static get_Callback_2(mthis, __arg_0, __arg_1) native "IDBIndex_get_Callback";
-  get_Callback_2_(mthis, __arg_0, __arg_1) => get_Callback_2(mthis, __arg_0, __arg_1);
+  openCursor_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "openCursor", []);
 
-  static get_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "IDBIndex_get_Callback";
-  get_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => get_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  openCursor_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "openCursor", [__arg_0]);
 
-  static keyPath_Getter(mthis) native "IDBIndex_keyPath_Getter";
-  keyPath_Getter_(mthis) => keyPath_Getter(mthis);
+  openCursor_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "openCursor", [__arg_0, __arg_1]);
 
-  static multiEntry_Getter(mthis) native "IDBIndex_multiEntry_Getter";
-  multiEntry_Getter_(mthis) => multiEntry_Getter(mthis);
+  openKeyCursor_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "openKeyCursor", []);
 
-  static name_Getter(mthis) native "IDBIndex_name_Getter";
-  name_Getter_(mthis) => name_Getter(mthis);
+  openKeyCursor_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "openKeyCursor", [__arg_0]);
 
-  static objectStore_Getter(mthis) native "IDBIndex_objectStore_Getter";
-  objectStore_Getter_(mthis) => objectStore_Getter(mthis);
+  openKeyCursor_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "openKeyCursor", [__arg_0, __arg_1]);
 
-  static openCursor_Callback_0(mthis) native "IDBIndex_openCursor_Callback";
-  openCursor_Callback_0_(mthis) => openCursor_Callback_0(mthis);
-
-  static openCursor_Callback_1(mthis, __arg_0) native "IDBIndex_openCursor_Callback";
-  openCursor_Callback_1_(mthis, __arg_0) => openCursor_Callback_1(mthis, __arg_0);
-
-  static openCursor_Callback_2(mthis, __arg_0, __arg_1) native "IDBIndex_openCursor_Callback";
-  openCursor_Callback_2_(mthis, __arg_0, __arg_1) => openCursor_Callback_2(mthis, __arg_0, __arg_1);
-
-  static openCursor_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "IDBIndex_openCursor_Callback";
-  openCursor_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => openCursor_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static openCursor_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "IDBIndex_openCursor_Callback";
-  openCursor_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => openCursor_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static openKeyCursor_Callback_0(mthis) native "IDBIndex_openKeyCursor_Callback";
-  openKeyCursor_Callback_0_(mthis) => openKeyCursor_Callback_0(mthis);
-
-  static openKeyCursor_Callback_1(mthis, __arg_0) native "IDBIndex_openKeyCursor_Callback";
-  openKeyCursor_Callback_1_(mthis, __arg_0) => openKeyCursor_Callback_1(mthis, __arg_0);
-
-  static openKeyCursor_Callback_2(mthis, __arg_0, __arg_1) native "IDBIndex_openKeyCursor_Callback";
-  openKeyCursor_Callback_2_(mthis, __arg_0, __arg_1) => openKeyCursor_Callback_2(mthis, __arg_0, __arg_1);
-
-  static openKeyCursor_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "IDBIndex_openKeyCursor_Callback";
-  openKeyCursor_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => openKeyCursor_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static openKeyCursor_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "IDBIndex_openKeyCursor_Callback";
-  openKeyCursor_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => openKeyCursor_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static unique_Getter(mthis) native "IDBIndex_unique_Getter";
-  unique_Getter_(mthis) => unique_Getter(mthis);
+  unique_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "unique");
 
 }
 
 class BlinkIDBKeyRange {
   static final instance = new BlinkIDBKeyRange();
 
-  static bound_Callback_0() native "IDBKeyRange_bound_Callback";
-  bound_Callback_0_() => bound_Callback_0();
+  bound_Callback_0_() => Blink_JsNative_DomException.callMethod(Blink_JsNative_DomException.getProperty(js.context, "IDBKeyRange"), "bound", []);
 
-  static bound_Callback_1(__arg_0) native "IDBKeyRange_bound_Callback";
-  bound_Callback_1_(__arg_0) => bound_Callback_1(__arg_0);
+  bound_Callback_1_(__arg_0) => Blink_JsNative_DomException.callMethod(Blink_JsNative_DomException.getProperty(js.context, "IDBKeyRange"), "bound", [__arg_0]);
 
-  static bound_Callback_2(__arg_0, __arg_1) native "IDBKeyRange_bound_Callback";
-  bound_Callback_2_(__arg_0, __arg_1) => bound_Callback_2(__arg_0, __arg_1);
+  bound_Callback_2_(__arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(Blink_JsNative_DomException.getProperty(js.context, "IDBKeyRange"), "bound", [__arg_0, __arg_1]);
 
-  static bound_Callback_3(__arg_0, __arg_1, __arg_2) native "IDBKeyRange_bound_Callback";
-  bound_Callback_3_(__arg_0, __arg_1, __arg_2) => bound_Callback_3(__arg_0, __arg_1, __arg_2);
+  bound_Callback_3_(__arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(Blink_JsNative_DomException.getProperty(js.context, "IDBKeyRange"), "bound", [__arg_0, __arg_1, __arg_2]);
 
-  static bound_Callback_4(__arg_0, __arg_1, __arg_2, __arg_3) native "IDBKeyRange_bound_Callback";
-  bound_Callback_4_(__arg_0, __arg_1, __arg_2, __arg_3) => bound_Callback_4(__arg_0, __arg_1, __arg_2, __arg_3);
+  bound_Callback_4_(__arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(Blink_JsNative_DomException.getProperty(js.context, "IDBKeyRange"), "bound", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static bound_Callback_5(__arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "IDBKeyRange_bound_Callback";
-  bound_Callback_5_(__arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => bound_Callback_5(__arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  lowerBound_Callback_0_() => Blink_JsNative_DomException.callMethod(Blink_JsNative_DomException.getProperty(js.context, "IDBKeyRange"), "lowerBound", []);
 
-  static bound_Callback_6(__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "IDBKeyRange_bound_Callback";
-  bound_Callback_6_(__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => bound_Callback_6(__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  lowerBound_Callback_1_(__arg_0) => Blink_JsNative_DomException.callMethod(Blink_JsNative_DomException.getProperty(js.context, "IDBKeyRange"), "lowerBound", [__arg_0]);
 
-  static lowerBound_Callback_0() native "IDBKeyRange_lowerBound_Callback";
-  lowerBound_Callback_0_() => lowerBound_Callback_0();
+  lowerBound_Callback_2_(__arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(Blink_JsNative_DomException.getProperty(js.context, "IDBKeyRange"), "lowerBound", [__arg_0, __arg_1]);
 
-  static lowerBound_Callback_1(__arg_0) native "IDBKeyRange_lowerBound_Callback";
-  lowerBound_Callback_1_(__arg_0) => lowerBound_Callback_1(__arg_0);
+  lowerOpen_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "lowerOpen");
 
-  static lowerBound_Callback_2(__arg_0, __arg_1) native "IDBKeyRange_lowerBound_Callback";
-  lowerBound_Callback_2_(__arg_0, __arg_1) => lowerBound_Callback_2(__arg_0, __arg_1);
+  lower_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "lower");
 
-  static lowerBound_Callback_3(__arg_0, __arg_1, __arg_2) native "IDBKeyRange_lowerBound_Callback";
-  lowerBound_Callback_3_(__arg_0, __arg_1, __arg_2) => lowerBound_Callback_3(__arg_0, __arg_1, __arg_2);
+  only_Callback_0_() => Blink_JsNative_DomException.callMethod(Blink_JsNative_DomException.getProperty(js.context, "IDBKeyRange"), "only", []);
 
-  static lowerBound_Callback_4(__arg_0, __arg_1, __arg_2, __arg_3) native "IDBKeyRange_lowerBound_Callback";
-  lowerBound_Callback_4_(__arg_0, __arg_1, __arg_2, __arg_3) => lowerBound_Callback_4(__arg_0, __arg_1, __arg_2, __arg_3);
+  only_Callback_1_(__arg_0) => Blink_JsNative_DomException.callMethod(Blink_JsNative_DomException.getProperty(js.context, "IDBKeyRange"), "only", [__arg_0]);
 
-  static lowerOpen_Getter(mthis) native "IDBKeyRange_lowerOpen_Getter";
-  lowerOpen_Getter_(mthis) => lowerOpen_Getter(mthis);
+  upperBound_Callback_0_() => Blink_JsNative_DomException.callMethod(Blink_JsNative_DomException.getProperty(js.context, "IDBKeyRange"), "upperBound", []);
 
-  static lower_Getter(mthis) native "IDBKeyRange_lower_Getter";
-  lower_Getter_(mthis) => lower_Getter(mthis);
+  upperBound_Callback_1_(__arg_0) => Blink_JsNative_DomException.callMethod(Blink_JsNative_DomException.getProperty(js.context, "IDBKeyRange"), "upperBound", [__arg_0]);
 
-  static only_Callback_0() native "IDBKeyRange_only_Callback";
-  only_Callback_0_() => only_Callback_0();
+  upperBound_Callback_2_(__arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(Blink_JsNative_DomException.getProperty(js.context, "IDBKeyRange"), "upperBound", [__arg_0, __arg_1]);
 
-  static only_Callback_1(__arg_0) native "IDBKeyRange_only_Callback";
-  only_Callback_1_(__arg_0) => only_Callback_1(__arg_0);
+  upperOpen_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "upperOpen");
 
-  static only_Callback_2(__arg_0, __arg_1) native "IDBKeyRange_only_Callback";
-  only_Callback_2_(__arg_0, __arg_1) => only_Callback_2(__arg_0, __arg_1);
-
-  static only_Callback_3(__arg_0, __arg_1, __arg_2) native "IDBKeyRange_only_Callback";
-  only_Callback_3_(__arg_0, __arg_1, __arg_2) => only_Callback_3(__arg_0, __arg_1, __arg_2);
-
-  static upperBound_Callback_0() native "IDBKeyRange_upperBound_Callback";
-  upperBound_Callback_0_() => upperBound_Callback_0();
-
-  static upperBound_Callback_1(__arg_0) native "IDBKeyRange_upperBound_Callback";
-  upperBound_Callback_1_(__arg_0) => upperBound_Callback_1(__arg_0);
-
-  static upperBound_Callback_2(__arg_0, __arg_1) native "IDBKeyRange_upperBound_Callback";
-  upperBound_Callback_2_(__arg_0, __arg_1) => upperBound_Callback_2(__arg_0, __arg_1);
-
-  static upperBound_Callback_3(__arg_0, __arg_1, __arg_2) native "IDBKeyRange_upperBound_Callback";
-  upperBound_Callback_3_(__arg_0, __arg_1, __arg_2) => upperBound_Callback_3(__arg_0, __arg_1, __arg_2);
-
-  static upperBound_Callback_4(__arg_0, __arg_1, __arg_2, __arg_3) native "IDBKeyRange_upperBound_Callback";
-  upperBound_Callback_4_(__arg_0, __arg_1, __arg_2, __arg_3) => upperBound_Callback_4(__arg_0, __arg_1, __arg_2, __arg_3);
-
-  static upperOpen_Getter(mthis) native "IDBKeyRange_upperOpen_Getter";
-  upperOpen_Getter_(mthis) => upperOpen_Getter(mthis);
-
-  static upper_Getter(mthis) native "IDBKeyRange_upper_Getter";
-  upper_Getter_(mthis) => upper_Getter(mthis);
+  upper_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "upper");
 
 }
 
 class BlinkIDBObjectStore {
   static final instance = new BlinkIDBObjectStore();
 
-  static add_Callback_0(mthis) native "IDBObjectStore_add_Callback";
-  add_Callback_0_(mthis) => add_Callback_0(mthis);
+  add_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "add", []);
 
-  static add_Callback_1(mthis, __arg_0) native "IDBObjectStore_add_Callback";
-  add_Callback_1_(mthis, __arg_0) => add_Callback_1(mthis, __arg_0);
+  add_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "add", [__arg_0]);
 
-  static add_Callback_2(mthis, __arg_0, __arg_1) native "IDBObjectStore_add_Callback";
-  add_Callback_2_(mthis, __arg_0, __arg_1) => add_Callback_2(mthis, __arg_0, __arg_1);
+  add_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "add", [__arg_0, __arg_1]);
 
-  static add_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "IDBObjectStore_add_Callback";
-  add_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => add_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  autoIncrement_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "autoIncrement");
 
-  static add_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "IDBObjectStore_add_Callback";
-  add_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => add_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  clear_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "clear", []);
 
-  static autoIncrement_Getter(mthis) native "IDBObjectStore_autoIncrement_Getter";
-  autoIncrement_Getter_(mthis) => autoIncrement_Getter(mthis);
+  count_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "count", []);
 
-  static clear_Callback_0(mthis) native "IDBObjectStore_clear_Callback";
-  clear_Callback_0_(mthis) => clear_Callback_0(mthis);
+  count_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "count", [__arg_0]);
 
-  static clear_Callback_1(mthis, __arg_0) native "IDBObjectStore_clear_Callback";
-  clear_Callback_1_(mthis, __arg_0) => clear_Callback_1(mthis, __arg_0);
+  createIndex_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createIndex", []);
 
-  static clear_Callback_2(mthis, __arg_0, __arg_1) native "IDBObjectStore_clear_Callback";
-  clear_Callback_2_(mthis, __arg_0, __arg_1) => clear_Callback_2(mthis, __arg_0, __arg_1);
+  createIndex_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "createIndex", [__arg_0]);
 
-  static count_Callback_0(mthis) native "IDBObjectStore_count_Callback";
-  count_Callback_0_(mthis) => count_Callback_0(mthis);
+  createIndex_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "createIndex", [__arg_0, __arg_1]);
 
-  static count_Callback_1(mthis, __arg_0) native "IDBObjectStore_count_Callback";
-  count_Callback_1_(mthis, __arg_0) => count_Callback_1(mthis, __arg_0);
+  createIndex_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "createIndex", [__arg_0, __arg_1, __arg_2]);
 
-  static count_Callback_2(mthis, __arg_0, __arg_1) native "IDBObjectStore_count_Callback";
-  count_Callback_2_(mthis, __arg_0, __arg_1) => count_Callback_2(mthis, __arg_0, __arg_1);
+  deleteIndex_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "deleteIndex", []);
 
-  static count_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "IDBObjectStore_count_Callback";
-  count_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => count_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  deleteIndex_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "deleteIndex", [__arg_0]);
 
-  static createIndex_Callback_0(mthis) native "IDBObjectStore_createIndex_Callback";
-  createIndex_Callback_0_(mthis) => createIndex_Callback_0(mthis);
+  delete_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "delete", []);
 
-  static createIndex_Callback_1(mthis, __arg_0) native "IDBObjectStore_createIndex_Callback";
-  createIndex_Callback_1_(mthis, __arg_0) => createIndex_Callback_1(mthis, __arg_0);
+  delete_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "delete", [__arg_0]);
 
-  static createIndex_Callback_2(mthis, __arg_0, __arg_1) native "IDBObjectStore_createIndex_Callback";
-  createIndex_Callback_2_(mthis, __arg_0, __arg_1) => createIndex_Callback_2(mthis, __arg_0, __arg_1);
+  get_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "get", []);
 
-  static createIndex_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "IDBObjectStore_createIndex_Callback";
-  createIndex_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => createIndex_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  get_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "get", [__arg_0]);
 
-  static createIndex_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "IDBObjectStore_createIndex_Callback";
-  createIndex_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => createIndex_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  indexNames_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "indexNames");
 
-  static createIndex_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "IDBObjectStore_createIndex_Callback";
-  createIndex_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => createIndex_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  index_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "index", []);
 
-  static deleteIndex_Callback_0(mthis) native "IDBObjectStore_deleteIndex_Callback";
-  deleteIndex_Callback_0_(mthis) => deleteIndex_Callback_0(mthis);
+  index_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "index", [__arg_0]);
 
-  static deleteIndex_Callback_1(mthis, __arg_0) native "IDBObjectStore_deleteIndex_Callback";
-  deleteIndex_Callback_1_(mthis, __arg_0) => deleteIndex_Callback_1(mthis, __arg_0);
+  keyPath_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "keyPath");
 
-  static deleteIndex_Callback_2(mthis, __arg_0, __arg_1) native "IDBObjectStore_deleteIndex_Callback";
-  deleteIndex_Callback_2_(mthis, __arg_0, __arg_1) => deleteIndex_Callback_2(mthis, __arg_0, __arg_1);
+  name_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "name");
 
-  static deleteIndex_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "IDBObjectStore_deleteIndex_Callback";
-  deleteIndex_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => deleteIndex_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  openCursor_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "openCursor", []);
 
-  static delete_Callback_0(mthis) native "IDBObjectStore_delete_Callback";
-  delete_Callback_0_(mthis) => delete_Callback_0(mthis);
+  openCursor_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "openCursor", [__arg_0]);
 
-  static delete_Callback_1(mthis, __arg_0) native "IDBObjectStore_delete_Callback";
-  delete_Callback_1_(mthis, __arg_0) => delete_Callback_1(mthis, __arg_0);
+  openCursor_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "openCursor", [__arg_0, __arg_1]);
 
-  static delete_Callback_2(mthis, __arg_0, __arg_1) native "IDBObjectStore_delete_Callback";
-  delete_Callback_2_(mthis, __arg_0, __arg_1) => delete_Callback_2(mthis, __arg_0, __arg_1);
+  openKeyCursor_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "openKeyCursor", []);
 
-  static delete_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "IDBObjectStore_delete_Callback";
-  delete_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => delete_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  openKeyCursor_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "openKeyCursor", [__arg_0]);
 
-  static get_Callback_0(mthis) native "IDBObjectStore_get_Callback";
-  get_Callback_0_(mthis) => get_Callback_0(mthis);
+  openKeyCursor_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "openKeyCursor", [__arg_0, __arg_1]);
 
-  static get_Callback_1(mthis, __arg_0) native "IDBObjectStore_get_Callback";
-  get_Callback_1_(mthis, __arg_0) => get_Callback_1(mthis, __arg_0);
+  put_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "put", []);
 
-  static get_Callback_2(mthis, __arg_0, __arg_1) native "IDBObjectStore_get_Callback";
-  get_Callback_2_(mthis, __arg_0, __arg_1) => get_Callback_2(mthis, __arg_0, __arg_1);
+  put_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "put", [__arg_0]);
 
-  static get_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "IDBObjectStore_get_Callback";
-  get_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => get_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  put_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "put", [__arg_0, __arg_1]);
 
-  static indexNames_Getter(mthis) native "IDBObjectStore_indexNames_Getter";
-  indexNames_Getter_(mthis) => indexNames_Getter(mthis);
-
-  static index_Callback_0(mthis) native "IDBObjectStore_index_Callback";
-  index_Callback_0_(mthis) => index_Callback_0(mthis);
-
-  static index_Callback_1(mthis, __arg_0) native "IDBObjectStore_index_Callback";
-  index_Callback_1_(mthis, __arg_0) => index_Callback_1(mthis, __arg_0);
-
-  static index_Callback_2(mthis, __arg_0, __arg_1) native "IDBObjectStore_index_Callback";
-  index_Callback_2_(mthis, __arg_0, __arg_1) => index_Callback_2(mthis, __arg_0, __arg_1);
-
-  static index_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "IDBObjectStore_index_Callback";
-  index_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => index_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static keyPath_Getter(mthis) native "IDBObjectStore_keyPath_Getter";
-  keyPath_Getter_(mthis) => keyPath_Getter(mthis);
-
-  static name_Getter(mthis) native "IDBObjectStore_name_Getter";
-  name_Getter_(mthis) => name_Getter(mthis);
-
-  static openCursor_Callback_0(mthis) native "IDBObjectStore_openCursor_Callback";
-  openCursor_Callback_0_(mthis) => openCursor_Callback_0(mthis);
-
-  static openCursor_Callback_1(mthis, __arg_0) native "IDBObjectStore_openCursor_Callback";
-  openCursor_Callback_1_(mthis, __arg_0) => openCursor_Callback_1(mthis, __arg_0);
-
-  static openCursor_Callback_2(mthis, __arg_0, __arg_1) native "IDBObjectStore_openCursor_Callback";
-  openCursor_Callback_2_(mthis, __arg_0, __arg_1) => openCursor_Callback_2(mthis, __arg_0, __arg_1);
-
-  static openCursor_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "IDBObjectStore_openCursor_Callback";
-  openCursor_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => openCursor_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static openCursor_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "IDBObjectStore_openCursor_Callback";
-  openCursor_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => openCursor_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static openKeyCursor_Callback_0(mthis) native "IDBObjectStore_openKeyCursor_Callback";
-  openKeyCursor_Callback_0_(mthis) => openKeyCursor_Callback_0(mthis);
-
-  static openKeyCursor_Callback_1(mthis, __arg_0) native "IDBObjectStore_openKeyCursor_Callback";
-  openKeyCursor_Callback_1_(mthis, __arg_0) => openKeyCursor_Callback_1(mthis, __arg_0);
-
-  static openKeyCursor_Callback_2(mthis, __arg_0, __arg_1) native "IDBObjectStore_openKeyCursor_Callback";
-  openKeyCursor_Callback_2_(mthis, __arg_0, __arg_1) => openKeyCursor_Callback_2(mthis, __arg_0, __arg_1);
-
-  static openKeyCursor_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "IDBObjectStore_openKeyCursor_Callback";
-  openKeyCursor_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => openKeyCursor_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static openKeyCursor_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "IDBObjectStore_openKeyCursor_Callback";
-  openKeyCursor_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => openKeyCursor_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static put_Callback_0(mthis) native "IDBObjectStore_put_Callback";
-  put_Callback_0_(mthis) => put_Callback_0(mthis);
-
-  static put_Callback_1(mthis, __arg_0) native "IDBObjectStore_put_Callback";
-  put_Callback_1_(mthis, __arg_0) => put_Callback_1(mthis, __arg_0);
-
-  static put_Callback_2(mthis, __arg_0, __arg_1) native "IDBObjectStore_put_Callback";
-  put_Callback_2_(mthis, __arg_0, __arg_1) => put_Callback_2(mthis, __arg_0, __arg_1);
-
-  static put_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "IDBObjectStore_put_Callback";
-  put_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => put_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static put_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "IDBObjectStore_put_Callback";
-  put_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => put_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static transaction_Getter(mthis) native "IDBObjectStore_transaction_Getter";
-  transaction_Getter_(mthis) => transaction_Getter(mthis);
+  transaction_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "transaction");
 
 }
 
 class BlinkIDBOpenDBRequest extends BlinkIDBRequest {
   static final instance = new BlinkIDBOpenDBRequest();
 
-  static onblocked_Getter(mthis) native "IDBOpenDBRequest_onblocked_Getter";
-  onblocked_Getter_(mthis) => onblocked_Getter(mthis);
+  onblocked_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onblocked");
 
-  static onblocked_Setter(mthis, __arg_0) native "IDBOpenDBRequest_onblocked_Setter";
-  onblocked_Setter_(mthis, __arg_0) => onblocked_Setter(mthis, __arg_0);
+  onblocked_Setter_(mthis, __arg_0) => mthis["onblocked"] = __arg_0;
 
-  static onupgradeneeded_Getter(mthis) native "IDBOpenDBRequest_onupgradeneeded_Getter";
-  onupgradeneeded_Getter_(mthis) => onupgradeneeded_Getter(mthis);
+  onupgradeneeded_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onupgradeneeded");
 
-  static onupgradeneeded_Setter(mthis, __arg_0) native "IDBOpenDBRequest_onupgradeneeded_Setter";
-  onupgradeneeded_Setter_(mthis, __arg_0) => onupgradeneeded_Setter(mthis, __arg_0);
+  onupgradeneeded_Setter_(mthis, __arg_0) => mthis["onupgradeneeded"] = __arg_0;
 
 }
 
 class BlinkIDBRequest extends BlinkEventTarget {
   static final instance = new BlinkIDBRequest();
 
-  static error_Getter(mthis) native "IDBRequest_error_Getter";
-  error_Getter_(mthis) => error_Getter(mthis);
+  error_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "error");
 
-  static onerror_Getter(mthis) native "IDBRequest_onerror_Getter";
-  onerror_Getter_(mthis) => onerror_Getter(mthis);
+  onerror_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onerror");
 
-  static onerror_Setter(mthis, __arg_0) native "IDBRequest_onerror_Setter";
-  onerror_Setter_(mthis, __arg_0) => onerror_Setter(mthis, __arg_0);
+  onerror_Setter_(mthis, __arg_0) => mthis["onerror"] = __arg_0;
 
-  static onsuccess_Getter(mthis) native "IDBRequest_onsuccess_Getter";
-  onsuccess_Getter_(mthis) => onsuccess_Getter(mthis);
+  onsuccess_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onsuccess");
 
-  static onsuccess_Setter(mthis, __arg_0) native "IDBRequest_onsuccess_Setter";
-  onsuccess_Setter_(mthis, __arg_0) => onsuccess_Setter(mthis, __arg_0);
+  onsuccess_Setter_(mthis, __arg_0) => mthis["onsuccess"] = __arg_0;
 
-  static readyState_Getter(mthis) native "IDBRequest_readyState_Getter";
-  readyState_Getter_(mthis) => readyState_Getter(mthis);
+  readyState_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "readyState");
 
-  static result_Getter(mthis) native "IDBRequest_result_Getter";
-  result_Getter_(mthis) => result_Getter(mthis);
+  result_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "result");
 
-  static source_Getter(mthis) native "IDBRequest_source_Getter";
-  source_Getter_(mthis) => source_Getter(mthis);
+  source_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "source");
 
-  static transaction_Getter(mthis) native "IDBRequest_transaction_Getter";
-  transaction_Getter_(mthis) => transaction_Getter(mthis);
+  transaction_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "transaction");
 
 }
 
 class BlinkIDBTransaction extends BlinkEventTarget {
   static final instance = new BlinkIDBTransaction();
 
-  static abort_Callback_0(mthis) native "IDBTransaction_abort_Callback";
-  abort_Callback_0_(mthis) => abort_Callback_0(mthis);
+  abort_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "abort", []);
 
-  static abort_Callback_1(mthis, __arg_0) native "IDBTransaction_abort_Callback";
-  abort_Callback_1_(mthis, __arg_0) => abort_Callback_1(mthis, __arg_0);
+  db_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "db");
 
-  static abort_Callback_2(mthis, __arg_0, __arg_1) native "IDBTransaction_abort_Callback";
-  abort_Callback_2_(mthis, __arg_0, __arg_1) => abort_Callback_2(mthis, __arg_0, __arg_1);
+  error_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "error");
 
-  static db_Getter(mthis) native "IDBTransaction_db_Getter";
-  db_Getter_(mthis) => db_Getter(mthis);
+  mode_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "mode");
 
-  static error_Getter(mthis) native "IDBTransaction_error_Getter";
-  error_Getter_(mthis) => error_Getter(mthis);
+  objectStore_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "objectStore", []);
 
-  static mode_Getter(mthis) native "IDBTransaction_mode_Getter";
-  mode_Getter_(mthis) => mode_Getter(mthis);
+  objectStore_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "objectStore", [__arg_0]);
 
-  static objectStore_Callback_0(mthis) native "IDBTransaction_objectStore_Callback";
-  objectStore_Callback_0_(mthis) => objectStore_Callback_0(mthis);
+  onabort_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onabort");
 
-  static objectStore_Callback_1(mthis, __arg_0) native "IDBTransaction_objectStore_Callback";
-  objectStore_Callback_1_(mthis, __arg_0) => objectStore_Callback_1(mthis, __arg_0);
+  onabort_Setter_(mthis, __arg_0) => mthis["onabort"] = __arg_0;
 
-  static objectStore_Callback_2(mthis, __arg_0, __arg_1) native "IDBTransaction_objectStore_Callback";
-  objectStore_Callback_2_(mthis, __arg_0, __arg_1) => objectStore_Callback_2(mthis, __arg_0, __arg_1);
+  oncomplete_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "oncomplete");
 
-  static objectStore_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "IDBTransaction_objectStore_Callback";
-  objectStore_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => objectStore_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  oncomplete_Setter_(mthis, __arg_0) => mthis["oncomplete"] = __arg_0;
 
-  static onabort_Getter(mthis) native "IDBTransaction_onabort_Getter";
-  onabort_Getter_(mthis) => onabort_Getter(mthis);
+  onerror_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onerror");
 
-  static onabort_Setter(mthis, __arg_0) native "IDBTransaction_onabort_Setter";
-  onabort_Setter_(mthis, __arg_0) => onabort_Setter(mthis, __arg_0);
-
-  static oncomplete_Getter(mthis) native "IDBTransaction_oncomplete_Getter";
-  oncomplete_Getter_(mthis) => oncomplete_Getter(mthis);
-
-  static oncomplete_Setter(mthis, __arg_0) native "IDBTransaction_oncomplete_Setter";
-  oncomplete_Setter_(mthis, __arg_0) => oncomplete_Setter(mthis, __arg_0);
-
-  static onerror_Getter(mthis) native "IDBTransaction_onerror_Getter";
-  onerror_Getter_(mthis) => onerror_Getter(mthis);
-
-  static onerror_Setter(mthis, __arg_0) native "IDBTransaction_onerror_Setter";
-  onerror_Setter_(mthis, __arg_0) => onerror_Setter(mthis, __arg_0);
+  onerror_Setter_(mthis, __arg_0) => mthis["onerror"] = __arg_0;
 
 }
 
 class BlinkIDBVersionChangeEvent extends BlinkEvent {
   static final instance = new BlinkIDBVersionChangeEvent();
 
-  static constructorCallback_2(__arg_0, __arg_1) native "IDBVersionChangeEvent_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  constructorCallback_2_(__arg_0, __arg_1) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "IDBVersionChangeEvent"), [__arg_0, __arg_1]);
 
-  static dataLossMessage_Getter(mthis) native "IDBVersionChangeEvent_dataLossMessage_Getter";
-  dataLossMessage_Getter_(mthis) => dataLossMessage_Getter(mthis);
+  dataLossMessage_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "dataLossMessage");
 
-  static dataLoss_Getter(mthis) native "IDBVersionChangeEvent_dataLoss_Getter";
-  dataLoss_Getter_(mthis) => dataLoss_Getter(mthis);
+  dataLoss_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "dataLoss");
 
-  static newVersion_Getter(mthis) native "IDBVersionChangeEvent_newVersion_Getter";
-  newVersion_Getter_(mthis) => newVersion_Getter(mthis);
+  newVersion_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "newVersion");
 
-  static oldVersion_Getter(mthis) native "IDBVersionChangeEvent_oldVersion_Getter";
-  oldVersion_Getter_(mthis) => oldVersion_Getter(mthis);
+  oldVersion_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "oldVersion");
 
 }
 
 class BlinkImageBitmap {
   static final instance = new BlinkImageBitmap();
 
-  static height_Getter(mthis) native "ImageBitmap_height_Getter";
-  height_Getter_(mthis) => height_Getter(mthis);
+  height_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "height");
 
-  static width_Getter(mthis) native "ImageBitmap_width_Getter";
-  width_Getter_(mthis) => width_Getter(mthis);
+  width_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "width");
 
 }
 
 class BlinkImageData {
   static final instance = new BlinkImageData();
 
-  static constructorCallback_0() native "ImageData_constructorCallback";
-  constructorCallback_0_() => constructorCallback_0();
+  constructorCallback_0_() => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "ImageData"), []);
 
-  static constructorCallback_1(__arg_0) native "ImageData_constructorCallback";
-  constructorCallback_1_(__arg_0) => constructorCallback_1(__arg_0);
+  constructorCallback_1_(__arg_0) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "ImageData"), [__arg_0]);
 
-  static constructorCallback_2(__arg_0, __arg_1) native "ImageData_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  constructorCallback_2_(__arg_0, __arg_1) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "ImageData"), [__arg_0, __arg_1]);
 
-  static constructorCallback_3(__arg_0, __arg_1, __arg_2) native "ImageData_constructorCallback";
-  constructorCallback_3_(__arg_0, __arg_1, __arg_2) => constructorCallback_3(__arg_0, __arg_1, __arg_2);
+  constructorCallback_3_(__arg_0, __arg_1, __arg_2) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "ImageData"), [__arg_0, __arg_1, __arg_2]);
 
-  static constructorCallback_4(__arg_0, __arg_1, __arg_2, __arg_3) native "ImageData_constructorCallback";
-  constructorCallback_4_(__arg_0, __arg_1, __arg_2, __arg_3) => constructorCallback_4(__arg_0, __arg_1, __arg_2, __arg_3);
+  data_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "data");
 
-  static constructorCallback_5(__arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "ImageData_constructorCallback";
-  constructorCallback_5_(__arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => constructorCallback_5(__arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  height_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "height");
 
-  static data_Getter(mthis) native "ImageData_data_Getter";
-  data_Getter_(mthis) => data_Getter(mthis);
-
-  static height_Getter(mthis) native "ImageData_height_Getter";
-  height_Getter_(mthis) => height_Getter(mthis);
-
-  static width_Getter(mthis) native "ImageData_width_Getter";
-  width_Getter_(mthis) => width_Getter(mthis);
+  width_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "width");
 
 }
 
 class BlinkInjectedScriptHost {
   static final instance = new BlinkInjectedScriptHost();
 
-  static callFunction_Callback_0(mthis) native "InjectedScriptHost_callFunction_Callback";
-  callFunction_Callback_0_(mthis) => callFunction_Callback_0(mthis);
+  callFunction_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "callFunction", []);
 
-  static callFunction_Callback_1(mthis, __arg_0) native "InjectedScriptHost_callFunction_Callback";
-  callFunction_Callback_1_(mthis, __arg_0) => callFunction_Callback_1(mthis, __arg_0);
+  callFunction_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "callFunction", [__arg_0]);
 
-  static callFunction_Callback_2(mthis, __arg_0, __arg_1) native "InjectedScriptHost_callFunction_Callback";
-  callFunction_Callback_2_(mthis, __arg_0, __arg_1) => callFunction_Callback_2(mthis, __arg_0, __arg_1);
+  callFunction_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "callFunction", [__arg_0, __arg_1]);
 
-  static callFunction_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "InjectedScriptHost_callFunction_Callback";
-  callFunction_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => callFunction_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  callFunction_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "callFunction", [__arg_0, __arg_1, __arg_2]);
 
-  static callFunction_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "InjectedScriptHost_callFunction_Callback";
-  callFunction_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => callFunction_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  clearConsoleMessages_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "clearConsoleMessages", []);
 
-  static callFunction_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "InjectedScriptHost_callFunction_Callback";
-  callFunction_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => callFunction_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  collectionEntries_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "collectionEntries", []);
 
-  static clearConsoleMessages_Callback_0(mthis) native "InjectedScriptHost_clearConsoleMessages_Callback";
-  clearConsoleMessages_Callback_0_(mthis) => clearConsoleMessages_Callback_0(mthis);
+  collectionEntries_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "collectionEntries", [__arg_0]);
 
-  static clearConsoleMessages_Callback_1(mthis, __arg_0) native "InjectedScriptHost_clearConsoleMessages_Callback";
-  clearConsoleMessages_Callback_1_(mthis, __arg_0) => clearConsoleMessages_Callback_1(mthis, __arg_0);
+  debugFunction_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "debugFunction", []);
 
-  static clearConsoleMessages_Callback_2(mthis, __arg_0, __arg_1) native "InjectedScriptHost_clearConsoleMessages_Callback";
-  clearConsoleMessages_Callback_2_(mthis, __arg_0, __arg_1) => clearConsoleMessages_Callback_2(mthis, __arg_0, __arg_1);
+  debugFunction_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "debugFunction", [__arg_0]);
 
-  static collectionEntries_Callback_0(mthis) native "InjectedScriptHost_collectionEntries_Callback";
-  collectionEntries_Callback_0_(mthis) => collectionEntries_Callback_0(mthis);
+  eval_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "eval", []);
 
-  static collectionEntries_Callback_1(mthis, __arg_0) native "InjectedScriptHost_collectionEntries_Callback";
-  collectionEntries_Callback_1_(mthis, __arg_0) => collectionEntries_Callback_1(mthis, __arg_0);
+  eval_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "eval", [__arg_0]);
 
-  static collectionEntries_Callback_2(mthis, __arg_0, __arg_1) native "InjectedScriptHost_collectionEntries_Callback";
-  collectionEntries_Callback_2_(mthis, __arg_0, __arg_1) => collectionEntries_Callback_2(mthis, __arg_0, __arg_1);
+  evaluateWithExceptionDetails_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "evaluateWithExceptionDetails", []);
 
-  static collectionEntries_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "InjectedScriptHost_collectionEntries_Callback";
-  collectionEntries_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => collectionEntries_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  evaluateWithExceptionDetails_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "evaluateWithExceptionDetails", [__arg_0]);
 
-  static debugFunction_Callback_0(mthis) native "InjectedScriptHost_debugFunction_Callback";
-  debugFunction_Callback_0_(mthis) => debugFunction_Callback_0(mthis);
+  functionDetails_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "functionDetails", []);
 
-  static debugFunction_Callback_1(mthis, __arg_0) native "InjectedScriptHost_debugFunction_Callback";
-  debugFunction_Callback_1_(mthis, __arg_0) => debugFunction_Callback_1(mthis, __arg_0);
+  functionDetails_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "functionDetails", [__arg_0]);
 
-  static debugFunction_Callback_2(mthis, __arg_0, __arg_1) native "InjectedScriptHost_debugFunction_Callback";
-  debugFunction_Callback_2_(mthis, __arg_0, __arg_1) => debugFunction_Callback_2(mthis, __arg_0, __arg_1);
+  getEventListeners_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getEventListeners", []);
 
-  static debugFunction_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "InjectedScriptHost_debugFunction_Callback";
-  debugFunction_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => debugFunction_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  getEventListeners_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getEventListeners", [__arg_0]);
 
-  static eval_Callback_0(mthis) native "InjectedScriptHost_eval_Callback";
-  eval_Callback_0_(mthis) => eval_Callback_0(mthis);
+  getInternalProperties_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getInternalProperties", []);
 
-  static eval_Callback_1(mthis, __arg_0) native "InjectedScriptHost_eval_Callback";
-  eval_Callback_1_(mthis, __arg_0) => eval_Callback_1(mthis, __arg_0);
+  getInternalProperties_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getInternalProperties", [__arg_0]);
 
-  static eval_Callback_2(mthis, __arg_0, __arg_1) native "InjectedScriptHost_eval_Callback";
-  eval_Callback_2_(mthis, __arg_0, __arg_1) => eval_Callback_2(mthis, __arg_0, __arg_1);
+  inspect_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "inspect", []);
 
-  static eval_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "InjectedScriptHost_eval_Callback";
-  eval_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => eval_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  inspect_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "inspect", [__arg_0]);
 
-  static evaluateWithExceptionDetails_Callback_0(mthis) native "InjectedScriptHost_evaluateWithExceptionDetails_Callback";
-  evaluateWithExceptionDetails_Callback_0_(mthis) => evaluateWithExceptionDetails_Callback_0(mthis);
+  inspect_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "inspect", [__arg_0, __arg_1]);
 
-  static evaluateWithExceptionDetails_Callback_1(mthis, __arg_0) native "InjectedScriptHost_evaluateWithExceptionDetails_Callback";
-  evaluateWithExceptionDetails_Callback_1_(mthis, __arg_0) => evaluateWithExceptionDetails_Callback_1(mthis, __arg_0);
+  inspectedObject_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "inspectedObject", []);
 
-  static evaluateWithExceptionDetails_Callback_2(mthis, __arg_0, __arg_1) native "InjectedScriptHost_evaluateWithExceptionDetails_Callback";
-  evaluateWithExceptionDetails_Callback_2_(mthis, __arg_0, __arg_1) => evaluateWithExceptionDetails_Callback_2(mthis, __arg_0, __arg_1);
+  inspectedObject_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "inspectedObject", [__arg_0]);
 
-  static evaluateWithExceptionDetails_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "InjectedScriptHost_evaluateWithExceptionDetails_Callback";
-  evaluateWithExceptionDetails_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => evaluateWithExceptionDetails_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  internalConstructorName_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "internalConstructorName", []);
 
-  static functionDetails_Callback_0(mthis) native "InjectedScriptHost_functionDetails_Callback";
-  functionDetails_Callback_0_(mthis) => functionDetails_Callback_0(mthis);
+  internalConstructorName_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "internalConstructorName", [__arg_0]);
 
-  static functionDetails_Callback_1(mthis, __arg_0) native "InjectedScriptHost_functionDetails_Callback";
-  functionDetails_Callback_1_(mthis, __arg_0) => functionDetails_Callback_1(mthis, __arg_0);
+  isHTMLAllCollection_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "isHTMLAllCollection", []);
 
-  static functionDetails_Callback_2(mthis, __arg_0, __arg_1) native "InjectedScriptHost_functionDetails_Callback";
-  functionDetails_Callback_2_(mthis, __arg_0, __arg_1) => functionDetails_Callback_2(mthis, __arg_0, __arg_1);
+  isHTMLAllCollection_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "isHTMLAllCollection", [__arg_0]);
 
-  static functionDetails_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "InjectedScriptHost_functionDetails_Callback";
-  functionDetails_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => functionDetails_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  monitorFunction_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "monitorFunction", []);
 
-  static getEventListeners_Callback_0(mthis) native "InjectedScriptHost_getEventListeners_Callback";
-  getEventListeners_Callback_0_(mthis) => getEventListeners_Callback_0(mthis);
+  monitorFunction_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "monitorFunction", [__arg_0]);
 
-  static getEventListeners_Callback_1(mthis, __arg_0) native "InjectedScriptHost_getEventListeners_Callback";
-  getEventListeners_Callback_1_(mthis, __arg_0) => getEventListeners_Callback_1(mthis, __arg_0);
+  setFunctionVariableValue_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "setFunctionVariableValue", [__arg_0, __arg_1]);
 
-  static getEventListeners_Callback_2(mthis, __arg_0, __arg_1) native "InjectedScriptHost_getEventListeners_Callback";
-  getEventListeners_Callback_2_(mthis, __arg_0, __arg_1) => getEventListeners_Callback_2(mthis, __arg_0, __arg_1);
+  setFunctionVariableValue_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "setFunctionVariableValue", [__arg_0, __arg_1, __arg_2]);
 
-  static getEventListeners_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "InjectedScriptHost_getEventListeners_Callback";
-  getEventListeners_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getEventListeners_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  setFunctionVariableValue_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "setFunctionVariableValue", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static getInternalProperties_Callback_0(mthis) native "InjectedScriptHost_getInternalProperties_Callback";
-  getInternalProperties_Callback_0_(mthis) => getInternalProperties_Callback_0(mthis);
+  setNonEnumProperty_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "setNonEnumProperty", [__arg_0]);
 
-  static getInternalProperties_Callback_1(mthis, __arg_0) native "InjectedScriptHost_getInternalProperties_Callback";
-  getInternalProperties_Callback_1_(mthis, __arg_0) => getInternalProperties_Callback_1(mthis, __arg_0);
+  setNonEnumProperty_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "setNonEnumProperty", [__arg_0, __arg_1]);
 
-  static getInternalProperties_Callback_2(mthis, __arg_0, __arg_1) native "InjectedScriptHost_getInternalProperties_Callback";
-  getInternalProperties_Callback_2_(mthis, __arg_0, __arg_1) => getInternalProperties_Callback_2(mthis, __arg_0, __arg_1);
+  setNonEnumProperty_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "setNonEnumProperty", [__arg_0, __arg_1, __arg_2]);
 
-  static getInternalProperties_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "InjectedScriptHost_getInternalProperties_Callback";
-  getInternalProperties_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getInternalProperties_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  subtype_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "subtype", []);
 
-  static inspect_Callback_0(mthis) native "InjectedScriptHost_inspect_Callback";
-  inspect_Callback_0_(mthis) => inspect_Callback_0(mthis);
+  subtype_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "subtype", [__arg_0]);
 
-  static inspect_Callback_1(mthis, __arg_0) native "InjectedScriptHost_inspect_Callback";
-  inspect_Callback_1_(mthis, __arg_0) => inspect_Callback_1(mthis, __arg_0);
+  suppressWarningsAndCallFunction_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "suppressWarningsAndCallFunction", []);
 
-  static inspect_Callback_2(mthis, __arg_0, __arg_1) native "InjectedScriptHost_inspect_Callback";
-  inspect_Callback_2_(mthis, __arg_0, __arg_1) => inspect_Callback_2(mthis, __arg_0, __arg_1);
+  suppressWarningsAndCallFunction_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "suppressWarningsAndCallFunction", [__arg_0]);
 
-  static inspect_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "InjectedScriptHost_inspect_Callback";
-  inspect_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => inspect_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  suppressWarningsAndCallFunction_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "suppressWarningsAndCallFunction", [__arg_0, __arg_1]);
 
-  static inspect_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "InjectedScriptHost_inspect_Callback";
-  inspect_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => inspect_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  suppressWarningsAndCallFunction_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "suppressWarningsAndCallFunction", [__arg_0, __arg_1, __arg_2]);
 
-  static inspectedObject_Callback_0(mthis) native "InjectedScriptHost_inspectedObject_Callback";
-  inspectedObject_Callback_0_(mthis) => inspectedObject_Callback_0(mthis);
-
-  static inspectedObject_Callback_1(mthis, __arg_0) native "InjectedScriptHost_inspectedObject_Callback";
-  inspectedObject_Callback_1_(mthis, __arg_0) => inspectedObject_Callback_1(mthis, __arg_0);
-
-  static inspectedObject_Callback_2(mthis, __arg_0, __arg_1) native "InjectedScriptHost_inspectedObject_Callback";
-  inspectedObject_Callback_2_(mthis, __arg_0, __arg_1) => inspectedObject_Callback_2(mthis, __arg_0, __arg_1);
-
-  static inspectedObject_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "InjectedScriptHost_inspectedObject_Callback";
-  inspectedObject_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => inspectedObject_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static internalConstructorName_Callback_0(mthis) native "InjectedScriptHost_internalConstructorName_Callback";
-  internalConstructorName_Callback_0_(mthis) => internalConstructorName_Callback_0(mthis);
-
-  static internalConstructorName_Callback_1(mthis, __arg_0) native "InjectedScriptHost_internalConstructorName_Callback";
-  internalConstructorName_Callback_1_(mthis, __arg_0) => internalConstructorName_Callback_1(mthis, __arg_0);
-
-  static internalConstructorName_Callback_2(mthis, __arg_0, __arg_1) native "InjectedScriptHost_internalConstructorName_Callback";
-  internalConstructorName_Callback_2_(mthis, __arg_0, __arg_1) => internalConstructorName_Callback_2(mthis, __arg_0, __arg_1);
-
-  static internalConstructorName_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "InjectedScriptHost_internalConstructorName_Callback";
-  internalConstructorName_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => internalConstructorName_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static isHTMLAllCollection_Callback_0(mthis) native "InjectedScriptHost_isHTMLAllCollection_Callback";
-  isHTMLAllCollection_Callback_0_(mthis) => isHTMLAllCollection_Callback_0(mthis);
-
-  static isHTMLAllCollection_Callback_1(mthis, __arg_0) native "InjectedScriptHost_isHTMLAllCollection_Callback";
-  isHTMLAllCollection_Callback_1_(mthis, __arg_0) => isHTMLAllCollection_Callback_1(mthis, __arg_0);
-
-  static isHTMLAllCollection_Callback_2(mthis, __arg_0, __arg_1) native "InjectedScriptHost_isHTMLAllCollection_Callback";
-  isHTMLAllCollection_Callback_2_(mthis, __arg_0, __arg_1) => isHTMLAllCollection_Callback_2(mthis, __arg_0, __arg_1);
-
-  static isHTMLAllCollection_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "InjectedScriptHost_isHTMLAllCollection_Callback";
-  isHTMLAllCollection_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => isHTMLAllCollection_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static monitorFunction_Callback_0(mthis) native "InjectedScriptHost_monitorFunction_Callback";
-  monitorFunction_Callback_0_(mthis) => monitorFunction_Callback_0(mthis);
-
-  static monitorFunction_Callback_1(mthis, __arg_0) native "InjectedScriptHost_monitorFunction_Callback";
-  monitorFunction_Callback_1_(mthis, __arg_0) => monitorFunction_Callback_1(mthis, __arg_0);
-
-  static monitorFunction_Callback_2(mthis, __arg_0, __arg_1) native "InjectedScriptHost_monitorFunction_Callback";
-  monitorFunction_Callback_2_(mthis, __arg_0, __arg_1) => monitorFunction_Callback_2(mthis, __arg_0, __arg_1);
-
-  static monitorFunction_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "InjectedScriptHost_monitorFunction_Callback";
-  monitorFunction_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => monitorFunction_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static setFunctionVariableValue_Callback_2(mthis, __arg_0, __arg_1) native "InjectedScriptHost_setFunctionVariableValue_Callback";
-  setFunctionVariableValue_Callback_2_(mthis, __arg_0, __arg_1) => setFunctionVariableValue_Callback_2(mthis, __arg_0, __arg_1);
-
-  static setFunctionVariableValue_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "InjectedScriptHost_setFunctionVariableValue_Callback";
-  setFunctionVariableValue_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => setFunctionVariableValue_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static setFunctionVariableValue_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "InjectedScriptHost_setFunctionVariableValue_Callback";
-  setFunctionVariableValue_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => setFunctionVariableValue_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static setFunctionVariableValue_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "InjectedScriptHost_setFunctionVariableValue_Callback";
-  setFunctionVariableValue_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => setFunctionVariableValue_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
-
-  static setFunctionVariableValue_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "InjectedScriptHost_setFunctionVariableValue_Callback";
-  setFunctionVariableValue_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => setFunctionVariableValue_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
-
-  static setNonEnumProperty_Callback_1(mthis, __arg_0) native "InjectedScriptHost_setNonEnumProperty_Callback";
-  setNonEnumProperty_Callback_1_(mthis, __arg_0) => setNonEnumProperty_Callback_1(mthis, __arg_0);
-
-  static setNonEnumProperty_Callback_2(mthis, __arg_0, __arg_1) native "InjectedScriptHost_setNonEnumProperty_Callback";
-  setNonEnumProperty_Callback_2_(mthis, __arg_0, __arg_1) => setNonEnumProperty_Callback_2(mthis, __arg_0, __arg_1);
-
-  static setNonEnumProperty_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "InjectedScriptHost_setNonEnumProperty_Callback";
-  setNonEnumProperty_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => setNonEnumProperty_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static setNonEnumProperty_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "InjectedScriptHost_setNonEnumProperty_Callback";
-  setNonEnumProperty_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => setNonEnumProperty_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static setNonEnumProperty_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "InjectedScriptHost_setNonEnumProperty_Callback";
-  setNonEnumProperty_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => setNonEnumProperty_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
-
-  static subtype_Callback_0(mthis) native "InjectedScriptHost_subtype_Callback";
-  subtype_Callback_0_(mthis) => subtype_Callback_0(mthis);
-
-  static subtype_Callback_1(mthis, __arg_0) native "InjectedScriptHost_subtype_Callback";
-  subtype_Callback_1_(mthis, __arg_0) => subtype_Callback_1(mthis, __arg_0);
-
-  static subtype_Callback_2(mthis, __arg_0, __arg_1) native "InjectedScriptHost_subtype_Callback";
-  subtype_Callback_2_(mthis, __arg_0, __arg_1) => subtype_Callback_2(mthis, __arg_0, __arg_1);
-
-  static subtype_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "InjectedScriptHost_subtype_Callback";
-  subtype_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => subtype_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static suppressWarningsAndCallFunction_Callback_0(mthis) native "InjectedScriptHost_suppressWarningsAndCallFunction_Callback";
-  suppressWarningsAndCallFunction_Callback_0_(mthis) => suppressWarningsAndCallFunction_Callback_0(mthis);
-
-  static suppressWarningsAndCallFunction_Callback_1(mthis, __arg_0) native "InjectedScriptHost_suppressWarningsAndCallFunction_Callback";
-  suppressWarningsAndCallFunction_Callback_1_(mthis, __arg_0) => suppressWarningsAndCallFunction_Callback_1(mthis, __arg_0);
-
-  static suppressWarningsAndCallFunction_Callback_2(mthis, __arg_0, __arg_1) native "InjectedScriptHost_suppressWarningsAndCallFunction_Callback";
-  suppressWarningsAndCallFunction_Callback_2_(mthis, __arg_0, __arg_1) => suppressWarningsAndCallFunction_Callback_2(mthis, __arg_0, __arg_1);
-
-  static suppressWarningsAndCallFunction_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "InjectedScriptHost_suppressWarningsAndCallFunction_Callback";
-  suppressWarningsAndCallFunction_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => suppressWarningsAndCallFunction_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static suppressWarningsAndCallFunction_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "InjectedScriptHost_suppressWarningsAndCallFunction_Callback";
-  suppressWarningsAndCallFunction_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => suppressWarningsAndCallFunction_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static suppressWarningsAndCallFunction_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "InjectedScriptHost_suppressWarningsAndCallFunction_Callback";
-  suppressWarningsAndCallFunction_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => suppressWarningsAndCallFunction_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
-
-  static undebugFunction_Callback_0(mthis) native "InjectedScriptHost_undebugFunction_Callback";
-  undebugFunction_Callback_0_(mthis) => undebugFunction_Callback_0(mthis);
-
-  static undebugFunction_Callback_1(mthis, __arg_0) native "InjectedScriptHost_undebugFunction_Callback";
-  undebugFunction_Callback_1_(mthis, __arg_0) => undebugFunction_Callback_1(mthis, __arg_0);
-
-  static undebugFunction_Callback_2(mthis, __arg_0, __arg_1) native "InjectedScriptHost_undebugFunction_Callback";
-  undebugFunction_Callback_2_(mthis, __arg_0, __arg_1) => undebugFunction_Callback_2(mthis, __arg_0, __arg_1);
-
-  static undebugFunction_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "InjectedScriptHost_undebugFunction_Callback";
-  undebugFunction_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => undebugFunction_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static unmonitorFunction_Callback_0(mthis) native "InjectedScriptHost_unmonitorFunction_Callback";
-  unmonitorFunction_Callback_0_(mthis) => unmonitorFunction_Callback_0(mthis);
+  undebugFunction_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "undebugFunction", []);
 
-  static unmonitorFunction_Callback_1(mthis, __arg_0) native "InjectedScriptHost_unmonitorFunction_Callback";
-  unmonitorFunction_Callback_1_(mthis, __arg_0) => unmonitorFunction_Callback_1(mthis, __arg_0);
+  undebugFunction_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "undebugFunction", [__arg_0]);
 
-  static unmonitorFunction_Callback_2(mthis, __arg_0, __arg_1) native "InjectedScriptHost_unmonitorFunction_Callback";
-  unmonitorFunction_Callback_2_(mthis, __arg_0, __arg_1) => unmonitorFunction_Callback_2(mthis, __arg_0, __arg_1);
+  unmonitorFunction_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "unmonitorFunction", []);
 
-  static unmonitorFunction_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "InjectedScriptHost_unmonitorFunction_Callback";
-  unmonitorFunction_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => unmonitorFunction_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  unmonitorFunction_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "unmonitorFunction", [__arg_0]);
 
 }
 
 class BlinkInputMethodContext extends BlinkEventTarget {
   static final instance = new BlinkInputMethodContext();
 
-  static compositionEndOffset_Getter(mthis) native "InputMethodContext_compositionEndOffset_Getter";
-  compositionEndOffset_Getter_(mthis) => compositionEndOffset_Getter(mthis);
+  compositionEndOffset_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "compositionEndOffset");
 
-  static compositionStartOffset_Getter(mthis) native "InputMethodContext_compositionStartOffset_Getter";
-  compositionStartOffset_Getter_(mthis) => compositionStartOffset_Getter(mthis);
+  compositionStartOffset_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "compositionStartOffset");
 
-  static confirmComposition_Callback_0(mthis) native "InputMethodContext_confirmComposition_Callback";
-  confirmComposition_Callback_0_(mthis) => confirmComposition_Callback_0(mthis);
+  confirmComposition_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "confirmComposition", []);
 
-  static confirmComposition_Callback_1(mthis, __arg_0) native "InputMethodContext_confirmComposition_Callback";
-  confirmComposition_Callback_1_(mthis, __arg_0) => confirmComposition_Callback_1(mthis, __arg_0);
+  locale_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "locale");
 
-  static confirmComposition_Callback_2(mthis, __arg_0, __arg_1) native "InputMethodContext_confirmComposition_Callback";
-  confirmComposition_Callback_2_(mthis, __arg_0, __arg_1) => confirmComposition_Callback_2(mthis, __arg_0, __arg_1);
+  oncandidatewindowhide_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "oncandidatewindowhide");
 
-  static locale_Getter(mthis) native "InputMethodContext_locale_Getter";
-  locale_Getter_(mthis) => locale_Getter(mthis);
+  oncandidatewindowhide_Setter_(mthis, __arg_0) => mthis["oncandidatewindowhide"] = __arg_0;
 
-  static oncandidatewindowhide_Getter(mthis) native "InputMethodContext_oncandidatewindowhide_Getter";
-  oncandidatewindowhide_Getter_(mthis) => oncandidatewindowhide_Getter(mthis);
+  oncandidatewindowshow_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "oncandidatewindowshow");
 
-  static oncandidatewindowhide_Setter(mthis, __arg_0) native "InputMethodContext_oncandidatewindowhide_Setter";
-  oncandidatewindowhide_Setter_(mthis, __arg_0) => oncandidatewindowhide_Setter(mthis, __arg_0);
+  oncandidatewindowshow_Setter_(mthis, __arg_0) => mthis["oncandidatewindowshow"] = __arg_0;
 
-  static oncandidatewindowshow_Getter(mthis) native "InputMethodContext_oncandidatewindowshow_Getter";
-  oncandidatewindowshow_Getter_(mthis) => oncandidatewindowshow_Getter(mthis);
+  oncandidatewindowupdate_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "oncandidatewindowupdate");
 
-  static oncandidatewindowshow_Setter(mthis, __arg_0) native "InputMethodContext_oncandidatewindowshow_Setter";
-  oncandidatewindowshow_Setter_(mthis, __arg_0) => oncandidatewindowshow_Setter(mthis, __arg_0);
+  oncandidatewindowupdate_Setter_(mthis, __arg_0) => mthis["oncandidatewindowupdate"] = __arg_0;
 
-  static oncandidatewindowupdate_Getter(mthis) native "InputMethodContext_oncandidatewindowupdate_Getter";
-  oncandidatewindowupdate_Getter_(mthis) => oncandidatewindowupdate_Getter(mthis);
-
-  static oncandidatewindowupdate_Setter(mthis, __arg_0) native "InputMethodContext_oncandidatewindowupdate_Setter";
-  oncandidatewindowupdate_Setter_(mthis, __arg_0) => oncandidatewindowupdate_Setter(mthis, __arg_0);
-
-  static target_Getter(mthis) native "InputMethodContext_target_Getter";
-  target_Getter_(mthis) => target_Getter(mthis);
+  target_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "target");
 
 }
 
 class BlinkInspectorFrontendHost {
   static final instance = new BlinkInspectorFrontendHost();
 
-  static copyText_Callback_0(mthis) native "InspectorFrontendHost_copyText_Callback";
-  copyText_Callback_0_(mthis) => copyText_Callback_0(mthis);
+  copyText_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "copyText", []);
 
-  static copyText_Callback_1(mthis, __arg_0) native "InspectorFrontendHost_copyText_Callback";
-  copyText_Callback_1_(mthis, __arg_0) => copyText_Callback_1(mthis, __arg_0);
+  copyText_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "copyText", [__arg_0]);
 
-  static copyText_Callback_2(mthis, __arg_0, __arg_1) native "InspectorFrontendHost_copyText_Callback";
-  copyText_Callback_2_(mthis, __arg_0, __arg_1) => copyText_Callback_2(mthis, __arg_0, __arg_1);
+  getSelectionBackgroundColor_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getSelectionBackgroundColor", []);
 
-  static copyText_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "InspectorFrontendHost_copyText_Callback";
-  copyText_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => copyText_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  getSelectionForegroundColor_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getSelectionForegroundColor", []);
 
-  static getSelectionBackgroundColor_Callback_0(mthis) native "InspectorFrontendHost_getSelectionBackgroundColor_Callback";
-  getSelectionBackgroundColor_Callback_0_(mthis) => getSelectionBackgroundColor_Callback_0(mthis);
+  isHostedMode_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "isHostedMode", []);
 
-  static getSelectionBackgroundColor_Callback_1(mthis, __arg_0) native "InspectorFrontendHost_getSelectionBackgroundColor_Callback";
-  getSelectionBackgroundColor_Callback_1_(mthis, __arg_0) => getSelectionBackgroundColor_Callback_1(mthis, __arg_0);
+  isUnderTest_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "isUnderTest", []);
 
-  static getSelectionBackgroundColor_Callback_2(mthis, __arg_0, __arg_1) native "InspectorFrontendHost_getSelectionBackgroundColor_Callback";
-  getSelectionBackgroundColor_Callback_2_(mthis, __arg_0, __arg_1) => getSelectionBackgroundColor_Callback_2(mthis, __arg_0, __arg_1);
+  isolatedFileSystem_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "isolatedFileSystem", []);
 
-  static getSelectionForegroundColor_Callback_0(mthis) native "InspectorFrontendHost_getSelectionForegroundColor_Callback";
-  getSelectionForegroundColor_Callback_0_(mthis) => getSelectionForegroundColor_Callback_0(mthis);
+  isolatedFileSystem_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "isolatedFileSystem", [__arg_0]);
 
-  static getSelectionForegroundColor_Callback_1(mthis, __arg_0) native "InspectorFrontendHost_getSelectionForegroundColor_Callback";
-  getSelectionForegroundColor_Callback_1_(mthis, __arg_0) => getSelectionForegroundColor_Callback_1(mthis, __arg_0);
+  isolatedFileSystem_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "isolatedFileSystem", [__arg_0, __arg_1]);
 
-  static getSelectionForegroundColor_Callback_2(mthis, __arg_0, __arg_1) native "InspectorFrontendHost_getSelectionForegroundColor_Callback";
-  getSelectionForegroundColor_Callback_2_(mthis, __arg_0, __arg_1) => getSelectionForegroundColor_Callback_2(mthis, __arg_0, __arg_1);
+  platform_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "platform", []);
 
-  static isHostedMode_Callback_0(mthis) native "InspectorFrontendHost_isHostedMode_Callback";
-  isHostedMode_Callback_0_(mthis) => isHostedMode_Callback_0(mthis);
+  port_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "port", []);
 
-  static isHostedMode_Callback_1(mthis, __arg_0) native "InspectorFrontendHost_isHostedMode_Callback";
-  isHostedMode_Callback_1_(mthis, __arg_0) => isHostedMode_Callback_1(mthis, __arg_0);
+  recordActionTaken_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "recordActionTaken", []);
 
-  static isHostedMode_Callback_2(mthis, __arg_0, __arg_1) native "InspectorFrontendHost_isHostedMode_Callback";
-  isHostedMode_Callback_2_(mthis, __arg_0, __arg_1) => isHostedMode_Callback_2(mthis, __arg_0, __arg_1);
+  recordActionTaken_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "recordActionTaken", [__arg_0]);
 
-  static isUnderTest_Callback_0(mthis) native "InspectorFrontendHost_isUnderTest_Callback";
-  isUnderTest_Callback_0_(mthis) => isUnderTest_Callback_0(mthis);
+  recordPanelShown_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "recordPanelShown", []);
 
-  static isUnderTest_Callback_1(mthis, __arg_0) native "InspectorFrontendHost_isUnderTest_Callback";
-  isUnderTest_Callback_1_(mthis, __arg_0) => isUnderTest_Callback_1(mthis, __arg_0);
+  recordPanelShown_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "recordPanelShown", [__arg_0]);
 
-  static isUnderTest_Callback_2(mthis, __arg_0, __arg_1) native "InspectorFrontendHost_isUnderTest_Callback";
-  isUnderTest_Callback_2_(mthis, __arg_0, __arg_1) => isUnderTest_Callback_2(mthis, __arg_0, __arg_1);
+  sendMessageToBackend_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "sendMessageToBackend", []);
 
-  static isolatedFileSystem_Callback_0(mthis) native "InspectorFrontendHost_isolatedFileSystem_Callback";
-  isolatedFileSystem_Callback_0_(mthis) => isolatedFileSystem_Callback_0(mthis);
+  sendMessageToBackend_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "sendMessageToBackend", [__arg_0]);
 
-  static isolatedFileSystem_Callback_1(mthis, __arg_0) native "InspectorFrontendHost_isolatedFileSystem_Callback";
-  isolatedFileSystem_Callback_1_(mthis, __arg_0) => isolatedFileSystem_Callback_1(mthis, __arg_0);
+  sendMessageToEmbedder_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "sendMessageToEmbedder", []);
 
-  static isolatedFileSystem_Callback_2(mthis, __arg_0, __arg_1) native "InspectorFrontendHost_isolatedFileSystem_Callback";
-  isolatedFileSystem_Callback_2_(mthis, __arg_0, __arg_1) => isolatedFileSystem_Callback_2(mthis, __arg_0, __arg_1);
+  sendMessageToEmbedder_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "sendMessageToEmbedder", [__arg_0]);
 
-  static isolatedFileSystem_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "InspectorFrontendHost_isolatedFileSystem_Callback";
-  isolatedFileSystem_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => isolatedFileSystem_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  setInjectedScriptForOrigin_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "setInjectedScriptForOrigin", []);
 
-  static isolatedFileSystem_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "InspectorFrontendHost_isolatedFileSystem_Callback";
-  isolatedFileSystem_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => isolatedFileSystem_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  setInjectedScriptForOrigin_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "setInjectedScriptForOrigin", [__arg_0]);
 
-  static platform_Callback_0(mthis) native "InspectorFrontendHost_platform_Callback";
-  platform_Callback_0_(mthis) => platform_Callback_0(mthis);
+  setInjectedScriptForOrigin_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "setInjectedScriptForOrigin", [__arg_0, __arg_1]);
 
-  static platform_Callback_1(mthis, __arg_0) native "InspectorFrontendHost_platform_Callback";
-  platform_Callback_1_(mthis, __arg_0) => platform_Callback_1(mthis, __arg_0);
+  setZoomFactor_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "setZoomFactor", []);
 
-  static platform_Callback_2(mthis, __arg_0, __arg_1) native "InspectorFrontendHost_platform_Callback";
-  platform_Callback_2_(mthis, __arg_0, __arg_1) => platform_Callback_2(mthis, __arg_0, __arg_1);
+  setZoomFactor_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "setZoomFactor", [__arg_0]);
 
-  static port_Callback_0(mthis) native "InspectorFrontendHost_port_Callback";
-  port_Callback_0_(mthis) => port_Callback_0(mthis);
+  showContextMenuAtPoint_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "showContextMenuAtPoint", [__arg_0]);
 
-  static port_Callback_1(mthis, __arg_0) native "InspectorFrontendHost_port_Callback";
-  port_Callback_1_(mthis, __arg_0) => port_Callback_1(mthis, __arg_0);
+  showContextMenuAtPoint_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "showContextMenuAtPoint", [__arg_0, __arg_1]);
 
-  static port_Callback_2(mthis, __arg_0, __arg_1) native "InspectorFrontendHost_port_Callback";
-  port_Callback_2_(mthis, __arg_0, __arg_1) => port_Callback_2(mthis, __arg_0, __arg_1);
+  showContextMenuAtPoint_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "showContextMenuAtPoint", [__arg_0, __arg_1, __arg_2]);
 
-  static recordActionTaken_Callback_0(mthis) native "InspectorFrontendHost_recordActionTaken_Callback";
-  recordActionTaken_Callback_0_(mthis) => recordActionTaken_Callback_0(mthis);
+  showContextMenu_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "showContextMenu", []);
 
-  static recordActionTaken_Callback_1(mthis, __arg_0) native "InspectorFrontendHost_recordActionTaken_Callback";
-  recordActionTaken_Callback_1_(mthis, __arg_0) => recordActionTaken_Callback_1(mthis, __arg_0);
+  showContextMenu_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "showContextMenu", [__arg_0]);
 
-  static recordActionTaken_Callback_2(mthis, __arg_0, __arg_1) native "InspectorFrontendHost_recordActionTaken_Callback";
-  recordActionTaken_Callback_2_(mthis, __arg_0, __arg_1) => recordActionTaken_Callback_2(mthis, __arg_0, __arg_1);
+  showContextMenu_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "showContextMenu", [__arg_0, __arg_1]);
 
-  static recordActionTaken_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "InspectorFrontendHost_recordActionTaken_Callback";
-  recordActionTaken_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => recordActionTaken_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  upgradeDraggedFileSystemPermissions_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "upgradeDraggedFileSystemPermissions", []);
 
-  static recordPanelShown_Callback_0(mthis) native "InspectorFrontendHost_recordPanelShown_Callback";
-  recordPanelShown_Callback_0_(mthis) => recordPanelShown_Callback_0(mthis);
+  upgradeDraggedFileSystemPermissions_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "upgradeDraggedFileSystemPermissions", [__arg_0]);
 
-  static recordPanelShown_Callback_1(mthis, __arg_0) native "InspectorFrontendHost_recordPanelShown_Callback";
-  recordPanelShown_Callback_1_(mthis, __arg_0) => recordPanelShown_Callback_1(mthis, __arg_0);
-
-  static recordPanelShown_Callback_2(mthis, __arg_0, __arg_1) native "InspectorFrontendHost_recordPanelShown_Callback";
-  recordPanelShown_Callback_2_(mthis, __arg_0, __arg_1) => recordPanelShown_Callback_2(mthis, __arg_0, __arg_1);
-
-  static recordPanelShown_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "InspectorFrontendHost_recordPanelShown_Callback";
-  recordPanelShown_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => recordPanelShown_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static sendMessageToBackend_Callback_0(mthis) native "InspectorFrontendHost_sendMessageToBackend_Callback";
-  sendMessageToBackend_Callback_0_(mthis) => sendMessageToBackend_Callback_0(mthis);
-
-  static sendMessageToBackend_Callback_1(mthis, __arg_0) native "InspectorFrontendHost_sendMessageToBackend_Callback";
-  sendMessageToBackend_Callback_1_(mthis, __arg_0) => sendMessageToBackend_Callback_1(mthis, __arg_0);
-
-  static sendMessageToBackend_Callback_2(mthis, __arg_0, __arg_1) native "InspectorFrontendHost_sendMessageToBackend_Callback";
-  sendMessageToBackend_Callback_2_(mthis, __arg_0, __arg_1) => sendMessageToBackend_Callback_2(mthis, __arg_0, __arg_1);
-
-  static sendMessageToBackend_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "InspectorFrontendHost_sendMessageToBackend_Callback";
-  sendMessageToBackend_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => sendMessageToBackend_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static sendMessageToEmbedder_Callback_0(mthis) native "InspectorFrontendHost_sendMessageToEmbedder_Callback";
-  sendMessageToEmbedder_Callback_0_(mthis) => sendMessageToEmbedder_Callback_0(mthis);
-
-  static sendMessageToEmbedder_Callback_1(mthis, __arg_0) native "InspectorFrontendHost_sendMessageToEmbedder_Callback";
-  sendMessageToEmbedder_Callback_1_(mthis, __arg_0) => sendMessageToEmbedder_Callback_1(mthis, __arg_0);
-
-  static sendMessageToEmbedder_Callback_2(mthis, __arg_0, __arg_1) native "InspectorFrontendHost_sendMessageToEmbedder_Callback";
-  sendMessageToEmbedder_Callback_2_(mthis, __arg_0, __arg_1) => sendMessageToEmbedder_Callback_2(mthis, __arg_0, __arg_1);
-
-  static sendMessageToEmbedder_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "InspectorFrontendHost_sendMessageToEmbedder_Callback";
-  sendMessageToEmbedder_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => sendMessageToEmbedder_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static setInjectedScriptForOrigin_Callback_0(mthis) native "InspectorFrontendHost_setInjectedScriptForOrigin_Callback";
-  setInjectedScriptForOrigin_Callback_0_(mthis) => setInjectedScriptForOrigin_Callback_0(mthis);
-
-  static setInjectedScriptForOrigin_Callback_1(mthis, __arg_0) native "InspectorFrontendHost_setInjectedScriptForOrigin_Callback";
-  setInjectedScriptForOrigin_Callback_1_(mthis, __arg_0) => setInjectedScriptForOrigin_Callback_1(mthis, __arg_0);
-
-  static setInjectedScriptForOrigin_Callback_2(mthis, __arg_0, __arg_1) native "InspectorFrontendHost_setInjectedScriptForOrigin_Callback";
-  setInjectedScriptForOrigin_Callback_2_(mthis, __arg_0, __arg_1) => setInjectedScriptForOrigin_Callback_2(mthis, __arg_0, __arg_1);
-
-  static setInjectedScriptForOrigin_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "InspectorFrontendHost_setInjectedScriptForOrigin_Callback";
-  setInjectedScriptForOrigin_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => setInjectedScriptForOrigin_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static setInjectedScriptForOrigin_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "InspectorFrontendHost_setInjectedScriptForOrigin_Callback";
-  setInjectedScriptForOrigin_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => setInjectedScriptForOrigin_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static setZoomFactor_Callback_0(mthis) native "InspectorFrontendHost_setZoomFactor_Callback";
-  setZoomFactor_Callback_0_(mthis) => setZoomFactor_Callback_0(mthis);
-
-  static setZoomFactor_Callback_1(mthis, __arg_0) native "InspectorFrontendHost_setZoomFactor_Callback";
-  setZoomFactor_Callback_1_(mthis, __arg_0) => setZoomFactor_Callback_1(mthis, __arg_0);
-
-  static setZoomFactor_Callback_2(mthis, __arg_0, __arg_1) native "InspectorFrontendHost_setZoomFactor_Callback";
-  setZoomFactor_Callback_2_(mthis, __arg_0, __arg_1) => setZoomFactor_Callback_2(mthis, __arg_0, __arg_1);
-
-  static setZoomFactor_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "InspectorFrontendHost_setZoomFactor_Callback";
-  setZoomFactor_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => setZoomFactor_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static showContextMenuAtPoint_Callback_1(mthis, __arg_0) native "InspectorFrontendHost_showContextMenuAtPoint_Callback";
-  showContextMenuAtPoint_Callback_1_(mthis, __arg_0) => showContextMenuAtPoint_Callback_1(mthis, __arg_0);
-
-  static showContextMenuAtPoint_Callback_2(mthis, __arg_0, __arg_1) native "InspectorFrontendHost_showContextMenuAtPoint_Callback";
-  showContextMenuAtPoint_Callback_2_(mthis, __arg_0, __arg_1) => showContextMenuAtPoint_Callback_2(mthis, __arg_0, __arg_1);
-
-  static showContextMenuAtPoint_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "InspectorFrontendHost_showContextMenuAtPoint_Callback";
-  showContextMenuAtPoint_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => showContextMenuAtPoint_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static showContextMenuAtPoint_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "InspectorFrontendHost_showContextMenuAtPoint_Callback";
-  showContextMenuAtPoint_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => showContextMenuAtPoint_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static showContextMenuAtPoint_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "InspectorFrontendHost_showContextMenuAtPoint_Callback";
-  showContextMenuAtPoint_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => showContextMenuAtPoint_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
-
-  static showContextMenu_Callback_0(mthis) native "InspectorFrontendHost_showContextMenu_Callback";
-  showContextMenu_Callback_0_(mthis) => showContextMenu_Callback_0(mthis);
-
-  static showContextMenu_Callback_1(mthis, __arg_0) native "InspectorFrontendHost_showContextMenu_Callback";
-  showContextMenu_Callback_1_(mthis, __arg_0) => showContextMenu_Callback_1(mthis, __arg_0);
-
-  static showContextMenu_Callback_2(mthis, __arg_0, __arg_1) native "InspectorFrontendHost_showContextMenu_Callback";
-  showContextMenu_Callback_2_(mthis, __arg_0, __arg_1) => showContextMenu_Callback_2(mthis, __arg_0, __arg_1);
-
-  static showContextMenu_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "InspectorFrontendHost_showContextMenu_Callback";
-  showContextMenu_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => showContextMenu_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static showContextMenu_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "InspectorFrontendHost_showContextMenu_Callback";
-  showContextMenu_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => showContextMenu_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static upgradeDraggedFileSystemPermissions_Callback_0(mthis) native "InspectorFrontendHost_upgradeDraggedFileSystemPermissions_Callback";
-  upgradeDraggedFileSystemPermissions_Callback_0_(mthis) => upgradeDraggedFileSystemPermissions_Callback_0(mthis);
-
-  static upgradeDraggedFileSystemPermissions_Callback_1(mthis, __arg_0) native "InspectorFrontendHost_upgradeDraggedFileSystemPermissions_Callback";
-  upgradeDraggedFileSystemPermissions_Callback_1_(mthis, __arg_0) => upgradeDraggedFileSystemPermissions_Callback_1(mthis, __arg_0);
-
-  static upgradeDraggedFileSystemPermissions_Callback_2(mthis, __arg_0, __arg_1) native "InspectorFrontendHost_upgradeDraggedFileSystemPermissions_Callback";
-  upgradeDraggedFileSystemPermissions_Callback_2_(mthis, __arg_0, __arg_1) => upgradeDraggedFileSystemPermissions_Callback_2(mthis, __arg_0, __arg_1);
-
-  static upgradeDraggedFileSystemPermissions_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "InspectorFrontendHost_upgradeDraggedFileSystemPermissions_Callback";
-  upgradeDraggedFileSystemPermissions_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => upgradeDraggedFileSystemPermissions_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static zoomFactor_Callback_0(mthis) native "InspectorFrontendHost_zoomFactor_Callback";
-  zoomFactor_Callback_0_(mthis) => zoomFactor_Callback_0(mthis);
-
-  static zoomFactor_Callback_1(mthis, __arg_0) native "InspectorFrontendHost_zoomFactor_Callback";
-  zoomFactor_Callback_1_(mthis, __arg_0) => zoomFactor_Callback_1(mthis, __arg_0);
-
-  static zoomFactor_Callback_2(mthis, __arg_0, __arg_1) native "InspectorFrontendHost_zoomFactor_Callback";
-  zoomFactor_Callback_2_(mthis, __arg_0, __arg_1) => zoomFactor_Callback_2(mthis, __arg_0, __arg_1);
+  zoomFactor_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "zoomFactor", []);
 
 }
 
 class BlinkInspectorOverlayHost {
   static final instance = new BlinkInspectorOverlayHost();
 
-  static resume_Callback_0(mthis) native "InspectorOverlayHost_resume_Callback";
-  resume_Callback_0_(mthis) => resume_Callback_0(mthis);
+  resume_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "resume", []);
 
-  static resume_Callback_1(mthis, __arg_0) native "InspectorOverlayHost_resume_Callback";
-  resume_Callback_1_(mthis, __arg_0) => resume_Callback_1(mthis, __arg_0);
-
-  static resume_Callback_2(mthis, __arg_0, __arg_1) native "InspectorOverlayHost_resume_Callback";
-  resume_Callback_2_(mthis, __arg_0, __arg_1) => resume_Callback_2(mthis, __arg_0, __arg_1);
-
-  static stepOver_Callback_0(mthis) native "InspectorOverlayHost_stepOver_Callback";
-  stepOver_Callback_0_(mthis) => stepOver_Callback_0(mthis);
-
-  static stepOver_Callback_1(mthis, __arg_0) native "InspectorOverlayHost_stepOver_Callback";
-  stepOver_Callback_1_(mthis, __arg_0) => stepOver_Callback_1(mthis, __arg_0);
-
-  static stepOver_Callback_2(mthis, __arg_0, __arg_1) native "InspectorOverlayHost_stepOver_Callback";
-  stepOver_Callback_2_(mthis, __arg_0, __arg_1) => stepOver_Callback_2(mthis, __arg_0, __arg_1);
+  stepOver_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "stepOver", []);
 
 }
 
 class BlinkInstallEvent extends BlinkExtendableEvent {
   static final instance = new BlinkInstallEvent();
 
-  static reloadAll_Callback_0(mthis) native "InstallEvent_reloadAll_Callback";
-  reloadAll_Callback_0_(mthis) => reloadAll_Callback_0(mthis);
+  reloadAll_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "reloadAll", []);
 
-  static reloadAll_Callback_1(mthis, __arg_0) native "InstallEvent_reloadAll_Callback";
-  reloadAll_Callback_1_(mthis, __arg_0) => reloadAll_Callback_1(mthis, __arg_0);
-
-  static reloadAll_Callback_2(mthis, __arg_0, __arg_1) native "InstallEvent_reloadAll_Callback";
-  reloadAll_Callback_2_(mthis, __arg_0, __arg_1) => reloadAll_Callback_2(mthis, __arg_0, __arg_1);
-
-  static replace_Callback_0(mthis) native "InstallEvent_replace_Callback";
-  replace_Callback_0_(mthis) => replace_Callback_0(mthis);
-
-  static replace_Callback_1(mthis, __arg_0) native "InstallEvent_replace_Callback";
-  replace_Callback_1_(mthis, __arg_0) => replace_Callback_1(mthis, __arg_0);
-
-  static replace_Callback_2(mthis, __arg_0, __arg_1) native "InstallEvent_replace_Callback";
-  replace_Callback_2_(mthis, __arg_0, __arg_1) => replace_Callback_2(mthis, __arg_0, __arg_1);
+  replace_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "replace", []);
 
 }
 
 class BlinkIterator {
   static final instance = new BlinkIterator();
 
-  static next_Callback_0(mthis) native "Iterator_next_Callback";
-  next_Callback_0_(mthis) => next_Callback_0(mthis);
+  next_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "next", []);
 
-  static next_Callback_1(mthis, __arg_0) native "Iterator_next_Callback";
-  next_Callback_1_(mthis, __arg_0) => next_Callback_1(mthis, __arg_0);
-
-  static next_Callback_2(mthis, __arg_0, __arg_1) native "Iterator_next_Callback";
-  next_Callback_2_(mthis, __arg_0, __arg_1) => next_Callback_2(mthis, __arg_0, __arg_1);
-
-  static next_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Iterator_next_Callback";
-  next_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => next_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  next_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "next", [__arg_0]);
 
 }
 
 class BlinkJavaScriptCallFrame {
   static final instance = new BlinkJavaScriptCallFrame();
 
-  static caller_Getter(mthis) native "JavaScriptCallFrame_caller_Getter";
-  caller_Getter_(mthis) => caller_Getter(mthis);
+  caller_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "caller");
 
-  static column_Getter(mthis) native "JavaScriptCallFrame_column_Getter";
-  column_Getter_(mthis) => column_Getter(mthis);
+  column_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "column");
 
-  static evaluateWithExceptionDetails_Callback_0(mthis) native "JavaScriptCallFrame_evaluateWithExceptionDetails_Callback";
-  evaluateWithExceptionDetails_Callback_0_(mthis) => evaluateWithExceptionDetails_Callback_0(mthis);
+  evaluateWithExceptionDetails_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "evaluateWithExceptionDetails", []);
 
-  static evaluateWithExceptionDetails_Callback_1(mthis, __arg_0) native "JavaScriptCallFrame_evaluateWithExceptionDetails_Callback";
-  evaluateWithExceptionDetails_Callback_1_(mthis, __arg_0) => evaluateWithExceptionDetails_Callback_1(mthis, __arg_0);
+  evaluateWithExceptionDetails_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "evaluateWithExceptionDetails", [__arg_0]);
 
-  static evaluateWithExceptionDetails_Callback_2(mthis, __arg_0, __arg_1) native "JavaScriptCallFrame_evaluateWithExceptionDetails_Callback";
-  evaluateWithExceptionDetails_Callback_2_(mthis, __arg_0, __arg_1) => evaluateWithExceptionDetails_Callback_2(mthis, __arg_0, __arg_1);
+  functionName_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "functionName");
 
-  static evaluateWithExceptionDetails_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "JavaScriptCallFrame_evaluateWithExceptionDetails_Callback";
-  evaluateWithExceptionDetails_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => evaluateWithExceptionDetails_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  isAtReturn_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "isAtReturn");
 
-  static functionName_Getter(mthis) native "JavaScriptCallFrame_functionName_Getter";
-  functionName_Getter_(mthis) => functionName_Getter(mthis);
+  line_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "line");
 
-  static isAtReturn_Getter(mthis) native "JavaScriptCallFrame_isAtReturn_Getter";
-  isAtReturn_Getter_(mthis) => isAtReturn_Getter(mthis);
+  restart_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "restart", []);
 
-  static line_Getter(mthis) native "JavaScriptCallFrame_line_Getter";
-  line_Getter_(mthis) => line_Getter(mthis);
+  returnValue_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "returnValue");
 
-  static restart_Callback_0(mthis) native "JavaScriptCallFrame_restart_Callback";
-  restart_Callback_0_(mthis) => restart_Callback_0(mthis);
+  scopeChain_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "scopeChain");
 
-  static restart_Callback_1(mthis, __arg_0) native "JavaScriptCallFrame_restart_Callback";
-  restart_Callback_1_(mthis, __arg_0) => restart_Callback_1(mthis, __arg_0);
+  scopeType_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "scopeType", []);
 
-  static restart_Callback_2(mthis, __arg_0, __arg_1) native "JavaScriptCallFrame_restart_Callback";
-  restart_Callback_2_(mthis, __arg_0, __arg_1) => restart_Callback_2(mthis, __arg_0, __arg_1);
+  scopeType_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "scopeType", [__arg_0]);
 
-  static returnValue_Getter(mthis) native "JavaScriptCallFrame_returnValue_Getter";
-  returnValue_Getter_(mthis) => returnValue_Getter(mthis);
+  setVariableValue_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "setVariableValue", []);
 
-  static scopeChain_Getter(mthis) native "JavaScriptCallFrame_scopeChain_Getter";
-  scopeChain_Getter_(mthis) => scopeChain_Getter(mthis);
+  setVariableValue_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "setVariableValue", [__arg_0]);
 
-  static scopeType_Callback_0(mthis) native "JavaScriptCallFrame_scopeType_Callback";
-  scopeType_Callback_0_(mthis) => scopeType_Callback_0(mthis);
+  setVariableValue_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "setVariableValue", [__arg_0, __arg_1]);
 
-  static scopeType_Callback_1(mthis, __arg_0) native "JavaScriptCallFrame_scopeType_Callback";
-  scopeType_Callback_1_(mthis, __arg_0) => scopeType_Callback_1(mthis, __arg_0);
+  setVariableValue_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "setVariableValue", [__arg_0, __arg_1, __arg_2]);
 
-  static scopeType_Callback_2(mthis, __arg_0, __arg_1) native "JavaScriptCallFrame_scopeType_Callback";
-  scopeType_Callback_2_(mthis, __arg_0, __arg_1) => scopeType_Callback_2(mthis, __arg_0, __arg_1);
+  sourceID_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "sourceID");
 
-  static scopeType_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "JavaScriptCallFrame_scopeType_Callback";
-  scopeType_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => scopeType_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  stepInPositions_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "stepInPositions");
 
-  static setVariableValue_Callback_0(mthis) native "JavaScriptCallFrame_setVariableValue_Callback";
-  setVariableValue_Callback_0_(mthis) => setVariableValue_Callback_0(mthis);
+  thisObject_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "thisObject");
 
-  static setVariableValue_Callback_1(mthis, __arg_0) native "JavaScriptCallFrame_setVariableValue_Callback";
-  setVariableValue_Callback_1_(mthis, __arg_0) => setVariableValue_Callback_1(mthis, __arg_0);
-
-  static setVariableValue_Callback_2(mthis, __arg_0, __arg_1) native "JavaScriptCallFrame_setVariableValue_Callback";
-  setVariableValue_Callback_2_(mthis, __arg_0, __arg_1) => setVariableValue_Callback_2(mthis, __arg_0, __arg_1);
-
-  static setVariableValue_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "JavaScriptCallFrame_setVariableValue_Callback";
-  setVariableValue_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => setVariableValue_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static setVariableValue_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "JavaScriptCallFrame_setVariableValue_Callback";
-  setVariableValue_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => setVariableValue_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static setVariableValue_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "JavaScriptCallFrame_setVariableValue_Callback";
-  setVariableValue_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => setVariableValue_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
-
-  static sourceID_Getter(mthis) native "JavaScriptCallFrame_sourceID_Getter";
-  sourceID_Getter_(mthis) => sourceID_Getter(mthis);
-
-  static stepInPositions_Getter(mthis) native "JavaScriptCallFrame_stepInPositions_Getter";
-  stepInPositions_Getter_(mthis) => stepInPositions_Getter(mthis);
-
-  static thisObject_Getter(mthis) native "JavaScriptCallFrame_thisObject_Getter";
-  thisObject_Getter_(mthis) => thisObject_Getter(mthis);
-
-  static type_Getter(mthis) native "JavaScriptCallFrame_type_Getter";
-  type_Getter_(mthis) => type_Getter(mthis);
+  type_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "type");
 
 }
 
 class BlinkKeyboardEvent extends BlinkUIEvent {
   static final instance = new BlinkKeyboardEvent();
 
-  static altKey_Getter(mthis) native "KeyboardEvent_altKey_Getter";
-  altKey_Getter_(mthis) => altKey_Getter(mthis);
+  altKey_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "altKey");
 
-  static constructorCallback_2(__arg_0, __arg_1) native "KeyboardEvent_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  constructorCallback_2_(__arg_0, __arg_1) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "KeyboardEvent"), [__arg_0, __arg_1]);
 
-  static ctrlKey_Getter(mthis) native "KeyboardEvent_ctrlKey_Getter";
-  ctrlKey_Getter_(mthis) => ctrlKey_Getter(mthis);
+  ctrlKey_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ctrlKey");
 
-  static getModifierState_Callback_0(mthis) native "KeyboardEvent_getModifierState_Callback";
-  getModifierState_Callback_0_(mthis) => getModifierState_Callback_0(mthis);
+  getModifierState_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getModifierState", []);
 
-  static getModifierState_Callback_1(mthis, __arg_0) native "KeyboardEvent_getModifierState_Callback";
-  getModifierState_Callback_1_(mthis, __arg_0) => getModifierState_Callback_1(mthis, __arg_0);
+  getModifierState_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getModifierState", [__arg_0]);
 
-  static getModifierState_Callback_2(mthis, __arg_0, __arg_1) native "KeyboardEvent_getModifierState_Callback";
-  getModifierState_Callback_2_(mthis, __arg_0, __arg_1) => getModifierState_Callback_2(mthis, __arg_0, __arg_1);
+  initKeyboardEvent_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "initKeyboardEvent", []);
 
-  static getModifierState_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "KeyboardEvent_getModifierState_Callback";
-  getModifierState_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getModifierState_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  initKeyboardEvent_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "initKeyboardEvent", [__arg_0]);
 
-  static initKeyboardEvent_Callback_0(mthis) native "KeyboardEvent_initKeyboardEvent_Callback";
-  initKeyboardEvent_Callback_0_(mthis) => initKeyboardEvent_Callback_0(mthis);
+  initKeyboardEvent_Callback_10_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9) => Blink_JsNative_DomException.callMethod(mthis, "initKeyboardEvent", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9]);
 
-  static initKeyboardEvent_Callback_1(mthis, __arg_0) native "KeyboardEvent_initKeyboardEvent_Callback";
-  initKeyboardEvent_Callback_1_(mthis, __arg_0) => initKeyboardEvent_Callback_1(mthis, __arg_0);
+  initKeyboardEvent_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "initKeyboardEvent", [__arg_0, __arg_1]);
 
-  static initKeyboardEvent_Callback_10(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9) native "KeyboardEvent_initKeyboardEvent_Callback";
-  initKeyboardEvent_Callback_10_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9) => initKeyboardEvent_Callback_10(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9);
+  initKeyboardEvent_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "initKeyboardEvent", [__arg_0, __arg_1, __arg_2]);
 
-  static initKeyboardEvent_Callback_11(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10) native "KeyboardEvent_initKeyboardEvent_Callback";
-  initKeyboardEvent_Callback_11_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10) => initKeyboardEvent_Callback_11(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10);
+  initKeyboardEvent_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "initKeyboardEvent", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static initKeyboardEvent_Callback_12(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10, __arg_11) native "KeyboardEvent_initKeyboardEvent_Callback";
-  initKeyboardEvent_Callback_12_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10, __arg_11) => initKeyboardEvent_Callback_12(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10, __arg_11);
+  initKeyboardEvent_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => Blink_JsNative_DomException.callMethod(mthis, "initKeyboardEvent", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4]);
 
-  static initKeyboardEvent_Callback_2(mthis, __arg_0, __arg_1) native "KeyboardEvent_initKeyboardEvent_Callback";
-  initKeyboardEvent_Callback_2_(mthis, __arg_0, __arg_1) => initKeyboardEvent_Callback_2(mthis, __arg_0, __arg_1);
+  initKeyboardEvent_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => Blink_JsNative_DomException.callMethod(mthis, "initKeyboardEvent", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5]);
 
-  static initKeyboardEvent_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "KeyboardEvent_initKeyboardEvent_Callback";
-  initKeyboardEvent_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => initKeyboardEvent_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  initKeyboardEvent_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => Blink_JsNative_DomException.callMethod(mthis, "initKeyboardEvent", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6]);
 
-  static initKeyboardEvent_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "KeyboardEvent_initKeyboardEvent_Callback";
-  initKeyboardEvent_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => initKeyboardEvent_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  initKeyboardEvent_Callback_8_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) => Blink_JsNative_DomException.callMethod(mthis, "initKeyboardEvent", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7]);
 
-  static initKeyboardEvent_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "KeyboardEvent_initKeyboardEvent_Callback";
-  initKeyboardEvent_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => initKeyboardEvent_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  initKeyboardEvent_Callback_9_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8) => Blink_JsNative_DomException.callMethod(mthis, "initKeyboardEvent", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8]);
 
-  static initKeyboardEvent_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "KeyboardEvent_initKeyboardEvent_Callback";
-  initKeyboardEvent_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => initKeyboardEvent_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  keyIdentifier_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "keyIdentifier");
 
-  static initKeyboardEvent_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) native "KeyboardEvent_initKeyboardEvent_Callback";
-  initKeyboardEvent_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => initKeyboardEvent_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6);
+  keyLocation_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "keyLocation");
 
-  static initKeyboardEvent_Callback_8(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) native "KeyboardEvent_initKeyboardEvent_Callback";
-  initKeyboardEvent_Callback_8_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) => initKeyboardEvent_Callback_8(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7);
+  location_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "location");
 
-  static initKeyboardEvent_Callback_9(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8) native "KeyboardEvent_initKeyboardEvent_Callback";
-  initKeyboardEvent_Callback_9_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8) => initKeyboardEvent_Callback_9(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8);
+  metaKey_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "metaKey");
 
-  static keyIdentifier_Getter(mthis) native "KeyboardEvent_keyIdentifier_Getter";
-  keyIdentifier_Getter_(mthis) => keyIdentifier_Getter(mthis);
+  repeat_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "repeat");
 
-  static keyLocation_Getter(mthis) native "KeyboardEvent_keyLocation_Getter";
-  keyLocation_Getter_(mthis) => keyLocation_Getter(mthis);
-
-  static location_Getter(mthis) native "KeyboardEvent_location_Getter";
-  location_Getter_(mthis) => location_Getter(mthis);
-
-  static metaKey_Getter(mthis) native "KeyboardEvent_metaKey_Getter";
-  metaKey_Getter_(mthis) => metaKey_Getter(mthis);
-
-  static repeat_Getter(mthis) native "KeyboardEvent_repeat_Getter";
-  repeat_Getter_(mthis) => repeat_Getter(mthis);
-
-  static shiftKey_Getter(mthis) native "KeyboardEvent_shiftKey_Getter";
-  shiftKey_Getter_(mthis) => shiftKey_Getter(mthis);
+  shiftKey_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "shiftKey");
 
 }
 
 class BlinkLocalCredential extends BlinkCredential {
   static final instance = new BlinkLocalCredential();
 
-  static constructorCallback_2(__arg_0, __arg_1) native "LocalCredential_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  constructorCallback_2_(__arg_0, __arg_1) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "LocalCredential"), [__arg_0, __arg_1]);
 
-  static constructorCallback_3(__arg_0, __arg_1, __arg_2) native "LocalCredential_constructorCallback";
-  constructorCallback_3_(__arg_0, __arg_1, __arg_2) => constructorCallback_3(__arg_0, __arg_1, __arg_2);
+  constructorCallback_3_(__arg_0, __arg_1, __arg_2) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "LocalCredential"), [__arg_0, __arg_1, __arg_2]);
 
-  static constructorCallback_4(__arg_0, __arg_1, __arg_2, __arg_3) native "LocalCredential_constructorCallback";
-  constructorCallback_4_(__arg_0, __arg_1, __arg_2, __arg_3) => constructorCallback_4(__arg_0, __arg_1, __arg_2, __arg_3);
+  constructorCallback_4_(__arg_0, __arg_1, __arg_2, __arg_3) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "LocalCredential"), [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static constructorCallback_5(__arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "LocalCredential_constructorCallback";
-  constructorCallback_5_(__arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => constructorCallback_5(__arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
-
-  static constructorCallback_6(__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "LocalCredential_constructorCallback";
-  constructorCallback_6_(__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => constructorCallback_6(__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
-
-  static password_Getter(mthis) native "LocalCredential_password_Getter";
-  password_Getter_(mthis) => password_Getter(mthis);
+  password_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "password");
 
 }
 
 class BlinkLocation {
   static final instance = new BlinkLocation();
 
-  static ancestorOrigins_Getter(mthis) native "Location_ancestorOrigins_Getter";
-  ancestorOrigins_Getter_(mthis) => ancestorOrigins_Getter(mthis);
+  ancestorOrigins_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ancestorOrigins");
 
-  static assign_Callback_0(mthis) native "Location_assign_Callback";
-  assign_Callback_0_(mthis) => assign_Callback_0(mthis);
+  assign_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "assign", []);
 
-  static assign_Callback_1(mthis, __arg_0) native "Location_assign_Callback";
-  assign_Callback_1_(mthis, __arg_0) => assign_Callback_1(mthis, __arg_0);
+  assign_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "assign", [__arg_0]);
 
-  static assign_Callback_2(mthis, __arg_0, __arg_1) native "Location_assign_Callback";
-  assign_Callback_2_(mthis, __arg_0, __arg_1) => assign_Callback_2(mthis, __arg_0, __arg_1);
+  hash_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "hash");
 
-  static assign_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Location_assign_Callback";
-  assign_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => assign_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  hash_Setter_(mthis, __arg_0) => mthis["hash"] = __arg_0;
 
-  static hash_Getter(mthis) native "Location_hash_Getter";
-  hash_Getter_(mthis) => hash_Getter(mthis);
+  host_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "host");
 
-  static hash_Setter(mthis, __arg_0) native "Location_hash_Setter";
-  hash_Setter_(mthis, __arg_0) => hash_Setter(mthis, __arg_0);
+  host_Setter_(mthis, __arg_0) => mthis["host"] = __arg_0;
 
-  static host_Getter(mthis) native "Location_host_Getter";
-  host_Getter_(mthis) => host_Getter(mthis);
+  hostname_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "hostname");
 
-  static host_Setter(mthis, __arg_0) native "Location_host_Setter";
-  host_Setter_(mthis, __arg_0) => host_Setter(mthis, __arg_0);
+  hostname_Setter_(mthis, __arg_0) => mthis["hostname"] = __arg_0;
 
-  static hostname_Getter(mthis) native "Location_hostname_Getter";
-  hostname_Getter_(mthis) => hostname_Getter(mthis);
+  href_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "href");
 
-  static hostname_Setter(mthis, __arg_0) native "Location_hostname_Setter";
-  hostname_Setter_(mthis, __arg_0) => hostname_Setter(mthis, __arg_0);
+  href_Setter_(mthis, __arg_0) => mthis["href"] = __arg_0;
 
-  static href_Getter(mthis) native "Location_href_Getter";
-  href_Getter_(mthis) => href_Getter(mthis);
+  origin_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "origin");
 
-  static href_Setter(mthis, __arg_0) native "Location_href_Setter";
-  href_Setter_(mthis, __arg_0) => href_Setter(mthis, __arg_0);
+  pathname_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "pathname");
 
-  static origin_Getter(mthis) native "Location_origin_Getter";
-  origin_Getter_(mthis) => origin_Getter(mthis);
+  pathname_Setter_(mthis, __arg_0) => mthis["pathname"] = __arg_0;
 
-  static pathname_Getter(mthis) native "Location_pathname_Getter";
-  pathname_Getter_(mthis) => pathname_Getter(mthis);
+  port_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "port");
 
-  static pathname_Setter(mthis, __arg_0) native "Location_pathname_Setter";
-  pathname_Setter_(mthis, __arg_0) => pathname_Setter(mthis, __arg_0);
+  port_Setter_(mthis, __arg_0) => mthis["port"] = __arg_0;
 
-  static port_Getter(mthis) native "Location_port_Getter";
-  port_Getter_(mthis) => port_Getter(mthis);
+  protocol_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "protocol");
 
-  static port_Setter(mthis, __arg_0) native "Location_port_Setter";
-  port_Setter_(mthis, __arg_0) => port_Setter(mthis, __arg_0);
+  protocol_Setter_(mthis, __arg_0) => mthis["protocol"] = __arg_0;
 
-  static protocol_Getter(mthis) native "Location_protocol_Getter";
-  protocol_Getter_(mthis) => protocol_Getter(mthis);
+  reload_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "reload", []);
 
-  static protocol_Setter(mthis, __arg_0) native "Location_protocol_Setter";
-  protocol_Setter_(mthis, __arg_0) => protocol_Setter(mthis, __arg_0);
+  replace_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "replace", []);
 
-  static reload_Callback_0(mthis) native "Location_reload_Callback";
-  reload_Callback_0_(mthis) => reload_Callback_0(mthis);
+  replace_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "replace", [__arg_0]);
 
-  static reload_Callback_1(mthis, __arg_0) native "Location_reload_Callback";
-  reload_Callback_1_(mthis, __arg_0) => reload_Callback_1(mthis, __arg_0);
+  search_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "search");
 
-  static reload_Callback_2(mthis, __arg_0, __arg_1) native "Location_reload_Callback";
-  reload_Callback_2_(mthis, __arg_0, __arg_1) => reload_Callback_2(mthis, __arg_0, __arg_1);
+  search_Setter_(mthis, __arg_0) => mthis["search"] = __arg_0;
 
-  static replace_Callback_0(mthis) native "Location_replace_Callback";
-  replace_Callback_0_(mthis) => replace_Callback_0(mthis);
-
-  static replace_Callback_1(mthis, __arg_0) native "Location_replace_Callback";
-  replace_Callback_1_(mthis, __arg_0) => replace_Callback_1(mthis, __arg_0);
-
-  static replace_Callback_2(mthis, __arg_0, __arg_1) native "Location_replace_Callback";
-  replace_Callback_2_(mthis, __arg_0, __arg_1) => replace_Callback_2(mthis, __arg_0, __arg_1);
-
-  static replace_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Location_replace_Callback";
-  replace_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => replace_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static search_Getter(mthis) native "Location_search_Getter";
-  search_Getter_(mthis) => search_Getter(mthis);
-
-  static search_Setter(mthis, __arg_0) native "Location_search_Setter";
-  search_Setter_(mthis, __arg_0) => search_Setter(mthis, __arg_0);
-
-  static toString_Callback_0(mthis) native "Location_toString_Callback";
-  toString_Callback_0_(mthis) => toString_Callback_0(mthis);
-
-  static toString_Callback_1(mthis, __arg_0) native "Location_toString_Callback";
-  toString_Callback_1_(mthis, __arg_0) => toString_Callback_1(mthis, __arg_0);
-
-  static toString_Callback_2(mthis, __arg_0, __arg_1) native "Location_toString_Callback";
-  toString_Callback_2_(mthis, __arg_0, __arg_1) => toString_Callback_2(mthis, __arg_0, __arg_1);
+  toString_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "toString", []);
 
 }
 
 class BlinkMIDIAccess extends BlinkEventTarget {
   static final instance = new BlinkMIDIAccess();
 
-  static inputs_Getter(mthis) native "MIDIAccess_inputs_Getter";
-  inputs_Getter_(mthis) => inputs_Getter(mthis);
+  inputs_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "inputs");
 
-  static onconnect_Getter(mthis) native "MIDIAccess_onconnect_Getter";
-  onconnect_Getter_(mthis) => onconnect_Getter(mthis);
+  onconnect_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onconnect");
 
-  static onconnect_Setter(mthis, __arg_0) native "MIDIAccess_onconnect_Setter";
-  onconnect_Setter_(mthis, __arg_0) => onconnect_Setter(mthis, __arg_0);
+  onconnect_Setter_(mthis, __arg_0) => mthis["onconnect"] = __arg_0;
 
-  static ondisconnect_Getter(mthis) native "MIDIAccess_ondisconnect_Getter";
-  ondisconnect_Getter_(mthis) => ondisconnect_Getter(mthis);
+  ondisconnect_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ondisconnect");
 
-  static ondisconnect_Setter(mthis, __arg_0) native "MIDIAccess_ondisconnect_Setter";
-  ondisconnect_Setter_(mthis, __arg_0) => ondisconnect_Setter(mthis, __arg_0);
+  ondisconnect_Setter_(mthis, __arg_0) => mthis["ondisconnect"] = __arg_0;
 
-  static outputs_Getter(mthis) native "MIDIAccess_outputs_Getter";
-  outputs_Getter_(mthis) => outputs_Getter(mthis);
+  outputs_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "outputs");
 
-  static sysexEnabled_Getter(mthis) native "MIDIAccess_sysexEnabled_Getter";
-  sysexEnabled_Getter_(mthis) => sysexEnabled_Getter(mthis);
+  sysexEnabled_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "sysexEnabled");
 
 }
 
 class BlinkMIDIConnectionEvent extends BlinkEvent {
   static final instance = new BlinkMIDIConnectionEvent();
 
-  static constructorCallback_2(__arg_0, __arg_1) native "MIDIConnectionEvent_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  constructorCallback_2_(__arg_0, __arg_1) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "MIDIConnectionEvent"), [__arg_0, __arg_1]);
 
-  static port_Getter(mthis) native "MIDIConnectionEvent_port_Getter";
-  port_Getter_(mthis) => port_Getter(mthis);
+  port_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "port");
 
 }
 
 class BlinkMIDIInput extends BlinkMIDIPort {
   static final instance = new BlinkMIDIInput();
 
-  static onmidimessage_Getter(mthis) native "MIDIInput_onmidimessage_Getter";
-  onmidimessage_Getter_(mthis) => onmidimessage_Getter(mthis);
+  onmidimessage_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onmidimessage");
 
-  static onmidimessage_Setter(mthis, __arg_0) native "MIDIInput_onmidimessage_Setter";
-  onmidimessage_Setter_(mthis, __arg_0) => onmidimessage_Setter(mthis, __arg_0);
+  onmidimessage_Setter_(mthis, __arg_0) => mthis["onmidimessage"] = __arg_0;
 
 }
 
 class BlinkMIDIInputMap {
   static final instance = new BlinkMIDIInputMap();
 
-  static entries_Callback_0(mthis) native "MIDIInputMap_entries_Callback";
-  entries_Callback_0_(mthis) => entries_Callback_0(mthis);
+  entries_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "entries", []);
 
-  static entries_Callback_1(mthis, __arg_0) native "MIDIInputMap_entries_Callback";
-  entries_Callback_1_(mthis, __arg_0) => entries_Callback_1(mthis, __arg_0);
+  get_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "get", []);
 
-  static entries_Callback_2(mthis, __arg_0, __arg_1) native "MIDIInputMap_entries_Callback";
-  entries_Callback_2_(mthis, __arg_0, __arg_1) => entries_Callback_2(mthis, __arg_0, __arg_1);
+  get_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "get", [__arg_0]);
 
-  static get_Callback_0(mthis) native "MIDIInputMap_get_Callback";
-  get_Callback_0_(mthis) => get_Callback_0(mthis);
+  has_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "has", []);
 
-  static get_Callback_1(mthis, __arg_0) native "MIDIInputMap_get_Callback";
-  get_Callback_1_(mthis, __arg_0) => get_Callback_1(mthis, __arg_0);
+  has_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "has", [__arg_0]);
 
-  static get_Callback_2(mthis, __arg_0, __arg_1) native "MIDIInputMap_get_Callback";
-  get_Callback_2_(mthis, __arg_0, __arg_1) => get_Callback_2(mthis, __arg_0, __arg_1);
+  keys_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "keys", []);
 
-  static get_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "MIDIInputMap_get_Callback";
-  get_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => get_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  size_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "size");
 
-  static has_Callback_0(mthis) native "MIDIInputMap_has_Callback";
-  has_Callback_0_(mthis) => has_Callback_0(mthis);
-
-  static has_Callback_1(mthis, __arg_0) native "MIDIInputMap_has_Callback";
-  has_Callback_1_(mthis, __arg_0) => has_Callback_1(mthis, __arg_0);
-
-  static has_Callback_2(mthis, __arg_0, __arg_1) native "MIDIInputMap_has_Callback";
-  has_Callback_2_(mthis, __arg_0, __arg_1) => has_Callback_2(mthis, __arg_0, __arg_1);
-
-  static has_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "MIDIInputMap_has_Callback";
-  has_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => has_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static keys_Callback_0(mthis) native "MIDIInputMap_keys_Callback";
-  keys_Callback_0_(mthis) => keys_Callback_0(mthis);
-
-  static keys_Callback_1(mthis, __arg_0) native "MIDIInputMap_keys_Callback";
-  keys_Callback_1_(mthis, __arg_0) => keys_Callback_1(mthis, __arg_0);
-
-  static keys_Callback_2(mthis, __arg_0, __arg_1) native "MIDIInputMap_keys_Callback";
-  keys_Callback_2_(mthis, __arg_0, __arg_1) => keys_Callback_2(mthis, __arg_0, __arg_1);
-
-  static size_Getter(mthis) native "MIDIInputMap_size_Getter";
-  size_Getter_(mthis) => size_Getter(mthis);
-
-  static values_Callback_0(mthis) native "MIDIInputMap_values_Callback";
-  values_Callback_0_(mthis) => values_Callback_0(mthis);
-
-  static values_Callback_1(mthis, __arg_0) native "MIDIInputMap_values_Callback";
-  values_Callback_1_(mthis, __arg_0) => values_Callback_1(mthis, __arg_0);
-
-  static values_Callback_2(mthis, __arg_0, __arg_1) native "MIDIInputMap_values_Callback";
-  values_Callback_2_(mthis, __arg_0, __arg_1) => values_Callback_2(mthis, __arg_0, __arg_1);
+  values_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "values", []);
 
 }
 
 class BlinkMIDIMessageEvent extends BlinkEvent {
   static final instance = new BlinkMIDIMessageEvent();
 
-  static constructorCallback_2(__arg_0, __arg_1) native "MIDIMessageEvent_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  constructorCallback_2_(__arg_0, __arg_1) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "MIDIMessageEvent"), [__arg_0, __arg_1]);
 
-  static data_Getter(mthis) native "MIDIMessageEvent_data_Getter";
-  data_Getter_(mthis) => data_Getter(mthis);
+  data_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "data");
 
-  static receivedTime_Getter(mthis) native "MIDIMessageEvent_receivedTime_Getter";
-  receivedTime_Getter_(mthis) => receivedTime_Getter(mthis);
+  receivedTime_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "receivedTime");
 
 }
 
 class BlinkMIDIOutput extends BlinkMIDIPort {
   static final instance = new BlinkMIDIOutput();
 
-  static send_Callback_0(mthis) native "MIDIOutput_send_Callback";
-  send_Callback_0_(mthis) => send_Callback_0(mthis);
+  send_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "send", []);
 
-  static send_Callback_1(mthis, __arg_0) native "MIDIOutput_send_Callback";
-  send_Callback_1_(mthis, __arg_0) => send_Callback_1(mthis, __arg_0);
+  send_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "send", [__arg_0]);
 
-  static send_Callback_2(mthis, __arg_0, __arg_1) native "MIDIOutput_send_Callback";
-  send_Callback_2_(mthis, __arg_0, __arg_1) => send_Callback_2(mthis, __arg_0, __arg_1);
-
-  static send_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "MIDIOutput_send_Callback";
-  send_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => send_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static send_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "MIDIOutput_send_Callback";
-  send_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => send_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  send_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "send", [__arg_0, __arg_1]);
 
 }
 
 class BlinkMIDIOutputMap {
   static final instance = new BlinkMIDIOutputMap();
 
-  static entries_Callback_0(mthis) native "MIDIOutputMap_entries_Callback";
-  entries_Callback_0_(mthis) => entries_Callback_0(mthis);
+  entries_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "entries", []);
 
-  static entries_Callback_1(mthis, __arg_0) native "MIDIOutputMap_entries_Callback";
-  entries_Callback_1_(mthis, __arg_0) => entries_Callback_1(mthis, __arg_0);
+  get_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "get", []);
 
-  static entries_Callback_2(mthis, __arg_0, __arg_1) native "MIDIOutputMap_entries_Callback";
-  entries_Callback_2_(mthis, __arg_0, __arg_1) => entries_Callback_2(mthis, __arg_0, __arg_1);
+  get_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "get", [__arg_0]);
 
-  static get_Callback_0(mthis) native "MIDIOutputMap_get_Callback";
-  get_Callback_0_(mthis) => get_Callback_0(mthis);
+  has_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "has", []);
 
-  static get_Callback_1(mthis, __arg_0) native "MIDIOutputMap_get_Callback";
-  get_Callback_1_(mthis, __arg_0) => get_Callback_1(mthis, __arg_0);
+  has_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "has", [__arg_0]);
 
-  static get_Callback_2(mthis, __arg_0, __arg_1) native "MIDIOutputMap_get_Callback";
-  get_Callback_2_(mthis, __arg_0, __arg_1) => get_Callback_2(mthis, __arg_0, __arg_1);
+  keys_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "keys", []);
 
-  static get_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "MIDIOutputMap_get_Callback";
-  get_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => get_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  size_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "size");
 
-  static has_Callback_0(mthis) native "MIDIOutputMap_has_Callback";
-  has_Callback_0_(mthis) => has_Callback_0(mthis);
-
-  static has_Callback_1(mthis, __arg_0) native "MIDIOutputMap_has_Callback";
-  has_Callback_1_(mthis, __arg_0) => has_Callback_1(mthis, __arg_0);
-
-  static has_Callback_2(mthis, __arg_0, __arg_1) native "MIDIOutputMap_has_Callback";
-  has_Callback_2_(mthis, __arg_0, __arg_1) => has_Callback_2(mthis, __arg_0, __arg_1);
-
-  static has_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "MIDIOutputMap_has_Callback";
-  has_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => has_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static keys_Callback_0(mthis) native "MIDIOutputMap_keys_Callback";
-  keys_Callback_0_(mthis) => keys_Callback_0(mthis);
-
-  static keys_Callback_1(mthis, __arg_0) native "MIDIOutputMap_keys_Callback";
-  keys_Callback_1_(mthis, __arg_0) => keys_Callback_1(mthis, __arg_0);
-
-  static keys_Callback_2(mthis, __arg_0, __arg_1) native "MIDIOutputMap_keys_Callback";
-  keys_Callback_2_(mthis, __arg_0, __arg_1) => keys_Callback_2(mthis, __arg_0, __arg_1);
-
-  static size_Getter(mthis) native "MIDIOutputMap_size_Getter";
-  size_Getter_(mthis) => size_Getter(mthis);
-
-  static values_Callback_0(mthis) native "MIDIOutputMap_values_Callback";
-  values_Callback_0_(mthis) => values_Callback_0(mthis);
-
-  static values_Callback_1(mthis, __arg_0) native "MIDIOutputMap_values_Callback";
-  values_Callback_1_(mthis, __arg_0) => values_Callback_1(mthis, __arg_0);
-
-  static values_Callback_2(mthis, __arg_0, __arg_1) native "MIDIOutputMap_values_Callback";
-  values_Callback_2_(mthis, __arg_0, __arg_1) => values_Callback_2(mthis, __arg_0, __arg_1);
+  values_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "values", []);
 
 }
 
 class BlinkMIDIPort extends BlinkEventTarget {
   static final instance = new BlinkMIDIPort();
 
-  static id_Getter(mthis) native "MIDIPort_id_Getter";
-  id_Getter_(mthis) => id_Getter(mthis);
+  id_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "id");
 
-  static manufacturer_Getter(mthis) native "MIDIPort_manufacturer_Getter";
-  manufacturer_Getter_(mthis) => manufacturer_Getter(mthis);
+  manufacturer_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "manufacturer");
 
-  static name_Getter(mthis) native "MIDIPort_name_Getter";
-  name_Getter_(mthis) => name_Getter(mthis);
+  name_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "name");
 
-  static ondisconnect_Getter(mthis) native "MIDIPort_ondisconnect_Getter";
-  ondisconnect_Getter_(mthis) => ondisconnect_Getter(mthis);
+  ondisconnect_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ondisconnect");
 
-  static ondisconnect_Setter(mthis, __arg_0) native "MIDIPort_ondisconnect_Setter";
-  ondisconnect_Setter_(mthis, __arg_0) => ondisconnect_Setter(mthis, __arg_0);
+  ondisconnect_Setter_(mthis, __arg_0) => mthis["ondisconnect"] = __arg_0;
 
-  static type_Getter(mthis) native "MIDIPort_type_Getter";
-  type_Getter_(mthis) => type_Getter(mthis);
+  type_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "type");
 
-  static version_Getter(mthis) native "MIDIPort_version_Getter";
-  version_Getter_(mthis) => version_Getter(mthis);
+  version_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "version");
 
 }
 
 class BlinkMediaController extends BlinkEventTarget {
   static final instance = new BlinkMediaController();
 
-  static buffered_Getter(mthis) native "MediaController_buffered_Getter";
-  buffered_Getter_(mthis) => buffered_Getter(mthis);
+  buffered_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "buffered");
 
-  static constructorCallback_0() native "MediaController_constructorCallback";
-  constructorCallback_0_() => constructorCallback_0();
+  constructorCallback_0_() => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "MediaController"), []);
 
-  static constructorCallback_1(__arg_0) native "MediaController_constructorCallback";
-  constructorCallback_1_(__arg_0) => constructorCallback_1(__arg_0);
+  currentTime_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "currentTime");
 
-  static constructorCallback_2(__arg_0, __arg_1) native "MediaController_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  currentTime_Setter_(mthis, __arg_0) => mthis["currentTime"] = __arg_0;
 
-  static currentTime_Getter(mthis) native "MediaController_currentTime_Getter";
-  currentTime_Getter_(mthis) => currentTime_Getter(mthis);
+  defaultPlaybackRate_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "defaultPlaybackRate");
 
-  static currentTime_Setter(mthis, __arg_0) native "MediaController_currentTime_Setter";
-  currentTime_Setter_(mthis, __arg_0) => currentTime_Setter(mthis, __arg_0);
+  defaultPlaybackRate_Setter_(mthis, __arg_0) => mthis["defaultPlaybackRate"] = __arg_0;
 
-  static defaultPlaybackRate_Getter(mthis) native "MediaController_defaultPlaybackRate_Getter";
-  defaultPlaybackRate_Getter_(mthis) => defaultPlaybackRate_Getter(mthis);
+  duration_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "duration");
 
-  static defaultPlaybackRate_Setter(mthis, __arg_0) native "MediaController_defaultPlaybackRate_Setter";
-  defaultPlaybackRate_Setter_(mthis, __arg_0) => defaultPlaybackRate_Setter(mthis, __arg_0);
+  muted_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "muted");
 
-  static duration_Getter(mthis) native "MediaController_duration_Getter";
-  duration_Getter_(mthis) => duration_Getter(mthis);
+  muted_Setter_(mthis, __arg_0) => mthis["muted"] = __arg_0;
 
-  static muted_Getter(mthis) native "MediaController_muted_Getter";
-  muted_Getter_(mthis) => muted_Getter(mthis);
+  pause_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "pause", []);
 
-  static muted_Setter(mthis, __arg_0) native "MediaController_muted_Setter";
-  muted_Setter_(mthis, __arg_0) => muted_Setter(mthis, __arg_0);
+  paused_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "paused");
 
-  static pause_Callback_0(mthis) native "MediaController_pause_Callback";
-  pause_Callback_0_(mthis) => pause_Callback_0(mthis);
+  play_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "play", []);
 
-  static pause_Callback_1(mthis, __arg_0) native "MediaController_pause_Callback";
-  pause_Callback_1_(mthis, __arg_0) => pause_Callback_1(mthis, __arg_0);
+  playbackRate_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "playbackRate");
 
-  static pause_Callback_2(mthis, __arg_0, __arg_1) native "MediaController_pause_Callback";
-  pause_Callback_2_(mthis, __arg_0, __arg_1) => pause_Callback_2(mthis, __arg_0, __arg_1);
+  playbackRate_Setter_(mthis, __arg_0) => mthis["playbackRate"] = __arg_0;
 
-  static paused_Getter(mthis) native "MediaController_paused_Getter";
-  paused_Getter_(mthis) => paused_Getter(mthis);
+  playbackState_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "playbackState");
 
-  static play_Callback_0(mthis) native "MediaController_play_Callback";
-  play_Callback_0_(mthis) => play_Callback_0(mthis);
+  played_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "played");
 
-  static play_Callback_1(mthis, __arg_0) native "MediaController_play_Callback";
-  play_Callback_1_(mthis, __arg_0) => play_Callback_1(mthis, __arg_0);
+  seekable_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "seekable");
 
-  static play_Callback_2(mthis, __arg_0, __arg_1) native "MediaController_play_Callback";
-  play_Callback_2_(mthis, __arg_0, __arg_1) => play_Callback_2(mthis, __arg_0, __arg_1);
+  unpause_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "unpause", []);
 
-  static playbackRate_Getter(mthis) native "MediaController_playbackRate_Getter";
-  playbackRate_Getter_(mthis) => playbackRate_Getter(mthis);
+  volume_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "volume");
 
-  static playbackRate_Setter(mthis, __arg_0) native "MediaController_playbackRate_Setter";
-  playbackRate_Setter_(mthis, __arg_0) => playbackRate_Setter(mthis, __arg_0);
-
-  static playbackState_Getter(mthis) native "MediaController_playbackState_Getter";
-  playbackState_Getter_(mthis) => playbackState_Getter(mthis);
-
-  static played_Getter(mthis) native "MediaController_played_Getter";
-  played_Getter_(mthis) => played_Getter(mthis);
-
-  static seekable_Getter(mthis) native "MediaController_seekable_Getter";
-  seekable_Getter_(mthis) => seekable_Getter(mthis);
-
-  static unpause_Callback_0(mthis) native "MediaController_unpause_Callback";
-  unpause_Callback_0_(mthis) => unpause_Callback_0(mthis);
-
-  static unpause_Callback_1(mthis, __arg_0) native "MediaController_unpause_Callback";
-  unpause_Callback_1_(mthis, __arg_0) => unpause_Callback_1(mthis, __arg_0);
-
-  static unpause_Callback_2(mthis, __arg_0, __arg_1) native "MediaController_unpause_Callback";
-  unpause_Callback_2_(mthis, __arg_0, __arg_1) => unpause_Callback_2(mthis, __arg_0, __arg_1);
-
-  static volume_Getter(mthis) native "MediaController_volume_Getter";
-  volume_Getter_(mthis) => volume_Getter(mthis);
-
-  static volume_Setter(mthis, __arg_0) native "MediaController_volume_Setter";
-  volume_Setter_(mthis, __arg_0) => volume_Setter(mthis, __arg_0);
+  volume_Setter_(mthis, __arg_0) => mthis["volume"] = __arg_0;
 
 }
 
 class BlinkMediaDeviceInfo {
   static final instance = new BlinkMediaDeviceInfo();
 
-  static deviceId_Getter(mthis) native "MediaDeviceInfo_deviceId_Getter";
-  deviceId_Getter_(mthis) => deviceId_Getter(mthis);
+  deviceId_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "deviceId");
 
-  static groupId_Getter(mthis) native "MediaDeviceInfo_groupId_Getter";
-  groupId_Getter_(mthis) => groupId_Getter(mthis);
+  groupId_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "groupId");
 
-  static kind_Getter(mthis) native "MediaDeviceInfo_kind_Getter";
-  kind_Getter_(mthis) => kind_Getter(mthis);
+  kind_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "kind");
 
-  static label_Getter(mthis) native "MediaDeviceInfo_label_Getter";
-  label_Getter_(mthis) => label_Getter(mthis);
+  label_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "label");
 
 }
 
 class BlinkMediaElementAudioSourceNode extends BlinkAudioSourceNode {
   static final instance = new BlinkMediaElementAudioSourceNode();
 
-  static mediaElement_Getter(mthis) native "MediaElementAudioSourceNode_mediaElement_Getter";
-  mediaElement_Getter_(mthis) => mediaElement_Getter(mthis);
+  mediaElement_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "mediaElement");
 
 }
 
 class BlinkMediaError {
   static final instance = new BlinkMediaError();
 
-  static code_Getter(mthis) native "MediaError_code_Getter";
-  code_Getter_(mthis) => code_Getter(mthis);
+  code_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "code");
 
 }
 
 class BlinkMediaKeyError {
   static final instance = new BlinkMediaKeyError();
 
-  static code_Getter(mthis) native "MediaKeyError_code_Getter";
-  code_Getter_(mthis) => code_Getter(mthis);
+  code_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "code");
 
-  static systemCode_Getter(mthis) native "MediaKeyError_systemCode_Getter";
-  systemCode_Getter_(mthis) => systemCode_Getter(mthis);
+  systemCode_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "systemCode");
 
 }
 
 class BlinkMediaKeyEvent extends BlinkEvent {
   static final instance = new BlinkMediaKeyEvent();
 
-  static constructorCallback_2(__arg_0, __arg_1) native "MediaKeyEvent_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  constructorCallback_2_(__arg_0, __arg_1) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "MediaKeyEvent"), [__arg_0, __arg_1]);
 
-  static defaultURL_Getter(mthis) native "MediaKeyEvent_defaultURL_Getter";
-  defaultURL_Getter_(mthis) => defaultURL_Getter(mthis);
+  defaultURL_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "defaultURL");
 
-  static errorCode_Getter(mthis) native "MediaKeyEvent_errorCode_Getter";
-  errorCode_Getter_(mthis) => errorCode_Getter(mthis);
+  errorCode_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "errorCode");
 
-  static initData_Getter(mthis) native "MediaKeyEvent_initData_Getter";
-  initData_Getter_(mthis) => initData_Getter(mthis);
+  initData_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "initData");
 
-  static keySystem_Getter(mthis) native "MediaKeyEvent_keySystem_Getter";
-  keySystem_Getter_(mthis) => keySystem_Getter(mthis);
+  keySystem_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "keySystem");
 
-  static message_Getter(mthis) native "MediaKeyEvent_message_Getter";
-  message_Getter_(mthis) => message_Getter(mthis);
+  message_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "message");
 
-  static sessionId_Getter(mthis) native "MediaKeyEvent_sessionId_Getter";
-  sessionId_Getter_(mthis) => sessionId_Getter(mthis);
+  sessionId_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "sessionId");
 
-  static systemCode_Getter(mthis) native "MediaKeyEvent_systemCode_Getter";
-  systemCode_Getter_(mthis) => systemCode_Getter(mthis);
+  systemCode_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "systemCode");
 
 }
 
 class BlinkMediaKeyMessageEvent extends BlinkEvent {
   static final instance = new BlinkMediaKeyMessageEvent();
 
-  static constructorCallback_2(__arg_0, __arg_1) native "MediaKeyMessageEvent_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  constructorCallback_2_(__arg_0, __arg_1) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "MediaKeyMessageEvent"), [__arg_0, __arg_1]);
 
-  static destinationURL_Getter(mthis) native "MediaKeyMessageEvent_destinationURL_Getter";
-  destinationURL_Getter_(mthis) => destinationURL_Getter(mthis);
+  destinationURL_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "destinationURL");
 
-  static message_Getter(mthis) native "MediaKeyMessageEvent_message_Getter";
-  message_Getter_(mthis) => message_Getter(mthis);
+  message_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "message");
 
 }
 
 class BlinkMediaKeyNeededEvent extends BlinkEvent {
   static final instance = new BlinkMediaKeyNeededEvent();
 
-  static constructorCallback_2(__arg_0, __arg_1) native "MediaKeyNeededEvent_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  constructorCallback_2_(__arg_0, __arg_1) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "MediaKeyNeededEvent"), [__arg_0, __arg_1]);
 
-  static contentType_Getter(mthis) native "MediaKeyNeededEvent_contentType_Getter";
-  contentType_Getter_(mthis) => contentType_Getter(mthis);
+  contentType_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "contentType");
 
-  static initData_Getter(mthis) native "MediaKeyNeededEvent_initData_Getter";
-  initData_Getter_(mthis) => initData_Getter(mthis);
+  initData_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "initData");
 
 }
 
 class BlinkMediaKeySession extends BlinkEventTarget {
   static final instance = new BlinkMediaKeySession();
 
-  static closed_Getter(mthis) native "MediaKeySession_closed_Getter";
-  closed_Getter_(mthis) => closed_Getter(mthis);
+  closed_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "closed");
 
-  static error_Getter(mthis) native "MediaKeySession_error_Getter";
-  error_Getter_(mthis) => error_Getter(mthis);
+  error_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "error");
 
-  static generateRequest_Callback_0(mthis) native "MediaKeySession_generateRequest_Callback";
-  generateRequest_Callback_0_(mthis) => generateRequest_Callback_0(mthis);
+  generateRequest_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "generateRequest", []);
 
-  static generateRequest_Callback_1(mthis, __arg_0) native "MediaKeySession_generateRequest_Callback";
-  generateRequest_Callback_1_(mthis, __arg_0) => generateRequest_Callback_1(mthis, __arg_0);
+  generateRequest_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "generateRequest", [__arg_0]);
 
-  static generateRequest_Callback_2(mthis, __arg_0, __arg_1) native "MediaKeySession_generateRequest_Callback";
-  generateRequest_Callback_2_(mthis, __arg_0, __arg_1) => generateRequest_Callback_2(mthis, __arg_0, __arg_1);
+  generateRequest_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "generateRequest", [__arg_0, __arg_1]);
 
-  static generateRequest_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "MediaKeySession_generateRequest_Callback";
-  generateRequest_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => generateRequest_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  keySystem_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "keySystem");
 
-  static generateRequest_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "MediaKeySession_generateRequest_Callback";
-  generateRequest_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => generateRequest_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  release_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "release", []);
 
-  static keySystem_Getter(mthis) native "MediaKeySession_keySystem_Getter";
-  keySystem_Getter_(mthis) => keySystem_Getter(mthis);
+  sessionId_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "sessionId");
 
-  static release_Callback_0(mthis) native "MediaKeySession_release_Callback";
-  release_Callback_0_(mthis) => release_Callback_0(mthis);
+  update_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "update", []);
 
-  static release_Callback_1(mthis, __arg_0) native "MediaKeySession_release_Callback";
-  release_Callback_1_(mthis, __arg_0) => release_Callback_1(mthis, __arg_0);
-
-  static release_Callback_2(mthis, __arg_0, __arg_1) native "MediaKeySession_release_Callback";
-  release_Callback_2_(mthis, __arg_0, __arg_1) => release_Callback_2(mthis, __arg_0, __arg_1);
-
-  static sessionId_Getter(mthis) native "MediaKeySession_sessionId_Getter";
-  sessionId_Getter_(mthis) => sessionId_Getter(mthis);
-
-  static update_Callback_0(mthis) native "MediaKeySession_update_Callback";
-  update_Callback_0_(mthis) => update_Callback_0(mthis);
-
-  static update_Callback_1(mthis, __arg_0) native "MediaKeySession_update_Callback";
-  update_Callback_1_(mthis, __arg_0) => update_Callback_1(mthis, __arg_0);
-
-  static update_Callback_2(mthis, __arg_0, __arg_1) native "MediaKeySession_update_Callback";
-  update_Callback_2_(mthis, __arg_0, __arg_1) => update_Callback_2(mthis, __arg_0, __arg_1);
-
-  static update_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "MediaKeySession_update_Callback";
-  update_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => update_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  update_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "update", [__arg_0]);
 
 }
 
 class BlinkMediaKeys {
   static final instance = new BlinkMediaKeys();
 
-  static createSession_Callback_0(mthis) native "MediaKeys_createSession_Callback";
-  createSession_Callback_0_(mthis) => createSession_Callback_0(mthis);
+  createSession_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createSession", []);
 
-  static createSession_Callback_1(mthis, __arg_0) native "MediaKeys_createSession_Callback";
-  createSession_Callback_1_(mthis, __arg_0) => createSession_Callback_1(mthis, __arg_0);
+  createSession_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "createSession", [__arg_0]);
 
-  static createSession_Callback_2(mthis, __arg_0, __arg_1) native "MediaKeys_createSession_Callback";
-  createSession_Callback_2_(mthis, __arg_0, __arg_1) => createSession_Callback_2(mthis, __arg_0, __arg_1);
+  create_Callback_0_() => Blink_JsNative_DomException.callMethod(Blink_JsNative_DomException.getProperty(js.context, "MediaKeys"), "create", []);
 
-  static createSession_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "MediaKeys_createSession_Callback";
-  createSession_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => createSession_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  create_Callback_1_(__arg_0) => Blink_JsNative_DomException.callMethod(Blink_JsNative_DomException.getProperty(js.context, "MediaKeys"), "create", [__arg_0]);
 
-  static create_Callback_0() native "MediaKeys_create_Callback";
-  create_Callback_0_() => create_Callback_0();
+  isTypeSupported_Callback_0_() => Blink_JsNative_DomException.callMethod(Blink_JsNative_DomException.getProperty(js.context, "MediaKeys"), "isTypeSupported", []);
 
-  static create_Callback_1(__arg_0) native "MediaKeys_create_Callback";
-  create_Callback_1_(__arg_0) => create_Callback_1(__arg_0);
+  isTypeSupported_Callback_1_(__arg_0) => Blink_JsNative_DomException.callMethod(Blink_JsNative_DomException.getProperty(js.context, "MediaKeys"), "isTypeSupported", [__arg_0]);
 
-  static create_Callback_2(__arg_0, __arg_1) native "MediaKeys_create_Callback";
-  create_Callback_2_(__arg_0, __arg_1) => create_Callback_2(__arg_0, __arg_1);
+  isTypeSupported_Callback_2_(__arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(Blink_JsNative_DomException.getProperty(js.context, "MediaKeys"), "isTypeSupported", [__arg_0, __arg_1]);
 
-  static create_Callback_3(__arg_0, __arg_1, __arg_2) native "MediaKeys_create_Callback";
-  create_Callback_3_(__arg_0, __arg_1, __arg_2) => create_Callback_3(__arg_0, __arg_1, __arg_2);
-
-  static isTypeSupported_Callback_0() native "MediaKeys_isTypeSupported_Callback";
-  isTypeSupported_Callback_0_() => isTypeSupported_Callback_0();
-
-  static isTypeSupported_Callback_1(__arg_0) native "MediaKeys_isTypeSupported_Callback";
-  isTypeSupported_Callback_1_(__arg_0) => isTypeSupported_Callback_1(__arg_0);
-
-  static isTypeSupported_Callback_2(__arg_0, __arg_1) native "MediaKeys_isTypeSupported_Callback";
-  isTypeSupported_Callback_2_(__arg_0, __arg_1) => isTypeSupported_Callback_2(__arg_0, __arg_1);
-
-  static isTypeSupported_Callback_3(__arg_0, __arg_1, __arg_2) native "MediaKeys_isTypeSupported_Callback";
-  isTypeSupported_Callback_3_(__arg_0, __arg_1, __arg_2) => isTypeSupported_Callback_3(__arg_0, __arg_1, __arg_2);
-
-  static isTypeSupported_Callback_4(__arg_0, __arg_1, __arg_2, __arg_3) native "MediaKeys_isTypeSupported_Callback";
-  isTypeSupported_Callback_4_(__arg_0, __arg_1, __arg_2, __arg_3) => isTypeSupported_Callback_4(__arg_0, __arg_1, __arg_2, __arg_3);
-
-  static keySystem_Getter(mthis) native "MediaKeys_keySystem_Getter";
-  keySystem_Getter_(mthis) => keySystem_Getter(mthis);
+  keySystem_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "keySystem");
 
 }
 
 class BlinkMediaList {
   static final instance = new BlinkMediaList();
 
-  static $__getter___Callback_1(mthis, __arg_0) native "MediaList___getter___Callback";
-  $__getter___Callback_1_(mthis, __arg_0) => $__getter___Callback_1(mthis, __arg_0);
+  $__getter___Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "__getter__", [__arg_0]);
 
-  static appendMedium_Callback_0(mthis) native "MediaList_appendMedium_Callback";
-  appendMedium_Callback_0_(mthis) => appendMedium_Callback_0(mthis);
+  appendMedium_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "appendMedium", []);
 
-  static appendMedium_Callback_1(mthis, __arg_0) native "MediaList_appendMedium_Callback";
-  appendMedium_Callback_1_(mthis, __arg_0) => appendMedium_Callback_1(mthis, __arg_0);
+  appendMedium_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "appendMedium", [__arg_0]);
 
-  static appendMedium_Callback_2(mthis, __arg_0, __arg_1) native "MediaList_appendMedium_Callback";
-  appendMedium_Callback_2_(mthis, __arg_0, __arg_1) => appendMedium_Callback_2(mthis, __arg_0, __arg_1);
+  deleteMedium_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "deleteMedium", []);
 
-  static appendMedium_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "MediaList_appendMedium_Callback";
-  appendMedium_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => appendMedium_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  deleteMedium_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "deleteMedium", [__arg_0]);
 
-  static deleteMedium_Callback_0(mthis) native "MediaList_deleteMedium_Callback";
-  deleteMedium_Callback_0_(mthis) => deleteMedium_Callback_0(mthis);
+  item_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "item", []);
 
-  static deleteMedium_Callback_1(mthis, __arg_0) native "MediaList_deleteMedium_Callback";
-  deleteMedium_Callback_1_(mthis, __arg_0) => deleteMedium_Callback_1(mthis, __arg_0);
+  item_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "item", [__arg_0]);
 
-  static deleteMedium_Callback_2(mthis, __arg_0, __arg_1) native "MediaList_deleteMedium_Callback";
-  deleteMedium_Callback_2_(mthis, __arg_0, __arg_1) => deleteMedium_Callback_2(mthis, __arg_0, __arg_1);
+  length_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "length");
 
-  static deleteMedium_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "MediaList_deleteMedium_Callback";
-  deleteMedium_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => deleteMedium_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  mediaText_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "mediaText");
 
-  static item_Callback_0(mthis) native "MediaList_item_Callback";
-  item_Callback_0_(mthis) => item_Callback_0(mthis);
-
-  static item_Callback_1(mthis, __arg_0) native "MediaList_item_Callback";
-  item_Callback_1_(mthis, __arg_0) => item_Callback_1(mthis, __arg_0);
-
-  static item_Callback_2(mthis, __arg_0, __arg_1) native "MediaList_item_Callback";
-  item_Callback_2_(mthis, __arg_0, __arg_1) => item_Callback_2(mthis, __arg_0, __arg_1);
-
-  static item_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "MediaList_item_Callback";
-  item_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => item_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static length_Getter(mthis) native "MediaList_length_Getter";
-  length_Getter_(mthis) => length_Getter(mthis);
-
-  static mediaText_Getter(mthis) native "MediaList_mediaText_Getter";
-  mediaText_Getter_(mthis) => mediaText_Getter(mthis);
-
-  static mediaText_Setter(mthis, __arg_0) native "MediaList_mediaText_Setter";
-  mediaText_Setter_(mthis, __arg_0) => mediaText_Setter(mthis, __arg_0);
+  mediaText_Setter_(mthis, __arg_0) => mthis["mediaText"] = __arg_0;
 
 }
 
 class BlinkMediaQueryList extends BlinkEventTarget {
   static final instance = new BlinkMediaQueryList();
 
-  static addListener_Callback_0(mthis) native "MediaQueryList_addListener_Callback";
-  addListener_Callback_0_(mthis) => addListener_Callback_0(mthis);
+  addListener_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "addListener", []);
 
-  static addListener_Callback_1(mthis, __arg_0) native "MediaQueryList_addListener_Callback";
-  addListener_Callback_1_(mthis, __arg_0) => addListener_Callback_1(mthis, __arg_0);
+  addListener_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "addListener", [__arg_0]);
 
-  static addListener_Callback_2(mthis, __arg_0, __arg_1) native "MediaQueryList_addListener_Callback";
-  addListener_Callback_2_(mthis, __arg_0, __arg_1) => addListener_Callback_2(mthis, __arg_0, __arg_1);
+  matches_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "matches");
 
-  static addListener_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "MediaQueryList_addListener_Callback";
-  addListener_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => addListener_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  media_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "media");
 
-  static matches_Getter(mthis) native "MediaQueryList_matches_Getter";
-  matches_Getter_(mthis) => matches_Getter(mthis);
+  onchange_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onchange");
 
-  static media_Getter(mthis) native "MediaQueryList_media_Getter";
-  media_Getter_(mthis) => media_Getter(mthis);
+  onchange_Setter_(mthis, __arg_0) => mthis["onchange"] = __arg_0;
 
-  static onchange_Getter(mthis) native "MediaQueryList_onchange_Getter";
-  onchange_Getter_(mthis) => onchange_Getter(mthis);
+  removeListener_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "removeListener", []);
 
-  static onchange_Setter(mthis, __arg_0) native "MediaQueryList_onchange_Setter";
-  onchange_Setter_(mthis, __arg_0) => onchange_Setter(mthis, __arg_0);
-
-  static removeListener_Callback_0(mthis) native "MediaQueryList_removeListener_Callback";
-  removeListener_Callback_0_(mthis) => removeListener_Callback_0(mthis);
-
-  static removeListener_Callback_1(mthis, __arg_0) native "MediaQueryList_removeListener_Callback";
-  removeListener_Callback_1_(mthis, __arg_0) => removeListener_Callback_1(mthis, __arg_0);
-
-  static removeListener_Callback_2(mthis, __arg_0, __arg_1) native "MediaQueryList_removeListener_Callback";
-  removeListener_Callback_2_(mthis, __arg_0, __arg_1) => removeListener_Callback_2(mthis, __arg_0, __arg_1);
-
-  static removeListener_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "MediaQueryList_removeListener_Callback";
-  removeListener_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => removeListener_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  removeListener_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "removeListener", [__arg_0]);
 
 }
 
 class BlinkMediaQueryListEvent extends BlinkEvent {
   static final instance = new BlinkMediaQueryListEvent();
 
-  static constructorCallback_2(__arg_0, __arg_1) native "MediaQueryListEvent_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  constructorCallback_2_(__arg_0, __arg_1) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "MediaQueryListEvent"), [__arg_0, __arg_1]);
 
-  static matches_Getter(mthis) native "MediaQueryListEvent_matches_Getter";
-  matches_Getter_(mthis) => matches_Getter(mthis);
+  matches_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "matches");
 
-  static media_Getter(mthis) native "MediaQueryListEvent_media_Getter";
-  media_Getter_(mthis) => media_Getter(mthis);
+  media_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "media");
 
 }
 
 class BlinkMediaSource extends BlinkEventTarget {
   static final instance = new BlinkMediaSource();
 
-  static activeSourceBuffers_Getter(mthis) native "MediaSource_activeSourceBuffers_Getter";
-  activeSourceBuffers_Getter_(mthis) => activeSourceBuffers_Getter(mthis);
+  activeSourceBuffers_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "activeSourceBuffers");
 
-  static addSourceBuffer_Callback_0(mthis) native "MediaSource_addSourceBuffer_Callback";
-  addSourceBuffer_Callback_0_(mthis) => addSourceBuffer_Callback_0(mthis);
+  addSourceBuffer_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "addSourceBuffer", []);
 
-  static addSourceBuffer_Callback_1(mthis, __arg_0) native "MediaSource_addSourceBuffer_Callback";
-  addSourceBuffer_Callback_1_(mthis, __arg_0) => addSourceBuffer_Callback_1(mthis, __arg_0);
+  addSourceBuffer_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "addSourceBuffer", [__arg_0]);
 
-  static addSourceBuffer_Callback_2(mthis, __arg_0, __arg_1) native "MediaSource_addSourceBuffer_Callback";
-  addSourceBuffer_Callback_2_(mthis, __arg_0, __arg_1) => addSourceBuffer_Callback_2(mthis, __arg_0, __arg_1);
+  constructorCallback_0_() => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "MediaSource"), []);
 
-  static addSourceBuffer_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "MediaSource_addSourceBuffer_Callback";
-  addSourceBuffer_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => addSourceBuffer_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  duration_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "duration");
 
-  static constructorCallback_0() native "MediaSource_constructorCallback";
-  constructorCallback_0_() => constructorCallback_0();
+  duration_Setter_(mthis, __arg_0) => mthis["duration"] = __arg_0;
 
-  static constructorCallback_1(__arg_0) native "MediaSource_constructorCallback";
-  constructorCallback_1_(__arg_0) => constructorCallback_1(__arg_0);
+  endOfStream_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "endOfStream", []);
 
-  static constructorCallback_2(__arg_0, __arg_1) native "MediaSource_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  endOfStream_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "endOfStream", [__arg_0]);
 
-  static duration_Getter(mthis) native "MediaSource_duration_Getter";
-  duration_Getter_(mthis) => duration_Getter(mthis);
+  isTypeSupported_Callback_0_() => Blink_JsNative_DomException.callMethod(Blink_JsNative_DomException.getProperty(js.context, "MediaSource"), "isTypeSupported", []);
 
-  static duration_Setter(mthis, __arg_0) native "MediaSource_duration_Setter";
-  duration_Setter_(mthis, __arg_0) => duration_Setter(mthis, __arg_0);
+  isTypeSupported_Callback_1_(__arg_0) => Blink_JsNative_DomException.callMethod(Blink_JsNative_DomException.getProperty(js.context, "MediaSource"), "isTypeSupported", [__arg_0]);
 
-  static endOfStream_Callback_0(mthis) native "MediaSource_endOfStream_Callback";
-  endOfStream_Callback_0_(mthis) => endOfStream_Callback_0(mthis);
+  readyState_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "readyState");
 
-  static endOfStream_Callback_1(mthis, __arg_0) native "MediaSource_endOfStream_Callback";
-  endOfStream_Callback_1_(mthis, __arg_0) => endOfStream_Callback_1(mthis, __arg_0);
+  removeSourceBuffer_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "removeSourceBuffer", []);
 
-  static endOfStream_Callback_2(mthis, __arg_0, __arg_1) native "MediaSource_endOfStream_Callback";
-  endOfStream_Callback_2_(mthis, __arg_0, __arg_1) => endOfStream_Callback_2(mthis, __arg_0, __arg_1);
+  removeSourceBuffer_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "removeSourceBuffer", [__arg_0]);
 
-  static endOfStream_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "MediaSource_endOfStream_Callback";
-  endOfStream_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => endOfStream_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static isTypeSupported_Callback_0() native "MediaSource_isTypeSupported_Callback";
-  isTypeSupported_Callback_0_() => isTypeSupported_Callback_0();
-
-  static isTypeSupported_Callback_1(__arg_0) native "MediaSource_isTypeSupported_Callback";
-  isTypeSupported_Callback_1_(__arg_0) => isTypeSupported_Callback_1(__arg_0);
-
-  static isTypeSupported_Callback_2(__arg_0, __arg_1) native "MediaSource_isTypeSupported_Callback";
-  isTypeSupported_Callback_2_(__arg_0, __arg_1) => isTypeSupported_Callback_2(__arg_0, __arg_1);
-
-  static isTypeSupported_Callback_3(__arg_0, __arg_1, __arg_2) native "MediaSource_isTypeSupported_Callback";
-  isTypeSupported_Callback_3_(__arg_0, __arg_1, __arg_2) => isTypeSupported_Callback_3(__arg_0, __arg_1, __arg_2);
-
-  static readyState_Getter(mthis) native "MediaSource_readyState_Getter";
-  readyState_Getter_(mthis) => readyState_Getter(mthis);
-
-  static removeSourceBuffer_Callback_0(mthis) native "MediaSource_removeSourceBuffer_Callback";
-  removeSourceBuffer_Callback_0_(mthis) => removeSourceBuffer_Callback_0(mthis);
-
-  static removeSourceBuffer_Callback_1(mthis, __arg_0) native "MediaSource_removeSourceBuffer_Callback";
-  removeSourceBuffer_Callback_1_(mthis, __arg_0) => removeSourceBuffer_Callback_1(mthis, __arg_0);
-
-  static removeSourceBuffer_Callback_2(mthis, __arg_0, __arg_1) native "MediaSource_removeSourceBuffer_Callback";
-  removeSourceBuffer_Callback_2_(mthis, __arg_0, __arg_1) => removeSourceBuffer_Callback_2(mthis, __arg_0, __arg_1);
-
-  static removeSourceBuffer_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "MediaSource_removeSourceBuffer_Callback";
-  removeSourceBuffer_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => removeSourceBuffer_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static sourceBuffers_Getter(mthis) native "MediaSource_sourceBuffers_Getter";
-  sourceBuffers_Getter_(mthis) => sourceBuffers_Getter(mthis);
+  sourceBuffers_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "sourceBuffers");
 
 }
 
 class BlinkMediaStream extends BlinkEventTarget {
   static final instance = new BlinkMediaStream();
 
-  static addTrack_Callback_0(mthis) native "MediaStream_addTrack_Callback";
-  addTrack_Callback_0_(mthis) => addTrack_Callback_0(mthis);
+  addTrack_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "addTrack", []);
 
-  static addTrack_Callback_1(mthis, __arg_0) native "MediaStream_addTrack_Callback";
-  addTrack_Callback_1_(mthis, __arg_0) => addTrack_Callback_1(mthis, __arg_0);
+  addTrack_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "addTrack", [__arg_0]);
 
-  static addTrack_Callback_2(mthis, __arg_0, __arg_1) native "MediaStream_addTrack_Callback";
-  addTrack_Callback_2_(mthis, __arg_0, __arg_1) => addTrack_Callback_2(mthis, __arg_0, __arg_1);
+  clone_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "clone", []);
 
-  static addTrack_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "MediaStream_addTrack_Callback";
-  addTrack_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => addTrack_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  constructorCallback_0_() => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "MediaStream"), []);
 
-  static clone_Callback_0(mthis) native "MediaStream_clone_Callback";
-  clone_Callback_0_(mthis) => clone_Callback_0(mthis);
+  constructorCallback_1_(__arg_0) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "MediaStream"), [__arg_0]);
 
-  static clone_Callback_1(mthis, __arg_0) native "MediaStream_clone_Callback";
-  clone_Callback_1_(mthis, __arg_0) => clone_Callback_1(mthis, __arg_0);
+  ended_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ended");
 
-  static clone_Callback_2(mthis, __arg_0, __arg_1) native "MediaStream_clone_Callback";
-  clone_Callback_2_(mthis, __arg_0, __arg_1) => clone_Callback_2(mthis, __arg_0, __arg_1);
+  getAudioTracks_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getAudioTracks", []);
 
-  static constructorCallback_0() native "MediaStream_constructorCallback";
-  constructorCallback_0_() => constructorCallback_0();
+  getTrackById_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getTrackById", []);
 
-  static constructorCallback_1(__arg_0) native "MediaStream_constructorCallback";
-  constructorCallback_1_(__arg_0) => constructorCallback_1(__arg_0);
+  getTrackById_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getTrackById", [__arg_0]);
 
-  static constructorCallback_2(__arg_0, __arg_1) native "MediaStream_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  getTracks_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getTracks", []);
 
-  static constructorCallback_3(__arg_0, __arg_1, __arg_2) native "MediaStream_constructorCallback";
-  constructorCallback_3_(__arg_0, __arg_1, __arg_2) => constructorCallback_3(__arg_0, __arg_1, __arg_2);
+  getVideoTracks_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getVideoTracks", []);
 
-  static ended_Getter(mthis) native "MediaStream_ended_Getter";
-  ended_Getter_(mthis) => ended_Getter(mthis);
+  id_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "id");
 
-  static getAudioTracks_Callback_0(mthis) native "MediaStream_getAudioTracks_Callback";
-  getAudioTracks_Callback_0_(mthis) => getAudioTracks_Callback_0(mthis);
+  label_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "label");
 
-  static getAudioTracks_Callback_1(mthis, __arg_0) native "MediaStream_getAudioTracks_Callback";
-  getAudioTracks_Callback_1_(mthis, __arg_0) => getAudioTracks_Callback_1(mthis, __arg_0);
+  onaddtrack_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onaddtrack");
 
-  static getAudioTracks_Callback_2(mthis, __arg_0, __arg_1) native "MediaStream_getAudioTracks_Callback";
-  getAudioTracks_Callback_2_(mthis, __arg_0, __arg_1) => getAudioTracks_Callback_2(mthis, __arg_0, __arg_1);
+  onaddtrack_Setter_(mthis, __arg_0) => mthis["onaddtrack"] = __arg_0;
 
-  static getTrackById_Callback_0(mthis) native "MediaStream_getTrackById_Callback";
-  getTrackById_Callback_0_(mthis) => getTrackById_Callback_0(mthis);
+  onended_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onended");
 
-  static getTrackById_Callback_1(mthis, __arg_0) native "MediaStream_getTrackById_Callback";
-  getTrackById_Callback_1_(mthis, __arg_0) => getTrackById_Callback_1(mthis, __arg_0);
+  onended_Setter_(mthis, __arg_0) => mthis["onended"] = __arg_0;
 
-  static getTrackById_Callback_2(mthis, __arg_0, __arg_1) native "MediaStream_getTrackById_Callback";
-  getTrackById_Callback_2_(mthis, __arg_0, __arg_1) => getTrackById_Callback_2(mthis, __arg_0, __arg_1);
+  onremovetrack_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onremovetrack");
 
-  static getTrackById_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "MediaStream_getTrackById_Callback";
-  getTrackById_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getTrackById_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  onremovetrack_Setter_(mthis, __arg_0) => mthis["onremovetrack"] = __arg_0;
 
-  static getTracks_Callback_0(mthis) native "MediaStream_getTracks_Callback";
-  getTracks_Callback_0_(mthis) => getTracks_Callback_0(mthis);
+  removeTrack_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "removeTrack", []);
 
-  static getTracks_Callback_1(mthis, __arg_0) native "MediaStream_getTracks_Callback";
-  getTracks_Callback_1_(mthis, __arg_0) => getTracks_Callback_1(mthis, __arg_0);
+  removeTrack_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "removeTrack", [__arg_0]);
 
-  static getTracks_Callback_2(mthis, __arg_0, __arg_1) native "MediaStream_getTracks_Callback";
-  getTracks_Callback_2_(mthis, __arg_0, __arg_1) => getTracks_Callback_2(mthis, __arg_0, __arg_1);
-
-  static getVideoTracks_Callback_0(mthis) native "MediaStream_getVideoTracks_Callback";
-  getVideoTracks_Callback_0_(mthis) => getVideoTracks_Callback_0(mthis);
-
-  static getVideoTracks_Callback_1(mthis, __arg_0) native "MediaStream_getVideoTracks_Callback";
-  getVideoTracks_Callback_1_(mthis, __arg_0) => getVideoTracks_Callback_1(mthis, __arg_0);
-
-  static getVideoTracks_Callback_2(mthis, __arg_0, __arg_1) native "MediaStream_getVideoTracks_Callback";
-  getVideoTracks_Callback_2_(mthis, __arg_0, __arg_1) => getVideoTracks_Callback_2(mthis, __arg_0, __arg_1);
-
-  static id_Getter(mthis) native "MediaStream_id_Getter";
-  id_Getter_(mthis) => id_Getter(mthis);
-
-  static label_Getter(mthis) native "MediaStream_label_Getter";
-  label_Getter_(mthis) => label_Getter(mthis);
-
-  static onaddtrack_Getter(mthis) native "MediaStream_onaddtrack_Getter";
-  onaddtrack_Getter_(mthis) => onaddtrack_Getter(mthis);
-
-  static onaddtrack_Setter(mthis, __arg_0) native "MediaStream_onaddtrack_Setter";
-  onaddtrack_Setter_(mthis, __arg_0) => onaddtrack_Setter(mthis, __arg_0);
-
-  static onended_Getter(mthis) native "MediaStream_onended_Getter";
-  onended_Getter_(mthis) => onended_Getter(mthis);
-
-  static onended_Setter(mthis, __arg_0) native "MediaStream_onended_Setter";
-  onended_Setter_(mthis, __arg_0) => onended_Setter(mthis, __arg_0);
-
-  static onremovetrack_Getter(mthis) native "MediaStream_onremovetrack_Getter";
-  onremovetrack_Getter_(mthis) => onremovetrack_Getter(mthis);
-
-  static onremovetrack_Setter(mthis, __arg_0) native "MediaStream_onremovetrack_Setter";
-  onremovetrack_Setter_(mthis, __arg_0) => onremovetrack_Setter(mthis, __arg_0);
-
-  static removeTrack_Callback_0(mthis) native "MediaStream_removeTrack_Callback";
-  removeTrack_Callback_0_(mthis) => removeTrack_Callback_0(mthis);
-
-  static removeTrack_Callback_1(mthis, __arg_0) native "MediaStream_removeTrack_Callback";
-  removeTrack_Callback_1_(mthis, __arg_0) => removeTrack_Callback_1(mthis, __arg_0);
-
-  static removeTrack_Callback_2(mthis, __arg_0, __arg_1) native "MediaStream_removeTrack_Callback";
-  removeTrack_Callback_2_(mthis, __arg_0, __arg_1) => removeTrack_Callback_2(mthis, __arg_0, __arg_1);
-
-  static removeTrack_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "MediaStream_removeTrack_Callback";
-  removeTrack_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => removeTrack_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static stop_Callback_0(mthis) native "MediaStream_stop_Callback";
-  stop_Callback_0_(mthis) => stop_Callback_0(mthis);
-
-  static stop_Callback_1(mthis, __arg_0) native "MediaStream_stop_Callback";
-  stop_Callback_1_(mthis, __arg_0) => stop_Callback_1(mthis, __arg_0);
-
-  static stop_Callback_2(mthis, __arg_0, __arg_1) native "MediaStream_stop_Callback";
-  stop_Callback_2_(mthis, __arg_0, __arg_1) => stop_Callback_2(mthis, __arg_0, __arg_1);
+  stop_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "stop", []);
 
 }
 
 class BlinkMediaStreamAudioDestinationNode extends BlinkAudioNode {
   static final instance = new BlinkMediaStreamAudioDestinationNode();
 
-  static stream_Getter(mthis) native "MediaStreamAudioDestinationNode_stream_Getter";
-  stream_Getter_(mthis) => stream_Getter(mthis);
+  stream_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "stream");
 
 }
 
 class BlinkMediaStreamAudioSourceNode extends BlinkAudioSourceNode {
   static final instance = new BlinkMediaStreamAudioSourceNode();
 
-  static mediaStream_Getter(mthis) native "MediaStreamAudioSourceNode_mediaStream_Getter";
-  mediaStream_Getter_(mthis) => mediaStream_Getter(mthis);
+  mediaStream_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "mediaStream");
 
 }
 
 class BlinkMediaStreamEvent extends BlinkEvent {
   static final instance = new BlinkMediaStreamEvent();
 
-  static constructorCallback_2(__arg_0, __arg_1) native "MediaStreamEvent_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  constructorCallback_2_(__arg_0, __arg_1) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "MediaStreamEvent"), [__arg_0, __arg_1]);
 
-  static stream_Getter(mthis) native "MediaStreamEvent_stream_Getter";
-  stream_Getter_(mthis) => stream_Getter(mthis);
+  stream_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "stream");
 
 }
 
 class BlinkMediaStreamTrack extends BlinkEventTarget {
   static final instance = new BlinkMediaStreamTrack();
 
-  static clone_Callback_0(mthis) native "MediaStreamTrack_clone_Callback";
-  clone_Callback_0_(mthis) => clone_Callback_0(mthis);
+  clone_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "clone", []);
 
-  static clone_Callback_1(mthis, __arg_0) native "MediaStreamTrack_clone_Callback";
-  clone_Callback_1_(mthis, __arg_0) => clone_Callback_1(mthis, __arg_0);
+  enabled_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "enabled");
 
-  static clone_Callback_2(mthis, __arg_0, __arg_1) native "MediaStreamTrack_clone_Callback";
-  clone_Callback_2_(mthis, __arg_0, __arg_1) => clone_Callback_2(mthis, __arg_0, __arg_1);
+  enabled_Setter_(mthis, __arg_0) => mthis["enabled"] = __arg_0;
 
-  static enabled_Getter(mthis) native "MediaStreamTrack_enabled_Getter";
-  enabled_Getter_(mthis) => enabled_Getter(mthis);
+  getSources_Callback_0_() => Blink_JsNative_DomException.callMethod(Blink_JsNative_DomException.getProperty(js.context, "MediaStreamTrack"), "getSources", []);
 
-  static enabled_Setter(mthis, __arg_0) native "MediaStreamTrack_enabled_Setter";
-  enabled_Setter_(mthis, __arg_0) => enabled_Setter(mthis, __arg_0);
+  getSources_Callback_1_(__arg_0) => Blink_JsNative_DomException.callMethod(Blink_JsNative_DomException.getProperty(js.context, "MediaStreamTrack"), "getSources", [__arg_0]);
 
-  static getSources_Callback_0() native "MediaStreamTrack_getSources_Callback";
-  getSources_Callback_0_() => getSources_Callback_0();
+  id_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "id");
 
-  static getSources_Callback_1(__arg_0) native "MediaStreamTrack_getSources_Callback";
-  getSources_Callback_1_(__arg_0) => getSources_Callback_1(__arg_0);
+  kind_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "kind");
 
-  static getSources_Callback_2(__arg_0, __arg_1) native "MediaStreamTrack_getSources_Callback";
-  getSources_Callback_2_(__arg_0, __arg_1) => getSources_Callback_2(__arg_0, __arg_1);
+  label_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "label");
 
-  static getSources_Callback_3(__arg_0, __arg_1, __arg_2) native "MediaStreamTrack_getSources_Callback";
-  getSources_Callback_3_(__arg_0, __arg_1, __arg_2) => getSources_Callback_3(__arg_0, __arg_1, __arg_2);
+  muted_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "muted");
 
-  static id_Getter(mthis) native "MediaStreamTrack_id_Getter";
-  id_Getter_(mthis) => id_Getter(mthis);
+  onended_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onended");
 
-  static kind_Getter(mthis) native "MediaStreamTrack_kind_Getter";
-  kind_Getter_(mthis) => kind_Getter(mthis);
+  onended_Setter_(mthis, __arg_0) => mthis["onended"] = __arg_0;
 
-  static label_Getter(mthis) native "MediaStreamTrack_label_Getter";
-  label_Getter_(mthis) => label_Getter(mthis);
+  onmute_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onmute");
 
-  static muted_Getter(mthis) native "MediaStreamTrack_muted_Getter";
-  muted_Getter_(mthis) => muted_Getter(mthis);
+  onmute_Setter_(mthis, __arg_0) => mthis["onmute"] = __arg_0;
 
-  static onended_Getter(mthis) native "MediaStreamTrack_onended_Getter";
-  onended_Getter_(mthis) => onended_Getter(mthis);
+  onunmute_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onunmute");
 
-  static onended_Setter(mthis, __arg_0) native "MediaStreamTrack_onended_Setter";
-  onended_Setter_(mthis, __arg_0) => onended_Setter(mthis, __arg_0);
+  onunmute_Setter_(mthis, __arg_0) => mthis["onunmute"] = __arg_0;
 
-  static onmute_Getter(mthis) native "MediaStreamTrack_onmute_Getter";
-  onmute_Getter_(mthis) => onmute_Getter(mthis);
+  readyState_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "readyState");
 
-  static onmute_Setter(mthis, __arg_0) native "MediaStreamTrack_onmute_Setter";
-  onmute_Setter_(mthis, __arg_0) => onmute_Setter(mthis, __arg_0);
-
-  static onunmute_Getter(mthis) native "MediaStreamTrack_onunmute_Getter";
-  onunmute_Getter_(mthis) => onunmute_Getter(mthis);
-
-  static onunmute_Setter(mthis, __arg_0) native "MediaStreamTrack_onunmute_Setter";
-  onunmute_Setter_(mthis, __arg_0) => onunmute_Setter(mthis, __arg_0);
-
-  static readyState_Getter(mthis) native "MediaStreamTrack_readyState_Getter";
-  readyState_Getter_(mthis) => readyState_Getter(mthis);
-
-  static stop_Callback_0(mthis) native "MediaStreamTrack_stop_Callback";
-  stop_Callback_0_(mthis) => stop_Callback_0(mthis);
-
-  static stop_Callback_1(mthis, __arg_0) native "MediaStreamTrack_stop_Callback";
-  stop_Callback_1_(mthis, __arg_0) => stop_Callback_1(mthis, __arg_0);
-
-  static stop_Callback_2(mthis, __arg_0, __arg_1) native "MediaStreamTrack_stop_Callback";
-  stop_Callback_2_(mthis, __arg_0, __arg_1) => stop_Callback_2(mthis, __arg_0, __arg_1);
+  stop_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "stop", []);
 
 }
 
 class BlinkMediaStreamTrackEvent extends BlinkEvent {
   static final instance = new BlinkMediaStreamTrackEvent();
 
-  static track_Getter(mthis) native "MediaStreamTrackEvent_track_Getter";
-  track_Getter_(mthis) => track_Getter(mthis);
+  track_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "track");
 
 }
 
 class BlinkMemoryInfo {
   static final instance = new BlinkMemoryInfo();
 
-  static jsHeapSizeLimit_Getter(mthis) native "MemoryInfo_jsHeapSizeLimit_Getter";
-  jsHeapSizeLimit_Getter_(mthis) => jsHeapSizeLimit_Getter(mthis);
+  jsHeapSizeLimit_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "jsHeapSizeLimit");
 
-  static totalJSHeapSize_Getter(mthis) native "MemoryInfo_totalJSHeapSize_Getter";
-  totalJSHeapSize_Getter_(mthis) => totalJSHeapSize_Getter(mthis);
+  totalJSHeapSize_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "totalJSHeapSize");
 
-  static usedJSHeapSize_Getter(mthis) native "MemoryInfo_usedJSHeapSize_Getter";
-  usedJSHeapSize_Getter_(mthis) => usedJSHeapSize_Getter(mthis);
+  usedJSHeapSize_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "usedJSHeapSize");
 
 }
 
 class BlinkMessageChannel {
   static final instance = new BlinkMessageChannel();
 
-  static constructorCallback_0() native "MessageChannel_constructorCallback";
-  constructorCallback_0_() => constructorCallback_0();
+  constructorCallback_0_() => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "MessageChannel"), []);
 
-  static constructorCallback_1(__arg_0) native "MessageChannel_constructorCallback";
-  constructorCallback_1_(__arg_0) => constructorCallback_1(__arg_0);
+  port1_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "port1");
 
-  static constructorCallback_2(__arg_0, __arg_1) native "MessageChannel_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
-
-  static port1_Getter(mthis) native "MessageChannel_port1_Getter";
-  port1_Getter_(mthis) => port1_Getter(mthis);
-
-  static port2_Getter(mthis) native "MessageChannel_port2_Getter";
-  port2_Getter_(mthis) => port2_Getter(mthis);
+  port2_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "port2");
 
 }
 
 class BlinkMessageEvent extends BlinkEvent {
   static final instance = new BlinkMessageEvent();
 
-  static constructorCallback_2(__arg_0, __arg_1) native "MessageEvent_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  constructorCallback_2_(__arg_0, __arg_1) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "MessageEvent"), [__arg_0, __arg_1]);
 
-  static data_Getter(mthis) native "MessageEvent_data_Getter";
-  data_Getter_(mthis) => data_Getter(mthis);
+  data_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "data");
 
-  static initMessageEvent_Callback_0(mthis) native "MessageEvent_initMessageEvent_Callback";
-  initMessageEvent_Callback_0_(mthis) => initMessageEvent_Callback_0(mthis);
+  initMessageEvent_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "initMessageEvent", []);
 
-  static initMessageEvent_Callback_1(mthis, __arg_0) native "MessageEvent_initMessageEvent_Callback";
-  initMessageEvent_Callback_1_(mthis, __arg_0) => initMessageEvent_Callback_1(mthis, __arg_0);
+  initMessageEvent_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "initMessageEvent", [__arg_0]);
 
-  static initMessageEvent_Callback_10(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9) native "MessageEvent_initMessageEvent_Callback";
-  initMessageEvent_Callback_10_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9) => initMessageEvent_Callback_10(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9);
+  initMessageEvent_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "initMessageEvent", [__arg_0, __arg_1]);
 
-  static initMessageEvent_Callback_2(mthis, __arg_0, __arg_1) native "MessageEvent_initMessageEvent_Callback";
-  initMessageEvent_Callback_2_(mthis, __arg_0, __arg_1) => initMessageEvent_Callback_2(mthis, __arg_0, __arg_1);
+  initMessageEvent_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "initMessageEvent", [__arg_0, __arg_1, __arg_2]);
 
-  static initMessageEvent_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "MessageEvent_initMessageEvent_Callback";
-  initMessageEvent_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => initMessageEvent_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  initMessageEvent_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "initMessageEvent", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static initMessageEvent_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "MessageEvent_initMessageEvent_Callback";
-  initMessageEvent_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => initMessageEvent_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  initMessageEvent_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => Blink_JsNative_DomException.callMethod(mthis, "initMessageEvent", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4]);
 
-  static initMessageEvent_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "MessageEvent_initMessageEvent_Callback";
-  initMessageEvent_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => initMessageEvent_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  initMessageEvent_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => Blink_JsNative_DomException.callMethod(mthis, "initMessageEvent", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5]);
 
-  static initMessageEvent_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "MessageEvent_initMessageEvent_Callback";
-  initMessageEvent_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => initMessageEvent_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  initMessageEvent_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => Blink_JsNative_DomException.callMethod(mthis, "initMessageEvent", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6]);
 
-  static initMessageEvent_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) native "MessageEvent_initMessageEvent_Callback";
-  initMessageEvent_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => initMessageEvent_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6);
+  initMessageEvent_Callback_8_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) => Blink_JsNative_DomException.callMethod(mthis, "initMessageEvent", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7]);
 
-  static initMessageEvent_Callback_8(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) native "MessageEvent_initMessageEvent_Callback";
-  initMessageEvent_Callback_8_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) => initMessageEvent_Callback_8(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7);
+  lastEventId_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "lastEventId");
 
-  static initMessageEvent_Callback_9(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8) native "MessageEvent_initMessageEvent_Callback";
-  initMessageEvent_Callback_9_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8) => initMessageEvent_Callback_9(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8);
+  origin_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "origin");
 
-  static lastEventId_Getter(mthis) native "MessageEvent_lastEventId_Getter";
-  lastEventId_Getter_(mthis) => lastEventId_Getter(mthis);
-
-  static origin_Getter(mthis) native "MessageEvent_origin_Getter";
-  origin_Getter_(mthis) => origin_Getter(mthis);
-
-  static source_Getter(mthis) native "MessageEvent_source_Getter";
-  source_Getter_(mthis) => source_Getter(mthis);
+  source_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "source");
 
 }
 
 class BlinkMessagePort extends BlinkEventTarget {
   static final instance = new BlinkMessagePort();
 
-  static close_Callback_0(mthis) native "MessagePort_close_Callback";
-  close_Callback_0_(mthis) => close_Callback_0(mthis);
+  close_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "close", []);
 
-  static close_Callback_1(mthis, __arg_0) native "MessagePort_close_Callback";
-  close_Callback_1_(mthis, __arg_0) => close_Callback_1(mthis, __arg_0);
+  onmessage_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onmessage");
 
-  static close_Callback_2(mthis, __arg_0, __arg_1) native "MessagePort_close_Callback";
-  close_Callback_2_(mthis, __arg_0, __arg_1) => close_Callback_2(mthis, __arg_0, __arg_1);
+  onmessage_Setter_(mthis, __arg_0) => mthis["onmessage"] = __arg_0;
 
-  static onmessage_Getter(mthis) native "MessagePort_onmessage_Getter";
-  onmessage_Getter_(mthis) => onmessage_Getter(mthis);
+  postMessage_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "postMessage", []);
 
-  static onmessage_Setter(mthis, __arg_0) native "MessagePort_onmessage_Setter";
-  onmessage_Setter_(mthis, __arg_0) => onmessage_Setter(mthis, __arg_0);
+  postMessage_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "postMessage", [__arg_0]);
 
-  static postMessage_Callback_0(mthis) native "MessagePort_postMessage_Callback";
-  postMessage_Callback_0_(mthis) => postMessage_Callback_0(mthis);
+  postMessage_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "postMessage", [__arg_0, __arg_1]);
 
-  static postMessage_Callback_1(mthis, __arg_0) native "MessagePort_postMessage_Callback";
-  postMessage_Callback_1_(mthis, __arg_0) => postMessage_Callback_1(mthis, __arg_0);
-
-  static postMessage_Callback_2(mthis, __arg_0, __arg_1) native "MessagePort_postMessage_Callback";
-  postMessage_Callback_2_(mthis, __arg_0, __arg_1) => postMessage_Callback_2(mthis, __arg_0, __arg_1);
-
-  static postMessage_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "MessagePort_postMessage_Callback";
-  postMessage_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => postMessage_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static postMessage_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "MessagePort_postMessage_Callback";
-  postMessage_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => postMessage_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static start_Callback_0(mthis) native "MessagePort_start_Callback";
-  start_Callback_0_(mthis) => start_Callback_0(mthis);
-
-  static start_Callback_1(mthis, __arg_0) native "MessagePort_start_Callback";
-  start_Callback_1_(mthis, __arg_0) => start_Callback_1(mthis, __arg_0);
-
-  static start_Callback_2(mthis, __arg_0, __arg_1) native "MessagePort_start_Callback";
-  start_Callback_2_(mthis, __arg_0, __arg_1) => start_Callback_2(mthis, __arg_0, __arg_1);
+  start_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "start", []);
 
 }
 
 class BlinkMetadata {
   static final instance = new BlinkMetadata();
 
-  static modificationTime_Getter(mthis) native "Metadata_modificationTime_Getter";
-  modificationTime_Getter_(mthis) => modificationTime_Getter(mthis);
+  modificationTime_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "modificationTime");
 
-  static size_Getter(mthis) native "Metadata_size_Getter";
-  size_Getter_(mthis) => size_Getter(mthis);
+  size_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "size");
 
 }
 
 class BlinkMimeType {
   static final instance = new BlinkMimeType();
 
-  static description_Getter(mthis) native "MimeType_description_Getter";
-  description_Getter_(mthis) => description_Getter(mthis);
+  description_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "description");
 
-  static enabledPlugin_Getter(mthis) native "MimeType_enabledPlugin_Getter";
-  enabledPlugin_Getter_(mthis) => enabledPlugin_Getter(mthis);
+  enabledPlugin_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "enabledPlugin");
 
-  static suffixes_Getter(mthis) native "MimeType_suffixes_Getter";
-  suffixes_Getter_(mthis) => suffixes_Getter(mthis);
+  suffixes_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "suffixes");
 
-  static type_Getter(mthis) native "MimeType_type_Getter";
-  type_Getter_(mthis) => type_Getter(mthis);
+  type_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "type");
 
 }
 
 class BlinkMimeTypeArray {
   static final instance = new BlinkMimeTypeArray();
 
-  static $__getter___Callback_1(mthis, __arg_0) native "MimeTypeArray___getter___Callback";
-  $__getter___Callback_1_(mthis, __arg_0) => $__getter___Callback_1(mthis, __arg_0);
+  $__getter___Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "__getter__", [__arg_0]);
 
-  static item_Callback_0(mthis) native "MimeTypeArray_item_Callback";
-  item_Callback_0_(mthis) => item_Callback_0(mthis);
+  item_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "item", []);
 
-  static item_Callback_1(mthis, __arg_0) native "MimeTypeArray_item_Callback";
-  item_Callback_1_(mthis, __arg_0) => item_Callback_1(mthis, __arg_0);
+  item_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "item", [__arg_0]);
 
-  static item_Callback_2(mthis, __arg_0, __arg_1) native "MimeTypeArray_item_Callback";
-  item_Callback_2_(mthis, __arg_0, __arg_1) => item_Callback_2(mthis, __arg_0, __arg_1);
+  length_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "length");
 
-  static item_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "MimeTypeArray_item_Callback";
-  item_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => item_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  namedItem_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "namedItem", []);
 
-  static length_Getter(mthis) native "MimeTypeArray_length_Getter";
-  length_Getter_(mthis) => length_Getter(mthis);
-
-  static namedItem_Callback_0(mthis) native "MimeTypeArray_namedItem_Callback";
-  namedItem_Callback_0_(mthis) => namedItem_Callback_0(mthis);
-
-  static namedItem_Callback_1(mthis, __arg_0) native "MimeTypeArray_namedItem_Callback";
-  namedItem_Callback_1_(mthis, __arg_0) => namedItem_Callback_1(mthis, __arg_0);
-
-  static namedItem_Callback_2(mthis, __arg_0, __arg_1) native "MimeTypeArray_namedItem_Callback";
-  namedItem_Callback_2_(mthis, __arg_0, __arg_1) => namedItem_Callback_2(mthis, __arg_0, __arg_1);
-
-  static namedItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "MimeTypeArray_namedItem_Callback";
-  namedItem_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => namedItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  namedItem_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "namedItem", [__arg_0]);
 
 }
 
 class BlinkMouseEvent extends BlinkUIEvent {
   static final instance = new BlinkMouseEvent();
 
-  static altKey_Getter(mthis) native "MouseEvent_altKey_Getter";
-  altKey_Getter_(mthis) => altKey_Getter(mthis);
+  altKey_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "altKey");
 
-  static button_Getter(mthis) native "MouseEvent_button_Getter";
-  button_Getter_(mthis) => button_Getter(mthis);
+  button_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "button");
 
-  static clientX_Getter(mthis) native "MouseEvent_clientX_Getter";
-  clientX_Getter_(mthis) => clientX_Getter(mthis);
+  clientX_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "clientX");
 
-  static clientY_Getter(mthis) native "MouseEvent_clientY_Getter";
-  clientY_Getter_(mthis) => clientY_Getter(mthis);
+  clientY_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "clientY");
 
-  static constructorCallback_2(__arg_0, __arg_1) native "MouseEvent_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  constructorCallback_2_(__arg_0, __arg_1) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "MouseEvent"), [__arg_0, __arg_1]);
 
-  static ctrlKey_Getter(mthis) native "MouseEvent_ctrlKey_Getter";
-  ctrlKey_Getter_(mthis) => ctrlKey_Getter(mthis);
+  ctrlKey_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ctrlKey");
 
-  static dataTransfer_Getter(mthis) native "MouseEvent_dataTransfer_Getter";
-  dataTransfer_Getter_(mthis) => dataTransfer_Getter(mthis);
+  dataTransfer_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "dataTransfer");
 
-  static fromElement_Getter(mthis) native "MouseEvent_fromElement_Getter";
-  fromElement_Getter_(mthis) => fromElement_Getter(mthis);
+  fromElement_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "fromElement");
 
-  static initMouseEvent_Callback_0(mthis) native "MouseEvent_initMouseEvent_Callback";
-  initMouseEvent_Callback_0_(mthis) => initMouseEvent_Callback_0(mthis);
+  initMouseEvent_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "initMouseEvent", []);
 
-  static initMouseEvent_Callback_1(mthis, __arg_0) native "MouseEvent_initMouseEvent_Callback";
-  initMouseEvent_Callback_1_(mthis, __arg_0) => initMouseEvent_Callback_1(mthis, __arg_0);
+  initMouseEvent_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "initMouseEvent", [__arg_0]);
 
-  static initMouseEvent_Callback_10(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9) native "MouseEvent_initMouseEvent_Callback";
-  initMouseEvent_Callback_10_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9) => initMouseEvent_Callback_10(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9);
+  initMouseEvent_Callback_10_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9) => Blink_JsNative_DomException.callMethod(mthis, "initMouseEvent", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9]);
 
-  static initMouseEvent_Callback_11(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10) native "MouseEvent_initMouseEvent_Callback";
-  initMouseEvent_Callback_11_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10) => initMouseEvent_Callback_11(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10);
+  initMouseEvent_Callback_11_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10) => Blink_JsNative_DomException.callMethod(mthis, "initMouseEvent", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10]);
 
-  static initMouseEvent_Callback_12(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10, __arg_11) native "MouseEvent_initMouseEvent_Callback";
-  initMouseEvent_Callback_12_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10, __arg_11) => initMouseEvent_Callback_12(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10, __arg_11);
+  initMouseEvent_Callback_12_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10, __arg_11) => Blink_JsNative_DomException.callMethod(mthis, "initMouseEvent", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10, __arg_11]);
 
-  static initMouseEvent_Callback_13(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10, __arg_11, __arg_12) native "MouseEvent_initMouseEvent_Callback";
-  initMouseEvent_Callback_13_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10, __arg_11, __arg_12) => initMouseEvent_Callback_13(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10, __arg_11, __arg_12);
+  initMouseEvent_Callback_13_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10, __arg_11, __arg_12) => Blink_JsNative_DomException.callMethod(mthis, "initMouseEvent", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10, __arg_11, __arg_12]);
 
-  static initMouseEvent_Callback_14(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10, __arg_11, __arg_12, __arg_13) native "MouseEvent_initMouseEvent_Callback";
-  initMouseEvent_Callback_14_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10, __arg_11, __arg_12, __arg_13) => initMouseEvent_Callback_14(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10, __arg_11, __arg_12, __arg_13);
+  initMouseEvent_Callback_14_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10, __arg_11, __arg_12, __arg_13) => Blink_JsNative_DomException.callMethod(mthis, "initMouseEvent", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10, __arg_11, __arg_12, __arg_13]);
 
-  static initMouseEvent_Callback_15(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10, __arg_11, __arg_12, __arg_13, __arg_14) native "MouseEvent_initMouseEvent_Callback";
-  initMouseEvent_Callback_15_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10, __arg_11, __arg_12, __arg_13, __arg_14) => initMouseEvent_Callback_15(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10, __arg_11, __arg_12, __arg_13, __arg_14);
+  initMouseEvent_Callback_15_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10, __arg_11, __arg_12, __arg_13, __arg_14) => Blink_JsNative_DomException.callMethod(mthis, "initMouseEvent", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10, __arg_11, __arg_12, __arg_13, __arg_14]);
 
-  static initMouseEvent_Callback_16(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10, __arg_11, __arg_12, __arg_13, __arg_14, __arg_15) native "MouseEvent_initMouseEvent_Callback";
-  initMouseEvent_Callback_16_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10, __arg_11, __arg_12, __arg_13, __arg_14, __arg_15) => initMouseEvent_Callback_16(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10, __arg_11, __arg_12, __arg_13, __arg_14, __arg_15);
+  initMouseEvent_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "initMouseEvent", [__arg_0, __arg_1]);
 
-  static initMouseEvent_Callback_17(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10, __arg_11, __arg_12, __arg_13, __arg_14, __arg_15, __arg_16) native "MouseEvent_initMouseEvent_Callback";
-  initMouseEvent_Callback_17_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10, __arg_11, __arg_12, __arg_13, __arg_14, __arg_15, __arg_16) => initMouseEvent_Callback_17(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10, __arg_11, __arg_12, __arg_13, __arg_14, __arg_15, __arg_16);
+  initMouseEvent_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "initMouseEvent", [__arg_0, __arg_1, __arg_2]);
 
-  static initMouseEvent_Callback_2(mthis, __arg_0, __arg_1) native "MouseEvent_initMouseEvent_Callback";
-  initMouseEvent_Callback_2_(mthis, __arg_0, __arg_1) => initMouseEvent_Callback_2(mthis, __arg_0, __arg_1);
+  initMouseEvent_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "initMouseEvent", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static initMouseEvent_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "MouseEvent_initMouseEvent_Callback";
-  initMouseEvent_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => initMouseEvent_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  initMouseEvent_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => Blink_JsNative_DomException.callMethod(mthis, "initMouseEvent", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4]);
 
-  static initMouseEvent_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "MouseEvent_initMouseEvent_Callback";
-  initMouseEvent_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => initMouseEvent_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  initMouseEvent_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => Blink_JsNative_DomException.callMethod(mthis, "initMouseEvent", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5]);
 
-  static initMouseEvent_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "MouseEvent_initMouseEvent_Callback";
-  initMouseEvent_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => initMouseEvent_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  initMouseEvent_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => Blink_JsNative_DomException.callMethod(mthis, "initMouseEvent", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6]);
 
-  static initMouseEvent_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "MouseEvent_initMouseEvent_Callback";
-  initMouseEvent_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => initMouseEvent_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  initMouseEvent_Callback_8_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) => Blink_JsNative_DomException.callMethod(mthis, "initMouseEvent", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7]);
 
-  static initMouseEvent_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) native "MouseEvent_initMouseEvent_Callback";
-  initMouseEvent_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => initMouseEvent_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6);
+  initMouseEvent_Callback_9_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8) => Blink_JsNative_DomException.callMethod(mthis, "initMouseEvent", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8]);
 
-  static initMouseEvent_Callback_8(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) native "MouseEvent_initMouseEvent_Callback";
-  initMouseEvent_Callback_8_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) => initMouseEvent_Callback_8(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7);
+  metaKey_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "metaKey");
 
-  static initMouseEvent_Callback_9(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8) native "MouseEvent_initMouseEvent_Callback";
-  initMouseEvent_Callback_9_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8) => initMouseEvent_Callback_9(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8);
+  movementX_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "movementX");
 
-  static metaKey_Getter(mthis) native "MouseEvent_metaKey_Getter";
-  metaKey_Getter_(mthis) => metaKey_Getter(mthis);
+  movementY_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "movementY");
 
-  static movementX_Getter(mthis) native "MouseEvent_movementX_Getter";
-  movementX_Getter_(mthis) => movementX_Getter(mthis);
+  offsetX_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "offsetX");
 
-  static movementY_Getter(mthis) native "MouseEvent_movementY_Getter";
-  movementY_Getter_(mthis) => movementY_Getter(mthis);
+  offsetY_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "offsetY");
 
-  static offsetX_Getter(mthis) native "MouseEvent_offsetX_Getter";
-  offsetX_Getter_(mthis) => offsetX_Getter(mthis);
+  region_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "region");
 
-  static offsetY_Getter(mthis) native "MouseEvent_offsetY_Getter";
-  offsetY_Getter_(mthis) => offsetY_Getter(mthis);
+  relatedTarget_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "relatedTarget");
 
-  static region_Getter(mthis) native "MouseEvent_region_Getter";
-  region_Getter_(mthis) => region_Getter(mthis);
+  screenX_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "screenX");
 
-  static relatedTarget_Getter(mthis) native "MouseEvent_relatedTarget_Getter";
-  relatedTarget_Getter_(mthis) => relatedTarget_Getter(mthis);
+  screenY_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "screenY");
 
-  static screenX_Getter(mthis) native "MouseEvent_screenX_Getter";
-  screenX_Getter_(mthis) => screenX_Getter(mthis);
+  shiftKey_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "shiftKey");
 
-  static screenY_Getter(mthis) native "MouseEvent_screenY_Getter";
-  screenY_Getter_(mthis) => screenY_Getter(mthis);
+  toElement_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "toElement");
 
-  static shiftKey_Getter(mthis) native "MouseEvent_shiftKey_Getter";
-  shiftKey_Getter_(mthis) => shiftKey_Getter(mthis);
+  webkitMovementX_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "webkitMovementX");
 
-  static toElement_Getter(mthis) native "MouseEvent_toElement_Getter";
-  toElement_Getter_(mthis) => toElement_Getter(mthis);
-
-  static webkitMovementX_Getter(mthis) native "MouseEvent_webkitMovementX_Getter";
-  webkitMovementX_Getter_(mthis) => webkitMovementX_Getter(mthis);
-
-  static webkitMovementY_Getter(mthis) native "MouseEvent_webkitMovementY_Getter";
-  webkitMovementY_Getter_(mthis) => webkitMovementY_Getter(mthis);
+  webkitMovementY_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "webkitMovementY");
 
 }
 
 class BlinkMutationEvent extends BlinkEvent {
   static final instance = new BlinkMutationEvent();
 
-  static attrChange_Getter(mthis) native "MutationEvent_attrChange_Getter";
-  attrChange_Getter_(mthis) => attrChange_Getter(mthis);
+  attrChange_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "attrChange");
 
-  static attrName_Getter(mthis) native "MutationEvent_attrName_Getter";
-  attrName_Getter_(mthis) => attrName_Getter(mthis);
+  attrName_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "attrName");
 
-  static initMutationEvent_Callback_0(mthis) native "MutationEvent_initMutationEvent_Callback";
-  initMutationEvent_Callback_0_(mthis) => initMutationEvent_Callback_0(mthis);
+  initMutationEvent_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "initMutationEvent", []);
 
-  static initMutationEvent_Callback_1(mthis, __arg_0) native "MutationEvent_initMutationEvent_Callback";
-  initMutationEvent_Callback_1_(mthis, __arg_0) => initMutationEvent_Callback_1(mthis, __arg_0);
+  initMutationEvent_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "initMutationEvent", [__arg_0]);
 
-  static initMutationEvent_Callback_10(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9) native "MutationEvent_initMutationEvent_Callback";
-  initMutationEvent_Callback_10_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9) => initMutationEvent_Callback_10(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9);
+  initMutationEvent_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "initMutationEvent", [__arg_0, __arg_1]);
 
-  static initMutationEvent_Callback_2(mthis, __arg_0, __arg_1) native "MutationEvent_initMutationEvent_Callback";
-  initMutationEvent_Callback_2_(mthis, __arg_0, __arg_1) => initMutationEvent_Callback_2(mthis, __arg_0, __arg_1);
+  initMutationEvent_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "initMutationEvent", [__arg_0, __arg_1, __arg_2]);
 
-  static initMutationEvent_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "MutationEvent_initMutationEvent_Callback";
-  initMutationEvent_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => initMutationEvent_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  initMutationEvent_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "initMutationEvent", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static initMutationEvent_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "MutationEvent_initMutationEvent_Callback";
-  initMutationEvent_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => initMutationEvent_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  initMutationEvent_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => Blink_JsNative_DomException.callMethod(mthis, "initMutationEvent", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4]);
 
-  static initMutationEvent_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "MutationEvent_initMutationEvent_Callback";
-  initMutationEvent_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => initMutationEvent_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  initMutationEvent_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => Blink_JsNative_DomException.callMethod(mthis, "initMutationEvent", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5]);
 
-  static initMutationEvent_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "MutationEvent_initMutationEvent_Callback";
-  initMutationEvent_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => initMutationEvent_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  initMutationEvent_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => Blink_JsNative_DomException.callMethod(mthis, "initMutationEvent", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6]);
 
-  static initMutationEvent_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) native "MutationEvent_initMutationEvent_Callback";
-  initMutationEvent_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => initMutationEvent_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6);
+  initMutationEvent_Callback_8_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) => Blink_JsNative_DomException.callMethod(mthis, "initMutationEvent", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7]);
 
-  static initMutationEvent_Callback_8(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) native "MutationEvent_initMutationEvent_Callback";
-  initMutationEvent_Callback_8_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) => initMutationEvent_Callback_8(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7);
+  newValue_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "newValue");
 
-  static initMutationEvent_Callback_9(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8) native "MutationEvent_initMutationEvent_Callback";
-  initMutationEvent_Callback_9_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8) => initMutationEvent_Callback_9(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8);
+  prevValue_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "prevValue");
 
-  static newValue_Getter(mthis) native "MutationEvent_newValue_Getter";
-  newValue_Getter_(mthis) => newValue_Getter(mthis);
-
-  static prevValue_Getter(mthis) native "MutationEvent_prevValue_Getter";
-  prevValue_Getter_(mthis) => prevValue_Getter(mthis);
-
-  static relatedNode_Getter(mthis) native "MutationEvent_relatedNode_Getter";
-  relatedNode_Getter_(mthis) => relatedNode_Getter(mthis);
+  relatedNode_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "relatedNode");
 
 }
 
 class BlinkMutationObserver {
   static final instance = new BlinkMutationObserver();
 
-  static constructorCallback_0() native "MutationObserver_constructorCallback";
-  constructorCallback_0_() => constructorCallback_0();
+  constructorCallback_0_() => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "MutationObserver"), []);
 
-  static constructorCallback_1(__arg_0) native "MutationObserver_constructorCallback";
-  constructorCallback_1_(__arg_0) => constructorCallback_1(__arg_0);
+  constructorCallback_1_(__arg_0) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "MutationObserver"), [__arg_0]);
 
-  static constructorCallback_2(__arg_0, __arg_1) native "MutationObserver_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  disconnect_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "disconnect", []);
 
-  static constructorCallback_3(__arg_0, __arg_1, __arg_2) native "MutationObserver_constructorCallback";
-  constructorCallback_3_(__arg_0, __arg_1, __arg_2) => constructorCallback_3(__arg_0, __arg_1, __arg_2);
+  observe_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "observe", []);
 
-  static disconnect_Callback_0(mthis) native "MutationObserver_disconnect_Callback";
-  disconnect_Callback_0_(mthis) => disconnect_Callback_0(mthis);
+  observe_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "observe", [__arg_0]);
 
-  static disconnect_Callback_1(mthis, __arg_0) native "MutationObserver_disconnect_Callback";
-  disconnect_Callback_1_(mthis, __arg_0) => disconnect_Callback_1(mthis, __arg_0);
+  observe_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "observe", [__arg_0, __arg_1]);
 
-  static disconnect_Callback_2(mthis, __arg_0, __arg_1) native "MutationObserver_disconnect_Callback";
-  disconnect_Callback_2_(mthis, __arg_0, __arg_1) => disconnect_Callback_2(mthis, __arg_0, __arg_1);
-
-  static observe_Callback_0(mthis) native "MutationObserver_observe_Callback";
-  observe_Callback_0_(mthis) => observe_Callback_0(mthis);
-
-  static observe_Callback_1(mthis, __arg_0) native "MutationObserver_observe_Callback";
-  observe_Callback_1_(mthis, __arg_0) => observe_Callback_1(mthis, __arg_0);
-
-  static observe_Callback_2(mthis, __arg_0, __arg_1) native "MutationObserver_observe_Callback";
-  observe_Callback_2_(mthis, __arg_0, __arg_1) => observe_Callback_2(mthis, __arg_0, __arg_1);
-
-  static observe_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "MutationObserver_observe_Callback";
-  observe_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => observe_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static observe_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "MutationObserver_observe_Callback";
-  observe_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => observe_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static takeRecords_Callback_0(mthis) native "MutationObserver_takeRecords_Callback";
-  takeRecords_Callback_0_(mthis) => takeRecords_Callback_0(mthis);
-
-  static takeRecords_Callback_1(mthis, __arg_0) native "MutationObserver_takeRecords_Callback";
-  takeRecords_Callback_1_(mthis, __arg_0) => takeRecords_Callback_1(mthis, __arg_0);
-
-  static takeRecords_Callback_2(mthis, __arg_0, __arg_1) native "MutationObserver_takeRecords_Callback";
-  takeRecords_Callback_2_(mthis, __arg_0, __arg_1) => takeRecords_Callback_2(mthis, __arg_0, __arg_1);
+  takeRecords_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "takeRecords", []);
 
 }
 
 class BlinkMutationRecord {
   static final instance = new BlinkMutationRecord();
 
-  static addedNodes_Getter(mthis) native "MutationRecord_addedNodes_Getter";
-  addedNodes_Getter_(mthis) => addedNodes_Getter(mthis);
+  addedNodes_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "addedNodes");
 
-  static attributeName_Getter(mthis) native "MutationRecord_attributeName_Getter";
-  attributeName_Getter_(mthis) => attributeName_Getter(mthis);
+  attributeName_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "attributeName");
 
-  static attributeNamespace_Getter(mthis) native "MutationRecord_attributeNamespace_Getter";
-  attributeNamespace_Getter_(mthis) => attributeNamespace_Getter(mthis);
+  attributeNamespace_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "attributeNamespace");
 
-  static nextSibling_Getter(mthis) native "MutationRecord_nextSibling_Getter";
-  nextSibling_Getter_(mthis) => nextSibling_Getter(mthis);
+  nextSibling_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "nextSibling");
 
-  static oldValue_Getter(mthis) native "MutationRecord_oldValue_Getter";
-  oldValue_Getter_(mthis) => oldValue_Getter(mthis);
+  oldValue_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "oldValue");
 
-  static previousSibling_Getter(mthis) native "MutationRecord_previousSibling_Getter";
-  previousSibling_Getter_(mthis) => previousSibling_Getter(mthis);
+  previousSibling_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "previousSibling");
 
-  static removedNodes_Getter(mthis) native "MutationRecord_removedNodes_Getter";
-  removedNodes_Getter_(mthis) => removedNodes_Getter(mthis);
+  removedNodes_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "removedNodes");
 
-  static target_Getter(mthis) native "MutationRecord_target_Getter";
-  target_Getter_(mthis) => target_Getter(mthis);
+  target_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "target");
 
-  static type_Getter(mthis) native "MutationRecord_type_Getter";
-  type_Getter_(mthis) => type_Getter(mthis);
+  type_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "type");
 
 }
 
 class BlinkNamedNodeMap {
   static final instance = new BlinkNamedNodeMap();
 
-  static $__getter___Callback_1(mthis, __arg_0) native "NamedNodeMap___getter___Callback";
-  $__getter___Callback_1_(mthis, __arg_0) => $__getter___Callback_1(mthis, __arg_0);
+  $__getter___Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "__getter__", [__arg_0]);
 
-  static getNamedItemNS_Callback_0(mthis) native "NamedNodeMap_getNamedItemNS_Callback";
-  getNamedItemNS_Callback_0_(mthis) => getNamedItemNS_Callback_0(mthis);
+  getNamedItemNS_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getNamedItemNS", []);
 
-  static getNamedItemNS_Callback_1(mthis, __arg_0) native "NamedNodeMap_getNamedItemNS_Callback";
-  getNamedItemNS_Callback_1_(mthis, __arg_0) => getNamedItemNS_Callback_1(mthis, __arg_0);
+  getNamedItemNS_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getNamedItemNS", [__arg_0]);
 
-  static getNamedItemNS_Callback_2(mthis, __arg_0, __arg_1) native "NamedNodeMap_getNamedItemNS_Callback";
-  getNamedItemNS_Callback_2_(mthis, __arg_0, __arg_1) => getNamedItemNS_Callback_2(mthis, __arg_0, __arg_1);
+  getNamedItemNS_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "getNamedItemNS", [__arg_0, __arg_1]);
 
-  static getNamedItemNS_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "NamedNodeMap_getNamedItemNS_Callback";
-  getNamedItemNS_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getNamedItemNS_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  getNamedItem_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getNamedItem", []);
 
-  static getNamedItemNS_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "NamedNodeMap_getNamedItemNS_Callback";
-  getNamedItemNS_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => getNamedItemNS_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  getNamedItem_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getNamedItem", [__arg_0]);
 
-  static getNamedItem_Callback_0(mthis) native "NamedNodeMap_getNamedItem_Callback";
-  getNamedItem_Callback_0_(mthis) => getNamedItem_Callback_0(mthis);
+  item_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "item", []);
 
-  static getNamedItem_Callback_1(mthis, __arg_0) native "NamedNodeMap_getNamedItem_Callback";
-  getNamedItem_Callback_1_(mthis, __arg_0) => getNamedItem_Callback_1(mthis, __arg_0);
+  item_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "item", [__arg_0]);
 
-  static getNamedItem_Callback_2(mthis, __arg_0, __arg_1) native "NamedNodeMap_getNamedItem_Callback";
-  getNamedItem_Callback_2_(mthis, __arg_0, __arg_1) => getNamedItem_Callback_2(mthis, __arg_0, __arg_1);
+  length_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "length");
 
-  static getNamedItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "NamedNodeMap_getNamedItem_Callback";
-  getNamedItem_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getNamedItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  removeNamedItemNS_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "removeNamedItemNS", []);
 
-  static item_Callback_0(mthis) native "NamedNodeMap_item_Callback";
-  item_Callback_0_(mthis) => item_Callback_0(mthis);
+  removeNamedItemNS_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "removeNamedItemNS", [__arg_0]);
 
-  static item_Callback_1(mthis, __arg_0) native "NamedNodeMap_item_Callback";
-  item_Callback_1_(mthis, __arg_0) => item_Callback_1(mthis, __arg_0);
+  removeNamedItemNS_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "removeNamedItemNS", [__arg_0, __arg_1]);
 
-  static item_Callback_2(mthis, __arg_0, __arg_1) native "NamedNodeMap_item_Callback";
-  item_Callback_2_(mthis, __arg_0, __arg_1) => item_Callback_2(mthis, __arg_0, __arg_1);
+  removeNamedItem_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "removeNamedItem", []);
 
-  static item_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "NamedNodeMap_item_Callback";
-  item_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => item_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  removeNamedItem_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "removeNamedItem", [__arg_0]);
 
-  static length_Getter(mthis) native "NamedNodeMap_length_Getter";
-  length_Getter_(mthis) => length_Getter(mthis);
+  setNamedItemNS_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "setNamedItemNS", []);
 
-  static removeNamedItemNS_Callback_0(mthis) native "NamedNodeMap_removeNamedItemNS_Callback";
-  removeNamedItemNS_Callback_0_(mthis) => removeNamedItemNS_Callback_0(mthis);
+  setNamedItemNS_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "setNamedItemNS", [__arg_0]);
 
-  static removeNamedItemNS_Callback_1(mthis, __arg_0) native "NamedNodeMap_removeNamedItemNS_Callback";
-  removeNamedItemNS_Callback_1_(mthis, __arg_0) => removeNamedItemNS_Callback_1(mthis, __arg_0);
+  setNamedItem_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "setNamedItem", []);
 
-  static removeNamedItemNS_Callback_2(mthis, __arg_0, __arg_1) native "NamedNodeMap_removeNamedItemNS_Callback";
-  removeNamedItemNS_Callback_2_(mthis, __arg_0, __arg_1) => removeNamedItemNS_Callback_2(mthis, __arg_0, __arg_1);
-
-  static removeNamedItemNS_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "NamedNodeMap_removeNamedItemNS_Callback";
-  removeNamedItemNS_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => removeNamedItemNS_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static removeNamedItemNS_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "NamedNodeMap_removeNamedItemNS_Callback";
-  removeNamedItemNS_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => removeNamedItemNS_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static removeNamedItem_Callback_0(mthis) native "NamedNodeMap_removeNamedItem_Callback";
-  removeNamedItem_Callback_0_(mthis) => removeNamedItem_Callback_0(mthis);
-
-  static removeNamedItem_Callback_1(mthis, __arg_0) native "NamedNodeMap_removeNamedItem_Callback";
-  removeNamedItem_Callback_1_(mthis, __arg_0) => removeNamedItem_Callback_1(mthis, __arg_0);
-
-  static removeNamedItem_Callback_2(mthis, __arg_0, __arg_1) native "NamedNodeMap_removeNamedItem_Callback";
-  removeNamedItem_Callback_2_(mthis, __arg_0, __arg_1) => removeNamedItem_Callback_2(mthis, __arg_0, __arg_1);
-
-  static removeNamedItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "NamedNodeMap_removeNamedItem_Callback";
-  removeNamedItem_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => removeNamedItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static setNamedItemNS_Callback_0(mthis) native "NamedNodeMap_setNamedItemNS_Callback";
-  setNamedItemNS_Callback_0_(mthis) => setNamedItemNS_Callback_0(mthis);
-
-  static setNamedItemNS_Callback_1(mthis, __arg_0) native "NamedNodeMap_setNamedItemNS_Callback";
-  setNamedItemNS_Callback_1_(mthis, __arg_0) => setNamedItemNS_Callback_1(mthis, __arg_0);
-
-  static setNamedItemNS_Callback_2(mthis, __arg_0, __arg_1) native "NamedNodeMap_setNamedItemNS_Callback";
-  setNamedItemNS_Callback_2_(mthis, __arg_0, __arg_1) => setNamedItemNS_Callback_2(mthis, __arg_0, __arg_1);
-
-  static setNamedItemNS_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "NamedNodeMap_setNamedItemNS_Callback";
-  setNamedItemNS_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => setNamedItemNS_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static setNamedItem_Callback_0(mthis) native "NamedNodeMap_setNamedItem_Callback";
-  setNamedItem_Callback_0_(mthis) => setNamedItem_Callback_0(mthis);
-
-  static setNamedItem_Callback_1(mthis, __arg_0) native "NamedNodeMap_setNamedItem_Callback";
-  setNamedItem_Callback_1_(mthis, __arg_0) => setNamedItem_Callback_1(mthis, __arg_0);
-
-  static setNamedItem_Callback_2(mthis, __arg_0, __arg_1) native "NamedNodeMap_setNamedItem_Callback";
-  setNamedItem_Callback_2_(mthis, __arg_0, __arg_1) => setNamedItem_Callback_2(mthis, __arg_0, __arg_1);
-
-  static setNamedItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "NamedNodeMap_setNamedItem_Callback";
-  setNamedItem_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => setNamedItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  setNamedItem_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "setNamedItem", [__arg_0]);
 
 }
 
 class BlinkNavigator {
   static final instance = new BlinkNavigator();
 
-  static appCodeName_Getter(mthis) native "Navigator_appCodeName_Getter";
-  appCodeName_Getter_(mthis) => appCodeName_Getter(mthis);
+  appCodeName_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "appCodeName");
 
-  static appName_Getter(mthis) native "Navigator_appName_Getter";
-  appName_Getter_(mthis) => appName_Getter(mthis);
+  appName_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "appName");
 
-  static appVersion_Getter(mthis) native "Navigator_appVersion_Getter";
-  appVersion_Getter_(mthis) => appVersion_Getter(mthis);
+  appVersion_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "appVersion");
 
-  static connection_Getter(mthis) native "Navigator_connection_Getter";
-  connection_Getter_(mthis) => connection_Getter(mthis);
+  connection_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "connection");
 
-  static cookieEnabled_Getter(mthis) native "Navigator_cookieEnabled_Getter";
-  cookieEnabled_Getter_(mthis) => cookieEnabled_Getter(mthis);
+  cookieEnabled_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "cookieEnabled");
 
-  static credentials_Getter(mthis) native "Navigator_credentials_Getter";
-  credentials_Getter_(mthis) => credentials_Getter(mthis);
+  credentials_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "credentials");
 
-  static dartEnabled_Getter(mthis) native "Navigator_dartEnabled_Getter";
-  dartEnabled_Getter_(mthis) => dartEnabled_Getter(mthis);
+  dartEnabled_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "dartEnabled");
 
-  static doNotTrack_Getter(mthis) native "Navigator_doNotTrack_Getter";
-  doNotTrack_Getter_(mthis) => doNotTrack_Getter(mthis);
+  doNotTrack_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "doNotTrack");
 
-  static geofencing_Getter(mthis) native "Navigator_geofencing_Getter";
-  geofencing_Getter_(mthis) => geofencing_Getter(mthis);
+  geofencing_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "geofencing");
 
-  static geolocation_Getter(mthis) native "Navigator_geolocation_Getter";
-  geolocation_Getter_(mthis) => geolocation_Getter(mthis);
+  geolocation_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "geolocation");
 
-  static getBattery_Callback_0(mthis) native "Navigator_getBattery_Callback";
-  getBattery_Callback_0_(mthis) => getBattery_Callback_0(mthis);
+  getBattery_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getBattery", []);
 
-  static getBattery_Callback_1(mthis, __arg_0) native "Navigator_getBattery_Callback";
-  getBattery_Callback_1_(mthis, __arg_0) => getBattery_Callback_1(mthis, __arg_0);
+  getGamepads_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getGamepads", []);
 
-  static getBattery_Callback_2(mthis, __arg_0, __arg_1) native "Navigator_getBattery_Callback";
-  getBattery_Callback_2_(mthis, __arg_0, __arg_1) => getBattery_Callback_2(mthis, __arg_0, __arg_1);
+  getStorageUpdates_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getStorageUpdates", []);
 
-  static getGamepads_Callback_0(mthis) native "Navigator_getGamepads_Callback";
-  getGamepads_Callback_0_(mthis) => getGamepads_Callback_0(mthis);
+  hardwareConcurrency_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "hardwareConcurrency");
 
-  static getGamepads_Callback_1(mthis, __arg_0) native "Navigator_getGamepads_Callback";
-  getGamepads_Callback_1_(mthis, __arg_0) => getGamepads_Callback_1(mthis, __arg_0);
+  isProtocolHandlerRegistered_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "isProtocolHandlerRegistered", []);
 
-  static getGamepads_Callback_2(mthis, __arg_0, __arg_1) native "Navigator_getGamepads_Callback";
-  getGamepads_Callback_2_(mthis, __arg_0, __arg_1) => getGamepads_Callback_2(mthis, __arg_0, __arg_1);
+  isProtocolHandlerRegistered_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "isProtocolHandlerRegistered", [__arg_0]);
 
-  static getStorageUpdates_Callback_0(mthis) native "Navigator_getStorageUpdates_Callback";
-  getStorageUpdates_Callback_0_(mthis) => getStorageUpdates_Callback_0(mthis);
+  isProtocolHandlerRegistered_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "isProtocolHandlerRegistered", [__arg_0, __arg_1]);
 
-  static getStorageUpdates_Callback_1(mthis, __arg_0) native "Navigator_getStorageUpdates_Callback";
-  getStorageUpdates_Callback_1_(mthis, __arg_0) => getStorageUpdates_Callback_1(mthis, __arg_0);
+  javaEnabled_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "javaEnabled", []);
 
-  static getStorageUpdates_Callback_2(mthis, __arg_0, __arg_1) native "Navigator_getStorageUpdates_Callback";
-  getStorageUpdates_Callback_2_(mthis, __arg_0, __arg_1) => getStorageUpdates_Callback_2(mthis, __arg_0, __arg_1);
+  language_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "language");
 
-  static hardwareConcurrency_Getter(mthis) native "Navigator_hardwareConcurrency_Getter";
-  hardwareConcurrency_Getter_(mthis) => hardwareConcurrency_Getter(mthis);
+  languages_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "languages");
 
-  static isProtocolHandlerRegistered_Callback_0(mthis) native "Navigator_isProtocolHandlerRegistered_Callback";
-  isProtocolHandlerRegistered_Callback_0_(mthis) => isProtocolHandlerRegistered_Callback_0(mthis);
+  maxTouchPoints_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "maxTouchPoints");
 
-  static isProtocolHandlerRegistered_Callback_1(mthis, __arg_0) native "Navigator_isProtocolHandlerRegistered_Callback";
-  isProtocolHandlerRegistered_Callback_1_(mthis, __arg_0) => isProtocolHandlerRegistered_Callback_1(mthis, __arg_0);
+  mimeTypes_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "mimeTypes");
 
-  static isProtocolHandlerRegistered_Callback_2(mthis, __arg_0, __arg_1) native "Navigator_isProtocolHandlerRegistered_Callback";
-  isProtocolHandlerRegistered_Callback_2_(mthis, __arg_0, __arg_1) => isProtocolHandlerRegistered_Callback_2(mthis, __arg_0, __arg_1);
+  onLine_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onLine");
 
-  static isProtocolHandlerRegistered_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Navigator_isProtocolHandlerRegistered_Callback";
-  isProtocolHandlerRegistered_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => isProtocolHandlerRegistered_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  platform_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "platform");
 
-  static isProtocolHandlerRegistered_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Navigator_isProtocolHandlerRegistered_Callback";
-  isProtocolHandlerRegistered_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => isProtocolHandlerRegistered_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  plugins_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "plugins");
 
-  static javaEnabled_Callback_0(mthis) native "Navigator_javaEnabled_Callback";
-  javaEnabled_Callback_0_(mthis) => javaEnabled_Callback_0(mthis);
+  presentation_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "presentation");
 
-  static javaEnabled_Callback_1(mthis, __arg_0) native "Navigator_javaEnabled_Callback";
-  javaEnabled_Callback_1_(mthis, __arg_0) => javaEnabled_Callback_1(mthis, __arg_0);
+  productSub_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "productSub");
 
-  static javaEnabled_Callback_2(mthis, __arg_0, __arg_1) native "Navigator_javaEnabled_Callback";
-  javaEnabled_Callback_2_(mthis, __arg_0, __arg_1) => javaEnabled_Callback_2(mthis, __arg_0, __arg_1);
+  product_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "product");
 
-  static language_Getter(mthis) native "Navigator_language_Getter";
-  language_Getter_(mthis) => language_Getter(mthis);
+  push_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "push");
 
-  static languages_Getter(mthis) native "Navigator_languages_Getter";
-  languages_Getter_(mthis) => languages_Getter(mthis);
+  registerProtocolHandler_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "registerProtocolHandler", [__arg_0]);
 
-  static maxTouchPoints_Getter(mthis) native "Navigator_maxTouchPoints_Getter";
-  maxTouchPoints_Getter_(mthis) => maxTouchPoints_Getter(mthis);
+  registerProtocolHandler_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "registerProtocolHandler", [__arg_0, __arg_1]);
 
-  static mimeTypes_Getter(mthis) native "Navigator_mimeTypes_Getter";
-  mimeTypes_Getter_(mthis) => mimeTypes_Getter(mthis);
+  registerProtocolHandler_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "registerProtocolHandler", [__arg_0, __arg_1, __arg_2]);
 
-  static onLine_Getter(mthis) native "Navigator_onLine_Getter";
-  onLine_Getter_(mthis) => onLine_Getter(mthis);
+  sendBeacon_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "sendBeacon", []);
 
-  static platform_Getter(mthis) native "Navigator_platform_Getter";
-  platform_Getter_(mthis) => platform_Getter(mthis);
+  sendBeacon_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "sendBeacon", [__arg_0]);
 
-  static plugins_Getter(mthis) native "Navigator_plugins_Getter";
-  plugins_Getter_(mthis) => plugins_Getter(mthis);
+  sendBeacon_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "sendBeacon", [__arg_0, __arg_1]);
 
-  static presentation_Getter(mthis) native "Navigator_presentation_Getter";
-  presentation_Getter_(mthis) => presentation_Getter(mthis);
+  serviceWorker_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "serviceWorker");
 
-  static productSub_Getter(mthis) native "Navigator_productSub_Getter";
-  productSub_Getter_(mthis) => productSub_Getter(mthis);
-
-  static product_Getter(mthis) native "Navigator_product_Getter";
-  product_Getter_(mthis) => product_Getter(mthis);
-
-  static push_Getter(mthis) native "Navigator_push_Getter";
-  push_Getter_(mthis) => push_Getter(mthis);
-
-  static registerProtocolHandler_Callback_1(mthis, __arg_0) native "Navigator_registerProtocolHandler_Callback";
-  registerProtocolHandler_Callback_1_(mthis, __arg_0) => registerProtocolHandler_Callback_1(mthis, __arg_0);
-
-  static registerProtocolHandler_Callback_2(mthis, __arg_0, __arg_1) native "Navigator_registerProtocolHandler_Callback";
-  registerProtocolHandler_Callback_2_(mthis, __arg_0, __arg_1) => registerProtocolHandler_Callback_2(mthis, __arg_0, __arg_1);
-
-  static registerProtocolHandler_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Navigator_registerProtocolHandler_Callback";
-  registerProtocolHandler_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => registerProtocolHandler_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static registerProtocolHandler_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Navigator_registerProtocolHandler_Callback";
-  registerProtocolHandler_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => registerProtocolHandler_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static registerProtocolHandler_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "Navigator_registerProtocolHandler_Callback";
-  registerProtocolHandler_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => registerProtocolHandler_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
-
-  static sendBeacon_Callback_0(mthis) native "Navigator_sendBeacon_Callback";
-  sendBeacon_Callback_0_(mthis) => sendBeacon_Callback_0(mthis);
-
-  static sendBeacon_Callback_1(mthis, __arg_0) native "Navigator_sendBeacon_Callback";
-  sendBeacon_Callback_1_(mthis, __arg_0) => sendBeacon_Callback_1(mthis, __arg_0);
-
-  static sendBeacon_Callback_2(mthis, __arg_0, __arg_1) native "Navigator_sendBeacon_Callback";
-  sendBeacon_Callback_2_(mthis, __arg_0, __arg_1) => sendBeacon_Callback_2(mthis, __arg_0, __arg_1);
-
-  static sendBeacon_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Navigator_sendBeacon_Callback";
-  sendBeacon_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => sendBeacon_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static sendBeacon_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Navigator_sendBeacon_Callback";
-  sendBeacon_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => sendBeacon_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static serviceWorker_Getter(mthis) native "Navigator_serviceWorker_Getter";
-  serviceWorker_Getter_(mthis) => serviceWorker_Getter(mthis);
-
-  static storageQuota_Getter(mthis) native "Navigator_storageQuota_Getter";
-  storageQuota_Getter_(mthis) => storageQuota_Getter(mthis);
-
-  static unregisterProtocolHandler_Callback_0(mthis) native "Navigator_unregisterProtocolHandler_Callback";
-  unregisterProtocolHandler_Callback_0_(mthis) => unregisterProtocolHandler_Callback_0(mthis);
-
-  static unregisterProtocolHandler_Callback_1(mthis, __arg_0) native "Navigator_unregisterProtocolHandler_Callback";
-  unregisterProtocolHandler_Callback_1_(mthis, __arg_0) => unregisterProtocolHandler_Callback_1(mthis, __arg_0);
-
-  static unregisterProtocolHandler_Callback_2(mthis, __arg_0, __arg_1) native "Navigator_unregisterProtocolHandler_Callback";
-  unregisterProtocolHandler_Callback_2_(mthis, __arg_0, __arg_1) => unregisterProtocolHandler_Callback_2(mthis, __arg_0, __arg_1);
-
-  static unregisterProtocolHandler_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Navigator_unregisterProtocolHandler_Callback";
-  unregisterProtocolHandler_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => unregisterProtocolHandler_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static unregisterProtocolHandler_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Navigator_unregisterProtocolHandler_Callback";
-  unregisterProtocolHandler_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => unregisterProtocolHandler_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static userAgent_Getter(mthis) native "Navigator_userAgent_Getter";
-  userAgent_Getter_(mthis) => userAgent_Getter(mthis);
-
-  static vendorSub_Getter(mthis) native "Navigator_vendorSub_Getter";
-  vendorSub_Getter_(mthis) => vendorSub_Getter(mthis);
-
-  static vendor_Getter(mthis) native "Navigator_vendor_Getter";
-  vendor_Getter_(mthis) => vendor_Getter(mthis);
+  storageQuota_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "storageQuota");
 
-  static vibrate_Callback_0(mthis) native "Navigator_vibrate_Callback";
-  vibrate_Callback_0_(mthis) => vibrate_Callback_0(mthis);
+  unregisterProtocolHandler_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "unregisterProtocolHandler", []);
 
-  static vibrate_Callback_1(mthis, __arg_0) native "Navigator_vibrate_Callback";
-  vibrate_Callback_1_(mthis, __arg_0) => vibrate_Callback_1(mthis, __arg_0);
+  unregisterProtocolHandler_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "unregisterProtocolHandler", [__arg_0]);
 
-  static vibrate_Callback_2(mthis, __arg_0, __arg_1) native "Navigator_vibrate_Callback";
-  vibrate_Callback_2_(mthis, __arg_0, __arg_1) => vibrate_Callback_2(mthis, __arg_0, __arg_1);
+  unregisterProtocolHandler_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "unregisterProtocolHandler", [__arg_0, __arg_1]);
 
-  static vibrate_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Navigator_vibrate_Callback";
-  vibrate_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => vibrate_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  userAgent_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "userAgent");
 
-  static webkitGetGamepads_Callback_0(mthis) native "Navigator_webkitGetGamepads_Callback";
-  webkitGetGamepads_Callback_0_(mthis) => webkitGetGamepads_Callback_0(mthis);
+  vendorSub_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "vendorSub");
 
-  static webkitGetGamepads_Callback_1(mthis, __arg_0) native "Navigator_webkitGetGamepads_Callback";
-  webkitGetGamepads_Callback_1_(mthis, __arg_0) => webkitGetGamepads_Callback_1(mthis, __arg_0);
+  vendor_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "vendor");
 
-  static webkitGetGamepads_Callback_2(mthis, __arg_0, __arg_1) native "Navigator_webkitGetGamepads_Callback";
-  webkitGetGamepads_Callback_2_(mthis, __arg_0, __arg_1) => webkitGetGamepads_Callback_2(mthis, __arg_0, __arg_1);
+  vibrate_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "vibrate", []);
 
-  static webkitGetUserMedia_Callback_1(mthis, __arg_0) native "Navigator_webkitGetUserMedia_Callback";
-  webkitGetUserMedia_Callback_1_(mthis, __arg_0) => webkitGetUserMedia_Callback_1(mthis, __arg_0);
+  vibrate_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "vibrate", [__arg_0]);
 
-  static webkitGetUserMedia_Callback_2(mthis, __arg_0, __arg_1) native "Navigator_webkitGetUserMedia_Callback";
-  webkitGetUserMedia_Callback_2_(mthis, __arg_0, __arg_1) => webkitGetUserMedia_Callback_2(mthis, __arg_0, __arg_1);
+  webkitGetGamepads_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "webkitGetGamepads", []);
 
-  static webkitGetUserMedia_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Navigator_webkitGetUserMedia_Callback";
-  webkitGetUserMedia_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => webkitGetUserMedia_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  webkitGetUserMedia_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "webkitGetUserMedia", [__arg_0]);
 
-  static webkitGetUserMedia_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Navigator_webkitGetUserMedia_Callback";
-  webkitGetUserMedia_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => webkitGetUserMedia_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  webkitGetUserMedia_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "webkitGetUserMedia", [__arg_0, __arg_1]);
 
-  static webkitGetUserMedia_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "Navigator_webkitGetUserMedia_Callback";
-  webkitGetUserMedia_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => webkitGetUserMedia_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  webkitGetUserMedia_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "webkitGetUserMedia", [__arg_0, __arg_1, __arg_2]);
 
-  static webkitPersistentStorage_Getter(mthis) native "Navigator_webkitPersistentStorage_Getter";
-  webkitPersistentStorage_Getter_(mthis) => webkitPersistentStorage_Getter(mthis);
+  webkitPersistentStorage_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "webkitPersistentStorage");
 
-  static webkitTemporaryStorage_Getter(mthis) native "Navigator_webkitTemporaryStorage_Getter";
-  webkitTemporaryStorage_Getter_(mthis) => webkitTemporaryStorage_Getter(mthis);
+  webkitTemporaryStorage_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "webkitTemporaryStorage");
 
 }
 
 class BlinkNavigatorUserMediaError {
   static final instance = new BlinkNavigatorUserMediaError();
 
-  static constraintName_Getter(mthis) native "NavigatorUserMediaError_constraintName_Getter";
-  constraintName_Getter_(mthis) => constraintName_Getter(mthis);
+  constraintName_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "constraintName");
 
-  static message_Getter(mthis) native "NavigatorUserMediaError_message_Getter";
-  message_Getter_(mthis) => message_Getter(mthis);
+  message_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "message");
 
-  static name_Getter(mthis) native "NavigatorUserMediaError_name_Getter";
-  name_Getter_(mthis) => name_Getter(mthis);
+  name_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "name");
 
 }
 
 class BlinkNetworkInformation extends BlinkEventTarget {
   static final instance = new BlinkNetworkInformation();
 
-  static ontypechange_Getter(mthis) native "NetworkInformation_ontypechange_Getter";
-  ontypechange_Getter_(mthis) => ontypechange_Getter(mthis);
+  ontypechange_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ontypechange");
 
-  static ontypechange_Setter(mthis, __arg_0) native "NetworkInformation_ontypechange_Setter";
-  ontypechange_Setter_(mthis, __arg_0) => ontypechange_Setter(mthis, __arg_0);
+  ontypechange_Setter_(mthis, __arg_0) => mthis["ontypechange"] = __arg_0;
 
-  static type_Getter(mthis) native "NetworkInformation_type_Getter";
-  type_Getter_(mthis) => type_Getter(mthis);
+  type_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "type");
 
 }
 
 class BlinkNode extends BlinkEventTarget {
   static final instance = new BlinkNode();
 
-  static appendChild_Callback_0(mthis) native "Node_appendChild_Callback";
-  appendChild_Callback_0_(mthis) => appendChild_Callback_0(mthis);
+  appendChild_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "appendChild", []);
 
-  static appendChild_Callback_1(mthis, __arg_0) native "Node_appendChild_Callback";
-  appendChild_Callback_1_(mthis, __arg_0) => appendChild_Callback_1(mthis, __arg_0);
+  appendChild_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "appendChild", [__arg_0]);
 
-  static appendChild_Callback_2(mthis, __arg_0, __arg_1) native "Node_appendChild_Callback";
-  appendChild_Callback_2_(mthis, __arg_0, __arg_1) => appendChild_Callback_2(mthis, __arg_0, __arg_1);
+  baseURI_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "baseURI");
 
-  static appendChild_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Node_appendChild_Callback";
-  appendChild_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => appendChild_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  childNodes_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "childNodes");
 
-  static baseURI_Getter(mthis) native "Node_baseURI_Getter";
-  baseURI_Getter_(mthis) => baseURI_Getter(mthis);
+  cloneNode_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "cloneNode", []);
 
-  static childNodes_Getter(mthis) native "Node_childNodes_Getter";
-  childNodes_Getter_(mthis) => childNodes_Getter(mthis);
+  cloneNode_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "cloneNode", [__arg_0]);
 
-  static cloneNode_Callback_0(mthis) native "Node_cloneNode_Callback";
-  cloneNode_Callback_0_(mthis) => cloneNode_Callback_0(mthis);
+  contains_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "contains", []);
 
-  static cloneNode_Callback_1(mthis, __arg_0) native "Node_cloneNode_Callback";
-  cloneNode_Callback_1_(mthis, __arg_0) => cloneNode_Callback_1(mthis, __arg_0);
+  contains_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "contains", [__arg_0]);
 
-  static cloneNode_Callback_2(mthis, __arg_0, __arg_1) native "Node_cloneNode_Callback";
-  cloneNode_Callback_2_(mthis, __arg_0, __arg_1) => cloneNode_Callback_2(mthis, __arg_0, __arg_1);
+  firstChild_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "firstChild");
 
-  static cloneNode_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Node_cloneNode_Callback";
-  cloneNode_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => cloneNode_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  hasChildNodes_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "hasChildNodes", []);
 
-  static contains_Callback_0(mthis) native "Node_contains_Callback";
-  contains_Callback_0_(mthis) => contains_Callback_0(mthis);
+  insertBefore_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "insertBefore", []);
 
-  static contains_Callback_1(mthis, __arg_0) native "Node_contains_Callback";
-  contains_Callback_1_(mthis, __arg_0) => contains_Callback_1(mthis, __arg_0);
+  insertBefore_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "insertBefore", [__arg_0]);
 
-  static contains_Callback_2(mthis, __arg_0, __arg_1) native "Node_contains_Callback";
-  contains_Callback_2_(mthis, __arg_0, __arg_1) => contains_Callback_2(mthis, __arg_0, __arg_1);
+  insertBefore_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "insertBefore", [__arg_0, __arg_1]);
 
-  static contains_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Node_contains_Callback";
-  contains_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => contains_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  lastChild_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "lastChild");
 
-  static firstChild_Getter(mthis) native "Node_firstChild_Getter";
-  firstChild_Getter_(mthis) => firstChild_Getter(mthis);
+  localName_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "localName");
 
-  static hasChildNodes_Callback_0(mthis) native "Node_hasChildNodes_Callback";
-  hasChildNodes_Callback_0_(mthis) => hasChildNodes_Callback_0(mthis);
+  namespaceURI_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "namespaceURI");
 
-  static hasChildNodes_Callback_1(mthis, __arg_0) native "Node_hasChildNodes_Callback";
-  hasChildNodes_Callback_1_(mthis, __arg_0) => hasChildNodes_Callback_1(mthis, __arg_0);
+  nextSibling_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "nextSibling");
 
-  static hasChildNodes_Callback_2(mthis, __arg_0, __arg_1) native "Node_hasChildNodes_Callback";
-  hasChildNodes_Callback_2_(mthis, __arg_0, __arg_1) => hasChildNodes_Callback_2(mthis, __arg_0, __arg_1);
+  nodeName_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "nodeName");
 
-  static insertBefore_Callback_0(mthis) native "Node_insertBefore_Callback";
-  insertBefore_Callback_0_(mthis) => insertBefore_Callback_0(mthis);
+  nodeType_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "nodeType");
 
-  static insertBefore_Callback_1(mthis, __arg_0) native "Node_insertBefore_Callback";
-  insertBefore_Callback_1_(mthis, __arg_0) => insertBefore_Callback_1(mthis, __arg_0);
+  nodeValue_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "nodeValue");
 
-  static insertBefore_Callback_2(mthis, __arg_0, __arg_1) native "Node_insertBefore_Callback";
-  insertBefore_Callback_2_(mthis, __arg_0, __arg_1) => insertBefore_Callback_2(mthis, __arg_0, __arg_1);
+  nodeValue_Setter_(mthis, __arg_0) => mthis["nodeValue"] = __arg_0;
 
-  static insertBefore_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Node_insertBefore_Callback";
-  insertBefore_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => insertBefore_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  ownerDocument_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ownerDocument");
 
-  static insertBefore_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Node_insertBefore_Callback";
-  insertBefore_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => insertBefore_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  parentElement_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "parentElement");
 
-  static lastChild_Getter(mthis) native "Node_lastChild_Getter";
-  lastChild_Getter_(mthis) => lastChild_Getter(mthis);
+  parentNode_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "parentNode");
 
-  static localName_Getter(mthis) native "Node_localName_Getter";
-  localName_Getter_(mthis) => localName_Getter(mthis);
+  previousSibling_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "previousSibling");
 
-  static namespaceURI_Getter(mthis) native "Node_namespaceURI_Getter";
-  namespaceURI_Getter_(mthis) => namespaceURI_Getter(mthis);
+  removeChild_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "removeChild", []);
 
-  static nextSibling_Getter(mthis) native "Node_nextSibling_Getter";
-  nextSibling_Getter_(mthis) => nextSibling_Getter(mthis);
+  removeChild_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "removeChild", [__arg_0]);
 
-  static nodeName_Getter(mthis) native "Node_nodeName_Getter";
-  nodeName_Getter_(mthis) => nodeName_Getter(mthis);
+  replaceChild_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "replaceChild", []);
 
-  static nodeType_Getter(mthis) native "Node_nodeType_Getter";
-  nodeType_Getter_(mthis) => nodeType_Getter(mthis);
+  replaceChild_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "replaceChild", [__arg_0]);
 
-  static nodeValue_Getter(mthis) native "Node_nodeValue_Getter";
-  nodeValue_Getter_(mthis) => nodeValue_Getter(mthis);
+  replaceChild_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "replaceChild", [__arg_0, __arg_1]);
 
-  static nodeValue_Setter(mthis, __arg_0) native "Node_nodeValue_Setter";
-  nodeValue_Setter_(mthis, __arg_0) => nodeValue_Setter(mthis, __arg_0);
+  textContent_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "textContent");
 
-  static ownerDocument_Getter(mthis) native "Node_ownerDocument_Getter";
-  ownerDocument_Getter_(mthis) => ownerDocument_Getter(mthis);
-
-  static parentElement_Getter(mthis) native "Node_parentElement_Getter";
-  parentElement_Getter_(mthis) => parentElement_Getter(mthis);
-
-  static parentNode_Getter(mthis) native "Node_parentNode_Getter";
-  parentNode_Getter_(mthis) => parentNode_Getter(mthis);
-
-  static previousSibling_Getter(mthis) native "Node_previousSibling_Getter";
-  previousSibling_Getter_(mthis) => previousSibling_Getter(mthis);
-
-  static removeChild_Callback_0(mthis) native "Node_removeChild_Callback";
-  removeChild_Callback_0_(mthis) => removeChild_Callback_0(mthis);
-
-  static removeChild_Callback_1(mthis, __arg_0) native "Node_removeChild_Callback";
-  removeChild_Callback_1_(mthis, __arg_0) => removeChild_Callback_1(mthis, __arg_0);
-
-  static removeChild_Callback_2(mthis, __arg_0, __arg_1) native "Node_removeChild_Callback";
-  removeChild_Callback_2_(mthis, __arg_0, __arg_1) => removeChild_Callback_2(mthis, __arg_0, __arg_1);
-
-  static removeChild_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Node_removeChild_Callback";
-  removeChild_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => removeChild_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static replaceChild_Callback_0(mthis) native "Node_replaceChild_Callback";
-  replaceChild_Callback_0_(mthis) => replaceChild_Callback_0(mthis);
-
-  static replaceChild_Callback_1(mthis, __arg_0) native "Node_replaceChild_Callback";
-  replaceChild_Callback_1_(mthis, __arg_0) => replaceChild_Callback_1(mthis, __arg_0);
-
-  static replaceChild_Callback_2(mthis, __arg_0, __arg_1) native "Node_replaceChild_Callback";
-  replaceChild_Callback_2_(mthis, __arg_0, __arg_1) => replaceChild_Callback_2(mthis, __arg_0, __arg_1);
-
-  static replaceChild_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Node_replaceChild_Callback";
-  replaceChild_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => replaceChild_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static replaceChild_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Node_replaceChild_Callback";
-  replaceChild_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => replaceChild_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static textContent_Getter(mthis) native "Node_textContent_Getter";
-  textContent_Getter_(mthis) => textContent_Getter(mthis);
-
-  static textContent_Setter(mthis, __arg_0) native "Node_textContent_Setter";
-  textContent_Setter_(mthis, __arg_0) => textContent_Setter(mthis, __arg_0);
+  textContent_Setter_(mthis, __arg_0) => mthis["textContent"] = __arg_0;
 
 }
 
@@ -16689,153 +9231,79 @@
 class BlinkNodeIterator {
   static final instance = new BlinkNodeIterator();
 
-  static detach_Callback_0(mthis) native "NodeIterator_detach_Callback";
-  detach_Callback_0_(mthis) => detach_Callback_0(mthis);
+  detach_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "detach", []);
 
-  static detach_Callback_1(mthis, __arg_0) native "NodeIterator_detach_Callback";
-  detach_Callback_1_(mthis, __arg_0) => detach_Callback_1(mthis, __arg_0);
+  nextNode_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "nextNode", []);
 
-  static detach_Callback_2(mthis, __arg_0, __arg_1) native "NodeIterator_detach_Callback";
-  detach_Callback_2_(mthis, __arg_0, __arg_1) => detach_Callback_2(mthis, __arg_0, __arg_1);
+  pointerBeforeReferenceNode_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "pointerBeforeReferenceNode");
 
-  static nextNode_Callback_0(mthis) native "NodeIterator_nextNode_Callback";
-  nextNode_Callback_0_(mthis) => nextNode_Callback_0(mthis);
+  previousNode_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "previousNode", []);
 
-  static nextNode_Callback_1(mthis, __arg_0) native "NodeIterator_nextNode_Callback";
-  nextNode_Callback_1_(mthis, __arg_0) => nextNode_Callback_1(mthis, __arg_0);
+  referenceNode_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "referenceNode");
 
-  static nextNode_Callback_2(mthis, __arg_0, __arg_1) native "NodeIterator_nextNode_Callback";
-  nextNode_Callback_2_(mthis, __arg_0, __arg_1) => nextNode_Callback_2(mthis, __arg_0, __arg_1);
+  root_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "root");
 
-  static pointerBeforeReferenceNode_Getter(mthis) native "NodeIterator_pointerBeforeReferenceNode_Getter";
-  pointerBeforeReferenceNode_Getter_(mthis) => pointerBeforeReferenceNode_Getter(mthis);
-
-  static previousNode_Callback_0(mthis) native "NodeIterator_previousNode_Callback";
-  previousNode_Callback_0_(mthis) => previousNode_Callback_0(mthis);
-
-  static previousNode_Callback_1(mthis, __arg_0) native "NodeIterator_previousNode_Callback";
-  previousNode_Callback_1_(mthis, __arg_0) => previousNode_Callback_1(mthis, __arg_0);
-
-  static previousNode_Callback_2(mthis, __arg_0, __arg_1) native "NodeIterator_previousNode_Callback";
-  previousNode_Callback_2_(mthis, __arg_0, __arg_1) => previousNode_Callback_2(mthis, __arg_0, __arg_1);
-
-  static referenceNode_Getter(mthis) native "NodeIterator_referenceNode_Getter";
-  referenceNode_Getter_(mthis) => referenceNode_Getter(mthis);
-
-  static root_Getter(mthis) native "NodeIterator_root_Getter";
-  root_Getter_(mthis) => root_Getter(mthis);
-
-  static whatToShow_Getter(mthis) native "NodeIterator_whatToShow_Getter";
-  whatToShow_Getter_(mthis) => whatToShow_Getter(mthis);
+  whatToShow_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "whatToShow");
 
 }
 
 class BlinkNodeList {
   static final instance = new BlinkNodeList();
 
-  static $__getter___Callback_1(mthis, __arg_0) native "NodeList___getter___Callback";
-  $__getter___Callback_1_(mthis, __arg_0) => $__getter___Callback_1(mthis, __arg_0);
+  $__getter___Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "__getter__", [__arg_0]);
 
-  static item_Callback_0(mthis) native "NodeList_item_Callback";
-  item_Callback_0_(mthis) => item_Callback_0(mthis);
+  item_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "item", []);
 
-  static item_Callback_1(mthis, __arg_0) native "NodeList_item_Callback";
-  item_Callback_1_(mthis, __arg_0) => item_Callback_1(mthis, __arg_0);
+  item_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "item", [__arg_0]);
 
-  static item_Callback_2(mthis, __arg_0, __arg_1) native "NodeList_item_Callback";
-  item_Callback_2_(mthis, __arg_0, __arg_1) => item_Callback_2(mthis, __arg_0, __arg_1);
-
-  static item_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "NodeList_item_Callback";
-  item_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => item_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static length_Getter(mthis) native "NodeList_length_Getter";
-  length_Getter_(mthis) => length_Getter(mthis);
+  length_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "length");
 
 }
 
 class BlinkNotification extends BlinkEventTarget {
   static final instance = new BlinkNotification();
 
-  static body_Getter(mthis) native "Notification_body_Getter";
-  body_Getter_(mthis) => body_Getter(mthis);
+  body_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "body");
 
-  static close_Callback_0(mthis) native "Notification_close_Callback";
-  close_Callback_0_(mthis) => close_Callback_0(mthis);
+  close_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "close", []);
 
-  static close_Callback_1(mthis, __arg_0) native "Notification_close_Callback";
-  close_Callback_1_(mthis, __arg_0) => close_Callback_1(mthis, __arg_0);
+  constructorCallback_0_() => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "Notification"), []);
 
-  static close_Callback_2(mthis, __arg_0, __arg_1) native "Notification_close_Callback";
-  close_Callback_2_(mthis, __arg_0, __arg_1) => close_Callback_2(mthis, __arg_0, __arg_1);
+  constructorCallback_1_(__arg_0) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "Notification"), [__arg_0]);
 
-  static constructorCallback_0() native "Notification_constructorCallback";
-  constructorCallback_0_() => constructorCallback_0();
+  constructorCallback_2_(__arg_0, __arg_1) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "Notification"), [__arg_0, __arg_1]);
 
-  static constructorCallback_1(__arg_0) native "Notification_constructorCallback";
-  constructorCallback_1_(__arg_0) => constructorCallback_1(__arg_0);
+  dir_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "dir");
 
-  static constructorCallback_2(__arg_0, __arg_1) native "Notification_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  icon_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "icon");
 
-  static constructorCallback_3(__arg_0, __arg_1, __arg_2) native "Notification_constructorCallback";
-  constructorCallback_3_(__arg_0, __arg_1, __arg_2) => constructorCallback_3(__arg_0, __arg_1, __arg_2);
+  lang_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "lang");
 
-  static constructorCallback_4(__arg_0, __arg_1, __arg_2, __arg_3) native "Notification_constructorCallback";
-  constructorCallback_4_(__arg_0, __arg_1, __arg_2, __arg_3) => constructorCallback_4(__arg_0, __arg_1, __arg_2, __arg_3);
+  onclick_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onclick");
 
-  static dir_Getter(mthis) native "Notification_dir_Getter";
-  dir_Getter_(mthis) => dir_Getter(mthis);
+  onclick_Setter_(mthis, __arg_0) => mthis["onclick"] = __arg_0;
 
-  static icon_Getter(mthis) native "Notification_icon_Getter";
-  icon_Getter_(mthis) => icon_Getter(mthis);
+  onclose_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onclose");
 
-  static lang_Getter(mthis) native "Notification_lang_Getter";
-  lang_Getter_(mthis) => lang_Getter(mthis);
+  onclose_Setter_(mthis, __arg_0) => mthis["onclose"] = __arg_0;
 
-  static onclick_Getter(mthis) native "Notification_onclick_Getter";
-  onclick_Getter_(mthis) => onclick_Getter(mthis);
+  onerror_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onerror");
 
-  static onclick_Setter(mthis, __arg_0) native "Notification_onclick_Setter";
-  onclick_Setter_(mthis, __arg_0) => onclick_Setter(mthis, __arg_0);
+  onerror_Setter_(mthis, __arg_0) => mthis["onerror"] = __arg_0;
 
-  static onclose_Getter(mthis) native "Notification_onclose_Getter";
-  onclose_Getter_(mthis) => onclose_Getter(mthis);
+  onshow_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onshow");
 
-  static onclose_Setter(mthis, __arg_0) native "Notification_onclose_Setter";
-  onclose_Setter_(mthis, __arg_0) => onclose_Setter(mthis, __arg_0);
+  onshow_Setter_(mthis, __arg_0) => mthis["onshow"] = __arg_0;
 
-  static onerror_Getter(mthis) native "Notification_onerror_Getter";
-  onerror_Getter_(mthis) => onerror_Getter(mthis);
+  permission_Getter_() => Blink_JsNative_DomException.getProperty(Blink_JsNative_DomException.getProperty(js.context, "Notification"), "permission");
 
-  static onerror_Setter(mthis, __arg_0) native "Notification_onerror_Setter";
-  onerror_Setter_(mthis, __arg_0) => onerror_Setter(mthis, __arg_0);
+  requestPermission_Callback_0_() => Blink_JsNative_DomException.callMethod(Blink_JsNative_DomException.getProperty(js.context, "Notification"), "requestPermission", []);
 
-  static onshow_Getter(mthis) native "Notification_onshow_Getter";
-  onshow_Getter_(mthis) => onshow_Getter(mthis);
+  requestPermission_Callback_1_(__arg_0) => Blink_JsNative_DomException.callMethod(Blink_JsNative_DomException.getProperty(js.context, "Notification"), "requestPermission", [__arg_0]);
 
-  static onshow_Setter(mthis, __arg_0) native "Notification_onshow_Setter";
-  onshow_Setter_(mthis, __arg_0) => onshow_Setter(mthis, __arg_0);
+  tag_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "tag");
 
-  static permission_Getter() native "Notification_permission_Getter";
-  permission_Getter_() => permission_Getter();
-
-  static requestPermission_Callback_0() native "Notification_requestPermission_Callback";
-  requestPermission_Callback_0_() => requestPermission_Callback_0();
-
-  static requestPermission_Callback_1(__arg_0) native "Notification_requestPermission_Callback";
-  requestPermission_Callback_1_(__arg_0) => requestPermission_Callback_1(__arg_0);
-
-  static requestPermission_Callback_2(__arg_0, __arg_1) native "Notification_requestPermission_Callback";
-  requestPermission_Callback_2_(__arg_0, __arg_1) => requestPermission_Callback_2(__arg_0, __arg_1);
-
-  static requestPermission_Callback_3(__arg_0, __arg_1, __arg_2) native "Notification_requestPermission_Callback";
-  requestPermission_Callback_3_(__arg_0, __arg_1, __arg_2) => requestPermission_Callback_3(__arg_0, __arg_1, __arg_2);
-
-  static tag_Getter(mthis) native "Notification_tag_Getter";
-  tag_Getter_(mthis) => tag_Getter(mthis);
-
-  static title_Getter(mthis) native "Notification_title_Getter";
-  title_Getter_(mthis) => title_Getter(mthis);
+  title_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "title");
 
 }
 
@@ -16872,724 +9340,333 @@
 class BlinkOESVertexArrayObject {
   static final instance = new BlinkOESVertexArrayObject();
 
-  static bindVertexArrayOES_Callback_0(mthis) native "OESVertexArrayObject_bindVertexArrayOES_Callback";
-  bindVertexArrayOES_Callback_0_(mthis) => bindVertexArrayOES_Callback_0(mthis);
+  bindVertexArrayOES_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "bindVertexArrayOES", []);
 
-  static bindVertexArrayOES_Callback_1(mthis, __arg_0) native "OESVertexArrayObject_bindVertexArrayOES_Callback";
-  bindVertexArrayOES_Callback_1_(mthis, __arg_0) => bindVertexArrayOES_Callback_1(mthis, __arg_0);
+  bindVertexArrayOES_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "bindVertexArrayOES", [__arg_0]);
 
-  static bindVertexArrayOES_Callback_2(mthis, __arg_0, __arg_1) native "OESVertexArrayObject_bindVertexArrayOES_Callback";
-  bindVertexArrayOES_Callback_2_(mthis, __arg_0, __arg_1) => bindVertexArrayOES_Callback_2(mthis, __arg_0, __arg_1);
+  createVertexArrayOES_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createVertexArrayOES", []);
 
-  static bindVertexArrayOES_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "OESVertexArrayObject_bindVertexArrayOES_Callback";
-  bindVertexArrayOES_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => bindVertexArrayOES_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  deleteVertexArrayOES_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "deleteVertexArrayOES", []);
 
-  static createVertexArrayOES_Callback_0(mthis) native "OESVertexArrayObject_createVertexArrayOES_Callback";
-  createVertexArrayOES_Callback_0_(mthis) => createVertexArrayOES_Callback_0(mthis);
+  deleteVertexArrayOES_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "deleteVertexArrayOES", [__arg_0]);
 
-  static createVertexArrayOES_Callback_1(mthis, __arg_0) native "OESVertexArrayObject_createVertexArrayOES_Callback";
-  createVertexArrayOES_Callback_1_(mthis, __arg_0) => createVertexArrayOES_Callback_1(mthis, __arg_0);
+  isVertexArrayOES_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "isVertexArrayOES", []);
 
-  static createVertexArrayOES_Callback_2(mthis, __arg_0, __arg_1) native "OESVertexArrayObject_createVertexArrayOES_Callback";
-  createVertexArrayOES_Callback_2_(mthis, __arg_0, __arg_1) => createVertexArrayOES_Callback_2(mthis, __arg_0, __arg_1);
-
-  static deleteVertexArrayOES_Callback_0(mthis) native "OESVertexArrayObject_deleteVertexArrayOES_Callback";
-  deleteVertexArrayOES_Callback_0_(mthis) => deleteVertexArrayOES_Callback_0(mthis);
-
-  static deleteVertexArrayOES_Callback_1(mthis, __arg_0) native "OESVertexArrayObject_deleteVertexArrayOES_Callback";
-  deleteVertexArrayOES_Callback_1_(mthis, __arg_0) => deleteVertexArrayOES_Callback_1(mthis, __arg_0);
-
-  static deleteVertexArrayOES_Callback_2(mthis, __arg_0, __arg_1) native "OESVertexArrayObject_deleteVertexArrayOES_Callback";
-  deleteVertexArrayOES_Callback_2_(mthis, __arg_0, __arg_1) => deleteVertexArrayOES_Callback_2(mthis, __arg_0, __arg_1);
-
-  static deleteVertexArrayOES_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "OESVertexArrayObject_deleteVertexArrayOES_Callback";
-  deleteVertexArrayOES_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => deleteVertexArrayOES_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static isVertexArrayOES_Callback_0(mthis) native "OESVertexArrayObject_isVertexArrayOES_Callback";
-  isVertexArrayOES_Callback_0_(mthis) => isVertexArrayOES_Callback_0(mthis);
-
-  static isVertexArrayOES_Callback_1(mthis, __arg_0) native "OESVertexArrayObject_isVertexArrayOES_Callback";
-  isVertexArrayOES_Callback_1_(mthis, __arg_0) => isVertexArrayOES_Callback_1(mthis, __arg_0);
-
-  static isVertexArrayOES_Callback_2(mthis, __arg_0, __arg_1) native "OESVertexArrayObject_isVertexArrayOES_Callback";
-  isVertexArrayOES_Callback_2_(mthis, __arg_0, __arg_1) => isVertexArrayOES_Callback_2(mthis, __arg_0, __arg_1);
-
-  static isVertexArrayOES_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "OESVertexArrayObject_isVertexArrayOES_Callback";
-  isVertexArrayOES_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => isVertexArrayOES_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  isVertexArrayOES_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "isVertexArrayOES", [__arg_0]);
 
 }
 
 class BlinkOfflineAudioCompletionEvent extends BlinkEvent {
   static final instance = new BlinkOfflineAudioCompletionEvent();
 
-  static renderedBuffer_Getter(mthis) native "OfflineAudioCompletionEvent_renderedBuffer_Getter";
-  renderedBuffer_Getter_(mthis) => renderedBuffer_Getter(mthis);
+  renderedBuffer_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "renderedBuffer");
 
 }
 
 class BlinkOfflineAudioContext extends BlinkAudioContext {
   static final instance = new BlinkOfflineAudioContext();
 
-  static constructorCallback_1(__arg_0) native "OfflineAudioContext_constructorCallback";
-  constructorCallback_1_(__arg_0) => constructorCallback_1(__arg_0);
+  constructorCallback_1_(__arg_0) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "OfflineAudioContext"), [__arg_0]);
 
-  static constructorCallback_2(__arg_0, __arg_1) native "OfflineAudioContext_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  constructorCallback_2_(__arg_0, __arg_1) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "OfflineAudioContext"), [__arg_0, __arg_1]);
 
-  static constructorCallback_3(__arg_0, __arg_1, __arg_2) native "OfflineAudioContext_constructorCallback";
-  constructorCallback_3_(__arg_0, __arg_1, __arg_2) => constructorCallback_3(__arg_0, __arg_1, __arg_2);
-
-  static constructorCallback_4(__arg_0, __arg_1, __arg_2, __arg_3) native "OfflineAudioContext_constructorCallback";
-  constructorCallback_4_(__arg_0, __arg_1, __arg_2, __arg_3) => constructorCallback_4(__arg_0, __arg_1, __arg_2, __arg_3);
-
-  static constructorCallback_5(__arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "OfflineAudioContext_constructorCallback";
-  constructorCallback_5_(__arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => constructorCallback_5(__arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  constructorCallback_3_(__arg_0, __arg_1, __arg_2) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "OfflineAudioContext"), [__arg_0, __arg_1, __arg_2]);
 
 }
 
 class BlinkOscillatorNode extends BlinkAudioSourceNode {
   static final instance = new BlinkOscillatorNode();
 
-  static detune_Getter(mthis) native "OscillatorNode_detune_Getter";
-  detune_Getter_(mthis) => detune_Getter(mthis);
+  detune_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "detune");
 
-  static frequency_Getter(mthis) native "OscillatorNode_frequency_Getter";
-  frequency_Getter_(mthis) => frequency_Getter(mthis);
+  frequency_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "frequency");
 
-  static noteOff_Callback_0(mthis) native "OscillatorNode_noteOff_Callback";
-  noteOff_Callback_0_(mthis) => noteOff_Callback_0(mthis);
+  noteOff_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "noteOff", []);
 
-  static noteOff_Callback_1(mthis, __arg_0) native "OscillatorNode_noteOff_Callback";
-  noteOff_Callback_1_(mthis, __arg_0) => noteOff_Callback_1(mthis, __arg_0);
+  noteOff_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "noteOff", [__arg_0]);
 
-  static noteOff_Callback_2(mthis, __arg_0, __arg_1) native "OscillatorNode_noteOff_Callback";
-  noteOff_Callback_2_(mthis, __arg_0, __arg_1) => noteOff_Callback_2(mthis, __arg_0, __arg_1);
+  noteOn_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "noteOn", []);
 
-  static noteOff_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "OscillatorNode_noteOff_Callback";
-  noteOff_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => noteOff_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  noteOn_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "noteOn", [__arg_0]);
 
-  static noteOn_Callback_0(mthis) native "OscillatorNode_noteOn_Callback";
-  noteOn_Callback_0_(mthis) => noteOn_Callback_0(mthis);
+  onended_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onended");
 
-  static noteOn_Callback_1(mthis, __arg_0) native "OscillatorNode_noteOn_Callback";
-  noteOn_Callback_1_(mthis, __arg_0) => noteOn_Callback_1(mthis, __arg_0);
+  onended_Setter_(mthis, __arg_0) => mthis["onended"] = __arg_0;
 
-  static noteOn_Callback_2(mthis, __arg_0, __arg_1) native "OscillatorNode_noteOn_Callback";
-  noteOn_Callback_2_(mthis, __arg_0, __arg_1) => noteOn_Callback_2(mthis, __arg_0, __arg_1);
+  setPeriodicWave_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "setPeriodicWave", []);
 
-  static noteOn_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "OscillatorNode_noteOn_Callback";
-  noteOn_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => noteOn_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  setPeriodicWave_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "setPeriodicWave", [__arg_0]);
 
-  static onended_Getter(mthis) native "OscillatorNode_onended_Getter";
-  onended_Getter_(mthis) => onended_Getter(mthis);
+  start_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "start", []);
 
-  static onended_Setter(mthis, __arg_0) native "OscillatorNode_onended_Setter";
-  onended_Setter_(mthis, __arg_0) => onended_Setter(mthis, __arg_0);
+  start_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "start", [__arg_0]);
 
-  static setPeriodicWave_Callback_0(mthis) native "OscillatorNode_setPeriodicWave_Callback";
-  setPeriodicWave_Callback_0_(mthis) => setPeriodicWave_Callback_0(mthis);
+  stop_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "stop", []);
 
-  static setPeriodicWave_Callback_1(mthis, __arg_0) native "OscillatorNode_setPeriodicWave_Callback";
-  setPeriodicWave_Callback_1_(mthis, __arg_0) => setPeriodicWave_Callback_1(mthis, __arg_0);
+  stop_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "stop", [__arg_0]);
 
-  static setPeriodicWave_Callback_2(mthis, __arg_0, __arg_1) native "OscillatorNode_setPeriodicWave_Callback";
-  setPeriodicWave_Callback_2_(mthis, __arg_0, __arg_1) => setPeriodicWave_Callback_2(mthis, __arg_0, __arg_1);
+  type_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "type");
 
-  static setPeriodicWave_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "OscillatorNode_setPeriodicWave_Callback";
-  setPeriodicWave_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => setPeriodicWave_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static start_Callback_0(mthis) native "OscillatorNode_start_Callback";
-  start_Callback_0_(mthis) => start_Callback_0(mthis);
-
-  static start_Callback_1(mthis, __arg_0) native "OscillatorNode_start_Callback";
-  start_Callback_1_(mthis, __arg_0) => start_Callback_1(mthis, __arg_0);
-
-  static start_Callback_2(mthis, __arg_0, __arg_1) native "OscillatorNode_start_Callback";
-  start_Callback_2_(mthis, __arg_0, __arg_1) => start_Callback_2(mthis, __arg_0, __arg_1);
-
-  static start_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "OscillatorNode_start_Callback";
-  start_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => start_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static stop_Callback_0(mthis) native "OscillatorNode_stop_Callback";
-  stop_Callback_0_(mthis) => stop_Callback_0(mthis);
-
-  static stop_Callback_1(mthis, __arg_0) native "OscillatorNode_stop_Callback";
-  stop_Callback_1_(mthis, __arg_0) => stop_Callback_1(mthis, __arg_0);
-
-  static stop_Callback_2(mthis, __arg_0, __arg_1) native "OscillatorNode_stop_Callback";
-  stop_Callback_2_(mthis, __arg_0, __arg_1) => stop_Callback_2(mthis, __arg_0, __arg_1);
-
-  static stop_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "OscillatorNode_stop_Callback";
-  stop_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => stop_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static type_Getter(mthis) native "OscillatorNode_type_Getter";
-  type_Getter_(mthis) => type_Getter(mthis);
-
-  static type_Setter(mthis, __arg_0) native "OscillatorNode_type_Setter";
-  type_Setter_(mthis, __arg_0) => type_Setter(mthis, __arg_0);
+  type_Setter_(mthis, __arg_0) => mthis["type"] = __arg_0;
 
 }
 
 class BlinkOverflowEvent extends BlinkEvent {
   static final instance = new BlinkOverflowEvent();
 
-  static constructorCallback_2(__arg_0, __arg_1) native "OverflowEvent_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  constructorCallback_2_(__arg_0, __arg_1) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "OverflowEvent"), [__arg_0, __arg_1]);
 
-  static horizontalOverflow_Getter(mthis) native "OverflowEvent_horizontalOverflow_Getter";
-  horizontalOverflow_Getter_(mthis) => horizontalOverflow_Getter(mthis);
+  horizontalOverflow_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "horizontalOverflow");
 
-  static orient_Getter(mthis) native "OverflowEvent_orient_Getter";
-  orient_Getter_(mthis) => orient_Getter(mthis);
+  orient_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "orient");
 
-  static verticalOverflow_Getter(mthis) native "OverflowEvent_verticalOverflow_Getter";
-  verticalOverflow_Getter_(mthis) => verticalOverflow_Getter(mthis);
+  verticalOverflow_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "verticalOverflow");
 
 }
 
 class BlinkPagePopupController {
   static final instance = new BlinkPagePopupController();
 
-  static closePopup_Callback_0(mthis) native "PagePopupController_closePopup_Callback";
-  closePopup_Callback_0_(mthis) => closePopup_Callback_0(mthis);
+  closePopup_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "closePopup", []);
 
-  static closePopup_Callback_1(mthis, __arg_0) native "PagePopupController_closePopup_Callback";
-  closePopup_Callback_1_(mthis, __arg_0) => closePopup_Callback_1(mthis, __arg_0);
+  formatMonth_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "formatMonth", []);
 
-  static closePopup_Callback_2(mthis, __arg_0, __arg_1) native "PagePopupController_closePopup_Callback";
-  closePopup_Callback_2_(mthis, __arg_0, __arg_1) => closePopup_Callback_2(mthis, __arg_0, __arg_1);
+  formatMonth_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "formatMonth", [__arg_0]);
 
-  static formatMonth_Callback_0(mthis) native "PagePopupController_formatMonth_Callback";
-  formatMonth_Callback_0_(mthis) => formatMonth_Callback_0(mthis);
+  formatMonth_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "formatMonth", [__arg_0, __arg_1]);
 
-  static formatMonth_Callback_1(mthis, __arg_0) native "PagePopupController_formatMonth_Callback";
-  formatMonth_Callback_1_(mthis, __arg_0) => formatMonth_Callback_1(mthis, __arg_0);
+  formatShortMonth_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "formatShortMonth", []);
 
-  static formatMonth_Callback_2(mthis, __arg_0, __arg_1) native "PagePopupController_formatMonth_Callback";
-  formatMonth_Callback_2_(mthis, __arg_0, __arg_1) => formatMonth_Callback_2(mthis, __arg_0, __arg_1);
+  formatShortMonth_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "formatShortMonth", [__arg_0]);
 
-  static formatMonth_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "PagePopupController_formatMonth_Callback";
-  formatMonth_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => formatMonth_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  formatShortMonth_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "formatShortMonth", [__arg_0, __arg_1]);
 
-  static formatMonth_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "PagePopupController_formatMonth_Callback";
-  formatMonth_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => formatMonth_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  formatWeek_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "formatWeek", [__arg_0]);
 
-  static formatShortMonth_Callback_0(mthis) native "PagePopupController_formatShortMonth_Callback";
-  formatShortMonth_Callback_0_(mthis) => formatShortMonth_Callback_0(mthis);
+  formatWeek_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "formatWeek", [__arg_0, __arg_1]);
 
-  static formatShortMonth_Callback_1(mthis, __arg_0) native "PagePopupController_formatShortMonth_Callback";
-  formatShortMonth_Callback_1_(mthis, __arg_0) => formatShortMonth_Callback_1(mthis, __arg_0);
+  formatWeek_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "formatWeek", [__arg_0, __arg_1, __arg_2]);
 
-  static formatShortMonth_Callback_2(mthis, __arg_0, __arg_1) native "PagePopupController_formatShortMonth_Callback";
-  formatShortMonth_Callback_2_(mthis, __arg_0, __arg_1) => formatShortMonth_Callback_2(mthis, __arg_0, __arg_1);
+  histogramEnumeration_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "histogramEnumeration", [__arg_0]);
 
-  static formatShortMonth_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "PagePopupController_formatShortMonth_Callback";
-  formatShortMonth_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => formatShortMonth_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  histogramEnumeration_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "histogramEnumeration", [__arg_0, __arg_1]);
 
-  static formatShortMonth_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "PagePopupController_formatShortMonth_Callback";
-  formatShortMonth_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => formatShortMonth_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  histogramEnumeration_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "histogramEnumeration", [__arg_0, __arg_1, __arg_2]);
 
-  static formatWeek_Callback_1(mthis, __arg_0) native "PagePopupController_formatWeek_Callback";
-  formatWeek_Callback_1_(mthis, __arg_0) => formatWeek_Callback_1(mthis, __arg_0);
+  localizeNumberString_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "localizeNumberString", []);
 
-  static formatWeek_Callback_2(mthis, __arg_0, __arg_1) native "PagePopupController_formatWeek_Callback";
-  formatWeek_Callback_2_(mthis, __arg_0, __arg_1) => formatWeek_Callback_2(mthis, __arg_0, __arg_1);
+  localizeNumberString_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "localizeNumberString", [__arg_0]);
 
-  static formatWeek_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "PagePopupController_formatWeek_Callback";
-  formatWeek_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => formatWeek_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  setValueAndClosePopup_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "setValueAndClosePopup", []);
 
-  static formatWeek_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "PagePopupController_formatWeek_Callback";
-  formatWeek_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => formatWeek_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  setValueAndClosePopup_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "setValueAndClosePopup", [__arg_0]);
 
-  static formatWeek_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "PagePopupController_formatWeek_Callback";
-  formatWeek_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => formatWeek_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  setValueAndClosePopup_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "setValueAndClosePopup", [__arg_0, __arg_1]);
 
-  static histogramEnumeration_Callback_1(mthis, __arg_0) native "PagePopupController_histogramEnumeration_Callback";
-  histogramEnumeration_Callback_1_(mthis, __arg_0) => histogramEnumeration_Callback_1(mthis, __arg_0);
+  setValue_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "setValue", []);
 
-  static histogramEnumeration_Callback_2(mthis, __arg_0, __arg_1) native "PagePopupController_histogramEnumeration_Callback";
-  histogramEnumeration_Callback_2_(mthis, __arg_0, __arg_1) => histogramEnumeration_Callback_2(mthis, __arg_0, __arg_1);
-
-  static histogramEnumeration_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "PagePopupController_histogramEnumeration_Callback";
-  histogramEnumeration_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => histogramEnumeration_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static histogramEnumeration_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "PagePopupController_histogramEnumeration_Callback";
-  histogramEnumeration_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => histogramEnumeration_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static histogramEnumeration_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "PagePopupController_histogramEnumeration_Callback";
-  histogramEnumeration_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => histogramEnumeration_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
-
-  static localizeNumberString_Callback_0(mthis) native "PagePopupController_localizeNumberString_Callback";
-  localizeNumberString_Callback_0_(mthis) => localizeNumberString_Callback_0(mthis);
-
-  static localizeNumberString_Callback_1(mthis, __arg_0) native "PagePopupController_localizeNumberString_Callback";
-  localizeNumberString_Callback_1_(mthis, __arg_0) => localizeNumberString_Callback_1(mthis, __arg_0);
-
-  static localizeNumberString_Callback_2(mthis, __arg_0, __arg_1) native "PagePopupController_localizeNumberString_Callback";
-  localizeNumberString_Callback_2_(mthis, __arg_0, __arg_1) => localizeNumberString_Callback_2(mthis, __arg_0, __arg_1);
-
-  static localizeNumberString_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "PagePopupController_localizeNumberString_Callback";
-  localizeNumberString_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => localizeNumberString_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static setValueAndClosePopup_Callback_0(mthis) native "PagePopupController_setValueAndClosePopup_Callback";
-  setValueAndClosePopup_Callback_0_(mthis) => setValueAndClosePopup_Callback_0(mthis);
-
-  static setValueAndClosePopup_Callback_1(mthis, __arg_0) native "PagePopupController_setValueAndClosePopup_Callback";
-  setValueAndClosePopup_Callback_1_(mthis, __arg_0) => setValueAndClosePopup_Callback_1(mthis, __arg_0);
-
-  static setValueAndClosePopup_Callback_2(mthis, __arg_0, __arg_1) native "PagePopupController_setValueAndClosePopup_Callback";
-  setValueAndClosePopup_Callback_2_(mthis, __arg_0, __arg_1) => setValueAndClosePopup_Callback_2(mthis, __arg_0, __arg_1);
-
-  static setValueAndClosePopup_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "PagePopupController_setValueAndClosePopup_Callback";
-  setValueAndClosePopup_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => setValueAndClosePopup_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static setValueAndClosePopup_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "PagePopupController_setValueAndClosePopup_Callback";
-  setValueAndClosePopup_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => setValueAndClosePopup_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static setValue_Callback_0(mthis) native "PagePopupController_setValue_Callback";
-  setValue_Callback_0_(mthis) => setValue_Callback_0(mthis);
-
-  static setValue_Callback_1(mthis, __arg_0) native "PagePopupController_setValue_Callback";
-  setValue_Callback_1_(mthis, __arg_0) => setValue_Callback_1(mthis, __arg_0);
-
-  static setValue_Callback_2(mthis, __arg_0, __arg_1) native "PagePopupController_setValue_Callback";
-  setValue_Callback_2_(mthis, __arg_0, __arg_1) => setValue_Callback_2(mthis, __arg_0, __arg_1);
-
-  static setValue_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "PagePopupController_setValue_Callback";
-  setValue_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => setValue_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  setValue_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "setValue", [__arg_0]);
 
 }
 
 class BlinkPageTransitionEvent extends BlinkEvent {
   static final instance = new BlinkPageTransitionEvent();
 
-  static constructorCallback_2(__arg_0, __arg_1) native "PageTransitionEvent_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  constructorCallback_2_(__arg_0, __arg_1) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "PageTransitionEvent"), [__arg_0, __arg_1]);
 
-  static persisted_Getter(mthis) native "PageTransitionEvent_persisted_Getter";
-  persisted_Getter_(mthis) => persisted_Getter(mthis);
+  persisted_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "persisted");
 
 }
 
 class BlinkPannerNode extends BlinkAudioNode {
   static final instance = new BlinkPannerNode();
 
-  static coneInnerAngle_Getter(mthis) native "PannerNode_coneInnerAngle_Getter";
-  coneInnerAngle_Getter_(mthis) => coneInnerAngle_Getter(mthis);
+  coneInnerAngle_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "coneInnerAngle");
 
-  static coneInnerAngle_Setter(mthis, __arg_0) native "PannerNode_coneInnerAngle_Setter";
-  coneInnerAngle_Setter_(mthis, __arg_0) => coneInnerAngle_Setter(mthis, __arg_0);
+  coneInnerAngle_Setter_(mthis, __arg_0) => mthis["coneInnerAngle"] = __arg_0;
 
-  static coneOuterAngle_Getter(mthis) native "PannerNode_coneOuterAngle_Getter";
-  coneOuterAngle_Getter_(mthis) => coneOuterAngle_Getter(mthis);
+  coneOuterAngle_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "coneOuterAngle");
 
-  static coneOuterAngle_Setter(mthis, __arg_0) native "PannerNode_coneOuterAngle_Setter";
-  coneOuterAngle_Setter_(mthis, __arg_0) => coneOuterAngle_Setter(mthis, __arg_0);
+  coneOuterAngle_Setter_(mthis, __arg_0) => mthis["coneOuterAngle"] = __arg_0;
 
-  static coneOuterGain_Getter(mthis) native "PannerNode_coneOuterGain_Getter";
-  coneOuterGain_Getter_(mthis) => coneOuterGain_Getter(mthis);
+  coneOuterGain_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "coneOuterGain");
 
-  static coneOuterGain_Setter(mthis, __arg_0) native "PannerNode_coneOuterGain_Setter";
-  coneOuterGain_Setter_(mthis, __arg_0) => coneOuterGain_Setter(mthis, __arg_0);
+  coneOuterGain_Setter_(mthis, __arg_0) => mthis["coneOuterGain"] = __arg_0;
 
-  static distanceModel_Getter(mthis) native "PannerNode_distanceModel_Getter";
-  distanceModel_Getter_(mthis) => distanceModel_Getter(mthis);
+  distanceModel_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "distanceModel");
 
-  static distanceModel_Setter(mthis, __arg_0) native "PannerNode_distanceModel_Setter";
-  distanceModel_Setter_(mthis, __arg_0) => distanceModel_Setter(mthis, __arg_0);
+  distanceModel_Setter_(mthis, __arg_0) => mthis["distanceModel"] = __arg_0;
 
-  static maxDistance_Getter(mthis) native "PannerNode_maxDistance_Getter";
-  maxDistance_Getter_(mthis) => maxDistance_Getter(mthis);
+  maxDistance_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "maxDistance");
 
-  static maxDistance_Setter(mthis, __arg_0) native "PannerNode_maxDistance_Setter";
-  maxDistance_Setter_(mthis, __arg_0) => maxDistance_Setter(mthis, __arg_0);
+  maxDistance_Setter_(mthis, __arg_0) => mthis["maxDistance"] = __arg_0;
 
-  static panningModel_Getter(mthis) native "PannerNode_panningModel_Getter";
-  panningModel_Getter_(mthis) => panningModel_Getter(mthis);
+  panningModel_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "panningModel");
 
-  static panningModel_Setter(mthis, __arg_0) native "PannerNode_panningModel_Setter";
-  panningModel_Setter_(mthis, __arg_0) => panningModel_Setter(mthis, __arg_0);
+  panningModel_Setter_(mthis, __arg_0) => mthis["panningModel"] = __arg_0;
 
-  static refDistance_Getter(mthis) native "PannerNode_refDistance_Getter";
-  refDistance_Getter_(mthis) => refDistance_Getter(mthis);
+  refDistance_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "refDistance");
 
-  static refDistance_Setter(mthis, __arg_0) native "PannerNode_refDistance_Setter";
-  refDistance_Setter_(mthis, __arg_0) => refDistance_Setter(mthis, __arg_0);
+  refDistance_Setter_(mthis, __arg_0) => mthis["refDistance"] = __arg_0;
 
-  static rolloffFactor_Getter(mthis) native "PannerNode_rolloffFactor_Getter";
-  rolloffFactor_Getter_(mthis) => rolloffFactor_Getter(mthis);
+  rolloffFactor_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "rolloffFactor");
 
-  static rolloffFactor_Setter(mthis, __arg_0) native "PannerNode_rolloffFactor_Setter";
-  rolloffFactor_Setter_(mthis, __arg_0) => rolloffFactor_Setter(mthis, __arg_0);
+  rolloffFactor_Setter_(mthis, __arg_0) => mthis["rolloffFactor"] = __arg_0;
 
-  static setOrientation_Callback_1(mthis, __arg_0) native "PannerNode_setOrientation_Callback";
-  setOrientation_Callback_1_(mthis, __arg_0) => setOrientation_Callback_1(mthis, __arg_0);
+  setOrientation_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "setOrientation", [__arg_0]);
 
-  static setOrientation_Callback_2(mthis, __arg_0, __arg_1) native "PannerNode_setOrientation_Callback";
-  setOrientation_Callback_2_(mthis, __arg_0, __arg_1) => setOrientation_Callback_2(mthis, __arg_0, __arg_1);
+  setOrientation_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "setOrientation", [__arg_0, __arg_1]);
 
-  static setOrientation_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "PannerNode_setOrientation_Callback";
-  setOrientation_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => setOrientation_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  setOrientation_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "setOrientation", [__arg_0, __arg_1, __arg_2]);
 
-  static setOrientation_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "PannerNode_setOrientation_Callback";
-  setOrientation_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => setOrientation_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  setPosition_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "setPosition", [__arg_0]);
 
-  static setOrientation_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "PannerNode_setOrientation_Callback";
-  setOrientation_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => setOrientation_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  setPosition_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "setPosition", [__arg_0, __arg_1]);
 
-  static setPosition_Callback_1(mthis, __arg_0) native "PannerNode_setPosition_Callback";
-  setPosition_Callback_1_(mthis, __arg_0) => setPosition_Callback_1(mthis, __arg_0);
+  setPosition_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "setPosition", [__arg_0, __arg_1, __arg_2]);
 
-  static setPosition_Callback_2(mthis, __arg_0, __arg_1) native "PannerNode_setPosition_Callback";
-  setPosition_Callback_2_(mthis, __arg_0, __arg_1) => setPosition_Callback_2(mthis, __arg_0, __arg_1);
+  setVelocity_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "setVelocity", [__arg_0]);
 
-  static setPosition_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "PannerNode_setPosition_Callback";
-  setPosition_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => setPosition_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  setVelocity_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "setVelocity", [__arg_0, __arg_1]);
 
-  static setPosition_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "PannerNode_setPosition_Callback";
-  setPosition_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => setPosition_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static setPosition_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "PannerNode_setPosition_Callback";
-  setPosition_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => setPosition_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
-
-  static setVelocity_Callback_1(mthis, __arg_0) native "PannerNode_setVelocity_Callback";
-  setVelocity_Callback_1_(mthis, __arg_0) => setVelocity_Callback_1(mthis, __arg_0);
-
-  static setVelocity_Callback_2(mthis, __arg_0, __arg_1) native "PannerNode_setVelocity_Callback";
-  setVelocity_Callback_2_(mthis, __arg_0, __arg_1) => setVelocity_Callback_2(mthis, __arg_0, __arg_1);
-
-  static setVelocity_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "PannerNode_setVelocity_Callback";
-  setVelocity_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => setVelocity_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static setVelocity_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "PannerNode_setVelocity_Callback";
-  setVelocity_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => setVelocity_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static setVelocity_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "PannerNode_setVelocity_Callback";
-  setVelocity_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => setVelocity_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  setVelocity_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "setVelocity", [__arg_0, __arg_1, __arg_2]);
 
 }
 
 class BlinkPath2D {
   static final instance = new BlinkPath2D();
 
-  static addPath_Callback_0(mthis) native "Path2D_addPath_Callback";
-  addPath_Callback_0_(mthis) => addPath_Callback_0(mthis);
+  addPath_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "addPath", []);
 
-  static addPath_Callback_1(mthis, __arg_0) native "Path2D_addPath_Callback";
-  addPath_Callback_1_(mthis, __arg_0) => addPath_Callback_1(mthis, __arg_0);
+  addPath_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "addPath", [__arg_0]);
 
-  static addPath_Callback_2(mthis, __arg_0, __arg_1) native "Path2D_addPath_Callback";
-  addPath_Callback_2_(mthis, __arg_0, __arg_1) => addPath_Callback_2(mthis, __arg_0, __arg_1);
+  addPath_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "addPath", [__arg_0, __arg_1]);
 
-  static addPath_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Path2D_addPath_Callback";
-  addPath_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => addPath_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  arcTo_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "arcTo", [__arg_0, __arg_1, __arg_2]);
 
-  static addPath_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Path2D_addPath_Callback";
-  addPath_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => addPath_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  arcTo_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "arcTo", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static arcTo_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Path2D_arcTo_Callback";
-  arcTo_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => arcTo_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  arcTo_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => Blink_JsNative_DomException.callMethod(mthis, "arcTo", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4]);
 
-  static arcTo_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Path2D_arcTo_Callback";
-  arcTo_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => arcTo_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  arc_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "arc", [__arg_0, __arg_1, __arg_2]);
 
-  static arcTo_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "Path2D_arcTo_Callback";
-  arcTo_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => arcTo_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  arc_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "arc", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static arcTo_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "Path2D_arcTo_Callback";
-  arcTo_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => arcTo_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  arc_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => Blink_JsNative_DomException.callMethod(mthis, "arc", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4]);
 
-  static arcTo_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) native "Path2D_arcTo_Callback";
-  arcTo_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => arcTo_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6);
+  arc_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => Blink_JsNative_DomException.callMethod(mthis, "arc", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5]);
 
-  static arc_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Path2D_arc_Callback";
-  arc_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => arc_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  bezierCurveTo_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "bezierCurveTo", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static arc_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Path2D_arc_Callback";
-  arc_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => arc_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  bezierCurveTo_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => Blink_JsNative_DomException.callMethod(mthis, "bezierCurveTo", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4]);
 
-  static arc_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "Path2D_arc_Callback";
-  arc_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => arc_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  bezierCurveTo_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => Blink_JsNative_DomException.callMethod(mthis, "bezierCurveTo", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5]);
 
-  static arc_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "Path2D_arc_Callback";
-  arc_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => arc_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  closePath_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "closePath", []);
 
-  static arc_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) native "Path2D_arc_Callback";
-  arc_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => arc_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6);
+  constructorCallback_0_() => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "Path2D"), []);
 
-  static arc_Callback_8(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) native "Path2D_arc_Callback";
-  arc_Callback_8_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) => arc_Callback_8(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7);
+  constructorCallback_1_(__arg_0) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "Path2D"), [__arg_0]);
 
-  static bezierCurveTo_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Path2D_bezierCurveTo_Callback";
-  bezierCurveTo_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => bezierCurveTo_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  ellipse_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => Blink_JsNative_DomException.callMethod(mthis, "ellipse", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4]);
 
-  static bezierCurveTo_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "Path2D_bezierCurveTo_Callback";
-  bezierCurveTo_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => bezierCurveTo_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  ellipse_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => Blink_JsNative_DomException.callMethod(mthis, "ellipse", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5]);
 
-  static bezierCurveTo_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "Path2D_bezierCurveTo_Callback";
-  bezierCurveTo_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => bezierCurveTo_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  ellipse_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => Blink_JsNative_DomException.callMethod(mthis, "ellipse", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6]);
 
-  static bezierCurveTo_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) native "Path2D_bezierCurveTo_Callback";
-  bezierCurveTo_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => bezierCurveTo_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6);
+  ellipse_Callback_8_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) => Blink_JsNative_DomException.callMethod(mthis, "ellipse", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7]);
 
-  static bezierCurveTo_Callback_8(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) native "Path2D_bezierCurveTo_Callback";
-  bezierCurveTo_Callback_8_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) => bezierCurveTo_Callback_8(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7);
+  lineTo_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "lineTo", []);
 
-  static closePath_Callback_0(mthis) native "Path2D_closePath_Callback";
-  closePath_Callback_0_(mthis) => closePath_Callback_0(mthis);
+  lineTo_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "lineTo", [__arg_0]);
 
-  static closePath_Callback_1(mthis, __arg_0) native "Path2D_closePath_Callback";
-  closePath_Callback_1_(mthis, __arg_0) => closePath_Callback_1(mthis, __arg_0);
+  lineTo_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "lineTo", [__arg_0, __arg_1]);
 
-  static closePath_Callback_2(mthis, __arg_0, __arg_1) native "Path2D_closePath_Callback";
-  closePath_Callback_2_(mthis, __arg_0, __arg_1) => closePath_Callback_2(mthis, __arg_0, __arg_1);
+  moveTo_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "moveTo", []);
 
-  static constructorCallback_0() native "Path2D_constructorCallback";
-  constructorCallback_0_() => constructorCallback_0();
+  moveTo_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "moveTo", [__arg_0]);
 
-  static constructorCallback_1(__arg_0) native "Path2D_constructorCallback";
-  constructorCallback_1_(__arg_0) => constructorCallback_1(__arg_0);
+  moveTo_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "moveTo", [__arg_0, __arg_1]);
 
-  static constructorCallback_2(__arg_0, __arg_1) native "Path2D_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  quadraticCurveTo_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "quadraticCurveTo", [__arg_0, __arg_1]);
 
-  static constructorCallback_3(__arg_0, __arg_1, __arg_2) native "Path2D_constructorCallback";
-  constructorCallback_3_(__arg_0, __arg_1, __arg_2) => constructorCallback_3(__arg_0, __arg_1, __arg_2);
+  quadraticCurveTo_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "quadraticCurveTo", [__arg_0, __arg_1, __arg_2]);
 
-  static ellipse_Callback_10(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9) native "Path2D_ellipse_Callback";
-  ellipse_Callback_10_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9) => ellipse_Callback_10(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9);
+  quadraticCurveTo_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "quadraticCurveTo", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static ellipse_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "Path2D_ellipse_Callback";
-  ellipse_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => ellipse_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  rect_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "rect", [__arg_0, __arg_1]);
 
-  static ellipse_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "Path2D_ellipse_Callback";
-  ellipse_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => ellipse_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  rect_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "rect", [__arg_0, __arg_1, __arg_2]);
 
-  static ellipse_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) native "Path2D_ellipse_Callback";
-  ellipse_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => ellipse_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6);
-
-  static ellipse_Callback_8(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) native "Path2D_ellipse_Callback";
-  ellipse_Callback_8_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) => ellipse_Callback_8(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7);
-
-  static ellipse_Callback_9(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8) native "Path2D_ellipse_Callback";
-  ellipse_Callback_9_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8) => ellipse_Callback_9(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8);
-
-  static lineTo_Callback_0(mthis) native "Path2D_lineTo_Callback";
-  lineTo_Callback_0_(mthis) => lineTo_Callback_0(mthis);
-
-  static lineTo_Callback_1(mthis, __arg_0) native "Path2D_lineTo_Callback";
-  lineTo_Callback_1_(mthis, __arg_0) => lineTo_Callback_1(mthis, __arg_0);
-
-  static lineTo_Callback_2(mthis, __arg_0, __arg_1) native "Path2D_lineTo_Callback";
-  lineTo_Callback_2_(mthis, __arg_0, __arg_1) => lineTo_Callback_2(mthis, __arg_0, __arg_1);
-
-  static lineTo_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Path2D_lineTo_Callback";
-  lineTo_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => lineTo_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static lineTo_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Path2D_lineTo_Callback";
-  lineTo_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => lineTo_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static moveTo_Callback_0(mthis) native "Path2D_moveTo_Callback";
-  moveTo_Callback_0_(mthis) => moveTo_Callback_0(mthis);
-
-  static moveTo_Callback_1(mthis, __arg_0) native "Path2D_moveTo_Callback";
-  moveTo_Callback_1_(mthis, __arg_0) => moveTo_Callback_1(mthis, __arg_0);
-
-  static moveTo_Callback_2(mthis, __arg_0, __arg_1) native "Path2D_moveTo_Callback";
-  moveTo_Callback_2_(mthis, __arg_0, __arg_1) => moveTo_Callback_2(mthis, __arg_0, __arg_1);
-
-  static moveTo_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Path2D_moveTo_Callback";
-  moveTo_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => moveTo_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static moveTo_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Path2D_moveTo_Callback";
-  moveTo_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => moveTo_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static quadraticCurveTo_Callback_2(mthis, __arg_0, __arg_1) native "Path2D_quadraticCurveTo_Callback";
-  quadraticCurveTo_Callback_2_(mthis, __arg_0, __arg_1) => quadraticCurveTo_Callback_2(mthis, __arg_0, __arg_1);
-
-  static quadraticCurveTo_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Path2D_quadraticCurveTo_Callback";
-  quadraticCurveTo_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => quadraticCurveTo_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static quadraticCurveTo_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Path2D_quadraticCurveTo_Callback";
-  quadraticCurveTo_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => quadraticCurveTo_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static quadraticCurveTo_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "Path2D_quadraticCurveTo_Callback";
-  quadraticCurveTo_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => quadraticCurveTo_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
-
-  static quadraticCurveTo_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "Path2D_quadraticCurveTo_Callback";
-  quadraticCurveTo_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => quadraticCurveTo_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
-
-  static rect_Callback_2(mthis, __arg_0, __arg_1) native "Path2D_rect_Callback";
-  rect_Callback_2_(mthis, __arg_0, __arg_1) => rect_Callback_2(mthis, __arg_0, __arg_1);
-
-  static rect_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Path2D_rect_Callback";
-  rect_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => rect_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static rect_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Path2D_rect_Callback";
-  rect_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => rect_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static rect_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "Path2D_rect_Callback";
-  rect_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => rect_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
-
-  static rect_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "Path2D_rect_Callback";
-  rect_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => rect_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  rect_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "rect", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
 }
 
 class BlinkPerformance extends BlinkEventTarget {
   static final instance = new BlinkPerformance();
 
-  static clearMarks_Callback_0(mthis) native "Performance_clearMarks_Callback";
-  clearMarks_Callback_0_(mthis) => clearMarks_Callback_0(mthis);
+  clearMarks_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "clearMarks", []);
 
-  static clearMarks_Callback_1(mthis, __arg_0) native "Performance_clearMarks_Callback";
-  clearMarks_Callback_1_(mthis, __arg_0) => clearMarks_Callback_1(mthis, __arg_0);
+  clearMarks_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "clearMarks", [__arg_0]);
 
-  static clearMarks_Callback_2(mthis, __arg_0, __arg_1) native "Performance_clearMarks_Callback";
-  clearMarks_Callback_2_(mthis, __arg_0, __arg_1) => clearMarks_Callback_2(mthis, __arg_0, __arg_1);
+  clearMeasures_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "clearMeasures", []);
 
-  static clearMarks_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Performance_clearMarks_Callback";
-  clearMarks_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => clearMarks_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  clearMeasures_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "clearMeasures", [__arg_0]);
 
-  static clearMeasures_Callback_0(mthis) native "Performance_clearMeasures_Callback";
-  clearMeasures_Callback_0_(mthis) => clearMeasures_Callback_0(mthis);
+  getEntriesByName_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getEntriesByName", []);
 
-  static clearMeasures_Callback_1(mthis, __arg_0) native "Performance_clearMeasures_Callback";
-  clearMeasures_Callback_1_(mthis, __arg_0) => clearMeasures_Callback_1(mthis, __arg_0);
+  getEntriesByName_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getEntriesByName", [__arg_0]);
 
-  static clearMeasures_Callback_2(mthis, __arg_0, __arg_1) native "Performance_clearMeasures_Callback";
-  clearMeasures_Callback_2_(mthis, __arg_0, __arg_1) => clearMeasures_Callback_2(mthis, __arg_0, __arg_1);
+  getEntriesByName_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "getEntriesByName", [__arg_0, __arg_1]);
 
-  static clearMeasures_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Performance_clearMeasures_Callback";
-  clearMeasures_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => clearMeasures_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  getEntriesByType_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getEntriesByType", []);
 
-  static getEntriesByName_Callback_0(mthis) native "Performance_getEntriesByName_Callback";
-  getEntriesByName_Callback_0_(mthis) => getEntriesByName_Callback_0(mthis);
+  getEntriesByType_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getEntriesByType", [__arg_0]);
 
-  static getEntriesByName_Callback_1(mthis, __arg_0) native "Performance_getEntriesByName_Callback";
-  getEntriesByName_Callback_1_(mthis, __arg_0) => getEntriesByName_Callback_1(mthis, __arg_0);
+  getEntries_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getEntries", []);
 
-  static getEntriesByName_Callback_2(mthis, __arg_0, __arg_1) native "Performance_getEntriesByName_Callback";
-  getEntriesByName_Callback_2_(mthis, __arg_0, __arg_1) => getEntriesByName_Callback_2(mthis, __arg_0, __arg_1);
+  mark_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "mark", []);
 
-  static getEntriesByName_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Performance_getEntriesByName_Callback";
-  getEntriesByName_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getEntriesByName_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  mark_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "mark", [__arg_0]);
 
-  static getEntriesByName_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Performance_getEntriesByName_Callback";
-  getEntriesByName_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => getEntriesByName_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  measure_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "measure", []);
 
-  static getEntriesByType_Callback_0(mthis) native "Performance_getEntriesByType_Callback";
-  getEntriesByType_Callback_0_(mthis) => getEntriesByType_Callback_0(mthis);
+  measure_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "measure", [__arg_0]);
 
-  static getEntriesByType_Callback_1(mthis, __arg_0) native "Performance_getEntriesByType_Callback";
-  getEntriesByType_Callback_1_(mthis, __arg_0) => getEntriesByType_Callback_1(mthis, __arg_0);
+  measure_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "measure", [__arg_0, __arg_1]);
 
-  static getEntriesByType_Callback_2(mthis, __arg_0, __arg_1) native "Performance_getEntriesByType_Callback";
-  getEntriesByType_Callback_2_(mthis, __arg_0, __arg_1) => getEntriesByType_Callback_2(mthis, __arg_0, __arg_1);
+  measure_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "measure", [__arg_0, __arg_1, __arg_2]);
 
-  static getEntriesByType_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Performance_getEntriesByType_Callback";
-  getEntriesByType_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getEntriesByType_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  memory_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "memory");
 
-  static getEntries_Callback_0(mthis) native "Performance_getEntries_Callback";
-  getEntries_Callback_0_(mthis) => getEntries_Callback_0(mthis);
+  navigation_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "navigation");
 
-  static getEntries_Callback_1(mthis, __arg_0) native "Performance_getEntries_Callback";
-  getEntries_Callback_1_(mthis, __arg_0) => getEntries_Callback_1(mthis, __arg_0);
+  now_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "now", []);
 
-  static getEntries_Callback_2(mthis, __arg_0, __arg_1) native "Performance_getEntries_Callback";
-  getEntries_Callback_2_(mthis, __arg_0, __arg_1) => getEntries_Callback_2(mthis, __arg_0, __arg_1);
+  onwebkitresourcetimingbufferfull_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onwebkitresourcetimingbufferfull");
 
-  static mark_Callback_0(mthis) native "Performance_mark_Callback";
-  mark_Callback_0_(mthis) => mark_Callback_0(mthis);
+  onwebkitresourcetimingbufferfull_Setter_(mthis, __arg_0) => mthis["onwebkitresourcetimingbufferfull"] = __arg_0;
 
-  static mark_Callback_1(mthis, __arg_0) native "Performance_mark_Callback";
-  mark_Callback_1_(mthis, __arg_0) => mark_Callback_1(mthis, __arg_0);
+  timing_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "timing");
 
-  static mark_Callback_2(mthis, __arg_0, __arg_1) native "Performance_mark_Callback";
-  mark_Callback_2_(mthis, __arg_0, __arg_1) => mark_Callback_2(mthis, __arg_0, __arg_1);
+  webkitClearResourceTimings_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "webkitClearResourceTimings", []);
 
-  static mark_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Performance_mark_Callback";
-  mark_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => mark_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  webkitSetResourceTimingBufferSize_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "webkitSetResourceTimingBufferSize", []);
 
-  static measure_Callback_0(mthis) native "Performance_measure_Callback";
-  measure_Callback_0_(mthis) => measure_Callback_0(mthis);
-
-  static measure_Callback_1(mthis, __arg_0) native "Performance_measure_Callback";
-  measure_Callback_1_(mthis, __arg_0) => measure_Callback_1(mthis, __arg_0);
-
-  static measure_Callback_2(mthis, __arg_0, __arg_1) native "Performance_measure_Callback";
-  measure_Callback_2_(mthis, __arg_0, __arg_1) => measure_Callback_2(mthis, __arg_0, __arg_1);
-
-  static measure_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Performance_measure_Callback";
-  measure_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => measure_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static measure_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Performance_measure_Callback";
-  measure_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => measure_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static measure_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "Performance_measure_Callback";
-  measure_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => measure_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
-
-  static memory_Getter(mthis) native "Performance_memory_Getter";
-  memory_Getter_(mthis) => memory_Getter(mthis);
-
-  static navigation_Getter(mthis) native "Performance_navigation_Getter";
-  navigation_Getter_(mthis) => navigation_Getter(mthis);
-
-  static now_Callback_0(mthis) native "Performance_now_Callback";
-  now_Callback_0_(mthis) => now_Callback_0(mthis);
-
-  static now_Callback_1(mthis, __arg_0) native "Performance_now_Callback";
-  now_Callback_1_(mthis, __arg_0) => now_Callback_1(mthis, __arg_0);
-
-  static now_Callback_2(mthis, __arg_0, __arg_1) native "Performance_now_Callback";
-  now_Callback_2_(mthis, __arg_0, __arg_1) => now_Callback_2(mthis, __arg_0, __arg_1);
-
-  static onwebkitresourcetimingbufferfull_Getter(mthis) native "Performance_onwebkitresourcetimingbufferfull_Getter";
-  onwebkitresourcetimingbufferfull_Getter_(mthis) => onwebkitresourcetimingbufferfull_Getter(mthis);
-
-  static onwebkitresourcetimingbufferfull_Setter(mthis, __arg_0) native "Performance_onwebkitresourcetimingbufferfull_Setter";
-  onwebkitresourcetimingbufferfull_Setter_(mthis, __arg_0) => onwebkitresourcetimingbufferfull_Setter(mthis, __arg_0);
-
-  static timing_Getter(mthis) native "Performance_timing_Getter";
-  timing_Getter_(mthis) => timing_Getter(mthis);
-
-  static webkitClearResourceTimings_Callback_0(mthis) native "Performance_webkitClearResourceTimings_Callback";
-  webkitClearResourceTimings_Callback_0_(mthis) => webkitClearResourceTimings_Callback_0(mthis);
-
-  static webkitClearResourceTimings_Callback_1(mthis, __arg_0) native "Performance_webkitClearResourceTimings_Callback";
-  webkitClearResourceTimings_Callback_1_(mthis, __arg_0) => webkitClearResourceTimings_Callback_1(mthis, __arg_0);
-
-  static webkitClearResourceTimings_Callback_2(mthis, __arg_0, __arg_1) native "Performance_webkitClearResourceTimings_Callback";
-  webkitClearResourceTimings_Callback_2_(mthis, __arg_0, __arg_1) => webkitClearResourceTimings_Callback_2(mthis, __arg_0, __arg_1);
-
-  static webkitSetResourceTimingBufferSize_Callback_0(mthis) native "Performance_webkitSetResourceTimingBufferSize_Callback";
-  webkitSetResourceTimingBufferSize_Callback_0_(mthis) => webkitSetResourceTimingBufferSize_Callback_0(mthis);
-
-  static webkitSetResourceTimingBufferSize_Callback_1(mthis, __arg_0) native "Performance_webkitSetResourceTimingBufferSize_Callback";
-  webkitSetResourceTimingBufferSize_Callback_1_(mthis, __arg_0) => webkitSetResourceTimingBufferSize_Callback_1(mthis, __arg_0);
-
-  static webkitSetResourceTimingBufferSize_Callback_2(mthis, __arg_0, __arg_1) native "Performance_webkitSetResourceTimingBufferSize_Callback";
-  webkitSetResourceTimingBufferSize_Callback_2_(mthis, __arg_0, __arg_1) => webkitSetResourceTimingBufferSize_Callback_2(mthis, __arg_0, __arg_1);
-
-  static webkitSetResourceTimingBufferSize_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Performance_webkitSetResourceTimingBufferSize_Callback";
-  webkitSetResourceTimingBufferSize_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => webkitSetResourceTimingBufferSize_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  webkitSetResourceTimingBufferSize_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "webkitSetResourceTimingBufferSize", [__arg_0]);
 
 }
 
 class BlinkPerformanceEntry {
   static final instance = new BlinkPerformanceEntry();
 
-  static duration_Getter(mthis) native "PerformanceEntry_duration_Getter";
-  duration_Getter_(mthis) => duration_Getter(mthis);
+  duration_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "duration");
 
-  static entryType_Getter(mthis) native "PerformanceEntry_entryType_Getter";
-  entryType_Getter_(mthis) => entryType_Getter(mthis);
+  entryType_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "entryType");
 
-  static name_Getter(mthis) native "PerformanceEntry_name_Getter";
-  name_Getter_(mthis) => name_Getter(mthis);
+  name_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "name");
 
-  static startTime_Getter(mthis) native "PerformanceEntry_startTime_Getter";
-  startTime_Getter_(mthis) => startTime_Getter(mthis);
+  startTime_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "startTime");
 
 }
 
@@ -17606,120 +9683,85 @@
 class BlinkPerformanceNavigation {
   static final instance = new BlinkPerformanceNavigation();
 
-  static redirectCount_Getter(mthis) native "PerformanceNavigation_redirectCount_Getter";
-  redirectCount_Getter_(mthis) => redirectCount_Getter(mthis);
+  redirectCount_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "redirectCount");
 
-  static type_Getter(mthis) native "PerformanceNavigation_type_Getter";
-  type_Getter_(mthis) => type_Getter(mthis);
+  type_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "type");
 
 }
 
 class BlinkPerformanceResourceTiming extends BlinkPerformanceEntry {
   static final instance = new BlinkPerformanceResourceTiming();
 
-  static connectEnd_Getter(mthis) native "PerformanceResourceTiming_connectEnd_Getter";
-  connectEnd_Getter_(mthis) => connectEnd_Getter(mthis);
+  connectEnd_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "connectEnd");
 
-  static connectStart_Getter(mthis) native "PerformanceResourceTiming_connectStart_Getter";
-  connectStart_Getter_(mthis) => connectStart_Getter(mthis);
+  connectStart_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "connectStart");
 
-  static domainLookupEnd_Getter(mthis) native "PerformanceResourceTiming_domainLookupEnd_Getter";
-  domainLookupEnd_Getter_(mthis) => domainLookupEnd_Getter(mthis);
+  domainLookupEnd_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "domainLookupEnd");
 
-  static domainLookupStart_Getter(mthis) native "PerformanceResourceTiming_domainLookupStart_Getter";
-  domainLookupStart_Getter_(mthis) => domainLookupStart_Getter(mthis);
+  domainLookupStart_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "domainLookupStart");
 
-  static fetchStart_Getter(mthis) native "PerformanceResourceTiming_fetchStart_Getter";
-  fetchStart_Getter_(mthis) => fetchStart_Getter(mthis);
+  fetchStart_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "fetchStart");
 
-  static initiatorType_Getter(mthis) native "PerformanceResourceTiming_initiatorType_Getter";
-  initiatorType_Getter_(mthis) => initiatorType_Getter(mthis);
+  initiatorType_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "initiatorType");
 
-  static redirectEnd_Getter(mthis) native "PerformanceResourceTiming_redirectEnd_Getter";
-  redirectEnd_Getter_(mthis) => redirectEnd_Getter(mthis);
+  redirectEnd_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "redirectEnd");
 
-  static redirectStart_Getter(mthis) native "PerformanceResourceTiming_redirectStart_Getter";
-  redirectStart_Getter_(mthis) => redirectStart_Getter(mthis);
+  redirectStart_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "redirectStart");
 
-  static requestStart_Getter(mthis) native "PerformanceResourceTiming_requestStart_Getter";
-  requestStart_Getter_(mthis) => requestStart_Getter(mthis);
+  requestStart_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "requestStart");
 
-  static responseEnd_Getter(mthis) native "PerformanceResourceTiming_responseEnd_Getter";
-  responseEnd_Getter_(mthis) => responseEnd_Getter(mthis);
+  responseEnd_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "responseEnd");
 
-  static responseStart_Getter(mthis) native "PerformanceResourceTiming_responseStart_Getter";
-  responseStart_Getter_(mthis) => responseStart_Getter(mthis);
+  responseStart_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "responseStart");
 
-  static secureConnectionStart_Getter(mthis) native "PerformanceResourceTiming_secureConnectionStart_Getter";
-  secureConnectionStart_Getter_(mthis) => secureConnectionStart_Getter(mthis);
+  secureConnectionStart_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "secureConnectionStart");
 
 }
 
 class BlinkPerformanceTiming {
   static final instance = new BlinkPerformanceTiming();
 
-  static connectEnd_Getter(mthis) native "PerformanceTiming_connectEnd_Getter";
-  connectEnd_Getter_(mthis) => connectEnd_Getter(mthis);
+  connectEnd_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "connectEnd");
 
-  static connectStart_Getter(mthis) native "PerformanceTiming_connectStart_Getter";
-  connectStart_Getter_(mthis) => connectStart_Getter(mthis);
+  connectStart_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "connectStart");
 
-  static domComplete_Getter(mthis) native "PerformanceTiming_domComplete_Getter";
-  domComplete_Getter_(mthis) => domComplete_Getter(mthis);
+  domComplete_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "domComplete");
 
-  static domContentLoadedEventEnd_Getter(mthis) native "PerformanceTiming_domContentLoadedEventEnd_Getter";
-  domContentLoadedEventEnd_Getter_(mthis) => domContentLoadedEventEnd_Getter(mthis);
+  domContentLoadedEventEnd_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "domContentLoadedEventEnd");
 
-  static domContentLoadedEventStart_Getter(mthis) native "PerformanceTiming_domContentLoadedEventStart_Getter";
-  domContentLoadedEventStart_Getter_(mthis) => domContentLoadedEventStart_Getter(mthis);
+  domContentLoadedEventStart_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "domContentLoadedEventStart");
 
-  static domInteractive_Getter(mthis) native "PerformanceTiming_domInteractive_Getter";
-  domInteractive_Getter_(mthis) => domInteractive_Getter(mthis);
+  domInteractive_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "domInteractive");
 
-  static domLoading_Getter(mthis) native "PerformanceTiming_domLoading_Getter";
-  domLoading_Getter_(mthis) => domLoading_Getter(mthis);
+  domLoading_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "domLoading");
 
-  static domainLookupEnd_Getter(mthis) native "PerformanceTiming_domainLookupEnd_Getter";
-  domainLookupEnd_Getter_(mthis) => domainLookupEnd_Getter(mthis);
+  domainLookupEnd_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "domainLookupEnd");
 
-  static domainLookupStart_Getter(mthis) native "PerformanceTiming_domainLookupStart_Getter";
-  domainLookupStart_Getter_(mthis) => domainLookupStart_Getter(mthis);
+  domainLookupStart_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "domainLookupStart");
 
-  static fetchStart_Getter(mthis) native "PerformanceTiming_fetchStart_Getter";
-  fetchStart_Getter_(mthis) => fetchStart_Getter(mthis);
+  fetchStart_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "fetchStart");
 
-  static loadEventEnd_Getter(mthis) native "PerformanceTiming_loadEventEnd_Getter";
-  loadEventEnd_Getter_(mthis) => loadEventEnd_Getter(mthis);
+  loadEventEnd_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "loadEventEnd");
 
-  static loadEventStart_Getter(mthis) native "PerformanceTiming_loadEventStart_Getter";
-  loadEventStart_Getter_(mthis) => loadEventStart_Getter(mthis);
+  loadEventStart_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "loadEventStart");
 
-  static navigationStart_Getter(mthis) native "PerformanceTiming_navigationStart_Getter";
-  navigationStart_Getter_(mthis) => navigationStart_Getter(mthis);
+  navigationStart_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "navigationStart");
 
-  static redirectEnd_Getter(mthis) native "PerformanceTiming_redirectEnd_Getter";
-  redirectEnd_Getter_(mthis) => redirectEnd_Getter(mthis);
+  redirectEnd_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "redirectEnd");
 
-  static redirectStart_Getter(mthis) native "PerformanceTiming_redirectStart_Getter";
-  redirectStart_Getter_(mthis) => redirectStart_Getter(mthis);
+  redirectStart_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "redirectStart");
 
-  static requestStart_Getter(mthis) native "PerformanceTiming_requestStart_Getter";
-  requestStart_Getter_(mthis) => requestStart_Getter(mthis);
+  requestStart_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "requestStart");
 
-  static responseEnd_Getter(mthis) native "PerformanceTiming_responseEnd_Getter";
-  responseEnd_Getter_(mthis) => responseEnd_Getter(mthis);
+  responseEnd_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "responseEnd");
 
-  static responseStart_Getter(mthis) native "PerformanceTiming_responseStart_Getter";
-  responseStart_Getter_(mthis) => responseStart_Getter(mthis);
+  responseStart_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "responseStart");
 
-  static secureConnectionStart_Getter(mthis) native "PerformanceTiming_secureConnectionStart_Getter";
-  secureConnectionStart_Getter_(mthis) => secureConnectionStart_Getter(mthis);
+  secureConnectionStart_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "secureConnectionStart");
 
-  static unloadEventEnd_Getter(mthis) native "PerformanceTiming_unloadEventEnd_Getter";
-  unloadEventEnd_Getter_(mthis) => unloadEventEnd_Getter(mthis);
+  unloadEventEnd_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "unloadEventEnd");
 
-  static unloadEventStart_Getter(mthis) native "PerformanceTiming_unloadEventStart_Getter";
-  unloadEventStart_Getter_(mthis) => unloadEventStart_Getter(mthis);
+  unloadEventStart_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "unloadEventStart");
 
 }
 
@@ -17731,1471 +9773,739 @@
 class BlinkPlugin {
   static final instance = new BlinkPlugin();
 
-  static $__getter___Callback_1(mthis, __arg_0) native "Plugin___getter___Callback";
-  $__getter___Callback_1_(mthis, __arg_0) => $__getter___Callback_1(mthis, __arg_0);
+  $__getter___Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "__getter__", [__arg_0]);
 
-  static description_Getter(mthis) native "Plugin_description_Getter";
-  description_Getter_(mthis) => description_Getter(mthis);
+  description_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "description");
 
-  static filename_Getter(mthis) native "Plugin_filename_Getter";
-  filename_Getter_(mthis) => filename_Getter(mthis);
+  filename_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "filename");
 
-  static item_Callback_0(mthis) native "Plugin_item_Callback";
-  item_Callback_0_(mthis) => item_Callback_0(mthis);
+  item_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "item", []);
 
-  static item_Callback_1(mthis, __arg_0) native "Plugin_item_Callback";
-  item_Callback_1_(mthis, __arg_0) => item_Callback_1(mthis, __arg_0);
+  item_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "item", [__arg_0]);
 
-  static item_Callback_2(mthis, __arg_0, __arg_1) native "Plugin_item_Callback";
-  item_Callback_2_(mthis, __arg_0, __arg_1) => item_Callback_2(mthis, __arg_0, __arg_1);
+  length_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "length");
 
-  static item_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Plugin_item_Callback";
-  item_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => item_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  name_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "name");
 
-  static length_Getter(mthis) native "Plugin_length_Getter";
-  length_Getter_(mthis) => length_Getter(mthis);
+  namedItem_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "namedItem", []);
 
-  static name_Getter(mthis) native "Plugin_name_Getter";
-  name_Getter_(mthis) => name_Getter(mthis);
-
-  static namedItem_Callback_0(mthis) native "Plugin_namedItem_Callback";
-  namedItem_Callback_0_(mthis) => namedItem_Callback_0(mthis);
-
-  static namedItem_Callback_1(mthis, __arg_0) native "Plugin_namedItem_Callback";
-  namedItem_Callback_1_(mthis, __arg_0) => namedItem_Callback_1(mthis, __arg_0);
-
-  static namedItem_Callback_2(mthis, __arg_0, __arg_1) native "Plugin_namedItem_Callback";
-  namedItem_Callback_2_(mthis, __arg_0, __arg_1) => namedItem_Callback_2(mthis, __arg_0, __arg_1);
-
-  static namedItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Plugin_namedItem_Callback";
-  namedItem_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => namedItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  namedItem_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "namedItem", [__arg_0]);
 
 }
 
 class BlinkPluginArray {
   static final instance = new BlinkPluginArray();
 
-  static $__getter___Callback_1(mthis, __arg_0) native "PluginArray___getter___Callback";
-  $__getter___Callback_1_(mthis, __arg_0) => $__getter___Callback_1(mthis, __arg_0);
+  $__getter___Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "__getter__", [__arg_0]);
 
-  static item_Callback_0(mthis) native "PluginArray_item_Callback";
-  item_Callback_0_(mthis) => item_Callback_0(mthis);
+  item_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "item", []);
 
-  static item_Callback_1(mthis, __arg_0) native "PluginArray_item_Callback";
-  item_Callback_1_(mthis, __arg_0) => item_Callback_1(mthis, __arg_0);
+  item_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "item", [__arg_0]);
 
-  static item_Callback_2(mthis, __arg_0, __arg_1) native "PluginArray_item_Callback";
-  item_Callback_2_(mthis, __arg_0, __arg_1) => item_Callback_2(mthis, __arg_0, __arg_1);
+  length_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "length");
 
-  static item_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "PluginArray_item_Callback";
-  item_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => item_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  namedItem_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "namedItem", []);
 
-  static length_Getter(mthis) native "PluginArray_length_Getter";
-  length_Getter_(mthis) => length_Getter(mthis);
+  namedItem_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "namedItem", [__arg_0]);
 
-  static namedItem_Callback_0(mthis) native "PluginArray_namedItem_Callback";
-  namedItem_Callback_0_(mthis) => namedItem_Callback_0(mthis);
+  refresh_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "refresh", []);
 
-  static namedItem_Callback_1(mthis, __arg_0) native "PluginArray_namedItem_Callback";
-  namedItem_Callback_1_(mthis, __arg_0) => namedItem_Callback_1(mthis, __arg_0);
-
-  static namedItem_Callback_2(mthis, __arg_0, __arg_1) native "PluginArray_namedItem_Callback";
-  namedItem_Callback_2_(mthis, __arg_0, __arg_1) => namedItem_Callback_2(mthis, __arg_0, __arg_1);
-
-  static namedItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "PluginArray_namedItem_Callback";
-  namedItem_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => namedItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static refresh_Callback_0(mthis) native "PluginArray_refresh_Callback";
-  refresh_Callback_0_(mthis) => refresh_Callback_0(mthis);
-
-  static refresh_Callback_1(mthis, __arg_0) native "PluginArray_refresh_Callback";
-  refresh_Callback_1_(mthis, __arg_0) => refresh_Callback_1(mthis, __arg_0);
-
-  static refresh_Callback_2(mthis, __arg_0, __arg_1) native "PluginArray_refresh_Callback";
-  refresh_Callback_2_(mthis, __arg_0, __arg_1) => refresh_Callback_2(mthis, __arg_0, __arg_1);
-
-  static refresh_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "PluginArray_refresh_Callback";
-  refresh_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => refresh_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  refresh_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "refresh", [__arg_0]);
 
 }
 
 class BlinkPluginPlaceholderElement extends BlinkHTMLDivElement {
   static final instance = new BlinkPluginPlaceholderElement();
 
-  static createdCallback_Callback_0(mthis) native "PluginPlaceholderElement_createdCallback_Callback";
-  createdCallback_Callback_0_(mthis) => createdCallback_Callback_0(mthis);
+  createdCallback_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createdCallback", []);
 
-  static createdCallback_Callback_1(mthis, __arg_0) native "PluginPlaceholderElement_createdCallback_Callback";
-  createdCallback_Callback_1_(mthis, __arg_0) => createdCallback_Callback_1(mthis, __arg_0);
+  message_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "message");
 
-  static createdCallback_Callback_2(mthis, __arg_0, __arg_1) native "PluginPlaceholderElement_createdCallback_Callback";
-  createdCallback_Callback_2_(mthis, __arg_0, __arg_1) => createdCallback_Callback_2(mthis, __arg_0, __arg_1);
-
-  static message_Getter(mthis) native "PluginPlaceholderElement_message_Getter";
-  message_Getter_(mthis) => message_Getter(mthis);
-
-  static message_Setter(mthis, __arg_0) native "PluginPlaceholderElement_message_Setter";
-  message_Setter_(mthis, __arg_0) => message_Setter(mthis, __arg_0);
+  message_Setter_(mthis, __arg_0) => mthis["message"] = __arg_0;
 
 }
 
 class BlinkPopStateEvent extends BlinkEvent {
   static final instance = new BlinkPopStateEvent();
 
-  static constructorCallback_2(__arg_0, __arg_1) native "PopStateEvent_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  constructorCallback_2_(__arg_0, __arg_1) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "PopStateEvent"), [__arg_0, __arg_1]);
 
-  static state_Getter(mthis) native "PopStateEvent_state_Getter";
-  state_Getter_(mthis) => state_Getter(mthis);
+  state_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "state");
 
 }
 
 class BlinkPositionError {
   static final instance = new BlinkPositionError();
 
-  static code_Getter(mthis) native "PositionError_code_Getter";
-  code_Getter_(mthis) => code_Getter(mthis);
+  code_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "code");
 
-  static message_Getter(mthis) native "PositionError_message_Getter";
-  message_Getter_(mthis) => message_Getter(mthis);
+  message_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "message");
 
 }
 
 class BlinkPresentation extends BlinkEventTarget {
   static final instance = new BlinkPresentation();
 
-  static onavailablechange_Getter(mthis) native "Presentation_onavailablechange_Getter";
-  onavailablechange_Getter_(mthis) => onavailablechange_Getter(mthis);
+  onavailablechange_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onavailablechange");
 
-  static onavailablechange_Setter(mthis, __arg_0) native "Presentation_onavailablechange_Setter";
-  onavailablechange_Setter_(mthis, __arg_0) => onavailablechange_Setter(mthis, __arg_0);
+  onavailablechange_Setter_(mthis, __arg_0) => mthis["onavailablechange"] = __arg_0;
 
 }
 
 class BlinkProcessingInstruction extends BlinkCharacterData {
   static final instance = new BlinkProcessingInstruction();
 
-  static sheet_Getter(mthis) native "ProcessingInstruction_sheet_Getter";
-  sheet_Getter_(mthis) => sheet_Getter(mthis);
+  sheet_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "sheet");
 
-  static target_Getter(mthis) native "ProcessingInstruction_target_Getter";
-  target_Getter_(mthis) => target_Getter(mthis);
+  target_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "target");
 
 }
 
 class BlinkProgressEvent extends BlinkEvent {
   static final instance = new BlinkProgressEvent();
 
-  static constructorCallback_2(__arg_0, __arg_1) native "ProgressEvent_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  constructorCallback_2_(__arg_0, __arg_1) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "ProgressEvent"), [__arg_0, __arg_1]);
 
-  static lengthComputable_Getter(mthis) native "ProgressEvent_lengthComputable_Getter";
-  lengthComputable_Getter_(mthis) => lengthComputable_Getter(mthis);
+  lengthComputable_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "lengthComputable");
 
-  static loaded_Getter(mthis) native "ProgressEvent_loaded_Getter";
-  loaded_Getter_(mthis) => loaded_Getter(mthis);
+  loaded_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "loaded");
 
-  static total_Getter(mthis) native "ProgressEvent_total_Getter";
-  total_Getter_(mthis) => total_Getter(mthis);
+  total_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "total");
 
 }
 
 class BlinkPushEvent extends BlinkEvent {
   static final instance = new BlinkPushEvent();
 
-  static constructorCallback_2(__arg_0, __arg_1) native "PushEvent_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  constructorCallback_2_(__arg_0, __arg_1) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "PushEvent"), [__arg_0, __arg_1]);
 
-  static data_Getter(mthis) native "PushEvent_data_Getter";
-  data_Getter_(mthis) => data_Getter(mthis);
+  data_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "data");
 
 }
 
 class BlinkPushManager {
   static final instance = new BlinkPushManager();
 
-  static register_Callback_0(mthis) native "PushManager_register_Callback";
-  register_Callback_0_(mthis) => register_Callback_0(mthis);
+  register_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "register", []);
 
-  static register_Callback_1(mthis, __arg_0) native "PushManager_register_Callback";
-  register_Callback_1_(mthis, __arg_0) => register_Callback_1(mthis, __arg_0);
-
-  static register_Callback_2(mthis, __arg_0, __arg_1) native "PushManager_register_Callback";
-  register_Callback_2_(mthis, __arg_0, __arg_1) => register_Callback_2(mthis, __arg_0, __arg_1);
-
-  static register_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "PushManager_register_Callback";
-  register_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => register_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  register_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "register", [__arg_0]);
 
 }
 
 class BlinkPushRegistration {
   static final instance = new BlinkPushRegistration();
 
-  static pushEndpoint_Getter(mthis) native "PushRegistration_pushEndpoint_Getter";
-  pushEndpoint_Getter_(mthis) => pushEndpoint_Getter(mthis);
+  pushEndpoint_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "pushEndpoint");
 
-  static pushRegistrationId_Getter(mthis) native "PushRegistration_pushRegistrationId_Getter";
-  pushRegistrationId_Getter_(mthis) => pushRegistrationId_Getter(mthis);
+  pushRegistrationId_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "pushRegistrationId");
 
 }
 
 class BlinkRGBColor {
   static final instance = new BlinkRGBColor();
 
-  static blue_Getter(mthis) native "RGBColor_blue_Getter";
-  blue_Getter_(mthis) => blue_Getter(mthis);
+  blue_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "blue");
 
-  static green_Getter(mthis) native "RGBColor_green_Getter";
-  green_Getter_(mthis) => green_Getter(mthis);
+  green_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "green");
 
-  static red_Getter(mthis) native "RGBColor_red_Getter";
-  red_Getter_(mthis) => red_Getter(mthis);
+  red_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "red");
 
 }
 
 class BlinkRTCDTMFSender extends BlinkEventTarget {
   static final instance = new BlinkRTCDTMFSender();
 
-  static canInsertDTMF_Getter(mthis) native "RTCDTMFSender_canInsertDTMF_Getter";
-  canInsertDTMF_Getter_(mthis) => canInsertDTMF_Getter(mthis);
+  canInsertDTMF_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "canInsertDTMF");
 
-  static duration_Getter(mthis) native "RTCDTMFSender_duration_Getter";
-  duration_Getter_(mthis) => duration_Getter(mthis);
+  duration_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "duration");
 
-  static insertDTMF_Callback_0(mthis) native "RTCDTMFSender_insertDTMF_Callback";
-  insertDTMF_Callback_0_(mthis) => insertDTMF_Callback_0(mthis);
+  insertDTMF_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "insertDTMF", []);
 
-  static insertDTMF_Callback_1(mthis, __arg_0) native "RTCDTMFSender_insertDTMF_Callback";
-  insertDTMF_Callback_1_(mthis, __arg_0) => insertDTMF_Callback_1(mthis, __arg_0);
+  insertDTMF_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "insertDTMF", [__arg_0]);
 
-  static insertDTMF_Callback_2(mthis, __arg_0, __arg_1) native "RTCDTMFSender_insertDTMF_Callback";
-  insertDTMF_Callback_2_(mthis, __arg_0, __arg_1) => insertDTMF_Callback_2(mthis, __arg_0, __arg_1);
+  insertDTMF_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "insertDTMF", [__arg_0, __arg_1]);
 
-  static insertDTMF_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "RTCDTMFSender_insertDTMF_Callback";
-  insertDTMF_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => insertDTMF_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  insertDTMF_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "insertDTMF", [__arg_0, __arg_1, __arg_2]);
 
-  static insertDTMF_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "RTCDTMFSender_insertDTMF_Callback";
-  insertDTMF_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => insertDTMF_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  interToneGap_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "interToneGap");
 
-  static insertDTMF_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "RTCDTMFSender_insertDTMF_Callback";
-  insertDTMF_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => insertDTMF_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  ontonechange_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ontonechange");
 
-  static interToneGap_Getter(mthis) native "RTCDTMFSender_interToneGap_Getter";
-  interToneGap_Getter_(mthis) => interToneGap_Getter(mthis);
+  ontonechange_Setter_(mthis, __arg_0) => mthis["ontonechange"] = __arg_0;
 
-  static ontonechange_Getter(mthis) native "RTCDTMFSender_ontonechange_Getter";
-  ontonechange_Getter_(mthis) => ontonechange_Getter(mthis);
+  toneBuffer_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "toneBuffer");
 
-  static ontonechange_Setter(mthis, __arg_0) native "RTCDTMFSender_ontonechange_Setter";
-  ontonechange_Setter_(mthis, __arg_0) => ontonechange_Setter(mthis, __arg_0);
-
-  static toneBuffer_Getter(mthis) native "RTCDTMFSender_toneBuffer_Getter";
-  toneBuffer_Getter_(mthis) => toneBuffer_Getter(mthis);
-
-  static track_Getter(mthis) native "RTCDTMFSender_track_Getter";
-  track_Getter_(mthis) => track_Getter(mthis);
+  track_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "track");
 
 }
 
 class BlinkRTCDTMFToneChangeEvent extends BlinkEvent {
   static final instance = new BlinkRTCDTMFToneChangeEvent();
 
-  static constructorCallback_2(__arg_0, __arg_1) native "RTCDTMFToneChangeEvent_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  constructorCallback_2_(__arg_0, __arg_1) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "RTCDTMFToneChangeEvent"), [__arg_0, __arg_1]);
 
-  static tone_Getter(mthis) native "RTCDTMFToneChangeEvent_tone_Getter";
-  tone_Getter_(mthis) => tone_Getter(mthis);
+  tone_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "tone");
 
 }
 
 class BlinkRTCDataChannel extends BlinkEventTarget {
   static final instance = new BlinkRTCDataChannel();
 
-  static binaryType_Getter(mthis) native "RTCDataChannel_binaryType_Getter";
-  binaryType_Getter_(mthis) => binaryType_Getter(mthis);
+  binaryType_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "binaryType");
 
-  static binaryType_Setter(mthis, __arg_0) native "RTCDataChannel_binaryType_Setter";
-  binaryType_Setter_(mthis, __arg_0) => binaryType_Setter(mthis, __arg_0);
+  binaryType_Setter_(mthis, __arg_0) => mthis["binaryType"] = __arg_0;
 
-  static bufferedAmount_Getter(mthis) native "RTCDataChannel_bufferedAmount_Getter";
-  bufferedAmount_Getter_(mthis) => bufferedAmount_Getter(mthis);
+  bufferedAmount_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "bufferedAmount");
 
-  static close_Callback_0(mthis) native "RTCDataChannel_close_Callback";
-  close_Callback_0_(mthis) => close_Callback_0(mthis);
+  close_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "close", []);
 
-  static close_Callback_1(mthis, __arg_0) native "RTCDataChannel_close_Callback";
-  close_Callback_1_(mthis, __arg_0) => close_Callback_1(mthis, __arg_0);
+  id_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "id");
 
-  static close_Callback_2(mthis, __arg_0, __arg_1) native "RTCDataChannel_close_Callback";
-  close_Callback_2_(mthis, __arg_0, __arg_1) => close_Callback_2(mthis, __arg_0, __arg_1);
+  label_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "label");
 
-  static id_Getter(mthis) native "RTCDataChannel_id_Getter";
-  id_Getter_(mthis) => id_Getter(mthis);
+  maxRetransmitTime_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "maxRetransmitTime");
 
-  static label_Getter(mthis) native "RTCDataChannel_label_Getter";
-  label_Getter_(mthis) => label_Getter(mthis);
+  maxRetransmits_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "maxRetransmits");
 
-  static maxRetransmitTime_Getter(mthis) native "RTCDataChannel_maxRetransmitTime_Getter";
-  maxRetransmitTime_Getter_(mthis) => maxRetransmitTime_Getter(mthis);
+  negotiated_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "negotiated");
 
-  static maxRetransmits_Getter(mthis) native "RTCDataChannel_maxRetransmits_Getter";
-  maxRetransmits_Getter_(mthis) => maxRetransmits_Getter(mthis);
+  onclose_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onclose");
 
-  static negotiated_Getter(mthis) native "RTCDataChannel_negotiated_Getter";
-  negotiated_Getter_(mthis) => negotiated_Getter(mthis);
+  onclose_Setter_(mthis, __arg_0) => mthis["onclose"] = __arg_0;
 
-  static onclose_Getter(mthis) native "RTCDataChannel_onclose_Getter";
-  onclose_Getter_(mthis) => onclose_Getter(mthis);
+  onerror_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onerror");
 
-  static onclose_Setter(mthis, __arg_0) native "RTCDataChannel_onclose_Setter";
-  onclose_Setter_(mthis, __arg_0) => onclose_Setter(mthis, __arg_0);
+  onerror_Setter_(mthis, __arg_0) => mthis["onerror"] = __arg_0;
 
-  static onerror_Getter(mthis) native "RTCDataChannel_onerror_Getter";
-  onerror_Getter_(mthis) => onerror_Getter(mthis);
+  onmessage_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onmessage");
 
-  static onerror_Setter(mthis, __arg_0) native "RTCDataChannel_onerror_Setter";
-  onerror_Setter_(mthis, __arg_0) => onerror_Setter(mthis, __arg_0);
+  onmessage_Setter_(mthis, __arg_0) => mthis["onmessage"] = __arg_0;
 
-  static onmessage_Getter(mthis) native "RTCDataChannel_onmessage_Getter";
-  onmessage_Getter_(mthis) => onmessage_Getter(mthis);
+  onopen_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onopen");
 
-  static onmessage_Setter(mthis, __arg_0) native "RTCDataChannel_onmessage_Setter";
-  onmessage_Setter_(mthis, __arg_0) => onmessage_Setter(mthis, __arg_0);
+  onopen_Setter_(mthis, __arg_0) => mthis["onopen"] = __arg_0;
 
-  static onopen_Getter(mthis) native "RTCDataChannel_onopen_Getter";
-  onopen_Getter_(mthis) => onopen_Getter(mthis);
+  ordered_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ordered");
 
-  static onopen_Setter(mthis, __arg_0) native "RTCDataChannel_onopen_Setter";
-  onopen_Setter_(mthis, __arg_0) => onopen_Setter(mthis, __arg_0);
+  protocol_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "protocol");
 
-  static ordered_Getter(mthis) native "RTCDataChannel_ordered_Getter";
-  ordered_Getter_(mthis) => ordered_Getter(mthis);
+  readyState_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "readyState");
 
-  static protocol_Getter(mthis) native "RTCDataChannel_protocol_Getter";
-  protocol_Getter_(mthis) => protocol_Getter(mthis);
+  reliable_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "reliable");
 
-  static readyState_Getter(mthis) native "RTCDataChannel_readyState_Getter";
-  readyState_Getter_(mthis) => readyState_Getter(mthis);
+  send_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "send", []);
 
-  static reliable_Getter(mthis) native "RTCDataChannel_reliable_Getter";
-  reliable_Getter_(mthis) => reliable_Getter(mthis);
-
-  static send_Callback_0(mthis) native "RTCDataChannel_send_Callback";
-  send_Callback_0_(mthis) => send_Callback_0(mthis);
-
-  static send_Callback_1(mthis, __arg_0) native "RTCDataChannel_send_Callback";
-  send_Callback_1_(mthis, __arg_0) => send_Callback_1(mthis, __arg_0);
-
-  static send_Callback_2(mthis, __arg_0, __arg_1) native "RTCDataChannel_send_Callback";
-  send_Callback_2_(mthis, __arg_0, __arg_1) => send_Callback_2(mthis, __arg_0, __arg_1);
-
-  static send_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "RTCDataChannel_send_Callback";
-  send_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => send_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  send_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "send", [__arg_0]);
 
 }
 
 class BlinkRTCDataChannelEvent extends BlinkEvent {
   static final instance = new BlinkRTCDataChannelEvent();
 
-  static channel_Getter(mthis) native "RTCDataChannelEvent_channel_Getter";
-  channel_Getter_(mthis) => channel_Getter(mthis);
+  channel_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "channel");
 
 }
 
 class BlinkRTCIceCandidate {
   static final instance = new BlinkRTCIceCandidate();
 
-  static candidate_Getter(mthis) native "RTCIceCandidate_candidate_Getter";
-  candidate_Getter_(mthis) => candidate_Getter(mthis);
+  candidate_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "candidate");
 
-  static candidate_Setter(mthis, __arg_0) native "RTCIceCandidate_candidate_Setter";
-  candidate_Setter_(mthis, __arg_0) => candidate_Setter(mthis, __arg_0);
+  candidate_Setter_(mthis, __arg_0) => mthis["candidate"] = __arg_0;
 
-  static constructorCallback_0() native "RTCIceCandidate_constructorCallback";
-  constructorCallback_0_() => constructorCallback_0();
+  constructorCallback_0_() => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "RTCIceCandidate"), []);
 
-  static constructorCallback_1(__arg_0) native "RTCIceCandidate_constructorCallback";
-  constructorCallback_1_(__arg_0) => constructorCallback_1(__arg_0);
+  constructorCallback_1_(__arg_0) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "RTCIceCandidate"), [__arg_0]);
 
-  static constructorCallback_2(__arg_0, __arg_1) native "RTCIceCandidate_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  sdpMLineIndex_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "sdpMLineIndex");
 
-  static constructorCallback_3(__arg_0, __arg_1, __arg_2) native "RTCIceCandidate_constructorCallback";
-  constructorCallback_3_(__arg_0, __arg_1, __arg_2) => constructorCallback_3(__arg_0, __arg_1, __arg_2);
+  sdpMLineIndex_Setter_(mthis, __arg_0) => mthis["sdpMLineIndex"] = __arg_0;
 
-  static sdpMLineIndex_Getter(mthis) native "RTCIceCandidate_sdpMLineIndex_Getter";
-  sdpMLineIndex_Getter_(mthis) => sdpMLineIndex_Getter(mthis);
+  sdpMid_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "sdpMid");
 
-  static sdpMLineIndex_Setter(mthis, __arg_0) native "RTCIceCandidate_sdpMLineIndex_Setter";
-  sdpMLineIndex_Setter_(mthis, __arg_0) => sdpMLineIndex_Setter(mthis, __arg_0);
-
-  static sdpMid_Getter(mthis) native "RTCIceCandidate_sdpMid_Getter";
-  sdpMid_Getter_(mthis) => sdpMid_Getter(mthis);
-
-  static sdpMid_Setter(mthis, __arg_0) native "RTCIceCandidate_sdpMid_Setter";
-  sdpMid_Setter_(mthis, __arg_0) => sdpMid_Setter(mthis, __arg_0);
+  sdpMid_Setter_(mthis, __arg_0) => mthis["sdpMid"] = __arg_0;
 
 }
 
 class BlinkRTCIceCandidateEvent extends BlinkEvent {
   static final instance = new BlinkRTCIceCandidateEvent();
 
-  static candidate_Getter(mthis) native "RTCIceCandidateEvent_candidate_Getter";
-  candidate_Getter_(mthis) => candidate_Getter(mthis);
+  candidate_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "candidate");
 
 }
 
 class BlinkRTCPeerConnection extends BlinkEventTarget {
   static final instance = new BlinkRTCPeerConnection();
 
-  static addIceCandidate_Callback_1(mthis, __arg_0) native "RTCPeerConnection_addIceCandidate_Callback";
-  addIceCandidate_Callback_1_(mthis, __arg_0) => addIceCandidate_Callback_1(mthis, __arg_0);
+  addIceCandidate_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "addIceCandidate", [__arg_0]);
 
-  static addIceCandidate_Callback_2(mthis, __arg_0, __arg_1) native "RTCPeerConnection_addIceCandidate_Callback";
-  addIceCandidate_Callback_2_(mthis, __arg_0, __arg_1) => addIceCandidate_Callback_2(mthis, __arg_0, __arg_1);
+  addIceCandidate_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "addIceCandidate", [__arg_0, __arg_1]);
 
-  static addIceCandidate_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "RTCPeerConnection_addIceCandidate_Callback";
-  addIceCandidate_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => addIceCandidate_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  addIceCandidate_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "addIceCandidate", [__arg_0, __arg_1, __arg_2]);
 
-  static addIceCandidate_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "RTCPeerConnection_addIceCandidate_Callback";
-  addIceCandidate_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => addIceCandidate_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  addStream_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "addStream", []);
 
-  static addIceCandidate_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "RTCPeerConnection_addIceCandidate_Callback";
-  addIceCandidate_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => addIceCandidate_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  addStream_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "addStream", [__arg_0]);
 
-  static addStream_Callback_0(mthis) native "RTCPeerConnection_addStream_Callback";
-  addStream_Callback_0_(mthis) => addStream_Callback_0(mthis);
+  addStream_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "addStream", [__arg_0, __arg_1]);
 
-  static addStream_Callback_1(mthis, __arg_0) native "RTCPeerConnection_addStream_Callback";
-  addStream_Callback_1_(mthis, __arg_0) => addStream_Callback_1(mthis, __arg_0);
+  close_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "close", []);
 
-  static addStream_Callback_2(mthis, __arg_0, __arg_1) native "RTCPeerConnection_addStream_Callback";
-  addStream_Callback_2_(mthis, __arg_0, __arg_1) => addStream_Callback_2(mthis, __arg_0, __arg_1);
+  constructorCallback_0_() => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "webkitRTCPeerConnection"), []);
 
-  static addStream_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "RTCPeerConnection_addStream_Callback";
-  addStream_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => addStream_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  constructorCallback_1_(__arg_0) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "webkitRTCPeerConnection"), [__arg_0]);
 
-  static addStream_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "RTCPeerConnection_addStream_Callback";
-  addStream_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => addStream_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  constructorCallback_2_(__arg_0, __arg_1) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "webkitRTCPeerConnection"), [__arg_0, __arg_1]);
 
-  static close_Callback_0(mthis) native "RTCPeerConnection_close_Callback";
-  close_Callback_0_(mthis) => close_Callback_0(mthis);
+  createAnswer_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createAnswer", []);
 
-  static close_Callback_1(mthis, __arg_0) native "RTCPeerConnection_close_Callback";
-  close_Callback_1_(mthis, __arg_0) => close_Callback_1(mthis, __arg_0);
+  createAnswer_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "createAnswer", [__arg_0]);
 
-  static close_Callback_2(mthis, __arg_0, __arg_1) native "RTCPeerConnection_close_Callback";
-  close_Callback_2_(mthis, __arg_0, __arg_1) => close_Callback_2(mthis, __arg_0, __arg_1);
+  createAnswer_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "createAnswer", [__arg_0, __arg_1]);
 
-  static constructorCallback_0() native "RTCPeerConnection_constructorCallback";
-  constructorCallback_0_() => constructorCallback_0();
+  createAnswer_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "createAnswer", [__arg_0, __arg_1, __arg_2]);
 
-  static constructorCallback_1(__arg_0) native "RTCPeerConnection_constructorCallback";
-  constructorCallback_1_(__arg_0) => constructorCallback_1(__arg_0);
+  createDTMFSender_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createDTMFSender", []);
 
-  static constructorCallback_2(__arg_0, __arg_1) native "RTCPeerConnection_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  createDTMFSender_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "createDTMFSender", [__arg_0]);
 
-  static constructorCallback_3(__arg_0, __arg_1, __arg_2) native "RTCPeerConnection_constructorCallback";
-  constructorCallback_3_(__arg_0, __arg_1, __arg_2) => constructorCallback_3(__arg_0, __arg_1, __arg_2);
+  createDataChannel_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createDataChannel", []);
 
-  static constructorCallback_4(__arg_0, __arg_1, __arg_2, __arg_3) native "RTCPeerConnection_constructorCallback";
-  constructorCallback_4_(__arg_0, __arg_1, __arg_2, __arg_3) => constructorCallback_4(__arg_0, __arg_1, __arg_2, __arg_3);
+  createDataChannel_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "createDataChannel", [__arg_0]);
 
-  static createAnswer_Callback_0(mthis) native "RTCPeerConnection_createAnswer_Callback";
-  createAnswer_Callback_0_(mthis) => createAnswer_Callback_0(mthis);
+  createDataChannel_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "createDataChannel", [__arg_0, __arg_1]);
 
-  static createAnswer_Callback_1(mthis, __arg_0) native "RTCPeerConnection_createAnswer_Callback";
-  createAnswer_Callback_1_(mthis, __arg_0) => createAnswer_Callback_1(mthis, __arg_0);
+  createOffer_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createOffer", []);
 
-  static createAnswer_Callback_2(mthis, __arg_0, __arg_1) native "RTCPeerConnection_createAnswer_Callback";
-  createAnswer_Callback_2_(mthis, __arg_0, __arg_1) => createAnswer_Callback_2(mthis, __arg_0, __arg_1);
+  createOffer_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "createOffer", [__arg_0]);
 
-  static createAnswer_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "RTCPeerConnection_createAnswer_Callback";
-  createAnswer_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => createAnswer_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  createOffer_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "createOffer", [__arg_0, __arg_1]);
 
-  static createAnswer_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "RTCPeerConnection_createAnswer_Callback";
-  createAnswer_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => createAnswer_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  createOffer_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "createOffer", [__arg_0, __arg_1, __arg_2]);
 
-  static createAnswer_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "RTCPeerConnection_createAnswer_Callback";
-  createAnswer_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => createAnswer_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  getLocalStreams_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getLocalStreams", []);
 
-  static createDTMFSender_Callback_0(mthis) native "RTCPeerConnection_createDTMFSender_Callback";
-  createDTMFSender_Callback_0_(mthis) => createDTMFSender_Callback_0(mthis);
+  getRemoteStreams_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getRemoteStreams", []);
 
-  static createDTMFSender_Callback_1(mthis, __arg_0) native "RTCPeerConnection_createDTMFSender_Callback";
-  createDTMFSender_Callback_1_(mthis, __arg_0) => createDTMFSender_Callback_1(mthis, __arg_0);
+  getStats_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getStats", []);
 
-  static createDTMFSender_Callback_2(mthis, __arg_0, __arg_1) native "RTCPeerConnection_createDTMFSender_Callback";
-  createDTMFSender_Callback_2_(mthis, __arg_0, __arg_1) => createDTMFSender_Callback_2(mthis, __arg_0, __arg_1);
+  getStats_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getStats", [__arg_0]);
 
-  static createDTMFSender_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "RTCPeerConnection_createDTMFSender_Callback";
-  createDTMFSender_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => createDTMFSender_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  getStats_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "getStats", [__arg_0, __arg_1]);
 
-  static createDataChannel_Callback_0(mthis) native "RTCPeerConnection_createDataChannel_Callback";
-  createDataChannel_Callback_0_(mthis) => createDataChannel_Callback_0(mthis);
+  getStreamById_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getStreamById", []);
 
-  static createDataChannel_Callback_1(mthis, __arg_0) native "RTCPeerConnection_createDataChannel_Callback";
-  createDataChannel_Callback_1_(mthis, __arg_0) => createDataChannel_Callback_1(mthis, __arg_0);
+  getStreamById_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getStreamById", [__arg_0]);
 
-  static createDataChannel_Callback_2(mthis, __arg_0, __arg_1) native "RTCPeerConnection_createDataChannel_Callback";
-  createDataChannel_Callback_2_(mthis, __arg_0, __arg_1) => createDataChannel_Callback_2(mthis, __arg_0, __arg_1);
+  iceConnectionState_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "iceConnectionState");
 
-  static createDataChannel_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "RTCPeerConnection_createDataChannel_Callback";
-  createDataChannel_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => createDataChannel_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  iceGatheringState_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "iceGatheringState");
 
-  static createDataChannel_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "RTCPeerConnection_createDataChannel_Callback";
-  createDataChannel_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => createDataChannel_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  localDescription_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "localDescription");
 
-  static createOffer_Callback_0(mthis) native "RTCPeerConnection_createOffer_Callback";
-  createOffer_Callback_0_(mthis) => createOffer_Callback_0(mthis);
+  onaddstream_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onaddstream");
 
-  static createOffer_Callback_1(mthis, __arg_0) native "RTCPeerConnection_createOffer_Callback";
-  createOffer_Callback_1_(mthis, __arg_0) => createOffer_Callback_1(mthis, __arg_0);
+  onaddstream_Setter_(mthis, __arg_0) => mthis["onaddstream"] = __arg_0;
 
-  static createOffer_Callback_2(mthis, __arg_0, __arg_1) native "RTCPeerConnection_createOffer_Callback";
-  createOffer_Callback_2_(mthis, __arg_0, __arg_1) => createOffer_Callback_2(mthis, __arg_0, __arg_1);
+  ondatachannel_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ondatachannel");
 
-  static createOffer_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "RTCPeerConnection_createOffer_Callback";
-  createOffer_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => createOffer_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  ondatachannel_Setter_(mthis, __arg_0) => mthis["ondatachannel"] = __arg_0;
 
-  static createOffer_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "RTCPeerConnection_createOffer_Callback";
-  createOffer_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => createOffer_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  onicecandidate_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onicecandidate");
 
-  static createOffer_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "RTCPeerConnection_createOffer_Callback";
-  createOffer_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => createOffer_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  onicecandidate_Setter_(mthis, __arg_0) => mthis["onicecandidate"] = __arg_0;
 
-  static getLocalStreams_Callback_0(mthis) native "RTCPeerConnection_getLocalStreams_Callback";
-  getLocalStreams_Callback_0_(mthis) => getLocalStreams_Callback_0(mthis);
+  oniceconnectionstatechange_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "oniceconnectionstatechange");
 
-  static getLocalStreams_Callback_1(mthis, __arg_0) native "RTCPeerConnection_getLocalStreams_Callback";
-  getLocalStreams_Callback_1_(mthis, __arg_0) => getLocalStreams_Callback_1(mthis, __arg_0);
+  oniceconnectionstatechange_Setter_(mthis, __arg_0) => mthis["oniceconnectionstatechange"] = __arg_0;
 
-  static getLocalStreams_Callback_2(mthis, __arg_0, __arg_1) native "RTCPeerConnection_getLocalStreams_Callback";
-  getLocalStreams_Callback_2_(mthis, __arg_0, __arg_1) => getLocalStreams_Callback_2(mthis, __arg_0, __arg_1);
+  onnegotiationneeded_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onnegotiationneeded");
 
-  static getRemoteStreams_Callback_0(mthis) native "RTCPeerConnection_getRemoteStreams_Callback";
-  getRemoteStreams_Callback_0_(mthis) => getRemoteStreams_Callback_0(mthis);
+  onnegotiationneeded_Setter_(mthis, __arg_0) => mthis["onnegotiationneeded"] = __arg_0;
 
-  static getRemoteStreams_Callback_1(mthis, __arg_0) native "RTCPeerConnection_getRemoteStreams_Callback";
-  getRemoteStreams_Callback_1_(mthis, __arg_0) => getRemoteStreams_Callback_1(mthis, __arg_0);
+  onremovestream_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onremovestream");
 
-  static getRemoteStreams_Callback_2(mthis, __arg_0, __arg_1) native "RTCPeerConnection_getRemoteStreams_Callback";
-  getRemoteStreams_Callback_2_(mthis, __arg_0, __arg_1) => getRemoteStreams_Callback_2(mthis, __arg_0, __arg_1);
+  onremovestream_Setter_(mthis, __arg_0) => mthis["onremovestream"] = __arg_0;
 
-  static getStats_Callback_0(mthis) native "RTCPeerConnection_getStats_Callback";
-  getStats_Callback_0_(mthis) => getStats_Callback_0(mthis);
+  onsignalingstatechange_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onsignalingstatechange");
 
-  static getStats_Callback_1(mthis, __arg_0) native "RTCPeerConnection_getStats_Callback";
-  getStats_Callback_1_(mthis, __arg_0) => getStats_Callback_1(mthis, __arg_0);
-
-  static getStats_Callback_2(mthis, __arg_0, __arg_1) native "RTCPeerConnection_getStats_Callback";
-  getStats_Callback_2_(mthis, __arg_0, __arg_1) => getStats_Callback_2(mthis, __arg_0, __arg_1);
-
-  static getStats_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "RTCPeerConnection_getStats_Callback";
-  getStats_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getStats_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static getStats_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "RTCPeerConnection_getStats_Callback";
-  getStats_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => getStats_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static getStreamById_Callback_0(mthis) native "RTCPeerConnection_getStreamById_Callback";
-  getStreamById_Callback_0_(mthis) => getStreamById_Callback_0(mthis);
-
-  static getStreamById_Callback_1(mthis, __arg_0) native "RTCPeerConnection_getStreamById_Callback";
-  getStreamById_Callback_1_(mthis, __arg_0) => getStreamById_Callback_1(mthis, __arg_0);
-
-  static getStreamById_Callback_2(mthis, __arg_0, __arg_1) native "RTCPeerConnection_getStreamById_Callback";
-  getStreamById_Callback_2_(mthis, __arg_0, __arg_1) => getStreamById_Callback_2(mthis, __arg_0, __arg_1);
-
-  static getStreamById_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "RTCPeerConnection_getStreamById_Callback";
-  getStreamById_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getStreamById_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static iceConnectionState_Getter(mthis) native "RTCPeerConnection_iceConnectionState_Getter";
-  iceConnectionState_Getter_(mthis) => iceConnectionState_Getter(mthis);
-
-  static iceGatheringState_Getter(mthis) native "RTCPeerConnection_iceGatheringState_Getter";
-  iceGatheringState_Getter_(mthis) => iceGatheringState_Getter(mthis);
-
-  static localDescription_Getter(mthis) native "RTCPeerConnection_localDescription_Getter";
-  localDescription_Getter_(mthis) => localDescription_Getter(mthis);
-
-  static onaddstream_Getter(mthis) native "RTCPeerConnection_onaddstream_Getter";
-  onaddstream_Getter_(mthis) => onaddstream_Getter(mthis);
-
-  static onaddstream_Setter(mthis, __arg_0) native "RTCPeerConnection_onaddstream_Setter";
-  onaddstream_Setter_(mthis, __arg_0) => onaddstream_Setter(mthis, __arg_0);
-
-  static ondatachannel_Getter(mthis) native "RTCPeerConnection_ondatachannel_Getter";
-  ondatachannel_Getter_(mthis) => ondatachannel_Getter(mthis);
-
-  static ondatachannel_Setter(mthis, __arg_0) native "RTCPeerConnection_ondatachannel_Setter";
-  ondatachannel_Setter_(mthis, __arg_0) => ondatachannel_Setter(mthis, __arg_0);
-
-  static onicecandidate_Getter(mthis) native "RTCPeerConnection_onicecandidate_Getter";
-  onicecandidate_Getter_(mthis) => onicecandidate_Getter(mthis);
-
-  static onicecandidate_Setter(mthis, __arg_0) native "RTCPeerConnection_onicecandidate_Setter";
-  onicecandidate_Setter_(mthis, __arg_0) => onicecandidate_Setter(mthis, __arg_0);
-
-  static oniceconnectionstatechange_Getter(mthis) native "RTCPeerConnection_oniceconnectionstatechange_Getter";
-  oniceconnectionstatechange_Getter_(mthis) => oniceconnectionstatechange_Getter(mthis);
-
-  static oniceconnectionstatechange_Setter(mthis, __arg_0) native "RTCPeerConnection_oniceconnectionstatechange_Setter";
-  oniceconnectionstatechange_Setter_(mthis, __arg_0) => oniceconnectionstatechange_Setter(mthis, __arg_0);
-
-  static onnegotiationneeded_Getter(mthis) native "RTCPeerConnection_onnegotiationneeded_Getter";
-  onnegotiationneeded_Getter_(mthis) => onnegotiationneeded_Getter(mthis);
-
-  static onnegotiationneeded_Setter(mthis, __arg_0) native "RTCPeerConnection_onnegotiationneeded_Setter";
-  onnegotiationneeded_Setter_(mthis, __arg_0) => onnegotiationneeded_Setter(mthis, __arg_0);
-
-  static onremovestream_Getter(mthis) native "RTCPeerConnection_onremovestream_Getter";
-  onremovestream_Getter_(mthis) => onremovestream_Getter(mthis);
-
-  static onremovestream_Setter(mthis, __arg_0) native "RTCPeerConnection_onremovestream_Setter";
-  onremovestream_Setter_(mthis, __arg_0) => onremovestream_Setter(mthis, __arg_0);
-
-  static onsignalingstatechange_Getter(mthis) native "RTCPeerConnection_onsignalingstatechange_Getter";
-  onsignalingstatechange_Getter_(mthis) => onsignalingstatechange_Getter(mthis);
-
-  static onsignalingstatechange_Setter(mthis, __arg_0) native "RTCPeerConnection_onsignalingstatechange_Setter";
-  onsignalingstatechange_Setter_(mthis, __arg_0) => onsignalingstatechange_Setter(mthis, __arg_0);
-
-  static remoteDescription_Getter(mthis) native "RTCPeerConnection_remoteDescription_Getter";
-  remoteDescription_Getter_(mthis) => remoteDescription_Getter(mthis);
-
-  static removeStream_Callback_0(mthis) native "RTCPeerConnection_removeStream_Callback";
-  removeStream_Callback_0_(mthis) => removeStream_Callback_0(mthis);
-
-  static removeStream_Callback_1(mthis, __arg_0) native "RTCPeerConnection_removeStream_Callback";
-  removeStream_Callback_1_(mthis, __arg_0) => removeStream_Callback_1(mthis, __arg_0);
-
-  static removeStream_Callback_2(mthis, __arg_0, __arg_1) native "RTCPeerConnection_removeStream_Callback";
-  removeStream_Callback_2_(mthis, __arg_0, __arg_1) => removeStream_Callback_2(mthis, __arg_0, __arg_1);
-
-  static removeStream_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "RTCPeerConnection_removeStream_Callback";
-  removeStream_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => removeStream_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static setLocalDescription_Callback_0(mthis) native "RTCPeerConnection_setLocalDescription_Callback";
-  setLocalDescription_Callback_0_(mthis) => setLocalDescription_Callback_0(mthis);
-
-  static setLocalDescription_Callback_1(mthis, __arg_0) native "RTCPeerConnection_setLocalDescription_Callback";
-  setLocalDescription_Callback_1_(mthis, __arg_0) => setLocalDescription_Callback_1(mthis, __arg_0);
-
-  static setLocalDescription_Callback_2(mthis, __arg_0, __arg_1) native "RTCPeerConnection_setLocalDescription_Callback";
-  setLocalDescription_Callback_2_(mthis, __arg_0, __arg_1) => setLocalDescription_Callback_2(mthis, __arg_0, __arg_1);
+  onsignalingstatechange_Setter_(mthis, __arg_0) => mthis["onsignalingstatechange"] = __arg_0;
 
-  static setLocalDescription_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "RTCPeerConnection_setLocalDescription_Callback";
-  setLocalDescription_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => setLocalDescription_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  remoteDescription_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "remoteDescription");
 
-  static setLocalDescription_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "RTCPeerConnection_setLocalDescription_Callback";
-  setLocalDescription_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => setLocalDescription_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  removeStream_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "removeStream", []);
 
-  static setLocalDescription_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "RTCPeerConnection_setLocalDescription_Callback";
-  setLocalDescription_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => setLocalDescription_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  removeStream_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "removeStream", [__arg_0]);
 
-  static setRemoteDescription_Callback_0(mthis) native "RTCPeerConnection_setRemoteDescription_Callback";
-  setRemoteDescription_Callback_0_(mthis) => setRemoteDescription_Callback_0(mthis);
+  setLocalDescription_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "setLocalDescription", []);
 
-  static setRemoteDescription_Callback_1(mthis, __arg_0) native "RTCPeerConnection_setRemoteDescription_Callback";
-  setRemoteDescription_Callback_1_(mthis, __arg_0) => setRemoteDescription_Callback_1(mthis, __arg_0);
+  setLocalDescription_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "setLocalDescription", [__arg_0]);
 
-  static setRemoteDescription_Callback_2(mthis, __arg_0, __arg_1) native "RTCPeerConnection_setRemoteDescription_Callback";
-  setRemoteDescription_Callback_2_(mthis, __arg_0, __arg_1) => setRemoteDescription_Callback_2(mthis, __arg_0, __arg_1);
+  setLocalDescription_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "setLocalDescription", [__arg_0, __arg_1]);
 
-  static setRemoteDescription_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "RTCPeerConnection_setRemoteDescription_Callback";
-  setRemoteDescription_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => setRemoteDescription_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  setLocalDescription_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "setLocalDescription", [__arg_0, __arg_1, __arg_2]);
 
-  static setRemoteDescription_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "RTCPeerConnection_setRemoteDescription_Callback";
-  setRemoteDescription_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => setRemoteDescription_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  setRemoteDescription_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "setRemoteDescription", []);
 
-  static setRemoteDescription_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "RTCPeerConnection_setRemoteDescription_Callback";
-  setRemoteDescription_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => setRemoteDescription_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  setRemoteDescription_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "setRemoteDescription", [__arg_0]);
 
-  static signalingState_Getter(mthis) native "RTCPeerConnection_signalingState_Getter";
-  signalingState_Getter_(mthis) => signalingState_Getter(mthis);
+  setRemoteDescription_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "setRemoteDescription", [__arg_0, __arg_1]);
 
-  static updateIce_Callback_0(mthis) native "RTCPeerConnection_updateIce_Callback";
-  updateIce_Callback_0_(mthis) => updateIce_Callback_0(mthis);
+  setRemoteDescription_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "setRemoteDescription", [__arg_0, __arg_1, __arg_2]);
 
-  static updateIce_Callback_1(mthis, __arg_0) native "RTCPeerConnection_updateIce_Callback";
-  updateIce_Callback_1_(mthis, __arg_0) => updateIce_Callback_1(mthis, __arg_0);
+  signalingState_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "signalingState");
 
-  static updateIce_Callback_2(mthis, __arg_0, __arg_1) native "RTCPeerConnection_updateIce_Callback";
-  updateIce_Callback_2_(mthis, __arg_0, __arg_1) => updateIce_Callback_2(mthis, __arg_0, __arg_1);
+  updateIce_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "updateIce", []);
 
-  static updateIce_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "RTCPeerConnection_updateIce_Callback";
-  updateIce_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => updateIce_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  updateIce_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "updateIce", [__arg_0]);
 
-  static updateIce_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "RTCPeerConnection_updateIce_Callback";
-  updateIce_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => updateIce_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  updateIce_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "updateIce", [__arg_0, __arg_1]);
 
 }
 
 class BlinkRTCSessionDescription {
   static final instance = new BlinkRTCSessionDescription();
 
-  static constructorCallback_0() native "RTCSessionDescription_constructorCallback";
-  constructorCallback_0_() => constructorCallback_0();
+  constructorCallback_0_() => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "RTCSessionDescription"), []);
 
-  static constructorCallback_1(__arg_0) native "RTCSessionDescription_constructorCallback";
-  constructorCallback_1_(__arg_0) => constructorCallback_1(__arg_0);
+  constructorCallback_1_(__arg_0) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "RTCSessionDescription"), [__arg_0]);
 
-  static constructorCallback_2(__arg_0, __arg_1) native "RTCSessionDescription_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  sdp_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "sdp");
 
-  static constructorCallback_3(__arg_0, __arg_1, __arg_2) native "RTCSessionDescription_constructorCallback";
-  constructorCallback_3_(__arg_0, __arg_1, __arg_2) => constructorCallback_3(__arg_0, __arg_1, __arg_2);
+  sdp_Setter_(mthis, __arg_0) => mthis["sdp"] = __arg_0;
 
-  static sdp_Getter(mthis) native "RTCSessionDescription_sdp_Getter";
-  sdp_Getter_(mthis) => sdp_Getter(mthis);
+  type_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "type");
 
-  static sdp_Setter(mthis, __arg_0) native "RTCSessionDescription_sdp_Setter";
-  sdp_Setter_(mthis, __arg_0) => sdp_Setter(mthis, __arg_0);
-
-  static type_Getter(mthis) native "RTCSessionDescription_type_Getter";
-  type_Getter_(mthis) => type_Getter(mthis);
-
-  static type_Setter(mthis, __arg_0) native "RTCSessionDescription_type_Setter";
-  type_Setter_(mthis, __arg_0) => type_Setter(mthis, __arg_0);
+  type_Setter_(mthis, __arg_0) => mthis["type"] = __arg_0;
 
 }
 
 class BlinkRTCStatsReport {
   static final instance = new BlinkRTCStatsReport();
 
-  static id_Getter(mthis) native "RTCStatsReport_id_Getter";
-  id_Getter_(mthis) => id_Getter(mthis);
+  id_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "id");
 
-  static local_Getter(mthis) native "RTCStatsReport_local_Getter";
-  local_Getter_(mthis) => local_Getter(mthis);
+  local_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "local");
 
-  static names_Callback_0(mthis) native "RTCStatsReport_names_Callback";
-  names_Callback_0_(mthis) => names_Callback_0(mthis);
+  names_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "names", []);
 
-  static names_Callback_1(mthis, __arg_0) native "RTCStatsReport_names_Callback";
-  names_Callback_1_(mthis, __arg_0) => names_Callback_1(mthis, __arg_0);
+  remote_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "remote");
 
-  static names_Callback_2(mthis, __arg_0, __arg_1) native "RTCStatsReport_names_Callback";
-  names_Callback_2_(mthis, __arg_0, __arg_1) => names_Callback_2(mthis, __arg_0, __arg_1);
+  stat_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "stat", []);
 
-  static remote_Getter(mthis) native "RTCStatsReport_remote_Getter";
-  remote_Getter_(mthis) => remote_Getter(mthis);
+  stat_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "stat", [__arg_0]);
 
-  static stat_Callback_0(mthis) native "RTCStatsReport_stat_Callback";
-  stat_Callback_0_(mthis) => stat_Callback_0(mthis);
+  timestamp_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "timestamp");
 
-  static stat_Callback_1(mthis, __arg_0) native "RTCStatsReport_stat_Callback";
-  stat_Callback_1_(mthis, __arg_0) => stat_Callback_1(mthis, __arg_0);
-
-  static stat_Callback_2(mthis, __arg_0, __arg_1) native "RTCStatsReport_stat_Callback";
-  stat_Callback_2_(mthis, __arg_0, __arg_1) => stat_Callback_2(mthis, __arg_0, __arg_1);
-
-  static stat_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "RTCStatsReport_stat_Callback";
-  stat_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => stat_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static timestamp_Getter(mthis) native "RTCStatsReport_timestamp_Getter";
-  timestamp_Getter_(mthis) => timestamp_Getter(mthis);
-
-  static type_Getter(mthis) native "RTCStatsReport_type_Getter";
-  type_Getter_(mthis) => type_Getter(mthis);
+  type_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "type");
 
 }
 
 class BlinkRTCStatsResponse {
   static final instance = new BlinkRTCStatsResponse();
 
-  static $__getter___Callback_1(mthis, __arg_0) native "RTCStatsResponse___getter___Callback";
-  $__getter___Callback_1_(mthis, __arg_0) => $__getter___Callback_1(mthis, __arg_0);
+  $__getter___Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "__getter__", [__arg_0]);
 
-  static namedItem_Callback_0(mthis) native "RTCStatsResponse_namedItem_Callback";
-  namedItem_Callback_0_(mthis) => namedItem_Callback_0(mthis);
+  namedItem_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "namedItem", []);
 
-  static namedItem_Callback_1(mthis, __arg_0) native "RTCStatsResponse_namedItem_Callback";
-  namedItem_Callback_1_(mthis, __arg_0) => namedItem_Callback_1(mthis, __arg_0);
+  namedItem_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "namedItem", [__arg_0]);
 
-  static namedItem_Callback_2(mthis, __arg_0, __arg_1) native "RTCStatsResponse_namedItem_Callback";
-  namedItem_Callback_2_(mthis, __arg_0, __arg_1) => namedItem_Callback_2(mthis, __arg_0, __arg_1);
-
-  static namedItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "RTCStatsResponse_namedItem_Callback";
-  namedItem_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => namedItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static result_Callback_0(mthis) native "RTCStatsResponse_result_Callback";
-  result_Callback_0_(mthis) => result_Callback_0(mthis);
-
-  static result_Callback_1(mthis, __arg_0) native "RTCStatsResponse_result_Callback";
-  result_Callback_1_(mthis, __arg_0) => result_Callback_1(mthis, __arg_0);
-
-  static result_Callback_2(mthis, __arg_0, __arg_1) native "RTCStatsResponse_result_Callback";
-  result_Callback_2_(mthis, __arg_0, __arg_1) => result_Callback_2(mthis, __arg_0, __arg_1);
+  result_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "result", []);
 
 }
 
 class BlinkRadioNodeList extends BlinkNodeList {
   static final instance = new BlinkRadioNodeList();
 
-  static $__getter___Callback_1(mthis, __arg_0) native "RadioNodeList___getter___Callback";
-  $__getter___Callback_1_(mthis, __arg_0) => $__getter___Callback_1(mthis, __arg_0);
+  $__getter___Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "__getter__", [__arg_0]);
 
-  static value_Getter(mthis) native "RadioNodeList_value_Getter";
-  value_Getter_(mthis) => value_Getter(mthis);
+  value_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "value");
 
-  static value_Setter(mthis, __arg_0) native "RadioNodeList_value_Setter";
-  value_Setter_(mthis, __arg_0) => value_Setter(mthis, __arg_0);
+  value_Setter_(mthis, __arg_0) => mthis["value"] = __arg_0;
 
 }
 
 class BlinkRange {
   static final instance = new BlinkRange();
 
-  static cloneContents_Callback_0(mthis) native "Range_cloneContents_Callback";
-  cloneContents_Callback_0_(mthis) => cloneContents_Callback_0(mthis);
+  cloneContents_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "cloneContents", []);
 
-  static cloneContents_Callback_1(mthis, __arg_0) native "Range_cloneContents_Callback";
-  cloneContents_Callback_1_(mthis, __arg_0) => cloneContents_Callback_1(mthis, __arg_0);
+  cloneRange_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "cloneRange", []);
 
-  static cloneContents_Callback_2(mthis, __arg_0, __arg_1) native "Range_cloneContents_Callback";
-  cloneContents_Callback_2_(mthis, __arg_0, __arg_1) => cloneContents_Callback_2(mthis, __arg_0, __arg_1);
+  collapse_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "collapse", []);
 
-  static cloneRange_Callback_0(mthis) native "Range_cloneRange_Callback";
-  cloneRange_Callback_0_(mthis) => cloneRange_Callback_0(mthis);
+  collapse_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "collapse", [__arg_0]);
 
-  static cloneRange_Callback_1(mthis, __arg_0) native "Range_cloneRange_Callback";
-  cloneRange_Callback_1_(mthis, __arg_0) => cloneRange_Callback_1(mthis, __arg_0);
+  collapsed_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "collapsed");
 
-  static cloneRange_Callback_2(mthis, __arg_0, __arg_1) native "Range_cloneRange_Callback";
-  cloneRange_Callback_2_(mthis, __arg_0, __arg_1) => cloneRange_Callback_2(mthis, __arg_0, __arg_1);
+  commonAncestorContainer_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "commonAncestorContainer");
 
-  static collapse_Callback_0(mthis) native "Range_collapse_Callback";
-  collapse_Callback_0_(mthis) => collapse_Callback_0(mthis);
+  compareBoundaryPoints_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "compareBoundaryPoints", []);
 
-  static collapse_Callback_1(mthis, __arg_0) native "Range_collapse_Callback";
-  collapse_Callback_1_(mthis, __arg_0) => collapse_Callback_1(mthis, __arg_0);
+  compareBoundaryPoints_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "compareBoundaryPoints", [__arg_0]);
 
-  static collapse_Callback_2(mthis, __arg_0, __arg_1) native "Range_collapse_Callback";
-  collapse_Callback_2_(mthis, __arg_0, __arg_1) => collapse_Callback_2(mthis, __arg_0, __arg_1);
+  compareBoundaryPoints_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "compareBoundaryPoints", [__arg_0, __arg_1]);
 
-  static collapse_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Range_collapse_Callback";
-  collapse_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => collapse_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  compareNode_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "compareNode", []);
 
-  static collapsed_Getter(mthis) native "Range_collapsed_Getter";
-  collapsed_Getter_(mthis) => collapsed_Getter(mthis);
+  compareNode_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "compareNode", [__arg_0]);
 
-  static commonAncestorContainer_Getter(mthis) native "Range_commonAncestorContainer_Getter";
-  commonAncestorContainer_Getter_(mthis) => commonAncestorContainer_Getter(mthis);
+  comparePoint_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "comparePoint", []);
 
-  static compareBoundaryPoints_Callback_0(mthis) native "Range_compareBoundaryPoints_Callback";
-  compareBoundaryPoints_Callback_0_(mthis) => compareBoundaryPoints_Callback_0(mthis);
+  comparePoint_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "comparePoint", [__arg_0]);
 
-  static compareBoundaryPoints_Callback_1(mthis, __arg_0) native "Range_compareBoundaryPoints_Callback";
-  compareBoundaryPoints_Callback_1_(mthis, __arg_0) => compareBoundaryPoints_Callback_1(mthis, __arg_0);
+  comparePoint_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "comparePoint", [__arg_0, __arg_1]);
 
-  static compareBoundaryPoints_Callback_2(mthis, __arg_0, __arg_1) native "Range_compareBoundaryPoints_Callback";
-  compareBoundaryPoints_Callback_2_(mthis, __arg_0, __arg_1) => compareBoundaryPoints_Callback_2(mthis, __arg_0, __arg_1);
+  constructorCallback_0_() => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "Range"), []);
 
-  static compareBoundaryPoints_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Range_compareBoundaryPoints_Callback";
-  compareBoundaryPoints_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => compareBoundaryPoints_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  createContextualFragment_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createContextualFragment", []);
 
-  static compareBoundaryPoints_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Range_compareBoundaryPoints_Callback";
-  compareBoundaryPoints_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => compareBoundaryPoints_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  createContextualFragment_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "createContextualFragment", [__arg_0]);
 
-  static compareNode_Callback_0(mthis) native "Range_compareNode_Callback";
-  compareNode_Callback_0_(mthis) => compareNode_Callback_0(mthis);
+  deleteContents_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "deleteContents", []);
 
-  static compareNode_Callback_1(mthis, __arg_0) native "Range_compareNode_Callback";
-  compareNode_Callback_1_(mthis, __arg_0) => compareNode_Callback_1(mthis, __arg_0);
+  detach_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "detach", []);
 
-  static compareNode_Callback_2(mthis, __arg_0, __arg_1) native "Range_compareNode_Callback";
-  compareNode_Callback_2_(mthis, __arg_0, __arg_1) => compareNode_Callback_2(mthis, __arg_0, __arg_1);
+  endContainer_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "endContainer");
 
-  static compareNode_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Range_compareNode_Callback";
-  compareNode_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => compareNode_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  endOffset_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "endOffset");
 
-  static comparePoint_Callback_0(mthis) native "Range_comparePoint_Callback";
-  comparePoint_Callback_0_(mthis) => comparePoint_Callback_0(mthis);
+  expand_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "expand", []);
 
-  static comparePoint_Callback_1(mthis, __arg_0) native "Range_comparePoint_Callback";
-  comparePoint_Callback_1_(mthis, __arg_0) => comparePoint_Callback_1(mthis, __arg_0);
+  expand_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "expand", [__arg_0]);
 
-  static comparePoint_Callback_2(mthis, __arg_0, __arg_1) native "Range_comparePoint_Callback";
-  comparePoint_Callback_2_(mthis, __arg_0, __arg_1) => comparePoint_Callback_2(mthis, __arg_0, __arg_1);
+  extractContents_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "extractContents", []);
 
-  static comparePoint_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Range_comparePoint_Callback";
-  comparePoint_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => comparePoint_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  getBoundingClientRect_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getBoundingClientRect", []);
 
-  static comparePoint_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Range_comparePoint_Callback";
-  comparePoint_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => comparePoint_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  getClientRects_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getClientRects", []);
 
-  static constructorCallback_0() native "Range_constructorCallback";
-  constructorCallback_0_() => constructorCallback_0();
+  insertNode_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "insertNode", []);
 
-  static constructorCallback_1(__arg_0) native "Range_constructorCallback";
-  constructorCallback_1_(__arg_0) => constructorCallback_1(__arg_0);
+  insertNode_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "insertNode", [__arg_0]);
 
-  static constructorCallback_2(__arg_0, __arg_1) native "Range_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  intersectsNode_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "intersectsNode", []);
 
-  static createContextualFragment_Callback_0(mthis) native "Range_createContextualFragment_Callback";
-  createContextualFragment_Callback_0_(mthis) => createContextualFragment_Callback_0(mthis);
+  intersectsNode_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "intersectsNode", [__arg_0]);
 
-  static createContextualFragment_Callback_1(mthis, __arg_0) native "Range_createContextualFragment_Callback";
-  createContextualFragment_Callback_1_(mthis, __arg_0) => createContextualFragment_Callback_1(mthis, __arg_0);
+  isPointInRange_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "isPointInRange", []);
 
-  static createContextualFragment_Callback_2(mthis, __arg_0, __arg_1) native "Range_createContextualFragment_Callback";
-  createContextualFragment_Callback_2_(mthis, __arg_0, __arg_1) => createContextualFragment_Callback_2(mthis, __arg_0, __arg_1);
+  isPointInRange_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "isPointInRange", [__arg_0]);
 
-  static createContextualFragment_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Range_createContextualFragment_Callback";
-  createContextualFragment_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => createContextualFragment_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  isPointInRange_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "isPointInRange", [__arg_0, __arg_1]);
 
-  static deleteContents_Callback_0(mthis) native "Range_deleteContents_Callback";
-  deleteContents_Callback_0_(mthis) => deleteContents_Callback_0(mthis);
+  selectNodeContents_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "selectNodeContents", []);
 
-  static deleteContents_Callback_1(mthis, __arg_0) native "Range_deleteContents_Callback";
-  deleteContents_Callback_1_(mthis, __arg_0) => deleteContents_Callback_1(mthis, __arg_0);
+  selectNodeContents_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "selectNodeContents", [__arg_0]);
 
-  static deleteContents_Callback_2(mthis, __arg_0, __arg_1) native "Range_deleteContents_Callback";
-  deleteContents_Callback_2_(mthis, __arg_0, __arg_1) => deleteContents_Callback_2(mthis, __arg_0, __arg_1);
+  selectNode_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "selectNode", []);
 
-  static detach_Callback_0(mthis) native "Range_detach_Callback";
-  detach_Callback_0_(mthis) => detach_Callback_0(mthis);
+  selectNode_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "selectNode", [__arg_0]);
 
-  static detach_Callback_1(mthis, __arg_0) native "Range_detach_Callback";
-  detach_Callback_1_(mthis, __arg_0) => detach_Callback_1(mthis, __arg_0);
+  setEndAfter_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "setEndAfter", []);
 
-  static detach_Callback_2(mthis, __arg_0, __arg_1) native "Range_detach_Callback";
-  detach_Callback_2_(mthis, __arg_0, __arg_1) => detach_Callback_2(mthis, __arg_0, __arg_1);
+  setEndAfter_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "setEndAfter", [__arg_0]);
 
-  static endContainer_Getter(mthis) native "Range_endContainer_Getter";
-  endContainer_Getter_(mthis) => endContainer_Getter(mthis);
+  setEndBefore_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "setEndBefore", []);
 
-  static endOffset_Getter(mthis) native "Range_endOffset_Getter";
-  endOffset_Getter_(mthis) => endOffset_Getter(mthis);
+  setEndBefore_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "setEndBefore", [__arg_0]);
 
-  static expand_Callback_0(mthis) native "Range_expand_Callback";
-  expand_Callback_0_(mthis) => expand_Callback_0(mthis);
+  setEnd_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "setEnd", []);
 
-  static expand_Callback_1(mthis, __arg_0) native "Range_expand_Callback";
-  expand_Callback_1_(mthis, __arg_0) => expand_Callback_1(mthis, __arg_0);
+  setEnd_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "setEnd", [__arg_0]);
 
-  static expand_Callback_2(mthis, __arg_0, __arg_1) native "Range_expand_Callback";
-  expand_Callback_2_(mthis, __arg_0, __arg_1) => expand_Callback_2(mthis, __arg_0, __arg_1);
+  setEnd_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "setEnd", [__arg_0, __arg_1]);
 
-  static expand_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Range_expand_Callback";
-  expand_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => expand_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  setStartAfter_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "setStartAfter", []);
 
-  static extractContents_Callback_0(mthis) native "Range_extractContents_Callback";
-  extractContents_Callback_0_(mthis) => extractContents_Callback_0(mthis);
+  setStartAfter_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "setStartAfter", [__arg_0]);
 
-  static extractContents_Callback_1(mthis, __arg_0) native "Range_extractContents_Callback";
-  extractContents_Callback_1_(mthis, __arg_0) => extractContents_Callback_1(mthis, __arg_0);
+  setStartBefore_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "setStartBefore", []);
 
-  static extractContents_Callback_2(mthis, __arg_0, __arg_1) native "Range_extractContents_Callback";
-  extractContents_Callback_2_(mthis, __arg_0, __arg_1) => extractContents_Callback_2(mthis, __arg_0, __arg_1);
+  setStartBefore_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "setStartBefore", [__arg_0]);
 
-  static getBoundingClientRect_Callback_0(mthis) native "Range_getBoundingClientRect_Callback";
-  getBoundingClientRect_Callback_0_(mthis) => getBoundingClientRect_Callback_0(mthis);
+  setStart_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "setStart", []);
 
-  static getBoundingClientRect_Callback_1(mthis, __arg_0) native "Range_getBoundingClientRect_Callback";
-  getBoundingClientRect_Callback_1_(mthis, __arg_0) => getBoundingClientRect_Callback_1(mthis, __arg_0);
+  setStart_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "setStart", [__arg_0]);
 
-  static getBoundingClientRect_Callback_2(mthis, __arg_0, __arg_1) native "Range_getBoundingClientRect_Callback";
-  getBoundingClientRect_Callback_2_(mthis, __arg_0, __arg_1) => getBoundingClientRect_Callback_2(mthis, __arg_0, __arg_1);
+  setStart_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "setStart", [__arg_0, __arg_1]);
 
-  static getClientRects_Callback_0(mthis) native "Range_getClientRects_Callback";
-  getClientRects_Callback_0_(mthis) => getClientRects_Callback_0(mthis);
+  startContainer_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "startContainer");
 
-  static getClientRects_Callback_1(mthis, __arg_0) native "Range_getClientRects_Callback";
-  getClientRects_Callback_1_(mthis, __arg_0) => getClientRects_Callback_1(mthis, __arg_0);
+  startOffset_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "startOffset");
 
-  static getClientRects_Callback_2(mthis, __arg_0, __arg_1) native "Range_getClientRects_Callback";
-  getClientRects_Callback_2_(mthis, __arg_0, __arg_1) => getClientRects_Callback_2(mthis, __arg_0, __arg_1);
-
-  static insertNode_Callback_0(mthis) native "Range_insertNode_Callback";
-  insertNode_Callback_0_(mthis) => insertNode_Callback_0(mthis);
-
-  static insertNode_Callback_1(mthis, __arg_0) native "Range_insertNode_Callback";
-  insertNode_Callback_1_(mthis, __arg_0) => insertNode_Callback_1(mthis, __arg_0);
-
-  static insertNode_Callback_2(mthis, __arg_0, __arg_1) native "Range_insertNode_Callback";
-  insertNode_Callback_2_(mthis, __arg_0, __arg_1) => insertNode_Callback_2(mthis, __arg_0, __arg_1);
-
-  static insertNode_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Range_insertNode_Callback";
-  insertNode_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => insertNode_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static intersectsNode_Callback_0(mthis) native "Range_intersectsNode_Callback";
-  intersectsNode_Callback_0_(mthis) => intersectsNode_Callback_0(mthis);
-
-  static intersectsNode_Callback_1(mthis, __arg_0) native "Range_intersectsNode_Callback";
-  intersectsNode_Callback_1_(mthis, __arg_0) => intersectsNode_Callback_1(mthis, __arg_0);
-
-  static intersectsNode_Callback_2(mthis, __arg_0, __arg_1) native "Range_intersectsNode_Callback";
-  intersectsNode_Callback_2_(mthis, __arg_0, __arg_1) => intersectsNode_Callback_2(mthis, __arg_0, __arg_1);
-
-  static intersectsNode_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Range_intersectsNode_Callback";
-  intersectsNode_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => intersectsNode_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static isPointInRange_Callback_0(mthis) native "Range_isPointInRange_Callback";
-  isPointInRange_Callback_0_(mthis) => isPointInRange_Callback_0(mthis);
-
-  static isPointInRange_Callback_1(mthis, __arg_0) native "Range_isPointInRange_Callback";
-  isPointInRange_Callback_1_(mthis, __arg_0) => isPointInRange_Callback_1(mthis, __arg_0);
-
-  static isPointInRange_Callback_2(mthis, __arg_0, __arg_1) native "Range_isPointInRange_Callback";
-  isPointInRange_Callback_2_(mthis, __arg_0, __arg_1) => isPointInRange_Callback_2(mthis, __arg_0, __arg_1);
-
-  static isPointInRange_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Range_isPointInRange_Callback";
-  isPointInRange_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => isPointInRange_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static isPointInRange_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Range_isPointInRange_Callback";
-  isPointInRange_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => isPointInRange_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static selectNodeContents_Callback_0(mthis) native "Range_selectNodeContents_Callback";
-  selectNodeContents_Callback_0_(mthis) => selectNodeContents_Callback_0(mthis);
-
-  static selectNodeContents_Callback_1(mthis, __arg_0) native "Range_selectNodeContents_Callback";
-  selectNodeContents_Callback_1_(mthis, __arg_0) => selectNodeContents_Callback_1(mthis, __arg_0);
-
-  static selectNodeContents_Callback_2(mthis, __arg_0, __arg_1) native "Range_selectNodeContents_Callback";
-  selectNodeContents_Callback_2_(mthis, __arg_0, __arg_1) => selectNodeContents_Callback_2(mthis, __arg_0, __arg_1);
-
-  static selectNodeContents_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Range_selectNodeContents_Callback";
-  selectNodeContents_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => selectNodeContents_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static selectNode_Callback_0(mthis) native "Range_selectNode_Callback";
-  selectNode_Callback_0_(mthis) => selectNode_Callback_0(mthis);
-
-  static selectNode_Callback_1(mthis, __arg_0) native "Range_selectNode_Callback";
-  selectNode_Callback_1_(mthis, __arg_0) => selectNode_Callback_1(mthis, __arg_0);
-
-  static selectNode_Callback_2(mthis, __arg_0, __arg_1) native "Range_selectNode_Callback";
-  selectNode_Callback_2_(mthis, __arg_0, __arg_1) => selectNode_Callback_2(mthis, __arg_0, __arg_1);
-
-  static selectNode_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Range_selectNode_Callback";
-  selectNode_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => selectNode_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static setEndAfter_Callback_0(mthis) native "Range_setEndAfter_Callback";
-  setEndAfter_Callback_0_(mthis) => setEndAfter_Callback_0(mthis);
-
-  static setEndAfter_Callback_1(mthis, __arg_0) native "Range_setEndAfter_Callback";
-  setEndAfter_Callback_1_(mthis, __arg_0) => setEndAfter_Callback_1(mthis, __arg_0);
-
-  static setEndAfter_Callback_2(mthis, __arg_0, __arg_1) native "Range_setEndAfter_Callback";
-  setEndAfter_Callback_2_(mthis, __arg_0, __arg_1) => setEndAfter_Callback_2(mthis, __arg_0, __arg_1);
-
-  static setEndAfter_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Range_setEndAfter_Callback";
-  setEndAfter_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => setEndAfter_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static setEndBefore_Callback_0(mthis) native "Range_setEndBefore_Callback";
-  setEndBefore_Callback_0_(mthis) => setEndBefore_Callback_0(mthis);
-
-  static setEndBefore_Callback_1(mthis, __arg_0) native "Range_setEndBefore_Callback";
-  setEndBefore_Callback_1_(mthis, __arg_0) => setEndBefore_Callback_1(mthis, __arg_0);
-
-  static setEndBefore_Callback_2(mthis, __arg_0, __arg_1) native "Range_setEndBefore_Callback";
-  setEndBefore_Callback_2_(mthis, __arg_0, __arg_1) => setEndBefore_Callback_2(mthis, __arg_0, __arg_1);
-
-  static setEndBefore_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Range_setEndBefore_Callback";
-  setEndBefore_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => setEndBefore_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static setEnd_Callback_0(mthis) native "Range_setEnd_Callback";
-  setEnd_Callback_0_(mthis) => setEnd_Callback_0(mthis);
-
-  static setEnd_Callback_1(mthis, __arg_0) native "Range_setEnd_Callback";
-  setEnd_Callback_1_(mthis, __arg_0) => setEnd_Callback_1(mthis, __arg_0);
-
-  static setEnd_Callback_2(mthis, __arg_0, __arg_1) native "Range_setEnd_Callback";
-  setEnd_Callback_2_(mthis, __arg_0, __arg_1) => setEnd_Callback_2(mthis, __arg_0, __arg_1);
-
-  static setEnd_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Range_setEnd_Callback";
-  setEnd_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => setEnd_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static setEnd_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Range_setEnd_Callback";
-  setEnd_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => setEnd_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static setStartAfter_Callback_0(mthis) native "Range_setStartAfter_Callback";
-  setStartAfter_Callback_0_(mthis) => setStartAfter_Callback_0(mthis);
-
-  static setStartAfter_Callback_1(mthis, __arg_0) native "Range_setStartAfter_Callback";
-  setStartAfter_Callback_1_(mthis, __arg_0) => setStartAfter_Callback_1(mthis, __arg_0);
-
-  static setStartAfter_Callback_2(mthis, __arg_0, __arg_1) native "Range_setStartAfter_Callback";
-  setStartAfter_Callback_2_(mthis, __arg_0, __arg_1) => setStartAfter_Callback_2(mthis, __arg_0, __arg_1);
-
-  static setStartAfter_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Range_setStartAfter_Callback";
-  setStartAfter_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => setStartAfter_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static setStartBefore_Callback_0(mthis) native "Range_setStartBefore_Callback";
-  setStartBefore_Callback_0_(mthis) => setStartBefore_Callback_0(mthis);
-
-  static setStartBefore_Callback_1(mthis, __arg_0) native "Range_setStartBefore_Callback";
-  setStartBefore_Callback_1_(mthis, __arg_0) => setStartBefore_Callback_1(mthis, __arg_0);
-
-  static setStartBefore_Callback_2(mthis, __arg_0, __arg_1) native "Range_setStartBefore_Callback";
-  setStartBefore_Callback_2_(mthis, __arg_0, __arg_1) => setStartBefore_Callback_2(mthis, __arg_0, __arg_1);
-
-  static setStartBefore_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Range_setStartBefore_Callback";
-  setStartBefore_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => setStartBefore_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static setStart_Callback_0(mthis) native "Range_setStart_Callback";
-  setStart_Callback_0_(mthis) => setStart_Callback_0(mthis);
-
-  static setStart_Callback_1(mthis, __arg_0) native "Range_setStart_Callback";
-  setStart_Callback_1_(mthis, __arg_0) => setStart_Callback_1(mthis, __arg_0);
-
-  static setStart_Callback_2(mthis, __arg_0, __arg_1) native "Range_setStart_Callback";
-  setStart_Callback_2_(mthis, __arg_0, __arg_1) => setStart_Callback_2(mthis, __arg_0, __arg_1);
-
-  static setStart_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Range_setStart_Callback";
-  setStart_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => setStart_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static setStart_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Range_setStart_Callback";
-  setStart_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => setStart_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static startContainer_Getter(mthis) native "Range_startContainer_Getter";
-  startContainer_Getter_(mthis) => startContainer_Getter(mthis);
-
-  static startOffset_Getter(mthis) native "Range_startOffset_Getter";
-  startOffset_Getter_(mthis) => startOffset_Getter(mthis);
-
-  static surroundContents_Callback_0(mthis) native "Range_surroundContents_Callback";
-  surroundContents_Callback_0_(mthis) => surroundContents_Callback_0(mthis);
-
-  static surroundContents_Callback_1(mthis, __arg_0) native "Range_surroundContents_Callback";
-  surroundContents_Callback_1_(mthis, __arg_0) => surroundContents_Callback_1(mthis, __arg_0);
-
-  static surroundContents_Callback_2(mthis, __arg_0, __arg_1) native "Range_surroundContents_Callback";
-  surroundContents_Callback_2_(mthis, __arg_0, __arg_1) => surroundContents_Callback_2(mthis, __arg_0, __arg_1);
+  surroundContents_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "surroundContents", []);
 
-  static surroundContents_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Range_surroundContents_Callback";
-  surroundContents_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => surroundContents_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  surroundContents_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "surroundContents", [__arg_0]);
 
 }
 
 class BlinkReadableStream {
   static final instance = new BlinkReadableStream();
 
-  static cancel_Callback_0(mthis) native "ReadableStream_cancel_Callback";
-  cancel_Callback_0_(mthis) => cancel_Callback_0(mthis);
+  cancel_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "cancel", []);
 
-  static cancel_Callback_1(mthis, __arg_0) native "ReadableStream_cancel_Callback";
-  cancel_Callback_1_(mthis, __arg_0) => cancel_Callback_1(mthis, __arg_0);
+  cancel_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "cancel", [__arg_0]);
 
-  static cancel_Callback_2(mthis, __arg_0, __arg_1) native "ReadableStream_cancel_Callback";
-  cancel_Callback_2_(mthis, __arg_0, __arg_1) => cancel_Callback_2(mthis, __arg_0, __arg_1);
+  closed_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "closed");
 
-  static cancel_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "ReadableStream_cancel_Callback";
-  cancel_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => cancel_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  read_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "read", []);
 
-  static closed_Getter(mthis) native "ReadableStream_closed_Getter";
-  closed_Getter_(mthis) => closed_Getter(mthis);
+  state_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "state");
 
-  static read_Callback_0(mthis) native "ReadableStream_read_Callback";
-  read_Callback_0_(mthis) => read_Callback_0(mthis);
-
-  static read_Callback_1(mthis, __arg_0) native "ReadableStream_read_Callback";
-  read_Callback_1_(mthis, __arg_0) => read_Callback_1(mthis, __arg_0);
-
-  static read_Callback_2(mthis, __arg_0, __arg_1) native "ReadableStream_read_Callback";
-  read_Callback_2_(mthis, __arg_0, __arg_1) => read_Callback_2(mthis, __arg_0, __arg_1);
-
-  static state_Getter(mthis) native "ReadableStream_state_Getter";
-  state_Getter_(mthis) => state_Getter(mthis);
-
-  static wait_Callback_0(mthis) native "ReadableStream_wait_Callback";
-  wait_Callback_0_(mthis) => wait_Callback_0(mthis);
-
-  static wait_Callback_1(mthis, __arg_0) native "ReadableStream_wait_Callback";
-  wait_Callback_1_(mthis, __arg_0) => wait_Callback_1(mthis, __arg_0);
-
-  static wait_Callback_2(mthis, __arg_0, __arg_1) native "ReadableStream_wait_Callback";
-  wait_Callback_2_(mthis, __arg_0, __arg_1) => wait_Callback_2(mthis, __arg_0, __arg_1);
+  wait_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "wait", []);
 
 }
 
 class BlinkRect {
   static final instance = new BlinkRect();
 
-  static bottom_Getter(mthis) native "Rect_bottom_Getter";
-  bottom_Getter_(mthis) => bottom_Getter(mthis);
+  bottom_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "bottom");
 
-  static left_Getter(mthis) native "Rect_left_Getter";
-  left_Getter_(mthis) => left_Getter(mthis);
+  left_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "left");
 
-  static right_Getter(mthis) native "Rect_right_Getter";
-  right_Getter_(mthis) => right_Getter(mthis);
+  right_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "right");
 
-  static top_Getter(mthis) native "Rect_top_Getter";
-  top_Getter_(mthis) => top_Getter(mthis);
+  top_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "top");
 
 }
 
 class BlinkRelatedEvent extends BlinkEvent {
   static final instance = new BlinkRelatedEvent();
 
-  static constructorCallback_2(__arg_0, __arg_1) native "RelatedEvent_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  constructorCallback_2_(__arg_0, __arg_1) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "RelatedEvent"), [__arg_0, __arg_1]);
 
-  static relatedTarget_Getter(mthis) native "RelatedEvent_relatedTarget_Getter";
-  relatedTarget_Getter_(mthis) => relatedTarget_Getter(mthis);
+  relatedTarget_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "relatedTarget");
 
 }
 
 class BlinkRequest {
   static final instance = new BlinkRequest();
 
-  static arrayBuffer_Callback_0(mthis) native "Request_arrayBuffer_Callback";
-  arrayBuffer_Callback_0_(mthis) => arrayBuffer_Callback_0(mthis);
+  arrayBuffer_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "arrayBuffer", []);
 
-  static arrayBuffer_Callback_1(mthis, __arg_0) native "Request_arrayBuffer_Callback";
-  arrayBuffer_Callback_1_(mthis, __arg_0) => arrayBuffer_Callback_1(mthis, __arg_0);
+  blob_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "blob", []);
 
-  static arrayBuffer_Callback_2(mthis, __arg_0, __arg_1) native "Request_arrayBuffer_Callback";
-  arrayBuffer_Callback_2_(mthis, __arg_0, __arg_1) => arrayBuffer_Callback_2(mthis, __arg_0, __arg_1);
+  bodyUsed_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "bodyUsed");
 
-  static blob_Callback_0(mthis) native "Request_blob_Callback";
-  blob_Callback_0_(mthis) => blob_Callback_0(mthis);
+  clone_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "clone", []);
 
-  static blob_Callback_1(mthis, __arg_0) native "Request_blob_Callback";
-  blob_Callback_1_(mthis, __arg_0) => blob_Callback_1(mthis, __arg_0);
+  constructorCallback_0_() => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "Request"), []);
 
-  static blob_Callback_2(mthis, __arg_0, __arg_1) native "Request_blob_Callback";
-  blob_Callback_2_(mthis, __arg_0, __arg_1) => blob_Callback_2(mthis, __arg_0, __arg_1);
+  constructorCallback_1_(__arg_0) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "Request"), [__arg_0]);
 
-  static bodyUsed_Getter(mthis) native "Request_bodyUsed_Getter";
-  bodyUsed_Getter_(mthis) => bodyUsed_Getter(mthis);
+  constructorCallback_2_(__arg_0, __arg_1) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "Request"), [__arg_0, __arg_1]);
 
-  static clone_Callback_0(mthis) native "Request_clone_Callback";
-  clone_Callback_0_(mthis) => clone_Callback_0(mthis);
+  credentials_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "credentials");
 
-  static clone_Callback_1(mthis, __arg_0) native "Request_clone_Callback";
-  clone_Callback_1_(mthis, __arg_0) => clone_Callback_1(mthis, __arg_0);
+  headers_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "headers");
 
-  static clone_Callback_2(mthis, __arg_0, __arg_1) native "Request_clone_Callback";
-  clone_Callback_2_(mthis, __arg_0, __arg_1) => clone_Callback_2(mthis, __arg_0, __arg_1);
+  json_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "json", []);
 
-  static constructorCallback_0() native "Request_constructorCallback";
-  constructorCallback_0_() => constructorCallback_0();
+  method_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "method");
 
-  static constructorCallback_1(__arg_0) native "Request_constructorCallback";
-  constructorCallback_1_(__arg_0) => constructorCallback_1(__arg_0);
+  mode_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "mode");
 
-  static constructorCallback_2(__arg_0, __arg_1) native "Request_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  referrer_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "referrer");
 
-  static constructorCallback_3(__arg_0, __arg_1, __arg_2) native "Request_constructorCallback";
-  constructorCallback_3_(__arg_0, __arg_1, __arg_2) => constructorCallback_3(__arg_0, __arg_1, __arg_2);
+  text_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "text", []);
 
-  static constructorCallback_4(__arg_0, __arg_1, __arg_2, __arg_3) native "Request_constructorCallback";
-  constructorCallback_4_(__arg_0, __arg_1, __arg_2, __arg_3) => constructorCallback_4(__arg_0, __arg_1, __arg_2, __arg_3);
-
-  static credentials_Getter(mthis) native "Request_credentials_Getter";
-  credentials_Getter_(mthis) => credentials_Getter(mthis);
-
-  static headers_Getter(mthis) native "Request_headers_Getter";
-  headers_Getter_(mthis) => headers_Getter(mthis);
-
-  static json_Callback_0(mthis) native "Request_json_Callback";
-  json_Callback_0_(mthis) => json_Callback_0(mthis);
-
-  static json_Callback_1(mthis, __arg_0) native "Request_json_Callback";
-  json_Callback_1_(mthis, __arg_0) => json_Callback_1(mthis, __arg_0);
-
-  static json_Callback_2(mthis, __arg_0, __arg_1) native "Request_json_Callback";
-  json_Callback_2_(mthis, __arg_0, __arg_1) => json_Callback_2(mthis, __arg_0, __arg_1);
-
-  static method_Getter(mthis) native "Request_method_Getter";
-  method_Getter_(mthis) => method_Getter(mthis);
-
-  static mode_Getter(mthis) native "Request_mode_Getter";
-  mode_Getter_(mthis) => mode_Getter(mthis);
-
-  static referrer_Getter(mthis) native "Request_referrer_Getter";
-  referrer_Getter_(mthis) => referrer_Getter(mthis);
-
-  static text_Callback_0(mthis) native "Request_text_Callback";
-  text_Callback_0_(mthis) => text_Callback_0(mthis);
-
-  static text_Callback_1(mthis, __arg_0) native "Request_text_Callback";
-  text_Callback_1_(mthis, __arg_0) => text_Callback_1(mthis, __arg_0);
-
-  static text_Callback_2(mthis, __arg_0, __arg_1) native "Request_text_Callback";
-  text_Callback_2_(mthis, __arg_0, __arg_1) => text_Callback_2(mthis, __arg_0, __arg_1);
-
-  static url_Getter(mthis) native "Request_url_Getter";
-  url_Getter_(mthis) => url_Getter(mthis);
+  url_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "url");
 
 }
 
 class BlinkResourceProgressEvent extends BlinkProgressEvent {
   static final instance = new BlinkResourceProgressEvent();
 
-  static url_Getter(mthis) native "ResourceProgressEvent_url_Getter";
-  url_Getter_(mthis) => url_Getter(mthis);
+  url_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "url");
 
 }
 
 class BlinkResponse {
   static final instance = new BlinkResponse();
 
-  static arrayBuffer_Callback_0(mthis) native "Response_arrayBuffer_Callback";
-  arrayBuffer_Callback_0_(mthis) => arrayBuffer_Callback_0(mthis);
+  arrayBuffer_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "arrayBuffer", []);
 
-  static arrayBuffer_Callback_1(mthis, __arg_0) native "Response_arrayBuffer_Callback";
-  arrayBuffer_Callback_1_(mthis, __arg_0) => arrayBuffer_Callback_1(mthis, __arg_0);
+  blob_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "blob", []);
 
-  static arrayBuffer_Callback_2(mthis, __arg_0, __arg_1) native "Response_arrayBuffer_Callback";
-  arrayBuffer_Callback_2_(mthis, __arg_0, __arg_1) => arrayBuffer_Callback_2(mthis, __arg_0, __arg_1);
+  bodyUsed_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "bodyUsed");
 
-  static blob_Callback_0(mthis) native "Response_blob_Callback";
-  blob_Callback_0_(mthis) => blob_Callback_0(mthis);
+  clone_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "clone", []);
 
-  static blob_Callback_1(mthis, __arg_0) native "Response_blob_Callback";
-  blob_Callback_1_(mthis, __arg_0) => blob_Callback_1(mthis, __arg_0);
+  constructorCallback_0_() => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "Response"), []);
 
-  static blob_Callback_2(mthis, __arg_0, __arg_1) native "Response_blob_Callback";
-  blob_Callback_2_(mthis, __arg_0, __arg_1) => blob_Callback_2(mthis, __arg_0, __arg_1);
+  constructorCallback_1_(__arg_0) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "Response"), [__arg_0]);
 
-  static bodyUsed_Getter(mthis) native "Response_bodyUsed_Getter";
-  bodyUsed_Getter_(mthis) => bodyUsed_Getter(mthis);
+  constructorCallback_2_(__arg_0, __arg_1) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "Response"), [__arg_0, __arg_1]);
 
-  static clone_Callback_0(mthis) native "Response_clone_Callback";
-  clone_Callback_0_(mthis) => clone_Callback_0(mthis);
+  headers_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "headers");
 
-  static clone_Callback_1(mthis, __arg_0) native "Response_clone_Callback";
-  clone_Callback_1_(mthis, __arg_0) => clone_Callback_1(mthis, __arg_0);
+  json_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "json", []);
 
-  static clone_Callback_2(mthis, __arg_0, __arg_1) native "Response_clone_Callback";
-  clone_Callback_2_(mthis, __arg_0, __arg_1) => clone_Callback_2(mthis, __arg_0, __arg_1);
+  statusText_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "statusText");
 
-  static constructorCallback_0() native "Response_constructorCallback";
-  constructorCallback_0_() => constructorCallback_0();
+  status_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "status");
 
-  static constructorCallback_1(__arg_0) native "Response_constructorCallback";
-  constructorCallback_1_(__arg_0) => constructorCallback_1(__arg_0);
+  text_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "text", []);
 
-  static constructorCallback_2(__arg_0, __arg_1) native "Response_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  type_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "type");
 
-  static constructorCallback_3(__arg_0, __arg_1, __arg_2) native "Response_constructorCallback";
-  constructorCallback_3_(__arg_0, __arg_1, __arg_2) => constructorCallback_3(__arg_0, __arg_1, __arg_2);
-
-  static constructorCallback_4(__arg_0, __arg_1, __arg_2, __arg_3) native "Response_constructorCallback";
-  constructorCallback_4_(__arg_0, __arg_1, __arg_2, __arg_3) => constructorCallback_4(__arg_0, __arg_1, __arg_2, __arg_3);
-
-  static headers_Getter(mthis) native "Response_headers_Getter";
-  headers_Getter_(mthis) => headers_Getter(mthis);
-
-  static json_Callback_0(mthis) native "Response_json_Callback";
-  json_Callback_0_(mthis) => json_Callback_0(mthis);
-
-  static json_Callback_1(mthis, __arg_0) native "Response_json_Callback";
-  json_Callback_1_(mthis, __arg_0) => json_Callback_1(mthis, __arg_0);
-
-  static json_Callback_2(mthis, __arg_0, __arg_1) native "Response_json_Callback";
-  json_Callback_2_(mthis, __arg_0, __arg_1) => json_Callback_2(mthis, __arg_0, __arg_1);
-
-  static statusText_Getter(mthis) native "Response_statusText_Getter";
-  statusText_Getter_(mthis) => statusText_Getter(mthis);
-
-  static status_Getter(mthis) native "Response_status_Getter";
-  status_Getter_(mthis) => status_Getter(mthis);
-
-  static text_Callback_0(mthis) native "Response_text_Callback";
-  text_Callback_0_(mthis) => text_Callback_0(mthis);
-
-  static text_Callback_1(mthis, __arg_0) native "Response_text_Callback";
-  text_Callback_1_(mthis, __arg_0) => text_Callback_1(mthis, __arg_0);
-
-  static text_Callback_2(mthis, __arg_0, __arg_1) native "Response_text_Callback";
-  text_Callback_2_(mthis, __arg_0, __arg_1) => text_Callback_2(mthis, __arg_0, __arg_1);
-
-  static type_Getter(mthis) native "Response_type_Getter";
-  type_Getter_(mthis) => type_Getter(mthis);
-
-  static url_Getter(mthis) native "Response_url_Getter";
-  url_Getter_(mthis) => url_Getter(mthis);
+  url_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "url");
 
 }
 
 class BlinkSQLError {
   static final instance = new BlinkSQLError();
 
-  static code_Getter(mthis) native "SQLError_code_Getter";
-  code_Getter_(mthis) => code_Getter(mthis);
+  code_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "code");
 
-  static message_Getter(mthis) native "SQLError_message_Getter";
-  message_Getter_(mthis) => message_Getter(mthis);
+  message_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "message");
 
 }
 
 class BlinkSQLResultSet {
   static final instance = new BlinkSQLResultSet();
 
-  static insertId_Getter(mthis) native "SQLResultSet_insertId_Getter";
-  insertId_Getter_(mthis) => insertId_Getter(mthis);
+  insertId_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "insertId");
 
-  static rowsAffected_Getter(mthis) native "SQLResultSet_rowsAffected_Getter";
-  rowsAffected_Getter_(mthis) => rowsAffected_Getter(mthis);
+  rowsAffected_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "rowsAffected");
 
-  static rows_Getter(mthis) native "SQLResultSet_rows_Getter";
-  rows_Getter_(mthis) => rows_Getter(mthis);
+  rows_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "rows");
 
 }
 
 class BlinkSQLResultSetRowList {
   static final instance = new BlinkSQLResultSetRowList();
 
-  static item_Callback_0(mthis) native "SQLResultSetRowList_item_Callback";
-  item_Callback_0_(mthis) => item_Callback_0(mthis);
+  item_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "item", []);
 
-  static item_Callback_1(mthis, __arg_0) native "SQLResultSetRowList_item_Callback";
-  item_Callback_1_(mthis, __arg_0) => item_Callback_1(mthis, __arg_0);
+  item_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "item", [__arg_0]);
 
-  static item_Callback_2(mthis, __arg_0, __arg_1) native "SQLResultSetRowList_item_Callback";
-  item_Callback_2_(mthis, __arg_0, __arg_1) => item_Callback_2(mthis, __arg_0, __arg_1);
-
-  static item_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SQLResultSetRowList_item_Callback";
-  item_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => item_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static length_Getter(mthis) native "SQLResultSetRowList_length_Getter";
-  length_Getter_(mthis) => length_Getter(mthis);
+  length_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "length");
 
 }
 
 class BlinkSQLTransaction {
   static final instance = new BlinkSQLTransaction();
 
-  static executeSql_Callback_0(mthis) native "SQLTransaction_executeSql_Callback";
-  executeSql_Callback_0_(mthis) => executeSql_Callback_0(mthis);
+  executeSql_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "executeSql", []);
 
-  static executeSql_Callback_1(mthis, __arg_0) native "SQLTransaction_executeSql_Callback";
-  executeSql_Callback_1_(mthis, __arg_0) => executeSql_Callback_1(mthis, __arg_0);
+  executeSql_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "executeSql", [__arg_0]);
 
-  static executeSql_Callback_2(mthis, __arg_0, __arg_1) native "SQLTransaction_executeSql_Callback";
-  executeSql_Callback_2_(mthis, __arg_0, __arg_1) => executeSql_Callback_2(mthis, __arg_0, __arg_1);
+  executeSql_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "executeSql", [__arg_0, __arg_1]);
 
-  static executeSql_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SQLTransaction_executeSql_Callback";
-  executeSql_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => executeSql_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  executeSql_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "executeSql", [__arg_0, __arg_1, __arg_2]);
 
-  static executeSql_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "SQLTransaction_executeSql_Callback";
-  executeSql_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => executeSql_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static executeSql_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "SQLTransaction_executeSql_Callback";
-  executeSql_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => executeSql_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
-
-  static executeSql_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "SQLTransaction_executeSql_Callback";
-  executeSql_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => executeSql_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  executeSql_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "executeSql", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
 }
 
 class BlinkSVGAElement extends BlinkSVGGraphicsElement {
   static final instance = new BlinkSVGAElement();
 
-  static href_Getter(mthis) native "SVGAElement_href_Getter";
-  href_Getter_(mthis) => href_Getter(mthis);
+  href_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "href");
 
-  static target_Getter(mthis) native "SVGAElement_target_Getter";
-  target_Getter_(mthis) => target_Getter(mthis);
+  target_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "target");
 
 }
 
@@ -19207,20 +10517,15 @@
 class BlinkSVGAltGlyphElement extends BlinkSVGTextPositioningElement {
   static final instance = new BlinkSVGAltGlyphElement();
 
-  static format_Getter(mthis) native "SVGAltGlyphElement_format_Getter";
-  format_Getter_(mthis) => format_Getter(mthis);
+  format_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "format");
 
-  static format_Setter(mthis, __arg_0) native "SVGAltGlyphElement_format_Setter";
-  format_Setter_(mthis, __arg_0) => format_Setter(mthis, __arg_0);
+  format_Setter_(mthis, __arg_0) => mthis["format"] = __arg_0;
 
-  static glyphRef_Getter(mthis) native "SVGAltGlyphElement_glyphRef_Getter";
-  glyphRef_Getter_(mthis) => glyphRef_Getter(mthis);
+  glyphRef_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "glyphRef");
 
-  static glyphRef_Setter(mthis, __arg_0) native "SVGAltGlyphElement_glyphRef_Setter";
-  glyphRef_Setter_(mthis, __arg_0) => glyphRef_Setter(mthis, __arg_0);
+  glyphRef_Setter_(mthis, __arg_0) => mthis["glyphRef"] = __arg_0;
 
-  static href_Getter(mthis) native "SVGAltGlyphElement_href_Getter";
-  href_Getter_(mthis) => href_Getter(mthis);
+  href_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "href");
 
 }
 
@@ -19232,53 +10537,29 @@
 class BlinkSVGAngle {
   static final instance = new BlinkSVGAngle();
 
-  static convertToSpecifiedUnits_Callback_0(mthis) native "SVGAngle_convertToSpecifiedUnits_Callback";
-  convertToSpecifiedUnits_Callback_0_(mthis) => convertToSpecifiedUnits_Callback_0(mthis);
+  convertToSpecifiedUnits_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "convertToSpecifiedUnits", []);
 
-  static convertToSpecifiedUnits_Callback_1(mthis, __arg_0) native "SVGAngle_convertToSpecifiedUnits_Callback";
-  convertToSpecifiedUnits_Callback_1_(mthis, __arg_0) => convertToSpecifiedUnits_Callback_1(mthis, __arg_0);
+  convertToSpecifiedUnits_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "convertToSpecifiedUnits", [__arg_0]);
 
-  static convertToSpecifiedUnits_Callback_2(mthis, __arg_0, __arg_1) native "SVGAngle_convertToSpecifiedUnits_Callback";
-  convertToSpecifiedUnits_Callback_2_(mthis, __arg_0, __arg_1) => convertToSpecifiedUnits_Callback_2(mthis, __arg_0, __arg_1);
+  newValueSpecifiedUnits_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "newValueSpecifiedUnits", []);
 
-  static convertToSpecifiedUnits_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGAngle_convertToSpecifiedUnits_Callback";
-  convertToSpecifiedUnits_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => convertToSpecifiedUnits_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  newValueSpecifiedUnits_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "newValueSpecifiedUnits", [__arg_0]);
 
-  static newValueSpecifiedUnits_Callback_0(mthis) native "SVGAngle_newValueSpecifiedUnits_Callback";
-  newValueSpecifiedUnits_Callback_0_(mthis) => newValueSpecifiedUnits_Callback_0(mthis);
+  newValueSpecifiedUnits_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "newValueSpecifiedUnits", [__arg_0, __arg_1]);
 
-  static newValueSpecifiedUnits_Callback_1(mthis, __arg_0) native "SVGAngle_newValueSpecifiedUnits_Callback";
-  newValueSpecifiedUnits_Callback_1_(mthis, __arg_0) => newValueSpecifiedUnits_Callback_1(mthis, __arg_0);
+  unitType_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "unitType");
 
-  static newValueSpecifiedUnits_Callback_2(mthis, __arg_0, __arg_1) native "SVGAngle_newValueSpecifiedUnits_Callback";
-  newValueSpecifiedUnits_Callback_2_(mthis, __arg_0, __arg_1) => newValueSpecifiedUnits_Callback_2(mthis, __arg_0, __arg_1);
+  valueAsString_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "valueAsString");
 
-  static newValueSpecifiedUnits_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGAngle_newValueSpecifiedUnits_Callback";
-  newValueSpecifiedUnits_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => newValueSpecifiedUnits_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  valueAsString_Setter_(mthis, __arg_0) => mthis["valueAsString"] = __arg_0;
 
-  static newValueSpecifiedUnits_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "SVGAngle_newValueSpecifiedUnits_Callback";
-  newValueSpecifiedUnits_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => newValueSpecifiedUnits_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  valueInSpecifiedUnits_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "valueInSpecifiedUnits");
 
-  static unitType_Getter(mthis) native "SVGAngle_unitType_Getter";
-  unitType_Getter_(mthis) => unitType_Getter(mthis);
+  valueInSpecifiedUnits_Setter_(mthis, __arg_0) => mthis["valueInSpecifiedUnits"] = __arg_0;
 
-  static valueAsString_Getter(mthis) native "SVGAngle_valueAsString_Getter";
-  valueAsString_Getter_(mthis) => valueAsString_Getter(mthis);
+  value_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "value");
 
-  static valueAsString_Setter(mthis, __arg_0) native "SVGAngle_valueAsString_Setter";
-  valueAsString_Setter_(mthis, __arg_0) => valueAsString_Setter(mthis, __arg_0);
-
-  static valueInSpecifiedUnits_Getter(mthis) native "SVGAngle_valueInSpecifiedUnits_Getter";
-  valueInSpecifiedUnits_Getter_(mthis) => valueInSpecifiedUnits_Getter(mthis);
-
-  static valueInSpecifiedUnits_Setter(mthis, __arg_0) native "SVGAngle_valueInSpecifiedUnits_Setter";
-  valueInSpecifiedUnits_Setter_(mthis, __arg_0) => valueInSpecifiedUnits_Setter(mthis, __arg_0);
-
-  static value_Getter(mthis) native "SVGAngle_value_Getter";
-  value_Getter_(mthis) => value_Getter(mthis);
-
-  static value_Setter(mthis, __arg_0) native "SVGAngle_value_Setter";
-  value_Setter_(mthis, __arg_0) => value_Setter(mthis, __arg_0);
+  value_Setter_(mthis, __arg_0) => mthis["value"] = __arg_0;
 
 }
 
@@ -19300,346 +10581,223 @@
 class BlinkSVGAnimatedAngle {
   static final instance = new BlinkSVGAnimatedAngle();
 
-  static animVal_Getter(mthis) native "SVGAnimatedAngle_animVal_Getter";
-  animVal_Getter_(mthis) => animVal_Getter(mthis);
+  animVal_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "animVal");
 
-  static baseVal_Getter(mthis) native "SVGAnimatedAngle_baseVal_Getter";
-  baseVal_Getter_(mthis) => baseVal_Getter(mthis);
+  baseVal_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "baseVal");
 
 }
 
 class BlinkSVGAnimatedBoolean {
   static final instance = new BlinkSVGAnimatedBoolean();
 
-  static animVal_Getter(mthis) native "SVGAnimatedBoolean_animVal_Getter";
-  animVal_Getter_(mthis) => animVal_Getter(mthis);
+  animVal_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "animVal");
 
-  static baseVal_Getter(mthis) native "SVGAnimatedBoolean_baseVal_Getter";
-  baseVal_Getter_(mthis) => baseVal_Getter(mthis);
+  baseVal_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "baseVal");
 
-  static baseVal_Setter(mthis, __arg_0) native "SVGAnimatedBoolean_baseVal_Setter";
-  baseVal_Setter_(mthis, __arg_0) => baseVal_Setter(mthis, __arg_0);
+  baseVal_Setter_(mthis, __arg_0) => mthis["baseVal"] = __arg_0;
 
 }
 
 class BlinkSVGAnimatedEnumeration {
   static final instance = new BlinkSVGAnimatedEnumeration();
 
-  static animVal_Getter(mthis) native "SVGAnimatedEnumeration_animVal_Getter";
-  animVal_Getter_(mthis) => animVal_Getter(mthis);
+  animVal_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "animVal");
 
-  static baseVal_Getter(mthis) native "SVGAnimatedEnumeration_baseVal_Getter";
-  baseVal_Getter_(mthis) => baseVal_Getter(mthis);
+  baseVal_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "baseVal");
 
-  static baseVal_Setter(mthis, __arg_0) native "SVGAnimatedEnumeration_baseVal_Setter";
-  baseVal_Setter_(mthis, __arg_0) => baseVal_Setter(mthis, __arg_0);
+  baseVal_Setter_(mthis, __arg_0) => mthis["baseVal"] = __arg_0;
 
 }
 
 class BlinkSVGAnimatedInteger {
   static final instance = new BlinkSVGAnimatedInteger();
 
-  static animVal_Getter(mthis) native "SVGAnimatedInteger_animVal_Getter";
-  animVal_Getter_(mthis) => animVal_Getter(mthis);
+  animVal_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "animVal");
 
-  static baseVal_Getter(mthis) native "SVGAnimatedInteger_baseVal_Getter";
-  baseVal_Getter_(mthis) => baseVal_Getter(mthis);
+  baseVal_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "baseVal");
 
-  static baseVal_Setter(mthis, __arg_0) native "SVGAnimatedInteger_baseVal_Setter";
-  baseVal_Setter_(mthis, __arg_0) => baseVal_Setter(mthis, __arg_0);
+  baseVal_Setter_(mthis, __arg_0) => mthis["baseVal"] = __arg_0;
 
 }
 
 class BlinkSVGAnimatedLength {
   static final instance = new BlinkSVGAnimatedLength();
 
-  static animVal_Getter(mthis) native "SVGAnimatedLength_animVal_Getter";
-  animVal_Getter_(mthis) => animVal_Getter(mthis);
+  animVal_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "animVal");
 
-  static baseVal_Getter(mthis) native "SVGAnimatedLength_baseVal_Getter";
-  baseVal_Getter_(mthis) => baseVal_Getter(mthis);
+  baseVal_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "baseVal");
 
 }
 
 class BlinkSVGAnimatedLengthList {
   static final instance = new BlinkSVGAnimatedLengthList();
 
-  static animVal_Getter(mthis) native "SVGAnimatedLengthList_animVal_Getter";
-  animVal_Getter_(mthis) => animVal_Getter(mthis);
+  animVal_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "animVal");
 
-  static baseVal_Getter(mthis) native "SVGAnimatedLengthList_baseVal_Getter";
-  baseVal_Getter_(mthis) => baseVal_Getter(mthis);
+  baseVal_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "baseVal");
 
 }
 
 class BlinkSVGAnimatedNumber {
   static final instance = new BlinkSVGAnimatedNumber();
 
-  static animVal_Getter(mthis) native "SVGAnimatedNumber_animVal_Getter";
-  animVal_Getter_(mthis) => animVal_Getter(mthis);
+  animVal_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "animVal");
 
-  static baseVal_Getter(mthis) native "SVGAnimatedNumber_baseVal_Getter";
-  baseVal_Getter_(mthis) => baseVal_Getter(mthis);
+  baseVal_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "baseVal");
 
-  static baseVal_Setter(mthis, __arg_0) native "SVGAnimatedNumber_baseVal_Setter";
-  baseVal_Setter_(mthis, __arg_0) => baseVal_Setter(mthis, __arg_0);
+  baseVal_Setter_(mthis, __arg_0) => mthis["baseVal"] = __arg_0;
 
 }
 
 class BlinkSVGAnimatedNumberList {
   static final instance = new BlinkSVGAnimatedNumberList();
 
-  static animVal_Getter(mthis) native "SVGAnimatedNumberList_animVal_Getter";
-  animVal_Getter_(mthis) => animVal_Getter(mthis);
+  animVal_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "animVal");
 
-  static baseVal_Getter(mthis) native "SVGAnimatedNumberList_baseVal_Getter";
-  baseVal_Getter_(mthis) => baseVal_Getter(mthis);
+  baseVal_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "baseVal");
 
 }
 
 class BlinkSVGAnimatedPreserveAspectRatio {
   static final instance = new BlinkSVGAnimatedPreserveAspectRatio();
 
-  static animVal_Getter(mthis) native "SVGAnimatedPreserveAspectRatio_animVal_Getter";
-  animVal_Getter_(mthis) => animVal_Getter(mthis);
+  animVal_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "animVal");
 
-  static baseVal_Getter(mthis) native "SVGAnimatedPreserveAspectRatio_baseVal_Getter";
-  baseVal_Getter_(mthis) => baseVal_Getter(mthis);
+  baseVal_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "baseVal");
 
 }
 
 class BlinkSVGAnimatedRect {
   static final instance = new BlinkSVGAnimatedRect();
 
-  static animVal_Getter(mthis) native "SVGAnimatedRect_animVal_Getter";
-  animVal_Getter_(mthis) => animVal_Getter(mthis);
+  animVal_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "animVal");
 
-  static baseVal_Getter(mthis) native "SVGAnimatedRect_baseVal_Getter";
-  baseVal_Getter_(mthis) => baseVal_Getter(mthis);
+  baseVal_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "baseVal");
 
 }
 
 class BlinkSVGAnimatedString {
   static final instance = new BlinkSVGAnimatedString();
 
-  static animVal_Getter(mthis) native "SVGAnimatedString_animVal_Getter";
-  animVal_Getter_(mthis) => animVal_Getter(mthis);
+  animVal_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "animVal");
 
-  static baseVal_Getter(mthis) native "SVGAnimatedString_baseVal_Getter";
-  baseVal_Getter_(mthis) => baseVal_Getter(mthis);
+  baseVal_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "baseVal");
 
-  static baseVal_Setter(mthis, __arg_0) native "SVGAnimatedString_baseVal_Setter";
-  baseVal_Setter_(mthis, __arg_0) => baseVal_Setter(mthis, __arg_0);
+  baseVal_Setter_(mthis, __arg_0) => mthis["baseVal"] = __arg_0;
 
 }
 
 class BlinkSVGAnimatedTransformList {
   static final instance = new BlinkSVGAnimatedTransformList();
 
-  static animVal_Getter(mthis) native "SVGAnimatedTransformList_animVal_Getter";
-  animVal_Getter_(mthis) => animVal_Getter(mthis);
+  animVal_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "animVal");
 
-  static baseVal_Getter(mthis) native "SVGAnimatedTransformList_baseVal_Getter";
-  baseVal_Getter_(mthis) => baseVal_Getter(mthis);
+  baseVal_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "baseVal");
 
 }
 
 class BlinkSVGAnimationElement extends BlinkSVGElement {
   static final instance = new BlinkSVGAnimationElement();
 
-  static beginElementAt_Callback_0(mthis) native "SVGAnimationElement_beginElementAt_Callback";
-  beginElementAt_Callback_0_(mthis) => beginElementAt_Callback_0(mthis);
+  beginElementAt_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "beginElementAt", []);
 
-  static beginElementAt_Callback_1(mthis, __arg_0) native "SVGAnimationElement_beginElementAt_Callback";
-  beginElementAt_Callback_1_(mthis, __arg_0) => beginElementAt_Callback_1(mthis, __arg_0);
+  beginElementAt_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "beginElementAt", [__arg_0]);
 
-  static beginElementAt_Callback_2(mthis, __arg_0, __arg_1) native "SVGAnimationElement_beginElementAt_Callback";
-  beginElementAt_Callback_2_(mthis, __arg_0, __arg_1) => beginElementAt_Callback_2(mthis, __arg_0, __arg_1);
+  beginElement_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "beginElement", []);
 
-  static beginElementAt_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGAnimationElement_beginElementAt_Callback";
-  beginElementAt_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => beginElementAt_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  endElementAt_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "endElementAt", []);
 
-  static beginElement_Callback_0(mthis) native "SVGAnimationElement_beginElement_Callback";
-  beginElement_Callback_0_(mthis) => beginElement_Callback_0(mthis);
+  endElementAt_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "endElementAt", [__arg_0]);
 
-  static beginElement_Callback_1(mthis, __arg_0) native "SVGAnimationElement_beginElement_Callback";
-  beginElement_Callback_1_(mthis, __arg_0) => beginElement_Callback_1(mthis, __arg_0);
+  endElement_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "endElement", []);
 
-  static beginElement_Callback_2(mthis, __arg_0, __arg_1) native "SVGAnimationElement_beginElement_Callback";
-  beginElement_Callback_2_(mthis, __arg_0, __arg_1) => beginElement_Callback_2(mthis, __arg_0, __arg_1);
+  getCurrentTime_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getCurrentTime", []);
 
-  static endElementAt_Callback_0(mthis) native "SVGAnimationElement_endElementAt_Callback";
-  endElementAt_Callback_0_(mthis) => endElementAt_Callback_0(mthis);
+  getSimpleDuration_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getSimpleDuration", []);
 
-  static endElementAt_Callback_1(mthis, __arg_0) native "SVGAnimationElement_endElementAt_Callback";
-  endElementAt_Callback_1_(mthis, __arg_0) => endElementAt_Callback_1(mthis, __arg_0);
+  getStartTime_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getStartTime", []);
 
-  static endElementAt_Callback_2(mthis, __arg_0, __arg_1) native "SVGAnimationElement_endElementAt_Callback";
-  endElementAt_Callback_2_(mthis, __arg_0, __arg_1) => endElementAt_Callback_2(mthis, __arg_0, __arg_1);
+  hasExtension_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "hasExtension", []);
 
-  static endElementAt_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGAnimationElement_endElementAt_Callback";
-  endElementAt_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => endElementAt_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  hasExtension_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "hasExtension", [__arg_0]);
 
-  static endElement_Callback_0(mthis) native "SVGAnimationElement_endElement_Callback";
-  endElement_Callback_0_(mthis) => endElement_Callback_0(mthis);
+  onbegin_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onbegin");
 
-  static endElement_Callback_1(mthis, __arg_0) native "SVGAnimationElement_endElement_Callback";
-  endElement_Callback_1_(mthis, __arg_0) => endElement_Callback_1(mthis, __arg_0);
+  onbegin_Setter_(mthis, __arg_0) => mthis["onbegin"] = __arg_0;
 
-  static endElement_Callback_2(mthis, __arg_0, __arg_1) native "SVGAnimationElement_endElement_Callback";
-  endElement_Callback_2_(mthis, __arg_0, __arg_1) => endElement_Callback_2(mthis, __arg_0, __arg_1);
+  onend_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onend");
 
-  static getCurrentTime_Callback_0(mthis) native "SVGAnimationElement_getCurrentTime_Callback";
-  getCurrentTime_Callback_0_(mthis) => getCurrentTime_Callback_0(mthis);
+  onend_Setter_(mthis, __arg_0) => mthis["onend"] = __arg_0;
 
-  static getCurrentTime_Callback_1(mthis, __arg_0) native "SVGAnimationElement_getCurrentTime_Callback";
-  getCurrentTime_Callback_1_(mthis, __arg_0) => getCurrentTime_Callback_1(mthis, __arg_0);
+  onrepeat_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onrepeat");
 
-  static getCurrentTime_Callback_2(mthis, __arg_0, __arg_1) native "SVGAnimationElement_getCurrentTime_Callback";
-  getCurrentTime_Callback_2_(mthis, __arg_0, __arg_1) => getCurrentTime_Callback_2(mthis, __arg_0, __arg_1);
+  onrepeat_Setter_(mthis, __arg_0) => mthis["onrepeat"] = __arg_0;
 
-  static getSimpleDuration_Callback_0(mthis) native "SVGAnimationElement_getSimpleDuration_Callback";
-  getSimpleDuration_Callback_0_(mthis) => getSimpleDuration_Callback_0(mthis);
+  requiredExtensions_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "requiredExtensions");
 
-  static getSimpleDuration_Callback_1(mthis, __arg_0) native "SVGAnimationElement_getSimpleDuration_Callback";
-  getSimpleDuration_Callback_1_(mthis, __arg_0) => getSimpleDuration_Callback_1(mthis, __arg_0);
+  requiredFeatures_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "requiredFeatures");
 
-  static getSimpleDuration_Callback_2(mthis, __arg_0, __arg_1) native "SVGAnimationElement_getSimpleDuration_Callback";
-  getSimpleDuration_Callback_2_(mthis, __arg_0, __arg_1) => getSimpleDuration_Callback_2(mthis, __arg_0, __arg_1);
+  systemLanguage_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "systemLanguage");
 
-  static getStartTime_Callback_0(mthis) native "SVGAnimationElement_getStartTime_Callback";
-  getStartTime_Callback_0_(mthis) => getStartTime_Callback_0(mthis);
-
-  static getStartTime_Callback_1(mthis, __arg_0) native "SVGAnimationElement_getStartTime_Callback";
-  getStartTime_Callback_1_(mthis, __arg_0) => getStartTime_Callback_1(mthis, __arg_0);
-
-  static getStartTime_Callback_2(mthis, __arg_0, __arg_1) native "SVGAnimationElement_getStartTime_Callback";
-  getStartTime_Callback_2_(mthis, __arg_0, __arg_1) => getStartTime_Callback_2(mthis, __arg_0, __arg_1);
-
-  static hasExtension_Callback_0(mthis) native "SVGAnimationElement_hasExtension_Callback";
-  hasExtension_Callback_0_(mthis) => hasExtension_Callback_0(mthis);
-
-  static hasExtension_Callback_1(mthis, __arg_0) native "SVGAnimationElement_hasExtension_Callback";
-  hasExtension_Callback_1_(mthis, __arg_0) => hasExtension_Callback_1(mthis, __arg_0);
-
-  static hasExtension_Callback_2(mthis, __arg_0, __arg_1) native "SVGAnimationElement_hasExtension_Callback";
-  hasExtension_Callback_2_(mthis, __arg_0, __arg_1) => hasExtension_Callback_2(mthis, __arg_0, __arg_1);
-
-  static hasExtension_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGAnimationElement_hasExtension_Callback";
-  hasExtension_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => hasExtension_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static onbegin_Getter(mthis) native "SVGAnimationElement_onbegin_Getter";
-  onbegin_Getter_(mthis) => onbegin_Getter(mthis);
-
-  static onbegin_Setter(mthis, __arg_0) native "SVGAnimationElement_onbegin_Setter";
-  onbegin_Setter_(mthis, __arg_0) => onbegin_Setter(mthis, __arg_0);
-
-  static onend_Getter(mthis) native "SVGAnimationElement_onend_Getter";
-  onend_Getter_(mthis) => onend_Getter(mthis);
-
-  static onend_Setter(mthis, __arg_0) native "SVGAnimationElement_onend_Setter";
-  onend_Setter_(mthis, __arg_0) => onend_Setter(mthis, __arg_0);
-
-  static onrepeat_Getter(mthis) native "SVGAnimationElement_onrepeat_Getter";
-  onrepeat_Getter_(mthis) => onrepeat_Getter(mthis);
-
-  static onrepeat_Setter(mthis, __arg_0) native "SVGAnimationElement_onrepeat_Setter";
-  onrepeat_Setter_(mthis, __arg_0) => onrepeat_Setter(mthis, __arg_0);
-
-  static requiredExtensions_Getter(mthis) native "SVGAnimationElement_requiredExtensions_Getter";
-  requiredExtensions_Getter_(mthis) => requiredExtensions_Getter(mthis);
-
-  static requiredFeatures_Getter(mthis) native "SVGAnimationElement_requiredFeatures_Getter";
-  requiredFeatures_Getter_(mthis) => requiredFeatures_Getter(mthis);
-
-  static systemLanguage_Getter(mthis) native "SVGAnimationElement_systemLanguage_Getter";
-  systemLanguage_Getter_(mthis) => systemLanguage_Getter(mthis);
-
-  static targetElement_Getter(mthis) native "SVGAnimationElement_targetElement_Getter";
-  targetElement_Getter_(mthis) => targetElement_Getter(mthis);
+  targetElement_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "targetElement");
 
 }
 
 class BlinkSVGCircleElement extends BlinkSVGGeometryElement {
   static final instance = new BlinkSVGCircleElement();
 
-  static cx_Getter(mthis) native "SVGCircleElement_cx_Getter";
-  cx_Getter_(mthis) => cx_Getter(mthis);
+  cx_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "cx");
 
-  static cy_Getter(mthis) native "SVGCircleElement_cy_Getter";
-  cy_Getter_(mthis) => cy_Getter(mthis);
+  cy_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "cy");
 
-  static r_Getter(mthis) native "SVGCircleElement_r_Getter";
-  r_Getter_(mthis) => r_Getter(mthis);
+  r_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "r");
 
 }
 
 class BlinkSVGClipPathElement extends BlinkSVGGraphicsElement {
   static final instance = new BlinkSVGClipPathElement();
 
-  static clipPathUnits_Getter(mthis) native "SVGClipPathElement_clipPathUnits_Getter";
-  clipPathUnits_Getter_(mthis) => clipPathUnits_Getter(mthis);
+  clipPathUnits_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "clipPathUnits");
 
 }
 
 class BlinkSVGComponentTransferFunctionElement extends BlinkSVGElement {
   static final instance = new BlinkSVGComponentTransferFunctionElement();
 
-  static amplitude_Getter(mthis) native "SVGComponentTransferFunctionElement_amplitude_Getter";
-  amplitude_Getter_(mthis) => amplitude_Getter(mthis);
+  amplitude_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "amplitude");
 
-  static exponent_Getter(mthis) native "SVGComponentTransferFunctionElement_exponent_Getter";
-  exponent_Getter_(mthis) => exponent_Getter(mthis);
+  exponent_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "exponent");
 
-  static intercept_Getter(mthis) native "SVGComponentTransferFunctionElement_intercept_Getter";
-  intercept_Getter_(mthis) => intercept_Getter(mthis);
+  intercept_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "intercept");
 
-  static offset_Getter(mthis) native "SVGComponentTransferFunctionElement_offset_Getter";
-  offset_Getter_(mthis) => offset_Getter(mthis);
+  offset_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "offset");
 
-  static slope_Getter(mthis) native "SVGComponentTransferFunctionElement_slope_Getter";
-  slope_Getter_(mthis) => slope_Getter(mthis);
+  slope_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "slope");
 
-  static tableValues_Getter(mthis) native "SVGComponentTransferFunctionElement_tableValues_Getter";
-  tableValues_Getter_(mthis) => tableValues_Getter(mthis);
+  tableValues_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "tableValues");
 
-  static type_Getter(mthis) native "SVGComponentTransferFunctionElement_type_Getter";
-  type_Getter_(mthis) => type_Getter(mthis);
+  type_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "type");
 
 }
 
 class BlinkSVGCursorElement extends BlinkSVGElement {
   static final instance = new BlinkSVGCursorElement();
 
-  static hasExtension_Callback_0(mthis) native "SVGCursorElement_hasExtension_Callback";
-  hasExtension_Callback_0_(mthis) => hasExtension_Callback_0(mthis);
+  hasExtension_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "hasExtension", []);
 
-  static hasExtension_Callback_1(mthis, __arg_0) native "SVGCursorElement_hasExtension_Callback";
-  hasExtension_Callback_1_(mthis, __arg_0) => hasExtension_Callback_1(mthis, __arg_0);
+  hasExtension_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "hasExtension", [__arg_0]);
 
-  static hasExtension_Callback_2(mthis, __arg_0, __arg_1) native "SVGCursorElement_hasExtension_Callback";
-  hasExtension_Callback_2_(mthis, __arg_0, __arg_1) => hasExtension_Callback_2(mthis, __arg_0, __arg_1);
+  href_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "href");
 
-  static hasExtension_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGCursorElement_hasExtension_Callback";
-  hasExtension_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => hasExtension_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  requiredExtensions_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "requiredExtensions");
 
-  static href_Getter(mthis) native "SVGCursorElement_href_Getter";
-  href_Getter_(mthis) => href_Getter(mthis);
+  requiredFeatures_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "requiredFeatures");
 
-  static requiredExtensions_Getter(mthis) native "SVGCursorElement_requiredExtensions_Getter";
-  requiredExtensions_Getter_(mthis) => requiredExtensions_Getter(mthis);
+  systemLanguage_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "systemLanguage");
 
-  static requiredFeatures_Getter(mthis) native "SVGCursorElement_requiredFeatures_Getter";
-  requiredFeatures_Getter_(mthis) => requiredFeatures_Getter(mthis);
+  x_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "x");
 
-  static systemLanguage_Getter(mthis) native "SVGCursorElement_systemLanguage_Getter";
-  systemLanguage_Getter_(mthis) => systemLanguage_Getter(mthis);
-
-  static x_Getter(mthis) native "SVGCursorElement_x_Getter";
-  x_Getter_(mthis) => x_Getter(mthis);
-
-  static y_Getter(mthis) native "SVGCursorElement_y_Getter";
-  y_Getter_(mthis) => y_Getter(mthis);
+  y_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "y");
 
 }
 
@@ -19661,753 +10819,518 @@
 class BlinkSVGElement extends BlinkElement {
   static final instance = new BlinkSVGElement();
 
-  static className_Getter(mthis) native "SVGElement_className_Getter";
-  className_Getter_(mthis) => className_Getter(mthis);
+  className_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "className");
 
-  static onabort_Getter(mthis) native "SVGElement_onabort_Getter";
-  onabort_Getter_(mthis) => onabort_Getter(mthis);
+  onabort_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onabort");
 
-  static onabort_Setter(mthis, __arg_0) native "SVGElement_onabort_Setter";
-  onabort_Setter_(mthis, __arg_0) => onabort_Setter(mthis, __arg_0);
+  onabort_Setter_(mthis, __arg_0) => mthis["onabort"] = __arg_0;
 
-  static onautocomplete_Getter(mthis) native "SVGElement_onautocomplete_Getter";
-  onautocomplete_Getter_(mthis) => onautocomplete_Getter(mthis);
+  onautocomplete_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onautocomplete");
 
-  static onautocomplete_Setter(mthis, __arg_0) native "SVGElement_onautocomplete_Setter";
-  onautocomplete_Setter_(mthis, __arg_0) => onautocomplete_Setter(mthis, __arg_0);
+  onautocomplete_Setter_(mthis, __arg_0) => mthis["onautocomplete"] = __arg_0;
 
-  static onautocompleteerror_Getter(mthis) native "SVGElement_onautocompleteerror_Getter";
-  onautocompleteerror_Getter_(mthis) => onautocompleteerror_Getter(mthis);
+  onautocompleteerror_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onautocompleteerror");
 
-  static onautocompleteerror_Setter(mthis, __arg_0) native "SVGElement_onautocompleteerror_Setter";
-  onautocompleteerror_Setter_(mthis, __arg_0) => onautocompleteerror_Setter(mthis, __arg_0);
+  onautocompleteerror_Setter_(mthis, __arg_0) => mthis["onautocompleteerror"] = __arg_0;
 
-  static onblur_Getter(mthis) native "SVGElement_onblur_Getter";
-  onblur_Getter_(mthis) => onblur_Getter(mthis);
+  onblur_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onblur");
 
-  static onblur_Setter(mthis, __arg_0) native "SVGElement_onblur_Setter";
-  onblur_Setter_(mthis, __arg_0) => onblur_Setter(mthis, __arg_0);
+  onblur_Setter_(mthis, __arg_0) => mthis["onblur"] = __arg_0;
 
-  static oncancel_Getter(mthis) native "SVGElement_oncancel_Getter";
-  oncancel_Getter_(mthis) => oncancel_Getter(mthis);
+  oncancel_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "oncancel");
 
-  static oncancel_Setter(mthis, __arg_0) native "SVGElement_oncancel_Setter";
-  oncancel_Setter_(mthis, __arg_0) => oncancel_Setter(mthis, __arg_0);
+  oncancel_Setter_(mthis, __arg_0) => mthis["oncancel"] = __arg_0;
 
-  static oncanplay_Getter(mthis) native "SVGElement_oncanplay_Getter";
-  oncanplay_Getter_(mthis) => oncanplay_Getter(mthis);
+  oncanplay_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "oncanplay");
 
-  static oncanplay_Setter(mthis, __arg_0) native "SVGElement_oncanplay_Setter";
-  oncanplay_Setter_(mthis, __arg_0) => oncanplay_Setter(mthis, __arg_0);
+  oncanplay_Setter_(mthis, __arg_0) => mthis["oncanplay"] = __arg_0;
 
-  static oncanplaythrough_Getter(mthis) native "SVGElement_oncanplaythrough_Getter";
-  oncanplaythrough_Getter_(mthis) => oncanplaythrough_Getter(mthis);
+  oncanplaythrough_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "oncanplaythrough");
 
-  static oncanplaythrough_Setter(mthis, __arg_0) native "SVGElement_oncanplaythrough_Setter";
-  oncanplaythrough_Setter_(mthis, __arg_0) => oncanplaythrough_Setter(mthis, __arg_0);
+  oncanplaythrough_Setter_(mthis, __arg_0) => mthis["oncanplaythrough"] = __arg_0;
 
-  static onchange_Getter(mthis) native "SVGElement_onchange_Getter";
-  onchange_Getter_(mthis) => onchange_Getter(mthis);
+  onchange_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onchange");
 
-  static onchange_Setter(mthis, __arg_0) native "SVGElement_onchange_Setter";
-  onchange_Setter_(mthis, __arg_0) => onchange_Setter(mthis, __arg_0);
+  onchange_Setter_(mthis, __arg_0) => mthis["onchange"] = __arg_0;
 
-  static onclick_Getter(mthis) native "SVGElement_onclick_Getter";
-  onclick_Getter_(mthis) => onclick_Getter(mthis);
+  onclick_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onclick");
 
-  static onclick_Setter(mthis, __arg_0) native "SVGElement_onclick_Setter";
-  onclick_Setter_(mthis, __arg_0) => onclick_Setter(mthis, __arg_0);
+  onclick_Setter_(mthis, __arg_0) => mthis["onclick"] = __arg_0;
 
-  static onclose_Getter(mthis) native "SVGElement_onclose_Getter";
-  onclose_Getter_(mthis) => onclose_Getter(mthis);
+  onclose_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onclose");
 
-  static onclose_Setter(mthis, __arg_0) native "SVGElement_onclose_Setter";
-  onclose_Setter_(mthis, __arg_0) => onclose_Setter(mthis, __arg_0);
+  onclose_Setter_(mthis, __arg_0) => mthis["onclose"] = __arg_0;
 
-  static oncontextmenu_Getter(mthis) native "SVGElement_oncontextmenu_Getter";
-  oncontextmenu_Getter_(mthis) => oncontextmenu_Getter(mthis);
+  oncontextmenu_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "oncontextmenu");
 
-  static oncontextmenu_Setter(mthis, __arg_0) native "SVGElement_oncontextmenu_Setter";
-  oncontextmenu_Setter_(mthis, __arg_0) => oncontextmenu_Setter(mthis, __arg_0);
+  oncontextmenu_Setter_(mthis, __arg_0) => mthis["oncontextmenu"] = __arg_0;
 
-  static oncuechange_Getter(mthis) native "SVGElement_oncuechange_Getter";
-  oncuechange_Getter_(mthis) => oncuechange_Getter(mthis);
+  oncuechange_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "oncuechange");
 
-  static oncuechange_Setter(mthis, __arg_0) native "SVGElement_oncuechange_Setter";
-  oncuechange_Setter_(mthis, __arg_0) => oncuechange_Setter(mthis, __arg_0);
+  oncuechange_Setter_(mthis, __arg_0) => mthis["oncuechange"] = __arg_0;
 
-  static ondblclick_Getter(mthis) native "SVGElement_ondblclick_Getter";
-  ondblclick_Getter_(mthis) => ondblclick_Getter(mthis);
+  ondblclick_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ondblclick");
 
-  static ondblclick_Setter(mthis, __arg_0) native "SVGElement_ondblclick_Setter";
-  ondblclick_Setter_(mthis, __arg_0) => ondblclick_Setter(mthis, __arg_0);
+  ondblclick_Setter_(mthis, __arg_0) => mthis["ondblclick"] = __arg_0;
 
-  static ondrag_Getter(mthis) native "SVGElement_ondrag_Getter";
-  ondrag_Getter_(mthis) => ondrag_Getter(mthis);
+  ondrag_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ondrag");
 
-  static ondrag_Setter(mthis, __arg_0) native "SVGElement_ondrag_Setter";
-  ondrag_Setter_(mthis, __arg_0) => ondrag_Setter(mthis, __arg_0);
+  ondrag_Setter_(mthis, __arg_0) => mthis["ondrag"] = __arg_0;
 
-  static ondragend_Getter(mthis) native "SVGElement_ondragend_Getter";
-  ondragend_Getter_(mthis) => ondragend_Getter(mthis);
+  ondragend_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ondragend");
 
-  static ondragend_Setter(mthis, __arg_0) native "SVGElement_ondragend_Setter";
-  ondragend_Setter_(mthis, __arg_0) => ondragend_Setter(mthis, __arg_0);
+  ondragend_Setter_(mthis, __arg_0) => mthis["ondragend"] = __arg_0;
 
-  static ondragenter_Getter(mthis) native "SVGElement_ondragenter_Getter";
-  ondragenter_Getter_(mthis) => ondragenter_Getter(mthis);
+  ondragenter_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ondragenter");
 
-  static ondragenter_Setter(mthis, __arg_0) native "SVGElement_ondragenter_Setter";
-  ondragenter_Setter_(mthis, __arg_0) => ondragenter_Setter(mthis, __arg_0);
+  ondragenter_Setter_(mthis, __arg_0) => mthis["ondragenter"] = __arg_0;
 
-  static ondragleave_Getter(mthis) native "SVGElement_ondragleave_Getter";
-  ondragleave_Getter_(mthis) => ondragleave_Getter(mthis);
+  ondragleave_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ondragleave");
 
-  static ondragleave_Setter(mthis, __arg_0) native "SVGElement_ondragleave_Setter";
-  ondragleave_Setter_(mthis, __arg_0) => ondragleave_Setter(mthis, __arg_0);
+  ondragleave_Setter_(mthis, __arg_0) => mthis["ondragleave"] = __arg_0;
 
-  static ondragover_Getter(mthis) native "SVGElement_ondragover_Getter";
-  ondragover_Getter_(mthis) => ondragover_Getter(mthis);
+  ondragover_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ondragover");
 
-  static ondragover_Setter(mthis, __arg_0) native "SVGElement_ondragover_Setter";
-  ondragover_Setter_(mthis, __arg_0) => ondragover_Setter(mthis, __arg_0);
+  ondragover_Setter_(mthis, __arg_0) => mthis["ondragover"] = __arg_0;
 
-  static ondragstart_Getter(mthis) native "SVGElement_ondragstart_Getter";
-  ondragstart_Getter_(mthis) => ondragstart_Getter(mthis);
+  ondragstart_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ondragstart");
 
-  static ondragstart_Setter(mthis, __arg_0) native "SVGElement_ondragstart_Setter";
-  ondragstart_Setter_(mthis, __arg_0) => ondragstart_Setter(mthis, __arg_0);
+  ondragstart_Setter_(mthis, __arg_0) => mthis["ondragstart"] = __arg_0;
 
-  static ondrop_Getter(mthis) native "SVGElement_ondrop_Getter";
-  ondrop_Getter_(mthis) => ondrop_Getter(mthis);
+  ondrop_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ondrop");
 
-  static ondrop_Setter(mthis, __arg_0) native "SVGElement_ondrop_Setter";
-  ondrop_Setter_(mthis, __arg_0) => ondrop_Setter(mthis, __arg_0);
+  ondrop_Setter_(mthis, __arg_0) => mthis["ondrop"] = __arg_0;
 
-  static ondurationchange_Getter(mthis) native "SVGElement_ondurationchange_Getter";
-  ondurationchange_Getter_(mthis) => ondurationchange_Getter(mthis);
+  ondurationchange_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ondurationchange");
 
-  static ondurationchange_Setter(mthis, __arg_0) native "SVGElement_ondurationchange_Setter";
-  ondurationchange_Setter_(mthis, __arg_0) => ondurationchange_Setter(mthis, __arg_0);
+  ondurationchange_Setter_(mthis, __arg_0) => mthis["ondurationchange"] = __arg_0;
 
-  static onemptied_Getter(mthis) native "SVGElement_onemptied_Getter";
-  onemptied_Getter_(mthis) => onemptied_Getter(mthis);
+  onemptied_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onemptied");
 
-  static onemptied_Setter(mthis, __arg_0) native "SVGElement_onemptied_Setter";
-  onemptied_Setter_(mthis, __arg_0) => onemptied_Setter(mthis, __arg_0);
+  onemptied_Setter_(mthis, __arg_0) => mthis["onemptied"] = __arg_0;
 
-  static onended_Getter(mthis) native "SVGElement_onended_Getter";
-  onended_Getter_(mthis) => onended_Getter(mthis);
+  onended_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onended");
 
-  static onended_Setter(mthis, __arg_0) native "SVGElement_onended_Setter";
-  onended_Setter_(mthis, __arg_0) => onended_Setter(mthis, __arg_0);
+  onended_Setter_(mthis, __arg_0) => mthis["onended"] = __arg_0;
 
-  static onerror_Getter(mthis) native "SVGElement_onerror_Getter";
-  onerror_Getter_(mthis) => onerror_Getter(mthis);
+  onerror_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onerror");
 
-  static onerror_Setter(mthis, __arg_0) native "SVGElement_onerror_Setter";
-  onerror_Setter_(mthis, __arg_0) => onerror_Setter(mthis, __arg_0);
+  onerror_Setter_(mthis, __arg_0) => mthis["onerror"] = __arg_0;
 
-  static onfocus_Getter(mthis) native "SVGElement_onfocus_Getter";
-  onfocus_Getter_(mthis) => onfocus_Getter(mthis);
+  onfocus_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onfocus");
 
-  static onfocus_Setter(mthis, __arg_0) native "SVGElement_onfocus_Setter";
-  onfocus_Setter_(mthis, __arg_0) => onfocus_Setter(mthis, __arg_0);
+  onfocus_Setter_(mthis, __arg_0) => mthis["onfocus"] = __arg_0;
 
-  static oninput_Getter(mthis) native "SVGElement_oninput_Getter";
-  oninput_Getter_(mthis) => oninput_Getter(mthis);
+  oninput_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "oninput");
 
-  static oninput_Setter(mthis, __arg_0) native "SVGElement_oninput_Setter";
-  oninput_Setter_(mthis, __arg_0) => oninput_Setter(mthis, __arg_0);
+  oninput_Setter_(mthis, __arg_0) => mthis["oninput"] = __arg_0;
 
-  static oninvalid_Getter(mthis) native "SVGElement_oninvalid_Getter";
-  oninvalid_Getter_(mthis) => oninvalid_Getter(mthis);
+  oninvalid_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "oninvalid");
 
-  static oninvalid_Setter(mthis, __arg_0) native "SVGElement_oninvalid_Setter";
-  oninvalid_Setter_(mthis, __arg_0) => oninvalid_Setter(mthis, __arg_0);
+  oninvalid_Setter_(mthis, __arg_0) => mthis["oninvalid"] = __arg_0;
 
-  static onkeydown_Getter(mthis) native "SVGElement_onkeydown_Getter";
-  onkeydown_Getter_(mthis) => onkeydown_Getter(mthis);
+  onkeydown_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onkeydown");
 
-  static onkeydown_Setter(mthis, __arg_0) native "SVGElement_onkeydown_Setter";
-  onkeydown_Setter_(mthis, __arg_0) => onkeydown_Setter(mthis, __arg_0);
+  onkeydown_Setter_(mthis, __arg_0) => mthis["onkeydown"] = __arg_0;
 
-  static onkeypress_Getter(mthis) native "SVGElement_onkeypress_Getter";
-  onkeypress_Getter_(mthis) => onkeypress_Getter(mthis);
+  onkeypress_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onkeypress");
 
-  static onkeypress_Setter(mthis, __arg_0) native "SVGElement_onkeypress_Setter";
-  onkeypress_Setter_(mthis, __arg_0) => onkeypress_Setter(mthis, __arg_0);
+  onkeypress_Setter_(mthis, __arg_0) => mthis["onkeypress"] = __arg_0;
 
-  static onkeyup_Getter(mthis) native "SVGElement_onkeyup_Getter";
-  onkeyup_Getter_(mthis) => onkeyup_Getter(mthis);
+  onkeyup_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onkeyup");
 
-  static onkeyup_Setter(mthis, __arg_0) native "SVGElement_onkeyup_Setter";
-  onkeyup_Setter_(mthis, __arg_0) => onkeyup_Setter(mthis, __arg_0);
+  onkeyup_Setter_(mthis, __arg_0) => mthis["onkeyup"] = __arg_0;
 
-  static onload_Getter(mthis) native "SVGElement_onload_Getter";
-  onload_Getter_(mthis) => onload_Getter(mthis);
+  onload_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onload");
 
-  static onload_Setter(mthis, __arg_0) native "SVGElement_onload_Setter";
-  onload_Setter_(mthis, __arg_0) => onload_Setter(mthis, __arg_0);
+  onload_Setter_(mthis, __arg_0) => mthis["onload"] = __arg_0;
 
-  static onloadeddata_Getter(mthis) native "SVGElement_onloadeddata_Getter";
-  onloadeddata_Getter_(mthis) => onloadeddata_Getter(mthis);
+  onloadeddata_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onloadeddata");
 
-  static onloadeddata_Setter(mthis, __arg_0) native "SVGElement_onloadeddata_Setter";
-  onloadeddata_Setter_(mthis, __arg_0) => onloadeddata_Setter(mthis, __arg_0);
+  onloadeddata_Setter_(mthis, __arg_0) => mthis["onloadeddata"] = __arg_0;
 
-  static onloadedmetadata_Getter(mthis) native "SVGElement_onloadedmetadata_Getter";
-  onloadedmetadata_Getter_(mthis) => onloadedmetadata_Getter(mthis);
+  onloadedmetadata_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onloadedmetadata");
 
-  static onloadedmetadata_Setter(mthis, __arg_0) native "SVGElement_onloadedmetadata_Setter";
-  onloadedmetadata_Setter_(mthis, __arg_0) => onloadedmetadata_Setter(mthis, __arg_0);
+  onloadedmetadata_Setter_(mthis, __arg_0) => mthis["onloadedmetadata"] = __arg_0;
 
-  static onloadstart_Getter(mthis) native "SVGElement_onloadstart_Getter";
-  onloadstart_Getter_(mthis) => onloadstart_Getter(mthis);
+  onloadstart_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onloadstart");
 
-  static onloadstart_Setter(mthis, __arg_0) native "SVGElement_onloadstart_Setter";
-  onloadstart_Setter_(mthis, __arg_0) => onloadstart_Setter(mthis, __arg_0);
+  onloadstart_Setter_(mthis, __arg_0) => mthis["onloadstart"] = __arg_0;
 
-  static onmousedown_Getter(mthis) native "SVGElement_onmousedown_Getter";
-  onmousedown_Getter_(mthis) => onmousedown_Getter(mthis);
+  onmousedown_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onmousedown");
 
-  static onmousedown_Setter(mthis, __arg_0) native "SVGElement_onmousedown_Setter";
-  onmousedown_Setter_(mthis, __arg_0) => onmousedown_Setter(mthis, __arg_0);
+  onmousedown_Setter_(mthis, __arg_0) => mthis["onmousedown"] = __arg_0;
 
-  static onmouseenter_Getter(mthis) native "SVGElement_onmouseenter_Getter";
-  onmouseenter_Getter_(mthis) => onmouseenter_Getter(mthis);
+  onmouseenter_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onmouseenter");
 
-  static onmouseenter_Setter(mthis, __arg_0) native "SVGElement_onmouseenter_Setter";
-  onmouseenter_Setter_(mthis, __arg_0) => onmouseenter_Setter(mthis, __arg_0);
+  onmouseenter_Setter_(mthis, __arg_0) => mthis["onmouseenter"] = __arg_0;
 
-  static onmouseleave_Getter(mthis) native "SVGElement_onmouseleave_Getter";
-  onmouseleave_Getter_(mthis) => onmouseleave_Getter(mthis);
+  onmouseleave_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onmouseleave");
 
-  static onmouseleave_Setter(mthis, __arg_0) native "SVGElement_onmouseleave_Setter";
-  onmouseleave_Setter_(mthis, __arg_0) => onmouseleave_Setter(mthis, __arg_0);
+  onmouseleave_Setter_(mthis, __arg_0) => mthis["onmouseleave"] = __arg_0;
 
-  static onmousemove_Getter(mthis) native "SVGElement_onmousemove_Getter";
-  onmousemove_Getter_(mthis) => onmousemove_Getter(mthis);
+  onmousemove_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onmousemove");
 
-  static onmousemove_Setter(mthis, __arg_0) native "SVGElement_onmousemove_Setter";
-  onmousemove_Setter_(mthis, __arg_0) => onmousemove_Setter(mthis, __arg_0);
+  onmousemove_Setter_(mthis, __arg_0) => mthis["onmousemove"] = __arg_0;
 
-  static onmouseout_Getter(mthis) native "SVGElement_onmouseout_Getter";
-  onmouseout_Getter_(mthis) => onmouseout_Getter(mthis);
+  onmouseout_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onmouseout");
 
-  static onmouseout_Setter(mthis, __arg_0) native "SVGElement_onmouseout_Setter";
-  onmouseout_Setter_(mthis, __arg_0) => onmouseout_Setter(mthis, __arg_0);
+  onmouseout_Setter_(mthis, __arg_0) => mthis["onmouseout"] = __arg_0;
 
-  static onmouseover_Getter(mthis) native "SVGElement_onmouseover_Getter";
-  onmouseover_Getter_(mthis) => onmouseover_Getter(mthis);
+  onmouseover_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onmouseover");
 
-  static onmouseover_Setter(mthis, __arg_0) native "SVGElement_onmouseover_Setter";
-  onmouseover_Setter_(mthis, __arg_0) => onmouseover_Setter(mthis, __arg_0);
+  onmouseover_Setter_(mthis, __arg_0) => mthis["onmouseover"] = __arg_0;
 
-  static onmouseup_Getter(mthis) native "SVGElement_onmouseup_Getter";
-  onmouseup_Getter_(mthis) => onmouseup_Getter(mthis);
+  onmouseup_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onmouseup");
 
-  static onmouseup_Setter(mthis, __arg_0) native "SVGElement_onmouseup_Setter";
-  onmouseup_Setter_(mthis, __arg_0) => onmouseup_Setter(mthis, __arg_0);
+  onmouseup_Setter_(mthis, __arg_0) => mthis["onmouseup"] = __arg_0;
 
-  static onmousewheel_Getter(mthis) native "SVGElement_onmousewheel_Getter";
-  onmousewheel_Getter_(mthis) => onmousewheel_Getter(mthis);
+  onmousewheel_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onmousewheel");
 
-  static onmousewheel_Setter(mthis, __arg_0) native "SVGElement_onmousewheel_Setter";
-  onmousewheel_Setter_(mthis, __arg_0) => onmousewheel_Setter(mthis, __arg_0);
+  onmousewheel_Setter_(mthis, __arg_0) => mthis["onmousewheel"] = __arg_0;
 
-  static onpause_Getter(mthis) native "SVGElement_onpause_Getter";
-  onpause_Getter_(mthis) => onpause_Getter(mthis);
+  onpause_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onpause");
 
-  static onpause_Setter(mthis, __arg_0) native "SVGElement_onpause_Setter";
-  onpause_Setter_(mthis, __arg_0) => onpause_Setter(mthis, __arg_0);
+  onpause_Setter_(mthis, __arg_0) => mthis["onpause"] = __arg_0;
 
-  static onplay_Getter(mthis) native "SVGElement_onplay_Getter";
-  onplay_Getter_(mthis) => onplay_Getter(mthis);
+  onplay_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onplay");
 
-  static onplay_Setter(mthis, __arg_0) native "SVGElement_onplay_Setter";
-  onplay_Setter_(mthis, __arg_0) => onplay_Setter(mthis, __arg_0);
+  onplay_Setter_(mthis, __arg_0) => mthis["onplay"] = __arg_0;
 
-  static onplaying_Getter(mthis) native "SVGElement_onplaying_Getter";
-  onplaying_Getter_(mthis) => onplaying_Getter(mthis);
+  onplaying_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onplaying");
 
-  static onplaying_Setter(mthis, __arg_0) native "SVGElement_onplaying_Setter";
-  onplaying_Setter_(mthis, __arg_0) => onplaying_Setter(mthis, __arg_0);
+  onplaying_Setter_(mthis, __arg_0) => mthis["onplaying"] = __arg_0;
 
-  static onprogress_Getter(mthis) native "SVGElement_onprogress_Getter";
-  onprogress_Getter_(mthis) => onprogress_Getter(mthis);
+  onprogress_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onprogress");
 
-  static onprogress_Setter(mthis, __arg_0) native "SVGElement_onprogress_Setter";
-  onprogress_Setter_(mthis, __arg_0) => onprogress_Setter(mthis, __arg_0);
+  onprogress_Setter_(mthis, __arg_0) => mthis["onprogress"] = __arg_0;
 
-  static onratechange_Getter(mthis) native "SVGElement_onratechange_Getter";
-  onratechange_Getter_(mthis) => onratechange_Getter(mthis);
+  onratechange_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onratechange");
 
-  static onratechange_Setter(mthis, __arg_0) native "SVGElement_onratechange_Setter";
-  onratechange_Setter_(mthis, __arg_0) => onratechange_Setter(mthis, __arg_0);
+  onratechange_Setter_(mthis, __arg_0) => mthis["onratechange"] = __arg_0;
 
-  static onreset_Getter(mthis) native "SVGElement_onreset_Getter";
-  onreset_Getter_(mthis) => onreset_Getter(mthis);
+  onreset_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onreset");
 
-  static onreset_Setter(mthis, __arg_0) native "SVGElement_onreset_Setter";
-  onreset_Setter_(mthis, __arg_0) => onreset_Setter(mthis, __arg_0);
+  onreset_Setter_(mthis, __arg_0) => mthis["onreset"] = __arg_0;
 
-  static onresize_Getter(mthis) native "SVGElement_onresize_Getter";
-  onresize_Getter_(mthis) => onresize_Getter(mthis);
+  onresize_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onresize");
 
-  static onresize_Setter(mthis, __arg_0) native "SVGElement_onresize_Setter";
-  onresize_Setter_(mthis, __arg_0) => onresize_Setter(mthis, __arg_0);
+  onresize_Setter_(mthis, __arg_0) => mthis["onresize"] = __arg_0;
 
-  static onscroll_Getter(mthis) native "SVGElement_onscroll_Getter";
-  onscroll_Getter_(mthis) => onscroll_Getter(mthis);
+  onscroll_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onscroll");
 
-  static onscroll_Setter(mthis, __arg_0) native "SVGElement_onscroll_Setter";
-  onscroll_Setter_(mthis, __arg_0) => onscroll_Setter(mthis, __arg_0);
+  onscroll_Setter_(mthis, __arg_0) => mthis["onscroll"] = __arg_0;
 
-  static onseeked_Getter(mthis) native "SVGElement_onseeked_Getter";
-  onseeked_Getter_(mthis) => onseeked_Getter(mthis);
+  onseeked_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onseeked");
 
-  static onseeked_Setter(mthis, __arg_0) native "SVGElement_onseeked_Setter";
-  onseeked_Setter_(mthis, __arg_0) => onseeked_Setter(mthis, __arg_0);
+  onseeked_Setter_(mthis, __arg_0) => mthis["onseeked"] = __arg_0;
 
-  static onseeking_Getter(mthis) native "SVGElement_onseeking_Getter";
-  onseeking_Getter_(mthis) => onseeking_Getter(mthis);
+  onseeking_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onseeking");
 
-  static onseeking_Setter(mthis, __arg_0) native "SVGElement_onseeking_Setter";
-  onseeking_Setter_(mthis, __arg_0) => onseeking_Setter(mthis, __arg_0);
+  onseeking_Setter_(mthis, __arg_0) => mthis["onseeking"] = __arg_0;
 
-  static onselect_Getter(mthis) native "SVGElement_onselect_Getter";
-  onselect_Getter_(mthis) => onselect_Getter(mthis);
+  onselect_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onselect");
 
-  static onselect_Setter(mthis, __arg_0) native "SVGElement_onselect_Setter";
-  onselect_Setter_(mthis, __arg_0) => onselect_Setter(mthis, __arg_0);
+  onselect_Setter_(mthis, __arg_0) => mthis["onselect"] = __arg_0;
 
-  static onshow_Getter(mthis) native "SVGElement_onshow_Getter";
-  onshow_Getter_(mthis) => onshow_Getter(mthis);
+  onshow_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onshow");
 
-  static onshow_Setter(mthis, __arg_0) native "SVGElement_onshow_Setter";
-  onshow_Setter_(mthis, __arg_0) => onshow_Setter(mthis, __arg_0);
+  onshow_Setter_(mthis, __arg_0) => mthis["onshow"] = __arg_0;
 
-  static onstalled_Getter(mthis) native "SVGElement_onstalled_Getter";
-  onstalled_Getter_(mthis) => onstalled_Getter(mthis);
+  onstalled_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onstalled");
 
-  static onstalled_Setter(mthis, __arg_0) native "SVGElement_onstalled_Setter";
-  onstalled_Setter_(mthis, __arg_0) => onstalled_Setter(mthis, __arg_0);
+  onstalled_Setter_(mthis, __arg_0) => mthis["onstalled"] = __arg_0;
 
-  static onsubmit_Getter(mthis) native "SVGElement_onsubmit_Getter";
-  onsubmit_Getter_(mthis) => onsubmit_Getter(mthis);
+  onsubmit_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onsubmit");
 
-  static onsubmit_Setter(mthis, __arg_0) native "SVGElement_onsubmit_Setter";
-  onsubmit_Setter_(mthis, __arg_0) => onsubmit_Setter(mthis, __arg_0);
+  onsubmit_Setter_(mthis, __arg_0) => mthis["onsubmit"] = __arg_0;
 
-  static onsuspend_Getter(mthis) native "SVGElement_onsuspend_Getter";
-  onsuspend_Getter_(mthis) => onsuspend_Getter(mthis);
+  onsuspend_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onsuspend");
 
-  static onsuspend_Setter(mthis, __arg_0) native "SVGElement_onsuspend_Setter";
-  onsuspend_Setter_(mthis, __arg_0) => onsuspend_Setter(mthis, __arg_0);
+  onsuspend_Setter_(mthis, __arg_0) => mthis["onsuspend"] = __arg_0;
 
-  static ontimeupdate_Getter(mthis) native "SVGElement_ontimeupdate_Getter";
-  ontimeupdate_Getter_(mthis) => ontimeupdate_Getter(mthis);
+  ontimeupdate_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ontimeupdate");
 
-  static ontimeupdate_Setter(mthis, __arg_0) native "SVGElement_ontimeupdate_Setter";
-  ontimeupdate_Setter_(mthis, __arg_0) => ontimeupdate_Setter(mthis, __arg_0);
+  ontimeupdate_Setter_(mthis, __arg_0) => mthis["ontimeupdate"] = __arg_0;
 
-  static ontoggle_Getter(mthis) native "SVGElement_ontoggle_Getter";
-  ontoggle_Getter_(mthis) => ontoggle_Getter(mthis);
+  ontoggle_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ontoggle");
 
-  static ontoggle_Setter(mthis, __arg_0) native "SVGElement_ontoggle_Setter";
-  ontoggle_Setter_(mthis, __arg_0) => ontoggle_Setter(mthis, __arg_0);
+  ontoggle_Setter_(mthis, __arg_0) => mthis["ontoggle"] = __arg_0;
 
-  static onvolumechange_Getter(mthis) native "SVGElement_onvolumechange_Getter";
-  onvolumechange_Getter_(mthis) => onvolumechange_Getter(mthis);
+  onvolumechange_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onvolumechange");
 
-  static onvolumechange_Setter(mthis, __arg_0) native "SVGElement_onvolumechange_Setter";
-  onvolumechange_Setter_(mthis, __arg_0) => onvolumechange_Setter(mthis, __arg_0);
+  onvolumechange_Setter_(mthis, __arg_0) => mthis["onvolumechange"] = __arg_0;
 
-  static onwaiting_Getter(mthis) native "SVGElement_onwaiting_Getter";
-  onwaiting_Getter_(mthis) => onwaiting_Getter(mthis);
+  onwaiting_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onwaiting");
 
-  static onwaiting_Setter(mthis, __arg_0) native "SVGElement_onwaiting_Setter";
-  onwaiting_Setter_(mthis, __arg_0) => onwaiting_Setter(mthis, __arg_0);
+  onwaiting_Setter_(mthis, __arg_0) => mthis["onwaiting"] = __arg_0;
 
-  static ownerSVGElement_Getter(mthis) native "SVGElement_ownerSVGElement_Getter";
-  ownerSVGElement_Getter_(mthis) => ownerSVGElement_Getter(mthis);
+  ownerSVGElement_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ownerSVGElement");
 
-  static style_Getter(mthis) native "SVGElement_style_Getter";
-  style_Getter_(mthis) => style_Getter(mthis);
+  style_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "style");
 
-  static tabIndex_Getter(mthis) native "SVGElement_tabIndex_Getter";
-  tabIndex_Getter_(mthis) => tabIndex_Getter(mthis);
+  tabIndex_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "tabIndex");
 
-  static tabIndex_Setter(mthis, __arg_0) native "SVGElement_tabIndex_Setter";
-  tabIndex_Setter_(mthis, __arg_0) => tabIndex_Setter(mthis, __arg_0);
+  tabIndex_Setter_(mthis, __arg_0) => mthis["tabIndex"] = __arg_0;
 
-  static viewportElement_Getter(mthis) native "SVGElement_viewportElement_Getter";
-  viewportElement_Getter_(mthis) => viewportElement_Getter(mthis);
+  viewportElement_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "viewportElement");
 
-  static xmlbase_Getter(mthis) native "SVGElement_xmlbase_Getter";
-  xmlbase_Getter_(mthis) => xmlbase_Getter(mthis);
+  xmlbase_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "xmlbase");
 
-  static xmlbase_Setter(mthis, __arg_0) native "SVGElement_xmlbase_Setter";
-  xmlbase_Setter_(mthis, __arg_0) => xmlbase_Setter(mthis, __arg_0);
+  xmlbase_Setter_(mthis, __arg_0) => mthis["xmlbase"] = __arg_0;
 
-  static xmllang_Getter(mthis) native "SVGElement_xmllang_Getter";
-  xmllang_Getter_(mthis) => xmllang_Getter(mthis);
+  xmllang_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "xmllang");
 
-  static xmllang_Setter(mthis, __arg_0) native "SVGElement_xmllang_Setter";
-  xmllang_Setter_(mthis, __arg_0) => xmllang_Setter(mthis, __arg_0);
+  xmllang_Setter_(mthis, __arg_0) => mthis["xmllang"] = __arg_0;
 
-  static xmlspace_Getter(mthis) native "SVGElement_xmlspace_Getter";
-  xmlspace_Getter_(mthis) => xmlspace_Getter(mthis);
+  xmlspace_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "xmlspace");
 
-  static xmlspace_Setter(mthis, __arg_0) native "SVGElement_xmlspace_Setter";
-  xmlspace_Setter_(mthis, __arg_0) => xmlspace_Setter(mthis, __arg_0);
+  xmlspace_Setter_(mthis, __arg_0) => mthis["xmlspace"] = __arg_0;
 
 }
 
 class BlinkSVGEllipseElement extends BlinkSVGGeometryElement {
   static final instance = new BlinkSVGEllipseElement();
 
-  static cx_Getter(mthis) native "SVGEllipseElement_cx_Getter";
-  cx_Getter_(mthis) => cx_Getter(mthis);
+  cx_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "cx");
 
-  static cy_Getter(mthis) native "SVGEllipseElement_cy_Getter";
-  cy_Getter_(mthis) => cy_Getter(mthis);
+  cy_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "cy");
 
-  static rx_Getter(mthis) native "SVGEllipseElement_rx_Getter";
-  rx_Getter_(mthis) => rx_Getter(mthis);
+  rx_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "rx");
 
-  static ry_Getter(mthis) native "SVGEllipseElement_ry_Getter";
-  ry_Getter_(mthis) => ry_Getter(mthis);
+  ry_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ry");
 
 }
 
 class BlinkSVGFEBlendElement extends BlinkSVGElement {
   static final instance = new BlinkSVGFEBlendElement();
 
-  static height_Getter(mthis) native "SVGFEBlendElement_height_Getter";
-  height_Getter_(mthis) => height_Getter(mthis);
+  height_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "height");
 
-  static in1_Getter(mthis) native "SVGFEBlendElement_in1_Getter";
-  in1_Getter_(mthis) => in1_Getter(mthis);
+  in1_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "in1");
 
-  static in2_Getter(mthis) native "SVGFEBlendElement_in2_Getter";
-  in2_Getter_(mthis) => in2_Getter(mthis);
+  in2_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "in2");
 
-  static mode_Getter(mthis) native "SVGFEBlendElement_mode_Getter";
-  mode_Getter_(mthis) => mode_Getter(mthis);
+  mode_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "mode");
 
-  static result_Getter(mthis) native "SVGFEBlendElement_result_Getter";
-  result_Getter_(mthis) => result_Getter(mthis);
+  result_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "result");
 
-  static width_Getter(mthis) native "SVGFEBlendElement_width_Getter";
-  width_Getter_(mthis) => width_Getter(mthis);
+  width_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "width");
 
-  static x_Getter(mthis) native "SVGFEBlendElement_x_Getter";
-  x_Getter_(mthis) => x_Getter(mthis);
+  x_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "x");
 
-  static y_Getter(mthis) native "SVGFEBlendElement_y_Getter";
-  y_Getter_(mthis) => y_Getter(mthis);
+  y_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "y");
 
 }
 
 class BlinkSVGFEColorMatrixElement extends BlinkSVGElement {
   static final instance = new BlinkSVGFEColorMatrixElement();
 
-  static height_Getter(mthis) native "SVGFEColorMatrixElement_height_Getter";
-  height_Getter_(mthis) => height_Getter(mthis);
+  height_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "height");
 
-  static in1_Getter(mthis) native "SVGFEColorMatrixElement_in1_Getter";
-  in1_Getter_(mthis) => in1_Getter(mthis);
+  in1_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "in1");
 
-  static result_Getter(mthis) native "SVGFEColorMatrixElement_result_Getter";
-  result_Getter_(mthis) => result_Getter(mthis);
+  result_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "result");
 
-  static type_Getter(mthis) native "SVGFEColorMatrixElement_type_Getter";
-  type_Getter_(mthis) => type_Getter(mthis);
+  type_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "type");
 
-  static values_Getter(mthis) native "SVGFEColorMatrixElement_values_Getter";
-  values_Getter_(mthis) => values_Getter(mthis);
+  values_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "values");
 
-  static width_Getter(mthis) native "SVGFEColorMatrixElement_width_Getter";
-  width_Getter_(mthis) => width_Getter(mthis);
+  width_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "width");
 
-  static x_Getter(mthis) native "SVGFEColorMatrixElement_x_Getter";
-  x_Getter_(mthis) => x_Getter(mthis);
+  x_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "x");
 
-  static y_Getter(mthis) native "SVGFEColorMatrixElement_y_Getter";
-  y_Getter_(mthis) => y_Getter(mthis);
+  y_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "y");
 
 }
 
 class BlinkSVGFEComponentTransferElement extends BlinkSVGElement {
   static final instance = new BlinkSVGFEComponentTransferElement();
 
-  static height_Getter(mthis) native "SVGFEComponentTransferElement_height_Getter";
-  height_Getter_(mthis) => height_Getter(mthis);
+  height_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "height");
 
-  static in1_Getter(mthis) native "SVGFEComponentTransferElement_in1_Getter";
-  in1_Getter_(mthis) => in1_Getter(mthis);
+  in1_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "in1");
 
-  static result_Getter(mthis) native "SVGFEComponentTransferElement_result_Getter";
-  result_Getter_(mthis) => result_Getter(mthis);
+  result_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "result");
 
-  static width_Getter(mthis) native "SVGFEComponentTransferElement_width_Getter";
-  width_Getter_(mthis) => width_Getter(mthis);
+  width_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "width");
 
-  static x_Getter(mthis) native "SVGFEComponentTransferElement_x_Getter";
-  x_Getter_(mthis) => x_Getter(mthis);
+  x_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "x");
 
-  static y_Getter(mthis) native "SVGFEComponentTransferElement_y_Getter";
-  y_Getter_(mthis) => y_Getter(mthis);
+  y_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "y");
 
 }
 
 class BlinkSVGFECompositeElement extends BlinkSVGElement {
   static final instance = new BlinkSVGFECompositeElement();
 
-  static height_Getter(mthis) native "SVGFECompositeElement_height_Getter";
-  height_Getter_(mthis) => height_Getter(mthis);
+  height_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "height");
 
-  static in1_Getter(mthis) native "SVGFECompositeElement_in1_Getter";
-  in1_Getter_(mthis) => in1_Getter(mthis);
+  in1_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "in1");
 
-  static in2_Getter(mthis) native "SVGFECompositeElement_in2_Getter";
-  in2_Getter_(mthis) => in2_Getter(mthis);
+  in2_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "in2");
 
-  static k1_Getter(mthis) native "SVGFECompositeElement_k1_Getter";
-  k1_Getter_(mthis) => k1_Getter(mthis);
+  k1_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "k1");
 
-  static k2_Getter(mthis) native "SVGFECompositeElement_k2_Getter";
-  k2_Getter_(mthis) => k2_Getter(mthis);
+  k2_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "k2");
 
-  static k3_Getter(mthis) native "SVGFECompositeElement_k3_Getter";
-  k3_Getter_(mthis) => k3_Getter(mthis);
+  k3_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "k3");
 
-  static k4_Getter(mthis) native "SVGFECompositeElement_k4_Getter";
-  k4_Getter_(mthis) => k4_Getter(mthis);
+  k4_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "k4");
 
-  static operator_Getter(mthis) native "SVGFECompositeElement_operator_Getter";
-  operator_Getter_(mthis) => operator_Getter(mthis);
+  operator_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "operator");
 
-  static result_Getter(mthis) native "SVGFECompositeElement_result_Getter";
-  result_Getter_(mthis) => result_Getter(mthis);
+  result_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "result");
 
-  static width_Getter(mthis) native "SVGFECompositeElement_width_Getter";
-  width_Getter_(mthis) => width_Getter(mthis);
+  width_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "width");
 
-  static x_Getter(mthis) native "SVGFECompositeElement_x_Getter";
-  x_Getter_(mthis) => x_Getter(mthis);
+  x_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "x");
 
-  static y_Getter(mthis) native "SVGFECompositeElement_y_Getter";
-  y_Getter_(mthis) => y_Getter(mthis);
+  y_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "y");
 
 }
 
 class BlinkSVGFEConvolveMatrixElement extends BlinkSVGElement {
   static final instance = new BlinkSVGFEConvolveMatrixElement();
 
-  static bias_Getter(mthis) native "SVGFEConvolveMatrixElement_bias_Getter";
-  bias_Getter_(mthis) => bias_Getter(mthis);
+  bias_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "bias");
 
-  static divisor_Getter(mthis) native "SVGFEConvolveMatrixElement_divisor_Getter";
-  divisor_Getter_(mthis) => divisor_Getter(mthis);
+  divisor_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "divisor");
 
-  static edgeMode_Getter(mthis) native "SVGFEConvolveMatrixElement_edgeMode_Getter";
-  edgeMode_Getter_(mthis) => edgeMode_Getter(mthis);
+  edgeMode_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "edgeMode");
 
-  static height_Getter(mthis) native "SVGFEConvolveMatrixElement_height_Getter";
-  height_Getter_(mthis) => height_Getter(mthis);
+  height_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "height");
 
-  static in1_Getter(mthis) native "SVGFEConvolveMatrixElement_in1_Getter";
-  in1_Getter_(mthis) => in1_Getter(mthis);
+  in1_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "in1");
 
-  static kernelMatrix_Getter(mthis) native "SVGFEConvolveMatrixElement_kernelMatrix_Getter";
-  kernelMatrix_Getter_(mthis) => kernelMatrix_Getter(mthis);
+  kernelMatrix_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "kernelMatrix");
 
-  static kernelUnitLengthX_Getter(mthis) native "SVGFEConvolveMatrixElement_kernelUnitLengthX_Getter";
-  kernelUnitLengthX_Getter_(mthis) => kernelUnitLengthX_Getter(mthis);
+  kernelUnitLengthX_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "kernelUnitLengthX");
 
-  static kernelUnitLengthY_Getter(mthis) native "SVGFEConvolveMatrixElement_kernelUnitLengthY_Getter";
-  kernelUnitLengthY_Getter_(mthis) => kernelUnitLengthY_Getter(mthis);
+  kernelUnitLengthY_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "kernelUnitLengthY");
 
-  static orderX_Getter(mthis) native "SVGFEConvolveMatrixElement_orderX_Getter";
-  orderX_Getter_(mthis) => orderX_Getter(mthis);
+  orderX_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "orderX");
 
-  static orderY_Getter(mthis) native "SVGFEConvolveMatrixElement_orderY_Getter";
-  orderY_Getter_(mthis) => orderY_Getter(mthis);
+  orderY_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "orderY");
 
-  static preserveAlpha_Getter(mthis) native "SVGFEConvolveMatrixElement_preserveAlpha_Getter";
-  preserveAlpha_Getter_(mthis) => preserveAlpha_Getter(mthis);
+  preserveAlpha_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "preserveAlpha");
 
-  static result_Getter(mthis) native "SVGFEConvolveMatrixElement_result_Getter";
-  result_Getter_(mthis) => result_Getter(mthis);
+  result_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "result");
 
-  static targetX_Getter(mthis) native "SVGFEConvolveMatrixElement_targetX_Getter";
-  targetX_Getter_(mthis) => targetX_Getter(mthis);
+  targetX_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "targetX");
 
-  static targetY_Getter(mthis) native "SVGFEConvolveMatrixElement_targetY_Getter";
-  targetY_Getter_(mthis) => targetY_Getter(mthis);
+  targetY_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "targetY");
 
-  static width_Getter(mthis) native "SVGFEConvolveMatrixElement_width_Getter";
-  width_Getter_(mthis) => width_Getter(mthis);
+  width_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "width");
 
-  static x_Getter(mthis) native "SVGFEConvolveMatrixElement_x_Getter";
-  x_Getter_(mthis) => x_Getter(mthis);
+  x_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "x");
 
-  static y_Getter(mthis) native "SVGFEConvolveMatrixElement_y_Getter";
-  y_Getter_(mthis) => y_Getter(mthis);
+  y_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "y");
 
 }
 
 class BlinkSVGFEDiffuseLightingElement extends BlinkSVGElement {
   static final instance = new BlinkSVGFEDiffuseLightingElement();
 
-  static diffuseConstant_Getter(mthis) native "SVGFEDiffuseLightingElement_diffuseConstant_Getter";
-  diffuseConstant_Getter_(mthis) => diffuseConstant_Getter(mthis);
+  diffuseConstant_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "diffuseConstant");
 
-  static height_Getter(mthis) native "SVGFEDiffuseLightingElement_height_Getter";
-  height_Getter_(mthis) => height_Getter(mthis);
+  height_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "height");
 
-  static in1_Getter(mthis) native "SVGFEDiffuseLightingElement_in1_Getter";
-  in1_Getter_(mthis) => in1_Getter(mthis);
+  in1_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "in1");
 
-  static kernelUnitLengthX_Getter(mthis) native "SVGFEDiffuseLightingElement_kernelUnitLengthX_Getter";
-  kernelUnitLengthX_Getter_(mthis) => kernelUnitLengthX_Getter(mthis);
+  kernelUnitLengthX_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "kernelUnitLengthX");
 
-  static kernelUnitLengthY_Getter(mthis) native "SVGFEDiffuseLightingElement_kernelUnitLengthY_Getter";
-  kernelUnitLengthY_Getter_(mthis) => kernelUnitLengthY_Getter(mthis);
+  kernelUnitLengthY_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "kernelUnitLengthY");
 
-  static result_Getter(mthis) native "SVGFEDiffuseLightingElement_result_Getter";
-  result_Getter_(mthis) => result_Getter(mthis);
+  result_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "result");
 
-  static surfaceScale_Getter(mthis) native "SVGFEDiffuseLightingElement_surfaceScale_Getter";
-  surfaceScale_Getter_(mthis) => surfaceScale_Getter(mthis);
+  surfaceScale_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "surfaceScale");
 
-  static width_Getter(mthis) native "SVGFEDiffuseLightingElement_width_Getter";
-  width_Getter_(mthis) => width_Getter(mthis);
+  width_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "width");
 
-  static x_Getter(mthis) native "SVGFEDiffuseLightingElement_x_Getter";
-  x_Getter_(mthis) => x_Getter(mthis);
+  x_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "x");
 
-  static y_Getter(mthis) native "SVGFEDiffuseLightingElement_y_Getter";
-  y_Getter_(mthis) => y_Getter(mthis);
+  y_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "y");
 
 }
 
 class BlinkSVGFEDisplacementMapElement extends BlinkSVGElement {
   static final instance = new BlinkSVGFEDisplacementMapElement();
 
-  static height_Getter(mthis) native "SVGFEDisplacementMapElement_height_Getter";
-  height_Getter_(mthis) => height_Getter(mthis);
+  height_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "height");
 
-  static in1_Getter(mthis) native "SVGFEDisplacementMapElement_in1_Getter";
-  in1_Getter_(mthis) => in1_Getter(mthis);
+  in1_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "in1");
 
-  static in2_Getter(mthis) native "SVGFEDisplacementMapElement_in2_Getter";
-  in2_Getter_(mthis) => in2_Getter(mthis);
+  in2_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "in2");
 
-  static result_Getter(mthis) native "SVGFEDisplacementMapElement_result_Getter";
-  result_Getter_(mthis) => result_Getter(mthis);
+  result_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "result");
 
-  static scale_Getter(mthis) native "SVGFEDisplacementMapElement_scale_Getter";
-  scale_Getter_(mthis) => scale_Getter(mthis);
+  scale_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "scale");
 
-  static width_Getter(mthis) native "SVGFEDisplacementMapElement_width_Getter";
-  width_Getter_(mthis) => width_Getter(mthis);
+  width_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "width");
 
-  static xChannelSelector_Getter(mthis) native "SVGFEDisplacementMapElement_xChannelSelector_Getter";
-  xChannelSelector_Getter_(mthis) => xChannelSelector_Getter(mthis);
+  xChannelSelector_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "xChannelSelector");
 
-  static x_Getter(mthis) native "SVGFEDisplacementMapElement_x_Getter";
-  x_Getter_(mthis) => x_Getter(mthis);
+  x_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "x");
 
-  static yChannelSelector_Getter(mthis) native "SVGFEDisplacementMapElement_yChannelSelector_Getter";
-  yChannelSelector_Getter_(mthis) => yChannelSelector_Getter(mthis);
+  yChannelSelector_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "yChannelSelector");
 
-  static y_Getter(mthis) native "SVGFEDisplacementMapElement_y_Getter";
-  y_Getter_(mthis) => y_Getter(mthis);
+  y_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "y");
 
 }
 
 class BlinkSVGFEDistantLightElement extends BlinkSVGElement {
   static final instance = new BlinkSVGFEDistantLightElement();
 
-  static azimuth_Getter(mthis) native "SVGFEDistantLightElement_azimuth_Getter";
-  azimuth_Getter_(mthis) => azimuth_Getter(mthis);
+  azimuth_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "azimuth");
 
-  static elevation_Getter(mthis) native "SVGFEDistantLightElement_elevation_Getter";
-  elevation_Getter_(mthis) => elevation_Getter(mthis);
+  elevation_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "elevation");
 
 }
 
 class BlinkSVGFEDropShadowElement extends BlinkSVGElement {
   static final instance = new BlinkSVGFEDropShadowElement();
 
-  static dx_Getter(mthis) native "SVGFEDropShadowElement_dx_Getter";
-  dx_Getter_(mthis) => dx_Getter(mthis);
+  dx_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "dx");
 
-  static dy_Getter(mthis) native "SVGFEDropShadowElement_dy_Getter";
-  dy_Getter_(mthis) => dy_Getter(mthis);
+  dy_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "dy");
 
-  static height_Getter(mthis) native "SVGFEDropShadowElement_height_Getter";
-  height_Getter_(mthis) => height_Getter(mthis);
+  height_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "height");
 
-  static in1_Getter(mthis) native "SVGFEDropShadowElement_in1_Getter";
-  in1_Getter_(mthis) => in1_Getter(mthis);
+  in1_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "in1");
 
-  static result_Getter(mthis) native "SVGFEDropShadowElement_result_Getter";
-  result_Getter_(mthis) => result_Getter(mthis);
+  result_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "result");
 
-  static setStdDeviation_Callback_0(mthis) native "SVGFEDropShadowElement_setStdDeviation_Callback";
-  setStdDeviation_Callback_0_(mthis) => setStdDeviation_Callback_0(mthis);
+  setStdDeviation_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "setStdDeviation", []);
 
-  static setStdDeviation_Callback_1(mthis, __arg_0) native "SVGFEDropShadowElement_setStdDeviation_Callback";
-  setStdDeviation_Callback_1_(mthis, __arg_0) => setStdDeviation_Callback_1(mthis, __arg_0);
+  setStdDeviation_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "setStdDeviation", [__arg_0]);
 
-  static setStdDeviation_Callback_2(mthis, __arg_0, __arg_1) native "SVGFEDropShadowElement_setStdDeviation_Callback";
-  setStdDeviation_Callback_2_(mthis, __arg_0, __arg_1) => setStdDeviation_Callback_2(mthis, __arg_0, __arg_1);
+  setStdDeviation_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "setStdDeviation", [__arg_0, __arg_1]);
 
-  static setStdDeviation_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGFEDropShadowElement_setStdDeviation_Callback";
-  setStdDeviation_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => setStdDeviation_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  stdDeviationX_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "stdDeviationX");
 
-  static setStdDeviation_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "SVGFEDropShadowElement_setStdDeviation_Callback";
-  setStdDeviation_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => setStdDeviation_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  stdDeviationY_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "stdDeviationY");
 
-  static stdDeviationX_Getter(mthis) native "SVGFEDropShadowElement_stdDeviationX_Getter";
-  stdDeviationX_Getter_(mthis) => stdDeviationX_Getter(mthis);
+  width_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "width");
 
-  static stdDeviationY_Getter(mthis) native "SVGFEDropShadowElement_stdDeviationY_Getter";
-  stdDeviationY_Getter_(mthis) => stdDeviationY_Getter(mthis);
+  x_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "x");
 
-  static width_Getter(mthis) native "SVGFEDropShadowElement_width_Getter";
-  width_Getter_(mthis) => width_Getter(mthis);
-
-  static x_Getter(mthis) native "SVGFEDropShadowElement_x_Getter";
-  x_Getter_(mthis) => x_Getter(mthis);
-
-  static y_Getter(mthis) native "SVGFEDropShadowElement_y_Getter";
-  y_Getter_(mthis) => y_Getter(mthis);
+  y_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "y");
 
 }
 
 class BlinkSVGFEFloodElement extends BlinkSVGElement {
   static final instance = new BlinkSVGFEFloodElement();
 
-  static height_Getter(mthis) native "SVGFEFloodElement_height_Getter";
-  height_Getter_(mthis) => height_Getter(mthis);
+  height_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "height");
 
-  static result_Getter(mthis) native "SVGFEFloodElement_result_Getter";
-  result_Getter_(mthis) => result_Getter(mthis);
+  result_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "result");
 
-  static width_Getter(mthis) native "SVGFEFloodElement_width_Getter";
-  width_Getter_(mthis) => width_Getter(mthis);
+  width_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "width");
 
-  static x_Getter(mthis) native "SVGFEFloodElement_x_Getter";
-  x_Getter_(mthis) => x_Getter(mthis);
+  x_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "x");
 
-  static y_Getter(mthis) native "SVGFEFloodElement_y_Getter";
-  y_Getter_(mthis) => y_Getter(mthis);
+  y_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "y");
 
 }
 
@@ -20434,342 +11357,240 @@
 class BlinkSVGFEGaussianBlurElement extends BlinkSVGElement {
   static final instance = new BlinkSVGFEGaussianBlurElement();
 
-  static height_Getter(mthis) native "SVGFEGaussianBlurElement_height_Getter";
-  height_Getter_(mthis) => height_Getter(mthis);
+  height_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "height");
 
-  static in1_Getter(mthis) native "SVGFEGaussianBlurElement_in1_Getter";
-  in1_Getter_(mthis) => in1_Getter(mthis);
+  in1_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "in1");
 
-  static result_Getter(mthis) native "SVGFEGaussianBlurElement_result_Getter";
-  result_Getter_(mthis) => result_Getter(mthis);
+  result_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "result");
 
-  static setStdDeviation_Callback_0(mthis) native "SVGFEGaussianBlurElement_setStdDeviation_Callback";
-  setStdDeviation_Callback_0_(mthis) => setStdDeviation_Callback_0(mthis);
+  setStdDeviation_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "setStdDeviation", []);
 
-  static setStdDeviation_Callback_1(mthis, __arg_0) native "SVGFEGaussianBlurElement_setStdDeviation_Callback";
-  setStdDeviation_Callback_1_(mthis, __arg_0) => setStdDeviation_Callback_1(mthis, __arg_0);
+  setStdDeviation_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "setStdDeviation", [__arg_0]);
 
-  static setStdDeviation_Callback_2(mthis, __arg_0, __arg_1) native "SVGFEGaussianBlurElement_setStdDeviation_Callback";
-  setStdDeviation_Callback_2_(mthis, __arg_0, __arg_1) => setStdDeviation_Callback_2(mthis, __arg_0, __arg_1);
+  setStdDeviation_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "setStdDeviation", [__arg_0, __arg_1]);
 
-  static setStdDeviation_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGFEGaussianBlurElement_setStdDeviation_Callback";
-  setStdDeviation_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => setStdDeviation_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  stdDeviationX_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "stdDeviationX");
 
-  static setStdDeviation_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "SVGFEGaussianBlurElement_setStdDeviation_Callback";
-  setStdDeviation_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => setStdDeviation_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  stdDeviationY_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "stdDeviationY");
 
-  static stdDeviationX_Getter(mthis) native "SVGFEGaussianBlurElement_stdDeviationX_Getter";
-  stdDeviationX_Getter_(mthis) => stdDeviationX_Getter(mthis);
+  width_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "width");
 
-  static stdDeviationY_Getter(mthis) native "SVGFEGaussianBlurElement_stdDeviationY_Getter";
-  stdDeviationY_Getter_(mthis) => stdDeviationY_Getter(mthis);
+  x_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "x");
 
-  static width_Getter(mthis) native "SVGFEGaussianBlurElement_width_Getter";
-  width_Getter_(mthis) => width_Getter(mthis);
-
-  static x_Getter(mthis) native "SVGFEGaussianBlurElement_x_Getter";
-  x_Getter_(mthis) => x_Getter(mthis);
-
-  static y_Getter(mthis) native "SVGFEGaussianBlurElement_y_Getter";
-  y_Getter_(mthis) => y_Getter(mthis);
+  y_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "y");
 
 }
 
 class BlinkSVGFEImageElement extends BlinkSVGElement {
   static final instance = new BlinkSVGFEImageElement();
 
-  static height_Getter(mthis) native "SVGFEImageElement_height_Getter";
-  height_Getter_(mthis) => height_Getter(mthis);
+  height_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "height");
 
-  static href_Getter(mthis) native "SVGFEImageElement_href_Getter";
-  href_Getter_(mthis) => href_Getter(mthis);
+  href_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "href");
 
-  static preserveAspectRatio_Getter(mthis) native "SVGFEImageElement_preserveAspectRatio_Getter";
-  preserveAspectRatio_Getter_(mthis) => preserveAspectRatio_Getter(mthis);
+  preserveAspectRatio_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "preserveAspectRatio");
 
-  static result_Getter(mthis) native "SVGFEImageElement_result_Getter";
-  result_Getter_(mthis) => result_Getter(mthis);
+  result_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "result");
 
-  static width_Getter(mthis) native "SVGFEImageElement_width_Getter";
-  width_Getter_(mthis) => width_Getter(mthis);
+  width_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "width");
 
-  static x_Getter(mthis) native "SVGFEImageElement_x_Getter";
-  x_Getter_(mthis) => x_Getter(mthis);
+  x_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "x");
 
-  static y_Getter(mthis) native "SVGFEImageElement_y_Getter";
-  y_Getter_(mthis) => y_Getter(mthis);
+  y_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "y");
 
 }
 
 class BlinkSVGFEMergeElement extends BlinkSVGElement {
   static final instance = new BlinkSVGFEMergeElement();
 
-  static height_Getter(mthis) native "SVGFEMergeElement_height_Getter";
-  height_Getter_(mthis) => height_Getter(mthis);
+  height_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "height");
 
-  static result_Getter(mthis) native "SVGFEMergeElement_result_Getter";
-  result_Getter_(mthis) => result_Getter(mthis);
+  result_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "result");
 
-  static width_Getter(mthis) native "SVGFEMergeElement_width_Getter";
-  width_Getter_(mthis) => width_Getter(mthis);
+  width_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "width");
 
-  static x_Getter(mthis) native "SVGFEMergeElement_x_Getter";
-  x_Getter_(mthis) => x_Getter(mthis);
+  x_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "x");
 
-  static y_Getter(mthis) native "SVGFEMergeElement_y_Getter";
-  y_Getter_(mthis) => y_Getter(mthis);
+  y_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "y");
 
 }
 
 class BlinkSVGFEMergeNodeElement extends BlinkSVGElement {
   static final instance = new BlinkSVGFEMergeNodeElement();
 
-  static in1_Getter(mthis) native "SVGFEMergeNodeElement_in1_Getter";
-  in1_Getter_(mthis) => in1_Getter(mthis);
+  in1_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "in1");
 
 }
 
 class BlinkSVGFEMorphologyElement extends BlinkSVGElement {
   static final instance = new BlinkSVGFEMorphologyElement();
 
-  static height_Getter(mthis) native "SVGFEMorphologyElement_height_Getter";
-  height_Getter_(mthis) => height_Getter(mthis);
+  height_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "height");
 
-  static in1_Getter(mthis) native "SVGFEMorphologyElement_in1_Getter";
-  in1_Getter_(mthis) => in1_Getter(mthis);
+  in1_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "in1");
 
-  static operator_Getter(mthis) native "SVGFEMorphologyElement_operator_Getter";
-  operator_Getter_(mthis) => operator_Getter(mthis);
+  operator_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "operator");
 
-  static radiusX_Getter(mthis) native "SVGFEMorphologyElement_radiusX_Getter";
-  radiusX_Getter_(mthis) => radiusX_Getter(mthis);
+  radiusX_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "radiusX");
 
-  static radiusY_Getter(mthis) native "SVGFEMorphologyElement_radiusY_Getter";
-  radiusY_Getter_(mthis) => radiusY_Getter(mthis);
+  radiusY_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "radiusY");
 
-  static result_Getter(mthis) native "SVGFEMorphologyElement_result_Getter";
-  result_Getter_(mthis) => result_Getter(mthis);
+  result_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "result");
 
-  static width_Getter(mthis) native "SVGFEMorphologyElement_width_Getter";
-  width_Getter_(mthis) => width_Getter(mthis);
+  width_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "width");
 
-  static x_Getter(mthis) native "SVGFEMorphologyElement_x_Getter";
-  x_Getter_(mthis) => x_Getter(mthis);
+  x_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "x");
 
-  static y_Getter(mthis) native "SVGFEMorphologyElement_y_Getter";
-  y_Getter_(mthis) => y_Getter(mthis);
+  y_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "y");
 
 }
 
 class BlinkSVGFEOffsetElement extends BlinkSVGElement {
   static final instance = new BlinkSVGFEOffsetElement();
 
-  static dx_Getter(mthis) native "SVGFEOffsetElement_dx_Getter";
-  dx_Getter_(mthis) => dx_Getter(mthis);
+  dx_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "dx");
 
-  static dy_Getter(mthis) native "SVGFEOffsetElement_dy_Getter";
-  dy_Getter_(mthis) => dy_Getter(mthis);
+  dy_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "dy");
 
-  static height_Getter(mthis) native "SVGFEOffsetElement_height_Getter";
-  height_Getter_(mthis) => height_Getter(mthis);
+  height_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "height");
 
-  static in1_Getter(mthis) native "SVGFEOffsetElement_in1_Getter";
-  in1_Getter_(mthis) => in1_Getter(mthis);
+  in1_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "in1");
 
-  static result_Getter(mthis) native "SVGFEOffsetElement_result_Getter";
-  result_Getter_(mthis) => result_Getter(mthis);
+  result_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "result");
 
-  static width_Getter(mthis) native "SVGFEOffsetElement_width_Getter";
-  width_Getter_(mthis) => width_Getter(mthis);
+  width_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "width");
 
-  static x_Getter(mthis) native "SVGFEOffsetElement_x_Getter";
-  x_Getter_(mthis) => x_Getter(mthis);
+  x_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "x");
 
-  static y_Getter(mthis) native "SVGFEOffsetElement_y_Getter";
-  y_Getter_(mthis) => y_Getter(mthis);
+  y_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "y");
 
 }
 
 class BlinkSVGFEPointLightElement extends BlinkSVGElement {
   static final instance = new BlinkSVGFEPointLightElement();
 
-  static x_Getter(mthis) native "SVGFEPointLightElement_x_Getter";
-  x_Getter_(mthis) => x_Getter(mthis);
+  x_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "x");
 
-  static y_Getter(mthis) native "SVGFEPointLightElement_y_Getter";
-  y_Getter_(mthis) => y_Getter(mthis);
+  y_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "y");
 
-  static z_Getter(mthis) native "SVGFEPointLightElement_z_Getter";
-  z_Getter_(mthis) => z_Getter(mthis);
+  z_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "z");
 
 }
 
 class BlinkSVGFESpecularLightingElement extends BlinkSVGElement {
   static final instance = new BlinkSVGFESpecularLightingElement();
 
-  static height_Getter(mthis) native "SVGFESpecularLightingElement_height_Getter";
-  height_Getter_(mthis) => height_Getter(mthis);
+  height_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "height");
 
-  static in1_Getter(mthis) native "SVGFESpecularLightingElement_in1_Getter";
-  in1_Getter_(mthis) => in1_Getter(mthis);
+  in1_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "in1");
 
-  static result_Getter(mthis) native "SVGFESpecularLightingElement_result_Getter";
-  result_Getter_(mthis) => result_Getter(mthis);
+  result_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "result");
 
-  static specularConstant_Getter(mthis) native "SVGFESpecularLightingElement_specularConstant_Getter";
-  specularConstant_Getter_(mthis) => specularConstant_Getter(mthis);
+  specularConstant_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "specularConstant");
 
-  static specularExponent_Getter(mthis) native "SVGFESpecularLightingElement_specularExponent_Getter";
-  specularExponent_Getter_(mthis) => specularExponent_Getter(mthis);
+  specularExponent_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "specularExponent");
 
-  static surfaceScale_Getter(mthis) native "SVGFESpecularLightingElement_surfaceScale_Getter";
-  surfaceScale_Getter_(mthis) => surfaceScale_Getter(mthis);
+  surfaceScale_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "surfaceScale");
 
-  static width_Getter(mthis) native "SVGFESpecularLightingElement_width_Getter";
-  width_Getter_(mthis) => width_Getter(mthis);
+  width_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "width");
 
-  static x_Getter(mthis) native "SVGFESpecularLightingElement_x_Getter";
-  x_Getter_(mthis) => x_Getter(mthis);
+  x_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "x");
 
-  static y_Getter(mthis) native "SVGFESpecularLightingElement_y_Getter";
-  y_Getter_(mthis) => y_Getter(mthis);
+  y_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "y");
 
 }
 
 class BlinkSVGFESpotLightElement extends BlinkSVGElement {
   static final instance = new BlinkSVGFESpotLightElement();
 
-  static limitingConeAngle_Getter(mthis) native "SVGFESpotLightElement_limitingConeAngle_Getter";
-  limitingConeAngle_Getter_(mthis) => limitingConeAngle_Getter(mthis);
+  limitingConeAngle_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "limitingConeAngle");
 
-  static pointsAtX_Getter(mthis) native "SVGFESpotLightElement_pointsAtX_Getter";
-  pointsAtX_Getter_(mthis) => pointsAtX_Getter(mthis);
+  pointsAtX_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "pointsAtX");
 
-  static pointsAtY_Getter(mthis) native "SVGFESpotLightElement_pointsAtY_Getter";
-  pointsAtY_Getter_(mthis) => pointsAtY_Getter(mthis);
+  pointsAtY_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "pointsAtY");
 
-  static pointsAtZ_Getter(mthis) native "SVGFESpotLightElement_pointsAtZ_Getter";
-  pointsAtZ_Getter_(mthis) => pointsAtZ_Getter(mthis);
+  pointsAtZ_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "pointsAtZ");
 
-  static specularExponent_Getter(mthis) native "SVGFESpotLightElement_specularExponent_Getter";
-  specularExponent_Getter_(mthis) => specularExponent_Getter(mthis);
+  specularExponent_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "specularExponent");
 
-  static x_Getter(mthis) native "SVGFESpotLightElement_x_Getter";
-  x_Getter_(mthis) => x_Getter(mthis);
+  x_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "x");
 
-  static y_Getter(mthis) native "SVGFESpotLightElement_y_Getter";
-  y_Getter_(mthis) => y_Getter(mthis);
+  y_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "y");
 
-  static z_Getter(mthis) native "SVGFESpotLightElement_z_Getter";
-  z_Getter_(mthis) => z_Getter(mthis);
+  z_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "z");
 
 }
 
 class BlinkSVGFETileElement extends BlinkSVGElement {
   static final instance = new BlinkSVGFETileElement();
 
-  static height_Getter(mthis) native "SVGFETileElement_height_Getter";
-  height_Getter_(mthis) => height_Getter(mthis);
+  height_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "height");
 
-  static in1_Getter(mthis) native "SVGFETileElement_in1_Getter";
-  in1_Getter_(mthis) => in1_Getter(mthis);
+  in1_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "in1");
 
-  static result_Getter(mthis) native "SVGFETileElement_result_Getter";
-  result_Getter_(mthis) => result_Getter(mthis);
+  result_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "result");
 
-  static width_Getter(mthis) native "SVGFETileElement_width_Getter";
-  width_Getter_(mthis) => width_Getter(mthis);
+  width_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "width");
 
-  static x_Getter(mthis) native "SVGFETileElement_x_Getter";
-  x_Getter_(mthis) => x_Getter(mthis);
+  x_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "x");
 
-  static y_Getter(mthis) native "SVGFETileElement_y_Getter";
-  y_Getter_(mthis) => y_Getter(mthis);
+  y_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "y");
 
 }
 
 class BlinkSVGFETurbulenceElement extends BlinkSVGElement {
   static final instance = new BlinkSVGFETurbulenceElement();
 
-  static baseFrequencyX_Getter(mthis) native "SVGFETurbulenceElement_baseFrequencyX_Getter";
-  baseFrequencyX_Getter_(mthis) => baseFrequencyX_Getter(mthis);
+  baseFrequencyX_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "baseFrequencyX");
 
-  static baseFrequencyY_Getter(mthis) native "SVGFETurbulenceElement_baseFrequencyY_Getter";
-  baseFrequencyY_Getter_(mthis) => baseFrequencyY_Getter(mthis);
+  baseFrequencyY_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "baseFrequencyY");
 
-  static height_Getter(mthis) native "SVGFETurbulenceElement_height_Getter";
-  height_Getter_(mthis) => height_Getter(mthis);
+  height_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "height");
 
-  static numOctaves_Getter(mthis) native "SVGFETurbulenceElement_numOctaves_Getter";
-  numOctaves_Getter_(mthis) => numOctaves_Getter(mthis);
+  numOctaves_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "numOctaves");
 
-  static result_Getter(mthis) native "SVGFETurbulenceElement_result_Getter";
-  result_Getter_(mthis) => result_Getter(mthis);
+  result_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "result");
 
-  static seed_Getter(mthis) native "SVGFETurbulenceElement_seed_Getter";
-  seed_Getter_(mthis) => seed_Getter(mthis);
+  seed_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "seed");
 
-  static stitchTiles_Getter(mthis) native "SVGFETurbulenceElement_stitchTiles_Getter";
-  stitchTiles_Getter_(mthis) => stitchTiles_Getter(mthis);
+  stitchTiles_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "stitchTiles");
 
-  static type_Getter(mthis) native "SVGFETurbulenceElement_type_Getter";
-  type_Getter_(mthis) => type_Getter(mthis);
+  type_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "type");
 
-  static width_Getter(mthis) native "SVGFETurbulenceElement_width_Getter";
-  width_Getter_(mthis) => width_Getter(mthis);
+  width_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "width");
 
-  static x_Getter(mthis) native "SVGFETurbulenceElement_x_Getter";
-  x_Getter_(mthis) => x_Getter(mthis);
+  x_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "x");
 
-  static y_Getter(mthis) native "SVGFETurbulenceElement_y_Getter";
-  y_Getter_(mthis) => y_Getter(mthis);
+  y_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "y");
 
 }
 
 class BlinkSVGFilterElement extends BlinkSVGElement {
   static final instance = new BlinkSVGFilterElement();
 
-  static filterResX_Getter(mthis) native "SVGFilterElement_filterResX_Getter";
-  filterResX_Getter_(mthis) => filterResX_Getter(mthis);
+  filterResX_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "filterResX");
 
-  static filterResY_Getter(mthis) native "SVGFilterElement_filterResY_Getter";
-  filterResY_Getter_(mthis) => filterResY_Getter(mthis);
+  filterResY_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "filterResY");
 
-  static filterUnits_Getter(mthis) native "SVGFilterElement_filterUnits_Getter";
-  filterUnits_Getter_(mthis) => filterUnits_Getter(mthis);
+  filterUnits_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "filterUnits");
 
-  static height_Getter(mthis) native "SVGFilterElement_height_Getter";
-  height_Getter_(mthis) => height_Getter(mthis);
+  height_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "height");
 
-  static href_Getter(mthis) native "SVGFilterElement_href_Getter";
-  href_Getter_(mthis) => href_Getter(mthis);
+  href_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "href");
 
-  static primitiveUnits_Getter(mthis) native "SVGFilterElement_primitiveUnits_Getter";
-  primitiveUnits_Getter_(mthis) => primitiveUnits_Getter(mthis);
+  primitiveUnits_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "primitiveUnits");
 
-  static setFilterRes_Callback_0(mthis) native "SVGFilterElement_setFilterRes_Callback";
-  setFilterRes_Callback_0_(mthis) => setFilterRes_Callback_0(mthis);
+  setFilterRes_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "setFilterRes", []);
 
-  static setFilterRes_Callback_1(mthis, __arg_0) native "SVGFilterElement_setFilterRes_Callback";
-  setFilterRes_Callback_1_(mthis, __arg_0) => setFilterRes_Callback_1(mthis, __arg_0);
+  setFilterRes_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "setFilterRes", [__arg_0]);
 
-  static setFilterRes_Callback_2(mthis, __arg_0, __arg_1) native "SVGFilterElement_setFilterRes_Callback";
-  setFilterRes_Callback_2_(mthis, __arg_0, __arg_1) => setFilterRes_Callback_2(mthis, __arg_0, __arg_1);
+  setFilterRes_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "setFilterRes", [__arg_0, __arg_1]);
 
-  static setFilterRes_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGFilterElement_setFilterRes_Callback";
-  setFilterRes_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => setFilterRes_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  width_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "width");
 
-  static setFilterRes_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "SVGFilterElement_setFilterRes_Callback";
-  setFilterRes_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => setFilterRes_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  x_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "x");
 
-  static width_Getter(mthis) native "SVGFilterElement_width_Getter";
-  width_Getter_(mthis) => width_Getter(mthis);
-
-  static x_Getter(mthis) native "SVGFilterElement_x_Getter";
-  x_Getter_(mthis) => x_Getter(mthis);
-
-  static y_Getter(mthis) native "SVGFilterElement_y_Getter";
-  y_Getter_(mthis) => y_Getter(mthis);
+  y_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "y");
 
 }
 
@@ -20806,17 +11627,13 @@
 class BlinkSVGForeignObjectElement extends BlinkSVGGraphicsElement {
   static final instance = new BlinkSVGForeignObjectElement();
 
-  static height_Getter(mthis) native "SVGForeignObjectElement_height_Getter";
-  height_Getter_(mthis) => height_Getter(mthis);
+  height_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "height");
 
-  static width_Getter(mthis) native "SVGForeignObjectElement_width_Getter";
-  width_Getter_(mthis) => width_Getter(mthis);
+  width_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "width");
 
-  static x_Getter(mthis) native "SVGForeignObjectElement_x_Getter";
-  x_Getter_(mthis) => x_Getter(mthis);
+  x_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "x");
 
-  static y_Getter(mthis) native "SVGForeignObjectElement_y_Getter";
-  y_Getter_(mthis) => y_Getter(mthis);
+  y_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "y");
 
 }
 
@@ -20828,29 +11645,13 @@
 class BlinkSVGGeometryElement extends BlinkSVGGraphicsElement {
   static final instance = new BlinkSVGGeometryElement();
 
-  static isPointInFill_Callback_0(mthis) native "SVGGeometryElement_isPointInFill_Callback";
-  isPointInFill_Callback_0_(mthis) => isPointInFill_Callback_0(mthis);
+  isPointInFill_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "isPointInFill", []);
 
-  static isPointInFill_Callback_1(mthis, __arg_0) native "SVGGeometryElement_isPointInFill_Callback";
-  isPointInFill_Callback_1_(mthis, __arg_0) => isPointInFill_Callback_1(mthis, __arg_0);
+  isPointInFill_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "isPointInFill", [__arg_0]);
 
-  static isPointInFill_Callback_2(mthis, __arg_0, __arg_1) native "SVGGeometryElement_isPointInFill_Callback";
-  isPointInFill_Callback_2_(mthis, __arg_0, __arg_1) => isPointInFill_Callback_2(mthis, __arg_0, __arg_1);
+  isPointInStroke_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "isPointInStroke", []);
 
-  static isPointInFill_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGGeometryElement_isPointInFill_Callback";
-  isPointInFill_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => isPointInFill_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static isPointInStroke_Callback_0(mthis) native "SVGGeometryElement_isPointInStroke_Callback";
-  isPointInStroke_Callback_0_(mthis) => isPointInStroke_Callback_0(mthis);
-
-  static isPointInStroke_Callback_1(mthis, __arg_0) native "SVGGeometryElement_isPointInStroke_Callback";
-  isPointInStroke_Callback_1_(mthis, __arg_0) => isPointInStroke_Callback_1(mthis, __arg_0);
-
-  static isPointInStroke_Callback_2(mthis, __arg_0, __arg_1) native "SVGGeometryElement_isPointInStroke_Callback";
-  isPointInStroke_Callback_2_(mthis, __arg_0, __arg_1) => isPointInStroke_Callback_2(mthis, __arg_0, __arg_1);
-
-  static isPointInStroke_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGGeometryElement_isPointInStroke_Callback";
-  isPointInStroke_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => isPointInStroke_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  isPointInStroke_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "isPointInStroke", [__arg_0]);
 
 }
 
@@ -20862,135 +11663,75 @@
 class BlinkSVGGlyphRefElement extends BlinkSVGElement {
   static final instance = new BlinkSVGGlyphRefElement();
 
-  static dx_Getter(mthis) native "SVGGlyphRefElement_dx_Getter";
-  dx_Getter_(mthis) => dx_Getter(mthis);
+  dx_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "dx");
 
-  static dx_Setter(mthis, __arg_0) native "SVGGlyphRefElement_dx_Setter";
-  dx_Setter_(mthis, __arg_0) => dx_Setter(mthis, __arg_0);
+  dx_Setter_(mthis, __arg_0) => mthis["dx"] = __arg_0;
 
-  static dy_Getter(mthis) native "SVGGlyphRefElement_dy_Getter";
-  dy_Getter_(mthis) => dy_Getter(mthis);
+  dy_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "dy");
 
-  static dy_Setter(mthis, __arg_0) native "SVGGlyphRefElement_dy_Setter";
-  dy_Setter_(mthis, __arg_0) => dy_Setter(mthis, __arg_0);
+  dy_Setter_(mthis, __arg_0) => mthis["dy"] = __arg_0;
 
-  static format_Getter(mthis) native "SVGGlyphRefElement_format_Getter";
-  format_Getter_(mthis) => format_Getter(mthis);
+  format_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "format");
 
-  static format_Setter(mthis, __arg_0) native "SVGGlyphRefElement_format_Setter";
-  format_Setter_(mthis, __arg_0) => format_Setter(mthis, __arg_0);
+  format_Setter_(mthis, __arg_0) => mthis["format"] = __arg_0;
 
-  static glyphRef_Getter(mthis) native "SVGGlyphRefElement_glyphRef_Getter";
-  glyphRef_Getter_(mthis) => glyphRef_Getter(mthis);
+  glyphRef_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "glyphRef");
 
-  static glyphRef_Setter(mthis, __arg_0) native "SVGGlyphRefElement_glyphRef_Setter";
-  glyphRef_Setter_(mthis, __arg_0) => glyphRef_Setter(mthis, __arg_0);
+  glyphRef_Setter_(mthis, __arg_0) => mthis["glyphRef"] = __arg_0;
 
-  static href_Getter(mthis) native "SVGGlyphRefElement_href_Getter";
-  href_Getter_(mthis) => href_Getter(mthis);
+  href_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "href");
 
-  static x_Getter(mthis) native "SVGGlyphRefElement_x_Getter";
-  x_Getter_(mthis) => x_Getter(mthis);
+  x_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "x");
 
-  static x_Setter(mthis, __arg_0) native "SVGGlyphRefElement_x_Setter";
-  x_Setter_(mthis, __arg_0) => x_Setter(mthis, __arg_0);
+  x_Setter_(mthis, __arg_0) => mthis["x"] = __arg_0;
 
-  static y_Getter(mthis) native "SVGGlyphRefElement_y_Getter";
-  y_Getter_(mthis) => y_Getter(mthis);
+  y_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "y");
 
-  static y_Setter(mthis, __arg_0) native "SVGGlyphRefElement_y_Setter";
-  y_Setter_(mthis, __arg_0) => y_Setter(mthis, __arg_0);
+  y_Setter_(mthis, __arg_0) => mthis["y"] = __arg_0;
 
 }
 
 class BlinkSVGGradientElement extends BlinkSVGElement {
   static final instance = new BlinkSVGGradientElement();
 
-  static gradientTransform_Getter(mthis) native "SVGGradientElement_gradientTransform_Getter";
-  gradientTransform_Getter_(mthis) => gradientTransform_Getter(mthis);
+  gradientTransform_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "gradientTransform");
 
-  static gradientUnits_Getter(mthis) native "SVGGradientElement_gradientUnits_Getter";
-  gradientUnits_Getter_(mthis) => gradientUnits_Getter(mthis);
+  gradientUnits_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "gradientUnits");
 
-  static href_Getter(mthis) native "SVGGradientElement_href_Getter";
-  href_Getter_(mthis) => href_Getter(mthis);
+  href_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "href");
 
-  static spreadMethod_Getter(mthis) native "SVGGradientElement_spreadMethod_Getter";
-  spreadMethod_Getter_(mthis) => spreadMethod_Getter(mthis);
+  spreadMethod_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "spreadMethod");
 
 }
 
 class BlinkSVGGraphicsElement extends BlinkSVGElement {
   static final instance = new BlinkSVGGraphicsElement();
 
-  static farthestViewportElement_Getter(mthis) native "SVGGraphicsElement_farthestViewportElement_Getter";
-  farthestViewportElement_Getter_(mthis) => farthestViewportElement_Getter(mthis);
+  farthestViewportElement_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "farthestViewportElement");
 
-  static getBBox_Callback_0(mthis) native "SVGGraphicsElement_getBBox_Callback";
-  getBBox_Callback_0_(mthis) => getBBox_Callback_0(mthis);
+  getBBox_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getBBox", []);
 
-  static getBBox_Callback_1(mthis, __arg_0) native "SVGGraphicsElement_getBBox_Callback";
-  getBBox_Callback_1_(mthis, __arg_0) => getBBox_Callback_1(mthis, __arg_0);
+  getCTM_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getCTM", []);
 
-  static getBBox_Callback_2(mthis, __arg_0, __arg_1) native "SVGGraphicsElement_getBBox_Callback";
-  getBBox_Callback_2_(mthis, __arg_0, __arg_1) => getBBox_Callback_2(mthis, __arg_0, __arg_1);
+  getScreenCTM_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getScreenCTM", []);
 
-  static getCTM_Callback_0(mthis) native "SVGGraphicsElement_getCTM_Callback";
-  getCTM_Callback_0_(mthis) => getCTM_Callback_0(mthis);
+  getTransformToElement_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getTransformToElement", []);
 
-  static getCTM_Callback_1(mthis, __arg_0) native "SVGGraphicsElement_getCTM_Callback";
-  getCTM_Callback_1_(mthis, __arg_0) => getCTM_Callback_1(mthis, __arg_0);
+  getTransformToElement_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getTransformToElement", [__arg_0]);
 
-  static getCTM_Callback_2(mthis, __arg_0, __arg_1) native "SVGGraphicsElement_getCTM_Callback";
-  getCTM_Callback_2_(mthis, __arg_0, __arg_1) => getCTM_Callback_2(mthis, __arg_0, __arg_1);
+  hasExtension_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "hasExtension", []);
 
-  static getScreenCTM_Callback_0(mthis) native "SVGGraphicsElement_getScreenCTM_Callback";
-  getScreenCTM_Callback_0_(mthis) => getScreenCTM_Callback_0(mthis);
+  hasExtension_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "hasExtension", [__arg_0]);
 
-  static getScreenCTM_Callback_1(mthis, __arg_0) native "SVGGraphicsElement_getScreenCTM_Callback";
-  getScreenCTM_Callback_1_(mthis, __arg_0) => getScreenCTM_Callback_1(mthis, __arg_0);
+  nearestViewportElement_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "nearestViewportElement");
 
-  static getScreenCTM_Callback_2(mthis, __arg_0, __arg_1) native "SVGGraphicsElement_getScreenCTM_Callback";
-  getScreenCTM_Callback_2_(mthis, __arg_0, __arg_1) => getScreenCTM_Callback_2(mthis, __arg_0, __arg_1);
+  requiredExtensions_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "requiredExtensions");
 
-  static getTransformToElement_Callback_0(mthis) native "SVGGraphicsElement_getTransformToElement_Callback";
-  getTransformToElement_Callback_0_(mthis) => getTransformToElement_Callback_0(mthis);
+  requiredFeatures_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "requiredFeatures");
 
-  static getTransformToElement_Callback_1(mthis, __arg_0) native "SVGGraphicsElement_getTransformToElement_Callback";
-  getTransformToElement_Callback_1_(mthis, __arg_0) => getTransformToElement_Callback_1(mthis, __arg_0);
+  systemLanguage_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "systemLanguage");
 
-  static getTransformToElement_Callback_2(mthis, __arg_0, __arg_1) native "SVGGraphicsElement_getTransformToElement_Callback";
-  getTransformToElement_Callback_2_(mthis, __arg_0, __arg_1) => getTransformToElement_Callback_2(mthis, __arg_0, __arg_1);
-
-  static getTransformToElement_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGGraphicsElement_getTransformToElement_Callback";
-  getTransformToElement_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getTransformToElement_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static hasExtension_Callback_0(mthis) native "SVGGraphicsElement_hasExtension_Callback";
-  hasExtension_Callback_0_(mthis) => hasExtension_Callback_0(mthis);
-
-  static hasExtension_Callback_1(mthis, __arg_0) native "SVGGraphicsElement_hasExtension_Callback";
-  hasExtension_Callback_1_(mthis, __arg_0) => hasExtension_Callback_1(mthis, __arg_0);
-
-  static hasExtension_Callback_2(mthis, __arg_0, __arg_1) native "SVGGraphicsElement_hasExtension_Callback";
-  hasExtension_Callback_2_(mthis, __arg_0, __arg_1) => hasExtension_Callback_2(mthis, __arg_0, __arg_1);
-
-  static hasExtension_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGGraphicsElement_hasExtension_Callback";
-  hasExtension_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => hasExtension_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static nearestViewportElement_Getter(mthis) native "SVGGraphicsElement_nearestViewportElement_Getter";
-  nearestViewportElement_Getter_(mthis) => nearestViewportElement_Getter(mthis);
-
-  static requiredExtensions_Getter(mthis) native "SVGGraphicsElement_requiredExtensions_Getter";
-  requiredExtensions_Getter_(mthis) => requiredExtensions_Getter(mthis);
-
-  static requiredFeatures_Getter(mthis) native "SVGGraphicsElement_requiredFeatures_Getter";
-  requiredFeatures_Getter_(mthis) => requiredFeatures_Getter(mthis);
-
-  static systemLanguage_Getter(mthis) native "SVGGraphicsElement_systemLanguage_Getter";
-  systemLanguage_Getter_(mthis) => systemLanguage_Getter(mthis);
-
-  static transform_Getter(mthis) native "SVGGraphicsElement_transform_Getter";
-  transform_Getter_(mthis) => transform_Getter(mthis);
+  transform_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "transform");
 
 }
 
@@ -21002,492 +11743,251 @@
 class BlinkSVGImageElement extends BlinkSVGGraphicsElement {
   static final instance = new BlinkSVGImageElement();
 
-  static height_Getter(mthis) native "SVGImageElement_height_Getter";
-  height_Getter_(mthis) => height_Getter(mthis);
+  height_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "height");
 
-  static href_Getter(mthis) native "SVGImageElement_href_Getter";
-  href_Getter_(mthis) => href_Getter(mthis);
+  href_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "href");
 
-  static preserveAspectRatio_Getter(mthis) native "SVGImageElement_preserveAspectRatio_Getter";
-  preserveAspectRatio_Getter_(mthis) => preserveAspectRatio_Getter(mthis);
+  preserveAspectRatio_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "preserveAspectRatio");
 
-  static width_Getter(mthis) native "SVGImageElement_width_Getter";
-  width_Getter_(mthis) => width_Getter(mthis);
+  width_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "width");
 
-  static x_Getter(mthis) native "SVGImageElement_x_Getter";
-  x_Getter_(mthis) => x_Getter(mthis);
+  x_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "x");
 
-  static y_Getter(mthis) native "SVGImageElement_y_Getter";
-  y_Getter_(mthis) => y_Getter(mthis);
+  y_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "y");
 
 }
 
 class BlinkSVGLength {
   static final instance = new BlinkSVGLength();
 
-  static convertToSpecifiedUnits_Callback_0(mthis) native "SVGLength_convertToSpecifiedUnits_Callback";
-  convertToSpecifiedUnits_Callback_0_(mthis) => convertToSpecifiedUnits_Callback_0(mthis);
+  convertToSpecifiedUnits_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "convertToSpecifiedUnits", []);
 
-  static convertToSpecifiedUnits_Callback_1(mthis, __arg_0) native "SVGLength_convertToSpecifiedUnits_Callback";
-  convertToSpecifiedUnits_Callback_1_(mthis, __arg_0) => convertToSpecifiedUnits_Callback_1(mthis, __arg_0);
+  convertToSpecifiedUnits_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "convertToSpecifiedUnits", [__arg_0]);
 
-  static convertToSpecifiedUnits_Callback_2(mthis, __arg_0, __arg_1) native "SVGLength_convertToSpecifiedUnits_Callback";
-  convertToSpecifiedUnits_Callback_2_(mthis, __arg_0, __arg_1) => convertToSpecifiedUnits_Callback_2(mthis, __arg_0, __arg_1);
+  newValueSpecifiedUnits_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "newValueSpecifiedUnits", []);
 
-  static convertToSpecifiedUnits_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGLength_convertToSpecifiedUnits_Callback";
-  convertToSpecifiedUnits_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => convertToSpecifiedUnits_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  newValueSpecifiedUnits_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "newValueSpecifiedUnits", [__arg_0]);
 
-  static newValueSpecifiedUnits_Callback_0(mthis) native "SVGLength_newValueSpecifiedUnits_Callback";
-  newValueSpecifiedUnits_Callback_0_(mthis) => newValueSpecifiedUnits_Callback_0(mthis);
+  newValueSpecifiedUnits_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "newValueSpecifiedUnits", [__arg_0, __arg_1]);
 
-  static newValueSpecifiedUnits_Callback_1(mthis, __arg_0) native "SVGLength_newValueSpecifiedUnits_Callback";
-  newValueSpecifiedUnits_Callback_1_(mthis, __arg_0) => newValueSpecifiedUnits_Callback_1(mthis, __arg_0);
+  unitType_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "unitType");
 
-  static newValueSpecifiedUnits_Callback_2(mthis, __arg_0, __arg_1) native "SVGLength_newValueSpecifiedUnits_Callback";
-  newValueSpecifiedUnits_Callback_2_(mthis, __arg_0, __arg_1) => newValueSpecifiedUnits_Callback_2(mthis, __arg_0, __arg_1);
+  valueAsString_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "valueAsString");
 
-  static newValueSpecifiedUnits_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGLength_newValueSpecifiedUnits_Callback";
-  newValueSpecifiedUnits_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => newValueSpecifiedUnits_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  valueAsString_Setter_(mthis, __arg_0) => mthis["valueAsString"] = __arg_0;
 
-  static newValueSpecifiedUnits_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "SVGLength_newValueSpecifiedUnits_Callback";
-  newValueSpecifiedUnits_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => newValueSpecifiedUnits_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  valueInSpecifiedUnits_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "valueInSpecifiedUnits");
 
-  static unitType_Getter(mthis) native "SVGLength_unitType_Getter";
-  unitType_Getter_(mthis) => unitType_Getter(mthis);
+  valueInSpecifiedUnits_Setter_(mthis, __arg_0) => mthis["valueInSpecifiedUnits"] = __arg_0;
 
-  static valueAsString_Getter(mthis) native "SVGLength_valueAsString_Getter";
-  valueAsString_Getter_(mthis) => valueAsString_Getter(mthis);
+  value_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "value");
 
-  static valueAsString_Setter(mthis, __arg_0) native "SVGLength_valueAsString_Setter";
-  valueAsString_Setter_(mthis, __arg_0) => valueAsString_Setter(mthis, __arg_0);
-
-  static valueInSpecifiedUnits_Getter(mthis) native "SVGLength_valueInSpecifiedUnits_Getter";
-  valueInSpecifiedUnits_Getter_(mthis) => valueInSpecifiedUnits_Getter(mthis);
-
-  static valueInSpecifiedUnits_Setter(mthis, __arg_0) native "SVGLength_valueInSpecifiedUnits_Setter";
-  valueInSpecifiedUnits_Setter_(mthis, __arg_0) => valueInSpecifiedUnits_Setter(mthis, __arg_0);
-
-  static value_Getter(mthis) native "SVGLength_value_Getter";
-  value_Getter_(mthis) => value_Getter(mthis);
-
-  static value_Setter(mthis, __arg_0) native "SVGLength_value_Setter";
-  value_Setter_(mthis, __arg_0) => value_Setter(mthis, __arg_0);
+  value_Setter_(mthis, __arg_0) => mthis["value"] = __arg_0;
 
 }
 
 class BlinkSVGLengthList {
   static final instance = new BlinkSVGLengthList();
 
-  static $__getter___Callback_1(mthis, __arg_0) native "SVGLengthList___getter___Callback";
-  $__getter___Callback_1_(mthis, __arg_0) => $__getter___Callback_1(mthis, __arg_0);
+  $__getter___Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "__getter__", [__arg_0]);
 
-  static $__setter___Callback_2(mthis, __arg_0, __arg_1) native "SVGLengthList___setter___Callback";
-  $__setter___Callback_2_(mthis, __arg_0, __arg_1) => $__setter___Callback_2(mthis, __arg_0, __arg_1);
+  $__setter___Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "__setter__", [__arg_0, __arg_1]);
 
-  static appendItem_Callback_0(mthis) native "SVGLengthList_appendItem_Callback";
-  appendItem_Callback_0_(mthis) => appendItem_Callback_0(mthis);
+  appendItem_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "appendItem", []);
 
-  static appendItem_Callback_1(mthis, __arg_0) native "SVGLengthList_appendItem_Callback";
-  appendItem_Callback_1_(mthis, __arg_0) => appendItem_Callback_1(mthis, __arg_0);
+  appendItem_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "appendItem", [__arg_0]);
 
-  static appendItem_Callback_2(mthis, __arg_0, __arg_1) native "SVGLengthList_appendItem_Callback";
-  appendItem_Callback_2_(mthis, __arg_0, __arg_1) => appendItem_Callback_2(mthis, __arg_0, __arg_1);
+  clear_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "clear", []);
 
-  static appendItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGLengthList_appendItem_Callback";
-  appendItem_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => appendItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  getItem_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getItem", []);
 
-  static clear_Callback_0(mthis) native "SVGLengthList_clear_Callback";
-  clear_Callback_0_(mthis) => clear_Callback_0(mthis);
+  getItem_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getItem", [__arg_0]);
 
-  static clear_Callback_1(mthis, __arg_0) native "SVGLengthList_clear_Callback";
-  clear_Callback_1_(mthis, __arg_0) => clear_Callback_1(mthis, __arg_0);
+  initialize_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "initialize", []);
 
-  static clear_Callback_2(mthis, __arg_0, __arg_1) native "SVGLengthList_clear_Callback";
-  clear_Callback_2_(mthis, __arg_0, __arg_1) => clear_Callback_2(mthis, __arg_0, __arg_1);
+  initialize_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "initialize", [__arg_0]);
 
-  static getItem_Callback_0(mthis) native "SVGLengthList_getItem_Callback";
-  getItem_Callback_0_(mthis) => getItem_Callback_0(mthis);
+  insertItemBefore_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "insertItemBefore", []);
 
-  static getItem_Callback_1(mthis, __arg_0) native "SVGLengthList_getItem_Callback";
-  getItem_Callback_1_(mthis, __arg_0) => getItem_Callback_1(mthis, __arg_0);
+  insertItemBefore_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "insertItemBefore", [__arg_0]);
 
-  static getItem_Callback_2(mthis, __arg_0, __arg_1) native "SVGLengthList_getItem_Callback";
-  getItem_Callback_2_(mthis, __arg_0, __arg_1) => getItem_Callback_2(mthis, __arg_0, __arg_1);
+  insertItemBefore_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "insertItemBefore", [__arg_0, __arg_1]);
 
-  static getItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGLengthList_getItem_Callback";
-  getItem_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  length_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "length");
 
-  static initialize_Callback_0(mthis) native "SVGLengthList_initialize_Callback";
-  initialize_Callback_0_(mthis) => initialize_Callback_0(mthis);
+  numberOfItems_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "numberOfItems");
 
-  static initialize_Callback_1(mthis, __arg_0) native "SVGLengthList_initialize_Callback";
-  initialize_Callback_1_(mthis, __arg_0) => initialize_Callback_1(mthis, __arg_0);
+  removeItem_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "removeItem", []);
 
-  static initialize_Callback_2(mthis, __arg_0, __arg_1) native "SVGLengthList_initialize_Callback";
-  initialize_Callback_2_(mthis, __arg_0, __arg_1) => initialize_Callback_2(mthis, __arg_0, __arg_1);
+  removeItem_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "removeItem", [__arg_0]);
 
-  static initialize_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGLengthList_initialize_Callback";
-  initialize_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => initialize_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  replaceItem_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "replaceItem", []);
 
-  static insertItemBefore_Callback_0(mthis) native "SVGLengthList_insertItemBefore_Callback";
-  insertItemBefore_Callback_0_(mthis) => insertItemBefore_Callback_0(mthis);
+  replaceItem_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "replaceItem", [__arg_0]);
 
-  static insertItemBefore_Callback_1(mthis, __arg_0) native "SVGLengthList_insertItemBefore_Callback";
-  insertItemBefore_Callback_1_(mthis, __arg_0) => insertItemBefore_Callback_1(mthis, __arg_0);
-
-  static insertItemBefore_Callback_2(mthis, __arg_0, __arg_1) native "SVGLengthList_insertItemBefore_Callback";
-  insertItemBefore_Callback_2_(mthis, __arg_0, __arg_1) => insertItemBefore_Callback_2(mthis, __arg_0, __arg_1);
-
-  static insertItemBefore_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGLengthList_insertItemBefore_Callback";
-  insertItemBefore_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => insertItemBefore_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static insertItemBefore_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "SVGLengthList_insertItemBefore_Callback";
-  insertItemBefore_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => insertItemBefore_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static length_Getter(mthis) native "SVGLengthList_length_Getter";
-  length_Getter_(mthis) => length_Getter(mthis);
-
-  static numberOfItems_Getter(mthis) native "SVGLengthList_numberOfItems_Getter";
-  numberOfItems_Getter_(mthis) => numberOfItems_Getter(mthis);
-
-  static removeItem_Callback_0(mthis) native "SVGLengthList_removeItem_Callback";
-  removeItem_Callback_0_(mthis) => removeItem_Callback_0(mthis);
-
-  static removeItem_Callback_1(mthis, __arg_0) native "SVGLengthList_removeItem_Callback";
-  removeItem_Callback_1_(mthis, __arg_0) => removeItem_Callback_1(mthis, __arg_0);
-
-  static removeItem_Callback_2(mthis, __arg_0, __arg_1) native "SVGLengthList_removeItem_Callback";
-  removeItem_Callback_2_(mthis, __arg_0, __arg_1) => removeItem_Callback_2(mthis, __arg_0, __arg_1);
-
-  static removeItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGLengthList_removeItem_Callback";
-  removeItem_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => removeItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static replaceItem_Callback_0(mthis) native "SVGLengthList_replaceItem_Callback";
-  replaceItem_Callback_0_(mthis) => replaceItem_Callback_0(mthis);
-
-  static replaceItem_Callback_1(mthis, __arg_0) native "SVGLengthList_replaceItem_Callback";
-  replaceItem_Callback_1_(mthis, __arg_0) => replaceItem_Callback_1(mthis, __arg_0);
-
-  static replaceItem_Callback_2(mthis, __arg_0, __arg_1) native "SVGLengthList_replaceItem_Callback";
-  replaceItem_Callback_2_(mthis, __arg_0, __arg_1) => replaceItem_Callback_2(mthis, __arg_0, __arg_1);
-
-  static replaceItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGLengthList_replaceItem_Callback";
-  replaceItem_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => replaceItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static replaceItem_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "SVGLengthList_replaceItem_Callback";
-  replaceItem_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => replaceItem_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  replaceItem_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "replaceItem", [__arg_0, __arg_1]);
 
 }
 
 class BlinkSVGLineElement extends BlinkSVGGeometryElement {
   static final instance = new BlinkSVGLineElement();
 
-  static x1_Getter(mthis) native "SVGLineElement_x1_Getter";
-  x1_Getter_(mthis) => x1_Getter(mthis);
+  x1_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "x1");
 
-  static x2_Getter(mthis) native "SVGLineElement_x2_Getter";
-  x2_Getter_(mthis) => x2_Getter(mthis);
+  x2_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "x2");
 
-  static y1_Getter(mthis) native "SVGLineElement_y1_Getter";
-  y1_Getter_(mthis) => y1_Getter(mthis);
+  y1_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "y1");
 
-  static y2_Getter(mthis) native "SVGLineElement_y2_Getter";
-  y2_Getter_(mthis) => y2_Getter(mthis);
+  y2_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "y2");
 
 }
 
 class BlinkSVGLinearGradientElement extends BlinkSVGGradientElement {
   static final instance = new BlinkSVGLinearGradientElement();
 
-  static x1_Getter(mthis) native "SVGLinearGradientElement_x1_Getter";
-  x1_Getter_(mthis) => x1_Getter(mthis);
+  x1_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "x1");
 
-  static x2_Getter(mthis) native "SVGLinearGradientElement_x2_Getter";
-  x2_Getter_(mthis) => x2_Getter(mthis);
+  x2_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "x2");
 
-  static y1_Getter(mthis) native "SVGLinearGradientElement_y1_Getter";
-  y1_Getter_(mthis) => y1_Getter(mthis);
+  y1_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "y1");
 
-  static y2_Getter(mthis) native "SVGLinearGradientElement_y2_Getter";
-  y2_Getter_(mthis) => y2_Getter(mthis);
+  y2_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "y2");
 
 }
 
 class BlinkSVGMPathElement extends BlinkSVGElement {
   static final instance = new BlinkSVGMPathElement();
 
-  static href_Getter(mthis) native "SVGMPathElement_href_Getter";
-  href_Getter_(mthis) => href_Getter(mthis);
+  href_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "href");
 
 }
 
 class BlinkSVGMarkerElement extends BlinkSVGElement {
   static final instance = new BlinkSVGMarkerElement();
 
-  static markerHeight_Getter(mthis) native "SVGMarkerElement_markerHeight_Getter";
-  markerHeight_Getter_(mthis) => markerHeight_Getter(mthis);
+  markerHeight_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "markerHeight");
 
-  static markerUnits_Getter(mthis) native "SVGMarkerElement_markerUnits_Getter";
-  markerUnits_Getter_(mthis) => markerUnits_Getter(mthis);
+  markerUnits_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "markerUnits");
 
-  static markerWidth_Getter(mthis) native "SVGMarkerElement_markerWidth_Getter";
-  markerWidth_Getter_(mthis) => markerWidth_Getter(mthis);
+  markerWidth_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "markerWidth");
 
-  static orientAngle_Getter(mthis) native "SVGMarkerElement_orientAngle_Getter";
-  orientAngle_Getter_(mthis) => orientAngle_Getter(mthis);
+  orientAngle_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "orientAngle");
 
-  static orientType_Getter(mthis) native "SVGMarkerElement_orientType_Getter";
-  orientType_Getter_(mthis) => orientType_Getter(mthis);
+  orientType_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "orientType");
 
-  static preserveAspectRatio_Getter(mthis) native "SVGMarkerElement_preserveAspectRatio_Getter";
-  preserveAspectRatio_Getter_(mthis) => preserveAspectRatio_Getter(mthis);
+  preserveAspectRatio_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "preserveAspectRatio");
 
-  static refX_Getter(mthis) native "SVGMarkerElement_refX_Getter";
-  refX_Getter_(mthis) => refX_Getter(mthis);
+  refX_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "refX");
 
-  static refY_Getter(mthis) native "SVGMarkerElement_refY_Getter";
-  refY_Getter_(mthis) => refY_Getter(mthis);
+  refY_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "refY");
 
-  static setOrientToAngle_Callback_0(mthis) native "SVGMarkerElement_setOrientToAngle_Callback";
-  setOrientToAngle_Callback_0_(mthis) => setOrientToAngle_Callback_0(mthis);
+  setOrientToAngle_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "setOrientToAngle", []);
 
-  static setOrientToAngle_Callback_1(mthis, __arg_0) native "SVGMarkerElement_setOrientToAngle_Callback";
-  setOrientToAngle_Callback_1_(mthis, __arg_0) => setOrientToAngle_Callback_1(mthis, __arg_0);
+  setOrientToAngle_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "setOrientToAngle", [__arg_0]);
 
-  static setOrientToAngle_Callback_2(mthis, __arg_0, __arg_1) native "SVGMarkerElement_setOrientToAngle_Callback";
-  setOrientToAngle_Callback_2_(mthis, __arg_0, __arg_1) => setOrientToAngle_Callback_2(mthis, __arg_0, __arg_1);
+  setOrientToAuto_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "setOrientToAuto", []);
 
-  static setOrientToAngle_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGMarkerElement_setOrientToAngle_Callback";
-  setOrientToAngle_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => setOrientToAngle_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static setOrientToAuto_Callback_0(mthis) native "SVGMarkerElement_setOrientToAuto_Callback";
-  setOrientToAuto_Callback_0_(mthis) => setOrientToAuto_Callback_0(mthis);
-
-  static setOrientToAuto_Callback_1(mthis, __arg_0) native "SVGMarkerElement_setOrientToAuto_Callback";
-  setOrientToAuto_Callback_1_(mthis, __arg_0) => setOrientToAuto_Callback_1(mthis, __arg_0);
-
-  static setOrientToAuto_Callback_2(mthis, __arg_0, __arg_1) native "SVGMarkerElement_setOrientToAuto_Callback";
-  setOrientToAuto_Callback_2_(mthis, __arg_0, __arg_1) => setOrientToAuto_Callback_2(mthis, __arg_0, __arg_1);
-
-  static viewBox_Getter(mthis) native "SVGMarkerElement_viewBox_Getter";
-  viewBox_Getter_(mthis) => viewBox_Getter(mthis);
+  viewBox_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "viewBox");
 
 }
 
 class BlinkSVGMaskElement extends BlinkSVGElement {
   static final instance = new BlinkSVGMaskElement();
 
-  static hasExtension_Callback_0(mthis) native "SVGMaskElement_hasExtension_Callback";
-  hasExtension_Callback_0_(mthis) => hasExtension_Callback_0(mthis);
+  hasExtension_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "hasExtension", []);
 
-  static hasExtension_Callback_1(mthis, __arg_0) native "SVGMaskElement_hasExtension_Callback";
-  hasExtension_Callback_1_(mthis, __arg_0) => hasExtension_Callback_1(mthis, __arg_0);
+  hasExtension_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "hasExtension", [__arg_0]);
 
-  static hasExtension_Callback_2(mthis, __arg_0, __arg_1) native "SVGMaskElement_hasExtension_Callback";
-  hasExtension_Callback_2_(mthis, __arg_0, __arg_1) => hasExtension_Callback_2(mthis, __arg_0, __arg_1);
+  height_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "height");
 
-  static hasExtension_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGMaskElement_hasExtension_Callback";
-  hasExtension_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => hasExtension_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  maskContentUnits_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "maskContentUnits");
 
-  static height_Getter(mthis) native "SVGMaskElement_height_Getter";
-  height_Getter_(mthis) => height_Getter(mthis);
+  maskUnits_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "maskUnits");
 
-  static maskContentUnits_Getter(mthis) native "SVGMaskElement_maskContentUnits_Getter";
-  maskContentUnits_Getter_(mthis) => maskContentUnits_Getter(mthis);
+  requiredExtensions_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "requiredExtensions");
 
-  static maskUnits_Getter(mthis) native "SVGMaskElement_maskUnits_Getter";
-  maskUnits_Getter_(mthis) => maskUnits_Getter(mthis);
+  requiredFeatures_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "requiredFeatures");
 
-  static requiredExtensions_Getter(mthis) native "SVGMaskElement_requiredExtensions_Getter";
-  requiredExtensions_Getter_(mthis) => requiredExtensions_Getter(mthis);
+  systemLanguage_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "systemLanguage");
 
-  static requiredFeatures_Getter(mthis) native "SVGMaskElement_requiredFeatures_Getter";
-  requiredFeatures_Getter_(mthis) => requiredFeatures_Getter(mthis);
+  width_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "width");
 
-  static systemLanguage_Getter(mthis) native "SVGMaskElement_systemLanguage_Getter";
-  systemLanguage_Getter_(mthis) => systemLanguage_Getter(mthis);
+  x_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "x");
 
-  static width_Getter(mthis) native "SVGMaskElement_width_Getter";
-  width_Getter_(mthis) => width_Getter(mthis);
-
-  static x_Getter(mthis) native "SVGMaskElement_x_Getter";
-  x_Getter_(mthis) => x_Getter(mthis);
-
-  static y_Getter(mthis) native "SVGMaskElement_y_Getter";
-  y_Getter_(mthis) => y_Getter(mthis);
+  y_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "y");
 
 }
 
 class BlinkSVGMatrix {
   static final instance = new BlinkSVGMatrix();
 
-  static a_Getter(mthis) native "SVGMatrix_a_Getter";
-  a_Getter_(mthis) => a_Getter(mthis);
+  a_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "a");
 
-  static a_Setter(mthis, __arg_0) native "SVGMatrix_a_Setter";
-  a_Setter_(mthis, __arg_0) => a_Setter(mthis, __arg_0);
+  a_Setter_(mthis, __arg_0) => mthis["a"] = __arg_0;
 
-  static b_Getter(mthis) native "SVGMatrix_b_Getter";
-  b_Getter_(mthis) => b_Getter(mthis);
+  b_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "b");
 
-  static b_Setter(mthis, __arg_0) native "SVGMatrix_b_Setter";
-  b_Setter_(mthis, __arg_0) => b_Setter(mthis, __arg_0);
+  b_Setter_(mthis, __arg_0) => mthis["b"] = __arg_0;
 
-  static c_Getter(mthis) native "SVGMatrix_c_Getter";
-  c_Getter_(mthis) => c_Getter(mthis);
+  c_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "c");
 
-  static c_Setter(mthis, __arg_0) native "SVGMatrix_c_Setter";
-  c_Setter_(mthis, __arg_0) => c_Setter(mthis, __arg_0);
+  c_Setter_(mthis, __arg_0) => mthis["c"] = __arg_0;
 
-  static d_Getter(mthis) native "SVGMatrix_d_Getter";
-  d_Getter_(mthis) => d_Getter(mthis);
+  d_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "d");
 
-  static d_Setter(mthis, __arg_0) native "SVGMatrix_d_Setter";
-  d_Setter_(mthis, __arg_0) => d_Setter(mthis, __arg_0);
+  d_Setter_(mthis, __arg_0) => mthis["d"] = __arg_0;
 
-  static e_Getter(mthis) native "SVGMatrix_e_Getter";
-  e_Getter_(mthis) => e_Getter(mthis);
+  e_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "e");
 
-  static e_Setter(mthis, __arg_0) native "SVGMatrix_e_Setter";
-  e_Setter_(mthis, __arg_0) => e_Setter(mthis, __arg_0);
+  e_Setter_(mthis, __arg_0) => mthis["e"] = __arg_0;
 
-  static f_Getter(mthis) native "SVGMatrix_f_Getter";
-  f_Getter_(mthis) => f_Getter(mthis);
+  f_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "f");
 
-  static f_Setter(mthis, __arg_0) native "SVGMatrix_f_Setter";
-  f_Setter_(mthis, __arg_0) => f_Setter(mthis, __arg_0);
+  f_Setter_(mthis, __arg_0) => mthis["f"] = __arg_0;
 
-  static flipX_Callback_0(mthis) native "SVGMatrix_flipX_Callback";
-  flipX_Callback_0_(mthis) => flipX_Callback_0(mthis);
+  flipX_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "flipX", []);
 
-  static flipX_Callback_1(mthis, __arg_0) native "SVGMatrix_flipX_Callback";
-  flipX_Callback_1_(mthis, __arg_0) => flipX_Callback_1(mthis, __arg_0);
+  flipY_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "flipY", []);
 
-  static flipX_Callback_2(mthis, __arg_0, __arg_1) native "SVGMatrix_flipX_Callback";
-  flipX_Callback_2_(mthis, __arg_0, __arg_1) => flipX_Callback_2(mthis, __arg_0, __arg_1);
+  inverse_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "inverse", []);
 
-  static flipY_Callback_0(mthis) native "SVGMatrix_flipY_Callback";
-  flipY_Callback_0_(mthis) => flipY_Callback_0(mthis);
+  multiply_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "multiply", []);
 
-  static flipY_Callback_1(mthis, __arg_0) native "SVGMatrix_flipY_Callback";
-  flipY_Callback_1_(mthis, __arg_0) => flipY_Callback_1(mthis, __arg_0);
+  multiply_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "multiply", [__arg_0]);
 
-  static flipY_Callback_2(mthis, __arg_0, __arg_1) native "SVGMatrix_flipY_Callback";
-  flipY_Callback_2_(mthis, __arg_0, __arg_1) => flipY_Callback_2(mthis, __arg_0, __arg_1);
+  rotateFromVector_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "rotateFromVector", []);
 
-  static inverse_Callback_0(mthis) native "SVGMatrix_inverse_Callback";
-  inverse_Callback_0_(mthis) => inverse_Callback_0(mthis);
+  rotateFromVector_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "rotateFromVector", [__arg_0]);
 
-  static inverse_Callback_1(mthis, __arg_0) native "SVGMatrix_inverse_Callback";
-  inverse_Callback_1_(mthis, __arg_0) => inverse_Callback_1(mthis, __arg_0);
+  rotateFromVector_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "rotateFromVector", [__arg_0, __arg_1]);
 
-  static inverse_Callback_2(mthis, __arg_0, __arg_1) native "SVGMatrix_inverse_Callback";
-  inverse_Callback_2_(mthis, __arg_0, __arg_1) => inverse_Callback_2(mthis, __arg_0, __arg_1);
+  rotate_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "rotate", []);
 
-  static multiply_Callback_0(mthis) native "SVGMatrix_multiply_Callback";
-  multiply_Callback_0_(mthis) => multiply_Callback_0(mthis);
+  rotate_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "rotate", [__arg_0]);
 
-  static multiply_Callback_1(mthis, __arg_0) native "SVGMatrix_multiply_Callback";
-  multiply_Callback_1_(mthis, __arg_0) => multiply_Callback_1(mthis, __arg_0);
+  scaleNonUniform_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "scaleNonUniform", []);
 
-  static multiply_Callback_2(mthis, __arg_0, __arg_1) native "SVGMatrix_multiply_Callback";
-  multiply_Callback_2_(mthis, __arg_0, __arg_1) => multiply_Callback_2(mthis, __arg_0, __arg_1);
+  scaleNonUniform_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "scaleNonUniform", [__arg_0]);
 
-  static multiply_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGMatrix_multiply_Callback";
-  multiply_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => multiply_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  scaleNonUniform_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "scaleNonUniform", [__arg_0, __arg_1]);
 
-  static rotateFromVector_Callback_0(mthis) native "SVGMatrix_rotateFromVector_Callback";
-  rotateFromVector_Callback_0_(mthis) => rotateFromVector_Callback_0(mthis);
+  scale_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "scale", []);
 
-  static rotateFromVector_Callback_1(mthis, __arg_0) native "SVGMatrix_rotateFromVector_Callback";
-  rotateFromVector_Callback_1_(mthis, __arg_0) => rotateFromVector_Callback_1(mthis, __arg_0);
+  scale_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "scale", [__arg_0]);
 
-  static rotateFromVector_Callback_2(mthis, __arg_0, __arg_1) native "SVGMatrix_rotateFromVector_Callback";
-  rotateFromVector_Callback_2_(mthis, __arg_0, __arg_1) => rotateFromVector_Callback_2(mthis, __arg_0, __arg_1);
+  skewX_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "skewX", []);
 
-  static rotateFromVector_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGMatrix_rotateFromVector_Callback";
-  rotateFromVector_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => rotateFromVector_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  skewX_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "skewX", [__arg_0]);
 
-  static rotateFromVector_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "SVGMatrix_rotateFromVector_Callback";
-  rotateFromVector_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => rotateFromVector_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  skewY_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "skewY", []);
 
-  static rotate_Callback_0(mthis) native "SVGMatrix_rotate_Callback";
-  rotate_Callback_0_(mthis) => rotate_Callback_0(mthis);
+  skewY_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "skewY", [__arg_0]);
 
-  static rotate_Callback_1(mthis, __arg_0) native "SVGMatrix_rotate_Callback";
-  rotate_Callback_1_(mthis, __arg_0) => rotate_Callback_1(mthis, __arg_0);
+  translate_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "translate", []);
 
-  static rotate_Callback_2(mthis, __arg_0, __arg_1) native "SVGMatrix_rotate_Callback";
-  rotate_Callback_2_(mthis, __arg_0, __arg_1) => rotate_Callback_2(mthis, __arg_0, __arg_1);
+  translate_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "translate", [__arg_0]);
 
-  static rotate_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGMatrix_rotate_Callback";
-  rotate_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => rotate_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static scaleNonUniform_Callback_0(mthis) native "SVGMatrix_scaleNonUniform_Callback";
-  scaleNonUniform_Callback_0_(mthis) => scaleNonUniform_Callback_0(mthis);
-
-  static scaleNonUniform_Callback_1(mthis, __arg_0) native "SVGMatrix_scaleNonUniform_Callback";
-  scaleNonUniform_Callback_1_(mthis, __arg_0) => scaleNonUniform_Callback_1(mthis, __arg_0);
-
-  static scaleNonUniform_Callback_2(mthis, __arg_0, __arg_1) native "SVGMatrix_scaleNonUniform_Callback";
-  scaleNonUniform_Callback_2_(mthis, __arg_0, __arg_1) => scaleNonUniform_Callback_2(mthis, __arg_0, __arg_1);
-
-  static scaleNonUniform_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGMatrix_scaleNonUniform_Callback";
-  scaleNonUniform_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => scaleNonUniform_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static scaleNonUniform_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "SVGMatrix_scaleNonUniform_Callback";
-  scaleNonUniform_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => scaleNonUniform_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static scale_Callback_0(mthis) native "SVGMatrix_scale_Callback";
-  scale_Callback_0_(mthis) => scale_Callback_0(mthis);
-
-  static scale_Callback_1(mthis, __arg_0) native "SVGMatrix_scale_Callback";
-  scale_Callback_1_(mthis, __arg_0) => scale_Callback_1(mthis, __arg_0);
-
-  static scale_Callback_2(mthis, __arg_0, __arg_1) native "SVGMatrix_scale_Callback";
-  scale_Callback_2_(mthis, __arg_0, __arg_1) => scale_Callback_2(mthis, __arg_0, __arg_1);
-
-  static scale_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGMatrix_scale_Callback";
-  scale_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => scale_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static skewX_Callback_0(mthis) native "SVGMatrix_skewX_Callback";
-  skewX_Callback_0_(mthis) => skewX_Callback_0(mthis);
-
-  static skewX_Callback_1(mthis, __arg_0) native "SVGMatrix_skewX_Callback";
-  skewX_Callback_1_(mthis, __arg_0) => skewX_Callback_1(mthis, __arg_0);
-
-  static skewX_Callback_2(mthis, __arg_0, __arg_1) native "SVGMatrix_skewX_Callback";
-  skewX_Callback_2_(mthis, __arg_0, __arg_1) => skewX_Callback_2(mthis, __arg_0, __arg_1);
-
-  static skewX_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGMatrix_skewX_Callback";
-  skewX_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => skewX_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static skewY_Callback_0(mthis) native "SVGMatrix_skewY_Callback";
-  skewY_Callback_0_(mthis) => skewY_Callback_0(mthis);
-
-  static skewY_Callback_1(mthis, __arg_0) native "SVGMatrix_skewY_Callback";
-  skewY_Callback_1_(mthis, __arg_0) => skewY_Callback_1(mthis, __arg_0);
-
-  static skewY_Callback_2(mthis, __arg_0, __arg_1) native "SVGMatrix_skewY_Callback";
-  skewY_Callback_2_(mthis, __arg_0, __arg_1) => skewY_Callback_2(mthis, __arg_0, __arg_1);
-
-  static skewY_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGMatrix_skewY_Callback";
-  skewY_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => skewY_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static translate_Callback_0(mthis) native "SVGMatrix_translate_Callback";
-  translate_Callback_0_(mthis) => translate_Callback_0(mthis);
-
-  static translate_Callback_1(mthis, __arg_0) native "SVGMatrix_translate_Callback";
-  translate_Callback_1_(mthis, __arg_0) => translate_Callback_1(mthis, __arg_0);
-
-  static translate_Callback_2(mthis, __arg_0, __arg_1) native "SVGMatrix_translate_Callback";
-  translate_Callback_2_(mthis, __arg_0, __arg_1) => translate_Callback_2(mthis, __arg_0, __arg_1);
-
-  static translate_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGMatrix_translate_Callback";
-  translate_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => translate_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static translate_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "SVGMatrix_translate_Callback";
-  translate_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => translate_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  translate_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "translate", [__arg_0, __arg_1]);
 
 }
 
@@ -21504,540 +12004,254 @@
 class BlinkSVGNumber {
   static final instance = new BlinkSVGNumber();
 
-  static value_Getter(mthis) native "SVGNumber_value_Getter";
-  value_Getter_(mthis) => value_Getter(mthis);
+  value_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "value");
 
-  static value_Setter(mthis, __arg_0) native "SVGNumber_value_Setter";
-  value_Setter_(mthis, __arg_0) => value_Setter(mthis, __arg_0);
+  value_Setter_(mthis, __arg_0) => mthis["value"] = __arg_0;
 
 }
 
 class BlinkSVGNumberList {
   static final instance = new BlinkSVGNumberList();
 
-  static $__getter___Callback_1(mthis, __arg_0) native "SVGNumberList___getter___Callback";
-  $__getter___Callback_1_(mthis, __arg_0) => $__getter___Callback_1(mthis, __arg_0);
+  $__getter___Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "__getter__", [__arg_0]);
 
-  static $__setter___Callback_2(mthis, __arg_0, __arg_1) native "SVGNumberList___setter___Callback";
-  $__setter___Callback_2_(mthis, __arg_0, __arg_1) => $__setter___Callback_2(mthis, __arg_0, __arg_1);
+  $__setter___Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "__setter__", [__arg_0, __arg_1]);
 
-  static appendItem_Callback_0(mthis) native "SVGNumberList_appendItem_Callback";
-  appendItem_Callback_0_(mthis) => appendItem_Callback_0(mthis);
+  appendItem_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "appendItem", []);
 
-  static appendItem_Callback_1(mthis, __arg_0) native "SVGNumberList_appendItem_Callback";
-  appendItem_Callback_1_(mthis, __arg_0) => appendItem_Callback_1(mthis, __arg_0);
+  appendItem_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "appendItem", [__arg_0]);
 
-  static appendItem_Callback_2(mthis, __arg_0, __arg_1) native "SVGNumberList_appendItem_Callback";
-  appendItem_Callback_2_(mthis, __arg_0, __arg_1) => appendItem_Callback_2(mthis, __arg_0, __arg_1);
+  clear_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "clear", []);
 
-  static appendItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGNumberList_appendItem_Callback";
-  appendItem_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => appendItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  getItem_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getItem", []);
 
-  static clear_Callback_0(mthis) native "SVGNumberList_clear_Callback";
-  clear_Callback_0_(mthis) => clear_Callback_0(mthis);
+  getItem_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getItem", [__arg_0]);
 
-  static clear_Callback_1(mthis, __arg_0) native "SVGNumberList_clear_Callback";
-  clear_Callback_1_(mthis, __arg_0) => clear_Callback_1(mthis, __arg_0);
+  initialize_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "initialize", []);
 
-  static clear_Callback_2(mthis, __arg_0, __arg_1) native "SVGNumberList_clear_Callback";
-  clear_Callback_2_(mthis, __arg_0, __arg_1) => clear_Callback_2(mthis, __arg_0, __arg_1);
+  initialize_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "initialize", [__arg_0]);
 
-  static getItem_Callback_0(mthis) native "SVGNumberList_getItem_Callback";
-  getItem_Callback_0_(mthis) => getItem_Callback_0(mthis);
+  insertItemBefore_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "insertItemBefore", []);
 
-  static getItem_Callback_1(mthis, __arg_0) native "SVGNumberList_getItem_Callback";
-  getItem_Callback_1_(mthis, __arg_0) => getItem_Callback_1(mthis, __arg_0);
+  insertItemBefore_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "insertItemBefore", [__arg_0]);
 
-  static getItem_Callback_2(mthis, __arg_0, __arg_1) native "SVGNumberList_getItem_Callback";
-  getItem_Callback_2_(mthis, __arg_0, __arg_1) => getItem_Callback_2(mthis, __arg_0, __arg_1);
+  insertItemBefore_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "insertItemBefore", [__arg_0, __arg_1]);
 
-  static getItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGNumberList_getItem_Callback";
-  getItem_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  length_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "length");
 
-  static initialize_Callback_0(mthis) native "SVGNumberList_initialize_Callback";
-  initialize_Callback_0_(mthis) => initialize_Callback_0(mthis);
+  numberOfItems_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "numberOfItems");
 
-  static initialize_Callback_1(mthis, __arg_0) native "SVGNumberList_initialize_Callback";
-  initialize_Callback_1_(mthis, __arg_0) => initialize_Callback_1(mthis, __arg_0);
+  removeItem_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "removeItem", []);
 
-  static initialize_Callback_2(mthis, __arg_0, __arg_1) native "SVGNumberList_initialize_Callback";
-  initialize_Callback_2_(mthis, __arg_0, __arg_1) => initialize_Callback_2(mthis, __arg_0, __arg_1);
+  removeItem_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "removeItem", [__arg_0]);
 
-  static initialize_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGNumberList_initialize_Callback";
-  initialize_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => initialize_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  replaceItem_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "replaceItem", []);
 
-  static insertItemBefore_Callback_0(mthis) native "SVGNumberList_insertItemBefore_Callback";
-  insertItemBefore_Callback_0_(mthis) => insertItemBefore_Callback_0(mthis);
+  replaceItem_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "replaceItem", [__arg_0]);
 
-  static insertItemBefore_Callback_1(mthis, __arg_0) native "SVGNumberList_insertItemBefore_Callback";
-  insertItemBefore_Callback_1_(mthis, __arg_0) => insertItemBefore_Callback_1(mthis, __arg_0);
-
-  static insertItemBefore_Callback_2(mthis, __arg_0, __arg_1) native "SVGNumberList_insertItemBefore_Callback";
-  insertItemBefore_Callback_2_(mthis, __arg_0, __arg_1) => insertItemBefore_Callback_2(mthis, __arg_0, __arg_1);
-
-  static insertItemBefore_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGNumberList_insertItemBefore_Callback";
-  insertItemBefore_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => insertItemBefore_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static insertItemBefore_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "SVGNumberList_insertItemBefore_Callback";
-  insertItemBefore_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => insertItemBefore_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static length_Getter(mthis) native "SVGNumberList_length_Getter";
-  length_Getter_(mthis) => length_Getter(mthis);
-
-  static numberOfItems_Getter(mthis) native "SVGNumberList_numberOfItems_Getter";
-  numberOfItems_Getter_(mthis) => numberOfItems_Getter(mthis);
-
-  static removeItem_Callback_0(mthis) native "SVGNumberList_removeItem_Callback";
-  removeItem_Callback_0_(mthis) => removeItem_Callback_0(mthis);
-
-  static removeItem_Callback_1(mthis, __arg_0) native "SVGNumberList_removeItem_Callback";
-  removeItem_Callback_1_(mthis, __arg_0) => removeItem_Callback_1(mthis, __arg_0);
-
-  static removeItem_Callback_2(mthis, __arg_0, __arg_1) native "SVGNumberList_removeItem_Callback";
-  removeItem_Callback_2_(mthis, __arg_0, __arg_1) => removeItem_Callback_2(mthis, __arg_0, __arg_1);
-
-  static removeItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGNumberList_removeItem_Callback";
-  removeItem_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => removeItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static replaceItem_Callback_0(mthis) native "SVGNumberList_replaceItem_Callback";
-  replaceItem_Callback_0_(mthis) => replaceItem_Callback_0(mthis);
-
-  static replaceItem_Callback_1(mthis, __arg_0) native "SVGNumberList_replaceItem_Callback";
-  replaceItem_Callback_1_(mthis, __arg_0) => replaceItem_Callback_1(mthis, __arg_0);
-
-  static replaceItem_Callback_2(mthis, __arg_0, __arg_1) native "SVGNumberList_replaceItem_Callback";
-  replaceItem_Callback_2_(mthis, __arg_0, __arg_1) => replaceItem_Callback_2(mthis, __arg_0, __arg_1);
-
-  static replaceItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGNumberList_replaceItem_Callback";
-  replaceItem_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => replaceItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static replaceItem_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "SVGNumberList_replaceItem_Callback";
-  replaceItem_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => replaceItem_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  replaceItem_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "replaceItem", [__arg_0, __arg_1]);
 
 }
 
 class BlinkSVGPathElement extends BlinkSVGGeometryElement {
   static final instance = new BlinkSVGPathElement();
 
-  static animatedNormalizedPathSegList_Getter(mthis) native "SVGPathElement_animatedNormalizedPathSegList_Getter";
-  animatedNormalizedPathSegList_Getter_(mthis) => animatedNormalizedPathSegList_Getter(mthis);
+  animatedNormalizedPathSegList_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "animatedNormalizedPathSegList");
 
-  static animatedPathSegList_Getter(mthis) native "SVGPathElement_animatedPathSegList_Getter";
-  animatedPathSegList_Getter_(mthis) => animatedPathSegList_Getter(mthis);
+  animatedPathSegList_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "animatedPathSegList");
 
-  static createSVGPathSegArcAbs_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "SVGPathElement_createSVGPathSegArcAbs_Callback";
-  createSVGPathSegArcAbs_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => createSVGPathSegArcAbs_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  createSVGPathSegArcAbs_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => Blink_JsNative_DomException.callMethod(mthis, "createSVGPathSegArcAbs", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4]);
 
-  static createSVGPathSegArcAbs_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "SVGPathElement_createSVGPathSegArcAbs_Callback";
-  createSVGPathSegArcAbs_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => createSVGPathSegArcAbs_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  createSVGPathSegArcAbs_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => Blink_JsNative_DomException.callMethod(mthis, "createSVGPathSegArcAbs", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5]);
 
-  static createSVGPathSegArcAbs_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) native "SVGPathElement_createSVGPathSegArcAbs_Callback";
-  createSVGPathSegArcAbs_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => createSVGPathSegArcAbs_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6);
+  createSVGPathSegArcAbs_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => Blink_JsNative_DomException.callMethod(mthis, "createSVGPathSegArcAbs", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6]);
 
-  static createSVGPathSegArcAbs_Callback_8(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) native "SVGPathElement_createSVGPathSegArcAbs_Callback";
-  createSVGPathSegArcAbs_Callback_8_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) => createSVGPathSegArcAbs_Callback_8(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7);
+  createSVGPathSegArcRel_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => Blink_JsNative_DomException.callMethod(mthis, "createSVGPathSegArcRel", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4]);
 
-  static createSVGPathSegArcAbs_Callback_9(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8) native "SVGPathElement_createSVGPathSegArcAbs_Callback";
-  createSVGPathSegArcAbs_Callback_9_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8) => createSVGPathSegArcAbs_Callback_9(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8);
+  createSVGPathSegArcRel_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => Blink_JsNative_DomException.callMethod(mthis, "createSVGPathSegArcRel", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5]);
 
-  static createSVGPathSegArcRel_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "SVGPathElement_createSVGPathSegArcRel_Callback";
-  createSVGPathSegArcRel_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => createSVGPathSegArcRel_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  createSVGPathSegArcRel_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => Blink_JsNative_DomException.callMethod(mthis, "createSVGPathSegArcRel", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6]);
 
-  static createSVGPathSegArcRel_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "SVGPathElement_createSVGPathSegArcRel_Callback";
-  createSVGPathSegArcRel_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => createSVGPathSegArcRel_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  createSVGPathSegClosePath_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createSVGPathSegClosePath", []);
 
-  static createSVGPathSegArcRel_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) native "SVGPathElement_createSVGPathSegArcRel_Callback";
-  createSVGPathSegArcRel_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => createSVGPathSegArcRel_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6);
+  createSVGPathSegCurvetoCubicAbs_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "createSVGPathSegCurvetoCubicAbs", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static createSVGPathSegArcRel_Callback_8(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) native "SVGPathElement_createSVGPathSegArcRel_Callback";
-  createSVGPathSegArcRel_Callback_8_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) => createSVGPathSegArcRel_Callback_8(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7);
+  createSVGPathSegCurvetoCubicAbs_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => Blink_JsNative_DomException.callMethod(mthis, "createSVGPathSegCurvetoCubicAbs", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4]);
 
-  static createSVGPathSegArcRel_Callback_9(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8) native "SVGPathElement_createSVGPathSegArcRel_Callback";
-  createSVGPathSegArcRel_Callback_9_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8) => createSVGPathSegArcRel_Callback_9(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8);
+  createSVGPathSegCurvetoCubicAbs_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => Blink_JsNative_DomException.callMethod(mthis, "createSVGPathSegCurvetoCubicAbs", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5]);
 
-  static createSVGPathSegClosePath_Callback_0(mthis) native "SVGPathElement_createSVGPathSegClosePath_Callback";
-  createSVGPathSegClosePath_Callback_0_(mthis) => createSVGPathSegClosePath_Callback_0(mthis);
+  createSVGPathSegCurvetoCubicRel_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "createSVGPathSegCurvetoCubicRel", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static createSVGPathSegClosePath_Callback_1(mthis, __arg_0) native "SVGPathElement_createSVGPathSegClosePath_Callback";
-  createSVGPathSegClosePath_Callback_1_(mthis, __arg_0) => createSVGPathSegClosePath_Callback_1(mthis, __arg_0);
+  createSVGPathSegCurvetoCubicRel_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => Blink_JsNative_DomException.callMethod(mthis, "createSVGPathSegCurvetoCubicRel", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4]);
 
-  static createSVGPathSegClosePath_Callback_2(mthis, __arg_0, __arg_1) native "SVGPathElement_createSVGPathSegClosePath_Callback";
-  createSVGPathSegClosePath_Callback_2_(mthis, __arg_0, __arg_1) => createSVGPathSegClosePath_Callback_2(mthis, __arg_0, __arg_1);
+  createSVGPathSegCurvetoCubicRel_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => Blink_JsNative_DomException.callMethod(mthis, "createSVGPathSegCurvetoCubicRel", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5]);
 
-  static createSVGPathSegCurvetoCubicAbs_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "SVGPathElement_createSVGPathSegCurvetoCubicAbs_Callback";
-  createSVGPathSegCurvetoCubicAbs_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => createSVGPathSegCurvetoCubicAbs_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  createSVGPathSegCurvetoCubicSmoothAbs_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "createSVGPathSegCurvetoCubicSmoothAbs", [__arg_0, __arg_1]);
 
-  static createSVGPathSegCurvetoCubicAbs_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "SVGPathElement_createSVGPathSegCurvetoCubicAbs_Callback";
-  createSVGPathSegCurvetoCubicAbs_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => createSVGPathSegCurvetoCubicAbs_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  createSVGPathSegCurvetoCubicSmoothAbs_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "createSVGPathSegCurvetoCubicSmoothAbs", [__arg_0, __arg_1, __arg_2]);
 
-  static createSVGPathSegCurvetoCubicAbs_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "SVGPathElement_createSVGPathSegCurvetoCubicAbs_Callback";
-  createSVGPathSegCurvetoCubicAbs_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => createSVGPathSegCurvetoCubicAbs_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  createSVGPathSegCurvetoCubicSmoothAbs_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "createSVGPathSegCurvetoCubicSmoothAbs", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static createSVGPathSegCurvetoCubicAbs_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) native "SVGPathElement_createSVGPathSegCurvetoCubicAbs_Callback";
-  createSVGPathSegCurvetoCubicAbs_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => createSVGPathSegCurvetoCubicAbs_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6);
+  createSVGPathSegCurvetoCubicSmoothRel_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "createSVGPathSegCurvetoCubicSmoothRel", [__arg_0, __arg_1]);
 
-  static createSVGPathSegCurvetoCubicAbs_Callback_8(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) native "SVGPathElement_createSVGPathSegCurvetoCubicAbs_Callback";
-  createSVGPathSegCurvetoCubicAbs_Callback_8_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) => createSVGPathSegCurvetoCubicAbs_Callback_8(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7);
+  createSVGPathSegCurvetoCubicSmoothRel_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "createSVGPathSegCurvetoCubicSmoothRel", [__arg_0, __arg_1, __arg_2]);
 
-  static createSVGPathSegCurvetoCubicRel_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "SVGPathElement_createSVGPathSegCurvetoCubicRel_Callback";
-  createSVGPathSegCurvetoCubicRel_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => createSVGPathSegCurvetoCubicRel_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  createSVGPathSegCurvetoCubicSmoothRel_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "createSVGPathSegCurvetoCubicSmoothRel", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static createSVGPathSegCurvetoCubicRel_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "SVGPathElement_createSVGPathSegCurvetoCubicRel_Callback";
-  createSVGPathSegCurvetoCubicRel_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => createSVGPathSegCurvetoCubicRel_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  createSVGPathSegCurvetoQuadraticAbs_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "createSVGPathSegCurvetoQuadraticAbs", [__arg_0, __arg_1]);
 
-  static createSVGPathSegCurvetoCubicRel_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "SVGPathElement_createSVGPathSegCurvetoCubicRel_Callback";
-  createSVGPathSegCurvetoCubicRel_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => createSVGPathSegCurvetoCubicRel_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  createSVGPathSegCurvetoQuadraticAbs_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "createSVGPathSegCurvetoQuadraticAbs", [__arg_0, __arg_1, __arg_2]);
 
-  static createSVGPathSegCurvetoCubicRel_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) native "SVGPathElement_createSVGPathSegCurvetoCubicRel_Callback";
-  createSVGPathSegCurvetoCubicRel_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => createSVGPathSegCurvetoCubicRel_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6);
+  createSVGPathSegCurvetoQuadraticAbs_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "createSVGPathSegCurvetoQuadraticAbs", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static createSVGPathSegCurvetoCubicRel_Callback_8(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) native "SVGPathElement_createSVGPathSegCurvetoCubicRel_Callback";
-  createSVGPathSegCurvetoCubicRel_Callback_8_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) => createSVGPathSegCurvetoCubicRel_Callback_8(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7);
+  createSVGPathSegCurvetoQuadraticRel_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "createSVGPathSegCurvetoQuadraticRel", [__arg_0, __arg_1]);
 
-  static createSVGPathSegCurvetoCubicSmoothAbs_Callback_2(mthis, __arg_0, __arg_1) native "SVGPathElement_createSVGPathSegCurvetoCubicSmoothAbs_Callback";
-  createSVGPathSegCurvetoCubicSmoothAbs_Callback_2_(mthis, __arg_0, __arg_1) => createSVGPathSegCurvetoCubicSmoothAbs_Callback_2(mthis, __arg_0, __arg_1);
+  createSVGPathSegCurvetoQuadraticRel_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "createSVGPathSegCurvetoQuadraticRel", [__arg_0, __arg_1, __arg_2]);
 
-  static createSVGPathSegCurvetoCubicSmoothAbs_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGPathElement_createSVGPathSegCurvetoCubicSmoothAbs_Callback";
-  createSVGPathSegCurvetoCubicSmoothAbs_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => createSVGPathSegCurvetoCubicSmoothAbs_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  createSVGPathSegCurvetoQuadraticRel_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "createSVGPathSegCurvetoQuadraticRel", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static createSVGPathSegCurvetoCubicSmoothAbs_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "SVGPathElement_createSVGPathSegCurvetoCubicSmoothAbs_Callback";
-  createSVGPathSegCurvetoCubicSmoothAbs_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => createSVGPathSegCurvetoCubicSmoothAbs_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  createSVGPathSegCurvetoQuadraticSmoothAbs_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createSVGPathSegCurvetoQuadraticSmoothAbs", []);
 
-  static createSVGPathSegCurvetoCubicSmoothAbs_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "SVGPathElement_createSVGPathSegCurvetoCubicSmoothAbs_Callback";
-  createSVGPathSegCurvetoCubicSmoothAbs_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => createSVGPathSegCurvetoCubicSmoothAbs_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  createSVGPathSegCurvetoQuadraticSmoothAbs_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "createSVGPathSegCurvetoQuadraticSmoothAbs", [__arg_0]);
 
-  static createSVGPathSegCurvetoCubicSmoothAbs_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "SVGPathElement_createSVGPathSegCurvetoCubicSmoothAbs_Callback";
-  createSVGPathSegCurvetoCubicSmoothAbs_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => createSVGPathSegCurvetoCubicSmoothAbs_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  createSVGPathSegCurvetoQuadraticSmoothAbs_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "createSVGPathSegCurvetoQuadraticSmoothAbs", [__arg_0, __arg_1]);
 
-  static createSVGPathSegCurvetoCubicSmoothRel_Callback_2(mthis, __arg_0, __arg_1) native "SVGPathElement_createSVGPathSegCurvetoCubicSmoothRel_Callback";
-  createSVGPathSegCurvetoCubicSmoothRel_Callback_2_(mthis, __arg_0, __arg_1) => createSVGPathSegCurvetoCubicSmoothRel_Callback_2(mthis, __arg_0, __arg_1);
+  createSVGPathSegCurvetoQuadraticSmoothRel_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createSVGPathSegCurvetoQuadraticSmoothRel", []);
 
-  static createSVGPathSegCurvetoCubicSmoothRel_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGPathElement_createSVGPathSegCurvetoCubicSmoothRel_Callback";
-  createSVGPathSegCurvetoCubicSmoothRel_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => createSVGPathSegCurvetoCubicSmoothRel_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  createSVGPathSegCurvetoQuadraticSmoothRel_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "createSVGPathSegCurvetoQuadraticSmoothRel", [__arg_0]);
 
-  static createSVGPathSegCurvetoCubicSmoothRel_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "SVGPathElement_createSVGPathSegCurvetoCubicSmoothRel_Callback";
-  createSVGPathSegCurvetoCubicSmoothRel_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => createSVGPathSegCurvetoCubicSmoothRel_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  createSVGPathSegCurvetoQuadraticSmoothRel_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "createSVGPathSegCurvetoQuadraticSmoothRel", [__arg_0, __arg_1]);
 
-  static createSVGPathSegCurvetoCubicSmoothRel_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "SVGPathElement_createSVGPathSegCurvetoCubicSmoothRel_Callback";
-  createSVGPathSegCurvetoCubicSmoothRel_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => createSVGPathSegCurvetoCubicSmoothRel_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  createSVGPathSegLinetoAbs_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createSVGPathSegLinetoAbs", []);
 
-  static createSVGPathSegCurvetoCubicSmoothRel_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "SVGPathElement_createSVGPathSegCurvetoCubicSmoothRel_Callback";
-  createSVGPathSegCurvetoCubicSmoothRel_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => createSVGPathSegCurvetoCubicSmoothRel_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  createSVGPathSegLinetoAbs_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "createSVGPathSegLinetoAbs", [__arg_0]);
 
-  static createSVGPathSegCurvetoQuadraticAbs_Callback_2(mthis, __arg_0, __arg_1) native "SVGPathElement_createSVGPathSegCurvetoQuadraticAbs_Callback";
-  createSVGPathSegCurvetoQuadraticAbs_Callback_2_(mthis, __arg_0, __arg_1) => createSVGPathSegCurvetoQuadraticAbs_Callback_2(mthis, __arg_0, __arg_1);
+  createSVGPathSegLinetoAbs_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "createSVGPathSegLinetoAbs", [__arg_0, __arg_1]);
 
-  static createSVGPathSegCurvetoQuadraticAbs_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGPathElement_createSVGPathSegCurvetoQuadraticAbs_Callback";
-  createSVGPathSegCurvetoQuadraticAbs_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => createSVGPathSegCurvetoQuadraticAbs_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  createSVGPathSegLinetoHorizontalAbs_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createSVGPathSegLinetoHorizontalAbs", []);
 
-  static createSVGPathSegCurvetoQuadraticAbs_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "SVGPathElement_createSVGPathSegCurvetoQuadraticAbs_Callback";
-  createSVGPathSegCurvetoQuadraticAbs_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => createSVGPathSegCurvetoQuadraticAbs_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  createSVGPathSegLinetoHorizontalAbs_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "createSVGPathSegLinetoHorizontalAbs", [__arg_0]);
 
-  static createSVGPathSegCurvetoQuadraticAbs_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "SVGPathElement_createSVGPathSegCurvetoQuadraticAbs_Callback";
-  createSVGPathSegCurvetoQuadraticAbs_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => createSVGPathSegCurvetoQuadraticAbs_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  createSVGPathSegLinetoHorizontalRel_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createSVGPathSegLinetoHorizontalRel", []);
 
-  static createSVGPathSegCurvetoQuadraticAbs_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "SVGPathElement_createSVGPathSegCurvetoQuadraticAbs_Callback";
-  createSVGPathSegCurvetoQuadraticAbs_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => createSVGPathSegCurvetoQuadraticAbs_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  createSVGPathSegLinetoHorizontalRel_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "createSVGPathSegLinetoHorizontalRel", [__arg_0]);
 
-  static createSVGPathSegCurvetoQuadraticRel_Callback_2(mthis, __arg_0, __arg_1) native "SVGPathElement_createSVGPathSegCurvetoQuadraticRel_Callback";
-  createSVGPathSegCurvetoQuadraticRel_Callback_2_(mthis, __arg_0, __arg_1) => createSVGPathSegCurvetoQuadraticRel_Callback_2(mthis, __arg_0, __arg_1);
+  createSVGPathSegLinetoRel_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createSVGPathSegLinetoRel", []);
 
-  static createSVGPathSegCurvetoQuadraticRel_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGPathElement_createSVGPathSegCurvetoQuadraticRel_Callback";
-  createSVGPathSegCurvetoQuadraticRel_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => createSVGPathSegCurvetoQuadraticRel_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  createSVGPathSegLinetoRel_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "createSVGPathSegLinetoRel", [__arg_0]);
 
-  static createSVGPathSegCurvetoQuadraticRel_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "SVGPathElement_createSVGPathSegCurvetoQuadraticRel_Callback";
-  createSVGPathSegCurvetoQuadraticRel_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => createSVGPathSegCurvetoQuadraticRel_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  createSVGPathSegLinetoRel_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "createSVGPathSegLinetoRel", [__arg_0, __arg_1]);
 
-  static createSVGPathSegCurvetoQuadraticRel_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "SVGPathElement_createSVGPathSegCurvetoQuadraticRel_Callback";
-  createSVGPathSegCurvetoQuadraticRel_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => createSVGPathSegCurvetoQuadraticRel_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  createSVGPathSegLinetoVerticalAbs_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createSVGPathSegLinetoVerticalAbs", []);
 
-  static createSVGPathSegCurvetoQuadraticRel_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "SVGPathElement_createSVGPathSegCurvetoQuadraticRel_Callback";
-  createSVGPathSegCurvetoQuadraticRel_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => createSVGPathSegCurvetoQuadraticRel_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  createSVGPathSegLinetoVerticalAbs_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "createSVGPathSegLinetoVerticalAbs", [__arg_0]);
 
-  static createSVGPathSegCurvetoQuadraticSmoothAbs_Callback_0(mthis) native "SVGPathElement_createSVGPathSegCurvetoQuadraticSmoothAbs_Callback";
-  createSVGPathSegCurvetoQuadraticSmoothAbs_Callback_0_(mthis) => createSVGPathSegCurvetoQuadraticSmoothAbs_Callback_0(mthis);
+  createSVGPathSegLinetoVerticalRel_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createSVGPathSegLinetoVerticalRel", []);
 
-  static createSVGPathSegCurvetoQuadraticSmoothAbs_Callback_1(mthis, __arg_0) native "SVGPathElement_createSVGPathSegCurvetoQuadraticSmoothAbs_Callback";
-  createSVGPathSegCurvetoQuadraticSmoothAbs_Callback_1_(mthis, __arg_0) => createSVGPathSegCurvetoQuadraticSmoothAbs_Callback_1(mthis, __arg_0);
+  createSVGPathSegLinetoVerticalRel_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "createSVGPathSegLinetoVerticalRel", [__arg_0]);
 
-  static createSVGPathSegCurvetoQuadraticSmoothAbs_Callback_2(mthis, __arg_0, __arg_1) native "SVGPathElement_createSVGPathSegCurvetoQuadraticSmoothAbs_Callback";
-  createSVGPathSegCurvetoQuadraticSmoothAbs_Callback_2_(mthis, __arg_0, __arg_1) => createSVGPathSegCurvetoQuadraticSmoothAbs_Callback_2(mthis, __arg_0, __arg_1);
+  createSVGPathSegMovetoAbs_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createSVGPathSegMovetoAbs", []);
 
-  static createSVGPathSegCurvetoQuadraticSmoothAbs_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGPathElement_createSVGPathSegCurvetoQuadraticSmoothAbs_Callback";
-  createSVGPathSegCurvetoQuadraticSmoothAbs_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => createSVGPathSegCurvetoQuadraticSmoothAbs_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  createSVGPathSegMovetoAbs_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "createSVGPathSegMovetoAbs", [__arg_0]);
 
-  static createSVGPathSegCurvetoQuadraticSmoothAbs_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "SVGPathElement_createSVGPathSegCurvetoQuadraticSmoothAbs_Callback";
-  createSVGPathSegCurvetoQuadraticSmoothAbs_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => createSVGPathSegCurvetoQuadraticSmoothAbs_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  createSVGPathSegMovetoAbs_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "createSVGPathSegMovetoAbs", [__arg_0, __arg_1]);
 
-  static createSVGPathSegCurvetoQuadraticSmoothRel_Callback_0(mthis) native "SVGPathElement_createSVGPathSegCurvetoQuadraticSmoothRel_Callback";
-  createSVGPathSegCurvetoQuadraticSmoothRel_Callback_0_(mthis) => createSVGPathSegCurvetoQuadraticSmoothRel_Callback_0(mthis);
+  createSVGPathSegMovetoRel_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createSVGPathSegMovetoRel", []);
 
-  static createSVGPathSegCurvetoQuadraticSmoothRel_Callback_1(mthis, __arg_0) native "SVGPathElement_createSVGPathSegCurvetoQuadraticSmoothRel_Callback";
-  createSVGPathSegCurvetoQuadraticSmoothRel_Callback_1_(mthis, __arg_0) => createSVGPathSegCurvetoQuadraticSmoothRel_Callback_1(mthis, __arg_0);
+  createSVGPathSegMovetoRel_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "createSVGPathSegMovetoRel", [__arg_0]);
 
-  static createSVGPathSegCurvetoQuadraticSmoothRel_Callback_2(mthis, __arg_0, __arg_1) native "SVGPathElement_createSVGPathSegCurvetoQuadraticSmoothRel_Callback";
-  createSVGPathSegCurvetoQuadraticSmoothRel_Callback_2_(mthis, __arg_0, __arg_1) => createSVGPathSegCurvetoQuadraticSmoothRel_Callback_2(mthis, __arg_0, __arg_1);
-
-  static createSVGPathSegCurvetoQuadraticSmoothRel_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGPathElement_createSVGPathSegCurvetoQuadraticSmoothRel_Callback";
-  createSVGPathSegCurvetoQuadraticSmoothRel_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => createSVGPathSegCurvetoQuadraticSmoothRel_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static createSVGPathSegCurvetoQuadraticSmoothRel_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "SVGPathElement_createSVGPathSegCurvetoQuadraticSmoothRel_Callback";
-  createSVGPathSegCurvetoQuadraticSmoothRel_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => createSVGPathSegCurvetoQuadraticSmoothRel_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static createSVGPathSegLinetoAbs_Callback_0(mthis) native "SVGPathElement_createSVGPathSegLinetoAbs_Callback";
-  createSVGPathSegLinetoAbs_Callback_0_(mthis) => createSVGPathSegLinetoAbs_Callback_0(mthis);
-
-  static createSVGPathSegLinetoAbs_Callback_1(mthis, __arg_0) native "SVGPathElement_createSVGPathSegLinetoAbs_Callback";
-  createSVGPathSegLinetoAbs_Callback_1_(mthis, __arg_0) => createSVGPathSegLinetoAbs_Callback_1(mthis, __arg_0);
-
-  static createSVGPathSegLinetoAbs_Callback_2(mthis, __arg_0, __arg_1) native "SVGPathElement_createSVGPathSegLinetoAbs_Callback";
-  createSVGPathSegLinetoAbs_Callback_2_(mthis, __arg_0, __arg_1) => createSVGPathSegLinetoAbs_Callback_2(mthis, __arg_0, __arg_1);
-
-  static createSVGPathSegLinetoAbs_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGPathElement_createSVGPathSegLinetoAbs_Callback";
-  createSVGPathSegLinetoAbs_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => createSVGPathSegLinetoAbs_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static createSVGPathSegLinetoAbs_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "SVGPathElement_createSVGPathSegLinetoAbs_Callback";
-  createSVGPathSegLinetoAbs_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => createSVGPathSegLinetoAbs_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static createSVGPathSegLinetoHorizontalAbs_Callback_0(mthis) native "SVGPathElement_createSVGPathSegLinetoHorizontalAbs_Callback";
-  createSVGPathSegLinetoHorizontalAbs_Callback_0_(mthis) => createSVGPathSegLinetoHorizontalAbs_Callback_0(mthis);
-
-  static createSVGPathSegLinetoHorizontalAbs_Callback_1(mthis, __arg_0) native "SVGPathElement_createSVGPathSegLinetoHorizontalAbs_Callback";
-  createSVGPathSegLinetoHorizontalAbs_Callback_1_(mthis, __arg_0) => createSVGPathSegLinetoHorizontalAbs_Callback_1(mthis, __arg_0);
-
-  static createSVGPathSegLinetoHorizontalAbs_Callback_2(mthis, __arg_0, __arg_1) native "SVGPathElement_createSVGPathSegLinetoHorizontalAbs_Callback";
-  createSVGPathSegLinetoHorizontalAbs_Callback_2_(mthis, __arg_0, __arg_1) => createSVGPathSegLinetoHorizontalAbs_Callback_2(mthis, __arg_0, __arg_1);
-
-  static createSVGPathSegLinetoHorizontalAbs_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGPathElement_createSVGPathSegLinetoHorizontalAbs_Callback";
-  createSVGPathSegLinetoHorizontalAbs_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => createSVGPathSegLinetoHorizontalAbs_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static createSVGPathSegLinetoHorizontalRel_Callback_0(mthis) native "SVGPathElement_createSVGPathSegLinetoHorizontalRel_Callback";
-  createSVGPathSegLinetoHorizontalRel_Callback_0_(mthis) => createSVGPathSegLinetoHorizontalRel_Callback_0(mthis);
-
-  static createSVGPathSegLinetoHorizontalRel_Callback_1(mthis, __arg_0) native "SVGPathElement_createSVGPathSegLinetoHorizontalRel_Callback";
-  createSVGPathSegLinetoHorizontalRel_Callback_1_(mthis, __arg_0) => createSVGPathSegLinetoHorizontalRel_Callback_1(mthis, __arg_0);
-
-  static createSVGPathSegLinetoHorizontalRel_Callback_2(mthis, __arg_0, __arg_1) native "SVGPathElement_createSVGPathSegLinetoHorizontalRel_Callback";
-  createSVGPathSegLinetoHorizontalRel_Callback_2_(mthis, __arg_0, __arg_1) => createSVGPathSegLinetoHorizontalRel_Callback_2(mthis, __arg_0, __arg_1);
-
-  static createSVGPathSegLinetoHorizontalRel_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGPathElement_createSVGPathSegLinetoHorizontalRel_Callback";
-  createSVGPathSegLinetoHorizontalRel_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => createSVGPathSegLinetoHorizontalRel_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static createSVGPathSegLinetoRel_Callback_0(mthis) native "SVGPathElement_createSVGPathSegLinetoRel_Callback";
-  createSVGPathSegLinetoRel_Callback_0_(mthis) => createSVGPathSegLinetoRel_Callback_0(mthis);
-
-  static createSVGPathSegLinetoRel_Callback_1(mthis, __arg_0) native "SVGPathElement_createSVGPathSegLinetoRel_Callback";
-  createSVGPathSegLinetoRel_Callback_1_(mthis, __arg_0) => createSVGPathSegLinetoRel_Callback_1(mthis, __arg_0);
-
-  static createSVGPathSegLinetoRel_Callback_2(mthis, __arg_0, __arg_1) native "SVGPathElement_createSVGPathSegLinetoRel_Callback";
-  createSVGPathSegLinetoRel_Callback_2_(mthis, __arg_0, __arg_1) => createSVGPathSegLinetoRel_Callback_2(mthis, __arg_0, __arg_1);
-
-  static createSVGPathSegLinetoRel_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGPathElement_createSVGPathSegLinetoRel_Callback";
-  createSVGPathSegLinetoRel_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => createSVGPathSegLinetoRel_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static createSVGPathSegLinetoRel_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "SVGPathElement_createSVGPathSegLinetoRel_Callback";
-  createSVGPathSegLinetoRel_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => createSVGPathSegLinetoRel_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static createSVGPathSegLinetoVerticalAbs_Callback_0(mthis) native "SVGPathElement_createSVGPathSegLinetoVerticalAbs_Callback";
-  createSVGPathSegLinetoVerticalAbs_Callback_0_(mthis) => createSVGPathSegLinetoVerticalAbs_Callback_0(mthis);
-
-  static createSVGPathSegLinetoVerticalAbs_Callback_1(mthis, __arg_0) native "SVGPathElement_createSVGPathSegLinetoVerticalAbs_Callback";
-  createSVGPathSegLinetoVerticalAbs_Callback_1_(mthis, __arg_0) => createSVGPathSegLinetoVerticalAbs_Callback_1(mthis, __arg_0);
-
-  static createSVGPathSegLinetoVerticalAbs_Callback_2(mthis, __arg_0, __arg_1) native "SVGPathElement_createSVGPathSegLinetoVerticalAbs_Callback";
-  createSVGPathSegLinetoVerticalAbs_Callback_2_(mthis, __arg_0, __arg_1) => createSVGPathSegLinetoVerticalAbs_Callback_2(mthis, __arg_0, __arg_1);
-
-  static createSVGPathSegLinetoVerticalAbs_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGPathElement_createSVGPathSegLinetoVerticalAbs_Callback";
-  createSVGPathSegLinetoVerticalAbs_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => createSVGPathSegLinetoVerticalAbs_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static createSVGPathSegLinetoVerticalRel_Callback_0(mthis) native "SVGPathElement_createSVGPathSegLinetoVerticalRel_Callback";
-  createSVGPathSegLinetoVerticalRel_Callback_0_(mthis) => createSVGPathSegLinetoVerticalRel_Callback_0(mthis);
-
-  static createSVGPathSegLinetoVerticalRel_Callback_1(mthis, __arg_0) native "SVGPathElement_createSVGPathSegLinetoVerticalRel_Callback";
-  createSVGPathSegLinetoVerticalRel_Callback_1_(mthis, __arg_0) => createSVGPathSegLinetoVerticalRel_Callback_1(mthis, __arg_0);
-
-  static createSVGPathSegLinetoVerticalRel_Callback_2(mthis, __arg_0, __arg_1) native "SVGPathElement_createSVGPathSegLinetoVerticalRel_Callback";
-  createSVGPathSegLinetoVerticalRel_Callback_2_(mthis, __arg_0, __arg_1) => createSVGPathSegLinetoVerticalRel_Callback_2(mthis, __arg_0, __arg_1);
-
-  static createSVGPathSegLinetoVerticalRel_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGPathElement_createSVGPathSegLinetoVerticalRel_Callback";
-  createSVGPathSegLinetoVerticalRel_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => createSVGPathSegLinetoVerticalRel_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static createSVGPathSegMovetoAbs_Callback_0(mthis) native "SVGPathElement_createSVGPathSegMovetoAbs_Callback";
-  createSVGPathSegMovetoAbs_Callback_0_(mthis) => createSVGPathSegMovetoAbs_Callback_0(mthis);
-
-  static createSVGPathSegMovetoAbs_Callback_1(mthis, __arg_0) native "SVGPathElement_createSVGPathSegMovetoAbs_Callback";
-  createSVGPathSegMovetoAbs_Callback_1_(mthis, __arg_0) => createSVGPathSegMovetoAbs_Callback_1(mthis, __arg_0);
-
-  static createSVGPathSegMovetoAbs_Callback_2(mthis, __arg_0, __arg_1) native "SVGPathElement_createSVGPathSegMovetoAbs_Callback";
-  createSVGPathSegMovetoAbs_Callback_2_(mthis, __arg_0, __arg_1) => createSVGPathSegMovetoAbs_Callback_2(mthis, __arg_0, __arg_1);
-
-  static createSVGPathSegMovetoAbs_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGPathElement_createSVGPathSegMovetoAbs_Callback";
-  createSVGPathSegMovetoAbs_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => createSVGPathSegMovetoAbs_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static createSVGPathSegMovetoAbs_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "SVGPathElement_createSVGPathSegMovetoAbs_Callback";
-  createSVGPathSegMovetoAbs_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => createSVGPathSegMovetoAbs_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static createSVGPathSegMovetoRel_Callback_0(mthis) native "SVGPathElement_createSVGPathSegMovetoRel_Callback";
-  createSVGPathSegMovetoRel_Callback_0_(mthis) => createSVGPathSegMovetoRel_Callback_0(mthis);
-
-  static createSVGPathSegMovetoRel_Callback_1(mthis, __arg_0) native "SVGPathElement_createSVGPathSegMovetoRel_Callback";
-  createSVGPathSegMovetoRel_Callback_1_(mthis, __arg_0) => createSVGPathSegMovetoRel_Callback_1(mthis, __arg_0);
-
-  static createSVGPathSegMovetoRel_Callback_2(mthis, __arg_0, __arg_1) native "SVGPathElement_createSVGPathSegMovetoRel_Callback";
-  createSVGPathSegMovetoRel_Callback_2_(mthis, __arg_0, __arg_1) => createSVGPathSegMovetoRel_Callback_2(mthis, __arg_0, __arg_1);
-
-  static createSVGPathSegMovetoRel_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGPathElement_createSVGPathSegMovetoRel_Callback";
-  createSVGPathSegMovetoRel_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => createSVGPathSegMovetoRel_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static createSVGPathSegMovetoRel_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "SVGPathElement_createSVGPathSegMovetoRel_Callback";
-  createSVGPathSegMovetoRel_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => createSVGPathSegMovetoRel_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static getPathSegAtLength_Callback_0(mthis) native "SVGPathElement_getPathSegAtLength_Callback";
-  getPathSegAtLength_Callback_0_(mthis) => getPathSegAtLength_Callback_0(mthis);
-
-  static getPathSegAtLength_Callback_1(mthis, __arg_0) native "SVGPathElement_getPathSegAtLength_Callback";
-  getPathSegAtLength_Callback_1_(mthis, __arg_0) => getPathSegAtLength_Callback_1(mthis, __arg_0);
-
-  static getPathSegAtLength_Callback_2(mthis, __arg_0, __arg_1) native "SVGPathElement_getPathSegAtLength_Callback";
-  getPathSegAtLength_Callback_2_(mthis, __arg_0, __arg_1) => getPathSegAtLength_Callback_2(mthis, __arg_0, __arg_1);
-
-  static getPathSegAtLength_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGPathElement_getPathSegAtLength_Callback";
-  getPathSegAtLength_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getPathSegAtLength_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static getPointAtLength_Callback_0(mthis) native "SVGPathElement_getPointAtLength_Callback";
-  getPointAtLength_Callback_0_(mthis) => getPointAtLength_Callback_0(mthis);
-
-  static getPointAtLength_Callback_1(mthis, __arg_0) native "SVGPathElement_getPointAtLength_Callback";
-  getPointAtLength_Callback_1_(mthis, __arg_0) => getPointAtLength_Callback_1(mthis, __arg_0);
+  createSVGPathSegMovetoRel_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "createSVGPathSegMovetoRel", [__arg_0, __arg_1]);
 
-  static getPointAtLength_Callback_2(mthis, __arg_0, __arg_1) native "SVGPathElement_getPointAtLength_Callback";
-  getPointAtLength_Callback_2_(mthis, __arg_0, __arg_1) => getPointAtLength_Callback_2(mthis, __arg_0, __arg_1);
+  getPathSegAtLength_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getPathSegAtLength", []);
 
-  static getPointAtLength_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGPathElement_getPointAtLength_Callback";
-  getPointAtLength_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getPointAtLength_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  getPathSegAtLength_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getPathSegAtLength", [__arg_0]);
 
-  static getTotalLength_Callback_0(mthis) native "SVGPathElement_getTotalLength_Callback";
-  getTotalLength_Callback_0_(mthis) => getTotalLength_Callback_0(mthis);
+  getPointAtLength_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getPointAtLength", []);
 
-  static getTotalLength_Callback_1(mthis, __arg_0) native "SVGPathElement_getTotalLength_Callback";
-  getTotalLength_Callback_1_(mthis, __arg_0) => getTotalLength_Callback_1(mthis, __arg_0);
+  getPointAtLength_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getPointAtLength", [__arg_0]);
 
-  static getTotalLength_Callback_2(mthis, __arg_0, __arg_1) native "SVGPathElement_getTotalLength_Callback";
-  getTotalLength_Callback_2_(mthis, __arg_0, __arg_1) => getTotalLength_Callback_2(mthis, __arg_0, __arg_1);
+  getTotalLength_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getTotalLength", []);
 
-  static normalizedPathSegList_Getter(mthis) native "SVGPathElement_normalizedPathSegList_Getter";
-  normalizedPathSegList_Getter_(mthis) => normalizedPathSegList_Getter(mthis);
+  normalizedPathSegList_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "normalizedPathSegList");
 
-  static pathLength_Getter(mthis) native "SVGPathElement_pathLength_Getter";
-  pathLength_Getter_(mthis) => pathLength_Getter(mthis);
+  pathLength_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "pathLength");
 
-  static pathSegList_Getter(mthis) native "SVGPathElement_pathSegList_Getter";
-  pathSegList_Getter_(mthis) => pathSegList_Getter(mthis);
+  pathSegList_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "pathSegList");
 
 }
 
 class BlinkSVGPathSeg {
   static final instance = new BlinkSVGPathSeg();
 
-  static pathSegTypeAsLetter_Getter(mthis) native "SVGPathSeg_pathSegTypeAsLetter_Getter";
-  pathSegTypeAsLetter_Getter_(mthis) => pathSegTypeAsLetter_Getter(mthis);
+  pathSegTypeAsLetter_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "pathSegTypeAsLetter");
 
-  static pathSegType_Getter(mthis) native "SVGPathSeg_pathSegType_Getter";
-  pathSegType_Getter_(mthis) => pathSegType_Getter(mthis);
+  pathSegType_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "pathSegType");
 
 }
 
 class BlinkSVGPathSegArcAbs extends BlinkSVGPathSeg {
   static final instance = new BlinkSVGPathSegArcAbs();
 
-  static angle_Getter(mthis) native "SVGPathSegArcAbs_angle_Getter";
-  angle_Getter_(mthis) => angle_Getter(mthis);
+  angle_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "angle");
 
-  static angle_Setter(mthis, __arg_0) native "SVGPathSegArcAbs_angle_Setter";
-  angle_Setter_(mthis, __arg_0) => angle_Setter(mthis, __arg_0);
+  angle_Setter_(mthis, __arg_0) => mthis["angle"] = __arg_0;
 
-  static largeArcFlag_Getter(mthis) native "SVGPathSegArcAbs_largeArcFlag_Getter";
-  largeArcFlag_Getter_(mthis) => largeArcFlag_Getter(mthis);
+  largeArcFlag_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "largeArcFlag");
 
-  static largeArcFlag_Setter(mthis, __arg_0) native "SVGPathSegArcAbs_largeArcFlag_Setter";
-  largeArcFlag_Setter_(mthis, __arg_0) => largeArcFlag_Setter(mthis, __arg_0);
+  largeArcFlag_Setter_(mthis, __arg_0) => mthis["largeArcFlag"] = __arg_0;
 
-  static r1_Getter(mthis) native "SVGPathSegArcAbs_r1_Getter";
-  r1_Getter_(mthis) => r1_Getter(mthis);
+  r1_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "r1");
 
-  static r1_Setter(mthis, __arg_0) native "SVGPathSegArcAbs_r1_Setter";
-  r1_Setter_(mthis, __arg_0) => r1_Setter(mthis, __arg_0);
+  r1_Setter_(mthis, __arg_0) => mthis["r1"] = __arg_0;
 
-  static r2_Getter(mthis) native "SVGPathSegArcAbs_r2_Getter";
-  r2_Getter_(mthis) => r2_Getter(mthis);
+  r2_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "r2");
 
-  static r2_Setter(mthis, __arg_0) native "SVGPathSegArcAbs_r2_Setter";
-  r2_Setter_(mthis, __arg_0) => r2_Setter(mthis, __arg_0);
+  r2_Setter_(mthis, __arg_0) => mthis["r2"] = __arg_0;
 
-  static sweepFlag_Getter(mthis) native "SVGPathSegArcAbs_sweepFlag_Getter";
-  sweepFlag_Getter_(mthis) => sweepFlag_Getter(mthis);
+  sweepFlag_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "sweepFlag");
 
-  static sweepFlag_Setter(mthis, __arg_0) native "SVGPathSegArcAbs_sweepFlag_Setter";
-  sweepFlag_Setter_(mthis, __arg_0) => sweepFlag_Setter(mthis, __arg_0);
+  sweepFlag_Setter_(mthis, __arg_0) => mthis["sweepFlag"] = __arg_0;
 
-  static x_Getter(mthis) native "SVGPathSegArcAbs_x_Getter";
-  x_Getter_(mthis) => x_Getter(mthis);
+  x_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "x");
 
-  static x_Setter(mthis, __arg_0) native "SVGPathSegArcAbs_x_Setter";
-  x_Setter_(mthis, __arg_0) => x_Setter(mthis, __arg_0);
+  x_Setter_(mthis, __arg_0) => mthis["x"] = __arg_0;
 
-  static y_Getter(mthis) native "SVGPathSegArcAbs_y_Getter";
-  y_Getter_(mthis) => y_Getter(mthis);
+  y_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "y");
 
-  static y_Setter(mthis, __arg_0) native "SVGPathSegArcAbs_y_Setter";
-  y_Setter_(mthis, __arg_0) => y_Setter(mthis, __arg_0);
+  y_Setter_(mthis, __arg_0) => mthis["y"] = __arg_0;
 
 }
 
 class BlinkSVGPathSegArcRel extends BlinkSVGPathSeg {
   static final instance = new BlinkSVGPathSegArcRel();
 
-  static angle_Getter(mthis) native "SVGPathSegArcRel_angle_Getter";
-  angle_Getter_(mthis) => angle_Getter(mthis);
+  angle_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "angle");
 
-  static angle_Setter(mthis, __arg_0) native "SVGPathSegArcRel_angle_Setter";
-  angle_Setter_(mthis, __arg_0) => angle_Setter(mthis, __arg_0);
+  angle_Setter_(mthis, __arg_0) => mthis["angle"] = __arg_0;
 
-  static largeArcFlag_Getter(mthis) native "SVGPathSegArcRel_largeArcFlag_Getter";
-  largeArcFlag_Getter_(mthis) => largeArcFlag_Getter(mthis);
+  largeArcFlag_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "largeArcFlag");
 
-  static largeArcFlag_Setter(mthis, __arg_0) native "SVGPathSegArcRel_largeArcFlag_Setter";
-  largeArcFlag_Setter_(mthis, __arg_0) => largeArcFlag_Setter(mthis, __arg_0);
+  largeArcFlag_Setter_(mthis, __arg_0) => mthis["largeArcFlag"] = __arg_0;
 
-  static r1_Getter(mthis) native "SVGPathSegArcRel_r1_Getter";
-  r1_Getter_(mthis) => r1_Getter(mthis);
+  r1_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "r1");
 
-  static r1_Setter(mthis, __arg_0) native "SVGPathSegArcRel_r1_Setter";
-  r1_Setter_(mthis, __arg_0) => r1_Setter(mthis, __arg_0);
+  r1_Setter_(mthis, __arg_0) => mthis["r1"] = __arg_0;
 
-  static r2_Getter(mthis) native "SVGPathSegArcRel_r2_Getter";
-  r2_Getter_(mthis) => r2_Getter(mthis);
+  r2_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "r2");
 
-  static r2_Setter(mthis, __arg_0) native "SVGPathSegArcRel_r2_Setter";
-  r2_Setter_(mthis, __arg_0) => r2_Setter(mthis, __arg_0);
+  r2_Setter_(mthis, __arg_0) => mthis["r2"] = __arg_0;
 
-  static sweepFlag_Getter(mthis) native "SVGPathSegArcRel_sweepFlag_Getter";
-  sweepFlag_Getter_(mthis) => sweepFlag_Getter(mthis);
+  sweepFlag_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "sweepFlag");
 
-  static sweepFlag_Setter(mthis, __arg_0) native "SVGPathSegArcRel_sweepFlag_Setter";
-  sweepFlag_Setter_(mthis, __arg_0) => sweepFlag_Setter(mthis, __arg_0);
+  sweepFlag_Setter_(mthis, __arg_0) => mthis["sweepFlag"] = __arg_0;
 
-  static x_Getter(mthis) native "SVGPathSegArcRel_x_Getter";
-  x_Getter_(mthis) => x_Getter(mthis);
+  x_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "x");
 
-  static x_Setter(mthis, __arg_0) native "SVGPathSegArcRel_x_Setter";
-  x_Setter_(mthis, __arg_0) => x_Setter(mthis, __arg_0);
+  x_Setter_(mthis, __arg_0) => mthis["x"] = __arg_0;
 
-  static y_Getter(mthis) native "SVGPathSegArcRel_y_Getter";
-  y_Getter_(mthis) => y_Getter(mthis);
+  y_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "y");
 
-  static y_Setter(mthis, __arg_0) native "SVGPathSegArcRel_y_Setter";
-  y_Setter_(mthis, __arg_0) => y_Setter(mthis, __arg_0);
+  y_Setter_(mthis, __arg_0) => mthis["y"] = __arg_0;
 
 }
 
@@ -22049,751 +12263,480 @@
 class BlinkSVGPathSegCurvetoCubicAbs extends BlinkSVGPathSeg {
   static final instance = new BlinkSVGPathSegCurvetoCubicAbs();
 
-  static x1_Getter(mthis) native "SVGPathSegCurvetoCubicAbs_x1_Getter";
-  x1_Getter_(mthis) => x1_Getter(mthis);
+  x1_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "x1");
 
-  static x1_Setter(mthis, __arg_0) native "SVGPathSegCurvetoCubicAbs_x1_Setter";
-  x1_Setter_(mthis, __arg_0) => x1_Setter(mthis, __arg_0);
+  x1_Setter_(mthis, __arg_0) => mthis["x1"] = __arg_0;
 
-  static x2_Getter(mthis) native "SVGPathSegCurvetoCubicAbs_x2_Getter";
-  x2_Getter_(mthis) => x2_Getter(mthis);
+  x2_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "x2");
 
-  static x2_Setter(mthis, __arg_0) native "SVGPathSegCurvetoCubicAbs_x2_Setter";
-  x2_Setter_(mthis, __arg_0) => x2_Setter(mthis, __arg_0);
+  x2_Setter_(mthis, __arg_0) => mthis["x2"] = __arg_0;
 
-  static x_Getter(mthis) native "SVGPathSegCurvetoCubicAbs_x_Getter";
-  x_Getter_(mthis) => x_Getter(mthis);
+  x_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "x");
 
-  static x_Setter(mthis, __arg_0) native "SVGPathSegCurvetoCubicAbs_x_Setter";
-  x_Setter_(mthis, __arg_0) => x_Setter(mthis, __arg_0);
+  x_Setter_(mthis, __arg_0) => mthis["x"] = __arg_0;
 
-  static y1_Getter(mthis) native "SVGPathSegCurvetoCubicAbs_y1_Getter";
-  y1_Getter_(mthis) => y1_Getter(mthis);
+  y1_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "y1");
 
-  static y1_Setter(mthis, __arg_0) native "SVGPathSegCurvetoCubicAbs_y1_Setter";
-  y1_Setter_(mthis, __arg_0) => y1_Setter(mthis, __arg_0);
+  y1_Setter_(mthis, __arg_0) => mthis["y1"] = __arg_0;
 
-  static y2_Getter(mthis) native "SVGPathSegCurvetoCubicAbs_y2_Getter";
-  y2_Getter_(mthis) => y2_Getter(mthis);
+  y2_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "y2");
 
-  static y2_Setter(mthis, __arg_0) native "SVGPathSegCurvetoCubicAbs_y2_Setter";
-  y2_Setter_(mthis, __arg_0) => y2_Setter(mthis, __arg_0);
+  y2_Setter_(mthis, __arg_0) => mthis["y2"] = __arg_0;
 
-  static y_Getter(mthis) native "SVGPathSegCurvetoCubicAbs_y_Getter";
-  y_Getter_(mthis) => y_Getter(mthis);
+  y_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "y");
 
-  static y_Setter(mthis, __arg_0) native "SVGPathSegCurvetoCubicAbs_y_Setter";
-  y_Setter_(mthis, __arg_0) => y_Setter(mthis, __arg_0);
+  y_Setter_(mthis, __arg_0) => mthis["y"] = __arg_0;
 
 }
 
 class BlinkSVGPathSegCurvetoCubicRel extends BlinkSVGPathSeg {
   static final instance = new BlinkSVGPathSegCurvetoCubicRel();
 
-  static x1_Getter(mthis) native "SVGPathSegCurvetoCubicRel_x1_Getter";
-  x1_Getter_(mthis) => x1_Getter(mthis);
+  x1_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "x1");
 
-  static x1_Setter(mthis, __arg_0) native "SVGPathSegCurvetoCubicRel_x1_Setter";
-  x1_Setter_(mthis, __arg_0) => x1_Setter(mthis, __arg_0);
+  x1_Setter_(mthis, __arg_0) => mthis["x1"] = __arg_0;
 
-  static x2_Getter(mthis) native "SVGPathSegCurvetoCubicRel_x2_Getter";
-  x2_Getter_(mthis) => x2_Getter(mthis);
+  x2_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "x2");
 
-  static x2_Setter(mthis, __arg_0) native "SVGPathSegCurvetoCubicRel_x2_Setter";
-  x2_Setter_(mthis, __arg_0) => x2_Setter(mthis, __arg_0);
+  x2_Setter_(mthis, __arg_0) => mthis["x2"] = __arg_0;
 
-  static x_Getter(mthis) native "SVGPathSegCurvetoCubicRel_x_Getter";
-  x_Getter_(mthis) => x_Getter(mthis);
+  x_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "x");
 
-  static x_Setter(mthis, __arg_0) native "SVGPathSegCurvetoCubicRel_x_Setter";
-  x_Setter_(mthis, __arg_0) => x_Setter(mthis, __arg_0);
+  x_Setter_(mthis, __arg_0) => mthis["x"] = __arg_0;
 
-  static y1_Getter(mthis) native "SVGPathSegCurvetoCubicRel_y1_Getter";
-  y1_Getter_(mthis) => y1_Getter(mthis);
+  y1_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "y1");
 
-  static y1_Setter(mthis, __arg_0) native "SVGPathSegCurvetoCubicRel_y1_Setter";
-  y1_Setter_(mthis, __arg_0) => y1_Setter(mthis, __arg_0);
+  y1_Setter_(mthis, __arg_0) => mthis["y1"] = __arg_0;
 
-  static y2_Getter(mthis) native "SVGPathSegCurvetoCubicRel_y2_Getter";
-  y2_Getter_(mthis) => y2_Getter(mthis);
+  y2_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "y2");
 
-  static y2_Setter(mthis, __arg_0) native "SVGPathSegCurvetoCubicRel_y2_Setter";
-  y2_Setter_(mthis, __arg_0) => y2_Setter(mthis, __arg_0);
+  y2_Setter_(mthis, __arg_0) => mthis["y2"] = __arg_0;
 
-  static y_Getter(mthis) native "SVGPathSegCurvetoCubicRel_y_Getter";
-  y_Getter_(mthis) => y_Getter(mthis);
+  y_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "y");
 
-  static y_Setter(mthis, __arg_0) native "SVGPathSegCurvetoCubicRel_y_Setter";
-  y_Setter_(mthis, __arg_0) => y_Setter(mthis, __arg_0);
+  y_Setter_(mthis, __arg_0) => mthis["y"] = __arg_0;
 
 }
 
 class BlinkSVGPathSegCurvetoCubicSmoothAbs extends BlinkSVGPathSeg {
   static final instance = new BlinkSVGPathSegCurvetoCubicSmoothAbs();
 
-  static x2_Getter(mthis) native "SVGPathSegCurvetoCubicSmoothAbs_x2_Getter";
-  x2_Getter_(mthis) => x2_Getter(mthis);
+  x2_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "x2");
 
-  static x2_Setter(mthis, __arg_0) native "SVGPathSegCurvetoCubicSmoothAbs_x2_Setter";
-  x2_Setter_(mthis, __arg_0) => x2_Setter(mthis, __arg_0);
+  x2_Setter_(mthis, __arg_0) => mthis["x2"] = __arg_0;
 
-  static x_Getter(mthis) native "SVGPathSegCurvetoCubicSmoothAbs_x_Getter";
-  x_Getter_(mthis) => x_Getter(mthis);
+  x_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "x");
 
-  static x_Setter(mthis, __arg_0) native "SVGPathSegCurvetoCubicSmoothAbs_x_Setter";
-  x_Setter_(mthis, __arg_0) => x_Setter(mthis, __arg_0);
+  x_Setter_(mthis, __arg_0) => mthis["x"] = __arg_0;
 
-  static y2_Getter(mthis) native "SVGPathSegCurvetoCubicSmoothAbs_y2_Getter";
-  y2_Getter_(mthis) => y2_Getter(mthis);
+  y2_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "y2");
 
-  static y2_Setter(mthis, __arg_0) native "SVGPathSegCurvetoCubicSmoothAbs_y2_Setter";
-  y2_Setter_(mthis, __arg_0) => y2_Setter(mthis, __arg_0);
+  y2_Setter_(mthis, __arg_0) => mthis["y2"] = __arg_0;
 
-  static y_Getter(mthis) native "SVGPathSegCurvetoCubicSmoothAbs_y_Getter";
-  y_Getter_(mthis) => y_Getter(mthis);
+  y_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "y");
 
-  static y_Setter(mthis, __arg_0) native "SVGPathSegCurvetoCubicSmoothAbs_y_Setter";
-  y_Setter_(mthis, __arg_0) => y_Setter(mthis, __arg_0);
+  y_Setter_(mthis, __arg_0) => mthis["y"] = __arg_0;
 
 }
 
 class BlinkSVGPathSegCurvetoCubicSmoothRel extends BlinkSVGPathSeg {
   static final instance = new BlinkSVGPathSegCurvetoCubicSmoothRel();
 
-  static x2_Getter(mthis) native "SVGPathSegCurvetoCubicSmoothRel_x2_Getter";
-  x2_Getter_(mthis) => x2_Getter(mthis);
+  x2_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "x2");
 
-  static x2_Setter(mthis, __arg_0) native "SVGPathSegCurvetoCubicSmoothRel_x2_Setter";
-  x2_Setter_(mthis, __arg_0) => x2_Setter(mthis, __arg_0);
+  x2_Setter_(mthis, __arg_0) => mthis["x2"] = __arg_0;
 
-  static x_Getter(mthis) native "SVGPathSegCurvetoCubicSmoothRel_x_Getter";
-  x_Getter_(mthis) => x_Getter(mthis);
+  x_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "x");
 
-  static x_Setter(mthis, __arg_0) native "SVGPathSegCurvetoCubicSmoothRel_x_Setter";
-  x_Setter_(mthis, __arg_0) => x_Setter(mthis, __arg_0);
+  x_Setter_(mthis, __arg_0) => mthis["x"] = __arg_0;
 
-  static y2_Getter(mthis) native "SVGPathSegCurvetoCubicSmoothRel_y2_Getter";
-  y2_Getter_(mthis) => y2_Getter(mthis);
+  y2_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "y2");
 
-  static y2_Setter(mthis, __arg_0) native "SVGPathSegCurvetoCubicSmoothRel_y2_Setter";
-  y2_Setter_(mthis, __arg_0) => y2_Setter(mthis, __arg_0);
+  y2_Setter_(mthis, __arg_0) => mthis["y2"] = __arg_0;
 
-  static y_Getter(mthis) native "SVGPathSegCurvetoCubicSmoothRel_y_Getter";
-  y_Getter_(mthis) => y_Getter(mthis);
+  y_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "y");
 
-  static y_Setter(mthis, __arg_0) native "SVGPathSegCurvetoCubicSmoothRel_y_Setter";
-  y_Setter_(mthis, __arg_0) => y_Setter(mthis, __arg_0);
+  y_Setter_(mthis, __arg_0) => mthis["y"] = __arg_0;
 
 }
 
 class BlinkSVGPathSegCurvetoQuadraticAbs extends BlinkSVGPathSeg {
   static final instance = new BlinkSVGPathSegCurvetoQuadraticAbs();
 
-  static x1_Getter(mthis) native "SVGPathSegCurvetoQuadraticAbs_x1_Getter";
-  x1_Getter_(mthis) => x1_Getter(mthis);
+  x1_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "x1");
 
-  static x1_Setter(mthis, __arg_0) native "SVGPathSegCurvetoQuadraticAbs_x1_Setter";
-  x1_Setter_(mthis, __arg_0) => x1_Setter(mthis, __arg_0);
+  x1_Setter_(mthis, __arg_0) => mthis["x1"] = __arg_0;
 
-  static x_Getter(mthis) native "SVGPathSegCurvetoQuadraticAbs_x_Getter";
-  x_Getter_(mthis) => x_Getter(mthis);
+  x_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "x");
 
-  static x_Setter(mthis, __arg_0) native "SVGPathSegCurvetoQuadraticAbs_x_Setter";
-  x_Setter_(mthis, __arg_0) => x_Setter(mthis, __arg_0);
+  x_Setter_(mthis, __arg_0) => mthis["x"] = __arg_0;
 
-  static y1_Getter(mthis) native "SVGPathSegCurvetoQuadraticAbs_y1_Getter";
-  y1_Getter_(mthis) => y1_Getter(mthis);
+  y1_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "y1");
 
-  static y1_Setter(mthis, __arg_0) native "SVGPathSegCurvetoQuadraticAbs_y1_Setter";
-  y1_Setter_(mthis, __arg_0) => y1_Setter(mthis, __arg_0);
+  y1_Setter_(mthis, __arg_0) => mthis["y1"] = __arg_0;
 
-  static y_Getter(mthis) native "SVGPathSegCurvetoQuadraticAbs_y_Getter";
-  y_Getter_(mthis) => y_Getter(mthis);
+  y_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "y");
 
-  static y_Setter(mthis, __arg_0) native "SVGPathSegCurvetoQuadraticAbs_y_Setter";
-  y_Setter_(mthis, __arg_0) => y_Setter(mthis, __arg_0);
+  y_Setter_(mthis, __arg_0) => mthis["y"] = __arg_0;
 
 }
 
 class BlinkSVGPathSegCurvetoQuadraticRel extends BlinkSVGPathSeg {
   static final instance = new BlinkSVGPathSegCurvetoQuadraticRel();
 
-  static x1_Getter(mthis) native "SVGPathSegCurvetoQuadraticRel_x1_Getter";
-  x1_Getter_(mthis) => x1_Getter(mthis);
+  x1_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "x1");
 
-  static x1_Setter(mthis, __arg_0) native "SVGPathSegCurvetoQuadraticRel_x1_Setter";
-  x1_Setter_(mthis, __arg_0) => x1_Setter(mthis, __arg_0);
+  x1_Setter_(mthis, __arg_0) => mthis["x1"] = __arg_0;
 
-  static x_Getter(mthis) native "SVGPathSegCurvetoQuadraticRel_x_Getter";
-  x_Getter_(mthis) => x_Getter(mthis);
+  x_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "x");
 
-  static x_Setter(mthis, __arg_0) native "SVGPathSegCurvetoQuadraticRel_x_Setter";
-  x_Setter_(mthis, __arg_0) => x_Setter(mthis, __arg_0);
+  x_Setter_(mthis, __arg_0) => mthis["x"] = __arg_0;
 
-  static y1_Getter(mthis) native "SVGPathSegCurvetoQuadraticRel_y1_Getter";
-  y1_Getter_(mthis) => y1_Getter(mthis);
+  y1_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "y1");
 
-  static y1_Setter(mthis, __arg_0) native "SVGPathSegCurvetoQuadraticRel_y1_Setter";
-  y1_Setter_(mthis, __arg_0) => y1_Setter(mthis, __arg_0);
+  y1_Setter_(mthis, __arg_0) => mthis["y1"] = __arg_0;
 
-  static y_Getter(mthis) native "SVGPathSegCurvetoQuadraticRel_y_Getter";
-  y_Getter_(mthis) => y_Getter(mthis);
+  y_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "y");
 
-  static y_Setter(mthis, __arg_0) native "SVGPathSegCurvetoQuadraticRel_y_Setter";
-  y_Setter_(mthis, __arg_0) => y_Setter(mthis, __arg_0);
+  y_Setter_(mthis, __arg_0) => mthis["y"] = __arg_0;
 
 }
 
 class BlinkSVGPathSegCurvetoQuadraticSmoothAbs extends BlinkSVGPathSeg {
   static final instance = new BlinkSVGPathSegCurvetoQuadraticSmoothAbs();
 
-  static x_Getter(mthis) native "SVGPathSegCurvetoQuadraticSmoothAbs_x_Getter";
-  x_Getter_(mthis) => x_Getter(mthis);
+  x_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "x");
 
-  static x_Setter(mthis, __arg_0) native "SVGPathSegCurvetoQuadraticSmoothAbs_x_Setter";
-  x_Setter_(mthis, __arg_0) => x_Setter(mthis, __arg_0);
+  x_Setter_(mthis, __arg_0) => mthis["x"] = __arg_0;
 
-  static y_Getter(mthis) native "SVGPathSegCurvetoQuadraticSmoothAbs_y_Getter";
-  y_Getter_(mthis) => y_Getter(mthis);
+  y_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "y");
 
-  static y_Setter(mthis, __arg_0) native "SVGPathSegCurvetoQuadraticSmoothAbs_y_Setter";
-  y_Setter_(mthis, __arg_0) => y_Setter(mthis, __arg_0);
+  y_Setter_(mthis, __arg_0) => mthis["y"] = __arg_0;
 
 }
 
 class BlinkSVGPathSegCurvetoQuadraticSmoothRel extends BlinkSVGPathSeg {
   static final instance = new BlinkSVGPathSegCurvetoQuadraticSmoothRel();
 
-  static x_Getter(mthis) native "SVGPathSegCurvetoQuadraticSmoothRel_x_Getter";
-  x_Getter_(mthis) => x_Getter(mthis);
+  x_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "x");
 
-  static x_Setter(mthis, __arg_0) native "SVGPathSegCurvetoQuadraticSmoothRel_x_Setter";
-  x_Setter_(mthis, __arg_0) => x_Setter(mthis, __arg_0);
+  x_Setter_(mthis, __arg_0) => mthis["x"] = __arg_0;
 
-  static y_Getter(mthis) native "SVGPathSegCurvetoQuadraticSmoothRel_y_Getter";
-  y_Getter_(mthis) => y_Getter(mthis);
+  y_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "y");
 
-  static y_Setter(mthis, __arg_0) native "SVGPathSegCurvetoQuadraticSmoothRel_y_Setter";
-  y_Setter_(mthis, __arg_0) => y_Setter(mthis, __arg_0);
+  y_Setter_(mthis, __arg_0) => mthis["y"] = __arg_0;
 
 }
 
 class BlinkSVGPathSegLinetoAbs extends BlinkSVGPathSeg {
   static final instance = new BlinkSVGPathSegLinetoAbs();
 
-  static x_Getter(mthis) native "SVGPathSegLinetoAbs_x_Getter";
-  x_Getter_(mthis) => x_Getter(mthis);
+  x_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "x");
 
-  static x_Setter(mthis, __arg_0) native "SVGPathSegLinetoAbs_x_Setter";
-  x_Setter_(mthis, __arg_0) => x_Setter(mthis, __arg_0);
+  x_Setter_(mthis, __arg_0) => mthis["x"] = __arg_0;
 
-  static y_Getter(mthis) native "SVGPathSegLinetoAbs_y_Getter";
-  y_Getter_(mthis) => y_Getter(mthis);
+  y_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "y");
 
-  static y_Setter(mthis, __arg_0) native "SVGPathSegLinetoAbs_y_Setter";
-  y_Setter_(mthis, __arg_0) => y_Setter(mthis, __arg_0);
+  y_Setter_(mthis, __arg_0) => mthis["y"] = __arg_0;
 
 }
 
 class BlinkSVGPathSegLinetoHorizontalAbs extends BlinkSVGPathSeg {
   static final instance = new BlinkSVGPathSegLinetoHorizontalAbs();
 
-  static x_Getter(mthis) native "SVGPathSegLinetoHorizontalAbs_x_Getter";
-  x_Getter_(mthis) => x_Getter(mthis);
+  x_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "x");
 
-  static x_Setter(mthis, __arg_0) native "SVGPathSegLinetoHorizontalAbs_x_Setter";
-  x_Setter_(mthis, __arg_0) => x_Setter(mthis, __arg_0);
+  x_Setter_(mthis, __arg_0) => mthis["x"] = __arg_0;
 
 }
 
 class BlinkSVGPathSegLinetoHorizontalRel extends BlinkSVGPathSeg {
   static final instance = new BlinkSVGPathSegLinetoHorizontalRel();
 
-  static x_Getter(mthis) native "SVGPathSegLinetoHorizontalRel_x_Getter";
-  x_Getter_(mthis) => x_Getter(mthis);
+  x_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "x");
 
-  static x_Setter(mthis, __arg_0) native "SVGPathSegLinetoHorizontalRel_x_Setter";
-  x_Setter_(mthis, __arg_0) => x_Setter(mthis, __arg_0);
+  x_Setter_(mthis, __arg_0) => mthis["x"] = __arg_0;
 
 }
 
 class BlinkSVGPathSegLinetoRel extends BlinkSVGPathSeg {
   static final instance = new BlinkSVGPathSegLinetoRel();
 
-  static x_Getter(mthis) native "SVGPathSegLinetoRel_x_Getter";
-  x_Getter_(mthis) => x_Getter(mthis);
+  x_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "x");
 
-  static x_Setter(mthis, __arg_0) native "SVGPathSegLinetoRel_x_Setter";
-  x_Setter_(mthis, __arg_0) => x_Setter(mthis, __arg_0);
+  x_Setter_(mthis, __arg_0) => mthis["x"] = __arg_0;
 
-  static y_Getter(mthis) native "SVGPathSegLinetoRel_y_Getter";
-  y_Getter_(mthis) => y_Getter(mthis);
+  y_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "y");
 
-  static y_Setter(mthis, __arg_0) native "SVGPathSegLinetoRel_y_Setter";
-  y_Setter_(mthis, __arg_0) => y_Setter(mthis, __arg_0);
+  y_Setter_(mthis, __arg_0) => mthis["y"] = __arg_0;
 
 }
 
 class BlinkSVGPathSegLinetoVerticalAbs extends BlinkSVGPathSeg {
   static final instance = new BlinkSVGPathSegLinetoVerticalAbs();
 
-  static y_Getter(mthis) native "SVGPathSegLinetoVerticalAbs_y_Getter";
-  y_Getter_(mthis) => y_Getter(mthis);
+  y_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "y");
 
-  static y_Setter(mthis, __arg_0) native "SVGPathSegLinetoVerticalAbs_y_Setter";
-  y_Setter_(mthis, __arg_0) => y_Setter(mthis, __arg_0);
+  y_Setter_(mthis, __arg_0) => mthis["y"] = __arg_0;
 
 }
 
 class BlinkSVGPathSegLinetoVerticalRel extends BlinkSVGPathSeg {
   static final instance = new BlinkSVGPathSegLinetoVerticalRel();
 
-  static y_Getter(mthis) native "SVGPathSegLinetoVerticalRel_y_Getter";
-  y_Getter_(mthis) => y_Getter(mthis);
+  y_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "y");
 
-  static y_Setter(mthis, __arg_0) native "SVGPathSegLinetoVerticalRel_y_Setter";
-  y_Setter_(mthis, __arg_0) => y_Setter(mthis, __arg_0);
+  y_Setter_(mthis, __arg_0) => mthis["y"] = __arg_0;
 
 }
 
 class BlinkSVGPathSegList {
   static final instance = new BlinkSVGPathSegList();
 
-  static $__getter___Callback_1(mthis, __arg_0) native "SVGPathSegList___getter___Callback";
-  $__getter___Callback_1_(mthis, __arg_0) => $__getter___Callback_1(mthis, __arg_0);
+  $__getter___Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "__getter__", [__arg_0]);
 
-  static $__setter___Callback_2(mthis, __arg_0, __arg_1) native "SVGPathSegList___setter___Callback";
-  $__setter___Callback_2_(mthis, __arg_0, __arg_1) => $__setter___Callback_2(mthis, __arg_0, __arg_1);
+  $__setter___Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "__setter__", [__arg_0, __arg_1]);
 
-  static appendItem_Callback_0(mthis) native "SVGPathSegList_appendItem_Callback";
-  appendItem_Callback_0_(mthis) => appendItem_Callback_0(mthis);
+  appendItem_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "appendItem", []);
 
-  static appendItem_Callback_1(mthis, __arg_0) native "SVGPathSegList_appendItem_Callback";
-  appendItem_Callback_1_(mthis, __arg_0) => appendItem_Callback_1(mthis, __arg_0);
+  appendItem_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "appendItem", [__arg_0]);
 
-  static appendItem_Callback_2(mthis, __arg_0, __arg_1) native "SVGPathSegList_appendItem_Callback";
-  appendItem_Callback_2_(mthis, __arg_0, __arg_1) => appendItem_Callback_2(mthis, __arg_0, __arg_1);
+  clear_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "clear", []);
 
-  static appendItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGPathSegList_appendItem_Callback";
-  appendItem_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => appendItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  getItem_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getItem", []);
 
-  static clear_Callback_0(mthis) native "SVGPathSegList_clear_Callback";
-  clear_Callback_0_(mthis) => clear_Callback_0(mthis);
+  getItem_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getItem", [__arg_0]);
 
-  static clear_Callback_1(mthis, __arg_0) native "SVGPathSegList_clear_Callback";
-  clear_Callback_1_(mthis, __arg_0) => clear_Callback_1(mthis, __arg_0);
+  initialize_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "initialize", []);
 
-  static clear_Callback_2(mthis, __arg_0, __arg_1) native "SVGPathSegList_clear_Callback";
-  clear_Callback_2_(mthis, __arg_0, __arg_1) => clear_Callback_2(mthis, __arg_0, __arg_1);
+  initialize_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "initialize", [__arg_0]);
 
-  static getItem_Callback_0(mthis) native "SVGPathSegList_getItem_Callback";
-  getItem_Callback_0_(mthis) => getItem_Callback_0(mthis);
+  insertItemBefore_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "insertItemBefore", []);
 
-  static getItem_Callback_1(mthis, __arg_0) native "SVGPathSegList_getItem_Callback";
-  getItem_Callback_1_(mthis, __arg_0) => getItem_Callback_1(mthis, __arg_0);
+  insertItemBefore_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "insertItemBefore", [__arg_0]);
 
-  static getItem_Callback_2(mthis, __arg_0, __arg_1) native "SVGPathSegList_getItem_Callback";
-  getItem_Callback_2_(mthis, __arg_0, __arg_1) => getItem_Callback_2(mthis, __arg_0, __arg_1);
+  insertItemBefore_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "insertItemBefore", [__arg_0, __arg_1]);
 
-  static getItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGPathSegList_getItem_Callback";
-  getItem_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  length_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "length");
 
-  static initialize_Callback_0(mthis) native "SVGPathSegList_initialize_Callback";
-  initialize_Callback_0_(mthis) => initialize_Callback_0(mthis);
+  numberOfItems_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "numberOfItems");
 
-  static initialize_Callback_1(mthis, __arg_0) native "SVGPathSegList_initialize_Callback";
-  initialize_Callback_1_(mthis, __arg_0) => initialize_Callback_1(mthis, __arg_0);
+  removeItem_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "removeItem", []);
 
-  static initialize_Callback_2(mthis, __arg_0, __arg_1) native "SVGPathSegList_initialize_Callback";
-  initialize_Callback_2_(mthis, __arg_0, __arg_1) => initialize_Callback_2(mthis, __arg_0, __arg_1);
+  removeItem_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "removeItem", [__arg_0]);
 
-  static initialize_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGPathSegList_initialize_Callback";
-  initialize_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => initialize_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  replaceItem_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "replaceItem", []);
 
-  static insertItemBefore_Callback_0(mthis) native "SVGPathSegList_insertItemBefore_Callback";
-  insertItemBefore_Callback_0_(mthis) => insertItemBefore_Callback_0(mthis);
+  replaceItem_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "replaceItem", [__arg_0]);
 
-  static insertItemBefore_Callback_1(mthis, __arg_0) native "SVGPathSegList_insertItemBefore_Callback";
-  insertItemBefore_Callback_1_(mthis, __arg_0) => insertItemBefore_Callback_1(mthis, __arg_0);
-
-  static insertItemBefore_Callback_2(mthis, __arg_0, __arg_1) native "SVGPathSegList_insertItemBefore_Callback";
-  insertItemBefore_Callback_2_(mthis, __arg_0, __arg_1) => insertItemBefore_Callback_2(mthis, __arg_0, __arg_1);
-
-  static insertItemBefore_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGPathSegList_insertItemBefore_Callback";
-  insertItemBefore_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => insertItemBefore_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static insertItemBefore_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "SVGPathSegList_insertItemBefore_Callback";
-  insertItemBefore_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => insertItemBefore_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static length_Getter(mthis) native "SVGPathSegList_length_Getter";
-  length_Getter_(mthis) => length_Getter(mthis);
-
-  static numberOfItems_Getter(mthis) native "SVGPathSegList_numberOfItems_Getter";
-  numberOfItems_Getter_(mthis) => numberOfItems_Getter(mthis);
-
-  static removeItem_Callback_0(mthis) native "SVGPathSegList_removeItem_Callback";
-  removeItem_Callback_0_(mthis) => removeItem_Callback_0(mthis);
-
-  static removeItem_Callback_1(mthis, __arg_0) native "SVGPathSegList_removeItem_Callback";
-  removeItem_Callback_1_(mthis, __arg_0) => removeItem_Callback_1(mthis, __arg_0);
-
-  static removeItem_Callback_2(mthis, __arg_0, __arg_1) native "SVGPathSegList_removeItem_Callback";
-  removeItem_Callback_2_(mthis, __arg_0, __arg_1) => removeItem_Callback_2(mthis, __arg_0, __arg_1);
-
-  static removeItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGPathSegList_removeItem_Callback";
-  removeItem_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => removeItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static replaceItem_Callback_0(mthis) native "SVGPathSegList_replaceItem_Callback";
-  replaceItem_Callback_0_(mthis) => replaceItem_Callback_0(mthis);
-
-  static replaceItem_Callback_1(mthis, __arg_0) native "SVGPathSegList_replaceItem_Callback";
-  replaceItem_Callback_1_(mthis, __arg_0) => replaceItem_Callback_1(mthis, __arg_0);
-
-  static replaceItem_Callback_2(mthis, __arg_0, __arg_1) native "SVGPathSegList_replaceItem_Callback";
-  replaceItem_Callback_2_(mthis, __arg_0, __arg_1) => replaceItem_Callback_2(mthis, __arg_0, __arg_1);
-
-  static replaceItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGPathSegList_replaceItem_Callback";
-  replaceItem_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => replaceItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static replaceItem_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "SVGPathSegList_replaceItem_Callback";
-  replaceItem_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => replaceItem_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  replaceItem_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "replaceItem", [__arg_0, __arg_1]);
 
 }
 
 class BlinkSVGPathSegMovetoAbs extends BlinkSVGPathSeg {
   static final instance = new BlinkSVGPathSegMovetoAbs();
 
-  static x_Getter(mthis) native "SVGPathSegMovetoAbs_x_Getter";
-  x_Getter_(mthis) => x_Getter(mthis);
+  x_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "x");
 
-  static x_Setter(mthis, __arg_0) native "SVGPathSegMovetoAbs_x_Setter";
-  x_Setter_(mthis, __arg_0) => x_Setter(mthis, __arg_0);
+  x_Setter_(mthis, __arg_0) => mthis["x"] = __arg_0;
 
-  static y_Getter(mthis) native "SVGPathSegMovetoAbs_y_Getter";
-  y_Getter_(mthis) => y_Getter(mthis);
+  y_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "y");
 
-  static y_Setter(mthis, __arg_0) native "SVGPathSegMovetoAbs_y_Setter";
-  y_Setter_(mthis, __arg_0) => y_Setter(mthis, __arg_0);
+  y_Setter_(mthis, __arg_0) => mthis["y"] = __arg_0;
 
 }
 
 class BlinkSVGPathSegMovetoRel extends BlinkSVGPathSeg {
   static final instance = new BlinkSVGPathSegMovetoRel();
 
-  static x_Getter(mthis) native "SVGPathSegMovetoRel_x_Getter";
-  x_Getter_(mthis) => x_Getter(mthis);
+  x_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "x");
 
-  static x_Setter(mthis, __arg_0) native "SVGPathSegMovetoRel_x_Setter";
-  x_Setter_(mthis, __arg_0) => x_Setter(mthis, __arg_0);
+  x_Setter_(mthis, __arg_0) => mthis["x"] = __arg_0;
 
-  static y_Getter(mthis) native "SVGPathSegMovetoRel_y_Getter";
-  y_Getter_(mthis) => y_Getter(mthis);
+  y_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "y");
 
-  static y_Setter(mthis, __arg_0) native "SVGPathSegMovetoRel_y_Setter";
-  y_Setter_(mthis, __arg_0) => y_Setter(mthis, __arg_0);
+  y_Setter_(mthis, __arg_0) => mthis["y"] = __arg_0;
 
 }
 
 class BlinkSVGPatternElement extends BlinkSVGElement {
   static final instance = new BlinkSVGPatternElement();
 
-  static hasExtension_Callback_0(mthis) native "SVGPatternElement_hasExtension_Callback";
-  hasExtension_Callback_0_(mthis) => hasExtension_Callback_0(mthis);
+  hasExtension_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "hasExtension", []);
 
-  static hasExtension_Callback_1(mthis, __arg_0) native "SVGPatternElement_hasExtension_Callback";
-  hasExtension_Callback_1_(mthis, __arg_0) => hasExtension_Callback_1(mthis, __arg_0);
+  hasExtension_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "hasExtension", [__arg_0]);
 
-  static hasExtension_Callback_2(mthis, __arg_0, __arg_1) native "SVGPatternElement_hasExtension_Callback";
-  hasExtension_Callback_2_(mthis, __arg_0, __arg_1) => hasExtension_Callback_2(mthis, __arg_0, __arg_1);
+  height_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "height");
 
-  static hasExtension_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGPatternElement_hasExtension_Callback";
-  hasExtension_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => hasExtension_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  href_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "href");
 
-  static height_Getter(mthis) native "SVGPatternElement_height_Getter";
-  height_Getter_(mthis) => height_Getter(mthis);
+  patternContentUnits_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "patternContentUnits");
 
-  static href_Getter(mthis) native "SVGPatternElement_href_Getter";
-  href_Getter_(mthis) => href_Getter(mthis);
+  patternTransform_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "patternTransform");
 
-  static patternContentUnits_Getter(mthis) native "SVGPatternElement_patternContentUnits_Getter";
-  patternContentUnits_Getter_(mthis) => patternContentUnits_Getter(mthis);
+  patternUnits_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "patternUnits");
 
-  static patternTransform_Getter(mthis) native "SVGPatternElement_patternTransform_Getter";
-  patternTransform_Getter_(mthis) => patternTransform_Getter(mthis);
+  preserveAspectRatio_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "preserveAspectRatio");
 
-  static patternUnits_Getter(mthis) native "SVGPatternElement_patternUnits_Getter";
-  patternUnits_Getter_(mthis) => patternUnits_Getter(mthis);
+  requiredExtensions_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "requiredExtensions");
 
-  static preserveAspectRatio_Getter(mthis) native "SVGPatternElement_preserveAspectRatio_Getter";
-  preserveAspectRatio_Getter_(mthis) => preserveAspectRatio_Getter(mthis);
+  requiredFeatures_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "requiredFeatures");
 
-  static requiredExtensions_Getter(mthis) native "SVGPatternElement_requiredExtensions_Getter";
-  requiredExtensions_Getter_(mthis) => requiredExtensions_Getter(mthis);
+  systemLanguage_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "systemLanguage");
 
-  static requiredFeatures_Getter(mthis) native "SVGPatternElement_requiredFeatures_Getter";
-  requiredFeatures_Getter_(mthis) => requiredFeatures_Getter(mthis);
+  viewBox_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "viewBox");
 
-  static systemLanguage_Getter(mthis) native "SVGPatternElement_systemLanguage_Getter";
-  systemLanguage_Getter_(mthis) => systemLanguage_Getter(mthis);
+  width_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "width");
 
-  static viewBox_Getter(mthis) native "SVGPatternElement_viewBox_Getter";
-  viewBox_Getter_(mthis) => viewBox_Getter(mthis);
+  x_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "x");
 
-  static width_Getter(mthis) native "SVGPatternElement_width_Getter";
-  width_Getter_(mthis) => width_Getter(mthis);
-
-  static x_Getter(mthis) native "SVGPatternElement_x_Getter";
-  x_Getter_(mthis) => x_Getter(mthis);
-
-  static y_Getter(mthis) native "SVGPatternElement_y_Getter";
-  y_Getter_(mthis) => y_Getter(mthis);
+  y_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "y");
 
 }
 
 class BlinkSVGPoint {
   static final instance = new BlinkSVGPoint();
 
-  static matrixTransform_Callback_0(mthis) native "SVGPoint_matrixTransform_Callback";
-  matrixTransform_Callback_0_(mthis) => matrixTransform_Callback_0(mthis);
+  matrixTransform_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "matrixTransform", []);
 
-  static matrixTransform_Callback_1(mthis, __arg_0) native "SVGPoint_matrixTransform_Callback";
-  matrixTransform_Callback_1_(mthis, __arg_0) => matrixTransform_Callback_1(mthis, __arg_0);
+  matrixTransform_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "matrixTransform", [__arg_0]);
 
-  static matrixTransform_Callback_2(mthis, __arg_0, __arg_1) native "SVGPoint_matrixTransform_Callback";
-  matrixTransform_Callback_2_(mthis, __arg_0, __arg_1) => matrixTransform_Callback_2(mthis, __arg_0, __arg_1);
+  x_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "x");
 
-  static matrixTransform_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGPoint_matrixTransform_Callback";
-  matrixTransform_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => matrixTransform_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  x_Setter_(mthis, __arg_0) => mthis["x"] = __arg_0;
 
-  static x_Getter(mthis) native "SVGPoint_x_Getter";
-  x_Getter_(mthis) => x_Getter(mthis);
+  y_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "y");
 
-  static x_Setter(mthis, __arg_0) native "SVGPoint_x_Setter";
-  x_Setter_(mthis, __arg_0) => x_Setter(mthis, __arg_0);
-
-  static y_Getter(mthis) native "SVGPoint_y_Getter";
-  y_Getter_(mthis) => y_Getter(mthis);
-
-  static y_Setter(mthis, __arg_0) native "SVGPoint_y_Setter";
-  y_Setter_(mthis, __arg_0) => y_Setter(mthis, __arg_0);
+  y_Setter_(mthis, __arg_0) => mthis["y"] = __arg_0;
 
 }
 
 class BlinkSVGPointList {
   static final instance = new BlinkSVGPointList();
 
-  static $__getter___Callback_1(mthis, __arg_0) native "SVGPointList___getter___Callback";
-  $__getter___Callback_1_(mthis, __arg_0) => $__getter___Callback_1(mthis, __arg_0);
+  $__getter___Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "__getter__", [__arg_0]);
 
-  static $__setter___Callback_2(mthis, __arg_0, __arg_1) native "SVGPointList___setter___Callback";
-  $__setter___Callback_2_(mthis, __arg_0, __arg_1) => $__setter___Callback_2(mthis, __arg_0, __arg_1);
+  $__setter___Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "__setter__", [__arg_0, __arg_1]);
 
-  static appendItem_Callback_0(mthis) native "SVGPointList_appendItem_Callback";
-  appendItem_Callback_0_(mthis) => appendItem_Callback_0(mthis);
+  appendItem_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "appendItem", []);
 
-  static appendItem_Callback_1(mthis, __arg_0) native "SVGPointList_appendItem_Callback";
-  appendItem_Callback_1_(mthis, __arg_0) => appendItem_Callback_1(mthis, __arg_0);
+  appendItem_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "appendItem", [__arg_0]);
 
-  static appendItem_Callback_2(mthis, __arg_0, __arg_1) native "SVGPointList_appendItem_Callback";
-  appendItem_Callback_2_(mthis, __arg_0, __arg_1) => appendItem_Callback_2(mthis, __arg_0, __arg_1);
+  clear_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "clear", []);
 
-  static appendItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGPointList_appendItem_Callback";
-  appendItem_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => appendItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  getItem_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getItem", []);
 
-  static clear_Callback_0(mthis) native "SVGPointList_clear_Callback";
-  clear_Callback_0_(mthis) => clear_Callback_0(mthis);
+  getItem_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getItem", [__arg_0]);
 
-  static clear_Callback_1(mthis, __arg_0) native "SVGPointList_clear_Callback";
-  clear_Callback_1_(mthis, __arg_0) => clear_Callback_1(mthis, __arg_0);
+  initialize_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "initialize", []);
 
-  static clear_Callback_2(mthis, __arg_0, __arg_1) native "SVGPointList_clear_Callback";
-  clear_Callback_2_(mthis, __arg_0, __arg_1) => clear_Callback_2(mthis, __arg_0, __arg_1);
+  initialize_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "initialize", [__arg_0]);
 
-  static getItem_Callback_0(mthis) native "SVGPointList_getItem_Callback";
-  getItem_Callback_0_(mthis) => getItem_Callback_0(mthis);
+  insertItemBefore_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "insertItemBefore", []);
 
-  static getItem_Callback_1(mthis, __arg_0) native "SVGPointList_getItem_Callback";
-  getItem_Callback_1_(mthis, __arg_0) => getItem_Callback_1(mthis, __arg_0);
+  insertItemBefore_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "insertItemBefore", [__arg_0]);
 
-  static getItem_Callback_2(mthis, __arg_0, __arg_1) native "SVGPointList_getItem_Callback";
-  getItem_Callback_2_(mthis, __arg_0, __arg_1) => getItem_Callback_2(mthis, __arg_0, __arg_1);
+  insertItemBefore_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "insertItemBefore", [__arg_0, __arg_1]);
 
-  static getItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGPointList_getItem_Callback";
-  getItem_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  length_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "length");
 
-  static initialize_Callback_0(mthis) native "SVGPointList_initialize_Callback";
-  initialize_Callback_0_(mthis) => initialize_Callback_0(mthis);
+  numberOfItems_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "numberOfItems");
 
-  static initialize_Callback_1(mthis, __arg_0) native "SVGPointList_initialize_Callback";
-  initialize_Callback_1_(mthis, __arg_0) => initialize_Callback_1(mthis, __arg_0);
+  removeItem_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "removeItem", []);
 
-  static initialize_Callback_2(mthis, __arg_0, __arg_1) native "SVGPointList_initialize_Callback";
-  initialize_Callback_2_(mthis, __arg_0, __arg_1) => initialize_Callback_2(mthis, __arg_0, __arg_1);
+  removeItem_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "removeItem", [__arg_0]);
 
-  static initialize_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGPointList_initialize_Callback";
-  initialize_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => initialize_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  replaceItem_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "replaceItem", []);
 
-  static insertItemBefore_Callback_0(mthis) native "SVGPointList_insertItemBefore_Callback";
-  insertItemBefore_Callback_0_(mthis) => insertItemBefore_Callback_0(mthis);
+  replaceItem_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "replaceItem", [__arg_0]);
 
-  static insertItemBefore_Callback_1(mthis, __arg_0) native "SVGPointList_insertItemBefore_Callback";
-  insertItemBefore_Callback_1_(mthis, __arg_0) => insertItemBefore_Callback_1(mthis, __arg_0);
-
-  static insertItemBefore_Callback_2(mthis, __arg_0, __arg_1) native "SVGPointList_insertItemBefore_Callback";
-  insertItemBefore_Callback_2_(mthis, __arg_0, __arg_1) => insertItemBefore_Callback_2(mthis, __arg_0, __arg_1);
-
-  static insertItemBefore_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGPointList_insertItemBefore_Callback";
-  insertItemBefore_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => insertItemBefore_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static insertItemBefore_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "SVGPointList_insertItemBefore_Callback";
-  insertItemBefore_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => insertItemBefore_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static length_Getter(mthis) native "SVGPointList_length_Getter";
-  length_Getter_(mthis) => length_Getter(mthis);
-
-  static numberOfItems_Getter(mthis) native "SVGPointList_numberOfItems_Getter";
-  numberOfItems_Getter_(mthis) => numberOfItems_Getter(mthis);
-
-  static removeItem_Callback_0(mthis) native "SVGPointList_removeItem_Callback";
-  removeItem_Callback_0_(mthis) => removeItem_Callback_0(mthis);
-
-  static removeItem_Callback_1(mthis, __arg_0) native "SVGPointList_removeItem_Callback";
-  removeItem_Callback_1_(mthis, __arg_0) => removeItem_Callback_1(mthis, __arg_0);
-
-  static removeItem_Callback_2(mthis, __arg_0, __arg_1) native "SVGPointList_removeItem_Callback";
-  removeItem_Callback_2_(mthis, __arg_0, __arg_1) => removeItem_Callback_2(mthis, __arg_0, __arg_1);
-
-  static removeItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGPointList_removeItem_Callback";
-  removeItem_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => removeItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static replaceItem_Callback_0(mthis) native "SVGPointList_replaceItem_Callback";
-  replaceItem_Callback_0_(mthis) => replaceItem_Callback_0(mthis);
-
-  static replaceItem_Callback_1(mthis, __arg_0) native "SVGPointList_replaceItem_Callback";
-  replaceItem_Callback_1_(mthis, __arg_0) => replaceItem_Callback_1(mthis, __arg_0);
-
-  static replaceItem_Callback_2(mthis, __arg_0, __arg_1) native "SVGPointList_replaceItem_Callback";
-  replaceItem_Callback_2_(mthis, __arg_0, __arg_1) => replaceItem_Callback_2(mthis, __arg_0, __arg_1);
-
-  static replaceItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGPointList_replaceItem_Callback";
-  replaceItem_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => replaceItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static replaceItem_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "SVGPointList_replaceItem_Callback";
-  replaceItem_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => replaceItem_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  replaceItem_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "replaceItem", [__arg_0, __arg_1]);
 
 }
 
 class BlinkSVGPolygonElement extends BlinkSVGGeometryElement {
   static final instance = new BlinkSVGPolygonElement();
 
-  static animatedPoints_Getter(mthis) native "SVGPolygonElement_animatedPoints_Getter";
-  animatedPoints_Getter_(mthis) => animatedPoints_Getter(mthis);
+  animatedPoints_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "animatedPoints");
 
-  static points_Getter(mthis) native "SVGPolygonElement_points_Getter";
-  points_Getter_(mthis) => points_Getter(mthis);
+  points_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "points");
 
 }
 
 class BlinkSVGPolylineElement extends BlinkSVGGeometryElement {
   static final instance = new BlinkSVGPolylineElement();
 
-  static animatedPoints_Getter(mthis) native "SVGPolylineElement_animatedPoints_Getter";
-  animatedPoints_Getter_(mthis) => animatedPoints_Getter(mthis);
+  animatedPoints_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "animatedPoints");
 
-  static points_Getter(mthis) native "SVGPolylineElement_points_Getter";
-  points_Getter_(mthis) => points_Getter(mthis);
+  points_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "points");
 
 }
 
 class BlinkSVGPreserveAspectRatio {
   static final instance = new BlinkSVGPreserveAspectRatio();
 
-  static align_Getter(mthis) native "SVGPreserveAspectRatio_align_Getter";
-  align_Getter_(mthis) => align_Getter(mthis);
+  align_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "align");
 
-  static align_Setter(mthis, __arg_0) native "SVGPreserveAspectRatio_align_Setter";
-  align_Setter_(mthis, __arg_0) => align_Setter(mthis, __arg_0);
+  align_Setter_(mthis, __arg_0) => mthis["align"] = __arg_0;
 
-  static meetOrSlice_Getter(mthis) native "SVGPreserveAspectRatio_meetOrSlice_Getter";
-  meetOrSlice_Getter_(mthis) => meetOrSlice_Getter(mthis);
+  meetOrSlice_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "meetOrSlice");
 
-  static meetOrSlice_Setter(mthis, __arg_0) native "SVGPreserveAspectRatio_meetOrSlice_Setter";
-  meetOrSlice_Setter_(mthis, __arg_0) => meetOrSlice_Setter(mthis, __arg_0);
+  meetOrSlice_Setter_(mthis, __arg_0) => mthis["meetOrSlice"] = __arg_0;
 
 }
 
 class BlinkSVGRadialGradientElement extends BlinkSVGGradientElement {
   static final instance = new BlinkSVGRadialGradientElement();
 
-  static cx_Getter(mthis) native "SVGRadialGradientElement_cx_Getter";
-  cx_Getter_(mthis) => cx_Getter(mthis);
+  cx_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "cx");
 
-  static cy_Getter(mthis) native "SVGRadialGradientElement_cy_Getter";
-  cy_Getter_(mthis) => cy_Getter(mthis);
+  cy_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "cy");
 
-  static fr_Getter(mthis) native "SVGRadialGradientElement_fr_Getter";
-  fr_Getter_(mthis) => fr_Getter(mthis);
+  fr_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "fr");
 
-  static fx_Getter(mthis) native "SVGRadialGradientElement_fx_Getter";
-  fx_Getter_(mthis) => fx_Getter(mthis);
+  fx_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "fx");
 
-  static fy_Getter(mthis) native "SVGRadialGradientElement_fy_Getter";
-  fy_Getter_(mthis) => fy_Getter(mthis);
+  fy_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "fy");
 
-  static r_Getter(mthis) native "SVGRadialGradientElement_r_Getter";
-  r_Getter_(mthis) => r_Getter(mthis);
+  r_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "r");
 
 }
 
 class BlinkSVGRect {
   static final instance = new BlinkSVGRect();
 
-  static height_Getter(mthis) native "SVGRect_height_Getter";
-  height_Getter_(mthis) => height_Getter(mthis);
+  height_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "height");
 
-  static height_Setter(mthis, __arg_0) native "SVGRect_height_Setter";
-  height_Setter_(mthis, __arg_0) => height_Setter(mthis, __arg_0);
+  height_Setter_(mthis, __arg_0) => mthis["height"] = __arg_0;
 
-  static width_Getter(mthis) native "SVGRect_width_Getter";
-  width_Getter_(mthis) => width_Getter(mthis);
+  width_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "width");
 
-  static width_Setter(mthis, __arg_0) native "SVGRect_width_Setter";
-  width_Setter_(mthis, __arg_0) => width_Setter(mthis, __arg_0);
+  width_Setter_(mthis, __arg_0) => mthis["width"] = __arg_0;
 
-  static x_Getter(mthis) native "SVGRect_x_Getter";
-  x_Getter_(mthis) => x_Getter(mthis);
+  x_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "x");
 
-  static x_Setter(mthis, __arg_0) native "SVGRect_x_Setter";
-  x_Setter_(mthis, __arg_0) => x_Setter(mthis, __arg_0);
+  x_Setter_(mthis, __arg_0) => mthis["x"] = __arg_0;
 
-  static y_Getter(mthis) native "SVGRect_y_Getter";
-  y_Getter_(mthis) => y_Getter(mthis);
+  y_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "y");
 
-  static y_Setter(mthis, __arg_0) native "SVGRect_y_Setter";
-  y_Setter_(mthis, __arg_0) => y_Setter(mthis, __arg_0);
+  y_Setter_(mthis, __arg_0) => mthis["y"] = __arg_0;
 
 }
 
 class BlinkSVGRectElement extends BlinkSVGGeometryElement {
   static final instance = new BlinkSVGRectElement();
 
-  static height_Getter(mthis) native "SVGRectElement_height_Getter";
-  height_Getter_(mthis) => height_Getter(mthis);
+  height_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "height");
 
-  static rx_Getter(mthis) native "SVGRectElement_rx_Getter";
-  rx_Getter_(mthis) => rx_Getter(mthis);
+  rx_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "rx");
 
-  static ry_Getter(mthis) native "SVGRectElement_ry_Getter";
-  ry_Getter_(mthis) => ry_Getter(mthis);
+  ry_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ry");
 
-  static width_Getter(mthis) native "SVGRectElement_width_Getter";
-  width_Getter_(mthis) => width_Getter(mthis);
+  width_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "width");
 
-  static x_Getter(mthis) native "SVGRectElement_x_Getter";
-  x_Getter_(mthis) => x_Getter(mthis);
+  x_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "x");
 
-  static y_Getter(mthis) native "SVGRectElement_y_Getter";
-  y_Getter_(mthis) => y_Getter(mthis);
+  y_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "y");
 
 }
 
@@ -22805,319 +12748,124 @@
 class BlinkSVGSVGElement extends BlinkSVGGraphicsElement {
   static final instance = new BlinkSVGSVGElement();
 
-  static animationsPaused_Callback_0(mthis) native "SVGSVGElement_animationsPaused_Callback";
-  animationsPaused_Callback_0_(mthis) => animationsPaused_Callback_0(mthis);
+  animationsPaused_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "animationsPaused", []);
 
-  static animationsPaused_Callback_1(mthis, __arg_0) native "SVGSVGElement_animationsPaused_Callback";
-  animationsPaused_Callback_1_(mthis, __arg_0) => animationsPaused_Callback_1(mthis, __arg_0);
+  checkEnclosure_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "checkEnclosure", []);
 
-  static animationsPaused_Callback_2(mthis, __arg_0, __arg_1) native "SVGSVGElement_animationsPaused_Callback";
-  animationsPaused_Callback_2_(mthis, __arg_0, __arg_1) => animationsPaused_Callback_2(mthis, __arg_0, __arg_1);
+  checkEnclosure_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "checkEnclosure", [__arg_0]);
 
-  static checkEnclosure_Callback_0(mthis) native "SVGSVGElement_checkEnclosure_Callback";
-  checkEnclosure_Callback_0_(mthis) => checkEnclosure_Callback_0(mthis);
+  checkEnclosure_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "checkEnclosure", [__arg_0, __arg_1]);
 
-  static checkEnclosure_Callback_1(mthis, __arg_0) native "SVGSVGElement_checkEnclosure_Callback";
-  checkEnclosure_Callback_1_(mthis, __arg_0) => checkEnclosure_Callback_1(mthis, __arg_0);
+  checkIntersection_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "checkIntersection", []);
 
-  static checkEnclosure_Callback_2(mthis, __arg_0, __arg_1) native "SVGSVGElement_checkEnclosure_Callback";
-  checkEnclosure_Callback_2_(mthis, __arg_0, __arg_1) => checkEnclosure_Callback_2(mthis, __arg_0, __arg_1);
+  checkIntersection_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "checkIntersection", [__arg_0]);
 
-  static checkEnclosure_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGSVGElement_checkEnclosure_Callback";
-  checkEnclosure_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => checkEnclosure_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  checkIntersection_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "checkIntersection", [__arg_0, __arg_1]);
 
-  static checkEnclosure_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "SVGSVGElement_checkEnclosure_Callback";
-  checkEnclosure_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => checkEnclosure_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  createSVGAngle_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createSVGAngle", []);
 
-  static checkIntersection_Callback_0(mthis) native "SVGSVGElement_checkIntersection_Callback";
-  checkIntersection_Callback_0_(mthis) => checkIntersection_Callback_0(mthis);
+  createSVGLength_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createSVGLength", []);
 
-  static checkIntersection_Callback_1(mthis, __arg_0) native "SVGSVGElement_checkIntersection_Callback";
-  checkIntersection_Callback_1_(mthis, __arg_0) => checkIntersection_Callback_1(mthis, __arg_0);
+  createSVGMatrix_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createSVGMatrix", []);
 
-  static checkIntersection_Callback_2(mthis, __arg_0, __arg_1) native "SVGSVGElement_checkIntersection_Callback";
-  checkIntersection_Callback_2_(mthis, __arg_0, __arg_1) => checkIntersection_Callback_2(mthis, __arg_0, __arg_1);
+  createSVGNumber_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createSVGNumber", []);
 
-  static checkIntersection_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGSVGElement_checkIntersection_Callback";
-  checkIntersection_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => checkIntersection_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  createSVGPoint_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createSVGPoint", []);
 
-  static checkIntersection_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "SVGSVGElement_checkIntersection_Callback";
-  checkIntersection_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => checkIntersection_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  createSVGRect_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createSVGRect", []);
 
-  static createSVGAngle_Callback_0(mthis) native "SVGSVGElement_createSVGAngle_Callback";
-  createSVGAngle_Callback_0_(mthis) => createSVGAngle_Callback_0(mthis);
+  createSVGTransformFromMatrix_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createSVGTransformFromMatrix", []);
 
-  static createSVGAngle_Callback_1(mthis, __arg_0) native "SVGSVGElement_createSVGAngle_Callback";
-  createSVGAngle_Callback_1_(mthis, __arg_0) => createSVGAngle_Callback_1(mthis, __arg_0);
+  createSVGTransformFromMatrix_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "createSVGTransformFromMatrix", [__arg_0]);
 
-  static createSVGAngle_Callback_2(mthis, __arg_0, __arg_1) native "SVGSVGElement_createSVGAngle_Callback";
-  createSVGAngle_Callback_2_(mthis, __arg_0, __arg_1) => createSVGAngle_Callback_2(mthis, __arg_0, __arg_1);
+  createSVGTransform_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createSVGTransform", []);
 
-  static createSVGLength_Callback_0(mthis) native "SVGSVGElement_createSVGLength_Callback";
-  createSVGLength_Callback_0_(mthis) => createSVGLength_Callback_0(mthis);
+  currentScale_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "currentScale");
 
-  static createSVGLength_Callback_1(mthis, __arg_0) native "SVGSVGElement_createSVGLength_Callback";
-  createSVGLength_Callback_1_(mthis, __arg_0) => createSVGLength_Callback_1(mthis, __arg_0);
+  currentScale_Setter_(mthis, __arg_0) => mthis["currentScale"] = __arg_0;
 
-  static createSVGLength_Callback_2(mthis, __arg_0, __arg_1) native "SVGSVGElement_createSVGLength_Callback";
-  createSVGLength_Callback_2_(mthis, __arg_0, __arg_1) => createSVGLength_Callback_2(mthis, __arg_0, __arg_1);
+  currentTranslate_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "currentTranslate");
 
-  static createSVGMatrix_Callback_0(mthis) native "SVGSVGElement_createSVGMatrix_Callback";
-  createSVGMatrix_Callback_0_(mthis) => createSVGMatrix_Callback_0(mthis);
+  currentView_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "currentView");
 
-  static createSVGMatrix_Callback_1(mthis, __arg_0) native "SVGSVGElement_createSVGMatrix_Callback";
-  createSVGMatrix_Callback_1_(mthis, __arg_0) => createSVGMatrix_Callback_1(mthis, __arg_0);
+  deselectAll_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "deselectAll", []);
 
-  static createSVGMatrix_Callback_2(mthis, __arg_0, __arg_1) native "SVGSVGElement_createSVGMatrix_Callback";
-  createSVGMatrix_Callback_2_(mthis, __arg_0, __arg_1) => createSVGMatrix_Callback_2(mthis, __arg_0, __arg_1);
+  forceRedraw_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "forceRedraw", []);
 
-  static createSVGNumber_Callback_0(mthis) native "SVGSVGElement_createSVGNumber_Callback";
-  createSVGNumber_Callback_0_(mthis) => createSVGNumber_Callback_0(mthis);
+  getCurrentTime_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getCurrentTime", []);
 
-  static createSVGNumber_Callback_1(mthis, __arg_0) native "SVGSVGElement_createSVGNumber_Callback";
-  createSVGNumber_Callback_1_(mthis, __arg_0) => createSVGNumber_Callback_1(mthis, __arg_0);
+  getElementById_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getElementById", []);
 
-  static createSVGNumber_Callback_2(mthis, __arg_0, __arg_1) native "SVGSVGElement_createSVGNumber_Callback";
-  createSVGNumber_Callback_2_(mthis, __arg_0, __arg_1) => createSVGNumber_Callback_2(mthis, __arg_0, __arg_1);
+  getElementById_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getElementById", [__arg_0]);
 
-  static createSVGPoint_Callback_0(mthis) native "SVGSVGElement_createSVGPoint_Callback";
-  createSVGPoint_Callback_0_(mthis) => createSVGPoint_Callback_0(mthis);
+  getEnclosureList_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getEnclosureList", []);
 
-  static createSVGPoint_Callback_1(mthis, __arg_0) native "SVGSVGElement_createSVGPoint_Callback";
-  createSVGPoint_Callback_1_(mthis, __arg_0) => createSVGPoint_Callback_1(mthis, __arg_0);
+  getEnclosureList_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getEnclosureList", [__arg_0]);
 
-  static createSVGPoint_Callback_2(mthis, __arg_0, __arg_1) native "SVGSVGElement_createSVGPoint_Callback";
-  createSVGPoint_Callback_2_(mthis, __arg_0, __arg_1) => createSVGPoint_Callback_2(mthis, __arg_0, __arg_1);
+  getEnclosureList_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "getEnclosureList", [__arg_0, __arg_1]);
 
-  static createSVGRect_Callback_0(mthis) native "SVGSVGElement_createSVGRect_Callback";
-  createSVGRect_Callback_0_(mthis) => createSVGRect_Callback_0(mthis);
+  getIntersectionList_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getIntersectionList", []);
 
-  static createSVGRect_Callback_1(mthis, __arg_0) native "SVGSVGElement_createSVGRect_Callback";
-  createSVGRect_Callback_1_(mthis, __arg_0) => createSVGRect_Callback_1(mthis, __arg_0);
+  getIntersectionList_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getIntersectionList", [__arg_0]);
 
-  static createSVGRect_Callback_2(mthis, __arg_0, __arg_1) native "SVGSVGElement_createSVGRect_Callback";
-  createSVGRect_Callback_2_(mthis, __arg_0, __arg_1) => createSVGRect_Callback_2(mthis, __arg_0, __arg_1);
+  getIntersectionList_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "getIntersectionList", [__arg_0, __arg_1]);
 
-  static createSVGTransformFromMatrix_Callback_0(mthis) native "SVGSVGElement_createSVGTransformFromMatrix_Callback";
-  createSVGTransformFromMatrix_Callback_0_(mthis) => createSVGTransformFromMatrix_Callback_0(mthis);
+  height_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "height");
 
-  static createSVGTransformFromMatrix_Callback_1(mthis, __arg_0) native "SVGSVGElement_createSVGTransformFromMatrix_Callback";
-  createSVGTransformFromMatrix_Callback_1_(mthis, __arg_0) => createSVGTransformFromMatrix_Callback_1(mthis, __arg_0);
+  pauseAnimations_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "pauseAnimations", []);
 
-  static createSVGTransformFromMatrix_Callback_2(mthis, __arg_0, __arg_1) native "SVGSVGElement_createSVGTransformFromMatrix_Callback";
-  createSVGTransformFromMatrix_Callback_2_(mthis, __arg_0, __arg_1) => createSVGTransformFromMatrix_Callback_2(mthis, __arg_0, __arg_1);
+  pixelUnitToMillimeterX_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "pixelUnitToMillimeterX");
 
-  static createSVGTransformFromMatrix_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGSVGElement_createSVGTransformFromMatrix_Callback";
-  createSVGTransformFromMatrix_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => createSVGTransformFromMatrix_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  pixelUnitToMillimeterY_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "pixelUnitToMillimeterY");
 
-  static createSVGTransform_Callback_0(mthis) native "SVGSVGElement_createSVGTransform_Callback";
-  createSVGTransform_Callback_0_(mthis) => createSVGTransform_Callback_0(mthis);
+  preserveAspectRatio_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "preserveAspectRatio");
 
-  static createSVGTransform_Callback_1(mthis, __arg_0) native "SVGSVGElement_createSVGTransform_Callback";
-  createSVGTransform_Callback_1_(mthis, __arg_0) => createSVGTransform_Callback_1(mthis, __arg_0);
+  screenPixelToMillimeterX_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "screenPixelToMillimeterX");
 
-  static createSVGTransform_Callback_2(mthis, __arg_0, __arg_1) native "SVGSVGElement_createSVGTransform_Callback";
-  createSVGTransform_Callback_2_(mthis, __arg_0, __arg_1) => createSVGTransform_Callback_2(mthis, __arg_0, __arg_1);
+  screenPixelToMillimeterY_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "screenPixelToMillimeterY");
 
-  static currentScale_Getter(mthis) native "SVGSVGElement_currentScale_Getter";
-  currentScale_Getter_(mthis) => currentScale_Getter(mthis);
+  setCurrentTime_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "setCurrentTime", []);
 
-  static currentScale_Setter(mthis, __arg_0) native "SVGSVGElement_currentScale_Setter";
-  currentScale_Setter_(mthis, __arg_0) => currentScale_Setter(mthis, __arg_0);
+  setCurrentTime_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "setCurrentTime", [__arg_0]);
 
-  static currentTranslate_Getter(mthis) native "SVGSVGElement_currentTranslate_Getter";
-  currentTranslate_Getter_(mthis) => currentTranslate_Getter(mthis);
+  suspendRedraw_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "suspendRedraw", []);
 
-  static currentView_Getter(mthis) native "SVGSVGElement_currentView_Getter";
-  currentView_Getter_(mthis) => currentView_Getter(mthis);
+  suspendRedraw_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "suspendRedraw", [__arg_0]);
 
-  static deselectAll_Callback_0(mthis) native "SVGSVGElement_deselectAll_Callback";
-  deselectAll_Callback_0_(mthis) => deselectAll_Callback_0(mthis);
+  unpauseAnimations_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "unpauseAnimations", []);
 
-  static deselectAll_Callback_1(mthis, __arg_0) native "SVGSVGElement_deselectAll_Callback";
-  deselectAll_Callback_1_(mthis, __arg_0) => deselectAll_Callback_1(mthis, __arg_0);
+  unsuspendRedrawAll_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "unsuspendRedrawAll", []);
 
-  static deselectAll_Callback_2(mthis, __arg_0, __arg_1) native "SVGSVGElement_deselectAll_Callback";
-  deselectAll_Callback_2_(mthis, __arg_0, __arg_1) => deselectAll_Callback_2(mthis, __arg_0, __arg_1);
+  unsuspendRedraw_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "unsuspendRedraw", []);
 
-  static forceRedraw_Callback_0(mthis) native "SVGSVGElement_forceRedraw_Callback";
-  forceRedraw_Callback_0_(mthis) => forceRedraw_Callback_0(mthis);
+  unsuspendRedraw_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "unsuspendRedraw", [__arg_0]);
 
-  static forceRedraw_Callback_1(mthis, __arg_0) native "SVGSVGElement_forceRedraw_Callback";
-  forceRedraw_Callback_1_(mthis, __arg_0) => forceRedraw_Callback_1(mthis, __arg_0);
+  useCurrentView_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "useCurrentView");
 
-  static forceRedraw_Callback_2(mthis, __arg_0, __arg_1) native "SVGSVGElement_forceRedraw_Callback";
-  forceRedraw_Callback_2_(mthis, __arg_0, __arg_1) => forceRedraw_Callback_2(mthis, __arg_0, __arg_1);
+  viewBox_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "viewBox");
 
-  static getCurrentTime_Callback_0(mthis) native "SVGSVGElement_getCurrentTime_Callback";
-  getCurrentTime_Callback_0_(mthis) => getCurrentTime_Callback_0(mthis);
+  viewport_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "viewport");
 
-  static getCurrentTime_Callback_1(mthis, __arg_0) native "SVGSVGElement_getCurrentTime_Callback";
-  getCurrentTime_Callback_1_(mthis, __arg_0) => getCurrentTime_Callback_1(mthis, __arg_0);
-
-  static getCurrentTime_Callback_2(mthis, __arg_0, __arg_1) native "SVGSVGElement_getCurrentTime_Callback";
-  getCurrentTime_Callback_2_(mthis, __arg_0, __arg_1) => getCurrentTime_Callback_2(mthis, __arg_0, __arg_1);
-
-  static getElementById_Callback_0(mthis) native "SVGSVGElement_getElementById_Callback";
-  getElementById_Callback_0_(mthis) => getElementById_Callback_0(mthis);
-
-  static getElementById_Callback_1(mthis, __arg_0) native "SVGSVGElement_getElementById_Callback";
-  getElementById_Callback_1_(mthis, __arg_0) => getElementById_Callback_1(mthis, __arg_0);
-
-  static getElementById_Callback_2(mthis, __arg_0, __arg_1) native "SVGSVGElement_getElementById_Callback";
-  getElementById_Callback_2_(mthis, __arg_0, __arg_1) => getElementById_Callback_2(mthis, __arg_0, __arg_1);
-
-  static getElementById_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGSVGElement_getElementById_Callback";
-  getElementById_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getElementById_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static getEnclosureList_Callback_0(mthis) native "SVGSVGElement_getEnclosureList_Callback";
-  getEnclosureList_Callback_0_(mthis) => getEnclosureList_Callback_0(mthis);
-
-  static getEnclosureList_Callback_1(mthis, __arg_0) native "SVGSVGElement_getEnclosureList_Callback";
-  getEnclosureList_Callback_1_(mthis, __arg_0) => getEnclosureList_Callback_1(mthis, __arg_0);
-
-  static getEnclosureList_Callback_2(mthis, __arg_0, __arg_1) native "SVGSVGElement_getEnclosureList_Callback";
-  getEnclosureList_Callback_2_(mthis, __arg_0, __arg_1) => getEnclosureList_Callback_2(mthis, __arg_0, __arg_1);
-
-  static getEnclosureList_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGSVGElement_getEnclosureList_Callback";
-  getEnclosureList_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getEnclosureList_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static getEnclosureList_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "SVGSVGElement_getEnclosureList_Callback";
-  getEnclosureList_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => getEnclosureList_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static getIntersectionList_Callback_0(mthis) native "SVGSVGElement_getIntersectionList_Callback";
-  getIntersectionList_Callback_0_(mthis) => getIntersectionList_Callback_0(mthis);
-
-  static getIntersectionList_Callback_1(mthis, __arg_0) native "SVGSVGElement_getIntersectionList_Callback";
-  getIntersectionList_Callback_1_(mthis, __arg_0) => getIntersectionList_Callback_1(mthis, __arg_0);
-
-  static getIntersectionList_Callback_2(mthis, __arg_0, __arg_1) native "SVGSVGElement_getIntersectionList_Callback";
-  getIntersectionList_Callback_2_(mthis, __arg_0, __arg_1) => getIntersectionList_Callback_2(mthis, __arg_0, __arg_1);
-
-  static getIntersectionList_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGSVGElement_getIntersectionList_Callback";
-  getIntersectionList_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getIntersectionList_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static getIntersectionList_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "SVGSVGElement_getIntersectionList_Callback";
-  getIntersectionList_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => getIntersectionList_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static height_Getter(mthis) native "SVGSVGElement_height_Getter";
-  height_Getter_(mthis) => height_Getter(mthis);
-
-  static pauseAnimations_Callback_0(mthis) native "SVGSVGElement_pauseAnimations_Callback";
-  pauseAnimations_Callback_0_(mthis) => pauseAnimations_Callback_0(mthis);
-
-  static pauseAnimations_Callback_1(mthis, __arg_0) native "SVGSVGElement_pauseAnimations_Callback";
-  pauseAnimations_Callback_1_(mthis, __arg_0) => pauseAnimations_Callback_1(mthis, __arg_0);
-
-  static pauseAnimations_Callback_2(mthis, __arg_0, __arg_1) native "SVGSVGElement_pauseAnimations_Callback";
-  pauseAnimations_Callback_2_(mthis, __arg_0, __arg_1) => pauseAnimations_Callback_2(mthis, __arg_0, __arg_1);
-
-  static pixelUnitToMillimeterX_Getter(mthis) native "SVGSVGElement_pixelUnitToMillimeterX_Getter";
-  pixelUnitToMillimeterX_Getter_(mthis) => pixelUnitToMillimeterX_Getter(mthis);
-
-  static pixelUnitToMillimeterY_Getter(mthis) native "SVGSVGElement_pixelUnitToMillimeterY_Getter";
-  pixelUnitToMillimeterY_Getter_(mthis) => pixelUnitToMillimeterY_Getter(mthis);
-
-  static preserveAspectRatio_Getter(mthis) native "SVGSVGElement_preserveAspectRatio_Getter";
-  preserveAspectRatio_Getter_(mthis) => preserveAspectRatio_Getter(mthis);
-
-  static screenPixelToMillimeterX_Getter(mthis) native "SVGSVGElement_screenPixelToMillimeterX_Getter";
-  screenPixelToMillimeterX_Getter_(mthis) => screenPixelToMillimeterX_Getter(mthis);
-
-  static screenPixelToMillimeterY_Getter(mthis) native "SVGSVGElement_screenPixelToMillimeterY_Getter";
-  screenPixelToMillimeterY_Getter_(mthis) => screenPixelToMillimeterY_Getter(mthis);
-
-  static setCurrentTime_Callback_0(mthis) native "SVGSVGElement_setCurrentTime_Callback";
-  setCurrentTime_Callback_0_(mthis) => setCurrentTime_Callback_0(mthis);
-
-  static setCurrentTime_Callback_1(mthis, __arg_0) native "SVGSVGElement_setCurrentTime_Callback";
-  setCurrentTime_Callback_1_(mthis, __arg_0) => setCurrentTime_Callback_1(mthis, __arg_0);
-
-  static setCurrentTime_Callback_2(mthis, __arg_0, __arg_1) native "SVGSVGElement_setCurrentTime_Callback";
-  setCurrentTime_Callback_2_(mthis, __arg_0, __arg_1) => setCurrentTime_Callback_2(mthis, __arg_0, __arg_1);
-
-  static setCurrentTime_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGSVGElement_setCurrentTime_Callback";
-  setCurrentTime_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => setCurrentTime_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static suspendRedraw_Callback_0(mthis) native "SVGSVGElement_suspendRedraw_Callback";
-  suspendRedraw_Callback_0_(mthis) => suspendRedraw_Callback_0(mthis);
-
-  static suspendRedraw_Callback_1(mthis, __arg_0) native "SVGSVGElement_suspendRedraw_Callback";
-  suspendRedraw_Callback_1_(mthis, __arg_0) => suspendRedraw_Callback_1(mthis, __arg_0);
-
-  static suspendRedraw_Callback_2(mthis, __arg_0, __arg_1) native "SVGSVGElement_suspendRedraw_Callback";
-  suspendRedraw_Callback_2_(mthis, __arg_0, __arg_1) => suspendRedraw_Callback_2(mthis, __arg_0, __arg_1);
-
-  static suspendRedraw_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGSVGElement_suspendRedraw_Callback";
-  suspendRedraw_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => suspendRedraw_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static unpauseAnimations_Callback_0(mthis) native "SVGSVGElement_unpauseAnimations_Callback";
-  unpauseAnimations_Callback_0_(mthis) => unpauseAnimations_Callback_0(mthis);
-
-  static unpauseAnimations_Callback_1(mthis, __arg_0) native "SVGSVGElement_unpauseAnimations_Callback";
-  unpauseAnimations_Callback_1_(mthis, __arg_0) => unpauseAnimations_Callback_1(mthis, __arg_0);
-
-  static unpauseAnimations_Callback_2(mthis, __arg_0, __arg_1) native "SVGSVGElement_unpauseAnimations_Callback";
-  unpauseAnimations_Callback_2_(mthis, __arg_0, __arg_1) => unpauseAnimations_Callback_2(mthis, __arg_0, __arg_1);
-
-  static unsuspendRedrawAll_Callback_0(mthis) native "SVGSVGElement_unsuspendRedrawAll_Callback";
-  unsuspendRedrawAll_Callback_0_(mthis) => unsuspendRedrawAll_Callback_0(mthis);
-
-  static unsuspendRedrawAll_Callback_1(mthis, __arg_0) native "SVGSVGElement_unsuspendRedrawAll_Callback";
-  unsuspendRedrawAll_Callback_1_(mthis, __arg_0) => unsuspendRedrawAll_Callback_1(mthis, __arg_0);
-
-  static unsuspendRedrawAll_Callback_2(mthis, __arg_0, __arg_1) native "SVGSVGElement_unsuspendRedrawAll_Callback";
-  unsuspendRedrawAll_Callback_2_(mthis, __arg_0, __arg_1) => unsuspendRedrawAll_Callback_2(mthis, __arg_0, __arg_1);
-
-  static unsuspendRedraw_Callback_0(mthis) native "SVGSVGElement_unsuspendRedraw_Callback";
-  unsuspendRedraw_Callback_0_(mthis) => unsuspendRedraw_Callback_0(mthis);
-
-  static unsuspendRedraw_Callback_1(mthis, __arg_0) native "SVGSVGElement_unsuspendRedraw_Callback";
-  unsuspendRedraw_Callback_1_(mthis, __arg_0) => unsuspendRedraw_Callback_1(mthis, __arg_0);
-
-  static unsuspendRedraw_Callback_2(mthis, __arg_0, __arg_1) native "SVGSVGElement_unsuspendRedraw_Callback";
-  unsuspendRedraw_Callback_2_(mthis, __arg_0, __arg_1) => unsuspendRedraw_Callback_2(mthis, __arg_0, __arg_1);
-
-  static unsuspendRedraw_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGSVGElement_unsuspendRedraw_Callback";
-  unsuspendRedraw_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => unsuspendRedraw_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static useCurrentView_Getter(mthis) native "SVGSVGElement_useCurrentView_Getter";
-  useCurrentView_Getter_(mthis) => useCurrentView_Getter(mthis);
-
-  static viewBox_Getter(mthis) native "SVGSVGElement_viewBox_Getter";
-  viewBox_Getter_(mthis) => viewBox_Getter(mthis);
-
-  static viewport_Getter(mthis) native "SVGSVGElement_viewport_Getter";
-  viewport_Getter_(mthis) => viewport_Getter(mthis);
-
-  static width_Getter(mthis) native "SVGSVGElement_width_Getter";
-  width_Getter_(mthis) => width_Getter(mthis);
+  width_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "width");
 
-  static x_Getter(mthis) native "SVGSVGElement_x_Getter";
-  x_Getter_(mthis) => x_Getter(mthis);
+  x_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "x");
 
-  static y_Getter(mthis) native "SVGSVGElement_y_Getter";
-  y_Getter_(mthis) => y_Getter(mthis);
+  y_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "y");
 
-  static zoomAndPan_Getter(mthis) native "SVGSVGElement_zoomAndPan_Getter";
-  zoomAndPan_Getter_(mthis) => zoomAndPan_Getter(mthis);
+  zoomAndPan_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "zoomAndPan");
 
-  static zoomAndPan_Setter(mthis, __arg_0) native "SVGSVGElement_zoomAndPan_Setter";
-  zoomAndPan_Setter_(mthis, __arg_0) => zoomAndPan_Setter(mthis, __arg_0);
+  zoomAndPan_Setter_(mthis, __arg_0) => mthis["zoomAndPan"] = __arg_0;
 
 }
 
 class BlinkSVGScriptElement extends BlinkSVGElement {
   static final instance = new BlinkSVGScriptElement();
 
-  static href_Getter(mthis) native "SVGScriptElement_href_Getter";
-  href_Getter_(mthis) => href_Getter(mthis);
+  href_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "href");
 
-  static type_Getter(mthis) native "SVGScriptElement_type_Getter";
-  type_Getter_(mthis) => type_Getter(mthis);
+  type_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "type");
 
-  static type_Setter(mthis, __arg_0) native "SVGScriptElement_type_Setter";
-  type_Setter_(mthis, __arg_0) => type_Setter(mthis, __arg_0);
+  type_Setter_(mthis, __arg_0) => mthis["type"] = __arg_0;
 
 }
 
@@ -23129,144 +12877,73 @@
 class BlinkSVGStopElement extends BlinkSVGElement {
   static final instance = new BlinkSVGStopElement();
 
-  static offset_Getter(mthis) native "SVGStopElement_offset_Getter";
-  offset_Getter_(mthis) => offset_Getter(mthis);
+  offset_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "offset");
 
 }
 
 class BlinkSVGStringList {
   static final instance = new BlinkSVGStringList();
 
-  static $__getter___Callback_1(mthis, __arg_0) native "SVGStringList___getter___Callback";
-  $__getter___Callback_1_(mthis, __arg_0) => $__getter___Callback_1(mthis, __arg_0);
+  $__getter___Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "__getter__", [__arg_0]);
 
-  static $__setter___Callback_2(mthis, __arg_0, __arg_1) native "SVGStringList___setter___Callback";
-  $__setter___Callback_2_(mthis, __arg_0, __arg_1) => $__setter___Callback_2(mthis, __arg_0, __arg_1);
+  $__setter___Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "__setter__", [__arg_0, __arg_1]);
 
-  static appendItem_Callback_0(mthis) native "SVGStringList_appendItem_Callback";
-  appendItem_Callback_0_(mthis) => appendItem_Callback_0(mthis);
+  appendItem_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "appendItem", []);
 
-  static appendItem_Callback_1(mthis, __arg_0) native "SVGStringList_appendItem_Callback";
-  appendItem_Callback_1_(mthis, __arg_0) => appendItem_Callback_1(mthis, __arg_0);
+  appendItem_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "appendItem", [__arg_0]);
 
-  static appendItem_Callback_2(mthis, __arg_0, __arg_1) native "SVGStringList_appendItem_Callback";
-  appendItem_Callback_2_(mthis, __arg_0, __arg_1) => appendItem_Callback_2(mthis, __arg_0, __arg_1);
+  clear_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "clear", []);
 
-  static appendItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGStringList_appendItem_Callback";
-  appendItem_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => appendItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  getItem_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getItem", []);
 
-  static clear_Callback_0(mthis) native "SVGStringList_clear_Callback";
-  clear_Callback_0_(mthis) => clear_Callback_0(mthis);
+  getItem_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getItem", [__arg_0]);
 
-  static clear_Callback_1(mthis, __arg_0) native "SVGStringList_clear_Callback";
-  clear_Callback_1_(mthis, __arg_0) => clear_Callback_1(mthis, __arg_0);
+  initialize_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "initialize", []);
 
-  static clear_Callback_2(mthis, __arg_0, __arg_1) native "SVGStringList_clear_Callback";
-  clear_Callback_2_(mthis, __arg_0, __arg_1) => clear_Callback_2(mthis, __arg_0, __arg_1);
+  initialize_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "initialize", [__arg_0]);
 
-  static getItem_Callback_0(mthis) native "SVGStringList_getItem_Callback";
-  getItem_Callback_0_(mthis) => getItem_Callback_0(mthis);
+  insertItemBefore_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "insertItemBefore", []);
 
-  static getItem_Callback_1(mthis, __arg_0) native "SVGStringList_getItem_Callback";
-  getItem_Callback_1_(mthis, __arg_0) => getItem_Callback_1(mthis, __arg_0);
+  insertItemBefore_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "insertItemBefore", [__arg_0]);
 
-  static getItem_Callback_2(mthis, __arg_0, __arg_1) native "SVGStringList_getItem_Callback";
-  getItem_Callback_2_(mthis, __arg_0, __arg_1) => getItem_Callback_2(mthis, __arg_0, __arg_1);
+  insertItemBefore_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "insertItemBefore", [__arg_0, __arg_1]);
 
-  static getItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGStringList_getItem_Callback";
-  getItem_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  length_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "length");
 
-  static initialize_Callback_0(mthis) native "SVGStringList_initialize_Callback";
-  initialize_Callback_0_(mthis) => initialize_Callback_0(mthis);
+  numberOfItems_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "numberOfItems");
 
-  static initialize_Callback_1(mthis, __arg_0) native "SVGStringList_initialize_Callback";
-  initialize_Callback_1_(mthis, __arg_0) => initialize_Callback_1(mthis, __arg_0);
+  removeItem_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "removeItem", []);
 
-  static initialize_Callback_2(mthis, __arg_0, __arg_1) native "SVGStringList_initialize_Callback";
-  initialize_Callback_2_(mthis, __arg_0, __arg_1) => initialize_Callback_2(mthis, __arg_0, __arg_1);
+  removeItem_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "removeItem", [__arg_0]);
 
-  static initialize_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGStringList_initialize_Callback";
-  initialize_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => initialize_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  replaceItem_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "replaceItem", []);
 
-  static insertItemBefore_Callback_0(mthis) native "SVGStringList_insertItemBefore_Callback";
-  insertItemBefore_Callback_0_(mthis) => insertItemBefore_Callback_0(mthis);
+  replaceItem_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "replaceItem", [__arg_0]);
 
-  static insertItemBefore_Callback_1(mthis, __arg_0) native "SVGStringList_insertItemBefore_Callback";
-  insertItemBefore_Callback_1_(mthis, __arg_0) => insertItemBefore_Callback_1(mthis, __arg_0);
-
-  static insertItemBefore_Callback_2(mthis, __arg_0, __arg_1) native "SVGStringList_insertItemBefore_Callback";
-  insertItemBefore_Callback_2_(mthis, __arg_0, __arg_1) => insertItemBefore_Callback_2(mthis, __arg_0, __arg_1);
-
-  static insertItemBefore_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGStringList_insertItemBefore_Callback";
-  insertItemBefore_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => insertItemBefore_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static insertItemBefore_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "SVGStringList_insertItemBefore_Callback";
-  insertItemBefore_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => insertItemBefore_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static length_Getter(mthis) native "SVGStringList_length_Getter";
-  length_Getter_(mthis) => length_Getter(mthis);
-
-  static numberOfItems_Getter(mthis) native "SVGStringList_numberOfItems_Getter";
-  numberOfItems_Getter_(mthis) => numberOfItems_Getter(mthis);
-
-  static removeItem_Callback_0(mthis) native "SVGStringList_removeItem_Callback";
-  removeItem_Callback_0_(mthis) => removeItem_Callback_0(mthis);
-
-  static removeItem_Callback_1(mthis, __arg_0) native "SVGStringList_removeItem_Callback";
-  removeItem_Callback_1_(mthis, __arg_0) => removeItem_Callback_1(mthis, __arg_0);
-
-  static removeItem_Callback_2(mthis, __arg_0, __arg_1) native "SVGStringList_removeItem_Callback";
-  removeItem_Callback_2_(mthis, __arg_0, __arg_1) => removeItem_Callback_2(mthis, __arg_0, __arg_1);
-
-  static removeItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGStringList_removeItem_Callback";
-  removeItem_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => removeItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static replaceItem_Callback_0(mthis) native "SVGStringList_replaceItem_Callback";
-  replaceItem_Callback_0_(mthis) => replaceItem_Callback_0(mthis);
-
-  static replaceItem_Callback_1(mthis, __arg_0) native "SVGStringList_replaceItem_Callback";
-  replaceItem_Callback_1_(mthis, __arg_0) => replaceItem_Callback_1(mthis, __arg_0);
-
-  static replaceItem_Callback_2(mthis, __arg_0, __arg_1) native "SVGStringList_replaceItem_Callback";
-  replaceItem_Callback_2_(mthis, __arg_0, __arg_1) => replaceItem_Callback_2(mthis, __arg_0, __arg_1);
-
-  static replaceItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGStringList_replaceItem_Callback";
-  replaceItem_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => replaceItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static replaceItem_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "SVGStringList_replaceItem_Callback";
-  replaceItem_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => replaceItem_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  replaceItem_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "replaceItem", [__arg_0, __arg_1]);
 
 }
 
 class BlinkSVGStyleElement extends BlinkSVGElement {
   static final instance = new BlinkSVGStyleElement();
 
-  static disabled_Getter(mthis) native "SVGStyleElement_disabled_Getter";
-  disabled_Getter_(mthis) => disabled_Getter(mthis);
+  disabled_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "disabled");
 
-  static disabled_Setter(mthis, __arg_0) native "SVGStyleElement_disabled_Setter";
-  disabled_Setter_(mthis, __arg_0) => disabled_Setter(mthis, __arg_0);
+  disabled_Setter_(mthis, __arg_0) => mthis["disabled"] = __arg_0;
 
-  static media_Getter(mthis) native "SVGStyleElement_media_Getter";
-  media_Getter_(mthis) => media_Getter(mthis);
+  media_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "media");
 
-  static media_Setter(mthis, __arg_0) native "SVGStyleElement_media_Setter";
-  media_Setter_(mthis, __arg_0) => media_Setter(mthis, __arg_0);
+  media_Setter_(mthis, __arg_0) => mthis["media"] = __arg_0;
 
-  static sheet_Getter(mthis) native "SVGStyleElement_sheet_Getter";
-  sheet_Getter_(mthis) => sheet_Getter(mthis);
+  sheet_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "sheet");
 
-  static title_Getter(mthis) native "SVGStyleElement_title_Getter";
-  title_Getter_(mthis) => title_Getter(mthis);
+  title_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "title");
 
-  static title_Setter(mthis, __arg_0) native "SVGStyleElement_title_Setter";
-  title_Setter_(mthis, __arg_0) => title_Setter(mthis, __arg_0);
+  title_Setter_(mthis, __arg_0) => mthis["title"] = __arg_0;
 
-  static type_Getter(mthis) native "SVGStyleElement_type_Getter";
-  type_Getter_(mthis) => type_Getter(mthis);
+  type_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "type");
 
-  static type_Setter(mthis, __arg_0) native "SVGStyleElement_type_Setter";
-  type_Setter_(mthis, __arg_0) => type_Setter(mthis, __arg_0);
+  type_Setter_(mthis, __arg_0) => mthis["type"] = __arg_0;
 
 }
 
@@ -23278,11 +12955,9 @@
 class BlinkSVGSymbolElement extends BlinkSVGElement {
   static final instance = new BlinkSVGSymbolElement();
 
-  static preserveAspectRatio_Getter(mthis) native "SVGSymbolElement_preserveAspectRatio_Getter";
-  preserveAspectRatio_Getter_(mthis) => preserveAspectRatio_Getter(mthis);
+  preserveAspectRatio_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "preserveAspectRatio");
 
-  static viewBox_Getter(mthis) native "SVGSymbolElement_viewBox_Getter";
-  viewBox_Getter_(mthis) => viewBox_Getter(mthis);
+  viewBox_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "viewBox");
 
 }
 
@@ -23294,119 +12969,45 @@
 class BlinkSVGTextContentElement extends BlinkSVGGraphicsElement {
   static final instance = new BlinkSVGTextContentElement();
 
-  static getCharNumAtPosition_Callback_0(mthis) native "SVGTextContentElement_getCharNumAtPosition_Callback";
-  getCharNumAtPosition_Callback_0_(mthis) => getCharNumAtPosition_Callback_0(mthis);
+  getCharNumAtPosition_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getCharNumAtPosition", []);
 
-  static getCharNumAtPosition_Callback_1(mthis, __arg_0) native "SVGTextContentElement_getCharNumAtPosition_Callback";
-  getCharNumAtPosition_Callback_1_(mthis, __arg_0) => getCharNumAtPosition_Callback_1(mthis, __arg_0);
+  getCharNumAtPosition_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getCharNumAtPosition", [__arg_0]);
 
-  static getCharNumAtPosition_Callback_2(mthis, __arg_0, __arg_1) native "SVGTextContentElement_getCharNumAtPosition_Callback";
-  getCharNumAtPosition_Callback_2_(mthis, __arg_0, __arg_1) => getCharNumAtPosition_Callback_2(mthis, __arg_0, __arg_1);
+  getComputedTextLength_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getComputedTextLength", []);
 
-  static getCharNumAtPosition_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGTextContentElement_getCharNumAtPosition_Callback";
-  getCharNumAtPosition_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getCharNumAtPosition_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  getEndPositionOfChar_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getEndPositionOfChar", []);
 
-  static getComputedTextLength_Callback_0(mthis) native "SVGTextContentElement_getComputedTextLength_Callback";
-  getComputedTextLength_Callback_0_(mthis) => getComputedTextLength_Callback_0(mthis);
+  getEndPositionOfChar_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getEndPositionOfChar", [__arg_0]);
 
-  static getComputedTextLength_Callback_1(mthis, __arg_0) native "SVGTextContentElement_getComputedTextLength_Callback";
-  getComputedTextLength_Callback_1_(mthis, __arg_0) => getComputedTextLength_Callback_1(mthis, __arg_0);
+  getExtentOfChar_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getExtentOfChar", []);
 
-  static getComputedTextLength_Callback_2(mthis, __arg_0, __arg_1) native "SVGTextContentElement_getComputedTextLength_Callback";
-  getComputedTextLength_Callback_2_(mthis, __arg_0, __arg_1) => getComputedTextLength_Callback_2(mthis, __arg_0, __arg_1);
+  getExtentOfChar_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getExtentOfChar", [__arg_0]);
 
-  static getEndPositionOfChar_Callback_0(mthis) native "SVGTextContentElement_getEndPositionOfChar_Callback";
-  getEndPositionOfChar_Callback_0_(mthis) => getEndPositionOfChar_Callback_0(mthis);
+  getNumberOfChars_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getNumberOfChars", []);
 
-  static getEndPositionOfChar_Callback_1(mthis, __arg_0) native "SVGTextContentElement_getEndPositionOfChar_Callback";
-  getEndPositionOfChar_Callback_1_(mthis, __arg_0) => getEndPositionOfChar_Callback_1(mthis, __arg_0);
+  getRotationOfChar_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getRotationOfChar", []);
 
-  static getEndPositionOfChar_Callback_2(mthis, __arg_0, __arg_1) native "SVGTextContentElement_getEndPositionOfChar_Callback";
-  getEndPositionOfChar_Callback_2_(mthis, __arg_0, __arg_1) => getEndPositionOfChar_Callback_2(mthis, __arg_0, __arg_1);
+  getRotationOfChar_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getRotationOfChar", [__arg_0]);
 
-  static getEndPositionOfChar_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGTextContentElement_getEndPositionOfChar_Callback";
-  getEndPositionOfChar_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getEndPositionOfChar_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  getStartPositionOfChar_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getStartPositionOfChar", []);
 
-  static getExtentOfChar_Callback_0(mthis) native "SVGTextContentElement_getExtentOfChar_Callback";
-  getExtentOfChar_Callback_0_(mthis) => getExtentOfChar_Callback_0(mthis);
+  getStartPositionOfChar_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getStartPositionOfChar", [__arg_0]);
 
-  static getExtentOfChar_Callback_1(mthis, __arg_0) native "SVGTextContentElement_getExtentOfChar_Callback";
-  getExtentOfChar_Callback_1_(mthis, __arg_0) => getExtentOfChar_Callback_1(mthis, __arg_0);
+  getSubStringLength_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getSubStringLength", []);
 
-  static getExtentOfChar_Callback_2(mthis, __arg_0, __arg_1) native "SVGTextContentElement_getExtentOfChar_Callback";
-  getExtentOfChar_Callback_2_(mthis, __arg_0, __arg_1) => getExtentOfChar_Callback_2(mthis, __arg_0, __arg_1);
+  getSubStringLength_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getSubStringLength", [__arg_0]);
 
-  static getExtentOfChar_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGTextContentElement_getExtentOfChar_Callback";
-  getExtentOfChar_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getExtentOfChar_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  getSubStringLength_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "getSubStringLength", [__arg_0, __arg_1]);
 
-  static getNumberOfChars_Callback_0(mthis) native "SVGTextContentElement_getNumberOfChars_Callback";
-  getNumberOfChars_Callback_0_(mthis) => getNumberOfChars_Callback_0(mthis);
+  lengthAdjust_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "lengthAdjust");
 
-  static getNumberOfChars_Callback_1(mthis, __arg_0) native "SVGTextContentElement_getNumberOfChars_Callback";
-  getNumberOfChars_Callback_1_(mthis, __arg_0) => getNumberOfChars_Callback_1(mthis, __arg_0);
+  selectSubString_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "selectSubString", []);
 
-  static getNumberOfChars_Callback_2(mthis, __arg_0, __arg_1) native "SVGTextContentElement_getNumberOfChars_Callback";
-  getNumberOfChars_Callback_2_(mthis, __arg_0, __arg_1) => getNumberOfChars_Callback_2(mthis, __arg_0, __arg_1);
+  selectSubString_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "selectSubString", [__arg_0]);
 
-  static getRotationOfChar_Callback_0(mthis) native "SVGTextContentElement_getRotationOfChar_Callback";
-  getRotationOfChar_Callback_0_(mthis) => getRotationOfChar_Callback_0(mthis);
+  selectSubString_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "selectSubString", [__arg_0, __arg_1]);
 
-  static getRotationOfChar_Callback_1(mthis, __arg_0) native "SVGTextContentElement_getRotationOfChar_Callback";
-  getRotationOfChar_Callback_1_(mthis, __arg_0) => getRotationOfChar_Callback_1(mthis, __arg_0);
-
-  static getRotationOfChar_Callback_2(mthis, __arg_0, __arg_1) native "SVGTextContentElement_getRotationOfChar_Callback";
-  getRotationOfChar_Callback_2_(mthis, __arg_0, __arg_1) => getRotationOfChar_Callback_2(mthis, __arg_0, __arg_1);
-
-  static getRotationOfChar_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGTextContentElement_getRotationOfChar_Callback";
-  getRotationOfChar_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getRotationOfChar_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static getStartPositionOfChar_Callback_0(mthis) native "SVGTextContentElement_getStartPositionOfChar_Callback";
-  getStartPositionOfChar_Callback_0_(mthis) => getStartPositionOfChar_Callback_0(mthis);
-
-  static getStartPositionOfChar_Callback_1(mthis, __arg_0) native "SVGTextContentElement_getStartPositionOfChar_Callback";
-  getStartPositionOfChar_Callback_1_(mthis, __arg_0) => getStartPositionOfChar_Callback_1(mthis, __arg_0);
-
-  static getStartPositionOfChar_Callback_2(mthis, __arg_0, __arg_1) native "SVGTextContentElement_getStartPositionOfChar_Callback";
-  getStartPositionOfChar_Callback_2_(mthis, __arg_0, __arg_1) => getStartPositionOfChar_Callback_2(mthis, __arg_0, __arg_1);
-
-  static getStartPositionOfChar_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGTextContentElement_getStartPositionOfChar_Callback";
-  getStartPositionOfChar_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getStartPositionOfChar_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static getSubStringLength_Callback_0(mthis) native "SVGTextContentElement_getSubStringLength_Callback";
-  getSubStringLength_Callback_0_(mthis) => getSubStringLength_Callback_0(mthis);
-
-  static getSubStringLength_Callback_1(mthis, __arg_0) native "SVGTextContentElement_getSubStringLength_Callback";
-  getSubStringLength_Callback_1_(mthis, __arg_0) => getSubStringLength_Callback_1(mthis, __arg_0);
-
-  static getSubStringLength_Callback_2(mthis, __arg_0, __arg_1) native "SVGTextContentElement_getSubStringLength_Callback";
-  getSubStringLength_Callback_2_(mthis, __arg_0, __arg_1) => getSubStringLength_Callback_2(mthis, __arg_0, __arg_1);
-
-  static getSubStringLength_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGTextContentElement_getSubStringLength_Callback";
-  getSubStringLength_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getSubStringLength_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static getSubStringLength_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "SVGTextContentElement_getSubStringLength_Callback";
-  getSubStringLength_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => getSubStringLength_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static lengthAdjust_Getter(mthis) native "SVGTextContentElement_lengthAdjust_Getter";
-  lengthAdjust_Getter_(mthis) => lengthAdjust_Getter(mthis);
-
-  static selectSubString_Callback_0(mthis) native "SVGTextContentElement_selectSubString_Callback";
-  selectSubString_Callback_0_(mthis) => selectSubString_Callback_0(mthis);
-
-  static selectSubString_Callback_1(mthis, __arg_0) native "SVGTextContentElement_selectSubString_Callback";
-  selectSubString_Callback_1_(mthis, __arg_0) => selectSubString_Callback_1(mthis, __arg_0);
-
-  static selectSubString_Callback_2(mthis, __arg_0, __arg_1) native "SVGTextContentElement_selectSubString_Callback";
-  selectSubString_Callback_2_(mthis, __arg_0, __arg_1) => selectSubString_Callback_2(mthis, __arg_0, __arg_1);
-
-  static selectSubString_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGTextContentElement_selectSubString_Callback";
-  selectSubString_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => selectSubString_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static selectSubString_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "SVGTextContentElement_selectSubString_Callback";
-  selectSubString_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => selectSubString_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static textLength_Getter(mthis) native "SVGTextContentElement_textLength_Getter";
-  textLength_Getter_(mthis) => textLength_Getter(mthis);
+  textLength_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "textLength");
 
 }
 
@@ -23418,37 +13019,28 @@
 class BlinkSVGTextPathElement extends BlinkSVGTextContentElement {
   static final instance = new BlinkSVGTextPathElement();
 
-  static href_Getter(mthis) native "SVGTextPathElement_href_Getter";
-  href_Getter_(mthis) => href_Getter(mthis);
+  href_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "href");
 
-  static method_Getter(mthis) native "SVGTextPathElement_method_Getter";
-  method_Getter_(mthis) => method_Getter(mthis);
+  method_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "method");
 
-  static spacing_Getter(mthis) native "SVGTextPathElement_spacing_Getter";
-  spacing_Getter_(mthis) => spacing_Getter(mthis);
+  spacing_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "spacing");
 
-  static startOffset_Getter(mthis) native "SVGTextPathElement_startOffset_Getter";
-  startOffset_Getter_(mthis) => startOffset_Getter(mthis);
+  startOffset_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "startOffset");
 
 }
 
 class BlinkSVGTextPositioningElement extends BlinkSVGTextContentElement {
   static final instance = new BlinkSVGTextPositioningElement();
 
-  static dx_Getter(mthis) native "SVGTextPositioningElement_dx_Getter";
-  dx_Getter_(mthis) => dx_Getter(mthis);
+  dx_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "dx");
 
-  static dy_Getter(mthis) native "SVGTextPositioningElement_dy_Getter";
-  dy_Getter_(mthis) => dy_Getter(mthis);
+  dy_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "dy");
 
-  static rotate_Getter(mthis) native "SVGTextPositioningElement_rotate_Getter";
-  rotate_Getter_(mthis) => rotate_Getter(mthis);
+  rotate_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "rotate");
 
-  static x_Getter(mthis) native "SVGTextPositioningElement_x_Getter";
-  x_Getter_(mthis) => x_Getter(mthis);
+  x_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "x");
 
-  static y_Getter(mthis) native "SVGTextPositioningElement_y_Getter";
-  y_Getter_(mthis) => y_Getter(mthis);
+  y_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "y");
 
 }
 
@@ -23460,220 +13052,90 @@
 class BlinkSVGTransform {
   static final instance = new BlinkSVGTransform();
 
-  static angle_Getter(mthis) native "SVGTransform_angle_Getter";
-  angle_Getter_(mthis) => angle_Getter(mthis);
+  angle_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "angle");
 
-  static matrix_Getter(mthis) native "SVGTransform_matrix_Getter";
-  matrix_Getter_(mthis) => matrix_Getter(mthis);
+  matrix_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "matrix");
 
-  static setMatrix_Callback_0(mthis) native "SVGTransform_setMatrix_Callback";
-  setMatrix_Callback_0_(mthis) => setMatrix_Callback_0(mthis);
+  setMatrix_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "setMatrix", []);
 
-  static setMatrix_Callback_1(mthis, __arg_0) native "SVGTransform_setMatrix_Callback";
-  setMatrix_Callback_1_(mthis, __arg_0) => setMatrix_Callback_1(mthis, __arg_0);
+  setMatrix_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "setMatrix", [__arg_0]);
 
-  static setMatrix_Callback_2(mthis, __arg_0, __arg_1) native "SVGTransform_setMatrix_Callback";
-  setMatrix_Callback_2_(mthis, __arg_0, __arg_1) => setMatrix_Callback_2(mthis, __arg_0, __arg_1);
+  setRotate_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "setRotate", [__arg_0]);
 
-  static setMatrix_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGTransform_setMatrix_Callback";
-  setMatrix_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => setMatrix_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  setRotate_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "setRotate", [__arg_0, __arg_1]);
 
-  static setRotate_Callback_1(mthis, __arg_0) native "SVGTransform_setRotate_Callback";
-  setRotate_Callback_1_(mthis, __arg_0) => setRotate_Callback_1(mthis, __arg_0);
+  setRotate_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "setRotate", [__arg_0, __arg_1, __arg_2]);
 
-  static setRotate_Callback_2(mthis, __arg_0, __arg_1) native "SVGTransform_setRotate_Callback";
-  setRotate_Callback_2_(mthis, __arg_0, __arg_1) => setRotate_Callback_2(mthis, __arg_0, __arg_1);
+  setScale_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "setScale", []);
 
-  static setRotate_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGTransform_setRotate_Callback";
-  setRotate_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => setRotate_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  setScale_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "setScale", [__arg_0]);
 
-  static setRotate_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "SVGTransform_setRotate_Callback";
-  setRotate_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => setRotate_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  setScale_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "setScale", [__arg_0, __arg_1]);
 
-  static setRotate_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "SVGTransform_setRotate_Callback";
-  setRotate_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => setRotate_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  setSkewX_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "setSkewX", []);
 
-  static setScale_Callback_0(mthis) native "SVGTransform_setScale_Callback";
-  setScale_Callback_0_(mthis) => setScale_Callback_0(mthis);
+  setSkewX_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "setSkewX", [__arg_0]);
 
-  static setScale_Callback_1(mthis, __arg_0) native "SVGTransform_setScale_Callback";
-  setScale_Callback_1_(mthis, __arg_0) => setScale_Callback_1(mthis, __arg_0);
+  setSkewY_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "setSkewY", []);
 
-  static setScale_Callback_2(mthis, __arg_0, __arg_1) native "SVGTransform_setScale_Callback";
-  setScale_Callback_2_(mthis, __arg_0, __arg_1) => setScale_Callback_2(mthis, __arg_0, __arg_1);
+  setSkewY_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "setSkewY", [__arg_0]);
 
-  static setScale_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGTransform_setScale_Callback";
-  setScale_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => setScale_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  setTranslate_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "setTranslate", []);
 
-  static setScale_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "SVGTransform_setScale_Callback";
-  setScale_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => setScale_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  setTranslate_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "setTranslate", [__arg_0]);
 
-  static setSkewX_Callback_0(mthis) native "SVGTransform_setSkewX_Callback";
-  setSkewX_Callback_0_(mthis) => setSkewX_Callback_0(mthis);
+  setTranslate_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "setTranslate", [__arg_0, __arg_1]);
 
-  static setSkewX_Callback_1(mthis, __arg_0) native "SVGTransform_setSkewX_Callback";
-  setSkewX_Callback_1_(mthis, __arg_0) => setSkewX_Callback_1(mthis, __arg_0);
-
-  static setSkewX_Callback_2(mthis, __arg_0, __arg_1) native "SVGTransform_setSkewX_Callback";
-  setSkewX_Callback_2_(mthis, __arg_0, __arg_1) => setSkewX_Callback_2(mthis, __arg_0, __arg_1);
-
-  static setSkewX_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGTransform_setSkewX_Callback";
-  setSkewX_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => setSkewX_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static setSkewY_Callback_0(mthis) native "SVGTransform_setSkewY_Callback";
-  setSkewY_Callback_0_(mthis) => setSkewY_Callback_0(mthis);
-
-  static setSkewY_Callback_1(mthis, __arg_0) native "SVGTransform_setSkewY_Callback";
-  setSkewY_Callback_1_(mthis, __arg_0) => setSkewY_Callback_1(mthis, __arg_0);
-
-  static setSkewY_Callback_2(mthis, __arg_0, __arg_1) native "SVGTransform_setSkewY_Callback";
-  setSkewY_Callback_2_(mthis, __arg_0, __arg_1) => setSkewY_Callback_2(mthis, __arg_0, __arg_1);
-
-  static setSkewY_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGTransform_setSkewY_Callback";
-  setSkewY_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => setSkewY_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static setTranslate_Callback_0(mthis) native "SVGTransform_setTranslate_Callback";
-  setTranslate_Callback_0_(mthis) => setTranslate_Callback_0(mthis);
-
-  static setTranslate_Callback_1(mthis, __arg_0) native "SVGTransform_setTranslate_Callback";
-  setTranslate_Callback_1_(mthis, __arg_0) => setTranslate_Callback_1(mthis, __arg_0);
-
-  static setTranslate_Callback_2(mthis, __arg_0, __arg_1) native "SVGTransform_setTranslate_Callback";
-  setTranslate_Callback_2_(mthis, __arg_0, __arg_1) => setTranslate_Callback_2(mthis, __arg_0, __arg_1);
-
-  static setTranslate_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGTransform_setTranslate_Callback";
-  setTranslate_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => setTranslate_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static setTranslate_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "SVGTransform_setTranslate_Callback";
-  setTranslate_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => setTranslate_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static type_Getter(mthis) native "SVGTransform_type_Getter";
-  type_Getter_(mthis) => type_Getter(mthis);
+  type_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "type");
 
 }
 
 class BlinkSVGTransformList {
   static final instance = new BlinkSVGTransformList();
 
-  static $__getter___Callback_1(mthis, __arg_0) native "SVGTransformList___getter___Callback";
-  $__getter___Callback_1_(mthis, __arg_0) => $__getter___Callback_1(mthis, __arg_0);
+  $__getter___Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "__getter__", [__arg_0]);
 
-  static $__setter___Callback_2(mthis, __arg_0, __arg_1) native "SVGTransformList___setter___Callback";
-  $__setter___Callback_2_(mthis, __arg_0, __arg_1) => $__setter___Callback_2(mthis, __arg_0, __arg_1);
+  $__setter___Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "__setter__", [__arg_0, __arg_1]);
 
-  static appendItem_Callback_0(mthis) native "SVGTransformList_appendItem_Callback";
-  appendItem_Callback_0_(mthis) => appendItem_Callback_0(mthis);
+  appendItem_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "appendItem", []);
 
-  static appendItem_Callback_1(mthis, __arg_0) native "SVGTransformList_appendItem_Callback";
-  appendItem_Callback_1_(mthis, __arg_0) => appendItem_Callback_1(mthis, __arg_0);
+  appendItem_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "appendItem", [__arg_0]);
 
-  static appendItem_Callback_2(mthis, __arg_0, __arg_1) native "SVGTransformList_appendItem_Callback";
-  appendItem_Callback_2_(mthis, __arg_0, __arg_1) => appendItem_Callback_2(mthis, __arg_0, __arg_1);
+  clear_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "clear", []);
 
-  static appendItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGTransformList_appendItem_Callback";
-  appendItem_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => appendItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  consolidate_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "consolidate", []);
 
-  static clear_Callback_0(mthis) native "SVGTransformList_clear_Callback";
-  clear_Callback_0_(mthis) => clear_Callback_0(mthis);
+  createSVGTransformFromMatrix_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createSVGTransformFromMatrix", []);
 
-  static clear_Callback_1(mthis, __arg_0) native "SVGTransformList_clear_Callback";
-  clear_Callback_1_(mthis, __arg_0) => clear_Callback_1(mthis, __arg_0);
+  createSVGTransformFromMatrix_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "createSVGTransformFromMatrix", [__arg_0]);
 
-  static clear_Callback_2(mthis, __arg_0, __arg_1) native "SVGTransformList_clear_Callback";
-  clear_Callback_2_(mthis, __arg_0, __arg_1) => clear_Callback_2(mthis, __arg_0, __arg_1);
+  getItem_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getItem", []);
 
-  static consolidate_Callback_0(mthis) native "SVGTransformList_consolidate_Callback";
-  consolidate_Callback_0_(mthis) => consolidate_Callback_0(mthis);
+  getItem_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getItem", [__arg_0]);
 
-  static consolidate_Callback_1(mthis, __arg_0) native "SVGTransformList_consolidate_Callback";
-  consolidate_Callback_1_(mthis, __arg_0) => consolidate_Callback_1(mthis, __arg_0);
+  initialize_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "initialize", []);
 
-  static consolidate_Callback_2(mthis, __arg_0, __arg_1) native "SVGTransformList_consolidate_Callback";
-  consolidate_Callback_2_(mthis, __arg_0, __arg_1) => consolidate_Callback_2(mthis, __arg_0, __arg_1);
+  initialize_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "initialize", [__arg_0]);
 
-  static createSVGTransformFromMatrix_Callback_0(mthis) native "SVGTransformList_createSVGTransformFromMatrix_Callback";
-  createSVGTransformFromMatrix_Callback_0_(mthis) => createSVGTransformFromMatrix_Callback_0(mthis);
+  insertItemBefore_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "insertItemBefore", []);
 
-  static createSVGTransformFromMatrix_Callback_1(mthis, __arg_0) native "SVGTransformList_createSVGTransformFromMatrix_Callback";
-  createSVGTransformFromMatrix_Callback_1_(mthis, __arg_0) => createSVGTransformFromMatrix_Callback_1(mthis, __arg_0);
+  insertItemBefore_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "insertItemBefore", [__arg_0]);
 
-  static createSVGTransformFromMatrix_Callback_2(mthis, __arg_0, __arg_1) native "SVGTransformList_createSVGTransformFromMatrix_Callback";
-  createSVGTransformFromMatrix_Callback_2_(mthis, __arg_0, __arg_1) => createSVGTransformFromMatrix_Callback_2(mthis, __arg_0, __arg_1);
+  insertItemBefore_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "insertItemBefore", [__arg_0, __arg_1]);
 
-  static createSVGTransformFromMatrix_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGTransformList_createSVGTransformFromMatrix_Callback";
-  createSVGTransformFromMatrix_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => createSVGTransformFromMatrix_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  length_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "length");
 
-  static getItem_Callback_0(mthis) native "SVGTransformList_getItem_Callback";
-  getItem_Callback_0_(mthis) => getItem_Callback_0(mthis);
+  numberOfItems_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "numberOfItems");
 
-  static getItem_Callback_1(mthis, __arg_0) native "SVGTransformList_getItem_Callback";
-  getItem_Callback_1_(mthis, __arg_0) => getItem_Callback_1(mthis, __arg_0);
+  removeItem_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "removeItem", []);
 
-  static getItem_Callback_2(mthis, __arg_0, __arg_1) native "SVGTransformList_getItem_Callback";
-  getItem_Callback_2_(mthis, __arg_0, __arg_1) => getItem_Callback_2(mthis, __arg_0, __arg_1);
+  removeItem_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "removeItem", [__arg_0]);
 
-  static getItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGTransformList_getItem_Callback";
-  getItem_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  replaceItem_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "replaceItem", []);
 
-  static initialize_Callback_0(mthis) native "SVGTransformList_initialize_Callback";
-  initialize_Callback_0_(mthis) => initialize_Callback_0(mthis);
+  replaceItem_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "replaceItem", [__arg_0]);
 
-  static initialize_Callback_1(mthis, __arg_0) native "SVGTransformList_initialize_Callback";
-  initialize_Callback_1_(mthis, __arg_0) => initialize_Callback_1(mthis, __arg_0);
-
-  static initialize_Callback_2(mthis, __arg_0, __arg_1) native "SVGTransformList_initialize_Callback";
-  initialize_Callback_2_(mthis, __arg_0, __arg_1) => initialize_Callback_2(mthis, __arg_0, __arg_1);
-
-  static initialize_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGTransformList_initialize_Callback";
-  initialize_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => initialize_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static insertItemBefore_Callback_0(mthis) native "SVGTransformList_insertItemBefore_Callback";
-  insertItemBefore_Callback_0_(mthis) => insertItemBefore_Callback_0(mthis);
-
-  static insertItemBefore_Callback_1(mthis, __arg_0) native "SVGTransformList_insertItemBefore_Callback";
-  insertItemBefore_Callback_1_(mthis, __arg_0) => insertItemBefore_Callback_1(mthis, __arg_0);
-
-  static insertItemBefore_Callback_2(mthis, __arg_0, __arg_1) native "SVGTransformList_insertItemBefore_Callback";
-  insertItemBefore_Callback_2_(mthis, __arg_0, __arg_1) => insertItemBefore_Callback_2(mthis, __arg_0, __arg_1);
-
-  static insertItemBefore_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGTransformList_insertItemBefore_Callback";
-  insertItemBefore_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => insertItemBefore_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static insertItemBefore_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "SVGTransformList_insertItemBefore_Callback";
-  insertItemBefore_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => insertItemBefore_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static length_Getter(mthis) native "SVGTransformList_length_Getter";
-  length_Getter_(mthis) => length_Getter(mthis);
-
-  static numberOfItems_Getter(mthis) native "SVGTransformList_numberOfItems_Getter";
-  numberOfItems_Getter_(mthis) => numberOfItems_Getter(mthis);
-
-  static removeItem_Callback_0(mthis) native "SVGTransformList_removeItem_Callback";
-  removeItem_Callback_0_(mthis) => removeItem_Callback_0(mthis);
-
-  static removeItem_Callback_1(mthis, __arg_0) native "SVGTransformList_removeItem_Callback";
-  removeItem_Callback_1_(mthis, __arg_0) => removeItem_Callback_1(mthis, __arg_0);
-
-  static removeItem_Callback_2(mthis, __arg_0, __arg_1) native "SVGTransformList_removeItem_Callback";
-  removeItem_Callback_2_(mthis, __arg_0, __arg_1) => removeItem_Callback_2(mthis, __arg_0, __arg_1);
-
-  static removeItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGTransformList_removeItem_Callback";
-  removeItem_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => removeItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static replaceItem_Callback_0(mthis) native "SVGTransformList_replaceItem_Callback";
-  replaceItem_Callback_0_(mthis) => replaceItem_Callback_0(mthis);
-
-  static replaceItem_Callback_1(mthis, __arg_0) native "SVGTransformList_replaceItem_Callback";
-  replaceItem_Callback_1_(mthis, __arg_0) => replaceItem_Callback_1(mthis, __arg_0);
-
-  static replaceItem_Callback_2(mthis, __arg_0, __arg_1) native "SVGTransformList_replaceItem_Callback";
-  replaceItem_Callback_2_(mthis, __arg_0, __arg_1) => replaceItem_Callback_2(mthis, __arg_0, __arg_1);
-
-  static replaceItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SVGTransformList_replaceItem_Callback";
-  replaceItem_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => replaceItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static replaceItem_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "SVGTransformList_replaceItem_Callback";
-  replaceItem_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => replaceItem_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  replaceItem_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "replaceItem", [__arg_0, __arg_1]);
 
 }
 
@@ -23685,20 +13147,15 @@
 class BlinkSVGUseElement extends BlinkSVGGraphicsElement {
   static final instance = new BlinkSVGUseElement();
 
-  static height_Getter(mthis) native "SVGUseElement_height_Getter";
-  height_Getter_(mthis) => height_Getter(mthis);
+  height_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "height");
 
-  static href_Getter(mthis) native "SVGUseElement_href_Getter";
-  href_Getter_(mthis) => href_Getter(mthis);
+  href_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "href");
 
-  static width_Getter(mthis) native "SVGUseElement_width_Getter";
-  width_Getter_(mthis) => width_Getter(mthis);
+  width_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "width");
 
-  static x_Getter(mthis) native "SVGUseElement_x_Getter";
-  x_Getter_(mthis) => x_Getter(mthis);
+  x_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "x");
 
-  static y_Getter(mthis) native "SVGUseElement_y_Getter";
-  y_Getter_(mthis) => y_Getter(mthis);
+  y_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "y");
 
 }
 
@@ -23710,3126 +13167,1743 @@
 class BlinkSVGViewElement extends BlinkSVGElement {
   static final instance = new BlinkSVGViewElement();
 
-  static preserveAspectRatio_Getter(mthis) native "SVGViewElement_preserveAspectRatio_Getter";
-  preserveAspectRatio_Getter_(mthis) => preserveAspectRatio_Getter(mthis);
+  preserveAspectRatio_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "preserveAspectRatio");
 
-  static viewBox_Getter(mthis) native "SVGViewElement_viewBox_Getter";
-  viewBox_Getter_(mthis) => viewBox_Getter(mthis);
+  viewBox_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "viewBox");
 
-  static viewTarget_Getter(mthis) native "SVGViewElement_viewTarget_Getter";
-  viewTarget_Getter_(mthis) => viewTarget_Getter(mthis);
+  viewTarget_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "viewTarget");
 
-  static zoomAndPan_Getter(mthis) native "SVGViewElement_zoomAndPan_Getter";
-  zoomAndPan_Getter_(mthis) => zoomAndPan_Getter(mthis);
+  zoomAndPan_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "zoomAndPan");
 
-  static zoomAndPan_Setter(mthis, __arg_0) native "SVGViewElement_zoomAndPan_Setter";
-  zoomAndPan_Setter_(mthis, __arg_0) => zoomAndPan_Setter(mthis, __arg_0);
+  zoomAndPan_Setter_(mthis, __arg_0) => mthis["zoomAndPan"] = __arg_0;
 
 }
 
 class BlinkSVGViewSpec {
   static final instance = new BlinkSVGViewSpec();
 
-  static preserveAspectRatioString_Getter(mthis) native "SVGViewSpec_preserveAspectRatioString_Getter";
-  preserveAspectRatioString_Getter_(mthis) => preserveAspectRatioString_Getter(mthis);
+  preserveAspectRatioString_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "preserveAspectRatioString");
 
-  static preserveAspectRatio_Getter(mthis) native "SVGViewSpec_preserveAspectRatio_Getter";
-  preserveAspectRatio_Getter_(mthis) => preserveAspectRatio_Getter(mthis);
+  preserveAspectRatio_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "preserveAspectRatio");
 
-  static transformString_Getter(mthis) native "SVGViewSpec_transformString_Getter";
-  transformString_Getter_(mthis) => transformString_Getter(mthis);
+  transformString_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "transformString");
 
-  static transform_Getter(mthis) native "SVGViewSpec_transform_Getter";
-  transform_Getter_(mthis) => transform_Getter(mthis);
+  transform_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "transform");
 
-  static viewBoxString_Getter(mthis) native "SVGViewSpec_viewBoxString_Getter";
-  viewBoxString_Getter_(mthis) => viewBoxString_Getter(mthis);
+  viewBoxString_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "viewBoxString");
 
-  static viewBox_Getter(mthis) native "SVGViewSpec_viewBox_Getter";
-  viewBox_Getter_(mthis) => viewBox_Getter(mthis);
+  viewBox_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "viewBox");
 
-  static viewTargetString_Getter(mthis) native "SVGViewSpec_viewTargetString_Getter";
-  viewTargetString_Getter_(mthis) => viewTargetString_Getter(mthis);
+  viewTargetString_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "viewTargetString");
 
-  static viewTarget_Getter(mthis) native "SVGViewSpec_viewTarget_Getter";
-  viewTarget_Getter_(mthis) => viewTarget_Getter(mthis);
+  viewTarget_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "viewTarget");
 
-  static zoomAndPan_Getter(mthis) native "SVGViewSpec_zoomAndPan_Getter";
-  zoomAndPan_Getter_(mthis) => zoomAndPan_Getter(mthis);
+  zoomAndPan_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "zoomAndPan");
 
-  static zoomAndPan_Setter(mthis, __arg_0) native "SVGViewSpec_zoomAndPan_Setter";
-  zoomAndPan_Setter_(mthis, __arg_0) => zoomAndPan_Setter(mthis, __arg_0);
+  zoomAndPan_Setter_(mthis, __arg_0) => mthis["zoomAndPan"] = __arg_0;
 
 }
 
 class BlinkSVGZoomEvent extends BlinkUIEvent {
   static final instance = new BlinkSVGZoomEvent();
 
-  static newScale_Getter(mthis) native "SVGZoomEvent_newScale_Getter";
-  newScale_Getter_(mthis) => newScale_Getter(mthis);
+  newScale_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "newScale");
 
-  static newTranslate_Getter(mthis) native "SVGZoomEvent_newTranslate_Getter";
-  newTranslate_Getter_(mthis) => newTranslate_Getter(mthis);
+  newTranslate_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "newTranslate");
 
-  static previousScale_Getter(mthis) native "SVGZoomEvent_previousScale_Getter";
-  previousScale_Getter_(mthis) => previousScale_Getter(mthis);
+  previousScale_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "previousScale");
 
-  static previousTranslate_Getter(mthis) native "SVGZoomEvent_previousTranslate_Getter";
-  previousTranslate_Getter_(mthis) => previousTranslate_Getter(mthis);
+  previousTranslate_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "previousTranslate");
 
-  static zoomRectScreen_Getter(mthis) native "SVGZoomEvent_zoomRectScreen_Getter";
-  zoomRectScreen_Getter_(mthis) => zoomRectScreen_Getter(mthis);
+  zoomRectScreen_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "zoomRectScreen");
 
 }
 
 class BlinkScreen {
   static final instance = new BlinkScreen();
 
-  static availHeight_Getter(mthis) native "Screen_availHeight_Getter";
-  availHeight_Getter_(mthis) => availHeight_Getter(mthis);
+  availHeight_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "availHeight");
 
-  static availLeft_Getter(mthis) native "Screen_availLeft_Getter";
-  availLeft_Getter_(mthis) => availLeft_Getter(mthis);
+  availLeft_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "availLeft");
 
-  static availTop_Getter(mthis) native "Screen_availTop_Getter";
-  availTop_Getter_(mthis) => availTop_Getter(mthis);
+  availTop_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "availTop");
 
-  static availWidth_Getter(mthis) native "Screen_availWidth_Getter";
-  availWidth_Getter_(mthis) => availWidth_Getter(mthis);
+  availWidth_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "availWidth");
 
-  static colorDepth_Getter(mthis) native "Screen_colorDepth_Getter";
-  colorDepth_Getter_(mthis) => colorDepth_Getter(mthis);
+  colorDepth_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "colorDepth");
 
-  static height_Getter(mthis) native "Screen_height_Getter";
-  height_Getter_(mthis) => height_Getter(mthis);
+  height_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "height");
 
-  static orientation_Getter(mthis) native "Screen_orientation_Getter";
-  orientation_Getter_(mthis) => orientation_Getter(mthis);
+  orientation_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "orientation");
 
-  static pixelDepth_Getter(mthis) native "Screen_pixelDepth_Getter";
-  pixelDepth_Getter_(mthis) => pixelDepth_Getter(mthis);
+  pixelDepth_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "pixelDepth");
 
-  static width_Getter(mthis) native "Screen_width_Getter";
-  width_Getter_(mthis) => width_Getter(mthis);
+  width_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "width");
 
 }
 
 class BlinkScreenOrientation extends BlinkEventTarget {
   static final instance = new BlinkScreenOrientation();
 
-  static angle_Getter(mthis) native "ScreenOrientation_angle_Getter";
-  angle_Getter_(mthis) => angle_Getter(mthis);
+  angle_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "angle");
 
-  static lock_Callback_0(mthis) native "ScreenOrientation_lock_Callback";
-  lock_Callback_0_(mthis) => lock_Callback_0(mthis);
+  lock_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "lock", []);
 
-  static lock_Callback_1(mthis, __arg_0) native "ScreenOrientation_lock_Callback";
-  lock_Callback_1_(mthis, __arg_0) => lock_Callback_1(mthis, __arg_0);
+  lock_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "lock", [__arg_0]);
 
-  static lock_Callback_2(mthis, __arg_0, __arg_1) native "ScreenOrientation_lock_Callback";
-  lock_Callback_2_(mthis, __arg_0, __arg_1) => lock_Callback_2(mthis, __arg_0, __arg_1);
+  onchange_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onchange");
 
-  static lock_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "ScreenOrientation_lock_Callback";
-  lock_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => lock_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  onchange_Setter_(mthis, __arg_0) => mthis["onchange"] = __arg_0;
 
-  static onchange_Getter(mthis) native "ScreenOrientation_onchange_Getter";
-  onchange_Getter_(mthis) => onchange_Getter(mthis);
+  type_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "type");
 
-  static onchange_Setter(mthis, __arg_0) native "ScreenOrientation_onchange_Setter";
-  onchange_Setter_(mthis, __arg_0) => onchange_Setter(mthis, __arg_0);
-
-  static type_Getter(mthis) native "ScreenOrientation_type_Getter";
-  type_Getter_(mthis) => type_Getter(mthis);
-
-  static unlock_Callback_0(mthis) native "ScreenOrientation_unlock_Callback";
-  unlock_Callback_0_(mthis) => unlock_Callback_0(mthis);
-
-  static unlock_Callback_1(mthis, __arg_0) native "ScreenOrientation_unlock_Callback";
-  unlock_Callback_1_(mthis, __arg_0) => unlock_Callback_1(mthis, __arg_0);
-
-  static unlock_Callback_2(mthis, __arg_0, __arg_1) native "ScreenOrientation_unlock_Callback";
-  unlock_Callback_2_(mthis, __arg_0, __arg_1) => unlock_Callback_2(mthis, __arg_0, __arg_1);
+  unlock_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "unlock", []);
 
 }
 
 class BlinkScriptProcessorNode extends BlinkAudioNode {
   static final instance = new BlinkScriptProcessorNode();
 
-  static bufferSize_Getter(mthis) native "ScriptProcessorNode_bufferSize_Getter";
-  bufferSize_Getter_(mthis) => bufferSize_Getter(mthis);
+  bufferSize_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "bufferSize");
 
-  static onaudioprocess_Getter(mthis) native "ScriptProcessorNode_onaudioprocess_Getter";
-  onaudioprocess_Getter_(mthis) => onaudioprocess_Getter(mthis);
+  onaudioprocess_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onaudioprocess");
 
-  static onaudioprocess_Setter(mthis, __arg_0) native "ScriptProcessorNode_onaudioprocess_Setter";
-  onaudioprocess_Setter_(mthis, __arg_0) => onaudioprocess_Setter(mthis, __arg_0);
+  onaudioprocess_Setter_(mthis, __arg_0) => mthis["onaudioprocess"] = __arg_0;
 
-  static setEventListener_Callback_0(mthis) native "ScriptProcessorNode_setEventListener_Callback";
-  setEventListener_Callback_0_(mthis) => setEventListener_Callback_0(mthis);
+  setEventListener_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "setEventListener", []);
 
-  static setEventListener_Callback_1(mthis, __arg_0) native "ScriptProcessorNode_setEventListener_Callback";
-  setEventListener_Callback_1_(mthis, __arg_0) => setEventListener_Callback_1(mthis, __arg_0);
-
-  static setEventListener_Callback_2(mthis, __arg_0, __arg_1) native "ScriptProcessorNode_setEventListener_Callback";
-  setEventListener_Callback_2_(mthis, __arg_0, __arg_1) => setEventListener_Callback_2(mthis, __arg_0, __arg_1);
-
-  static setEventListener_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "ScriptProcessorNode_setEventListener_Callback";
-  setEventListener_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => setEventListener_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  setEventListener_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "setEventListener", [__arg_0]);
 
 }
 
 class BlinkSecurityPolicyViolationEvent extends BlinkEvent {
   static final instance = new BlinkSecurityPolicyViolationEvent();
 
-  static blockedURI_Getter(mthis) native "SecurityPolicyViolationEvent_blockedURI_Getter";
-  blockedURI_Getter_(mthis) => blockedURI_Getter(mthis);
+  blockedURI_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "blockedURI");
 
-  static columnNumber_Getter(mthis) native "SecurityPolicyViolationEvent_columnNumber_Getter";
-  columnNumber_Getter_(mthis) => columnNumber_Getter(mthis);
+  columnNumber_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "columnNumber");
 
-  static constructorCallback_2(__arg_0, __arg_1) native "SecurityPolicyViolationEvent_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  constructorCallback_2_(__arg_0, __arg_1) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "SecurityPolicyViolationEvent"), [__arg_0, __arg_1]);
 
-  static documentURI_Getter(mthis) native "SecurityPolicyViolationEvent_documentURI_Getter";
-  documentURI_Getter_(mthis) => documentURI_Getter(mthis);
+  documentURI_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "documentURI");
 
-  static effectiveDirective_Getter(mthis) native "SecurityPolicyViolationEvent_effectiveDirective_Getter";
-  effectiveDirective_Getter_(mthis) => effectiveDirective_Getter(mthis);
+  effectiveDirective_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "effectiveDirective");
 
-  static lineNumber_Getter(mthis) native "SecurityPolicyViolationEvent_lineNumber_Getter";
-  lineNumber_Getter_(mthis) => lineNumber_Getter(mthis);
+  lineNumber_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "lineNumber");
 
-  static originalPolicy_Getter(mthis) native "SecurityPolicyViolationEvent_originalPolicy_Getter";
-  originalPolicy_Getter_(mthis) => originalPolicy_Getter(mthis);
+  originalPolicy_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "originalPolicy");
 
-  static referrer_Getter(mthis) native "SecurityPolicyViolationEvent_referrer_Getter";
-  referrer_Getter_(mthis) => referrer_Getter(mthis);
+  referrer_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "referrer");
 
-  static sourceFile_Getter(mthis) native "SecurityPolicyViolationEvent_sourceFile_Getter";
-  sourceFile_Getter_(mthis) => sourceFile_Getter(mthis);
+  sourceFile_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "sourceFile");
 
-  static statusCode_Getter(mthis) native "SecurityPolicyViolationEvent_statusCode_Getter";
-  statusCode_Getter_(mthis) => statusCode_Getter(mthis);
+  statusCode_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "statusCode");
 
-  static violatedDirective_Getter(mthis) native "SecurityPolicyViolationEvent_violatedDirective_Getter";
-  violatedDirective_Getter_(mthis) => violatedDirective_Getter(mthis);
+  violatedDirective_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "violatedDirective");
 
 }
 
 class BlinkSelection {
   static final instance = new BlinkSelection();
 
-  static addRange_Callback_0(mthis) native "Selection_addRange_Callback";
-  addRange_Callback_0_(mthis) => addRange_Callback_0(mthis);
+  addRange_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "addRange", []);
 
-  static addRange_Callback_1(mthis, __arg_0) native "Selection_addRange_Callback";
-  addRange_Callback_1_(mthis, __arg_0) => addRange_Callback_1(mthis, __arg_0);
+  addRange_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "addRange", [__arg_0]);
 
-  static addRange_Callback_2(mthis, __arg_0, __arg_1) native "Selection_addRange_Callback";
-  addRange_Callback_2_(mthis, __arg_0, __arg_1) => addRange_Callback_2(mthis, __arg_0, __arg_1);
+  anchorNode_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "anchorNode");
 
-  static addRange_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Selection_addRange_Callback";
-  addRange_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => addRange_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  anchorOffset_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "anchorOffset");
 
-  static anchorNode_Getter(mthis) native "Selection_anchorNode_Getter";
-  anchorNode_Getter_(mthis) => anchorNode_Getter(mthis);
+  baseNode_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "baseNode");
 
-  static anchorOffset_Getter(mthis) native "Selection_anchorOffset_Getter";
-  anchorOffset_Getter_(mthis) => anchorOffset_Getter(mthis);
+  baseOffset_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "baseOffset");
 
-  static baseNode_Getter(mthis) native "Selection_baseNode_Getter";
-  baseNode_Getter_(mthis) => baseNode_Getter(mthis);
+  collapseToEnd_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "collapseToEnd", []);
 
-  static baseOffset_Getter(mthis) native "Selection_baseOffset_Getter";
-  baseOffset_Getter_(mthis) => baseOffset_Getter(mthis);
+  collapseToStart_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "collapseToStart", []);
 
-  static collapseToEnd_Callback_0(mthis) native "Selection_collapseToEnd_Callback";
-  collapseToEnd_Callback_0_(mthis) => collapseToEnd_Callback_0(mthis);
+  collapse_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "collapse", []);
 
-  static collapseToEnd_Callback_1(mthis, __arg_0) native "Selection_collapseToEnd_Callback";
-  collapseToEnd_Callback_1_(mthis, __arg_0) => collapseToEnd_Callback_1(mthis, __arg_0);
+  collapse_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "collapse", [__arg_0]);
 
-  static collapseToEnd_Callback_2(mthis, __arg_0, __arg_1) native "Selection_collapseToEnd_Callback";
-  collapseToEnd_Callback_2_(mthis, __arg_0, __arg_1) => collapseToEnd_Callback_2(mthis, __arg_0, __arg_1);
+  collapse_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "collapse", [__arg_0, __arg_1]);
 
-  static collapseToStart_Callback_0(mthis) native "Selection_collapseToStart_Callback";
-  collapseToStart_Callback_0_(mthis) => collapseToStart_Callback_0(mthis);
+  containsNode_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "containsNode", []);
 
-  static collapseToStart_Callback_1(mthis, __arg_0) native "Selection_collapseToStart_Callback";
-  collapseToStart_Callback_1_(mthis, __arg_0) => collapseToStart_Callback_1(mthis, __arg_0);
+  containsNode_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "containsNode", [__arg_0]);
 
-  static collapseToStart_Callback_2(mthis, __arg_0, __arg_1) native "Selection_collapseToStart_Callback";
-  collapseToStart_Callback_2_(mthis, __arg_0, __arg_1) => collapseToStart_Callback_2(mthis, __arg_0, __arg_1);
+  containsNode_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "containsNode", [__arg_0, __arg_1]);
 
-  static collapse_Callback_0(mthis) native "Selection_collapse_Callback";
-  collapse_Callback_0_(mthis) => collapse_Callback_0(mthis);
+  deleteFromDocument_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "deleteFromDocument", []);
 
-  static collapse_Callback_1(mthis, __arg_0) native "Selection_collapse_Callback";
-  collapse_Callback_1_(mthis, __arg_0) => collapse_Callback_1(mthis, __arg_0);
+  empty_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "empty", []);
 
-  static collapse_Callback_2(mthis, __arg_0, __arg_1) native "Selection_collapse_Callback";
-  collapse_Callback_2_(mthis, __arg_0, __arg_1) => collapse_Callback_2(mthis, __arg_0, __arg_1);
+  extend_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "extend", []);
 
-  static collapse_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Selection_collapse_Callback";
-  collapse_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => collapse_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  extend_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "extend", [__arg_0]);
 
-  static collapse_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Selection_collapse_Callback";
-  collapse_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => collapse_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  extend_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "extend", [__arg_0, __arg_1]);
 
-  static containsNode_Callback_0(mthis) native "Selection_containsNode_Callback";
-  containsNode_Callback_0_(mthis) => containsNode_Callback_0(mthis);
+  extentNode_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "extentNode");
 
-  static containsNode_Callback_1(mthis, __arg_0) native "Selection_containsNode_Callback";
-  containsNode_Callback_1_(mthis, __arg_0) => containsNode_Callback_1(mthis, __arg_0);
+  extentOffset_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "extentOffset");
 
-  static containsNode_Callback_2(mthis, __arg_0, __arg_1) native "Selection_containsNode_Callback";
-  containsNode_Callback_2_(mthis, __arg_0, __arg_1) => containsNode_Callback_2(mthis, __arg_0, __arg_1);
+  focusNode_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "focusNode");
 
-  static containsNode_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Selection_containsNode_Callback";
-  containsNode_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => containsNode_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  focusOffset_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "focusOffset");
 
-  static containsNode_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Selection_containsNode_Callback";
-  containsNode_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => containsNode_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  getRangeAt_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getRangeAt", []);
 
-  static deleteFromDocument_Callback_0(mthis) native "Selection_deleteFromDocument_Callback";
-  deleteFromDocument_Callback_0_(mthis) => deleteFromDocument_Callback_0(mthis);
+  getRangeAt_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getRangeAt", [__arg_0]);
 
-  static deleteFromDocument_Callback_1(mthis, __arg_0) native "Selection_deleteFromDocument_Callback";
-  deleteFromDocument_Callback_1_(mthis, __arg_0) => deleteFromDocument_Callback_1(mthis, __arg_0);
+  isCollapsed_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "isCollapsed");
 
-  static deleteFromDocument_Callback_2(mthis, __arg_0, __arg_1) native "Selection_deleteFromDocument_Callback";
-  deleteFromDocument_Callback_2_(mthis, __arg_0, __arg_1) => deleteFromDocument_Callback_2(mthis, __arg_0, __arg_1);
+  modify_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "modify", []);
 
-  static empty_Callback_0(mthis) native "Selection_empty_Callback";
-  empty_Callback_0_(mthis) => empty_Callback_0(mthis);
+  modify_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "modify", [__arg_0]);
 
-  static empty_Callback_1(mthis, __arg_0) native "Selection_empty_Callback";
-  empty_Callback_1_(mthis, __arg_0) => empty_Callback_1(mthis, __arg_0);
+  modify_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "modify", [__arg_0, __arg_1]);
 
-  static empty_Callback_2(mthis, __arg_0, __arg_1) native "Selection_empty_Callback";
-  empty_Callback_2_(mthis, __arg_0, __arg_1) => empty_Callback_2(mthis, __arg_0, __arg_1);
+  modify_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "modify", [__arg_0, __arg_1, __arg_2]);
 
-  static extend_Callback_0(mthis) native "Selection_extend_Callback";
-  extend_Callback_0_(mthis) => extend_Callback_0(mthis);
+  rangeCount_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "rangeCount");
 
-  static extend_Callback_1(mthis, __arg_0) native "Selection_extend_Callback";
-  extend_Callback_1_(mthis, __arg_0) => extend_Callback_1(mthis, __arg_0);
+  removeAllRanges_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "removeAllRanges", []);
 
-  static extend_Callback_2(mthis, __arg_0, __arg_1) native "Selection_extend_Callback";
-  extend_Callback_2_(mthis, __arg_0, __arg_1) => extend_Callback_2(mthis, __arg_0, __arg_1);
+  selectAllChildren_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "selectAllChildren", []);
 
-  static extend_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Selection_extend_Callback";
-  extend_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => extend_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  selectAllChildren_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "selectAllChildren", [__arg_0]);
 
-  static extend_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Selection_extend_Callback";
-  extend_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => extend_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  setBaseAndExtent_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "setBaseAndExtent", []);
 
-  static extentNode_Getter(mthis) native "Selection_extentNode_Getter";
-  extentNode_Getter_(mthis) => extentNode_Getter(mthis);
-
-  static extentOffset_Getter(mthis) native "Selection_extentOffset_Getter";
-  extentOffset_Getter_(mthis) => extentOffset_Getter(mthis);
-
-  static focusNode_Getter(mthis) native "Selection_focusNode_Getter";
-  focusNode_Getter_(mthis) => focusNode_Getter(mthis);
-
-  static focusOffset_Getter(mthis) native "Selection_focusOffset_Getter";
-  focusOffset_Getter_(mthis) => focusOffset_Getter(mthis);
-
-  static getRangeAt_Callback_0(mthis) native "Selection_getRangeAt_Callback";
-  getRangeAt_Callback_0_(mthis) => getRangeAt_Callback_0(mthis);
-
-  static getRangeAt_Callback_1(mthis, __arg_0) native "Selection_getRangeAt_Callback";
-  getRangeAt_Callback_1_(mthis, __arg_0) => getRangeAt_Callback_1(mthis, __arg_0);
-
-  static getRangeAt_Callback_2(mthis, __arg_0, __arg_1) native "Selection_getRangeAt_Callback";
-  getRangeAt_Callback_2_(mthis, __arg_0, __arg_1) => getRangeAt_Callback_2(mthis, __arg_0, __arg_1);
-
-  static getRangeAt_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Selection_getRangeAt_Callback";
-  getRangeAt_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getRangeAt_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static isCollapsed_Getter(mthis) native "Selection_isCollapsed_Getter";
-  isCollapsed_Getter_(mthis) => isCollapsed_Getter(mthis);
-
-  static modify_Callback_0(mthis) native "Selection_modify_Callback";
-  modify_Callback_0_(mthis) => modify_Callback_0(mthis);
-
-  static modify_Callback_1(mthis, __arg_0) native "Selection_modify_Callback";
-  modify_Callback_1_(mthis, __arg_0) => modify_Callback_1(mthis, __arg_0);
-
-  static modify_Callback_2(mthis, __arg_0, __arg_1) native "Selection_modify_Callback";
-  modify_Callback_2_(mthis, __arg_0, __arg_1) => modify_Callback_2(mthis, __arg_0, __arg_1);
-
-  static modify_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Selection_modify_Callback";
-  modify_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => modify_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static modify_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Selection_modify_Callback";
-  modify_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => modify_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static modify_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "Selection_modify_Callback";
-  modify_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => modify_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
-
-  static rangeCount_Getter(mthis) native "Selection_rangeCount_Getter";
-  rangeCount_Getter_(mthis) => rangeCount_Getter(mthis);
-
-  static removeAllRanges_Callback_0(mthis) native "Selection_removeAllRanges_Callback";
-  removeAllRanges_Callback_0_(mthis) => removeAllRanges_Callback_0(mthis);
-
-  static removeAllRanges_Callback_1(mthis, __arg_0) native "Selection_removeAllRanges_Callback";
-  removeAllRanges_Callback_1_(mthis, __arg_0) => removeAllRanges_Callback_1(mthis, __arg_0);
-
-  static removeAllRanges_Callback_2(mthis, __arg_0, __arg_1) native "Selection_removeAllRanges_Callback";
-  removeAllRanges_Callback_2_(mthis, __arg_0, __arg_1) => removeAllRanges_Callback_2(mthis, __arg_0, __arg_1);
-
-  static selectAllChildren_Callback_0(mthis) native "Selection_selectAllChildren_Callback";
-  selectAllChildren_Callback_0_(mthis) => selectAllChildren_Callback_0(mthis);
-
-  static selectAllChildren_Callback_1(mthis, __arg_0) native "Selection_selectAllChildren_Callback";
-  selectAllChildren_Callback_1_(mthis, __arg_0) => selectAllChildren_Callback_1(mthis, __arg_0);
-
-  static selectAllChildren_Callback_2(mthis, __arg_0, __arg_1) native "Selection_selectAllChildren_Callback";
-  selectAllChildren_Callback_2_(mthis, __arg_0, __arg_1) => selectAllChildren_Callback_2(mthis, __arg_0, __arg_1);
-
-  static selectAllChildren_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Selection_selectAllChildren_Callback";
-  selectAllChildren_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => selectAllChildren_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static setBaseAndExtent_Callback_0(mthis) native "Selection_setBaseAndExtent_Callback";
-  setBaseAndExtent_Callback_0_(mthis) => setBaseAndExtent_Callback_0(mthis);
-
-  static setBaseAndExtent_Callback_1(mthis, __arg_0) native "Selection_setBaseAndExtent_Callback";
-  setBaseAndExtent_Callback_1_(mthis, __arg_0) => setBaseAndExtent_Callback_1(mthis, __arg_0);
-
-  static setBaseAndExtent_Callback_2(mthis, __arg_0, __arg_1) native "Selection_setBaseAndExtent_Callback";
-  setBaseAndExtent_Callback_2_(mthis, __arg_0, __arg_1) => setBaseAndExtent_Callback_2(mthis, __arg_0, __arg_1);
-
-  static setBaseAndExtent_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Selection_setBaseAndExtent_Callback";
-  setBaseAndExtent_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => setBaseAndExtent_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static setBaseAndExtent_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Selection_setBaseAndExtent_Callback";
-  setBaseAndExtent_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => setBaseAndExtent_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static setBaseAndExtent_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "Selection_setBaseAndExtent_Callback";
-  setBaseAndExtent_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => setBaseAndExtent_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  setBaseAndExtent_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "setBaseAndExtent", [__arg_0]);
 
-  static setBaseAndExtent_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "Selection_setBaseAndExtent_Callback";
-  setBaseAndExtent_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => setBaseAndExtent_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  setBaseAndExtent_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "setBaseAndExtent", [__arg_0, __arg_1]);
 
-  static setPosition_Callback_0(mthis) native "Selection_setPosition_Callback";
-  setPosition_Callback_0_(mthis) => setPosition_Callback_0(mthis);
+  setBaseAndExtent_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "setBaseAndExtent", [__arg_0, __arg_1, __arg_2]);
 
-  static setPosition_Callback_1(mthis, __arg_0) native "Selection_setPosition_Callback";
-  setPosition_Callback_1_(mthis, __arg_0) => setPosition_Callback_1(mthis, __arg_0);
+  setBaseAndExtent_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "setBaseAndExtent", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static setPosition_Callback_2(mthis, __arg_0, __arg_1) native "Selection_setPosition_Callback";
-  setPosition_Callback_2_(mthis, __arg_0, __arg_1) => setPosition_Callback_2(mthis, __arg_0, __arg_1);
+  setPosition_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "setPosition", []);
 
-  static setPosition_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Selection_setPosition_Callback";
-  setPosition_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => setPosition_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  setPosition_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "setPosition", [__arg_0]);
 
-  static setPosition_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Selection_setPosition_Callback";
-  setPosition_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => setPosition_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  setPosition_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "setPosition", [__arg_0, __arg_1]);
 
-  static type_Getter(mthis) native "Selection_type_Getter";
-  type_Getter_(mthis) => type_Getter(mthis);
+  type_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "type");
 
 }
 
 class BlinkServiceWorker extends BlinkEventTarget {
   static final instance = new BlinkServiceWorker();
 
-  static onerror_Getter(mthis) native "ServiceWorker_onerror_Getter";
-  onerror_Getter_(mthis) => onerror_Getter(mthis);
+  onerror_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onerror");
 
-  static onerror_Setter(mthis, __arg_0) native "ServiceWorker_onerror_Setter";
-  onerror_Setter_(mthis, __arg_0) => onerror_Setter(mthis, __arg_0);
+  onerror_Setter_(mthis, __arg_0) => mthis["onerror"] = __arg_0;
 
-  static onstatechange_Getter(mthis) native "ServiceWorker_onstatechange_Getter";
-  onstatechange_Getter_(mthis) => onstatechange_Getter(mthis);
+  onstatechange_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onstatechange");
 
-  static onstatechange_Setter(mthis, __arg_0) native "ServiceWorker_onstatechange_Setter";
-  onstatechange_Setter_(mthis, __arg_0) => onstatechange_Setter(mthis, __arg_0);
+  onstatechange_Setter_(mthis, __arg_0) => mthis["onstatechange"] = __arg_0;
 
-  static postMessage_Callback_0(mthis) native "ServiceWorker_postMessage_Callback";
-  postMessage_Callback_0_(mthis) => postMessage_Callback_0(mthis);
+  postMessage_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "postMessage", []);
 
-  static postMessage_Callback_1(mthis, __arg_0) native "ServiceWorker_postMessage_Callback";
-  postMessage_Callback_1_(mthis, __arg_0) => postMessage_Callback_1(mthis, __arg_0);
+  postMessage_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "postMessage", [__arg_0]);
 
-  static postMessage_Callback_2(mthis, __arg_0, __arg_1) native "ServiceWorker_postMessage_Callback";
-  postMessage_Callback_2_(mthis, __arg_0, __arg_1) => postMessage_Callback_2(mthis, __arg_0, __arg_1);
+  postMessage_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "postMessage", [__arg_0, __arg_1]);
 
-  static postMessage_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "ServiceWorker_postMessage_Callback";
-  postMessage_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => postMessage_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  scriptURL_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "scriptURL");
 
-  static postMessage_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "ServiceWorker_postMessage_Callback";
-  postMessage_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => postMessage_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  state_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "state");
 
-  static scriptURL_Getter(mthis) native "ServiceWorker_scriptURL_Getter";
-  scriptURL_Getter_(mthis) => scriptURL_Getter(mthis);
-
-  static state_Getter(mthis) native "ServiceWorker_state_Getter";
-  state_Getter_(mthis) => state_Getter(mthis);
-
-  static terminate_Callback_0(mthis) native "ServiceWorker_terminate_Callback";
-  terminate_Callback_0_(mthis) => terminate_Callback_0(mthis);
-
-  static terminate_Callback_1(mthis, __arg_0) native "ServiceWorker_terminate_Callback";
-  terminate_Callback_1_(mthis, __arg_0) => terminate_Callback_1(mthis, __arg_0);
-
-  static terminate_Callback_2(mthis, __arg_0, __arg_1) native "ServiceWorker_terminate_Callback";
-  terminate_Callback_2_(mthis, __arg_0, __arg_1) => terminate_Callback_2(mthis, __arg_0, __arg_1);
+  terminate_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "terminate", []);
 
 }
 
 class BlinkServiceWorkerClient {
   static final instance = new BlinkServiceWorkerClient();
 
-  static id_Getter(mthis) native "ServiceWorkerClient_id_Getter";
-  id_Getter_(mthis) => id_Getter(mthis);
+  id_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "id");
 
-  static postMessage_Callback_0(mthis) native "ServiceWorkerClient_postMessage_Callback";
-  postMessage_Callback_0_(mthis) => postMessage_Callback_0(mthis);
+  postMessage_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "postMessage", []);
 
-  static postMessage_Callback_1(mthis, __arg_0) native "ServiceWorkerClient_postMessage_Callback";
-  postMessage_Callback_1_(mthis, __arg_0) => postMessage_Callback_1(mthis, __arg_0);
+  postMessage_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "postMessage", [__arg_0]);
 
-  static postMessage_Callback_2(mthis, __arg_0, __arg_1) native "ServiceWorkerClient_postMessage_Callback";
-  postMessage_Callback_2_(mthis, __arg_0, __arg_1) => postMessage_Callback_2(mthis, __arg_0, __arg_1);
-
-  static postMessage_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "ServiceWorkerClient_postMessage_Callback";
-  postMessage_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => postMessage_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static postMessage_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "ServiceWorkerClient_postMessage_Callback";
-  postMessage_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => postMessage_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  postMessage_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "postMessage", [__arg_0, __arg_1]);
 
 }
 
 class BlinkServiceWorkerClients {
   static final instance = new BlinkServiceWorkerClients();
 
-  static getAll_Callback_0(mthis) native "ServiceWorkerClients_getAll_Callback";
-  getAll_Callback_0_(mthis) => getAll_Callback_0(mthis);
+  getAll_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getAll", []);
 
-  static getAll_Callback_1(mthis, __arg_0) native "ServiceWorkerClients_getAll_Callback";
-  getAll_Callback_1_(mthis, __arg_0) => getAll_Callback_1(mthis, __arg_0);
-
-  static getAll_Callback_2(mthis, __arg_0, __arg_1) native "ServiceWorkerClients_getAll_Callback";
-  getAll_Callback_2_(mthis, __arg_0, __arg_1) => getAll_Callback_2(mthis, __arg_0, __arg_1);
-
-  static getAll_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "ServiceWorkerClients_getAll_Callback";
-  getAll_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getAll_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  getAll_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getAll", [__arg_0]);
 
 }
 
 class BlinkServiceWorkerContainer {
   static final instance = new BlinkServiceWorkerContainer();
 
-  static controller_Getter(mthis) native "ServiceWorkerContainer_controller_Getter";
-  controller_Getter_(mthis) => controller_Getter(mthis);
+  controller_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "controller");
 
-  static getRegistration_Callback_0(mthis) native "ServiceWorkerContainer_getRegistration_Callback";
-  getRegistration_Callback_0_(mthis) => getRegistration_Callback_0(mthis);
+  getRegistration_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getRegistration", []);
 
-  static getRegistration_Callback_1(mthis, __arg_0) native "ServiceWorkerContainer_getRegistration_Callback";
-  getRegistration_Callback_1_(mthis, __arg_0) => getRegistration_Callback_1(mthis, __arg_0);
+  getRegistration_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getRegistration", [__arg_0]);
 
-  static getRegistration_Callback_2(mthis, __arg_0, __arg_1) native "ServiceWorkerContainer_getRegistration_Callback";
-  getRegistration_Callback_2_(mthis, __arg_0, __arg_1) => getRegistration_Callback_2(mthis, __arg_0, __arg_1);
+  ready_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ready");
 
-  static getRegistration_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "ServiceWorkerContainer_getRegistration_Callback";
-  getRegistration_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getRegistration_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  register_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "register", []);
 
-  static ready_Getter(mthis) native "ServiceWorkerContainer_ready_Getter";
-  ready_Getter_(mthis) => ready_Getter(mthis);
+  register_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "register", [__arg_0]);
 
-  static register_Callback_0(mthis) native "ServiceWorkerContainer_register_Callback";
-  register_Callback_0_(mthis) => register_Callback_0(mthis);
-
-  static register_Callback_1(mthis, __arg_0) native "ServiceWorkerContainer_register_Callback";
-  register_Callback_1_(mthis, __arg_0) => register_Callback_1(mthis, __arg_0);
-
-  static register_Callback_2(mthis, __arg_0, __arg_1) native "ServiceWorkerContainer_register_Callback";
-  register_Callback_2_(mthis, __arg_0, __arg_1) => register_Callback_2(mthis, __arg_0, __arg_1);
-
-  static register_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "ServiceWorkerContainer_register_Callback";
-  register_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => register_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static register_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "ServiceWorkerContainer_register_Callback";
-  register_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => register_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  register_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "register", [__arg_0, __arg_1]);
 
 }
 
 class BlinkServiceWorkerGlobalScope extends BlinkWorkerGlobalScope {
   static final instance = new BlinkServiceWorkerGlobalScope();
 
-  static caches_Getter(mthis) native "ServiceWorkerGlobalScope_caches_Getter";
-  caches_Getter_(mthis) => caches_Getter(mthis);
+  caches_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "caches");
 
-  static clients_Getter(mthis) native "ServiceWorkerGlobalScope_clients_Getter";
-  clients_Getter_(mthis) => clients_Getter(mthis);
+  clients_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "clients");
 
-  static close_Callback_0(mthis) native "ServiceWorkerGlobalScope_close_Callback";
-  close_Callback_0_(mthis) => close_Callback_0(mthis);
+  close_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "close", []);
 
-  static close_Callback_1(mthis, __arg_0) native "ServiceWorkerGlobalScope_close_Callback";
-  close_Callback_1_(mthis, __arg_0) => close_Callback_1(mthis, __arg_0);
+  fetch_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "fetch", []);
 
-  static close_Callback_2(mthis, __arg_0, __arg_1) native "ServiceWorkerGlobalScope_close_Callback";
-  close_Callback_2_(mthis, __arg_0, __arg_1) => close_Callback_2(mthis, __arg_0, __arg_1);
+  fetch_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "fetch", [__arg_0]);
 
-  static fetch_Callback_0(mthis) native "ServiceWorkerGlobalScope_fetch_Callback";
-  fetch_Callback_0_(mthis) => fetch_Callback_0(mthis);
+  fetch_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "fetch", [__arg_0, __arg_1]);
 
-  static fetch_Callback_1(mthis, __arg_0) native "ServiceWorkerGlobalScope_fetch_Callback";
-  fetch_Callback_1_(mthis, __arg_0) => fetch_Callback_1(mthis, __arg_0);
+  onactivate_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onactivate");
 
-  static fetch_Callback_2(mthis, __arg_0, __arg_1) native "ServiceWorkerGlobalScope_fetch_Callback";
-  fetch_Callback_2_(mthis, __arg_0, __arg_1) => fetch_Callback_2(mthis, __arg_0, __arg_1);
+  onactivate_Setter_(mthis, __arg_0) => mthis["onactivate"] = __arg_0;
 
-  static fetch_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "ServiceWorkerGlobalScope_fetch_Callback";
-  fetch_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => fetch_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  onfetch_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onfetch");
 
-  static fetch_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "ServiceWorkerGlobalScope_fetch_Callback";
-  fetch_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => fetch_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  onfetch_Setter_(mthis, __arg_0) => mthis["onfetch"] = __arg_0;
 
-  static onactivate_Getter(mthis) native "ServiceWorkerGlobalScope_onactivate_Getter";
-  onactivate_Getter_(mthis) => onactivate_Getter(mthis);
+  oninstall_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "oninstall");
 
-  static onactivate_Setter(mthis, __arg_0) native "ServiceWorkerGlobalScope_onactivate_Setter";
-  onactivate_Setter_(mthis, __arg_0) => onactivate_Setter(mthis, __arg_0);
+  oninstall_Setter_(mthis, __arg_0) => mthis["oninstall"] = __arg_0;
 
-  static onfetch_Getter(mthis) native "ServiceWorkerGlobalScope_onfetch_Getter";
-  onfetch_Getter_(mthis) => onfetch_Getter(mthis);
+  onmessage_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onmessage");
 
-  static onfetch_Setter(mthis, __arg_0) native "ServiceWorkerGlobalScope_onfetch_Setter";
-  onfetch_Setter_(mthis, __arg_0) => onfetch_Setter(mthis, __arg_0);
+  onmessage_Setter_(mthis, __arg_0) => mthis["onmessage"] = __arg_0;
 
-  static oninstall_Getter(mthis) native "ServiceWorkerGlobalScope_oninstall_Getter";
-  oninstall_Getter_(mthis) => oninstall_Getter(mthis);
+  onpush_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onpush");
 
-  static oninstall_Setter(mthis, __arg_0) native "ServiceWorkerGlobalScope_oninstall_Setter";
-  oninstall_Setter_(mthis, __arg_0) => oninstall_Setter(mthis, __arg_0);
+  onpush_Setter_(mthis, __arg_0) => mthis["onpush"] = __arg_0;
 
-  static onmessage_Getter(mthis) native "ServiceWorkerGlobalScope_onmessage_Getter";
-  onmessage_Getter_(mthis) => onmessage_Getter(mthis);
+  onsync_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onsync");
 
-  static onmessage_Setter(mthis, __arg_0) native "ServiceWorkerGlobalScope_onmessage_Setter";
-  onmessage_Setter_(mthis, __arg_0) => onmessage_Setter(mthis, __arg_0);
+  onsync_Setter_(mthis, __arg_0) => mthis["onsync"] = __arg_0;
 
-  static onpush_Getter(mthis) native "ServiceWorkerGlobalScope_onpush_Getter";
-  onpush_Getter_(mthis) => onpush_Getter(mthis);
-
-  static onpush_Setter(mthis, __arg_0) native "ServiceWorkerGlobalScope_onpush_Setter";
-  onpush_Setter_(mthis, __arg_0) => onpush_Setter(mthis, __arg_0);
-
-  static onsync_Getter(mthis) native "ServiceWorkerGlobalScope_onsync_Getter";
-  onsync_Getter_(mthis) => onsync_Getter(mthis);
-
-  static onsync_Setter(mthis, __arg_0) native "ServiceWorkerGlobalScope_onsync_Setter";
-  onsync_Setter_(mthis, __arg_0) => onsync_Setter(mthis, __arg_0);
-
-  static scope_Getter(mthis) native "ServiceWorkerGlobalScope_scope_Getter";
-  scope_Getter_(mthis) => scope_Getter(mthis);
+  scope_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "scope");
 
 }
 
 class BlinkServiceWorkerRegistration extends BlinkEventTarget {
   static final instance = new BlinkServiceWorkerRegistration();
 
-  static active_Getter(mthis) native "ServiceWorkerRegistration_active_Getter";
-  active_Getter_(mthis) => active_Getter(mthis);
+  active_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "active");
 
-  static installing_Getter(mthis) native "ServiceWorkerRegistration_installing_Getter";
-  installing_Getter_(mthis) => installing_Getter(mthis);
+  installing_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "installing");
 
-  static onupdatefound_Getter(mthis) native "ServiceWorkerRegistration_onupdatefound_Getter";
-  onupdatefound_Getter_(mthis) => onupdatefound_Getter(mthis);
+  onupdatefound_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onupdatefound");
 
-  static onupdatefound_Setter(mthis, __arg_0) native "ServiceWorkerRegistration_onupdatefound_Setter";
-  onupdatefound_Setter_(mthis, __arg_0) => onupdatefound_Setter(mthis, __arg_0);
+  onupdatefound_Setter_(mthis, __arg_0) => mthis["onupdatefound"] = __arg_0;
 
-  static scope_Getter(mthis) native "ServiceWorkerRegistration_scope_Getter";
-  scope_Getter_(mthis) => scope_Getter(mthis);
+  scope_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "scope");
 
-  static unregister_Callback_0(mthis) native "ServiceWorkerRegistration_unregister_Callback";
-  unregister_Callback_0_(mthis) => unregister_Callback_0(mthis);
+  unregister_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "unregister", []);
 
-  static unregister_Callback_1(mthis, __arg_0) native "ServiceWorkerRegistration_unregister_Callback";
-  unregister_Callback_1_(mthis, __arg_0) => unregister_Callback_1(mthis, __arg_0);
-
-  static unregister_Callback_2(mthis, __arg_0, __arg_1) native "ServiceWorkerRegistration_unregister_Callback";
-  unregister_Callback_2_(mthis, __arg_0, __arg_1) => unregister_Callback_2(mthis, __arg_0, __arg_1);
-
-  static waiting_Getter(mthis) native "ServiceWorkerRegistration_waiting_Getter";
-  waiting_Getter_(mthis) => waiting_Getter(mthis);
+  waiting_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "waiting");
 
 }
 
 class BlinkShadowRoot extends BlinkDocumentFragment {
   static final instance = new BlinkShadowRoot();
 
-  static activeElement_Getter(mthis) native "ShadowRoot_activeElement_Getter";
-  activeElement_Getter_(mthis) => activeElement_Getter(mthis);
+  activeElement_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "activeElement");
 
-  static cloneNode_Callback_0(mthis) native "ShadowRoot_cloneNode_Callback";
-  cloneNode_Callback_0_(mthis) => cloneNode_Callback_0(mthis);
+  cloneNode_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "cloneNode", []);
 
-  static cloneNode_Callback_1(mthis, __arg_0) native "ShadowRoot_cloneNode_Callback";
-  cloneNode_Callback_1_(mthis, __arg_0) => cloneNode_Callback_1(mthis, __arg_0);
+  cloneNode_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "cloneNode", [__arg_0]);
 
-  static cloneNode_Callback_2(mthis, __arg_0, __arg_1) native "ShadowRoot_cloneNode_Callback";
-  cloneNode_Callback_2_(mthis, __arg_0, __arg_1) => cloneNode_Callback_2(mthis, __arg_0, __arg_1);
+  elementFromPoint_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "elementFromPoint", []);
 
-  static cloneNode_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "ShadowRoot_cloneNode_Callback";
-  cloneNode_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => cloneNode_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  elementFromPoint_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "elementFromPoint", [__arg_0]);
 
-  static elementFromPoint_Callback_0(mthis) native "ShadowRoot_elementFromPoint_Callback";
-  elementFromPoint_Callback_0_(mthis) => elementFromPoint_Callback_0(mthis);
+  elementFromPoint_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "elementFromPoint", [__arg_0, __arg_1]);
 
-  static elementFromPoint_Callback_1(mthis, __arg_0) native "ShadowRoot_elementFromPoint_Callback";
-  elementFromPoint_Callback_1_(mthis, __arg_0) => elementFromPoint_Callback_1(mthis, __arg_0);
+  getElementById_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getElementById", []);
 
-  static elementFromPoint_Callback_2(mthis, __arg_0, __arg_1) native "ShadowRoot_elementFromPoint_Callback";
-  elementFromPoint_Callback_2_(mthis, __arg_0, __arg_1) => elementFromPoint_Callback_2(mthis, __arg_0, __arg_1);
+  getElementById_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getElementById", [__arg_0]);
 
-  static elementFromPoint_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "ShadowRoot_elementFromPoint_Callback";
-  elementFromPoint_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => elementFromPoint_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  getElementsByClassName_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getElementsByClassName", []);
 
-  static elementFromPoint_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "ShadowRoot_elementFromPoint_Callback";
-  elementFromPoint_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => elementFromPoint_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  getElementsByClassName_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getElementsByClassName", [__arg_0]);
 
-  static getElementById_Callback_0(mthis) native "ShadowRoot_getElementById_Callback";
-  getElementById_Callback_0_(mthis) => getElementById_Callback_0(mthis);
+  getElementsByTagName_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getElementsByTagName", []);
 
-  static getElementById_Callback_1(mthis, __arg_0) native "ShadowRoot_getElementById_Callback";
-  getElementById_Callback_1_(mthis, __arg_0) => getElementById_Callback_1(mthis, __arg_0);
+  getElementsByTagName_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getElementsByTagName", [__arg_0]);
 
-  static getElementById_Callback_2(mthis, __arg_0, __arg_1) native "ShadowRoot_getElementById_Callback";
-  getElementById_Callback_2_(mthis, __arg_0, __arg_1) => getElementById_Callback_2(mthis, __arg_0, __arg_1);
+  getSelection_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getSelection", []);
 
-  static getElementById_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "ShadowRoot_getElementById_Callback";
-  getElementById_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getElementById_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  host_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "host");
 
-  static getElementsByClassName_Callback_0(mthis) native "ShadowRoot_getElementsByClassName_Callback";
-  getElementsByClassName_Callback_0_(mthis) => getElementsByClassName_Callback_0(mthis);
+  innerHTML_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "innerHTML");
 
-  static getElementsByClassName_Callback_1(mthis, __arg_0) native "ShadowRoot_getElementsByClassName_Callback";
-  getElementsByClassName_Callback_1_(mthis, __arg_0) => getElementsByClassName_Callback_1(mthis, __arg_0);
+  innerHTML_Setter_(mthis, __arg_0) => mthis["innerHTML"] = __arg_0;
 
-  static getElementsByClassName_Callback_2(mthis, __arg_0, __arg_1) native "ShadowRoot_getElementsByClassName_Callback";
-  getElementsByClassName_Callback_2_(mthis, __arg_0, __arg_1) => getElementsByClassName_Callback_2(mthis, __arg_0, __arg_1);
+  olderShadowRoot_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "olderShadowRoot");
 
-  static getElementsByClassName_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "ShadowRoot_getElementsByClassName_Callback";
-  getElementsByClassName_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getElementsByClassName_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static getElementsByTagName_Callback_0(mthis) native "ShadowRoot_getElementsByTagName_Callback";
-  getElementsByTagName_Callback_0_(mthis) => getElementsByTagName_Callback_0(mthis);
-
-  static getElementsByTagName_Callback_1(mthis, __arg_0) native "ShadowRoot_getElementsByTagName_Callback";
-  getElementsByTagName_Callback_1_(mthis, __arg_0) => getElementsByTagName_Callback_1(mthis, __arg_0);
-
-  static getElementsByTagName_Callback_2(mthis, __arg_0, __arg_1) native "ShadowRoot_getElementsByTagName_Callback";
-  getElementsByTagName_Callback_2_(mthis, __arg_0, __arg_1) => getElementsByTagName_Callback_2(mthis, __arg_0, __arg_1);
-
-  static getElementsByTagName_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "ShadowRoot_getElementsByTagName_Callback";
-  getElementsByTagName_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getElementsByTagName_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static getSelection_Callback_0(mthis) native "ShadowRoot_getSelection_Callback";
-  getSelection_Callback_0_(mthis) => getSelection_Callback_0(mthis);
-
-  static getSelection_Callback_1(mthis, __arg_0) native "ShadowRoot_getSelection_Callback";
-  getSelection_Callback_1_(mthis, __arg_0) => getSelection_Callback_1(mthis, __arg_0);
-
-  static getSelection_Callback_2(mthis, __arg_0, __arg_1) native "ShadowRoot_getSelection_Callback";
-  getSelection_Callback_2_(mthis, __arg_0, __arg_1) => getSelection_Callback_2(mthis, __arg_0, __arg_1);
-
-  static host_Getter(mthis) native "ShadowRoot_host_Getter";
-  host_Getter_(mthis) => host_Getter(mthis);
-
-  static innerHTML_Getter(mthis) native "ShadowRoot_innerHTML_Getter";
-  innerHTML_Getter_(mthis) => innerHTML_Getter(mthis);
-
-  static innerHTML_Setter(mthis, __arg_0) native "ShadowRoot_innerHTML_Setter";
-  innerHTML_Setter_(mthis, __arg_0) => innerHTML_Setter(mthis, __arg_0);
-
-  static olderShadowRoot_Getter(mthis) native "ShadowRoot_olderShadowRoot_Getter";
-  olderShadowRoot_Getter_(mthis) => olderShadowRoot_Getter(mthis);
-
-  static styleSheets_Getter(mthis) native "ShadowRoot_styleSheets_Getter";
-  styleSheets_Getter_(mthis) => styleSheets_Getter(mthis);
+  styleSheets_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "styleSheets");
 
 }
 
 class BlinkSharedWorker extends BlinkEventTarget {
   static final instance = new BlinkSharedWorker();
 
-  static constructorCallback_0() native "SharedWorker_constructorCallback";
-  constructorCallback_0_() => constructorCallback_0();
+  constructorCallback_0_() => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "SharedWorker"), []);
 
-  static constructorCallback_1(__arg_0) native "SharedWorker_constructorCallback";
-  constructorCallback_1_(__arg_0) => constructorCallback_1(__arg_0);
+  constructorCallback_1_(__arg_0) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "SharedWorker"), [__arg_0]);
 
-  static constructorCallback_2(__arg_0, __arg_1) native "SharedWorker_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  constructorCallback_2_(__arg_0, __arg_1) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "SharedWorker"), [__arg_0, __arg_1]);
 
-  static constructorCallback_3(__arg_0, __arg_1, __arg_2) native "SharedWorker_constructorCallback";
-  constructorCallback_3_(__arg_0, __arg_1, __arg_2) => constructorCallback_3(__arg_0, __arg_1, __arg_2);
+  onerror_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onerror");
 
-  static constructorCallback_4(__arg_0, __arg_1, __arg_2, __arg_3) native "SharedWorker_constructorCallback";
-  constructorCallback_4_(__arg_0, __arg_1, __arg_2, __arg_3) => constructorCallback_4(__arg_0, __arg_1, __arg_2, __arg_3);
+  onerror_Setter_(mthis, __arg_0) => mthis["onerror"] = __arg_0;
 
-  static onerror_Getter(mthis) native "SharedWorker_onerror_Getter";
-  onerror_Getter_(mthis) => onerror_Getter(mthis);
+  port_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "port");
 
-  static onerror_Setter(mthis, __arg_0) native "SharedWorker_onerror_Setter";
-  onerror_Setter_(mthis, __arg_0) => onerror_Setter(mthis, __arg_0);
-
-  static port_Getter(mthis) native "SharedWorker_port_Getter";
-  port_Getter_(mthis) => port_Getter(mthis);
-
-  static workerStart_Getter(mthis) native "SharedWorker_workerStart_Getter";
-  workerStart_Getter_(mthis) => workerStart_Getter(mthis);
+  workerStart_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "workerStart");
 
 }
 
 class BlinkSharedWorkerGlobalScope extends BlinkWorkerGlobalScope {
   static final instance = new BlinkSharedWorkerGlobalScope();
 
-  static name_Getter(mthis) native "SharedWorkerGlobalScope_name_Getter";
-  name_Getter_(mthis) => name_Getter(mthis);
+  name_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "name");
 
-  static onconnect_Getter(mthis) native "SharedWorkerGlobalScope_onconnect_Getter";
-  onconnect_Getter_(mthis) => onconnect_Getter(mthis);
+  onconnect_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onconnect");
 
-  static onconnect_Setter(mthis, __arg_0) native "SharedWorkerGlobalScope_onconnect_Setter";
-  onconnect_Setter_(mthis, __arg_0) => onconnect_Setter(mthis, __arg_0);
+  onconnect_Setter_(mthis, __arg_0) => mthis["onconnect"] = __arg_0;
 
 }
 
 class BlinkSourceBuffer extends BlinkEventTarget {
   static final instance = new BlinkSourceBuffer();
 
-  static abort_Callback_0(mthis) native "SourceBuffer_abort_Callback";
-  abort_Callback_0_(mthis) => abort_Callback_0(mthis);
+  abort_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "abort", []);
 
-  static abort_Callback_1(mthis, __arg_0) native "SourceBuffer_abort_Callback";
-  abort_Callback_1_(mthis, __arg_0) => abort_Callback_1(mthis, __arg_0);
+  appendBuffer_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "appendBuffer", []);
 
-  static abort_Callback_2(mthis, __arg_0, __arg_1) native "SourceBuffer_abort_Callback";
-  abort_Callback_2_(mthis, __arg_0, __arg_1) => abort_Callback_2(mthis, __arg_0, __arg_1);
+  appendBuffer_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "appendBuffer", [__arg_0]);
 
-  static appendBuffer_Callback_0(mthis) native "SourceBuffer_appendBuffer_Callback";
-  appendBuffer_Callback_0_(mthis) => appendBuffer_Callback_0(mthis);
+  appendStream_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "appendStream", []);
 
-  static appendBuffer_Callback_1(mthis, __arg_0) native "SourceBuffer_appendBuffer_Callback";
-  appendBuffer_Callback_1_(mthis, __arg_0) => appendBuffer_Callback_1(mthis, __arg_0);
+  appendStream_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "appendStream", [__arg_0]);
 
-  static appendBuffer_Callback_2(mthis, __arg_0, __arg_1) native "SourceBuffer_appendBuffer_Callback";
-  appendBuffer_Callback_2_(mthis, __arg_0, __arg_1) => appendBuffer_Callback_2(mthis, __arg_0, __arg_1);
+  appendStream_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "appendStream", [__arg_0, __arg_1]);
 
-  static appendBuffer_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SourceBuffer_appendBuffer_Callback";
-  appendBuffer_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => appendBuffer_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  appendWindowEnd_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "appendWindowEnd");
 
-  static appendStream_Callback_0(mthis) native "SourceBuffer_appendStream_Callback";
-  appendStream_Callback_0_(mthis) => appendStream_Callback_0(mthis);
+  appendWindowEnd_Setter_(mthis, __arg_0) => mthis["appendWindowEnd"] = __arg_0;
 
-  static appendStream_Callback_1(mthis, __arg_0) native "SourceBuffer_appendStream_Callback";
-  appendStream_Callback_1_(mthis, __arg_0) => appendStream_Callback_1(mthis, __arg_0);
+  appendWindowStart_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "appendWindowStart");
 
-  static appendStream_Callback_2(mthis, __arg_0, __arg_1) native "SourceBuffer_appendStream_Callback";
-  appendStream_Callback_2_(mthis, __arg_0, __arg_1) => appendStream_Callback_2(mthis, __arg_0, __arg_1);
+  appendWindowStart_Setter_(mthis, __arg_0) => mthis["appendWindowStart"] = __arg_0;
 
-  static appendStream_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SourceBuffer_appendStream_Callback";
-  appendStream_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => appendStream_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  buffered_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "buffered");
 
-  static appendStream_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "SourceBuffer_appendStream_Callback";
-  appendStream_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => appendStream_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  mode_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "mode");
 
-  static appendWindowEnd_Getter(mthis) native "SourceBuffer_appendWindowEnd_Getter";
-  appendWindowEnd_Getter_(mthis) => appendWindowEnd_Getter(mthis);
+  mode_Setter_(mthis, __arg_0) => mthis["mode"] = __arg_0;
 
-  static appendWindowEnd_Setter(mthis, __arg_0) native "SourceBuffer_appendWindowEnd_Setter";
-  appendWindowEnd_Setter_(mthis, __arg_0) => appendWindowEnd_Setter(mthis, __arg_0);
+  remove_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "remove", []);
 
-  static appendWindowStart_Getter(mthis) native "SourceBuffer_appendWindowStart_Getter";
-  appendWindowStart_Getter_(mthis) => appendWindowStart_Getter(mthis);
+  remove_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "remove", [__arg_0]);
 
-  static appendWindowStart_Setter(mthis, __arg_0) native "SourceBuffer_appendWindowStart_Setter";
-  appendWindowStart_Setter_(mthis, __arg_0) => appendWindowStart_Setter(mthis, __arg_0);
+  remove_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "remove", [__arg_0, __arg_1]);
 
-  static buffered_Getter(mthis) native "SourceBuffer_buffered_Getter";
-  buffered_Getter_(mthis) => buffered_Getter(mthis);
+  timestampOffset_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "timestampOffset");
 
-  static mode_Getter(mthis) native "SourceBuffer_mode_Getter";
-  mode_Getter_(mthis) => mode_Getter(mthis);
+  timestampOffset_Setter_(mthis, __arg_0) => mthis["timestampOffset"] = __arg_0;
 
-  static mode_Setter(mthis, __arg_0) native "SourceBuffer_mode_Setter";
-  mode_Setter_(mthis, __arg_0) => mode_Setter(mthis, __arg_0);
-
-  static remove_Callback_0(mthis) native "SourceBuffer_remove_Callback";
-  remove_Callback_0_(mthis) => remove_Callback_0(mthis);
-
-  static remove_Callback_1(mthis, __arg_0) native "SourceBuffer_remove_Callback";
-  remove_Callback_1_(mthis, __arg_0) => remove_Callback_1(mthis, __arg_0);
-
-  static remove_Callback_2(mthis, __arg_0, __arg_1) native "SourceBuffer_remove_Callback";
-  remove_Callback_2_(mthis, __arg_0, __arg_1) => remove_Callback_2(mthis, __arg_0, __arg_1);
-
-  static remove_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SourceBuffer_remove_Callback";
-  remove_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => remove_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static remove_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "SourceBuffer_remove_Callback";
-  remove_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => remove_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static timestampOffset_Getter(mthis) native "SourceBuffer_timestampOffset_Getter";
-  timestampOffset_Getter_(mthis) => timestampOffset_Getter(mthis);
-
-  static timestampOffset_Setter(mthis, __arg_0) native "SourceBuffer_timestampOffset_Setter";
-  timestampOffset_Setter_(mthis, __arg_0) => timestampOffset_Setter(mthis, __arg_0);
-
-  static updating_Getter(mthis) native "SourceBuffer_updating_Getter";
-  updating_Getter_(mthis) => updating_Getter(mthis);
+  updating_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "updating");
 
 }
 
 class BlinkSourceBufferList extends BlinkEventTarget {
   static final instance = new BlinkSourceBufferList();
 
-  static $__getter___Callback_1(mthis, __arg_0) native "SourceBufferList___getter___Callback";
-  $__getter___Callback_1_(mthis, __arg_0) => $__getter___Callback_1(mthis, __arg_0);
+  $__getter___Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "__getter__", [__arg_0]);
 
-  static item_Callback_0(mthis) native "SourceBufferList_item_Callback";
-  item_Callback_0_(mthis) => item_Callback_0(mthis);
+  item_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "item", []);
 
-  static item_Callback_1(mthis, __arg_0) native "SourceBufferList_item_Callback";
-  item_Callback_1_(mthis, __arg_0) => item_Callback_1(mthis, __arg_0);
+  item_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "item", [__arg_0]);
 
-  static item_Callback_2(mthis, __arg_0, __arg_1) native "SourceBufferList_item_Callback";
-  item_Callback_2_(mthis, __arg_0, __arg_1) => item_Callback_2(mthis, __arg_0, __arg_1);
-
-  static item_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SourceBufferList_item_Callback";
-  item_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => item_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static length_Getter(mthis) native "SourceBufferList_length_Getter";
-  length_Getter_(mthis) => length_Getter(mthis);
+  length_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "length");
 
 }
 
 class BlinkSourceInfo {
   static final instance = new BlinkSourceInfo();
 
-  static facing_Getter(mthis) native "SourceInfo_facing_Getter";
-  facing_Getter_(mthis) => facing_Getter(mthis);
+  facing_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "facing");
 
-  static id_Getter(mthis) native "SourceInfo_id_Getter";
-  id_Getter_(mthis) => id_Getter(mthis);
+  id_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "id");
 
-  static kind_Getter(mthis) native "SourceInfo_kind_Getter";
-  kind_Getter_(mthis) => kind_Getter(mthis);
+  kind_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "kind");
 
-  static label_Getter(mthis) native "SourceInfo_label_Getter";
-  label_Getter_(mthis) => label_Getter(mthis);
+  label_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "label");
 
 }
 
 class BlinkSpeechGrammar {
   static final instance = new BlinkSpeechGrammar();
 
-  static constructorCallback_0() native "SpeechGrammar_constructorCallback";
-  constructorCallback_0_() => constructorCallback_0();
+  constructorCallback_0_() => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "SpeechGrammar"), []);
 
-  static constructorCallback_1(__arg_0) native "SpeechGrammar_constructorCallback";
-  constructorCallback_1_(__arg_0) => constructorCallback_1(__arg_0);
+  src_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "src");
 
-  static constructorCallback_2(__arg_0, __arg_1) native "SpeechGrammar_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  src_Setter_(mthis, __arg_0) => mthis["src"] = __arg_0;
 
-  static src_Getter(mthis) native "SpeechGrammar_src_Getter";
-  src_Getter_(mthis) => src_Getter(mthis);
+  weight_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "weight");
 
-  static src_Setter(mthis, __arg_0) native "SpeechGrammar_src_Setter";
-  src_Setter_(mthis, __arg_0) => src_Setter(mthis, __arg_0);
-
-  static weight_Getter(mthis) native "SpeechGrammar_weight_Getter";
-  weight_Getter_(mthis) => weight_Getter(mthis);
-
-  static weight_Setter(mthis, __arg_0) native "SpeechGrammar_weight_Setter";
-  weight_Setter_(mthis, __arg_0) => weight_Setter(mthis, __arg_0);
+  weight_Setter_(mthis, __arg_0) => mthis["weight"] = __arg_0;
 
 }
 
 class BlinkSpeechGrammarList {
   static final instance = new BlinkSpeechGrammarList();
 
-  static $__getter___Callback_1(mthis, __arg_0) native "SpeechGrammarList___getter___Callback";
-  $__getter___Callback_1_(mthis, __arg_0) => $__getter___Callback_1(mthis, __arg_0);
+  $__getter___Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "__getter__", [__arg_0]);
 
-  static addFromString_Callback_0(mthis) native "SpeechGrammarList_addFromString_Callback";
-  addFromString_Callback_0_(mthis) => addFromString_Callback_0(mthis);
+  addFromString_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "addFromString", []);
 
-  static addFromString_Callback_1(mthis, __arg_0) native "SpeechGrammarList_addFromString_Callback";
-  addFromString_Callback_1_(mthis, __arg_0) => addFromString_Callback_1(mthis, __arg_0);
+  addFromString_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "addFromString", [__arg_0]);
 
-  static addFromString_Callback_2(mthis, __arg_0, __arg_1) native "SpeechGrammarList_addFromString_Callback";
-  addFromString_Callback_2_(mthis, __arg_0, __arg_1) => addFromString_Callback_2(mthis, __arg_0, __arg_1);
+  addFromString_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "addFromString", [__arg_0, __arg_1]);
 
-  static addFromString_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SpeechGrammarList_addFromString_Callback";
-  addFromString_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => addFromString_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  addFromUri_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "addFromUri", []);
 
-  static addFromString_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "SpeechGrammarList_addFromString_Callback";
-  addFromString_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => addFromString_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  addFromUri_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "addFromUri", [__arg_0]);
 
-  static addFromUri_Callback_0(mthis) native "SpeechGrammarList_addFromUri_Callback";
-  addFromUri_Callback_0_(mthis) => addFromUri_Callback_0(mthis);
+  addFromUri_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "addFromUri", [__arg_0, __arg_1]);
 
-  static addFromUri_Callback_1(mthis, __arg_0) native "SpeechGrammarList_addFromUri_Callback";
-  addFromUri_Callback_1_(mthis, __arg_0) => addFromUri_Callback_1(mthis, __arg_0);
+  constructorCallback_0_() => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "SpeechGrammarList"), []);
 
-  static addFromUri_Callback_2(mthis, __arg_0, __arg_1) native "SpeechGrammarList_addFromUri_Callback";
-  addFromUri_Callback_2_(mthis, __arg_0, __arg_1) => addFromUri_Callback_2(mthis, __arg_0, __arg_1);
+  item_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "item", []);
 
-  static addFromUri_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SpeechGrammarList_addFromUri_Callback";
-  addFromUri_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => addFromUri_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  item_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "item", [__arg_0]);
 
-  static addFromUri_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "SpeechGrammarList_addFromUri_Callback";
-  addFromUri_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => addFromUri_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static constructorCallback_0() native "SpeechGrammarList_constructorCallback";
-  constructorCallback_0_() => constructorCallback_0();
-
-  static constructorCallback_1(__arg_0) native "SpeechGrammarList_constructorCallback";
-  constructorCallback_1_(__arg_0) => constructorCallback_1(__arg_0);
-
-  static constructorCallback_2(__arg_0, __arg_1) native "SpeechGrammarList_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
-
-  static item_Callback_0(mthis) native "SpeechGrammarList_item_Callback";
-  item_Callback_0_(mthis) => item_Callback_0(mthis);
-
-  static item_Callback_1(mthis, __arg_0) native "SpeechGrammarList_item_Callback";
-  item_Callback_1_(mthis, __arg_0) => item_Callback_1(mthis, __arg_0);
-
-  static item_Callback_2(mthis, __arg_0, __arg_1) native "SpeechGrammarList_item_Callback";
-  item_Callback_2_(mthis, __arg_0, __arg_1) => item_Callback_2(mthis, __arg_0, __arg_1);
-
-  static item_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SpeechGrammarList_item_Callback";
-  item_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => item_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static length_Getter(mthis) native "SpeechGrammarList_length_Getter";
-  length_Getter_(mthis) => length_Getter(mthis);
+  length_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "length");
 
 }
 
 class BlinkSpeechRecognition extends BlinkEventTarget {
   static final instance = new BlinkSpeechRecognition();
 
-  static abort_Callback_0(mthis) native "SpeechRecognition_abort_Callback";
-  abort_Callback_0_(mthis) => abort_Callback_0(mthis);
+  abort_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "abort", []);
 
-  static abort_Callback_1(mthis, __arg_0) native "SpeechRecognition_abort_Callback";
-  abort_Callback_1_(mthis, __arg_0) => abort_Callback_1(mthis, __arg_0);
+  constructorCallback_0_() => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "webkitSpeechRecognition"), []);
 
-  static abort_Callback_2(mthis, __arg_0, __arg_1) native "SpeechRecognition_abort_Callback";
-  abort_Callback_2_(mthis, __arg_0, __arg_1) => abort_Callback_2(mthis, __arg_0, __arg_1);
+  continuous_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "continuous");
 
-  static constructorCallback_0() native "SpeechRecognition_constructorCallback";
-  constructorCallback_0_() => constructorCallback_0();
+  continuous_Setter_(mthis, __arg_0) => mthis["continuous"] = __arg_0;
 
-  static constructorCallback_1(__arg_0) native "SpeechRecognition_constructorCallback";
-  constructorCallback_1_(__arg_0) => constructorCallback_1(__arg_0);
+  grammars_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "grammars");
 
-  static constructorCallback_2(__arg_0, __arg_1) native "SpeechRecognition_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  grammars_Setter_(mthis, __arg_0) => mthis["grammars"] = __arg_0;
 
-  static continuous_Getter(mthis) native "SpeechRecognition_continuous_Getter";
-  continuous_Getter_(mthis) => continuous_Getter(mthis);
+  interimResults_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "interimResults");
 
-  static continuous_Setter(mthis, __arg_0) native "SpeechRecognition_continuous_Setter";
-  continuous_Setter_(mthis, __arg_0) => continuous_Setter(mthis, __arg_0);
+  interimResults_Setter_(mthis, __arg_0) => mthis["interimResults"] = __arg_0;
 
-  static grammars_Getter(mthis) native "SpeechRecognition_grammars_Getter";
-  grammars_Getter_(mthis) => grammars_Getter(mthis);
+  lang_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "lang");
 
-  static grammars_Setter(mthis, __arg_0) native "SpeechRecognition_grammars_Setter";
-  grammars_Setter_(mthis, __arg_0) => grammars_Setter(mthis, __arg_0);
+  lang_Setter_(mthis, __arg_0) => mthis["lang"] = __arg_0;
 
-  static interimResults_Getter(mthis) native "SpeechRecognition_interimResults_Getter";
-  interimResults_Getter_(mthis) => interimResults_Getter(mthis);
+  maxAlternatives_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "maxAlternatives");
 
-  static interimResults_Setter(mthis, __arg_0) native "SpeechRecognition_interimResults_Setter";
-  interimResults_Setter_(mthis, __arg_0) => interimResults_Setter(mthis, __arg_0);
+  maxAlternatives_Setter_(mthis, __arg_0) => mthis["maxAlternatives"] = __arg_0;
 
-  static lang_Getter(mthis) native "SpeechRecognition_lang_Getter";
-  lang_Getter_(mthis) => lang_Getter(mthis);
+  onaudioend_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onaudioend");
 
-  static lang_Setter(mthis, __arg_0) native "SpeechRecognition_lang_Setter";
-  lang_Setter_(mthis, __arg_0) => lang_Setter(mthis, __arg_0);
+  onaudioend_Setter_(mthis, __arg_0) => mthis["onaudioend"] = __arg_0;
 
-  static maxAlternatives_Getter(mthis) native "SpeechRecognition_maxAlternatives_Getter";
-  maxAlternatives_Getter_(mthis) => maxAlternatives_Getter(mthis);
+  onaudiostart_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onaudiostart");
 
-  static maxAlternatives_Setter(mthis, __arg_0) native "SpeechRecognition_maxAlternatives_Setter";
-  maxAlternatives_Setter_(mthis, __arg_0) => maxAlternatives_Setter(mthis, __arg_0);
+  onaudiostart_Setter_(mthis, __arg_0) => mthis["onaudiostart"] = __arg_0;
 
-  static onaudioend_Getter(mthis) native "SpeechRecognition_onaudioend_Getter";
-  onaudioend_Getter_(mthis) => onaudioend_Getter(mthis);
+  onend_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onend");
 
-  static onaudioend_Setter(mthis, __arg_0) native "SpeechRecognition_onaudioend_Setter";
-  onaudioend_Setter_(mthis, __arg_0) => onaudioend_Setter(mthis, __arg_0);
+  onend_Setter_(mthis, __arg_0) => mthis["onend"] = __arg_0;
 
-  static onaudiostart_Getter(mthis) native "SpeechRecognition_onaudiostart_Getter";
-  onaudiostart_Getter_(mthis) => onaudiostart_Getter(mthis);
+  onerror_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onerror");
 
-  static onaudiostart_Setter(mthis, __arg_0) native "SpeechRecognition_onaudiostart_Setter";
-  onaudiostart_Setter_(mthis, __arg_0) => onaudiostart_Setter(mthis, __arg_0);
+  onerror_Setter_(mthis, __arg_0) => mthis["onerror"] = __arg_0;
 
-  static onend_Getter(mthis) native "SpeechRecognition_onend_Getter";
-  onend_Getter_(mthis) => onend_Getter(mthis);
+  onnomatch_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onnomatch");
 
-  static onend_Setter(mthis, __arg_0) native "SpeechRecognition_onend_Setter";
-  onend_Setter_(mthis, __arg_0) => onend_Setter(mthis, __arg_0);
+  onnomatch_Setter_(mthis, __arg_0) => mthis["onnomatch"] = __arg_0;
 
-  static onerror_Getter(mthis) native "SpeechRecognition_onerror_Getter";
-  onerror_Getter_(mthis) => onerror_Getter(mthis);
+  onresult_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onresult");
 
-  static onerror_Setter(mthis, __arg_0) native "SpeechRecognition_onerror_Setter";
-  onerror_Setter_(mthis, __arg_0) => onerror_Setter(mthis, __arg_0);
+  onresult_Setter_(mthis, __arg_0) => mthis["onresult"] = __arg_0;
 
-  static onnomatch_Getter(mthis) native "SpeechRecognition_onnomatch_Getter";
-  onnomatch_Getter_(mthis) => onnomatch_Getter(mthis);
+  onsoundend_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onsoundend");
 
-  static onnomatch_Setter(mthis, __arg_0) native "SpeechRecognition_onnomatch_Setter";
-  onnomatch_Setter_(mthis, __arg_0) => onnomatch_Setter(mthis, __arg_0);
+  onsoundend_Setter_(mthis, __arg_0) => mthis["onsoundend"] = __arg_0;
 
-  static onresult_Getter(mthis) native "SpeechRecognition_onresult_Getter";
-  onresult_Getter_(mthis) => onresult_Getter(mthis);
+  onsoundstart_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onsoundstart");
 
-  static onresult_Setter(mthis, __arg_0) native "SpeechRecognition_onresult_Setter";
-  onresult_Setter_(mthis, __arg_0) => onresult_Setter(mthis, __arg_0);
+  onsoundstart_Setter_(mthis, __arg_0) => mthis["onsoundstart"] = __arg_0;
 
-  static onsoundend_Getter(mthis) native "SpeechRecognition_onsoundend_Getter";
-  onsoundend_Getter_(mthis) => onsoundend_Getter(mthis);
+  onspeechend_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onspeechend");
 
-  static onsoundend_Setter(mthis, __arg_0) native "SpeechRecognition_onsoundend_Setter";
-  onsoundend_Setter_(mthis, __arg_0) => onsoundend_Setter(mthis, __arg_0);
+  onspeechend_Setter_(mthis, __arg_0) => mthis["onspeechend"] = __arg_0;
 
-  static onsoundstart_Getter(mthis) native "SpeechRecognition_onsoundstart_Getter";
-  onsoundstart_Getter_(mthis) => onsoundstart_Getter(mthis);
+  onspeechstart_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onspeechstart");
 
-  static onsoundstart_Setter(mthis, __arg_0) native "SpeechRecognition_onsoundstart_Setter";
-  onsoundstart_Setter_(mthis, __arg_0) => onsoundstart_Setter(mthis, __arg_0);
+  onspeechstart_Setter_(mthis, __arg_0) => mthis["onspeechstart"] = __arg_0;
 
-  static onspeechend_Getter(mthis) native "SpeechRecognition_onspeechend_Getter";
-  onspeechend_Getter_(mthis) => onspeechend_Getter(mthis);
+  onstart_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onstart");
 
-  static onspeechend_Setter(mthis, __arg_0) native "SpeechRecognition_onspeechend_Setter";
-  onspeechend_Setter_(mthis, __arg_0) => onspeechend_Setter(mthis, __arg_0);
+  onstart_Setter_(mthis, __arg_0) => mthis["onstart"] = __arg_0;
 
-  static onspeechstart_Getter(mthis) native "SpeechRecognition_onspeechstart_Getter";
-  onspeechstart_Getter_(mthis) => onspeechstart_Getter(mthis);
+  start_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "start", []);
 
-  static onspeechstart_Setter(mthis, __arg_0) native "SpeechRecognition_onspeechstart_Setter";
-  onspeechstart_Setter_(mthis, __arg_0) => onspeechstart_Setter(mthis, __arg_0);
-
-  static onstart_Getter(mthis) native "SpeechRecognition_onstart_Getter";
-  onstart_Getter_(mthis) => onstart_Getter(mthis);
-
-  static onstart_Setter(mthis, __arg_0) native "SpeechRecognition_onstart_Setter";
-  onstart_Setter_(mthis, __arg_0) => onstart_Setter(mthis, __arg_0);
-
-  static start_Callback_0(mthis) native "SpeechRecognition_start_Callback";
-  start_Callback_0_(mthis) => start_Callback_0(mthis);
-
-  static start_Callback_1(mthis, __arg_0) native "SpeechRecognition_start_Callback";
-  start_Callback_1_(mthis, __arg_0) => start_Callback_1(mthis, __arg_0);
-
-  static start_Callback_2(mthis, __arg_0, __arg_1) native "SpeechRecognition_start_Callback";
-  start_Callback_2_(mthis, __arg_0, __arg_1) => start_Callback_2(mthis, __arg_0, __arg_1);
-
-  static stop_Callback_0(mthis) native "SpeechRecognition_stop_Callback";
-  stop_Callback_0_(mthis) => stop_Callback_0(mthis);
-
-  static stop_Callback_1(mthis, __arg_0) native "SpeechRecognition_stop_Callback";
-  stop_Callback_1_(mthis, __arg_0) => stop_Callback_1(mthis, __arg_0);
-
-  static stop_Callback_2(mthis, __arg_0, __arg_1) native "SpeechRecognition_stop_Callback";
-  stop_Callback_2_(mthis, __arg_0, __arg_1) => stop_Callback_2(mthis, __arg_0, __arg_1);
+  stop_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "stop", []);
 
 }
 
 class BlinkSpeechRecognitionAlternative {
   static final instance = new BlinkSpeechRecognitionAlternative();
 
-  static confidence_Getter(mthis) native "SpeechRecognitionAlternative_confidence_Getter";
-  confidence_Getter_(mthis) => confidence_Getter(mthis);
+  confidence_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "confidence");
 
-  static transcript_Getter(mthis) native "SpeechRecognitionAlternative_transcript_Getter";
-  transcript_Getter_(mthis) => transcript_Getter(mthis);
+  transcript_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "transcript");
 
 }
 
 class BlinkSpeechRecognitionError extends BlinkEvent {
   static final instance = new BlinkSpeechRecognitionError();
 
-  static constructorCallback_2(__arg_0, __arg_1) native "SpeechRecognitionError_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  constructorCallback_2_(__arg_0, __arg_1) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "SpeechRecognitionError"), [__arg_0, __arg_1]);
 
-  static error_Getter(mthis) native "SpeechRecognitionError_error_Getter";
-  error_Getter_(mthis) => error_Getter(mthis);
+  error_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "error");
 
-  static message_Getter(mthis) native "SpeechRecognitionError_message_Getter";
-  message_Getter_(mthis) => message_Getter(mthis);
+  message_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "message");
 
 }
 
 class BlinkSpeechRecognitionEvent extends BlinkEvent {
   static final instance = new BlinkSpeechRecognitionEvent();
 
-  static constructorCallback_2(__arg_0, __arg_1) native "SpeechRecognitionEvent_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  constructorCallback_2_(__arg_0, __arg_1) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "SpeechRecognitionEvent"), [__arg_0, __arg_1]);
 
-  static emma_Getter(mthis) native "SpeechRecognitionEvent_emma_Getter";
-  emma_Getter_(mthis) => emma_Getter(mthis);
+  emma_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "emma");
 
-  static interpretation_Getter(mthis) native "SpeechRecognitionEvent_interpretation_Getter";
-  interpretation_Getter_(mthis) => interpretation_Getter(mthis);
+  interpretation_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "interpretation");
 
-  static resultIndex_Getter(mthis) native "SpeechRecognitionEvent_resultIndex_Getter";
-  resultIndex_Getter_(mthis) => resultIndex_Getter(mthis);
+  resultIndex_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "resultIndex");
 
-  static results_Getter(mthis) native "SpeechRecognitionEvent_results_Getter";
-  results_Getter_(mthis) => results_Getter(mthis);
+  results_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "results");
 
 }
 
 class BlinkSpeechRecognitionResult {
   static final instance = new BlinkSpeechRecognitionResult();
 
-  static $__getter___Callback_1(mthis, __arg_0) native "SpeechRecognitionResult___getter___Callback";
-  $__getter___Callback_1_(mthis, __arg_0) => $__getter___Callback_1(mthis, __arg_0);
+  $__getter___Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "__getter__", [__arg_0]);
 
-  static isFinal_Getter(mthis) native "SpeechRecognitionResult_isFinal_Getter";
-  isFinal_Getter_(mthis) => isFinal_Getter(mthis);
+  isFinal_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "isFinal");
 
-  static item_Callback_0(mthis) native "SpeechRecognitionResult_item_Callback";
-  item_Callback_0_(mthis) => item_Callback_0(mthis);
+  item_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "item", []);
 
-  static item_Callback_1(mthis, __arg_0) native "SpeechRecognitionResult_item_Callback";
-  item_Callback_1_(mthis, __arg_0) => item_Callback_1(mthis, __arg_0);
+  item_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "item", [__arg_0]);
 
-  static item_Callback_2(mthis, __arg_0, __arg_1) native "SpeechRecognitionResult_item_Callback";
-  item_Callback_2_(mthis, __arg_0, __arg_1) => item_Callback_2(mthis, __arg_0, __arg_1);
-
-  static item_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SpeechRecognitionResult_item_Callback";
-  item_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => item_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static length_Getter(mthis) native "SpeechRecognitionResult_length_Getter";
-  length_Getter_(mthis) => length_Getter(mthis);
+  length_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "length");
 
 }
 
 class BlinkSpeechRecognitionResultList {
   static final instance = new BlinkSpeechRecognitionResultList();
 
-  static $__getter___Callback_1(mthis, __arg_0) native "SpeechRecognitionResultList___getter___Callback";
-  $__getter___Callback_1_(mthis, __arg_0) => $__getter___Callback_1(mthis, __arg_0);
+  $__getter___Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "__getter__", [__arg_0]);
 
-  static item_Callback_0(mthis) native "SpeechRecognitionResultList_item_Callback";
-  item_Callback_0_(mthis) => item_Callback_0(mthis);
+  item_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "item", []);
 
-  static item_Callback_1(mthis, __arg_0) native "SpeechRecognitionResultList_item_Callback";
-  item_Callback_1_(mthis, __arg_0) => item_Callback_1(mthis, __arg_0);
+  item_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "item", [__arg_0]);
 
-  static item_Callback_2(mthis, __arg_0, __arg_1) native "SpeechRecognitionResultList_item_Callback";
-  item_Callback_2_(mthis, __arg_0, __arg_1) => item_Callback_2(mthis, __arg_0, __arg_1);
-
-  static item_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SpeechRecognitionResultList_item_Callback";
-  item_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => item_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static length_Getter(mthis) native "SpeechRecognitionResultList_length_Getter";
-  length_Getter_(mthis) => length_Getter(mthis);
+  length_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "length");
 
 }
 
 class BlinkSpeechSynthesis extends BlinkEventTarget {
   static final instance = new BlinkSpeechSynthesis();
 
-  static cancel_Callback_0(mthis) native "SpeechSynthesis_cancel_Callback";
-  cancel_Callback_0_(mthis) => cancel_Callback_0(mthis);
+  cancel_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "cancel", []);
 
-  static cancel_Callback_1(mthis, __arg_0) native "SpeechSynthesis_cancel_Callback";
-  cancel_Callback_1_(mthis, __arg_0) => cancel_Callback_1(mthis, __arg_0);
+  getVoices_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getVoices", []);
 
-  static cancel_Callback_2(mthis, __arg_0, __arg_1) native "SpeechSynthesis_cancel_Callback";
-  cancel_Callback_2_(mthis, __arg_0, __arg_1) => cancel_Callback_2(mthis, __arg_0, __arg_1);
+  onvoiceschanged_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onvoiceschanged");
 
-  static getVoices_Callback_0(mthis) native "SpeechSynthesis_getVoices_Callback";
-  getVoices_Callback_0_(mthis) => getVoices_Callback_0(mthis);
+  onvoiceschanged_Setter_(mthis, __arg_0) => mthis["onvoiceschanged"] = __arg_0;
 
-  static getVoices_Callback_1(mthis, __arg_0) native "SpeechSynthesis_getVoices_Callback";
-  getVoices_Callback_1_(mthis, __arg_0) => getVoices_Callback_1(mthis, __arg_0);
+  pause_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "pause", []);
 
-  static getVoices_Callback_2(mthis, __arg_0, __arg_1) native "SpeechSynthesis_getVoices_Callback";
-  getVoices_Callback_2_(mthis, __arg_0, __arg_1) => getVoices_Callback_2(mthis, __arg_0, __arg_1);
+  paused_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "paused");
 
-  static onvoiceschanged_Getter(mthis) native "SpeechSynthesis_onvoiceschanged_Getter";
-  onvoiceschanged_Getter_(mthis) => onvoiceschanged_Getter(mthis);
+  pending_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "pending");
 
-  static onvoiceschanged_Setter(mthis, __arg_0) native "SpeechSynthesis_onvoiceschanged_Setter";
-  onvoiceschanged_Setter_(mthis, __arg_0) => onvoiceschanged_Setter(mthis, __arg_0);
+  resume_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "resume", []);
 
-  static pause_Callback_0(mthis) native "SpeechSynthesis_pause_Callback";
-  pause_Callback_0_(mthis) => pause_Callback_0(mthis);
+  speak_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "speak", []);
 
-  static pause_Callback_1(mthis, __arg_0) native "SpeechSynthesis_pause_Callback";
-  pause_Callback_1_(mthis, __arg_0) => pause_Callback_1(mthis, __arg_0);
+  speak_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "speak", [__arg_0]);
 
-  static pause_Callback_2(mthis, __arg_0, __arg_1) native "SpeechSynthesis_pause_Callback";
-  pause_Callback_2_(mthis, __arg_0, __arg_1) => pause_Callback_2(mthis, __arg_0, __arg_1);
-
-  static paused_Getter(mthis) native "SpeechSynthesis_paused_Getter";
-  paused_Getter_(mthis) => paused_Getter(mthis);
-
-  static pending_Getter(mthis) native "SpeechSynthesis_pending_Getter";
-  pending_Getter_(mthis) => pending_Getter(mthis);
-
-  static resume_Callback_0(mthis) native "SpeechSynthesis_resume_Callback";
-  resume_Callback_0_(mthis) => resume_Callback_0(mthis);
-
-  static resume_Callback_1(mthis, __arg_0) native "SpeechSynthesis_resume_Callback";
-  resume_Callback_1_(mthis, __arg_0) => resume_Callback_1(mthis, __arg_0);
-
-  static resume_Callback_2(mthis, __arg_0, __arg_1) native "SpeechSynthesis_resume_Callback";
-  resume_Callback_2_(mthis, __arg_0, __arg_1) => resume_Callback_2(mthis, __arg_0, __arg_1);
-
-  static speak_Callback_0(mthis) native "SpeechSynthesis_speak_Callback";
-  speak_Callback_0_(mthis) => speak_Callback_0(mthis);
-
-  static speak_Callback_1(mthis, __arg_0) native "SpeechSynthesis_speak_Callback";
-  speak_Callback_1_(mthis, __arg_0) => speak_Callback_1(mthis, __arg_0);
-
-  static speak_Callback_2(mthis, __arg_0, __arg_1) native "SpeechSynthesis_speak_Callback";
-  speak_Callback_2_(mthis, __arg_0, __arg_1) => speak_Callback_2(mthis, __arg_0, __arg_1);
-
-  static speak_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SpeechSynthesis_speak_Callback";
-  speak_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => speak_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static speaking_Getter(mthis) native "SpeechSynthesis_speaking_Getter";
-  speaking_Getter_(mthis) => speaking_Getter(mthis);
+  speaking_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "speaking");
 
 }
 
 class BlinkSpeechSynthesisEvent extends BlinkEvent {
   static final instance = new BlinkSpeechSynthesisEvent();
 
-  static charIndex_Getter(mthis) native "SpeechSynthesisEvent_charIndex_Getter";
-  charIndex_Getter_(mthis) => charIndex_Getter(mthis);
+  charIndex_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "charIndex");
 
-  static elapsedTime_Getter(mthis) native "SpeechSynthesisEvent_elapsedTime_Getter";
-  elapsedTime_Getter_(mthis) => elapsedTime_Getter(mthis);
+  elapsedTime_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "elapsedTime");
 
-  static name_Getter(mthis) native "SpeechSynthesisEvent_name_Getter";
-  name_Getter_(mthis) => name_Getter(mthis);
+  name_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "name");
 
 }
 
 class BlinkSpeechSynthesisUtterance extends BlinkEventTarget {
   static final instance = new BlinkSpeechSynthesisUtterance();
 
-  static constructorCallback_0() native "SpeechSynthesisUtterance_constructorCallback";
-  constructorCallback_0_() => constructorCallback_0();
+  constructorCallback_0_() => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "SpeechSynthesisUtterance"), []);
 
-  static constructorCallback_1(__arg_0) native "SpeechSynthesisUtterance_constructorCallback";
-  constructorCallback_1_(__arg_0) => constructorCallback_1(__arg_0);
+  constructorCallback_1_(__arg_0) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "SpeechSynthesisUtterance"), [__arg_0]);
 
-  static constructorCallback_2(__arg_0, __arg_1) native "SpeechSynthesisUtterance_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  lang_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "lang");
 
-  static constructorCallback_3(__arg_0, __arg_1, __arg_2) native "SpeechSynthesisUtterance_constructorCallback";
-  constructorCallback_3_(__arg_0, __arg_1, __arg_2) => constructorCallback_3(__arg_0, __arg_1, __arg_2);
+  lang_Setter_(mthis, __arg_0) => mthis["lang"] = __arg_0;
 
-  static lang_Getter(mthis) native "SpeechSynthesisUtterance_lang_Getter";
-  lang_Getter_(mthis) => lang_Getter(mthis);
+  onboundary_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onboundary");
 
-  static lang_Setter(mthis, __arg_0) native "SpeechSynthesisUtterance_lang_Setter";
-  lang_Setter_(mthis, __arg_0) => lang_Setter(mthis, __arg_0);
+  onboundary_Setter_(mthis, __arg_0) => mthis["onboundary"] = __arg_0;
 
-  static onboundary_Getter(mthis) native "SpeechSynthesisUtterance_onboundary_Getter";
-  onboundary_Getter_(mthis) => onboundary_Getter(mthis);
+  onend_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onend");
 
-  static onboundary_Setter(mthis, __arg_0) native "SpeechSynthesisUtterance_onboundary_Setter";
-  onboundary_Setter_(mthis, __arg_0) => onboundary_Setter(mthis, __arg_0);
+  onend_Setter_(mthis, __arg_0) => mthis["onend"] = __arg_0;
 
-  static onend_Getter(mthis) native "SpeechSynthesisUtterance_onend_Getter";
-  onend_Getter_(mthis) => onend_Getter(mthis);
+  onerror_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onerror");
 
-  static onend_Setter(mthis, __arg_0) native "SpeechSynthesisUtterance_onend_Setter";
-  onend_Setter_(mthis, __arg_0) => onend_Setter(mthis, __arg_0);
+  onerror_Setter_(mthis, __arg_0) => mthis["onerror"] = __arg_0;
 
-  static onerror_Getter(mthis) native "SpeechSynthesisUtterance_onerror_Getter";
-  onerror_Getter_(mthis) => onerror_Getter(mthis);
+  onmark_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onmark");
 
-  static onerror_Setter(mthis, __arg_0) native "SpeechSynthesisUtterance_onerror_Setter";
-  onerror_Setter_(mthis, __arg_0) => onerror_Setter(mthis, __arg_0);
+  onmark_Setter_(mthis, __arg_0) => mthis["onmark"] = __arg_0;
 
-  static onmark_Getter(mthis) native "SpeechSynthesisUtterance_onmark_Getter";
-  onmark_Getter_(mthis) => onmark_Getter(mthis);
+  onpause_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onpause");
 
-  static onmark_Setter(mthis, __arg_0) native "SpeechSynthesisUtterance_onmark_Setter";
-  onmark_Setter_(mthis, __arg_0) => onmark_Setter(mthis, __arg_0);
+  onpause_Setter_(mthis, __arg_0) => mthis["onpause"] = __arg_0;
 
-  static onpause_Getter(mthis) native "SpeechSynthesisUtterance_onpause_Getter";
-  onpause_Getter_(mthis) => onpause_Getter(mthis);
+  onresume_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onresume");
 
-  static onpause_Setter(mthis, __arg_0) native "SpeechSynthesisUtterance_onpause_Setter";
-  onpause_Setter_(mthis, __arg_0) => onpause_Setter(mthis, __arg_0);
+  onresume_Setter_(mthis, __arg_0) => mthis["onresume"] = __arg_0;
 
-  static onresume_Getter(mthis) native "SpeechSynthesisUtterance_onresume_Getter";
-  onresume_Getter_(mthis) => onresume_Getter(mthis);
+  onstart_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onstart");
 
-  static onresume_Setter(mthis, __arg_0) native "SpeechSynthesisUtterance_onresume_Setter";
-  onresume_Setter_(mthis, __arg_0) => onresume_Setter(mthis, __arg_0);
+  onstart_Setter_(mthis, __arg_0) => mthis["onstart"] = __arg_0;
 
-  static onstart_Getter(mthis) native "SpeechSynthesisUtterance_onstart_Getter";
-  onstart_Getter_(mthis) => onstart_Getter(mthis);
+  pitch_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "pitch");
 
-  static onstart_Setter(mthis, __arg_0) native "SpeechSynthesisUtterance_onstart_Setter";
-  onstart_Setter_(mthis, __arg_0) => onstart_Setter(mthis, __arg_0);
+  pitch_Setter_(mthis, __arg_0) => mthis["pitch"] = __arg_0;
 
-  static pitch_Getter(mthis) native "SpeechSynthesisUtterance_pitch_Getter";
-  pitch_Getter_(mthis) => pitch_Getter(mthis);
+  rate_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "rate");
 
-  static pitch_Setter(mthis, __arg_0) native "SpeechSynthesisUtterance_pitch_Setter";
-  pitch_Setter_(mthis, __arg_0) => pitch_Setter(mthis, __arg_0);
+  rate_Setter_(mthis, __arg_0) => mthis["rate"] = __arg_0;
 
-  static rate_Getter(mthis) native "SpeechSynthesisUtterance_rate_Getter";
-  rate_Getter_(mthis) => rate_Getter(mthis);
+  text_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "text");
 
-  static rate_Setter(mthis, __arg_0) native "SpeechSynthesisUtterance_rate_Setter";
-  rate_Setter_(mthis, __arg_0) => rate_Setter(mthis, __arg_0);
+  text_Setter_(mthis, __arg_0) => mthis["text"] = __arg_0;
 
-  static text_Getter(mthis) native "SpeechSynthesisUtterance_text_Getter";
-  text_Getter_(mthis) => text_Getter(mthis);
+  voice_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "voice");
 
-  static text_Setter(mthis, __arg_0) native "SpeechSynthesisUtterance_text_Setter";
-  text_Setter_(mthis, __arg_0) => text_Setter(mthis, __arg_0);
+  voice_Setter_(mthis, __arg_0) => mthis["voice"] = __arg_0;
 
-  static voice_Getter(mthis) native "SpeechSynthesisUtterance_voice_Getter";
-  voice_Getter_(mthis) => voice_Getter(mthis);
+  volume_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "volume");
 
-  static voice_Setter(mthis, __arg_0) native "SpeechSynthesisUtterance_voice_Setter";
-  voice_Setter_(mthis, __arg_0) => voice_Setter(mthis, __arg_0);
-
-  static volume_Getter(mthis) native "SpeechSynthesisUtterance_volume_Getter";
-  volume_Getter_(mthis) => volume_Getter(mthis);
-
-  static volume_Setter(mthis, __arg_0) native "SpeechSynthesisUtterance_volume_Setter";
-  volume_Setter_(mthis, __arg_0) => volume_Setter(mthis, __arg_0);
+  volume_Setter_(mthis, __arg_0) => mthis["volume"] = __arg_0;
 
 }
 
 class BlinkSpeechSynthesisVoice {
   static final instance = new BlinkSpeechSynthesisVoice();
 
-  static default_Getter(mthis) native "SpeechSynthesisVoice_default_Getter";
-  default_Getter_(mthis) => default_Getter(mthis);
+  default_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "default");
 
-  static lang_Getter(mthis) native "SpeechSynthesisVoice_lang_Getter";
-  lang_Getter_(mthis) => lang_Getter(mthis);
+  lang_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "lang");
 
-  static localService_Getter(mthis) native "SpeechSynthesisVoice_localService_Getter";
-  localService_Getter_(mthis) => localService_Getter(mthis);
+  localService_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "localService");
 
-  static name_Getter(mthis) native "SpeechSynthesisVoice_name_Getter";
-  name_Getter_(mthis) => name_Getter(mthis);
+  name_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "name");
 
-  static voiceURI_Getter(mthis) native "SpeechSynthesisVoice_voiceURI_Getter";
-  voiceURI_Getter_(mthis) => voiceURI_Getter(mthis);
+  voiceURI_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "voiceURI");
 
 }
 
 class BlinkStorage {
   static final instance = new BlinkStorage();
 
-  static $__delete___Callback_1(mthis, __arg_0) native "Storage___delete___Callback";
-  $__delete___Callback_1_(mthis, __arg_0) => $__delete___Callback_1(mthis, __arg_0);
+  $__delete___Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "__delete__", [__arg_0]);
 
-  static $__getter___Callback_1(mthis, __arg_0) native "Storage___getter___Callback";
-  $__getter___Callback_1_(mthis, __arg_0) => $__getter___Callback_1(mthis, __arg_0);
+  $__getter___Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "__getter__", [__arg_0]);
 
-  static $__setter___Callback_2(mthis, __arg_0, __arg_1) native "Storage___setter___Callback";
-  $__setter___Callback_2_(mthis, __arg_0, __arg_1) => $__setter___Callback_2(mthis, __arg_0, __arg_1);
+  $__setter___Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "__setter__", [__arg_0, __arg_1]);
 
-  static clear_Callback_0(mthis) native "Storage_clear_Callback";
-  clear_Callback_0_(mthis) => clear_Callback_0(mthis);
+  clear_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "clear", []);
 
-  static clear_Callback_1(mthis, __arg_0) native "Storage_clear_Callback";
-  clear_Callback_1_(mthis, __arg_0) => clear_Callback_1(mthis, __arg_0);
+  getItem_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getItem", []);
 
-  static clear_Callback_2(mthis, __arg_0, __arg_1) native "Storage_clear_Callback";
-  clear_Callback_2_(mthis, __arg_0, __arg_1) => clear_Callback_2(mthis, __arg_0, __arg_1);
+  getItem_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getItem", [__arg_0]);
 
-  static getItem_Callback_0(mthis) native "Storage_getItem_Callback";
-  getItem_Callback_0_(mthis) => getItem_Callback_0(mthis);
+  key_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "key", []);
 
-  static getItem_Callback_1(mthis, __arg_0) native "Storage_getItem_Callback";
-  getItem_Callback_1_(mthis, __arg_0) => getItem_Callback_1(mthis, __arg_0);
+  key_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "key", [__arg_0]);
 
-  static getItem_Callback_2(mthis, __arg_0, __arg_1) native "Storage_getItem_Callback";
-  getItem_Callback_2_(mthis, __arg_0, __arg_1) => getItem_Callback_2(mthis, __arg_0, __arg_1);
+  length_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "length");
 
-  static getItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Storage_getItem_Callback";
-  getItem_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  removeItem_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "removeItem", []);
 
-  static key_Callback_0(mthis) native "Storage_key_Callback";
-  key_Callback_0_(mthis) => key_Callback_0(mthis);
+  removeItem_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "removeItem", [__arg_0]);
 
-  static key_Callback_1(mthis, __arg_0) native "Storage_key_Callback";
-  key_Callback_1_(mthis, __arg_0) => key_Callback_1(mthis, __arg_0);
+  setItem_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "setItem", []);
 
-  static key_Callback_2(mthis, __arg_0, __arg_1) native "Storage_key_Callback";
-  key_Callback_2_(mthis, __arg_0, __arg_1) => key_Callback_2(mthis, __arg_0, __arg_1);
+  setItem_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "setItem", [__arg_0]);
 
-  static key_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Storage_key_Callback";
-  key_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => key_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static length_Getter(mthis) native "Storage_length_Getter";
-  length_Getter_(mthis) => length_Getter(mthis);
-
-  static removeItem_Callback_0(mthis) native "Storage_removeItem_Callback";
-  removeItem_Callback_0_(mthis) => removeItem_Callback_0(mthis);
-
-  static removeItem_Callback_1(mthis, __arg_0) native "Storage_removeItem_Callback";
-  removeItem_Callback_1_(mthis, __arg_0) => removeItem_Callback_1(mthis, __arg_0);
-
-  static removeItem_Callback_2(mthis, __arg_0, __arg_1) native "Storage_removeItem_Callback";
-  removeItem_Callback_2_(mthis, __arg_0, __arg_1) => removeItem_Callback_2(mthis, __arg_0, __arg_1);
-
-  static removeItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Storage_removeItem_Callback";
-  removeItem_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => removeItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static setItem_Callback_0(mthis) native "Storage_setItem_Callback";
-  setItem_Callback_0_(mthis) => setItem_Callback_0(mthis);
-
-  static setItem_Callback_1(mthis, __arg_0) native "Storage_setItem_Callback";
-  setItem_Callback_1_(mthis, __arg_0) => setItem_Callback_1(mthis, __arg_0);
-
-  static setItem_Callback_2(mthis, __arg_0, __arg_1) native "Storage_setItem_Callback";
-  setItem_Callback_2_(mthis, __arg_0, __arg_1) => setItem_Callback_2(mthis, __arg_0, __arg_1);
-
-  static setItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Storage_setItem_Callback";
-  setItem_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => setItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static setItem_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Storage_setItem_Callback";
-  setItem_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => setItem_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  setItem_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "setItem", [__arg_0, __arg_1]);
 
 }
 
 class BlinkStorageEvent extends BlinkEvent {
   static final instance = new BlinkStorageEvent();
 
-  static constructorCallback_2(__arg_0, __arg_1) native "StorageEvent_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  constructorCallback_2_(__arg_0, __arg_1) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "StorageEvent"), [__arg_0, __arg_1]);
 
-  static initStorageEvent_Callback_0(mthis) native "StorageEvent_initStorageEvent_Callback";
-  initStorageEvent_Callback_0_(mthis) => initStorageEvent_Callback_0(mthis);
+  initStorageEvent_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "initStorageEvent", []);
 
-  static initStorageEvent_Callback_1(mthis, __arg_0) native "StorageEvent_initStorageEvent_Callback";
-  initStorageEvent_Callback_1_(mthis, __arg_0) => initStorageEvent_Callback_1(mthis, __arg_0);
+  initStorageEvent_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "initStorageEvent", [__arg_0]);
 
-  static initStorageEvent_Callback_10(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9) native "StorageEvent_initStorageEvent_Callback";
-  initStorageEvent_Callback_10_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9) => initStorageEvent_Callback_10(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9);
+  initStorageEvent_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "initStorageEvent", [__arg_0, __arg_1]);
 
-  static initStorageEvent_Callback_2(mthis, __arg_0, __arg_1) native "StorageEvent_initStorageEvent_Callback";
-  initStorageEvent_Callback_2_(mthis, __arg_0, __arg_1) => initStorageEvent_Callback_2(mthis, __arg_0, __arg_1);
+  initStorageEvent_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "initStorageEvent", [__arg_0, __arg_1, __arg_2]);
 
-  static initStorageEvent_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "StorageEvent_initStorageEvent_Callback";
-  initStorageEvent_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => initStorageEvent_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  initStorageEvent_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "initStorageEvent", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static initStorageEvent_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "StorageEvent_initStorageEvent_Callback";
-  initStorageEvent_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => initStorageEvent_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  initStorageEvent_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => Blink_JsNative_DomException.callMethod(mthis, "initStorageEvent", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4]);
 
-  static initStorageEvent_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "StorageEvent_initStorageEvent_Callback";
-  initStorageEvent_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => initStorageEvent_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  initStorageEvent_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => Blink_JsNative_DomException.callMethod(mthis, "initStorageEvent", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5]);
 
-  static initStorageEvent_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "StorageEvent_initStorageEvent_Callback";
-  initStorageEvent_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => initStorageEvent_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  initStorageEvent_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => Blink_JsNative_DomException.callMethod(mthis, "initStorageEvent", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6]);
 
-  static initStorageEvent_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) native "StorageEvent_initStorageEvent_Callback";
-  initStorageEvent_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => initStorageEvent_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6);
+  initStorageEvent_Callback_8_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) => Blink_JsNative_DomException.callMethod(mthis, "initStorageEvent", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7]);
 
-  static initStorageEvent_Callback_8(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) native "StorageEvent_initStorageEvent_Callback";
-  initStorageEvent_Callback_8_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) => initStorageEvent_Callback_8(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7);
+  key_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "key");
 
-  static initStorageEvent_Callback_9(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8) native "StorageEvent_initStorageEvent_Callback";
-  initStorageEvent_Callback_9_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8) => initStorageEvent_Callback_9(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8);
+  newValue_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "newValue");
 
-  static key_Getter(mthis) native "StorageEvent_key_Getter";
-  key_Getter_(mthis) => key_Getter(mthis);
+  oldValue_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "oldValue");
 
-  static newValue_Getter(mthis) native "StorageEvent_newValue_Getter";
-  newValue_Getter_(mthis) => newValue_Getter(mthis);
+  storageArea_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "storageArea");
 
-  static oldValue_Getter(mthis) native "StorageEvent_oldValue_Getter";
-  oldValue_Getter_(mthis) => oldValue_Getter(mthis);
-
-  static storageArea_Getter(mthis) native "StorageEvent_storageArea_Getter";
-  storageArea_Getter_(mthis) => storageArea_Getter(mthis);
-
-  static url_Getter(mthis) native "StorageEvent_url_Getter";
-  url_Getter_(mthis) => url_Getter(mthis);
+  url_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "url");
 
 }
 
 class BlinkStorageInfo {
   static final instance = new BlinkStorageInfo();
 
-  static quota_Getter(mthis) native "StorageInfo_quota_Getter";
-  quota_Getter_(mthis) => quota_Getter(mthis);
+  quota_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "quota");
 
-  static usage_Getter(mthis) native "StorageInfo_usage_Getter";
-  usage_Getter_(mthis) => usage_Getter(mthis);
+  usage_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "usage");
 
 }
 
 class BlinkStorageQuota {
   static final instance = new BlinkStorageQuota();
 
-  static queryInfo_Callback_0(mthis) native "StorageQuota_queryInfo_Callback";
-  queryInfo_Callback_0_(mthis) => queryInfo_Callback_0(mthis);
+  queryInfo_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "queryInfo", []);
 
-  static queryInfo_Callback_1(mthis, __arg_0) native "StorageQuota_queryInfo_Callback";
-  queryInfo_Callback_1_(mthis, __arg_0) => queryInfo_Callback_1(mthis, __arg_0);
+  queryInfo_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "queryInfo", [__arg_0]);
 
-  static queryInfo_Callback_2(mthis, __arg_0, __arg_1) native "StorageQuota_queryInfo_Callback";
-  queryInfo_Callback_2_(mthis, __arg_0, __arg_1) => queryInfo_Callback_2(mthis, __arg_0, __arg_1);
+  requestPersistentQuota_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "requestPersistentQuota", []);
 
-  static queryInfo_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "StorageQuota_queryInfo_Callback";
-  queryInfo_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => queryInfo_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  requestPersistentQuota_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "requestPersistentQuota", [__arg_0]);
 
-  static requestPersistentQuota_Callback_0(mthis) native "StorageQuota_requestPersistentQuota_Callback";
-  requestPersistentQuota_Callback_0_(mthis) => requestPersistentQuota_Callback_0(mthis);
-
-  static requestPersistentQuota_Callback_1(mthis, __arg_0) native "StorageQuota_requestPersistentQuota_Callback";
-  requestPersistentQuota_Callback_1_(mthis, __arg_0) => requestPersistentQuota_Callback_1(mthis, __arg_0);
-
-  static requestPersistentQuota_Callback_2(mthis, __arg_0, __arg_1) native "StorageQuota_requestPersistentQuota_Callback";
-  requestPersistentQuota_Callback_2_(mthis, __arg_0, __arg_1) => requestPersistentQuota_Callback_2(mthis, __arg_0, __arg_1);
-
-  static requestPersistentQuota_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "StorageQuota_requestPersistentQuota_Callback";
-  requestPersistentQuota_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => requestPersistentQuota_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static supportedTypes_Getter(mthis) native "StorageQuota_supportedTypes_Getter";
-  supportedTypes_Getter_(mthis) => supportedTypes_Getter(mthis);
+  supportedTypes_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "supportedTypes");
 
 }
 
 class BlinkStream {
   static final instance = new BlinkStream();
 
-  static type_Getter(mthis) native "Stream_type_Getter";
-  type_Getter_(mthis) => type_Getter(mthis);
+  type_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "type");
 
 }
 
 class BlinkStyleMedia {
   static final instance = new BlinkStyleMedia();
 
-  static matchMedium_Callback_0(mthis) native "StyleMedia_matchMedium_Callback";
-  matchMedium_Callback_0_(mthis) => matchMedium_Callback_0(mthis);
+  matchMedium_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "matchMedium", []);
 
-  static matchMedium_Callback_1(mthis, __arg_0) native "StyleMedia_matchMedium_Callback";
-  matchMedium_Callback_1_(mthis, __arg_0) => matchMedium_Callback_1(mthis, __arg_0);
+  matchMedium_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "matchMedium", [__arg_0]);
 
-  static matchMedium_Callback_2(mthis, __arg_0, __arg_1) native "StyleMedia_matchMedium_Callback";
-  matchMedium_Callback_2_(mthis, __arg_0, __arg_1) => matchMedium_Callback_2(mthis, __arg_0, __arg_1);
-
-  static matchMedium_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "StyleMedia_matchMedium_Callback";
-  matchMedium_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => matchMedium_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static type_Getter(mthis) native "StyleMedia_type_Getter";
-  type_Getter_(mthis) => type_Getter(mthis);
+  type_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "type");
 
 }
 
 class BlinkStyleSheet {
   static final instance = new BlinkStyleSheet();
 
-  static disabled_Getter(mthis) native "StyleSheet_disabled_Getter";
-  disabled_Getter_(mthis) => disabled_Getter(mthis);
+  disabled_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "disabled");
 
-  static disabled_Setter(mthis, __arg_0) native "StyleSheet_disabled_Setter";
-  disabled_Setter_(mthis, __arg_0) => disabled_Setter(mthis, __arg_0);
+  disabled_Setter_(mthis, __arg_0) => mthis["disabled"] = __arg_0;
 
-  static href_Getter(mthis) native "StyleSheet_href_Getter";
-  href_Getter_(mthis) => href_Getter(mthis);
+  href_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "href");
 
-  static media_Getter(mthis) native "StyleSheet_media_Getter";
-  media_Getter_(mthis) => media_Getter(mthis);
+  media_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "media");
 
-  static ownerNode_Getter(mthis) native "StyleSheet_ownerNode_Getter";
-  ownerNode_Getter_(mthis) => ownerNode_Getter(mthis);
+  ownerNode_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ownerNode");
 
-  static parentStyleSheet_Getter(mthis) native "StyleSheet_parentStyleSheet_Getter";
-  parentStyleSheet_Getter_(mthis) => parentStyleSheet_Getter(mthis);
+  parentStyleSheet_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "parentStyleSheet");
 
-  static title_Getter(mthis) native "StyleSheet_title_Getter";
-  title_Getter_(mthis) => title_Getter(mthis);
+  title_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "title");
 
-  static type_Getter(mthis) native "StyleSheet_type_Getter";
-  type_Getter_(mthis) => type_Getter(mthis);
+  type_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "type");
 
 }
 
 class BlinkStyleSheetList {
   static final instance = new BlinkStyleSheetList();
 
-  static $__getter___Callback_1(mthis, __arg_0) native "StyleSheetList___getter___Callback";
-  $__getter___Callback_1_(mthis, __arg_0) => $__getter___Callback_1(mthis, __arg_0);
+  $__getter___Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "__getter__", [__arg_0]);
 
-  static item_Callback_0(mthis) native "StyleSheetList_item_Callback";
-  item_Callback_0_(mthis) => item_Callback_0(mthis);
+  item_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "item", []);
 
-  static item_Callback_1(mthis, __arg_0) native "StyleSheetList_item_Callback";
-  item_Callback_1_(mthis, __arg_0) => item_Callback_1(mthis, __arg_0);
+  item_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "item", [__arg_0]);
 
-  static item_Callback_2(mthis, __arg_0, __arg_1) native "StyleSheetList_item_Callback";
-  item_Callback_2_(mthis, __arg_0, __arg_1) => item_Callback_2(mthis, __arg_0, __arg_1);
-
-  static item_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "StyleSheetList_item_Callback";
-  item_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => item_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static length_Getter(mthis) native "StyleSheetList_length_Getter";
-  length_Getter_(mthis) => length_Getter(mthis);
+  length_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "length");
 
 }
 
 class BlinkSubtleCrypto {
   static final instance = new BlinkSubtleCrypto();
 
-  static decrypt_Callback_1(mthis, __arg_0) native "SubtleCrypto_decrypt_Callback";
-  decrypt_Callback_1_(mthis, __arg_0) => decrypt_Callback_1(mthis, __arg_0);
+  decrypt_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "decrypt", [__arg_0]);
 
-  static decrypt_Callback_2(mthis, __arg_0, __arg_1) native "SubtleCrypto_decrypt_Callback";
-  decrypt_Callback_2_(mthis, __arg_0, __arg_1) => decrypt_Callback_2(mthis, __arg_0, __arg_1);
+  decrypt_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "decrypt", [__arg_0, __arg_1]);
 
-  static decrypt_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SubtleCrypto_decrypt_Callback";
-  decrypt_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => decrypt_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  decrypt_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "decrypt", [__arg_0, __arg_1, __arg_2]);
 
-  static decrypt_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "SubtleCrypto_decrypt_Callback";
-  decrypt_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => decrypt_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  digest_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "digest", []);
 
-  static decrypt_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "SubtleCrypto_decrypt_Callback";
-  decrypt_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => decrypt_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  digest_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "digest", [__arg_0]);
 
-  static digest_Callback_0(mthis) native "SubtleCrypto_digest_Callback";
-  digest_Callback_0_(mthis) => digest_Callback_0(mthis);
+  digest_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "digest", [__arg_0, __arg_1]);
 
-  static digest_Callback_1(mthis, __arg_0) native "SubtleCrypto_digest_Callback";
-  digest_Callback_1_(mthis, __arg_0) => digest_Callback_1(mthis, __arg_0);
+  encrypt_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "encrypt", [__arg_0]);
 
-  static digest_Callback_2(mthis, __arg_0, __arg_1) native "SubtleCrypto_digest_Callback";
-  digest_Callback_2_(mthis, __arg_0, __arg_1) => digest_Callback_2(mthis, __arg_0, __arg_1);
+  encrypt_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "encrypt", [__arg_0, __arg_1]);
 
-  static digest_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SubtleCrypto_digest_Callback";
-  digest_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => digest_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  encrypt_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "encrypt", [__arg_0, __arg_1, __arg_2]);
 
-  static digest_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "SubtleCrypto_digest_Callback";
-  digest_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => digest_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  exportKey_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "exportKey", []);
 
-  static encrypt_Callback_1(mthis, __arg_0) native "SubtleCrypto_encrypt_Callback";
-  encrypt_Callback_1_(mthis, __arg_0) => encrypt_Callback_1(mthis, __arg_0);
+  exportKey_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "exportKey", [__arg_0]);
 
-  static encrypt_Callback_2(mthis, __arg_0, __arg_1) native "SubtleCrypto_encrypt_Callback";
-  encrypt_Callback_2_(mthis, __arg_0, __arg_1) => encrypt_Callback_2(mthis, __arg_0, __arg_1);
+  exportKey_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "exportKey", [__arg_0, __arg_1]);
 
-  static encrypt_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SubtleCrypto_encrypt_Callback";
-  encrypt_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => encrypt_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  generateKey_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "generateKey", [__arg_0]);
 
-  static encrypt_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "SubtleCrypto_encrypt_Callback";
-  encrypt_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => encrypt_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  generateKey_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "generateKey", [__arg_0, __arg_1]);
 
-  static encrypt_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "SubtleCrypto_encrypt_Callback";
-  encrypt_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => encrypt_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  generateKey_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "generateKey", [__arg_0, __arg_1, __arg_2]);
 
-  static exportKey_Callback_0(mthis) native "SubtleCrypto_exportKey_Callback";
-  exportKey_Callback_0_(mthis) => exportKey_Callback_0(mthis);
+  importKey_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "importKey", [__arg_0, __arg_1, __arg_2]);
 
-  static exportKey_Callback_1(mthis, __arg_0) native "SubtleCrypto_exportKey_Callback";
-  exportKey_Callback_1_(mthis, __arg_0) => exportKey_Callback_1(mthis, __arg_0);
+  importKey_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "importKey", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static exportKey_Callback_2(mthis, __arg_0, __arg_1) native "SubtleCrypto_exportKey_Callback";
-  exportKey_Callback_2_(mthis, __arg_0, __arg_1) => exportKey_Callback_2(mthis, __arg_0, __arg_1);
+  importKey_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => Blink_JsNative_DomException.callMethod(mthis, "importKey", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4]);
 
-  static exportKey_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SubtleCrypto_exportKey_Callback";
-  exportKey_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => exportKey_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  sign_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "sign", [__arg_0]);
 
-  static exportKey_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "SubtleCrypto_exportKey_Callback";
-  exportKey_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => exportKey_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  sign_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "sign", [__arg_0, __arg_1]);
 
-  static generateKey_Callback_1(mthis, __arg_0) native "SubtleCrypto_generateKey_Callback";
-  generateKey_Callback_1_(mthis, __arg_0) => generateKey_Callback_1(mthis, __arg_0);
+  sign_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "sign", [__arg_0, __arg_1, __arg_2]);
 
-  static generateKey_Callback_2(mthis, __arg_0, __arg_1) native "SubtleCrypto_generateKey_Callback";
-  generateKey_Callback_2_(mthis, __arg_0, __arg_1) => generateKey_Callback_2(mthis, __arg_0, __arg_1);
+  unwrapKey_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => Blink_JsNative_DomException.callMethod(mthis, "unwrapKey", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4]);
 
-  static generateKey_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SubtleCrypto_generateKey_Callback";
-  generateKey_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => generateKey_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  unwrapKey_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => Blink_JsNative_DomException.callMethod(mthis, "unwrapKey", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5]);
 
-  static generateKey_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "SubtleCrypto_generateKey_Callback";
-  generateKey_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => generateKey_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  unwrapKey_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => Blink_JsNative_DomException.callMethod(mthis, "unwrapKey", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6]);
 
-  static generateKey_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "SubtleCrypto_generateKey_Callback";
-  generateKey_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => generateKey_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  verify_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "verify", [__arg_0, __arg_1]);
 
-  static importKey_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SubtleCrypto_importKey_Callback";
-  importKey_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => importKey_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  verify_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "verify", [__arg_0, __arg_1, __arg_2]);
 
-  static importKey_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "SubtleCrypto_importKey_Callback";
-  importKey_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => importKey_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  verify_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "verify", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static importKey_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "SubtleCrypto_importKey_Callback";
-  importKey_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => importKey_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  wrapKey_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "wrapKey", [__arg_0, __arg_1]);
 
-  static importKey_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "SubtleCrypto_importKey_Callback";
-  importKey_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => importKey_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  wrapKey_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "wrapKey", [__arg_0, __arg_1, __arg_2]);
 
-  static importKey_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) native "SubtleCrypto_importKey_Callback";
-  importKey_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => importKey_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6);
-
-  static sign_Callback_1(mthis, __arg_0) native "SubtleCrypto_sign_Callback";
-  sign_Callback_1_(mthis, __arg_0) => sign_Callback_1(mthis, __arg_0);
-
-  static sign_Callback_2(mthis, __arg_0, __arg_1) native "SubtleCrypto_sign_Callback";
-  sign_Callback_2_(mthis, __arg_0, __arg_1) => sign_Callback_2(mthis, __arg_0, __arg_1);
-
-  static sign_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SubtleCrypto_sign_Callback";
-  sign_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => sign_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static sign_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "SubtleCrypto_sign_Callback";
-  sign_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => sign_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static sign_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "SubtleCrypto_sign_Callback";
-  sign_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => sign_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
-
-  static unwrapKey_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "SubtleCrypto_unwrapKey_Callback";
-  unwrapKey_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => unwrapKey_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
-
-  static unwrapKey_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "SubtleCrypto_unwrapKey_Callback";
-  unwrapKey_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => unwrapKey_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
-
-  static unwrapKey_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) native "SubtleCrypto_unwrapKey_Callback";
-  unwrapKey_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => unwrapKey_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6);
-
-  static unwrapKey_Callback_8(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) native "SubtleCrypto_unwrapKey_Callback";
-  unwrapKey_Callback_8_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) => unwrapKey_Callback_8(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7);
-
-  static unwrapKey_Callback_9(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8) native "SubtleCrypto_unwrapKey_Callback";
-  unwrapKey_Callback_9_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8) => unwrapKey_Callback_9(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8);
-
-  static verify_Callback_2(mthis, __arg_0, __arg_1) native "SubtleCrypto_verify_Callback";
-  verify_Callback_2_(mthis, __arg_0, __arg_1) => verify_Callback_2(mthis, __arg_0, __arg_1);
-
-  static verify_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SubtleCrypto_verify_Callback";
-  verify_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => verify_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static verify_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "SubtleCrypto_verify_Callback";
-  verify_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => verify_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static verify_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "SubtleCrypto_verify_Callback";
-  verify_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => verify_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
-
-  static verify_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "SubtleCrypto_verify_Callback";
-  verify_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => verify_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
-
-  static wrapKey_Callback_2(mthis, __arg_0, __arg_1) native "SubtleCrypto_wrapKey_Callback";
-  wrapKey_Callback_2_(mthis, __arg_0, __arg_1) => wrapKey_Callback_2(mthis, __arg_0, __arg_1);
-
-  static wrapKey_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "SubtleCrypto_wrapKey_Callback";
-  wrapKey_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => wrapKey_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static wrapKey_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "SubtleCrypto_wrapKey_Callback";
-  wrapKey_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => wrapKey_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static wrapKey_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "SubtleCrypto_wrapKey_Callback";
-  wrapKey_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => wrapKey_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
-
-  static wrapKey_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "SubtleCrypto_wrapKey_Callback";
-  wrapKey_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => wrapKey_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  wrapKey_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "wrapKey", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
 }
 
 class BlinkText extends BlinkCharacterData {
   static final instance = new BlinkText();
 
-  static constructorCallback_0() native "Text_constructorCallback";
-  constructorCallback_0_() => constructorCallback_0();
+  constructorCallback_0_() => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "Text"), []);
 
-  static constructorCallback_1(__arg_0) native "Text_constructorCallback";
-  constructorCallback_1_(__arg_0) => constructorCallback_1(__arg_0);
+  constructorCallback_1_(__arg_0) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "Text"), [__arg_0]);
 
-  static constructorCallback_2(__arg_0, __arg_1) native "Text_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  getDestinationInsertionPoints_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getDestinationInsertionPoints", []);
 
-  static constructorCallback_3(__arg_0, __arg_1, __arg_2) native "Text_constructorCallback";
-  constructorCallback_3_(__arg_0, __arg_1, __arg_2) => constructorCallback_3(__arg_0, __arg_1, __arg_2);
+  replaceWholeText_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "replaceWholeText", []);
 
-  static getDestinationInsertionPoints_Callback_0(mthis) native "Text_getDestinationInsertionPoints_Callback";
-  getDestinationInsertionPoints_Callback_0_(mthis) => getDestinationInsertionPoints_Callback_0(mthis);
+  replaceWholeText_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "replaceWholeText", [__arg_0]);
 
-  static getDestinationInsertionPoints_Callback_1(mthis, __arg_0) native "Text_getDestinationInsertionPoints_Callback";
-  getDestinationInsertionPoints_Callback_1_(mthis, __arg_0) => getDestinationInsertionPoints_Callback_1(mthis, __arg_0);
+  splitText_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "splitText", []);
 
-  static getDestinationInsertionPoints_Callback_2(mthis, __arg_0, __arg_1) native "Text_getDestinationInsertionPoints_Callback";
-  getDestinationInsertionPoints_Callback_2_(mthis, __arg_0, __arg_1) => getDestinationInsertionPoints_Callback_2(mthis, __arg_0, __arg_1);
+  splitText_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "splitText", [__arg_0]);
 
-  static replaceWholeText_Callback_0(mthis) native "Text_replaceWholeText_Callback";
-  replaceWholeText_Callback_0_(mthis) => replaceWholeText_Callback_0(mthis);
-
-  static replaceWholeText_Callback_1(mthis, __arg_0) native "Text_replaceWholeText_Callback";
-  replaceWholeText_Callback_1_(mthis, __arg_0) => replaceWholeText_Callback_1(mthis, __arg_0);
-
-  static replaceWholeText_Callback_2(mthis, __arg_0, __arg_1) native "Text_replaceWholeText_Callback";
-  replaceWholeText_Callback_2_(mthis, __arg_0, __arg_1) => replaceWholeText_Callback_2(mthis, __arg_0, __arg_1);
-
-  static replaceWholeText_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Text_replaceWholeText_Callback";
-  replaceWholeText_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => replaceWholeText_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static splitText_Callback_0(mthis) native "Text_splitText_Callback";
-  splitText_Callback_0_(mthis) => splitText_Callback_0(mthis);
-
-  static splitText_Callback_1(mthis, __arg_0) native "Text_splitText_Callback";
-  splitText_Callback_1_(mthis, __arg_0) => splitText_Callback_1(mthis, __arg_0);
-
-  static splitText_Callback_2(mthis, __arg_0, __arg_1) native "Text_splitText_Callback";
-  splitText_Callback_2_(mthis, __arg_0, __arg_1) => splitText_Callback_2(mthis, __arg_0, __arg_1);
-
-  static splitText_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Text_splitText_Callback";
-  splitText_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => splitText_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static wholeText_Getter(mthis) native "Text_wholeText_Getter";
-  wholeText_Getter_(mthis) => wholeText_Getter(mthis);
+  wholeText_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "wholeText");
 
 }
 
 class BlinkTextDecoder {
   static final instance = new BlinkTextDecoder();
 
-  static constructorCallback_0() native "TextDecoder_constructorCallback";
-  constructorCallback_0_() => constructorCallback_0();
+  constructorCallback_0_() => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "TextDecoder"), []);
 
-  static constructorCallback_1(__arg_0) native "TextDecoder_constructorCallback";
-  constructorCallback_1_(__arg_0) => constructorCallback_1(__arg_0);
+  constructorCallback_1_(__arg_0) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "TextDecoder"), [__arg_0]);
 
-  static constructorCallback_2(__arg_0, __arg_1) native "TextDecoder_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  constructorCallback_2_(__arg_0, __arg_1) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "TextDecoder"), [__arg_0, __arg_1]);
 
-  static constructorCallback_3(__arg_0, __arg_1, __arg_2) native "TextDecoder_constructorCallback";
-  constructorCallback_3_(__arg_0, __arg_1, __arg_2) => constructorCallback_3(__arg_0, __arg_1, __arg_2);
+  decode_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "decode", []);
 
-  static constructorCallback_4(__arg_0, __arg_1, __arg_2, __arg_3) native "TextDecoder_constructorCallback";
-  constructorCallback_4_(__arg_0, __arg_1, __arg_2, __arg_3) => constructorCallback_4(__arg_0, __arg_1, __arg_2, __arg_3);
+  decode_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "decode", [__arg_0]);
 
-  static decode_Callback_0(mthis) native "TextDecoder_decode_Callback";
-  decode_Callback_0_(mthis) => decode_Callback_0(mthis);
+  decode_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "decode", [__arg_0, __arg_1]);
 
-  static decode_Callback_1(mthis, __arg_0) native "TextDecoder_decode_Callback";
-  decode_Callback_1_(mthis, __arg_0) => decode_Callback_1(mthis, __arg_0);
+  encoding_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "encoding");
 
-  static decode_Callback_2(mthis, __arg_0, __arg_1) native "TextDecoder_decode_Callback";
-  decode_Callback_2_(mthis, __arg_0, __arg_1) => decode_Callback_2(mthis, __arg_0, __arg_1);
+  fatal_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "fatal");
 
-  static decode_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "TextDecoder_decode_Callback";
-  decode_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => decode_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static decode_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "TextDecoder_decode_Callback";
-  decode_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => decode_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static encoding_Getter(mthis) native "TextDecoder_encoding_Getter";
-  encoding_Getter_(mthis) => encoding_Getter(mthis);
-
-  static fatal_Getter(mthis) native "TextDecoder_fatal_Getter";
-  fatal_Getter_(mthis) => fatal_Getter(mthis);
-
-  static ignoreBOM_Getter(mthis) native "TextDecoder_ignoreBOM_Getter";
-  ignoreBOM_Getter_(mthis) => ignoreBOM_Getter(mthis);
+  ignoreBOM_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ignoreBOM");
 
 }
 
 class BlinkTextEncoder {
   static final instance = new BlinkTextEncoder();
 
-  static constructorCallback_0() native "TextEncoder_constructorCallback";
-  constructorCallback_0_() => constructorCallback_0();
+  constructorCallback_0_() => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "TextEncoder"), []);
 
-  static constructorCallback_1(__arg_0) native "TextEncoder_constructorCallback";
-  constructorCallback_1_(__arg_0) => constructorCallback_1(__arg_0);
+  constructorCallback_1_(__arg_0) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "TextEncoder"), [__arg_0]);
 
-  static constructorCallback_2(__arg_0, __arg_1) native "TextEncoder_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  encode_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "encode", []);
 
-  static constructorCallback_3(__arg_0, __arg_1, __arg_2) native "TextEncoder_constructorCallback";
-  constructorCallback_3_(__arg_0, __arg_1, __arg_2) => constructorCallback_3(__arg_0, __arg_1, __arg_2);
+  encode_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "encode", [__arg_0]);
 
-  static encode_Callback_0(mthis) native "TextEncoder_encode_Callback";
-  encode_Callback_0_(mthis) => encode_Callback_0(mthis);
-
-  static encode_Callback_1(mthis, __arg_0) native "TextEncoder_encode_Callback";
-  encode_Callback_1_(mthis, __arg_0) => encode_Callback_1(mthis, __arg_0);
-
-  static encode_Callback_2(mthis, __arg_0, __arg_1) native "TextEncoder_encode_Callback";
-  encode_Callback_2_(mthis, __arg_0, __arg_1) => encode_Callback_2(mthis, __arg_0, __arg_1);
-
-  static encode_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "TextEncoder_encode_Callback";
-  encode_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => encode_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static encoding_Getter(mthis) native "TextEncoder_encoding_Getter";
-  encoding_Getter_(mthis) => encoding_Getter(mthis);
+  encoding_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "encoding");
 
 }
 
 class BlinkTextEvent extends BlinkUIEvent {
   static final instance = new BlinkTextEvent();
 
-  static data_Getter(mthis) native "TextEvent_data_Getter";
-  data_Getter_(mthis) => data_Getter(mthis);
+  data_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "data");
 
-  static initTextEvent_Callback_0(mthis) native "TextEvent_initTextEvent_Callback";
-  initTextEvent_Callback_0_(mthis) => initTextEvent_Callback_0(mthis);
+  initTextEvent_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "initTextEvent", []);
 
-  static initTextEvent_Callback_1(mthis, __arg_0) native "TextEvent_initTextEvent_Callback";
-  initTextEvent_Callback_1_(mthis, __arg_0) => initTextEvent_Callback_1(mthis, __arg_0);
+  initTextEvent_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "initTextEvent", [__arg_0]);
 
-  static initTextEvent_Callback_2(mthis, __arg_0, __arg_1) native "TextEvent_initTextEvent_Callback";
-  initTextEvent_Callback_2_(mthis, __arg_0, __arg_1) => initTextEvent_Callback_2(mthis, __arg_0, __arg_1);
+  initTextEvent_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "initTextEvent", [__arg_0, __arg_1]);
 
-  static initTextEvent_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "TextEvent_initTextEvent_Callback";
-  initTextEvent_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => initTextEvent_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  initTextEvent_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "initTextEvent", [__arg_0, __arg_1, __arg_2]);
 
-  static initTextEvent_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "TextEvent_initTextEvent_Callback";
-  initTextEvent_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => initTextEvent_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  initTextEvent_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "initTextEvent", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static initTextEvent_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "TextEvent_initTextEvent_Callback";
-  initTextEvent_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => initTextEvent_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
-
-  static initTextEvent_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "TextEvent_initTextEvent_Callback";
-  initTextEvent_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => initTextEvent_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
-
-  static initTextEvent_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) native "TextEvent_initTextEvent_Callback";
-  initTextEvent_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => initTextEvent_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6);
+  initTextEvent_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => Blink_JsNative_DomException.callMethod(mthis, "initTextEvent", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4]);
 
 }
 
 class BlinkTextMetrics {
   static final instance = new BlinkTextMetrics();
 
-  static actualBoundingBoxAscent_Getter(mthis) native "TextMetrics_actualBoundingBoxAscent_Getter";
-  actualBoundingBoxAscent_Getter_(mthis) => actualBoundingBoxAscent_Getter(mthis);
+  actualBoundingBoxAscent_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "actualBoundingBoxAscent");
 
-  static actualBoundingBoxDescent_Getter(mthis) native "TextMetrics_actualBoundingBoxDescent_Getter";
-  actualBoundingBoxDescent_Getter_(mthis) => actualBoundingBoxDescent_Getter(mthis);
+  actualBoundingBoxDescent_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "actualBoundingBoxDescent");
 
-  static actualBoundingBoxLeft_Getter(mthis) native "TextMetrics_actualBoundingBoxLeft_Getter";
-  actualBoundingBoxLeft_Getter_(mthis) => actualBoundingBoxLeft_Getter(mthis);
+  actualBoundingBoxLeft_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "actualBoundingBoxLeft");
 
-  static actualBoundingBoxRight_Getter(mthis) native "TextMetrics_actualBoundingBoxRight_Getter";
-  actualBoundingBoxRight_Getter_(mthis) => actualBoundingBoxRight_Getter(mthis);
+  actualBoundingBoxRight_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "actualBoundingBoxRight");
 
-  static alphabeticBaseline_Getter(mthis) native "TextMetrics_alphabeticBaseline_Getter";
-  alphabeticBaseline_Getter_(mthis) => alphabeticBaseline_Getter(mthis);
+  alphabeticBaseline_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "alphabeticBaseline");
 
-  static emHeightAscent_Getter(mthis) native "TextMetrics_emHeightAscent_Getter";
-  emHeightAscent_Getter_(mthis) => emHeightAscent_Getter(mthis);
+  emHeightAscent_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "emHeightAscent");
 
-  static emHeightDescent_Getter(mthis) native "TextMetrics_emHeightDescent_Getter";
-  emHeightDescent_Getter_(mthis) => emHeightDescent_Getter(mthis);
+  emHeightDescent_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "emHeightDescent");
 
-  static fontBoundingBoxAscent_Getter(mthis) native "TextMetrics_fontBoundingBoxAscent_Getter";
-  fontBoundingBoxAscent_Getter_(mthis) => fontBoundingBoxAscent_Getter(mthis);
+  fontBoundingBoxAscent_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "fontBoundingBoxAscent");
 
-  static fontBoundingBoxDescent_Getter(mthis) native "TextMetrics_fontBoundingBoxDescent_Getter";
-  fontBoundingBoxDescent_Getter_(mthis) => fontBoundingBoxDescent_Getter(mthis);
+  fontBoundingBoxDescent_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "fontBoundingBoxDescent");
 
-  static hangingBaseline_Getter(mthis) native "TextMetrics_hangingBaseline_Getter";
-  hangingBaseline_Getter_(mthis) => hangingBaseline_Getter(mthis);
+  hangingBaseline_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "hangingBaseline");
 
-  static ideographicBaseline_Getter(mthis) native "TextMetrics_ideographicBaseline_Getter";
-  ideographicBaseline_Getter_(mthis) => ideographicBaseline_Getter(mthis);
+  ideographicBaseline_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ideographicBaseline");
 
-  static width_Getter(mthis) native "TextMetrics_width_Getter";
-  width_Getter_(mthis) => width_Getter(mthis);
+  width_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "width");
 
 }
 
 class BlinkTextTrack extends BlinkEventTarget {
   static final instance = new BlinkTextTrack();
 
-  static activeCues_Getter(mthis) native "TextTrack_activeCues_Getter";
-  activeCues_Getter_(mthis) => activeCues_Getter(mthis);
+  activeCues_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "activeCues");
 
-  static addCue_Callback_0(mthis) native "TextTrack_addCue_Callback";
-  addCue_Callback_0_(mthis) => addCue_Callback_0(mthis);
+  addCue_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "addCue", []);
 
-  static addCue_Callback_1(mthis, __arg_0) native "TextTrack_addCue_Callback";
-  addCue_Callback_1_(mthis, __arg_0) => addCue_Callback_1(mthis, __arg_0);
+  addCue_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "addCue", [__arg_0]);
 
-  static addCue_Callback_2(mthis, __arg_0, __arg_1) native "TextTrack_addCue_Callback";
-  addCue_Callback_2_(mthis, __arg_0, __arg_1) => addCue_Callback_2(mthis, __arg_0, __arg_1);
+  addRegion_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "addRegion", []);
 
-  static addCue_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "TextTrack_addCue_Callback";
-  addCue_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => addCue_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  addRegion_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "addRegion", [__arg_0]);
 
-  static addRegion_Callback_0(mthis) native "TextTrack_addRegion_Callback";
-  addRegion_Callback_0_(mthis) => addRegion_Callback_0(mthis);
+  cues_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "cues");
 
-  static addRegion_Callback_1(mthis, __arg_0) native "TextTrack_addRegion_Callback";
-  addRegion_Callback_1_(mthis, __arg_0) => addRegion_Callback_1(mthis, __arg_0);
+  id_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "id");
 
-  static addRegion_Callback_2(mthis, __arg_0, __arg_1) native "TextTrack_addRegion_Callback";
-  addRegion_Callback_2_(mthis, __arg_0, __arg_1) => addRegion_Callback_2(mthis, __arg_0, __arg_1);
+  kind_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "kind");
 
-  static addRegion_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "TextTrack_addRegion_Callback";
-  addRegion_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => addRegion_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  label_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "label");
 
-  static cues_Getter(mthis) native "TextTrack_cues_Getter";
-  cues_Getter_(mthis) => cues_Getter(mthis);
+  language_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "language");
 
-  static id_Getter(mthis) native "TextTrack_id_Getter";
-  id_Getter_(mthis) => id_Getter(mthis);
+  mode_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "mode");
 
-  static kind_Getter(mthis) native "TextTrack_kind_Getter";
-  kind_Getter_(mthis) => kind_Getter(mthis);
+  mode_Setter_(mthis, __arg_0) => mthis["mode"] = __arg_0;
 
-  static label_Getter(mthis) native "TextTrack_label_Getter";
-  label_Getter_(mthis) => label_Getter(mthis);
+  oncuechange_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "oncuechange");
 
-  static language_Getter(mthis) native "TextTrack_language_Getter";
-  language_Getter_(mthis) => language_Getter(mthis);
+  oncuechange_Setter_(mthis, __arg_0) => mthis["oncuechange"] = __arg_0;
 
-  static mode_Getter(mthis) native "TextTrack_mode_Getter";
-  mode_Getter_(mthis) => mode_Getter(mthis);
+  regions_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "regions");
 
-  static mode_Setter(mthis, __arg_0) native "TextTrack_mode_Setter";
-  mode_Setter_(mthis, __arg_0) => mode_Setter(mthis, __arg_0);
+  removeCue_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "removeCue", []);
 
-  static oncuechange_Getter(mthis) native "TextTrack_oncuechange_Getter";
-  oncuechange_Getter_(mthis) => oncuechange_Getter(mthis);
+  removeCue_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "removeCue", [__arg_0]);
 
-  static oncuechange_Setter(mthis, __arg_0) native "TextTrack_oncuechange_Setter";
-  oncuechange_Setter_(mthis, __arg_0) => oncuechange_Setter(mthis, __arg_0);
+  removeRegion_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "removeRegion", []);
 
-  static regions_Getter(mthis) native "TextTrack_regions_Getter";
-  regions_Getter_(mthis) => regions_Getter(mthis);
-
-  static removeCue_Callback_0(mthis) native "TextTrack_removeCue_Callback";
-  removeCue_Callback_0_(mthis) => removeCue_Callback_0(mthis);
-
-  static removeCue_Callback_1(mthis, __arg_0) native "TextTrack_removeCue_Callback";
-  removeCue_Callback_1_(mthis, __arg_0) => removeCue_Callback_1(mthis, __arg_0);
-
-  static removeCue_Callback_2(mthis, __arg_0, __arg_1) native "TextTrack_removeCue_Callback";
-  removeCue_Callback_2_(mthis, __arg_0, __arg_1) => removeCue_Callback_2(mthis, __arg_0, __arg_1);
-
-  static removeCue_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "TextTrack_removeCue_Callback";
-  removeCue_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => removeCue_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static removeRegion_Callback_0(mthis) native "TextTrack_removeRegion_Callback";
-  removeRegion_Callback_0_(mthis) => removeRegion_Callback_0(mthis);
-
-  static removeRegion_Callback_1(mthis, __arg_0) native "TextTrack_removeRegion_Callback";
-  removeRegion_Callback_1_(mthis, __arg_0) => removeRegion_Callback_1(mthis, __arg_0);
-
-  static removeRegion_Callback_2(mthis, __arg_0, __arg_1) native "TextTrack_removeRegion_Callback";
-  removeRegion_Callback_2_(mthis, __arg_0, __arg_1) => removeRegion_Callback_2(mthis, __arg_0, __arg_1);
-
-  static removeRegion_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "TextTrack_removeRegion_Callback";
-  removeRegion_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => removeRegion_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  removeRegion_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "removeRegion", [__arg_0]);
 
 }
 
 class BlinkTextTrackCue extends BlinkEventTarget {
   static final instance = new BlinkTextTrackCue();
 
-  static endTime_Getter(mthis) native "TextTrackCue_endTime_Getter";
-  endTime_Getter_(mthis) => endTime_Getter(mthis);
+  endTime_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "endTime");
 
-  static endTime_Setter(mthis, __arg_0) native "TextTrackCue_endTime_Setter";
-  endTime_Setter_(mthis, __arg_0) => endTime_Setter(mthis, __arg_0);
+  endTime_Setter_(mthis, __arg_0) => mthis["endTime"] = __arg_0;
 
-  static id_Getter(mthis) native "TextTrackCue_id_Getter";
-  id_Getter_(mthis) => id_Getter(mthis);
+  id_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "id");
 
-  static id_Setter(mthis, __arg_0) native "TextTrackCue_id_Setter";
-  id_Setter_(mthis, __arg_0) => id_Setter(mthis, __arg_0);
+  id_Setter_(mthis, __arg_0) => mthis["id"] = __arg_0;
 
-  static onenter_Getter(mthis) native "TextTrackCue_onenter_Getter";
-  onenter_Getter_(mthis) => onenter_Getter(mthis);
+  onenter_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onenter");
 
-  static onenter_Setter(mthis, __arg_0) native "TextTrackCue_onenter_Setter";
-  onenter_Setter_(mthis, __arg_0) => onenter_Setter(mthis, __arg_0);
+  onenter_Setter_(mthis, __arg_0) => mthis["onenter"] = __arg_0;
 
-  static onexit_Getter(mthis) native "TextTrackCue_onexit_Getter";
-  onexit_Getter_(mthis) => onexit_Getter(mthis);
+  onexit_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onexit");
 
-  static onexit_Setter(mthis, __arg_0) native "TextTrackCue_onexit_Setter";
-  onexit_Setter_(mthis, __arg_0) => onexit_Setter(mthis, __arg_0);
+  onexit_Setter_(mthis, __arg_0) => mthis["onexit"] = __arg_0;
 
-  static pauseOnExit_Getter(mthis) native "TextTrackCue_pauseOnExit_Getter";
-  pauseOnExit_Getter_(mthis) => pauseOnExit_Getter(mthis);
+  pauseOnExit_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "pauseOnExit");
 
-  static pauseOnExit_Setter(mthis, __arg_0) native "TextTrackCue_pauseOnExit_Setter";
-  pauseOnExit_Setter_(mthis, __arg_0) => pauseOnExit_Setter(mthis, __arg_0);
+  pauseOnExit_Setter_(mthis, __arg_0) => mthis["pauseOnExit"] = __arg_0;
 
-  static startTime_Getter(mthis) native "TextTrackCue_startTime_Getter";
-  startTime_Getter_(mthis) => startTime_Getter(mthis);
+  startTime_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "startTime");
 
-  static startTime_Setter(mthis, __arg_0) native "TextTrackCue_startTime_Setter";
-  startTime_Setter_(mthis, __arg_0) => startTime_Setter(mthis, __arg_0);
+  startTime_Setter_(mthis, __arg_0) => mthis["startTime"] = __arg_0;
 
-  static track_Getter(mthis) native "TextTrackCue_track_Getter";
-  track_Getter_(mthis) => track_Getter(mthis);
+  track_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "track");
 
 }
 
 class BlinkTextTrackCueList {
   static final instance = new BlinkTextTrackCueList();
 
-  static $__getter___Callback_1(mthis, __arg_0) native "TextTrackCueList___getter___Callback";
-  $__getter___Callback_1_(mthis, __arg_0) => $__getter___Callback_1(mthis, __arg_0);
+  $__getter___Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "__getter__", [__arg_0]);
 
-  static getCueById_Callback_0(mthis) native "TextTrackCueList_getCueById_Callback";
-  getCueById_Callback_0_(mthis) => getCueById_Callback_0(mthis);
+  getCueById_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getCueById", []);
 
-  static getCueById_Callback_1(mthis, __arg_0) native "TextTrackCueList_getCueById_Callback";
-  getCueById_Callback_1_(mthis, __arg_0) => getCueById_Callback_1(mthis, __arg_0);
+  getCueById_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getCueById", [__arg_0]);
 
-  static getCueById_Callback_2(mthis, __arg_0, __arg_1) native "TextTrackCueList_getCueById_Callback";
-  getCueById_Callback_2_(mthis, __arg_0, __arg_1) => getCueById_Callback_2(mthis, __arg_0, __arg_1);
+  item_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "item", []);
 
-  static getCueById_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "TextTrackCueList_getCueById_Callback";
-  getCueById_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getCueById_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  item_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "item", [__arg_0]);
 
-  static item_Callback_0(mthis) native "TextTrackCueList_item_Callback";
-  item_Callback_0_(mthis) => item_Callback_0(mthis);
-
-  static item_Callback_1(mthis, __arg_0) native "TextTrackCueList_item_Callback";
-  item_Callback_1_(mthis, __arg_0) => item_Callback_1(mthis, __arg_0);
-
-  static item_Callback_2(mthis, __arg_0, __arg_1) native "TextTrackCueList_item_Callback";
-  item_Callback_2_(mthis, __arg_0, __arg_1) => item_Callback_2(mthis, __arg_0, __arg_1);
-
-  static item_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "TextTrackCueList_item_Callback";
-  item_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => item_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static length_Getter(mthis) native "TextTrackCueList_length_Getter";
-  length_Getter_(mthis) => length_Getter(mthis);
+  length_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "length");
 
 }
 
 class BlinkTextTrackList extends BlinkEventTarget {
   static final instance = new BlinkTextTrackList();
 
-  static $__getter___Callback_1(mthis, __arg_0) native "TextTrackList___getter___Callback";
-  $__getter___Callback_1_(mthis, __arg_0) => $__getter___Callback_1(mthis, __arg_0);
+  $__getter___Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "__getter__", [__arg_0]);
 
-  static getTrackById_Callback_0(mthis) native "TextTrackList_getTrackById_Callback";
-  getTrackById_Callback_0_(mthis) => getTrackById_Callback_0(mthis);
+  getTrackById_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getTrackById", []);
 
-  static getTrackById_Callback_1(mthis, __arg_0) native "TextTrackList_getTrackById_Callback";
-  getTrackById_Callback_1_(mthis, __arg_0) => getTrackById_Callback_1(mthis, __arg_0);
+  getTrackById_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getTrackById", [__arg_0]);
 
-  static getTrackById_Callback_2(mthis, __arg_0, __arg_1) native "TextTrackList_getTrackById_Callback";
-  getTrackById_Callback_2_(mthis, __arg_0, __arg_1) => getTrackById_Callback_2(mthis, __arg_0, __arg_1);
+  item_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "item", []);
 
-  static getTrackById_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "TextTrackList_getTrackById_Callback";
-  getTrackById_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getTrackById_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  item_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "item", [__arg_0]);
 
-  static item_Callback_0(mthis) native "TextTrackList_item_Callback";
-  item_Callback_0_(mthis) => item_Callback_0(mthis);
+  length_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "length");
 
-  static item_Callback_1(mthis, __arg_0) native "TextTrackList_item_Callback";
-  item_Callback_1_(mthis, __arg_0) => item_Callback_1(mthis, __arg_0);
+  onaddtrack_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onaddtrack");
 
-  static item_Callback_2(mthis, __arg_0, __arg_1) native "TextTrackList_item_Callback";
-  item_Callback_2_(mthis, __arg_0, __arg_1) => item_Callback_2(mthis, __arg_0, __arg_1);
+  onaddtrack_Setter_(mthis, __arg_0) => mthis["onaddtrack"] = __arg_0;
 
-  static item_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "TextTrackList_item_Callback";
-  item_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => item_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  onchange_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onchange");
 
-  static length_Getter(mthis) native "TextTrackList_length_Getter";
-  length_Getter_(mthis) => length_Getter(mthis);
+  onchange_Setter_(mthis, __arg_0) => mthis["onchange"] = __arg_0;
 
-  static onaddtrack_Getter(mthis) native "TextTrackList_onaddtrack_Getter";
-  onaddtrack_Getter_(mthis) => onaddtrack_Getter(mthis);
+  onremovetrack_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onremovetrack");
 
-  static onaddtrack_Setter(mthis, __arg_0) native "TextTrackList_onaddtrack_Setter";
-  onaddtrack_Setter_(mthis, __arg_0) => onaddtrack_Setter(mthis, __arg_0);
-
-  static onchange_Getter(mthis) native "TextTrackList_onchange_Getter";
-  onchange_Getter_(mthis) => onchange_Getter(mthis);
-
-  static onchange_Setter(mthis, __arg_0) native "TextTrackList_onchange_Setter";
-  onchange_Setter_(mthis, __arg_0) => onchange_Setter(mthis, __arg_0);
-
-  static onremovetrack_Getter(mthis) native "TextTrackList_onremovetrack_Getter";
-  onremovetrack_Getter_(mthis) => onremovetrack_Getter(mthis);
-
-  static onremovetrack_Setter(mthis, __arg_0) native "TextTrackList_onremovetrack_Setter";
-  onremovetrack_Setter_(mthis, __arg_0) => onremovetrack_Setter(mthis, __arg_0);
+  onremovetrack_Setter_(mthis, __arg_0) => mthis["onremovetrack"] = __arg_0;
 
 }
 
 class BlinkTimeRanges {
   static final instance = new BlinkTimeRanges();
 
-  static end_Callback_0(mthis) native "TimeRanges_end_Callback";
-  end_Callback_0_(mthis) => end_Callback_0(mthis);
+  end_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "end", []);
 
-  static end_Callback_1(mthis, __arg_0) native "TimeRanges_end_Callback";
-  end_Callback_1_(mthis, __arg_0) => end_Callback_1(mthis, __arg_0);
+  end_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "end", [__arg_0]);
 
-  static end_Callback_2(mthis, __arg_0, __arg_1) native "TimeRanges_end_Callback";
-  end_Callback_2_(mthis, __arg_0, __arg_1) => end_Callback_2(mthis, __arg_0, __arg_1);
+  length_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "length");
 
-  static end_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "TimeRanges_end_Callback";
-  end_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => end_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  start_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "start", []);
 
-  static length_Getter(mthis) native "TimeRanges_length_Getter";
-  length_Getter_(mthis) => length_Getter(mthis);
-
-  static start_Callback_0(mthis) native "TimeRanges_start_Callback";
-  start_Callback_0_(mthis) => start_Callback_0(mthis);
-
-  static start_Callback_1(mthis, __arg_0) native "TimeRanges_start_Callback";
-  start_Callback_1_(mthis, __arg_0) => start_Callback_1(mthis, __arg_0);
-
-  static start_Callback_2(mthis, __arg_0, __arg_1) native "TimeRanges_start_Callback";
-  start_Callback_2_(mthis, __arg_0, __arg_1) => start_Callback_2(mthis, __arg_0, __arg_1);
-
-  static start_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "TimeRanges_start_Callback";
-  start_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => start_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  start_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "start", [__arg_0]);
 
 }
 
 class BlinkTiming {
   static final instance = new BlinkTiming();
 
-  static $__getter___Callback_1(mthis, __arg_0) native "Timing___getter___Callback";
-  $__getter___Callback_1_(mthis, __arg_0) => $__getter___Callback_1(mthis, __arg_0);
+  $__getter___Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "__getter__", [__arg_0]);
 
-  static $__setter___Callback_2(mthis, __arg_0, __arg_1) native "Timing___setter___Callback";
-  $__setter___Callback_2_(mthis, __arg_0, __arg_1) => $__setter___Callback_2(mthis, __arg_0, __arg_1);
+  $__setter___Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "__setter__", [__arg_0, __arg_1]);
 
-  static delay_Getter(mthis) native "Timing_delay_Getter";
-  delay_Getter_(mthis) => delay_Getter(mthis);
+  delay_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "delay");
 
-  static delay_Setter(mthis, __arg_0) native "Timing_delay_Setter";
-  delay_Setter_(mthis, __arg_0) => delay_Setter(mthis, __arg_0);
+  delay_Setter_(mthis, __arg_0) => mthis["delay"] = __arg_0;
 
-  static direction_Getter(mthis) native "Timing_direction_Getter";
-  direction_Getter_(mthis) => direction_Getter(mthis);
+  direction_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "direction");
 
-  static direction_Setter(mthis, __arg_0) native "Timing_direction_Setter";
-  direction_Setter_(mthis, __arg_0) => direction_Setter(mthis, __arg_0);
+  direction_Setter_(mthis, __arg_0) => mthis["direction"] = __arg_0;
 
-  static easing_Getter(mthis) native "Timing_easing_Getter";
-  easing_Getter_(mthis) => easing_Getter(mthis);
+  easing_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "easing");
 
-  static easing_Setter(mthis, __arg_0) native "Timing_easing_Setter";
-  easing_Setter_(mthis, __arg_0) => easing_Setter(mthis, __arg_0);
+  easing_Setter_(mthis, __arg_0) => mthis["easing"] = __arg_0;
 
-  static endDelay_Getter(mthis) native "Timing_endDelay_Getter";
-  endDelay_Getter_(mthis) => endDelay_Getter(mthis);
+  endDelay_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "endDelay");
 
-  static endDelay_Setter(mthis, __arg_0) native "Timing_endDelay_Setter";
-  endDelay_Setter_(mthis, __arg_0) => endDelay_Setter(mthis, __arg_0);
+  endDelay_Setter_(mthis, __arg_0) => mthis["endDelay"] = __arg_0;
 
-  static fill_Getter(mthis) native "Timing_fill_Getter";
-  fill_Getter_(mthis) => fill_Getter(mthis);
+  fill_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "fill");
 
-  static fill_Setter(mthis, __arg_0) native "Timing_fill_Setter";
-  fill_Setter_(mthis, __arg_0) => fill_Setter(mthis, __arg_0);
+  fill_Setter_(mthis, __arg_0) => mthis["fill"] = __arg_0;
 
-  static iterationStart_Getter(mthis) native "Timing_iterationStart_Getter";
-  iterationStart_Getter_(mthis) => iterationStart_Getter(mthis);
+  iterationStart_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "iterationStart");
 
-  static iterationStart_Setter(mthis, __arg_0) native "Timing_iterationStart_Setter";
-  iterationStart_Setter_(mthis, __arg_0) => iterationStart_Setter(mthis, __arg_0);
+  iterationStart_Setter_(mthis, __arg_0) => mthis["iterationStart"] = __arg_0;
 
-  static iterations_Getter(mthis) native "Timing_iterations_Getter";
-  iterations_Getter_(mthis) => iterations_Getter(mthis);
+  iterations_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "iterations");
 
-  static iterations_Setter(mthis, __arg_0) native "Timing_iterations_Setter";
-  iterations_Setter_(mthis, __arg_0) => iterations_Setter(mthis, __arg_0);
+  iterations_Setter_(mthis, __arg_0) => mthis["iterations"] = __arg_0;
 
-  static playbackRate_Getter(mthis) native "Timing_playbackRate_Getter";
-  playbackRate_Getter_(mthis) => playbackRate_Getter(mthis);
+  playbackRate_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "playbackRate");
 
-  static playbackRate_Setter(mthis, __arg_0) native "Timing_playbackRate_Setter";
-  playbackRate_Setter_(mthis, __arg_0) => playbackRate_Setter(mthis, __arg_0);
+  playbackRate_Setter_(mthis, __arg_0) => mthis["playbackRate"] = __arg_0;
 
 }
 
 class BlinkTouch {
   static final instance = new BlinkTouch();
 
-  static clientX_Getter(mthis) native "Touch_clientX_Getter";
-  clientX_Getter_(mthis) => clientX_Getter(mthis);
+  clientX_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "clientX");
 
-  static clientY_Getter(mthis) native "Touch_clientY_Getter";
-  clientY_Getter_(mthis) => clientY_Getter(mthis);
+  clientY_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "clientY");
 
-  static force_Getter(mthis) native "Touch_force_Getter";
-  force_Getter_(mthis) => force_Getter(mthis);
+  force_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "force");
 
-  static identifier_Getter(mthis) native "Touch_identifier_Getter";
-  identifier_Getter_(mthis) => identifier_Getter(mthis);
+  identifier_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "identifier");
 
-  static pageX_Getter(mthis) native "Touch_pageX_Getter";
-  pageX_Getter_(mthis) => pageX_Getter(mthis);
+  pageX_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "pageX");
 
-  static pageY_Getter(mthis) native "Touch_pageY_Getter";
-  pageY_Getter_(mthis) => pageY_Getter(mthis);
+  pageY_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "pageY");
 
-  static radiusX_Getter(mthis) native "Touch_radiusX_Getter";
-  radiusX_Getter_(mthis) => radiusX_Getter(mthis);
+  radiusX_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "radiusX");
 
-  static radiusY_Getter(mthis) native "Touch_radiusY_Getter";
-  radiusY_Getter_(mthis) => radiusY_Getter(mthis);
+  radiusY_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "radiusY");
 
-  static screenX_Getter(mthis) native "Touch_screenX_Getter";
-  screenX_Getter_(mthis) => screenX_Getter(mthis);
+  screenX_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "screenX");
 
-  static screenY_Getter(mthis) native "Touch_screenY_Getter";
-  screenY_Getter_(mthis) => screenY_Getter(mthis);
+  screenY_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "screenY");
 
-  static target_Getter(mthis) native "Touch_target_Getter";
-  target_Getter_(mthis) => target_Getter(mthis);
+  target_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "target");
 
-  static webkitForce_Getter(mthis) native "Touch_webkitForce_Getter";
-  webkitForce_Getter_(mthis) => webkitForce_Getter(mthis);
+  webkitForce_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "webkitForce");
 
-  static webkitRadiusX_Getter(mthis) native "Touch_webkitRadiusX_Getter";
-  webkitRadiusX_Getter_(mthis) => webkitRadiusX_Getter(mthis);
+  webkitRadiusX_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "webkitRadiusX");
 
-  static webkitRadiusY_Getter(mthis) native "Touch_webkitRadiusY_Getter";
-  webkitRadiusY_Getter_(mthis) => webkitRadiusY_Getter(mthis);
+  webkitRadiusY_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "webkitRadiusY");
 
-  static webkitRotationAngle_Getter(mthis) native "Touch_webkitRotationAngle_Getter";
-  webkitRotationAngle_Getter_(mthis) => webkitRotationAngle_Getter(mthis);
+  webkitRotationAngle_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "webkitRotationAngle");
 
 }
 
 class BlinkTouchEvent extends BlinkUIEvent {
   static final instance = new BlinkTouchEvent();
 
-  static altKey_Getter(mthis) native "TouchEvent_altKey_Getter";
-  altKey_Getter_(mthis) => altKey_Getter(mthis);
+  altKey_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "altKey");
 
-  static changedTouches_Getter(mthis) native "TouchEvent_changedTouches_Getter";
-  changedTouches_Getter_(mthis) => changedTouches_Getter(mthis);
+  changedTouches_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "changedTouches");
 
-  static ctrlKey_Getter(mthis) native "TouchEvent_ctrlKey_Getter";
-  ctrlKey_Getter_(mthis) => ctrlKey_Getter(mthis);
+  ctrlKey_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ctrlKey");
 
-  static initTouchEvent_Callback_0(mthis) native "TouchEvent_initTouchEvent_Callback";
-  initTouchEvent_Callback_0_(mthis) => initTouchEvent_Callback_0(mthis);
+  initTouchEvent_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "initTouchEvent", []);
 
-  static initTouchEvent_Callback_1(mthis, __arg_0) native "TouchEvent_initTouchEvent_Callback";
-  initTouchEvent_Callback_1_(mthis, __arg_0) => initTouchEvent_Callback_1(mthis, __arg_0);
+  initTouchEvent_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "initTouchEvent", [__arg_0]);
 
-  static initTouchEvent_Callback_10(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9) native "TouchEvent_initTouchEvent_Callback";
-  initTouchEvent_Callback_10_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9) => initTouchEvent_Callback_10(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9);
+  initTouchEvent_Callback_10_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9) => Blink_JsNative_DomException.callMethod(mthis, "initTouchEvent", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9]);
 
-  static initTouchEvent_Callback_11(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10) native "TouchEvent_initTouchEvent_Callback";
-  initTouchEvent_Callback_11_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10) => initTouchEvent_Callback_11(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10);
+  initTouchEvent_Callback_11_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10) => Blink_JsNative_DomException.callMethod(mthis, "initTouchEvent", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10]);
 
-  static initTouchEvent_Callback_12(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10, __arg_11) native "TouchEvent_initTouchEvent_Callback";
-  initTouchEvent_Callback_12_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10, __arg_11) => initTouchEvent_Callback_12(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10, __arg_11);
+  initTouchEvent_Callback_12_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10, __arg_11) => Blink_JsNative_DomException.callMethod(mthis, "initTouchEvent", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10, __arg_11]);
 
-  static initTouchEvent_Callback_13(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10, __arg_11, __arg_12) native "TouchEvent_initTouchEvent_Callback";
-  initTouchEvent_Callback_13_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10, __arg_11, __arg_12) => initTouchEvent_Callback_13(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10, __arg_11, __arg_12);
+  initTouchEvent_Callback_13_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10, __arg_11, __arg_12) => Blink_JsNative_DomException.callMethod(mthis, "initTouchEvent", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10, __arg_11, __arg_12]);
 
-  static initTouchEvent_Callback_14(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10, __arg_11, __arg_12, __arg_13) native "TouchEvent_initTouchEvent_Callback";
-  initTouchEvent_Callback_14_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10, __arg_11, __arg_12, __arg_13) => initTouchEvent_Callback_14(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10, __arg_11, __arg_12, __arg_13);
+  initTouchEvent_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "initTouchEvent", [__arg_0, __arg_1]);
 
-  static initTouchEvent_Callback_15(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10, __arg_11, __arg_12, __arg_13, __arg_14) native "TouchEvent_initTouchEvent_Callback";
-  initTouchEvent_Callback_15_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10, __arg_11, __arg_12, __arg_13, __arg_14) => initTouchEvent_Callback_15(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10, __arg_11, __arg_12, __arg_13, __arg_14);
+  initTouchEvent_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "initTouchEvent", [__arg_0, __arg_1, __arg_2]);
 
-  static initTouchEvent_Callback_2(mthis, __arg_0, __arg_1) native "TouchEvent_initTouchEvent_Callback";
-  initTouchEvent_Callback_2_(mthis, __arg_0, __arg_1) => initTouchEvent_Callback_2(mthis, __arg_0, __arg_1);
+  initTouchEvent_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "initTouchEvent", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static initTouchEvent_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "TouchEvent_initTouchEvent_Callback";
-  initTouchEvent_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => initTouchEvent_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  initTouchEvent_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => Blink_JsNative_DomException.callMethod(mthis, "initTouchEvent", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4]);
 
-  static initTouchEvent_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "TouchEvent_initTouchEvent_Callback";
-  initTouchEvent_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => initTouchEvent_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  initTouchEvent_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => Blink_JsNative_DomException.callMethod(mthis, "initTouchEvent", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5]);
 
-  static initTouchEvent_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "TouchEvent_initTouchEvent_Callback";
-  initTouchEvent_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => initTouchEvent_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  initTouchEvent_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => Blink_JsNative_DomException.callMethod(mthis, "initTouchEvent", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6]);
 
-  static initTouchEvent_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "TouchEvent_initTouchEvent_Callback";
-  initTouchEvent_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => initTouchEvent_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  initTouchEvent_Callback_8_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) => Blink_JsNative_DomException.callMethod(mthis, "initTouchEvent", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7]);
 
-  static initTouchEvent_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) native "TouchEvent_initTouchEvent_Callback";
-  initTouchEvent_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => initTouchEvent_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6);
+  initTouchEvent_Callback_9_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8) => Blink_JsNative_DomException.callMethod(mthis, "initTouchEvent", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8]);
 
-  static initTouchEvent_Callback_8(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) native "TouchEvent_initTouchEvent_Callback";
-  initTouchEvent_Callback_8_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) => initTouchEvent_Callback_8(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7);
+  metaKey_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "metaKey");
 
-  static initTouchEvent_Callback_9(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8) native "TouchEvent_initTouchEvent_Callback";
-  initTouchEvent_Callback_9_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8) => initTouchEvent_Callback_9(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8);
+  shiftKey_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "shiftKey");
 
-  static metaKey_Getter(mthis) native "TouchEvent_metaKey_Getter";
-  metaKey_Getter_(mthis) => metaKey_Getter(mthis);
+  targetTouches_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "targetTouches");
 
-  static shiftKey_Getter(mthis) native "TouchEvent_shiftKey_Getter";
-  shiftKey_Getter_(mthis) => shiftKey_Getter(mthis);
-
-  static targetTouches_Getter(mthis) native "TouchEvent_targetTouches_Getter";
-  targetTouches_Getter_(mthis) => targetTouches_Getter(mthis);
-
-  static touches_Getter(mthis) native "TouchEvent_touches_Getter";
-  touches_Getter_(mthis) => touches_Getter(mthis);
+  touches_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "touches");
 
 }
 
 class BlinkTouchList {
   static final instance = new BlinkTouchList();
 
-  static $__getter___Callback_1(mthis, __arg_0) native "TouchList___getter___Callback";
-  $__getter___Callback_1_(mthis, __arg_0) => $__getter___Callback_1(mthis, __arg_0);
+  $__getter___Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "__getter__", [__arg_0]);
 
-  static item_Callback_0(mthis) native "TouchList_item_Callback";
-  item_Callback_0_(mthis) => item_Callback_0(mthis);
+  item_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "item", []);
 
-  static item_Callback_1(mthis, __arg_0) native "TouchList_item_Callback";
-  item_Callback_1_(mthis, __arg_0) => item_Callback_1(mthis, __arg_0);
+  item_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "item", [__arg_0]);
 
-  static item_Callback_2(mthis, __arg_0, __arg_1) native "TouchList_item_Callback";
-  item_Callback_2_(mthis, __arg_0, __arg_1) => item_Callback_2(mthis, __arg_0, __arg_1);
-
-  static item_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "TouchList_item_Callback";
-  item_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => item_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static length_Getter(mthis) native "TouchList_length_Getter";
-  length_Getter_(mthis) => length_Getter(mthis);
+  length_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "length");
 
 }
 
 class BlinkTrackEvent extends BlinkEvent {
   static final instance = new BlinkTrackEvent();
 
-  static constructorCallback_2(__arg_0, __arg_1) native "TrackEvent_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  constructorCallback_2_(__arg_0, __arg_1) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "TrackEvent"), [__arg_0, __arg_1]);
 
-  static track_Getter(mthis) native "TrackEvent_track_Getter";
-  track_Getter_(mthis) => track_Getter(mthis);
+  track_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "track");
 
 }
 
 class BlinkTransitionEvent extends BlinkEvent {
   static final instance = new BlinkTransitionEvent();
 
-  static constructorCallback_2(__arg_0, __arg_1) native "TransitionEvent_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  constructorCallback_2_(__arg_0, __arg_1) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "TransitionEvent"), [__arg_0, __arg_1]);
 
-  static elapsedTime_Getter(mthis) native "TransitionEvent_elapsedTime_Getter";
-  elapsedTime_Getter_(mthis) => elapsedTime_Getter(mthis);
+  elapsedTime_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "elapsedTime");
 
-  static propertyName_Getter(mthis) native "TransitionEvent_propertyName_Getter";
-  propertyName_Getter_(mthis) => propertyName_Getter(mthis);
+  propertyName_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "propertyName");
 
-  static pseudoElement_Getter(mthis) native "TransitionEvent_pseudoElement_Getter";
-  pseudoElement_Getter_(mthis) => pseudoElement_Getter(mthis);
+  pseudoElement_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "pseudoElement");
 
 }
 
 class BlinkTreeWalker {
   static final instance = new BlinkTreeWalker();
 
-  static currentNode_Getter(mthis) native "TreeWalker_currentNode_Getter";
-  currentNode_Getter_(mthis) => currentNode_Getter(mthis);
+  currentNode_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "currentNode");
 
-  static currentNode_Setter(mthis, __arg_0) native "TreeWalker_currentNode_Setter";
-  currentNode_Setter_(mthis, __arg_0) => currentNode_Setter(mthis, __arg_0);
+  currentNode_Setter_(mthis, __arg_0) => mthis["currentNode"] = __arg_0;
 
-  static expandEntityReferences_Getter(mthis) native "TreeWalker_expandEntityReferences_Getter";
-  expandEntityReferences_Getter_(mthis) => expandEntityReferences_Getter(mthis);
+  expandEntityReferences_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "expandEntityReferences");
 
-  static filter_Getter(mthis) native "TreeWalker_filter_Getter";
-  filter_Getter_(mthis) => filter_Getter(mthis);
+  filter_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "filter");
 
-  static firstChild_Callback_0(mthis) native "TreeWalker_firstChild_Callback";
-  firstChild_Callback_0_(mthis) => firstChild_Callback_0(mthis);
+  firstChild_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "firstChild", []);
 
-  static firstChild_Callback_1(mthis, __arg_0) native "TreeWalker_firstChild_Callback";
-  firstChild_Callback_1_(mthis, __arg_0) => firstChild_Callback_1(mthis, __arg_0);
+  lastChild_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "lastChild", []);
 
-  static firstChild_Callback_2(mthis, __arg_0, __arg_1) native "TreeWalker_firstChild_Callback";
-  firstChild_Callback_2_(mthis, __arg_0, __arg_1) => firstChild_Callback_2(mthis, __arg_0, __arg_1);
+  nextNode_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "nextNode", []);
 
-  static lastChild_Callback_0(mthis) native "TreeWalker_lastChild_Callback";
-  lastChild_Callback_0_(mthis) => lastChild_Callback_0(mthis);
+  nextSibling_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "nextSibling", []);
 
-  static lastChild_Callback_1(mthis, __arg_0) native "TreeWalker_lastChild_Callback";
-  lastChild_Callback_1_(mthis, __arg_0) => lastChild_Callback_1(mthis, __arg_0);
+  parentNode_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "parentNode", []);
 
-  static lastChild_Callback_2(mthis, __arg_0, __arg_1) native "TreeWalker_lastChild_Callback";
-  lastChild_Callback_2_(mthis, __arg_0, __arg_1) => lastChild_Callback_2(mthis, __arg_0, __arg_1);
+  previousNode_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "previousNode", []);
 
-  static nextNode_Callback_0(mthis) native "TreeWalker_nextNode_Callback";
-  nextNode_Callback_0_(mthis) => nextNode_Callback_0(mthis);
+  previousSibling_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "previousSibling", []);
 
-  static nextNode_Callback_1(mthis, __arg_0) native "TreeWalker_nextNode_Callback";
-  nextNode_Callback_1_(mthis, __arg_0) => nextNode_Callback_1(mthis, __arg_0);
+  root_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "root");
 
-  static nextNode_Callback_2(mthis, __arg_0, __arg_1) native "TreeWalker_nextNode_Callback";
-  nextNode_Callback_2_(mthis, __arg_0, __arg_1) => nextNode_Callback_2(mthis, __arg_0, __arg_1);
-
-  static nextSibling_Callback_0(mthis) native "TreeWalker_nextSibling_Callback";
-  nextSibling_Callback_0_(mthis) => nextSibling_Callback_0(mthis);
-
-  static nextSibling_Callback_1(mthis, __arg_0) native "TreeWalker_nextSibling_Callback";
-  nextSibling_Callback_1_(mthis, __arg_0) => nextSibling_Callback_1(mthis, __arg_0);
-
-  static nextSibling_Callback_2(mthis, __arg_0, __arg_1) native "TreeWalker_nextSibling_Callback";
-  nextSibling_Callback_2_(mthis, __arg_0, __arg_1) => nextSibling_Callback_2(mthis, __arg_0, __arg_1);
-
-  static parentNode_Callback_0(mthis) native "TreeWalker_parentNode_Callback";
-  parentNode_Callback_0_(mthis) => parentNode_Callback_0(mthis);
-
-  static parentNode_Callback_1(mthis, __arg_0) native "TreeWalker_parentNode_Callback";
-  parentNode_Callback_1_(mthis, __arg_0) => parentNode_Callback_1(mthis, __arg_0);
-
-  static parentNode_Callback_2(mthis, __arg_0, __arg_1) native "TreeWalker_parentNode_Callback";
-  parentNode_Callback_2_(mthis, __arg_0, __arg_1) => parentNode_Callback_2(mthis, __arg_0, __arg_1);
-
-  static previousNode_Callback_0(mthis) native "TreeWalker_previousNode_Callback";
-  previousNode_Callback_0_(mthis) => previousNode_Callback_0(mthis);
-
-  static previousNode_Callback_1(mthis, __arg_0) native "TreeWalker_previousNode_Callback";
-  previousNode_Callback_1_(mthis, __arg_0) => previousNode_Callback_1(mthis, __arg_0);
-
-  static previousNode_Callback_2(mthis, __arg_0, __arg_1) native "TreeWalker_previousNode_Callback";
-  previousNode_Callback_2_(mthis, __arg_0, __arg_1) => previousNode_Callback_2(mthis, __arg_0, __arg_1);
-
-  static previousSibling_Callback_0(mthis) native "TreeWalker_previousSibling_Callback";
-  previousSibling_Callback_0_(mthis) => previousSibling_Callback_0(mthis);
-
-  static previousSibling_Callback_1(mthis, __arg_0) native "TreeWalker_previousSibling_Callback";
-  previousSibling_Callback_1_(mthis, __arg_0) => previousSibling_Callback_1(mthis, __arg_0);
-
-  static previousSibling_Callback_2(mthis, __arg_0, __arg_1) native "TreeWalker_previousSibling_Callback";
-  previousSibling_Callback_2_(mthis, __arg_0, __arg_1) => previousSibling_Callback_2(mthis, __arg_0, __arg_1);
-
-  static root_Getter(mthis) native "TreeWalker_root_Getter";
-  root_Getter_(mthis) => root_Getter(mthis);
-
-  static whatToShow_Getter(mthis) native "TreeWalker_whatToShow_Getter";
-  whatToShow_Getter_(mthis) => whatToShow_Getter(mthis);
+  whatToShow_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "whatToShow");
 
 }
 
 class BlinkUIEvent extends BlinkEvent {
   static final instance = new BlinkUIEvent();
 
-  static charCode_Getter(mthis) native "UIEvent_charCode_Getter";
-  charCode_Getter_(mthis) => charCode_Getter(mthis);
+  charCode_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "charCode");
 
-  static constructorCallback_2(__arg_0, __arg_1) native "UIEvent_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  constructorCallback_2_(__arg_0, __arg_1) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "UIEvent"), [__arg_0, __arg_1]);
 
-  static detail_Getter(mthis) native "UIEvent_detail_Getter";
-  detail_Getter_(mthis) => detail_Getter(mthis);
+  detail_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "detail");
 
-  static initUIEvent_Callback_0(mthis) native "UIEvent_initUIEvent_Callback";
-  initUIEvent_Callback_0_(mthis) => initUIEvent_Callback_0(mthis);
+  initUIEvent_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "initUIEvent", []);
 
-  static initUIEvent_Callback_1(mthis, __arg_0) native "UIEvent_initUIEvent_Callback";
-  initUIEvent_Callback_1_(mthis, __arg_0) => initUIEvent_Callback_1(mthis, __arg_0);
+  initUIEvent_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "initUIEvent", [__arg_0]);
 
-  static initUIEvent_Callback_2(mthis, __arg_0, __arg_1) native "UIEvent_initUIEvent_Callback";
-  initUIEvent_Callback_2_(mthis, __arg_0, __arg_1) => initUIEvent_Callback_2(mthis, __arg_0, __arg_1);
+  initUIEvent_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "initUIEvent", [__arg_0, __arg_1]);
 
-  static initUIEvent_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "UIEvent_initUIEvent_Callback";
-  initUIEvent_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => initUIEvent_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  initUIEvent_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "initUIEvent", [__arg_0, __arg_1, __arg_2]);
 
-  static initUIEvent_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "UIEvent_initUIEvent_Callback";
-  initUIEvent_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => initUIEvent_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  initUIEvent_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "initUIEvent", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static initUIEvent_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "UIEvent_initUIEvent_Callback";
-  initUIEvent_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => initUIEvent_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  initUIEvent_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => Blink_JsNative_DomException.callMethod(mthis, "initUIEvent", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4]);
 
-  static initUIEvent_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "UIEvent_initUIEvent_Callback";
-  initUIEvent_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => initUIEvent_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  keyCode_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "keyCode");
 
-  static initUIEvent_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) native "UIEvent_initUIEvent_Callback";
-  initUIEvent_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => initUIEvent_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6);
+  layerX_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "layerX");
 
-  static keyCode_Getter(mthis) native "UIEvent_keyCode_Getter";
-  keyCode_Getter_(mthis) => keyCode_Getter(mthis);
+  layerY_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "layerY");
 
-  static layerX_Getter(mthis) native "UIEvent_layerX_Getter";
-  layerX_Getter_(mthis) => layerX_Getter(mthis);
+  pageX_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "pageX");
 
-  static layerY_Getter(mthis) native "UIEvent_layerY_Getter";
-  layerY_Getter_(mthis) => layerY_Getter(mthis);
+  pageY_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "pageY");
 
-  static pageX_Getter(mthis) native "UIEvent_pageX_Getter";
-  pageX_Getter_(mthis) => pageX_Getter(mthis);
+  view_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "view");
 
-  static pageY_Getter(mthis) native "UIEvent_pageY_Getter";
-  pageY_Getter_(mthis) => pageY_Getter(mthis);
-
-  static view_Getter(mthis) native "UIEvent_view_Getter";
-  view_Getter_(mthis) => view_Getter(mthis);
-
-  static which_Getter(mthis) native "UIEvent_which_Getter";
-  which_Getter_(mthis) => which_Getter(mthis);
+  which_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "which");
 
 }
 
 class BlinkURL {
   static final instance = new BlinkURL();
 
-  static constructorCallback_0() native "URL_constructorCallback";
-  constructorCallback_0_() => constructorCallback_0();
+  constructorCallback_0_() => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "URL"), []);
 
-  static constructorCallback_1(__arg_0) native "URL_constructorCallback";
-  constructorCallback_1_(__arg_0) => constructorCallback_1(__arg_0);
+  constructorCallback_1_(__arg_0) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "URL"), [__arg_0]);
 
-  static constructorCallback_2(__arg_0, __arg_1) native "URL_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  constructorCallback_2_(__arg_0, __arg_1) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "URL"), [__arg_0, __arg_1]);
 
-  static constructorCallback_3(__arg_0, __arg_1, __arg_2) native "URL_constructorCallback";
-  constructorCallback_3_(__arg_0, __arg_1, __arg_2) => constructorCallback_3(__arg_0, __arg_1, __arg_2);
+  createObjectURL_Callback_0_() => Blink_JsNative_DomException.callMethod(Blink_JsNative_DomException.getProperty(js.context, "URL"), "createObjectURL", []);
 
-  static constructorCallback_4(__arg_0, __arg_1, __arg_2, __arg_3) native "URL_constructorCallback";
-  constructorCallback_4_(__arg_0, __arg_1, __arg_2, __arg_3) => constructorCallback_4(__arg_0, __arg_1, __arg_2, __arg_3);
+  createObjectURL_Callback_1_(__arg_0) => Blink_JsNative_DomException.callMethod(Blink_JsNative_DomException.getProperty(js.context, "URL"), "createObjectURL", [__arg_0]);
 
-  static createObjectURL_Callback_0() native "URL_createObjectURL_Callback";
-  createObjectURL_Callback_0_() => createObjectURL_Callback_0();
+  hash_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "hash");
 
-  static createObjectURL_Callback_1(__arg_0) native "URL_createObjectURL_Callback";
-  createObjectURL_Callback_1_(__arg_0) => createObjectURL_Callback_1(__arg_0);
+  hash_Setter_(mthis, __arg_0) => mthis["hash"] = __arg_0;
 
-  static createObjectURL_Callback_2(__arg_0, __arg_1) native "URL_createObjectURL_Callback";
-  createObjectURL_Callback_2_(__arg_0, __arg_1) => createObjectURL_Callback_2(__arg_0, __arg_1);
+  host_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "host");
 
-  static createObjectURL_Callback_3(__arg_0, __arg_1, __arg_2) native "URL_createObjectURL_Callback";
-  createObjectURL_Callback_3_(__arg_0, __arg_1, __arg_2) => createObjectURL_Callback_3(__arg_0, __arg_1, __arg_2);
+  host_Setter_(mthis, __arg_0) => mthis["host"] = __arg_0;
 
-  static hash_Getter(mthis) native "URL_hash_Getter";
-  hash_Getter_(mthis) => hash_Getter(mthis);
+  hostname_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "hostname");
 
-  static hash_Setter(mthis, __arg_0) native "URL_hash_Setter";
-  hash_Setter_(mthis, __arg_0) => hash_Setter(mthis, __arg_0);
+  hostname_Setter_(mthis, __arg_0) => mthis["hostname"] = __arg_0;
 
-  static host_Getter(mthis) native "URL_host_Getter";
-  host_Getter_(mthis) => host_Getter(mthis);
+  href_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "href");
 
-  static host_Setter(mthis, __arg_0) native "URL_host_Setter";
-  host_Setter_(mthis, __arg_0) => host_Setter(mthis, __arg_0);
+  href_Setter_(mthis, __arg_0) => mthis["href"] = __arg_0;
 
-  static hostname_Getter(mthis) native "URL_hostname_Getter";
-  hostname_Getter_(mthis) => hostname_Getter(mthis);
+  origin_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "origin");
 
-  static hostname_Setter(mthis, __arg_0) native "URL_hostname_Setter";
-  hostname_Setter_(mthis, __arg_0) => hostname_Setter(mthis, __arg_0);
+  password_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "password");
 
-  static href_Getter(mthis) native "URL_href_Getter";
-  href_Getter_(mthis) => href_Getter(mthis);
+  password_Setter_(mthis, __arg_0) => mthis["password"] = __arg_0;
 
-  static href_Setter(mthis, __arg_0) native "URL_href_Setter";
-  href_Setter_(mthis, __arg_0) => href_Setter(mthis, __arg_0);
+  pathname_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "pathname");
 
-  static origin_Getter(mthis) native "URL_origin_Getter";
-  origin_Getter_(mthis) => origin_Getter(mthis);
+  pathname_Setter_(mthis, __arg_0) => mthis["pathname"] = __arg_0;
 
-  static password_Getter(mthis) native "URL_password_Getter";
-  password_Getter_(mthis) => password_Getter(mthis);
+  port_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "port");
 
-  static password_Setter(mthis, __arg_0) native "URL_password_Setter";
-  password_Setter_(mthis, __arg_0) => password_Setter(mthis, __arg_0);
+  port_Setter_(mthis, __arg_0) => mthis["port"] = __arg_0;
 
-  static pathname_Getter(mthis) native "URL_pathname_Getter";
-  pathname_Getter_(mthis) => pathname_Getter(mthis);
+  protocol_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "protocol");
 
-  static pathname_Setter(mthis, __arg_0) native "URL_pathname_Setter";
-  pathname_Setter_(mthis, __arg_0) => pathname_Setter(mthis, __arg_0);
+  protocol_Setter_(mthis, __arg_0) => mthis["protocol"] = __arg_0;
 
-  static port_Getter(mthis) native "URL_port_Getter";
-  port_Getter_(mthis) => port_Getter(mthis);
+  revokeObjectURL_Callback_0_() => Blink_JsNative_DomException.callMethod(Blink_JsNative_DomException.getProperty(js.context, "URL"), "revokeObjectURL", []);
 
-  static port_Setter(mthis, __arg_0) native "URL_port_Setter";
-  port_Setter_(mthis, __arg_0) => port_Setter(mthis, __arg_0);
+  revokeObjectURL_Callback_1_(__arg_0) => Blink_JsNative_DomException.callMethod(Blink_JsNative_DomException.getProperty(js.context, "URL"), "revokeObjectURL", [__arg_0]);
 
-  static protocol_Getter(mthis) native "URL_protocol_Getter";
-  protocol_Getter_(mthis) => protocol_Getter(mthis);
+  search_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "search");
 
-  static protocol_Setter(mthis, __arg_0) native "URL_protocol_Setter";
-  protocol_Setter_(mthis, __arg_0) => protocol_Setter(mthis, __arg_0);
+  search_Setter_(mthis, __arg_0) => mthis["search"] = __arg_0;
 
-  static revokeObjectURL_Callback_0() native "URL_revokeObjectURL_Callback";
-  revokeObjectURL_Callback_0_() => revokeObjectURL_Callback_0();
+  toString_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "toString", []);
 
-  static revokeObjectURL_Callback_1(__arg_0) native "URL_revokeObjectURL_Callback";
-  revokeObjectURL_Callback_1_(__arg_0) => revokeObjectURL_Callback_1(__arg_0);
+  username_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "username");
 
-  static revokeObjectURL_Callback_2(__arg_0, __arg_1) native "URL_revokeObjectURL_Callback";
-  revokeObjectURL_Callback_2_(__arg_0, __arg_1) => revokeObjectURL_Callback_2(__arg_0, __arg_1);
-
-  static revokeObjectURL_Callback_3(__arg_0, __arg_1, __arg_2) native "URL_revokeObjectURL_Callback";
-  revokeObjectURL_Callback_3_(__arg_0, __arg_1, __arg_2) => revokeObjectURL_Callback_3(__arg_0, __arg_1, __arg_2);
-
-  static search_Getter(mthis) native "URL_search_Getter";
-  search_Getter_(mthis) => search_Getter(mthis);
-
-  static search_Setter(mthis, __arg_0) native "URL_search_Setter";
-  search_Setter_(mthis, __arg_0) => search_Setter(mthis, __arg_0);
-
-  static toString_Callback_0(mthis) native "URL_toString_Callback";
-  toString_Callback_0_(mthis) => toString_Callback_0(mthis);
-
-  static toString_Callback_1(mthis, __arg_0) native "URL_toString_Callback";
-  toString_Callback_1_(mthis, __arg_0) => toString_Callback_1(mthis, __arg_0);
-
-  static toString_Callback_2(mthis, __arg_0, __arg_1) native "URL_toString_Callback";
-  toString_Callback_2_(mthis, __arg_0, __arg_1) => toString_Callback_2(mthis, __arg_0, __arg_1);
-
-  static username_Getter(mthis) native "URL_username_Getter";
-  username_Getter_(mthis) => username_Getter(mthis);
-
-  static username_Setter(mthis, __arg_0) native "URL_username_Setter";
-  username_Setter_(mthis, __arg_0) => username_Setter(mthis, __arg_0);
+  username_Setter_(mthis, __arg_0) => mthis["username"] = __arg_0;
 
 }
 
 class BlinkVTTCue extends BlinkTextTrackCue {
   static final instance = new BlinkVTTCue();
 
-  static align_Getter(mthis) native "VTTCue_align_Getter";
-  align_Getter_(mthis) => align_Getter(mthis);
+  align_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "align");
 
-  static align_Setter(mthis, __arg_0) native "VTTCue_align_Setter";
-  align_Setter_(mthis, __arg_0) => align_Setter(mthis, __arg_0);
+  align_Setter_(mthis, __arg_0) => mthis["align"] = __arg_0;
 
-  static constructorCallback_1(__arg_0) native "VTTCue_constructorCallback";
-  constructorCallback_1_(__arg_0) => constructorCallback_1(__arg_0);
+  constructorCallback_1_(__arg_0) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "VTTCue"), [__arg_0]);
 
-  static constructorCallback_2(__arg_0, __arg_1) native "VTTCue_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  constructorCallback_2_(__arg_0, __arg_1) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "VTTCue"), [__arg_0, __arg_1]);
 
-  static constructorCallback_3(__arg_0, __arg_1, __arg_2) native "VTTCue_constructorCallback";
-  constructorCallback_3_(__arg_0, __arg_1, __arg_2) => constructorCallback_3(__arg_0, __arg_1, __arg_2);
+  constructorCallback_3_(__arg_0, __arg_1, __arg_2) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "VTTCue"), [__arg_0, __arg_1, __arg_2]);
 
-  static constructorCallback_4(__arg_0, __arg_1, __arg_2, __arg_3) native "VTTCue_constructorCallback";
-  constructorCallback_4_(__arg_0, __arg_1, __arg_2, __arg_3) => constructorCallback_4(__arg_0, __arg_1, __arg_2, __arg_3);
+  getCueAsHTML_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getCueAsHTML", []);
 
-  static constructorCallback_5(__arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "VTTCue_constructorCallback";
-  constructorCallback_5_(__arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => constructorCallback_5(__arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  line_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "line");
 
-  static getCueAsHTML_Callback_0(mthis) native "VTTCue_getCueAsHTML_Callback";
-  getCueAsHTML_Callback_0_(mthis) => getCueAsHTML_Callback_0(mthis);
+  line_Setter_(mthis, __arg_0) => mthis["line"] = __arg_0;
 
-  static getCueAsHTML_Callback_1(mthis, __arg_0) native "VTTCue_getCueAsHTML_Callback";
-  getCueAsHTML_Callback_1_(mthis, __arg_0) => getCueAsHTML_Callback_1(mthis, __arg_0);
+  position_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "position");
 
-  static getCueAsHTML_Callback_2(mthis, __arg_0, __arg_1) native "VTTCue_getCueAsHTML_Callback";
-  getCueAsHTML_Callback_2_(mthis, __arg_0, __arg_1) => getCueAsHTML_Callback_2(mthis, __arg_0, __arg_1);
+  position_Setter_(mthis, __arg_0) => mthis["position"] = __arg_0;
 
-  static line_Getter(mthis) native "VTTCue_line_Getter";
-  line_Getter_(mthis) => line_Getter(mthis);
+  regionId_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "regionId");
 
-  static line_Setter(mthis, __arg_0) native "VTTCue_line_Setter";
-  line_Setter_(mthis, __arg_0) => line_Setter(mthis, __arg_0);
+  regionId_Setter_(mthis, __arg_0) => mthis["regionId"] = __arg_0;
 
-  static position_Getter(mthis) native "VTTCue_position_Getter";
-  position_Getter_(mthis) => position_Getter(mthis);
+  size_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "size");
 
-  static position_Setter(mthis, __arg_0) native "VTTCue_position_Setter";
-  position_Setter_(mthis, __arg_0) => position_Setter(mthis, __arg_0);
+  size_Setter_(mthis, __arg_0) => mthis["size"] = __arg_0;
 
-  static regionId_Getter(mthis) native "VTTCue_regionId_Getter";
-  regionId_Getter_(mthis) => regionId_Getter(mthis);
+  snapToLines_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "snapToLines");
 
-  static regionId_Setter(mthis, __arg_0) native "VTTCue_regionId_Setter";
-  regionId_Setter_(mthis, __arg_0) => regionId_Setter(mthis, __arg_0);
+  snapToLines_Setter_(mthis, __arg_0) => mthis["snapToLines"] = __arg_0;
 
-  static size_Getter(mthis) native "VTTCue_size_Getter";
-  size_Getter_(mthis) => size_Getter(mthis);
+  text_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "text");
 
-  static size_Setter(mthis, __arg_0) native "VTTCue_size_Setter";
-  size_Setter_(mthis, __arg_0) => size_Setter(mthis, __arg_0);
+  text_Setter_(mthis, __arg_0) => mthis["text"] = __arg_0;
 
-  static snapToLines_Getter(mthis) native "VTTCue_snapToLines_Getter";
-  snapToLines_Getter_(mthis) => snapToLines_Getter(mthis);
+  vertical_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "vertical");
 
-  static snapToLines_Setter(mthis, __arg_0) native "VTTCue_snapToLines_Setter";
-  snapToLines_Setter_(mthis, __arg_0) => snapToLines_Setter(mthis, __arg_0);
-
-  static text_Getter(mthis) native "VTTCue_text_Getter";
-  text_Getter_(mthis) => text_Getter(mthis);
-
-  static text_Setter(mthis, __arg_0) native "VTTCue_text_Setter";
-  text_Setter_(mthis, __arg_0) => text_Setter(mthis, __arg_0);
-
-  static vertical_Getter(mthis) native "VTTCue_vertical_Getter";
-  vertical_Getter_(mthis) => vertical_Getter(mthis);
-
-  static vertical_Setter(mthis, __arg_0) native "VTTCue_vertical_Setter";
-  vertical_Setter_(mthis, __arg_0) => vertical_Setter(mthis, __arg_0);
+  vertical_Setter_(mthis, __arg_0) => mthis["vertical"] = __arg_0;
 
 }
 
 class BlinkVTTRegion {
   static final instance = new BlinkVTTRegion();
 
-  static constructorCallback_0() native "VTTRegion_constructorCallback";
-  constructorCallback_0_() => constructorCallback_0();
+  constructorCallback_0_() => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "VTTRegion"), []);
 
-  static constructorCallback_1(__arg_0) native "VTTRegion_constructorCallback";
-  constructorCallback_1_(__arg_0) => constructorCallback_1(__arg_0);
+  height_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "height");
 
-  static constructorCallback_2(__arg_0, __arg_1) native "VTTRegion_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  height_Setter_(mthis, __arg_0) => mthis["height"] = __arg_0;
 
-  static height_Getter(mthis) native "VTTRegion_height_Getter";
-  height_Getter_(mthis) => height_Getter(mthis);
+  id_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "id");
 
-  static height_Setter(mthis, __arg_0) native "VTTRegion_height_Setter";
-  height_Setter_(mthis, __arg_0) => height_Setter(mthis, __arg_0);
+  id_Setter_(mthis, __arg_0) => mthis["id"] = __arg_0;
 
-  static id_Getter(mthis) native "VTTRegion_id_Getter";
-  id_Getter_(mthis) => id_Getter(mthis);
+  regionAnchorX_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "regionAnchorX");
 
-  static id_Setter(mthis, __arg_0) native "VTTRegion_id_Setter";
-  id_Setter_(mthis, __arg_0) => id_Setter(mthis, __arg_0);
+  regionAnchorX_Setter_(mthis, __arg_0) => mthis["regionAnchorX"] = __arg_0;
 
-  static regionAnchorX_Getter(mthis) native "VTTRegion_regionAnchorX_Getter";
-  regionAnchorX_Getter_(mthis) => regionAnchorX_Getter(mthis);
+  regionAnchorY_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "regionAnchorY");
 
-  static regionAnchorX_Setter(mthis, __arg_0) native "VTTRegion_regionAnchorX_Setter";
-  regionAnchorX_Setter_(mthis, __arg_0) => regionAnchorX_Setter(mthis, __arg_0);
+  regionAnchorY_Setter_(mthis, __arg_0) => mthis["regionAnchorY"] = __arg_0;
 
-  static regionAnchorY_Getter(mthis) native "VTTRegion_regionAnchorY_Getter";
-  regionAnchorY_Getter_(mthis) => regionAnchorY_Getter(mthis);
+  scroll_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "scroll");
 
-  static regionAnchorY_Setter(mthis, __arg_0) native "VTTRegion_regionAnchorY_Setter";
-  regionAnchorY_Setter_(mthis, __arg_0) => regionAnchorY_Setter(mthis, __arg_0);
+  scroll_Setter_(mthis, __arg_0) => mthis["scroll"] = __arg_0;
 
-  static scroll_Getter(mthis) native "VTTRegion_scroll_Getter";
-  scroll_Getter_(mthis) => scroll_Getter(mthis);
+  track_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "track");
 
-  static scroll_Setter(mthis, __arg_0) native "VTTRegion_scroll_Setter";
-  scroll_Setter_(mthis, __arg_0) => scroll_Setter(mthis, __arg_0);
+  viewportAnchorX_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "viewportAnchorX");
 
-  static track_Getter(mthis) native "VTTRegion_track_Getter";
-  track_Getter_(mthis) => track_Getter(mthis);
+  viewportAnchorX_Setter_(mthis, __arg_0) => mthis["viewportAnchorX"] = __arg_0;
 
-  static viewportAnchorX_Getter(mthis) native "VTTRegion_viewportAnchorX_Getter";
-  viewportAnchorX_Getter_(mthis) => viewportAnchorX_Getter(mthis);
+  viewportAnchorY_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "viewportAnchorY");
 
-  static viewportAnchorX_Setter(mthis, __arg_0) native "VTTRegion_viewportAnchorX_Setter";
-  viewportAnchorX_Setter_(mthis, __arg_0) => viewportAnchorX_Setter(mthis, __arg_0);
+  viewportAnchorY_Setter_(mthis, __arg_0) => mthis["viewportAnchorY"] = __arg_0;
 
-  static viewportAnchorY_Getter(mthis) native "VTTRegion_viewportAnchorY_Getter";
-  viewportAnchorY_Getter_(mthis) => viewportAnchorY_Getter(mthis);
+  width_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "width");
 
-  static viewportAnchorY_Setter(mthis, __arg_0) native "VTTRegion_viewportAnchorY_Setter";
-  viewportAnchorY_Setter_(mthis, __arg_0) => viewportAnchorY_Setter(mthis, __arg_0);
-
-  static width_Getter(mthis) native "VTTRegion_width_Getter";
-  width_Getter_(mthis) => width_Getter(mthis);
-
-  static width_Setter(mthis, __arg_0) native "VTTRegion_width_Setter";
-  width_Setter_(mthis, __arg_0) => width_Setter(mthis, __arg_0);
+  width_Setter_(mthis, __arg_0) => mthis["width"] = __arg_0;
 
 }
 
 class BlinkVTTRegionList {
   static final instance = new BlinkVTTRegionList();
 
-  static $__getter___Callback_1(mthis, __arg_0) native "VTTRegionList___getter___Callback";
-  $__getter___Callback_1_(mthis, __arg_0) => $__getter___Callback_1(mthis, __arg_0);
+  $__getter___Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "__getter__", [__arg_0]);
 
-  static getRegionById_Callback_0(mthis) native "VTTRegionList_getRegionById_Callback";
-  getRegionById_Callback_0_(mthis) => getRegionById_Callback_0(mthis);
+  getRegionById_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getRegionById", []);
 
-  static getRegionById_Callback_1(mthis, __arg_0) native "VTTRegionList_getRegionById_Callback";
-  getRegionById_Callback_1_(mthis, __arg_0) => getRegionById_Callback_1(mthis, __arg_0);
+  getRegionById_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getRegionById", [__arg_0]);
 
-  static getRegionById_Callback_2(mthis, __arg_0, __arg_1) native "VTTRegionList_getRegionById_Callback";
-  getRegionById_Callback_2_(mthis, __arg_0, __arg_1) => getRegionById_Callback_2(mthis, __arg_0, __arg_1);
+  item_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "item", []);
 
-  static getRegionById_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "VTTRegionList_getRegionById_Callback";
-  getRegionById_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getRegionById_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  item_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "item", [__arg_0]);
 
-  static item_Callback_0(mthis) native "VTTRegionList_item_Callback";
-  item_Callback_0_(mthis) => item_Callback_0(mthis);
-
-  static item_Callback_1(mthis, __arg_0) native "VTTRegionList_item_Callback";
-  item_Callback_1_(mthis, __arg_0) => item_Callback_1(mthis, __arg_0);
-
-  static item_Callback_2(mthis, __arg_0, __arg_1) native "VTTRegionList_item_Callback";
-  item_Callback_2_(mthis, __arg_0, __arg_1) => item_Callback_2(mthis, __arg_0, __arg_1);
-
-  static item_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "VTTRegionList_item_Callback";
-  item_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => item_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static length_Getter(mthis) native "VTTRegionList_length_Getter";
-  length_Getter_(mthis) => length_Getter(mthis);
+  length_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "length");
 
 }
 
 class BlinkValidityState {
   static final instance = new BlinkValidityState();
 
-  static badInput_Getter(mthis) native "ValidityState_badInput_Getter";
-  badInput_Getter_(mthis) => badInput_Getter(mthis);
+  badInput_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "badInput");
 
-  static customError_Getter(mthis) native "ValidityState_customError_Getter";
-  customError_Getter_(mthis) => customError_Getter(mthis);
+  customError_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "customError");
 
-  static patternMismatch_Getter(mthis) native "ValidityState_patternMismatch_Getter";
-  patternMismatch_Getter_(mthis) => patternMismatch_Getter(mthis);
+  patternMismatch_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "patternMismatch");
 
-  static rangeOverflow_Getter(mthis) native "ValidityState_rangeOverflow_Getter";
-  rangeOverflow_Getter_(mthis) => rangeOverflow_Getter(mthis);
+  rangeOverflow_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "rangeOverflow");
 
-  static rangeUnderflow_Getter(mthis) native "ValidityState_rangeUnderflow_Getter";
-  rangeUnderflow_Getter_(mthis) => rangeUnderflow_Getter(mthis);
+  rangeUnderflow_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "rangeUnderflow");
 
-  static stepMismatch_Getter(mthis) native "ValidityState_stepMismatch_Getter";
-  stepMismatch_Getter_(mthis) => stepMismatch_Getter(mthis);
+  stepMismatch_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "stepMismatch");
 
-  static tooLong_Getter(mthis) native "ValidityState_tooLong_Getter";
-  tooLong_Getter_(mthis) => tooLong_Getter(mthis);
+  tooLong_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "tooLong");
 
-  static typeMismatch_Getter(mthis) native "ValidityState_typeMismatch_Getter";
-  typeMismatch_Getter_(mthis) => typeMismatch_Getter(mthis);
+  typeMismatch_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "typeMismatch");
 
-  static valid_Getter(mthis) native "ValidityState_valid_Getter";
-  valid_Getter_(mthis) => valid_Getter(mthis);
+  valid_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "valid");
 
-  static valueMissing_Getter(mthis) native "ValidityState_valueMissing_Getter";
-  valueMissing_Getter_(mthis) => valueMissing_Getter(mthis);
+  valueMissing_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "valueMissing");
 
 }
 
 class BlinkVideoPlaybackQuality {
   static final instance = new BlinkVideoPlaybackQuality();
 
-  static corruptedVideoFrames_Getter(mthis) native "VideoPlaybackQuality_corruptedVideoFrames_Getter";
-  corruptedVideoFrames_Getter_(mthis) => corruptedVideoFrames_Getter(mthis);
+  corruptedVideoFrames_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "corruptedVideoFrames");
 
-  static creationTime_Getter(mthis) native "VideoPlaybackQuality_creationTime_Getter";
-  creationTime_Getter_(mthis) => creationTime_Getter(mthis);
+  creationTime_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "creationTime");
 
-  static droppedVideoFrames_Getter(mthis) native "VideoPlaybackQuality_droppedVideoFrames_Getter";
-  droppedVideoFrames_Getter_(mthis) => droppedVideoFrames_Getter(mthis);
+  droppedVideoFrames_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "droppedVideoFrames");
 
-  static totalVideoFrames_Getter(mthis) native "VideoPlaybackQuality_totalVideoFrames_Getter";
-  totalVideoFrames_Getter_(mthis) => totalVideoFrames_Getter(mthis);
+  totalVideoFrames_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "totalVideoFrames");
 
 }
 
 class BlinkVideoTrack {
   static final instance = new BlinkVideoTrack();
 
-  static id_Getter(mthis) native "VideoTrack_id_Getter";
-  id_Getter_(mthis) => id_Getter(mthis);
+  id_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "id");
 
-  static kind_Getter(mthis) native "VideoTrack_kind_Getter";
-  kind_Getter_(mthis) => kind_Getter(mthis);
+  kind_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "kind");
 
-  static label_Getter(mthis) native "VideoTrack_label_Getter";
-  label_Getter_(mthis) => label_Getter(mthis);
+  label_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "label");
 
-  static language_Getter(mthis) native "VideoTrack_language_Getter";
-  language_Getter_(mthis) => language_Getter(mthis);
+  language_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "language");
 
-  static selected_Getter(mthis) native "VideoTrack_selected_Getter";
-  selected_Getter_(mthis) => selected_Getter(mthis);
+  selected_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "selected");
 
-  static selected_Setter(mthis, __arg_0) native "VideoTrack_selected_Setter";
-  selected_Setter_(mthis, __arg_0) => selected_Setter(mthis, __arg_0);
+  selected_Setter_(mthis, __arg_0) => mthis["selected"] = __arg_0;
 
 }
 
 class BlinkVideoTrackList extends BlinkEventTarget {
   static final instance = new BlinkVideoTrackList();
 
-  static $__getter___Callback_1(mthis, __arg_0) native "VideoTrackList___getter___Callback";
-  $__getter___Callback_1_(mthis, __arg_0) => $__getter___Callback_1(mthis, __arg_0);
+  $__getter___Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "__getter__", [__arg_0]);
 
-  static getTrackById_Callback_0(mthis) native "VideoTrackList_getTrackById_Callback";
-  getTrackById_Callback_0_(mthis) => getTrackById_Callback_0(mthis);
+  getTrackById_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getTrackById", []);
 
-  static getTrackById_Callback_1(mthis, __arg_0) native "VideoTrackList_getTrackById_Callback";
-  getTrackById_Callback_1_(mthis, __arg_0) => getTrackById_Callback_1(mthis, __arg_0);
+  getTrackById_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getTrackById", [__arg_0]);
 
-  static getTrackById_Callback_2(mthis, __arg_0, __arg_1) native "VideoTrackList_getTrackById_Callback";
-  getTrackById_Callback_2_(mthis, __arg_0, __arg_1) => getTrackById_Callback_2(mthis, __arg_0, __arg_1);
+  length_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "length");
 
-  static getTrackById_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "VideoTrackList_getTrackById_Callback";
-  getTrackById_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getTrackById_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  onaddtrack_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onaddtrack");
 
-  static length_Getter(mthis) native "VideoTrackList_length_Getter";
-  length_Getter_(mthis) => length_Getter(mthis);
+  onaddtrack_Setter_(mthis, __arg_0) => mthis["onaddtrack"] = __arg_0;
 
-  static onaddtrack_Getter(mthis) native "VideoTrackList_onaddtrack_Getter";
-  onaddtrack_Getter_(mthis) => onaddtrack_Getter(mthis);
+  onchange_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onchange");
 
-  static onaddtrack_Setter(mthis, __arg_0) native "VideoTrackList_onaddtrack_Setter";
-  onaddtrack_Setter_(mthis, __arg_0) => onaddtrack_Setter(mthis, __arg_0);
+  onchange_Setter_(mthis, __arg_0) => mthis["onchange"] = __arg_0;
 
-  static onchange_Getter(mthis) native "VideoTrackList_onchange_Getter";
-  onchange_Getter_(mthis) => onchange_Getter(mthis);
+  onremovetrack_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onremovetrack");
 
-  static onchange_Setter(mthis, __arg_0) native "VideoTrackList_onchange_Setter";
-  onchange_Setter_(mthis, __arg_0) => onchange_Setter(mthis, __arg_0);
+  onremovetrack_Setter_(mthis, __arg_0) => mthis["onremovetrack"] = __arg_0;
 
-  static onremovetrack_Getter(mthis) native "VideoTrackList_onremovetrack_Getter";
-  onremovetrack_Getter_(mthis) => onremovetrack_Getter(mthis);
-
-  static onremovetrack_Setter(mthis, __arg_0) native "VideoTrackList_onremovetrack_Setter";
-  onremovetrack_Setter_(mthis, __arg_0) => onremovetrack_Setter(mthis, __arg_0);
-
-  static selectedIndex_Getter(mthis) native "VideoTrackList_selectedIndex_Getter";
-  selectedIndex_Getter_(mthis) => selectedIndex_Getter(mthis);
+  selectedIndex_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "selectedIndex");
 
 }
 
 class BlinkWaveShaperNode extends BlinkAudioNode {
   static final instance = new BlinkWaveShaperNode();
 
-  static curve_Getter(mthis) native "WaveShaperNode_curve_Getter";
-  curve_Getter_(mthis) => curve_Getter(mthis);
+  curve_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "curve");
 
-  static curve_Setter(mthis, __arg_0) native "WaveShaperNode_curve_Setter";
-  curve_Setter_(mthis, __arg_0) => curve_Setter(mthis, __arg_0);
+  curve_Setter_(mthis, __arg_0) => mthis["curve"] = __arg_0;
 
-  static oversample_Getter(mthis) native "WaveShaperNode_oversample_Getter";
-  oversample_Getter_(mthis) => oversample_Getter(mthis);
+  oversample_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "oversample");
 
-  static oversample_Setter(mthis, __arg_0) native "WaveShaperNode_oversample_Setter";
-  oversample_Setter_(mthis, __arg_0) => oversample_Setter(mthis, __arg_0);
+  oversample_Setter_(mthis, __arg_0) => mthis["oversample"] = __arg_0;
 
 }
 
 class BlinkWebGLActiveInfo {
   static final instance = new BlinkWebGLActiveInfo();
 
-  static name_Getter(mthis) native "WebGLActiveInfo_name_Getter";
-  name_Getter_(mthis) => name_Getter(mthis);
+  name_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "name");
 
-  static size_Getter(mthis) native "WebGLActiveInfo_size_Getter";
-  size_Getter_(mthis) => size_Getter(mthis);
+  size_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "size");
 
-  static type_Getter(mthis) native "WebGLActiveInfo_type_Getter";
-  type_Getter_(mthis) => type_Getter(mthis);
+  type_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "type");
 
 }
 
@@ -26861,58 +14935,42 @@
 class BlinkWebGLContextAttributes {
   static final instance = new BlinkWebGLContextAttributes();
 
-  static alpha_Getter(mthis) native "WebGLContextAttributes_alpha_Getter";
-  alpha_Getter_(mthis) => alpha_Getter(mthis);
+  alpha_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "alpha");
 
-  static alpha_Setter(mthis, __arg_0) native "WebGLContextAttributes_alpha_Setter";
-  alpha_Setter_(mthis, __arg_0) => alpha_Setter(mthis, __arg_0);
+  alpha_Setter_(mthis, __arg_0) => mthis["alpha"] = __arg_0;
 
-  static antialias_Getter(mthis) native "WebGLContextAttributes_antialias_Getter";
-  antialias_Getter_(mthis) => antialias_Getter(mthis);
+  antialias_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "antialias");
 
-  static antialias_Setter(mthis, __arg_0) native "WebGLContextAttributes_antialias_Setter";
-  antialias_Setter_(mthis, __arg_0) => antialias_Setter(mthis, __arg_0);
+  antialias_Setter_(mthis, __arg_0) => mthis["antialias"] = __arg_0;
 
-  static depth_Getter(mthis) native "WebGLContextAttributes_depth_Getter";
-  depth_Getter_(mthis) => depth_Getter(mthis);
+  depth_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "depth");
 
-  static depth_Setter(mthis, __arg_0) native "WebGLContextAttributes_depth_Setter";
-  depth_Setter_(mthis, __arg_0) => depth_Setter(mthis, __arg_0);
+  depth_Setter_(mthis, __arg_0) => mthis["depth"] = __arg_0;
 
-  static failIfMajorPerformanceCaveat_Getter(mthis) native "WebGLContextAttributes_failIfMajorPerformanceCaveat_Getter";
-  failIfMajorPerformanceCaveat_Getter_(mthis) => failIfMajorPerformanceCaveat_Getter(mthis);
+  failIfMajorPerformanceCaveat_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "failIfMajorPerformanceCaveat");
 
-  static failIfMajorPerformanceCaveat_Setter(mthis, __arg_0) native "WebGLContextAttributes_failIfMajorPerformanceCaveat_Setter";
-  failIfMajorPerformanceCaveat_Setter_(mthis, __arg_0) => failIfMajorPerformanceCaveat_Setter(mthis, __arg_0);
+  failIfMajorPerformanceCaveat_Setter_(mthis, __arg_0) => mthis["failIfMajorPerformanceCaveat"] = __arg_0;
 
-  static premultipliedAlpha_Getter(mthis) native "WebGLContextAttributes_premultipliedAlpha_Getter";
-  premultipliedAlpha_Getter_(mthis) => premultipliedAlpha_Getter(mthis);
+  premultipliedAlpha_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "premultipliedAlpha");
 
-  static premultipliedAlpha_Setter(mthis, __arg_0) native "WebGLContextAttributes_premultipliedAlpha_Setter";
-  premultipliedAlpha_Setter_(mthis, __arg_0) => premultipliedAlpha_Setter(mthis, __arg_0);
+  premultipliedAlpha_Setter_(mthis, __arg_0) => mthis["premultipliedAlpha"] = __arg_0;
 
-  static preserveDrawingBuffer_Getter(mthis) native "WebGLContextAttributes_preserveDrawingBuffer_Getter";
-  preserveDrawingBuffer_Getter_(mthis) => preserveDrawingBuffer_Getter(mthis);
+  preserveDrawingBuffer_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "preserveDrawingBuffer");
 
-  static preserveDrawingBuffer_Setter(mthis, __arg_0) native "WebGLContextAttributes_preserveDrawingBuffer_Setter";
-  preserveDrawingBuffer_Setter_(mthis, __arg_0) => preserveDrawingBuffer_Setter(mthis, __arg_0);
+  preserveDrawingBuffer_Setter_(mthis, __arg_0) => mthis["preserveDrawingBuffer"] = __arg_0;
 
-  static stencil_Getter(mthis) native "WebGLContextAttributes_stencil_Getter";
-  stencil_Getter_(mthis) => stencil_Getter(mthis);
+  stencil_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "stencil");
 
-  static stencil_Setter(mthis, __arg_0) native "WebGLContextAttributes_stencil_Setter";
-  stencil_Setter_(mthis, __arg_0) => stencil_Setter(mthis, __arg_0);
+  stencil_Setter_(mthis, __arg_0) => mthis["stencil"] = __arg_0;
 
 }
 
 class BlinkWebGLContextEvent extends BlinkEvent {
   static final instance = new BlinkWebGLContextEvent();
 
-  static constructorCallback_2(__arg_0, __arg_1) native "WebGLContextEvent_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  constructorCallback_2_(__arg_0, __arg_1) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "WebGLContextEvent"), [__arg_0, __arg_1]);
 
-  static statusMessage_Getter(mthis) native "WebGLContextEvent_statusMessage_Getter";
-  statusMessage_Getter_(mthis) => statusMessage_Getter(mthis);
+  statusMessage_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "statusMessage");
 
 }
 
@@ -26924,17 +14982,9 @@
 class BlinkWebGLDebugShaders {
   static final instance = new BlinkWebGLDebugShaders();
 
-  static getTranslatedShaderSource_Callback_0(mthis) native "WebGLDebugShaders_getTranslatedShaderSource_Callback";
-  getTranslatedShaderSource_Callback_0_(mthis) => getTranslatedShaderSource_Callback_0(mthis);
+  getTranslatedShaderSource_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getTranslatedShaderSource", []);
 
-  static getTranslatedShaderSource_Callback_1(mthis, __arg_0) native "WebGLDebugShaders_getTranslatedShaderSource_Callback";
-  getTranslatedShaderSource_Callback_1_(mthis, __arg_0) => getTranslatedShaderSource_Callback_1(mthis, __arg_0);
-
-  static getTranslatedShaderSource_Callback_2(mthis, __arg_0, __arg_1) native "WebGLDebugShaders_getTranslatedShaderSource_Callback";
-  getTranslatedShaderSource_Callback_2_(mthis, __arg_0, __arg_1) => getTranslatedShaderSource_Callback_2(mthis, __arg_0, __arg_1);
-
-  static getTranslatedShaderSource_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLDebugShaders_getTranslatedShaderSource_Callback";
-  getTranslatedShaderSource_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getTranslatedShaderSource_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  getTranslatedShaderSource_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getTranslatedShaderSource", [__arg_0]);
 
 }
 
@@ -26946,17 +14996,9 @@
 class BlinkWebGLDrawBuffers {
   static final instance = new BlinkWebGLDrawBuffers();
 
-  static drawBuffersWEBGL_Callback_0(mthis) native "WebGLDrawBuffers_drawBuffersWEBGL_Callback";
-  drawBuffersWEBGL_Callback_0_(mthis) => drawBuffersWEBGL_Callback_0(mthis);
+  drawBuffersWEBGL_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "drawBuffersWEBGL", []);
 
-  static drawBuffersWEBGL_Callback_1(mthis, __arg_0) native "WebGLDrawBuffers_drawBuffersWEBGL_Callback";
-  drawBuffersWEBGL_Callback_1_(mthis, __arg_0) => drawBuffersWEBGL_Callback_1(mthis, __arg_0);
-
-  static drawBuffersWEBGL_Callback_2(mthis, __arg_0, __arg_1) native "WebGLDrawBuffers_drawBuffersWEBGL_Callback";
-  drawBuffersWEBGL_Callback_2_(mthis, __arg_0, __arg_1) => drawBuffersWEBGL_Callback_2(mthis, __arg_0, __arg_1);
-
-  static drawBuffersWEBGL_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLDrawBuffers_drawBuffersWEBGL_Callback";
-  drawBuffersWEBGL_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => drawBuffersWEBGL_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  drawBuffersWEBGL_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "drawBuffersWEBGL", [__arg_0]);
 
 }
 
@@ -26968,23 +15010,9 @@
 class BlinkWebGLLoseContext {
   static final instance = new BlinkWebGLLoseContext();
 
-  static loseContext_Callback_0(mthis) native "WebGLLoseContext_loseContext_Callback";
-  loseContext_Callback_0_(mthis) => loseContext_Callback_0(mthis);
+  loseContext_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "loseContext", []);
 
-  static loseContext_Callback_1(mthis, __arg_0) native "WebGLLoseContext_loseContext_Callback";
-  loseContext_Callback_1_(mthis, __arg_0) => loseContext_Callback_1(mthis, __arg_0);
-
-  static loseContext_Callback_2(mthis, __arg_0, __arg_1) native "WebGLLoseContext_loseContext_Callback";
-  loseContext_Callback_2_(mthis, __arg_0, __arg_1) => loseContext_Callback_2(mthis, __arg_0, __arg_1);
-
-  static restoreContext_Callback_0(mthis) native "WebGLLoseContext_restoreContext_Callback";
-  restoreContext_Callback_0_(mthis) => restoreContext_Callback_0(mthis);
-
-  static restoreContext_Callback_1(mthis, __arg_0) native "WebGLLoseContext_restoreContext_Callback";
-  restoreContext_Callback_1_(mthis, __arg_0) => restoreContext_Callback_1(mthis, __arg_0);
-
-  static restoreContext_Callback_2(mthis, __arg_0, __arg_1) native "WebGLLoseContext_restoreContext_Callback";
-  restoreContext_Callback_2_(mthis, __arg_0, __arg_1) => restoreContext_Callback_2(mthis, __arg_0, __arg_1);
+  restoreContext_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "restoreContext", []);
 
 }
 
@@ -27001,1880 +15029,711 @@
 class BlinkWebGLRenderingContext {
   static final instance = new BlinkWebGLRenderingContext();
 
-  static activeTexture_Callback_0(mthis) native "WebGLRenderingContext_activeTexture_Callback";
-  activeTexture_Callback_0_(mthis) => activeTexture_Callback_0(mthis);
+  activeTexture_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "activeTexture", []);
 
-  static activeTexture_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_activeTexture_Callback";
-  activeTexture_Callback_1_(mthis, __arg_0) => activeTexture_Callback_1(mthis, __arg_0);
+  activeTexture_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "activeTexture", [__arg_0]);
 
-  static activeTexture_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_activeTexture_Callback";
-  activeTexture_Callback_2_(mthis, __arg_0, __arg_1) => activeTexture_Callback_2(mthis, __arg_0, __arg_1);
+  attachShader_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "attachShader", []);
 
-  static activeTexture_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_activeTexture_Callback";
-  activeTexture_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => activeTexture_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  attachShader_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "attachShader", [__arg_0]);
 
-  static attachShader_Callback_0(mthis) native "WebGLRenderingContext_attachShader_Callback";
-  attachShader_Callback_0_(mthis) => attachShader_Callback_0(mthis);
+  attachShader_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "attachShader", [__arg_0, __arg_1]);
 
-  static attachShader_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_attachShader_Callback";
-  attachShader_Callback_1_(mthis, __arg_0) => attachShader_Callback_1(mthis, __arg_0);
+  bindAttribLocation_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "bindAttribLocation", [__arg_0]);
 
-  static attachShader_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_attachShader_Callback";
-  attachShader_Callback_2_(mthis, __arg_0, __arg_1) => attachShader_Callback_2(mthis, __arg_0, __arg_1);
+  bindAttribLocation_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "bindAttribLocation", [__arg_0, __arg_1]);
 
-  static attachShader_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_attachShader_Callback";
-  attachShader_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => attachShader_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  bindAttribLocation_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "bindAttribLocation", [__arg_0, __arg_1, __arg_2]);
 
-  static attachShader_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_attachShader_Callback";
-  attachShader_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => attachShader_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  bindBuffer_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "bindBuffer", []);
 
-  static bindAttribLocation_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_bindAttribLocation_Callback";
-  bindAttribLocation_Callback_1_(mthis, __arg_0) => bindAttribLocation_Callback_1(mthis, __arg_0);
+  bindBuffer_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "bindBuffer", [__arg_0]);
 
-  static bindAttribLocation_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_bindAttribLocation_Callback";
-  bindAttribLocation_Callback_2_(mthis, __arg_0, __arg_1) => bindAttribLocation_Callback_2(mthis, __arg_0, __arg_1);
+  bindBuffer_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "bindBuffer", [__arg_0, __arg_1]);
 
-  static bindAttribLocation_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_bindAttribLocation_Callback";
-  bindAttribLocation_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => bindAttribLocation_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  bindFramebuffer_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "bindFramebuffer", []);
 
-  static bindAttribLocation_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_bindAttribLocation_Callback";
-  bindAttribLocation_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => bindAttribLocation_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  bindFramebuffer_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "bindFramebuffer", [__arg_0]);
 
-  static bindAttribLocation_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "WebGLRenderingContext_bindAttribLocation_Callback";
-  bindAttribLocation_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => bindAttribLocation_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  bindFramebuffer_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "bindFramebuffer", [__arg_0, __arg_1]);
 
-  static bindBuffer_Callback_0(mthis) native "WebGLRenderingContext_bindBuffer_Callback";
-  bindBuffer_Callback_0_(mthis) => bindBuffer_Callback_0(mthis);
+  bindRenderbuffer_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "bindRenderbuffer", []);
 
-  static bindBuffer_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_bindBuffer_Callback";
-  bindBuffer_Callback_1_(mthis, __arg_0) => bindBuffer_Callback_1(mthis, __arg_0);
+  bindRenderbuffer_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "bindRenderbuffer", [__arg_0]);
 
-  static bindBuffer_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_bindBuffer_Callback";
-  bindBuffer_Callback_2_(mthis, __arg_0, __arg_1) => bindBuffer_Callback_2(mthis, __arg_0, __arg_1);
+  bindRenderbuffer_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "bindRenderbuffer", [__arg_0, __arg_1]);
 
-  static bindBuffer_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_bindBuffer_Callback";
-  bindBuffer_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => bindBuffer_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  bindTexture_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "bindTexture", []);
 
-  static bindBuffer_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_bindBuffer_Callback";
-  bindBuffer_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => bindBuffer_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  bindTexture_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "bindTexture", [__arg_0]);
 
-  static bindFramebuffer_Callback_0(mthis) native "WebGLRenderingContext_bindFramebuffer_Callback";
-  bindFramebuffer_Callback_0_(mthis) => bindFramebuffer_Callback_0(mthis);
+  bindTexture_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "bindTexture", [__arg_0, __arg_1]);
 
-  static bindFramebuffer_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_bindFramebuffer_Callback";
-  bindFramebuffer_Callback_1_(mthis, __arg_0) => bindFramebuffer_Callback_1(mthis, __arg_0);
+  blendColor_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "blendColor", [__arg_0, __arg_1]);
 
-  static bindFramebuffer_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_bindFramebuffer_Callback";
-  bindFramebuffer_Callback_2_(mthis, __arg_0, __arg_1) => bindFramebuffer_Callback_2(mthis, __arg_0, __arg_1);
+  blendColor_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "blendColor", [__arg_0, __arg_1, __arg_2]);
 
-  static bindFramebuffer_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_bindFramebuffer_Callback";
-  bindFramebuffer_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => bindFramebuffer_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  blendColor_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "blendColor", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static bindFramebuffer_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_bindFramebuffer_Callback";
-  bindFramebuffer_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => bindFramebuffer_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  blendEquationSeparate_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "blendEquationSeparate", []);
 
-  static bindRenderbuffer_Callback_0(mthis) native "WebGLRenderingContext_bindRenderbuffer_Callback";
-  bindRenderbuffer_Callback_0_(mthis) => bindRenderbuffer_Callback_0(mthis);
+  blendEquationSeparate_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "blendEquationSeparate", [__arg_0]);
 
-  static bindRenderbuffer_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_bindRenderbuffer_Callback";
-  bindRenderbuffer_Callback_1_(mthis, __arg_0) => bindRenderbuffer_Callback_1(mthis, __arg_0);
+  blendEquationSeparate_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "blendEquationSeparate", [__arg_0, __arg_1]);
 
-  static bindRenderbuffer_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_bindRenderbuffer_Callback";
-  bindRenderbuffer_Callback_2_(mthis, __arg_0, __arg_1) => bindRenderbuffer_Callback_2(mthis, __arg_0, __arg_1);
+  blendEquation_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "blendEquation", []);
 
-  static bindRenderbuffer_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_bindRenderbuffer_Callback";
-  bindRenderbuffer_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => bindRenderbuffer_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  blendEquation_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "blendEquation", [__arg_0]);
 
-  static bindRenderbuffer_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_bindRenderbuffer_Callback";
-  bindRenderbuffer_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => bindRenderbuffer_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  blendFuncSeparate_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "blendFuncSeparate", [__arg_0, __arg_1]);
 
-  static bindTexture_Callback_0(mthis) native "WebGLRenderingContext_bindTexture_Callback";
-  bindTexture_Callback_0_(mthis) => bindTexture_Callback_0(mthis);
+  blendFuncSeparate_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "blendFuncSeparate", [__arg_0, __arg_1, __arg_2]);
 
-  static bindTexture_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_bindTexture_Callback";
-  bindTexture_Callback_1_(mthis, __arg_0) => bindTexture_Callback_1(mthis, __arg_0);
+  blendFuncSeparate_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "blendFuncSeparate", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static bindTexture_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_bindTexture_Callback";
-  bindTexture_Callback_2_(mthis, __arg_0, __arg_1) => bindTexture_Callback_2(mthis, __arg_0, __arg_1);
+  blendFunc_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "blendFunc", []);
 
-  static bindTexture_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_bindTexture_Callback";
-  bindTexture_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => bindTexture_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  blendFunc_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "blendFunc", [__arg_0]);
 
-  static bindTexture_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_bindTexture_Callback";
-  bindTexture_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => bindTexture_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  blendFunc_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "blendFunc", [__arg_0, __arg_1]);
 
-  static blendColor_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_blendColor_Callback";
-  blendColor_Callback_2_(mthis, __arg_0, __arg_1) => blendColor_Callback_2(mthis, __arg_0, __arg_1);
+  bufferData_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "bufferData", [__arg_0]);
 
-  static blendColor_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_blendColor_Callback";
-  blendColor_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => blendColor_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  bufferData_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "bufferData", [__arg_0, __arg_1]);
 
-  static blendColor_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_blendColor_Callback";
-  blendColor_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => blendColor_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  bufferData_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "bufferData", [__arg_0, __arg_1, __arg_2]);
 
-  static blendColor_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "WebGLRenderingContext_blendColor_Callback";
-  blendColor_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => blendColor_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  bufferSubData_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "bufferSubData", [__arg_0]);
 
-  static blendColor_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "WebGLRenderingContext_blendColor_Callback";
-  blendColor_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => blendColor_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  bufferSubData_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "bufferSubData", [__arg_0, __arg_1]);
 
-  static blendEquationSeparate_Callback_0(mthis) native "WebGLRenderingContext_blendEquationSeparate_Callback";
-  blendEquationSeparate_Callback_0_(mthis) => blendEquationSeparate_Callback_0(mthis);
+  bufferSubData_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "bufferSubData", [__arg_0, __arg_1, __arg_2]);
 
-  static blendEquationSeparate_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_blendEquationSeparate_Callback";
-  blendEquationSeparate_Callback_1_(mthis, __arg_0) => blendEquationSeparate_Callback_1(mthis, __arg_0);
+  canvas_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "canvas");
 
-  static blendEquationSeparate_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_blendEquationSeparate_Callback";
-  blendEquationSeparate_Callback_2_(mthis, __arg_0, __arg_1) => blendEquationSeparate_Callback_2(mthis, __arg_0, __arg_1);
+  checkFramebufferStatus_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "checkFramebufferStatus", []);
 
-  static blendEquationSeparate_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_blendEquationSeparate_Callback";
-  blendEquationSeparate_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => blendEquationSeparate_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  checkFramebufferStatus_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "checkFramebufferStatus", [__arg_0]);
 
-  static blendEquationSeparate_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_blendEquationSeparate_Callback";
-  blendEquationSeparate_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => blendEquationSeparate_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  clearColor_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "clearColor", [__arg_0, __arg_1]);
 
-  static blendEquation_Callback_0(mthis) native "WebGLRenderingContext_blendEquation_Callback";
-  blendEquation_Callback_0_(mthis) => blendEquation_Callback_0(mthis);
+  clearColor_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "clearColor", [__arg_0, __arg_1, __arg_2]);
 
-  static blendEquation_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_blendEquation_Callback";
-  blendEquation_Callback_1_(mthis, __arg_0) => blendEquation_Callback_1(mthis, __arg_0);
+  clearColor_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "clearColor", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static blendEquation_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_blendEquation_Callback";
-  blendEquation_Callback_2_(mthis, __arg_0, __arg_1) => blendEquation_Callback_2(mthis, __arg_0, __arg_1);
+  clearDepth_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "clearDepth", []);
 
-  static blendEquation_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_blendEquation_Callback";
-  blendEquation_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => blendEquation_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  clearDepth_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "clearDepth", [__arg_0]);
 
-  static blendFuncSeparate_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_blendFuncSeparate_Callback";
-  blendFuncSeparate_Callback_2_(mthis, __arg_0, __arg_1) => blendFuncSeparate_Callback_2(mthis, __arg_0, __arg_1);
+  clearStencil_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "clearStencil", []);
 
-  static blendFuncSeparate_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_blendFuncSeparate_Callback";
-  blendFuncSeparate_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => blendFuncSeparate_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  clearStencil_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "clearStencil", [__arg_0]);
 
-  static blendFuncSeparate_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_blendFuncSeparate_Callback";
-  blendFuncSeparate_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => blendFuncSeparate_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  clear_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "clear", []);
 
-  static blendFuncSeparate_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "WebGLRenderingContext_blendFuncSeparate_Callback";
-  blendFuncSeparate_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => blendFuncSeparate_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  clear_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "clear", [__arg_0]);
 
-  static blendFuncSeparate_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "WebGLRenderingContext_blendFuncSeparate_Callback";
-  blendFuncSeparate_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => blendFuncSeparate_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  colorMask_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "colorMask", [__arg_0, __arg_1]);
 
-  static blendFunc_Callback_0(mthis) native "WebGLRenderingContext_blendFunc_Callback";
-  blendFunc_Callback_0_(mthis) => blendFunc_Callback_0(mthis);
+  colorMask_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "colorMask", [__arg_0, __arg_1, __arg_2]);
 
-  static blendFunc_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_blendFunc_Callback";
-  blendFunc_Callback_1_(mthis, __arg_0) => blendFunc_Callback_1(mthis, __arg_0);
+  colorMask_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "colorMask", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static blendFunc_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_blendFunc_Callback";
-  blendFunc_Callback_2_(mthis, __arg_0, __arg_1) => blendFunc_Callback_2(mthis, __arg_0, __arg_1);
+  compileShader_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "compileShader", []);
 
-  static blendFunc_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_blendFunc_Callback";
-  blendFunc_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => blendFunc_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  compileShader_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "compileShader", [__arg_0]);
 
-  static blendFunc_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_blendFunc_Callback";
-  blendFunc_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => blendFunc_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  compressedTexImage2D_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => Blink_JsNative_DomException.callMethod(mthis, "compressedTexImage2D", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4]);
 
-  static bufferData_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_bufferData_Callback";
-  bufferData_Callback_1_(mthis, __arg_0) => bufferData_Callback_1(mthis, __arg_0);
+  compressedTexImage2D_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => Blink_JsNative_DomException.callMethod(mthis, "compressedTexImage2D", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5]);
 
-  static bufferData_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_bufferData_Callback";
-  bufferData_Callback_2_(mthis, __arg_0, __arg_1) => bufferData_Callback_2(mthis, __arg_0, __arg_1);
+  compressedTexImage2D_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => Blink_JsNative_DomException.callMethod(mthis, "compressedTexImage2D", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6]);
 
-  static bufferData_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_bufferData_Callback";
-  bufferData_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => bufferData_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  compressedTexSubImage2D_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => Blink_JsNative_DomException.callMethod(mthis, "compressedTexSubImage2D", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5]);
 
-  static bufferData_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_bufferData_Callback";
-  bufferData_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => bufferData_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  compressedTexSubImage2D_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => Blink_JsNative_DomException.callMethod(mthis, "compressedTexSubImage2D", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6]);
 
-  static bufferData_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "WebGLRenderingContext_bufferData_Callback";
-  bufferData_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => bufferData_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  compressedTexSubImage2D_Callback_8_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) => Blink_JsNative_DomException.callMethod(mthis, "compressedTexSubImage2D", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7]);
 
-  static bufferSubData_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_bufferSubData_Callback";
-  bufferSubData_Callback_1_(mthis, __arg_0) => bufferSubData_Callback_1(mthis, __arg_0);
+  copyTexImage2D_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => Blink_JsNative_DomException.callMethod(mthis, "copyTexImage2D", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5]);
 
-  static bufferSubData_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_bufferSubData_Callback";
-  bufferSubData_Callback_2_(mthis, __arg_0, __arg_1) => bufferSubData_Callback_2(mthis, __arg_0, __arg_1);
+  copyTexImage2D_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => Blink_JsNative_DomException.callMethod(mthis, "copyTexImage2D", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6]);
 
-  static bufferSubData_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_bufferSubData_Callback";
-  bufferSubData_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => bufferSubData_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  copyTexImage2D_Callback_8_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) => Blink_JsNative_DomException.callMethod(mthis, "copyTexImage2D", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7]);
 
-  static bufferSubData_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_bufferSubData_Callback";
-  bufferSubData_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => bufferSubData_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  copyTexSubImage2D_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => Blink_JsNative_DomException.callMethod(mthis, "copyTexSubImage2D", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5]);
 
-  static bufferSubData_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "WebGLRenderingContext_bufferSubData_Callback";
-  bufferSubData_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => bufferSubData_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  copyTexSubImage2D_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => Blink_JsNative_DomException.callMethod(mthis, "copyTexSubImage2D", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6]);
 
-  static canvas_Getter(mthis) native "WebGLRenderingContext_canvas_Getter";
-  canvas_Getter_(mthis) => canvas_Getter(mthis);
+  copyTexSubImage2D_Callback_8_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) => Blink_JsNative_DomException.callMethod(mthis, "copyTexSubImage2D", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7]);
 
-  static checkFramebufferStatus_Callback_0(mthis) native "WebGLRenderingContext_checkFramebufferStatus_Callback";
-  checkFramebufferStatus_Callback_0_(mthis) => checkFramebufferStatus_Callback_0(mthis);
+  createBuffer_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createBuffer", []);
 
-  static checkFramebufferStatus_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_checkFramebufferStatus_Callback";
-  checkFramebufferStatus_Callback_1_(mthis, __arg_0) => checkFramebufferStatus_Callback_1(mthis, __arg_0);
+  createFramebuffer_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createFramebuffer", []);
 
-  static checkFramebufferStatus_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_checkFramebufferStatus_Callback";
-  checkFramebufferStatus_Callback_2_(mthis, __arg_0, __arg_1) => checkFramebufferStatus_Callback_2(mthis, __arg_0, __arg_1);
+  createProgram_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createProgram", []);
 
-  static checkFramebufferStatus_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_checkFramebufferStatus_Callback";
-  checkFramebufferStatus_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => checkFramebufferStatus_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  createRenderbuffer_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createRenderbuffer", []);
 
-  static clearColor_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_clearColor_Callback";
-  clearColor_Callback_2_(mthis, __arg_0, __arg_1) => clearColor_Callback_2(mthis, __arg_0, __arg_1);
+  createShader_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createShader", []);
 
-  static clearColor_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_clearColor_Callback";
-  clearColor_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => clearColor_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  createShader_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "createShader", [__arg_0]);
 
-  static clearColor_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_clearColor_Callback";
-  clearColor_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => clearColor_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  createTexture_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createTexture", []);
 
-  static clearColor_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "WebGLRenderingContext_clearColor_Callback";
-  clearColor_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => clearColor_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  cullFace_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "cullFace", []);
 
-  static clearColor_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "WebGLRenderingContext_clearColor_Callback";
-  clearColor_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => clearColor_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  cullFace_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "cullFace", [__arg_0]);
 
-  static clearDepth_Callback_0(mthis) native "WebGLRenderingContext_clearDepth_Callback";
-  clearDepth_Callback_0_(mthis) => clearDepth_Callback_0(mthis);
+  deleteBuffer_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "deleteBuffer", []);
 
-  static clearDepth_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_clearDepth_Callback";
-  clearDepth_Callback_1_(mthis, __arg_0) => clearDepth_Callback_1(mthis, __arg_0);
+  deleteBuffer_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "deleteBuffer", [__arg_0]);
 
-  static clearDepth_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_clearDepth_Callback";
-  clearDepth_Callback_2_(mthis, __arg_0, __arg_1) => clearDepth_Callback_2(mthis, __arg_0, __arg_1);
+  deleteFramebuffer_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "deleteFramebuffer", []);
 
-  static clearDepth_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_clearDepth_Callback";
-  clearDepth_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => clearDepth_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  deleteFramebuffer_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "deleteFramebuffer", [__arg_0]);
 
-  static clearStencil_Callback_0(mthis) native "WebGLRenderingContext_clearStencil_Callback";
-  clearStencil_Callback_0_(mthis) => clearStencil_Callback_0(mthis);
+  deleteProgram_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "deleteProgram", []);
 
-  static clearStencil_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_clearStencil_Callback";
-  clearStencil_Callback_1_(mthis, __arg_0) => clearStencil_Callback_1(mthis, __arg_0);
+  deleteProgram_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "deleteProgram", [__arg_0]);
 
-  static clearStencil_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_clearStencil_Callback";
-  clearStencil_Callback_2_(mthis, __arg_0, __arg_1) => clearStencil_Callback_2(mthis, __arg_0, __arg_1);
+  deleteRenderbuffer_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "deleteRenderbuffer", []);
 
-  static clearStencil_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_clearStencil_Callback";
-  clearStencil_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => clearStencil_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  deleteRenderbuffer_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "deleteRenderbuffer", [__arg_0]);
 
-  static clear_Callback_0(mthis) native "WebGLRenderingContext_clear_Callback";
-  clear_Callback_0_(mthis) => clear_Callback_0(mthis);
+  deleteShader_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "deleteShader", []);
 
-  static clear_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_clear_Callback";
-  clear_Callback_1_(mthis, __arg_0) => clear_Callback_1(mthis, __arg_0);
+  deleteShader_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "deleteShader", [__arg_0]);
 
-  static clear_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_clear_Callback";
-  clear_Callback_2_(mthis, __arg_0, __arg_1) => clear_Callback_2(mthis, __arg_0, __arg_1);
+  deleteTexture_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "deleteTexture", []);
 
-  static clear_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_clear_Callback";
-  clear_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => clear_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  deleteTexture_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "deleteTexture", [__arg_0]);
 
-  static colorMask_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_colorMask_Callback";
-  colorMask_Callback_2_(mthis, __arg_0, __arg_1) => colorMask_Callback_2(mthis, __arg_0, __arg_1);
+  depthFunc_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "depthFunc", []);
 
-  static colorMask_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_colorMask_Callback";
-  colorMask_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => colorMask_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  depthFunc_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "depthFunc", [__arg_0]);
 
-  static colorMask_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_colorMask_Callback";
-  colorMask_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => colorMask_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  depthMask_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "depthMask", []);
 
-  static colorMask_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "WebGLRenderingContext_colorMask_Callback";
-  colorMask_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => colorMask_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  depthMask_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "depthMask", [__arg_0]);
 
-  static colorMask_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "WebGLRenderingContext_colorMask_Callback";
-  colorMask_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => colorMask_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  depthRange_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "depthRange", []);
 
-  static compileShader_Callback_0(mthis) native "WebGLRenderingContext_compileShader_Callback";
-  compileShader_Callback_0_(mthis) => compileShader_Callback_0(mthis);
+  depthRange_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "depthRange", [__arg_0]);
 
-  static compileShader_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_compileShader_Callback";
-  compileShader_Callback_1_(mthis, __arg_0) => compileShader_Callback_1(mthis, __arg_0);
+  depthRange_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "depthRange", [__arg_0, __arg_1]);
 
-  static compileShader_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_compileShader_Callback";
-  compileShader_Callback_2_(mthis, __arg_0, __arg_1) => compileShader_Callback_2(mthis, __arg_0, __arg_1);
+  detachShader_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "detachShader", []);
 
-  static compileShader_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_compileShader_Callback";
-  compileShader_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => compileShader_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  detachShader_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "detachShader", [__arg_0]);
 
-  static compressedTexImage2D_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "WebGLRenderingContext_compressedTexImage2D_Callback";
-  compressedTexImage2D_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => compressedTexImage2D_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  detachShader_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "detachShader", [__arg_0, __arg_1]);
 
-  static compressedTexImage2D_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "WebGLRenderingContext_compressedTexImage2D_Callback";
-  compressedTexImage2D_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => compressedTexImage2D_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  disableVertexAttribArray_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "disableVertexAttribArray", []);
 
-  static compressedTexImage2D_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) native "WebGLRenderingContext_compressedTexImage2D_Callback";
-  compressedTexImage2D_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => compressedTexImage2D_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6);
+  disableVertexAttribArray_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "disableVertexAttribArray", [__arg_0]);
 
-  static compressedTexImage2D_Callback_8(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) native "WebGLRenderingContext_compressedTexImage2D_Callback";
-  compressedTexImage2D_Callback_8_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) => compressedTexImage2D_Callback_8(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7);
+  disable_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "disable", []);
 
-  static compressedTexImage2D_Callback_9(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8) native "WebGLRenderingContext_compressedTexImage2D_Callback";
-  compressedTexImage2D_Callback_9_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8) => compressedTexImage2D_Callback_9(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8);
+  disable_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "disable", [__arg_0]);
 
-  static compressedTexSubImage2D_Callback_10(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9) native "WebGLRenderingContext_compressedTexSubImage2D_Callback";
-  compressedTexSubImage2D_Callback_10_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9) => compressedTexSubImage2D_Callback_10(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9);
+  drawArrays_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "drawArrays", [__arg_0]);
 
-  static compressedTexSubImage2D_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "WebGLRenderingContext_compressedTexSubImage2D_Callback";
-  compressedTexSubImage2D_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => compressedTexSubImage2D_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  drawArrays_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "drawArrays", [__arg_0, __arg_1]);
 
-  static compressedTexSubImage2D_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) native "WebGLRenderingContext_compressedTexSubImage2D_Callback";
-  compressedTexSubImage2D_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => compressedTexSubImage2D_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6);
+  drawArrays_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "drawArrays", [__arg_0, __arg_1, __arg_2]);
 
-  static compressedTexSubImage2D_Callback_8(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) native "WebGLRenderingContext_compressedTexSubImage2D_Callback";
-  compressedTexSubImage2D_Callback_8_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) => compressedTexSubImage2D_Callback_8(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7);
+  drawElements_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "drawElements", [__arg_0, __arg_1]);
 
-  static compressedTexSubImage2D_Callback_9(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8) native "WebGLRenderingContext_compressedTexSubImage2D_Callback";
-  compressedTexSubImage2D_Callback_9_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8) => compressedTexSubImage2D_Callback_9(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8);
+  drawElements_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "drawElements", [__arg_0, __arg_1, __arg_2]);
 
-  static copyTexImage2D_Callback_10(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9) native "WebGLRenderingContext_copyTexImage2D_Callback";
-  copyTexImage2D_Callback_10_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9) => copyTexImage2D_Callback_10(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9);
+  drawElements_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "drawElements", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static copyTexImage2D_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "WebGLRenderingContext_copyTexImage2D_Callback";
-  copyTexImage2D_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => copyTexImage2D_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  drawingBufferHeight_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "drawingBufferHeight");
 
-  static copyTexImage2D_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) native "WebGLRenderingContext_copyTexImage2D_Callback";
-  copyTexImage2D_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => copyTexImage2D_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6);
+  drawingBufferWidth_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "drawingBufferWidth");
 
-  static copyTexImage2D_Callback_8(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) native "WebGLRenderingContext_copyTexImage2D_Callback";
-  copyTexImage2D_Callback_8_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) => copyTexImage2D_Callback_8(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7);
+  enableVertexAttribArray_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "enableVertexAttribArray", []);
 
-  static copyTexImage2D_Callback_9(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8) native "WebGLRenderingContext_copyTexImage2D_Callback";
-  copyTexImage2D_Callback_9_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8) => copyTexImage2D_Callback_9(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8);
+  enableVertexAttribArray_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "enableVertexAttribArray", [__arg_0]);
 
-  static copyTexSubImage2D_Callback_10(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9) native "WebGLRenderingContext_copyTexSubImage2D_Callback";
-  copyTexSubImage2D_Callback_10_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9) => copyTexSubImage2D_Callback_10(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9);
+  enable_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "enable", []);
 
-  static copyTexSubImage2D_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "WebGLRenderingContext_copyTexSubImage2D_Callback";
-  copyTexSubImage2D_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => copyTexSubImage2D_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  enable_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "enable", [__arg_0]);
 
-  static copyTexSubImage2D_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) native "WebGLRenderingContext_copyTexSubImage2D_Callback";
-  copyTexSubImage2D_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => copyTexSubImage2D_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6);
+  finish_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "finish", []);
 
-  static copyTexSubImage2D_Callback_8(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) native "WebGLRenderingContext_copyTexSubImage2D_Callback";
-  copyTexSubImage2D_Callback_8_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) => copyTexSubImage2D_Callback_8(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7);
+  flush_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "flush", []);
 
-  static copyTexSubImage2D_Callback_9(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8) native "WebGLRenderingContext_copyTexSubImage2D_Callback";
-  copyTexSubImage2D_Callback_9_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8) => copyTexSubImage2D_Callback_9(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8);
+  framebufferRenderbuffer_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "framebufferRenderbuffer", [__arg_0, __arg_1]);
 
-  static createBuffer_Callback_0(mthis) native "WebGLRenderingContext_createBuffer_Callback";
-  createBuffer_Callback_0_(mthis) => createBuffer_Callback_0(mthis);
+  framebufferRenderbuffer_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "framebufferRenderbuffer", [__arg_0, __arg_1, __arg_2]);
 
-  static createBuffer_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_createBuffer_Callback";
-  createBuffer_Callback_1_(mthis, __arg_0) => createBuffer_Callback_1(mthis, __arg_0);
+  framebufferRenderbuffer_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "framebufferRenderbuffer", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static createBuffer_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_createBuffer_Callback";
-  createBuffer_Callback_2_(mthis, __arg_0, __arg_1) => createBuffer_Callback_2(mthis, __arg_0, __arg_1);
+  framebufferTexture2D_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "framebufferTexture2D", [__arg_0, __arg_1, __arg_2]);
 
-  static createFramebuffer_Callback_0(mthis) native "WebGLRenderingContext_createFramebuffer_Callback";
-  createFramebuffer_Callback_0_(mthis) => createFramebuffer_Callback_0(mthis);
+  framebufferTexture2D_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "framebufferTexture2D", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static createFramebuffer_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_createFramebuffer_Callback";
-  createFramebuffer_Callback_1_(mthis, __arg_0) => createFramebuffer_Callback_1(mthis, __arg_0);
+  framebufferTexture2D_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => Blink_JsNative_DomException.callMethod(mthis, "framebufferTexture2D", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4]);
 
-  static createFramebuffer_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_createFramebuffer_Callback";
-  createFramebuffer_Callback_2_(mthis, __arg_0, __arg_1) => createFramebuffer_Callback_2(mthis, __arg_0, __arg_1);
+  frontFace_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "frontFace", []);
 
-  static createProgram_Callback_0(mthis) native "WebGLRenderingContext_createProgram_Callback";
-  createProgram_Callback_0_(mthis) => createProgram_Callback_0(mthis);
+  frontFace_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "frontFace", [__arg_0]);
 
-  static createProgram_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_createProgram_Callback";
-  createProgram_Callback_1_(mthis, __arg_0) => createProgram_Callback_1(mthis, __arg_0);
+  generateMipmap_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "generateMipmap", []);
 
-  static createProgram_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_createProgram_Callback";
-  createProgram_Callback_2_(mthis, __arg_0, __arg_1) => createProgram_Callback_2(mthis, __arg_0, __arg_1);
+  generateMipmap_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "generateMipmap", [__arg_0]);
 
-  static createRenderbuffer_Callback_0(mthis) native "WebGLRenderingContext_createRenderbuffer_Callback";
-  createRenderbuffer_Callback_0_(mthis) => createRenderbuffer_Callback_0(mthis);
+  getActiveAttrib_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getActiveAttrib", []);
 
-  static createRenderbuffer_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_createRenderbuffer_Callback";
-  createRenderbuffer_Callback_1_(mthis, __arg_0) => createRenderbuffer_Callback_1(mthis, __arg_0);
+  getActiveAttrib_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getActiveAttrib", [__arg_0]);
 
-  static createRenderbuffer_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_createRenderbuffer_Callback";
-  createRenderbuffer_Callback_2_(mthis, __arg_0, __arg_1) => createRenderbuffer_Callback_2(mthis, __arg_0, __arg_1);
+  getActiveAttrib_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "getActiveAttrib", [__arg_0, __arg_1]);
 
-  static createShader_Callback_0(mthis) native "WebGLRenderingContext_createShader_Callback";
-  createShader_Callback_0_(mthis) => createShader_Callback_0(mthis);
+  getActiveUniform_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getActiveUniform", []);
 
-  static createShader_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_createShader_Callback";
-  createShader_Callback_1_(mthis, __arg_0) => createShader_Callback_1(mthis, __arg_0);
+  getActiveUniform_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getActiveUniform", [__arg_0]);
 
-  static createShader_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_createShader_Callback";
-  createShader_Callback_2_(mthis, __arg_0, __arg_1) => createShader_Callback_2(mthis, __arg_0, __arg_1);
+  getActiveUniform_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "getActiveUniform", [__arg_0, __arg_1]);
 
-  static createShader_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_createShader_Callback";
-  createShader_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => createShader_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  getAttachedShaders_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getAttachedShaders", []);
 
-  static createTexture_Callback_0(mthis) native "WebGLRenderingContext_createTexture_Callback";
-  createTexture_Callback_0_(mthis) => createTexture_Callback_0(mthis);
+  getAttachedShaders_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getAttachedShaders", [__arg_0]);
 
-  static createTexture_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_createTexture_Callback";
-  createTexture_Callback_1_(mthis, __arg_0) => createTexture_Callback_1(mthis, __arg_0);
+  getAttribLocation_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getAttribLocation", []);
 
-  static createTexture_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_createTexture_Callback";
-  createTexture_Callback_2_(mthis, __arg_0, __arg_1) => createTexture_Callback_2(mthis, __arg_0, __arg_1);
+  getAttribLocation_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getAttribLocation", [__arg_0]);
 
-  static cullFace_Callback_0(mthis) native "WebGLRenderingContext_cullFace_Callback";
-  cullFace_Callback_0_(mthis) => cullFace_Callback_0(mthis);
+  getAttribLocation_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "getAttribLocation", [__arg_0, __arg_1]);
 
-  static cullFace_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_cullFace_Callback";
-  cullFace_Callback_1_(mthis, __arg_0) => cullFace_Callback_1(mthis, __arg_0);
+  getBufferParameter_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getBufferParameter", []);
 
-  static cullFace_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_cullFace_Callback";
-  cullFace_Callback_2_(mthis, __arg_0, __arg_1) => cullFace_Callback_2(mthis, __arg_0, __arg_1);
+  getBufferParameter_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getBufferParameter", [__arg_0]);
 
-  static cullFace_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_cullFace_Callback";
-  cullFace_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => cullFace_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  getBufferParameter_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "getBufferParameter", [__arg_0, __arg_1]);
 
-  static deleteBuffer_Callback_0(mthis) native "WebGLRenderingContext_deleteBuffer_Callback";
-  deleteBuffer_Callback_0_(mthis) => deleteBuffer_Callback_0(mthis);
+  getContextAttributes_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getContextAttributes", []);
 
-  static deleteBuffer_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_deleteBuffer_Callback";
-  deleteBuffer_Callback_1_(mthis, __arg_0) => deleteBuffer_Callback_1(mthis, __arg_0);
+  getError_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getError", []);
 
-  static deleteBuffer_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_deleteBuffer_Callback";
-  deleteBuffer_Callback_2_(mthis, __arg_0, __arg_1) => deleteBuffer_Callback_2(mthis, __arg_0, __arg_1);
+  getExtension_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getExtension", []);
 
-  static deleteBuffer_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_deleteBuffer_Callback";
-  deleteBuffer_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => deleteBuffer_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  getExtension_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getExtension", [__arg_0]);
 
-  static deleteFramebuffer_Callback_0(mthis) native "WebGLRenderingContext_deleteFramebuffer_Callback";
-  deleteFramebuffer_Callback_0_(mthis) => deleteFramebuffer_Callback_0(mthis);
+  getFramebufferAttachmentParameter_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getFramebufferAttachmentParameter", [__arg_0]);
 
-  static deleteFramebuffer_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_deleteFramebuffer_Callback";
-  deleteFramebuffer_Callback_1_(mthis, __arg_0) => deleteFramebuffer_Callback_1(mthis, __arg_0);
+  getFramebufferAttachmentParameter_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "getFramebufferAttachmentParameter", [__arg_0, __arg_1]);
 
-  static deleteFramebuffer_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_deleteFramebuffer_Callback";
-  deleteFramebuffer_Callback_2_(mthis, __arg_0, __arg_1) => deleteFramebuffer_Callback_2(mthis, __arg_0, __arg_1);
+  getFramebufferAttachmentParameter_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "getFramebufferAttachmentParameter", [__arg_0, __arg_1, __arg_2]);
 
-  static deleteFramebuffer_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_deleteFramebuffer_Callback";
-  deleteFramebuffer_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => deleteFramebuffer_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  getParameter_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getParameter", []);
 
-  static deleteProgram_Callback_0(mthis) native "WebGLRenderingContext_deleteProgram_Callback";
-  deleteProgram_Callback_0_(mthis) => deleteProgram_Callback_0(mthis);
+  getParameter_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getParameter", [__arg_0]);
 
-  static deleteProgram_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_deleteProgram_Callback";
-  deleteProgram_Callback_1_(mthis, __arg_0) => deleteProgram_Callback_1(mthis, __arg_0);
+  getProgramInfoLog_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getProgramInfoLog", []);
 
-  static deleteProgram_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_deleteProgram_Callback";
-  deleteProgram_Callback_2_(mthis, __arg_0, __arg_1) => deleteProgram_Callback_2(mthis, __arg_0, __arg_1);
+  getProgramInfoLog_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getProgramInfoLog", [__arg_0]);
 
-  static deleteProgram_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_deleteProgram_Callback";
-  deleteProgram_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => deleteProgram_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  getProgramParameter_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getProgramParameter", []);
 
-  static deleteRenderbuffer_Callback_0(mthis) native "WebGLRenderingContext_deleteRenderbuffer_Callback";
-  deleteRenderbuffer_Callback_0_(mthis) => deleteRenderbuffer_Callback_0(mthis);
+  getProgramParameter_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getProgramParameter", [__arg_0]);
 
-  static deleteRenderbuffer_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_deleteRenderbuffer_Callback";
-  deleteRenderbuffer_Callback_1_(mthis, __arg_0) => deleteRenderbuffer_Callback_1(mthis, __arg_0);
+  getProgramParameter_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "getProgramParameter", [__arg_0, __arg_1]);
 
-  static deleteRenderbuffer_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_deleteRenderbuffer_Callback";
-  deleteRenderbuffer_Callback_2_(mthis, __arg_0, __arg_1) => deleteRenderbuffer_Callback_2(mthis, __arg_0, __arg_1);
+  getRenderbufferParameter_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getRenderbufferParameter", []);
 
-  static deleteRenderbuffer_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_deleteRenderbuffer_Callback";
-  deleteRenderbuffer_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => deleteRenderbuffer_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  getRenderbufferParameter_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getRenderbufferParameter", [__arg_0]);
 
-  static deleteShader_Callback_0(mthis) native "WebGLRenderingContext_deleteShader_Callback";
-  deleteShader_Callback_0_(mthis) => deleteShader_Callback_0(mthis);
+  getRenderbufferParameter_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "getRenderbufferParameter", [__arg_0, __arg_1]);
 
-  static deleteShader_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_deleteShader_Callback";
-  deleteShader_Callback_1_(mthis, __arg_0) => deleteShader_Callback_1(mthis, __arg_0);
+  getShaderInfoLog_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getShaderInfoLog", []);
 
-  static deleteShader_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_deleteShader_Callback";
-  deleteShader_Callback_2_(mthis, __arg_0, __arg_1) => deleteShader_Callback_2(mthis, __arg_0, __arg_1);
+  getShaderInfoLog_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getShaderInfoLog", [__arg_0]);
 
-  static deleteShader_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_deleteShader_Callback";
-  deleteShader_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => deleteShader_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  getShaderParameter_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getShaderParameter", []);
 
-  static deleteTexture_Callback_0(mthis) native "WebGLRenderingContext_deleteTexture_Callback";
-  deleteTexture_Callback_0_(mthis) => deleteTexture_Callback_0(mthis);
+  getShaderParameter_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getShaderParameter", [__arg_0]);
 
-  static deleteTexture_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_deleteTexture_Callback";
-  deleteTexture_Callback_1_(mthis, __arg_0) => deleteTexture_Callback_1(mthis, __arg_0);
+  getShaderParameter_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "getShaderParameter", [__arg_0, __arg_1]);
 
-  static deleteTexture_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_deleteTexture_Callback";
-  deleteTexture_Callback_2_(mthis, __arg_0, __arg_1) => deleteTexture_Callback_2(mthis, __arg_0, __arg_1);
+  getShaderPrecisionFormat_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getShaderPrecisionFormat", []);
 
-  static deleteTexture_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_deleteTexture_Callback";
-  deleteTexture_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => deleteTexture_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  getShaderPrecisionFormat_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getShaderPrecisionFormat", [__arg_0]);
 
-  static depthFunc_Callback_0(mthis) native "WebGLRenderingContext_depthFunc_Callback";
-  depthFunc_Callback_0_(mthis) => depthFunc_Callback_0(mthis);
+  getShaderPrecisionFormat_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "getShaderPrecisionFormat", [__arg_0, __arg_1]);
 
-  static depthFunc_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_depthFunc_Callback";
-  depthFunc_Callback_1_(mthis, __arg_0) => depthFunc_Callback_1(mthis, __arg_0);
+  getShaderSource_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getShaderSource", []);
 
-  static depthFunc_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_depthFunc_Callback";
-  depthFunc_Callback_2_(mthis, __arg_0, __arg_1) => depthFunc_Callback_2(mthis, __arg_0, __arg_1);
+  getShaderSource_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getShaderSource", [__arg_0]);
 
-  static depthFunc_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_depthFunc_Callback";
-  depthFunc_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => depthFunc_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  getSupportedExtensions_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getSupportedExtensions", []);
 
-  static depthMask_Callback_0(mthis) native "WebGLRenderingContext_depthMask_Callback";
-  depthMask_Callback_0_(mthis) => depthMask_Callback_0(mthis);
+  getTexParameter_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getTexParameter", []);
 
-  static depthMask_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_depthMask_Callback";
-  depthMask_Callback_1_(mthis, __arg_0) => depthMask_Callback_1(mthis, __arg_0);
+  getTexParameter_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getTexParameter", [__arg_0]);
 
-  static depthMask_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_depthMask_Callback";
-  depthMask_Callback_2_(mthis, __arg_0, __arg_1) => depthMask_Callback_2(mthis, __arg_0, __arg_1);
+  getTexParameter_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "getTexParameter", [__arg_0, __arg_1]);
 
-  static depthMask_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_depthMask_Callback";
-  depthMask_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => depthMask_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  getUniformLocation_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getUniformLocation", []);
 
-  static depthRange_Callback_0(mthis) native "WebGLRenderingContext_depthRange_Callback";
-  depthRange_Callback_0_(mthis) => depthRange_Callback_0(mthis);
+  getUniformLocation_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getUniformLocation", [__arg_0]);
 
-  static depthRange_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_depthRange_Callback";
-  depthRange_Callback_1_(mthis, __arg_0) => depthRange_Callback_1(mthis, __arg_0);
+  getUniformLocation_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "getUniformLocation", [__arg_0, __arg_1]);
 
-  static depthRange_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_depthRange_Callback";
-  depthRange_Callback_2_(mthis, __arg_0, __arg_1) => depthRange_Callback_2(mthis, __arg_0, __arg_1);
+  getUniform_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getUniform", []);
 
-  static depthRange_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_depthRange_Callback";
-  depthRange_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => depthRange_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  getUniform_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getUniform", [__arg_0]);
 
-  static depthRange_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_depthRange_Callback";
-  depthRange_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => depthRange_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  getUniform_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "getUniform", [__arg_0, __arg_1]);
 
-  static detachShader_Callback_0(mthis) native "WebGLRenderingContext_detachShader_Callback";
-  detachShader_Callback_0_(mthis) => detachShader_Callback_0(mthis);
+  getVertexAttribOffset_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getVertexAttribOffset", []);
 
-  static detachShader_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_detachShader_Callback";
-  detachShader_Callback_1_(mthis, __arg_0) => detachShader_Callback_1(mthis, __arg_0);
+  getVertexAttribOffset_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getVertexAttribOffset", [__arg_0]);
 
-  static detachShader_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_detachShader_Callback";
-  detachShader_Callback_2_(mthis, __arg_0, __arg_1) => detachShader_Callback_2(mthis, __arg_0, __arg_1);
+  getVertexAttribOffset_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "getVertexAttribOffset", [__arg_0, __arg_1]);
 
-  static detachShader_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_detachShader_Callback";
-  detachShader_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => detachShader_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  getVertexAttrib_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getVertexAttrib", []);
 
-  static detachShader_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_detachShader_Callback";
-  detachShader_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => detachShader_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  getVertexAttrib_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getVertexAttrib", [__arg_0]);
 
-  static disableVertexAttribArray_Callback_0(mthis) native "WebGLRenderingContext_disableVertexAttribArray_Callback";
-  disableVertexAttribArray_Callback_0_(mthis) => disableVertexAttribArray_Callback_0(mthis);
+  getVertexAttrib_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "getVertexAttrib", [__arg_0, __arg_1]);
 
-  static disableVertexAttribArray_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_disableVertexAttribArray_Callback";
-  disableVertexAttribArray_Callback_1_(mthis, __arg_0) => disableVertexAttribArray_Callback_1(mthis, __arg_0);
+  hint_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "hint", []);
 
-  static disableVertexAttribArray_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_disableVertexAttribArray_Callback";
-  disableVertexAttribArray_Callback_2_(mthis, __arg_0, __arg_1) => disableVertexAttribArray_Callback_2(mthis, __arg_0, __arg_1);
+  hint_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "hint", [__arg_0]);
 
-  static disableVertexAttribArray_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_disableVertexAttribArray_Callback";
-  disableVertexAttribArray_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => disableVertexAttribArray_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  hint_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "hint", [__arg_0, __arg_1]);
 
-  static disable_Callback_0(mthis) native "WebGLRenderingContext_disable_Callback";
-  disable_Callback_0_(mthis) => disable_Callback_0(mthis);
+  isBuffer_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "isBuffer", []);
 
-  static disable_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_disable_Callback";
-  disable_Callback_1_(mthis, __arg_0) => disable_Callback_1(mthis, __arg_0);
+  isBuffer_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "isBuffer", [__arg_0]);
 
-  static disable_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_disable_Callback";
-  disable_Callback_2_(mthis, __arg_0, __arg_1) => disable_Callback_2(mthis, __arg_0, __arg_1);
+  isContextLost_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "isContextLost", []);
 
-  static disable_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_disable_Callback";
-  disable_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => disable_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  isEnabled_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "isEnabled", []);
 
-  static drawArrays_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_drawArrays_Callback";
-  drawArrays_Callback_1_(mthis, __arg_0) => drawArrays_Callback_1(mthis, __arg_0);
+  isEnabled_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "isEnabled", [__arg_0]);
 
-  static drawArrays_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_drawArrays_Callback";
-  drawArrays_Callback_2_(mthis, __arg_0, __arg_1) => drawArrays_Callback_2(mthis, __arg_0, __arg_1);
+  isFramebuffer_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "isFramebuffer", []);
 
-  static drawArrays_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_drawArrays_Callback";
-  drawArrays_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => drawArrays_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  isFramebuffer_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "isFramebuffer", [__arg_0]);
 
-  static drawArrays_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_drawArrays_Callback";
-  drawArrays_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => drawArrays_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  isProgram_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "isProgram", []);
 
-  static drawArrays_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "WebGLRenderingContext_drawArrays_Callback";
-  drawArrays_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => drawArrays_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  isProgram_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "isProgram", [__arg_0]);
 
-  static drawElements_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_drawElements_Callback";
-  drawElements_Callback_2_(mthis, __arg_0, __arg_1) => drawElements_Callback_2(mthis, __arg_0, __arg_1);
+  isRenderbuffer_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "isRenderbuffer", []);
 
-  static drawElements_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_drawElements_Callback";
-  drawElements_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => drawElements_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  isRenderbuffer_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "isRenderbuffer", [__arg_0]);
 
-  static drawElements_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_drawElements_Callback";
-  drawElements_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => drawElements_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  isShader_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "isShader", []);
 
-  static drawElements_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "WebGLRenderingContext_drawElements_Callback";
-  drawElements_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => drawElements_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  isShader_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "isShader", [__arg_0]);
 
-  static drawElements_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "WebGLRenderingContext_drawElements_Callback";
-  drawElements_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => drawElements_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  isTexture_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "isTexture", []);
 
-  static drawingBufferHeight_Getter(mthis) native "WebGLRenderingContext_drawingBufferHeight_Getter";
-  drawingBufferHeight_Getter_(mthis) => drawingBufferHeight_Getter(mthis);
+  isTexture_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "isTexture", [__arg_0]);
 
-  static drawingBufferWidth_Getter(mthis) native "WebGLRenderingContext_drawingBufferWidth_Getter";
-  drawingBufferWidth_Getter_(mthis) => drawingBufferWidth_Getter(mthis);
+  lineWidth_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "lineWidth", []);
 
-  static enableVertexAttribArray_Callback_0(mthis) native "WebGLRenderingContext_enableVertexAttribArray_Callback";
-  enableVertexAttribArray_Callback_0_(mthis) => enableVertexAttribArray_Callback_0(mthis);
+  lineWidth_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "lineWidth", [__arg_0]);
 
-  static enableVertexAttribArray_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_enableVertexAttribArray_Callback";
-  enableVertexAttribArray_Callback_1_(mthis, __arg_0) => enableVertexAttribArray_Callback_1(mthis, __arg_0);
+  linkProgram_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "linkProgram", []);
 
-  static enableVertexAttribArray_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_enableVertexAttribArray_Callback";
-  enableVertexAttribArray_Callback_2_(mthis, __arg_0, __arg_1) => enableVertexAttribArray_Callback_2(mthis, __arg_0, __arg_1);
+  linkProgram_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "linkProgram", [__arg_0]);
 
-  static enableVertexAttribArray_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_enableVertexAttribArray_Callback";
-  enableVertexAttribArray_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => enableVertexAttribArray_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  pixelStorei_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "pixelStorei", []);
 
-  static enable_Callback_0(mthis) native "WebGLRenderingContext_enable_Callback";
-  enable_Callback_0_(mthis) => enable_Callback_0(mthis);
+  pixelStorei_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "pixelStorei", [__arg_0]);
 
-  static enable_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_enable_Callback";
-  enable_Callback_1_(mthis, __arg_0) => enable_Callback_1(mthis, __arg_0);
+  pixelStorei_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "pixelStorei", [__arg_0, __arg_1]);
 
-  static enable_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_enable_Callback";
-  enable_Callback_2_(mthis, __arg_0, __arg_1) => enable_Callback_2(mthis, __arg_0, __arg_1);
+  polygonOffset_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "polygonOffset", []);
 
-  static enable_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_enable_Callback";
-  enable_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => enable_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  polygonOffset_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "polygonOffset", [__arg_0]);
 
-  static finish_Callback_0(mthis) native "WebGLRenderingContext_finish_Callback";
-  finish_Callback_0_(mthis) => finish_Callback_0(mthis);
+  polygonOffset_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "polygonOffset", [__arg_0, __arg_1]);
 
-  static finish_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_finish_Callback";
-  finish_Callback_1_(mthis, __arg_0) => finish_Callback_1(mthis, __arg_0);
+  readPixels_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => Blink_JsNative_DomException.callMethod(mthis, "readPixels", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4]);
 
-  static finish_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_finish_Callback";
-  finish_Callback_2_(mthis, __arg_0, __arg_1) => finish_Callback_2(mthis, __arg_0, __arg_1);
+  readPixels_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => Blink_JsNative_DomException.callMethod(mthis, "readPixels", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5]);
 
-  static flush_Callback_0(mthis) native "WebGLRenderingContext_flush_Callback";
-  flush_Callback_0_(mthis) => flush_Callback_0(mthis);
+  readPixels_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => Blink_JsNative_DomException.callMethod(mthis, "readPixels", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6]);
 
-  static flush_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_flush_Callback";
-  flush_Callback_1_(mthis, __arg_0) => flush_Callback_1(mthis, __arg_0);
+  renderbufferStorage_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "renderbufferStorage", [__arg_0, __arg_1]);
 
-  static flush_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_flush_Callback";
-  flush_Callback_2_(mthis, __arg_0, __arg_1) => flush_Callback_2(mthis, __arg_0, __arg_1);
+  renderbufferStorage_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "renderbufferStorage", [__arg_0, __arg_1, __arg_2]);
 
-  static framebufferRenderbuffer_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_framebufferRenderbuffer_Callback";
-  framebufferRenderbuffer_Callback_2_(mthis, __arg_0, __arg_1) => framebufferRenderbuffer_Callback_2(mthis, __arg_0, __arg_1);
+  renderbufferStorage_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "renderbufferStorage", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static framebufferRenderbuffer_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_framebufferRenderbuffer_Callback";
-  framebufferRenderbuffer_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => framebufferRenderbuffer_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  sampleCoverage_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "sampleCoverage", []);
 
-  static framebufferRenderbuffer_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_framebufferRenderbuffer_Callback";
-  framebufferRenderbuffer_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => framebufferRenderbuffer_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  sampleCoverage_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "sampleCoverage", [__arg_0]);
 
-  static framebufferRenderbuffer_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "WebGLRenderingContext_framebufferRenderbuffer_Callback";
-  framebufferRenderbuffer_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => framebufferRenderbuffer_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  sampleCoverage_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "sampleCoverage", [__arg_0, __arg_1]);
 
-  static framebufferRenderbuffer_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "WebGLRenderingContext_framebufferRenderbuffer_Callback";
-  framebufferRenderbuffer_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => framebufferRenderbuffer_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  scissor_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "scissor", [__arg_0, __arg_1]);
 
-  static framebufferTexture2D_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_framebufferTexture2D_Callback";
-  framebufferTexture2D_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => framebufferTexture2D_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  scissor_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "scissor", [__arg_0, __arg_1, __arg_2]);
 
-  static framebufferTexture2D_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_framebufferTexture2D_Callback";
-  framebufferTexture2D_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => framebufferTexture2D_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  scissor_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "scissor", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static framebufferTexture2D_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "WebGLRenderingContext_framebufferTexture2D_Callback";
-  framebufferTexture2D_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => framebufferTexture2D_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  shaderSource_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "shaderSource", []);
 
-  static framebufferTexture2D_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "WebGLRenderingContext_framebufferTexture2D_Callback";
-  framebufferTexture2D_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => framebufferTexture2D_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  shaderSource_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "shaderSource", [__arg_0]);
 
-  static framebufferTexture2D_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) native "WebGLRenderingContext_framebufferTexture2D_Callback";
-  framebufferTexture2D_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => framebufferTexture2D_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6);
+  shaderSource_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "shaderSource", [__arg_0, __arg_1]);
 
-  static frontFace_Callback_0(mthis) native "WebGLRenderingContext_frontFace_Callback";
-  frontFace_Callback_0_(mthis) => frontFace_Callback_0(mthis);
+  stencilFuncSeparate_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "stencilFuncSeparate", [__arg_0, __arg_1]);
 
-  static frontFace_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_frontFace_Callback";
-  frontFace_Callback_1_(mthis, __arg_0) => frontFace_Callback_1(mthis, __arg_0);
+  stencilFuncSeparate_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "stencilFuncSeparate", [__arg_0, __arg_1, __arg_2]);
 
-  static frontFace_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_frontFace_Callback";
-  frontFace_Callback_2_(mthis, __arg_0, __arg_1) => frontFace_Callback_2(mthis, __arg_0, __arg_1);
+  stencilFuncSeparate_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "stencilFuncSeparate", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static frontFace_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_frontFace_Callback";
-  frontFace_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => frontFace_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  stencilFunc_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "stencilFunc", [__arg_0]);
 
-  static generateMipmap_Callback_0(mthis) native "WebGLRenderingContext_generateMipmap_Callback";
-  generateMipmap_Callback_0_(mthis) => generateMipmap_Callback_0(mthis);
+  stencilFunc_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "stencilFunc", [__arg_0, __arg_1]);
 
-  static generateMipmap_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_generateMipmap_Callback";
-  generateMipmap_Callback_1_(mthis, __arg_0) => generateMipmap_Callback_1(mthis, __arg_0);
+  stencilFunc_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "stencilFunc", [__arg_0, __arg_1, __arg_2]);
 
-  static generateMipmap_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_generateMipmap_Callback";
-  generateMipmap_Callback_2_(mthis, __arg_0, __arg_1) => generateMipmap_Callback_2(mthis, __arg_0, __arg_1);
+  stencilMaskSeparate_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "stencilMaskSeparate", []);
 
-  static generateMipmap_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_generateMipmap_Callback";
-  generateMipmap_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => generateMipmap_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  stencilMaskSeparate_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "stencilMaskSeparate", [__arg_0]);
 
-  static getActiveAttrib_Callback_0(mthis) native "WebGLRenderingContext_getActiveAttrib_Callback";
-  getActiveAttrib_Callback_0_(mthis) => getActiveAttrib_Callback_0(mthis);
+  stencilMaskSeparate_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "stencilMaskSeparate", [__arg_0, __arg_1]);
 
-  static getActiveAttrib_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_getActiveAttrib_Callback";
-  getActiveAttrib_Callback_1_(mthis, __arg_0) => getActiveAttrib_Callback_1(mthis, __arg_0);
+  stencilMask_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "stencilMask", []);
 
-  static getActiveAttrib_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_getActiveAttrib_Callback";
-  getActiveAttrib_Callback_2_(mthis, __arg_0, __arg_1) => getActiveAttrib_Callback_2(mthis, __arg_0, __arg_1);
+  stencilMask_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "stencilMask", [__arg_0]);
 
-  static getActiveAttrib_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_getActiveAttrib_Callback";
-  getActiveAttrib_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getActiveAttrib_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  stencilOpSeparate_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "stencilOpSeparate", [__arg_0, __arg_1]);
 
-  static getActiveAttrib_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_getActiveAttrib_Callback";
-  getActiveAttrib_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => getActiveAttrib_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  stencilOpSeparate_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "stencilOpSeparate", [__arg_0, __arg_1, __arg_2]);
 
-  static getActiveUniform_Callback_0(mthis) native "WebGLRenderingContext_getActiveUniform_Callback";
-  getActiveUniform_Callback_0_(mthis) => getActiveUniform_Callback_0(mthis);
+  stencilOpSeparate_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "stencilOpSeparate", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static getActiveUniform_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_getActiveUniform_Callback";
-  getActiveUniform_Callback_1_(mthis, __arg_0) => getActiveUniform_Callback_1(mthis, __arg_0);
+  stencilOp_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "stencilOp", [__arg_0]);
 
-  static getActiveUniform_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_getActiveUniform_Callback";
-  getActiveUniform_Callback_2_(mthis, __arg_0, __arg_1) => getActiveUniform_Callback_2(mthis, __arg_0, __arg_1);
+  stencilOp_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "stencilOp", [__arg_0, __arg_1]);
 
-  static getActiveUniform_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_getActiveUniform_Callback";
-  getActiveUniform_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getActiveUniform_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  stencilOp_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "stencilOp", [__arg_0, __arg_1, __arg_2]);
 
-  static getActiveUniform_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_getActiveUniform_Callback";
-  getActiveUniform_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => getActiveUniform_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  texImage2D_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "texImage2D", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static getAttachedShaders_Callback_0(mthis) native "WebGLRenderingContext_getAttachedShaders_Callback";
-  getAttachedShaders_Callback_0_(mthis) => getAttachedShaders_Callback_0(mthis);
+  texImage2D_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => Blink_JsNative_DomException.callMethod(mthis, "texImage2D", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4]);
 
-  static getAttachedShaders_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_getAttachedShaders_Callback";
-  getAttachedShaders_Callback_1_(mthis, __arg_0) => getAttachedShaders_Callback_1(mthis, __arg_0);
+  texImage2D_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => Blink_JsNative_DomException.callMethod(mthis, "texImage2D", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5]);
 
-  static getAttachedShaders_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_getAttachedShaders_Callback";
-  getAttachedShaders_Callback_2_(mthis, __arg_0, __arg_1) => getAttachedShaders_Callback_2(mthis, __arg_0, __arg_1);
+  texImage2D_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => Blink_JsNative_DomException.callMethod(mthis, "texImage2D", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6]);
 
-  static getAttachedShaders_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_getAttachedShaders_Callback";
-  getAttachedShaders_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getAttachedShaders_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  texImage2D_Callback_8_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) => Blink_JsNative_DomException.callMethod(mthis, "texImage2D", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7]);
 
-  static getAttribLocation_Callback_0(mthis) native "WebGLRenderingContext_getAttribLocation_Callback";
-  getAttribLocation_Callback_0_(mthis) => getAttribLocation_Callback_0(mthis);
+  texImage2D_Callback_9_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8) => Blink_JsNative_DomException.callMethod(mthis, "texImage2D", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8]);
 
-  static getAttribLocation_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_getAttribLocation_Callback";
-  getAttribLocation_Callback_1_(mthis, __arg_0) => getAttribLocation_Callback_1(mthis, __arg_0);
+  texParameterf_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "texParameterf", [__arg_0]);
 
-  static getAttribLocation_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_getAttribLocation_Callback";
-  getAttribLocation_Callback_2_(mthis, __arg_0, __arg_1) => getAttribLocation_Callback_2(mthis, __arg_0, __arg_1);
+  texParameterf_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "texParameterf", [__arg_0, __arg_1]);
 
-  static getAttribLocation_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_getAttribLocation_Callback";
-  getAttribLocation_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getAttribLocation_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  texParameterf_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "texParameterf", [__arg_0, __arg_1, __arg_2]);
 
-  static getAttribLocation_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_getAttribLocation_Callback";
-  getAttribLocation_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => getAttribLocation_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  texParameteri_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "texParameteri", [__arg_0]);
 
-  static getBufferParameter_Callback_0(mthis) native "WebGLRenderingContext_getBufferParameter_Callback";
-  getBufferParameter_Callback_0_(mthis) => getBufferParameter_Callback_0(mthis);
+  texParameteri_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "texParameteri", [__arg_0, __arg_1]);
 
-  static getBufferParameter_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_getBufferParameter_Callback";
-  getBufferParameter_Callback_1_(mthis, __arg_0) => getBufferParameter_Callback_1(mthis, __arg_0);
+  texParameteri_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "texParameteri", [__arg_0, __arg_1, __arg_2]);
 
-  static getBufferParameter_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_getBufferParameter_Callback";
-  getBufferParameter_Callback_2_(mthis, __arg_0, __arg_1) => getBufferParameter_Callback_2(mthis, __arg_0, __arg_1);
+  texSubImage2D_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => Blink_JsNative_DomException.callMethod(mthis, "texSubImage2D", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4]);
 
-  static getBufferParameter_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_getBufferParameter_Callback";
-  getBufferParameter_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getBufferParameter_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  texSubImage2D_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => Blink_JsNative_DomException.callMethod(mthis, "texSubImage2D", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5]);
 
-  static getBufferParameter_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_getBufferParameter_Callback";
-  getBufferParameter_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => getBufferParameter_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  texSubImage2D_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => Blink_JsNative_DomException.callMethod(mthis, "texSubImage2D", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6]);
 
-  static getContextAttributes_Callback_0(mthis) native "WebGLRenderingContext_getContextAttributes_Callback";
-  getContextAttributes_Callback_0_(mthis) => getContextAttributes_Callback_0(mthis);
+  texSubImage2D_Callback_8_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) => Blink_JsNative_DomException.callMethod(mthis, "texSubImage2D", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7]);
 
-  static getContextAttributes_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_getContextAttributes_Callback";
-  getContextAttributes_Callback_1_(mthis, __arg_0) => getContextAttributes_Callback_1(mthis, __arg_0);
+  texSubImage2D_Callback_9_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8) => Blink_JsNative_DomException.callMethod(mthis, "texSubImage2D", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8]);
 
-  static getContextAttributes_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_getContextAttributes_Callback";
-  getContextAttributes_Callback_2_(mthis, __arg_0, __arg_1) => getContextAttributes_Callback_2(mthis, __arg_0, __arg_1);
+  uniform1f_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "uniform1f", []);
 
-  static getError_Callback_0(mthis) native "WebGLRenderingContext_getError_Callback";
-  getError_Callback_0_(mthis) => getError_Callback_0(mthis);
+  uniform1f_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "uniform1f", [__arg_0]);
 
-  static getError_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_getError_Callback";
-  getError_Callback_1_(mthis, __arg_0) => getError_Callback_1(mthis, __arg_0);
+  uniform1f_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "uniform1f", [__arg_0, __arg_1]);
 
-  static getError_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_getError_Callback";
-  getError_Callback_2_(mthis, __arg_0, __arg_1) => getError_Callback_2(mthis, __arg_0, __arg_1);
+  uniform1fv_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "uniform1fv", []);
 
-  static getExtension_Callback_0(mthis) native "WebGLRenderingContext_getExtension_Callback";
-  getExtension_Callback_0_(mthis) => getExtension_Callback_0(mthis);
+  uniform1fv_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "uniform1fv", [__arg_0]);
 
-  static getExtension_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_getExtension_Callback";
-  getExtension_Callback_1_(mthis, __arg_0) => getExtension_Callback_1(mthis, __arg_0);
+  uniform1fv_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "uniform1fv", [__arg_0, __arg_1]);
 
-  static getExtension_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_getExtension_Callback";
-  getExtension_Callback_2_(mthis, __arg_0, __arg_1) => getExtension_Callback_2(mthis, __arg_0, __arg_1);
+  uniform1i_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "uniform1i", []);
 
-  static getExtension_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_getExtension_Callback";
-  getExtension_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getExtension_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  uniform1i_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "uniform1i", [__arg_0]);
 
-  static getFramebufferAttachmentParameter_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_getFramebufferAttachmentParameter_Callback";
-  getFramebufferAttachmentParameter_Callback_1_(mthis, __arg_0) => getFramebufferAttachmentParameter_Callback_1(mthis, __arg_0);
+  uniform1i_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "uniform1i", [__arg_0, __arg_1]);
 
-  static getFramebufferAttachmentParameter_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_getFramebufferAttachmentParameter_Callback";
-  getFramebufferAttachmentParameter_Callback_2_(mthis, __arg_0, __arg_1) => getFramebufferAttachmentParameter_Callback_2(mthis, __arg_0, __arg_1);
+  uniform1iv_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "uniform1iv", []);
 
-  static getFramebufferAttachmentParameter_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_getFramebufferAttachmentParameter_Callback";
-  getFramebufferAttachmentParameter_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getFramebufferAttachmentParameter_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  uniform1iv_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "uniform1iv", [__arg_0]);
 
-  static getFramebufferAttachmentParameter_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_getFramebufferAttachmentParameter_Callback";
-  getFramebufferAttachmentParameter_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => getFramebufferAttachmentParameter_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  uniform1iv_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "uniform1iv", [__arg_0, __arg_1]);
 
-  static getFramebufferAttachmentParameter_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "WebGLRenderingContext_getFramebufferAttachmentParameter_Callback";
-  getFramebufferAttachmentParameter_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => getFramebufferAttachmentParameter_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  uniform2f_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "uniform2f", [__arg_0]);
 
-  static getParameter_Callback_0(mthis) native "WebGLRenderingContext_getParameter_Callback";
-  getParameter_Callback_0_(mthis) => getParameter_Callback_0(mthis);
+  uniform2f_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "uniform2f", [__arg_0, __arg_1]);
 
-  static getParameter_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_getParameter_Callback";
-  getParameter_Callback_1_(mthis, __arg_0) => getParameter_Callback_1(mthis, __arg_0);
+  uniform2f_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "uniform2f", [__arg_0, __arg_1, __arg_2]);
 
-  static getParameter_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_getParameter_Callback";
-  getParameter_Callback_2_(mthis, __arg_0, __arg_1) => getParameter_Callback_2(mthis, __arg_0, __arg_1);
+  uniform2fv_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "uniform2fv", []);
 
-  static getParameter_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_getParameter_Callback";
-  getParameter_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getParameter_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  uniform2fv_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "uniform2fv", [__arg_0]);
 
-  static getProgramInfoLog_Callback_0(mthis) native "WebGLRenderingContext_getProgramInfoLog_Callback";
-  getProgramInfoLog_Callback_0_(mthis) => getProgramInfoLog_Callback_0(mthis);
+  uniform2fv_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "uniform2fv", [__arg_0, __arg_1]);
 
-  static getProgramInfoLog_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_getProgramInfoLog_Callback";
-  getProgramInfoLog_Callback_1_(mthis, __arg_0) => getProgramInfoLog_Callback_1(mthis, __arg_0);
+  uniform2i_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "uniform2i", [__arg_0]);
 
-  static getProgramInfoLog_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_getProgramInfoLog_Callback";
-  getProgramInfoLog_Callback_2_(mthis, __arg_0, __arg_1) => getProgramInfoLog_Callback_2(mthis, __arg_0, __arg_1);
+  uniform2i_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "uniform2i", [__arg_0, __arg_1]);
 
-  static getProgramInfoLog_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_getProgramInfoLog_Callback";
-  getProgramInfoLog_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getProgramInfoLog_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  uniform2i_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "uniform2i", [__arg_0, __arg_1, __arg_2]);
 
-  static getProgramParameter_Callback_0(mthis) native "WebGLRenderingContext_getProgramParameter_Callback";
-  getProgramParameter_Callback_0_(mthis) => getProgramParameter_Callback_0(mthis);
+  uniform2iv_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "uniform2iv", []);
 
-  static getProgramParameter_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_getProgramParameter_Callback";
-  getProgramParameter_Callback_1_(mthis, __arg_0) => getProgramParameter_Callback_1(mthis, __arg_0);
+  uniform2iv_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "uniform2iv", [__arg_0]);
 
-  static getProgramParameter_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_getProgramParameter_Callback";
-  getProgramParameter_Callback_2_(mthis, __arg_0, __arg_1) => getProgramParameter_Callback_2(mthis, __arg_0, __arg_1);
+  uniform2iv_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "uniform2iv", [__arg_0, __arg_1]);
 
-  static getProgramParameter_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_getProgramParameter_Callback";
-  getProgramParameter_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getProgramParameter_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  uniform3f_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "uniform3f", [__arg_0, __arg_1]);
 
-  static getProgramParameter_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_getProgramParameter_Callback";
-  getProgramParameter_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => getProgramParameter_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  uniform3f_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "uniform3f", [__arg_0, __arg_1, __arg_2]);
 
-  static getRenderbufferParameter_Callback_0(mthis) native "WebGLRenderingContext_getRenderbufferParameter_Callback";
-  getRenderbufferParameter_Callback_0_(mthis) => getRenderbufferParameter_Callback_0(mthis);
+  uniform3f_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "uniform3f", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static getRenderbufferParameter_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_getRenderbufferParameter_Callback";
-  getRenderbufferParameter_Callback_1_(mthis, __arg_0) => getRenderbufferParameter_Callback_1(mthis, __arg_0);
+  uniform3fv_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "uniform3fv", []);
 
-  static getRenderbufferParameter_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_getRenderbufferParameter_Callback";
-  getRenderbufferParameter_Callback_2_(mthis, __arg_0, __arg_1) => getRenderbufferParameter_Callback_2(mthis, __arg_0, __arg_1);
+  uniform3fv_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "uniform3fv", [__arg_0]);
 
-  static getRenderbufferParameter_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_getRenderbufferParameter_Callback";
-  getRenderbufferParameter_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getRenderbufferParameter_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  uniform3fv_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "uniform3fv", [__arg_0, __arg_1]);
 
-  static getRenderbufferParameter_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_getRenderbufferParameter_Callback";
-  getRenderbufferParameter_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => getRenderbufferParameter_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  uniform3i_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "uniform3i", [__arg_0, __arg_1]);
 
-  static getShaderInfoLog_Callback_0(mthis) native "WebGLRenderingContext_getShaderInfoLog_Callback";
-  getShaderInfoLog_Callback_0_(mthis) => getShaderInfoLog_Callback_0(mthis);
+  uniform3i_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "uniform3i", [__arg_0, __arg_1, __arg_2]);
 
-  static getShaderInfoLog_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_getShaderInfoLog_Callback";
-  getShaderInfoLog_Callback_1_(mthis, __arg_0) => getShaderInfoLog_Callback_1(mthis, __arg_0);
+  uniform3i_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "uniform3i", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static getShaderInfoLog_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_getShaderInfoLog_Callback";
-  getShaderInfoLog_Callback_2_(mthis, __arg_0, __arg_1) => getShaderInfoLog_Callback_2(mthis, __arg_0, __arg_1);
+  uniform3iv_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "uniform3iv", []);
 
-  static getShaderInfoLog_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_getShaderInfoLog_Callback";
-  getShaderInfoLog_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getShaderInfoLog_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  uniform3iv_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "uniform3iv", [__arg_0]);
 
-  static getShaderParameter_Callback_0(mthis) native "WebGLRenderingContext_getShaderParameter_Callback";
-  getShaderParameter_Callback_0_(mthis) => getShaderParameter_Callback_0(mthis);
+  uniform3iv_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "uniform3iv", [__arg_0, __arg_1]);
 
-  static getShaderParameter_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_getShaderParameter_Callback";
-  getShaderParameter_Callback_1_(mthis, __arg_0) => getShaderParameter_Callback_1(mthis, __arg_0);
+  uniform4f_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "uniform4f", [__arg_0, __arg_1, __arg_2]);
 
-  static getShaderParameter_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_getShaderParameter_Callback";
-  getShaderParameter_Callback_2_(mthis, __arg_0, __arg_1) => getShaderParameter_Callback_2(mthis, __arg_0, __arg_1);
+  uniform4f_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "uniform4f", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static getShaderParameter_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_getShaderParameter_Callback";
-  getShaderParameter_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getShaderParameter_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  uniform4f_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => Blink_JsNative_DomException.callMethod(mthis, "uniform4f", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4]);
 
-  static getShaderParameter_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_getShaderParameter_Callback";
-  getShaderParameter_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => getShaderParameter_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  uniform4fv_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "uniform4fv", []);
 
-  static getShaderPrecisionFormat_Callback_0(mthis) native "WebGLRenderingContext_getShaderPrecisionFormat_Callback";
-  getShaderPrecisionFormat_Callback_0_(mthis) => getShaderPrecisionFormat_Callback_0(mthis);
+  uniform4fv_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "uniform4fv", [__arg_0]);
 
-  static getShaderPrecisionFormat_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_getShaderPrecisionFormat_Callback";
-  getShaderPrecisionFormat_Callback_1_(mthis, __arg_0) => getShaderPrecisionFormat_Callback_1(mthis, __arg_0);
+  uniform4fv_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "uniform4fv", [__arg_0, __arg_1]);
 
-  static getShaderPrecisionFormat_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_getShaderPrecisionFormat_Callback";
-  getShaderPrecisionFormat_Callback_2_(mthis, __arg_0, __arg_1) => getShaderPrecisionFormat_Callback_2(mthis, __arg_0, __arg_1);
+  uniform4i_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "uniform4i", [__arg_0, __arg_1, __arg_2]);
 
-  static getShaderPrecisionFormat_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_getShaderPrecisionFormat_Callback";
-  getShaderPrecisionFormat_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getShaderPrecisionFormat_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  uniform4i_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "uniform4i", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static getShaderPrecisionFormat_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_getShaderPrecisionFormat_Callback";
-  getShaderPrecisionFormat_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => getShaderPrecisionFormat_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  uniform4i_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => Blink_JsNative_DomException.callMethod(mthis, "uniform4i", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4]);
 
-  static getShaderSource_Callback_0(mthis) native "WebGLRenderingContext_getShaderSource_Callback";
-  getShaderSource_Callback_0_(mthis) => getShaderSource_Callback_0(mthis);
+  uniform4iv_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "uniform4iv", []);
 
-  static getShaderSource_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_getShaderSource_Callback";
-  getShaderSource_Callback_1_(mthis, __arg_0) => getShaderSource_Callback_1(mthis, __arg_0);
+  uniform4iv_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "uniform4iv", [__arg_0]);
 
-  static getShaderSource_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_getShaderSource_Callback";
-  getShaderSource_Callback_2_(mthis, __arg_0, __arg_1) => getShaderSource_Callback_2(mthis, __arg_0, __arg_1);
+  uniform4iv_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "uniform4iv", [__arg_0, __arg_1]);
 
-  static getShaderSource_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_getShaderSource_Callback";
-  getShaderSource_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getShaderSource_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  uniformMatrix2fv_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "uniformMatrix2fv", [__arg_0]);
 
-  static getSupportedExtensions_Callback_0(mthis) native "WebGLRenderingContext_getSupportedExtensions_Callback";
-  getSupportedExtensions_Callback_0_(mthis) => getSupportedExtensions_Callback_0(mthis);
+  uniformMatrix2fv_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "uniformMatrix2fv", [__arg_0, __arg_1]);
 
-  static getSupportedExtensions_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_getSupportedExtensions_Callback";
-  getSupportedExtensions_Callback_1_(mthis, __arg_0) => getSupportedExtensions_Callback_1(mthis, __arg_0);
-
-  static getSupportedExtensions_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_getSupportedExtensions_Callback";
-  getSupportedExtensions_Callback_2_(mthis, __arg_0, __arg_1) => getSupportedExtensions_Callback_2(mthis, __arg_0, __arg_1);
-
-  static getTexParameter_Callback_0(mthis) native "WebGLRenderingContext_getTexParameter_Callback";
-  getTexParameter_Callback_0_(mthis) => getTexParameter_Callback_0(mthis);
-
-  static getTexParameter_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_getTexParameter_Callback";
-  getTexParameter_Callback_1_(mthis, __arg_0) => getTexParameter_Callback_1(mthis, __arg_0);
-
-  static getTexParameter_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_getTexParameter_Callback";
-  getTexParameter_Callback_2_(mthis, __arg_0, __arg_1) => getTexParameter_Callback_2(mthis, __arg_0, __arg_1);
-
-  static getTexParameter_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_getTexParameter_Callback";
-  getTexParameter_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getTexParameter_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static getTexParameter_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_getTexParameter_Callback";
-  getTexParameter_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => getTexParameter_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static getUniformLocation_Callback_0(mthis) native "WebGLRenderingContext_getUniformLocation_Callback";
-  getUniformLocation_Callback_0_(mthis) => getUniformLocation_Callback_0(mthis);
-
-  static getUniformLocation_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_getUniformLocation_Callback";
-  getUniformLocation_Callback_1_(mthis, __arg_0) => getUniformLocation_Callback_1(mthis, __arg_0);
-
-  static getUniformLocation_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_getUniformLocation_Callback";
-  getUniformLocation_Callback_2_(mthis, __arg_0, __arg_1) => getUniformLocation_Callback_2(mthis, __arg_0, __arg_1);
-
-  static getUniformLocation_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_getUniformLocation_Callback";
-  getUniformLocation_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getUniformLocation_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static getUniformLocation_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_getUniformLocation_Callback";
-  getUniformLocation_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => getUniformLocation_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static getUniform_Callback_0(mthis) native "WebGLRenderingContext_getUniform_Callback";
-  getUniform_Callback_0_(mthis) => getUniform_Callback_0(mthis);
-
-  static getUniform_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_getUniform_Callback";
-  getUniform_Callback_1_(mthis, __arg_0) => getUniform_Callback_1(mthis, __arg_0);
-
-  static getUniform_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_getUniform_Callback";
-  getUniform_Callback_2_(mthis, __arg_0, __arg_1) => getUniform_Callback_2(mthis, __arg_0, __arg_1);
-
-  static getUniform_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_getUniform_Callback";
-  getUniform_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getUniform_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static getUniform_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_getUniform_Callback";
-  getUniform_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => getUniform_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static getVertexAttribOffset_Callback_0(mthis) native "WebGLRenderingContext_getVertexAttribOffset_Callback";
-  getVertexAttribOffset_Callback_0_(mthis) => getVertexAttribOffset_Callback_0(mthis);
-
-  static getVertexAttribOffset_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_getVertexAttribOffset_Callback";
-  getVertexAttribOffset_Callback_1_(mthis, __arg_0) => getVertexAttribOffset_Callback_1(mthis, __arg_0);
-
-  static getVertexAttribOffset_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_getVertexAttribOffset_Callback";
-  getVertexAttribOffset_Callback_2_(mthis, __arg_0, __arg_1) => getVertexAttribOffset_Callback_2(mthis, __arg_0, __arg_1);
-
-  static getVertexAttribOffset_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_getVertexAttribOffset_Callback";
-  getVertexAttribOffset_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getVertexAttribOffset_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static getVertexAttribOffset_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_getVertexAttribOffset_Callback";
-  getVertexAttribOffset_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => getVertexAttribOffset_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static getVertexAttrib_Callback_0(mthis) native "WebGLRenderingContext_getVertexAttrib_Callback";
-  getVertexAttrib_Callback_0_(mthis) => getVertexAttrib_Callback_0(mthis);
-
-  static getVertexAttrib_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_getVertexAttrib_Callback";
-  getVertexAttrib_Callback_1_(mthis, __arg_0) => getVertexAttrib_Callback_1(mthis, __arg_0);
-
-  static getVertexAttrib_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_getVertexAttrib_Callback";
-  getVertexAttrib_Callback_2_(mthis, __arg_0, __arg_1) => getVertexAttrib_Callback_2(mthis, __arg_0, __arg_1);
-
-  static getVertexAttrib_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_getVertexAttrib_Callback";
-  getVertexAttrib_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getVertexAttrib_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static getVertexAttrib_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_getVertexAttrib_Callback";
-  getVertexAttrib_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => getVertexAttrib_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static hint_Callback_0(mthis) native "WebGLRenderingContext_hint_Callback";
-  hint_Callback_0_(mthis) => hint_Callback_0(mthis);
-
-  static hint_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_hint_Callback";
-  hint_Callback_1_(mthis, __arg_0) => hint_Callback_1(mthis, __arg_0);
-
-  static hint_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_hint_Callback";
-  hint_Callback_2_(mthis, __arg_0, __arg_1) => hint_Callback_2(mthis, __arg_0, __arg_1);
-
-  static hint_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_hint_Callback";
-  hint_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => hint_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static hint_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_hint_Callback";
-  hint_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => hint_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static isBuffer_Callback_0(mthis) native "WebGLRenderingContext_isBuffer_Callback";
-  isBuffer_Callback_0_(mthis) => isBuffer_Callback_0(mthis);
-
-  static isBuffer_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_isBuffer_Callback";
-  isBuffer_Callback_1_(mthis, __arg_0) => isBuffer_Callback_1(mthis, __arg_0);
-
-  static isBuffer_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_isBuffer_Callback";
-  isBuffer_Callback_2_(mthis, __arg_0, __arg_1) => isBuffer_Callback_2(mthis, __arg_0, __arg_1);
-
-  static isBuffer_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_isBuffer_Callback";
-  isBuffer_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => isBuffer_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static isContextLost_Callback_0(mthis) native "WebGLRenderingContext_isContextLost_Callback";
-  isContextLost_Callback_0_(mthis) => isContextLost_Callback_0(mthis);
-
-  static isContextLost_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_isContextLost_Callback";
-  isContextLost_Callback_1_(mthis, __arg_0) => isContextLost_Callback_1(mthis, __arg_0);
-
-  static isContextLost_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_isContextLost_Callback";
-  isContextLost_Callback_2_(mthis, __arg_0, __arg_1) => isContextLost_Callback_2(mthis, __arg_0, __arg_1);
-
-  static isEnabled_Callback_0(mthis) native "WebGLRenderingContext_isEnabled_Callback";
-  isEnabled_Callback_0_(mthis) => isEnabled_Callback_0(mthis);
-
-  static isEnabled_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_isEnabled_Callback";
-  isEnabled_Callback_1_(mthis, __arg_0) => isEnabled_Callback_1(mthis, __arg_0);
-
-  static isEnabled_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_isEnabled_Callback";
-  isEnabled_Callback_2_(mthis, __arg_0, __arg_1) => isEnabled_Callback_2(mthis, __arg_0, __arg_1);
-
-  static isEnabled_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_isEnabled_Callback";
-  isEnabled_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => isEnabled_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static isFramebuffer_Callback_0(mthis) native "WebGLRenderingContext_isFramebuffer_Callback";
-  isFramebuffer_Callback_0_(mthis) => isFramebuffer_Callback_0(mthis);
-
-  static isFramebuffer_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_isFramebuffer_Callback";
-  isFramebuffer_Callback_1_(mthis, __arg_0) => isFramebuffer_Callback_1(mthis, __arg_0);
-
-  static isFramebuffer_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_isFramebuffer_Callback";
-  isFramebuffer_Callback_2_(mthis, __arg_0, __arg_1) => isFramebuffer_Callback_2(mthis, __arg_0, __arg_1);
-
-  static isFramebuffer_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_isFramebuffer_Callback";
-  isFramebuffer_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => isFramebuffer_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static isProgram_Callback_0(mthis) native "WebGLRenderingContext_isProgram_Callback";
-  isProgram_Callback_0_(mthis) => isProgram_Callback_0(mthis);
-
-  static isProgram_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_isProgram_Callback";
-  isProgram_Callback_1_(mthis, __arg_0) => isProgram_Callback_1(mthis, __arg_0);
-
-  static isProgram_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_isProgram_Callback";
-  isProgram_Callback_2_(mthis, __arg_0, __arg_1) => isProgram_Callback_2(mthis, __arg_0, __arg_1);
-
-  static isProgram_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_isProgram_Callback";
-  isProgram_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => isProgram_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static isRenderbuffer_Callback_0(mthis) native "WebGLRenderingContext_isRenderbuffer_Callback";
-  isRenderbuffer_Callback_0_(mthis) => isRenderbuffer_Callback_0(mthis);
-
-  static isRenderbuffer_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_isRenderbuffer_Callback";
-  isRenderbuffer_Callback_1_(mthis, __arg_0) => isRenderbuffer_Callback_1(mthis, __arg_0);
-
-  static isRenderbuffer_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_isRenderbuffer_Callback";
-  isRenderbuffer_Callback_2_(mthis, __arg_0, __arg_1) => isRenderbuffer_Callback_2(mthis, __arg_0, __arg_1);
-
-  static isRenderbuffer_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_isRenderbuffer_Callback";
-  isRenderbuffer_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => isRenderbuffer_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static isShader_Callback_0(mthis) native "WebGLRenderingContext_isShader_Callback";
-  isShader_Callback_0_(mthis) => isShader_Callback_0(mthis);
-
-  static isShader_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_isShader_Callback";
-  isShader_Callback_1_(mthis, __arg_0) => isShader_Callback_1(mthis, __arg_0);
-
-  static isShader_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_isShader_Callback";
-  isShader_Callback_2_(mthis, __arg_0, __arg_1) => isShader_Callback_2(mthis, __arg_0, __arg_1);
-
-  static isShader_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_isShader_Callback";
-  isShader_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => isShader_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static isTexture_Callback_0(mthis) native "WebGLRenderingContext_isTexture_Callback";
-  isTexture_Callback_0_(mthis) => isTexture_Callback_0(mthis);
-
-  static isTexture_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_isTexture_Callback";
-  isTexture_Callback_1_(mthis, __arg_0) => isTexture_Callback_1(mthis, __arg_0);
-
-  static isTexture_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_isTexture_Callback";
-  isTexture_Callback_2_(mthis, __arg_0, __arg_1) => isTexture_Callback_2(mthis, __arg_0, __arg_1);
-
-  static isTexture_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_isTexture_Callback";
-  isTexture_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => isTexture_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static lineWidth_Callback_0(mthis) native "WebGLRenderingContext_lineWidth_Callback";
-  lineWidth_Callback_0_(mthis) => lineWidth_Callback_0(mthis);
-
-  static lineWidth_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_lineWidth_Callback";
-  lineWidth_Callback_1_(mthis, __arg_0) => lineWidth_Callback_1(mthis, __arg_0);
-
-  static lineWidth_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_lineWidth_Callback";
-  lineWidth_Callback_2_(mthis, __arg_0, __arg_1) => lineWidth_Callback_2(mthis, __arg_0, __arg_1);
-
-  static lineWidth_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_lineWidth_Callback";
-  lineWidth_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => lineWidth_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static linkProgram_Callback_0(mthis) native "WebGLRenderingContext_linkProgram_Callback";
-  linkProgram_Callback_0_(mthis) => linkProgram_Callback_0(mthis);
-
-  static linkProgram_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_linkProgram_Callback";
-  linkProgram_Callback_1_(mthis, __arg_0) => linkProgram_Callback_1(mthis, __arg_0);
-
-  static linkProgram_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_linkProgram_Callback";
-  linkProgram_Callback_2_(mthis, __arg_0, __arg_1) => linkProgram_Callback_2(mthis, __arg_0, __arg_1);
-
-  static linkProgram_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_linkProgram_Callback";
-  linkProgram_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => linkProgram_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static pixelStorei_Callback_0(mthis) native "WebGLRenderingContext_pixelStorei_Callback";
-  pixelStorei_Callback_0_(mthis) => pixelStorei_Callback_0(mthis);
-
-  static pixelStorei_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_pixelStorei_Callback";
-  pixelStorei_Callback_1_(mthis, __arg_0) => pixelStorei_Callback_1(mthis, __arg_0);
-
-  static pixelStorei_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_pixelStorei_Callback";
-  pixelStorei_Callback_2_(mthis, __arg_0, __arg_1) => pixelStorei_Callback_2(mthis, __arg_0, __arg_1);
-
-  static pixelStorei_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_pixelStorei_Callback";
-  pixelStorei_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => pixelStorei_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static pixelStorei_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_pixelStorei_Callback";
-  pixelStorei_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => pixelStorei_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static polygonOffset_Callback_0(mthis) native "WebGLRenderingContext_polygonOffset_Callback";
-  polygonOffset_Callback_0_(mthis) => polygonOffset_Callback_0(mthis);
-
-  static polygonOffset_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_polygonOffset_Callback";
-  polygonOffset_Callback_1_(mthis, __arg_0) => polygonOffset_Callback_1(mthis, __arg_0);
-
-  static polygonOffset_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_polygonOffset_Callback";
-  polygonOffset_Callback_2_(mthis, __arg_0, __arg_1) => polygonOffset_Callback_2(mthis, __arg_0, __arg_1);
-
-  static polygonOffset_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_polygonOffset_Callback";
-  polygonOffset_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => polygonOffset_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static polygonOffset_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_polygonOffset_Callback";
-  polygonOffset_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => polygonOffset_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static readPixels_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "WebGLRenderingContext_readPixels_Callback";
-  readPixels_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => readPixels_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
-
-  static readPixels_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "WebGLRenderingContext_readPixels_Callback";
-  readPixels_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => readPixels_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
-
-  static readPixels_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) native "WebGLRenderingContext_readPixels_Callback";
-  readPixels_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => readPixels_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6);
-
-  static readPixels_Callback_8(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) native "WebGLRenderingContext_readPixels_Callback";
-  readPixels_Callback_8_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) => readPixels_Callback_8(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7);
-
-  static readPixels_Callback_9(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8) native "WebGLRenderingContext_readPixels_Callback";
-  readPixels_Callback_9_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8) => readPixels_Callback_9(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8);
-
-  static renderbufferStorage_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_renderbufferStorage_Callback";
-  renderbufferStorage_Callback_2_(mthis, __arg_0, __arg_1) => renderbufferStorage_Callback_2(mthis, __arg_0, __arg_1);
-
-  static renderbufferStorage_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_renderbufferStorage_Callback";
-  renderbufferStorage_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => renderbufferStorage_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static renderbufferStorage_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_renderbufferStorage_Callback";
-  renderbufferStorage_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => renderbufferStorage_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static renderbufferStorage_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "WebGLRenderingContext_renderbufferStorage_Callback";
-  renderbufferStorage_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => renderbufferStorage_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
-
-  static renderbufferStorage_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "WebGLRenderingContext_renderbufferStorage_Callback";
-  renderbufferStorage_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => renderbufferStorage_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
-
-  static sampleCoverage_Callback_0(mthis) native "WebGLRenderingContext_sampleCoverage_Callback";
-  sampleCoverage_Callback_0_(mthis) => sampleCoverage_Callback_0(mthis);
-
-  static sampleCoverage_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_sampleCoverage_Callback";
-  sampleCoverage_Callback_1_(mthis, __arg_0) => sampleCoverage_Callback_1(mthis, __arg_0);
-
-  static sampleCoverage_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_sampleCoverage_Callback";
-  sampleCoverage_Callback_2_(mthis, __arg_0, __arg_1) => sampleCoverage_Callback_2(mthis, __arg_0, __arg_1);
-
-  static sampleCoverage_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_sampleCoverage_Callback";
-  sampleCoverage_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => sampleCoverage_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static sampleCoverage_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_sampleCoverage_Callback";
-  sampleCoverage_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => sampleCoverage_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static scissor_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_scissor_Callback";
-  scissor_Callback_2_(mthis, __arg_0, __arg_1) => scissor_Callback_2(mthis, __arg_0, __arg_1);
-
-  static scissor_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_scissor_Callback";
-  scissor_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => scissor_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static scissor_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_scissor_Callback";
-  scissor_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => scissor_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static scissor_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "WebGLRenderingContext_scissor_Callback";
-  scissor_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => scissor_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
-
-  static scissor_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "WebGLRenderingContext_scissor_Callback";
-  scissor_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => scissor_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
-
-  static shaderSource_Callback_0(mthis) native "WebGLRenderingContext_shaderSource_Callback";
-  shaderSource_Callback_0_(mthis) => shaderSource_Callback_0(mthis);
-
-  static shaderSource_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_shaderSource_Callback";
-  shaderSource_Callback_1_(mthis, __arg_0) => shaderSource_Callback_1(mthis, __arg_0);
-
-  static shaderSource_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_shaderSource_Callback";
-  shaderSource_Callback_2_(mthis, __arg_0, __arg_1) => shaderSource_Callback_2(mthis, __arg_0, __arg_1);
-
-  static shaderSource_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_shaderSource_Callback";
-  shaderSource_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => shaderSource_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static shaderSource_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_shaderSource_Callback";
-  shaderSource_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => shaderSource_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static stencilFuncSeparate_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_stencilFuncSeparate_Callback";
-  stencilFuncSeparate_Callback_2_(mthis, __arg_0, __arg_1) => stencilFuncSeparate_Callback_2(mthis, __arg_0, __arg_1);
-
-  static stencilFuncSeparate_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_stencilFuncSeparate_Callback";
-  stencilFuncSeparate_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => stencilFuncSeparate_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static stencilFuncSeparate_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_stencilFuncSeparate_Callback";
-  stencilFuncSeparate_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => stencilFuncSeparate_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static stencilFuncSeparate_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "WebGLRenderingContext_stencilFuncSeparate_Callback";
-  stencilFuncSeparate_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => stencilFuncSeparate_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
-
-  static stencilFuncSeparate_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "WebGLRenderingContext_stencilFuncSeparate_Callback";
-  stencilFuncSeparate_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => stencilFuncSeparate_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
-
-  static stencilFunc_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_stencilFunc_Callback";
-  stencilFunc_Callback_1_(mthis, __arg_0) => stencilFunc_Callback_1(mthis, __arg_0);
-
-  static stencilFunc_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_stencilFunc_Callback";
-  stencilFunc_Callback_2_(mthis, __arg_0, __arg_1) => stencilFunc_Callback_2(mthis, __arg_0, __arg_1);
-
-  static stencilFunc_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_stencilFunc_Callback";
-  stencilFunc_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => stencilFunc_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static stencilFunc_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_stencilFunc_Callback";
-  stencilFunc_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => stencilFunc_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static stencilFunc_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "WebGLRenderingContext_stencilFunc_Callback";
-  stencilFunc_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => stencilFunc_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
-
-  static stencilMaskSeparate_Callback_0(mthis) native "WebGLRenderingContext_stencilMaskSeparate_Callback";
-  stencilMaskSeparate_Callback_0_(mthis) => stencilMaskSeparate_Callback_0(mthis);
-
-  static stencilMaskSeparate_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_stencilMaskSeparate_Callback";
-  stencilMaskSeparate_Callback_1_(mthis, __arg_0) => stencilMaskSeparate_Callback_1(mthis, __arg_0);
-
-  static stencilMaskSeparate_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_stencilMaskSeparate_Callback";
-  stencilMaskSeparate_Callback_2_(mthis, __arg_0, __arg_1) => stencilMaskSeparate_Callback_2(mthis, __arg_0, __arg_1);
-
-  static stencilMaskSeparate_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_stencilMaskSeparate_Callback";
-  stencilMaskSeparate_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => stencilMaskSeparate_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static stencilMaskSeparate_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_stencilMaskSeparate_Callback";
-  stencilMaskSeparate_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => stencilMaskSeparate_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static stencilMask_Callback_0(mthis) native "WebGLRenderingContext_stencilMask_Callback";
-  stencilMask_Callback_0_(mthis) => stencilMask_Callback_0(mthis);
-
-  static stencilMask_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_stencilMask_Callback";
-  stencilMask_Callback_1_(mthis, __arg_0) => stencilMask_Callback_1(mthis, __arg_0);
-
-  static stencilMask_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_stencilMask_Callback";
-  stencilMask_Callback_2_(mthis, __arg_0, __arg_1) => stencilMask_Callback_2(mthis, __arg_0, __arg_1);
-
-  static stencilMask_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_stencilMask_Callback";
-  stencilMask_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => stencilMask_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static stencilOpSeparate_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_stencilOpSeparate_Callback";
-  stencilOpSeparate_Callback_2_(mthis, __arg_0, __arg_1) => stencilOpSeparate_Callback_2(mthis, __arg_0, __arg_1);
-
-  static stencilOpSeparate_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_stencilOpSeparate_Callback";
-  stencilOpSeparate_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => stencilOpSeparate_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static stencilOpSeparate_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_stencilOpSeparate_Callback";
-  stencilOpSeparate_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => stencilOpSeparate_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static stencilOpSeparate_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "WebGLRenderingContext_stencilOpSeparate_Callback";
-  stencilOpSeparate_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => stencilOpSeparate_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
-
-  static stencilOpSeparate_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "WebGLRenderingContext_stencilOpSeparate_Callback";
-  stencilOpSeparate_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => stencilOpSeparate_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
-
-  static stencilOp_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_stencilOp_Callback";
-  stencilOp_Callback_1_(mthis, __arg_0) => stencilOp_Callback_1(mthis, __arg_0);
-
-  static stencilOp_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_stencilOp_Callback";
-  stencilOp_Callback_2_(mthis, __arg_0, __arg_1) => stencilOp_Callback_2(mthis, __arg_0, __arg_1);
-
-  static stencilOp_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_stencilOp_Callback";
-  stencilOp_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => stencilOp_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static stencilOp_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_stencilOp_Callback";
-  stencilOp_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => stencilOp_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static stencilOp_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "WebGLRenderingContext_stencilOp_Callback";
-  stencilOp_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => stencilOp_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
-
-  static texImage2D_Callback_10(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9) native "WebGLRenderingContext_texImage2D_Callback";
-  texImage2D_Callback_10_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9) => texImage2D_Callback_10(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9);
-
-  static texImage2D_Callback_11(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10) native "WebGLRenderingContext_texImage2D_Callback";
-  texImage2D_Callback_11_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10) => texImage2D_Callback_11(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10);
-
-  static texImage2D_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_texImage2D_Callback";
-  texImage2D_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => texImage2D_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static texImage2D_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "WebGLRenderingContext_texImage2D_Callback";
-  texImage2D_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => texImage2D_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
-
-  static texImage2D_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "WebGLRenderingContext_texImage2D_Callback";
-  texImage2D_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => texImage2D_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
-
-  static texImage2D_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) native "WebGLRenderingContext_texImage2D_Callback";
-  texImage2D_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => texImage2D_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6);
-
-  static texImage2D_Callback_8(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) native "WebGLRenderingContext_texImage2D_Callback";
-  texImage2D_Callback_8_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) => texImage2D_Callback_8(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7);
-
-  static texImage2D_Callback_9(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8) native "WebGLRenderingContext_texImage2D_Callback";
-  texImage2D_Callback_9_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8) => texImage2D_Callback_9(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8);
-
-  static texParameterf_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_texParameterf_Callback";
-  texParameterf_Callback_1_(mthis, __arg_0) => texParameterf_Callback_1(mthis, __arg_0);
-
-  static texParameterf_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_texParameterf_Callback";
-  texParameterf_Callback_2_(mthis, __arg_0, __arg_1) => texParameterf_Callback_2(mthis, __arg_0, __arg_1);
-
-  static texParameterf_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_texParameterf_Callback";
-  texParameterf_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => texParameterf_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static texParameterf_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_texParameterf_Callback";
-  texParameterf_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => texParameterf_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static texParameterf_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "WebGLRenderingContext_texParameterf_Callback";
-  texParameterf_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => texParameterf_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
-
-  static texParameteri_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_texParameteri_Callback";
-  texParameteri_Callback_1_(mthis, __arg_0) => texParameteri_Callback_1(mthis, __arg_0);
-
-  static texParameteri_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_texParameteri_Callback";
-  texParameteri_Callback_2_(mthis, __arg_0, __arg_1) => texParameteri_Callback_2(mthis, __arg_0, __arg_1);
-
-  static texParameteri_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_texParameteri_Callback";
-  texParameteri_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => texParameteri_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static texParameteri_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_texParameteri_Callback";
-  texParameteri_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => texParameteri_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static texParameteri_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "WebGLRenderingContext_texParameteri_Callback";
-  texParameteri_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => texParameteri_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
-
-  static texSubImage2D_Callback_10(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9) native "WebGLRenderingContext_texSubImage2D_Callback";
-  texSubImage2D_Callback_10_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9) => texSubImage2D_Callback_10(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9);
-
-  static texSubImage2D_Callback_11(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10) native "WebGLRenderingContext_texSubImage2D_Callback";
-  texSubImage2D_Callback_11_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10) => texSubImage2D_Callback_11(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8, __arg_9, __arg_10);
-
-  static texSubImage2D_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "WebGLRenderingContext_texSubImage2D_Callback";
-  texSubImage2D_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => texSubImage2D_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
-
-  static texSubImage2D_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "WebGLRenderingContext_texSubImage2D_Callback";
-  texSubImage2D_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => texSubImage2D_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
-
-  static texSubImage2D_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) native "WebGLRenderingContext_texSubImage2D_Callback";
-  texSubImage2D_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => texSubImage2D_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6);
-
-  static texSubImage2D_Callback_8(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) native "WebGLRenderingContext_texSubImage2D_Callback";
-  texSubImage2D_Callback_8_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) => texSubImage2D_Callback_8(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7);
-
-  static texSubImage2D_Callback_9(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8) native "WebGLRenderingContext_texSubImage2D_Callback";
-  texSubImage2D_Callback_9_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8) => texSubImage2D_Callback_9(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8);
-
-  static uniform1f_Callback_0(mthis) native "WebGLRenderingContext_uniform1f_Callback";
-  uniform1f_Callback_0_(mthis) => uniform1f_Callback_0(mthis);
-
-  static uniform1f_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_uniform1f_Callback";
-  uniform1f_Callback_1_(mthis, __arg_0) => uniform1f_Callback_1(mthis, __arg_0);
-
-  static uniform1f_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_uniform1f_Callback";
-  uniform1f_Callback_2_(mthis, __arg_0, __arg_1) => uniform1f_Callback_2(mthis, __arg_0, __arg_1);
-
-  static uniform1f_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_uniform1f_Callback";
-  uniform1f_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => uniform1f_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static uniform1f_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_uniform1f_Callback";
-  uniform1f_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => uniform1f_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static uniform1fv_Callback_0(mthis) native "WebGLRenderingContext_uniform1fv_Callback";
-  uniform1fv_Callback_0_(mthis) => uniform1fv_Callback_0(mthis);
-
-  static uniform1fv_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_uniform1fv_Callback";
-  uniform1fv_Callback_1_(mthis, __arg_0) => uniform1fv_Callback_1(mthis, __arg_0);
-
-  static uniform1fv_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_uniform1fv_Callback";
-  uniform1fv_Callback_2_(mthis, __arg_0, __arg_1) => uniform1fv_Callback_2(mthis, __arg_0, __arg_1);
-
-  static uniform1fv_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_uniform1fv_Callback";
-  uniform1fv_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => uniform1fv_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static uniform1fv_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_uniform1fv_Callback";
-  uniform1fv_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => uniform1fv_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static uniform1i_Callback_0(mthis) native "WebGLRenderingContext_uniform1i_Callback";
-  uniform1i_Callback_0_(mthis) => uniform1i_Callback_0(mthis);
-
-  static uniform1i_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_uniform1i_Callback";
-  uniform1i_Callback_1_(mthis, __arg_0) => uniform1i_Callback_1(mthis, __arg_0);
-
-  static uniform1i_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_uniform1i_Callback";
-  uniform1i_Callback_2_(mthis, __arg_0, __arg_1) => uniform1i_Callback_2(mthis, __arg_0, __arg_1);
-
-  static uniform1i_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_uniform1i_Callback";
-  uniform1i_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => uniform1i_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static uniform1i_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_uniform1i_Callback";
-  uniform1i_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => uniform1i_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static uniform1iv_Callback_0(mthis) native "WebGLRenderingContext_uniform1iv_Callback";
-  uniform1iv_Callback_0_(mthis) => uniform1iv_Callback_0(mthis);
-
-  static uniform1iv_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_uniform1iv_Callback";
-  uniform1iv_Callback_1_(mthis, __arg_0) => uniform1iv_Callback_1(mthis, __arg_0);
-
-  static uniform1iv_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_uniform1iv_Callback";
-  uniform1iv_Callback_2_(mthis, __arg_0, __arg_1) => uniform1iv_Callback_2(mthis, __arg_0, __arg_1);
-
-  static uniform1iv_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_uniform1iv_Callback";
-  uniform1iv_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => uniform1iv_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static uniform1iv_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_uniform1iv_Callback";
-  uniform1iv_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => uniform1iv_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static uniform2f_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_uniform2f_Callback";
-  uniform2f_Callback_1_(mthis, __arg_0) => uniform2f_Callback_1(mthis, __arg_0);
-
-  static uniform2f_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_uniform2f_Callback";
-  uniform2f_Callback_2_(mthis, __arg_0, __arg_1) => uniform2f_Callback_2(mthis, __arg_0, __arg_1);
-
-  static uniform2f_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_uniform2f_Callback";
-  uniform2f_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => uniform2f_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static uniform2f_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_uniform2f_Callback";
-  uniform2f_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => uniform2f_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static uniform2f_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "WebGLRenderingContext_uniform2f_Callback";
-  uniform2f_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => uniform2f_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
-
-  static uniform2fv_Callback_0(mthis) native "WebGLRenderingContext_uniform2fv_Callback";
-  uniform2fv_Callback_0_(mthis) => uniform2fv_Callback_0(mthis);
-
-  static uniform2fv_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_uniform2fv_Callback";
-  uniform2fv_Callback_1_(mthis, __arg_0) => uniform2fv_Callback_1(mthis, __arg_0);
-
-  static uniform2fv_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_uniform2fv_Callback";
-  uniform2fv_Callback_2_(mthis, __arg_0, __arg_1) => uniform2fv_Callback_2(mthis, __arg_0, __arg_1);
-
-  static uniform2fv_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_uniform2fv_Callback";
-  uniform2fv_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => uniform2fv_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static uniform2fv_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_uniform2fv_Callback";
-  uniform2fv_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => uniform2fv_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static uniform2i_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_uniform2i_Callback";
-  uniform2i_Callback_1_(mthis, __arg_0) => uniform2i_Callback_1(mthis, __arg_0);
-
-  static uniform2i_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_uniform2i_Callback";
-  uniform2i_Callback_2_(mthis, __arg_0, __arg_1) => uniform2i_Callback_2(mthis, __arg_0, __arg_1);
-
-  static uniform2i_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_uniform2i_Callback";
-  uniform2i_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => uniform2i_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static uniform2i_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_uniform2i_Callback";
-  uniform2i_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => uniform2i_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static uniform2i_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "WebGLRenderingContext_uniform2i_Callback";
-  uniform2i_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => uniform2i_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
-
-  static uniform2iv_Callback_0(mthis) native "WebGLRenderingContext_uniform2iv_Callback";
-  uniform2iv_Callback_0_(mthis) => uniform2iv_Callback_0(mthis);
-
-  static uniform2iv_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_uniform2iv_Callback";
-  uniform2iv_Callback_1_(mthis, __arg_0) => uniform2iv_Callback_1(mthis, __arg_0);
-
-  static uniform2iv_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_uniform2iv_Callback";
-  uniform2iv_Callback_2_(mthis, __arg_0, __arg_1) => uniform2iv_Callback_2(mthis, __arg_0, __arg_1);
-
-  static uniform2iv_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_uniform2iv_Callback";
-  uniform2iv_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => uniform2iv_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static uniform2iv_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_uniform2iv_Callback";
-  uniform2iv_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => uniform2iv_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static uniform3f_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_uniform3f_Callback";
-  uniform3f_Callback_2_(mthis, __arg_0, __arg_1) => uniform3f_Callback_2(mthis, __arg_0, __arg_1);
-
-  static uniform3f_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_uniform3f_Callback";
-  uniform3f_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => uniform3f_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static uniform3f_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_uniform3f_Callback";
-  uniform3f_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => uniform3f_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static uniform3f_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "WebGLRenderingContext_uniform3f_Callback";
-  uniform3f_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => uniform3f_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
-
-  static uniform3f_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "WebGLRenderingContext_uniform3f_Callback";
-  uniform3f_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => uniform3f_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
-
-  static uniform3fv_Callback_0(mthis) native "WebGLRenderingContext_uniform3fv_Callback";
-  uniform3fv_Callback_0_(mthis) => uniform3fv_Callback_0(mthis);
-
-  static uniform3fv_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_uniform3fv_Callback";
-  uniform3fv_Callback_1_(mthis, __arg_0) => uniform3fv_Callback_1(mthis, __arg_0);
-
-  static uniform3fv_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_uniform3fv_Callback";
-  uniform3fv_Callback_2_(mthis, __arg_0, __arg_1) => uniform3fv_Callback_2(mthis, __arg_0, __arg_1);
-
-  static uniform3fv_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_uniform3fv_Callback";
-  uniform3fv_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => uniform3fv_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static uniform3fv_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_uniform3fv_Callback";
-  uniform3fv_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => uniform3fv_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static uniform3i_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_uniform3i_Callback";
-  uniform3i_Callback_2_(mthis, __arg_0, __arg_1) => uniform3i_Callback_2(mthis, __arg_0, __arg_1);
-
-  static uniform3i_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_uniform3i_Callback";
-  uniform3i_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => uniform3i_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static uniform3i_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_uniform3i_Callback";
-  uniform3i_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => uniform3i_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static uniform3i_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "WebGLRenderingContext_uniform3i_Callback";
-  uniform3i_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => uniform3i_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
-
-  static uniform3i_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "WebGLRenderingContext_uniform3i_Callback";
-  uniform3i_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => uniform3i_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
-
-  static uniform3iv_Callback_0(mthis) native "WebGLRenderingContext_uniform3iv_Callback";
-  uniform3iv_Callback_0_(mthis) => uniform3iv_Callback_0(mthis);
-
-  static uniform3iv_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_uniform3iv_Callback";
-  uniform3iv_Callback_1_(mthis, __arg_0) => uniform3iv_Callback_1(mthis, __arg_0);
-
-  static uniform3iv_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_uniform3iv_Callback";
-  uniform3iv_Callback_2_(mthis, __arg_0, __arg_1) => uniform3iv_Callback_2(mthis, __arg_0, __arg_1);
-
-  static uniform3iv_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_uniform3iv_Callback";
-  uniform3iv_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => uniform3iv_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static uniform3iv_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_uniform3iv_Callback";
-  uniform3iv_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => uniform3iv_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static uniform4f_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_uniform4f_Callback";
-  uniform4f_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => uniform4f_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static uniform4f_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_uniform4f_Callback";
-  uniform4f_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => uniform4f_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static uniform4f_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "WebGLRenderingContext_uniform4f_Callback";
-  uniform4f_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => uniform4f_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
-
-  static uniform4f_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "WebGLRenderingContext_uniform4f_Callback";
-  uniform4f_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => uniform4f_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
-
-  static uniform4f_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) native "WebGLRenderingContext_uniform4f_Callback";
-  uniform4f_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => uniform4f_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6);
-
-  static uniform4fv_Callback_0(mthis) native "WebGLRenderingContext_uniform4fv_Callback";
-  uniform4fv_Callback_0_(mthis) => uniform4fv_Callback_0(mthis);
-
-  static uniform4fv_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_uniform4fv_Callback";
-  uniform4fv_Callback_1_(mthis, __arg_0) => uniform4fv_Callback_1(mthis, __arg_0);
-
-  static uniform4fv_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_uniform4fv_Callback";
-  uniform4fv_Callback_2_(mthis, __arg_0, __arg_1) => uniform4fv_Callback_2(mthis, __arg_0, __arg_1);
-
-  static uniform4fv_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_uniform4fv_Callback";
-  uniform4fv_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => uniform4fv_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static uniform4fv_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_uniform4fv_Callback";
-  uniform4fv_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => uniform4fv_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static uniform4i_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_uniform4i_Callback";
-  uniform4i_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => uniform4i_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static uniform4i_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_uniform4i_Callback";
-  uniform4i_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => uniform4i_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static uniform4i_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "WebGLRenderingContext_uniform4i_Callback";
-  uniform4i_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => uniform4i_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
-
-  static uniform4i_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "WebGLRenderingContext_uniform4i_Callback";
-  uniform4i_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => uniform4i_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
-
-  static uniform4i_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) native "WebGLRenderingContext_uniform4i_Callback";
-  uniform4i_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => uniform4i_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6);
-
-  static uniform4iv_Callback_0(mthis) native "WebGLRenderingContext_uniform4iv_Callback";
-  uniform4iv_Callback_0_(mthis) => uniform4iv_Callback_0(mthis);
-
-  static uniform4iv_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_uniform4iv_Callback";
-  uniform4iv_Callback_1_(mthis, __arg_0) => uniform4iv_Callback_1(mthis, __arg_0);
-
-  static uniform4iv_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_uniform4iv_Callback";
-  uniform4iv_Callback_2_(mthis, __arg_0, __arg_1) => uniform4iv_Callback_2(mthis, __arg_0, __arg_1);
-
-  static uniform4iv_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_uniform4iv_Callback";
-  uniform4iv_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => uniform4iv_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static uniform4iv_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_uniform4iv_Callback";
-  uniform4iv_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => uniform4iv_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static uniformMatrix2fv_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_uniformMatrix2fv_Callback";
-  uniformMatrix2fv_Callback_1_(mthis, __arg_0) => uniformMatrix2fv_Callback_1(mthis, __arg_0);
-
-  static uniformMatrix2fv_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_uniformMatrix2fv_Callback";
-  uniformMatrix2fv_Callback_2_(mthis, __arg_0, __arg_1) => uniformMatrix2fv_Callback_2(mthis, __arg_0, __arg_1);
-
-  static uniformMatrix2fv_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_uniformMatrix2fv_Callback";
-  uniformMatrix2fv_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => uniformMatrix2fv_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static uniformMatrix2fv_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_uniformMatrix2fv_Callback";
-  uniformMatrix2fv_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => uniformMatrix2fv_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static uniformMatrix2fv_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "WebGLRenderingContext_uniformMatrix2fv_Callback";
-  uniformMatrix2fv_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => uniformMatrix2fv_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
-
-  static uniformMatrix3fv_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_uniformMatrix3fv_Callback";
-  uniformMatrix3fv_Callback_1_(mthis, __arg_0) => uniformMatrix3fv_Callback_1(mthis, __arg_0);
-
-  static uniformMatrix3fv_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_uniformMatrix3fv_Callback";
-  uniformMatrix3fv_Callback_2_(mthis, __arg_0, __arg_1) => uniformMatrix3fv_Callback_2(mthis, __arg_0, __arg_1);
-
-  static uniformMatrix3fv_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_uniformMatrix3fv_Callback";
-  uniformMatrix3fv_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => uniformMatrix3fv_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static uniformMatrix3fv_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_uniformMatrix3fv_Callback";
-  uniformMatrix3fv_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => uniformMatrix3fv_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static uniformMatrix3fv_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "WebGLRenderingContext_uniformMatrix3fv_Callback";
-  uniformMatrix3fv_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => uniformMatrix3fv_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
-
-  static uniformMatrix4fv_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_uniformMatrix4fv_Callback";
-  uniformMatrix4fv_Callback_1_(mthis, __arg_0) => uniformMatrix4fv_Callback_1(mthis, __arg_0);
-
-  static uniformMatrix4fv_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_uniformMatrix4fv_Callback";
-  uniformMatrix4fv_Callback_2_(mthis, __arg_0, __arg_1) => uniformMatrix4fv_Callback_2(mthis, __arg_0, __arg_1);
-
-  static uniformMatrix4fv_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_uniformMatrix4fv_Callback";
-  uniformMatrix4fv_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => uniformMatrix4fv_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static uniformMatrix4fv_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_uniformMatrix4fv_Callback";
-  uniformMatrix4fv_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => uniformMatrix4fv_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static uniformMatrix4fv_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "WebGLRenderingContext_uniformMatrix4fv_Callback";
-  uniformMatrix4fv_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => uniformMatrix4fv_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
-
-  static useProgram_Callback_0(mthis) native "WebGLRenderingContext_useProgram_Callback";
-  useProgram_Callback_0_(mthis) => useProgram_Callback_0(mthis);
-
-  static useProgram_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_useProgram_Callback";
-  useProgram_Callback_1_(mthis, __arg_0) => useProgram_Callback_1(mthis, __arg_0);
-
-  static useProgram_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_useProgram_Callback";
-  useProgram_Callback_2_(mthis, __arg_0, __arg_1) => useProgram_Callback_2(mthis, __arg_0, __arg_1);
-
-  static useProgram_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_useProgram_Callback";
-  useProgram_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => useProgram_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static validateProgram_Callback_0(mthis) native "WebGLRenderingContext_validateProgram_Callback";
-  validateProgram_Callback_0_(mthis) => validateProgram_Callback_0(mthis);
-
-  static validateProgram_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_validateProgram_Callback";
-  validateProgram_Callback_1_(mthis, __arg_0) => validateProgram_Callback_1(mthis, __arg_0);
-
-  static validateProgram_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_validateProgram_Callback";
-  validateProgram_Callback_2_(mthis, __arg_0, __arg_1) => validateProgram_Callback_2(mthis, __arg_0, __arg_1);
-
-  static validateProgram_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_validateProgram_Callback";
-  validateProgram_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => validateProgram_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static vertexAttrib1f_Callback_0(mthis) native "WebGLRenderingContext_vertexAttrib1f_Callback";
-  vertexAttrib1f_Callback_0_(mthis) => vertexAttrib1f_Callback_0(mthis);
-
-  static vertexAttrib1f_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_vertexAttrib1f_Callback";
-  vertexAttrib1f_Callback_1_(mthis, __arg_0) => vertexAttrib1f_Callback_1(mthis, __arg_0);
-
-  static vertexAttrib1f_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_vertexAttrib1f_Callback";
-  vertexAttrib1f_Callback_2_(mthis, __arg_0, __arg_1) => vertexAttrib1f_Callback_2(mthis, __arg_0, __arg_1);
-
-  static vertexAttrib1f_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_vertexAttrib1f_Callback";
-  vertexAttrib1f_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => vertexAttrib1f_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static vertexAttrib1f_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_vertexAttrib1f_Callback";
-  vertexAttrib1f_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => vertexAttrib1f_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static vertexAttrib1fv_Callback_0(mthis) native "WebGLRenderingContext_vertexAttrib1fv_Callback";
-  vertexAttrib1fv_Callback_0_(mthis) => vertexAttrib1fv_Callback_0(mthis);
-
-  static vertexAttrib1fv_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_vertexAttrib1fv_Callback";
-  vertexAttrib1fv_Callback_1_(mthis, __arg_0) => vertexAttrib1fv_Callback_1(mthis, __arg_0);
-
-  static vertexAttrib1fv_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_vertexAttrib1fv_Callback";
-  vertexAttrib1fv_Callback_2_(mthis, __arg_0, __arg_1) => vertexAttrib1fv_Callback_2(mthis, __arg_0, __arg_1);
-
-  static vertexAttrib1fv_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_vertexAttrib1fv_Callback";
-  vertexAttrib1fv_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => vertexAttrib1fv_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static vertexAttrib1fv_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_vertexAttrib1fv_Callback";
-  vertexAttrib1fv_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => vertexAttrib1fv_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  uniformMatrix2fv_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "uniformMatrix2fv", [__arg_0, __arg_1, __arg_2]);
 
-  static vertexAttrib2f_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_vertexAttrib2f_Callback";
-  vertexAttrib2f_Callback_1_(mthis, __arg_0) => vertexAttrib2f_Callback_1(mthis, __arg_0);
+  uniformMatrix3fv_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "uniformMatrix3fv", [__arg_0]);
 
-  static vertexAttrib2f_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_vertexAttrib2f_Callback";
-  vertexAttrib2f_Callback_2_(mthis, __arg_0, __arg_1) => vertexAttrib2f_Callback_2(mthis, __arg_0, __arg_1);
+  uniformMatrix3fv_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "uniformMatrix3fv", [__arg_0, __arg_1]);
 
-  static vertexAttrib2f_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_vertexAttrib2f_Callback";
-  vertexAttrib2f_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => vertexAttrib2f_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  uniformMatrix3fv_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "uniformMatrix3fv", [__arg_0, __arg_1, __arg_2]);
 
-  static vertexAttrib2f_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_vertexAttrib2f_Callback";
-  vertexAttrib2f_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => vertexAttrib2f_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  uniformMatrix4fv_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "uniformMatrix4fv", [__arg_0]);
 
-  static vertexAttrib2f_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "WebGLRenderingContext_vertexAttrib2f_Callback";
-  vertexAttrib2f_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => vertexAttrib2f_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  uniformMatrix4fv_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "uniformMatrix4fv", [__arg_0, __arg_1]);
 
-  static vertexAttrib2fv_Callback_0(mthis) native "WebGLRenderingContext_vertexAttrib2fv_Callback";
-  vertexAttrib2fv_Callback_0_(mthis) => vertexAttrib2fv_Callback_0(mthis);
+  uniformMatrix4fv_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "uniformMatrix4fv", [__arg_0, __arg_1, __arg_2]);
 
-  static vertexAttrib2fv_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_vertexAttrib2fv_Callback";
-  vertexAttrib2fv_Callback_1_(mthis, __arg_0) => vertexAttrib2fv_Callback_1(mthis, __arg_0);
+  useProgram_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "useProgram", []);
 
-  static vertexAttrib2fv_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_vertexAttrib2fv_Callback";
-  vertexAttrib2fv_Callback_2_(mthis, __arg_0, __arg_1) => vertexAttrib2fv_Callback_2(mthis, __arg_0, __arg_1);
+  useProgram_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "useProgram", [__arg_0]);
 
-  static vertexAttrib2fv_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_vertexAttrib2fv_Callback";
-  vertexAttrib2fv_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => vertexAttrib2fv_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  validateProgram_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "validateProgram", []);
 
-  static vertexAttrib2fv_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_vertexAttrib2fv_Callback";
-  vertexAttrib2fv_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => vertexAttrib2fv_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  validateProgram_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "validateProgram", [__arg_0]);
 
-  static vertexAttrib3f_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_vertexAttrib3f_Callback";
-  vertexAttrib3f_Callback_2_(mthis, __arg_0, __arg_1) => vertexAttrib3f_Callback_2(mthis, __arg_0, __arg_1);
+  vertexAttrib1f_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "vertexAttrib1f", []);
 
-  static vertexAttrib3f_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_vertexAttrib3f_Callback";
-  vertexAttrib3f_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => vertexAttrib3f_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  vertexAttrib1f_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "vertexAttrib1f", [__arg_0]);
 
-  static vertexAttrib3f_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_vertexAttrib3f_Callback";
-  vertexAttrib3f_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => vertexAttrib3f_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  vertexAttrib1f_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "vertexAttrib1f", [__arg_0, __arg_1]);
 
-  static vertexAttrib3f_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "WebGLRenderingContext_vertexAttrib3f_Callback";
-  vertexAttrib3f_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => vertexAttrib3f_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  vertexAttrib1fv_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "vertexAttrib1fv", []);
 
-  static vertexAttrib3f_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "WebGLRenderingContext_vertexAttrib3f_Callback";
-  vertexAttrib3f_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => vertexAttrib3f_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  vertexAttrib1fv_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "vertexAttrib1fv", [__arg_0]);
 
-  static vertexAttrib3fv_Callback_0(mthis) native "WebGLRenderingContext_vertexAttrib3fv_Callback";
-  vertexAttrib3fv_Callback_0_(mthis) => vertexAttrib3fv_Callback_0(mthis);
+  vertexAttrib1fv_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "vertexAttrib1fv", [__arg_0, __arg_1]);
 
-  static vertexAttrib3fv_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_vertexAttrib3fv_Callback";
-  vertexAttrib3fv_Callback_1_(mthis, __arg_0) => vertexAttrib3fv_Callback_1(mthis, __arg_0);
+  vertexAttrib2f_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "vertexAttrib2f", [__arg_0]);
 
-  static vertexAttrib3fv_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_vertexAttrib3fv_Callback";
-  vertexAttrib3fv_Callback_2_(mthis, __arg_0, __arg_1) => vertexAttrib3fv_Callback_2(mthis, __arg_0, __arg_1);
+  vertexAttrib2f_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "vertexAttrib2f", [__arg_0, __arg_1]);
 
-  static vertexAttrib3fv_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_vertexAttrib3fv_Callback";
-  vertexAttrib3fv_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => vertexAttrib3fv_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  vertexAttrib2f_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "vertexAttrib2f", [__arg_0, __arg_1, __arg_2]);
 
-  static vertexAttrib3fv_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_vertexAttrib3fv_Callback";
-  vertexAttrib3fv_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => vertexAttrib3fv_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  vertexAttrib2fv_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "vertexAttrib2fv", []);
 
-  static vertexAttrib4f_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_vertexAttrib4f_Callback";
-  vertexAttrib4f_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => vertexAttrib4f_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  vertexAttrib2fv_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "vertexAttrib2fv", [__arg_0]);
 
-  static vertexAttrib4f_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_vertexAttrib4f_Callback";
-  vertexAttrib4f_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => vertexAttrib4f_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  vertexAttrib2fv_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "vertexAttrib2fv", [__arg_0, __arg_1]);
 
-  static vertexAttrib4f_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "WebGLRenderingContext_vertexAttrib4f_Callback";
-  vertexAttrib4f_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => vertexAttrib4f_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  vertexAttrib3f_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "vertexAttrib3f", [__arg_0, __arg_1]);
 
-  static vertexAttrib4f_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "WebGLRenderingContext_vertexAttrib4f_Callback";
-  vertexAttrib4f_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => vertexAttrib4f_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  vertexAttrib3f_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "vertexAttrib3f", [__arg_0, __arg_1, __arg_2]);
 
-  static vertexAttrib4f_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) native "WebGLRenderingContext_vertexAttrib4f_Callback";
-  vertexAttrib4f_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => vertexAttrib4f_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6);
+  vertexAttrib3f_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "vertexAttrib3f", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static vertexAttrib4fv_Callback_0(mthis) native "WebGLRenderingContext_vertexAttrib4fv_Callback";
-  vertexAttrib4fv_Callback_0_(mthis) => vertexAttrib4fv_Callback_0(mthis);
+  vertexAttrib3fv_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "vertexAttrib3fv", []);
 
-  static vertexAttrib4fv_Callback_1(mthis, __arg_0) native "WebGLRenderingContext_vertexAttrib4fv_Callback";
-  vertexAttrib4fv_Callback_1_(mthis, __arg_0) => vertexAttrib4fv_Callback_1(mthis, __arg_0);
+  vertexAttrib3fv_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "vertexAttrib3fv", [__arg_0]);
 
-  static vertexAttrib4fv_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_vertexAttrib4fv_Callback";
-  vertexAttrib4fv_Callback_2_(mthis, __arg_0, __arg_1) => vertexAttrib4fv_Callback_2(mthis, __arg_0, __arg_1);
+  vertexAttrib3fv_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "vertexAttrib3fv", [__arg_0, __arg_1]);
 
-  static vertexAttrib4fv_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_vertexAttrib4fv_Callback";
-  vertexAttrib4fv_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => vertexAttrib4fv_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  vertexAttrib4f_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "vertexAttrib4f", [__arg_0, __arg_1, __arg_2]);
 
-  static vertexAttrib4fv_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_vertexAttrib4fv_Callback";
-  vertexAttrib4fv_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => vertexAttrib4fv_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  vertexAttrib4f_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "vertexAttrib4f", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static vertexAttribPointer_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_vertexAttribPointer_Callback";
-  vertexAttribPointer_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => vertexAttribPointer_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  vertexAttrib4f_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => Blink_JsNative_DomException.callMethod(mthis, "vertexAttrib4f", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4]);
 
-  static vertexAttribPointer_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "WebGLRenderingContext_vertexAttribPointer_Callback";
-  vertexAttribPointer_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => vertexAttribPointer_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  vertexAttrib4fv_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "vertexAttrib4fv", []);
 
-  static vertexAttribPointer_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "WebGLRenderingContext_vertexAttribPointer_Callback";
-  vertexAttribPointer_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => vertexAttribPointer_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  vertexAttrib4fv_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "vertexAttrib4fv", [__arg_0]);
 
-  static vertexAttribPointer_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) native "WebGLRenderingContext_vertexAttribPointer_Callback";
-  vertexAttribPointer_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => vertexAttribPointer_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6);
+  vertexAttrib4fv_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "vertexAttrib4fv", [__arg_0, __arg_1]);
 
-  static vertexAttribPointer_Callback_8(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) native "WebGLRenderingContext_vertexAttribPointer_Callback";
-  vertexAttribPointer_Callback_8_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) => vertexAttribPointer_Callback_8(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7);
+  vertexAttribPointer_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "vertexAttribPointer", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static viewport_Callback_2(mthis, __arg_0, __arg_1) native "WebGLRenderingContext_viewport_Callback";
-  viewport_Callback_2_(mthis, __arg_0, __arg_1) => viewport_Callback_2(mthis, __arg_0, __arg_1);
+  vertexAttribPointer_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => Blink_JsNative_DomException.callMethod(mthis, "vertexAttribPointer", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4]);
 
-  static viewport_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebGLRenderingContext_viewport_Callback";
-  viewport_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => viewport_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  vertexAttribPointer_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => Blink_JsNative_DomException.callMethod(mthis, "vertexAttribPointer", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5]);
 
-  static viewport_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebGLRenderingContext_viewport_Callback";
-  viewport_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => viewport_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  viewport_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "viewport", [__arg_0, __arg_1]);
 
-  static viewport_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "WebGLRenderingContext_viewport_Callback";
-  viewport_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => viewport_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  viewport_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "viewport", [__arg_0, __arg_1, __arg_2]);
 
-  static viewport_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "WebGLRenderingContext_viewport_Callback";
-  viewport_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => viewport_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  viewport_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "viewport", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
 }
 
@@ -28886,14 +15745,11 @@
 class BlinkWebGLShaderPrecisionFormat {
   static final instance = new BlinkWebGLShaderPrecisionFormat();
 
-  static precision_Getter(mthis) native "WebGLShaderPrecisionFormat_precision_Getter";
-  precision_Getter_(mthis) => precision_Getter(mthis);
+  precision_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "precision");
 
-  static rangeMax_Getter(mthis) native "WebGLShaderPrecisionFormat_rangeMax_Getter";
-  rangeMax_Getter_(mthis) => rangeMax_Getter(mthis);
+  rangeMax_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "rangeMax");
 
-  static rangeMin_Getter(mthis) native "WebGLShaderPrecisionFormat_rangeMin_Getter";
-  rangeMin_Getter_(mthis) => rangeMin_Getter(mthis);
+  rangeMin_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "rangeMin");
 
 }
 
@@ -28915,1762 +15771,985 @@
 class BlinkWebKitAnimationEvent extends BlinkEvent {
   static final instance = new BlinkWebKitAnimationEvent();
 
-  static animationName_Getter(mthis) native "WebKitAnimationEvent_animationName_Getter";
-  animationName_Getter_(mthis) => animationName_Getter(mthis);
+  animationName_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "animationName");
 
-  static constructorCallback_2(__arg_0, __arg_1) native "WebKitAnimationEvent_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  constructorCallback_2_(__arg_0, __arg_1) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "WebKitAnimationEvent"), [__arg_0, __arg_1]);
 
-  static elapsedTime_Getter(mthis) native "WebKitAnimationEvent_elapsedTime_Getter";
-  elapsedTime_Getter_(mthis) => elapsedTime_Getter(mthis);
+  elapsedTime_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "elapsedTime");
 
 }
 
 class BlinkWebKitCSSFilterRule extends BlinkCSSRule {
   static final instance = new BlinkWebKitCSSFilterRule();
 
-  static style_Getter(mthis) native "WebKitCSSFilterRule_style_Getter";
-  style_Getter_(mthis) => style_Getter(mthis);
+  style_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "style");
 
 }
 
 class BlinkWebKitCSSFilterValue extends BlinkCSSValueList {
   static final instance = new BlinkWebKitCSSFilterValue();
 
-  static $__getter___Callback_1(mthis, __arg_0) native "WebKitCSSFilterValue___getter___Callback";
-  $__getter___Callback_1_(mthis, __arg_0) => $__getter___Callback_1(mthis, __arg_0);
+  $__getter___Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "__getter__", [__arg_0]);
 
-  static operationType_Getter(mthis) native "WebKitCSSFilterValue_operationType_Getter";
-  operationType_Getter_(mthis) => operationType_Getter(mthis);
+  operationType_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "operationType");
 
 }
 
 class BlinkWebKitCSSMatrix {
   static final instance = new BlinkWebKitCSSMatrix();
 
-  static a_Getter(mthis) native "WebKitCSSMatrix_a_Getter";
-  a_Getter_(mthis) => a_Getter(mthis);
+  a_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "a");
 
-  static a_Setter(mthis, __arg_0) native "WebKitCSSMatrix_a_Setter";
-  a_Setter_(mthis, __arg_0) => a_Setter(mthis, __arg_0);
+  a_Setter_(mthis, __arg_0) => mthis["a"] = __arg_0;
 
-  static b_Getter(mthis) native "WebKitCSSMatrix_b_Getter";
-  b_Getter_(mthis) => b_Getter(mthis);
+  b_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "b");
 
-  static b_Setter(mthis, __arg_0) native "WebKitCSSMatrix_b_Setter";
-  b_Setter_(mthis, __arg_0) => b_Setter(mthis, __arg_0);
+  b_Setter_(mthis, __arg_0) => mthis["b"] = __arg_0;
 
-  static c_Getter(mthis) native "WebKitCSSMatrix_c_Getter";
-  c_Getter_(mthis) => c_Getter(mthis);
+  c_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "c");
 
-  static c_Setter(mthis, __arg_0) native "WebKitCSSMatrix_c_Setter";
-  c_Setter_(mthis, __arg_0) => c_Setter(mthis, __arg_0);
+  c_Setter_(mthis, __arg_0) => mthis["c"] = __arg_0;
 
-  static constructorCallback_0() native "WebKitCSSMatrix_constructorCallback";
-  constructorCallback_0_() => constructorCallback_0();
+  constructorCallback_0_() => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "WebKitCSSMatrix"), []);
 
-  static constructorCallback_1(__arg_0) native "WebKitCSSMatrix_constructorCallback";
-  constructorCallback_1_(__arg_0) => constructorCallback_1(__arg_0);
+  constructorCallback_1_(__arg_0) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "WebKitCSSMatrix"), [__arg_0]);
 
-  static constructorCallback_2(__arg_0, __arg_1) native "WebKitCSSMatrix_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  d_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "d");
 
-  static constructorCallback_3(__arg_0, __arg_1, __arg_2) native "WebKitCSSMatrix_constructorCallback";
-  constructorCallback_3_(__arg_0, __arg_1, __arg_2) => constructorCallback_3(__arg_0, __arg_1, __arg_2);
+  d_Setter_(mthis, __arg_0) => mthis["d"] = __arg_0;
 
-  static d_Getter(mthis) native "WebKitCSSMatrix_d_Getter";
-  d_Getter_(mthis) => d_Getter(mthis);
+  e_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "e");
 
-  static d_Setter(mthis, __arg_0) native "WebKitCSSMatrix_d_Setter";
-  d_Setter_(mthis, __arg_0) => d_Setter(mthis, __arg_0);
+  e_Setter_(mthis, __arg_0) => mthis["e"] = __arg_0;
 
-  static e_Getter(mthis) native "WebKitCSSMatrix_e_Getter";
-  e_Getter_(mthis) => e_Getter(mthis);
+  f_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "f");
 
-  static e_Setter(mthis, __arg_0) native "WebKitCSSMatrix_e_Setter";
-  e_Setter_(mthis, __arg_0) => e_Setter(mthis, __arg_0);
+  f_Setter_(mthis, __arg_0) => mthis["f"] = __arg_0;
 
-  static f_Getter(mthis) native "WebKitCSSMatrix_f_Getter";
-  f_Getter_(mthis) => f_Getter(mthis);
+  inverse_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "inverse", []);
 
-  static f_Setter(mthis, __arg_0) native "WebKitCSSMatrix_f_Setter";
-  f_Setter_(mthis, __arg_0) => f_Setter(mthis, __arg_0);
+  m11_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "m11");
 
-  static inverse_Callback_0(mthis) native "WebKitCSSMatrix_inverse_Callback";
-  inverse_Callback_0_(mthis) => inverse_Callback_0(mthis);
+  m11_Setter_(mthis, __arg_0) => mthis["m11"] = __arg_0;
 
-  static inverse_Callback_1(mthis, __arg_0) native "WebKitCSSMatrix_inverse_Callback";
-  inverse_Callback_1_(mthis, __arg_0) => inverse_Callback_1(mthis, __arg_0);
+  m12_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "m12");
 
-  static inverse_Callback_2(mthis, __arg_0, __arg_1) native "WebKitCSSMatrix_inverse_Callback";
-  inverse_Callback_2_(mthis, __arg_0, __arg_1) => inverse_Callback_2(mthis, __arg_0, __arg_1);
+  m12_Setter_(mthis, __arg_0) => mthis["m12"] = __arg_0;
 
-  static m11_Getter(mthis) native "WebKitCSSMatrix_m11_Getter";
-  m11_Getter_(mthis) => m11_Getter(mthis);
+  m13_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "m13");
 
-  static m11_Setter(mthis, __arg_0) native "WebKitCSSMatrix_m11_Setter";
-  m11_Setter_(mthis, __arg_0) => m11_Setter(mthis, __arg_0);
+  m13_Setter_(mthis, __arg_0) => mthis["m13"] = __arg_0;
 
-  static m12_Getter(mthis) native "WebKitCSSMatrix_m12_Getter";
-  m12_Getter_(mthis) => m12_Getter(mthis);
+  m14_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "m14");
 
-  static m12_Setter(mthis, __arg_0) native "WebKitCSSMatrix_m12_Setter";
-  m12_Setter_(mthis, __arg_0) => m12_Setter(mthis, __arg_0);
+  m14_Setter_(mthis, __arg_0) => mthis["m14"] = __arg_0;
 
-  static m13_Getter(mthis) native "WebKitCSSMatrix_m13_Getter";
-  m13_Getter_(mthis) => m13_Getter(mthis);
+  m21_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "m21");
 
-  static m13_Setter(mthis, __arg_0) native "WebKitCSSMatrix_m13_Setter";
-  m13_Setter_(mthis, __arg_0) => m13_Setter(mthis, __arg_0);
+  m21_Setter_(mthis, __arg_0) => mthis["m21"] = __arg_0;
 
-  static m14_Getter(mthis) native "WebKitCSSMatrix_m14_Getter";
-  m14_Getter_(mthis) => m14_Getter(mthis);
+  m22_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "m22");
 
-  static m14_Setter(mthis, __arg_0) native "WebKitCSSMatrix_m14_Setter";
-  m14_Setter_(mthis, __arg_0) => m14_Setter(mthis, __arg_0);
+  m22_Setter_(mthis, __arg_0) => mthis["m22"] = __arg_0;
 
-  static m21_Getter(mthis) native "WebKitCSSMatrix_m21_Getter";
-  m21_Getter_(mthis) => m21_Getter(mthis);
+  m23_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "m23");
 
-  static m21_Setter(mthis, __arg_0) native "WebKitCSSMatrix_m21_Setter";
-  m21_Setter_(mthis, __arg_0) => m21_Setter(mthis, __arg_0);
+  m23_Setter_(mthis, __arg_0) => mthis["m23"] = __arg_0;
 
-  static m22_Getter(mthis) native "WebKitCSSMatrix_m22_Getter";
-  m22_Getter_(mthis) => m22_Getter(mthis);
+  m24_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "m24");
 
-  static m22_Setter(mthis, __arg_0) native "WebKitCSSMatrix_m22_Setter";
-  m22_Setter_(mthis, __arg_0) => m22_Setter(mthis, __arg_0);
+  m24_Setter_(mthis, __arg_0) => mthis["m24"] = __arg_0;
 
-  static m23_Getter(mthis) native "WebKitCSSMatrix_m23_Getter";
-  m23_Getter_(mthis) => m23_Getter(mthis);
+  m31_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "m31");
 
-  static m23_Setter(mthis, __arg_0) native "WebKitCSSMatrix_m23_Setter";
-  m23_Setter_(mthis, __arg_0) => m23_Setter(mthis, __arg_0);
+  m31_Setter_(mthis, __arg_0) => mthis["m31"] = __arg_0;
 
-  static m24_Getter(mthis) native "WebKitCSSMatrix_m24_Getter";
-  m24_Getter_(mthis) => m24_Getter(mthis);
+  m32_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "m32");
 
-  static m24_Setter(mthis, __arg_0) native "WebKitCSSMatrix_m24_Setter";
-  m24_Setter_(mthis, __arg_0) => m24_Setter(mthis, __arg_0);
+  m32_Setter_(mthis, __arg_0) => mthis["m32"] = __arg_0;
 
-  static m31_Getter(mthis) native "WebKitCSSMatrix_m31_Getter";
-  m31_Getter_(mthis) => m31_Getter(mthis);
+  m33_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "m33");
 
-  static m31_Setter(mthis, __arg_0) native "WebKitCSSMatrix_m31_Setter";
-  m31_Setter_(mthis, __arg_0) => m31_Setter(mthis, __arg_0);
+  m33_Setter_(mthis, __arg_0) => mthis["m33"] = __arg_0;
 
-  static m32_Getter(mthis) native "WebKitCSSMatrix_m32_Getter";
-  m32_Getter_(mthis) => m32_Getter(mthis);
+  m34_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "m34");
 
-  static m32_Setter(mthis, __arg_0) native "WebKitCSSMatrix_m32_Setter";
-  m32_Setter_(mthis, __arg_0) => m32_Setter(mthis, __arg_0);
+  m34_Setter_(mthis, __arg_0) => mthis["m34"] = __arg_0;
 
-  static m33_Getter(mthis) native "WebKitCSSMatrix_m33_Getter";
-  m33_Getter_(mthis) => m33_Getter(mthis);
+  m41_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "m41");
 
-  static m33_Setter(mthis, __arg_0) native "WebKitCSSMatrix_m33_Setter";
-  m33_Setter_(mthis, __arg_0) => m33_Setter(mthis, __arg_0);
+  m41_Setter_(mthis, __arg_0) => mthis["m41"] = __arg_0;
 
-  static m34_Getter(mthis) native "WebKitCSSMatrix_m34_Getter";
-  m34_Getter_(mthis) => m34_Getter(mthis);
+  m42_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "m42");
 
-  static m34_Setter(mthis, __arg_0) native "WebKitCSSMatrix_m34_Setter";
-  m34_Setter_(mthis, __arg_0) => m34_Setter(mthis, __arg_0);
+  m42_Setter_(mthis, __arg_0) => mthis["m42"] = __arg_0;
 
-  static m41_Getter(mthis) native "WebKitCSSMatrix_m41_Getter";
-  m41_Getter_(mthis) => m41_Getter(mthis);
+  m43_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "m43");
 
-  static m41_Setter(mthis, __arg_0) native "WebKitCSSMatrix_m41_Setter";
-  m41_Setter_(mthis, __arg_0) => m41_Setter(mthis, __arg_0);
+  m43_Setter_(mthis, __arg_0) => mthis["m43"] = __arg_0;
 
-  static m42_Getter(mthis) native "WebKitCSSMatrix_m42_Getter";
-  m42_Getter_(mthis) => m42_Getter(mthis);
-
-  static m42_Setter(mthis, __arg_0) native "WebKitCSSMatrix_m42_Setter";
-  m42_Setter_(mthis, __arg_0) => m42_Setter(mthis, __arg_0);
-
-  static m43_Getter(mthis) native "WebKitCSSMatrix_m43_Getter";
-  m43_Getter_(mthis) => m43_Getter(mthis);
-
-  static m43_Setter(mthis, __arg_0) native "WebKitCSSMatrix_m43_Setter";
-  m43_Setter_(mthis, __arg_0) => m43_Setter(mthis, __arg_0);
-
-  static m44_Getter(mthis) native "WebKitCSSMatrix_m44_Getter";
-  m44_Getter_(mthis) => m44_Getter(mthis);
-
-  static m44_Setter(mthis, __arg_0) native "WebKitCSSMatrix_m44_Setter";
-  m44_Setter_(mthis, __arg_0) => m44_Setter(mthis, __arg_0);
-
-  static multiply_Callback_0(mthis) native "WebKitCSSMatrix_multiply_Callback";
-  multiply_Callback_0_(mthis) => multiply_Callback_0(mthis);
-
-  static multiply_Callback_1(mthis, __arg_0) native "WebKitCSSMatrix_multiply_Callback";
-  multiply_Callback_1_(mthis, __arg_0) => multiply_Callback_1(mthis, __arg_0);
-
-  static multiply_Callback_2(mthis, __arg_0, __arg_1) native "WebKitCSSMatrix_multiply_Callback";
-  multiply_Callback_2_(mthis, __arg_0, __arg_1) => multiply_Callback_2(mthis, __arg_0, __arg_1);
-
-  static multiply_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebKitCSSMatrix_multiply_Callback";
-  multiply_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => multiply_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static rotateAxisAngle_Callback_0(mthis) native "WebKitCSSMatrix_rotateAxisAngle_Callback";
-  rotateAxisAngle_Callback_0_(mthis) => rotateAxisAngle_Callback_0(mthis);
-
-  static rotateAxisAngle_Callback_1(mthis, __arg_0) native "WebKitCSSMatrix_rotateAxisAngle_Callback";
-  rotateAxisAngle_Callback_1_(mthis, __arg_0) => rotateAxisAngle_Callback_1(mthis, __arg_0);
-
-  static rotateAxisAngle_Callback_2(mthis, __arg_0, __arg_1) native "WebKitCSSMatrix_rotateAxisAngle_Callback";
-  rotateAxisAngle_Callback_2_(mthis, __arg_0, __arg_1) => rotateAxisAngle_Callback_2(mthis, __arg_0, __arg_1);
-
-  static rotateAxisAngle_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebKitCSSMatrix_rotateAxisAngle_Callback";
-  rotateAxisAngle_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => rotateAxisAngle_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static rotateAxisAngle_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebKitCSSMatrix_rotateAxisAngle_Callback";
-  rotateAxisAngle_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => rotateAxisAngle_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static rotateAxisAngle_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "WebKitCSSMatrix_rotateAxisAngle_Callback";
-  rotateAxisAngle_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => rotateAxisAngle_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
-
-  static rotateAxisAngle_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "WebKitCSSMatrix_rotateAxisAngle_Callback";
-  rotateAxisAngle_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => rotateAxisAngle_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
-
-  static rotate_Callback_0(mthis) native "WebKitCSSMatrix_rotate_Callback";
-  rotate_Callback_0_(mthis) => rotate_Callback_0(mthis);
-
-  static rotate_Callback_1(mthis, __arg_0) native "WebKitCSSMatrix_rotate_Callback";
-  rotate_Callback_1_(mthis, __arg_0) => rotate_Callback_1(mthis, __arg_0);
-
-  static rotate_Callback_2(mthis, __arg_0, __arg_1) native "WebKitCSSMatrix_rotate_Callback";
-  rotate_Callback_2_(mthis, __arg_0, __arg_1) => rotate_Callback_2(mthis, __arg_0, __arg_1);
-
-  static rotate_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebKitCSSMatrix_rotate_Callback";
-  rotate_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => rotate_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  m44_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "m44");
 
-  static rotate_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebKitCSSMatrix_rotate_Callback";
-  rotate_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => rotate_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  m44_Setter_(mthis, __arg_0) => mthis["m44"] = __arg_0;
 
-  static rotate_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "WebKitCSSMatrix_rotate_Callback";
-  rotate_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => rotate_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  multiply_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "multiply", []);
 
-  static scale_Callback_0(mthis) native "WebKitCSSMatrix_scale_Callback";
-  scale_Callback_0_(mthis) => scale_Callback_0(mthis);
+  multiply_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "multiply", [__arg_0]);
 
-  static scale_Callback_1(mthis, __arg_0) native "WebKitCSSMatrix_scale_Callback";
-  scale_Callback_1_(mthis, __arg_0) => scale_Callback_1(mthis, __arg_0);
+  rotateAxisAngle_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "rotateAxisAngle", []);
 
-  static scale_Callback_2(mthis, __arg_0, __arg_1) native "WebKitCSSMatrix_scale_Callback";
-  scale_Callback_2_(mthis, __arg_0, __arg_1) => scale_Callback_2(mthis, __arg_0, __arg_1);
+  rotateAxisAngle_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "rotateAxisAngle", [__arg_0]);
 
-  static scale_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebKitCSSMatrix_scale_Callback";
-  scale_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => scale_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  rotateAxisAngle_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "rotateAxisAngle", [__arg_0, __arg_1]);
 
-  static scale_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebKitCSSMatrix_scale_Callback";
-  scale_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => scale_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  rotateAxisAngle_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "rotateAxisAngle", [__arg_0, __arg_1, __arg_2]);
 
-  static scale_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "WebKitCSSMatrix_scale_Callback";
-  scale_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => scale_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  rotateAxisAngle_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "rotateAxisAngle", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static setMatrixValue_Callback_0(mthis) native "WebKitCSSMatrix_setMatrixValue_Callback";
-  setMatrixValue_Callback_0_(mthis) => setMatrixValue_Callback_0(mthis);
+  rotate_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "rotate", []);
 
-  static setMatrixValue_Callback_1(mthis, __arg_0) native "WebKitCSSMatrix_setMatrixValue_Callback";
-  setMatrixValue_Callback_1_(mthis, __arg_0) => setMatrixValue_Callback_1(mthis, __arg_0);
+  rotate_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "rotate", [__arg_0]);
 
-  static setMatrixValue_Callback_2(mthis, __arg_0, __arg_1) native "WebKitCSSMatrix_setMatrixValue_Callback";
-  setMatrixValue_Callback_2_(mthis, __arg_0, __arg_1) => setMatrixValue_Callback_2(mthis, __arg_0, __arg_1);
+  rotate_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "rotate", [__arg_0, __arg_1]);
 
-  static setMatrixValue_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebKitCSSMatrix_setMatrixValue_Callback";
-  setMatrixValue_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => setMatrixValue_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  rotate_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "rotate", [__arg_0, __arg_1, __arg_2]);
 
-  static skewX_Callback_0(mthis) native "WebKitCSSMatrix_skewX_Callback";
-  skewX_Callback_0_(mthis) => skewX_Callback_0(mthis);
+  scale_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "scale", []);
 
-  static skewX_Callback_1(mthis, __arg_0) native "WebKitCSSMatrix_skewX_Callback";
-  skewX_Callback_1_(mthis, __arg_0) => skewX_Callback_1(mthis, __arg_0);
+  scale_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "scale", [__arg_0]);
 
-  static skewX_Callback_2(mthis, __arg_0, __arg_1) native "WebKitCSSMatrix_skewX_Callback";
-  skewX_Callback_2_(mthis, __arg_0, __arg_1) => skewX_Callback_2(mthis, __arg_0, __arg_1);
+  scale_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "scale", [__arg_0, __arg_1]);
 
-  static skewX_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebKitCSSMatrix_skewX_Callback";
-  skewX_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => skewX_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  scale_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "scale", [__arg_0, __arg_1, __arg_2]);
 
-  static skewY_Callback_0(mthis) native "WebKitCSSMatrix_skewY_Callback";
-  skewY_Callback_0_(mthis) => skewY_Callback_0(mthis);
+  setMatrixValue_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "setMatrixValue", []);
 
-  static skewY_Callback_1(mthis, __arg_0) native "WebKitCSSMatrix_skewY_Callback";
-  skewY_Callback_1_(mthis, __arg_0) => skewY_Callback_1(mthis, __arg_0);
+  setMatrixValue_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "setMatrixValue", [__arg_0]);
 
-  static skewY_Callback_2(mthis, __arg_0, __arg_1) native "WebKitCSSMatrix_skewY_Callback";
-  skewY_Callback_2_(mthis, __arg_0, __arg_1) => skewY_Callback_2(mthis, __arg_0, __arg_1);
+  skewX_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "skewX", []);
 
-  static skewY_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebKitCSSMatrix_skewY_Callback";
-  skewY_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => skewY_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  skewX_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "skewX", [__arg_0]);
 
-  static translate_Callback_0(mthis) native "WebKitCSSMatrix_translate_Callback";
-  translate_Callback_0_(mthis) => translate_Callback_0(mthis);
+  skewY_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "skewY", []);
 
-  static translate_Callback_1(mthis, __arg_0) native "WebKitCSSMatrix_translate_Callback";
-  translate_Callback_1_(mthis, __arg_0) => translate_Callback_1(mthis, __arg_0);
+  skewY_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "skewY", [__arg_0]);
 
-  static translate_Callback_2(mthis, __arg_0, __arg_1) native "WebKitCSSMatrix_translate_Callback";
-  translate_Callback_2_(mthis, __arg_0, __arg_1) => translate_Callback_2(mthis, __arg_0, __arg_1);
+  translate_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "translate", []);
 
-  static translate_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebKitCSSMatrix_translate_Callback";
-  translate_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => translate_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  translate_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "translate", [__arg_0]);
 
-  static translate_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebKitCSSMatrix_translate_Callback";
-  translate_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => translate_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  translate_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "translate", [__arg_0, __arg_1]);
 
-  static translate_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "WebKitCSSMatrix_translate_Callback";
-  translate_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => translate_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  translate_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "translate", [__arg_0, __arg_1, __arg_2]);
 
 }
 
 class BlinkWebKitCSSTransformValue extends BlinkCSSValueList {
   static final instance = new BlinkWebKitCSSTransformValue();
 
-  static $__getter___Callback_1(mthis, __arg_0) native "WebKitCSSTransformValue___getter___Callback";
-  $__getter___Callback_1_(mthis, __arg_0) => $__getter___Callback_1(mthis, __arg_0);
+  $__getter___Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "__getter__", [__arg_0]);
 
-  static operationType_Getter(mthis) native "WebKitCSSTransformValue_operationType_Getter";
-  operationType_Getter_(mthis) => operationType_Getter(mthis);
+  operationType_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "operationType");
 
 }
 
 class BlinkWebKitGamepad {
   static final instance = new BlinkWebKitGamepad();
 
-  static axes_Getter(mthis) native "WebKitGamepad_axes_Getter";
-  axes_Getter_(mthis) => axes_Getter(mthis);
+  axes_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "axes");
 
-  static buttons_Getter(mthis) native "WebKitGamepad_buttons_Getter";
-  buttons_Getter_(mthis) => buttons_Getter(mthis);
+  buttons_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "buttons");
 
-  static connected_Getter(mthis) native "WebKitGamepad_connected_Getter";
-  connected_Getter_(mthis) => connected_Getter(mthis);
+  connected_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "connected");
 
-  static id_Getter(mthis) native "WebKitGamepad_id_Getter";
-  id_Getter_(mthis) => id_Getter(mthis);
+  id_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "id");
 
-  static index_Getter(mthis) native "WebKitGamepad_index_Getter";
-  index_Getter_(mthis) => index_Getter(mthis);
+  index_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "index");
 
-  static mapping_Getter(mthis) native "WebKitGamepad_mapping_Getter";
-  mapping_Getter_(mthis) => mapping_Getter(mthis);
+  mapping_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "mapping");
 
-  static timestamp_Getter(mthis) native "WebKitGamepad_timestamp_Getter";
-  timestamp_Getter_(mthis) => timestamp_Getter(mthis);
+  timestamp_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "timestamp");
 
 }
 
 class BlinkWebKitGamepadList {
   static final instance = new BlinkWebKitGamepadList();
 
-  static $__getter___Callback_1(mthis, __arg_0) native "WebKitGamepadList___getter___Callback";
-  $__getter___Callback_1_(mthis, __arg_0) => $__getter___Callback_1(mthis, __arg_0);
+  $__getter___Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "__getter__", [__arg_0]);
 
-  static item_Callback_0(mthis) native "WebKitGamepadList_item_Callback";
-  item_Callback_0_(mthis) => item_Callback_0(mthis);
+  item_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "item", []);
 
-  static item_Callback_1(mthis, __arg_0) native "WebKitGamepadList_item_Callback";
-  item_Callback_1_(mthis, __arg_0) => item_Callback_1(mthis, __arg_0);
+  item_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "item", [__arg_0]);
 
-  static item_Callback_2(mthis, __arg_0, __arg_1) native "WebKitGamepadList_item_Callback";
-  item_Callback_2_(mthis, __arg_0, __arg_1) => item_Callback_2(mthis, __arg_0, __arg_1);
-
-  static item_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebKitGamepadList_item_Callback";
-  item_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => item_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static length_Getter(mthis) native "WebKitGamepadList_length_Getter";
-  length_Getter_(mthis) => length_Getter(mthis);
+  length_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "length");
 
 }
 
 class BlinkWebSocket extends BlinkEventTarget {
   static final instance = new BlinkWebSocket();
 
-  static URL_Getter(mthis) native "WebSocket_URL_Getter";
-  URL_Getter_(mthis) => URL_Getter(mthis);
+  URL_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "URL");
 
-  static binaryType_Getter(mthis) native "WebSocket_binaryType_Getter";
-  binaryType_Getter_(mthis) => binaryType_Getter(mthis);
+  binaryType_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "binaryType");
 
-  static binaryType_Setter(mthis, __arg_0) native "WebSocket_binaryType_Setter";
-  binaryType_Setter_(mthis, __arg_0) => binaryType_Setter(mthis, __arg_0);
+  binaryType_Setter_(mthis, __arg_0) => mthis["binaryType"] = __arg_0;
 
-  static bufferedAmount_Getter(mthis) native "WebSocket_bufferedAmount_Getter";
-  bufferedAmount_Getter_(mthis) => bufferedAmount_Getter(mthis);
+  bufferedAmount_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "bufferedAmount");
 
-  static close_Callback_0(mthis) native "WebSocket_close_Callback";
-  close_Callback_0_(mthis) => close_Callback_0(mthis);
+  close_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "close", []);
 
-  static close_Callback_1(mthis, __arg_0) native "WebSocket_close_Callback";
-  close_Callback_1_(mthis, __arg_0) => close_Callback_1(mthis, __arg_0);
+  close_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "close", [__arg_0]);
 
-  static close_Callback_2(mthis, __arg_0, __arg_1) native "WebSocket_close_Callback";
-  close_Callback_2_(mthis, __arg_0, __arg_1) => close_Callback_2(mthis, __arg_0, __arg_1);
+  close_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "close", [__arg_0, __arg_1]);
 
-  static close_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebSocket_close_Callback";
-  close_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => close_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  constructorCallback_0_() => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "WebSocket"), []);
 
-  static close_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WebSocket_close_Callback";
-  close_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => close_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  constructorCallback_1_(__arg_0) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "WebSocket"), [__arg_0]);
 
-  static constructorCallback_0() native "WebSocket_constructorCallback";
-  constructorCallback_0_() => constructorCallback_0();
+  constructorCallback_2_(__arg_0, __arg_1) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "WebSocket"), [__arg_0, __arg_1]);
 
-  static constructorCallback_1(__arg_0) native "WebSocket_constructorCallback";
-  constructorCallback_1_(__arg_0) => constructorCallback_1(__arg_0);
+  extensions_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "extensions");
 
-  static constructorCallback_2(__arg_0, __arg_1) native "WebSocket_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  onclose_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onclose");
 
-  static constructorCallback_3(__arg_0, __arg_1, __arg_2) native "WebSocket_constructorCallback";
-  constructorCallback_3_(__arg_0, __arg_1, __arg_2) => constructorCallback_3(__arg_0, __arg_1, __arg_2);
+  onclose_Setter_(mthis, __arg_0) => mthis["onclose"] = __arg_0;
 
-  static constructorCallback_4(__arg_0, __arg_1, __arg_2, __arg_3) native "WebSocket_constructorCallback";
-  constructorCallback_4_(__arg_0, __arg_1, __arg_2, __arg_3) => constructorCallback_4(__arg_0, __arg_1, __arg_2, __arg_3);
+  onerror_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onerror");
 
-  static extensions_Getter(mthis) native "WebSocket_extensions_Getter";
-  extensions_Getter_(mthis) => extensions_Getter(mthis);
+  onerror_Setter_(mthis, __arg_0) => mthis["onerror"] = __arg_0;
 
-  static onclose_Getter(mthis) native "WebSocket_onclose_Getter";
-  onclose_Getter_(mthis) => onclose_Getter(mthis);
+  onmessage_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onmessage");
 
-  static onclose_Setter(mthis, __arg_0) native "WebSocket_onclose_Setter";
-  onclose_Setter_(mthis, __arg_0) => onclose_Setter(mthis, __arg_0);
+  onmessage_Setter_(mthis, __arg_0) => mthis["onmessage"] = __arg_0;
 
-  static onerror_Getter(mthis) native "WebSocket_onerror_Getter";
-  onerror_Getter_(mthis) => onerror_Getter(mthis);
+  onopen_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onopen");
 
-  static onerror_Setter(mthis, __arg_0) native "WebSocket_onerror_Setter";
-  onerror_Setter_(mthis, __arg_0) => onerror_Setter(mthis, __arg_0);
+  onopen_Setter_(mthis, __arg_0) => mthis["onopen"] = __arg_0;
 
-  static onmessage_Getter(mthis) native "WebSocket_onmessage_Getter";
-  onmessage_Getter_(mthis) => onmessage_Getter(mthis);
+  protocol_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "protocol");
 
-  static onmessage_Setter(mthis, __arg_0) native "WebSocket_onmessage_Setter";
-  onmessage_Setter_(mthis, __arg_0) => onmessage_Setter(mthis, __arg_0);
+  readyState_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "readyState");
 
-  static onopen_Getter(mthis) native "WebSocket_onopen_Getter";
-  onopen_Getter_(mthis) => onopen_Getter(mthis);
+  send_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "send", []);
 
-  static onopen_Setter(mthis, __arg_0) native "WebSocket_onopen_Setter";
-  onopen_Setter_(mthis, __arg_0) => onopen_Setter(mthis, __arg_0);
+  send_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "send", [__arg_0]);
 
-  static protocol_Getter(mthis) native "WebSocket_protocol_Getter";
-  protocol_Getter_(mthis) => protocol_Getter(mthis);
-
-  static readyState_Getter(mthis) native "WebSocket_readyState_Getter";
-  readyState_Getter_(mthis) => readyState_Getter(mthis);
-
-  static send_Callback_0(mthis) native "WebSocket_send_Callback";
-  send_Callback_0_(mthis) => send_Callback_0(mthis);
-
-  static send_Callback_1(mthis, __arg_0) native "WebSocket_send_Callback";
-  send_Callback_1_(mthis, __arg_0) => send_Callback_1(mthis, __arg_0);
-
-  static send_Callback_2(mthis, __arg_0, __arg_1) native "WebSocket_send_Callback";
-  send_Callback_2_(mthis, __arg_0, __arg_1) => send_Callback_2(mthis, __arg_0, __arg_1);
-
-  static send_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WebSocket_send_Callback";
-  send_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => send_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static url_Getter(mthis) native "WebSocket_url_Getter";
-  url_Getter_(mthis) => url_Getter(mthis);
+  url_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "url");
 
 }
 
 class BlinkWheelEvent extends BlinkMouseEvent {
   static final instance = new BlinkWheelEvent();
 
-  static constructorCallback_2(__arg_0, __arg_1) native "WheelEvent_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  constructorCallback_2_(__arg_0, __arg_1) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "WheelEvent"), [__arg_0, __arg_1]);
 
-  static deltaMode_Getter(mthis) native "WheelEvent_deltaMode_Getter";
-  deltaMode_Getter_(mthis) => deltaMode_Getter(mthis);
+  deltaMode_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "deltaMode");
 
-  static deltaX_Getter(mthis) native "WheelEvent_deltaX_Getter";
-  deltaX_Getter_(mthis) => deltaX_Getter(mthis);
+  deltaX_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "deltaX");
 
-  static deltaY_Getter(mthis) native "WheelEvent_deltaY_Getter";
-  deltaY_Getter_(mthis) => deltaY_Getter(mthis);
+  deltaY_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "deltaY");
 
-  static deltaZ_Getter(mthis) native "WheelEvent_deltaZ_Getter";
-  deltaZ_Getter_(mthis) => deltaZ_Getter(mthis);
+  deltaZ_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "deltaZ");
 
-  static wheelDeltaX_Getter(mthis) native "WheelEvent_wheelDeltaX_Getter";
-  wheelDeltaX_Getter_(mthis) => wheelDeltaX_Getter(mthis);
+  wheelDeltaX_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "wheelDeltaX");
 
-  static wheelDeltaY_Getter(mthis) native "WheelEvent_wheelDeltaY_Getter";
-  wheelDeltaY_Getter_(mthis) => wheelDeltaY_Getter(mthis);
+  wheelDeltaY_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "wheelDeltaY");
 
 }
 
 class BlinkWindow extends BlinkEventTarget {
   static final instance = new BlinkWindow();
 
-  static $__getter___Callback_1(mthis, __arg_0) native "Window___getter___Callback";
-  $__getter___Callback_1_(mthis, __arg_0) => $__getter___Callback_1(mthis, __arg_0);
+  $__getter___Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "__getter__", [__arg_0]);
 
-  static CSS_Getter(mthis) native "Window_CSS_Getter";
-  CSS_Getter_(mthis) => CSS_Getter(mthis);
+  CSS_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "CSS");
 
-  static alert_Callback_0(mthis) native "Window_alert_Callback";
-  alert_Callback_0_(mthis) => alert_Callback_0(mthis);
+  alert_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "alert", []);
 
-  static alert_Callback_1(mthis, __arg_0) native "Window_alert_Callback";
-  alert_Callback_1_(mthis, __arg_0) => alert_Callback_1(mthis, __arg_0);
+  alert_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "alert", [__arg_0]);
 
-  static alert_Callback_2(mthis, __arg_0, __arg_1) native "Window_alert_Callback";
-  alert_Callback_2_(mthis, __arg_0, __arg_1) => alert_Callback_2(mthis, __arg_0, __arg_1);
+  applicationCache_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "applicationCache");
 
-  static alert_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Window_alert_Callback";
-  alert_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => alert_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  atob_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "atob", []);
 
-  static applicationCache_Getter(mthis) native "Window_applicationCache_Getter";
-  applicationCache_Getter_(mthis) => applicationCache_Getter(mthis);
+  atob_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "atob", [__arg_0]);
 
-  static atob_Callback_0(mthis) native "Window_atob_Callback";
-  atob_Callback_0_(mthis) => atob_Callback_0(mthis);
+  blur_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "blur", []);
 
-  static atob_Callback_1(mthis, __arg_0) native "Window_atob_Callback";
-  atob_Callback_1_(mthis, __arg_0) => atob_Callback_1(mthis, __arg_0);
+  btoa_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "btoa", []);
 
-  static atob_Callback_2(mthis, __arg_0, __arg_1) native "Window_atob_Callback";
-  atob_Callback_2_(mthis, __arg_0, __arg_1) => atob_Callback_2(mthis, __arg_0, __arg_1);
+  btoa_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "btoa", [__arg_0]);
 
-  static atob_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Window_atob_Callback";
-  atob_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => atob_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  cancelAnimationFrame_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "cancelAnimationFrame", []);
 
-  static blur_Callback_0(mthis) native "Window_blur_Callback";
-  blur_Callback_0_(mthis) => blur_Callback_0(mthis);
+  cancelAnimationFrame_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "cancelAnimationFrame", [__arg_0]);
 
-  static blur_Callback_1(mthis, __arg_0) native "Window_blur_Callback";
-  blur_Callback_1_(mthis, __arg_0) => blur_Callback_1(mthis, __arg_0);
+  captureEvents_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "captureEvents", []);
 
-  static blur_Callback_2(mthis, __arg_0, __arg_1) native "Window_blur_Callback";
-  blur_Callback_2_(mthis, __arg_0, __arg_1) => blur_Callback_2(mthis, __arg_0, __arg_1);
+  clearInterval_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "clearInterval", []);
 
-  static btoa_Callback_0(mthis) native "Window_btoa_Callback";
-  btoa_Callback_0_(mthis) => btoa_Callback_0(mthis);
+  clearInterval_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "clearInterval", [__arg_0]);
 
-  static btoa_Callback_1(mthis, __arg_0) native "Window_btoa_Callback";
-  btoa_Callback_1_(mthis, __arg_0) => btoa_Callback_1(mthis, __arg_0);
+  clearTimeout_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "clearTimeout", []);
 
-  static btoa_Callback_2(mthis, __arg_0, __arg_1) native "Window_btoa_Callback";
-  btoa_Callback_2_(mthis, __arg_0, __arg_1) => btoa_Callback_2(mthis, __arg_0, __arg_1);
+  clearTimeout_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "clearTimeout", [__arg_0]);
 
-  static btoa_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Window_btoa_Callback";
-  btoa_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => btoa_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  close_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "close", []);
 
-  static cancelAnimationFrame_Callback_0(mthis) native "Window_cancelAnimationFrame_Callback";
-  cancelAnimationFrame_Callback_0_(mthis) => cancelAnimationFrame_Callback_0(mthis);
+  closed_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "closed");
 
-  static cancelAnimationFrame_Callback_1(mthis, __arg_0) native "Window_cancelAnimationFrame_Callback";
-  cancelAnimationFrame_Callback_1_(mthis, __arg_0) => cancelAnimationFrame_Callback_1(mthis, __arg_0);
+  confirm_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "confirm", []);
 
-  static cancelAnimationFrame_Callback_2(mthis, __arg_0, __arg_1) native "Window_cancelAnimationFrame_Callback";
-  cancelAnimationFrame_Callback_2_(mthis, __arg_0, __arg_1) => cancelAnimationFrame_Callback_2(mthis, __arg_0, __arg_1);
+  confirm_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "confirm", [__arg_0]);
 
-  static cancelAnimationFrame_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Window_cancelAnimationFrame_Callback";
-  cancelAnimationFrame_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => cancelAnimationFrame_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  console_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "console");
 
-  static captureEvents_Callback_0(mthis) native "Window_captureEvents_Callback";
-  captureEvents_Callback_0_(mthis) => captureEvents_Callback_0(mthis);
+  crypto_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "crypto");
 
-  static captureEvents_Callback_1(mthis, __arg_0) native "Window_captureEvents_Callback";
-  captureEvents_Callback_1_(mthis, __arg_0) => captureEvents_Callback_1(mthis, __arg_0);
+  defaultStatus_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "defaultStatus");
 
-  static captureEvents_Callback_2(mthis, __arg_0, __arg_1) native "Window_captureEvents_Callback";
-  captureEvents_Callback_2_(mthis, __arg_0, __arg_1) => captureEvents_Callback_2(mthis, __arg_0, __arg_1);
+  defaultStatus_Setter_(mthis, __arg_0) => mthis["defaultStatus"] = __arg_0;
 
-  static clearInterval_Callback_0(mthis) native "Window_clearInterval_Callback";
-  clearInterval_Callback_0_(mthis) => clearInterval_Callback_0(mthis);
+  defaultstatus_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "defaultstatus");
 
-  static clearInterval_Callback_1(mthis, __arg_0) native "Window_clearInterval_Callback";
-  clearInterval_Callback_1_(mthis, __arg_0) => clearInterval_Callback_1(mthis, __arg_0);
+  defaultstatus_Setter_(mthis, __arg_0) => mthis["defaultstatus"] = __arg_0;
 
-  static clearInterval_Callback_2(mthis, __arg_0, __arg_1) native "Window_clearInterval_Callback";
-  clearInterval_Callback_2_(mthis, __arg_0, __arg_1) => clearInterval_Callback_2(mthis, __arg_0, __arg_1);
+  devicePixelRatio_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "devicePixelRatio");
 
-  static clearInterval_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Window_clearInterval_Callback";
-  clearInterval_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => clearInterval_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  document_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "document");
 
-  static clearTimeout_Callback_0(mthis) native "Window_clearTimeout_Callback";
-  clearTimeout_Callback_0_(mthis) => clearTimeout_Callback_0(mthis);
+  event_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "event");
 
-  static clearTimeout_Callback_1(mthis, __arg_0) native "Window_clearTimeout_Callback";
-  clearTimeout_Callback_1_(mthis, __arg_0) => clearTimeout_Callback_1(mthis, __arg_0);
+  event_Setter_(mthis, __arg_0) => mthis["event"] = __arg_0;
 
-  static clearTimeout_Callback_2(mthis, __arg_0, __arg_1) native "Window_clearTimeout_Callback";
-  clearTimeout_Callback_2_(mthis, __arg_0, __arg_1) => clearTimeout_Callback_2(mthis, __arg_0, __arg_1);
+  find_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "find", []);
 
-  static clearTimeout_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Window_clearTimeout_Callback";
-  clearTimeout_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => clearTimeout_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  find_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "find", [__arg_0]);
 
-  static close_Callback_0(mthis) native "Window_close_Callback";
-  close_Callback_0_(mthis) => close_Callback_0(mthis);
+  find_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "find", [__arg_0, __arg_1]);
 
-  static close_Callback_1(mthis, __arg_0) native "Window_close_Callback";
-  close_Callback_1_(mthis, __arg_0) => close_Callback_1(mthis, __arg_0);
+  find_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "find", [__arg_0, __arg_1, __arg_2]);
 
-  static close_Callback_2(mthis, __arg_0, __arg_1) native "Window_close_Callback";
-  close_Callback_2_(mthis, __arg_0, __arg_1) => close_Callback_2(mthis, __arg_0, __arg_1);
+  find_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "find", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static closed_Getter(mthis) native "Window_closed_Getter";
-  closed_Getter_(mthis) => closed_Getter(mthis);
+  find_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => Blink_JsNative_DomException.callMethod(mthis, "find", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4]);
 
-  static confirm_Callback_0(mthis) native "Window_confirm_Callback";
-  confirm_Callback_0_(mthis) => confirm_Callback_0(mthis);
+  find_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => Blink_JsNative_DomException.callMethod(mthis, "find", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5]);
 
-  static confirm_Callback_1(mthis, __arg_0) native "Window_confirm_Callback";
-  confirm_Callback_1_(mthis, __arg_0) => confirm_Callback_1(mthis, __arg_0);
+  find_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => Blink_JsNative_DomException.callMethod(mthis, "find", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6]);
 
-  static confirm_Callback_2(mthis, __arg_0, __arg_1) native "Window_confirm_Callback";
-  confirm_Callback_2_(mthis, __arg_0, __arg_1) => confirm_Callback_2(mthis, __arg_0, __arg_1);
+  focus_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "focus", []);
 
-  static confirm_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Window_confirm_Callback";
-  confirm_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => confirm_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  frameElement_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "frameElement");
 
-  static console_Getter(mthis) native "Window_console_Getter";
-  console_Getter_(mthis) => console_Getter(mthis);
+  frames_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "frames");
 
-  static crypto_Getter(mthis) native "Window_crypto_Getter";
-  crypto_Getter_(mthis) => crypto_Getter(mthis);
+  getComputedStyle_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getComputedStyle", []);
 
-  static defaultStatus_Getter(mthis) native "Window_defaultStatus_Getter";
-  defaultStatus_Getter_(mthis) => defaultStatus_Getter(mthis);
+  getComputedStyle_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getComputedStyle", [__arg_0]);
 
-  static defaultStatus_Setter(mthis, __arg_0) native "Window_defaultStatus_Setter";
-  defaultStatus_Setter_(mthis, __arg_0) => defaultStatus_Setter(mthis, __arg_0);
+  getComputedStyle_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "getComputedStyle", [__arg_0, __arg_1]);
 
-  static defaultstatus_Getter(mthis) native "Window_defaultstatus_Getter";
-  defaultstatus_Getter_(mthis) => defaultstatus_Getter(mthis);
+  getMatchedCSSRules_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getMatchedCSSRules", []);
 
-  static defaultstatus_Setter(mthis, __arg_0) native "Window_defaultstatus_Setter";
-  defaultstatus_Setter_(mthis, __arg_0) => defaultstatus_Setter(mthis, __arg_0);
+  getMatchedCSSRules_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getMatchedCSSRules", [__arg_0]);
 
-  static devicePixelRatio_Getter(mthis) native "Window_devicePixelRatio_Getter";
-  devicePixelRatio_Getter_(mthis) => devicePixelRatio_Getter(mthis);
+  getMatchedCSSRules_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "getMatchedCSSRules", [__arg_0, __arg_1]);
 
-  static document_Getter(mthis) native "Window_document_Getter";
-  document_Getter_(mthis) => document_Getter(mthis);
+  getSelection_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getSelection", []);
 
-  static event_Getter(mthis) native "Window_event_Getter";
-  event_Getter_(mthis) => event_Getter(mthis);
+  history_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "history");
 
-  static event_Setter(mthis, __arg_0) native "Window_event_Setter";
-  event_Setter_(mthis, __arg_0) => event_Setter(mthis, __arg_0);
+  indexedDB_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "indexedDB");
 
-  static find_Callback_0(mthis) native "Window_find_Callback";
-  find_Callback_0_(mthis) => find_Callback_0(mthis);
+  innerHeight_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "innerHeight");
 
-  static find_Callback_1(mthis, __arg_0) native "Window_find_Callback";
-  find_Callback_1_(mthis, __arg_0) => find_Callback_1(mthis, __arg_0);
+  innerWidth_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "innerWidth");
 
-  static find_Callback_2(mthis, __arg_0, __arg_1) native "Window_find_Callback";
-  find_Callback_2_(mthis, __arg_0, __arg_1) => find_Callback_2(mthis, __arg_0, __arg_1);
+  length_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "length");
 
-  static find_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Window_find_Callback";
-  find_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => find_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  localStorage_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "localStorage");
 
-  static find_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Window_find_Callback";
-  find_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => find_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  location_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "location");
 
-  static find_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "Window_find_Callback";
-  find_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => find_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  location_Setter_(mthis, __arg_0) => mthis["location"] = __arg_0;
 
-  static find_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "Window_find_Callback";
-  find_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => find_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  locationbar_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "locationbar");
 
-  static find_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) native "Window_find_Callback";
-  find_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => find_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6);
+  matchMedia_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "matchMedia", []);
 
-  static find_Callback_8(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) native "Window_find_Callback";
-  find_Callback_8_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7) => find_Callback_8(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7);
+  matchMedia_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "matchMedia", [__arg_0]);
 
-  static find_Callback_9(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8) native "Window_find_Callback";
-  find_Callback_9_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8) => find_Callback_9(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6, __arg_7, __arg_8);
+  menubar_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "menubar");
 
-  static focus_Callback_0(mthis) native "Window_focus_Callback";
-  focus_Callback_0_(mthis) => focus_Callback_0(mthis);
+  moveBy_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "moveBy", []);
 
-  static focus_Callback_1(mthis, __arg_0) native "Window_focus_Callback";
-  focus_Callback_1_(mthis, __arg_0) => focus_Callback_1(mthis, __arg_0);
+  moveBy_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "moveBy", [__arg_0]);
 
-  static focus_Callback_2(mthis, __arg_0, __arg_1) native "Window_focus_Callback";
-  focus_Callback_2_(mthis, __arg_0, __arg_1) => focus_Callback_2(mthis, __arg_0, __arg_1);
+  moveBy_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "moveBy", [__arg_0, __arg_1]);
 
-  static frameElement_Getter(mthis) native "Window_frameElement_Getter";
-  frameElement_Getter_(mthis) => frameElement_Getter(mthis);
+  moveTo_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "moveTo", []);
 
-  static frames_Getter(mthis) native "Window_frames_Getter";
-  frames_Getter_(mthis) => frames_Getter(mthis);
+  moveTo_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "moveTo", [__arg_0]);
 
-  static getComputedStyle_Callback_0(mthis) native "Window_getComputedStyle_Callback";
-  getComputedStyle_Callback_0_(mthis) => getComputedStyle_Callback_0(mthis);
+  moveTo_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "moveTo", [__arg_0, __arg_1]);
 
-  static getComputedStyle_Callback_1(mthis, __arg_0) native "Window_getComputedStyle_Callback";
-  getComputedStyle_Callback_1_(mthis, __arg_0) => getComputedStyle_Callback_1(mthis, __arg_0);
+  name_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "name");
 
-  static getComputedStyle_Callback_2(mthis, __arg_0, __arg_1) native "Window_getComputedStyle_Callback";
-  getComputedStyle_Callback_2_(mthis, __arg_0, __arg_1) => getComputedStyle_Callback_2(mthis, __arg_0, __arg_1);
+  name_Setter_(mthis, __arg_0) => mthis["name"] = __arg_0;
 
-  static getComputedStyle_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Window_getComputedStyle_Callback";
-  getComputedStyle_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getComputedStyle_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  navigator_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "navigator");
 
-  static getComputedStyle_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Window_getComputedStyle_Callback";
-  getComputedStyle_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => getComputedStyle_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  offscreenBuffering_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "offscreenBuffering");
 
-  static getMatchedCSSRules_Callback_0(mthis) native "Window_getMatchedCSSRules_Callback";
-  getMatchedCSSRules_Callback_0_(mthis) => getMatchedCSSRules_Callback_0(mthis);
+  onabort_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onabort");
 
-  static getMatchedCSSRules_Callback_1(mthis, __arg_0) native "Window_getMatchedCSSRules_Callback";
-  getMatchedCSSRules_Callback_1_(mthis, __arg_0) => getMatchedCSSRules_Callback_1(mthis, __arg_0);
+  onabort_Setter_(mthis, __arg_0) => mthis["onabort"] = __arg_0;
 
-  static getMatchedCSSRules_Callback_2(mthis, __arg_0, __arg_1) native "Window_getMatchedCSSRules_Callback";
-  getMatchedCSSRules_Callback_2_(mthis, __arg_0, __arg_1) => getMatchedCSSRules_Callback_2(mthis, __arg_0, __arg_1);
+  onanimationend_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onanimationend");
 
-  static getMatchedCSSRules_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Window_getMatchedCSSRules_Callback";
-  getMatchedCSSRules_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getMatchedCSSRules_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  onanimationend_Setter_(mthis, __arg_0) => mthis["onanimationend"] = __arg_0;
 
-  static getMatchedCSSRules_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Window_getMatchedCSSRules_Callback";
-  getMatchedCSSRules_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => getMatchedCSSRules_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  onanimationiteration_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onanimationiteration");
 
-  static getSelection_Callback_0(mthis) native "Window_getSelection_Callback";
-  getSelection_Callback_0_(mthis) => getSelection_Callback_0(mthis);
+  onanimationiteration_Setter_(mthis, __arg_0) => mthis["onanimationiteration"] = __arg_0;
 
-  static getSelection_Callback_1(mthis, __arg_0) native "Window_getSelection_Callback";
-  getSelection_Callback_1_(mthis, __arg_0) => getSelection_Callback_1(mthis, __arg_0);
+  onanimationstart_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onanimationstart");
 
-  static getSelection_Callback_2(mthis, __arg_0, __arg_1) native "Window_getSelection_Callback";
-  getSelection_Callback_2_(mthis, __arg_0, __arg_1) => getSelection_Callback_2(mthis, __arg_0, __arg_1);
+  onanimationstart_Setter_(mthis, __arg_0) => mthis["onanimationstart"] = __arg_0;
 
-  static history_Getter(mthis) native "Window_history_Getter";
-  history_Getter_(mthis) => history_Getter(mthis);
+  onautocomplete_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onautocomplete");
 
-  static indexedDB_Getter(mthis) native "Window_indexedDB_Getter";
-  indexedDB_Getter_(mthis) => indexedDB_Getter(mthis);
+  onautocomplete_Setter_(mthis, __arg_0) => mthis["onautocomplete"] = __arg_0;
 
-  static innerHeight_Getter(mthis) native "Window_innerHeight_Getter";
-  innerHeight_Getter_(mthis) => innerHeight_Getter(mthis);
+  onautocompleteerror_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onautocompleteerror");
 
-  static innerWidth_Getter(mthis) native "Window_innerWidth_Getter";
-  innerWidth_Getter_(mthis) => innerWidth_Getter(mthis);
+  onautocompleteerror_Setter_(mthis, __arg_0) => mthis["onautocompleteerror"] = __arg_0;
 
-  static length_Getter(mthis) native "Window_length_Getter";
-  length_Getter_(mthis) => length_Getter(mthis);
+  onbeforeunload_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onbeforeunload");
 
-  static localStorage_Getter(mthis) native "Window_localStorage_Getter";
-  localStorage_Getter_(mthis) => localStorage_Getter(mthis);
+  onbeforeunload_Setter_(mthis, __arg_0) => mthis["onbeforeunload"] = __arg_0;
 
-  static location_Getter(mthis) native "Window_location_Getter";
-  location_Getter_(mthis) => location_Getter(mthis);
+  onblur_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onblur");
 
-  static location_Setter(mthis, __arg_0) native "Window_location_Setter";
-  location_Setter_(mthis, __arg_0) => location_Setter(mthis, __arg_0);
+  onblur_Setter_(mthis, __arg_0) => mthis["onblur"] = __arg_0;
 
-  static locationbar_Getter(mthis) native "Window_locationbar_Getter";
-  locationbar_Getter_(mthis) => locationbar_Getter(mthis);
+  oncancel_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "oncancel");
 
-  static matchMedia_Callback_0(mthis) native "Window_matchMedia_Callback";
-  matchMedia_Callback_0_(mthis) => matchMedia_Callback_0(mthis);
+  oncancel_Setter_(mthis, __arg_0) => mthis["oncancel"] = __arg_0;
 
-  static matchMedia_Callback_1(mthis, __arg_0) native "Window_matchMedia_Callback";
-  matchMedia_Callback_1_(mthis, __arg_0) => matchMedia_Callback_1(mthis, __arg_0);
+  oncanplay_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "oncanplay");
 
-  static matchMedia_Callback_2(mthis, __arg_0, __arg_1) native "Window_matchMedia_Callback";
-  matchMedia_Callback_2_(mthis, __arg_0, __arg_1) => matchMedia_Callback_2(mthis, __arg_0, __arg_1);
+  oncanplay_Setter_(mthis, __arg_0) => mthis["oncanplay"] = __arg_0;
 
-  static matchMedia_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Window_matchMedia_Callback";
-  matchMedia_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => matchMedia_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  oncanplaythrough_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "oncanplaythrough");
 
-  static menubar_Getter(mthis) native "Window_menubar_Getter";
-  menubar_Getter_(mthis) => menubar_Getter(mthis);
+  oncanplaythrough_Setter_(mthis, __arg_0) => mthis["oncanplaythrough"] = __arg_0;
 
-  static moveBy_Callback_0(mthis) native "Window_moveBy_Callback";
-  moveBy_Callback_0_(mthis) => moveBy_Callback_0(mthis);
+  onchange_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onchange");
 
-  static moveBy_Callback_1(mthis, __arg_0) native "Window_moveBy_Callback";
-  moveBy_Callback_1_(mthis, __arg_0) => moveBy_Callback_1(mthis, __arg_0);
+  onchange_Setter_(mthis, __arg_0) => mthis["onchange"] = __arg_0;
 
-  static moveBy_Callback_2(mthis, __arg_0, __arg_1) native "Window_moveBy_Callback";
-  moveBy_Callback_2_(mthis, __arg_0, __arg_1) => moveBy_Callback_2(mthis, __arg_0, __arg_1);
+  onclick_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onclick");
 
-  static moveBy_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Window_moveBy_Callback";
-  moveBy_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => moveBy_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  onclick_Setter_(mthis, __arg_0) => mthis["onclick"] = __arg_0;
 
-  static moveBy_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Window_moveBy_Callback";
-  moveBy_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => moveBy_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  onclose_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onclose");
 
-  static moveTo_Callback_0(mthis) native "Window_moveTo_Callback";
-  moveTo_Callback_0_(mthis) => moveTo_Callback_0(mthis);
+  onclose_Setter_(mthis, __arg_0) => mthis["onclose"] = __arg_0;
 
-  static moveTo_Callback_1(mthis, __arg_0) native "Window_moveTo_Callback";
-  moveTo_Callback_1_(mthis, __arg_0) => moveTo_Callback_1(mthis, __arg_0);
+  oncontextmenu_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "oncontextmenu");
 
-  static moveTo_Callback_2(mthis, __arg_0, __arg_1) native "Window_moveTo_Callback";
-  moveTo_Callback_2_(mthis, __arg_0, __arg_1) => moveTo_Callback_2(mthis, __arg_0, __arg_1);
+  oncontextmenu_Setter_(mthis, __arg_0) => mthis["oncontextmenu"] = __arg_0;
 
-  static moveTo_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Window_moveTo_Callback";
-  moveTo_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => moveTo_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  oncuechange_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "oncuechange");
 
-  static moveTo_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Window_moveTo_Callback";
-  moveTo_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => moveTo_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  oncuechange_Setter_(mthis, __arg_0) => mthis["oncuechange"] = __arg_0;
 
-  static name_Getter(mthis) native "Window_name_Getter";
-  name_Getter_(mthis) => name_Getter(mthis);
+  ondblclick_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ondblclick");
 
-  static name_Setter(mthis, __arg_0) native "Window_name_Setter";
-  name_Setter_(mthis, __arg_0) => name_Setter(mthis, __arg_0);
+  ondblclick_Setter_(mthis, __arg_0) => mthis["ondblclick"] = __arg_0;
 
-  static navigator_Getter(mthis) native "Window_navigator_Getter";
-  navigator_Getter_(mthis) => navigator_Getter(mthis);
+  ondevicelight_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ondevicelight");
 
-  static offscreenBuffering_Getter(mthis) native "Window_offscreenBuffering_Getter";
-  offscreenBuffering_Getter_(mthis) => offscreenBuffering_Getter(mthis);
+  ondevicelight_Setter_(mthis, __arg_0) => mthis["ondevicelight"] = __arg_0;
 
-  static onabort_Getter(mthis) native "Window_onabort_Getter";
-  onabort_Getter_(mthis) => onabort_Getter(mthis);
+  ondevicemotion_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ondevicemotion");
 
-  static onabort_Setter(mthis, __arg_0) native "Window_onabort_Setter";
-  onabort_Setter_(mthis, __arg_0) => onabort_Setter(mthis, __arg_0);
+  ondevicemotion_Setter_(mthis, __arg_0) => mthis["ondevicemotion"] = __arg_0;
 
-  static onanimationend_Getter(mthis) native "Window_onanimationend_Getter";
-  onanimationend_Getter_(mthis) => onanimationend_Getter(mthis);
+  ondeviceorientation_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ondeviceorientation");
 
-  static onanimationend_Setter(mthis, __arg_0) native "Window_onanimationend_Setter";
-  onanimationend_Setter_(mthis, __arg_0) => onanimationend_Setter(mthis, __arg_0);
+  ondeviceorientation_Setter_(mthis, __arg_0) => mthis["ondeviceorientation"] = __arg_0;
 
-  static onanimationiteration_Getter(mthis) native "Window_onanimationiteration_Getter";
-  onanimationiteration_Getter_(mthis) => onanimationiteration_Getter(mthis);
+  ondrag_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ondrag");
 
-  static onanimationiteration_Setter(mthis, __arg_0) native "Window_onanimationiteration_Setter";
-  onanimationiteration_Setter_(mthis, __arg_0) => onanimationiteration_Setter(mthis, __arg_0);
+  ondrag_Setter_(mthis, __arg_0) => mthis["ondrag"] = __arg_0;
 
-  static onanimationstart_Getter(mthis) native "Window_onanimationstart_Getter";
-  onanimationstart_Getter_(mthis) => onanimationstart_Getter(mthis);
+  ondragend_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ondragend");
 
-  static onanimationstart_Setter(mthis, __arg_0) native "Window_onanimationstart_Setter";
-  onanimationstart_Setter_(mthis, __arg_0) => onanimationstart_Setter(mthis, __arg_0);
+  ondragend_Setter_(mthis, __arg_0) => mthis["ondragend"] = __arg_0;
 
-  static onautocomplete_Getter(mthis) native "Window_onautocomplete_Getter";
-  onautocomplete_Getter_(mthis) => onautocomplete_Getter(mthis);
+  ondragenter_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ondragenter");
 
-  static onautocomplete_Setter(mthis, __arg_0) native "Window_onautocomplete_Setter";
-  onautocomplete_Setter_(mthis, __arg_0) => onautocomplete_Setter(mthis, __arg_0);
+  ondragenter_Setter_(mthis, __arg_0) => mthis["ondragenter"] = __arg_0;
 
-  static onautocompleteerror_Getter(mthis) native "Window_onautocompleteerror_Getter";
-  onautocompleteerror_Getter_(mthis) => onautocompleteerror_Getter(mthis);
+  ondragleave_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ondragleave");
 
-  static onautocompleteerror_Setter(mthis, __arg_0) native "Window_onautocompleteerror_Setter";
-  onautocompleteerror_Setter_(mthis, __arg_0) => onautocompleteerror_Setter(mthis, __arg_0);
+  ondragleave_Setter_(mthis, __arg_0) => mthis["ondragleave"] = __arg_0;
 
-  static onbeforeunload_Getter(mthis) native "Window_onbeforeunload_Getter";
-  onbeforeunload_Getter_(mthis) => onbeforeunload_Getter(mthis);
+  ondragover_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ondragover");
 
-  static onbeforeunload_Setter(mthis, __arg_0) native "Window_onbeforeunload_Setter";
-  onbeforeunload_Setter_(mthis, __arg_0) => onbeforeunload_Setter(mthis, __arg_0);
+  ondragover_Setter_(mthis, __arg_0) => mthis["ondragover"] = __arg_0;
 
-  static onblur_Getter(mthis) native "Window_onblur_Getter";
-  onblur_Getter_(mthis) => onblur_Getter(mthis);
+  ondragstart_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ondragstart");
 
-  static onblur_Setter(mthis, __arg_0) native "Window_onblur_Setter";
-  onblur_Setter_(mthis, __arg_0) => onblur_Setter(mthis, __arg_0);
+  ondragstart_Setter_(mthis, __arg_0) => mthis["ondragstart"] = __arg_0;
 
-  static oncancel_Getter(mthis) native "Window_oncancel_Getter";
-  oncancel_Getter_(mthis) => oncancel_Getter(mthis);
+  ondrop_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ondrop");
 
-  static oncancel_Setter(mthis, __arg_0) native "Window_oncancel_Setter";
-  oncancel_Setter_(mthis, __arg_0) => oncancel_Setter(mthis, __arg_0);
+  ondrop_Setter_(mthis, __arg_0) => mthis["ondrop"] = __arg_0;
 
-  static oncanplay_Getter(mthis) native "Window_oncanplay_Getter";
-  oncanplay_Getter_(mthis) => oncanplay_Getter(mthis);
+  ondurationchange_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ondurationchange");
 
-  static oncanplay_Setter(mthis, __arg_0) native "Window_oncanplay_Setter";
-  oncanplay_Setter_(mthis, __arg_0) => oncanplay_Setter(mthis, __arg_0);
+  ondurationchange_Setter_(mthis, __arg_0) => mthis["ondurationchange"] = __arg_0;
 
-  static oncanplaythrough_Getter(mthis) native "Window_oncanplaythrough_Getter";
-  oncanplaythrough_Getter_(mthis) => oncanplaythrough_Getter(mthis);
+  onemptied_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onemptied");
 
-  static oncanplaythrough_Setter(mthis, __arg_0) native "Window_oncanplaythrough_Setter";
-  oncanplaythrough_Setter_(mthis, __arg_0) => oncanplaythrough_Setter(mthis, __arg_0);
+  onemptied_Setter_(mthis, __arg_0) => mthis["onemptied"] = __arg_0;
 
-  static onchange_Getter(mthis) native "Window_onchange_Getter";
-  onchange_Getter_(mthis) => onchange_Getter(mthis);
+  onended_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onended");
 
-  static onchange_Setter(mthis, __arg_0) native "Window_onchange_Setter";
-  onchange_Setter_(mthis, __arg_0) => onchange_Setter(mthis, __arg_0);
+  onended_Setter_(mthis, __arg_0) => mthis["onended"] = __arg_0;
 
-  static onclick_Getter(mthis) native "Window_onclick_Getter";
-  onclick_Getter_(mthis) => onclick_Getter(mthis);
+  onerror_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onerror");
 
-  static onclick_Setter(mthis, __arg_0) native "Window_onclick_Setter";
-  onclick_Setter_(mthis, __arg_0) => onclick_Setter(mthis, __arg_0);
+  onerror_Setter_(mthis, __arg_0) => mthis["onerror"] = __arg_0;
 
-  static onclose_Getter(mthis) native "Window_onclose_Getter";
-  onclose_Getter_(mthis) => onclose_Getter(mthis);
+  onfocus_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onfocus");
 
-  static onclose_Setter(mthis, __arg_0) native "Window_onclose_Setter";
-  onclose_Setter_(mthis, __arg_0) => onclose_Setter(mthis, __arg_0);
+  onfocus_Setter_(mthis, __arg_0) => mthis["onfocus"] = __arg_0;
 
-  static oncontextmenu_Getter(mthis) native "Window_oncontextmenu_Getter";
-  oncontextmenu_Getter_(mthis) => oncontextmenu_Getter(mthis);
+  onhashchange_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onhashchange");
 
-  static oncontextmenu_Setter(mthis, __arg_0) native "Window_oncontextmenu_Setter";
-  oncontextmenu_Setter_(mthis, __arg_0) => oncontextmenu_Setter(mthis, __arg_0);
+  onhashchange_Setter_(mthis, __arg_0) => mthis["onhashchange"] = __arg_0;
 
-  static oncuechange_Getter(mthis) native "Window_oncuechange_Getter";
-  oncuechange_Getter_(mthis) => oncuechange_Getter(mthis);
+  oninput_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "oninput");
 
-  static oncuechange_Setter(mthis, __arg_0) native "Window_oncuechange_Setter";
-  oncuechange_Setter_(mthis, __arg_0) => oncuechange_Setter(mthis, __arg_0);
+  oninput_Setter_(mthis, __arg_0) => mthis["oninput"] = __arg_0;
 
-  static ondblclick_Getter(mthis) native "Window_ondblclick_Getter";
-  ondblclick_Getter_(mthis) => ondblclick_Getter(mthis);
+  oninvalid_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "oninvalid");
 
-  static ondblclick_Setter(mthis, __arg_0) native "Window_ondblclick_Setter";
-  ondblclick_Setter_(mthis, __arg_0) => ondblclick_Setter(mthis, __arg_0);
+  oninvalid_Setter_(mthis, __arg_0) => mthis["oninvalid"] = __arg_0;
 
-  static ondevicelight_Getter(mthis) native "Window_ondevicelight_Getter";
-  ondevicelight_Getter_(mthis) => ondevicelight_Getter(mthis);
+  onkeydown_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onkeydown");
 
-  static ondevicelight_Setter(mthis, __arg_0) native "Window_ondevicelight_Setter";
-  ondevicelight_Setter_(mthis, __arg_0) => ondevicelight_Setter(mthis, __arg_0);
+  onkeydown_Setter_(mthis, __arg_0) => mthis["onkeydown"] = __arg_0;
 
-  static ondevicemotion_Getter(mthis) native "Window_ondevicemotion_Getter";
-  ondevicemotion_Getter_(mthis) => ondevicemotion_Getter(mthis);
+  onkeypress_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onkeypress");
 
-  static ondevicemotion_Setter(mthis, __arg_0) native "Window_ondevicemotion_Setter";
-  ondevicemotion_Setter_(mthis, __arg_0) => ondevicemotion_Setter(mthis, __arg_0);
+  onkeypress_Setter_(mthis, __arg_0) => mthis["onkeypress"] = __arg_0;
 
-  static ondeviceorientation_Getter(mthis) native "Window_ondeviceorientation_Getter";
-  ondeviceorientation_Getter_(mthis) => ondeviceorientation_Getter(mthis);
+  onkeyup_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onkeyup");
 
-  static ondeviceorientation_Setter(mthis, __arg_0) native "Window_ondeviceorientation_Setter";
-  ondeviceorientation_Setter_(mthis, __arg_0) => ondeviceorientation_Setter(mthis, __arg_0);
+  onkeyup_Setter_(mthis, __arg_0) => mthis["onkeyup"] = __arg_0;
 
-  static ondrag_Getter(mthis) native "Window_ondrag_Getter";
-  ondrag_Getter_(mthis) => ondrag_Getter(mthis);
+  onlanguagechange_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onlanguagechange");
 
-  static ondrag_Setter(mthis, __arg_0) native "Window_ondrag_Setter";
-  ondrag_Setter_(mthis, __arg_0) => ondrag_Setter(mthis, __arg_0);
+  onlanguagechange_Setter_(mthis, __arg_0) => mthis["onlanguagechange"] = __arg_0;
 
-  static ondragend_Getter(mthis) native "Window_ondragend_Getter";
-  ondragend_Getter_(mthis) => ondragend_Getter(mthis);
+  onload_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onload");
 
-  static ondragend_Setter(mthis, __arg_0) native "Window_ondragend_Setter";
-  ondragend_Setter_(mthis, __arg_0) => ondragend_Setter(mthis, __arg_0);
+  onload_Setter_(mthis, __arg_0) => mthis["onload"] = __arg_0;
 
-  static ondragenter_Getter(mthis) native "Window_ondragenter_Getter";
-  ondragenter_Getter_(mthis) => ondragenter_Getter(mthis);
+  onloadeddata_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onloadeddata");
 
-  static ondragenter_Setter(mthis, __arg_0) native "Window_ondragenter_Setter";
-  ondragenter_Setter_(mthis, __arg_0) => ondragenter_Setter(mthis, __arg_0);
+  onloadeddata_Setter_(mthis, __arg_0) => mthis["onloadeddata"] = __arg_0;
 
-  static ondragleave_Getter(mthis) native "Window_ondragleave_Getter";
-  ondragleave_Getter_(mthis) => ondragleave_Getter(mthis);
+  onloadedmetadata_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onloadedmetadata");
 
-  static ondragleave_Setter(mthis, __arg_0) native "Window_ondragleave_Setter";
-  ondragleave_Setter_(mthis, __arg_0) => ondragleave_Setter(mthis, __arg_0);
+  onloadedmetadata_Setter_(mthis, __arg_0) => mthis["onloadedmetadata"] = __arg_0;
 
-  static ondragover_Getter(mthis) native "Window_ondragover_Getter";
-  ondragover_Getter_(mthis) => ondragover_Getter(mthis);
+  onloadstart_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onloadstart");
 
-  static ondragover_Setter(mthis, __arg_0) native "Window_ondragover_Setter";
-  ondragover_Setter_(mthis, __arg_0) => ondragover_Setter(mthis, __arg_0);
+  onloadstart_Setter_(mthis, __arg_0) => mthis["onloadstart"] = __arg_0;
 
-  static ondragstart_Getter(mthis) native "Window_ondragstart_Getter";
-  ondragstart_Getter_(mthis) => ondragstart_Getter(mthis);
+  onmessage_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onmessage");
 
-  static ondragstart_Setter(mthis, __arg_0) native "Window_ondragstart_Setter";
-  ondragstart_Setter_(mthis, __arg_0) => ondragstart_Setter(mthis, __arg_0);
+  onmessage_Setter_(mthis, __arg_0) => mthis["onmessage"] = __arg_0;
 
-  static ondrop_Getter(mthis) native "Window_ondrop_Getter";
-  ondrop_Getter_(mthis) => ondrop_Getter(mthis);
+  onmousedown_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onmousedown");
 
-  static ondrop_Setter(mthis, __arg_0) native "Window_ondrop_Setter";
-  ondrop_Setter_(mthis, __arg_0) => ondrop_Setter(mthis, __arg_0);
+  onmousedown_Setter_(mthis, __arg_0) => mthis["onmousedown"] = __arg_0;
 
-  static ondurationchange_Getter(mthis) native "Window_ondurationchange_Getter";
-  ondurationchange_Getter_(mthis) => ondurationchange_Getter(mthis);
+  onmouseenter_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onmouseenter");
 
-  static ondurationchange_Setter(mthis, __arg_0) native "Window_ondurationchange_Setter";
-  ondurationchange_Setter_(mthis, __arg_0) => ondurationchange_Setter(mthis, __arg_0);
+  onmouseenter_Setter_(mthis, __arg_0) => mthis["onmouseenter"] = __arg_0;
 
-  static onemptied_Getter(mthis) native "Window_onemptied_Getter";
-  onemptied_Getter_(mthis) => onemptied_Getter(mthis);
+  onmouseleave_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onmouseleave");
 
-  static onemptied_Setter(mthis, __arg_0) native "Window_onemptied_Setter";
-  onemptied_Setter_(mthis, __arg_0) => onemptied_Setter(mthis, __arg_0);
+  onmouseleave_Setter_(mthis, __arg_0) => mthis["onmouseleave"] = __arg_0;
 
-  static onended_Getter(mthis) native "Window_onended_Getter";
-  onended_Getter_(mthis) => onended_Getter(mthis);
+  onmousemove_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onmousemove");
 
-  static onended_Setter(mthis, __arg_0) native "Window_onended_Setter";
-  onended_Setter_(mthis, __arg_0) => onended_Setter(mthis, __arg_0);
+  onmousemove_Setter_(mthis, __arg_0) => mthis["onmousemove"] = __arg_0;
 
-  static onerror_Getter(mthis) native "Window_onerror_Getter";
-  onerror_Getter_(mthis) => onerror_Getter(mthis);
+  onmouseout_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onmouseout");
 
-  static onerror_Setter(mthis, __arg_0) native "Window_onerror_Setter";
-  onerror_Setter_(mthis, __arg_0) => onerror_Setter(mthis, __arg_0);
+  onmouseout_Setter_(mthis, __arg_0) => mthis["onmouseout"] = __arg_0;
 
-  static onfocus_Getter(mthis) native "Window_onfocus_Getter";
-  onfocus_Getter_(mthis) => onfocus_Getter(mthis);
+  onmouseover_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onmouseover");
 
-  static onfocus_Setter(mthis, __arg_0) native "Window_onfocus_Setter";
-  onfocus_Setter_(mthis, __arg_0) => onfocus_Setter(mthis, __arg_0);
+  onmouseover_Setter_(mthis, __arg_0) => mthis["onmouseover"] = __arg_0;
 
-  static onhashchange_Getter(mthis) native "Window_onhashchange_Getter";
-  onhashchange_Getter_(mthis) => onhashchange_Getter(mthis);
+  onmouseup_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onmouseup");
 
-  static onhashchange_Setter(mthis, __arg_0) native "Window_onhashchange_Setter";
-  onhashchange_Setter_(mthis, __arg_0) => onhashchange_Setter(mthis, __arg_0);
+  onmouseup_Setter_(mthis, __arg_0) => mthis["onmouseup"] = __arg_0;
 
-  static oninput_Getter(mthis) native "Window_oninput_Getter";
-  oninput_Getter_(mthis) => oninput_Getter(mthis);
+  onmousewheel_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onmousewheel");
 
-  static oninput_Setter(mthis, __arg_0) native "Window_oninput_Setter";
-  oninput_Setter_(mthis, __arg_0) => oninput_Setter(mthis, __arg_0);
+  onmousewheel_Setter_(mthis, __arg_0) => mthis["onmousewheel"] = __arg_0;
 
-  static oninvalid_Getter(mthis) native "Window_oninvalid_Getter";
-  oninvalid_Getter_(mthis) => oninvalid_Getter(mthis);
+  onoffline_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onoffline");
 
-  static oninvalid_Setter(mthis, __arg_0) native "Window_oninvalid_Setter";
-  oninvalid_Setter_(mthis, __arg_0) => oninvalid_Setter(mthis, __arg_0);
+  onoffline_Setter_(mthis, __arg_0) => mthis["onoffline"] = __arg_0;
 
-  static onkeydown_Getter(mthis) native "Window_onkeydown_Getter";
-  onkeydown_Getter_(mthis) => onkeydown_Getter(mthis);
+  ononline_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ononline");
 
-  static onkeydown_Setter(mthis, __arg_0) native "Window_onkeydown_Setter";
-  onkeydown_Setter_(mthis, __arg_0) => onkeydown_Setter(mthis, __arg_0);
+  ononline_Setter_(mthis, __arg_0) => mthis["ononline"] = __arg_0;
 
-  static onkeypress_Getter(mthis) native "Window_onkeypress_Getter";
-  onkeypress_Getter_(mthis) => onkeypress_Getter(mthis);
+  onorientationchange_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onorientationchange");
 
-  static onkeypress_Setter(mthis, __arg_0) native "Window_onkeypress_Setter";
-  onkeypress_Setter_(mthis, __arg_0) => onkeypress_Setter(mthis, __arg_0);
+  onorientationchange_Setter_(mthis, __arg_0) => mthis["onorientationchange"] = __arg_0;
 
-  static onkeyup_Getter(mthis) native "Window_onkeyup_Getter";
-  onkeyup_Getter_(mthis) => onkeyup_Getter(mthis);
+  onpagehide_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onpagehide");
 
-  static onkeyup_Setter(mthis, __arg_0) native "Window_onkeyup_Setter";
-  onkeyup_Setter_(mthis, __arg_0) => onkeyup_Setter(mthis, __arg_0);
+  onpagehide_Setter_(mthis, __arg_0) => mthis["onpagehide"] = __arg_0;
 
-  static onlanguagechange_Getter(mthis) native "Window_onlanguagechange_Getter";
-  onlanguagechange_Getter_(mthis) => onlanguagechange_Getter(mthis);
+  onpageshow_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onpageshow");
 
-  static onlanguagechange_Setter(mthis, __arg_0) native "Window_onlanguagechange_Setter";
-  onlanguagechange_Setter_(mthis, __arg_0) => onlanguagechange_Setter(mthis, __arg_0);
+  onpageshow_Setter_(mthis, __arg_0) => mthis["onpageshow"] = __arg_0;
 
-  static onload_Getter(mthis) native "Window_onload_Getter";
-  onload_Getter_(mthis) => onload_Getter(mthis);
+  onpause_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onpause");
 
-  static onload_Setter(mthis, __arg_0) native "Window_onload_Setter";
-  onload_Setter_(mthis, __arg_0) => onload_Setter(mthis, __arg_0);
+  onpause_Setter_(mthis, __arg_0) => mthis["onpause"] = __arg_0;
 
-  static onloadeddata_Getter(mthis) native "Window_onloadeddata_Getter";
-  onloadeddata_Getter_(mthis) => onloadeddata_Getter(mthis);
+  onplay_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onplay");
 
-  static onloadeddata_Setter(mthis, __arg_0) native "Window_onloadeddata_Setter";
-  onloadeddata_Setter_(mthis, __arg_0) => onloadeddata_Setter(mthis, __arg_0);
+  onplay_Setter_(mthis, __arg_0) => mthis["onplay"] = __arg_0;
 
-  static onloadedmetadata_Getter(mthis) native "Window_onloadedmetadata_Getter";
-  onloadedmetadata_Getter_(mthis) => onloadedmetadata_Getter(mthis);
+  onplaying_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onplaying");
 
-  static onloadedmetadata_Setter(mthis, __arg_0) native "Window_onloadedmetadata_Setter";
-  onloadedmetadata_Setter_(mthis, __arg_0) => onloadedmetadata_Setter(mthis, __arg_0);
+  onplaying_Setter_(mthis, __arg_0) => mthis["onplaying"] = __arg_0;
 
-  static onloadstart_Getter(mthis) native "Window_onloadstart_Getter";
-  onloadstart_Getter_(mthis) => onloadstart_Getter(mthis);
+  onpopstate_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onpopstate");
 
-  static onloadstart_Setter(mthis, __arg_0) native "Window_onloadstart_Setter";
-  onloadstart_Setter_(mthis, __arg_0) => onloadstart_Setter(mthis, __arg_0);
+  onpopstate_Setter_(mthis, __arg_0) => mthis["onpopstate"] = __arg_0;
 
-  static onmessage_Getter(mthis) native "Window_onmessage_Getter";
-  onmessage_Getter_(mthis) => onmessage_Getter(mthis);
+  onprogress_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onprogress");
 
-  static onmessage_Setter(mthis, __arg_0) native "Window_onmessage_Setter";
-  onmessage_Setter_(mthis, __arg_0) => onmessage_Setter(mthis, __arg_0);
+  onprogress_Setter_(mthis, __arg_0) => mthis["onprogress"] = __arg_0;
 
-  static onmousedown_Getter(mthis) native "Window_onmousedown_Getter";
-  onmousedown_Getter_(mthis) => onmousedown_Getter(mthis);
+  onratechange_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onratechange");
 
-  static onmousedown_Setter(mthis, __arg_0) native "Window_onmousedown_Setter";
-  onmousedown_Setter_(mthis, __arg_0) => onmousedown_Setter(mthis, __arg_0);
+  onratechange_Setter_(mthis, __arg_0) => mthis["onratechange"] = __arg_0;
 
-  static onmouseenter_Getter(mthis) native "Window_onmouseenter_Getter";
-  onmouseenter_Getter_(mthis) => onmouseenter_Getter(mthis);
+  onreset_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onreset");
 
-  static onmouseenter_Setter(mthis, __arg_0) native "Window_onmouseenter_Setter";
-  onmouseenter_Setter_(mthis, __arg_0) => onmouseenter_Setter(mthis, __arg_0);
+  onreset_Setter_(mthis, __arg_0) => mthis["onreset"] = __arg_0;
 
-  static onmouseleave_Getter(mthis) native "Window_onmouseleave_Getter";
-  onmouseleave_Getter_(mthis) => onmouseleave_Getter(mthis);
+  onresize_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onresize");
 
-  static onmouseleave_Setter(mthis, __arg_0) native "Window_onmouseleave_Setter";
-  onmouseleave_Setter_(mthis, __arg_0) => onmouseleave_Setter(mthis, __arg_0);
+  onresize_Setter_(mthis, __arg_0) => mthis["onresize"] = __arg_0;
 
-  static onmousemove_Getter(mthis) native "Window_onmousemove_Getter";
-  onmousemove_Getter_(mthis) => onmousemove_Getter(mthis);
-
-  static onmousemove_Setter(mthis, __arg_0) native "Window_onmousemove_Setter";
-  onmousemove_Setter_(mthis, __arg_0) => onmousemove_Setter(mthis, __arg_0);
-
-  static onmouseout_Getter(mthis) native "Window_onmouseout_Getter";
-  onmouseout_Getter_(mthis) => onmouseout_Getter(mthis);
-
-  static onmouseout_Setter(mthis, __arg_0) native "Window_onmouseout_Setter";
-  onmouseout_Setter_(mthis, __arg_0) => onmouseout_Setter(mthis, __arg_0);
-
-  static onmouseover_Getter(mthis) native "Window_onmouseover_Getter";
-  onmouseover_Getter_(mthis) => onmouseover_Getter(mthis);
-
-  static onmouseover_Setter(mthis, __arg_0) native "Window_onmouseover_Setter";
-  onmouseover_Setter_(mthis, __arg_0) => onmouseover_Setter(mthis, __arg_0);
-
-  static onmouseup_Getter(mthis) native "Window_onmouseup_Getter";
-  onmouseup_Getter_(mthis) => onmouseup_Getter(mthis);
-
-  static onmouseup_Setter(mthis, __arg_0) native "Window_onmouseup_Setter";
-  onmouseup_Setter_(mthis, __arg_0) => onmouseup_Setter(mthis, __arg_0);
-
-  static onmousewheel_Getter(mthis) native "Window_onmousewheel_Getter";
-  onmousewheel_Getter_(mthis) => onmousewheel_Getter(mthis);
-
-  static onmousewheel_Setter(mthis, __arg_0) native "Window_onmousewheel_Setter";
-  onmousewheel_Setter_(mthis, __arg_0) => onmousewheel_Setter(mthis, __arg_0);
-
-  static onoffline_Getter(mthis) native "Window_onoffline_Getter";
-  onoffline_Getter_(mthis) => onoffline_Getter(mthis);
-
-  static onoffline_Setter(mthis, __arg_0) native "Window_onoffline_Setter";
-  onoffline_Setter_(mthis, __arg_0) => onoffline_Setter(mthis, __arg_0);
-
-  static ononline_Getter(mthis) native "Window_ononline_Getter";
-  ononline_Getter_(mthis) => ononline_Getter(mthis);
-
-  static ononline_Setter(mthis, __arg_0) native "Window_ononline_Setter";
-  ononline_Setter_(mthis, __arg_0) => ononline_Setter(mthis, __arg_0);
-
-  static onorientationchange_Getter(mthis) native "Window_onorientationchange_Getter";
-  onorientationchange_Getter_(mthis) => onorientationchange_Getter(mthis);
-
-  static onorientationchange_Setter(mthis, __arg_0) native "Window_onorientationchange_Setter";
-  onorientationchange_Setter_(mthis, __arg_0) => onorientationchange_Setter(mthis, __arg_0);
-
-  static onpagehide_Getter(mthis) native "Window_onpagehide_Getter";
-  onpagehide_Getter_(mthis) => onpagehide_Getter(mthis);
-
-  static onpagehide_Setter(mthis, __arg_0) native "Window_onpagehide_Setter";
-  onpagehide_Setter_(mthis, __arg_0) => onpagehide_Setter(mthis, __arg_0);
-
-  static onpageshow_Getter(mthis) native "Window_onpageshow_Getter";
-  onpageshow_Getter_(mthis) => onpageshow_Getter(mthis);
-
-  static onpageshow_Setter(mthis, __arg_0) native "Window_onpageshow_Setter";
-  onpageshow_Setter_(mthis, __arg_0) => onpageshow_Setter(mthis, __arg_0);
-
-  static onpause_Getter(mthis) native "Window_onpause_Getter";
-  onpause_Getter_(mthis) => onpause_Getter(mthis);
-
-  static onpause_Setter(mthis, __arg_0) native "Window_onpause_Setter";
-  onpause_Setter_(mthis, __arg_0) => onpause_Setter(mthis, __arg_0);
-
-  static onplay_Getter(mthis) native "Window_onplay_Getter";
-  onplay_Getter_(mthis) => onplay_Getter(mthis);
-
-  static onplay_Setter(mthis, __arg_0) native "Window_onplay_Setter";
-  onplay_Setter_(mthis, __arg_0) => onplay_Setter(mthis, __arg_0);
-
-  static onplaying_Getter(mthis) native "Window_onplaying_Getter";
-  onplaying_Getter_(mthis) => onplaying_Getter(mthis);
-
-  static onplaying_Setter(mthis, __arg_0) native "Window_onplaying_Setter";
-  onplaying_Setter_(mthis, __arg_0) => onplaying_Setter(mthis, __arg_0);
-
-  static onpopstate_Getter(mthis) native "Window_onpopstate_Getter";
-  onpopstate_Getter_(mthis) => onpopstate_Getter(mthis);
-
-  static onpopstate_Setter(mthis, __arg_0) native "Window_onpopstate_Setter";
-  onpopstate_Setter_(mthis, __arg_0) => onpopstate_Setter(mthis, __arg_0);
-
-  static onprogress_Getter(mthis) native "Window_onprogress_Getter";
-  onprogress_Getter_(mthis) => onprogress_Getter(mthis);
-
-  static onprogress_Setter(mthis, __arg_0) native "Window_onprogress_Setter";
-  onprogress_Setter_(mthis, __arg_0) => onprogress_Setter(mthis, __arg_0);
-
-  static onratechange_Getter(mthis) native "Window_onratechange_Getter";
-  onratechange_Getter_(mthis) => onratechange_Getter(mthis);
-
-  static onratechange_Setter(mthis, __arg_0) native "Window_onratechange_Setter";
-  onratechange_Setter_(mthis, __arg_0) => onratechange_Setter(mthis, __arg_0);
-
-  static onreset_Getter(mthis) native "Window_onreset_Getter";
-  onreset_Getter_(mthis) => onreset_Getter(mthis);
-
-  static onreset_Setter(mthis, __arg_0) native "Window_onreset_Setter";
-  onreset_Setter_(mthis, __arg_0) => onreset_Setter(mthis, __arg_0);
-
-  static onresize_Getter(mthis) native "Window_onresize_Getter";
-  onresize_Getter_(mthis) => onresize_Getter(mthis);
-
-  static onresize_Setter(mthis, __arg_0) native "Window_onresize_Setter";
-  onresize_Setter_(mthis, __arg_0) => onresize_Setter(mthis, __arg_0);
-
-  static onscroll_Getter(mthis) native "Window_onscroll_Getter";
-  onscroll_Getter_(mthis) => onscroll_Getter(mthis);
-
-  static onscroll_Setter(mthis, __arg_0) native "Window_onscroll_Setter";
-  onscroll_Setter_(mthis, __arg_0) => onscroll_Setter(mthis, __arg_0);
-
-  static onsearch_Getter(mthis) native "Window_onsearch_Getter";
-  onsearch_Getter_(mthis) => onsearch_Getter(mthis);
-
-  static onsearch_Setter(mthis, __arg_0) native "Window_onsearch_Setter";
-  onsearch_Setter_(mthis, __arg_0) => onsearch_Setter(mthis, __arg_0);
-
-  static onseeked_Getter(mthis) native "Window_onseeked_Getter";
-  onseeked_Getter_(mthis) => onseeked_Getter(mthis);
-
-  static onseeked_Setter(mthis, __arg_0) native "Window_onseeked_Setter";
-  onseeked_Setter_(mthis, __arg_0) => onseeked_Setter(mthis, __arg_0);
-
-  static onseeking_Getter(mthis) native "Window_onseeking_Getter";
-  onseeking_Getter_(mthis) => onseeking_Getter(mthis);
-
-  static onseeking_Setter(mthis, __arg_0) native "Window_onseeking_Setter";
-  onseeking_Setter_(mthis, __arg_0) => onseeking_Setter(mthis, __arg_0);
-
-  static onselect_Getter(mthis) native "Window_onselect_Getter";
-  onselect_Getter_(mthis) => onselect_Getter(mthis);
-
-  static onselect_Setter(mthis, __arg_0) native "Window_onselect_Setter";
-  onselect_Setter_(mthis, __arg_0) => onselect_Setter(mthis, __arg_0);
-
-  static onshow_Getter(mthis) native "Window_onshow_Getter";
-  onshow_Getter_(mthis) => onshow_Getter(mthis);
-
-  static onshow_Setter(mthis, __arg_0) native "Window_onshow_Setter";
-  onshow_Setter_(mthis, __arg_0) => onshow_Setter(mthis, __arg_0);
-
-  static onstalled_Getter(mthis) native "Window_onstalled_Getter";
-  onstalled_Getter_(mthis) => onstalled_Getter(mthis);
-
-  static onstalled_Setter(mthis, __arg_0) native "Window_onstalled_Setter";
-  onstalled_Setter_(mthis, __arg_0) => onstalled_Setter(mthis, __arg_0);
-
-  static onstorage_Getter(mthis) native "Window_onstorage_Getter";
-  onstorage_Getter_(mthis) => onstorage_Getter(mthis);
-
-  static onstorage_Setter(mthis, __arg_0) native "Window_onstorage_Setter";
-  onstorage_Setter_(mthis, __arg_0) => onstorage_Setter(mthis, __arg_0);
-
-  static onsubmit_Getter(mthis) native "Window_onsubmit_Getter";
-  onsubmit_Getter_(mthis) => onsubmit_Getter(mthis);
-
-  static onsubmit_Setter(mthis, __arg_0) native "Window_onsubmit_Setter";
-  onsubmit_Setter_(mthis, __arg_0) => onsubmit_Setter(mthis, __arg_0);
-
-  static onsuspend_Getter(mthis) native "Window_onsuspend_Getter";
-  onsuspend_Getter_(mthis) => onsuspend_Getter(mthis);
-
-  static onsuspend_Setter(mthis, __arg_0) native "Window_onsuspend_Setter";
-  onsuspend_Setter_(mthis, __arg_0) => onsuspend_Setter(mthis, __arg_0);
-
-  static ontimeupdate_Getter(mthis) native "Window_ontimeupdate_Getter";
-  ontimeupdate_Getter_(mthis) => ontimeupdate_Getter(mthis);
-
-  static ontimeupdate_Setter(mthis, __arg_0) native "Window_ontimeupdate_Setter";
-  ontimeupdate_Setter_(mthis, __arg_0) => ontimeupdate_Setter(mthis, __arg_0);
-
-  static ontoggle_Getter(mthis) native "Window_ontoggle_Getter";
-  ontoggle_Getter_(mthis) => ontoggle_Getter(mthis);
-
-  static ontoggle_Setter(mthis, __arg_0) native "Window_ontoggle_Setter";
-  ontoggle_Setter_(mthis, __arg_0) => ontoggle_Setter(mthis, __arg_0);
-
-  static ontouchcancel_Getter(mthis) native "Window_ontouchcancel_Getter";
-  ontouchcancel_Getter_(mthis) => ontouchcancel_Getter(mthis);
-
-  static ontouchcancel_Setter(mthis, __arg_0) native "Window_ontouchcancel_Setter";
-  ontouchcancel_Setter_(mthis, __arg_0) => ontouchcancel_Setter(mthis, __arg_0);
-
-  static ontouchend_Getter(mthis) native "Window_ontouchend_Getter";
-  ontouchend_Getter_(mthis) => ontouchend_Getter(mthis);
-
-  static ontouchend_Setter(mthis, __arg_0) native "Window_ontouchend_Setter";
-  ontouchend_Setter_(mthis, __arg_0) => ontouchend_Setter(mthis, __arg_0);
-
-  static ontouchmove_Getter(mthis) native "Window_ontouchmove_Getter";
-  ontouchmove_Getter_(mthis) => ontouchmove_Getter(mthis);
-
-  static ontouchmove_Setter(mthis, __arg_0) native "Window_ontouchmove_Setter";
-  ontouchmove_Setter_(mthis, __arg_0) => ontouchmove_Setter(mthis, __arg_0);
-
-  static ontouchstart_Getter(mthis) native "Window_ontouchstart_Getter";
-  ontouchstart_Getter_(mthis) => ontouchstart_Getter(mthis);
-
-  static ontouchstart_Setter(mthis, __arg_0) native "Window_ontouchstart_Setter";
-  ontouchstart_Setter_(mthis, __arg_0) => ontouchstart_Setter(mthis, __arg_0);
-
-  static ontransitionend_Getter(mthis) native "Window_ontransitionend_Getter";
-  ontransitionend_Getter_(mthis) => ontransitionend_Getter(mthis);
-
-  static ontransitionend_Setter(mthis, __arg_0) native "Window_ontransitionend_Setter";
-  ontransitionend_Setter_(mthis, __arg_0) => ontransitionend_Setter(mthis, __arg_0);
-
-  static onunload_Getter(mthis) native "Window_onunload_Getter";
-  onunload_Getter_(mthis) => onunload_Getter(mthis);
+  onscroll_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onscroll");
 
-  static onunload_Setter(mthis, __arg_0) native "Window_onunload_Setter";
-  onunload_Setter_(mthis, __arg_0) => onunload_Setter(mthis, __arg_0);
+  onscroll_Setter_(mthis, __arg_0) => mthis["onscroll"] = __arg_0;
 
-  static onvolumechange_Getter(mthis) native "Window_onvolumechange_Getter";
-  onvolumechange_Getter_(mthis) => onvolumechange_Getter(mthis);
+  onsearch_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onsearch");
 
-  static onvolumechange_Setter(mthis, __arg_0) native "Window_onvolumechange_Setter";
-  onvolumechange_Setter_(mthis, __arg_0) => onvolumechange_Setter(mthis, __arg_0);
+  onsearch_Setter_(mthis, __arg_0) => mthis["onsearch"] = __arg_0;
 
-  static onwaiting_Getter(mthis) native "Window_onwaiting_Getter";
-  onwaiting_Getter_(mthis) => onwaiting_Getter(mthis);
+  onseeked_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onseeked");
 
-  static onwaiting_Setter(mthis, __arg_0) native "Window_onwaiting_Setter";
-  onwaiting_Setter_(mthis, __arg_0) => onwaiting_Setter(mthis, __arg_0);
+  onseeked_Setter_(mthis, __arg_0) => mthis["onseeked"] = __arg_0;
 
-  static onwebkitanimationend_Getter(mthis) native "Window_onwebkitanimationend_Getter";
-  onwebkitanimationend_Getter_(mthis) => onwebkitanimationend_Getter(mthis);
+  onseeking_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onseeking");
 
-  static onwebkitanimationend_Setter(mthis, __arg_0) native "Window_onwebkitanimationend_Setter";
-  onwebkitanimationend_Setter_(mthis, __arg_0) => onwebkitanimationend_Setter(mthis, __arg_0);
+  onseeking_Setter_(mthis, __arg_0) => mthis["onseeking"] = __arg_0;
 
-  static onwebkitanimationiteration_Getter(mthis) native "Window_onwebkitanimationiteration_Getter";
-  onwebkitanimationiteration_Getter_(mthis) => onwebkitanimationiteration_Getter(mthis);
+  onselect_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onselect");
 
-  static onwebkitanimationiteration_Setter(mthis, __arg_0) native "Window_onwebkitanimationiteration_Setter";
-  onwebkitanimationiteration_Setter_(mthis, __arg_0) => onwebkitanimationiteration_Setter(mthis, __arg_0);
+  onselect_Setter_(mthis, __arg_0) => mthis["onselect"] = __arg_0;
 
-  static onwebkitanimationstart_Getter(mthis) native "Window_onwebkitanimationstart_Getter";
-  onwebkitanimationstart_Getter_(mthis) => onwebkitanimationstart_Getter(mthis);
+  onshow_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onshow");
 
-  static onwebkitanimationstart_Setter(mthis, __arg_0) native "Window_onwebkitanimationstart_Setter";
-  onwebkitanimationstart_Setter_(mthis, __arg_0) => onwebkitanimationstart_Setter(mthis, __arg_0);
+  onshow_Setter_(mthis, __arg_0) => mthis["onshow"] = __arg_0;
 
-  static onwebkittransitionend_Getter(mthis) native "Window_onwebkittransitionend_Getter";
-  onwebkittransitionend_Getter_(mthis) => onwebkittransitionend_Getter(mthis);
+  onstalled_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onstalled");
 
-  static onwebkittransitionend_Setter(mthis, __arg_0) native "Window_onwebkittransitionend_Setter";
-  onwebkittransitionend_Setter_(mthis, __arg_0) => onwebkittransitionend_Setter(mthis, __arg_0);
+  onstalled_Setter_(mthis, __arg_0) => mthis["onstalled"] = __arg_0;
 
-  static onwheel_Getter(mthis) native "Window_onwheel_Getter";
-  onwheel_Getter_(mthis) => onwheel_Getter(mthis);
+  onstorage_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onstorage");
 
-  static onwheel_Setter(mthis, __arg_0) native "Window_onwheel_Setter";
-  onwheel_Setter_(mthis, __arg_0) => onwheel_Setter(mthis, __arg_0);
+  onstorage_Setter_(mthis, __arg_0) => mthis["onstorage"] = __arg_0;
 
-  static openDatabase_Callback_2(mthis, __arg_0, __arg_1) native "Window_openDatabase_Callback";
-  openDatabase_Callback_2_(mthis, __arg_0, __arg_1) => openDatabase_Callback_2(mthis, __arg_0, __arg_1);
+  onsubmit_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onsubmit");
 
-  static openDatabase_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Window_openDatabase_Callback";
-  openDatabase_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => openDatabase_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  onsubmit_Setter_(mthis, __arg_0) => mthis["onsubmit"] = __arg_0;
 
-  static openDatabase_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Window_openDatabase_Callback";
-  openDatabase_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => openDatabase_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  onsuspend_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onsuspend");
 
-  static openDatabase_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "Window_openDatabase_Callback";
-  openDatabase_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => openDatabase_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  onsuspend_Setter_(mthis, __arg_0) => mthis["onsuspend"] = __arg_0;
 
-  static openDatabase_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "Window_openDatabase_Callback";
-  openDatabase_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => openDatabase_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  ontimeupdate_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ontimeupdate");
 
-  static openDatabase_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) native "Window_openDatabase_Callback";
-  openDatabase_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => openDatabase_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6);
+  ontimeupdate_Setter_(mthis, __arg_0) => mthis["ontimeupdate"] = __arg_0;
 
-  static open_Callback_0(mthis) native "Window_open_Callback";
-  open_Callback_0_(mthis) => open_Callback_0(mthis);
+  ontoggle_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ontoggle");
 
-  static open_Callback_1(mthis, __arg_0) native "Window_open_Callback";
-  open_Callback_1_(mthis, __arg_0) => open_Callback_1(mthis, __arg_0);
+  ontoggle_Setter_(mthis, __arg_0) => mthis["ontoggle"] = __arg_0;
 
-  static open_Callback_2(mthis, __arg_0, __arg_1) native "Window_open_Callback";
-  open_Callback_2_(mthis, __arg_0, __arg_1) => open_Callback_2(mthis, __arg_0, __arg_1);
+  ontouchcancel_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ontouchcancel");
 
-  static open_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Window_open_Callback";
-  open_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => open_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  ontouchcancel_Setter_(mthis, __arg_0) => mthis["ontouchcancel"] = __arg_0;
 
-  static open_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Window_open_Callback";
-  open_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => open_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  ontouchend_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ontouchend");
 
-  static open_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "Window_open_Callback";
-  open_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => open_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  ontouchend_Setter_(mthis, __arg_0) => mthis["ontouchend"] = __arg_0;
 
-  static opener_Getter(mthis) native "Window_opener_Getter";
-  opener_Getter_(mthis) => opener_Getter(mthis);
+  ontouchmove_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ontouchmove");
 
-  static opener_Setter(mthis, __arg_0) native "Window_opener_Setter";
-  opener_Setter_(mthis, __arg_0) => opener_Setter(mthis, __arg_0);
+  ontouchmove_Setter_(mthis, __arg_0) => mthis["ontouchmove"] = __arg_0;
 
-  static orientation_Getter(mthis) native "Window_orientation_Getter";
-  orientation_Getter_(mthis) => orientation_Getter(mthis);
+  ontouchstart_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ontouchstart");
 
-  static outerHeight_Getter(mthis) native "Window_outerHeight_Getter";
-  outerHeight_Getter_(mthis) => outerHeight_Getter(mthis);
+  ontouchstart_Setter_(mthis, __arg_0) => mthis["ontouchstart"] = __arg_0;
 
-  static outerWidth_Getter(mthis) native "Window_outerWidth_Getter";
-  outerWidth_Getter_(mthis) => outerWidth_Getter(mthis);
+  ontransitionend_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ontransitionend");
 
-  static pageXOffset_Getter(mthis) native "Window_pageXOffset_Getter";
-  pageXOffset_Getter_(mthis) => pageXOffset_Getter(mthis);
+  ontransitionend_Setter_(mthis, __arg_0) => mthis["ontransitionend"] = __arg_0;
 
-  static pageYOffset_Getter(mthis) native "Window_pageYOffset_Getter";
-  pageYOffset_Getter_(mthis) => pageYOffset_Getter(mthis);
+  onunload_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onunload");
 
-  static parent_Getter(mthis) native "Window_parent_Getter";
-  parent_Getter_(mthis) => parent_Getter(mthis);
+  onunload_Setter_(mthis, __arg_0) => mthis["onunload"] = __arg_0;
 
-  static performance_Getter(mthis) native "Window_performance_Getter";
-  performance_Getter_(mthis) => performance_Getter(mthis);
+  onvolumechange_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onvolumechange");
 
-  static personalbar_Getter(mthis) native "Window_personalbar_Getter";
-  personalbar_Getter_(mthis) => personalbar_Getter(mthis);
+  onvolumechange_Setter_(mthis, __arg_0) => mthis["onvolumechange"] = __arg_0;
 
-  static postMessage_Callback_0(mthis) native "Window_postMessage_Callback";
-  postMessage_Callback_0_(mthis) => postMessage_Callback_0(mthis);
+  onwaiting_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onwaiting");
 
-  static postMessage_Callback_1(mthis, __arg_0) native "Window_postMessage_Callback";
-  postMessage_Callback_1_(mthis, __arg_0) => postMessage_Callback_1(mthis, __arg_0);
+  onwaiting_Setter_(mthis, __arg_0) => mthis["onwaiting"] = __arg_0;
 
-  static postMessage_Callback_2(mthis, __arg_0, __arg_1) native "Window_postMessage_Callback";
-  postMessage_Callback_2_(mthis, __arg_0, __arg_1) => postMessage_Callback_2(mthis, __arg_0, __arg_1);
+  onwebkitanimationend_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onwebkitanimationend");
 
-  static postMessage_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Window_postMessage_Callback";
-  postMessage_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => postMessage_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  onwebkitanimationend_Setter_(mthis, __arg_0) => mthis["onwebkitanimationend"] = __arg_0;
 
-  static postMessage_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Window_postMessage_Callback";
-  postMessage_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => postMessage_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  onwebkitanimationiteration_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onwebkitanimationiteration");
 
-  static postMessage_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "Window_postMessage_Callback";
-  postMessage_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => postMessage_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  onwebkitanimationiteration_Setter_(mthis, __arg_0) => mthis["onwebkitanimationiteration"] = __arg_0;
 
-  static print_Callback_0(mthis) native "Window_print_Callback";
-  print_Callback_0_(mthis) => print_Callback_0(mthis);
+  onwebkitanimationstart_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onwebkitanimationstart");
 
-  static print_Callback_1(mthis, __arg_0) native "Window_print_Callback";
-  print_Callback_1_(mthis, __arg_0) => print_Callback_1(mthis, __arg_0);
+  onwebkitanimationstart_Setter_(mthis, __arg_0) => mthis["onwebkitanimationstart"] = __arg_0;
 
-  static print_Callback_2(mthis, __arg_0, __arg_1) native "Window_print_Callback";
-  print_Callback_2_(mthis, __arg_0, __arg_1) => print_Callback_2(mthis, __arg_0, __arg_1);
+  onwebkittransitionend_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onwebkittransitionend");
 
-  static releaseEvents_Callback_0(mthis) native "Window_releaseEvents_Callback";
-  releaseEvents_Callback_0_(mthis) => releaseEvents_Callback_0(mthis);
+  onwebkittransitionend_Setter_(mthis, __arg_0) => mthis["onwebkittransitionend"] = __arg_0;
 
-  static releaseEvents_Callback_1(mthis, __arg_0) native "Window_releaseEvents_Callback";
-  releaseEvents_Callback_1_(mthis, __arg_0) => releaseEvents_Callback_1(mthis, __arg_0);
+  onwheel_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onwheel");
 
-  static releaseEvents_Callback_2(mthis, __arg_0, __arg_1) native "Window_releaseEvents_Callback";
-  releaseEvents_Callback_2_(mthis, __arg_0, __arg_1) => releaseEvents_Callback_2(mthis, __arg_0, __arg_1);
+  onwheel_Setter_(mthis, __arg_0) => mthis["onwheel"] = __arg_0;
 
-  static requestAnimationFrame_Callback_0(mthis) native "Window_requestAnimationFrame_Callback";
-  requestAnimationFrame_Callback_0_(mthis) => requestAnimationFrame_Callback_0(mthis);
+  openDatabase_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "openDatabase", [__arg_0, __arg_1]);
 
-  static requestAnimationFrame_Callback_1(mthis, __arg_0) native "Window_requestAnimationFrame_Callback";
-  requestAnimationFrame_Callback_1_(mthis, __arg_0) => requestAnimationFrame_Callback_1(mthis, __arg_0);
+  openDatabase_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "openDatabase", [__arg_0, __arg_1, __arg_2]);
 
-  static requestAnimationFrame_Callback_2(mthis, __arg_0, __arg_1) native "Window_requestAnimationFrame_Callback";
-  requestAnimationFrame_Callback_2_(mthis, __arg_0, __arg_1) => requestAnimationFrame_Callback_2(mthis, __arg_0, __arg_1);
+  openDatabase_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "openDatabase", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static requestAnimationFrame_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Window_requestAnimationFrame_Callback";
-  requestAnimationFrame_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => requestAnimationFrame_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  openDatabase_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => Blink_JsNative_DomException.callMethod(mthis, "openDatabase", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4]);
 
-  static resizeBy_Callback_0(mthis) native "Window_resizeBy_Callback";
-  resizeBy_Callback_0_(mthis) => resizeBy_Callback_0(mthis);
+  open_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "open", []);
 
-  static resizeBy_Callback_1(mthis, __arg_0) native "Window_resizeBy_Callback";
-  resizeBy_Callback_1_(mthis, __arg_0) => resizeBy_Callback_1(mthis, __arg_0);
+  open_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "open", [__arg_0]);
 
-  static resizeBy_Callback_2(mthis, __arg_0, __arg_1) native "Window_resizeBy_Callback";
-  resizeBy_Callback_2_(mthis, __arg_0, __arg_1) => resizeBy_Callback_2(mthis, __arg_0, __arg_1);
+  open_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "open", [__arg_0, __arg_1]);
 
-  static resizeBy_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Window_resizeBy_Callback";
-  resizeBy_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => resizeBy_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  open_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "open", [__arg_0, __arg_1, __arg_2]);
 
-  static resizeBy_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Window_resizeBy_Callback";
-  resizeBy_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => resizeBy_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  opener_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "opener");
 
-  static resizeTo_Callback_0(mthis) native "Window_resizeTo_Callback";
-  resizeTo_Callback_0_(mthis) => resizeTo_Callback_0(mthis);
+  opener_Setter_(mthis, __arg_0) => mthis["opener"] = __arg_0;
 
-  static resizeTo_Callback_1(mthis, __arg_0) native "Window_resizeTo_Callback";
-  resizeTo_Callback_1_(mthis, __arg_0) => resizeTo_Callback_1(mthis, __arg_0);
+  orientation_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "orientation");
 
-  static resizeTo_Callback_2(mthis, __arg_0, __arg_1) native "Window_resizeTo_Callback";
-  resizeTo_Callback_2_(mthis, __arg_0, __arg_1) => resizeTo_Callback_2(mthis, __arg_0, __arg_1);
+  outerHeight_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "outerHeight");
 
-  static resizeTo_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Window_resizeTo_Callback";
-  resizeTo_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => resizeTo_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  outerWidth_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "outerWidth");
 
-  static resizeTo_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Window_resizeTo_Callback";
-  resizeTo_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => resizeTo_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  pageXOffset_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "pageXOffset");
 
-  static screenLeft_Getter(mthis) native "Window_screenLeft_Getter";
-  screenLeft_Getter_(mthis) => screenLeft_Getter(mthis);
+  pageYOffset_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "pageYOffset");
 
-  static screenTop_Getter(mthis) native "Window_screenTop_Getter";
-  screenTop_Getter_(mthis) => screenTop_Getter(mthis);
+  parent_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "parent");
 
-  static screenX_Getter(mthis) native "Window_screenX_Getter";
-  screenX_Getter_(mthis) => screenX_Getter(mthis);
+  performance_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "performance");
 
-  static screenY_Getter(mthis) native "Window_screenY_Getter";
-  screenY_Getter_(mthis) => screenY_Getter(mthis);
+  personalbar_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "personalbar");
 
-  static screen_Getter(mthis) native "Window_screen_Getter";
-  screen_Getter_(mthis) => screen_Getter(mthis);
+  postMessage_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "postMessage", []);
 
-  static scrollBy_Callback_0(mthis) native "Window_scrollBy_Callback";
-  scrollBy_Callback_0_(mthis) => scrollBy_Callback_0(mthis);
+  postMessage_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "postMessage", [__arg_0]);
 
-  static scrollBy_Callback_1(mthis, __arg_0) native "Window_scrollBy_Callback";
-  scrollBy_Callback_1_(mthis, __arg_0) => scrollBy_Callback_1(mthis, __arg_0);
+  postMessage_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "postMessage", [__arg_0, __arg_1]);
 
-  static scrollBy_Callback_2(mthis, __arg_0, __arg_1) native "Window_scrollBy_Callback";
-  scrollBy_Callback_2_(mthis, __arg_0, __arg_1) => scrollBy_Callback_2(mthis, __arg_0, __arg_1);
+  postMessage_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "postMessage", [__arg_0, __arg_1, __arg_2]);
 
-  static scrollBy_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Window_scrollBy_Callback";
-  scrollBy_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => scrollBy_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  print_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "print", []);
 
-  static scrollBy_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Window_scrollBy_Callback";
-  scrollBy_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => scrollBy_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  releaseEvents_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "releaseEvents", []);
 
-  static scrollBy_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "Window_scrollBy_Callback";
-  scrollBy_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => scrollBy_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  requestAnimationFrame_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "requestAnimationFrame", []);
 
-  static scrollTo_Callback_0(mthis) native "Window_scrollTo_Callback";
-  scrollTo_Callback_0_(mthis) => scrollTo_Callback_0(mthis);
+  requestAnimationFrame_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "requestAnimationFrame", [__arg_0]);
 
-  static scrollTo_Callback_1(mthis, __arg_0) native "Window_scrollTo_Callback";
-  scrollTo_Callback_1_(mthis, __arg_0) => scrollTo_Callback_1(mthis, __arg_0);
+  resizeBy_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "resizeBy", []);
 
-  static scrollTo_Callback_2(mthis, __arg_0, __arg_1) native "Window_scrollTo_Callback";
-  scrollTo_Callback_2_(mthis, __arg_0, __arg_1) => scrollTo_Callback_2(mthis, __arg_0, __arg_1);
+  resizeBy_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "resizeBy", [__arg_0]);
 
-  static scrollTo_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Window_scrollTo_Callback";
-  scrollTo_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => scrollTo_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  resizeBy_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "resizeBy", [__arg_0, __arg_1]);
 
-  static scrollTo_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Window_scrollTo_Callback";
-  scrollTo_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => scrollTo_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  resizeTo_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "resizeTo", []);
 
-  static scrollTo_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "Window_scrollTo_Callback";
-  scrollTo_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => scrollTo_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  resizeTo_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "resizeTo", [__arg_0]);
 
-  static scrollX_Getter(mthis) native "Window_scrollX_Getter";
-  scrollX_Getter_(mthis) => scrollX_Getter(mthis);
+  resizeTo_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "resizeTo", [__arg_0, __arg_1]);
 
-  static scrollY_Getter(mthis) native "Window_scrollY_Getter";
-  scrollY_Getter_(mthis) => scrollY_Getter(mthis);
+  screenLeft_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "screenLeft");
 
-  static scroll_Callback_0(mthis) native "Window_scroll_Callback";
-  scroll_Callback_0_(mthis) => scroll_Callback_0(mthis);
+  screenTop_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "screenTop");
 
-  static scroll_Callback_1(mthis, __arg_0) native "Window_scroll_Callback";
-  scroll_Callback_1_(mthis, __arg_0) => scroll_Callback_1(mthis, __arg_0);
+  screenX_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "screenX");
 
-  static scroll_Callback_2(mthis, __arg_0, __arg_1) native "Window_scroll_Callback";
-  scroll_Callback_2_(mthis, __arg_0, __arg_1) => scroll_Callback_2(mthis, __arg_0, __arg_1);
+  screenY_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "screenY");
 
-  static scroll_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Window_scroll_Callback";
-  scroll_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => scroll_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  screen_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "screen");
 
-  static scroll_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Window_scroll_Callback";
-  scroll_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => scroll_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  scrollBy_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "scrollBy", []);
 
-  static scroll_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "Window_scroll_Callback";
-  scroll_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => scroll_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  scrollBy_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "scrollBy", [__arg_0]);
 
-  static scrollbars_Getter(mthis) native "Window_scrollbars_Getter";
-  scrollbars_Getter_(mthis) => scrollbars_Getter(mthis);
+  scrollBy_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "scrollBy", [__arg_0, __arg_1]);
 
-  static self_Getter(mthis) native "Window_self_Getter";
-  self_Getter_(mthis) => self_Getter(mthis);
+  scrollBy_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "scrollBy", [__arg_0, __arg_1, __arg_2]);
 
-  static sessionStorage_Getter(mthis) native "Window_sessionStorage_Getter";
-  sessionStorage_Getter_(mthis) => sessionStorage_Getter(mthis);
+  scrollTo_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "scrollTo", []);
 
-  static setInterval_Callback_0(mthis) native "Window_setInterval_Callback";
-  setInterval_Callback_0_(mthis) => setInterval_Callback_0(mthis);
+  scrollTo_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "scrollTo", [__arg_0]);
 
-  static setInterval_Callback_1(mthis, __arg_0) native "Window_setInterval_Callback";
-  setInterval_Callback_1_(mthis, __arg_0) => setInterval_Callback_1(mthis, __arg_0);
+  scrollTo_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "scrollTo", [__arg_0, __arg_1]);
 
-  static setInterval_Callback_2(mthis, __arg_0, __arg_1) native "Window_setInterval_Callback";
-  setInterval_Callback_2_(mthis, __arg_0, __arg_1) => setInterval_Callback_2(mthis, __arg_0, __arg_1);
+  scrollTo_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "scrollTo", [__arg_0, __arg_1, __arg_2]);
 
-  static setInterval_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Window_setInterval_Callback";
-  setInterval_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => setInterval_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  scrollX_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "scrollX");
 
-  static setInterval_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Window_setInterval_Callback";
-  setInterval_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => setInterval_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  scrollY_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "scrollY");
 
-  static setTimeout_Callback_0(mthis) native "Window_setTimeout_Callback";
-  setTimeout_Callback_0_(mthis) => setTimeout_Callback_0(mthis);
+  scroll_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "scroll", []);
 
-  static setTimeout_Callback_1(mthis, __arg_0) native "Window_setTimeout_Callback";
-  setTimeout_Callback_1_(mthis, __arg_0) => setTimeout_Callback_1(mthis, __arg_0);
+  scroll_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "scroll", [__arg_0]);
 
-  static setTimeout_Callback_2(mthis, __arg_0, __arg_1) native "Window_setTimeout_Callback";
-  setTimeout_Callback_2_(mthis, __arg_0, __arg_1) => setTimeout_Callback_2(mthis, __arg_0, __arg_1);
+  scroll_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "scroll", [__arg_0, __arg_1]);
 
-  static setTimeout_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Window_setTimeout_Callback";
-  setTimeout_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => setTimeout_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  scroll_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "scroll", [__arg_0, __arg_1, __arg_2]);
 
-  static setTimeout_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Window_setTimeout_Callback";
-  setTimeout_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => setTimeout_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  scrollbars_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "scrollbars");
 
-  static showModalDialog_Callback_0(mthis) native "Window_showModalDialog_Callback";
-  showModalDialog_Callback_0_(mthis) => showModalDialog_Callback_0(mthis);
+  self_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "self");
 
-  static showModalDialog_Callback_1(mthis, __arg_0) native "Window_showModalDialog_Callback";
-  showModalDialog_Callback_1_(mthis, __arg_0) => showModalDialog_Callback_1(mthis, __arg_0);
+  sessionStorage_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "sessionStorage");
 
-  static showModalDialog_Callback_2(mthis, __arg_0, __arg_1) native "Window_showModalDialog_Callback";
-  showModalDialog_Callback_2_(mthis, __arg_0, __arg_1) => showModalDialog_Callback_2(mthis, __arg_0, __arg_1);
+  setInterval_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "setInterval", []);
 
-  static showModalDialog_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Window_showModalDialog_Callback";
-  showModalDialog_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => showModalDialog_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  setInterval_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "setInterval", [__arg_0]);
 
-  static showModalDialog_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Window_showModalDialog_Callback";
-  showModalDialog_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => showModalDialog_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  setInterval_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "setInterval", [__arg_0, __arg_1]);
 
-  static showModalDialog_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "Window_showModalDialog_Callback";
-  showModalDialog_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => showModalDialog_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  setTimeout_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "setTimeout", []);
 
-  static speechSynthesis_Getter(mthis) native "Window_speechSynthesis_Getter";
-  speechSynthesis_Getter_(mthis) => speechSynthesis_Getter(mthis);
+  setTimeout_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "setTimeout", [__arg_0]);
 
-  static status_Getter(mthis) native "Window_status_Getter";
-  status_Getter_(mthis) => status_Getter(mthis);
+  setTimeout_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "setTimeout", [__arg_0, __arg_1]);
 
-  static status_Setter(mthis, __arg_0) native "Window_status_Setter";
-  status_Setter_(mthis, __arg_0) => status_Setter(mthis, __arg_0);
+  showModalDialog_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "showModalDialog", []);
 
-  static statusbar_Getter(mthis) native "Window_statusbar_Getter";
-  statusbar_Getter_(mthis) => statusbar_Getter(mthis);
+  showModalDialog_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "showModalDialog", [__arg_0]);
 
-  static stop_Callback_0(mthis) native "Window_stop_Callback";
-  stop_Callback_0_(mthis) => stop_Callback_0(mthis);
+  showModalDialog_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "showModalDialog", [__arg_0, __arg_1]);
 
-  static stop_Callback_1(mthis, __arg_0) native "Window_stop_Callback";
-  stop_Callback_1_(mthis, __arg_0) => stop_Callback_1(mthis, __arg_0);
+  showModalDialog_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "showModalDialog", [__arg_0, __arg_1, __arg_2]);
 
-  static stop_Callback_2(mthis, __arg_0, __arg_1) native "Window_stop_Callback";
-  stop_Callback_2_(mthis, __arg_0, __arg_1) => stop_Callback_2(mthis, __arg_0, __arg_1);
+  speechSynthesis_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "speechSynthesis");
 
-  static styleMedia_Getter(mthis) native "Window_styleMedia_Getter";
-  styleMedia_Getter_(mthis) => styleMedia_Getter(mthis);
+  status_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "status");
 
-  static toolbar_Getter(mthis) native "Window_toolbar_Getter";
-  toolbar_Getter_(mthis) => toolbar_Getter(mthis);
+  status_Setter_(mthis, __arg_0) => mthis["status"] = __arg_0;
 
-  static top_Getter(mthis) native "Window_top_Getter";
-  top_Getter_(mthis) => top_Getter(mthis);
+  statusbar_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "statusbar");
 
-  static webkitRequestFileSystem_Callback_1(mthis, __arg_0) native "Window_webkitRequestFileSystem_Callback";
-  webkitRequestFileSystem_Callback_1_(mthis, __arg_0) => webkitRequestFileSystem_Callback_1(mthis, __arg_0);
+  stop_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "stop", []);
 
-  static webkitRequestFileSystem_Callback_2(mthis, __arg_0, __arg_1) native "Window_webkitRequestFileSystem_Callback";
-  webkitRequestFileSystem_Callback_2_(mthis, __arg_0, __arg_1) => webkitRequestFileSystem_Callback_2(mthis, __arg_0, __arg_1);
+  styleMedia_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "styleMedia");
 
-  static webkitRequestFileSystem_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Window_webkitRequestFileSystem_Callback";
-  webkitRequestFileSystem_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => webkitRequestFileSystem_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  toolbar_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "toolbar");
 
-  static webkitRequestFileSystem_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Window_webkitRequestFileSystem_Callback";
-  webkitRequestFileSystem_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => webkitRequestFileSystem_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  top_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "top");
 
-  static webkitRequestFileSystem_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "Window_webkitRequestFileSystem_Callback";
-  webkitRequestFileSystem_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => webkitRequestFileSystem_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  webkitRequestFileSystem_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "webkitRequestFileSystem", [__arg_0]);
 
-  static webkitRequestFileSystem_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "Window_webkitRequestFileSystem_Callback";
-  webkitRequestFileSystem_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => webkitRequestFileSystem_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  webkitRequestFileSystem_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "webkitRequestFileSystem", [__arg_0, __arg_1]);
 
-  static webkitResolveLocalFileSystemURL_Callback_0(mthis) native "Window_webkitResolveLocalFileSystemURL_Callback";
-  webkitResolveLocalFileSystemURL_Callback_0_(mthis) => webkitResolveLocalFileSystemURL_Callback_0(mthis);
+  webkitRequestFileSystem_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "webkitRequestFileSystem", [__arg_0, __arg_1, __arg_2]);
 
-  static webkitResolveLocalFileSystemURL_Callback_1(mthis, __arg_0) native "Window_webkitResolveLocalFileSystemURL_Callback";
-  webkitResolveLocalFileSystemURL_Callback_1_(mthis, __arg_0) => webkitResolveLocalFileSystemURL_Callback_1(mthis, __arg_0);
+  webkitRequestFileSystem_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "webkitRequestFileSystem", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static webkitResolveLocalFileSystemURL_Callback_2(mthis, __arg_0, __arg_1) native "Window_webkitResolveLocalFileSystemURL_Callback";
-  webkitResolveLocalFileSystemURL_Callback_2_(mthis, __arg_0, __arg_1) => webkitResolveLocalFileSystemURL_Callback_2(mthis, __arg_0, __arg_1);
+  webkitResolveLocalFileSystemURL_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "webkitResolveLocalFileSystemURL", []);
 
-  static webkitResolveLocalFileSystemURL_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Window_webkitResolveLocalFileSystemURL_Callback";
-  webkitResolveLocalFileSystemURL_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => webkitResolveLocalFileSystemURL_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  webkitResolveLocalFileSystemURL_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "webkitResolveLocalFileSystemURL", [__arg_0]);
 
-  static webkitResolveLocalFileSystemURL_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Window_webkitResolveLocalFileSystemURL_Callback";
-  webkitResolveLocalFileSystemURL_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => webkitResolveLocalFileSystemURL_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  webkitResolveLocalFileSystemURL_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "webkitResolveLocalFileSystemURL", [__arg_0, __arg_1]);
 
-  static webkitResolveLocalFileSystemURL_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "Window_webkitResolveLocalFileSystemURL_Callback";
-  webkitResolveLocalFileSystemURL_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => webkitResolveLocalFileSystemURL_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  webkitResolveLocalFileSystemURL_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "webkitResolveLocalFileSystemURL", [__arg_0, __arg_1, __arg_2]);
 
-  static webkitStorageInfo_Getter(mthis) native "Window_webkitStorageInfo_Getter";
-  webkitStorageInfo_Getter_(mthis) => webkitStorageInfo_Getter(mthis);
+  webkitStorageInfo_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "webkitStorageInfo");
 
-  static window_Getter(mthis) native "Window_window_Getter";
-  window_Getter_(mthis) => window_Getter(mthis);
+  window_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "window");
 
 }
 
 class BlinkWorker extends BlinkEventTarget {
   static final instance = new BlinkWorker();
 
-  static constructorCallback_0() native "Worker_constructorCallback";
-  constructorCallback_0_() => constructorCallback_0();
+  constructorCallback_0_() => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "Worker"), []);
 
-  static constructorCallback_1(__arg_0) native "Worker_constructorCallback";
-  constructorCallback_1_(__arg_0) => constructorCallback_1(__arg_0);
+  constructorCallback_1_(__arg_0) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "Worker"), [__arg_0]);
 
-  static constructorCallback_2(__arg_0, __arg_1) native "Worker_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  onerror_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onerror");
 
-  static constructorCallback_3(__arg_0, __arg_1, __arg_2) native "Worker_constructorCallback";
-  constructorCallback_3_(__arg_0, __arg_1, __arg_2) => constructorCallback_3(__arg_0, __arg_1, __arg_2);
+  onerror_Setter_(mthis, __arg_0) => mthis["onerror"] = __arg_0;
 
-  static onerror_Getter(mthis) native "Worker_onerror_Getter";
-  onerror_Getter_(mthis) => onerror_Getter(mthis);
+  onmessage_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onmessage");
 
-  static onerror_Setter(mthis, __arg_0) native "Worker_onerror_Setter";
-  onerror_Setter_(mthis, __arg_0) => onerror_Setter(mthis, __arg_0);
+  onmessage_Setter_(mthis, __arg_0) => mthis["onmessage"] = __arg_0;
 
-  static onmessage_Getter(mthis) native "Worker_onmessage_Getter";
-  onmessage_Getter_(mthis) => onmessage_Getter(mthis);
+  postMessage_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "postMessage", []);
 
-  static onmessage_Setter(mthis, __arg_0) native "Worker_onmessage_Setter";
-  onmessage_Setter_(mthis, __arg_0) => onmessage_Setter(mthis, __arg_0);
+  postMessage_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "postMessage", [__arg_0]);
 
-  static postMessage_Callback_0(mthis) native "Worker_postMessage_Callback";
-  postMessage_Callback_0_(mthis) => postMessage_Callback_0(mthis);
+  postMessage_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "postMessage", [__arg_0, __arg_1]);
 
-  static postMessage_Callback_1(mthis, __arg_0) native "Worker_postMessage_Callback";
-  postMessage_Callback_1_(mthis, __arg_0) => postMessage_Callback_1(mthis, __arg_0);
-
-  static postMessage_Callback_2(mthis, __arg_0, __arg_1) native "Worker_postMessage_Callback";
-  postMessage_Callback_2_(mthis, __arg_0, __arg_1) => postMessage_Callback_2(mthis, __arg_0, __arg_1);
-
-  static postMessage_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "Worker_postMessage_Callback";
-  postMessage_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => postMessage_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static postMessage_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "Worker_postMessage_Callback";
-  postMessage_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => postMessage_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static terminate_Callback_0(mthis) native "Worker_terminate_Callback";
-  terminate_Callback_0_(mthis) => terminate_Callback_0(mthis);
-
-  static terminate_Callback_1(mthis, __arg_0) native "Worker_terminate_Callback";
-  terminate_Callback_1_(mthis, __arg_0) => terminate_Callback_1(mthis, __arg_0);
-
-  static terminate_Callback_2(mthis, __arg_0, __arg_1) native "Worker_terminate_Callback";
-  terminate_Callback_2_(mthis, __arg_0, __arg_1) => terminate_Callback_2(mthis, __arg_0, __arg_1);
+  terminate_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "terminate", []);
 
 }
 
@@ -30682,323 +16761,160 @@
 class BlinkWorkerGlobalScope extends BlinkEventTarget {
   static final instance = new BlinkWorkerGlobalScope();
 
-  static atob_Callback_0(mthis) native "WorkerGlobalScope_atob_Callback";
-  atob_Callback_0_(mthis) => atob_Callback_0(mthis);
+  atob_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "atob", []);
 
-  static atob_Callback_1(mthis, __arg_0) native "WorkerGlobalScope_atob_Callback";
-  atob_Callback_1_(mthis, __arg_0) => atob_Callback_1(mthis, __arg_0);
+  atob_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "atob", [__arg_0]);
 
-  static atob_Callback_2(mthis, __arg_0, __arg_1) native "WorkerGlobalScope_atob_Callback";
-  atob_Callback_2_(mthis, __arg_0, __arg_1) => atob_Callback_2(mthis, __arg_0, __arg_1);
+  btoa_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "btoa", []);
 
-  static atob_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WorkerGlobalScope_atob_Callback";
-  atob_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => atob_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  btoa_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "btoa", [__arg_0]);
 
-  static btoa_Callback_0(mthis) native "WorkerGlobalScope_btoa_Callback";
-  btoa_Callback_0_(mthis) => btoa_Callback_0(mthis);
+  clearInterval_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "clearInterval", []);
 
-  static btoa_Callback_1(mthis, __arg_0) native "WorkerGlobalScope_btoa_Callback";
-  btoa_Callback_1_(mthis, __arg_0) => btoa_Callback_1(mthis, __arg_0);
+  clearInterval_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "clearInterval", [__arg_0]);
 
-  static btoa_Callback_2(mthis, __arg_0, __arg_1) native "WorkerGlobalScope_btoa_Callback";
-  btoa_Callback_2_(mthis, __arg_0, __arg_1) => btoa_Callback_2(mthis, __arg_0, __arg_1);
+  clearTimeout_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "clearTimeout", []);
 
-  static btoa_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WorkerGlobalScope_btoa_Callback";
-  btoa_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => btoa_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  clearTimeout_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "clearTimeout", [__arg_0]);
 
-  static clearInterval_Callback_0(mthis) native "WorkerGlobalScope_clearInterval_Callback";
-  clearInterval_Callback_0_(mthis) => clearInterval_Callback_0(mthis);
+  close_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "close", []);
 
-  static clearInterval_Callback_1(mthis, __arg_0) native "WorkerGlobalScope_clearInterval_Callback";
-  clearInterval_Callback_1_(mthis, __arg_0) => clearInterval_Callback_1(mthis, __arg_0);
+  console_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "console");
 
-  static clearInterval_Callback_2(mthis, __arg_0, __arg_1) native "WorkerGlobalScope_clearInterval_Callback";
-  clearInterval_Callback_2_(mthis, __arg_0, __arg_1) => clearInterval_Callback_2(mthis, __arg_0, __arg_1);
+  createImageBitmap_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createImageBitmap", []);
 
-  static clearInterval_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WorkerGlobalScope_clearInterval_Callback";
-  clearInterval_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => clearInterval_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  createImageBitmap_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "createImageBitmap", [__arg_0]);
 
-  static clearTimeout_Callback_0(mthis) native "WorkerGlobalScope_clearTimeout_Callback";
-  clearTimeout_Callback_0_(mthis) => clearTimeout_Callback_0(mthis);
+  createImageBitmap_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "createImageBitmap", [__arg_0, __arg_1, __arg_2]);
 
-  static clearTimeout_Callback_1(mthis, __arg_0) native "WorkerGlobalScope_clearTimeout_Callback";
-  clearTimeout_Callback_1_(mthis, __arg_0) => clearTimeout_Callback_1(mthis, __arg_0);
+  createImageBitmap_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "createImageBitmap", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static clearTimeout_Callback_2(mthis, __arg_0, __arg_1) native "WorkerGlobalScope_clearTimeout_Callback";
-  clearTimeout_Callback_2_(mthis, __arg_0, __arg_1) => clearTimeout_Callback_2(mthis, __arg_0, __arg_1);
+  createImageBitmap_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => Blink_JsNative_DomException.callMethod(mthis, "createImageBitmap", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4]);
 
-  static clearTimeout_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WorkerGlobalScope_clearTimeout_Callback";
-  clearTimeout_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => clearTimeout_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  crypto_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "crypto");
 
-  static close_Callback_0(mthis) native "WorkerGlobalScope_close_Callback";
-  close_Callback_0_(mthis) => close_Callback_0(mthis);
+  importScripts_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "importScripts", []);
 
-  static close_Callback_1(mthis, __arg_0) native "WorkerGlobalScope_close_Callback";
-  close_Callback_1_(mthis, __arg_0) => close_Callback_1(mthis, __arg_0);
+  importScripts_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "importScripts", [__arg_0]);
 
-  static close_Callback_2(mthis, __arg_0, __arg_1) native "WorkerGlobalScope_close_Callback";
-  close_Callback_2_(mthis, __arg_0, __arg_1) => close_Callback_2(mthis, __arg_0, __arg_1);
+  indexedDB_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "indexedDB");
 
-  static console_Getter(mthis) native "WorkerGlobalScope_console_Getter";
-  console_Getter_(mthis) => console_Getter(mthis);
+  location_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "location");
 
-  static createImageBitmap_Callback_0(mthis) native "WorkerGlobalScope_createImageBitmap_Callback";
-  createImageBitmap_Callback_0_(mthis) => createImageBitmap_Callback_0(mthis);
+  navigator_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "navigator");
 
-  static createImageBitmap_Callback_1(mthis, __arg_0) native "WorkerGlobalScope_createImageBitmap_Callback";
-  createImageBitmap_Callback_1_(mthis, __arg_0) => createImageBitmap_Callback_1(mthis, __arg_0);
+  onerror_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onerror");
 
-  static createImageBitmap_Callback_2(mthis, __arg_0, __arg_1) native "WorkerGlobalScope_createImageBitmap_Callback";
-  createImageBitmap_Callback_2_(mthis, __arg_0, __arg_1) => createImageBitmap_Callback_2(mthis, __arg_0, __arg_1);
+  onerror_Setter_(mthis, __arg_0) => mthis["onerror"] = __arg_0;
 
-  static createImageBitmap_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WorkerGlobalScope_createImageBitmap_Callback";
-  createImageBitmap_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => createImageBitmap_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  performance_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "performance");
 
-  static createImageBitmap_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WorkerGlobalScope_createImageBitmap_Callback";
-  createImageBitmap_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => createImageBitmap_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  self_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "self");
 
-  static createImageBitmap_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "WorkerGlobalScope_createImageBitmap_Callback";
-  createImageBitmap_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => createImageBitmap_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  setInterval_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "setInterval", []);
 
-  static createImageBitmap_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "WorkerGlobalScope_createImageBitmap_Callback";
-  createImageBitmap_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => createImageBitmap_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  setInterval_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "setInterval", [__arg_0]);
 
-  static createImageBitmap_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) native "WorkerGlobalScope_createImageBitmap_Callback";
-  createImageBitmap_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => createImageBitmap_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6);
+  setInterval_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "setInterval", [__arg_0, __arg_1]);
 
-  static crypto_Getter(mthis) native "WorkerGlobalScope_crypto_Getter";
-  crypto_Getter_(mthis) => crypto_Getter(mthis);
+  setTimeout_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "setTimeout", []);
 
-  static importScripts_Callback_0(mthis) native "WorkerGlobalScope_importScripts_Callback";
-  importScripts_Callback_0_(mthis) => importScripts_Callback_0(mthis);
+  setTimeout_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "setTimeout", [__arg_0]);
 
-  static importScripts_Callback_1(mthis, __arg_0) native "WorkerGlobalScope_importScripts_Callback";
-  importScripts_Callback_1_(mthis, __arg_0) => importScripts_Callback_1(mthis, __arg_0);
+  setTimeout_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "setTimeout", [__arg_0, __arg_1]);
 
-  static importScripts_Callback_2(mthis, __arg_0, __arg_1) native "WorkerGlobalScope_importScripts_Callback";
-  importScripts_Callback_2_(mthis, __arg_0, __arg_1) => importScripts_Callback_2(mthis, __arg_0, __arg_1);
+  webkitRequestFileSystemSync_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "webkitRequestFileSystemSync", []);
 
-  static importScripts_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WorkerGlobalScope_importScripts_Callback";
-  importScripts_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => importScripts_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  webkitRequestFileSystemSync_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "webkitRequestFileSystemSync", [__arg_0]);
 
-  static indexedDB_Getter(mthis) native "WorkerGlobalScope_indexedDB_Getter";
-  indexedDB_Getter_(mthis) => indexedDB_Getter(mthis);
+  webkitRequestFileSystemSync_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "webkitRequestFileSystemSync", [__arg_0, __arg_1]);
 
-  static location_Getter(mthis) native "WorkerGlobalScope_location_Getter";
-  location_Getter_(mthis) => location_Getter(mthis);
+  webkitRequestFileSystem_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "webkitRequestFileSystem", []);
 
-  static navigator_Getter(mthis) native "WorkerGlobalScope_navigator_Getter";
-  navigator_Getter_(mthis) => navigator_Getter(mthis);
-
-  static onerror_Getter(mthis) native "WorkerGlobalScope_onerror_Getter";
-  onerror_Getter_(mthis) => onerror_Getter(mthis);
-
-  static onerror_Setter(mthis, __arg_0) native "WorkerGlobalScope_onerror_Setter";
-  onerror_Setter_(mthis, __arg_0) => onerror_Setter(mthis, __arg_0);
-
-  static performance_Getter(mthis) native "WorkerGlobalScope_performance_Getter";
-  performance_Getter_(mthis) => performance_Getter(mthis);
-
-  static self_Getter(mthis) native "WorkerGlobalScope_self_Getter";
-  self_Getter_(mthis) => self_Getter(mthis);
-
-  static setInterval_Callback_0(mthis) native "WorkerGlobalScope_setInterval_Callback";
-  setInterval_Callback_0_(mthis) => setInterval_Callback_0(mthis);
-
-  static setInterval_Callback_1(mthis, __arg_0) native "WorkerGlobalScope_setInterval_Callback";
-  setInterval_Callback_1_(mthis, __arg_0) => setInterval_Callback_1(mthis, __arg_0);
-
-  static setInterval_Callback_2(mthis, __arg_0, __arg_1) native "WorkerGlobalScope_setInterval_Callback";
-  setInterval_Callback_2_(mthis, __arg_0, __arg_1) => setInterval_Callback_2(mthis, __arg_0, __arg_1);
-
-  static setInterval_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WorkerGlobalScope_setInterval_Callback";
-  setInterval_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => setInterval_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static setInterval_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WorkerGlobalScope_setInterval_Callback";
-  setInterval_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => setInterval_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static setTimeout_Callback_0(mthis) native "WorkerGlobalScope_setTimeout_Callback";
-  setTimeout_Callback_0_(mthis) => setTimeout_Callback_0(mthis);
-
-  static setTimeout_Callback_1(mthis, __arg_0) native "WorkerGlobalScope_setTimeout_Callback";
-  setTimeout_Callback_1_(mthis, __arg_0) => setTimeout_Callback_1(mthis, __arg_0);
-
-  static setTimeout_Callback_2(mthis, __arg_0, __arg_1) native "WorkerGlobalScope_setTimeout_Callback";
-  setTimeout_Callback_2_(mthis, __arg_0, __arg_1) => setTimeout_Callback_2(mthis, __arg_0, __arg_1);
-
-  static setTimeout_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WorkerGlobalScope_setTimeout_Callback";
-  setTimeout_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => setTimeout_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static setTimeout_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WorkerGlobalScope_setTimeout_Callback";
-  setTimeout_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => setTimeout_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static webkitRequestFileSystemSync_Callback_0(mthis) native "WorkerGlobalScope_webkitRequestFileSystemSync_Callback";
-  webkitRequestFileSystemSync_Callback_0_(mthis) => webkitRequestFileSystemSync_Callback_0(mthis);
-
-  static webkitRequestFileSystemSync_Callback_1(mthis, __arg_0) native "WorkerGlobalScope_webkitRequestFileSystemSync_Callback";
-  webkitRequestFileSystemSync_Callback_1_(mthis, __arg_0) => webkitRequestFileSystemSync_Callback_1(mthis, __arg_0);
-
-  static webkitRequestFileSystemSync_Callback_2(mthis, __arg_0, __arg_1) native "WorkerGlobalScope_webkitRequestFileSystemSync_Callback";
-  webkitRequestFileSystemSync_Callback_2_(mthis, __arg_0, __arg_1) => webkitRequestFileSystemSync_Callback_2(mthis, __arg_0, __arg_1);
-
-  static webkitRequestFileSystemSync_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WorkerGlobalScope_webkitRequestFileSystemSync_Callback";
-  webkitRequestFileSystemSync_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => webkitRequestFileSystemSync_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static webkitRequestFileSystemSync_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WorkerGlobalScope_webkitRequestFileSystemSync_Callback";
-  webkitRequestFileSystemSync_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => webkitRequestFileSystemSync_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static webkitRequestFileSystem_Callback_0(mthis) native "WorkerGlobalScope_webkitRequestFileSystem_Callback";
-  webkitRequestFileSystem_Callback_0_(mthis) => webkitRequestFileSystem_Callback_0(mthis);
-
-  static webkitRequestFileSystem_Callback_1(mthis, __arg_0) native "WorkerGlobalScope_webkitRequestFileSystem_Callback";
-  webkitRequestFileSystem_Callback_1_(mthis, __arg_0) => webkitRequestFileSystem_Callback_1(mthis, __arg_0);
-
-  static webkitRequestFileSystem_Callback_2(mthis, __arg_0, __arg_1) native "WorkerGlobalScope_webkitRequestFileSystem_Callback";
-  webkitRequestFileSystem_Callback_2_(mthis, __arg_0, __arg_1) => webkitRequestFileSystem_Callback_2(mthis, __arg_0, __arg_1);
-
-  static webkitRequestFileSystem_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WorkerGlobalScope_webkitRequestFileSystem_Callback";
-  webkitRequestFileSystem_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => webkitRequestFileSystem_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static webkitRequestFileSystem_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WorkerGlobalScope_webkitRequestFileSystem_Callback";
-  webkitRequestFileSystem_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => webkitRequestFileSystem_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static webkitRequestFileSystem_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "WorkerGlobalScope_webkitRequestFileSystem_Callback";
-  webkitRequestFileSystem_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => webkitRequestFileSystem_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
-
-  static webkitRequestFileSystem_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "WorkerGlobalScope_webkitRequestFileSystem_Callback";
-  webkitRequestFileSystem_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => webkitRequestFileSystem_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
-
-  static webkitResolveLocalFileSystemSyncURL_Callback_0(mthis) native "WorkerGlobalScope_webkitResolveLocalFileSystemSyncURL_Callback";
-  webkitResolveLocalFileSystemSyncURL_Callback_0_(mthis) => webkitResolveLocalFileSystemSyncURL_Callback_0(mthis);
+  webkitRequestFileSystem_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "webkitRequestFileSystem", [__arg_0]);
 
-  static webkitResolveLocalFileSystemSyncURL_Callback_1(mthis, __arg_0) native "WorkerGlobalScope_webkitResolveLocalFileSystemSyncURL_Callback";
-  webkitResolveLocalFileSystemSyncURL_Callback_1_(mthis, __arg_0) => webkitResolveLocalFileSystemSyncURL_Callback_1(mthis, __arg_0);
+  webkitRequestFileSystem_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "webkitRequestFileSystem", [__arg_0, __arg_1]);
 
-  static webkitResolveLocalFileSystemSyncURL_Callback_2(mthis, __arg_0, __arg_1) native "WorkerGlobalScope_webkitResolveLocalFileSystemSyncURL_Callback";
-  webkitResolveLocalFileSystemSyncURL_Callback_2_(mthis, __arg_0, __arg_1) => webkitResolveLocalFileSystemSyncURL_Callback_2(mthis, __arg_0, __arg_1);
+  webkitRequestFileSystem_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "webkitRequestFileSystem", [__arg_0, __arg_1, __arg_2]);
 
-  static webkitResolveLocalFileSystemSyncURL_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WorkerGlobalScope_webkitResolveLocalFileSystemSyncURL_Callback";
-  webkitResolveLocalFileSystemSyncURL_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => webkitResolveLocalFileSystemSyncURL_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  webkitRequestFileSystem_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "webkitRequestFileSystem", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static webkitResolveLocalFileSystemURL_Callback_0(mthis) native "WorkerGlobalScope_webkitResolveLocalFileSystemURL_Callback";
-  webkitResolveLocalFileSystemURL_Callback_0_(mthis) => webkitResolveLocalFileSystemURL_Callback_0(mthis);
+  webkitResolveLocalFileSystemSyncURL_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "webkitResolveLocalFileSystemSyncURL", []);
 
-  static webkitResolveLocalFileSystemURL_Callback_1(mthis, __arg_0) native "WorkerGlobalScope_webkitResolveLocalFileSystemURL_Callback";
-  webkitResolveLocalFileSystemURL_Callback_1_(mthis, __arg_0) => webkitResolveLocalFileSystemURL_Callback_1(mthis, __arg_0);
+  webkitResolveLocalFileSystemSyncURL_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "webkitResolveLocalFileSystemSyncURL", [__arg_0]);
 
-  static webkitResolveLocalFileSystemURL_Callback_2(mthis, __arg_0, __arg_1) native "WorkerGlobalScope_webkitResolveLocalFileSystemURL_Callback";
-  webkitResolveLocalFileSystemURL_Callback_2_(mthis, __arg_0, __arg_1) => webkitResolveLocalFileSystemURL_Callback_2(mthis, __arg_0, __arg_1);
+  webkitResolveLocalFileSystemURL_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "webkitResolveLocalFileSystemURL", []);
 
-  static webkitResolveLocalFileSystemURL_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "WorkerGlobalScope_webkitResolveLocalFileSystemURL_Callback";
-  webkitResolveLocalFileSystemURL_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => webkitResolveLocalFileSystemURL_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  webkitResolveLocalFileSystemURL_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "webkitResolveLocalFileSystemURL", [__arg_0]);
 
-  static webkitResolveLocalFileSystemURL_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "WorkerGlobalScope_webkitResolveLocalFileSystemURL_Callback";
-  webkitResolveLocalFileSystemURL_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => webkitResolveLocalFileSystemURL_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  webkitResolveLocalFileSystemURL_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "webkitResolveLocalFileSystemURL", [__arg_0, __arg_1]);
 
-  static webkitResolveLocalFileSystemURL_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "WorkerGlobalScope_webkitResolveLocalFileSystemURL_Callback";
-  webkitResolveLocalFileSystemURL_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => webkitResolveLocalFileSystemURL_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  webkitResolveLocalFileSystemURL_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "webkitResolveLocalFileSystemURL", [__arg_0, __arg_1, __arg_2]);
 
 }
 
 class BlinkWorkerLocation {
   static final instance = new BlinkWorkerLocation();
 
-  static hash_Getter(mthis) native "WorkerLocation_hash_Getter";
-  hash_Getter_(mthis) => hash_Getter(mthis);
+  hash_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "hash");
 
-  static host_Getter(mthis) native "WorkerLocation_host_Getter";
-  host_Getter_(mthis) => host_Getter(mthis);
+  host_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "host");
 
-  static hostname_Getter(mthis) native "WorkerLocation_hostname_Getter";
-  hostname_Getter_(mthis) => hostname_Getter(mthis);
+  hostname_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "hostname");
 
-  static href_Getter(mthis) native "WorkerLocation_href_Getter";
-  href_Getter_(mthis) => href_Getter(mthis);
+  href_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "href");
 
-  static origin_Getter(mthis) native "WorkerLocation_origin_Getter";
-  origin_Getter_(mthis) => origin_Getter(mthis);
+  origin_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "origin");
 
-  static pathname_Getter(mthis) native "WorkerLocation_pathname_Getter";
-  pathname_Getter_(mthis) => pathname_Getter(mthis);
+  pathname_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "pathname");
 
-  static port_Getter(mthis) native "WorkerLocation_port_Getter";
-  port_Getter_(mthis) => port_Getter(mthis);
+  port_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "port");
 
-  static protocol_Getter(mthis) native "WorkerLocation_protocol_Getter";
-  protocol_Getter_(mthis) => protocol_Getter(mthis);
+  protocol_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "protocol");
 
-  static search_Getter(mthis) native "WorkerLocation_search_Getter";
-  search_Getter_(mthis) => search_Getter(mthis);
+  search_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "search");
 
-  static toString_Callback_0(mthis) native "WorkerLocation_toString_Callback";
-  toString_Callback_0_(mthis) => toString_Callback_0(mthis);
-
-  static toString_Callback_1(mthis, __arg_0) native "WorkerLocation_toString_Callback";
-  toString_Callback_1_(mthis, __arg_0) => toString_Callback_1(mthis, __arg_0);
-
-  static toString_Callback_2(mthis, __arg_0, __arg_1) native "WorkerLocation_toString_Callback";
-  toString_Callback_2_(mthis, __arg_0, __arg_1) => toString_Callback_2(mthis, __arg_0, __arg_1);
+  toString_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "toString", []);
 
 }
 
 class BlinkWorkerNavigator {
   static final instance = new BlinkWorkerNavigator();
 
-  static appCodeName_Getter(mthis) native "WorkerNavigator_appCodeName_Getter";
-  appCodeName_Getter_(mthis) => appCodeName_Getter(mthis);
+  appCodeName_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "appCodeName");
 
-  static appName_Getter(mthis) native "WorkerNavigator_appName_Getter";
-  appName_Getter_(mthis) => appName_Getter(mthis);
+  appName_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "appName");
 
-  static appVersion_Getter(mthis) native "WorkerNavigator_appVersion_Getter";
-  appVersion_Getter_(mthis) => appVersion_Getter(mthis);
+  appVersion_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "appVersion");
 
-  static connection_Getter(mthis) native "WorkerNavigator_connection_Getter";
-  connection_Getter_(mthis) => connection_Getter(mthis);
+  connection_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "connection");
 
-  static dartEnabled_Getter(mthis) native "WorkerNavigator_dartEnabled_Getter";
-  dartEnabled_Getter_(mthis) => dartEnabled_Getter(mthis);
+  dartEnabled_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "dartEnabled");
 
-  static geofencing_Getter(mthis) native "WorkerNavigator_geofencing_Getter";
-  geofencing_Getter_(mthis) => geofencing_Getter(mthis);
+  geofencing_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "geofencing");
 
-  static hardwareConcurrency_Getter(mthis) native "WorkerNavigator_hardwareConcurrency_Getter";
-  hardwareConcurrency_Getter_(mthis) => hardwareConcurrency_Getter(mthis);
+  hardwareConcurrency_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "hardwareConcurrency");
 
-  static onLine_Getter(mthis) native "WorkerNavigator_onLine_Getter";
-  onLine_Getter_(mthis) => onLine_Getter(mthis);
+  onLine_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onLine");
 
-  static platform_Getter(mthis) native "WorkerNavigator_platform_Getter";
-  platform_Getter_(mthis) => platform_Getter(mthis);
+  platform_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "platform");
 
-  static product_Getter(mthis) native "WorkerNavigator_product_Getter";
-  product_Getter_(mthis) => product_Getter(mthis);
+  product_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "product");
 
-  static userAgent_Getter(mthis) native "WorkerNavigator_userAgent_Getter";
-  userAgent_Getter_(mthis) => userAgent_Getter(mthis);
+  userAgent_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "userAgent");
 
-  static webkitPersistentStorage_Getter(mthis) native "WorkerNavigator_webkitPersistentStorage_Getter";
-  webkitPersistentStorage_Getter_(mthis) => webkitPersistentStorage_Getter(mthis);
+  webkitPersistentStorage_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "webkitPersistentStorage");
 
-  static webkitTemporaryStorage_Getter(mthis) native "WorkerNavigator_webkitTemporaryStorage_Getter";
-  webkitTemporaryStorage_Getter_(mthis) => webkitTemporaryStorage_Getter(mthis);
+  webkitTemporaryStorage_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "webkitTemporaryStorage");
 
 }
 
 class BlinkWorkerPerformance {
   static final instance = new BlinkWorkerPerformance();
 
-  static memory_Getter(mthis) native "WorkerPerformance_memory_Getter";
-  memory_Getter_(mthis) => memory_Getter(mthis);
+  memory_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "memory");
 
-  static now_Callback_0(mthis) native "WorkerPerformance_now_Callback";
-  now_Callback_0_(mthis) => now_Callback_0(mthis);
-
-  static now_Callback_1(mthis, __arg_0) native "WorkerPerformance_now_Callback";
-  now_Callback_1_(mthis, __arg_0) => now_Callback_1(mthis, __arg_0);
-
-  static now_Callback_2(mthis, __arg_0, __arg_1) native "WorkerPerformance_now_Callback";
-  now_Callback_2_(mthis, __arg_0, __arg_1) => now_Callback_2(mthis, __arg_0, __arg_1);
+  now_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "now", []);
 
 }
 
@@ -31010,216 +16926,117 @@
 class BlinkXMLHttpRequest extends BlinkXMLHttpRequestEventTarget {
   static final instance = new BlinkXMLHttpRequest();
 
-  static abort_Callback_0(mthis) native "XMLHttpRequest_abort_Callback";
-  abort_Callback_0_(mthis) => abort_Callback_0(mthis);
+  abort_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "abort", []);
 
-  static abort_Callback_1(mthis, __arg_0) native "XMLHttpRequest_abort_Callback";
-  abort_Callback_1_(mthis, __arg_0) => abort_Callback_1(mthis, __arg_0);
+  constructorCallback_0_() => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "XMLHttpRequest"), []);
 
-  static abort_Callback_2(mthis, __arg_0, __arg_1) native "XMLHttpRequest_abort_Callback";
-  abort_Callback_2_(mthis, __arg_0, __arg_1) => abort_Callback_2(mthis, __arg_0, __arg_1);
+  constructorCallback_1_(__arg_0) => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "XMLHttpRequest"), [__arg_0]);
 
-  static constructorCallback_0() native "XMLHttpRequest_constructorCallback";
-  constructorCallback_0_() => constructorCallback_0();
+  getAllResponseHeaders_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getAllResponseHeaders", []);
 
-  static constructorCallback_1(__arg_0) native "XMLHttpRequest_constructorCallback";
-  constructorCallback_1_(__arg_0) => constructorCallback_1(__arg_0);
+  getResponseHeader_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getResponseHeader", []);
 
-  static constructorCallback_2(__arg_0, __arg_1) native "XMLHttpRequest_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  getResponseHeader_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getResponseHeader", [__arg_0]);
 
-  static constructorCallback_3(__arg_0, __arg_1, __arg_2) native "XMLHttpRequest_constructorCallback";
-  constructorCallback_3_(__arg_0, __arg_1, __arg_2) => constructorCallback_3(__arg_0, __arg_1, __arg_2);
+  onreadystatechange_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onreadystatechange");
 
-  static getAllResponseHeaders_Callback_0(mthis) native "XMLHttpRequest_getAllResponseHeaders_Callback";
-  getAllResponseHeaders_Callback_0_(mthis) => getAllResponseHeaders_Callback_0(mthis);
+  onreadystatechange_Setter_(mthis, __arg_0) => mthis["onreadystatechange"] = __arg_0;
 
-  static getAllResponseHeaders_Callback_1(mthis, __arg_0) native "XMLHttpRequest_getAllResponseHeaders_Callback";
-  getAllResponseHeaders_Callback_1_(mthis, __arg_0) => getAllResponseHeaders_Callback_1(mthis, __arg_0);
+  open_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "open", []);
 
-  static getAllResponseHeaders_Callback_2(mthis, __arg_0, __arg_1) native "XMLHttpRequest_getAllResponseHeaders_Callback";
-  getAllResponseHeaders_Callback_2_(mthis, __arg_0, __arg_1) => getAllResponseHeaders_Callback_2(mthis, __arg_0, __arg_1);
+  open_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "open", [__arg_0]);
 
-  static getResponseHeader_Callback_0(mthis) native "XMLHttpRequest_getResponseHeader_Callback";
-  getResponseHeader_Callback_0_(mthis) => getResponseHeader_Callback_0(mthis);
+  open_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "open", [__arg_0, __arg_1]);
 
-  static getResponseHeader_Callback_1(mthis, __arg_0) native "XMLHttpRequest_getResponseHeader_Callback";
-  getResponseHeader_Callback_1_(mthis, __arg_0) => getResponseHeader_Callback_1(mthis, __arg_0);
+  open_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "open", [__arg_0, __arg_1, __arg_2]);
 
-  static getResponseHeader_Callback_2(mthis, __arg_0, __arg_1) native "XMLHttpRequest_getResponseHeader_Callback";
-  getResponseHeader_Callback_2_(mthis, __arg_0, __arg_1) => getResponseHeader_Callback_2(mthis, __arg_0, __arg_1);
+  open_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "open", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static getResponseHeader_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "XMLHttpRequest_getResponseHeader_Callback";
-  getResponseHeader_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getResponseHeader_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  open_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => Blink_JsNative_DomException.callMethod(mthis, "open", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4]);
 
-  static onreadystatechange_Getter(mthis) native "XMLHttpRequest_onreadystatechange_Getter";
-  onreadystatechange_Getter_(mthis) => onreadystatechange_Getter(mthis);
+  overrideMimeType_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "overrideMimeType", []);
 
-  static onreadystatechange_Setter(mthis, __arg_0) native "XMLHttpRequest_onreadystatechange_Setter";
-  onreadystatechange_Setter_(mthis, __arg_0) => onreadystatechange_Setter(mthis, __arg_0);
+  overrideMimeType_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "overrideMimeType", [__arg_0]);
 
-  static open_Callback_0(mthis) native "XMLHttpRequest_open_Callback";
-  open_Callback_0_(mthis) => open_Callback_0(mthis);
+  readyState_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "readyState");
 
-  static open_Callback_1(mthis, __arg_0) native "XMLHttpRequest_open_Callback";
-  open_Callback_1_(mthis, __arg_0) => open_Callback_1(mthis, __arg_0);
+  responseText_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "responseText");
 
-  static open_Callback_2(mthis, __arg_0, __arg_1) native "XMLHttpRequest_open_Callback";
-  open_Callback_2_(mthis, __arg_0, __arg_1) => open_Callback_2(mthis, __arg_0, __arg_1);
+  responseType_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "responseType");
 
-  static open_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "XMLHttpRequest_open_Callback";
-  open_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => open_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  responseType_Setter_(mthis, __arg_0) => mthis["responseType"] = __arg_0;
 
-  static open_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "XMLHttpRequest_open_Callback";
-  open_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => open_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  responseURL_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "responseURL");
 
-  static open_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "XMLHttpRequest_open_Callback";
-  open_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => open_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  responseXML_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "responseXML");
 
-  static open_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "XMLHttpRequest_open_Callback";
-  open_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => open_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
+  response_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "response");
 
-  static open_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) native "XMLHttpRequest_open_Callback";
-  open_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => open_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6);
+  send_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "send", []);
 
-  static overrideMimeType_Callback_0(mthis) native "XMLHttpRequest_overrideMimeType_Callback";
-  overrideMimeType_Callback_0_(mthis) => overrideMimeType_Callback_0(mthis);
+  send_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "send", [__arg_0]);
 
-  static overrideMimeType_Callback_1(mthis, __arg_0) native "XMLHttpRequest_overrideMimeType_Callback";
-  overrideMimeType_Callback_1_(mthis, __arg_0) => overrideMimeType_Callback_1(mthis, __arg_0);
+  setRequestHeader_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "setRequestHeader", []);
 
-  static overrideMimeType_Callback_2(mthis, __arg_0, __arg_1) native "XMLHttpRequest_overrideMimeType_Callback";
-  overrideMimeType_Callback_2_(mthis, __arg_0, __arg_1) => overrideMimeType_Callback_2(mthis, __arg_0, __arg_1);
+  setRequestHeader_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "setRequestHeader", [__arg_0]);
 
-  static overrideMimeType_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "XMLHttpRequest_overrideMimeType_Callback";
-  overrideMimeType_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => overrideMimeType_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  setRequestHeader_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "setRequestHeader", [__arg_0, __arg_1]);
 
-  static readyState_Getter(mthis) native "XMLHttpRequest_readyState_Getter";
-  readyState_Getter_(mthis) => readyState_Getter(mthis);
+  statusText_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "statusText");
 
-  static responseText_Getter(mthis) native "XMLHttpRequest_responseText_Getter";
-  responseText_Getter_(mthis) => responseText_Getter(mthis);
+  status_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "status");
 
-  static responseType_Getter(mthis) native "XMLHttpRequest_responseType_Getter";
-  responseType_Getter_(mthis) => responseType_Getter(mthis);
+  timeout_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "timeout");
 
-  static responseType_Setter(mthis, __arg_0) native "XMLHttpRequest_responseType_Setter";
-  responseType_Setter_(mthis, __arg_0) => responseType_Setter(mthis, __arg_0);
+  timeout_Setter_(mthis, __arg_0) => mthis["timeout"] = __arg_0;
 
-  static responseURL_Getter(mthis) native "XMLHttpRequest_responseURL_Getter";
-  responseURL_Getter_(mthis) => responseURL_Getter(mthis);
+  upload_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "upload");
 
-  static responseXML_Getter(mthis) native "XMLHttpRequest_responseXML_Getter";
-  responseXML_Getter_(mthis) => responseXML_Getter(mthis);
+  withCredentials_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "withCredentials");
 
-  static response_Getter(mthis) native "XMLHttpRequest_response_Getter";
-  response_Getter_(mthis) => response_Getter(mthis);
-
-  static send_Callback_0(mthis) native "XMLHttpRequest_send_Callback";
-  send_Callback_0_(mthis) => send_Callback_0(mthis);
-
-  static send_Callback_1(mthis, __arg_0) native "XMLHttpRequest_send_Callback";
-  send_Callback_1_(mthis, __arg_0) => send_Callback_1(mthis, __arg_0);
-
-  static send_Callback_2(mthis, __arg_0, __arg_1) native "XMLHttpRequest_send_Callback";
-  send_Callback_2_(mthis, __arg_0, __arg_1) => send_Callback_2(mthis, __arg_0, __arg_1);
-
-  static send_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "XMLHttpRequest_send_Callback";
-  send_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => send_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static setRequestHeader_Callback_0(mthis) native "XMLHttpRequest_setRequestHeader_Callback";
-  setRequestHeader_Callback_0_(mthis) => setRequestHeader_Callback_0(mthis);
-
-  static setRequestHeader_Callback_1(mthis, __arg_0) native "XMLHttpRequest_setRequestHeader_Callback";
-  setRequestHeader_Callback_1_(mthis, __arg_0) => setRequestHeader_Callback_1(mthis, __arg_0);
-
-  static setRequestHeader_Callback_2(mthis, __arg_0, __arg_1) native "XMLHttpRequest_setRequestHeader_Callback";
-  setRequestHeader_Callback_2_(mthis, __arg_0, __arg_1) => setRequestHeader_Callback_2(mthis, __arg_0, __arg_1);
-
-  static setRequestHeader_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "XMLHttpRequest_setRequestHeader_Callback";
-  setRequestHeader_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => setRequestHeader_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static setRequestHeader_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "XMLHttpRequest_setRequestHeader_Callback";
-  setRequestHeader_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => setRequestHeader_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static statusText_Getter(mthis) native "XMLHttpRequest_statusText_Getter";
-  statusText_Getter_(mthis) => statusText_Getter(mthis);
-
-  static status_Getter(mthis) native "XMLHttpRequest_status_Getter";
-  status_Getter_(mthis) => status_Getter(mthis);
-
-  static timeout_Getter(mthis) native "XMLHttpRequest_timeout_Getter";
-  timeout_Getter_(mthis) => timeout_Getter(mthis);
-
-  static timeout_Setter(mthis, __arg_0) native "XMLHttpRequest_timeout_Setter";
-  timeout_Setter_(mthis, __arg_0) => timeout_Setter(mthis, __arg_0);
-
-  static upload_Getter(mthis) native "XMLHttpRequest_upload_Getter";
-  upload_Getter_(mthis) => upload_Getter(mthis);
-
-  static withCredentials_Getter(mthis) native "XMLHttpRequest_withCredentials_Getter";
-  withCredentials_Getter_(mthis) => withCredentials_Getter(mthis);
-
-  static withCredentials_Setter(mthis, __arg_0) native "XMLHttpRequest_withCredentials_Setter";
-  withCredentials_Setter_(mthis, __arg_0) => withCredentials_Setter(mthis, __arg_0);
+  withCredentials_Setter_(mthis, __arg_0) => mthis["withCredentials"] = __arg_0;
 
 }
 
 class BlinkXMLHttpRequestEventTarget extends BlinkEventTarget {
   static final instance = new BlinkXMLHttpRequestEventTarget();
 
-  static onabort_Getter(mthis) native "XMLHttpRequestEventTarget_onabort_Getter";
-  onabort_Getter_(mthis) => onabort_Getter(mthis);
+  onabort_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onabort");
 
-  static onabort_Setter(mthis, __arg_0) native "XMLHttpRequestEventTarget_onabort_Setter";
-  onabort_Setter_(mthis, __arg_0) => onabort_Setter(mthis, __arg_0);
+  onabort_Setter_(mthis, __arg_0) => mthis["onabort"] = __arg_0;
 
-  static onerror_Getter(mthis) native "XMLHttpRequestEventTarget_onerror_Getter";
-  onerror_Getter_(mthis) => onerror_Getter(mthis);
+  onerror_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onerror");
 
-  static onerror_Setter(mthis, __arg_0) native "XMLHttpRequestEventTarget_onerror_Setter";
-  onerror_Setter_(mthis, __arg_0) => onerror_Setter(mthis, __arg_0);
+  onerror_Setter_(mthis, __arg_0) => mthis["onerror"] = __arg_0;
 
-  static onload_Getter(mthis) native "XMLHttpRequestEventTarget_onload_Getter";
-  onload_Getter_(mthis) => onload_Getter(mthis);
+  onload_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onload");
 
-  static onload_Setter(mthis, __arg_0) native "XMLHttpRequestEventTarget_onload_Setter";
-  onload_Setter_(mthis, __arg_0) => onload_Setter(mthis, __arg_0);
+  onload_Setter_(mthis, __arg_0) => mthis["onload"] = __arg_0;
 
-  static onloadend_Getter(mthis) native "XMLHttpRequestEventTarget_onloadend_Getter";
-  onloadend_Getter_(mthis) => onloadend_Getter(mthis);
+  onloadend_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onloadend");
 
-  static onloadend_Setter(mthis, __arg_0) native "XMLHttpRequestEventTarget_onloadend_Setter";
-  onloadend_Setter_(mthis, __arg_0) => onloadend_Setter(mthis, __arg_0);
+  onloadend_Setter_(mthis, __arg_0) => mthis["onloadend"] = __arg_0;
 
-  static onloadstart_Getter(mthis) native "XMLHttpRequestEventTarget_onloadstart_Getter";
-  onloadstart_Getter_(mthis) => onloadstart_Getter(mthis);
+  onloadstart_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onloadstart");
 
-  static onloadstart_Setter(mthis, __arg_0) native "XMLHttpRequestEventTarget_onloadstart_Setter";
-  onloadstart_Setter_(mthis, __arg_0) => onloadstart_Setter(mthis, __arg_0);
+  onloadstart_Setter_(mthis, __arg_0) => mthis["onloadstart"] = __arg_0;
 
-  static onprogress_Getter(mthis) native "XMLHttpRequestEventTarget_onprogress_Getter";
-  onprogress_Getter_(mthis) => onprogress_Getter(mthis);
+  onprogress_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "onprogress");
 
-  static onprogress_Setter(mthis, __arg_0) native "XMLHttpRequestEventTarget_onprogress_Setter";
-  onprogress_Setter_(mthis, __arg_0) => onprogress_Setter(mthis, __arg_0);
+  onprogress_Setter_(mthis, __arg_0) => mthis["onprogress"] = __arg_0;
 
-  static ontimeout_Getter(mthis) native "XMLHttpRequestEventTarget_ontimeout_Getter";
-  ontimeout_Getter_(mthis) => ontimeout_Getter(mthis);
+  ontimeout_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "ontimeout");
 
-  static ontimeout_Setter(mthis, __arg_0) native "XMLHttpRequestEventTarget_ontimeout_Setter";
-  ontimeout_Setter_(mthis, __arg_0) => ontimeout_Setter(mthis, __arg_0);
+  ontimeout_Setter_(mthis, __arg_0) => mthis["ontimeout"] = __arg_0;
 
 }
 
 class BlinkXMLHttpRequestProgressEvent extends BlinkProgressEvent {
   static final instance = new BlinkXMLHttpRequestProgressEvent();
 
-  static position_Getter(mthis) native "XMLHttpRequestProgressEvent_position_Getter";
-  position_Getter_(mthis) => position_Getter(mthis);
+  position_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "position");
 
-  static totalSize_Getter(mthis) native "XMLHttpRequestProgressEvent_totalSize_Getter";
-  totalSize_Getter_(mthis) => totalSize_Getter(mthis);
+  totalSize_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "totalSize");
 
 }
 
@@ -31231,294 +17048,130 @@
 class BlinkXMLSerializer {
   static final instance = new BlinkXMLSerializer();
 
-  static constructorCallback_0() native "XMLSerializer_constructorCallback";
-  constructorCallback_0_() => constructorCallback_0();
+  constructorCallback_0_() => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "XMLSerializer"), []);
 
-  static constructorCallback_1(__arg_0) native "XMLSerializer_constructorCallback";
-  constructorCallback_1_(__arg_0) => constructorCallback_1(__arg_0);
+  serializeToString_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "serializeToString", []);
 
-  static constructorCallback_2(__arg_0, __arg_1) native "XMLSerializer_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
-
-  static serializeToString_Callback_0(mthis) native "XMLSerializer_serializeToString_Callback";
-  serializeToString_Callback_0_(mthis) => serializeToString_Callback_0(mthis);
-
-  static serializeToString_Callback_1(mthis, __arg_0) native "XMLSerializer_serializeToString_Callback";
-  serializeToString_Callback_1_(mthis, __arg_0) => serializeToString_Callback_1(mthis, __arg_0);
-
-  static serializeToString_Callback_2(mthis, __arg_0, __arg_1) native "XMLSerializer_serializeToString_Callback";
-  serializeToString_Callback_2_(mthis, __arg_0, __arg_1) => serializeToString_Callback_2(mthis, __arg_0, __arg_1);
-
-  static serializeToString_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "XMLSerializer_serializeToString_Callback";
-  serializeToString_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => serializeToString_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  serializeToString_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "serializeToString", [__arg_0]);
 
 }
 
 class BlinkXPathEvaluator {
   static final instance = new BlinkXPathEvaluator();
 
-  static constructorCallback_0() native "XPathEvaluator_constructorCallback";
-  constructorCallback_0_() => constructorCallback_0();
+  constructorCallback_0_() => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "XPathEvaluator"), []);
 
-  static constructorCallback_1(__arg_0) native "XPathEvaluator_constructorCallback";
-  constructorCallback_1_(__arg_0) => constructorCallback_1(__arg_0);
+  createExpression_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createExpression", []);
 
-  static constructorCallback_2(__arg_0, __arg_1) native "XPathEvaluator_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  createExpression_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "createExpression", [__arg_0]);
 
-  static createExpression_Callback_0(mthis) native "XPathEvaluator_createExpression_Callback";
-  createExpression_Callback_0_(mthis) => createExpression_Callback_0(mthis);
+  createExpression_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "createExpression", [__arg_0, __arg_1]);
 
-  static createExpression_Callback_1(mthis, __arg_0) native "XPathEvaluator_createExpression_Callback";
-  createExpression_Callback_1_(mthis, __arg_0) => createExpression_Callback_1(mthis, __arg_0);
+  createNSResolver_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "createNSResolver", []);
 
-  static createExpression_Callback_2(mthis, __arg_0, __arg_1) native "XPathEvaluator_createExpression_Callback";
-  createExpression_Callback_2_(mthis, __arg_0, __arg_1) => createExpression_Callback_2(mthis, __arg_0, __arg_1);
+  createNSResolver_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "createNSResolver", [__arg_0]);
 
-  static createExpression_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "XPathEvaluator_createExpression_Callback";
-  createExpression_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => createExpression_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  evaluate_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "evaluate", []);
 
-  static createExpression_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "XPathEvaluator_createExpression_Callback";
-  createExpression_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => createExpression_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  evaluate_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "evaluate", [__arg_0]);
 
-  static createNSResolver_Callback_0(mthis) native "XPathEvaluator_createNSResolver_Callback";
-  createNSResolver_Callback_0_(mthis) => createNSResolver_Callback_0(mthis);
+  evaluate_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "evaluate", [__arg_0, __arg_1]);
 
-  static createNSResolver_Callback_1(mthis, __arg_0) native "XPathEvaluator_createNSResolver_Callback";
-  createNSResolver_Callback_1_(mthis, __arg_0) => createNSResolver_Callback_1(mthis, __arg_0);
+  evaluate_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "evaluate", [__arg_0, __arg_1, __arg_2]);
 
-  static createNSResolver_Callback_2(mthis, __arg_0, __arg_1) native "XPathEvaluator_createNSResolver_Callback";
-  createNSResolver_Callback_2_(mthis, __arg_0, __arg_1) => createNSResolver_Callback_2(mthis, __arg_0, __arg_1);
+  evaluate_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => Blink_JsNative_DomException.callMethod(mthis, "evaluate", [__arg_0, __arg_1, __arg_2, __arg_3]);
 
-  static createNSResolver_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "XPathEvaluator_createNSResolver_Callback";
-  createNSResolver_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => createNSResolver_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static evaluate_Callback_0(mthis) native "XPathEvaluator_evaluate_Callback";
-  evaluate_Callback_0_(mthis) => evaluate_Callback_0(mthis);
-
-  static evaluate_Callback_1(mthis, __arg_0) native "XPathEvaluator_evaluate_Callback";
-  evaluate_Callback_1_(mthis, __arg_0) => evaluate_Callback_1(mthis, __arg_0);
-
-  static evaluate_Callback_2(mthis, __arg_0, __arg_1) native "XPathEvaluator_evaluate_Callback";
-  evaluate_Callback_2_(mthis, __arg_0, __arg_1) => evaluate_Callback_2(mthis, __arg_0, __arg_1);
-
-  static evaluate_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "XPathEvaluator_evaluate_Callback";
-  evaluate_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => evaluate_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static evaluate_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "XPathEvaluator_evaluate_Callback";
-  evaluate_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => evaluate_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static evaluate_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "XPathEvaluator_evaluate_Callback";
-  evaluate_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => evaluate_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
-
-  static evaluate_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) native "XPathEvaluator_evaluate_Callback";
-  evaluate_Callback_6_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5) => evaluate_Callback_6(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5);
-
-  static evaluate_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) native "XPathEvaluator_evaluate_Callback";
-  evaluate_Callback_7_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6) => evaluate_Callback_7(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4, __arg_5, __arg_6);
+  evaluate_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => Blink_JsNative_DomException.callMethod(mthis, "evaluate", [__arg_0, __arg_1, __arg_2, __arg_3, __arg_4]);
 
 }
 
 class BlinkXPathExpression {
   static final instance = new BlinkXPathExpression();
 
-  static evaluate_Callback_0(mthis) native "XPathExpression_evaluate_Callback";
-  evaluate_Callback_0_(mthis) => evaluate_Callback_0(mthis);
+  evaluate_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "evaluate", []);
 
-  static evaluate_Callback_1(mthis, __arg_0) native "XPathExpression_evaluate_Callback";
-  evaluate_Callback_1_(mthis, __arg_0) => evaluate_Callback_1(mthis, __arg_0);
+  evaluate_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "evaluate", [__arg_0]);
 
-  static evaluate_Callback_2(mthis, __arg_0, __arg_1) native "XPathExpression_evaluate_Callback";
-  evaluate_Callback_2_(mthis, __arg_0, __arg_1) => evaluate_Callback_2(mthis, __arg_0, __arg_1);
+  evaluate_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "evaluate", [__arg_0, __arg_1]);
 
-  static evaluate_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "XPathExpression_evaluate_Callback";
-  evaluate_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => evaluate_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static evaluate_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "XPathExpression_evaluate_Callback";
-  evaluate_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => evaluate_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static evaluate_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "XPathExpression_evaluate_Callback";
-  evaluate_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => evaluate_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
+  evaluate_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "evaluate", [__arg_0, __arg_1, __arg_2]);
 
 }
 
 class BlinkXPathNSResolver {
   static final instance = new BlinkXPathNSResolver();
 
-  static lookupNamespaceURI_Callback_0(mthis) native "XPathNSResolver_lookupNamespaceURI_Callback";
-  lookupNamespaceURI_Callback_0_(mthis) => lookupNamespaceURI_Callback_0(mthis);
+  lookupNamespaceURI_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "lookupNamespaceURI", []);
 
-  static lookupNamespaceURI_Callback_1(mthis, __arg_0) native "XPathNSResolver_lookupNamespaceURI_Callback";
-  lookupNamespaceURI_Callback_1_(mthis, __arg_0) => lookupNamespaceURI_Callback_1(mthis, __arg_0);
-
-  static lookupNamespaceURI_Callback_2(mthis, __arg_0, __arg_1) native "XPathNSResolver_lookupNamespaceURI_Callback";
-  lookupNamespaceURI_Callback_2_(mthis, __arg_0, __arg_1) => lookupNamespaceURI_Callback_2(mthis, __arg_0, __arg_1);
-
-  static lookupNamespaceURI_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "XPathNSResolver_lookupNamespaceURI_Callback";
-  lookupNamespaceURI_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => lookupNamespaceURI_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  lookupNamespaceURI_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "lookupNamespaceURI", [__arg_0]);
 
 }
 
 class BlinkXPathResult {
   static final instance = new BlinkXPathResult();
 
-  static booleanValue_Getter(mthis) native "XPathResult_booleanValue_Getter";
-  booleanValue_Getter_(mthis) => booleanValue_Getter(mthis);
+  booleanValue_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "booleanValue");
 
-  static invalidIteratorState_Getter(mthis) native "XPathResult_invalidIteratorState_Getter";
-  invalidIteratorState_Getter_(mthis) => invalidIteratorState_Getter(mthis);
+  invalidIteratorState_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "invalidIteratorState");
 
-  static iterateNext_Callback_0(mthis) native "XPathResult_iterateNext_Callback";
-  iterateNext_Callback_0_(mthis) => iterateNext_Callback_0(mthis);
+  iterateNext_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "iterateNext", []);
 
-  static iterateNext_Callback_1(mthis, __arg_0) native "XPathResult_iterateNext_Callback";
-  iterateNext_Callback_1_(mthis, __arg_0) => iterateNext_Callback_1(mthis, __arg_0);
+  numberValue_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "numberValue");
 
-  static iterateNext_Callback_2(mthis, __arg_0, __arg_1) native "XPathResult_iterateNext_Callback";
-  iterateNext_Callback_2_(mthis, __arg_0, __arg_1) => iterateNext_Callback_2(mthis, __arg_0, __arg_1);
+  resultType_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "resultType");
 
-  static numberValue_Getter(mthis) native "XPathResult_numberValue_Getter";
-  numberValue_Getter_(mthis) => numberValue_Getter(mthis);
+  singleNodeValue_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "singleNodeValue");
 
-  static resultType_Getter(mthis) native "XPathResult_resultType_Getter";
-  resultType_Getter_(mthis) => resultType_Getter(mthis);
+  snapshotItem_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "snapshotItem", []);
 
-  static singleNodeValue_Getter(mthis) native "XPathResult_singleNodeValue_Getter";
-  singleNodeValue_Getter_(mthis) => singleNodeValue_Getter(mthis);
+  snapshotItem_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "snapshotItem", [__arg_0]);
 
-  static snapshotItem_Callback_0(mthis) native "XPathResult_snapshotItem_Callback";
-  snapshotItem_Callback_0_(mthis) => snapshotItem_Callback_0(mthis);
+  snapshotLength_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "snapshotLength");
 
-  static snapshotItem_Callback_1(mthis, __arg_0) native "XPathResult_snapshotItem_Callback";
-  snapshotItem_Callback_1_(mthis, __arg_0) => snapshotItem_Callback_1(mthis, __arg_0);
-
-  static snapshotItem_Callback_2(mthis, __arg_0, __arg_1) native "XPathResult_snapshotItem_Callback";
-  snapshotItem_Callback_2_(mthis, __arg_0, __arg_1) => snapshotItem_Callback_2(mthis, __arg_0, __arg_1);
-
-  static snapshotItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "XPathResult_snapshotItem_Callback";
-  snapshotItem_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => snapshotItem_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static snapshotLength_Getter(mthis) native "XPathResult_snapshotLength_Getter";
-  snapshotLength_Getter_(mthis) => snapshotLength_Getter(mthis);
-
-  static stringValue_Getter(mthis) native "XPathResult_stringValue_Getter";
-  stringValue_Getter_(mthis) => stringValue_Getter(mthis);
+  stringValue_Getter_(mthis) => Blink_JsNative_DomException.getProperty(mthis, "stringValue");
 
 }
 
 class BlinkXSLTProcessor {
   static final instance = new BlinkXSLTProcessor();
 
-  static clearParameters_Callback_0(mthis) native "XSLTProcessor_clearParameters_Callback";
-  clearParameters_Callback_0_(mthis) => clearParameters_Callback_0(mthis);
+  clearParameters_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "clearParameters", []);
 
-  static clearParameters_Callback_1(mthis, __arg_0) native "XSLTProcessor_clearParameters_Callback";
-  clearParameters_Callback_1_(mthis, __arg_0) => clearParameters_Callback_1(mthis, __arg_0);
+  constructorCallback_0_() => new js.JsObject(Blink_JsNative_DomException.getProperty(js.context, "XSLTProcessor"), []);
 
-  static clearParameters_Callback_2(mthis, __arg_0, __arg_1) native "XSLTProcessor_clearParameters_Callback";
-  clearParameters_Callback_2_(mthis, __arg_0, __arg_1) => clearParameters_Callback_2(mthis, __arg_0, __arg_1);
+  getParameter_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "getParameter", []);
 
-  static constructorCallback_0() native "XSLTProcessor_constructorCallback";
-  constructorCallback_0_() => constructorCallback_0();
+  getParameter_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "getParameter", [__arg_0]);
 
-  static constructorCallback_1(__arg_0) native "XSLTProcessor_constructorCallback";
-  constructorCallback_1_(__arg_0) => constructorCallback_1(__arg_0);
+  getParameter_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "getParameter", [__arg_0, __arg_1]);
 
-  static constructorCallback_2(__arg_0, __arg_1) native "XSLTProcessor_constructorCallback";
-  constructorCallback_2_(__arg_0, __arg_1) => constructorCallback_2(__arg_0, __arg_1);
+  importStylesheet_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "importStylesheet", []);
 
-  static getParameter_Callback_0(mthis) native "XSLTProcessor_getParameter_Callback";
-  getParameter_Callback_0_(mthis) => getParameter_Callback_0(mthis);
+  importStylesheet_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "importStylesheet", [__arg_0]);
 
-  static getParameter_Callback_1(mthis, __arg_0) native "XSLTProcessor_getParameter_Callback";
-  getParameter_Callback_1_(mthis, __arg_0) => getParameter_Callback_1(mthis, __arg_0);
+  removeParameter_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "removeParameter", []);
 
-  static getParameter_Callback_2(mthis, __arg_0, __arg_1) native "XSLTProcessor_getParameter_Callback";
-  getParameter_Callback_2_(mthis, __arg_0, __arg_1) => getParameter_Callback_2(mthis, __arg_0, __arg_1);
+  removeParameter_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "removeParameter", [__arg_0]);
 
-  static getParameter_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "XSLTProcessor_getParameter_Callback";
-  getParameter_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => getParameter_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  removeParameter_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "removeParameter", [__arg_0, __arg_1]);
 
-  static getParameter_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "XSLTProcessor_getParameter_Callback";
-  getParameter_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => getParameter_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  reset_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "reset", []);
 
-  static importStylesheet_Callback_0(mthis) native "XSLTProcessor_importStylesheet_Callback";
-  importStylesheet_Callback_0_(mthis) => importStylesheet_Callback_0(mthis);
+  setParameter_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "setParameter", [__arg_0]);
 
-  static importStylesheet_Callback_1(mthis, __arg_0) native "XSLTProcessor_importStylesheet_Callback";
-  importStylesheet_Callback_1_(mthis, __arg_0) => importStylesheet_Callback_1(mthis, __arg_0);
+  setParameter_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "setParameter", [__arg_0, __arg_1]);
 
-  static importStylesheet_Callback_2(mthis, __arg_0, __arg_1) native "XSLTProcessor_importStylesheet_Callback";
-  importStylesheet_Callback_2_(mthis, __arg_0, __arg_1) => importStylesheet_Callback_2(mthis, __arg_0, __arg_1);
+  setParameter_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => Blink_JsNative_DomException.callMethod(mthis, "setParameter", [__arg_0, __arg_1, __arg_2]);
 
-  static importStylesheet_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "XSLTProcessor_importStylesheet_Callback";
-  importStylesheet_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => importStylesheet_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
+  transformToDocument_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "transformToDocument", []);
 
-  static removeParameter_Callback_0(mthis) native "XSLTProcessor_removeParameter_Callback";
-  removeParameter_Callback_0_(mthis) => removeParameter_Callback_0(mthis);
+  transformToDocument_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "transformToDocument", [__arg_0]);
 
-  static removeParameter_Callback_1(mthis, __arg_0) native "XSLTProcessor_removeParameter_Callback";
-  removeParameter_Callback_1_(mthis, __arg_0) => removeParameter_Callback_1(mthis, __arg_0);
+  transformToFragment_Callback_0_(mthis) => Blink_JsNative_DomException.callMethod(mthis, "transformToFragment", []);
 
-  static removeParameter_Callback_2(mthis, __arg_0, __arg_1) native "XSLTProcessor_removeParameter_Callback";
-  removeParameter_Callback_2_(mthis, __arg_0, __arg_1) => removeParameter_Callback_2(mthis, __arg_0, __arg_1);
+  transformToFragment_Callback_1_(mthis, __arg_0) => Blink_JsNative_DomException.callMethod(mthis, "transformToFragment", [__arg_0]);
 
-  static removeParameter_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "XSLTProcessor_removeParameter_Callback";
-  removeParameter_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => removeParameter_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static removeParameter_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "XSLTProcessor_removeParameter_Callback";
-  removeParameter_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => removeParameter_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static reset_Callback_0(mthis) native "XSLTProcessor_reset_Callback";
-  reset_Callback_0_(mthis) => reset_Callback_0(mthis);
-
-  static reset_Callback_1(mthis, __arg_0) native "XSLTProcessor_reset_Callback";
-  reset_Callback_1_(mthis, __arg_0) => reset_Callback_1(mthis, __arg_0);
-
-  static reset_Callback_2(mthis, __arg_0, __arg_1) native "XSLTProcessor_reset_Callback";
-  reset_Callback_2_(mthis, __arg_0, __arg_1) => reset_Callback_2(mthis, __arg_0, __arg_1);
-
-  static setParameter_Callback_1(mthis, __arg_0) native "XSLTProcessor_setParameter_Callback";
-  setParameter_Callback_1_(mthis, __arg_0) => setParameter_Callback_1(mthis, __arg_0);
-
-  static setParameter_Callback_2(mthis, __arg_0, __arg_1) native "XSLTProcessor_setParameter_Callback";
-  setParameter_Callback_2_(mthis, __arg_0, __arg_1) => setParameter_Callback_2(mthis, __arg_0, __arg_1);
-
-  static setParameter_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "XSLTProcessor_setParameter_Callback";
-  setParameter_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => setParameter_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static setParameter_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "XSLTProcessor_setParameter_Callback";
-  setParameter_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => setParameter_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
-
-  static setParameter_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) native "XSLTProcessor_setParameter_Callback";
-  setParameter_Callback_5_(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4) => setParameter_Callback_5(mthis, __arg_0, __arg_1, __arg_2, __arg_3, __arg_4);
-
-  static transformToDocument_Callback_0(mthis) native "XSLTProcessor_transformToDocument_Callback";
-  transformToDocument_Callback_0_(mthis) => transformToDocument_Callback_0(mthis);
-
-  static transformToDocument_Callback_1(mthis, __arg_0) native "XSLTProcessor_transformToDocument_Callback";
-  transformToDocument_Callback_1_(mthis, __arg_0) => transformToDocument_Callback_1(mthis, __arg_0);
-
-  static transformToDocument_Callback_2(mthis, __arg_0, __arg_1) native "XSLTProcessor_transformToDocument_Callback";
-  transformToDocument_Callback_2_(mthis, __arg_0, __arg_1) => transformToDocument_Callback_2(mthis, __arg_0, __arg_1);
-
-  static transformToDocument_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "XSLTProcessor_transformToDocument_Callback";
-  transformToDocument_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => transformToDocument_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static transformToFragment_Callback_0(mthis) native "XSLTProcessor_transformToFragment_Callback";
-  transformToFragment_Callback_0_(mthis) => transformToFragment_Callback_0(mthis);
-
-  static transformToFragment_Callback_1(mthis, __arg_0) native "XSLTProcessor_transformToFragment_Callback";
-  transformToFragment_Callback_1_(mthis, __arg_0) => transformToFragment_Callback_1(mthis, __arg_0);
-
-  static transformToFragment_Callback_2(mthis, __arg_0, __arg_1) native "XSLTProcessor_transformToFragment_Callback";
-  transformToFragment_Callback_2_(mthis, __arg_0, __arg_1) => transformToFragment_Callback_2(mthis, __arg_0, __arg_1);
-
-  static transformToFragment_Callback_3(mthis, __arg_0, __arg_1, __arg_2) native "XSLTProcessor_transformToFragment_Callback";
-  transformToFragment_Callback_3_(mthis, __arg_0, __arg_1, __arg_2) => transformToFragment_Callback_3(mthis, __arg_0, __arg_1, __arg_2);
-
-  static transformToFragment_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3) native "XSLTProcessor_transformToFragment_Callback";
-  transformToFragment_Callback_4_(mthis, __arg_0, __arg_1, __arg_2, __arg_3) => transformToFragment_Callback_4(mthis, __arg_0, __arg_1, __arg_2, __arg_3);
+  transformToFragment_Callback_2_(mthis, __arg_0, __arg_1) => Blink_JsNative_DomException.callMethod(mthis, "transformToFragment", [__arg_0, __arg_1]);
 
 }
 
@@ -31537,6 +17190,8 @@
 
   static createElement(document, tagName) native "Utils_createElement";
 
+  static constructElement(element_type, jsObject) native "Utils_constructor_create";
+
   static initializeCustomElement(element) native "Utils_initializeCustomElement";
 
   static changeElementWrapper(element, type) native "Utils_changeElementWrapper";
@@ -31587,3 +17242,25 @@
 
   static get_keys(_DOMStringMap) native "DOMStringMap_getKeys_Callback";
 }
+
+// Calls through JsNative but returns DomException instead of error strings.
+class Blink_JsNative_DomException {
+  static getProperty(js.JsObject o, name) {
+    try {
+      return js.JsNative.getProperty(o, name);
+    } catch (e) {
+      // Re-throw any errors (returned as a string) as a DomException.
+      throw new DomException.jsInterop(e);
+    }
+  }
+
+  static callMethod(js.JsObject o, String method, List args) {
+    try {
+      return js.JsNative.callMethod(o, method, args);
+    } catch (e) {
+      // Re-throw any errors (returned as a string) as a DomException.
+      throw new DomException.jsInterop(e);
+    }
+  }
+}
+
diff --git a/sdk/lib/_internal/js_runtime/lib/async_patch.dart b/sdk/lib/_internal/js_runtime/lib/async_patch.dart
index 1377957..1155e79 100644
--- a/sdk/lib/_internal/js_runtime/lib/async_patch.dart
+++ b/sdk/lib/_internal/js_runtime/lib/async_patch.dart
@@ -6,9 +6,12 @@
 
 import 'dart:_js_helper' show
     patch,
+    ExceptionAndStackTrace,
     Primitives,
     convertDartClosureToJS,
-    requiresPreamble;
+    getTraceFromException,
+    requiresPreamble,
+    unwrapException;
 import 'dart:_isolate_helper' show
     IsolateNatives,
     TimerImpl,
@@ -18,6 +21,8 @@
 
 import 'dart:_foreign_helper' show JS;
 
+import 'dart:_async_await_error_codes' as async_error_codes;
+
 @patch
 class _AsyncRun {
   @patch
@@ -121,3 +126,388 @@
     return new TimerImpl.periodic(milliseconds, callback);
   }
 }
+
+/// Runtime support for async-await transformation.
+///
+/// This function is called by a transformed function on each await and return
+/// in the untransformed function, and before starting.
+///
+/// If [object] is not a future it will be wrapped in a `new Future.value`.
+///
+/// If [asyncBody] is [async_error_codes.SUCCESS]/[async_error_codes.ERROR] it
+/// indicates a return or throw from the async function, and
+/// complete/completeError is called on [completer] with [object].
+///
+/// Otherwise [asyncBody] is set up to be called when the future is completed
+/// with a code [async_error_codes.SUCCESS]/[async_error_codes.ERROR] depending
+/// on the success of the future.
+///
+/// Returns the future of the completer for convenience of the first call.
+dynamic _asyncHelper(dynamic object,
+    dynamic /* int | _WrappedAsyncBody */ bodyFunctionOrErrorCode,
+    Completer completer) {
+  if (identical(bodyFunctionOrErrorCode, async_error_codes.SUCCESS)) {
+    completer.complete(object);
+    return;
+  } else if (identical(bodyFunctionOrErrorCode, async_error_codes.ERROR)) {
+    // The error is a js-error.
+    completer.completeError(unwrapException(object),
+    getTraceFromException(object));
+    return;
+  }
+
+  _awaitOnObject(object, bodyFunctionOrErrorCode);
+  return completer.future;
+}
+
+/// Awaits on the given [object].
+///
+/// If the [object] is a Future, registers on it, otherwise wraps it into a
+/// future first.
+///
+/// The [bodyFunction] argument is the continuation that should be invoked
+/// when the future completes.
+void _awaitOnObject(object, _WrappedAsyncBody bodyFunction) {
+  Function thenCallback =
+      (result) => bodyFunction(async_error_codes.SUCCESS, result);
+
+  Function errorCallback = (dynamic error, StackTrace stackTrace) {
+    ExceptionAndStackTrace wrappedException =
+        new ExceptionAndStackTrace(error, stackTrace);
+    bodyFunction(async_error_codes.ERROR, wrappedException);
+  };
+
+  if (object is _Future) {
+    // We can skip the zone registration, since the bodyFunction is already
+    // registered (see [_wrapJsFunctionForAsync]).
+    object._thenNoZoneRegistration(thenCallback, errorCallback);
+  } else if (object is Future) {
+    object.then(thenCallback, onError: errorCallback);
+  } else {
+    _Future future = new _Future();
+    future._setValue(object);
+    // We can skip the zone registration, since the bodyFunction is already
+    // registered (see [_wrapJsFunctionForAsync]).
+    future._thenNoZoneRegistration(thenCallback, null);
+  }
+}
+
+typedef void _WrappedAsyncBody(int errorCode, dynamic result);
+
+_WrappedAsyncBody _wrapJsFunctionForAsync(dynamic /* js function */ function) {
+  var protected = JS('', """
+    // Invokes [function] with [errorCode] and [result].
+    //
+    // If (and as long as) the invocation throws, calls [function] again,
+    // with an error-code.
+    function(errorCode, result) {
+      while (true) {
+        try {
+          #(errorCode, result);
+          break;
+        } catch (error) {
+          result = error;
+          errorCode = #;
+        }
+      }
+    }""", function, async_error_codes.ERROR);
+  return Zone.current.registerBinaryCallback((int errorCode, dynamic result) {
+    JS('', '#(#, #)', protected, errorCode, result);
+  });
+}
+
+/// Implements the runtime support for async* functions.
+///
+/// Called by the transformed function for each original return, await, yield,
+/// yield* and before starting the function.
+///
+/// When the async* function wants to return it calls this function with
+/// [asyncBody] == [async_error_codes.SUCCESS], the asyncStarHelper takes this
+/// as signal to close the stream.
+///
+/// When the async* function wants to signal that an uncaught error was thrown,
+/// it calls this function with [asyncBody] == [async_error_codes.ERROR],
+/// the streamHelper takes this as signal to addError [object] to the
+/// [controller] and close it.
+///
+/// If the async* function wants to do a yield or yield*, it calls this function
+/// with [object] being an [IterationMarker].
+///
+/// In the case of a yield or yield*, if the stream subscription has been
+/// canceled, schedules [asyncBody] to be called with
+/// [async_error_codes.STREAM_WAS_CANCELED].
+///
+/// If [object] is a single-yield [IterationMarker], adds the value of the
+/// [IterationMarker] to the stream. If the stream subscription has been
+/// paused, return early. Otherwise schedule the helper function to be
+/// executed again.
+///
+/// If [object] is a yield-star [IterationMarker], starts listening to the
+/// yielded stream, and adds all events and errors to our own controller (taking
+/// care if the subscription has been paused or canceled) - when the sub-stream
+/// is done, schedules [asyncBody] again.
+///
+/// If the async* function wants to do an await it calls this function with
+/// [object] not and [IterationMarker].
+///
+/// If [object] is not a [Future], it is wrapped in a `Future.value`.
+/// The [asyncBody] is called on completion of the future (see [asyncHelper].
+void _asyncStarHelper(dynamic object,
+    dynamic /* int | _WrappedAsyncBody */ bodyFunctionOrErrorCode,
+    _AsyncStarStreamController controller) {
+  if (identical(bodyFunctionOrErrorCode, async_error_codes.SUCCESS)) {
+    // This happens on return from the async* function.
+    if (controller.isCanceled) {
+      controller.cancelationCompleter.complete();
+    } else {
+      controller.close();
+    }
+    return;
+  } else if (identical(bodyFunctionOrErrorCode, async_error_codes.ERROR)) {
+    // The error is a js-error.
+    if (controller.isCanceled) {
+      controller.cancelationCompleter.completeError(
+          unwrapException(object),
+          getTraceFromException(object));
+    } else {
+      controller.addError(unwrapException(object),
+                          getTraceFromException(object));
+      controller.close();
+    }
+    return;
+  }
+
+  if (object is _IterationMarker) {
+    if (controller.isCanceled) {
+      bodyFunctionOrErrorCode(async_error_codes.STREAM_WAS_CANCELED, null);
+      return;
+    }
+    if (object.state == _IterationMarker.YIELD_SINGLE) {
+      controller.add(object.value);
+
+      scheduleMicrotask(() {
+        if (controller.isPaused) {
+          // We only suspend the thread inside the microtask in order to allow
+          // listeners on the output stream to pause in response to the just
+          // output value, and have the stream immediately stop producing.
+          controller.isSuspended = true;
+          return;
+        }
+        bodyFunctionOrErrorCode(null, async_error_codes.SUCCESS);
+      });
+      return;
+    } else if (object.state == _IterationMarker.YIELD_STAR) {
+      Stream stream = object.value;
+      // Errors of [stream] are passed though to the main stream. (see
+      // [AsyncStreamController.addStream]).
+      // TODO(sigurdm): The spec is not very clear here. Clarify with Gilad.
+      controller.addStream(stream).then((_) {
+        // No check for isPaused here because the spec 17.16.2 only
+        // demands checks *before* each element in [stream] not after the last
+        // one. On the other hand we check for isCanceled, as that check happens
+        // after insertion of each element.
+        int errorCode = controller.isCanceled
+            ? async_error_codes.STREAM_WAS_CANCELED
+            : async_error_codes.SUCCESS;
+        bodyFunctionOrErrorCode(errorCode, null);
+      });
+      return;
+    }
+  }
+
+  _awaitOnObject(object, bodyFunctionOrErrorCode);
+}
+
+Stream _streamOfController(_AsyncStarStreamController controller) {
+  return controller.stream;
+}
+
+/// A wrapper around a [StreamController] that keeps track of the state of
+/// the execution of an async* function.
+/// It can be in 1 of 3 states:
+///
+/// - running/scheduled
+/// - suspended
+/// - canceled
+///
+/// If yielding while the subscription is paused it will become suspended. And
+/// only resume after the subscription is resumed or canceled.
+class _AsyncStarStreamController {
+  StreamController controller;
+  Stream get stream => controller.stream;
+
+  /// True when the async* function has yielded while being paused.
+  /// When true execution will only resume after a `onResume` or `onCancel`
+  /// event.
+  bool isSuspended = false;
+
+  bool get isPaused => controller.isPaused;
+
+  Completer cancelationCompleter = null;
+
+  /// True after the StreamSubscription has been cancelled.
+  /// When this is true, errors thrown from the async* body should go to the
+  /// [cancelationCompleter] instead of adding them to [controller], and
+  /// returning from the async function should complete [cancelationCompleter].
+  bool get isCanceled => cancelationCompleter != null;
+
+  add(event) => controller.add(event);
+
+  addStream(Stream stream) {
+    return controller.addStream(stream, cancelOnError: false);
+  }
+
+  addError(error, stackTrace) => controller.addError(error, stackTrace);
+
+  close() => controller.close();
+
+  _AsyncStarStreamController(_WrappedAsyncBody body) {
+
+    _resumeBody() {
+      scheduleMicrotask(() {
+        body(async_error_codes.SUCCESS, null);
+      });
+    }
+
+    controller = new StreamController(
+      onListen: () {
+        _resumeBody();
+      }, onResume: () {
+        // Only schedule again if the async* function actually is suspended.
+        // Resume directly instead of scheduling, so that the sequence
+        // `pause-resume-pause` will result in one extra event produced.
+        if (isSuspended) {
+          isSuspended = false;
+          _resumeBody();
+        }
+      }, onCancel: () {
+        // If the async* is finished we ignore cancel events.
+        if (!controller.isClosed) {
+          cancelationCompleter = new Completer();
+          if (isSuspended) {
+            // Resume the suspended async* function to run finalizers.
+            isSuspended = false;
+            scheduleMicrotask(() {
+              body(async_error_codes.STREAM_WAS_CANCELED, null);
+            });
+          }
+          return cancelationCompleter.future;
+        }
+      });
+  }
+}
+
+_makeAsyncStarController(body) {
+  return new _AsyncStarStreamController(body);
+}
+
+class _IterationMarker {
+  static const YIELD_SINGLE = 0;
+  static const YIELD_STAR = 1;
+  static const ITERATION_ENDED = 2;
+  static const UNCAUGHT_ERROR = 3;
+
+  final value;
+  final int state;
+
+  _IterationMarker._(this.state, this.value);
+
+  static yieldStar(dynamic /* Iterable or Stream */ values) {
+    return new _IterationMarker._(YIELD_STAR, values);
+  }
+
+  static endOfIteration() {
+    return new _IterationMarker._(ITERATION_ENDED, null);
+  }
+
+  static yieldSingle(dynamic value) {
+    return new _IterationMarker._(YIELD_SINGLE, value);
+  }
+
+  static uncaughtError(dynamic error) {
+    return new _IterationMarker._(UNCAUGHT_ERROR, error);
+  }
+
+  toString() => "IterationMarker($state, $value)";
+}
+
+class _SyncStarIterator implements Iterator {
+  final dynamic _body;
+
+  // If [runningNested] this is the nested iterator, otherwise it is the
+  // current value.
+  dynamic _current = null;
+  bool _runningNested = false;
+
+  get current => _runningNested ? _current.current : _current;
+
+  _SyncStarIterator(this._body);
+
+  _runBody() {
+    return JS('', '''
+// Invokes [body] with [errorCode] and [result].
+//
+// If (and as long as) the invocation throws, calls [function] again,
+// with an error-code.
+(function(body) {
+  var errorValue, errorCode = #;
+  while (true) {
+    try {
+      return body(errorCode, errorValue);
+    } catch (error) {
+      errorValue = error;
+      errorCode = #
+    }
+  }
+})(#)''', async_error_codes.SUCCESS, async_error_codes.ERROR, _body);
+  }
+
+
+  bool moveNext() {
+    if (_runningNested) {
+      if (_current.moveNext()) {
+        return true;
+      } else {
+        _runningNested = false;
+      }
+    }
+    _current = _runBody();
+    if (_current is _IterationMarker) {
+      if (_current.state == _IterationMarker.ITERATION_ENDED) {
+        _current = null;
+        // Rely on [_body] to repeatedly return `ITERATION_ENDED`.
+        return false;
+      } else if (_current.state == _IterationMarker.UNCAUGHT_ERROR) {
+        // Rely on [_body] to repeatedly return `UNCAUGHT_ERROR`.
+        // This is a wrapped exception, so we use JavaScript throw to throw it.
+        JS('', 'throw #', _current.value);
+      } else {
+        assert(_current.state == _IterationMarker.YIELD_STAR);
+        _current = _current.value.iterator;
+        _runningNested = true;
+        return moveNext();
+      }
+    }
+    return true;
+  }
+}
+
+/// An Iterable corresponding to a sync* method.
+///
+/// Each invocation of a sync* method will return a new instance of this class.
+class _SyncStarIterable extends IterableBase {
+  // This is a function that will return a helper function that does the
+  // iteration of the sync*.
+  //
+  // Each invocation should give a body with fresh state.
+  final dynamic /* js function */ _outerHelper;
+
+  _SyncStarIterable(this._outerHelper);
+
+  Iterator get iterator => new _SyncStarIterator(JS('', '#()', _outerHelper));
+}
+
+@patch
+void _rethrow(Object error, StackTrace stackTrace) {
+  throw new AsyncError(error, stackTrace);
+}
diff --git a/sdk/lib/_internal/js_runtime/lib/constant_map.dart b/sdk/lib/_internal/js_runtime/lib/constant_map.dart
index 8f813fc..8a6a5c9 100644
--- a/sdk/lib/_internal/js_runtime/lib/constant_map.dart
+++ b/sdk/lib/_internal/js_runtime/lib/constant_map.dart
@@ -75,7 +75,7 @@
   final _jsObject;
   final List<K> _keys;
 
-  bool containsValue(V needle) {
+  bool containsValue(Object needle) {
     return values.any((V value) => value == needle);
   }
 
@@ -160,7 +160,7 @@
     return backingMap;
   }
 
-  bool containsValue(V needle) {
+  bool containsValue(Object needle) {
     return _getMap().containsValue(needle);
   }
 
diff --git a/sdk/lib/_internal/js_runtime/lib/core_patch.dart b/sdk/lib/_internal/js_runtime/lib/core_patch.dart
index 971b37f..7d6ad7c 100644
--- a/sdk/lib/_internal/js_runtime/lib/core_patch.dart
+++ b/sdk/lib/_internal/js_runtime/lib/core_patch.dart
@@ -17,10 +17,16 @@
                               ConstantMap,
                               stringJoinUnchecked,
                               objectHashCode,
-                              Closure;
+                              Closure,
+                              readHttp,
+                              JsLinkedHashMap;
+
+import 'dart:_foreign_helper' show JS;
 
 import 'dart:_native_typed_data' show NativeUint8List;
 
+import 'dart:async' show StreamController;
+
 String _symbolToString(Symbol symbol) => _symbol_dev.Symbol.getName(symbol);
 
 _symbolMapToStringMap(Map<Symbol, dynamic> map) {
@@ -306,6 +312,9 @@
 class Map<K, V> {
   @patch
   factory Map.unmodifiable(Map other) = ConstantMap<K, V>.from;
+
+  @patch
+  factory Map() = JsLinkedHashMap<K, V>.es6;
 }
 
 @patch
@@ -400,7 +409,7 @@
 // Patch for 'identical' function.
 @patch
 bool identical(Object a, Object b) {
-  return Primitives.identicalImplementation(a, b);
+  return JS('bool', '(# == null ? # == null : # === #)', a, b, a, b);
 }
 
 @patch
@@ -570,20 +579,53 @@
       uri = _resolvePackageUri(uri);
     }
     if (uri.scheme == "http" || uri.scheme == "https") {
-      return _readAsString(uri);
+      return _readAsString(uri, encoding);
     }
     throw new StateError("Unable to find resource, unknown scheme: $_location");
   }
 
+  // TODO(het): Use a streaming XHR request instead of returning the entire
+  // payload in one event.
   Stream<List<int>> _readAsStream(Uri uri) {
-    throw new UnimplementedError("Streaming bytes via HTTP");
+    var controller = new StreamController.broadcast();
+    // We only need to implement the listener as there is no way to provide
+    // back pressure into the channel.
+    controller.onListen = () {
+      // Once there is a listener, we kick off the loading of the resource.
+      _readAsBytes(uri).then((value) {
+        // The resource loading implementation sends all of the data in a
+        // single message. So the stream will only get a single value posted.
+        controller.add(value);
+        controller.close();
+      },
+      onError: (e, s) {
+        // In case the future terminates with an error we propagate it to the
+        // stream.
+        controller.addError(e, s);
+        controller.close();
+      });
+    };
+
+    return controller.stream;
   }
 
   Future<List<int>> _readAsBytes(Uri uri) {
-    throw new UnimplementedError("Reading bytes via HTTP");
+    return readHttp('$uri').then((data) {
+      if (data is NativeUint8List) return data;
+      if (data is String) return data.codeUnits;
+      throw new StateError(
+          "Unable to read Resource, data could not be decoded");
+    });
   }
 
-  Future<String> _readAsString(Uri uri) {
-    throw new UnimplementedError("Reading string via HTTP");
+  Future<String> _readAsString(Uri uri, Encoding encoding) {
+    return readHttp('$uri').then((data) {
+      if (data is String) return data;
+      if (data is NativeUint8List) {
+        return encoding.decode(data);
+      };
+      throw new StateError(
+          "Unable to read Resource, data could not be decoded");
+    });
   }
 }
diff --git a/sdk/lib/_internal/js_runtime/lib/developer_patch.dart b/sdk/lib/_internal/js_runtime/lib/developer_patch.dart
index 4f06174d..e13f580 100644
--- a/sdk/lib/_internal/js_runtime/lib/developer_patch.dart
+++ b/sdk/lib/_internal/js_runtime/lib/developer_patch.dart
@@ -4,7 +4,7 @@
 
 // Patch file for dart:developer library.
 
-import 'dart:_js_helper' show patch;
+import 'dart:_js_helper' show patch, ForceInline;
 import 'dart:_foreign_helper' show JS;
 
 @patch
@@ -22,13 +22,56 @@
 }
 
 @patch
-log(String message,
-    {DateTime time,
-     int sequenceNumber,
-     int level: 0,
-     String name: '',
-     Zone zone,
-     Object error,
-     StackTrace stackTrace}) {
+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
+int _getTraceClock() {
+  // TODO.
+  return _clockValue++;
+}
+int _clockValue = 0;
+
+@patch
+void _reportCompleteEvent(int start,
+                          int end,
+                          String category,
+                          String name,
+                          String argumentsAsJson) {
+  // TODO.
+}
+
+@patch
+int _getNextAsyncId() {
+  return 0;
+}
+
+@patch
+void _reportTaskEvent(int start,
+                      int taskId,
+                      String phase,
+                      String category,
+                      String name,
+                      String argumentsAsJson) {
+ // TODO.
+}
diff --git a/sdk/lib/_internal/js_runtime/lib/interceptors.dart b/sdk/lib/_internal/js_runtime/lib/interceptors.dart
index cf4d39b..25fbb11 100644
--- a/sdk/lib/_internal/js_runtime/lib/interceptors.dart
+++ b/sdk/lib/_internal/js_runtime/lib/interceptors.dart
@@ -12,7 +12,6 @@
 import 'dart:_internal' hide Symbol;
 import "dart:_internal" as _symbol_dev show Symbol;
 import 'dart:_js_helper' show allMatchesInStringUnchecked,
-                              Null,
                               JSSyntaxRegExp,
                               Primitives,
                               argumentErrorValue,
@@ -22,6 +21,7 @@
                               checkString,
                               defineProperty,
                               diagnoseIndexError,
+                              getIsolateAffinityTag,
                               getRuntimeType,
                               initNativeDispatch,
                               initNativeDispatchFlag,
@@ -35,11 +35,12 @@
                               stringReplaceFirstUnchecked,
                               stringReplaceFirstMappedUnchecked,
                               stringReplaceRangeUnchecked,
+                              throwConcurrentModificationError,
                               lookupAndCacheInterceptor,
-                              lookupDispatchRecord,
                               StringMatch,
                               firstMatchAfter,
                               NoInline;
+
 import 'dart:_foreign_helper' show
     JS,
     JS_EFFECT,
@@ -52,6 +53,9 @@
 part 'js_number.dart';
 part 'js_string.dart';
 
+final String DART_CLOSURE_PROPERTY_NAME =
+    getIsolateAffinityTag(r'_$dart_dartClosure');
+
 String _symbolToString(Symbol symbol) => _symbol_dev.Symbol.getName(symbol);
 
 _symbolMapToStringMap(Map<Symbol, dynamic> map) {
@@ -68,6 +72,7 @@
  * to emit a call to an intercepted method, that is a method that is
  * defined in an interceptor class.
  */
+@NoInline()
 getInterceptor(object) {
   // This is a magic method: the compiler does specialization of it
   // depending on the uses of intercepted methods and instantiated
@@ -169,6 +174,9 @@
     // 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);
@@ -393,13 +401,18 @@
  * Interceptor base class for JavaScript objects not recognized as some more
  * specific native type.
  */
-abstract class JavaScriptObject extends Interceptor implements JSObject {
+class JavaScriptObject extends Interceptor implements JSObject {
   const JavaScriptObject();
 
   // It would be impolite to stash a property on the object.
   int get hashCode => 0;
 
   Type get runtimeType => JSObject;
+
+  /**
+   * Returns the result of the JavaScript objects `toString` method.
+   */
+  String toString() => JS('String', 'String(#)', this);
 }
 
 
@@ -420,6 +433,19 @@
  */
 class UnknownJavaScriptObject extends JavaScriptObject {
   const UnknownJavaScriptObject();
+}
 
-  String toString() => JS('String', 'String(#)', this);
+/**
+ * Interceptor for JavaScript function objects and Dart functions that have
+ * been converted to JavaScript functions.
+ * These interceptor methods are not always used as the JavaScript function
+ * object has also been mangled to support Dart function calling conventions.
+ */
+class JavaScriptFunction extends JavaScriptObject implements Function {
+  const JavaScriptFunction();
+
+  String toString() {
+    var dartClosure = JS('', '#.#', this, DART_CLOSURE_PROPERTY_NAME);
+    return dartClosure == null ? super.toString() : dartClosure.toString();
+  }
 }
diff --git a/sdk/lib/_internal/js_runtime/lib/internal_patch.dart b/sdk/lib/_internal/js_runtime/lib/internal_patch.dart
index 6c39c4a..cb8820c 100644
--- a/sdk/lib/_internal/js_runtime/lib/internal_patch.dart
+++ b/sdk/lib/_internal/js_runtime/lib/internal_patch.dart
@@ -3,7 +3,7 @@
 // BSD-style license that can be found in the LICENSE file.
 
 import 'dart:_js_primitives' show printString;
-import 'dart:_js_helper' show JS, patch;
+import 'dart:_js_helper' show patch;
 import 'dart:_interceptors' show JSArray;
 
 @patch
diff --git a/sdk/lib/_internal/js_runtime/lib/io_patch.dart b/sdk/lib/_internal/js_runtime/lib/io_patch.dart
index 792b74d..23f4708 100644
--- a/sdk/lib/_internal/js_runtime/lib/io_patch.dart
+++ b/sdk/lib/_internal/js_runtime/lib/io_patch.dart
@@ -403,12 +403,26 @@
   factory SecureSocket._(RawSecureSocket rawSocket) {
     throw new UnsupportedError("SecureSocket constructor");
   }
+}
+
+@patch
+class SecurityContext {
+  @patch
+  factory SecurityContext() {
+    throw new UnsupportedError("SecurityContext constructor");
+  }
 
   @patch
-  static void initialize({String database,
-                          String password,
-                          bool useBuiltinRoots: true}) {
-    throw new UnsupportedError("SecureSocket.initialize");
+  static SecurityContext get defaultContext {
+    throw new UnsupportedError("default SecurityContext getter");
+  }
+}
+
+@patch
+class X509Certificate {
+  @patch
+  factory X509Certificate._() {
+    throw new UnsupportedError("X509Certificate constructor");
   }
 }
 
diff --git a/sdk/lib/_internal/js_runtime/lib/isolate_helper.dart b/sdk/lib/_internal/js_runtime/lib/isolate_helper.dart
index 397c8d8..a74fb12 100644
--- a/sdk/lib/_internal/js_runtime/lib/isolate_helper.dart
+++ b/sdk/lib/_internal/js_runtime/lib/isolate_helper.dart
@@ -21,7 +21,6 @@
 import 'dart:_js_helper' show
     Closure,
     InternalMap,
-    Null,
     Primitives,
     convertDartClosureToJS,
     createDartClosureFromNameOfStaticFunction,
@@ -96,9 +95,6 @@
  * call is not emitted.
  */
 void startRootIsolate(entry, args) {
-  // The dartMainRunner can inject a new arguments array. We pass the arguments
-  // through a "JS", so that the type-inferrer loses track of it.
-  args = JS("", "#", args);
   if (args == null) args = [];
   if (args is! List) {
     throw new ArgumentError("Arguments to main must be a List: $args");
diff --git a/sdk/lib/_internal/js_runtime/lib/isolate_patch.dart b/sdk/lib/_internal/js_runtime/lib/isolate_patch.dart
index eb68107..ac8b537 100644
--- a/sdk/lib/_internal/js_runtime/lib/isolate_patch.dart
+++ b/sdk/lib/_internal/js_runtime/lib/isolate_patch.dart
@@ -6,9 +6,7 @@
 
 import 'dart:_js_helper' show patch;
 import 'dart:_isolate_helper' show CapabilityImpl,
-                                   CloseToken,
                                    IsolateNatives,
-                                   JsIsolateSink,
                                    ReceivePortImpl,
                                    RawReceivePortImpl;
 
@@ -62,8 +60,14 @@
   @patch
   static Future<Isolate> spawnUri(
       Uri uri, List<String> args, var message,
-      {bool paused: false, bool checked, Uri packageRoot, bool errorsAreFatal,
-       SendPort onExit, SendPort onError}) {
+      {bool paused: false,
+       SendPort onExit,
+       SendPort onError,
+       bool errorsAreFatal,
+       bool checked,
+       Map<String, String> environment,
+       Uri packageRoot}) {
+    if (environment != null) throw new UnimplementedError("environment");
     if (packageRoot != null) throw new UnimplementedError("packageRoot");
     bool forcePause = (errorsAreFatal != null) ||
                       (onExit != null) ||
@@ -78,6 +82,7 @@
       } else if (args != null) {
         throw new ArgumentError("Args must be a list of Strings $args");
       }
+      // TODO: Handle [packageRoot] somehow, possibly by throwing.
       // 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 f6bcbbb..78e53b1 100644
--- a/sdk/lib/_internal/js_runtime/lib/js_array.dart
+++ b/sdk/lib/_internal/js_runtime/lib/js_array.dart
@@ -22,8 +22,14 @@
   factory JSArray.fixed(int length)  {
     // Explicit type test is necessary to guard against JavaScript conversions
     // in unchecked mode.
-    if ((length is !int) || (length < 0)) {
-      throw new ArgumentError("Length must be a non-negative integer: $length");
+    if (length is !int) {
+      throw new ArgumentError.value(length, "length", "is not an integer");
+    }
+    // The JavaScript Array constructor with one argument throws if
+    // the value is not a UInt32. Give a better error message.
+    int maxJSArrayLength = 0xFFFFFFFF;
+    if (length < 0 || length > maxJSArrayLength) {
+      throw new RangeError.range(length, 0, maxJSArrayLength, "length");
     }
     return new JSArray<E>.markFixed(JS('', 'new Array(#)', length));
   }
@@ -144,7 +150,7 @@
 
   E removeLast() {
     checkGrowable('removeLast');
-    if (length == 0) throw new RangeError.value(-1);
+    if (length == 0) throw diagnoseIndexError(this, -1);
     return JS('var', r'#.pop()', this);
   }
 
@@ -208,8 +214,10 @@
   }
 
   void addAll(Iterable<E> collection) {
+    int i = this.length;
     checkGrowable('addAll');
     for (E e in collection) {
+      assert(i++ == this.length || (throw new ConcurrentModificationError(this)));
       JS('void', r'#.push(#)', this, e);
     }
   }
@@ -343,14 +351,14 @@
     checkNull(start); // TODO(ahe): This is not specified but co19 tests it.
     if (start is !int) throw argumentErrorValue(start);
     if (start < 0 || start > length) {
-      throw new RangeError.range(start, 0, length);
+      throw new RangeError.range(start, 0, length, "start");
     }
     if (end == null) {
       end = length;
     } else {
       if (end is !int) throw argumentErrorValue(end);
       if (end < start || end > length) {
-        throw new RangeError.range(end, start, length);
+        throw new RangeError.range(end, start, length, "end");
       }
     }
     if (start == end) return <E>[];
@@ -573,7 +581,7 @@
 
   int get length => JS('JSUInt32', r'#.length', this);
 
-  void set length(int newLength) {
+  set length(int newLength) {
     checkGrowable('set length');
     if (newLength is !int) {
       throw new ArgumentError.value(newLength, 'newLength');
@@ -642,7 +650,7 @@
     // inline moveNext() we might be able to GVN the length and eliminate this
     // check on known fixed length JSArray.
     if (_length != length) {
-      throw new ConcurrentModificationError(_iterable);
+      throw throwConcurrentModificationError(_iterable);
     }
 
     if (_index >= length) {
diff --git a/sdk/lib/_internal/js_runtime/lib/js_helper.dart b/sdk/lib/_internal/js_runtime/lib/js_helper.dart
index fd53e61..8b3020a 100644
--- a/sdk/lib/_internal/js_runtime/lib/js_helper.dart
+++ b/sdk/lib/_internal/js_runtime/lib/js_helper.dart
@@ -4,8 +4,6 @@
 
 library _js_helper;
 
-import 'dart:_async_await_error_codes' as async_error_codes;
-
 import 'dart:_js_embedded_names' show
     DEFERRED_LIBRARY_URIS,
     DEFERRED_LIBRARY_HASHES,
@@ -37,7 +35,8 @@
     StreamController,
     Stream,
     StreamSubscription,
-    scheduleMicrotask;
+    scheduleMicrotask,
+    Zone;
 
 import 'dart:_foreign_helper' show
     DART_CLOSURE_TO_JS,
@@ -45,19 +44,21 @@
     JS_BUILTIN,
     JS_CALL_IN_ISOLATE,
     JS_CONST,
-    JS_GET_STATIC_STATEC,
     JS_CURRENT_ISOLATE_CONTEXT,
     JS_EFFECT,
     JS_EMBEDDED_GLOBAL,
     JS_GET_FLAG,
     JS_GET_NAME,
-    JS_HAS_EQUALS,
+    JS_INTERCEPTOR_CONSTANT,
     JS_STRING_CONCAT,
     RAW_DART_FUNCTION_REF;
 
 import 'dart:_interceptors';
 import 'dart:_internal' as _symbol_dev;
-import 'dart:_internal' show EfficientLength, MappedIterable;
+import 'dart:_internal' show
+    EfficientLength,
+    MappedIterable,
+    IterableElementError;
 
 import 'dart:_native_typed_data';
 
@@ -148,7 +149,7 @@
 @ForceInline()
 bool isDartFunctionTypeRti(Object type) {
   return JS_BUILTIN('returns:bool;effects:none;depends:none',
-                    JsBuiltin.isGivenTypeRti, 
+                    JsBuiltin.isGivenTypeRti,
                     type,
                     JS_GET_NAME(JsGetName.FUNCTION_CLASS_TYPE_NAME));
 }
@@ -158,7 +159,7 @@
 @ForceInline()
 bool isDartObjectTypeRti(type) {
   return JS_BUILTIN('returns:bool;effects:none;depends:none',
-                    JsBuiltin.isGivenTypeRti, 
+                    JsBuiltin.isGivenTypeRti,
                     type,
                     JS_GET_NAME(JsGetName.OBJECT_CLASS_TYPE_NAME));
 }
@@ -168,7 +169,7 @@
 @ForceInline()
 bool isNullTypeRti(type) {
   return JS_BUILTIN('returns:bool;effects:none;depends:none',
-                    JsBuiltin.isGivenTypeRti, 
+                    JsBuiltin.isGivenTypeRti,
                     type,
                     JS_GET_NAME(JsGetName.NULL_CLASS_TYPE_NAME));
 }
@@ -257,7 +258,7 @@
 /// Helper to print the given method information to the console the first
 /// time it is called with it.
 @NoInline()
-void traceHelper(String method) {
+void consoleTraceHelper(String method) {
   if (JS('bool', '!this.cache')) {
     JS('', 'this.cache = Object.create(null)');
   }
@@ -267,6 +268,31 @@
   }
 }
 
+List _traceBuffer;
+
+/// Helper to send coverage information as a POST request to a server.
+@NoInline()
+void postTraceHelper(int id, String name) {
+  // Note: we can't move this initialization to the declaration of
+  // [_traceBuffer] because [postTraceHelper] is called very early on functions
+  // that define constants, this happens before getters and setters are expanded
+  // and before main starts executing. This initialization here allows us to
+  // skip the lazy field initialization logic.
+  if (_traceBuffer == null) _traceBuffer = JS('JSArray', '[]');
+  if (JS('bool', '#.length == 0', _traceBuffer)) {
+    JS('', r'''
+      window.setTimeout((function(buffer) {
+        return function() {
+          var xhr = new XMLHttpRequest();
+          xhr.open("POST", "/coverage_uri_to_amend_by_server");
+          xhr.send(JSON.stringify(buffer));
+          buffer.length = 0;
+        };
+      })(#), 1000)''', _traceBuffer);
+  }
+  JS('', '#.push([#, #])', _traceBuffer, id, name);
+}
+
 class JSInvocationMirror implements Invocation {
   static const METHOD = 0;
   static const GETTER = 1;
@@ -819,25 +845,76 @@
   /// Returns the type of [object] as a string (including type arguments).
   ///
   /// In minified mode, uses the unminified names if available.
+  @NoInline()
   static String objectTypeName(Object object) {
-    String name = constructorNameFallback(getInterceptor(object));
-    if (name == 'Object') {
-      // Try to decompile the constructor by turning it into a string and get
-      // the name out of that. If the decompiled name is a string containing an
-      // identifier, we use that instead of the very generic 'Object'.
-      var decompiled =
-          JS('var', r'#.match(/^\s*function\s*([\w$]*)\s*\(/)[1]',
-              JS('var', r'String(#.constructor)', object));
-      if (decompiled is String)
-        if (JS('bool', r'/^\w+$/.test(#)', decompiled))
-          name = decompiled;
+    return formatType(_objectRawTypeName(object), getRuntimeTypeInfo(object));
+  }
+
+  static String _objectRawTypeName(Object object) {
+    var interceptor = getInterceptor(object);
+    // The interceptor is either an object (self-intercepting plain Dart class),
+    // the prototype of the constructor for an Interceptor class (like
+    // `JSString.prototype`, `JSNull.prototype`), or an Interceptor object
+    // instance (`const JSString()`, should use `JSString.prototype`).
+    //
+    // These all should have a `constructor` property with a `name` property.
+    String name;
+    var interceptorConstructor = JS('', '#.constructor', interceptor);
+    if (JS('bool', 'typeof # == "function"', interceptorConstructor)) {
+      var interceptorConstructorName = JS('', '#.name', interceptorConstructor);
+      if (interceptorConstructorName is String) {
+        name = interceptorConstructorName;
+      }
     }
+
+    if (name == null ||
+        identical(interceptor, JS_INTERCEPTOR_CONSTANT(Interceptor)) ||
+        object is UnknownJavaScriptObject) {
+      // Try to do better.  If we do not find something better, leave the name
+      // as 'UnknownJavaScriptObject' or 'Interceptor' (or the minified name).
+      //
+      // When we get here via the UnknownJavaScriptObject test (for JavaScript
+      // objects from outside the program), the object's constructor has a
+      // better name that 'UnknownJavaScriptObject'.
+      //
+      // When we get here the Interceptor test (for Native classes that are
+      // declared in the Dart program but have been 'folded' into Interceptor),
+      // the native class's constructor name is better than the generic
+      // 'Interceptor' (an abstract class).
+
+      // Try the [constructorNameFallback]. This gets the constructor name for
+      // any browser (used by [getNativeInterceptor]).
+      String dispatchName = constructorNameFallback(object);
+      if (dispatchName == 'Object') {
+        // Try to decompile the constructor by turning it into a string and get
+        // the name out of that. If the decompiled name is a string containing
+        // an identifier, we use that instead of the very generic 'Object'.
+        var objectConstructor = JS('', '#.constructor', object);
+        if (JS('bool', 'typeof # == "function"', objectConstructor)) {
+          var decompiledName =
+              JS('var', r'#.match(/^\s*function\s*([\w$]*)\s*\(/)[1]',
+                  JS('var', r'String(#)', objectConstructor));
+          if (decompiledName is String &&
+              JS('bool', r'/^\w+$/.test(#)', decompiledName)) {
+            name = decompiledName;
+          }
+        }
+        if (name == null) name = dispatchName;
+      } else {
+        name = dispatchName;
+      }
+    }
+
+    // Type inference does not understand that [name] is now always a non-null
+    // String. (There is some imprecision in the negation of the disjunction.)
+    name = JS('String', '#', name);
+
     // TODO(kasperl): If the namer gave us a fresh global name, we may
     // want to remove the numeric suffix that makes it unique too.
     if (name.length > 1 && identical(name.codeUnitAt(0), DOLLAR_CHAR_VALUE)) {
       name = name.substring(1);
     }
-    return formatType(name, getRuntimeTypeInfo(object));
+    return name;
   }
 
   /// In minified mode, uses the unminified names if available.
@@ -1482,12 +1559,6 @@
     return JS('', '#.apply(#, #)', jsFunction, function, positionalArguments);
   }
 
-  static bool identicalImplementation(a, b) {
-    return JS('bool', '# == null', a)
-      ? JS('bool', '# == null', b)
-      : JS('bool', '# === #', a, b);
-  }
-
   static StackTrace extractStackTrace(Error error) {
     return getTraceFromException(JS('', r'#.$thrownJsError', error));
   }
@@ -1555,6 +1626,29 @@
   return new RangeError.value(index, 'index');
 }
 
+/**
+ * Diagnoses a range error. Returns the ArgumentError or RangeError that
+ * describes the problem.
+ */
+@NoInline()
+Error diagnoseRangeError(start, end, length) {
+  if (start is! int) {
+    return new ArgumentError.value(start, 'start');
+  }
+  if (start < 0 || start > length) {
+    return new RangeError.range(start, 0, length, 'start');
+  }
+  if (end != null) {
+    if (end is! int) {
+      return new ArgumentError.value(end, 'end');
+    }
+    if (end < start || end > length) {
+      return new RangeError.range(end, start, length, 'end');
+    }
+  }
+  // The above should always match, but if it does not, use the following.
+  return new ArgumentError.value(end, "end");
+}
 
 stringLastIndexOfUnchecked(receiver, element, start)
   => JS('int', r'#.lastIndexOf(#, #)', receiver, element, start);
@@ -2046,6 +2140,15 @@
   String toString() => _message.isEmpty ? 'Error' : 'Error: $_message';
 }
 
+/// A wrapper around an exception, much like the one created by [wrapException]
+/// but with a pre-given stack-trace.
+class ExceptionAndStackTrace {
+  dynamic dartException;
+  StackTrace stackTrace;
+
+  ExceptionAndStackTrace(this.dartException, this.stackTrace);
+}
+
 /**
  * Called from catch blocks in generated code to extract the Dart
  * exception from the thrown value. The thrown value may have been
@@ -2365,8 +2468,12 @@
                      jsArguments,
                      String propertyName) {
     JS_EFFECT(() {
-      BoundClosure.receiverOf(JS('BoundClosure', 'void 0'));
-      BoundClosure.selfOf(JS('BoundClosure', 'void 0'));
+      // The functions are called here to model the calls from JS forms below.
+      // The types in the JS forms in the arguments are propagated in type
+      // inference.
+      BoundClosure.receiverOf(JS('BoundClosure', '0'));
+      BoundClosure.selfOf(JS('BoundClosure', '0'));
+      getType(JS('int', '0'));
     });
     // TODO(ahe): All the place below using \$ should be rewritten to go
     // through the namer.
@@ -3072,8 +3179,9 @@
  */
 interceptedTypeCheck(value, property) {
   if (value == null) return value;
-  if ((identical(JS('String', 'typeof #', value), 'object'))
-      && JS('bool', '#[#]', getInterceptor(value), property)) {
+  if ((JS('bool', 'typeof # === "object"', value) ||
+              JS('bool', 'typeof # === "function"', value)) &&
+      JS('bool', '#[#]', getInterceptor(value), property)) {
     return value;
   }
   propertyTypeError(value, property);
@@ -3085,9 +3193,10 @@
  * prototype at load time.
  */
 interceptedTypeCast(value, property) {
-  if (value == null
-      || ((JS('bool', 'typeof # === "object"', value))
-          && JS('bool', '#[#]', getInterceptor(value), property))) {
+  if (value == null ||
+      ((JS('bool', 'typeof # === "object"', value) ||
+              JS('bool', 'typeof # === "function"', value)) &&
+          JS('bool', '#[#]', getInterceptor(value), property))) {
     return value;
   }
   propertyTypeCastError(value, property);
@@ -3263,18 +3372,33 @@
 
 /**
  * Helper function for implementing asserts. The compiler treats this specially.
+ *
+ * Returns the negation of the condition. That is: `true` if the assert should
+ * fail.
  */
+bool assertTest(condition) {
+  // Do bool success check first, it is common and faster than 'is Function'.
+  if (true == condition) return false;
+  if (condition is Function) condition = condition();
+  if (condition is bool) return !condition;
+  throw new TypeErrorImplementation(condition, 'bool');
+}
+
+/**
+ * Helper function for implementing asserts with messages.
+ * The compiler treats this specially.
+ */
+void assertThrow(Object message) {
+  throw new _AssertionError(message);
+}
+
+/**
+ * Helper function for implementing asserts without messages.
+ * The compiler treats this specially.
+ */
+@NoInline()
 void assertHelper(condition) {
-  // Do a bool check first because it is common and faster than 'is Function'.
-  if (condition is !bool) {
-    if (condition is Function) condition = condition();
-    if (condition is !bool) {
-      throw new TypeErrorImplementation(condition, 'bool');
-    }
-  }
-  // Compare to true to avoid boolean conversion check in checked
-  // mode.
-  if (true != condition) throw new AssertionError();
+  if (assertTest(condition)) throw new AssertionError();
 }
 
 /**
@@ -3866,6 +3990,58 @@
   return completer.future;
 }
 
+// Performs an HTTP GET of the given URI and returns the response. The response
+// is either a String or a ByteBuffer.
+Future<dynamic> readHttp(String uri) {
+  Completer completer = new Completer();
+
+  void failure([error, StackTrace stackTrace]) {
+    completer.completeError(
+        new Exception("Loading $uri failed: $error"),
+        stackTrace);
+  }
+
+  enterJsAsync();
+  completer.future.whenComplete(leaveJsAsync);
+
+  var xhr = JS('var', 'new XMLHttpRequest()');
+  JS('void', '#.open("GET", #)', xhr, uri);
+  JS('void', '#.addEventListener("load", #, false)',
+     xhr, convertDartClosureToJS((event) {
+    int status = JS('int', '#.status', xhr);
+    if (status != 200) {
+      failure("Status code: $status");
+      return;
+    }
+    String responseType = JS('String', '#.responseType', xhr);
+    var data;
+    if (responseType.isEmpty || responseType == 'text') {
+      data = JS('String', '#.response', xhr);
+      completer.complete(data);
+    } else if (responseType == 'document' || responseType == 'json') {
+      data = JS('String', '#.responseText', xhr);
+      completer.complete(data);
+    } else if (responseType == 'arraybuffer') {
+      data = JS('var', '#.response', xhr);
+      completer.complete(data);
+    } else if (responseType == 'blob') {
+      var reader = JS('var', 'new FileReader()');
+      JS('void', '#.addEventListener("loadend", #, false)',
+          reader, convertDartClosureToJS((event) {
+            data = JS('var', '#.result', reader);
+            completer.complete(data);
+          }, 1));
+    } else {
+      failure('Result had unexpected type: $responseType');
+    }
+  }, 1));
+
+  JS('void', '#.addEventListener("error", #, false)', xhr, failure);
+  JS('void', '#.addEventListener("abort", #, false)', xhr, failure);
+  JS('void', '#.send()', xhr);
+  return completer.future;
+}
+
 class MainError extends Error implements NoSuchMethodError {
   final String _message;
 
@@ -3886,385 +4062,23 @@
   throw new MainError("'main' expects too many parameters.");
 }
 
-/// A wrapper around an exception, much like the one created by [wrapException]
-/// but with a pre-given stack-trace.
-class ExceptionAndStackTrace {
-  dynamic dartException;
-  StackTrace stackTrace;
+class _AssertionError extends AssertionError {
+  final _message;
+  _AssertionError(this._message);
 
-  ExceptionAndStackTrace(this.dartException, this.stackTrace);
+  String toString() => "Assertion failed: " + Error.safeToString(_message);
 }
 
-/// Runtime support for async-await transformation.
-///
-/// This function is called by a transformed function on each await and return
-/// in the untransformed function, and before starting.
-///
-/// If [object] is not a future it will be wrapped in a `new Future.value`.
-///
-/// If [asyncBody] is [async_error_codes.SUCCESS]/[async_error_codes.ERROR] it
-/// indicates a return or throw from the async function, and
-/// complete/completeError is called on [completer] with [object].
-///
-/// Otherwise [asyncBody] is set up to be called when the future is completed
-/// with a code [async_error_codes.SUCCESS]/[async_error_codes.ERROR] depending
-/// on the success of the future.
-///
-/// Returns the future of the completer for convenience of the first call.
-dynamic asyncHelper(dynamic object,
-                    dynamic /* js function */ bodyFunctionOrErrorCode,
-                    Completer completer) {
-  if (identical(bodyFunctionOrErrorCode, async_error_codes.SUCCESS)) {
-    completer.complete(object);
-    return;
-  } else if (identical(bodyFunctionOrErrorCode, async_error_codes.ERROR)) {
-    // The error is a js-error.
-    completer.completeError(unwrapException(object),
-                            getTraceFromException(object));
-    return;
-  }
-  Future future = object is Future ? object : new Future.value(object);
-  future.then(_wrapJsFunctionForAsync(bodyFunctionOrErrorCode,
-                                      async_error_codes.SUCCESS),
-      onError: (dynamic error, StackTrace stackTrace) {
-        ExceptionAndStackTrace wrappedException =
-            new ExceptionAndStackTrace(error, stackTrace);
-        Function wrapped =_wrapJsFunctionForAsync(bodyFunctionOrErrorCode,
-            async_error_codes.ERROR);
-        wrapped(wrappedException);
-      });
-  return completer.future;
+
+// [_UnreachableError] is a separate class because we always resolve
+// [assertUnreachable] and want to reduce the impact of resolving possibly
+// unneeded code.
+class _UnreachableError extends AssertionError {
+  _UnreachableError();
+  String toString() => "Assertion failed: Reached dead code";
 }
 
-Function _wrapJsFunctionForAsync(dynamic /* js function */ function,
-                                 int errorCode) {
-  var protected = JS('', """
-    // Invokes [function] with [errorCode] and [result].
-    //
-    // If (and as long as) the invocation throws, calls [function] again,
-    // with an error-code.
-    function(errorCode, result) {
-      while (true) {
-        try {
-          #(errorCode, result);
-          break;
-        } catch (error) {
-          result = error;
-          errorCode = #;
-        }
-      }
-    }""", function, async_error_codes.ERROR);
-  return (result) {
-    JS('', '#(#, #)', protected, errorCode, result);
-  };
-}
-
-/// Implements the runtime support for async* functions.
-///
-/// Called by the transformed function for each original return, await, yield,
-/// yield* and before starting the function.
-///
-/// When the async* function wants to return it calls this function with
-/// [asyncBody] == [async_error_codes.SUCCESS], the asyncStarHelper takes this
-/// as signal to close the stream.
-///
-/// When the async* function wants to signal that an uncaught error was thrown,
-/// it calls this function with [asyncBody] == [async_error_codes.ERROR],
-/// the streamHelper takes this as signal to addError [object] to the
-/// [controller] and close it.
-///
-/// If the async* function wants to do a yield or yield*, it calls this function
-/// with [object] being an [IterationMarker].
-///
-/// In the case of a yield or yield*, if the stream subscription has been
-/// canceled, schedules [asyncBody] to be called with
-/// [async_error_codes.STREAM_WAS_CANCELED].
-///
-/// If [object] is a single-yield [IterationMarker], adds the value of the
-/// [IterationMarker] to the stream. If the stream subscription has been
-/// paused, return early. Otherwise schedule the helper function to be
-/// executed again.
-///
-/// If [object] is a yield-star [IterationMarker], starts listening to the
-/// yielded stream, and adds all events and errors to our own controller (taking
-/// care if the subscription has been paused or canceled) - when the sub-stream
-/// is done, schedules [asyncBody] again.
-///
-/// If the async* function wants to do an await it calls this function with
-/// [object] not and [IterationMarker].
-///
-/// If [object] is not a [Future], it is wrapped in a `Future.value`.
-/// The [asyncBody] is called on completion of the future (see [asyncHelper].
-void asyncStarHelper(dynamic object,
-                     dynamic /* int | js function */ bodyFunctionOrErrorCode,
-                     AsyncStarStreamController controller) {
-  if (identical(bodyFunctionOrErrorCode, async_error_codes.SUCCESS)) {
-    // This happens on return from the async* function.
-    if (controller.isCanceled) {
-      controller.cancelationCompleter.complete();
-    } else {
-      controller.close();
-    }
-    return;
-  } else if (identical(bodyFunctionOrErrorCode, async_error_codes.ERROR)) {
-    // The error is a js-error.
-    if (controller.isCanceled) {
-      controller.cancelationCompleter.completeError(
-          unwrapException(object),
-          getTraceFromException(object));
-    } else {
-      controller.addError(unwrapException(object),
-                          getTraceFromException(object));
-      controller.close();
-    }
-    return;
-  }
-
-  if (object is IterationMarker) {
-    if (controller.isCanceled) {
-      Function wrapped = _wrapJsFunctionForAsync(bodyFunctionOrErrorCode,
-          async_error_codes.STREAM_WAS_CANCELED);
-      wrapped(null);
-      return;
-    }
-    if (object.state == IterationMarker.YIELD_SINGLE) {
-      controller.add(object.value);
-
-      scheduleMicrotask(() {
-        if (controller.isPaused) {
-          // We only suspend the thread inside the microtask in order to allow
-          // listeners on the output stream to pause in response to the just
-          // output value, and have the stream immediately stop producing.
-          controller.isSuspended = true;
-          return;
-        }
-        Function wrapped = _wrapJsFunctionForAsync(bodyFunctionOrErrorCode,
-            async_error_codes.SUCCESS);
-        wrapped(null);
-      });
-      return;
-    } else if (object.state == IterationMarker.YIELD_STAR) {
-      Stream stream = object.value;
-      // Errors of [stream] are passed though to the main stream. (see
-      // [AsyncStreamController.addStream]).
-      // TODO(sigurdm): The spec is not very clear here. Clarify with Gilad.
-      controller.addStream(stream).then((_) {
-        // No check for isPaused here because the spec 17.16.2 only
-        // demands checks *before* each element in [stream] not after the last
-        // one. On the other hand we check for isCanceled, as that check happens
-        // after insertion of each element.
-        int errorCode = controller.isCanceled
-            ? async_error_codes.STREAM_WAS_CANCELED
-            : async_error_codes.SUCCESS;
-        Function wrapped = _wrapJsFunctionForAsync(bodyFunctionOrErrorCode,
-                                errorCode);
-        wrapped(null);
-      });
-      return;
-    }
-  }
-
-  Future future = object is Future ? object : new Future.value(object);
-  future.then(_wrapJsFunctionForAsync(bodyFunctionOrErrorCode,
-                                      async_error_codes.SUCCESS),
-              onError: (error, StackTrace stackTrace) {
-                ExceptionAndStackTrace wrappedException =
-                    new ExceptionAndStackTrace(error, stackTrace);
-                Function wrapped = _wrapJsFunctionForAsync(
-                    bodyFunctionOrErrorCode, async_error_codes.ERROR);
-                return wrapped(wrappedException);
-              });
-}
-
-Stream streamOfController(AsyncStarStreamController controller) {
-  return controller.stream;
-}
-
-/// A wrapper around a [StreamController] that keeps track of the state of
-/// the execution of an async* function.
-/// It can be in 1 of 3 states:
-///
-/// - running/scheduled
-/// - suspended
-/// - canceled
-///
-/// If yielding while the subscription is paused it will become suspended. And
-/// only resume after the subscription is resumed or canceled.
-class AsyncStarStreamController {
-  StreamController controller;
-  Stream get stream => controller.stream;
-
-  /// True when the async* function has yielded while being paused.
-  /// When true execution will only resume after a `onResume` or `onCancel`
-  /// event.
-  bool isSuspended = false;
-
-  bool get isPaused => controller.isPaused;
-
-  Completer cancelationCompleter = null;
-
-  /// True after the StreamSubscription has been cancelled.
-  /// When this is true, errors thrown from the async* body should go to the
-  /// [cancelationCompleter] instead of adding them to [controller], and
-  /// returning from the async function should complete [cancelationCompleter].
-  bool get isCanceled => cancelationCompleter != null;
-
-  add(event) => controller.add(event);
-
-  addStream(Stream stream) {
-    return controller.addStream(stream, cancelOnError: false);
-  }
-
-  addError(error, stackTrace) => controller.addError(error, stackTrace);
-
-  close() => controller.close();
-
-  AsyncStarStreamController(body) {
-
-    _resumeBody() {
-      scheduleMicrotask(() {
-        Function wrapped =
-            _wrapJsFunctionForAsync(body, async_error_codes.SUCCESS);
-        wrapped(null);
-      });
-    }
-
-    controller = new StreamController(
-      onListen: () {
-        _resumeBody();
-      }, onResume: () {
-        // Only schedule again if the async* function actually is suspended.
-        // Resume directly instead of scheduling, so that the sequence
-        // `pause-resume-pause` will result in one extra event produced.
-        if (isSuspended) {
-          isSuspended = false;
-          _resumeBody();
-        }
-      }, onCancel: () {
-        // If the async* is finished we ignore cancel events.
-        if (!controller.isClosed) {
-          cancelationCompleter = new Completer();
-          if (isSuspended) {
-            // Resume the suspended async* function to run finalizers.
-            isSuspended = false;
-            scheduleMicrotask(() {
-              Function wrapped =_wrapJsFunctionForAsync(body,
-                  async_error_codes.STREAM_WAS_CANCELED);
-              wrapped(null);
-            });
-          }
-          return cancelationCompleter.future;
-        }
-      });
-  }
-}
-
-makeAsyncStarController(body) {
-  return new AsyncStarStreamController(body);
-}
-
-class IterationMarker {
-  static const YIELD_SINGLE = 0;
-  static const YIELD_STAR = 1;
-  static const ITERATION_ENDED = 2;
-  static const UNCAUGHT_ERROR = 3;
-
-  final value;
-  final int state;
-
-  IterationMarker._(this.state, this.value);
-
-  static yieldStar(dynamic /* Iterable or Stream */ values) {
-    return new IterationMarker._(YIELD_STAR, values);
-  }
-
-  static endOfIteration() {
-    return new IterationMarker._(ITERATION_ENDED, null);
-  }
-
-  static yieldSingle(dynamic value) {
-    return new IterationMarker._(YIELD_SINGLE, value);
-  }
-
-  static uncaughtError(dynamic error) {
-    return new IterationMarker._(UNCAUGHT_ERROR, error);
-  }
-
-  toString() => "IterationMarker($state, $value)";
-}
-
-class SyncStarIterator implements Iterator {
-  final dynamic _body;
-
-  // If [runningNested] this is the nested iterator, otherwise it is the
-  // current value.
-  dynamic _current = null;
-  bool _runningNested = false;
-
-  get current => _runningNested ? _current.current : _current;
-
-  SyncStarIterator(this._body);
-
-  _runBody() {
-    return JS('', '''
-      // Invokes [body] with [errorCode] and [result].
-      //
-      // If (and as long as) the invocation throws, calls [function] again,
-      // with an error-code.
-      (function(body) {
-        var errorValue, errorCode = #;
-        while (true) {
-          try {
-            return body(errorCode, errorValue);
-          } catch (error) {
-            errorValue = error;
-            errorCode = #
-          }
-        }
-      })(#)''', async_error_codes.SUCCESS, async_error_codes.ERROR, _body);
-  }
-
-
-  bool moveNext() {
-    if (_runningNested) {
-      if (_current.moveNext()) {
-        return true;
-      } else {
-        _runningNested = false;
-      }
-    }
-    _current = _runBody();
-    if (_current is IterationMarker) {
-      if (_current.state == IterationMarker.ITERATION_ENDED) {
-        _current = null;
-        // Rely on [_body] to repeatedly return `ITERATION_ENDED`.
-        return false;
-      } else if (_current.state == IterationMarker.UNCAUGHT_ERROR) {
-        // Rely on [_body] to repeatedly return `UNCAUGHT_ERROR`.
-        // This is a wrapped exception, so we use JavaScript throw to throw it.
-        JS('', 'throw #', _current.value);
-      } else {
-        assert(_current.state == IterationMarker.YIELD_STAR);
-        _current = _current.value.iterator;
-        _runningNested = true;
-        return moveNext();
-      }
-    }
-    return true;
-  }
-}
-
-/// An Iterable corresponding to a sync* method.
-///
-/// Each invocation of a sync* method will return a new instance of this class.
-class SyncStarIterable extends IterableBase {
-  // This is a function that will return a helper function that does the
-  // iteration of the sync*.
-  //
-  // Each invocation should give a body with fresh state.
-  final dynamic /* js function */ _outerHelper;
-
-  SyncStarIterable(this._outerHelper);
-
-  Iterator get iterator => new SyncStarIterator(JS('', '#()', _outerHelper));
+@NoInline()
+void assertUnreachable() {
+  throw new _UnreachableError();
 }
diff --git a/sdk/lib/_internal/js_runtime/lib/js_mirrors.dart b/sdk/lib/_internal/js_runtime/lib/js_mirrors.dart
index aa836ca..fc78e72 100644
--- a/sdk/lib/_internal/js_runtime/lib/js_mirrors.dart
+++ b/sdk/lib/_internal/js_runtime/lib/js_mirrors.dart
@@ -26,13 +26,7 @@
     JS_GET_STATIC_STATE,
     JS_CURRENT_ISOLATE_CONTEXT,
     JS_EMBEDDED_GLOBAL,
-    JS_GET_NAME,
-    JS_TYPEDEF_TAG,
-    JS_FUNCTION_TYPE_RETURN_TYPE_TAG,
-    JS_FUNCTION_TYPE_VOID_RETURN_TAG,
-    JS_FUNCTION_TYPE_REQUIRED_PARAMETERS_TAG,
-    JS_FUNCTION_TYPE_OPTIONAL_PARAMETERS_TAG,
-    JS_FUNCTION_TYPE_NAMED_PARAMETERS_TAG;
+    JS_GET_NAME;
 
 
 import 'dart:_internal' as _symbol_dev;
@@ -43,7 +37,6 @@
     Closure,
     JSInvocationMirror,
     JsCache,
-    Null,
     Primitives,
     ReflectionInfo,
     RuntimeError,
diff --git a/sdk/lib/_internal/js_runtime/lib/js_rti.dart b/sdk/lib/_internal/js_runtime/lib/js_rti.dart
index e5669e2..65ae257 100644
--- a/sdk/lib/_internal/js_runtime/lib/js_rti.dart
+++ b/sdk/lib/_internal/js_runtime/lib/js_rti.dart
@@ -41,7 +41,11 @@
 
 part of _js_helper;
 
-Type createRuntimeType(String name) => new TypeImpl(name);
+Type createRuntimeType(String name) {
+  // Use a 'JS' cast to String.  Since this is registered as used by the
+  // backend, type inference assumes the worst (name is dynamic).
+  return new TypeImpl(JS('String', '#', name));
+}
 
 class TypeImpl implements Type {
   final String _typeName;
@@ -85,10 +89,14 @@
  * representation of type 4 or 5, that is, either a JavaScript array or
  * `null`.
  */
+// Don't inline.  Let the JS engine inline this.  The call expression is much
+// more compact that the inlined expansion.
+// TODO(sra): For most objects it would be better to initialize the type info as
+// a field in the constructor: http://dartbug.com/22676 .
+@NoInline()
 Object setRuntimeTypeInfo(Object target, var rti) {
   assert(rti == null || isJsArray(rti));
-  // We have to check for null because factories may return null.
-  if (target != null) JS('var', r'#.$builtinTypeInfo = #', target, rti);
+  JS('var', r'#.$builtinTypeInfo = #', target, rti);
   return target;
 }
 
@@ -229,11 +237,17 @@
   assert(arguments == null || isJsArray(arguments));
   if (isJsFunction(substitution)) {
     substitution = invoke(substitution, arguments);
-    if (substitution == null || isJsArray(substitution)) {
-      arguments = substitution;
-    } else if (isJsFunction(substitution)) {
+    if (substitution == null) return substitution;
+    if (isJsArray(substitution)) {
+      // Substitutions are generated too late to mark Array as used, so use a
+      // tautological JS 'cast' to mark Array as used. This is needed only in
+      // some tiny tests where the substition is the only thing that creates an
+      // Array.
+      return JS('JSArray', '#', substitution);
+    }
+    if (isJsFunction(substitution)) {
       // TODO(johnniwinther): Check if this is still needed.
-      arguments = invoke(substitution, arguments);
+      return invoke(substitution, arguments);
     }
   }
   return arguments;
diff --git a/sdk/lib/_internal/js_runtime/lib/math_patch.dart b/sdk/lib/_internal/js_runtime/lib/math_patch.dart
index 0a43708..34476f2 100644
--- a/sdk/lib/_internal/js_runtime/lib/math_patch.dart
+++ b/sdk/lib/_internal/js_runtime/lib/math_patch.dart
@@ -8,43 +8,43 @@
 
 @patch
 double sqrt(num x)
-  => JS('double', r'Math.sqrt(#)', checkNum(x));
+  => JS('num', r'Math.sqrt(#)', checkNum(x));
 
 @patch
 double sin(num x)
-  => JS('double', r'Math.sin(#)', checkNum(x));
+  => JS('num', r'Math.sin(#)', checkNum(x));
 
 @patch
 double cos(num x)
-  => JS('double', r'Math.cos(#)', checkNum(x));
+  => JS('num', r'Math.cos(#)', checkNum(x));
 
 @patch
 double tan(num x)
-  => JS('double', r'Math.tan(#)', checkNum(x));
+  => JS('num', r'Math.tan(#)', checkNum(x));
 
 @patch
 double acos(num x)
-  => JS('double', r'Math.acos(#)', checkNum(x));
+  => JS('num', r'Math.acos(#)', checkNum(x));
 
 @patch
 double asin(num x)
-  => JS('double', r'Math.asin(#)', checkNum(x));
+  => JS('num', r'Math.asin(#)', checkNum(x));
 
 @patch
 double atan(num x)
-  => JS('double', r'Math.atan(#)', checkNum(x));
+  => JS('num', r'Math.atan(#)', checkNum(x));
 
 @patch
 double atan2(num a, num b)
-  => JS('double', r'Math.atan2(#, #)', checkNum(a), checkNum(b));
+  => JS('num', r'Math.atan2(#, #)', checkNum(a), checkNum(b));
 
 @patch
 double exp(num x)
-  => JS('double', r'Math.exp(#)', checkNum(x));
+  => JS('num', r'Math.exp(#)', checkNum(x));
 
 @patch
 double log(num x)
-  => JS('double', r'Math.log(#)', checkNum(x));
+  => JS('num', r'Math.log(#)', checkNum(x));
 
 @patch
 num pow(num x, num exponent) {
diff --git a/sdk/lib/_internal/js_runtime/lib/native_typed_data.dart b/sdk/lib/_internal/js_runtime/lib/native_typed_data.dart
index d134c6d..c256020 100644
--- a/sdk/lib/_internal/js_runtime/lib/native_typed_data.dart
+++ b/sdk/lib/_internal/js_runtime/lib/native_typed_data.dart
@@ -12,8 +12,8 @@
 import 'dart:_internal';
 import 'dart:_interceptors' show JSIndexable, JSUInt32, JSUInt31;
 import 'dart:_js_helper' show
-    Creates, JavaScriptIndexingBehavior, JSName, Native, Null, Returns,
-    diagnoseIndexError;
+    Creates, JavaScriptIndexingBehavior, JSName, Native, Returns,
+    diagnoseIndexError, diagnoseRangeError;
 import 'dart:_foreign_helper' show JS;
 import 'dart:math' as Math;
 
@@ -148,39 +148,10 @@
 
   int get elementSizeInBytes => Float32x4List.BYTES_PER_ELEMENT;
 
-  void _invalidIndex(int index, int length) {
-    if (index < 0 || index >= length) {
-      if (length == this.length) {
-        throw new RangeError.index(index, this);
-      }
-      throw new RangeError.range(index, 0, length - 1);
-    } else {
-      throw new ArgumentError('Invalid list index $index');
-    }
-  }
-
-  void _checkIndex(int index, int length) {
-    if (JS('bool', '(# >>> 0 != #)', index, index) || index >= length) {
-      _invalidIndex(index, length);
-    }
-  }
-
-  int _checkSublistArguments(int start, int end, int length) {
-    // For `sublist` the [start] and [end] indices are allowed to be equal to
-    // [length]. However, [_checkIndex] only allows indices in the range
-    // 0 .. length - 1. We therefore increment the [length] argument by one
-    // for the [_checkIndex] checks.
-    _checkIndex(start, length + 1);
-    if (end == null) return length;
-    _checkIndex(end, length + 1);
-    if (start > end) throw new RangeError.range(start, 0, end);
-    return end;
-  }
-
   int get length => _storage.length ~/ 4;
 
   Float32x4 operator[](int index) {
-    _checkIndex(index, length);
+    _checkValidIndex(index, this, this.length);
     double _x = _storage[(index * 4) + 0];
     double _y = _storage[(index * 4) + 1];
     double _z = _storage[(index * 4) + 2];
@@ -189,7 +160,7 @@
   }
 
   void operator[]=(int index, Float32x4 value) {
-    _checkIndex(index, length);
+    _checkValidIndex(index, this, this.length);
     _storage[(index * 4) + 0] = value.x;
     _storage[(index * 4) + 1] = value.y;
     _storage[(index * 4) + 2] = value.z;
@@ -197,7 +168,7 @@
   }
 
   List<Float32x4> sublist(int start, [int end]) {
-    end = _checkSublistArguments(start, end, length);
+    end = _checkValidRange(start, end, this.length);
     return new NativeFloat32x4List._externalStorage(
         _storage.sublist(start * 4, end * 4));
   }
@@ -257,40 +228,10 @@
 
   int get elementSizeInBytes => Int32x4List.BYTES_PER_ELEMENT;
 
-  void _invalidIndex(int index, int length) {
-    if (index < 0 || index >= length) {
-      if (length == this.length) {
-        throw new RangeError.index(index, this);
-      }
-      throw new RangeError.range(index, 0, length - 1);
-    } else {
-      throw new ArgumentError('Invalid list index $index');
-    }
-  }
-
-  void _checkIndex(int index, int length) {
-    if (JS('bool', '(# >>> 0 != #)', index, index)
-        || JS('bool', '# >= #', index, length)) {
-      _invalidIndex(index, length);
-    }
-  }
-
-  int _checkSublistArguments(int start, int end, int length) {
-    // For `sublist` the [start] and [end] indices are allowed to be equal to
-    // [length]. However, [_checkIndex] only allows indices in the range
-    // 0 .. length - 1. We therefore increment the [length] argument by one
-    // for the [_checkIndex] checks.
-    _checkIndex(start, length + 1);
-    if (end == null) return length;
-    _checkIndex(end, length + 1);
-    if (start > end) throw new RangeError.range(start, 0, end);
-    return end;
-  }
-
   int get length => _storage.length ~/ 4;
 
   Int32x4 operator[](int index) {
-    _checkIndex(index, length);
+    _checkValidIndex(index, this, this.length);
     int _x = _storage[(index * 4) + 0];
     int _y = _storage[(index * 4) + 1];
     int _z = _storage[(index * 4) + 2];
@@ -299,7 +240,7 @@
   }
 
   void operator[]=(int index, Int32x4 value) {
-    _checkIndex(index, length);
+    _checkValidIndex(index, this, this.length);
     _storage[(index * 4) + 0] = value.x;
     _storage[(index * 4) + 1] = value.y;
     _storage[(index * 4) + 2] = value.z;
@@ -307,7 +248,7 @@
   }
 
   List<Int32x4> sublist(int start, [int end]) {
-    end = _checkSublistArguments(start, end, length);
+    end = _checkValidRange(start, end, this.length);
     return new NativeInt32x4List._externalStorage(
         _storage.sublist(start * 4, end * 4));
   }
@@ -366,52 +307,23 @@
 
   int get elementSizeInBytes => Float64x2List.BYTES_PER_ELEMENT;
 
-  void _invalidIndex(int index, int length) {
-    if (index < 0 || index >= length) {
-      if (length == this.length) {
-        throw new RangeError.index(index, this);
-      }
-      throw new RangeError.range(index, 0, length - 1);
-    } else {
-      throw new ArgumentError('Invalid list index $index');
-    }
-  }
-
-  void _checkIndex(int index, int length) {
-    if (JS('bool', '(# >>> 0 != #)', index, index) || index >= length) {
-      _invalidIndex(index, length);
-    }
-  }
-
-  int _checkSublistArguments(int start, int end, int length) {
-    // For `sublist` the [start] and [end] indices are allowed to be equal to
-    // [length]. However, [_checkIndex] only allows indices in the range
-    // 0 .. length - 1. We therefore increment the [length] argument by one
-    // for the [_checkIndex] checks.
-    _checkIndex(start, length + 1);
-    if (end == null) return length;
-    _checkIndex(end, length + 1);
-    if (start > end) throw new RangeError.range(start, 0, end);
-    return end;
-  }
-
   int get length => _storage.length ~/ 2;
 
   Float64x2 operator[](int index) {
-    _checkIndex(index, length);
+    _checkValidIndex(index, this, this.length);
     double _x = _storage[(index * 2) + 0];
     double _y = _storage[(index * 2) + 1];
     return new Float64x2(_x, _y);
   }
 
   void operator[]=(int index, Float64x2 value) {
-    _checkIndex(index, length);
+    _checkValidIndex(index, this, this.length);
     _storage[(index * 2) + 0] = value.x;
     _storage[(index * 2) + 1] = value.y;
   }
 
   List<Float64x2> sublist(int start, [int end]) {
-    end = _checkSublistArguments(start, end, length);
+    end = _checkValidRange(start, end, this.length);
     return new NativeFloat64x2List._externalStorage(
         _storage.sublist(start * 2, end * 2));
   }
@@ -446,37 +358,20 @@
   @JSName('BYTES_PER_ELEMENT')
   final int elementSizeInBytes;
 
-  void _checkIndex(int index, int length) {
-    if (JS('bool', '(# >>> 0) !== #', index, index) ||
-        JS('int', '#', index) >= length) {  // 'int' guaranteed by above test.
-      throw diagnoseIndexError(this, index);
-    }
-  }
-
-  void _invalidPosition(int position, int length) {
+  void _invalidPosition(int position, int length, String name) {
     if (position is !int) {
-      throw new ArgumentError.value(position, null, 'Invalid list position');
+      throw new ArgumentError.value(position, name, 'Invalid list position');
     } else {
-      throw new RangeError.range(position, 0, length);
+      throw new RangeError.range(position, 0, length, name);
     }
   }
 
-  void _checkPosition(int position, int length) {
+  void _checkPosition(int position, int length, String name) {
     if (JS('bool', '(# >>> 0) !== #', position, position) ||
         JS('int', '#', position) > length) {  // 'int' guaranteed by above test.
-      _invalidPosition(position, length);
+      _invalidPosition(position, length, name);
     }
   }
-
-  int _checkSublistArguments(int start, int end, int length) {
-    // For `sublist` the [start] and [end] indices are allowed to be equal to
-    // [length].
-    _checkPosition(start, length);
-    if (end == null) return length;
-    _checkPosition(end, length);
-    if (start > end) throw new RangeError.range(start, 0, end);
-    return end;
-  }
 }
 
 
@@ -862,8 +757,8 @@
   void _setRangeFast(int start, int end,
       NativeTypedArray source, int skipCount) {
     int targetLength = this.length;
-    _checkPosition(start, targetLength);
-    _checkPosition(end, targetLength);
+    _checkPosition(start, targetLength, "start");
+    _checkPosition(end, targetLength, "end");
     if (start > end) throw new RangeError.range(start, 0, end);
     int count = end - start;
 
@@ -888,12 +783,12 @@
         with ListMixin<double>, FixedLengthListMixin<double> {
 
   num operator[](int index) {
-    _checkIndex(index, length);
+    _checkValidIndex(index, this, this.length);
     return JS('num', '#[#]', this, index);
   }
 
   void operator[]=(int index, num value) {
-    _checkIndex(index, length);
+    _checkValidIndex(index, this, this.length);
     JS('void', '#[#] = #', this, index, value);
   }
 
@@ -916,7 +811,7 @@
   // types
 
   void operator[]=(int index, int value) {
-    _checkIndex(index, length);
+    _checkValidIndex(index, this, this.length);
     JS('void', '#[#] = #', this, index, value);
   }
 
@@ -952,7 +847,7 @@
   Type get runtimeType => Float32List;
 
   List<double> sublist(int start, [int end]) {
-    end = _checkSublistArguments(start, end, length);
+    end = _checkValidRange(start, end, this.length);
     var source = JS('NativeFloat32List', '#.subarray(#, #)', this, start, end);
     return _create1(source);
   }
@@ -989,7 +884,7 @@
   Type get runtimeType => Float64List;
 
   List<double> sublist(int start, [int end]) {
-    end = _checkSublistArguments(start, end, length);
+    end = _checkValidRange(start, end, this.length);
     var source = JS('NativeFloat64List', '#.subarray(#, #)', this, start, end);
     return _create1(source);
   }
@@ -1026,12 +921,12 @@
   Type get runtimeType => Int16List;
 
   int operator[](int index) {
-    _checkIndex(index, length);
+    _checkValidIndex(index, this, this.length);
     return JS('int', '#[#]', this, index);
   }
 
   List<int> sublist(int start, [int end]) {
-    end = _checkSublistArguments(start, end, length);
+    end = _checkValidRange(start, end, this.length);
     var source = JS('NativeInt16List', '#.subarray(#, #)', this, start, end);
     return _create1(source);
   }
@@ -1066,12 +961,12 @@
   Type get runtimeType => Int32List;
 
   int operator[](int index) {
-    _checkIndex(index, length);
+    _checkValidIndex(index, this, this.length);
     return JS('int', '#[#]', this, index);
   }
 
   List<int> sublist(int start, [int end]) {
-    end = _checkSublistArguments(start, end, length);
+    end = _checkValidRange(start, end, this.length);
     var source = JS('NativeInt32List', '#.subarray(#, #)', this, start, end);
     return _create1(source);
   }
@@ -1106,12 +1001,12 @@
   Type get runtimeType => Int8List;
 
   int operator[](int index) {
-    _checkIndex(index, length);
+    _checkValidIndex(index, this, this.length);
     return JS('int', '#[#]', this, index);
   }
 
   List<int> sublist(int start, [int end]) {
-    end = _checkSublistArguments(start, end, length);
+    end = _checkValidRange(start, end, this.length);
     var source = JS('NativeInt8List', '#.subarray(#, #)', this, start, end);
     return _create1(source);
   }
@@ -1146,12 +1041,12 @@
   Type get runtimeType => Uint16List;
 
   int operator[](int index) {
-    _checkIndex(index, length);
+    _checkValidIndex(index, this, this.length);
     return JS('JSUInt31', '#[#]', this, index);
   }
 
   List<int> sublist(int start, [int end]) {
-    end = _checkSublistArguments(start, end, length);
+    end = _checkValidRange(start, end, this.length);
     var source = JS('NativeUint16List', '#.subarray(#, #)', this, start, end);
     return _create1(source);
   }
@@ -1186,12 +1081,12 @@
   Type get runtimeType => Uint32List;
 
   int operator[](int index) {
-    _checkIndex(index, length);
+    _checkValidIndex(index, this, this.length);
     return JS('JSUInt32', '#[#]', this, index);
   }
 
   List<int> sublist(int start, [int end]) {
-    end = _checkSublistArguments(start, end, length);
+    end = _checkValidRange(start, end, this.length);
     var source = JS('NativeUint32List', '#.subarray(#, #)', this, start, end);
     return _create1(source);
   }
@@ -1230,12 +1125,12 @@
   int get length => JS('JSUInt32', '#.length', this);
 
   int operator[](int index) {
-    _checkIndex(index, length);
+    _checkValidIndex(index, this, this.length);
     return JS('JSUInt31', '#[#]', this, index);
   }
 
   List<int> sublist(int start, [int end]) {
-    end = _checkSublistArguments(start, end, length);
+    end = _checkValidRange(start, end, this.length);
     var source = JS('NativeUint8ClampedList', '#.subarray(#, #)',
         this, start, end);
     return _create1(source);
@@ -1278,12 +1173,12 @@
   int get length => JS('JSUInt32', '#.length', this);
 
   int operator[](int index) {
-    _checkIndex(index, length);
+    _checkValidIndex(index, this, this.length);
     return JS('JSUInt31', '#[#]', this, index);
   }
 
   List<int> sublist(int start, [int end]) {
-    end = _checkSublistArguments(start, end, length);
+    end = _checkValidRange(start, end, this.length);
     var source = JS('NativeUint8List', '#.subarray(#, #)', this, start, end);
     return _create1(source);
   }
@@ -2006,3 +1901,37 @@
       return new NativeFloat64x2._doubles(Math.sqrt(x), Math.sqrt(y));
   }
 }
+
+/// Checks that the value is a Uint32. If not, it's not valid as an array
+/// index or offset. Also ensures that the value is non-negative.
+bool _isInvalidArrayIndex(int index) {
+  return (JS('bool', '(# >>> 0 !== #)', index, index));
+}
+
+/// Checks that [index] is a valid index into [list] which has length [length].
+///
+/// That is, [index] is an insteger in the range `0..length - 1`.
+void _checkValidIndex(int index, List list, int length) {
+  if (_isInvalidArrayIndex(index) || JS('int', '#', index) >= length) {
+    throw diagnoseIndexError(list, index);
+  }
+}
+
+/// Checks that [start] and [end] form a range of a list of length [length].
+///
+/// That is: `start` and `end` are integers with `0 <= start <= end <= length`.
+/// If `end` is `null` in which case it is considered to be `length`
+///
+/// Returns the actual value of `end`, which is `length` if `end` is `null`, and
+/// the original value of `end` otherwise.
+int _checkValidRange(int start, int end, int length) {
+  if (_isInvalidArrayIndex(start) ||  // Ensures start is non-negative int.
+      ((end == null) ? start > length
+                     : (_isInvalidArrayIndex(end) ||
+                        start > end ||
+                        end > length))) {
+    throw diagnoseRangeError(start, end, length);
+  }
+  if (end == null) return length;
+  return end;
+}
diff --git a/sdk/lib/_internal/js_runtime/lib/string_helper.dart b/sdk/lib/_internal/js_runtime/lib/string_helper.dart
index 51b696b..9ce91f8 100644
--- a/sdk/lib/_internal/js_runtime/lib/string_helper.dart
+++ b/sdk/lib/_internal/js_runtime/lib/string_helper.dart
@@ -49,29 +49,58 @@
   final String pattern;
 }
 
-List<Match> allMatchesInStringUnchecked(String pattern, String string,
-                                        int startIndex) {
-  // Copied from StringBase.allMatches in
-  // /runtime/lib/string_base.dart
-  List<Match> result = new List<Match>();
-  int length = string.length;
-  int patternLength = pattern.length;
-  while (true) {
-    int position = stringIndexOfStringUnchecked(string, pattern, startIndex);
-    if (position == -1) {
-      break;
+Iterable<Match> allMatchesInStringUnchecked(String pattern, String string,
+                                            int startIndex) {
+  return new _StringAllMatchesIterable(string, pattern, startIndex);
+}
+
+class _StringAllMatchesIterable extends Iterable<Match> {
+  final String _input;
+  final String _pattern;
+  final int _index;
+
+  _StringAllMatchesIterable(this._input, this._pattern, this._index);
+
+  Iterator<Match> get iterator =>
+      new _StringAllMatchesIterator(_input, _pattern, _index);
+
+  Match get first {
+    int index = stringIndexOfStringUnchecked(_input, _pattern, _index);
+    if (index >= 0) {
+      return new StringMatch(index, _input, _pattern);
     }
-    result.add(new StringMatch(position, string, pattern));
-    int endIndex = position + patternLength;
-    if (endIndex == length) {
-      break;
-    } else if (position == endIndex) {
-      ++startIndex;  // empty match, advance and restart
-    } else {
-      startIndex = endIndex;
-    }
+    throw IterableElementError.noElement();
   }
-  return result;
+}
+
+class _StringAllMatchesIterator implements Iterator<Match> {
+  final String _input;
+  final String _pattern;
+  int _index;
+  Match _current;
+
+  _StringAllMatchesIterator(this._input, this._pattern, this._index);
+
+  bool moveNext() {
+    if (_index + _pattern.length > _input.length) {
+      _current = null;
+      return false;
+    }
+    var index = stringIndexOfStringUnchecked(_input, _pattern, _index);
+    if (index < 0) {
+      _index = _input.length + 1;
+      _current = null;
+      return false;
+    }
+    int end = index + _pattern.length;
+    _current = new StringMatch(index, _input, _pattern);
+    // Empty match, don't start at same location again.
+    if (end == _index) end++;
+    _index = end;
+    return true;
+  }
+
+  Match get current => _current;
 }
 
 stringContainsUnchecked(receiver, other, startIndex) {
diff --git a/sdk/lib/_internal/js_runtime/lib/typed_data_patch.dart b/sdk/lib/_internal/js_runtime/lib/typed_data_patch.dart
index e9af062..6041760 100644
--- a/sdk/lib/_internal/js_runtime/lib/typed_data_patch.dart
+++ b/sdk/lib/_internal/js_runtime/lib/typed_data_patch.dart
@@ -9,7 +9,7 @@
 import 'dart:_internal';
 import 'dart:_interceptors' show JSIndexable, JSUInt32, JSUInt31;
 import 'dart:_js_helper'
-    show Creates, JavaScriptIndexingBehavior, JSName, Null, Returns, patch;
+    show Creates, JavaScriptIndexingBehavior, JSName, Returns, patch;
 import 'dart:_native_typed_data';
 
 @patch class ByteData {
diff --git a/sdk/lib/_internal/js_runtime/pubspec.yaml b/sdk/lib/_internal/js_runtime/pubspec.yaml
index 058f035..c8fa809 100644
--- a/sdk/lib/_internal/js_runtime/pubspec.yaml
+++ b/sdk/lib/_internal/js_runtime/pubspec.yaml
@@ -1,4 +1,4 @@
 # Note: This package is not meant to be uploaded to pub. This file is used to
-# make it easer to develop on dart2js.
+# make it easier to develop on dart2js.
 name: js_runtime
 # version: do-not-upload
diff --git a/sdk/lib/_internal/sdk_library_metadata/lib/libraries.dart b/sdk/lib/_internal/sdk_library_metadata/lib/libraries.dart
index 1a2e3eb..e304873 100644
--- a/sdk/lib/_internal/sdk_library_metadata/lib/libraries.dart
+++ b/sdk/lib/_internal/sdk_library_metadata/lib/libraries.dart
@@ -14,60 +14,80 @@
  */
 const int VM_PLATFORM = 2;
 
-/**
- * Mapping of "dart:" library name (e.g. "core") to information about that library.
- * This information is structured such that Dart Editor can parse this file
- * and extract the necessary information without executing it
- * while other tools can access via execution.
- */
-const Map<String, LibraryInfo> LIBRARIES = const {
+/// The contexts that a library can be used from.
+enum Category {
+  /// Indicates that a library can be used in a browser context.
+  client,
+  /// Indicates that a library can be used in a command line context.
+  server,
+  /// Indicates that a library can be used from embedded devices.
+  embedded
+}
+
+Category parseCategory(String name) {
+  switch (name) {
+    case "Client": return Category.client;
+    case "Server": return Category.server;
+    case "Embedded": return Category.embedded;
+  }
+  return null;
+}
+
+/// Mapping of "dart:" library name (e.g. "core") to information about that
+/// library.
+const Map<String, LibraryInfo> libraries = const {
 
   "async": const LibraryInfo(
       "async/async.dart",
+      categories: "Client,Server",
       maturity: Maturity.STABLE,
       dart2jsPatchPath: "_internal/js_runtime/lib/async_patch.dart"),
 
   "_blink": const LibraryInfo(
       "_blink/dartium/_blink_dartium.dart",
-      category: "Client",
+      categories: "Client",
       implementation: true,
       documented: false,
       platforms: VM_PLATFORM),
 
   "_chrome": const LibraryInfo(
       "_chrome/dart2js/chrome_dart2js.dart",
-      documented: false,
-      category: "Client"),
+      categories: "Client",
+      documented: false),
 
   "collection": const LibraryInfo(
       "collection/collection.dart",
+      categories: "Client,Server,Embedded",
       maturity: Maturity.STABLE,
       dart2jsPatchPath: "_internal/js_runtime/lib/collection_patch.dart"),
 
   "convert": const LibraryInfo(
       "convert/convert.dart",
+      categories: "Client,Server",
       maturity: Maturity.STABLE,
       dart2jsPatchPath: "_internal/js_runtime/lib/convert_patch.dart"),
 
   "core": const LibraryInfo(
       "core/core.dart",
+      categories: "Client,Server,Embedded",
       maturity: Maturity.STABLE,
       dart2jsPatchPath: "_internal/js_runtime/lib/core_patch.dart"),
 
   "developer": const LibraryInfo(
       "developer/developer.dart",
+      categories: "Client,Server,Embedded",
       maturity: Maturity.UNSTABLE,
       dart2jsPatchPath: "_internal/js_runtime/lib/developer_patch.dart"),
 
   "html": const LibraryInfo(
       "html/dartium/html_dartium.dart",
-      category: "Client",
+      categories: "Client",
       maturity: Maturity.WEB_STABLE,
       dart2jsPath: "html/dart2js/html_dart2js.dart"),
 
   "html_common": const LibraryInfo(
       "html/html_common/html_common.dart",
-      category: "Client",
+      categories: "Client",
       maturity: Maturity.WEB_STABLE,
       dart2jsPath: "html/html_common/html_common_dart2js.dart",
       documented: false,
@@ -75,130 +95,129 @@
 
   "indexed_db": const LibraryInfo(
       "indexed_db/dartium/indexed_db_dartium.dart",
-      category: "Client",
+      categories: "Client",
       maturity: Maturity.WEB_STABLE,
       dart2jsPath: "indexed_db/dart2js/indexed_db_dart2js.dart"),
 
   "io": const LibraryInfo(
       "io/io.dart",
-      category: "Server",
-      maturity: Maturity.STABLE,
+      categories: "Server",
       dart2jsPatchPath: "_internal/js_runtime/lib/io_patch.dart"),
 
   "isolate": const LibraryInfo(
       "isolate/isolate.dart",
+      categories: "Client,Server",
       maturity: Maturity.STABLE,
       dart2jsPatchPath: "_internal/js_runtime/lib/isolate_patch.dart"),
 
   "js": const LibraryInfo(
       "js/dartium/js_dartium.dart",
-      category: "Client",
+      categories: "Client",
       maturity: Maturity.STABLE,
       dart2jsPath: "js/dart2js/js_dart2js.dart"),
 
   "math": const LibraryInfo(
       "math/math.dart",
+      categories: "Client,Server,Embedded",
       maturity: Maturity.STABLE,
       dart2jsPatchPath: "_internal/js_runtime/lib/math_patch.dart"),
 
   "mirrors": const LibraryInfo(
       "mirrors/mirrors.dart",
+      categories: "Client,Server",
       maturity: Maturity.UNSTABLE,
       dart2jsPatchPath: "_internal/js_runtime/lib/mirrors_patch.dart"),
 
-  "profiler": const LibraryInfo(
-      "profiler/profiler.dart",
-      maturity: Maturity.UNSTABLE),
-
   "nativewrappers": const LibraryInfo(
       "html/dartium/nativewrappers.dart",
-      category: "Client",
+      categories: "Client",
       implementation: true,
       documented: false,
       platforms: VM_PLATFORM),
 
   "typed_data": const LibraryInfo(
       "typed_data/typed_data.dart",
+      categories: "Client,Server,Embedded",
       maturity: Maturity.STABLE,
       dart2jsPatchPath: "_internal/js_runtime/lib/typed_data_patch.dart"),
 
   "_native_typed_data": const LibraryInfo(
       "_internal/js_runtime/lib/native_typed_data.dart",
-      category: "Internal",
+      categories: "",
       implementation: true,
       documented: false,
       platforms: DART2JS_PLATFORM),
 
   "svg": const LibraryInfo(
       "svg/dartium/svg_dartium.dart",
-      category: "Client",
+      categories: "Client",
       maturity: Maturity.WEB_STABLE,
       dart2jsPath: "svg/dart2js/svg_dart2js.dart"),
 
   "web_audio": const LibraryInfo(
       "web_audio/dartium/web_audio_dartium.dart",
-      category: "Client",
+      categories: "Client",
       maturity: Maturity.WEB_STABLE,
       dart2jsPath: "web_audio/dart2js/web_audio_dart2js.dart"),
 
   "web_gl": const LibraryInfo(
       "web_gl/dartium/web_gl_dartium.dart",
-      category: "Client",
+      categories: "Client",
       maturity: Maturity.WEB_STABLE,
       dart2jsPath: "web_gl/dart2js/web_gl_dart2js.dart"),
 
   "web_sql": const LibraryInfo(
       "web_sql/dartium/web_sql_dartium.dart",
-      category: "Client",
+      categories: "Client",
       maturity: Maturity.WEB_STABLE,
       dart2jsPath: "web_sql/dart2js/web_sql_dart2js.dart"),
 
   "_internal": const LibraryInfo(
       "internal/internal.dart",
-      category: "Internal",
+      categories: "",
       documented: false,
       dart2jsPatchPath:
           "_internal/js_runtime/lib/internal_patch.dart"),
 
   "_js_helper": const LibraryInfo(
       "_internal/js_runtime/lib/js_helper.dart",
-      category: "Internal",
+      categories: "",
       documented: false,
       platforms: DART2JS_PLATFORM),
 
   "_interceptors": const LibraryInfo(
       "_internal/js_runtime/lib/interceptors.dart",
-      category: "Internal",
+      categories: "",
       documented: false,
       platforms: DART2JS_PLATFORM),
 
   "_foreign_helper": const LibraryInfo(
       "_internal/js_runtime/lib/foreign_helper.dart",
-      category: "Internal",
+      categories: "",
       documented: false,
       platforms: DART2JS_PLATFORM),
 
   "_isolate_helper": const LibraryInfo(
       "_internal/js_runtime/lib/isolate_helper.dart",
-      category: "Internal",
+      categories: "",
       documented: false,
       platforms: DART2JS_PLATFORM),
 
   "_js_mirrors": const LibraryInfo(
       "_internal/js_runtime/lib/js_mirrors.dart",
-      category: "Internal",
+      categories: "",
       documented: false,
       platforms: DART2JS_PLATFORM),
 
   "_js_names": const LibraryInfo(
       "_internal/js_runtime/lib/js_names.dart",
-      category: "Internal",
+      categories: "",
       documented: false,
       platforms: DART2JS_PLATFORM),
 
   "_js_primitives": const LibraryInfo(
       "_internal/js_runtime/lib/js_primitives.dart",
-      category: "Internal",
+      categories: "",
       documented: false,
       platforms: DART2JS_PLATFORM),
 
@@ -206,25 +225,25 @@
   // different platform.
   "_mirror_helper": const LibraryInfo(
       "_internal/js_runtime/lib/mirror_helper.dart",
-      category: "Internal",
+      categories: "",
       documented: false,
       platforms: DART2JS_PLATFORM),
 
   "_js_embedded_names": const LibraryInfo(
       "_internal/js_runtime/lib/shared/embedded_names.dart",
-      category: "Internal",
+      categories: "",
       documented: false,
       platforms: DART2JS_PLATFORM),
 
   "_async_await_error_codes": const LibraryInfo(
       "_internal/js_runtime/lib/shared/async_await_error_codes.dart",
-      category: "Internal",
+      categories: "",
       documented: false,
       platforms: DART2JS_PLATFORM),
 
   "_metadata": const LibraryInfo(
       "html/html_common/metadata.dart",
-      category: "Internal",
+      categories: "",
       documented: false,
       platforms: DART2JS_PLATFORM),
 };
@@ -240,11 +259,10 @@
   final String path;
 
   /**
-   * The category in which the library should appear in the editor
-   * (e.g. "Shared", "Client", "Server", ...).
-   * If a category is not specified it defaults to "Shared".
+   * The categories in which the library can be used encoded as a
+   * comma-separated String.
    */
-  final String category;
+  final String _categories;
 
   /**
    * Path to the dart2js library's *.dart file relative to this file
@@ -286,16 +304,38 @@
   final Maturity maturity;
 
   const LibraryInfo(this.path, {
-                    this.category: "Shared",
+                    String categories: "",
                     this.dart2jsPath,
                     this.dart2jsPatchPath,
                     this.implementation: false,
                     this.documented: true,
                     this.maturity: Maturity.UNSPECIFIED,
-                    this.platforms: DART2JS_PLATFORM | VM_PLATFORM});
+                    this.platforms: DART2JS_PLATFORM | VM_PLATFORM})
+      : _categories = categories;
 
   bool get isDart2jsLibrary => (platforms & DART2JS_PLATFORM) != 0;
   bool get isVmLibrary => (platforms & VM_PLATFORM) != 0;
+
+  /**
+   * The categories in which the library can be used.
+   *
+   * If no categories are specified, the library is internal and can not be
+   * loaded by user code.
+   */
+  List<Category> get categories {
+    // `"".split(,)` returns [""] not [], so we handle that case separately.
+    if (_categories == "") return const <Category>[];
+    return _categories.split(",").map(parseCategory).toList();
+  }
+
+  bool get isInternal => categories.isEmpty;
+
+  /// The original "categories" String that was passed to the constructor.
+  ///
+  /// Can be used to construct a slightly modified copy of this LibraryInfo.
+  String get categoriesString {
+    return _categories;
+  }
 }
 
 
diff --git a/sdk/lib/async/async.dart b/sdk/lib/async/async.dart
index b244191..ac205be 100644
--- a/sdk/lib/async/async.dart
+++ b/sdk/lib/async/async.dart
@@ -91,7 +91,7 @@
 library dart.async;
 
 import "dart:collection";
-import "dart:_internal" show deprecated, printToZone, printToConsole,
+import "dart:_internal" show printToZone, printToConsole,
                              IterableElementError;
 
 part 'async_error.dart';
diff --git a/sdk/lib/async/broadcast_stream_controller.dart b/sdk/lib/async/broadcast_stream_controller.dart
index e5a1efc..6f4ddab 100644
--- a/sdk/lib/async/broadcast_stream_controller.dart
+++ b/sdk/lib/async/broadcast_stream_controller.dart
@@ -79,8 +79,8 @@
   static const int _STATE_CLOSED = 4;
   static const int _STATE_ADDSTREAM = 8;
 
-  _NotificationHandler _onListen;
-  _NotificationHandler _onCancel;
+  ControllerCallback onListen;
+  ControllerCancelCallback onCancel;
 
   // State of the controller.
   int _state;
@@ -107,25 +107,31 @@
    */
   _Future _doneFuture;
 
-  _BroadcastStreamController(this._onListen, this._onCancel)
+  _BroadcastStreamController(this.onListen, this.onCancel)
       : _state = _STATE_INITIAL {
     _next = _previous = this;
   }
 
-  void set onListen(void onListenHandler()) { _onListen = onListenHandler; }
+  ControllerCallback get onPause {
+    throw new UnsupportedError(
+        "Broadcast stream controllers do not support pause callbacks");
+  }
 
   void set onPause(void onPauseHandler()) {
     throw new UnsupportedError(
         "Broadcast stream controllers do not support pause callbacks");
   }
 
+  ControllerCallback get onResume {
+    throw new UnsupportedError(
+        "Broadcast stream controllers do not support pause callbacks");
+  }
+
   void set onResume(void onResumeHandler())  {
     throw new UnsupportedError(
         "Broadcast stream controllers do not support pause callbacks");
   }
 
-  void set onCancel(onCancelHandler()) { _onCancel = onCancelHandler; }
-
   // StreamController interface.
 
   Stream<T> get stream => new _BroadcastStream<T>(this);
@@ -209,7 +215,7 @@
     _addListener(subscription);
     if (identical(_next, _previous)) {
       // Only one listener, so it must be the first listener.
-      _runGuarded(_onListen);
+      _runGuarded(onListen);
     }
     return subscription;
   }
@@ -310,7 +316,7 @@
 
     // Get event id of this event.
     int id = (_state & _STATE_EVENT_ID);
-    // Start firing (set the _STATE_FIRING bit). We don't do [_onCancel]
+    // Start firing (set the _STATE_FIRING bit). We don't do [onCancel]
     // callbacks while firing, and we prevent reentrancy of this function.
     //
     // Set [_state]'s event id to the next event's id.
@@ -346,7 +352,7 @@
       // When closed, _doneFuture is not null.
       _doneFuture._asyncComplete(null);
     }
-    _runGuarded(_onCancel);
+    _runGuarded(onCancel);
   }
 }
 
diff --git a/sdk/lib/async/future.dart b/sdk/lib/async/future.dart
index 5d6a650..30016f7 100644
--- a/sdk/lib/async/future.dart
+++ b/sdk/lib/async/future.dart
@@ -221,7 +221,7 @@
    * See also [Completer] for a way to create and complete a future at a
    * later time that isn't necessarily after a known fixed duration.
    */
-  factory Future.delayed(Duration duration, [T computation()]) {
+  factory Future.delayed(Duration duration, [computation()]) {
     _Future result = new _Future<T>();
     new Timer(duration, () {
       try {
diff --git a/sdk/lib/async/future_impl.dart b/sdk/lib/async/future_impl.dart
index 980f0ca..35dfd119 100644
--- a/sdk/lib/async/future_impl.dart
+++ b/sdk/lib/async/future_impl.dart
@@ -175,6 +175,7 @@
    */
   var _resultOrListeners;
 
+  // This constructor is used by async/await.
   _Future();
 
   /// Valid types for value: `T` or `Future<T>`.
@@ -203,13 +204,19 @@
   }
 
   Future then(f(T value), { Function onError }) {
-    _Future result = new _Future();
-    if (!identical(result._zone, _ROOT_ZONE)) {
-      f = result._zone.registerUnaryCallback(f);
+    Zone currentZone = Zone.current;
+    if (!identical(currentZone, _ROOT_ZONE)) {
+      f = currentZone.registerUnaryCallback(f);
       if (onError != null) {
-        onError = _registerErrorHandler(onError, result._zone);
+        onError = _registerErrorHandler(onError, currentZone);
       }
     }
+    return _thenNoZoneRegistration(f, onError);
+  }
+
+  // This method is used by async/await.
+  Future _thenNoZoneRegistration(f(T value), Function onError) {
+    _Future result = new _Future();
     _addListener(new _FutureListener.then(result, f, onError));
     return result;
   }
@@ -250,6 +257,7 @@
     return _resultOrListeners;
   }
 
+  // This method is used by async/await.
   void _setValue(T value) {
     assert(!_isComplete);  // But may have a completion pending.
     _state = _VALUE;
diff --git a/sdk/lib/async/stream.dart b/sdk/lib/async/stream.dart
index 7c9ee75..232d8db 100644
--- a/sdk/lib/async/stream.dart
+++ b/sdk/lib/async/stream.dart
@@ -1622,9 +1622,9 @@
    *                 onDone: controller.close,
    *                 cancelOnError: cancelOnError);
    *             },
-   *             onPause: subscription.pause,
-   *             onResume: subscription.resume,
-   *             onCancel: subscription.cancel,
+   *             onPause: () => subscription.pause(),
+   *             onResume: () => subscription.resume(),
+   *             onCancel: () => subscription.cancel(),
    *             sync: true);
    *           return controller.stream.listen(null);
    *         });
diff --git a/sdk/lib/async/stream_controller.dart b/sdk/lib/async/stream_controller.dart
index f856b61..c8a2465 100644
--- a/sdk/lib/async/stream_controller.dart
+++ b/sdk/lib/async/stream_controller.dart
@@ -9,6 +9,18 @@
 // -------------------------------------------------------------------
 
 /**
+ * Type of a stream controller's `onListen`, `onPause` and `onResume` callbacks.
+ */
+typedef void ControllerCallback();
+
+/**
+ * Type of stream controller `onCancel` callbacks.
+ *
+ * The callback may return either `void` or a future.
+ */
+typedef ControllerCancelCallback();
+
+/**
  * A controller with the stream it controls.
  *
  * This controller allows sending data, error and done events on
@@ -133,39 +145,43 @@
   }
 
   /**
-   * Sets the callback which is called when the stream is listened to.
+   * The callback which is called when the stream is listened to.
    *
-   * This overrides the previous callback, or clears it if the [onListenHandler]
-   * is `null`.
+   * May be set to `null`, in which case no callback will happen.
    */
+  ControllerCallback get onListen;
+
   void set onListen(void onListenHandler());
 
   /**
-   * Sets the callback which is called when the stream is paused.
+   * The callback which is called when the stream is paused.
    *
-   * This overrides the previous callback, or clears it if the [onPauseHandler]
-   * is `null`.
+   * May be set to `null`, in which case no callback will happen.
    *
    * Pause related callbacks are not supported on broadcast stream controllers.
    */
+  ControllerCallback get onPause;
+
   void set onPause(void onPauseHandler());
 
   /**
-   * Sets the callback which is called when the stream is resumed.
+   * The callback which is called when the stream is resumed.
    *
-   * This overrides the previous callback, or clears it if the [onResumeHandler]
-   * is `null`.
+   * May be set to `null`, in which case no callback will happen.
    *
    * Pause related callbacks are not supported on broadcast stream controllers.
    */
+  ControllerCallback get onResume;
+
   void set onResume(void onResumeHandler());
 
   /**
-   * Sets the callback which is called when the stream is canceled.
+   * The callback which is called when the stream is canceled.
    *
-   * This overrides the previous callback, or clears it if the [onCancelHandler]
-   * is `null`.
+   * May be set to `null`, in which case no callback will happen.
    */
+  ControllerCancelCallback get onCancel;
+
   void set onCancel(onCancelHandler());
 
   /**
@@ -413,23 +429,15 @@
   // accessed earlier, or if close is called before subscribing.
   _Future _doneFuture;
 
-  _NotificationHandler _onListen;
-  _NotificationHandler _onPause;
-  _NotificationHandler _onResume;
-  _NotificationHandler _onCancel;
+  ControllerCallback onListen;
+  ControllerCallback onPause;
+  ControllerCallback onResume;
+  ControllerCancelCallback onCancel;
 
-  _StreamController(void this._onListen(),
-                    void this._onPause(),
-                    void this._onResume(),
-                    this._onCancel());
-
-  void set onListen(void onListenHandler()) { _onListen = onListenHandler; }
-
-  void set onPause(void onPauseHandler()) { _onPause = onPauseHandler; }
-
-  void set onResume(void onResumeHandler()) { _onResume = onResumeHandler; }
-
-  void set onCancel(onCancelHandler()) { _onCancel = onCancelHandler; }
+  _StreamController(this.onListen,
+                    this.onPause,
+                    this.onResume,
+                    this.onCancel);
 
   // Return a new stream every time. The streams are equal, but not identical.
   Stream<T> get stream => new _ControllerStream<T>(this);
@@ -653,7 +661,7 @@
     }
     subscription._setPendingEvents(pendingEvents);
     subscription._guardCallback(() {
-      _runGuarded(_onListen);
+      _runGuarded(onListen);
     });
 
     return subscription;
@@ -661,8 +669,8 @@
 
   Future _recordCancel(StreamSubscription<T> subscription) {
     // When we cancel, we first cancel any stream being added,
-    // Then we call _onCancel, and finally the _doneFuture is completed.
-    // If either of addStream's cancel or _onCancel returns a future,
+    // Then we call `onCancel`, and finally the _doneFuture is completed.
+    // If either of addStream's cancel or `onCancel` returns a future,
     // we wait for it before continuing.
     // Any error during this process ends up in the returned future.
     // If more errors happen, we act as if it happens inside nested try/finallys
@@ -677,12 +685,12 @@
     _state =
         (_state & ~(_STATE_SUBSCRIBED | _STATE_ADDSTREAM)) | _STATE_CANCELED;
 
-    if (_onCancel != null) {
+    if (onCancel != null) {
       if (result == null) {
         // Only introduce a future if one is needed.
         // If _onCancel returns null, no future is needed.
         try {
-          result = _onCancel();
+          result = onCancel();
         } catch (e, s) {
           // Return the error in the returned future.
           // Complete it asynchronously, so there is time for a listener
@@ -691,7 +699,7 @@
         }
       } else {
         // Simpler case when we already know that we will return a future.
-        result = result.whenComplete(_onCancel);
+        result = result.whenComplete(onCancel);
       }
     }
 
@@ -715,7 +723,7 @@
       _StreamControllerAddStreamState addState = _varData;
       addState.pause();
     }
-    _runGuarded(_onPause);
+    _runGuarded(onPause);
   }
 
   void _recordResume(StreamSubscription<T> subscription) {
@@ -723,7 +731,7 @@
       _StreamControllerAddStreamState addState = _varData;
       addState.resume();
     }
-    _runGuarded(_onResume);
+    _runGuarded(onResume);
   }
 }
 
diff --git a/sdk/lib/async/stream_impl.dart b/sdk/lib/async/stream_impl.dart
index c23b0f0..51f8b14 100644
--- a/sdk/lib/async/stream_impl.dart
+++ b/sdk/lib/async/stream_impl.dart
@@ -203,7 +203,7 @@
   }
 
   Future asFuture([var futureValue]) {
-    _Future<T> result = new _Future<T>();
+    _Future result = new _Future();
 
     // Overwrite the onDone and onError handlers.
     _onDone = () { result._complete(futureValue); };
@@ -839,7 +839,8 @@
   void _onCancel() {
     bool shutdown = (_controller == null) || _controller.isClosed;
     if (_onCancelHandler != null) {
-      _zone.runUnary(_onCancelHandler, new _BroadcastSubscriptionWrapper(this));
+      _zone.runUnary(
+          _onCancelHandler, new _BroadcastSubscriptionWrapper<T>(this));
     }
     if (shutdown) {
       if (_subscription != null) {
@@ -851,7 +852,8 @@
 
   void _onListen() {
     if (_onListenHandler != null) {
-      _zone.runUnary(_onListenHandler, new _BroadcastSubscriptionWrapper(this));
+      _zone.runUnary(
+          _onListenHandler, new _BroadcastSubscriptionWrapper<T>(this));
     }
   }
 
diff --git a/sdk/lib/async/stream_pipe.dart b/sdk/lib/async/stream_pipe.dart
index a2fc15d..b3c3aaf 100644
--- a/sdk/lib/async/stream_pipe.dart
+++ b/sdk/lib/async/stream_pipe.dart
@@ -161,7 +161,7 @@
     if (_subscription != null) {
       StreamSubscription subscription = _subscription;
       _subscription = null;
-      subscription.cancel();
+      return subscription.cancel();
     }
     return null;
   }
diff --git a/sdk/lib/async/stream_transformers.dart b/sdk/lib/async/stream_transformers.dart
index 0ed4117..ea4aaf7 100644
--- a/sdk/lib/async/stream_transformers.dart
+++ b/sdk/lib/async/stream_transformers.dart
@@ -250,7 +250,7 @@
   /** Default error handler forwards all errors. */
   static void _defaultHandleError(error, StackTrace stackTrace,
                                   EventSink sink) {
-    sink.addError(error);
+    sink.addError(error, stackTrace);
   }
 
   /** Default done handler forwards done. */
diff --git a/sdk/lib/async/zone.dart b/sdk/lib/async/zone.dart
index fba3dc9..2520f4d 100644
--- a/sdk/lib/async/zone.dart
+++ b/sdk/lib/async/zone.dart
@@ -203,20 +203,19 @@
     this.fork: null
   });
 
-  // TODO(13406): Enable types when dart2js supports it.
-  final /*HandleUncaughtErrorHandler*/ handleUncaughtError;
-  final /*RunHandler*/ run;
-  final /*RunUnaryHandler*/ runUnary;
-  final /*RunBinaryHandler*/ runBinary;
-  final /*RegisterCallbackHandler*/ registerCallback;
-  final /*RegisterUnaryCallbackHandler*/ registerUnaryCallback;
-  final /*RegisterBinaryCallbackHandler*/ registerBinaryCallback;
-  final /*ErrorCallbackHandler*/ errorCallback;
-  final /*ScheduleMicrotaskHandler*/ scheduleMicrotask;
-  final /*CreateTimerHandler*/ createTimer;
-  final /*CreatePeriodicTimerHandler*/ createPeriodicTimer;
-  final /*PrintHandler*/ print;
-  final /*ForkHandler*/ fork;
+  final HandleUncaughtErrorHandler handleUncaughtError;
+  final RunHandler run;
+  final RunUnaryHandler runUnary;
+  final RunBinaryHandler runBinary;
+  final RegisterCallbackHandler registerCallback;
+  final RegisterUnaryCallbackHandler registerUnaryCallback;
+  final RegisterBinaryCallbackHandler registerBinaryCallback;
+  final ErrorCallbackHandler errorCallback;
+  final ScheduleMicrotaskHandler scheduleMicrotask;
+  final CreateTimerHandler createTimer;
+  final CreatePeriodicTimerHandler createPeriodicTimer;
+  final PrintHandler print;
+  final ForkHandler fork;
 }
 
 /**
@@ -892,10 +891,14 @@
 void _rootHandleUncaughtError(
     Zone self, ZoneDelegate parent, Zone zone, error, StackTrace stackTrace) {
   _schedulePriorityAsyncCallback(() {
-    throw new _UncaughtAsyncError(error, stackTrace);
+    if (error == null) error = new NullThrownError();
+    if (stackTrace == null) throw error;
+    _rethrow(error, stackTrace);
   });
 }
 
+external void _rethrow(Object error, StackTrace stackTrace);
+
 dynamic _rootRun(Zone self, ZoneDelegate parent, Zone zone, f()) {
   if (Zone._current == zone) return f();
 
@@ -1010,26 +1013,6 @@
   return new _CustomZone(zone, specification, valueMap);
 }
 
-class _RootZoneSpecification implements ZoneSpecification {
-  HandleUncaughtErrorHandler get handleUncaughtError =>
-      _rootHandleUncaughtError;
-  RunHandler get run => _rootRun;
-  RunUnaryHandler get runUnary => _rootRunUnary;
-  RunBinaryHandler get runBinary => _rootRunBinary;
-  RegisterCallbackHandler get registerCallback => _rootRegisterCallback;
-  RegisterUnaryCallbackHandler get registerUnaryCallback =>
-      _rootRegisterUnaryCallback;
-  RegisterBinaryCallbackHandler get registerBinaryCallback =>
-      _rootRegisterBinaryCallback;
-  ErrorCallbackHandler get errorCallback => _rootErrorCallback;
-  ScheduleMicrotaskHandler get scheduleMicrotask => _rootScheduleMicrotask;
-  CreateTimerHandler get createTimer => _rootCreateTimer;
-  CreatePeriodicTimerHandler get createPeriodicTimer =>
-      _rootCreatePeriodicTimer;
-  PrintHandler get print => _rootPrint;
-  ForkHandler get fork => _rootFork;
-}
-
 class _RootZone extends _Zone {
   const _RootZone();
 
diff --git a/sdk/lib/collection/hash_map.dart b/sdk/lib/collection/hash_map.dart
index 6fb73a5..5a22dc0 100644
--- a/sdk/lib/collection/hash_map.dart
+++ b/sdk/lib/collection/hash_map.dart
@@ -27,7 +27,7 @@
  *
  * Iterating the map's keys, values or entries (through [forEach])
  * may happen in any order.
- * The itearation order only changes when the map is modified.
+ * The iteration order only changes when the map is modified.
  * Values are iterated in the same order as their associated keys,
  * so iterating the [keys] and [values] in parallel
  * will give matching key and value pairs.
diff --git a/sdk/lib/collection/list.dart b/sdk/lib/collection/list.dart
index 9b6b753..02e4b71 100644
--- a/sdk/lib/collection/list.dart
+++ b/sdk/lib/collection/list.dart
@@ -244,8 +244,12 @@
   }
 
   void addAll(Iterable<E> iterable) {
+    int i = this.length;
     for (E element in iterable) {
-      this[this.length++] = element;
+      assert(this.length == i || (throw new ConcurrentModificationError(this)));
+      this.length = i + 1;
+      this[i] = element;
+      i++;
     }
   }
 
diff --git a/sdk/lib/collection/maps.dart b/sdk/lib/collection/maps.dart
index 7945e7e..bd2e736 100644
--- a/sdk/lib/collection/maps.dart
+++ b/sdk/lib/collection/maps.dart
@@ -60,7 +60,7 @@
     }
   }
 
-  bool containsValue(V value) {
+  bool containsValue(Object value) {
     for (K key in keys) {
       if (this[key] == value) return true;
     }
@@ -68,7 +68,7 @@
   }
 
   V putIfAbsent(K key, V ifAbsent()) {
-    if (keys.contains(key)) {
+    if (containsKey(key)) {
       return this[key];
     }
     return this[key] = ifAbsent();
@@ -218,18 +218,18 @@
  * necessary to implement each particular operation.
  */
 class Maps {
-  static bool containsValue(Map map, value) {
+  static bool containsValue(Map map, Object value) {
     for (final v in map.values) {
-      if (value == v) {
+      if (v == value) {
         return true;
       }
     }
     return false;
   }
 
-  static bool containsKey(Map map, key) {
+  static bool containsKey(Map map, Object key) {
     for (final k in map.keys) {
-      if (key == k) {
+      if (k == key) {
         return true;
       }
     }
diff --git a/sdk/lib/collection/splay_tree.dart b/sdk/lib/collection/splay_tree.dart
index fea7d34..223e58c 100644
--- a/sdk/lib/collection/splay_tree.dart
+++ b/sdk/lib/collection/splay_tree.dart
@@ -325,7 +325,6 @@
   SplayTreeMap._internal();
 
   V operator [](Object key) {
-    if (key == null) throw new ArgumentError(key);
     if (!_validKey(key)) return null;
     if (_root != null) {
       int comp = _splay(key);
diff --git a/sdk/lib/convert/base64.dart b/sdk/lib/convert/base64.dart
new file mode 100644
index 0000000..77f7158
--- /dev/null
+++ b/sdk/lib/convert/base64.dart
@@ -0,0 +1,713 @@
+// 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.convert;
+
+/**
+ * An instance of [Base64Codec].
+ *
+ * This instance provides a convenient access to
+ * [base64](https://tools.ietf.org/html/rfc4648) encoding and decoding.
+ *
+ * It encodes and decodes using the default base64 alphabet, does not allow
+ * any invalid characters when decoding, and requires padding.
+ *
+ * Examples:
+ *
+ *     var encoded = BASE64.encode([0x62, 0x6c, 0xc3, 0xa5, 0x62, 0xc3, 0xa6,
+ *                                  0x72, 0x67, 0x72, 0xc3, 0xb8, 0x64]);
+ *     var decoded = BASE64.decode("YmzDpWLDpnJncsO4ZAo=");
+ */
+const Base64Codec BASE64 = const Base64Codec();
+
+// Constants used in more than one class.
+const int _paddingChar = 0x3d;  // '='.
+
+/**
+ * A [base64](https://tools.ietf.org/html/rfc4648) encoder and decoder.
+ *
+ * A [Base64Codec] allows base64 encoding bytes into ASCII strings and
+ * decoding valid encodings back to bytes.
+ *
+ * This implementation only handles the simplest RFC 4648 base-64 encoding.
+ * It does not allow invalid characters when decoding and it requires,
+ * and generates, padding so that the input is always a multiple of four
+ * characters.
+ */
+class Base64Codec extends Codec<List<int>, String> {
+  const Base64Codec();
+
+  Base64Encoder get encoder => const Base64Encoder();
+
+  Base64Decoder get decoder => const Base64Decoder();
+}
+
+// ------------------------------------------------------------------------
+// Encoder
+// ------------------------------------------------------------------------
+
+/**
+ * Base-64 encoding converter.
+ *
+ * Encodes lists of bytes using base64 encoding.
+ * The result are ASCII strings using a restricted alphabet.
+ */
+class Base64Encoder extends Converter<List<int>, String> {
+  const Base64Encoder();
+
+  String convert(List<int> input) {
+    if (input.isEmpty) return "";
+    var encoder = new _Base64Encoder();
+    Uint8List buffer = encoder.encode(input, 0, input.length, true);
+    return new String.fromCharCodes(buffer);
+  }
+
+  ByteConversionSink startChunkedConversion(Sink<String> sink) {
+    if (sink is StringConversionSink) {
+      return new _Utf8Base64EncoderSink(sink.asUtf8Sink(false));
+    }
+    return new _AsciiBase64EncoderSink(sink);
+  }
+
+  Stream<String> bind(Stream<List<int>> stream) {
+    return new Stream<String>.eventTransformed(
+        stream,
+        (EventSink sink) =>
+            new _ConverterStreamEventSink<List<int>, String>(this, sink));
+  }
+}
+
+/**
+ * Helper class for encoding bytes to BASE-64.
+ */
+class _Base64Encoder {
+  /** The RFC 4648 base64 encoding alphabet. */
+  static const String _base64Alphabet =
+      "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+
+  /** Shift-count to extract the values stored in [_state]. */
+  static const int _valueShift = 2;
+
+  /** Mask to extract the count value stored in [_state]. */
+  static const int _countMask = 3;
+
+  static const int _sixBitMask = 0x3F;
+
+  /**
+   * Intermediate state between chunks.
+   *
+   * Encoding handles three bytes at a time.
+   * If fewer than three bytes has been seen, this value encodes
+   * the number of bytes seen (0, 1 or 2) and their values.
+   */
+  int _state = 0;
+
+  /** Encode count and bits into a value to be stored in [_state]. */
+  static int _encodeState(int count, int bits) {
+    assert(count <= _countMask);
+    return bits << _valueShift | count;
+  }
+
+  /** Extract bits from encoded state. */
+  static int _stateBits(int state) => state >> _valueShift;
+
+  /** Extract count from encoded state. */
+  static int _stateCount(int state) => state & _countMask;
+
+  /**
+   * Create a [Uint8List] with the provided length.
+   */
+  Uint8List createBuffer(int bufferLength) => new Uint8List(bufferLength);
+
+  /**
+   * Encode [bytes] from [start] to [end] and the bits in [_state].
+   *
+   * Returns a [Uint8List] of the ASCII codes of the encoded data.
+   *
+   * If the input, including left over [_state] from earlier encodings,
+   * are not a multiple of three bytes, then the partial state is stored
+   * back into [_state].
+   * If [isLast] is true, partial state is encoded in the output instead,
+   * with the necessary padding.
+   *
+   * Returns `null` if there is no output.
+   */
+  Uint8List encode(List<int> bytes, int start, int end, bool isLast) {
+    assert(0 <= start);
+    assert(start <= end);
+    assert(bytes == null || end <= bytes.length);
+    int length = end - start;
+
+    int count = _stateCount(_state);
+    int byteCount = (count + length);
+    int fullChunks = byteCount ~/ 3;
+    int partialChunkLength = byteCount - fullChunks * 3;
+    int bufferLength = fullChunks * 4;
+    if (isLast && partialChunkLength > 0) {
+      bufferLength += 4;  // Room for padding.
+    }
+    var output = createBuffer(bufferLength);
+    _state = encodeChunk(bytes, start, end, isLast, output, 0, _state);
+    if (bufferLength > 0) return output;
+    // If the input plus the data in state is still less than three bytes,
+    // there may not be any output.
+    return null;
+  }
+
+  static int encodeChunk(List<int> bytes, int start, int end, bool isLast,
+                          Uint8List output, int outputIndex, int state) {
+    int bits = _stateBits(state);
+    // Count number of missing bytes in three-byte chunk.
+    int expectedChars = 3 - _stateCount(state);
+
+    // The input must be a list of bytes (integers in the range 0..255).
+    // The value of `byteOr` will be the bitwise or of all the values in
+    // `bytes` and a later check will validate that they were all valid bytes.
+    int byteOr = 0;
+    for (int i = start; i < end; i++) {
+      int byte = bytes[i];
+      byteOr |= byte;
+      bits = ((bits << 8) | byte) & 0xFFFFFF;  // Never store more than 24 bits.
+      expectedChars--;
+      if (expectedChars == 0) {
+        output[outputIndex++] =
+            _base64Alphabet.codeUnitAt((bits >> 18) & _sixBitMask);
+        output[outputIndex++] =
+            _base64Alphabet.codeUnitAt((bits >> 12) & _sixBitMask);
+        output[outputIndex++] =
+            _base64Alphabet.codeUnitAt((bits >> 6) & _sixBitMask);
+        output[outputIndex++] =
+            _base64Alphabet.codeUnitAt(bits & _sixBitMask);
+        expectedChars = 3;
+        bits = 0;
+      }
+    }
+    if (byteOr >= 0 && byteOr <= 255) {
+      if (isLast && expectedChars < 3) {
+        writeFinalChunk(output, outputIndex, 3 - expectedChars, bits);
+        return 0;
+      }
+      return _encodeState(3 - expectedChars, bits);
+    }
+
+    // There was an invalid byte value somewhere in the input - find it!
+    int i = start;
+    while (i < end) {
+      int byte = bytes[i];
+      if (byte < 0 || byte > 255) break;
+      i++;
+    }
+    throw new ArgumentError.value(bytes,
+        "Not a byte value at index $i: 0x${bytes[i].toRadixString(16)}");
+  }
+
+  /**
+   * Writes a final encoded four-character chunk.
+   *
+   * Only used when the [_state] contains a partial (1 or 2 byte)
+   * input.
+   */
+  static void writeFinalChunk(Uint8List output, int outputIndex,
+                              int count, int bits) {
+    assert(count > 0);
+    if (count == 1) {
+      output[outputIndex++] =
+          _base64Alphabet.codeUnitAt((bits >> 2) & _sixBitMask);
+      output[outputIndex++] =
+          _base64Alphabet.codeUnitAt((bits << 4) & _sixBitMask);
+      output[outputIndex++] = _paddingChar;
+      output[outputIndex++] = _paddingChar;
+    } else {
+      assert(count == 2);
+      output[outputIndex++] =
+          _base64Alphabet.codeUnitAt((bits >> 10) & _sixBitMask);
+      output[outputIndex++] =
+          _base64Alphabet.codeUnitAt((bits >> 4) & _sixBitMask);
+      output[outputIndex++] =
+          _base64Alphabet.codeUnitAt((bits << 2) & _sixBitMask);
+      output[outputIndex++] = _paddingChar;
+    }
+  }
+}
+
+class _BufferCachingBase64Encoder extends _Base64Encoder {
+  /**
+   * Reused buffer.
+   *
+   * When the buffer isn't released to the sink, only used to create another
+   * value (a string), the buffer can be reused between chunks.
+   */
+  Uint8List bufferCache;
+
+  Uint8List createBuffer(int bufferLength) {
+    if (bufferCache == null || bufferCache.length < bufferLength) {
+      bufferCache = new Uint8List(bufferLength);
+    }
+    // Return a view of the buffer, so it has the reuested length.
+    return new Uint8List.view(bufferCache.buffer, 0, bufferLength);
+  }
+}
+
+abstract class _Base64EncoderSink extends ByteConversionSinkBase {
+  void add(List<int> source) {
+    _add(source, 0, source.length, false);
+  }
+
+  void close() {
+    _add(null, 0, 0, true);
+  }
+
+  void addSlice(List<int> source, int start, int end, bool isLast) {
+    if (end == null) throw new ArgumentError.notNull("end");
+    RangeError.checkValidRange(start, end, source.length);
+    _add(source, start, end, isLast);
+  }
+
+  void _add(List<int> source, int start, int end, bool isLast);
+}
+
+class _AsciiBase64EncoderSink extends _Base64EncoderSink {
+  final _Base64Encoder _encoder = new _BufferCachingBase64Encoder();
+
+  final ChunkedConversionSink<String> _sink;
+
+  _AsciiBase64EncoderSink(this._sink);
+
+  void _add(List<int> source, int start, int end, bool isLast) {
+    Uint8List buffer = _encoder.encode(source, start, end, isLast);
+    if (buffer != null) {
+      String string = new String.fromCharCodes(buffer);
+      _sink.add(string);
+    }
+    if (isLast) {
+      _sink.close();
+    }
+  }
+}
+
+class _Utf8Base64EncoderSink extends _Base64EncoderSink {
+  final ByteConversionSink _sink;
+  final _Base64Encoder _encoder = new _Base64Encoder();
+
+  _Utf8Base64EncoderSink(this._sink);
+
+  void _add(List<int> source, int start, int end, bool isLast) {
+    Uint8List buffer = _encoder.encode(source, start, end, isLast);
+    if (buffer != null) {
+      _sink.addSlice(buffer, 0, buffer.length, isLast);
+    }
+  }
+}
+
+// ------------------------------------------------------------------------
+// Decoder
+// ------------------------------------------------------------------------
+
+class Base64Decoder extends Converter<String, List<int>> {
+  const Base64Decoder();
+
+  List<int> convert(String input) {
+    if (input.isEmpty) return new Uint8List(0);
+    int length = input.length;
+    var decoder = new _Base64Decoder();
+    Uint8List buffer = decoder.decode(input, 0, input.length);
+    decoder.close(input, input.length);
+    return buffer;
+  }
+
+  StringConversionSink startChunkedConversion(Sink<List<int>> sink) {
+    return new _Base64DecoderSink(sink);
+  }
+}
+
+/**
+ * Helper class implementing base64 decoding with intermediate state.
+ */
+class _Base64Decoder {
+  /** Shift-count to extract the values stored in [_state]. */
+  static const int _valueShift = 2;
+
+  /** Mask to extract the count value stored in [_state]. */
+  static const int _countMask = 3;
+
+  /** Invalid character in decoding table. */
+  static const int _invalid = -2;
+
+  /** Padding character in decoding table. */
+  static const int _padding = -1;
+
+  // Shorthands to make the table more readable.
+  static const int __ = _invalid;
+  static const int _p = _padding;
+
+  /**
+   * Mapping from ASCII characters to their index in the base64 alphabet.
+   *
+   * Uses [_invalid] for invalid indices and [_padding] for the padding
+   * character.
+   *
+   * Accepts the "URL-safe" alphabet as well (`-` and `_` are the
+   * 62nd and 63rd alphabet characters), and considers `%` a padding
+   * character which mush be followed by `3D`, the percent-escape
+   * for `=`.
+   */
+  static final List<int> _inverseAlphabet = new Int8List.fromList([
+    __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __,
+    __, __, __, __, __, __, __, __, __, __, __, __, __, __, __, __,
+    __, __, __, __, __, _p, __, __, __, __, __, 62, __, 62, __, 63,
+    52, 53, 54, 55, 56, 57, 58, 59, 60, 61, __, __, __, _p, __, __,
+    __,  0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14,
+    15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, __, __, __, __, 63,
+    __, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
+    41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, __, __, __, __, __,
+  ]);
+
+  // Character constants.
+  static const int _char_percent = 0x25;  // '%'.
+  static const int _char_3       = 0x33;  // '3'.
+  static const int _char_d       = 0x64;  // 'd'.
+
+  /**
+   * Maintains the intermediate state of a partly-decoded input.
+   *
+   * BASE-64 is decoded in chunks of four characters. If a chunk does not
+   * contain a full block, the decoded bits (six per character) of the
+   * available characters are stored in [_state] until the next call to
+   * [_decode] or [_close].
+   *
+   * If no padding has been seen, the value is
+   *   `numberOfCharactersSeen | (decodedBits << 2)`
+   * where `numberOfCharactersSeen` is between 0 and 3 and decoded bits
+   * contains six bits per seen character.
+   *
+   * If padding has been seen the value is negative. It's the bitwise negation
+   * of the number of remanining allowed padding characters (always ~0 or ~1).
+   *
+   * A state of `0` or `~0` are valid places to end decoding, all other values
+   * mean that a four-character block has not been completed.
+   */
+  int _state = 0;
+
+  /**
+   * Encodes [count] and [bits] as a value to be stored in [_state].
+   */
+  static int _encodeCharacterState(int count, int bits) {
+    assert(count == (count & _countMask));
+    return (bits << _valueShift | count);
+  }
+
+  /**
+   * Extracts count from a [_state] value.
+   */
+  static int _stateCount(int state) {
+    assert(state >= 0);
+    return state & _countMask;
+  }
+
+  /**
+   * Extracts value bits from a [_state] value.
+   */
+  static int _stateBits(int state) {
+    assert(state >= 0);
+    return state >> _valueShift;
+  }
+
+  /**
+   * Encodes a number of expected padding characters to be stored in [_state].
+   */
+  static int _encodePaddingState(int expectedPadding) {
+    assert(expectedPadding >= 0);
+    assert(expectedPadding <= 5);
+    return -expectedPadding - 1;  // ~expectedPadding adapted to dart2js.
+  }
+
+  /**
+   * Extracts expected padding character count from a [_state] value.
+   */
+  static int _statePadding(int state) {
+    assert(state < 0);
+    return -state - 1;  // ~state adapted to dart2js.
+  }
+
+  static bool _hasSeenPadding(int state) => state < 0;
+
+  /**
+   * Decodes [input] from [start] to [end].
+   *
+   * Returns a [Uint8List] with the decoded bytes.
+   * If a previous call had an incomplete four-character block, the bits from
+   * those are included in decoding
+   */
+  Uint8List decode(String input, int start, int end) {
+    assert(0 <= start);
+    assert(start <= end);
+    assert(end <= input.length);
+    if (_hasSeenPadding(_state)) {
+      _state = _checkPadding(input, start, end, _state);
+      return null;
+    }
+    if (start == end) return new Uint8List(0);
+    Uint8List buffer = _allocateBuffer(input, start, end, _state);
+    _state = decodeChunk(input, start, end, buffer, 0, _state);
+    return buffer;
+  }
+
+  /** Checks that [_state] represents a valid decoding. */
+  void close(String input, int end) {
+    if (_state < _encodePaddingState(0)) {
+      throw new FormatException("Missing padding character", input, end);
+    }
+    if (_state > 0) {
+      throw new FormatException("Invalid length, must be multiple of four",
+                                input, end);
+    }
+    _state = _encodePaddingState(0);
+  }
+
+  /**
+   * Decodes [input] from [start] to [end].
+   *
+   * Includes the state returned by a previous call in the decoding.
+   * Writes the decoding to [output] at [outIndex], and there must
+   * be room in the output.
+   */
+  static int decodeChunk(String input, int start, int end,
+                          Uint8List output, int outIndex,
+                          int state) {
+    assert(!_hasSeenPadding(state));
+    const int asciiMask = 127;
+    const int asciiMax = 127;
+    const int eightBitMask = 0xFF;
+    const int bitsPerCharacter = 6;
+
+    int bits = _stateBits(state);
+    int count = _stateCount(state);
+    // String contents should be all ASCII.
+    // Instead of checking for each character, we collect the bitwise-or of
+    // all the characters in `charOr` and later validate that all characters
+    // were ASCII.
+    int charOr = 0;
+    for (int i = start; i < end; i++) {
+      var char = input.codeUnitAt(i);
+      charOr |= char;
+      int code = _inverseAlphabet[char & asciiMask];
+      if (code >= 0) {
+        bits = ((bits << bitsPerCharacter) | code) & 0xFFFFFF;
+        count = (count + 1) & 3;
+        if (count == 0) {
+          assert(outIndex + 3 <= output.length);
+          output[outIndex++] = (bits >> 16) & eightBitMask;
+          output[outIndex++] = (bits >> 8) & eightBitMask;
+          output[outIndex++] = bits & eightBitMask;
+          bits = 0;
+        }
+        continue;
+      } else if (code == _padding && count > 1) {
+        if (charOr < 0 || charOr > asciiMax) break;
+        if (count == 3) {
+          if ((bits & 0x03) != 0) {
+            throw new FormatException(
+                "Invalid encoding before padding", input, i);
+          }
+          output[outIndex++] = bits >> 10;
+          output[outIndex++] = bits >> 2;
+        } else {
+          if ((bits & 0x0F) != 0) {
+            throw new FormatException(
+                "Invalid encoding before padding", input, i);
+          }
+          output[outIndex++] = bits >> 4;
+        }
+        // Expected padding is the number of expected padding characters,
+        // where `=` counts as three and `%3D` counts as one per character.
+        //
+        // Expect either zero or one padding depending on count (2 or 3),
+        // plus two more characters if the code was `%` (a partial padding).
+        int expectedPadding = (3 - count) * 3;
+        if (char == _char_percent) expectedPadding += 2;
+        state = _encodePaddingState(expectedPadding);
+        return _checkPadding(input, i + 1, end, state);
+      }
+      throw new FormatException("Invalid character", input, i);
+    }
+    if (charOr >= 0 && charOr <= asciiMax) {
+      return _encodeCharacterState(count, bits);
+    }
+    // There is an invalid (non-ASCII) character in the input.
+    int i;
+    for (i = start; i < end; i++) {
+      int char = input.codeUnitAt(i);
+      if (char < 0 || char > asciiMax) break;
+    }
+    throw new FormatException("Invalid character", input, i);
+  }
+
+  /**
+   * Allocates a buffer with room for the decoding of a substring of [input].
+   *
+   * Includes room for the characters in [state], and handles padding correctly.
+   */
+  static Uint8List _allocateBuffer(String input, int start, int end,
+                                   int state) {
+    assert(state >= 0);
+    int paddingStart = _trimPaddingChars(input, start, end);
+    int length = _stateCount(state) + (paddingStart - start);
+    // Three bytes per full four bytes in the input.
+    int bufferLength = (length >> 2) * 3;
+    // If padding was seen, then this is the last chunk, and the final partial
+    // chunk should be decoded too.
+    int remainderLength = length & 3;
+    if (remainderLength != 0 && paddingStart < end) {
+      bufferLength += remainderLength - 1;
+    }
+    if (bufferLength > 0) return new Uint8List(bufferLength);
+    // If the input plus state is less than four characters, and it's not
+    // at the end of input, no buffer is needed.
+    return null;
+  }
+
+  /**
+   * Returns the position of the start of padding at the end of the input.
+   *
+   * Returns the end of input if there is no padding.
+   *
+   * This is used to ensure that the decoding buffer has the exact size
+   * it needs when input is valid, and at least enough bytes to reach the error
+   * when input is invalid.
+   *
+   * Never count more than two padding sequences since any more than that
+   * will raise an error anyway, and we only care about being precise for
+   * successful conversions.
+   */
+  static int _trimPaddingChars(String input, int start, int end) {
+    // This may count '%=' as two paddings. That's ok, it will err later,
+    // but the buffer will be large enough to reach the error.
+    int padding = 0;
+    int index = end;
+    int newEnd = end;
+    while (index > start && padding < 2) {
+      index--;
+      int char = input.codeUnitAt(index);
+      if (char == _paddingChar) {
+        padding++;
+        newEnd = index;
+        continue;
+      }
+      if ((char | 0x20) == _char_d) {
+        if (index == start) break;
+        index--;
+        char = input.codeUnitAt(index);
+      }
+      if (char == _char_3) {
+        if (index == start) break;
+        index--;
+        char = input.codeUnitAt(index);
+      }
+      if (char == _char_percent) {
+        padding++;
+        newEnd = index;
+        continue;
+      }
+      break;
+    }
+    return newEnd;
+  }
+
+  /**
+   * Check that the remainder of the string is valid padding.
+   *
+   * Valid padding is a correct number (0, 1 or 2) of `=` characters
+   * or `%3D` sequences depending on the number of preceding BASE-64 characters.
+   * The [state] parameter encodes which padding continuations are allowed
+   * as the number of expected characters. That number is the number of
+   * expected padding characters times 3 minus the number of padding characters
+   * seen so far, where `=` counts as 3 counts as three characters,
+   * and the padding sequence `%3D` counts as one character per character.
+   *
+   * The number of missing characters is always between 0 and 5 because we
+   * only call this function after having seen at least one `=` or `%`
+   * character.
+   * If the number of missing characters is not 3 or 0, we have seen (at least)
+   * a `%` character and expects the rest of the `%3D` sequence, and a `=` is
+   * not allowed. When missing 3 characters, either `=` or `%` is allowed.
+   *
+   * When the value is 0, no more padding (or any other character) is allowed.
+   */
+  static int _checkPadding(String input, int start, int end, int state) {
+    assert(_hasSeenPadding(state));
+    if (start == end) return state;
+    int expectedPadding = _statePadding(state);
+    assert(expectedPadding >= 0);
+    assert(expectedPadding < 6);
+    while (expectedPadding > 0) {
+      int char = input.codeUnitAt(start);
+      if (expectedPadding == 3) {
+        if (char == _paddingChar) {
+          expectedPadding -= 3;
+          start++;
+          break;
+        }
+        if (char == _char_percent) {
+          expectedPadding--;
+          start++;
+          if (start == end) break;
+          char = input.codeUnitAt(start);
+        } else {
+          break;
+        }
+      }
+      // Partial padding means we have seen part of a "%3D" escape.
+      int expectedPartialPadding = expectedPadding;
+      if (expectedPartialPadding > 3) expectedPartialPadding -= 3;
+      if (expectedPartialPadding == 2) {
+        // Expects '3'
+        if (char != _char_3) break;
+        start++;
+        expectedPadding--;
+        if (start == end) break;
+        char = input.codeUnitAt(start);
+      }
+      // Expects 'D' or 'd'.
+      if ((char | 0x20) != _char_d) break;
+      start++;
+      expectedPadding--;
+      if (start == end) break;
+    }
+    if (start != end) {
+      throw new FormatException("Invalid padding character",
+                                input, start);
+    }
+    return _encodePaddingState(expectedPadding);
+  }
+}
+
+class _Base64DecoderSink extends StringConversionSinkBase {
+  /** Output sink */
+  final ChunkedConversionSink<List<int>> _sink;
+  final _Base64Decoder _decoder = new _Base64Decoder();
+
+  _Base64DecoderSink(this._sink);
+
+  void add(String string) {
+    if (string.isEmpty) return;
+    Uint8List buffer = _decoder.decode(string, 0, string.length);
+    if (buffer != null) _sink.add(buffer);
+  }
+
+  void close() {
+    _decoder.close(null, null);
+    _sink.close();
+  }
+
+  void addSlice(String string, int start, int end, bool isLast) {
+    end = RangeError.checkValidRange(start, end, string.length);
+    if (start == end) return;
+    Uint8List buffer = _decoder.decode(string, start, end);
+    if (buffer != null) _sink.add(buffer);
+    if (isLast) {
+      _decoder.close(string, end);
+      _sink.close();
+    }
+  }
+}
diff --git a/sdk/lib/convert/convert.dart b/sdk/lib/convert/convert.dart
index a047cc0..da0c87c 100644
--- a/sdk/lib/convert/convert.dart
+++ b/sdk/lib/convert/convert.dart
@@ -58,6 +58,7 @@
 import 'dart:typed_data';
 
 part 'ascii.dart';
+part 'base64.dart';
 part 'byte_conversion.dart';
 part 'chunked_conversion.dart';
 part 'codec.dart';
diff --git a/sdk/lib/convert/convert_sources.gypi b/sdk/lib/convert/convert_sources.gypi
index 6c5267f..d8d40cb 100644
--- a/sdk/lib/convert/convert_sources.gypi
+++ b/sdk/lib/convert/convert_sources.gypi
@@ -8,6 +8,7 @@
     'convert.dart',
     # The above file needs to be first as it lists the parts below.
     'ascii.dart',
+    'base64.dart',
     'byte_conversion.dart',
     'chunked_conversion.dart',
     'codec.dart',
diff --git a/sdk/lib/convert/json.dart b/sdk/lib/convert/json.dart
index d3624ab..ace76c2 100644
--- a/sdk/lib/convert/json.dart
+++ b/sdk/lib/convert/json.dart
@@ -53,8 +53,8 @@
  *
  * Examples:
  *
- *     var encoded = JSON.encode([1, 2, { "a": null }]);
- *     var decoded = JSON.decode('["foo", { "bar": 499 }]');
+ *    var encoded = JSON.encode([1, 2, { "a": null }]);
+ *    var decoded = JSON.decode('["foo", { "bar": 499 }]');
  */
 const JsonCodec JSON = const JsonCodec();
 
@@ -65,6 +65,11 @@
 /**
  * A [JsonCodec] encodes JSON objects to strings and decodes strings to
  * JSON objects.
+ *
+ * Examples:
+ *
+ *    var encoded = JSON.encode([1, 2, { "a": null }]);
+ *    var decoded = JSON.decode('["foo", { "bar": 499 }]');
  */
 class JsonCodec extends Codec<Object, String> {
   final _Reviver _reviver;
@@ -898,9 +903,9 @@
   int index = 0;
 
   _JsonUtf8Stringifier(toEncodable, int bufferSize, this.addChunk)
-      : super(toEncodable),
-        this.bufferSize = bufferSize,
-        buffer = new Uint8List(bufferSize);
+      : this.bufferSize = bufferSize,
+        buffer = new Uint8List(bufferSize),
+        super(toEncodable);
 
   /**
    * Convert [object] to UTF-8 encoded JSON.
diff --git a/sdk/lib/convert/utf.dart b/sdk/lib/convert/utf.dart
index 9128e61..8b1a1e0 100644
--- a/sdk/lib/convert/utf.dart
+++ b/sdk/lib/convert/utf.dart
@@ -66,7 +66,7 @@
     return new Utf8Decoder(allowMalformed: allowMalformed).convert(codeUnits);
   }
 
-  Utf8Encoder get encoder => new Utf8Encoder();
+  Utf8Encoder get encoder => const Utf8Encoder();
   Utf8Decoder get decoder {
     return new Utf8Decoder(allowMalformed: _allowMalformed);
   }
diff --git a/sdk/lib/core/bool.dart b/sdk/lib/core/bool.dart
index 8150219..d1f31d7 100644
--- a/sdk/lib/core/bool.dart
+++ b/sdk/lib/core/bool.dart
@@ -21,11 +21,19 @@
    * In all other cases, including when there is no declaration for `name`,
    * the result is the [defaultValue].
    *
+   * The result is the same as would be returned by:
+   *
+   *     (const String.fromEnvironment(name) == "true")
+   *         ? true
+   *         : (const String.fromEnvironment(name) == "false")
+   *             ? false
+   *             : defaultValue
+   *
    * Example:
    *
    *     const loggingFlag = const bool.fromEnvironment("logging");
    *
-   * If you want to use a different truth-string, you can use the
+   * If you want to use a different truth-string than `"true"`, you can use the
    * [String.fromEnvironment] constructor directly:
    *
    *     const isLoggingOn = (const String.fromEnvironment("logging") == "on");
diff --git a/sdk/lib/core/errors.dart b/sdk/lib/core/errors.dart
index 0e99b0b..0229732 100644
--- a/sdk/lib/core/errors.dart
+++ b/sdk/lib/core/errors.dart
@@ -96,6 +96,8 @@
  * Error thrown by the runtime system when an assert statement fails.
  */
 class AssertionError extends Error {
+  AssertionError();
+  String toString() => "Assertion failed";
 }
 
 /**
@@ -392,12 +394,13 @@
   String get _errorName => "RangeError";
   String get _errorExplanation {
     assert(_hasValue);
-    String target = Error.safeToString(indexable);
-    var explanation = ": index should be less than $length";
     if (invalidValue < 0) {
-      explanation = ": index must not be negative";
+      return ": index must not be negative";
     }
-    return explanation;
+    if (length == 0) {
+      return ": no indices are valid";
+    }
+    return ": index should be less than $length";
   }
 }
 
diff --git a/sdk/lib/core/list.dart b/sdk/lib/core/list.dart
index 8e837f8..50a5f58 100644
--- a/sdk/lib/core/list.dart
+++ b/sdk/lib/core/list.dart
@@ -159,7 +159,7 @@
    *
    * Throws an [UnsupportedError] if the list is fixed-length.
    */
-  void set length(int newLength);
+  set length(int newLength);
 
   /**
    * Adds [value] to the end of this list,
diff --git a/sdk/lib/core/map.dart b/sdk/lib/core/map.dart
index d19d108..4f7fcf8 100644
--- a/sdk/lib/core/map.dart
+++ b/sdk/lib/core/map.dart
@@ -35,7 +35,7 @@
    * `operator==` and `hashCode`, and it allows null as a key.
    * It iterates in key insertion order.
    */
-  factory Map() = LinkedHashMap<K, V>;
+  external factory Map();
 
   /**
    * Creates a [LinkedHashMap] instance that contains all key-value pairs of
@@ -149,7 +149,7 @@
   /**
    * Returns true if this map contains the given [key].
    *
-   * Returns true if any of the keys in the map ar equal to `key`
+   * Returns true if any of the keys in the map are equal to `key`
    * according to the equality used by the map.
    */
   bool containsKey(Object key);
diff --git a/sdk/lib/core/pattern.dart b/sdk/lib/core/pattern.dart
index cf898af..f47ba15 100644
--- a/sdk/lib/core/pattern.dart
+++ b/sdk/lib/core/pattern.dart
@@ -17,8 +17,10 @@
    *
    * If [start] is provided, matching will start at that index.
    *
-   * The iterable will contain all the non-overlapping matches of the
-   * pattern on the string, ordered by start index.
+   * The returned iterable lazily computes all the non-overlapping matches
+   * of the pattern on the string, ordered by start index.
+   * If a user only requests the first
+   * match, this function should not compute all possible matches.
    *
    * The matches are found by repeatedly finding the first match
    * of the pattern on the string, starting from the end of the previous
diff --git a/sdk/lib/core/resource.dart b/sdk/lib/core/resource.dart
index 17bdebc..e8c9c67 100644
--- a/sdk/lib/core/resource.dart
+++ b/sdk/lib/core/resource.dart
@@ -5,16 +5,18 @@
 part of dart.core;
 
 /**
- * A resource that can be read into the program.
+ * DEPRECATED. A resource that can be read into the program.
  *
- * WARNING: This API is _experimental_,
- * and it may be changed or removed in future releases
+ * WARNING: This API is _deprecated_,
+ * and it will be removed in 1.14. Please use
+ * https://pub.dartlang.org/packages/resource instead.
  *
  * A resource is data that can be located using a URI and read into
  * the program at runtime.
  * The URI may use the `package` scheme to read resources provided
  * along with package sources.
  */
+@Deprecated('1.14')
 abstract class Resource {
   /**
    * Creates a resource object with the given [uri] as location.
diff --git a/sdk/lib/core/uri.dart b/sdk/lib/core/uri.dart
index 3eb81a4..2cd5f8a 100644
--- a/sdk/lib/core/uri.dart
+++ b/sdk/lib/core/uri.dart
@@ -16,18 +16,8 @@
  * [libtour]: http://www.dartlang.org/docs/dart-up-and-running/contents/ch03.html
  */
 class Uri {
-  // The host name of the URI.
-  // Set to `null` if there is no authority in a URI.
-  final String _host;
-  // The port. Set to null if there is no port. Normalized to null if
-  // the port is the default port for the scheme.
-  // Set to the value of the default port if an empty port was supplied.
-  int _port;
-  // The path. Always non-null.
-  String _path;
-
   /**
-   * Returns the scheme component.
+   * The scheme component of the URI.
    *
    * Returns the empty string if there is no scheme component.
    *
@@ -39,6 +29,213 @@
   final String scheme;
 
   /**
+   * The user-info part of the authority.
+   *
+   * Does not distinguish between an empty user-info and an absent one.
+   * The value is always non-null.
+   * Is considered absent if [_host] is `null`.
+   */
+  final String _userInfo;
+
+  /**
+   * The host name of the URI.
+   *
+   * Set to `null` if there is no authority in the URI.
+   * The host name is the only mandatory part of an authority, so we use
+   * it to mark whether an authority part was present or not.
+   */
+  final String _host;
+
+  /**
+   * The port number part of the authority.
+   *
+   * The port. Set to null if there is no port. Normalized to null if
+   * the port is the default port for the scheme.
+   */
+  int _port;
+
+  /**
+   * The path of the URI.
+   *
+   * Always non-null.
+   */
+  String _path;
+
+  // The query content, or null if there is no query.
+  final String _query;
+
+  // The fragment content, or null if there is no fragment.
+  final String _fragment;
+
+  /**
+   * Cache the computed return value of [pathSegements].
+   */
+  List<String> _pathSegments;
+
+  /**
+   * Cache the computed return value of [queryParameters].
+   */
+  Map<String, String> _queryParameters;
+
+  /// Internal non-verifying constructor. Only call with validated arguments.
+  Uri._internal(this.scheme,
+                this._userInfo,
+                this._host,
+                this._port,
+                this._path,
+                this._query,
+                this._fragment);
+
+  /**
+   * Creates a new URI from its components.
+   *
+   * Each component is set through a named argument. Any number of
+   * components can be provided. The [path] and [query] components can be set
+   * using either of two different named arguments.
+   *
+   * The scheme component is set through [scheme]. The scheme is
+   * normalized to all lowercase letters. If the scheme is omitted or empty,
+   * the URI will not have a scheme part.
+   *
+   * The user info part of the authority component is set through
+   * [userInfo]. It defaults to the empty string, which will be omitted
+   * from the string representation of the URI.
+   *
+   * The host part of the authority component is set through
+   * [host]. The host can either be a hostname, an IPv4 address or an
+   * IPv6 address, contained in '[' and ']'. If the host contains a
+   * ':' character, the '[' and ']' are added if not already provided.
+   * The host is normalized to all lowercase letters.
+   *
+   * The port part of the authority component is set through
+   * [port].
+   * If [port] is omitted or `null`, it implies the default port for
+   * the URI's scheme, and is equivalent to passing that port explicitly.
+   * The recognized schemes, and their default ports, are "http" (80) and
+   * "https" (443). All other schemes are considered as having zero as the
+   * default port.
+   *
+   * If any of `userInfo`, `host` or `port` are provided,
+   * the URI will have an autority according to [hasAuthority].
+   *
+   * The path component is set through either [path] or
+   * [pathSegments]. When [path] is used, it should be a valid URI path,
+   * but invalid characters, except the general delimiters ':/@[]?#',
+   * will be escaped if necessary.
+   * When [pathSegments] is used, each of the provided segments
+   * is first percent-encoded and then joined using the forward slash
+   * separator. The percent-encoding of the path segments encodes all
+   * characters except for the unreserved characters and the following
+   * list of characters: `!$&'()*+,;=:@`. If the other components
+   * calls for an absolute path a leading slash `/` is prepended if
+   * not already there.
+   *
+   * The query component is set through either [query] or
+   * [queryParameters]. When [query] is used the provided string should
+   * be a valid URI query, but invalid characters other than general delimiters,
+   * will be escaped if necessary.
+   * When [queryParameters] is used the query is built from the
+   * provided map. Each key and value in the map is percent-encoded
+   * and joined using equal and ampersand characters. The
+   * percent-encoding of the keys and values encodes all characters
+   * except for the unreserved characters.
+   * If `query` is the empty string, it is equivalent to omitting it.
+   * To have an actual empty query part,
+   * use an empty list for `queryParameters`.
+   * If both `query` and `queryParameters` are omitted or `null`, the
+   * URI will have no query part.
+   *
+   * The fragment component is set through [fragment].
+   * It should be a valid URI fragment, but invalid characters other than
+   * general delimiters, will be escaped if necessary.
+   * If `fragment` is omitted or `null`, the URI will have no fragment part.
+   */
+  factory Uri({String scheme : "",
+               String userInfo : "",
+               String host,
+               int port,
+               String path,
+               Iterable<String> pathSegments,
+               String query,
+               Map<String, String> queryParameters,
+               String fragment}) {
+    scheme = _makeScheme(scheme, 0, _stringOrNullLength(scheme));
+    userInfo = _makeUserInfo(userInfo, 0, _stringOrNullLength(userInfo));
+    host = _makeHost(host, 0, _stringOrNullLength(host), false);
+    // Special case this constructor for backwards compatibility.
+    if (query == "") query = null;
+    query = _makeQuery(query, 0, _stringOrNullLength(query), queryParameters);
+    fragment = _makeFragment(fragment, 0, _stringOrNullLength(fragment));
+    port = _makePort(port, scheme);
+    bool isFile = (scheme == "file");
+    if (host == null &&
+        (userInfo.isNotEmpty || port != null || isFile)) {
+      host = "";
+    }
+    bool hasAuthority = (host != null);
+    path = _makePath(path, 0, _stringOrNullLength(path), pathSegments,
+                     scheme, hasAuthority);
+    if (scheme.isEmpty && host == null && !path.startsWith('/')) {
+      path = _normalizeRelativePath(path);
+    } else {
+      path = _removeDotSegments(path);
+    }
+    return new Uri._internal(scheme, userInfo, host, port,
+                             path, query, fragment);
+  }
+
+  /**
+   * Creates a new `http` URI from authority, path and query.
+   *
+   * Examples:
+   *
+   * ```
+   * // http://example.org/path?q=dart.
+   * new Uri.http("google.com", "/search", { "q" : "dart" });
+   *
+   * // http://user:pass@localhost:8080
+   * new Uri.http("user:pass@localhost:8080", "");
+   *
+   * // http://example.org/a%20b
+   * new Uri.http("example.org", "a b");
+   *
+   * // http://example.org/a%252F
+   * new Uri.http("example.org", "/a%2F");
+   * ```
+   *
+   * The `scheme` is always set to `http`.
+   *
+   * The `userInfo`, `host` and `port` components are set from the
+   * [authority] argument. If `authority` is `null` or empty,
+   * the created `Uri` will have no authority, and will not be directly usable
+   * as an HTTP URL, which must have a non-empty host.
+   *
+   * The `path` component is set from the [unencodedPath]
+   * argument. The path passed must not be encoded as this constructor
+   * encodes the path.
+   *
+   * The `query` component is set from the optional [queryParameters]
+   * argument.
+   */
+  factory Uri.http(String authority,
+                   String unencodedPath,
+                   [Map<String, String> queryParameters]) {
+    return _makeHttpUri("http", authority, unencodedPath, queryParameters);
+  }
+
+  /**
+   * Creates a new `https` URI from authority, path and query.
+   *
+   * This constructor is the same as [Uri.http] except for the scheme
+   * which is set to `https`.
+   */
+  factory Uri.https(String authority,
+                    String unencodedPath,
+                    [Map<String, String> queryParameters]) {
+    return _makeHttpUri("https", authority, unencodedPath, queryParameters);
+  }
+
+  /**
    * Returns the authority component.
    *
    * The authority is formatted from the [userInfo], [host] and [port]
@@ -54,14 +251,6 @@
   }
 
   /**
-   * The user-info part of the authority.
-   *
-   * Does not distinguish between an empty user-info and an absent one.
-   * The value is always non-null.
-   */
-  final String _userInfo;
-
-  /**
    * Returns the user info part of the authority component.
    *
    * Returns the empty string if there is no user info in the
@@ -118,9 +307,6 @@
    */
   String get path => _path;
 
-  // The query content, or null if there is no query.
-  final String _query;
-
   /**
    * Returns the query component. The returned query is encoded. To get
    * direct access to the decoded query use [queryParameters].
@@ -129,9 +315,6 @@
    */
   String get query => (_query == null) ? "" : _query;
 
-  // The fragment content, or null if there is no fragment.
-  final String _fragment;
-
   /**
    * Returns the fragment identifier component.
    *
@@ -141,16 +324,6 @@
   String get fragment => (_fragment == null) ? "" : _fragment;
 
   /**
-   * Cache the computed return value of [pathSegements].
-   */
-  List<String> _pathSegments;
-
-  /**
-   * Cache the computed return value of [queryParameters].
-   */
-  Map<String, String> _queryParameters;
-
-  /**
    * Creates a new `Uri` object by parsing a URI string.
    *
    * If [start] and [end] are provided, only the substring from `start`
@@ -415,164 +588,6 @@
     throw new FormatException(message, uri, index);
   }
 
-  /// Internal non-verifying constructor. Only call with validated arguments.
-  Uri._internal(this.scheme,
-                this._userInfo,
-                this._host,
-                this._port,
-                this._path,
-                this._query,
-                this._fragment);
-
-  /**
-   * Creates a new URI from its components.
-   *
-   * Each component is set through a named argument. Any number of
-   * components can be provided. The [path] and [query] components can be set
-   * using either of two different named arguments.
-   *
-   * The scheme component is set through [scheme]. The scheme is
-   * normalized to all lowercase letters. If the scheme is omitted or empty,
-   * the URI will not have a scheme part.
-   *
-   * The user info part of the authority component is set through
-   * [userInfo]. It defaults to the empty string, which will be omitted
-   * from the string representation of the URI.
-   *
-   * The host part of the authority component is set through
-   * [host]. The host can either be a hostname, an IPv4 address or an
-   * IPv6 address, contained in '[' and ']'. If the host contains a
-   * ':' character, the '[' and ']' are added if not already provided.
-   * The host is normalized to all lowercase letters.
-   *
-   * The port part of the authority component is set through
-   * [port].
-   * If [port] is omitted or `null`, it implies the default port for
-   * the URI's scheme, and is equivalent to passing that port explicitly.
-   * The recognized schemes, and their default ports, are "http" (80) and
-   * "https" (443). All other schemes are considered as having zero as the
-   * default port.
-   *
-   * If any of `userInfo`, `host` or `port` are provided,
-   * the URI will have an autority according to [hasAuthority].
-   *
-   * The path component is set through either [path] or
-   * [pathSegments]. When [path] is used, it should be a valid URI path,
-   * but invalid characters, except the general delimiters ':/@[]?#',
-   * will be escaped if necessary.
-   * When [pathSegments] is used, each of the provided segments
-   * is first percent-encoded and then joined using the forward slash
-   * separator. The percent-encoding of the path segments encodes all
-   * characters except for the unreserved characters and the following
-   * list of characters: `!$&'()*+,;=:@`. If the other components
-   * calls for an absolute path a leading slash `/` is prepended if
-   * not already there.
-   *
-   * The query component is set through either [query] or
-   * [queryParameters]. When [query] is used the provided string should
-   * be a valid URI query, but invalid characters other than general delimiters,
-   * will be escaped if necessary.
-   * When [queryParameters] is used the query is built from the
-   * provided map. Each key and value in the map is percent-encoded
-   * and joined using equal and ampersand characters. The
-   * percent-encoding of the keys and values encodes all characters
-   * except for the unreserved characters.
-   * If `query` is the empty string, it is equivalent to omitting it.
-   * To have an actual empty query part,
-   * use an empty list for `queryParameters`.
-   * If both `query` and `queryParameters` are omitted or `null`, the
-   * URI will have no query part.
-   *
-   * The fragment component is set through [fragment].
-   * It should be a valid URI fragment, but invalid characters other than
-   * general delimiters, will be escaped if necessary.
-   * If `fragment` is omitted or `null`, the URI will have no fragment part.
-   */
-  factory Uri({String scheme : "",
-               String userInfo : "",
-               String host,
-               int port,
-               String path,
-               Iterable<String> pathSegments,
-               String query,
-               Map<String, String> queryParameters,
-               String fragment}) {
-    scheme = _makeScheme(scheme, 0, _stringOrNullLength(scheme));
-    userInfo = _makeUserInfo(userInfo, 0, _stringOrNullLength(userInfo));
-    host = _makeHost(host, 0, _stringOrNullLength(host), false);
-    // Special case this constructor for backwards compatibility.
-    if (query == "") query = null;
-    query = _makeQuery(query, 0, _stringOrNullLength(query), queryParameters);
-    fragment = _makeFragment(fragment, 0, _stringOrNullLength(fragment));
-    port = _makePort(port, scheme);
-    bool isFile = (scheme == "file");
-    if (host == null &&
-        (userInfo.isNotEmpty || port != null || isFile)) {
-      host = "";
-    }
-    bool hasAuthority = (host != null);
-    path = _makePath(path, 0, _stringOrNullLength(path), pathSegments,
-                     scheme, hasAuthority);
-    if (scheme.isEmpty && host == null && !path.startsWith('/')) {
-      path = _normalizeRelativePath(path);
-    } else {
-      path = _removeDotSegments(path);
-    }
-    return new Uri._internal(scheme, userInfo, host, port,
-                             path, query, fragment);
-  }
-
-  /**
-   * Creates a new `http` URI from authority, path and query.
-   *
-   * Examples:
-   *
-   * ```
-   * // http://example.org/path?q=dart.
-   * new Uri.http("google.com", "/search", { "q" : "dart" });
-   *
-   * // http://user:pass@localhost:8080
-   * new Uri.http("user:pass@localhost:8080", "");
-   *
-   * // http://example.org/a%20b
-   * new Uri.http("example.org", "a b");
-   *
-   * // http://example.org/a%252F
-   * new Uri.http("example.org", "/a%2F");
-   * ```
-   *
-   * The `scheme` is always set to `http`.
-   *
-   * The `userInfo`, `host` and `port` components are set from the
-   * [authority] argument. If `authority` is `null` or empty,
-   * the created `Uri` will have no authority, and will not be directly usable
-   * as an HTTP URL, which must have a non-empty host.
-   *
-   * The `path` component is set from the [unencodedPath]
-   * argument. The path passed must not be encoded as this constructor
-   * encodes the path.
-   *
-   * The `query` component is set from the optional [queryParameters]
-   * argument.
-   */
-  factory Uri.http(String authority,
-                   String unencodedPath,
-                   [Map<String, String> queryParameters]) {
-    return _makeHttpUri("http", authority, unencodedPath, queryParameters);
-  }
-
-  /**
-   * Creates a new `https` URI from authority, path and query.
-   *
-   * This constructor is the same as [Uri.http] except for the scheme
-   * which is set to `https`.
-   */
-  factory Uri.https(String authority,
-                    String unencodedPath,
-                    [Map<String, String> queryParameters]) {
-    return _makeHttpUri("https", authority, unencodedPath, queryParameters);
-  }
-
   static Uri _makeHttpUri(String scheme,
                           String authority,
                           String unencodedPath,
@@ -938,7 +953,7 @@
     if (userInfo != null) {
       userInfo = _makeUserInfo(userInfo, 0, userInfo.length);
     } else {
-      userInfo = this.userInfo;
+      userInfo = this._userInfo;
     }
     if (port != null) {
       port = _makePort(port, scheme);
@@ -952,7 +967,7 @@
     if (host != null) {
       host = _makeHost(host, 0, host.length, false);
     } else if (this.hasAuthority) {
-      host = this.host;
+      host = this._host;
     } else if (userInfo.isNotEmpty || port != null || isFile) {
       host = "";
     }
@@ -962,7 +977,7 @@
       path = _makePath(path, 0, _stringOrNullLength(path), pathSegments,
                        scheme, hasAuthority);
     } else {
-      path = this.path;
+      path = this._path;
       if ((isFile || (hasAuthority && !path.isEmpty)) &&
           !path.startsWith('/')) {
         path = "/" + path;
@@ -971,14 +986,14 @@
 
     if (query != null || queryParameters != null) {
       query = _makeQuery(query, 0, _stringOrNullLength(query), queryParameters);
-    } else if (this.hasQuery) {
-      query = this.query;
+    } else {
+      query = this._query;
     }
 
     if (fragment != null) {
       fragment = _makeFragment(fragment, 0, fragment.length);
-    } else if (this.hasFragment) {
-      fragment = this.fragment;
+    } else {
+      fragment = this._fragment;
     }
 
     return new Uri._internal(
@@ -986,6 +1001,17 @@
   }
 
   /**
+   * Returns a `Uri` that differs from this only in not having a fragment.
+   *
+   * If this `Uri` does not have a fragment, it is itself returned.
+   */
+  Uri removeFragment() {
+    if (!this.hasFragment) return this;
+    return new Uri._internal(scheme, _userInfo, _host, _port,
+                             _path, _query, null);
+  }
+
+  /**
    * Returns the URI path split into its segments. Each of the
    * segments in the returned list have been decoded. If the path is
    * empty the empty list will be returned. A leading slash `/` does
diff --git a/sdk/lib/developer/developer.dart b/sdk/lib/developer/developer.dart
index 97c449e..722819c 100644
--- a/sdk/lib/developer/developer.dart
+++ b/sdk/lib/developer/developer.dart
@@ -13,8 +13,11 @@
 
 import 'dart:async';
 import 'dart:convert';
+import 'dart:isolate' show SendPort;
 
+part 'extension.dart';
 part 'profiler.dart';
+part 'timeline.dart';
 
 /// If [when] is true, stop the program as if a breakpoint were hit at the
 /// following statement.
@@ -35,18 +38,18 @@
 
 /// 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 log(String message,
-             {DateTime time,
-              int sequenceNumber,
-              int level: 0,
-              String name: '',
-              Zone zone,
-              Object error,
-              StackTrace stackTrace});
+/// [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/sdk/lib/developer/developer_sources.gypi b/sdk/lib/developer/developer_sources.gypi
index adbaea9..0c4333a 100644
--- a/sdk/lib/developer/developer_sources.gypi
+++ b/sdk/lib/developer/developer_sources.gypi
@@ -5,7 +5,9 @@
 {
   'sources': [
     'developer.dart',
+    'extension.dart',
     'profiler.dart',
+    'timeline.dart',
     # The above file needs to be first if additional parts are added to the lib.
   ],
 }
diff --git a/sdk/lib/developer/extension.dart b/sdk/lib/developer/extension.dart
new file mode 100644
index 0000000..05eeae7
--- /dev/null
+++ b/sdk/lib/developer/extension.dart
@@ -0,0 +1,191 @@
+// 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;
+
+class ServiceExtensionResponse {
+  final String _result;
+  final int _errorCode;
+  final String _errorDetail;
+
+  ServiceExtensionResponse.result(this._result)
+      : _errorCode = null,
+        _errorDetail = null {
+    if (_result is! String) {
+      throw new ArgumentError.value(_result, "result", "Must be a String");
+    }
+  }
+
+  ServiceExtensionResponse.error(this._errorCode, this._errorDetail)
+      : _result = null {
+    _validateErrorCode(_errorCode);
+    if (_errorDetail is! String) {
+      throw new ArgumentError.value(_errorDetail,
+                                    "errorDetail",
+                                    "Must be a String");
+    }
+  }
+
+  /// Invalid method parameter(s) error code.
+  static const kInvalidParams = -32602;
+  /// Generic extension error code.
+  static const kExtensionError = -32000;
+  /// Maximum extension provided error code.
+  static const kExtensionErrorMax = -32000;
+  /// Minimum extension provided error code.
+  static const kExtensionErrorMin = -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 == kInvalidParams) {
+      return;
+    }
+    if ((errorCode >= kExtensionErrorMin) &&
+        (errorCode <= kExtensionErrorMax)) {
+      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.
+/// [parameters] - the parameters.
+typedef Future<ServiceExtensionResponse>
+    ServiceExtensionHandler(String method, Map parameters);
+
+/// Register a [ServiceExtensionHandler] that will be invoked in this isolate
+/// for [method].
+void registerExtension(String method, ServiceExtensionHandler handler) {
+  if (method is! String) {
+    throw new ArgumentError.value(method,
+                                  'method',
+                                  'Must be a String');
+  }
+  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);
+}
+
+// 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);
+
+// This code is only invoked when there is no other Dart code on the stack.
+_runExtension(ServiceExtensionHandler handler,
+              String method,
+              List<String> parameterKeys,
+              List<String> parameterValues,
+              SendPort replyPort,
+              Object id) {
+  var parameters = {};
+  for (var i = 0; i < parameterKeys.length; i++) {
+    parameters[parameterKeys[i]] = parameterValues[i];
+  }
+  var response;
+  try {
+    response = handler(method, parameters);
+  } catch (e, st) {
+    var errorDetails = (st == null) ? '$e' : '$e\n$st';
+    response = new ServiceExtensionResponse.error(
+        ServiceExtensionResponse.kExtensionError,
+        errorDetails);
+    _postResponse(replyPort, id, response);
+    return;
+  }
+  if (response is! Future) {
+    response = new ServiceExtensionResponse.error(
+          ServiceExtensionResponse.kExtensionError,
+          "Extension handler must return a Future");
+    _postResponse(replyPort, id, response);
+    return;
+  }
+  response.catchError((e, st) {
+    // Catch any errors eagerly and wrap them in a ServiceExtensionResponse.
+    var errorDetails = (st == null) ? '$e' : '$e\n$st';
+    return new ServiceExtensionResponse.error(
+        ServiceExtensionResponse.kExtensionError,
+        errorDetails);
+  }).then((response) {
+    // Post the valid response or the wrapped error after verifying that
+    // the response is a ServiceExtensionResponse.
+    if (response is! ServiceExtensionResponse) {
+      response = new ServiceExtensionResponse.error(
+          ServiceExtensionResponse.kExtensionError,
+          "Extension handler must complete to a ServiceExtensionResponse");
+    }
+    _postResponse(replyPort, id, response);
+  }).catchError((e, st) {
+    // We do not expect any errors to occur in the .then or .catchError blocks
+    // but, suppress them just in case.
+  });
+}
+
+// This code is only invoked by _runExtension.
+_postResponse(SendPort replyPort,
+              Object id,
+              ServiceExtensionResponse response) {
+  assert(replyPort != null);
+  if (id == null) {
+    // No id -> no response.
+    replyPort.send(null);
+    return;
+  }
+  assert(id != null);
+  StringBuffer sb = new StringBuffer();
+  sb.write('{"jsonrpc":"2.0",');
+  if (response._isError()) {
+    sb.write('"error":');
+  } else {
+    sb.write('"result":');
+  }
+  sb.write('${response._toString()},');
+  if (id is String) {
+    sb.write('"id":"$id"}');
+  } else {
+    sb.write('"id":$id}');
+  }
+  replyPort.send(sb.toString());
+}
diff --git a/sdk/lib/developer/timeline.dart b/sdk/lib/developer/timeline.dart
new file mode 100644
index 0000000..2753add
--- /dev/null
+++ b/sdk/lib/developer/timeline.dart
@@ -0,0 +1,231 @@
+// 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;
+
+typedef dynamic TimelineSyncFunction();
+
+/// 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 (name is! String) {
+      throw new ArgumentError.value(name,
+                                    'name',
+                                    'Must be a String');
+    }
+    var block = new _SyncBlock._(name, _getTraceClock());
+    if (arguments is Map) {
+      block.arguments.addAll(arguments);
+    }
+    _stack.add(block);
+  }
+
+  /// Finish the last synchronous operation that was started.
+  static void finishSync() {
+    if (_stack.length == 0) {
+      throw new StateError(
+          'Uneven calls to startSync and finishSync');
+    }
+    // Pop top item off of stack.
+    var block = _stack.removeLast();
+    // Finish it.
+    block.finish();
+  }
+
+  /// 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();
+    }
+  }
+
+  static final List<_SyncBlock> _stack = new List<_SyncBlock>();
+}
+
+/// An asynchronous task on the timeline. Asynchronous tasks can live
+/// longer than the current event and can even be shared between isolates.
+/// An asynchronous task can have many (nested) blocks. To share a
+/// [_TimelineTask] across isolates, you must construct a [_TimelineTask] in
+/// both isolates using the same [taskId] and [category].
+class _TimelineTask {
+  /// Create a task. [taskId] will be set by the system.
+  /// Optionally you can specify a [category] name.
+  _TimelineTask({String category: 'Dart'})
+      : _taskId = _getNextAsyncId(),
+        category = category {
+    if (category is! String) {
+      throw new ArgumentError.value(category,
+                                    'category',
+                                    'Must be a String');
+    }
+  }
+
+  /// Create a task with an explicit [taskId]. This is useful if you are
+  /// passing a task between isolates. Optionally you can specify a [category]
+  /// name.
+  _TimelineTask.withTaskId(int taskId, {String category: 'Dart'})
+      : _taskId = taskId,
+        category = category {
+    if (taskId is! int) {
+      throw new ArgumentError.value(taskId,
+                                    'taskId',
+                                    'Must be an int');
+    }
+    if (category is! String) {
+      throw new ArgumentError.value(category,
+                                    'category',
+                                    'Must be a String');
+    }
+  }
+
+  /// Start a block in this task named [name]. Optionally takes
+  /// a [Map] of [arguments].
+  /// Returns an [_AsyncBlock] which is used to finish this block.
+  _AsyncBlock start(String name, {Map arguments}) {
+    if (name is! String) {
+      throw new ArgumentError.value(name,
+                                    'name',
+                                    'Must be a String');
+    }
+    var block = new _AsyncBlock._(name, _taskId, category);
+    if (arguments is Map) {
+      block.arguments.addAll(arguments);
+    }
+    /// Emit start event.
+    block._start();
+    return block;
+  }
+
+  /// Retrieve the asynchronous task's id. Can be used to construct a
+  /// [_TimelineTask] in another isolate.
+  int get taskId => _taskId;
+  final int _taskId;
+  /// Retrieve the asynchronous task's category. Can be used to construct a
+  /// [_TimelineTask] in another isolate.
+  final String category;
+}
+
+/// 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;
+  /// 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.
+  final Map arguments = {};
+  bool _finished = false;
+
+  _AsyncBlock._(this.name, this._taskId, this.category);
+
+  // Emit the start event.
+  void _start() {
+    String argumentsAsJson = JSON.encode(arguments);
+    _reportTaskEvent(_getTraceClock(),
+                     _taskId,
+                     'b',
+                     category,
+                     name,
+                     argumentsAsJson);
+  }
+
+  // Emit the finish event.
+  void _finish() {
+    _reportTaskEvent(_getTraceClock(),
+                     _taskId,
+                     'e',
+                     category,
+                     name,
+                     JSON.encode({}));
+  }
+
+  /// Finish this block. Cannot be called twice.
+  void finish() {
+    if (_finished) {
+      throw new StateError(
+          'It is illegal to call finish twice on the same _AsyncBlock');
+    }
+    _finished = true;
+    _finish();
+  }
+
+  /// Finishes this block when [future] completes. Returns a [Future]
+  /// chained to [future].
+  Future finishWhenComplete(Future future) {
+    if (future is! Future) {
+      throw new ArgumentError.value(future,
+                                    'future',
+                                    'Must be a Future');
+    }
+    return future.whenComplete(() {
+      finish();
+    });
+  }
+}
+
+/// 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.
+  final Map arguments = {};
+  // The start time stamp.
+  final int _start;
+
+  _SyncBlock._(this.name,
+               this._start);
+
+  /// Finish this block of time. At this point, this block can no longer be
+  /// used.
+  void finish() {
+    var end = _getTraceClock();
+
+    // Encode arguments map as JSON before reporting.
+    var argumentsAsJson = JSON.encode(arguments);
+
+    // Report event to runtime.
+    _reportCompleteEvent(_start,
+                         end,
+                         category,
+                         name,
+                         argumentsAsJson);
+  }
+}
+
+/// Returns the next async task id.
+external int _getNextAsyncId();
+
+/// Returns the current value from the trace clock.
+external int _getTraceClock();
+
+/// 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 end,
+                                   String category,
+                                   String name,
+                                   String argumentsAsJson);
diff --git a/sdk/lib/html/dart2js/html_dart2js.dart b/sdk/lib/html/dart2js/html_dart2js.dart
index a63c557..4983498 100644
--- a/sdk/lib/html/dart2js/html_dart2js.dart
+++ b/sdk/lib/html/dart2js/html_dart2js.dart
@@ -26,7 +26,7 @@
 
 import 'dart:async';
 import 'dart:collection';
-import 'dart:_internal' hide Symbol, deprecated;
+import 'dart:_internal' hide Symbol;
 import 'dart:html_common';
 import 'dart:indexed_db';
 import 'dart:isolate';
@@ -55,7 +55,7 @@
 // Not actually used, but imported since dart:html can generate these objects.
 import 'dart:_js_helper' show
     convertDartClosureToJS, Creates, JavaScriptIndexingBehavior,
-    JSName, Native, Null, Returns, Inline, ForceInline,
+    JSName, Native, Returns, ForceInline,
     findDispatchTagForInterceptorClass, setNativeSubclassDispatchRecord,
     makeLeafDispatchRecord;
 import 'dart:_interceptors' show
@@ -122,6 +122,11 @@
   // TODO(17738): Implement this.
   throw new UnimplementedError();
 }
+
+/// Dartium functions that are a NOOP in dart2js.
+unwrap_jso(dartClass_instance) => dartClass_instance;
+wrap_jso(jsObject) => jsObject;
+createCustomUpgrader(Type customElementClass, $this) => $this;
 // 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.
@@ -820,12 +825,10 @@
 @DomName('HTMLAudioElement')
 @Native("HTMLAudioElement")
 class AudioElement extends MediaElement {
-  // To suppress missing implicit constructor warnings.
-  factory AudioElement._() { throw new UnsupportedError("Not supported"); }
 
   @DomName('HTMLAudioElement.HTMLAudioElement')
   @DocsEditable()
-  factory AudioElement([String src]) {
+  factory AudioElement._([String src]) {
     if (src != null) {
       return AudioElement._create_1(src);
     }
@@ -839,6 +842,8 @@
    * This can only be called by subclasses from their created constructor.
    */
   AudioElement.created() : super.created();
+
+  factory AudioElement([String src]) => new AudioElement._(src);
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -1049,7 +1054,7 @@
   // Shadowing definition.
   String get returnValue => JS("String", "#.returnValue", this);
 
-  void set returnValue(String value) {
+  set returnValue(String value) {
     JS("void", "#.returnValue = #", this, value);
   }
 }
@@ -2372,7 +2377,7 @@
   @DomName('CanvasRenderingContext2D.lineDashOffset')
   // TODO(14316): Firefox has this functionality with mozDashOffset, but it
   // needs to be polyfilled.
-  void set lineDashOffset(num value) {
+  set lineDashOffset(num value) {
     JS('void',
        'typeof #.lineDashOffset != "undefined" ? #.lineDashOffset = # : '
        '#.webkitLineDashOffset = #', this, this, value, this, value);
@@ -2940,12 +2945,11 @@
   @Experimental() // untriaged
   Future _request_2() native;
 }
-// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
+// 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.
 
 
-@DocsEditable()
 @DomName('Crypto')
 @SupportedBrowser(SupportedBrowser.CHROME)
 @SupportedBrowser(SupportedBrowser.SAFARI)
@@ -2953,6 +2957,11 @@
 // http://www.w3.org/TR/WebCryptoAPI/
 @Native("Crypto")
 class Crypto extends Interceptor {
+
+  TypedData getRandomValues(TypedData array) {
+    return _getRandomValues(array);
+  }
+
   // To suppress missing implicit constructor warnings.
   factory Crypto._() { throw new UnsupportedError("Not supported"); }
 
@@ -2964,11 +2973,13 @@
   @Experimental() // untriaged
   final _SubtleCrypto subtle;
 
+  @JSName('getRandomValues')
   @DomName('Crypto.getRandomValues')
   @DocsEditable()
   @Creates('TypedData')
   @Returns('TypedData|Null')
-  TypedData getRandomValues(TypedData array) native;
+  TypedData _getRandomValues(TypedData array) native;
+
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -3458,7 +3469,7 @@
   String get background => this._background;
 
   /** Sets the value of "background" */
-  void set background(String value) {
+  set background(String value) {
     _background = value == null ? '' : value;
   }
   @Returns('String')
@@ -3469,7 +3480,7 @@
   String get backgroundAttachment => this._backgroundAttachment;
 
   /** Sets the value of "background-attachment" */
-  void set backgroundAttachment(String value) {
+  set backgroundAttachment(String value) {
     _backgroundAttachment = value == null ? '' : value;
   }
   @Returns('String')
@@ -3480,7 +3491,7 @@
   String get backgroundColor => this._backgroundColor;
 
   /** Sets the value of "background-color" */
-  void set backgroundColor(String value) {
+  set backgroundColor(String value) {
     _backgroundColor = value == null ? '' : value;
   }
   @Returns('String')
@@ -3491,7 +3502,7 @@
   String get backgroundImage => this._backgroundImage;
 
   /** Sets the value of "background-image" */
-  void set backgroundImage(String value) {
+  set backgroundImage(String value) {
     _backgroundImage = value == null ? '' : value;
   }
   @Returns('String')
@@ -3502,7 +3513,7 @@
   String get backgroundPosition => this._backgroundPosition;
 
   /** Sets the value of "background-position" */
-  void set backgroundPosition(String value) {
+  set backgroundPosition(String value) {
     _backgroundPosition = value == null ? '' : value;
   }
   @Returns('String')
@@ -3513,7 +3524,7 @@
   String get backgroundRepeat => this._backgroundRepeat;
 
   /** Sets the value of "background-repeat" */
-  void set backgroundRepeat(String value) {
+  set backgroundRepeat(String value) {
     _backgroundRepeat = value == null ? '' : value;
   }
   @Returns('String')
@@ -3524,7 +3535,7 @@
   String get border => this._border;
 
   /** Sets the value of "border" */
-  void set border(String value) {
+  set border(String value) {
     _border = value == null ? '' : value;
   }
   @Returns('String')
@@ -3535,7 +3546,7 @@
   String get borderBottom => this._borderBottom;
 
   /** Sets the value of "border-bottom" */
-  void set borderBottom(String value) {
+  set borderBottom(String value) {
     _borderBottom = value == null ? '' : value;
   }
   @Returns('String')
@@ -3546,7 +3557,7 @@
   String get borderBottomColor => this._borderBottomColor;
 
   /** Sets the value of "border-bottom-color" */
-  void set borderBottomColor(String value) {
+  set borderBottomColor(String value) {
     _borderBottomColor = value == null ? '' : value;
   }
   @Returns('String')
@@ -3557,7 +3568,7 @@
   String get borderBottomStyle => this._borderBottomStyle;
 
   /** Sets the value of "border-bottom-style" */
-  void set borderBottomStyle(String value) {
+  set borderBottomStyle(String value) {
     _borderBottomStyle = value == null ? '' : value;
   }
   @Returns('String')
@@ -3568,7 +3579,7 @@
   String get borderBottomWidth => this._borderBottomWidth;
 
   /** Sets the value of "border-bottom-width" */
-  void set borderBottomWidth(String value) {
+  set borderBottomWidth(String value) {
     _borderBottomWidth = value == null ? '' : value;
   }
   @Returns('String')
@@ -3579,7 +3590,7 @@
   String get borderCollapse => this._borderCollapse;
 
   /** Sets the value of "border-collapse" */
-  void set borderCollapse(String value) {
+  set borderCollapse(String value) {
     _borderCollapse = value == null ? '' : value;
   }
   @Returns('String')
@@ -3590,7 +3601,7 @@
   String get borderColor => this._borderColor;
 
   /** Sets the value of "border-color" */
-  void set borderColor(String value) {
+  set borderColor(String value) {
     _borderColor = value == null ? '' : value;
   }
   @Returns('String')
@@ -3601,7 +3612,7 @@
   String get borderLeft => this._borderLeft;
 
   /** Sets the value of "border-left" */
-  void set borderLeft(String value) {
+  set borderLeft(String value) {
     _borderLeft = value == null ? '' : value;
   }
   @Returns('String')
@@ -3612,7 +3623,7 @@
   String get borderLeftColor => this._borderLeftColor;
 
   /** Sets the value of "border-left-color" */
-  void set borderLeftColor(String value) {
+  set borderLeftColor(String value) {
     _borderLeftColor = value == null ? '' : value;
   }
   @Returns('String')
@@ -3623,7 +3634,7 @@
   String get borderLeftStyle => this._borderLeftStyle;
 
   /** Sets the value of "border-left-style" */
-  void set borderLeftStyle(String value) {
+  set borderLeftStyle(String value) {
     _borderLeftStyle = value == null ? '' : value;
   }
   @Returns('String')
@@ -3634,7 +3645,7 @@
   String get borderLeftWidth => this._borderLeftWidth;
 
   /** Sets the value of "border-left-width" */
-  void set borderLeftWidth(String value) {
+  set borderLeftWidth(String value) {
     _borderLeftWidth = value == null ? '' : value;
   }
   @Returns('String')
@@ -3645,7 +3656,7 @@
   String get borderRight => this._borderRight;
 
   /** Sets the value of "border-right" */
-  void set borderRight(String value) {
+  set borderRight(String value) {
     _borderRight = value == null ? '' : value;
   }
   @Returns('String')
@@ -3656,7 +3667,7 @@
   String get borderRightColor => this._borderRightColor;
 
   /** Sets the value of "border-right-color" */
-  void set borderRightColor(String value) {
+  set borderRightColor(String value) {
     _borderRightColor = value == null ? '' : value;
   }
   @Returns('String')
@@ -3667,7 +3678,7 @@
   String get borderRightStyle => this._borderRightStyle;
 
   /** Sets the value of "border-right-style" */
-  void set borderRightStyle(String value) {
+  set borderRightStyle(String value) {
     _borderRightStyle = value == null ? '' : value;
   }
   @Returns('String')
@@ -3678,7 +3689,7 @@
   String get borderRightWidth => this._borderRightWidth;
 
   /** Sets the value of "border-right-width" */
-  void set borderRightWidth(String value) {
+  set borderRightWidth(String value) {
     _borderRightWidth = value == null ? '' : value;
   }
   @Returns('String')
@@ -3689,7 +3700,7 @@
   String get borderSpacing => this._borderSpacing;
 
   /** Sets the value of "border-spacing" */
-  void set borderSpacing(String value) {
+  set borderSpacing(String value) {
     _borderSpacing = value == null ? '' : value;
   }
   @Returns('String')
@@ -3700,7 +3711,7 @@
   String get borderStyle => this._borderStyle;
 
   /** Sets the value of "border-style" */
-  void set borderStyle(String value) {
+  set borderStyle(String value) {
     _borderStyle = value == null ? '' : value;
   }
   @Returns('String')
@@ -3711,7 +3722,7 @@
   String get borderTop => this._borderTop;
 
   /** Sets the value of "border-top" */
-  void set borderTop(String value) {
+  set borderTop(String value) {
     _borderTop = value == null ? '' : value;
   }
   @Returns('String')
@@ -3722,7 +3733,7 @@
   String get borderTopColor => this._borderTopColor;
 
   /** Sets the value of "border-top-color" */
-  void set borderTopColor(String value) {
+  set borderTopColor(String value) {
     _borderTopColor = value == null ? '' : value;
   }
   @Returns('String')
@@ -3733,7 +3744,7 @@
   String get borderTopStyle => this._borderTopStyle;
 
   /** Sets the value of "border-top-style" */
-  void set borderTopStyle(String value) {
+  set borderTopStyle(String value) {
     _borderTopStyle = value == null ? '' : value;
   }
   @Returns('String')
@@ -3744,7 +3755,7 @@
   String get borderTopWidth => this._borderTopWidth;
 
   /** Sets the value of "border-top-width" */
-  void set borderTopWidth(String value) {
+  set borderTopWidth(String value) {
     _borderTopWidth = value == null ? '' : value;
   }
   @Returns('String')
@@ -3755,7 +3766,7 @@
   String get borderWidth => this._borderWidth;
 
   /** Sets the value of "border-width" */
-  void set borderWidth(String value) {
+  set borderWidth(String value) {
     _borderWidth = value == null ? '' : value;
   }
   @Returns('String')
@@ -3766,7 +3777,7 @@
   String get bottom => this._bottom;
 
   /** Sets the value of "bottom" */
-  void set bottom(String value) {
+  set bottom(String value) {
     _bottom = value == null ? '' : value;
   }
   @Returns('String')
@@ -3777,7 +3788,7 @@
   String get captionSide => this._captionSide;
 
   /** Sets the value of "caption-side" */
-  void set captionSide(String value) {
+  set captionSide(String value) {
     _captionSide = value == null ? '' : value;
   }
   @Returns('String')
@@ -3788,7 +3799,7 @@
   String get clear => this._clear;
 
   /** Sets the value of "clear" */
-  void set clear(String value) {
+  set clear(String value) {
     _clear = value == null ? '' : value;
   }
   @Returns('String')
@@ -3799,7 +3810,7 @@
   String get clip => this._clip;
 
   /** Sets the value of "clip" */
-  void set clip(String value) {
+  set clip(String value) {
     _clip = value == null ? '' : value;
   }
   @Returns('String')
@@ -3810,7 +3821,7 @@
   String get color => this._color;
 
   /** Sets the value of "color" */
-  void set color(String value) {
+  set color(String value) {
     _color = value == null ? '' : value;
   }
   @Returns('String')
@@ -3821,7 +3832,7 @@
   String get content => this._content;
 
   /** Sets the value of "content" */
-  void set content(String value) {
+  set content(String value) {
     _content = value == null ? '' : value;
   }
   @Returns('String')
@@ -3832,7 +3843,7 @@
   String get cursor => this._cursor;
 
   /** Sets the value of "cursor" */
-  void set cursor(String value) {
+  set cursor(String value) {
     _cursor = value == null ? '' : value;
   }
   @Returns('String')
@@ -3843,7 +3854,7 @@
   String get direction => this._direction;
 
   /** Sets the value of "direction" */
-  void set direction(String value) {
+  set direction(String value) {
     _direction = value == null ? '' : value;
   }
   @Returns('String')
@@ -3854,7 +3865,7 @@
   String get display => this._display;
 
   /** Sets the value of "display" */
-  void set display(String value) {
+  set display(String value) {
     _display = value == null ? '' : value;
   }
   @Returns('String')
@@ -3865,7 +3876,7 @@
   String get emptyCells => this._emptyCells;
 
   /** Sets the value of "empty-cells" */
-  void set emptyCells(String value) {
+  set emptyCells(String value) {
     _emptyCells = value == null ? '' : value;
   }
   @Returns('String')
@@ -3876,7 +3887,7 @@
   String get font => this._font;
 
   /** Sets the value of "font" */
-  void set font(String value) {
+  set font(String value) {
     _font = value == null ? '' : value;
   }
   @Returns('String')
@@ -3887,7 +3898,7 @@
   String get fontFamily => this._fontFamily;
 
   /** Sets the value of "font-family" */
-  void set fontFamily(String value) {
+  set fontFamily(String value) {
     _fontFamily = value == null ? '' : value;
   }
   @Returns('String')
@@ -3898,7 +3909,7 @@
   String get fontSize => this._fontSize;
 
   /** Sets the value of "font-size" */
-  void set fontSize(String value) {
+  set fontSize(String value) {
     _fontSize = value == null ? '' : value;
   }
   @Returns('String')
@@ -3909,7 +3920,7 @@
   String get fontStyle => this._fontStyle;
 
   /** Sets the value of "font-style" */
-  void set fontStyle(String value) {
+  set fontStyle(String value) {
     _fontStyle = value == null ? '' : value;
   }
   @Returns('String')
@@ -3920,7 +3931,7 @@
   String get fontVariant => this._fontVariant;
 
   /** Sets the value of "font-variant" */
-  void set fontVariant(String value) {
+  set fontVariant(String value) {
     _fontVariant = value == null ? '' : value;
   }
   @Returns('String')
@@ -3931,7 +3942,7 @@
   String get fontWeight => this._fontWeight;
 
   /** Sets the value of "font-weight" */
-  void set fontWeight(String value) {
+  set fontWeight(String value) {
     _fontWeight = value == null ? '' : value;
   }
   @Returns('String')
@@ -3942,7 +3953,7 @@
   String get height => this._height;
 
   /** Sets the value of "height" */
-  void set height(String value) {
+  set height(String value) {
     _height = value == null ? '' : value;
   }
   @Returns('String')
@@ -3953,7 +3964,7 @@
   String get left => this._left;
 
   /** Sets the value of "left" */
-  void set left(String value) {
+  set left(String value) {
     _left = value == null ? '' : value;
   }
   @Returns('String')
@@ -3964,7 +3975,7 @@
   String get letterSpacing => this._letterSpacing;
 
   /** Sets the value of "letter-spacing" */
-  void set letterSpacing(String value) {
+  set letterSpacing(String value) {
     _letterSpacing = value == null ? '' : value;
   }
   @Returns('String')
@@ -3975,7 +3986,7 @@
   String get lineHeight => this._lineHeight;
 
   /** Sets the value of "line-height" */
-  void set lineHeight(String value) {
+  set lineHeight(String value) {
     _lineHeight = value == null ? '' : value;
   }
   @Returns('String')
@@ -3986,7 +3997,7 @@
   String get listStyle => this._listStyle;
 
   /** Sets the value of "list-style" */
-  void set listStyle(String value) {
+  set listStyle(String value) {
     _listStyle = value == null ? '' : value;
   }
   @Returns('String')
@@ -3997,7 +4008,7 @@
   String get listStyleImage => this._listStyleImage;
 
   /** Sets the value of "list-style-image" */
-  void set listStyleImage(String value) {
+  set listStyleImage(String value) {
     _listStyleImage = value == null ? '' : value;
   }
   @Returns('String')
@@ -4008,7 +4019,7 @@
   String get listStylePosition => this._listStylePosition;
 
   /** Sets the value of "list-style-position" */
-  void set listStylePosition(String value) {
+  set listStylePosition(String value) {
     _listStylePosition = value == null ? '' : value;
   }
   @Returns('String')
@@ -4019,7 +4030,7 @@
   String get listStyleType => this._listStyleType;
 
   /** Sets the value of "list-style-type" */
-  void set listStyleType(String value) {
+  set listStyleType(String value) {
     _listStyleType = value == null ? '' : value;
   }
   @Returns('String')
@@ -4030,7 +4041,7 @@
   String get margin => this._margin;
 
   /** Sets the value of "margin" */
-  void set margin(String value) {
+  set margin(String value) {
     _margin = value == null ? '' : value;
   }
   @Returns('String')
@@ -4041,7 +4052,7 @@
   String get marginBottom => this._marginBottom;
 
   /** Sets the value of "margin-bottom" */
-  void set marginBottom(String value) {
+  set marginBottom(String value) {
     _marginBottom = value == null ? '' : value;
   }
   @Returns('String')
@@ -4052,7 +4063,7 @@
   String get marginLeft => this._marginLeft;
 
   /** Sets the value of "margin-left" */
-  void set marginLeft(String value) {
+  set marginLeft(String value) {
     _marginLeft = value == null ? '' : value;
   }
   @Returns('String')
@@ -4063,7 +4074,7 @@
   String get marginRight => this._marginRight;
 
   /** Sets the value of "margin-right" */
-  void set marginRight(String value) {
+  set marginRight(String value) {
     _marginRight = value == null ? '' : value;
   }
   @Returns('String')
@@ -4074,7 +4085,7 @@
   String get marginTop => this._marginTop;
 
   /** Sets the value of "margin-top" */
-  void set marginTop(String value) {
+  set marginTop(String value) {
     _marginTop = value == null ? '' : value;
   }
   @Returns('String')
@@ -4085,7 +4096,7 @@
   String get maxHeight => this._maxHeight;
 
   /** Sets the value of "max-height" */
-  void set maxHeight(String value) {
+  set maxHeight(String value) {
     _maxHeight = value == null ? '' : value;
   }
   @Returns('String')
@@ -4096,7 +4107,7 @@
   String get maxWidth => this._maxWidth;
 
   /** Sets the value of "max-width" */
-  void set maxWidth(String value) {
+  set maxWidth(String value) {
     _maxWidth = value == null ? '' : value;
   }
   @Returns('String')
@@ -4107,7 +4118,7 @@
   String get minHeight => this._minHeight;
 
   /** Sets the value of "min-height" */
-  void set minHeight(String value) {
+  set minHeight(String value) {
     _minHeight = value == null ? '' : value;
   }
   @Returns('String')
@@ -4118,7 +4129,7 @@
   String get minWidth => this._minWidth;
 
   /** Sets the value of "min-width" */
-  void set minWidth(String value) {
+  set minWidth(String value) {
     _minWidth = value == null ? '' : value;
   }
   @Returns('String')
@@ -4129,7 +4140,7 @@
   String get outline => this._outline;
 
   /** Sets the value of "outline" */
-  void set outline(String value) {
+  set outline(String value) {
     _outline = value == null ? '' : value;
   }
   @Returns('String')
@@ -4140,7 +4151,7 @@
   String get outlineColor => this._outlineColor;
 
   /** Sets the value of "outline-color" */
-  void set outlineColor(String value) {
+  set outlineColor(String value) {
     _outlineColor = value == null ? '' : value;
   }
   @Returns('String')
@@ -4151,7 +4162,7 @@
   String get outlineStyle => this._outlineStyle;
 
   /** Sets the value of "outline-style" */
-  void set outlineStyle(String value) {
+  set outlineStyle(String value) {
     _outlineStyle = value == null ? '' : value;
   }
   @Returns('String')
@@ -4162,7 +4173,7 @@
   String get outlineWidth => this._outlineWidth;
 
   /** Sets the value of "outline-width" */
-  void set outlineWidth(String value) {
+  set outlineWidth(String value) {
     _outlineWidth = value == null ? '' : value;
   }
   @Returns('String')
@@ -4173,7 +4184,7 @@
   String get overflow => this._overflow;
 
   /** Sets the value of "overflow" */
-  void set overflow(String value) {
+  set overflow(String value) {
     _overflow = value == null ? '' : value;
   }
   @Returns('String')
@@ -4184,7 +4195,7 @@
   String get padding => this._padding;
 
   /** Sets the value of "padding" */
-  void set padding(String value) {
+  set padding(String value) {
     _padding = value == null ? '' : value;
   }
   @Returns('String')
@@ -4195,7 +4206,7 @@
   String get paddingBottom => this._paddingBottom;
 
   /** Sets the value of "padding-bottom" */
-  void set paddingBottom(String value) {
+  set paddingBottom(String value) {
     _paddingBottom = value == null ? '' : value;
   }
   @Returns('String')
@@ -4206,7 +4217,7 @@
   String get paddingLeft => this._paddingLeft;
 
   /** Sets the value of "padding-left" */
-  void set paddingLeft(String value) {
+  set paddingLeft(String value) {
     _paddingLeft = value == null ? '' : value;
   }
   @Returns('String')
@@ -4217,7 +4228,7 @@
   String get paddingRight => this._paddingRight;
 
   /** Sets the value of "padding-right" */
-  void set paddingRight(String value) {
+  set paddingRight(String value) {
     _paddingRight = value == null ? '' : value;
   }
   @Returns('String')
@@ -4228,7 +4239,7 @@
   String get paddingTop => this._paddingTop;
 
   /** Sets the value of "padding-top" */
-  void set paddingTop(String value) {
+  set paddingTop(String value) {
     _paddingTop = value == null ? '' : value;
   }
   @Returns('String')
@@ -4239,7 +4250,7 @@
   String get pageBreakAfter => this._pageBreakAfter;
 
   /** Sets the value of "page-break-after" */
-  void set pageBreakAfter(String value) {
+  set pageBreakAfter(String value) {
     _pageBreakAfter = value == null ? '' : value;
   }
   @Returns('String')
@@ -4250,7 +4261,7 @@
   String get pageBreakBefore => this._pageBreakBefore;
 
   /** Sets the value of "page-break-before" */
-  void set pageBreakBefore(String value) {
+  set pageBreakBefore(String value) {
     _pageBreakBefore = value == null ? '' : value;
   }
   @Returns('String')
@@ -4261,7 +4272,7 @@
   String get pageBreakInside => this._pageBreakInside;
 
   /** Sets the value of "page-break-inside" */
-  void set pageBreakInside(String value) {
+  set pageBreakInside(String value) {
     _pageBreakInside = value == null ? '' : value;
   }
   @Returns('String')
@@ -4272,7 +4283,7 @@
   String get position => this._position;
 
   /** Sets the value of "position" */
-  void set position(String value) {
+  set position(String value) {
     _position = value == null ? '' : value;
   }
   @Returns('String')
@@ -4283,7 +4294,7 @@
   String get quotes => this._quotes;
 
   /** Sets the value of "quotes" */
-  void set quotes(String value) {
+  set quotes(String value) {
     _quotes = value == null ? '' : value;
   }
   @Returns('String')
@@ -4294,7 +4305,7 @@
   String get right => this._right;
 
   /** Sets the value of "right" */
-  void set right(String value) {
+  set right(String value) {
     _right = value == null ? '' : value;
   }
   @Returns('String')
@@ -4305,7 +4316,7 @@
   String get tableLayout => this._tableLayout;
 
   /** Sets the value of "table-layout" */
-  void set tableLayout(String value) {
+  set tableLayout(String value) {
     _tableLayout = value == null ? '' : value;
   }
   @Returns('String')
@@ -4316,7 +4327,7 @@
   String get textAlign => this._textAlign;
 
   /** Sets the value of "text-align" */
-  void set textAlign(String value) {
+  set textAlign(String value) {
     _textAlign = value == null ? '' : value;
   }
   @Returns('String')
@@ -4327,7 +4338,7 @@
   String get textDecoration => this._textDecoration;
 
   /** Sets the value of "text-decoration" */
-  void set textDecoration(String value) {
+  set textDecoration(String value) {
     _textDecoration = value == null ? '' : value;
   }
   @Returns('String')
@@ -4338,7 +4349,7 @@
   String get textIndent => this._textIndent;
 
   /** Sets the value of "text-indent" */
-  void set textIndent(String value) {
+  set textIndent(String value) {
     _textIndent = value == null ? '' : value;
   }
   @Returns('String')
@@ -4349,7 +4360,7 @@
   String get textTransform => this._textTransform;
 
   /** Sets the value of "text-transform" */
-  void set textTransform(String value) {
+  set textTransform(String value) {
     _textTransform = value == null ? '' : value;
   }
   @Returns('String')
@@ -4360,7 +4371,7 @@
   String get top => this._top;
 
   /** Sets the value of "top" */
-  void set top(String value) {
+  set top(String value) {
     _top = value == null ? '' : value;
   }
   @Returns('String')
@@ -4371,7 +4382,7 @@
   String get unicodeBidi => this._unicodeBidi;
 
   /** Sets the value of "unicode-bidi" */
-  void set unicodeBidi(String value) {
+  set unicodeBidi(String value) {
     _unicodeBidi = value == null ? '' : value;
   }
   @Returns('String')
@@ -4382,7 +4393,7 @@
   String get verticalAlign => this._verticalAlign;
 
   /** Sets the value of "vertical-align" */
-  void set verticalAlign(String value) {
+  set verticalAlign(String value) {
     _verticalAlign = value == null ? '' : value;
   }
   @Returns('String')
@@ -4393,7 +4404,7 @@
   String get visibility => this._visibility;
 
   /** Sets the value of "visibility" */
-  void set visibility(String value) {
+  set visibility(String value) {
     _visibility = value == null ? '' : value;
   }
   @Returns('String')
@@ -4404,7 +4415,7 @@
   String get whiteSpace => this._whiteSpace;
 
   /** Sets the value of "white-space" */
-  void set whiteSpace(String value) {
+  set whiteSpace(String value) {
     _whiteSpace = value == null ? '' : value;
   }
   @Returns('String')
@@ -4415,7 +4426,7 @@
   String get width => this._width;
 
   /** Sets the value of "width" */
-  void set width(String value) {
+  set width(String value) {
     _width = value == null ? '' : value;
   }
   @Returns('String')
@@ -4426,7 +4437,7 @@
   String get wordSpacing => this._wordSpacing;
 
   /** Sets the value of "word-spacing" */
-  void set wordSpacing(String value) {
+  set wordSpacing(String value) {
     _wordSpacing = value == null ? '' : value;
   }
   @Returns('String')
@@ -4437,7 +4448,7 @@
   String get zIndex => this._zIndex;
 
   /** Sets the value of "z-index" */
-  void set zIndex(String value) {
+  set zIndex(String value) {
     _zIndex = value == null ? '' : value;
   }
   @Returns('String')
@@ -4473,452 +4484,452 @@
   }
 
   /** Sets the value of "background" */
-  void set background(String value) {
+  set background(String value) {
     _setAll('background', value);
   }
     
   /** Sets the value of "background-attachment" */
-  void set backgroundAttachment(String value) {
+  set backgroundAttachment(String value) {
     _setAll('backgroundAttachment', value);
   }
     
   /** Sets the value of "background-color" */
-  void set backgroundColor(String value) {
+  set backgroundColor(String value) {
     _setAll('backgroundColor', value);
   }
     
   /** Sets the value of "background-image" */
-  void set backgroundImage(String value) {
+  set backgroundImage(String value) {
     _setAll('backgroundImage', value);
   }
     
   /** Sets the value of "background-position" */
-  void set backgroundPosition(String value) {
+  set backgroundPosition(String value) {
     _setAll('backgroundPosition', value);
   }
     
   /** Sets the value of "background-repeat" */
-  void set backgroundRepeat(String value) {
+  set backgroundRepeat(String value) {
     _setAll('backgroundRepeat', value);
   }
     
   /** Sets the value of "border" */
-  void set border(String value) {
+  set border(String value) {
     _setAll('border', value);
   }
     
   /** Sets the value of "border-bottom" */
-  void set borderBottom(String value) {
+  set borderBottom(String value) {
     _setAll('borderBottom', value);
   }
     
   /** Sets the value of "border-bottom-color" */
-  void set borderBottomColor(String value) {
+  set borderBottomColor(String value) {
     _setAll('borderBottomColor', value);
   }
     
   /** Sets the value of "border-bottom-style" */
-  void set borderBottomStyle(String value) {
+  set borderBottomStyle(String value) {
     _setAll('borderBottomStyle', value);
   }
     
   /** Sets the value of "border-bottom-width" */
-  void set borderBottomWidth(String value) {
+  set borderBottomWidth(String value) {
     _setAll('borderBottomWidth', value);
   }
     
   /** Sets the value of "border-collapse" */
-  void set borderCollapse(String value) {
+  set borderCollapse(String value) {
     _setAll('borderCollapse', value);
   }
     
   /** Sets the value of "border-color" */
-  void set borderColor(String value) {
+  set borderColor(String value) {
     _setAll('borderColor', value);
   }
     
   /** Sets the value of "border-left" */
-  void set borderLeft(String value) {
+  set borderLeft(String value) {
     _setAll('borderLeft', value);
   }
     
   /** Sets the value of "border-left-color" */
-  void set borderLeftColor(String value) {
+  set borderLeftColor(String value) {
     _setAll('borderLeftColor', value);
   }
     
   /** Sets the value of "border-left-style" */
-  void set borderLeftStyle(String value) {
+  set borderLeftStyle(String value) {
     _setAll('borderLeftStyle', value);
   }
     
   /** Sets the value of "border-left-width" */
-  void set borderLeftWidth(String value) {
+  set borderLeftWidth(String value) {
     _setAll('borderLeftWidth', value);
   }
     
   /** Sets the value of "border-right" */
-  void set borderRight(String value) {
+  set borderRight(String value) {
     _setAll('borderRight', value);
   }
     
   /** Sets the value of "border-right-color" */
-  void set borderRightColor(String value) {
+  set borderRightColor(String value) {
     _setAll('borderRightColor', value);
   }
     
   /** Sets the value of "border-right-style" */
-  void set borderRightStyle(String value) {
+  set borderRightStyle(String value) {
     _setAll('borderRightStyle', value);
   }
     
   /** Sets the value of "border-right-width" */
-  void set borderRightWidth(String value) {
+  set borderRightWidth(String value) {
     _setAll('borderRightWidth', value);
   }
     
   /** Sets the value of "border-spacing" */
-  void set borderSpacing(String value) {
+  set borderSpacing(String value) {
     _setAll('borderSpacing', value);
   }
     
   /** Sets the value of "border-style" */
-  void set borderStyle(String value) {
+  set borderStyle(String value) {
     _setAll('borderStyle', value);
   }
     
   /** Sets the value of "border-top" */
-  void set borderTop(String value) {
+  set borderTop(String value) {
     _setAll('borderTop', value);
   }
     
   /** Sets the value of "border-top-color" */
-  void set borderTopColor(String value) {
+  set borderTopColor(String value) {
     _setAll('borderTopColor', value);
   }
     
   /** Sets the value of "border-top-style" */
-  void set borderTopStyle(String value) {
+  set borderTopStyle(String value) {
     _setAll('borderTopStyle', value);
   }
     
   /** Sets the value of "border-top-width" */
-  void set borderTopWidth(String value) {
+  set borderTopWidth(String value) {
     _setAll('borderTopWidth', value);
   }
     
   /** Sets the value of "border-width" */
-  void set borderWidth(String value) {
+  set borderWidth(String value) {
     _setAll('borderWidth', value);
   }
     
   /** Sets the value of "bottom" */
-  void set bottom(String value) {
+  set bottom(String value) {
     _setAll('bottom', value);
   }
     
   /** Sets the value of "caption-side" */
-  void set captionSide(String value) {
+  set captionSide(String value) {
     _setAll('captionSide', value);
   }
     
   /** Sets the value of "clear" */
-  void set clear(String value) {
+  set clear(String value) {
     _setAll('clear', value);
   }
     
   /** Sets the value of "clip" */
-  void set clip(String value) {
+  set clip(String value) {
     _setAll('clip', value);
   }
     
   /** Sets the value of "color" */
-  void set color(String value) {
+  set color(String value) {
     _setAll('color', value);
   }
     
   /** Sets the value of "content" */
-  void set content(String value) {
+  set content(String value) {
     _setAll('content', value);
   }
     
   /** Sets the value of "cursor" */
-  void set cursor(String value) {
+  set cursor(String value) {
     _setAll('cursor', value);
   }
     
   /** Sets the value of "direction" */
-  void set direction(String value) {
+  set direction(String value) {
     _setAll('direction', value);
   }
     
   /** Sets the value of "display" */
-  void set display(String value) {
+  set display(String value) {
     _setAll('display', value);
   }
     
   /** Sets the value of "empty-cells" */
-  void set emptyCells(String value) {
+  set emptyCells(String value) {
     _setAll('emptyCells', value);
   }
     
   /** Sets the value of "font" */
-  void set font(String value) {
+  set font(String value) {
     _setAll('font', value);
   }
     
   /** Sets the value of "font-family" */
-  void set fontFamily(String value) {
+  set fontFamily(String value) {
     _setAll('fontFamily', value);
   }
     
   /** Sets the value of "font-size" */
-  void set fontSize(String value) {
+  set fontSize(String value) {
     _setAll('fontSize', value);
   }
     
   /** Sets the value of "font-style" */
-  void set fontStyle(String value) {
+  set fontStyle(String value) {
     _setAll('fontStyle', value);
   }
     
   /** Sets the value of "font-variant" */
-  void set fontVariant(String value) {
+  set fontVariant(String value) {
     _setAll('fontVariant', value);
   }
     
   /** Sets the value of "font-weight" */
-  void set fontWeight(String value) {
+  set fontWeight(String value) {
     _setAll('fontWeight', value);
   }
     
   /** Sets the value of "height" */
-  void set height(String value) {
+  set height(String value) {
     _setAll('height', value);
   }
     
   /** Sets the value of "left" */
-  void set left(String value) {
+  set left(String value) {
     _setAll('left', value);
   }
     
   /** Sets the value of "letter-spacing" */
-  void set letterSpacing(String value) {
+  set letterSpacing(String value) {
     _setAll('letterSpacing', value);
   }
     
   /** Sets the value of "line-height" */
-  void set lineHeight(String value) {
+  set lineHeight(String value) {
     _setAll('lineHeight', value);
   }
     
   /** Sets the value of "list-style" */
-  void set listStyle(String value) {
+  set listStyle(String value) {
     _setAll('listStyle', value);
   }
     
   /** Sets the value of "list-style-image" */
-  void set listStyleImage(String value) {
+  set listStyleImage(String value) {
     _setAll('listStyleImage', value);
   }
     
   /** Sets the value of "list-style-position" */
-  void set listStylePosition(String value) {
+  set listStylePosition(String value) {
     _setAll('listStylePosition', value);
   }
     
   /** Sets the value of "list-style-type" */
-  void set listStyleType(String value) {
+  set listStyleType(String value) {
     _setAll('listStyleType', value);
   }
     
   /** Sets the value of "margin" */
-  void set margin(String value) {
+  set margin(String value) {
     _setAll('margin', value);
   }
     
   /** Sets the value of "margin-bottom" */
-  void set marginBottom(String value) {
+  set marginBottom(String value) {
     _setAll('marginBottom', value);
   }
     
   /** Sets the value of "margin-left" */
-  void set marginLeft(String value) {
+  set marginLeft(String value) {
     _setAll('marginLeft', value);
   }
     
   /** Sets the value of "margin-right" */
-  void set marginRight(String value) {
+  set marginRight(String value) {
     _setAll('marginRight', value);
   }
     
   /** Sets the value of "margin-top" */
-  void set marginTop(String value) {
+  set marginTop(String value) {
     _setAll('marginTop', value);
   }
     
   /** Sets the value of "max-height" */
-  void set maxHeight(String value) {
+  set maxHeight(String value) {
     _setAll('maxHeight', value);
   }
     
   /** Sets the value of "max-width" */
-  void set maxWidth(String value) {
+  set maxWidth(String value) {
     _setAll('maxWidth', value);
   }
     
   /** Sets the value of "min-height" */
-  void set minHeight(String value) {
+  set minHeight(String value) {
     _setAll('minHeight', value);
   }
     
   /** Sets the value of "min-width" */
-  void set minWidth(String value) {
+  set minWidth(String value) {
     _setAll('minWidth', value);
   }
     
   /** Sets the value of "outline" */
-  void set outline(String value) {
+  set outline(String value) {
     _setAll('outline', value);
   }
     
   /** Sets the value of "outline-color" */
-  void set outlineColor(String value) {
+  set outlineColor(String value) {
     _setAll('outlineColor', value);
   }
     
   /** Sets the value of "outline-style" */
-  void set outlineStyle(String value) {
+  set outlineStyle(String value) {
     _setAll('outlineStyle', value);
   }
     
   /** Sets the value of "outline-width" */
-  void set outlineWidth(String value) {
+  set outlineWidth(String value) {
     _setAll('outlineWidth', value);
   }
     
   /** Sets the value of "overflow" */
-  void set overflow(String value) {
+  set overflow(String value) {
     _setAll('overflow', value);
   }
     
   /** Sets the value of "padding" */
-  void set padding(String value) {
+  set padding(String value) {
     _setAll('padding', value);
   }
     
   /** Sets the value of "padding-bottom" */
-  void set paddingBottom(String value) {
+  set paddingBottom(String value) {
     _setAll('paddingBottom', value);
   }
     
   /** Sets the value of "padding-left" */
-  void set paddingLeft(String value) {
+  set paddingLeft(String value) {
     _setAll('paddingLeft', value);
   }
     
   /** Sets the value of "padding-right" */
-  void set paddingRight(String value) {
+  set paddingRight(String value) {
     _setAll('paddingRight', value);
   }
     
   /** Sets the value of "padding-top" */
-  void set paddingTop(String value) {
+  set paddingTop(String value) {
     _setAll('paddingTop', value);
   }
     
   /** Sets the value of "page-break-after" */
-  void set pageBreakAfter(String value) {
+  set pageBreakAfter(String value) {
     _setAll('pageBreakAfter', value);
   }
     
   /** Sets the value of "page-break-before" */
-  void set pageBreakBefore(String value) {
+  set pageBreakBefore(String value) {
     _setAll('pageBreakBefore', value);
   }
     
   /** Sets the value of "page-break-inside" */
-  void set pageBreakInside(String value) {
+  set pageBreakInside(String value) {
     _setAll('pageBreakInside', value);
   }
     
   /** Sets the value of "position" */
-  void set position(String value) {
+  set position(String value) {
     _setAll('position', value);
   }
     
   /** Sets the value of "quotes" */
-  void set quotes(String value) {
+  set quotes(String value) {
     _setAll('quotes', value);
   }
     
   /** Sets the value of "right" */
-  void set right(String value) {
+  set right(String value) {
     _setAll('right', value);
   }
     
   /** Sets the value of "table-layout" */
-  void set tableLayout(String value) {
+  set tableLayout(String value) {
     _setAll('tableLayout', value);
   }
     
   /** Sets the value of "text-align" */
-  void set textAlign(String value) {
+  set textAlign(String value) {
     _setAll('textAlign', value);
   }
     
   /** Sets the value of "text-decoration" */
-  void set textDecoration(String value) {
+  set textDecoration(String value) {
     _setAll('textDecoration', value);
   }
     
   /** Sets the value of "text-indent" */
-  void set textIndent(String value) {
+  set textIndent(String value) {
     _setAll('textIndent', value);
   }
     
   /** Sets the value of "text-transform" */
-  void set textTransform(String value) {
+  set textTransform(String value) {
     _setAll('textTransform', value);
   }
     
   /** Sets the value of "top" */
-  void set top(String value) {
+  set top(String value) {
     _setAll('top', value);
   }
     
   /** Sets the value of "unicode-bidi" */
-  void set unicodeBidi(String value) {
+  set unicodeBidi(String value) {
     _setAll('unicodeBidi', value);
   }
     
   /** Sets the value of "vertical-align" */
-  void set verticalAlign(String value) {
+  set verticalAlign(String value) {
     _setAll('verticalAlign', value);
   }
     
   /** Sets the value of "visibility" */
-  void set visibility(String value) {
+  set visibility(String value) {
     _setAll('visibility', value);
   }
     
   /** Sets the value of "white-space" */
-  void set whiteSpace(String value) {
+  set whiteSpace(String value) {
     _setAll('whiteSpace', value);
   }
     
   /** Sets the value of "width" */
-  void set width(String value) {
+  set width(String value) {
     _setAll('width', value);
   }
     
   /** Sets the value of "word-spacing" */
-  void set wordSpacing(String value) {
+  set wordSpacing(String value) {
     _setAll('wordSpacing', value);
   }
     
   /** Sets the value of "z-index" */
-  void set zIndex(String value) {
+  set zIndex(String value) {
     _setAll('zIndex', value);
   }
     
@@ -4939,7 +4950,7 @@
     getPropertyValue('align-content');
 
   /** Sets the value of "align-content" */
-  void set alignContent(String value) {
+  set alignContent(String value) {
     setProperty('align-content', value, '');
   }
 
@@ -4948,7 +4959,7 @@
     getPropertyValue('align-items');
 
   /** Sets the value of "align-items" */
-  void set alignItems(String value) {
+  set alignItems(String value) {
     setProperty('align-items', value, '');
   }
 
@@ -4957,7 +4968,7 @@
     getPropertyValue('align-self');
 
   /** Sets the value of "align-self" */
-  void set alignSelf(String value) {
+  set alignSelf(String value) {
     setProperty('align-self', value, '');
   }
 
@@ -4966,7 +4977,7 @@
     getPropertyValue('animation');
 
   /** Sets the value of "animation" */
-  void set animation(String value) {
+  set animation(String value) {
     setProperty('animation', value, '');
   }
 
@@ -4975,7 +4986,7 @@
     getPropertyValue('animation-delay');
 
   /** Sets the value of "animation-delay" */
-  void set animationDelay(String value) {
+  set animationDelay(String value) {
     setProperty('animation-delay', value, '');
   }
 
@@ -4984,7 +4995,7 @@
     getPropertyValue('animation-direction');
 
   /** Sets the value of "animation-direction" */
-  void set animationDirection(String value) {
+  set animationDirection(String value) {
     setProperty('animation-direction', value, '');
   }
 
@@ -4993,7 +5004,7 @@
     getPropertyValue('animation-duration');
 
   /** Sets the value of "animation-duration" */
-  void set animationDuration(String value) {
+  set animationDuration(String value) {
     setProperty('animation-duration', value, '');
   }
 
@@ -5002,7 +5013,7 @@
     getPropertyValue('animation-fill-mode');
 
   /** Sets the value of "animation-fill-mode" */
-  void set animationFillMode(String value) {
+  set animationFillMode(String value) {
     setProperty('animation-fill-mode', value, '');
   }
 
@@ -5011,7 +5022,7 @@
     getPropertyValue('animation-iteration-count');
 
   /** Sets the value of "animation-iteration-count" */
-  void set animationIterationCount(String value) {
+  set animationIterationCount(String value) {
     setProperty('animation-iteration-count', value, '');
   }
 
@@ -5020,7 +5031,7 @@
     getPropertyValue('animation-name');
 
   /** Sets the value of "animation-name" */
-  void set animationName(String value) {
+  set animationName(String value) {
     setProperty('animation-name', value, '');
   }
 
@@ -5029,7 +5040,7 @@
     getPropertyValue('animation-play-state');
 
   /** Sets the value of "animation-play-state" */
-  void set animationPlayState(String value) {
+  set animationPlayState(String value) {
     setProperty('animation-play-state', value, '');
   }
 
@@ -5038,7 +5049,7 @@
     getPropertyValue('animation-timing-function');
 
   /** Sets the value of "animation-timing-function" */
-  void set animationTimingFunction(String value) {
+  set animationTimingFunction(String value) {
     setProperty('animation-timing-function', value, '');
   }
 
@@ -5047,7 +5058,7 @@
     getPropertyValue('app-region');
 
   /** Sets the value of "app-region" */
-  void set appRegion(String value) {
+  set appRegion(String value) {
     setProperty('app-region', value, '');
   }
 
@@ -5056,7 +5067,7 @@
     getPropertyValue('appearance');
 
   /** Sets the value of "appearance" */
-  void set appearance(String value) {
+  set appearance(String value) {
     setProperty('appearance', value, '');
   }
 
@@ -5065,7 +5076,7 @@
     getPropertyValue('aspect-ratio');
 
   /** Sets the value of "aspect-ratio" */
-  void set aspectRatio(String value) {
+  set aspectRatio(String value) {
     setProperty('aspect-ratio', value, '');
   }
 
@@ -5074,7 +5085,7 @@
     getPropertyValue('backface-visibility');
 
   /** Sets the value of "backface-visibility" */
-  void set backfaceVisibility(String value) {
+  set backfaceVisibility(String value) {
     setProperty('backface-visibility', value, '');
   }
 
@@ -5083,7 +5094,7 @@
     getPropertyValue('background');
 
   /** Sets the value of "background" */
-  void set background(String value) {
+  set background(String value) {
     setProperty('background', value, '');
   }
 
@@ -5092,7 +5103,7 @@
     getPropertyValue('background-attachment');
 
   /** Sets the value of "background-attachment" */
-  void set backgroundAttachment(String value) {
+  set backgroundAttachment(String value) {
     setProperty('background-attachment', value, '');
   }
 
@@ -5101,7 +5112,7 @@
     getPropertyValue('background-blend-mode');
 
   /** Sets the value of "background-blend-mode" */
-  void set backgroundBlendMode(String value) {
+  set backgroundBlendMode(String value) {
     setProperty('background-blend-mode', value, '');
   }
 
@@ -5110,7 +5121,7 @@
     getPropertyValue('background-clip');
 
   /** Sets the value of "background-clip" */
-  void set backgroundClip(String value) {
+  set backgroundClip(String value) {
     setProperty('background-clip', value, '');
   }
 
@@ -5119,7 +5130,7 @@
     getPropertyValue('background-color');
 
   /** Sets the value of "background-color" */
-  void set backgroundColor(String value) {
+  set backgroundColor(String value) {
     setProperty('background-color', value, '');
   }
 
@@ -5128,7 +5139,7 @@
     getPropertyValue('background-composite');
 
   /** Sets the value of "background-composite" */
-  void set backgroundComposite(String value) {
+  set backgroundComposite(String value) {
     setProperty('background-composite', value, '');
   }
 
@@ -5137,7 +5148,7 @@
     getPropertyValue('background-image');
 
   /** Sets the value of "background-image" */
-  void set backgroundImage(String value) {
+  set backgroundImage(String value) {
     setProperty('background-image', value, '');
   }
 
@@ -5146,7 +5157,7 @@
     getPropertyValue('background-origin');
 
   /** Sets the value of "background-origin" */
-  void set backgroundOrigin(String value) {
+  set backgroundOrigin(String value) {
     setProperty('background-origin', value, '');
   }
 
@@ -5155,7 +5166,7 @@
     getPropertyValue('background-position');
 
   /** Sets the value of "background-position" */
-  void set backgroundPosition(String value) {
+  set backgroundPosition(String value) {
     setProperty('background-position', value, '');
   }
 
@@ -5164,7 +5175,7 @@
     getPropertyValue('background-position-x');
 
   /** Sets the value of "background-position-x" */
-  void set backgroundPositionX(String value) {
+  set backgroundPositionX(String value) {
     setProperty('background-position-x', value, '');
   }
 
@@ -5173,7 +5184,7 @@
     getPropertyValue('background-position-y');
 
   /** Sets the value of "background-position-y" */
-  void set backgroundPositionY(String value) {
+  set backgroundPositionY(String value) {
     setProperty('background-position-y', value, '');
   }
 
@@ -5182,7 +5193,7 @@
     getPropertyValue('background-repeat');
 
   /** Sets the value of "background-repeat" */
-  void set backgroundRepeat(String value) {
+  set backgroundRepeat(String value) {
     setProperty('background-repeat', value, '');
   }
 
@@ -5191,7 +5202,7 @@
     getPropertyValue('background-repeat-x');
 
   /** Sets the value of "background-repeat-x" */
-  void set backgroundRepeatX(String value) {
+  set backgroundRepeatX(String value) {
     setProperty('background-repeat-x', value, '');
   }
 
@@ -5200,7 +5211,7 @@
     getPropertyValue('background-repeat-y');
 
   /** Sets the value of "background-repeat-y" */
-  void set backgroundRepeatY(String value) {
+  set backgroundRepeatY(String value) {
     setProperty('background-repeat-y', value, '');
   }
 
@@ -5209,7 +5220,7 @@
     getPropertyValue('background-size');
 
   /** Sets the value of "background-size" */
-  void set backgroundSize(String value) {
+  set backgroundSize(String value) {
     setProperty('background-size', value, '');
   }
 
@@ -5218,7 +5229,7 @@
     getPropertyValue('border');
 
   /** Sets the value of "border" */
-  void set border(String value) {
+  set border(String value) {
     setProperty('border', value, '');
   }
 
@@ -5227,7 +5238,7 @@
     getPropertyValue('border-after');
 
   /** Sets the value of "border-after" */
-  void set borderAfter(String value) {
+  set borderAfter(String value) {
     setProperty('border-after', value, '');
   }
 
@@ -5236,7 +5247,7 @@
     getPropertyValue('border-after-color');
 
   /** Sets the value of "border-after-color" */
-  void set borderAfterColor(String value) {
+  set borderAfterColor(String value) {
     setProperty('border-after-color', value, '');
   }
 
@@ -5245,7 +5256,7 @@
     getPropertyValue('border-after-style');
 
   /** Sets the value of "border-after-style" */
-  void set borderAfterStyle(String value) {
+  set borderAfterStyle(String value) {
     setProperty('border-after-style', value, '');
   }
 
@@ -5254,7 +5265,7 @@
     getPropertyValue('border-after-width');
 
   /** Sets the value of "border-after-width" */
-  void set borderAfterWidth(String value) {
+  set borderAfterWidth(String value) {
     setProperty('border-after-width', value, '');
   }
 
@@ -5263,7 +5274,7 @@
     getPropertyValue('border-before');
 
   /** Sets the value of "border-before" */
-  void set borderBefore(String value) {
+  set borderBefore(String value) {
     setProperty('border-before', value, '');
   }
 
@@ -5272,7 +5283,7 @@
     getPropertyValue('border-before-color');
 
   /** Sets the value of "border-before-color" */
-  void set borderBeforeColor(String value) {
+  set borderBeforeColor(String value) {
     setProperty('border-before-color', value, '');
   }
 
@@ -5281,7 +5292,7 @@
     getPropertyValue('border-before-style');
 
   /** Sets the value of "border-before-style" */
-  void set borderBeforeStyle(String value) {
+  set borderBeforeStyle(String value) {
     setProperty('border-before-style', value, '');
   }
 
@@ -5290,7 +5301,7 @@
     getPropertyValue('border-before-width');
 
   /** Sets the value of "border-before-width" */
-  void set borderBeforeWidth(String value) {
+  set borderBeforeWidth(String value) {
     setProperty('border-before-width', value, '');
   }
 
@@ -5299,7 +5310,7 @@
     getPropertyValue('border-bottom');
 
   /** Sets the value of "border-bottom" */
-  void set borderBottom(String value) {
+  set borderBottom(String value) {
     setProperty('border-bottom', value, '');
   }
 
@@ -5308,7 +5319,7 @@
     getPropertyValue('border-bottom-color');
 
   /** Sets the value of "border-bottom-color" */
-  void set borderBottomColor(String value) {
+  set borderBottomColor(String value) {
     setProperty('border-bottom-color', value, '');
   }
 
@@ -5317,7 +5328,7 @@
     getPropertyValue('border-bottom-left-radius');
 
   /** Sets the value of "border-bottom-left-radius" */
-  void set borderBottomLeftRadius(String value) {
+  set borderBottomLeftRadius(String value) {
     setProperty('border-bottom-left-radius', value, '');
   }
 
@@ -5326,7 +5337,7 @@
     getPropertyValue('border-bottom-right-radius');
 
   /** Sets the value of "border-bottom-right-radius" */
-  void set borderBottomRightRadius(String value) {
+  set borderBottomRightRadius(String value) {
     setProperty('border-bottom-right-radius', value, '');
   }
 
@@ -5335,7 +5346,7 @@
     getPropertyValue('border-bottom-style');
 
   /** Sets the value of "border-bottom-style" */
-  void set borderBottomStyle(String value) {
+  set borderBottomStyle(String value) {
     setProperty('border-bottom-style', value, '');
   }
 
@@ -5344,7 +5355,7 @@
     getPropertyValue('border-bottom-width');
 
   /** Sets the value of "border-bottom-width" */
-  void set borderBottomWidth(String value) {
+  set borderBottomWidth(String value) {
     setProperty('border-bottom-width', value, '');
   }
 
@@ -5353,7 +5364,7 @@
     getPropertyValue('border-collapse');
 
   /** Sets the value of "border-collapse" */
-  void set borderCollapse(String value) {
+  set borderCollapse(String value) {
     setProperty('border-collapse', value, '');
   }
 
@@ -5362,7 +5373,7 @@
     getPropertyValue('border-color');
 
   /** Sets the value of "border-color" */
-  void set borderColor(String value) {
+  set borderColor(String value) {
     setProperty('border-color', value, '');
   }
 
@@ -5371,7 +5382,7 @@
     getPropertyValue('border-end');
 
   /** Sets the value of "border-end" */
-  void set borderEnd(String value) {
+  set borderEnd(String value) {
     setProperty('border-end', value, '');
   }
 
@@ -5380,7 +5391,7 @@
     getPropertyValue('border-end-color');
 
   /** Sets the value of "border-end-color" */
-  void set borderEndColor(String value) {
+  set borderEndColor(String value) {
     setProperty('border-end-color', value, '');
   }
 
@@ -5389,7 +5400,7 @@
     getPropertyValue('border-end-style');
 
   /** Sets the value of "border-end-style" */
-  void set borderEndStyle(String value) {
+  set borderEndStyle(String value) {
     setProperty('border-end-style', value, '');
   }
 
@@ -5398,7 +5409,7 @@
     getPropertyValue('border-end-width');
 
   /** Sets the value of "border-end-width" */
-  void set borderEndWidth(String value) {
+  set borderEndWidth(String value) {
     setProperty('border-end-width', value, '');
   }
 
@@ -5407,7 +5418,7 @@
     getPropertyValue('border-fit');
 
   /** Sets the value of "border-fit" */
-  void set borderFit(String value) {
+  set borderFit(String value) {
     setProperty('border-fit', value, '');
   }
 
@@ -5416,7 +5427,7 @@
     getPropertyValue('border-horizontal-spacing');
 
   /** Sets the value of "border-horizontal-spacing" */
-  void set borderHorizontalSpacing(String value) {
+  set borderHorizontalSpacing(String value) {
     setProperty('border-horizontal-spacing', value, '');
   }
 
@@ -5425,7 +5436,7 @@
     getPropertyValue('border-image');
 
   /** Sets the value of "border-image" */
-  void set borderImage(String value) {
+  set borderImage(String value) {
     setProperty('border-image', value, '');
   }
 
@@ -5434,7 +5445,7 @@
     getPropertyValue('border-image-outset');
 
   /** Sets the value of "border-image-outset" */
-  void set borderImageOutset(String value) {
+  set borderImageOutset(String value) {
     setProperty('border-image-outset', value, '');
   }
 
@@ -5443,7 +5454,7 @@
     getPropertyValue('border-image-repeat');
 
   /** Sets the value of "border-image-repeat" */
-  void set borderImageRepeat(String value) {
+  set borderImageRepeat(String value) {
     setProperty('border-image-repeat', value, '');
   }
 
@@ -5452,7 +5463,7 @@
     getPropertyValue('border-image-slice');
 
   /** Sets the value of "border-image-slice" */
-  void set borderImageSlice(String value) {
+  set borderImageSlice(String value) {
     setProperty('border-image-slice', value, '');
   }
 
@@ -5461,7 +5472,7 @@
     getPropertyValue('border-image-source');
 
   /** Sets the value of "border-image-source" */
-  void set borderImageSource(String value) {
+  set borderImageSource(String value) {
     setProperty('border-image-source', value, '');
   }
 
@@ -5470,7 +5481,7 @@
     getPropertyValue('border-image-width');
 
   /** Sets the value of "border-image-width" */
-  void set borderImageWidth(String value) {
+  set borderImageWidth(String value) {
     setProperty('border-image-width', value, '');
   }
 
@@ -5479,7 +5490,7 @@
     getPropertyValue('border-left');
 
   /** Sets the value of "border-left" */
-  void set borderLeft(String value) {
+  set borderLeft(String value) {
     setProperty('border-left', value, '');
   }
 
@@ -5488,7 +5499,7 @@
     getPropertyValue('border-left-color');
 
   /** Sets the value of "border-left-color" */
-  void set borderLeftColor(String value) {
+  set borderLeftColor(String value) {
     setProperty('border-left-color', value, '');
   }
 
@@ -5497,7 +5508,7 @@
     getPropertyValue('border-left-style');
 
   /** Sets the value of "border-left-style" */
-  void set borderLeftStyle(String value) {
+  set borderLeftStyle(String value) {
     setProperty('border-left-style', value, '');
   }
 
@@ -5506,7 +5517,7 @@
     getPropertyValue('border-left-width');
 
   /** Sets the value of "border-left-width" */
-  void set borderLeftWidth(String value) {
+  set borderLeftWidth(String value) {
     setProperty('border-left-width', value, '');
   }
 
@@ -5515,7 +5526,7 @@
     getPropertyValue('border-radius');
 
   /** Sets the value of "border-radius" */
-  void set borderRadius(String value) {
+  set borderRadius(String value) {
     setProperty('border-radius', value, '');
   }
 
@@ -5524,7 +5535,7 @@
     getPropertyValue('border-right');
 
   /** Sets the value of "border-right" */
-  void set borderRight(String value) {
+  set borderRight(String value) {
     setProperty('border-right', value, '');
   }
 
@@ -5533,7 +5544,7 @@
     getPropertyValue('border-right-color');
 
   /** Sets the value of "border-right-color" */
-  void set borderRightColor(String value) {
+  set borderRightColor(String value) {
     setProperty('border-right-color', value, '');
   }
 
@@ -5542,7 +5553,7 @@
     getPropertyValue('border-right-style');
 
   /** Sets the value of "border-right-style" */
-  void set borderRightStyle(String value) {
+  set borderRightStyle(String value) {
     setProperty('border-right-style', value, '');
   }
 
@@ -5551,7 +5562,7 @@
     getPropertyValue('border-right-width');
 
   /** Sets the value of "border-right-width" */
-  void set borderRightWidth(String value) {
+  set borderRightWidth(String value) {
     setProperty('border-right-width', value, '');
   }
 
@@ -5560,7 +5571,7 @@
     getPropertyValue('border-spacing');
 
   /** Sets the value of "border-spacing" */
-  void set borderSpacing(String value) {
+  set borderSpacing(String value) {
     setProperty('border-spacing', value, '');
   }
 
@@ -5569,7 +5580,7 @@
     getPropertyValue('border-start');
 
   /** Sets the value of "border-start" */
-  void set borderStart(String value) {
+  set borderStart(String value) {
     setProperty('border-start', value, '');
   }
 
@@ -5578,7 +5589,7 @@
     getPropertyValue('border-start-color');
 
   /** Sets the value of "border-start-color" */
-  void set borderStartColor(String value) {
+  set borderStartColor(String value) {
     setProperty('border-start-color', value, '');
   }
 
@@ -5587,7 +5598,7 @@
     getPropertyValue('border-start-style');
 
   /** Sets the value of "border-start-style" */
-  void set borderStartStyle(String value) {
+  set borderStartStyle(String value) {
     setProperty('border-start-style', value, '');
   }
 
@@ -5596,7 +5607,7 @@
     getPropertyValue('border-start-width');
 
   /** Sets the value of "border-start-width" */
-  void set borderStartWidth(String value) {
+  set borderStartWidth(String value) {
     setProperty('border-start-width', value, '');
   }
 
@@ -5605,7 +5616,7 @@
     getPropertyValue('border-style');
 
   /** Sets the value of "border-style" */
-  void set borderStyle(String value) {
+  set borderStyle(String value) {
     setProperty('border-style', value, '');
   }
 
@@ -5614,7 +5625,7 @@
     getPropertyValue('border-top');
 
   /** Sets the value of "border-top" */
-  void set borderTop(String value) {
+  set borderTop(String value) {
     setProperty('border-top', value, '');
   }
 
@@ -5623,7 +5634,7 @@
     getPropertyValue('border-top-color');
 
   /** Sets the value of "border-top-color" */
-  void set borderTopColor(String value) {
+  set borderTopColor(String value) {
     setProperty('border-top-color', value, '');
   }
 
@@ -5632,7 +5643,7 @@
     getPropertyValue('border-top-left-radius');
 
   /** Sets the value of "border-top-left-radius" */
-  void set borderTopLeftRadius(String value) {
+  set borderTopLeftRadius(String value) {
     setProperty('border-top-left-radius', value, '');
   }
 
@@ -5641,7 +5652,7 @@
     getPropertyValue('border-top-right-radius');
 
   /** Sets the value of "border-top-right-radius" */
-  void set borderTopRightRadius(String value) {
+  set borderTopRightRadius(String value) {
     setProperty('border-top-right-radius', value, '');
   }
 
@@ -5650,7 +5661,7 @@
     getPropertyValue('border-top-style');
 
   /** Sets the value of "border-top-style" */
-  void set borderTopStyle(String value) {
+  set borderTopStyle(String value) {
     setProperty('border-top-style', value, '');
   }
 
@@ -5659,7 +5670,7 @@
     getPropertyValue('border-top-width');
 
   /** Sets the value of "border-top-width" */
-  void set borderTopWidth(String value) {
+  set borderTopWidth(String value) {
     setProperty('border-top-width', value, '');
   }
 
@@ -5668,7 +5679,7 @@
     getPropertyValue('border-vertical-spacing');
 
   /** Sets the value of "border-vertical-spacing" */
-  void set borderVerticalSpacing(String value) {
+  set borderVerticalSpacing(String value) {
     setProperty('border-vertical-spacing', value, '');
   }
 
@@ -5677,7 +5688,7 @@
     getPropertyValue('border-width');
 
   /** Sets the value of "border-width" */
-  void set borderWidth(String value) {
+  set borderWidth(String value) {
     setProperty('border-width', value, '');
   }
 
@@ -5686,7 +5697,7 @@
     getPropertyValue('bottom');
 
   /** Sets the value of "bottom" */
-  void set bottom(String value) {
+  set bottom(String value) {
     setProperty('bottom', value, '');
   }
 
@@ -5695,7 +5706,7 @@
     getPropertyValue('box-align');
 
   /** Sets the value of "box-align" */
-  void set boxAlign(String value) {
+  set boxAlign(String value) {
     setProperty('box-align', value, '');
   }
 
@@ -5704,7 +5715,7 @@
     getPropertyValue('box-decoration-break');
 
   /** Sets the value of "box-decoration-break" */
-  void set boxDecorationBreak(String value) {
+  set boxDecorationBreak(String value) {
     setProperty('box-decoration-break', value, '');
   }
 
@@ -5713,7 +5724,7 @@
     getPropertyValue('box-direction');
 
   /** Sets the value of "box-direction" */
-  void set boxDirection(String value) {
+  set boxDirection(String value) {
     setProperty('box-direction', value, '');
   }
 
@@ -5722,7 +5733,7 @@
     getPropertyValue('box-flex');
 
   /** Sets the value of "box-flex" */
-  void set boxFlex(String value) {
+  set boxFlex(String value) {
     setProperty('box-flex', value, '');
   }
 
@@ -5731,7 +5742,7 @@
     getPropertyValue('box-flex-group');
 
   /** Sets the value of "box-flex-group" */
-  void set boxFlexGroup(String value) {
+  set boxFlexGroup(String value) {
     setProperty('box-flex-group', value, '');
   }
 
@@ -5740,7 +5751,7 @@
     getPropertyValue('box-lines');
 
   /** Sets the value of "box-lines" */
-  void set boxLines(String value) {
+  set boxLines(String value) {
     setProperty('box-lines', value, '');
   }
 
@@ -5749,7 +5760,7 @@
     getPropertyValue('box-ordinal-group');
 
   /** Sets the value of "box-ordinal-group" */
-  void set boxOrdinalGroup(String value) {
+  set boxOrdinalGroup(String value) {
     setProperty('box-ordinal-group', value, '');
   }
 
@@ -5758,7 +5769,7 @@
     getPropertyValue('box-orient');
 
   /** Sets the value of "box-orient" */
-  void set boxOrient(String value) {
+  set boxOrient(String value) {
     setProperty('box-orient', value, '');
   }
 
@@ -5767,7 +5778,7 @@
     getPropertyValue('box-pack');
 
   /** Sets the value of "box-pack" */
-  void set boxPack(String value) {
+  set boxPack(String value) {
     setProperty('box-pack', value, '');
   }
 
@@ -5776,7 +5787,7 @@
     getPropertyValue('box-reflect');
 
   /** Sets the value of "box-reflect" */
-  void set boxReflect(String value) {
+  set boxReflect(String value) {
     setProperty('box-reflect', value, '');
   }
 
@@ -5785,7 +5796,7 @@
     getPropertyValue('box-shadow');
 
   /** Sets the value of "box-shadow" */
-  void set boxShadow(String value) {
+  set boxShadow(String value) {
     setProperty('box-shadow', value, '');
   }
 
@@ -5794,7 +5805,7 @@
     getPropertyValue('box-sizing');
 
   /** Sets the value of "box-sizing" */
-  void set boxSizing(String value) {
+  set boxSizing(String value) {
     setProperty('box-sizing', value, '');
   }
 
@@ -5803,7 +5814,7 @@
     getPropertyValue('caption-side');
 
   /** Sets the value of "caption-side" */
-  void set captionSide(String value) {
+  set captionSide(String value) {
     setProperty('caption-side', value, '');
   }
 
@@ -5812,7 +5823,7 @@
     getPropertyValue('clear');
 
   /** Sets the value of "clear" */
-  void set clear(String value) {
+  set clear(String value) {
     setProperty('clear', value, '');
   }
 
@@ -5821,7 +5832,7 @@
     getPropertyValue('clip');
 
   /** Sets the value of "clip" */
-  void set clip(String value) {
+  set clip(String value) {
     setProperty('clip', value, '');
   }
 
@@ -5830,7 +5841,7 @@
     getPropertyValue('clip-path');
 
   /** Sets the value of "clip-path" */
-  void set clipPath(String value) {
+  set clipPath(String value) {
     setProperty('clip-path', value, '');
   }
 
@@ -5839,7 +5850,7 @@
     getPropertyValue('color');
 
   /** Sets the value of "color" */
-  void set color(String value) {
+  set color(String value) {
     setProperty('color', value, '');
   }
 
@@ -5848,7 +5859,7 @@
     getPropertyValue('column-break-after');
 
   /** Sets the value of "column-break-after" */
-  void set columnBreakAfter(String value) {
+  set columnBreakAfter(String value) {
     setProperty('column-break-after', value, '');
   }
 
@@ -5857,7 +5868,7 @@
     getPropertyValue('column-break-before');
 
   /** Sets the value of "column-break-before" */
-  void set columnBreakBefore(String value) {
+  set columnBreakBefore(String value) {
     setProperty('column-break-before', value, '');
   }
 
@@ -5866,7 +5877,7 @@
     getPropertyValue('column-break-inside');
 
   /** Sets the value of "column-break-inside" */
-  void set columnBreakInside(String value) {
+  set columnBreakInside(String value) {
     setProperty('column-break-inside', value, '');
   }
 
@@ -5875,7 +5886,7 @@
     getPropertyValue('column-count');
 
   /** Sets the value of "column-count" */
-  void set columnCount(String value) {
+  set columnCount(String value) {
     setProperty('column-count', value, '');
   }
 
@@ -5884,7 +5895,7 @@
     getPropertyValue('column-fill');
 
   /** Sets the value of "column-fill" */
-  void set columnFill(String value) {
+  set columnFill(String value) {
     setProperty('column-fill', value, '');
   }
 
@@ -5893,7 +5904,7 @@
     getPropertyValue('column-gap');
 
   /** Sets the value of "column-gap" */
-  void set columnGap(String value) {
+  set columnGap(String value) {
     setProperty('column-gap', value, '');
   }
 
@@ -5902,7 +5913,7 @@
     getPropertyValue('column-rule');
 
   /** Sets the value of "column-rule" */
-  void set columnRule(String value) {
+  set columnRule(String value) {
     setProperty('column-rule', value, '');
   }
 
@@ -5911,7 +5922,7 @@
     getPropertyValue('column-rule-color');
 
   /** Sets the value of "column-rule-color" */
-  void set columnRuleColor(String value) {
+  set columnRuleColor(String value) {
     setProperty('column-rule-color', value, '');
   }
 
@@ -5920,7 +5931,7 @@
     getPropertyValue('column-rule-style');
 
   /** Sets the value of "column-rule-style" */
-  void set columnRuleStyle(String value) {
+  set columnRuleStyle(String value) {
     setProperty('column-rule-style', value, '');
   }
 
@@ -5929,7 +5940,7 @@
     getPropertyValue('column-rule-width');
 
   /** Sets the value of "column-rule-width" */
-  void set columnRuleWidth(String value) {
+  set columnRuleWidth(String value) {
     setProperty('column-rule-width', value, '');
   }
 
@@ -5938,7 +5949,7 @@
     getPropertyValue('column-span');
 
   /** Sets the value of "column-span" */
-  void set columnSpan(String value) {
+  set columnSpan(String value) {
     setProperty('column-span', value, '');
   }
 
@@ -5947,7 +5958,7 @@
     getPropertyValue('column-width');
 
   /** Sets the value of "column-width" */
-  void set columnWidth(String value) {
+  set columnWidth(String value) {
     setProperty('column-width', value, '');
   }
 
@@ -5956,7 +5967,7 @@
     getPropertyValue('columns');
 
   /** Sets the value of "columns" */
-  void set columns(String value) {
+  set columns(String value) {
     setProperty('columns', value, '');
   }
 
@@ -5965,7 +5976,7 @@
     getPropertyValue('content');
 
   /** Sets the value of "content" */
-  void set content(String value) {
+  set content(String value) {
     setProperty('content', value, '');
   }
 
@@ -5974,7 +5985,7 @@
     getPropertyValue('counter-increment');
 
   /** Sets the value of "counter-increment" */
-  void set counterIncrement(String value) {
+  set counterIncrement(String value) {
     setProperty('counter-increment', value, '');
   }
 
@@ -5983,7 +5994,7 @@
     getPropertyValue('counter-reset');
 
   /** Sets the value of "counter-reset" */
-  void set counterReset(String value) {
+  set counterReset(String value) {
     setProperty('counter-reset', value, '');
   }
 
@@ -5992,7 +6003,7 @@
     getPropertyValue('cursor');
 
   /** Sets the value of "cursor" */
-  void set cursor(String value) {
+  set cursor(String value) {
     setProperty('cursor', value, '');
   }
 
@@ -6001,7 +6012,7 @@
     getPropertyValue('direction');
 
   /** Sets the value of "direction" */
-  void set direction(String value) {
+  set direction(String value) {
     setProperty('direction', value, '');
   }
 
@@ -6010,7 +6021,7 @@
     getPropertyValue('display');
 
   /** Sets the value of "display" */
-  void set display(String value) {
+  set display(String value) {
     setProperty('display', value, '');
   }
 
@@ -6019,7 +6030,7 @@
     getPropertyValue('empty-cells');
 
   /** Sets the value of "empty-cells" */
-  void set emptyCells(String value) {
+  set emptyCells(String value) {
     setProperty('empty-cells', value, '');
   }
 
@@ -6028,7 +6039,7 @@
     getPropertyValue('filter');
 
   /** Sets the value of "filter" */
-  void set filter(String value) {
+  set filter(String value) {
     setProperty('filter', value, '');
   }
 
@@ -6037,7 +6048,7 @@
     getPropertyValue('flex');
 
   /** Sets the value of "flex" */
-  void set flex(String value) {
+  set flex(String value) {
     setProperty('flex', value, '');
   }
 
@@ -6046,7 +6057,7 @@
     getPropertyValue('flex-basis');
 
   /** Sets the value of "flex-basis" */
-  void set flexBasis(String value) {
+  set flexBasis(String value) {
     setProperty('flex-basis', value, '');
   }
 
@@ -6055,7 +6066,7 @@
     getPropertyValue('flex-direction');
 
   /** Sets the value of "flex-direction" */
-  void set flexDirection(String value) {
+  set flexDirection(String value) {
     setProperty('flex-direction', value, '');
   }
 
@@ -6064,7 +6075,7 @@
     getPropertyValue('flex-flow');
 
   /** Sets the value of "flex-flow" */
-  void set flexFlow(String value) {
+  set flexFlow(String value) {
     setProperty('flex-flow', value, '');
   }
 
@@ -6073,7 +6084,7 @@
     getPropertyValue('flex-grow');
 
   /** Sets the value of "flex-grow" */
-  void set flexGrow(String value) {
+  set flexGrow(String value) {
     setProperty('flex-grow', value, '');
   }
 
@@ -6082,7 +6093,7 @@
     getPropertyValue('flex-shrink');
 
   /** Sets the value of "flex-shrink" */
-  void set flexShrink(String value) {
+  set flexShrink(String value) {
     setProperty('flex-shrink', value, '');
   }
 
@@ -6091,7 +6102,7 @@
     getPropertyValue('flex-wrap');
 
   /** Sets the value of "flex-wrap" */
-  void set flexWrap(String value) {
+  set flexWrap(String value) {
     setProperty('flex-wrap', value, '');
   }
 
@@ -6100,7 +6111,7 @@
     getPropertyValue('float');
 
   /** Sets the value of "float" */
-  void set float(String value) {
+  set float(String value) {
     setProperty('float', value, '');
   }
 
@@ -6109,7 +6120,7 @@
     getPropertyValue('font');
 
   /** Sets the value of "font" */
-  void set font(String value) {
+  set font(String value) {
     setProperty('font', value, '');
   }
 
@@ -6118,7 +6129,7 @@
     getPropertyValue('font-family');
 
   /** Sets the value of "font-family" */
-  void set fontFamily(String value) {
+  set fontFamily(String value) {
     setProperty('font-family', value, '');
   }
 
@@ -6127,7 +6138,7 @@
     getPropertyValue('font-feature-settings');
 
   /** Sets the value of "font-feature-settings" */
-  void set fontFeatureSettings(String value) {
+  set fontFeatureSettings(String value) {
     setProperty('font-feature-settings', value, '');
   }
 
@@ -6136,7 +6147,7 @@
     getPropertyValue('font-kerning');
 
   /** Sets the value of "font-kerning" */
-  void set fontKerning(String value) {
+  set fontKerning(String value) {
     setProperty('font-kerning', value, '');
   }
 
@@ -6145,7 +6156,7 @@
     getPropertyValue('font-size');
 
   /** Sets the value of "font-size" */
-  void set fontSize(String value) {
+  set fontSize(String value) {
     setProperty('font-size', value, '');
   }
 
@@ -6154,7 +6165,7 @@
     getPropertyValue('font-size-delta');
 
   /** Sets the value of "font-size-delta" */
-  void set fontSizeDelta(String value) {
+  set fontSizeDelta(String value) {
     setProperty('font-size-delta', value, '');
   }
 
@@ -6163,7 +6174,7 @@
     getPropertyValue('font-smoothing');
 
   /** Sets the value of "font-smoothing" */
-  void set fontSmoothing(String value) {
+  set fontSmoothing(String value) {
     setProperty('font-smoothing', value, '');
   }
 
@@ -6172,7 +6183,7 @@
     getPropertyValue('font-stretch');
 
   /** Sets the value of "font-stretch" */
-  void set fontStretch(String value) {
+  set fontStretch(String value) {
     setProperty('font-stretch', value, '');
   }
 
@@ -6181,7 +6192,7 @@
     getPropertyValue('font-style');
 
   /** Sets the value of "font-style" */
-  void set fontStyle(String value) {
+  set fontStyle(String value) {
     setProperty('font-style', value, '');
   }
 
@@ -6190,7 +6201,7 @@
     getPropertyValue('font-variant');
 
   /** Sets the value of "font-variant" */
-  void set fontVariant(String value) {
+  set fontVariant(String value) {
     setProperty('font-variant', value, '');
   }
 
@@ -6199,7 +6210,7 @@
     getPropertyValue('font-variant-ligatures');
 
   /** Sets the value of "font-variant-ligatures" */
-  void set fontVariantLigatures(String value) {
+  set fontVariantLigatures(String value) {
     setProperty('font-variant-ligatures', value, '');
   }
 
@@ -6208,7 +6219,7 @@
     getPropertyValue('font-weight');
 
   /** Sets the value of "font-weight" */
-  void set fontWeight(String value) {
+  set fontWeight(String value) {
     setProperty('font-weight', value, '');
   }
 
@@ -6217,7 +6228,7 @@
     getPropertyValue('grid');
 
   /** Sets the value of "grid" */
-  void set grid(String value) {
+  set grid(String value) {
     setProperty('grid', value, '');
   }
 
@@ -6226,7 +6237,7 @@
     getPropertyValue('grid-area');
 
   /** Sets the value of "grid-area" */
-  void set gridArea(String value) {
+  set gridArea(String value) {
     setProperty('grid-area', value, '');
   }
 
@@ -6235,7 +6246,7 @@
     getPropertyValue('grid-auto-columns');
 
   /** Sets the value of "grid-auto-columns" */
-  void set gridAutoColumns(String value) {
+  set gridAutoColumns(String value) {
     setProperty('grid-auto-columns', value, '');
   }
 
@@ -6244,7 +6255,7 @@
     getPropertyValue('grid-auto-flow');
 
   /** Sets the value of "grid-auto-flow" */
-  void set gridAutoFlow(String value) {
+  set gridAutoFlow(String value) {
     setProperty('grid-auto-flow', value, '');
   }
 
@@ -6253,7 +6264,7 @@
     getPropertyValue('grid-auto-rows');
 
   /** Sets the value of "grid-auto-rows" */
-  void set gridAutoRows(String value) {
+  set gridAutoRows(String value) {
     setProperty('grid-auto-rows', value, '');
   }
 
@@ -6262,7 +6273,7 @@
     getPropertyValue('grid-column');
 
   /** Sets the value of "grid-column" */
-  void set gridColumn(String value) {
+  set gridColumn(String value) {
     setProperty('grid-column', value, '');
   }
 
@@ -6271,7 +6282,7 @@
     getPropertyValue('grid-column-end');
 
   /** Sets the value of "grid-column-end" */
-  void set gridColumnEnd(String value) {
+  set gridColumnEnd(String value) {
     setProperty('grid-column-end', value, '');
   }
 
@@ -6280,7 +6291,7 @@
     getPropertyValue('grid-column-start');
 
   /** Sets the value of "grid-column-start" */
-  void set gridColumnStart(String value) {
+  set gridColumnStart(String value) {
     setProperty('grid-column-start', value, '');
   }
 
@@ -6289,7 +6300,7 @@
     getPropertyValue('grid-row');
 
   /** Sets the value of "grid-row" */
-  void set gridRow(String value) {
+  set gridRow(String value) {
     setProperty('grid-row', value, '');
   }
 
@@ -6298,7 +6309,7 @@
     getPropertyValue('grid-row-end');
 
   /** Sets the value of "grid-row-end" */
-  void set gridRowEnd(String value) {
+  set gridRowEnd(String value) {
     setProperty('grid-row-end', value, '');
   }
 
@@ -6307,7 +6318,7 @@
     getPropertyValue('grid-row-start');
 
   /** Sets the value of "grid-row-start" */
-  void set gridRowStart(String value) {
+  set gridRowStart(String value) {
     setProperty('grid-row-start', value, '');
   }
 
@@ -6316,7 +6327,7 @@
     getPropertyValue('grid-template');
 
   /** Sets the value of "grid-template" */
-  void set gridTemplate(String value) {
+  set gridTemplate(String value) {
     setProperty('grid-template', value, '');
   }
 
@@ -6325,7 +6336,7 @@
     getPropertyValue('grid-template-areas');
 
   /** Sets the value of "grid-template-areas" */
-  void set gridTemplateAreas(String value) {
+  set gridTemplateAreas(String value) {
     setProperty('grid-template-areas', value, '');
   }
 
@@ -6334,7 +6345,7 @@
     getPropertyValue('grid-template-columns');
 
   /** Sets the value of "grid-template-columns" */
-  void set gridTemplateColumns(String value) {
+  set gridTemplateColumns(String value) {
     setProperty('grid-template-columns', value, '');
   }
 
@@ -6343,7 +6354,7 @@
     getPropertyValue('grid-template-rows');
 
   /** Sets the value of "grid-template-rows" */
-  void set gridTemplateRows(String value) {
+  set gridTemplateRows(String value) {
     setProperty('grid-template-rows', value, '');
   }
 
@@ -6352,7 +6363,7 @@
     getPropertyValue('height');
 
   /** Sets the value of "height" */
-  void set height(String value) {
+  set height(String value) {
     setProperty('height', value, '');
   }
 
@@ -6361,7 +6372,7 @@
     getPropertyValue('highlight');
 
   /** Sets the value of "highlight" */
-  void set highlight(String value) {
+  set highlight(String value) {
     setProperty('highlight', value, '');
   }
 
@@ -6370,7 +6381,7 @@
     getPropertyValue('hyphenate-character');
 
   /** Sets the value of "hyphenate-character" */
-  void set hyphenateCharacter(String value) {
+  set hyphenateCharacter(String value) {
     setProperty('hyphenate-character', value, '');
   }
 
@@ -6379,7 +6390,7 @@
     getPropertyValue('image-rendering');
 
   /** Sets the value of "image-rendering" */
-  void set imageRendering(String value) {
+  set imageRendering(String value) {
     setProperty('image-rendering', value, '');
   }
 
@@ -6388,7 +6399,7 @@
     getPropertyValue('isolation');
 
   /** Sets the value of "isolation" */
-  void set isolation(String value) {
+  set isolation(String value) {
     setProperty('isolation', value, '');
   }
 
@@ -6397,7 +6408,7 @@
     getPropertyValue('justify-content');
 
   /** Sets the value of "justify-content" */
-  void set justifyContent(String value) {
+  set justifyContent(String value) {
     setProperty('justify-content', value, '');
   }
 
@@ -6406,7 +6417,7 @@
     getPropertyValue('justify-self');
 
   /** Sets the value of "justify-self" */
-  void set justifySelf(String value) {
+  set justifySelf(String value) {
     setProperty('justify-self', value, '');
   }
 
@@ -6415,7 +6426,7 @@
     getPropertyValue('left');
 
   /** Sets the value of "left" */
-  void set left(String value) {
+  set left(String value) {
     setProperty('left', value, '');
   }
 
@@ -6424,7 +6435,7 @@
     getPropertyValue('letter-spacing');
 
   /** Sets the value of "letter-spacing" */
-  void set letterSpacing(String value) {
+  set letterSpacing(String value) {
     setProperty('letter-spacing', value, '');
   }
 
@@ -6433,7 +6444,7 @@
     getPropertyValue('line-box-contain');
 
   /** Sets the value of "line-box-contain" */
-  void set lineBoxContain(String value) {
+  set lineBoxContain(String value) {
     setProperty('line-box-contain', value, '');
   }
 
@@ -6442,7 +6453,7 @@
     getPropertyValue('line-break');
 
   /** Sets the value of "line-break" */
-  void set lineBreak(String value) {
+  set lineBreak(String value) {
     setProperty('line-break', value, '');
   }
 
@@ -6451,7 +6462,7 @@
     getPropertyValue('line-clamp');
 
   /** Sets the value of "line-clamp" */
-  void set lineClamp(String value) {
+  set lineClamp(String value) {
     setProperty('line-clamp', value, '');
   }
 
@@ -6460,7 +6471,7 @@
     getPropertyValue('line-height');
 
   /** Sets the value of "line-height" */
-  void set lineHeight(String value) {
+  set lineHeight(String value) {
     setProperty('line-height', value, '');
   }
 
@@ -6469,7 +6480,7 @@
     getPropertyValue('list-style');
 
   /** Sets the value of "list-style" */
-  void set listStyle(String value) {
+  set listStyle(String value) {
     setProperty('list-style', value, '');
   }
 
@@ -6478,7 +6489,7 @@
     getPropertyValue('list-style-image');
 
   /** Sets the value of "list-style-image" */
-  void set listStyleImage(String value) {
+  set listStyleImage(String value) {
     setProperty('list-style-image', value, '');
   }
 
@@ -6487,7 +6498,7 @@
     getPropertyValue('list-style-position');
 
   /** Sets the value of "list-style-position" */
-  void set listStylePosition(String value) {
+  set listStylePosition(String value) {
     setProperty('list-style-position', value, '');
   }
 
@@ -6496,7 +6507,7 @@
     getPropertyValue('list-style-type');
 
   /** Sets the value of "list-style-type" */
-  void set listStyleType(String value) {
+  set listStyleType(String value) {
     setProperty('list-style-type', value, '');
   }
 
@@ -6505,7 +6516,7 @@
     getPropertyValue('locale');
 
   /** Sets the value of "locale" */
-  void set locale(String value) {
+  set locale(String value) {
     setProperty('locale', value, '');
   }
 
@@ -6514,7 +6525,7 @@
     getPropertyValue('logical-height');
 
   /** Sets the value of "logical-height" */
-  void set logicalHeight(String value) {
+  set logicalHeight(String value) {
     setProperty('logical-height', value, '');
   }
 
@@ -6523,7 +6534,7 @@
     getPropertyValue('logical-width');
 
   /** Sets the value of "logical-width" */
-  void set logicalWidth(String value) {
+  set logicalWidth(String value) {
     setProperty('logical-width', value, '');
   }
 
@@ -6532,7 +6543,7 @@
     getPropertyValue('margin');
 
   /** Sets the value of "margin" */
-  void set margin(String value) {
+  set margin(String value) {
     setProperty('margin', value, '');
   }
 
@@ -6541,7 +6552,7 @@
     getPropertyValue('margin-after');
 
   /** Sets the value of "margin-after" */
-  void set marginAfter(String value) {
+  set marginAfter(String value) {
     setProperty('margin-after', value, '');
   }
 
@@ -6550,7 +6561,7 @@
     getPropertyValue('margin-after-collapse');
 
   /** Sets the value of "margin-after-collapse" */
-  void set marginAfterCollapse(String value) {
+  set marginAfterCollapse(String value) {
     setProperty('margin-after-collapse', value, '');
   }
 
@@ -6559,7 +6570,7 @@
     getPropertyValue('margin-before');
 
   /** Sets the value of "margin-before" */
-  void set marginBefore(String value) {
+  set marginBefore(String value) {
     setProperty('margin-before', value, '');
   }
 
@@ -6568,7 +6579,7 @@
     getPropertyValue('margin-before-collapse');
 
   /** Sets the value of "margin-before-collapse" */
-  void set marginBeforeCollapse(String value) {
+  set marginBeforeCollapse(String value) {
     setProperty('margin-before-collapse', value, '');
   }
 
@@ -6577,7 +6588,7 @@
     getPropertyValue('margin-bottom');
 
   /** Sets the value of "margin-bottom" */
-  void set marginBottom(String value) {
+  set marginBottom(String value) {
     setProperty('margin-bottom', value, '');
   }
 
@@ -6586,7 +6597,7 @@
     getPropertyValue('margin-bottom-collapse');
 
   /** Sets the value of "margin-bottom-collapse" */
-  void set marginBottomCollapse(String value) {
+  set marginBottomCollapse(String value) {
     setProperty('margin-bottom-collapse', value, '');
   }
 
@@ -6595,7 +6606,7 @@
     getPropertyValue('margin-collapse');
 
   /** Sets the value of "margin-collapse" */
-  void set marginCollapse(String value) {
+  set marginCollapse(String value) {
     setProperty('margin-collapse', value, '');
   }
 
@@ -6604,7 +6615,7 @@
     getPropertyValue('margin-end');
 
   /** Sets the value of "margin-end" */
-  void set marginEnd(String value) {
+  set marginEnd(String value) {
     setProperty('margin-end', value, '');
   }
 
@@ -6613,7 +6624,7 @@
     getPropertyValue('margin-left');
 
   /** Sets the value of "margin-left" */
-  void set marginLeft(String value) {
+  set marginLeft(String value) {
     setProperty('margin-left', value, '');
   }
 
@@ -6622,7 +6633,7 @@
     getPropertyValue('margin-right');
 
   /** Sets the value of "margin-right" */
-  void set marginRight(String value) {
+  set marginRight(String value) {
     setProperty('margin-right', value, '');
   }
 
@@ -6631,7 +6642,7 @@
     getPropertyValue('margin-start');
 
   /** Sets the value of "margin-start" */
-  void set marginStart(String value) {
+  set marginStart(String value) {
     setProperty('margin-start', value, '');
   }
 
@@ -6640,7 +6651,7 @@
     getPropertyValue('margin-top');
 
   /** Sets the value of "margin-top" */
-  void set marginTop(String value) {
+  set marginTop(String value) {
     setProperty('margin-top', value, '');
   }
 
@@ -6649,7 +6660,7 @@
     getPropertyValue('margin-top-collapse');
 
   /** Sets the value of "margin-top-collapse" */
-  void set marginTopCollapse(String value) {
+  set marginTopCollapse(String value) {
     setProperty('margin-top-collapse', value, '');
   }
 
@@ -6658,7 +6669,7 @@
     getPropertyValue('mask');
 
   /** Sets the value of "mask" */
-  void set mask(String value) {
+  set mask(String value) {
     setProperty('mask', value, '');
   }
 
@@ -6667,7 +6678,7 @@
     getPropertyValue('mask-box-image');
 
   /** Sets the value of "mask-box-image" */
-  void set maskBoxImage(String value) {
+  set maskBoxImage(String value) {
     setProperty('mask-box-image', value, '');
   }
 
@@ -6676,7 +6687,7 @@
     getPropertyValue('mask-box-image-outset');
 
   /** Sets the value of "mask-box-image-outset" */
-  void set maskBoxImageOutset(String value) {
+  set maskBoxImageOutset(String value) {
     setProperty('mask-box-image-outset', value, '');
   }
 
@@ -6685,7 +6696,7 @@
     getPropertyValue('mask-box-image-repeat');
 
   /** Sets the value of "mask-box-image-repeat" */
-  void set maskBoxImageRepeat(String value) {
+  set maskBoxImageRepeat(String value) {
     setProperty('mask-box-image-repeat', value, '');
   }
 
@@ -6694,7 +6705,7 @@
     getPropertyValue('mask-box-image-slice');
 
   /** Sets the value of "mask-box-image-slice" */
-  void set maskBoxImageSlice(String value) {
+  set maskBoxImageSlice(String value) {
     setProperty('mask-box-image-slice', value, '');
   }
 
@@ -6703,7 +6714,7 @@
     getPropertyValue('mask-box-image-source');
 
   /** Sets the value of "mask-box-image-source" */
-  void set maskBoxImageSource(String value) {
+  set maskBoxImageSource(String value) {
     setProperty('mask-box-image-source', value, '');
   }
 
@@ -6712,7 +6723,7 @@
     getPropertyValue('mask-box-image-width');
 
   /** Sets the value of "mask-box-image-width" */
-  void set maskBoxImageWidth(String value) {
+  set maskBoxImageWidth(String value) {
     setProperty('mask-box-image-width', value, '');
   }
 
@@ -6721,7 +6732,7 @@
     getPropertyValue('mask-clip');
 
   /** Sets the value of "mask-clip" */
-  void set maskClip(String value) {
+  set maskClip(String value) {
     setProperty('mask-clip', value, '');
   }
 
@@ -6730,7 +6741,7 @@
     getPropertyValue('mask-composite');
 
   /** Sets the value of "mask-composite" */
-  void set maskComposite(String value) {
+  set maskComposite(String value) {
     setProperty('mask-composite', value, '');
   }
 
@@ -6739,7 +6750,7 @@
     getPropertyValue('mask-image');
 
   /** Sets the value of "mask-image" */
-  void set maskImage(String value) {
+  set maskImage(String value) {
     setProperty('mask-image', value, '');
   }
 
@@ -6748,7 +6759,7 @@
     getPropertyValue('mask-origin');
 
   /** Sets the value of "mask-origin" */
-  void set maskOrigin(String value) {
+  set maskOrigin(String value) {
     setProperty('mask-origin', value, '');
   }
 
@@ -6757,7 +6768,7 @@
     getPropertyValue('mask-position');
 
   /** Sets the value of "mask-position" */
-  void set maskPosition(String value) {
+  set maskPosition(String value) {
     setProperty('mask-position', value, '');
   }
 
@@ -6766,7 +6777,7 @@
     getPropertyValue('mask-position-x');
 
   /** Sets the value of "mask-position-x" */
-  void set maskPositionX(String value) {
+  set maskPositionX(String value) {
     setProperty('mask-position-x', value, '');
   }
 
@@ -6775,7 +6786,7 @@
     getPropertyValue('mask-position-y');
 
   /** Sets the value of "mask-position-y" */
-  void set maskPositionY(String value) {
+  set maskPositionY(String value) {
     setProperty('mask-position-y', value, '');
   }
 
@@ -6784,7 +6795,7 @@
     getPropertyValue('mask-repeat');
 
   /** Sets the value of "mask-repeat" */
-  void set maskRepeat(String value) {
+  set maskRepeat(String value) {
     setProperty('mask-repeat', value, '');
   }
 
@@ -6793,7 +6804,7 @@
     getPropertyValue('mask-repeat-x');
 
   /** Sets the value of "mask-repeat-x" */
-  void set maskRepeatX(String value) {
+  set maskRepeatX(String value) {
     setProperty('mask-repeat-x', value, '');
   }
 
@@ -6802,7 +6813,7 @@
     getPropertyValue('mask-repeat-y');
 
   /** Sets the value of "mask-repeat-y" */
-  void set maskRepeatY(String value) {
+  set maskRepeatY(String value) {
     setProperty('mask-repeat-y', value, '');
   }
 
@@ -6811,7 +6822,7 @@
     getPropertyValue('mask-size');
 
   /** Sets the value of "mask-size" */
-  void set maskSize(String value) {
+  set maskSize(String value) {
     setProperty('mask-size', value, '');
   }
 
@@ -6820,7 +6831,7 @@
     getPropertyValue('mask-source-type');
 
   /** Sets the value of "mask-source-type" */
-  void set maskSourceType(String value) {
+  set maskSourceType(String value) {
     setProperty('mask-source-type', value, '');
   }
 
@@ -6829,7 +6840,7 @@
     getPropertyValue('max-height');
 
   /** Sets the value of "max-height" */
-  void set maxHeight(String value) {
+  set maxHeight(String value) {
     setProperty('max-height', value, '');
   }
 
@@ -6838,7 +6849,7 @@
     getPropertyValue('max-logical-height');
 
   /** Sets the value of "max-logical-height" */
-  void set maxLogicalHeight(String value) {
+  set maxLogicalHeight(String value) {
     setProperty('max-logical-height', value, '');
   }
 
@@ -6847,7 +6858,7 @@
     getPropertyValue('max-logical-width');
 
   /** Sets the value of "max-logical-width" */
-  void set maxLogicalWidth(String value) {
+  set maxLogicalWidth(String value) {
     setProperty('max-logical-width', value, '');
   }
 
@@ -6856,7 +6867,7 @@
     getPropertyValue('max-width');
 
   /** Sets the value of "max-width" */
-  void set maxWidth(String value) {
+  set maxWidth(String value) {
     setProperty('max-width', value, '');
   }
 
@@ -6865,7 +6876,7 @@
     getPropertyValue('max-zoom');
 
   /** Sets the value of "max-zoom" */
-  void set maxZoom(String value) {
+  set maxZoom(String value) {
     setProperty('max-zoom', value, '');
   }
 
@@ -6874,7 +6885,7 @@
     getPropertyValue('min-height');
 
   /** Sets the value of "min-height" */
-  void set minHeight(String value) {
+  set minHeight(String value) {
     setProperty('min-height', value, '');
   }
 
@@ -6883,7 +6894,7 @@
     getPropertyValue('min-logical-height');
 
   /** Sets the value of "min-logical-height" */
-  void set minLogicalHeight(String value) {
+  set minLogicalHeight(String value) {
     setProperty('min-logical-height', value, '');
   }
 
@@ -6892,7 +6903,7 @@
     getPropertyValue('min-logical-width');
 
   /** Sets the value of "min-logical-width" */
-  void set minLogicalWidth(String value) {
+  set minLogicalWidth(String value) {
     setProperty('min-logical-width', value, '');
   }
 
@@ -6901,7 +6912,7 @@
     getPropertyValue('min-width');
 
   /** Sets the value of "min-width" */
-  void set minWidth(String value) {
+  set minWidth(String value) {
     setProperty('min-width', value, '');
   }
 
@@ -6910,7 +6921,7 @@
     getPropertyValue('min-zoom');
 
   /** Sets the value of "min-zoom" */
-  void set minZoom(String value) {
+  set minZoom(String value) {
     setProperty('min-zoom', value, '');
   }
 
@@ -6919,7 +6930,7 @@
     getPropertyValue('mix-blend-mode');
 
   /** Sets the value of "mix-blend-mode" */
-  void set mixBlendMode(String value) {
+  set mixBlendMode(String value) {
     setProperty('mix-blend-mode', value, '');
   }
 
@@ -6928,7 +6939,7 @@
     getPropertyValue('object-fit');
 
   /** Sets the value of "object-fit" */
-  void set objectFit(String value) {
+  set objectFit(String value) {
     setProperty('object-fit', value, '');
   }
 
@@ -6937,7 +6948,7 @@
     getPropertyValue('object-position');
 
   /** Sets the value of "object-position" */
-  void set objectPosition(String value) {
+  set objectPosition(String value) {
     setProperty('object-position', value, '');
   }
 
@@ -6946,7 +6957,7 @@
     getPropertyValue('opacity');
 
   /** Sets the value of "opacity" */
-  void set opacity(String value) {
+  set opacity(String value) {
     setProperty('opacity', value, '');
   }
 
@@ -6955,7 +6966,7 @@
     getPropertyValue('order');
 
   /** Sets the value of "order" */
-  void set order(String value) {
+  set order(String value) {
     setProperty('order', value, '');
   }
 
@@ -6964,7 +6975,7 @@
     getPropertyValue('orientation');
 
   /** Sets the value of "orientation" */
-  void set orientation(String value) {
+  set orientation(String value) {
     setProperty('orientation', value, '');
   }
 
@@ -6973,7 +6984,7 @@
     getPropertyValue('orphans');
 
   /** Sets the value of "orphans" */
-  void set orphans(String value) {
+  set orphans(String value) {
     setProperty('orphans', value, '');
   }
 
@@ -6982,7 +6993,7 @@
     getPropertyValue('outline');
 
   /** Sets the value of "outline" */
-  void set outline(String value) {
+  set outline(String value) {
     setProperty('outline', value, '');
   }
 
@@ -6991,7 +7002,7 @@
     getPropertyValue('outline-color');
 
   /** Sets the value of "outline-color" */
-  void set outlineColor(String value) {
+  set outlineColor(String value) {
     setProperty('outline-color', value, '');
   }
 
@@ -7000,7 +7011,7 @@
     getPropertyValue('outline-offset');
 
   /** Sets the value of "outline-offset" */
-  void set outlineOffset(String value) {
+  set outlineOffset(String value) {
     setProperty('outline-offset', value, '');
   }
 
@@ -7009,7 +7020,7 @@
     getPropertyValue('outline-style');
 
   /** Sets the value of "outline-style" */
-  void set outlineStyle(String value) {
+  set outlineStyle(String value) {
     setProperty('outline-style', value, '');
   }
 
@@ -7018,7 +7029,7 @@
     getPropertyValue('outline-width');
 
   /** Sets the value of "outline-width" */
-  void set outlineWidth(String value) {
+  set outlineWidth(String value) {
     setProperty('outline-width', value, '');
   }
 
@@ -7027,7 +7038,7 @@
     getPropertyValue('overflow');
 
   /** Sets the value of "overflow" */
-  void set overflow(String value) {
+  set overflow(String value) {
     setProperty('overflow', value, '');
   }
 
@@ -7036,7 +7047,7 @@
     getPropertyValue('overflow-wrap');
 
   /** Sets the value of "overflow-wrap" */
-  void set overflowWrap(String value) {
+  set overflowWrap(String value) {
     setProperty('overflow-wrap', value, '');
   }
 
@@ -7045,7 +7056,7 @@
     getPropertyValue('overflow-x');
 
   /** Sets the value of "overflow-x" */
-  void set overflowX(String value) {
+  set overflowX(String value) {
     setProperty('overflow-x', value, '');
   }
 
@@ -7054,7 +7065,7 @@
     getPropertyValue('overflow-y');
 
   /** Sets the value of "overflow-y" */
-  void set overflowY(String value) {
+  set overflowY(String value) {
     setProperty('overflow-y', value, '');
   }
 
@@ -7063,7 +7074,7 @@
     getPropertyValue('padding');
 
   /** Sets the value of "padding" */
-  void set padding(String value) {
+  set padding(String value) {
     setProperty('padding', value, '');
   }
 
@@ -7072,7 +7083,7 @@
     getPropertyValue('padding-after');
 
   /** Sets the value of "padding-after" */
-  void set paddingAfter(String value) {
+  set paddingAfter(String value) {
     setProperty('padding-after', value, '');
   }
 
@@ -7081,7 +7092,7 @@
     getPropertyValue('padding-before');
 
   /** Sets the value of "padding-before" */
-  void set paddingBefore(String value) {
+  set paddingBefore(String value) {
     setProperty('padding-before', value, '');
   }
 
@@ -7090,7 +7101,7 @@
     getPropertyValue('padding-bottom');
 
   /** Sets the value of "padding-bottom" */
-  void set paddingBottom(String value) {
+  set paddingBottom(String value) {
     setProperty('padding-bottom', value, '');
   }
 
@@ -7099,7 +7110,7 @@
     getPropertyValue('padding-end');
 
   /** Sets the value of "padding-end" */
-  void set paddingEnd(String value) {
+  set paddingEnd(String value) {
     setProperty('padding-end', value, '');
   }
 
@@ -7108,7 +7119,7 @@
     getPropertyValue('padding-left');
 
   /** Sets the value of "padding-left" */
-  void set paddingLeft(String value) {
+  set paddingLeft(String value) {
     setProperty('padding-left', value, '');
   }
 
@@ -7117,7 +7128,7 @@
     getPropertyValue('padding-right');
 
   /** Sets the value of "padding-right" */
-  void set paddingRight(String value) {
+  set paddingRight(String value) {
     setProperty('padding-right', value, '');
   }
 
@@ -7126,7 +7137,7 @@
     getPropertyValue('padding-start');
 
   /** Sets the value of "padding-start" */
-  void set paddingStart(String value) {
+  set paddingStart(String value) {
     setProperty('padding-start', value, '');
   }
 
@@ -7135,7 +7146,7 @@
     getPropertyValue('padding-top');
 
   /** Sets the value of "padding-top" */
-  void set paddingTop(String value) {
+  set paddingTop(String value) {
     setProperty('padding-top', value, '');
   }
 
@@ -7144,7 +7155,7 @@
     getPropertyValue('page');
 
   /** Sets the value of "page" */
-  void set page(String value) {
+  set page(String value) {
     setProperty('page', value, '');
   }
 
@@ -7153,7 +7164,7 @@
     getPropertyValue('page-break-after');
 
   /** Sets the value of "page-break-after" */
-  void set pageBreakAfter(String value) {
+  set pageBreakAfter(String value) {
     setProperty('page-break-after', value, '');
   }
 
@@ -7162,7 +7173,7 @@
     getPropertyValue('page-break-before');
 
   /** Sets the value of "page-break-before" */
-  void set pageBreakBefore(String value) {
+  set pageBreakBefore(String value) {
     setProperty('page-break-before', value, '');
   }
 
@@ -7171,7 +7182,7 @@
     getPropertyValue('page-break-inside');
 
   /** Sets the value of "page-break-inside" */
-  void set pageBreakInside(String value) {
+  set pageBreakInside(String value) {
     setProperty('page-break-inside', value, '');
   }
 
@@ -7180,7 +7191,7 @@
     getPropertyValue('perspective');
 
   /** Sets the value of "perspective" */
-  void set perspective(String value) {
+  set perspective(String value) {
     setProperty('perspective', value, '');
   }
 
@@ -7189,7 +7200,7 @@
     getPropertyValue('perspective-origin');
 
   /** Sets the value of "perspective-origin" */
-  void set perspectiveOrigin(String value) {
+  set perspectiveOrigin(String value) {
     setProperty('perspective-origin', value, '');
   }
 
@@ -7198,7 +7209,7 @@
     getPropertyValue('perspective-origin-x');
 
   /** Sets the value of "perspective-origin-x" */
-  void set perspectiveOriginX(String value) {
+  set perspectiveOriginX(String value) {
     setProperty('perspective-origin-x', value, '');
   }
 
@@ -7207,7 +7218,7 @@
     getPropertyValue('perspective-origin-y');
 
   /** Sets the value of "perspective-origin-y" */
-  void set perspectiveOriginY(String value) {
+  set perspectiveOriginY(String value) {
     setProperty('perspective-origin-y', value, '');
   }
 
@@ -7216,7 +7227,7 @@
     getPropertyValue('pointer-events');
 
   /** Sets the value of "pointer-events" */
-  void set pointerEvents(String value) {
+  set pointerEvents(String value) {
     setProperty('pointer-events', value, '');
   }
 
@@ -7225,7 +7236,7 @@
     getPropertyValue('position');
 
   /** Sets the value of "position" */
-  void set position(String value) {
+  set position(String value) {
     setProperty('position', value, '');
   }
 
@@ -7234,7 +7245,7 @@
     getPropertyValue('print-color-adjust');
 
   /** Sets the value of "print-color-adjust" */
-  void set printColorAdjust(String value) {
+  set printColorAdjust(String value) {
     setProperty('print-color-adjust', value, '');
   }
 
@@ -7243,7 +7254,7 @@
     getPropertyValue('quotes');
 
   /** Sets the value of "quotes" */
-  void set quotes(String value) {
+  set quotes(String value) {
     setProperty('quotes', value, '');
   }
 
@@ -7252,7 +7263,7 @@
     getPropertyValue('resize');
 
   /** Sets the value of "resize" */
-  void set resize(String value) {
+  set resize(String value) {
     setProperty('resize', value, '');
   }
 
@@ -7261,7 +7272,7 @@
     getPropertyValue('right');
 
   /** Sets the value of "right" */
-  void set right(String value) {
+  set right(String value) {
     setProperty('right', value, '');
   }
 
@@ -7270,7 +7281,7 @@
     getPropertyValue('rtl-ordering');
 
   /** Sets the value of "rtl-ordering" */
-  void set rtlOrdering(String value) {
+  set rtlOrdering(String value) {
     setProperty('rtl-ordering', value, '');
   }
 
@@ -7279,7 +7290,7 @@
     getPropertyValue('ruby-position');
 
   /** Sets the value of "ruby-position" */
-  void set rubyPosition(String value) {
+  set rubyPosition(String value) {
     setProperty('ruby-position', value, '');
   }
 
@@ -7288,7 +7299,7 @@
     getPropertyValue('scroll-behavior');
 
   /** Sets the value of "scroll-behavior" */
-  void set scrollBehavior(String value) {
+  set scrollBehavior(String value) {
     setProperty('scroll-behavior', value, '');
   }
 
@@ -7297,7 +7308,7 @@
     getPropertyValue('shape-image-threshold');
 
   /** Sets the value of "shape-image-threshold" */
-  void set shapeImageThreshold(String value) {
+  set shapeImageThreshold(String value) {
     setProperty('shape-image-threshold', value, '');
   }
 
@@ -7306,7 +7317,7 @@
     getPropertyValue('shape-margin');
 
   /** Sets the value of "shape-margin" */
-  void set shapeMargin(String value) {
+  set shapeMargin(String value) {
     setProperty('shape-margin', value, '');
   }
 
@@ -7315,7 +7326,7 @@
     getPropertyValue('shape-outside');
 
   /** Sets the value of "shape-outside" */
-  void set shapeOutside(String value) {
+  set shapeOutside(String value) {
     setProperty('shape-outside', value, '');
   }
 
@@ -7324,7 +7335,7 @@
     getPropertyValue('size');
 
   /** Sets the value of "size" */
-  void set size(String value) {
+  set size(String value) {
     setProperty('size', value, '');
   }
 
@@ -7333,7 +7344,7 @@
     getPropertyValue('speak');
 
   /** Sets the value of "speak" */
-  void set speak(String value) {
+  set speak(String value) {
     setProperty('speak', value, '');
   }
 
@@ -7342,7 +7353,7 @@
     getPropertyValue('src');
 
   /** Sets the value of "src" */
-  void set src(String value) {
+  set src(String value) {
     setProperty('src', value, '');
   }
 
@@ -7351,7 +7362,7 @@
     getPropertyValue('tab-size');
 
   /** Sets the value of "tab-size" */
-  void set tabSize(String value) {
+  set tabSize(String value) {
     setProperty('tab-size', value, '');
   }
 
@@ -7360,7 +7371,7 @@
     getPropertyValue('table-layout');
 
   /** Sets the value of "table-layout" */
-  void set tableLayout(String value) {
+  set tableLayout(String value) {
     setProperty('table-layout', value, '');
   }
 
@@ -7369,7 +7380,7 @@
     getPropertyValue('tap-highlight-color');
 
   /** Sets the value of "tap-highlight-color" */
-  void set tapHighlightColor(String value) {
+  set tapHighlightColor(String value) {
     setProperty('tap-highlight-color', value, '');
   }
 
@@ -7378,7 +7389,7 @@
     getPropertyValue('text-align');
 
   /** Sets the value of "text-align" */
-  void set textAlign(String value) {
+  set textAlign(String value) {
     setProperty('text-align', value, '');
   }
 
@@ -7387,7 +7398,7 @@
     getPropertyValue('text-align-last');
 
   /** Sets the value of "text-align-last" */
-  void set textAlignLast(String value) {
+  set textAlignLast(String value) {
     setProperty('text-align-last', value, '');
   }
 
@@ -7396,7 +7407,7 @@
     getPropertyValue('text-combine');
 
   /** Sets the value of "text-combine" */
-  void set textCombine(String value) {
+  set textCombine(String value) {
     setProperty('text-combine', value, '');
   }
 
@@ -7405,7 +7416,7 @@
     getPropertyValue('text-decoration');
 
   /** Sets the value of "text-decoration" */
-  void set textDecoration(String value) {
+  set textDecoration(String value) {
     setProperty('text-decoration', value, '');
   }
 
@@ -7414,7 +7425,7 @@
     getPropertyValue('text-decoration-color');
 
   /** Sets the value of "text-decoration-color" */
-  void set textDecorationColor(String value) {
+  set textDecorationColor(String value) {
     setProperty('text-decoration-color', value, '');
   }
 
@@ -7423,7 +7434,7 @@
     getPropertyValue('text-decoration-line');
 
   /** Sets the value of "text-decoration-line" */
-  void set textDecorationLine(String value) {
+  set textDecorationLine(String value) {
     setProperty('text-decoration-line', value, '');
   }
 
@@ -7432,7 +7443,7 @@
     getPropertyValue('text-decoration-style');
 
   /** Sets the value of "text-decoration-style" */
-  void set textDecorationStyle(String value) {
+  set textDecorationStyle(String value) {
     setProperty('text-decoration-style', value, '');
   }
 
@@ -7441,7 +7452,7 @@
     getPropertyValue('text-decorations-in-effect');
 
   /** Sets the value of "text-decorations-in-effect" */
-  void set textDecorationsInEffect(String value) {
+  set textDecorationsInEffect(String value) {
     setProperty('text-decorations-in-effect', value, '');
   }
 
@@ -7450,7 +7461,7 @@
     getPropertyValue('text-emphasis');
 
   /** Sets the value of "text-emphasis" */
-  void set textEmphasis(String value) {
+  set textEmphasis(String value) {
     setProperty('text-emphasis', value, '');
   }
 
@@ -7459,7 +7470,7 @@
     getPropertyValue('text-emphasis-color');
 
   /** Sets the value of "text-emphasis-color" */
-  void set textEmphasisColor(String value) {
+  set textEmphasisColor(String value) {
     setProperty('text-emphasis-color', value, '');
   }
 
@@ -7468,7 +7479,7 @@
     getPropertyValue('text-emphasis-position');
 
   /** Sets the value of "text-emphasis-position" */
-  void set textEmphasisPosition(String value) {
+  set textEmphasisPosition(String value) {
     setProperty('text-emphasis-position', value, '');
   }
 
@@ -7477,7 +7488,7 @@
     getPropertyValue('text-emphasis-style');
 
   /** Sets the value of "text-emphasis-style" */
-  void set textEmphasisStyle(String value) {
+  set textEmphasisStyle(String value) {
     setProperty('text-emphasis-style', value, '');
   }
 
@@ -7486,7 +7497,7 @@
     getPropertyValue('text-fill-color');
 
   /** Sets the value of "text-fill-color" */
-  void set textFillColor(String value) {
+  set textFillColor(String value) {
     setProperty('text-fill-color', value, '');
   }
 
@@ -7495,7 +7506,7 @@
     getPropertyValue('text-indent');
 
   /** Sets the value of "text-indent" */
-  void set textIndent(String value) {
+  set textIndent(String value) {
     setProperty('text-indent', value, '');
   }
 
@@ -7504,7 +7515,7 @@
     getPropertyValue('text-justify');
 
   /** Sets the value of "text-justify" */
-  void set textJustify(String value) {
+  set textJustify(String value) {
     setProperty('text-justify', value, '');
   }
 
@@ -7513,7 +7524,7 @@
     getPropertyValue('text-line-through-color');
 
   /** Sets the value of "text-line-through-color" */
-  void set textLineThroughColor(String value) {
+  set textLineThroughColor(String value) {
     setProperty('text-line-through-color', value, '');
   }
 
@@ -7522,7 +7533,7 @@
     getPropertyValue('text-line-through-mode');
 
   /** Sets the value of "text-line-through-mode" */
-  void set textLineThroughMode(String value) {
+  set textLineThroughMode(String value) {
     setProperty('text-line-through-mode', value, '');
   }
 
@@ -7531,7 +7542,7 @@
     getPropertyValue('text-line-through-style');
 
   /** Sets the value of "text-line-through-style" */
-  void set textLineThroughStyle(String value) {
+  set textLineThroughStyle(String value) {
     setProperty('text-line-through-style', value, '');
   }
 
@@ -7540,7 +7551,7 @@
     getPropertyValue('text-line-through-width');
 
   /** Sets the value of "text-line-through-width" */
-  void set textLineThroughWidth(String value) {
+  set textLineThroughWidth(String value) {
     setProperty('text-line-through-width', value, '');
   }
 
@@ -7549,7 +7560,7 @@
     getPropertyValue('text-orientation');
 
   /** Sets the value of "text-orientation" */
-  void set textOrientation(String value) {
+  set textOrientation(String value) {
     setProperty('text-orientation', value, '');
   }
 
@@ -7558,7 +7569,7 @@
     getPropertyValue('text-overflow');
 
   /** Sets the value of "text-overflow" */
-  void set textOverflow(String value) {
+  set textOverflow(String value) {
     setProperty('text-overflow', value, '');
   }
 
@@ -7567,7 +7578,7 @@
     getPropertyValue('text-overline-color');
 
   /** Sets the value of "text-overline-color" */
-  void set textOverlineColor(String value) {
+  set textOverlineColor(String value) {
     setProperty('text-overline-color', value, '');
   }
 
@@ -7576,7 +7587,7 @@
     getPropertyValue('text-overline-mode');
 
   /** Sets the value of "text-overline-mode" */
-  void set textOverlineMode(String value) {
+  set textOverlineMode(String value) {
     setProperty('text-overline-mode', value, '');
   }
 
@@ -7585,7 +7596,7 @@
     getPropertyValue('text-overline-style');
 
   /** Sets the value of "text-overline-style" */
-  void set textOverlineStyle(String value) {
+  set textOverlineStyle(String value) {
     setProperty('text-overline-style', value, '');
   }
 
@@ -7594,7 +7605,7 @@
     getPropertyValue('text-overline-width');
 
   /** Sets the value of "text-overline-width" */
-  void set textOverlineWidth(String value) {
+  set textOverlineWidth(String value) {
     setProperty('text-overline-width', value, '');
   }
 
@@ -7603,7 +7614,7 @@
     getPropertyValue('text-rendering');
 
   /** Sets the value of "text-rendering" */
-  void set textRendering(String value) {
+  set textRendering(String value) {
     setProperty('text-rendering', value, '');
   }
 
@@ -7612,7 +7623,7 @@
     getPropertyValue('text-security');
 
   /** Sets the value of "text-security" */
-  void set textSecurity(String value) {
+  set textSecurity(String value) {
     setProperty('text-security', value, '');
   }
 
@@ -7621,7 +7632,7 @@
     getPropertyValue('text-shadow');
 
   /** Sets the value of "text-shadow" */
-  void set textShadow(String value) {
+  set textShadow(String value) {
     setProperty('text-shadow', value, '');
   }
 
@@ -7630,7 +7641,7 @@
     getPropertyValue('text-stroke');
 
   /** Sets the value of "text-stroke" */
-  void set textStroke(String value) {
+  set textStroke(String value) {
     setProperty('text-stroke', value, '');
   }
 
@@ -7639,7 +7650,7 @@
     getPropertyValue('text-stroke-color');
 
   /** Sets the value of "text-stroke-color" */
-  void set textStrokeColor(String value) {
+  set textStrokeColor(String value) {
     setProperty('text-stroke-color', value, '');
   }
 
@@ -7648,7 +7659,7 @@
     getPropertyValue('text-stroke-width');
 
   /** Sets the value of "text-stroke-width" */
-  void set textStrokeWidth(String value) {
+  set textStrokeWidth(String value) {
     setProperty('text-stroke-width', value, '');
   }
 
@@ -7657,7 +7668,7 @@
     getPropertyValue('text-transform');
 
   /** Sets the value of "text-transform" */
-  void set textTransform(String value) {
+  set textTransform(String value) {
     setProperty('text-transform', value, '');
   }
 
@@ -7666,7 +7677,7 @@
     getPropertyValue('text-underline-color');
 
   /** Sets the value of "text-underline-color" */
-  void set textUnderlineColor(String value) {
+  set textUnderlineColor(String value) {
     setProperty('text-underline-color', value, '');
   }
 
@@ -7675,7 +7686,7 @@
     getPropertyValue('text-underline-mode');
 
   /** Sets the value of "text-underline-mode" */
-  void set textUnderlineMode(String value) {
+  set textUnderlineMode(String value) {
     setProperty('text-underline-mode', value, '');
   }
 
@@ -7684,7 +7695,7 @@
     getPropertyValue('text-underline-position');
 
   /** Sets the value of "text-underline-position" */
-  void set textUnderlinePosition(String value) {
+  set textUnderlinePosition(String value) {
     setProperty('text-underline-position', value, '');
   }
 
@@ -7693,7 +7704,7 @@
     getPropertyValue('text-underline-style');
 
   /** Sets the value of "text-underline-style" */
-  void set textUnderlineStyle(String value) {
+  set textUnderlineStyle(String value) {
     setProperty('text-underline-style', value, '');
   }
 
@@ -7702,7 +7713,7 @@
     getPropertyValue('text-underline-width');
 
   /** Sets the value of "text-underline-width" */
-  void set textUnderlineWidth(String value) {
+  set textUnderlineWidth(String value) {
     setProperty('text-underline-width', value, '');
   }
 
@@ -7711,7 +7722,7 @@
     getPropertyValue('top');
 
   /** Sets the value of "top" */
-  void set top(String value) {
+  set top(String value) {
     setProperty('top', value, '');
   }
 
@@ -7720,7 +7731,7 @@
     getPropertyValue('touch-action');
 
   /** Sets the value of "touch-action" */
-  void set touchAction(String value) {
+  set touchAction(String value) {
     setProperty('touch-action', value, '');
   }
 
@@ -7729,7 +7740,7 @@
     getPropertyValue('touch-action-delay');
 
   /** Sets the value of "touch-action-delay" */
-  void set touchActionDelay(String value) {
+  set touchActionDelay(String value) {
     setProperty('touch-action-delay', value, '');
   }
 
@@ -7738,7 +7749,7 @@
     getPropertyValue('transform');
 
   /** Sets the value of "transform" */
-  void set transform(String value) {
+  set transform(String value) {
     setProperty('transform', value, '');
   }
 
@@ -7747,7 +7758,7 @@
     getPropertyValue('transform-origin');
 
   /** Sets the value of "transform-origin" */
-  void set transformOrigin(String value) {
+  set transformOrigin(String value) {
     setProperty('transform-origin', value, '');
   }
 
@@ -7756,7 +7767,7 @@
     getPropertyValue('transform-origin-x');
 
   /** Sets the value of "transform-origin-x" */
-  void set transformOriginX(String value) {
+  set transformOriginX(String value) {
     setProperty('transform-origin-x', value, '');
   }
 
@@ -7765,7 +7776,7 @@
     getPropertyValue('transform-origin-y');
 
   /** Sets the value of "transform-origin-y" */
-  void set transformOriginY(String value) {
+  set transformOriginY(String value) {
     setProperty('transform-origin-y', value, '');
   }
 
@@ -7774,7 +7785,7 @@
     getPropertyValue('transform-origin-z');
 
   /** Sets the value of "transform-origin-z" */
-  void set transformOriginZ(String value) {
+  set transformOriginZ(String value) {
     setProperty('transform-origin-z', value, '');
   }
 
@@ -7783,7 +7794,7 @@
     getPropertyValue('transform-style');
 
   /** Sets the value of "transform-style" */
-  void set transformStyle(String value) {
+  set transformStyle(String value) {
     setProperty('transform-style', value, '');
   }
 
@@ -7798,7 +7809,7 @@
   @SupportedBrowser(SupportedBrowser.FIREFOX)
   @SupportedBrowser(SupportedBrowser.IE, '10')
   @SupportedBrowser(SupportedBrowser.SAFARI)
-  void set transition(String value) {
+  set transition(String value) {
     setProperty('transition', value, '');
   }
 
@@ -7807,7 +7818,7 @@
     getPropertyValue('transition-delay');
 
   /** Sets the value of "transition-delay" */
-  void set transitionDelay(String value) {
+  set transitionDelay(String value) {
     setProperty('transition-delay', value, '');
   }
 
@@ -7816,7 +7827,7 @@
     getPropertyValue('transition-duration');
 
   /** Sets the value of "transition-duration" */
-  void set transitionDuration(String value) {
+  set transitionDuration(String value) {
     setProperty('transition-duration', value, '');
   }
 
@@ -7825,7 +7836,7 @@
     getPropertyValue('transition-property');
 
   /** Sets the value of "transition-property" */
-  void set transitionProperty(String value) {
+  set transitionProperty(String value) {
     setProperty('transition-property', value, '');
   }
 
@@ -7834,7 +7845,7 @@
     getPropertyValue('transition-timing-function');
 
   /** Sets the value of "transition-timing-function" */
-  void set transitionTimingFunction(String value) {
+  set transitionTimingFunction(String value) {
     setProperty('transition-timing-function', value, '');
   }
 
@@ -7843,7 +7854,7 @@
     getPropertyValue('unicode-bidi');
 
   /** Sets the value of "unicode-bidi" */
-  void set unicodeBidi(String value) {
+  set unicodeBidi(String value) {
     setProperty('unicode-bidi', value, '');
   }
 
@@ -7852,7 +7863,7 @@
     getPropertyValue('unicode-range');
 
   /** Sets the value of "unicode-range" */
-  void set unicodeRange(String value) {
+  set unicodeRange(String value) {
     setProperty('unicode-range', value, '');
   }
 
@@ -7861,7 +7872,7 @@
     getPropertyValue('user-drag');
 
   /** Sets the value of "user-drag" */
-  void set userDrag(String value) {
+  set userDrag(String value) {
     setProperty('user-drag', value, '');
   }
 
@@ -7870,7 +7881,7 @@
     getPropertyValue('user-modify');
 
   /** Sets the value of "user-modify" */
-  void set userModify(String value) {
+  set userModify(String value) {
     setProperty('user-modify', value, '');
   }
 
@@ -7879,7 +7890,7 @@
     getPropertyValue('user-select');
 
   /** Sets the value of "user-select" */
-  void set userSelect(String value) {
+  set userSelect(String value) {
     setProperty('user-select', value, '');
   }
 
@@ -7888,7 +7899,7 @@
     getPropertyValue('user-zoom');
 
   /** Sets the value of "user-zoom" */
-  void set userZoom(String value) {
+  set userZoom(String value) {
     setProperty('user-zoom', value, '');
   }
 
@@ -7897,7 +7908,7 @@
     getPropertyValue('vertical-align');
 
   /** Sets the value of "vertical-align" */
-  void set verticalAlign(String value) {
+  set verticalAlign(String value) {
     setProperty('vertical-align', value, '');
   }
 
@@ -7906,7 +7917,7 @@
     getPropertyValue('visibility');
 
   /** Sets the value of "visibility" */
-  void set visibility(String value) {
+  set visibility(String value) {
     setProperty('visibility', value, '');
   }
 
@@ -7915,7 +7926,7 @@
     getPropertyValue('white-space');
 
   /** Sets the value of "white-space" */
-  void set whiteSpace(String value) {
+  set whiteSpace(String value) {
     setProperty('white-space', value, '');
   }
 
@@ -7924,7 +7935,7 @@
     getPropertyValue('widows');
 
   /** Sets the value of "widows" */
-  void set widows(String value) {
+  set widows(String value) {
     setProperty('widows', value, '');
   }
 
@@ -7933,7 +7944,7 @@
     getPropertyValue('width');
 
   /** Sets the value of "width" */
-  void set width(String value) {
+  set width(String value) {
     setProperty('width', value, '');
   }
 
@@ -7942,7 +7953,7 @@
     getPropertyValue('will-change');
 
   /** Sets the value of "will-change" */
-  void set willChange(String value) {
+  set willChange(String value) {
     setProperty('will-change', value, '');
   }
 
@@ -7951,7 +7962,7 @@
     getPropertyValue('word-break');
 
   /** Sets the value of "word-break" */
-  void set wordBreak(String value) {
+  set wordBreak(String value) {
     setProperty('word-break', value, '');
   }
 
@@ -7960,7 +7971,7 @@
     getPropertyValue('word-spacing');
 
   /** Sets the value of "word-spacing" */
-  void set wordSpacing(String value) {
+  set wordSpacing(String value) {
     setProperty('word-spacing', value, '');
   }
 
@@ -7969,7 +7980,7 @@
     getPropertyValue('word-wrap');
 
   /** Sets the value of "word-wrap" */
-  void set wordWrap(String value) {
+  set wordWrap(String value) {
     setProperty('word-wrap', value, '');
   }
 
@@ -7978,7 +7989,7 @@
     getPropertyValue('wrap-flow');
 
   /** Sets the value of "wrap-flow" */
-  void set wrapFlow(String value) {
+  set wrapFlow(String value) {
     setProperty('wrap-flow', value, '');
   }
 
@@ -7987,7 +7998,7 @@
     getPropertyValue('wrap-through');
 
   /** Sets the value of "wrap-through" */
-  void set wrapThrough(String value) {
+  set wrapThrough(String value) {
     setProperty('wrap-through', value, '');
   }
 
@@ -7996,7 +8007,7 @@
     getPropertyValue('writing-mode');
 
   /** Sets the value of "writing-mode" */
-  void set writingMode(String value) {
+  set writingMode(String value) {
     setProperty('writing-mode', value, '');
   }
 
@@ -8005,7 +8016,7 @@
     getPropertyValue('z-index');
 
   /** Sets the value of "z-index" */
-  void set zIndex(String value) {
+  set zIndex(String value) {
     setProperty('z-index', value, '');
   }
 
@@ -8014,7 +8025,7 @@
     getPropertyValue('zoom');
 
   /** Sets the value of "zoom" */
-  void set zoom(String value) {
+  set zoom(String value) {
     setProperty('zoom', value, '');
   }
 }
@@ -9232,9 +9243,10 @@
   @DocsEditable()
   Element _createElement(String localName_OR_tagName, [String typeExtension]) native;
 
+  @JSName('createElementNS')
   @DomName('Document.createElementNS')
   @DocsEditable()
-  Element createElementNS(String namespaceURI, String qualifiedName, [String typeExtension]) native;
+  Element _createElementNS(String namespaceURI, String qualifiedName, [String typeExtension]) native;
 
   @JSName('createEvent')
   @DomName('Document.createEvent')
@@ -9833,7 +9845,32 @@
 
   @DomName('Document.createElement')
   Element createElement(String tagName, [String typeExtension]) {
-    return _createElement(tagName, typeExtension);
+    if (typeExtension == null) {
+      return _createElement_2(tagName);
+    } else {
+      return _createElement(tagName, typeExtension);
+    }
+  }
+
+  // The two-argument version of this is automatically generated, but we need to
+  // omit the typeExtension if it's null on Firefox or we get an is="null" attribute.
+  @DomName('Document.createElement')
+  _createElement_2(String tagName) => JS('', '#.createElement(#)', this, tagName);
+
+  // The three-argument version of this is automatically generated, but we need to
+  // omit the typeExtension if it's null on Firefox or we get an is="null" attribute.
+  @DomName('Document.createElementNS')
+  _createElementNS_2(String namespaceURI, String qualifiedName) =>
+      JS('', '#.createElementNS(#, #)', this, namespaceURI, qualifiedName);
+
+  @DomName('Document.createElementNS')
+  @DocsEditable()
+  Element createElementNS(String namespaceURI, String qualifiedName, [String typeExtension]) {
+    if (typeExtension == null) {
+      return _createElementNS_2(namespaceURI, qualifiedName);
+    } else {
+      return _createElementNS(namespaceURI, qualifiedName, typeExtension);
+    }
   }
 
   @DomName('Document.createNodeIterator')
@@ -9887,7 +9924,7 @@
     return _docChildren;
   }
 
-  void set children(List<Element> value) {
+  set children(List<Element> value) {
     // Copy list first since we don't want liveness during iteration.
     List copy = new List.from(value);
     var children = this.children;
@@ -9909,14 +9946,13 @@
   ElementList<Element> querySelectorAll(String selectors) =>
     new _FrozenElementList._wrap(_querySelectorAll(selectors));
 
-
   String get innerHtml {
     final e = new Element.tag("div");
     e.append(this.clone(true));
     return e.innerHtml;
   }
 
-  void set innerHtml(String value) {
+  set innerHtml(String value) {
     this.setInnerHtml(value);
   }
 
@@ -10179,154 +10215,154 @@
   // Shadowing definition.
   num get a => JS("num", "#.a", this);
 
-  void set a(num value) {
+  set a(num value) {
     JS("void", "#.a = #", this, value);
   }
 
   // Shadowing definition.
   num get b => JS("num", "#.b", this);
 
-  void set b(num value) {
+  set b(num value) {
     JS("void", "#.b = #", this, value);
   }
 
   // Shadowing definition.
   num get c => JS("num", "#.c", this);
 
-  void set c(num value) {
+  set c(num value) {
     JS("void", "#.c = #", this, value);
   }
 
   // Shadowing definition.
   num get d => JS("num", "#.d", this);
 
-  void set d(num value) {
+  set d(num value) {
     JS("void", "#.d = #", this, value);
   }
 
   // Shadowing definition.
   num get e => JS("num", "#.e", this);
 
-  void set e(num value) {
+  set e(num value) {
     JS("void", "#.e = #", this, value);
   }
 
   // Shadowing definition.
   num get f => JS("num", "#.f", this);
 
-  void set f(num value) {
+  set f(num value) {
     JS("void", "#.f = #", this, value);
   }
 
   // Shadowing definition.
   num get m11 => JS("num", "#.m11", this);
 
-  void set m11(num value) {
+  set m11(num value) {
     JS("void", "#.m11 = #", this, value);
   }
 
   // Shadowing definition.
   num get m12 => JS("num", "#.m12", this);
 
-  void set m12(num value) {
+  set m12(num value) {
     JS("void", "#.m12 = #", this, value);
   }
 
   // Shadowing definition.
   num get m13 => JS("num", "#.m13", this);
 
-  void set m13(num value) {
+  set m13(num value) {
     JS("void", "#.m13 = #", this, value);
   }
 
   // Shadowing definition.
   num get m14 => JS("num", "#.m14", this);
 
-  void set m14(num value) {
+  set m14(num value) {
     JS("void", "#.m14 = #", this, value);
   }
 
   // Shadowing definition.
   num get m21 => JS("num", "#.m21", this);
 
-  void set m21(num value) {
+  set m21(num value) {
     JS("void", "#.m21 = #", this, value);
   }
 
   // Shadowing definition.
   num get m22 => JS("num", "#.m22", this);
 
-  void set m22(num value) {
+  set m22(num value) {
     JS("void", "#.m22 = #", this, value);
   }
 
   // Shadowing definition.
   num get m23 => JS("num", "#.m23", this);
 
-  void set m23(num value) {
+  set m23(num value) {
     JS("void", "#.m23 = #", this, value);
   }
 
   // Shadowing definition.
   num get m24 => JS("num", "#.m24", this);
 
-  void set m24(num value) {
+  set m24(num value) {
     JS("void", "#.m24 = #", this, value);
   }
 
   // Shadowing definition.
   num get m31 => JS("num", "#.m31", this);
 
-  void set m31(num value) {
+  set m31(num value) {
     JS("void", "#.m31 = #", this, value);
   }
 
   // Shadowing definition.
   num get m32 => JS("num", "#.m32", this);
 
-  void set m32(num value) {
+  set m32(num value) {
     JS("void", "#.m32 = #", this, value);
   }
 
   // Shadowing definition.
   num get m33 => JS("num", "#.m33", this);
 
-  void set m33(num value) {
+  set m33(num value) {
     JS("void", "#.m33 = #", this, value);
   }
 
   // Shadowing definition.
   num get m34 => JS("num", "#.m34", this);
 
-  void set m34(num value) {
+  set m34(num value) {
     JS("void", "#.m34 = #", this, value);
   }
 
   // Shadowing definition.
   num get m41 => JS("num", "#.m41", this);
 
-  void set m41(num value) {
+  set m41(num value) {
     JS("void", "#.m41 = #", this, value);
   }
 
   // Shadowing definition.
   num get m42 => JS("num", "#.m42", this);
 
-  void set m42(num value) {
+  set m42(num value) {
     JS("void", "#.m42 = #", this, value);
   }
 
   // Shadowing definition.
   num get m43 => JS("num", "#.m43", this);
 
-  void set m43(num value) {
+  set m43(num value) {
     JS("void", "#.m43 = #", this, value);
   }
 
   // Shadowing definition.
   num get m44 => JS("num", "#.m44", this);
 
-  void set m44(num value) {
+  set m44(num value) {
     JS("void", "#.m44 = #", this, value);
   }
 
@@ -10597,28 +10633,28 @@
   // Shadowing definition.
   num get w => JS("num", "#.w", this);
 
-  void set w(num value) {
+  set w(num value) {
     JS("void", "#.w = #", this, value);
   }
 
   // Shadowing definition.
   num get x => JS("num", "#.x", this);
 
-  void set x(num value) {
+  set x(num value) {
     JS("void", "#.x = #", this, value);
   }
 
   // Shadowing definition.
   num get y => JS("num", "#.y", this);
 
-  void set y(num value) {
+  set y(num value) {
     JS("void", "#.y = #", this, value);
   }
 
   // Shadowing definition.
   num get z => JS("num", "#.z", this);
 
-  void set z(num value) {
+  set z(num value) {
     JS("void", "#.z = #", this, value);
   }
 }
@@ -10862,7 +10898,7 @@
   // String is the element type.
 
 
-  void set length(int value) {
+  set length(int value) {
     throw new UnsupportedError("Cannot resize immutable List.");
   }
 
@@ -10990,7 +11026,7 @@
     _element._replaceChild(value, _childElements[index]);
   }
 
-  void set length(int newLength) {
+  set length(int newLength) {
     // TODO(jacobr): remove children when length is reduced.
     throw new UnsupportedError('Cannot resize element lists');
   }
@@ -11696,7 +11732,7 @@
     throw new UnsupportedError('Cannot modify list');
   }
 
-  void set length(int newLength) {
+  set length(int newLength) {
     throw new UnsupportedError('Cannot modify list');
   }
 
@@ -11719,7 +11755,7 @@
   CssStyleDeclarationBase get style =>
       new _CssStyleDeclarationSet(this);
 
-  void set classes(Iterable<String> value) {
+  set classes(Iterable<String> value) {
     // TODO(sra): This might be faster for Sets:
     //
     //     new _MultiElementCssClassSet(this).writeClasses(value)
@@ -12214,7 +12250,7 @@
  */
 @DomName('Element')
 @Native("Element")
-abstract class Element extends Node implements GlobalEventHandlers, ParentNode, ChildNode {
+class Element extends Node implements GlobalEventHandlers, ParentNode, ChildNode {
 
   /**
    * Creates an HTML element from a valid fragment of HTML.
@@ -12261,11 +12297,7 @@
    *     }
    *     document.registerElement('x-custom', CustomElement);
    */
-  Element.created() : super._created() {
-    // Validate that this is a custom element & perform any additional
-    // initialization.
-    _initializeCustomElement(this);
-  }
+  Element.created() : super._created();
 
   /**
    * Creates the HTML element specified by the tag name.
@@ -12446,7 +12478,7 @@
    */
   Map<String, String> get attributes => new _ElementAttributeMap(this);
 
-  void set attributes(Map<String, String> value) {
+  set attributes(Map<String, String> value) {
     Map<String, String> attributes = this.attributes;
     attributes.clear();
     for (String key in value.keys) {
@@ -12468,7 +12500,7 @@
    */
   List<Element> get children => new _ChildrenElementList._wrap(this);
 
-  void set children(List<Element> value) {
+  set children(List<Element> value) {
     // Copy list first since we don't want liveness during iteration.
     List copy = new List.from(value);
     var children = this.children;
@@ -12522,7 +12554,7 @@
    */
   CssClassSet get classes => new _ElementCssClassSet(this);
 
-  void set classes(Iterable<String> value) {
+  set classes(Iterable<String> value) {
     // TODO(sra): Do this without reading the classes in clear() and addAll(),
     // or writing the classes in clear().
     CssClassSet classSet = classes;
@@ -12556,7 +12588,7 @@
   Map<String, String> get dataset =>
     new _DataAttributeMap(attributes);
 
-  void set dataset(Map<String, String> value) {
+  set dataset(Map<String, String> value) {
     final data = this.dataset;
     data.clear();
     for (String key in value.keys) {
@@ -12689,18 +12721,15 @@
    *     var animation = elem.animate([
    *       {"transform": "translate(100px, -100%)"},
    *       {"transform" : "translate(400px, 500px)"}
-   *     ], 1500);  
+   *     ], 1500);
    *
    * The [frames] parameter is an Iterable<Map>, where the
    * map entries specify CSS animation effects. The
    * [timing] paramter can be a double, representing the number of milliseconds
    * for the transition, or a Map with fields corresponding to those
    * of the [Timing] object.
-   *
-   * This is not yet supported in Dartium.
   **/
-// TODO(alanknight): Correct above comment once it works in Dartium.
-  @Experimental
+  @Experimental()
   @SupportedBrowser(SupportedBrowser.CHROME, '36')
   AnimationPlayer animate(Iterable<Map<String, dynamic>> frames, [timing]) {
     if (frames is! Iterable || !(frames.every((x) => x is Map))) {
@@ -12750,7 +12779,7 @@
   // members of the component are used. The actual type is a subtype of Element.
   get xtag => _xtag != null ? _xtag : this;
 
-  void set xtag(Element value) {
+  set xtag(Element value) {
     _xtag = value;
   }
 
@@ -12869,7 +12898,7 @@
 
   @JSName('insertAdjacentText')
   void _insertAdjacentText(String where, String text) native;
-  
+
 
   /**
    * Parses text as an HTML fragment and inserts it into the DOM at the
@@ -13122,8 +13151,9 @@
     // offsetParent, "tops out" at BODY. But people could conceivably pass in
     // the document.documentElement and I want it to return an absolute offset,
     // so we have the special case checking for HTML.
-    bool foundAsParent = identical(current, parent) || parent.tagName == 'HTML';
-    if (current == null || identical(current, parent)) {
+    bool sameAsParent = identical(current, parent);
+    bool foundAsParent = sameAsParent || parent.tagName == 'HTML';
+    if (current == null || sameAsParent) {
       if (foundAsParent) return new Point(0, 0);
       throw new ArgumentError("Specified element is not a transitive offset "
           "parent of this element.");
@@ -13181,11 +13211,11 @@
     if (_parseDocument == null) {
       _parseDocument = document.implementation.createHtmlDocument('');
       _parseRange = _parseDocument.createRange();
-	
+
       // Workaround for Safari bug. Was also previously Chrome bug 229142
-      // - URIs are not resolved in new doc.	
-      var base = _parseDocument.createElement('base');	
-      base.href = document.baseUri;	
+      // - URIs are not resolved in new doc.
+      var base = _parseDocument.createElement('base');
+      base.href = document.baseUri;
       _parseDocument.head.append(base);
     }
     var contextElement;
@@ -13243,7 +13273,7 @@
    * This uses the default sanitization behavior to sanitize the HTML fragment,
    * use [setInnerHtml] to override the default behavior.
    */
-  void set innerHtml(String html) {
+  set innerHtml(String html) {
     this.setInnerHtml(html);
   }
 
@@ -13285,7 +13315,7 @@
    * used when an explicit accessor is not available.
    */
   ElementEvents get on => new ElementEvents(this);
-  
+
   /**
    * Verify if any of the attributes that we use in the sanitizer look unexpected,
    * possibly indicating DOM clobbering attacks.
@@ -13309,10 +13339,43 @@
 	     return true;
 	   }
 	 }
+         var length = 0;
+         if (element.children) {
+           length = element.children.length;
+         }
+         for (var i = 0; i < length; i++) {
+           var child = element.children[i];
+           // On IE it seems like we sometimes don't see the clobbered attribute,
+           // perhaps as a result of an over-optimization. Also use another route
+           // to check of attributes, children, or lastChild are clobbered. It may
+           // seem silly to check children as we rely on children to do this iteration,
+           // but it seems possible that the access to children might see the real thing,
+           // allowing us to check for clobbering that may show up in other accesses.
+           if (child["id"] == 'attributes' || child["name"] == 'attributes' ||
+               child["id"] == 'lastChild'  || child["name"] == 'lastChild' ||
+               child["id"] == 'children' || child["name"] == 'children') {
+             return true;
+           }
+         }
 	 return false;
           })(#)''', element);
   }
 
+  /// A secondary check for corruption, needed on IE
+  static bool _hasCorruptedAttributesAdditionalCheck(Element element) {
+    return JS('bool', r'!(#.attributes instanceof NamedNodeMap)', element);
+  }
+
+  static String _safeTagName(element) {
+    String result = 'element tag unavailable';
+    try {
+      if (element.tagName is String) {
+        result = element.tagName;
+      }
+    } catch (e) {}
+    return result;
+  }
+
   @DomName('Element.offsetHeight')
   @DocsEditable()
   int get offsetHeight => JS('num', '#.offsetHeight', this).round();
@@ -13355,7 +13418,7 @@
 
   @DomName('Element.scrollLeft')
   @DocsEditable()
-  void set scrollLeft(int value) {
+  set scrollLeft(int value) {
     JS("void", "#.scrollLeft = #", this, value.round());
   }
 
@@ -13365,7 +13428,7 @@
 
   @DomName('Element.scrollTop')
   @DocsEditable()
-  void set scrollTop(int value) {
+  set scrollTop(int value) {
     JS("void", "#.scrollTop = #", this, value.round());
   }
 
@@ -15978,7 +16041,7 @@
   // File is the element type.
 
 
-  void set length(int value) {
+  set length(int value) {
     throw new UnsupportedError("Cannot resize immutable List.");
   }
 
@@ -17840,7 +17903,7 @@
   // Node is the element type.
 
 
-  void set length(int value) {
+  set length(int value) {
     throw new UnsupportedError("Cannot resize immutable List.");
   }
 
@@ -17960,7 +18023,7 @@
 
   @DomName('Document.selectedStylesheetSet')
   String get selectedStylesheetSet => _selectedStylesheetSet;
-  void set selectedStylesheetSet(String value) {
+  set selectedStylesheetSet(String value) {
     _selectedStylesheetSet = value;
   }
 
@@ -17971,7 +18034,7 @@
   String get title => _title;
 
   @DomName('Document.title')
-  void set title(String value) {
+  set title(String value) {
     _title = value;
   }
 
@@ -18577,6 +18640,25 @@
     return headers;
   }
 
+  /**
+   * Specify the desired `url`, and `method` to use in making the request.
+   *
+   * By default the request is done asyncronously, with no user or password
+   * authentication information. If `async` is false, the request will be send
+   * synchronously.
+   *
+   * Calling `open` again on a currently active request is equivalent to
+   * calling `abort`.
+   *
+   * Note: Most simple HTTP requests can be accomplished using the [getString],
+   * [request], [requestCrossOrigin], or [postFormData] methods. Use of this
+   * `open` method is intended only for more complext HTTP requests where
+   * finer-grained control is needed.
+   */
+  @DomName('XMLHttpRequest.open')
+  @DocsEditable()
+  void open(String method, String url, {bool async, String user, String password}) native;
+
   // To suppress missing implicit constructor warnings.
   factory HttpRequest._() { throw new UnsupportedError("Not supported"); }
 
@@ -18833,25 +18915,6 @@
   String getResponseHeader(String header) native;
 
   /**
-   * Specify the desired `url`, and `method` to use in making the request.
-   *
-   * By default the request is done asyncronously, with no user or password
-   * authentication information. If `async` is false, the request will be send
-   * synchronously.
-   *
-   * Calling `open` again on a currently active request is equivalent to
-   * calling `abort`.
-   *
-   * Note: Most simple HTTP requests can be accomplished using the [getString],
-   * [request], [requestCrossOrigin], or [postFormData] methods. Use of this
-   * `open` method is intended only for more complext HTTP requests where
-   * finer-grained control is needed.
-   */
-  @DomName('XMLHttpRequest.open')
-  @DocsEditable()
-  void open(String method, String url, {bool async, String user, String password}) native;
-
-  /**
    * Specify a particular MIME type (such as `text/xml`) desired for the
    * response.
    *
@@ -19543,10 +19606,10 @@
   @Creates('Null')
   final dynamic _get_valueAsDate;
 
-  void set valueAsDate(DateTime value) {
+  set valueAsDate(DateTime value) {
     this._set_valueAsDate = convertDartToNative_DateTime(value);
   }
-  void set _set_valueAsDate(/*dynamic*/ value) {
+  set _set_valueAsDate(/*dynamic*/ value) {
     JS("void", "#.valueAsDate = #", this, value);
   }
 
@@ -22661,7 +22724,7 @@
   // MimeType is the element type.
 
 
-  void set length(int value) {
+  set length(int value) {
     throw new UnsupportedError("Cannot resize immutable List.");
   }
 
@@ -23287,11 +23350,6 @@
   @Experimental()
   void getStorageUpdates() native;
 
-  @DomName('Navigator.isProtocolHandlerRegistered')
-  @DocsEditable()
-  @Experimental() // untriaged
-  String isProtocolHandlerRegistered(String scheme, String url) native;
-
   @DomName('Navigator.registerProtocolHandler')
   @DocsEditable()
   @Unstable()
@@ -23302,11 +23360,6 @@
   @Experimental() // untriaged
   bool sendBeacon(String url, data) native;
 
-  @DomName('Navigator.unregisterProtocolHandler')
-  @DocsEditable()
-  @Experimental() // untriaged
-  void unregisterProtocolHandler(String scheme, String url) native;
-
   // From NavigatorCPU
 
   @DomName('Navigator.hardwareConcurrency')
@@ -23658,7 +23711,7 @@
   // a local copy of childNodes is more efficient.
   int get length => _this.childNodes.length;
 
-  void set length(int value) {
+  set length(int value) {
     throw new UnsupportedError(
         "Cannot set length on immutable List.");
   }
@@ -23683,7 +23736,7 @@
     return new _ChildNodeListLazy(this);
   }
 
-  void set nodes(Iterable<Node> value) {
+  set nodes(Iterable<Node> value) {
     // Copy list first since we don't want liveness during iteration.
     // TODO(jacobr): there is a better way to do this.
     List copy = new List.from(value);
@@ -24222,7 +24275,7 @@
   // Node is the element type.
 
 
-  void set length(int value) {
+  set length(int value) {
     throw new UnsupportedError("Cannot resize immutable List.");
   }
 
@@ -25404,7 +25457,7 @@
   // Plugin is the element type.
 
 
-  void set length(int value) {
+  set length(int value) {
     throw new UnsupportedError("Cannot resize immutable List.");
   }
 
@@ -27668,7 +27721,7 @@
   }
 
   @deprecated
-  void set resetStyleInheritance(bool value) {
+  set resetStyleInheritance(bool value) {
     _shadowRootDeprecationReport();
   }
 
@@ -27680,7 +27733,7 @@
   }
 
   @deprecated
-  void set applyAuthorStyles(bool value) {
+  set applyAuthorStyles(bool value) {
     _shadowRootDeprecationReport();
   }
 }
@@ -27861,7 +27914,7 @@
   // SourceBuffer is the element type.
 
 
-  void set length(int value) {
+  set length(int value) {
     throw new UnsupportedError("Cannot resize immutable List.");
   }
 
@@ -28067,7 +28120,7 @@
   // SpeechGrammar is the element type.
 
 
-  void set length(int value) {
+  set length(int value) {
     throw new UnsupportedError("Cannot resize immutable List.");
   }
 
@@ -29932,7 +29985,7 @@
   // TextTrackCue is the element type.
 
 
-  void set length(int value) {
+  set length(int value) {
     throw new UnsupportedError("Cannot resize immutable List.");
   }
 
@@ -30017,7 +30070,7 @@
   // TextTrack is the element type.
 
 
-  void set length(int value) {
+  set length(int value) {
     throw new UnsupportedError("Cannot resize immutable List.");
   }
 
@@ -30418,7 +30471,7 @@
   // Touch is the element type.
 
 
-  void set length(int value) {
+  set length(int value) {
     throw new UnsupportedError("Cannot resize immutable List.");
   }
 
@@ -31632,7 +31685,7 @@
     if (view == null) {
       view = window;
     }
-    
+
     return JS('WheelEvent', 'new WheelEvent(#, #)',
         type, convertDartToNative_Dictionary(options));
 
@@ -31876,13 +31929,13 @@
    * Sets the window's location, which causes the browser to navigate to the new
    * location. [value] may be a Location object or a String.
    */
-  void set location(value) {
+  set location(value) {
     _location = value;
   }
 
   // Native getter and setter to access raw Location object.
   dynamic get _location => JS('Location|Null', '#.location', this);
-  void set _location(value) {
+  set _location(value) {
     JS('void', '#.location = #', this, value);
   }
 
@@ -32403,7 +32456,7 @@
   @Returns('Window|=Object')
   final dynamic _get_opener;
 
-  void set opener(Window value) {
+  set opener(Window value) {
     JS("void", "#.opener = #", this, value);
   }
 
@@ -33750,7 +33803,7 @@
 
   String get returnValue => _returnValue;
 
-  void set returnValue(String value) {
+  set returnValue(String value) {
     _returnValue = value;
     // FF and IE use the value as the return value, Chrome will return this from
     // the event callback function.
@@ -34455,7 +34508,7 @@
   // Shadowing definition.
   String get text => JS("String", "#.textContent", this);
 
-  void set text(String value) {
+  set text(String value) {
     JS("void", "#.textContent = #", this, value);
   }
 
@@ -34722,7 +34775,7 @@
   // Rectangle is the element type.
 
 
-  void set length(int value) {
+  set length(int value) {
     throw new UnsupportedError("Cannot resize immutable List.");
   }
 
@@ -34800,7 +34853,7 @@
   // CssRule is the element type.
 
 
-  void set length(int value) {
+  set length(int value) {
     throw new UnsupportedError("Cannot resize immutable List.");
   }
 
@@ -34866,7 +34919,7 @@
   // _CSSValue is the element type.
 
 
-  void set length(int value) {
+  set length(int value) {
     throw new UnsupportedError("Cannot resize immutable List.");
   }
 
@@ -34959,7 +35012,9 @@
   factory _DocumentType._() { throw new UnsupportedError("Not supported"); }
 
   // From ChildNode
+
 }
+
 // Copyright (c) 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.
@@ -34999,28 +35054,28 @@
   // Shadowing definition.
   num get height => JS("num", "#.height", this);
 
-  void set height(num value) {
+  set height(num value) {
     JS("void", "#.height = #", this, value);
   }
 
   // Shadowing definition.
   num get width => JS("num", "#.width", this);
 
-  void set width(num value) {
+  set width(num value) {
     JS("void", "#.width = #", this, value);
   }
 
   // Shadowing definition.
   num get x => JS("num", "#.x", this);
 
-  void set x(num value) {
+  set x(num value) {
     JS("void", "#.x = #", this, value);
   }
 
   // Shadowing definition.
   num get y => JS("num", "#.y", this);
 
-  void set y(num value) {
+  set y(num value) {
     JS("void", "#.y = #", this, value);
   }
 }
@@ -35118,7 +35173,7 @@
   // Gamepad is the element type.
 
 
-  void set length(int value) {
+  set length(int value) {
     throw new UnsupportedError("Cannot resize immutable List.");
   }
 
@@ -35271,7 +35326,9 @@
    * This can only be called by subclasses from their created constructor.
    */
   _HTMLFrameSetElement.created() : super.created();
+
 }
+
 // Copyright (c) 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.
@@ -35346,7 +35403,7 @@
   // Node is the element type.
 
 
-  void set length(int value) {
+  set length(int value) {
     throw new UnsupportedError("Cannot resize immutable List.");
   }
 
@@ -35593,7 +35650,9 @@
 abstract class _ServiceWorker extends EventTarget implements AbstractWorker {
   // To suppress missing implicit constructor warnings.
   factory _ServiceWorker._() { throw new UnsupportedError("Not supported"); }
+
 }
+
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
@@ -35625,7 +35684,7 @@
   // SpeechRecognitionResult is the element type.
 
 
-  void set length(int value) {
+  set length(int value) {
     throw new UnsupportedError("Cannot resize immutable List.");
   }
 
@@ -35689,7 +35748,7 @@
   // StyleSheet is the element type.
 
 
-  void set length(int value) {
+  set length(int value) {
     throw new UnsupportedError("Cannot resize immutable List.");
   }
 
@@ -35832,7 +35891,9 @@
   factory _WorkerLocation._() { throw new UnsupportedError("Not supported"); }
 
   // From URLUtilsReadOnly
+
 }
+
 // Copyright (c) 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.
@@ -35852,7 +35913,9 @@
   // From NavigatorID
 
   // From NavigatorOnLine
+
 }
+
 // Copyright (c) 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.
@@ -36467,7 +36530,7 @@
    * `height` function in jQuery and the calculated `height` CSS value,
    * converted to a num in pixels.
    */
-  void set height(newHeight) {
+  set height(newHeight) {
     if (newHeight is Dimension) {
       if (newHeight.value < 0) newHeight = new Dimension.px(0);
       _element.style.height = newHeight.toString();
@@ -36485,7 +36548,7 @@
    * and the calculated
    * `width` CSS value, converted to a dimensionless num in pixels.
    */
-  void set width(newWidth) {
+  set width(newWidth) {
     if (newWidth is Dimension) {
       if (newWidth.value < 0) newWidth = new Dimension.px(0);
       _element.style.width = newWidth.toString();
@@ -36520,7 +36583,7 @@
    * function in jQuery and the calculated `height` CSS value, converted to a
    * num in pixels.
    */
-  void set height(newHeight) {
+  set height(newHeight) {
     _elementList.forEach((e) => e.contentEdge.height = newHeight);
   }
 
@@ -36530,7 +36593,7 @@
    * This is equivalent to the `width` function in jQuery and the calculated
    * `width` CSS value, converted to a dimensionless num in pixels.
    */
-  void set width(newWidth) {
+  set width(newWidth) {
     _elementList.forEach((e) => e.contentEdge.width = newWidth);
   }
 }
@@ -36637,7 +36700,7 @@
    *
    * Note that only the content height can actually be set via this method.
    */
-  void set height(newHeight) {
+  set height(newHeight) {
     throw new UnsupportedError("Can only set height for content rect.");
   }
 
@@ -36651,7 +36714,7 @@
    *
    * Note that only the content width can be set via this method.
    */
-  void set width(newWidth) {
+  set width(newWidth) {
     throw new UnsupportedError("Can only set width for content rect.");
   }
 
@@ -37902,11 +37965,11 @@
   }
 
   bool allowsElement(Element element) {
-    return _allowedElements.contains(element.tagName);
+    return _allowedElements.contains(Element._safeTagName(element));
   }
 
   bool allowsAttribute(Element element, String attributeName, String value) {
-    var tagName = element.tagName;
+    var tagName = Element._safeTagName(element);
     var validator = _attributeValidators['$tagName::$attributeName'];
     if (validator == null) {
       validator = _attributeValidators['*::$attributeName'];
@@ -39568,11 +39631,11 @@
   }
 
   bool allowsElement(Element element) {
-    return allowedElements.contains(element.tagName);
+    return allowedElements.contains(Element._safeTagName(element));
   }
 
   bool allowsAttribute(Element element, String attributeName, String value) {
-    var tagName = element.tagName;
+    var tagName = Element._safeTagName(element);
     if (allowedUriAttributes.contains('$tagName::$attributeName')) {
       return uriPolicy.allowsUri(value);
     } else if (allowedUriAttributes.contains('*::$attributeName')) {
@@ -39613,10 +39676,10 @@
       var isAttr = element.attributes['is'];
       if (isAttr != null) {
         return allowedElements.contains(isAttr.toUpperCase()) &&
-          allowedElements.contains(element.tagName);
+            allowedElements.contains(Element._safeTagName(element));
       }
     }
-    return allowCustomTag && allowedElements.contains(element.tagName);
+    return allowCustomTag && allowedElements.contains(Element._safeTagName(element));
   }
 
   bool allowsAttribute(Element element, String attributeName, String value) {
@@ -39672,7 +39735,7 @@
     // foreignobject tag as SvgElement. We don't want foreignobject contents
     // anyway, so just remove the whole tree outright. And we can't rely
     // on IE recognizing the SvgForeignObject type, so go by tagName. Bug 23144
-    if (element is svg.SvgElement && element.tagName == 'foreignObject') {
+    if (element is svg.SvgElement && Element._safeTagName(element) == 'foreignObject') {
       return false;
     }
     if (element is svg.SvgElement) {
@@ -39748,7 +39811,7 @@
 
   void operator []=(int index, E value) { _list[index] = value; }
 
-  void set length(int newLength) { _list.length = newLength; }
+  set length(int newLength) { _list.length = newLength; }
 
   void sort([int compare(E a, E b)]) { _list.sort(compare); }
 
@@ -40194,7 +40257,7 @@
   // properly.  Its fields and methods can only be accessed via JavaScript.
   var _location;
 
-  void set href(String val) => _setHref(_location, val);
+  set href(String val) => _setHref(_location, val);
   static void _setHref(location, val) {
     JS('void', '#.href = #', location, val);
   }
@@ -40730,7 +40793,7 @@
   /**
    * A sanitizer for trees that we trust. It does no validation and allows
    * any elements. It is also more efficient, since it can pass the text
-   * directly through to the underlying APIs without creating a document 
+   * directly through to the underlying APIs without creating a document
    * fragment to be sanitized.
    */
   static const trusted = const _TrustedHtmlTreeSanitizer();
@@ -40745,7 +40808,7 @@
 
   sanitizeTree(Node node) {}
 }
-  
+
 /**
  * Defines the policy for what types of uris are allowed for particular
  * attribute values.
@@ -40799,14 +40862,14 @@
 
   bool allowsElement(Element element) {
     if (!validator.allowsElement(element)) {
-      throw new ArgumentError(element.tagName);
+      throw new ArgumentError(Element._safeTagName(element));
     }
     return true;
   }
 
   bool allowsAttribute(Element element, String attributeName, String value) {
     if (!validator.allowsAttribute(element, attributeName, value)) {
-      throw new ArgumentError('${element.tagName}[$attributeName="$value"]');
+      throw new ArgumentError('${Element._safeTagName(element)}[$attributeName="$value"]');
     }
   }
 }
@@ -40848,7 +40911,7 @@
   }
 
   /// Sanitize the element, assuming we can't trust anything about it.
-  void _sanitizeUntrustedElement(Element element, Node parent) {
+  void _sanitizeUntrustedElement(/* Element */ element, Node parent) {
     // If the _hasCorruptedAttributes does not successfully return false,
     // then we consider it corrupted and remove.
     // TODO(alanknight): This is a workaround because on Firefox
@@ -40857,7 +40920,9 @@
     // can't call methods. This does mean that you can't explicitly allow an
     // embed tag. The only thing that will let it through is a null
     // sanitizer that doesn't traverse the tree at all. But sanitizing while
-    // allowing embeds seems quite unlikely.
+    // allowing embeds seems quite unlikely. This is also the reason that we
+    // can't declare the type of element, as an embed won't pass any type
+    // check in dart2js.
     var corrupted = true;
     var attrs;
     var isAttr;
@@ -40865,18 +40930,27 @@
       // If getting/indexing attributes throws, count that as corrupt.
       attrs = element.attributes;
       isAttr = attrs['is'];
-      corrupted = Element._hasCorruptedAttributes(element);
+      var corruptedTest1 = Element._hasCorruptedAttributes(element);
+
+      // On IE, erratically, the hasCorruptedAttributes test can return false,
+      // even though it clearly is corrupted. A separate copy of the test
+      // inlining just the basic check seems to help.
+      corrupted = corruptedTest1 ? true : Element._hasCorruptedAttributesAdditionalCheck(element);
     } catch(e) {}
-     var elementText = 'element unprintable';
+    var elementText = 'element unprintable';
     try {
       elementText = element.toString();
     } catch(e) {}
-    var elementTagName = 'element tag unavailable';
     try {
-      elementTagName = element.tagName;
-    } catch(e) {}
-    _sanitizeElement(element, parent, corrupted, elementText, elementTagName,
-        attrs, isAttr);
+      var elementTagName = Element._safeTagName(element);
+      _sanitizeElement(element, parent, corrupted, elementText, elementTagName,
+          attrs, isAttr);
+    } on ArgumentError { // Thrown by _ThrowsNodeValidator
+      rethrow;
+    } catch(e) {  // Unexpected exception sanitizing -> remove
+      _removeNode(element, parent);
+      window.console.warn('Removing corrupted element $elementText');
+    }
   }
 
   /// Having done basic sanity checking on the element, and computed the
@@ -40885,23 +40959,23 @@
   void _sanitizeElement(Element element, Node parent, bool corrupted,
       String text, String tag, Map attrs, String isAttr) {
     if (false != corrupted) {
+       _removeNode(element, parent);
       window.console.warn(
           'Removing element due to corrupted attributes on <$text>');
-       _removeNode(element, parent);
        return;
     }
     if (!validator.allowsElement(element)) {
-      window.console.warn(
-          'Removing disallowed element <$tag>');
       _removeNode(element, parent);
+      window.console.warn(
+          'Removing disallowed element <$tag> from $parent');
       return;
     }
 
     if (isAttr != null) {
       if (!validator.allowsAttribute(element, 'is', isAttr)) {
+        _removeNode(element, parent);
         window.console.warn('Removing disallowed type extension '
             '<$tag is="$isAttr">');
-        _removeNode(element, parent);
         return;
       }
     }
diff --git a/sdk/lib/html/dartium/html_dartium.dart b/sdk/lib/html/dartium/html_dartium.dart
index 218dc51..109eca3 100644
--- a/sdk/lib/html/dartium/html_dartium.dart
+++ b/sdk/lib/html/dartium/html_dartium.dart
@@ -26,7 +26,7 @@
 
 import 'dart:async';
 import 'dart:collection';
-import 'dart:_internal' hide Symbol, deprecated;
+import 'dart:_internal' hide Symbol;
 import 'dart:html_common';
 import 'dart:indexed_db';
 import 'dart:indexed_db' show indexed_dbBlinkMap;
@@ -51,6 +51,7 @@
 import 'dart:web_audio' show web_audioBlinkMap;
 import 'dart:web_audio' show web_audioBlinkFunctionMap;
 import 'dart:_blink' as _blink;
+import 'dart:developer';
 // Copyright (c) 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.
@@ -89,7 +90,7 @@
   if (_window != null) {
     return _window;
   }
-  _window = _Utils.window();
+  _window = wrap_jso(js.JsNative.getProperty(js.context, 'window'));
   return _window;
 }
 
@@ -118,6 +119,7 @@
   return _Utils.spawnDomUri(uri.toString());
 }
 // FIXME: Can we make this private?
+@Deprecated("Internal Use Only")
 final htmlBlinkMap = {
   '_HistoryCrossFrame': () => _HistoryCrossFrame,
   '_LocationCrossFrame': () => _LocationCrossFrame,
@@ -619,11 +621,632 @@
   return null;
 }
 
+// FIXME: Can we make this private?
+@Deprecated("Internal Use Only")
+final htmlBlinkFunctionMap = {
+  'Animation': () => Animation.internalCreateAnimation,
+  'AnimationEffect': () => AnimationEffect.internalCreateAnimationEffect,
+  'AnimationNode': () => AnimationNode.internalCreateAnimationNode,
+  'AnimationPlayer': () => AnimationPlayer.internalCreateAnimationPlayer,
+  'AnimationPlayerEvent': () => AnimationPlayerEvent.internalCreateAnimationPlayerEvent,
+  'AnimationTimeline': () => AnimationTimeline.internalCreateAnimationTimeline,
+  'ApplicationCache': () => ApplicationCache.internalCreateApplicationCache,
+  'ApplicationCacheErrorEvent': () => ApplicationCacheErrorEvent.internalCreateApplicationCacheErrorEvent,
+  'Attr': () => _Attr.internalCreate_Attr,
+  'AudioTrack': () => AudioTrack.internalCreateAudioTrack,
+  'AudioTrackList': () => AudioTrackList.internalCreateAudioTrackList,
+  'AutocompleteErrorEvent': () => AutocompleteErrorEvent.internalCreateAutocompleteErrorEvent,
+  'BarProp': () => BarProp.internalCreateBarProp,
+  'BatteryManager': () => BatteryManager.internalCreateBatteryManager,
+  'BeforeUnloadEvent': () => BeforeUnloadEvent.internalCreateBeforeUnloadEvent,
+  'Blob': () => Blob.internalCreateBlob,
+  'Body': () => Body.internalCreateBody,
+  'CDATASection': () => CDataSection.internalCreateCDataSection,
+  'CSS': () => Css.internalCreateCss,
+  'CSSCharsetRule': () => CssCharsetRule.internalCreateCssCharsetRule,
+  'CSSFontFaceRule': () => CssFontFaceRule.internalCreateCssFontFaceRule,
+  'CSSImportRule': () => CssImportRule.internalCreateCssImportRule,
+  'CSSKeyframeRule': () => CssKeyframeRule.internalCreateCssKeyframeRule,
+  'CSSKeyframesRule': () => CssKeyframesRule.internalCreateCssKeyframesRule,
+  'CSSMediaRule': () => CssMediaRule.internalCreateCssMediaRule,
+  'CSSPageRule': () => CssPageRule.internalCreateCssPageRule,
+  'CSSPrimitiveValue': () => _CSSPrimitiveValue.internalCreate_CSSPrimitiveValue,
+  'CSSRule': () => CssRule.internalCreateCssRule,
+  'CSSRuleList': () => _CssRuleList.internalCreate_CssRuleList,
+  'CSSStyleDeclaration': () => CssStyleDeclaration.internalCreateCssStyleDeclaration,
+  'CSSStyleRule': () => CssStyleRule.internalCreateCssStyleRule,
+  'CSSStyleSheet': () => CssStyleSheet.internalCreateCssStyleSheet,
+  'CSSSupportsRule': () => CssSupportsRule.internalCreateCssSupportsRule,
+  'CSSUnknownRule': () => _CSSUnknownRule.internalCreate_CSSUnknownRule,
+  'CSSValue': () => _CSSValue.internalCreate_CSSValue,
+  'CSSValueList': () => _CssValueList.internalCreate_CssValueList,
+  'CSSViewportRule': () => CssViewportRule.internalCreateCssViewportRule,
+  'Cache': () => _Cache.internalCreate_Cache,
+  'CacheStorage': () => CacheStorage.internalCreateCacheStorage,
+  'Canvas2DContextAttributes': () => Canvas2DContextAttributes.internalCreateCanvas2DContextAttributes,
+  'CanvasGradient': () => CanvasGradient.internalCreateCanvasGradient,
+  'CanvasPattern': () => CanvasPattern.internalCreateCanvasPattern,
+  'CanvasRenderingContext2D': () => CanvasRenderingContext2D.internalCreateCanvasRenderingContext2D,
+  'CharacterData': () => CharacterData.internalCreateCharacterData,
+  'CircularGeofencingRegion': () => CircularGeofencingRegion.internalCreateCircularGeofencingRegion,
+  'ClientRect': () => _ClientRect.internalCreate_ClientRect,
+  'ClientRectList': () => _ClientRectList.internalCreate_ClientRectList,
+  'CloseEvent': () => CloseEvent.internalCreateCloseEvent,
+  'Comment': () => Comment.internalCreateComment,
+  'CompositionEvent': () => CompositionEvent.internalCreateCompositionEvent,
+  'Console': () => Console.internalCreateConsole,
+  'ConsoleBase': () => ConsoleBase.internalCreateConsoleBase,
+  'Coordinates': () => Coordinates.internalCreateCoordinates,
+  'Counter': () => _Counter.internalCreate_Counter,
+  'Credential': () => Credential.internalCreateCredential,
+  'CredentialsContainer': () => CredentialsContainer.internalCreateCredentialsContainer,
+  'Crypto': () => Crypto.internalCreateCrypto,
+  'CryptoKey': () => CryptoKey.internalCreateCryptoKey,
+  'CustomEvent': () => CustomEvent.internalCreateCustomEvent,
+  'DOMError': () => DomError.internalCreateDomError,
+  'DOMException': () => DomException.internalCreateDomException,
+  'DOMFileSystem': () => FileSystem.internalCreateFileSystem,
+  'DOMFileSystemSync': () => _DOMFileSystemSync.internalCreate_DOMFileSystemSync,
+  'DOMImplementation': () => DomImplementation.internalCreateDomImplementation,
+  'DOMMatrix': () => DomMatrix.internalCreateDomMatrix,
+  'DOMMatrixReadOnly': () => DomMatrixReadOnly.internalCreateDomMatrixReadOnly,
+  'DOMParser': () => DomParser.internalCreateDomParser,
+  'DOMPoint': () => DomPoint.internalCreateDomPoint,
+  'DOMPointReadOnly': () => DomPointReadOnly.internalCreateDomPointReadOnly,
+  'DOMRect': () => _DomRect.internalCreate_DomRect,
+  'DOMRectReadOnly': () => DomRectReadOnly.internalCreateDomRectReadOnly,
+  'DOMSettableTokenList': () => DomSettableTokenList.internalCreateDomSettableTokenList,
+  'DOMStringList': () => DomStringList.internalCreateDomStringList,
+  'DOMTokenList': () => DomTokenList.internalCreateDomTokenList,
+  'DataTransfer': () => DataTransfer.internalCreateDataTransfer,
+  'DataTransferItem': () => DataTransferItem.internalCreateDataTransferItem,
+  'DataTransferItemList': () => DataTransferItemList.internalCreateDataTransferItemList,
+  'DedicatedWorkerGlobalScope': () => DedicatedWorkerGlobalScope.internalCreateDedicatedWorkerGlobalScope,
+  'DeprecatedStorageInfo': () => DeprecatedStorageInfo.internalCreateDeprecatedStorageInfo,
+  'DeprecatedStorageQuota': () => DeprecatedStorageQuota.internalCreateDeprecatedStorageQuota,
+  'DeviceAcceleration': () => DeviceAcceleration.internalCreateDeviceAcceleration,
+  'DeviceLightEvent': () => DeviceLightEvent.internalCreateDeviceLightEvent,
+  'DeviceMotionEvent': () => DeviceMotionEvent.internalCreateDeviceMotionEvent,
+  'DeviceOrientationEvent': () => DeviceOrientationEvent.internalCreateDeviceOrientationEvent,
+  'DeviceRotationRate': () => DeviceRotationRate.internalCreateDeviceRotationRate,
+  'DirectoryEntry': () => DirectoryEntry.internalCreateDirectoryEntry,
+  'DirectoryEntrySync': () => _DirectoryEntrySync.internalCreate_DirectoryEntrySync,
+  'DirectoryReader': () => DirectoryReader.internalCreateDirectoryReader,
+  'DirectoryReaderSync': () => _DirectoryReaderSync.internalCreate_DirectoryReaderSync,
+  'Document': () => Document.internalCreateDocument,
+  'DocumentFragment': () => DocumentFragment.internalCreateDocumentFragment,
+  'DocumentType': () => _DocumentType.internalCreate_DocumentType,
+  'Element': () => Element.internalCreateElement,
+  'Entry': () => Entry.internalCreateEntry,
+  'EntrySync': () => _EntrySync.internalCreate_EntrySync,
+  'ErrorEvent': () => ErrorEvent.internalCreateErrorEvent,
+  'Event': () => Event.internalCreateEvent,
+  'EventSource': () => EventSource.internalCreateEventSource,
+  'EventTarget': () => EventTarget.internalCreateEventTarget,
+  'ExtendableEvent': () => ExtendableEvent.internalCreateExtendableEvent,
+  'FederatedCredential': () => FederatedCredential.internalCreateFederatedCredential,
+  'FetchEvent': () => FetchEvent.internalCreateFetchEvent,
+  'File': () => File.internalCreateFile,
+  'FileEntry': () => FileEntry.internalCreateFileEntry,
+  'FileEntrySync': () => _FileEntrySync.internalCreate_FileEntrySync,
+  'FileError': () => FileError.internalCreateFileError,
+  'FileList': () => FileList.internalCreateFileList,
+  'FileReader': () => FileReader.internalCreateFileReader,
+  'FileReaderSync': () => _FileReaderSync.internalCreate_FileReaderSync,
+  'FileWriter': () => FileWriter.internalCreateFileWriter,
+  'FileWriterSync': () => _FileWriterSync.internalCreate_FileWriterSync,
+  'FocusEvent': () => FocusEvent.internalCreateFocusEvent,
+  'FontFace': () => FontFace.internalCreateFontFace,
+  'FontFaceSet': () => FontFaceSet.internalCreateFontFaceSet,
+  'FontFaceSetLoadEvent': () => FontFaceSetLoadEvent.internalCreateFontFaceSetLoadEvent,
+  'FormData': () => FormData.internalCreateFormData,
+  'Gamepad': () => Gamepad.internalCreateGamepad,
+  'GamepadButton': () => GamepadButton.internalCreateGamepadButton,
+  'GamepadEvent': () => GamepadEvent.internalCreateGamepadEvent,
+  'GamepadList': () => _GamepadList.internalCreate_GamepadList,
+  'Geofencing': () => Geofencing.internalCreateGeofencing,
+  'GeofencingRegion': () => GeofencingRegion.internalCreateGeofencingRegion,
+  'Geolocation': () => Geolocation.internalCreateGeolocation,
+  'Geoposition': () => Geoposition.internalCreateGeoposition,
+  'HTMLAllCollection': () => _HTMLAllCollection.internalCreate_HTMLAllCollection,
+  'HTMLAnchorElement': () => AnchorElement.internalCreateAnchorElement,
+  'HTMLAppletElement': () => _HTMLAppletElement.internalCreate_HTMLAppletElement,
+  'HTMLAreaElement': () => AreaElement.internalCreateAreaElement,
+  'HTMLAudioElement': () => AudioElement.internalCreateAudioElement,
+  'HTMLBRElement': () => BRElement.internalCreateBRElement,
+  'HTMLBaseElement': () => BaseElement.internalCreateBaseElement,
+  'HTMLBodyElement': () => BodyElement.internalCreateBodyElement,
+  'HTMLButtonElement': () => ButtonElement.internalCreateButtonElement,
+  'HTMLCanvasElement': () => CanvasElement.internalCreateCanvasElement,
+  'HTMLCollection': () => HtmlCollection.internalCreateHtmlCollection,
+  'HTMLContentElement': () => ContentElement.internalCreateContentElement,
+  'HTMLDListElement': () => DListElement.internalCreateDListElement,
+  'HTMLDataListElement': () => DataListElement.internalCreateDataListElement,
+  'HTMLDetailsElement': () => DetailsElement.internalCreateDetailsElement,
+  'HTMLDialogElement': () => DialogElement.internalCreateDialogElement,
+  'HTMLDirectoryElement': () => _HTMLDirectoryElement.internalCreate_HTMLDirectoryElement,
+  'HTMLDivElement': () => DivElement.internalCreateDivElement,
+  'HTMLDocument': () => HtmlDocument.internalCreateHtmlDocument,
+  'HTMLElement': () => HtmlElement.internalCreateHtmlElement,
+  'HTMLEmbedElement': () => EmbedElement.internalCreateEmbedElement,
+  'HTMLFieldSetElement': () => FieldSetElement.internalCreateFieldSetElement,
+  'HTMLFontElement': () => _HTMLFontElement.internalCreate_HTMLFontElement,
+  'HTMLFormControlsCollection': () => HtmlFormControlsCollection.internalCreateHtmlFormControlsCollection,
+  'HTMLFormElement': () => FormElement.internalCreateFormElement,
+  'HTMLFrameElement': () => _HTMLFrameElement.internalCreate_HTMLFrameElement,
+  'HTMLFrameSetElement': () => _HTMLFrameSetElement.internalCreate_HTMLFrameSetElement,
+  'HTMLHRElement': () => HRElement.internalCreateHRElement,
+  'HTMLHeadElement': () => HeadElement.internalCreateHeadElement,
+  'HTMLHeadingElement': () => HeadingElement.internalCreateHeadingElement,
+  'HTMLHtmlElement': () => HtmlHtmlElement.internalCreateHtmlHtmlElement,
+  'HTMLIFrameElement': () => IFrameElement.internalCreateIFrameElement,
+  'HTMLImageElement': () => ImageElement.internalCreateImageElement,
+  'HTMLInputElement': () => InputElement.internalCreateInputElement,
+  'HTMLKeygenElement': () => KeygenElement.internalCreateKeygenElement,
+  'HTMLLIElement': () => LIElement.internalCreateLIElement,
+  'HTMLLabelElement': () => LabelElement.internalCreateLabelElement,
+  'HTMLLegendElement': () => LegendElement.internalCreateLegendElement,
+  'HTMLLinkElement': () => LinkElement.internalCreateLinkElement,
+  'HTMLMapElement': () => MapElement.internalCreateMapElement,
+  'HTMLMarqueeElement': () => _HTMLMarqueeElement.internalCreate_HTMLMarqueeElement,
+  'HTMLMediaElement': () => MediaElement.internalCreateMediaElement,
+  'HTMLMenuElement': () => MenuElement.internalCreateMenuElement,
+  'HTMLMenuItemElement': () => MenuItemElement.internalCreateMenuItemElement,
+  'HTMLMetaElement': () => MetaElement.internalCreateMetaElement,
+  'HTMLMeterElement': () => MeterElement.internalCreateMeterElement,
+  'HTMLModElement': () => ModElement.internalCreateModElement,
+  'HTMLOListElement': () => OListElement.internalCreateOListElement,
+  'HTMLObjectElement': () => ObjectElement.internalCreateObjectElement,
+  'HTMLOptGroupElement': () => OptGroupElement.internalCreateOptGroupElement,
+  'HTMLOptionElement': () => OptionElement.internalCreateOptionElement,
+  'HTMLOptionsCollection': () => HtmlOptionsCollection.internalCreateHtmlOptionsCollection,
+  'HTMLOutputElement': () => OutputElement.internalCreateOutputElement,
+  'HTMLParagraphElement': () => ParagraphElement.internalCreateParagraphElement,
+  'HTMLParamElement': () => ParamElement.internalCreateParamElement,
+  'HTMLPictureElement': () => PictureElement.internalCreatePictureElement,
+  'HTMLPreElement': () => PreElement.internalCreatePreElement,
+  'HTMLProgressElement': () => ProgressElement.internalCreateProgressElement,
+  'HTMLQuoteElement': () => QuoteElement.internalCreateQuoteElement,
+  'HTMLScriptElement': () => ScriptElement.internalCreateScriptElement,
+  'HTMLSelectElement': () => SelectElement.internalCreateSelectElement,
+  'HTMLShadowElement': () => ShadowElement.internalCreateShadowElement,
+  'HTMLSourceElement': () => SourceElement.internalCreateSourceElement,
+  'HTMLSpanElement': () => SpanElement.internalCreateSpanElement,
+  'HTMLStyleElement': () => StyleElement.internalCreateStyleElement,
+  'HTMLTableCaptionElement': () => TableCaptionElement.internalCreateTableCaptionElement,
+  'HTMLTableCellElement': () => TableCellElement.internalCreateTableCellElement,
+  'HTMLTableColElement': () => TableColElement.internalCreateTableColElement,
+  'HTMLTableElement': () => TableElement.internalCreateTableElement,
+  'HTMLTableRowElement': () => TableRowElement.internalCreateTableRowElement,
+  'HTMLTableSectionElement': () => TableSectionElement.internalCreateTableSectionElement,
+  'HTMLTemplateElement': () => TemplateElement.internalCreateTemplateElement,
+  'HTMLTextAreaElement': () => TextAreaElement.internalCreateTextAreaElement,
+  'HTMLTitleElement': () => TitleElement.internalCreateTitleElement,
+  'HTMLTrackElement': () => TrackElement.internalCreateTrackElement,
+  'HTMLUListElement': () => UListElement.internalCreateUListElement,
+  'HTMLUnknownElement': () => UnknownElement.internalCreateUnknownElement,
+  'HTMLVideoElement': () => VideoElement.internalCreateVideoElement,
+  'HashChangeEvent': () => HashChangeEvent.internalCreateHashChangeEvent,
+  'Headers': () => Headers.internalCreateHeaders,
+  'History': () => History.internalCreateHistory,
+  'ImageBitmap': () => ImageBitmap.internalCreateImageBitmap,
+  'ImageData': () => ImageData.internalCreateImageData,
+  'InjectedScriptHost': () => InjectedScriptHost.internalCreateInjectedScriptHost,
+  'InputMethodContext': () => InputMethodContext.internalCreateInputMethodContext,
+  'InstallEvent': () => InstallEvent.internalCreateInstallEvent,
+  'Iterator': () => DomIterator.internalCreateDomIterator,
+  'KeyboardEvent': () => KeyboardEvent.internalCreateKeyboardEvent,
+  'LocalCredential': () => LocalCredential.internalCreateLocalCredential,
+  'Location': () => Location.internalCreateLocation,
+  'MIDIAccess': () => MidiAccess.internalCreateMidiAccess,
+  'MIDIConnectionEvent': () => MidiConnectionEvent.internalCreateMidiConnectionEvent,
+  'MIDIInput': () => MidiInput.internalCreateMidiInput,
+  'MIDIInputMap': () => MidiInputMap.internalCreateMidiInputMap,
+  'MIDIMessageEvent': () => MidiMessageEvent.internalCreateMidiMessageEvent,
+  'MIDIOutput': () => MidiOutput.internalCreateMidiOutput,
+  'MIDIOutputMap': () => MidiOutputMap.internalCreateMidiOutputMap,
+  'MIDIPort': () => MidiPort.internalCreateMidiPort,
+  'MediaController': () => MediaController.internalCreateMediaController,
+  'MediaDeviceInfo': () => MediaDeviceInfo.internalCreateMediaDeviceInfo,
+  'MediaError': () => MediaError.internalCreateMediaError,
+  'MediaKeyError': () => MediaKeyError.internalCreateMediaKeyError,
+  'MediaKeyEvent': () => MediaKeyEvent.internalCreateMediaKeyEvent,
+  'MediaKeyMessageEvent': () => MediaKeyMessageEvent.internalCreateMediaKeyMessageEvent,
+  'MediaKeyNeededEvent': () => MediaKeyNeededEvent.internalCreateMediaKeyNeededEvent,
+  'MediaKeySession': () => MediaKeySession.internalCreateMediaKeySession,
+  'MediaKeys': () => MediaKeys.internalCreateMediaKeys,
+  'MediaList': () => MediaList.internalCreateMediaList,
+  'MediaQueryList': () => MediaQueryList.internalCreateMediaQueryList,
+  'MediaQueryListEvent': () => MediaQueryListEvent.internalCreateMediaQueryListEvent,
+  'MediaSource': () => MediaSource.internalCreateMediaSource,
+  'MediaStream': () => MediaStream.internalCreateMediaStream,
+  'MediaStreamEvent': () => MediaStreamEvent.internalCreateMediaStreamEvent,
+  'MediaStreamTrack': () => MediaStreamTrack.internalCreateMediaStreamTrack,
+  'MediaStreamTrackEvent': () => MediaStreamTrackEvent.internalCreateMediaStreamTrackEvent,
+  'MemoryInfo': () => MemoryInfo.internalCreateMemoryInfo,
+  'MessageChannel': () => MessageChannel.internalCreateMessageChannel,
+  'MessageEvent': () => MessageEvent.internalCreateMessageEvent,
+  'MessagePort': () => MessagePort.internalCreateMessagePort,
+  'Metadata': () => Metadata.internalCreateMetadata,
+  'MimeType': () => MimeType.internalCreateMimeType,
+  'MimeTypeArray': () => MimeTypeArray.internalCreateMimeTypeArray,
+  'MouseEvent': () => MouseEvent.internalCreateMouseEvent,
+  'MutationEvent': () => _MutationEvent.internalCreate_MutationEvent,
+  'MutationObserver': () => MutationObserver.internalCreateMutationObserver,
+  'MutationRecord': () => MutationRecord.internalCreateMutationRecord,
+  'NamedNodeMap': () => _NamedNodeMap.internalCreate_NamedNodeMap,
+  'Navigator': () => Navigator.internalCreateNavigator,
+  'NavigatorUserMediaError': () => NavigatorUserMediaError.internalCreateNavigatorUserMediaError,
+  'NetworkInformation': () => NetworkInformation.internalCreateNetworkInformation,
+  'Node': () => Node.internalCreateNode,
+  'NodeFilter': () => NodeFilter.internalCreateNodeFilter,
+  'NodeIterator': () => NodeIterator.internalCreateNodeIterator,
+  'NodeList': () => NodeList.internalCreateNodeList,
+  'Notification': () => Notification.internalCreateNotification,
+  'OverflowEvent': () => OverflowEvent.internalCreateOverflowEvent,
+  'PagePopupController': () => _PagePopupController.internalCreate_PagePopupController,
+  'PageTransitionEvent': () => PageTransitionEvent.internalCreatePageTransitionEvent,
+  'Path2D': () => Path2D.internalCreatePath2D,
+  'Performance': () => Performance.internalCreatePerformance,
+  'PerformanceEntry': () => PerformanceEntry.internalCreatePerformanceEntry,
+  'PerformanceMark': () => PerformanceMark.internalCreatePerformanceMark,
+  'PerformanceMeasure': () => PerformanceMeasure.internalCreatePerformanceMeasure,
+  'PerformanceNavigation': () => PerformanceNavigation.internalCreatePerformanceNavigation,
+  'PerformanceResourceTiming': () => PerformanceResourceTiming.internalCreatePerformanceResourceTiming,
+  'PerformanceTiming': () => PerformanceTiming.internalCreatePerformanceTiming,
+  'Plugin': () => Plugin.internalCreatePlugin,
+  'PluginArray': () => PluginArray.internalCreatePluginArray,
+  'PluginPlaceholderElement': () => PluginPlaceholderElement.internalCreatePluginPlaceholderElement,
+  'PopStateEvent': () => PopStateEvent.internalCreatePopStateEvent,
+  'PositionError': () => PositionError.internalCreatePositionError,
+  'Presentation': () => Presentation.internalCreatePresentation,
+  'ProcessingInstruction': () => ProcessingInstruction.internalCreateProcessingInstruction,
+  'ProgressEvent': () => ProgressEvent.internalCreateProgressEvent,
+  'PushEvent': () => PushEvent.internalCreatePushEvent,
+  'PushManager': () => PushManager.internalCreatePushManager,
+  'PushRegistration': () => PushRegistration.internalCreatePushRegistration,
+  'RGBColor': () => _RGBColor.internalCreate_RGBColor,
+  'RTCDTMFSender': () => RtcDtmfSender.internalCreateRtcDtmfSender,
+  'RTCDTMFToneChangeEvent': () => RtcDtmfToneChangeEvent.internalCreateRtcDtmfToneChangeEvent,
+  'RTCDataChannel': () => RtcDataChannel.internalCreateRtcDataChannel,
+  'RTCDataChannelEvent': () => RtcDataChannelEvent.internalCreateRtcDataChannelEvent,
+  'RTCIceCandidate': () => RtcIceCandidate.internalCreateRtcIceCandidate,
+  'RTCIceCandidateEvent': () => RtcIceCandidateEvent.internalCreateRtcIceCandidateEvent,
+  'RTCPeerConnection': () => RtcPeerConnection.internalCreateRtcPeerConnection,
+  'RTCSessionDescription': () => RtcSessionDescription.internalCreateRtcSessionDescription,
+  'RTCStatsReport': () => RtcStatsReport.internalCreateRtcStatsReport,
+  'RTCStatsResponse': () => RtcStatsResponse.internalCreateRtcStatsResponse,
+  'RadioNodeList': () => _RadioNodeList.internalCreate_RadioNodeList,
+  'Range': () => Range.internalCreateRange,
+  'ReadableStream': () => ReadableStream.internalCreateReadableStream,
+  'Rect': () => _Rect.internalCreate_Rect,
+  'RelatedEvent': () => RelatedEvent.internalCreateRelatedEvent,
+  'Request': () => _Request.internalCreate_Request,
+  'ResourceProgressEvent': () => ResourceProgressEvent.internalCreateResourceProgressEvent,
+  'Response': () => _Response.internalCreate_Response,
+  'Screen': () => Screen.internalCreateScreen,
+  'ScreenOrientation': () => ScreenOrientation.internalCreateScreenOrientation,
+  'SecurityPolicyViolationEvent': () => SecurityPolicyViolationEvent.internalCreateSecurityPolicyViolationEvent,
+  'Selection': () => Selection.internalCreateSelection,
+  'ServiceWorker': () => _ServiceWorker.internalCreate_ServiceWorker,
+  'ServiceWorkerClient': () => ServiceWorkerClient.internalCreateServiceWorkerClient,
+  'ServiceWorkerClients': () => ServiceWorkerClients.internalCreateServiceWorkerClients,
+  'ServiceWorkerContainer': () => ServiceWorkerContainer.internalCreateServiceWorkerContainer,
+  'ServiceWorkerGlobalScope': () => ServiceWorkerGlobalScope.internalCreateServiceWorkerGlobalScope,
+  'ServiceWorkerRegistration': () => ServiceWorkerRegistration.internalCreateServiceWorkerRegistration,
+  'ShadowRoot': () => ShadowRoot.internalCreateShadowRoot,
+  'SharedWorker': () => SharedWorker.internalCreateSharedWorker,
+  'SharedWorkerGlobalScope': () => SharedWorkerGlobalScope.internalCreateSharedWorkerGlobalScope,
+  'SourceBuffer': () => SourceBuffer.internalCreateSourceBuffer,
+  'SourceBufferList': () => SourceBufferList.internalCreateSourceBufferList,
+  'SourceInfo': () => SourceInfo.internalCreateSourceInfo,
+  'SpeechGrammar': () => SpeechGrammar.internalCreateSpeechGrammar,
+  'SpeechGrammarList': () => SpeechGrammarList.internalCreateSpeechGrammarList,
+  'SpeechRecognition': () => SpeechRecognition.internalCreateSpeechRecognition,
+  'SpeechRecognitionAlternative': () => SpeechRecognitionAlternative.internalCreateSpeechRecognitionAlternative,
+  'SpeechRecognitionError': () => SpeechRecognitionError.internalCreateSpeechRecognitionError,
+  'SpeechRecognitionEvent': () => SpeechRecognitionEvent.internalCreateSpeechRecognitionEvent,
+  'SpeechRecognitionResult': () => SpeechRecognitionResult.internalCreateSpeechRecognitionResult,
+  'SpeechRecognitionResultList': () => _SpeechRecognitionResultList.internalCreate_SpeechRecognitionResultList,
+  'SpeechSynthesis': () => SpeechSynthesis.internalCreateSpeechSynthesis,
+  'SpeechSynthesisEvent': () => SpeechSynthesisEvent.internalCreateSpeechSynthesisEvent,
+  'SpeechSynthesisUtterance': () => SpeechSynthesisUtterance.internalCreateSpeechSynthesisUtterance,
+  'SpeechSynthesisVoice': () => SpeechSynthesisVoice.internalCreateSpeechSynthesisVoice,
+  'Storage': () => Storage.internalCreateStorage,
+  'StorageEvent': () => StorageEvent.internalCreateStorageEvent,
+  'StorageInfo': () => StorageInfo.internalCreateStorageInfo,
+  'StorageQuota': () => StorageQuota.internalCreateStorageQuota,
+  'Stream': () => FileStream.internalCreateFileStream,
+  'StyleMedia': () => StyleMedia.internalCreateStyleMedia,
+  'StyleSheet': () => StyleSheet.internalCreateStyleSheet,
+  'StyleSheetList': () => _StyleSheetList.internalCreate_StyleSheetList,
+  'SubtleCrypto': () => _SubtleCrypto.internalCreate_SubtleCrypto,
+  'Text': () => Text.internalCreateText,
+  'TextEvent': () => TextEvent.internalCreateTextEvent,
+  'TextMetrics': () => TextMetrics.internalCreateTextMetrics,
+  'TextTrack': () => TextTrack.internalCreateTextTrack,
+  'TextTrackCue': () => TextTrackCue.internalCreateTextTrackCue,
+  'TextTrackCueList': () => TextTrackCueList.internalCreateTextTrackCueList,
+  'TextTrackList': () => TextTrackList.internalCreateTextTrackList,
+  'TimeRanges': () => TimeRanges.internalCreateTimeRanges,
+  'Timing': () => Timing.internalCreateTiming,
+  'Touch': () => Touch.internalCreateTouch,
+  'TouchEvent': () => TouchEvent.internalCreateTouchEvent,
+  'TouchList': () => TouchList.internalCreateTouchList,
+  'TrackEvent': () => TrackEvent.internalCreateTrackEvent,
+  'TransitionEvent': () => TransitionEvent.internalCreateTransitionEvent,
+  'TreeWalker': () => TreeWalker.internalCreateTreeWalker,
+  'UIEvent': () => UIEvent.internalCreateUIEvent,
+  'URL': () => Url.internalCreateUrl,
+  'VTTCue': () => VttCue.internalCreateVttCue,
+  'VTTRegion': () => VttRegion.internalCreateVttRegion,
+  'VTTRegionList': () => VttRegionList.internalCreateVttRegionList,
+  'ValidityState': () => ValidityState.internalCreateValidityState,
+  'VideoPlaybackQuality': () => VideoPlaybackQuality.internalCreateVideoPlaybackQuality,
+  'VideoTrack': () => VideoTrack.internalCreateVideoTrack,
+  'VideoTrackList': () => VideoTrackList.internalCreateVideoTrackList,
+  'WebKitAnimationEvent': () => AnimationEvent.internalCreateAnimationEvent,
+  'WebKitCSSFilterRule': () => CssFilterRule.internalCreateCssFilterRule,
+  'WebKitCSSFilterValue': () => _WebKitCSSFilterValue.internalCreate_WebKitCSSFilterValue,
+  'WebKitCSSMatrix': () => _WebKitCSSMatrix.internalCreate_WebKitCSSMatrix,
+  'WebKitCSSTransformValue': () => _WebKitCSSTransformValue.internalCreate_WebKitCSSTransformValue,
+  'WebSocket': () => WebSocket.internalCreateWebSocket,
+  'WheelEvent': () => WheelEvent.internalCreateWheelEvent,
+  'Window': () => Window.internalCreateWindow,
+  'Worker': () => Worker.internalCreateWorker,
+  'WorkerConsole': () => WorkerConsole.internalCreateWorkerConsole,
+  'WorkerGlobalScope': () => WorkerGlobalScope.internalCreateWorkerGlobalScope,
+  'WorkerLocation': () => _WorkerLocation.internalCreate_WorkerLocation,
+  'WorkerNavigator': () => _WorkerNavigator.internalCreate_WorkerNavigator,
+  'WorkerPerformance': () => WorkerPerformance.internalCreateWorkerPerformance,
+  'XMLDocument': () => XmlDocument.internalCreateXmlDocument,
+  'XMLHttpRequest': () => HttpRequest.internalCreateHttpRequest,
+  'XMLHttpRequestEventTarget': () => HttpRequestEventTarget.internalCreateHttpRequestEventTarget,
+  'XMLHttpRequestProgressEvent': () => _XMLHttpRequestProgressEvent.internalCreate_XMLHttpRequestProgressEvent,
+  'XMLHttpRequestUpload': () => HttpRequestUpload.internalCreateHttpRequestUpload,
+  'XMLSerializer': () => XmlSerializer.internalCreateXmlSerializer,
+  'XPathEvaluator': () => XPathEvaluator.internalCreateXPathEvaluator,
+  'XPathExpression': () => XPathExpression.internalCreateXPathExpression,
+  'XPathNSResolver': () => XPathNSResolver.internalCreateXPathNSResolver,
+  'XPathResult': () => XPathResult.internalCreateXPathResult,
+  'XSLTProcessor': () => XsltProcessor.internalCreateXsltProcessor,
+  'polymer-element': () => HtmlElement.internalCreateHtmlElement,
 
-unwrap_jso(dartClass_instance) => dartClass_instance;
-wrap_jso(jsObject) => jsObject;
-wrap_jso_list(jso_nodes) => jso_nodes;
-make_dart_rectangle(r) => r;
+};
+
+// TODO(terry): We may want to move this elsewhere if html becomes
+// a package to avoid dartium depending on pkg:html.
+@Deprecated("Internal Use Only")
+getHtmlCreateFunction(String key) {
+  var result;
+
+  // TODO(vsm): Add Cross Frame and JS types here as well.
+
+  // Check the html library.
+  result = _getHtmlFunction(key);
+  if (result != null) {
+    return result;
+  }
+
+  // Check the web gl library.
+  result = _getWebGlFunction(key);
+  if (result != null) {
+    return result;
+  }
+
+  // Check the indexed db library.
+  result = _getIndexDbFunction(key);
+  if (result != null) {
+    return result;
+  }
+
+  // Check the web audio library.
+  result = _getWebAudioFunction(key);
+  if (result != null) {
+    return result;
+  }
+
+  // Check the web sql library.
+  result = _getWebSqlFunction(key);
+  if (result != null) {
+    return result;
+  }
+
+  // Check the svg library.
+  result = _getSvgFunction(key);
+  if (result != null) {
+    return result;
+  }
+
+  return null;
+}
+
+Function _getHtmlFunction(String key) {
+  if (htmlBlinkFunctionMap.containsKey(key)) {
+    return htmlBlinkFunctionMap[key]();
+  }
+  return null;
+}
+
+Function _getWebGlFunction(String key) {
+  if (web_glBlinkFunctionMap.containsKey(key)) {
+    return web_glBlinkFunctionMap[key]();
+  }
+  return null;
+}
+
+Function _getIndexDbFunction(String key) {
+  if (indexed_dbBlinkFunctionMap.containsKey(key)) {
+    return indexed_dbBlinkFunctionMap[key]();
+  }
+  return null;
+}
+
+Function _getWebAudioFunction(String key) {
+  if (web_audioBlinkFunctionMap.containsKey(key)) {
+    return web_audioBlinkFunctionMap[key]();
+  }
+  return null;
+}
+
+Function _getWebSqlFunction(String key) {
+  if (web_sqlBlinkFunctionMap.containsKey(key)) {
+    return web_sqlBlinkFunctionMap[key]();
+  }
+  return null;
+}
+
+Function _getSvgFunction(String key) {
+  if (svgBlinkFunctionMap.containsKey(key)) {
+    return svgBlinkFunctionMap[key]();
+  }
+  return null;
+}
+
+
+/******************************************************************************
+ **********                                                          **********
+ **********                    JS Interop Support                    **********
+ **********                                                          **********
+ ******************************************************************************/
+
+String _getCustomElementExtends(object) {
+  var entry = getCustomElementEntry(object);
+  if (entry != null) {
+    return entry['extends'];
+  }
+  return null;
+}
+
+// Return the tag name or is attribute of the custom element or data binding.
+String _getCustomElementName(element) {
+  var jsObject;
+  var tag = "";
+  var runtimeType = element.runtimeType;
+  if (runtimeType == HtmlElement) {
+    tag = element.localName;
+  } else if (runtimeType == TemplateElement) {
+    // Data binding with a Dart class.
+    tag = element.attributes['is'];
+  } else if (runtimeType == js.JsObjectImpl) {
+    // It's a Polymer core element (written in JS).
+    // Make sure it's an element anything else we can ignore.
+    if (element.hasProperty('nodeType') && element['nodeType'] == 1) {
+      if (js.JsNative.callMethod(element, 'hasAttribute', ['is'])) {
+        // It's data binding use the is attribute.
+        tag = js.JsNative.callMethod(element, 'getAttribute', ['is']);
+      } else {
+        // It's a custom element we want the local name.
+        tag = element['localName'];
+      }
+    }
+  } else {
+    throw new UnsupportedError('Element is incorrect type. Got ${runtimeType}, expected HtmlElement/HtmlTemplate/JsObjectImpl.');
+  }
+
+  return tag;
+}
+
+/// An abstract class for all DOM objects we wrap in dart:html and related
+///  libraries.
+///
+/// ** Internal Use Only **
+@Deprecated("Internal Use Only")
+class DartHtmlDomObject {
+
+  /// The underlying JS DOM object.
+  @Deprecated("Internal Use Only")
+  js.JsObject blink_jsObject;
+
+}
+
+/// Upgrade a Dart HtmlElement to the user's Dart custom element class.
+_upgradeHtmlElement(dartInstance) {
+  // Only try upgrading HtmlElement (Dart class) if there is a failure then
+  // don't try it again - one failure is enough.
+  if (dartInstance.runtimeType == HtmlElement && !dartInstance.isBadUpgrade) {
+    // Must be exactly HtmlElement not something derived from it.
+
+    var customElementClass = getCustomElementType(dartInstance);
+
+    // Custom Element to upgrade.
+    if (customElementClass != null) {
+      var jsObject = dartInstance.blink_jsObject;
+      try {
+        dartInstance = _blink.Blink_Utils.constructElement(customElementClass, jsObject);
+      } catch (e) {
+        dartInstance._badUpgrade();
+      } finally {
+        dartInstance.blink_jsObject = jsObject;
+        js.setDartHtmlWrapperFor(jsObject, dartInstance);
+     }
+   }
+  }
+
+  return dartInstance;
+}
+
+@Deprecated("Internal Use Only")
+class DebugAssertException implements Exception {
+  String message;
+  DebugAssertException(this.message);
+}
+
+@Deprecated("Internal Use Only")
+debug_or_assert(message, expression) {
+  if (!expression) {
+    throw new DebugAssertException("$message");
+  }
+}
+
+// TODO(terry): Manage JS interop JsFunctions for each listener used for add/
+//              removeEventListener.  These JsFunctions will leak look at
+//              fixing with weak-refs in C++.  The key are the hashcodes of the
+//              user's this (this is needed for futures) and listener function.
+Map<int, Map<int, js.JsFunction>> _knownListeners = {};
+
+@Deprecated("Internal Use Only")
+js.JsFunction wrap_event_listener(theObject, Function listener) {
+  var thisHashCode = theObject.hashCode;
+  var listenerHashCode = identityHashCode(listener);
+
+  _knownListeners.putIfAbsent(thisHashCode, () => new Map<int, js.JsFunction>());
+  _knownListeners[thisHashCode].putIfAbsent(listenerHashCode, () =>
+    new js.JsFunction.withThis((theObject, event) => listener(wrap_jso(event))));
+
+  return _knownListeners[thisHashCode][listenerHashCode];
+}
+
+@Deprecated("Internal Use Only")
+Map<String, dynamic> convertNativeObjectToDartMap(js.JsObject jsObject) {
+  var result = new Map();
+  var keys = js.JsNative.callMethod(js.JsNative.getProperty(js.context, 'Object'), 'keys', [jsObject]);
+  for (var key in keys) {
+    result[key] = wrap_jso(js.JsNative.getProperty(jsObject, key));
+  }
+  return result;
+}
+
+/**
+ * Upgrade the JS HTMLElement to the Dart class.  Used by Dart's Polymer.
+ */
+_createCustomUpgrader(Type customElementClass, $this) {
+  var dartClass;
+  try {
+    dartClass = _blink.Blink_Utils.constructElement(customElementClass, $this);
+  } catch (e) {
+    dartClass._badUpgrade();
+    throw e;
+  } finally {
+    // Need to remember the Dart class that was created for this custom so
+    // return it and setup the blink_jsObject to the $this that we'll be working
+    // with as we talk to blink.
+    js.setDartHtmlWrapperFor($this, dartClass);
+  }
+
+  return dartClass;
+}
+
 // 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.
@@ -631,7 +1254,7 @@
 
 @DocsEditable()
 @DomName('AbstractWorker')
-abstract class AbstractWorker extends NativeFieldWrapperClass2 implements EventTarget {
+abstract class AbstractWorker extends DartHtmlDomObject implements EventTarget {
   // To suppress missing implicit constructor warnings.
   factory AbstractWorker._() { throw new UnsupportedError("Not supported"); }
 
@@ -670,6 +1293,20 @@
     if (href != null) e.href = href;
     return e;
   }
+
+
+  @Deprecated("Internal Use Only")
+  static AnchorElement internalCreateAnchorElement() {
+    return new AnchorElement._internalWrap();
+  }
+
+  factory AnchorElement._internalWrap() {
+    return new AnchorElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  AnchorElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -683,7 +1320,7 @@
   
   @DomName('HTMLAnchorElement.download')
   @DocsEditable()
-  void set download(String value) => _blink.BlinkHTMLAnchorElement.instance.download_Setter_(unwrap_jso(this), value);
+  set download(String value) => _blink.BlinkHTMLAnchorElement.instance.download_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLAnchorElement.hreflang')
   @DocsEditable()
@@ -691,7 +1328,7 @@
   
   @DomName('HTMLAnchorElement.hreflang')
   @DocsEditable()
-  void set hreflang(String value) => _blink.BlinkHTMLAnchorElement.instance.hreflang_Setter_(unwrap_jso(this), value);
+  set hreflang(String value) => _blink.BlinkHTMLAnchorElement.instance.hreflang_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLAnchorElement.integrity')
   @DocsEditable()
@@ -701,7 +1338,7 @@
   @DomName('HTMLAnchorElement.integrity')
   @DocsEditable()
   @Experimental() // untriaged
-  void set integrity(String value) => _blink.BlinkHTMLAnchorElement.instance.integrity_Setter_(unwrap_jso(this), value);
+  set integrity(String value) => _blink.BlinkHTMLAnchorElement.instance.integrity_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLAnchorElement.rel')
   @DocsEditable()
@@ -709,7 +1346,7 @@
   
   @DomName('HTMLAnchorElement.rel')
   @DocsEditable()
-  void set rel(String value) => _blink.BlinkHTMLAnchorElement.instance.rel_Setter_(unwrap_jso(this), value);
+  set rel(String value) => _blink.BlinkHTMLAnchorElement.instance.rel_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLAnchorElement.target')
   @DocsEditable()
@@ -717,7 +1354,7 @@
   
   @DomName('HTMLAnchorElement.target')
   @DocsEditable()
-  void set target(String value) => _blink.BlinkHTMLAnchorElement.instance.target_Setter_(unwrap_jso(this), value);
+  set target(String value) => _blink.BlinkHTMLAnchorElement.instance.target_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLAnchorElement.type')
   @DocsEditable()
@@ -725,7 +1362,7 @@
   
   @DomName('HTMLAnchorElement.type')
   @DocsEditable()
-  void set type(String value) => _blink.BlinkHTMLAnchorElement.instance.type_Setter_(unwrap_jso(this), value);
+  set type(String value) => _blink.BlinkHTMLAnchorElement.instance.type_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLAnchorElement.hash')
   @DocsEditable()
@@ -733,7 +1370,7 @@
   
   @DomName('HTMLAnchorElement.hash')
   @DocsEditable()
-  void set hash(String value) => _blink.BlinkHTMLAnchorElement.instance.hash_Setter_(unwrap_jso(this), value);
+  set hash(String value) => _blink.BlinkHTMLAnchorElement.instance.hash_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLAnchorElement.host')
   @DocsEditable()
@@ -741,7 +1378,7 @@
   
   @DomName('HTMLAnchorElement.host')
   @DocsEditable()
-  void set host(String value) => _blink.BlinkHTMLAnchorElement.instance.host_Setter_(unwrap_jso(this), value);
+  set host(String value) => _blink.BlinkHTMLAnchorElement.instance.host_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLAnchorElement.hostname')
   @DocsEditable()
@@ -749,7 +1386,7 @@
   
   @DomName('HTMLAnchorElement.hostname')
   @DocsEditable()
-  void set hostname(String value) => _blink.BlinkHTMLAnchorElement.instance.hostname_Setter_(unwrap_jso(this), value);
+  set hostname(String value) => _blink.BlinkHTMLAnchorElement.instance.hostname_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLAnchorElement.href')
   @DocsEditable()
@@ -757,7 +1394,7 @@
   
   @DomName('HTMLAnchorElement.href')
   @DocsEditable()
-  void set href(String value) => _blink.BlinkHTMLAnchorElement.instance.href_Setter_(unwrap_jso(this), value);
+  set href(String value) => _blink.BlinkHTMLAnchorElement.instance.href_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLAnchorElement.origin')
   @DocsEditable()
@@ -773,7 +1410,7 @@
   @DomName('HTMLAnchorElement.password')
   @DocsEditable()
   @Experimental() // untriaged
-  void set password(String value) => _blink.BlinkHTMLAnchorElement.instance.password_Setter_(unwrap_jso(this), value);
+  set password(String value) => _blink.BlinkHTMLAnchorElement.instance.password_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLAnchorElement.pathname')
   @DocsEditable()
@@ -781,7 +1418,7 @@
   
   @DomName('HTMLAnchorElement.pathname')
   @DocsEditable()
-  void set pathname(String value) => _blink.BlinkHTMLAnchorElement.instance.pathname_Setter_(unwrap_jso(this), value);
+  set pathname(String value) => _blink.BlinkHTMLAnchorElement.instance.pathname_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLAnchorElement.port')
   @DocsEditable()
@@ -789,7 +1426,7 @@
   
   @DomName('HTMLAnchorElement.port')
   @DocsEditable()
-  void set port(String value) => _blink.BlinkHTMLAnchorElement.instance.port_Setter_(unwrap_jso(this), value);
+  set port(String value) => _blink.BlinkHTMLAnchorElement.instance.port_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLAnchorElement.protocol')
   @DocsEditable()
@@ -797,7 +1434,7 @@
   
   @DomName('HTMLAnchorElement.protocol')
   @DocsEditable()
-  void set protocol(String value) => _blink.BlinkHTMLAnchorElement.instance.protocol_Setter_(unwrap_jso(this), value);
+  set protocol(String value) => _blink.BlinkHTMLAnchorElement.instance.protocol_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLAnchorElement.search')
   @DocsEditable()
@@ -805,7 +1442,7 @@
   
   @DomName('HTMLAnchorElement.search')
   @DocsEditable()
-  void set search(String value) => _blink.BlinkHTMLAnchorElement.instance.search_Setter_(unwrap_jso(this), value);
+  set search(String value) => _blink.BlinkHTMLAnchorElement.instance.search_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLAnchorElement.username')
   @DocsEditable()
@@ -815,7 +1452,7 @@
   @DomName('HTMLAnchorElement.username')
   @DocsEditable()
   @Experimental() // untriaged
-  void set username(String value) => _blink.BlinkHTMLAnchorElement.instance.username_Setter_(unwrap_jso(this), value);
+  set username(String value) => _blink.BlinkHTMLAnchorElement.instance.username_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLAnchorElement.toString')
   @DocsEditable()
@@ -840,17 +1477,32 @@
   @DocsEditable()
   factory Animation(Element target, List<Map> keyframes, [timingInput]) {
     if ((keyframes is List<Map> || keyframes == null) && (target is Element || target == null) && timingInput == null) {
-      return _blink.BlinkAnimation.instance.constructorCallback_2_(target, keyframes);
+      return wrap_jso(_blink.BlinkAnimation.instance.constructorCallback_2_(target, keyframes));
     }
     if ((timingInput is num || timingInput == null) && (keyframes is List<Map> || keyframes == null) && (target is Element || target == null)) {
-      return _blink.BlinkAnimation.instance.constructorCallback_3_(target, keyframes, timingInput);
+      return wrap_jso(_blink.BlinkAnimation.instance.constructorCallback_3_(target, keyframes, timingInput));
     }
     if ((timingInput is Map || timingInput == null) && (keyframes is List<Map> || keyframes == null) && (target is Element || target == null)) {
-      return _blink.BlinkAnimation.instance.constructorCallback_3_(target, keyframes, timingInput);
+      var timingInput_1 = convertDartToNative_Dictionary(timingInput);
+      return wrap_jso(_blink.BlinkAnimation.instance.constructorCallback_3_(target, keyframes, timingInput_1));
     }
     throw new ArgumentError("Incorrect number or type of arguments");
   }
 
+
+  @Deprecated("Internal Use Only")
+  static Animation internalCreateAnimation() {
+    return new Animation._internalWrap();
+  }
+
+  factory Animation._internalWrap() {
+    return new Animation.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  Animation.internal_() : super.internal_();
+
+
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -862,10 +1514,25 @@
 @DocsEditable()
 @DomName('AnimationEffect')
 @Experimental() // untriaged
-class AnimationEffect extends NativeFieldWrapperClass2 {
+class AnimationEffect extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory AnimationEffect._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static AnimationEffect internalCreateAnimationEffect() {
+    return new AnimationEffect._internalWrap();
+  }
+
+  factory AnimationEffect._internalWrap() {
+    return new AnimationEffect.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  AnimationEffect.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -883,13 +1550,27 @@
   // To suppress missing implicit constructor warnings.
   factory AnimationEvent._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static AnimationEvent internalCreateAnimationEvent() {
+    return new AnimationEvent._internalWrap();
+  }
+
+  factory AnimationEvent._internalWrap() {
+    return new AnimationEvent.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  AnimationEvent.internal_() : super.internal_();
+
+
   @DomName('WebKitAnimationEvent.animationName')
   @DocsEditable()
   String get animationName => _blink.BlinkWebKitAnimationEvent.instance.animationName_Getter_(unwrap_jso(this));
   
   @DomName('WebKitAnimationEvent.elapsedTime')
   @DocsEditable()
-  double get elapsedTime => _blink.BlinkWebKitAnimationEvent.instance.elapsedTime_Getter_(unwrap_jso(this));
+  num get elapsedTime => _blink.BlinkWebKitAnimationEvent.instance.elapsedTime_Getter_(unwrap_jso(this));
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -902,14 +1583,29 @@
 @DocsEditable()
 @DomName('AnimationNode')
 @Experimental() // untriaged
-class AnimationNode extends NativeFieldWrapperClass2 {
+class AnimationNode extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory AnimationNode._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static AnimationNode internalCreateAnimationNode() {
+    return new AnimationNode._internalWrap();
+  }
+
+  factory AnimationNode._internalWrap() {
+    return new AnimationNode.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  AnimationNode.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('AnimationNode.activeDuration')
   @DocsEditable()
   @Experimental() // untriaged
-  double get activeDuration => _blink.BlinkAnimationNode.instance.activeDuration_Getter_(unwrap_jso(this));
+  num get activeDuration => _blink.BlinkAnimationNode.instance.activeDuration_Getter_(unwrap_jso(this));
   
   @DomName('AnimationNode.currentIteration')
   @DocsEditable()
@@ -919,17 +1615,17 @@
   @DomName('AnimationNode.duration')
   @DocsEditable()
   @Experimental() // untriaged
-  double get duration => _blink.BlinkAnimationNode.instance.duration_Getter_(unwrap_jso(this));
+  num get duration => _blink.BlinkAnimationNode.instance.duration_Getter_(unwrap_jso(this));
   
   @DomName('AnimationNode.endTime')
   @DocsEditable()
   @Experimental() // untriaged
-  double get endTime => _blink.BlinkAnimationNode.instance.endTime_Getter_(unwrap_jso(this));
+  num get endTime => _blink.BlinkAnimationNode.instance.endTime_Getter_(unwrap_jso(this));
   
   @DomName('AnimationNode.localTime')
   @DocsEditable()
   @Experimental() // untriaged
-  double get localTime => _blink.BlinkAnimationNode.instance.localTime_Getter_(unwrap_jso(this));
+  num get localTime => _blink.BlinkAnimationNode.instance.localTime_Getter_(unwrap_jso(this));
   
   @DomName('AnimationNode.player')
   @DocsEditable()
@@ -939,7 +1635,7 @@
   @DomName('AnimationNode.startTime')
   @DocsEditable()
   @Experimental() // untriaged
-  double get startTime => _blink.BlinkAnimationNode.instance.startTime_Getter_(unwrap_jso(this));
+  num get startTime => _blink.BlinkAnimationNode.instance.startTime_Getter_(unwrap_jso(this));
   
   @DomName('AnimationNode.timing')
   @DocsEditable()
@@ -961,6 +1657,20 @@
   // To suppress missing implicit constructor warnings.
   factory AnimationPlayer._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static AnimationPlayer internalCreateAnimationPlayer() {
+    return new AnimationPlayer._internalWrap();
+  }
+
+  factory AnimationPlayer._internalWrap() {
+    return new AnimationPlayer.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  AnimationPlayer.internal_() : super.internal_();
+
+
   /// Checks if this type is supported on the current platform.
   static bool get supported => true;
 
@@ -972,7 +1682,7 @@
   @DomName('AnimationPlayer.currentTime')
   @DocsEditable()
   @Experimental() // untriaged
-  void set currentTime(num value) => _blink.BlinkAnimationPlayer.instance.currentTime_Setter_(unwrap_jso(this), value);
+  set currentTime(num value) => _blink.BlinkAnimationPlayer.instance.currentTime_Setter_(unwrap_jso(this), value);
   
   @DomName('AnimationPlayer.playState')
   @DocsEditable()
@@ -987,7 +1697,7 @@
   @DomName('AnimationPlayer.playbackRate')
   @DocsEditable()
   @Experimental() // untriaged
-  void set playbackRate(num value) => _blink.BlinkAnimationPlayer.instance.playbackRate_Setter_(unwrap_jso(this), value);
+  set playbackRate(num value) => _blink.BlinkAnimationPlayer.instance.playbackRate_Setter_(unwrap_jso(this), value);
   
   @DomName('AnimationPlayer.source')
   @DocsEditable()
@@ -997,7 +1707,7 @@
   @DomName('AnimationPlayer.source')
   @DocsEditable()
   @Experimental() // untriaged
-  void set source(AnimationNode value) => _blink.BlinkAnimationPlayer.instance.source_Setter_(unwrap_jso(this), unwrap_jso(value));
+  set source(AnimationNode value) => _blink.BlinkAnimationPlayer.instance.source_Setter_(unwrap_jso(this), unwrap_jso(value));
   
   @DomName('AnimationPlayer.startTime')
   @DocsEditable()
@@ -1007,7 +1717,7 @@
   @DomName('AnimationPlayer.startTime')
   @DocsEditable()
   @Experimental() // untriaged
-  void set startTime(num value) => _blink.BlinkAnimationPlayer.instance.startTime_Setter_(unwrap_jso(this), value);
+  set startTime(num value) => _blink.BlinkAnimationPlayer.instance.startTime_Setter_(unwrap_jso(this), value);
   
   @DomName('AnimationPlayer.cancel')
   @DocsEditable()
@@ -1049,15 +1759,29 @@
   // To suppress missing implicit constructor warnings.
   factory AnimationPlayerEvent._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static AnimationPlayerEvent internalCreateAnimationPlayerEvent() {
+    return new AnimationPlayerEvent._internalWrap();
+  }
+
+  factory AnimationPlayerEvent._internalWrap() {
+    return new AnimationPlayerEvent.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  AnimationPlayerEvent.internal_() : super.internal_();
+
+
   @DomName('AnimationPlayerEvent.currentTime')
   @DocsEditable()
   @Experimental() // untriaged
-  double get currentTime => _blink.BlinkAnimationPlayerEvent.instance.currentTime_Getter_(unwrap_jso(this));
+  num get currentTime => _blink.BlinkAnimationPlayerEvent.instance.currentTime_Getter_(unwrap_jso(this));
   
   @DomName('AnimationPlayerEvent.timelineTime')
   @DocsEditable()
   @Experimental() // untriaged
-  double get timelineTime => _blink.BlinkAnimationPlayerEvent.instance.timelineTime_Getter_(unwrap_jso(this));
+  num get timelineTime => _blink.BlinkAnimationPlayerEvent.instance.timelineTime_Getter_(unwrap_jso(this));
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -1070,19 +1794,34 @@
 @DocsEditable()
 @DomName('AnimationTimeline')
 @Experimental() // untriaged
-class AnimationTimeline extends NativeFieldWrapperClass2 {
+class AnimationTimeline extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory AnimationTimeline._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static AnimationTimeline internalCreateAnimationTimeline() {
+    return new AnimationTimeline._internalWrap();
+  }
+
+  factory AnimationTimeline._internalWrap() {
+    return new AnimationTimeline.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  AnimationTimeline.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('AnimationTimeline.currentTime')
   @DocsEditable()
   @Experimental() // untriaged
-  double get currentTime => _blink.BlinkAnimationTimeline.instance.currentTime_Getter_(unwrap_jso(this));
+  num get currentTime => _blink.BlinkAnimationTimeline.instance.currentTime_Getter_(unwrap_jso(this));
   
   @DomName('AnimationTimeline.getAnimationPlayers')
   @DocsEditable()
   @Experimental() // untriaged
-  List<AnimationPlayer> getAnimationPlayers() => _blink.BlinkAnimationTimeline.instance.getAnimationPlayers_Callback_0_(unwrap_jso(this));
+  List<AnimationPlayer> getAnimationPlayers() => wrap_jso(_blink.BlinkAnimationTimeline.instance.getAnimationPlayers_Callback_0_(unwrap_jso(this)));
   
   @DomName('AnimationTimeline.play')
   @DocsEditable()
@@ -1192,6 +1931,20 @@
   @DocsEditable()
   static const EventStreamProvider<Event> updateReadyEvent = const EventStreamProvider<Event>('updateready');
 
+
+  @Deprecated("Internal Use Only")
+  static ApplicationCache internalCreateApplicationCache() {
+    return new ApplicationCache._internalWrap();
+  }
+
+  factory ApplicationCache._internalWrap() {
+    return new ApplicationCache.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  ApplicationCache.internal_() : super.internal_();
+
+
   /// Checks if this type is supported on the current platform.
   static bool get supported => true;
 
@@ -1290,6 +2043,20 @@
   // To suppress missing implicit constructor warnings.
   factory ApplicationCacheErrorEvent._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static ApplicationCacheErrorEvent internalCreateApplicationCacheErrorEvent() {
+    return new ApplicationCacheErrorEvent._internalWrap();
+  }
+
+  factory ApplicationCacheErrorEvent._internalWrap() {
+    return new ApplicationCacheErrorEvent.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  ApplicationCacheErrorEvent.internal_() : super.internal_();
+
+
   @DomName('ApplicationCacheErrorEvent.message')
   @DocsEditable()
   @Experimental() // untriaged
@@ -1337,6 +2104,20 @@
   @DomName('HTMLAreaElement.HTMLAreaElement')
   @DocsEditable()
   factory AreaElement() => document.createElement("area");
+
+
+  @Deprecated("Internal Use Only")
+  static AreaElement internalCreateAreaElement() {
+    return new AreaElement._internalWrap();
+  }
+
+  factory AreaElement._internalWrap() {
+    return new AreaElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  AreaElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -1350,7 +2131,7 @@
   
   @DomName('HTMLAreaElement.alt')
   @DocsEditable()
-  void set alt(String value) => _blink.BlinkHTMLAreaElement.instance.alt_Setter_(unwrap_jso(this), value);
+  set alt(String value) => _blink.BlinkHTMLAreaElement.instance.alt_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLAreaElement.coords')
   @DocsEditable()
@@ -1358,7 +2139,7 @@
   
   @DomName('HTMLAreaElement.coords')
   @DocsEditable()
-  void set coords(String value) => _blink.BlinkHTMLAreaElement.instance.coords_Setter_(unwrap_jso(this), value);
+  set coords(String value) => _blink.BlinkHTMLAreaElement.instance.coords_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLAreaElement.shape')
   @DocsEditable()
@@ -1366,7 +2147,7 @@
   
   @DomName('HTMLAreaElement.shape')
   @DocsEditable()
-  void set shape(String value) => _blink.BlinkHTMLAreaElement.instance.shape_Setter_(unwrap_jso(this), value);
+  set shape(String value) => _blink.BlinkHTMLAreaElement.instance.shape_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLAreaElement.target')
   @DocsEditable()
@@ -1374,7 +2155,7 @@
   
   @DomName('HTMLAreaElement.target')
   @DocsEditable()
-  void set target(String value) => _blink.BlinkHTMLAreaElement.instance.target_Setter_(unwrap_jso(this), value);
+  set target(String value) => _blink.BlinkHTMLAreaElement.instance.target_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLAreaElement.hash')
   @DocsEditable()
@@ -1382,7 +2163,7 @@
   
   @DomName('HTMLAreaElement.hash')
   @DocsEditable()
-  void set hash(String value) => _blink.BlinkHTMLAreaElement.instance.hash_Setter_(unwrap_jso(this), value);
+  set hash(String value) => _blink.BlinkHTMLAreaElement.instance.hash_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLAreaElement.host')
   @DocsEditable()
@@ -1390,7 +2171,7 @@
   
   @DomName('HTMLAreaElement.host')
   @DocsEditable()
-  void set host(String value) => _blink.BlinkHTMLAreaElement.instance.host_Setter_(unwrap_jso(this), value);
+  set host(String value) => _blink.BlinkHTMLAreaElement.instance.host_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLAreaElement.hostname')
   @DocsEditable()
@@ -1398,7 +2179,7 @@
   
   @DomName('HTMLAreaElement.hostname')
   @DocsEditable()
-  void set hostname(String value) => _blink.BlinkHTMLAreaElement.instance.hostname_Setter_(unwrap_jso(this), value);
+  set hostname(String value) => _blink.BlinkHTMLAreaElement.instance.hostname_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLAreaElement.href')
   @DocsEditable()
@@ -1406,7 +2187,7 @@
   
   @DomName('HTMLAreaElement.href')
   @DocsEditable()
-  void set href(String value) => _blink.BlinkHTMLAreaElement.instance.href_Setter_(unwrap_jso(this), value);
+  set href(String value) => _blink.BlinkHTMLAreaElement.instance.href_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLAreaElement.origin')
   @DocsEditable()
@@ -1421,7 +2202,7 @@
   @DomName('HTMLAreaElement.password')
   @DocsEditable()
   @Experimental() // untriaged
-  void set password(String value) => _blink.BlinkHTMLAreaElement.instance.password_Setter_(unwrap_jso(this), value);
+  set password(String value) => _blink.BlinkHTMLAreaElement.instance.password_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLAreaElement.pathname')
   @DocsEditable()
@@ -1429,7 +2210,7 @@
   
   @DomName('HTMLAreaElement.pathname')
   @DocsEditable()
-  void set pathname(String value) => _blink.BlinkHTMLAreaElement.instance.pathname_Setter_(unwrap_jso(this), value);
+  set pathname(String value) => _blink.BlinkHTMLAreaElement.instance.pathname_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLAreaElement.port')
   @DocsEditable()
@@ -1437,7 +2218,7 @@
   
   @DomName('HTMLAreaElement.port')
   @DocsEditable()
-  void set port(String value) => _blink.BlinkHTMLAreaElement.instance.port_Setter_(unwrap_jso(this), value);
+  set port(String value) => _blink.BlinkHTMLAreaElement.instance.port_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLAreaElement.protocol')
   @DocsEditable()
@@ -1445,7 +2226,7 @@
   
   @DomName('HTMLAreaElement.protocol')
   @DocsEditable()
-  void set protocol(String value) => _blink.BlinkHTMLAreaElement.instance.protocol_Setter_(unwrap_jso(this), value);
+  set protocol(String value) => _blink.BlinkHTMLAreaElement.instance.protocol_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLAreaElement.search')
   @DocsEditable()
@@ -1453,7 +2234,7 @@
   
   @DomName('HTMLAreaElement.search')
   @DocsEditable()
-  void set search(String value) => _blink.BlinkHTMLAreaElement.instance.search_Setter_(unwrap_jso(this), value);
+  set search(String value) => _blink.BlinkHTMLAreaElement.instance.search_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLAreaElement.username')
   @DocsEditable()
@@ -1463,7 +2244,7 @@
   @DomName('HTMLAreaElement.username')
   @DocsEditable()
   @Experimental() // untriaged
-  void set username(String value) => _blink.BlinkHTMLAreaElement.instance.username_Setter_(unwrap_jso(this), value);
+  set username(String value) => _blink.BlinkHTMLAreaElement.instance.username_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLAreaElement.toString')
   @DocsEditable()
@@ -1475,20 +2256,30 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-// WARNING: Do not edit - generated code.
-
 
 @DocsEditable()
 @DomName('HTMLAudioElement')
 class AudioElement extends MediaElement {
-  // To suppress missing implicit constructor warnings.
-  factory AudioElement._() { throw new UnsupportedError("Not supported"); }
 
   @DomName('HTMLAudioElement.HTMLAudioElement')
   @DocsEditable()
-  factory AudioElement([String src]) {
-    return _blink.BlinkHTMLAudioElement.instance.constructorCallback_1_(src);
+  factory AudioElement._([String src]) {
+    return wrap_jso(_blink.BlinkHTMLAudioElement.instance.constructorCallback_1_(src));
   }
+
+
+  @Deprecated("Internal Use Only")
+  static AudioElement internalCreateAudioElement() {
+    return new AudioElement._internalWrap();
+  }
+
+  factory AudioElement._internalWrap() {
+    return new AudioElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  AudioElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -1496,6 +2287,12 @@
    */
   AudioElement.created() : super.created();
 
+  factory AudioElement([String src]) {
+    if (src == null)
+      return wrap_jso(_blink.BlinkHTMLAudioElement.instance.constructorCallback_0_());
+    else
+      return wrap_jso(_blink.BlinkHTMLAudioElement.instance.constructorCallback_1_(src));
+  }
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -1507,10 +2304,25 @@
 @DocsEditable()
 @DomName('AudioTrack')
 @Experimental() // untriaged
-class AudioTrack extends NativeFieldWrapperClass2 {
+class AudioTrack extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory AudioTrack._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static AudioTrack internalCreateAudioTrack() {
+    return new AudioTrack._internalWrap();
+  }
+
+  factory AudioTrack._internalWrap() {
+    return new AudioTrack.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  AudioTrack.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('AudioTrack.enabled')
   @DocsEditable()
   @Experimental() // untriaged
@@ -1519,7 +2331,7 @@
   @DomName('AudioTrack.enabled')
   @DocsEditable()
   @Experimental() // untriaged
-  void set enabled(bool value) => _blink.BlinkAudioTrack.instance.enabled_Setter_(unwrap_jso(this), value);
+  set enabled(bool value) => _blink.BlinkAudioTrack.instance.enabled_Setter_(unwrap_jso(this), value);
   
   @DomName('AudioTrack.id')
   @DocsEditable()
@@ -1561,6 +2373,20 @@
   @Experimental() // untriaged
   static const EventStreamProvider<Event> changeEvent = const EventStreamProvider<Event>('change');
 
+
+  @Deprecated("Internal Use Only")
+  static AudioTrackList internalCreateAudioTrackList() {
+    return new AudioTrackList._internalWrap();
+  }
+
+  factory AudioTrackList._internalWrap() {
+    return new AudioTrackList.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  AudioTrackList.internal_() : super.internal_();
+
+
   @DomName('AudioTrackList.length')
   @DocsEditable()
   @Experimental() // untriaged
@@ -1597,6 +2423,20 @@
   // To suppress missing implicit constructor warnings.
   factory AutocompleteErrorEvent._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static AutocompleteErrorEvent internalCreateAutocompleteErrorEvent() {
+    return new AutocompleteErrorEvent._internalWrap();
+  }
+
+  factory AutocompleteErrorEvent._internalWrap() {
+    return new AutocompleteErrorEvent.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  AutocompleteErrorEvent.internal_() : super.internal_();
+
+
   @DomName('AutocompleteErrorEvent.reason')
   @DocsEditable()
   String get reason => _blink.BlinkAutocompleteErrorEvent.instance.reason_Getter_(unwrap_jso(this));
@@ -1618,6 +2458,20 @@
   @DomName('HTMLBRElement.HTMLBRElement')
   @DocsEditable()
   factory BRElement() => document.createElement("br");
+
+
+  @Deprecated("Internal Use Only")
+  static BRElement internalCreateBRElement() {
+    return new BRElement._internalWrap();
+  }
+
+  factory BRElement._internalWrap() {
+    return new BRElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  BRElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -1637,10 +2491,25 @@
 @DomName('BarProp')
 // http://www.whatwg.org/specs/web-apps/current-work/multipage/browsers.html#barprop
 @deprecated // standard
-class BarProp extends NativeFieldWrapperClass2 {
+class BarProp extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory BarProp._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static BarProp internalCreateBarProp() {
+    return new BarProp._internalWrap();
+  }
+
+  factory BarProp._internalWrap() {
+    return new BarProp.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  BarProp.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('BarProp.visible')
   @DocsEditable()
   bool get visible => _blink.BlinkBarProp.instance.visible_Getter_(unwrap_jso(this));
@@ -1662,6 +2531,20 @@
   @DomName('HTMLBaseElement.HTMLBaseElement')
   @DocsEditable()
   factory BaseElement() => document.createElement("base");
+
+
+  @Deprecated("Internal Use Only")
+  static BaseElement internalCreateBaseElement() {
+    return new BaseElement._internalWrap();
+  }
+
+  factory BaseElement._internalWrap() {
+    return new BaseElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  BaseElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -1675,7 +2558,7 @@
   
   @DomName('HTMLBaseElement.href')
   @DocsEditable()
-  void set href(String value) => _blink.BlinkHTMLBaseElement.instance.href_Setter_(unwrap_jso(this), value);
+  set href(String value) => _blink.BlinkHTMLBaseElement.instance.href_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLBaseElement.target')
   @DocsEditable()
@@ -1683,7 +2566,7 @@
   
   @DomName('HTMLBaseElement.target')
   @DocsEditable()
-  void set target(String value) => _blink.BlinkHTMLBaseElement.instance.target_Setter_(unwrap_jso(this), value);
+  set target(String value) => _blink.BlinkHTMLBaseElement.instance.target_Setter_(unwrap_jso(this), value);
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -1701,21 +2584,35 @@
   // To suppress missing implicit constructor warnings.
   factory BatteryManager._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static BatteryManager internalCreateBatteryManager() {
+    return new BatteryManager._internalWrap();
+  }
+
+  factory BatteryManager._internalWrap() {
+    return new BatteryManager.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  BatteryManager.internal_() : super.internal_();
+
+
   @DomName('BatteryManager.charging')
   @DocsEditable()
   bool get charging => _blink.BlinkBatteryManager.instance.charging_Getter_(unwrap_jso(this));
   
   @DomName('BatteryManager.chargingTime')
   @DocsEditable()
-  double get chargingTime => _blink.BlinkBatteryManager.instance.chargingTime_Getter_(unwrap_jso(this));
+  num get chargingTime => _blink.BlinkBatteryManager.instance.chargingTime_Getter_(unwrap_jso(this));
   
   @DomName('BatteryManager.dischargingTime')
   @DocsEditable()
-  double get dischargingTime => _blink.BlinkBatteryManager.instance.dischargingTime_Getter_(unwrap_jso(this));
+  num get dischargingTime => _blink.BlinkBatteryManager.instance.dischargingTime_Getter_(unwrap_jso(this));
   
   @DomName('BatteryManager.level')
   @DocsEditable()
-  double get level => _blink.BlinkBatteryManager.instance.level_Getter_(unwrap_jso(this));
+  num get level => _blink.BlinkBatteryManager.instance.level_Getter_(unwrap_jso(this));
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -1731,13 +2628,27 @@
   // To suppress missing implicit constructor warnings.
   factory BeforeUnloadEvent._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static BeforeUnloadEvent internalCreateBeforeUnloadEvent() {
+    return new BeforeUnloadEvent._internalWrap();
+  }
+
+  factory BeforeUnloadEvent._internalWrap() {
+    return new BeforeUnloadEvent.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  BeforeUnloadEvent.internal_() : super.internal_();
+
+
   @DomName('BeforeUnloadEvent.returnValue')
   @DocsEditable()
   String get returnValue => _blink.BlinkBeforeUnloadEvent.instance.returnValue_Getter_(unwrap_jso(this));
   
   @DomName('BeforeUnloadEvent.returnValue')
   @DocsEditable()
-  void set returnValue(String value) => _blink.BlinkBeforeUnloadEvent.instance.returnValue_Setter_(unwrap_jso(this), value);
+  set returnValue(String value) => _blink.BlinkBeforeUnloadEvent.instance.returnValue_Setter_(unwrap_jso(this), value);
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -1746,16 +2657,24 @@
 
 
 @DomName('Blob')
-class Blob extends NativeFieldWrapperClass2 {
+class Blob extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory Blob._() { throw new UnsupportedError("Not supported"); }
 
-  @DomName('Blob.Blob')
-  @DocsEditable()
-  factory Blob(List blobParts, [String type, String endings]) => wrap_jso(_create(blobParts, type, endings));
+  @Deprecated("Internal Use Only")
+  static Blob internalCreateBlob() {
+    return new Blob._internalWrap();
+  }
 
-  @DocsEditable()
-  static Blob _create(blobParts, type, endings) => _blink.BlinkBlob.instance.constructorCallback_3_(blobParts, type, endings);
+  factory Blob._internalWrap() {
+    return new Blob.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  Blob.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
 
   @DomName('Blob.size')
   @DocsEditable()
@@ -1783,6 +2702,20 @@
     return wrap_jso(_blink.BlinkBlob.instance.slice_Callback_0_(unwrap_jso(this)));
   }
 
+  factory Blob(List blobParts, [String type, String endings]) {
+    // TODO: any coercions on the elements of blobParts, e.g. coerce a typed
+    // array to ArrayBuffer if it is a total view.
+
+    var parts = convertDartToNative_List(blobParts.map(unwrap_jso).toList());
+    if (type == null && endings == null) {
+      return wrap_jso(_blink.BlinkBlob.instance.constructorCallback_1_(parts));
+    }
+    var bag = {};
+    if (type != null) bag['type'] = type;
+    if (endings != null) bag['endings'] = endings;
+    return wrap_jso(_blink.BlinkBlob.instance.constructorCallback_2_(parts,
+        convertDartToNative_Dictionary(bag)));
+  }
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -1794,10 +2727,25 @@
 @DocsEditable()
 @DomName('Body')
 @Experimental() // untriaged
-class Body extends NativeFieldWrapperClass2 {
+class Body extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory Body._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static Body internalCreateBody() {
+    return new Body._internalWrap();
+  }
+
+  factory Body._internalWrap() {
+    return new Body.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  Body.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('Body.bodyUsed')
   @DocsEditable()
   @Experimental() // untriaged
@@ -1806,22 +2754,22 @@
   @DomName('Body.arrayBuffer')
   @DocsEditable()
   @Experimental() // untriaged
-  Future arrayBuffer() => _blink.BlinkBody.instance.arrayBuffer_Callback_0_(unwrap_jso(this));
+  Future arrayBuffer() => wrap_jso(_blink.BlinkBody.instance.arrayBuffer_Callback_0_(unwrap_jso(this)));
   
   @DomName('Body.blob')
   @DocsEditable()
   @Experimental() // untriaged
-  Future blob() => _blink.BlinkBody.instance.blob_Callback_0_(unwrap_jso(this));
+  Future blob() => wrap_jso(_blink.BlinkBody.instance.blob_Callback_0_(unwrap_jso(this)));
   
   @DomName('Body.json')
   @DocsEditable()
   @Experimental() // untriaged
-  Future json() => _blink.BlinkBody.instance.json_Callback_0_(unwrap_jso(this));
+  Future json() => wrap_jso(_blink.BlinkBody.instance.json_Callback_0_(unwrap_jso(this)));
   
   @DomName('Body.text')
   @DocsEditable()
   @Experimental() // untriaged
-  Future text() => _blink.BlinkBody.instance.text_Callback_0_(unwrap_jso(this));
+  Future text() => wrap_jso(_blink.BlinkBody.instance.text_Callback_0_(unwrap_jso(this)));
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -1965,6 +2913,20 @@
   @DomName('HTMLBodyElement.HTMLBodyElement')
   @DocsEditable()
   factory BodyElement() => document.createElement("body");
+
+
+  @Deprecated("Internal Use Only")
+  static BodyElement internalCreateBodyElement() {
+    return new BodyElement._internalWrap();
+  }
+
+  factory BodyElement._internalWrap() {
+    return new BodyElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  BodyElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -2054,6 +3016,20 @@
   @DomName('HTMLButtonElement.HTMLButtonElement')
   @DocsEditable()
   factory ButtonElement() => document.createElement("button");
+
+
+  @Deprecated("Internal Use Only")
+  static ButtonElement internalCreateButtonElement() {
+    return new ButtonElement._internalWrap();
+  }
+
+  factory ButtonElement._internalWrap() {
+    return new ButtonElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  ButtonElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -2067,7 +3043,7 @@
   
   @DomName('HTMLButtonElement.autofocus')
   @DocsEditable()
-  void set autofocus(bool value) => _blink.BlinkHTMLButtonElement.instance.autofocus_Setter_(unwrap_jso(this), value);
+  set autofocus(bool value) => _blink.BlinkHTMLButtonElement.instance.autofocus_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLButtonElement.disabled')
   @DocsEditable()
@@ -2075,7 +3051,7 @@
   
   @DomName('HTMLButtonElement.disabled')
   @DocsEditable()
-  void set disabled(bool value) => _blink.BlinkHTMLButtonElement.instance.disabled_Setter_(unwrap_jso(this), value);
+  set disabled(bool value) => _blink.BlinkHTMLButtonElement.instance.disabled_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLButtonElement.form')
   @DocsEditable()
@@ -2087,7 +3063,7 @@
   
   @DomName('HTMLButtonElement.formAction')
   @DocsEditable()
-  void set formAction(String value) => _blink.BlinkHTMLButtonElement.instance.formAction_Setter_(unwrap_jso(this), value);
+  set formAction(String value) => _blink.BlinkHTMLButtonElement.instance.formAction_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLButtonElement.formEnctype')
   @DocsEditable()
@@ -2095,7 +3071,7 @@
   
   @DomName('HTMLButtonElement.formEnctype')
   @DocsEditable()
-  void set formEnctype(String value) => _blink.BlinkHTMLButtonElement.instance.formEnctype_Setter_(unwrap_jso(this), value);
+  set formEnctype(String value) => _blink.BlinkHTMLButtonElement.instance.formEnctype_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLButtonElement.formMethod')
   @DocsEditable()
@@ -2103,7 +3079,7 @@
   
   @DomName('HTMLButtonElement.formMethod')
   @DocsEditable()
-  void set formMethod(String value) => _blink.BlinkHTMLButtonElement.instance.formMethod_Setter_(unwrap_jso(this), value);
+  set formMethod(String value) => _blink.BlinkHTMLButtonElement.instance.formMethod_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLButtonElement.formNoValidate')
   @DocsEditable()
@@ -2111,7 +3087,7 @@
   
   @DomName('HTMLButtonElement.formNoValidate')
   @DocsEditable()
-  void set formNoValidate(bool value) => _blink.BlinkHTMLButtonElement.instance.formNoValidate_Setter_(unwrap_jso(this), value);
+  set formNoValidate(bool value) => _blink.BlinkHTMLButtonElement.instance.formNoValidate_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLButtonElement.formTarget')
   @DocsEditable()
@@ -2119,12 +3095,12 @@
   
   @DomName('HTMLButtonElement.formTarget')
   @DocsEditable()
-  void set formTarget(String value) => _blink.BlinkHTMLButtonElement.instance.formTarget_Setter_(unwrap_jso(this), value);
+  set formTarget(String value) => _blink.BlinkHTMLButtonElement.instance.formTarget_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLButtonElement.labels')
   @DocsEditable()
   @Unstable()
-  List<Node> get labels => wrap_jso_list(_blink.BlinkHTMLButtonElement.instance.labels_Getter_(unwrap_jso(this)));
+  List<Node> get labels => wrap_jso(_blink.BlinkHTMLButtonElement.instance.labels_Getter_(unwrap_jso(this)));
   
   @DomName('HTMLButtonElement.name')
   @DocsEditable()
@@ -2132,7 +3108,7 @@
   
   @DomName('HTMLButtonElement.name')
   @DocsEditable()
-  void set name(String value) => _blink.BlinkHTMLButtonElement.instance.name_Setter_(unwrap_jso(this), value);
+  set name(String value) => _blink.BlinkHTMLButtonElement.instance.name_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLButtonElement.type')
   @DocsEditable()
@@ -2140,7 +3116,7 @@
   
   @DomName('HTMLButtonElement.type')
   @DocsEditable()
-  void set type(String value) => _blink.BlinkHTMLButtonElement.instance.type_Setter_(unwrap_jso(this), value);
+  set type(String value) => _blink.BlinkHTMLButtonElement.instance.type_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLButtonElement.validationMessage')
   @DocsEditable()
@@ -2156,7 +3132,7 @@
   
   @DomName('HTMLButtonElement.value')
   @DocsEditable()
-  void set value(String value) => _blink.BlinkHTMLButtonElement.instance.value_Setter_(unwrap_jso(this), value);
+  set value(String value) => _blink.BlinkHTMLButtonElement.instance.value_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLButtonElement.willValidate')
   @DocsEditable()
@@ -2186,6 +3162,20 @@
   // To suppress missing implicit constructor warnings.
   factory CDataSection._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static CDataSection internalCreateCDataSection() {
+    return new CDataSection._internalWrap();
+  }
+
+  factory CDataSection._internalWrap() {
+    return new CDataSection.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  CDataSection.internal_() : super.internal_();
+
+
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -2197,34 +3187,49 @@
 @DocsEditable()
 @DomName('CacheStorage')
 @Experimental() // untriaged
-class CacheStorage extends NativeFieldWrapperClass2 {
+class CacheStorage extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory CacheStorage._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static CacheStorage internalCreateCacheStorage() {
+    return new CacheStorage._internalWrap();
+  }
+
+  factory CacheStorage._internalWrap() {
+    return new CacheStorage.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  CacheStorage.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('CacheStorage.create')
   @DocsEditable()
   @Experimental() // untriaged
-  Future create(String cacheName) => _blink.BlinkCacheStorage.instance.create_Callback_1_(unwrap_jso(this), cacheName);
+  Future create(String cacheName) => wrap_jso(_blink.BlinkCacheStorage.instance.create_Callback_1_(unwrap_jso(this), cacheName));
   
   @DomName('CacheStorage.delete')
   @DocsEditable()
   @Experimental() // untriaged
-  Future delete(String cacheName) => _blink.BlinkCacheStorage.instance.delete_Callback_1_(unwrap_jso(this), cacheName);
+  Future delete(String cacheName) => wrap_jso(_blink.BlinkCacheStorage.instance.delete_Callback_1_(unwrap_jso(this), cacheName));
   
   @DomName('CacheStorage.get')
   @DocsEditable()
   @Experimental() // untriaged
-  Future get(String cacheName) => _blink.BlinkCacheStorage.instance.get_Callback_1_(unwrap_jso(this), cacheName);
+  Future get(String cacheName) => wrap_jso(_blink.BlinkCacheStorage.instance.get_Callback_1_(unwrap_jso(this), cacheName));
   
   @DomName('CacheStorage.has')
   @DocsEditable()
   @Experimental() // untriaged
-  Future has(String cacheName) => _blink.BlinkCacheStorage.instance.has_Callback_1_(unwrap_jso(this), cacheName);
+  Future has(String cacheName) => wrap_jso(_blink.BlinkCacheStorage.instance.has_Callback_1_(unwrap_jso(this), cacheName));
   
   @DomName('CacheStorage.keys')
   @DocsEditable()
   @Experimental() // untriaged
-  Future keys() => _blink.BlinkCacheStorage.instance.keys_Callback_0_(unwrap_jso(this));
+  Future keys() => wrap_jso(_blink.BlinkCacheStorage.instance.keys_Callback_0_(unwrap_jso(this)));
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -2238,17 +3243,32 @@
 @DomName('Canvas2DContextAttributes')
 // http://wiki.whatwg.org/wiki/CanvasOpaque#Suggested_IDL
 @Experimental()
-class Canvas2DContextAttributes extends NativeFieldWrapperClass2 {
+class Canvas2DContextAttributes extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory Canvas2DContextAttributes._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static Canvas2DContextAttributes internalCreateCanvas2DContextAttributes() {
+    return new Canvas2DContextAttributes._internalWrap();
+  }
+
+  factory Canvas2DContextAttributes._internalWrap() {
+    return new Canvas2DContextAttributes.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  Canvas2DContextAttributes.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('Canvas2DContextAttributes.alpha')
   @DocsEditable()
   bool get alpha => _blink.BlinkCanvas2DContextAttributes.instance.alpha_Getter_(unwrap_jso(this));
   
   @DomName('Canvas2DContextAttributes.alpha')
   @DocsEditable()
-  void set alpha(bool value) => _blink.BlinkCanvas2DContextAttributes.instance.alpha_Setter_(unwrap_jso(this), value);
+  set alpha(bool value) => _blink.BlinkCanvas2DContextAttributes.instance.alpha_Setter_(unwrap_jso(this), value);
   
   @DomName('Canvas2DContextAttributes.storage')
   @DocsEditable()
@@ -2258,7 +3278,7 @@
   @DomName('Canvas2DContextAttributes.storage')
   @DocsEditable()
   @Experimental() // untriaged
-  void set storage(String value) => _blink.BlinkCanvas2DContextAttributes.instance.storage_Setter_(unwrap_jso(this), value);
+  set storage(String value) => _blink.BlinkCanvas2DContextAttributes.instance.storage_Setter_(unwrap_jso(this), value);
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -2299,6 +3319,20 @@
     if (height != null) e.height = height;
     return e;
   }
+
+
+  @Deprecated("Internal Use Only")
+  static CanvasElement internalCreateCanvasElement() {
+    return new CanvasElement._internalWrap();
+  }
+
+  factory CanvasElement._internalWrap() {
+    return new CanvasElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  CanvasElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -2314,7 +3348,7 @@
   /// The height of this canvas element in CSS pixels.
   @DomName('HTMLCanvasElement.height')
   @DocsEditable()
-  void set height(int value) => _blink.BlinkHTMLCanvasElement.instance.height_Setter_(unwrap_jso(this), value);
+  set height(int value) => _blink.BlinkHTMLCanvasElement.instance.height_Setter_(unwrap_jso(this), value);
   
   /// The width of this canvas element in CSS pixels.
   @DomName('HTMLCanvasElement.width')
@@ -2324,11 +3358,11 @@
   /// The width of this canvas element in CSS pixels.
   @DomName('HTMLCanvasElement.width')
   @DocsEditable()
-  void set width(int value) => _blink.BlinkHTMLCanvasElement.instance.width_Setter_(unwrap_jso(this), value);
+  set width(int value) => _blink.BlinkHTMLCanvasElement.instance.width_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLCanvasElement.getContext')
   @DocsEditable()
-  Object getContext(String contextId, [Map attrs]) => wrap_jso(_blink.BlinkHTMLCanvasElement.instance.getContext_Callback_2_(unwrap_jso(this), contextId, attrs));
+  Object getContext(String contextId, [Map attrs]) => wrap_jso(_blink.BlinkHTMLCanvasElement.instance.getContext_Callback_2_(unwrap_jso(this), contextId, convertDartToNative_Dictionary(attrs)));
   
   @DomName('HTMLCanvasElement.toDataURL')
   @DocsEditable()
@@ -2460,10 +3494,25 @@
  * * [CanvasGradient](http://www.w3.org/TR/2010/WD-2dcontext-20100304/#canvasgradient) from W3C.
  */
 @DomName('CanvasGradient')
-class CanvasGradient extends NativeFieldWrapperClass2 {
+class CanvasGradient extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory CanvasGradient._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static CanvasGradient internalCreateCanvasGradient() {
+    return new CanvasGradient._internalWrap();
+  }
+
+  factory CanvasGradient._internalWrap() {
+    return new CanvasGradient.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  CanvasGradient.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   /**
    * Adds a color stop to this gradient at the offset.
    *
@@ -2514,10 +3563,25 @@
  * * [CanvasPattern](http://www.w3.org/TR/2010/WD-2dcontext-20100304/#canvaspattern) from W3C.
  */
 @DomName('CanvasPattern')
-class CanvasPattern extends NativeFieldWrapperClass2 {
+class CanvasPattern extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory CanvasPattern._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static CanvasPattern internalCreateCanvasPattern() {
+    return new CanvasPattern._internalWrap();
+  }
+
+  factory CanvasPattern._internalWrap() {
+    return new CanvasPattern.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  CanvasPattern.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('CanvasPattern.setTransform')
   @DocsEditable()
   @Experimental() // untriaged
@@ -2534,10 +3598,25 @@
 }
 
 @DomName('CanvasRenderingContext2D')
-class CanvasRenderingContext2D extends NativeFieldWrapperClass2 implements CanvasRenderingContext {
+class CanvasRenderingContext2D extends DartHtmlDomObject implements CanvasRenderingContext {
   // To suppress missing implicit constructor warnings.
   factory CanvasRenderingContext2D._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static CanvasRenderingContext2D internalCreateCanvasRenderingContext2D() {
+    return new CanvasRenderingContext2D._internalWrap();
+  }
+
+  factory CanvasRenderingContext2D._internalWrap() {
+    return new CanvasRenderingContext2D.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  CanvasRenderingContext2D.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('CanvasRenderingContext2D.canvas')
   @DocsEditable()
   @Experimental() // untriaged
@@ -2551,7 +3630,7 @@
   @DomName('CanvasRenderingContext2D.currentTransform')
   @DocsEditable()
   @Experimental() // untriaged
-  void set currentTransform(Matrix value) => _blink.BlinkCanvasRenderingContext2D.instance.currentTransform_Setter_(unwrap_jso(this), unwrap_jso(value));
+  set currentTransform(Matrix value) => _blink.BlinkCanvasRenderingContext2D.instance.currentTransform_Setter_(unwrap_jso(this), unwrap_jso(value));
   
   @DomName('CanvasRenderingContext2D.direction')
   @DocsEditable()
@@ -2561,15 +3640,15 @@
   @DomName('CanvasRenderingContext2D.direction')
   @DocsEditable()
   @Experimental() // untriaged
-  void set direction(String value) => _blink.BlinkCanvasRenderingContext2D.instance.direction_Setter_(unwrap_jso(this), value);
+  set direction(String value) => _blink.BlinkCanvasRenderingContext2D.instance.direction_Setter_(unwrap_jso(this), value);
   
   @DomName('CanvasRenderingContext2D.fillStyle')
   @DocsEditable()
-  Object get fillStyle => _blink.BlinkCanvasRenderingContext2D.instance.fillStyle_Getter_(unwrap_jso(this));
+  Object get fillStyle => wrap_jso(_blink.BlinkCanvasRenderingContext2D.instance.fillStyle_Getter_(unwrap_jso(this)));
   
   @DomName('CanvasRenderingContext2D.fillStyle')
   @DocsEditable()
-  void set fillStyle(Object value) => _blink.BlinkCanvasRenderingContext2D.instance.fillStyle_Setter_(unwrap_jso(this), unwrap_jso(value));
+  set fillStyle(Object value) => _blink.BlinkCanvasRenderingContext2D.instance.fillStyle_Setter_(unwrap_jso(this), unwrap_jso(value));
   
   @DomName('CanvasRenderingContext2D.font')
   @DocsEditable()
@@ -2577,7 +3656,7 @@
   
   @DomName('CanvasRenderingContext2D.font')
   @DocsEditable()
-  void set font(String value) => _blink.BlinkCanvasRenderingContext2D.instance.font_Setter_(unwrap_jso(this), value);
+  set font(String value) => _blink.BlinkCanvasRenderingContext2D.instance.font_Setter_(unwrap_jso(this), value);
   
   @DomName('CanvasRenderingContext2D.globalAlpha')
   @DocsEditable()
@@ -2585,7 +3664,7 @@
   
   @DomName('CanvasRenderingContext2D.globalAlpha')
   @DocsEditable()
-  void set globalAlpha(num value) => _blink.BlinkCanvasRenderingContext2D.instance.globalAlpha_Setter_(unwrap_jso(this), value);
+  set globalAlpha(num value) => _blink.BlinkCanvasRenderingContext2D.instance.globalAlpha_Setter_(unwrap_jso(this), value);
   
   @DomName('CanvasRenderingContext2D.globalCompositeOperation')
   @DocsEditable()
@@ -2593,7 +3672,7 @@
   
   @DomName('CanvasRenderingContext2D.globalCompositeOperation')
   @DocsEditable()
-  void set globalCompositeOperation(String value) => _blink.BlinkCanvasRenderingContext2D.instance.globalCompositeOperation_Setter_(unwrap_jso(this), value);
+  set globalCompositeOperation(String value) => _blink.BlinkCanvasRenderingContext2D.instance.globalCompositeOperation_Setter_(unwrap_jso(this), value);
   
   /**
    * Whether images and patterns on this canvas will be smoothed when this
@@ -2623,7 +3702,7 @@
   @DomName('CanvasRenderingContext2D.imageSmoothingEnabled')
   @DocsEditable()
   @Experimental() // untriaged
-  void set imageSmoothingEnabled(bool value) => _blink.BlinkCanvasRenderingContext2D.instance.imageSmoothingEnabled_Setter_(unwrap_jso(this), value);
+  set imageSmoothingEnabled(bool value) => _blink.BlinkCanvasRenderingContext2D.instance.imageSmoothingEnabled_Setter_(unwrap_jso(this), value);
   
   @DomName('CanvasRenderingContext2D.lineCap')
   @DocsEditable()
@@ -2631,7 +3710,7 @@
   
   @DomName('CanvasRenderingContext2D.lineCap')
   @DocsEditable()
-  void set lineCap(String value) => _blink.BlinkCanvasRenderingContext2D.instance.lineCap_Setter_(unwrap_jso(this), value);
+  set lineCap(String value) => _blink.BlinkCanvasRenderingContext2D.instance.lineCap_Setter_(unwrap_jso(this), value);
   
   @DomName('CanvasRenderingContext2D.lineDashOffset')
   @DocsEditable()
@@ -2639,7 +3718,7 @@
   
   @DomName('CanvasRenderingContext2D.lineDashOffset')
   @DocsEditable()
-  void set lineDashOffset(num value) => _blink.BlinkCanvasRenderingContext2D.instance.lineDashOffset_Setter_(unwrap_jso(this), value);
+  set lineDashOffset(num value) => _blink.BlinkCanvasRenderingContext2D.instance.lineDashOffset_Setter_(unwrap_jso(this), value);
   
   @DomName('CanvasRenderingContext2D.lineJoin')
   @DocsEditable()
@@ -2647,7 +3726,7 @@
   
   @DomName('CanvasRenderingContext2D.lineJoin')
   @DocsEditable()
-  void set lineJoin(String value) => _blink.BlinkCanvasRenderingContext2D.instance.lineJoin_Setter_(unwrap_jso(this), value);
+  set lineJoin(String value) => _blink.BlinkCanvasRenderingContext2D.instance.lineJoin_Setter_(unwrap_jso(this), value);
   
   @DomName('CanvasRenderingContext2D.lineWidth')
   @DocsEditable()
@@ -2655,7 +3734,7 @@
   
   @DomName('CanvasRenderingContext2D.lineWidth')
   @DocsEditable()
-  void set lineWidth(num value) => _blink.BlinkCanvasRenderingContext2D.instance.lineWidth_Setter_(unwrap_jso(this), value);
+  set lineWidth(num value) => _blink.BlinkCanvasRenderingContext2D.instance.lineWidth_Setter_(unwrap_jso(this), value);
   
   @DomName('CanvasRenderingContext2D.miterLimit')
   @DocsEditable()
@@ -2663,7 +3742,7 @@
   
   @DomName('CanvasRenderingContext2D.miterLimit')
   @DocsEditable()
-  void set miterLimit(num value) => _blink.BlinkCanvasRenderingContext2D.instance.miterLimit_Setter_(unwrap_jso(this), value);
+  set miterLimit(num value) => _blink.BlinkCanvasRenderingContext2D.instance.miterLimit_Setter_(unwrap_jso(this), value);
   
   @DomName('CanvasRenderingContext2D.shadowBlur')
   @DocsEditable()
@@ -2671,7 +3750,7 @@
   
   @DomName('CanvasRenderingContext2D.shadowBlur')
   @DocsEditable()
-  void set shadowBlur(num value) => _blink.BlinkCanvasRenderingContext2D.instance.shadowBlur_Setter_(unwrap_jso(this), value);
+  set shadowBlur(num value) => _blink.BlinkCanvasRenderingContext2D.instance.shadowBlur_Setter_(unwrap_jso(this), value);
   
   @DomName('CanvasRenderingContext2D.shadowColor')
   @DocsEditable()
@@ -2679,7 +3758,7 @@
   
   @DomName('CanvasRenderingContext2D.shadowColor')
   @DocsEditable()
-  void set shadowColor(String value) => _blink.BlinkCanvasRenderingContext2D.instance.shadowColor_Setter_(unwrap_jso(this), value);
+  set shadowColor(String value) => _blink.BlinkCanvasRenderingContext2D.instance.shadowColor_Setter_(unwrap_jso(this), value);
   
   @DomName('CanvasRenderingContext2D.shadowOffsetX')
   @DocsEditable()
@@ -2687,7 +3766,7 @@
   
   @DomName('CanvasRenderingContext2D.shadowOffsetX')
   @DocsEditable()
-  void set shadowOffsetX(num value) => _blink.BlinkCanvasRenderingContext2D.instance.shadowOffsetX_Setter_(unwrap_jso(this), value);
+  set shadowOffsetX(num value) => _blink.BlinkCanvasRenderingContext2D.instance.shadowOffsetX_Setter_(unwrap_jso(this), value);
   
   @DomName('CanvasRenderingContext2D.shadowOffsetY')
   @DocsEditable()
@@ -2695,15 +3774,15 @@
   
   @DomName('CanvasRenderingContext2D.shadowOffsetY')
   @DocsEditable()
-  void set shadowOffsetY(num value) => _blink.BlinkCanvasRenderingContext2D.instance.shadowOffsetY_Setter_(unwrap_jso(this), value);
+  set shadowOffsetY(num value) => _blink.BlinkCanvasRenderingContext2D.instance.shadowOffsetY_Setter_(unwrap_jso(this), value);
   
   @DomName('CanvasRenderingContext2D.strokeStyle')
   @DocsEditable()
-  Object get strokeStyle => _blink.BlinkCanvasRenderingContext2D.instance.strokeStyle_Getter_(unwrap_jso(this));
+  Object get strokeStyle => wrap_jso(_blink.BlinkCanvasRenderingContext2D.instance.strokeStyle_Getter_(unwrap_jso(this)));
   
   @DomName('CanvasRenderingContext2D.strokeStyle')
   @DocsEditable()
-  void set strokeStyle(Object value) => _blink.BlinkCanvasRenderingContext2D.instance.strokeStyle_Setter_(unwrap_jso(this), unwrap_jso(value));
+  set strokeStyle(Object value) => _blink.BlinkCanvasRenderingContext2D.instance.strokeStyle_Setter_(unwrap_jso(this), unwrap_jso(value));
   
   @DomName('CanvasRenderingContext2D.textAlign')
   @DocsEditable()
@@ -2711,7 +3790,7 @@
   
   @DomName('CanvasRenderingContext2D.textAlign')
   @DocsEditable()
-  void set textAlign(String value) => _blink.BlinkCanvasRenderingContext2D.instance.textAlign_Setter_(unwrap_jso(this), value);
+  set textAlign(String value) => _blink.BlinkCanvasRenderingContext2D.instance.textAlign_Setter_(unwrap_jso(this), value);
   
   @DomName('CanvasRenderingContext2D.textBaseline')
   @DocsEditable()
@@ -2719,11 +3798,11 @@
   
   @DomName('CanvasRenderingContext2D.textBaseline')
   @DocsEditable()
-  void set textBaseline(String value) => _blink.BlinkCanvasRenderingContext2D.instance.textBaseline_Setter_(unwrap_jso(this), value);
+  set textBaseline(String value) => _blink.BlinkCanvasRenderingContext2D.instance.textBaseline_Setter_(unwrap_jso(this), value);
   
   void addHitRegion([Map options]) {
     if (options != null) {
-      _blink.BlinkCanvasRenderingContext2D.instance.addHitRegion_Callback_1_(unwrap_jso(this), options);
+      _blink.BlinkCanvasRenderingContext2D.instance.addHitRegion_Callback_1_(unwrap_jso(this), convertDartToNative_Dictionary(options));
       return;
     }
     _blink.BlinkCanvasRenderingContext2D.instance.addHitRegion_Callback_0_(unwrap_jso(this));
@@ -3312,13 +4391,27 @@
   // To suppress missing implicit constructor warnings.
   factory CharacterData._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static CharacterData internalCreateCharacterData() {
+    return new CharacterData._internalWrap();
+  }
+
+  factory CharacterData._internalWrap() {
+    return new CharacterData.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  CharacterData.internal_() : super.internal_();
+
+
   @DomName('CharacterData.data')
   @DocsEditable()
   String get data => _blink.BlinkCharacterData.instance.data_Getter_(unwrap_jso(this));
   
   @DomName('CharacterData.data')
   @DocsEditable()
-  void set data(String value) => _blink.BlinkCharacterData.instance.data_Setter_(unwrap_jso(this), value);
+  set data(String value) => _blink.BlinkCharacterData.instance.data_Setter_(unwrap_jso(this), value);
   
   @DomName('CharacterData.length')
   @DocsEditable()
@@ -3363,7 +4456,7 @@
 @DocsEditable()
 @DomName('ChildNode')
 @Experimental() // untriaged
-abstract class ChildNode extends NativeFieldWrapperClass2 {
+abstract class ChildNode extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory ChildNode._() { throw new UnsupportedError("Not supported"); }
 
@@ -3400,9 +4493,24 @@
   @DomName('CircularGeofencingRegion.CircularGeofencingRegion')
   @DocsEditable()
   factory CircularGeofencingRegion(Map init) {
-    return _blink.BlinkCircularGeofencingRegion.instance.constructorCallback_1_(init);
+    var init_1 = convertDartToNative_Dictionary(init);
+    return wrap_jso(_blink.BlinkCircularGeofencingRegion.instance.constructorCallback_1_(init_1));
   }
 
+
+  @Deprecated("Internal Use Only")
+  static CircularGeofencingRegion internalCreateCircularGeofencingRegion() {
+    return new CircularGeofencingRegion._internalWrap();
+  }
+
+  factory CircularGeofencingRegion._internalWrap() {
+    return new CircularGeofencingRegion.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  CircularGeofencingRegion.internal_() : super.internal_();
+
+
   @DomName('CircularGeofencingRegion.MAX_RADIUS')
   @DocsEditable()
   @Experimental() // untriaged
@@ -3416,17 +4524,17 @@
   @DomName('CircularGeofencingRegion.latitude')
   @DocsEditable()
   @Experimental() // untriaged
-  double get latitude => _blink.BlinkCircularGeofencingRegion.instance.latitude_Getter_(unwrap_jso(this));
+  num get latitude => _blink.BlinkCircularGeofencingRegion.instance.latitude_Getter_(unwrap_jso(this));
   
   @DomName('CircularGeofencingRegion.longitude')
   @DocsEditable()
   @Experimental() // untriaged
-  double get longitude => _blink.BlinkCircularGeofencingRegion.instance.longitude_Getter_(unwrap_jso(this));
+  num get longitude => _blink.BlinkCircularGeofencingRegion.instance.longitude_Getter_(unwrap_jso(this));
   
   @DomName('CircularGeofencingRegion.radius')
   @DocsEditable()
   @Experimental() // untriaged
-  double get radius => _blink.BlinkCircularGeofencingRegion.instance.radius_Getter_(unwrap_jso(this));
+  num get radius => _blink.BlinkCircularGeofencingRegion.instance.radius_Getter_(unwrap_jso(this));
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -3442,6 +4550,20 @@
   // To suppress missing implicit constructor warnings.
   factory CloseEvent._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static CloseEvent internalCreateCloseEvent() {
+    return new CloseEvent._internalWrap();
+  }
+
+  factory CloseEvent._internalWrap() {
+    return new CloseEvent.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  CloseEvent.internal_() : super.internal_();
+
+
   @DomName('CloseEvent.code')
   @DocsEditable()
   int get code => _blink.BlinkCloseEvent.instance.code_Getter_(unwrap_jso(this));
@@ -3470,10 +4592,24 @@
   @DocsEditable()
   factory Comment([String data]) {
     if (data != null) {
-      return _blink.BlinkComment.instance.constructorCallback_1_(data);
+      return wrap_jso(_blink.BlinkComment.instance.constructorCallback_1_(data));
     }
-    return _blink.BlinkComment.instance.constructorCallback_0_();
+    return wrap_jso(_blink.BlinkComment.instance.constructorCallback_0_());
   }
+
+
+  @Deprecated("Internal Use Only")
+  static Comment internalCreateComment() {
+    return new Comment._internalWrap();
+  }
+
+  factory Comment._internalWrap() {
+    return new Comment.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  Comment.internal_() : super.internal_();
+
 }
 // Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -3500,6 +4636,20 @@
   // To suppress missing implicit constructor warnings.
   factory CompositionEvent._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static CompositionEvent internalCreateCompositionEvent() {
+    return new CompositionEvent._internalWrap();
+  }
+
+  factory CompositionEvent._internalWrap() {
+    return new CompositionEvent.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  CompositionEvent.internal_() : super.internal_();
+
+
   @DomName('CompositionEvent.activeSegmentEnd')
   @DocsEditable()
   @Experimental() // untriaged
@@ -3537,6 +4687,20 @@
   // To suppress missing implicit constructor warnings.
   factory Console._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static Console internalCreateConsole() {
+    return new Console._internalWrap();
+  }
+
+  factory Console._internalWrap() {
+    return new Console.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  Console.internal_() : super.internal_();
+
+
   @DomName('Console.memory')
   @DocsEditable()
   @Experimental()
@@ -3553,10 +4717,25 @@
 @DocsEditable()
 @DomName('ConsoleBase')
 @Experimental() // untriaged
-class ConsoleBase extends NativeFieldWrapperClass2 {
+class ConsoleBase extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory ConsoleBase._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static ConsoleBase internalCreateConsoleBase() {
+    return new ConsoleBase._internalWrap();
+  }
+
+  factory ConsoleBase._internalWrap() {
+    return new ConsoleBase.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  ConsoleBase.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('ConsoleBase.assertCondition')
   @DocsEditable()
   @Experimental() // untriaged
@@ -3692,6 +4871,20 @@
   @DomName('HTMLContentElement.HTMLContentElement')
   @DocsEditable()
   factory ContentElement() => document.createElement("content");
+
+
+  @Deprecated("Internal Use Only")
+  static ContentElement internalCreateContentElement() {
+    return new ContentElement._internalWrap();
+  }
+
+  factory ContentElement._internalWrap() {
+    return new ContentElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  ContentElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -3708,11 +4901,11 @@
   
   @DomName('HTMLContentElement.select')
   @DocsEditable()
-  void set select(String value) => _blink.BlinkHTMLContentElement.instance.select_Setter_(unwrap_jso(this), value);
+  set select(String value) => _blink.BlinkHTMLContentElement.instance.select_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLContentElement.getDistributedNodes')
   @DocsEditable()
-  List<Node> getDistributedNodes() => wrap_jso_list(_blink.BlinkHTMLContentElement.instance.getDistributedNodes_Callback_0_(unwrap_jso(this)));
+  List<Node> getDistributedNodes() => wrap_jso(_blink.BlinkHTMLContentElement.instance.getDistributedNodes_Callback_0_(unwrap_jso(this)));
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -3724,37 +4917,52 @@
 
 @DocsEditable()
 @DomName('Coordinates')
-class Coordinates extends NativeFieldWrapperClass2 {
+class Coordinates extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory Coordinates._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static Coordinates internalCreateCoordinates() {
+    return new Coordinates._internalWrap();
+  }
+
+  factory Coordinates._internalWrap() {
+    return new Coordinates.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  Coordinates.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('Coordinates.accuracy')
   @DocsEditable()
-  double get accuracy => _blink.BlinkCoordinates.instance.accuracy_Getter_(unwrap_jso(this));
+  num get accuracy => _blink.BlinkCoordinates.instance.accuracy_Getter_(unwrap_jso(this));
   
   @DomName('Coordinates.altitude')
   @DocsEditable()
-  double get altitude => _blink.BlinkCoordinates.instance.altitude_Getter_(unwrap_jso(this));
+  num get altitude => _blink.BlinkCoordinates.instance.altitude_Getter_(unwrap_jso(this));
   
   @DomName('Coordinates.altitudeAccuracy')
   @DocsEditable()
-  double get altitudeAccuracy => _blink.BlinkCoordinates.instance.altitudeAccuracy_Getter_(unwrap_jso(this));
+  num get altitudeAccuracy => _blink.BlinkCoordinates.instance.altitudeAccuracy_Getter_(unwrap_jso(this));
   
   @DomName('Coordinates.heading')
   @DocsEditable()
-  double get heading => _blink.BlinkCoordinates.instance.heading_Getter_(unwrap_jso(this));
+  num get heading => _blink.BlinkCoordinates.instance.heading_Getter_(unwrap_jso(this));
   
   @DomName('Coordinates.latitude')
   @DocsEditable()
-  double get latitude => _blink.BlinkCoordinates.instance.latitude_Getter_(unwrap_jso(this));
+  num get latitude => _blink.BlinkCoordinates.instance.latitude_Getter_(unwrap_jso(this));
   
   @DomName('Coordinates.longitude')
   @DocsEditable()
-  double get longitude => _blink.BlinkCoordinates.instance.longitude_Getter_(unwrap_jso(this));
+  num get longitude => _blink.BlinkCoordinates.instance.longitude_Getter_(unwrap_jso(this));
   
   @DomName('Coordinates.speed')
   @DocsEditable()
-  double get speed => _blink.BlinkCoordinates.instance.speed_Getter_(unwrap_jso(this));
+  num get speed => _blink.BlinkCoordinates.instance.speed_Getter_(unwrap_jso(this));
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -3767,10 +4975,25 @@
 @DocsEditable()
 @DomName('Credential')
 @Experimental() // untriaged
-class Credential extends NativeFieldWrapperClass2 {
+class Credential extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory Credential._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static Credential internalCreateCredential() {
+    return new Credential._internalWrap();
+  }
+
+  factory Credential._internalWrap() {
+    return new Credential.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  Credential.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('Credential.avatarURL')
   @DocsEditable()
   @Experimental() // untriaged
@@ -3797,50 +5020,90 @@
 @DocsEditable()
 @DomName('CredentialsContainer')
 @Experimental() // untriaged
-class CredentialsContainer extends NativeFieldWrapperClass2 {
+class CredentialsContainer extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory CredentialsContainer._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static CredentialsContainer internalCreateCredentialsContainer() {
+    return new CredentialsContainer._internalWrap();
+  }
+
+  factory CredentialsContainer._internalWrap() {
+    return new CredentialsContainer.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  CredentialsContainer.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('CredentialsContainer.notifyFailedSignIn')
   @DocsEditable()
   @Experimental() // untriaged
-  Future notifyFailedSignIn(Credential credential) => _blink.BlinkCredentialsContainer.instance.notifyFailedSignIn_Callback_1_(unwrap_jso(this), unwrap_jso(credential));
+  Future notifyFailedSignIn(Credential credential) => wrap_jso(_blink.BlinkCredentialsContainer.instance.notifyFailedSignIn_Callback_1_(unwrap_jso(this), unwrap_jso(credential)));
   
   @DomName('CredentialsContainer.notifySignedIn')
   @DocsEditable()
   @Experimental() // untriaged
-  Future notifySignedIn(Credential credential) => _blink.BlinkCredentialsContainer.instance.notifySignedIn_Callback_1_(unwrap_jso(this), unwrap_jso(credential));
+  Future notifySignedIn(Credential credential) => wrap_jso(_blink.BlinkCredentialsContainer.instance.notifySignedIn_Callback_1_(unwrap_jso(this), unwrap_jso(credential)));
   
   @DomName('CredentialsContainer.notifySignedOut')
   @DocsEditable()
   @Experimental() // untriaged
-  Future notifySignedOut() => _blink.BlinkCredentialsContainer.instance.notifySignedOut_Callback_0_(unwrap_jso(this));
+  Future notifySignedOut() => wrap_jso(_blink.BlinkCredentialsContainer.instance.notifySignedOut_Callback_0_(unwrap_jso(this)));
   
   Future request([Map options]) {
     if (options != null) {
-      return _blink.BlinkCredentialsContainer.instance.request_Callback_1_(unwrap_jso(this), options);
+      return wrap_jso(_blink.BlinkCredentialsContainer.instance.request_Callback_1_(unwrap_jso(this), convertDartToNative_Dictionary(options)));
     }
-    return _blink.BlinkCredentialsContainer.instance.request_Callback_0_(unwrap_jso(this));
+    return wrap_jso(_blink.BlinkCredentialsContainer.instance.request_Callback_0_(unwrap_jso(this)));
   }
 
 }
-// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
+// 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.
 
-// WARNING: Do not edit - generated code.
 
-
-@DocsEditable()
 @DomName('Crypto')
 @SupportedBrowser(SupportedBrowser.CHROME)
 @SupportedBrowser(SupportedBrowser.SAFARI)
 @Experimental()
 // http://www.w3.org/TR/WebCryptoAPI/
-class Crypto extends NativeFieldWrapperClass2 {
+class Crypto extends DartHtmlDomObject {
+
+  TypedData getRandomValues(TypedData array) {
+    var random = _getRandomValues(array);
+    // The semantics of the operation are that it modifies the argument, but we
+    // have no way of making a Dart typed data created initially in Dart reference
+    // externalized storage. So we copy the values back from the returned copy.
+    // TODO(alanknight): Make this less ridiculously slow.
+    for (var i = 0; i < random.length; i++) {
+      array[i] = random[i];
+    }
+    return array;
+  }
+
   // To suppress missing implicit constructor warnings.
   factory Crypto._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static Crypto internalCreateCrypto() {
+    return new Crypto._internalWrap();
+  }
+
+  factory Crypto._internalWrap() {
+    return new Crypto.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  Crypto.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   /// Checks if this type is supported on the current platform.
   static bool get supported => true;
 
@@ -3851,7 +5114,7 @@
   
   @DomName('Crypto.getRandomValues')
   @DocsEditable()
-  TypedData getRandomValues(TypedData array) => _blink.BlinkCrypto.instance.getRandomValues_Callback_1_(unwrap_jso(this), unwrap_jso(array));
+  TypedData _getRandomValues(TypedData array) => wrap_jso(_blink.BlinkCrypto.instance.getRandomValues_Callback_1_(unwrap_jso(this), unwrap_jso(array)));
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -3864,14 +5127,29 @@
 @DocsEditable()
 @DomName('CryptoKey')
 @Experimental() // untriaged
-class CryptoKey extends NativeFieldWrapperClass2 {
+class CryptoKey extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory CryptoKey._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static CryptoKey internalCreateCryptoKey() {
+    return new CryptoKey._internalWrap();
+  }
+
+  factory CryptoKey._internalWrap() {
+    return new CryptoKey.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  CryptoKey.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('CryptoKey.algorithm')
   @DocsEditable()
   @Experimental() // untriaged
-  Object get algorithm => _blink.BlinkCryptoKey.instance.algorithm_Getter_(unwrap_jso(this));
+  Object get algorithm => wrap_jso(_blink.BlinkCryptoKey.instance.algorithm_Getter_(unwrap_jso(this)));
   
   @DomName('CryptoKey.extractable')
   @DocsEditable()
@@ -3900,10 +5178,25 @@
 @DomName('CSS')
 // http://www.w3.org/TR/css3-conditional/#the-css-interface
 @Experimental() // None
-class Css extends NativeFieldWrapperClass2 {
+class Css extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory Css._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static Css internalCreateCss() {
+    return new Css._internalWrap();
+  }
+
+  factory Css._internalWrap() {
+    return new Css.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  Css.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('CSS.supports')
   @DocsEditable()
   bool supports(String property, String value) => _blink.BlinkCSS.instance.supports_Callback_2_(unwrap_jso(this), property, value);
@@ -3928,13 +5221,27 @@
   // To suppress missing implicit constructor warnings.
   factory CssCharsetRule._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static CssCharsetRule internalCreateCssCharsetRule() {
+    return new CssCharsetRule._internalWrap();
+  }
+
+  factory CssCharsetRule._internalWrap() {
+    return new CssCharsetRule.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  CssCharsetRule.internal_() : super.internal_();
+
+
   @DomName('CSSCharsetRule.encoding')
   @DocsEditable()
   String get encoding => _blink.BlinkCSSCharsetRule.instance.encoding_Getter_(unwrap_jso(this));
   
   @DomName('CSSCharsetRule.encoding')
   @DocsEditable()
-  void set encoding(String value) => _blink.BlinkCSSCharsetRule.instance.encoding_Setter_(unwrap_jso(this), value);
+  set encoding(String value) => _blink.BlinkCSSCharsetRule.instance.encoding_Setter_(unwrap_jso(this), value);
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -3954,6 +5261,20 @@
   // To suppress missing implicit constructor warnings.
   factory CssFilterRule._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static CssFilterRule internalCreateCssFilterRule() {
+    return new CssFilterRule._internalWrap();
+  }
+
+  factory CssFilterRule._internalWrap() {
+    return new CssFilterRule.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  CssFilterRule.internal_() : super.internal_();
+
+
   @DomName('WebKitCSSFilterRule.style')
   @DocsEditable()
   CssStyleDeclaration get style => wrap_jso(_blink.BlinkWebKitCSSFilterRule.instance.style_Getter_(unwrap_jso(this)));
@@ -3972,6 +5293,20 @@
   // To suppress missing implicit constructor warnings.
   factory CssFontFaceRule._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static CssFontFaceRule internalCreateCssFontFaceRule() {
+    return new CssFontFaceRule._internalWrap();
+  }
+
+  factory CssFontFaceRule._internalWrap() {
+    return new CssFontFaceRule.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  CssFontFaceRule.internal_() : super.internal_();
+
+
   @DomName('CSSFontFaceRule.style')
   @DocsEditable()
   CssStyleDeclaration get style => wrap_jso(_blink.BlinkCSSFontFaceRule.instance.style_Getter_(unwrap_jso(this)));
@@ -3990,6 +5325,20 @@
   // To suppress missing implicit constructor warnings.
   factory CssImportRule._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static CssImportRule internalCreateCssImportRule() {
+    return new CssImportRule._internalWrap();
+  }
+
+  factory CssImportRule._internalWrap() {
+    return new CssImportRule.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  CssImportRule.internal_() : super.internal_();
+
+
   @DomName('CSSImportRule.href')
   @DocsEditable()
   String get href => _blink.BlinkCSSImportRule.instance.href_Getter_(unwrap_jso(this));
@@ -4017,6 +5366,20 @@
   // To suppress missing implicit constructor warnings.
   factory CssKeyframeRule._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static CssKeyframeRule internalCreateCssKeyframeRule() {
+    return new CssKeyframeRule._internalWrap();
+  }
+
+  factory CssKeyframeRule._internalWrap() {
+    return new CssKeyframeRule.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  CssKeyframeRule.internal_() : super.internal_();
+
+
   @DomName('CSSKeyframeRule.keyText')
   @DocsEditable()
   @Experimental() // untriaged
@@ -4025,7 +5388,7 @@
   @DomName('CSSKeyframeRule.keyText')
   @DocsEditable()
   @Experimental() // untriaged
-  void set keyText(String value) => _blink.BlinkCSSKeyframeRule.instance.keyText_Setter_(unwrap_jso(this), value);
+  set keyText(String value) => _blink.BlinkCSSKeyframeRule.instance.keyText_Setter_(unwrap_jso(this), value);
   
   @DomName('CSSKeyframeRule.style')
   @DocsEditable()
@@ -4047,10 +5410,24 @@
   // To suppress missing implicit constructor warnings.
   factory CssKeyframesRule._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static CssKeyframesRule internalCreateCssKeyframesRule() {
+    return new CssKeyframesRule._internalWrap();
+  }
+
+  factory CssKeyframesRule._internalWrap() {
+    return new CssKeyframesRule.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  CssKeyframesRule.internal_() : super.internal_();
+
+
   @DomName('CSSKeyframesRule.cssRules')
   @DocsEditable()
   @Experimental() // untriaged
-  List<CssRule> get cssRules => wrap_jso_list(_blink.BlinkCSSKeyframesRule.instance.cssRules_Getter_(unwrap_jso(this)));
+  List<CssRule> get cssRules => wrap_jso(_blink.BlinkCSSKeyframesRule.instance.cssRules_Getter_(unwrap_jso(this)));
   
   @DomName('CSSKeyframesRule.name')
   @DocsEditable()
@@ -4060,12 +5437,12 @@
   @DomName('CSSKeyframesRule.name')
   @DocsEditable()
   @Experimental() // untriaged
-  void set name(String value) => _blink.BlinkCSSKeyframesRule.instance.name_Setter_(unwrap_jso(this), value);
+  set name(String value) => _blink.BlinkCSSKeyframesRule.instance.name_Setter_(unwrap_jso(this), value);
   
   @DomName('CSSKeyframesRule.__getter__')
   @DocsEditable()
   @Experimental() // untriaged
-  CssKeyframeRule __getter__(int index) => _blink.BlinkCSSKeyframesRule.instance.$__getter___Callback_1_(unwrap_jso(this), index);
+  CssKeyframeRule __getter__(int index) => wrap_jso(_blink.BlinkCSSKeyframesRule.instance.$__getter___Callback_1_(unwrap_jso(this), index));
   
   @DomName('CSSKeyframesRule.deleteRule')
   @DocsEditable()
@@ -4075,7 +5452,7 @@
   @DomName('CSSKeyframesRule.findRule')
   @DocsEditable()
   @Experimental() // untriaged
-  CssKeyframeRule findRule(String key) => _blink.BlinkCSSKeyframesRule.instance.findRule_Callback_1_(unwrap_jso(this), key);
+  CssKeyframeRule findRule(String key) => wrap_jso(_blink.BlinkCSSKeyframesRule.instance.findRule_Callback_1_(unwrap_jso(this), key));
   
   @DomName('CSSKeyframesRule.insertRule')
   @DocsEditable()
@@ -4096,9 +5473,23 @@
   // To suppress missing implicit constructor warnings.
   factory CssMediaRule._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static CssMediaRule internalCreateCssMediaRule() {
+    return new CssMediaRule._internalWrap();
+  }
+
+  factory CssMediaRule._internalWrap() {
+    return new CssMediaRule.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  CssMediaRule.internal_() : super.internal_();
+
+
   @DomName('CSSMediaRule.cssRules')
   @DocsEditable()
-  List<CssRule> get cssRules => wrap_jso_list(_blink.BlinkCSSMediaRule.instance.cssRules_Getter_(unwrap_jso(this)));
+  List<CssRule> get cssRules => wrap_jso(_blink.BlinkCSSMediaRule.instance.cssRules_Getter_(unwrap_jso(this)));
   
   @DomName('CSSMediaRule.media')
   @DocsEditable()
@@ -4126,13 +5517,27 @@
   // To suppress missing implicit constructor warnings.
   factory CssPageRule._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static CssPageRule internalCreateCssPageRule() {
+    return new CssPageRule._internalWrap();
+  }
+
+  factory CssPageRule._internalWrap() {
+    return new CssPageRule.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  CssPageRule.internal_() : super.internal_();
+
+
   @DomName('CSSPageRule.selectorText')
   @DocsEditable()
   String get selectorText => _blink.BlinkCSSPageRule.instance.selectorText_Getter_(unwrap_jso(this));
   
   @DomName('CSSPageRule.selectorText')
   @DocsEditable()
-  void set selectorText(String value) => _blink.BlinkCSSPageRule.instance.selectorText_Setter_(unwrap_jso(this), value);
+  set selectorText(String value) => _blink.BlinkCSSPageRule.instance.selectorText_Setter_(unwrap_jso(this), value);
   
   @DomName('CSSPageRule.style')
   @DocsEditable()
@@ -4148,10 +5553,25 @@
 
 @DocsEditable()
 @DomName('CSSRule')
-class CssRule extends NativeFieldWrapperClass2 {
+class CssRule extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory CssRule._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static CssRule internalCreateCssRule() {
+    return new CssRule._internalWrap();
+  }
+
+  factory CssRule._internalWrap() {
+    return new CssRule.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  CssRule.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('CSSRule.CHARSET_RULE')
   @DocsEditable()
   static const int CHARSET_RULE = 2;
@@ -4219,7 +5639,7 @@
   
   @DomName('CSSRule.cssText')
   @DocsEditable()
-  void set cssText(String value) => _blink.BlinkCSSRule.instance.cssText_Setter_(unwrap_jso(this), value);
+  set cssText(String value) => _blink.BlinkCSSRule.instance.cssText_Setter_(unwrap_jso(this), value);
   
   @DomName('CSSRule.parentRule')
   @DocsEditable()
@@ -4247,7 +5667,7 @@
 
 
 @DomName('CSSStyleDeclaration')
-class CssStyleDeclaration  extends NativeFieldWrapperClass2 with
+class CssStyleDeclaration  extends DartHtmlDomObject with
     CssStyleDeclarationBase  {
   factory CssStyleDeclaration() => new CssStyleDeclaration.css('');
 
@@ -4293,7 +5713,7 @@
   }
 
   bool _hasProperty(String propertyName) =>
-      _blink.BlinkCSSStyleDeclaration.$__propertyQuery___Callback_1(this, propertyName);
+      _blink.BlinkCSSStyleDeclaration.instance.$__propertyQuery___Callback_1_(unwrap_jso(this), propertyName) != null;
 
   @DomName('CSSStyleDeclaration.setProperty')
   void setProperty(String propertyName, String value, [String priority]) {
@@ -4337,13 +5757,28 @@
   // To suppress missing implicit constructor warnings.
   factory CssStyleDeclaration._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static CssStyleDeclaration internalCreateCssStyleDeclaration() {
+    return new CssStyleDeclaration._internalWrap();
+  }
+
+  factory CssStyleDeclaration._internalWrap() {
+    return new CssStyleDeclaration.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  CssStyleDeclaration.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('CSSStyleDeclaration.cssText')
   @DocsEditable()
   String get cssText => _blink.BlinkCSSStyleDeclaration.instance.cssText_Getter_(unwrap_jso(this));
   
   @DomName('CSSStyleDeclaration.cssText')
   @DocsEditable()
-  void set cssText(String value) => _blink.BlinkCSSStyleDeclaration.instance.cssText_Setter_(unwrap_jso(this), value);
+  set cssText(String value) => _blink.BlinkCSSStyleDeclaration.instance.cssText_Setter_(unwrap_jso(this), value);
   
   @DomName('CSSStyleDeclaration.length')
   @DocsEditable()
@@ -4416,16 +5851,18 @@
   // items in the MEMBERS set if you want that functionality.
 }
 
-abstract class CssStyleDeclarationBase {
-  String getPropertyValue(String propertyName);
-  void setProperty(String propertyName, String value, [String priority]);
+class CssStyleDeclarationBase {
+  String getPropertyValue(String propertyName) =>
+    throw new StateError('getProperty not overridden in dart:html');
+  void setProperty(String propertyName, String value, [String priority]) =>
+    throw new StateError('setProperty not overridden in dart:html');
 
   /** Gets the value of "align-content" */
   String get alignContent =>
     getPropertyValue('align-content');
 
   /** Sets the value of "align-content" */
-  void set alignContent(String value) {
+  set alignContent(String value) {
     setProperty('align-content', value, '');
   }
 
@@ -4434,7 +5871,7 @@
     getPropertyValue('align-items');
 
   /** Sets the value of "align-items" */
-  void set alignItems(String value) {
+  set alignItems(String value) {
     setProperty('align-items', value, '');
   }
 
@@ -4443,7 +5880,7 @@
     getPropertyValue('align-self');
 
   /** Sets the value of "align-self" */
-  void set alignSelf(String value) {
+  set alignSelf(String value) {
     setProperty('align-self', value, '');
   }
 
@@ -4452,7 +5889,7 @@
     getPropertyValue('animation');
 
   /** Sets the value of "animation" */
-  void set animation(String value) {
+  set animation(String value) {
     setProperty('animation', value, '');
   }
 
@@ -4461,7 +5898,7 @@
     getPropertyValue('animation-delay');
 
   /** Sets the value of "animation-delay" */
-  void set animationDelay(String value) {
+  set animationDelay(String value) {
     setProperty('animation-delay', value, '');
   }
 
@@ -4470,7 +5907,7 @@
     getPropertyValue('animation-direction');
 
   /** Sets the value of "animation-direction" */
-  void set animationDirection(String value) {
+  set animationDirection(String value) {
     setProperty('animation-direction', value, '');
   }
 
@@ -4479,7 +5916,7 @@
     getPropertyValue('animation-duration');
 
   /** Sets the value of "animation-duration" */
-  void set animationDuration(String value) {
+  set animationDuration(String value) {
     setProperty('animation-duration', value, '');
   }
 
@@ -4488,7 +5925,7 @@
     getPropertyValue('animation-fill-mode');
 
   /** Sets the value of "animation-fill-mode" */
-  void set animationFillMode(String value) {
+  set animationFillMode(String value) {
     setProperty('animation-fill-mode', value, '');
   }
 
@@ -4497,7 +5934,7 @@
     getPropertyValue('animation-iteration-count');
 
   /** Sets the value of "animation-iteration-count" */
-  void set animationIterationCount(String value) {
+  set animationIterationCount(String value) {
     setProperty('animation-iteration-count', value, '');
   }
 
@@ -4506,7 +5943,7 @@
     getPropertyValue('animation-name');
 
   /** Sets the value of "animation-name" */
-  void set animationName(String value) {
+  set animationName(String value) {
     setProperty('animation-name', value, '');
   }
 
@@ -4515,7 +5952,7 @@
     getPropertyValue('animation-play-state');
 
   /** Sets the value of "animation-play-state" */
-  void set animationPlayState(String value) {
+  set animationPlayState(String value) {
     setProperty('animation-play-state', value, '');
   }
 
@@ -4524,7 +5961,7 @@
     getPropertyValue('animation-timing-function');
 
   /** Sets the value of "animation-timing-function" */
-  void set animationTimingFunction(String value) {
+  set animationTimingFunction(String value) {
     setProperty('animation-timing-function', value, '');
   }
 
@@ -4533,7 +5970,7 @@
     getPropertyValue('app-region');
 
   /** Sets the value of "app-region" */
-  void set appRegion(String value) {
+  set appRegion(String value) {
     setProperty('app-region', value, '');
   }
 
@@ -4542,7 +5979,7 @@
     getPropertyValue('appearance');
 
   /** Sets the value of "appearance" */
-  void set appearance(String value) {
+  set appearance(String value) {
     setProperty('appearance', value, '');
   }
 
@@ -4551,7 +5988,7 @@
     getPropertyValue('aspect-ratio');
 
   /** Sets the value of "aspect-ratio" */
-  void set aspectRatio(String value) {
+  set aspectRatio(String value) {
     setProperty('aspect-ratio', value, '');
   }
 
@@ -4560,7 +5997,7 @@
     getPropertyValue('backface-visibility');
 
   /** Sets the value of "backface-visibility" */
-  void set backfaceVisibility(String value) {
+  set backfaceVisibility(String value) {
     setProperty('backface-visibility', value, '');
   }
 
@@ -4569,7 +6006,7 @@
     getPropertyValue('background');
 
   /** Sets the value of "background" */
-  void set background(String value) {
+  set background(String value) {
     setProperty('background', value, '');
   }
 
@@ -4578,7 +6015,7 @@
     getPropertyValue('background-attachment');
 
   /** Sets the value of "background-attachment" */
-  void set backgroundAttachment(String value) {
+  set backgroundAttachment(String value) {
     setProperty('background-attachment', value, '');
   }
 
@@ -4587,7 +6024,7 @@
     getPropertyValue('background-blend-mode');
 
   /** Sets the value of "background-blend-mode" */
-  void set backgroundBlendMode(String value) {
+  set backgroundBlendMode(String value) {
     setProperty('background-blend-mode', value, '');
   }
 
@@ -4596,7 +6033,7 @@
     getPropertyValue('background-clip');
 
   /** Sets the value of "background-clip" */
-  void set backgroundClip(String value) {
+  set backgroundClip(String value) {
     setProperty('background-clip', value, '');
   }
 
@@ -4605,7 +6042,7 @@
     getPropertyValue('background-color');
 
   /** Sets the value of "background-color" */
-  void set backgroundColor(String value) {
+  set backgroundColor(String value) {
     setProperty('background-color', value, '');
   }
 
@@ -4614,7 +6051,7 @@
     getPropertyValue('background-composite');
 
   /** Sets the value of "background-composite" */
-  void set backgroundComposite(String value) {
+  set backgroundComposite(String value) {
     setProperty('background-composite', value, '');
   }
 
@@ -4623,7 +6060,7 @@
     getPropertyValue('background-image');
 
   /** Sets the value of "background-image" */
-  void set backgroundImage(String value) {
+  set backgroundImage(String value) {
     setProperty('background-image', value, '');
   }
 
@@ -4632,7 +6069,7 @@
     getPropertyValue('background-origin');
 
   /** Sets the value of "background-origin" */
-  void set backgroundOrigin(String value) {
+  set backgroundOrigin(String value) {
     setProperty('background-origin', value, '');
   }
 
@@ -4641,7 +6078,7 @@
     getPropertyValue('background-position');
 
   /** Sets the value of "background-position" */
-  void set backgroundPosition(String value) {
+  set backgroundPosition(String value) {
     setProperty('background-position', value, '');
   }
 
@@ -4650,7 +6087,7 @@
     getPropertyValue('background-position-x');
 
   /** Sets the value of "background-position-x" */
-  void set backgroundPositionX(String value) {
+  set backgroundPositionX(String value) {
     setProperty('background-position-x', value, '');
   }
 
@@ -4659,7 +6096,7 @@
     getPropertyValue('background-position-y');
 
   /** Sets the value of "background-position-y" */
-  void set backgroundPositionY(String value) {
+  set backgroundPositionY(String value) {
     setProperty('background-position-y', value, '');
   }
 
@@ -4668,7 +6105,7 @@
     getPropertyValue('background-repeat');
 
   /** Sets the value of "background-repeat" */
-  void set backgroundRepeat(String value) {
+  set backgroundRepeat(String value) {
     setProperty('background-repeat', value, '');
   }
 
@@ -4677,7 +6114,7 @@
     getPropertyValue('background-repeat-x');
 
   /** Sets the value of "background-repeat-x" */
-  void set backgroundRepeatX(String value) {
+  set backgroundRepeatX(String value) {
     setProperty('background-repeat-x', value, '');
   }
 
@@ -4686,7 +6123,7 @@
     getPropertyValue('background-repeat-y');
 
   /** Sets the value of "background-repeat-y" */
-  void set backgroundRepeatY(String value) {
+  set backgroundRepeatY(String value) {
     setProperty('background-repeat-y', value, '');
   }
 
@@ -4695,7 +6132,7 @@
     getPropertyValue('background-size');
 
   /** Sets the value of "background-size" */
-  void set backgroundSize(String value) {
+  set backgroundSize(String value) {
     setProperty('background-size', value, '');
   }
 
@@ -4704,7 +6141,7 @@
     getPropertyValue('border');
 
   /** Sets the value of "border" */
-  void set border(String value) {
+  set border(String value) {
     setProperty('border', value, '');
   }
 
@@ -4713,7 +6150,7 @@
     getPropertyValue('border-after');
 
   /** Sets the value of "border-after" */
-  void set borderAfter(String value) {
+  set borderAfter(String value) {
     setProperty('border-after', value, '');
   }
 
@@ -4722,7 +6159,7 @@
     getPropertyValue('border-after-color');
 
   /** Sets the value of "border-after-color" */
-  void set borderAfterColor(String value) {
+  set borderAfterColor(String value) {
     setProperty('border-after-color', value, '');
   }
 
@@ -4731,7 +6168,7 @@
     getPropertyValue('border-after-style');
 
   /** Sets the value of "border-after-style" */
-  void set borderAfterStyle(String value) {
+  set borderAfterStyle(String value) {
     setProperty('border-after-style', value, '');
   }
 
@@ -4740,7 +6177,7 @@
     getPropertyValue('border-after-width');
 
   /** Sets the value of "border-after-width" */
-  void set borderAfterWidth(String value) {
+  set borderAfterWidth(String value) {
     setProperty('border-after-width', value, '');
   }
 
@@ -4749,7 +6186,7 @@
     getPropertyValue('border-before');
 
   /** Sets the value of "border-before" */
-  void set borderBefore(String value) {
+  set borderBefore(String value) {
     setProperty('border-before', value, '');
   }
 
@@ -4758,7 +6195,7 @@
     getPropertyValue('border-before-color');
 
   /** Sets the value of "border-before-color" */
-  void set borderBeforeColor(String value) {
+  set borderBeforeColor(String value) {
     setProperty('border-before-color', value, '');
   }
 
@@ -4767,7 +6204,7 @@
     getPropertyValue('border-before-style');
 
   /** Sets the value of "border-before-style" */
-  void set borderBeforeStyle(String value) {
+  set borderBeforeStyle(String value) {
     setProperty('border-before-style', value, '');
   }
 
@@ -4776,7 +6213,7 @@
     getPropertyValue('border-before-width');
 
   /** Sets the value of "border-before-width" */
-  void set borderBeforeWidth(String value) {
+  set borderBeforeWidth(String value) {
     setProperty('border-before-width', value, '');
   }
 
@@ -4785,7 +6222,7 @@
     getPropertyValue('border-bottom');
 
   /** Sets the value of "border-bottom" */
-  void set borderBottom(String value) {
+  set borderBottom(String value) {
     setProperty('border-bottom', value, '');
   }
 
@@ -4794,7 +6231,7 @@
     getPropertyValue('border-bottom-color');
 
   /** Sets the value of "border-bottom-color" */
-  void set borderBottomColor(String value) {
+  set borderBottomColor(String value) {
     setProperty('border-bottom-color', value, '');
   }
 
@@ -4803,7 +6240,7 @@
     getPropertyValue('border-bottom-left-radius');
 
   /** Sets the value of "border-bottom-left-radius" */
-  void set borderBottomLeftRadius(String value) {
+  set borderBottomLeftRadius(String value) {
     setProperty('border-bottom-left-radius', value, '');
   }
 
@@ -4812,7 +6249,7 @@
     getPropertyValue('border-bottom-right-radius');
 
   /** Sets the value of "border-bottom-right-radius" */
-  void set borderBottomRightRadius(String value) {
+  set borderBottomRightRadius(String value) {
     setProperty('border-bottom-right-radius', value, '');
   }
 
@@ -4821,7 +6258,7 @@
     getPropertyValue('border-bottom-style');
 
   /** Sets the value of "border-bottom-style" */
-  void set borderBottomStyle(String value) {
+  set borderBottomStyle(String value) {
     setProperty('border-bottom-style', value, '');
   }
 
@@ -4830,7 +6267,7 @@
     getPropertyValue('border-bottom-width');
 
   /** Sets the value of "border-bottom-width" */
-  void set borderBottomWidth(String value) {
+  set borderBottomWidth(String value) {
     setProperty('border-bottom-width', value, '');
   }
 
@@ -4839,7 +6276,7 @@
     getPropertyValue('border-collapse');
 
   /** Sets the value of "border-collapse" */
-  void set borderCollapse(String value) {
+  set borderCollapse(String value) {
     setProperty('border-collapse', value, '');
   }
 
@@ -4848,7 +6285,7 @@
     getPropertyValue('border-color');
 
   /** Sets the value of "border-color" */
-  void set borderColor(String value) {
+  set borderColor(String value) {
     setProperty('border-color', value, '');
   }
 
@@ -4857,7 +6294,7 @@
     getPropertyValue('border-end');
 
   /** Sets the value of "border-end" */
-  void set borderEnd(String value) {
+  set borderEnd(String value) {
     setProperty('border-end', value, '');
   }
 
@@ -4866,7 +6303,7 @@
     getPropertyValue('border-end-color');
 
   /** Sets the value of "border-end-color" */
-  void set borderEndColor(String value) {
+  set borderEndColor(String value) {
     setProperty('border-end-color', value, '');
   }
 
@@ -4875,7 +6312,7 @@
     getPropertyValue('border-end-style');
 
   /** Sets the value of "border-end-style" */
-  void set borderEndStyle(String value) {
+  set borderEndStyle(String value) {
     setProperty('border-end-style', value, '');
   }
 
@@ -4884,7 +6321,7 @@
     getPropertyValue('border-end-width');
 
   /** Sets the value of "border-end-width" */
-  void set borderEndWidth(String value) {
+  set borderEndWidth(String value) {
     setProperty('border-end-width', value, '');
   }
 
@@ -4893,7 +6330,7 @@
     getPropertyValue('border-fit');
 
   /** Sets the value of "border-fit" */
-  void set borderFit(String value) {
+  set borderFit(String value) {
     setProperty('border-fit', value, '');
   }
 
@@ -4902,7 +6339,7 @@
     getPropertyValue('border-horizontal-spacing');
 
   /** Sets the value of "border-horizontal-spacing" */
-  void set borderHorizontalSpacing(String value) {
+  set borderHorizontalSpacing(String value) {
     setProperty('border-horizontal-spacing', value, '');
   }
 
@@ -4911,7 +6348,7 @@
     getPropertyValue('border-image');
 
   /** Sets the value of "border-image" */
-  void set borderImage(String value) {
+  set borderImage(String value) {
     setProperty('border-image', value, '');
   }
 
@@ -4920,7 +6357,7 @@
     getPropertyValue('border-image-outset');
 
   /** Sets the value of "border-image-outset" */
-  void set borderImageOutset(String value) {
+  set borderImageOutset(String value) {
     setProperty('border-image-outset', value, '');
   }
 
@@ -4929,7 +6366,7 @@
     getPropertyValue('border-image-repeat');
 
   /** Sets the value of "border-image-repeat" */
-  void set borderImageRepeat(String value) {
+  set borderImageRepeat(String value) {
     setProperty('border-image-repeat', value, '');
   }
 
@@ -4938,7 +6375,7 @@
     getPropertyValue('border-image-slice');
 
   /** Sets the value of "border-image-slice" */
-  void set borderImageSlice(String value) {
+  set borderImageSlice(String value) {
     setProperty('border-image-slice', value, '');
   }
 
@@ -4947,7 +6384,7 @@
     getPropertyValue('border-image-source');
 
   /** Sets the value of "border-image-source" */
-  void set borderImageSource(String value) {
+  set borderImageSource(String value) {
     setProperty('border-image-source', value, '');
   }
 
@@ -4956,7 +6393,7 @@
     getPropertyValue('border-image-width');
 
   /** Sets the value of "border-image-width" */
-  void set borderImageWidth(String value) {
+  set borderImageWidth(String value) {
     setProperty('border-image-width', value, '');
   }
 
@@ -4965,7 +6402,7 @@
     getPropertyValue('border-left');
 
   /** Sets the value of "border-left" */
-  void set borderLeft(String value) {
+  set borderLeft(String value) {
     setProperty('border-left', value, '');
   }
 
@@ -4974,7 +6411,7 @@
     getPropertyValue('border-left-color');
 
   /** Sets the value of "border-left-color" */
-  void set borderLeftColor(String value) {
+  set borderLeftColor(String value) {
     setProperty('border-left-color', value, '');
   }
 
@@ -4983,7 +6420,7 @@
     getPropertyValue('border-left-style');
 
   /** Sets the value of "border-left-style" */
-  void set borderLeftStyle(String value) {
+  set borderLeftStyle(String value) {
     setProperty('border-left-style', value, '');
   }
 
@@ -4992,7 +6429,7 @@
     getPropertyValue('border-left-width');
 
   /** Sets the value of "border-left-width" */
-  void set borderLeftWidth(String value) {
+  set borderLeftWidth(String value) {
     setProperty('border-left-width', value, '');
   }
 
@@ -5001,7 +6438,7 @@
     getPropertyValue('border-radius');
 
   /** Sets the value of "border-radius" */
-  void set borderRadius(String value) {
+  set borderRadius(String value) {
     setProperty('border-radius', value, '');
   }
 
@@ -5010,7 +6447,7 @@
     getPropertyValue('border-right');
 
   /** Sets the value of "border-right" */
-  void set borderRight(String value) {
+  set borderRight(String value) {
     setProperty('border-right', value, '');
   }
 
@@ -5019,7 +6456,7 @@
     getPropertyValue('border-right-color');
 
   /** Sets the value of "border-right-color" */
-  void set borderRightColor(String value) {
+  set borderRightColor(String value) {
     setProperty('border-right-color', value, '');
   }
 
@@ -5028,7 +6465,7 @@
     getPropertyValue('border-right-style');
 
   /** Sets the value of "border-right-style" */
-  void set borderRightStyle(String value) {
+  set borderRightStyle(String value) {
     setProperty('border-right-style', value, '');
   }
 
@@ -5037,7 +6474,7 @@
     getPropertyValue('border-right-width');
 
   /** Sets the value of "border-right-width" */
-  void set borderRightWidth(String value) {
+  set borderRightWidth(String value) {
     setProperty('border-right-width', value, '');
   }
 
@@ -5046,7 +6483,7 @@
     getPropertyValue('border-spacing');
 
   /** Sets the value of "border-spacing" */
-  void set borderSpacing(String value) {
+  set borderSpacing(String value) {
     setProperty('border-spacing', value, '');
   }
 
@@ -5055,7 +6492,7 @@
     getPropertyValue('border-start');
 
   /** Sets the value of "border-start" */
-  void set borderStart(String value) {
+  set borderStart(String value) {
     setProperty('border-start', value, '');
   }
 
@@ -5064,7 +6501,7 @@
     getPropertyValue('border-start-color');
 
   /** Sets the value of "border-start-color" */
-  void set borderStartColor(String value) {
+  set borderStartColor(String value) {
     setProperty('border-start-color', value, '');
   }
 
@@ -5073,7 +6510,7 @@
     getPropertyValue('border-start-style');
 
   /** Sets the value of "border-start-style" */
-  void set borderStartStyle(String value) {
+  set borderStartStyle(String value) {
     setProperty('border-start-style', value, '');
   }
 
@@ -5082,7 +6519,7 @@
     getPropertyValue('border-start-width');
 
   /** Sets the value of "border-start-width" */
-  void set borderStartWidth(String value) {
+  set borderStartWidth(String value) {
     setProperty('border-start-width', value, '');
   }
 
@@ -5091,7 +6528,7 @@
     getPropertyValue('border-style');
 
   /** Sets the value of "border-style" */
-  void set borderStyle(String value) {
+  set borderStyle(String value) {
     setProperty('border-style', value, '');
   }
 
@@ -5100,7 +6537,7 @@
     getPropertyValue('border-top');
 
   /** Sets the value of "border-top" */
-  void set borderTop(String value) {
+  set borderTop(String value) {
     setProperty('border-top', value, '');
   }
 
@@ -5109,7 +6546,7 @@
     getPropertyValue('border-top-color');
 
   /** Sets the value of "border-top-color" */
-  void set borderTopColor(String value) {
+  set borderTopColor(String value) {
     setProperty('border-top-color', value, '');
   }
 
@@ -5118,7 +6555,7 @@
     getPropertyValue('border-top-left-radius');
 
   /** Sets the value of "border-top-left-radius" */
-  void set borderTopLeftRadius(String value) {
+  set borderTopLeftRadius(String value) {
     setProperty('border-top-left-radius', value, '');
   }
 
@@ -5127,7 +6564,7 @@
     getPropertyValue('border-top-right-radius');
 
   /** Sets the value of "border-top-right-radius" */
-  void set borderTopRightRadius(String value) {
+  set borderTopRightRadius(String value) {
     setProperty('border-top-right-radius', value, '');
   }
 
@@ -5136,7 +6573,7 @@
     getPropertyValue('border-top-style');
 
   /** Sets the value of "border-top-style" */
-  void set borderTopStyle(String value) {
+  set borderTopStyle(String value) {
     setProperty('border-top-style', value, '');
   }
 
@@ -5145,7 +6582,7 @@
     getPropertyValue('border-top-width');
 
   /** Sets the value of "border-top-width" */
-  void set borderTopWidth(String value) {
+  set borderTopWidth(String value) {
     setProperty('border-top-width', value, '');
   }
 
@@ -5154,7 +6591,7 @@
     getPropertyValue('border-vertical-spacing');
 
   /** Sets the value of "border-vertical-spacing" */
-  void set borderVerticalSpacing(String value) {
+  set borderVerticalSpacing(String value) {
     setProperty('border-vertical-spacing', value, '');
   }
 
@@ -5163,7 +6600,7 @@
     getPropertyValue('border-width');
 
   /** Sets the value of "border-width" */
-  void set borderWidth(String value) {
+  set borderWidth(String value) {
     setProperty('border-width', value, '');
   }
 
@@ -5172,7 +6609,7 @@
     getPropertyValue('bottom');
 
   /** Sets the value of "bottom" */
-  void set bottom(String value) {
+  set bottom(String value) {
     setProperty('bottom', value, '');
   }
 
@@ -5181,7 +6618,7 @@
     getPropertyValue('box-align');
 
   /** Sets the value of "box-align" */
-  void set boxAlign(String value) {
+  set boxAlign(String value) {
     setProperty('box-align', value, '');
   }
 
@@ -5190,7 +6627,7 @@
     getPropertyValue('box-decoration-break');
 
   /** Sets the value of "box-decoration-break" */
-  void set boxDecorationBreak(String value) {
+  set boxDecorationBreak(String value) {
     setProperty('box-decoration-break', value, '');
   }
 
@@ -5199,7 +6636,7 @@
     getPropertyValue('box-direction');
 
   /** Sets the value of "box-direction" */
-  void set boxDirection(String value) {
+  set boxDirection(String value) {
     setProperty('box-direction', value, '');
   }
 
@@ -5208,7 +6645,7 @@
     getPropertyValue('box-flex');
 
   /** Sets the value of "box-flex" */
-  void set boxFlex(String value) {
+  set boxFlex(String value) {
     setProperty('box-flex', value, '');
   }
 
@@ -5217,7 +6654,7 @@
     getPropertyValue('box-flex-group');
 
   /** Sets the value of "box-flex-group" */
-  void set boxFlexGroup(String value) {
+  set boxFlexGroup(String value) {
     setProperty('box-flex-group', value, '');
   }
 
@@ -5226,7 +6663,7 @@
     getPropertyValue('box-lines');
 
   /** Sets the value of "box-lines" */
-  void set boxLines(String value) {
+  set boxLines(String value) {
     setProperty('box-lines', value, '');
   }
 
@@ -5235,7 +6672,7 @@
     getPropertyValue('box-ordinal-group');
 
   /** Sets the value of "box-ordinal-group" */
-  void set boxOrdinalGroup(String value) {
+  set boxOrdinalGroup(String value) {
     setProperty('box-ordinal-group', value, '');
   }
 
@@ -5244,7 +6681,7 @@
     getPropertyValue('box-orient');
 
   /** Sets the value of "box-orient" */
-  void set boxOrient(String value) {
+  set boxOrient(String value) {
     setProperty('box-orient', value, '');
   }
 
@@ -5253,7 +6690,7 @@
     getPropertyValue('box-pack');
 
   /** Sets the value of "box-pack" */
-  void set boxPack(String value) {
+  set boxPack(String value) {
     setProperty('box-pack', value, '');
   }
 
@@ -5262,7 +6699,7 @@
     getPropertyValue('box-reflect');
 
   /** Sets the value of "box-reflect" */
-  void set boxReflect(String value) {
+  set boxReflect(String value) {
     setProperty('box-reflect', value, '');
   }
 
@@ -5271,7 +6708,7 @@
     getPropertyValue('box-shadow');
 
   /** Sets the value of "box-shadow" */
-  void set boxShadow(String value) {
+  set boxShadow(String value) {
     setProperty('box-shadow', value, '');
   }
 
@@ -5280,7 +6717,7 @@
     getPropertyValue('box-sizing');
 
   /** Sets the value of "box-sizing" */
-  void set boxSizing(String value) {
+  set boxSizing(String value) {
     setProperty('box-sizing', value, '');
   }
 
@@ -5289,7 +6726,7 @@
     getPropertyValue('caption-side');
 
   /** Sets the value of "caption-side" */
-  void set captionSide(String value) {
+  set captionSide(String value) {
     setProperty('caption-side', value, '');
   }
 
@@ -5298,7 +6735,7 @@
     getPropertyValue('clear');
 
   /** Sets the value of "clear" */
-  void set clear(String value) {
+  set clear(String value) {
     setProperty('clear', value, '');
   }
 
@@ -5307,7 +6744,7 @@
     getPropertyValue('clip');
 
   /** Sets the value of "clip" */
-  void set clip(String value) {
+  set clip(String value) {
     setProperty('clip', value, '');
   }
 
@@ -5316,7 +6753,7 @@
     getPropertyValue('clip-path');
 
   /** Sets the value of "clip-path" */
-  void set clipPath(String value) {
+  set clipPath(String value) {
     setProperty('clip-path', value, '');
   }
 
@@ -5325,7 +6762,7 @@
     getPropertyValue('color');
 
   /** Sets the value of "color" */
-  void set color(String value) {
+  set color(String value) {
     setProperty('color', value, '');
   }
 
@@ -5334,7 +6771,7 @@
     getPropertyValue('column-break-after');
 
   /** Sets the value of "column-break-after" */
-  void set columnBreakAfter(String value) {
+  set columnBreakAfter(String value) {
     setProperty('column-break-after', value, '');
   }
 
@@ -5343,7 +6780,7 @@
     getPropertyValue('column-break-before');
 
   /** Sets the value of "column-break-before" */
-  void set columnBreakBefore(String value) {
+  set columnBreakBefore(String value) {
     setProperty('column-break-before', value, '');
   }
 
@@ -5352,7 +6789,7 @@
     getPropertyValue('column-break-inside');
 
   /** Sets the value of "column-break-inside" */
-  void set columnBreakInside(String value) {
+  set columnBreakInside(String value) {
     setProperty('column-break-inside', value, '');
   }
 
@@ -5361,7 +6798,7 @@
     getPropertyValue('column-count');
 
   /** Sets the value of "column-count" */
-  void set columnCount(String value) {
+  set columnCount(String value) {
     setProperty('column-count', value, '');
   }
 
@@ -5370,7 +6807,7 @@
     getPropertyValue('column-fill');
 
   /** Sets the value of "column-fill" */
-  void set columnFill(String value) {
+  set columnFill(String value) {
     setProperty('column-fill', value, '');
   }
 
@@ -5379,7 +6816,7 @@
     getPropertyValue('column-gap');
 
   /** Sets the value of "column-gap" */
-  void set columnGap(String value) {
+  set columnGap(String value) {
     setProperty('column-gap', value, '');
   }
 
@@ -5388,7 +6825,7 @@
     getPropertyValue('column-rule');
 
   /** Sets the value of "column-rule" */
-  void set columnRule(String value) {
+  set columnRule(String value) {
     setProperty('column-rule', value, '');
   }
 
@@ -5397,7 +6834,7 @@
     getPropertyValue('column-rule-color');
 
   /** Sets the value of "column-rule-color" */
-  void set columnRuleColor(String value) {
+  set columnRuleColor(String value) {
     setProperty('column-rule-color', value, '');
   }
 
@@ -5406,7 +6843,7 @@
     getPropertyValue('column-rule-style');
 
   /** Sets the value of "column-rule-style" */
-  void set columnRuleStyle(String value) {
+  set columnRuleStyle(String value) {
     setProperty('column-rule-style', value, '');
   }
 
@@ -5415,7 +6852,7 @@
     getPropertyValue('column-rule-width');
 
   /** Sets the value of "column-rule-width" */
-  void set columnRuleWidth(String value) {
+  set columnRuleWidth(String value) {
     setProperty('column-rule-width', value, '');
   }
 
@@ -5424,7 +6861,7 @@
     getPropertyValue('column-span');
 
   /** Sets the value of "column-span" */
-  void set columnSpan(String value) {
+  set columnSpan(String value) {
     setProperty('column-span', value, '');
   }
 
@@ -5433,7 +6870,7 @@
     getPropertyValue('column-width');
 
   /** Sets the value of "column-width" */
-  void set columnWidth(String value) {
+  set columnWidth(String value) {
     setProperty('column-width', value, '');
   }
 
@@ -5442,7 +6879,7 @@
     getPropertyValue('columns');
 
   /** Sets the value of "columns" */
-  void set columns(String value) {
+  set columns(String value) {
     setProperty('columns', value, '');
   }
 
@@ -5451,7 +6888,7 @@
     getPropertyValue('content');
 
   /** Sets the value of "content" */
-  void set content(String value) {
+  set content(String value) {
     setProperty('content', value, '');
   }
 
@@ -5460,7 +6897,7 @@
     getPropertyValue('counter-increment');
 
   /** Sets the value of "counter-increment" */
-  void set counterIncrement(String value) {
+  set counterIncrement(String value) {
     setProperty('counter-increment', value, '');
   }
 
@@ -5469,7 +6906,7 @@
     getPropertyValue('counter-reset');
 
   /** Sets the value of "counter-reset" */
-  void set counterReset(String value) {
+  set counterReset(String value) {
     setProperty('counter-reset', value, '');
   }
 
@@ -5478,7 +6915,7 @@
     getPropertyValue('cursor');
 
   /** Sets the value of "cursor" */
-  void set cursor(String value) {
+  set cursor(String value) {
     setProperty('cursor', value, '');
   }
 
@@ -5487,7 +6924,7 @@
     getPropertyValue('direction');
 
   /** Sets the value of "direction" */
-  void set direction(String value) {
+  set direction(String value) {
     setProperty('direction', value, '');
   }
 
@@ -5496,7 +6933,7 @@
     getPropertyValue('display');
 
   /** Sets the value of "display" */
-  void set display(String value) {
+  set display(String value) {
     setProperty('display', value, '');
   }
 
@@ -5505,7 +6942,7 @@
     getPropertyValue('empty-cells');
 
   /** Sets the value of "empty-cells" */
-  void set emptyCells(String value) {
+  set emptyCells(String value) {
     setProperty('empty-cells', value, '');
   }
 
@@ -5514,7 +6951,7 @@
     getPropertyValue('filter');
 
   /** Sets the value of "filter" */
-  void set filter(String value) {
+  set filter(String value) {
     setProperty('filter', value, '');
   }
 
@@ -5523,7 +6960,7 @@
     getPropertyValue('flex');
 
   /** Sets the value of "flex" */
-  void set flex(String value) {
+  set flex(String value) {
     setProperty('flex', value, '');
   }
 
@@ -5532,7 +6969,7 @@
     getPropertyValue('flex-basis');
 
   /** Sets the value of "flex-basis" */
-  void set flexBasis(String value) {
+  set flexBasis(String value) {
     setProperty('flex-basis', value, '');
   }
 
@@ -5541,7 +6978,7 @@
     getPropertyValue('flex-direction');
 
   /** Sets the value of "flex-direction" */
-  void set flexDirection(String value) {
+  set flexDirection(String value) {
     setProperty('flex-direction', value, '');
   }
 
@@ -5550,7 +6987,7 @@
     getPropertyValue('flex-flow');
 
   /** Sets the value of "flex-flow" */
-  void set flexFlow(String value) {
+  set flexFlow(String value) {
     setProperty('flex-flow', value, '');
   }
 
@@ -5559,7 +6996,7 @@
     getPropertyValue('flex-grow');
 
   /** Sets the value of "flex-grow" */
-  void set flexGrow(String value) {
+  set flexGrow(String value) {
     setProperty('flex-grow', value, '');
   }
 
@@ -5568,7 +7005,7 @@
     getPropertyValue('flex-shrink');
 
   /** Sets the value of "flex-shrink" */
-  void set flexShrink(String value) {
+  set flexShrink(String value) {
     setProperty('flex-shrink', value, '');
   }
 
@@ -5577,7 +7014,7 @@
     getPropertyValue('flex-wrap');
 
   /** Sets the value of "flex-wrap" */
-  void set flexWrap(String value) {
+  set flexWrap(String value) {
     setProperty('flex-wrap', value, '');
   }
 
@@ -5586,7 +7023,7 @@
     getPropertyValue('float');
 
   /** Sets the value of "float" */
-  void set float(String value) {
+  set float(String value) {
     setProperty('float', value, '');
   }
 
@@ -5595,7 +7032,7 @@
     getPropertyValue('font');
 
   /** Sets the value of "font" */
-  void set font(String value) {
+  set font(String value) {
     setProperty('font', value, '');
   }
 
@@ -5604,7 +7041,7 @@
     getPropertyValue('font-family');
 
   /** Sets the value of "font-family" */
-  void set fontFamily(String value) {
+  set fontFamily(String value) {
     setProperty('font-family', value, '');
   }
 
@@ -5613,7 +7050,7 @@
     getPropertyValue('font-feature-settings');
 
   /** Sets the value of "font-feature-settings" */
-  void set fontFeatureSettings(String value) {
+  set fontFeatureSettings(String value) {
     setProperty('font-feature-settings', value, '');
   }
 
@@ -5622,7 +7059,7 @@
     getPropertyValue('font-kerning');
 
   /** Sets the value of "font-kerning" */
-  void set fontKerning(String value) {
+  set fontKerning(String value) {
     setProperty('font-kerning', value, '');
   }
 
@@ -5631,7 +7068,7 @@
     getPropertyValue('font-size');
 
   /** Sets the value of "font-size" */
-  void set fontSize(String value) {
+  set fontSize(String value) {
     setProperty('font-size', value, '');
   }
 
@@ -5640,7 +7077,7 @@
     getPropertyValue('font-size-delta');
 
   /** Sets the value of "font-size-delta" */
-  void set fontSizeDelta(String value) {
+  set fontSizeDelta(String value) {
     setProperty('font-size-delta', value, '');
   }
 
@@ -5649,7 +7086,7 @@
     getPropertyValue('font-smoothing');
 
   /** Sets the value of "font-smoothing" */
-  void set fontSmoothing(String value) {
+  set fontSmoothing(String value) {
     setProperty('font-smoothing', value, '');
   }
 
@@ -5658,7 +7095,7 @@
     getPropertyValue('font-stretch');
 
   /** Sets the value of "font-stretch" */
-  void set fontStretch(String value) {
+  set fontStretch(String value) {
     setProperty('font-stretch', value, '');
   }
 
@@ -5667,7 +7104,7 @@
     getPropertyValue('font-style');
 
   /** Sets the value of "font-style" */
-  void set fontStyle(String value) {
+  set fontStyle(String value) {
     setProperty('font-style', value, '');
   }
 
@@ -5676,7 +7113,7 @@
     getPropertyValue('font-variant');
 
   /** Sets the value of "font-variant" */
-  void set fontVariant(String value) {
+  set fontVariant(String value) {
     setProperty('font-variant', value, '');
   }
 
@@ -5685,7 +7122,7 @@
     getPropertyValue('font-variant-ligatures');
 
   /** Sets the value of "font-variant-ligatures" */
-  void set fontVariantLigatures(String value) {
+  set fontVariantLigatures(String value) {
     setProperty('font-variant-ligatures', value, '');
   }
 
@@ -5694,7 +7131,7 @@
     getPropertyValue('font-weight');
 
   /** Sets the value of "font-weight" */
-  void set fontWeight(String value) {
+  set fontWeight(String value) {
     setProperty('font-weight', value, '');
   }
 
@@ -5703,7 +7140,7 @@
     getPropertyValue('grid');
 
   /** Sets the value of "grid" */
-  void set grid(String value) {
+  set grid(String value) {
     setProperty('grid', value, '');
   }
 
@@ -5712,7 +7149,7 @@
     getPropertyValue('grid-area');
 
   /** Sets the value of "grid-area" */
-  void set gridArea(String value) {
+  set gridArea(String value) {
     setProperty('grid-area', value, '');
   }
 
@@ -5721,7 +7158,7 @@
     getPropertyValue('grid-auto-columns');
 
   /** Sets the value of "grid-auto-columns" */
-  void set gridAutoColumns(String value) {
+  set gridAutoColumns(String value) {
     setProperty('grid-auto-columns', value, '');
   }
 
@@ -5730,7 +7167,7 @@
     getPropertyValue('grid-auto-flow');
 
   /** Sets the value of "grid-auto-flow" */
-  void set gridAutoFlow(String value) {
+  set gridAutoFlow(String value) {
     setProperty('grid-auto-flow', value, '');
   }
 
@@ -5739,7 +7176,7 @@
     getPropertyValue('grid-auto-rows');
 
   /** Sets the value of "grid-auto-rows" */
-  void set gridAutoRows(String value) {
+  set gridAutoRows(String value) {
     setProperty('grid-auto-rows', value, '');
   }
 
@@ -5748,7 +7185,7 @@
     getPropertyValue('grid-column');
 
   /** Sets the value of "grid-column" */
-  void set gridColumn(String value) {
+  set gridColumn(String value) {
     setProperty('grid-column', value, '');
   }
 
@@ -5757,7 +7194,7 @@
     getPropertyValue('grid-column-end');
 
   /** Sets the value of "grid-column-end" */
-  void set gridColumnEnd(String value) {
+  set gridColumnEnd(String value) {
     setProperty('grid-column-end', value, '');
   }
 
@@ -5766,7 +7203,7 @@
     getPropertyValue('grid-column-start');
 
   /** Sets the value of "grid-column-start" */
-  void set gridColumnStart(String value) {
+  set gridColumnStart(String value) {
     setProperty('grid-column-start', value, '');
   }
 
@@ -5775,7 +7212,7 @@
     getPropertyValue('grid-row');
 
   /** Sets the value of "grid-row" */
-  void set gridRow(String value) {
+  set gridRow(String value) {
     setProperty('grid-row', value, '');
   }
 
@@ -5784,7 +7221,7 @@
     getPropertyValue('grid-row-end');
 
   /** Sets the value of "grid-row-end" */
-  void set gridRowEnd(String value) {
+  set gridRowEnd(String value) {
     setProperty('grid-row-end', value, '');
   }
 
@@ -5793,7 +7230,7 @@
     getPropertyValue('grid-row-start');
 
   /** Sets the value of "grid-row-start" */
-  void set gridRowStart(String value) {
+  set gridRowStart(String value) {
     setProperty('grid-row-start', value, '');
   }
 
@@ -5802,7 +7239,7 @@
     getPropertyValue('grid-template');
 
   /** Sets the value of "grid-template" */
-  void set gridTemplate(String value) {
+  set gridTemplate(String value) {
     setProperty('grid-template', value, '');
   }
 
@@ -5811,7 +7248,7 @@
     getPropertyValue('grid-template-areas');
 
   /** Sets the value of "grid-template-areas" */
-  void set gridTemplateAreas(String value) {
+  set gridTemplateAreas(String value) {
     setProperty('grid-template-areas', value, '');
   }
 
@@ -5820,7 +7257,7 @@
     getPropertyValue('grid-template-columns');
 
   /** Sets the value of "grid-template-columns" */
-  void set gridTemplateColumns(String value) {
+  set gridTemplateColumns(String value) {
     setProperty('grid-template-columns', value, '');
   }
 
@@ -5829,7 +7266,7 @@
     getPropertyValue('grid-template-rows');
 
   /** Sets the value of "grid-template-rows" */
-  void set gridTemplateRows(String value) {
+  set gridTemplateRows(String value) {
     setProperty('grid-template-rows', value, '');
   }
 
@@ -5838,7 +7275,7 @@
     getPropertyValue('height');
 
   /** Sets the value of "height" */
-  void set height(String value) {
+  set height(String value) {
     setProperty('height', value, '');
   }
 
@@ -5847,7 +7284,7 @@
     getPropertyValue('highlight');
 
   /** Sets the value of "highlight" */
-  void set highlight(String value) {
+  set highlight(String value) {
     setProperty('highlight', value, '');
   }
 
@@ -5856,7 +7293,7 @@
     getPropertyValue('hyphenate-character');
 
   /** Sets the value of "hyphenate-character" */
-  void set hyphenateCharacter(String value) {
+  set hyphenateCharacter(String value) {
     setProperty('hyphenate-character', value, '');
   }
 
@@ -5865,7 +7302,7 @@
     getPropertyValue('image-rendering');
 
   /** Sets the value of "image-rendering" */
-  void set imageRendering(String value) {
+  set imageRendering(String value) {
     setProperty('image-rendering', value, '');
   }
 
@@ -5874,7 +7311,7 @@
     getPropertyValue('isolation');
 
   /** Sets the value of "isolation" */
-  void set isolation(String value) {
+  set isolation(String value) {
     setProperty('isolation', value, '');
   }
 
@@ -5883,7 +7320,7 @@
     getPropertyValue('justify-content');
 
   /** Sets the value of "justify-content" */
-  void set justifyContent(String value) {
+  set justifyContent(String value) {
     setProperty('justify-content', value, '');
   }
 
@@ -5892,7 +7329,7 @@
     getPropertyValue('justify-self');
 
   /** Sets the value of "justify-self" */
-  void set justifySelf(String value) {
+  set justifySelf(String value) {
     setProperty('justify-self', value, '');
   }
 
@@ -5901,7 +7338,7 @@
     getPropertyValue('left');
 
   /** Sets the value of "left" */
-  void set left(String value) {
+  set left(String value) {
     setProperty('left', value, '');
   }
 
@@ -5910,7 +7347,7 @@
     getPropertyValue('letter-spacing');
 
   /** Sets the value of "letter-spacing" */
-  void set letterSpacing(String value) {
+  set letterSpacing(String value) {
     setProperty('letter-spacing', value, '');
   }
 
@@ -5919,7 +7356,7 @@
     getPropertyValue('line-box-contain');
 
   /** Sets the value of "line-box-contain" */
-  void set lineBoxContain(String value) {
+  set lineBoxContain(String value) {
     setProperty('line-box-contain', value, '');
   }
 
@@ -5928,7 +7365,7 @@
     getPropertyValue('line-break');
 
   /** Sets the value of "line-break" */
-  void set lineBreak(String value) {
+  set lineBreak(String value) {
     setProperty('line-break', value, '');
   }
 
@@ -5937,7 +7374,7 @@
     getPropertyValue('line-clamp');
 
   /** Sets the value of "line-clamp" */
-  void set lineClamp(String value) {
+  set lineClamp(String value) {
     setProperty('line-clamp', value, '');
   }
 
@@ -5946,7 +7383,7 @@
     getPropertyValue('line-height');
 
   /** Sets the value of "line-height" */
-  void set lineHeight(String value) {
+  set lineHeight(String value) {
     setProperty('line-height', value, '');
   }
 
@@ -5955,7 +7392,7 @@
     getPropertyValue('list-style');
 
   /** Sets the value of "list-style" */
-  void set listStyle(String value) {
+  set listStyle(String value) {
     setProperty('list-style', value, '');
   }
 
@@ -5964,7 +7401,7 @@
     getPropertyValue('list-style-image');
 
   /** Sets the value of "list-style-image" */
-  void set listStyleImage(String value) {
+  set listStyleImage(String value) {
     setProperty('list-style-image', value, '');
   }
 
@@ -5973,7 +7410,7 @@
     getPropertyValue('list-style-position');
 
   /** Sets the value of "list-style-position" */
-  void set listStylePosition(String value) {
+  set listStylePosition(String value) {
     setProperty('list-style-position', value, '');
   }
 
@@ -5982,7 +7419,7 @@
     getPropertyValue('list-style-type');
 
   /** Sets the value of "list-style-type" */
-  void set listStyleType(String value) {
+  set listStyleType(String value) {
     setProperty('list-style-type', value, '');
   }
 
@@ -5991,7 +7428,7 @@
     getPropertyValue('locale');
 
   /** Sets the value of "locale" */
-  void set locale(String value) {
+  set locale(String value) {
     setProperty('locale', value, '');
   }
 
@@ -6000,7 +7437,7 @@
     getPropertyValue('logical-height');
 
   /** Sets the value of "logical-height" */
-  void set logicalHeight(String value) {
+  set logicalHeight(String value) {
     setProperty('logical-height', value, '');
   }
 
@@ -6009,7 +7446,7 @@
     getPropertyValue('logical-width');
 
   /** Sets the value of "logical-width" */
-  void set logicalWidth(String value) {
+  set logicalWidth(String value) {
     setProperty('logical-width', value, '');
   }
 
@@ -6018,7 +7455,7 @@
     getPropertyValue('margin');
 
   /** Sets the value of "margin" */
-  void set margin(String value) {
+  set margin(String value) {
     setProperty('margin', value, '');
   }
 
@@ -6027,7 +7464,7 @@
     getPropertyValue('margin-after');
 
   /** Sets the value of "margin-after" */
-  void set marginAfter(String value) {
+  set marginAfter(String value) {
     setProperty('margin-after', value, '');
   }
 
@@ -6036,7 +7473,7 @@
     getPropertyValue('margin-after-collapse');
 
   /** Sets the value of "margin-after-collapse" */
-  void set marginAfterCollapse(String value) {
+  set marginAfterCollapse(String value) {
     setProperty('margin-after-collapse', value, '');
   }
 
@@ -6045,7 +7482,7 @@
     getPropertyValue('margin-before');
 
   /** Sets the value of "margin-before" */
-  void set marginBefore(String value) {
+  set marginBefore(String value) {
     setProperty('margin-before', value, '');
   }
 
@@ -6054,7 +7491,7 @@
     getPropertyValue('margin-before-collapse');
 
   /** Sets the value of "margin-before-collapse" */
-  void set marginBeforeCollapse(String value) {
+  set marginBeforeCollapse(String value) {
     setProperty('margin-before-collapse', value, '');
   }
 
@@ -6063,7 +7500,7 @@
     getPropertyValue('margin-bottom');
 
   /** Sets the value of "margin-bottom" */
-  void set marginBottom(String value) {
+  set marginBottom(String value) {
     setProperty('margin-bottom', value, '');
   }
 
@@ -6072,7 +7509,7 @@
     getPropertyValue('margin-bottom-collapse');
 
   /** Sets the value of "margin-bottom-collapse" */
-  void set marginBottomCollapse(String value) {
+  set marginBottomCollapse(String value) {
     setProperty('margin-bottom-collapse', value, '');
   }
 
@@ -6081,7 +7518,7 @@
     getPropertyValue('margin-collapse');
 
   /** Sets the value of "margin-collapse" */
-  void set marginCollapse(String value) {
+  set marginCollapse(String value) {
     setProperty('margin-collapse', value, '');
   }
 
@@ -6090,7 +7527,7 @@
     getPropertyValue('margin-end');
 
   /** Sets the value of "margin-end" */
-  void set marginEnd(String value) {
+  set marginEnd(String value) {
     setProperty('margin-end', value, '');
   }
 
@@ -6099,7 +7536,7 @@
     getPropertyValue('margin-left');
 
   /** Sets the value of "margin-left" */
-  void set marginLeft(String value) {
+  set marginLeft(String value) {
     setProperty('margin-left', value, '');
   }
 
@@ -6108,7 +7545,7 @@
     getPropertyValue('margin-right');
 
   /** Sets the value of "margin-right" */
-  void set marginRight(String value) {
+  set marginRight(String value) {
     setProperty('margin-right', value, '');
   }
 
@@ -6117,7 +7554,7 @@
     getPropertyValue('margin-start');
 
   /** Sets the value of "margin-start" */
-  void set marginStart(String value) {
+  set marginStart(String value) {
     setProperty('margin-start', value, '');
   }
 
@@ -6126,7 +7563,7 @@
     getPropertyValue('margin-top');
 
   /** Sets the value of "margin-top" */
-  void set marginTop(String value) {
+  set marginTop(String value) {
     setProperty('margin-top', value, '');
   }
 
@@ -6135,7 +7572,7 @@
     getPropertyValue('margin-top-collapse');
 
   /** Sets the value of "margin-top-collapse" */
-  void set marginTopCollapse(String value) {
+  set marginTopCollapse(String value) {
     setProperty('margin-top-collapse', value, '');
   }
 
@@ -6144,7 +7581,7 @@
     getPropertyValue('mask');
 
   /** Sets the value of "mask" */
-  void set mask(String value) {
+  set mask(String value) {
     setProperty('mask', value, '');
   }
 
@@ -6153,7 +7590,7 @@
     getPropertyValue('mask-box-image');
 
   /** Sets the value of "mask-box-image" */
-  void set maskBoxImage(String value) {
+  set maskBoxImage(String value) {
     setProperty('mask-box-image', value, '');
   }
 
@@ -6162,7 +7599,7 @@
     getPropertyValue('mask-box-image-outset');
 
   /** Sets the value of "mask-box-image-outset" */
-  void set maskBoxImageOutset(String value) {
+  set maskBoxImageOutset(String value) {
     setProperty('mask-box-image-outset', value, '');
   }
 
@@ -6171,7 +7608,7 @@
     getPropertyValue('mask-box-image-repeat');
 
   /** Sets the value of "mask-box-image-repeat" */
-  void set maskBoxImageRepeat(String value) {
+  set maskBoxImageRepeat(String value) {
     setProperty('mask-box-image-repeat', value, '');
   }
 
@@ -6180,7 +7617,7 @@
     getPropertyValue('mask-box-image-slice');
 
   /** Sets the value of "mask-box-image-slice" */
-  void set maskBoxImageSlice(String value) {
+  set maskBoxImageSlice(String value) {
     setProperty('mask-box-image-slice', value, '');
   }
 
@@ -6189,7 +7626,7 @@
     getPropertyValue('mask-box-image-source');
 
   /** Sets the value of "mask-box-image-source" */
-  void set maskBoxImageSource(String value) {
+  set maskBoxImageSource(String value) {
     setProperty('mask-box-image-source', value, '');
   }
 
@@ -6198,7 +7635,7 @@
     getPropertyValue('mask-box-image-width');
 
   /** Sets the value of "mask-box-image-width" */
-  void set maskBoxImageWidth(String value) {
+  set maskBoxImageWidth(String value) {
     setProperty('mask-box-image-width', value, '');
   }
 
@@ -6207,7 +7644,7 @@
     getPropertyValue('mask-clip');
 
   /** Sets the value of "mask-clip" */
-  void set maskClip(String value) {
+  set maskClip(String value) {
     setProperty('mask-clip', value, '');
   }
 
@@ -6216,7 +7653,7 @@
     getPropertyValue('mask-composite');
 
   /** Sets the value of "mask-composite" */
-  void set maskComposite(String value) {
+  set maskComposite(String value) {
     setProperty('mask-composite', value, '');
   }
 
@@ -6225,7 +7662,7 @@
     getPropertyValue('mask-image');
 
   /** Sets the value of "mask-image" */
-  void set maskImage(String value) {
+  set maskImage(String value) {
     setProperty('mask-image', value, '');
   }
 
@@ -6234,7 +7671,7 @@
     getPropertyValue('mask-origin');
 
   /** Sets the value of "mask-origin" */
-  void set maskOrigin(String value) {
+  set maskOrigin(String value) {
     setProperty('mask-origin', value, '');
   }
 
@@ -6243,7 +7680,7 @@
     getPropertyValue('mask-position');
 
   /** Sets the value of "mask-position" */
-  void set maskPosition(String value) {
+  set maskPosition(String value) {
     setProperty('mask-position', value, '');
   }
 
@@ -6252,7 +7689,7 @@
     getPropertyValue('mask-position-x');
 
   /** Sets the value of "mask-position-x" */
-  void set maskPositionX(String value) {
+  set maskPositionX(String value) {
     setProperty('mask-position-x', value, '');
   }
 
@@ -6261,7 +7698,7 @@
     getPropertyValue('mask-position-y');
 
   /** Sets the value of "mask-position-y" */
-  void set maskPositionY(String value) {
+  set maskPositionY(String value) {
     setProperty('mask-position-y', value, '');
   }
 
@@ -6270,7 +7707,7 @@
     getPropertyValue('mask-repeat');
 
   /** Sets the value of "mask-repeat" */
-  void set maskRepeat(String value) {
+  set maskRepeat(String value) {
     setProperty('mask-repeat', value, '');
   }
 
@@ -6279,7 +7716,7 @@
     getPropertyValue('mask-repeat-x');
 
   /** Sets the value of "mask-repeat-x" */
-  void set maskRepeatX(String value) {
+  set maskRepeatX(String value) {
     setProperty('mask-repeat-x', value, '');
   }
 
@@ -6288,7 +7725,7 @@
     getPropertyValue('mask-repeat-y');
 
   /** Sets the value of "mask-repeat-y" */
-  void set maskRepeatY(String value) {
+  set maskRepeatY(String value) {
     setProperty('mask-repeat-y', value, '');
   }
 
@@ -6297,7 +7734,7 @@
     getPropertyValue('mask-size');
 
   /** Sets the value of "mask-size" */
-  void set maskSize(String value) {
+  set maskSize(String value) {
     setProperty('mask-size', value, '');
   }
 
@@ -6306,7 +7743,7 @@
     getPropertyValue('mask-source-type');
 
   /** Sets the value of "mask-source-type" */
-  void set maskSourceType(String value) {
+  set maskSourceType(String value) {
     setProperty('mask-source-type', value, '');
   }
 
@@ -6315,7 +7752,7 @@
     getPropertyValue('max-height');
 
   /** Sets the value of "max-height" */
-  void set maxHeight(String value) {
+  set maxHeight(String value) {
     setProperty('max-height', value, '');
   }
 
@@ -6324,7 +7761,7 @@
     getPropertyValue('max-logical-height');
 
   /** Sets the value of "max-logical-height" */
-  void set maxLogicalHeight(String value) {
+  set maxLogicalHeight(String value) {
     setProperty('max-logical-height', value, '');
   }
 
@@ -6333,7 +7770,7 @@
     getPropertyValue('max-logical-width');
 
   /** Sets the value of "max-logical-width" */
-  void set maxLogicalWidth(String value) {
+  set maxLogicalWidth(String value) {
     setProperty('max-logical-width', value, '');
   }
 
@@ -6342,7 +7779,7 @@
     getPropertyValue('max-width');
 
   /** Sets the value of "max-width" */
-  void set maxWidth(String value) {
+  set maxWidth(String value) {
     setProperty('max-width', value, '');
   }
 
@@ -6351,7 +7788,7 @@
     getPropertyValue('max-zoom');
 
   /** Sets the value of "max-zoom" */
-  void set maxZoom(String value) {
+  set maxZoom(String value) {
     setProperty('max-zoom', value, '');
   }
 
@@ -6360,7 +7797,7 @@
     getPropertyValue('min-height');
 
   /** Sets the value of "min-height" */
-  void set minHeight(String value) {
+  set minHeight(String value) {
     setProperty('min-height', value, '');
   }
 
@@ -6369,7 +7806,7 @@
     getPropertyValue('min-logical-height');
 
   /** Sets the value of "min-logical-height" */
-  void set minLogicalHeight(String value) {
+  set minLogicalHeight(String value) {
     setProperty('min-logical-height', value, '');
   }
 
@@ -6378,7 +7815,7 @@
     getPropertyValue('min-logical-width');
 
   /** Sets the value of "min-logical-width" */
-  void set minLogicalWidth(String value) {
+  set minLogicalWidth(String value) {
     setProperty('min-logical-width', value, '');
   }
 
@@ -6387,7 +7824,7 @@
     getPropertyValue('min-width');
 
   /** Sets the value of "min-width" */
-  void set minWidth(String value) {
+  set minWidth(String value) {
     setProperty('min-width', value, '');
   }
 
@@ -6396,7 +7833,7 @@
     getPropertyValue('min-zoom');
 
   /** Sets the value of "min-zoom" */
-  void set minZoom(String value) {
+  set minZoom(String value) {
     setProperty('min-zoom', value, '');
   }
 
@@ -6405,7 +7842,7 @@
     getPropertyValue('mix-blend-mode');
 
   /** Sets the value of "mix-blend-mode" */
-  void set mixBlendMode(String value) {
+  set mixBlendMode(String value) {
     setProperty('mix-blend-mode', value, '');
   }
 
@@ -6414,7 +7851,7 @@
     getPropertyValue('object-fit');
 
   /** Sets the value of "object-fit" */
-  void set objectFit(String value) {
+  set objectFit(String value) {
     setProperty('object-fit', value, '');
   }
 
@@ -6423,7 +7860,7 @@
     getPropertyValue('object-position');
 
   /** Sets the value of "object-position" */
-  void set objectPosition(String value) {
+  set objectPosition(String value) {
     setProperty('object-position', value, '');
   }
 
@@ -6432,7 +7869,7 @@
     getPropertyValue('opacity');
 
   /** Sets the value of "opacity" */
-  void set opacity(String value) {
+  set opacity(String value) {
     setProperty('opacity', value, '');
   }
 
@@ -6441,7 +7878,7 @@
     getPropertyValue('order');
 
   /** Sets the value of "order" */
-  void set order(String value) {
+  set order(String value) {
     setProperty('order', value, '');
   }
 
@@ -6450,7 +7887,7 @@
     getPropertyValue('orientation');
 
   /** Sets the value of "orientation" */
-  void set orientation(String value) {
+  set orientation(String value) {
     setProperty('orientation', value, '');
   }
 
@@ -6459,7 +7896,7 @@
     getPropertyValue('orphans');
 
   /** Sets the value of "orphans" */
-  void set orphans(String value) {
+  set orphans(String value) {
     setProperty('orphans', value, '');
   }
 
@@ -6468,7 +7905,7 @@
     getPropertyValue('outline');
 
   /** Sets the value of "outline" */
-  void set outline(String value) {
+  set outline(String value) {
     setProperty('outline', value, '');
   }
 
@@ -6477,7 +7914,7 @@
     getPropertyValue('outline-color');
 
   /** Sets the value of "outline-color" */
-  void set outlineColor(String value) {
+  set outlineColor(String value) {
     setProperty('outline-color', value, '');
   }
 
@@ -6486,7 +7923,7 @@
     getPropertyValue('outline-offset');
 
   /** Sets the value of "outline-offset" */
-  void set outlineOffset(String value) {
+  set outlineOffset(String value) {
     setProperty('outline-offset', value, '');
   }
 
@@ -6495,7 +7932,7 @@
     getPropertyValue('outline-style');
 
   /** Sets the value of "outline-style" */
-  void set outlineStyle(String value) {
+  set outlineStyle(String value) {
     setProperty('outline-style', value, '');
   }
 
@@ -6504,7 +7941,7 @@
     getPropertyValue('outline-width');
 
   /** Sets the value of "outline-width" */
-  void set outlineWidth(String value) {
+  set outlineWidth(String value) {
     setProperty('outline-width', value, '');
   }
 
@@ -6513,7 +7950,7 @@
     getPropertyValue('overflow');
 
   /** Sets the value of "overflow" */
-  void set overflow(String value) {
+  set overflow(String value) {
     setProperty('overflow', value, '');
   }
 
@@ -6522,7 +7959,7 @@
     getPropertyValue('overflow-wrap');
 
   /** Sets the value of "overflow-wrap" */
-  void set overflowWrap(String value) {
+  set overflowWrap(String value) {
     setProperty('overflow-wrap', value, '');
   }
 
@@ -6531,7 +7968,7 @@
     getPropertyValue('overflow-x');
 
   /** Sets the value of "overflow-x" */
-  void set overflowX(String value) {
+  set overflowX(String value) {
     setProperty('overflow-x', value, '');
   }
 
@@ -6540,7 +7977,7 @@
     getPropertyValue('overflow-y');
 
   /** Sets the value of "overflow-y" */
-  void set overflowY(String value) {
+  set overflowY(String value) {
     setProperty('overflow-y', value, '');
   }
 
@@ -6549,7 +7986,7 @@
     getPropertyValue('padding');
 
   /** Sets the value of "padding" */
-  void set padding(String value) {
+  set padding(String value) {
     setProperty('padding', value, '');
   }
 
@@ -6558,7 +7995,7 @@
     getPropertyValue('padding-after');
 
   /** Sets the value of "padding-after" */
-  void set paddingAfter(String value) {
+  set paddingAfter(String value) {
     setProperty('padding-after', value, '');
   }
 
@@ -6567,7 +8004,7 @@
     getPropertyValue('padding-before');
 
   /** Sets the value of "padding-before" */
-  void set paddingBefore(String value) {
+  set paddingBefore(String value) {
     setProperty('padding-before', value, '');
   }
 
@@ -6576,7 +8013,7 @@
     getPropertyValue('padding-bottom');
 
   /** Sets the value of "padding-bottom" */
-  void set paddingBottom(String value) {
+  set paddingBottom(String value) {
     setProperty('padding-bottom', value, '');
   }
 
@@ -6585,7 +8022,7 @@
     getPropertyValue('padding-end');
 
   /** Sets the value of "padding-end" */
-  void set paddingEnd(String value) {
+  set paddingEnd(String value) {
     setProperty('padding-end', value, '');
   }
 
@@ -6594,7 +8031,7 @@
     getPropertyValue('padding-left');
 
   /** Sets the value of "padding-left" */
-  void set paddingLeft(String value) {
+  set paddingLeft(String value) {
     setProperty('padding-left', value, '');
   }
 
@@ -6603,7 +8040,7 @@
     getPropertyValue('padding-right');
 
   /** Sets the value of "padding-right" */
-  void set paddingRight(String value) {
+  set paddingRight(String value) {
     setProperty('padding-right', value, '');
   }
 
@@ -6612,7 +8049,7 @@
     getPropertyValue('padding-start');
 
   /** Sets the value of "padding-start" */
-  void set paddingStart(String value) {
+  set paddingStart(String value) {
     setProperty('padding-start', value, '');
   }
 
@@ -6621,7 +8058,7 @@
     getPropertyValue('padding-top');
 
   /** Sets the value of "padding-top" */
-  void set paddingTop(String value) {
+  set paddingTop(String value) {
     setProperty('padding-top', value, '');
   }
 
@@ -6630,7 +8067,7 @@
     getPropertyValue('page');
 
   /** Sets the value of "page" */
-  void set page(String value) {
+  set page(String value) {
     setProperty('page', value, '');
   }
 
@@ -6639,7 +8076,7 @@
     getPropertyValue('page-break-after');
 
   /** Sets the value of "page-break-after" */
-  void set pageBreakAfter(String value) {
+  set pageBreakAfter(String value) {
     setProperty('page-break-after', value, '');
   }
 
@@ -6648,7 +8085,7 @@
     getPropertyValue('page-break-before');
 
   /** Sets the value of "page-break-before" */
-  void set pageBreakBefore(String value) {
+  set pageBreakBefore(String value) {
     setProperty('page-break-before', value, '');
   }
 
@@ -6657,7 +8094,7 @@
     getPropertyValue('page-break-inside');
 
   /** Sets the value of "page-break-inside" */
-  void set pageBreakInside(String value) {
+  set pageBreakInside(String value) {
     setProperty('page-break-inside', value, '');
   }
 
@@ -6666,7 +8103,7 @@
     getPropertyValue('perspective');
 
   /** Sets the value of "perspective" */
-  void set perspective(String value) {
+  set perspective(String value) {
     setProperty('perspective', value, '');
   }
 
@@ -6675,7 +8112,7 @@
     getPropertyValue('perspective-origin');
 
   /** Sets the value of "perspective-origin" */
-  void set perspectiveOrigin(String value) {
+  set perspectiveOrigin(String value) {
     setProperty('perspective-origin', value, '');
   }
 
@@ -6684,7 +8121,7 @@
     getPropertyValue('perspective-origin-x');
 
   /** Sets the value of "perspective-origin-x" */
-  void set perspectiveOriginX(String value) {
+  set perspectiveOriginX(String value) {
     setProperty('perspective-origin-x', value, '');
   }
 
@@ -6693,7 +8130,7 @@
     getPropertyValue('perspective-origin-y');
 
   /** Sets the value of "perspective-origin-y" */
-  void set perspectiveOriginY(String value) {
+  set perspectiveOriginY(String value) {
     setProperty('perspective-origin-y', value, '');
   }
 
@@ -6702,7 +8139,7 @@
     getPropertyValue('pointer-events');
 
   /** Sets the value of "pointer-events" */
-  void set pointerEvents(String value) {
+  set pointerEvents(String value) {
     setProperty('pointer-events', value, '');
   }
 
@@ -6711,7 +8148,7 @@
     getPropertyValue('position');
 
   /** Sets the value of "position" */
-  void set position(String value) {
+  set position(String value) {
     setProperty('position', value, '');
   }
 
@@ -6720,7 +8157,7 @@
     getPropertyValue('print-color-adjust');
 
   /** Sets the value of "print-color-adjust" */
-  void set printColorAdjust(String value) {
+  set printColorAdjust(String value) {
     setProperty('print-color-adjust', value, '');
   }
 
@@ -6729,7 +8166,7 @@
     getPropertyValue('quotes');
 
   /** Sets the value of "quotes" */
-  void set quotes(String value) {
+  set quotes(String value) {
     setProperty('quotes', value, '');
   }
 
@@ -6738,7 +8175,7 @@
     getPropertyValue('resize');
 
   /** Sets the value of "resize" */
-  void set resize(String value) {
+  set resize(String value) {
     setProperty('resize', value, '');
   }
 
@@ -6747,7 +8184,7 @@
     getPropertyValue('right');
 
   /** Sets the value of "right" */
-  void set right(String value) {
+  set right(String value) {
     setProperty('right', value, '');
   }
 
@@ -6756,7 +8193,7 @@
     getPropertyValue('rtl-ordering');
 
   /** Sets the value of "rtl-ordering" */
-  void set rtlOrdering(String value) {
+  set rtlOrdering(String value) {
     setProperty('rtl-ordering', value, '');
   }
 
@@ -6765,7 +8202,7 @@
     getPropertyValue('ruby-position');
 
   /** Sets the value of "ruby-position" */
-  void set rubyPosition(String value) {
+  set rubyPosition(String value) {
     setProperty('ruby-position', value, '');
   }
 
@@ -6774,7 +8211,7 @@
     getPropertyValue('scroll-behavior');
 
   /** Sets the value of "scroll-behavior" */
-  void set scrollBehavior(String value) {
+  set scrollBehavior(String value) {
     setProperty('scroll-behavior', value, '');
   }
 
@@ -6783,7 +8220,7 @@
     getPropertyValue('shape-image-threshold');
 
   /** Sets the value of "shape-image-threshold" */
-  void set shapeImageThreshold(String value) {
+  set shapeImageThreshold(String value) {
     setProperty('shape-image-threshold', value, '');
   }
 
@@ -6792,7 +8229,7 @@
     getPropertyValue('shape-margin');
 
   /** Sets the value of "shape-margin" */
-  void set shapeMargin(String value) {
+  set shapeMargin(String value) {
     setProperty('shape-margin', value, '');
   }
 
@@ -6801,7 +8238,7 @@
     getPropertyValue('shape-outside');
 
   /** Sets the value of "shape-outside" */
-  void set shapeOutside(String value) {
+  set shapeOutside(String value) {
     setProperty('shape-outside', value, '');
   }
 
@@ -6810,7 +8247,7 @@
     getPropertyValue('size');
 
   /** Sets the value of "size" */
-  void set size(String value) {
+  set size(String value) {
     setProperty('size', value, '');
   }
 
@@ -6819,7 +8256,7 @@
     getPropertyValue('speak');
 
   /** Sets the value of "speak" */
-  void set speak(String value) {
+  set speak(String value) {
     setProperty('speak', value, '');
   }
 
@@ -6828,7 +8265,7 @@
     getPropertyValue('src');
 
   /** Sets the value of "src" */
-  void set src(String value) {
+  set src(String value) {
     setProperty('src', value, '');
   }
 
@@ -6837,7 +8274,7 @@
     getPropertyValue('tab-size');
 
   /** Sets the value of "tab-size" */
-  void set tabSize(String value) {
+  set tabSize(String value) {
     setProperty('tab-size', value, '');
   }
 
@@ -6846,7 +8283,7 @@
     getPropertyValue('table-layout');
 
   /** Sets the value of "table-layout" */
-  void set tableLayout(String value) {
+  set tableLayout(String value) {
     setProperty('table-layout', value, '');
   }
 
@@ -6855,7 +8292,7 @@
     getPropertyValue('tap-highlight-color');
 
   /** Sets the value of "tap-highlight-color" */
-  void set tapHighlightColor(String value) {
+  set tapHighlightColor(String value) {
     setProperty('tap-highlight-color', value, '');
   }
 
@@ -6864,7 +8301,7 @@
     getPropertyValue('text-align');
 
   /** Sets the value of "text-align" */
-  void set textAlign(String value) {
+  set textAlign(String value) {
     setProperty('text-align', value, '');
   }
 
@@ -6873,7 +8310,7 @@
     getPropertyValue('text-align-last');
 
   /** Sets the value of "text-align-last" */
-  void set textAlignLast(String value) {
+  set textAlignLast(String value) {
     setProperty('text-align-last', value, '');
   }
 
@@ -6882,7 +8319,7 @@
     getPropertyValue('text-combine');
 
   /** Sets the value of "text-combine" */
-  void set textCombine(String value) {
+  set textCombine(String value) {
     setProperty('text-combine', value, '');
   }
 
@@ -6891,7 +8328,7 @@
     getPropertyValue('text-decoration');
 
   /** Sets the value of "text-decoration" */
-  void set textDecoration(String value) {
+  set textDecoration(String value) {
     setProperty('text-decoration', value, '');
   }
 
@@ -6900,7 +8337,7 @@
     getPropertyValue('text-decoration-color');
 
   /** Sets the value of "text-decoration-color" */
-  void set textDecorationColor(String value) {
+  set textDecorationColor(String value) {
     setProperty('text-decoration-color', value, '');
   }
 
@@ -6909,7 +8346,7 @@
     getPropertyValue('text-decoration-line');
 
   /** Sets the value of "text-decoration-line" */
-  void set textDecorationLine(String value) {
+  set textDecorationLine(String value) {
     setProperty('text-decoration-line', value, '');
   }
 
@@ -6918,7 +8355,7 @@
     getPropertyValue('text-decoration-style');
 
   /** Sets the value of "text-decoration-style" */
-  void set textDecorationStyle(String value) {
+  set textDecorationStyle(String value) {
     setProperty('text-decoration-style', value, '');
   }
 
@@ -6927,7 +8364,7 @@
     getPropertyValue('text-decorations-in-effect');
 
   /** Sets the value of "text-decorations-in-effect" */
-  void set textDecorationsInEffect(String value) {
+  set textDecorationsInEffect(String value) {
     setProperty('text-decorations-in-effect', value, '');
   }
 
@@ -6936,7 +8373,7 @@
     getPropertyValue('text-emphasis');
 
   /** Sets the value of "text-emphasis" */
-  void set textEmphasis(String value) {
+  set textEmphasis(String value) {
     setProperty('text-emphasis', value, '');
   }
 
@@ -6945,7 +8382,7 @@
     getPropertyValue('text-emphasis-color');
 
   /** Sets the value of "text-emphasis-color" */
-  void set textEmphasisColor(String value) {
+  set textEmphasisColor(String value) {
     setProperty('text-emphasis-color', value, '');
   }
 
@@ -6954,7 +8391,7 @@
     getPropertyValue('text-emphasis-position');
 
   /** Sets the value of "text-emphasis-position" */
-  void set textEmphasisPosition(String value) {
+  set textEmphasisPosition(String value) {
     setProperty('text-emphasis-position', value, '');
   }
 
@@ -6963,7 +8400,7 @@
     getPropertyValue('text-emphasis-style');
 
   /** Sets the value of "text-emphasis-style" */
-  void set textEmphasisStyle(String value) {
+  set textEmphasisStyle(String value) {
     setProperty('text-emphasis-style', value, '');
   }
 
@@ -6972,7 +8409,7 @@
     getPropertyValue('text-fill-color');
 
   /** Sets the value of "text-fill-color" */
-  void set textFillColor(String value) {
+  set textFillColor(String value) {
     setProperty('text-fill-color', value, '');
   }
 
@@ -6981,7 +8418,7 @@
     getPropertyValue('text-indent');
 
   /** Sets the value of "text-indent" */
-  void set textIndent(String value) {
+  set textIndent(String value) {
     setProperty('text-indent', value, '');
   }
 
@@ -6990,7 +8427,7 @@
     getPropertyValue('text-justify');
 
   /** Sets the value of "text-justify" */
-  void set textJustify(String value) {
+  set textJustify(String value) {
     setProperty('text-justify', value, '');
   }
 
@@ -6999,7 +8436,7 @@
     getPropertyValue('text-line-through-color');
 
   /** Sets the value of "text-line-through-color" */
-  void set textLineThroughColor(String value) {
+  set textLineThroughColor(String value) {
     setProperty('text-line-through-color', value, '');
   }
 
@@ -7008,7 +8445,7 @@
     getPropertyValue('text-line-through-mode');
 
   /** Sets the value of "text-line-through-mode" */
-  void set textLineThroughMode(String value) {
+  set textLineThroughMode(String value) {
     setProperty('text-line-through-mode', value, '');
   }
 
@@ -7017,7 +8454,7 @@
     getPropertyValue('text-line-through-style');
 
   /** Sets the value of "text-line-through-style" */
-  void set textLineThroughStyle(String value) {
+  set textLineThroughStyle(String value) {
     setProperty('text-line-through-style', value, '');
   }
 
@@ -7026,7 +8463,7 @@
     getPropertyValue('text-line-through-width');
 
   /** Sets the value of "text-line-through-width" */
-  void set textLineThroughWidth(String value) {
+  set textLineThroughWidth(String value) {
     setProperty('text-line-through-width', value, '');
   }
 
@@ -7035,7 +8472,7 @@
     getPropertyValue('text-orientation');
 
   /** Sets the value of "text-orientation" */
-  void set textOrientation(String value) {
+  set textOrientation(String value) {
     setProperty('text-orientation', value, '');
   }
 
@@ -7044,7 +8481,7 @@
     getPropertyValue('text-overflow');
 
   /** Sets the value of "text-overflow" */
-  void set textOverflow(String value) {
+  set textOverflow(String value) {
     setProperty('text-overflow', value, '');
   }
 
@@ -7053,7 +8490,7 @@
     getPropertyValue('text-overline-color');
 
   /** Sets the value of "text-overline-color" */
-  void set textOverlineColor(String value) {
+  set textOverlineColor(String value) {
     setProperty('text-overline-color', value, '');
   }
 
@@ -7062,7 +8499,7 @@
     getPropertyValue('text-overline-mode');
 
   /** Sets the value of "text-overline-mode" */
-  void set textOverlineMode(String value) {
+  set textOverlineMode(String value) {
     setProperty('text-overline-mode', value, '');
   }
 
@@ -7071,7 +8508,7 @@
     getPropertyValue('text-overline-style');
 
   /** Sets the value of "text-overline-style" */
-  void set textOverlineStyle(String value) {
+  set textOverlineStyle(String value) {
     setProperty('text-overline-style', value, '');
   }
 
@@ -7080,7 +8517,7 @@
     getPropertyValue('text-overline-width');
 
   /** Sets the value of "text-overline-width" */
-  void set textOverlineWidth(String value) {
+  set textOverlineWidth(String value) {
     setProperty('text-overline-width', value, '');
   }
 
@@ -7089,7 +8526,7 @@
     getPropertyValue('text-rendering');
 
   /** Sets the value of "text-rendering" */
-  void set textRendering(String value) {
+  set textRendering(String value) {
     setProperty('text-rendering', value, '');
   }
 
@@ -7098,7 +8535,7 @@
     getPropertyValue('text-security');
 
   /** Sets the value of "text-security" */
-  void set textSecurity(String value) {
+  set textSecurity(String value) {
     setProperty('text-security', value, '');
   }
 
@@ -7107,7 +8544,7 @@
     getPropertyValue('text-shadow');
 
   /** Sets the value of "text-shadow" */
-  void set textShadow(String value) {
+  set textShadow(String value) {
     setProperty('text-shadow', value, '');
   }
 
@@ -7116,7 +8553,7 @@
     getPropertyValue('text-stroke');
 
   /** Sets the value of "text-stroke" */
-  void set textStroke(String value) {
+  set textStroke(String value) {
     setProperty('text-stroke', value, '');
   }
 
@@ -7125,7 +8562,7 @@
     getPropertyValue('text-stroke-color');
 
   /** Sets the value of "text-stroke-color" */
-  void set textStrokeColor(String value) {
+  set textStrokeColor(String value) {
     setProperty('text-stroke-color', value, '');
   }
 
@@ -7134,7 +8571,7 @@
     getPropertyValue('text-stroke-width');
 
   /** Sets the value of "text-stroke-width" */
-  void set textStrokeWidth(String value) {
+  set textStrokeWidth(String value) {
     setProperty('text-stroke-width', value, '');
   }
 
@@ -7143,7 +8580,7 @@
     getPropertyValue('text-transform');
 
   /** Sets the value of "text-transform" */
-  void set textTransform(String value) {
+  set textTransform(String value) {
     setProperty('text-transform', value, '');
   }
 
@@ -7152,7 +8589,7 @@
     getPropertyValue('text-underline-color');
 
   /** Sets the value of "text-underline-color" */
-  void set textUnderlineColor(String value) {
+  set textUnderlineColor(String value) {
     setProperty('text-underline-color', value, '');
   }
 
@@ -7161,7 +8598,7 @@
     getPropertyValue('text-underline-mode');
 
   /** Sets the value of "text-underline-mode" */
-  void set textUnderlineMode(String value) {
+  set textUnderlineMode(String value) {
     setProperty('text-underline-mode', value, '');
   }
 
@@ -7170,7 +8607,7 @@
     getPropertyValue('text-underline-position');
 
   /** Sets the value of "text-underline-position" */
-  void set textUnderlinePosition(String value) {
+  set textUnderlinePosition(String value) {
     setProperty('text-underline-position', value, '');
   }
 
@@ -7179,7 +8616,7 @@
     getPropertyValue('text-underline-style');
 
   /** Sets the value of "text-underline-style" */
-  void set textUnderlineStyle(String value) {
+  set textUnderlineStyle(String value) {
     setProperty('text-underline-style', value, '');
   }
 
@@ -7188,7 +8625,7 @@
     getPropertyValue('text-underline-width');
 
   /** Sets the value of "text-underline-width" */
-  void set textUnderlineWidth(String value) {
+  set textUnderlineWidth(String value) {
     setProperty('text-underline-width', value, '');
   }
 
@@ -7197,7 +8634,7 @@
     getPropertyValue('top');
 
   /** Sets the value of "top" */
-  void set top(String value) {
+  set top(String value) {
     setProperty('top', value, '');
   }
 
@@ -7206,7 +8643,7 @@
     getPropertyValue('touch-action');
 
   /** Sets the value of "touch-action" */
-  void set touchAction(String value) {
+  set touchAction(String value) {
     setProperty('touch-action', value, '');
   }
 
@@ -7215,7 +8652,7 @@
     getPropertyValue('touch-action-delay');
 
   /** Sets the value of "touch-action-delay" */
-  void set touchActionDelay(String value) {
+  set touchActionDelay(String value) {
     setProperty('touch-action-delay', value, '');
   }
 
@@ -7224,7 +8661,7 @@
     getPropertyValue('transform');
 
   /** Sets the value of "transform" */
-  void set transform(String value) {
+  set transform(String value) {
     setProperty('transform', value, '');
   }
 
@@ -7233,7 +8670,7 @@
     getPropertyValue('transform-origin');
 
   /** Sets the value of "transform-origin" */
-  void set transformOrigin(String value) {
+  set transformOrigin(String value) {
     setProperty('transform-origin', value, '');
   }
 
@@ -7242,7 +8679,7 @@
     getPropertyValue('transform-origin-x');
 
   /** Sets the value of "transform-origin-x" */
-  void set transformOriginX(String value) {
+  set transformOriginX(String value) {
     setProperty('transform-origin-x', value, '');
   }
 
@@ -7251,7 +8688,7 @@
     getPropertyValue('transform-origin-y');
 
   /** Sets the value of "transform-origin-y" */
-  void set transformOriginY(String value) {
+  set transformOriginY(String value) {
     setProperty('transform-origin-y', value, '');
   }
 
@@ -7260,7 +8697,7 @@
     getPropertyValue('transform-origin-z');
 
   /** Sets the value of "transform-origin-z" */
-  void set transformOriginZ(String value) {
+  set transformOriginZ(String value) {
     setProperty('transform-origin-z', value, '');
   }
 
@@ -7269,7 +8706,7 @@
     getPropertyValue('transform-style');
 
   /** Sets the value of "transform-style" */
-  void set transformStyle(String value) {
+  set transformStyle(String value) {
     setProperty('transform-style', value, '');
   }
 
@@ -7284,7 +8721,7 @@
   @SupportedBrowser(SupportedBrowser.FIREFOX)
   @SupportedBrowser(SupportedBrowser.IE, '10')
   @SupportedBrowser(SupportedBrowser.SAFARI)
-  void set transition(String value) {
+  set transition(String value) {
     setProperty('transition', value, '');
   }
 
@@ -7293,7 +8730,7 @@
     getPropertyValue('transition-delay');
 
   /** Sets the value of "transition-delay" */
-  void set transitionDelay(String value) {
+  set transitionDelay(String value) {
     setProperty('transition-delay', value, '');
   }
 
@@ -7302,7 +8739,7 @@
     getPropertyValue('transition-duration');
 
   /** Sets the value of "transition-duration" */
-  void set transitionDuration(String value) {
+  set transitionDuration(String value) {
     setProperty('transition-duration', value, '');
   }
 
@@ -7311,7 +8748,7 @@
     getPropertyValue('transition-property');
 
   /** Sets the value of "transition-property" */
-  void set transitionProperty(String value) {
+  set transitionProperty(String value) {
     setProperty('transition-property', value, '');
   }
 
@@ -7320,7 +8757,7 @@
     getPropertyValue('transition-timing-function');
 
   /** Sets the value of "transition-timing-function" */
-  void set transitionTimingFunction(String value) {
+  set transitionTimingFunction(String value) {
     setProperty('transition-timing-function', value, '');
   }
 
@@ -7329,7 +8766,7 @@
     getPropertyValue('unicode-bidi');
 
   /** Sets the value of "unicode-bidi" */
-  void set unicodeBidi(String value) {
+  set unicodeBidi(String value) {
     setProperty('unicode-bidi', value, '');
   }
 
@@ -7338,7 +8775,7 @@
     getPropertyValue('unicode-range');
 
   /** Sets the value of "unicode-range" */
-  void set unicodeRange(String value) {
+  set unicodeRange(String value) {
     setProperty('unicode-range', value, '');
   }
 
@@ -7347,7 +8784,7 @@
     getPropertyValue('user-drag');
 
   /** Sets the value of "user-drag" */
-  void set userDrag(String value) {
+  set userDrag(String value) {
     setProperty('user-drag', value, '');
   }
 
@@ -7356,7 +8793,7 @@
     getPropertyValue('user-modify');
 
   /** Sets the value of "user-modify" */
-  void set userModify(String value) {
+  set userModify(String value) {
     setProperty('user-modify', value, '');
   }
 
@@ -7365,7 +8802,7 @@
     getPropertyValue('user-select');
 
   /** Sets the value of "user-select" */
-  void set userSelect(String value) {
+  set userSelect(String value) {
     setProperty('user-select', value, '');
   }
 
@@ -7374,7 +8811,7 @@
     getPropertyValue('user-zoom');
 
   /** Sets the value of "user-zoom" */
-  void set userZoom(String value) {
+  set userZoom(String value) {
     setProperty('user-zoom', value, '');
   }
 
@@ -7383,7 +8820,7 @@
     getPropertyValue('vertical-align');
 
   /** Sets the value of "vertical-align" */
-  void set verticalAlign(String value) {
+  set verticalAlign(String value) {
     setProperty('vertical-align', value, '');
   }
 
@@ -7392,7 +8829,7 @@
     getPropertyValue('visibility');
 
   /** Sets the value of "visibility" */
-  void set visibility(String value) {
+  set visibility(String value) {
     setProperty('visibility', value, '');
   }
 
@@ -7401,7 +8838,7 @@
     getPropertyValue('white-space');
 
   /** Sets the value of "white-space" */
-  void set whiteSpace(String value) {
+  set whiteSpace(String value) {
     setProperty('white-space', value, '');
   }
 
@@ -7410,7 +8847,7 @@
     getPropertyValue('widows');
 
   /** Sets the value of "widows" */
-  void set widows(String value) {
+  set widows(String value) {
     setProperty('widows', value, '');
   }
 
@@ -7419,7 +8856,7 @@
     getPropertyValue('width');
 
   /** Sets the value of "width" */
-  void set width(String value) {
+  set width(String value) {
     setProperty('width', value, '');
   }
 
@@ -7428,7 +8865,7 @@
     getPropertyValue('will-change');
 
   /** Sets the value of "will-change" */
-  void set willChange(String value) {
+  set willChange(String value) {
     setProperty('will-change', value, '');
   }
 
@@ -7437,7 +8874,7 @@
     getPropertyValue('word-break');
 
   /** Sets the value of "word-break" */
-  void set wordBreak(String value) {
+  set wordBreak(String value) {
     setProperty('word-break', value, '');
   }
 
@@ -7446,7 +8883,7 @@
     getPropertyValue('word-spacing');
 
   /** Sets the value of "word-spacing" */
-  void set wordSpacing(String value) {
+  set wordSpacing(String value) {
     setProperty('word-spacing', value, '');
   }
 
@@ -7455,7 +8892,7 @@
     getPropertyValue('word-wrap');
 
   /** Sets the value of "word-wrap" */
-  void set wordWrap(String value) {
+  set wordWrap(String value) {
     setProperty('word-wrap', value, '');
   }
 
@@ -7464,7 +8901,7 @@
     getPropertyValue('wrap-flow');
 
   /** Sets the value of "wrap-flow" */
-  void set wrapFlow(String value) {
+  set wrapFlow(String value) {
     setProperty('wrap-flow', value, '');
   }
 
@@ -7473,7 +8910,7 @@
     getPropertyValue('wrap-through');
 
   /** Sets the value of "wrap-through" */
-  void set wrapThrough(String value) {
+  set wrapThrough(String value) {
     setProperty('wrap-through', value, '');
   }
 
@@ -7482,7 +8919,7 @@
     getPropertyValue('writing-mode');
 
   /** Sets the value of "writing-mode" */
-  void set writingMode(String value) {
+  set writingMode(String value) {
     setProperty('writing-mode', value, '');
   }
 
@@ -7491,7 +8928,7 @@
     getPropertyValue('z-index');
 
   /** Sets the value of "z-index" */
-  void set zIndex(String value) {
+  set zIndex(String value) {
     setProperty('z-index', value, '');
   }
 
@@ -7500,7 +8937,7 @@
     getPropertyValue('zoom');
 
   /** Sets the value of "zoom" */
-  void set zoom(String value) {
+  set zoom(String value) {
     setProperty('zoom', value, '');
   }
 }
@@ -7517,13 +8954,27 @@
   // To suppress missing implicit constructor warnings.
   factory CssStyleRule._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static CssStyleRule internalCreateCssStyleRule() {
+    return new CssStyleRule._internalWrap();
+  }
+
+  factory CssStyleRule._internalWrap() {
+    return new CssStyleRule.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  CssStyleRule.internal_() : super.internal_();
+
+
   @DomName('CSSStyleRule.selectorText')
   @DocsEditable()
   String get selectorText => _blink.BlinkCSSStyleRule.instance.selectorText_Getter_(unwrap_jso(this));
   
   @DomName('CSSStyleRule.selectorText')
   @DocsEditable()
-  void set selectorText(String value) => _blink.BlinkCSSStyleRule.instance.selectorText_Setter_(unwrap_jso(this), value);
+  set selectorText(String value) => _blink.BlinkCSSStyleRule.instance.selectorText_Setter_(unwrap_jso(this), value);
   
   @DomName('CSSStyleRule.style')
   @DocsEditable()
@@ -7543,9 +8994,23 @@
   // To suppress missing implicit constructor warnings.
   factory CssStyleSheet._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static CssStyleSheet internalCreateCssStyleSheet() {
+    return new CssStyleSheet._internalWrap();
+  }
+
+  factory CssStyleSheet._internalWrap() {
+    return new CssStyleSheet.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  CssStyleSheet.internal_() : super.internal_();
+
+
   @DomName('CSSStyleSheet.cssRules')
   @DocsEditable()
-  List<CssRule> get cssRules => wrap_jso_list(_blink.BlinkCSSStyleSheet.instance.cssRules_Getter_(unwrap_jso(this)));
+  List<CssRule> get cssRules => wrap_jso(_blink.BlinkCSSStyleSheet.instance.cssRules_Getter_(unwrap_jso(this)));
   
   @DomName('CSSStyleSheet.ownerRule')
   @DocsEditable()
@@ -7554,7 +9019,7 @@
   @DomName('CSSStyleSheet.rules')
   @DocsEditable()
   @Experimental() // non-standard
-  List<CssRule> get rules => wrap_jso_list(_blink.BlinkCSSStyleSheet.instance.rules_Getter_(unwrap_jso(this)));
+  List<CssRule> get rules => wrap_jso(_blink.BlinkCSSStyleSheet.instance.rules_Getter_(unwrap_jso(this)));
   
   int addRule(String selector, String style, [int index]) {
     if (index != null) {
@@ -7593,13 +9058,27 @@
   // To suppress missing implicit constructor warnings.
   factory CssSupportsRule._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static CssSupportsRule internalCreateCssSupportsRule() {
+    return new CssSupportsRule._internalWrap();
+  }
+
+  factory CssSupportsRule._internalWrap() {
+    return new CssSupportsRule.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  CssSupportsRule.internal_() : super.internal_();
+
+
   @DomName('CSSSupportsRule.conditionText')
   @DocsEditable()
   String get conditionText => _blink.BlinkCSSSupportsRule.instance.conditionText_Getter_(unwrap_jso(this));
   
   @DomName('CSSSupportsRule.cssRules')
   @DocsEditable()
-  List<CssRule> get cssRules => wrap_jso_list(_blink.BlinkCSSSupportsRule.instance.cssRules_Getter_(unwrap_jso(this)));
+  List<CssRule> get cssRules => wrap_jso(_blink.BlinkCSSSupportsRule.instance.cssRules_Getter_(unwrap_jso(this)));
   
   @DomName('CSSSupportsRule.deleteRule')
   @DocsEditable()
@@ -7624,6 +9103,20 @@
   // To suppress missing implicit constructor warnings.
   factory CssViewportRule._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static CssViewportRule internalCreateCssViewportRule() {
+    return new CssViewportRule._internalWrap();
+  }
+
+  factory CssViewportRule._internalWrap() {
+    return new CssViewportRule.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  CssViewportRule.internal_() : super.internal_();
+
+
   @DomName('CSSViewportRule.style')
   @DocsEditable()
   @Experimental() // untriaged
@@ -7660,6 +9153,9 @@
       e._initCustomEvent(type, canBubble, cancelable, null);
     }
 
+    // Need for identity.
+    js.setDartHtmlWrapperFor(e.blink_jsObject, e);
+
     return e;
   }
 
@@ -7673,9 +9169,23 @@
   // To suppress missing implicit constructor warnings.
   factory CustomEvent._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static CustomEvent internalCreateCustomEvent() {
+    return new CustomEvent._internalWrap();
+  }
+
+  factory CustomEvent._internalWrap() {
+    return new CustomEvent.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  CustomEvent.internal_() : super.internal_();
+
+
   @DomName('CustomEvent.detail')
   @DocsEditable()
-  Object get _detail => _blink.BlinkCustomEvent.instance.detail_Getter_(unwrap_jso(this));
+  Object get _detail => wrap_jso(_blink.BlinkCustomEvent.instance.detail_Getter_(unwrap_jso(this)));
   
   @DomName('CustomEvent.initCustomEvent')
   @DocsEditable()
@@ -7698,6 +9208,20 @@
   @DomName('HTMLDListElement.HTMLDListElement')
   @DocsEditable()
   factory DListElement() => document.createElement("dl");
+
+
+  @Deprecated("Internal Use Only")
+  static DListElement internalCreateDListElement() {
+    return new DListElement._internalWrap();
+  }
+
+  factory DListElement._internalWrap() {
+    return new DListElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  DListElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -7726,6 +9250,20 @@
   @DomName('HTMLDataListElement.HTMLDataListElement')
   @DocsEditable()
   factory DataListElement() => document.createElement("datalist");
+
+
+  @Deprecated("Internal Use Only")
+  static DataListElement internalCreateDataListElement() {
+    return new DataListElement._internalWrap();
+  }
+
+  factory DataListElement._internalWrap() {
+    return new DataListElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  DataListElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -7738,7 +9276,7 @@
 
   @DomName('HTMLDataListElement.options')
   @DocsEditable()
-  List<Node> get options => wrap_jso_list(_blink.BlinkHTMLDataListElement.instance.options_Getter_(unwrap_jso(this)));
+  List<Node> get options => wrap_jso(_blink.BlinkHTMLDataListElement.instance.options_Getter_(unwrap_jso(this)));
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -7751,10 +9289,25 @@
 @DocsEditable()
 @DomName('DataTransfer')
 @Experimental() // untriaged
-class DataTransfer extends NativeFieldWrapperClass2 {
+class DataTransfer extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory DataTransfer._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static DataTransfer internalCreateDataTransfer() {
+    return new DataTransfer._internalWrap();
+  }
+
+  factory DataTransfer._internalWrap() {
+    return new DataTransfer.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  DataTransfer.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('DataTransfer.dropEffect')
   @DocsEditable()
   @Experimental() // untriaged
@@ -7763,7 +9316,7 @@
   @DomName('DataTransfer.dropEffect')
   @DocsEditable()
   @Experimental() // untriaged
-  void set dropEffect(String value) => _blink.BlinkDataTransfer.instance.dropEffect_Setter_(unwrap_jso(this), value);
+  set dropEffect(String value) => _blink.BlinkDataTransfer.instance.dropEffect_Setter_(unwrap_jso(this), value);
   
   @DomName('DataTransfer.effectAllowed')
   @DocsEditable()
@@ -7773,12 +9326,12 @@
   @DomName('DataTransfer.effectAllowed')
   @DocsEditable()
   @Experimental() // untriaged
-  void set effectAllowed(String value) => _blink.BlinkDataTransfer.instance.effectAllowed_Setter_(unwrap_jso(this), value);
+  set effectAllowed(String value) => _blink.BlinkDataTransfer.instance.effectAllowed_Setter_(unwrap_jso(this), value);
   
   @DomName('DataTransfer.files')
   @DocsEditable()
   @Experimental() // untriaged
-  List<File> get files => wrap_jso_list(_blink.BlinkDataTransfer.instance.files_Getter_(unwrap_jso(this)));
+  List<File> get files => wrap_jso(_blink.BlinkDataTransfer.instance.files_Getter_(unwrap_jso(this)));
   
   @DomName('DataTransfer.items')
   @DocsEditable()
@@ -7826,10 +9379,25 @@
 @DomName('DataTransferItem')
 // http://www.w3.org/TR/2011/WD-html5-20110113/dnd.html#the-datatransferitem-interface
 @Experimental()
-class DataTransferItem extends NativeFieldWrapperClass2 {
+class DataTransferItem extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory DataTransferItem._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static DataTransferItem internalCreateDataTransferItem() {
+    return new DataTransferItem._internalWrap();
+  }
+
+  factory DataTransferItem._internalWrap() {
+    return new DataTransferItem.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  DataTransferItem.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('DataTransferItem.kind')
   @DocsEditable()
   String get kind => _blink.BlinkDataTransferItem.instance.kind_Getter_(unwrap_jso(this));
@@ -7844,7 +9412,7 @@
   
   @DomName('DataTransferItem.getAsString')
   @DocsEditable()
-  void _getAsString(_StringCallback callback) => _blink.BlinkDataTransferItem.instance.getAsString_Callback_1_(unwrap_jso(this), unwrap_jso(callback));
+  void _getAsString(_StringCallback callback) => _blink.BlinkDataTransferItem.instance.getAsString_Callback_1_(unwrap_jso(this), unwrap_jso((data) => callback(data)));
   
   Future<String> getAsString() {
     var completer = new Completer<String>();
@@ -7870,10 +9438,25 @@
 @DomName('DataTransferItemList')
 // http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html#the-datatransferitemlist-interface
 @Experimental()
-class DataTransferItemList extends NativeFieldWrapperClass2 {
+class DataTransferItemList extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory DataTransferItemList._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static DataTransferItemList internalCreateDataTransferItemList() {
+    return new DataTransferItemList._internalWrap();
+  }
+
+  factory DataTransferItemList._internalWrap() {
+    return new DataTransferItemList.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  DataTransferItemList.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('DataTransferItemList.length')
   @DocsEditable()
   int get length => _blink.BlinkDataTransferItemList.instance.length_Getter_(unwrap_jso(this));
@@ -7912,7 +9495,10 @@
   
 
   DataTransferItem operator[] (int index) {
-    return __getter__(index);
+    // TODO(alanknight): I think that all the __getter__ generators should just
+    // do property access, but that's major surgery. This one is a problem, so
+    // just hard-code it for now.
+    return _blink.Blink_JsNative_DomException.getProperty(unwrap_jso(this), index);
   }
 
 }
@@ -7952,6 +9538,20 @@
   @Experimental() // untriaged
   static const EventStreamProvider<MessageEvent> messageEvent = const EventStreamProvider<MessageEvent>('message');
 
+
+  @Deprecated("Internal Use Only")
+  static DedicatedWorkerGlobalScope internalCreateDedicatedWorkerGlobalScope() {
+    return new DedicatedWorkerGlobalScope._internalWrap();
+  }
+
+  factory DedicatedWorkerGlobalScope._internalWrap() {
+    return new DedicatedWorkerGlobalScope.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  DedicatedWorkerGlobalScope.internal_() : super.internal_();
+
+
   @DomName('DedicatedWorkerGlobalScope.postMessage')
   @DocsEditable()
   @Experimental() // untriaged
@@ -7974,10 +9574,25 @@
 @DocsEditable()
 @DomName('DeprecatedStorageInfo')
 @Experimental() // untriaged
-class DeprecatedStorageInfo extends NativeFieldWrapperClass2 {
+class DeprecatedStorageInfo extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory DeprecatedStorageInfo._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static DeprecatedStorageInfo internalCreateDeprecatedStorageInfo() {
+    return new DeprecatedStorageInfo._internalWrap();
+  }
+
+  factory DeprecatedStorageInfo._internalWrap() {
+    return new DeprecatedStorageInfo.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  DeprecatedStorageInfo.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('DeprecatedStorageInfo.PERSISTENT')
   @DocsEditable()
   @Experimental() // untriaged
@@ -7990,11 +9605,11 @@
 
   void queryUsageAndQuota(int storageType, [StorageUsageCallback usageCallback, StorageErrorCallback errorCallback]) {
     if (errorCallback != null) {
-      _blink.BlinkDeprecatedStorageInfo.instance.queryUsageAndQuota_Callback_3_(unwrap_jso(this), storageType, unwrap_jso(usageCallback), unwrap_jso(errorCallback));
+      _blink.BlinkDeprecatedStorageInfo.instance.queryUsageAndQuota_Callback_3_(unwrap_jso(this), storageType, unwrap_jso((currentUsageInBytes, currentQuotaInBytes) => usageCallback(currentUsageInBytes, currentQuotaInBytes)), unwrap_jso((error) => errorCallback(wrap_jso(error))));
       return;
     }
     if (usageCallback != null) {
-      _blink.BlinkDeprecatedStorageInfo.instance.queryUsageAndQuota_Callback_2_(unwrap_jso(this), storageType, unwrap_jso(usageCallback));
+      _blink.BlinkDeprecatedStorageInfo.instance.queryUsageAndQuota_Callback_2_(unwrap_jso(this), storageType, unwrap_jso((currentUsageInBytes, currentQuotaInBytes) => usageCallback(currentUsageInBytes, currentQuotaInBytes)));
       return;
     }
     _blink.BlinkDeprecatedStorageInfo.instance.queryUsageAndQuota_Callback_1_(unwrap_jso(this), storageType);
@@ -8003,11 +9618,11 @@
 
   void requestQuota(int storageType, int newQuotaInBytes, [StorageQuotaCallback quotaCallback, StorageErrorCallback errorCallback]) {
     if (errorCallback != null) {
-      _blink.BlinkDeprecatedStorageInfo.instance.requestQuota_Callback_4_(unwrap_jso(this), storageType, newQuotaInBytes, unwrap_jso(quotaCallback), unwrap_jso(errorCallback));
+      _blink.BlinkDeprecatedStorageInfo.instance.requestQuota_Callback_4_(unwrap_jso(this), storageType, newQuotaInBytes, unwrap_jso((grantedQuotaInBytes) => quotaCallback(grantedQuotaInBytes)), unwrap_jso((error) => errorCallback(wrap_jso(error))));
       return;
     }
     if (quotaCallback != null) {
-      _blink.BlinkDeprecatedStorageInfo.instance.requestQuota_Callback_3_(unwrap_jso(this), storageType, newQuotaInBytes, unwrap_jso(quotaCallback));
+      _blink.BlinkDeprecatedStorageInfo.instance.requestQuota_Callback_3_(unwrap_jso(this), storageType, newQuotaInBytes, unwrap_jso((grantedQuotaInBytes) => quotaCallback(grantedQuotaInBytes)));
       return;
     }
     _blink.BlinkDeprecatedStorageInfo.instance.requestQuota_Callback_2_(unwrap_jso(this), storageType, newQuotaInBytes);
@@ -8025,26 +9640,41 @@
 @DocsEditable()
 @DomName('DeprecatedStorageQuota')
 @Experimental() // untriaged
-class DeprecatedStorageQuota extends NativeFieldWrapperClass2 {
+class DeprecatedStorageQuota extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory DeprecatedStorageQuota._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static DeprecatedStorageQuota internalCreateDeprecatedStorageQuota() {
+    return new DeprecatedStorageQuota._internalWrap();
+  }
+
+  factory DeprecatedStorageQuota._internalWrap() {
+    return new DeprecatedStorageQuota.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  DeprecatedStorageQuota.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   void queryUsageAndQuota(StorageUsageCallback usageCallback, [StorageErrorCallback errorCallback]) {
     if (errorCallback != null) {
-      _blink.BlinkDeprecatedStorageQuota.instance.queryUsageAndQuota_Callback_2_(unwrap_jso(this), unwrap_jso(usageCallback), unwrap_jso(errorCallback));
+      _blink.BlinkDeprecatedStorageQuota.instance.queryUsageAndQuota_Callback_2_(unwrap_jso(this), unwrap_jso((currentUsageInBytes, currentQuotaInBytes) => usageCallback(currentUsageInBytes, currentQuotaInBytes)), unwrap_jso((error) => errorCallback(wrap_jso(error))));
       return;
     }
-    _blink.BlinkDeprecatedStorageQuota.instance.queryUsageAndQuota_Callback_1_(unwrap_jso(this), unwrap_jso(usageCallback));
+    _blink.BlinkDeprecatedStorageQuota.instance.queryUsageAndQuota_Callback_1_(unwrap_jso(this), unwrap_jso((currentUsageInBytes, currentQuotaInBytes) => usageCallback(currentUsageInBytes, currentQuotaInBytes)));
     return;
   }
 
   void requestQuota(int newQuotaInBytes, [StorageQuotaCallback quotaCallback, StorageErrorCallback errorCallback]) {
     if (errorCallback != null) {
-      _blink.BlinkDeprecatedStorageQuota.instance.requestQuota_Callback_3_(unwrap_jso(this), newQuotaInBytes, unwrap_jso(quotaCallback), unwrap_jso(errorCallback));
+      _blink.BlinkDeprecatedStorageQuota.instance.requestQuota_Callback_3_(unwrap_jso(this), newQuotaInBytes, unwrap_jso((grantedQuotaInBytes) => quotaCallback(grantedQuotaInBytes)), unwrap_jso((error) => errorCallback(wrap_jso(error))));
       return;
     }
     if (quotaCallback != null) {
-      _blink.BlinkDeprecatedStorageQuota.instance.requestQuota_Callback_2_(unwrap_jso(this), newQuotaInBytes, unwrap_jso(quotaCallback));
+      _blink.BlinkDeprecatedStorageQuota.instance.requestQuota_Callback_2_(unwrap_jso(this), newQuotaInBytes, unwrap_jso((grantedQuotaInBytes) => quotaCallback(grantedQuotaInBytes)));
       return;
     }
     _blink.BlinkDeprecatedStorageQuota.instance.requestQuota_Callback_1_(unwrap_jso(this), newQuotaInBytes);
@@ -8071,6 +9701,20 @@
   @DomName('HTMLDetailsElement.HTMLDetailsElement')
   @DocsEditable()
   factory DetailsElement() => document.createElement("details");
+
+
+  @Deprecated("Internal Use Only")
+  static DetailsElement internalCreateDetailsElement() {
+    return new DetailsElement._internalWrap();
+  }
+
+  factory DetailsElement._internalWrap() {
+    return new DetailsElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  DetailsElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -8087,7 +9731,7 @@
   
   @DomName('HTMLDetailsElement.open')
   @DocsEditable()
-  void set open(bool value) => _blink.BlinkHTMLDetailsElement.instance.open_Setter_(unwrap_jso(this), value);
+  set open(bool value) => _blink.BlinkHTMLDetailsElement.instance.open_Setter_(unwrap_jso(this), value);
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -8101,21 +9745,36 @@
 @DomName('DeviceAcceleration')
 // http://dev.w3.org/geo/api/spec-source-orientation.html#devicemotion
 @Experimental()
-class DeviceAcceleration extends NativeFieldWrapperClass2 {
+class DeviceAcceleration extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory DeviceAcceleration._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static DeviceAcceleration internalCreateDeviceAcceleration() {
+    return new DeviceAcceleration._internalWrap();
+  }
+
+  factory DeviceAcceleration._internalWrap() {
+    return new DeviceAcceleration.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  DeviceAcceleration.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('DeviceAcceleration.x')
   @DocsEditable()
-  double get x => _blink.BlinkDeviceAcceleration.instance.x_Getter_(unwrap_jso(this));
+  num get x => _blink.BlinkDeviceAcceleration.instance.x_Getter_(unwrap_jso(this));
   
   @DomName('DeviceAcceleration.y')
   @DocsEditable()
-  double get y => _blink.BlinkDeviceAcceleration.instance.y_Getter_(unwrap_jso(this));
+  num get y => _blink.BlinkDeviceAcceleration.instance.y_Getter_(unwrap_jso(this));
   
   @DomName('DeviceAcceleration.z')
   @DocsEditable()
-  double get z => _blink.BlinkDeviceAcceleration.instance.z_Getter_(unwrap_jso(this));
+  num get z => _blink.BlinkDeviceAcceleration.instance.z_Getter_(unwrap_jso(this));
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -8132,10 +9791,24 @@
   // To suppress missing implicit constructor warnings.
   factory DeviceLightEvent._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static DeviceLightEvent internalCreateDeviceLightEvent() {
+    return new DeviceLightEvent._internalWrap();
+  }
+
+  factory DeviceLightEvent._internalWrap() {
+    return new DeviceLightEvent.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  DeviceLightEvent.internal_() : super.internal_();
+
+
   @DomName('DeviceLightEvent.value')
   @DocsEditable()
   @Experimental() // untriaged
-  double get value => _blink.BlinkDeviceLightEvent.instance.value_Getter_(unwrap_jso(this));
+  num get value => _blink.BlinkDeviceLightEvent.instance.value_Getter_(unwrap_jso(this));
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -8153,6 +9826,20 @@
   // To suppress missing implicit constructor warnings.
   factory DeviceMotionEvent._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static DeviceMotionEvent internalCreateDeviceMotionEvent() {
+    return new DeviceMotionEvent._internalWrap();
+  }
+
+  factory DeviceMotionEvent._internalWrap() {
+    return new DeviceMotionEvent.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  DeviceMotionEvent.internal_() : super.internal_();
+
+
   @DomName('DeviceMotionEvent.acceleration')
   @DocsEditable()
   DeviceAcceleration get acceleration => wrap_jso(_blink.BlinkDeviceMotionEvent.instance.acceleration_Getter_(unwrap_jso(this)));
@@ -8163,7 +9850,7 @@
   
   @DomName('DeviceMotionEvent.interval')
   @DocsEditable()
-  double get interval => _blink.BlinkDeviceMotionEvent.instance.interval_Getter_(unwrap_jso(this));
+  num get interval => _blink.BlinkDeviceMotionEvent.instance.interval_Getter_(unwrap_jso(this));
   
   @DomName('DeviceMotionEvent.rotationRate')
   @DocsEditable()
@@ -8196,21 +9883,35 @@
   // To suppress missing implicit constructor warnings.
   factory DeviceOrientationEvent._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static DeviceOrientationEvent internalCreateDeviceOrientationEvent() {
+    return new DeviceOrientationEvent._internalWrap();
+  }
+
+  factory DeviceOrientationEvent._internalWrap() {
+    return new DeviceOrientationEvent.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  DeviceOrientationEvent.internal_() : super.internal_();
+
+
   @DomName('DeviceOrientationEvent.absolute')
   @DocsEditable()
   bool get absolute => _blink.BlinkDeviceOrientationEvent.instance.absolute_Getter_(unwrap_jso(this));
   
   @DomName('DeviceOrientationEvent.alpha')
   @DocsEditable()
-  double get alpha => _blink.BlinkDeviceOrientationEvent.instance.alpha_Getter_(unwrap_jso(this));
+  num get alpha => _blink.BlinkDeviceOrientationEvent.instance.alpha_Getter_(unwrap_jso(this));
   
   @DomName('DeviceOrientationEvent.beta')
   @DocsEditable()
-  double get beta => _blink.BlinkDeviceOrientationEvent.instance.beta_Getter_(unwrap_jso(this));
+  num get beta => _blink.BlinkDeviceOrientationEvent.instance.beta_Getter_(unwrap_jso(this));
   
   @DomName('DeviceOrientationEvent.gamma')
   @DocsEditable()
-  double get gamma => _blink.BlinkDeviceOrientationEvent.instance.gamma_Getter_(unwrap_jso(this));
+  num get gamma => _blink.BlinkDeviceOrientationEvent.instance.gamma_Getter_(unwrap_jso(this));
   
   @DomName('DeviceOrientationEvent.initDeviceOrientationEvent')
   @DocsEditable()
@@ -8228,21 +9929,36 @@
 @DomName('DeviceRotationRate')
 // http://dev.w3.org/geo/api/spec-source-orientation.html#devicemotion
 @Experimental()
-class DeviceRotationRate extends NativeFieldWrapperClass2 {
+class DeviceRotationRate extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory DeviceRotationRate._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static DeviceRotationRate internalCreateDeviceRotationRate() {
+    return new DeviceRotationRate._internalWrap();
+  }
+
+  factory DeviceRotationRate._internalWrap() {
+    return new DeviceRotationRate.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  DeviceRotationRate.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('DeviceRotationRate.alpha')
   @DocsEditable()
-  double get alpha => _blink.BlinkDeviceRotationRate.instance.alpha_Getter_(unwrap_jso(this));
+  num get alpha => _blink.BlinkDeviceRotationRate.instance.alpha_Getter_(unwrap_jso(this));
   
   @DomName('DeviceRotationRate.beta')
   @DocsEditable()
-  double get beta => _blink.BlinkDeviceRotationRate.instance.beta_Getter_(unwrap_jso(this));
+  num get beta => _blink.BlinkDeviceRotationRate.instance.beta_Getter_(unwrap_jso(this));
   
   @DomName('DeviceRotationRate.gamma')
   @DocsEditable()
-  double get gamma => _blink.BlinkDeviceRotationRate.instance.gamma_Getter_(unwrap_jso(this));
+  num get gamma => _blink.BlinkDeviceRotationRate.instance.gamma_Getter_(unwrap_jso(this));
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -8258,6 +9974,20 @@
 class DialogElement extends HtmlElement {
   // To suppress missing implicit constructor warnings.
   factory DialogElement._() { throw new UnsupportedError("Not supported"); }
+
+
+  @Deprecated("Internal Use Only")
+  static DialogElement internalCreateDialogElement() {
+    return new DialogElement._internalWrap();
+  }
+
+  factory DialogElement._internalWrap() {
+    return new DialogElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  DialogElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -8271,7 +10001,7 @@
   
   @DomName('HTMLDialogElement.open')
   @DocsEditable()
-  void set open(bool value) => _blink.BlinkHTMLDialogElement.instance.open_Setter_(unwrap_jso(this), value);
+  set open(bool value) => _blink.BlinkHTMLDialogElement.instance.open_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLDialogElement.returnValue')
   @DocsEditable()
@@ -8281,7 +10011,7 @@
   @DomName('HTMLDialogElement.returnValue')
   @DocsEditable()
   @Experimental() // untriaged
-  void set returnValue(String value) => _blink.BlinkHTMLDialogElement.instance.returnValue_Setter_(unwrap_jso(this), value);
+  set returnValue(String value) => _blink.BlinkHTMLDialogElement.instance.returnValue_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLDialogElement.close')
   @DocsEditable()
@@ -8345,21 +10075,35 @@
   // To suppress missing implicit constructor warnings.
   factory DirectoryEntry._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static DirectoryEntry internalCreateDirectoryEntry() {
+    return new DirectoryEntry._internalWrap();
+  }
+
+  factory DirectoryEntry._internalWrap() {
+    return new DirectoryEntry.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  DirectoryEntry.internal_() : super.internal_();
+
+
   @DomName('DirectoryEntry.createReader')
   @DocsEditable()
   DirectoryReader createReader() => wrap_jso(_blink.BlinkDirectoryEntry.instance.createReader_Callback_0_(unwrap_jso(this)));
   
   void __getDirectory(String path, {Map options, _EntryCallback successCallback, _ErrorCallback errorCallback}) {
     if (errorCallback != null) {
-      _blink.BlinkDirectoryEntry.instance.getDirectory_Callback_4_(unwrap_jso(this), path, options, unwrap_jso(successCallback), unwrap_jso(errorCallback));
+      _blink.BlinkDirectoryEntry.instance.getDirectory_Callback_4_(unwrap_jso(this), path, convertDartToNative_Dictionary(options), unwrap_jso((entry) => successCallback(wrap_jso(entry))), unwrap_jso((error) => errorCallback(wrap_jso(error))));
       return;
     }
     if (successCallback != null) {
-      _blink.BlinkDirectoryEntry.instance.getDirectory_Callback_3_(unwrap_jso(this), path, options, unwrap_jso(successCallback));
+      _blink.BlinkDirectoryEntry.instance.getDirectory_Callback_3_(unwrap_jso(this), path, convertDartToNative_Dictionary(options), unwrap_jso((entry) => successCallback(wrap_jso(entry))));
       return;
     }
     if (options != null) {
-      _blink.BlinkDirectoryEntry.instance.getDirectory_Callback_2_(unwrap_jso(this), path, options);
+      _blink.BlinkDirectoryEntry.instance.getDirectory_Callback_2_(unwrap_jso(this), path, convertDartToNative_Dictionary(options));
       return;
     }
     _blink.BlinkDirectoryEntry.instance.getDirectory_Callback_1_(unwrap_jso(this), path);
@@ -8376,15 +10120,15 @@
 
   void __getFile(String path, {Map options, _EntryCallback successCallback, _ErrorCallback errorCallback}) {
     if (errorCallback != null) {
-      _blink.BlinkDirectoryEntry.instance.getFile_Callback_4_(unwrap_jso(this), path, options, unwrap_jso(successCallback), unwrap_jso(errorCallback));
+      _blink.BlinkDirectoryEntry.instance.getFile_Callback_4_(unwrap_jso(this), path, convertDartToNative_Dictionary(options), unwrap_jso((entry) => successCallback(wrap_jso(entry))), unwrap_jso((error) => errorCallback(wrap_jso(error))));
       return;
     }
     if (successCallback != null) {
-      _blink.BlinkDirectoryEntry.instance.getFile_Callback_3_(unwrap_jso(this), path, options, unwrap_jso(successCallback));
+      _blink.BlinkDirectoryEntry.instance.getFile_Callback_3_(unwrap_jso(this), path, convertDartToNative_Dictionary(options), unwrap_jso((entry) => successCallback(wrap_jso(entry))));
       return;
     }
     if (options != null) {
-      _blink.BlinkDirectoryEntry.instance.getFile_Callback_2_(unwrap_jso(this), path, options);
+      _blink.BlinkDirectoryEntry.instance.getFile_Callback_2_(unwrap_jso(this), path, convertDartToNative_Dictionary(options));
       return;
     }
     _blink.BlinkDirectoryEntry.instance.getFile_Callback_1_(unwrap_jso(this), path);
@@ -8401,10 +10145,10 @@
 
   void _removeRecursively(VoidCallback successCallback, [_ErrorCallback errorCallback]) {
     if (errorCallback != null) {
-      _blink.BlinkDirectoryEntry.instance.removeRecursively_Callback_2_(unwrap_jso(this), unwrap_jso(successCallback), unwrap_jso(errorCallback));
+      _blink.BlinkDirectoryEntry.instance.removeRecursively_Callback_2_(unwrap_jso(this), unwrap_jso(() => successCallback()), unwrap_jso((error) => errorCallback(wrap_jso(error))));
       return;
     }
-    _blink.BlinkDirectoryEntry.instance.removeRecursively_Callback_1_(unwrap_jso(this), unwrap_jso(successCallback));
+    _blink.BlinkDirectoryEntry.instance.removeRecursively_Callback_1_(unwrap_jso(this), unwrap_jso(() => successCallback()));
     return;
   }
 
@@ -8428,16 +10172,31 @@
 @DomName('DirectoryReader')
 // http://www.w3.org/TR/file-system-api/#the-directoryreader-interface
 @Experimental()
-class DirectoryReader extends NativeFieldWrapperClass2 {
+class DirectoryReader extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory DirectoryReader._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static DirectoryReader internalCreateDirectoryReader() {
+    return new DirectoryReader._internalWrap();
+  }
+
+  factory DirectoryReader._internalWrap() {
+    return new DirectoryReader.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  DirectoryReader.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   void _readEntries(_EntriesCallback successCallback, [_ErrorCallback errorCallback]) {
     if (errorCallback != null) {
-      _blink.BlinkDirectoryReader.instance.readEntries_Callback_2_(unwrap_jso(this), unwrap_jso(successCallback), unwrap_jso(errorCallback));
+      _blink.BlinkDirectoryReader.instance.readEntries_Callback_2_(unwrap_jso(this), unwrap_jso((entries) => successCallback(wrap_jso(entries))), unwrap_jso((error) => errorCallback(wrap_jso(error))));
       return;
     }
-    _blink.BlinkDirectoryReader.instance.readEntries_Callback_1_(unwrap_jso(this), unwrap_jso(successCallback));
+    _blink.BlinkDirectoryReader.instance.readEntries_Callback_1_(unwrap_jso(this), unwrap_jso((entries) => successCallback(wrap_jso(entries))));
     return;
   }
 
@@ -8488,6 +10247,20 @@
   @DomName('HTMLDivElement.HTMLDivElement')
   @DocsEditable()
   factory DivElement() => document.createElement("div");
+
+
+  @Deprecated("Internal Use Only")
+  static DivElement internalCreateDivElement() {
+    return new DivElement._internalWrap();
+  }
+
+  factory DivElement._internalWrap() {
+    return new DivElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  DivElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -8560,6 +10333,20 @@
   @DocsEditable()
   static const EventStreamProvider<Event> selectionChangeEvent = const EventStreamProvider<Event>('selectionchange');
 
+
+  @Deprecated("Internal Use Only")
+  static Document internalCreateDocument() {
+    return new Document._internalWrap();
+  }
+
+  factory Document._internalWrap() {
+    return new Document.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  Document.internal_() : super.internal_();
+
+
   @DomName('Document.activeElement')
   @DocsEditable()
   @Experimental() // untriaged
@@ -8571,7 +10358,7 @@
   
   @DomName('Document.body')
   @DocsEditable()
-  void set _body(HtmlElement value) => _blink.BlinkDocument.instance.body_Setter_(unwrap_jso(this), unwrap_jso(value));
+  set _body(HtmlElement value) => _blink.BlinkDocument.instance.body_Setter_(unwrap_jso(this), unwrap_jso(value));
   
   @DomName('Document.contentType')
   @DocsEditable()
@@ -8584,7 +10371,7 @@
   
   @DomName('Document.cookie')
   @DocsEditable()
-  void set cookie(String value) => _blink.BlinkDocument.instance.cookie_Setter_(unwrap_jso(this), value);
+  set cookie(String value) => _blink.BlinkDocument.instance.cookie_Setter_(unwrap_jso(this), value);
   
   @DomName('Document.currentScript')
   @DocsEditable()
@@ -8663,11 +10450,11 @@
   
   @DomName('Document.selectedStylesheetSet')
   @DocsEditable()
-  void set _selectedStylesheetSet(String value) => _blink.BlinkDocument.instance.selectedStylesheetSet_Setter_(unwrap_jso(this), value);
+  set _selectedStylesheetSet(String value) => _blink.BlinkDocument.instance.selectedStylesheetSet_Setter_(unwrap_jso(this), value);
   
   @DomName('Document.styleSheets')
   @DocsEditable()
-  List<StyleSheet> get _styleSheets => wrap_jso_list(_blink.BlinkDocument.instance.styleSheets_Getter_(unwrap_jso(this)));
+  List<StyleSheet> get _styleSheets => wrap_jso(_blink.BlinkDocument.instance.styleSheets_Getter_(unwrap_jso(this)));
   
   @DomName('Document.timeline')
   @DocsEditable()
@@ -8680,7 +10467,7 @@
   
   @DomName('Document.title')
   @DocsEditable()
-  void set _title(String value) => _blink.BlinkDocument.instance.title_Setter_(unwrap_jso(this), value);
+  set _title(String value) => _blink.BlinkDocument.instance.title_Setter_(unwrap_jso(this), value);
   
   @DomName('Document.visibilityState')
   @DocsEditable()
@@ -8739,7 +10526,7 @@
   
   @DomName('Document.createElementNS')
   @DocsEditable()
-  Element createElementNS(String namespaceURI, String qualifiedName, [String typeExtension]) => wrap_jso(_blink.BlinkDocument.instance.createElementNS_Callback_3_(unwrap_jso(this), namespaceURI, qualifiedName, typeExtension));
+  Element _createElementNS(String namespaceURI, String qualifiedName, [String typeExtension]) => wrap_jso(_blink.BlinkDocument.instance.createElementNS_Callback_3_(unwrap_jso(this), namespaceURI, qualifiedName, typeExtension));
   
   @DomName('Document.createEvent')
   @DocsEditable()
@@ -8809,15 +10596,15 @@
   
   @DomName('Document.getElementsByClassName')
   @DocsEditable()
-  List<Node> getElementsByClassName(String classNames) => wrap_jso_list(_blink.BlinkDocument.instance.getElementsByClassName_Callback_1_(unwrap_jso(this), classNames));
+  List<Node> getElementsByClassName(String classNames) => wrap_jso(_blink.BlinkDocument.instance.getElementsByClassName_Callback_1_(unwrap_jso(this), classNames));
   
   @DomName('Document.getElementsByName')
   @DocsEditable()
-  List<Node> getElementsByName(String elementName) => wrap_jso_list(_blink.BlinkDocument.instance.getElementsByName_Callback_1_(unwrap_jso(this), elementName));
+  List<Node> getElementsByName(String elementName) => wrap_jso(_blink.BlinkDocument.instance.getElementsByName_Callback_1_(unwrap_jso(this), elementName));
   
   @DomName('Document.getElementsByTagName')
   @DocsEditable()
-  List<Node> getElementsByTagName(String localName) => wrap_jso_list(_blink.BlinkDocument.instance.getElementsByTagName_Callback_1_(unwrap_jso(this), localName));
+  List<Node> getElementsByTagName(String localName) => wrap_jso(_blink.BlinkDocument.instance.getElementsByTagName_Callback_1_(unwrap_jso(this), localName));
   
   Node importNode(Node node, [bool deep]) {
     if (deep != null) {
@@ -8865,7 +10652,7 @@
   
   @DomName('Document.children')
   @DocsEditable()
-  List<Node> get _children => wrap_jso_list(_blink.BlinkDocument.instance.children_Getter_(unwrap_jso(this)));
+  List<Node> get _children => wrap_jso(_blink.BlinkDocument.instance.children_Getter_(unwrap_jso(this)));
   
   @DomName('Document.firstElementChild')
   @DocsEditable()
@@ -8898,7 +10685,7 @@
   
   @DomName('Document.querySelectorAll')
   @DocsEditable()
-  List<Node> _querySelectorAll(String selectors) => wrap_jso_list(_blink.BlinkDocument.instance.querySelectorAll_Callback_1_(unwrap_jso(this), selectors));
+  List<Node> _querySelectorAll(String selectors) => wrap_jso(_blink.BlinkDocument.instance.querySelectorAll_Callback_1_(unwrap_jso(this), selectors));
   
   /// Stream of `abort` events handled by this [Document].
   @DomName('Document.onabort')
@@ -9323,12 +11110,47 @@
 
   @DomName('Document.createElement')
   Element createElement(String tagName, [String typeExtension]) {
-    if (typeExtension != null) {  
-      return _createElement(tagName, typeExtension);  
-    } else {  
-      // Fast-path for Dartium when typeExtension is not needed.  
-      return _Utils.createElement(this, tagName); 
-    } 
+    var newElement = (typeExtension == null) ?
+      _blink.BlinkDocument.instance.createElement_Callback_1_(unwrap_jso(this), tagName) :
+      _blink.BlinkDocument.instance.createElement_Callback_2_(unwrap_jso(this), tagName, typeExtension);
+
+    var wrapped = js.getDartHtmlWrapperFor(newElement);  // Here's our Dart class.
+    if (wrapped != null) {
+      wrapped.blink_jsObject = newElement;
+    } else {
+      wrapped = wrap_jso(newElement);
+      if (wrapped == null) {
+        wrapped = wrap_jso_custom_element(newElement);
+      } else {
+        js.setDartHtmlWrapperFor(wrapped.blink_jsObject, wrapped);
+      }
+    }
+
+    return wrapped;
+  }
+
+  @DomName('Document.createElementNS')
+  @DocsEditable()
+  Element createElementNS(String namespaceURI, String qualifiedName, [String typeExtension]) {
+    var newElement = (typeExtension == null) ?
+      _blink.BlinkDocument.instance.createElementNS_Callback_2_(unwrap_jso(this), namespaceURI, qualifiedName) :
+      _blink.BlinkDocument.instance.createElementNS_Callback_3_(unwrap_jso(this), namespaceURI, qualifiedName, typeExtension);
+
+    var wrapped;
+
+    wrapped = js.getDartHtmlWrapperFor(newElement);  // Here's our Dart class.
+    if (wrapped != null) {
+      wrapped.blink_jsObject = newElement;
+    } else {
+      wrapped = wrap_jso(newElement);
+      if (wrapped == null) {
+        wrapped = wrap_jso_custom_element(newElement);
+      } else {
+        js.setDartHtmlWrapperFor(wrapped.blink_jsObject, wrapped);  // Here's our Dart class.
+      }
+    }
+
+    return wrapped;
   }
 
 }
@@ -9367,7 +11189,7 @@
     return _docChildren;
   }
 
-  void set children(List<Element> value) {
+  set children(List<Element> value) {
     // Copy list first since we don't want liveness during iteration.
     List copy = new List.from(value);
     var children = this.children;
@@ -9389,14 +11211,13 @@
   ElementList<Element> querySelectorAll(String selectors) =>
     new _FrozenElementList._wrap(_querySelectorAll(selectors));
 
-
   String get innerHtml {
     final e = new Element.tag("div");
     e.append(this.clone(true));
     return e.innerHtml;
   }
 
-  void set innerHtml(String value) {
+  set innerHtml(String value) {
     this.setInnerHtml(value);
   }
 
@@ -9451,6 +11272,20 @@
   // To suppress missing implicit constructor warnings.
   factory DocumentFragment._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static DocumentFragment internalCreateDocumentFragment() {
+    return new DocumentFragment._internalWrap();
+  }
+
+  factory DocumentFragment._internalWrap() {
+    return new DocumentFragment.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  DocumentFragment.internal_() : super.internal_();
+
+
   @DomName('DocumentFragment.getElementById')
   @DocsEditable()
   @Experimental() // untriaged
@@ -9486,7 +11321,7 @@
   
   @DomName('DocumentFragment.querySelectorAll')
   @DocsEditable()
-  List<Node> _querySelectorAll(String selectors) => wrap_jso_list(_blink.BlinkDocumentFragment.instance.querySelectorAll_Callback_1_(unwrap_jso(this), selectors));
+  List<Node> _querySelectorAll(String selectors) => wrap_jso(_blink.BlinkDocumentFragment.instance.querySelectorAll_Callback_1_(unwrap_jso(this), selectors));
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -9498,16 +11333,31 @@
 
 @DocsEditable()
 @DomName('DOMError')
-class DomError extends NativeFieldWrapperClass2 {
+class DomError extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory DomError._() { throw new UnsupportedError("Not supported"); }
 
   @DomName('DOMError.DOMError')
   @DocsEditable()
   factory DomError(String name, [String message]) {
-    return _blink.BlinkDOMError.instance.constructorCallback_2_(name, message);
+    return wrap_jso(_blink.BlinkDOMError.instance.constructorCallback_2_(name, message));
   }
 
+  @Deprecated("Internal Use Only")
+  static DomError internalCreateDomError() {
+    return new DomError._internalWrap();
+  }
+
+  factory DomError._internalWrap() {
+    return new DomError.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  DomError.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('DOMError.message')
   @DocsEditable()
   @Experimental() // untriaged
@@ -9525,7 +11375,7 @@
 
 @DomName('DOMException')
 @Unstable()
-class DomException extends NativeFieldWrapperClass2 {
+class DomException extends DartHtmlDomObject {
 
   static const String INDEX_SIZE = 'IndexSizeError';
   static const String HIERARCHY_REQUEST = 'HierarchyRequestError';
@@ -9549,21 +11399,51 @@
   static const String INVALID_NODE_TYPE = 'InvalidNodeTypeError';
   static const String DATA_CLONE = 'DataCloneError';
 
+  String _name;
+  String _message;
+
   // To suppress missing implicit constructor warnings.
   factory DomException._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static DomException internalCreateDomException() {
+    return new DomException._internalWrap();
+  }
+
+  @Deprecated("Internal Use Only")
+  js.JsObject blink_jsObject;
+
+  factory DomException._internalWrap() {
+    return new DomException.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  DomException.internal_() { }
+
+  @Deprecated("Internal Use Only")
+  DomException.jsInterop(String m) {
+    var name_index = m.indexOf(': ');
+    if (name_index < 0) {
+      _name = "";
+      _message = m;
+    } else {
+      _name = m.substring(0, name_index);
+      _message = m.substring(name_index + 1).trim();
+    }
+  }
+
   @DomName('DOMException.message')
   @DocsEditable()
-  String get message => _blink.BlinkDOMException.instance.message_Getter_(unwrap_jso(this));
-  
+  String get message => _message;
+
   @DomName('DOMException.name')
   @DocsEditable()
-  String get name => _blink.BlinkDOMException.instance.name_Getter_(unwrap_jso(this));
-  
+  String get name => _name;
+
   @DomName('DOMException.toString')
   @DocsEditable()
-  String toString() => _blink.BlinkDOMException.instance.toString_Callback_0_(unwrap_jso(this));
-  
+  String toString() => "${_name}: $_message";
+
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -9574,17 +11454,32 @@
 
 @DocsEditable()
 @DomName('DOMImplementation')
-class DomImplementation extends NativeFieldWrapperClass2 {
+class DomImplementation extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory DomImplementation._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static DomImplementation internalCreateDomImplementation() {
+    return new DomImplementation._internalWrap();
+  }
+
+  factory DomImplementation._internalWrap() {
+    return new DomImplementation.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  DomImplementation.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('DOMImplementation.createDocument')
   @DocsEditable()
-  XmlDocument createDocument(String namespaceURI, String qualifiedName, _DocumentType doctype) => _blink.BlinkDOMImplementation.instance.createDocument_Callback_3_(unwrap_jso(this), namespaceURI, qualifiedName, unwrap_jso(doctype));
+  XmlDocument createDocument(String namespaceURI, String qualifiedName, _DocumentType doctype) => wrap_jso(_blink.BlinkDOMImplementation.instance.createDocument_Callback_3_(unwrap_jso(this), namespaceURI, qualifiedName, unwrap_jso(doctype)));
   
   @DomName('DOMImplementation.createDocumentType')
   @DocsEditable()
-  _DocumentType createDocumentType(String qualifiedName, String publicId, String systemId) => _blink.BlinkDOMImplementation.instance.createDocumentType_Callback_3_(unwrap_jso(this), qualifiedName, publicId, systemId);
+  _DocumentType createDocumentType(String qualifiedName, String publicId, String systemId) => wrap_jso(_blink.BlinkDOMImplementation.instance.createDocumentType_Callback_3_(unwrap_jso(this), qualifiedName, publicId, systemId));
   
   @DomName('DOMImplementation.createHTMLDocument')
   @DocsEditable()
@@ -9605,15 +11500,30 @@
 @DocsEditable()
 @DomName('Iterator')
 @Experimental() // untriaged
-class DomIterator extends NativeFieldWrapperClass2 {
+class DomIterator extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory DomIterator._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static DomIterator internalCreateDomIterator() {
+    return new DomIterator._internalWrap();
+  }
+
+  factory DomIterator._internalWrap() {
+    return new DomIterator.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  DomIterator.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   Object next([Object value]) {
     if (value != null) {
-      return _blink.BlinkIterator.instance.next_Callback_1_(unwrap_jso(this), value);
+      return wrap_jso(_blink.BlinkIterator.instance.next_Callback_1_(unwrap_jso(this), value));
     }
-    return _blink.BlinkIterator.instance.next_Callback_0_(unwrap_jso(this));
+    return wrap_jso(_blink.BlinkIterator.instance.next_Callback_0_(unwrap_jso(this)));
   }
 
 }
@@ -9635,14 +11545,28 @@
   @DocsEditable()
   factory DomMatrix([DomMatrixReadOnly other]) {
     if (other == null) {
-      return _blink.BlinkDOMMatrix.instance.constructorCallback_0_();
+      return wrap_jso(_blink.BlinkDOMMatrix.instance.constructorCallback_0_());
     }
     if ((other is DomMatrixReadOnly || other == null)) {
-      return _blink.BlinkDOMMatrix.instance.constructorCallback_1_(other);
+      return wrap_jso(_blink.BlinkDOMMatrix.instance.constructorCallback_1_(other));
     }
     throw new ArgumentError("Incorrect number or type of arguments");
   }
 
+
+  @Deprecated("Internal Use Only")
+  static DomMatrix internalCreateDomMatrix() {
+    return new DomMatrix._internalWrap();
+  }
+
+  factory DomMatrix._internalWrap() {
+    return new DomMatrix.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  DomMatrix.internal_() : super.internal_();
+
+
   @DomName('DOMMatrix.a')
   @DocsEditable()
   @Experimental() // untriaged
@@ -9651,7 +11575,7 @@
   @DomName('DOMMatrix.a')
   @DocsEditable()
   @Experimental() // untriaged
-  void set a(num value) => _blink.BlinkDOMMatrix.instance.a_Setter_(unwrap_jso(this), value);
+  set a(num value) => _blink.BlinkDOMMatrix.instance.a_Setter_(unwrap_jso(this), value);
   
   @DomName('DOMMatrix.b')
   @DocsEditable()
@@ -9661,7 +11585,7 @@
   @DomName('DOMMatrix.b')
   @DocsEditable()
   @Experimental() // untriaged
-  void set b(num value) => _blink.BlinkDOMMatrix.instance.b_Setter_(unwrap_jso(this), value);
+  set b(num value) => _blink.BlinkDOMMatrix.instance.b_Setter_(unwrap_jso(this), value);
   
   @DomName('DOMMatrix.c')
   @DocsEditable()
@@ -9671,7 +11595,7 @@
   @DomName('DOMMatrix.c')
   @DocsEditable()
   @Experimental() // untriaged
-  void set c(num value) => _blink.BlinkDOMMatrix.instance.c_Setter_(unwrap_jso(this), value);
+  set c(num value) => _blink.BlinkDOMMatrix.instance.c_Setter_(unwrap_jso(this), value);
   
   @DomName('DOMMatrix.d')
   @DocsEditable()
@@ -9681,7 +11605,7 @@
   @DomName('DOMMatrix.d')
   @DocsEditable()
   @Experimental() // untriaged
-  void set d(num value) => _blink.BlinkDOMMatrix.instance.d_Setter_(unwrap_jso(this), value);
+  set d(num value) => _blink.BlinkDOMMatrix.instance.d_Setter_(unwrap_jso(this), value);
   
   @DomName('DOMMatrix.e')
   @DocsEditable()
@@ -9691,7 +11615,7 @@
   @DomName('DOMMatrix.e')
   @DocsEditable()
   @Experimental() // untriaged
-  void set e(num value) => _blink.BlinkDOMMatrix.instance.e_Setter_(unwrap_jso(this), value);
+  set e(num value) => _blink.BlinkDOMMatrix.instance.e_Setter_(unwrap_jso(this), value);
   
   @DomName('DOMMatrix.f')
   @DocsEditable()
@@ -9701,7 +11625,7 @@
   @DomName('DOMMatrix.f')
   @DocsEditable()
   @Experimental() // untriaged
-  void set f(num value) => _blink.BlinkDOMMatrix.instance.f_Setter_(unwrap_jso(this), value);
+  set f(num value) => _blink.BlinkDOMMatrix.instance.f_Setter_(unwrap_jso(this), value);
   
   @DomName('DOMMatrix.m11')
   @DocsEditable()
@@ -9711,7 +11635,7 @@
   @DomName('DOMMatrix.m11')
   @DocsEditable()
   @Experimental() // untriaged
-  void set m11(num value) => _blink.BlinkDOMMatrix.instance.m11_Setter_(unwrap_jso(this), value);
+  set m11(num value) => _blink.BlinkDOMMatrix.instance.m11_Setter_(unwrap_jso(this), value);
   
   @DomName('DOMMatrix.m12')
   @DocsEditable()
@@ -9721,7 +11645,7 @@
   @DomName('DOMMatrix.m12')
   @DocsEditable()
   @Experimental() // untriaged
-  void set m12(num value) => _blink.BlinkDOMMatrix.instance.m12_Setter_(unwrap_jso(this), value);
+  set m12(num value) => _blink.BlinkDOMMatrix.instance.m12_Setter_(unwrap_jso(this), value);
   
   @DomName('DOMMatrix.m13')
   @DocsEditable()
@@ -9731,7 +11655,7 @@
   @DomName('DOMMatrix.m13')
   @DocsEditable()
   @Experimental() // untriaged
-  void set m13(num value) => _blink.BlinkDOMMatrix.instance.m13_Setter_(unwrap_jso(this), value);
+  set m13(num value) => _blink.BlinkDOMMatrix.instance.m13_Setter_(unwrap_jso(this), value);
   
   @DomName('DOMMatrix.m14')
   @DocsEditable()
@@ -9741,7 +11665,7 @@
   @DomName('DOMMatrix.m14')
   @DocsEditable()
   @Experimental() // untriaged
-  void set m14(num value) => _blink.BlinkDOMMatrix.instance.m14_Setter_(unwrap_jso(this), value);
+  set m14(num value) => _blink.BlinkDOMMatrix.instance.m14_Setter_(unwrap_jso(this), value);
   
   @DomName('DOMMatrix.m21')
   @DocsEditable()
@@ -9751,7 +11675,7 @@
   @DomName('DOMMatrix.m21')
   @DocsEditable()
   @Experimental() // untriaged
-  void set m21(num value) => _blink.BlinkDOMMatrix.instance.m21_Setter_(unwrap_jso(this), value);
+  set m21(num value) => _blink.BlinkDOMMatrix.instance.m21_Setter_(unwrap_jso(this), value);
   
   @DomName('DOMMatrix.m22')
   @DocsEditable()
@@ -9761,7 +11685,7 @@
   @DomName('DOMMatrix.m22')
   @DocsEditable()
   @Experimental() // untriaged
-  void set m22(num value) => _blink.BlinkDOMMatrix.instance.m22_Setter_(unwrap_jso(this), value);
+  set m22(num value) => _blink.BlinkDOMMatrix.instance.m22_Setter_(unwrap_jso(this), value);
   
   @DomName('DOMMatrix.m23')
   @DocsEditable()
@@ -9771,7 +11695,7 @@
   @DomName('DOMMatrix.m23')
   @DocsEditable()
   @Experimental() // untriaged
-  void set m23(num value) => _blink.BlinkDOMMatrix.instance.m23_Setter_(unwrap_jso(this), value);
+  set m23(num value) => _blink.BlinkDOMMatrix.instance.m23_Setter_(unwrap_jso(this), value);
   
   @DomName('DOMMatrix.m24')
   @DocsEditable()
@@ -9781,7 +11705,7 @@
   @DomName('DOMMatrix.m24')
   @DocsEditable()
   @Experimental() // untriaged
-  void set m24(num value) => _blink.BlinkDOMMatrix.instance.m24_Setter_(unwrap_jso(this), value);
+  set m24(num value) => _blink.BlinkDOMMatrix.instance.m24_Setter_(unwrap_jso(this), value);
   
   @DomName('DOMMatrix.m31')
   @DocsEditable()
@@ -9791,7 +11715,7 @@
   @DomName('DOMMatrix.m31')
   @DocsEditable()
   @Experimental() // untriaged
-  void set m31(num value) => _blink.BlinkDOMMatrix.instance.m31_Setter_(unwrap_jso(this), value);
+  set m31(num value) => _blink.BlinkDOMMatrix.instance.m31_Setter_(unwrap_jso(this), value);
   
   @DomName('DOMMatrix.m32')
   @DocsEditable()
@@ -9801,7 +11725,7 @@
   @DomName('DOMMatrix.m32')
   @DocsEditable()
   @Experimental() // untriaged
-  void set m32(num value) => _blink.BlinkDOMMatrix.instance.m32_Setter_(unwrap_jso(this), value);
+  set m32(num value) => _blink.BlinkDOMMatrix.instance.m32_Setter_(unwrap_jso(this), value);
   
   @DomName('DOMMatrix.m33')
   @DocsEditable()
@@ -9811,7 +11735,7 @@
   @DomName('DOMMatrix.m33')
   @DocsEditable()
   @Experimental() // untriaged
-  void set m33(num value) => _blink.BlinkDOMMatrix.instance.m33_Setter_(unwrap_jso(this), value);
+  set m33(num value) => _blink.BlinkDOMMatrix.instance.m33_Setter_(unwrap_jso(this), value);
   
   @DomName('DOMMatrix.m34')
   @DocsEditable()
@@ -9821,7 +11745,7 @@
   @DomName('DOMMatrix.m34')
   @DocsEditable()
   @Experimental() // untriaged
-  void set m34(num value) => _blink.BlinkDOMMatrix.instance.m34_Setter_(unwrap_jso(this), value);
+  set m34(num value) => _blink.BlinkDOMMatrix.instance.m34_Setter_(unwrap_jso(this), value);
   
   @DomName('DOMMatrix.m41')
   @DocsEditable()
@@ -9831,7 +11755,7 @@
   @DomName('DOMMatrix.m41')
   @DocsEditable()
   @Experimental() // untriaged
-  void set m41(num value) => _blink.BlinkDOMMatrix.instance.m41_Setter_(unwrap_jso(this), value);
+  set m41(num value) => _blink.BlinkDOMMatrix.instance.m41_Setter_(unwrap_jso(this), value);
   
   @DomName('DOMMatrix.m42')
   @DocsEditable()
@@ -9841,7 +11765,7 @@
   @DomName('DOMMatrix.m42')
   @DocsEditable()
   @Experimental() // untriaged
-  void set m42(num value) => _blink.BlinkDOMMatrix.instance.m42_Setter_(unwrap_jso(this), value);
+  set m42(num value) => _blink.BlinkDOMMatrix.instance.m42_Setter_(unwrap_jso(this), value);
   
   @DomName('DOMMatrix.m43')
   @DocsEditable()
@@ -9851,7 +11775,7 @@
   @DomName('DOMMatrix.m43')
   @DocsEditable()
   @Experimental() // untriaged
-  void set m43(num value) => _blink.BlinkDOMMatrix.instance.m43_Setter_(unwrap_jso(this), value);
+  set m43(num value) => _blink.BlinkDOMMatrix.instance.m43_Setter_(unwrap_jso(this), value);
   
   @DomName('DOMMatrix.m44')
   @DocsEditable()
@@ -9861,65 +11785,65 @@
   @DomName('DOMMatrix.m44')
   @DocsEditable()
   @Experimental() // untriaged
-  void set m44(num value) => _blink.BlinkDOMMatrix.instance.m44_Setter_(unwrap_jso(this), value);
+  set m44(num value) => _blink.BlinkDOMMatrix.instance.m44_Setter_(unwrap_jso(this), value);
   
   @DomName('DOMMatrix.multiplySelf')
   @DocsEditable()
   @Experimental() // untriaged
-  DomMatrix multiplySelf(DomMatrix other) => _blink.BlinkDOMMatrix.instance.multiplySelf_Callback_1_(unwrap_jso(this), unwrap_jso(other));
+  DomMatrix multiplySelf(DomMatrix other) => wrap_jso(_blink.BlinkDOMMatrix.instance.multiplySelf_Callback_1_(unwrap_jso(this), unwrap_jso(other)));
   
   @DomName('DOMMatrix.preMultiplySelf')
   @DocsEditable()
   @Experimental() // untriaged
-  DomMatrix preMultiplySelf(DomMatrix other) => _blink.BlinkDOMMatrix.instance.preMultiplySelf_Callback_1_(unwrap_jso(this), unwrap_jso(other));
+  DomMatrix preMultiplySelf(DomMatrix other) => wrap_jso(_blink.BlinkDOMMatrix.instance.preMultiplySelf_Callback_1_(unwrap_jso(this), unwrap_jso(other)));
   
   DomMatrix scale3dSelf(num scale, [num ox, num oy, num oz]) {
     if (oz != null) {
-      return _blink.BlinkDOMMatrix.instance.scale3dSelf_Callback_4_(unwrap_jso(this), scale, ox, oy, oz);
+      return wrap_jso(_blink.BlinkDOMMatrix.instance.scale3dSelf_Callback_4_(unwrap_jso(this), scale, ox, oy, oz));
     }
     if (oy != null) {
-      return _blink.BlinkDOMMatrix.instance.scale3dSelf_Callback_3_(unwrap_jso(this), scale, ox, oy);
+      return wrap_jso(_blink.BlinkDOMMatrix.instance.scale3dSelf_Callback_3_(unwrap_jso(this), scale, ox, oy));
     }
     if (ox != null) {
-      return _blink.BlinkDOMMatrix.instance.scale3dSelf_Callback_2_(unwrap_jso(this), scale, ox);
+      return wrap_jso(_blink.BlinkDOMMatrix.instance.scale3dSelf_Callback_2_(unwrap_jso(this), scale, ox));
     }
-    return _blink.BlinkDOMMatrix.instance.scale3dSelf_Callback_1_(unwrap_jso(this), scale);
+    return wrap_jso(_blink.BlinkDOMMatrix.instance.scale3dSelf_Callback_1_(unwrap_jso(this), scale));
   }
 
   DomMatrix scaleNonUniformSelf(num sx, [num sy, num sz, num ox, num oy, num oz]) {
     if (oz != null) {
-      return _blink.BlinkDOMMatrix.instance.scaleNonUniformSelf_Callback_6_(unwrap_jso(this), sx, sy, sz, ox, oy, oz);
+      return wrap_jso(_blink.BlinkDOMMatrix.instance.scaleNonUniformSelf_Callback_6_(unwrap_jso(this), sx, sy, sz, ox, oy, oz));
     }
     if (oy != null) {
-      return _blink.BlinkDOMMatrix.instance.scaleNonUniformSelf_Callback_5_(unwrap_jso(this), sx, sy, sz, ox, oy);
+      return wrap_jso(_blink.BlinkDOMMatrix.instance.scaleNonUniformSelf_Callback_5_(unwrap_jso(this), sx, sy, sz, ox, oy));
     }
     if (ox != null) {
-      return _blink.BlinkDOMMatrix.instance.scaleNonUniformSelf_Callback_4_(unwrap_jso(this), sx, sy, sz, ox);
+      return wrap_jso(_blink.BlinkDOMMatrix.instance.scaleNonUniformSelf_Callback_4_(unwrap_jso(this), sx, sy, sz, ox));
     }
     if (sz != null) {
-      return _blink.BlinkDOMMatrix.instance.scaleNonUniformSelf_Callback_3_(unwrap_jso(this), sx, sy, sz);
+      return wrap_jso(_blink.BlinkDOMMatrix.instance.scaleNonUniformSelf_Callback_3_(unwrap_jso(this), sx, sy, sz));
     }
     if (sy != null) {
-      return _blink.BlinkDOMMatrix.instance.scaleNonUniformSelf_Callback_2_(unwrap_jso(this), sx, sy);
+      return wrap_jso(_blink.BlinkDOMMatrix.instance.scaleNonUniformSelf_Callback_2_(unwrap_jso(this), sx, sy));
     }
-    return _blink.BlinkDOMMatrix.instance.scaleNonUniformSelf_Callback_1_(unwrap_jso(this), sx);
+    return wrap_jso(_blink.BlinkDOMMatrix.instance.scaleNonUniformSelf_Callback_1_(unwrap_jso(this), sx));
   }
 
   DomMatrix scaleSelf(num scale, [num ox, num oy]) {
     if (oy != null) {
-      return _blink.BlinkDOMMatrix.instance.scaleSelf_Callback_3_(unwrap_jso(this), scale, ox, oy);
+      return wrap_jso(_blink.BlinkDOMMatrix.instance.scaleSelf_Callback_3_(unwrap_jso(this), scale, ox, oy));
     }
     if (ox != null) {
-      return _blink.BlinkDOMMatrix.instance.scaleSelf_Callback_2_(unwrap_jso(this), scale, ox);
+      return wrap_jso(_blink.BlinkDOMMatrix.instance.scaleSelf_Callback_2_(unwrap_jso(this), scale, ox));
     }
-    return _blink.BlinkDOMMatrix.instance.scaleSelf_Callback_1_(unwrap_jso(this), scale);
+    return wrap_jso(_blink.BlinkDOMMatrix.instance.scaleSelf_Callback_1_(unwrap_jso(this), scale));
   }
 
   DomMatrix translateSelf(num tx, num ty, [num tz]) {
     if (tz != null) {
-      return _blink.BlinkDOMMatrix.instance.translateSelf_Callback_3_(unwrap_jso(this), tx, ty, tz);
+      return wrap_jso(_blink.BlinkDOMMatrix.instance.translateSelf_Callback_3_(unwrap_jso(this), tx, ty, tz));
     }
-    return _blink.BlinkDOMMatrix.instance.translateSelf_Callback_2_(unwrap_jso(this), tx, ty);
+    return wrap_jso(_blink.BlinkDOMMatrix.instance.translateSelf_Callback_2_(unwrap_jso(this), tx, ty));
   }
 
 }
@@ -9933,39 +11857,54 @@
 @DocsEditable()
 @DomName('DOMMatrixReadOnly')
 @Experimental() // untriaged
-class DomMatrixReadOnly extends NativeFieldWrapperClass2 {
+class DomMatrixReadOnly extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory DomMatrixReadOnly._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static DomMatrixReadOnly internalCreateDomMatrixReadOnly() {
+    return new DomMatrixReadOnly._internalWrap();
+  }
+
+  factory DomMatrixReadOnly._internalWrap() {
+    return new DomMatrixReadOnly.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  DomMatrixReadOnly.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('DOMMatrixReadOnly.a')
   @DocsEditable()
   @Experimental() // untriaged
-  double get a => _blink.BlinkDOMMatrixReadOnly.instance.a_Getter_(unwrap_jso(this));
+  num get a => _blink.BlinkDOMMatrixReadOnly.instance.a_Getter_(unwrap_jso(this));
   
   @DomName('DOMMatrixReadOnly.b')
   @DocsEditable()
   @Experimental() // untriaged
-  double get b => _blink.BlinkDOMMatrixReadOnly.instance.b_Getter_(unwrap_jso(this));
+  num get b => _blink.BlinkDOMMatrixReadOnly.instance.b_Getter_(unwrap_jso(this));
   
   @DomName('DOMMatrixReadOnly.c')
   @DocsEditable()
   @Experimental() // untriaged
-  double get c => _blink.BlinkDOMMatrixReadOnly.instance.c_Getter_(unwrap_jso(this));
+  num get c => _blink.BlinkDOMMatrixReadOnly.instance.c_Getter_(unwrap_jso(this));
   
   @DomName('DOMMatrixReadOnly.d')
   @DocsEditable()
   @Experimental() // untriaged
-  double get d => _blink.BlinkDOMMatrixReadOnly.instance.d_Getter_(unwrap_jso(this));
+  num get d => _blink.BlinkDOMMatrixReadOnly.instance.d_Getter_(unwrap_jso(this));
   
   @DomName('DOMMatrixReadOnly.e')
   @DocsEditable()
   @Experimental() // untriaged
-  double get e => _blink.BlinkDOMMatrixReadOnly.instance.e_Getter_(unwrap_jso(this));
+  num get e => _blink.BlinkDOMMatrixReadOnly.instance.e_Getter_(unwrap_jso(this));
   
   @DomName('DOMMatrixReadOnly.f')
   @DocsEditable()
   @Experimental() // untriaged
-  double get f => _blink.BlinkDOMMatrixReadOnly.instance.f_Getter_(unwrap_jso(this));
+  num get f => _blink.BlinkDOMMatrixReadOnly.instance.f_Getter_(unwrap_jso(this));
   
   @DomName('DOMMatrixReadOnly.is2D')
   @DocsEditable()
@@ -9980,128 +11919,128 @@
   @DomName('DOMMatrixReadOnly.m11')
   @DocsEditable()
   @Experimental() // untriaged
-  double get m11 => _blink.BlinkDOMMatrixReadOnly.instance.m11_Getter_(unwrap_jso(this));
+  num get m11 => _blink.BlinkDOMMatrixReadOnly.instance.m11_Getter_(unwrap_jso(this));
   
   @DomName('DOMMatrixReadOnly.m12')
   @DocsEditable()
   @Experimental() // untriaged
-  double get m12 => _blink.BlinkDOMMatrixReadOnly.instance.m12_Getter_(unwrap_jso(this));
+  num get m12 => _blink.BlinkDOMMatrixReadOnly.instance.m12_Getter_(unwrap_jso(this));
   
   @DomName('DOMMatrixReadOnly.m13')
   @DocsEditable()
   @Experimental() // untriaged
-  double get m13 => _blink.BlinkDOMMatrixReadOnly.instance.m13_Getter_(unwrap_jso(this));
+  num get m13 => _blink.BlinkDOMMatrixReadOnly.instance.m13_Getter_(unwrap_jso(this));
   
   @DomName('DOMMatrixReadOnly.m14')
   @DocsEditable()
   @Experimental() // untriaged
-  double get m14 => _blink.BlinkDOMMatrixReadOnly.instance.m14_Getter_(unwrap_jso(this));
+  num get m14 => _blink.BlinkDOMMatrixReadOnly.instance.m14_Getter_(unwrap_jso(this));
   
   @DomName('DOMMatrixReadOnly.m21')
   @DocsEditable()
   @Experimental() // untriaged
-  double get m21 => _blink.BlinkDOMMatrixReadOnly.instance.m21_Getter_(unwrap_jso(this));
+  num get m21 => _blink.BlinkDOMMatrixReadOnly.instance.m21_Getter_(unwrap_jso(this));
   
   @DomName('DOMMatrixReadOnly.m22')
   @DocsEditable()
   @Experimental() // untriaged
-  double get m22 => _blink.BlinkDOMMatrixReadOnly.instance.m22_Getter_(unwrap_jso(this));
+  num get m22 => _blink.BlinkDOMMatrixReadOnly.instance.m22_Getter_(unwrap_jso(this));
   
   @DomName('DOMMatrixReadOnly.m23')
   @DocsEditable()
   @Experimental() // untriaged
-  double get m23 => _blink.BlinkDOMMatrixReadOnly.instance.m23_Getter_(unwrap_jso(this));
+  num get m23 => _blink.BlinkDOMMatrixReadOnly.instance.m23_Getter_(unwrap_jso(this));
   
   @DomName('DOMMatrixReadOnly.m24')
   @DocsEditable()
   @Experimental() // untriaged
-  double get m24 => _blink.BlinkDOMMatrixReadOnly.instance.m24_Getter_(unwrap_jso(this));
+  num get m24 => _blink.BlinkDOMMatrixReadOnly.instance.m24_Getter_(unwrap_jso(this));
   
   @DomName('DOMMatrixReadOnly.m31')
   @DocsEditable()
   @Experimental() // untriaged
-  double get m31 => _blink.BlinkDOMMatrixReadOnly.instance.m31_Getter_(unwrap_jso(this));
+  num get m31 => _blink.BlinkDOMMatrixReadOnly.instance.m31_Getter_(unwrap_jso(this));
   
   @DomName('DOMMatrixReadOnly.m32')
   @DocsEditable()
   @Experimental() // untriaged
-  double get m32 => _blink.BlinkDOMMatrixReadOnly.instance.m32_Getter_(unwrap_jso(this));
+  num get m32 => _blink.BlinkDOMMatrixReadOnly.instance.m32_Getter_(unwrap_jso(this));
   
   @DomName('DOMMatrixReadOnly.m33')
   @DocsEditable()
   @Experimental() // untriaged
-  double get m33 => _blink.BlinkDOMMatrixReadOnly.instance.m33_Getter_(unwrap_jso(this));
+  num get m33 => _blink.BlinkDOMMatrixReadOnly.instance.m33_Getter_(unwrap_jso(this));
   
   @DomName('DOMMatrixReadOnly.m34')
   @DocsEditable()
   @Experimental() // untriaged
-  double get m34 => _blink.BlinkDOMMatrixReadOnly.instance.m34_Getter_(unwrap_jso(this));
+  num get m34 => _blink.BlinkDOMMatrixReadOnly.instance.m34_Getter_(unwrap_jso(this));
   
   @DomName('DOMMatrixReadOnly.m41')
   @DocsEditable()
   @Experimental() // untriaged
-  double get m41 => _blink.BlinkDOMMatrixReadOnly.instance.m41_Getter_(unwrap_jso(this));
+  num get m41 => _blink.BlinkDOMMatrixReadOnly.instance.m41_Getter_(unwrap_jso(this));
   
   @DomName('DOMMatrixReadOnly.m42')
   @DocsEditable()
   @Experimental() // untriaged
-  double get m42 => _blink.BlinkDOMMatrixReadOnly.instance.m42_Getter_(unwrap_jso(this));
+  num get m42 => _blink.BlinkDOMMatrixReadOnly.instance.m42_Getter_(unwrap_jso(this));
   
   @DomName('DOMMatrixReadOnly.m43')
   @DocsEditable()
   @Experimental() // untriaged
-  double get m43 => _blink.BlinkDOMMatrixReadOnly.instance.m43_Getter_(unwrap_jso(this));
+  num get m43 => _blink.BlinkDOMMatrixReadOnly.instance.m43_Getter_(unwrap_jso(this));
   
   @DomName('DOMMatrixReadOnly.m44')
   @DocsEditable()
   @Experimental() // untriaged
-  double get m44 => _blink.BlinkDOMMatrixReadOnly.instance.m44_Getter_(unwrap_jso(this));
+  num get m44 => _blink.BlinkDOMMatrixReadOnly.instance.m44_Getter_(unwrap_jso(this));
   
   @DomName('DOMMatrixReadOnly.multiply')
   @DocsEditable()
   @Experimental() // untriaged
-  DomMatrix multiply(DomMatrix other) => _blink.BlinkDOMMatrixReadOnly.instance.multiply_Callback_1_(unwrap_jso(this), unwrap_jso(other));
+  DomMatrix multiply(DomMatrix other) => wrap_jso(_blink.BlinkDOMMatrixReadOnly.instance.multiply_Callback_1_(unwrap_jso(this), unwrap_jso(other)));
   
   DomMatrix scale(num scale, [num ox, num oy]) {
     if (oy != null) {
-      return _blink.BlinkDOMMatrixReadOnly.instance.scale_Callback_3_(unwrap_jso(this), scale, ox, oy);
+      return wrap_jso(_blink.BlinkDOMMatrixReadOnly.instance.scale_Callback_3_(unwrap_jso(this), scale, ox, oy));
     }
     if (ox != null) {
-      return _blink.BlinkDOMMatrixReadOnly.instance.scale_Callback_2_(unwrap_jso(this), scale, ox);
+      return wrap_jso(_blink.BlinkDOMMatrixReadOnly.instance.scale_Callback_2_(unwrap_jso(this), scale, ox));
     }
-    return _blink.BlinkDOMMatrixReadOnly.instance.scale_Callback_1_(unwrap_jso(this), scale);
+    return wrap_jso(_blink.BlinkDOMMatrixReadOnly.instance.scale_Callback_1_(unwrap_jso(this), scale));
   }
 
   DomMatrix scale3d(num scale, [num ox, num oy, num oz]) {
     if (oz != null) {
-      return _blink.BlinkDOMMatrixReadOnly.instance.scale3d_Callback_4_(unwrap_jso(this), scale, ox, oy, oz);
+      return wrap_jso(_blink.BlinkDOMMatrixReadOnly.instance.scale3d_Callback_4_(unwrap_jso(this), scale, ox, oy, oz));
     }
     if (oy != null) {
-      return _blink.BlinkDOMMatrixReadOnly.instance.scale3d_Callback_3_(unwrap_jso(this), scale, ox, oy);
+      return wrap_jso(_blink.BlinkDOMMatrixReadOnly.instance.scale3d_Callback_3_(unwrap_jso(this), scale, ox, oy));
     }
     if (ox != null) {
-      return _blink.BlinkDOMMatrixReadOnly.instance.scale3d_Callback_2_(unwrap_jso(this), scale, ox);
+      return wrap_jso(_blink.BlinkDOMMatrixReadOnly.instance.scale3d_Callback_2_(unwrap_jso(this), scale, ox));
     }
-    return _blink.BlinkDOMMatrixReadOnly.instance.scale3d_Callback_1_(unwrap_jso(this), scale);
+    return wrap_jso(_blink.BlinkDOMMatrixReadOnly.instance.scale3d_Callback_1_(unwrap_jso(this), scale));
   }
 
   DomMatrix scaleNonUniform(num sx, [num sy, num sz, num ox, num oy, num oz]) {
     if (oz != null) {
-      return _blink.BlinkDOMMatrixReadOnly.instance.scaleNonUniform_Callback_6_(unwrap_jso(this), sx, sy, sz, ox, oy, oz);
+      return wrap_jso(_blink.BlinkDOMMatrixReadOnly.instance.scaleNonUniform_Callback_6_(unwrap_jso(this), sx, sy, sz, ox, oy, oz));
     }
     if (oy != null) {
-      return _blink.BlinkDOMMatrixReadOnly.instance.scaleNonUniform_Callback_5_(unwrap_jso(this), sx, sy, sz, ox, oy);
+      return wrap_jso(_blink.BlinkDOMMatrixReadOnly.instance.scaleNonUniform_Callback_5_(unwrap_jso(this), sx, sy, sz, ox, oy));
     }
     if (ox != null) {
-      return _blink.BlinkDOMMatrixReadOnly.instance.scaleNonUniform_Callback_4_(unwrap_jso(this), sx, sy, sz, ox);
+      return wrap_jso(_blink.BlinkDOMMatrixReadOnly.instance.scaleNonUniform_Callback_4_(unwrap_jso(this), sx, sy, sz, ox));
     }
     if (sz != null) {
-      return _blink.BlinkDOMMatrixReadOnly.instance.scaleNonUniform_Callback_3_(unwrap_jso(this), sx, sy, sz);
+      return wrap_jso(_blink.BlinkDOMMatrixReadOnly.instance.scaleNonUniform_Callback_3_(unwrap_jso(this), sx, sy, sz));
     }
     if (sy != null) {
-      return _blink.BlinkDOMMatrixReadOnly.instance.scaleNonUniform_Callback_2_(unwrap_jso(this), sx, sy);
+      return wrap_jso(_blink.BlinkDOMMatrixReadOnly.instance.scaleNonUniform_Callback_2_(unwrap_jso(this), sx, sy));
     }
-    return _blink.BlinkDOMMatrixReadOnly.instance.scaleNonUniform_Callback_1_(unwrap_jso(this), sx);
+    return wrap_jso(_blink.BlinkDOMMatrixReadOnly.instance.scaleNonUniform_Callback_1_(unwrap_jso(this), sx));
   }
 
   @DomName('DOMMatrixReadOnly.toFloat32Array')
@@ -10116,9 +12055,9 @@
   
   DomMatrix translate(num tx, num ty, [num tz]) {
     if (tz != null) {
-      return _blink.BlinkDOMMatrixReadOnly.instance.translate_Callback_3_(unwrap_jso(this), tx, ty, tz);
+      return wrap_jso(_blink.BlinkDOMMatrixReadOnly.instance.translate_Callback_3_(unwrap_jso(this), tx, ty, tz));
     }
-    return _blink.BlinkDOMMatrixReadOnly.instance.translate_Callback_2_(unwrap_jso(this), tx, ty);
+    return wrap_jso(_blink.BlinkDOMMatrixReadOnly.instance.translate_Callback_2_(unwrap_jso(this), tx, ty));
   }
 
 }
@@ -10131,16 +12070,31 @@
 
 @DocsEditable()
 @DomName('DOMParser')
-class DomParser extends NativeFieldWrapperClass2 {
+class DomParser extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory DomParser._() { throw new UnsupportedError("Not supported"); }
 
   @DomName('DOMParser.DOMParser')
   @DocsEditable()
   factory DomParser() {
-    return _blink.BlinkDOMParser.instance.constructorCallback_0_();
+    return wrap_jso(_blink.BlinkDOMParser.instance.constructorCallback_0_());
   }
 
+  @Deprecated("Internal Use Only")
+  static DomParser internalCreateDomParser() {
+    return new DomParser._internalWrap();
+  }
+
+  factory DomParser._internalWrap() {
+    return new DomParser.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  DomParser.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('DOMParser.parseFromString')
   @DocsEditable()
   Document parseFromString(String str, String contentType) => wrap_jso(_blink.BlinkDOMParser.instance.parseFromString_Callback_2_(unwrap_jso(this), str, contentType));
@@ -10164,23 +12118,38 @@
   @DocsEditable()
   factory DomPoint([point_OR_x, num y, num z, num w]) {
     if (point_OR_x == null && y == null && z == null && w == null) {
-      return _blink.BlinkDOMPoint.instance.constructorCallback_0_();
+      return wrap_jso(_blink.BlinkDOMPoint.instance.constructorCallback_0_());
     }
     if ((point_OR_x is Map || point_OR_x == null) && y == null && z == null && w == null) {
-      return _blink.BlinkDOMPoint.instance.constructorCallback_1_(point_OR_x);
+      var point_1 = convertDartToNative_Dictionary(point_OR_x);
+      return wrap_jso(_blink.BlinkDOMPoint.instance.constructorCallback_1_(point_1));
     }
     if ((y is num || y == null) && (point_OR_x is num || point_OR_x == null) && z == null && w == null) {
-      return _blink.BlinkDOMPoint.instance.constructorCallback_2_(point_OR_x, y);
+      return wrap_jso(_blink.BlinkDOMPoint.instance.constructorCallback_2_(point_OR_x, y));
     }
     if ((z is num || z == null) && (y is num || y == null) && (point_OR_x is num || point_OR_x == null) && w == null) {
-      return _blink.BlinkDOMPoint.instance.constructorCallback_3_(point_OR_x, y, z);
+      return wrap_jso(_blink.BlinkDOMPoint.instance.constructorCallback_3_(point_OR_x, y, z));
     }
     if ((w is num || w == null) && (z is num || z == null) && (y is num || y == null) && (point_OR_x is num || point_OR_x == null)) {
-      return _blink.BlinkDOMPoint.instance.constructorCallback_4_(point_OR_x, y, z, w);
+      return wrap_jso(_blink.BlinkDOMPoint.instance.constructorCallback_4_(point_OR_x, y, z, w));
     }
     throw new ArgumentError("Incorrect number or type of arguments");
   }
 
+
+  @Deprecated("Internal Use Only")
+  static DomPoint internalCreateDomPoint() {
+    return new DomPoint._internalWrap();
+  }
+
+  factory DomPoint._internalWrap() {
+    return new DomPoint.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  DomPoint.internal_() : super.internal_();
+
+
   /// Checks if this type is supported on the current platform.
   static bool get supported => true;
 
@@ -10192,7 +12161,7 @@
   @DomName('DOMPoint.w')
   @DocsEditable()
   @Experimental() // untriaged
-  void set w(num value) => _blink.BlinkDOMPoint.instance.w_Setter_(unwrap_jso(this), value);
+  set w(num value) => _blink.BlinkDOMPoint.instance.w_Setter_(unwrap_jso(this), value);
   
   @DomName('DOMPoint.x')
   @DocsEditable()
@@ -10202,7 +12171,7 @@
   @DomName('DOMPoint.x')
   @DocsEditable()
   @Experimental() // untriaged
-  void set x(num value) => _blink.BlinkDOMPoint.instance.x_Setter_(unwrap_jso(this), value);
+  set x(num value) => _blink.BlinkDOMPoint.instance.x_Setter_(unwrap_jso(this), value);
   
   @DomName('DOMPoint.y')
   @DocsEditable()
@@ -10212,7 +12181,7 @@
   @DomName('DOMPoint.y')
   @DocsEditable()
   @Experimental() // untriaged
-  void set y(num value) => _blink.BlinkDOMPoint.instance.y_Setter_(unwrap_jso(this), value);
+  set y(num value) => _blink.BlinkDOMPoint.instance.y_Setter_(unwrap_jso(this), value);
   
   @DomName('DOMPoint.z')
   @DocsEditable()
@@ -10222,7 +12191,7 @@
   @DomName('DOMPoint.z')
   @DocsEditable()
   @Experimental() // untriaged
-  void set z(num value) => _blink.BlinkDOMPoint.instance.z_Setter_(unwrap_jso(this), value);
+  set z(num value) => _blink.BlinkDOMPoint.instance.z_Setter_(unwrap_jso(this), value);
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -10235,35 +12204,50 @@
 @DocsEditable()
 @DomName('DOMPointReadOnly')
 @Experimental() // untriaged
-class DomPointReadOnly extends NativeFieldWrapperClass2 {
+class DomPointReadOnly extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory DomPointReadOnly._() { throw new UnsupportedError("Not supported"); }
 
   @DomName('DOMPointReadOnly.DOMPointReadOnly')
   @DocsEditable()
   factory DomPointReadOnly(num x, num y, num z, num w) {
-    return _blink.BlinkDOMPointReadOnly.instance.constructorCallback_4_(x, y, z, w);
+    return wrap_jso(_blink.BlinkDOMPointReadOnly.instance.constructorCallback_4_(x, y, z, w));
   }
 
+  @Deprecated("Internal Use Only")
+  static DomPointReadOnly internalCreateDomPointReadOnly() {
+    return new DomPointReadOnly._internalWrap();
+  }
+
+  factory DomPointReadOnly._internalWrap() {
+    return new DomPointReadOnly.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  DomPointReadOnly.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('DOMPointReadOnly.w')
   @DocsEditable()
   @Experimental() // untriaged
-  double get w => _blink.BlinkDOMPointReadOnly.instance.w_Getter_(unwrap_jso(this));
+  num get w => _blink.BlinkDOMPointReadOnly.instance.w_Getter_(unwrap_jso(this));
   
   @DomName('DOMPointReadOnly.x')
   @DocsEditable()
   @Experimental() // untriaged
-  double get x => _blink.BlinkDOMPointReadOnly.instance.x_Getter_(unwrap_jso(this));
+  num get x => _blink.BlinkDOMPointReadOnly.instance.x_Getter_(unwrap_jso(this));
   
   @DomName('DOMPointReadOnly.y')
   @DocsEditable()
   @Experimental() // untriaged
-  double get y => _blink.BlinkDOMPointReadOnly.instance.y_Getter_(unwrap_jso(this));
+  num get y => _blink.BlinkDOMPointReadOnly.instance.y_Getter_(unwrap_jso(this));
   
   @DomName('DOMPointReadOnly.z')
   @DocsEditable()
   @Experimental() // untriaged
-  double get z => _blink.BlinkDOMPointReadOnly.instance.z_Getter_(unwrap_jso(this));
+  num get z => _blink.BlinkDOMPointReadOnly.instance.z_Getter_(unwrap_jso(this));
   
 }
 // Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
@@ -10274,7 +12258,7 @@
 @DocsEditable()
 @DomName('DOMRectReadOnly')
 @Experimental() // untriaged
-class DomRectReadOnly extends NativeFieldWrapperClass2 implements Rectangle {
+class DomRectReadOnly extends DartHtmlDomObject implements Rectangle {
 
   // NOTE! All code below should be common with RectangleBase.
    String toString() {
@@ -10371,48 +12355,61 @@
   @DomName('DOMRectReadOnly.DOMRectReadOnly')
   @DocsEditable()
   factory DomRectReadOnly(num x, num y, num width, num height) {
-    return _blink.BlinkDOMRectReadOnly.instance.constructorCallback_4_(x, y, width, height);
+    return wrap_jso(_blink.BlinkDOMRectReadOnly.instance.constructorCallback_4_(x, y, width, height));
   }
 
+  @Deprecated("Internal Use Only")
+  static DomRectReadOnly internalCreateDomRectReadOnly() {
+    return new DomRectReadOnly._internalWrap();
+  }
+
+  factory DomRectReadOnly._internalWrap() {
+    return new DomRectReadOnly.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  DomRectReadOnly.internal_() { }
+
+
   @DomName('DOMRectReadOnly.bottom')
   @DocsEditable()
   @Experimental() // untriaged
-  double get bottom => _blink.BlinkDOMRectReadOnly.instance.bottom_Getter_(unwrap_jso(this));
+  num get bottom => _blink.BlinkDOMRectReadOnly.instance.bottom_Getter_(unwrap_jso(this));
   
   @DomName('DOMRectReadOnly.height')
   @DocsEditable()
   @Experimental() // untriaged
-  double get height => _blink.BlinkDOMRectReadOnly.instance.height_Getter_(unwrap_jso(this));
+  num get height => _blink.BlinkDOMRectReadOnly.instance.height_Getter_(unwrap_jso(this));
   
   @DomName('DOMRectReadOnly.left')
   @DocsEditable()
   @Experimental() // untriaged
-  double get left => _blink.BlinkDOMRectReadOnly.instance.left_Getter_(unwrap_jso(this));
+  num get left => _blink.BlinkDOMRectReadOnly.instance.left_Getter_(unwrap_jso(this));
   
   @DomName('DOMRectReadOnly.right')
   @DocsEditable()
   @Experimental() // untriaged
-  double get right => _blink.BlinkDOMRectReadOnly.instance.right_Getter_(unwrap_jso(this));
+  num get right => _blink.BlinkDOMRectReadOnly.instance.right_Getter_(unwrap_jso(this));
   
   @DomName('DOMRectReadOnly.top')
   @DocsEditable()
   @Experimental() // untriaged
-  double get top => _blink.BlinkDOMRectReadOnly.instance.top_Getter_(unwrap_jso(this));
+  num get top => _blink.BlinkDOMRectReadOnly.instance.top_Getter_(unwrap_jso(this));
   
   @DomName('DOMRectReadOnly.width')
   @DocsEditable()
   @Experimental() // untriaged
-  double get width => _blink.BlinkDOMRectReadOnly.instance.width_Getter_(unwrap_jso(this));
+  num get width => _blink.BlinkDOMRectReadOnly.instance.width_Getter_(unwrap_jso(this));
   
   @DomName('DOMRectReadOnly.x')
   @DocsEditable()
   @Experimental() // untriaged
-  double get x => _blink.BlinkDOMRectReadOnly.instance.x_Getter_(unwrap_jso(this));
+  num get x => _blink.BlinkDOMRectReadOnly.instance.x_Getter_(unwrap_jso(this));
   
   @DomName('DOMRectReadOnly.y')
   @DocsEditable()
   @Experimental() // untriaged
-  double get y => _blink.BlinkDOMRectReadOnly.instance.y_Getter_(unwrap_jso(this));
+  num get y => _blink.BlinkDOMRectReadOnly.instance.y_Getter_(unwrap_jso(this));
   }
 
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -10428,13 +12425,27 @@
   // To suppress missing implicit constructor warnings.
   factory DomSettableTokenList._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static DomSettableTokenList internalCreateDomSettableTokenList() {
+    return new DomSettableTokenList._internalWrap();
+  }
+
+  factory DomSettableTokenList._internalWrap() {
+    return new DomSettableTokenList.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  DomSettableTokenList.internal_() : super.internal_();
+
+
   @DomName('DOMSettableTokenList.value')
   @DocsEditable()
   String get value => _blink.BlinkDOMSettableTokenList.instance.value_Getter_(unwrap_jso(this));
   
   @DomName('DOMSettableTokenList.value')
   @DocsEditable()
-  void set value(String value) => _blink.BlinkDOMSettableTokenList.instance.value_Setter_(unwrap_jso(this), value);
+  set value(String value) => _blink.BlinkDOMSettableTokenList.instance.value_Setter_(unwrap_jso(this), value);
   
   @DomName('DOMSettableTokenList.__getter__')
   @DocsEditable()
@@ -10450,10 +12461,25 @@
 
 @DocsEditable()
 @DomName('DOMStringList')
-class DomStringList extends NativeFieldWrapperClass2 with ListMixin<String>, ImmutableListMixin<String> implements List<String> {
+class DomStringList extends DartHtmlDomObject with ListMixin<String>, ImmutableListMixin<String> implements List<String> {
   // To suppress missing implicit constructor warnings.
   factory DomStringList._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static DomStringList internalCreateDomStringList() {
+    return new DomStringList._internalWrap();
+  }
+
+  factory DomStringList._internalWrap() {
+    return new DomStringList.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  DomStringList.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('DOMStringList.length')
   @DocsEditable()
   int get length => _blink.BlinkDOMStringList.instance.length_Getter_(unwrap_jso(this));
@@ -10465,7 +12491,7 @@
   }
 
   String _nativeIndexedGetter(int index) => _blink.BlinkDOMStringList.instance.item_Callback_1_(unwrap_jso(this), index);
- 
+
   void operator[]=(int index, String value) {
     throw new UnsupportedError("Cannot assign element of immutable List.");
   }
@@ -10473,7 +12499,7 @@
   // String is the element type.
 
 
-  void set length(int value) {
+  set length(int value) {
     throw new UnsupportedError("Cannot resize immutable List.");
   }
 
@@ -10522,7 +12548,7 @@
 
 @DocsEditable()
 @DomName('DOMStringMap')
-abstract class DomStringMap extends NativeFieldWrapperClass2 {
+class DomStringMap extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory DomStringMap._() { throw new UnsupportedError("Not supported"); }
 
@@ -10568,10 +12594,25 @@
 
 @DocsEditable()
 @DomName('DOMTokenList')
-class DomTokenList extends NativeFieldWrapperClass2 {
+class DomTokenList extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory DomTokenList._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static DomTokenList internalCreateDomTokenList() {
+    return new DomTokenList._internalWrap();
+  }
+
+  factory DomTokenList._internalWrap() {
+    return new DomTokenList.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  DomTokenList.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('DOMTokenList.length')
   @DocsEditable()
   int get length => _blink.BlinkDOMTokenList.instance.length_Getter_(unwrap_jso(this));
@@ -10636,7 +12677,7 @@
     _element._replaceChild(value, _childElements[index]);
   }
 
-  void set length(int newLength) {
+  set length(int newLength) {
     // TODO(jacobr): remove children when length is reduced.
     throw new UnsupportedError('Cannot resize element lists');
   }
@@ -10700,7 +12741,8 @@
   bool remove(Object object) {
     if (object is Element) {
       Element element = object;
-      if (identical(element.parentNode, _element)) {
+      // We aren't preserving identity of nodes in JSINTEROP mode
+      if (element.parentNode == _element) {
         _element._removeChild(element);
         return true;
       }
@@ -11332,7 +13374,11 @@
     implements ElementList, NodeListWrapper {
   final List<Node> _nodeList;
 
-  _FrozenElementList._wrap(this._nodeList);
+  var dartClass_instance;
+
+  _FrozenElementList._wrap(this._nodeList) {
+      this.dartClass_instance = this._nodeList;
+  }
 
   int get length => _nodeList.length;
 
@@ -11342,7 +13388,7 @@
     throw new UnsupportedError('Cannot modify list');
   }
 
-  void set length(int newLength) {
+  set length(int newLength) {
     throw new UnsupportedError('Cannot modify list');
   }
 
@@ -11365,7 +13411,7 @@
   CssStyleDeclarationBase get style =>
       new _CssStyleDeclarationSet(this);
 
-  void set classes(Iterable<String> value) {
+  set classes(Iterable<String> value) {
     // TODO(sra): This might be faster for Sets:
     //
     //     new _MultiElementCssClassSet(this).writeClasses(value)
@@ -11859,7 +13905,7 @@
  * An abstract class, which all HTML elements extend.
  */
 @DomName('Element')
-abstract class Element extends Node implements GlobalEventHandlers, ParentNode, ChildNode {
+class Element extends Node implements GlobalEventHandlers, ParentNode, ChildNode {
 
   /**
    * Creates an HTML element from a valid fragment of HTML.
@@ -11906,11 +13952,7 @@
    *     }
    *     document.registerElement('x-custom', CustomElement);
    */
-  Element.created() : super._created() {
-    // Validate that this is a custom element & perform any additional
-    // initialization.
-    _initializeCustomElement(this);
-  }
+  Element.created() : super._created();
 
   /**
    * Creates the HTML element specified by the tag name.
@@ -12091,7 +14133,7 @@
    */
   Map<String, String> get attributes => new _ElementAttributeMap(this);
 
-  void set attributes(Map<String, String> value) {
+  set attributes(Map<String, String> value) {
     Map<String, String> attributes = this.attributes;
     attributes.clear();
     for (String key in value.keys) {
@@ -12113,7 +14155,7 @@
    */
   List<Element> get children => new _ChildrenElementList._wrap(this);
 
-  void set children(List<Element> value) {
+  set children(List<Element> value) {
     // Copy list first since we don't want liveness during iteration.
     List copy = new List.from(value);
     var children = this.children;
@@ -12167,7 +14209,7 @@
    */
   CssClassSet get classes => new _ElementCssClassSet(this);
 
-  void set classes(Iterable<String> value) {
+  set classes(Iterable<String> value) {
     // TODO(sra): Do this without reading the classes in clear() and addAll(),
     // or writing the classes in clear().
     CssClassSet classSet = classes;
@@ -12201,7 +14243,7 @@
   Map<String, String> get dataset =>
     new _DataAttributeMap(attributes);
 
-  void set dataset(Map<String, String> value) {
+  set dataset(Map<String, String> value) {
     final data = this.dataset;
     data.clear();
     for (String key in value.keys) {
@@ -12321,6 +14363,49 @@
   void leftView() {}
 
   /**
+   * Creates a new AnimationEffect object whose target element is the object
+   * on which the method is called, and calls the play() method of the
+   * AnimationTimeline object of the document timeline of the node document
+   * of the element, passing the newly created AnimationEffect as the argument
+   * to the method. Returns an AnimationPlayer for the effect.
+   *
+   * Examples
+   *
+   *     var animation = elem.animate([{"opacity": 75}, {"opacity": 0}], 200);
+   *
+   *     var animation = elem.animate([
+   *       {"transform": "translate(100px, -100%)"},
+   *       {"transform" : "translate(400px, 500px)"}
+   *     ], 1500);
+   *
+   * The [frames] parameter is an Iterable<Map>, where the
+   * map entries specify CSS animation effects. The
+   * [timing] paramter can be a double, representing the number of milliseconds
+   * for the transition, or a Map with fields corresponding to those
+   * of the [Timing] object.
+  **/
+  @Experimental()
+  @SupportedBrowser(SupportedBrowser.CHROME, '36')
+  AnimationPlayer animate(Iterable<Map<String, dynamic>> frames, [timing]) {
+    if (frames is! Iterable || !(frames.every((x) => x is Map))) {
+      throw new ArgumentError("The frames parameter should be a List of Maps "
+          "with frame information");
+    }
+    var convertedFrames = frames;
+    if (convertedFrames is Iterable) {
+      convertedFrames = convertDartToNative_List(
+          frames.map(convertDartToNative_Dictionary).toList());
+    }
+    var convertedTiming = timing;
+    if (convertedTiming is Map) {
+      convertedTiming = convertDartToNative_Dictionary(convertedTiming);
+    }
+    return convertedTiming == null
+      ? _animate(convertedFrames)
+      : _animate(convertedFrames, convertedTiming);
+  }
+
+  /**
    * Called by the DOM whenever an attribute on this has been changed.
    */
   void attributeChanged(String name, String oldValue, String newValue) {}
@@ -12345,7 +14430,7 @@
   // members of the component are used. The actual type is a subtype of Element.
   get xtag => _xtag != null ? _xtag : this;
 
-  void set xtag(Element value) {
+  set xtag(Element value) {
     _xtag = value;
   }
 
@@ -12579,8 +14664,9 @@
     // offsetParent, "tops out" at BODY. But people could conceivably pass in
     // the document.documentElement and I want it to return an absolute offset,
     // so we have the special case checking for HTML.
-    bool foundAsParent = identical(current, parent) || parent.tagName == 'HTML';
-    if (current == null || identical(current, parent)) {
+    bool sameAsParent = current == parent;
+    bool foundAsParent = sameAsParent || parent.tagName == 'HTML';
+    if (current == null || sameAsParent) {
       if (foundAsParent) return new Point(0, 0);
       throw new ArgumentError("Specified element is not a transitive offset "
           "parent of this element.");
@@ -12638,11 +14724,11 @@
     if (_parseDocument == null) {
       _parseDocument = document.implementation.createHtmlDocument('');
       _parseRange = _parseDocument.createRange();
-	
+
       // Workaround for Safari bug. Was also previously Chrome bug 229142
-      // - URIs are not resolved in new doc.	
-      var base = _parseDocument.createElement('base');	
-      base.href = document.baseUri;	
+      // - URIs are not resolved in new doc.
+      var base = _parseDocument.createElement('base');
+      base.href = document.baseUri;
       _parseDocument.head.append(base);
     }
     var contextElement;
@@ -12700,7 +14786,7 @@
    * This uses the default sanitization behavior to sanitize the HTML fragment,
    * use [setInnerHtml] to override the default behavior.
    */
-  void set innerHtml(String html) {
+  set innerHtml(String html) {
     this.setInnerHtml(html);
   }
 
@@ -12742,71 +14828,112 @@
    * used when an explicit accessor is not available.
    */
   ElementEvents get on => new ElementEvents(this);
-  
+
   /**
    * Verify if any of the attributes that we use in the sanitizer look unexpected,
    * possibly indicating DOM clobbering attacks.
    *
    * Those attributes are: attributes, lastChild, children, previousNode and tagName.
    */
-  // Dartium isn't affected by these attacks, because it goes directly to the C++ API.
-  static bool _hasCorruptedAttributes(Element element) => false;
+
+  static var _namedNodeMap = js.context["NamedNodeMap"];
+  static var _htmlCollection = js.context["HTMLCollection"];
+  static var _nodeList = js.context["NodeList"];
+
+  static bool _hasCorruptedAttributes(Element element) {
+    var attributes = unwrap_jso(element)["attributes"];
+    if (!attributes.instanceof(_namedNodeMap)) {
+      return true;
+    }
+    var childNodes = unwrap_jso(element.childNodes);
+    var length = childNodes["length"];
+    var lastChild = unwrap_jso(element.lastChild);
+    if (null != lastChild &&
+        lastChild != childNodes[length - 1]) {
+      return true;
+    }
+    var children = unwrap_jso(element._children);
+    if (null != children) { // On Safari, children can apparently be null.
+      if (!children.instanceof(_htmlCollection) ||
+          children.instanceof(_nodeList)) {
+	return true;
+      }
+    }
+    return false;
+  }
+
+  /// A secondary check for corruption, needed on IE
+  static bool _hasCorruptedAttributesAdditionalCheck(Element element) => false;
+
+  static String _safeTagName(element) {
+    String result = 'element tag unavailable';
+    try {
+      if (element.tagName is String) {
+        result = element.tagName;
+      }
+    } catch (e) {}
+    return result;
+  }
+
+  // Need to explicitly delegate because Element is no longer abstract for Dartium.
+  bool get isContentEditable => _blink.BlinkHTMLElement.instance.isContentEditable_Getter_(unwrap_jso(this));
+  void click() => _blink.BlinkHTMLElement.instance.click_Callback_0_(unwrap_jso(this));
 
   @DomName('Element.offsetHeight')
   @DocsEditable()
-  int get offsetHeight => _blink.BlinkElement.offsetHeight_Getter(this).round();
+  int get offsetHeight => _blink.BlinkElement.instance.offsetHeight_Getter_(unwrap_jso(this)).round();
 
   @DomName('Element.offsetLeft')
   @DocsEditable()
-  int get offsetLeft => _blink.BlinkElement.offsetLeft_Getter(this).round();
+  int get offsetLeft => _blink.BlinkElement.instance.offsetLeft_Getter_(unwrap_jso(this)).round();
 
   @DomName('Element.offsetTop')
   @DocsEditable()
-  int get offsetTop => _blink.BlinkElement.offsetTop_Getter(this).round();
+  int get offsetTop => _blink.BlinkElement.instance.offsetTop_Getter_(unwrap_jso(this)).round();
 
   @DomName('Element.offsetWidth')
   @DocsEditable()
-  int get offsetWidth => _blink.BlinkElement.offsetWidth_Getter(this).round();
+  int get offsetWidth => _blink.BlinkElement.instance.offsetWidth_Getter_(unwrap_jso(this)).round();
 
   @DomName('Element.clientHeight')
   @DocsEditable()
-  int get clientHeight => _blink.BlinkElement.clientHeight_Getter(this).round();
+  int get clientHeight => _blink.BlinkElement.instance.clientHeight_Getter_(unwrap_jso(this)).round();
 
   @DomName('Element.clientLeft')
   @DocsEditable()
-  int get clientLeft => _blink.BlinkElement.clientLeft_Getter(this).round();
+  int get clientLeft => _blink.BlinkElement.instance.clientLeft_Getter_(unwrap_jso(this)).round();
 
   @DomName('Element.clientTop')
   @DocsEditable()
-  int get clientTop => _blink.BlinkElement.clientTop_Getter(this).round();
+  int get clientTop => _blink.BlinkElement.instance.clientTop_Getter_(unwrap_jso(this)).round();
 
   @DomName('Element.clientWidth')
   @DocsEditable()
-  int get clientWidth => _blink.BlinkElement.clientWidth_Getter(this).round();
+  int get clientWidth => _blink.BlinkElement.instance.clientWidth_Getter_(unwrap_jso(this)).round();
 
   @DomName('Element.scrollHeight')
   @DocsEditable()
-  int get scrollHeight => _blink.BlinkElement.scrollHeight_Getter(this).round();
+  int get scrollHeight => _blink.BlinkElement.instance.scrollHeight_Getter_(unwrap_jso(this)).round();
 
   @DomName('Element.scrollLeft')
   @DocsEditable()
-  int get scrollLeft => _blink.BlinkElement.scrollLeft_Getter(this).round();
+  int get scrollLeft => _blink.BlinkElement.instance.scrollLeft_Getter_(unwrap_jso(this)).round();
 
   @DomName('Element.scrollLeft')
   @DocsEditable()
-  void set scrollLeft(int value) => _blink.BlinkElement.scrollLeft_Setter(this, value.round());
+  set scrollLeft(int value) => _blink.BlinkElement.instance.scrollLeft_Setter_(unwrap_jso(this), value.round());
 
   @DomName('Element.scrollTop')
   @DocsEditable()
-  int get scrollTop => _blink.BlinkElement.scrollTop_Getter(this).round();
+  int get scrollTop => _blink.BlinkElement.instance.scrollTop_Getter_(unwrap_jso(this)).round();
 
   @DomName('Element.scrollTop')
   @DocsEditable()
-  void set scrollTop(int value) => _blink.BlinkElement.scrollTop_Setter(this, value.round());
+  set scrollTop(int value) => _blink.BlinkElement.instance.scrollTop_Setter_(unwrap_jso(this), value.round());
 
   @DomName('Element.scrollWidth')
   @DocsEditable()
-  int get scrollWidth => _blink.BlinkElement.scrollWidth_Getter(this).round();
+  int get scrollWidth => _blink.BlinkElement.instance.scrollWidth_Getter_(unwrap_jso(this)).round();
 
   // To suppress missing implicit constructor warnings.
   factory Element._() { throw new UnsupportedError("Not supported"); }
@@ -13479,6 +15606,20 @@
   // https://dvcs.w3.org/hg/fullscreen/raw-file/tip/Overview.html
   static const EventStreamProvider<Event> fullscreenErrorEvent = const EventStreamProvider<Event>('webkitfullscreenerror');
 
+
+  @Deprecated("Internal Use Only")
+  static Element internalCreateElement() {
+    return new Element._internalWrap();
+  }
+
+  factory Element._internalWrap() {
+    return new Element.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  Element.internal_() : super.internal_();
+
+
   String contentEditable;
 
   MenuElement contextMenu;
@@ -13489,8 +15630,6 @@
 
   bool hidden;
 
-  bool get isContentEditable;
-
   String lang;
 
   bool spellcheck;
@@ -13503,8 +15642,6 @@
 
   String dropzone;
 
-  void click();
-
   @DomName('Element.attributes')
   @DocsEditable()
   _NamedNodeMap get _attributes => wrap_jso(_blink.BlinkElement.instance.attributes_Getter_(unwrap_jso(this)));
@@ -13515,7 +15652,7 @@
   
   @DomName('Element.className')
   @DocsEditable()
-  void set className(String value) => _blink.BlinkElement.instance.className_Setter_(unwrap_jso(this), value);
+  set className(String value) => _blink.BlinkElement.instance.className_Setter_(unwrap_jso(this), value);
   
   @DomName('Element.clientHeight')
   @DocsEditable()
@@ -13539,7 +15676,7 @@
   
   @DomName('Element.id')
   @DocsEditable()
-  void set id(String value) => _blink.BlinkElement.instance.id_Setter_(unwrap_jso(this), value);
+  set id(String value) => _blink.BlinkElement.instance.id_Setter_(unwrap_jso(this), value);
   
   @DomName('Element.innerHTML')
   @DocsEditable()
@@ -13547,7 +15684,7 @@
   
   @DomName('Element.innerHTML')
   @DocsEditable()
-  void set _innerHtml(String value) => _blink.BlinkElement.instance.innerHTML_Setter_(unwrap_jso(this), value);
+  set _innerHtml(String value) => _blink.BlinkElement.instance.innerHTML_Setter_(unwrap_jso(this), value);
   
   @DomName('Element.localName')
   @DocsEditable()
@@ -13593,7 +15730,7 @@
   
   @DomName('Element.scrollLeft')
   @DocsEditable()
-  void set _scrollLeft(num value) => _blink.BlinkElement.instance.scrollLeft_Setter_(unwrap_jso(this), value);
+  set _scrollLeft(num value) => _blink.BlinkElement.instance.scrollLeft_Setter_(unwrap_jso(this), value);
   
   @DomName('Element.scrollTop')
   @DocsEditable()
@@ -13601,7 +15738,7 @@
   
   @DomName('Element.scrollTop')
   @DocsEditable()
-  void set _scrollTop(num value) => _blink.BlinkElement.instance.scrollTop_Setter_(unwrap_jso(this), value);
+  set _scrollTop(num value) => _blink.BlinkElement.instance.scrollTop_Setter_(unwrap_jso(this), value);
   
   @DomName('Element.scrollWidth')
   @DocsEditable()
@@ -13624,7 +15761,7 @@
   @DomName('Element.animate')
   @DocsEditable()
   @Experimental() // untriaged
-  AnimationPlayer animate(Object effect, [Object timing]) => wrap_jso(_blink.BlinkElement.instance.animate_Callback_2_(unwrap_jso(this), effect, timing));
+  AnimationPlayer _animate(Object effect, [Object timing]) => wrap_jso(_blink.BlinkElement.instance.animate_Callback_2_(unwrap_jso(this), effect, timing));
   
   @DomName('Element.blur')
   @DocsEditable()
@@ -13644,7 +15781,7 @@
   @DomName('Element.getAnimationPlayers')
   @DocsEditable()
   @Experimental() // untriaged
-  List<AnimationPlayer> getAnimationPlayers() => _blink.BlinkElement.instance.getAnimationPlayers_Callback_0_(unwrap_jso(this));
+  List<AnimationPlayer> getAnimationPlayers() => wrap_jso(_blink.BlinkElement.instance.getAnimationPlayers_Callback_0_(unwrap_jso(this)));
   
   @DomName('Element.getAttribute')
   @DocsEditable()
@@ -13688,7 +15825,7 @@
    */
   @DomName('Element.getClientRects')
   @DocsEditable()
-  List<Rectangle> getClientRects() => _blink.BlinkElement.instance.getClientRects_Callback_0_(unwrap_jso(this));
+  List<Rectangle> getClientRects() => wrap_jso(_blink.BlinkElement.instance.getClientRects_Callback_0_(unwrap_jso(this)));
   
   /**
    * Returns a list of shadow DOM insertion points to which this element is
@@ -13703,7 +15840,7 @@
   @DomName('Element.getDestinationInsertionPoints')
   @DocsEditable()
   @Experimental() // untriaged
-  List<Node> getDestinationInsertionPoints() => wrap_jso_list(_blink.BlinkElement.instance.getDestinationInsertionPoints_Callback_0_(unwrap_jso(this)));
+  List<Node> getDestinationInsertionPoints() => wrap_jso(_blink.BlinkElement.instance.getDestinationInsertionPoints_Callback_0_(unwrap_jso(this)));
   
   /**
    * Returns a list of nodes with the given class name inside this element.
@@ -13718,11 +15855,11 @@
    */
   @DomName('Element.getElementsByClassName')
   @DocsEditable()
-  List<Node> getElementsByClassName(String classNames) => wrap_jso_list(_blink.BlinkElement.instance.getElementsByClassName_Callback_1_(unwrap_jso(this), classNames));
+  List<Node> getElementsByClassName(String classNames) => wrap_jso(_blink.BlinkElement.instance.getElementsByClassName_Callback_1_(unwrap_jso(this), classNames));
   
   @DomName('Element.getElementsByTagName')
   @DocsEditable()
-  List<Node> _getElementsByTagName(String name) => wrap_jso_list(_blink.BlinkElement.instance.getElementsByTagName_Callback_1_(unwrap_jso(this), name));
+  List<Node> _getElementsByTagName(String name) => wrap_jso(_blink.BlinkElement.instance.getElementsByTagName_Callback_1_(unwrap_jso(this), name));
   
   @DomName('Element.hasAttribute')
   @DocsEditable()
@@ -13814,7 +15951,7 @@
   
   @DomName('Element.children')
   @DocsEditable()
-  List<Node> get _children => wrap_jso_list(_blink.BlinkElement.instance.children_Getter_(unwrap_jso(this)));
+  List<Node> get _children => wrap_jso(_blink.BlinkElement.instance.children_Getter_(unwrap_jso(this)));
   
   @DomName('Element.firstElementChild')
   @DocsEditable()
@@ -13846,7 +15983,7 @@
   
   @DomName('Element.querySelectorAll')
   @DocsEditable()
-  List<Node> _querySelectorAll(String selectors) => wrap_jso_list(_blink.BlinkElement.instance.querySelectorAll_Callback_1_(unwrap_jso(this), selectors));
+  List<Node> _querySelectorAll(String selectors) => wrap_jso(_blink.BlinkElement.instance.querySelectorAll_Callback_1_(unwrap_jso(this), selectors));
   
   /// Stream of `abort` events handled by this [Element].
   @DomName('Element.onabort')
@@ -14360,6 +16497,20 @@
   @DomName('HTMLEmbedElement.HTMLEmbedElement')
   @DocsEditable()
   factory EmbedElement() => document.createElement("embed");
+
+
+  @Deprecated("Internal Use Only")
+  static EmbedElement internalCreateEmbedElement() {
+    return new EmbedElement._internalWrap();
+  }
+
+  factory EmbedElement._internalWrap() {
+    return new EmbedElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  EmbedElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -14376,7 +16527,7 @@
   
   @DomName('HTMLEmbedElement.height')
   @DocsEditable()
-  void set height(String value) => _blink.BlinkHTMLEmbedElement.instance.height_Setter_(unwrap_jso(this), value);
+  set height(String value) => _blink.BlinkHTMLEmbedElement.instance.height_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLEmbedElement.integrity')
   @DocsEditable()
@@ -14386,7 +16537,7 @@
   @DomName('HTMLEmbedElement.integrity')
   @DocsEditable()
   @Experimental() // untriaged
-  void set integrity(String value) => _blink.BlinkHTMLEmbedElement.instance.integrity_Setter_(unwrap_jso(this), value);
+  set integrity(String value) => _blink.BlinkHTMLEmbedElement.instance.integrity_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLEmbedElement.name')
   @DocsEditable()
@@ -14394,7 +16545,7 @@
   
   @DomName('HTMLEmbedElement.name')
   @DocsEditable()
-  void set name(String value) => _blink.BlinkHTMLEmbedElement.instance.name_Setter_(unwrap_jso(this), value);
+  set name(String value) => _blink.BlinkHTMLEmbedElement.instance.name_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLEmbedElement.src')
   @DocsEditable()
@@ -14402,7 +16553,7 @@
   
   @DomName('HTMLEmbedElement.src')
   @DocsEditable()
-  void set src(String value) => _blink.BlinkHTMLEmbedElement.instance.src_Setter_(unwrap_jso(this), value);
+  set src(String value) => _blink.BlinkHTMLEmbedElement.instance.src_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLEmbedElement.type')
   @DocsEditable()
@@ -14410,7 +16561,7 @@
   
   @DomName('HTMLEmbedElement.type')
   @DocsEditable()
-  void set type(String value) => _blink.BlinkHTMLEmbedElement.instance.type_Setter_(unwrap_jso(this), value);
+  set type(String value) => _blink.BlinkHTMLEmbedElement.instance.type_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLEmbedElement.width')
   @DocsEditable()
@@ -14418,7 +16569,7 @@
   
   @DomName('HTMLEmbedElement.width')
   @DocsEditable()
-  void set width(String value) => _blink.BlinkHTMLEmbedElement.instance.width_Setter_(unwrap_jso(this), value);
+  set width(String value) => _blink.BlinkHTMLEmbedElement.instance.width_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLEmbedElement.__getter__')
   @DocsEditable()
@@ -14451,10 +16602,25 @@
 @DomName('Entry')
 // http://www.w3.org/TR/file-system-api/#the-entry-interface
 @Experimental()
-class Entry extends NativeFieldWrapperClass2 {
+class Entry extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory Entry._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static Entry internalCreateEntry() {
+    return new Entry._internalWrap();
+  }
+
+  factory Entry._internalWrap() {
+    return new Entry.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  Entry.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('Entry.filesystem')
   @DocsEditable()
   FileSystem get filesystem => wrap_jso(_blink.BlinkEntry.instance.filesystem_Getter_(unwrap_jso(this)));
@@ -14477,11 +16643,11 @@
   
   void _copyTo(DirectoryEntry parent, {String name, _EntryCallback successCallback, _ErrorCallback errorCallback}) {
     if (errorCallback != null) {
-      _blink.BlinkEntry.instance.copyTo_Callback_4_(unwrap_jso(this), unwrap_jso(parent), name, unwrap_jso(successCallback), unwrap_jso(errorCallback));
+      _blink.BlinkEntry.instance.copyTo_Callback_4_(unwrap_jso(this), unwrap_jso(parent), name, unwrap_jso((entry) => successCallback(wrap_jso(entry))), unwrap_jso((error) => errorCallback(wrap_jso(error))));
       return;
     }
     if (successCallback != null) {
-      _blink.BlinkEntry.instance.copyTo_Callback_3_(unwrap_jso(this), unwrap_jso(parent), name, unwrap_jso(successCallback));
+      _blink.BlinkEntry.instance.copyTo_Callback_3_(unwrap_jso(this), unwrap_jso(parent), name, unwrap_jso((entry) => successCallback(wrap_jso(entry))));
       return;
     }
     if (name != null) {
@@ -14502,10 +16668,10 @@
 
   void _getMetadata(MetadataCallback successCallback, [_ErrorCallback errorCallback]) {
     if (errorCallback != null) {
-      _blink.BlinkEntry.instance.getMetadata_Callback_2_(unwrap_jso(this), unwrap_jso(successCallback), unwrap_jso(errorCallback));
+      _blink.BlinkEntry.instance.getMetadata_Callback_2_(unwrap_jso(this), unwrap_jso((metadata) => successCallback(wrap_jso(metadata))), unwrap_jso((error) => errorCallback(wrap_jso(error))));
       return;
     }
-    _blink.BlinkEntry.instance.getMetadata_Callback_1_(unwrap_jso(this), unwrap_jso(successCallback));
+    _blink.BlinkEntry.instance.getMetadata_Callback_1_(unwrap_jso(this), unwrap_jso((metadata) => successCallback(wrap_jso(metadata))));
     return;
   }
 
@@ -14519,11 +16685,11 @@
 
   void _getParent([_EntryCallback successCallback, _ErrorCallback errorCallback]) {
     if (errorCallback != null) {
-      _blink.BlinkEntry.instance.getParent_Callback_2_(unwrap_jso(this), unwrap_jso(successCallback), unwrap_jso(errorCallback));
+      _blink.BlinkEntry.instance.getParent_Callback_2_(unwrap_jso(this), unwrap_jso((entry) => successCallback(wrap_jso(entry))), unwrap_jso((error) => errorCallback(wrap_jso(error))));
       return;
     }
     if (successCallback != null) {
-      _blink.BlinkEntry.instance.getParent_Callback_1_(unwrap_jso(this), unwrap_jso(successCallback));
+      _blink.BlinkEntry.instance.getParent_Callback_1_(unwrap_jso(this), unwrap_jso((entry) => successCallback(wrap_jso(entry))));
       return;
     }
     _blink.BlinkEntry.instance.getParent_Callback_0_(unwrap_jso(this));
@@ -14540,11 +16706,11 @@
 
   void _moveTo(DirectoryEntry parent, {String name, _EntryCallback successCallback, _ErrorCallback errorCallback}) {
     if (errorCallback != null) {
-      _blink.BlinkEntry.instance.moveTo_Callback_4_(unwrap_jso(this), unwrap_jso(parent), name, unwrap_jso(successCallback), unwrap_jso(errorCallback));
+      _blink.BlinkEntry.instance.moveTo_Callback_4_(unwrap_jso(this), unwrap_jso(parent), name, unwrap_jso((entry) => successCallback(wrap_jso(entry))), unwrap_jso((error) => errorCallback(wrap_jso(error))));
       return;
     }
     if (successCallback != null) {
-      _blink.BlinkEntry.instance.moveTo_Callback_3_(unwrap_jso(this), unwrap_jso(parent), name, unwrap_jso(successCallback));
+      _blink.BlinkEntry.instance.moveTo_Callback_3_(unwrap_jso(this), unwrap_jso(parent), name, unwrap_jso((entry) => successCallback(wrap_jso(entry))));
       return;
     }
     if (name != null) {
@@ -14565,10 +16731,10 @@
 
   void _remove(VoidCallback successCallback, [_ErrorCallback errorCallback]) {
     if (errorCallback != null) {
-      _blink.BlinkEntry.instance.remove_Callback_2_(unwrap_jso(this), unwrap_jso(successCallback), unwrap_jso(errorCallback));
+      _blink.BlinkEntry.instance.remove_Callback_2_(unwrap_jso(this), unwrap_jso(() => successCallback()), unwrap_jso((error) => errorCallback(wrap_jso(error))));
       return;
     }
-    _blink.BlinkEntry.instance.remove_Callback_1_(unwrap_jso(this), unwrap_jso(successCallback));
+    _blink.BlinkEntry.instance.remove_Callback_1_(unwrap_jso(this), unwrap_jso(() => successCallback()));
     return;
   }
 
@@ -14621,6 +16787,20 @@
   // To suppress missing implicit constructor warnings.
   factory ErrorEvent._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static ErrorEvent internalCreateErrorEvent() {
+    return new ErrorEvent._internalWrap();
+  }
+
+  factory ErrorEvent._internalWrap() {
+    return new ErrorEvent.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  ErrorEvent.internal_() : super.internal_();
+
+
   @DomName('ErrorEvent.colno')
   @DocsEditable()
   @Experimental() // untriaged
@@ -14629,7 +16809,7 @@
   @DomName('ErrorEvent.error')
   @DocsEditable()
   @Experimental() // untriaged
-  Object get error => _blink.BlinkErrorEvent.instance.error_Getter_(unwrap_jso(this));
+  Object get error => wrap_jso(_blink.BlinkErrorEvent.instance.error_Getter_(unwrap_jso(this)));
   
   @DomName('ErrorEvent.filename')
   @DocsEditable()
@@ -14652,7 +16832,7 @@
 
 
 @DomName('Event')
-class Event extends NativeFieldWrapperClass2 {
+class Event extends DartHtmlDomObject {
   // In JS, canBubble and cancelable are technically required parameters to
   // init*Event. In practice, though, if they aren't provided they simply
   // default to false (since that's Boolean(undefined)).
@@ -14705,6 +16885,21 @@
   // To suppress missing implicit constructor warnings.
   factory Event._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static Event internalCreateEvent() {
+    return new Event._internalWrap();
+  }
+
+  factory Event._internalWrap() {
+    return new Event.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  Event.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   /**
    * This event is being handled by the event target.
    *
@@ -14793,7 +16988,7 @@
   @DocsEditable()
   // https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#extensions-to-event
   @Experimental()
-  List<Node> get path => wrap_jso_list(_blink.BlinkEvent.instance.path_Getter_(unwrap_jso(this)));
+  List<Node> get path => wrap_jso(_blink.BlinkEvent.instance.path_Getter_(unwrap_jso(this)));
   
   @DomName('Event.target')
   @DocsEditable()
@@ -14876,11 +17071,26 @@
   @DocsEditable()
   static EventSource _factoryEventSource(String url, [Map eventSourceInit]) {
     if (eventSourceInit != null) {
-      return _blink.BlinkEventSource.instance.constructorCallback_2_(url, eventSourceInit);
+      var eventSourceInit_1 = convertDartToNative_Dictionary(eventSourceInit);
+      return wrap_jso(_blink.BlinkEventSource.instance.constructorCallback_2_(url, eventSourceInit_1));
     }
-    return _blink.BlinkEventSource.instance.constructorCallback_1_(url);
+    return wrap_jso(_blink.BlinkEventSource.instance.constructorCallback_1_(url));
   }
 
+
+  @Deprecated("Internal Use Only")
+  static EventSource internalCreateEventSource() {
+    return new EventSource._internalWrap();
+  }
+
+  factory EventSource._internalWrap() {
+    return new EventSource.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  EventSource.internal_() : super.internal_();
+
+
   @DomName('EventSource.CLOSED')
   @DocsEditable()
   static const int CLOSED = 2;
@@ -15017,7 +17227,11 @@
  * for compile-time type checks and a more concise API.
  */
 @DomName('EventTarget')
-class EventTarget extends NativeFieldWrapperClass2 {
+class EventTarget extends DartHtmlDomObject {
+
+  // Default constructor to allow other classes e.g. GlobalEventHandlers to be
+  // constructed using _internalWrap when mapping Blink object to Dart class.
+  EventTarget();
 
   // Custom element created callback.
   EventTarget._created();
@@ -15049,13 +17263,28 @@
   // To suppress missing implicit constructor warnings.
   factory EventTarget._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static EventTarget internalCreateEventTarget() {
+    return new EventTarget._internalWrap();
+  }
+
+  factory EventTarget._internalWrap() {
+    return new EventTarget.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  EventTarget.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   void _addEventListener([String type, EventListener listener, bool useCapture]) {
     if (useCapture != null) {
-      _blink.BlinkEventTarget.instance.addEventListener_Callback_3_(unwrap_jso(this), type, unwrap_jso(listener), useCapture);
+      _blink.BlinkEventTarget.instance.addEventListener_Callback_3_(unwrap_jso(this), type, wrap_event_listener(this, listener), useCapture);
       return;
     }
     if (listener != null) {
-      _blink.BlinkEventTarget.instance.addEventListener_Callback_2_(unwrap_jso(this), type, unwrap_jso(listener));
+      _blink.BlinkEventTarget.instance.addEventListener_Callback_2_(unwrap_jso(this), type, wrap_event_listener(this, listener));
       return;
     }
     if (type != null) {
@@ -15072,11 +17301,11 @@
   
   void _removeEventListener([String type, EventListener listener, bool useCapture]) {
     if (useCapture != null) {
-      _blink.BlinkEventTarget.instance.removeEventListener_Callback_3_(unwrap_jso(this), type, unwrap_jso(listener), useCapture);
+      _blink.BlinkEventTarget.instance.removeEventListener_Callback_3_(unwrap_jso(this), type, _knownListeners[this.hashCode][identityHashCode(listener)], useCapture);
       return;
     }
     if (listener != null) {
-      _blink.BlinkEventTarget.instance.removeEventListener_Callback_2_(unwrap_jso(this), type, unwrap_jso(listener));
+      _blink.BlinkEventTarget.instance.removeEventListener_Callback_2_(unwrap_jso(this), type, _knownListeners[this.hashCode][identityHashCode(listener)]);
       return;
     }
     if (type != null) {
@@ -15102,6 +17331,20 @@
   // To suppress missing implicit constructor warnings.
   factory ExtendableEvent._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static ExtendableEvent internalCreateExtendableEvent() {
+    return new ExtendableEvent._internalWrap();
+  }
+
+  factory ExtendableEvent._internalWrap() {
+    return new ExtendableEvent.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  ExtendableEvent.internal_() : super.internal_();
+
+
   @DomName('ExtendableEvent.waitUntil')
   @DocsEditable()
   @Experimental() // untriaged
@@ -15125,9 +17368,23 @@
   @DomName('FederatedCredential.FederatedCredential')
   @DocsEditable()
   factory FederatedCredential(String id, String name, String avatarURL, String federation) {
-    return _blink.BlinkFederatedCredential.instance.constructorCallback_4_(id, name, avatarURL, federation);
+    return wrap_jso(_blink.BlinkFederatedCredential.instance.constructorCallback_4_(id, name, avatarURL, federation));
   }
 
+
+  @Deprecated("Internal Use Only")
+  static FederatedCredential internalCreateFederatedCredential() {
+    return new FederatedCredential._internalWrap();
+  }
+
+  factory FederatedCredential._internalWrap() {
+    return new FederatedCredential.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  FederatedCredential.internal_() : super.internal_();
+
+
   @DomName('FederatedCredential.federation')
   @DocsEditable()
   @Experimental() // untriaged
@@ -15148,6 +17405,20 @@
   // To suppress missing implicit constructor warnings.
   factory FetchEvent._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static FetchEvent internalCreateFetchEvent() {
+    return new FetchEvent._internalWrap();
+  }
+
+  factory FetchEvent._internalWrap() {
+    return new FetchEvent.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  FetchEvent.internal_() : super.internal_();
+
+
   @DomName('FetchEvent.isReload')
   @DocsEditable()
   @Experimental() // untriaged
@@ -15181,6 +17452,20 @@
   @DomName('HTMLFieldSetElement.HTMLFieldSetElement')
   @DocsEditable()
   factory FieldSetElement() => document.createElement("fieldset");
+
+
+  @Deprecated("Internal Use Only")
+  static FieldSetElement internalCreateFieldSetElement() {
+    return new FieldSetElement._internalWrap();
+  }
+
+  factory FieldSetElement._internalWrap() {
+    return new FieldSetElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  FieldSetElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -15194,11 +17479,11 @@
   
   @DomName('HTMLFieldSetElement.disabled')
   @DocsEditable()
-  void set disabled(bool value) => _blink.BlinkHTMLFieldSetElement.instance.disabled_Setter_(unwrap_jso(this), value);
+  set disabled(bool value) => _blink.BlinkHTMLFieldSetElement.instance.disabled_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLFieldSetElement.elements')
   @DocsEditable()
-  List<Node> get elements => wrap_jso_list(_blink.BlinkHTMLFieldSetElement.instance.elements_Getter_(unwrap_jso(this)));
+  List<Node> get elements => wrap_jso(_blink.BlinkHTMLFieldSetElement.instance.elements_Getter_(unwrap_jso(this)));
   
   @DomName('HTMLFieldSetElement.form')
   @DocsEditable()
@@ -15210,7 +17495,7 @@
   
   @DomName('HTMLFieldSetElement.name')
   @DocsEditable()
-  void set name(String value) => _blink.BlinkHTMLFieldSetElement.instance.name_Setter_(unwrap_jso(this), value);
+  set name(String value) => _blink.BlinkHTMLFieldSetElement.instance.name_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLFieldSetElement.type')
   @DocsEditable()
@@ -15250,6 +17535,20 @@
   // To suppress missing implicit constructor warnings.
   factory File._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static File internalCreateFile() {
+    return new File._internalWrap();
+  }
+
+  factory File._internalWrap() {
+    return new File.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  File.internal_() : super.internal_();
+
+
   @DomName('File.lastModified')
   @DocsEditable()
   @Experimental() // untriaged
@@ -15298,12 +17597,26 @@
   // To suppress missing implicit constructor warnings.
   factory FileEntry._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static FileEntry internalCreateFileEntry() {
+    return new FileEntry._internalWrap();
+  }
+
+  factory FileEntry._internalWrap() {
+    return new FileEntry.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  FileEntry.internal_() : super.internal_();
+
+
   void _createWriter(_FileWriterCallback successCallback, [_ErrorCallback errorCallback]) {
     if (errorCallback != null) {
-      _blink.BlinkFileEntry.instance.createWriter_Callback_2_(unwrap_jso(this), unwrap_jso(successCallback), unwrap_jso(errorCallback));
+      _blink.BlinkFileEntry.instance.createWriter_Callback_2_(unwrap_jso(this), unwrap_jso((fileWriter) => successCallback(wrap_jso(fileWriter))), unwrap_jso((error) => errorCallback(wrap_jso(error))));
       return;
     }
-    _blink.BlinkFileEntry.instance.createWriter_Callback_1_(unwrap_jso(this), unwrap_jso(successCallback));
+    _blink.BlinkFileEntry.instance.createWriter_Callback_1_(unwrap_jso(this), unwrap_jso((fileWriter) => successCallback(wrap_jso(fileWriter))));
     return;
   }
 
@@ -15317,10 +17630,10 @@
 
   void _file(_FileCallback successCallback, [_ErrorCallback errorCallback]) {
     if (errorCallback != null) {
-      _blink.BlinkFileEntry.instance.file_Callback_2_(unwrap_jso(this), unwrap_jso(successCallback), unwrap_jso(errorCallback));
+      _blink.BlinkFileEntry.instance.file_Callback_2_(unwrap_jso(this), unwrap_jso((file) => successCallback(wrap_jso(file))), unwrap_jso((error) => errorCallback(wrap_jso(error))));
       return;
     }
-    _blink.BlinkFileEntry.instance.file_Callback_1_(unwrap_jso(this), unwrap_jso(successCallback));
+    _blink.BlinkFileEntry.instance.file_Callback_1_(unwrap_jso(this), unwrap_jso((file) => successCallback(wrap_jso(file))));
     return;
   }
 
@@ -15348,6 +17661,20 @@
   // To suppress missing implicit constructor warnings.
   factory FileError._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static FileError internalCreateFileError() {
+    return new FileError._internalWrap();
+  }
+
+  factory FileError._internalWrap() {
+    return new FileError.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  FileError.internal_() : super.internal_();
+
+
   @DomName('FileError.ABORT_ERR')
   @DocsEditable()
   static const int ABORT_ERR = 3;
@@ -15410,10 +17737,25 @@
 
 @DocsEditable()
 @DomName('FileList')
-class FileList extends NativeFieldWrapperClass2 with ListMixin<File>, ImmutableListMixin<File> implements List<File> {
+class FileList extends DartHtmlDomObject with ListMixin<File>, ImmutableListMixin<File> implements List<File> {
   // To suppress missing implicit constructor warnings.
   factory FileList._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static FileList internalCreateFileList() {
+    return new FileList._internalWrap();
+  }
+
+  factory FileList._internalWrap() {
+    return new FileList.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  FileList.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('FileList.length')
   @DocsEditable()
   int get length => _blink.BlinkFileList.instance.length_Getter_(unwrap_jso(this));
@@ -15425,7 +17767,7 @@
   }
 
   File _nativeIndexedGetter(int index) => wrap_jso(_blink.BlinkFileList.instance.item_Callback_1_(unwrap_jso(this), index));
- 
+
   void operator[]=(int index, File value) {
     throw new UnsupportedError("Cannot assign element of immutable List.");
   }
@@ -15433,7 +17775,7 @@
   // File is the element type.
 
 
-  void set length(int value) {
+  set length(int value) {
     throw new UnsupportedError("Cannot resize immutable List.");
   }
 
@@ -15481,7 +17823,7 @@
   @DomName('FileReader.result')
   @DocsEditable()
   Object get result {
-    var res = _blink.BlinkFileReader.result_Getter(unwrap_jso(this));
+    var res = _blink.BlinkFileReader.instance.result_Getter_(unwrap_jso(this));
     if (res is ByteBuffer) {
       return new Uint8List.view(res);
     }
@@ -15554,9 +17896,23 @@
   @DomName('FileReader.FileReader')
   @DocsEditable()
   factory FileReader() {
-    return _blink.BlinkFileReader.instance.constructorCallback_0_();
+    return wrap_jso(_blink.BlinkFileReader.instance.constructorCallback_0_());
   }
 
+
+  @Deprecated("Internal Use Only")
+  static FileReader internalCreateFileReader() {
+    return new FileReader._internalWrap();
+  }
+
+  factory FileReader._internalWrap() {
+    return new FileReader.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  FileReader.internal_() : super.internal_();
+
+
   @DomName('FileReader.DONE')
   @DocsEditable()
   static const int DONE = 2;
@@ -15579,7 +17935,7 @@
   
   @DomName('FileReader.result')
   @DocsEditable()
-  Object get _result => _blink.BlinkFileReader.instance.result_Getter_(unwrap_jso(this));
+  Object get _result => wrap_jso(_blink.BlinkFileReader.instance.result_Getter_(unwrap_jso(this)));
   
   @DomName('FileReader.abort')
   @DocsEditable()
@@ -15643,10 +17999,25 @@
 @DocsEditable()
 @DomName('Stream')
 @Experimental() // untriaged
-class FileStream extends NativeFieldWrapperClass2 {
+class FileStream extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory FileStream._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static FileStream internalCreateFileStream() {
+    return new FileStream._internalWrap();
+  }
+
+  factory FileStream._internalWrap() {
+    return new FileStream.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  FileStream.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('Stream.type')
   @DocsEditable()
   @Experimental() // untriaged
@@ -15665,10 +18036,25 @@
 @SupportedBrowser(SupportedBrowser.CHROME)
 @Experimental()
 // http://www.w3.org/TR/file-system-api/
-class FileSystem extends NativeFieldWrapperClass2 {
+class FileSystem extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory FileSystem._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static FileSystem internalCreateFileSystem() {
+    return new FileSystem._internalWrap();
+  }
+
+  factory FileSystem._internalWrap() {
+    return new FileSystem.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  FileSystem.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   /// Checks if this type is supported on the current platform.
   static bool get supported => true;
 
@@ -15767,6 +18153,20 @@
   @DocsEditable()
   static const EventStreamProvider<ProgressEvent> writeStartEvent = const EventStreamProvider<ProgressEvent>('writestart');
 
+
+  @Deprecated("Internal Use Only")
+  static FileWriter internalCreateFileWriter() {
+    return new FileWriter._internalWrap();
+  }
+
+  factory FileWriter._internalWrap() {
+    return new FileWriter.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  FileWriter.internal_() : super.internal_();
+
+
   @DomName('FileWriter.DONE')
   @DocsEditable()
   static const int DONE = 2;
@@ -15866,6 +18266,20 @@
   // To suppress missing implicit constructor warnings.
   factory FocusEvent._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static FocusEvent internalCreateFocusEvent() {
+    return new FocusEvent._internalWrap();
+  }
+
+  factory FocusEvent._internalWrap() {
+    return new FocusEvent.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  FocusEvent.internal_() : super.internal_();
+
+
   @DomName('FocusEvent.relatedTarget')
   @DocsEditable()
   EventTarget get relatedTarget => wrap_jso(_blink.BlinkFocusEvent.instance.relatedTarget_Getter_(unwrap_jso(this)));
@@ -15881,7 +18295,7 @@
 @DocsEditable()
 @DomName('FontFace')
 @Experimental() // untriaged
-class FontFace extends NativeFieldWrapperClass2 {
+class FontFace extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory FontFace._() { throw new UnsupportedError("Not supported"); }
 
@@ -15889,26 +18303,44 @@
   @DocsEditable()
   factory FontFace(String family, source, [Map descriptors]) {
     if ((source is String || source == null) && (family is String || family == null) && descriptors == null) {
-      return _blink.BlinkFontFace.instance.constructorCallback_2_(family, source);
+      return wrap_jso(_blink.BlinkFontFace.instance.constructorCallback_2_(family, source));
     }
     if ((descriptors is Map || descriptors == null) && (source is String || source == null) && (family is String || family == null)) {
-      return _blink.BlinkFontFace.instance.constructorCallback_3_(family, source, descriptors);
+      var descriptors_1 = convertDartToNative_Dictionary(descriptors);
+      return wrap_jso(_blink.BlinkFontFace.instance.constructorCallback_3_(family, source, descriptors_1));
     }
     if ((source is TypedData || source == null) && (family is String || family == null) && descriptors == null) {
-      return _blink.BlinkFontFace.instance.constructorCallback_2_(family, source);
+      return wrap_jso(_blink.BlinkFontFace.instance.constructorCallback_2_(family, source));
     }
     if ((descriptors is Map || descriptors == null) && (source is TypedData || source == null) && (family is String || family == null)) {
-      return _blink.BlinkFontFace.instance.constructorCallback_3_(family, source, descriptors);
+      var descriptors_1 = convertDartToNative_Dictionary(descriptors);
+      return wrap_jso(_blink.BlinkFontFace.instance.constructorCallback_3_(family, source, descriptors_1));
     }
     if ((source is ByteBuffer || source == null) && (family is String || family == null) && descriptors == null) {
-      return _blink.BlinkFontFace.instance.constructorCallback_2_(family, source);
+      return wrap_jso(_blink.BlinkFontFace.instance.constructorCallback_2_(family, source));
     }
     if ((descriptors is Map || descriptors == null) && (source is ByteBuffer || source == null) && (family is String || family == null)) {
-      return _blink.BlinkFontFace.instance.constructorCallback_3_(family, source, descriptors);
+      var descriptors_1 = convertDartToNative_Dictionary(descriptors);
+      return wrap_jso(_blink.BlinkFontFace.instance.constructorCallback_3_(family, source, descriptors_1));
     }
     throw new ArgumentError("Incorrect number or type of arguments");
   }
 
+  @Deprecated("Internal Use Only")
+  static FontFace internalCreateFontFace() {
+    return new FontFace._internalWrap();
+  }
+
+  factory FontFace._internalWrap() {
+    return new FontFace.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  FontFace.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('FontFace.family')
   @DocsEditable()
   @Experimental() // untriaged
@@ -15917,7 +18349,7 @@
   @DomName('FontFace.family')
   @DocsEditable()
   @Experimental() // untriaged
-  void set family(String value) => _blink.BlinkFontFace.instance.family_Setter_(unwrap_jso(this), value);
+  set family(String value) => _blink.BlinkFontFace.instance.family_Setter_(unwrap_jso(this), value);
   
   @DomName('FontFace.featureSettings')
   @DocsEditable()
@@ -15927,12 +18359,12 @@
   @DomName('FontFace.featureSettings')
   @DocsEditable()
   @Experimental() // untriaged
-  void set featureSettings(String value) => _blink.BlinkFontFace.instance.featureSettings_Setter_(unwrap_jso(this), value);
+  set featureSettings(String value) => _blink.BlinkFontFace.instance.featureSettings_Setter_(unwrap_jso(this), value);
   
   @DomName('FontFace.loaded')
   @DocsEditable()
   @Experimental() // untriaged
-  Future get loaded => _blink.BlinkFontFace.instance.loaded_Getter_(unwrap_jso(this));
+  Future get loaded => wrap_jso(_blink.BlinkFontFace.instance.loaded_Getter_(unwrap_jso(this)));
   
   @DomName('FontFace.status')
   @DocsEditable()
@@ -15947,7 +18379,7 @@
   @DomName('FontFace.stretch')
   @DocsEditable()
   @Experimental() // untriaged
-  void set stretch(String value) => _blink.BlinkFontFace.instance.stretch_Setter_(unwrap_jso(this), value);
+  set stretch(String value) => _blink.BlinkFontFace.instance.stretch_Setter_(unwrap_jso(this), value);
   
   @DomName('FontFace.style')
   @DocsEditable()
@@ -15957,7 +18389,7 @@
   @DomName('FontFace.style')
   @DocsEditable()
   @Experimental() // untriaged
-  void set style(String value) => _blink.BlinkFontFace.instance.style_Setter_(unwrap_jso(this), value);
+  set style(String value) => _blink.BlinkFontFace.instance.style_Setter_(unwrap_jso(this), value);
   
   @DomName('FontFace.unicodeRange')
   @DocsEditable()
@@ -15967,7 +18399,7 @@
   @DomName('FontFace.unicodeRange')
   @DocsEditable()
   @Experimental() // untriaged
-  void set unicodeRange(String value) => _blink.BlinkFontFace.instance.unicodeRange_Setter_(unwrap_jso(this), value);
+  set unicodeRange(String value) => _blink.BlinkFontFace.instance.unicodeRange_Setter_(unwrap_jso(this), value);
   
   @DomName('FontFace.variant')
   @DocsEditable()
@@ -15977,7 +18409,7 @@
   @DomName('FontFace.variant')
   @DocsEditable()
   @Experimental() // untriaged
-  void set variant(String value) => _blink.BlinkFontFace.instance.variant_Setter_(unwrap_jso(this), value);
+  set variant(String value) => _blink.BlinkFontFace.instance.variant_Setter_(unwrap_jso(this), value);
   
   @DomName('FontFace.weight')
   @DocsEditable()
@@ -15987,12 +18419,12 @@
   @DomName('FontFace.weight')
   @DocsEditable()
   @Experimental() // untriaged
-  void set weight(String value) => _blink.BlinkFontFace.instance.weight_Setter_(unwrap_jso(this), value);
+  set weight(String value) => _blink.BlinkFontFace.instance.weight_Setter_(unwrap_jso(this), value);
   
   @DomName('FontFace.load')
   @DocsEditable()
   @Experimental() // untriaged
-  Future load() => _blink.BlinkFontFace.instance.load_Callback_0_(unwrap_jso(this));
+  Future load() => wrap_jso(_blink.BlinkFontFace.instance.load_Callback_0_(unwrap_jso(this)));
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -16009,6 +18441,20 @@
   // To suppress missing implicit constructor warnings.
   factory FontFaceSet._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static FontFaceSet internalCreateFontFaceSet() {
+    return new FontFaceSet._internalWrap();
+  }
+
+  factory FontFaceSet._internalWrap() {
+    return new FontFaceSet.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  FontFaceSet.internal_() : super.internal_();
+
+
   @DomName('FontFaceSet.size')
   @DocsEditable()
   @Experimental() // untriaged
@@ -16043,10 +18489,10 @@
   
   void forEach(FontFaceSetForEachCallback callback, [Object thisArg]) {
     if (thisArg != null) {
-      _blink.BlinkFontFaceSet.instance.forEach_Callback_2_(unwrap_jso(this), unwrap_jso(callback), thisArg);
+      _blink.BlinkFontFaceSet.instance.forEach_Callback_2_(unwrap_jso(this), unwrap_jso((fontFace, fontFaceAgain, set) => callback(wrap_jso(fontFace), wrap_jso(fontFaceAgain), wrap_jso(set))), thisArg);
       return;
     }
-    _blink.BlinkFontFaceSet.instance.forEach_Callback_1_(unwrap_jso(this), unwrap_jso(callback));
+    _blink.BlinkFontFaceSet.instance.forEach_Callback_1_(unwrap_jso(this), unwrap_jso((fontFace, fontFaceAgain, set) => callback(wrap_jso(fontFace), wrap_jso(fontFaceAgain), wrap_jso(set))));
     return;
   }
 
@@ -16080,10 +18526,24 @@
   // To suppress missing implicit constructor warnings.
   factory FontFaceSetLoadEvent._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static FontFaceSetLoadEvent internalCreateFontFaceSetLoadEvent() {
+    return new FontFaceSetLoadEvent._internalWrap();
+  }
+
+  factory FontFaceSetLoadEvent._internalWrap() {
+    return new FontFaceSetLoadEvent.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  FontFaceSetLoadEvent.internal_() : super.internal_();
+
+
   @DomName('FontFaceSetLoadEvent.fontfaces')
   @DocsEditable()
   @Experimental() // untriaged
-  List<FontFace> get fontfaces => _blink.BlinkFontFaceSetLoadEvent.instance.fontfaces_Getter_(unwrap_jso(this));
+  List<FontFace> get fontfaces => wrap_jso(_blink.BlinkFontFaceSetLoadEvent.instance.fontfaces_Getter_(unwrap_jso(this)));
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -16099,7 +18559,7 @@
 @SupportedBrowser(SupportedBrowser.FIREFOX)
 @SupportedBrowser(SupportedBrowser.IE, '10')
 @SupportedBrowser(SupportedBrowser.SAFARI)
-class FormData extends NativeFieldWrapperClass2 {
+class FormData extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory FormData._() { throw new UnsupportedError("Not supported"); }
 
@@ -16108,7 +18568,22 @@
   factory FormData([FormElement form]) => wrap_jso(_create(form));
 
   @DocsEditable()
-  static FormData _create(form) => _blink.BlinkFormData.instance.constructorCallback_1_(form);
+  static FormData _create(form) => wrap_jso(_blink.BlinkFormData.instance.constructorCallback_1_(form));
+
+  @Deprecated("Internal Use Only")
+  static FormData internalCreateFormData() {
+    return new FormData._internalWrap();
+  }
+
+  factory FormData._internalWrap() {
+    return new FormData.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  FormData.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
 
   /// Checks if this type is supported on the current platform.
   static bool get supported => true;
@@ -16138,6 +18613,20 @@
   @DomName('HTMLFormElement.HTMLFormElement')
   @DocsEditable()
   factory FormElement() => document.createElement("form");
+
+
+  @Deprecated("Internal Use Only")
+  static FormElement internalCreateFormElement() {
+    return new FormElement._internalWrap();
+  }
+
+  factory FormElement._internalWrap() {
+    return new FormElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  FormElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -16151,7 +18640,7 @@
   
   @DomName('HTMLFormElement.acceptCharset')
   @DocsEditable()
-  void set acceptCharset(String value) => _blink.BlinkHTMLFormElement.instance.acceptCharset_Setter_(unwrap_jso(this), value);
+  set acceptCharset(String value) => _blink.BlinkHTMLFormElement.instance.acceptCharset_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLFormElement.action')
   @DocsEditable()
@@ -16159,7 +18648,7 @@
   
   @DomName('HTMLFormElement.action')
   @DocsEditable()
-  void set action(String value) => _blink.BlinkHTMLFormElement.instance.action_Setter_(unwrap_jso(this), value);
+  set action(String value) => _blink.BlinkHTMLFormElement.instance.action_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLFormElement.autocomplete')
   @DocsEditable()
@@ -16171,7 +18660,7 @@
   @DocsEditable()
   // http://www.whatwg.org/specs/web-apps/current-work/multipage/association-of-controls-and-forms.html#autofilling-form-controls:-the-autocomplete-attribute
   @Experimental()
-  void set autocomplete(String value) => _blink.BlinkHTMLFormElement.instance.autocomplete_Setter_(unwrap_jso(this), value);
+  set autocomplete(String value) => _blink.BlinkHTMLFormElement.instance.autocomplete_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLFormElement.encoding')
   @DocsEditable()
@@ -16179,7 +18668,7 @@
   
   @DomName('HTMLFormElement.encoding')
   @DocsEditable()
-  void set encoding(String value) => _blink.BlinkHTMLFormElement.instance.encoding_Setter_(unwrap_jso(this), value);
+  set encoding(String value) => _blink.BlinkHTMLFormElement.instance.encoding_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLFormElement.enctype')
   @DocsEditable()
@@ -16187,7 +18676,7 @@
   
   @DomName('HTMLFormElement.enctype')
   @DocsEditable()
-  void set enctype(String value) => _blink.BlinkHTMLFormElement.instance.enctype_Setter_(unwrap_jso(this), value);
+  set enctype(String value) => _blink.BlinkHTMLFormElement.instance.enctype_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLFormElement.length')
   @DocsEditable()
@@ -16199,7 +18688,7 @@
   
   @DomName('HTMLFormElement.method')
   @DocsEditable()
-  void set method(String value) => _blink.BlinkHTMLFormElement.instance.method_Setter_(unwrap_jso(this), value);
+  set method(String value) => _blink.BlinkHTMLFormElement.instance.method_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLFormElement.name')
   @DocsEditable()
@@ -16207,7 +18696,7 @@
   
   @DomName('HTMLFormElement.name')
   @DocsEditable()
-  void set name(String value) => _blink.BlinkHTMLFormElement.instance.name_Setter_(unwrap_jso(this), value);
+  set name(String value) => _blink.BlinkHTMLFormElement.instance.name_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLFormElement.noValidate')
   @DocsEditable()
@@ -16215,7 +18704,7 @@
   
   @DomName('HTMLFormElement.noValidate')
   @DocsEditable()
-  void set noValidate(bool value) => _blink.BlinkHTMLFormElement.instance.noValidate_Setter_(unwrap_jso(this), value);
+  set noValidate(bool value) => _blink.BlinkHTMLFormElement.instance.noValidate_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLFormElement.target')
   @DocsEditable()
@@ -16223,14 +18712,14 @@
   
   @DomName('HTMLFormElement.target')
   @DocsEditable()
-  void set target(String value) => _blink.BlinkHTMLFormElement.instance.target_Setter_(unwrap_jso(this), value);
+  set target(String value) => _blink.BlinkHTMLFormElement.instance.target_Setter_(unwrap_jso(this), value);
   
   Element __getter__(index_OR_name) {
     if ((index_OR_name is int || index_OR_name == null)) {
       return wrap_jso(_blink.BlinkHTMLFormElement.instance.$__getter___Callback_1_(unwrap_jso(this), unwrap_jso(index_OR_name)));
     }
     if ((index_OR_name is String || index_OR_name == null)) {
-      return _blink.BlinkHTMLFormElement.instance.$__getter___Callback_1_(unwrap_jso(this), unwrap_jso(index_OR_name));
+      return wrap_jso(_blink.BlinkHTMLFormElement.instance.$__getter___Callback_1_(unwrap_jso(this), unwrap_jso(index_OR_name)));
     }
     throw new ArgumentError("Incorrect number or type of arguments");
   }
@@ -16243,7 +18732,7 @@
   @DocsEditable()
   // http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2012-October/037711.html
   @Experimental()
-  void requestAutocomplete(Map details) => _blink.BlinkHTMLFormElement.instance.requestAutocomplete_Callback_1_(unwrap_jso(this), details);
+  void requestAutocomplete(Map details) => _blink.BlinkHTMLFormElement.instance.requestAutocomplete_Callback_1_(unwrap_jso(this), convertDartToNative_Dictionary(details));
   
   @DomName('HTMLFormElement.reset')
   @DocsEditable()
@@ -16265,13 +18754,28 @@
 @DomName('Gamepad')
 // https://dvcs.w3.org/hg/gamepad/raw-file/default/gamepad.html#gamepad-interface
 @Experimental()
-class Gamepad extends NativeFieldWrapperClass2 {
+class Gamepad extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory Gamepad._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static Gamepad internalCreateGamepad() {
+    return new Gamepad._internalWrap();
+  }
+
+  factory Gamepad._internalWrap() {
+    return new Gamepad.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  Gamepad.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('Gamepad.axes')
   @DocsEditable()
-  List<num> get axes => _blink.BlinkGamepad.instance.axes_Getter_(unwrap_jso(this));
+  List<num> get axes => wrap_jso(_blink.BlinkGamepad.instance.axes_Getter_(unwrap_jso(this)));
   
   @DomName('Gamepad.connected')
   @DocsEditable()
@@ -16306,10 +18810,25 @@
 @DocsEditable()
 @DomName('GamepadButton')
 @Experimental() // untriaged
-class GamepadButton extends NativeFieldWrapperClass2 {
+class GamepadButton extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory GamepadButton._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static GamepadButton internalCreateGamepadButton() {
+    return new GamepadButton._internalWrap();
+  }
+
+  factory GamepadButton._internalWrap() {
+    return new GamepadButton.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  GamepadButton.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('GamepadButton.pressed')
   @DocsEditable()
   @Experimental() // untriaged
@@ -16318,7 +18837,7 @@
   @DomName('GamepadButton.value')
   @DocsEditable()
   @Experimental() // untriaged
-  double get value => _blink.BlinkGamepadButton.instance.value_Getter_(unwrap_jso(this));
+  num get value => _blink.BlinkGamepadButton.instance.value_Getter_(unwrap_jso(this));
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -16335,6 +18854,20 @@
   // To suppress missing implicit constructor warnings.
   factory GamepadEvent._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static GamepadEvent internalCreateGamepadEvent() {
+    return new GamepadEvent._internalWrap();
+  }
+
+  factory GamepadEvent._internalWrap() {
+    return new GamepadEvent.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  GamepadEvent.internal_() : super.internal_();
+
+
   @DomName('GamepadEvent.gamepad')
   @DocsEditable()
   @Experimental() // untriaged
@@ -16351,24 +18884,39 @@
 @DocsEditable()
 @DomName('Geofencing')
 @Experimental() // untriaged
-class Geofencing extends NativeFieldWrapperClass2 {
+class Geofencing extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory Geofencing._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static Geofencing internalCreateGeofencing() {
+    return new Geofencing._internalWrap();
+  }
+
+  factory Geofencing._internalWrap() {
+    return new Geofencing.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  Geofencing.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('Geofencing.getRegisteredRegions')
   @DocsEditable()
   @Experimental() // untriaged
-  Future getRegisteredRegions() => _blink.BlinkGeofencing.instance.getRegisteredRegions_Callback_0_(unwrap_jso(this));
+  Future getRegisteredRegions() => wrap_jso(_blink.BlinkGeofencing.instance.getRegisteredRegions_Callback_0_(unwrap_jso(this)));
   
   @DomName('Geofencing.registerRegion')
   @DocsEditable()
   @Experimental() // untriaged
-  Future registerRegion(GeofencingRegion region) => _blink.BlinkGeofencing.instance.registerRegion_Callback_1_(unwrap_jso(this), unwrap_jso(region));
+  Future registerRegion(GeofencingRegion region) => wrap_jso(_blink.BlinkGeofencing.instance.registerRegion_Callback_1_(unwrap_jso(this), unwrap_jso(region)));
   
   @DomName('Geofencing.unregisterRegion')
   @DocsEditable()
   @Experimental() // untriaged
-  Future unregisterRegion(String regionId) => _blink.BlinkGeofencing.instance.unregisterRegion_Callback_1_(unwrap_jso(this), regionId);
+  Future unregisterRegion(String regionId) => wrap_jso(_blink.BlinkGeofencing.instance.unregisterRegion_Callback_1_(unwrap_jso(this), regionId));
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -16381,10 +18929,25 @@
 @DocsEditable()
 @DomName('GeofencingRegion')
 @Experimental() // untriaged
-class GeofencingRegion extends NativeFieldWrapperClass2 {
+class GeofencingRegion extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory GeofencingRegion._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static GeofencingRegion internalCreateGeofencingRegion() {
+    return new GeofencingRegion._internalWrap();
+  }
+
+  factory GeofencingRegion._internalWrap() {
+    return new GeofencingRegion.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  GeofencingRegion.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('GeofencingRegion.id')
   @DocsEditable()
   @Experimental() // untriaged
@@ -16399,7 +18962,7 @@
 @DocsEditable()
 @DomName('Geolocation')
 @Unstable()
-class Geolocation extends NativeFieldWrapperClass2 {
+class Geolocation extends DartHtmlDomObject {
 
   @DomName('Geolocation.getCurrentPosition')
   Future<Geoposition> getCurrentPosition({bool enableHighAccuracy,
@@ -16474,31 +19037,46 @@
   // To suppress missing implicit constructor warnings.
   factory Geolocation._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static Geolocation internalCreateGeolocation() {
+    return new Geolocation._internalWrap();
+  }
+
+  factory Geolocation._internalWrap() {
+    return new Geolocation.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  Geolocation.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('Geolocation.clearWatch')
   @DocsEditable()
   void _clearWatch(int watchID) => _blink.BlinkGeolocation.instance.clearWatch_Callback_1_(unwrap_jso(this), watchID);
   
   void _getCurrentPosition(_PositionCallback successCallback, [_PositionErrorCallback errorCallback, Map options]) {
     if (options != null) {
-      _blink.BlinkGeolocation.instance.getCurrentPosition_Callback_3_(unwrap_jso(this), unwrap_jso(successCallback), unwrap_jso(errorCallback), options);
+      _blink.BlinkGeolocation.instance.getCurrentPosition_Callback_3_(unwrap_jso(this), unwrap_jso((position) => successCallback(wrap_jso(position))), unwrap_jso((error) => errorCallback(wrap_jso(error))), convertDartToNative_Dictionary(options));
       return;
     }
     if (errorCallback != null) {
-      _blink.BlinkGeolocation.instance.getCurrentPosition_Callback_2_(unwrap_jso(this), unwrap_jso(successCallback), unwrap_jso(errorCallback));
+      _blink.BlinkGeolocation.instance.getCurrentPosition_Callback_2_(unwrap_jso(this), unwrap_jso((position) => successCallback(wrap_jso(position))), unwrap_jso((error) => errorCallback(wrap_jso(error))));
       return;
     }
-    _blink.BlinkGeolocation.instance.getCurrentPosition_Callback_1_(unwrap_jso(this), unwrap_jso(successCallback));
+    _blink.BlinkGeolocation.instance.getCurrentPosition_Callback_1_(unwrap_jso(this), unwrap_jso((position) => successCallback(wrap_jso(position))));
     return;
   }
 
   int _watchPosition(_PositionCallback successCallback, [_PositionErrorCallback errorCallback, Map options]) {
     if (options != null) {
-      return _blink.BlinkGeolocation.instance.watchPosition_Callback_3_(unwrap_jso(this), unwrap_jso(successCallback), unwrap_jso(errorCallback), options);
+      return _blink.BlinkGeolocation.instance.watchPosition_Callback_3_(unwrap_jso(this), unwrap_jso((position) => successCallback(wrap_jso(position))), unwrap_jso((error) => errorCallback(wrap_jso(error))), convertDartToNative_Dictionary(options));
     }
     if (errorCallback != null) {
-      return _blink.BlinkGeolocation.instance.watchPosition_Callback_2_(unwrap_jso(this), unwrap_jso(successCallback), unwrap_jso(errorCallback));
+      return _blink.BlinkGeolocation.instance.watchPosition_Callback_2_(unwrap_jso(this), unwrap_jso((position) => successCallback(wrap_jso(position))), unwrap_jso((error) => errorCallback(wrap_jso(error))));
     }
-    return _blink.BlinkGeolocation.instance.watchPosition_Callback_1_(unwrap_jso(this), unwrap_jso(successCallback));
+    return _blink.BlinkGeolocation.instance.watchPosition_Callback_1_(unwrap_jso(this), unwrap_jso((position) => successCallback(wrap_jso(position))));
   }
 }
 
@@ -16512,10 +19090,25 @@
 @DocsEditable()
 @DomName('Geoposition')
 @Unstable()
-class Geoposition extends NativeFieldWrapperClass2 {
+class Geoposition extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory Geoposition._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static Geoposition internalCreateGeoposition() {
+    return new Geoposition._internalWrap();
+  }
+
+  factory Geoposition._internalWrap() {
+    return new Geoposition.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  Geoposition.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('Geoposition.coords')
   @DocsEditable()
   Coordinates get coords => wrap_jso(_blink.BlinkGeoposition.instance.coords_Getter_(unwrap_jso(this)));
@@ -17076,6 +19669,20 @@
   @DomName('HTMLHRElement.HTMLHRElement')
   @DocsEditable()
   factory HRElement() => document.createElement("hr");
+
+
+  @Deprecated("Internal Use Only")
+  static HRElement internalCreateHRElement() {
+    return new HRElement._internalWrap();
+  }
+
+  factory HRElement._internalWrap() {
+    return new HRElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  HRElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -17091,7 +19698,7 @@
   @DomName('HTMLHRElement.color')
   @DocsEditable()
   @Experimental() // untriaged
-  void set color(String value) => _blink.BlinkHTMLHRElement.instance.color_Setter_(unwrap_jso(this), value);
+  set color(String value) => _blink.BlinkHTMLHRElement.instance.color_Setter_(unwrap_jso(this), value);
   
 }
 // Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
@@ -17116,6 +19723,20 @@
   // To suppress missing implicit constructor warnings.
   factory HashChangeEvent._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static HashChangeEvent internalCreateHashChangeEvent() {
+    return new HashChangeEvent._internalWrap();
+  }
+
+  factory HashChangeEvent._internalWrap() {
+    return new HashChangeEvent.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  HashChangeEvent.internal_() : super.internal_();
+
+
   /// Checks if this type is supported on the current platform.
   static bool get supported => true;
 
@@ -17148,6 +19769,20 @@
   @DomName('HTMLHeadElement.HTMLHeadElement')
   @DocsEditable()
   factory HeadElement() => document.createElement("head");
+
+
+  @Deprecated("Internal Use Only")
+  static HeadElement internalCreateHeadElement() {
+    return new HeadElement._internalWrap();
+  }
+
+  factory HeadElement._internalWrap() {
+    return new HeadElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  HeadElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -17166,7 +19801,7 @@
 @DocsEditable()
 @DomName('Headers')
 @Experimental() // untriaged
-class Headers extends NativeFieldWrapperClass2 {
+class Headers extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory Headers._() { throw new UnsupportedError("Not supported"); }
 
@@ -17174,17 +19809,33 @@
   @DocsEditable()
   factory Headers([input]) {
     if (input == null) {
-      return _blink.BlinkHeaders.instance.constructorCallback_0_();
+      return wrap_jso(_blink.BlinkHeaders.instance.constructorCallback_0_());
     }
     if ((input is Headers || input == null)) {
-      return _blink.BlinkHeaders.instance.constructorCallback_1_(input);
+      return wrap_jso(_blink.BlinkHeaders.instance.constructorCallback_1_(input));
     }
     if ((input is Map || input == null)) {
-      return _blink.BlinkHeaders.instance.constructorCallback_1_(input);
+      var input_1 = convertDartToNative_Dictionary(input);
+      return wrap_jso(_blink.BlinkHeaders.instance.constructorCallback_1_(input_1));
     }
     throw new ArgumentError("Incorrect number or type of arguments");
   }
 
+  @Deprecated("Internal Use Only")
+  static Headers internalCreateHeaders() {
+    return new Headers._internalWrap();
+  }
+
+  factory Headers._internalWrap() {
+    return new Headers.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  Headers.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('Headers.size')
   @DocsEditable()
   @Experimental() // untriaged
@@ -17192,10 +19843,10 @@
   
   void forEach(HeadersForEachCallback callback, [Object thisArg]) {
     if (thisArg != null) {
-      _blink.BlinkHeaders.instance.forEach_Callback_2_(unwrap_jso(this), unwrap_jso(callback), thisArg);
+      _blink.BlinkHeaders.instance.forEach_Callback_2_(unwrap_jso(this), unwrap_jso((String value, String key, map) => callback(value, key, wrap_jso(map))), thisArg);
       return;
     }
-    _blink.BlinkHeaders.instance.forEach_Callback_1_(unwrap_jso(this), unwrap_jso(callback));
+    _blink.BlinkHeaders.instance.forEach_Callback_1_(unwrap_jso(this), unwrap_jso((String value, String key, map) => callback(value, key, wrap_jso(map))));
     return;
   }
 
@@ -17246,6 +19897,20 @@
   @DomName('HTMLHeadingElement.HTMLHeadingElement')
   @DocsEditable()
   factory HeadingElement.h6() => document.createElement("h6");
+
+
+  @Deprecated("Internal Use Only")
+  static HeadingElement internalCreateHeadingElement() {
+    return new HeadingElement._internalWrap();
+  }
+
+  factory HeadingElement._internalWrap() {
+    return new HeadingElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  HeadingElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -17260,7 +19925,7 @@
 
 
 @DomName('History')
-class History extends NativeFieldWrapperClass2 implements HistoryBase {
+class History extends DartHtmlDomObject implements HistoryBase {
 
   /**
    * Checks if the State APIs are supported on the current platform.
@@ -17275,6 +19940,21 @@
   // To suppress missing implicit constructor warnings.
   factory History._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static History internalCreateHistory() {
+    return new History._internalWrap();
+  }
+
+  factory History._internalWrap() {
+    return new History.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  History.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('History.length')
   @DocsEditable()
   int get length => _blink.BlinkHistory.instance.length_Getter_(unwrap_jso(this));
@@ -17320,10 +20000,25 @@
 
 @DocsEditable()
 @DomName('HTMLCollection')
-class HtmlCollection extends NativeFieldWrapperClass2 with ListMixin<Node>, ImmutableListMixin<Node> implements List<Node> {
+class HtmlCollection extends DartHtmlDomObject with ListMixin<Node>, ImmutableListMixin<Node> implements List<Node> {
   // To suppress missing implicit constructor warnings.
   factory HtmlCollection._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static HtmlCollection internalCreateHtmlCollection() {
+    return new HtmlCollection._internalWrap();
+  }
+
+  factory HtmlCollection._internalWrap() {
+    return new HtmlCollection.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  HtmlCollection.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('HTMLCollection.length')
   @DocsEditable()
   int get length => _blink.BlinkHTMLCollection.instance.length_Getter_(unwrap_jso(this));
@@ -17335,7 +20030,7 @@
   }
 
   Node _nativeIndexedGetter(int index) => wrap_jso(_blink.BlinkHTMLCollection.instance.item_Callback_1_(unwrap_jso(this), index));
- 
+
   void operator[]=(int index, Node value) {
     throw new UnsupportedError("Cannot assign element of immutable List.");
   }
@@ -17343,7 +20038,7 @@
   // Node is the element type.
 
 
-  void set length(int value) {
+  set length(int value) {
     throw new UnsupportedError("Cannot resize immutable List.");
   }
 
@@ -17396,11 +20091,25 @@
   factory HtmlDocument._() { throw new UnsupportedError("Not supported"); }
 
 
+  @Deprecated("Internal Use Only")
+  static HtmlDocument internalCreateHtmlDocument() {
+    return new HtmlDocument._internalWrap();
+  }
+
+  factory HtmlDocument._internalWrap() {
+    return new HtmlDocument.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  HtmlDocument.internal_() : super.internal_();
+
+
+
   @DomName('Document.body')
   BodyElement get body => _body;
 
   @DomName('Document.body')
-  void set body(BodyElement value) {
+  set body(BodyElement value) {
     _body = value;
   }
 
@@ -17467,7 +20176,7 @@
 
   @DomName('Document.selectedStylesheetSet')
   String get selectedStylesheetSet => _selectedStylesheetSet;
-  void set selectedStylesheetSet(String value) {
+  set selectedStylesheetSet(String value) {
     _selectedStylesheetSet = value;
   }
 
@@ -17478,7 +20187,7 @@
   String get title => _title;
 
   @DomName('Document.title')
-  void set title(String value) {
+  set title(String value) {
     _title = value;
   }
 
@@ -17559,6 +20268,138 @@
   @Experimental()
   String get visibilityState => _webkitVisibilityState;
 
+  /**
+   * Internal routine to find the DOM JS class name being extended for custom
+   * elements.
+   */
+  String _getJSClassName(ClassMirror classMirror) {
+    var jsClassName = null;
+    var isElement = false;
+
+    while (classMirror.superclass != null) {
+      var fullName = classMirror.superclass.qualifiedName;
+      isElement = isElement ||
+          (fullName == #dart.dom.html.Element || fullName == #dart.dom.svg.Element);
+
+      var domLibrary = MirrorSystem.getName(fullName).startsWith('dart.dom.');
+      if (jsClassName == null && domLibrary) {
+        // Lookup JS class name (if not found).
+        var metadatas = classMirror.metadata;
+        for (var metadata in metadatas) {
+          var metaDataMirror = metadata.reflectee;
+          var metaType = reflectClass(metaDataMirror.runtimeType);
+          if (MirrorSystem.getName(metaType.simpleName) == 'DomName' &&
+              (metaDataMirror.name.startsWith('HTML') || metaDataMirror.name.startsWith('SVG'))) {
+            jsClassName = metadata.reflectee.name;
+          }
+        }
+      }
+
+      classMirror = classMirror.superclass;
+    }
+
+    // If we're an element then everything is okay.
+    return isElement ? jsClassName : null;
+  }
+
+  // Get the first class that's a super of a dart.dom library.
+  ClassMirror _getDartHtmlClassName(ClassMirror classMirror) {
+    while (classMirror.superclass != null) {
+      var fullName = classMirror.superclass.qualifiedName;
+      var domLibrary = MirrorSystem.getName(fullName).startsWith('dart.dom.');
+      if (domLibrary) {
+        return classMirror.superclass;
+      }
+
+      classMirror = classMirror.superclass;
+    }
+
+    return null;
+  }
+
+  /**
+   * Get the class that immediately derived from a class in dart:html or
+   * dart:svg (has an attribute DomName of either HTML* or SVG*).
+   */
+  ClassMirror _getDomSuperClass(ClassMirror classMirror) {
+    var isElement = false;
+    var foundSuperElement = null;
+
+    while (classMirror.superclass != null) {
+      var fullName = classMirror.superclass.qualifiedName;
+      isElement = isElement || (fullName == #dart.dom.html.Element || fullName == #dart.dom.svg.Element);
+
+      var domLibrary = MirrorSystem.getName(fullName).startsWith('dart.dom.');
+      if (domLibrary) {
+        if (foundSuperElement == null) {
+          foundSuperElement = classMirror.superclass;
+        }
+        // Lookup JS class (if not found).
+        var metadatas = classMirror.metadata;
+        for (var metadata in metadatas) {
+          var metaDataMirror = metadata.reflectee;
+          var metaType = reflectClass(metaDataMirror.runtimeType);
+          if (MirrorSystem.getName(metaType.simpleName) == 'DomName' &&
+              (metaDataMirror.name.startsWith('HTML') || metaDataMirror.name.startsWith('SVG'))) {
+            if (isElement) return foundSuperElement;
+          }
+        }
+      }
+
+      classMirror = classMirror.superclass;
+    }
+
+    return null;
+  }
+
+  /**
+   * Does this CustomElement class have:
+   *
+   *   - a created constructor with no arguments?
+   *   - a created constructor with a super.created() initializer?
+   *
+   * e.g.,    MyCustomClass.created() : super.created();
+   */
+  bool _hasCreatedConstructor(ClassMirror classToRegister) {
+    var htmlClassMirror = _getDomSuperClass(classToRegister);
+
+    var classMirror = classToRegister;
+    while (classMirror != null && classMirror != htmlClassMirror) {
+      var createdParametersValid = false;
+      var superCreatedCalled = false;
+      var className = MirrorSystem.getName(classMirror.simpleName);
+      var methodMirror = classMirror.declarations[new Symbol("$className.created")];
+      if (methodMirror != null && methodMirror.isConstructor) {
+        createdParametersValid = true;                // Assume no parameters.
+        if (methodMirror.parameters.length != 0) {
+          // If any parameters each one must be optional.
+          methodMirror.parameters.forEach((parameter) {
+            createdParametersValid = createdParametersValid && parameter.isOptional;
+          });
+        }
+
+        // Get the created constructor source and look at the initializer;
+        // Must call super.created() if not its as an error.
+        var createdSource = methodMirror.source;
+        superCreatedCalled = createdSource.contains("super.created(");
+      }
+
+      if (!superCreatedCalled) {
+        throw new DomException.jsInterop('created constructor initializer must call super.created()');
+      } else if (!createdParametersValid) {
+        throw new DomException.jsInterop('created constructor must have no parameters');
+      }
+
+      classMirror = classMirror.superclass;
+      while (classMirror != classMirror.mixin) {
+        // Skip the mixins.
+        classMirror = classMirror.superclass;
+      }
+    }
+
+    return true;
+  }
+
   @Experimental()
   /**
    * Register a custom subclass of Element to be instantiatable by the DOM.
@@ -17603,7 +20444,143 @@
    */
   void registerElement(String tag, Type customElementClass,
       {String extendsTag}) {
-    _Utils.register(this, tag, customElementClass, extendsTag);
+    // Figure out which DOM class is being extended from the user's Dart class.
+    var classMirror = reflectClass(customElementClass);
+
+    var locationUri = classMirror.location.sourceUri.toString();
+    if (locationUri == 'dart:html' || locationUri == 'dart:svg') {
+      throw new DomException.jsInterop("HierarchyRequestError: Cannot register an existing dart:html or dart:svg type.");
+    }
+
+    if (classMirror.isAbstract) {
+      throw new DomException.jsInterop("HierarchyRequestError: Cannot register an abstract class.");
+    }
+
+    var jsClassName = _getJSClassName(classMirror);
+    if (jsClassName == null) {
+      // Only components derived from HTML* can be extended.
+      throw new DomException.jsInterop("HierarchyRequestError: Only HTML elements can be customized.");
+    }
+
+    var customClassType = _getDartHtmlClassName(classMirror);
+
+    if (extendsTag != null) {
+      var nativeElement = document.createElement(extendsTag);
+
+      // Trying to extend a native element is it the Dart class consistent with the
+      // extendsTag?
+      if (nativeElement.runtimeType != customClassType.reflectedType) {
+        var nativeElementClassMirror = reflectClass(nativeElement.runtimeType);
+        var customClassNativeElement = MirrorSystem.getName(customClassType.simpleName);
+        var extendsNativeElement = MirrorSystem.getName(nativeElementClassMirror.simpleName);
+        throw new DomException.jsInterop("HierarchyRequestError: Custom class type ($customClassNativeElement) and extendsTag class ($extendsNativeElement) don't match .");
+      }
+    } else if (customClassType.reflectedType != HtmlElement && customClassType.reflectedType != svg.SvgElement) {
+      var customClassName = MirrorSystem.getName(classMirror.simpleName);
+      var customClassElement = MirrorSystem.getName(customClassType.simpleName);
+      throw new DomException.jsInterop("HierarchyRequestError: Custom element $customClassName is a native $customClassElement should be derived from HtmlElement or SvgElement.");
+    }
+
+    if (_hasCreatedConstructor(classMirror)) {
+      // Start the hookup the JS way create an <x-foo> element that extends the
+      // <x-base> custom element. Inherit its prototype and signal what tag is
+      // inherited:
+      //
+      //     var myProto = Object.create(HTMLElement.prototype);
+      //     var myElement = document.registerElement('x-foo', {prototype: myProto});
+      var baseElement = js.JsNative.getProperty(js.context, jsClassName);
+      if (baseElement == null) {
+        // Couldn't find the HTML element so use a generic one.
+        baseElement = js.JsNative.getProperty(js.context, 'HTMLElement');
+      }
+      var elemProto = js.JsNative.callMethod(js.JsNative.getProperty(js.context, 'Object'), "create", [js.JsNative.getProperty(baseElement, 'prototype')]);
+
+      // Remember for any upgrading done in wrap_jso.
+      addCustomElementType(tag, customElementClass, extendsTag);
+
+      // TODO(terry): Hack to stop recursion re-creating custom element when the
+      //              created() constructor of the custom element does e.g.,
+      //
+      //                  MyElement.created() : super.created() {
+      //                    this.innerHtml = "<b>I'm an x-foo-with-markup!</b>";
+      //                  }
+      //
+      //              sanitizing causes custom element to created recursively
+      //              until stack overflow.
+      //
+      //              See https://github.com/dart-lang/sdk/issues/23666
+      int creating = 0;
+
+      // If any JS code is hooked we want to call it too.
+      var oldCreatedCallback = elemProto['createdCallback'];
+      var oldAttributeChangedCallback = elemProto['attributeChangedCallback'];
+      var oldAttachedCallback = elemProto['attachedCallback'];
+      var oldDetachedCallback = elemProto['detachedCallback'];
+
+      // TODO(jacobr): warning:
+      elemProto['createdCallback'] = js.JsNative.withThis(($this) {
+        if (_getJSClassName(reflectClass(customElementClass).superclass) != null && creating < 2) {
+          creating++;
+
+          var dartClass;
+          try {
+            if (extendsTag != null) {
+              // If we're extending a native element then create that element.
+              // Then upgrade that element to the customElementClass through
+              // normal flow.
+              dartClass = document.createElement(extendsTag);
+              js.setDartHtmlWrapperFor($this, dartClass);
+              dartClass.blink_jsObject = $this;
+            }
+
+            // Upgrade to the CustomElement Dart class.
+            dartClass = _blink.Blink_Utils.constructElement(customElementClass, $this);
+          } catch (e) {
+            // Got a problem make it an HtmlElement and rethrow the error.
+            dartClass = HtmlElement.internalCreateHtmlElement();
+            // We need to remember the JS object (because constructElement failed
+            // it normally sets up the blink_jsObject.
+            dartClass.blink_jsObject = $this;
+
+            // Mark to only try this once don't try upgrading from HtmlElement
+            // to the user's Dart class - we had a problem.
+            dartClass._badUpgrade();
+            throw e;
+          } finally {
+            // Need to remember the Dart class that was created for this custom so
+            // return it and setup the blink_jsObject to the $this that we'll be working
+            // with as we talk to blink.
+            js.setDartHtmlWrapperFor($this, dartClass);
+
+            creating--;
+          }
+        }
+
+        if (oldCreatedCallback != null)
+          oldCreatedCallback.apply([], thisArg: unwrap_jso($this));
+      });
+      elemProto['attributeChangedCallback'] = new js.JsFunction.withThis(($this, attrName, oldVal, newVal) {
+        $this.attributeChanged(attrName, oldVal, newVal);
+
+        if (oldAttributeChangedCallback != null)
+          oldAttributeChangedCallback.apply([], thisArg: unwrap_jso($this));
+      });
+      elemProto['attachedCallback'] = new js.JsFunction.withThis(($this) {
+        $this.attached();
+
+        if (oldAttachedCallback != null)
+          oldAttachedCallback.apply([], thisArg: unwrap_jso($this));
+      });
+      elemProto['detachedCallback'] = new js.JsFunction.withThis(($this) {
+        $this.detached();
+
+        if (oldDetachedCallback != null)
+          oldDetachedCallback.apply([], thisArg: unwrap_jso($this));
+      });
+      // document.registerElement('x-foo', {prototype: elemProto, extends: extendsTag});
+      var jsMap = new js.JsObject.jsify({'prototype': elemProto, 'extends': extendsTag});
+      js.JsNative.callMethod(js.JsNative.getProperty(js.context, 'document'), 'registerElement', [tag, jsMap]);
+    }
   }
 
   /** *Deprecated*: use [registerElement] instead. */
@@ -17656,8 +20633,6 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-// WARNING: Do not edit - generated code.
-
 
 @DocsEditable()
 @DomName('HTMLElement')
@@ -17924,6 +20899,20 @@
   @DocsEditable()
   @Experimental() // untriaged
   static const EventStreamProvider<Event> waitingEvent = const EventStreamProvider<Event>('waiting');
+
+
+  @Deprecated("Internal Use Only")
+  static HtmlElement internalCreateHtmlElement() {
+    return new HtmlElement._internalWrap();
+  }
+
+  factory HtmlElement._internalWrap() {
+    return new HtmlElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  HtmlElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -17937,7 +20926,7 @@
   
   @DomName('HTMLElement.contentEditable')
   @DocsEditable()
-  void set contentEditable(String value) => _blink.BlinkHTMLElement.instance.contentEditable_Setter_(unwrap_jso(this), value);
+  set contentEditable(String value) => _blink.BlinkHTMLElement.instance.contentEditable_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLElement.contextMenu')
   @DocsEditable()
@@ -17947,7 +20936,7 @@
   @DomName('HTMLElement.contextMenu')
   @DocsEditable()
   @Experimental() // untriaged
-  void set contextMenu(MenuElement value) => _blink.BlinkHTMLElement.instance.contextMenu_Setter_(unwrap_jso(this), unwrap_jso(value));
+  set contextMenu(MenuElement value) => _blink.BlinkHTMLElement.instance.contextMenu_Setter_(unwrap_jso(this), unwrap_jso(value));
   
   @DomName('HTMLElement.dir')
   @DocsEditable()
@@ -17955,7 +20944,7 @@
   
   @DomName('HTMLElement.dir')
   @DocsEditable()
-  void set dir(String value) => _blink.BlinkHTMLElement.instance.dir_Setter_(unwrap_jso(this), value);
+  set dir(String value) => _blink.BlinkHTMLElement.instance.dir_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLElement.draggable')
   @DocsEditable()
@@ -17963,7 +20952,7 @@
   
   @DomName('HTMLElement.draggable')
   @DocsEditable()
-  void set draggable(bool value) => _blink.BlinkHTMLElement.instance.draggable_Setter_(unwrap_jso(this), value);
+  set draggable(bool value) => _blink.BlinkHTMLElement.instance.draggable_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLElement.hidden')
   @DocsEditable()
@@ -17971,7 +20960,7 @@
   
   @DomName('HTMLElement.hidden')
   @DocsEditable()
-  void set hidden(bool value) => _blink.BlinkHTMLElement.instance.hidden_Setter_(unwrap_jso(this), value);
+  set hidden(bool value) => _blink.BlinkHTMLElement.instance.hidden_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLElement.inputMethodContext')
   @DocsEditable()
@@ -17988,7 +20977,7 @@
   
   @DomName('HTMLElement.lang')
   @DocsEditable()
-  void set lang(String value) => _blink.BlinkHTMLElement.instance.lang_Setter_(unwrap_jso(this), value);
+  set lang(String value) => _blink.BlinkHTMLElement.instance.lang_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLElement.spellcheck')
   @DocsEditable()
@@ -18000,7 +20989,7 @@
   @DocsEditable()
   // http://blog.whatwg.org/the-road-to-html-5-spellchecking
   @Experimental() // nonstandard
-  void set spellcheck(bool value) => _blink.BlinkHTMLElement.instance.spellcheck_Setter_(unwrap_jso(this), value);
+  set spellcheck(bool value) => _blink.BlinkHTMLElement.instance.spellcheck_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLElement.tabIndex')
   @DocsEditable()
@@ -18008,7 +20997,7 @@
   
   @DomName('HTMLElement.tabIndex')
   @DocsEditable()
-  void set tabIndex(int value) => _blink.BlinkHTMLElement.instance.tabIndex_Setter_(unwrap_jso(this), value);
+  set tabIndex(int value) => _blink.BlinkHTMLElement.instance.tabIndex_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLElement.title')
   @DocsEditable()
@@ -18016,7 +21005,7 @@
   
   @DomName('HTMLElement.title')
   @DocsEditable()
-  void set title(String value) => _blink.BlinkHTMLElement.instance.title_Setter_(unwrap_jso(this), value);
+  set title(String value) => _blink.BlinkHTMLElement.instance.title_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLElement.translate')
   @DocsEditable()
@@ -18024,7 +21013,7 @@
   
   @DomName('HTMLElement.translate')
   @DocsEditable()
-  void set translate(bool value) => _blink.BlinkHTMLElement.instance.translate_Setter_(unwrap_jso(this), value);
+  set translate(bool value) => _blink.BlinkHTMLElement.instance.translate_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLElement.webkitdropzone')
   @DocsEditable()
@@ -18040,7 +21029,7 @@
   @SupportedBrowser(SupportedBrowser.SAFARI)
   @Experimental()
   // http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html#the-dropzone-attribute
-  void set dropzone(String value) => _blink.BlinkHTMLElement.instance.webkitdropzone_Setter_(unwrap_jso(this), value);
+  set dropzone(String value) => _blink.BlinkHTMLElement.instance.webkitdropzone_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLElement.click')
   @DocsEditable()
@@ -18306,6 +21295,18 @@
   @Experimental() // untriaged
   ElementStream<Event> get onWaiting => waitingEvent.forElement(this);
 
+  // Flags to only try upgrading once. If there's a failure don't try upgrading
+  // anymore.
+  bool _badUpgradeOccurred = false;
+
+  /// Required for SDK Infrastructure. Internal use only.
+  ///
+  /// Did this encounter a failure attempting to upgrade to
+  /// a custom element.
+  @Deprecated("Required for SDK Infrastructure. Internal use only.")
+  bool get isBadUpgrade => _badUpgradeOccurred;
+
+  void _badUpgrade() { _badUpgradeOccurred = true; }
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -18320,6 +21321,20 @@
   // To suppress missing implicit constructor warnings.
   factory HtmlFormControlsCollection._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static HtmlFormControlsCollection internalCreateHtmlFormControlsCollection() {
+    return new HtmlFormControlsCollection._internalWrap();
+  }
+
+  factory HtmlFormControlsCollection._internalWrap() {
+    return new HtmlFormControlsCollection.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  HtmlFormControlsCollection.internal_() : super.internal_();
+
+
   @DomName('HTMLFormControlsCollection.namedItem')
   @DocsEditable()
   Object namedItem(String name) => wrap_jso(_blink.BlinkHTMLFormControlsCollection.instance.namedItem_Callback_1_(unwrap_jso(this), name));
@@ -18341,6 +21356,20 @@
   @DomName('HTMLHtmlElement.HTMLHtmlElement')
   @DocsEditable()
   factory HtmlHtmlElement() => document.createElement("html");
+
+
+  @Deprecated("Internal Use Only")
+  static HtmlHtmlElement internalCreateHtmlHtmlElement() {
+    return new HtmlHtmlElement._internalWrap();
+  }
+
+  factory HtmlHtmlElement._internalWrap() {
+    return new HtmlHtmlElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  HtmlHtmlElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -18362,6 +21391,20 @@
   // To suppress missing implicit constructor warnings.
   factory HtmlOptionsCollection._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static HtmlOptionsCollection internalCreateHtmlOptionsCollection() {
+    return new HtmlOptionsCollection._internalWrap();
+  }
+
+  factory HtmlOptionsCollection._internalWrap() {
+    return new HtmlOptionsCollection.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  HtmlOptionsCollection.internal_() : super.internal_();
+
+
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -18699,6 +21742,31 @@
     return headers;
   }
 
+  /**
+   * Specify the desired `url`, and `method` to use in making the request.
+   *
+   * By default the request is done asyncronously, with no user or password
+   * authentication information. If `async` is false, the request will be send
+   * synchronously.
+   *
+   * Calling `open` again on a currently active request is equivalent to
+   * calling `abort`.
+   *
+   * Note: Most simple HTTP requests can be accomplished using the [getString],
+   * [request], [requestCrossOrigin], or [postFormData] methods. Use of this
+   * `open` method is intended only for more complext HTTP requests where
+   * finer-grained control is needed.
+   */
+  @DomName('XMLHttpRequest.open')
+  @DocsEditable()
+  void open(String method, String url, {bool async, String user, String password}) {
+    if (async == null && user == null && password == null) {
+      _blink.BlinkXMLHttpRequest.instance.open_Callback_2_(unwrap_jso(this), method, url);
+    } else {
+      _blink.BlinkXMLHttpRequest.instance.open_Callback_5_(unwrap_jso(this), method, url, async, user, password);
+    }
+  }
+
   // To suppress missing implicit constructor warnings.
   factory HttpRequest._() { throw new UnsupportedError("Not supported"); }
 
@@ -18733,7 +21801,21 @@
   factory HttpRequest() => wrap_jso(_create());
 
   @DocsEditable()
-  static HttpRequest _create() => _blink.BlinkXMLHttpRequest.instance.constructorCallback_0_();
+  static HttpRequest _create() => wrap_jso(_blink.BlinkXMLHttpRequest.instance.constructorCallback_0_());
+
+
+  @Deprecated("Internal Use Only")
+  static HttpRequest internalCreateHttpRequest() {
+    return new HttpRequest._internalWrap();
+  }
+
+  factory HttpRequest._internalWrap() {
+    return new HttpRequest.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  HttpRequest.internal_() : super.internal_();
+
 
   @DomName('XMLHttpRequest.DONE')
   @DocsEditable()
@@ -18804,7 +21886,7 @@
   @SupportedBrowser(SupportedBrowser.FIREFOX)
   @SupportedBrowser(SupportedBrowser.IE, '10')
   @SupportedBrowser(SupportedBrowser.SAFARI)
-  Object get response => _blink.BlinkXMLHttpRequest.instance.response_Getter_(unwrap_jso(this));
+  Object get response => wrap_jso(_blink.BlinkXMLHttpRequest.instance.response_Getter_(unwrap_jso(this)));
   
   /**
    * The response in String form or empty String on failure.
@@ -18839,7 +21921,7 @@
    */
   @DomName('XMLHttpRequest.responseType')
   @DocsEditable()
-  void set responseType(String value) => _blink.BlinkXMLHttpRequest.instance.responseType_Setter_(unwrap_jso(this), value);
+  set responseType(String value) => _blink.BlinkXMLHttpRequest.instance.responseType_Setter_(unwrap_jso(this), value);
   
   @DomName('XMLHttpRequest.responseURL')
   @DocsEditable()
@@ -18913,7 +21995,7 @@
   @DomName('XMLHttpRequest.timeout')
   @DocsEditable()
   @Experimental() // untriaged
-  void set timeout(int value) => _blink.BlinkXMLHttpRequest.instance.timeout_Setter_(unwrap_jso(this), value);
+  set timeout(int value) => _blink.BlinkXMLHttpRequest.instance.timeout_Setter_(unwrap_jso(this), value);
   
   /**
    * [EventTarget] that can hold listeners to track the progress of the request.
@@ -18942,7 +22024,7 @@
    */
   @DomName('XMLHttpRequest.withCredentials')
   @DocsEditable()
-  void set withCredentials(bool value) => _blink.BlinkXMLHttpRequest.instance.withCredentials_Setter_(unwrap_jso(this), value);
+  set withCredentials(bool value) => _blink.BlinkXMLHttpRequest.instance.withCredentials_Setter_(unwrap_jso(this), value);
   
   /**
    * Stop the current request.
@@ -18982,25 +22064,6 @@
   String getResponseHeader(String header) => _blink.BlinkXMLHttpRequest.instance.getResponseHeader_Callback_1_(unwrap_jso(this), header);
   
   /**
-   * Specify the desired `url`, and `method` to use in making the request.
-   *
-   * By default the request is done asyncronously, with no user or password
-   * authentication information. If `async` is false, the request will be send
-   * synchronously.
-   *
-   * Calling `open` again on a currently active request is equivalent to
-   * calling `abort`.
-   *
-   * Note: Most simple HTTP requests can be accomplished using the [getString],
-   * [request], [requestCrossOrigin], or [postFormData] methods. Use of this
-   * `open` method is intended only for more complext HTTP requests where
-   * finer-grained control is needed.
-   */
-  @DomName('XMLHttpRequest.open')
-  @DocsEditable()
-  void open(String method, String url, {bool async, String user, String password}) => _blink.BlinkXMLHttpRequest.instance.open_Callback_5_(unwrap_jso(this), method, url, async, user, password);
-  
-  /**
    * Specify a particular MIME type (such as `text/xml`) desired for the
    * response.
    *
@@ -19155,6 +22218,20 @@
   @Experimental() // untriaged
   static const EventStreamProvider<ProgressEvent> timeoutEvent = const EventStreamProvider<ProgressEvent>('timeout');
 
+
+  @Deprecated("Internal Use Only")
+  static HttpRequestEventTarget internalCreateHttpRequestEventTarget() {
+    return new HttpRequestEventTarget._internalWrap();
+  }
+
+  factory HttpRequestEventTarget._internalWrap() {
+    return new HttpRequestEventTarget.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  HttpRequestEventTarget.internal_() : super.internal_();
+
+
   /// Stream of `abort` events handled by this [HttpRequestEventTarget].
   @DomName('XMLHttpRequestEventTarget.onabort')
   @DocsEditable()
@@ -19221,6 +22298,20 @@
   // To suppress missing implicit constructor warnings.
   factory HttpRequestUpload._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static HttpRequestUpload internalCreateHttpRequestUpload() {
+    return new HttpRequestUpload._internalWrap();
+  }
+
+  factory HttpRequestUpload._internalWrap() {
+    return new HttpRequestUpload.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  HttpRequestUpload.internal_() : super.internal_();
+
+
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -19238,6 +22329,20 @@
   @DomName('HTMLIFrameElement.HTMLIFrameElement')
   @DocsEditable()
   factory IFrameElement() => document.createElement("iframe");
+
+
+  @Deprecated("Internal Use Only")
+  static IFrameElement internalCreateIFrameElement() {
+    return new IFrameElement._internalWrap();
+  }
+
+  factory IFrameElement._internalWrap() {
+    return new IFrameElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  IFrameElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -19253,7 +22358,7 @@
   @DomName('HTMLIFrameElement.allowFullscreen')
   @DocsEditable()
   @Experimental() // untriaged
-  void set allowFullscreen(bool value) => _blink.BlinkHTMLIFrameElement.instance.allowFullscreen_Setter_(unwrap_jso(this), value);
+  set allowFullscreen(bool value) => _blink.BlinkHTMLIFrameElement.instance.allowFullscreen_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLIFrameElement.contentWindow')
   @DocsEditable()
@@ -19265,7 +22370,7 @@
   
   @DomName('HTMLIFrameElement.height')
   @DocsEditable()
-  void set height(String value) => _blink.BlinkHTMLIFrameElement.instance.height_Setter_(unwrap_jso(this), value);
+  set height(String value) => _blink.BlinkHTMLIFrameElement.instance.height_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLIFrameElement.integrity')
   @DocsEditable()
@@ -19275,7 +22380,7 @@
   @DomName('HTMLIFrameElement.integrity')
   @DocsEditable()
   @Experimental() // untriaged
-  void set integrity(String value) => _blink.BlinkHTMLIFrameElement.instance.integrity_Setter_(unwrap_jso(this), value);
+  set integrity(String value) => _blink.BlinkHTMLIFrameElement.instance.integrity_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLIFrameElement.name')
   @DocsEditable()
@@ -19283,7 +22388,7 @@
   
   @DomName('HTMLIFrameElement.name')
   @DocsEditable()
-  void set name(String value) => _blink.BlinkHTMLIFrameElement.instance.name_Setter_(unwrap_jso(this), value);
+  set name(String value) => _blink.BlinkHTMLIFrameElement.instance.name_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLIFrameElement.sandbox')
   @DocsEditable()
@@ -19291,7 +22396,7 @@
   
   @DomName('HTMLIFrameElement.sandbox')
   @DocsEditable()
-  void set sandbox(String value) => _blink.BlinkHTMLIFrameElement.instance.sandbox_Setter_(unwrap_jso(this), value);
+  set sandbox(String value) => _blink.BlinkHTMLIFrameElement.instance.sandbox_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLIFrameElement.src')
   @DocsEditable()
@@ -19299,7 +22404,7 @@
   
   @DomName('HTMLIFrameElement.src')
   @DocsEditable()
-  void set src(String value) => _blink.BlinkHTMLIFrameElement.instance.src_Setter_(unwrap_jso(this), value);
+  set src(String value) => _blink.BlinkHTMLIFrameElement.instance.src_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLIFrameElement.srcdoc')
   @DocsEditable()
@@ -19307,7 +22412,7 @@
   
   @DomName('HTMLIFrameElement.srcdoc')
   @DocsEditable()
-  void set srcdoc(String value) => _blink.BlinkHTMLIFrameElement.instance.srcdoc_Setter_(unwrap_jso(this), value);
+  set srcdoc(String value) => _blink.BlinkHTMLIFrameElement.instance.srcdoc_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLIFrameElement.width')
   @DocsEditable()
@@ -19315,7 +22420,7 @@
   
   @DomName('HTMLIFrameElement.width')
   @DocsEditable()
-  void set width(String value) => _blink.BlinkHTMLIFrameElement.instance.width_Setter_(unwrap_jso(this), value);
+  set width(String value) => _blink.BlinkHTMLIFrameElement.instance.width_Setter_(unwrap_jso(this), value);
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -19328,10 +22433,25 @@
 @DocsEditable()
 @DomName('ImageBitmap')
 @Experimental() // untriaged
-class ImageBitmap extends NativeFieldWrapperClass2 {
+class ImageBitmap extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory ImageBitmap._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static ImageBitmap internalCreateImageBitmap() {
+    return new ImageBitmap._internalWrap();
+  }
+
+  factory ImageBitmap._internalWrap() {
+    return new ImageBitmap.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  ImageBitmap.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('ImageBitmap.height')
   @DocsEditable()
   @Experimental() // untriaged
@@ -19348,7 +22468,7 @@
 // BSD-style license that can be found in the LICENSE file.
 
 @DomName('ImageData')
-class ImageData extends NativeFieldWrapperClass2 {
+class ImageData extends DartHtmlDomObject {
   List<int> __data;
 
   List<int> get data {
@@ -19365,17 +22485,32 @@
   @DocsEditable()
   factory ImageData(data_OR_width, int height_OR_width, [int height]) {
     if ((height_OR_width is int || height_OR_width == null) && (data_OR_width is int || data_OR_width == null) && height == null) {
-      return _blink.BlinkImageData.instance.constructorCallback_2_(data_OR_width, height_OR_width);
+      return wrap_jso(_blink.BlinkImageData.instance.constructorCallback_2_(data_OR_width, height_OR_width));
     }
     if ((height is int || height == null) && (height_OR_width is int || height_OR_width == null) && (data_OR_width is Uint8ClampedList || data_OR_width == null)) {
-      return _blink.BlinkImageData.instance.constructorCallback_3_(data_OR_width, height_OR_width, height);
+      return wrap_jso(_blink.BlinkImageData.instance.constructorCallback_3_(data_OR_width, height_OR_width, height));
     }
     throw new ArgumentError("Incorrect number or type of arguments");
   }
 
+  @Deprecated("Internal Use Only")
+  static ImageData internalCreateImageData() {
+    return new ImageData._internalWrap();
+  }
+
+  factory ImageData._internalWrap() {
+    return new ImageData.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  ImageData.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('ImageData.data')
   @DocsEditable()
-  Uint8ClampedList get _data => wrap_jso(_blink.BlinkImageData.instance.data_Getter_(unwrap_jso(this)));
+  Uint8ClampedList get _data => _blink.BlinkImageData.instance.data_Getter_(unwrap_jso(this));
   
   @DomName('ImageData.height')
   @DocsEditable()
@@ -19405,6 +22540,20 @@
     if (height != null) e.height = height;
     return e;
   }
+
+
+  @Deprecated("Internal Use Only")
+  static ImageElement internalCreateImageElement() {
+    return new ImageElement._internalWrap();
+  }
+
+  factory ImageElement._internalWrap() {
+    return new ImageElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  ImageElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -19418,7 +22567,7 @@
   
   @DomName('HTMLImageElement.alt')
   @DocsEditable()
-  void set alt(String value) => _blink.BlinkHTMLImageElement.instance.alt_Setter_(unwrap_jso(this), value);
+  set alt(String value) => _blink.BlinkHTMLImageElement.instance.alt_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLImageElement.complete')
   @DocsEditable()
@@ -19430,7 +22579,7 @@
   
   @DomName('HTMLImageElement.crossOrigin')
   @DocsEditable()
-  void set crossOrigin(String value) => _blink.BlinkHTMLImageElement.instance.crossOrigin_Setter_(unwrap_jso(this), value);
+  set crossOrigin(String value) => _blink.BlinkHTMLImageElement.instance.crossOrigin_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLImageElement.currentSrc')
   @DocsEditable()
@@ -19443,7 +22592,7 @@
   
   @DomName('HTMLImageElement.height')
   @DocsEditable()
-  void set height(int value) => _blink.BlinkHTMLImageElement.instance.height_Setter_(unwrap_jso(this), value);
+  set height(int value) => _blink.BlinkHTMLImageElement.instance.height_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLImageElement.integrity')
   @DocsEditable()
@@ -19453,7 +22602,7 @@
   @DomName('HTMLImageElement.integrity')
   @DocsEditable()
   @Experimental() // untriaged
-  void set integrity(String value) => _blink.BlinkHTMLImageElement.instance.integrity_Setter_(unwrap_jso(this), value);
+  set integrity(String value) => _blink.BlinkHTMLImageElement.instance.integrity_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLImageElement.isMap')
   @DocsEditable()
@@ -19461,7 +22610,7 @@
   
   @DomName('HTMLImageElement.isMap')
   @DocsEditable()
-  void set isMap(bool value) => _blink.BlinkHTMLImageElement.instance.isMap_Setter_(unwrap_jso(this), value);
+  set isMap(bool value) => _blink.BlinkHTMLImageElement.instance.isMap_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLImageElement.naturalHeight')
   @DocsEditable()
@@ -19479,7 +22628,7 @@
   @DomName('HTMLImageElement.sizes')
   @DocsEditable()
   @Experimental() // untriaged
-  void set sizes(String value) => _blink.BlinkHTMLImageElement.instance.sizes_Setter_(unwrap_jso(this), value);
+  set sizes(String value) => _blink.BlinkHTMLImageElement.instance.sizes_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLImageElement.src')
   @DocsEditable()
@@ -19487,7 +22636,7 @@
   
   @DomName('HTMLImageElement.src')
   @DocsEditable()
-  void set src(String value) => _blink.BlinkHTMLImageElement.instance.src_Setter_(unwrap_jso(this), value);
+  set src(String value) => _blink.BlinkHTMLImageElement.instance.src_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLImageElement.srcset')
   @DocsEditable()
@@ -19497,7 +22646,7 @@
   @DomName('HTMLImageElement.srcset')
   @DocsEditable()
   @Experimental() // untriaged
-  void set srcset(String value) => _blink.BlinkHTMLImageElement.instance.srcset_Setter_(unwrap_jso(this), value);
+  set srcset(String value) => _blink.BlinkHTMLImageElement.instance.srcset_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLImageElement.useMap')
   @DocsEditable()
@@ -19505,7 +22654,7 @@
   
   @DomName('HTMLImageElement.useMap')
   @DocsEditable()
-  void set useMap(String value) => _blink.BlinkHTMLImageElement.instance.useMap_Setter_(unwrap_jso(this), value);
+  set useMap(String value) => _blink.BlinkHTMLImageElement.instance.useMap_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLImageElement.width')
   @DocsEditable()
@@ -19513,7 +22662,7 @@
   
   @DomName('HTMLImageElement.width')
   @DocsEditable()
-  void set width(int value) => _blink.BlinkHTMLImageElement.instance.width_Setter_(unwrap_jso(this), value);
+  set width(int value) => _blink.BlinkHTMLImageElement.instance.width_Setter_(unwrap_jso(this), value);
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -19526,10 +22675,25 @@
 @DocsEditable()
 @DomName('InjectedScriptHost')
 @Experimental() // untriaged
-class InjectedScriptHost extends NativeFieldWrapperClass2 {
+class InjectedScriptHost extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory InjectedScriptHost._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static InjectedScriptHost internalCreateInjectedScriptHost() {
+    return new InjectedScriptHost._internalWrap();
+  }
+
+  factory InjectedScriptHost._internalWrap() {
+    return new InjectedScriptHost.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  InjectedScriptHost.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('InjectedScriptHost.inspect')
   @DocsEditable()
   @Experimental() // untriaged
@@ -19578,6 +22742,20 @@
 
   // To suppress missing implicit constructor warnings.
   factory InputElement._() { throw new UnsupportedError("Not supported"); }
+
+
+  @Deprecated("Internal Use Only")
+  static InputElement internalCreateInputElement() {
+    return new InputElement._internalWrap();
+  }
+
+  factory InputElement._internalWrap() {
+    return new InputElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  InputElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -19591,7 +22769,7 @@
   
   @DomName('HTMLInputElement.accept')
   @DocsEditable()
-  void set accept(String value) => _blink.BlinkHTMLInputElement.instance.accept_Setter_(unwrap_jso(this), value);
+  set accept(String value) => _blink.BlinkHTMLInputElement.instance.accept_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLInputElement.alt')
   @DocsEditable()
@@ -19599,7 +22777,7 @@
   
   @DomName('HTMLInputElement.alt')
   @DocsEditable()
-  void set alt(String value) => _blink.BlinkHTMLInputElement.instance.alt_Setter_(unwrap_jso(this), value);
+  set alt(String value) => _blink.BlinkHTMLInputElement.instance.alt_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLInputElement.autocomplete')
   @DocsEditable()
@@ -19607,7 +22785,7 @@
   
   @DomName('HTMLInputElement.autocomplete')
   @DocsEditable()
-  void set autocomplete(String value) => _blink.BlinkHTMLInputElement.instance.autocomplete_Setter_(unwrap_jso(this), value);
+  set autocomplete(String value) => _blink.BlinkHTMLInputElement.instance.autocomplete_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLInputElement.autofocus')
   @DocsEditable()
@@ -19615,7 +22793,7 @@
   
   @DomName('HTMLInputElement.autofocus')
   @DocsEditable()
-  void set autofocus(bool value) => _blink.BlinkHTMLInputElement.instance.autofocus_Setter_(unwrap_jso(this), value);
+  set autofocus(bool value) => _blink.BlinkHTMLInputElement.instance.autofocus_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLInputElement.capture')
   @DocsEditable()
@@ -19625,7 +22803,7 @@
   @DomName('HTMLInputElement.capture')
   @DocsEditable()
   @Experimental() // untriaged
-  void set capture(bool value) => _blink.BlinkHTMLInputElement.instance.capture_Setter_(unwrap_jso(this), value);
+  set capture(bool value) => _blink.BlinkHTMLInputElement.instance.capture_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLInputElement.checked')
   @DocsEditable()
@@ -19633,7 +22811,7 @@
   
   @DomName('HTMLInputElement.checked')
   @DocsEditable()
-  void set checked(bool value) => _blink.BlinkHTMLInputElement.instance.checked_Setter_(unwrap_jso(this), value);
+  set checked(bool value) => _blink.BlinkHTMLInputElement.instance.checked_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLInputElement.defaultChecked')
   @DocsEditable()
@@ -19641,7 +22819,7 @@
   
   @DomName('HTMLInputElement.defaultChecked')
   @DocsEditable()
-  void set defaultChecked(bool value) => _blink.BlinkHTMLInputElement.instance.defaultChecked_Setter_(unwrap_jso(this), value);
+  set defaultChecked(bool value) => _blink.BlinkHTMLInputElement.instance.defaultChecked_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLInputElement.defaultValue')
   @DocsEditable()
@@ -19649,7 +22827,7 @@
   
   @DomName('HTMLInputElement.defaultValue')
   @DocsEditable()
-  void set defaultValue(String value) => _blink.BlinkHTMLInputElement.instance.defaultValue_Setter_(unwrap_jso(this), value);
+  set defaultValue(String value) => _blink.BlinkHTMLInputElement.instance.defaultValue_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLInputElement.dirName')
   @DocsEditable()
@@ -19657,7 +22835,7 @@
   
   @DomName('HTMLInputElement.dirName')
   @DocsEditable()
-  void set dirName(String value) => _blink.BlinkHTMLInputElement.instance.dirName_Setter_(unwrap_jso(this), value);
+  set dirName(String value) => _blink.BlinkHTMLInputElement.instance.dirName_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLInputElement.disabled')
   @DocsEditable()
@@ -19665,15 +22843,15 @@
   
   @DomName('HTMLInputElement.disabled')
   @DocsEditable()
-  void set disabled(bool value) => _blink.BlinkHTMLInputElement.instance.disabled_Setter_(unwrap_jso(this), value);
+  set disabled(bool value) => _blink.BlinkHTMLInputElement.instance.disabled_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLInputElement.files')
   @DocsEditable()
-  List<File> get files => wrap_jso_list(_blink.BlinkHTMLInputElement.instance.files_Getter_(unwrap_jso(this)));
+  List<File> get files => wrap_jso(_blink.BlinkHTMLInputElement.instance.files_Getter_(unwrap_jso(this)));
   
   @DomName('HTMLInputElement.files')
   @DocsEditable()
-  void set files(List<File> value) => _blink.BlinkHTMLInputElement.instance.files_Setter_(unwrap_jso(this), unwrap_jso(value));
+  set files(List<File> value) => _blink.BlinkHTMLInputElement.instance.files_Setter_(unwrap_jso(this), unwrap_jso(value));
   
   @DomName('HTMLInputElement.form')
   @DocsEditable()
@@ -19685,7 +22863,7 @@
   
   @DomName('HTMLInputElement.formAction')
   @DocsEditable()
-  void set formAction(String value) => _blink.BlinkHTMLInputElement.instance.formAction_Setter_(unwrap_jso(this), value);
+  set formAction(String value) => _blink.BlinkHTMLInputElement.instance.formAction_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLInputElement.formEnctype')
   @DocsEditable()
@@ -19693,7 +22871,7 @@
   
   @DomName('HTMLInputElement.formEnctype')
   @DocsEditable()
-  void set formEnctype(String value) => _blink.BlinkHTMLInputElement.instance.formEnctype_Setter_(unwrap_jso(this), value);
+  set formEnctype(String value) => _blink.BlinkHTMLInputElement.instance.formEnctype_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLInputElement.formMethod')
   @DocsEditable()
@@ -19701,7 +22879,7 @@
   
   @DomName('HTMLInputElement.formMethod')
   @DocsEditable()
-  void set formMethod(String value) => _blink.BlinkHTMLInputElement.instance.formMethod_Setter_(unwrap_jso(this), value);
+  set formMethod(String value) => _blink.BlinkHTMLInputElement.instance.formMethod_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLInputElement.formNoValidate')
   @DocsEditable()
@@ -19709,7 +22887,7 @@
   
   @DomName('HTMLInputElement.formNoValidate')
   @DocsEditable()
-  void set formNoValidate(bool value) => _blink.BlinkHTMLInputElement.instance.formNoValidate_Setter_(unwrap_jso(this), value);
+  set formNoValidate(bool value) => _blink.BlinkHTMLInputElement.instance.formNoValidate_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLInputElement.formTarget')
   @DocsEditable()
@@ -19717,7 +22895,7 @@
   
   @DomName('HTMLInputElement.formTarget')
   @DocsEditable()
-  void set formTarget(String value) => _blink.BlinkHTMLInputElement.instance.formTarget_Setter_(unwrap_jso(this), value);
+  set formTarget(String value) => _blink.BlinkHTMLInputElement.instance.formTarget_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLInputElement.height')
   @DocsEditable()
@@ -19725,7 +22903,7 @@
   
   @DomName('HTMLInputElement.height')
   @DocsEditable()
-  void set height(int value) => _blink.BlinkHTMLInputElement.instance.height_Setter_(unwrap_jso(this), value);
+  set height(int value) => _blink.BlinkHTMLInputElement.instance.height_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLInputElement.incremental')
   @DocsEditable()
@@ -19737,7 +22915,7 @@
   @DocsEditable()
   // http://www.w3.org/TR/html-markup/input.search.html
   @Experimental()
-  void set incremental(bool value) => _blink.BlinkHTMLInputElement.instance.incremental_Setter_(unwrap_jso(this), value);
+  set incremental(bool value) => _blink.BlinkHTMLInputElement.instance.incremental_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLInputElement.indeterminate')
   @DocsEditable()
@@ -19745,7 +22923,7 @@
   
   @DomName('HTMLInputElement.indeterminate')
   @DocsEditable()
-  void set indeterminate(bool value) => _blink.BlinkHTMLInputElement.instance.indeterminate_Setter_(unwrap_jso(this), value);
+  set indeterminate(bool value) => _blink.BlinkHTMLInputElement.instance.indeterminate_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLInputElement.inputMode')
   @DocsEditable()
@@ -19755,11 +22933,11 @@
   @DomName('HTMLInputElement.inputMode')
   @DocsEditable()
   @Experimental() // untriaged
-  void set inputMode(String value) => _blink.BlinkHTMLInputElement.instance.inputMode_Setter_(unwrap_jso(this), value);
+  set inputMode(String value) => _blink.BlinkHTMLInputElement.instance.inputMode_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLInputElement.labels')
   @DocsEditable()
-  List<Node> get labels => wrap_jso_list(_blink.BlinkHTMLInputElement.instance.labels_Getter_(unwrap_jso(this)));
+  List<Node> get labels => wrap_jso(_blink.BlinkHTMLInputElement.instance.labels_Getter_(unwrap_jso(this)));
   
   @DomName('HTMLInputElement.list')
   @DocsEditable()
@@ -19771,7 +22949,7 @@
   
   @DomName('HTMLInputElement.max')
   @DocsEditable()
-  void set max(String value) => _blink.BlinkHTMLInputElement.instance.max_Setter_(unwrap_jso(this), value);
+  set max(String value) => _blink.BlinkHTMLInputElement.instance.max_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLInputElement.maxLength')
   @DocsEditable()
@@ -19779,7 +22957,7 @@
   
   @DomName('HTMLInputElement.maxLength')
   @DocsEditable()
-  void set maxLength(int value) => _blink.BlinkHTMLInputElement.instance.maxLength_Setter_(unwrap_jso(this), value);
+  set maxLength(int value) => _blink.BlinkHTMLInputElement.instance.maxLength_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLInputElement.min')
   @DocsEditable()
@@ -19787,7 +22965,7 @@
   
   @DomName('HTMLInputElement.min')
   @DocsEditable()
-  void set min(String value) => _blink.BlinkHTMLInputElement.instance.min_Setter_(unwrap_jso(this), value);
+  set min(String value) => _blink.BlinkHTMLInputElement.instance.min_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLInputElement.multiple')
   @DocsEditable()
@@ -19795,7 +22973,7 @@
   
   @DomName('HTMLInputElement.multiple')
   @DocsEditable()
-  void set multiple(bool value) => _blink.BlinkHTMLInputElement.instance.multiple_Setter_(unwrap_jso(this), value);
+  set multiple(bool value) => _blink.BlinkHTMLInputElement.instance.multiple_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLInputElement.name')
   @DocsEditable()
@@ -19803,7 +22981,7 @@
   
   @DomName('HTMLInputElement.name')
   @DocsEditable()
-  void set name(String value) => _blink.BlinkHTMLInputElement.instance.name_Setter_(unwrap_jso(this), value);
+  set name(String value) => _blink.BlinkHTMLInputElement.instance.name_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLInputElement.pattern')
   @DocsEditable()
@@ -19811,7 +22989,7 @@
   
   @DomName('HTMLInputElement.pattern')
   @DocsEditable()
-  void set pattern(String value) => _blink.BlinkHTMLInputElement.instance.pattern_Setter_(unwrap_jso(this), value);
+  set pattern(String value) => _blink.BlinkHTMLInputElement.instance.pattern_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLInputElement.placeholder')
   @DocsEditable()
@@ -19819,7 +22997,7 @@
   
   @DomName('HTMLInputElement.placeholder')
   @DocsEditable()
-  void set placeholder(String value) => _blink.BlinkHTMLInputElement.instance.placeholder_Setter_(unwrap_jso(this), value);
+  set placeholder(String value) => _blink.BlinkHTMLInputElement.instance.placeholder_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLInputElement.readOnly')
   @DocsEditable()
@@ -19827,7 +23005,7 @@
   
   @DomName('HTMLInputElement.readOnly')
   @DocsEditable()
-  void set readOnly(bool value) => _blink.BlinkHTMLInputElement.instance.readOnly_Setter_(unwrap_jso(this), value);
+  set readOnly(bool value) => _blink.BlinkHTMLInputElement.instance.readOnly_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLInputElement.required')
   @DocsEditable()
@@ -19835,7 +23013,7 @@
   
   @DomName('HTMLInputElement.required')
   @DocsEditable()
-  void set required(bool value) => _blink.BlinkHTMLInputElement.instance.required_Setter_(unwrap_jso(this), value);
+  set required(bool value) => _blink.BlinkHTMLInputElement.instance.required_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLInputElement.selectionDirection')
   @DocsEditable()
@@ -19843,7 +23021,7 @@
   
   @DomName('HTMLInputElement.selectionDirection')
   @DocsEditable()
-  void set selectionDirection(String value) => _blink.BlinkHTMLInputElement.instance.selectionDirection_Setter_(unwrap_jso(this), value);
+  set selectionDirection(String value) => _blink.BlinkHTMLInputElement.instance.selectionDirection_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLInputElement.selectionEnd')
   @DocsEditable()
@@ -19851,7 +23029,7 @@
   
   @DomName('HTMLInputElement.selectionEnd')
   @DocsEditable()
-  void set selectionEnd(int value) => _blink.BlinkHTMLInputElement.instance.selectionEnd_Setter_(unwrap_jso(this), value);
+  set selectionEnd(int value) => _blink.BlinkHTMLInputElement.instance.selectionEnd_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLInputElement.selectionStart')
   @DocsEditable()
@@ -19859,7 +23037,7 @@
   
   @DomName('HTMLInputElement.selectionStart')
   @DocsEditable()
-  void set selectionStart(int value) => _blink.BlinkHTMLInputElement.instance.selectionStart_Setter_(unwrap_jso(this), value);
+  set selectionStart(int value) => _blink.BlinkHTMLInputElement.instance.selectionStart_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLInputElement.size')
   @DocsEditable()
@@ -19867,7 +23045,7 @@
   
   @DomName('HTMLInputElement.size')
   @DocsEditable()
-  void set size(int value) => _blink.BlinkHTMLInputElement.instance.size_Setter_(unwrap_jso(this), value);
+  set size(int value) => _blink.BlinkHTMLInputElement.instance.size_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLInputElement.src')
   @DocsEditable()
@@ -19875,7 +23053,7 @@
   
   @DomName('HTMLInputElement.src')
   @DocsEditable()
-  void set src(String value) => _blink.BlinkHTMLInputElement.instance.src_Setter_(unwrap_jso(this), value);
+  set src(String value) => _blink.BlinkHTMLInputElement.instance.src_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLInputElement.step')
   @DocsEditable()
@@ -19883,7 +23061,7 @@
   
   @DomName('HTMLInputElement.step')
   @DocsEditable()
-  void set step(String value) => _blink.BlinkHTMLInputElement.instance.step_Setter_(unwrap_jso(this), value);
+  set step(String value) => _blink.BlinkHTMLInputElement.instance.step_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLInputElement.type')
   @DocsEditable()
@@ -19891,7 +23069,7 @@
   
   @DomName('HTMLInputElement.type')
   @DocsEditable()
-  void set type(String value) => _blink.BlinkHTMLInputElement.instance.type_Setter_(unwrap_jso(this), value);
+  set type(String value) => _blink.BlinkHTMLInputElement.instance.type_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLInputElement.validationMessage')
   @DocsEditable()
@@ -19907,7 +23085,7 @@
   
   @DomName('HTMLInputElement.value')
   @DocsEditable()
-  void set value(String value) => _blink.BlinkHTMLInputElement.instance.value_Setter_(unwrap_jso(this), value);
+  set value(String value) => _blink.BlinkHTMLInputElement.instance.value_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLInputElement.valueAsDate')
   @DocsEditable()
@@ -19915,7 +23093,7 @@
   
   @DomName('HTMLInputElement.valueAsDate')
   @DocsEditable()
-  void set valueAsDate(DateTime value) => _blink.BlinkHTMLInputElement.instance.valueAsDate_Setter_(unwrap_jso(this), value);
+  set valueAsDate(DateTime value) => _blink.BlinkHTMLInputElement.instance.valueAsDate_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLInputElement.valueAsNumber')
   @DocsEditable()
@@ -19923,7 +23101,7 @@
   
   @DomName('HTMLInputElement.valueAsNumber')
   @DocsEditable()
-  void set valueAsNumber(num value) => _blink.BlinkHTMLInputElement.instance.valueAsNumber_Setter_(unwrap_jso(this), value);
+  set valueAsNumber(num value) => _blink.BlinkHTMLInputElement.instance.valueAsNumber_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLInputElement.webkitEntries')
   @DocsEditable()
@@ -19931,7 +23109,7 @@
   @SupportedBrowser(SupportedBrowser.SAFARI)
   @Experimental()
   // http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#concept-input-type-file-selected
-  List<Entry> get entries => _blink.BlinkHTMLInputElement.instance.webkitEntries_Getter_(unwrap_jso(this));
+  List<Entry> get entries => wrap_jso(_blink.BlinkHTMLInputElement.instance.webkitEntries_Getter_(unwrap_jso(this)));
   
   @DomName('HTMLInputElement.webkitdirectory')
   @DocsEditable()
@@ -19947,7 +23125,7 @@
   @SupportedBrowser(SupportedBrowser.SAFARI)
   @Experimental()
   // https://plus.sandbox.google.com/+AddyOsmani/posts/Dk5UhZ6zfF3
-  void set directory(bool value) => _blink.BlinkHTMLInputElement.instance.webkitdirectory_Setter_(unwrap_jso(this), value);
+  set directory(bool value) => _blink.BlinkHTMLInputElement.instance.webkitdirectory_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLInputElement.width')
   @DocsEditable()
@@ -19955,7 +23133,7 @@
   
   @DomName('HTMLInputElement.width')
   @DocsEditable()
-  void set width(int value) => _blink.BlinkHTMLInputElement.instance.width_Setter_(unwrap_jso(this), value);
+  set width(int value) => _blink.BlinkHTMLInputElement.instance.width_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLInputElement.willValidate')
   @DocsEditable()
@@ -20587,6 +23765,20 @@
   // To suppress missing implicit constructor warnings.
   factory InputMethodContext._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static InputMethodContext internalCreateInputMethodContext() {
+    return new InputMethodContext._internalWrap();
+  }
+
+  factory InputMethodContext._internalWrap() {
+    return new InputMethodContext.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  InputMethodContext.internal_() : super.internal_();
+
+
   @DomName('InputMethodContext.compositionEndOffset')
   @DocsEditable()
   @Experimental() // untriaged
@@ -20625,10 +23817,24 @@
   // To suppress missing implicit constructor warnings.
   factory InstallEvent._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static InstallEvent internalCreateInstallEvent() {
+    return new InstallEvent._internalWrap();
+  }
+
+  factory InstallEvent._internalWrap() {
+    return new InstallEvent.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  InstallEvent.internal_() : super.internal_();
+
+
   @DomName('InstallEvent.reloadAll')
   @DocsEditable()
   @Experimental() // untriaged
-  Future reloadAll() => _blink.BlinkInstallEvent.instance.reloadAll_Callback_0_(unwrap_jso(this));
+  Future reloadAll() => wrap_jso(_blink.BlinkInstallEvent.instance.reloadAll_Callback_0_(unwrap_jso(this)));
   
   @DomName('InstallEvent.replace')
   @DocsEditable()
@@ -20665,6 +23871,20 @@
   // To suppress missing implicit constructor warnings.
   factory KeyboardEvent._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static KeyboardEvent internalCreateKeyboardEvent() {
+    return new KeyboardEvent._internalWrap();
+  }
+
+  factory KeyboardEvent._internalWrap() {
+    return new KeyboardEvent.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  KeyboardEvent.internal_() : super.internal_();
+
+
   @DomName('KeyboardEvent.DOM_KEY_LOCATION_LEFT')
   @DocsEditable()
   @Experimental() // untriaged
@@ -20751,6 +23971,20 @@
   @DomName('HTMLKeygenElement.HTMLKeygenElement')
   @DocsEditable()
   factory KeygenElement() => document.createElement("keygen");
+
+
+  @Deprecated("Internal Use Only")
+  static KeygenElement internalCreateKeygenElement() {
+    return new KeygenElement._internalWrap();
+  }
+
+  factory KeygenElement._internalWrap() {
+    return new KeygenElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  KeygenElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -20767,7 +24001,7 @@
   
   @DomName('HTMLKeygenElement.autofocus')
   @DocsEditable()
-  void set autofocus(bool value) => _blink.BlinkHTMLKeygenElement.instance.autofocus_Setter_(unwrap_jso(this), value);
+  set autofocus(bool value) => _blink.BlinkHTMLKeygenElement.instance.autofocus_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLKeygenElement.challenge')
   @DocsEditable()
@@ -20775,7 +24009,7 @@
   
   @DomName('HTMLKeygenElement.challenge')
   @DocsEditable()
-  void set challenge(String value) => _blink.BlinkHTMLKeygenElement.instance.challenge_Setter_(unwrap_jso(this), value);
+  set challenge(String value) => _blink.BlinkHTMLKeygenElement.instance.challenge_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLKeygenElement.disabled')
   @DocsEditable()
@@ -20783,7 +24017,7 @@
   
   @DomName('HTMLKeygenElement.disabled')
   @DocsEditable()
-  void set disabled(bool value) => _blink.BlinkHTMLKeygenElement.instance.disabled_Setter_(unwrap_jso(this), value);
+  set disabled(bool value) => _blink.BlinkHTMLKeygenElement.instance.disabled_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLKeygenElement.form')
   @DocsEditable()
@@ -20795,12 +24029,12 @@
   
   @DomName('HTMLKeygenElement.keytype')
   @DocsEditable()
-  void set keytype(String value) => _blink.BlinkHTMLKeygenElement.instance.keytype_Setter_(unwrap_jso(this), value);
+  set keytype(String value) => _blink.BlinkHTMLKeygenElement.instance.keytype_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLKeygenElement.labels')
   @DocsEditable()
   @Unstable()
-  List<Node> get labels => wrap_jso_list(_blink.BlinkHTMLKeygenElement.instance.labels_Getter_(unwrap_jso(this)));
+  List<Node> get labels => wrap_jso(_blink.BlinkHTMLKeygenElement.instance.labels_Getter_(unwrap_jso(this)));
   
   @DomName('HTMLKeygenElement.name')
   @DocsEditable()
@@ -20808,7 +24042,7 @@
   
   @DomName('HTMLKeygenElement.name')
   @DocsEditable()
-  void set name(String value) => _blink.BlinkHTMLKeygenElement.instance.name_Setter_(unwrap_jso(this), value);
+  set name(String value) => _blink.BlinkHTMLKeygenElement.instance.name_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLKeygenElement.type')
   @DocsEditable()
@@ -20851,6 +24085,20 @@
   @DomName('HTMLLIElement.HTMLLIElement')
   @DocsEditable()
   factory LIElement() => document.createElement("li");
+
+
+  @Deprecated("Internal Use Only")
+  static LIElement internalCreateLIElement() {
+    return new LIElement._internalWrap();
+  }
+
+  factory LIElement._internalWrap() {
+    return new LIElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  LIElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -20864,7 +24112,7 @@
   
   @DomName('HTMLLIElement.value')
   @DocsEditable()
-  void set value(int value) => _blink.BlinkHTMLLIElement.instance.value_Setter_(unwrap_jso(this), value);
+  set value(int value) => _blink.BlinkHTMLLIElement.instance.value_Setter_(unwrap_jso(this), value);
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -20883,6 +24131,20 @@
   @DomName('HTMLLabelElement.HTMLLabelElement')
   @DocsEditable()
   factory LabelElement() => document.createElement("label");
+
+
+  @Deprecated("Internal Use Only")
+  static LabelElement internalCreateLabelElement() {
+    return new LabelElement._internalWrap();
+  }
+
+  factory LabelElement._internalWrap() {
+    return new LabelElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  LabelElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -20904,7 +24166,7 @@
   
   @DomName('HTMLLabelElement.htmlFor')
   @DocsEditable()
-  void set htmlFor(String value) => _blink.BlinkHTMLLabelElement.instance.htmlFor_Setter_(unwrap_jso(this), value);
+  set htmlFor(String value) => _blink.BlinkHTMLLabelElement.instance.htmlFor_Setter_(unwrap_jso(this), value);
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -20923,6 +24185,20 @@
   @DomName('HTMLLegendElement.HTMLLegendElement')
   @DocsEditable()
   factory LegendElement() => document.createElement("legend");
+
+
+  @Deprecated("Internal Use Only")
+  static LegendElement internalCreateLegendElement() {
+    return new LegendElement._internalWrap();
+  }
+
+  factory LegendElement._internalWrap() {
+    return new LegendElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  LegendElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -20949,6 +24225,20 @@
   @DomName('HTMLLinkElement.HTMLLinkElement')
   @DocsEditable()
   factory LinkElement() => document.createElement("link");
+
+
+  @Deprecated("Internal Use Only")
+  static LinkElement internalCreateLinkElement() {
+    return new LinkElement._internalWrap();
+  }
+
+  factory LinkElement._internalWrap() {
+    return new LinkElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  LinkElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -20964,7 +24254,7 @@
   @DomName('HTMLLinkElement.crossOrigin')
   @DocsEditable()
   @Experimental() // untriaged
-  void set crossOrigin(String value) => _blink.BlinkHTMLLinkElement.instance.crossOrigin_Setter_(unwrap_jso(this), value);
+  set crossOrigin(String value) => _blink.BlinkHTMLLinkElement.instance.crossOrigin_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLLinkElement.disabled')
   @DocsEditable()
@@ -20972,7 +24262,7 @@
   
   @DomName('HTMLLinkElement.disabled')
   @DocsEditable()
-  void set disabled(bool value) => _blink.BlinkHTMLLinkElement.instance.disabled_Setter_(unwrap_jso(this), value);
+  set disabled(bool value) => _blink.BlinkHTMLLinkElement.instance.disabled_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLLinkElement.href')
   @DocsEditable()
@@ -20980,7 +24270,7 @@
   
   @DomName('HTMLLinkElement.href')
   @DocsEditable()
-  void set href(String value) => _blink.BlinkHTMLLinkElement.instance.href_Setter_(unwrap_jso(this), value);
+  set href(String value) => _blink.BlinkHTMLLinkElement.instance.href_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLLinkElement.hreflang')
   @DocsEditable()
@@ -20988,7 +24278,7 @@
   
   @DomName('HTMLLinkElement.hreflang')
   @DocsEditable()
-  void set hreflang(String value) => _blink.BlinkHTMLLinkElement.instance.hreflang_Setter_(unwrap_jso(this), value);
+  set hreflang(String value) => _blink.BlinkHTMLLinkElement.instance.hreflang_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLLinkElement.import')
   @DocsEditable()
@@ -21004,7 +24294,7 @@
   @DomName('HTMLLinkElement.integrity')
   @DocsEditable()
   @Experimental() // untriaged
-  void set integrity(String value) => _blink.BlinkHTMLLinkElement.instance.integrity_Setter_(unwrap_jso(this), value);
+  set integrity(String value) => _blink.BlinkHTMLLinkElement.instance.integrity_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLLinkElement.media')
   @DocsEditable()
@@ -21012,7 +24302,7 @@
   
   @DomName('HTMLLinkElement.media')
   @DocsEditable()
-  void set media(String value) => _blink.BlinkHTMLLinkElement.instance.media_Setter_(unwrap_jso(this), value);
+  set media(String value) => _blink.BlinkHTMLLinkElement.instance.media_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLLinkElement.rel')
   @DocsEditable()
@@ -21020,7 +24310,7 @@
   
   @DomName('HTMLLinkElement.rel')
   @DocsEditable()
-  void set rel(String value) => _blink.BlinkHTMLLinkElement.instance.rel_Setter_(unwrap_jso(this), value);
+  set rel(String value) => _blink.BlinkHTMLLinkElement.instance.rel_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLLinkElement.sheet')
   @DocsEditable()
@@ -21036,7 +24326,7 @@
   
   @DomName('HTMLLinkElement.type')
   @DocsEditable()
-  void set type(String value) => _blink.BlinkHTMLLinkElement.instance.type_Setter_(unwrap_jso(this), value);
+  set type(String value) => _blink.BlinkHTMLLinkElement.instance.type_Setter_(unwrap_jso(this), value);
   
 
     /// Checks if HTML imports are supported on the current platform.
@@ -21061,9 +24351,23 @@
   @DomName('LocalCredential.LocalCredential')
   @DocsEditable()
   factory LocalCredential(String id, String name, String avatarURL, String password) {
-    return _blink.BlinkLocalCredential.instance.constructorCallback_4_(id, name, avatarURL, password);
+    return wrap_jso(_blink.BlinkLocalCredential.instance.constructorCallback_4_(id, name, avatarURL, password));
   }
 
+
+  @Deprecated("Internal Use Only")
+  static LocalCredential internalCreateLocalCredential() {
+    return new LocalCredential._internalWrap();
+  }
+
+  factory LocalCredential._internalWrap() {
+    return new LocalCredential.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  LocalCredential.internal_() : super.internal_();
+
+
   @DomName('LocalCredential.password')
   @DocsEditable()
   @Experimental() // untriaged
@@ -21077,14 +24381,29 @@
 
 @DocsEditable()
 @DomName('Location')
-class Location extends NativeFieldWrapperClass2 implements LocationBase {
+class Location extends DartHtmlDomObject implements LocationBase {
   // To suppress missing implicit constructor warnings.
   factory Location._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static Location internalCreateLocation() {
+    return new Location._internalWrap();
+  }
+
+  factory Location._internalWrap() {
+    return new Location.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  Location.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('Location.ancestorOrigins')
   @DocsEditable()
   @Experimental() // nonstandard
-  List<String> get ancestorOrigins => _blink.BlinkLocation.instance.ancestorOrigins_Getter_(unwrap_jso(this));
+  List<String> get ancestorOrigins => wrap_jso(_blink.BlinkLocation.instance.ancestorOrigins_Getter_(unwrap_jso(this)));
   
   @DomName('Location.hash')
   @DocsEditable()
@@ -21092,7 +24411,7 @@
   
   @DomName('Location.hash')
   @DocsEditable()
-  void set hash(String value) => _blink.BlinkLocation.instance.hash_Setter_(unwrap_jso(this), value);
+  set hash(String value) => _blink.BlinkLocation.instance.hash_Setter_(unwrap_jso(this), value);
   
   @DomName('Location.host')
   @DocsEditable()
@@ -21100,7 +24419,7 @@
   
   @DomName('Location.host')
   @DocsEditable()
-  void set host(String value) => _blink.BlinkLocation.instance.host_Setter_(unwrap_jso(this), value);
+  set host(String value) => _blink.BlinkLocation.instance.host_Setter_(unwrap_jso(this), value);
   
   @DomName('Location.hostname')
   @DocsEditable()
@@ -21108,7 +24427,7 @@
   
   @DomName('Location.hostname')
   @DocsEditable()
-  void set hostname(String value) => _blink.BlinkLocation.instance.hostname_Setter_(unwrap_jso(this), value);
+  set hostname(String value) => _blink.BlinkLocation.instance.hostname_Setter_(unwrap_jso(this), value);
   
   @DomName('Location.href')
   @DocsEditable()
@@ -21116,7 +24435,7 @@
   
   @DomName('Location.href')
   @DocsEditable()
-  void set href(String value) => _blink.BlinkLocation.instance.href_Setter_(unwrap_jso(this), value);
+  set href(String value) => _blink.BlinkLocation.instance.href_Setter_(unwrap_jso(this), value);
   
   @DomName('Location.origin')
   @DocsEditable()
@@ -21130,7 +24449,7 @@
   
   @DomName('Location.pathname')
   @DocsEditable()
-  void set pathname(String value) => _blink.BlinkLocation.instance.pathname_Setter_(unwrap_jso(this), value);
+  set pathname(String value) => _blink.BlinkLocation.instance.pathname_Setter_(unwrap_jso(this), value);
   
   @DomName('Location.port')
   @DocsEditable()
@@ -21138,7 +24457,7 @@
   
   @DomName('Location.port')
   @DocsEditable()
-  void set port(String value) => _blink.BlinkLocation.instance.port_Setter_(unwrap_jso(this), value);
+  set port(String value) => _blink.BlinkLocation.instance.port_Setter_(unwrap_jso(this), value);
   
   @DomName('Location.protocol')
   @DocsEditable()
@@ -21146,7 +24465,7 @@
   
   @DomName('Location.protocol')
   @DocsEditable()
-  void set protocol(String value) => _blink.BlinkLocation.instance.protocol_Setter_(unwrap_jso(this), value);
+  set protocol(String value) => _blink.BlinkLocation.instance.protocol_Setter_(unwrap_jso(this), value);
   
   @DomName('Location.search')
   @DocsEditable()
@@ -21154,7 +24473,7 @@
   
   @DomName('Location.search')
   @DocsEditable()
-  void set search(String value) => _blink.BlinkLocation.instance.search_Setter_(unwrap_jso(this), value);
+  set search(String value) => _blink.BlinkLocation.instance.search_Setter_(unwrap_jso(this), value);
   
   @DomName('Location.assign')
   @DocsEditable()
@@ -21212,6 +24531,20 @@
   @DomName('HTMLMapElement.HTMLMapElement')
   @DocsEditable()
   factory MapElement() => document.createElement("map");
+
+
+  @Deprecated("Internal Use Only")
+  static MapElement internalCreateMapElement() {
+    return new MapElement._internalWrap();
+  }
+
+  factory MapElement._internalWrap() {
+    return new MapElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  MapElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -21221,7 +24554,7 @@
 
   @DomName('HTMLMapElement.areas')
   @DocsEditable()
-  List<Node> get areas => wrap_jso_list(_blink.BlinkHTMLMapElement.instance.areas_Getter_(unwrap_jso(this)));
+  List<Node> get areas => wrap_jso(_blink.BlinkHTMLMapElement.instance.areas_Getter_(unwrap_jso(this)));
   
   @DomName('HTMLMapElement.name')
   @DocsEditable()
@@ -21229,7 +24562,7 @@
   
   @DomName('HTMLMapElement.name')
   @DocsEditable()
-  void set name(String value) => _blink.BlinkHTMLMapElement.instance.name_Setter_(unwrap_jso(this), value);
+  set name(String value) => _blink.BlinkHTMLMapElement.instance.name_Setter_(unwrap_jso(this), value);
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -21250,9 +24583,23 @@
   @DomName('MediaController.MediaController')
   @DocsEditable()
   factory MediaController() {
-    return _blink.BlinkMediaController.instance.constructorCallback_0_();
+    return wrap_jso(_blink.BlinkMediaController.instance.constructorCallback_0_());
   }
 
+
+  @Deprecated("Internal Use Only")
+  static MediaController internalCreateMediaController() {
+    return new MediaController._internalWrap();
+  }
+
+  factory MediaController._internalWrap() {
+    return new MediaController.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  MediaController.internal_() : super.internal_();
+
+
   @DomName('MediaController.buffered')
   @DocsEditable()
   TimeRanges get buffered => wrap_jso(_blink.BlinkMediaController.instance.buffered_Getter_(unwrap_jso(this)));
@@ -21263,7 +24610,7 @@
   
   @DomName('MediaController.currentTime')
   @DocsEditable()
-  void set currentTime(num value) => _blink.BlinkMediaController.instance.currentTime_Setter_(unwrap_jso(this), value);
+  set currentTime(num value) => _blink.BlinkMediaController.instance.currentTime_Setter_(unwrap_jso(this), value);
   
   @DomName('MediaController.defaultPlaybackRate')
   @DocsEditable()
@@ -21271,11 +24618,11 @@
   
   @DomName('MediaController.defaultPlaybackRate')
   @DocsEditable()
-  void set defaultPlaybackRate(num value) => _blink.BlinkMediaController.instance.defaultPlaybackRate_Setter_(unwrap_jso(this), value);
+  set defaultPlaybackRate(num value) => _blink.BlinkMediaController.instance.defaultPlaybackRate_Setter_(unwrap_jso(this), value);
   
   @DomName('MediaController.duration')
   @DocsEditable()
-  double get duration => _blink.BlinkMediaController.instance.duration_Getter_(unwrap_jso(this));
+  num get duration => _blink.BlinkMediaController.instance.duration_Getter_(unwrap_jso(this));
   
   @DomName('MediaController.muted')
   @DocsEditable()
@@ -21283,7 +24630,7 @@
   
   @DomName('MediaController.muted')
   @DocsEditable()
-  void set muted(bool value) => _blink.BlinkMediaController.instance.muted_Setter_(unwrap_jso(this), value);
+  set muted(bool value) => _blink.BlinkMediaController.instance.muted_Setter_(unwrap_jso(this), value);
   
   @DomName('MediaController.paused')
   @DocsEditable()
@@ -21295,7 +24642,7 @@
   
   @DomName('MediaController.playbackRate')
   @DocsEditable()
-  void set playbackRate(num value) => _blink.BlinkMediaController.instance.playbackRate_Setter_(unwrap_jso(this), value);
+  set playbackRate(num value) => _blink.BlinkMediaController.instance.playbackRate_Setter_(unwrap_jso(this), value);
   
   @DomName('MediaController.playbackState')
   @DocsEditable()
@@ -21315,7 +24662,7 @@
   
   @DomName('MediaController.volume')
   @DocsEditable()
-  void set volume(num value) => _blink.BlinkMediaController.instance.volume_Setter_(unwrap_jso(this), value);
+  set volume(num value) => _blink.BlinkMediaController.instance.volume_Setter_(unwrap_jso(this), value);
   
   @DomName('MediaController.pause')
   @DocsEditable()
@@ -21340,10 +24687,25 @@
 @DocsEditable()
 @DomName('MediaDeviceInfo')
 @Experimental() // untriaged
-class MediaDeviceInfo extends NativeFieldWrapperClass2 {
+class MediaDeviceInfo extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory MediaDeviceInfo._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static MediaDeviceInfo internalCreateMediaDeviceInfo() {
+    return new MediaDeviceInfo._internalWrap();
+  }
+
+  factory MediaDeviceInfo._internalWrap() {
+    return new MediaDeviceInfo.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  MediaDeviceInfo.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('MediaDeviceInfo.deviceId')
   @DocsEditable()
   @Experimental() // untriaged
@@ -21444,6 +24806,20 @@
   @Experimental()
   // https://dvcs.w3.org/hg/html-media/raw-file/eme-v0.1/encrypted-media/encrypted-media.html#dom-keyadded
   static const EventStreamProvider<MediaKeyEvent> needKeyEvent = const EventStreamProvider<MediaKeyEvent>('webkitneedkey');
+
+
+  @Deprecated("Internal Use Only")
+  static MediaElement internalCreateMediaElement() {
+    return new MediaElement._internalWrap();
+  }
+
+  factory MediaElement._internalWrap() {
+    return new MediaElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  MediaElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -21498,7 +24874,7 @@
   
   @DomName('HTMLMediaElement.autoplay')
   @DocsEditable()
-  void set autoplay(bool value) => _blink.BlinkHTMLMediaElement.instance.autoplay_Setter_(unwrap_jso(this), value);
+  set autoplay(bool value) => _blink.BlinkHTMLMediaElement.instance.autoplay_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLMediaElement.buffered')
   @DocsEditable()
@@ -21510,7 +24886,7 @@
   
   @DomName('HTMLMediaElement.controller')
   @DocsEditable()
-  void set controller(MediaController value) => _blink.BlinkHTMLMediaElement.instance.controller_Setter_(unwrap_jso(this), unwrap_jso(value));
+  set controller(MediaController value) => _blink.BlinkHTMLMediaElement.instance.controller_Setter_(unwrap_jso(this), unwrap_jso(value));
   
   @DomName('HTMLMediaElement.controls')
   @DocsEditable()
@@ -21518,7 +24894,7 @@
   
   @DomName('HTMLMediaElement.controls')
   @DocsEditable()
-  void set controls(bool value) => _blink.BlinkHTMLMediaElement.instance.controls_Setter_(unwrap_jso(this), value);
+  set controls(bool value) => _blink.BlinkHTMLMediaElement.instance.controls_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLMediaElement.crossOrigin')
   @DocsEditable()
@@ -21528,7 +24904,7 @@
   @DomName('HTMLMediaElement.crossOrigin')
   @DocsEditable()
   @Experimental() // untriaged
-  void set crossOrigin(String value) => _blink.BlinkHTMLMediaElement.instance.crossOrigin_Setter_(unwrap_jso(this), value);
+  set crossOrigin(String value) => _blink.BlinkHTMLMediaElement.instance.crossOrigin_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLMediaElement.currentSrc')
   @DocsEditable()
@@ -21540,7 +24916,7 @@
   
   @DomName('HTMLMediaElement.currentTime')
   @DocsEditable()
-  void set currentTime(num value) => _blink.BlinkHTMLMediaElement.instance.currentTime_Setter_(unwrap_jso(this), value);
+  set currentTime(num value) => _blink.BlinkHTMLMediaElement.instance.currentTime_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLMediaElement.defaultMuted')
   @DocsEditable()
@@ -21548,7 +24924,7 @@
   
   @DomName('HTMLMediaElement.defaultMuted')
   @DocsEditable()
-  void set defaultMuted(bool value) => _blink.BlinkHTMLMediaElement.instance.defaultMuted_Setter_(unwrap_jso(this), value);
+  set defaultMuted(bool value) => _blink.BlinkHTMLMediaElement.instance.defaultMuted_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLMediaElement.defaultPlaybackRate')
   @DocsEditable()
@@ -21556,11 +24932,11 @@
   
   @DomName('HTMLMediaElement.defaultPlaybackRate')
   @DocsEditable()
-  void set defaultPlaybackRate(num value) => _blink.BlinkHTMLMediaElement.instance.defaultPlaybackRate_Setter_(unwrap_jso(this), value);
+  set defaultPlaybackRate(num value) => _blink.BlinkHTMLMediaElement.instance.defaultPlaybackRate_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLMediaElement.duration')
   @DocsEditable()
-  double get duration => _blink.BlinkHTMLMediaElement.instance.duration_Getter_(unwrap_jso(this));
+  num get duration => _blink.BlinkHTMLMediaElement.instance.duration_Getter_(unwrap_jso(this));
   
   @DomName('HTMLMediaElement.ended')
   @DocsEditable()
@@ -21578,7 +24954,7 @@
   @DomName('HTMLMediaElement.integrity')
   @DocsEditable()
   @Experimental() // untriaged
-  void set integrity(String value) => _blink.BlinkHTMLMediaElement.instance.integrity_Setter_(unwrap_jso(this), value);
+  set integrity(String value) => _blink.BlinkHTMLMediaElement.instance.integrity_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLMediaElement.loop')
   @DocsEditable()
@@ -21586,7 +24962,7 @@
   
   @DomName('HTMLMediaElement.loop')
   @DocsEditable()
-  void set loop(bool value) => _blink.BlinkHTMLMediaElement.instance.loop_Setter_(unwrap_jso(this), value);
+  set loop(bool value) => _blink.BlinkHTMLMediaElement.instance.loop_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLMediaElement.mediaGroup')
   @DocsEditable()
@@ -21594,7 +24970,7 @@
   
   @DomName('HTMLMediaElement.mediaGroup')
   @DocsEditable()
-  void set mediaGroup(String value) => _blink.BlinkHTMLMediaElement.instance.mediaGroup_Setter_(unwrap_jso(this), value);
+  set mediaGroup(String value) => _blink.BlinkHTMLMediaElement.instance.mediaGroup_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLMediaElement.mediaKeys')
   @DocsEditable()
@@ -21608,7 +24984,7 @@
   
   @DomName('HTMLMediaElement.muted')
   @DocsEditable()
-  void set muted(bool value) => _blink.BlinkHTMLMediaElement.instance.muted_Setter_(unwrap_jso(this), value);
+  set muted(bool value) => _blink.BlinkHTMLMediaElement.instance.muted_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLMediaElement.networkState')
   @DocsEditable()
@@ -21624,7 +25000,7 @@
   
   @DomName('HTMLMediaElement.playbackRate')
   @DocsEditable()
-  void set playbackRate(num value) => _blink.BlinkHTMLMediaElement.instance.playbackRate_Setter_(unwrap_jso(this), value);
+  set playbackRate(num value) => _blink.BlinkHTMLMediaElement.instance.playbackRate_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLMediaElement.played')
   @DocsEditable()
@@ -21636,7 +25012,7 @@
   
   @DomName('HTMLMediaElement.preload')
   @DocsEditable()
-  void set preload(String value) => _blink.BlinkHTMLMediaElement.instance.preload_Setter_(unwrap_jso(this), value);
+  set preload(String value) => _blink.BlinkHTMLMediaElement.instance.preload_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLMediaElement.readyState')
   @DocsEditable()
@@ -21656,7 +25032,7 @@
   
   @DomName('HTMLMediaElement.src')
   @DocsEditable()
-  void set src(String value) => _blink.BlinkHTMLMediaElement.instance.src_Setter_(unwrap_jso(this), value);
+  set src(String value) => _blink.BlinkHTMLMediaElement.instance.src_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLMediaElement.textTracks')
   @DocsEditable()
@@ -21675,7 +25051,7 @@
   
   @DomName('HTMLMediaElement.volume')
   @DocsEditable()
-  void set volume(num value) => _blink.BlinkHTMLMediaElement.instance.volume_Setter_(unwrap_jso(this), value);
+  set volume(num value) => _blink.BlinkHTMLMediaElement.instance.volume_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLMediaElement.webkitAudioDecodedByteCount')
   @DocsEditable()
@@ -21725,7 +25101,7 @@
   @DomName('HTMLMediaElement.setMediaKeys')
   @DocsEditable()
   @Experimental() // untriaged
-  Future setMediaKeys(MediaKeys mediaKeys) => _blink.BlinkHTMLMediaElement.instance.setMediaKeys_Callback_1_(unwrap_jso(this), unwrap_jso(mediaKeys));
+  Future setMediaKeys(MediaKeys mediaKeys) => wrap_jso(_blink.BlinkHTMLMediaElement.instance.setMediaKeys_Callback_1_(unwrap_jso(this), unwrap_jso(mediaKeys)));
   
   void addKey(String keySystem, Uint8List key, [Uint8List initData, String sessionId]) {
     if (initData != null) {
@@ -21792,10 +25168,25 @@
 @DocsEditable()
 @DomName('MediaError')
 @Unstable()
-class MediaError extends NativeFieldWrapperClass2 {
+class MediaError extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory MediaError._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static MediaError internalCreateMediaError() {
+    return new MediaError._internalWrap();
+  }
+
+  factory MediaError._internalWrap() {
+    return new MediaError.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  MediaError.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('MediaError.MEDIA_ERR_ABORTED')
   @DocsEditable()
   static const int MEDIA_ERR_ABORTED = 1;
@@ -21834,10 +25225,25 @@
 @DomName('MediaKeyError')
 // https://dvcs.w3.org/hg/html-media/raw-file/eme-v0.1/encrypted-media/encrypted-media.html#error-codes
 @Experimental()
-class MediaKeyError extends NativeFieldWrapperClass2 {
+class MediaKeyError extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory MediaKeyError._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static MediaKeyError internalCreateMediaKeyError() {
+    return new MediaKeyError._internalWrap();
+  }
+
+  factory MediaKeyError._internalWrap() {
+    return new MediaKeyError.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  MediaKeyError.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('MediaKeyError.MEDIA_KEYERR_CLIENT')
   @DocsEditable()
   static const int MEDIA_KEYERR_CLIENT = 2;
@@ -21887,6 +25293,20 @@
   // To suppress missing implicit constructor warnings.
   factory MediaKeyEvent._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static MediaKeyEvent internalCreateMediaKeyEvent() {
+    return new MediaKeyEvent._internalWrap();
+  }
+
+  factory MediaKeyEvent._internalWrap() {
+    return new MediaKeyEvent.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  MediaKeyEvent.internal_() : super.internal_();
+
+
   @DomName('MediaKeyEvent.defaultURL')
   @DocsEditable()
   String get defaultUrl => _blink.BlinkMediaKeyEvent.instance.defaultURL_Getter_(unwrap_jso(this));
@@ -21897,7 +25317,7 @@
   
   @DomName('MediaKeyEvent.initData')
   @DocsEditable()
-  Uint8List get initData => wrap_jso(_blink.BlinkMediaKeyEvent.instance.initData_Getter_(unwrap_jso(this)));
+  Uint8List get initData => _blink.BlinkMediaKeyEvent.instance.initData_Getter_(unwrap_jso(this));
   
   @DomName('MediaKeyEvent.keySystem')
   @DocsEditable()
@@ -21905,7 +25325,7 @@
   
   @DomName('MediaKeyEvent.message')
   @DocsEditable()
-  Uint8List get message => wrap_jso(_blink.BlinkMediaKeyEvent.instance.message_Getter_(unwrap_jso(this)));
+  Uint8List get message => _blink.BlinkMediaKeyEvent.instance.message_Getter_(unwrap_jso(this));
   
   @DomName('MediaKeyEvent.sessionId')
   @DocsEditable()
@@ -21931,13 +25351,27 @@
   // To suppress missing implicit constructor warnings.
   factory MediaKeyMessageEvent._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static MediaKeyMessageEvent internalCreateMediaKeyMessageEvent() {
+    return new MediaKeyMessageEvent._internalWrap();
+  }
+
+  factory MediaKeyMessageEvent._internalWrap() {
+    return new MediaKeyMessageEvent.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  MediaKeyMessageEvent.internal_() : super.internal_();
+
+
   @DomName('MediaKeyMessageEvent.destinationURL')
   @DocsEditable()
   String get destinationUrl => _blink.BlinkMediaKeyMessageEvent.instance.destinationURL_Getter_(unwrap_jso(this));
   
   @DomName('MediaKeyMessageEvent.message')
   @DocsEditable()
-  ByteBuffer get message => wrap_jso(_blink.BlinkMediaKeyMessageEvent.instance.message_Getter_(unwrap_jso(this)));
+  ByteBuffer get message => _blink.BlinkMediaKeyMessageEvent.instance.message_Getter_(unwrap_jso(this));
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -21955,6 +25389,20 @@
   // To suppress missing implicit constructor warnings.
   factory MediaKeyNeededEvent._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static MediaKeyNeededEvent internalCreateMediaKeyNeededEvent() {
+    return new MediaKeyNeededEvent._internalWrap();
+  }
+
+  factory MediaKeyNeededEvent._internalWrap() {
+    return new MediaKeyNeededEvent.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  MediaKeyNeededEvent.internal_() : super.internal_();
+
+
   @DomName('MediaKeyNeededEvent.contentType')
   @DocsEditable()
   @Experimental() // untriaged
@@ -21962,7 +25410,7 @@
   
   @DomName('MediaKeyNeededEvent.initData')
   @DocsEditable()
-  Uint8List get initData => wrap_jso(_blink.BlinkMediaKeyNeededEvent.instance.initData_Getter_(unwrap_jso(this)));
+  Uint8List get initData => _blink.BlinkMediaKeyNeededEvent.instance.initData_Getter_(unwrap_jso(this));
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -21980,10 +25428,24 @@
   // To suppress missing implicit constructor warnings.
   factory MediaKeySession._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static MediaKeySession internalCreateMediaKeySession() {
+    return new MediaKeySession._internalWrap();
+  }
+
+  factory MediaKeySession._internalWrap() {
+    return new MediaKeySession.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  MediaKeySession.internal_() : super.internal_();
+
+
   @DomName('MediaKeySession.closed')
   @DocsEditable()
   @Experimental() // untriaged
-  Future get closed => _blink.BlinkMediaKeySession.instance.closed_Getter_(unwrap_jso(this));
+  Future get closed => wrap_jso(_blink.BlinkMediaKeySession.instance.closed_Getter_(unwrap_jso(this)));
   
   @DomName('MediaKeySession.error')
   @DocsEditable()
@@ -21999,10 +25461,10 @@
   
   Future generateRequest(String initDataType, initData) {
     if ((initData is TypedData) && (initDataType is String)) {
-      return _blink.BlinkMediaKeySession.instance.generateRequest_Callback_2_(unwrap_jso(this), initDataType, unwrap_jso(initData));
+      return wrap_jso(_blink.BlinkMediaKeySession.instance.generateRequest_Callback_2_(unwrap_jso(this), initDataType, unwrap_jso(initData)));
     }
     if ((initData is ByteBuffer) && (initDataType is String)) {
-      return _blink.BlinkMediaKeySession.instance.generateRequest_Callback_2_(unwrap_jso(this), initDataType, unwrap_jso(initData));
+      return wrap_jso(_blink.BlinkMediaKeySession.instance.generateRequest_Callback_2_(unwrap_jso(this), initDataType, unwrap_jso(initData)));
     }
     throw new ArgumentError("Incorrect number or type of arguments");
   }
@@ -22010,14 +25472,14 @@
   @DomName('MediaKeySession.release')
   @DocsEditable()
   @Experimental() // untriaged
-  Future release() => _blink.BlinkMediaKeySession.instance.release_Callback_0_(unwrap_jso(this));
+  Future release() => wrap_jso(_blink.BlinkMediaKeySession.instance.release_Callback_0_(unwrap_jso(this)));
   
   Future _update(response) {
     if ((response is TypedData)) {
-      return _blink.BlinkMediaKeySession.instance.update_Callback_1_(unwrap_jso(this), unwrap_jso(response));
+      return wrap_jso(_blink.BlinkMediaKeySession.instance.update_Callback_1_(unwrap_jso(this), unwrap_jso(response)));
     }
     if ((response is ByteBuffer)) {
-      return _blink.BlinkMediaKeySession.instance.update_Callback_1_(unwrap_jso(this), unwrap_jso(response));
+      return wrap_jso(_blink.BlinkMediaKeySession.instance.update_Callback_1_(unwrap_jso(this), unwrap_jso(response)));
     }
     throw new ArgumentError("Incorrect number or type of arguments");
   }
@@ -22034,10 +25496,25 @@
 @DomName('MediaKeys')
 // https://dvcs.w3.org/hg/html-media/raw-file/eme-v0.1/encrypted-media/encrypted-media.html
 @Experimental()
-class MediaKeys extends NativeFieldWrapperClass2 {
+class MediaKeys extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory MediaKeys._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static MediaKeys internalCreateMediaKeys() {
+    return new MediaKeys._internalWrap();
+  }
+
+  factory MediaKeys._internalWrap() {
+    return new MediaKeys.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  MediaKeys.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('MediaKeys.keySystem')
   @DocsEditable()
   String get keySystem => _blink.BlinkMediaKeys.instance.keySystem_Getter_(unwrap_jso(this));
@@ -22045,7 +25522,7 @@
   @DomName('MediaKeys.create')
   @DocsEditable()
   @Experimental() // untriaged
-  static Future create(String keySystem) => _blink.BlinkMediaKeys.instance.create_Callback_1_(keySystem);
+  static Future create(String keySystem) => wrap_jso(_blink.BlinkMediaKeys.instance.create_Callback_1_(keySystem));
   
   MediaKeySession _createSession([String sessionType]) {
     if (sessionType != null) {
@@ -22070,10 +25547,25 @@
 @DocsEditable()
 @DomName('MediaList')
 @Unstable()
-class MediaList extends NativeFieldWrapperClass2 {
+class MediaList extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory MediaList._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static MediaList internalCreateMediaList() {
+    return new MediaList._internalWrap();
+  }
+
+  factory MediaList._internalWrap() {
+    return new MediaList.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  MediaList.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('MediaList.length')
   @DocsEditable()
   int get length => _blink.BlinkMediaList.instance.length_Getter_(unwrap_jso(this));
@@ -22084,7 +25576,7 @@
   
   @DomName('MediaList.mediaText')
   @DocsEditable()
-  void set mediaText(String value) => _blink.BlinkMediaList.instance.mediaText_Setter_(unwrap_jso(this), value);
+  set mediaText(String value) => _blink.BlinkMediaList.instance.mediaText_Setter_(unwrap_jso(this), value);
   
   @DomName('MediaList.appendMedium')
   @DocsEditable()
@@ -22118,6 +25610,20 @@
   @Experimental() // untriaged
   static const EventStreamProvider<Event> changeEvent = const EventStreamProvider<Event>('change');
 
+
+  @Deprecated("Internal Use Only")
+  static MediaQueryList internalCreateMediaQueryList() {
+    return new MediaQueryList._internalWrap();
+  }
+
+  factory MediaQueryList._internalWrap() {
+    return new MediaQueryList.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  MediaQueryList.internal_() : super.internal_();
+
+
   @DomName('MediaQueryList.matches')
   @DocsEditable()
   bool get matches => _blink.BlinkMediaQueryList.instance.matches_Getter_(unwrap_jso(this));
@@ -22128,7 +25634,7 @@
   
   @DomName('MediaQueryList.addListener')
   @DocsEditable()
-  void addListener(EventListener listener) => _blink.BlinkMediaQueryList.instance.addListener_Callback_1_(unwrap_jso(this), unwrap_jso(listener));
+  void addListener(EventListener listener) => _blink.BlinkMediaQueryList.instance.addListener_Callback_1_(unwrap_jso(this), unwrap_jso((event) => listener(wrap_jso(event))));
   
   @DomName('MediaQueryList.removeListener')
   @DocsEditable()
@@ -22154,6 +25660,20 @@
   // To suppress missing implicit constructor warnings.
   factory MediaQueryListEvent._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static MediaQueryListEvent internalCreateMediaQueryListEvent() {
+    return new MediaQueryListEvent._internalWrap();
+  }
+
+  factory MediaQueryListEvent._internalWrap() {
+    return new MediaQueryListEvent.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  MediaQueryListEvent.internal_() : super.internal_();
+
+
   @DomName('MediaQueryListEvent.matches')
   @DocsEditable()
   @Experimental() // untriaged
@@ -22185,9 +25705,23 @@
   @DomName('MediaSource.MediaSource')
   @DocsEditable()
   factory MediaSource() {
-    return _blink.BlinkMediaSource.instance.constructorCallback_0_();
+    return wrap_jso(_blink.BlinkMediaSource.instance.constructorCallback_0_());
   }
 
+
+  @Deprecated("Internal Use Only")
+  static MediaSource internalCreateMediaSource() {
+    return new MediaSource._internalWrap();
+  }
+
+  factory MediaSource._internalWrap() {
+    return new MediaSource.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  MediaSource.internal_() : super.internal_();
+
+
   /// Checks if this type is supported on the current platform.
   static bool get supported => true;
 
@@ -22201,7 +25735,7 @@
   
   @DomName('MediaSource.duration')
   @DocsEditable()
-  void set duration(num value) => _blink.BlinkMediaSource.instance.duration_Setter_(unwrap_jso(this), value);
+  set duration(num value) => _blink.BlinkMediaSource.instance.duration_Setter_(unwrap_jso(this), value);
   
   @DomName('MediaSource.readyState')
   @DocsEditable()
@@ -22280,17 +25814,31 @@
   @DocsEditable()
   factory MediaStream([stream_OR_tracks]) {
     if (stream_OR_tracks == null) {
-      return _blink.BlinkMediaStream.instance.constructorCallback_0_();
+      return wrap_jso(_blink.BlinkMediaStream.instance.constructorCallback_0_());
     }
     if ((stream_OR_tracks is MediaStream || stream_OR_tracks == null)) {
-      return _blink.BlinkMediaStream.instance.constructorCallback_1_(stream_OR_tracks);
+      return wrap_jso(_blink.BlinkMediaStream.instance.constructorCallback_1_(stream_OR_tracks));
     }
     if ((stream_OR_tracks is List<MediaStreamTrack> || stream_OR_tracks == null)) {
-      return _blink.BlinkMediaStream.instance.constructorCallback_1_(stream_OR_tracks);
+      return wrap_jso(_blink.BlinkMediaStream.instance.constructorCallback_1_(stream_OR_tracks));
     }
     throw new ArgumentError("Incorrect number or type of arguments");
   }
 
+
+  @Deprecated("Internal Use Only")
+  static MediaStream internalCreateMediaStream() {
+    return new MediaStream._internalWrap();
+  }
+
+  factory MediaStream._internalWrap() {
+    return new MediaStream.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  MediaStream.internal_() : super.internal_();
+
+
   @DomName('MediaStream.ended')
   @DocsEditable()
   bool get ended => _blink.BlinkMediaStream.instance.ended_Getter_(unwrap_jso(this));
@@ -22315,7 +25863,7 @@
   
   @DomName('MediaStream.getAudioTracks')
   @DocsEditable()
-  List<MediaStreamTrack> getAudioTracks() => _blink.BlinkMediaStream.instance.getAudioTracks_Callback_0_(unwrap_jso(this));
+  List<MediaStreamTrack> getAudioTracks() => wrap_jso(_blink.BlinkMediaStream.instance.getAudioTracks_Callback_0_(unwrap_jso(this)));
   
   @DomName('MediaStream.getTrackById')
   @DocsEditable()
@@ -22324,11 +25872,11 @@
   @DomName('MediaStream.getTracks')
   @DocsEditable()
   @Experimental() // untriaged
-  List<MediaStreamTrack> getTracks() => _blink.BlinkMediaStream.instance.getTracks_Callback_0_(unwrap_jso(this));
+  List<MediaStreamTrack> getTracks() => wrap_jso(_blink.BlinkMediaStream.instance.getTracks_Callback_0_(unwrap_jso(this)));
   
   @DomName('MediaStream.getVideoTracks')
   @DocsEditable()
-  List<MediaStreamTrack> getVideoTracks() => _blink.BlinkMediaStream.instance.getVideoTracks_Callback_0_(unwrap_jso(this));
+  List<MediaStreamTrack> getVideoTracks() => wrap_jso(_blink.BlinkMediaStream.instance.getVideoTracks_Callback_0_(unwrap_jso(this)));
   
   @DomName('MediaStream.removeTrack')
   @DocsEditable()
@@ -22379,6 +25927,20 @@
   // To suppress missing implicit constructor warnings.
   factory MediaStreamEvent._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static MediaStreamEvent internalCreateMediaStreamEvent() {
+    return new MediaStreamEvent._internalWrap();
+  }
+
+  factory MediaStreamEvent._internalWrap() {
+    return new MediaStreamEvent.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  MediaStreamEvent.internal_() : super.internal_();
+
+
   /// Checks if this type is supported on the current platform.
   static bool get supported => true;
 
@@ -22433,13 +25995,27 @@
   @DocsEditable()
   static const EventStreamProvider<Event> unmuteEvent = const EventStreamProvider<Event>('unmute');
 
+
+  @Deprecated("Internal Use Only")
+  static MediaStreamTrack internalCreateMediaStreamTrack() {
+    return new MediaStreamTrack._internalWrap();
+  }
+
+  factory MediaStreamTrack._internalWrap() {
+    return new MediaStreamTrack.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  MediaStreamTrack.internal_() : super.internal_();
+
+
   @DomName('MediaStreamTrack.enabled')
   @DocsEditable()
   bool get enabled => _blink.BlinkMediaStreamTrack.instance.enabled_Getter_(unwrap_jso(this));
   
   @DomName('MediaStreamTrack.enabled')
   @DocsEditable()
-  void set enabled(bool value) => _blink.BlinkMediaStreamTrack.instance.enabled_Setter_(unwrap_jso(this), value);
+  set enabled(bool value) => _blink.BlinkMediaStreamTrack.instance.enabled_Setter_(unwrap_jso(this), value);
   
   @DomName('MediaStreamTrack.id')
   @DocsEditable()
@@ -22470,7 +26046,7 @@
   @DomName('MediaStreamTrack.getSources')
   @DocsEditable()
   @Experimental() // untriaged
-  static void _getSources(MediaStreamTrackSourcesCallback callback) => _blink.BlinkMediaStreamTrack.instance.getSources_Callback_1_(unwrap_jso(callback));
+  static void _getSources(MediaStreamTrackSourcesCallback callback) => _blink.BlinkMediaStreamTrack.instance.getSources_Callback_1_(unwrap_jso((sources) => callback(sources)));
   
   static Future<List<SourceInfo>> getSources() {
     var completer = new Completer<List<SourceInfo>>();
@@ -22516,6 +26092,20 @@
   // To suppress missing implicit constructor warnings.
   factory MediaStreamTrackEvent._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static MediaStreamTrackEvent internalCreateMediaStreamTrackEvent() {
+    return new MediaStreamTrackEvent._internalWrap();
+  }
+
+  factory MediaStreamTrackEvent._internalWrap() {
+    return new MediaStreamTrackEvent.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  MediaStreamTrackEvent.internal_() : super.internal_();
+
+
   /// Checks if this type is supported on the current platform.
   static bool get supported => true;
 
@@ -22544,10 +26134,25 @@
 @DocsEditable()
 @DomName('MemoryInfo')
 @Experimental() // nonstandard
-class MemoryInfo extends NativeFieldWrapperClass2 {
+class MemoryInfo extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory MemoryInfo._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static MemoryInfo internalCreateMemoryInfo() {
+    return new MemoryInfo._internalWrap();
+  }
+
+  factory MemoryInfo._internalWrap() {
+    return new MemoryInfo.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  MemoryInfo.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('MemoryInfo.jsHeapSizeLimit')
   @DocsEditable()
   int get jsHeapSizeLimit => _blink.BlinkMemoryInfo.instance.jsHeapSizeLimit_Getter_(unwrap_jso(this));
@@ -22587,6 +26192,20 @@
   @DomName('HTMLMenuElement.HTMLMenuElement')
   @DocsEditable()
   factory MenuElement() => document.createElement("menu");
+
+
+  @Deprecated("Internal Use Only")
+  static MenuElement internalCreateMenuElement() {
+    return new MenuElement._internalWrap();
+  }
+
+  factory MenuElement._internalWrap() {
+    return new MenuElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  MenuElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -22602,7 +26221,7 @@
   @DomName('HTMLMenuElement.label')
   @DocsEditable()
   @Experimental() // untriaged
-  void set label(String value) => _blink.BlinkHTMLMenuElement.instance.label_Setter_(unwrap_jso(this), value);
+  set label(String value) => _blink.BlinkHTMLMenuElement.instance.label_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLMenuElement.type')
   @DocsEditable()
@@ -22612,7 +26231,7 @@
   @DomName('HTMLMenuElement.type')
   @DocsEditable()
   @Experimental() // untriaged
-  void set type(String value) => _blink.BlinkHTMLMenuElement.instance.type_Setter_(unwrap_jso(this), value);
+  set type(String value) => _blink.BlinkHTMLMenuElement.instance.type_Setter_(unwrap_jso(this), value);
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -22628,6 +26247,20 @@
 class MenuItemElement extends HtmlElement {
   // To suppress missing implicit constructor warnings.
   factory MenuItemElement._() { throw new UnsupportedError("Not supported"); }
+
+
+  @Deprecated("Internal Use Only")
+  static MenuItemElement internalCreateMenuItemElement() {
+    return new MenuItemElement._internalWrap();
+  }
+
+  factory MenuItemElement._internalWrap() {
+    return new MenuItemElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  MenuItemElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -22643,7 +26276,7 @@
   @DomName('HTMLMenuItemElement.checked')
   @DocsEditable()
   @Experimental() // untriaged
-  void set checked(bool value) => _blink.BlinkHTMLMenuItemElement.instance.checked_Setter_(unwrap_jso(this), value);
+  set checked(bool value) => _blink.BlinkHTMLMenuItemElement.instance.checked_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLMenuItemElement.default')
   @DocsEditable()
@@ -22653,7 +26286,7 @@
   @DomName('HTMLMenuItemElement.default')
   @DocsEditable()
   @Experimental() // untriaged
-  void set defaultValue(bool value) => _blink.BlinkHTMLMenuItemElement.instance.default_Setter_(unwrap_jso(this), value);
+  set defaultValue(bool value) => _blink.BlinkHTMLMenuItemElement.instance.default_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLMenuItemElement.disabled')
   @DocsEditable()
@@ -22663,7 +26296,7 @@
   @DomName('HTMLMenuItemElement.disabled')
   @DocsEditable()
   @Experimental() // untriaged
-  void set disabled(bool value) => _blink.BlinkHTMLMenuItemElement.instance.disabled_Setter_(unwrap_jso(this), value);
+  set disabled(bool value) => _blink.BlinkHTMLMenuItemElement.instance.disabled_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLMenuItemElement.label')
   @DocsEditable()
@@ -22673,7 +26306,7 @@
   @DomName('HTMLMenuItemElement.label')
   @DocsEditable()
   @Experimental() // untriaged
-  void set label(String value) => _blink.BlinkHTMLMenuItemElement.instance.label_Setter_(unwrap_jso(this), value);
+  set label(String value) => _blink.BlinkHTMLMenuItemElement.instance.label_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLMenuItemElement.type')
   @DocsEditable()
@@ -22683,7 +26316,7 @@
   @DomName('HTMLMenuItemElement.type')
   @DocsEditable()
   @Experimental() // untriaged
-  void set type(String value) => _blink.BlinkHTMLMenuItemElement.instance.type_Setter_(unwrap_jso(this), value);
+  set type(String value) => _blink.BlinkHTMLMenuItemElement.instance.type_Setter_(unwrap_jso(this), value);
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -22696,10 +26329,25 @@
 @DocsEditable()
 @DomName('MessageChannel')
 @Unstable()
-class MessageChannel extends NativeFieldWrapperClass2 {
+class MessageChannel extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory MessageChannel._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static MessageChannel internalCreateMessageChannel() {
+    return new MessageChannel._internalWrap();
+  }
+
+  factory MessageChannel._internalWrap() {
+    return new MessageChannel.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  MessageChannel.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('MessageChannel.port1')
   @DocsEditable()
   MessagePort get port1 => wrap_jso(_blink.BlinkMessageChannel.instance.port1_Getter_(unwrap_jso(this)));
@@ -22733,9 +26381,23 @@
   // To suppress missing implicit constructor warnings.
   factory MessageEvent._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static MessageEvent internalCreateMessageEvent() {
+    return new MessageEvent._internalWrap();
+  }
+
+  factory MessageEvent._internalWrap() {
+    return new MessageEvent.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  MessageEvent.internal_() : super.internal_();
+
+
   @DomName('MessageEvent.data')
   @DocsEditable()
-  Object get data => _blink.BlinkMessageEvent.instance.data_Getter_(unwrap_jso(this));
+  Object get data => wrap_jso(_blink.BlinkMessageEvent.instance.data_Getter_(unwrap_jso(this)));
   
   @DomName('MessageEvent.lastEventId')
   @DocsEditable()
@@ -22752,7 +26414,7 @@
   
   @DomName('MessageEvent.initMessageEvent')
   @DocsEditable()
-  void _initMessageEvent(String typeArg, bool canBubbleArg, bool cancelableArg, Object dataArg, String originArg, String lastEventIdArg, Window sourceArg, List<MessagePort> messagePorts) => _blink.BlinkMessageEvent.instance.initMessageEvent_Callback_8_(unwrap_jso(this), typeArg, canBubbleArg, cancelableArg, dataArg, originArg, lastEventIdArg, unwrap_jso(sourceArg), messagePorts);
+  void _initMessageEvent(String typeArg, bool canBubbleArg, bool cancelableArg, Object dataArg, String originArg, String lastEventIdArg, Window sourceArg, List<MessagePort> messagePorts) => _blink.BlinkMessageEvent.instance.initMessageEvent_Callback_8_(unwrap_jso(this), typeArg, canBubbleArg, cancelableArg, dataArg, originArg, lastEventIdArg, unwrap_jso(sourceArg), unwrap_jso(messagePorts));
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -22779,13 +26441,27 @@
   @DocsEditable()
   static const EventStreamProvider<MessageEvent> messageEvent = const EventStreamProvider<MessageEvent>('message');
 
+
+  @Deprecated("Internal Use Only")
+  static MessagePort internalCreateMessagePort() {
+    return new MessagePort._internalWrap();
+  }
+
+  factory MessagePort._internalWrap() {
+    return new MessagePort.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  MessagePort.internal_() : super.internal_();
+
+
   @DomName('MessagePort.close')
   @DocsEditable()
   void close() => _blink.BlinkMessagePort.instance.close_Callback_0_(unwrap_jso(this));
   
   @DomName('MessagePort.postMessage')
   @DocsEditable()
-  void postMessage(Object message, [List<MessagePort> transfer]) => _blink.BlinkMessagePort.instance.postMessage_Callback_2_(unwrap_jso(this), message, transfer);
+  void postMessage(Object message, [List<MessagePort> transfer]) => _blink.BlinkMessagePort.instance.postMessage_Callback_2_(unwrap_jso(this), convertDartToNative_SerializedScriptValue(message), transfer);
   
   @DomName('MessagePort.start')
   @DocsEditable()
@@ -22813,6 +26489,20 @@
   @DomName('HTMLMetaElement.HTMLMetaElement')
   @DocsEditable()
   factory MetaElement() => document.createElement("meta");
+
+
+  @Deprecated("Internal Use Only")
+  static MetaElement internalCreateMetaElement() {
+    return new MetaElement._internalWrap();
+  }
+
+  factory MetaElement._internalWrap() {
+    return new MetaElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  MetaElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -22826,7 +26516,7 @@
   
   @DomName('HTMLMetaElement.content')
   @DocsEditable()
-  void set content(String value) => _blink.BlinkHTMLMetaElement.instance.content_Setter_(unwrap_jso(this), value);
+  set content(String value) => _blink.BlinkHTMLMetaElement.instance.content_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLMetaElement.httpEquiv')
   @DocsEditable()
@@ -22834,7 +26524,7 @@
   
   @DomName('HTMLMetaElement.httpEquiv')
   @DocsEditable()
-  void set httpEquiv(String value) => _blink.BlinkHTMLMetaElement.instance.httpEquiv_Setter_(unwrap_jso(this), value);
+  set httpEquiv(String value) => _blink.BlinkHTMLMetaElement.instance.httpEquiv_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLMetaElement.name')
   @DocsEditable()
@@ -22842,7 +26532,7 @@
   
   @DomName('HTMLMetaElement.name')
   @DocsEditable()
-  void set name(String value) => _blink.BlinkHTMLMetaElement.instance.name_Setter_(unwrap_jso(this), value);
+  set name(String value) => _blink.BlinkHTMLMetaElement.instance.name_Setter_(unwrap_jso(this), value);
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -22856,10 +26546,25 @@
 @DomName('Metadata')
 // http://www.w3.org/TR/file-system-api/#the-metadata-interface
 @Experimental()
-class Metadata extends NativeFieldWrapperClass2 {
+class Metadata extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory Metadata._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static Metadata internalCreateMetadata() {
+    return new Metadata._internalWrap();
+  }
+
+  factory Metadata._internalWrap() {
+    return new Metadata.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  Metadata.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('Metadata.modificationTime')
   @DocsEditable()
   DateTime get modificationTime => _blink.BlinkMetadata.instance.modificationTime_Getter_(unwrap_jso(this));
@@ -22900,6 +26605,20 @@
   @DomName('HTMLMeterElement.HTMLMeterElement')
   @DocsEditable()
   factory MeterElement() => document.createElement("meter");
+
+
+  @Deprecated("Internal Use Only")
+  static MeterElement internalCreateMeterElement() {
+    return new MeterElement._internalWrap();
+  }
+
+  factory MeterElement._internalWrap() {
+    return new MeterElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  MeterElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -22916,12 +26635,12 @@
   
   @DomName('HTMLMeterElement.high')
   @DocsEditable()
-  void set high(num value) => _blink.BlinkHTMLMeterElement.instance.high_Setter_(unwrap_jso(this), value);
+  set high(num value) => _blink.BlinkHTMLMeterElement.instance.high_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLMeterElement.labels')
   @DocsEditable()
   @Unstable()
-  List<Node> get labels => wrap_jso_list(_blink.BlinkHTMLMeterElement.instance.labels_Getter_(unwrap_jso(this)));
+  List<Node> get labels => wrap_jso(_blink.BlinkHTMLMeterElement.instance.labels_Getter_(unwrap_jso(this)));
   
   @DomName('HTMLMeterElement.low')
   @DocsEditable()
@@ -22929,7 +26648,7 @@
   
   @DomName('HTMLMeterElement.low')
   @DocsEditable()
-  void set low(num value) => _blink.BlinkHTMLMeterElement.instance.low_Setter_(unwrap_jso(this), value);
+  set low(num value) => _blink.BlinkHTMLMeterElement.instance.low_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLMeterElement.max')
   @DocsEditable()
@@ -22937,7 +26656,7 @@
   
   @DomName('HTMLMeterElement.max')
   @DocsEditable()
-  void set max(num value) => _blink.BlinkHTMLMeterElement.instance.max_Setter_(unwrap_jso(this), value);
+  set max(num value) => _blink.BlinkHTMLMeterElement.instance.max_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLMeterElement.min')
   @DocsEditable()
@@ -22945,7 +26664,7 @@
   
   @DomName('HTMLMeterElement.min')
   @DocsEditable()
-  void set min(num value) => _blink.BlinkHTMLMeterElement.instance.min_Setter_(unwrap_jso(this), value);
+  set min(num value) => _blink.BlinkHTMLMeterElement.instance.min_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLMeterElement.optimum')
   @DocsEditable()
@@ -22953,7 +26672,7 @@
   
   @DomName('HTMLMeterElement.optimum')
   @DocsEditable()
-  void set optimum(num value) => _blink.BlinkHTMLMeterElement.instance.optimum_Setter_(unwrap_jso(this), value);
+  set optimum(num value) => _blink.BlinkHTMLMeterElement.instance.optimum_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLMeterElement.value')
   @DocsEditable()
@@ -22961,7 +26680,7 @@
   
   @DomName('HTMLMeterElement.value')
   @DocsEditable()
-  void set value(num value) => _blink.BlinkHTMLMeterElement.instance.value_Setter_(unwrap_jso(this), value);
+  set value(num value) => _blink.BlinkHTMLMeterElement.instance.value_Setter_(unwrap_jso(this), value);
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -22999,6 +26718,20 @@
   @DocsEditable()
   static const EventStreamProvider<MidiConnectionEvent> disconnectEvent = const EventStreamProvider<MidiConnectionEvent>('disconnect');
 
+
+  @Deprecated("Internal Use Only")
+  static MidiAccess internalCreateMidiAccess() {
+    return new MidiAccess._internalWrap();
+  }
+
+  factory MidiAccess._internalWrap() {
+    return new MidiAccess.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  MidiAccess.internal_() : super.internal_();
+
+
   @DomName('MIDIAccess.inputs')
   @DocsEditable()
   MidiInputMap get inputs => wrap_jso(_blink.BlinkMIDIAccess.instance.inputs_Getter_(unwrap_jso(this)));
@@ -23038,6 +26771,20 @@
   // To suppress missing implicit constructor warnings.
   factory MidiConnectionEvent._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static MidiConnectionEvent internalCreateMidiConnectionEvent() {
+    return new MidiConnectionEvent._internalWrap();
+  }
+
+  factory MidiConnectionEvent._internalWrap() {
+    return new MidiConnectionEvent.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  MidiConnectionEvent.internal_() : super.internal_();
+
+
   @DomName('MIDIConnectionEvent.port')
   @DocsEditable()
   MidiPort get port => wrap_jso(_blink.BlinkMIDIConnectionEvent.instance.port_Getter_(unwrap_jso(this)));
@@ -23068,6 +26815,20 @@
   @DocsEditable()
   static const EventStreamProvider<MidiMessageEvent> midiMessageEvent = const EventStreamProvider<MidiMessageEvent>('midimessage');
 
+
+  @Deprecated("Internal Use Only")
+  static MidiInput internalCreateMidiInput() {
+    return new MidiInput._internalWrap();
+  }
+
+  factory MidiInput._internalWrap() {
+    return new MidiInput.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  MidiInput.internal_() : super.internal_();
+
+
   /// Stream of `midimessage` events handled by this [MidiInput].
   @DomName('MIDIInput.onmidimessage')
   @DocsEditable()
@@ -23084,10 +26845,25 @@
 @DocsEditable()
 @DomName('MIDIInputMap')
 @Experimental() // untriaged
-class MidiInputMap extends NativeFieldWrapperClass2 {
+class MidiInputMap extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory MidiInputMap._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static MidiInputMap internalCreateMidiInputMap() {
+    return new MidiInputMap._internalWrap();
+  }
+
+  factory MidiInputMap._internalWrap() {
+    return new MidiInputMap.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  MidiInputMap.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('MIDIInputMap.size')
   @DocsEditable()
   @Experimental() // untriaged
@@ -23096,7 +26872,7 @@
   @DomName('MIDIInputMap.entries')
   @DocsEditable()
   @Experimental() // untriaged
-  DomIterator entries() => _blink.BlinkMIDIInputMap.instance.entries_Callback_0_(unwrap_jso(this));
+  DomIterator entries() => wrap_jso(_blink.BlinkMIDIInputMap.instance.entries_Callback_0_(unwrap_jso(this)));
   
   @DomName('MIDIInputMap.get')
   @DocsEditable()
@@ -23111,12 +26887,12 @@
   @DomName('MIDIInputMap.keys')
   @DocsEditable()
   @Experimental() // untriaged
-  DomIterator keys() => _blink.BlinkMIDIInputMap.instance.keys_Callback_0_(unwrap_jso(this));
+  DomIterator keys() => wrap_jso(_blink.BlinkMIDIInputMap.instance.keys_Callback_0_(unwrap_jso(this)));
   
   @DomName('MIDIInputMap.values')
   @DocsEditable()
   @Experimental() // untriaged
-  DomIterator values() => _blink.BlinkMIDIInputMap.instance.values_Callback_0_(unwrap_jso(this));
+  DomIterator values() => wrap_jso(_blink.BlinkMIDIInputMap.instance.values_Callback_0_(unwrap_jso(this)));
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -23134,13 +26910,27 @@
   // To suppress missing implicit constructor warnings.
   factory MidiMessageEvent._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static MidiMessageEvent internalCreateMidiMessageEvent() {
+    return new MidiMessageEvent._internalWrap();
+  }
+
+  factory MidiMessageEvent._internalWrap() {
+    return new MidiMessageEvent.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  MidiMessageEvent.internal_() : super.internal_();
+
+
   @DomName('MIDIMessageEvent.data')
   @DocsEditable()
-  Uint8List get data => wrap_jso(_blink.BlinkMIDIMessageEvent.instance.data_Getter_(unwrap_jso(this)));
+  Uint8List get data => _blink.BlinkMIDIMessageEvent.instance.data_Getter_(unwrap_jso(this));
   
   @DomName('MIDIMessageEvent.receivedTime')
   @DocsEditable()
-  double get receivedTime => _blink.BlinkMIDIMessageEvent.instance.receivedTime_Getter_(unwrap_jso(this));
+  num get receivedTime => _blink.BlinkMIDIMessageEvent.instance.receivedTime_Getter_(unwrap_jso(this));
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -23158,6 +26948,20 @@
   // To suppress missing implicit constructor warnings.
   factory MidiOutput._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static MidiOutput internalCreateMidiOutput() {
+    return new MidiOutput._internalWrap();
+  }
+
+  factory MidiOutput._internalWrap() {
+    return new MidiOutput.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  MidiOutput.internal_() : super.internal_();
+
+
   void send(Uint8List data, [num timestamp]) {
     if (timestamp != null) {
       _blink.BlinkMIDIOutput.instance.send_Callback_2_(unwrap_jso(this), data, timestamp);
@@ -23178,10 +26982,25 @@
 @DocsEditable()
 @DomName('MIDIOutputMap')
 @Experimental() // untriaged
-class MidiOutputMap extends NativeFieldWrapperClass2 {
+class MidiOutputMap extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory MidiOutputMap._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static MidiOutputMap internalCreateMidiOutputMap() {
+    return new MidiOutputMap._internalWrap();
+  }
+
+  factory MidiOutputMap._internalWrap() {
+    return new MidiOutputMap.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  MidiOutputMap.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('MIDIOutputMap.size')
   @DocsEditable()
   @Experimental() // untriaged
@@ -23190,7 +27009,7 @@
   @DomName('MIDIOutputMap.entries')
   @DocsEditable()
   @Experimental() // untriaged
-  DomIterator entries() => _blink.BlinkMIDIOutputMap.instance.entries_Callback_0_(unwrap_jso(this));
+  DomIterator entries() => wrap_jso(_blink.BlinkMIDIOutputMap.instance.entries_Callback_0_(unwrap_jso(this)));
   
   @DomName('MIDIOutputMap.get')
   @DocsEditable()
@@ -23205,12 +27024,12 @@
   @DomName('MIDIOutputMap.keys')
   @DocsEditable()
   @Experimental() // untriaged
-  DomIterator keys() => _blink.BlinkMIDIOutputMap.instance.keys_Callback_0_(unwrap_jso(this));
+  DomIterator keys() => wrap_jso(_blink.BlinkMIDIOutputMap.instance.keys_Callback_0_(unwrap_jso(this)));
   
   @DomName('MIDIOutputMap.values')
   @DocsEditable()
   @Experimental() // untriaged
-  DomIterator values() => _blink.BlinkMIDIOutputMap.instance.values_Callback_0_(unwrap_jso(this));
+  DomIterator values() => wrap_jso(_blink.BlinkMIDIOutputMap.instance.values_Callback_0_(unwrap_jso(this)));
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -23238,6 +27057,20 @@
   @DocsEditable()
   static const EventStreamProvider<MidiConnectionEvent> disconnectEvent = const EventStreamProvider<MidiConnectionEvent>('disconnect');
 
+
+  @Deprecated("Internal Use Only")
+  static MidiPort internalCreateMidiPort() {
+    return new MidiPort._internalWrap();
+  }
+
+  factory MidiPort._internalWrap() {
+    return new MidiPort.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  MidiPort.internal_() : super.internal_();
+
+
   @DomName('MIDIPort.id')
   @DocsEditable()
   String get id => _blink.BlinkMIDIPort.instance.id_Getter_(unwrap_jso(this));
@@ -23274,10 +27107,25 @@
 @DocsEditable()
 @DomName('MimeType')
 @Experimental() // non-standard
-class MimeType extends NativeFieldWrapperClass2 {
+class MimeType extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory MimeType._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static MimeType internalCreateMimeType() {
+    return new MimeType._internalWrap();
+  }
+
+  factory MimeType._internalWrap() {
+    return new MimeType.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  MimeType.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('MimeType.description')
   @DocsEditable()
   String get description => _blink.BlinkMimeType.instance.description_Getter_(unwrap_jso(this));
@@ -23305,10 +27153,25 @@
 @DocsEditable()
 @DomName('MimeTypeArray')
 @Experimental() // non-standard
-class MimeTypeArray extends NativeFieldWrapperClass2 with ListMixin<MimeType>, ImmutableListMixin<MimeType> implements List<MimeType> {
+class MimeTypeArray extends DartHtmlDomObject with ListMixin<MimeType>, ImmutableListMixin<MimeType> implements List<MimeType> {
   // To suppress missing implicit constructor warnings.
   factory MimeTypeArray._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static MimeTypeArray internalCreateMimeTypeArray() {
+    return new MimeTypeArray._internalWrap();
+  }
+
+  factory MimeTypeArray._internalWrap() {
+    return new MimeTypeArray.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  MimeTypeArray.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('MimeTypeArray.length')
   @DocsEditable()
   int get length => _blink.BlinkMimeTypeArray.instance.length_Getter_(unwrap_jso(this));
@@ -23320,7 +27183,7 @@
   }
 
   MimeType _nativeIndexedGetter(int index) => wrap_jso(_blink.BlinkMimeTypeArray.instance.item_Callback_1_(unwrap_jso(this), index));
- 
+
   void operator[]=(int index, MimeType value) {
     throw new UnsupportedError("Cannot assign element of immutable List.");
   }
@@ -23328,7 +27191,7 @@
   // MimeType is the element type.
 
 
-  void set length(int value) {
+  set length(int value) {
     throw new UnsupportedError("Cannot resize immutable List.");
   }
 
@@ -23385,6 +27248,20 @@
 class ModElement extends HtmlElement {
   // To suppress missing implicit constructor warnings.
   factory ModElement._() { throw new UnsupportedError("Not supported"); }
+
+
+  @Deprecated("Internal Use Only")
+  static ModElement internalCreateModElement() {
+    return new ModElement._internalWrap();
+  }
+
+  factory ModElement._internalWrap() {
+    return new ModElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  ModElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -23398,7 +27275,7 @@
   
   @DomName('HTMLModElement.cite')
   @DocsEditable()
-  void set cite(String value) => _blink.BlinkHTMLModElement.instance.cite_Setter_(unwrap_jso(this), value);
+  set cite(String value) => _blink.BlinkHTMLModElement.instance.cite_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLModElement.dateTime')
   @DocsEditable()
@@ -23406,7 +27283,7 @@
   
   @DomName('HTMLModElement.dateTime')
   @DocsEditable()
-  void set dateTime(String value) => _blink.BlinkHTMLModElement.instance.dateTime_Setter_(unwrap_jso(this), value);
+  set dateTime(String value) => _blink.BlinkHTMLModElement.instance.dateTime_Setter_(unwrap_jso(this), value);
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -23436,6 +27313,20 @@
   // To suppress missing implicit constructor warnings.
   factory MouseEvent._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static MouseEvent internalCreateMouseEvent() {
+    return new MouseEvent._internalWrap();
+  }
+
+  factory MouseEvent._internalWrap() {
+    return new MouseEvent.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  MouseEvent.internal_() : super.internal_();
+
+
   @DomName('MouseEvent.altKey')
   @DocsEditable()
   bool get altKey => _blink.BlinkMouseEvent.instance.altKey_Getter_(unwrap_jso(this));
@@ -23609,23 +27500,38 @@
 @SupportedBrowser(SupportedBrowser.FIREFOX)
 @SupportedBrowser(SupportedBrowser.SAFARI)
 @Experimental()
-class MutationObserver extends NativeFieldWrapperClass2 {
+class MutationObserver extends DartHtmlDomObject {
 
   @DomName('MutationObserver.MutationObserver')
   @DocsEditable()
   factory MutationObserver._(MutationCallback callback) => wrap_jso(_create(callback));
 
+  @Deprecated("Internal Use Only")
+  static MutationObserver internalCreateMutationObserver() {
+    return new MutationObserver._internalWrap();
+  }
+
+  factory MutationObserver._internalWrap() {
+    return new MutationObserver.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  MutationObserver.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('MutationObserver.disconnect')
   @DocsEditable()
   void disconnect() => _blink.BlinkMutationObserver.instance.disconnect_Callback_0_(unwrap_jso(this));
   
   @DomName('MutationObserver.observe')
   @DocsEditable()
-  void _observe(Node target, Map options) => _blink.BlinkMutationObserver.instance.observe_Callback_2_(unwrap_jso(this), unwrap_jso(target), options);
+  void _observe(Node target, Map options) => _blink.BlinkMutationObserver.instance.observe_Callback_2_(unwrap_jso(this), unwrap_jso(target), convertDartToNative_Dictionary(options));
   
   @DomName('MutationObserver.takeRecords')
   @DocsEditable()
-  List<MutationRecord> takeRecords() => _blink.BlinkMutationObserver.instance.takeRecords_Callback_0_(unwrap_jso(this));
+  List<MutationRecord> takeRecords() => wrap_jso(_blink.BlinkMutationObserver.instance.takeRecords_Callback_0_(unwrap_jso(this)));
   
   /**
    * Checks to see if the mutation observer API is supported on the current
@@ -23635,7 +27541,9 @@
     return true;
   }
   @DocsEditable()
-  static MutationObserver _create(callback) => _blink.BlinkMutationObserver.instance.constructorCallback_1_(callback);
+  static MutationObserver _create(callback) => wrap_jso(_blink.BlinkMutationObserver.instance.constructorCallback_1_((mutations, observer) {
+    callback(wrap_jso(mutations), wrap_jso(observer));
+  }));
 
   /**
    * Observes the target for the specified changes.
@@ -23706,13 +27614,28 @@
 
 @DocsEditable()
 @DomName('MutationRecord')
-class MutationRecord extends NativeFieldWrapperClass2 {
+class MutationRecord extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory MutationRecord._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static MutationRecord internalCreateMutationRecord() {
+    return new MutationRecord._internalWrap();
+  }
+
+  factory MutationRecord._internalWrap() {
+    return new MutationRecord.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  MutationRecord.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('MutationRecord.addedNodes')
   @DocsEditable()
-  List<Node> get addedNodes => wrap_jso_list(_blink.BlinkMutationRecord.instance.addedNodes_Getter_(unwrap_jso(this)));
+  List<Node> get addedNodes => wrap_jso(_blink.BlinkMutationRecord.instance.addedNodes_Getter_(unwrap_jso(this)));
   
   @DomName('MutationRecord.attributeName')
   @DocsEditable()
@@ -23736,7 +27659,7 @@
   
   @DomName('MutationRecord.removedNodes')
   @DocsEditable()
-  List<Node> get removedNodes => wrap_jso_list(_blink.BlinkMutationRecord.instance.removedNodes_Getter_(unwrap_jso(this)));
+  List<Node> get removedNodes => wrap_jso(_blink.BlinkMutationRecord.instance.removedNodes_Getter_(unwrap_jso(this)));
   
   @DomName('MutationRecord.target')
   @DocsEditable()
@@ -23753,7 +27676,7 @@
 
 
 @DomName('Navigator')
-class Navigator extends NativeFieldWrapperClass2 implements NavigatorCpu, NavigatorLanguage, NavigatorOnLine, NavigatorID {
+class Navigator extends DartHtmlDomObject implements NavigatorCpu, NavigatorLanguage, NavigatorOnLine, NavigatorID {
 
 
   /**
@@ -23814,6 +27737,21 @@
   // To suppress missing implicit constructor warnings.
   factory Navigator._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static Navigator internalCreateNavigator() {
+    return new Navigator._internalWrap();
+  }
+
+  factory Navigator._internalWrap() {
+    return new Navigator.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  Navigator.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('Navigator.connection')
   @DocsEditable()
   @Experimental() // untriaged
@@ -23909,12 +27847,12 @@
   @DomName('Navigator.getBattery')
   @DocsEditable()
   @Experimental() // untriaged
-  Future getBattery() => _blink.BlinkNavigator.instance.getBattery_Callback_0_(unwrap_jso(this));
+  Future getBattery() => wrap_jso(_blink.BlinkNavigator.instance.getBattery_Callback_0_(unwrap_jso(this)));
   
   @DomName('Navigator.getGamepads')
   @DocsEditable()
   @Experimental() // untriaged
-  List<Gamepad> getGamepads() => _blink.BlinkNavigator.instance.getGamepads_Callback_0_(unwrap_jso(this));
+  List<Gamepad> getGamepads() => wrap_jso(_blink.BlinkNavigator.instance.getGamepads_Callback_0_(unwrap_jso(this)));
   
   @DomName('Navigator.getStorageUpdates')
   @DocsEditable()
@@ -23922,11 +27860,6 @@
   @Experimental()
   void getStorageUpdates() => _blink.BlinkNavigator.instance.getStorageUpdates_Callback_0_(unwrap_jso(this));
   
-  @DomName('Navigator.isProtocolHandlerRegistered')
-  @DocsEditable()
-  @Experimental() // untriaged
-  String isProtocolHandlerRegistered(String scheme, String url) => _blink.BlinkNavigator.instance.isProtocolHandlerRegistered_Callback_2_(unwrap_jso(this), scheme, url);
-  
   @DomName('Navigator.registerProtocolHandler')
   @DocsEditable()
   @Unstable()
@@ -23948,16 +27881,11 @@
     throw new ArgumentError("Incorrect number or type of arguments");
   }
 
-  @DomName('Navigator.unregisterProtocolHandler')
-  @DocsEditable()
-  @Experimental() // untriaged
-  void unregisterProtocolHandler(String scheme, String url) => _blink.BlinkNavigator.instance.unregisterProtocolHandler_Callback_2_(unwrap_jso(this), scheme, url);
-  
   @DomName('Navigator.webkitGetUserMedia')
   @DocsEditable()
   // http://dev.w3.org/2011/webrtc/editor/getusermedia.html#navigatorusermedia
   @Experimental()
-  void _getUserMedia(Map options, _NavigatorUserMediaSuccessCallback successCallback, _NavigatorUserMediaErrorCallback errorCallback) => _blink.BlinkNavigator.instance.webkitGetUserMedia_Callback_3_(unwrap_jso(this), options, unwrap_jso(successCallback), unwrap_jso(errorCallback));
+  void _getUserMedia(Map options, _NavigatorUserMediaSuccessCallback successCallback, _NavigatorUserMediaErrorCallback errorCallback) => _blink.BlinkNavigator.instance.webkitGetUserMedia_Callback_3_(unwrap_jso(this), convertDartToNative_Dictionary(options), unwrap_jso((stream) => successCallback(wrap_jso(stream))), unwrap_jso((error) => errorCallback(wrap_jso(error))));
   
   @DomName('Navigator.hardwareConcurrency')
   @DocsEditable()
@@ -24020,7 +27948,7 @@
 @DocsEditable()
 @DomName('NavigatorCPU')
 @Experimental() // untriaged
-abstract class NavigatorCpu extends NativeFieldWrapperClass2 {
+abstract class NavigatorCpu extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory NavigatorCpu._() { throw new UnsupportedError("Not supported"); }
 
@@ -24040,7 +27968,7 @@
 @DocsEditable()
 @DomName('NavigatorID')
 @Experimental() // untriaged
-abstract class NavigatorID extends NativeFieldWrapperClass2 {
+abstract class NavigatorID extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory NavigatorID._() { throw new UnsupportedError("Not supported"); }
 
@@ -24090,7 +28018,7 @@
 @DocsEditable()
 @DomName('NavigatorLanguage')
 @Experimental() // untriaged
-abstract class NavigatorLanguage extends NativeFieldWrapperClass2 {
+abstract class NavigatorLanguage extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory NavigatorLanguage._() { throw new UnsupportedError("Not supported"); }
 
@@ -24115,7 +28043,7 @@
 @DocsEditable()
 @DomName('NavigatorOnLine')
 @Experimental() // untriaged
-abstract class NavigatorOnLine extends NativeFieldWrapperClass2 {
+abstract class NavigatorOnLine extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory NavigatorOnLine._() { throw new UnsupportedError("Not supported"); }
 
@@ -24136,10 +28064,25 @@
 @DomName('NavigatorUserMediaError')
 // http://dev.w3.org/2011/webrtc/editor/getusermedia.html#idl-def-NavigatorUserMediaError
 @Experimental()
-class NavigatorUserMediaError extends NativeFieldWrapperClass2 {
+class NavigatorUserMediaError extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory NavigatorUserMediaError._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static NavigatorUserMediaError internalCreateNavigatorUserMediaError() {
+    return new NavigatorUserMediaError._internalWrap();
+  }
+
+  factory NavigatorUserMediaError._internalWrap() {
+    return new NavigatorUserMediaError.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  NavigatorUserMediaError.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('NavigatorUserMediaError.constraintName')
   @DocsEditable()
   String get constraintName => _blink.BlinkNavigatorUserMediaError.instance.constraintName_Getter_(unwrap_jso(this));
@@ -24189,6 +28132,20 @@
   // To suppress missing implicit constructor warnings.
   factory NetworkInformation._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static NetworkInformation internalCreateNetworkInformation() {
+    return new NetworkInformation._internalWrap();
+  }
+
+  factory NetworkInformation._internalWrap() {
+    return new NetworkInformation.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  NetworkInformation.internal_() : super.internal_();
+
+
   @DomName('NetworkInformation.type')
   @DocsEditable()
   @Experimental() // untriaged
@@ -24291,7 +28248,8 @@
   bool remove(Object object) {
     if (object is! Node) return false;
     Node node = object;
-    if (!identical(_this, node.parentNode)) return false;
+    // We aren't preserving identity of nodes in JSINTEROP mode
+    if (_this != node.parentNode) return false;
     _this._removeChild(node);
     return true;
   }
@@ -24355,7 +28313,7 @@
   // a local copy of childNodes is more efficient.
   int get length => _this.childNodes.length;
 
-  void set length(int value) {
+  set length(int value) {
     throw new UnsupportedError(
         "Cannot set length on immutable List.");
   }
@@ -24370,7 +28328,14 @@
 class Node extends EventTarget {
 
   // Custom element created callback.
-  Node._created() : super._created();
+  Node._created() : super._created() {
+    // By this point blink_jsObject should be setup if it's not then we weren't
+    // called by the registerElement createdCallback - probably created() was
+    // called directly which is verboten.
+    if (this.blink_jsObject == null) {
+      throw new DomException.jsInterop("the created constructor cannot be called directly");
+    }
+  }
 
   /**
    * A modifiable list of this node's children.
@@ -24379,7 +28344,7 @@
     return new _ChildNodeListLazy(this);
   }
 
-  void set nodes(Iterable<Node> value) {
+  set nodes(Iterable<Node> value) {
     // Copy list first since we don't want liveness during iteration.
     // TODO(jacobr): there is a better way to do this.
     List copy = new List.from(value);
@@ -24466,12 +28431,24 @@
    */
   @DomName('Node.childNodes')
   @DocsEditable()
-  @Returns('NodeList')
-  @Creates('NodeList')
-  List<Node> get childNodes => _blink.BlinkNode.instance.childNodes_Getter_(this);
+  List<Node> get childNodes => wrap_jso(_blink.BlinkNode.instance.childNodes_Getter_(unwrap_jso(this)));
   // To suppress missing implicit constructor warnings.
   factory Node._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static Node internalCreateNode() {
+    return new Node._internalWrap();
+  }
+
+  factory Node._internalWrap() {
+    return new Node.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  Node.internal_() : super.internal_();
+
+
   @DomName('Node.ATTRIBUTE_NODE')
   @DocsEditable()
   static const int ATTRIBUTE_NODE = 2;
@@ -24711,7 +28688,7 @@
    */
   @DomName('Node.textContent')
   @DocsEditable()
-  void set text(String value) => _blink.BlinkNode.instance.textContent_Setter_(unwrap_jso(this), value);
+  set text(String value) => _blink.BlinkNode.instance.textContent_Setter_(unwrap_jso(this), value);
   
   /**
    * Adds a node to the end of the child [nodes] list of this node.
@@ -24799,10 +28776,25 @@
 @DocsEditable()
 @DomName('NodeFilter')
 @Unstable()
-class NodeFilter extends NativeFieldWrapperClass2 {
+class NodeFilter extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory NodeFilter._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static NodeFilter internalCreateNodeFilter() {
+    return new NodeFilter._internalWrap();
+  }
+
+  factory NodeFilter._internalWrap() {
+    return new NodeFilter.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  NodeFilter.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('NodeFilter.FILTER_ACCEPT')
   @DocsEditable()
   static const int FILTER_ACCEPT = 1;
@@ -24855,13 +28847,28 @@
 
 @DomName('NodeIterator')
 @Unstable()
-class NodeIterator extends NativeFieldWrapperClass2 {
+class NodeIterator extends DartHtmlDomObject {
   factory NodeIterator(Node root, int whatToShow) {
     return document._createNodeIterator(root, whatToShow, null);
   }
   // To suppress missing implicit constructor warnings.
   factory NodeIterator._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static NodeIterator internalCreateNodeIterator() {
+    return new NodeIterator._internalWrap();
+  }
+
+  factory NodeIterator._internalWrap() {
+    return new NodeIterator.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  NodeIterator.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('NodeIterator.pointerBeforeReferenceNode')
   @DocsEditable()
   bool get pointerBeforeReferenceNode => _blink.BlinkNodeIterator.instance.pointerBeforeReferenceNode_Getter_(unwrap_jso(this));
@@ -24900,10 +28907,25 @@
 
 @DocsEditable()
 @DomName('NodeList')
-class NodeList extends NativeFieldWrapperClass2 with ListMixin<Node>, ImmutableListMixin<Node> implements List<Node> {
+class NodeList extends DartHtmlDomObject with ListMixin<Node>, ImmutableListMixin<Node> implements List<Node> {
   // To suppress missing implicit constructor warnings.
   factory NodeList._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static NodeList internalCreateNodeList() {
+    return new NodeList._internalWrap();
+  }
+
+  factory NodeList._internalWrap() {
+    return new NodeList.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  NodeList.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('NodeList.length')
   @DocsEditable()
   int get length => _blink.BlinkNodeList.instance.length_Getter_(unwrap_jso(this));
@@ -24915,7 +28937,7 @@
   }
 
   Node _nativeIndexedGetter(int index) => wrap_jso(_blink.BlinkNodeList.instance.item_Callback_1_(unwrap_jso(this), index));
- 
+
   void operator[]=(int index, Node value) {
     throw new UnsupportedError("Cannot assign element of immutable List.");
   }
@@ -24923,7 +28945,7 @@
   // Node is the element type.
 
 
-  void set length(int value) {
+  set length(int value) {
     throw new UnsupportedError("Cannot resize immutable List.");
   }
 
@@ -25027,11 +29049,26 @@
   @DocsEditable()
   static Notification _factoryNotification(String title, [Map options]) {
     if (options != null) {
-      return _blink.BlinkNotification.instance.constructorCallback_2_(title, options);
+      var options_1 = convertDartToNative_Dictionary(options);
+      return wrap_jso(_blink.BlinkNotification.instance.constructorCallback_2_(title, options_1));
     }
-    return _blink.BlinkNotification.instance.constructorCallback_1_(title);
+    return wrap_jso(_blink.BlinkNotification.instance.constructorCallback_1_(title));
   }
 
+
+  @Deprecated("Internal Use Only")
+  static Notification internalCreateNotification() {
+    return new Notification._internalWrap();
+  }
+
+  factory Notification._internalWrap() {
+    return new Notification.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  Notification.internal_() : super.internal_();
+
+
   /// Checks if this type is supported on the current platform.
   static bool get supported => true;
 
@@ -25075,7 +29112,7 @@
   
   static void _requestPermission([_NotificationPermissionCallback callback]) {
     if (callback != null) {
-      _blink.BlinkNotification.instance.requestPermission_Callback_1_(unwrap_jso(callback));
+      _blink.BlinkNotification.instance.requestPermission_Callback_1_(unwrap_jso((permission) => callback(permission)));
       return;
     }
     _blink.BlinkNotification.instance.requestPermission_Callback_0_();
@@ -25137,6 +29174,20 @@
   @DomName('HTMLOListElement.HTMLOListElement')
   @DocsEditable()
   factory OListElement() => document.createElement("ol");
+
+
+  @Deprecated("Internal Use Only")
+  static OListElement internalCreateOListElement() {
+    return new OListElement._internalWrap();
+  }
+
+  factory OListElement._internalWrap() {
+    return new OListElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  OListElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -25150,7 +29201,7 @@
   
   @DomName('HTMLOListElement.reversed')
   @DocsEditable()
-  void set reversed(bool value) => _blink.BlinkHTMLOListElement.instance.reversed_Setter_(unwrap_jso(this), value);
+  set reversed(bool value) => _blink.BlinkHTMLOListElement.instance.reversed_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLOListElement.start')
   @DocsEditable()
@@ -25158,7 +29209,7 @@
   
   @DomName('HTMLOListElement.start')
   @DocsEditable()
-  void set start(int value) => _blink.BlinkHTMLOListElement.instance.start_Setter_(unwrap_jso(this), value);
+  set start(int value) => _blink.BlinkHTMLOListElement.instance.start_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLOListElement.type')
   @DocsEditable()
@@ -25166,7 +29217,7 @@
   
   @DomName('HTMLOListElement.type')
   @DocsEditable()
-  void set type(String value) => _blink.BlinkHTMLOListElement.instance.type_Setter_(unwrap_jso(this), value);
+  set type(String value) => _blink.BlinkHTMLOListElement.instance.type_Setter_(unwrap_jso(this), value);
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -25189,6 +29240,20 @@
   @DomName('HTMLObjectElement.HTMLObjectElement')
   @DocsEditable()
   factory ObjectElement() => document.createElement("object");
+
+
+  @Deprecated("Internal Use Only")
+  static ObjectElement internalCreateObjectElement() {
+    return new ObjectElement._internalWrap();
+  }
+
+  factory ObjectElement._internalWrap() {
+    return new ObjectElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  ObjectElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -25205,7 +29270,7 @@
   
   @DomName('HTMLObjectElement.data')
   @DocsEditable()
-  void set data(String value) => _blink.BlinkHTMLObjectElement.instance.data_Setter_(unwrap_jso(this), value);
+  set data(String value) => _blink.BlinkHTMLObjectElement.instance.data_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLObjectElement.form')
   @DocsEditable()
@@ -25217,7 +29282,7 @@
   
   @DomName('HTMLObjectElement.height')
   @DocsEditable()
-  void set height(String value) => _blink.BlinkHTMLObjectElement.instance.height_Setter_(unwrap_jso(this), value);
+  set height(String value) => _blink.BlinkHTMLObjectElement.instance.height_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLObjectElement.integrity')
   @DocsEditable()
@@ -25227,7 +29292,7 @@
   @DomName('HTMLObjectElement.integrity')
   @DocsEditable()
   @Experimental() // untriaged
-  void set integrity(String value) => _blink.BlinkHTMLObjectElement.instance.integrity_Setter_(unwrap_jso(this), value);
+  set integrity(String value) => _blink.BlinkHTMLObjectElement.instance.integrity_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLObjectElement.name')
   @DocsEditable()
@@ -25235,7 +29300,7 @@
   
   @DomName('HTMLObjectElement.name')
   @DocsEditable()
-  void set name(String value) => _blink.BlinkHTMLObjectElement.instance.name_Setter_(unwrap_jso(this), value);
+  set name(String value) => _blink.BlinkHTMLObjectElement.instance.name_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLObjectElement.type')
   @DocsEditable()
@@ -25243,7 +29308,7 @@
   
   @DomName('HTMLObjectElement.type')
   @DocsEditable()
-  void set type(String value) => _blink.BlinkHTMLObjectElement.instance.type_Setter_(unwrap_jso(this), value);
+  set type(String value) => _blink.BlinkHTMLObjectElement.instance.type_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLObjectElement.useMap')
   @DocsEditable()
@@ -25251,7 +29316,7 @@
   
   @DomName('HTMLObjectElement.useMap')
   @DocsEditable()
-  void set useMap(String value) => _blink.BlinkHTMLObjectElement.instance.useMap_Setter_(unwrap_jso(this), value);
+  set useMap(String value) => _blink.BlinkHTMLObjectElement.instance.useMap_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLObjectElement.validationMessage')
   @DocsEditable()
@@ -25267,7 +29332,7 @@
   
   @DomName('HTMLObjectElement.width')
   @DocsEditable()
-  void set width(String value) => _blink.BlinkHTMLObjectElement.instance.width_Setter_(unwrap_jso(this), value);
+  set width(String value) => _blink.BlinkHTMLObjectElement.instance.width_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLObjectElement.willValidate')
   @DocsEditable()
@@ -25306,6 +29371,20 @@
   @DomName('HTMLOptGroupElement.HTMLOptGroupElement')
   @DocsEditable()
   factory OptGroupElement() => document.createElement("optgroup");
+
+
+  @Deprecated("Internal Use Only")
+  static OptGroupElement internalCreateOptGroupElement() {
+    return new OptGroupElement._internalWrap();
+  }
+
+  factory OptGroupElement._internalWrap() {
+    return new OptGroupElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  OptGroupElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -25319,7 +29398,7 @@
   
   @DomName('HTMLOptGroupElement.disabled')
   @DocsEditable()
-  void set disabled(bool value) => _blink.BlinkHTMLOptGroupElement.instance.disabled_Setter_(unwrap_jso(this), value);
+  set disabled(bool value) => _blink.BlinkHTMLOptGroupElement.instance.disabled_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLOptGroupElement.label')
   @DocsEditable()
@@ -25327,7 +29406,7 @@
   
   @DomName('HTMLOptGroupElement.label')
   @DocsEditable()
-  void set label(String value) => _blink.BlinkHTMLOptGroupElement.instance.label_Setter_(unwrap_jso(this), value);
+  set label(String value) => _blink.BlinkHTMLOptGroupElement.instance.label_Setter_(unwrap_jso(this), value);
   
 }
 // Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
@@ -25344,8 +29423,22 @@
   @DomName('HTMLOptionElement.HTMLOptionElement')
   @DocsEditable()
   factory OptionElement._([String data, String value, bool defaultSelected, bool selected]) {
-    return _blink.BlinkHTMLOptionElement.instance.constructorCallback_4_(data, value, defaultSelected, selected);
+    return wrap_jso(_blink.BlinkHTMLOptionElement.instance.constructorCallback_4_(data, value, defaultSelected, selected));
   }
+
+
+  @Deprecated("Internal Use Only")
+  static OptionElement internalCreateOptionElement() {
+    return new OptionElement._internalWrap();
+  }
+
+  factory OptionElement._internalWrap() {
+    return new OptionElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  OptionElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -25359,7 +29452,7 @@
   
   @DomName('HTMLOptionElement.defaultSelected')
   @DocsEditable()
-  void set defaultSelected(bool value) => _blink.BlinkHTMLOptionElement.instance.defaultSelected_Setter_(unwrap_jso(this), value);
+  set defaultSelected(bool value) => _blink.BlinkHTMLOptionElement.instance.defaultSelected_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLOptionElement.disabled')
   @DocsEditable()
@@ -25367,7 +29460,7 @@
   
   @DomName('HTMLOptionElement.disabled')
   @DocsEditable()
-  void set disabled(bool value) => _blink.BlinkHTMLOptionElement.instance.disabled_Setter_(unwrap_jso(this), value);
+  set disabled(bool value) => _blink.BlinkHTMLOptionElement.instance.disabled_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLOptionElement.form')
   @DocsEditable()
@@ -25383,7 +29476,7 @@
   
   @DomName('HTMLOptionElement.label')
   @DocsEditable()
-  void set label(String value) => _blink.BlinkHTMLOptionElement.instance.label_Setter_(unwrap_jso(this), value);
+  set label(String value) => _blink.BlinkHTMLOptionElement.instance.label_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLOptionElement.selected')
   @DocsEditable()
@@ -25391,7 +29484,7 @@
   
   @DomName('HTMLOptionElement.selected')
   @DocsEditable()
-  void set selected(bool value) => _blink.BlinkHTMLOptionElement.instance.selected_Setter_(unwrap_jso(this), value);
+  set selected(bool value) => _blink.BlinkHTMLOptionElement.instance.selected_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLOptionElement.value')
   @DocsEditable()
@@ -25399,7 +29492,7 @@
   
   @DomName('HTMLOptionElement.value')
   @DocsEditable()
-  void set value(String value) => _blink.BlinkHTMLOptionElement.instance.value_Setter_(unwrap_jso(this), value);
+  set value(String value) => _blink.BlinkHTMLOptionElement.instance.value_Setter_(unwrap_jso(this), value);
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -25421,6 +29514,20 @@
   @DomName('HTMLOutputElement.HTMLOutputElement')
   @DocsEditable()
   factory OutputElement() => document.createElement("output");
+
+
+  @Deprecated("Internal Use Only")
+  static OutputElement internalCreateOutputElement() {
+    return new OutputElement._internalWrap();
+  }
+
+  factory OutputElement._internalWrap() {
+    return new OutputElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  OutputElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -25437,7 +29544,7 @@
   
   @DomName('HTMLOutputElement.defaultValue')
   @DocsEditable()
-  void set defaultValue(String value) => _blink.BlinkHTMLOutputElement.instance.defaultValue_Setter_(unwrap_jso(this), value);
+  set defaultValue(String value) => _blink.BlinkHTMLOutputElement.instance.defaultValue_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLOutputElement.form')
   @DocsEditable()
@@ -25450,7 +29557,7 @@
   @DomName('HTMLOutputElement.labels')
   @DocsEditable()
   @Unstable()
-  List<Node> get labels => wrap_jso_list(_blink.BlinkHTMLOutputElement.instance.labels_Getter_(unwrap_jso(this)));
+  List<Node> get labels => wrap_jso(_blink.BlinkHTMLOutputElement.instance.labels_Getter_(unwrap_jso(this)));
   
   @DomName('HTMLOutputElement.name')
   @DocsEditable()
@@ -25458,7 +29565,7 @@
   
   @DomName('HTMLOutputElement.name')
   @DocsEditable()
-  void set name(String value) => _blink.BlinkHTMLOutputElement.instance.name_Setter_(unwrap_jso(this), value);
+  set name(String value) => _blink.BlinkHTMLOutputElement.instance.name_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLOutputElement.type')
   @DocsEditable()
@@ -25478,7 +29585,7 @@
   
   @DomName('HTMLOutputElement.value')
   @DocsEditable()
-  void set value(String value) => _blink.BlinkHTMLOutputElement.instance.value_Setter_(unwrap_jso(this), value);
+  set value(String value) => _blink.BlinkHTMLOutputElement.instance.value_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLOutputElement.willValidate')
   @DocsEditable()
@@ -25507,6 +29614,20 @@
   // To suppress missing implicit constructor warnings.
   factory OverflowEvent._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static OverflowEvent internalCreateOverflowEvent() {
+    return new OverflowEvent._internalWrap();
+  }
+
+  factory OverflowEvent._internalWrap() {
+    return new OverflowEvent.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  OverflowEvent.internal_() : super.internal_();
+
+
   @DomName('OverflowEvent.BOTH')
   @DocsEditable()
   static const int BOTH = 2;
@@ -25547,6 +29668,20 @@
   // To suppress missing implicit constructor warnings.
   factory PageTransitionEvent._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static PageTransitionEvent internalCreatePageTransitionEvent() {
+    return new PageTransitionEvent._internalWrap();
+  }
+
+  factory PageTransitionEvent._internalWrap() {
+    return new PageTransitionEvent.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  PageTransitionEvent.internal_() : super.internal_();
+
+
   @DomName('PageTransitionEvent.persisted')
   @DocsEditable()
   bool get persisted => _blink.BlinkPageTransitionEvent.instance.persisted_Getter_(unwrap_jso(this));
@@ -25568,6 +29703,20 @@
   @DomName('HTMLParagraphElement.HTMLParagraphElement')
   @DocsEditable()
   factory ParagraphElement() => document.createElement("p");
+
+
+  @Deprecated("Internal Use Only")
+  static ParagraphElement internalCreateParagraphElement() {
+    return new ParagraphElement._internalWrap();
+  }
+
+  factory ParagraphElement._internalWrap() {
+    return new ParagraphElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  ParagraphElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -25593,6 +29742,20 @@
   @DomName('HTMLParamElement.HTMLParamElement')
   @DocsEditable()
   factory ParamElement() => document.createElement("param");
+
+
+  @Deprecated("Internal Use Only")
+  static ParamElement internalCreateParamElement() {
+    return new ParamElement._internalWrap();
+  }
+
+  factory ParamElement._internalWrap() {
+    return new ParamElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  ParamElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -25606,7 +29769,7 @@
   
   @DomName('HTMLParamElement.name')
   @DocsEditable()
-  void set name(String value) => _blink.BlinkHTMLParamElement.instance.name_Setter_(unwrap_jso(this), value);
+  set name(String value) => _blink.BlinkHTMLParamElement.instance.name_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLParamElement.value')
   @DocsEditable()
@@ -25614,7 +29777,7 @@
   
   @DomName('HTMLParamElement.value')
   @DocsEditable()
-  void set value(String value) => _blink.BlinkHTMLParamElement.instance.value_Setter_(unwrap_jso(this), value);
+  set value(String value) => _blink.BlinkHTMLParamElement.instance.value_Setter_(unwrap_jso(this), value);
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -25627,7 +29790,7 @@
 @DocsEditable()
 @DomName('ParentNode')
 @Experimental() // untriaged
-abstract class ParentNode extends NativeFieldWrapperClass2 {
+abstract class ParentNode extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory ParentNode._() { throw new UnsupportedError("Not supported"); }
 
@@ -25672,7 +29835,7 @@
 @DocsEditable()
 @DomName('Path2D')
 @Experimental() // untriaged
-class Path2D extends NativeFieldWrapperClass2 implements _CanvasPathMethods {
+class Path2D extends DartHtmlDomObject implements _CanvasPathMethods {
   // To suppress missing implicit constructor warnings.
   factory Path2D._() { throw new UnsupportedError("Not supported"); }
 
@@ -25680,17 +29843,32 @@
   @DocsEditable()
   factory Path2D([path_OR_text]) {
     if (path_OR_text == null) {
-      return _blink.BlinkPath2D.instance.constructorCallback_0_();
+      return wrap_jso(_blink.BlinkPath2D.instance.constructorCallback_0_());
     }
     if ((path_OR_text is Path2D || path_OR_text == null)) {
-      return _blink.BlinkPath2D.instance.constructorCallback_1_(path_OR_text);
+      return wrap_jso(_blink.BlinkPath2D.instance.constructorCallback_1_(path_OR_text));
     }
     if ((path_OR_text is String || path_OR_text == null)) {
-      return _blink.BlinkPath2D.instance.constructorCallback_1_(path_OR_text);
+      return wrap_jso(_blink.BlinkPath2D.instance.constructorCallback_1_(path_OR_text));
     }
     throw new ArgumentError("Incorrect number or type of arguments");
   }
 
+  @Deprecated("Internal Use Only")
+  static Path2D internalCreatePath2D() {
+    return new Path2D._internalWrap();
+  }
+
+  factory Path2D._internalWrap() {
+    return new Path2D.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  Path2D.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   void addPath(Path2D path, [Matrix transform]) {
     if (transform != null) {
       _blink.BlinkPath2D.instance.addPath_Callback_2_(unwrap_jso(this), unwrap_jso(path), unwrap_jso(transform));
@@ -25776,6 +29954,20 @@
   // http://www.w3c-test.org/webperf/specs/ResourceTiming/#performanceresourcetiming-methods
   static const EventStreamProvider<Event> resourceTimingBufferFullEvent = const EventStreamProvider<Event>('webkitresourcetimingbufferfull');
 
+
+  @Deprecated("Internal Use Only")
+  static Performance internalCreatePerformance() {
+    return new Performance._internalWrap();
+  }
+
+  factory Performance._internalWrap() {
+    return new Performance.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  Performance.internal_() : super.internal_();
+
+
   /// Checks if this type is supported on the current platform.
   static bool get supported => true;
 
@@ -25808,19 +30000,19 @@
   @DocsEditable()
   // http://www.w3.org/TR/performance-timeline/#sec-window.performance-attribute
   @Experimental()
-  List<PerformanceEntry> getEntries() => _blink.BlinkPerformance.instance.getEntries_Callback_0_(unwrap_jso(this));
+  List<PerformanceEntry> getEntries() => wrap_jso(_blink.BlinkPerformance.instance.getEntries_Callback_0_(unwrap_jso(this)));
   
   @DomName('Performance.getEntriesByName')
   @DocsEditable()
   // http://www.w3.org/TR/performance-timeline/#sec-window.performance-attribute
   @Experimental()
-  List<PerformanceEntry> getEntriesByName(String name, String entryType) => _blink.BlinkPerformance.instance.getEntriesByName_Callback_2_(unwrap_jso(this), name, entryType);
+  List<PerformanceEntry> getEntriesByName(String name, String entryType) => wrap_jso(_blink.BlinkPerformance.instance.getEntriesByName_Callback_2_(unwrap_jso(this), name, entryType));
   
   @DomName('Performance.getEntriesByType')
   @DocsEditable()
   // http://www.w3.org/TR/performance-timeline/#sec-window.performance-attribute
   @Experimental()
-  List<PerformanceEntry> getEntriesByType(String entryType) => _blink.BlinkPerformance.instance.getEntriesByType_Callback_1_(unwrap_jso(this), entryType);
+  List<PerformanceEntry> getEntriesByType(String entryType) => wrap_jso(_blink.BlinkPerformance.instance.getEntriesByType_Callback_1_(unwrap_jso(this), entryType));
   
   @DomName('Performance.mark')
   @DocsEditable()
@@ -25836,7 +30028,7 @@
   
   @DomName('Performance.now')
   @DocsEditable()
-  double now() => _blink.BlinkPerformance.instance.now_Callback_0_(unwrap_jso(this));
+  num now() => _blink.BlinkPerformance.instance.now_Callback_0_(unwrap_jso(this));
   
   @DomName('Performance.webkitClearResourceTimings')
   @DocsEditable()
@@ -25873,13 +30065,28 @@
 @DomName('PerformanceEntry')
 // http://www.w3.org/TR/performance-timeline/#sec-PerformanceEntry-interface
 @Experimental()
-class PerformanceEntry extends NativeFieldWrapperClass2 {
+class PerformanceEntry extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory PerformanceEntry._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static PerformanceEntry internalCreatePerformanceEntry() {
+    return new PerformanceEntry._internalWrap();
+  }
+
+  factory PerformanceEntry._internalWrap() {
+    return new PerformanceEntry.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  PerformanceEntry.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('PerformanceEntry.duration')
   @DocsEditable()
-  double get duration => _blink.BlinkPerformanceEntry.instance.duration_Getter_(unwrap_jso(this));
+  num get duration => _blink.BlinkPerformanceEntry.instance.duration_Getter_(unwrap_jso(this));
   
   @DomName('PerformanceEntry.entryType')
   @DocsEditable()
@@ -25891,7 +30098,7 @@
   
   @DomName('PerformanceEntry.startTime')
   @DocsEditable()
-  double get startTime => _blink.BlinkPerformanceEntry.instance.startTime_Getter_(unwrap_jso(this));
+  num get startTime => _blink.BlinkPerformanceEntry.instance.startTime_Getter_(unwrap_jso(this));
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -25909,6 +30116,20 @@
   // To suppress missing implicit constructor warnings.
   factory PerformanceMark._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static PerformanceMark internalCreatePerformanceMark() {
+    return new PerformanceMark._internalWrap();
+  }
+
+  factory PerformanceMark._internalWrap() {
+    return new PerformanceMark.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  PerformanceMark.internal_() : super.internal_();
+
+
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -25925,6 +30146,20 @@
   // To suppress missing implicit constructor warnings.
   factory PerformanceMeasure._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static PerformanceMeasure internalCreatePerformanceMeasure() {
+    return new PerformanceMeasure._internalWrap();
+  }
+
+  factory PerformanceMeasure._internalWrap() {
+    return new PerformanceMeasure.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  PerformanceMeasure.internal_() : super.internal_();
+
+
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -25936,10 +30171,25 @@
 @DocsEditable()
 @DomName('PerformanceNavigation')
 @Unstable()
-class PerformanceNavigation extends NativeFieldWrapperClass2 {
+class PerformanceNavigation extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory PerformanceNavigation._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static PerformanceNavigation internalCreatePerformanceNavigation() {
+    return new PerformanceNavigation._internalWrap();
+  }
+
+  factory PerformanceNavigation._internalWrap() {
+    return new PerformanceNavigation.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  PerformanceNavigation.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('PerformanceNavigation.TYPE_BACK_FORWARD')
   @DocsEditable()
   static const int TYPE_BACK_FORWARD = 2;
@@ -25980,25 +30230,39 @@
   // To suppress missing implicit constructor warnings.
   factory PerformanceResourceTiming._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static PerformanceResourceTiming internalCreatePerformanceResourceTiming() {
+    return new PerformanceResourceTiming._internalWrap();
+  }
+
+  factory PerformanceResourceTiming._internalWrap() {
+    return new PerformanceResourceTiming.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  PerformanceResourceTiming.internal_() : super.internal_();
+
+
   @DomName('PerformanceResourceTiming.connectEnd')
   @DocsEditable()
-  double get connectEnd => _blink.BlinkPerformanceResourceTiming.instance.connectEnd_Getter_(unwrap_jso(this));
+  num get connectEnd => _blink.BlinkPerformanceResourceTiming.instance.connectEnd_Getter_(unwrap_jso(this));
   
   @DomName('PerformanceResourceTiming.connectStart')
   @DocsEditable()
-  double get connectStart => _blink.BlinkPerformanceResourceTiming.instance.connectStart_Getter_(unwrap_jso(this));
+  num get connectStart => _blink.BlinkPerformanceResourceTiming.instance.connectStart_Getter_(unwrap_jso(this));
   
   @DomName('PerformanceResourceTiming.domainLookupEnd')
   @DocsEditable()
-  double get domainLookupEnd => _blink.BlinkPerformanceResourceTiming.instance.domainLookupEnd_Getter_(unwrap_jso(this));
+  num get domainLookupEnd => _blink.BlinkPerformanceResourceTiming.instance.domainLookupEnd_Getter_(unwrap_jso(this));
   
   @DomName('PerformanceResourceTiming.domainLookupStart')
   @DocsEditable()
-  double get domainLookupStart => _blink.BlinkPerformanceResourceTiming.instance.domainLookupStart_Getter_(unwrap_jso(this));
+  num get domainLookupStart => _blink.BlinkPerformanceResourceTiming.instance.domainLookupStart_Getter_(unwrap_jso(this));
   
   @DomName('PerformanceResourceTiming.fetchStart')
   @DocsEditable()
-  double get fetchStart => _blink.BlinkPerformanceResourceTiming.instance.fetchStart_Getter_(unwrap_jso(this));
+  num get fetchStart => _blink.BlinkPerformanceResourceTiming.instance.fetchStart_Getter_(unwrap_jso(this));
   
   @DomName('PerformanceResourceTiming.initiatorType')
   @DocsEditable()
@@ -26006,30 +30270,30 @@
   
   @DomName('PerformanceResourceTiming.redirectEnd')
   @DocsEditable()
-  double get redirectEnd => _blink.BlinkPerformanceResourceTiming.instance.redirectEnd_Getter_(unwrap_jso(this));
+  num get redirectEnd => _blink.BlinkPerformanceResourceTiming.instance.redirectEnd_Getter_(unwrap_jso(this));
   
   @DomName('PerformanceResourceTiming.redirectStart')
   @DocsEditable()
-  double get redirectStart => _blink.BlinkPerformanceResourceTiming.instance.redirectStart_Getter_(unwrap_jso(this));
+  num get redirectStart => _blink.BlinkPerformanceResourceTiming.instance.redirectStart_Getter_(unwrap_jso(this));
   
   @DomName('PerformanceResourceTiming.requestStart')
   @DocsEditable()
   @Experimental() // nonstandard
-  double get requestStart => _blink.BlinkPerformanceResourceTiming.instance.requestStart_Getter_(unwrap_jso(this));
+  num get requestStart => _blink.BlinkPerformanceResourceTiming.instance.requestStart_Getter_(unwrap_jso(this));
   
   @DomName('PerformanceResourceTiming.responseEnd')
   @DocsEditable()
   @Experimental() // nonstandard
-  double get responseEnd => _blink.BlinkPerformanceResourceTiming.instance.responseEnd_Getter_(unwrap_jso(this));
+  num get responseEnd => _blink.BlinkPerformanceResourceTiming.instance.responseEnd_Getter_(unwrap_jso(this));
   
   @DomName('PerformanceResourceTiming.responseStart')
   @DocsEditable()
   @Experimental() // nonstandard
-  double get responseStart => _blink.BlinkPerformanceResourceTiming.instance.responseStart_Getter_(unwrap_jso(this));
+  num get responseStart => _blink.BlinkPerformanceResourceTiming.instance.responseStart_Getter_(unwrap_jso(this));
   
   @DomName('PerformanceResourceTiming.secureConnectionStart')
   @DocsEditable()
-  double get secureConnectionStart => _blink.BlinkPerformanceResourceTiming.instance.secureConnectionStart_Getter_(unwrap_jso(this));
+  num get secureConnectionStart => _blink.BlinkPerformanceResourceTiming.instance.secureConnectionStart_Getter_(unwrap_jso(this));
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -26042,10 +30306,25 @@
 @DocsEditable()
 @DomName('PerformanceTiming')
 @Unstable()
-class PerformanceTiming extends NativeFieldWrapperClass2 {
+class PerformanceTiming extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory PerformanceTiming._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static PerformanceTiming internalCreatePerformanceTiming() {
+    return new PerformanceTiming._internalWrap();
+  }
+
+  factory PerformanceTiming._internalWrap() {
+    return new PerformanceTiming.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  PerformanceTiming.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('PerformanceTiming.connectEnd')
   @DocsEditable()
   int get connectEnd => _blink.BlinkPerformanceTiming.instance.connectEnd_Getter_(unwrap_jso(this));
@@ -26144,6 +30423,20 @@
 class PictureElement extends HtmlElement {
   // To suppress missing implicit constructor warnings.
   factory PictureElement._() { throw new UnsupportedError("Not supported"); }
+
+
+  @Deprecated("Internal Use Only")
+  static PictureElement internalCreatePictureElement() {
+    return new PictureElement._internalWrap();
+  }
+
+  factory PictureElement._internalWrap() {
+    return new PictureElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  PictureElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -26162,10 +30455,25 @@
 @DocsEditable()
 @DomName('Plugin')
 @Experimental() // non-standard
-class Plugin extends NativeFieldWrapperClass2 {
+class Plugin extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory Plugin._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static Plugin internalCreatePlugin() {
+    return new Plugin._internalWrap();
+  }
+
+  factory Plugin._internalWrap() {
+    return new Plugin.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  Plugin.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('Plugin.description')
   @DocsEditable()
   String get description => _blink.BlinkPlugin.instance.description_Getter_(unwrap_jso(this));
@@ -26205,10 +30513,25 @@
 @DocsEditable()
 @DomName('PluginArray')
 @Experimental() // non-standard
-class PluginArray extends NativeFieldWrapperClass2 with ListMixin<Plugin>, ImmutableListMixin<Plugin> implements List<Plugin> {
+class PluginArray extends DartHtmlDomObject with ListMixin<Plugin>, ImmutableListMixin<Plugin> implements List<Plugin> {
   // To suppress missing implicit constructor warnings.
   factory PluginArray._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static PluginArray internalCreatePluginArray() {
+    return new PluginArray._internalWrap();
+  }
+
+  factory PluginArray._internalWrap() {
+    return new PluginArray.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  PluginArray.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('PluginArray.length')
   @DocsEditable()
   int get length => _blink.BlinkPluginArray.instance.length_Getter_(unwrap_jso(this));
@@ -26220,7 +30543,7 @@
   }
 
   Plugin _nativeIndexedGetter(int index) => wrap_jso(_blink.BlinkPluginArray.instance.item_Callback_1_(unwrap_jso(this), index));
- 
+
   void operator[]=(int index, Plugin value) {
     throw new UnsupportedError("Cannot assign element of immutable List.");
   }
@@ -26228,7 +30551,7 @@
   // Plugin is the element type.
 
 
-  void set length(int value) {
+  set length(int value) {
     throw new UnsupportedError("Cannot resize immutable List.");
   }
 
@@ -26289,6 +30612,20 @@
 class PluginPlaceholderElement extends DivElement {
   // To suppress missing implicit constructor warnings.
   factory PluginPlaceholderElement._() { throw new UnsupportedError("Not supported"); }
+
+
+  @Deprecated("Internal Use Only")
+  static PluginPlaceholderElement internalCreatePluginPlaceholderElement() {
+    return new PluginPlaceholderElement._internalWrap();
+  }
+
+  factory PluginPlaceholderElement._internalWrap() {
+    return new PluginPlaceholderElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  PluginPlaceholderElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -26304,7 +30641,7 @@
   @DomName('PluginPlaceholderElement.message')
   @DocsEditable()
   @Experimental() // untriaged
-  void set message(String value) => _blink.BlinkPluginPlaceholderElement.instance.message_Setter_(unwrap_jso(this), value);
+  set message(String value) => _blink.BlinkPluginPlaceholderElement.instance.message_Setter_(unwrap_jso(this), value);
   
   @DomName('PluginPlaceholderElement.createdCallback')
   @DocsEditable()
@@ -26329,9 +30666,23 @@
   // To suppress missing implicit constructor warnings.
   factory PopStateEvent._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static PopStateEvent internalCreatePopStateEvent() {
+    return new PopStateEvent._internalWrap();
+  }
+
+  factory PopStateEvent._internalWrap() {
+    return new PopStateEvent.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  PopStateEvent.internal_() : super.internal_();
+
+
   @DomName('PopStateEvent.state')
   @DocsEditable()
-  Object get state => _blink.BlinkPopStateEvent.instance.state_Getter_(unwrap_jso(this));
+  Object get state => wrap_jso(_blink.BlinkPopStateEvent.instance.state_Getter_(unwrap_jso(this)));
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -26354,10 +30705,25 @@
 @DocsEditable()
 @DomName('PositionError')
 @Unstable()
-class PositionError extends NativeFieldWrapperClass2 {
+class PositionError extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory PositionError._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static PositionError internalCreatePositionError() {
+    return new PositionError._internalWrap();
+  }
+
+  factory PositionError._internalWrap() {
+    return new PositionError.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  PositionError.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('PositionError.PERMISSION_DENIED')
   @DocsEditable()
   static const int PERMISSION_DENIED = 1;
@@ -26405,6 +30771,20 @@
   @DomName('HTMLPreElement.HTMLPreElement')
   @DocsEditable()
   factory PreElement() => document.createElement("pre");
+
+
+  @Deprecated("Internal Use Only")
+  static PreElement internalCreatePreElement() {
+    return new PreElement._internalWrap();
+  }
+
+  factory PreElement._internalWrap() {
+    return new PreElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  PreElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -26427,6 +30807,20 @@
   // To suppress missing implicit constructor warnings.
   factory Presentation._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static Presentation internalCreatePresentation() {
+    return new Presentation._internalWrap();
+  }
+
+  factory Presentation._internalWrap() {
+    return new Presentation.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  Presentation.internal_() : super.internal_();
+
+
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -26442,6 +30836,20 @@
   // To suppress missing implicit constructor warnings.
   factory ProcessingInstruction._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static ProcessingInstruction internalCreateProcessingInstruction() {
+    return new ProcessingInstruction._internalWrap();
+  }
+
+  factory ProcessingInstruction._internalWrap() {
+    return new ProcessingInstruction.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  ProcessingInstruction.internal_() : super.internal_();
+
+
   @DomName('ProcessingInstruction.sheet')
   @DocsEditable()
   @Experimental() // non-standard
@@ -26472,6 +30880,20 @@
   @DomName('HTMLProgressElement.HTMLProgressElement')
   @DocsEditable()
   factory ProgressElement() => document.createElement("progress");
+
+
+  @Deprecated("Internal Use Only")
+  static ProgressElement internalCreateProgressElement() {
+    return new ProgressElement._internalWrap();
+  }
+
+  factory ProgressElement._internalWrap() {
+    return new ProgressElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  ProgressElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -26485,7 +30907,7 @@
   @DomName('HTMLProgressElement.labels')
   @DocsEditable()
   @Unstable()
-  List<Node> get labels => wrap_jso_list(_blink.BlinkHTMLProgressElement.instance.labels_Getter_(unwrap_jso(this)));
+  List<Node> get labels => wrap_jso(_blink.BlinkHTMLProgressElement.instance.labels_Getter_(unwrap_jso(this)));
   
   @DomName('HTMLProgressElement.max')
   @DocsEditable()
@@ -26493,11 +30915,11 @@
   
   @DomName('HTMLProgressElement.max')
   @DocsEditable()
-  void set max(num value) => _blink.BlinkHTMLProgressElement.instance.max_Setter_(unwrap_jso(this), value);
+  set max(num value) => _blink.BlinkHTMLProgressElement.instance.max_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLProgressElement.position')
   @DocsEditable()
-  double get position => _blink.BlinkHTMLProgressElement.instance.position_Getter_(unwrap_jso(this));
+  num get position => _blink.BlinkHTMLProgressElement.instance.position_Getter_(unwrap_jso(this));
   
   @DomName('HTMLProgressElement.value')
   @DocsEditable()
@@ -26505,7 +30927,7 @@
   
   @DomName('HTMLProgressElement.value')
   @DocsEditable()
-  void set value(num value) => _blink.BlinkHTMLProgressElement.instance.value_Setter_(unwrap_jso(this), value);
+  set value(num value) => _blink.BlinkHTMLProgressElement.instance.value_Setter_(unwrap_jso(this), value);
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -26521,6 +30943,20 @@
   // To suppress missing implicit constructor warnings.
   factory ProgressEvent._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static ProgressEvent internalCreateProgressEvent() {
+    return new ProgressEvent._internalWrap();
+  }
+
+  factory ProgressEvent._internalWrap() {
+    return new ProgressEvent.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  ProgressEvent.internal_() : super.internal_();
+
+
   @DomName('ProgressEvent.lengthComputable')
   @DocsEditable()
   bool get lengthComputable => _blink.BlinkProgressEvent.instance.lengthComputable_Getter_(unwrap_jso(this));
@@ -26548,6 +30984,20 @@
   // To suppress missing implicit constructor warnings.
   factory PushEvent._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static PushEvent internalCreatePushEvent() {
+    return new PushEvent._internalWrap();
+  }
+
+  factory PushEvent._internalWrap() {
+    return new PushEvent.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  PushEvent.internal_() : super.internal_();
+
+
   @DomName('PushEvent.data')
   @DocsEditable()
   @Experimental() // untriaged
@@ -26564,14 +31014,29 @@
 @DocsEditable()
 @DomName('PushManager')
 @Experimental() // untriaged
-class PushManager extends NativeFieldWrapperClass2 {
+class PushManager extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory PushManager._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static PushManager internalCreatePushManager() {
+    return new PushManager._internalWrap();
+  }
+
+  factory PushManager._internalWrap() {
+    return new PushManager.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  PushManager.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('PushManager.register')
   @DocsEditable()
   @Experimental() // untriaged
-  Future register(String senderId) => _blink.BlinkPushManager.instance.register_Callback_1_(unwrap_jso(this), senderId);
+  Future register(String senderId) => wrap_jso(_blink.BlinkPushManager.instance.register_Callback_1_(unwrap_jso(this), senderId));
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -26584,10 +31049,25 @@
 @DocsEditable()
 @DomName('PushRegistration')
 @Experimental() // untriaged
-class PushRegistration extends NativeFieldWrapperClass2 {
+class PushRegistration extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory PushRegistration._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static PushRegistration internalCreatePushRegistration() {
+    return new PushRegistration._internalWrap();
+  }
+
+  factory PushRegistration._internalWrap() {
+    return new PushRegistration.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  PushRegistration.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('PushRegistration.pushEndpoint')
   @DocsEditable()
   @Experimental() // untriaged
@@ -26615,6 +31095,20 @@
   @DomName('HTMLQuoteElement.HTMLQuoteElement')
   @DocsEditable()
   factory QuoteElement() => document.createElement("q");
+
+
+  @Deprecated("Internal Use Only")
+  static QuoteElement internalCreateQuoteElement() {
+    return new QuoteElement._internalWrap();
+  }
+
+  factory QuoteElement._internalWrap() {
+    return new QuoteElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  QuoteElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -26628,7 +31122,7 @@
   
   @DomName('HTMLQuoteElement.cite')
   @DocsEditable()
-  void set cite(String value) => _blink.BlinkHTMLQuoteElement.instance.cite_Setter_(unwrap_jso(this), value);
+  set cite(String value) => _blink.BlinkHTMLQuoteElement.instance.cite_Setter_(unwrap_jso(this), value);
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -26673,7 +31167,7 @@
 
 @DomName('Range')
 @Unstable()
-class Range extends NativeFieldWrapperClass2 {
+class Range extends DartHtmlDomObject {
   factory Range() => document.createRange();
 
   factory Range.fromPoint(Point point) =>
@@ -26681,6 +31175,21 @@
   // To suppress missing implicit constructor warnings.
   factory Range._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static Range internalCreateRange() {
+    return new Range._internalWrap();
+  }
+
+  factory Range._internalWrap() {
+    return new Range.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  Range.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('Range.END_TO_END')
   @DocsEditable()
   static const int END_TO_END = 2;
@@ -26794,7 +31303,7 @@
   
   @DomName('Range.getClientRects')
   @DocsEditable()
-  List<Rectangle> getClientRects() => _blink.BlinkRange.instance.getClientRects_Callback_0_(unwrap_jso(this));
+  List<Rectangle> getClientRects() => wrap_jso(_blink.BlinkRange.instance.getClientRects_Callback_0_(unwrap_jso(this)));
   
   @DomName('Range.insertNode')
   @DocsEditable()
@@ -26860,14 +31369,29 @@
 @DocsEditable()
 @DomName('ReadableStream')
 @Experimental() // untriaged
-class ReadableStream extends NativeFieldWrapperClass2 {
+class ReadableStream extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory ReadableStream._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static ReadableStream internalCreateReadableStream() {
+    return new ReadableStream._internalWrap();
+  }
+
+  factory ReadableStream._internalWrap() {
+    return new ReadableStream.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  ReadableStream.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('ReadableStream.closed')
   @DocsEditable()
   @Experimental() // untriaged
-  Future get closed => _blink.BlinkReadableStream.instance.closed_Getter_(unwrap_jso(this));
+  Future get closed => wrap_jso(_blink.BlinkReadableStream.instance.closed_Getter_(unwrap_jso(this)));
   
   @DomName('ReadableStream.state')
   @DocsEditable()
@@ -26877,7 +31401,7 @@
   @DomName('ReadableStream.cancel')
   @DocsEditable()
   @Experimental() // untriaged
-  Future cancel(Object reason) => _blink.BlinkReadableStream.instance.cancel_Callback_1_(unwrap_jso(this), reason);
+  Future cancel(Object reason) => wrap_jso(_blink.BlinkReadableStream.instance.cancel_Callback_1_(unwrap_jso(this), reason));
   
   @DomName('ReadableStream.read')
   @DocsEditable()
@@ -26887,7 +31411,7 @@
   @DomName('ReadableStream.wait')
   @DocsEditable()
   @Experimental() // untriaged
-  Future wait() => _blink.BlinkReadableStream.instance.wait_Callback_0_(unwrap_jso(this));
+  Future wait() => wrap_jso(_blink.BlinkReadableStream.instance.wait_Callback_0_(unwrap_jso(this)));
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -26904,6 +31428,20 @@
   // To suppress missing implicit constructor warnings.
   factory RelatedEvent._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static RelatedEvent internalCreateRelatedEvent() {
+    return new RelatedEvent._internalWrap();
+  }
+
+  factory RelatedEvent._internalWrap() {
+    return new RelatedEvent.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  RelatedEvent.internal_() : super.internal_();
+
+
   @DomName('RelatedEvent.relatedTarget')
   @DocsEditable()
   @Experimental() // untriaged
@@ -26934,6 +31472,20 @@
   // To suppress missing implicit constructor warnings.
   factory ResourceProgressEvent._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static ResourceProgressEvent internalCreateResourceProgressEvent() {
+    return new ResourceProgressEvent._internalWrap();
+  }
+
+  factory ResourceProgressEvent._internalWrap() {
+    return new ResourceProgressEvent.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  ResourceProgressEvent.internal_() : super.internal_();
+
+
   @DomName('ResourceProgressEvent.url')
   @DocsEditable()
   String get url => _blink.BlinkResourceProgressEvent.instance.url_Getter_(unwrap_jso(this));
@@ -26994,13 +31546,27 @@
   @DocsEditable()
   static const EventStreamProvider<Event> openEvent = const EventStreamProvider<Event>('open');
 
+
+  @Deprecated("Internal Use Only")
+  static RtcDataChannel internalCreateRtcDataChannel() {
+    return new RtcDataChannel._internalWrap();
+  }
+
+  factory RtcDataChannel._internalWrap() {
+    return new RtcDataChannel.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  RtcDataChannel.internal_() : super.internal_();
+
+
   @DomName('RTCDataChannel.binaryType')
   @DocsEditable()
   String get binaryType => _blink.BlinkRTCDataChannel.instance.binaryType_Getter_(unwrap_jso(this));
   
   @DomName('RTCDataChannel.binaryType')
   @DocsEditable()
-  void set binaryType(String value) => _blink.BlinkRTCDataChannel.instance.binaryType_Setter_(unwrap_jso(this), value);
+  set binaryType(String value) => _blink.BlinkRTCDataChannel.instance.binaryType_Setter_(unwrap_jso(this), value);
   
   @DomName('RTCDataChannel.bufferedAmount')
   @DocsEditable()
@@ -27124,6 +31690,20 @@
   // To suppress missing implicit constructor warnings.
   factory RtcDataChannelEvent._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static RtcDataChannelEvent internalCreateRtcDataChannelEvent() {
+    return new RtcDataChannelEvent._internalWrap();
+  }
+
+  factory RtcDataChannelEvent._internalWrap() {
+    return new RtcDataChannelEvent.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  RtcDataChannelEvent.internal_() : super.internal_();
+
+
   @DomName('RTCDataChannelEvent.channel')
   @DocsEditable()
   RtcDataChannel get channel => wrap_jso(_blink.BlinkRTCDataChannelEvent.instance.channel_Getter_(unwrap_jso(this)));
@@ -27154,6 +31734,20 @@
   @DocsEditable()
   static const EventStreamProvider<RtcDtmfToneChangeEvent> toneChangeEvent = const EventStreamProvider<RtcDtmfToneChangeEvent>('tonechange');
 
+
+  @Deprecated("Internal Use Only")
+  static RtcDtmfSender internalCreateRtcDtmfSender() {
+    return new RtcDtmfSender._internalWrap();
+  }
+
+  factory RtcDtmfSender._internalWrap() {
+    return new RtcDtmfSender.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  RtcDtmfSender.internal_() : super.internal_();
+
+
   @DomName('RTCDTMFSender.canInsertDTMF')
   @DocsEditable()
   bool get canInsertDtmf => _blink.BlinkRTCDTMFSender.instance.canInsertDTMF_Getter_(unwrap_jso(this));
@@ -27208,6 +31802,20 @@
   // To suppress missing implicit constructor warnings.
   factory RtcDtmfToneChangeEvent._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static RtcDtmfToneChangeEvent internalCreateRtcDtmfToneChangeEvent() {
+    return new RtcDtmfToneChangeEvent._internalWrap();
+  }
+
+  factory RtcDtmfToneChangeEvent._internalWrap() {
+    return new RtcDtmfToneChangeEvent.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  RtcDtmfToneChangeEvent.internal_() : super.internal_();
+
+
   @DomName('RTCDTMFToneChangeEvent.tone')
   @DocsEditable()
   String get tone => _blink.BlinkRTCDTMFToneChangeEvent.instance.tone_Getter_(unwrap_jso(this));
@@ -27225,23 +31833,39 @@
 @SupportedBrowser(SupportedBrowser.CHROME)
 @Experimental()
 // http://dev.w3.org/2011/webrtc/editor/webrtc.html#idl-def-RTCIceCandidate
-class RtcIceCandidate extends NativeFieldWrapperClass2 {
+class RtcIceCandidate extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory RtcIceCandidate._() { throw new UnsupportedError("Not supported"); }
 
   @DomName('RTCIceCandidate.RTCIceCandidate')
   @DocsEditable()
   factory RtcIceCandidate(Map dictionary) {
-    return _blink.BlinkRTCIceCandidate.instance.constructorCallback_1_(dictionary);
+    var dictionary_1 = convertDartToNative_Dictionary(dictionary);
+    return wrap_jso(_blink.BlinkRTCIceCandidate.instance.constructorCallback_1_(dictionary_1));
   }
 
+  @Deprecated("Internal Use Only")
+  static RtcIceCandidate internalCreateRtcIceCandidate() {
+    return new RtcIceCandidate._internalWrap();
+  }
+
+  factory RtcIceCandidate._internalWrap() {
+    return new RtcIceCandidate.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  RtcIceCandidate.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('RTCIceCandidate.candidate')
   @DocsEditable()
   String get candidate => _blink.BlinkRTCIceCandidate.instance.candidate_Getter_(unwrap_jso(this));
   
   @DomName('RTCIceCandidate.candidate')
   @DocsEditable()
-  void set candidate(String value) => _blink.BlinkRTCIceCandidate.instance.candidate_Setter_(unwrap_jso(this), value);
+  set candidate(String value) => _blink.BlinkRTCIceCandidate.instance.candidate_Setter_(unwrap_jso(this), value);
   
   @DomName('RTCIceCandidate.sdpMLineIndex')
   @DocsEditable()
@@ -27249,7 +31873,7 @@
   
   @DomName('RTCIceCandidate.sdpMLineIndex')
   @DocsEditable()
-  void set sdpMLineIndex(int value) => _blink.BlinkRTCIceCandidate.instance.sdpMLineIndex_Setter_(unwrap_jso(this), value);
+  set sdpMLineIndex(int value) => _blink.BlinkRTCIceCandidate.instance.sdpMLineIndex_Setter_(unwrap_jso(this), value);
   
   @DomName('RTCIceCandidate.sdpMid')
   @DocsEditable()
@@ -27257,7 +31881,7 @@
   
   @DomName('RTCIceCandidate.sdpMid')
   @DocsEditable()
-  void set sdpMid(String value) => _blink.BlinkRTCIceCandidate.instance.sdpMid_Setter_(unwrap_jso(this), value);
+  set sdpMid(String value) => _blink.BlinkRTCIceCandidate.instance.sdpMid_Setter_(unwrap_jso(this), value);
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -27275,6 +31899,20 @@
   // To suppress missing implicit constructor warnings.
   factory RtcIceCandidateEvent._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static RtcIceCandidateEvent internalCreateRtcIceCandidateEvent() {
+    return new RtcIceCandidateEvent._internalWrap();
+  }
+
+  factory RtcIceCandidateEvent._internalWrap() {
+    return new RtcIceCandidateEvent.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  RtcIceCandidateEvent.internal_() : super.internal_();
+
+
   @DomName('RTCIceCandidateEvent.candidate')
   @DocsEditable()
   RtcIceCandidate get candidate => wrap_jso(_blink.BlinkRTCIceCandidateEvent.instance.candidate_Getter_(unwrap_jso(this)));
@@ -27395,11 +32033,28 @@
   @DocsEditable()
   factory RtcPeerConnection(Map rtcConfiguration, [Map mediaConstraints]) {
     if (mediaConstraints != null) {
-      return _blink.BlinkRTCPeerConnection.instance.constructorCallback_2_(rtcConfiguration, mediaConstraints);
+      var rtcConfiguration_1 = convertDartToNative_Dictionary(rtcConfiguration);
+      var mediaConstraints_2 = convertDartToNative_Dictionary(mediaConstraints);
+      return wrap_jso(_blink.BlinkRTCPeerConnection.instance.constructorCallback_2_(rtcConfiguration_1, mediaConstraints_2));
     }
-    return _blink.BlinkRTCPeerConnection.instance.constructorCallback_1_(rtcConfiguration);
+    var rtcConfiguration_1 = convertDartToNative_Dictionary(rtcConfiguration);
+    return wrap_jso(_blink.BlinkRTCPeerConnection.instance.constructorCallback_1_(rtcConfiguration_1));
   }
 
+
+  @Deprecated("Internal Use Only")
+  static RtcPeerConnection internalCreateRtcPeerConnection() {
+    return new RtcPeerConnection._internalWrap();
+  }
+
+  factory RtcPeerConnection._internalWrap() {
+    return new RtcPeerConnection.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  RtcPeerConnection.internal_() : super.internal_();
+
+
   @DomName('RTCPeerConnection.iceConnectionState')
   @DocsEditable()
   String get iceConnectionState => _blink.BlinkRTCPeerConnection.instance.iceConnectionState_Getter_(unwrap_jso(this));
@@ -27422,11 +32077,11 @@
   
   @DomName('RTCPeerConnection.addIceCandidate')
   @DocsEditable()
-  void addIceCandidate(RtcIceCandidate candidate, VoidCallback successCallback, _RtcErrorCallback failureCallback) => _blink.BlinkRTCPeerConnection.instance.addIceCandidate_Callback_3_(unwrap_jso(this), unwrap_jso(candidate), unwrap_jso(successCallback), unwrap_jso(failureCallback));
+  void addIceCandidate(RtcIceCandidate candidate, VoidCallback successCallback, _RtcErrorCallback failureCallback) => _blink.BlinkRTCPeerConnection.instance.addIceCandidate_Callback_3_(unwrap_jso(this), unwrap_jso(candidate), unwrap_jso(() => successCallback()), unwrap_jso((errorInformation) => failureCallback(errorInformation)));
   
   void addStream(MediaStream stream, [Map mediaConstraints]) {
     if (mediaConstraints != null) {
-      _blink.BlinkRTCPeerConnection.instance.addStream_Callback_2_(unwrap_jso(this), unwrap_jso(stream), mediaConstraints);
+      _blink.BlinkRTCPeerConnection.instance.addStream_Callback_2_(unwrap_jso(this), unwrap_jso(stream), convertDartToNative_Dictionary(mediaConstraints));
       return;
     }
     _blink.BlinkRTCPeerConnection.instance.addStream_Callback_1_(unwrap_jso(this), unwrap_jso(stream));
@@ -27439,44 +32094,44 @@
   
   void _createAnswer(_RtcSessionDescriptionCallback successCallback, [_RtcErrorCallback failureCallback, Map mediaConstraints]) {
     if (mediaConstraints != null) {
-      _blink.BlinkRTCPeerConnection.instance.createAnswer_Callback_3_(unwrap_jso(this), unwrap_jso(successCallback), unwrap_jso(failureCallback), mediaConstraints);
+      _blink.BlinkRTCPeerConnection.instance.createAnswer_Callback_3_(unwrap_jso(this), unwrap_jso((sdp) => successCallback(wrap_jso(sdp))), unwrap_jso((errorInformation) => failureCallback(errorInformation)), convertDartToNative_Dictionary(mediaConstraints));
       return;
     }
-    _blink.BlinkRTCPeerConnection.instance.createAnswer_Callback_2_(unwrap_jso(this), unwrap_jso(successCallback), unwrap_jso(failureCallback));
+    _blink.BlinkRTCPeerConnection.instance.createAnswer_Callback_2_(unwrap_jso(this), unwrap_jso((sdp) => successCallback(wrap_jso(sdp))), unwrap_jso((errorInformation) => failureCallback(errorInformation)));
     return;
   }
 
   @DomName('RTCPeerConnection.createDTMFSender')
   @DocsEditable()
-  RtcDtmfSender createDtmfSender(MediaStreamTrack track) => _blink.BlinkRTCPeerConnection.instance.createDTMFSender_Callback_1_(unwrap_jso(this), unwrap_jso(track));
+  RtcDtmfSender createDtmfSender(MediaStreamTrack track) => wrap_jso(_blink.BlinkRTCPeerConnection.instance.createDTMFSender_Callback_1_(unwrap_jso(this), unwrap_jso(track)));
   
   RtcDataChannel createDataChannel(String label, [Map options]) {
     if (options != null) {
-      return _blink.BlinkRTCPeerConnection.instance.createDataChannel_Callback_2_(unwrap_jso(this), label, options);
+      return wrap_jso(_blink.BlinkRTCPeerConnection.instance.createDataChannel_Callback_2_(unwrap_jso(this), label, convertDartToNative_Dictionary(options)));
     }
-    return _blink.BlinkRTCPeerConnection.instance.createDataChannel_Callback_1_(unwrap_jso(this), label);
+    return wrap_jso(_blink.BlinkRTCPeerConnection.instance.createDataChannel_Callback_1_(unwrap_jso(this), label));
   }
 
   void _createOffer(_RtcSessionDescriptionCallback successCallback, [_RtcErrorCallback failureCallback, Map rtcOfferOptions]) {
     if (rtcOfferOptions != null) {
-      _blink.BlinkRTCPeerConnection.instance.createOffer_Callback_3_(unwrap_jso(this), unwrap_jso(successCallback), unwrap_jso(failureCallback), rtcOfferOptions);
+      _blink.BlinkRTCPeerConnection.instance.createOffer_Callback_3_(unwrap_jso(this), unwrap_jso((sdp) => successCallback(wrap_jso(sdp))), unwrap_jso((errorInformation) => failureCallback(errorInformation)), convertDartToNative_Dictionary(rtcOfferOptions));
       return;
     }
-    _blink.BlinkRTCPeerConnection.instance.createOffer_Callback_2_(unwrap_jso(this), unwrap_jso(successCallback), unwrap_jso(failureCallback));
+    _blink.BlinkRTCPeerConnection.instance.createOffer_Callback_2_(unwrap_jso(this), unwrap_jso((sdp) => successCallback(wrap_jso(sdp))), unwrap_jso((errorInformation) => failureCallback(errorInformation)));
     return;
   }
 
   @DomName('RTCPeerConnection.getLocalStreams')
   @DocsEditable()
-  List<MediaStream> getLocalStreams() => _blink.BlinkRTCPeerConnection.instance.getLocalStreams_Callback_0_(unwrap_jso(this));
+  List<MediaStream> getLocalStreams() => wrap_jso(_blink.BlinkRTCPeerConnection.instance.getLocalStreams_Callback_0_(unwrap_jso(this)));
   
   @DomName('RTCPeerConnection.getRemoteStreams')
   @DocsEditable()
-  List<MediaStream> getRemoteStreams() => _blink.BlinkRTCPeerConnection.instance.getRemoteStreams_Callback_0_(unwrap_jso(this));
+  List<MediaStream> getRemoteStreams() => wrap_jso(_blink.BlinkRTCPeerConnection.instance.getRemoteStreams_Callback_0_(unwrap_jso(this)));
   
   @DomName('RTCPeerConnection.getStats')
   @DocsEditable()
-  void _getStats(RtcStatsCallback successCallback, MediaStreamTrack selector) => _blink.BlinkRTCPeerConnection.instance.getStats_Callback_2_(unwrap_jso(this), unwrap_jso(successCallback), unwrap_jso(selector));
+  void _getStats(RtcStatsCallback successCallback, MediaStreamTrack selector) => _blink.BlinkRTCPeerConnection.instance.getStats_Callback_2_(unwrap_jso(this), unwrap_jso((response) => successCallback(wrap_jso(response))), unwrap_jso(selector));
   
   @DomName('RTCPeerConnection.getStreamById')
   @DocsEditable()
@@ -27488,7 +32143,7 @@
   
   @DomName('RTCPeerConnection.setLocalDescription')
   @DocsEditable()
-  void _setLocalDescription(RtcSessionDescription description, [VoidCallback successCallback, _RtcErrorCallback failureCallback]) => _blink.BlinkRTCPeerConnection.instance.setLocalDescription_Callback_3_(unwrap_jso(this), unwrap_jso(description), unwrap_jso(successCallback), unwrap_jso(failureCallback));
+  void _setLocalDescription(RtcSessionDescription description, [VoidCallback successCallback, _RtcErrorCallback failureCallback]) => _blink.BlinkRTCPeerConnection.instance.setLocalDescription_Callback_3_(unwrap_jso(this), unwrap_jso(description), unwrap_jso(() => successCallback()), unwrap_jso((errorInformation) => failureCallback(errorInformation)));
   
   Future setLocalDescription(RtcSessionDescription description) {
     var completer = new Completer();
@@ -27500,7 +32155,7 @@
 
   @DomName('RTCPeerConnection.setRemoteDescription')
   @DocsEditable()
-  void _setRemoteDescription(RtcSessionDescription description, [VoidCallback successCallback, _RtcErrorCallback failureCallback]) => _blink.BlinkRTCPeerConnection.instance.setRemoteDescription_Callback_3_(unwrap_jso(this), unwrap_jso(description), unwrap_jso(successCallback), unwrap_jso(failureCallback));
+  void _setRemoteDescription(RtcSessionDescription description, [VoidCallback successCallback, _RtcErrorCallback failureCallback]) => _blink.BlinkRTCPeerConnection.instance.setRemoteDescription_Callback_3_(unwrap_jso(this), unwrap_jso(description), unwrap_jso(() => successCallback()), unwrap_jso((errorInformation) => failureCallback(errorInformation)));
   
   Future setRemoteDescription(RtcSessionDescription description) {
     var completer = new Completer();
@@ -27512,11 +32167,11 @@
 
   void updateIce([Map configuration, Map mediaConstraints]) {
     if (mediaConstraints != null) {
-      _blink.BlinkRTCPeerConnection.instance.updateIce_Callback_2_(unwrap_jso(this), configuration, mediaConstraints);
+      _blink.BlinkRTCPeerConnection.instance.updateIce_Callback_2_(unwrap_jso(this), convertDartToNative_Dictionary(configuration), convertDartToNative_Dictionary(mediaConstraints));
       return;
     }
     if (configuration != null) {
-      _blink.BlinkRTCPeerConnection.instance.updateIce_Callback_1_(unwrap_jso(this), configuration);
+      _blink.BlinkRTCPeerConnection.instance.updateIce_Callback_1_(unwrap_jso(this), convertDartToNative_Dictionary(configuration));
       return;
     }
     _blink.BlinkRTCPeerConnection.instance.updateIce_Callback_0_(unwrap_jso(this));
@@ -27571,7 +32226,7 @@
 @SupportedBrowser(SupportedBrowser.CHROME)
 @Experimental()
 // http://dev.w3.org/2011/webrtc/editor/webrtc.html#idl-def-RTCSessionDescription
-class RtcSessionDescription extends NativeFieldWrapperClass2 {
+class RtcSessionDescription extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory RtcSessionDescription._() { throw new UnsupportedError("Not supported"); }
 
@@ -27579,18 +32234,34 @@
   @DocsEditable()
   factory RtcSessionDescription([Map descriptionInitDict]) {
     if (descriptionInitDict != null) {
-      return _blink.BlinkRTCSessionDescription.instance.constructorCallback_1_(descriptionInitDict);
+      var descriptionInitDict_1 = convertDartToNative_Dictionary(descriptionInitDict);
+      return wrap_jso(_blink.BlinkRTCSessionDescription.instance.constructorCallback_1_(descriptionInitDict_1));
     }
-    return _blink.BlinkRTCSessionDescription.instance.constructorCallback_0_();
+    return wrap_jso(_blink.BlinkRTCSessionDescription.instance.constructorCallback_0_());
   }
 
+  @Deprecated("Internal Use Only")
+  static RtcSessionDescription internalCreateRtcSessionDescription() {
+    return new RtcSessionDescription._internalWrap();
+  }
+
+  factory RtcSessionDescription._internalWrap() {
+    return new RtcSessionDescription.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  RtcSessionDescription.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('RTCSessionDescription.sdp')
   @DocsEditable()
   String get sdp => _blink.BlinkRTCSessionDescription.instance.sdp_Getter_(unwrap_jso(this));
   
   @DomName('RTCSessionDescription.sdp')
   @DocsEditable()
-  void set sdp(String value) => _blink.BlinkRTCSessionDescription.instance.sdp_Setter_(unwrap_jso(this), value);
+  set sdp(String value) => _blink.BlinkRTCSessionDescription.instance.sdp_Setter_(unwrap_jso(this), value);
   
   @DomName('RTCSessionDescription.type')
   @DocsEditable()
@@ -27598,7 +32269,7 @@
   
   @DomName('RTCSessionDescription.type')
   @DocsEditable()
-  void set type(String value) => _blink.BlinkRTCSessionDescription.instance.type_Setter_(unwrap_jso(this), value);
+  set type(String value) => _blink.BlinkRTCSessionDescription.instance.type_Setter_(unwrap_jso(this), value);
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -27612,10 +32283,25 @@
 @DomName('RTCStatsReport')
 // http://dev.w3.org/2011/webrtc/editor/webrtc.html#idl-def-RTCStatsReport
 @Experimental()
-class RtcStatsReport extends NativeFieldWrapperClass2 {
+class RtcStatsReport extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory RtcStatsReport._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static RtcStatsReport internalCreateRtcStatsReport() {
+    return new RtcStatsReport._internalWrap();
+  }
+
+  factory RtcStatsReport._internalWrap() {
+    return new RtcStatsReport.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  RtcStatsReport.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('RTCStatsReport.id')
   @DocsEditable()
   String get id => _blink.BlinkRTCStatsReport.instance.id_Getter_(unwrap_jso(this));
@@ -27656,21 +32342,36 @@
 @DomName('RTCStatsResponse')
 // http://dev.w3.org/2011/webrtc/editor/webrtc.html#widl-RTCStatsReport-RTCStats-getter-DOMString-id
 @Experimental()
-class RtcStatsResponse extends NativeFieldWrapperClass2 {
+class RtcStatsResponse extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory RtcStatsResponse._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static RtcStatsResponse internalCreateRtcStatsResponse() {
+    return new RtcStatsResponse._internalWrap();
+  }
+
+  factory RtcStatsResponse._internalWrap() {
+    return new RtcStatsResponse.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  RtcStatsResponse.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('RTCStatsResponse.__getter__')
   @DocsEditable()
-  RtcStatsReport __getter__(String name) => _blink.BlinkRTCStatsResponse.instance.$__getter___Callback_1_(unwrap_jso(this), name);
+  RtcStatsReport __getter__(String name) => wrap_jso(_blink.BlinkRTCStatsResponse.instance.$__getter___Callback_1_(unwrap_jso(this), name));
   
   @DomName('RTCStatsResponse.namedItem')
   @DocsEditable()
-  RtcStatsReport namedItem(String name) => _blink.BlinkRTCStatsResponse.instance.namedItem_Callback_1_(unwrap_jso(this), name);
+  RtcStatsReport namedItem(String name) => wrap_jso(_blink.BlinkRTCStatsResponse.instance.namedItem_Callback_1_(unwrap_jso(this), name));
   
   @DomName('RTCStatsResponse.result')
   @DocsEditable()
-  List<RtcStatsReport> result() => _blink.BlinkRTCStatsResponse.instance.result_Callback_0_(unwrap_jso(this));
+  List<RtcStatsReport> result() => wrap_jso(_blink.BlinkRTCStatsResponse.instance.result_Callback_0_(unwrap_jso(this)));
   
 }
 // Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
@@ -27680,7 +32381,7 @@
 
 @DocsEditable()
 @DomName('Screen')
-class Screen extends NativeFieldWrapperClass2 {
+class Screen extends DartHtmlDomObject {
 
   @DomName('Screen.availHeight')
   @DomName('Screen.availLeft')
@@ -27691,6 +32392,21 @@
   // To suppress missing implicit constructor warnings.
   factory Screen._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static Screen internalCreateScreen() {
+    return new Screen._internalWrap();
+  }
+
+  factory Screen._internalWrap() {
+    return new Screen.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  Screen.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('Screen.availHeight')
   @DocsEditable()
   int get _availHeight => _blink.BlinkScreen.instance.availHeight_Getter_(unwrap_jso(this));
@@ -27749,6 +32465,20 @@
   @Experimental() // untriaged
   static const EventStreamProvider<Event> changeEvent = const EventStreamProvider<Event>('change');
 
+
+  @Deprecated("Internal Use Only")
+  static ScreenOrientation internalCreateScreenOrientation() {
+    return new ScreenOrientation._internalWrap();
+  }
+
+  factory ScreenOrientation._internalWrap() {
+    return new ScreenOrientation.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  ScreenOrientation.internal_() : super.internal_();
+
+
   @DomName('ScreenOrientation.angle')
   @DocsEditable()
   @Experimental() // untriaged
@@ -27762,7 +32492,7 @@
   @DomName('ScreenOrientation.lock')
   @DocsEditable()
   @Experimental() // untriaged
-  Future lock(String orientation) => _blink.BlinkScreenOrientation.instance.lock_Callback_1_(unwrap_jso(this), orientation);
+  Future lock(String orientation) => wrap_jso(_blink.BlinkScreenOrientation.instance.lock_Callback_1_(unwrap_jso(this), orientation));
   
   @DomName('ScreenOrientation.unlock')
   @DocsEditable()
@@ -27791,6 +32521,20 @@
   @DomName('HTMLScriptElement.HTMLScriptElement')
   @DocsEditable()
   factory ScriptElement() => document.createElement("script");
+
+
+  @Deprecated("Internal Use Only")
+  static ScriptElement internalCreateScriptElement() {
+    return new ScriptElement._internalWrap();
+  }
+
+  factory ScriptElement._internalWrap() {
+    return new ScriptElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  ScriptElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -27804,7 +32548,7 @@
   
   @DomName('HTMLScriptElement.async')
   @DocsEditable()
-  void set async(bool value) => _blink.BlinkHTMLScriptElement.instance.async_Setter_(unwrap_jso(this), value);
+  set async(bool value) => _blink.BlinkHTMLScriptElement.instance.async_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLScriptElement.charset')
   @DocsEditable()
@@ -27812,7 +32556,7 @@
   
   @DomName('HTMLScriptElement.charset')
   @DocsEditable()
-  void set charset(String value) => _blink.BlinkHTMLScriptElement.instance.charset_Setter_(unwrap_jso(this), value);
+  set charset(String value) => _blink.BlinkHTMLScriptElement.instance.charset_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLScriptElement.crossOrigin')
   @DocsEditable()
@@ -27824,7 +32568,7 @@
   @DocsEditable()
   // http://www.whatwg.org/specs/web-apps/current-work/multipage/scripting-1.html#attr-script-crossorigin
   @Experimental()
-  void set crossOrigin(String value) => _blink.BlinkHTMLScriptElement.instance.crossOrigin_Setter_(unwrap_jso(this), value);
+  set crossOrigin(String value) => _blink.BlinkHTMLScriptElement.instance.crossOrigin_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLScriptElement.defer')
   @DocsEditable()
@@ -27832,7 +32576,7 @@
   
   @DomName('HTMLScriptElement.defer')
   @DocsEditable()
-  void set defer(bool value) => _blink.BlinkHTMLScriptElement.instance.defer_Setter_(unwrap_jso(this), value);
+  set defer(bool value) => _blink.BlinkHTMLScriptElement.instance.defer_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLScriptElement.integrity')
   @DocsEditable()
@@ -27842,7 +32586,7 @@
   @DomName('HTMLScriptElement.integrity')
   @DocsEditable()
   @Experimental() // untriaged
-  void set integrity(String value) => _blink.BlinkHTMLScriptElement.instance.integrity_Setter_(unwrap_jso(this), value);
+  set integrity(String value) => _blink.BlinkHTMLScriptElement.instance.integrity_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLScriptElement.nonce')
   @DocsEditable()
@@ -27854,7 +32598,7 @@
   @DocsEditable()
   // https://dvcs.w3.org/hg/content-security-policy/raw-file/tip/csp-specification.dev.html#interaction-with-the-script-src-directive
   @Experimental()
-  void set nonce(String value) => _blink.BlinkHTMLScriptElement.instance.nonce_Setter_(unwrap_jso(this), value);
+  set nonce(String value) => _blink.BlinkHTMLScriptElement.instance.nonce_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLScriptElement.src')
   @DocsEditable()
@@ -27862,7 +32606,7 @@
   
   @DomName('HTMLScriptElement.src')
   @DocsEditable()
-  void set src(String value) => _blink.BlinkHTMLScriptElement.instance.src_Setter_(unwrap_jso(this), value);
+  set src(String value) => _blink.BlinkHTMLScriptElement.instance.src_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLScriptElement.type')
   @DocsEditable()
@@ -27870,7 +32614,7 @@
   
   @DomName('HTMLScriptElement.type')
   @DocsEditable()
-  void set type(String value) => _blink.BlinkHTMLScriptElement.instance.type_Setter_(unwrap_jso(this), value);
+  set type(String value) => _blink.BlinkHTMLScriptElement.instance.type_Setter_(unwrap_jso(this), value);
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -27888,6 +32632,20 @@
   // To suppress missing implicit constructor warnings.
   factory SecurityPolicyViolationEvent._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static SecurityPolicyViolationEvent internalCreateSecurityPolicyViolationEvent() {
+    return new SecurityPolicyViolationEvent._internalWrap();
+  }
+
+  factory SecurityPolicyViolationEvent._internalWrap() {
+    return new SecurityPolicyViolationEvent.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  SecurityPolicyViolationEvent.internal_() : super.internal_();
+
+
   @DomName('SecurityPolicyViolationEvent.blockedURI')
   @DocsEditable()
   String get blockedUri => _blink.BlinkSecurityPolicyViolationEvent.instance.blockedURI_Getter_(unwrap_jso(this));
@@ -27943,6 +32701,20 @@
   @DomName('HTMLSelectElement.HTMLSelectElement')
   @DocsEditable()
   factory SelectElement() => document.createElement("select");
+
+
+  @Deprecated("Internal Use Only")
+  static SelectElement internalCreateSelectElement() {
+    return new SelectElement._internalWrap();
+  }
+
+  factory SelectElement._internalWrap() {
+    return new SelectElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  SelectElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -27956,7 +32728,7 @@
   
   @DomName('HTMLSelectElement.autofocus')
   @DocsEditable()
-  void set autofocus(bool value) => _blink.BlinkHTMLSelectElement.instance.autofocus_Setter_(unwrap_jso(this), value);
+  set autofocus(bool value) => _blink.BlinkHTMLSelectElement.instance.autofocus_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLSelectElement.disabled')
   @DocsEditable()
@@ -27964,7 +32736,7 @@
   
   @DomName('HTMLSelectElement.disabled')
   @DocsEditable()
-  void set disabled(bool value) => _blink.BlinkHTMLSelectElement.instance.disabled_Setter_(unwrap_jso(this), value);
+  set disabled(bool value) => _blink.BlinkHTMLSelectElement.instance.disabled_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLSelectElement.form')
   @DocsEditable()
@@ -27973,7 +32745,7 @@
   @DomName('HTMLSelectElement.labels')
   @DocsEditable()
   @Unstable()
-  List<Node> get labels => wrap_jso_list(_blink.BlinkHTMLSelectElement.instance.labels_Getter_(unwrap_jso(this)));
+  List<Node> get labels => wrap_jso(_blink.BlinkHTMLSelectElement.instance.labels_Getter_(unwrap_jso(this)));
   
   @DomName('HTMLSelectElement.length')
   @DocsEditable()
@@ -27981,7 +32753,7 @@
   
   @DomName('HTMLSelectElement.length')
   @DocsEditable()
-  void set length(int value) => _blink.BlinkHTMLSelectElement.instance.length_Setter_(unwrap_jso(this), value);
+  set length(int value) => _blink.BlinkHTMLSelectElement.instance.length_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLSelectElement.multiple')
   @DocsEditable()
@@ -27989,7 +32761,7 @@
   
   @DomName('HTMLSelectElement.multiple')
   @DocsEditable()
-  void set multiple(bool value) => _blink.BlinkHTMLSelectElement.instance.multiple_Setter_(unwrap_jso(this), value);
+  set multiple(bool value) => _blink.BlinkHTMLSelectElement.instance.multiple_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLSelectElement.name')
   @DocsEditable()
@@ -27997,7 +32769,7 @@
   
   @DomName('HTMLSelectElement.name')
   @DocsEditable()
-  void set name(String value) => _blink.BlinkHTMLSelectElement.instance.name_Setter_(unwrap_jso(this), value);
+  set name(String value) => _blink.BlinkHTMLSelectElement.instance.name_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLSelectElement.required')
   @DocsEditable()
@@ -28005,7 +32777,7 @@
   
   @DomName('HTMLSelectElement.required')
   @DocsEditable()
-  void set required(bool value) => _blink.BlinkHTMLSelectElement.instance.required_Setter_(unwrap_jso(this), value);
+  set required(bool value) => _blink.BlinkHTMLSelectElement.instance.required_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLSelectElement.selectedIndex')
   @DocsEditable()
@@ -28013,7 +32785,7 @@
   
   @DomName('HTMLSelectElement.selectedIndex')
   @DocsEditable()
-  void set selectedIndex(int value) => _blink.BlinkHTMLSelectElement.instance.selectedIndex_Setter_(unwrap_jso(this), value);
+  set selectedIndex(int value) => _blink.BlinkHTMLSelectElement.instance.selectedIndex_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLSelectElement.size')
   @DocsEditable()
@@ -28021,7 +32793,7 @@
   
   @DomName('HTMLSelectElement.size')
   @DocsEditable()
-  void set size(int value) => _blink.BlinkHTMLSelectElement.instance.size_Setter_(unwrap_jso(this), value);
+  set size(int value) => _blink.BlinkHTMLSelectElement.instance.size_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLSelectElement.type')
   @DocsEditable()
@@ -28041,7 +32813,7 @@
   
   @DomName('HTMLSelectElement.value')
   @DocsEditable()
-  void set value(String value) => _blink.BlinkHTMLSelectElement.instance.value_Setter_(unwrap_jso(this), value);
+  set value(String value) => _blink.BlinkHTMLSelectElement.instance.value_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLSelectElement.willValidate')
   @DocsEditable()
@@ -28100,10 +32872,25 @@
 
 @DocsEditable()
 @DomName('Selection')
-class Selection extends NativeFieldWrapperClass2 {
+class Selection extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory Selection._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static Selection internalCreateSelection() {
+    return new Selection._internalWrap();
+  }
+
+  factory Selection._internalWrap() {
+    return new Selection.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  Selection.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('Selection.anchorNode')
   @DocsEditable()
   Node get anchorNode => wrap_jso(_blink.BlinkSelection.instance.anchorNode_Getter_(unwrap_jso(this)));
@@ -28239,10 +33026,25 @@
 @DocsEditable()
 @DomName('ServiceWorkerClient')
 @Experimental() // untriaged
-class ServiceWorkerClient extends NativeFieldWrapperClass2 {
+class ServiceWorkerClient extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory ServiceWorkerClient._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static ServiceWorkerClient internalCreateServiceWorkerClient() {
+    return new ServiceWorkerClient._internalWrap();
+  }
+
+  factory ServiceWorkerClient._internalWrap() {
+    return new ServiceWorkerClient.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  ServiceWorkerClient.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('ServiceWorkerClient.id')
   @DocsEditable()
   @Experimental() // untriaged
@@ -28264,15 +33066,30 @@
 @DocsEditable()
 @DomName('ServiceWorkerClients')
 @Experimental() // untriaged
-class ServiceWorkerClients extends NativeFieldWrapperClass2 {
+class ServiceWorkerClients extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory ServiceWorkerClients._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static ServiceWorkerClients internalCreateServiceWorkerClients() {
+    return new ServiceWorkerClients._internalWrap();
+  }
+
+  factory ServiceWorkerClients._internalWrap() {
+    return new ServiceWorkerClients.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  ServiceWorkerClients.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   Future getAll([Map options]) {
     if (options != null) {
-      return _blink.BlinkServiceWorkerClients.instance.getAll_Callback_1_(unwrap_jso(this), options);
+      return wrap_jso(_blink.BlinkServiceWorkerClients.instance.getAll_Callback_1_(unwrap_jso(this), convertDartToNative_Dictionary(options)));
     }
-    return _blink.BlinkServiceWorkerClients.instance.getAll_Callback_0_(unwrap_jso(this));
+    return wrap_jso(_blink.BlinkServiceWorkerClients.instance.getAll_Callback_0_(unwrap_jso(this)));
   }
 
 }
@@ -28286,10 +33103,25 @@
 @DocsEditable()
 @DomName('ServiceWorkerContainer')
 @Experimental() // untriaged
-class ServiceWorkerContainer extends NativeFieldWrapperClass2 {
+class ServiceWorkerContainer extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory ServiceWorkerContainer._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static ServiceWorkerContainer internalCreateServiceWorkerContainer() {
+    return new ServiceWorkerContainer._internalWrap();
+  }
+
+  factory ServiceWorkerContainer._internalWrap() {
+    return new ServiceWorkerContainer.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  ServiceWorkerContainer.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('ServiceWorkerContainer.controller')
   @DocsEditable()
   @Experimental() // untriaged
@@ -28298,20 +33130,20 @@
   @DomName('ServiceWorkerContainer.ready')
   @DocsEditable()
   @Experimental() // untriaged
-  Future get ready => _blink.BlinkServiceWorkerContainer.instance.ready_Getter_(unwrap_jso(this));
+  Future get ready => wrap_jso(_blink.BlinkServiceWorkerContainer.instance.ready_Getter_(unwrap_jso(this)));
   
   Future getRegistration([String documentURL]) {
     if (documentURL != null) {
-      return _blink.BlinkServiceWorkerContainer.instance.getRegistration_Callback_1_(unwrap_jso(this), documentURL);
+      return wrap_jso(_blink.BlinkServiceWorkerContainer.instance.getRegistration_Callback_1_(unwrap_jso(this), documentURL));
     }
-    return _blink.BlinkServiceWorkerContainer.instance.getRegistration_Callback_0_(unwrap_jso(this));
+    return wrap_jso(_blink.BlinkServiceWorkerContainer.instance.getRegistration_Callback_0_(unwrap_jso(this)));
   }
 
   Future register(String url, [Map options]) {
     if (options != null) {
-      return _blink.BlinkServiceWorkerContainer.instance.register_Callback_2_(unwrap_jso(this), url, options);
+      return wrap_jso(_blink.BlinkServiceWorkerContainer.instance.register_Callback_2_(unwrap_jso(this), url, convertDartToNative_Dictionary(options)));
     }
-    return _blink.BlinkServiceWorkerContainer.instance.register_Callback_1_(unwrap_jso(this), url);
+    return wrap_jso(_blink.BlinkServiceWorkerContainer.instance.register_Callback_1_(unwrap_jso(this), url));
   }
 
 }
@@ -28334,6 +33166,20 @@
   @Experimental() // untriaged
   static const EventStreamProvider<MessageEvent> messageEvent = const EventStreamProvider<MessageEvent>('message');
 
+
+  @Deprecated("Internal Use Only")
+  static ServiceWorkerGlobalScope internalCreateServiceWorkerGlobalScope() {
+    return new ServiceWorkerGlobalScope._internalWrap();
+  }
+
+  factory ServiceWorkerGlobalScope._internalWrap() {
+    return new ServiceWorkerGlobalScope.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  ServiceWorkerGlobalScope.internal_() : super.internal_();
+
+
   @DomName('ServiceWorkerGlobalScope.caches')
   @DocsEditable()
   @Experimental() // untriaged
@@ -28356,16 +33202,16 @@
   
   Future _fetch(request, [Map requestInitDict]) {
     if ((request is String || request == null) && requestInitDict == null) {
-      return _blink.BlinkServiceWorkerGlobalScope.instance.fetch_Callback_1_(unwrap_jso(this), unwrap_jso(request));
+      return wrap_jso(_blink.BlinkServiceWorkerGlobalScope.instance.fetch_Callback_1_(unwrap_jso(this), unwrap_jso(request)));
     }
     if ((requestInitDict is Map || requestInitDict == null) && (request is String || request == null)) {
-      return _blink.BlinkServiceWorkerGlobalScope.instance.fetch_Callback_2_(unwrap_jso(this), unwrap_jso(request), requestInitDict);
+      return wrap_jso(_blink.BlinkServiceWorkerGlobalScope.instance.fetch_Callback_2_(unwrap_jso(this), unwrap_jso(request), convertDartToNative_Dictionary(requestInitDict)));
     }
     if ((request is _Request || request == null) && requestInitDict == null) {
-      return _blink.BlinkServiceWorkerGlobalScope.instance.fetch_Callback_1_(unwrap_jso(this), unwrap_jso(request));
+      return wrap_jso(_blink.BlinkServiceWorkerGlobalScope.instance.fetch_Callback_1_(unwrap_jso(this), unwrap_jso(request)));
     }
     if ((requestInitDict is Map || requestInitDict == null) && (request is _Request || request == null)) {
-      return _blink.BlinkServiceWorkerGlobalScope.instance.fetch_Callback_2_(unwrap_jso(this), unwrap_jso(request), requestInitDict);
+      return wrap_jso(_blink.BlinkServiceWorkerGlobalScope.instance.fetch_Callback_2_(unwrap_jso(this), unwrap_jso(request), convertDartToNative_Dictionary(requestInitDict)));
     }
     throw new ArgumentError("Incorrect number or type of arguments");
   }
@@ -28390,6 +33236,20 @@
   // To suppress missing implicit constructor warnings.
   factory ServiceWorkerRegistration._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static ServiceWorkerRegistration internalCreateServiceWorkerRegistration() {
+    return new ServiceWorkerRegistration._internalWrap();
+  }
+
+  factory ServiceWorkerRegistration._internalWrap() {
+    return new ServiceWorkerRegistration.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  ServiceWorkerRegistration.internal_() : super.internal_();
+
+
   @DomName('ServiceWorkerRegistration.active')
   @DocsEditable()
   @Experimental() // untriaged
@@ -28413,7 +33273,7 @@
   @DomName('ServiceWorkerRegistration.unregister')
   @DocsEditable()
   @Experimental() // untriaged
-  Future unregister() => _blink.BlinkServiceWorkerRegistration.instance.unregister_Callback_0_(unwrap_jso(this));
+  Future unregister() => wrap_jso(_blink.BlinkServiceWorkerRegistration.instance.unregister_Callback_0_(unwrap_jso(this)));
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -28435,6 +33295,20 @@
   @DomName('HTMLShadowElement.HTMLShadowElement')
   @DocsEditable()
   factory ShadowElement() => document.createElement("shadow");
+
+
+  @Deprecated("Internal Use Only")
+  static ShadowElement internalCreateShadowElement() {
+    return new ShadowElement._internalWrap();
+  }
+
+  factory ShadowElement._internalWrap() {
+    return new ShadowElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  ShadowElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -28448,7 +33322,7 @@
   @DomName('HTMLShadowElement.getDistributedNodes')
   @DocsEditable()
   @Experimental() // untriaged
-  List<Node> getDistributedNodes() => wrap_jso_list(_blink.BlinkHTMLShadowElement.instance.getDistributedNodes_Callback_0_(unwrap_jso(this)));
+  List<Node> getDistributedNodes() => wrap_jso(_blink.BlinkHTMLShadowElement.instance.getDistributedNodes_Callback_0_(unwrap_jso(this)));
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -28466,6 +33340,20 @@
   // To suppress missing implicit constructor warnings.
   factory ShadowRoot._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static ShadowRoot internalCreateShadowRoot() {
+    return new ShadowRoot._internalWrap();
+  }
+
+  factory ShadowRoot._internalWrap() {
+    return new ShadowRoot.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  ShadowRoot.internal_() : super.internal_();
+
+
   @DomName('ShadowRoot.activeElement')
   @DocsEditable()
   Element get activeElement => wrap_jso(_blink.BlinkShadowRoot.instance.activeElement_Getter_(unwrap_jso(this)));
@@ -28481,7 +33369,7 @@
   
   @DomName('ShadowRoot.innerHTML')
   @DocsEditable()
-  void set innerHtml(String value) => _blink.BlinkShadowRoot.instance.innerHTML_Setter_(unwrap_jso(this), value);
+  set innerHtml(String value) => _blink.BlinkShadowRoot.instance.innerHTML_Setter_(unwrap_jso(this), value);
   
   @DomName('ShadowRoot.olderShadowRoot')
   @DocsEditable()
@@ -28491,7 +33379,7 @@
   @DomName('ShadowRoot.styleSheets')
   @DocsEditable()
   @Experimental() // untriaged
-  List<StyleSheet> get styleSheets => wrap_jso_list(_blink.BlinkShadowRoot.instance.styleSheets_Getter_(unwrap_jso(this)));
+  List<StyleSheet> get styleSheets => wrap_jso(_blink.BlinkShadowRoot.instance.styleSheets_Getter_(unwrap_jso(this)));
   
   @DomName('ShadowRoot.cloneNode')
   @DocsEditable()
@@ -28507,11 +33395,11 @@
   
   @DomName('ShadowRoot.getElementsByClassName')
   @DocsEditable()
-  List<Node> getElementsByClassName(String className) => wrap_jso_list(_blink.BlinkShadowRoot.instance.getElementsByClassName_Callback_1_(unwrap_jso(this), className));
+  List<Node> getElementsByClassName(String className) => wrap_jso(_blink.BlinkShadowRoot.instance.getElementsByClassName_Callback_1_(unwrap_jso(this), className));
   
   @DomName('ShadowRoot.getElementsByTagName')
   @DocsEditable()
-  List<Node> getElementsByTagName(String tagName) => wrap_jso_list(_blink.BlinkShadowRoot.instance.getElementsByTagName_Callback_1_(unwrap_jso(this), tagName));
+  List<Node> getElementsByTagName(String tagName) => wrap_jso(_blink.BlinkShadowRoot.instance.getElementsByTagName_Callback_1_(unwrap_jso(this), tagName));
   
   @DomName('ShadowRoot.getSelection')
   @DocsEditable()
@@ -28538,7 +33426,7 @@
   }
 
   @deprecated
-  void set resetStyleInheritance(bool value) {
+  set resetStyleInheritance(bool value) {
     _shadowRootDeprecationReport();
   }
 
@@ -28550,7 +33438,7 @@
   }
 
   @deprecated
-  void set applyAuthorStyles(bool value) {
+  set applyAuthorStyles(bool value) {
     _shadowRootDeprecationReport();
   }
 }
@@ -28577,9 +33465,23 @@
   @DomName('SharedWorker.SharedWorker')
   @DocsEditable()
   factory SharedWorker(String scriptURL, [String name]) {
-    return _blink.BlinkSharedWorker.instance.constructorCallback_2_(scriptURL, name);
+    return wrap_jso(_blink.BlinkSharedWorker.instance.constructorCallback_2_(scriptURL, name));
   }
 
+
+  @Deprecated("Internal Use Only")
+  static SharedWorker internalCreateSharedWorker() {
+    return new SharedWorker._internalWrap();
+  }
+
+  factory SharedWorker._internalWrap() {
+    return new SharedWorker.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  SharedWorker.internal_() : super.internal_();
+
+
   @DomName('SharedWorker.port')
   @DocsEditable()
   MessagePort get port => wrap_jso(_blink.BlinkSharedWorker.instance.port_Getter_(unwrap_jso(this)));
@@ -28587,7 +33489,7 @@
   @DomName('SharedWorker.workerStart')
   @DocsEditable()
   @Experimental() // untriaged
-  double get workerStart => _blink.BlinkSharedWorker.instance.workerStart_Getter_(unwrap_jso(this));
+  num get workerStart => _blink.BlinkSharedWorker.instance.workerStart_Getter_(unwrap_jso(this));
   
   @DomName('SharedWorker.onerror')
   @DocsEditable()
@@ -28620,6 +33522,20 @@
   @Experimental() // untriaged
   static const EventStreamProvider<Event> connectEvent = const EventStreamProvider<Event>('connect');
 
+
+  @Deprecated("Internal Use Only")
+  static SharedWorkerGlobalScope internalCreateSharedWorkerGlobalScope() {
+    return new SharedWorkerGlobalScope._internalWrap();
+  }
+
+  factory SharedWorkerGlobalScope._internalWrap() {
+    return new SharedWorkerGlobalScope.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  SharedWorkerGlobalScope.internal_() : super.internal_();
+
+
   @DomName('SharedWorkerGlobalScope.name')
   @DocsEditable()
   @Experimental() // untriaged
@@ -28647,6 +33563,20 @@
   // To suppress missing implicit constructor warnings.
   factory SourceBuffer._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static SourceBuffer internalCreateSourceBuffer() {
+    return new SourceBuffer._internalWrap();
+  }
+
+  factory SourceBuffer._internalWrap() {
+    return new SourceBuffer.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  SourceBuffer.internal_() : super.internal_();
+
+
   @DomName('SourceBuffer.appendWindowEnd')
   @DocsEditable()
   @Experimental() // untriaged
@@ -28655,7 +33585,7 @@
   @DomName('SourceBuffer.appendWindowEnd')
   @DocsEditable()
   @Experimental() // untriaged
-  void set appendWindowEnd(num value) => _blink.BlinkSourceBuffer.instance.appendWindowEnd_Setter_(unwrap_jso(this), value);
+  set appendWindowEnd(num value) => _blink.BlinkSourceBuffer.instance.appendWindowEnd_Setter_(unwrap_jso(this), value);
   
   @DomName('SourceBuffer.appendWindowStart')
   @DocsEditable()
@@ -28665,7 +33595,7 @@
   @DomName('SourceBuffer.appendWindowStart')
   @DocsEditable()
   @Experimental() // untriaged
-  void set appendWindowStart(num value) => _blink.BlinkSourceBuffer.instance.appendWindowStart_Setter_(unwrap_jso(this), value);
+  set appendWindowStart(num value) => _blink.BlinkSourceBuffer.instance.appendWindowStart_Setter_(unwrap_jso(this), value);
   
   @DomName('SourceBuffer.buffered')
   @DocsEditable()
@@ -28679,7 +33609,7 @@
   @DomName('SourceBuffer.mode')
   @DocsEditable()
   @Experimental() // untriaged
-  void set mode(String value) => _blink.BlinkSourceBuffer.instance.mode_Setter_(unwrap_jso(this), value);
+  set mode(String value) => _blink.BlinkSourceBuffer.instance.mode_Setter_(unwrap_jso(this), value);
   
   @DomName('SourceBuffer.timestampOffset')
   @DocsEditable()
@@ -28687,7 +33617,7 @@
   
   @DomName('SourceBuffer.timestampOffset')
   @DocsEditable()
-  void set timestampOffset(num value) => _blink.BlinkSourceBuffer.instance.timestampOffset_Setter_(unwrap_jso(this), value);
+  set timestampOffset(num value) => _blink.BlinkSourceBuffer.instance.timestampOffset_Setter_(unwrap_jso(this), value);
   
   @DomName('SourceBuffer.updating')
   @DocsEditable()
@@ -28738,6 +33668,20 @@
   // To suppress missing implicit constructor warnings.
   factory SourceBufferList._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static SourceBufferList internalCreateSourceBufferList() {
+    return new SourceBufferList._internalWrap();
+  }
+
+  factory SourceBufferList._internalWrap() {
+    return new SourceBufferList.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  SourceBufferList.internal_() : super.internal_();
+
+
   @DomName('SourceBufferList.length')
   @DocsEditable()
   int get length => _blink.BlinkSourceBufferList.instance.length_Getter_(unwrap_jso(this));
@@ -28749,7 +33693,7 @@
   }
 
   SourceBuffer _nativeIndexedGetter(int index) => wrap_jso(_blink.BlinkSourceBufferList.instance.item_Callback_1_(unwrap_jso(this), index));
- 
+
   void operator[]=(int index, SourceBuffer value) {
     throw new UnsupportedError("Cannot assign element of immutable List.");
   }
@@ -28757,7 +33701,7 @@
   // SourceBuffer is the element type.
 
 
-  void set length(int value) {
+  set length(int value) {
     throw new UnsupportedError("Cannot resize immutable List.");
   }
 
@@ -28809,6 +33753,20 @@
   @DomName('HTMLSourceElement.HTMLSourceElement')
   @DocsEditable()
   factory SourceElement() => document.createElement("source");
+
+
+  @Deprecated("Internal Use Only")
+  static SourceElement internalCreateSourceElement() {
+    return new SourceElement._internalWrap();
+  }
+
+  factory SourceElement._internalWrap() {
+    return new SourceElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  SourceElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -28824,7 +33782,7 @@
   @DomName('HTMLSourceElement.integrity')
   @DocsEditable()
   @Experimental() // untriaged
-  void set integrity(String value) => _blink.BlinkHTMLSourceElement.instance.integrity_Setter_(unwrap_jso(this), value);
+  set integrity(String value) => _blink.BlinkHTMLSourceElement.instance.integrity_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLSourceElement.media')
   @DocsEditable()
@@ -28832,7 +33790,7 @@
   
   @DomName('HTMLSourceElement.media')
   @DocsEditable()
-  void set media(String value) => _blink.BlinkHTMLSourceElement.instance.media_Setter_(unwrap_jso(this), value);
+  set media(String value) => _blink.BlinkHTMLSourceElement.instance.media_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLSourceElement.sizes')
   @DocsEditable()
@@ -28842,7 +33800,7 @@
   @DomName('HTMLSourceElement.sizes')
   @DocsEditable()
   @Experimental() // untriaged
-  void set sizes(String value) => _blink.BlinkHTMLSourceElement.instance.sizes_Setter_(unwrap_jso(this), value);
+  set sizes(String value) => _blink.BlinkHTMLSourceElement.instance.sizes_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLSourceElement.src')
   @DocsEditable()
@@ -28850,7 +33808,7 @@
   
   @DomName('HTMLSourceElement.src')
   @DocsEditable()
-  void set src(String value) => _blink.BlinkHTMLSourceElement.instance.src_Setter_(unwrap_jso(this), value);
+  set src(String value) => _blink.BlinkHTMLSourceElement.instance.src_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLSourceElement.srcset')
   @DocsEditable()
@@ -28860,7 +33818,7 @@
   @DomName('HTMLSourceElement.srcset')
   @DocsEditable()
   @Experimental() // untriaged
-  void set srcset(String value) => _blink.BlinkHTMLSourceElement.instance.srcset_Setter_(unwrap_jso(this), value);
+  set srcset(String value) => _blink.BlinkHTMLSourceElement.instance.srcset_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLSourceElement.type')
   @DocsEditable()
@@ -28868,7 +33826,7 @@
   
   @DomName('HTMLSourceElement.type')
   @DocsEditable()
-  void set type(String value) => _blink.BlinkHTMLSourceElement.instance.type_Setter_(unwrap_jso(this), value);
+  set type(String value) => _blink.BlinkHTMLSourceElement.instance.type_Setter_(unwrap_jso(this), value);
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -28881,10 +33839,25 @@
 @DocsEditable()
 @DomName('SourceInfo')
 @Experimental() // untriaged
-class SourceInfo extends NativeFieldWrapperClass2 {
+class SourceInfo extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory SourceInfo._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static SourceInfo internalCreateSourceInfo() {
+    return new SourceInfo._internalWrap();
+  }
+
+  factory SourceInfo._internalWrap() {
+    return new SourceInfo.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  SourceInfo.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('SourceInfo.facing')
   @DocsEditable()
   @Experimental() // untriaged
@@ -28922,6 +33895,20 @@
   @DomName('HTMLSpanElement.HTMLSpanElement')
   @DocsEditable()
   factory SpanElement() => document.createElement("span");
+
+
+  @Deprecated("Internal Use Only")
+  static SpanElement internalCreateSpanElement() {
+    return new SpanElement._internalWrap();
+  }
+
+  factory SpanElement._internalWrap() {
+    return new SpanElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  SpanElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -28941,23 +33928,38 @@
 @DomName('SpeechGrammar')
 // https://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html#dfn-speechgrammar
 @Experimental()
-class SpeechGrammar extends NativeFieldWrapperClass2 {
+class SpeechGrammar extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory SpeechGrammar._() { throw new UnsupportedError("Not supported"); }
 
   @DomName('SpeechGrammar.SpeechGrammar')
   @DocsEditable()
   factory SpeechGrammar() {
-    return _blink.BlinkSpeechGrammar.instance.constructorCallback_0_();
+    return wrap_jso(_blink.BlinkSpeechGrammar.instance.constructorCallback_0_());
   }
 
+  @Deprecated("Internal Use Only")
+  static SpeechGrammar internalCreateSpeechGrammar() {
+    return new SpeechGrammar._internalWrap();
+  }
+
+  factory SpeechGrammar._internalWrap() {
+    return new SpeechGrammar.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  SpeechGrammar.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('SpeechGrammar.src')
   @DocsEditable()
   String get src => _blink.BlinkSpeechGrammar.instance.src_Getter_(unwrap_jso(this));
   
   @DomName('SpeechGrammar.src')
   @DocsEditable()
-  void set src(String value) => _blink.BlinkSpeechGrammar.instance.src_Setter_(unwrap_jso(this), value);
+  set src(String value) => _blink.BlinkSpeechGrammar.instance.src_Setter_(unwrap_jso(this), value);
   
   @DomName('SpeechGrammar.weight')
   @DocsEditable()
@@ -28965,7 +33967,7 @@
   
   @DomName('SpeechGrammar.weight')
   @DocsEditable()
-  void set weight(num value) => _blink.BlinkSpeechGrammar.instance.weight_Setter_(unwrap_jso(this), value);
+  set weight(num value) => _blink.BlinkSpeechGrammar.instance.weight_Setter_(unwrap_jso(this), value);
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -28979,16 +33981,31 @@
 @DomName('SpeechGrammarList')
 // https://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html#dfn-speechgrammarlist
 @Experimental()
-class SpeechGrammarList extends NativeFieldWrapperClass2 with ListMixin<SpeechGrammar>, ImmutableListMixin<SpeechGrammar> implements List<SpeechGrammar> {
+class SpeechGrammarList extends DartHtmlDomObject with ListMixin<SpeechGrammar>, ImmutableListMixin<SpeechGrammar> implements List<SpeechGrammar> {
   // To suppress missing implicit constructor warnings.
   factory SpeechGrammarList._() { throw new UnsupportedError("Not supported"); }
 
   @DomName('SpeechGrammarList.SpeechGrammarList')
   @DocsEditable()
   factory SpeechGrammarList() {
-    return _blink.BlinkSpeechGrammarList.instance.constructorCallback_0_();
+    return wrap_jso(_blink.BlinkSpeechGrammarList.instance.constructorCallback_0_());
   }
 
+  @Deprecated("Internal Use Only")
+  static SpeechGrammarList internalCreateSpeechGrammarList() {
+    return new SpeechGrammarList._internalWrap();
+  }
+
+  factory SpeechGrammarList._internalWrap() {
+    return new SpeechGrammarList.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  SpeechGrammarList.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('SpeechGrammarList.length')
   @DocsEditable()
   int get length => _blink.BlinkSpeechGrammarList.instance.length_Getter_(unwrap_jso(this));
@@ -29000,7 +34017,7 @@
   }
 
   SpeechGrammar _nativeIndexedGetter(int index) => wrap_jso(_blink.BlinkSpeechGrammarList.instance.item_Callback_1_(unwrap_jso(this), index));
- 
+
   void operator[]=(int index, SpeechGrammar value) {
     throw new UnsupportedError("Cannot assign element of immutable List.");
   }
@@ -29008,7 +34025,7 @@
   // SpeechGrammar is the element type.
 
 
-  void set length(int value) {
+  set length(int value) {
     throw new UnsupportedError("Cannot resize immutable List.");
   }
 
@@ -29191,9 +34208,23 @@
   @DomName('SpeechRecognition.SpeechRecognition')
   @DocsEditable()
   factory SpeechRecognition() {
-    return _blink.BlinkSpeechRecognition.instance.constructorCallback_0_();
+    return wrap_jso(_blink.BlinkSpeechRecognition.instance.constructorCallback_0_());
   }
 
+
+  @Deprecated("Internal Use Only")
+  static SpeechRecognition internalCreateSpeechRecognition() {
+    return new SpeechRecognition._internalWrap();
+  }
+
+  factory SpeechRecognition._internalWrap() {
+    return new SpeechRecognition.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  SpeechRecognition.internal_() : super.internal_();
+
+
   /// Checks if this type is supported on the current platform.
   static bool get supported => true;
 
@@ -29203,7 +34234,7 @@
   
   @DomName('SpeechRecognition.continuous')
   @DocsEditable()
-  void set continuous(bool value) => _blink.BlinkSpeechRecognition.instance.continuous_Setter_(unwrap_jso(this), value);
+  set continuous(bool value) => _blink.BlinkSpeechRecognition.instance.continuous_Setter_(unwrap_jso(this), value);
   
   @DomName('SpeechRecognition.grammars')
   @DocsEditable()
@@ -29211,7 +34242,7 @@
   
   @DomName('SpeechRecognition.grammars')
   @DocsEditable()
-  void set grammars(SpeechGrammarList value) => _blink.BlinkSpeechRecognition.instance.grammars_Setter_(unwrap_jso(this), unwrap_jso(value));
+  set grammars(SpeechGrammarList value) => _blink.BlinkSpeechRecognition.instance.grammars_Setter_(unwrap_jso(this), unwrap_jso(value));
   
   @DomName('SpeechRecognition.interimResults')
   @DocsEditable()
@@ -29219,7 +34250,7 @@
   
   @DomName('SpeechRecognition.interimResults')
   @DocsEditable()
-  void set interimResults(bool value) => _blink.BlinkSpeechRecognition.instance.interimResults_Setter_(unwrap_jso(this), value);
+  set interimResults(bool value) => _blink.BlinkSpeechRecognition.instance.interimResults_Setter_(unwrap_jso(this), value);
   
   @DomName('SpeechRecognition.lang')
   @DocsEditable()
@@ -29227,7 +34258,7 @@
   
   @DomName('SpeechRecognition.lang')
   @DocsEditable()
-  void set lang(String value) => _blink.BlinkSpeechRecognition.instance.lang_Setter_(unwrap_jso(this), value);
+  set lang(String value) => _blink.BlinkSpeechRecognition.instance.lang_Setter_(unwrap_jso(this), value);
   
   @DomName('SpeechRecognition.maxAlternatives')
   @DocsEditable()
@@ -29235,7 +34266,7 @@
   
   @DomName('SpeechRecognition.maxAlternatives')
   @DocsEditable()
-  void set maxAlternatives(int value) => _blink.BlinkSpeechRecognition.instance.maxAlternatives_Setter_(unwrap_jso(this), value);
+  set maxAlternatives(int value) => _blink.BlinkSpeechRecognition.instance.maxAlternatives_Setter_(unwrap_jso(this), value);
   
   @DomName('SpeechRecognition.abort')
   @DocsEditable()
@@ -29317,13 +34348,28 @@
 @SupportedBrowser(SupportedBrowser.CHROME, '25')
 @Experimental()
 // https://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html#speechrecognitionalternative
-class SpeechRecognitionAlternative extends NativeFieldWrapperClass2 {
+class SpeechRecognitionAlternative extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory SpeechRecognitionAlternative._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static SpeechRecognitionAlternative internalCreateSpeechRecognitionAlternative() {
+    return new SpeechRecognitionAlternative._internalWrap();
+  }
+
+  factory SpeechRecognitionAlternative._internalWrap() {
+    return new SpeechRecognitionAlternative.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  SpeechRecognitionAlternative.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('SpeechRecognitionAlternative.confidence')
   @DocsEditable()
-  double get confidence => _blink.BlinkSpeechRecognitionAlternative.instance.confidence_Getter_(unwrap_jso(this));
+  num get confidence => _blink.BlinkSpeechRecognitionAlternative.instance.confidence_Getter_(unwrap_jso(this));
   
   @DomName('SpeechRecognitionAlternative.transcript')
   @DocsEditable()
@@ -29346,6 +34392,20 @@
   // To suppress missing implicit constructor warnings.
   factory SpeechRecognitionError._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static SpeechRecognitionError internalCreateSpeechRecognitionError() {
+    return new SpeechRecognitionError._internalWrap();
+  }
+
+  factory SpeechRecognitionError._internalWrap() {
+    return new SpeechRecognitionError.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  SpeechRecognitionError.internal_() : super.internal_();
+
+
   @DomName('SpeechRecognitionError.error')
   @DocsEditable()
   String get error => _blink.BlinkSpeechRecognitionError.instance.error_Getter_(unwrap_jso(this));
@@ -29371,6 +34431,20 @@
   // To suppress missing implicit constructor warnings.
   factory SpeechRecognitionEvent._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static SpeechRecognitionEvent internalCreateSpeechRecognitionEvent() {
+    return new SpeechRecognitionEvent._internalWrap();
+  }
+
+  factory SpeechRecognitionEvent._internalWrap() {
+    return new SpeechRecognitionEvent.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  SpeechRecognitionEvent.internal_() : super.internal_();
+
+
   @DomName('SpeechRecognitionEvent.emma')
   @DocsEditable()
   Document get emma => wrap_jso(_blink.BlinkSpeechRecognitionEvent.instance.emma_Getter_(unwrap_jso(this)));
@@ -29385,7 +34459,7 @@
   
   @DomName('SpeechRecognitionEvent.results')
   @DocsEditable()
-  List<SpeechRecognitionResult> get results => wrap_jso_list(_blink.BlinkSpeechRecognitionEvent.instance.results_Getter_(unwrap_jso(this)));
+  List<SpeechRecognitionResult> get results => wrap_jso(_blink.BlinkSpeechRecognitionEvent.instance.results_Getter_(unwrap_jso(this)));
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -29400,10 +34474,25 @@
 @SupportedBrowser(SupportedBrowser.CHROME, '25')
 @Experimental()
 // https://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html#speechrecognitionresult
-class SpeechRecognitionResult extends NativeFieldWrapperClass2 {
+class SpeechRecognitionResult extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory SpeechRecognitionResult._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static SpeechRecognitionResult internalCreateSpeechRecognitionResult() {
+    return new SpeechRecognitionResult._internalWrap();
+  }
+
+  factory SpeechRecognitionResult._internalWrap() {
+    return new SpeechRecognitionResult.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  SpeechRecognitionResult.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('SpeechRecognitionResult.isFinal')
   @DocsEditable()
   bool get isFinal => _blink.BlinkSpeechRecognitionResult.instance.isFinal_Getter_(unwrap_jso(this));
@@ -29432,6 +34521,20 @@
   // To suppress missing implicit constructor warnings.
   factory SpeechSynthesis._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static SpeechSynthesis internalCreateSpeechSynthesis() {
+    return new SpeechSynthesis._internalWrap();
+  }
+
+  factory SpeechSynthesis._internalWrap() {
+    return new SpeechSynthesis.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  SpeechSynthesis.internal_() : super.internal_();
+
+
   @DomName('SpeechSynthesis.paused')
   @DocsEditable()
   bool get paused => _blink.BlinkSpeechSynthesis.instance.paused_Getter_(unwrap_jso(this));
@@ -29450,7 +34553,7 @@
   
   @DomName('SpeechSynthesis.getVoices')
   @DocsEditable()
-  List<SpeechSynthesisVoice> getVoices() => _blink.BlinkSpeechSynthesis.instance.getVoices_Callback_0_(unwrap_jso(this));
+  List<SpeechSynthesisVoice> getVoices() => wrap_jso(_blink.BlinkSpeechSynthesis.instance.getVoices_Callback_0_(unwrap_jso(this)));
   
   @DomName('SpeechSynthesis.pause')
   @DocsEditable()
@@ -29480,13 +34583,27 @@
   // To suppress missing implicit constructor warnings.
   factory SpeechSynthesisEvent._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static SpeechSynthesisEvent internalCreateSpeechSynthesisEvent() {
+    return new SpeechSynthesisEvent._internalWrap();
+  }
+
+  factory SpeechSynthesisEvent._internalWrap() {
+    return new SpeechSynthesisEvent.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  SpeechSynthesisEvent.internal_() : super.internal_();
+
+
   @DomName('SpeechSynthesisEvent.charIndex')
   @DocsEditable()
   int get charIndex => _blink.BlinkSpeechSynthesisEvent.instance.charIndex_Getter_(unwrap_jso(this));
   
   @DomName('SpeechSynthesisEvent.elapsedTime')
   @DocsEditable()
-  double get elapsedTime => _blink.BlinkSpeechSynthesisEvent.instance.elapsedTime_Getter_(unwrap_jso(this));
+  num get elapsedTime => _blink.BlinkSpeechSynthesisEvent.instance.elapsedTime_Getter_(unwrap_jso(this));
   
   @DomName('SpeechSynthesisEvent.name')
   @DocsEditable()
@@ -29581,16 +34698,30 @@
   @DomName('SpeechSynthesisUtterance.SpeechSynthesisUtterance')
   @DocsEditable()
   factory SpeechSynthesisUtterance([String text]) {
-    return _blink.BlinkSpeechSynthesisUtterance.instance.constructorCallback_1_(text);
+    return wrap_jso(_blink.BlinkSpeechSynthesisUtterance.instance.constructorCallback_1_(text));
   }
 
+
+  @Deprecated("Internal Use Only")
+  static SpeechSynthesisUtterance internalCreateSpeechSynthesisUtterance() {
+    return new SpeechSynthesisUtterance._internalWrap();
+  }
+
+  factory SpeechSynthesisUtterance._internalWrap() {
+    return new SpeechSynthesisUtterance.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  SpeechSynthesisUtterance.internal_() : super.internal_();
+
+
   @DomName('SpeechSynthesisUtterance.lang')
   @DocsEditable()
   String get lang => _blink.BlinkSpeechSynthesisUtterance.instance.lang_Getter_(unwrap_jso(this));
   
   @DomName('SpeechSynthesisUtterance.lang')
   @DocsEditable()
-  void set lang(String value) => _blink.BlinkSpeechSynthesisUtterance.instance.lang_Setter_(unwrap_jso(this), value);
+  set lang(String value) => _blink.BlinkSpeechSynthesisUtterance.instance.lang_Setter_(unwrap_jso(this), value);
   
   @DomName('SpeechSynthesisUtterance.pitch')
   @DocsEditable()
@@ -29598,7 +34729,7 @@
   
   @DomName('SpeechSynthesisUtterance.pitch')
   @DocsEditable()
-  void set pitch(num value) => _blink.BlinkSpeechSynthesisUtterance.instance.pitch_Setter_(unwrap_jso(this), value);
+  set pitch(num value) => _blink.BlinkSpeechSynthesisUtterance.instance.pitch_Setter_(unwrap_jso(this), value);
   
   @DomName('SpeechSynthesisUtterance.rate')
   @DocsEditable()
@@ -29606,7 +34737,7 @@
   
   @DomName('SpeechSynthesisUtterance.rate')
   @DocsEditable()
-  void set rate(num value) => _blink.BlinkSpeechSynthesisUtterance.instance.rate_Setter_(unwrap_jso(this), value);
+  set rate(num value) => _blink.BlinkSpeechSynthesisUtterance.instance.rate_Setter_(unwrap_jso(this), value);
   
   @DomName('SpeechSynthesisUtterance.text')
   @DocsEditable()
@@ -29614,7 +34745,7 @@
   
   @DomName('SpeechSynthesisUtterance.text')
   @DocsEditable()
-  void set text(String value) => _blink.BlinkSpeechSynthesisUtterance.instance.text_Setter_(unwrap_jso(this), value);
+  set text(String value) => _blink.BlinkSpeechSynthesisUtterance.instance.text_Setter_(unwrap_jso(this), value);
   
   @DomName('SpeechSynthesisUtterance.voice')
   @DocsEditable()
@@ -29622,7 +34753,7 @@
   
   @DomName('SpeechSynthesisUtterance.voice')
   @DocsEditable()
-  void set voice(SpeechSynthesisVoice value) => _blink.BlinkSpeechSynthesisUtterance.instance.voice_Setter_(unwrap_jso(this), unwrap_jso(value));
+  set voice(SpeechSynthesisVoice value) => _blink.BlinkSpeechSynthesisUtterance.instance.voice_Setter_(unwrap_jso(this), unwrap_jso(value));
   
   @DomName('SpeechSynthesisUtterance.volume')
   @DocsEditable()
@@ -29630,7 +34761,7 @@
   
   @DomName('SpeechSynthesisUtterance.volume')
   @DocsEditable()
-  void set volume(num value) => _blink.BlinkSpeechSynthesisUtterance.instance.volume_Setter_(unwrap_jso(this), value);
+  set volume(num value) => _blink.BlinkSpeechSynthesisUtterance.instance.volume_Setter_(unwrap_jso(this), value);
   
   /// Stream of `boundary` events handled by this [SpeechSynthesisUtterance].
   @DomName('SpeechSynthesisUtterance.onboundary')
@@ -29679,10 +34810,25 @@
 @DomName('SpeechSynthesisVoice')
 // https://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html#tts-section
 @Experimental()
-class SpeechSynthesisVoice extends NativeFieldWrapperClass2 {
+class SpeechSynthesisVoice extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory SpeechSynthesisVoice._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static SpeechSynthesisVoice internalCreateSpeechSynthesisVoice() {
+    return new SpeechSynthesisVoice._internalWrap();
+  }
+
+  factory SpeechSynthesisVoice._internalWrap() {
+    return new SpeechSynthesisVoice.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  SpeechSynthesisVoice.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('SpeechSynthesisVoice.default')
   @DocsEditable()
   bool get defaultValue => _blink.BlinkSpeechSynthesisVoice.instance.default_Getter_(unwrap_jso(this));
@@ -29736,7 +34882,7 @@
  */
 @DomName('Storage')
 @Unstable()
-class Storage extends NativeFieldWrapperClass2
+class Storage extends DartHtmlDomObject
     implements Map<String, String> {
 
   void addAll(Map<String, String> other) {
@@ -29794,6 +34940,21 @@
   // To suppress missing implicit constructor warnings.
   factory Storage._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static Storage internalCreateStorage() {
+    return new Storage._internalWrap();
+  }
+
+  factory Storage._internalWrap() {
+    return new Storage.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  Storage.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('Storage.length')
   @DocsEditable()
   int get _length => _blink.BlinkStorage.instance.length_Getter_(unwrap_jso(this));
@@ -29884,6 +35045,20 @@
   // To suppress missing implicit constructor warnings.
   factory StorageEvent._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static StorageEvent internalCreateStorageEvent() {
+    return new StorageEvent._internalWrap();
+  }
+
+  factory StorageEvent._internalWrap() {
+    return new StorageEvent.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  StorageEvent.internal_() : super.internal_();
+
+
   @DomName('StorageEvent.key')
   @DocsEditable()
   String get key => _blink.BlinkStorageEvent.instance.key_Getter_(unwrap_jso(this));
@@ -29920,10 +35095,25 @@
 @DomName('StorageInfo')
 // http://www.w3.org/TR/file-system-api/
 @Experimental()
-class StorageInfo extends NativeFieldWrapperClass2 {
+class StorageInfo extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory StorageInfo._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static StorageInfo internalCreateStorageInfo() {
+    return new StorageInfo._internalWrap();
+  }
+
+  factory StorageInfo._internalWrap() {
+    return new StorageInfo.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  StorageInfo.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('StorageInfo.quota')
   @DocsEditable()
   @Experimental() // untriaged
@@ -29946,24 +35136,39 @@
 @DomName('StorageQuota')
 // http://www.w3.org/TR/quota-api/#idl-def-StorageQuota
 @Experimental()
-class StorageQuota extends NativeFieldWrapperClass2 {
+class StorageQuota extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory StorageQuota._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static StorageQuota internalCreateStorageQuota() {
+    return new StorageQuota._internalWrap();
+  }
+
+  factory StorageQuota._internalWrap() {
+    return new StorageQuota.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  StorageQuota.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('StorageQuota.supportedTypes')
   @DocsEditable()
   @Experimental() // untriaged
-  List<String> get supportedTypes => _blink.BlinkStorageQuota.instance.supportedTypes_Getter_(unwrap_jso(this));
+  List<String> get supportedTypes => wrap_jso(_blink.BlinkStorageQuota.instance.supportedTypes_Getter_(unwrap_jso(this)));
   
   @DomName('StorageQuota.queryInfo')
   @DocsEditable()
   @Experimental() // untriaged
-  Future queryInfo(String type) => _blink.BlinkStorageQuota.instance.queryInfo_Callback_1_(unwrap_jso(this), type);
+  Future queryInfo(String type) => wrap_jso(_blink.BlinkStorageQuota.instance.queryInfo_Callback_1_(unwrap_jso(this), type));
   
   @DomName('StorageQuota.requestPersistentQuota')
   @DocsEditable()
   @Experimental() // untriaged
-  Future requestPersistentQuota(int newQuota) => _blink.BlinkStorageQuota.instance.requestPersistentQuota_Callback_1_(unwrap_jso(this), newQuota);
+  Future requestPersistentQuota(int newQuota) => wrap_jso(_blink.BlinkStorageQuota.instance.requestPersistentQuota_Callback_1_(unwrap_jso(this), newQuota));
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -30015,6 +35220,20 @@
   @DomName('HTMLStyleElement.HTMLStyleElement')
   @DocsEditable()
   factory StyleElement() => document.createElement("style");
+
+
+  @Deprecated("Internal Use Only")
+  static StyleElement internalCreateStyleElement() {
+    return new StyleElement._internalWrap();
+  }
+
+  factory StyleElement._internalWrap() {
+    return new StyleElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  StyleElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -30028,7 +35247,7 @@
   
   @DomName('HTMLStyleElement.disabled')
   @DocsEditable()
-  void set disabled(bool value) => _blink.BlinkHTMLStyleElement.instance.disabled_Setter_(unwrap_jso(this), value);
+  set disabled(bool value) => _blink.BlinkHTMLStyleElement.instance.disabled_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLStyleElement.media')
   @DocsEditable()
@@ -30036,7 +35255,7 @@
   
   @DomName('HTMLStyleElement.media')
   @DocsEditable()
-  void set media(String value) => _blink.BlinkHTMLStyleElement.instance.media_Setter_(unwrap_jso(this), value);
+  set media(String value) => _blink.BlinkHTMLStyleElement.instance.media_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLStyleElement.sheet')
   @DocsEditable()
@@ -30048,7 +35267,7 @@
   
   @DomName('HTMLStyleElement.type')
   @DocsEditable()
-  void set type(String value) => _blink.BlinkHTMLStyleElement.instance.type_Setter_(unwrap_jso(this), value);
+  set type(String value) => _blink.BlinkHTMLStyleElement.instance.type_Setter_(unwrap_jso(this), value);
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -30062,10 +35281,25 @@
 @DomName('StyleMedia')
 // http://developer.apple.com/library/safari/#documentation/SafariDOMAdditions/Reference/StyleMedia/StyleMedia/StyleMedia.html
 @Experimental() // nonstandard
-class StyleMedia extends NativeFieldWrapperClass2 {
+class StyleMedia extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory StyleMedia._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static StyleMedia internalCreateStyleMedia() {
+    return new StyleMedia._internalWrap();
+  }
+
+  factory StyleMedia._internalWrap() {
+    return new StyleMedia.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  StyleMedia.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('StyleMedia.type')
   @DocsEditable()
   String get type => _blink.BlinkStyleMedia.instance.type_Getter_(unwrap_jso(this));
@@ -30084,17 +35318,32 @@
 
 @DocsEditable()
 @DomName('StyleSheet')
-class StyleSheet extends NativeFieldWrapperClass2 {
+class StyleSheet extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory StyleSheet._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static StyleSheet internalCreateStyleSheet() {
+    return new StyleSheet._internalWrap();
+  }
+
+  factory StyleSheet._internalWrap() {
+    return new StyleSheet.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  StyleSheet.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('StyleSheet.disabled')
   @DocsEditable()
   bool get disabled => _blink.BlinkStyleSheet.instance.disabled_Getter_(unwrap_jso(this));
   
   @DomName('StyleSheet.disabled')
   @DocsEditable()
-  void set disabled(bool value) => _blink.BlinkStyleSheet.instance.disabled_Setter_(unwrap_jso(this), value);
+  set disabled(bool value) => _blink.BlinkStyleSheet.instance.disabled_Setter_(unwrap_jso(this), value);
   
   @DomName('StyleSheet.href')
   @DocsEditable()
@@ -30137,6 +35386,20 @@
   @DomName('HTMLTableCaptionElement.HTMLTableCaptionElement')
   @DocsEditable()
   factory TableCaptionElement() => document.createElement("caption");
+
+
+  @Deprecated("Internal Use Only")
+  static TableCaptionElement internalCreateTableCaptionElement() {
+    return new TableCaptionElement._internalWrap();
+  }
+
+  factory TableCaptionElement._internalWrap() {
+    return new TableCaptionElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  TableCaptionElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -30161,6 +35424,20 @@
   @DomName('HTMLTableCellElement.HTMLTableCellElement')
   @DocsEditable()
   factory TableCellElement() => document.createElement("td");
+
+
+  @Deprecated("Internal Use Only")
+  static TableCellElement internalCreateTableCellElement() {
+    return new TableCellElement._internalWrap();
+  }
+
+  factory TableCellElement._internalWrap() {
+    return new TableCellElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  TableCellElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -30178,7 +35455,7 @@
   
   @DomName('HTMLTableCellElement.colSpan')
   @DocsEditable()
-  void set colSpan(int value) => _blink.BlinkHTMLTableCellElement.instance.colSpan_Setter_(unwrap_jso(this), value);
+  set colSpan(int value) => _blink.BlinkHTMLTableCellElement.instance.colSpan_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLTableCellElement.headers')
   @DocsEditable()
@@ -30186,7 +35463,7 @@
   
   @DomName('HTMLTableCellElement.headers')
   @DocsEditable()
-  void set headers(String value) => _blink.BlinkHTMLTableCellElement.instance.headers_Setter_(unwrap_jso(this), value);
+  set headers(String value) => _blink.BlinkHTMLTableCellElement.instance.headers_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLTableCellElement.rowSpan')
   @DocsEditable()
@@ -30194,7 +35471,7 @@
   
   @DomName('HTMLTableCellElement.rowSpan')
   @DocsEditable()
-  void set rowSpan(int value) => _blink.BlinkHTMLTableCellElement.instance.rowSpan_Setter_(unwrap_jso(this), value);
+  set rowSpan(int value) => _blink.BlinkHTMLTableCellElement.instance.rowSpan_Setter_(unwrap_jso(this), value);
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -30213,6 +35490,20 @@
   @DomName('HTMLTableColElement.HTMLTableColElement')
   @DocsEditable()
   factory TableColElement() => document.createElement("col");
+
+
+  @Deprecated("Internal Use Only")
+  static TableColElement internalCreateTableColElement() {
+    return new TableColElement._internalWrap();
+  }
+
+  factory TableColElement._internalWrap() {
+    return new TableColElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  TableColElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -30226,7 +35517,7 @@
   
   @DomName('HTMLTableColElement.span')
   @DocsEditable()
-  void set span(int value) => _blink.BlinkHTMLTableColElement.instance.span_Setter_(unwrap_jso(this), value);
+  set span(int value) => _blink.BlinkHTMLTableColElement.instance.span_Setter_(unwrap_jso(this), value);
   
 }
 // Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
@@ -30263,6 +35554,20 @@
   @DomName('HTMLTableElement.HTMLTableElement')
   @DocsEditable()
   factory TableElement() => document.createElement("table");
+
+
+  @Deprecated("Internal Use Only")
+  static TableElement internalCreateTableElement() {
+    return new TableElement._internalWrap();
+  }
+
+  factory TableElement._internalWrap() {
+    return new TableElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  TableElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -30276,15 +35581,15 @@
   
   @DomName('HTMLTableElement.caption')
   @DocsEditable()
-  void set caption(TableCaptionElement value) => _blink.BlinkHTMLTableElement.instance.caption_Setter_(unwrap_jso(this), unwrap_jso(value));
+  set caption(TableCaptionElement value) => _blink.BlinkHTMLTableElement.instance.caption_Setter_(unwrap_jso(this), unwrap_jso(value));
   
   @DomName('HTMLTableElement.rows')
   @DocsEditable()
-  List<Node> get _rows => wrap_jso_list(_blink.BlinkHTMLTableElement.instance.rows_Getter_(unwrap_jso(this)));
+  List<Node> get _rows => wrap_jso(_blink.BlinkHTMLTableElement.instance.rows_Getter_(unwrap_jso(this)));
   
   @DomName('HTMLTableElement.tBodies')
   @DocsEditable()
-  List<Node> get _tBodies => wrap_jso_list(_blink.BlinkHTMLTableElement.instance.tBodies_Getter_(unwrap_jso(this)));
+  List<Node> get _tBodies => wrap_jso(_blink.BlinkHTMLTableElement.instance.tBodies_Getter_(unwrap_jso(this)));
   
   @DomName('HTMLTableElement.tFoot')
   @DocsEditable()
@@ -30292,7 +35597,7 @@
   
   @DomName('HTMLTableElement.tFoot')
   @DocsEditable()
-  void set tFoot(TableSectionElement value) => _blink.BlinkHTMLTableElement.instance.tFoot_Setter_(unwrap_jso(this), unwrap_jso(value));
+  set tFoot(TableSectionElement value) => _blink.BlinkHTMLTableElement.instance.tFoot_Setter_(unwrap_jso(this), unwrap_jso(value));
   
   @DomName('HTMLTableElement.tHead')
   @DocsEditable()
@@ -30300,7 +35605,7 @@
   
   @DomName('HTMLTableElement.tHead')
   @DocsEditable()
-  void set tHead(TableSectionElement value) => _blink.BlinkHTMLTableElement.instance.tHead_Setter_(unwrap_jso(this), unwrap_jso(value));
+  set tHead(TableSectionElement value) => _blink.BlinkHTMLTableElement.instance.tHead_Setter_(unwrap_jso(this), unwrap_jso(value));
   
   @DomName('HTMLTableElement.createCaption')
   @DocsEditable()
@@ -30336,9 +35641,9 @@
   
   HtmlElement _insertRow([int index]) {
     if (index != null) {
-      return _blink.BlinkHTMLTableElement.instance.insertRow_Callback_1_(unwrap_jso(this), index);
+      return wrap_jso(_blink.BlinkHTMLTableElement.instance.insertRow_Callback_1_(unwrap_jso(this), index));
     }
-    return _blink.BlinkHTMLTableElement.instance.insertRow_Callback_0_(unwrap_jso(this));
+    return wrap_jso(_blink.BlinkHTMLTableElement.instance.insertRow_Callback_0_(unwrap_jso(this)));
   }
 }
 // Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
@@ -30367,6 +35672,20 @@
   @DomName('HTMLTableRowElement.HTMLTableRowElement')
   @DocsEditable()
   factory TableRowElement() => document.createElement("tr");
+
+
+  @Deprecated("Internal Use Only")
+  static TableRowElement internalCreateTableRowElement() {
+    return new TableRowElement._internalWrap();
+  }
+
+  factory TableRowElement._internalWrap() {
+    return new TableRowElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  TableRowElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -30376,7 +35695,7 @@
 
   @DomName('HTMLTableRowElement.cells')
   @DocsEditable()
-  List<Node> get _cells => wrap_jso_list(_blink.BlinkHTMLTableRowElement.instance.cells_Getter_(unwrap_jso(this)));
+  List<Node> get _cells => wrap_jso(_blink.BlinkHTMLTableRowElement.instance.cells_Getter_(unwrap_jso(this)));
   
   @DomName('HTMLTableRowElement.rowIndex')
   @DocsEditable()
@@ -30392,9 +35711,9 @@
   
   HtmlElement _insertCell([int index]) {
     if (index != null) {
-      return _blink.BlinkHTMLTableRowElement.instance.insertCell_Callback_1_(unwrap_jso(this), index);
+      return wrap_jso(_blink.BlinkHTMLTableRowElement.instance.insertCell_Callback_1_(unwrap_jso(this), index));
     }
-    return _blink.BlinkHTMLTableRowElement.instance.insertCell_Callback_0_(unwrap_jso(this));
+    return wrap_jso(_blink.BlinkHTMLTableRowElement.instance.insertCell_Callback_0_(unwrap_jso(this)));
   }
 }
 // Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
@@ -30419,6 +35738,20 @@
 
   // To suppress missing implicit constructor warnings.
   factory TableSectionElement._() { throw new UnsupportedError("Not supported"); }
+
+
+  @Deprecated("Internal Use Only")
+  static TableSectionElement internalCreateTableSectionElement() {
+    return new TableSectionElement._internalWrap();
+  }
+
+  factory TableSectionElement._internalWrap() {
+    return new TableSectionElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  TableSectionElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -30428,7 +35761,7 @@
 
   @DomName('HTMLTableSectionElement.rows')
   @DocsEditable()
-  List<Node> get _rows => wrap_jso_list(_blink.BlinkHTMLTableSectionElement.instance.rows_Getter_(unwrap_jso(this)));
+  List<Node> get _rows => wrap_jso(_blink.BlinkHTMLTableSectionElement.instance.rows_Getter_(unwrap_jso(this)));
   
   @DomName('HTMLTableSectionElement.deleteRow')
   @DocsEditable()
@@ -30436,9 +35769,9 @@
   
   HtmlElement _insertRow([int index]) {
     if (index != null) {
-      return _blink.BlinkHTMLTableSectionElement.instance.insertRow_Callback_1_(unwrap_jso(this), index);
+      return wrap_jso(_blink.BlinkHTMLTableSectionElement.instance.insertRow_Callback_1_(unwrap_jso(this), index));
     }
-    return _blink.BlinkHTMLTableSectionElement.instance.insertRow_Callback_0_(unwrap_jso(this));
+    return wrap_jso(_blink.BlinkHTMLTableSectionElement.instance.insertRow_Callback_0_(unwrap_jso(this)));
   }
 }
 // Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
@@ -30460,6 +35793,20 @@
   @DomName('HTMLTemplateElement.HTMLTemplateElement')
   @DocsEditable()
   factory TemplateElement() => document.createElement("template");
+
+
+  @Deprecated("Internal Use Only")
+  static TemplateElement internalCreateTemplateElement() {
+    return new TemplateElement._internalWrap();
+  }
+
+  factory TemplateElement._internalWrap() {
+    return new TemplateElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  TemplateElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -30504,6 +35851,20 @@
   // To suppress missing implicit constructor warnings.
   factory Text._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static Text internalCreateText() {
+    return new Text._internalWrap();
+  }
+
+  factory Text._internalWrap() {
+    return new Text.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  Text.internal_() : super.internal_();
+
+
   @DomName('Text.wholeText')
   @DocsEditable()
   String get wholeText => _blink.BlinkText.instance.wholeText_Getter_(unwrap_jso(this));
@@ -30511,7 +35872,7 @@
   @DomName('Text.getDestinationInsertionPoints')
   @DocsEditable()
   @Experimental() // untriaged
-  List<Node> getDestinationInsertionPoints() => wrap_jso_list(_blink.BlinkText.instance.getDestinationInsertionPoints_Callback_0_(unwrap_jso(this)));
+  List<Node> getDestinationInsertionPoints() => wrap_jso(_blink.BlinkText.instance.getDestinationInsertionPoints_Callback_0_(unwrap_jso(this)));
   
   @DomName('Text.splitText')
   @DocsEditable()
@@ -30534,6 +35895,20 @@
   @DomName('HTMLTextAreaElement.HTMLTextAreaElement')
   @DocsEditable()
   factory TextAreaElement() => document.createElement("textarea");
+
+
+  @Deprecated("Internal Use Only")
+  static TextAreaElement internalCreateTextAreaElement() {
+    return new TextAreaElement._internalWrap();
+  }
+
+  factory TextAreaElement._internalWrap() {
+    return new TextAreaElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  TextAreaElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -30547,7 +35922,7 @@
   
   @DomName('HTMLTextAreaElement.autofocus')
   @DocsEditable()
-  void set autofocus(bool value) => _blink.BlinkHTMLTextAreaElement.instance.autofocus_Setter_(unwrap_jso(this), value);
+  set autofocus(bool value) => _blink.BlinkHTMLTextAreaElement.instance.autofocus_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLTextAreaElement.cols')
   @DocsEditable()
@@ -30555,7 +35930,7 @@
   
   @DomName('HTMLTextAreaElement.cols')
   @DocsEditable()
-  void set cols(int value) => _blink.BlinkHTMLTextAreaElement.instance.cols_Setter_(unwrap_jso(this), value);
+  set cols(int value) => _blink.BlinkHTMLTextAreaElement.instance.cols_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLTextAreaElement.defaultValue')
   @DocsEditable()
@@ -30563,7 +35938,7 @@
   
   @DomName('HTMLTextAreaElement.defaultValue')
   @DocsEditable()
-  void set defaultValue(String value) => _blink.BlinkHTMLTextAreaElement.instance.defaultValue_Setter_(unwrap_jso(this), value);
+  set defaultValue(String value) => _blink.BlinkHTMLTextAreaElement.instance.defaultValue_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLTextAreaElement.dirName')
   @DocsEditable()
@@ -30575,7 +35950,7 @@
   @DocsEditable()
   // http://www.whatwg.org/specs/web-apps/current-work/multipage/the-button-element.html#dom-textarea-dirname
   @Experimental()
-  void set dirName(String value) => _blink.BlinkHTMLTextAreaElement.instance.dirName_Setter_(unwrap_jso(this), value);
+  set dirName(String value) => _blink.BlinkHTMLTextAreaElement.instance.dirName_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLTextAreaElement.disabled')
   @DocsEditable()
@@ -30583,7 +35958,7 @@
   
   @DomName('HTMLTextAreaElement.disabled')
   @DocsEditable()
-  void set disabled(bool value) => _blink.BlinkHTMLTextAreaElement.instance.disabled_Setter_(unwrap_jso(this), value);
+  set disabled(bool value) => _blink.BlinkHTMLTextAreaElement.instance.disabled_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLTextAreaElement.form')
   @DocsEditable()
@@ -30597,12 +35972,12 @@
   @DomName('HTMLTextAreaElement.inputMode')
   @DocsEditable()
   @Experimental() // untriaged
-  void set inputMode(String value) => _blink.BlinkHTMLTextAreaElement.instance.inputMode_Setter_(unwrap_jso(this), value);
+  set inputMode(String value) => _blink.BlinkHTMLTextAreaElement.instance.inputMode_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLTextAreaElement.labels')
   @DocsEditable()
   @Unstable()
-  List<Node> get labels => wrap_jso_list(_blink.BlinkHTMLTextAreaElement.instance.labels_Getter_(unwrap_jso(this)));
+  List<Node> get labels => wrap_jso(_blink.BlinkHTMLTextAreaElement.instance.labels_Getter_(unwrap_jso(this)));
   
   @DomName('HTMLTextAreaElement.maxLength')
   @DocsEditable()
@@ -30610,7 +35985,7 @@
   
   @DomName('HTMLTextAreaElement.maxLength')
   @DocsEditable()
-  void set maxLength(int value) => _blink.BlinkHTMLTextAreaElement.instance.maxLength_Setter_(unwrap_jso(this), value);
+  set maxLength(int value) => _blink.BlinkHTMLTextAreaElement.instance.maxLength_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLTextAreaElement.name')
   @DocsEditable()
@@ -30618,7 +35993,7 @@
   
   @DomName('HTMLTextAreaElement.name')
   @DocsEditable()
-  void set name(String value) => _blink.BlinkHTMLTextAreaElement.instance.name_Setter_(unwrap_jso(this), value);
+  set name(String value) => _blink.BlinkHTMLTextAreaElement.instance.name_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLTextAreaElement.placeholder')
   @DocsEditable()
@@ -30626,7 +36001,7 @@
   
   @DomName('HTMLTextAreaElement.placeholder')
   @DocsEditable()
-  void set placeholder(String value) => _blink.BlinkHTMLTextAreaElement.instance.placeholder_Setter_(unwrap_jso(this), value);
+  set placeholder(String value) => _blink.BlinkHTMLTextAreaElement.instance.placeholder_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLTextAreaElement.readOnly')
   @DocsEditable()
@@ -30634,7 +36009,7 @@
   
   @DomName('HTMLTextAreaElement.readOnly')
   @DocsEditable()
-  void set readOnly(bool value) => _blink.BlinkHTMLTextAreaElement.instance.readOnly_Setter_(unwrap_jso(this), value);
+  set readOnly(bool value) => _blink.BlinkHTMLTextAreaElement.instance.readOnly_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLTextAreaElement.required')
   @DocsEditable()
@@ -30642,7 +36017,7 @@
   
   @DomName('HTMLTextAreaElement.required')
   @DocsEditable()
-  void set required(bool value) => _blink.BlinkHTMLTextAreaElement.instance.required_Setter_(unwrap_jso(this), value);
+  set required(bool value) => _blink.BlinkHTMLTextAreaElement.instance.required_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLTextAreaElement.rows')
   @DocsEditable()
@@ -30650,7 +36025,7 @@
   
   @DomName('HTMLTextAreaElement.rows')
   @DocsEditable()
-  void set rows(int value) => _blink.BlinkHTMLTextAreaElement.instance.rows_Setter_(unwrap_jso(this), value);
+  set rows(int value) => _blink.BlinkHTMLTextAreaElement.instance.rows_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLTextAreaElement.selectionDirection')
   @DocsEditable()
@@ -30658,7 +36033,7 @@
   
   @DomName('HTMLTextAreaElement.selectionDirection')
   @DocsEditable()
-  void set selectionDirection(String value) => _blink.BlinkHTMLTextAreaElement.instance.selectionDirection_Setter_(unwrap_jso(this), value);
+  set selectionDirection(String value) => _blink.BlinkHTMLTextAreaElement.instance.selectionDirection_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLTextAreaElement.selectionEnd')
   @DocsEditable()
@@ -30666,7 +36041,7 @@
   
   @DomName('HTMLTextAreaElement.selectionEnd')
   @DocsEditable()
-  void set selectionEnd(int value) => _blink.BlinkHTMLTextAreaElement.instance.selectionEnd_Setter_(unwrap_jso(this), value);
+  set selectionEnd(int value) => _blink.BlinkHTMLTextAreaElement.instance.selectionEnd_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLTextAreaElement.selectionStart')
   @DocsEditable()
@@ -30674,7 +36049,7 @@
   
   @DomName('HTMLTextAreaElement.selectionStart')
   @DocsEditable()
-  void set selectionStart(int value) => _blink.BlinkHTMLTextAreaElement.instance.selectionStart_Setter_(unwrap_jso(this), value);
+  set selectionStart(int value) => _blink.BlinkHTMLTextAreaElement.instance.selectionStart_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLTextAreaElement.textLength')
   @DocsEditable()
@@ -30698,7 +36073,7 @@
   
   @DomName('HTMLTextAreaElement.value')
   @DocsEditable()
-  void set value(String value) => _blink.BlinkHTMLTextAreaElement.instance.value_Setter_(unwrap_jso(this), value);
+  set value(String value) => _blink.BlinkHTMLTextAreaElement.instance.value_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLTextAreaElement.willValidate')
   @DocsEditable()
@@ -30710,7 +36085,7 @@
   
   @DomName('HTMLTextAreaElement.wrap')
   @DocsEditable()
-  void set wrap(String value) => _blink.BlinkHTMLTextAreaElement.instance.wrap_Setter_(unwrap_jso(this), value);
+  set wrap(String value) => _blink.BlinkHTMLTextAreaElement.instance.wrap_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLTextAreaElement.checkValidity')
   @DocsEditable()
@@ -30768,6 +36143,20 @@
   // To suppress missing implicit constructor warnings.
   factory TextEvent._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static TextEvent internalCreateTextEvent() {
+    return new TextEvent._internalWrap();
+  }
+
+  factory TextEvent._internalWrap() {
+    return new TextEvent.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  TextEvent.internal_() : super.internal_();
+
+
   @DomName('TextEvent.data')
   @DocsEditable()
   String get data => _blink.BlinkTextEvent.instance.data_Getter_(unwrap_jso(this));
@@ -30786,68 +36175,83 @@
 
 @DocsEditable()
 @DomName('TextMetrics')
-class TextMetrics extends NativeFieldWrapperClass2 {
+class TextMetrics extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory TextMetrics._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static TextMetrics internalCreateTextMetrics() {
+    return new TextMetrics._internalWrap();
+  }
+
+  factory TextMetrics._internalWrap() {
+    return new TextMetrics.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  TextMetrics.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('TextMetrics.actualBoundingBoxAscent')
   @DocsEditable()
   @Experimental() // untriaged
-  double get actualBoundingBoxAscent => _blink.BlinkTextMetrics.instance.actualBoundingBoxAscent_Getter_(unwrap_jso(this));
+  num get actualBoundingBoxAscent => _blink.BlinkTextMetrics.instance.actualBoundingBoxAscent_Getter_(unwrap_jso(this));
   
   @DomName('TextMetrics.actualBoundingBoxDescent')
   @DocsEditable()
   @Experimental() // untriaged
-  double get actualBoundingBoxDescent => _blink.BlinkTextMetrics.instance.actualBoundingBoxDescent_Getter_(unwrap_jso(this));
+  num get actualBoundingBoxDescent => _blink.BlinkTextMetrics.instance.actualBoundingBoxDescent_Getter_(unwrap_jso(this));
   
   @DomName('TextMetrics.actualBoundingBoxLeft')
   @DocsEditable()
   @Experimental() // untriaged
-  double get actualBoundingBoxLeft => _blink.BlinkTextMetrics.instance.actualBoundingBoxLeft_Getter_(unwrap_jso(this));
+  num get actualBoundingBoxLeft => _blink.BlinkTextMetrics.instance.actualBoundingBoxLeft_Getter_(unwrap_jso(this));
   
   @DomName('TextMetrics.actualBoundingBoxRight')
   @DocsEditable()
   @Experimental() // untriaged
-  double get actualBoundingBoxRight => _blink.BlinkTextMetrics.instance.actualBoundingBoxRight_Getter_(unwrap_jso(this));
+  num get actualBoundingBoxRight => _blink.BlinkTextMetrics.instance.actualBoundingBoxRight_Getter_(unwrap_jso(this));
   
   @DomName('TextMetrics.alphabeticBaseline')
   @DocsEditable()
   @Experimental() // untriaged
-  double get alphabeticBaseline => _blink.BlinkTextMetrics.instance.alphabeticBaseline_Getter_(unwrap_jso(this));
+  num get alphabeticBaseline => _blink.BlinkTextMetrics.instance.alphabeticBaseline_Getter_(unwrap_jso(this));
   
   @DomName('TextMetrics.emHeightAscent')
   @DocsEditable()
   @Experimental() // untriaged
-  double get emHeightAscent => _blink.BlinkTextMetrics.instance.emHeightAscent_Getter_(unwrap_jso(this));
+  num get emHeightAscent => _blink.BlinkTextMetrics.instance.emHeightAscent_Getter_(unwrap_jso(this));
   
   @DomName('TextMetrics.emHeightDescent')
   @DocsEditable()
   @Experimental() // untriaged
-  double get emHeightDescent => _blink.BlinkTextMetrics.instance.emHeightDescent_Getter_(unwrap_jso(this));
+  num get emHeightDescent => _blink.BlinkTextMetrics.instance.emHeightDescent_Getter_(unwrap_jso(this));
   
   @DomName('TextMetrics.fontBoundingBoxAscent')
   @DocsEditable()
   @Experimental() // untriaged
-  double get fontBoundingBoxAscent => _blink.BlinkTextMetrics.instance.fontBoundingBoxAscent_Getter_(unwrap_jso(this));
+  num get fontBoundingBoxAscent => _blink.BlinkTextMetrics.instance.fontBoundingBoxAscent_Getter_(unwrap_jso(this));
   
   @DomName('TextMetrics.fontBoundingBoxDescent')
   @DocsEditable()
   @Experimental() // untriaged
-  double get fontBoundingBoxDescent => _blink.BlinkTextMetrics.instance.fontBoundingBoxDescent_Getter_(unwrap_jso(this));
+  num get fontBoundingBoxDescent => _blink.BlinkTextMetrics.instance.fontBoundingBoxDescent_Getter_(unwrap_jso(this));
   
   @DomName('TextMetrics.hangingBaseline')
   @DocsEditable()
   @Experimental() // untriaged
-  double get hangingBaseline => _blink.BlinkTextMetrics.instance.hangingBaseline_Getter_(unwrap_jso(this));
+  num get hangingBaseline => _blink.BlinkTextMetrics.instance.hangingBaseline_Getter_(unwrap_jso(this));
   
   @DomName('TextMetrics.ideographicBaseline')
   @DocsEditable()
   @Experimental() // untriaged
-  double get ideographicBaseline => _blink.BlinkTextMetrics.instance.ideographicBaseline_Getter_(unwrap_jso(this));
+  num get ideographicBaseline => _blink.BlinkTextMetrics.instance.ideographicBaseline_Getter_(unwrap_jso(this));
   
   @DomName('TextMetrics.width')
   @DocsEditable()
-  double get width => _blink.BlinkTextMetrics.instance.width_Getter_(unwrap_jso(this));
+  num get width => _blink.BlinkTextMetrics.instance.width_Getter_(unwrap_jso(this));
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -30875,6 +36279,20 @@
   @DocsEditable()
   static const EventStreamProvider<Event> cueChangeEvent = const EventStreamProvider<Event>('cuechange');
 
+
+  @Deprecated("Internal Use Only")
+  static TextTrack internalCreateTextTrack() {
+    return new TextTrack._internalWrap();
+  }
+
+  factory TextTrack._internalWrap() {
+    return new TextTrack.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  TextTrack.internal_() : super.internal_();
+
+
   @DomName('TextTrack.activeCues')
   @DocsEditable()
   TextTrackCueList get activeCues => wrap_jso(_blink.BlinkTextTrack.instance.activeCues_Getter_(unwrap_jso(this)));
@@ -30906,7 +36324,7 @@
   
   @DomName('TextTrack.mode')
   @DocsEditable()
-  void set mode(String value) => _blink.BlinkTextTrack.instance.mode_Setter_(unwrap_jso(this), value);
+  set mode(String value) => _blink.BlinkTextTrack.instance.mode_Setter_(unwrap_jso(this), value);
   
   @DomName('TextTrack.regions')
   @DocsEditable()
@@ -30972,13 +36390,27 @@
   @DocsEditable()
   static const EventStreamProvider<Event> exitEvent = const EventStreamProvider<Event>('exit');
 
+
+  @Deprecated("Internal Use Only")
+  static TextTrackCue internalCreateTextTrackCue() {
+    return new TextTrackCue._internalWrap();
+  }
+
+  factory TextTrackCue._internalWrap() {
+    return new TextTrackCue.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  TextTrackCue.internal_() : super.internal_();
+
+
   @DomName('TextTrackCue.endTime')
   @DocsEditable()
   num get endTime => _blink.BlinkTextTrackCue.instance.endTime_Getter_(unwrap_jso(this));
   
   @DomName('TextTrackCue.endTime')
   @DocsEditable()
-  void set endTime(num value) => _blink.BlinkTextTrackCue.instance.endTime_Setter_(unwrap_jso(this), value);
+  set endTime(num value) => _blink.BlinkTextTrackCue.instance.endTime_Setter_(unwrap_jso(this), value);
   
   @DomName('TextTrackCue.id')
   @DocsEditable()
@@ -30986,7 +36418,7 @@
   
   @DomName('TextTrackCue.id')
   @DocsEditable()
-  void set id(String value) => _blink.BlinkTextTrackCue.instance.id_Setter_(unwrap_jso(this), value);
+  set id(String value) => _blink.BlinkTextTrackCue.instance.id_Setter_(unwrap_jso(this), value);
   
   @DomName('TextTrackCue.pauseOnExit')
   @DocsEditable()
@@ -30994,7 +36426,7 @@
   
   @DomName('TextTrackCue.pauseOnExit')
   @DocsEditable()
-  void set pauseOnExit(bool value) => _blink.BlinkTextTrackCue.instance.pauseOnExit_Setter_(unwrap_jso(this), value);
+  set pauseOnExit(bool value) => _blink.BlinkTextTrackCue.instance.pauseOnExit_Setter_(unwrap_jso(this), value);
   
   @DomName('TextTrackCue.startTime')
   @DocsEditable()
@@ -31002,7 +36434,7 @@
   
   @DomName('TextTrackCue.startTime')
   @DocsEditable()
-  void set startTime(num value) => _blink.BlinkTextTrackCue.instance.startTime_Setter_(unwrap_jso(this), value);
+  set startTime(num value) => _blink.BlinkTextTrackCue.instance.startTime_Setter_(unwrap_jso(this), value);
   
   @DomName('TextTrackCue.track')
   @DocsEditable()
@@ -31030,10 +36462,25 @@
 @DomName('TextTrackCueList')
 // http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#texttrackcuelist
 @Experimental()
-class TextTrackCueList extends NativeFieldWrapperClass2 with ListMixin<TextTrackCue>, ImmutableListMixin<TextTrackCue> implements List<TextTrackCue> {
+class TextTrackCueList extends DartHtmlDomObject with ListMixin<TextTrackCue>, ImmutableListMixin<TextTrackCue> implements List<TextTrackCue> {
   // To suppress missing implicit constructor warnings.
   factory TextTrackCueList._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static TextTrackCueList internalCreateTextTrackCueList() {
+    return new TextTrackCueList._internalWrap();
+  }
+
+  factory TextTrackCueList._internalWrap() {
+    return new TextTrackCueList.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  TextTrackCueList.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('TextTrackCueList.length')
   @DocsEditable()
   int get length => _blink.BlinkTextTrackCueList.instance.length_Getter_(unwrap_jso(this));
@@ -31045,7 +36492,7 @@
   }
 
   TextTrackCue _nativeIndexedGetter(int index) => wrap_jso(_blink.BlinkTextTrackCueList.instance.item_Callback_1_(unwrap_jso(this), index));
- 
+
   void operator[]=(int index, TextTrackCue value) {
     throw new UnsupportedError("Cannot assign element of immutable List.");
   }
@@ -31053,7 +36500,7 @@
   // TextTrackCue is the element type.
 
 
-  void set length(int value) {
+  set length(int value) {
     throw new UnsupportedError("Cannot resize immutable List.");
   }
 
@@ -31123,6 +36570,20 @@
   @Experimental() // untriaged
   static const EventStreamProvider<Event> changeEvent = const EventStreamProvider<Event>('change');
 
+
+  @Deprecated("Internal Use Only")
+  static TextTrackList internalCreateTextTrackList() {
+    return new TextTrackList._internalWrap();
+  }
+
+  factory TextTrackList._internalWrap() {
+    return new TextTrackList.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  TextTrackList.internal_() : super.internal_();
+
+
   @DomName('TextTrackList.length')
   @DocsEditable()
   int get length => _blink.BlinkTextTrackList.instance.length_Getter_(unwrap_jso(this));
@@ -31134,7 +36595,7 @@
   }
 
   TextTrack _nativeIndexedGetter(int index) => wrap_jso(_blink.BlinkTextTrackList.instance.item_Callback_1_(unwrap_jso(this), index));
- 
+
   void operator[]=(int index, TextTrack value) {
     throw new UnsupportedError("Cannot assign element of immutable List.");
   }
@@ -31142,7 +36603,7 @@
   // TextTrack is the element type.
 
 
-  void set length(int value) {
+  set length(int value) {
     throw new UnsupportedError("Cannot resize immutable List.");
   }
 
@@ -31203,21 +36664,36 @@
 @DocsEditable()
 @DomName('TimeRanges')
 @Unstable()
-class TimeRanges extends NativeFieldWrapperClass2 {
+class TimeRanges extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory TimeRanges._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static TimeRanges internalCreateTimeRanges() {
+    return new TimeRanges._internalWrap();
+  }
+
+  factory TimeRanges._internalWrap() {
+    return new TimeRanges.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  TimeRanges.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('TimeRanges.length')
   @DocsEditable()
   int get length => _blink.BlinkTimeRanges.instance.length_Getter_(unwrap_jso(this));
   
   @DomName('TimeRanges.end')
   @DocsEditable()
-  double end(int index) => _blink.BlinkTimeRanges.instance.end_Callback_1_(unwrap_jso(this), index);
+  num end(int index) => _blink.BlinkTimeRanges.instance.end_Callback_1_(unwrap_jso(this), index);
   
   @DomName('TimeRanges.start')
   @DocsEditable()
-  double start(int index) => _blink.BlinkTimeRanges.instance.start_Callback_1_(unwrap_jso(this), index);
+  num start(int index) => _blink.BlinkTimeRanges.instance.start_Callback_1_(unwrap_jso(this), index);
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -31239,10 +36715,25 @@
 @DocsEditable()
 @DomName('Timing')
 @Experimental() // untriaged
-class Timing extends NativeFieldWrapperClass2 {
+class Timing extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory Timing._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static Timing internalCreateTiming() {
+    return new Timing._internalWrap();
+  }
+
+  factory Timing._internalWrap() {
+    return new Timing.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  Timing.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('Timing.delay')
   @DocsEditable()
   @Experimental() // untriaged
@@ -31251,7 +36742,7 @@
   @DomName('Timing.delay')
   @DocsEditable()
   @Experimental() // untriaged
-  void set delay(num value) => _blink.BlinkTiming.instance.delay_Setter_(unwrap_jso(this), value);
+  set delay(num value) => _blink.BlinkTiming.instance.delay_Setter_(unwrap_jso(this), value);
   
   @DomName('Timing.direction')
   @DocsEditable()
@@ -31261,7 +36752,7 @@
   @DomName('Timing.direction')
   @DocsEditable()
   @Experimental() // untriaged
-  void set direction(String value) => _blink.BlinkTiming.instance.direction_Setter_(unwrap_jso(this), value);
+  set direction(String value) => _blink.BlinkTiming.instance.direction_Setter_(unwrap_jso(this), value);
   
   @DomName('Timing.easing')
   @DocsEditable()
@@ -31271,7 +36762,7 @@
   @DomName('Timing.easing')
   @DocsEditable()
   @Experimental() // untriaged
-  void set easing(String value) => _blink.BlinkTiming.instance.easing_Setter_(unwrap_jso(this), value);
+  set easing(String value) => _blink.BlinkTiming.instance.easing_Setter_(unwrap_jso(this), value);
   
   @DomName('Timing.endDelay')
   @DocsEditable()
@@ -31281,7 +36772,7 @@
   @DomName('Timing.endDelay')
   @DocsEditable()
   @Experimental() // untriaged
-  void set endDelay(num value) => _blink.BlinkTiming.instance.endDelay_Setter_(unwrap_jso(this), value);
+  set endDelay(num value) => _blink.BlinkTiming.instance.endDelay_Setter_(unwrap_jso(this), value);
   
   @DomName('Timing.fill')
   @DocsEditable()
@@ -31291,7 +36782,7 @@
   @DomName('Timing.fill')
   @DocsEditable()
   @Experimental() // untriaged
-  void set fill(String value) => _blink.BlinkTiming.instance.fill_Setter_(unwrap_jso(this), value);
+  set fill(String value) => _blink.BlinkTiming.instance.fill_Setter_(unwrap_jso(this), value);
   
   @DomName('Timing.iterationStart')
   @DocsEditable()
@@ -31301,7 +36792,7 @@
   @DomName('Timing.iterationStart')
   @DocsEditable()
   @Experimental() // untriaged
-  void set iterationStart(num value) => _blink.BlinkTiming.instance.iterationStart_Setter_(unwrap_jso(this), value);
+  set iterationStart(num value) => _blink.BlinkTiming.instance.iterationStart_Setter_(unwrap_jso(this), value);
   
   @DomName('Timing.iterations')
   @DocsEditable()
@@ -31311,7 +36802,7 @@
   @DomName('Timing.iterations')
   @DocsEditable()
   @Experimental() // untriaged
-  void set iterations(num value) => _blink.BlinkTiming.instance.iterations_Setter_(unwrap_jso(this), value);
+  set iterations(num value) => _blink.BlinkTiming.instance.iterations_Setter_(unwrap_jso(this), value);
   
   @DomName('Timing.playbackRate')
   @DocsEditable()
@@ -31321,7 +36812,7 @@
   @DomName('Timing.playbackRate')
   @DocsEditable()
   @Experimental() // untriaged
-  void set playbackRate(num value) => _blink.BlinkTiming.instance.playbackRate_Setter_(unwrap_jso(this), value);
+  set playbackRate(num value) => _blink.BlinkTiming.instance.playbackRate_Setter_(unwrap_jso(this), value);
   
   @DomName('Timing.__getter__')
   @DocsEditable()
@@ -31350,6 +36841,20 @@
   @DomName('HTMLTitleElement.HTMLTitleElement')
   @DocsEditable()
   factory TitleElement() => document.createElement("title");
+
+
+  @Deprecated("Internal Use Only")
+  static TitleElement internalCreateTitleElement() {
+    return new TitleElement._internalWrap();
+  }
+
+  factory TitleElement._internalWrap() {
+    return new TitleElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  TitleElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -31367,22 +36872,37 @@
 @DomName('Touch')
 // http://www.w3.org/TR/touch-events/, http://www.chromestatus.com/features
 @Experimental()
-class Touch extends NativeFieldWrapperClass2 {
+class Touch extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory Touch._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static Touch internalCreateTouch() {
+    return new Touch._internalWrap();
+  }
+
+  factory Touch._internalWrap() {
+    return new Touch.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  Touch.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('Touch.clientX')
   @DocsEditable()
-  double get _clientX => _blink.BlinkTouch.instance.clientX_Getter_(unwrap_jso(this));
+  num get _clientX => _blink.BlinkTouch.instance.clientX_Getter_(unwrap_jso(this));
   
   @DomName('Touch.clientY')
   @DocsEditable()
-  double get _clientY => _blink.BlinkTouch.instance.clientY_Getter_(unwrap_jso(this));
+  num get _clientY => _blink.BlinkTouch.instance.clientY_Getter_(unwrap_jso(this));
   
   @DomName('Touch.force')
   @DocsEditable()
   @Experimental() // untriaged
-  double get force => _blink.BlinkTouch.instance.force_Getter_(unwrap_jso(this));
+  num get force => _blink.BlinkTouch.instance.force_Getter_(unwrap_jso(this));
   
   @DomName('Touch.identifier')
   @DocsEditable()
@@ -31390,29 +36910,29 @@
   
   @DomName('Touch.pageX')
   @DocsEditable()
-  double get _pageX => _blink.BlinkTouch.instance.pageX_Getter_(unwrap_jso(this));
+  num get _pageX => _blink.BlinkTouch.instance.pageX_Getter_(unwrap_jso(this));
   
   @DomName('Touch.pageY')
   @DocsEditable()
-  double get _pageY => _blink.BlinkTouch.instance.pageY_Getter_(unwrap_jso(this));
+  num get _pageY => _blink.BlinkTouch.instance.pageY_Getter_(unwrap_jso(this));
   
   @DomName('Touch.radiusX')
   @DocsEditable()
   @Experimental() // untriaged
-  double get _radiusX => _blink.BlinkTouch.instance.radiusX_Getter_(unwrap_jso(this));
+  num get _radiusX => _blink.BlinkTouch.instance.radiusX_Getter_(unwrap_jso(this));
   
   @DomName('Touch.radiusY')
   @DocsEditable()
   @Experimental() // untriaged
-  double get _radiusY => _blink.BlinkTouch.instance.radiusY_Getter_(unwrap_jso(this));
+  num get _radiusY => _blink.BlinkTouch.instance.radiusY_Getter_(unwrap_jso(this));
   
   @DomName('Touch.screenX')
   @DocsEditable()
-  double get _screenX => _blink.BlinkTouch.instance.screenX_Getter_(unwrap_jso(this));
+  num get _screenX => _blink.BlinkTouch.instance.screenX_Getter_(unwrap_jso(this));
   
   @DomName('Touch.screenY')
   @DocsEditable()
-  double get _screenY => _blink.BlinkTouch.instance.screenY_Getter_(unwrap_jso(this));
+  num get _screenY => _blink.BlinkTouch.instance.screenY_Getter_(unwrap_jso(this));
   
   @DomName('Touch.target')
   @DocsEditable()
@@ -31423,19 +36943,19 @@
   @SupportedBrowser(SupportedBrowser.CHROME)
   @SupportedBrowser(SupportedBrowser.SAFARI)
   @Experimental()
-  double get rotationAngle => _blink.BlinkTouch.instance.webkitRotationAngle_Getter_(unwrap_jso(this));
+  num get rotationAngle => _blink.BlinkTouch.instance.webkitRotationAngle_Getter_(unwrap_jso(this));
   
 
 // As of Chrome 37, these all changed from long to double.  This code
 // preserves backwards compatability for the time being.
-  int get __clientX => _blink.BlinkTouch.clientX_Getter(unwrap_jso(this)).round();
-  int get __clientY => _blink.BlinkTouch.clientY_Getter(unwrap_jso(this)).round();
-  int get __screenX => _blink.BlinkTouch.screenX_Getter(unwrap_jso(this)).round();
-  int get __screenY => _blink.BlinkTouch.screenY_Getter(unwrap_jso(this)).round();
-  int get __pageX => _blink.BlinkTouch.pageX_Getter(unwrap_jso(this)).round();
-  int get __pageY => _blink.BlinkTouch.pageY_Getter(unwrap_jso(this)).round();
-  int get __radiusX => _blink.BlinkTouch.radiusX_Getter(unwrap_jso(this)).round();
-  int get __radiusY => _blink.BlinkTouch.radiusY_Getter(unwrap_jso(this)).round();
+  int get __clientX => _blink.BlinkTouch.instance.clientX_Getter_(unwrap_jso(this)).round();
+  int get __clientY => _blink.BlinkTouch.instance.clientY_Getter_(unwrap_jso(this)).round();
+  int get __screenX => _blink.BlinkTouch.instance.screenX_Getter_(unwrap_jso(this)).round();
+  int get __screenY => _blink.BlinkTouch.instance.screenY_Getter_(unwrap_jso(this)).round();
+  int get __pageX => _blink.BlinkTouch.instance.pageX_Getter_(unwrap_jso(this)).round();
+  int get __pageY => _blink.BlinkTouch.instance.pageY_Getter_(unwrap_jso(this)).round();
+  int get __radiusX => _blink.BlinkTouch.instance.radiusX_Getter_(unwrap_jso(this)).round();
+  int get __radiusY => _blink.BlinkTouch.instance.radiusY_Getter_(unwrap_jso(this)).round();
 
   @DomName('Touch.clientX')
   @DomName('Touch.clientY')
@@ -31491,6 +37011,20 @@
   // To suppress missing implicit constructor warnings.
   factory TouchEvent._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static TouchEvent internalCreateTouchEvent() {
+    return new TouchEvent._internalWrap();
+  }
+
+  factory TouchEvent._internalWrap() {
+    return new TouchEvent.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  TouchEvent.internal_() : super.internal_();
+
+
   @DomName('TouchEvent.altKey')
   @DocsEditable()
   bool get altKey => _blink.BlinkTouchEvent.instance.altKey_Getter_(unwrap_jso(this));
@@ -31542,7 +37076,7 @@
 @DomName('TouchList')
 // http://www.w3.org/TR/touch-events/, http://www.chromestatus.com/features
 @Experimental()
-class TouchList extends NativeFieldWrapperClass2 with ListMixin<Touch>, ImmutableListMixin<Touch> implements List<Touch> {
+class TouchList extends DartHtmlDomObject with ListMixin<Touch>, ImmutableListMixin<Touch> implements List<Touch> {
   /// NB: This constructor likely does not work as you might expect it to! This
   /// constructor will simply fail (returning null) if you are not on a device
   /// with touch enabled. See dartbug.com/8314.
@@ -31551,6 +37085,21 @@
   // To suppress missing implicit constructor warnings.
   factory TouchList._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static TouchList internalCreateTouchList() {
+    return new TouchList._internalWrap();
+  }
+
+  factory TouchList._internalWrap() {
+    return new TouchList.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  TouchList.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   /// Checks if this type is supported on the current platform.
   static bool get supported => true;
 
@@ -31565,7 +37114,7 @@
   }
 
   Touch _nativeIndexedGetter(int index) => wrap_jso(_blink.BlinkTouchList.instance.item_Callback_1_(unwrap_jso(this), index));
- 
+
   void operator[]=(int index, Touch value) {
     throw new UnsupportedError("Cannot assign element of immutable List.");
   }
@@ -31573,7 +37122,7 @@
   // Touch is the element type.
 
 
-  void set length(int value) {
+  set length(int value) {
     throw new UnsupportedError("Cannot resize immutable List.");
   }
 
@@ -31630,6 +37179,20 @@
   @DomName('HTMLTrackElement.HTMLTrackElement')
   @DocsEditable()
   factory TrackElement() => document.createElement("track");
+
+
+  @Deprecated("Internal Use Only")
+  static TrackElement internalCreateTrackElement() {
+    return new TrackElement._internalWrap();
+  }
+
+  factory TrackElement._internalWrap() {
+    return new TrackElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  TrackElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -31662,7 +37225,7 @@
   
   @DomName('HTMLTrackElement.default')
   @DocsEditable()
-  void set defaultValue(bool value) => _blink.BlinkHTMLTrackElement.instance.default_Setter_(unwrap_jso(this), value);
+  set defaultValue(bool value) => _blink.BlinkHTMLTrackElement.instance.default_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLTrackElement.integrity')
   @DocsEditable()
@@ -31672,7 +37235,7 @@
   @DomName('HTMLTrackElement.integrity')
   @DocsEditable()
   @Experimental() // untriaged
-  void set integrity(String value) => _blink.BlinkHTMLTrackElement.instance.integrity_Setter_(unwrap_jso(this), value);
+  set integrity(String value) => _blink.BlinkHTMLTrackElement.instance.integrity_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLTrackElement.kind')
   @DocsEditable()
@@ -31680,7 +37243,7 @@
   
   @DomName('HTMLTrackElement.kind')
   @DocsEditable()
-  void set kind(String value) => _blink.BlinkHTMLTrackElement.instance.kind_Setter_(unwrap_jso(this), value);
+  set kind(String value) => _blink.BlinkHTMLTrackElement.instance.kind_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLTrackElement.label')
   @DocsEditable()
@@ -31688,7 +37251,7 @@
   
   @DomName('HTMLTrackElement.label')
   @DocsEditable()
-  void set label(String value) => _blink.BlinkHTMLTrackElement.instance.label_Setter_(unwrap_jso(this), value);
+  set label(String value) => _blink.BlinkHTMLTrackElement.instance.label_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLTrackElement.readyState')
   @DocsEditable()
@@ -31700,7 +37263,7 @@
   
   @DomName('HTMLTrackElement.src')
   @DocsEditable()
-  void set src(String value) => _blink.BlinkHTMLTrackElement.instance.src_Setter_(unwrap_jso(this), value);
+  set src(String value) => _blink.BlinkHTMLTrackElement.instance.src_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLTrackElement.srclang')
   @DocsEditable()
@@ -31708,7 +37271,7 @@
   
   @DomName('HTMLTrackElement.srclang')
   @DocsEditable()
-  void set srclang(String value) => _blink.BlinkHTMLTrackElement.instance.srclang_Setter_(unwrap_jso(this), value);
+  set srclang(String value) => _blink.BlinkHTMLTrackElement.instance.srclang_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLTrackElement.track')
   @DocsEditable()
@@ -31729,9 +37292,23 @@
   // To suppress missing implicit constructor warnings.
   factory TrackEvent._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static TrackEvent internalCreateTrackEvent() {
+    return new TrackEvent._internalWrap();
+  }
+
+  factory TrackEvent._internalWrap() {
+    return new TrackEvent.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  TrackEvent.internal_() : super.internal_();
+
+
   @DomName('TrackEvent.track')
   @DocsEditable()
-  Object get track => _blink.BlinkTrackEvent.instance.track_Getter_(unwrap_jso(this));
+  Object get track => wrap_jso(_blink.BlinkTrackEvent.instance.track_Getter_(unwrap_jso(this)));
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -31747,9 +37324,23 @@
   // To suppress missing implicit constructor warnings.
   factory TransitionEvent._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static TransitionEvent internalCreateTransitionEvent() {
+    return new TransitionEvent._internalWrap();
+  }
+
+  factory TransitionEvent._internalWrap() {
+    return new TransitionEvent.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  TransitionEvent.internal_() : super.internal_();
+
+
   @DomName('TransitionEvent.elapsedTime')
   @DocsEditable()
-  double get elapsedTime => _blink.BlinkTransitionEvent.instance.elapsedTime_Getter_(unwrap_jso(this));
+  num get elapsedTime => _blink.BlinkTransitionEvent.instance.elapsedTime_Getter_(unwrap_jso(this));
   
   @DomName('TransitionEvent.propertyName')
   @DocsEditable()
@@ -31767,20 +37358,35 @@
 
 @DomName('TreeWalker')
 @Unstable()
-class TreeWalker extends NativeFieldWrapperClass2 {
+class TreeWalker extends DartHtmlDomObject {
   factory TreeWalker(Node root, int whatToShow) {
     return document._createTreeWalker(root, whatToShow, null);
   }
   // To suppress missing implicit constructor warnings.
   factory TreeWalker._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static TreeWalker internalCreateTreeWalker() {
+    return new TreeWalker._internalWrap();
+  }
+
+  factory TreeWalker._internalWrap() {
+    return new TreeWalker.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  TreeWalker.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('TreeWalker.currentNode')
   @DocsEditable()
   Node get currentNode => wrap_jso(_blink.BlinkTreeWalker.instance.currentNode_Getter_(unwrap_jso(this)));
   
   @DomName('TreeWalker.currentNode')
   @DocsEditable()
-  void set currentNode(Node value) => _blink.BlinkTreeWalker.instance.currentNode_Setter_(unwrap_jso(this), unwrap_jso(value));
+  set currentNode(Node value) => _blink.BlinkTreeWalker.instance.currentNode_Setter_(unwrap_jso(this), unwrap_jso(value));
   
   @DomName('TreeWalker.filter')
   @DocsEditable()
@@ -31851,6 +37457,20 @@
   // To suppress missing implicit constructor warnings.
   factory UIEvent._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static UIEvent internalCreateUIEvent() {
+    return new UIEvent._internalWrap();
+  }
+
+  factory UIEvent._internalWrap() {
+    return new UIEvent.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  UIEvent.internal_() : super.internal_();
+
+
   @DomName('UIEvent.charCode')
   @DocsEditable()
   @Unstable()
@@ -31927,6 +37547,20 @@
   @DomName('HTMLUListElement.HTMLUListElement')
   @DocsEditable()
   factory UListElement() => document.createElement("ul");
+
+
+  @Deprecated("Internal Use Only")
+  static UListElement internalCreateUListElement() {
+    return new UListElement._internalWrap();
+  }
+
+  factory UListElement._internalWrap() {
+    return new UListElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  UListElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -31947,6 +37581,20 @@
 class UnknownElement extends HtmlElement {
   // To suppress missing implicit constructor warnings.
   factory UnknownElement._() { throw new UnsupportedError("Not supported"); }
+
+
+  @Deprecated("Internal Use Only")
+  static UnknownElement internalCreateUnknownElement() {
+    return new UnknownElement._internalWrap();
+  }
+
+  factory UnknownElement._internalWrap() {
+    return new UnknownElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  UnknownElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -31964,10 +37612,25 @@
 
 @DocsEditable()
 @DomName('URL')
-class Url extends NativeFieldWrapperClass2 implements UrlUtils {
+class Url extends DartHtmlDomObject implements UrlUtils {
   // To suppress missing implicit constructor warnings.
   factory Url._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static Url internalCreateUrl() {
+    return new Url._internalWrap();
+  }
+
+  factory Url._internalWrap() {
+    return new Url.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  Url.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   static String createObjectUrl(blob_OR_source_OR_stream) {
     if ((blob_OR_source_OR_stream is Blob || blob_OR_source_OR_stream == null)) {
       return _blink.BlinkURL.instance.createObjectURL_Callback_1_(unwrap_jso(blob_OR_source_OR_stream));
@@ -32005,7 +37668,7 @@
   @DomName('URL.hash')
   @DocsEditable()
   @Experimental() // untriaged
-  void set hash(String value) => _blink.BlinkURL.instance.hash_Setter_(unwrap_jso(this), value);
+  set hash(String value) => _blink.BlinkURL.instance.hash_Setter_(unwrap_jso(this), value);
   
   @DomName('URL.host')
   @DocsEditable()
@@ -32015,7 +37678,7 @@
   @DomName('URL.host')
   @DocsEditable()
   @Experimental() // untriaged
-  void set host(String value) => _blink.BlinkURL.instance.host_Setter_(unwrap_jso(this), value);
+  set host(String value) => _blink.BlinkURL.instance.host_Setter_(unwrap_jso(this), value);
   
   @DomName('URL.hostname')
   @DocsEditable()
@@ -32025,7 +37688,7 @@
   @DomName('URL.hostname')
   @DocsEditable()
   @Experimental() // untriaged
-  void set hostname(String value) => _blink.BlinkURL.instance.hostname_Setter_(unwrap_jso(this), value);
+  set hostname(String value) => _blink.BlinkURL.instance.hostname_Setter_(unwrap_jso(this), value);
   
   @DomName('URL.href')
   @DocsEditable()
@@ -32035,7 +37698,7 @@
   @DomName('URL.href')
   @DocsEditable()
   @Experimental() // untriaged
-  void set href(String value) => _blink.BlinkURL.instance.href_Setter_(unwrap_jso(this), value);
+  set href(String value) => _blink.BlinkURL.instance.href_Setter_(unwrap_jso(this), value);
   
   @DomName('URL.origin')
   @DocsEditable()
@@ -32050,7 +37713,7 @@
   @DomName('URL.password')
   @DocsEditable()
   @Experimental() // untriaged
-  void set password(String value) => _blink.BlinkURL.instance.password_Setter_(unwrap_jso(this), value);
+  set password(String value) => _blink.BlinkURL.instance.password_Setter_(unwrap_jso(this), value);
   
   @DomName('URL.pathname')
   @DocsEditable()
@@ -32060,7 +37723,7 @@
   @DomName('URL.pathname')
   @DocsEditable()
   @Experimental() // untriaged
-  void set pathname(String value) => _blink.BlinkURL.instance.pathname_Setter_(unwrap_jso(this), value);
+  set pathname(String value) => _blink.BlinkURL.instance.pathname_Setter_(unwrap_jso(this), value);
   
   @DomName('URL.port')
   @DocsEditable()
@@ -32070,7 +37733,7 @@
   @DomName('URL.port')
   @DocsEditable()
   @Experimental() // untriaged
-  void set port(String value) => _blink.BlinkURL.instance.port_Setter_(unwrap_jso(this), value);
+  set port(String value) => _blink.BlinkURL.instance.port_Setter_(unwrap_jso(this), value);
   
   @DomName('URL.protocol')
   @DocsEditable()
@@ -32080,7 +37743,7 @@
   @DomName('URL.protocol')
   @DocsEditable()
   @Experimental() // untriaged
-  void set protocol(String value) => _blink.BlinkURL.instance.protocol_Setter_(unwrap_jso(this), value);
+  set protocol(String value) => _blink.BlinkURL.instance.protocol_Setter_(unwrap_jso(this), value);
   
   @DomName('URL.search')
   @DocsEditable()
@@ -32090,7 +37753,7 @@
   @DomName('URL.search')
   @DocsEditable()
   @Experimental() // untriaged
-  void set search(String value) => _blink.BlinkURL.instance.search_Setter_(unwrap_jso(this), value);
+  set search(String value) => _blink.BlinkURL.instance.search_Setter_(unwrap_jso(this), value);
   
   @DomName('URL.username')
   @DocsEditable()
@@ -32100,7 +37763,7 @@
   @DomName('URL.username')
   @DocsEditable()
   @Experimental() // untriaged
-  void set username(String value) => _blink.BlinkURL.instance.username_Setter_(unwrap_jso(this), value);
+  set username(String value) => _blink.BlinkURL.instance.username_Setter_(unwrap_jso(this), value);
   
   @DomName('URL.toString')
   @DocsEditable()
@@ -32118,7 +37781,7 @@
 @DocsEditable()
 @DomName('URLUtils')
 @Experimental() // untriaged
-abstract class UrlUtils extends NativeFieldWrapperClass2 {
+abstract class UrlUtils extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory UrlUtils._() { throw new UnsupportedError("Not supported"); }
 
@@ -32130,7 +37793,7 @@
   @DomName('URLUtils.hash')
   @DocsEditable()
   @Experimental() // untriaged
-  void set hash(String value);
+  set hash(String value);
 
   @DomName('URLUtils.host')
   @DocsEditable()
@@ -32140,7 +37803,7 @@
   @DomName('URLUtils.host')
   @DocsEditable()
   @Experimental() // untriaged
-  void set host(String value);
+  set host(String value);
 
   @DomName('URLUtils.hostname')
   @DocsEditable()
@@ -32150,7 +37813,7 @@
   @DomName('URLUtils.hostname')
   @DocsEditable()
   @Experimental() // untriaged
-  void set hostname(String value);
+  set hostname(String value);
 
   @DomName('URLUtils.href')
   @DocsEditable()
@@ -32160,7 +37823,7 @@
   @DomName('URLUtils.href')
   @DocsEditable()
   @Experimental() // untriaged
-  void set href(String value);
+  set href(String value);
 
   @DomName('URLUtils.origin')
   @DocsEditable()
@@ -32175,7 +37838,7 @@
   @DomName('URLUtils.password')
   @DocsEditable()
   @Experimental() // untriaged
-  void set password(String value);
+  set password(String value);
 
   @DomName('URLUtils.pathname')
   @DocsEditable()
@@ -32185,7 +37848,7 @@
   @DomName('URLUtils.pathname')
   @DocsEditable()
   @Experimental() // untriaged
-  void set pathname(String value);
+  set pathname(String value);
 
   @DomName('URLUtils.port')
   @DocsEditable()
@@ -32195,7 +37858,7 @@
   @DomName('URLUtils.port')
   @DocsEditable()
   @Experimental() // untriaged
-  void set port(String value);
+  set port(String value);
 
   @DomName('URLUtils.protocol')
   @DocsEditable()
@@ -32205,7 +37868,7 @@
   @DomName('URLUtils.protocol')
   @DocsEditable()
   @Experimental() // untriaged
-  void set protocol(String value);
+  set protocol(String value);
 
   @DomName('URLUtils.search')
   @DocsEditable()
@@ -32215,7 +37878,7 @@
   @DomName('URLUtils.search')
   @DocsEditable()
   @Experimental() // untriaged
-  void set search(String value);
+  set search(String value);
 
   @DomName('URLUtils.username')
   @DocsEditable()
@@ -32225,7 +37888,7 @@
   @DomName('URLUtils.username')
   @DocsEditable()
   @Experimental() // untriaged
-  void set username(String value);
+  set username(String value);
 
   @DomName('URLUtils.toString')
   @DocsEditable()
@@ -32243,7 +37906,7 @@
 @DocsEditable()
 @DomName('URLUtilsReadOnly')
 @Experimental() // untriaged
-abstract class UrlUtilsReadOnly extends NativeFieldWrapperClass2 {
+abstract class UrlUtilsReadOnly extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory UrlUtilsReadOnly._() { throw new UnsupportedError("Not supported"); }
 
@@ -32307,10 +37970,25 @@
 
 @DocsEditable()
 @DomName('ValidityState')
-class ValidityState extends NativeFieldWrapperClass2 {
+class ValidityState extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory ValidityState._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static ValidityState internalCreateValidityState() {
+    return new ValidityState._internalWrap();
+  }
+
+  factory ValidityState._internalWrap() {
+    return new ValidityState.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  ValidityState.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('ValidityState.badInput')
   @DocsEditable()
   bool get badInput => _blink.BlinkValidityState.instance.badInput_Getter_(unwrap_jso(this));
@@ -32365,6 +38043,20 @@
   @DomName('HTMLVideoElement.HTMLVideoElement')
   @DocsEditable()
   factory VideoElement() => document.createElement("video");
+
+
+  @Deprecated("Internal Use Only")
+  static VideoElement internalCreateVideoElement() {
+    return new VideoElement._internalWrap();
+  }
+
+  factory VideoElement._internalWrap() {
+    return new VideoElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  VideoElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -32378,7 +38070,7 @@
   
   @DomName('HTMLVideoElement.height')
   @DocsEditable()
-  void set height(int value) => _blink.BlinkHTMLVideoElement.instance.height_Setter_(unwrap_jso(this), value);
+  set height(int value) => _blink.BlinkHTMLVideoElement.instance.height_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLVideoElement.poster')
   @DocsEditable()
@@ -32386,7 +38078,7 @@
   
   @DomName('HTMLVideoElement.poster')
   @DocsEditable()
-  void set poster(String value) => _blink.BlinkHTMLVideoElement.instance.poster_Setter_(unwrap_jso(this), value);
+  set poster(String value) => _blink.BlinkHTMLVideoElement.instance.poster_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLVideoElement.videoHeight')
   @DocsEditable()
@@ -32416,7 +38108,7 @@
   
   @DomName('HTMLVideoElement.width')
   @DocsEditable()
-  void set width(int value) => _blink.BlinkHTMLVideoElement.instance.width_Setter_(unwrap_jso(this), value);
+  set width(int value) => _blink.BlinkHTMLVideoElement.instance.width_Setter_(unwrap_jso(this), value);
   
   @DomName('HTMLVideoElement.getVideoPlaybackQuality')
   @DocsEditable()
@@ -32450,10 +38142,25 @@
 @DocsEditable()
 @DomName('VideoPlaybackQuality')
 @Experimental() // untriaged
-class VideoPlaybackQuality extends NativeFieldWrapperClass2 {
+class VideoPlaybackQuality extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory VideoPlaybackQuality._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static VideoPlaybackQuality internalCreateVideoPlaybackQuality() {
+    return new VideoPlaybackQuality._internalWrap();
+  }
+
+  factory VideoPlaybackQuality._internalWrap() {
+    return new VideoPlaybackQuality.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  VideoPlaybackQuality.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('VideoPlaybackQuality.corruptedVideoFrames')
   @DocsEditable()
   @Experimental() // untriaged
@@ -32462,7 +38169,7 @@
   @DomName('VideoPlaybackQuality.creationTime')
   @DocsEditable()
   @Experimental() // untriaged
-  double get creationTime => _blink.BlinkVideoPlaybackQuality.instance.creationTime_Getter_(unwrap_jso(this));
+  num get creationTime => _blink.BlinkVideoPlaybackQuality.instance.creationTime_Getter_(unwrap_jso(this));
   
   @DomName('VideoPlaybackQuality.droppedVideoFrames')
   @DocsEditable()
@@ -32485,10 +38192,25 @@
 @DocsEditable()
 @DomName('VideoTrack')
 @Experimental() // untriaged
-class VideoTrack extends NativeFieldWrapperClass2 {
+class VideoTrack extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory VideoTrack._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static VideoTrack internalCreateVideoTrack() {
+    return new VideoTrack._internalWrap();
+  }
+
+  factory VideoTrack._internalWrap() {
+    return new VideoTrack.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  VideoTrack.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('VideoTrack.id')
   @DocsEditable()
   @Experimental() // untriaged
@@ -32517,7 +38239,7 @@
   @DomName('VideoTrack.selected')
   @DocsEditable()
   @Experimental() // untriaged
-  void set selected(bool value) => _blink.BlinkVideoTrack.instance.selected_Setter_(unwrap_jso(this), value);
+  set selected(bool value) => _blink.BlinkVideoTrack.instance.selected_Setter_(unwrap_jso(this), value);
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -32539,6 +38261,20 @@
   @Experimental() // untriaged
   static const EventStreamProvider<Event> changeEvent = const EventStreamProvider<Event>('change');
 
+
+  @Deprecated("Internal Use Only")
+  static VideoTrackList internalCreateVideoTrackList() {
+    return new VideoTrackList._internalWrap();
+  }
+
+  factory VideoTrackList._internalWrap() {
+    return new VideoTrackList.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  VideoTrackList.internal_() : super.internal_();
+
+
   @DomName('VideoTrackList.length')
   @DocsEditable()
   @Experimental() // untriaged
@@ -32593,9 +38329,23 @@
   @DomName('VTTCue.VTTCue')
   @DocsEditable()
   factory VttCue(num startTime, num endTime, String text) {
-    return _blink.BlinkVTTCue.instance.constructorCallback_3_(startTime, endTime, text);
+    return wrap_jso(_blink.BlinkVTTCue.instance.constructorCallback_3_(startTime, endTime, text));
   }
 
+
+  @Deprecated("Internal Use Only")
+  static VttCue internalCreateVttCue() {
+    return new VttCue._internalWrap();
+  }
+
+  factory VttCue._internalWrap() {
+    return new VttCue.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  VttCue.internal_() : super.internal_();
+
+
   @DomName('VTTCue.align')
   @DocsEditable()
   @Experimental() // untriaged
@@ -32604,7 +38354,7 @@
   @DomName('VTTCue.align')
   @DocsEditable()
   @Experimental() // untriaged
-  void set align(String value) => _blink.BlinkVTTCue.instance.align_Setter_(unwrap_jso(this), value);
+  set align(String value) => _blink.BlinkVTTCue.instance.align_Setter_(unwrap_jso(this), value);
   
   @DomName('VTTCue.line')
   @DocsEditable()
@@ -32614,7 +38364,7 @@
   @DomName('VTTCue.line')
   @DocsEditable()
   @Experimental() // untriaged
-  void set line(int value) => _blink.BlinkVTTCue.instance.line_Setter_(unwrap_jso(this), value);
+  set line(int value) => _blink.BlinkVTTCue.instance.line_Setter_(unwrap_jso(this), value);
   
   @DomName('VTTCue.position')
   @DocsEditable()
@@ -32624,7 +38374,7 @@
   @DomName('VTTCue.position')
   @DocsEditable()
   @Experimental() // untriaged
-  void set position(int value) => _blink.BlinkVTTCue.instance.position_Setter_(unwrap_jso(this), value);
+  set position(int value) => _blink.BlinkVTTCue.instance.position_Setter_(unwrap_jso(this), value);
   
   @DomName('VTTCue.regionId')
   @DocsEditable()
@@ -32634,7 +38384,7 @@
   @DomName('VTTCue.regionId')
   @DocsEditable()
   @Experimental() // untriaged
-  void set regionId(String value) => _blink.BlinkVTTCue.instance.regionId_Setter_(unwrap_jso(this), value);
+  set regionId(String value) => _blink.BlinkVTTCue.instance.regionId_Setter_(unwrap_jso(this), value);
   
   @DomName('VTTCue.size')
   @DocsEditable()
@@ -32644,7 +38394,7 @@
   @DomName('VTTCue.size')
   @DocsEditable()
   @Experimental() // untriaged
-  void set size(int value) => _blink.BlinkVTTCue.instance.size_Setter_(unwrap_jso(this), value);
+  set size(int value) => _blink.BlinkVTTCue.instance.size_Setter_(unwrap_jso(this), value);
   
   @DomName('VTTCue.snapToLines')
   @DocsEditable()
@@ -32654,7 +38404,7 @@
   @DomName('VTTCue.snapToLines')
   @DocsEditable()
   @Experimental() // untriaged
-  void set snapToLines(bool value) => _blink.BlinkVTTCue.instance.snapToLines_Setter_(unwrap_jso(this), value);
+  set snapToLines(bool value) => _blink.BlinkVTTCue.instance.snapToLines_Setter_(unwrap_jso(this), value);
   
   @DomName('VTTCue.text')
   @DocsEditable()
@@ -32664,7 +38414,7 @@
   @DomName('VTTCue.text')
   @DocsEditable()
   @Experimental() // untriaged
-  void set text(String value) => _blink.BlinkVTTCue.instance.text_Setter_(unwrap_jso(this), value);
+  set text(String value) => _blink.BlinkVTTCue.instance.text_Setter_(unwrap_jso(this), value);
   
   @DomName('VTTCue.vertical')
   @DocsEditable()
@@ -32674,7 +38424,7 @@
   @DomName('VTTCue.vertical')
   @DocsEditable()
   @Experimental() // untriaged
-  void set vertical(String value) => _blink.BlinkVTTCue.instance.vertical_Setter_(unwrap_jso(this), value);
+  set vertical(String value) => _blink.BlinkVTTCue.instance.vertical_Setter_(unwrap_jso(this), value);
   
   @DomName('VTTCue.getCueAsHTML')
   @DocsEditable()
@@ -32692,16 +38442,31 @@
 @DocsEditable()
 @DomName('VTTRegion')
 @Experimental() // untriaged
-class VttRegion extends NativeFieldWrapperClass2 {
+class VttRegion extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory VttRegion._() { throw new UnsupportedError("Not supported"); }
 
   @DomName('VTTRegion.VTTRegion')
   @DocsEditable()
   factory VttRegion() {
-    return _blink.BlinkVTTRegion.instance.constructorCallback_0_();
+    return wrap_jso(_blink.BlinkVTTRegion.instance.constructorCallback_0_());
   }
 
+  @Deprecated("Internal Use Only")
+  static VttRegion internalCreateVttRegion() {
+    return new VttRegion._internalWrap();
+  }
+
+  factory VttRegion._internalWrap() {
+    return new VttRegion.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  VttRegion.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('VTTRegion.height')
   @DocsEditable()
   @Experimental() // untriaged
@@ -32710,7 +38475,7 @@
   @DomName('VTTRegion.height')
   @DocsEditable()
   @Experimental() // untriaged
-  void set height(int value) => _blink.BlinkVTTRegion.instance.height_Setter_(unwrap_jso(this), value);
+  set height(int value) => _blink.BlinkVTTRegion.instance.height_Setter_(unwrap_jso(this), value);
   
   @DomName('VTTRegion.id')
   @DocsEditable()
@@ -32720,7 +38485,7 @@
   @DomName('VTTRegion.id')
   @DocsEditable()
   @Experimental() // untriaged
-  void set id(String value) => _blink.BlinkVTTRegion.instance.id_Setter_(unwrap_jso(this), value);
+  set id(String value) => _blink.BlinkVTTRegion.instance.id_Setter_(unwrap_jso(this), value);
   
   @DomName('VTTRegion.regionAnchorX')
   @DocsEditable()
@@ -32730,7 +38495,7 @@
   @DomName('VTTRegion.regionAnchorX')
   @DocsEditable()
   @Experimental() // untriaged
-  void set regionAnchorX(num value) => _blink.BlinkVTTRegion.instance.regionAnchorX_Setter_(unwrap_jso(this), value);
+  set regionAnchorX(num value) => _blink.BlinkVTTRegion.instance.regionAnchorX_Setter_(unwrap_jso(this), value);
   
   @DomName('VTTRegion.regionAnchorY')
   @DocsEditable()
@@ -32740,7 +38505,7 @@
   @DomName('VTTRegion.regionAnchorY')
   @DocsEditable()
   @Experimental() // untriaged
-  void set regionAnchorY(num value) => _blink.BlinkVTTRegion.instance.regionAnchorY_Setter_(unwrap_jso(this), value);
+  set regionAnchorY(num value) => _blink.BlinkVTTRegion.instance.regionAnchorY_Setter_(unwrap_jso(this), value);
   
   @DomName('VTTRegion.scroll')
   @DocsEditable()
@@ -32750,7 +38515,7 @@
   @DomName('VTTRegion.scroll')
   @DocsEditable()
   @Experimental() // untriaged
-  void set scroll(String value) => _blink.BlinkVTTRegion.instance.scroll_Setter_(unwrap_jso(this), value);
+  set scroll(String value) => _blink.BlinkVTTRegion.instance.scroll_Setter_(unwrap_jso(this), value);
   
   @DomName('VTTRegion.track')
   @DocsEditable()
@@ -32765,7 +38530,7 @@
   @DomName('VTTRegion.viewportAnchorX')
   @DocsEditable()
   @Experimental() // untriaged
-  void set viewportAnchorX(num value) => _blink.BlinkVTTRegion.instance.viewportAnchorX_Setter_(unwrap_jso(this), value);
+  set viewportAnchorX(num value) => _blink.BlinkVTTRegion.instance.viewportAnchorX_Setter_(unwrap_jso(this), value);
   
   @DomName('VTTRegion.viewportAnchorY')
   @DocsEditable()
@@ -32775,7 +38540,7 @@
   @DomName('VTTRegion.viewportAnchorY')
   @DocsEditable()
   @Experimental() // untriaged
-  void set viewportAnchorY(num value) => _blink.BlinkVTTRegion.instance.viewportAnchorY_Setter_(unwrap_jso(this), value);
+  set viewportAnchorY(num value) => _blink.BlinkVTTRegion.instance.viewportAnchorY_Setter_(unwrap_jso(this), value);
   
   @DomName('VTTRegion.width')
   @DocsEditable()
@@ -32785,7 +38550,7 @@
   @DomName('VTTRegion.width')
   @DocsEditable()
   @Experimental() // untriaged
-  void set width(num value) => _blink.BlinkVTTRegion.instance.width_Setter_(unwrap_jso(this), value);
+  set width(num value) => _blink.BlinkVTTRegion.instance.width_Setter_(unwrap_jso(this), value);
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -32798,10 +38563,25 @@
 @DocsEditable()
 @DomName('VTTRegionList')
 @Experimental() // untriaged
-class VttRegionList extends NativeFieldWrapperClass2 {
+class VttRegionList extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory VttRegionList._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static VttRegionList internalCreateVttRegionList() {
+    return new VttRegionList._internalWrap();
+  }
+
+  factory VttRegionList._internalWrap() {
+    return new VttRegionList.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  VttRegionList.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('VTTRegionList.length')
   @DocsEditable()
   @Experimental() // untriaged
@@ -32810,12 +38590,12 @@
   @DomName('VTTRegionList.getRegionById')
   @DocsEditable()
   @Experimental() // untriaged
-  VttRegion getRegionById(String id) => _blink.BlinkVTTRegionList.instance.getRegionById_Callback_1_(unwrap_jso(this), id);
+  VttRegion getRegionById(String id) => wrap_jso(_blink.BlinkVTTRegionList.instance.getRegionById_Callback_1_(unwrap_jso(this), id));
   
   @DomName('VTTRegionList.item')
   @DocsEditable()
   @Experimental() // untriaged
-  VttRegion item(int index) => _blink.BlinkVTTRegionList.instance.item_Callback_1_(unwrap_jso(this), index);
+  VttRegion item(int index) => wrap_jso(_blink.BlinkVTTRegionList.instance.item_Callback_1_(unwrap_jso(this), index));
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -32914,17 +38694,32 @@
   @DocsEditable()
   factory WebSocket(String url, [protocol_OR_protocols]) {
     if ((url is String || url == null) && protocol_OR_protocols == null) {
-      return _blink.BlinkWebSocket.instance.constructorCallback_1_(url);
+      return wrap_jso(_blink.BlinkWebSocket.instance.constructorCallback_1_(url));
     }
     if ((protocol_OR_protocols is String || protocol_OR_protocols == null) && (url is String || url == null)) {
-      return _blink.BlinkWebSocket.instance.constructorCallback_2_(url, protocol_OR_protocols);
+      return wrap_jso(_blink.BlinkWebSocket.instance.constructorCallback_2_(url, protocol_OR_protocols));
     }
     if ((protocol_OR_protocols is List<String> || protocol_OR_protocols == null) && (url is String || url == null)) {
-      return _blink.BlinkWebSocket.instance.constructorCallback_2_(url, protocol_OR_protocols);
+      List protocols_1 = convertDartToNative_StringArray(protocol_OR_protocols);
+      return wrap_jso(_blink.BlinkWebSocket.instance.constructorCallback_2_(url, protocols_1));
     }
     throw new ArgumentError("Incorrect number or type of arguments");
   }
 
+
+  @Deprecated("Internal Use Only")
+  static WebSocket internalCreateWebSocket() {
+    return new WebSocket._internalWrap();
+  }
+
+  factory WebSocket._internalWrap() {
+    return new WebSocket.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  WebSocket.internal_() : super.internal_();
+
+
   /// Checks if this type is supported on the current platform.
   static bool get supported => true;
 
@@ -32950,7 +38745,7 @@
   
   @DomName('WebSocket.binaryType')
   @DocsEditable()
-  void set binaryType(String value) => _blink.BlinkWebSocket.instance.binaryType_Setter_(unwrap_jso(this), value);
+  set binaryType(String value) => _blink.BlinkWebSocket.instance.binaryType_Setter_(unwrap_jso(this), value);
   
   @DomName('WebSocket.bufferedAmount')
   @DocsEditable()
@@ -33079,12 +38874,26 @@
       'relatedTarget': relatedTarget,
     };
 
-    return _blink.BlinkWheelEvent.constructorCallback_2(type, options);
+    return wrap_jso(_blink.BlinkWheelEvent.instance.constructorCallback_2_(type, convertDartToNative_Dictionary(options)));
   }
 
   // To suppress missing implicit constructor warnings.
   factory WheelEvent._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static WheelEvent internalCreateWheelEvent() {
+    return new WheelEvent._internalWrap();
+  }
+
+  factory WheelEvent._internalWrap() {
+    return new WheelEvent.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  WheelEvent.internal_() : super.internal_();
+
+
   @DomName('WheelEvent.DOM_DELTA_LINE')
   @DocsEditable()
   static const int DOM_DELTA_LINE = 0x01;
@@ -33103,15 +38912,15 @@
   
   @DomName('WheelEvent.deltaX')
   @DocsEditable()
-  double get _deltaX => _blink.BlinkWheelEvent.instance.deltaX_Getter_(unwrap_jso(this));
+  num get _deltaX => _blink.BlinkWheelEvent.instance.deltaX_Getter_(unwrap_jso(this));
   
   @DomName('WheelEvent.deltaY')
   @DocsEditable()
-  double get _deltaY => _blink.BlinkWheelEvent.instance.deltaY_Getter_(unwrap_jso(this));
+  num get _deltaY => _blink.BlinkWheelEvent.instance.deltaY_Getter_(unwrap_jso(this));
   
   @DomName('WheelEvent.deltaZ')
   @DocsEditable()
-  double get deltaZ => _blink.BlinkWheelEvent.instance.deltaZ_Getter_(unwrap_jso(this));
+  num get deltaZ => _blink.BlinkWheelEvent.instance.deltaZ_Getter_(unwrap_jso(this));
   
 
   /**
@@ -33413,6 +39222,20 @@
   @Experimental()
   static const EventStreamProvider<AnimationEvent> animationStartEvent = const EventStreamProvider<AnimationEvent>('webkitAnimationStart');
 
+
+  @Deprecated("Internal Use Only")
+  static Window internalCreateWindow() {
+    return new Window._internalWrap();
+  }
+
+  factory Window._internalWrap() {
+    return new Window.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  Window.internal_() : super.internal_();
+
+
   /**
    * Indicates that file system data cannot be cleared unless given user
    * permission.
@@ -33503,7 +39326,7 @@
   @DomName('Window.defaultStatus')
   @DocsEditable()
   @Experimental() // non-standard
-  void set defaultStatus(String value) => _blink.BlinkWindow.instance.defaultStatus_Setter_(unwrap_jso(this), value);
+  set defaultStatus(String value) => _blink.BlinkWindow.instance.defaultStatus_Setter_(unwrap_jso(this), value);
   
   /// *Deprecated*.
   @DomName('Window.defaultstatus')
@@ -33515,7 +39338,7 @@
   @DomName('Window.defaultstatus')
   @DocsEditable()
   @Experimental() // non-standard
-  void set defaultstatus(String value) => _blink.BlinkWindow.instance.defaultstatus_Setter_(unwrap_jso(this), value);
+  set defaultstatus(String value) => _blink.BlinkWindow.instance.defaultstatus_Setter_(unwrap_jso(this), value);
   
   /**
    * The ratio between physical pixels and logical CSS pixels.
@@ -33533,7 +39356,7 @@
   @DocsEditable()
   // http://www.quirksmode.org/blog/archives/2012/06/devicepixelrati.html
   @Experimental() // non-standard
-  double get devicePixelRatio => _blink.BlinkWindow.instance.devicePixelRatio_Getter_(unwrap_jso(this));
+  num get devicePixelRatio => _blink.BlinkWindow.instance.devicePixelRatio_Getter_(unwrap_jso(this));
   
   @DomName('Window.document')
   @DocsEditable()
@@ -33657,7 +39480,7 @@
    */
   @DomName('Window.name')
   @DocsEditable()
-  void set name(String value) => _blink.BlinkWindow.instance.name_Setter_(unwrap_jso(this), value);
+  set name(String value) => _blink.BlinkWindow.instance.name_Setter_(unwrap_jso(this), value);
   
   /**
    * The user agent accessing this window.
@@ -33692,7 +39515,7 @@
   
   @DomName('Window.opener')
   @DocsEditable()
-  void set opener(Window value) => _blink.BlinkWindow.instance.opener_Setter_(unwrap_jso(this), unwrap_jso(value));
+  set opener(Window value) => _blink.BlinkWindow.instance.opener_Setter_(unwrap_jso(this), unwrap_jso(value));
   
   @DomName('Window.orientation')
   @DocsEditable()
@@ -33739,7 +39562,7 @@
    */
   @DomName('Window.pageXOffset')
   @DocsEditable()
-  double get _pageXOffset => _blink.BlinkWindow.instance.pageXOffset_Getter_(unwrap_jso(this));
+  num get _pageXOffset => _blink.BlinkWindow.instance.pageXOffset_Getter_(unwrap_jso(this));
   
   /**
    * The distance this window has been scrolled vertically.
@@ -33755,7 +39578,7 @@
    */
   @DomName('Window.pageYOffset')
   @DocsEditable()
-  double get _pageYOffset => _blink.BlinkWindow.instance.pageYOffset_Getter_(unwrap_jso(this));
+  num get _pageYOffset => _blink.BlinkWindow.instance.pageYOffset_Getter_(unwrap_jso(this));
   
   @DomName('Window.parent')
   @DocsEditable()
@@ -33842,11 +39665,11 @@
   
   @DomName('Window.scrollX')
   @DocsEditable()
-  double get _scrollX => _blink.BlinkWindow.instance.scrollX_Getter_(unwrap_jso(this));
+  num get _scrollX => _blink.BlinkWindow.instance.scrollX_Getter_(unwrap_jso(this));
   
   @DomName('Window.scrollY')
   @DocsEditable()
-  double get _scrollY => _blink.BlinkWindow.instance.scrollY_Getter_(unwrap_jso(this));
+  num get _scrollY => _blink.BlinkWindow.instance.scrollY_Getter_(unwrap_jso(this));
   
   /**
    * This window's scroll bars.
@@ -33913,7 +39736,7 @@
   /// *Deprecated*.
   @DomName('Window.status')
   @DocsEditable()
-  void set status(String value) => _blink.BlinkWindow.instance.status_Setter_(unwrap_jso(this), value);
+  set status(String value) => _blink.BlinkWindow.instance.status_Setter_(unwrap_jso(this), value);
   
   /**
    * This window's status bar.
@@ -33974,10 +39797,10 @@
   
   WindowBase __getter__(index_OR_name) {
     if ((index_OR_name is int)) {
-      return _blink.BlinkWindow.instance.$__getter___Callback_1_(unwrap_jso(this), unwrap_jso(index_OR_name));
+      return wrap_jso(_blink.BlinkWindow.instance.$__getter___Callback_1_(unwrap_jso(this), unwrap_jso(index_OR_name)));
     }
     if ((index_OR_name is String)) {
-      return _blink.BlinkWindow.instance.$__getter___Callback_1_(unwrap_jso(this), unwrap_jso(index_OR_name));
+      return wrap_jso(_blink.BlinkWindow.instance.$__getter___Callback_1_(unwrap_jso(this), unwrap_jso(index_OR_name)));
     }
     throw new ArgumentError("Incorrect number or type of arguments");
   }
@@ -34021,7 +39844,7 @@
   
   @DomName('Window.getComputedStyle')
   @DocsEditable()
-  CssStyleDeclaration _getComputedStyle(Element element, String pseudoElement) => _blink.BlinkWindow.instance.getComputedStyle_Callback_2_(unwrap_jso(this), unwrap_jso(element), pseudoElement);
+  CssStyleDeclaration _getComputedStyle(Element element, String pseudoElement) => wrap_jso(_blink.BlinkWindow.instance.getComputedStyle_Callback_2_(unwrap_jso(this), unwrap_jso(element), pseudoElement));
   
   /**
    * Returns all CSS rules that apply to the element's pseudo-element.
@@ -34029,7 +39852,7 @@
   @DomName('Window.getMatchedCSSRules')
   @DocsEditable()
   @Experimental() // non-standard
-  List<CssRule> getMatchedCssRules(Element element, String pseudoElement) => _blink.BlinkWindow.instance.getMatchedCSSRules_Callback_2_(unwrap_jso(this), unwrap_jso(element), pseudoElement);
+  List<CssRule> getMatchedCssRules(Element element, String pseudoElement) => wrap_jso(_blink.BlinkWindow.instance.getMatchedCSSRules_Callback_2_(unwrap_jso(this), unwrap_jso(element), pseudoElement));
   
   /**
    * Returns the currently selected text.
@@ -34081,18 +39904,18 @@
   
   @DomName('Window.open')
   @DocsEditable()
-  WindowBase open(String url, String name, [String options]) => _blink.BlinkWindow.instance.open_Callback_3_(unwrap_jso(this), url, name, options);
+  WindowBase open(String url, String name, [String options]) => wrap_jso(_blink.BlinkWindow.instance.open_Callback_3_(unwrap_jso(this), url, name, options));
   
   SqlDatabase openDatabase(String name, String version, String displayName, int estimatedSize, [DatabaseCallback creationCallback]) {
     if (creationCallback != null) {
-      return _blink.BlinkWindow.instance.openDatabase_Callback_5_(unwrap_jso(this), name, version, displayName, estimatedSize, unwrap_jso(creationCallback));
+      return wrap_jso(_blink.BlinkWindow.instance.openDatabase_Callback_5_(unwrap_jso(this), name, version, displayName, estimatedSize, unwrap_jso((database) => creationCallback(wrap_jso(database)))));
     }
-    return _blink.BlinkWindow.instance.openDatabase_Callback_4_(unwrap_jso(this), name, version, displayName, estimatedSize);
+    return wrap_jso(_blink.BlinkWindow.instance.openDatabase_Callback_4_(unwrap_jso(this), name, version, displayName, estimatedSize));
   }
 
   @DomName('Window.postMessage')
   @DocsEditable()
-  void postMessage(/*SerializedScriptValue*/ message, String targetOrigin, [List<MessagePort> transfer]) => _blink.BlinkWindow.instance.postMessage_Callback_3_(unwrap_jso(this), message, targetOrigin, transfer);
+  void postMessage(/*SerializedScriptValue*/ message, String targetOrigin, [List<MessagePort> transfer]) => _blink.BlinkWindow.instance.postMessage_Callback_3_(unwrap_jso(this), convertDartToNative_SerializedScriptValue(message), targetOrigin, transfer);
   
   /**
    * Opens the print dialog for this window.
@@ -34108,7 +39931,7 @@
   
   @DomName('Window.requestAnimationFrame')
   @DocsEditable()
-  int _requestAnimationFrame(RequestAnimationFrameCallback callback) => _blink.BlinkWindow.instance.requestAnimationFrame_Callback_1_(unwrap_jso(this), unwrap_jso(callback));
+  int _requestAnimationFrame(RequestAnimationFrameCallback callback) => _blink.BlinkWindow.instance.requestAnimationFrame_Callback_1_(unwrap_jso(this), unwrap_jso((highResTime) => callback(highResTime)));
   
   /**
    * Resizes this window by an offset.
@@ -34140,7 +39963,7 @@
       return;
     }
     if ((scrollOptions is Map) && (y is num) && (x is num)) {
-      _blink.BlinkWindow.instance.scroll_Callback_3_(unwrap_jso(this), unwrap_jso(x), unwrap_jso(y), scrollOptions);
+      _blink.BlinkWindow.instance.scroll_Callback_3_(unwrap_jso(this), unwrap_jso(x), unwrap_jso(y), convertDartToNative_Dictionary(scrollOptions));
       return;
     }
     if ((y is int) && (x is int) && scrollOptions == null) {
@@ -34148,7 +39971,7 @@
       return;
     }
     if ((scrollOptions is Map) && (y is int) && (x is int)) {
-      _blink.BlinkWindow.instance.scroll_Callback_3_(unwrap_jso(this), unwrap_jso(x), unwrap_jso(y), scrollOptions);
+      _blink.BlinkWindow.instance.scroll_Callback_3_(unwrap_jso(this), unwrap_jso(x), unwrap_jso(y), convertDartToNative_Dictionary(scrollOptions));
       return;
     }
     throw new ArgumentError("Incorrect number or type of arguments");
@@ -34160,7 +39983,7 @@
       return;
     }
     if ((scrollOptions is Map) && (y is num) && (x is num)) {
-      _blink.BlinkWindow.instance.scrollBy_Callback_3_(unwrap_jso(this), unwrap_jso(x), unwrap_jso(y), scrollOptions);
+      _blink.BlinkWindow.instance.scrollBy_Callback_3_(unwrap_jso(this), unwrap_jso(x), unwrap_jso(y), convertDartToNative_Dictionary(scrollOptions));
       return;
     }
     if ((y is int) && (x is int) && scrollOptions == null) {
@@ -34168,7 +39991,7 @@
       return;
     }
     if ((scrollOptions is Map) && (y is int) && (x is int)) {
-      _blink.BlinkWindow.instance.scrollBy_Callback_3_(unwrap_jso(this), unwrap_jso(x), unwrap_jso(y), scrollOptions);
+      _blink.BlinkWindow.instance.scrollBy_Callback_3_(unwrap_jso(this), unwrap_jso(x), unwrap_jso(y), convertDartToNative_Dictionary(scrollOptions));
       return;
     }
     throw new ArgumentError("Incorrect number or type of arguments");
@@ -34180,7 +40003,7 @@
       return;
     }
     if ((scrollOptions is Map) && (y is num) && (x is num)) {
-      _blink.BlinkWindow.instance.scrollTo_Callback_3_(unwrap_jso(this), unwrap_jso(x), unwrap_jso(y), scrollOptions);
+      _blink.BlinkWindow.instance.scrollTo_Callback_3_(unwrap_jso(this), unwrap_jso(x), unwrap_jso(y), convertDartToNative_Dictionary(scrollOptions));
       return;
     }
     if ((y is int) && (x is int) && scrollOptions == null) {
@@ -34188,7 +40011,7 @@
       return;
     }
     if ((scrollOptions is Map) && (y is int) && (x is int)) {
-      _blink.BlinkWindow.instance.scrollTo_Callback_3_(unwrap_jso(this), unwrap_jso(x), unwrap_jso(y), scrollOptions);
+      _blink.BlinkWindow.instance.scrollTo_Callback_3_(unwrap_jso(this), unwrap_jso(x), unwrap_jso(y), convertDartToNative_Dictionary(scrollOptions));
       return;
     }
     throw new ArgumentError("Incorrect number or type of arguments");
@@ -34222,10 +40045,10 @@
   
   void __requestFileSystem(int type, int size, _FileSystemCallback successCallback, [_ErrorCallback errorCallback]) {
     if (errorCallback != null) {
-      _blink.BlinkWindow.instance.webkitRequestFileSystem_Callback_4_(unwrap_jso(this), type, size, unwrap_jso(successCallback), unwrap_jso(errorCallback));
+      _blink.BlinkWindow.instance.webkitRequestFileSystem_Callback_4_(unwrap_jso(this), type, size, unwrap_jso((fileSystem) => successCallback(wrap_jso(fileSystem))), unwrap_jso((error) => errorCallback(wrap_jso(error))));
       return;
     }
-    _blink.BlinkWindow.instance.webkitRequestFileSystem_Callback_3_(unwrap_jso(this), type, size, unwrap_jso(successCallback));
+    _blink.BlinkWindow.instance.webkitRequestFileSystem_Callback_3_(unwrap_jso(this), type, size, unwrap_jso((fileSystem) => successCallback(wrap_jso(fileSystem))));
     return;
   }
 
@@ -34239,10 +40062,10 @@
 
   void _resolveLocalFileSystemUrl(String url, _EntryCallback successCallback, [_ErrorCallback errorCallback]) {
     if (errorCallback != null) {
-      _blink.BlinkWindow.instance.webkitResolveLocalFileSystemURL_Callback_3_(unwrap_jso(this), url, unwrap_jso(successCallback), unwrap_jso(errorCallback));
+      _blink.BlinkWindow.instance.webkitResolveLocalFileSystemURL_Callback_3_(unwrap_jso(this), url, unwrap_jso((entry) => successCallback(wrap_jso(entry))), unwrap_jso((error) => errorCallback(wrap_jso(error))));
       return;
     }
-    _blink.BlinkWindow.instance.webkitResolveLocalFileSystemURL_Callback_2_(unwrap_jso(this), url, unwrap_jso(successCallback));
+    _blink.BlinkWindow.instance.webkitResolveLocalFileSystemURL_Callback_2_(unwrap_jso(this), url, unwrap_jso((entry) => successCallback(wrap_jso(entry))));
     return;
   }
 
@@ -34735,7 +40558,7 @@
 @DocsEditable()
 @DomName('WindowBase64')
 @Experimental() // untriaged
-abstract class WindowBase64 extends NativeFieldWrapperClass2 {
+abstract class WindowBase64 extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory WindowBase64._() { throw new UnsupportedError("Not supported"); }
 
@@ -34875,9 +40698,23 @@
   @DomName('Worker.Worker')
   @DocsEditable()
   factory Worker(String scriptUrl) {
-    return _blink.BlinkWorker.instance.constructorCallback_1_(scriptUrl);
+    return wrap_jso(_blink.BlinkWorker.instance.constructorCallback_1_(scriptUrl));
   }
 
+
+  @Deprecated("Internal Use Only")
+  static Worker internalCreateWorker() {
+    return new Worker._internalWrap();
+  }
+
+  factory Worker._internalWrap() {
+    return new Worker.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  Worker.internal_() : super.internal_();
+
+
   /// Checks if this type is supported on the current platform.
   static bool get supported => true;
 
@@ -34915,6 +40752,20 @@
   // To suppress missing implicit constructor warnings.
   factory WorkerConsole._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static WorkerConsole internalCreateWorkerConsole() {
+    return new WorkerConsole._internalWrap();
+  }
+
+  factory WorkerConsole._internalWrap() {
+    return new WorkerConsole.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  WorkerConsole.internal_() : super.internal_();
+
+
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -34941,6 +40792,20 @@
   @Experimental() // untriaged
   static const EventStreamProvider<Event> errorEvent = const EventStreamProvider<Event>('error');
 
+
+  @Deprecated("Internal Use Only")
+  static WorkerGlobalScope internalCreateWorkerGlobalScope() {
+    return new WorkerGlobalScope._internalWrap();
+  }
+
+  factory WorkerGlobalScope._internalWrap() {
+    return new WorkerGlobalScope.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  WorkerGlobalScope.internal_() : super.internal_();
+
+
   @DomName('WorkerGlobalScope.PERSISTENT')
   @DocsEditable()
   @Experimental() // untriaged
@@ -34998,11 +40863,11 @@
   
   void _webkitRequestFileSystem(int type, int size, [_FileSystemCallback successCallback, _ErrorCallback errorCallback]) {
     if (errorCallback != null) {
-      _blink.BlinkWorkerGlobalScope.instance.webkitRequestFileSystem_Callback_4_(unwrap_jso(this), type, size, unwrap_jso(successCallback), unwrap_jso(errorCallback));
+      _blink.BlinkWorkerGlobalScope.instance.webkitRequestFileSystem_Callback_4_(unwrap_jso(this), type, size, unwrap_jso((fileSystem) => successCallback(wrap_jso(fileSystem))), unwrap_jso((error) => errorCallback(wrap_jso(error))));
       return;
     }
     if (successCallback != null) {
-      _blink.BlinkWorkerGlobalScope.instance.webkitRequestFileSystem_Callback_3_(unwrap_jso(this), type, size, unwrap_jso(successCallback));
+      _blink.BlinkWorkerGlobalScope.instance.webkitRequestFileSystem_Callback_3_(unwrap_jso(this), type, size, unwrap_jso((fileSystem) => successCallback(wrap_jso(fileSystem))));
       return;
     }
     _blink.BlinkWorkerGlobalScope.instance.webkitRequestFileSystem_Callback_2_(unwrap_jso(this), type, size);
@@ -35023,7 +40888,7 @@
   @SupportedBrowser(SupportedBrowser.SAFARI)
   @Experimental()
   @Experimental() // untriaged
-  _DOMFileSystemSync requestFileSystemSync(int type, int size) => _blink.BlinkWorkerGlobalScope.instance.webkitRequestFileSystemSync_Callback_2_(unwrap_jso(this), type, size);
+  _DOMFileSystemSync requestFileSystemSync(int type, int size) => wrap_jso(_blink.BlinkWorkerGlobalScope.instance.webkitRequestFileSystemSync_Callback_2_(unwrap_jso(this), type, size));
   
   @DomName('WorkerGlobalScope.webkitResolveLocalFileSystemSyncURL')
   @DocsEditable()
@@ -35031,14 +40896,14 @@
   @SupportedBrowser(SupportedBrowser.SAFARI)
   @Experimental()
   @Experimental() // untriaged
-  _EntrySync resolveLocalFileSystemSyncUrl(String url) => _blink.BlinkWorkerGlobalScope.instance.webkitResolveLocalFileSystemSyncURL_Callback_1_(unwrap_jso(this), url);
+  _EntrySync resolveLocalFileSystemSyncUrl(String url) => wrap_jso(_blink.BlinkWorkerGlobalScope.instance.webkitResolveLocalFileSystemSyncURL_Callback_1_(unwrap_jso(this), url));
   
   void _webkitResolveLocalFileSystemUrl(String url, _EntryCallback successCallback, [_ErrorCallback errorCallback]) {
     if (errorCallback != null) {
-      _blink.BlinkWorkerGlobalScope.instance.webkitResolveLocalFileSystemURL_Callback_3_(unwrap_jso(this), url, unwrap_jso(successCallback), unwrap_jso(errorCallback));
+      _blink.BlinkWorkerGlobalScope.instance.webkitResolveLocalFileSystemURL_Callback_3_(unwrap_jso(this), url, unwrap_jso((entry) => successCallback(wrap_jso(entry))), unwrap_jso((error) => errorCallback(wrap_jso(error))));
       return;
     }
-    _blink.BlinkWorkerGlobalScope.instance.webkitResolveLocalFileSystemURL_Callback_2_(unwrap_jso(this), url, unwrap_jso(successCallback));
+    _blink.BlinkWorkerGlobalScope.instance.webkitResolveLocalFileSystemURL_Callback_2_(unwrap_jso(this), url, unwrap_jso((entry) => successCallback(wrap_jso(entry))));
     return;
   }
 
@@ -35097,10 +40962,25 @@
 @DocsEditable()
 @DomName('WorkerPerformance')
 @Experimental() // untriaged
-class WorkerPerformance extends NativeFieldWrapperClass2 {
+class WorkerPerformance extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory WorkerPerformance._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static WorkerPerformance internalCreateWorkerPerformance() {
+    return new WorkerPerformance._internalWrap();
+  }
+
+  factory WorkerPerformance._internalWrap() {
+    return new WorkerPerformance.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  WorkerPerformance.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('WorkerPerformance.memory')
   @DocsEditable()
   @Experimental() // untriaged
@@ -35109,7 +40989,7 @@
   @DomName('WorkerPerformance.now')
   @DocsEditable()
   @Experimental() // untriaged
-  double now() => _blink.BlinkWorkerPerformance.instance.now_Callback_0_(unwrap_jso(this));
+  num now() => _blink.BlinkWorkerPerformance.instance.now_Callback_0_(unwrap_jso(this));
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -35123,16 +41003,31 @@
 @DomName('XPathEvaluator')
 // http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathEvaluator
 @deprecated // experimental
-class XPathEvaluator extends NativeFieldWrapperClass2 {
+class XPathEvaluator extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory XPathEvaluator._() { throw new UnsupportedError("Not supported"); }
 
   @DomName('XPathEvaluator.XPathEvaluator')
   @DocsEditable()
   factory XPathEvaluator() {
-    return _blink.BlinkXPathEvaluator.instance.constructorCallback_0_();
+    return wrap_jso(_blink.BlinkXPathEvaluator.instance.constructorCallback_0_());
   }
 
+  @Deprecated("Internal Use Only")
+  static XPathEvaluator internalCreateXPathEvaluator() {
+    return new XPathEvaluator._internalWrap();
+  }
+
+  factory XPathEvaluator._internalWrap() {
+    return new XPathEvaluator.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  XPathEvaluator.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('XPathEvaluator.createExpression')
   @DocsEditable()
   XPathExpression createExpression(String expression, XPathNSResolver resolver) => wrap_jso(_blink.BlinkXPathEvaluator.instance.createExpression_Callback_2_(unwrap_jso(this), expression, unwrap_jso(resolver)));
@@ -35157,10 +41052,25 @@
 @DomName('XPathExpression')
 // http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathExpression
 @deprecated // experimental
-class XPathExpression extends NativeFieldWrapperClass2 {
+class XPathExpression extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory XPathExpression._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static XPathExpression internalCreateXPathExpression() {
+    return new XPathExpression._internalWrap();
+  }
+
+  factory XPathExpression._internalWrap() {
+    return new XPathExpression.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  XPathExpression.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('XPathExpression.evaluate')
   @DocsEditable()
   XPathResult evaluate(Node contextNode, int type, XPathResult inResult) => wrap_jso(_blink.BlinkXPathExpression.instance.evaluate_Callback_3_(unwrap_jso(this), unwrap_jso(contextNode), type, unwrap_jso(inResult)));
@@ -35177,10 +41087,25 @@
 @DomName('XPathNSResolver')
 // http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathNSResolver
 @deprecated // experimental
-class XPathNSResolver extends NativeFieldWrapperClass2 {
+class XPathNSResolver extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory XPathNSResolver._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static XPathNSResolver internalCreateXPathNSResolver() {
+    return new XPathNSResolver._internalWrap();
+  }
+
+  factory XPathNSResolver._internalWrap() {
+    return new XPathNSResolver.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  XPathNSResolver.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('XPathNSResolver.lookupNamespaceURI')
   @DocsEditable()
   String lookupNamespaceUri(String prefix) => _blink.BlinkXPathNSResolver.instance.lookupNamespaceURI_Callback_1_(unwrap_jso(this), prefix);
@@ -35197,10 +41122,25 @@
 @DomName('XPathResult')
 // http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult
 @deprecated // experimental
-class XPathResult extends NativeFieldWrapperClass2 {
+class XPathResult extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory XPathResult._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static XPathResult internalCreateXPathResult() {
+    return new XPathResult._internalWrap();
+  }
+
+  factory XPathResult._internalWrap() {
+    return new XPathResult.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  XPathResult.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('XPathResult.ANY_TYPE')
   @DocsEditable()
   static const int ANY_TYPE = 0;
@@ -35251,7 +41191,7 @@
   
   @DomName('XPathResult.numberValue')
   @DocsEditable()
-  double get numberValue => _blink.BlinkXPathResult.instance.numberValue_Getter_(unwrap_jso(this));
+  num get numberValue => _blink.BlinkXPathResult.instance.numberValue_Getter_(unwrap_jso(this));
   
   @DomName('XPathResult.resultType')
   @DocsEditable()
@@ -35292,6 +41232,20 @@
   // To suppress missing implicit constructor warnings.
   factory XmlDocument._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static XmlDocument internalCreateXmlDocument() {
+    return new XmlDocument._internalWrap();
+  }
+
+  factory XmlDocument._internalWrap() {
+    return new XmlDocument.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  XmlDocument.internal_() : super.internal_();
+
+
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -35304,16 +41258,31 @@
 @DomName('XMLSerializer')
 // http://domparsing.spec.whatwg.org/#the-xmlserializer-interface
 @deprecated // stable
-class XmlSerializer extends NativeFieldWrapperClass2 {
+class XmlSerializer extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory XmlSerializer._() { throw new UnsupportedError("Not supported"); }
 
   @DomName('XMLSerializer.XMLSerializer')
   @DocsEditable()
   factory XmlSerializer() {
-    return _blink.BlinkXMLSerializer.instance.constructorCallback_0_();
+    return wrap_jso(_blink.BlinkXMLSerializer.instance.constructorCallback_0_());
   }
 
+  @Deprecated("Internal Use Only")
+  static XmlSerializer internalCreateXmlSerializer() {
+    return new XmlSerializer._internalWrap();
+  }
+
+  factory XmlSerializer._internalWrap() {
+    return new XmlSerializer.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  XmlSerializer.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('XMLSerializer.serializeToString')
   @DocsEditable()
   String serializeToString(Node node) => _blink.BlinkXMLSerializer.instance.serializeToString_Callback_1_(unwrap_jso(this), unwrap_jso(node));
@@ -35332,16 +41301,31 @@
 @SupportedBrowser(SupportedBrowser.FIREFOX)
 @SupportedBrowser(SupportedBrowser.SAFARI)
 @deprecated // nonstandard
-class XsltProcessor extends NativeFieldWrapperClass2 {
+class XsltProcessor extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory XsltProcessor._() { throw new UnsupportedError("Not supported"); }
 
   @DomName('XSLTProcessor.XSLTProcessor')
   @DocsEditable()
   factory XsltProcessor() {
-    return _blink.BlinkXSLTProcessor.instance.constructorCallback_0_();
+    return wrap_jso(_blink.BlinkXSLTProcessor.instance.constructorCallback_0_());
   }
 
+  @Deprecated("Internal Use Only")
+  static XsltProcessor internalCreateXsltProcessor() {
+    return new XsltProcessor._internalWrap();
+  }
+
+  factory XsltProcessor._internalWrap() {
+    return new XsltProcessor.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  XsltProcessor.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   /// Checks if this type is supported on the current platform.
   static bool get supported => true;
 
@@ -35391,6 +41375,20 @@
   // To suppress missing implicit constructor warnings.
   factory _Attr._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static _Attr internalCreate_Attr() {
+    return new _Attr._internalWrap();
+  }
+
+  factory _Attr._internalWrap() {
+    return new _Attr.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  _Attr.internal_() : super.internal_();
+
+
   @DomName('Attr.localName')
   @DocsEditable()
   @Experimental() // untriaged
@@ -35418,7 +41416,7 @@
   @DomName('Attr.textContent')
   @DocsEditable()
   @Experimental() // untriaged
-  void set text(String value) => _blink.BlinkAttr.instance.textContent_Setter_(unwrap_jso(this), value);
+  set text(String value) => _blink.BlinkAttr.instance.textContent_Setter_(unwrap_jso(this), value);
   
   @DomName('Attr.value')
   @DocsEditable()
@@ -35426,7 +41424,7 @@
   
   @DomName('Attr.value')
   @DocsEditable()
-  void set value(String value) => _blink.BlinkAttr.instance.value_Setter_(unwrap_jso(this), value);
+  set value(String value) => _blink.BlinkAttr.instance.value_Setter_(unwrap_jso(this), value);
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -35440,10 +41438,24 @@
 @DomName('CSSPrimitiveValue')
 // http://dev.w3.org/csswg/cssom/#the-cssstyledeclaration-interface
 @deprecated // deprecated
-abstract class _CSSPrimitiveValue extends _CSSValue {
+class _CSSPrimitiveValue extends _CSSValue {
   // To suppress missing implicit constructor warnings.
   factory _CSSPrimitiveValue._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static _CSSPrimitiveValue internalCreate_CSSPrimitiveValue() {
+    return new _CSSPrimitiveValue._internalWrap();
+  }
+
+  factory _CSSPrimitiveValue._internalWrap() {
+    return new _CSSPrimitiveValue.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  _CSSPrimitiveValue.internal_() : super.internal_();
+
+
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -35456,10 +41468,24 @@
 @DomName('CSSUnknownRule')
 // http://dev.w3.org/csswg/cssom/#the-cssstylesheet-interface
 @deprecated // deprecated
-abstract class _CSSUnknownRule extends CssRule {
+class _CSSUnknownRule extends CssRule {
   // To suppress missing implicit constructor warnings.
   factory _CSSUnknownRule._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static _CSSUnknownRule internalCreate_CSSUnknownRule() {
+    return new _CSSUnknownRule._internalWrap();
+  }
+
+  factory _CSSUnknownRule._internalWrap() {
+    return new _CSSUnknownRule.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  _CSSUnknownRule.internal_() : super.internal_();
+
+
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -35472,10 +41498,25 @@
 @DomName('CSSValue')
 // http://dev.w3.org/csswg/cssom/
 @deprecated // deprecated
-abstract class _CSSValue extends NativeFieldWrapperClass2 {
+class _CSSValue extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory _CSSValue._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static _CSSValue internalCreate_CSSValue() {
+    return new _CSSValue._internalWrap();
+  }
+
+  factory _CSSValue._internalWrap() {
+    return new _CSSValue.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  _CSSValue.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -35487,10 +41528,25 @@
 @DocsEditable()
 @DomName('Cache')
 @Experimental() // untriaged
-abstract class _Cache extends NativeFieldWrapperClass2 {
+class _Cache extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory _Cache._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static _Cache internalCreate_Cache() {
+    return new _Cache._internalWrap();
+  }
+
+  factory _Cache._internalWrap() {
+    return new _Cache.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  _Cache.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -35502,7 +41558,7 @@
 @DocsEditable()
 @DomName('CanvasPathMethods')
 @Experimental() // untriaged
-abstract class _CanvasPathMethods extends NativeFieldWrapperClass2 {
+class _CanvasPathMethods extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory _CanvasPathMethods._() { throw new UnsupportedError("Not supported"); }
 
@@ -35514,7 +41570,7 @@
 
 @DocsEditable()
 @DomName('ClientRect')
-class _ClientRect extends NativeFieldWrapperClass2 implements Rectangle {
+class _ClientRect extends DartHtmlDomObject implements Rectangle {
 
   // NOTE! All code below should be common with RectangleBase.
    String toString() {
@@ -35608,29 +41664,42 @@
     // To suppress missing implicit constructor warnings.
   factory _ClientRect._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static _ClientRect internalCreate_ClientRect() {
+    return new _ClientRect._internalWrap();
+  }
+
+  factory _ClientRect._internalWrap() {
+    return new _ClientRect.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  _ClientRect.internal_() { }
+
+
   @DomName('ClientRect.bottom')
   @DocsEditable()
-  double get bottom => _blink.BlinkClientRect.instance.bottom_Getter_(unwrap_jso(this));
+  num get bottom => _blink.BlinkClientRect.instance.bottom_Getter_(unwrap_jso(this));
   
   @DomName('ClientRect.height')
   @DocsEditable()
-  double get height => _blink.BlinkClientRect.instance.height_Getter_(unwrap_jso(this));
+  num get height => _blink.BlinkClientRect.instance.height_Getter_(unwrap_jso(this));
   
   @DomName('ClientRect.left')
   @DocsEditable()
-  double get left => _blink.BlinkClientRect.instance.left_Getter_(unwrap_jso(this));
+  num get left => _blink.BlinkClientRect.instance.left_Getter_(unwrap_jso(this));
   
   @DomName('ClientRect.right')
   @DocsEditable()
-  double get right => _blink.BlinkClientRect.instance.right_Getter_(unwrap_jso(this));
+  num get right => _blink.BlinkClientRect.instance.right_Getter_(unwrap_jso(this));
   
   @DomName('ClientRect.top')
   @DocsEditable()
-  double get top => _blink.BlinkClientRect.instance.top_Getter_(unwrap_jso(this));
+  num get top => _blink.BlinkClientRect.instance.top_Getter_(unwrap_jso(this));
   
   @DomName('ClientRect.width')
   @DocsEditable()
-  double get width => _blink.BlinkClientRect.instance.width_Getter_(unwrap_jso(this));
+  num get width => _blink.BlinkClientRect.instance.width_Getter_(unwrap_jso(this));
   }
 
 /**
@@ -35678,10 +41747,25 @@
 
 @DocsEditable()
 @DomName('ClientRectList')
-class _ClientRectList extends NativeFieldWrapperClass2 with ListMixin<Rectangle>, ImmutableListMixin<Rectangle> implements List<Rectangle> {
+class _ClientRectList extends DartHtmlDomObject with ListMixin<Rectangle>, ImmutableListMixin<Rectangle> implements List<Rectangle> {
   // To suppress missing implicit constructor warnings.
   factory _ClientRectList._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static _ClientRectList internalCreate_ClientRectList() {
+    return new _ClientRectList._internalWrap();
+  }
+
+  factory _ClientRectList._internalWrap() {
+    return new _ClientRectList.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  _ClientRectList.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('ClientRectList.length')
   @DocsEditable()
   int get length => _blink.BlinkClientRectList.instance.length_Getter_(unwrap_jso(this));
@@ -35693,7 +41777,7 @@
   }
 
   Rectangle _nativeIndexedGetter(int index) => wrap_jso(_blink.BlinkClientRectList.instance.item_Callback_1_(unwrap_jso(this), index));
- 
+
   void operator[]=(int index, Rectangle value) {
     throw new UnsupportedError("Cannot assign element of immutable List.");
   }
@@ -35701,7 +41785,7 @@
   // Rectangle is the element type.
 
 
-  void set length(int value) {
+  set length(int value) {
     throw new UnsupportedError("Cannot resize immutable List.");
   }
 
@@ -35748,10 +41832,25 @@
 @DomName('Counter')
 // http://dev.w3.org/csswg/cssom/
 @deprecated // deprecated
-abstract class _Counter extends NativeFieldWrapperClass2 {
+class _Counter extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory _Counter._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static _Counter internalCreate_Counter() {
+    return new _Counter._internalWrap();
+  }
+
+  factory _Counter._internalWrap() {
+    return new _Counter.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  _Counter.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -35762,10 +41861,25 @@
 
 @DocsEditable()
 @DomName('CSSRuleList')
-class _CssRuleList extends NativeFieldWrapperClass2 with ListMixin<CssRule>, ImmutableListMixin<CssRule> implements List<CssRule> {
+class _CssRuleList extends DartHtmlDomObject with ListMixin<CssRule>, ImmutableListMixin<CssRule> implements List<CssRule> {
   // To suppress missing implicit constructor warnings.
   factory _CssRuleList._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static _CssRuleList internalCreate_CssRuleList() {
+    return new _CssRuleList._internalWrap();
+  }
+
+  factory _CssRuleList._internalWrap() {
+    return new _CssRuleList.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  _CssRuleList.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('CSSRuleList.length')
   @DocsEditable()
   int get length => _blink.BlinkCSSRuleList.instance.length_Getter_(unwrap_jso(this));
@@ -35777,7 +41891,7 @@
   }
 
   CssRule _nativeIndexedGetter(int index) => wrap_jso(_blink.BlinkCSSRuleList.instance.item_Callback_1_(unwrap_jso(this), index));
- 
+
   void operator[]=(int index, CssRule value) {
     throw new UnsupportedError("Cannot assign element of immutable List.");
   }
@@ -35785,7 +41899,7 @@
   // CssRule is the element type.
 
 
-  void set length(int value) {
+  set length(int value) {
     throw new UnsupportedError("Cannot resize immutable List.");
   }
 
@@ -35818,7 +41932,7 @@
 
   @DomName('CSSRuleList.item')
   @DocsEditable()
-  CssRule item(int index) => _blink.BlinkCSSRuleList.instance.item_Callback_1_(unwrap_jso(this), index);
+  CssRule item(int index) => wrap_jso(_blink.BlinkCSSRuleList.instance.item_Callback_1_(unwrap_jso(this), index));
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -35836,6 +41950,20 @@
   // To suppress missing implicit constructor warnings.
   factory _CssValueList._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static _CssValueList internalCreate_CssValueList() {
+    return new _CssValueList._internalWrap();
+  }
+
+  factory _CssValueList._internalWrap() {
+    return new _CssValueList.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  _CssValueList.internal_() : super.internal_();
+
+
   @DomName('CSSValueList.length')
   @DocsEditable()
   int get length => _blink.BlinkCSSValueList.instance.length_Getter_(unwrap_jso(this));
@@ -35847,7 +41975,7 @@
   }
 
   _CSSValue _nativeIndexedGetter(int index) => wrap_jso(_blink.BlinkCSSValueList.instance.item_Callback_1_(unwrap_jso(this), index));
- 
+
   void operator[]=(int index, _CSSValue value) {
     throw new UnsupportedError("Cannot assign element of immutable List.");
   }
@@ -35855,7 +41983,7 @@
   // _CSSValue is the element type.
 
 
-  void set length(int value) {
+  set length(int value) {
     throw new UnsupportedError("Cannot resize immutable List.");
   }
 
@@ -35888,7 +42016,7 @@
 
   @DomName('CSSValueList.item')
   @DocsEditable()
-  _CSSValue item(int index) => _blink.BlinkCSSValueList.instance.item_Callback_1_(unwrap_jso(this), index);
+  _CSSValue item(int index) => wrap_jso(_blink.BlinkCSSValueList.instance.item_Callback_1_(unwrap_jso(this), index));
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -35903,10 +42031,25 @@
 @SupportedBrowser(SupportedBrowser.CHROME)
 @Experimental()
 // http://www.w3.org/TR/file-system-api/#the-filesystemsync-interface
-abstract class _DOMFileSystemSync extends NativeFieldWrapperClass2 {
+class _DOMFileSystemSync extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory _DOMFileSystemSync._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static _DOMFileSystemSync internalCreate_DOMFileSystemSync() {
+    return new _DOMFileSystemSync._internalWrap();
+  }
+
+  factory _DOMFileSystemSync._internalWrap() {
+    return new _DOMFileSystemSync.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  _DOMFileSystemSync.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -35919,10 +42062,24 @@
 @DomName('DirectoryEntrySync')
 // http://www.w3.org/TR/file-system-api/#the-directoryentrysync-interface
 @Experimental()
-abstract class _DirectoryEntrySync extends _EntrySync {
+class _DirectoryEntrySync extends _EntrySync {
   // To suppress missing implicit constructor warnings.
   factory _DirectoryEntrySync._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static _DirectoryEntrySync internalCreate_DirectoryEntrySync() {
+    return new _DirectoryEntrySync._internalWrap();
+  }
+
+  factory _DirectoryEntrySync._internalWrap() {
+    return new _DirectoryEntrySync.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  _DirectoryEntrySync.internal_() : super.internal_();
+
+
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -35935,27 +42092,58 @@
 @DomName('DirectoryReaderSync')
 // http://www.w3.org/TR/file-system-api/#idl-def-DirectoryReaderSync
 @Experimental()
-abstract class _DirectoryReaderSync extends NativeFieldWrapperClass2 {
+class _DirectoryReaderSync extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory _DirectoryReaderSync._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static _DirectoryReaderSync internalCreate_DirectoryReaderSync() {
+    return new _DirectoryReaderSync._internalWrap();
+  }
+
+  factory _DirectoryReaderSync._internalWrap() {
+    return new _DirectoryReaderSync.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  _DirectoryReaderSync.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-// WARNING: Do not edit - generated code.
-
 
 @DocsEditable()
 @DomName('DocumentType')
 // http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-412266927
 @deprecated // stable
-abstract class _DocumentType extends Node implements ChildNode {
+class _DocumentType extends Node implements ChildNode {
   // To suppress missing implicit constructor warnings.
   factory _DocumentType._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static _DocumentType internalCreate_DocumentType() {
+    return new _DocumentType._internalWrap();
+  }
+
+  factory _DocumentType._internalWrap() {
+    return new _DocumentType.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  _DocumentType.internal_() : super.internal_();
+
+
+  // Override this methods for Dartium _DocumentType can't be abstract.
+  Element get nextElementSibling => wrap_jso(_blink.BlinkDocumentType.instance.nextElementSibling_Getter_(unwrap_jso(this)));
+  Element get previousElementSibling => wrap_jso(_blink.BlinkDocumentType.instance.previousElementSibling_Getter_(unwrap_jso(this)));
 }
+
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
@@ -35974,20 +42162,34 @@
   @DocsEditable()
   factory _DomRect([num x, num y, num width, num height]) {
     if (height != null) {
-      return _blink.BlinkDOMRect.instance.constructorCallback_4_(x, y, width, height);
+      return wrap_jso(_blink.BlinkDOMRect.instance.constructorCallback_4_(x, y, width, height));
     }
     if (width != null) {
-      return _blink.BlinkDOMRect.instance.constructorCallback_3_(x, y, width);
+      return wrap_jso(_blink.BlinkDOMRect.instance.constructorCallback_3_(x, y, width));
     }
     if (y != null) {
-      return _blink.BlinkDOMRect.instance.constructorCallback_2_(x, y);
+      return wrap_jso(_blink.BlinkDOMRect.instance.constructorCallback_2_(x, y));
     }
     if (x != null) {
-      return _blink.BlinkDOMRect.instance.constructorCallback_1_(x);
+      return wrap_jso(_blink.BlinkDOMRect.instance.constructorCallback_1_(x));
     }
-    return _blink.BlinkDOMRect.instance.constructorCallback_0_();
+    return wrap_jso(_blink.BlinkDOMRect.instance.constructorCallback_0_());
   }
 
+
+  @Deprecated("Internal Use Only")
+  static _DomRect internalCreate_DomRect() {
+    return new _DomRect._internalWrap();
+  }
+
+  factory _DomRect._internalWrap() {
+    return new _DomRect.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  _DomRect.internal_() : super.internal_();
+
+
   @DomName('DOMRect.height')
   @DocsEditable()
   @Experimental() // untriaged
@@ -35996,7 +42198,7 @@
   @DomName('DOMRect.height')
   @DocsEditable()
   @Experimental() // untriaged
-  void set height(num value) => _blink.BlinkDOMRect.instance.height_Setter_(unwrap_jso(this), value);
+  set height(num value) => _blink.BlinkDOMRect.instance.height_Setter_(unwrap_jso(this), value);
   
   @DomName('DOMRect.width')
   @DocsEditable()
@@ -36006,7 +42208,7 @@
   @DomName('DOMRect.width')
   @DocsEditable()
   @Experimental() // untriaged
-  void set width(num value) => _blink.BlinkDOMRect.instance.width_Setter_(unwrap_jso(this), value);
+  set width(num value) => _blink.BlinkDOMRect.instance.width_Setter_(unwrap_jso(this), value);
   
   @DomName('DOMRect.x')
   @DocsEditable()
@@ -36016,7 +42218,7 @@
   @DomName('DOMRect.x')
   @DocsEditable()
   @Experimental() // untriaged
-  void set x(num value) => _blink.BlinkDOMRect.instance.x_Setter_(unwrap_jso(this), value);
+  set x(num value) => _blink.BlinkDOMRect.instance.x_Setter_(unwrap_jso(this), value);
   
   @DomName('DOMRect.y')
   @DocsEditable()
@@ -36026,7 +42228,7 @@
   @DomName('DOMRect.y')
   @DocsEditable()
   @Experimental() // untriaged
-  void set y(num value) => _blink.BlinkDOMRect.instance.y_Setter_(unwrap_jso(this), value);
+  set y(num value) => _blink.BlinkDOMRect.instance.y_Setter_(unwrap_jso(this), value);
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -36040,10 +42242,25 @@
 @DomName('EntrySync')
 // http://www.w3.org/TR/file-system-api/#idl-def-EntrySync
 @Experimental()
-abstract class _EntrySync extends NativeFieldWrapperClass2 {
+class _EntrySync extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory _EntrySync._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static _EntrySync internalCreate_EntrySync() {
+    return new _EntrySync._internalWrap();
+  }
+
+  factory _EntrySync._internalWrap() {
+    return new _EntrySync.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  _EntrySync.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -36056,10 +42273,24 @@
 @DomName('FileEntrySync')
 // http://www.w3.org/TR/file-system-api/#the-fileentrysync-interface
 @Experimental()
-abstract class _FileEntrySync extends _EntrySync {
+class _FileEntrySync extends _EntrySync {
   // To suppress missing implicit constructor warnings.
   factory _FileEntrySync._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static _FileEntrySync internalCreate_FileEntrySync() {
+    return new _FileEntrySync._internalWrap();
+  }
+
+  factory _FileEntrySync._internalWrap() {
+    return new _FileEntrySync.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  _FileEntrySync.internal_() : super.internal_();
+
+
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -36072,16 +42303,31 @@
 @DomName('FileReaderSync')
 // http://www.w3.org/TR/FileAPI/#FileReaderSync
 @Experimental()
-abstract class _FileReaderSync extends NativeFieldWrapperClass2 {
+class _FileReaderSync extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory _FileReaderSync._() { throw new UnsupportedError("Not supported"); }
 
   @DomName('FileReaderSync.FileReaderSync')
   @DocsEditable()
   factory _FileReaderSync() {
-    return _blink.BlinkFileReaderSync.instance.constructorCallback_0_();
+    return wrap_jso(_blink.BlinkFileReaderSync.instance.constructorCallback_0_());
   }
 
+  @Deprecated("Internal Use Only")
+  static _FileReaderSync internalCreate_FileReaderSync() {
+    return new _FileReaderSync._internalWrap();
+  }
+
+  factory _FileReaderSync._internalWrap() {
+    return new _FileReaderSync.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  _FileReaderSync.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -36094,10 +42340,25 @@
 @DomName('FileWriterSync')
 // http://www.w3.org/TR/file-writer-api/#idl-def-FileWriterSync
 @Experimental()
-abstract class _FileWriterSync extends NativeFieldWrapperClass2 {
+class _FileWriterSync extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory _FileWriterSync._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static _FileWriterSync internalCreate_FileWriterSync() {
+    return new _FileWriterSync._internalWrap();
+  }
+
+  factory _FileWriterSync._internalWrap() {
+    return new _FileWriterSync.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  _FileWriterSync.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -36110,10 +42371,25 @@
 @DomName('GamepadList')
 // https://dvcs.w3.org/hg/gamepad/raw-file/default/gamepad.html
 @Experimental()
-class _GamepadList extends NativeFieldWrapperClass2 with ListMixin<Gamepad>, ImmutableListMixin<Gamepad> implements List<Gamepad> {
+class _GamepadList extends DartHtmlDomObject with ListMixin<Gamepad>, ImmutableListMixin<Gamepad> implements List<Gamepad> {
   // To suppress missing implicit constructor warnings.
   factory _GamepadList._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static _GamepadList internalCreate_GamepadList() {
+    return new _GamepadList._internalWrap();
+  }
+
+  factory _GamepadList._internalWrap() {
+    return new _GamepadList.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  _GamepadList.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('GamepadList.length')
   @DocsEditable()
   int get length => _blink.BlinkGamepadList.instance.length_Getter_(unwrap_jso(this));
@@ -36125,7 +42401,7 @@
   }
 
   Gamepad _nativeIndexedGetter(int index) => wrap_jso(_blink.BlinkGamepadList.instance.item_Callback_1_(unwrap_jso(this), index));
- 
+
   void operator[]=(int index, Gamepad value) {
     throw new UnsupportedError("Cannot assign element of immutable List.");
   }
@@ -36133,7 +42409,7 @@
   // Gamepad is the element type.
 
 
-  void set length(int value) {
+  set length(int value) {
     throw new UnsupportedError("Cannot resize immutable List.");
   }
 
@@ -36180,10 +42456,25 @@
 @DomName('HTMLAllCollection')
 // http://www.whatwg.org/specs/web-apps/current-work/multipage/obsolete.html#dom-document-all
 @deprecated // deprecated
-abstract class _HTMLAllCollection extends NativeFieldWrapperClass2 {
+class _HTMLAllCollection extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory _HTMLAllCollection._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static _HTMLAllCollection internalCreate_HTMLAllCollection() {
+    return new _HTMLAllCollection._internalWrap();
+  }
+
+  factory _HTMLAllCollection._internalWrap() {
+    return new _HTMLAllCollection.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  _HTMLAllCollection.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('HTMLAllCollection.item')
   @DocsEditable()
   Element _item(int index) => wrap_jso(_blink.BlinkHTMLAllCollection.instance.item_Callback_1_(unwrap_jso(this), index));
@@ -36200,9 +42491,23 @@
 @DomName('HTMLAppletElement')
 // http://www.whatwg.org/specs/web-apps/current-work/multipage/obsolete.html#the-applet-element
 @deprecated // deprecated
-abstract class _HTMLAppletElement extends HtmlElement {
+class _HTMLAppletElement extends HtmlElement {
   // To suppress missing implicit constructor warnings.
   factory _HTMLAppletElement._() { throw new UnsupportedError("Not supported"); }
+
+
+  @Deprecated("Internal Use Only")
+  static _HTMLAppletElement internalCreate_HTMLAppletElement() {
+    return new _HTMLAppletElement._internalWrap();
+  }
+
+  factory _HTMLAppletElement._internalWrap() {
+    return new _HTMLAppletElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  _HTMLAppletElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -36222,9 +42527,23 @@
 @DomName('HTMLDirectoryElement')
 // http://www.whatwg.org/specs/web-apps/current-work/multipage/obsolete.html#dir
 @deprecated // deprecated
-abstract class _HTMLDirectoryElement extends HtmlElement {
+class _HTMLDirectoryElement extends HtmlElement {
   // To suppress missing implicit constructor warnings.
   factory _HTMLDirectoryElement._() { throw new UnsupportedError("Not supported"); }
+
+
+  @Deprecated("Internal Use Only")
+  static _HTMLDirectoryElement internalCreate_HTMLDirectoryElement() {
+    return new _HTMLDirectoryElement._internalWrap();
+  }
+
+  factory _HTMLDirectoryElement._internalWrap() {
+    return new _HTMLDirectoryElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  _HTMLDirectoryElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -36244,9 +42563,23 @@
 @DomName('HTMLFontElement')
 // http://www.whatwg.org/specs/web-apps/current-work/multipage/obsolete.html#htmlfontelement
 @deprecated // deprecated
-abstract class _HTMLFontElement extends HtmlElement {
+class _HTMLFontElement extends HtmlElement {
   // To suppress missing implicit constructor warnings.
   factory _HTMLFontElement._() { throw new UnsupportedError("Not supported"); }
+
+
+  @Deprecated("Internal Use Only")
+  static _HTMLFontElement internalCreate_HTMLFontElement() {
+    return new _HTMLFontElement._internalWrap();
+  }
+
+  factory _HTMLFontElement._internalWrap() {
+    return new _HTMLFontElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  _HTMLFontElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -36266,9 +42599,23 @@
 @DomName('HTMLFrameElement')
 // http://www.whatwg.org/specs/web-apps/current-work/multipage/obsolete.html#htmlframeelement
 @deprecated // deprecated
-abstract class _HTMLFrameElement extends HtmlElement {
+class _HTMLFrameElement extends HtmlElement {
   // To suppress missing implicit constructor warnings.
   factory _HTMLFrameElement._() { throw new UnsupportedError("Not supported"); }
+
+
+  @Deprecated("Internal Use Only")
+  static _HTMLFrameElement internalCreate_HTMLFrameElement() {
+    return new _HTMLFrameElement._internalWrap();
+  }
+
+  factory _HTMLFrameElement._internalWrap() {
+    return new _HTMLFrameElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  _HTMLFrameElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -36281,16 +42628,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.
 
-// WARNING: Do not edit - generated code.
-
 
 @DocsEditable()
 @DomName('HTMLFrameSetElement')
 // http://www.whatwg.org/specs/web-apps/current-work/multipage/obsolete.html#frameset
 @deprecated // deprecated
-abstract class _HTMLFrameSetElement extends HtmlElement implements WindowEventHandlers {
+class _HTMLFrameSetElement extends HtmlElement implements WindowEventHandlers {
   // To suppress missing implicit constructor warnings.
   factory _HTMLFrameSetElement._() { throw new UnsupportedError("Not supported"); }
+
+
+  @Deprecated("Internal Use Only")
+  static _HTMLFrameSetElement internalCreate_HTMLFrameSetElement() {
+    return new _HTMLFrameSetElement._internalWrap();
+  }
+
+  factory _HTMLFrameSetElement._internalWrap() {
+    return new _HTMLFrameSetElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  _HTMLFrameSetElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -36298,7 +42657,16 @@
    */
   _HTMLFrameSetElement.created() : super.created();
 
+  // Override these methods for Dartium _HTMLFrameSetElement can't be abstract.
+  Stream<Event> get onHashChange => hashChangeEvent.forTarget(this);
+  Stream<MessageEvent> get onMessage => messageEvent.forTarget(this);
+  Stream<Event> get onOffline => offlineEvent.forTarget(this);
+  Stream<Event> get onOnline => onlineEvent.forTarget(this);
+  Stream<PopStateEvent> get onPopState => popStateEvent.forTarget(this);
+  Stream<StorageEvent> get onStorage => storageEvent.forTarget(this);
+  Stream<Event> get onUnload => unloadEvent.forTarget(this);
 }
+
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
@@ -36310,9 +42678,23 @@
 @DomName('HTMLMarqueeElement')
 // http://www.whatwg.org/specs/web-apps/current-work/multipage/obsolete.html#the-marquee-element
 @deprecated // deprecated
-abstract class _HTMLMarqueeElement extends HtmlElement {
+class _HTMLMarqueeElement extends HtmlElement {
   // To suppress missing implicit constructor warnings.
   factory _HTMLMarqueeElement._() { throw new UnsupportedError("Not supported"); }
+
+
+  @Deprecated("Internal Use Only")
+  static _HTMLMarqueeElement internalCreate_HTMLMarqueeElement() {
+    return new _HTMLMarqueeElement._internalWrap();
+  }
+
+  factory _HTMLMarqueeElement._internalWrap() {
+    return new _HTMLMarqueeElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  _HTMLMarqueeElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -36329,7 +42711,7 @@
 @DomName('MutationEvent')
 // http://www.w3.org/TR/DOM-Level-3-Events/#events-mutationevents
 @deprecated
-abstract class _MutationEvent extends Event {
+class _MutationEvent extends Event {
   factory _MutationEvent(String type,
       {bool canBubble: false, bool cancelable: false, Node relatedNode,
       String prevValue, String newValue, String attrName, int attrChange: 0}) {
@@ -36342,6 +42724,20 @@
   // To suppress missing implicit constructor warnings.
   factory _MutationEvent._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static _MutationEvent internalCreate_MutationEvent() {
+    return new _MutationEvent._internalWrap();
+  }
+
+  factory _MutationEvent._internalWrap() {
+    return new _MutationEvent.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  _MutationEvent.internal_() : super.internal_();
+
+
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -36354,10 +42750,25 @@
 @DomName('NamedNodeMap')
 // http://dom.spec.whatwg.org/#namednodemap
 @deprecated // deprecated
-class _NamedNodeMap extends NativeFieldWrapperClass2 with ListMixin<Node>, ImmutableListMixin<Node> implements List<Node> {
+class _NamedNodeMap extends DartHtmlDomObject with ListMixin<Node>, ImmutableListMixin<Node> implements List<Node> {
   // To suppress missing implicit constructor warnings.
   factory _NamedNodeMap._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static _NamedNodeMap internalCreate_NamedNodeMap() {
+    return new _NamedNodeMap._internalWrap();
+  }
+
+  factory _NamedNodeMap._internalWrap() {
+    return new _NamedNodeMap.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  _NamedNodeMap.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('NamedNodeMap.length')
   @DocsEditable()
   int get length => _blink.BlinkNamedNodeMap.instance.length_Getter_(unwrap_jso(this));
@@ -36369,7 +42780,7 @@
   }
 
   Node _nativeIndexedGetter(int index) => wrap_jso(_blink.BlinkNamedNodeMap.instance.item_Callback_1_(unwrap_jso(this), index));
- 
+
   void operator[]=(int index, Node value) {
     throw new UnsupportedError("Cannot assign element of immutable List.");
   }
@@ -36377,7 +42788,7 @@
   // Node is the element type.
 
 
-  void set length(int value) {
+  set length(int value) {
     throw new UnsupportedError("Cannot resize immutable List.");
   }
 
@@ -36451,10 +42862,25 @@
 @DocsEditable()
 @DomName('PagePopupController')
 @deprecated // nonstandard
-abstract class _PagePopupController extends NativeFieldWrapperClass2 {
+class _PagePopupController extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory _PagePopupController._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static _PagePopupController internalCreate_PagePopupController() {
+    return new _PagePopupController._internalWrap();
+  }
+
+  factory _PagePopupController._internalWrap() {
+    return new _PagePopupController.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  _PagePopupController.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -36467,10 +42893,25 @@
 @DomName('RGBColor')
 // http://dev.w3.org/csswg/cssom/
 @deprecated // deprecated
-abstract class _RGBColor extends NativeFieldWrapperClass2 {
+class _RGBColor extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory _RGBColor._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static _RGBColor internalCreate_RGBColor() {
+    return new _RGBColor._internalWrap();
+  }
+
+  factory _RGBColor._internalWrap() {
+    return new _RGBColor.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  _RGBColor.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
 }
 // 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
@@ -36478,10 +42919,24 @@
 
 
 @DomName('RadioNodeList')
-abstract class _RadioNodeList extends NodeList {
+class _RadioNodeList extends NodeList {
   // To suppress missing implicit constructor warnings.
   factory _RadioNodeList._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static _RadioNodeList internalCreate_RadioNodeList() {
+    return new _RadioNodeList._internalWrap();
+  }
+
+  factory _RadioNodeList._internalWrap() {
+    return new _RadioNodeList.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  _RadioNodeList.internal_() : super.internal_();
+
+
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -36494,10 +42949,25 @@
 @DomName('Rect')
 // http://dev.w3.org/csswg/cssom/
 @deprecated // deprecated
-abstract class _Rect extends NativeFieldWrapperClass2 {
+class _Rect extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory _Rect._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static _Rect internalCreate_Rect() {
+    return new _Rect._internalWrap();
+  }
+
+  factory _Rect._internalWrap() {
+    return new _Rect.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  _Rect.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -36517,20 +42987,36 @@
   @DocsEditable()
   factory _Request(input, [Map requestInitDict]) {
     if ((input is String || input == null) && requestInitDict == null) {
-      return _blink.BlinkRequest.instance.constructorCallback_1_(input);
+      return wrap_jso(_blink.BlinkRequest.instance.constructorCallback_1_(input));
     }
     if ((requestInitDict is Map || requestInitDict == null) && (input is String || input == null)) {
-      return _blink.BlinkRequest.instance.constructorCallback_2_(input, requestInitDict);
+      var requestInitDict_1 = convertDartToNative_Dictionary(requestInitDict);
+      return wrap_jso(_blink.BlinkRequest.instance.constructorCallback_2_(input, requestInitDict_1));
     }
     if ((input is _Request || input == null) && requestInitDict == null) {
-      return _blink.BlinkRequest.instance.constructorCallback_1_(input);
+      return wrap_jso(_blink.BlinkRequest.instance.constructorCallback_1_(input));
     }
     if ((requestInitDict is Map || requestInitDict == null) && (input is _Request || input == null)) {
-      return _blink.BlinkRequest.instance.constructorCallback_2_(input, requestInitDict);
+      var requestInitDict_1 = convertDartToNative_Dictionary(requestInitDict);
+      return wrap_jso(_blink.BlinkRequest.instance.constructorCallback_2_(input, requestInitDict_1));
     }
     throw new ArgumentError("Incorrect number or type of arguments");
   }
 
+
+  @Deprecated("Internal Use Only")
+  static _Request internalCreate_Request() {
+    return new _Request._internalWrap();
+  }
+
+  factory _Request._internalWrap() {
+    return new _Request.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  _Request.internal_() : super.internal_();
+
+
   @DomName('Request.credentials')
   @DocsEditable()
   @Experimental() // untriaged
@@ -36559,7 +43045,7 @@
   @DomName('Request.clone')
   @DocsEditable()
   @Experimental() // untriaged
-  _Request clone() => _blink.BlinkRequest.instance.clone_Callback_0_(unwrap_jso(this));
+  _Request clone() => wrap_jso(_blink.BlinkRequest.instance.clone_Callback_0_(unwrap_jso(this)));
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -36572,7 +43058,7 @@
 @DocsEditable()
 @DomName('Response')
 @Experimental() // untriaged
-abstract class _Response extends Body {
+class _Response extends Body {
   // To suppress missing implicit constructor warnings.
   factory _Response._() { throw new UnsupportedError("Not supported"); }
 
@@ -36580,48 +43066,81 @@
   @DocsEditable()
   factory _Response(body_OR_input, [Map requestInitDict_OR_responseInitDict]) {
     if ((body_OR_input is String || body_OR_input == null) && requestInitDict_OR_responseInitDict == null) {
-      return _blink.BlinkResponse.instance.constructorCallback_1_(body_OR_input);
+      return wrap_jso(_blink.BlinkResponse.instance.constructorCallback_1_(body_OR_input));
     }
     if ((requestInitDict_OR_responseInitDict is Map || requestInitDict_OR_responseInitDict == null) && (body_OR_input is String || body_OR_input == null)) {
-      return _blink.BlinkResponse.instance.constructorCallback_2_(body_OR_input, requestInitDict_OR_responseInitDict);
+      var responseInitDict_1 = convertDartToNative_Dictionary(requestInitDict_OR_responseInitDict);
+      return wrap_jso(_blink.BlinkResponse.instance.constructorCallback_2_(body_OR_input, responseInitDict_1));
     }
     if ((body_OR_input is Blob || body_OR_input == null) && requestInitDict_OR_responseInitDict == null) {
-      return _blink.BlinkResponse.instance.constructorCallback_1_(body_OR_input);
+      return wrap_jso(_blink.BlinkResponse.instance.constructorCallback_1_(body_OR_input));
     }
     if ((requestInitDict_OR_responseInitDict is Map || requestInitDict_OR_responseInitDict == null) && (body_OR_input is Blob || body_OR_input == null)) {
-      return _blink.BlinkResponse.instance.constructorCallback_2_(body_OR_input, requestInitDict_OR_responseInitDict);
+      var responseInitDict_1 = convertDartToNative_Dictionary(requestInitDict_OR_responseInitDict);
+      return wrap_jso(_blink.BlinkResponse.instance.constructorCallback_2_(body_OR_input, responseInitDict_1));
     }
     if ((body_OR_input is TypedData || body_OR_input == null) && requestInitDict_OR_responseInitDict == null) {
-      return _blink.BlinkResponse.instance.constructorCallback_1_(body_OR_input);
+      return wrap_jso(_blink.BlinkResponse.instance.constructorCallback_1_(body_OR_input));
     }
     if ((requestInitDict_OR_responseInitDict is Map || requestInitDict_OR_responseInitDict == null) && (body_OR_input is TypedData || body_OR_input == null)) {
-      return _blink.BlinkResponse.instance.constructorCallback_2_(body_OR_input, requestInitDict_OR_responseInitDict);
+      var requestInitDict_1 = convertDartToNative_Dictionary(requestInitDict_OR_responseInitDict);
+      return wrap_jso(_blink.BlinkResponse.instance.constructorCallback_2_(body_OR_input, requestInitDict_1));
     }
     if ((body_OR_input is ByteBuffer || body_OR_input == null) && requestInitDict_OR_responseInitDict == null) {
-      return _blink.BlinkResponse.instance.constructorCallback_1_(body_OR_input);
+      return wrap_jso(_blink.BlinkResponse.instance.constructorCallback_1_(body_OR_input));
     }
     if ((requestInitDict_OR_responseInitDict is Map || requestInitDict_OR_responseInitDict == null) && (body_OR_input is ByteBuffer || body_OR_input == null)) {
-      return _blink.BlinkResponse.instance.constructorCallback_2_(body_OR_input, requestInitDict_OR_responseInitDict);
+      var requestInitDict_1 = convertDartToNative_Dictionary(requestInitDict_OR_responseInitDict);
+      return wrap_jso(_blink.BlinkResponse.instance.constructorCallback_2_(body_OR_input, requestInitDict_1));
     }
     throw new ArgumentError("Incorrect number or type of arguments");
   }
 
+
+  @Deprecated("Internal Use Only")
+  static _Response internalCreate_Response() {
+    return new _Response._internalWrap();
+  }
+
+  factory _Response._internalWrap() {
+    return new _Response.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  _Response.internal_() : super.internal_();
+
+
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-// WARNING: Do not edit - generated code.
-
 
 @DocsEditable()
 @DomName('ServiceWorker')
 @Experimental() // untriaged
-abstract class _ServiceWorker extends EventTarget implements AbstractWorker {
+class _ServiceWorker extends EventTarget implements AbstractWorker {
   // To suppress missing implicit constructor warnings.
   factory _ServiceWorker._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static _ServiceWorker internalCreate_ServiceWorker() {
+    return new _ServiceWorker._internalWrap();
+  }
+
+  factory _ServiceWorker._internalWrap() {
+    return new _ServiceWorker.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  _ServiceWorker.internal_() : super.internal_();
+
+
+  // Override these methods for Dartium _ServiceWorker can't be abstract.
+  Stream<ErrorEvent> get onError => errorEvent.forTarget(this);
 }
+
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
@@ -36633,10 +43152,25 @@
 @DomName('SpeechRecognitionResultList')
 // https://dvcs.w3.org/hg/speech-api/raw-file/tip/speechapi.html#speechrecognitionresultlist
 @Experimental()
-class _SpeechRecognitionResultList extends NativeFieldWrapperClass2 with ListMixin<SpeechRecognitionResult>, ImmutableListMixin<SpeechRecognitionResult> implements List<SpeechRecognitionResult> {
+class _SpeechRecognitionResultList extends DartHtmlDomObject with ListMixin<SpeechRecognitionResult>, ImmutableListMixin<SpeechRecognitionResult> implements List<SpeechRecognitionResult> {
   // To suppress missing implicit constructor warnings.
   factory _SpeechRecognitionResultList._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static _SpeechRecognitionResultList internalCreate_SpeechRecognitionResultList() {
+    return new _SpeechRecognitionResultList._internalWrap();
+  }
+
+  factory _SpeechRecognitionResultList._internalWrap() {
+    return new _SpeechRecognitionResultList.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  _SpeechRecognitionResultList.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('SpeechRecognitionResultList.length')
   @DocsEditable()
   int get length => _blink.BlinkSpeechRecognitionResultList.instance.length_Getter_(unwrap_jso(this));
@@ -36648,7 +43182,7 @@
   }
 
   SpeechRecognitionResult _nativeIndexedGetter(int index) => wrap_jso(_blink.BlinkSpeechRecognitionResultList.instance.item_Callback_1_(unwrap_jso(this), index));
- 
+
   void operator[]=(int index, SpeechRecognitionResult value) {
     throw new UnsupportedError("Cannot assign element of immutable List.");
   }
@@ -36656,7 +43190,7 @@
   // SpeechRecognitionResult is the element type.
 
 
-  void set length(int value) {
+  set length(int value) {
     throw new UnsupportedError("Cannot resize immutable List.");
   }
 
@@ -36701,10 +43235,25 @@
 
 @DocsEditable()
 @DomName('StyleSheetList')
-class _StyleSheetList extends NativeFieldWrapperClass2 with ListMixin<StyleSheet>, ImmutableListMixin<StyleSheet> implements List<StyleSheet> {
+class _StyleSheetList extends DartHtmlDomObject with ListMixin<StyleSheet>, ImmutableListMixin<StyleSheet> implements List<StyleSheet> {
   // To suppress missing implicit constructor warnings.
   factory _StyleSheetList._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static _StyleSheetList internalCreate_StyleSheetList() {
+    return new _StyleSheetList._internalWrap();
+  }
+
+  factory _StyleSheetList._internalWrap() {
+    return new _StyleSheetList.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  _StyleSheetList.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('StyleSheetList.length')
   @DocsEditable()
   int get length => _blink.BlinkStyleSheetList.instance.length_Getter_(unwrap_jso(this));
@@ -36716,7 +43265,7 @@
   }
 
   StyleSheet _nativeIndexedGetter(int index) => wrap_jso(_blink.BlinkStyleSheetList.instance.item_Callback_1_(unwrap_jso(this), index));
- 
+
   void operator[]=(int index, StyleSheet value) {
     throw new UnsupportedError("Cannot assign element of immutable List.");
   }
@@ -36724,7 +43273,7 @@
   // StyleSheet is the element type.
 
 
-  void set length(int value) {
+  set length(int value) {
     throw new UnsupportedError("Cannot resize immutable List.");
   }
 
@@ -36757,7 +43306,7 @@
 
   @DomName('StyleSheetList.__getter__')
   @DocsEditable()
-  CssStyleSheet __getter__(String name) => _blink.BlinkStyleSheetList.instance.$__getter___Callback_1_(unwrap_jso(this), name);
+  CssStyleSheet __getter__(String name) => wrap_jso(_blink.BlinkStyleSheetList.instance.$__getter___Callback_1_(unwrap_jso(this), name));
   
   @DomName('StyleSheetList.item')
   @DocsEditable()
@@ -36774,10 +43323,25 @@
 @DocsEditable()
 @DomName('SubtleCrypto')
 @Experimental() // untriaged
-abstract class _SubtleCrypto extends NativeFieldWrapperClass2 {
+class _SubtleCrypto extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory _SubtleCrypto._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static _SubtleCrypto internalCreate_SubtleCrypto() {
+    return new _SubtleCrypto._internalWrap();
+  }
+
+  factory _SubtleCrypto._internalWrap() {
+    return new _SubtleCrypto.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  _SubtleCrypto.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -36790,10 +43354,24 @@
 @DomName('WebKitCSSFilterValue')
 // http://dev.w3.org/csswg/cssom/
 @deprecated // deprecated
-abstract class _WebKitCSSFilterValue extends _CssValueList {
+class _WebKitCSSFilterValue extends _CssValueList {
   // To suppress missing implicit constructor warnings.
   factory _WebKitCSSFilterValue._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static _WebKitCSSFilterValue internalCreate_WebKitCSSFilterValue() {
+    return new _WebKitCSSFilterValue._internalWrap();
+  }
+
+  factory _WebKitCSSFilterValue._internalWrap() {
+    return new _WebKitCSSFilterValue.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  _WebKitCSSFilterValue.internal_() : super.internal_();
+
+
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -36809,16 +43387,31 @@
 @Experimental()
 // http://dev.w3.org/csswg/cssom/
 @deprecated // deprecated
-abstract class _WebKitCSSMatrix extends NativeFieldWrapperClass2 {
+class _WebKitCSSMatrix extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory _WebKitCSSMatrix._() { throw new UnsupportedError("Not supported"); }
 
   @DomName('WebKitCSSMatrix.WebKitCSSMatrix')
   @DocsEditable()
   factory _WebKitCSSMatrix([String cssValue]) {
-    return _blink.BlinkWebKitCSSMatrix.instance.constructorCallback_1_(cssValue);
+    return wrap_jso(_blink.BlinkWebKitCSSMatrix.instance.constructorCallback_1_(cssValue));
   }
 
+  @Deprecated("Internal Use Only")
+  static _WebKitCSSMatrix internalCreate_WebKitCSSMatrix() {
+    return new _WebKitCSSMatrix._internalWrap();
+  }
+
+  factory _WebKitCSSMatrix._internalWrap() {
+    return new _WebKitCSSMatrix.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  _WebKitCSSMatrix.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -36831,10 +43424,24 @@
 @DomName('WebKitCSSTransformValue')
 // http://dev.w3.org/csswg/cssom/
 @deprecated // deprecated
-abstract class _WebKitCSSTransformValue extends _CssValueList {
+class _WebKitCSSTransformValue extends _CssValueList {
   // To suppress missing implicit constructor warnings.
   factory _WebKitCSSTransformValue._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static _WebKitCSSTransformValue internalCreate_WebKitCSSTransformValue() {
+    return new _WebKitCSSTransformValue._internalWrap();
+  }
+
+  factory _WebKitCSSTransformValue._internalWrap() {
+    return new _WebKitCSSTransformValue.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  _WebKitCSSTransformValue.internal_() : super.internal_();
+
+
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -36846,7 +43453,7 @@
 @DocsEditable()
 @DomName('WindowTimers')
 @Experimental() // untriaged
-abstract class _WindowTimers extends NativeFieldWrapperClass2 {
+abstract class _WindowTimers extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory _WindowTimers._() { throw new UnsupportedError("Not supported"); }
 
@@ -36875,34 +43482,82 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-// WARNING: Do not edit - generated code.
-
 
 @DocsEditable()
 @DomName('WorkerLocation')
 // http://www.whatwg.org/specs/web-apps/current-work/multipage/workers.html#workerlocation
 @Experimental()
-abstract class _WorkerLocation extends NativeFieldWrapperClass2 implements UrlUtilsReadOnly {
+class _WorkerLocation extends DartHtmlDomObject implements UrlUtilsReadOnly {
   // To suppress missing implicit constructor warnings.
   factory _WorkerLocation._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static _WorkerLocation internalCreate_WorkerLocation() {
+    return new _WorkerLocation._internalWrap();
+  }
+
+  factory _WorkerLocation._internalWrap() {
+    return new _WorkerLocation.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  _WorkerLocation.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
+  // Override these methods for Dartium _WorkerLocation can't be abstract.
+  String get hash => _blink.BlinkWorkerLocation.instance.hash_Getter_(unwrap_jso(this));
+  String get host => _blink.BlinkWorkerLocation.instance.host_Getter_(unwrap_jso(this));
+  String get hostname => _blink.BlinkWorkerLocation.instance.hostname_Getter_(unwrap_jso(this));
+  String get href => _blink.BlinkWorkerLocation.instance.href_Getter_(unwrap_jso(this));
+  String get origin => _blink.BlinkWorkerLocation.instance.origin_Getter_(unwrap_jso(this));
+  String get pathname => _blink.BlinkWorkerLocation.instance.pathname_Getter_(unwrap_jso(this));
+  String get port => _blink.BlinkWorkerLocation.instance.port_Getter_(unwrap_jso(this));
+  String get protocol => _blink.BlinkWorkerLocation.instance.protocol_Getter_(unwrap_jso(this));
+  String get search => _blink.BlinkWorkerLocation.instance.search_Getter_(unwrap_jso(this));
 }
+
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-// WARNING: Do not edit - generated code.
-
 
 @DocsEditable()
 @DomName('WorkerNavigator')
 // http://www.whatwg.org/specs/web-apps/current-work/multipage/workers.html#workernavigator
 @Experimental()
-abstract class _WorkerNavigator extends NativeFieldWrapperClass2 implements NavigatorCpu, NavigatorOnLine, NavigatorID {
+class _WorkerNavigator extends DartHtmlDomObject implements NavigatorCpu, NavigatorOnLine, NavigatorID {
   // To suppress missing implicit constructor warnings.
   factory _WorkerNavigator._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static _WorkerNavigator internalCreate_WorkerNavigator() {
+    return new _WorkerNavigator._internalWrap();
+  }
+
+  factory _WorkerNavigator._internalWrap() {
+    return new _WorkerNavigator.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  _WorkerNavigator.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
+  // Override these methods for Dartium _WorkerNavigator can't be abstract.
+  String get appCodeName => _blink.BlinkWorkerNavigator.instance.appCodeName_Getter_(unwrap_jso(this));
+  String get appName => _blink.BlinkWorkerNavigator.instance.appCodeName_Getter_(unwrap_jso(this));
+  String get appVersion => _blink.BlinkWorkerNavigator.instance.appVersion_Getter_(unwrap_jso(this));
+  bool get dartEnabled => _blink.BlinkWorkerNavigator.instance.dartEnabled_Getter_(unwrap_jso(this));
+  String get platform => _blink.BlinkWorkerNavigator.instance.platform_Getter_(unwrap_jso(this));
+  String get product => _blink.BlinkWorkerNavigator.instance.product_Getter_(unwrap_jso(this));
+  String get userAgent => _blink.BlinkWorkerNavigator.instance.userAgent_Getter_(unwrap_jso(this));
+  int get hardwareConcurrency => _blink.BlinkWorkerNavigator.instance.hardwareConcurrency_Getter_(unwrap_jso(this));
+  bool get onLine => _blink.BlinkWorkerNavigator.instance.onLine_Getter_(unwrap_jso(this));
 }
+
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
@@ -36917,6 +43572,20 @@
   // To suppress missing implicit constructor warnings.
   factory _XMLHttpRequestProgressEvent._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static _XMLHttpRequestProgressEvent internalCreate_XMLHttpRequestProgressEvent() {
+    return new _XMLHttpRequestProgressEvent._internalWrap();
+  }
+
+  factory _XMLHttpRequestProgressEvent._internalWrap() {
+    return new _XMLHttpRequestProgressEvent.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  _XMLHttpRequestProgressEvent.internal_() : super.internal_();
+
+
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -37607,7 +44276,7 @@
    * `height` function in jQuery and the calculated `height` CSS value,
    * converted to a num in pixels.
    */
-  void set height(newHeight) {
+  set height(newHeight) {
     if (newHeight is Dimension) {
       if (newHeight.value < 0) newHeight = new Dimension.px(0);
       _element.style.height = newHeight.toString();
@@ -37625,7 +44294,7 @@
    * and the calculated
    * `width` CSS value, converted to a dimensionless num in pixels.
    */
-  void set width(newWidth) {
+  set width(newWidth) {
     if (newWidth is Dimension) {
       if (newWidth.value < 0) newWidth = new Dimension.px(0);
       _element.style.width = newWidth.toString();
@@ -37660,7 +44329,7 @@
    * function in jQuery and the calculated `height` CSS value, converted to a
    * num in pixels.
    */
-  void set height(newHeight) {
+  set height(newHeight) {
     _elementList.forEach((e) => e.contentEdge.height = newHeight);
   }
 
@@ -37670,7 +44339,7 @@
    * This is equivalent to the `width` function in jQuery and the calculated
    * `width` CSS value, converted to a dimensionless num in pixels.
    */
-  void set width(newWidth) {
+  set width(newWidth) {
     _elementList.forEach((e) => e.contentEdge.width = newWidth);
   }
 }
@@ -37777,7 +44446,7 @@
    *
    * Note that only the content height can actually be set via this method.
    */
-  void set height(newHeight) {
+  set height(newHeight) {
     throw new UnsupportedError("Can only set height for content rect.");
   }
 
@@ -37791,7 +44460,7 @@
    *
    * Note that only the content width can be set via this method.
    */
-  void set width(newWidth) {
+  set width(newWidth) {
     throw new UnsupportedError("Can only set width for content rect.");
   }
 
@@ -38785,11 +45454,11 @@
   }
 
   bool allowsElement(Element element) {
-    return _allowedElements.contains(element.tagName);
+    return _allowedElements.contains(Element._safeTagName(element));
   }
 
   bool allowsAttribute(Element element, String attributeName, String value) {
-    var tagName = element.tagName;
+    var tagName = Element._safeTagName(element);
     var validator = _attributeValidators['$tagName::$attributeName'];
     if (validator == null) {
       validator = _attributeValidators['*::$attributeName'];
@@ -40451,11 +47120,11 @@
   }
 
   bool allowsElement(Element element) {
-    return allowedElements.contains(element.tagName);
+    return allowedElements.contains(Element._safeTagName(element));
   }
 
   bool allowsAttribute(Element element, String attributeName, String value) {
-    var tagName = element.tagName;
+    var tagName = Element._safeTagName(element);
     if (allowedUriAttributes.contains('$tagName::$attributeName')) {
       return uriPolicy.allowsUri(value);
     } else if (allowedUriAttributes.contains('*::$attributeName')) {
@@ -40496,10 +47165,10 @@
       var isAttr = element.attributes['is'];
       if (isAttr != null) {
         return allowedElements.contains(isAttr.toUpperCase()) &&
-          allowedElements.contains(element.tagName);
+            allowedElements.contains(Element._safeTagName(element));
       }
     }
-    return allowCustomTag && allowedElements.contains(element.tagName);
+    return allowCustomTag && allowedElements.contains(Element._safeTagName(element));
   }
 
   bool allowsAttribute(Element element, String attributeName, String value) {
@@ -40555,7 +47224,7 @@
     // foreignobject tag as SvgElement. We don't want foreignobject contents
     // anyway, so just remove the whole tree outright. And we can't rely
     // on IE recognizing the SvgForeignObject type, so go by tagName. Bug 23144
-    if (element is svg.SvgElement && element.tagName == 'foreignObject') {
+    if (element is svg.SvgElement && Element._safeTagName(element) == 'foreignObject') {
       return false;
     }
     if (element is svg.SvgElement) {
@@ -40669,7 +47338,7 @@
   /**
    * A sanitizer for trees that we trust. It does no validation and allows
    * any elements. It is also more efficient, since it can pass the text
-   * directly through to the underlying APIs without creating a document 
+   * directly through to the underlying APIs without creating a document
    * fragment to be sanitized.
    */
   static const trusted = const _TrustedHtmlTreeSanitizer();
@@ -40684,7 +47353,7 @@
 
   sanitizeTree(Node node) {}
 }
-  
+
 /**
  * Defines the policy for what types of uris are allowed for particular
  * attribute values.
@@ -40738,14 +47407,14 @@
 
   bool allowsElement(Element element) {
     if (!validator.allowsElement(element)) {
-      throw new ArgumentError(element.tagName);
+      throw new ArgumentError(Element._safeTagName(element));
     }
     return true;
   }
 
   bool allowsAttribute(Element element, String attributeName, String value) {
     if (!validator.allowsAttribute(element, attributeName, value)) {
-      throw new ArgumentError('${element.tagName}[$attributeName="$value"]');
+      throw new ArgumentError('${Element._safeTagName(element)}[$attributeName="$value"]');
     }
   }
 }
@@ -40787,7 +47456,7 @@
   }
 
   /// Sanitize the element, assuming we can't trust anything about it.
-  void _sanitizeUntrustedElement(Element element, Node parent) {
+  void _sanitizeUntrustedElement(/* Element */ element, Node parent) {
     // If the _hasCorruptedAttributes does not successfully return false,
     // then we consider it corrupted and remove.
     // TODO(alanknight): This is a workaround because on Firefox
@@ -40796,7 +47465,9 @@
     // can't call methods. This does mean that you can't explicitly allow an
     // embed tag. The only thing that will let it through is a null
     // sanitizer that doesn't traverse the tree at all. But sanitizing while
-    // allowing embeds seems quite unlikely.
+    // allowing embeds seems quite unlikely. This is also the reason that we
+    // can't declare the type of element, as an embed won't pass any type
+    // check in dart2js.
     var corrupted = true;
     var attrs;
     var isAttr;
@@ -40804,18 +47475,27 @@
       // If getting/indexing attributes throws, count that as corrupt.
       attrs = element.attributes;
       isAttr = attrs['is'];
-      corrupted = Element._hasCorruptedAttributes(element);
+      var corruptedTest1 = Element._hasCorruptedAttributes(element);
+
+      // On IE, erratically, the hasCorruptedAttributes test can return false,
+      // even though it clearly is corrupted. A separate copy of the test
+      // inlining just the basic check seems to help.
+      corrupted = corruptedTest1 ? true : Element._hasCorruptedAttributesAdditionalCheck(element);
     } catch(e) {}
-     var elementText = 'element unprintable';
+    var elementText = 'element unprintable';
     try {
       elementText = element.toString();
     } catch(e) {}
-    var elementTagName = 'element tag unavailable';
     try {
-      elementTagName = element.tagName;
-    } catch(e) {}
-    _sanitizeElement(element, parent, corrupted, elementText, elementTagName,
-        attrs, isAttr);
+      var elementTagName = Element._safeTagName(element);
+      _sanitizeElement(element, parent, corrupted, elementText, elementTagName,
+          attrs, isAttr);
+    } on ArgumentError { // Thrown by _ThrowsNodeValidator
+      rethrow;
+    } catch(e) {  // Unexpected exception sanitizing -> remove
+      _removeNode(element, parent);
+      window.console.warn('Removing corrupted element $elementText');
+    }
   }
 
   /// Having done basic sanity checking on the element, and computed the
@@ -40824,23 +47504,23 @@
   void _sanitizeElement(Element element, Node parent, bool corrupted,
       String text, String tag, Map attrs, String isAttr) {
     if (false != corrupted) {
+       _removeNode(element, parent);
       window.console.warn(
           'Removing element due to corrupted attributes on <$text>');
-       _removeNode(element, parent);
        return;
     }
     if (!validator.allowsElement(element)) {
-      window.console.warn(
-          'Removing disallowed element <$tag>');
       _removeNode(element, parent);
+      window.console.warn(
+          'Removing disallowed element <$tag> from $parent');
       return;
     }
 
     if (isAttr != null) {
       if (!validator.allowsAttribute(element, 'is', isAttr)) {
+        _removeNode(element, parent);
         window.console.warn('Removing disallowed type extension '
             '<$tag is="$isAttr">');
-        _removeNode(element, parent);
         return;
       }
     }
@@ -40915,7 +47595,7 @@
 
   void operator []=(int index, E value) { _list[index] = value; }
 
-  void set length(int newLength) { _list.length = newLength; }
+  set length(int newLength) { _list.length = newLength; }
 
   void sort([int compare(E a, E b)]) { _list.sort(compare); }
 
@@ -41050,9 +47730,11 @@
 class _VMElementUpgrader implements ElementUpgrader {
   final Type _type;
   final Type _nativeType;
+  final String _extendsTag;
 
   _VMElementUpgrader(Document document, Type type, String extendsTag) :
       _type = type,
+      _extendsTag = extendsTag,
       _nativeType = _validateCustomType(type).reflectedType {
 
     if (extendsTag == null) {
@@ -41068,11 +47750,41 @@
     }
   }
 
-  Element upgrade(Element element) {
-    if (element.runtimeType != _nativeType) {
-      throw new UnsupportedError('Element is incorrect type');
+  Element upgrade(element) {
+    var jsObject;
+    var tag;
+    var isNativeElementExtension = false;
+
+    try {
+      tag = _getCustomElementName(element);
+    } catch (e) {
+      isNativeElementExtension = element.localName == _extendsTag;
     }
-    return _Utils.changeElementWrapper(element, _type);
+
+    if (element.runtimeType == HtmlElement || element.runtimeType == TemplateElement) {
+      if (tag != _extendsTag) {
+        throw new UnsupportedError('$tag is not registered.');
+      }
+      jsObject = unwrap_jso(element);
+    } else if (element.runtimeType == js.JsObjectImpl) {
+      // It's a Polymer core element (written in JS).
+      jsObject = element;
+    } else if (isNativeElementExtension) {
+      // Extending a native element.
+      jsObject = element.blink_jsObject;
+
+      // Element to extend is the real tag.
+      tag = element.localName;
+    } else if (tag != null && element.localName != tag) {
+      throw new UnsupportedError('Element is incorrect type. Got ${element.runtimeType}, expected native Html or Svg element to extend.');
+    } else if (tag == null) {
+      throw new UnsupportedError('Element is incorrect type. Got ${element.runtimeType}, expected HtmlElement/JsObjectImpl.');
+    }
+
+    // Remember Dart class to tagName for any upgrading done in wrap_jso.
+    addCustomElementType(tag, _type, _extendsTag);
+
+    return _createCustomUpgrader(_type, jsObject);
   }
 }
 
@@ -41163,6 +47875,14 @@
 
 @Experimental()
 class KeyEvent extends _WrappedEvent implements KeyboardEvent {
+  /** Needed because KeyboardEvent is implements.
+   *  TODO(terry): Consider making blink_jsObject private (add underscore) for
+   *               all blink_jsObject.  Then needed private wrap/unwrap_jso
+   *               functions that delegate to a public wrap/unwrap_jso.
+   */
+  @Deprecated("Internal Use Only")
+  js.JsObject blink_jsObject;
+
   /** The parent KeyboardEvent that this KeyEvent is wrapping and "fixing". */
   KeyboardEvent _parent;
 
@@ -41315,6 +48035,13 @@
  * Helper class to implement custom events which wrap DOM events.
  */
 class _WrappedEvent implements Event {
+  /** Needed because KeyboardEvent is implements.
+   *  TODO(terry): Consider making blink_jsObject private (add underscore) for
+   *               all blink_jsObject.  Then needed private wrap/unwrap_jso
+   *               functions that delegate to a public wrap/unwrap_jso.
+   */
+  js.JsObject blink_jsObject;
+
   final Event wrapped;
 
   /** The CSS selector involved with event delegation. */
@@ -41594,6 +48321,8 @@
     }
   }
 
+  static maybeUnwrapJso(obj) => unwrap_jso(obj);
+
   static List convertToList(List list) {
     // FIXME: [possible optimization]: do not copy the array if Dart_IsArray is fine w/ it.
     final length = list.length;
@@ -41657,9 +48386,7 @@
     return element;
   }
 
-  // TODO(terry): Enable below for Dartium w/ interop and remove other static window().
-  // static window() => wrap_jso(_blink.Blink_Utils.window()['window']);
-  static window() => _blink.Blink_Utils.window();
+  static window() => wrap_jso(js.context['window']);
 
   static forwardingPrint(String message) => _blink.Blink_Utils.forwardingPrint(message);
   static void spawnDomHelper(Function f, int replyTo) =>
@@ -42241,7 +48968,7 @@
     return [
         "inspect",
         (o) {
-          host.inspect(o, null);
+          host.callMethod("inspect", [o]);
           return o;
         },
         "dir",
@@ -42276,15 +49003,19 @@
   static Element createElement(Document document, String tagName) =>
     wrap_jso(_blink.Blink_Utils.createElement(unwrap_jso(document), tagName));
 
-  static void initializeCustomElement(HtmlElement element) =>
-    _blink.Blink_Utils.initializeCustomElement(unwrap_jso(element));
-
   static Element changeElementWrapper(HtmlElement element, Type type) =>
     _blink.Blink_Utils.changeElementWrapper(unwrap_jso(element), type);
 }
 
-class _DOMWindowCrossFrame extends NativeFieldWrapperClass2 implements
+class _DOMWindowCrossFrame extends DartHtmlDomObject implements
     WindowBase {
+  /** Needed because KeyboardEvent is implements.
+   *  TODO(terry): Consider making blink_jsObject private (add underscore) for
+   *               all blink_jsObject.  Then needed private wrap/unwrap_jso
+   *               functions that delegate to a public wrap/unwrap_jso.
+   */
+  js.JsObject blink_jsObject;
+
   _DOMWindowCrossFrame.internal();
 
   // Fields.
@@ -42327,7 +49058,7 @@
     'You can only attach EventListeners to your own window.');
 }
 
-class _HistoryCrossFrame extends NativeFieldWrapperClass2 implements HistoryBase {
+class _HistoryCrossFrame extends DartHtmlDomObject implements HistoryBase {
   _HistoryCrossFrame.internal();
 
   // Methods.
@@ -42339,17 +49070,17 @@
   String get typeName => "History";
 }
 
-class _LocationCrossFrame extends NativeFieldWrapperClass2 implements LocationBase {
+class _LocationCrossFrame extends DartHtmlDomObject implements LocationBase {
   _LocationCrossFrame.internal();
 
   // Fields.
-  void set href(String h) => _blink.Blink_LocationCrossFrame.set_href(this, h);
+  set href(String h) => _blink.Blink_LocationCrossFrame.set_href(this, h);
 
   // Implementation support.
   String get typeName => "Location";
 }
 
-class _DOMStringMap extends NativeFieldWrapperClass2 implements Map<String, String> {
+class _DOMStringMap extends DartHtmlDomObject implements Map<String, String> {
   _DOMStringMap.internal();
 
   bool containsValue(String value) => Maps.containsValue(this, value);
@@ -42579,10 +49310,6 @@
   throw new UnimplementedError("scheduleMicrotask in background isolates "
                                "are not supported in the browser"));
 
-void _initializeCustomElement(Element e) {
-  _Utils.initializeCustomElement(e);
-}
-
 // Class for unsupported native browser 'DOM' objects.
-class _UnsupportedBrowserObject extends NativeFieldWrapperClass2 {
+class _UnsupportedBrowserObject extends DartHtmlDomObject {
 }
diff --git a/sdk/lib/html/html_common/conversions.dart b/sdk/lib/html/html_common/conversions.dart
index 042a784..0dca4d3 100644
--- a/sdk/lib/html/html_common/conversions.dart
+++ b/sdk/lib/html/html_common/conversions.dart
@@ -28,55 +28,9 @@
 
 part of html_common;
 
-
-/// Converts a JavaScript object with properties into a Dart Map.
-/// Not suitable for nested objects.
-Map convertNativeToDart_Dictionary(object) {
-  if (object == null) return null;
-  var dict = {};
-  var keys = JS('JSExtendableArray', 'Object.getOwnPropertyNames(#)', object);
-  for (final key in keys) {
-    dict[key] = JS('var', '#[#]', object, key);
-  }
-  return dict;
-}
-
-/// Converts a flat Dart map into a JavaScript object with properties.
-convertDartToNative_Dictionary(Map dict) {
-  if (dict == null) return null;
-  var object = JS('var', '{}');
-  dict.forEach((String key, value) {
-      JS('void', '#[#] = #', object, key, value);
-    });
-  return object;
-}
-
-
-/**
- * Ensures that the input is a JavaScript Array.
- *
- * Creates a new JavaScript array if necessary, otherwise returns the original.
- */
-List convertDartToNative_StringArray(List<String> input) {
-  // TODO(sra).  Implement this.
-  return input;
-}
-
-DateTime convertNativeToDart_DateTime(date) {
-  var millisSinceEpoch = JS('int', '#.getTime()', date);
-  return new DateTime.fromMillisecondsSinceEpoch(millisSinceEpoch, isUtc: true);
-}
-
-convertDartToNative_DateTime(DateTime date) {
-  return JS('', 'new Date(#)', date.millisecondsSinceEpoch);
-}
-
-
-// -----------------------------------------------------------------------------
-
 /// Converts a Dart value into a JavaScript SerializedScriptValue.
 convertDartToNative_SerializedScriptValue(value) {
-  return _convertDartToNative_PrepareForStructuredClone(value);
+  return convertDartToNative_PrepareForStructuredClone(value);
 }
 
 /// Since the source object may be viewed via a JavaScript event listener the
@@ -102,7 +56,7 @@
  * operations that perform the structured clone algorithm which does not mutate
  * its output, the result may share structure with the input [value].
  */
-_convertDartToNative_PrepareForStructuredClone(value) {
+abstract class _StructuredClone {
 
   // TODO(sra): Replace slots with identity hash table.
   var values = [];
@@ -120,6 +74,10 @@
   readSlot(int i) => copies[i];
   writeSlot(int i, x) { copies[i] = x; }
   cleanupSlots() {}  // Will be needed if we mark objects with a property.
+  bool cloneNotRequired(object);
+  newJsMap();
+  newJsList(length);
+  void putIntoMap(map, key, value);
 
   // Returns the input, or a clone of the input.
   walk(e) {
@@ -148,57 +106,52 @@
 
     // TODO(sra): Firefox: How to convert _TypedImageData on the other end?
     if (e is ImageData) return e;
-    if (e is NativeByteBuffer) return e;
-
-    if (e is NativeTypedData) return e;
+    if (cloneNotRequired(e)) return e;
 
     if (e is Map) {
       var slot = findSlot(e);
       var copy = readSlot(slot);
       if (copy != null) return copy;
-      copy = JS('var', '{}');
+      copy = newJsMap();
       writeSlot(slot, copy);
       e.forEach((key, value) {
-          JS('void', '#[#] = #', copy, key, walk(value));
-        });
+        putIntoMap(copy, key, walk(value));
+      });
       return copy;
     }
 
     if (e is List) {
-      // Since a JavaScript Array is an instance of Dart List it is possible to
-      // avoid making a copy of the list if there is no need to copy anything
-      // reachable from the array.  We defer creating a new array until a cycle
-      // is detected or a subgraph was copied.
-      int length = e.length;
+      // Since a JavaScript Array is an instance of Dart List it is tempting
+      // in dart2js to avoid making a copy of the list if there is no need
+      // to copy anything reachable from the array.  However, the list may have
+      // non-native properties or methods from interceptors and such, e.g.
+      // an immutability marker. So we  had to stop doing that.
       var slot = findSlot(e);
       var copy = readSlot(slot);
-      if (copy != null) {
-        if (true == copy) {  // Cycle, so commit to making a copy.
-          copy = JS('JSExtendableArray', 'new Array(#)', length);
-          writeSlot(slot, copy);
-        }
-        return copy;
-      }
-
-      int i = 0;
-
-      // Always clone the list, as it may have non-native properties or methods
-      // from interceptors and such.
-      copy = JS('JSExtendableArray', 'new Array(#)', length);
-      writeSlot(slot, copy);
-
-      for ( ; i < length; i++) {
-        copy[i] = walk(e[i]);
-      }
+      if (copy != null) return copy;
+      copy = copyList(e, slot);
       return copy;
     }
 
     throw new UnimplementedError('structured clone of other type');
   }
 
-  var copy = walk(value);
-  cleanupSlots();
-  return copy;
+  copyList(List e, int slot) {
+    int i = 0;
+    int length = e.length;
+    var copy = newJsList(length);
+    writeSlot(slot, copy);
+    for ( ; i < length; i++) {
+      copy[i] = walk(e[i]);
+    }
+    return copy;
+  }
+
+  convertDartToNative_PrepareForStructuredClone(value) {
+    var copy = walk(value);
+    cleanupSlots();
+    return copy;
+  }
 }
 
 /**
@@ -219,25 +172,36 @@
  * MessageEvents.  Mutating the object to make it more 'Dart-like' would corrupt
  * the value as seen from the JavaScript listeners.
  */
-convertNativeToDart_AcceptStructuredClone(object, {mustCopy: false}) {
+abstract class _AcceptStructuredClone {
 
-  // TODO(sra): Replace slots with identity hash table that works on non-dart
-  // objects.
+  // TODO(sra): Replace slots with identity hash table.
   var values = [];
-  var copies = [];
+  var copies = [];  // initially 'null', 'true' during initial DFS, then a copy.
+  bool mustCopy = false;
 
   int findSlot(value) {
     int length = values.length;
     for (int i = 0; i < length; i++) {
-      if (identical(values[i], value)) return i;
+      if (identicalInJs(values[i], value)) return i;
     }
     values.add(value);
     copies.add(null);
     return length;
   }
+
+  /// Are the two objects identical, but taking into account that two JsObject
+  /// wrappers may not be identical, but their underlying Js Object might be.
+  bool identicalInJs(a, b);
   readSlot(int i) => copies[i];
   writeSlot(int i, x) { copies[i] = x; }
 
+  /// Iterate over the JS properties.
+  forEachJsField(object, action);
+
+  /// Create a new Dart list of the given length. May create a native List or
+  /// a JsArray, depending if we're in Dartium or dart2js.
+  newDartList(length);
+
   walk(e) {
     if (e == null) return e;
     if (e is bool) return e;
@@ -253,6 +217,10 @@
       throw new UnimplementedError('structured clone of RegExp');
     }
 
+    if (isJavaScriptPromise(e)) {
+      return convertNativePromiseToDartFuture(e);
+    }
+
     if (isJavaScriptSimpleObject(e)) {
       // TODO(sra): If mustCopy is false, swizzle the prototype for one of a Map
       // implementation that uses the properies as storage.
@@ -262,9 +230,7 @@
       copy = {};
 
       writeSlot(slot, copy);
-      for (final key in JS('JSExtendableArray', 'Object.keys(#)', e)) {
-        copy[key] = walk(JS('var', '#[#]', e, key));
-      }
+      forEachJsField(e, (key, value) => copy[key] = walk(value));
       return copy;
     }
 
@@ -276,7 +242,7 @@
       int length = e.length;
       // Since a JavaScript Array is an instance of Dart List, we can modify it
       // in-place unless we must copy.
-      copy = mustCopy ? JS('JSExtendableArray', 'new Array(#)', length) : e;
+      copy = mustCopy ? newDartList(length) : e;
       writeSlot(slot, copy);
 
       for (int i = 0; i < length; i++) {
@@ -290,8 +256,11 @@
     return e;
   }
 
-  var copy = walk(object);
-  return copy;
+  convertNativeToDart_AcceptStructuredClone(object, {mustCopy: false}) {
+    this.mustCopy = mustCopy;
+    var copy = walk(object);
+    return copy;
+  }
 }
 
 // Conversions for ContextAttributes.
@@ -335,7 +304,7 @@
 // On Firefox, the returned ImageData is a plain object.
 
 class _TypedImageData implements ImageData {
-  final NativeUint8ClampedList data;
+  final Uint8ClampedList data;
   final int height;
   final int width;
 
@@ -388,20 +357,6 @@
   return imageData;
 }
 
-
-bool isJavaScriptDate(value) => JS('bool', '# instanceof Date', value);
-bool isJavaScriptRegExp(value) => JS('bool', '# instanceof RegExp', value);
-bool isJavaScriptArray(value) => JS('bool', '# instanceof Array', value);
-bool isJavaScriptSimpleObject(value) {
-  var proto = JS('', 'Object.getPrototypeOf(#)', value);
-  return JS('bool', '# === Object.prototype', proto) ||
-      JS('bool', '# === null', proto);
-}
-bool isImmutableJavaScriptArray(value) =>
-    JS('bool', r'!!(#.immutable$list)', value);
-
-
-
 const String _serializedScriptValue =
     'num|String|bool|'
     'JSExtendableArray|=Object|'
diff --git a/sdk/lib/html/html_common/conversions_dart2js.dart b/sdk/lib/html/html_common/conversions_dart2js.dart
new file mode 100644
index 0000000..3b3a8ad
--- /dev/null
+++ b/sdk/lib/html/html_common/conversions_dart2js.dart
@@ -0,0 +1,99 @@
+part of html_common;
+
+/// Converts a JavaScript object with properties into a Dart Map.
+/// Not suitable for nested objects.
+Map convertNativeToDart_Dictionary(object) {
+  if (object == null) return null;
+  var dict = {};
+  var keys = JS('JSExtendableArray', 'Object.getOwnPropertyNames(#)', object);
+  for (final key in keys) {
+    dict[key] = JS('var', '#[#]', object, key);
+  }
+  return dict;
+}
+
+/// Converts a flat Dart map into a JavaScript object with properties.
+convertDartToNative_Dictionary(Map dict, [void postCreate(dynamic)]) {
+  if (dict == null) return null;
+  var object = JS('var', '{}');
+  if (postCreate != null) {
+    postCreate(object);
+  }
+  dict.forEach((String key, value) {
+      JS('void', '#[#] = #', object, key, value);
+    });
+  return object;
+}
+
+
+/**
+ * Ensures that the input is a JavaScript Array.
+ *
+ * Creates a new JavaScript array if necessary, otherwise returns the original.
+ */
+List convertDartToNative_StringArray(List<String> input) {
+  // TODO(sra).  Implement this.
+  return input;
+}
+
+DateTime convertNativeToDart_DateTime(date) {
+  var millisSinceEpoch = JS('int', '#.getTime()', date);
+  return new DateTime.fromMillisecondsSinceEpoch(millisSinceEpoch, isUtc: true);
+}
+
+convertDartToNative_DateTime(DateTime date) {
+  return JS('', 'new Date(#)', date.millisecondsSinceEpoch);
+}
+
+convertDartToNative_PrepareForStructuredClone(value) =>
+    new _StructuredCloneDart2Js().convertDartToNative_PrepareForStructuredClone(value);
+
+convertNativeToDart_AcceptStructuredClone(object, {mustCopy: false}) =>
+    new _AcceptStructuredCloneDart2Js().convertNativeToDart_AcceptStructuredClone(object, mustCopy: mustCopy);
+
+class _StructuredCloneDart2Js extends _StructuredClone {
+  newJsMap() => JS('var', '{}');
+  putIntoMap(map, key, value) => JS('void', '#[#] = #', map, key, value);
+  newJsList(length) => JS('JSExtendableArray', 'new Array(#)', length);
+  cloneNotRequired(e) => (e is NativeByteBuffer || e is NativeTypedData);
+}
+
+class _AcceptStructuredCloneDart2Js extends _AcceptStructuredClone {
+
+  newJsList(length) => JS('JSExtendableArray', 'new Array(#)', length);
+  newDartList(length) => newJsList(length);
+  identicalInJs(a, b) => identical(a, b);
+
+  void forEachJsField(object, action) {
+      for (final key in JS('JSExtendableArray', 'Object.keys(#)', object)) {
+        action(key, JS('var', '#[#]', object, key));
+      }
+  }
+}
+
+bool isJavaScriptDate(value) => JS('bool', '# instanceof Date', value);
+bool isJavaScriptRegExp(value) => JS('bool', '# instanceof RegExp', value);
+bool isJavaScriptArray(value) => JS('bool', '# instanceof Array', value);
+bool isJavaScriptSimpleObject(value) {
+  var proto = JS('', 'Object.getPrototypeOf(#)', value);
+  return JS('bool', '# === Object.prototype', proto) ||
+      JS('bool', '# === null', proto);
+}
+bool isImmutableJavaScriptArray(value) =>
+    JS('bool', r'!!(#.immutable$list)', value);
+bool isJavaScriptPromise(value) =>
+    JS('bool', r'typeof Promise != "undefined" && # instanceof Promise', value);
+
+Future convertNativePromiseToDartFuture(promise) {
+  var completer = new Completer();
+  var then = convertDartClosureToJS((result) => completer.complete(result), 1);
+  var error = convertDartClosureToJS((result) => completer.completeError(result), 1);
+  var newPromise = JS('', '#.then(#).catch(#)', promise, then, error);
+  return completer.future;
+}
+
+/// Wrap a JS object with an instance of the matching dart:html class. Used only in Dartium.
+wrap_jso(jsObject) => jsObject;
+
+/// Find the underlying JS object for a dart:html Dart object.
+unwrap_jso(dartClass_instance) => dartClass_instance;
diff --git a/sdk/lib/html/html_common/conversions_dartium.dart b/sdk/lib/html/html_common/conversions_dartium.dart
new file mode 100644
index 0000000..56ed9d5
--- /dev/null
+++ b/sdk/lib/html/html_common/conversions_dartium.dart
@@ -0,0 +1,389 @@
+part of html_common;
+
+convertDartToNative_PrepareForStructuredClone(value) =>
+    new _StructuredCloneDartium().convertDartToNative_PrepareForStructuredClone(value);
+
+convertNativeToDart_AcceptStructuredClone(object, {mustCopy: false}) =>
+    new _AcceptStructuredCloneDartium().convertNativeToDart_AcceptStructuredClone(object, mustCopy: mustCopy);
+
+class _StructuredCloneDartium extends _StructuredClone {
+  newJsMap() => new js.JsObject(js.context["Object"]);
+  putIntoMap(map, key, value) => map[key] = value;
+  // TODO(alanknight): Don't create two extra lists to get a fixed-length JS list.
+  newJsList(length) => new js.JsArray.from(new List(length));
+  cloneNotRequired(e) => e is js.JsObject;
+}
+
+class _AcceptStructuredCloneDartium extends _AcceptStructuredClone {
+  newDartList(length) => new List(length);
+
+  // JsObjects won't be identical, but will be equal only if the underlying
+  // Js entities are identical.
+  bool identicalInJs(a, b) =>
+      (a is js.JsObject) ? a == b : identical(a, b);
+
+  void forEachJsField(jsObject, action) {
+    var keys = js.context["Object"].callMethod("keys", [jsObject]);
+    for (var key in keys) {
+      action(key, jsObject[key]);
+    }
+  }
+}
+
+final _dateConstructor = js.context["Date"];
+final _regexConstructor = js.context["RegExp"];
+
+bool isJavaScriptDate(value) => value is js.JsObject && value.instanceof(_dateConstructor);
+bool isJavaScriptRegExp(value) => value is js.JsObject && value.instanceof(_regexConstructor);
+bool isJavaScriptArray(value) => value is js.JsArray;
+
+final _object = js.context["Object"];
+final _getPrototypeOf = _object["getPrototypeOf"];
+_getProto(object) {
+  return _getPrototypeOf.apply([object]);
+}
+final _objectProto = js.context["Object"]["prototype"];
+
+bool isJavaScriptSimpleObject(value) {
+  if (value is! js.JsObject) return false;
+  var proto = _getProto(value);
+  return proto == _objectProto || proto == null;
+}
+bool isImmutableJavaScriptArray(value) =>
+    isJavaScriptArray(value) && value["immutable$list"] != null;
+
+final _promiseConstructor = js.context['Promise'];
+bool isJavaScriptPromise(value) => value is js.JsObject && value['constructor'] == _promiseConstructor;
+
+Future convertNativePromiseToDartFuture(js.JsObject promise) {
+  var completer = new Completer();
+  var newPromise = promise
+    .callMethod("then", [(result) => completer.complete(result)])
+    .callMethod("catch", [(result) => completer.completeError(result)]);
+  return completer.future;
+}
+
+convertDartToNative_DateTime(DateTime date) {
+  return new js.JsObject(js.context["Date"], [date.millisecondsSinceEpoch]);
+}
+
+/// Creates a Dart Rectangle from a Javascript object with properties
+/// left, top, width and height. Used internally in Dartium.
+Rectangle make_dart_rectangle(r) =>
+    r == null ? null : new Rectangle(
+    js.JsNative.getProperty(r, 'left'),
+    js.JsNative.getProperty(r, 'top'),
+    js.JsNative.getProperty(r, 'width'),
+    js.JsNative.getProperty(r, 'height'));
+
+// Converts a flat Dart map into a JavaScript object with properties this is
+// is the Dartium only version it uses dart:js.
+// TODO(alanknight): This could probably be unified with the dart2js conversions
+// code in html_common and be more general.
+convertDartToNative_Dictionary(Map dict) {
+  if (dict == null) return null;
+  var jsObject = new js.JsObject(js.JsNative.getProperty(js.context, 'Object'));
+  dict.forEach((String key, value) {
+    if (value is List) {
+      var jsArray = new js.JsArray();
+      value.forEach((elem) {
+        jsArray.add(elem is Map ? convertDartToNative_Dictionary(elem): elem);
+      });
+      jsObject[key] = jsArray;
+    } else {
+      jsObject[key] = value;
+    }
+  });
+  return jsObject;
+}
+
+// Conversion function place holder (currently not used in dart2js or dartium).
+List convertDartToNative_StringArray(List<String> input) => input;
+
+// Converts a Dart list into a JsArray. For the Dartium version only.
+convertDartToNative_List(List input) => new js.JsArray()..addAll(input);
+
+/// Find the underlying JS object for a dart:html Dart object.
+unwrap_jso(dartClass_instance) => js.unwrap_jso(dartClass_instance);
+
+// Flag to disable JS interop asserts.  Setting to false will speed up the
+// wrap_jso calls.
+bool interop_checks = false;
+
+/// Wrap a JS object with an instance of the matching dart:html class. Used only in Dartium.
+wrap_jso(jsObject) {
+  try {
+    if (jsObject is! js.JsObject || jsObject == null) {
+      // JS Interop converted the object to a Dart class e.g., Uint8ClampedList.
+      // or it's a simple type.
+      return jsObject;
+    }
+
+    var wrapper = js.getDartHtmlWrapperFor(jsObject);
+    // if we have a wrapper return the Dart instance.
+    if (wrapper != null && wrapper is! js.JsObject) {
+      return wrapper;
+    }
+
+    if (jsObject is js.JsArray) {
+      var wrappingList = new DartHtmlWrappingList(jsObject);
+      js.setDartHtmlWrapperFor(jsObject, wrappingList);
+      return wrappingList;
+    }
+
+    // Try the most general type conversions on it.
+    // TODO(alanknight): We may be able to do better. This maintains identity,
+    // which is useful, but expensive. And if we nest something that only
+    // this conversion handles, how does that work? e.g. a list of maps of elements.
+    var converted = convertNativeToDart_SerializedScriptValue(jsObject);
+    if (!identical(converted, jsObject)) {
+      return converted;
+    }
+
+    var constructor = js.JsNative.getProperty(jsObject, 'constructor');
+    if (constructor == null) {
+      // Perfectly valid case for JavaScript objects where __proto__ has
+      // intentionally been set to null.
+      js.setDartHtmlWrapperFor(jsObject, jsObject);
+      return jsObject;
+    }
+    var jsTypeName = js.JsNative.getProperty(constructor, 'name');
+    if (jsTypeName is! String || jsTypeName.length == 0) {
+      // Not an html type.
+      js.setDartHtmlWrapperFor(jsObject, jsObject);
+      return jsObject;
+    }
+
+    var dartClass_instance;
+    var customElementClass = null;
+    var extendsTag = "";
+    var custom = getCustomElementEntry(jsObject);
+    if (custom != null) {
+      customElementClass = custom['type'];
+      extendsTag = custom['extends'];
+    }
+
+    // Only allow custom elements to be created in the html or svg default
+    // namespace.
+    var func;
+    var defaultNS = jsObject['namespaceURI'] == 'http://www.w3.org/1999/xhtml' ||
+        jsObject['namespaceURI'] ==  'http://www.w3.org/2000/svg';
+    if (customElementClass != null && extendsTag == "" && defaultNS) {
+      // The customElementClass is known but we can't create the real class so
+      // create the HtmlElement and it will get upgraded when registerElement's
+      // createdCallback is called.
+      func = getHtmlCreateFunction('HTMLElement');
+    } else {
+      func = getHtmlCreateFunction(jsTypeName);
+      if (func == null) {
+        // Start walking the prototype chain looking for a JS class.
+        var prototype = jsObject['__proto__'];
+        var keepWalking = true;
+        while (keepWalking && prototype.hasProperty('__proto__')) {
+          prototype = prototype['__proto__'];
+          if (prototype != null && prototype is Element &&
+              prototype.blink_jsObject != null) {
+            // We're a Dart class that's pointing to a JS class.
+            var blinkJso = prototype.blink_jsObject;
+            jsTypeName = blinkJso['constructor']['name'];
+            func = getHtmlCreateFunction(jsTypeName);
+            keepWalking = func == null;
+          }
+        }
+      }
+    }
+
+    // Can we construct a Dart class?
+    if (func != null) {
+      dartClass_instance = func();
+
+      // Wrap our Dart instance in both directions.
+      dartClass_instance.blink_jsObject = jsObject;
+      js.setDartHtmlWrapperFor(jsObject, dartClass_instance);
+    }
+
+    // TODO(jacobr): cache that this is not a dart:html JS class.
+    return dartClass_instance;
+  } catch(e, stacktrace){
+    if (interop_checks) {
+      if (e is DebugAssertException)
+        window.console.log("${e.message}\n ${stacktrace}");
+      else
+        window.console.log("${stacktrace}");
+    }
+  }
+
+  return null;
+}
+
+/**
+ * Create Dart class that maps to the JS Type, add the JsObject as an expando
+ * on the Dart class and return the created Dart class.
+ */
+wrap_jso_no_SerializedScriptvalue(jsObject) {
+  try {
+    if (jsObject is! js.JsObject || jsObject == null) {
+      // JS Interop converted the object to a Dart class e.g., Uint8ClampedList.
+      // or it's a simple type.
+      return jsObject;
+    }
+
+    // TODO(alanknight): With upgraded custom elements this causes a failure because
+    // we need a new wrapper after the type changes. We could possibly invalidate this
+    // if the constructor name didn't match?
+    var wrapper = js.getDartHtmlWrapperFor(jsObject);
+    if (wrapper != null) {
+      return wrapper;
+    }
+
+    if (jsObject is js.JsArray) {
+      var wrappingList = new DartHtmlWrappingList(jsObject);
+      js.setDartHtmlWrapperFor(jsObject, wrappingList);
+      return wrappingList;
+    }
+
+    var constructor = js.JsNative.getProperty(jsObject, 'constructor');
+    if (constructor == null) {
+      // Perfectly valid case for JavaScript objects where __proto__ has
+      // intentionally been set to null.
+      js.setDartHtmlWrapperFor(jsObject, jsObject);
+      return jsObject;
+    }
+    var jsTypeName = js.JsNative.getProperty(constructor, 'name');
+    if (jsTypeName is! String || jsTypeName.length == 0) {
+      // Not an html type.
+      js.setDartHtmlWrapperFor(jsObject, jsObject);
+      return jsObject;
+    }
+
+    var func = getHtmlCreateFunction(jsTypeName);
+    if (func != null) {
+      var dartClass_instance = func();
+      dartClass_instance.blink_jsObject = jsObject;
+      js.setDartHtmlWrapperFor(jsObject, dartClass_instance);
+      return dartClass_instance;
+    }
+    return jsObject;
+  } catch(e, stacktrace){
+    if (interop_checks) {
+      if (e is DebugAssertException)
+        window.console.log("${e.message}\n ${stacktrace}");
+      else
+        window.console.log("${stacktrace}");
+    }
+  }
+
+  return null;
+}
+
+/**
+ * Create Dart class that maps to the JS Type that is the JS type being
+ * extended using JS interop createCallback (we need the base type of the
+ * custom element) not the Dart created constructor.
+ */
+wrap_jso_custom_element(jsObject) {
+  try {
+    if (jsObject is! js.JsObject) {
+      // JS Interop converted the object to a Dart class e.g., Uint8ClampedList.
+      return jsObject;
+    }
+
+    // Find out what object we're extending.
+    var objectName = jsObject.toString();
+    // Expect to see something like '[object HTMLElement]'.
+    if (!objectName.startsWith('[object ')) {
+      return jsObject;
+    }
+
+    var extendsClass = objectName.substring(8, objectName.length - 1);
+    var func = getHtmlCreateFunction(extendsClass);
+    if (interop_checks)
+      debug_or_assert("func != null name = ${extendsClass}", func != null);
+    var dartClass_instance = func();
+    dartClass_instance.blink_jsObject = jsObject;
+    return dartClass_instance;
+  } catch(e, stacktrace){
+    if (interop_checks) {
+      if (e is DebugAssertException)
+        window.console.log("${e.message}\n ${stacktrace}");
+      else
+        window.console.log("${stacktrace}");
+    }
+
+    // Problem?
+    return null;
+  }
+}
+
+getCustomElementEntry(element) {
+  var hasAttribute = false;
+
+  var jsObject;
+  var tag = "";
+  var runtimeType = element.runtimeType;
+  if (runtimeType == HtmlElement) {
+    tag = element.localName;
+  } else if (runtimeType == TemplateElement) {
+    // Data binding with a Dart class.
+    tag = element.attributes['is'];
+  } else if (runtimeType == js.JsObjectImpl) {
+    // It's a Polymer core element (written in JS).
+    // Make sure it's an element anything else we can ignore.
+    if (element.hasProperty('nodeType') && element['nodeType'] == 1) {
+      if (js.JsNative.callMethod(element, 'hasAttribute', ['is'])) {
+        hasAttribute = true;
+        // It's data binding use the is attribute.
+        tag = js.JsNative.callMethod(element, 'getAttribute', ['is']);
+      } else {
+        // It's a custom element we want the local name.
+        tag = element['localName'];
+      }
+    }
+  } else {
+    throw new UnsupportedError('Element is incorrect type. Got ${runtimeType}, expected HtmlElement/HtmlTemplate/JsObjectImpl.');
+  }
+
+  var entry = _knownCustomElements[tag];
+  if (entry != null) {
+    // If there's an 'is' attribute then check if the extends tag registered
+    // matches the tag if so then return the entry that's registered for this
+    // extendsTag or if there's no 'is' tag then return the entry found.
+    if ((hasAttribute && entry['extends'] == tag) || !hasAttribute) {
+      return entry;
+    }
+  }
+
+  return null;
+}
+
+// List of known tagName to DartClass for custom elements, used for upgrade.
+var _knownCustomElements = new Map<String, Map<Type, String>>();
+
+void addCustomElementType(String tagName, Type dartClass, [String extendTag]) {
+  _knownCustomElements[tagName] =
+      {'type': dartClass, 'extends': extendTag != null ? extendTag : "" };
+}
+
+Type getCustomElementType(object) {
+  var entry = getCustomElementEntry(object);
+  if (entry != null) {
+    return entry['type'];
+  }
+  return null;
+}
+
+/**
+ * Wraps a JsArray and will call wrap_jso on its entries.
+ */
+class DartHtmlWrappingList extends ListBase implements NativeFieldWrapperClass2 {
+  DartHtmlWrappingList(this.blink_jsObject);
+
+  final js.JsArray blink_jsObject;
+
+  operator [](int index) => wrap_jso(js.JsNative.getArrayIndex(blink_jsObject, index));
+
+  operator []=(int index, value) => blink_jsObject[index] = value;
+
+  int get length => blink_jsObject.length;
+  int set length(int newLength) => blink_jsObject.length = newLength;
+}
diff --git a/sdk/lib/html/html_common/filtered_element_list.dart b/sdk/lib/html/html_common/filtered_element_list.dart
index 1a55d79..e9e4718 100644
--- a/sdk/lib/html/html_common/filtered_element_list.dart
+++ b/sdk/lib/html/html_common/filtered_element_list.dart
@@ -45,7 +45,7 @@
     this[index].replaceWith(value);
   }
 
-  void set length(int newLength) {
+  set length(int newLength) {
     final len = this.length;
     if (newLength >= len) {
       return;
diff --git a/sdk/lib/html/html_common/html_common.dart b/sdk/lib/html/html_common/html_common.dart
index a538266..c2e1644 100644
--- a/sdk/lib/html/html_common/html_common.dart
+++ b/sdk/lib/html/html_common/html_common.dart
@@ -4,9 +4,14 @@
 
 library html_common;
 
+import 'dart:async';
 import 'dart:collection';
 import 'dart:html';
+import 'dart:js' as js;
 import 'dart:_internal' show WhereIterable;
+import 'dart:nativewrappers';
+import 'dart:typed_data';
+import 'dart:web_gl' as gl;
 
 import 'metadata.dart';
 export 'metadata.dart';
@@ -15,3 +20,5 @@
 part 'device.dart';
 part 'filtered_element_list.dart';
 part 'lists.dart';
+part 'conversions.dart';
+part 'conversions_dartium.dart';
diff --git a/sdk/lib/html/html_common/html_common_dart2js.dart b/sdk/lib/html/html_common/html_common_dart2js.dart
index 9dcd5b9..f162ad8 100644
--- a/sdk/lib/html/html_common/html_common_dart2js.dart
+++ b/sdk/lib/html/html_common/html_common_dart2js.dart
@@ -4,12 +4,14 @@
 
 library html_common;
 
+import 'dart:async';
 import 'dart:collection';
 import 'dart:html';
 import 'dart:_internal' show WhereIterable;
 import 'dart:web_gl' as gl;
+import 'dart:typed_data';
 import 'dart:_native_typed_data';
-import 'dart:_js_helper' show Creates, Returns;
+import 'dart:_js_helper' show Creates, Returns, convertDartClosureToJS;
 import 'dart:_foreign_helper' show JS;
 import 'dart:_interceptors' show Interceptor, JSExtendableArray;
 
@@ -18,6 +20,7 @@
 
 part 'css_class_set.dart';
 part 'conversions.dart';
+part 'conversions_dart2js.dart';
 part 'device.dart';
 part 'filtered_element_list.dart';
 part 'lists.dart';
diff --git a/sdk/lib/indexed_db/dart2js/indexed_db_dart2js.dart b/sdk/lib/indexed_db/dart2js/indexed_db_dart2js.dart
index 3db17c2..034b2ce 100644
--- a/sdk/lib/indexed_db/dart2js/indexed_db_dart2js.dart
+++ b/sdk/lib/indexed_db/dart2js/indexed_db_dart2js.dart
@@ -77,7 +77,7 @@
 import 'dart:html_common';
 import 'dart:_native_typed_data';
 import 'dart:typed_data';
-import 'dart:_js_helper' show Creates, Returns, JSName, Native, Null;
+import 'dart:_js_helper' show Creates, Returns, JSName, Native;
 import 'dart:_foreign_helper' show JS;
 import 'dart:_interceptors' show Interceptor, JSExtendableArray;
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
diff --git a/sdk/lib/indexed_db/dartium/indexed_db_dartium.dart b/sdk/lib/indexed_db/dartium/indexed_db_dartium.dart
index eb045b0..c75130a 100644
--- a/sdk/lib/indexed_db/dartium/indexed_db_dartium.dart
+++ b/sdk/lib/indexed_db/dartium/indexed_db_dartium.dart
@@ -62,7 +62,7 @@
  * and where both the keys and the values are strings.
  *
  * * [dart:web_sql]&mdash;a database that can be queried with SQL.
- * 
+ *
  * For a tutorial about using the indexed_db library with Dart,
  * check out
  * [Use IndexedDB](http://www.dartlang.org/docs/tutorials/indexeddb/).
@@ -77,6 +77,7 @@
 import 'dart:html_common';
 import 'dart:nativewrappers';
 import 'dart:_blink' as _blink;
+import 'dart:js' as js;
 // Copyright (c) 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.
@@ -107,6 +108,7 @@
       KeyRange.bound_(lower, upper, lowerOpen, upperOpen);
 }
 // FIXME: Can we make this private?
+@Deprecated("Internal Use Only")
 final indexed_dbBlinkMap = {
   'IDBCursor': () => Cursor,
   'IDBCursorWithValue': () => CursorWithValue,
@@ -122,6 +124,22 @@
 
 };
 
+// FIXME: Can we make this private?
+@Deprecated("Internal Use Only")
+final indexed_dbBlinkFunctionMap = {
+  'IDBCursor': () => Cursor.internalCreateCursor,
+  'IDBCursorWithValue': () => CursorWithValue.internalCreateCursorWithValue,
+  'IDBDatabase': () => Database.internalCreateDatabase,
+  'IDBFactory': () => IdbFactory.internalCreateIdbFactory,
+  'IDBIndex': () => Index.internalCreateIndex,
+  'IDBKeyRange': () => KeyRange.internalCreateKeyRange,
+  'IDBObjectStore': () => ObjectStore.internalCreateObjectStore,
+  'IDBOpenDBRequest': () => OpenDBRequest.internalCreateOpenDBRequest,
+  'IDBRequest': () => Request.internalCreateRequest,
+  'IDBTransaction': () => Transaction.internalCreateTransaction,
+  'IDBVersionChangeEvent': () => VersionChangeEvent.internalCreateVersionChangeEvent,
+
+};
 // 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.
@@ -129,7 +147,7 @@
 
 @DomName('IDBCursor')
 @Unstable()
-class Cursor extends NativeFieldWrapperClass2 {
+class Cursor extends DartHtmlDomObject {
   @DomName('IDBCursor.delete')
   Future delete() {
    try {
@@ -151,21 +169,36 @@
     // To suppress missing implicit constructor warnings.
   factory Cursor._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static Cursor internalCreateCursor() {
+    return new Cursor._internalWrap();
+  }
+
+  factory Cursor._internalWrap() {
+    return new Cursor.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  Cursor.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('IDBCursor.direction')
   @DocsEditable()
   String get direction => _blink.BlinkIDBCursor.instance.direction_Getter_(unwrap_jso(this));
   
   @DomName('IDBCursor.key')
   @DocsEditable()
-  Object get key => _blink.BlinkIDBCursor.instance.key_Getter_(unwrap_jso(this));
+  Object get key => wrap_jso(_blink.BlinkIDBCursor.instance.key_Getter_(unwrap_jso(this)));
   
   @DomName('IDBCursor.primaryKey')
   @DocsEditable()
-  Object get primaryKey => _blink.BlinkIDBCursor.instance.primaryKey_Getter_(unwrap_jso(this));
+  Object get primaryKey => wrap_jso(_blink.BlinkIDBCursor.instance.primaryKey_Getter_(unwrap_jso(this)));
   
   @DomName('IDBCursor.source')
   @DocsEditable()
-  Object get source => _blink.BlinkIDBCursor.instance.source_Getter_(unwrap_jso(this));
+  Object get source => wrap_jso(_blink.BlinkIDBCursor.instance.source_Getter_(unwrap_jso(this)));
   
   @DomName('IDBCursor.advance')
   @DocsEditable()
@@ -191,7 +224,7 @@
 
   @DomName('IDBCursor.update')
   @DocsEditable()
-  Request _update(Object value) => wrap_jso(_blink.BlinkIDBCursor.instance.update_Callback_1_(unwrap_jso(this), value));
+  Request _update(Object value) => wrap_jso(_blink.BlinkIDBCursor.instance.update_Callback_1_(unwrap_jso(this), convertDartToNative_SerializedScriptValue(value)));
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -208,9 +241,23 @@
   // To suppress missing implicit constructor warnings.
   factory CursorWithValue._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static CursorWithValue internalCreateCursorWithValue() {
+    return new CursorWithValue._internalWrap();
+  }
+
+  factory CursorWithValue._internalWrap() {
+    return new CursorWithValue.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  CursorWithValue.internal_() : super.internal_();
+
+
   @DomName('IDBCursorWithValue.value')
   @DocsEditable()
-  Object get value => _blink.BlinkIDBCursorWithValue.instance.value_Getter_(unwrap_jso(this));
+  Object get value => wrap_jso(_blink.BlinkIDBCursorWithValue.instance.value_Getter_(unwrap_jso(this)));
   
 }
 // Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
@@ -291,17 +338,31 @@
   @DocsEditable()
   static const EventStreamProvider<VersionChangeEvent> versionChangeEvent = const EventStreamProvider<VersionChangeEvent>('versionchange');
 
+
+  @Deprecated("Internal Use Only")
+  static Database internalCreateDatabase() {
+    return new Database._internalWrap();
+  }
+
+  factory Database._internalWrap() {
+    return new Database.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  Database.internal_() : super.internal_();
+
+
   @DomName('IDBDatabase.name')
   @DocsEditable()
   String get name => _blink.BlinkIDBDatabase.instance.name_Getter_(unwrap_jso(this));
   
   @DomName('IDBDatabase.objectStoreNames')
   @DocsEditable()
-  List<String> get objectStoreNames => _blink.BlinkIDBDatabase.instance.objectStoreNames_Getter_(unwrap_jso(this));
+  List<String> get objectStoreNames => wrap_jso(_blink.BlinkIDBDatabase.instance.objectStoreNames_Getter_(unwrap_jso(this)));
   
   @DomName('IDBDatabase.version')
   @DocsEditable()
-  Object get version => _blink.BlinkIDBDatabase.instance.version_Getter_(unwrap_jso(this));
+  Object get version => wrap_jso(_blink.BlinkIDBDatabase.instance.version_Getter_(unwrap_jso(this)));
   
   @DomName('IDBDatabase.close')
   @DocsEditable()
@@ -309,9 +370,9 @@
   
   ObjectStore _createObjectStore(String name, [Map options]) {
     if (options != null) {
-      return _blink.BlinkIDBDatabase.instance.createObjectStore_Callback_2_(unwrap_jso(this), name, options);
+      return wrap_jso(_blink.BlinkIDBDatabase.instance.createObjectStore_Callback_2_(unwrap_jso(this), name, convertDartToNative_Dictionary(options)));
     }
-    return _blink.BlinkIDBDatabase.instance.createObjectStore_Callback_1_(unwrap_jso(this), name);
+    return wrap_jso(_blink.BlinkIDBDatabase.instance.createObjectStore_Callback_1_(unwrap_jso(this), name));
   }
 
   @DomName('IDBDatabase.deleteObjectStore')
@@ -320,45 +381,45 @@
   
   Transaction transaction(storeName_OR_storeNames, [String mode]) {
     if ((storeName_OR_storeNames is String || storeName_OR_storeNames == null) && mode == null) {
-      return _blink.BlinkIDBDatabase.instance.transaction_Callback_1_(unwrap_jso(this), unwrap_jso(storeName_OR_storeNames));
+      return wrap_jso(_blink.BlinkIDBDatabase.instance.transaction_Callback_1_(unwrap_jso(this), unwrap_jso(storeName_OR_storeNames)));
     }
     if ((mode is String || mode == null) && (storeName_OR_storeNames is String || storeName_OR_storeNames == null)) {
-      return _blink.BlinkIDBDatabase.instance.transaction_Callback_2_(unwrap_jso(this), unwrap_jso(storeName_OR_storeNames), mode);
+      return wrap_jso(_blink.BlinkIDBDatabase.instance.transaction_Callback_2_(unwrap_jso(this), unwrap_jso(storeName_OR_storeNames), mode));
     }
     if ((storeName_OR_storeNames is List<String> || storeName_OR_storeNames == null) && mode == null) {
-      return _blink.BlinkIDBDatabase.instance.transaction_Callback_1_(unwrap_jso(this), unwrap_jso(storeName_OR_storeNames));
+      return wrap_jso(_blink.BlinkIDBDatabase.instance.transaction_Callback_1_(unwrap_jso(this), unwrap_jso(storeName_OR_storeNames)));
     }
     if ((mode is String || mode == null) && (storeName_OR_storeNames is List<String> || storeName_OR_storeNames == null)) {
-      return _blink.BlinkIDBDatabase.instance.transaction_Callback_2_(unwrap_jso(this), unwrap_jso(storeName_OR_storeNames), mode);
+      return wrap_jso(_blink.BlinkIDBDatabase.instance.transaction_Callback_2_(unwrap_jso(this), unwrap_jso(storeName_OR_storeNames), mode));
     }
     if ((storeName_OR_storeNames is DomStringList || storeName_OR_storeNames == null) && mode == null) {
-      return _blink.BlinkIDBDatabase.instance.transaction_Callback_1_(unwrap_jso(this), unwrap_jso(storeName_OR_storeNames));
+      return wrap_jso(_blink.BlinkIDBDatabase.instance.transaction_Callback_1_(unwrap_jso(this), unwrap_jso(storeName_OR_storeNames)));
     }
     if ((mode is String || mode == null) && (storeName_OR_storeNames is DomStringList || storeName_OR_storeNames == null)) {
-      return _blink.BlinkIDBDatabase.instance.transaction_Callback_2_(unwrap_jso(this), unwrap_jso(storeName_OR_storeNames), mode);
+      return wrap_jso(_blink.BlinkIDBDatabase.instance.transaction_Callback_2_(unwrap_jso(this), unwrap_jso(storeName_OR_storeNames), mode));
     }
     throw new ArgumentError("Incorrect number or type of arguments");
   }
 
   Transaction transactionList(List<String> storeNames, [String mode]) {
     if (mode != null) {
-      return _blink.BlinkIDBDatabase.instance.transaction_Callback_2_(unwrap_jso(this), storeNames, mode);
+      return wrap_jso(_blink.BlinkIDBDatabase.instance.transaction_Callback_2_(unwrap_jso(this), convertDartToNative_StringArray(storeNames), mode));
     }
-    return _blink.BlinkIDBDatabase.instance.transaction_Callback_1_(unwrap_jso(this), storeNames);
+    return wrap_jso(_blink.BlinkIDBDatabase.instance.transaction_Callback_1_(unwrap_jso(this), convertDartToNative_StringArray(storeNames)));
   }
 
   Transaction transactionStore(String storeName, [String mode]) {
     if (mode != null) {
-      return _blink.BlinkIDBDatabase.instance.transaction_Callback_2_(unwrap_jso(this), storeName, mode);
+      return wrap_jso(_blink.BlinkIDBDatabase.instance.transaction_Callback_2_(unwrap_jso(this), storeName, mode));
     }
-    return _blink.BlinkIDBDatabase.instance.transaction_Callback_1_(unwrap_jso(this), storeName);
+    return wrap_jso(_blink.BlinkIDBDatabase.instance.transaction_Callback_1_(unwrap_jso(this), storeName));
   }
 
   Transaction transactionStores(List<String> storeNames, [String mode]) {
     if (mode != null) {
-      return _blink.BlinkIDBDatabase.instance.transaction_Callback_2_(unwrap_jso(this), unwrap_jso(storeNames), mode);
+      return wrap_jso(_blink.BlinkIDBDatabase.instance.transaction_Callback_2_(unwrap_jso(this), unwrap_jso(storeNames), mode));
     }
-    return _blink.BlinkIDBDatabase.instance.transaction_Callback_1_(unwrap_jso(this), unwrap_jso(storeNames));
+    return wrap_jso(_blink.BlinkIDBDatabase.instance.transaction_Callback_1_(unwrap_jso(this), unwrap_jso(storeNames)));
   }
 
   /// Stream of `abort` events handled by this [Database].
@@ -394,7 +455,7 @@
 @SupportedBrowser(SupportedBrowser.IE, '10')
 @Experimental()
 @Unstable()
-class IdbFactory extends NativeFieldWrapperClass2 {
+class IdbFactory extends DartHtmlDomObject {
   /**
    * Checks to see if Indexed DB is supported on the current platform.
    */
@@ -473,19 +534,34 @@
   // To suppress missing implicit constructor warnings.
   factory IdbFactory._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static IdbFactory internalCreateIdbFactory() {
+    return new IdbFactory._internalWrap();
+  }
+
+  factory IdbFactory._internalWrap() {
+    return new IdbFactory.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  IdbFactory.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('IDBFactory.cmp')
   @DocsEditable()
   int cmp(Object first, Object second) => _blink.BlinkIDBFactory.instance.cmp_Callback_2_(unwrap_jso(this), first, second);
   
   @DomName('IDBFactory.deleteDatabase')
   @DocsEditable()
-  OpenDBRequest _deleteDatabase(String name) => _blink.BlinkIDBFactory.instance.deleteDatabase_Callback_1_(unwrap_jso(this), name);
+  OpenDBRequest _deleteDatabase(String name) => wrap_jso(_blink.BlinkIDBFactory.instance.deleteDatabase_Callback_1_(unwrap_jso(this), name));
   
   OpenDBRequest _open(String name, [int version]) {
     if (version != null) {
-      return _blink.BlinkIDBFactory.instance.open_Callback_2_(unwrap_jso(this), name, version);
+      return wrap_jso(_blink.BlinkIDBFactory.instance.open_Callback_2_(unwrap_jso(this), name, version));
     }
-    return _blink.BlinkIDBFactory.instance.open_Callback_1_(unwrap_jso(this), name);
+    return wrap_jso(_blink.BlinkIDBFactory.instance.open_Callback_1_(unwrap_jso(this), name));
   }
 
   @DomName('IDBFactory.webkitGetDatabaseNames')
@@ -519,7 +595,7 @@
 
 @DomName('IDBIndex')
 @Unstable()
-class Index extends NativeFieldWrapperClass2 {
+class Index extends DartHtmlDomObject {
   @DomName('IDBIndex.count')
   Future<int> count([key_OR_range]) {
    try {
@@ -611,9 +687,24 @@
     // To suppress missing implicit constructor warnings.
   factory Index._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static Index internalCreateIndex() {
+    return new Index._internalWrap();
+  }
+
+  factory Index._internalWrap() {
+    return new Index.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  Index.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('IDBIndex.keyPath')
   @DocsEditable()
-  Object get keyPath => _blink.BlinkIDBIndex.instance.keyPath_Getter_(unwrap_jso(this));
+  Object get keyPath => wrap_jso(_blink.BlinkIDBIndex.instance.keyPath_Getter_(unwrap_jso(this)));
   
   @DomName('IDBIndex.multiEntry')
   @DocsEditable()
@@ -665,7 +756,7 @@
 
 @DomName('IDBKeyRange')
 @Unstable()
-class KeyRange extends NativeFieldWrapperClass2 {
+class KeyRange extends DartHtmlDomObject {
   @DomName('IDBKeyRange.only')
   factory KeyRange.only(/*Key*/ value) =>
       _KeyRangeFactoryProvider.createKeyRange_only(value);
@@ -687,9 +778,24 @@
   // To suppress missing implicit constructor warnings.
   factory KeyRange._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static KeyRange internalCreateKeyRange() {
+    return new KeyRange._internalWrap();
+  }
+
+  factory KeyRange._internalWrap() {
+    return new KeyRange.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  KeyRange.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('IDBKeyRange.lower')
   @DocsEditable()
-  Object get lower => _blink.BlinkIDBKeyRange.instance.lower_Getter_(unwrap_jso(this));
+  Object get lower => wrap_jso(_blink.BlinkIDBKeyRange.instance.lower_Getter_(unwrap_jso(this)));
   
   @DomName('IDBKeyRange.lowerOpen')
   @DocsEditable()
@@ -697,7 +803,7 @@
   
   @DomName('IDBKeyRange.upper')
   @DocsEditable()
-  Object get upper => _blink.BlinkIDBKeyRange.instance.upper_Getter_(unwrap_jso(this));
+  Object get upper => wrap_jso(_blink.BlinkIDBKeyRange.instance.upper_Getter_(unwrap_jso(this)));
   
   @DomName('IDBKeyRange.upperOpen')
   @DocsEditable()
@@ -705,31 +811,31 @@
   
   static KeyRange bound_(Object lower, Object upper, [bool lowerOpen, bool upperOpen]) {
     if (upperOpen != null) {
-      return _blink.BlinkIDBKeyRange.instance.bound_Callback_4_(lower, upper, lowerOpen, upperOpen);
+      return wrap_jso(_blink.BlinkIDBKeyRange.instance.bound_Callback_4_(lower, upper, lowerOpen, upperOpen));
     }
     if (lowerOpen != null) {
-      return _blink.BlinkIDBKeyRange.instance.bound_Callback_3_(lower, upper, lowerOpen);
+      return wrap_jso(_blink.BlinkIDBKeyRange.instance.bound_Callback_3_(lower, upper, lowerOpen));
     }
-    return _blink.BlinkIDBKeyRange.instance.bound_Callback_2_(lower, upper);
+    return wrap_jso(_blink.BlinkIDBKeyRange.instance.bound_Callback_2_(lower, upper));
   }
 
   static KeyRange lowerBound_(Object bound, [bool open]) {
     if (open != null) {
-      return _blink.BlinkIDBKeyRange.instance.lowerBound_Callback_2_(bound, open);
+      return wrap_jso(_blink.BlinkIDBKeyRange.instance.lowerBound_Callback_2_(bound, open));
     }
-    return _blink.BlinkIDBKeyRange.instance.lowerBound_Callback_1_(bound);
+    return wrap_jso(_blink.BlinkIDBKeyRange.instance.lowerBound_Callback_1_(bound));
   }
 
   @DomName('IDBKeyRange.only_')
   @DocsEditable()
   @Experimental() // non-standard
-  static KeyRange only_(Object value) => _blink.BlinkIDBKeyRange.instance.only_Callback_1_(value);
+  static KeyRange only_(Object value) => wrap_jso(_blink.BlinkIDBKeyRange.instance.only_Callback_1_(value));
   
   static KeyRange upperBound_(Object bound, [bool open]) {
     if (open != null) {
-      return _blink.BlinkIDBKeyRange.instance.upperBound_Callback_2_(bound, open);
+      return wrap_jso(_blink.BlinkIDBKeyRange.instance.upperBound_Callback_2_(bound, open));
     }
-    return _blink.BlinkIDBKeyRange.instance.upperBound_Callback_1_(bound);
+    return wrap_jso(_blink.BlinkIDBKeyRange.instance.upperBound_Callback_1_(bound));
   }
 
 }
@@ -740,7 +846,7 @@
 
 @DomName('IDBObjectStore')
 @Unstable()
-class ObjectStore extends NativeFieldWrapperClass2 {
+class ObjectStore extends DartHtmlDomObject {
 
   @DomName('IDBObjectStore.add')
   Future add(value, [key]) {
@@ -871,17 +977,32 @@
   // To suppress missing implicit constructor warnings.
   factory ObjectStore._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static ObjectStore internalCreateObjectStore() {
+    return new ObjectStore._internalWrap();
+  }
+
+  factory ObjectStore._internalWrap() {
+    return new ObjectStore.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  ObjectStore.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('IDBObjectStore.autoIncrement')
   @DocsEditable()
   bool get autoIncrement => _blink.BlinkIDBObjectStore.instance.autoIncrement_Getter_(unwrap_jso(this));
   
   @DomName('IDBObjectStore.indexNames')
   @DocsEditable()
-  List<String> get indexNames => _blink.BlinkIDBObjectStore.instance.indexNames_Getter_(unwrap_jso(this));
+  List<String> get indexNames => wrap_jso(_blink.BlinkIDBObjectStore.instance.indexNames_Getter_(unwrap_jso(this)));
   
   @DomName('IDBObjectStore.keyPath')
   @DocsEditable()
-  Object get keyPath => _blink.BlinkIDBObjectStore.instance.keyPath_Getter_(unwrap_jso(this));
+  Object get keyPath => wrap_jso(_blink.BlinkIDBObjectStore.instance.keyPath_Getter_(unwrap_jso(this)));
   
   @DomName('IDBObjectStore.name')
   @DocsEditable()
@@ -893,9 +1014,9 @@
   
   Request _add(Object value, [Object key]) {
     if (key != null) {
-      return wrap_jso(_blink.BlinkIDBObjectStore.instance.add_Callback_2_(unwrap_jso(this), value, key));
+      return wrap_jso(_blink.BlinkIDBObjectStore.instance.add_Callback_2_(unwrap_jso(this), convertDartToNative_SerializedScriptValue(value), convertDartToNative_SerializedScriptValue(key)));
     }
-    return wrap_jso(_blink.BlinkIDBObjectStore.instance.add_Callback_1_(unwrap_jso(this), value));
+    return wrap_jso(_blink.BlinkIDBObjectStore.instance.add_Callback_1_(unwrap_jso(this), convertDartToNative_SerializedScriptValue(value)));
   }
 
   @DomName('IDBObjectStore.clear')
@@ -908,16 +1029,16 @@
   
   Index _createIndex(String name, keyPath, [Map options]) {
     if ((keyPath is String || keyPath == null) && (name is String || name == null) && options == null) {
-      return _blink.BlinkIDBObjectStore.instance.createIndex_Callback_2_(unwrap_jso(this), name, unwrap_jso(keyPath));
+      return wrap_jso(_blink.BlinkIDBObjectStore.instance.createIndex_Callback_2_(unwrap_jso(this), name, unwrap_jso(keyPath)));
     }
     if ((options is Map || options == null) && (keyPath is String || keyPath == null) && (name is String || name == null)) {
-      return _blink.BlinkIDBObjectStore.instance.createIndex_Callback_3_(unwrap_jso(this), name, unwrap_jso(keyPath), options);
+      return wrap_jso(_blink.BlinkIDBObjectStore.instance.createIndex_Callback_3_(unwrap_jso(this), name, unwrap_jso(keyPath), convertDartToNative_Dictionary(options)));
     }
     if ((keyPath is List<String> || keyPath == null) && (name is String || name == null) && options == null) {
-      return _blink.BlinkIDBObjectStore.instance.createIndex_Callback_2_(unwrap_jso(this), name, unwrap_jso(keyPath));
+      return wrap_jso(_blink.BlinkIDBObjectStore.instance.createIndex_Callback_2_(unwrap_jso(this), name, unwrap_jso(keyPath)));
     }
     if ((options is Map || options == null) && (keyPath is List<String> || keyPath == null) && (name is String || name == null)) {
-      return _blink.BlinkIDBObjectStore.instance.createIndex_Callback_3_(unwrap_jso(this), name, unwrap_jso(keyPath), options);
+      return wrap_jso(_blink.BlinkIDBObjectStore.instance.createIndex_Callback_3_(unwrap_jso(this), name, unwrap_jso(keyPath), convertDartToNative_Dictionary(options)));
     }
     throw new ArgumentError("Incorrect number or type of arguments");
   }
@@ -936,7 +1057,7 @@
   
   @DomName('IDBObjectStore.index')
   @DocsEditable()
-  Index index(String name) => _blink.BlinkIDBObjectStore.instance.index_Callback_1_(unwrap_jso(this), name);
+  Index index(String name) => wrap_jso(_blink.BlinkIDBObjectStore.instance.index_Callback_1_(unwrap_jso(this), name));
   
   Request _openCursor(Object range, [String direction]) {
     if (direction != null) {
@@ -954,9 +1075,9 @@
 
   Request _put(Object value, [Object key]) {
     if (key != null) {
-      return wrap_jso(_blink.BlinkIDBObjectStore.instance.put_Callback_2_(unwrap_jso(this), value, key));
+      return wrap_jso(_blink.BlinkIDBObjectStore.instance.put_Callback_2_(unwrap_jso(this), convertDartToNative_SerializedScriptValue(value), convertDartToNative_SerializedScriptValue(key)));
     }
-    return wrap_jso(_blink.BlinkIDBObjectStore.instance.put_Callback_1_(unwrap_jso(this), value));
+    return wrap_jso(_blink.BlinkIDBObjectStore.instance.put_Callback_1_(unwrap_jso(this), convertDartToNative_SerializedScriptValue(value)));
   }
 
 
@@ -1021,6 +1142,20 @@
   @DocsEditable()
   static const EventStreamProvider<VersionChangeEvent> upgradeNeededEvent = const EventStreamProvider<VersionChangeEvent>('upgradeneeded');
 
+
+  @Deprecated("Internal Use Only")
+  static OpenDBRequest internalCreateOpenDBRequest() {
+    return new OpenDBRequest._internalWrap();
+  }
+
+  factory OpenDBRequest._internalWrap() {
+    return new OpenDBRequest.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  OpenDBRequest.internal_() : super.internal_();
+
+
   /// Stream of `blocked` events handled by this [OpenDBRequest].
   @DomName('IDBOpenDBRequest.onblocked')
   @DocsEditable()
@@ -1066,6 +1201,20 @@
   @DocsEditable()
   static const EventStreamProvider<Event> successEvent = const EventStreamProvider<Event>('success');
 
+
+  @Deprecated("Internal Use Only")
+  static Request internalCreateRequest() {
+    return new Request._internalWrap();
+  }
+
+  factory Request._internalWrap() {
+    return new Request.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  Request.internal_() : super.internal_();
+
+
   @DomName('IDBRequest.error')
   @DocsEditable()
   DomError get error => wrap_jso(_blink.BlinkIDBRequest.instance.error_Getter_(unwrap_jso(this)));
@@ -1076,11 +1225,11 @@
   
   @DomName('IDBRequest.result')
   @DocsEditable()
-  Object get result => _blink.BlinkIDBRequest.instance.result_Getter_(unwrap_jso(this));
+  Object get result => wrap_jso(_blink.BlinkIDBRequest.instance.result_Getter_(unwrap_jso(this)));
   
   @DomName('IDBRequest.source')
   @DocsEditable()
-  Object get source => _blink.BlinkIDBRequest.instance.source_Getter_(unwrap_jso(this));
+  Object get source => wrap_jso(_blink.BlinkIDBRequest.instance.source_Getter_(unwrap_jso(this)));
   
   @DomName('IDBRequest.transaction')
   @DocsEditable()
@@ -1167,6 +1316,20 @@
   @DocsEditable()
   static const EventStreamProvider<Event> errorEvent = const EventStreamProvider<Event>('error');
 
+
+  @Deprecated("Internal Use Only")
+  static Transaction internalCreateTransaction() {
+    return new Transaction._internalWrap();
+  }
+
+  factory Transaction._internalWrap() {
+    return new Transaction.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  Transaction.internal_() : super.internal_();
+
+
   @DomName('IDBTransaction.db')
   @DocsEditable()
   Database get db => wrap_jso(_blink.BlinkIDBTransaction.instance.db_Getter_(unwrap_jso(this)));
@@ -1185,7 +1348,7 @@
   
   @DomName('IDBTransaction.objectStore')
   @DocsEditable()
-  ObjectStore objectStore(String name) => _blink.BlinkIDBTransaction.instance.objectStore_Callback_1_(unwrap_jso(this), name);
+  ObjectStore objectStore(String name) => wrap_jso(_blink.BlinkIDBTransaction.instance.objectStore_Callback_1_(unwrap_jso(this), name));
   
   /// Stream of `abort` events handled by this [Transaction].
   @DomName('IDBTransaction.onabort')
@@ -1217,6 +1380,20 @@
   // To suppress missing implicit constructor warnings.
   factory VersionChangeEvent._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static VersionChangeEvent internalCreateVersionChangeEvent() {
+    return new VersionChangeEvent._internalWrap();
+  }
+
+  factory VersionChangeEvent._internalWrap() {
+    return new VersionChangeEvent.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  VersionChangeEvent.internal_() : super.internal_();
+
+
   @DomName('IDBVersionChangeEvent.dataLoss')
   @DocsEditable()
   @Experimental() // untriaged
diff --git a/sdk/lib/internal/list.dart b/sdk/lib/internal/list.dart
index ed5c987..37ee3f8 100644
--- a/sdk/lib/internal/list.dart
+++ b/sdk/lib/internal/list.dart
@@ -11,7 +11,7 @@
  */
 abstract class FixedLengthListMixin<E> {
   /** This operation is not supported by a fixed length list. */
-  void set length(int newLength) {
+  set length(int newLength) {
     throw new UnsupportedError(
         "Cannot change the length of a fixed-length list");
   }
@@ -105,7 +105,7 @@
   }
 
   /** This operation is not supported by an unmodifiable list. */
-  void set length(int newLength) {
+  set length(int newLength) {
     throw new UnsupportedError(
         "Cannot change the length of an unmodifiable list");
   }
diff --git a/sdk/lib/io/data_transformer.dart b/sdk/lib/io/data_transformer.dart
index f9f974a..144234d 100644
--- a/sdk/lib/io/data_transformer.dart
+++ b/sdk/lib/io/data_transformer.dart
@@ -483,22 +483,22 @@
 
   void addSlice(List<int> data, int start, int end, bool isLast) {
     if (_closed) return;
-    if (start < 0 || start > data.length) {
-      throw new ArgumentError("Invalid start position");
-    }
-    if (end < 0 || end > data.length || end < start) {
-      throw new ArgumentError("Invalid end position");
-    }
+    if (end == null) throw new ArgumentError.notNull("end");
+    RangeError.checkValidRange(start, end, data.length);
     try {
       _empty = false;
-      _filter.process(data, start, end);
+      _BufferAndStart bufferAndStart =
+          _ensureFastAndSerializableByteData(data, start, end);
+      _filter.process(bufferAndStart.buffer,
+                      bufferAndStart.start,
+                      end - (start - bufferAndStart.start));
       var out;
       while ((out = _filter.processed(flush: false)) != null) {
         _sink.add(out);
       }
     } catch (e) {
       _closed = true;
-      throw e;
+      rethrow;
     }
 
     if (isLast) close();
diff --git a/sdk/lib/io/file_impl.dart b/sdk/lib/io/file_impl.dart
index 8ed6c58..6b0dc96 100644
--- a/sdk/lib/io/file_impl.dart
+++ b/sdk/lib/io/file_impl.dart
@@ -566,56 +566,43 @@
 
 
 class _RandomAccessFile
-    extends Object with _ServiceObject
     implements RandomAccessFile {
-  // Use default Map so we keep order.
-  static Map<int, _RandomAccessFile> _files = new Map<int, _RandomAccessFile>();
+  static bool _connectedResourceHandler = false;
 
   final String path;
   int _id;
   bool _asyncDispatched = false;
   SendPort _fileService;
 
-  int _totalRead = 0;
-  int _totalWritten = 0;
-  int _readCount = 0;
-  int _writeCount = 0;
-
+  _FileResourceInfo _resourceInfo;
 
   _RandomAccessFile(this._id, this.path) {
-    _files[_serviceId] = this;
-  }
-
-  String get _serviceTypePath => 'io/file/randomaccessfiles';
-  String get _serviceTypeName => 'RandomAccessFile';
-
-  Map _toJSON(bool ref) {
-    var r = {
-      'id': _servicePath,
-      'type': _serviceType(ref),
-      'name': '$path',
-      'user_name': '$path',
-    };
-    if (ref) {
-      return r;
-    }
-    r['asyncDispatched'] = _asyncDispatched;
-    r['fd'] = _getFD(_id);
-    r['totalRead'] = _totalRead;
-    r['totalWritten'] = _totalWritten;
-    r['readCount'] = _totalWritten;
-    r['writeCount'] = _writeCount;
-    return r;
+    _resourceInfo = new _FileResourceInfo(this);
+    _maybeConnectHandler();
   }
 
   void _maybePerformCleanup() {
     if (closed) {
-      _files.remove(_serviceId);
+      _FileResourceInfo.FileClosed(_resourceInfo);
     }
   }
 
   external static int _getFD(int id);
 
+  _maybeConnectHandler() {
+    if (!_connectedResourceHandler) {
+      // TODO(ricow): we probably need set these in some initialization code.
+      // We need to make sure that these are always awailable from the
+      // observatory even if no files (or sockets for the socket ones) are
+      // open.
+      registerExtension('__getOpenFiles',
+                        _FileResourceInfo.getOpenFiles);
+      registerExtension('__getFileByID',
+                        _FileResourceInfo.getFileInfoMapByID);
+      _connectedResourceHandler = true;
+    }
+  }
+
   Future<RandomAccessFile> close() {
     return _dispatch(_FILE_CLOSE, [_id], markClosed: true).then((result) {
       if (result != -1) {
@@ -645,8 +632,7 @@
       if (_isErrorResponse(response)) {
         throw _exceptionFromResponse(response, "readByte failed", path);
       }
-      _readCount++;
-      _totalRead++;
+      _resourceInfo.addRead(1);
       return response;
     });
   }
@@ -659,8 +645,7 @@
     if (result is OSError) {
       throw new FileSystemException("readByte failed", path, result);
     }
-    _readCount++;
-    _totalRead++;
+    _resourceInfo.addRead(1);
     return result;
   }
 
@@ -672,8 +657,7 @@
       if (_isErrorResponse(response)) {
         throw _exceptionFromResponse(response, "read failed", path);
       }
-      _readCount++;
-      _totalRead += response[1].length;
+      _resourceInfo.addRead(response[1].length);
       return response[1];
     });
   }
@@ -689,8 +673,7 @@
     if (result is OSError) {
       throw new FileSystemException("readSync failed", path, result);
     }
-    _readCount++;
-    _totalRead += result.length;
+    _resourceInfo.addRead(result.length);
     return result;
   }
 
@@ -710,8 +693,7 @@
       var read = response[1];
       var data = response[2];
       buffer.setRange(start, start + read, data);
-      _readCount++;
-      _totalRead += read;
+      _resourceInfo.addRead(read);
       return read;
     });
   }
@@ -731,8 +713,7 @@
     if (result is OSError) {
       throw new FileSystemException("readInto failed", path, result);
     }
-    _readCount++;
-    _totalRead += result;
+    _resourceInfo.addRead(result);
     return result;
   }
 
@@ -744,8 +725,7 @@
       if (_isErrorResponse(response)) {
         throw _exceptionFromResponse(response, "writeByte failed", path);
       }
-      _writeCount++;
-      _totalWritten++;
+      _resourceInfo.addWrite(1);
       return this;
     });
   }
@@ -761,8 +741,7 @@
     if (result is OSError) {
       throw new FileSystemException("writeByte failed", path, result);
     }
-    _writeCount++;
-    _totalWritten++;
+    _resourceInfo.addWrite(1);
     return result;
   }
 
@@ -791,8 +770,7 @@
       if (_isErrorResponse(response)) {
         throw _exceptionFromResponse(response, "writeFrom failed", path);
       }
-      _writeCount++;
-      _totalWritten += end - (start - result.start);
+      _resourceInfo.addWrite(end - (start - result.start));
       return this;
     });
   }
@@ -817,8 +795,7 @@
     if (result is OSError) {
       throw new FileSystemException("writeFrom failed", path, result);
     }
-    _writeCount++;
-    _totalWritten += end - (start - bufferAndStart.start);
+    _resourceInfo.addWrite(end - (start - bufferAndStart.start));
   }
 
   Future<RandomAccessFile> writeString(String string,
diff --git a/sdk/lib/io/http.dart b/sdk/lib/io/http.dart
index 4bc5448..deae6dc 100644
--- a/sdk/lib/io/http.dart
+++ b/sdk/lib/io/http.dart
@@ -93,23 +93,28 @@
  *
  * Use [bindSecure] to create an HTTPS server.
  *
- * The server presents a certificate to the client. In the following
- * example, the certificate is named `localhost_cert` and comes from
- * the database found in the `pkcert` directory.
+ * The server presents a certificate to the client. The certificate
+ * chain and the private key are set in the [SecurityContext]
+ * object that is passed to [bindSecure].
  *
  *     import 'dart:io';
  *     import "dart:isolate";
  *
  *     main() {
- *       var testPkcertDatabase = Platform.script.resolve('pkcert')
- *                                        .toFilePath();
- *       SecureSocket.initialize(database: testPkcertDatabase,
- *                               password: 'dartdart');
+ *       SecurityContext context = new SecurityContext();
+ *       var chain =
+ *           Platform.script.resolve('certificates/server_chain.pem')
+ *           .toFilePath();
+ *       var key =
+ *           Platform.script.resolve('certificates/server_key.pem')
+ *           .toFilePath();
+ *       context.useCertificateChain(chain);
+ *       context.usePrivateKey(key, password: 'dartdart');
  *
  *       HttpServer
  *           .bindSecure(InternetAddress.ANY_IP_V6,
  *                       443,
- *                       certificateName: 'localhost_cert')
+ *                       context)
  *           .then((server) {
  *             server.listen((HttpRequest request) {
  *               request.response.write('Hello, world!');
@@ -118,10 +123,8 @@
  *           });
  *     }
  *
- * The certificate database is managed using the Mozilla certutil tool (see
- * [NSS Tools certutil](https://developer.mozilla.org/en-US/docs/NSS/tools/NSS_Tools_certutil)).
- * Dart uses the NSS library to handle SSL, and the Mozilla certutil
- * must be used to manipulate the certificate database.
+ *  The certificates and keys are PEM files, which can be created and
+ *  managed with the tools in OpenSSL.
  *
  * ## Connect to a server socket
  *
@@ -234,13 +237,12 @@
    * value of [:0:] (the default) a reasonable value will be chosen by
    * the system.
    *
-   * The optional argument [shared] specify whether additional binds
-   * to the same `address`, `port` and `v6Only` combination is
-   * possible from the same Dart process. If `shared` is `true` and
-   * additional binds are performed, then the incoming connections
-   * will be distributed between that set of `HttpServer`s. One way of
-   * using this is to have number of isolates between which incoming
-   * connections are distributed.
+   * The optional argument [shared] specifies whether additional HttpServer
+   * objects can bind to the same combination of `address`, `port` and `v6Only`.
+   * If `shared` is `true` and more `HttpServer`s from this isolate or other
+   * isolates are bound to the port, then the incoming connections will be
+   * distributed among all the bound `HttpServer`s. Connections can be
+   * distributed over multiple isolates this way.
    */
   static Future<HttpServer> bind(address,
                                  int port,
@@ -275,32 +277,32 @@
    * value of [:0:] (the default) a reasonable value will be chosen by
    * the system.
    *
-   * The certificate with nickname or distinguished name (DN) [certificateName]
-   * is looked up in the certificate database, and is used as the server
-   * certificate. If [requestClientCertificate] is true, the server will
+   * If [requestClientCertificate] is true, the server will
    * request clients to authenticate with a client certificate.
+   * The server will advertise the names of trusted issuers of client
+   * certificates, getting them from [context], where they have been
+   * set using [SecurityContext.setClientAuthorities].
    *
-   * The optional argument [shared] specify whether additional binds
-   * to the same `address`, `port` and `v6Only` combination is
-   * possible from the same Dart process. If `shared` is `true` and
-   * additional binds are performed, then the incoming connections
-   * will be distributed between that set of `HttpServer`s. One way of
-   * using this is to have number of isolates between which incoming
-   * connections are distributed.
+   * The optional argument [shared] specifies whether additional HttpServer
+   * objects can bind to the same combination of `address`, `port` and `v6Only`.
+   * If `shared` is `true` and more `HttpServer`s from this isolate or other
+   * isolates are bound to the port, then the incoming connections will be
+   * distributed among all the bound `HttpServer`s. Connections can be
+   * distributed over multiple isolates this way.
    */
 
   static Future<HttpServer> bindSecure(address,
                                        int port,
+                                       SecurityContext context,
                                        {int backlog: 0,
                                         bool v6Only: false,
-                                        String certificateName,
                                         bool requestClientCertificate: false,
                                         bool shared: false})
       => _HttpServer.bindSecure(address,
                                 port,
+                                context,
                                 backlog,
                                 v6Only,
-                                certificateName,
                                 requestClientCertificate,
                                 shared);
 
@@ -958,7 +960,7 @@
    * The URI for the request.
    *
    * This provides access to the
-   * path, query string, and fragment identifier for the request.
+   * path and query string for the request.
    */
   Uri get uri;
 
@@ -1239,6 +1241,19 @@
  * The future for [HttpClientRequest] is created by methods such as
  * [getUrl] and [open].
  *
+ * ## HTTPS connections
+ *
+ * An HttpClient can make HTTPS requests, connecting to a server using
+ * the TLS (SSL) secure networking protocol. Calling [getUrl] with an
+ * https: scheme will work automatically, if the server's certificate is
+ * signed by a root CA (certificate authority) on the default list of
+ * well-known trusted CAs, compiled by Mozilla.
+ *
+ * To add a custom trusted certificate authority, or to send a client
+ * certificate to servers that request one, pass a [SecurityContext] object
+ * as the optional [context] argument to the `HttpClient` constructor.
+ * The desired security options can be set on the [SecurityContext] object.
+ *
  * ## Headers
  *
  * All HttpClient requests set the following header by default:
@@ -1331,14 +1346,15 @@
    */
   String userAgent;
 
-  factory HttpClient() => new _HttpClient();
+  factory HttpClient({SecurityContext context}) => new _HttpClient(context);
 
   /**
    * Opens a HTTP connection.
    *
    * The HTTP method to use is specified in [method], the server is
    * specified using [host] and [port], and the path (including
-   * possible fragment and query) is specified using [path].
+   * a possible query) is specified using [path].
+   * The path may also contain a URI fragment, which will be ignored.
    *
    * The `Host` header for the request will be set to the value
    * [host]:[port]. This can be overridden through the
@@ -1377,7 +1393,7 @@
    * Opens a HTTP connection using the GET method.
    *
    * The server is specified using [host] and [port], and the path
-   * (including possible fragment and query) is specified using
+   * (including a possible query) is specified using
    * [path].
    *
    * See [open] for details.
@@ -1397,7 +1413,7 @@
    * Opens a HTTP connection using the POST method.
    *
    * The server is specified using [host] and [port], and the path
-   * (including possible fragment and query) is specified using
+   * (including a possible query) is specified using
    * [path].
    *
    * See [open] for details.
@@ -1417,8 +1433,7 @@
    * Opens a HTTP connection using the PUT method.
    *
    * The server is specified using [host] and [port], and the path
-   * (including possible fragment and query) is specified using
-   * [path].
+   * (including a possible query) is specified using [path].
    *
    * See [open] for details.
    */
@@ -1437,8 +1452,7 @@
    * Opens a HTTP connection using the DELETE method.
    *
    * The server is specified using [host] and [port], and the path
-   * (including possible fragment and query) is specified using
-   * [path].
+   * (including s possible query) is specified using [path].
    *
    * See [open] for details.
    */
@@ -1457,8 +1471,7 @@
    * Opens a HTTP connection using the PATCH method.
    *
    * The server is specified using [host] and [port], and the path
-   * (including possible fragment and query) is specified using
-   * [path].
+   * (including a possible query) is specified using [path].
    *
    * See [open] for details.
    */
@@ -1477,8 +1490,7 @@
    * Opens a HTTP connection using the HEAD method.
    *
    * The server is specified using [host] and [port], and the path
-   * (including possible fragment and query) is specified using
-   * [path].
+   * (including a possible query) is specified using [path].
    *
    * See [open] for details.
    */
diff --git a/sdk/lib/io/http_impl.dart b/sdk/lib/io/http_impl.dart
index f06179b..d002f30 100644
--- a/sdk/lib/io/http_impl.dart
+++ b/sdk/lib/io/http_impl.dart
@@ -431,15 +431,15 @@
                        String protocolVersion,
                        _HttpOutgoing outgoing,
                        {_HttpHeaders initialHeaders})
-      : super(outgoing, null),
-        _uri = uri,
+      : _uri = uri,
         headers = new _HttpHeaders(
             protocolVersion,
             defaultPortForScheme: uri.scheme == 'https' ?
                 HttpClient.DEFAULT_HTTPS_PORT :
                 HttpClient.DEFAULT_HTTP_PORT,
             initialHeaders: initialHeaders),
-        _outgoing = outgoing {
+        _outgoing = outgoing,
+        super(outgoing, null) {
     _outgoing.outbound = this;
     _encodingMutable = false;
   }
@@ -718,8 +718,8 @@
 
   _HttpClientRequest(_HttpOutgoing outgoing, Uri uri, this.method, this._proxy,
                      this._httpClient, this._httpClientConnection)
-      : super(uri, "1.1", outgoing),
-        uri = uri {
+      : uri = uri,
+        super(uri, "1.1", outgoing) {
     // GET and HEAD have 'content-length: 0' by default.
     if (method == "GET" || method == "HEAD") {
       contentLength = 0;
@@ -791,13 +791,9 @@
     // Generate the request URI starting from the path component.
     String uriStartingFromPath() {
       String result = uri.path;
-      if (result.length == 0) result = "/";
-      if (uri.query != "") {
-        if (uri.fragment != "") {
-          result = "${result}?${uri.query}#${uri.fragment}";
-        } else {
-          result = "${result}?${uri.query}";
-        }
+      if (result.isEmpty) result = "/";
+      if (uri.hasQuery) {
+        result = "${result}?${uri.query}";
       }
       return result;
     }
@@ -814,7 +810,7 @@
         if (_httpClientConnection._proxyTunnel) {
           return uriStartingFromPath();
         } else {
-          return uri.toString();
+          return uri.removeFragment().toString();
         }
       }
     }
@@ -1260,6 +1256,7 @@
   final String key;
   final Socket _socket;
   final bool _proxyTunnel;
+  final SecurityContext _context;
   final _HttpParser _httpParser;
   StreamSubscription _subscription;
   final _HttpClient _httpClient;
@@ -1272,7 +1269,7 @@
   Future _streamFuture;
 
   _HttpClientConnection(this.key, this._socket, this._httpClient,
-                        [this._proxyTunnel = false])
+                        [this._proxyTunnel = false, this._context])
       : _httpParser = new _HttpParser.responseParser() {
     _httpParser.listenToStream(_socket);
 
@@ -1500,7 +1497,10 @@
           }
           var socket = response._httpRequest._httpClientConnection._socket;
           return SecureSocket.secure(
-              socket, host: host, onBadCertificate: callback);
+              socket,
+              host: host,
+              context: _context,
+              onBadCertificate: callback);
         })
         .then((secureSocket) {
           String key = _HttpClientConnection.makeKey(true, host, port);
@@ -1547,12 +1547,17 @@
   final String host;
   final int port;
   final bool isSecure;
+  final SecurityContext context;
   final Set<_HttpClientConnection> _idle = new HashSet();
   final Set<_HttpClientConnection> _active = new HashSet();
   final Queue _pending = new ListQueue();
   int _connecting = 0;
 
-  _ConnectionTarget(this.key, this.host, this.port, this.isSecure);
+  _ConnectionTarget(this.key,
+                    this.host,
+                    this.port,
+                    this.isSecure,
+                    this.context);
 
   bool get isEmpty => _idle.isEmpty && _active.isEmpty && _connecting == 0;
 
@@ -1624,20 +1629,21 @@
       return completer.future;
     }
     var currentBadCertificateCallback = client._badCertificateCallback;
-    bool callback(X509Certificate certificate) =>
+    callback(X509Certificate certificate) =>
         currentBadCertificateCallback == null ? false :
         currentBadCertificateCallback(certificate, uriHost, uriPort);
     Future socketFuture = (isSecure && proxy.isDirect
         ? SecureSocket.connect(host,
                                port,
-                               sendClientCertificate: true,
+                               context: context,
                                onBadCertificate: callback)
         : Socket.connect(host, port));
     _connecting++;
     return socketFuture.then((socket) {
         _connecting--;
         socket.setOption(SocketOption.TCP_NODELAY, true);
-        var connection = new _HttpClientConnection(key, socket, client);
+        var connection =
+            new _HttpClientConnection(key, socket, client, false, context);
         if (isSecure && !proxy.isDirect) {
           connection._dispose = true;
           return connection.createProxyTunnel(uriHost, uriPort, proxy, callback)
@@ -1666,6 +1672,7 @@
       = new HashMap<String, _ConnectionTarget>();
   final List<_Credentials> _credentials = [];
   final List<_ProxyCredentials> _proxyCredentials = [];
+  final SecurityContext _context;
   Function _authenticate;
   Function _authenticateProxy;
   Function _findProxy = HttpClient.findProxyFromEnvironment;
@@ -1680,6 +1687,8 @@
 
   String userAgent = _getHttpVersion();
 
+  _HttpClient(SecurityContext this._context);
+
   void set idleTimeout(Duration timeout) {
     _idleTimeout = timeout;
     for (var c in _connectionTargets.values) {
@@ -1702,9 +1711,26 @@
                                  String host,
                                  int port,
                                  String path) {
-    Uri uri = new Uri(scheme: "http", host: host, port: port).resolve(path);
-    // TODO(sgjesse): The path set here can contain both query and
-    // fragment. They should be cracked and set correctly.
+    const int hashMark = 0x23;
+    const int questionMark = 0x3f;
+    int fragmentStart = path.length;
+    int queryStart = path.length;
+    for (int i = path.length - 1; i >= 0; i--) {
+      var char = path.codeUnitAt(i);
+      if (char == hashMark) {
+        fragmentStart = i;
+        queryStart = i;
+      } else if (char == questionMark) {
+        queryStart = i;
+      }
+    }
+    String query = null;
+    if (queryStart < fragmentStart) {
+      query = path.substring(queryStart + 1, fragmentStart);
+      path = path.substring(0, queryStart);
+    }
+    Uri uri = new Uri(scheme: "http", host: host, port: port,
+                      path: path, query: query);
     return _openUrl(method, uri);
   }
 
@@ -1772,6 +1798,9 @@
   set findProxy(String f(Uri uri)) => _findProxy = f;
 
   Future<HttpClientRequest> _openUrl(String method, Uri uri) {
+    // Ignore any fragments on the request URI.
+    uri = uri.removeFragment();
+
     if (method == null) {
       throw new ArgumentError(method);
     }
@@ -1878,8 +1907,9 @@
 
   _ConnectionTarget _getConnectionTarget(String host, int port, bool isSecure) {
     String key = _HttpClientConnection.makeKey(isSecure, host, port);
-    return _connectionTargets.putIfAbsent(
-        key, () => new _ConnectionTarget(key, host, port, isSecure));
+    return _connectionTargets.putIfAbsent(key, () {
+      return new _ConnectionTarget(key, host, port, isSecure, _context);
+    });
   }
 
   // Get a new _HttpClientConnection, from the matching _ConnectionTarget.
@@ -2191,15 +2221,15 @@
 
   static Future<HttpServer> bindSecure(address,
                                        int port,
+                                       SecurityContext context,
                                        int backlog,
                                        bool v6Only,
-                                       String certificate_name,
                                        bool requestClientCertificate,
                                        bool shared) {
     return SecureServerSocket.bind(
         address,
         port,
-        certificate_name,
+        context,
         backlog: backlog,
         v6Only: v6Only,
         requestClientCertificate: requestClientCertificate,
diff --git a/sdk/lib/io/io.dart b/sdk/lib/io/io.dart
index c066b30..aea1b5b 100644
--- a/sdk/lib/io/io.dart
+++ b/sdk/lib/io/io.dart
@@ -206,6 +206,7 @@
                               LinkedListEntry,
                               UnmodifiableMapView;
 import 'dart:convert';
+import 'dart:developer';
 import 'dart:isolate';
 import 'dart:math';
 import 'dart:typed_data';
@@ -226,17 +227,19 @@
 part 'http_impl.dart';
 part 'http_parser.dart';
 part 'http_session.dart';
+part 'io_resource_info.dart';
 part 'io_sink.dart';
 part 'io_service.dart';
 part 'link.dart';
 part 'platform.dart';
 part 'platform_impl.dart';
 part 'process.dart';
+part 'secure_server_socket.dart';
+part 'secure_socket.dart';
+part 'security_context.dart';
 part 'service_object.dart';
 part 'socket.dart';
 part 'stdio.dart';
 part 'string_transformer.dart';
-part 'secure_socket.dart';
-part 'secure_server_socket.dart';
 part 'websocket.dart';
 part 'websocket_impl.dart';
diff --git a/sdk/lib/io/io_resource_info.dart b/sdk/lib/io/io_resource_info.dart
new file mode 100644
index 0000000..1a18fc9
--- /dev/null
+++ b/sdk/lib/io/io_resource_info.dart
@@ -0,0 +1,283 @@
+// 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.io;
+
+abstract class _IOResourceInfo {
+  final String type;
+  final int id;
+  String get name;
+  static int _count = 0;
+
+  static final Stopwatch _sw = new Stopwatch()..start();
+  static final _startTime = new DateTime.now().millisecondsSinceEpoch;
+
+  static double get timestamp => _startTime + _sw.elapsedMicroseconds/1000;
+
+  _IOResourceInfo(this.type) : id = _IOResourceInfo.getNextID();
+
+  /// Get the full set of values for a specific implementation. This is normally
+  /// looked up based on an id from a referenceValueMap.
+  Map<String, String> get fullValueMap;
+
+  /// The reference map, used to return a list of values, e.g., getting
+  /// all open sockets. The structure of this is shared among all subclasses.
+  Map<String, String> get referenceValueMap =>
+      {
+        // The type for a reference object is prefixed with @ in observatory.
+        'type': '@$type',
+        'id': id,
+        'name': name,
+      };
+
+  static int getNextID() => _count++;
+}
+
+abstract class _ReadWriteResourceInfo extends _IOResourceInfo {
+  int totalRead;
+  int totalWritten;
+  int readCount;
+  int writeCount;
+  double lastRead;
+  double lastWrite;
+
+  // Not all call sites use this. In some cases, e.g., a socket, a read does
+  // not always mean that we actually read some bytes (we may do a read to see
+  // if there are some bytes available).
+  void addRead(int bytes) {
+    totalRead += bytes;
+    readCount++;
+    lastRead = _IOResourceInfo.timestamp;
+  }
+
+  // In cases where we read but did not neccesarily get any bytes, use this to
+  // update the readCount and timestamp. Manually update totalRead if any bytes
+  // where acutally read.
+  void didRead() => addRead(0);
+
+  void addWrite(int bytes) {
+    totalWritten += bytes;
+    writeCount++;
+    lastWrite = _IOResourceInfo.timestamp;
+  }
+
+  _ReadWriteResourceInfo(String type) :
+    totalRead = 0,
+    totalWritten = 0,
+    readCount = 0,
+    writeCount = 0,
+    lastRead = 0.0,
+    lastWrite = 0.0,
+    super(type);
+
+  Map<String, String> get fullValueMap =>
+    {
+      'type': type,
+      'id': id,
+      'name': name,
+      'totalRead': totalRead,
+      'totalWritten': totalWritten,
+      'readCount': readCount,
+      'writeCount': writeCount,
+      'lastRead': lastRead,
+      'lastWrite': lastWrite
+    };
+}
+
+class _FileResourceInfo extends _ReadWriteResourceInfo {
+  static const String TYPE = '_file';
+
+  final file;
+
+  static Map<int, _FileResourceInfo> openFiles =
+      new Map<int, _FileResourceInfo>();
+
+  _FileResourceInfo(this.file) : super(TYPE) {
+    FileOpened(this);
+  }
+
+  static FileOpened(_FileResourceInfo info) {
+    assert(!openFiles.containsKey(info.id));
+    openFiles[info.id] = info;
+  }
+
+  static FileClosed(_FileResourceInfo info) {
+    assert(openFiles.containsKey(info.id));
+    openFiles.remove(info.id);
+  }
+
+  static Iterable<Map<String, String>> getOpenFilesList() {
+    return new List.from(openFiles.values.map((e) => e.referenceValueMap));
+  }
+
+  static Future<ServiceExtensionResponse> getOpenFiles(function, params) {
+    assert(function == '__getOpenFiles');
+    var data = {'type': '_openfiles', 'data': getOpenFilesList()};
+    var json = JSON.encode(data);
+    return new Future.value(new ServiceExtensionResponse.result(json));
+  }
+
+  Map<String, String> getFileInfoMap() {
+    var result = fullValueMap;
+    return result;
+  }
+
+  static Future<ServiceExtensionResponse> getFileInfoMapByID(function, params) {
+    assert(params.containsKey('id'));
+    var id = int.parse(params['id']);
+    var result =
+      openFiles.containsKey(id) ? openFiles[id].getFileInfoMap() : {};
+    var json = JSON.encode(result);
+    return new Future.value(new ServiceExtensionResponse.result(json));
+  }
+
+  String get name {
+    return '${file.path}';
+  }
+}
+
+class _ProcessResourceInfo extends _IOResourceInfo{
+  static const String TYPE = '_process';
+  final process;
+  final double startedAt;
+
+  static Map<int, _ProcessResourceInfo> startedProcesses =
+      new Map<int, _ProcessResourceInfo>();
+
+  _ProcessResourceInfo(this.process) :
+      startedAt = _IOResourceInfo.timestamp,
+      super(TYPE) {
+    ProcessStarted(this);
+  }
+
+  String get name => process._path;
+
+  void stopped() => ProcessStopped(this);
+
+  Map<String, String> get fullValueMap =>
+    {
+      'type': type,
+      'id': id,
+      'name': name,
+      'pid': process.pid,
+      'startedAt': startedAt,
+      'arguments': process._arguments,
+      'workingDirectory':
+          process._workingDirectory == null ? '.' : process._workingDirectory,
+    };
+
+  static ProcessStarted(_ProcessResourceInfo info) {
+    assert(!startedProcesses.containsKey(info.id));
+    startedProcesses[info.id] = info;
+  }
+
+  static ProcessStopped(_ProcessResourceInfo info) {
+    assert(startedProcesses.containsKey(info.id));
+    startedProcesses.remove(info.id);
+  }
+
+  static Iterable<Map<String, String>> getStartedProcessesList() =>
+      new List.from(startedProcesses.values.map((e) => e.referenceValueMap));
+
+  static Future<ServiceExtensionResponse> getStartedProcesses(
+      String function, Map<String, String> params) {
+    assert(function == '__getProcesses');
+    var data = {'type': '_startedprocesses', 'data': getStartedProcessesList()};
+    var json = JSON.encode(data);
+    return new Future.value(new ServiceExtensionResponse.result(json));
+  }
+
+  static Future<ServiceExtensionResponse> getProcessInfoMapById(
+      String function, Map<String, String> params) {
+    var id = int.parse(params['id']);
+    var result = startedProcesses.containsKey(id)
+        ? startedProcesses[id].fullValueMap
+        : {};
+    var json = JSON.encode(result);
+    return new Future.value(new ServiceExtensionResponse.result(json));
+  }
+}
+
+class _SocketResourceInfo extends _ReadWriteResourceInfo {
+  static const String TCP_STRING = 'TCP';
+  static const String UDP_STRING = 'UDP';
+  static const String TYPE = '_socket';
+
+  final socket;
+
+  static Map<int, _SocketResourceInfo> openSockets =
+      new Map<int, _SocketResourceInfo>();
+
+  _SocketResourceInfo(this.socket) : super(TYPE) {
+    SocketOpened(this);
+  }
+
+  String get name {
+    if (socket.isListening) {
+      return 'listening:${socket.address.host}:${socket.port}';
+    }
+    var remote = '';
+    try {
+      var remoteHost = socket.remoteAddress.host;
+      var remotePort = socket.remotePort;
+      remote = ' -> $remoteHost:$remotePort';
+    } catch (e) { } // ignored if we can't get the information
+    return '${socket.address.host}:${socket.port}$remote';
+  }
+
+  static Iterable<Map<String, String>> getOpenSocketsList() {
+    return new List.from(openSockets.values.map((e) => e.referenceValueMap));
+  }
+
+  Map<String, String> getSocketInfoMap() {
+    var result = fullValueMap;
+    result['socketType'] = socket.isTcp ? TCP_STRING : UDP_STRING;
+    result['listening'] = socket.isListening;
+    result['host'] = socket.address.host;
+    result['port'] = socket.port;
+    if (!socket.isListening) {
+      try {
+        result['remoteHost'] = socket.remoteAddress.host;
+        result['remotePort'] = socket.remotePort;
+      } catch (e) {
+        // UDP.
+        result['remotePort'] = 'NA';
+        result['remoteHost'] = 'NA';
+      }
+    } else {
+      result['remotePort'] = 'NA';
+      result['remoteHost'] = 'NA';
+    }
+    result['addressType'] = socket.address.type.name;
+    return result;
+  }
+
+  static Future<ServiceExtensionResponse> getSocketInfoMapByID(
+      String function, Map<String, String> params) {
+    assert(params.containsKey('id'));
+    var id = int.parse(params['id']);
+    var result =
+      openSockets.containsKey(id) ? openSockets[id].getSocketInfoMap() : {};
+    var json = JSON.encode(result);
+    return new Future.value(new ServiceExtensionResponse.result(json));
+  }
+
+  static Future<ServiceExtensionResponse> getOpenSockets(function, params) {
+    assert(function == '__getOpenSockets');
+    var data = {'type': '_opensockets', 'data': getOpenSocketsList()};
+    var json = JSON.encode(data);
+    return new Future.value(new ServiceExtensionResponse.result(json));
+  }
+
+  static SocketOpened(_SocketResourceInfo info) {
+    assert(!openSockets.containsKey(info.id));
+    openSockets[info.id] = info;
+  }
+
+  static SocketClosed(_SocketResourceInfo info) {
+    assert(openSockets.containsKey(info.id));
+    openSockets.remove(info.id);
+  }
+
+}
diff --git a/sdk/lib/io/io_sink.dart b/sdk/lib/io/io_sink.dart
index 89cd586..2d6719d 100644
--- a/sdk/lib/io/io_sink.dart
+++ b/sdk/lib/io/io_sink.dart
@@ -97,6 +97,9 @@
 
   /**
    * Adds all elements of the given [stream] to `this`.
+   *
+   * Returns a [Future] that completes when
+   * all elements of the given [stream] are added to `this`.
    */
   Future addStream(Stream<List<int>> stream);
 
diff --git a/sdk/lib/io/iolib_sources.gypi b/sdk/lib/io/iolib_sources.gypi
index 96900f7..ad2110f 100644
--- a/sdk/lib/io/iolib_sources.gypi
+++ b/sdk/lib/io/iolib_sources.gypi
@@ -20,6 +20,7 @@
     'http_impl.dart',
     'http_parser.dart',
     'http_session.dart',
+    'io_resource_info.dart',
     'io_sink.dart',
     'io_service.dart',
     'link.dart',
@@ -27,11 +28,12 @@
     'platform_impl.dart',
     'process.dart',
     'service_object.dart',
+    'secure_server_socket.dart',
+    'secure_socket.dart',
+    'security_context.dart',
     'socket.dart',
     'stdio.dart',
     'string_transformer.dart',
-    'secure_socket.dart',
-    'secure_server_socket.dart',
     'websocket.dart',
     'websocket_impl.dart',
   ],
diff --git a/sdk/lib/io/secure_server_socket.dart b/sdk/lib/io/secure_server_socket.dart
index c3ce9cf..2fbc5b1 100644
--- a/sdk/lib/io/secure_server_socket.dart
+++ b/sdk/lib/io/secure_server_socket.dart
@@ -41,36 +41,30 @@
    * the system.
    *
    * Incoming client connections are promoted to secure connections, using
-   * the server certificate given by [certificateName].
+   * the server certificate and key set in [context].
    *
    * [address] must be given as a numeric address, not a host name.
    *
-   * [certificateName] is the nickname or the distinguished name (DN) of
-   * the certificate in the certificate database. It is looked up in the
-   * NSS certificate database set by SecureSocket.initialize.
-   * If [certificateName] contains "CN=", it is assumed to be a distinguished
-   * name.  Otherwise, it is looked up as a nickname.
-   *
    * To request or require that clients authenticate by providing an SSL (TLS)
    * client certificate, set the optional parameter [requestClientCertificate]
    * or [requireClientCertificate] to true.  Requiring a certificate implies
-   * requesting a certificate, so one doesn't need to set both to true.
+   * requesting a certificate, so setting both is redundant.
    * To check whether a client certificate was received, check
    * SecureSocket.peerCertificate after connecting.  If no certificate
    * was received, the result will be null.
    *
-   * The optional argument [shared] specify whether additional binds
-   * to the same `address`, `port` and `v6Only` combination is
-   * possible from the same Dart process. If `shared` is `true` and
-   * additional binds are performed, then the incoming connections
-   * will be distributed between that set of
-   * `SecureServerSocket`s. One way of using this is to have number of
-   * isolates between which incoming connections are distributed.
+   * The optional argument [shared] specifies whether additional
+   * SecureServerSocket objects can bind to the same combination of `address`,
+   * `port` and `v6Only`.  If `shared` is `true` and more `SecureServerSocket`s
+   * from this isolate or other isolates are bound to the port, then the
+   * incoming connections will be distributed among all the bound
+   * `SecureServerSocket`s. Connections can be distributed over multiple
+   * isolates this way.
    */
   static Future<SecureServerSocket> bind(
       address,
       int port,
-      String certificateName,
+      SecurityContext context,
       {int backlog: 0,
        bool v6Only: false,
        bool requestClientCertificate: false,
@@ -80,7 +74,7 @@
     return RawSecureServerSocket.bind(
         address,
         port,
-        certificateName,
+        context,
         backlog: backlog,
         v6Only: v6Only,
         requestClientCertificate: requestClientCertificate,
@@ -128,21 +122,20 @@
  * See [RawSecureSocket] for more info.
  */
 class RawSecureServerSocket extends Stream<RawSecureSocket> {
-  RawServerSocket _socket;
+  final RawServerSocket _socket;
   StreamController<RawSecureSocket> _controller;
   StreamSubscription<RawSocket> _subscription;
-  final String certificateName;
+  final SecurityContext _context;
   final bool requestClientCertificate;
   final bool requireClientCertificate;
   final List<String> supportedProtocols;
   bool _closed = false;
 
-  RawSecureServerSocket._(RawServerSocket serverSocket,
-                          this.certificateName,
+  RawSecureServerSocket._(this._socket,
+                          this._context,
                           this.requestClientCertificate,
                           this.requireClientCertificate,
                           this.supportedProtocols) {
-    _socket = serverSocket;
     _controller = new StreamController<RawSecureSocket>(
         sync: true,
         onListen: _onSubscriptionStateChange,
@@ -177,16 +170,10 @@
    * the system.
    *
    * Incoming client connections are promoted to secure connections,
-   * using the server certificate given by [certificateName].
+   * using the server certificate and key set in [context].
    *
    * [address] must be given as a numeric address, not a host name.
    *
-   * [certificateName] is the nickname or the distinguished name (DN) of
-   * the certificate in the certificate database. It is looked up in the
-   * NSS certificate database set by SecureSocket.setCertificateDatabase.
-   * If [certificateName] contains "CN=", it is assumed to be a distinguished
-   * name.  Otherwise, it is looked up as a nickname.
-   *
    * To request or require that clients authenticate by providing an SSL (TLS)
    * client certificate, set the optional parameters requestClientCertificate or
    * requireClientCertificate to true.  Require implies request, so one doesn't
@@ -194,18 +181,18 @@
    * check SecureSocket.peerCertificate after connecting.  If no certificate
    * was received, the result will be null.
    *
-   * The optional argument [shared] specify whether additional binds
-   * to the same `address`, `port` and `v6Only` combination is
-   * possible from the same Dart process. If `shared` is `true` and
-   * additional binds are performed, then the incoming connections
-   * will be distributed between that set of
-   * `RawSecureServerSocket`s. One way of using this is to have number
-   * of isolates between which incoming connections are distributed.
+   * The optional argument [shared] specifies whether additional
+   * RawSecureServerSocket objects can bind to the same combination of
+   * `address`, `port` and `v6Only`.  If `shared` is `true` and more
+   * `RawSecureServerSocket`s from this isolate or other isolates are bound to
+   * the port, then the incoming connections will be distributed among all the
+   * bound `RawSecureServerSocket`s. Connections can be distributed over
+   * multiple isolates this way.
    */
   static Future<RawSecureServerSocket> bind(
       address,
       int port,
-      String certificateName,
+      SecurityContext context,
       {int backlog: 0,
        bool v6Only: false,
        bool requestClientCertificate: false,
@@ -216,7 +203,7 @@
         address, port, backlog: backlog, v6Only: v6Only, shared: shared)
         .then((serverSocket) => new RawSecureServerSocket._(
             serverSocket,
-            certificateName,
+            context,
             requestClientCertificate,
             requireClientCertificate,
             supportedProtocols));
@@ -263,7 +250,7 @@
     _RawSecureSocket.connect(
         connection.address,
         remotePort,
-        certificateName,
+        context: _context,
         is_server: true,
         socket: connection,
         requestClientCertificate: requestClientCertificate,
diff --git a/sdk/lib/io/secure_socket.dart b/sdk/lib/io/secure_socket.dart
index 6b36eba..cf8dec0 100644
--- a/sdk/lib/io/secure_socket.dart
+++ b/sdk/lib/io/secure_socket.dart
@@ -14,19 +14,14 @@
   external factory SecureSocket._(RawSecureSocket rawSocket);
 
   /**
-   * Constructs a new secure client socket and connect it to the given
+   * Constructs a new secure client socket and connects it to the given
    * [host] on port [port]. The returned Future will complete with a
    * [SecureSocket] that is connected and ready for subscription.
    *
-   * If [sendClientCertificate] is set to true, the socket will send a client
-   * certificate if one is requested by the server.
-   *
-   * If [certificateName] is the nickname of a certificate in the certificate
-   * database, that certificate will be sent.
-   *
-   * If [certificateName] is null, which is the usual use case, an
-   * appropriate certificate will be searched for in the database and
-   * sent automatically, based on what the server says it will accept.
+   * The certificate provided by the server is checked
+   * using the trusted certificates set in the SecurityContext object.
+   * The default SecurityContext object contains a built-in set of trusted
+   * root certificates for well-known certificate authorities.
    *
    * [onBadCertificate] is an optional handler for unverifiable certificates.
    * The handler receives the [X509Certificate], and can inspect it and
@@ -37,14 +32,12 @@
   static Future<SecureSocket> connect(
       host,
       int port,
-      {bool sendClientCertificate: false,
-       String certificateName,
+      {SecurityContext context,
        bool onBadCertificate(X509Certificate certificate),
        List<String> supportedProtocols}) {
     return RawSecureSocket.connect(host,
                                    port,
-                                   sendClientCertificate: sendClientCertificate,
-                                   certificateName: certificateName,
+                                   context: context,
                                    onBadCertificate: onBadCertificate,
                                    supportedProtocols: supportedProtocols)
         .then((rawSocket) => new SecureSocket._(rawSocket));
@@ -79,8 +72,7 @@
   static Future<SecureSocket> secure(
       Socket socket,
       {host,
-       bool sendClientCertificate: false,
-       String certificateName,
+       SecurityContext context,
        bool onBadCertificate(X509Certificate certificate)}) {
     var completer = new Completer();
     (socket as dynamic)._detachRaw()
@@ -89,7 +81,7 @@
             detachedRaw[0],
             subscription: detachedRaw[1],
             host: host,
-            sendClientCertificate: sendClientCertificate,
+            context: context,
             onBadCertificate: onBadCertificate);
           })
         .then((raw) {
@@ -121,7 +113,7 @@
    */
   static Future<SecureSocket> secureServer(
       Socket socket,
-      String certificateName,
+      SecurityContext context,
       {List<int> bufferedData,
        bool requestClientCertificate: false,
        bool requireClientCertificate: false,
@@ -131,7 +123,7 @@
         .then((detachedRaw) {
           return RawSecureSocket.secureServer(
             detachedRaw[0],
-            certificateName,
+            context,
             subscription: detachedRaw[1],
             bufferedData: bufferedData,
             requestClientCertificate: requestClientCertificate,
@@ -168,52 +160,6 @@
   void renegotiate({bool useSessionCache: true,
                     bool requestClientCertificate: false,
                     bool requireClientCertificate: false});
-
-  /**
-   * Initializes the NSS library. If [initialize] is not called, the library
-   * is automatically initialized as if [initialize] were called with no
-   * arguments. If [initialize] is called more than once, or called after
-   * automatic initialization has happened (when a secure connection is made),
-   * then a TlsException is thrown.
-   *
-   * The optional argument [database] is the path to a certificate database
-   * directory containing root certificates for verifying certificate paths on
-   * client connections, and server certificates to provide on server
-   * connections. The argument [password] should be used when creating
-   * secure server sockets, to allow the private key of the server
-   * certificate to be fetched. If [useBuiltinRoots] is true (the default),
-   * then a built-in set of root certificates for trusted certificate
-   * authorities is merged with the certificates in the database.
-   * The list of built-in root certificates, and documentation about this
-   * default database, is available at
-   * http://www.mozilla.org/projects/security/certs/included/ .
-   *
-   * If the [database] argument is omitted, then only the
-   * builtin root certificates are used. If [useBuiltinRoots] is also false,
-   * then no certificates are available.
-   *
-   * Examples:
-   *   1) Use only the builtin root certificates:
-   *     SecureSocket.initialize(); or
-   *
-   *   2) Use a specified database directory and the builtin roots:
-   *     SecureSocket.initialize(database: 'path/to/my/database',
-   *                             password: 'my_password');
-   *
-   *   3) Use a specified database directory, without builtin roots:
-   *     SecureSocket.initialize(database: 'path/to/my/database',
-   *                             password: 'my_password'.
-   *                             useBuiltinRoots: false);
-   *
-   * The database should be an NSS certificate database directory
-   * containing a cert9.db file, not a cert8.db file.  This version of
-   * the database can be created using the NSS certutil tool with "sql:" in
-   * front of the absolute path of the database directory, or setting the
-   * environment variable [[NSS_DEFAULT_DB_TYPE]] to "sql".
-   */
-  external static void initialize({String database,
-                                   String password,
-                                   bool useBuiltinRoots: true});
 }
 
 
@@ -221,27 +167,24 @@
  * RawSecureSocket provides a secure (SSL or TLS) network connection.
  * Client connections to a server are provided by calling
  * RawSecureSocket.connect.  A secure server, created with
- * RawSecureServerSocket, also returns RawSecureSocket objects representing
+ * [RawSecureServerSocket], also returns RawSecureSocket objects representing
  * the server end of a secure connection.
  * The certificate provided by the server is checked
- * using the certificate database provided in SecureSocket.initialize, and/or
- * the default built-in root certificates.
+ * using the trusted certificates set in the SecurityContext object.
+ * The default [SecurityContext] object contains a built-in set of trusted
+ * root certificates for well-known certificate authorities.
  */
 abstract class RawSecureSocket implements RawSocket {
   /**
    * Constructs a new secure client socket and connect it to the given
-   * host on the given port. The returned Future is completed with the
+   * host on the given port. The returned [Future] is completed with the
    * RawSecureSocket when it is connected and ready for subscription.
    *
-   * The certificate provided by the server is checked using the certificate
-   * database provided in [SecureSocket.initialize], and/or the default built-in
-   * root certificates. If [sendClientCertificate] is
-   * set to true, the socket will send a client certificate if one is
-   * requested by the server. If [certificateName] is the nickname of
-   * a certificate in the certificate database, that certificate will be sent.
-   * If [certificateName] is null, which is the usual use case, an
-   * appropriate certificate will be searched for in the database and
-   * sent automatically, based on what the server says it will accept.
+   * The certificate provided by the server is checked using the trusted
+   * certificates set in the SecurityContext object If a certificate and key are
+   * set on the client, using [SecurityContext.useCertificateChain] and
+   * [SecurityContext.usePrivateKey], and the server asks for a client
+   * certificate, then that client certificate is sent to the server.
    *
    * [onBadCertificate] is an optional handler for unverifiable certificates.
    * The handler receives the [X509Certificate], and can inspect it and
@@ -252,24 +195,20 @@
   static Future<RawSecureSocket> connect(
       host,
       int port,
-      {bool sendClientCertificate: false,
-       String certificateName,
+      {SecurityContext context,
        bool onBadCertificate(X509Certificate certificate),
        List<String> supportedProtocols}) {
     _RawSecureSocket._verifyFields(
         host,
         port,
-        certificateName,
         false,
         false,
         false,
-        sendClientCertificate,
         onBadCertificate);
     return RawSocket.connect(host, port)
         .then((socket) {
           return secure(socket,
-                        sendClientCertificate: sendClientCertificate,
-                        certificateName: certificateName,
+                        context: context,
                         onBadCertificate: onBadCertificate,
                         supportedProtocols: supportedProtocols);
         });
@@ -307,8 +246,7 @@
       RawSocket socket,
       {StreamSubscription subscription,
        host,
-       bool sendClientCertificate: false,
-       String certificateName,
+       SecurityContext context,
        bool onBadCertificate(X509Certificate certificate),
        List<String> supportedProtocols}) {
     socket.readEventsEnabled = false;
@@ -316,11 +254,10 @@
     return  _RawSecureSocket.connect(
         host != null ? host : socket.address.host,
         socket.port,
-        certificateName,
         is_server: false,
         socket: socket,
         subscription: subscription,
-        sendClientCertificate: sendClientCertificate,
+        context: context,
         onBadCertificate: onBadCertificate,
         supportedProtocols: supportedProtocols);
   }
@@ -350,7 +287,7 @@
    */
   static Future<RawSecureSocket> secureServer(
       RawSocket socket,
-      String certificateName,
+      SecurityContext context,
       {StreamSubscription subscription,
        List<int> bufferedData,
        bool requestClientCertificate: false,
@@ -361,7 +298,7 @@
     return _RawSecureSocket.connect(
         socket.address,
         socket.remotePort,
-        certificateName,
+        context: context,
         is_server: true,
         socket: socket,
         subscription: subscription,
@@ -402,15 +339,13 @@
  * X509Certificate represents an SSL certificate, with accessors to
  * get the fields of the certificate.
  */
-class X509Certificate {
-  X509Certificate(this.subject,
-                  this.issuer,
-                  this.startValidity,
-                  this.endValidity);
-  final String subject;
-  final String issuer;
-  final DateTime startValidity;
-  final DateTime endValidity;
+abstract class X509Certificate {
+  external factory X509Certificate._();
+
+  String get subject;
+  String get issuer;
+  DateTime get startValidity;
+  DateTime get endValidity;
 }
 
 
@@ -456,10 +391,9 @@
   int _bufferedDataIndex = 0;
   final InternetAddress address;
   final bool is_server;
-  final String certificateName;
+  SecurityContext context;
   final bool requestClientCertificate;
   final bool requireClientCertificate;
-  final bool sendClientCertificate;
   final Function onBadCertificate;
 
   var _status = HANDSHAKE;
@@ -484,32 +418,30 @@
   static Future<_RawSecureSocket> connect(
       host,
       int requestedPort,
-      String certificateName,
       {bool is_server,
+       SecurityContext context,
        RawSocket socket,
        StreamSubscription subscription,
        List<int> bufferedData,
        bool requestClientCertificate: false,
        bool requireClientCertificate: false,
-       bool sendClientCertificate: false,
        bool onBadCertificate(X509Certificate certificate),
        List<String> supportedProtocols}) {
-    _verifyFields(host, requestedPort, certificateName, is_server,
+    _verifyFields(host, requestedPort, is_server,
                  requestClientCertificate, requireClientCertificate,
-                 sendClientCertificate, onBadCertificate);
+                 onBadCertificate);
     if (host is InternetAddress) host = host.host;
     var address = socket.address;
     if (host != null) address =  address._cloneWithNewHost(host);
     return new _RawSecureSocket(address,
                                 requestedPort,
-                                certificateName,
                                 is_server,
+                                context,
                                 socket,
                                 subscription,
                                 bufferedData,
                                 requestClientCertificate,
                                 requireClientCertificate,
-                                sendClientCertificate,
                                 onBadCertificate,
                                 supportedProtocols)
         ._handshakeComplete.future;
@@ -518,16 +450,18 @@
   _RawSecureSocket(
       this.address,
       int requestedPort,
-      this.certificateName,
       this.is_server,
+      this.context,
       RawSocket this._socket,
       this._socketSubscription,
       this._bufferedData,
       this.requestClientCertificate,
       this.requireClientCertificate,
-      this.sendClientCertificate,
       this.onBadCertificate(X509Certificate certificate),
       List<String> supportedProtocols) {
+    if (context == null) {
+      context = SecurityContext.defaultContext;
+    }
     _controller = new StreamController<RawSocketEvent>(
         sync: true,
         onListen: _onSubscriptionStateChange,
@@ -570,144 +504,21 @@
           ..onDone(_doneHandler);
     }
     try {
+      var encodedProtocols =
+          SecurityContext._protocolsToLengthEncoding(supportedProtocols);
       _secureFilter.connect(address.host,
-                            (address as dynamic)._in_addr,
-                            port,
+                            context,
                             is_server,
-                            certificateName,
                             requestClientCertificate ||
                                 requireClientCertificate,
                             requireClientCertificate,
-                            sendClientCertificate,
-                            _protocolsToLengthEncoding(supportedProtocols));
+                            encodedProtocols);
       _secureHandshake();
     } catch (e, s) {
       _reportError(e, s);
     }
   }
 
-  /// Encodes a set of supported protocols for ALPN/NPN usage.
-  ///
-  /// The `protocols` list is expected to contain protocols in descending order
-  /// of preference.
-  ///
-  /// See RFC 7301 (https://tools.ietf.org/html/rfc7301) for the encoding of
-  /// `List<String> protocols`:
-  ///     opaque ProtocolName<1..2^8-1>;
-  ///
-  ///     struct {
-  ///         ProtocolName protocol_name_list<2..2^16-1>
-  ///     } ProtocolNameList;
-  ///
-  /// The encoding of the opaque `ProtocolName<lower..upper>` vector is
-  /// described in RFC 2246: 4.3 Vectors.
-  ///
-  /// Note: Even though this encoding scheme would allow a total
-  /// `ProtocolNameList` length of 65535, this limit cannot be reached. Testing
-  /// showed that more than ~ 65480 bytes will fail to negogiate a protocol.
-  /// We will be conservative and support only messages up to (1<<15) -1 bytes.
-  ///
-  /// Our NSS implementation will support ALPN and NPN transparently. The
-  /// default protocol will be the first in the encoded Uint8List.
-  ///
-  /// NOTE: The NSS library will treat the first protocol as the fallback
-  /// protocol. The remaining ones are sorted in (decreasing) priority order.
-  /// We therefore put the protocol least desired to the front, to make it the
-  /// default.
-  Uint8List _protocolsToLengthEncoding(List<String> protocols) {
-    if (protocols == null || protocols.length == 0) {
-      return new Uint8List(0);
-    }
-    int protocolsLength = protocols.length;
-
-    // Calculate the number of bytes we will need if it is ASCII.
-    int expectedLength = protocolsLength;
-    for (int i = 0; i < protocolsLength; i++) {
-      int length = protocols[i].length;
-      if (length > 0 && length <= 255) {
-        expectedLength += length;
-      } else {
-        throw new ArgumentError(
-            'Length of protocol must be between 1 and 255 (was: $length).');
-      }
-    }
-
-    if (expectedLength >= (1 << 15)) {
-      throw new ArgumentError(
-          'The maximum message length supported is 2^15-1.');
-    }
-
-    // Try encoding the `List<String> protocols` array using fast ASCII path.
-    var bytes = new Uint8List(expectedLength);
-    int bytesOffset = 0;
-    for (int i = 0; i < protocolsLength; i++) {
-      // The last protocol will be encoded as the first/default one in the list.
-      // (i.e. rotate `protocols` by 1 to the right).
-      int index = i;
-      if (index == 0) index = protocols.length;
-      String proto = protocols[index - 1];
-
-      // Add length byte.
-      bytes[bytesOffset++] = proto.length;
-      int bits = 0;
-
-      // Add protocol bytes.
-      for (int j = 0; j < proto.length; j++) {
-        var char = proto.codeUnitAt(j);
-        bits |= char;
-        bytes[bytesOffset++] = char & 0xff;
-      }
-
-      // Go slow case if we have encountered anything non-ascii.
-      if (bits > 0x7f) {
-        return _protocolsToLengthEncodingNonAsciiBailout(protocols);
-      }
-    }
-    return bytes;
-  }
-
-  Uint8List _protocolsToLengthEncodingNonAsciiBailout(List<String> protocols) {
-    void addProtocol(List<int> outBytes, String protocol) {
-      var protocolBytes = UTF8.encode(protocol);
-      var len = protocolBytes.length;
-
-      if (len > 255) {
-        throw new ArgumentError(
-            'Length of protocol must be between 1 and 255 (was: $len)');
-      }
-      // Add length byte.
-      outBytes.add(len);
-
-      // Add protocol bytes.
-      outBytes.addAll(protocolBytes);
-    }
-
-    List<int> bytes = [];
-    addProtocol(bytes, protocols.last);
-    for (var i = 0; i < protocols.length -1; i++) {
-      addProtocol(bytes, protocols[i]);
-    }
-
-    if (bytes.length >= (1 << 15)) {
-      throw new ArgumentError(
-          'The maximum message length supported is 2^15-1.');
-    }
-
-    return new Uint8List.fromList(bytes);
-  }
-
-  void _addProtocolBytes(List<int> outBytes, String protocol) {
-    var protocolBytes = UTF8.encode(protocol);
-    var len = protocolBytes.length;
-
-    if (len > 255) {
-      throw new ArgumentError(
-          'Cannot support protocols with more than 255 characters');
-    }
-    outBytes.add(len);
-    outBytes.addAll(protocolBytes);
-  }
-
   StreamSubscription listen(void onData(RawSocketEvent data),
                             {Function onError,
                              void onDone(),
@@ -721,11 +532,9 @@
 
   static void _verifyFields(host,
                             int requestedPort,
-                            String certificateName,
                             bool is_server,
                             bool requestClientCertificate,
                             bool requireClientCertificate,
-                            bool sendClientCertificate,
                             Function onBadCertificate) {
     if (host is! String && host is! InternetAddress) {
       throw new ArgumentError("host is not a String or an InternetAddress");
@@ -736,21 +545,12 @@
     if (requestedPort < 0 || requestedPort > 65535) {
       throw new ArgumentError("requestedPort is not in the range 0..65535");
     }
-    if (certificateName != null && certificateName is! String) {
-      throw new ArgumentError("certificateName is not null or a String");
-    }
-    if (certificateName == null && is_server) {
-      throw new ArgumentError("certificateName is null on a server");
-    }
     if (requestClientCertificate is! bool) {
       throw new ArgumentError("requestClientCertificate is not a bool");
     }
     if (requireClientCertificate is! bool) {
       throw new ArgumentError("requireClientCertificate is not a bool");
     }
-    if (sendClientCertificate is! bool) {
-      throw new ArgumentError("sendClientCertificate is not a bool");
-    }
     if (onBadCertificate != null && onBadCertificate is! Function) {
       throw new ArgumentError("onBadCertificate is not null or a Function");
     }
@@ -891,7 +691,7 @@
     if (onBadCertificate == null) return false;
     var result = onBadCertificate(certificate);
     if (result is bool) return result;
-    throw new ArgumentError(
+    throw new HandshakeException(
         "onBadCertificate callback returned non-boolean $result");
   }
 
@@ -1360,13 +1160,10 @@
   external factory _SecureFilter();
 
   void connect(String hostName,
-               Uint8List addr,
-               int port,
+               SecurityContext context,
                bool is_server,
-               String certificateName,
                bool requestClientCertificate,
                bool requireClientCertificate,
-               bool sendClientCertificate,
                Uint8List protocols);
   void destroy();
   void handshake();
diff --git a/sdk/lib/io/security_context.dart b/sdk/lib/io/security_context.dart
new file mode 100644
index 0000000..48e8111
--- /dev/null
+++ b/sdk/lib/io/security_context.dart
@@ -0,0 +1,194 @@
+// 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.io;
+
+/**
+ * The object containing the certificates to trust when making
+ * a secure client connection, and the certificate chain and
+ * private key to serve from a secure server.
+ * 
+ * The [SecureSocket]  and [SecureServer] classes take a SecurityContext
+ * as an argument to their connect and bind methods.
+ *
+ * Certificates and keys can be added to a SecurityContext from PEM files
+ * on the disk.  A PEM file contains one or more base-64 encoded DER-serialized
+ * ASN1 objects, surrounded with delimiter strings like
+ * "-----BEGIN CERTIFICATE -----" and "-----END CERTIFICATE-----".
+ * Distinguished encoding rules (DER) is a canonical binary serialization
+ * of ASN1 objects into an octet string.
+ */
+abstract class SecurityContext {
+  external factory SecurityContext();
+
+  /**
+   * Secure networking classes with an optional `context` parameter
+   * use the [defaultContext] object if the parameter is omitted.
+   * This object can also be accessed, and modified, directly.
+   * Each isolate has a different [defaultContext] object.
+   * The [defaultContext] object uses a list of well-known trusted
+   * certificate authorities as its trusted roots.  This list is
+   * taken from Mozilla, who maintains it as part of Firefox.
+   */
+  external static SecurityContext get defaultContext;
+
+  /**
+   * Sets the private key for a server certificate or client certificate.
+   * A secure connection using this SecurityContext will use this key with
+   * the server or client certificate to sign and decrypt messages.
+   * [keyFile] is a PEM file containing an encrypted
+   * private key, encrypted with [password].  An unencrypted file can be
+   * used, but this is not usual.
+   */
+  void usePrivateKey(String keyFile, {String password});
+
+  /**
+   * Sets the set of trusted X509 certificates used by [SecureSocket]
+   * client connections, when connecting to a secure server.
+   *
+   * There are two ways to set a set of trusted certificates, with a single
+   * PEM file, or with a directory containing individual PEM files for
+   * certificates.
+   *
+   * [file] is an optional PEM file containing X509 certificates, usually
+   * root certificates from certificate authorities.
+   *
+   * [directory] is an optional directory containing PEM files.  The directory
+   * must also have filesystem links added, which link extra filenames based
+   * on the hash of a certificate's distinguished name (DN) to the file
+   * containing that certificate. OpenSSL contains a tool called c_rehash
+   * to create these links in a directory.
+   */
+  void setTrustedCertificates({String file, String directory});
+
+  /**
+   * Sets the chain of X509 certificates served by [SecureServer]
+   * when making secure connections, including the server certificate.
+   * [file] is an PEM file containing X509 certificates, starting with
+   * the root authority and intermediate authorities forming the signed
+   * chain to the server certificate, and ending with the server certificate.
+   * The private key for the server certificate is set by [usePrivateKey].
+   */
+  void useCertificateChain(String file);
+
+  /**
+   * Sets the list of authority names that a [SecureServer] will advertise
+   * as accepted, when requesting a client certificate from a connecting
+   * client.  [file] is a PEM file containing the accepted signing authority
+   * certificates - the authority names are extracted from the certificates.
+   */
+  void setClientAuthorities(String file);
+
+  /**
+   * Sets the list of application-level protocols supported by a client
+   * connection or server connection. The ALPN (application level protocol
+   * negotiation) extension to TLS allows a client to send a list of
+   * protocols in the TLS client hello message, and the server to pick
+   * one and send the selected one back in its server hello message.
+   *
+   * Separate lists of protocols can be sent for client connections and
+   * for server connections, using the same SecurityContext.  The [isServer]
+   * boolean argument specifies whether to set the list for server connections
+   * or client connections.
+   */
+   void setAlpnProtocols(List<String> protocols, bool isServer);
+
+  /// Encodes a set of supported protocols for ALPN/NPN usage.
+  ///
+  /// The `protocols` list is expected to contain protocols in descending order
+  /// of preference.
+  ///
+  /// See RFC 7301 (https://tools.ietf.org/html/rfc7301) for the encoding of
+  /// `List<String> protocols`:
+  ///     opaque ProtocolName<1..2^8-1>;
+  ///
+  ///     struct {
+  ///         ProtocolName protocol_name_list<2..2^16-1>
+  ///     } ProtocolNameList;
+  ///
+  /// The encoding of the opaque `ProtocolName<lower..upper>` vector is
+  /// described in RFC 2246: 4.3 Vectors.
+  ///
+  /// Note: Even though this encoding scheme would allow a total
+  /// `ProtocolNameList` length of 65535, this limit cannot be reached. Testing
+  /// showed that more than ~ 2^14  bytes will fail to negotiate a protocol.
+  /// We will be conservative and support only messages up to (1<<13)-1 bytes.
+  static Uint8List _protocolsToLengthEncoding(List<String> protocols) {
+    if (protocols == null || protocols.length == 0) {
+      return new Uint8List(0);
+    }
+    int protocolsLength = protocols.length;
+
+    // Calculate the number of bytes we will need if it is ASCII.
+    int expectedLength = protocolsLength;
+    for (int i = 0; i < protocolsLength; i++) {
+      int length = protocols[i].length;
+      if (length > 0 && length <= 255) {
+        expectedLength += length;
+      } else {
+        throw new ArgumentError(
+            'Length of protocol must be between 1 and 255 (was: $length).');
+      }
+    }
+
+    if (expectedLength >= (1 << 13)) {
+      throw new ArgumentError(
+          'The maximum message length supported is 2^13-1.');
+    }
+
+    // Try encoding the `List<String> protocols` array using fast ASCII path.
+    var bytes = new Uint8List(expectedLength);
+    int bytesOffset = 0;
+    for (int i = 0; i < protocolsLength; i++) {
+      String proto = protocols[i];
+
+      // Add length byte.
+      bytes[bytesOffset++] = proto.length;
+      int bits = 0;
+
+      // Add protocol bytes.
+      for (int j = 0; j < proto.length; j++) {
+        var char = proto.codeUnitAt(j);
+        bits |= char;
+        bytes[bytesOffset++] = char & 0xff;
+      }
+
+      // Go slow case if we have encountered anything non-ascii.
+      if (bits > 0x7f) {
+        return _protocolsToLengthEncodingNonAsciiBailout(protocols);
+      }
+    }
+    return bytes;
+  }
+
+  static Uint8List _protocolsToLengthEncodingNonAsciiBailout(
+      List<String> protocols) {
+    void addProtocol(List<int> outBytes, String protocol) {
+      var protocolBytes = UTF8.encode(protocol);
+      var len = protocolBytes.length;
+
+      if (len > 255) {
+        throw new ArgumentError(
+            'Length of protocol must be between 1 and 255 (was: $len)');
+      }
+      // Add length byte.
+      outBytes.add(len);
+
+      // Add protocol bytes.
+      outBytes.addAll(protocolBytes);
+    }
+
+    List<int> bytes = [];
+    for (var i = 0; i < protocols.length; i++) {
+      addProtocol(bytes, protocols[i]);
+    }
+
+    if (bytes.length >= (1 << 13)) {
+      throw new ArgumentError(
+          'The maximum message length supported is 2^13-1.');
+    }
+
+    return new Uint8List.fromList(bytes);
+  }
+}
diff --git a/sdk/lib/io/socket.dart b/sdk/lib/io/socket.dart
index a759598..4da5bb8 100644
--- a/sdk/lib/io/socket.dart
+++ b/sdk/lib/io/socket.dart
@@ -224,13 +224,12 @@
    * value of [:0:] (the default) a reasonable value will be chosen by
    * the system.
    *
-   * The optional argument [shared] specify whether additional binds
-   * to the same `address`, `port` and `v6Only` combination is
-   * possible from the same Dart process. If `shared` is `true` and
-   * additional binds are performed, then the incoming connections
-   * will be distributed between that set of `RawServerSocket`s. One
-   * way of using this is to have number of isolates between which
-   * incoming connections are distributed.
+   * The optional argument [shared] specifies whether additional RawServerSocket
+   * objects can bind to the same combination of `address`, `port` and `v6Only`.
+   * If `shared` is `true` and more `RawServerSocket`s from this isolate or
+   * other isolates are bound to the port, then the incoming connections will be
+   * distributed among all the bound `RawServerSocket`s. Connections can be
+   * distributed over multiple isolates this way.
    */
   external static Future<RawServerSocket> bind(address,
                                                int port,
@@ -253,41 +252,6 @@
    * is fully closed and is no longer bound.
    */
   Future<RawServerSocket> close();
-
-  /**
-   * Get the [RawServerSocketReference].
-   *
-   * WARNING: This feature is *highly experimental* and currently only
-   * works on Linux. The API will be removed in Dart 1.10. Use the
-   * `shared` optional argument on the `bind` method instead.
-   *
-   * The returned [RawServerSocketReference] can be used to create other
-   * [RawServerSocket]s listening on the same port,
-   * using [RawServerSocketReference.create].
-   * Incoming connections on the port will be distributed fairly between the
-   * active server sockets.
-   * The [RawServerSocketReference] can be distributed to other isolates through
-   * a [RawSendPort].
-   */
-
-  @Deprecated('This will be removed in Dart 1.10. Use the '
-              '`shared` optional argument on the `bind` method instead.')
-  RawServerSocketReference get reference;
-}
-
-
-/**
- * A [RawServerSocketReference].
- *
- * WARNING: This class is used with [RawServerSocket.reference] which is highly
- * experimental.
- */
-@Deprecated('This will be removed in Dart 1.10.')
-abstract class RawServerSocketReference {
-  /**
-   * Create a new [RawServerSocket], from this reference.
-   */
-  Future<RawServerSocket> create();
 }
 
 
@@ -329,13 +293,12 @@
    * value of [:0:] (the default) a reasonable value will be chosen by
    * the system.
    *
-   * The optional argument [shared] specify whether additional binds
-   * to the same `address`, `port` and `v6Only` combination is
-   * possible from the same Dart process. If `shared` is `true` and
-   * additional binds are performed, then the incoming connections
-   * will be distributed between that set of `ServerSocket`s. One way
-   * of using this is to have number of isolates between which
-   * incoming connections are distributed.
+   * The optional argument [shared] specifies whether additional ServerSocket
+   * objects can bind to the same combination of `address`, `port` and `v6Only`.
+   * If `shared` is `true` and more `ServerSocket`s from this isolate or other
+   * isolates are bound to the port, then the incoming connections will be
+   * distributed among all the bound `ServerSocket`s. Connections can be
+   * distributed over multiple isolates this way.
    */
   external static Future<ServerSocket> bind(address,
                                             int port,
@@ -358,40 +321,6 @@
    * is fully closed and is no longer bound.
    */
   Future<ServerSocket> close();
-
-  /**
-   * Get the [ServerSocketReference].
-   *
-   * WARNING: This feature is *highly experimental* and currently only
-   * works on Linux. The API will be removed in Dart 1.10. Use the
-   * `shared` optional argument on the `bind` method instead.
-   *
-   * The returned [ServerSocketReference] can be used to create other
-   * [ServerSocket]s listening on the same port,
-   * using [ServerSocketReference.create].
-   * Incoming connections on the port will be distributed fairly between the
-   * active server sockets.
-   * The [ServerSocketReference] can be distributed to other isolates through a
-   * [SendPort].
-   */
-  @Deprecated('This will be removed in Dart 1.10. Use the '
-              '`shared` optional argument on the `bind` method instead.')
-  ServerSocketReference get reference;
-}
-
-
-/**
- * A [ServerSocketReference].
- *
- * WARNING: This class is used with [ServerSocket.reference] which is highly
- * experimental.
- */
-@Deprecated('This will be removed in Dart 1.10.')
-abstract class ServerSocketReference {
-  /**
-   * Create a new [ServerSocket], from this reference.
-   */
-  Future<ServerSocket> create();
 }
 
 
@@ -735,6 +664,8 @@
   /**
    * Receive a datagram. If there are no datagrams available `null` is
    * returned.
+   *
+   * The maximum length of the datagram that can be received is 65503 bytes.
    */
   Datagram receive();
 
diff --git a/sdk/lib/isolate/isolate.dart b/sdk/lib/isolate/isolate.dart
index 8c2b86e..8d284d2 100644
--- a/sdk/lib/isolate/isolate.dart
+++ b/sdk/lib/isolate/isolate.dart
@@ -213,18 +213,22 @@
    * WARNING: The [checked] parameter is not implemented on all platforms yet.
    *
    * If the [packageRoot] parameter is provided, it is used to find the location
-   * of packages imports in the spawned isolate.
+   * of package sources in the spawned isolate.
+   *
    * The `packageRoot` URI must be a "file" or "http"/"https" URI that specifies
    * a directory. If it doesn't end in a slash, one will be added before
    * using the URI, and any query or fragment parts are ignored.
-   * Package imports (like "package:foo/bar.dart") in the new isolate are
+   * Package imports (like `"package:foo/bar.dart"`) in the new isolate are
    * resolved against this location, as by
    * `packageRoot.resolve("foo/bar.dart")`.
-   * This includes the main entry [uri] if it happens to be a package-URL.
-   * If [packageRoot] is omitted, it defaults to the same URI that
-   * the current isolate is using.
    *
-   * WARNING: The [packageRoot] parameter is not implemented on all
+   * The [environment] is a mapping from strings to strings which the
+   * spawned isolate uses when looking up [String.fromEnvironment] values.
+   * The system may add its own entries to environment as well.
+   * If `environment` is omitted, the spawned isolate has the same environment
+   * declarations as the spawning isolate.
+   *
+   * WARNING: The [environment] parameter is not implemented on all
    * platforms yet.
    *
    * Returns a future that will complete with an [Isolate] instance if the
@@ -235,11 +239,12 @@
       List<String> args,
       var message,
       {bool paused: false,
-       bool checked,
-       Uri packageRoot,
-       bool errorsAreFatal,
        SendPort onExit,
-       SendPort onError});
+       SendPort onError,
+       bool errorsAreFatal,
+       bool checked,
+       Map<String, String> environment,
+       Uri packageRoot});
 
   /**
    * Requests the isolate to pause.
@@ -485,6 +490,10 @@
    * is also possible to send object instances (which would be copied in the
    * process). This is currently only supported by the dartvm.  For now, the
    * dart2js compiler only supports the restricted messages described above.
+   *
+   * The send happens immediately and doesn't block.  The corresponding receive
+   * port can receive the message as soon as its isolate's event loop is ready
+   * to deliver it, independently of what the sending isolate is doing.
    */
   void send(var message);
 
@@ -599,33 +608,6 @@
 }
 
 /**
- * Wraps unhandled exceptions thrown during isolate execution. It is
- * used to show both the error message and the stack trace for unhandled
- * exceptions.
- */
-// TODO(floitsch): probably going to remove and replace with something else.
-class _IsolateUnhandledException implements Exception {
-  /** Message being handled when exception occurred. */
-  final message;
-
-  /** Wrapped exception. */
-  final source;
-
-  /** Trace for the wrapped exception. */
-  final StackTrace stackTrace;
-
-  const _IsolateUnhandledException(this.message, this.source, this.stackTrace);
-
-  String toString() {
-    return 'IsolateUnhandledException: exception while handling message: '
-        '${message} \n  '
-        '${source.toString().replaceAll("\n", "\n  ")}\n'
-        'original stack trace:\n  '
-        '${stackTrace.toString().replaceAll("\n","\n  ")}';
-  }
-}
-
-/**
  * Description of an error from another isolate.
  *
  * This error has the same `toString()` and `stackTrace.toString()` behavior
diff --git a/sdk/lib/js/dart2js/js_dart2js.dart b/sdk/lib/js/dart2js/js_dart2js.dart
index 849de82..f98b29d 100644
--- a/sdk/lib/js/dart2js/js_dart2js.dart
+++ b/sdk/lib/js/dart2js/js_dart2js.dart
@@ -92,21 +92,30 @@
 import 'dart:indexed_db' show KeyRange;
 import 'dart:typed_data' show TypedData;
 
-import 'dart:_foreign_helper' show JS, DART_CLOSURE_TO_JS;
-import 'dart:_interceptors' show JavaScriptObject, UnknownJavaScriptObject;
-import 'dart:_js_helper' show Primitives, convertDartClosureToJS,
-    getIsolateAffinityTag;
+import 'dart:_foreign_helper' show JS, JS_CONST, DART_CLOSURE_TO_JS;
+import 'dart:_interceptors'
+    show JavaScriptObject, UnknownJavaScriptObject, DART_CLOSURE_PROPERTY_NAME;
+import 'dart:_js_helper'
+    show Primitives, convertDartClosureToJS, getIsolateAffinityTag;
+
+export 'dart:_interceptors' show JavaScriptObject;
 
 final JsObject context = _wrapToDart(JS('', 'self'));
 
 _convertDartFunction(Function f, {bool captureThis: false}) {
-  return JS('',
-    'function(_call, f, captureThis) {'
-      'return function() {'
-        'return _call(f, captureThis, this, '
-            'Array.prototype.slice.apply(arguments));'
-      '}'
-    '}(#, #, #)', DART_CLOSURE_TO_JS(_callDartFunction), f, captureThis);
+  return JS(
+      '',
+      '''
+        function(_call, f, captureThis) {
+          return function() {
+            return _call(f, captureThis, this,
+                Array.prototype.slice.apply(arguments));
+          }
+        }(#, #, #)
+      ''',
+      DART_CLOSURE_TO_JS(_callDartFunction),
+      f,
+      captureThis);
 }
 
 _callDartFunction(callback, bool captureThis, self, List arguments) {
@@ -212,8 +221,7 @@
    */
   factory JsObject.fromBrowserObject(object) {
     if (object is num || object is String || object is bool || object == null) {
-      throw new ArgumentError(
-        "object cannot be a num, string, bool, or null");
+      throw new ArgumentError("object cannot be a num, string, bool, or null");
     }
     return _wrapToDart(_convertToJS(object));
   }
@@ -267,7 +275,7 @@
    *
    * The type of [property] must be either [String] or [num].
    */
-  dynamic operator[](property) {
+  dynamic operator [](property) {
     if (property is! String && property is! num) {
       throw new ArgumentError("property is not a String or num");
     }
@@ -280,7 +288,7 @@
    *
    * The type of [property] must be either [String] or [num].
    */
-  operator[]=(property, value) {
+  operator []=(property, value) {
     if (property is! String && property is! num) {
       throw new ArgumentError("property is not a String or num");
     }
@@ -289,8 +297,8 @@
 
   int get hashCode => 0;
 
-  bool operator==(other) => other is JsObject &&
-      JS('bool', '# === #', _jsObject, other._jsObject);
+  bool operator ==(other) =>
+      other is JsObject && JS('bool', '# === #', _jsObject, other._jsObject);
 
   /**
    * Returns `true` if the JavaScript object contains the specified property
@@ -332,7 +340,7 @@
   String toString() {
     try {
       return JS('String', 'String(#)', _jsObject);
-    } catch(e) {
+    } catch (e) {
       return super.toString();
     }
   }
@@ -347,7 +355,11 @@
     if (method is! String && method is! num) {
       throw new ArgumentError("method is not a String or num");
     }
-    return _convertToDart(JS('', '#[#].apply(#, #)', _jsObject, method,
+    return _convertToDart(JS(
+        '',
+        '#[#].apply(#, #)',
+        _jsObject,
+        method,
         _jsObject,
         args == null ? null : new List.from(args.map(_convertToJS))));
   }
@@ -357,7 +369,6 @@
  * Proxies a JavaScript Function object.
  */
 class JsFunction extends JsObject {
-
   /**
    * Returns a [JsFunction] that captures its 'this' binding and calls [f]
    * with the value of this passed as the first argument.
@@ -373,17 +384,18 @@
    * Invokes the JavaScript function with arguments [args]. If [thisArg] is
    * supplied it is the value of `this` for the invocation.
    */
-  dynamic apply(List args, { thisArg }) =>
-      _convertToDart(JS('', '#.apply(#, #)', _jsObject,
-          _convertToJS(thisArg),
-          args == null ? null : new List.from(args.map(_convertToJS))));
+  dynamic apply(List args, {thisArg}) => _convertToDart(JS(
+      '',
+      '#.apply(#, #)',
+      _jsObject,
+      _convertToJS(thisArg),
+      args == null ? null : new List.from(args.map(_convertToJS))));
 }
 
 /**
  * A [List] that proxies a JavaScript array.
  */
 class JsArray<E> extends JsObject with ListMixin<E> {
-
   /**
    * Creates a new JavaScript array.
    */
@@ -449,8 +461,9 @@
     throw new StateError('Bad JsArray length');
   }
 
-  void set length(int length) { super['length'] = length; }
-
+  void set length(int length) {
+    super['length'] = length;
+  }
 
   // Methods overriden for better performance
 
@@ -503,25 +516,25 @@
 // property added to a Dart object referencing its JS-side DartObject proxy
 final String _DART_OBJECT_PROPERTY_NAME =
     getIsolateAffinityTag(r'_$dart_dartObject');
-final String _DART_CLOSURE_PROPERTY_NAME =
-    getIsolateAffinityTag(r'_$dart_dartClosure');
 
 // property added to a JS object referencing its Dart-side JsObject proxy
 const _JS_OBJECT_PROPERTY_NAME = r'_$dart_jsObject';
 const _JS_FUNCTION_PROPERTY_NAME = r'$dart_jsFunction';
+const _JS_FUNCTION_PROPERTY_NAME_CAPTURE_THIS = r'_$dart_jsFunctionCaptureThis';
 
 bool _defineProperty(o, String name, value) {
-  if (_isExtensible(o) &&
-      // TODO(ahe): Calling _hasOwnProperty to work around
-      // https://code.google.com/p/dart/issues/detail?id=21331.
-      !_hasOwnProperty(o, name)) {
-    try {
+  try {
+    if (_isExtensible(o) &&
+        // TODO(ahe): Calling _hasOwnProperty to work around
+        // https://code.google.com/p/dart/issues/detail?id=21331.
+        !_hasOwnProperty(o, name)) {
       JS('void', 'Object.defineProperty(#, #, { value: #})', o, name, value);
       return true;
-    } catch (e) {
-      // object is native and lies about being extensible
-      // see https://bugzilla.mozilla.org/show_bug.cgi?id=775185
     }
+  } catch (e) {
+    // object is native and lies about being extensible
+    // see https://bugzilla.mozilla.org/show_bug.cgi?id=775185
+    // Or, isExtensible throws for this object.
   }
   return false;
 }
@@ -554,8 +567,13 @@
   if (o is JsObject) {
     return o._jsObject;
   }
-  if (o is Blob || o is Event || o is KeyRange || o is ImageData || o is Node ||
-      o is TypedData || o is Window) {
+  if (o is Blob ||
+      o is Event ||
+      o is KeyRange ||
+      o is ImageData ||
+      o is Node ||
+      o is TypedData ||
+      o is Window) {
     return o;
   }
   if (o is DateTime) {
@@ -565,13 +583,13 @@
     return _getJsProxy(o, _JS_FUNCTION_PROPERTY_NAME, (o) {
       var jsFunction = _convertDartFunction(o);
       // set a property on the JS closure referencing the Dart closure
-      _defineProperty(jsFunction, _DART_CLOSURE_PROPERTY_NAME, o);
+      _defineProperty(jsFunction, DART_CLOSURE_PROPERTY_NAME, o);
       return jsFunction;
     });
   }
   var ctor = _dartProxyCtor;
-  return _getJsProxy(o, _JS_OBJECT_PROPERTY_NAME,
-      (o) => JS('', 'new #(#)', ctor, o));
+  return _getJsProxy(
+      o, _JS_OBJECT_PROPERTY_NAME, (o) => JS('', 'new #(#)', ctor, o));
 }
 
 Object _getJsProxy(o, String propertyName, createProxy(o)) {
@@ -591,9 +609,14 @@
       JS('bool', 'typeof # == "number"', o) ||
       JS('bool', 'typeof # == "boolean"', o)) {
     return o;
-  } else if (_isLocalObject(o)
-      && (o is Blob || o is Event || o is KeyRange || o is ImageData
-      || o is Node || o is TypedData || o is Window)) {
+  } else if (_isLocalObject(o) &&
+      (o is Blob ||
+          o is Event ||
+          o is KeyRange ||
+          o is ImageData ||
+          o is Node ||
+          o is TypedData ||
+          o is Window)) {
     // long line: dart2js doesn't allow string concatenation in the JS() form
     return JS('Blob|Event|KeyRange|ImageData|Node|TypedData|Window', '#', o);
   } else if (JS('bool', '# instanceof Date', o)) {
@@ -608,15 +631,15 @@
 
 JsObject _wrapToDart(o) {
   if (JS('bool', 'typeof # == "function"', o)) {
-    return _getDartProxy(o, _DART_CLOSURE_PROPERTY_NAME,
-        (o) => new JsFunction._fromJs(o));
+    return _getDartProxy(
+        o, DART_CLOSURE_PROPERTY_NAME, (o) => new JsFunction._fromJs(o));
   }
   if (JS('bool', '# instanceof Array', o)) {
-    return _getDartProxy(o, _DART_OBJECT_PROPERTY_NAME,
-        (o) => new JsArray._fromJs(o));
+    return _getDartProxy(
+        o, _DART_OBJECT_PROPERTY_NAME, (o) => new JsArray._fromJs(o));
   }
-  return _getDartProxy(o, _DART_OBJECT_PROPERTY_NAME,
-      (o) => new JsObject._fromJs(o));
+  return _getDartProxy(
+      o, _DART_OBJECT_PROPERTY_NAME, (o) => new JsObject._fromJs(o));
 }
 
 Object _getDartProxy(o, String propertyName, createProxy(o)) {
@@ -634,3 +657,72 @@
   }
   return dartProxy;
 }
+
+// ---------------------------------------------------------------------------
+// Start of methods for new style Dart-JS interop.
+
+_convertDartFunctionFast(Function f) {
+  var existing = JS('', '#.#', f, _JS_FUNCTION_PROPERTY_NAME);
+  if (existing != null) return existing;
+  var ret = JS(
+      '',
+      '''
+        function(_call, f) {
+          return function() {
+            return _call(f, Array.prototype.slice.apply(arguments));
+          }
+        }(#, #)
+      ''',
+      DART_CLOSURE_TO_JS(_callDartFunctionFast),
+      f);
+  JS('', '#.# = #', ret, DART_CLOSURE_PROPERTY_NAME, f);
+  JS('', '#.# = #', f, _JS_FUNCTION_PROPERTY_NAME, ret);
+  return ret;
+}
+
+_convertDartFunctionFastCaptureThis(Function f) {
+  var existing = JS('', '#.#', f, _JS_FUNCTION_PROPERTY_NAME_CAPTURE_THIS);
+  if (existing != null) return existing;
+  var ret = JS(
+      '',
+      '''
+        function(_call, f) {
+          return function() {
+            return _call(f, this,Array.prototype.slice.apply(arguments));
+          }
+        }(#, #)
+      ''',
+      DART_CLOSURE_TO_JS(_callDartFunctionFastCaptureThis),
+      f);
+  JS('', '#.# = #', ret, DART_CLOSURE_PROPERTY_NAME, f);
+  JS('', '#.# = #', f, _JS_FUNCTION_PROPERTY_NAME_CAPTURE_THIS, ret);
+  return ret;
+}
+
+_callDartFunctionFast(callback, List arguments) {
+  return Function.apply(callback, arguments);
+}
+
+_callDartFunctionFastCaptureThis(callback, self, List arguments) {
+  return Function.apply(callback, [self]..addAll(arguments));
+}
+
+Function allowInterop(Function f) {
+  if (JS('bool', 'typeof(#) == "function"', f)) {
+    // Already supports interop, just use the existing function.
+    return f;
+  } else {
+    return _convertDartFunctionFast(f);
+  }
+}
+
+Function allowInteropCaptureThis(Function f) {
+  if (JS('bool', 'typeof(#) == "function"', f)) {
+    // Behavior when the function is already a JS function is unspecified.
+    throw new ArgumentError(
+        "Function is already a JS function so cannot capture this.");
+    return f;
+  } else {
+    return _convertDartFunctionFastCaptureThis(f);
+  }
+}
diff --git a/sdk/lib/js/dartium/js_dartium.dart b/sdk/lib/js/dartium/js_dartium.dart
index 0bb53c3..b01dce0 100644
--- a/sdk/lib/js/dartium/js_dartium.dart
+++ b/sdk/lib/js/dartium/js_dartium.dart
@@ -4,7 +4,7 @@
 
 /**
  * Support for interoperating with JavaScript.
- * 
+ *
  * This library provides access to JavaScript objects from Dart, allowing
  * Dart code to get and set properties, and call methods of JavaScript objects
  * and invoke JavaScript functions. The library takes care of converting
@@ -27,14 +27,14 @@
  * global function `alert()`:
  *
  *     import 'dart:js';
- *     
+ *
  *     main() => context.callMethod('alert', ['Hello from Dart!']);
  *
  * This example shows how to create a [JsObject] from a JavaScript constructor
  * and access its properties:
  *
  *     import 'dart:js';
- *     
+ *
  *     main() {
  *       var object = new JsObject(context['Object']);
  *       object['greeting'] = 'Hello';
@@ -44,7 +44,7 @@
  *     }
  *
  * ## Proxying and automatic conversion
- * 
+ *
  * When setting properties on a JsObject or passing arguments to a Javascript
  * method or function, Dart objects are automatically converted or proxied to
  * JavaScript objects. When accessing JavaScript properties, or when a Dart
@@ -80,7 +80,7 @@
  * `a` and `b` defined:
  *
  *     var jsMap = new JsObject.jsify({'a': 1, 'b': 2});
- * 
+ *
  * This expression creates a JavaScript array:
  *
  *     var jsArray = new JsObject.jsify([1, 2, 3]);
@@ -91,17 +91,23 @@
 import 'dart:nativewrappers';
 import 'dart:math' as math;
 import 'dart:mirrors' as mirrors;
+import 'dart:html' as html;
+import 'dart:html_common' as html_common;
+import 'dart:indexed_db' as indexed_db;
+import 'dart:typed_data';
 
 // Pretend we are always in checked mode as we aren't interested in users
 // running Dartium code outside of checked mode.
+@Deprecated("Internal Use Only")
 final bool CHECK_JS_INVOCATIONS = true;
 
 final _allowedMethods = new Map<Symbol, _DeclarationSet>();
 final _allowedGetters = new Map<Symbol, _DeclarationSet>();
 final _allowedSetters = new Map<Symbol, _DeclarationSet>();
 
-final _jsInterfaceTypes = new Set<Type>();
-Iterable<Type> get jsInterfaceTypes => _jsInterfaceTypes;
+final _jsInterfaceTypes = new Set<mirrors.ClassMirror>();
+@Deprecated("Internal Use Only")
+Iterable<mirrors.ClassMirror> get jsInterfaceTypes => _jsInterfaceTypes;
 
 /// A collection of methods where all methods have the same name.
 /// This class is intended to optimize whether a specific invocation is
@@ -203,12 +209,13 @@
  * Temporary method that we hope to remove at some point. This method should
  * generally only be called by machine generated code.
  */
-void registerJsInterfaces(List<Type> classes) {
-  if (_finalized == true) {
-    throw 'JSInterop class registration already finalized';
-  }
+@Deprecated("Internal Use Only")
+void registerJsInterfaces([List<Type> classes]) {
+  // This method is now obsolete in Dartium.
+}
+
+void _registerJsInterfaces(List<Type> classes) {
   for (Type type in classes) {
-    if (!_jsInterfaceTypes.add(type)) continue; // Already registered.
     mirrors.ClassMirror typeMirror = mirrors.reflectType(type);
     typeMirror.declarations.forEach((symbol, declaration) {
       if (declaration is mirrors.MethodMirror ||
@@ -251,20 +258,378 @@
 
 _finalizeJsInterfaces() native "Js_finalizeJsInterfaces";
 
+String _getJsName(mirrors.DeclarationMirror mirror) {
+  for (var annotation in mirror.metadata) {
+    if (mirrors.MirrorSystem.getName(annotation.type.simpleName) == "JS") {
+      mirrors.LibraryMirror library = annotation.type.owner;
+      var uri = library.uri;
+      // make sure the annotation is from package://js
+      if (uri.scheme == 'package' && uri.path == 'js/js.dart') {
+        try {
+          var name = annotation.reflectee.name;
+          return name != null ? name : "";
+        } catch (e) {}
+      }
+    }
+  }
+  return null;
+}
+
+bool _isAnonymousClass(mirrors.ClassMirror mirror) {
+  for (var annotation in mirror.metadata) {
+    if (mirrors.MirrorSystem.getName(annotation.type.simpleName) ==
+        "_Anonymous") {
+      mirrors.LibraryMirror library = annotation.type.owner;
+      var uri = library.uri;
+      // make sure the annotation is from package://js
+      if (uri.scheme == 'package' && uri.path == 'js/js.dart') {
+        return true;
+      }
+    }
+  }
+  return false;
+}
+
+bool _hasJsName(mirrors.DeclarationMirror mirror) => _getJsName(mirror) != null;
+
+_getJsMemberName(mirrors.DeclarationMirror mirror) {
+  var name = _getJsName(mirror);
+  return name == null || name.isEmpty ? _getDeclarationName(mirror) : name;
+}
+
+// TODO(jacobr): handle setters correctyl.
+String _getDeclarationName(mirrors.DeclarationMirror declaration) {
+  var name = mirrors.MirrorSystem.getName(declaration.simpleName);
+  if (declaration is mirrors.MethodMirror && declaration.isSetter) {
+    assert(name.endsWith("="));
+    name = name.substring(0, name.length - 1);
+  }
+  return name;
+}
+
+final _JS_LIBRARY_PREFIX = "js_library";
+final _UNDEFINED_VAR = "_UNDEFINED_JS_CONST";
+
+String _accessJsPath(String path) =>
+    "${_JS_LIBRARY_PREFIX}.context${path.split(".").map((p) => "['$p']").join('')}";
+
+@Deprecated("Internal Use Only")
+void addMemberHelper(
+    mirrors.MethodMirror declaration, String path, StringBuffer sb,
+    {bool isStatic: false, String memberName}) {
+  if (!declaration.isConstructor) {
+    var jsName = _getJsMemberName(declaration);
+    path = (path != null && path.isNotEmpty) ? "${path}.${jsName}" : jsName;
+  }
+  var name = memberName != null ? memberName : _getDeclarationName(declaration);
+  if (declaration.isConstructor) {
+    sb.write("factory");
+  } else if (isStatic) {
+    sb.write("static");
+  } else {
+    sb.write("patch");
+  }
+  sb.write(" ");
+  if (declaration.isGetter) {
+    sb.write("get $name => ${_accessJsPath(path)};");
+  } else if (declaration.isSetter) {
+    sb.write("set $name(v) => ${_accessJsPath(path)} = v;");
+  } else {
+    sb.write("$name(");
+    bool hasOptional = false;
+    int i = 0;
+    var args = <String>[];
+    for (var p in declaration.parameters) {
+      assert(!p.isNamed); // XXX throw
+      assert(!p.hasDefaultValue);
+      if (i > 0) {
+        sb.write(", ");
+      }
+      if (p.isOptional && !hasOptional) {
+        sb.write("[");
+        hasOptional = true;
+      }
+      var arg = "p$i";
+      args.add(arg);
+      sb.write(arg);
+      if (p.isOptional) {
+        sb.write("=${_UNDEFINED_VAR}");
+      }
+      i++;
+    }
+    if (hasOptional) {
+      sb.write("]");
+    }
+    // TODO(jacobr):
+    sb.write(") => ");
+    if (declaration.isConstructor) {
+      sb.write("new ${_JS_LIBRARY_PREFIX}.JsObject(");
+    }
+    sb
+      ..write(_accessJsPath(path))
+      ..write(declaration.isConstructor ? "," : ".apply(")
+      ..write("[${args.join(",")}]");
+
+    if (hasOptional) {
+      sb.write(".takeWhile((i) => i != ${_UNDEFINED_VAR}).toList()");
+    }
+    sb.write(");");
+  }
+  sb.write("\n");
+}
+
+// TODO(jacobr): make this check more robust.
+bool _isExternal(mirrors.Mirror mirror) {
+  /*
+  var source = mirror.source;
+  return source != null && source.startsWith("external ");
+  */
+  return mirror.isExternal;
+}
+
+List<String> _generateExternalMethods() {
+  var staticCodegen = <String>[];
+  mirrors.currentMirrorSystem().libraries.forEach((uri, library) {
+    var sb = new StringBuffer();
+    String jsLibraryName = _getJsName(library);
+    library.declarations.forEach((name, declaration) {
+      if (declaration is mirrors.MethodMirror) {
+        if ((_hasJsName(declaration) || jsLibraryName != null) &&
+            _isExternal(declaration)) {
+          addMemberHelper(declaration, jsLibraryName, sb);
+        }
+      } else if (declaration is mirrors.ClassMirror) {
+        mirrors.ClassMirror clazz = declaration;
+        if (_hasJsName(clazz)) {
+          // TODO(jacobr): verify class implements JavaScriptObject.
+          String jsClassName = _getJsMemberName(clazz);
+          var className = mirrors.MirrorSystem.getName(clazz.simpleName);
+          var sbPatch = new StringBuffer();
+          jsInterfaceTypes.add(clazz);
+          clazz.declarations.forEach((name, declaration) {
+            if (declaration is! mirrors.MethodMirror ||
+                !_isExternal(declaration)) return;
+            if (declaration.isFactoryConstructor && _isAnonymousClass(clazz)) {
+              sbPatch.write("  factory ${className}(");
+              int i = 0;
+              var args = <String>[];
+              for (var p in declaration.parameters) {
+                args.add(mirrors.MirrorSystem.getName(p.simpleName));
+                i++;
+              }
+              if (args.isNotEmpty) {
+                sbPatch
+                  ..write('{')
+                  ..write(
+                      args.map((name) => '$name:${_UNDEFINED_VAR}').join(", "))
+                  ..write('}');
+              }
+              sbPatch.write(") {\n"
+                    "    var ret = new ${_JS_LIBRARY_PREFIX}.JsObject.jsify({});\n");
+              i = 0;
+              for (var p in declaration.parameters) {
+                assert(p.isNamed); // XXX throw
+                var name = args[i];
+                var jsName = mirrors.MirrorSystem.getName(p.simpleName);
+                // XXX apply name conversion rules.
+                sbPatch.write(
+                    "    if($name != ${_UNDEFINED_VAR}) ret['$jsName'] = $name;\n");
+                i++;
+              }
+
+              sbPatch.write("    return ret;\n"
+                  "  }\n");
+            } else if (declaration.isConstructor ||
+                declaration.isFactoryConstructor) {
+              sbPatch.write("  ");
+              addMemberHelper(
+                  declaration,
+                  (jsLibraryName != null && jsLibraryName.isNotEmpty)
+                      ? "${jsLibraryName}.${jsClassName}"
+                      : jsClassName,
+                  sbPatch,
+                  isStatic: true,
+                  memberName: className);
+            }
+          });
+
+          clazz.staticMembers.forEach((memberName, member) {
+            if (_isExternal(member)) {
+              sbPatch.write("  ");
+              addMemberHelper(
+                  member,
+                  (jsLibraryName != null && jsLibraryName.isNotEmpty)
+                      ? "${jsLibraryName}.${jsClassName}"
+                      : jsClassName,
+                  sbPatch,
+                  isStatic: true);
+            }
+          });
+          var typeVariablesClause = '';
+          if (!clazz.typeVariables.isEmpty) {
+            typeVariablesClause =
+                '<${clazz.typeVariables.map((m) => mirrors.MirrorSystem.getName(m.simpleName)).join(',')}>';
+          }
+          if (sbPatch.isNotEmpty) {
+            sb.write("""
+patch class $className$typeVariablesClause {
+$sbPatch
+}
+""");
+          }
+        }
+      }
+    });
+    if (sb.isNotEmpty) {
+      staticCodegen
+        ..add(uri.toString())
+        ..add("${uri}_js_interop_patch.dart")
+        ..add("""
+import 'dart:js' as ${_JS_LIBRARY_PREFIX};
+
+/**
+ * Placeholder object for cases where we need to determine exactly how many
+ * args were passed to a function.
+ */
+const ${_UNDEFINED_VAR} = const Object();
+
+${sb}
+""");
+    }
+  });
+
+  return staticCodegen;
+}
+
+List<String> _generateExternalMethods2() {
+  var staticCodegen = <String>[];
+  mirrors.currentMirrorSystem().libraries.forEach((uri, library) {
+    var sb = new StringBuffer();
+    String jsLibraryName = _getJsName(library);
+    library.declarations.forEach((name, declaration) {
+      var isExternal = _isExternal(declaration);
+      if (declaration is mirrors.MethodMirror) {
+        if (isExternal && (_hasJsName(declaration) || jsLibraryName != null)) {
+          addMemberHelper(declaration, jsLibraryName, sb);
+        }
+      } else if (declaration is mirrors.ClassMirror) {
+        mirrors.ClassMirror clazz = declaration;
+        if (_hasJsName(clazz)) {
+          // TODO(jacobr): verify class implements JavaScriptObject.
+          String jsClassName = _getJsMemberName(clazz);
+          var className = mirrors.MirrorSystem.getName(clazz.simpleName);
+          var sbPatch = new StringBuffer();
+          jsInterfaceTypes.add(clazz);
+          clazz.declarations.forEach((name, declaration) {
+            if (declaration is! mirrors.MethodMirror ||
+                !declaration.isAbstract ||
+                !isExternal) return;
+            if (_hasLiteralAnnotation(declaration) &&
+                declaration.isFactoryConstructor) {
+              sbPatch.write("  factory ${className}({");
+              int i = 0;
+              var args = <String>[];
+              for (var p in declaration.parameters) {
+                assert(p.isNamed); // XXX throw
+                args.add(mirrors.MirrorSystem.getName(p.simpleName));
+                i++;
+              }
+              sbPatch
+                ..write(
+                    args.map((name) => '$name:${_UNDEFINED_VAR}').join(", "))
+                ..write("}) {\n"
+                    "    var ret = new ${_JS_LIBRARY_PREFIX}.JsObject.jsify({});\n");
+              i = 0;
+              for (var p in declaration.parameters) {
+                assert(p.isNamed); // XXX throw
+                var name = args[i];
+                var jsName = mirrors.MirrorSystem.getName(p.simpleName);
+                // XXX apply name conversion rules.
+                sbPatch.write(
+                    "    if($name != ${_UNDEFINED_VAR}) ret['$jsName'] = $name;\n");
+                i++;
+              }
+
+              sbPatch.write("    return ret;\n"
+                  "  }\n");
+            } else if (declaration.isConstructor ||
+                declaration.isFactoryConstructor) {
+              sbPatch.write("  ");
+              addMemberHelper(
+                  declaration,
+                  (jsLibraryName != null && jsLibraryName.isNotEmpty)
+                      ? "${jsLibraryName}.${jsClassName}"
+                      : jsClassName,
+                  sbPatch,
+                  isStatic: true,
+                  memberName: className);
+            }
+          });
+
+          clazz.staticMembers.forEach((memberName, member) {
+            if (_isExternal(member)) {
+              sbPatch.write("  ");
+              addMemberHelper(
+                  member,
+                  (jsLibraryName != null && jsLibraryName.isNotEmpty)
+                      ? "${jsLibraryName}.${jsClassName}"
+                      : jsClassName,
+                  sbPatch,
+                  isStatic: true);
+            }
+          });
+          var typeVariablesClause = '';
+          if (!clazz.typeVariables.isEmpty) {
+            typeVariablesClause =
+                '<${clazz.typeVariables.map((m) => mirrors.MirrorSystem.getName(m.simpleName)).join(',')}>';
+          }
+          if (sbPatch.isNotEmpty) {
+            sb.write("""
+patch class $className$typeVariablesClause {
+$sbPatch
+}
+""");
+          }
+        }
+      }
+    });
+    if (sb.isNotEmpty) {
+      staticCodegen
+        ..add(uri.toString())
+        ..add("${uri}_js_interop_patch.dart")
+        ..add("""
+import 'dart:js' as ${_JS_LIBRARY_PREFIX};
+
+/**
+ * Placeholder object for cases where we need to determine exactly how many
+ * args were passed to a function.
+ */
+const ${_UNDEFINED_VAR} = const Object();
+
+${sb}
+""");
+    }
+  });
+
+  return staticCodegen;
+}
+
 /**
  * Generates a part file defining source code for JsObjectImpl and related
  * classes. This calass is needed so that type checks for all registered JavaScript
  * interop classes pass.
  */
-String _generateJsObjectImplPart() {
-  Iterable<Type> types = jsInterfaceTypes;
+List<String> _generateInteropPatchFiles() {
+  var ret = _generateExternalMethods();
   var libraryPrefixes = new Map<mirrors.LibraryMirror, String>();
   var prefixNames = new Set<String>();
   var sb = new StringBuffer();
 
   var implements = <String>[];
-  for (var type in types) {
-    mirrors.ClassMirror typeMirror = mirrors.reflectType(type);
+  var implementsArray = <String>[];
+  var listMirror = mirrors.reflectType(List);
+
+  for (var typeMirror in jsInterfaceTypes) {
     mirrors.LibraryMirror libraryMirror = typeMirror.owner;
     var prefixName;
     if (libraryPrefixes.containsKey(libraryMirror)) {
@@ -283,16 +648,19 @@
       prefixNames.add(prefixName);
       libraryPrefixes[libraryMirror] = prefixName;
     }
-    implements.add(
+    var isArray = typeMirror.isSubtypeOf(listMirror);
+    (isArray ? implementsArray : implements).add(
         '${prefixName}.${mirrors.MirrorSystem.getName(typeMirror.simpleName)}');
   }
   libraryPrefixes.forEach((libraryMirror, prefix) {
     sb.writeln('import "${libraryMirror.uri}" as $prefix;');
   });
-  var implementsClause =
-      implements.isEmpty ? "" : "implements ${implements.join(', ')}";
+  buildImplementsClause(classes) =>
+      classes.isEmpty ? "" : "implements ${classes.join(', ')}";
+  var implementsClause = buildImplementsClause(implements);
   // TODO(jacobr): only certain classes need to be implemented by
-  // Function and Array.
+  // JsFunctionImpl.
+  var allTypes = []..addAll(implements)..addAll(implementsArray);
   sb.write('''
 class JsObjectImpl extends JsObject $implementsClause {
   JsObjectImpl.internal() : super.internal();
@@ -302,11 +670,17 @@
   JsFunctionImpl.internal() : super.internal();
 }
 
-class JsArrayImpl<E> extends JsArray<E> $implementsClause {
+class JsArrayImpl<E> extends JsArray<E> ${buildImplementsClause(implementsArray)} {
   JsArrayImpl.internal() : super.internal();
 }
+
+_registerAllJsInterfaces() {
+  _registerJsInterfaces([${allTypes.join(", ")}]);
+}
+
 ''');
-  return sb.toString();
+  ret..addAll(["dart:js", "JsInteropImpl.dart", sb.toString()]);
+  return ret;
 }
 
 // Start of block of helper methods facilitating emulating JavaScript Array
@@ -357,7 +731,7 @@
 String _arrayToString(List list) => _arrayJoin(list, ",");
 
 int _arrayPush(List list, List args) {
-  for(var e in args) {
+  for (var e in args) {
     list.add(e);
   }
   return list.length;
@@ -458,6 +832,7 @@
  * be added. Creating an instance of JsObject will also automatically trigger
  * all JsObjects to be finalized.
  */
+@Deprecated("Internal Use Only")
 void finalizeJsInterfaces() {
   if (_finalized == true) {
     throw 'JSInterop class registration already finalized';
@@ -478,6 +853,48 @@
   return _cachedContext;
 }
 
+_maybeWrap(o) {
+  var wrapped = html_common.wrap_jso_no_SerializedScriptvalue(o);
+  if (identical(wrapped, o)) return o;
+  return (wrapped is html.Blob ||
+      wrapped is html.Event ||
+      wrapped is indexed_db.KeyRange ||
+      wrapped is html.ImageData ||
+      wrapped is html.Node ||
+      wrapped is TypedData ||
+      wrapped is html.Window) ? wrapped : o;
+}
+
+/**
+ * Get the dart wrapper object for object. Top-level so we
+ * we can access it from other libraries without it being
+ * a public instance field on JsObject.
+ */
+@Deprecated("Internal Use Only")
+getDartHtmlWrapperFor(JsObject object) => object._dartHtmlWrapper;
+
+/**
+ * Set the dart wrapper object for object. Top-level so we
+ * we can access it from other libraries without it being
+ * a public instance field on JsObject.
+ */
+@Deprecated("Internal Use Only")
+void setDartHtmlWrapperFor(JsObject object, wrapper) {
+  object._dartHtmlWrapper = wrapper;
+}
+
+/**
+ * Used by callMethod to get the JS object for each argument passed if the
+ * argument is a Dart class instance that delegates to a DOM object.  See
+ * wrap_jso defined in dart:html.
+ */
+@Deprecated("Internal Use Only")
+unwrap_jso(dartClass_instance) {
+  if (dartClass_instance is html.DartHtmlDomObject &&
+      dartClass_instance is! JsObject) return dartClass_instance.blink_jsObject;
+  else return dartClass_instance;
+}
+
 /**
  * Proxies a JavaScript object to Dart.
  *
@@ -488,14 +905,26 @@
   JsObject.internal();
 
   /**
+   * If this JsObject is wrapped, e.g. DOM objects, then we can save the
+   * wrapper here and preserve its identity.
+   */
+  var _dartHtmlWrapper;
+
+  /**
    * Constructs a new JavaScript object from [constructor] and returns a proxy
    * to it.
    */
-  factory JsObject(JsFunction constructor, [List arguments]) =>
-      _create(constructor, arguments);
+  factory JsObject(JsFunction constructor, [List arguments]) {
+    try {
+      return html_common.unwrap_jso(_create(constructor, arguments));
+    } catch (e) {
+      // Re-throw any errors (returned as a string) as a DomException.
+      throw new html.DomException.jsInterop(e);
+    }
+  }
 
-  static JsObject _create(
-      JsFunction constructor, arguments) native "JsObject_constructorCallback";
+  static JsObject _create(JsFunction constructor, arguments)
+      native "JsObject_constructorCallback";
 
   _buildArgs(Invocation invocation) {
     if (invocation.namedArguments.isEmpty) {
@@ -517,7 +946,7 @@
    * Use this constructor only if you wish to get access to JavaScript
    * properties attached to a browser host object, such as a Node or Blob, that
    * is normally automatically converted into a native Dart object.
-   * 
+   *
    * An exception will be thrown if [object] either is `null` or has the type
    * `bool`, `num`, or `String`.
    */
@@ -546,8 +975,7 @@
 
   static JsObject _jsify(object) native "JsObject_jsify";
 
-  static JsObject _fromBrowserObject(
-      object) native "JsObject_fromBrowserObject";
+  static JsObject _fromBrowserObject(object) => html_common.unwrap_jso(object);
 
   /**
    * Returns the value associated with [property] from the proxied JavaScript
@@ -555,7 +983,16 @@
    *
    * The type of [property] must be either [String] or [num].
    */
-  operator [](property) native "JsObject_[]";
+  operator [](property) {
+    try {
+      return _maybeWrap(_operator_getter(property));
+    } catch (e) {
+      // Re-throw any errors (returned as a string) as a DomException.
+      throw new html.DomException.jsInterop(e);
+    }
+  }
+
+  _operator_getter(property) native "JsObject_[]";
 
   /**
    * Sets the value associated with [property] on the proxied JavaScript
@@ -563,14 +1000,30 @@
    *
    * The type of [property] must be either [String] or [num].
    */
-  operator []=(property, value) native "JsObject_[]=";
+  operator []=(property, value) {
+    try {
+      _operator_setter(property, value);
+    } catch (e) {
+      // Re-throw any errors (returned as a string) as a DomException.
+      throw new html.DomException.jsInterop(e);
+    }
+  }
+
+  _operator_setter(property, value) native "JsObject_[]=";
 
   int get hashCode native "JsObject_hashCode";
 
-  operator ==(other) => other is JsObject && _identityEquality(this, other);
+  operator ==(other) {
+    var is_JsObject = other is JsObject;
+    if (!is_JsObject) {
+      other = html_common.unwrap_jso(other);
+      is_JsObject = other is JsObject;
+    }
+    return is_JsObject && _identityEquality(this, other);
+  }
 
-  static bool _identityEquality(
-      JsObject a, JsObject b) native "JsObject_identityEquality";
+  static bool _identityEquality(JsObject a, JsObject b)
+      native "JsObject_identityEquality";
 
   /**
    * Returns `true` if the JavaScript object contains the specified property
@@ -615,10 +1068,11 @@
    */
   callMethod(String method, [List args]) {
     try {
-      return _callMethod(method, args);
+      return _maybeWrap(_callMethod(method, args));
     } catch (e) {
       if (hasProperty(method)) {
-        rethrow;
+        // Return a DomException if DOM call returned an error.
+        throw new html.DomException.jsInterop(e);
       } else {
         throw new NoSuchMethodError(this, new Symbol(method), args, null);
       }
@@ -678,6 +1132,30 @@
   _callMethod(String name, List args) native "JsObject_callMethod";
 }
 
+// JavaScript interop methods that do not automatically wrap to dart:html types.
+// Warning: this API is not exposed to dart:js.
+@Deprecated("Internal Use Only")
+class JsNative {
+  static getProperty(JsObject o, name) {
+    return o._operator_getter(name);
+  }
+
+  static callMethod(JsObject o, String method, List args) {
+    return o._callMethod(method, args);
+  }
+
+  static getArrayIndex(JsArray array, int index) {
+    array._checkIndex(index);
+    return getProperty(array, index);
+  }
+
+  /**
+   * Same behavior as new JsFunction.withThis except that JavaScript "this" is not
+   * wrapped.
+   */
+  static JsFunction withThis(Function f) native "JsFunction_withThisNoWrap";
+}
+
 /**
  * Proxies a JavaScript Function object.
  */
@@ -694,7 +1172,24 @@
    * Invokes the JavaScript function with arguments [args]. If [thisArg] is
    * supplied it is the value of `this` for the invocation.
    */
-  dynamic apply(List args, {thisArg}) native "JsFunction_apply";
+  dynamic apply(List args, {thisArg}) =>
+      _maybeWrap(_apply(args, thisArg: thisArg));
+
+  dynamic _apply(List args, {thisArg}) native "JsFunction_apply";
+
+  call([a1 = _UNDEFINED,
+        a2 = _UNDEFINED,
+        a3 = _UNDEFINED,
+        a4 = _UNDEFINED,
+        a5 = _UNDEFINED,
+        a6 = _UNDEFINED,
+        a7 = _UNDEFINED,
+        a8 = _UNDEFINED,
+        a9 = _UNDEFINED,
+        a10 = _UNDEFINED]) {
+    return apply(
+        _stripUndefinedArgs([a1, a2, a3, a4, a5, a6, a7, a8, a9, a10]));
+  }
 
   noSuchMethod(Invocation invocation) {
     if (invocation.isMethod && invocation.memberName == #call) {
@@ -709,8 +1204,8 @@
    * efficiently implemented in Dart2Js so should only be used by internal
    * tools.
    */
-  _applyDebuggerOnly(List args,
-      {thisArg}) native "JsFunction_applyDebuggerOnly";
+  _applyDebuggerOnly(List args, {thisArg})
+      native "JsFunction_applyDebuggerOnly";
 
   static JsFunction _withThis(Function f) native "JsFunction_withThis";
 }
@@ -728,8 +1223,8 @@
   factory JsArray.from(Iterable<E> other) =>
       _newJsArrayFromSafeList(new List.from(other));
 
-  static JsArray _newJsArrayFromSafeList(
-      List list) native "JsArray_newJsArrayFromSafeList";
+  static JsArray _newJsArrayFromSafeList(List list)
+      native "JsArray_newJsArrayFromSafeList";
 
   _checkIndex(int index, {bool insert: false}) {
     int length = insert ? this.length + 1 : this.length;
@@ -754,6 +1249,7 @@
     if (index is int) {
       _checkIndex(index);
     }
+
     return super[index];
   }
 
@@ -766,7 +1262,7 @@
 
   int get length native "JsArray_length";
 
-  void set length(int length) {
+  set length(int length) {
     super['length'] = length;
   }
 
@@ -830,8 +1326,57 @@
  * Returns a method that can be called with an arbitrary number (for n less
  * than 11) of arguments without violating Dart type checks.
  */
-Function _wrapAsDebuggerVarArgsFunction(JsFunction jsFunction) =>
-    ([a1 = _UNDEFINED, a2 = _UNDEFINED, a3 = _UNDEFINED, a4 = _UNDEFINED,
-        a5 = _UNDEFINED, a6 = _UNDEFINED, a7 = _UNDEFINED, a8 = _UNDEFINED,
-        a9 = _UNDEFINED, a10 = _UNDEFINED]) => jsFunction._applyDebuggerOnly(
-            _stripUndefinedArgs([a1, a2, a3, a4, a5, a6, a7, a8, a9, a10]));
+Function _wrapAsDebuggerVarArgsFunction(JsFunction jsFunction) => (
+        [a1 = _UNDEFINED,
+        a2 = _UNDEFINED,
+        a3 = _UNDEFINED,
+        a4 = _UNDEFINED,
+        a5 = _UNDEFINED,
+        a6 = _UNDEFINED,
+        a7 = _UNDEFINED,
+        a8 = _UNDEFINED,
+        a9 = _UNDEFINED,
+        a10 = _UNDEFINED]) =>
+    jsFunction._applyDebuggerOnly(
+        _stripUndefinedArgs([a1, a2, a3, a4, a5, a6, a7, a8, a9, a10]));
+
+// The allowInterop method is a no-op in Dartium.
+// TODO(jacobr): tag methods so we can throw if a Dart method is passed to
+// JavaScript using the new interop without calling allowInterop.
+
+/// Returns a wrapper around function [f] that can be called from JavaScript
+/// using the package:js Dart-JavaScript interop.
+///
+/// For performance reasons in Dart2Js, by default Dart functions cannot be
+/// passed directly to JavaScript unless this method is called to create
+/// a Function compatible with both Dart and JavaScript.
+/// Calling this method repeatedly on a function will return the same function.
+/// The [Function] returned by this method can be used from both Dart and
+/// JavaScript. We may remove the need to call this method completely in the
+/// future if Dart2Js is refactored so that its function calling conventions
+/// are more compatible with JavaScript.
+Function allowInterop(Function f) => f;
+
+Expando<JsFunction> _interopCaptureThisExpando = new Expando<JsFunction>();
+
+/// Returns a [Function] that when called from JavaScript captures its 'this'
+/// binding and calls [f] with the value of this passed as the first argument.
+/// When called from Dart, [null] will be passed as the first argument.
+///
+/// See the documention for [allowInterop]. This method should only be used with
+/// package:js Dart-JavaScript interop.
+Function allowInteropCaptureThis(Function f) {
+  if (f is JsFunction) {
+    // Behavior when the function is already a JS function is unspecified.
+    throw new ArgumentError(
+        "Function is already a JS function so cannot capture this.");
+    return f;
+  } else {
+    var ret = _interopCaptureThisExpando[f];
+    if (ret == null) {
+      ret = new JsFunction.withThis(f);
+      _interopCaptureThisExpando[f] = ret;
+    }
+    return ret;
+  }
+}
diff --git a/sdk/lib/mirrors/mirrors.dart b/sdk/lib/mirrors/mirrors.dart
index 3480cde..3ba8dcd 100644
--- a/sdk/lib/mirrors/mirrors.dart
+++ b/sdk/lib/mirrors/mirrors.dart
@@ -71,10 +71,14 @@
  */
 abstract class MirrorSystem {
   /**
-   * Returns an immutable map from URIs to mirrors for all libraries known
-   * to this mirror system. For a runtime mirror system, only libraries which
-   * are currently loaded are included, and repeated calls of this method may
-   * return different maps as libraries are loaded.
+   * All libraries known to the mirror system, indexed by their URI.
+   *
+   * Returns an unmodifiable map of the libraries with [LibraryMirror.uri] as
+   * keys.
+   *
+   * For a runtime mirror system, only libraries which are currently loaded
+   * are included, and repeated calls of this method may return different maps
+   * as libraries are loaded.
    */
   Map<Uri, LibraryMirror> get libraries;
 
@@ -90,6 +94,7 @@
 
   /**
    * A mirror on the isolate associated with this [MirrorSystem].
+   *
    * This may be null if this mirror system is not running.
    */
   IsolateMirror get isolate;
@@ -115,15 +120,16 @@
   external static String getName(Symbol symbol);
 
   /**
-   * Returns a symbol for [name]. If [library] is not a [LibraryMirror] or if
-   * [name] is a private identifier and [library] is [:null:], throws an
-   * [ArgumentError]. If [name] is a private identifier, the symbol returned is
-   * with respect to [library].
+   * Returns a symbol for [name].
+   *
+   * If [library] is not a [LibraryMirror] or if [name] is a private identifier
+   * and [library] is `null`, throws an [ArgumentError]. If [name] is a private
+   * identifier, the symbol returned is with respect to [library].
    *
    * The following text is non-normative:
    *
    * Using this method may result in larger output.  If possible, use
-   * the const constructor of Symbol or symbol literals.
+   * the const constructor of [Symbol] or symbol literals.
    */
   external static Symbol getSymbol(String name, [LibraryMirror library]);
 }
@@ -135,43 +141,42 @@
 
 /**
  * Reflects an instance.
- * Returns an [InstanceMirror] reflecting [reflectee].
- * If [reflectee] is a function or an instance of a class
- * that has a [:call:] method, the returned instance mirror
- * will be a [ClosureMirror].
  *
- * Note that since one cannot obtain an object from
- * another isolate, this function can only be used to
- * obtain  mirrors on objects of the current isolate.
+ * Returns an [InstanceMirror] reflecting [reflectee]. If [reflectee] is a
+ * function or an instance of a class that has a [:call:] method, the returned
+ * instance mirror will be a [ClosureMirror].
+ *
+ * Note that since one cannot obtain an object from another isolate, this
+ * function can only be used to obtain  mirrors on objects of the current
+ * isolate.
  */
 external InstanceMirror reflect(Object reflectee);
 
 /**
  * Reflects a class declaration.
- * Let *C* be the original class declaration of the class
- * represented by [key].
+ *
+ * Let *C* be the original class declaration of the class represented by [key].
  * This function returns a [ClassMirror] reflecting *C*.
  *
- * If [key] is not an instance of [Type] then this function
- * throws an [ArgumentError]. If [key] is the Type for dynamic
- * or a function typedef, throws an [ArgumentError].
+ * If [key] is not an instance of [Type], then this function throws an
+ * [ArgumentError]. If [key] is the Type for dynamic or a function typedef,
+ * throws an [ArgumentError].
  *
- * Note that since one cannot obtain a [Type] object from
- * another isolate, this function can only be used to
- * obtain class mirrors on classes of the current isolate.
+ * Note that since one cannot obtain a [Type] object from another isolate, this
+ * function can only be used to obtain class mirrors on classes of the current
+ * isolate.
  */
 external ClassMirror reflectClass(Type key);
 
 /**
- * This function returns a [TypeMirror] reflecting the type
- * represented by [key].
+ * Reflects the type represented by [key].
  *
- * If [key] is not an instance of [Type] then this function
- * throws an [ArgumentError].
+ * If [key] is not an instance of [Type], then this function throws an
+ * [ArgumentError].
  *
- * Note that since one cannot obtain a [Type] object from
- * another isolate, this function can only be used to
- * obtain type mirrors on types of the current isolate.
+ * Note that since one cannot obtain a [Type] object from another isolate, this
+ * function can only be used to obtain type mirrors on types of the current
+ * isolate.
  */
 external TypeMirror reflectType(Type key);
 
@@ -187,32 +192,28 @@
  */
 abstract class IsolateMirror implements Mirror {
   /**
-   * Returns a unique name used to refer to an isolate
-   * in debugging messages.
+   * A unique name used to refer to the isolate in debugging messages.
    */
   String get debugName;
 
   /**
-   * Returns [:true:] if and only if this mirror reflects
-   * the currently running isolate. Otherwise returns
-   * [:false:].
+   * Whether this mirror reflects the currently running isolate.
    */
   bool get isCurrent;
 
   /**
-   * Returns a [LibraryMirror] on the root library for this
-   * isolate.
+   * The root library for the reflected isolate.
    */
   LibraryMirror get rootLibrary;
 
   /**
-   * Returns [:true:] if this mirror is equal to [other].
-   * Otherwise returns [:false:].
+   * Whether [other] is an [IsolateMirror] on the same isolate as this mirror.
+   *
    * The equality holds if and only if
-   * (1) [other] is a mirror of the same kind
-   * and
-   * (2) the isolate being reflected by this mirror is the same
-   * isolate being reflected by [other].
+   *
+   * 1. [other] is a mirror of the same kind, and
+   * 2. the isolate being reflected by this mirror is the same isolate being
+   *    reflected by [other].
    */
   bool operator == (other);
 }
@@ -224,9 +225,9 @@
   /**
    * The simple name for this Dart language entity.
    *
-   * The simple name is in most cases the the identifier name of the
-   * entity, such as 'method' for a method [:void method() {...}:] or
-   * 'mylibrary' for a [:library 'mylibrary';:] declaration.
+   * The simple name is in most cases the the identifier name of the entity,
+   * such as 'myMethod' for a method, [:void myMethod() {...}:] or 'mylibrary'
+   * for a [:library 'mylibrary';:] declaration.
    */
   Symbol get simpleName;
 
@@ -253,39 +254,37 @@
   Symbol get qualifiedName;
 
   /**
-   * A mirror on the owner of this Dart language entity. This is the declaration
-   * immediately surrounding the reflectee.
+   * A mirror on the owner of this Dart language entity.
    *
-   * For a library, the owner is [:null:].
-   * For a class declaration, typedef or top level function
-   * or variable, the owner is the enclosing library.
-   * For a mixin application *S with M*, the owner is the owner
-   * of *M*.
-   * For a constructor, the owner is the immediately enclosing class.
-   * For a method, instance variable or
-   * a static variable, the owner is the immediately enclosing class,
-   * unless the class is a mixin application *S with M*, in which case
-   * the owner is *M*. Note that *M* may be an invocation of a generic.
-   * For a parameter, local variable or local function the owner is the
-   * immediately enclosing function.
+   * The owner is the declaration immediately surrounding the reflectee:
+   *
+   * * For a library, the owner is [:null:].
+   * * For a class declaration, typedef or top level function or variable, the
+   *   owner is the enclosing library.
+   * * For a mixin application `S with M`, the owner is the owner of `M`.
+   * * For a constructor, the owner is the immediately enclosing class.
+   * * For a method, instance variable or a static variable, the owner is the
+   *   immediately enclosing class, unless the class is a mixin application
+   *   `S with M`, in which case the owner is `M`. Note that `M` may be an
+   *   invocation of a generic.
+   * * For a parameter, local variable or local function the owner is the
+   *   immediately enclosing function.
    */
   DeclarationMirror get owner;
 
   /**
-   * Returns [:true:] if this declaration is considered private
-   * according to the Dart language specification.
-   * Always returns [: false :] if this declaration
-   * is a library.
-   * Otherwise return [:false:].
+   * Whether this declaration is library private.
    *
+   * Always returns `false` for a library declaration,
+   * otherwise returns `true` if the declaration's name starts with an
+   * underscore character (`_`), and `false` if it doesn't.
    */
   bool get isPrivate;
 
   /**
-   * Is this declaration top-level?
+   * Whether this declaration is top-level.
    *
-   * This is defined to be equivalent to:
-   *    [:mirror.owner != null && mirror.owner is LibraryMirror:]
+   * A declaration is considered top-level if its [owner] is a [LibraryMirror].
    */
   bool get isTopLevel;
 
@@ -293,20 +292,23 @@
    * The source location of this Dart language entity, or [:null:] if the
    * entity is synthetic.
    *
-   * If the reflectee is a variable, the returned location gives the position of   * the variable name at its point of declaration.
+   * If the reflectee is a variable, the returned location gives the position
+   * of the variable name at its point of declaration.
    *
    * If the reflectee is a library, class, typedef, function or type variable
    * with associated metadata, the returned location gives the position of the
    * first metadata declaration associated with the reflectee.
    *
    * Otherwise:
+   *
    * If the reflectee is a library, the returned location gives the position of
    * the keyword 'library' at the reflectee's point of declaration, if the
    * reflectee is a named library, or the first character of the first line in
    * the compilation unit defining the reflectee if the reflectee is anonymous.
    *
    * If the reflectee is an abstract class, the returned location gives the
-   * position of the keyword 'abstract' at the reflectee's point of declaration.   * Otherwise, if the reflectee is a class, the returned location gives the
+   * position of the keyword 'abstract' at the reflectee's point of declaration.
+   * Otherwise, if the reflectee is a class, the returned location gives the
    * position of the keyword 'class' at the reflectee's point of declaration.
    *
    * If the reflectee is a typedef the returned location gives the position of
@@ -359,24 +361,23 @@
   /**
    * Invokes the named function and returns a mirror on the result.
    *
-   * Let *o* be the object reflected by this mirror, let
-   * *f* be the simple name of the member denoted by [memberName],
-   * let *a1, ..., an* be the elements of [positionalArguments]
-   * let *k1, ..., km* be the identifiers denoted by the elements of
-   * [namedArguments.keys]
-   * and let *v1, ..., vm* be the elements of [namedArguments.values].
-   * Then this method will perform the method invocation
-   *  *o.f(a1, ..., an, k1: v1, ..., km: vm)*
-   * in a scope that has access to the private members
-   * of *o* (if *o* is a class or library) or the private members of the
-   * class of *o* (otherwise).
-   * If the invocation returns a result *r*, this method returns
-   * the result of calling [reflect]\(*r*\).
-   * If the invocation causes a compilation error
-   * the effect is the same as if a non-reflective compilation error
-   * had been encountered.
-   * If the invocation throws an exception *e* (that it does not catch)
-   * this method throws *e*.
+   * Let *o* be the object reflected by this mirror, let *f* be the simple name
+   * of the member denoted by [memberName], let *a1, ..., an* be the elements
+   * of [positionalArguments], let *k1, ..., km* be the identifiers denoted by
+   * the elements of [namedArguments.keys], and let *v1, ..., vm* be the
+   * elements of [namedArguments.values]. Then this method will perform the
+   * method invocation *o.f(a1, ..., an, k1: v1, ..., km: vm)* in a scope that
+   * has access to the private members of *o* (if *o* is a class or library) or
+   * the private members of the class of *o* (otherwise).
+   *
+   * If the invocation returns a result *r*, this method returns the result of
+   * calling [reflect]\(*r*\).
+   *
+   * If the invocation causes a compilation error the effect is the same as if
+   * a non-reflective compilation error had been encountered.
+   *
+   * If the invocation throws an exception *e* (that it does not catch), this
+   * method throws *e*.
    */
   /*
    * TODO(turnidge): Handle ambiguous names.
@@ -387,17 +388,17 @@
                         [Map<Symbol,dynamic> namedArguments]);
 
   /**
-   * Invokes a getter and returns a mirror on the result. The getter
-   * can be the implicit getter for a field or a user-defined getter
+   * Invokes a getter and returns a mirror on the result.
+   *
+   * The getter can be the implicit getter for a field or a user-defined getter
    * method.
    *
-   * Let *o* be the object reflected by this mirror, let
-   * *f* be the simple name of the getter denoted by [fieldName],
-   * Then this method will perform the getter invocation
-   *  *o.f*
-   * in a scope that has access to the private members
-   * of *o* (if *o* is a class or library) or the private members of the
-   * class of *o* (otherwise).
+   * Let *o* be the object reflected by this mirror,
+   * let *f* be the simple name of the getter denoted by [fieldName].
+   *
+   * Then this method will perform the getter invocation *o.f* in a scope that
+   * has access to the private members of *o* (if *o* is a class or library) or
+   * the private members of the class of *o* (otherwise).
    *
    * If this mirror is an [InstanceMirror], and [fieldName] denotes an instance
    * method on its reflectee, the result of the invocation is an instance
@@ -411,44 +412,48 @@
    * in the corresponding class, the result of the invocation is an instance
    * mirror on a closure corresponding to that method.
    *
-   * If the invocation returns a result *r*, this method returns
-   * the result of calling [reflect]\(*r*\).
-   * If the invocation causes a compilation error
-   * the effect is the same as if a non-reflective compilation error
-   * had been encountered.
-   * If the invocation throws an exception *e* (that it does not catch)
-   * this method throws *e*.
+   * If the invocation returns a result *r*, this method returns the result of
+   * calling [reflect]\(*r*\).
+   *
+   * If the invocation causes a compilation error, the effect is the same as if
+   * a non-reflective compilation error had been encountered.
+   *
+   * If the invocation throws an exception *e* (that it does not catch), this
+   * method throws *e*.
    */
   // TODO(ahe): Remove stuff about scope and private members. [fieldName] is a
   // capability giving access to private members.
   InstanceMirror getField(Symbol fieldName);
 
   /**
-   * Invokes a setter and returns a mirror on the result. The setter
-   * may be either the implicit setter for a non-final field or a
+   * Invokes a setter and returns a mirror on the result.
+   *
+   * The setter may be either the implicit setter for a non-final field or a
    * user-defined setter method.
    *
-   * Let *o* be the object reflected by this mirror, let
-   * *f* be the simple name of the getter denoted by [fieldName],
+   * Let *o* be the object reflected by this mirror,
+   * let *f* be the simple name of the getter denoted by [fieldName],
    * and let *a* be the object bound to [value].
-   * Then this method will perform the setter invocation
-   * *o.f = a*
-   * in a scope that has access to the private members
-   * of *o* (if *o* is a class or library) or the private members of the
-   * class of *o* (otherwise).
-   * If the invocation returns a result *r*, this method returns
-   * the result of calling [reflect]\([value]\).
-   * If the invocation causes a compilation error
-   * the effect is the same as if a non-reflective compilation error
-   * had been encountered.
-   * If the invocation throws an exception *e* (that it does not catch)
-   * this method throws *e*.
+   *
+   * Then this method will perform the setter invocation *o.f = a* in a scope
+   * that has access to the private members of *o* (if *o* is a class or
+   * library) or the private members of the class of *o* (otherwise).
+   *
+   * If the invocation returns a result *r*, this method returns the result of
+   * calling [reflect]\([value]\).
+   *
+   * If the invocation causes a compilation error, the effect is the same as if
+   * a non-reflective compilation error had been encountered.
+   *
+   * If the invocation throws an exception *e* (that it does not catch) this
+   * method throws *e*.
    */
   /* TODO(turnidge): Handle ambiguous names.*/
   InstanceMirror setField(Symbol fieldName, Object value);
 
   /**
-   * Perform [invocation] on [reflectee].
+   * Performs [invocation] on [reflectee].
+   *
    * Equivalent to
    *
    *     if (invocation.isGetter) {
@@ -480,16 +485,18 @@
   ClassMirror get type;
 
   /**
-   * Does [reflectee] contain the instance reflected by this mirror?
-   * This will always be true in the local case (reflecting instances
-   * in the same isolate), but only true in the remote case if this
-   * mirror reflects a simple value.
+   * Whether [reflectee] will return the instance reflected by this mirror.
+   *
+   * This will always be true in the local case (reflecting instances in the
+   * same isolate), but only true in the remote case if this mirror reflects a
+   * simple value.
    *
    * A value is simple if one of the following holds:
-   *  - the value is [:null:]
-   *  - the value is of type [num]
-   *  - the value is of type [bool]
-   *  - the value is of type [String]
+   *
+   * * the value is [:null:]
+   * * the value is of type [num]
+   * * the value is of type [bool]
+   * * the value is of type [String]
    */
   bool get hasReflectee;
 
@@ -504,16 +511,18 @@
   get reflectee;
 
   /**
-   * Returns true if this mirror is equal to [other].
+   * Whether this mirror is equal to [other].
+   *
    * The equality holds if and only if
-   * (1) [other] is a mirror of the same kind
-   * and
-   * (2) either
-   * (a) [hasReflectee] is true and so is
-   * [:identical(reflectee, other.reflectee):]
-   * or
-   * (b) the remote objects reflected by this mirror and
-   * by [other] are identical.
+   *
+   * 1. [other] is a mirror of the same kind, and
+   * 2. either
+   *
+   *    a. [hasReflectee] is true and so is
+   *    [:identical(reflectee, other.reflectee):], or
+   *
+   *    b. the remote objects reflected by this mirror and by [other] are
+   *    identical.
    */
   bool operator == (other);
 }
@@ -548,20 +557,24 @@
 
   /**
    * Executes the closure and returns a mirror on the result.
+   *
    * Let *f* be the closure reflected by this mirror,
-   * let *a1, ..., an* be the elements of [positionalArguments]
+   * let *a1, ..., an* be the elements of [positionalArguments],
    * let *k1, ..., km* be the identifiers denoted by the elements of
-   * [namedArguments.keys]
+   * [namedArguments.keys],
    * and let *v1, ..., vm* be the elements of [namedArguments.values].
+   *
    * Then this method will perform the method invocation
-   *  *f(a1, ..., an, k1: v1, ..., km: vm)*
-   * If the invocation returns a result *r*, this method returns
-   * the result of calling [reflect]\(*r*\).
-   * If the invocation causes a compilation error
-   * the effect is the same as if a non-reflective compilation error
-   * had been encountered.
-   * If the invocation throws an exception *e* (that it does not catch)
-   * this method throws *e*.
+   * *f(a1, ..., an, k1: v1, ..., km: vm)*.
+   *
+   * If the invocation returns a result *r*, this method returns the result of
+   * calling [reflect]\(*r*\).
+   *
+   * If the invocation causes a compilation error, the effect is the same as if
+   * a non-reflective compilation error had been encountered.
+   *
+   * If the invocation throws an exception *e* (that it does not catch), this
+   * method throws *e*.
    */
   InstanceMirror apply(List positionalArguments,
                        [Map<Symbol, dynamic> namedArguments]);
@@ -588,18 +601,15 @@
   Map<Symbol, DeclarationMirror> get declarations;
 
   /**
-   * Returns [:true:] if this mirror is equal to [other].
-   * Otherwise returns [:false:].
+   * Whether this mirror is equal to [other].
    *
    * The equality holds if and only if
-   * (1) [other] is a mirror of the same kind
-   * and
-   * (2)  The library being reflected by this mirror
-   * and the library being reflected by [other]
-   * are
-   * the same library in the same isolate.
+   *
+   * 1. [other] is a mirror of the same kind, and
+   * 2. The library being reflected by this mirror and the library being
+   *    reflected by [other] are the same library in the same isolate.
    */
-   bool operator ==(other);
+  bool operator ==(other);
 
   /**
    * Returns a list of the imports and exports in this library;
@@ -726,15 +736,18 @@
 
 
   /**
-   * Checks the subtype relationship, denoted by [:<::] in the language
-   * specification. This is the type relationship used in [:is:] test checks.
+   * Checks the subtype relationship, denoted by `<:` in the language
+   * specification.
+   *
+   * This is the type relationship used in `is` test checks.
    */
   bool isSubtypeOf(TypeMirror other);
 
   /**
-   * Checks the assignability relationship, denoted by [:<=>:] in the language
-   * specification. This is the type relationship tested on assignment in
-   * checked mode.
+   * Checks the assignability relationship, denoted by `<=>` in the language
+   * specification.
+   *
+   * This is the type relationship tested on assignment in checked mode.
    */
   bool isAssignableTo(TypeMirror other);
 }
@@ -806,9 +819,10 @@
 
   /**
    * The mixin of this class.
-   * If this class is the result of a mixin application of the
-   * form S with M, returns a class mirror on M.
-   * Otherwise returns a class mirror on [reflectee].
+   *
+   * If this class is the result of a mixin application of the form S with M,
+   * returns a class mirror on M. Otherwise returns a class mirror on
+   * [reflectee].
    */
   ClassMirror get mixin;
 
@@ -817,52 +831,50 @@
   // /// reflected class.
   // DeclarationMirror instanceLookup(Symbol name);
 
-   /**
+  /**
    * Invokes the named constructor and returns a mirror on the result.
    *
-   * Let *c* be the class reflected by this mirror
-   * let *a1, ..., an* be the elements of [positionalArguments]
+   * Let *c* be the class reflected by this mirror,
+   * let *a1, ..., an* be the elements of [positionalArguments],
    * let *k1, ..., km* be the identifiers denoted by the elements of
-   * [namedArguments.keys]
+   * [namedArguments.keys],
    * and let *v1, ..., vm* be the elements of [namedArguments.values].
-   * If [constructorName] was created from the empty string
-   * Then this method will execute the instance creation expression
-   * *new c(a1, ..., an, k1: v1, ..., km: vm)*
-   * in a scope that has access to the private members
-   * of *c*. Otherwise, let
-   * *f* be the simple name of the constructor denoted by [constructorName]
-   * Then this method will execute the instance creation expression
-   *  *new c.f(a1, ..., an, k1: v1, ..., km: vm)*
-   * in a scope that has access to the private members
-   * of *c*.
+   *
+   * If [constructorName] was created from the empty string, then this method
+   * will execute the instance creation expression
+   * *new c(a1, ..., an, k1: v1, ..., km: vm)* in a scope that has access to
+   * the private members of *c*.
+   *
+   * Otherwise, let *f* be the simple name of the constructor denoted by
+   * [constructorName]. Then this method will execute the instance creation
+   * expression *new c.f(a1, ..., an, k1: v1, ..., km: vm)* in a scope that has
+   * access to the private members of *c*.
+   *
    * In either case:
-   * If the expression evaluates to a result *r*, this method returns
-   * the result of calling [reflect]\(*r*\).
-   * If evaluating the expression causes a compilation error
-   * the effect is the same as if a non-reflective compilation error
-   * had been encountered.
-   * If evaluating the expression throws an exception *e*
-   * (that it does not catch)
-   * this method throws *e*.
+   *
+   * * If the expression evaluates to a result *r*, this method returns the
+   *   result of calling [reflect]\(*r*\).
+   * * If evaluating the expression causes a compilation error, the effect is
+   *   the same as if a non-reflective compilation error had been encountered.
+   * * If evaluating the expression throws an exception *e* (that it does not
+   *   catch), this method throws *e*.
    */
   InstanceMirror newInstance(Symbol constructorName,
                              List positionalArguments,
                              [Map<Symbol,dynamic> namedArguments]);
 
   /**
-   * Returns [:true:] if this mirror is equal to [other].
-   * Otherwise returns [:false:].
+   * Whether this mirror is equal to [other].
    *
    * The equality holds if and only if
-   * (1) [other] is a mirror of the same kind
-   * and
-   * (2) This mirror and [other] reflect the same class.
    *
-   * Note that if the reflected class is an invocation of
-   * a generic class,(2) implies that the reflected class
-   * and [other] have equal type arguments.
+   * 1. [other] is a mirror of the same kind, and
+   * 2. This mirror and [other] reflect the same class.
+   *
+   * Note that if the reflected class is an invocation of a generic class, 2.
+   * implies that the reflected class and [other] have equal type arguments.
    */
-   bool operator == (other);
+  bool operator == (other);
 
   /**
    * Returns whether the class denoted by the receiver is a subclass of the
@@ -897,8 +909,7 @@
 }
 
 /**
- * A [TypeVariableMirror] represents a type parameter of a generic
- * type.
+ * A [TypeVariableMirror] represents a type parameter of a generic type.
  */
 abstract class TypeVariableMirror extends TypeMirror {
   /**
@@ -915,16 +926,15 @@
   bool get isStatic;
 
   /**
-   * Returns [:true:] if this mirror is equal to [other].
-   * Otherwise returns [:false:].
+   * Whether [other] is a [TypeVariableMirror] on the same type variable as this
+   * mirror.
    *
    * The equality holds if and only if
-   * (1) [other] is a mirror of the same kind
-   * and
-   * (2)  [:simpleName == other.simpleName:] and
-   * [:owner == other.owner:].
+   *
+   * 1. [other] is a mirror of the same kind, and
+   * 2. [:simpleName == other.simpleName:] and [:owner == other.owner:].
    */
-   bool operator == (other);
+  bool operator == (other);
 }
 
 /**
@@ -933,11 +943,10 @@
 abstract class TypedefMirror implements TypeMirror {
   /**
    * The defining type for this typedef.
-   * If the 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*.
    *
+   * If the 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):].
    */
   FunctionTypeMirror get referent;
@@ -1046,15 +1055,14 @@
   bool get isFactoryConstructor;
 
   /**
-   * Returns true if this mirror is equal to [other].
+   * Whether this mirror is equal to [other].
    *
    * The equality holds if and only if
-   * (1) [other] is a mirror of the same kind
-   * and
-   * (2) [:simpleName == other.simpleName:] and
-   * [:owner == other.owner:].
+   *
+   * 1. [other] is a mirror of the same kind, and
+   * 2. [:simpleName == other.simpleName:] and [:owner == other.owner:].
    */
-   bool operator == (other);
+  bool operator == (other);
 }
 
 /**
@@ -1088,15 +1096,14 @@
   bool get isConst;
 
   /**
-   * Returns true if this mirror is equal to [other].
+   * Whether this mirror is equal to [other].
    *
    * The equality holds if and only if
-   * (1) [other] is a mirror of the same kind
-   * and
-   * (2)  [:simpleName == other.simpleName:] and
-   * [:owner == other.owner:].
+   *
+   * 1. [other] is a mirror of the same kind, and
+   * 2. [:simpleName == other.simpleName:] and [:owner == other.owner:].
    */
-   bool operator == (other);
+  bool operator == (other);
 }
 
 /**
@@ -1127,10 +1134,14 @@
   bool get hasDefaultValue;
 
   /**
-   * If this is a required parameter, returns [:null:]. Otherwise returns a
-   * mirror on the default value for this parameter. If no default is declared
-   * for an optional parameter, the default is [:null:] and a mirror on [:null:]
-   * is returned.
+   * Returns the default value of an optional parameter.
+   *
+   * Returns an [InstanceMirror] on the (compile-time constant)
+   * default value for an optional parameter.
+   * If no default value is declared, it defaults to `null`
+   * and a mirror of `null` is returned.
+   *
+   * Returns `null` for a required parameter.
    */
   InstanceMirror get defaultValue;
 }
diff --git a/sdk/lib/svg/dart2js/svg_dart2js.dart b/sdk/lib/svg/dart2js/svg_dart2js.dart
index 1e63bd2..5cb2ace 100644
--- a/sdk/lib/svg/dart2js/svg_dart2js.dart
+++ b/sdk/lib/svg/dart2js/svg_dart2js.dart
@@ -10,7 +10,7 @@
 
 import 'dart:async';
 import 'dart:collection';
-import 'dart:_internal' hide deprecated;
+import 'dart:_internal';
 import 'dart:html';
 import 'dart:html_common';
 import 'dart:_js_helper' show Creates, Returns, JSName, Native;
@@ -2693,7 +2693,7 @@
   // Length is the element type.
 
 
-  void set length(int value) {
+  set length(int value) {
     throw new UnsupportedError("Cannot resize immutable List.");
   }
 
@@ -3145,7 +3145,7 @@
   // Number is the element type.
 
 
-  void set length(int value) {
+  set length(int value) {
     throw new UnsupportedError("Cannot resize immutable List.");
   }
 
@@ -3932,7 +3932,7 @@
   // PathSeg is the element type.
 
 
-  void set length(int value) {
+  set length(int value) {
     throw new UnsupportedError("Cannot resize immutable List.");
   }
 
@@ -4627,7 +4627,7 @@
   // String is the element type.
 
 
-  void set length(int value) {
+  set length(int value) {
     throw new UnsupportedError("Cannot resize immutable List.");
   }
 
@@ -4731,7 +4731,7 @@
   // Shadowing definition.
   String get title => JS("String", "#.title", this);
 
-  void set title(String value) {
+  set title(String value) {
     JS("void", "#.title = #", this, value);
   }
 
@@ -4801,7 +4801,7 @@
 
   List<Element> get children => new FilteredElementList(this);
 
-  void set children(List<Element> value) {
+  set children(List<Element> value) {
     final children = this.children;
     children.clear();
     children.addAll(value);
@@ -4821,7 +4821,7 @@
     return container.innerHtml;
   }
 
-  void set innerHtml(String value) {
+  set innerHtml(String value) {
     this.setInnerHtml(value);
   }
 
@@ -4886,6 +4886,7 @@
     var e = new SvgElement.tag(tag);
     return e is SvgElement && !(e is UnknownElement);
   }
+
   // To suppress missing implicit constructor warnings.
   factory SvgElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -5169,7 +5170,7 @@
   // Shadowing definition.
   int get tabIndex => JS("int", "#.tabIndex", this);
 
-  void set tabIndex(int value) {
+  set tabIndex(int value) {
     JS("void", "#.tabIndex = #", this, value);
   }
 
@@ -6082,7 +6083,7 @@
   // Transform is the element type.
 
 
-  void set length(int value) {
+  set length(int value) {
     throw new UnsupportedError("Cannot resize immutable List.");
   }
 
@@ -6536,7 +6537,9 @@
   // From SVGTests
 
   // From SVGURIReference
+
 }
+
 // Copyright (c) 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.
@@ -6557,7 +6560,9 @@
   _SVGFEDropShadowElement.created() : super.created();
 
   // From SVGFilterPrimitiveStandardAttributes
+
 }
+
 // Copyright (c) 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.
@@ -6715,7 +6720,9 @@
   _SVGGlyphRefElement.created() : super.created();
 
   // From SVGURIReference
+
 }
+
 // Copyright (c) 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.
@@ -6762,7 +6769,9 @@
   _SVGMPathElement.created() : super.created();
 
   // From SVGURIReference
+
 }
+
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
diff --git a/sdk/lib/svg/dartium/svg_dartium.dart b/sdk/lib/svg/dartium/svg_dartium.dart
index 8d52279..c093cab 100644
--- a/sdk/lib/svg/dartium/svg_dartium.dart
+++ b/sdk/lib/svg/dartium/svg_dartium.dart
@@ -10,11 +10,12 @@
 
 import 'dart:async';
 import 'dart:collection';
-import 'dart:_internal' hide deprecated;
+import 'dart:_internal';
 import 'dart:html';
 import 'dart:html_common';
 import 'dart:nativewrappers';
 import 'dart:_blink' as _blink;
+import 'dart:js' as js;
 // DO NOT EDIT
 // Auto-generated dart:svg library.
 
@@ -23,6 +24,7 @@
 
 
 // FIXME: Can we make this private?
+@Deprecated("Internal Use Only")
 final svgBlinkMap = {
   'SVGAElement': () => AElement,
   'SVGAltGlyphDefElement': () => _SVGAltGlyphDefElement,
@@ -169,6 +171,148 @@
 
 };
 
+// FIXME: Can we make this private?
+@Deprecated("Internal Use Only")
+final svgBlinkFunctionMap = {
+  'SVGAElement': () => AElement.internalCreateAElement,
+  'SVGAltGlyphDefElement': () => _SVGAltGlyphDefElement.internalCreate_SVGAltGlyphDefElement,
+  'SVGAltGlyphElement': () => AltGlyphElement.internalCreateAltGlyphElement,
+  'SVGAltGlyphItemElement': () => _SVGAltGlyphItemElement.internalCreate_SVGAltGlyphItemElement,
+  'SVGAngle': () => Angle.internalCreateAngle,
+  'SVGAnimateElement': () => AnimateElement.internalCreateAnimateElement,
+  'SVGAnimateMotionElement': () => AnimateMotionElement.internalCreateAnimateMotionElement,
+  'SVGAnimateTransformElement': () => AnimateTransformElement.internalCreateAnimateTransformElement,
+  'SVGAnimatedAngle': () => AnimatedAngle.internalCreateAnimatedAngle,
+  'SVGAnimatedBoolean': () => AnimatedBoolean.internalCreateAnimatedBoolean,
+  'SVGAnimatedEnumeration': () => AnimatedEnumeration.internalCreateAnimatedEnumeration,
+  'SVGAnimatedInteger': () => AnimatedInteger.internalCreateAnimatedInteger,
+  'SVGAnimatedLength': () => AnimatedLength.internalCreateAnimatedLength,
+  'SVGAnimatedLengthList': () => AnimatedLengthList.internalCreateAnimatedLengthList,
+  'SVGAnimatedNumber': () => AnimatedNumber.internalCreateAnimatedNumber,
+  'SVGAnimatedNumberList': () => AnimatedNumberList.internalCreateAnimatedNumberList,
+  'SVGAnimatedPreserveAspectRatio': () => AnimatedPreserveAspectRatio.internalCreateAnimatedPreserveAspectRatio,
+  'SVGAnimatedRect': () => AnimatedRect.internalCreateAnimatedRect,
+  'SVGAnimatedString': () => AnimatedString.internalCreateAnimatedString,
+  'SVGAnimatedTransformList': () => AnimatedTransformList.internalCreateAnimatedTransformList,
+  'SVGAnimationElement': () => AnimationElement.internalCreateAnimationElement,
+  'SVGCircleElement': () => CircleElement.internalCreateCircleElement,
+  'SVGClipPathElement': () => ClipPathElement.internalCreateClipPathElement,
+  'SVGComponentTransferFunctionElement': () => _SVGComponentTransferFunctionElement.internalCreate_SVGComponentTransferFunctionElement,
+  'SVGCursorElement': () => _SVGCursorElement.internalCreate_SVGCursorElement,
+  'SVGDefsElement': () => DefsElement.internalCreateDefsElement,
+  'SVGDescElement': () => DescElement.internalCreateDescElement,
+  'SVGDiscardElement': () => DiscardElement.internalCreateDiscardElement,
+  'SVGElement': () => SvgElement.internalCreateSvgElement,
+  'SVGEllipseElement': () => EllipseElement.internalCreateEllipseElement,
+  'SVGFEBlendElement': () => FEBlendElement.internalCreateFEBlendElement,
+  'SVGFEColorMatrixElement': () => FEColorMatrixElement.internalCreateFEColorMatrixElement,
+  'SVGFEComponentTransferElement': () => FEComponentTransferElement.internalCreateFEComponentTransferElement,
+  'SVGFECompositeElement': () => FECompositeElement.internalCreateFECompositeElement,
+  'SVGFEConvolveMatrixElement': () => FEConvolveMatrixElement.internalCreateFEConvolveMatrixElement,
+  'SVGFEDiffuseLightingElement': () => FEDiffuseLightingElement.internalCreateFEDiffuseLightingElement,
+  'SVGFEDisplacementMapElement': () => FEDisplacementMapElement.internalCreateFEDisplacementMapElement,
+  'SVGFEDistantLightElement': () => FEDistantLightElement.internalCreateFEDistantLightElement,
+  'SVGFEDropShadowElement': () => _SVGFEDropShadowElement.internalCreate_SVGFEDropShadowElement,
+  'SVGFEFloodElement': () => FEFloodElement.internalCreateFEFloodElement,
+  'SVGFEFuncAElement': () => FEFuncAElement.internalCreateFEFuncAElement,
+  'SVGFEFuncBElement': () => FEFuncBElement.internalCreateFEFuncBElement,
+  'SVGFEFuncGElement': () => FEFuncGElement.internalCreateFEFuncGElement,
+  'SVGFEFuncRElement': () => FEFuncRElement.internalCreateFEFuncRElement,
+  'SVGFEGaussianBlurElement': () => FEGaussianBlurElement.internalCreateFEGaussianBlurElement,
+  'SVGFEImageElement': () => FEImageElement.internalCreateFEImageElement,
+  'SVGFEMergeElement': () => FEMergeElement.internalCreateFEMergeElement,
+  'SVGFEMergeNodeElement': () => FEMergeNodeElement.internalCreateFEMergeNodeElement,
+  'SVGFEMorphologyElement': () => FEMorphologyElement.internalCreateFEMorphologyElement,
+  'SVGFEOffsetElement': () => FEOffsetElement.internalCreateFEOffsetElement,
+  'SVGFEPointLightElement': () => FEPointLightElement.internalCreateFEPointLightElement,
+  'SVGFESpecularLightingElement': () => FESpecularLightingElement.internalCreateFESpecularLightingElement,
+  'SVGFESpotLightElement': () => FESpotLightElement.internalCreateFESpotLightElement,
+  'SVGFETileElement': () => FETileElement.internalCreateFETileElement,
+  'SVGFETurbulenceElement': () => FETurbulenceElement.internalCreateFETurbulenceElement,
+  'SVGFilterElement': () => FilterElement.internalCreateFilterElement,
+  'SVGFontElement': () => _SVGFontElement.internalCreate_SVGFontElement,
+  'SVGFontFaceElement': () => _SVGFontFaceElement.internalCreate_SVGFontFaceElement,
+  'SVGFontFaceFormatElement': () => _SVGFontFaceFormatElement.internalCreate_SVGFontFaceFormatElement,
+  'SVGFontFaceNameElement': () => _SVGFontFaceNameElement.internalCreate_SVGFontFaceNameElement,
+  'SVGFontFaceSrcElement': () => _SVGFontFaceSrcElement.internalCreate_SVGFontFaceSrcElement,
+  'SVGFontFaceUriElement': () => _SVGFontFaceUriElement.internalCreate_SVGFontFaceUriElement,
+  'SVGForeignObjectElement': () => ForeignObjectElement.internalCreateForeignObjectElement,
+  'SVGGElement': () => GElement.internalCreateGElement,
+  'SVGGeometryElement': () => GeometryElement.internalCreateGeometryElement,
+  'SVGGlyphElement': () => _SVGGlyphElement.internalCreate_SVGGlyphElement,
+  'SVGGlyphRefElement': () => _SVGGlyphRefElement.internalCreate_SVGGlyphRefElement,
+  'SVGGradientElement': () => _GradientElement.internalCreate_GradientElement,
+  'SVGGraphicsElement': () => GraphicsElement.internalCreateGraphicsElement,
+  'SVGHKernElement': () => _SVGHKernElement.internalCreate_SVGHKernElement,
+  'SVGImageElement': () => ImageElement.internalCreateImageElement,
+  'SVGLength': () => Length.internalCreateLength,
+  'SVGLengthList': () => LengthList.internalCreateLengthList,
+  'SVGLineElement': () => LineElement.internalCreateLineElement,
+  'SVGLinearGradientElement': () => LinearGradientElement.internalCreateLinearGradientElement,
+  'SVGMPathElement': () => _SVGMPathElement.internalCreate_SVGMPathElement,
+  'SVGMarkerElement': () => MarkerElement.internalCreateMarkerElement,
+  'SVGMaskElement': () => MaskElement.internalCreateMaskElement,
+  'SVGMatrix': () => Matrix.internalCreateMatrix,
+  'SVGMetadataElement': () => MetadataElement.internalCreateMetadataElement,
+  'SVGMissingGlyphElement': () => _SVGMissingGlyphElement.internalCreate_SVGMissingGlyphElement,
+  'SVGNumber': () => Number.internalCreateNumber,
+  'SVGNumberList': () => NumberList.internalCreateNumberList,
+  'SVGPathElement': () => PathElement.internalCreatePathElement,
+  'SVGPathSeg': () => PathSeg.internalCreatePathSeg,
+  'SVGPathSegArcAbs': () => PathSegArcAbs.internalCreatePathSegArcAbs,
+  'SVGPathSegArcRel': () => PathSegArcRel.internalCreatePathSegArcRel,
+  'SVGPathSegClosePath': () => PathSegClosePath.internalCreatePathSegClosePath,
+  'SVGPathSegCurvetoCubicAbs': () => PathSegCurvetoCubicAbs.internalCreatePathSegCurvetoCubicAbs,
+  'SVGPathSegCurvetoCubicRel': () => PathSegCurvetoCubicRel.internalCreatePathSegCurvetoCubicRel,
+  'SVGPathSegCurvetoCubicSmoothAbs': () => PathSegCurvetoCubicSmoothAbs.internalCreatePathSegCurvetoCubicSmoothAbs,
+  'SVGPathSegCurvetoCubicSmoothRel': () => PathSegCurvetoCubicSmoothRel.internalCreatePathSegCurvetoCubicSmoothRel,
+  'SVGPathSegCurvetoQuadraticAbs': () => PathSegCurvetoQuadraticAbs.internalCreatePathSegCurvetoQuadraticAbs,
+  'SVGPathSegCurvetoQuadraticRel': () => PathSegCurvetoQuadraticRel.internalCreatePathSegCurvetoQuadraticRel,
+  'SVGPathSegCurvetoQuadraticSmoothAbs': () => PathSegCurvetoQuadraticSmoothAbs.internalCreatePathSegCurvetoQuadraticSmoothAbs,
+  'SVGPathSegCurvetoQuadraticSmoothRel': () => PathSegCurvetoQuadraticSmoothRel.internalCreatePathSegCurvetoQuadraticSmoothRel,
+  'SVGPathSegLinetoAbs': () => PathSegLinetoAbs.internalCreatePathSegLinetoAbs,
+  'SVGPathSegLinetoHorizontalAbs': () => PathSegLinetoHorizontalAbs.internalCreatePathSegLinetoHorizontalAbs,
+  'SVGPathSegLinetoHorizontalRel': () => PathSegLinetoHorizontalRel.internalCreatePathSegLinetoHorizontalRel,
+  'SVGPathSegLinetoRel': () => PathSegLinetoRel.internalCreatePathSegLinetoRel,
+  'SVGPathSegLinetoVerticalAbs': () => PathSegLinetoVerticalAbs.internalCreatePathSegLinetoVerticalAbs,
+  'SVGPathSegLinetoVerticalRel': () => PathSegLinetoVerticalRel.internalCreatePathSegLinetoVerticalRel,
+  'SVGPathSegList': () => PathSegList.internalCreatePathSegList,
+  'SVGPathSegMovetoAbs': () => PathSegMovetoAbs.internalCreatePathSegMovetoAbs,
+  'SVGPathSegMovetoRel': () => PathSegMovetoRel.internalCreatePathSegMovetoRel,
+  'SVGPatternElement': () => PatternElement.internalCreatePatternElement,
+  'SVGPoint': () => Point.internalCreatePoint,
+  'SVGPointList': () => PointList.internalCreatePointList,
+  'SVGPolygonElement': () => PolygonElement.internalCreatePolygonElement,
+  'SVGPolylineElement': () => PolylineElement.internalCreatePolylineElement,
+  'SVGPreserveAspectRatio': () => PreserveAspectRatio.internalCreatePreserveAspectRatio,
+  'SVGRadialGradientElement': () => RadialGradientElement.internalCreateRadialGradientElement,
+  'SVGRect': () => Rect.internalCreateRect,
+  'SVGRectElement': () => RectElement.internalCreateRectElement,
+  'SVGRenderingIntent': () => RenderingIntent.internalCreateRenderingIntent,
+  'SVGSVGElement': () => SvgSvgElement.internalCreateSvgSvgElement,
+  'SVGScriptElement': () => ScriptElement.internalCreateScriptElement,
+  'SVGSetElement': () => SetElement.internalCreateSetElement,
+  'SVGStopElement': () => StopElement.internalCreateStopElement,
+  'SVGStringList': () => StringList.internalCreateStringList,
+  'SVGStyleElement': () => StyleElement.internalCreateStyleElement,
+  'SVGSwitchElement': () => SwitchElement.internalCreateSwitchElement,
+  'SVGSymbolElement': () => SymbolElement.internalCreateSymbolElement,
+  'SVGTSpanElement': () => TSpanElement.internalCreateTSpanElement,
+  'SVGTextContentElement': () => TextContentElement.internalCreateTextContentElement,
+  'SVGTextElement': () => TextElement.internalCreateTextElement,
+  'SVGTextPathElement': () => TextPathElement.internalCreateTextPathElement,
+  'SVGTextPositioningElement': () => TextPositioningElement.internalCreateTextPositioningElement,
+  'SVGTitleElement': () => TitleElement.internalCreateTitleElement,
+  'SVGTransform': () => Transform.internalCreateTransform,
+  'SVGTransformList': () => TransformList.internalCreateTransformList,
+  'SVGUnitTypes': () => UnitTypes.internalCreateUnitTypes,
+  'SVGUseElement': () => UseElement.internalCreateUseElement,
+  'SVGVKernElement': () => _SVGVKernElement.internalCreate_SVGVKernElement,
+  'SVGViewElement': () => ViewElement.internalCreateViewElement,
+  'SVGViewSpec': () => ViewSpec.internalCreateViewSpec,
+  'SVGZoomEvent': () => ZoomEvent.internalCreateZoomEvent,
+
+};
 // Copyright (c) 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.
@@ -198,6 +342,20 @@
   @DomName('SVGAElement.SVGAElement')
   @DocsEditable()
   factory AElement() => _SvgElementFactoryProvider.createSvgElement_tag("a");
+
+
+  @Deprecated("Internal Use Only")
+  static AElement internalCreateAElement() {
+    return new AElement._internalWrap();
+  }
+
+  factory AElement._internalWrap() {
+    return new AElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  AElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -234,6 +392,20 @@
   @DomName('SVGAltGlyphElement.SVGAltGlyphElement')
   @DocsEditable()
   factory AltGlyphElement() => _SvgElementFactoryProvider.createSvgElement_tag("altGlyph");
+
+
+  @Deprecated("Internal Use Only")
+  static AltGlyphElement internalCreateAltGlyphElement() {
+    return new AltGlyphElement._internalWrap();
+  }
+
+  factory AltGlyphElement._internalWrap() {
+    return new AltGlyphElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  AltGlyphElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -250,7 +422,7 @@
   
   @DomName('SVGAltGlyphElement.format')
   @DocsEditable()
-  void set format(String value) => _blink.BlinkSVGAltGlyphElement.instance.format_Setter_(unwrap_jso(this), value);
+  set format(String value) => _blink.BlinkSVGAltGlyphElement.instance.format_Setter_(unwrap_jso(this), value);
   
   @DomName('SVGAltGlyphElement.glyphRef')
   @DocsEditable()
@@ -258,7 +430,7 @@
   
   @DomName('SVGAltGlyphElement.glyphRef')
   @DocsEditable()
-  void set glyphRef(String value) => _blink.BlinkSVGAltGlyphElement.instance.glyphRef_Setter_(unwrap_jso(this), value);
+  set glyphRef(String value) => _blink.BlinkSVGAltGlyphElement.instance.glyphRef_Setter_(unwrap_jso(this), value);
   
   @DomName('SVGAltGlyphElement.href')
   @DocsEditable()
@@ -275,10 +447,25 @@
 @DocsEditable()
 @DomName('SVGAngle')
 @Unstable()
-class Angle extends NativeFieldWrapperClass2 {
+class Angle extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory Angle._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static Angle internalCreateAngle() {
+    return new Angle._internalWrap();
+  }
+
+  factory Angle._internalWrap() {
+    return new Angle.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  Angle.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('SVGAngle.SVG_ANGLETYPE_DEG')
   @DocsEditable()
   static const int SVG_ANGLETYPE_DEG = 2;
@@ -309,7 +496,7 @@
   
   @DomName('SVGAngle.value')
   @DocsEditable()
-  void set value(num value) => _blink.BlinkSVGAngle.instance.value_Setter_(unwrap_jso(this), value);
+  set value(num value) => _blink.BlinkSVGAngle.instance.value_Setter_(unwrap_jso(this), value);
   
   @DomName('SVGAngle.valueAsString')
   @DocsEditable()
@@ -317,7 +504,7 @@
   
   @DomName('SVGAngle.valueAsString')
   @DocsEditable()
-  void set valueAsString(String value) => _blink.BlinkSVGAngle.instance.valueAsString_Setter_(unwrap_jso(this), value);
+  set valueAsString(String value) => _blink.BlinkSVGAngle.instance.valueAsString_Setter_(unwrap_jso(this), value);
   
   @DomName('SVGAngle.valueInSpecifiedUnits')
   @DocsEditable()
@@ -325,7 +512,7 @@
   
   @DomName('SVGAngle.valueInSpecifiedUnits')
   @DocsEditable()
-  void set valueInSpecifiedUnits(num value) => _blink.BlinkSVGAngle.instance.valueInSpecifiedUnits_Setter_(unwrap_jso(this), value);
+  set valueInSpecifiedUnits(num value) => _blink.BlinkSVGAngle.instance.valueInSpecifiedUnits_Setter_(unwrap_jso(this), value);
   
   @DomName('SVGAngle.convertToSpecifiedUnits')
   @DocsEditable()
@@ -356,6 +543,20 @@
   @DomName('SVGAnimateElement.SVGAnimateElement')
   @DocsEditable()
   factory AnimateElement() => _SvgElementFactoryProvider.createSvgElement_tag("animate");
+
+
+  @Deprecated("Internal Use Only")
+  static AnimateElement internalCreateAnimateElement() {
+    return new AnimateElement._internalWrap();
+  }
+
+  factory AnimateElement._internalWrap() {
+    return new AnimateElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  AnimateElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -387,6 +588,20 @@
   @DomName('SVGAnimateMotionElement.SVGAnimateMotionElement')
   @DocsEditable()
   factory AnimateMotionElement() => _SvgElementFactoryProvider.createSvgElement_tag("animateMotion");
+
+
+  @Deprecated("Internal Use Only")
+  static AnimateMotionElement internalCreateAnimateMotionElement() {
+    return new AnimateMotionElement._internalWrap();
+  }
+
+  factory AnimateMotionElement._internalWrap() {
+    return new AnimateMotionElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  AnimateMotionElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -418,6 +633,20 @@
   @DomName('SVGAnimateTransformElement.SVGAnimateTransformElement')
   @DocsEditable()
   factory AnimateTransformElement() => _SvgElementFactoryProvider.createSvgElement_tag("animateTransform");
+
+
+  @Deprecated("Internal Use Only")
+  static AnimateTransformElement internalCreateAnimateTransformElement() {
+    return new AnimateTransformElement._internalWrap();
+  }
+
+  factory AnimateTransformElement._internalWrap() {
+    return new AnimateTransformElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  AnimateTransformElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -439,10 +668,25 @@
 @DocsEditable()
 @DomName('SVGAnimatedAngle')
 @Unstable()
-class AnimatedAngle extends NativeFieldWrapperClass2 {
+class AnimatedAngle extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory AnimatedAngle._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static AnimatedAngle internalCreateAnimatedAngle() {
+    return new AnimatedAngle._internalWrap();
+  }
+
+  factory AnimatedAngle._internalWrap() {
+    return new AnimatedAngle.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  AnimatedAngle.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('SVGAnimatedAngle.animVal')
   @DocsEditable()
   Angle get animVal => wrap_jso(_blink.BlinkSVGAnimatedAngle.instance.animVal_Getter_(unwrap_jso(this)));
@@ -462,10 +706,25 @@
 @DocsEditable()
 @DomName('SVGAnimatedBoolean')
 @Unstable()
-class AnimatedBoolean extends NativeFieldWrapperClass2 {
+class AnimatedBoolean extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory AnimatedBoolean._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static AnimatedBoolean internalCreateAnimatedBoolean() {
+    return new AnimatedBoolean._internalWrap();
+  }
+
+  factory AnimatedBoolean._internalWrap() {
+    return new AnimatedBoolean.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  AnimatedBoolean.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('SVGAnimatedBoolean.animVal')
   @DocsEditable()
   bool get animVal => _blink.BlinkSVGAnimatedBoolean.instance.animVal_Getter_(unwrap_jso(this));
@@ -476,7 +735,7 @@
   
   @DomName('SVGAnimatedBoolean.baseVal')
   @DocsEditable()
-  void set baseVal(bool value) => _blink.BlinkSVGAnimatedBoolean.instance.baseVal_Setter_(unwrap_jso(this), value);
+  set baseVal(bool value) => _blink.BlinkSVGAnimatedBoolean.instance.baseVal_Setter_(unwrap_jso(this), value);
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -489,10 +748,25 @@
 @DocsEditable()
 @DomName('SVGAnimatedEnumeration')
 @Unstable()
-class AnimatedEnumeration extends NativeFieldWrapperClass2 {
+class AnimatedEnumeration extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory AnimatedEnumeration._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static AnimatedEnumeration internalCreateAnimatedEnumeration() {
+    return new AnimatedEnumeration._internalWrap();
+  }
+
+  factory AnimatedEnumeration._internalWrap() {
+    return new AnimatedEnumeration.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  AnimatedEnumeration.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('SVGAnimatedEnumeration.animVal')
   @DocsEditable()
   int get animVal => _blink.BlinkSVGAnimatedEnumeration.instance.animVal_Getter_(unwrap_jso(this));
@@ -503,7 +777,7 @@
   
   @DomName('SVGAnimatedEnumeration.baseVal')
   @DocsEditable()
-  void set baseVal(int value) => _blink.BlinkSVGAnimatedEnumeration.instance.baseVal_Setter_(unwrap_jso(this), value);
+  set baseVal(int value) => _blink.BlinkSVGAnimatedEnumeration.instance.baseVal_Setter_(unwrap_jso(this), value);
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -516,10 +790,25 @@
 @DocsEditable()
 @DomName('SVGAnimatedInteger')
 @Unstable()
-class AnimatedInteger extends NativeFieldWrapperClass2 {
+class AnimatedInteger extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory AnimatedInteger._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static AnimatedInteger internalCreateAnimatedInteger() {
+    return new AnimatedInteger._internalWrap();
+  }
+
+  factory AnimatedInteger._internalWrap() {
+    return new AnimatedInteger.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  AnimatedInteger.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('SVGAnimatedInteger.animVal')
   @DocsEditable()
   int get animVal => _blink.BlinkSVGAnimatedInteger.instance.animVal_Getter_(unwrap_jso(this));
@@ -530,7 +819,7 @@
   
   @DomName('SVGAnimatedInteger.baseVal')
   @DocsEditable()
-  void set baseVal(int value) => _blink.BlinkSVGAnimatedInteger.instance.baseVal_Setter_(unwrap_jso(this), value);
+  set baseVal(int value) => _blink.BlinkSVGAnimatedInteger.instance.baseVal_Setter_(unwrap_jso(this), value);
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -543,10 +832,25 @@
 @DocsEditable()
 @DomName('SVGAnimatedLength')
 @Unstable()
-class AnimatedLength extends NativeFieldWrapperClass2 {
+class AnimatedLength extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory AnimatedLength._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static AnimatedLength internalCreateAnimatedLength() {
+    return new AnimatedLength._internalWrap();
+  }
+
+  factory AnimatedLength._internalWrap() {
+    return new AnimatedLength.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  AnimatedLength.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('SVGAnimatedLength.animVal')
   @DocsEditable()
   Length get animVal => wrap_jso(_blink.BlinkSVGAnimatedLength.instance.animVal_Getter_(unwrap_jso(this)));
@@ -566,10 +870,25 @@
 @DocsEditable()
 @DomName('SVGAnimatedLengthList')
 @Unstable()
-class AnimatedLengthList extends NativeFieldWrapperClass2 {
+class AnimatedLengthList extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory AnimatedLengthList._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static AnimatedLengthList internalCreateAnimatedLengthList() {
+    return new AnimatedLengthList._internalWrap();
+  }
+
+  factory AnimatedLengthList._internalWrap() {
+    return new AnimatedLengthList.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  AnimatedLengthList.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('SVGAnimatedLengthList.animVal')
   @DocsEditable()
   LengthList get animVal => wrap_jso(_blink.BlinkSVGAnimatedLengthList.instance.animVal_Getter_(unwrap_jso(this)));
@@ -589,13 +908,28 @@
 @DocsEditable()
 @DomName('SVGAnimatedNumber')
 @Unstable()
-class AnimatedNumber extends NativeFieldWrapperClass2 {
+class AnimatedNumber extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory AnimatedNumber._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static AnimatedNumber internalCreateAnimatedNumber() {
+    return new AnimatedNumber._internalWrap();
+  }
+
+  factory AnimatedNumber._internalWrap() {
+    return new AnimatedNumber.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  AnimatedNumber.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('SVGAnimatedNumber.animVal')
   @DocsEditable()
-  double get animVal => _blink.BlinkSVGAnimatedNumber.instance.animVal_Getter_(unwrap_jso(this));
+  num get animVal => _blink.BlinkSVGAnimatedNumber.instance.animVal_Getter_(unwrap_jso(this));
   
   @DomName('SVGAnimatedNumber.baseVal')
   @DocsEditable()
@@ -603,7 +937,7 @@
   
   @DomName('SVGAnimatedNumber.baseVal')
   @DocsEditable()
-  void set baseVal(num value) => _blink.BlinkSVGAnimatedNumber.instance.baseVal_Setter_(unwrap_jso(this), value);
+  set baseVal(num value) => _blink.BlinkSVGAnimatedNumber.instance.baseVal_Setter_(unwrap_jso(this), value);
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -616,10 +950,25 @@
 @DocsEditable()
 @DomName('SVGAnimatedNumberList')
 @Unstable()
-class AnimatedNumberList extends NativeFieldWrapperClass2 {
+class AnimatedNumberList extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory AnimatedNumberList._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static AnimatedNumberList internalCreateAnimatedNumberList() {
+    return new AnimatedNumberList._internalWrap();
+  }
+
+  factory AnimatedNumberList._internalWrap() {
+    return new AnimatedNumberList.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  AnimatedNumberList.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('SVGAnimatedNumberList.animVal')
   @DocsEditable()
   NumberList get animVal => wrap_jso(_blink.BlinkSVGAnimatedNumberList.instance.animVal_Getter_(unwrap_jso(this)));
@@ -639,10 +988,25 @@
 @DocsEditable()
 @DomName('SVGAnimatedPreserveAspectRatio')
 @Unstable()
-class AnimatedPreserveAspectRatio extends NativeFieldWrapperClass2 {
+class AnimatedPreserveAspectRatio extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory AnimatedPreserveAspectRatio._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static AnimatedPreserveAspectRatio internalCreateAnimatedPreserveAspectRatio() {
+    return new AnimatedPreserveAspectRatio._internalWrap();
+  }
+
+  factory AnimatedPreserveAspectRatio._internalWrap() {
+    return new AnimatedPreserveAspectRatio.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  AnimatedPreserveAspectRatio.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('SVGAnimatedPreserveAspectRatio.animVal')
   @DocsEditable()
   PreserveAspectRatio get animVal => wrap_jso(_blink.BlinkSVGAnimatedPreserveAspectRatio.instance.animVal_Getter_(unwrap_jso(this)));
@@ -662,10 +1026,25 @@
 @DocsEditable()
 @DomName('SVGAnimatedRect')
 @Unstable()
-class AnimatedRect extends NativeFieldWrapperClass2 {
+class AnimatedRect extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory AnimatedRect._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static AnimatedRect internalCreateAnimatedRect() {
+    return new AnimatedRect._internalWrap();
+  }
+
+  factory AnimatedRect._internalWrap() {
+    return new AnimatedRect.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  AnimatedRect.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('SVGAnimatedRect.animVal')
   @DocsEditable()
   Rect get animVal => wrap_jso(_blink.BlinkSVGAnimatedRect.instance.animVal_Getter_(unwrap_jso(this)));
@@ -685,10 +1064,25 @@
 @DocsEditable()
 @DomName('SVGAnimatedString')
 @Unstable()
-class AnimatedString extends NativeFieldWrapperClass2 {
+class AnimatedString extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory AnimatedString._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static AnimatedString internalCreateAnimatedString() {
+    return new AnimatedString._internalWrap();
+  }
+
+  factory AnimatedString._internalWrap() {
+    return new AnimatedString.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  AnimatedString.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('SVGAnimatedString.animVal')
   @DocsEditable()
   String get animVal => _blink.BlinkSVGAnimatedString.instance.animVal_Getter_(unwrap_jso(this));
@@ -699,7 +1093,7 @@
   
   @DomName('SVGAnimatedString.baseVal')
   @DocsEditable()
-  void set baseVal(String value) => _blink.BlinkSVGAnimatedString.instance.baseVal_Setter_(unwrap_jso(this), value);
+  set baseVal(String value) => _blink.BlinkSVGAnimatedString.instance.baseVal_Setter_(unwrap_jso(this), value);
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -712,10 +1106,25 @@
 @DocsEditable()
 @DomName('SVGAnimatedTransformList')
 @Unstable()
-class AnimatedTransformList extends NativeFieldWrapperClass2 {
+class AnimatedTransformList extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory AnimatedTransformList._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static AnimatedTransformList internalCreateAnimatedTransformList() {
+    return new AnimatedTransformList._internalWrap();
+  }
+
+  factory AnimatedTransformList._internalWrap() {
+    return new AnimatedTransformList.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  AnimatedTransformList.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('SVGAnimatedTransformList.animVal')
   @DocsEditable()
   TransformList get animVal => wrap_jso(_blink.BlinkSVGAnimatedTransformList.instance.animVal_Getter_(unwrap_jso(this)));
@@ -742,6 +1151,20 @@
   @DomName('SVGAnimationElement.SVGAnimationElement')
   @DocsEditable()
   factory AnimationElement() => _SvgElementFactoryProvider.createSvgElement_tag("animation");
+
+
+  @Deprecated("Internal Use Only")
+  static AnimationElement internalCreateAnimationElement() {
+    return new AnimationElement._internalWrap();
+  }
+
+  factory AnimationElement._internalWrap() {
+    return new AnimationElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  AnimationElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -771,15 +1194,15 @@
   
   @DomName('SVGAnimationElement.getCurrentTime')
   @DocsEditable()
-  double getCurrentTime() => _blink.BlinkSVGAnimationElement.instance.getCurrentTime_Callback_0_(unwrap_jso(this));
+  num getCurrentTime() => _blink.BlinkSVGAnimationElement.instance.getCurrentTime_Callback_0_(unwrap_jso(this));
   
   @DomName('SVGAnimationElement.getSimpleDuration')
   @DocsEditable()
-  double getSimpleDuration() => _blink.BlinkSVGAnimationElement.instance.getSimpleDuration_Callback_0_(unwrap_jso(this));
+  num getSimpleDuration() => _blink.BlinkSVGAnimationElement.instance.getSimpleDuration_Callback_0_(unwrap_jso(this));
   
   @DomName('SVGAnimationElement.getStartTime')
   @DocsEditable()
-  double getStartTime() => _blink.BlinkSVGAnimationElement.instance.getStartTime_Callback_0_(unwrap_jso(this));
+  num getStartTime() => _blink.BlinkSVGAnimationElement.instance.getStartTime_Callback_0_(unwrap_jso(this));
   
   @DomName('SVGAnimationElement.requiredExtensions')
   @DocsEditable()
@@ -815,6 +1238,20 @@
   @DomName('SVGCircleElement.SVGCircleElement')
   @DocsEditable()
   factory CircleElement() => _SvgElementFactoryProvider.createSvgElement_tag("circle");
+
+
+  @Deprecated("Internal Use Only")
+  static CircleElement internalCreateCircleElement() {
+    return new CircleElement._internalWrap();
+  }
+
+  factory CircleElement._internalWrap() {
+    return new CircleElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  CircleElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -852,6 +1289,20 @@
   @DomName('SVGClipPathElement.SVGClipPathElement')
   @DocsEditable()
   factory ClipPathElement() => _SvgElementFactoryProvider.createSvgElement_tag("clipPath");
+
+
+  @Deprecated("Internal Use Only")
+  static ClipPathElement internalCreateClipPathElement() {
+    return new ClipPathElement._internalWrap();
+  }
+
+  factory ClipPathElement._internalWrap() {
+    return new ClipPathElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  ClipPathElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -881,6 +1332,20 @@
   @DomName('SVGDefsElement.SVGDefsElement')
   @DocsEditable()
   factory DefsElement() => _SvgElementFactoryProvider.createSvgElement_tag("defs");
+
+
+  @Deprecated("Internal Use Only")
+  static DefsElement internalCreateDefsElement() {
+    return new DefsElement._internalWrap();
+  }
+
+  factory DefsElement._internalWrap() {
+    return new DefsElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  DefsElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -906,6 +1371,20 @@
   @DomName('SVGDescElement.SVGDescElement')
   @DocsEditable()
   factory DescElement() => _SvgElementFactoryProvider.createSvgElement_tag("desc");
+
+
+  @Deprecated("Internal Use Only")
+  static DescElement internalCreateDescElement() {
+    return new DescElement._internalWrap();
+  }
+
+  factory DescElement._internalWrap() {
+    return new DescElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  DescElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -927,6 +1406,20 @@
 class DiscardElement extends SvgElement {
   // To suppress missing implicit constructor warnings.
   factory DiscardElement._() { throw new UnsupportedError("Not supported"); }
+
+
+  @Deprecated("Internal Use Only")
+  static DiscardElement internalCreateDiscardElement() {
+    return new DiscardElement._internalWrap();
+  }
+
+  factory DiscardElement._internalWrap() {
+    return new DiscardElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  DiscardElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -952,6 +1445,20 @@
   @DomName('SVGEllipseElement.SVGEllipseElement')
   @DocsEditable()
   factory EllipseElement() => _SvgElementFactoryProvider.createSvgElement_tag("ellipse");
+
+
+  @Deprecated("Internal Use Only")
+  static EllipseElement internalCreateEllipseElement() {
+    return new EllipseElement._internalWrap();
+  }
+
+  factory EllipseElement._internalWrap() {
+    return new EllipseElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  EllipseElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -997,6 +1504,20 @@
   @DomName('SVGFEBlendElement.SVGFEBlendElement')
   @DocsEditable()
   factory FEBlendElement() => _SvgElementFactoryProvider.createSvgElement_tag("feBlend");
+
+
+  @Deprecated("Internal Use Only")
+  static FEBlendElement internalCreateFEBlendElement() {
+    return new FEBlendElement._internalWrap();
+  }
+
+  factory FEBlendElement._internalWrap() {
+    return new FEBlendElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  FEBlendElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -1085,6 +1606,20 @@
   @DomName('SVGFEColorMatrixElement.SVGFEColorMatrixElement')
   @DocsEditable()
   factory FEColorMatrixElement() => _SvgElementFactoryProvider.createSvgElement_tag("feColorMatrix");
+
+
+  @Deprecated("Internal Use Only")
+  static FEColorMatrixElement internalCreateFEColorMatrixElement() {
+    return new FEColorMatrixElement._internalWrap();
+  }
+
+  factory FEColorMatrixElement._internalWrap() {
+    return new FEColorMatrixElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  FEColorMatrixElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -1169,6 +1704,20 @@
   @DomName('SVGFEComponentTransferElement.SVGFEComponentTransferElement')
   @DocsEditable()
   factory FEComponentTransferElement() => _SvgElementFactoryProvider.createSvgElement_tag("feComponentTransfer");
+
+
+  @Deprecated("Internal Use Only")
+  static FEComponentTransferElement internalCreateFEComponentTransferElement() {
+    return new FEComponentTransferElement._internalWrap();
+  }
+
+  factory FEComponentTransferElement._internalWrap() {
+    return new FEComponentTransferElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  FEComponentTransferElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -1217,6 +1766,20 @@
 class FECompositeElement extends SvgElement implements FilterPrimitiveStandardAttributes {
   // To suppress missing implicit constructor warnings.
   factory FECompositeElement._() { throw new UnsupportedError("Not supported"); }
+
+
+  @Deprecated("Internal Use Only")
+  static FECompositeElement internalCreateFECompositeElement() {
+    return new FECompositeElement._internalWrap();
+  }
+
+  factory FECompositeElement._internalWrap() {
+    return new FECompositeElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  FECompositeElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -1322,6 +1885,20 @@
   @DomName('SVGFEConvolveMatrixElement.SVGFEConvolveMatrixElement')
   @DocsEditable()
   factory FEConvolveMatrixElement() => _SvgElementFactoryProvider.createSvgElement_tag("feConvolveMatrix");
+
+
+  @Deprecated("Internal Use Only")
+  static FEConvolveMatrixElement internalCreateFEConvolveMatrixElement() {
+    return new FEConvolveMatrixElement._internalWrap();
+  }
+
+  factory FEConvolveMatrixElement._internalWrap() {
+    return new FEConvolveMatrixElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  FEConvolveMatrixElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -1438,6 +2015,20 @@
   @DomName('SVGFEDiffuseLightingElement.SVGFEDiffuseLightingElement')
   @DocsEditable()
   factory FEDiffuseLightingElement() => _SvgElementFactoryProvider.createSvgElement_tag("feDiffuseLighting");
+
+
+  @Deprecated("Internal Use Only")
+  static FEDiffuseLightingElement internalCreateFEDiffuseLightingElement() {
+    return new FEDiffuseLightingElement._internalWrap();
+  }
+
+  factory FEDiffuseLightingElement._internalWrap() {
+    return new FEDiffuseLightingElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  FEDiffuseLightingElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -1510,6 +2101,20 @@
   @DomName('SVGFEDisplacementMapElement.SVGFEDisplacementMapElement')
   @DocsEditable()
   factory FEDisplacementMapElement() => _SvgElementFactoryProvider.createSvgElement_tag("feDisplacementMap");
+
+
+  @Deprecated("Internal Use Only")
+  static FEDisplacementMapElement internalCreateFEDisplacementMapElement() {
+    return new FEDisplacementMapElement._internalWrap();
+  }
+
+  factory FEDisplacementMapElement._internalWrap() {
+    return new FEDisplacementMapElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  FEDisplacementMapElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -1602,6 +2207,20 @@
   @DomName('SVGFEDistantLightElement.SVGFEDistantLightElement')
   @DocsEditable()
   factory FEDistantLightElement() => _SvgElementFactoryProvider.createSvgElement_tag("feDistantLight");
+
+
+  @Deprecated("Internal Use Only")
+  static FEDistantLightElement internalCreateFEDistantLightElement() {
+    return new FEDistantLightElement._internalWrap();
+  }
+
+  factory FEDistantLightElement._internalWrap() {
+    return new FEDistantLightElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  FEDistantLightElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -1642,6 +2261,20 @@
   @DomName('SVGFEFloodElement.SVGFEFloodElement')
   @DocsEditable()
   factory FEFloodElement() => _SvgElementFactoryProvider.createSvgElement_tag("feFlood");
+
+
+  @Deprecated("Internal Use Only")
+  static FEFloodElement internalCreateFEFloodElement() {
+    return new FEFloodElement._internalWrap();
+  }
+
+  factory FEFloodElement._internalWrap() {
+    return new FEFloodElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  FEFloodElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -1694,6 +2327,20 @@
   @DomName('SVGFEFuncAElement.SVGFEFuncAElement')
   @DocsEditable()
   factory FEFuncAElement() => _SvgElementFactoryProvider.createSvgElement_tag("feFuncA");
+
+
+  @Deprecated("Internal Use Only")
+  static FEFuncAElement internalCreateFEFuncAElement() {
+    return new FEFuncAElement._internalWrap();
+  }
+
+  factory FEFuncAElement._internalWrap() {
+    return new FEFuncAElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  FEFuncAElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -1726,6 +2373,20 @@
   @DomName('SVGFEFuncBElement.SVGFEFuncBElement')
   @DocsEditable()
   factory FEFuncBElement() => _SvgElementFactoryProvider.createSvgElement_tag("feFuncB");
+
+
+  @Deprecated("Internal Use Only")
+  static FEFuncBElement internalCreateFEFuncBElement() {
+    return new FEFuncBElement._internalWrap();
+  }
+
+  factory FEFuncBElement._internalWrap() {
+    return new FEFuncBElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  FEFuncBElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -1758,6 +2419,20 @@
   @DomName('SVGFEFuncGElement.SVGFEFuncGElement')
   @DocsEditable()
   factory FEFuncGElement() => _SvgElementFactoryProvider.createSvgElement_tag("feFuncG");
+
+
+  @Deprecated("Internal Use Only")
+  static FEFuncGElement internalCreateFEFuncGElement() {
+    return new FEFuncGElement._internalWrap();
+  }
+
+  factory FEFuncGElement._internalWrap() {
+    return new FEFuncGElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  FEFuncGElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -1790,6 +2465,20 @@
   @DomName('SVGFEFuncRElement.SVGFEFuncRElement')
   @DocsEditable()
   factory FEFuncRElement() => _SvgElementFactoryProvider.createSvgElement_tag("feFuncR");
+
+
+  @Deprecated("Internal Use Only")
+  static FEFuncRElement internalCreateFEFuncRElement() {
+    return new FEFuncRElement._internalWrap();
+  }
+
+  factory FEFuncRElement._internalWrap() {
+    return new FEFuncRElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  FEFuncRElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -1822,6 +2511,20 @@
   @DomName('SVGFEGaussianBlurElement.SVGFEGaussianBlurElement')
   @DocsEditable()
   factory FEGaussianBlurElement() => _SvgElementFactoryProvider.createSvgElement_tag("feGaussianBlur");
+
+
+  @Deprecated("Internal Use Only")
+  static FEGaussianBlurElement internalCreateFEGaussianBlurElement() {
+    return new FEGaussianBlurElement._internalWrap();
+  }
+
+  factory FEGaussianBlurElement._internalWrap() {
+    return new FEGaussianBlurElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  FEGaussianBlurElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -1890,6 +2593,20 @@
   @DomName('SVGFEImageElement.SVGFEImageElement')
   @DocsEditable()
   factory FEImageElement() => _SvgElementFactoryProvider.createSvgElement_tag("feImage");
+
+
+  @Deprecated("Internal Use Only")
+  static FEImageElement internalCreateFEImageElement() {
+    return new FEImageElement._internalWrap();
+  }
+
+  factory FEImageElement._internalWrap() {
+    return new FEImageElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  FEImageElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -1950,6 +2667,20 @@
   @DomName('SVGFEMergeElement.SVGFEMergeElement')
   @DocsEditable()
   factory FEMergeElement() => _SvgElementFactoryProvider.createSvgElement_tag("feMerge");
+
+
+  @Deprecated("Internal Use Only")
+  static FEMergeElement internalCreateFEMergeElement() {
+    return new FEMergeElement._internalWrap();
+  }
+
+  factory FEMergeElement._internalWrap() {
+    return new FEMergeElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  FEMergeElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -2002,6 +2733,20 @@
   @DomName('SVGFEMergeNodeElement.SVGFEMergeNodeElement')
   @DocsEditable()
   factory FEMergeNodeElement() => _SvgElementFactoryProvider.createSvgElement_tag("feMergeNode");
+
+
+  @Deprecated("Internal Use Only")
+  static FEMergeNodeElement internalCreateFEMergeNodeElement() {
+    return new FEMergeNodeElement._internalWrap();
+  }
+
+  factory FEMergeNodeElement._internalWrap() {
+    return new FEMergeNodeElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  FEMergeNodeElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -2034,6 +2779,20 @@
 class FEMorphologyElement extends SvgElement implements FilterPrimitiveStandardAttributes {
   // To suppress missing implicit constructor warnings.
   factory FEMorphologyElement._() { throw new UnsupportedError("Not supported"); }
+
+
+  @Deprecated("Internal Use Only")
+  static FEMorphologyElement internalCreateFEMorphologyElement() {
+    return new FEMorphologyElement._internalWrap();
+  }
+
+  factory FEMorphologyElement._internalWrap() {
+    return new FEMorphologyElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  FEMorphologyElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -2111,6 +2870,20 @@
   @DomName('SVGFEOffsetElement.SVGFEOffsetElement')
   @DocsEditable()
   factory FEOffsetElement() => _SvgElementFactoryProvider.createSvgElement_tag("feOffset");
+
+
+  @Deprecated("Internal Use Only")
+  static FEOffsetElement internalCreateFEOffsetElement() {
+    return new FEOffsetElement._internalWrap();
+  }
+
+  factory FEOffsetElement._internalWrap() {
+    return new FEOffsetElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  FEOffsetElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -2175,6 +2948,20 @@
   @DomName('SVGFEPointLightElement.SVGFEPointLightElement')
   @DocsEditable()
   factory FEPointLightElement() => _SvgElementFactoryProvider.createSvgElement_tag("fePointLight");
+
+
+  @Deprecated("Internal Use Only")
+  static FEPointLightElement internalCreateFEPointLightElement() {
+    return new FEPointLightElement._internalWrap();
+  }
+
+  factory FEPointLightElement._internalWrap() {
+    return new FEPointLightElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  FEPointLightElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -2219,6 +3006,20 @@
   @DomName('SVGFESpecularLightingElement.SVGFESpecularLightingElement')
   @DocsEditable()
   factory FESpecularLightingElement() => _SvgElementFactoryProvider.createSvgElement_tag("feSpecularLighting");
+
+
+  @Deprecated("Internal Use Only")
+  static FESpecularLightingElement internalCreateFESpecularLightingElement() {
+    return new FESpecularLightingElement._internalWrap();
+  }
+
+  factory FESpecularLightingElement._internalWrap() {
+    return new FESpecularLightingElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  FESpecularLightingElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -2287,6 +3088,20 @@
   @DomName('SVGFESpotLightElement.SVGFESpotLightElement')
   @DocsEditable()
   factory FESpotLightElement() => _SvgElementFactoryProvider.createSvgElement_tag("feSpotLight");
+
+
+  @Deprecated("Internal Use Only")
+  static FESpotLightElement internalCreateFESpotLightElement() {
+    return new FESpotLightElement._internalWrap();
+  }
+
+  factory FESpotLightElement._internalWrap() {
+    return new FESpotLightElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  FESpotLightElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -2351,6 +3166,20 @@
   @DomName('SVGFETileElement.SVGFETileElement')
   @DocsEditable()
   factory FETileElement() => _SvgElementFactoryProvider.createSvgElement_tag("feTile");
+
+
+  @Deprecated("Internal Use Only")
+  static FETileElement internalCreateFETileElement() {
+    return new FETileElement._internalWrap();
+  }
+
+  factory FETileElement._internalWrap() {
+    return new FETileElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  FETileElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -2407,6 +3236,20 @@
   @DomName('SVGFETurbulenceElement.SVGFETurbulenceElement')
   @DocsEditable()
   factory FETurbulenceElement() => _SvgElementFactoryProvider.createSvgElement_tag("feTurbulence");
+
+
+  @Deprecated("Internal Use Only")
+  static FETurbulenceElement internalCreateFETurbulenceElement() {
+    return new FETurbulenceElement._internalWrap();
+  }
+
+  factory FETurbulenceElement._internalWrap() {
+    return new FETurbulenceElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  FETurbulenceElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -2507,6 +3350,20 @@
   @DomName('SVGFilterElement.SVGFilterElement')
   @DocsEditable()
   factory FilterElement() => _SvgElementFactoryProvider.createSvgElement_tag("filter");
+
+
+  @Deprecated("Internal Use Only")
+  static FilterElement internalCreateFilterElement() {
+    return new FilterElement._internalWrap();
+  }
+
+  factory FilterElement._internalWrap() {
+    return new FilterElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  FilterElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -2568,7 +3425,7 @@
 @DocsEditable()
 @DomName('SVGFilterPrimitiveStandardAttributes')
 @Unstable()
-abstract class FilterPrimitiveStandardAttributes extends NativeFieldWrapperClass2 {
+abstract class FilterPrimitiveStandardAttributes extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory FilterPrimitiveStandardAttributes._() { throw new UnsupportedError("Not supported"); }
 
@@ -2603,7 +3460,7 @@
 @DocsEditable()
 @DomName('SVGFitToViewBox')
 @Unstable()
-abstract class FitToViewBox extends NativeFieldWrapperClass2 {
+abstract class FitToViewBox extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory FitToViewBox._() { throw new UnsupportedError("Not supported"); }
 
@@ -2636,6 +3493,20 @@
   @DomName('SVGForeignObjectElement.SVGForeignObjectElement')
   @DocsEditable()
   factory ForeignObjectElement() => _SvgElementFactoryProvider.createSvgElement_tag("foreignObject");
+
+
+  @Deprecated("Internal Use Only")
+  static ForeignObjectElement internalCreateForeignObjectElement() {
+    return new ForeignObjectElement._internalWrap();
+  }
+
+  factory ForeignObjectElement._internalWrap() {
+    return new ForeignObjectElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  ForeignObjectElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -2680,6 +3551,20 @@
   @DomName('SVGGElement.SVGGElement')
   @DocsEditable()
   factory GElement() => _SvgElementFactoryProvider.createSvgElement_tag("g");
+
+
+  @Deprecated("Internal Use Only")
+  static GElement internalCreateGElement() {
+    return new GElement._internalWrap();
+  }
+
+  factory GElement._internalWrap() {
+    return new GElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  GElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -2701,6 +3586,20 @@
 class GeometryElement extends GraphicsElement {
   // To suppress missing implicit constructor warnings.
   factory GeometryElement._() { throw new UnsupportedError("Not supported"); }
+
+
+  @Deprecated("Internal Use Only")
+  static GeometryElement internalCreateGeometryElement() {
+    return new GeometryElement._internalWrap();
+  }
+
+  factory GeometryElement._internalWrap() {
+    return new GeometryElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  GeometryElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -2732,6 +3631,20 @@
 class GraphicsElement extends SvgElement implements Tests {
   // To suppress missing implicit constructor warnings.
   factory GraphicsElement._() { throw new UnsupportedError("Not supported"); }
+
+
+  @Deprecated("Internal Use Only")
+  static GraphicsElement internalCreateGraphicsElement() {
+    return new GraphicsElement._internalWrap();
+  }
+
+  factory GraphicsElement._internalWrap() {
+    return new GraphicsElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  GraphicsElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -2762,17 +3675,17 @@
   @DomName('SVGGraphicsElement.getCTM')
   @DocsEditable()
   @Experimental() // untriaged
-  Matrix getCtm() => _blink.BlinkSVGGraphicsElement.instance.getCTM_Callback_0_(unwrap_jso(this));
+  Matrix getCtm() => wrap_jso(_blink.BlinkSVGGraphicsElement.instance.getCTM_Callback_0_(unwrap_jso(this)));
   
   @DomName('SVGGraphicsElement.getScreenCTM')
   @DocsEditable()
   @Experimental() // untriaged
-  Matrix getScreenCtm() => _blink.BlinkSVGGraphicsElement.instance.getScreenCTM_Callback_0_(unwrap_jso(this));
+  Matrix getScreenCtm() => wrap_jso(_blink.BlinkSVGGraphicsElement.instance.getScreenCTM_Callback_0_(unwrap_jso(this)));
   
   @DomName('SVGGraphicsElement.getTransformToElement')
   @DocsEditable()
   @Experimental() // untriaged
-  Matrix getTransformToElement(SvgElement element) => _blink.BlinkSVGGraphicsElement.instance.getTransformToElement_Callback_1_(unwrap_jso(this), unwrap_jso(element));
+  Matrix getTransformToElement(SvgElement element) => wrap_jso(_blink.BlinkSVGGraphicsElement.instance.getTransformToElement_Callback_1_(unwrap_jso(this), unwrap_jso(element)));
   
   @DomName('SVGGraphicsElement.requiredExtensions')
   @DocsEditable()
@@ -2812,6 +3725,20 @@
   @DomName('SVGImageElement.SVGImageElement')
   @DocsEditable()
   factory ImageElement() => _SvgElementFactoryProvider.createSvgElement_tag("image");
+
+
+  @Deprecated("Internal Use Only")
+  static ImageElement internalCreateImageElement() {
+    return new ImageElement._internalWrap();
+  }
+
+  factory ImageElement._internalWrap() {
+    return new ImageElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  ImageElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -2854,10 +3781,25 @@
 @DocsEditable()
 @DomName('SVGLength')
 @Unstable()
-class Length extends NativeFieldWrapperClass2 {
+class Length extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory Length._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static Length internalCreateLength() {
+    return new Length._internalWrap();
+  }
+
+  factory Length._internalWrap() {
+    return new Length.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  Length.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('SVGLength.SVG_LENGTHTYPE_CM')
   @DocsEditable()
   static const int SVG_LENGTHTYPE_CM = 6;
@@ -2912,7 +3854,7 @@
   
   @DomName('SVGLength.value')
   @DocsEditable()
-  void set value(num value) => _blink.BlinkSVGLength.instance.value_Setter_(unwrap_jso(this), value);
+  set value(num value) => _blink.BlinkSVGLength.instance.value_Setter_(unwrap_jso(this), value);
   
   @DomName('SVGLength.valueAsString')
   @DocsEditable()
@@ -2920,7 +3862,7 @@
   
   @DomName('SVGLength.valueAsString')
   @DocsEditable()
-  void set valueAsString(String value) => _blink.BlinkSVGLength.instance.valueAsString_Setter_(unwrap_jso(this), value);
+  set valueAsString(String value) => _blink.BlinkSVGLength.instance.valueAsString_Setter_(unwrap_jso(this), value);
   
   @DomName('SVGLength.valueInSpecifiedUnits')
   @DocsEditable()
@@ -2928,7 +3870,7 @@
   
   @DomName('SVGLength.valueInSpecifiedUnits')
   @DocsEditable()
-  void set valueInSpecifiedUnits(num value) => _blink.BlinkSVGLength.instance.valueInSpecifiedUnits_Setter_(unwrap_jso(this), value);
+  set valueInSpecifiedUnits(num value) => _blink.BlinkSVGLength.instance.valueInSpecifiedUnits_Setter_(unwrap_jso(this), value);
   
   @DomName('SVGLength.convertToSpecifiedUnits')
   @DocsEditable()
@@ -2949,10 +3891,25 @@
 @DocsEditable()
 @DomName('SVGLengthList')
 @Unstable()
-class LengthList extends NativeFieldWrapperClass2 with ListMixin<Length>, ImmutableListMixin<Length> implements List<Length> {
+class LengthList extends DartHtmlDomObject with ListMixin<Length>, ImmutableListMixin<Length> implements List<Length> {
   // To suppress missing implicit constructor warnings.
   factory LengthList._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static LengthList internalCreateLengthList() {
+    return new LengthList._internalWrap();
+  }
+
+  factory LengthList._internalWrap() {
+    return new LengthList.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  LengthList.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('SVGLengthList.length')
   @DocsEditable()
   @Experimental() // untriaged
@@ -2975,7 +3932,7 @@
   // Length is the element type.
 
 
-  void set length(int value) {
+  set length(int value) {
     throw new UnsupportedError("Cannot resize immutable List.");
   }
 
@@ -3013,7 +3970,7 @@
   
   @DomName('SVGLengthList.appendItem')
   @DocsEditable()
-  Length appendItem(Length item) => _blink.BlinkSVGLengthList.instance.appendItem_Callback_1_(unwrap_jso(this), unwrap_jso(item));
+  Length appendItem(Length item) => wrap_jso(_blink.BlinkSVGLengthList.instance.appendItem_Callback_1_(unwrap_jso(this), unwrap_jso(item)));
   
   @DomName('SVGLengthList.clear')
   @DocsEditable()
@@ -3021,23 +3978,23 @@
   
   @DomName('SVGLengthList.getItem')
   @DocsEditable()
-  Length getItem(int index) => _blink.BlinkSVGLengthList.instance.getItem_Callback_1_(unwrap_jso(this), index);
+  Length getItem(int index) => wrap_jso(_blink.BlinkSVGLengthList.instance.getItem_Callback_1_(unwrap_jso(this), index));
   
   @DomName('SVGLengthList.initialize')
   @DocsEditable()
-  Length initialize(Length item) => _blink.BlinkSVGLengthList.instance.initialize_Callback_1_(unwrap_jso(this), unwrap_jso(item));
+  Length initialize(Length item) => wrap_jso(_blink.BlinkSVGLengthList.instance.initialize_Callback_1_(unwrap_jso(this), unwrap_jso(item)));
   
   @DomName('SVGLengthList.insertItemBefore')
   @DocsEditable()
-  Length insertItemBefore(Length item, int index) => _blink.BlinkSVGLengthList.instance.insertItemBefore_Callback_2_(unwrap_jso(this), unwrap_jso(item), index);
+  Length insertItemBefore(Length item, int index) => wrap_jso(_blink.BlinkSVGLengthList.instance.insertItemBefore_Callback_2_(unwrap_jso(this), unwrap_jso(item), index));
   
   @DomName('SVGLengthList.removeItem')
   @DocsEditable()
-  Length removeItem(int index) => _blink.BlinkSVGLengthList.instance.removeItem_Callback_1_(unwrap_jso(this), index);
+  Length removeItem(int index) => wrap_jso(_blink.BlinkSVGLengthList.instance.removeItem_Callback_1_(unwrap_jso(this), index));
   
   @DomName('SVGLengthList.replaceItem')
   @DocsEditable()
-  Length replaceItem(Length item, int index) => _blink.BlinkSVGLengthList.instance.replaceItem_Callback_2_(unwrap_jso(this), unwrap_jso(item), index);
+  Length replaceItem(Length item, int index) => wrap_jso(_blink.BlinkSVGLengthList.instance.replaceItem_Callback_2_(unwrap_jso(this), unwrap_jso(item), index));
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -3057,6 +4014,20 @@
   @DomName('SVGLineElement.SVGLineElement')
   @DocsEditable()
   factory LineElement() => _SvgElementFactoryProvider.createSvgElement_tag("line");
+
+
+  @Deprecated("Internal Use Only")
+  static LineElement internalCreateLineElement() {
+    return new LineElement._internalWrap();
+  }
+
+  factory LineElement._internalWrap() {
+    return new LineElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  LineElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -3098,6 +4069,20 @@
   @DomName('SVGLinearGradientElement.SVGLinearGradientElement')
   @DocsEditable()
   factory LinearGradientElement() => _SvgElementFactoryProvider.createSvgElement_tag("linearGradient");
+
+
+  @Deprecated("Internal Use Only")
+  static LinearGradientElement internalCreateLinearGradientElement() {
+    return new LinearGradientElement._internalWrap();
+  }
+
+  factory LinearGradientElement._internalWrap() {
+    return new LinearGradientElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  LinearGradientElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -3139,6 +4124,20 @@
   @DomName('SVGMarkerElement.SVGMarkerElement')
   @DocsEditable()
   factory MarkerElement() => _SvgElementFactoryProvider.createSvgElement_tag("marker");
+
+
+  @Deprecated("Internal Use Only")
+  static MarkerElement internalCreateMarkerElement() {
+    return new MarkerElement._internalWrap();
+  }
+
+  factory MarkerElement._internalWrap() {
+    return new MarkerElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  MarkerElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -3232,6 +4231,20 @@
   @DomName('SVGMaskElement.SVGMaskElement')
   @DocsEditable()
   factory MaskElement() => _SvgElementFactoryProvider.createSvgElement_tag("mask");
+
+
+  @Deprecated("Internal Use Only")
+  static MaskElement internalCreateMaskElement() {
+    return new MaskElement._internalWrap();
+  }
+
+  factory MaskElement._internalWrap() {
+    return new MaskElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  MaskElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -3290,17 +4303,32 @@
 @DocsEditable()
 @DomName('SVGMatrix')
 @Unstable()
-class Matrix extends NativeFieldWrapperClass2 {
+class Matrix extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory Matrix._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static Matrix internalCreateMatrix() {
+    return new Matrix._internalWrap();
+  }
+
+  factory Matrix._internalWrap() {
+    return new Matrix.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  Matrix.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('SVGMatrix.a')
   @DocsEditable()
   num get a => _blink.BlinkSVGMatrix.instance.a_Getter_(unwrap_jso(this));
   
   @DomName('SVGMatrix.a')
   @DocsEditable()
-  void set a(num value) => _blink.BlinkSVGMatrix.instance.a_Setter_(unwrap_jso(this), value);
+  set a(num value) => _blink.BlinkSVGMatrix.instance.a_Setter_(unwrap_jso(this), value);
   
   @DomName('SVGMatrix.b')
   @DocsEditable()
@@ -3308,7 +4336,7 @@
   
   @DomName('SVGMatrix.b')
   @DocsEditable()
-  void set b(num value) => _blink.BlinkSVGMatrix.instance.b_Setter_(unwrap_jso(this), value);
+  set b(num value) => _blink.BlinkSVGMatrix.instance.b_Setter_(unwrap_jso(this), value);
   
   @DomName('SVGMatrix.c')
   @DocsEditable()
@@ -3316,7 +4344,7 @@
   
   @DomName('SVGMatrix.c')
   @DocsEditable()
-  void set c(num value) => _blink.BlinkSVGMatrix.instance.c_Setter_(unwrap_jso(this), value);
+  set c(num value) => _blink.BlinkSVGMatrix.instance.c_Setter_(unwrap_jso(this), value);
   
   @DomName('SVGMatrix.d')
   @DocsEditable()
@@ -3324,7 +4352,7 @@
   
   @DomName('SVGMatrix.d')
   @DocsEditable()
-  void set d(num value) => _blink.BlinkSVGMatrix.instance.d_Setter_(unwrap_jso(this), value);
+  set d(num value) => _blink.BlinkSVGMatrix.instance.d_Setter_(unwrap_jso(this), value);
   
   @DomName('SVGMatrix.e')
   @DocsEditable()
@@ -3332,7 +4360,7 @@
   
   @DomName('SVGMatrix.e')
   @DocsEditable()
-  void set e(num value) => _blink.BlinkSVGMatrix.instance.e_Setter_(unwrap_jso(this), value);
+  set e(num value) => _blink.BlinkSVGMatrix.instance.e_Setter_(unwrap_jso(this), value);
   
   @DomName('SVGMatrix.f')
   @DocsEditable()
@@ -3340,51 +4368,51 @@
   
   @DomName('SVGMatrix.f')
   @DocsEditable()
-  void set f(num value) => _blink.BlinkSVGMatrix.instance.f_Setter_(unwrap_jso(this), value);
+  set f(num value) => _blink.BlinkSVGMatrix.instance.f_Setter_(unwrap_jso(this), value);
   
   @DomName('SVGMatrix.flipX')
   @DocsEditable()
-  Matrix flipX() => _blink.BlinkSVGMatrix.instance.flipX_Callback_0_(unwrap_jso(this));
+  Matrix flipX() => wrap_jso(_blink.BlinkSVGMatrix.instance.flipX_Callback_0_(unwrap_jso(this)));
   
   @DomName('SVGMatrix.flipY')
   @DocsEditable()
-  Matrix flipY() => _blink.BlinkSVGMatrix.instance.flipY_Callback_0_(unwrap_jso(this));
+  Matrix flipY() => wrap_jso(_blink.BlinkSVGMatrix.instance.flipY_Callback_0_(unwrap_jso(this)));
   
   @DomName('SVGMatrix.inverse')
   @DocsEditable()
-  Matrix inverse() => _blink.BlinkSVGMatrix.instance.inverse_Callback_0_(unwrap_jso(this));
+  Matrix inverse() => wrap_jso(_blink.BlinkSVGMatrix.instance.inverse_Callback_0_(unwrap_jso(this)));
   
   @DomName('SVGMatrix.multiply')
   @DocsEditable()
-  Matrix multiply(Matrix secondMatrix) => _blink.BlinkSVGMatrix.instance.multiply_Callback_1_(unwrap_jso(this), unwrap_jso(secondMatrix));
+  Matrix multiply(Matrix secondMatrix) => wrap_jso(_blink.BlinkSVGMatrix.instance.multiply_Callback_1_(unwrap_jso(this), unwrap_jso(secondMatrix)));
   
   @DomName('SVGMatrix.rotate')
   @DocsEditable()
-  Matrix rotate(num angle) => _blink.BlinkSVGMatrix.instance.rotate_Callback_1_(unwrap_jso(this), angle);
+  Matrix rotate(num angle) => wrap_jso(_blink.BlinkSVGMatrix.instance.rotate_Callback_1_(unwrap_jso(this), angle));
   
   @DomName('SVGMatrix.rotateFromVector')
   @DocsEditable()
-  Matrix rotateFromVector(num x, num y) => _blink.BlinkSVGMatrix.instance.rotateFromVector_Callback_2_(unwrap_jso(this), x, y);
+  Matrix rotateFromVector(num x, num y) => wrap_jso(_blink.BlinkSVGMatrix.instance.rotateFromVector_Callback_2_(unwrap_jso(this), x, y));
   
   @DomName('SVGMatrix.scale')
   @DocsEditable()
-  Matrix scale(num scaleFactor) => _blink.BlinkSVGMatrix.instance.scale_Callback_1_(unwrap_jso(this), scaleFactor);
+  Matrix scale(num scaleFactor) => wrap_jso(_blink.BlinkSVGMatrix.instance.scale_Callback_1_(unwrap_jso(this), scaleFactor));
   
   @DomName('SVGMatrix.scaleNonUniform')
   @DocsEditable()
-  Matrix scaleNonUniform(num scaleFactorX, num scaleFactorY) => _blink.BlinkSVGMatrix.instance.scaleNonUniform_Callback_2_(unwrap_jso(this), scaleFactorX, scaleFactorY);
+  Matrix scaleNonUniform(num scaleFactorX, num scaleFactorY) => wrap_jso(_blink.BlinkSVGMatrix.instance.scaleNonUniform_Callback_2_(unwrap_jso(this), scaleFactorX, scaleFactorY));
   
   @DomName('SVGMatrix.skewX')
   @DocsEditable()
-  Matrix skewX(num angle) => _blink.BlinkSVGMatrix.instance.skewX_Callback_1_(unwrap_jso(this), angle);
+  Matrix skewX(num angle) => wrap_jso(_blink.BlinkSVGMatrix.instance.skewX_Callback_1_(unwrap_jso(this), angle));
   
   @DomName('SVGMatrix.skewY')
   @DocsEditable()
-  Matrix skewY(num angle) => _blink.BlinkSVGMatrix.instance.skewY_Callback_1_(unwrap_jso(this), angle);
+  Matrix skewY(num angle) => wrap_jso(_blink.BlinkSVGMatrix.instance.skewY_Callback_1_(unwrap_jso(this), angle));
   
   @DomName('SVGMatrix.translate')
   @DocsEditable()
-  Matrix translate(num x, num y) => _blink.BlinkSVGMatrix.instance.translate_Callback_2_(unwrap_jso(this), x, y);
+  Matrix translate(num x, num y) => wrap_jso(_blink.BlinkSVGMatrix.instance.translate_Callback_2_(unwrap_jso(this), x, y));
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -3400,6 +4428,20 @@
 class MetadataElement extends SvgElement {
   // To suppress missing implicit constructor warnings.
   factory MetadataElement._() { throw new UnsupportedError("Not supported"); }
+
+
+  @Deprecated("Internal Use Only")
+  static MetadataElement internalCreateMetadataElement() {
+    return new MetadataElement._internalWrap();
+  }
+
+  factory MetadataElement._internalWrap() {
+    return new MetadataElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  MetadataElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -3418,17 +4460,32 @@
 @DocsEditable()
 @DomName('SVGNumber')
 @Unstable()
-class Number extends NativeFieldWrapperClass2 {
+class Number extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory Number._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static Number internalCreateNumber() {
+    return new Number._internalWrap();
+  }
+
+  factory Number._internalWrap() {
+    return new Number.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  Number.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('SVGNumber.value')
   @DocsEditable()
   num get value => _blink.BlinkSVGNumber.instance.value_Getter_(unwrap_jso(this));
   
   @DomName('SVGNumber.value')
   @DocsEditable()
-  void set value(num value) => _blink.BlinkSVGNumber.instance.value_Setter_(unwrap_jso(this), value);
+  set value(num value) => _blink.BlinkSVGNumber.instance.value_Setter_(unwrap_jso(this), value);
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -3441,10 +4498,25 @@
 @DocsEditable()
 @DomName('SVGNumberList')
 @Unstable()
-class NumberList extends NativeFieldWrapperClass2 with ListMixin<Number>, ImmutableListMixin<Number> implements List<Number> {
+class NumberList extends DartHtmlDomObject with ListMixin<Number>, ImmutableListMixin<Number> implements List<Number> {
   // To suppress missing implicit constructor warnings.
   factory NumberList._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static NumberList internalCreateNumberList() {
+    return new NumberList._internalWrap();
+  }
+
+  factory NumberList._internalWrap() {
+    return new NumberList.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  NumberList.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('SVGNumberList.length')
   @DocsEditable()
   @Experimental() // untriaged
@@ -3467,7 +4539,7 @@
   // Number is the element type.
 
 
-  void set length(int value) {
+  set length(int value) {
     throw new UnsupportedError("Cannot resize immutable List.");
   }
 
@@ -3505,7 +4577,7 @@
   
   @DomName('SVGNumberList.appendItem')
   @DocsEditable()
-  Number appendItem(Number item) => _blink.BlinkSVGNumberList.instance.appendItem_Callback_1_(unwrap_jso(this), unwrap_jso(item));
+  Number appendItem(Number item) => wrap_jso(_blink.BlinkSVGNumberList.instance.appendItem_Callback_1_(unwrap_jso(this), unwrap_jso(item)));
   
   @DomName('SVGNumberList.clear')
   @DocsEditable()
@@ -3513,23 +4585,23 @@
   
   @DomName('SVGNumberList.getItem')
   @DocsEditable()
-  Number getItem(int index) => _blink.BlinkSVGNumberList.instance.getItem_Callback_1_(unwrap_jso(this), index);
+  Number getItem(int index) => wrap_jso(_blink.BlinkSVGNumberList.instance.getItem_Callback_1_(unwrap_jso(this), index));
   
   @DomName('SVGNumberList.initialize')
   @DocsEditable()
-  Number initialize(Number item) => _blink.BlinkSVGNumberList.instance.initialize_Callback_1_(unwrap_jso(this), unwrap_jso(item));
+  Number initialize(Number item) => wrap_jso(_blink.BlinkSVGNumberList.instance.initialize_Callback_1_(unwrap_jso(this), unwrap_jso(item)));
   
   @DomName('SVGNumberList.insertItemBefore')
   @DocsEditable()
-  Number insertItemBefore(Number item, int index) => _blink.BlinkSVGNumberList.instance.insertItemBefore_Callback_2_(unwrap_jso(this), unwrap_jso(item), index);
+  Number insertItemBefore(Number item, int index) => wrap_jso(_blink.BlinkSVGNumberList.instance.insertItemBefore_Callback_2_(unwrap_jso(this), unwrap_jso(item), index));
   
   @DomName('SVGNumberList.removeItem')
   @DocsEditable()
-  Number removeItem(int index) => _blink.BlinkSVGNumberList.instance.removeItem_Callback_1_(unwrap_jso(this), index);
+  Number removeItem(int index) => wrap_jso(_blink.BlinkSVGNumberList.instance.removeItem_Callback_1_(unwrap_jso(this), index));
   
   @DomName('SVGNumberList.replaceItem')
   @DocsEditable()
-  Number replaceItem(Number item, int index) => _blink.BlinkSVGNumberList.instance.replaceItem_Callback_2_(unwrap_jso(this), unwrap_jso(item), index);
+  Number replaceItem(Number item, int index) => wrap_jso(_blink.BlinkSVGNumberList.instance.replaceItem_Callback_2_(unwrap_jso(this), unwrap_jso(item), index));
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -3549,6 +4621,20 @@
   @DomName('SVGPathElement.SVGPathElement')
   @DocsEditable()
   factory PathElement() => _SvgElementFactoryProvider.createSvgElement_tag("path");
+
+
+  @Deprecated("Internal Use Only")
+  static PathElement internalCreatePathElement() {
+    return new PathElement._internalWrap();
+  }
+
+  factory PathElement._internalWrap() {
+    return new PathElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  PathElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -3578,79 +4664,79 @@
   
   @DomName('SVGPathElement.createSVGPathSegArcAbs')
   @DocsEditable()
-  PathSegArcAbs createSvgPathSegArcAbs(num x, num y, num r1, num r2, num angle, bool largeArcFlag, bool sweepFlag) => _blink.BlinkSVGPathElement.instance.createSVGPathSegArcAbs_Callback_7_(unwrap_jso(this), x, y, r1, r2, angle, largeArcFlag, sweepFlag);
+  PathSegArcAbs createSvgPathSegArcAbs(num x, num y, num r1, num r2, num angle, bool largeArcFlag, bool sweepFlag) => wrap_jso(_blink.BlinkSVGPathElement.instance.createSVGPathSegArcAbs_Callback_7_(unwrap_jso(this), x, y, r1, r2, angle, largeArcFlag, sweepFlag));
   
   @DomName('SVGPathElement.createSVGPathSegArcRel')
   @DocsEditable()
-  PathSegArcRel createSvgPathSegArcRel(num x, num y, num r1, num r2, num angle, bool largeArcFlag, bool sweepFlag) => _blink.BlinkSVGPathElement.instance.createSVGPathSegArcRel_Callback_7_(unwrap_jso(this), x, y, r1, r2, angle, largeArcFlag, sweepFlag);
+  PathSegArcRel createSvgPathSegArcRel(num x, num y, num r1, num r2, num angle, bool largeArcFlag, bool sweepFlag) => wrap_jso(_blink.BlinkSVGPathElement.instance.createSVGPathSegArcRel_Callback_7_(unwrap_jso(this), x, y, r1, r2, angle, largeArcFlag, sweepFlag));
   
   @DomName('SVGPathElement.createSVGPathSegClosePath')
   @DocsEditable()
-  PathSegClosePath createSvgPathSegClosePath() => _blink.BlinkSVGPathElement.instance.createSVGPathSegClosePath_Callback_0_(unwrap_jso(this));
+  PathSegClosePath createSvgPathSegClosePath() => wrap_jso(_blink.BlinkSVGPathElement.instance.createSVGPathSegClosePath_Callback_0_(unwrap_jso(this)));
   
   @DomName('SVGPathElement.createSVGPathSegCurvetoCubicAbs')
   @DocsEditable()
-  PathSegCurvetoCubicAbs createSvgPathSegCurvetoCubicAbs(num x, num y, num x1, num y1, num x2, num y2) => _blink.BlinkSVGPathElement.instance.createSVGPathSegCurvetoCubicAbs_Callback_6_(unwrap_jso(this), x, y, x1, y1, x2, y2);
+  PathSegCurvetoCubicAbs createSvgPathSegCurvetoCubicAbs(num x, num y, num x1, num y1, num x2, num y2) => wrap_jso(_blink.BlinkSVGPathElement.instance.createSVGPathSegCurvetoCubicAbs_Callback_6_(unwrap_jso(this), x, y, x1, y1, x2, y2));
   
   @DomName('SVGPathElement.createSVGPathSegCurvetoCubicRel')
   @DocsEditable()
-  PathSegCurvetoCubicRel createSvgPathSegCurvetoCubicRel(num x, num y, num x1, num y1, num x2, num y2) => _blink.BlinkSVGPathElement.instance.createSVGPathSegCurvetoCubicRel_Callback_6_(unwrap_jso(this), x, y, x1, y1, x2, y2);
+  PathSegCurvetoCubicRel createSvgPathSegCurvetoCubicRel(num x, num y, num x1, num y1, num x2, num y2) => wrap_jso(_blink.BlinkSVGPathElement.instance.createSVGPathSegCurvetoCubicRel_Callback_6_(unwrap_jso(this), x, y, x1, y1, x2, y2));
   
   @DomName('SVGPathElement.createSVGPathSegCurvetoCubicSmoothAbs')
   @DocsEditable()
-  PathSegCurvetoCubicSmoothAbs createSvgPathSegCurvetoCubicSmoothAbs(num x, num y, num x2, num y2) => _blink.BlinkSVGPathElement.instance.createSVGPathSegCurvetoCubicSmoothAbs_Callback_4_(unwrap_jso(this), x, y, x2, y2);
+  PathSegCurvetoCubicSmoothAbs createSvgPathSegCurvetoCubicSmoothAbs(num x, num y, num x2, num y2) => wrap_jso(_blink.BlinkSVGPathElement.instance.createSVGPathSegCurvetoCubicSmoothAbs_Callback_4_(unwrap_jso(this), x, y, x2, y2));
   
   @DomName('SVGPathElement.createSVGPathSegCurvetoCubicSmoothRel')
   @DocsEditable()
-  PathSegCurvetoCubicSmoothRel createSvgPathSegCurvetoCubicSmoothRel(num x, num y, num x2, num y2) => _blink.BlinkSVGPathElement.instance.createSVGPathSegCurvetoCubicSmoothRel_Callback_4_(unwrap_jso(this), x, y, x2, y2);
+  PathSegCurvetoCubicSmoothRel createSvgPathSegCurvetoCubicSmoothRel(num x, num y, num x2, num y2) => wrap_jso(_blink.BlinkSVGPathElement.instance.createSVGPathSegCurvetoCubicSmoothRel_Callback_4_(unwrap_jso(this), x, y, x2, y2));
   
   @DomName('SVGPathElement.createSVGPathSegCurvetoQuadraticAbs')
   @DocsEditable()
-  PathSegCurvetoQuadraticAbs createSvgPathSegCurvetoQuadraticAbs(num x, num y, num x1, num y1) => _blink.BlinkSVGPathElement.instance.createSVGPathSegCurvetoQuadraticAbs_Callback_4_(unwrap_jso(this), x, y, x1, y1);
+  PathSegCurvetoQuadraticAbs createSvgPathSegCurvetoQuadraticAbs(num x, num y, num x1, num y1) => wrap_jso(_blink.BlinkSVGPathElement.instance.createSVGPathSegCurvetoQuadraticAbs_Callback_4_(unwrap_jso(this), x, y, x1, y1));
   
   @DomName('SVGPathElement.createSVGPathSegCurvetoQuadraticRel')
   @DocsEditable()
-  PathSegCurvetoQuadraticRel createSvgPathSegCurvetoQuadraticRel(num x, num y, num x1, num y1) => _blink.BlinkSVGPathElement.instance.createSVGPathSegCurvetoQuadraticRel_Callback_4_(unwrap_jso(this), x, y, x1, y1);
+  PathSegCurvetoQuadraticRel createSvgPathSegCurvetoQuadraticRel(num x, num y, num x1, num y1) => wrap_jso(_blink.BlinkSVGPathElement.instance.createSVGPathSegCurvetoQuadraticRel_Callback_4_(unwrap_jso(this), x, y, x1, y1));
   
   @DomName('SVGPathElement.createSVGPathSegCurvetoQuadraticSmoothAbs')
   @DocsEditable()
-  PathSegCurvetoQuadraticSmoothAbs createSvgPathSegCurvetoQuadraticSmoothAbs(num x, num y) => _blink.BlinkSVGPathElement.instance.createSVGPathSegCurvetoQuadraticSmoothAbs_Callback_2_(unwrap_jso(this), x, y);
+  PathSegCurvetoQuadraticSmoothAbs createSvgPathSegCurvetoQuadraticSmoothAbs(num x, num y) => wrap_jso(_blink.BlinkSVGPathElement.instance.createSVGPathSegCurvetoQuadraticSmoothAbs_Callback_2_(unwrap_jso(this), x, y));
   
   @DomName('SVGPathElement.createSVGPathSegCurvetoQuadraticSmoothRel')
   @DocsEditable()
-  PathSegCurvetoQuadraticSmoothRel createSvgPathSegCurvetoQuadraticSmoothRel(num x, num y) => _blink.BlinkSVGPathElement.instance.createSVGPathSegCurvetoQuadraticSmoothRel_Callback_2_(unwrap_jso(this), x, y);
+  PathSegCurvetoQuadraticSmoothRel createSvgPathSegCurvetoQuadraticSmoothRel(num x, num y) => wrap_jso(_blink.BlinkSVGPathElement.instance.createSVGPathSegCurvetoQuadraticSmoothRel_Callback_2_(unwrap_jso(this), x, y));
   
   @DomName('SVGPathElement.createSVGPathSegLinetoAbs')
   @DocsEditable()
-  PathSegLinetoAbs createSvgPathSegLinetoAbs(num x, num y) => _blink.BlinkSVGPathElement.instance.createSVGPathSegLinetoAbs_Callback_2_(unwrap_jso(this), x, y);
+  PathSegLinetoAbs createSvgPathSegLinetoAbs(num x, num y) => wrap_jso(_blink.BlinkSVGPathElement.instance.createSVGPathSegLinetoAbs_Callback_2_(unwrap_jso(this), x, y));
   
   @DomName('SVGPathElement.createSVGPathSegLinetoHorizontalAbs')
   @DocsEditable()
-  PathSegLinetoHorizontalAbs createSvgPathSegLinetoHorizontalAbs(num x) => _blink.BlinkSVGPathElement.instance.createSVGPathSegLinetoHorizontalAbs_Callback_1_(unwrap_jso(this), x);
+  PathSegLinetoHorizontalAbs createSvgPathSegLinetoHorizontalAbs(num x) => wrap_jso(_blink.BlinkSVGPathElement.instance.createSVGPathSegLinetoHorizontalAbs_Callback_1_(unwrap_jso(this), x));
   
   @DomName('SVGPathElement.createSVGPathSegLinetoHorizontalRel')
   @DocsEditable()
-  PathSegLinetoHorizontalRel createSvgPathSegLinetoHorizontalRel(num x) => _blink.BlinkSVGPathElement.instance.createSVGPathSegLinetoHorizontalRel_Callback_1_(unwrap_jso(this), x);
+  PathSegLinetoHorizontalRel createSvgPathSegLinetoHorizontalRel(num x) => wrap_jso(_blink.BlinkSVGPathElement.instance.createSVGPathSegLinetoHorizontalRel_Callback_1_(unwrap_jso(this), x));
   
   @DomName('SVGPathElement.createSVGPathSegLinetoRel')
   @DocsEditable()
-  PathSegLinetoRel createSvgPathSegLinetoRel(num x, num y) => _blink.BlinkSVGPathElement.instance.createSVGPathSegLinetoRel_Callback_2_(unwrap_jso(this), x, y);
+  PathSegLinetoRel createSvgPathSegLinetoRel(num x, num y) => wrap_jso(_blink.BlinkSVGPathElement.instance.createSVGPathSegLinetoRel_Callback_2_(unwrap_jso(this), x, y));
   
   @DomName('SVGPathElement.createSVGPathSegLinetoVerticalAbs')
   @DocsEditable()
-  PathSegLinetoVerticalAbs createSvgPathSegLinetoVerticalAbs(num y) => _blink.BlinkSVGPathElement.instance.createSVGPathSegLinetoVerticalAbs_Callback_1_(unwrap_jso(this), y);
+  PathSegLinetoVerticalAbs createSvgPathSegLinetoVerticalAbs(num y) => wrap_jso(_blink.BlinkSVGPathElement.instance.createSVGPathSegLinetoVerticalAbs_Callback_1_(unwrap_jso(this), y));
   
   @DomName('SVGPathElement.createSVGPathSegLinetoVerticalRel')
   @DocsEditable()
-  PathSegLinetoVerticalRel createSvgPathSegLinetoVerticalRel(num y) => _blink.BlinkSVGPathElement.instance.createSVGPathSegLinetoVerticalRel_Callback_1_(unwrap_jso(this), y);
+  PathSegLinetoVerticalRel createSvgPathSegLinetoVerticalRel(num y) => wrap_jso(_blink.BlinkSVGPathElement.instance.createSVGPathSegLinetoVerticalRel_Callback_1_(unwrap_jso(this), y));
   
   @DomName('SVGPathElement.createSVGPathSegMovetoAbs')
   @DocsEditable()
-  PathSegMovetoAbs createSvgPathSegMovetoAbs(num x, num y) => _blink.BlinkSVGPathElement.instance.createSVGPathSegMovetoAbs_Callback_2_(unwrap_jso(this), x, y);
+  PathSegMovetoAbs createSvgPathSegMovetoAbs(num x, num y) => wrap_jso(_blink.BlinkSVGPathElement.instance.createSVGPathSegMovetoAbs_Callback_2_(unwrap_jso(this), x, y));
   
   @DomName('SVGPathElement.createSVGPathSegMovetoRel')
   @DocsEditable()
-  PathSegMovetoRel createSvgPathSegMovetoRel(num x, num y) => _blink.BlinkSVGPathElement.instance.createSVGPathSegMovetoRel_Callback_2_(unwrap_jso(this), x, y);
+  PathSegMovetoRel createSvgPathSegMovetoRel(num x, num y) => wrap_jso(_blink.BlinkSVGPathElement.instance.createSVGPathSegMovetoRel_Callback_2_(unwrap_jso(this), x, y));
   
   @DomName('SVGPathElement.getPathSegAtLength')
   @DocsEditable()
@@ -3658,11 +4744,11 @@
   
   @DomName('SVGPathElement.getPointAtLength')
   @DocsEditable()
-  Point getPointAtLength(num distance) => _blink.BlinkSVGPathElement.instance.getPointAtLength_Callback_1_(unwrap_jso(this), distance);
+  Point getPointAtLength(num distance) => wrap_jso(_blink.BlinkSVGPathElement.instance.getPointAtLength_Callback_1_(unwrap_jso(this), distance));
   
   @DomName('SVGPathElement.getTotalLength')
   @DocsEditable()
-  double getTotalLength() => _blink.BlinkSVGPathElement.instance.getTotalLength_Callback_0_(unwrap_jso(this));
+  num getTotalLength() => _blink.BlinkSVGPathElement.instance.getTotalLength_Callback_0_(unwrap_jso(this));
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -3675,10 +4761,25 @@
 @DocsEditable()
 @DomName('SVGPathSeg')
 @Unstable()
-class PathSeg extends NativeFieldWrapperClass2 {
+class PathSeg extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory PathSeg._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static PathSeg internalCreatePathSeg() {
+    return new PathSeg._internalWrap();
+  }
+
+  factory PathSeg._internalWrap() {
+    return new PathSeg.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  PathSeg.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('SVGPathSeg.PATHSEG_ARC_ABS')
   @DocsEditable()
   static const int PATHSEG_ARC_ABS = 10;
@@ -3782,13 +4883,27 @@
   // To suppress missing implicit constructor warnings.
   factory PathSegArcAbs._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static PathSegArcAbs internalCreatePathSegArcAbs() {
+    return new PathSegArcAbs._internalWrap();
+  }
+
+  factory PathSegArcAbs._internalWrap() {
+    return new PathSegArcAbs.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  PathSegArcAbs.internal_() : super.internal_();
+
+
   @DomName('SVGPathSegArcAbs.angle')
   @DocsEditable()
   num get angle => _blink.BlinkSVGPathSegArcAbs.instance.angle_Getter_(unwrap_jso(this));
   
   @DomName('SVGPathSegArcAbs.angle')
   @DocsEditable()
-  void set angle(num value) => _blink.BlinkSVGPathSegArcAbs.instance.angle_Setter_(unwrap_jso(this), value);
+  set angle(num value) => _blink.BlinkSVGPathSegArcAbs.instance.angle_Setter_(unwrap_jso(this), value);
   
   @DomName('SVGPathSegArcAbs.largeArcFlag')
   @DocsEditable()
@@ -3796,7 +4911,7 @@
   
   @DomName('SVGPathSegArcAbs.largeArcFlag')
   @DocsEditable()
-  void set largeArcFlag(bool value) => _blink.BlinkSVGPathSegArcAbs.instance.largeArcFlag_Setter_(unwrap_jso(this), value);
+  set largeArcFlag(bool value) => _blink.BlinkSVGPathSegArcAbs.instance.largeArcFlag_Setter_(unwrap_jso(this), value);
   
   @DomName('SVGPathSegArcAbs.r1')
   @DocsEditable()
@@ -3804,7 +4919,7 @@
   
   @DomName('SVGPathSegArcAbs.r1')
   @DocsEditable()
-  void set r1(num value) => _blink.BlinkSVGPathSegArcAbs.instance.r1_Setter_(unwrap_jso(this), value);
+  set r1(num value) => _blink.BlinkSVGPathSegArcAbs.instance.r1_Setter_(unwrap_jso(this), value);
   
   @DomName('SVGPathSegArcAbs.r2')
   @DocsEditable()
@@ -3812,7 +4927,7 @@
   
   @DomName('SVGPathSegArcAbs.r2')
   @DocsEditable()
-  void set r2(num value) => _blink.BlinkSVGPathSegArcAbs.instance.r2_Setter_(unwrap_jso(this), value);
+  set r2(num value) => _blink.BlinkSVGPathSegArcAbs.instance.r2_Setter_(unwrap_jso(this), value);
   
   @DomName('SVGPathSegArcAbs.sweepFlag')
   @DocsEditable()
@@ -3820,7 +4935,7 @@
   
   @DomName('SVGPathSegArcAbs.sweepFlag')
   @DocsEditable()
-  void set sweepFlag(bool value) => _blink.BlinkSVGPathSegArcAbs.instance.sweepFlag_Setter_(unwrap_jso(this), value);
+  set sweepFlag(bool value) => _blink.BlinkSVGPathSegArcAbs.instance.sweepFlag_Setter_(unwrap_jso(this), value);
   
   @DomName('SVGPathSegArcAbs.x')
   @DocsEditable()
@@ -3828,7 +4943,7 @@
   
   @DomName('SVGPathSegArcAbs.x')
   @DocsEditable()
-  void set x(num value) => _blink.BlinkSVGPathSegArcAbs.instance.x_Setter_(unwrap_jso(this), value);
+  set x(num value) => _blink.BlinkSVGPathSegArcAbs.instance.x_Setter_(unwrap_jso(this), value);
   
   @DomName('SVGPathSegArcAbs.y')
   @DocsEditable()
@@ -3836,7 +4951,7 @@
   
   @DomName('SVGPathSegArcAbs.y')
   @DocsEditable()
-  void set y(num value) => _blink.BlinkSVGPathSegArcAbs.instance.y_Setter_(unwrap_jso(this), value);
+  set y(num value) => _blink.BlinkSVGPathSegArcAbs.instance.y_Setter_(unwrap_jso(this), value);
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -3853,13 +4968,27 @@
   // To suppress missing implicit constructor warnings.
   factory PathSegArcRel._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static PathSegArcRel internalCreatePathSegArcRel() {
+    return new PathSegArcRel._internalWrap();
+  }
+
+  factory PathSegArcRel._internalWrap() {
+    return new PathSegArcRel.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  PathSegArcRel.internal_() : super.internal_();
+
+
   @DomName('SVGPathSegArcRel.angle')
   @DocsEditable()
   num get angle => _blink.BlinkSVGPathSegArcRel.instance.angle_Getter_(unwrap_jso(this));
   
   @DomName('SVGPathSegArcRel.angle')
   @DocsEditable()
-  void set angle(num value) => _blink.BlinkSVGPathSegArcRel.instance.angle_Setter_(unwrap_jso(this), value);
+  set angle(num value) => _blink.BlinkSVGPathSegArcRel.instance.angle_Setter_(unwrap_jso(this), value);
   
   @DomName('SVGPathSegArcRel.largeArcFlag')
   @DocsEditable()
@@ -3867,7 +4996,7 @@
   
   @DomName('SVGPathSegArcRel.largeArcFlag')
   @DocsEditable()
-  void set largeArcFlag(bool value) => _blink.BlinkSVGPathSegArcRel.instance.largeArcFlag_Setter_(unwrap_jso(this), value);
+  set largeArcFlag(bool value) => _blink.BlinkSVGPathSegArcRel.instance.largeArcFlag_Setter_(unwrap_jso(this), value);
   
   @DomName('SVGPathSegArcRel.r1')
   @DocsEditable()
@@ -3875,7 +5004,7 @@
   
   @DomName('SVGPathSegArcRel.r1')
   @DocsEditable()
-  void set r1(num value) => _blink.BlinkSVGPathSegArcRel.instance.r1_Setter_(unwrap_jso(this), value);
+  set r1(num value) => _blink.BlinkSVGPathSegArcRel.instance.r1_Setter_(unwrap_jso(this), value);
   
   @DomName('SVGPathSegArcRel.r2')
   @DocsEditable()
@@ -3883,7 +5012,7 @@
   
   @DomName('SVGPathSegArcRel.r2')
   @DocsEditable()
-  void set r2(num value) => _blink.BlinkSVGPathSegArcRel.instance.r2_Setter_(unwrap_jso(this), value);
+  set r2(num value) => _blink.BlinkSVGPathSegArcRel.instance.r2_Setter_(unwrap_jso(this), value);
   
   @DomName('SVGPathSegArcRel.sweepFlag')
   @DocsEditable()
@@ -3891,7 +5020,7 @@
   
   @DomName('SVGPathSegArcRel.sweepFlag')
   @DocsEditable()
-  void set sweepFlag(bool value) => _blink.BlinkSVGPathSegArcRel.instance.sweepFlag_Setter_(unwrap_jso(this), value);
+  set sweepFlag(bool value) => _blink.BlinkSVGPathSegArcRel.instance.sweepFlag_Setter_(unwrap_jso(this), value);
   
   @DomName('SVGPathSegArcRel.x')
   @DocsEditable()
@@ -3899,7 +5028,7 @@
   
   @DomName('SVGPathSegArcRel.x')
   @DocsEditable()
-  void set x(num value) => _blink.BlinkSVGPathSegArcRel.instance.x_Setter_(unwrap_jso(this), value);
+  set x(num value) => _blink.BlinkSVGPathSegArcRel.instance.x_Setter_(unwrap_jso(this), value);
   
   @DomName('SVGPathSegArcRel.y')
   @DocsEditable()
@@ -3907,7 +5036,7 @@
   
   @DomName('SVGPathSegArcRel.y')
   @DocsEditable()
-  void set y(num value) => _blink.BlinkSVGPathSegArcRel.instance.y_Setter_(unwrap_jso(this), value);
+  set y(num value) => _blink.BlinkSVGPathSegArcRel.instance.y_Setter_(unwrap_jso(this), value);
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -3924,6 +5053,20 @@
   // To suppress missing implicit constructor warnings.
   factory PathSegClosePath._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static PathSegClosePath internalCreatePathSegClosePath() {
+    return new PathSegClosePath._internalWrap();
+  }
+
+  factory PathSegClosePath._internalWrap() {
+    return new PathSegClosePath.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  PathSegClosePath.internal_() : super.internal_();
+
+
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -3939,13 +5082,27 @@
   // To suppress missing implicit constructor warnings.
   factory PathSegCurvetoCubicAbs._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static PathSegCurvetoCubicAbs internalCreatePathSegCurvetoCubicAbs() {
+    return new PathSegCurvetoCubicAbs._internalWrap();
+  }
+
+  factory PathSegCurvetoCubicAbs._internalWrap() {
+    return new PathSegCurvetoCubicAbs.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  PathSegCurvetoCubicAbs.internal_() : super.internal_();
+
+
   @DomName('SVGPathSegCurvetoCubicAbs.x')
   @DocsEditable()
   num get x => _blink.BlinkSVGPathSegCurvetoCubicAbs.instance.x_Getter_(unwrap_jso(this));
   
   @DomName('SVGPathSegCurvetoCubicAbs.x')
   @DocsEditable()
-  void set x(num value) => _blink.BlinkSVGPathSegCurvetoCubicAbs.instance.x_Setter_(unwrap_jso(this), value);
+  set x(num value) => _blink.BlinkSVGPathSegCurvetoCubicAbs.instance.x_Setter_(unwrap_jso(this), value);
   
   @DomName('SVGPathSegCurvetoCubicAbs.x1')
   @DocsEditable()
@@ -3953,7 +5110,7 @@
   
   @DomName('SVGPathSegCurvetoCubicAbs.x1')
   @DocsEditable()
-  void set x1(num value) => _blink.BlinkSVGPathSegCurvetoCubicAbs.instance.x1_Setter_(unwrap_jso(this), value);
+  set x1(num value) => _blink.BlinkSVGPathSegCurvetoCubicAbs.instance.x1_Setter_(unwrap_jso(this), value);
   
   @DomName('SVGPathSegCurvetoCubicAbs.x2')
   @DocsEditable()
@@ -3961,7 +5118,7 @@
   
   @DomName('SVGPathSegCurvetoCubicAbs.x2')
   @DocsEditable()
-  void set x2(num value) => _blink.BlinkSVGPathSegCurvetoCubicAbs.instance.x2_Setter_(unwrap_jso(this), value);
+  set x2(num value) => _blink.BlinkSVGPathSegCurvetoCubicAbs.instance.x2_Setter_(unwrap_jso(this), value);
   
   @DomName('SVGPathSegCurvetoCubicAbs.y')
   @DocsEditable()
@@ -3969,7 +5126,7 @@
   
   @DomName('SVGPathSegCurvetoCubicAbs.y')
   @DocsEditable()
-  void set y(num value) => _blink.BlinkSVGPathSegCurvetoCubicAbs.instance.y_Setter_(unwrap_jso(this), value);
+  set y(num value) => _blink.BlinkSVGPathSegCurvetoCubicAbs.instance.y_Setter_(unwrap_jso(this), value);
   
   @DomName('SVGPathSegCurvetoCubicAbs.y1')
   @DocsEditable()
@@ -3977,7 +5134,7 @@
   
   @DomName('SVGPathSegCurvetoCubicAbs.y1')
   @DocsEditable()
-  void set y1(num value) => _blink.BlinkSVGPathSegCurvetoCubicAbs.instance.y1_Setter_(unwrap_jso(this), value);
+  set y1(num value) => _blink.BlinkSVGPathSegCurvetoCubicAbs.instance.y1_Setter_(unwrap_jso(this), value);
   
   @DomName('SVGPathSegCurvetoCubicAbs.y2')
   @DocsEditable()
@@ -3985,7 +5142,7 @@
   
   @DomName('SVGPathSegCurvetoCubicAbs.y2')
   @DocsEditable()
-  void set y2(num value) => _blink.BlinkSVGPathSegCurvetoCubicAbs.instance.y2_Setter_(unwrap_jso(this), value);
+  set y2(num value) => _blink.BlinkSVGPathSegCurvetoCubicAbs.instance.y2_Setter_(unwrap_jso(this), value);
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -4002,13 +5159,27 @@
   // To suppress missing implicit constructor warnings.
   factory PathSegCurvetoCubicRel._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static PathSegCurvetoCubicRel internalCreatePathSegCurvetoCubicRel() {
+    return new PathSegCurvetoCubicRel._internalWrap();
+  }
+
+  factory PathSegCurvetoCubicRel._internalWrap() {
+    return new PathSegCurvetoCubicRel.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  PathSegCurvetoCubicRel.internal_() : super.internal_();
+
+
   @DomName('SVGPathSegCurvetoCubicRel.x')
   @DocsEditable()
   num get x => _blink.BlinkSVGPathSegCurvetoCubicRel.instance.x_Getter_(unwrap_jso(this));
   
   @DomName('SVGPathSegCurvetoCubicRel.x')
   @DocsEditable()
-  void set x(num value) => _blink.BlinkSVGPathSegCurvetoCubicRel.instance.x_Setter_(unwrap_jso(this), value);
+  set x(num value) => _blink.BlinkSVGPathSegCurvetoCubicRel.instance.x_Setter_(unwrap_jso(this), value);
   
   @DomName('SVGPathSegCurvetoCubicRel.x1')
   @DocsEditable()
@@ -4016,7 +5187,7 @@
   
   @DomName('SVGPathSegCurvetoCubicRel.x1')
   @DocsEditable()
-  void set x1(num value) => _blink.BlinkSVGPathSegCurvetoCubicRel.instance.x1_Setter_(unwrap_jso(this), value);
+  set x1(num value) => _blink.BlinkSVGPathSegCurvetoCubicRel.instance.x1_Setter_(unwrap_jso(this), value);
   
   @DomName('SVGPathSegCurvetoCubicRel.x2')
   @DocsEditable()
@@ -4024,7 +5195,7 @@
   
   @DomName('SVGPathSegCurvetoCubicRel.x2')
   @DocsEditable()
-  void set x2(num value) => _blink.BlinkSVGPathSegCurvetoCubicRel.instance.x2_Setter_(unwrap_jso(this), value);
+  set x2(num value) => _blink.BlinkSVGPathSegCurvetoCubicRel.instance.x2_Setter_(unwrap_jso(this), value);
   
   @DomName('SVGPathSegCurvetoCubicRel.y')
   @DocsEditable()
@@ -4032,7 +5203,7 @@
   
   @DomName('SVGPathSegCurvetoCubicRel.y')
   @DocsEditable()
-  void set y(num value) => _blink.BlinkSVGPathSegCurvetoCubicRel.instance.y_Setter_(unwrap_jso(this), value);
+  set y(num value) => _blink.BlinkSVGPathSegCurvetoCubicRel.instance.y_Setter_(unwrap_jso(this), value);
   
   @DomName('SVGPathSegCurvetoCubicRel.y1')
   @DocsEditable()
@@ -4040,7 +5211,7 @@
   
   @DomName('SVGPathSegCurvetoCubicRel.y1')
   @DocsEditable()
-  void set y1(num value) => _blink.BlinkSVGPathSegCurvetoCubicRel.instance.y1_Setter_(unwrap_jso(this), value);
+  set y1(num value) => _blink.BlinkSVGPathSegCurvetoCubicRel.instance.y1_Setter_(unwrap_jso(this), value);
   
   @DomName('SVGPathSegCurvetoCubicRel.y2')
   @DocsEditable()
@@ -4048,7 +5219,7 @@
   
   @DomName('SVGPathSegCurvetoCubicRel.y2')
   @DocsEditable()
-  void set y2(num value) => _blink.BlinkSVGPathSegCurvetoCubicRel.instance.y2_Setter_(unwrap_jso(this), value);
+  set y2(num value) => _blink.BlinkSVGPathSegCurvetoCubicRel.instance.y2_Setter_(unwrap_jso(this), value);
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -4065,13 +5236,27 @@
   // To suppress missing implicit constructor warnings.
   factory PathSegCurvetoCubicSmoothAbs._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static PathSegCurvetoCubicSmoothAbs internalCreatePathSegCurvetoCubicSmoothAbs() {
+    return new PathSegCurvetoCubicSmoothAbs._internalWrap();
+  }
+
+  factory PathSegCurvetoCubicSmoothAbs._internalWrap() {
+    return new PathSegCurvetoCubicSmoothAbs.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  PathSegCurvetoCubicSmoothAbs.internal_() : super.internal_();
+
+
   @DomName('SVGPathSegCurvetoCubicSmoothAbs.x')
   @DocsEditable()
   num get x => _blink.BlinkSVGPathSegCurvetoCubicSmoothAbs.instance.x_Getter_(unwrap_jso(this));
   
   @DomName('SVGPathSegCurvetoCubicSmoothAbs.x')
   @DocsEditable()
-  void set x(num value) => _blink.BlinkSVGPathSegCurvetoCubicSmoothAbs.instance.x_Setter_(unwrap_jso(this), value);
+  set x(num value) => _blink.BlinkSVGPathSegCurvetoCubicSmoothAbs.instance.x_Setter_(unwrap_jso(this), value);
   
   @DomName('SVGPathSegCurvetoCubicSmoothAbs.x2')
   @DocsEditable()
@@ -4079,7 +5264,7 @@
   
   @DomName('SVGPathSegCurvetoCubicSmoothAbs.x2')
   @DocsEditable()
-  void set x2(num value) => _blink.BlinkSVGPathSegCurvetoCubicSmoothAbs.instance.x2_Setter_(unwrap_jso(this), value);
+  set x2(num value) => _blink.BlinkSVGPathSegCurvetoCubicSmoothAbs.instance.x2_Setter_(unwrap_jso(this), value);
   
   @DomName('SVGPathSegCurvetoCubicSmoothAbs.y')
   @DocsEditable()
@@ -4087,7 +5272,7 @@
   
   @DomName('SVGPathSegCurvetoCubicSmoothAbs.y')
   @DocsEditable()
-  void set y(num value) => _blink.BlinkSVGPathSegCurvetoCubicSmoothAbs.instance.y_Setter_(unwrap_jso(this), value);
+  set y(num value) => _blink.BlinkSVGPathSegCurvetoCubicSmoothAbs.instance.y_Setter_(unwrap_jso(this), value);
   
   @DomName('SVGPathSegCurvetoCubicSmoothAbs.y2')
   @DocsEditable()
@@ -4095,7 +5280,7 @@
   
   @DomName('SVGPathSegCurvetoCubicSmoothAbs.y2')
   @DocsEditable()
-  void set y2(num value) => _blink.BlinkSVGPathSegCurvetoCubicSmoothAbs.instance.y2_Setter_(unwrap_jso(this), value);
+  set y2(num value) => _blink.BlinkSVGPathSegCurvetoCubicSmoothAbs.instance.y2_Setter_(unwrap_jso(this), value);
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -4112,13 +5297,27 @@
   // To suppress missing implicit constructor warnings.
   factory PathSegCurvetoCubicSmoothRel._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static PathSegCurvetoCubicSmoothRel internalCreatePathSegCurvetoCubicSmoothRel() {
+    return new PathSegCurvetoCubicSmoothRel._internalWrap();
+  }
+
+  factory PathSegCurvetoCubicSmoothRel._internalWrap() {
+    return new PathSegCurvetoCubicSmoothRel.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  PathSegCurvetoCubicSmoothRel.internal_() : super.internal_();
+
+
   @DomName('SVGPathSegCurvetoCubicSmoothRel.x')
   @DocsEditable()
   num get x => _blink.BlinkSVGPathSegCurvetoCubicSmoothRel.instance.x_Getter_(unwrap_jso(this));
   
   @DomName('SVGPathSegCurvetoCubicSmoothRel.x')
   @DocsEditable()
-  void set x(num value) => _blink.BlinkSVGPathSegCurvetoCubicSmoothRel.instance.x_Setter_(unwrap_jso(this), value);
+  set x(num value) => _blink.BlinkSVGPathSegCurvetoCubicSmoothRel.instance.x_Setter_(unwrap_jso(this), value);
   
   @DomName('SVGPathSegCurvetoCubicSmoothRel.x2')
   @DocsEditable()
@@ -4126,7 +5325,7 @@
   
   @DomName('SVGPathSegCurvetoCubicSmoothRel.x2')
   @DocsEditable()
-  void set x2(num value) => _blink.BlinkSVGPathSegCurvetoCubicSmoothRel.instance.x2_Setter_(unwrap_jso(this), value);
+  set x2(num value) => _blink.BlinkSVGPathSegCurvetoCubicSmoothRel.instance.x2_Setter_(unwrap_jso(this), value);
   
   @DomName('SVGPathSegCurvetoCubicSmoothRel.y')
   @DocsEditable()
@@ -4134,7 +5333,7 @@
   
   @DomName('SVGPathSegCurvetoCubicSmoothRel.y')
   @DocsEditable()
-  void set y(num value) => _blink.BlinkSVGPathSegCurvetoCubicSmoothRel.instance.y_Setter_(unwrap_jso(this), value);
+  set y(num value) => _blink.BlinkSVGPathSegCurvetoCubicSmoothRel.instance.y_Setter_(unwrap_jso(this), value);
   
   @DomName('SVGPathSegCurvetoCubicSmoothRel.y2')
   @DocsEditable()
@@ -4142,7 +5341,7 @@
   
   @DomName('SVGPathSegCurvetoCubicSmoothRel.y2')
   @DocsEditable()
-  void set y2(num value) => _blink.BlinkSVGPathSegCurvetoCubicSmoothRel.instance.y2_Setter_(unwrap_jso(this), value);
+  set y2(num value) => _blink.BlinkSVGPathSegCurvetoCubicSmoothRel.instance.y2_Setter_(unwrap_jso(this), value);
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -4159,13 +5358,27 @@
   // To suppress missing implicit constructor warnings.
   factory PathSegCurvetoQuadraticAbs._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static PathSegCurvetoQuadraticAbs internalCreatePathSegCurvetoQuadraticAbs() {
+    return new PathSegCurvetoQuadraticAbs._internalWrap();
+  }
+
+  factory PathSegCurvetoQuadraticAbs._internalWrap() {
+    return new PathSegCurvetoQuadraticAbs.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  PathSegCurvetoQuadraticAbs.internal_() : super.internal_();
+
+
   @DomName('SVGPathSegCurvetoQuadraticAbs.x')
   @DocsEditable()
   num get x => _blink.BlinkSVGPathSegCurvetoQuadraticAbs.instance.x_Getter_(unwrap_jso(this));
   
   @DomName('SVGPathSegCurvetoQuadraticAbs.x')
   @DocsEditable()
-  void set x(num value) => _blink.BlinkSVGPathSegCurvetoQuadraticAbs.instance.x_Setter_(unwrap_jso(this), value);
+  set x(num value) => _blink.BlinkSVGPathSegCurvetoQuadraticAbs.instance.x_Setter_(unwrap_jso(this), value);
   
   @DomName('SVGPathSegCurvetoQuadraticAbs.x1')
   @DocsEditable()
@@ -4173,7 +5386,7 @@
   
   @DomName('SVGPathSegCurvetoQuadraticAbs.x1')
   @DocsEditable()
-  void set x1(num value) => _blink.BlinkSVGPathSegCurvetoQuadraticAbs.instance.x1_Setter_(unwrap_jso(this), value);
+  set x1(num value) => _blink.BlinkSVGPathSegCurvetoQuadraticAbs.instance.x1_Setter_(unwrap_jso(this), value);
   
   @DomName('SVGPathSegCurvetoQuadraticAbs.y')
   @DocsEditable()
@@ -4181,7 +5394,7 @@
   
   @DomName('SVGPathSegCurvetoQuadraticAbs.y')
   @DocsEditable()
-  void set y(num value) => _blink.BlinkSVGPathSegCurvetoQuadraticAbs.instance.y_Setter_(unwrap_jso(this), value);
+  set y(num value) => _blink.BlinkSVGPathSegCurvetoQuadraticAbs.instance.y_Setter_(unwrap_jso(this), value);
   
   @DomName('SVGPathSegCurvetoQuadraticAbs.y1')
   @DocsEditable()
@@ -4189,7 +5402,7 @@
   
   @DomName('SVGPathSegCurvetoQuadraticAbs.y1')
   @DocsEditable()
-  void set y1(num value) => _blink.BlinkSVGPathSegCurvetoQuadraticAbs.instance.y1_Setter_(unwrap_jso(this), value);
+  set y1(num value) => _blink.BlinkSVGPathSegCurvetoQuadraticAbs.instance.y1_Setter_(unwrap_jso(this), value);
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -4206,13 +5419,27 @@
   // To suppress missing implicit constructor warnings.
   factory PathSegCurvetoQuadraticRel._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static PathSegCurvetoQuadraticRel internalCreatePathSegCurvetoQuadraticRel() {
+    return new PathSegCurvetoQuadraticRel._internalWrap();
+  }
+
+  factory PathSegCurvetoQuadraticRel._internalWrap() {
+    return new PathSegCurvetoQuadraticRel.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  PathSegCurvetoQuadraticRel.internal_() : super.internal_();
+
+
   @DomName('SVGPathSegCurvetoQuadraticRel.x')
   @DocsEditable()
   num get x => _blink.BlinkSVGPathSegCurvetoQuadraticRel.instance.x_Getter_(unwrap_jso(this));
   
   @DomName('SVGPathSegCurvetoQuadraticRel.x')
   @DocsEditable()
-  void set x(num value) => _blink.BlinkSVGPathSegCurvetoQuadraticRel.instance.x_Setter_(unwrap_jso(this), value);
+  set x(num value) => _blink.BlinkSVGPathSegCurvetoQuadraticRel.instance.x_Setter_(unwrap_jso(this), value);
   
   @DomName('SVGPathSegCurvetoQuadraticRel.x1')
   @DocsEditable()
@@ -4220,7 +5447,7 @@
   
   @DomName('SVGPathSegCurvetoQuadraticRel.x1')
   @DocsEditable()
-  void set x1(num value) => _blink.BlinkSVGPathSegCurvetoQuadraticRel.instance.x1_Setter_(unwrap_jso(this), value);
+  set x1(num value) => _blink.BlinkSVGPathSegCurvetoQuadraticRel.instance.x1_Setter_(unwrap_jso(this), value);
   
   @DomName('SVGPathSegCurvetoQuadraticRel.y')
   @DocsEditable()
@@ -4228,7 +5455,7 @@
   
   @DomName('SVGPathSegCurvetoQuadraticRel.y')
   @DocsEditable()
-  void set y(num value) => _blink.BlinkSVGPathSegCurvetoQuadraticRel.instance.y_Setter_(unwrap_jso(this), value);
+  set y(num value) => _blink.BlinkSVGPathSegCurvetoQuadraticRel.instance.y_Setter_(unwrap_jso(this), value);
   
   @DomName('SVGPathSegCurvetoQuadraticRel.y1')
   @DocsEditable()
@@ -4236,7 +5463,7 @@
   
   @DomName('SVGPathSegCurvetoQuadraticRel.y1')
   @DocsEditable()
-  void set y1(num value) => _blink.BlinkSVGPathSegCurvetoQuadraticRel.instance.y1_Setter_(unwrap_jso(this), value);
+  set y1(num value) => _blink.BlinkSVGPathSegCurvetoQuadraticRel.instance.y1_Setter_(unwrap_jso(this), value);
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -4253,13 +5480,27 @@
   // To suppress missing implicit constructor warnings.
   factory PathSegCurvetoQuadraticSmoothAbs._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static PathSegCurvetoQuadraticSmoothAbs internalCreatePathSegCurvetoQuadraticSmoothAbs() {
+    return new PathSegCurvetoQuadraticSmoothAbs._internalWrap();
+  }
+
+  factory PathSegCurvetoQuadraticSmoothAbs._internalWrap() {
+    return new PathSegCurvetoQuadraticSmoothAbs.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  PathSegCurvetoQuadraticSmoothAbs.internal_() : super.internal_();
+
+
   @DomName('SVGPathSegCurvetoQuadraticSmoothAbs.x')
   @DocsEditable()
   num get x => _blink.BlinkSVGPathSegCurvetoQuadraticSmoothAbs.instance.x_Getter_(unwrap_jso(this));
   
   @DomName('SVGPathSegCurvetoQuadraticSmoothAbs.x')
   @DocsEditable()
-  void set x(num value) => _blink.BlinkSVGPathSegCurvetoQuadraticSmoothAbs.instance.x_Setter_(unwrap_jso(this), value);
+  set x(num value) => _blink.BlinkSVGPathSegCurvetoQuadraticSmoothAbs.instance.x_Setter_(unwrap_jso(this), value);
   
   @DomName('SVGPathSegCurvetoQuadraticSmoothAbs.y')
   @DocsEditable()
@@ -4267,7 +5508,7 @@
   
   @DomName('SVGPathSegCurvetoQuadraticSmoothAbs.y')
   @DocsEditable()
-  void set y(num value) => _blink.BlinkSVGPathSegCurvetoQuadraticSmoothAbs.instance.y_Setter_(unwrap_jso(this), value);
+  set y(num value) => _blink.BlinkSVGPathSegCurvetoQuadraticSmoothAbs.instance.y_Setter_(unwrap_jso(this), value);
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -4284,13 +5525,27 @@
   // To suppress missing implicit constructor warnings.
   factory PathSegCurvetoQuadraticSmoothRel._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static PathSegCurvetoQuadraticSmoothRel internalCreatePathSegCurvetoQuadraticSmoothRel() {
+    return new PathSegCurvetoQuadraticSmoothRel._internalWrap();
+  }
+
+  factory PathSegCurvetoQuadraticSmoothRel._internalWrap() {
+    return new PathSegCurvetoQuadraticSmoothRel.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  PathSegCurvetoQuadraticSmoothRel.internal_() : super.internal_();
+
+
   @DomName('SVGPathSegCurvetoQuadraticSmoothRel.x')
   @DocsEditable()
   num get x => _blink.BlinkSVGPathSegCurvetoQuadraticSmoothRel.instance.x_Getter_(unwrap_jso(this));
   
   @DomName('SVGPathSegCurvetoQuadraticSmoothRel.x')
   @DocsEditable()
-  void set x(num value) => _blink.BlinkSVGPathSegCurvetoQuadraticSmoothRel.instance.x_Setter_(unwrap_jso(this), value);
+  set x(num value) => _blink.BlinkSVGPathSegCurvetoQuadraticSmoothRel.instance.x_Setter_(unwrap_jso(this), value);
   
   @DomName('SVGPathSegCurvetoQuadraticSmoothRel.y')
   @DocsEditable()
@@ -4298,7 +5553,7 @@
   
   @DomName('SVGPathSegCurvetoQuadraticSmoothRel.y')
   @DocsEditable()
-  void set y(num value) => _blink.BlinkSVGPathSegCurvetoQuadraticSmoothRel.instance.y_Setter_(unwrap_jso(this), value);
+  set y(num value) => _blink.BlinkSVGPathSegCurvetoQuadraticSmoothRel.instance.y_Setter_(unwrap_jso(this), value);
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -4315,13 +5570,27 @@
   // To suppress missing implicit constructor warnings.
   factory PathSegLinetoAbs._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static PathSegLinetoAbs internalCreatePathSegLinetoAbs() {
+    return new PathSegLinetoAbs._internalWrap();
+  }
+
+  factory PathSegLinetoAbs._internalWrap() {
+    return new PathSegLinetoAbs.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  PathSegLinetoAbs.internal_() : super.internal_();
+
+
   @DomName('SVGPathSegLinetoAbs.x')
   @DocsEditable()
   num get x => _blink.BlinkSVGPathSegLinetoAbs.instance.x_Getter_(unwrap_jso(this));
   
   @DomName('SVGPathSegLinetoAbs.x')
   @DocsEditable()
-  void set x(num value) => _blink.BlinkSVGPathSegLinetoAbs.instance.x_Setter_(unwrap_jso(this), value);
+  set x(num value) => _blink.BlinkSVGPathSegLinetoAbs.instance.x_Setter_(unwrap_jso(this), value);
   
   @DomName('SVGPathSegLinetoAbs.y')
   @DocsEditable()
@@ -4329,7 +5598,7 @@
   
   @DomName('SVGPathSegLinetoAbs.y')
   @DocsEditable()
-  void set y(num value) => _blink.BlinkSVGPathSegLinetoAbs.instance.y_Setter_(unwrap_jso(this), value);
+  set y(num value) => _blink.BlinkSVGPathSegLinetoAbs.instance.y_Setter_(unwrap_jso(this), value);
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -4346,13 +5615,27 @@
   // To suppress missing implicit constructor warnings.
   factory PathSegLinetoHorizontalAbs._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static PathSegLinetoHorizontalAbs internalCreatePathSegLinetoHorizontalAbs() {
+    return new PathSegLinetoHorizontalAbs._internalWrap();
+  }
+
+  factory PathSegLinetoHorizontalAbs._internalWrap() {
+    return new PathSegLinetoHorizontalAbs.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  PathSegLinetoHorizontalAbs.internal_() : super.internal_();
+
+
   @DomName('SVGPathSegLinetoHorizontalAbs.x')
   @DocsEditable()
   num get x => _blink.BlinkSVGPathSegLinetoHorizontalAbs.instance.x_Getter_(unwrap_jso(this));
   
   @DomName('SVGPathSegLinetoHorizontalAbs.x')
   @DocsEditable()
-  void set x(num value) => _blink.BlinkSVGPathSegLinetoHorizontalAbs.instance.x_Setter_(unwrap_jso(this), value);
+  set x(num value) => _blink.BlinkSVGPathSegLinetoHorizontalAbs.instance.x_Setter_(unwrap_jso(this), value);
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -4369,13 +5652,27 @@
   // To suppress missing implicit constructor warnings.
   factory PathSegLinetoHorizontalRel._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static PathSegLinetoHorizontalRel internalCreatePathSegLinetoHorizontalRel() {
+    return new PathSegLinetoHorizontalRel._internalWrap();
+  }
+
+  factory PathSegLinetoHorizontalRel._internalWrap() {
+    return new PathSegLinetoHorizontalRel.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  PathSegLinetoHorizontalRel.internal_() : super.internal_();
+
+
   @DomName('SVGPathSegLinetoHorizontalRel.x')
   @DocsEditable()
   num get x => _blink.BlinkSVGPathSegLinetoHorizontalRel.instance.x_Getter_(unwrap_jso(this));
   
   @DomName('SVGPathSegLinetoHorizontalRel.x')
   @DocsEditable()
-  void set x(num value) => _blink.BlinkSVGPathSegLinetoHorizontalRel.instance.x_Setter_(unwrap_jso(this), value);
+  set x(num value) => _blink.BlinkSVGPathSegLinetoHorizontalRel.instance.x_Setter_(unwrap_jso(this), value);
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -4392,13 +5689,27 @@
   // To suppress missing implicit constructor warnings.
   factory PathSegLinetoRel._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static PathSegLinetoRel internalCreatePathSegLinetoRel() {
+    return new PathSegLinetoRel._internalWrap();
+  }
+
+  factory PathSegLinetoRel._internalWrap() {
+    return new PathSegLinetoRel.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  PathSegLinetoRel.internal_() : super.internal_();
+
+
   @DomName('SVGPathSegLinetoRel.x')
   @DocsEditable()
   num get x => _blink.BlinkSVGPathSegLinetoRel.instance.x_Getter_(unwrap_jso(this));
   
   @DomName('SVGPathSegLinetoRel.x')
   @DocsEditable()
-  void set x(num value) => _blink.BlinkSVGPathSegLinetoRel.instance.x_Setter_(unwrap_jso(this), value);
+  set x(num value) => _blink.BlinkSVGPathSegLinetoRel.instance.x_Setter_(unwrap_jso(this), value);
   
   @DomName('SVGPathSegLinetoRel.y')
   @DocsEditable()
@@ -4406,7 +5717,7 @@
   
   @DomName('SVGPathSegLinetoRel.y')
   @DocsEditable()
-  void set y(num value) => _blink.BlinkSVGPathSegLinetoRel.instance.y_Setter_(unwrap_jso(this), value);
+  set y(num value) => _blink.BlinkSVGPathSegLinetoRel.instance.y_Setter_(unwrap_jso(this), value);
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -4423,13 +5734,27 @@
   // To suppress missing implicit constructor warnings.
   factory PathSegLinetoVerticalAbs._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static PathSegLinetoVerticalAbs internalCreatePathSegLinetoVerticalAbs() {
+    return new PathSegLinetoVerticalAbs._internalWrap();
+  }
+
+  factory PathSegLinetoVerticalAbs._internalWrap() {
+    return new PathSegLinetoVerticalAbs.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  PathSegLinetoVerticalAbs.internal_() : super.internal_();
+
+
   @DomName('SVGPathSegLinetoVerticalAbs.y')
   @DocsEditable()
   num get y => _blink.BlinkSVGPathSegLinetoVerticalAbs.instance.y_Getter_(unwrap_jso(this));
   
   @DomName('SVGPathSegLinetoVerticalAbs.y')
   @DocsEditable()
-  void set y(num value) => _blink.BlinkSVGPathSegLinetoVerticalAbs.instance.y_Setter_(unwrap_jso(this), value);
+  set y(num value) => _blink.BlinkSVGPathSegLinetoVerticalAbs.instance.y_Setter_(unwrap_jso(this), value);
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -4446,13 +5771,27 @@
   // To suppress missing implicit constructor warnings.
   factory PathSegLinetoVerticalRel._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static PathSegLinetoVerticalRel internalCreatePathSegLinetoVerticalRel() {
+    return new PathSegLinetoVerticalRel._internalWrap();
+  }
+
+  factory PathSegLinetoVerticalRel._internalWrap() {
+    return new PathSegLinetoVerticalRel.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  PathSegLinetoVerticalRel.internal_() : super.internal_();
+
+
   @DomName('SVGPathSegLinetoVerticalRel.y')
   @DocsEditable()
   num get y => _blink.BlinkSVGPathSegLinetoVerticalRel.instance.y_Getter_(unwrap_jso(this));
   
   @DomName('SVGPathSegLinetoVerticalRel.y')
   @DocsEditable()
-  void set y(num value) => _blink.BlinkSVGPathSegLinetoVerticalRel.instance.y_Setter_(unwrap_jso(this), value);
+  set y(num value) => _blink.BlinkSVGPathSegLinetoVerticalRel.instance.y_Setter_(unwrap_jso(this), value);
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -4465,10 +5804,25 @@
 @DocsEditable()
 @DomName('SVGPathSegList')
 @Unstable()
-class PathSegList extends NativeFieldWrapperClass2 with ListMixin<PathSeg>, ImmutableListMixin<PathSeg> implements List<PathSeg> {
+class PathSegList extends DartHtmlDomObject with ListMixin<PathSeg>, ImmutableListMixin<PathSeg> implements List<PathSeg> {
   // To suppress missing implicit constructor warnings.
   factory PathSegList._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static PathSegList internalCreatePathSegList() {
+    return new PathSegList._internalWrap();
+  }
+
+  factory PathSegList._internalWrap() {
+    return new PathSegList.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  PathSegList.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('SVGPathSegList.length')
   @DocsEditable()
   @Experimental() // untriaged
@@ -4491,7 +5845,7 @@
   // PathSeg is the element type.
 
 
-  void set length(int value) {
+  set length(int value) {
     throw new UnsupportedError("Cannot resize immutable List.");
   }
 
@@ -4529,7 +5883,7 @@
   
   @DomName('SVGPathSegList.appendItem')
   @DocsEditable()
-  PathSeg appendItem(PathSeg newItem) => _blink.BlinkSVGPathSegList.instance.appendItem_Callback_1_(unwrap_jso(this), unwrap_jso(newItem));
+  PathSeg appendItem(PathSeg newItem) => wrap_jso(_blink.BlinkSVGPathSegList.instance.appendItem_Callback_1_(unwrap_jso(this), unwrap_jso(newItem)));
   
   @DomName('SVGPathSegList.clear')
   @DocsEditable()
@@ -4537,23 +5891,23 @@
   
   @DomName('SVGPathSegList.getItem')
   @DocsEditable()
-  PathSeg getItem(int index) => _blink.BlinkSVGPathSegList.instance.getItem_Callback_1_(unwrap_jso(this), index);
+  PathSeg getItem(int index) => wrap_jso(_blink.BlinkSVGPathSegList.instance.getItem_Callback_1_(unwrap_jso(this), index));
   
   @DomName('SVGPathSegList.initialize')
   @DocsEditable()
-  PathSeg initialize(PathSeg newItem) => _blink.BlinkSVGPathSegList.instance.initialize_Callback_1_(unwrap_jso(this), unwrap_jso(newItem));
+  PathSeg initialize(PathSeg newItem) => wrap_jso(_blink.BlinkSVGPathSegList.instance.initialize_Callback_1_(unwrap_jso(this), unwrap_jso(newItem)));
   
   @DomName('SVGPathSegList.insertItemBefore')
   @DocsEditable()
-  PathSeg insertItemBefore(PathSeg newItem, int index) => _blink.BlinkSVGPathSegList.instance.insertItemBefore_Callback_2_(unwrap_jso(this), unwrap_jso(newItem), index);
+  PathSeg insertItemBefore(PathSeg newItem, int index) => wrap_jso(_blink.BlinkSVGPathSegList.instance.insertItemBefore_Callback_2_(unwrap_jso(this), unwrap_jso(newItem), index));
   
   @DomName('SVGPathSegList.removeItem')
   @DocsEditable()
-  PathSeg removeItem(int index) => _blink.BlinkSVGPathSegList.instance.removeItem_Callback_1_(unwrap_jso(this), index);
+  PathSeg removeItem(int index) => wrap_jso(_blink.BlinkSVGPathSegList.instance.removeItem_Callback_1_(unwrap_jso(this), index));
   
   @DomName('SVGPathSegList.replaceItem')
   @DocsEditable()
-  PathSeg replaceItem(PathSeg newItem, int index) => _blink.BlinkSVGPathSegList.instance.replaceItem_Callback_2_(unwrap_jso(this), unwrap_jso(newItem), index);
+  PathSeg replaceItem(PathSeg newItem, int index) => wrap_jso(_blink.BlinkSVGPathSegList.instance.replaceItem_Callback_2_(unwrap_jso(this), unwrap_jso(newItem), index));
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -4570,13 +5924,27 @@
   // To suppress missing implicit constructor warnings.
   factory PathSegMovetoAbs._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static PathSegMovetoAbs internalCreatePathSegMovetoAbs() {
+    return new PathSegMovetoAbs._internalWrap();
+  }
+
+  factory PathSegMovetoAbs._internalWrap() {
+    return new PathSegMovetoAbs.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  PathSegMovetoAbs.internal_() : super.internal_();
+
+
   @DomName('SVGPathSegMovetoAbs.x')
   @DocsEditable()
   num get x => _blink.BlinkSVGPathSegMovetoAbs.instance.x_Getter_(unwrap_jso(this));
   
   @DomName('SVGPathSegMovetoAbs.x')
   @DocsEditable()
-  void set x(num value) => _blink.BlinkSVGPathSegMovetoAbs.instance.x_Setter_(unwrap_jso(this), value);
+  set x(num value) => _blink.BlinkSVGPathSegMovetoAbs.instance.x_Setter_(unwrap_jso(this), value);
   
   @DomName('SVGPathSegMovetoAbs.y')
   @DocsEditable()
@@ -4584,7 +5952,7 @@
   
   @DomName('SVGPathSegMovetoAbs.y')
   @DocsEditable()
-  void set y(num value) => _blink.BlinkSVGPathSegMovetoAbs.instance.y_Setter_(unwrap_jso(this), value);
+  set y(num value) => _blink.BlinkSVGPathSegMovetoAbs.instance.y_Setter_(unwrap_jso(this), value);
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -4601,13 +5969,27 @@
   // To suppress missing implicit constructor warnings.
   factory PathSegMovetoRel._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static PathSegMovetoRel internalCreatePathSegMovetoRel() {
+    return new PathSegMovetoRel._internalWrap();
+  }
+
+  factory PathSegMovetoRel._internalWrap() {
+    return new PathSegMovetoRel.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  PathSegMovetoRel.internal_() : super.internal_();
+
+
   @DomName('SVGPathSegMovetoRel.x')
   @DocsEditable()
   num get x => _blink.BlinkSVGPathSegMovetoRel.instance.x_Getter_(unwrap_jso(this));
   
   @DomName('SVGPathSegMovetoRel.x')
   @DocsEditable()
-  void set x(num value) => _blink.BlinkSVGPathSegMovetoRel.instance.x_Setter_(unwrap_jso(this), value);
+  set x(num value) => _blink.BlinkSVGPathSegMovetoRel.instance.x_Setter_(unwrap_jso(this), value);
   
   @DomName('SVGPathSegMovetoRel.y')
   @DocsEditable()
@@ -4615,7 +5997,7 @@
   
   @DomName('SVGPathSegMovetoRel.y')
   @DocsEditable()
-  void set y(num value) => _blink.BlinkSVGPathSegMovetoRel.instance.y_Setter_(unwrap_jso(this), value);
+  set y(num value) => _blink.BlinkSVGPathSegMovetoRel.instance.y_Setter_(unwrap_jso(this), value);
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -4635,6 +6017,20 @@
   @DomName('SVGPatternElement.SVGPatternElement')
   @DocsEditable()
   factory PatternElement() => _SvgElementFactoryProvider.createSvgElement_tag("pattern");
+
+
+  @Deprecated("Internal Use Only")
+  static PatternElement internalCreatePatternElement() {
+    return new PatternElement._internalWrap();
+  }
+
+  factory PatternElement._internalWrap() {
+    return new PatternElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  PatternElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -4709,17 +6105,32 @@
 @DocsEditable()
 @DomName('SVGPoint')
 @Unstable()
-class Point extends NativeFieldWrapperClass2 {
+class Point extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory Point._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static Point internalCreatePoint() {
+    return new Point._internalWrap();
+  }
+
+  factory Point._internalWrap() {
+    return new Point.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  Point.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('SVGPoint.x')
   @DocsEditable()
   num get x => _blink.BlinkSVGPoint.instance.x_Getter_(unwrap_jso(this));
   
   @DomName('SVGPoint.x')
   @DocsEditable()
-  void set x(num value) => _blink.BlinkSVGPoint.instance.x_Setter_(unwrap_jso(this), value);
+  set x(num value) => _blink.BlinkSVGPoint.instance.x_Setter_(unwrap_jso(this), value);
   
   @DomName('SVGPoint.y')
   @DocsEditable()
@@ -4727,11 +6138,11 @@
   
   @DomName('SVGPoint.y')
   @DocsEditable()
-  void set y(num value) => _blink.BlinkSVGPoint.instance.y_Setter_(unwrap_jso(this), value);
+  set y(num value) => _blink.BlinkSVGPoint.instance.y_Setter_(unwrap_jso(this), value);
   
   @DomName('SVGPoint.matrixTransform')
   @DocsEditable()
-  Point matrixTransform(Matrix matrix) => _blink.BlinkSVGPoint.instance.matrixTransform_Callback_1_(unwrap_jso(this), unwrap_jso(matrix));
+  Point matrixTransform(Matrix matrix) => wrap_jso(_blink.BlinkSVGPoint.instance.matrixTransform_Callback_1_(unwrap_jso(this), unwrap_jso(matrix)));
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -4744,10 +6155,25 @@
 @DocsEditable()
 @DomName('SVGPointList')
 @Unstable()
-class PointList extends NativeFieldWrapperClass2 {
+class PointList extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory PointList._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static PointList internalCreatePointList() {
+    return new PointList._internalWrap();
+  }
+
+  factory PointList._internalWrap() {
+    return new PointList.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  PointList.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('SVGPointList.length')
   @DocsEditable()
   @Experimental() // untriaged
@@ -4764,7 +6190,7 @@
   
   @DomName('SVGPointList.appendItem')
   @DocsEditable()
-  Point appendItem(Point item) => _blink.BlinkSVGPointList.instance.appendItem_Callback_1_(unwrap_jso(this), unwrap_jso(item));
+  Point appendItem(Point item) => wrap_jso(_blink.BlinkSVGPointList.instance.appendItem_Callback_1_(unwrap_jso(this), unwrap_jso(item)));
   
   @DomName('SVGPointList.clear')
   @DocsEditable()
@@ -4772,23 +6198,23 @@
   
   @DomName('SVGPointList.getItem')
   @DocsEditable()
-  Point getItem(int index) => _blink.BlinkSVGPointList.instance.getItem_Callback_1_(unwrap_jso(this), index);
+  Point getItem(int index) => wrap_jso(_blink.BlinkSVGPointList.instance.getItem_Callback_1_(unwrap_jso(this), index));
   
   @DomName('SVGPointList.initialize')
   @DocsEditable()
-  Point initialize(Point item) => _blink.BlinkSVGPointList.instance.initialize_Callback_1_(unwrap_jso(this), unwrap_jso(item));
+  Point initialize(Point item) => wrap_jso(_blink.BlinkSVGPointList.instance.initialize_Callback_1_(unwrap_jso(this), unwrap_jso(item)));
   
   @DomName('SVGPointList.insertItemBefore')
   @DocsEditable()
-  Point insertItemBefore(Point item, int index) => _blink.BlinkSVGPointList.instance.insertItemBefore_Callback_2_(unwrap_jso(this), unwrap_jso(item), index);
+  Point insertItemBefore(Point item, int index) => wrap_jso(_blink.BlinkSVGPointList.instance.insertItemBefore_Callback_2_(unwrap_jso(this), unwrap_jso(item), index));
   
   @DomName('SVGPointList.removeItem')
   @DocsEditable()
-  Point removeItem(int index) => _blink.BlinkSVGPointList.instance.removeItem_Callback_1_(unwrap_jso(this), index);
+  Point removeItem(int index) => wrap_jso(_blink.BlinkSVGPointList.instance.removeItem_Callback_1_(unwrap_jso(this), index));
   
   @DomName('SVGPointList.replaceItem')
   @DocsEditable()
-  Point replaceItem(Point item, int index) => _blink.BlinkSVGPointList.instance.replaceItem_Callback_2_(unwrap_jso(this), unwrap_jso(item), index);
+  Point replaceItem(Point item, int index) => wrap_jso(_blink.BlinkSVGPointList.instance.replaceItem_Callback_2_(unwrap_jso(this), unwrap_jso(item), index));
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -4808,6 +6234,20 @@
   @DomName('SVGPolygonElement.SVGPolygonElement')
   @DocsEditable()
   factory PolygonElement() => _SvgElementFactoryProvider.createSvgElement_tag("polygon");
+
+
+  @Deprecated("Internal Use Only")
+  static PolygonElement internalCreatePolygonElement() {
+    return new PolygonElement._internalWrap();
+  }
+
+  factory PolygonElement._internalWrap() {
+    return new PolygonElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  PolygonElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -4841,6 +6281,20 @@
   @DomName('SVGPolylineElement.SVGPolylineElement')
   @DocsEditable()
   factory PolylineElement() => _SvgElementFactoryProvider.createSvgElement_tag("polyline");
+
+
+  @Deprecated("Internal Use Only")
+  static PolylineElement internalCreatePolylineElement() {
+    return new PolylineElement._internalWrap();
+  }
+
+  factory PolylineElement._internalWrap() {
+    return new PolylineElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  PolylineElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -4867,10 +6321,25 @@
 @DocsEditable()
 @DomName('SVGPreserveAspectRatio')
 @Unstable()
-class PreserveAspectRatio extends NativeFieldWrapperClass2 {
+class PreserveAspectRatio extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory PreserveAspectRatio._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static PreserveAspectRatio internalCreatePreserveAspectRatio() {
+    return new PreserveAspectRatio._internalWrap();
+  }
+
+  factory PreserveAspectRatio._internalWrap() {
+    return new PreserveAspectRatio.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  PreserveAspectRatio.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('SVGPreserveAspectRatio.SVG_MEETORSLICE_MEET')
   @DocsEditable()
   static const int SVG_MEETORSLICE_MEET = 1;
@@ -4933,7 +6402,7 @@
   
   @DomName('SVGPreserveAspectRatio.align')
   @DocsEditable()
-  void set align(int value) => _blink.BlinkSVGPreserveAspectRatio.instance.align_Setter_(unwrap_jso(this), value);
+  set align(int value) => _blink.BlinkSVGPreserveAspectRatio.instance.align_Setter_(unwrap_jso(this), value);
   
   @DomName('SVGPreserveAspectRatio.meetOrSlice')
   @DocsEditable()
@@ -4941,7 +6410,7 @@
   
   @DomName('SVGPreserveAspectRatio.meetOrSlice')
   @DocsEditable()
-  void set meetOrSlice(int value) => _blink.BlinkSVGPreserveAspectRatio.instance.meetOrSlice_Setter_(unwrap_jso(this), value);
+  set meetOrSlice(int value) => _blink.BlinkSVGPreserveAspectRatio.instance.meetOrSlice_Setter_(unwrap_jso(this), value);
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -4961,6 +6430,20 @@
   @DomName('SVGRadialGradientElement.SVGRadialGradientElement')
   @DocsEditable()
   factory RadialGradientElement() => _SvgElementFactoryProvider.createSvgElement_tag("radialGradient");
+
+
+  @Deprecated("Internal Use Only")
+  static RadialGradientElement internalCreateRadialGradientElement() {
+    return new RadialGradientElement._internalWrap();
+  }
+
+  factory RadialGradientElement._internalWrap() {
+    return new RadialGradientElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  RadialGradientElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -5003,17 +6486,32 @@
 @DocsEditable()
 @DomName('SVGRect')
 @Unstable()
-class Rect extends NativeFieldWrapperClass2 {
+class Rect extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory Rect._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static Rect internalCreateRect() {
+    return new Rect._internalWrap();
+  }
+
+  factory Rect._internalWrap() {
+    return new Rect.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  Rect.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('SVGRect.height')
   @DocsEditable()
   num get height => _blink.BlinkSVGRect.instance.height_Getter_(unwrap_jso(this));
   
   @DomName('SVGRect.height')
   @DocsEditable()
-  void set height(num value) => _blink.BlinkSVGRect.instance.height_Setter_(unwrap_jso(this), value);
+  set height(num value) => _blink.BlinkSVGRect.instance.height_Setter_(unwrap_jso(this), value);
   
   @DomName('SVGRect.width')
   @DocsEditable()
@@ -5021,7 +6519,7 @@
   
   @DomName('SVGRect.width')
   @DocsEditable()
-  void set width(num value) => _blink.BlinkSVGRect.instance.width_Setter_(unwrap_jso(this), value);
+  set width(num value) => _blink.BlinkSVGRect.instance.width_Setter_(unwrap_jso(this), value);
   
   @DomName('SVGRect.x')
   @DocsEditable()
@@ -5029,7 +6527,7 @@
   
   @DomName('SVGRect.x')
   @DocsEditable()
-  void set x(num value) => _blink.BlinkSVGRect.instance.x_Setter_(unwrap_jso(this), value);
+  set x(num value) => _blink.BlinkSVGRect.instance.x_Setter_(unwrap_jso(this), value);
   
   @DomName('SVGRect.y')
   @DocsEditable()
@@ -5037,7 +6535,7 @@
   
   @DomName('SVGRect.y')
   @DocsEditable()
-  void set y(num value) => _blink.BlinkSVGRect.instance.y_Setter_(unwrap_jso(this), value);
+  set y(num value) => _blink.BlinkSVGRect.instance.y_Setter_(unwrap_jso(this), value);
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -5057,6 +6555,20 @@
   @DomName('SVGRectElement.SVGRectElement')
   @DocsEditable()
   factory RectElement() => _SvgElementFactoryProvider.createSvgElement_tag("rect");
+
+
+  @Deprecated("Internal Use Only")
+  static RectElement internalCreateRectElement() {
+    return new RectElement._internalWrap();
+  }
+
+  factory RectElement._internalWrap() {
+    return new RectElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  RectElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -5099,10 +6611,25 @@
 @DocsEditable()
 @DomName('SVGRenderingIntent')
 @Unstable()
-class RenderingIntent extends NativeFieldWrapperClass2 {
+class RenderingIntent extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory RenderingIntent._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static RenderingIntent internalCreateRenderingIntent() {
+    return new RenderingIntent._internalWrap();
+  }
+
+  factory RenderingIntent._internalWrap() {
+    return new RenderingIntent.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  RenderingIntent.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('SVGRenderingIntent.RENDERING_INTENT_ABSOLUTE_COLORIMETRIC')
   @DocsEditable()
   static const int RENDERING_INTENT_ABSOLUTE_COLORIMETRIC = 5;
@@ -5145,6 +6672,20 @@
   @DomName('SVGScriptElement.SVGScriptElement')
   @DocsEditable()
   factory ScriptElement() => _SvgElementFactoryProvider.createSvgElement_tag("script");
+
+
+  @Deprecated("Internal Use Only")
+  static ScriptElement internalCreateScriptElement() {
+    return new ScriptElement._internalWrap();
+  }
+
+  factory ScriptElement._internalWrap() {
+    return new ScriptElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  ScriptElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -5158,7 +6699,7 @@
   
   @DomName('SVGScriptElement.type')
   @DocsEditable()
-  void set type(String value) => _blink.BlinkSVGScriptElement.instance.type_Setter_(unwrap_jso(this), value);
+  set type(String value) => _blink.BlinkSVGScriptElement.instance.type_Setter_(unwrap_jso(this), value);
   
   @DomName('SVGScriptElement.href')
   @DocsEditable()
@@ -5185,6 +6726,20 @@
   @DomName('SVGSetElement.SVGSetElement')
   @DocsEditable()
   factory SetElement() => _SvgElementFactoryProvider.createSvgElement_tag("set");
+
+
+  @Deprecated("Internal Use Only")
+  static SetElement internalCreateSetElement() {
+    return new SetElement._internalWrap();
+  }
+
+  factory SetElement._internalWrap() {
+    return new SetElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  SetElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -5213,6 +6768,20 @@
   @DomName('SVGStopElement.SVGStopElement')
   @DocsEditable()
   factory StopElement() => _SvgElementFactoryProvider.createSvgElement_tag("stop");
+
+
+  @Deprecated("Internal Use Only")
+  static StopElement internalCreateStopElement() {
+    return new StopElement._internalWrap();
+  }
+
+  factory StopElement._internalWrap() {
+    return new StopElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  StopElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -5235,10 +6804,25 @@
 @DocsEditable()
 @DomName('SVGStringList')
 @Unstable()
-class StringList extends NativeFieldWrapperClass2 with ListMixin<String>, ImmutableListMixin<String> implements List<String> {
+class StringList extends DartHtmlDomObject with ListMixin<String>, ImmutableListMixin<String> implements List<String> {
   // To suppress missing implicit constructor warnings.
   factory StringList._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static StringList internalCreateStringList() {
+    return new StringList._internalWrap();
+  }
+
+  factory StringList._internalWrap() {
+    return new StringList.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  StringList.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('SVGStringList.length')
   @DocsEditable()
   @Experimental() // untriaged
@@ -5261,7 +6845,7 @@
   // String is the element type.
 
 
-  void set length(int value) {
+  set length(int value) {
     throw new UnsupportedError("Cannot resize immutable List.");
   }
 
@@ -5344,6 +6928,20 @@
   @DomName('SVGStyleElement.SVGStyleElement')
   @DocsEditable()
   factory StyleElement() => _SvgElementFactoryProvider.createSvgElement_tag("style");
+
+
+  @Deprecated("Internal Use Only")
+  static StyleElement internalCreateStyleElement() {
+    return new StyleElement._internalWrap();
+  }
+
+  factory StyleElement._internalWrap() {
+    return new StyleElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  StyleElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -5357,7 +6955,7 @@
   
   @DomName('SVGStyleElement.disabled')
   @DocsEditable()
-  void set disabled(bool value) => _blink.BlinkSVGStyleElement.instance.disabled_Setter_(unwrap_jso(this), value);
+  set disabled(bool value) => _blink.BlinkSVGStyleElement.instance.disabled_Setter_(unwrap_jso(this), value);
   
   @DomName('SVGStyleElement.media')
   @DocsEditable()
@@ -5365,7 +6963,7 @@
   
   @DomName('SVGStyleElement.media')
   @DocsEditable()
-  void set media(String value) => _blink.BlinkSVGStyleElement.instance.media_Setter_(unwrap_jso(this), value);
+  set media(String value) => _blink.BlinkSVGStyleElement.instance.media_Setter_(unwrap_jso(this), value);
   
   @DomName('SVGStyleElement.sheet')
   @DocsEditable()
@@ -5378,7 +6976,7 @@
   
   @DomName('SVGStyleElement.title')
   @DocsEditable()
-  void set title(String value) => _blink.BlinkSVGStyleElement.instance.title_Setter_(unwrap_jso(this), value);
+  set title(String value) => _blink.BlinkSVGStyleElement.instance.title_Setter_(unwrap_jso(this), value);
   
   @DomName('SVGStyleElement.type')
   @DocsEditable()
@@ -5386,7 +6984,7 @@
   
   @DomName('SVGStyleElement.type')
   @DocsEditable()
-  void set type(String value) => _blink.BlinkSVGStyleElement.instance.type_Setter_(unwrap_jso(this), value);
+  set type(String value) => _blink.BlinkSVGStyleElement.instance.type_Setter_(unwrap_jso(this), value);
   
 }
 // Copyright (c) 2011, the Dart project authors.  Please see the AUTHORS file
@@ -5450,7 +7048,7 @@
 
   List<Element> get children => new FilteredElementList(this);
 
-  void set children(List<Element> value) {
+  set children(List<Element> value) {
     final children = this.children;
     children.clear();
     children.addAll(value);
@@ -5470,7 +7068,7 @@
     return container.innerHtml;
   }
 
-  void set innerHtml(String value) {
+  set innerHtml(String value) {
     this.setInnerHtml(value);
   }
 
@@ -5535,6 +7133,20 @@
     var e = new SvgElement.tag(tag);
     return e is SvgElement && !(e is UnknownElement);
   }
+
+  set _svgClassName(AnimatedString value) =>
+      _blink.BlinkSVGElement.instance.className_Setter_(unwrap_jso(this), unwrap_jso(value));
+
+  String get className => _svgClassName.baseVal;
+
+  // Unbelievable hack. We can't create an SvgAnimatedString, but we can get
+  // the existing one and change its baseVal. Then we call the blink setter directly
+  // TODO(alanknight): Handle suppressing the SVGAnimated<*> better
+  set className(String s) {
+    var oldClass = _svgClassName;
+    oldClass.baseVal = s;
+    _svgClassName = oldClass;
+  }
   // To suppress missing implicit constructor warnings.
   factory SvgElement._() { throw new UnsupportedError("Not supported"); }
 
@@ -5797,6 +7409,20 @@
   @DocsEditable()
   @Experimental() // untriaged
   static const EventStreamProvider<Event> waitingEvent = const EventStreamProvider<Event>('waiting');
+
+
+  @Deprecated("Internal Use Only")
+  static SvgElement internalCreateSvgElement() {
+    return new SvgElement._internalWrap();
+  }
+
+  factory SvgElement._internalWrap() {
+    return new SvgElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  SvgElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -5826,7 +7452,7 @@
   @DomName('SVGElement.tabIndex')
   @DocsEditable()
   @Experimental() // untriaged
-  void set tabIndex(int value) => _blink.BlinkSVGElement.instance.tabIndex_Setter_(unwrap_jso(this), value);
+  set tabIndex(int value) => _blink.BlinkSVGElement.instance.tabIndex_Setter_(unwrap_jso(this), value);
   
   @DomName('SVGElement.viewportElement')
   @DocsEditable()
@@ -5838,7 +7464,7 @@
   
   @DomName('SVGElement.xmlbase')
   @DocsEditable()
-  void set xmlbase(String value) => _blink.BlinkSVGElement.instance.xmlbase_Setter_(unwrap_jso(this), value);
+  set xmlbase(String value) => _blink.BlinkSVGElement.instance.xmlbase_Setter_(unwrap_jso(this), value);
   
   @DomName('SVGElement.xmllang')
   @DocsEditable()
@@ -5848,7 +7474,7 @@
   @DomName('SVGElement.xmllang')
   @DocsEditable()
   @Experimental() // untriaged
-  void set xmllang(String value) => _blink.BlinkSVGElement.instance.xmllang_Setter_(unwrap_jso(this), value);
+  set xmllang(String value) => _blink.BlinkSVGElement.instance.xmllang_Setter_(unwrap_jso(this), value);
   
   @DomName('SVGElement.xmlspace')
   @DocsEditable()
@@ -5858,7 +7484,7 @@
   @DomName('SVGElement.xmlspace')
   @DocsEditable()
   @Experimental() // untriaged
-  void set xmlspace(String value) => _blink.BlinkSVGElement.instance.xmlspace_Setter_(unwrap_jso(this), value);
+  set xmlspace(String value) => _blink.BlinkSVGElement.instance.xmlspace_Setter_(unwrap_jso(this), value);
   
   @DomName('SVGElement.onabort')
   @DocsEditable()
@@ -6138,6 +7764,20 @@
 
   // To suppress missing implicit constructor warnings.
   factory SvgSvgElement._() { throw new UnsupportedError("Not supported"); }
+
+
+  @Deprecated("Internal Use Only")
+  static SvgSvgElement internalCreateSvgSvgElement() {
+    return new SvgSvgElement._internalWrap();
+  }
+
+  factory SvgSvgElement._internalWrap() {
+    return new SvgSvgElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  SvgSvgElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -6151,7 +7791,7 @@
   
   @DomName('SVGSVGElement.currentScale')
   @DocsEditable()
-  void set currentScale(num value) => _blink.BlinkSVGSVGElement.instance.currentScale_Setter_(unwrap_jso(this), value);
+  set currentScale(num value) => _blink.BlinkSVGSVGElement.instance.currentScale_Setter_(unwrap_jso(this), value);
   
   @DomName('SVGSVGElement.currentTranslate')
   @DocsEditable()
@@ -6167,19 +7807,19 @@
   
   @DomName('SVGSVGElement.pixelUnitToMillimeterX')
   @DocsEditable()
-  double get pixelUnitToMillimeterX => _blink.BlinkSVGSVGElement.instance.pixelUnitToMillimeterX_Getter_(unwrap_jso(this));
+  num get pixelUnitToMillimeterX => _blink.BlinkSVGSVGElement.instance.pixelUnitToMillimeterX_Getter_(unwrap_jso(this));
   
   @DomName('SVGSVGElement.pixelUnitToMillimeterY')
   @DocsEditable()
-  double get pixelUnitToMillimeterY => _blink.BlinkSVGSVGElement.instance.pixelUnitToMillimeterY_Getter_(unwrap_jso(this));
+  num get pixelUnitToMillimeterY => _blink.BlinkSVGSVGElement.instance.pixelUnitToMillimeterY_Getter_(unwrap_jso(this));
   
   @DomName('SVGSVGElement.screenPixelToMillimeterX')
   @DocsEditable()
-  double get screenPixelToMillimeterX => _blink.BlinkSVGSVGElement.instance.screenPixelToMillimeterX_Getter_(unwrap_jso(this));
+  num get screenPixelToMillimeterX => _blink.BlinkSVGSVGElement.instance.screenPixelToMillimeterX_Getter_(unwrap_jso(this));
   
   @DomName('SVGSVGElement.screenPixelToMillimeterY')
   @DocsEditable()
-  double get screenPixelToMillimeterY => _blink.BlinkSVGSVGElement.instance.screenPixelToMillimeterY_Getter_(unwrap_jso(this));
+  num get screenPixelToMillimeterY => _blink.BlinkSVGSVGElement.instance.screenPixelToMillimeterY_Getter_(unwrap_jso(this));
   
   @DomName('SVGSVGElement.useCurrentView')
   @DocsEditable()
@@ -6215,23 +7855,23 @@
   
   @DomName('SVGSVGElement.createSVGAngle')
   @DocsEditable()
-  Angle createSvgAngle() => _blink.BlinkSVGSVGElement.instance.createSVGAngle_Callback_0_(unwrap_jso(this));
+  Angle createSvgAngle() => wrap_jso(_blink.BlinkSVGSVGElement.instance.createSVGAngle_Callback_0_(unwrap_jso(this)));
   
   @DomName('SVGSVGElement.createSVGLength')
   @DocsEditable()
-  Length createSvgLength() => _blink.BlinkSVGSVGElement.instance.createSVGLength_Callback_0_(unwrap_jso(this));
+  Length createSvgLength() => wrap_jso(_blink.BlinkSVGSVGElement.instance.createSVGLength_Callback_0_(unwrap_jso(this)));
   
   @DomName('SVGSVGElement.createSVGMatrix')
   @DocsEditable()
-  Matrix createSvgMatrix() => _blink.BlinkSVGSVGElement.instance.createSVGMatrix_Callback_0_(unwrap_jso(this));
+  Matrix createSvgMatrix() => wrap_jso(_blink.BlinkSVGSVGElement.instance.createSVGMatrix_Callback_0_(unwrap_jso(this)));
   
   @DomName('SVGSVGElement.createSVGNumber')
   @DocsEditable()
-  Number createSvgNumber() => _blink.BlinkSVGSVGElement.instance.createSVGNumber_Callback_0_(unwrap_jso(this));
+  Number createSvgNumber() => wrap_jso(_blink.BlinkSVGSVGElement.instance.createSVGNumber_Callback_0_(unwrap_jso(this)));
   
   @DomName('SVGSVGElement.createSVGPoint')
   @DocsEditable()
-  Point createSvgPoint() => _blink.BlinkSVGSVGElement.instance.createSVGPoint_Callback_0_(unwrap_jso(this));
+  Point createSvgPoint() => wrap_jso(_blink.BlinkSVGSVGElement.instance.createSVGPoint_Callback_0_(unwrap_jso(this)));
   
   @DomName('SVGSVGElement.createSVGRect')
   @DocsEditable()
@@ -6239,11 +7879,11 @@
   
   @DomName('SVGSVGElement.createSVGTransform')
   @DocsEditable()
-  Transform createSvgTransform() => _blink.BlinkSVGSVGElement.instance.createSVGTransform_Callback_0_(unwrap_jso(this));
+  Transform createSvgTransform() => wrap_jso(_blink.BlinkSVGSVGElement.instance.createSVGTransform_Callback_0_(unwrap_jso(this)));
   
   @DomName('SVGSVGElement.createSVGTransformFromMatrix')
   @DocsEditable()
-  Transform createSvgTransformFromMatrix(Matrix matrix) => _blink.BlinkSVGSVGElement.instance.createSVGTransformFromMatrix_Callback_1_(unwrap_jso(this), unwrap_jso(matrix));
+  Transform createSvgTransformFromMatrix(Matrix matrix) => wrap_jso(_blink.BlinkSVGSVGElement.instance.createSVGTransformFromMatrix_Callback_1_(unwrap_jso(this), unwrap_jso(matrix)));
   
   @DomName('SVGSVGElement.deselectAll')
   @DocsEditable()
@@ -6255,7 +7895,7 @@
   
   @DomName('SVGSVGElement.getCurrentTime')
   @DocsEditable()
-  double getCurrentTime() => _blink.BlinkSVGSVGElement.instance.getCurrentTime_Callback_0_(unwrap_jso(this));
+  num getCurrentTime() => _blink.BlinkSVGSVGElement.instance.getCurrentTime_Callback_0_(unwrap_jso(this));
   
   @DomName('SVGSVGElement.getElementById')
   @DocsEditable()
@@ -6263,11 +7903,11 @@
   
   @DomName('SVGSVGElement.getEnclosureList')
   @DocsEditable()
-  List<Node> getEnclosureList(Rect rect, SvgElement referenceElement) => wrap_jso_list(_blink.BlinkSVGSVGElement.instance.getEnclosureList_Callback_2_(unwrap_jso(this), unwrap_jso(rect), unwrap_jso(referenceElement)));
+  List<Node> getEnclosureList(Rect rect, SvgElement referenceElement) => wrap_jso(_blink.BlinkSVGSVGElement.instance.getEnclosureList_Callback_2_(unwrap_jso(this), unwrap_jso(rect), unwrap_jso(referenceElement)));
   
   @DomName('SVGSVGElement.getIntersectionList')
   @DocsEditable()
-  List<Node> getIntersectionList(Rect rect, SvgElement referenceElement) => wrap_jso_list(_blink.BlinkSVGSVGElement.instance.getIntersectionList_Callback_2_(unwrap_jso(this), unwrap_jso(rect), unwrap_jso(referenceElement)));
+  List<Node> getIntersectionList(Rect rect, SvgElement referenceElement) => wrap_jso(_blink.BlinkSVGSVGElement.instance.getIntersectionList_Callback_2_(unwrap_jso(this), unwrap_jso(rect), unwrap_jso(referenceElement)));
   
   @DomName('SVGSVGElement.pauseAnimations')
   @DocsEditable()
@@ -6307,7 +7947,7 @@
   
   @DomName('SVGSVGElement.zoomAndPan')
   @DocsEditable()
-  void set zoomAndPan(int value) => _blink.BlinkSVGSVGElement.instance.zoomAndPan_Setter_(unwrap_jso(this), value);
+  set zoomAndPan(int value) => _blink.BlinkSVGSVGElement.instance.zoomAndPan_Setter_(unwrap_jso(this), value);
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -6327,6 +7967,20 @@
   @DomName('SVGSwitchElement.SVGSwitchElement')
   @DocsEditable()
   factory SwitchElement() => _SvgElementFactoryProvider.createSvgElement_tag("switch");
+
+
+  @Deprecated("Internal Use Only")
+  static SwitchElement internalCreateSwitchElement() {
+    return new SwitchElement._internalWrap();
+  }
+
+  factory SwitchElement._internalWrap() {
+    return new SwitchElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  SwitchElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -6352,6 +8006,20 @@
   @DomName('SVGSymbolElement.SVGSymbolElement')
   @DocsEditable()
   factory SymbolElement() => _SvgElementFactoryProvider.createSvgElement_tag("symbol");
+
+
+  @Deprecated("Internal Use Only")
+  static SymbolElement internalCreateSymbolElement() {
+    return new SymbolElement._internalWrap();
+  }
+
+  factory SymbolElement._internalWrap() {
+    return new SymbolElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  SymbolElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -6385,6 +8053,20 @@
   @DomName('SVGTSpanElement.SVGTSpanElement')
   @DocsEditable()
   factory TSpanElement() => _SvgElementFactoryProvider.createSvgElement_tag("tspan");
+
+
+  @Deprecated("Internal Use Only")
+  static TSpanElement internalCreateTSpanElement() {
+    return new TSpanElement._internalWrap();
+  }
+
+  factory TSpanElement._internalWrap() {
+    return new TSpanElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  TSpanElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -6403,7 +8085,7 @@
 @DocsEditable()
 @DomName('SVGTests')
 @Unstable()
-abstract class Tests extends NativeFieldWrapperClass2 {
+abstract class Tests extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory Tests._() { throw new UnsupportedError("Not supported"); }
 
@@ -6437,6 +8119,20 @@
 class TextContentElement extends GraphicsElement {
   // To suppress missing implicit constructor warnings.
   factory TextContentElement._() { throw new UnsupportedError("Not supported"); }
+
+
+  @Deprecated("Internal Use Only")
+  static TextContentElement internalCreateTextContentElement() {
+    return new TextContentElement._internalWrap();
+  }
+
+  factory TextContentElement._internalWrap() {
+    return new TextContentElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  TextContentElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -6470,11 +8166,11 @@
   
   @DomName('SVGTextContentElement.getComputedTextLength')
   @DocsEditable()
-  double getComputedTextLength() => _blink.BlinkSVGTextContentElement.instance.getComputedTextLength_Callback_0_(unwrap_jso(this));
+  num getComputedTextLength() => _blink.BlinkSVGTextContentElement.instance.getComputedTextLength_Callback_0_(unwrap_jso(this));
   
   @DomName('SVGTextContentElement.getEndPositionOfChar')
   @DocsEditable()
-  Point getEndPositionOfChar(int offset) => _blink.BlinkSVGTextContentElement.instance.getEndPositionOfChar_Callback_1_(unwrap_jso(this), offset);
+  Point getEndPositionOfChar(int offset) => wrap_jso(_blink.BlinkSVGTextContentElement.instance.getEndPositionOfChar_Callback_1_(unwrap_jso(this), offset));
   
   @DomName('SVGTextContentElement.getExtentOfChar')
   @DocsEditable()
@@ -6486,15 +8182,15 @@
   
   @DomName('SVGTextContentElement.getRotationOfChar')
   @DocsEditable()
-  double getRotationOfChar(int offset) => _blink.BlinkSVGTextContentElement.instance.getRotationOfChar_Callback_1_(unwrap_jso(this), offset);
+  num getRotationOfChar(int offset) => _blink.BlinkSVGTextContentElement.instance.getRotationOfChar_Callback_1_(unwrap_jso(this), offset);
   
   @DomName('SVGTextContentElement.getStartPositionOfChar')
   @DocsEditable()
-  Point getStartPositionOfChar(int offset) => _blink.BlinkSVGTextContentElement.instance.getStartPositionOfChar_Callback_1_(unwrap_jso(this), offset);
+  Point getStartPositionOfChar(int offset) => wrap_jso(_blink.BlinkSVGTextContentElement.instance.getStartPositionOfChar_Callback_1_(unwrap_jso(this), offset));
   
   @DomName('SVGTextContentElement.getSubStringLength')
   @DocsEditable()
-  double getSubStringLength(int offset, int length) => _blink.BlinkSVGTextContentElement.instance.getSubStringLength_Callback_2_(unwrap_jso(this), offset, length);
+  num getSubStringLength(int offset, int length) => _blink.BlinkSVGTextContentElement.instance.getSubStringLength_Callback_2_(unwrap_jso(this), offset, length);
   
   @DomName('SVGTextContentElement.selectSubString')
   @DocsEditable()
@@ -6518,6 +8214,20 @@
   @DomName('SVGTextElement.SVGTextElement')
   @DocsEditable()
   factory TextElement() => _SvgElementFactoryProvider.createSvgElement_tag("text");
+
+
+  @Deprecated("Internal Use Only")
+  static TextElement internalCreateTextElement() {
+    return new TextElement._internalWrap();
+  }
+
+  factory TextElement._internalWrap() {
+    return new TextElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  TextElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -6539,6 +8249,20 @@
 class TextPathElement extends TextContentElement implements UriReference {
   // To suppress missing implicit constructor warnings.
   factory TextPathElement._() { throw new UnsupportedError("Not supported"); }
+
+
+  @Deprecated("Internal Use Only")
+  static TextPathElement internalCreateTextPathElement() {
+    return new TextPathElement._internalWrap();
+  }
+
+  factory TextPathElement._internalWrap() {
+    return new TextPathElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  TextPathElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -6600,6 +8324,20 @@
 class TextPositioningElement extends TextContentElement {
   // To suppress missing implicit constructor warnings.
   factory TextPositioningElement._() { throw new UnsupportedError("Not supported"); }
+
+
+  @Deprecated("Internal Use Only")
+  static TextPositioningElement internalCreateTextPositioningElement() {
+    return new TextPositioningElement._internalWrap();
+  }
+
+  factory TextPositioningElement._internalWrap() {
+    return new TextPositioningElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  TextPositioningElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -6645,6 +8383,20 @@
   @DomName('SVGTitleElement.SVGTitleElement')
   @DocsEditable()
   factory TitleElement() => _SvgElementFactoryProvider.createSvgElement_tag("title");
+
+
+  @Deprecated("Internal Use Only")
+  static TitleElement internalCreateTitleElement() {
+    return new TitleElement._internalWrap();
+  }
+
+  factory TitleElement._internalWrap() {
+    return new TitleElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  TitleElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -6663,10 +8415,25 @@
 @DocsEditable()
 @DomName('SVGTransform')
 @Unstable()
-class Transform extends NativeFieldWrapperClass2 {
+class Transform extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory Transform._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static Transform internalCreateTransform() {
+    return new Transform._internalWrap();
+  }
+
+  factory Transform._internalWrap() {
+    return new Transform.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  Transform.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('SVGTransform.SVG_TRANSFORM_MATRIX')
   @DocsEditable()
   static const int SVG_TRANSFORM_MATRIX = 1;
@@ -6697,7 +8464,7 @@
 
   @DomName('SVGTransform.angle')
   @DocsEditable()
-  double get angle => _blink.BlinkSVGTransform.instance.angle_Getter_(unwrap_jso(this));
+  num get angle => _blink.BlinkSVGTransform.instance.angle_Getter_(unwrap_jso(this));
   
   @DomName('SVGTransform.matrix')
   @DocsEditable()
@@ -6742,10 +8509,25 @@
 @DocsEditable()
 @DomName('SVGTransformList')
 @Unstable()
-class TransformList extends NativeFieldWrapperClass2 with ListMixin<Transform>, ImmutableListMixin<Transform> implements List<Transform> {
+class TransformList extends DartHtmlDomObject with ListMixin<Transform>, ImmutableListMixin<Transform> implements List<Transform> {
   // To suppress missing implicit constructor warnings.
   factory TransformList._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static TransformList internalCreateTransformList() {
+    return new TransformList._internalWrap();
+  }
+
+  factory TransformList._internalWrap() {
+    return new TransformList.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  TransformList.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('SVGTransformList.length')
   @DocsEditable()
   @Experimental() // untriaged
@@ -6768,7 +8550,7 @@
   // Transform is the element type.
 
 
-  void set length(int value) {
+  set length(int value) {
     throw new UnsupportedError("Cannot resize immutable List.");
   }
 
@@ -6806,7 +8588,7 @@
   
   @DomName('SVGTransformList.appendItem')
   @DocsEditable()
-  Transform appendItem(Transform item) => _blink.BlinkSVGTransformList.instance.appendItem_Callback_1_(unwrap_jso(this), unwrap_jso(item));
+  Transform appendItem(Transform item) => wrap_jso(_blink.BlinkSVGTransformList.instance.appendItem_Callback_1_(unwrap_jso(this), unwrap_jso(item)));
   
   @DomName('SVGTransformList.clear')
   @DocsEditable()
@@ -6814,31 +8596,31 @@
   
   @DomName('SVGTransformList.consolidate')
   @DocsEditable()
-  Transform consolidate() => _blink.BlinkSVGTransformList.instance.consolidate_Callback_0_(unwrap_jso(this));
+  Transform consolidate() => wrap_jso(_blink.BlinkSVGTransformList.instance.consolidate_Callback_0_(unwrap_jso(this)));
   
   @DomName('SVGTransformList.createSVGTransformFromMatrix')
   @DocsEditable()
-  Transform createSvgTransformFromMatrix(Matrix matrix) => _blink.BlinkSVGTransformList.instance.createSVGTransformFromMatrix_Callback_1_(unwrap_jso(this), unwrap_jso(matrix));
+  Transform createSvgTransformFromMatrix(Matrix matrix) => wrap_jso(_blink.BlinkSVGTransformList.instance.createSVGTransformFromMatrix_Callback_1_(unwrap_jso(this), unwrap_jso(matrix)));
   
   @DomName('SVGTransformList.getItem')
   @DocsEditable()
-  Transform getItem(int index) => _blink.BlinkSVGTransformList.instance.getItem_Callback_1_(unwrap_jso(this), index);
+  Transform getItem(int index) => wrap_jso(_blink.BlinkSVGTransformList.instance.getItem_Callback_1_(unwrap_jso(this), index));
   
   @DomName('SVGTransformList.initialize')
   @DocsEditable()
-  Transform initialize(Transform item) => _blink.BlinkSVGTransformList.instance.initialize_Callback_1_(unwrap_jso(this), unwrap_jso(item));
+  Transform initialize(Transform item) => wrap_jso(_blink.BlinkSVGTransformList.instance.initialize_Callback_1_(unwrap_jso(this), unwrap_jso(item)));
   
   @DomName('SVGTransformList.insertItemBefore')
   @DocsEditable()
-  Transform insertItemBefore(Transform item, int index) => _blink.BlinkSVGTransformList.instance.insertItemBefore_Callback_2_(unwrap_jso(this), unwrap_jso(item), index);
+  Transform insertItemBefore(Transform item, int index) => wrap_jso(_blink.BlinkSVGTransformList.instance.insertItemBefore_Callback_2_(unwrap_jso(this), unwrap_jso(item), index));
   
   @DomName('SVGTransformList.removeItem')
   @DocsEditable()
-  Transform removeItem(int index) => _blink.BlinkSVGTransformList.instance.removeItem_Callback_1_(unwrap_jso(this), index);
+  Transform removeItem(int index) => wrap_jso(_blink.BlinkSVGTransformList.instance.removeItem_Callback_1_(unwrap_jso(this), index));
   
   @DomName('SVGTransformList.replaceItem')
   @DocsEditable()
-  Transform replaceItem(Transform item, int index) => _blink.BlinkSVGTransformList.instance.replaceItem_Callback_2_(unwrap_jso(this), unwrap_jso(item), index);
+  Transform replaceItem(Transform item, int index) => wrap_jso(_blink.BlinkSVGTransformList.instance.replaceItem_Callback_2_(unwrap_jso(this), unwrap_jso(item), index));
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -6851,10 +8633,25 @@
 @DocsEditable()
 @DomName('SVGUnitTypes')
 @Unstable()
-class UnitTypes extends NativeFieldWrapperClass2 {
+class UnitTypes extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory UnitTypes._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static UnitTypes internalCreateUnitTypes() {
+    return new UnitTypes._internalWrap();
+  }
+
+  factory UnitTypes._internalWrap() {
+    return new UnitTypes.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  UnitTypes.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('SVGUnitTypes.SVG_UNIT_TYPE_OBJECTBOUNDINGBOX')
   @DocsEditable()
   static const int SVG_UNIT_TYPE_OBJECTBOUNDINGBOX = 2;
@@ -6878,7 +8675,7 @@
 @DocsEditable()
 @DomName('SVGURIReference')
 @Unstable()
-abstract class UriReference extends NativeFieldWrapperClass2 {
+abstract class UriReference extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory UriReference._() { throw new UnsupportedError("Not supported"); }
 
@@ -6904,6 +8701,20 @@
   @DomName('SVGUseElement.SVGUseElement')
   @DocsEditable()
   factory UseElement() => _SvgElementFactoryProvider.createSvgElement_tag("use");
+
+
+  @Deprecated("Internal Use Only")
+  static UseElement internalCreateUseElement() {
+    return new UseElement._internalWrap();
+  }
+
+  factory UseElement._internalWrap() {
+    return new UseElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  UseElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -6949,6 +8760,20 @@
   @DomName('SVGViewElement.SVGViewElement')
   @DocsEditable()
   factory ViewElement() => _SvgElementFactoryProvider.createSvgElement_tag("view");
+
+
+  @Deprecated("Internal Use Only")
+  static ViewElement internalCreateViewElement() {
+    return new ViewElement._internalWrap();
+  }
+
+  factory ViewElement._internalWrap() {
+    return new ViewElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  ViewElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -6974,7 +8799,7 @@
   
   @DomName('SVGViewElement.zoomAndPan')
   @DocsEditable()
-  void set zoomAndPan(int value) => _blink.BlinkSVGViewElement.instance.zoomAndPan_Setter_(unwrap_jso(this), value);
+  set zoomAndPan(int value) => _blink.BlinkSVGViewElement.instance.zoomAndPan_Setter_(unwrap_jso(this), value);
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -6987,10 +8812,25 @@
 @DocsEditable()
 @DomName('SVGViewSpec')
 @Unstable()
-class ViewSpec extends NativeFieldWrapperClass2 implements FitToViewBox, ZoomAndPan {
+class ViewSpec extends DartHtmlDomObject implements FitToViewBox, ZoomAndPan {
   // To suppress missing implicit constructor warnings.
   factory ViewSpec._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static ViewSpec internalCreateViewSpec() {
+    return new ViewSpec._internalWrap();
+  }
+
+  factory ViewSpec._internalWrap() {
+    return new ViewSpec.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  ViewSpec.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('SVGViewSpec.preserveAspectRatioString')
   @DocsEditable()
   String get preserveAspectRatioString => _blink.BlinkSVGViewSpec.instance.preserveAspectRatioString_Getter_(unwrap_jso(this));
@@ -7033,7 +8873,7 @@
   @DomName('SVGViewSpec.zoomAndPan')
   @DocsEditable()
   @Experimental() // nonstandard
-  void set zoomAndPan(int value) => _blink.BlinkSVGViewSpec.instance.zoomAndPan_Setter_(unwrap_jso(this), value);
+  set zoomAndPan(int value) => _blink.BlinkSVGViewSpec.instance.zoomAndPan_Setter_(unwrap_jso(this), value);
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -7046,7 +8886,7 @@
 @DocsEditable()
 @DomName('SVGZoomAndPan')
 @Unstable()
-abstract class ZoomAndPan extends NativeFieldWrapperClass2 {
+abstract class ZoomAndPan extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory ZoomAndPan._() { throw new UnsupportedError("Not supported"); }
 
@@ -7068,7 +8908,7 @@
 
   @DomName('SVGZoomAndPan.zoomAndPan')
   @DocsEditable()
-  void set zoomAndPan(int value);
+  set zoomAndPan(int value);
 
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -7085,9 +8925,23 @@
   // To suppress missing implicit constructor warnings.
   factory ZoomEvent._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static ZoomEvent internalCreateZoomEvent() {
+    return new ZoomEvent._internalWrap();
+  }
+
+  factory ZoomEvent._internalWrap() {
+    return new ZoomEvent.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  ZoomEvent.internal_() : super.internal_();
+
+
   @DomName('SVGZoomEvent.newScale')
   @DocsEditable()
-  double get newScale => _blink.BlinkSVGZoomEvent.instance.newScale_Getter_(unwrap_jso(this));
+  num get newScale => _blink.BlinkSVGZoomEvent.instance.newScale_Getter_(unwrap_jso(this));
   
   @DomName('SVGZoomEvent.newTranslate')
   @DocsEditable()
@@ -7095,7 +8949,7 @@
   
   @DomName('SVGZoomEvent.previousScale')
   @DocsEditable()
-  double get previousScale => _blink.BlinkSVGZoomEvent.instance.previousScale_Getter_(unwrap_jso(this));
+  num get previousScale => _blink.BlinkSVGZoomEvent.instance.previousScale_Getter_(unwrap_jso(this));
   
   @DomName('SVGZoomEvent.previousTranslate')
   @DocsEditable()
@@ -7119,6 +8973,20 @@
 class _GradientElement extends SvgElement implements UriReference {
   // To suppress missing implicit constructor warnings.
   factory _GradientElement._() { throw new UnsupportedError("Not supported"); }
+
+
+  @Deprecated("Internal Use Only")
+  static _GradientElement internalCreate_GradientElement() {
+    return new _GradientElement._internalWrap();
+  }
+
+  factory _GradientElement._internalWrap() {
+    return new _GradientElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  _GradientElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -7169,9 +9037,23 @@
 @DocsEditable()
 @DomName('SVGAltGlyphDefElement')
 @Unstable()
-abstract class _SVGAltGlyphDefElement extends SvgElement {
+class _SVGAltGlyphDefElement extends SvgElement {
   // To suppress missing implicit constructor warnings.
   factory _SVGAltGlyphDefElement._() { throw new UnsupportedError("Not supported"); }
+
+
+  @Deprecated("Internal Use Only")
+  static _SVGAltGlyphDefElement internalCreate_SVGAltGlyphDefElement() {
+    return new _SVGAltGlyphDefElement._internalWrap();
+  }
+
+  factory _SVGAltGlyphDefElement._internalWrap() {
+    return new _SVGAltGlyphDefElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  _SVGAltGlyphDefElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -7190,9 +9072,23 @@
 @DocsEditable()
 @DomName('SVGAltGlyphItemElement')
 @Unstable()
-abstract class _SVGAltGlyphItemElement extends SvgElement {
+class _SVGAltGlyphItemElement extends SvgElement {
   // To suppress missing implicit constructor warnings.
   factory _SVGAltGlyphItemElement._() { throw new UnsupportedError("Not supported"); }
+
+
+  @Deprecated("Internal Use Only")
+  static _SVGAltGlyphItemElement internalCreate_SVGAltGlyphItemElement() {
+    return new _SVGAltGlyphItemElement._internalWrap();
+  }
+
+  factory _SVGAltGlyphItemElement._internalWrap() {
+    return new _SVGAltGlyphItemElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  _SVGAltGlyphItemElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -7211,9 +9107,23 @@
 @DocsEditable()
 @DomName('SVGComponentTransferFunctionElement')
 @Unstable()
-abstract class _SVGComponentTransferFunctionElement extends SvgElement {
+class _SVGComponentTransferFunctionElement extends SvgElement {
   // To suppress missing implicit constructor warnings.
   factory _SVGComponentTransferFunctionElement._() { throw new UnsupportedError("Not supported"); }
+
+
+  @Deprecated("Internal Use Only")
+  static _SVGComponentTransferFunctionElement internalCreate_SVGComponentTransferFunctionElement() {
+    return new _SVGComponentTransferFunctionElement._internalWrap();
+  }
+
+  factory _SVGComponentTransferFunctionElement._internalWrap() {
+    return new _SVGComponentTransferFunctionElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  _SVGComponentTransferFunctionElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -7226,19 +9136,31 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-// WARNING: Do not edit - generated code.
-
 
 @DocsEditable()
 @DomName('SVGCursorElement')
 @Unstable()
-abstract class _SVGCursorElement extends SvgElement implements UriReference, Tests {
+class _SVGCursorElement extends SvgElement implements UriReference, Tests {
   // To suppress missing implicit constructor warnings.
   factory _SVGCursorElement._() { throw new UnsupportedError("Not supported"); }
 
   @DomName('SVGCursorElement.SVGCursorElement')
   @DocsEditable()
   factory _SVGCursorElement() => _SvgElementFactoryProvider.createSvgElement_tag("cursor");
+
+
+  @Deprecated("Internal Use Only")
+  static _SVGCursorElement internalCreate_SVGCursorElement() {
+    return new _SVGCursorElement._internalWrap();
+  }
+
+  factory _SVGCursorElement._internalWrap() {
+    return new _SVGCursorElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  _SVGCursorElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -7249,20 +9171,39 @@
   /// Checks if this type is supported on the current platform.
   static bool get supported => true;
 
+  // Override these methods for Dartium _SVGCursorElement can't be abstract.
+  StringList get requiredExtensions => wrap_jso(_blink.BlinkSVGCursorElement.instance.requiredExtensions_Getter_(unwrap_jso(this)));
+  StringList get requiredFeatures => wrap_jso(_blink.BlinkSVGCursorElement.instance.requiredFeatures_Getter_(unwrap_jso(this)));
+  StringList get systemLanguage => wrap_jso(_blink.BlinkSVGCursorElement.instance.systemLanguage_Getter_(unwrap_jso(this)));
+  AnimatedString get href => wrap_jso(_blink.BlinkSVGCursorElement.instance.href_Getter_(unwrap_jso(this)));
+  bool hasExtension(String extension) => _blink.BlinkSVGCursorElement.instance.hasExtension_Callback_1_(unwrap_jso(this), extension);
 }
+
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-// WARNING: Do not edit - generated code.
-
 
 @DocsEditable()
 @DomName('SVGFEDropShadowElement')
 @Experimental() // nonstandard
-abstract class _SVGFEDropShadowElement extends SvgElement implements FilterPrimitiveStandardAttributes {
+class _SVGFEDropShadowElement extends SvgElement implements FilterPrimitiveStandardAttributes {
   // To suppress missing implicit constructor warnings.
   factory _SVGFEDropShadowElement._() { throw new UnsupportedError("Not supported"); }
+
+
+  @Deprecated("Internal Use Only")
+  static _SVGFEDropShadowElement internalCreate_SVGFEDropShadowElement() {
+    return new _SVGFEDropShadowElement._internalWrap();
+  }
+
+  factory _SVGFEDropShadowElement._internalWrap() {
+    return new _SVGFEDropShadowElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  _SVGFEDropShadowElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -7270,7 +9211,14 @@
    */
   _SVGFEDropShadowElement.created() : super.created();
 
+  // Override these methods for Dartium _SVGFEDropShadowElement can't be abstract.
+  AnimatedLength get height => wrap_jso(_blink.BlinkSVGFEDropShadowElement.instance.height_Getter_(unwrap_jso(this)));
+  AnimatedString get result => wrap_jso(_blink.BlinkSVGFEDropShadowElement.instance.result_Getter_(unwrap_jso(this)));
+  AnimatedLength get width => wrap_jso(_blink.BlinkSVGFEDropShadowElement.instance.width_Getter_(unwrap_jso(this)));
+  AnimatedLength get x => wrap_jso(_blink.BlinkSVGFEDropShadowElement.instance.x_Getter_(unwrap_jso(this)));
+  AnimatedLength get y => wrap_jso(_blink.BlinkSVGFEDropShadowElement.instance.y_Getter_(unwrap_jso(this)));
 }
+
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
@@ -7281,9 +9229,23 @@
 @DocsEditable()
 @DomName('SVGFontElement')
 @Unstable()
-abstract class _SVGFontElement extends SvgElement {
+class _SVGFontElement extends SvgElement {
   // To suppress missing implicit constructor warnings.
   factory _SVGFontElement._() { throw new UnsupportedError("Not supported"); }
+
+
+  @Deprecated("Internal Use Only")
+  static _SVGFontElement internalCreate_SVGFontElement() {
+    return new _SVGFontElement._internalWrap();
+  }
+
+  factory _SVGFontElement._internalWrap() {
+    return new _SVGFontElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  _SVGFontElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -7302,9 +9264,23 @@
 @DocsEditable()
 @DomName('SVGFontFaceElement')
 @Unstable()
-abstract class _SVGFontFaceElement extends SvgElement {
+class _SVGFontFaceElement extends SvgElement {
   // To suppress missing implicit constructor warnings.
   factory _SVGFontFaceElement._() { throw new UnsupportedError("Not supported"); }
+
+
+  @Deprecated("Internal Use Only")
+  static _SVGFontFaceElement internalCreate_SVGFontFaceElement() {
+    return new _SVGFontFaceElement._internalWrap();
+  }
+
+  factory _SVGFontFaceElement._internalWrap() {
+    return new _SVGFontFaceElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  _SVGFontFaceElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -7323,9 +9299,23 @@
 @DocsEditable()
 @DomName('SVGFontFaceFormatElement')
 @Unstable()
-abstract class _SVGFontFaceFormatElement extends SvgElement {
+class _SVGFontFaceFormatElement extends SvgElement {
   // To suppress missing implicit constructor warnings.
   factory _SVGFontFaceFormatElement._() { throw new UnsupportedError("Not supported"); }
+
+
+  @Deprecated("Internal Use Only")
+  static _SVGFontFaceFormatElement internalCreate_SVGFontFaceFormatElement() {
+    return new _SVGFontFaceFormatElement._internalWrap();
+  }
+
+  factory _SVGFontFaceFormatElement._internalWrap() {
+    return new _SVGFontFaceFormatElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  _SVGFontFaceFormatElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -7344,9 +9334,23 @@
 @DocsEditable()
 @DomName('SVGFontFaceNameElement')
 @Unstable()
-abstract class _SVGFontFaceNameElement extends SvgElement {
+class _SVGFontFaceNameElement extends SvgElement {
   // To suppress missing implicit constructor warnings.
   factory _SVGFontFaceNameElement._() { throw new UnsupportedError("Not supported"); }
+
+
+  @Deprecated("Internal Use Only")
+  static _SVGFontFaceNameElement internalCreate_SVGFontFaceNameElement() {
+    return new _SVGFontFaceNameElement._internalWrap();
+  }
+
+  factory _SVGFontFaceNameElement._internalWrap() {
+    return new _SVGFontFaceNameElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  _SVGFontFaceNameElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -7365,9 +9369,23 @@
 @DocsEditable()
 @DomName('SVGFontFaceSrcElement')
 @Unstable()
-abstract class _SVGFontFaceSrcElement extends SvgElement {
+class _SVGFontFaceSrcElement extends SvgElement {
   // To suppress missing implicit constructor warnings.
   factory _SVGFontFaceSrcElement._() { throw new UnsupportedError("Not supported"); }
+
+
+  @Deprecated("Internal Use Only")
+  static _SVGFontFaceSrcElement internalCreate_SVGFontFaceSrcElement() {
+    return new _SVGFontFaceSrcElement._internalWrap();
+  }
+
+  factory _SVGFontFaceSrcElement._internalWrap() {
+    return new _SVGFontFaceSrcElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  _SVGFontFaceSrcElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -7386,9 +9404,23 @@
 @DocsEditable()
 @DomName('SVGFontFaceUriElement')
 @Unstable()
-abstract class _SVGFontFaceUriElement extends SvgElement {
+class _SVGFontFaceUriElement extends SvgElement {
   // To suppress missing implicit constructor warnings.
   factory _SVGFontFaceUriElement._() { throw new UnsupportedError("Not supported"); }
+
+
+  @Deprecated("Internal Use Only")
+  static _SVGFontFaceUriElement internalCreate_SVGFontFaceUriElement() {
+    return new _SVGFontFaceUriElement._internalWrap();
+  }
+
+  factory _SVGFontFaceUriElement._internalWrap() {
+    return new _SVGFontFaceUriElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  _SVGFontFaceUriElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -7407,13 +9439,27 @@
 @DocsEditable()
 @DomName('SVGGlyphElement')
 @Unstable()
-abstract class _SVGGlyphElement extends SvgElement {
+class _SVGGlyphElement extends SvgElement {
   // To suppress missing implicit constructor warnings.
   factory _SVGGlyphElement._() { throw new UnsupportedError("Not supported"); }
 
   @DomName('SVGGlyphElement.SVGGlyphElement')
   @DocsEditable()
   factory _SVGGlyphElement() => _SvgElementFactoryProvider.createSvgElement_tag("glyph");
+
+
+  @Deprecated("Internal Use Only")
+  static _SVGGlyphElement internalCreate_SVGGlyphElement() {
+    return new _SVGGlyphElement._internalWrap();
+  }
+
+  factory _SVGGlyphElement._internalWrap() {
+    return new _SVGGlyphElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  _SVGGlyphElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -7426,15 +9472,27 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-// WARNING: Do not edit - generated code.
-
 
 @DocsEditable()
 @DomName('SVGGlyphRefElement')
 @Unstable()
-abstract class _SVGGlyphRefElement extends SvgElement implements UriReference {
+class _SVGGlyphRefElement extends SvgElement implements UriReference {
   // To suppress missing implicit constructor warnings.
   factory _SVGGlyphRefElement._() { throw new UnsupportedError("Not supported"); }
+
+
+  @Deprecated("Internal Use Only")
+  static _SVGGlyphRefElement internalCreate_SVGGlyphRefElement() {
+    return new _SVGGlyphRefElement._internalWrap();
+  }
+
+  factory _SVGGlyphRefElement._internalWrap() {
+    return new _SVGGlyphRefElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  _SVGGlyphRefElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -7442,7 +9500,10 @@
    */
   _SVGGlyphRefElement.created() : super.created();
 
+  // Override these methods for Dartium _SVGGlyphRefElement can't be abstract.
+  AnimatedString get href => wrap_jso(_blink.BlinkSVGGlyphRefElement.instance.href_Getter_(unwrap_jso(this)));
 }
+
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
@@ -7453,13 +9514,27 @@
 @DocsEditable()
 @DomName('SVGHKernElement')
 @Unstable()
-abstract class _SVGHKernElement extends SvgElement {
+class _SVGHKernElement extends SvgElement {
   // To suppress missing implicit constructor warnings.
   factory _SVGHKernElement._() { throw new UnsupportedError("Not supported"); }
 
   @DomName('SVGHKernElement.SVGHKernElement')
   @DocsEditable()
   factory _SVGHKernElement() => _SvgElementFactoryProvider.createSvgElement_tag("hkern");
+
+
+  @Deprecated("Internal Use Only")
+  static _SVGHKernElement internalCreate_SVGHKernElement() {
+    return new _SVGHKernElement._internalWrap();
+  }
+
+  factory _SVGHKernElement._internalWrap() {
+    return new _SVGHKernElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  _SVGHKernElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -7472,18 +9547,30 @@
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
 
-// WARNING: Do not edit - generated code.
-
 
 @DocsEditable()
 @DomName('SVGMPathElement')
-abstract class _SVGMPathElement extends SvgElement implements UriReference {
+class _SVGMPathElement extends SvgElement implements UriReference {
   // To suppress missing implicit constructor warnings.
   factory _SVGMPathElement._() { throw new UnsupportedError("Not supported"); }
 
   @DomName('SVGMPathElement.SVGMPathElement')
   @DocsEditable()
   factory _SVGMPathElement() => _SvgElementFactoryProvider.createSvgElement_tag("mpath");
+
+
+  @Deprecated("Internal Use Only")
+  static _SVGMPathElement internalCreate_SVGMPathElement() {
+    return new _SVGMPathElement._internalWrap();
+  }
+
+  factory _SVGMPathElement._internalWrap() {
+    return new _SVGMPathElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  _SVGMPathElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -7491,7 +9578,10 @@
    */
   _SVGMPathElement.created() : super.created();
 
+  // Override these methods for Dartium _SVGMPathElement can't be abstract.
+  AnimatedString get href => wrap_jso(_blink.BlinkSVGMPathElement.instance.href_Getter_(unwrap_jso(this)));
 }
+
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
@@ -7502,9 +9592,23 @@
 @DocsEditable()
 @DomName('SVGMissingGlyphElement')
 @Unstable()
-abstract class _SVGMissingGlyphElement extends SvgElement {
+class _SVGMissingGlyphElement extends SvgElement {
   // To suppress missing implicit constructor warnings.
   factory _SVGMissingGlyphElement._() { throw new UnsupportedError("Not supported"); }
+
+
+  @Deprecated("Internal Use Only")
+  static _SVGMissingGlyphElement internalCreate_SVGMissingGlyphElement() {
+    return new _SVGMissingGlyphElement._internalWrap();
+  }
+
+  factory _SVGMissingGlyphElement._internalWrap() {
+    return new _SVGMissingGlyphElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  _SVGMissingGlyphElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
@@ -7523,13 +9627,27 @@
 @DocsEditable()
 @DomName('SVGVKernElement')
 @Unstable()
-abstract class _SVGVKernElement extends SvgElement {
+class _SVGVKernElement extends SvgElement {
   // To suppress missing implicit constructor warnings.
   factory _SVGVKernElement._() { throw new UnsupportedError("Not supported"); }
 
   @DomName('SVGVKernElement.SVGVKernElement')
   @DocsEditable()
   factory _SVGVKernElement() => _SvgElementFactoryProvider.createSvgElement_tag("vkern");
+
+
+  @Deprecated("Internal Use Only")
+  static _SVGVKernElement internalCreate_SVGVKernElement() {
+    return new _SVGVKernElement._internalWrap();
+  }
+
+  factory _SVGVKernElement._internalWrap() {
+    return new _SVGVKernElement.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  _SVGVKernElement.internal_() : super.internal_();
+
   /**
    * Constructor instantiated by the DOM when a custom element has been created.
    *
diff --git a/sdk/lib/vmservice/client.dart b/sdk/lib/vmservice/client.dart
new file mode 100644
index 0000000..aa00d09
--- /dev/null
+++ b/sdk/lib/vmservice/client.dart
@@ -0,0 +1,48 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+part of dart._vmservice;
+
+// A service client.
+abstract class Client {
+  final VMService service;
+  final bool sendEvents;
+  final Set<String> streams = new Set<String>();
+
+  Client(this.service, { bool sendEvents: true })
+      : this.sendEvents = sendEvents {
+    service._addClient(this);
+  }
+
+  // Disconnects the client.
+  disconnect();
+
+  /// When implementing, call [close] when the network connection closes.
+  void close() {
+    service._removeClient(this);
+  }
+
+  /// Call to process a message. Response will be posted with 'seq'.
+  void onMessage(var seq, Message message) {
+    try {
+      // Send message to service.
+      service.route(message).then((response) {
+        // Call post when the response arrives.
+        post(response);
+      });
+    } catch (e, st) {
+      message.setErrorResponse(
+          kInternalError, 'Unexpected exception:$e\n$st');
+      post(message.response);
+    }
+  }
+
+  // Sends a result to the client.  Implemented in subclasses.
+  void post(dynamic result);
+
+  dynamic toJson() {
+    return {
+    };
+  }
+}
diff --git a/sdk/lib/vmservice/constants.dart b/sdk/lib/vmservice/constants.dart
new file mode 100644
index 0000000..e899dd1
--- /dev/null
+++ b/sdk/lib/vmservice/constants.dart
@@ -0,0 +1,12 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+part of dart._vmservice;
+
+// These must be kept in sync with runtime/vm/service.cc.
+class Constants {
+  static const int SERVICE_EXIT_MESSAGE_ID = 0;
+  static const int ISOLATE_STARTUP_MESSAGE_ID = 1;
+  static const int ISOLATE_SHUTDOWN_MESSAGE_ID = 2;
+}
diff --git a/sdk/lib/vmservice/message.dart b/sdk/lib/vmservice/message.dart
new file mode 100644
index 0000000..481206e
--- /dev/null
+++ b/sdk/lib/vmservice/message.dart
@@ -0,0 +1,149 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+part of dart._vmservice;
+
+class Message {
+  final Completer _completer = new Completer.sync();
+  bool get completed => _completer.isCompleted;
+  /// Future of response.
+  Future<String> get response => _completer.future;
+  Client client;
+
+  // Client-side identifier for this message.
+  final serial;
+
+  // In new messages.
+  final String method;
+
+  // In old messages.
+  final List path = new List();
+
+  final Map params = new Map();
+
+  void _setPath(List<String> pathSegments) {
+    if (pathSegments == null) {
+      return;
+    }
+    pathSegments.forEach((String segment) {
+      if (segment == null || segment == '') {
+        return;
+      }
+      path.add(segment);
+    });
+  }
+
+  Message.fromJsonRpc(this.client, Map map)
+      : serial = map['id'], method = map['method'] {
+    if (map['params'] != null) {
+      params.addAll(map['params']);
+    }
+  }
+
+  static String _methodNameFromUri(Uri uri) {
+    if (uri == null) {
+      return '';
+    }
+    if (uri.pathSegments.length == 0) {
+      return '';
+    }
+    return uri.pathSegments[0];
+  }
+
+  Message.fromUri(this.client, Uri uri)
+      : serial = '', method = _methodNameFromUri(uri) {
+    params.addAll(uri.queryParameters);
+  }
+
+  Message.forIsolate(this.client, Uri uri, RunningIsolate isolate)
+      : serial = '', method = _methodNameFromUri(uri) {
+    params.addAll(uri.queryParameters);
+    params['isolateId'] = isolate.serviceId;
+  }
+
+  Uri toUri() {
+    return new Uri(path: method, queryParameters: params);
+  }
+
+  dynamic toJson() {
+    return {
+      'path': path,
+      'params': params
+    };
+  }
+
+  // Calls toString on all non-String elements of [list]. We do this so all
+  // elements in the list are strings, making consumption by C++ simpler.
+  // This has a side effect that boolean literal values like true become 'true'
+  // and thus indistinguishable from the string literal 'true'.
+  List _makeAllString(List list) {
+    if (list == null) {
+      return null;
+    }
+    for (var i = 0; i < list.length; i++) {
+      if (list[i] is String) {
+        continue;
+      }
+      list[i] = list[i].toString();
+    }
+    return list;
+  }
+
+  Future<String> send(SendPort sendPort) {
+    final receivePort = new RawReceivePort();
+    receivePort.handler = (value) {
+      receivePort.close();
+      _completer.complete(value);
+    };
+    var keys = _makeAllString(params.keys.toList(growable:false));
+    var values = _makeAllString(params.values.toList(growable:false));
+    var request = new List(6)
+        ..[0] = 0  // Make room for OOB message type.
+        ..[1] = receivePort.sendPort
+        ..[2] = serial
+        ..[3] = method
+        ..[4] = keys
+        ..[5] = values;
+    if (!sendIsolateServiceMessage(sendPort, request)) {
+      _completer.complete(JSON.encode({
+          'type': 'ServiceError',
+          'id': '',
+          'kind': 'InternalError',
+          'message': 'could not send message [${serial}] to isolate',
+      }));
+    }
+    return _completer.future;
+  }
+
+  Future<String> sendToVM() {
+    final receivePort = new RawReceivePort();
+    receivePort.handler = (value) {
+      receivePort.close();
+      _completer.complete(value);
+    };
+    var keys = _makeAllString(params.keys.toList(growable:false));
+    var values = _makeAllString(params.values.toList(growable:false));
+    var request = new List(6)
+        ..[0] = 0  // Make room for OOB message type.
+        ..[1] = receivePort.sendPort
+        ..[2] = serial
+        ..[3] = method
+        ..[4] = keys
+        ..[5] = values;
+    sendRootServiceMessage(request);
+    return _completer.future;
+  }
+
+  void setResponse(String response) {
+    _completer.complete(response);
+  }
+
+  void setErrorResponse(int code, String details) {
+    _completer.complete(encodeRpcError(this, code,
+                                       details: '$method: $details'));
+  }
+}
+
+external bool sendIsolateServiceMessage(SendPort sp, List m);
+external void sendRootServiceMessage(List m);
diff --git a/sdk/lib/vmservice/message_router.dart b/sdk/lib/vmservice/message_router.dart
new file mode 100644
index 0000000..d510004
--- /dev/null
+++ b/sdk/lib/vmservice/message_router.dart
@@ -0,0 +1,9 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+part of dart._vmservice;
+
+abstract class MessageRouter {
+  Future<String> route(Message message);
+}
diff --git a/sdk/lib/vmservice/running_isolate.dart b/sdk/lib/vmservice/running_isolate.dart
new file mode 100644
index 0000000..6c24341
--- /dev/null
+++ b/sdk/lib/vmservice/running_isolate.dart
@@ -0,0 +1,20 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+part of dart._vmservice;
+
+class RunningIsolate implements MessageRouter {
+  final int portId;
+  final SendPort sendPort;
+  final String name;
+
+  RunningIsolate(this.portId, this.sendPort, this.name);
+
+  String get serviceId => 'isolates/$portId';
+
+  Future<String> route(Message message) {
+    // Send message to isolate.
+    return message.send(sendPort);
+  }
+}
diff --git a/sdk/lib/vmservice/running_isolates.dart b/sdk/lib/vmservice/running_isolates.dart
new file mode 100644
index 0000000..1a5ed06
--- /dev/null
+++ b/sdk/lib/vmservice/running_isolates.dart
@@ -0,0 +1,62 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+part of dart._vmservice;
+
+class RunningIsolates implements MessageRouter {
+  final Map<int, RunningIsolate> isolates = new Map<int, RunningIsolate>();
+  int _rootPortId;
+
+  RunningIsolates();
+
+  void isolateStartup(int portId, SendPort sp, String name) {
+    if (_rootPortId == null) {
+      _rootPortId = portId;
+    }
+    var ri = new RunningIsolate(portId, sp, name);
+    isolates[portId] = ri;
+  }
+
+  void isolateShutdown(int portId, SendPort sp) {
+    if (_rootPortId == portId) {
+      _rootPortId = null;
+    }
+    isolates.remove(portId);
+  }
+
+  Future<String> route(Message message) {
+    String isolateParam = message.params['isolateId'];
+    int isolateId;
+    if (!isolateParam.startsWith('isolates/')) {
+      message.setErrorResponse(
+          kInvalidParams, "invalid 'isolateId' parameter: $isolateParam");
+      return message.response;
+    }
+    isolateParam = isolateParam.substring('isolates/'.length);
+    if (isolateParam == 'root') {
+      isolateId = _rootPortId;
+    } else {
+      try {
+        isolateId = int.parse(isolateParam);
+      } catch (e) {
+        message.setErrorResponse(
+            kInvalidParams, "invalid 'isolateId' parameter: $isolateParam");
+        return message.response;
+      }
+    }
+    var isolate = isolates[isolateId];
+    if (isolate == null) {
+      // There is some chance that this isolate may have lived before,
+      // so return a sentinel rather than an error.
+      var result = {
+        'type' : 'Sentinel',
+        'kind' : 'Collected',
+        'valueAsString' : '<collected>',
+      };
+      message.setResponse(encodeResult(message, result));
+      return message.response;
+    }
+    return isolate.route(message);
+  }
+}
diff --git a/sdk/lib/vmservice/vmservice.dart b/sdk/lib/vmservice/vmservice.dart
new file mode 100644
index 0000000..eda4504
--- /dev/null
+++ b/sdk/lib/vmservice/vmservice.dart
@@ -0,0 +1,331 @@
+// 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 dart._vmservice;
+
+import 'dart:async';
+import 'dart:convert';
+import 'dart:isolate';
+import 'dart:typed_data';
+
+part 'client.dart';
+part 'constants.dart';
+part 'running_isolate.dart';
+part 'running_isolates.dart';
+part 'message.dart';
+part 'message_router.dart';
+
+final RawReceivePort isolateLifecyclePort = new RawReceivePort();
+final RawReceivePort scriptLoadPort = new RawReceivePort();
+
+typedef ShutdownCallback();
+
+// These must be kept in sync with the declarations in vm/json_stream.h.
+const kInvalidParams = -32602;
+const kInternalError = -32603;
+const kStreamAlreadySubscribed = 103;
+const kStreamNotSubscribed = 104;
+
+var _errorMessages = {
+  kInvalidParams: 'Invalid params',
+  kInternalError: 'Internal error',
+  kStreamAlreadySubscribed: 'Stream already subscribed',
+  kStreamNotSubscribed: 'Stream not subscribed',
+};
+
+String encodeRpcError(Message message, int code, {String details}) {
+  var response = {
+    'jsonrpc': '2.0',
+    'id' : message.serial,
+    'error' : {
+      'code': code,
+      'message': _errorMessages[code],
+    },
+  };
+  if (details != null) {
+    response['error']['data'] = {
+      'details': details,
+    };
+  }
+  return JSON.encode(response);
+}
+
+String encodeResult(Message message, Map result) {
+  var response = {
+    'jsonrpc': '2.0',
+    'id' : message.serial,
+    'result' : result,
+  };
+  return JSON.encode(response);
+}
+
+
+class VMService extends MessageRouter {
+  static VMService _instance;
+
+  /// Collection of currently connected clients.
+  final Set<Client> clients = new Set<Client>();
+
+  /// Collection of currently running isolates.
+  RunningIsolates runningIsolates = new RunningIsolates();
+
+  /// A port used to receive events from the VM.
+  final RawReceivePort eventPort;
+
+  ShutdownCallback onShutdown;
+
+  void _addClient(Client client) {
+    assert(client.streams.isEmpty);
+    clients.add(client);
+  }
+
+  void _removeClient(Client client) {
+    clients.remove(client);
+    for (var streamId in client.streams) {
+      if (!_isAnyClientSubscribed(streamId)) {
+        _vmCancelStream(streamId);
+      }
+    }
+  }
+
+  void _eventMessageHandler(List eventMessage) {
+    var streamId = eventMessage[0];
+    var event = eventMessage[1];
+    for (var client in clients) {
+      if (client.sendEvents && client.streams.contains(streamId)) {
+        client.post(event);
+      }
+    }
+  }
+
+  void _controlMessageHandler(int code,
+                              int portId,
+                              SendPort sp,
+                              String name) {
+    switch (code) {
+      case Constants.ISOLATE_STARTUP_MESSAGE_ID:
+        runningIsolates.isolateStartup(portId, sp, name);
+      break;
+      case Constants.ISOLATE_SHUTDOWN_MESSAGE_ID:
+        runningIsolates.isolateShutdown(portId, sp);
+      break;
+    }
+  }
+
+  void _exit() {
+    isolateLifecyclePort.close();
+    scriptLoadPort.close();
+    // Create a copy of the set as a list because client.disconnect() will
+    // alter the connected clients set.
+    var clientsList = clients.toList();
+    for (var client in clientsList) {
+      client.disconnect();
+    }
+    // Call embedder shutdown hook after the internal shutdown.
+    if (onShutdown != null) {
+      onShutdown();
+    }
+    _onExit();
+  }
+
+  void messageHandler(message) {
+    if (message is List) {
+      if (message.length == 2) {
+        // This is an event.
+        assert(message[0] is String);
+        assert(message[1] is String || message[1] is Uint8List);
+        _eventMessageHandler(message);
+        return;
+      }
+      if (message.length == 1) {
+        // This is a control message directing the vm service to exit.
+        assert(message[0] == Constants.SERVICE_EXIT_MESSAGE_ID);
+        _exit();
+        return;
+      }
+      if (message.length == 4) {
+        // This is a message informing us of the birth or death of an
+        // isolate.
+        _controlMessageHandler(message[0], message[1], message[2], message[3]);
+        return;
+      }
+    }
+    print('Internal vm-service error: ignoring illegal message: $message');
+  }
+
+  void _notSupported(_) {
+    throw new UnimplementedError('Service script loading not supported.');
+  }
+
+  VMService._internal()
+      : eventPort = isolateLifecyclePort {
+    scriptLoadPort.handler = _notSupported;
+    eventPort.handler = messageHandler;
+  }
+
+  factory VMService() {
+    if (VMService._instance == null) {
+      VMService._instance = new VMService._internal();
+      _onStart();
+    }
+    return _instance;
+  }
+
+  void _clientCollection(Message message) {
+    var members = [];
+    var result = {};
+    clients.forEach((client) {
+      members.add(client.toJson());
+    });
+    result['type'] = 'ClientList';
+    result['members'] = members;
+    message.setResponse(JSON.encode(result));
+  }
+
+  bool _isAnyClientSubscribed(String streamId) {
+    for (var client in clients) {
+      if (client.streams.contains(streamId)) {
+        return true;
+      }
+    }
+    return false;
+  }
+
+  Future<String> _streamListen(Message message) async {
+    var client = message.client;
+    var streamId = message.params['streamId'];
+
+    if (client.streams.contains(streamId)) {
+      return encodeRpcError(message, kStreamAlreadySubscribed);
+    }
+    if (!_isAnyClientSubscribed(streamId)) {
+      if (!_vmListenStream(streamId)) {
+        return encodeRpcError(
+            message, kInvalidParams,
+            details:"streamListen: invalid 'streamId' parameter: ${streamId}");
+      }
+    }
+    client.streams.add(streamId);
+
+    var result = { 'type' : 'Success' };
+    return encodeResult(message, result);
+  }
+
+  Future<String> _streamCancel(Message message) async {
+    var client = message.client;
+    var streamId = message.params['streamId'];
+
+    if (!client.streams.contains(streamId)) {
+      return encodeRpcError(message, kStreamNotSubscribed);
+    }
+    client.streams.remove(streamId);
+    if (!_isAnyClientSubscribed(streamId)) {
+      _vmCancelStream(streamId);
+    }
+
+    var result = { 'type' : 'Success' };
+    return encodeResult(message, result);
+  }
+
+  // TODO(johnmccutchan): Turn this into a command line tool that uses the
+  // service library.
+  Future<String> _getCrashDump(Message message) async {
+    var client = message.client;
+    final perIsolateRequests = [
+        // ?isolateId=<isolate id> will be appended to each of these requests.
+        // Isolate information.
+        Uri.parse('getIsolate'),
+        // State of heap.
+        Uri.parse('_getAllocationProfile'),
+        // Call stack + local variables.
+        Uri.parse('getStack?_full=true'),
+    ];
+
+    // Snapshot of running isolates.
+    var isolates = runningIsolates.isolates.values.toList();
+
+    // Collect the mapping from request uris to responses.
+    var responses = {
+    };
+
+    // Request VM.
+    var getVM = Uri.parse('getVM');
+    var getVmResponse = JSON.decode(
+        await new Message.fromUri(client, getVM).sendToVM());
+    responses[getVM.toString()] = getVmResponse['result'];
+
+    // Request command line flags.
+    var getFlagList = Uri.parse('getFlagList');
+    var getFlagListResponse = JSON.decode(
+        await new Message.fromUri(client, getFlagList).sendToVM());
+    responses[getFlagList.toString()] = getFlagListResponse['result'];
+
+    // Make requests to each isolate.
+    for (var isolate in isolates) {
+      for (var request in perIsolateRequests) {
+        var message = new Message.forIsolate(client, request, isolate);
+        // Decode the JSON and and insert it into the map. The map key
+        // is the request Uri.
+        var response = JSON.decode(await isolate.route(message));
+        responses[message.toUri().toString()] = response['result'];
+      }
+      // Dump the object id ring requests.
+      var message =
+          new Message.forIsolate(client, Uri.parse('_dumpIdZone'), isolate);
+      var response = JSON.decode(await isolate.route(message));
+      // Insert getObject requests into responses map.
+      for (var object in response['result']['objects']) {
+        final requestUri =
+            'getObject&isolateId=${isolate.serviceId}?objectId=${object["id"]}';
+        responses[requestUri] = object;
+      }
+    }
+
+    // Encode the entire crash dump.
+    return encodeResult(message, responses);
+  }
+
+  Future<String> route(Message message) {
+    if (message.completed) {
+      return message.response;
+    }
+    // TODO(turnidge): Update to json rpc.  BEFORE SUBMIT.
+    if ((message.path.length == 1) && (message.path[0] == 'clients')) {
+      _clientCollection(message);
+      return message.response;
+    }
+    if (message.method == '_getCrashDump') {
+      return _getCrashDump(message);
+    }
+    if (message.method == 'streamListen') {
+      return _streamListen(message);
+    }
+    if (message.method == 'streamCancel') {
+      return _streamCancel(message);
+    }
+    if (message.params['isolateId'] != null) {
+      return runningIsolates.route(message);
+    }
+    return message.sendToVM();
+  }
+}
+
+RawReceivePort boot() {
+  // Return the port we expect isolate startup and shutdown messages on.
+  return isolateLifecyclePort;
+}
+
+void _registerIsolate(int port_id, SendPort sp, String name) {
+  var service = new VMService();
+  service.runningIsolates.isolateStartup(port_id, sp, name);
+}
+
+external void _onStart();
+
+external void _onExit();
+
+external bool _vmListenStream(String streamId);
+
+external void _vmCancelStream(String streamId);
+
diff --git a/sdk/lib/vmservice/vmservice_sources.gypi b/sdk/lib/vmservice/vmservice_sources.gypi
new file mode 100644
index 0000000..97b2582
--- /dev/null
+++ b/sdk/lib/vmservice/vmservice_sources.gypi
@@ -0,0 +1,18 @@
+# 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.
+
+# Sources that make up the library "dart:_vmservice".
+
+{
+  'sources': [
+    'vmservice.dart',
+    # The above file needs to be first as it imports required libraries.
+    'client.dart',
+    'constants.dart',
+    'running_isolate.dart',
+    'running_isolates.dart',
+    'message.dart',
+    'message_router.dart',
+  ],
+}
diff --git a/sdk/lib/web_audio/dart2js/web_audio_dart2js.dart b/sdk/lib/web_audio/dart2js/web_audio_dart2js.dart
index 9524b80..6005329 100644
--- a/sdk/lib/web_audio/dart2js/web_audio_dart2js.dart
+++ b/sdk/lib/web_audio/dart2js/web_audio_dart2js.dart
@@ -5,7 +5,7 @@
 
 import 'dart:async';
 import 'dart:collection';
-import 'dart:_internal' hide deprecated;
+import 'dart:_internal';
 import 'dart:html';
 import 'dart:html_common';
 import 'dart:_native_typed_data';
diff --git a/sdk/lib/web_audio/dartium/web_audio_dartium.dart b/sdk/lib/web_audio/dartium/web_audio_dartium.dart
index f38441b..cc99534 100644
--- a/sdk/lib/web_audio/dartium/web_audio_dartium.dart
+++ b/sdk/lib/web_audio/dartium/web_audio_dartium.dart
@@ -5,12 +5,13 @@
 
 import 'dart:async';
 import 'dart:collection';
-import 'dart:_internal' hide deprecated;
+import 'dart:_internal';
 import 'dart:html';
 import 'dart:html_common';
 import 'dart:nativewrappers';
 import 'dart:typed_data';
 import 'dart:_blink' as _blink;
+import 'dart:js' as js;
 // DO NOT EDIT
 // Auto-generated dart:audio library.
 
@@ -18,6 +19,7 @@
 
 
 // FIXME: Can we make this private?
+@Deprecated("Internal Use Only")
 final web_audioBlinkMap = {
   'AnalyserNode': () => AnalyserNode,
   'AudioBuffer': () => AudioBuffer,
@@ -49,6 +51,38 @@
 
 };
 
+// FIXME: Can we make this private?
+@Deprecated("Internal Use Only")
+final web_audioBlinkFunctionMap = {
+  'AnalyserNode': () => AnalyserNode.internalCreateAnalyserNode,
+  'AudioBuffer': () => AudioBuffer.internalCreateAudioBuffer,
+  'AudioBufferSourceNode': () => AudioBufferSourceNode.internalCreateAudioBufferSourceNode,
+  'AudioContext': () => AudioContext.internalCreateAudioContext,
+  'AudioDestinationNode': () => AudioDestinationNode.internalCreateAudioDestinationNode,
+  'AudioListener': () => AudioListener.internalCreateAudioListener,
+  'AudioNode': () => AudioNode.internalCreateAudioNode,
+  'AudioParam': () => AudioParam.internalCreateAudioParam,
+  'AudioProcessingEvent': () => AudioProcessingEvent.internalCreateAudioProcessingEvent,
+  'AudioSourceNode': () => AudioSourceNode.internalCreateAudioSourceNode,
+  'BiquadFilterNode': () => BiquadFilterNode.internalCreateBiquadFilterNode,
+  'ChannelMergerNode': () => ChannelMergerNode.internalCreateChannelMergerNode,
+  'ChannelSplitterNode': () => ChannelSplitterNode.internalCreateChannelSplitterNode,
+  'ConvolverNode': () => ConvolverNode.internalCreateConvolverNode,
+  'DelayNode': () => DelayNode.internalCreateDelayNode,
+  'DynamicsCompressorNode': () => DynamicsCompressorNode.internalCreateDynamicsCompressorNode,
+  'GainNode': () => GainNode.internalCreateGainNode,
+  'MediaElementAudioSourceNode': () => MediaElementAudioSourceNode.internalCreateMediaElementAudioSourceNode,
+  'MediaStreamAudioDestinationNode': () => MediaStreamAudioDestinationNode.internalCreateMediaStreamAudioDestinationNode,
+  'MediaStreamAudioSourceNode': () => MediaStreamAudioSourceNode.internalCreateMediaStreamAudioSourceNode,
+  'OfflineAudioCompletionEvent': () => OfflineAudioCompletionEvent.internalCreateOfflineAudioCompletionEvent,
+  'OfflineAudioContext': () => OfflineAudioContext.internalCreateOfflineAudioContext,
+  'OscillatorNode': () => OscillatorNode.internalCreateOscillatorNode,
+  'PannerNode': () => PannerNode.internalCreatePannerNode,
+  'PeriodicWave': () => PeriodicWave.internalCreatePeriodicWave,
+  'ScriptProcessorNode': () => ScriptProcessorNode.internalCreateScriptProcessorNode,
+  'WaveShaperNode': () => WaveShaperNode.internalCreateWaveShaperNode,
+
+};
 // Copyright (c) 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.
@@ -64,13 +98,27 @@
   // To suppress missing implicit constructor warnings.
   factory AnalyserNode._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static AnalyserNode internalCreateAnalyserNode() {
+    return new AnalyserNode._internalWrap();
+  }
+
+  factory AnalyserNode._internalWrap() {
+    return new AnalyserNode.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  AnalyserNode.internal_() : super.internal_();
+
+
   @DomName('AnalyserNode.fftSize')
   @DocsEditable()
   int get fftSize => _blink.BlinkAnalyserNode.instance.fftSize_Getter_(unwrap_jso(this));
   
   @DomName('AnalyserNode.fftSize')
   @DocsEditable()
-  void set fftSize(int value) => _blink.BlinkAnalyserNode.instance.fftSize_Setter_(unwrap_jso(this), value);
+  set fftSize(int value) => _blink.BlinkAnalyserNode.instance.fftSize_Setter_(unwrap_jso(this), value);
   
   @DomName('AnalyserNode.frequencyBinCount')
   @DocsEditable()
@@ -82,7 +130,7 @@
   
   @DomName('AnalyserNode.maxDecibels')
   @DocsEditable()
-  void set maxDecibels(num value) => _blink.BlinkAnalyserNode.instance.maxDecibels_Setter_(unwrap_jso(this), value);
+  set maxDecibels(num value) => _blink.BlinkAnalyserNode.instance.maxDecibels_Setter_(unwrap_jso(this), value);
   
   @DomName('AnalyserNode.minDecibels')
   @DocsEditable()
@@ -90,7 +138,7 @@
   
   @DomName('AnalyserNode.minDecibels')
   @DocsEditable()
-  void set minDecibels(num value) => _blink.BlinkAnalyserNode.instance.minDecibels_Setter_(unwrap_jso(this), value);
+  set minDecibels(num value) => _blink.BlinkAnalyserNode.instance.minDecibels_Setter_(unwrap_jso(this), value);
   
   @DomName('AnalyserNode.smoothingTimeConstant')
   @DocsEditable()
@@ -98,7 +146,7 @@
   
   @DomName('AnalyserNode.smoothingTimeConstant')
   @DocsEditable()
-  void set smoothingTimeConstant(num value) => _blink.BlinkAnalyserNode.instance.smoothingTimeConstant_Setter_(unwrap_jso(this), value);
+  set smoothingTimeConstant(num value) => _blink.BlinkAnalyserNode.instance.smoothingTimeConstant_Setter_(unwrap_jso(this), value);
   
   @DomName('AnalyserNode.getByteFrequencyData')
   @DocsEditable()
@@ -129,13 +177,28 @@
 @DomName('AudioBuffer')
 // https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#AudioBuffer-section
 @Experimental()
-class AudioBuffer extends NativeFieldWrapperClass2 {
+class AudioBuffer extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory AudioBuffer._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static AudioBuffer internalCreateAudioBuffer() {
+    return new AudioBuffer._internalWrap();
+  }
+
+  factory AudioBuffer._internalWrap() {
+    return new AudioBuffer.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  AudioBuffer.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('AudioBuffer.duration')
   @DocsEditable()
-  double get duration => _blink.BlinkAudioBuffer.instance.duration_Getter_(unwrap_jso(this));
+  num get duration => _blink.BlinkAudioBuffer.instance.duration_Getter_(unwrap_jso(this));
   
   @DomName('AudioBuffer.length')
   @DocsEditable()
@@ -147,7 +210,7 @@
   
   @DomName('AudioBuffer.sampleRate')
   @DocsEditable()
-  double get sampleRate => _blink.BlinkAudioBuffer.instance.sampleRate_Getter_(unwrap_jso(this));
+  num get sampleRate => _blink.BlinkAudioBuffer.instance.sampleRate_Getter_(unwrap_jso(this));
   
   @DomName('AudioBuffer.getChannelData')
   @DocsEditable()
@@ -193,13 +256,27 @@
   @Experimental() // untriaged
   static const EventStreamProvider<Event> endedEvent = const EventStreamProvider<Event>('ended');
 
+
+  @Deprecated("Internal Use Only")
+  static AudioBufferSourceNode internalCreateAudioBufferSourceNode() {
+    return new AudioBufferSourceNode._internalWrap();
+  }
+
+  factory AudioBufferSourceNode._internalWrap() {
+    return new AudioBufferSourceNode.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  AudioBufferSourceNode.internal_() : super.internal_();
+
+
   @DomName('AudioBufferSourceNode.buffer')
   @DocsEditable()
   AudioBuffer get buffer => wrap_jso(_blink.BlinkAudioBufferSourceNode.instance.buffer_Getter_(unwrap_jso(this)));
   
   @DomName('AudioBufferSourceNode.buffer')
   @DocsEditable()
-  void set buffer(AudioBuffer value) => _blink.BlinkAudioBufferSourceNode.instance.buffer_Setter_(unwrap_jso(this), unwrap_jso(value));
+  set buffer(AudioBuffer value) => _blink.BlinkAudioBufferSourceNode.instance.buffer_Setter_(unwrap_jso(this), unwrap_jso(value));
   
   @DomName('AudioBufferSourceNode.loop')
   @DocsEditable()
@@ -207,7 +284,7 @@
   
   @DomName('AudioBufferSourceNode.loop')
   @DocsEditable()
-  void set loop(bool value) => _blink.BlinkAudioBufferSourceNode.instance.loop_Setter_(unwrap_jso(this), value);
+  set loop(bool value) => _blink.BlinkAudioBufferSourceNode.instance.loop_Setter_(unwrap_jso(this), value);
   
   @DomName('AudioBufferSourceNode.loopEnd')
   @DocsEditable()
@@ -215,7 +292,7 @@
   
   @DomName('AudioBufferSourceNode.loopEnd')
   @DocsEditable()
-  void set loopEnd(num value) => _blink.BlinkAudioBufferSourceNode.instance.loopEnd_Setter_(unwrap_jso(this), value);
+  set loopEnd(num value) => _blink.BlinkAudioBufferSourceNode.instance.loopEnd_Setter_(unwrap_jso(this), value);
   
   @DomName('AudioBufferSourceNode.loopStart')
   @DocsEditable()
@@ -223,7 +300,7 @@
   
   @DomName('AudioBufferSourceNode.loopStart')
   @DocsEditable()
-  void set loopStart(num value) => _blink.BlinkAudioBufferSourceNode.instance.loopStart_Setter_(unwrap_jso(this), value);
+  set loopStart(num value) => _blink.BlinkAudioBufferSourceNode.instance.loopStart_Setter_(unwrap_jso(this), value);
   
   @DomName('AudioBufferSourceNode.playbackRate')
   @DocsEditable()
@@ -289,15 +366,29 @@
   @DomName('AudioContext.AudioContext')
   @DocsEditable()
   factory AudioContext() {
-    return _blink.BlinkAudioContext.instance.constructorCallback_0_();
+    return wrap_jso(_blink.BlinkAudioContext.instance.constructorCallback_0_());
   }
 
+
+  @Deprecated("Internal Use Only")
+  static AudioContext internalCreateAudioContext() {
+    return new AudioContext._internalWrap();
+  }
+
+  factory AudioContext._internalWrap() {
+    return new AudioContext.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  AudioContext.internal_() : super.internal_();
+
+
   /// Checks if this type is supported on the current platform.
   static bool get supported => true;
 
   @DomName('AudioContext.currentTime')
   @DocsEditable()
-  double get currentTime => _blink.BlinkAudioContext.instance.currentTime_Getter_(unwrap_jso(this));
+  num get currentTime => _blink.BlinkAudioContext.instance.currentTime_Getter_(unwrap_jso(this));
   
   @DomName('AudioContext.destination')
   @DocsEditable()
@@ -309,7 +400,7 @@
   
   @DomName('AudioContext.sampleRate')
   @DocsEditable()
-  double get sampleRate => _blink.BlinkAudioContext.instance.sampleRate_Getter_(unwrap_jso(this));
+  num get sampleRate => _blink.BlinkAudioContext.instance.sampleRate_Getter_(unwrap_jso(this));
   
   @DomName('AudioContext.createAnalyser')
   @DocsEditable()
@@ -404,7 +495,7 @@
   
   @DomName('AudioContext.decodeAudioData')
   @DocsEditable()
-  void _decodeAudioData(ByteBuffer audioData, AudioBufferCallback successCallback, [AudioBufferCallback errorCallback]) => _blink.BlinkAudioContext.instance.decodeAudioData_Callback_3_(unwrap_jso(this), audioData, unwrap_jso(successCallback), unwrap_jso(errorCallback));
+  void _decodeAudioData(ByteBuffer audioData, AudioBufferCallback successCallback, [AudioBufferCallback errorCallback]) => _blink.BlinkAudioContext.instance.decodeAudioData_Callback_3_(unwrap_jso(this), audioData, unwrap_jso((audioBuffer) => successCallback(wrap_jso(audioBuffer))), unwrap_jso((audioBuffer) => errorCallback(wrap_jso(audioBuffer))));
   
   @DomName('AudioContext.startRendering')
   @DocsEditable()
@@ -445,6 +536,20 @@
   // To suppress missing implicit constructor warnings.
   factory AudioDestinationNode._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static AudioDestinationNode internalCreateAudioDestinationNode() {
+    return new AudioDestinationNode._internalWrap();
+  }
+
+  factory AudioDestinationNode._internalWrap() {
+    return new AudioDestinationNode.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  AudioDestinationNode.internal_() : super.internal_();
+
+
   @DomName('AudioDestinationNode.maxChannelCount')
   @DocsEditable()
   int get maxChannelCount => _blink.BlinkAudioDestinationNode.instance.maxChannelCount_Getter_(unwrap_jso(this));
@@ -461,17 +566,32 @@
 @DomName('AudioListener')
 // https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#AudioListener-section
 @Experimental()
-class AudioListener extends NativeFieldWrapperClass2 {
+class AudioListener extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory AudioListener._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static AudioListener internalCreateAudioListener() {
+    return new AudioListener._internalWrap();
+  }
+
+  factory AudioListener._internalWrap() {
+    return new AudioListener.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  AudioListener.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('AudioListener.dopplerFactor')
   @DocsEditable()
   num get dopplerFactor => _blink.BlinkAudioListener.instance.dopplerFactor_Getter_(unwrap_jso(this));
   
   @DomName('AudioListener.dopplerFactor')
   @DocsEditable()
-  void set dopplerFactor(num value) => _blink.BlinkAudioListener.instance.dopplerFactor_Setter_(unwrap_jso(this), value);
+  set dopplerFactor(num value) => _blink.BlinkAudioListener.instance.dopplerFactor_Setter_(unwrap_jso(this), value);
   
   @DomName('AudioListener.speedOfSound')
   @DocsEditable()
@@ -479,7 +599,7 @@
   
   @DomName('AudioListener.speedOfSound')
   @DocsEditable()
-  void set speedOfSound(num value) => _blink.BlinkAudioListener.instance.speedOfSound_Setter_(unwrap_jso(this), value);
+  set speedOfSound(num value) => _blink.BlinkAudioListener.instance.speedOfSound_Setter_(unwrap_jso(this), value);
   
   @DomName('AudioListener.setOrientation')
   @DocsEditable()
@@ -506,13 +626,27 @@
   // To suppress missing implicit constructor warnings.
   factory AudioNode._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static AudioNode internalCreateAudioNode() {
+    return new AudioNode._internalWrap();
+  }
+
+  factory AudioNode._internalWrap() {
+    return new AudioNode.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  AudioNode.internal_() : super.internal_();
+
+
   @DomName('AudioNode.channelCount')
   @DocsEditable()
   int get channelCount => _blink.BlinkAudioNode.instance.channelCount_Getter_(unwrap_jso(this));
   
   @DomName('AudioNode.channelCount')
   @DocsEditable()
-  void set channelCount(int value) => _blink.BlinkAudioNode.instance.channelCount_Setter_(unwrap_jso(this), value);
+  set channelCount(int value) => _blink.BlinkAudioNode.instance.channelCount_Setter_(unwrap_jso(this), value);
   
   @DomName('AudioNode.channelCountMode')
   @DocsEditable()
@@ -520,7 +654,7 @@
   
   @DomName('AudioNode.channelCountMode')
   @DocsEditable()
-  void set channelCountMode(String value) => _blink.BlinkAudioNode.instance.channelCountMode_Setter_(unwrap_jso(this), value);
+  set channelCountMode(String value) => _blink.BlinkAudioNode.instance.channelCountMode_Setter_(unwrap_jso(this), value);
   
   @DomName('AudioNode.channelInterpretation')
   @DocsEditable()
@@ -528,7 +662,7 @@
   
   @DomName('AudioNode.channelInterpretation')
   @DocsEditable()
-  void set channelInterpretation(String value) => _blink.BlinkAudioNode.instance.channelInterpretation_Setter_(unwrap_jso(this), value);
+  set channelInterpretation(String value) => _blink.BlinkAudioNode.instance.channelInterpretation_Setter_(unwrap_jso(this), value);
   
   @DomName('AudioNode.context')
   @DocsEditable()
@@ -577,13 +711,28 @@
 @DomName('AudioParam')
 // https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#AudioParam
 @Experimental()
-class AudioParam extends NativeFieldWrapperClass2 {
+class AudioParam extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory AudioParam._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static AudioParam internalCreateAudioParam() {
+    return new AudioParam._internalWrap();
+  }
+
+  factory AudioParam._internalWrap() {
+    return new AudioParam.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  AudioParam.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('AudioParam.defaultValue')
   @DocsEditable()
-  double get defaultValue => _blink.BlinkAudioParam.instance.defaultValue_Getter_(unwrap_jso(this));
+  num get defaultValue => _blink.BlinkAudioParam.instance.defaultValue_Getter_(unwrap_jso(this));
   
   @DomName('AudioParam.value')
   @DocsEditable()
@@ -591,7 +740,7 @@
   
   @DomName('AudioParam.value')
   @DocsEditable()
-  void set value(num value) => _blink.BlinkAudioParam.instance.value_Setter_(unwrap_jso(this), value);
+  set value(num value) => _blink.BlinkAudioParam.instance.value_Setter_(unwrap_jso(this), value);
   
   @DomName('AudioParam.cancelScheduledValues')
   @DocsEditable()
@@ -633,6 +782,20 @@
   // To suppress missing implicit constructor warnings.
   factory AudioProcessingEvent._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static AudioProcessingEvent internalCreateAudioProcessingEvent() {
+    return new AudioProcessingEvent._internalWrap();
+  }
+
+  factory AudioProcessingEvent._internalWrap() {
+    return new AudioProcessingEvent.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  AudioProcessingEvent.internal_() : super.internal_();
+
+
   @DomName('AudioProcessingEvent.inputBuffer')
   @DocsEditable()
   AudioBuffer get inputBuffer => wrap_jso(_blink.BlinkAudioProcessingEvent.instance.inputBuffer_Getter_(unwrap_jso(this)));
@@ -644,7 +807,7 @@
   @DomName('AudioProcessingEvent.playbackTime')
   @DocsEditable()
   @Experimental() // untriaged
-  double get playbackTime => _blink.BlinkAudioProcessingEvent.instance.playbackTime_Getter_(unwrap_jso(this));
+  num get playbackTime => _blink.BlinkAudioProcessingEvent.instance.playbackTime_Getter_(unwrap_jso(this));
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -662,6 +825,20 @@
   // To suppress missing implicit constructor warnings.
   factory AudioSourceNode._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static AudioSourceNode internalCreateAudioSourceNode() {
+    return new AudioSourceNode._internalWrap();
+  }
+
+  factory AudioSourceNode._internalWrap() {
+    return new AudioSourceNode.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  AudioSourceNode.internal_() : super.internal_();
+
+
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -678,6 +855,20 @@
   // To suppress missing implicit constructor warnings.
   factory BiquadFilterNode._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static BiquadFilterNode internalCreateBiquadFilterNode() {
+    return new BiquadFilterNode._internalWrap();
+  }
+
+  factory BiquadFilterNode._internalWrap() {
+    return new BiquadFilterNode.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  BiquadFilterNode.internal_() : super.internal_();
+
+
   @DomName('BiquadFilterNode.Q')
   @DocsEditable()
   AudioParam get Q => wrap_jso(_blink.BlinkBiquadFilterNode.instance.Q_Getter_(unwrap_jso(this)));
@@ -700,7 +891,7 @@
   
   @DomName('BiquadFilterNode.type')
   @DocsEditable()
-  void set type(String value) => _blink.BlinkBiquadFilterNode.instance.type_Setter_(unwrap_jso(this), value);
+  set type(String value) => _blink.BlinkBiquadFilterNode.instance.type_Setter_(unwrap_jso(this), value);
   
   @DomName('BiquadFilterNode.getFrequencyResponse')
   @DocsEditable()
@@ -722,6 +913,20 @@
   // To suppress missing implicit constructor warnings.
   factory ChannelMergerNode._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static ChannelMergerNode internalCreateChannelMergerNode() {
+    return new ChannelMergerNode._internalWrap();
+  }
+
+  factory ChannelMergerNode._internalWrap() {
+    return new ChannelMergerNode.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  ChannelMergerNode.internal_() : super.internal_();
+
+
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -738,6 +943,20 @@
   // To suppress missing implicit constructor warnings.
   factory ChannelSplitterNode._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static ChannelSplitterNode internalCreateChannelSplitterNode() {
+    return new ChannelSplitterNode._internalWrap();
+  }
+
+  factory ChannelSplitterNode._internalWrap() {
+    return new ChannelSplitterNode.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  ChannelSplitterNode.internal_() : super.internal_();
+
+
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -754,13 +973,27 @@
   // To suppress missing implicit constructor warnings.
   factory ConvolverNode._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static ConvolverNode internalCreateConvolverNode() {
+    return new ConvolverNode._internalWrap();
+  }
+
+  factory ConvolverNode._internalWrap() {
+    return new ConvolverNode.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  ConvolverNode.internal_() : super.internal_();
+
+
   @DomName('ConvolverNode.buffer')
   @DocsEditable()
   AudioBuffer get buffer => wrap_jso(_blink.BlinkConvolverNode.instance.buffer_Getter_(unwrap_jso(this)));
   
   @DomName('ConvolverNode.buffer')
   @DocsEditable()
-  void set buffer(AudioBuffer value) => _blink.BlinkConvolverNode.instance.buffer_Setter_(unwrap_jso(this), unwrap_jso(value));
+  set buffer(AudioBuffer value) => _blink.BlinkConvolverNode.instance.buffer_Setter_(unwrap_jso(this), unwrap_jso(value));
   
   @DomName('ConvolverNode.normalize')
   @DocsEditable()
@@ -768,7 +1001,7 @@
   
   @DomName('ConvolverNode.normalize')
   @DocsEditable()
-  void set normalize(bool value) => _blink.BlinkConvolverNode.instance.normalize_Setter_(unwrap_jso(this), value);
+  set normalize(bool value) => _blink.BlinkConvolverNode.instance.normalize_Setter_(unwrap_jso(this), value);
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -786,6 +1019,20 @@
   // To suppress missing implicit constructor warnings.
   factory DelayNode._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static DelayNode internalCreateDelayNode() {
+    return new DelayNode._internalWrap();
+  }
+
+  factory DelayNode._internalWrap() {
+    return new DelayNode.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  DelayNode.internal_() : super.internal_();
+
+
   @DomName('DelayNode.delayTime')
   @DocsEditable()
   AudioParam get delayTime => wrap_jso(_blink.BlinkDelayNode.instance.delayTime_Getter_(unwrap_jso(this)));
@@ -806,6 +1053,20 @@
   // To suppress missing implicit constructor warnings.
   factory DynamicsCompressorNode._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static DynamicsCompressorNode internalCreateDynamicsCompressorNode() {
+    return new DynamicsCompressorNode._internalWrap();
+  }
+
+  factory DynamicsCompressorNode._internalWrap() {
+    return new DynamicsCompressorNode.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  DynamicsCompressorNode.internal_() : super.internal_();
+
+
   @DomName('DynamicsCompressorNode.attack')
   @DocsEditable()
   AudioParam get attack => wrap_jso(_blink.BlinkDynamicsCompressorNode.instance.attack_Getter_(unwrap_jso(this)));
@@ -846,6 +1107,20 @@
   // To suppress missing implicit constructor warnings.
   factory GainNode._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static GainNode internalCreateGainNode() {
+    return new GainNode._internalWrap();
+  }
+
+  factory GainNode._internalWrap() {
+    return new GainNode.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  GainNode.internal_() : super.internal_();
+
+
   @DomName('GainNode.gain')
   @DocsEditable()
   AudioParam get gain => wrap_jso(_blink.BlinkGainNode.instance.gain_Getter_(unwrap_jso(this)));
@@ -866,6 +1141,20 @@
   // To suppress missing implicit constructor warnings.
   factory MediaElementAudioSourceNode._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static MediaElementAudioSourceNode internalCreateMediaElementAudioSourceNode() {
+    return new MediaElementAudioSourceNode._internalWrap();
+  }
+
+  factory MediaElementAudioSourceNode._internalWrap() {
+    return new MediaElementAudioSourceNode.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  MediaElementAudioSourceNode.internal_() : super.internal_();
+
+
   @DomName('MediaElementAudioSourceNode.mediaElement')
   @DocsEditable()
   @Experimental() // non-standard
@@ -887,6 +1176,20 @@
   // To suppress missing implicit constructor warnings.
   factory MediaStreamAudioDestinationNode._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static MediaStreamAudioDestinationNode internalCreateMediaStreamAudioDestinationNode() {
+    return new MediaStreamAudioDestinationNode._internalWrap();
+  }
+
+  factory MediaStreamAudioDestinationNode._internalWrap() {
+    return new MediaStreamAudioDestinationNode.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  MediaStreamAudioDestinationNode.internal_() : super.internal_();
+
+
   @DomName('MediaStreamAudioDestinationNode.stream')
   @DocsEditable()
   MediaStream get stream => wrap_jso(_blink.BlinkMediaStreamAudioDestinationNode.instance.stream_Getter_(unwrap_jso(this)));
@@ -907,6 +1210,20 @@
   // To suppress missing implicit constructor warnings.
   factory MediaStreamAudioSourceNode._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static MediaStreamAudioSourceNode internalCreateMediaStreamAudioSourceNode() {
+    return new MediaStreamAudioSourceNode._internalWrap();
+  }
+
+  factory MediaStreamAudioSourceNode._internalWrap() {
+    return new MediaStreamAudioSourceNode.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  MediaStreamAudioSourceNode.internal_() : super.internal_();
+
+
   @DomName('MediaStreamAudioSourceNode.mediaStream')
   @DocsEditable()
   MediaStream get mediaStream => wrap_jso(_blink.BlinkMediaStreamAudioSourceNode.instance.mediaStream_Getter_(unwrap_jso(this)));
@@ -927,6 +1244,20 @@
   // To suppress missing implicit constructor warnings.
   factory OfflineAudioCompletionEvent._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static OfflineAudioCompletionEvent internalCreateOfflineAudioCompletionEvent() {
+    return new OfflineAudioCompletionEvent._internalWrap();
+  }
+
+  factory OfflineAudioCompletionEvent._internalWrap() {
+    return new OfflineAudioCompletionEvent.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  OfflineAudioCompletionEvent.internal_() : super.internal_();
+
+
   @DomName('OfflineAudioCompletionEvent.renderedBuffer')
   @DocsEditable()
   AudioBuffer get renderedBuffer => wrap_jso(_blink.BlinkOfflineAudioCompletionEvent.instance.renderedBuffer_Getter_(unwrap_jso(this)));
@@ -950,9 +1281,23 @@
   @DomName('OfflineAudioContext.OfflineAudioContext')
   @DocsEditable()
   factory OfflineAudioContext(int numberOfChannels, int numberOfFrames, num sampleRate) {
-    return _blink.BlinkOfflineAudioContext.instance.constructorCallback_3_(numberOfChannels, numberOfFrames, sampleRate);
+    return wrap_jso(_blink.BlinkOfflineAudioContext.instance.constructorCallback_3_(numberOfChannels, numberOfFrames, sampleRate));
   }
 
+
+  @Deprecated("Internal Use Only")
+  static OfflineAudioContext internalCreateOfflineAudioContext() {
+    return new OfflineAudioContext._internalWrap();
+  }
+
+  factory OfflineAudioContext._internalWrap() {
+    return new OfflineAudioContext.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  OfflineAudioContext.internal_() : super.internal_();
+
+
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -980,6 +1325,20 @@
   @Experimental() // untriaged
   static const EventStreamProvider<Event> endedEvent = const EventStreamProvider<Event>('ended');
 
+
+  @Deprecated("Internal Use Only")
+  static OscillatorNode internalCreateOscillatorNode() {
+    return new OscillatorNode._internalWrap();
+  }
+
+  factory OscillatorNode._internalWrap() {
+    return new OscillatorNode.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  OscillatorNode.internal_() : super.internal_();
+
+
   @DomName('OscillatorNode.detune')
   @DocsEditable()
   AudioParam get detune => wrap_jso(_blink.BlinkOscillatorNode.instance.detune_Getter_(unwrap_jso(this)));
@@ -994,7 +1353,7 @@
   
   @DomName('OscillatorNode.type')
   @DocsEditable()
-  void set type(String value) => _blink.BlinkOscillatorNode.instance.type_Setter_(unwrap_jso(this), value);
+  set type(String value) => _blink.BlinkOscillatorNode.instance.type_Setter_(unwrap_jso(this), value);
   
   @DomName('OscillatorNode.noteOff')
   @DocsEditable()
@@ -1049,13 +1408,27 @@
   // To suppress missing implicit constructor warnings.
   factory PannerNode._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static PannerNode internalCreatePannerNode() {
+    return new PannerNode._internalWrap();
+  }
+
+  factory PannerNode._internalWrap() {
+    return new PannerNode.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  PannerNode.internal_() : super.internal_();
+
+
   @DomName('PannerNode.coneInnerAngle')
   @DocsEditable()
   num get coneInnerAngle => _blink.BlinkPannerNode.instance.coneInnerAngle_Getter_(unwrap_jso(this));
   
   @DomName('PannerNode.coneInnerAngle')
   @DocsEditable()
-  void set coneInnerAngle(num value) => _blink.BlinkPannerNode.instance.coneInnerAngle_Setter_(unwrap_jso(this), value);
+  set coneInnerAngle(num value) => _blink.BlinkPannerNode.instance.coneInnerAngle_Setter_(unwrap_jso(this), value);
   
   @DomName('PannerNode.coneOuterAngle')
   @DocsEditable()
@@ -1063,7 +1436,7 @@
   
   @DomName('PannerNode.coneOuterAngle')
   @DocsEditable()
-  void set coneOuterAngle(num value) => _blink.BlinkPannerNode.instance.coneOuterAngle_Setter_(unwrap_jso(this), value);
+  set coneOuterAngle(num value) => _blink.BlinkPannerNode.instance.coneOuterAngle_Setter_(unwrap_jso(this), value);
   
   @DomName('PannerNode.coneOuterGain')
   @DocsEditable()
@@ -1071,7 +1444,7 @@
   
   @DomName('PannerNode.coneOuterGain')
   @DocsEditable()
-  void set coneOuterGain(num value) => _blink.BlinkPannerNode.instance.coneOuterGain_Setter_(unwrap_jso(this), value);
+  set coneOuterGain(num value) => _blink.BlinkPannerNode.instance.coneOuterGain_Setter_(unwrap_jso(this), value);
   
   @DomName('PannerNode.distanceModel')
   @DocsEditable()
@@ -1079,7 +1452,7 @@
   
   @DomName('PannerNode.distanceModel')
   @DocsEditable()
-  void set distanceModel(String value) => _blink.BlinkPannerNode.instance.distanceModel_Setter_(unwrap_jso(this), value);
+  set distanceModel(String value) => _blink.BlinkPannerNode.instance.distanceModel_Setter_(unwrap_jso(this), value);
   
   @DomName('PannerNode.maxDistance')
   @DocsEditable()
@@ -1087,7 +1460,7 @@
   
   @DomName('PannerNode.maxDistance')
   @DocsEditable()
-  void set maxDistance(num value) => _blink.BlinkPannerNode.instance.maxDistance_Setter_(unwrap_jso(this), value);
+  set maxDistance(num value) => _blink.BlinkPannerNode.instance.maxDistance_Setter_(unwrap_jso(this), value);
   
   @DomName('PannerNode.panningModel')
   @DocsEditable()
@@ -1095,7 +1468,7 @@
   
   @DomName('PannerNode.panningModel')
   @DocsEditable()
-  void set panningModel(String value) => _blink.BlinkPannerNode.instance.panningModel_Setter_(unwrap_jso(this), value);
+  set panningModel(String value) => _blink.BlinkPannerNode.instance.panningModel_Setter_(unwrap_jso(this), value);
   
   @DomName('PannerNode.refDistance')
   @DocsEditable()
@@ -1103,7 +1476,7 @@
   
   @DomName('PannerNode.refDistance')
   @DocsEditable()
-  void set refDistance(num value) => _blink.BlinkPannerNode.instance.refDistance_Setter_(unwrap_jso(this), value);
+  set refDistance(num value) => _blink.BlinkPannerNode.instance.refDistance_Setter_(unwrap_jso(this), value);
   
   @DomName('PannerNode.rolloffFactor')
   @DocsEditable()
@@ -1111,7 +1484,7 @@
   
   @DomName('PannerNode.rolloffFactor')
   @DocsEditable()
-  void set rolloffFactor(num value) => _blink.BlinkPannerNode.instance.rolloffFactor_Setter_(unwrap_jso(this), value);
+  set rolloffFactor(num value) => _blink.BlinkPannerNode.instance.rolloffFactor_Setter_(unwrap_jso(this), value);
   
   @DomName('PannerNode.setOrientation')
   @DocsEditable()
@@ -1136,10 +1509,25 @@
 @DocsEditable()
 @DomName('PeriodicWave')
 @Experimental() // untriaged
-class PeriodicWave extends NativeFieldWrapperClass2 {
+class PeriodicWave extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory PeriodicWave._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static PeriodicWave internalCreatePeriodicWave() {
+    return new PeriodicWave._internalWrap();
+  }
+
+  factory PeriodicWave._internalWrap() {
+    return new PeriodicWave.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  PeriodicWave.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -1167,6 +1555,20 @@
   @Experimental() // untriaged
   static const EventStreamProvider<AudioProcessingEvent> audioProcessEvent = const EventStreamProvider<AudioProcessingEvent>('audioprocess');
 
+
+  @Deprecated("Internal Use Only")
+  static ScriptProcessorNode internalCreateScriptProcessorNode() {
+    return new ScriptProcessorNode._internalWrap();
+  }
+
+  factory ScriptProcessorNode._internalWrap() {
+    return new ScriptProcessorNode.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  ScriptProcessorNode.internal_() : super.internal_();
+
+
   @DomName('ScriptProcessorNode.bufferSize')
   @DocsEditable()
   int get bufferSize => _blink.BlinkScriptProcessorNode.instance.bufferSize_Getter_(unwrap_jso(this));
@@ -1174,7 +1576,7 @@
   @DomName('ScriptProcessorNode.setEventListener')
   @DocsEditable()
   @Experimental() // untriaged
-  void setEventListener(EventListener eventListener) => _blink.BlinkScriptProcessorNode.instance.setEventListener_Callback_1_(unwrap_jso(this), unwrap_jso(eventListener));
+  void setEventListener(EventListener eventListener) => _blink.BlinkScriptProcessorNode.instance.setEventListener_Callback_1_(unwrap_jso(this), unwrap_jso((event) => eventListener(wrap_jso(event))));
   
   /// Stream of `audioprocess` events handled by this [ScriptProcessorNode].
 /**
@@ -1205,13 +1607,27 @@
   // To suppress missing implicit constructor warnings.
   factory WaveShaperNode._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static WaveShaperNode internalCreateWaveShaperNode() {
+    return new WaveShaperNode._internalWrap();
+  }
+
+  factory WaveShaperNode._internalWrap() {
+    return new WaveShaperNode.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  WaveShaperNode.internal_() : super.internal_();
+
+
   @DomName('WaveShaperNode.curve')
   @DocsEditable()
-  Float32List get curve => wrap_jso(_blink.BlinkWaveShaperNode.instance.curve_Getter_(unwrap_jso(this)));
+  Float32List get curve => _blink.BlinkWaveShaperNode.instance.curve_Getter_(unwrap_jso(this));
   
   @DomName('WaveShaperNode.curve')
   @DocsEditable()
-  void set curve(Float32List value) => _blink.BlinkWaveShaperNode.instance.curve_Setter_(unwrap_jso(this), unwrap_jso(value));
+  set curve(Float32List value) => _blink.BlinkWaveShaperNode.instance.curve_Setter_(unwrap_jso(this), unwrap_jso(value));
   
   @DomName('WaveShaperNode.oversample')
   @DocsEditable()
@@ -1219,6 +1635,6 @@
   
   @DomName('WaveShaperNode.oversample')
   @DocsEditable()
-  void set oversample(String value) => _blink.BlinkWaveShaperNode.instance.oversample_Setter_(unwrap_jso(this), value);
+  set oversample(String value) => _blink.BlinkWaveShaperNode.instance.oversample_Setter_(unwrap_jso(this), value);
   
 }
diff --git a/sdk/lib/web_gl/dart2js/web_gl_dart2js.dart b/sdk/lib/web_gl/dart2js/web_gl_dart2js.dart
index 29d3070..2ce52d4 100644
--- a/sdk/lib/web_gl/dart2js/web_gl_dart2js.dart
+++ b/sdk/lib/web_gl/dart2js/web_gl_dart2js.dart
@@ -4,12 +4,12 @@
 library dart.dom.web_gl;
 
 import 'dart:collection';
-import 'dart:_internal' hide deprecated;
+import 'dart:_internal';
 import 'dart:html';
 import 'dart:html_common';
 import 'dart:_native_typed_data';
 import 'dart:typed_data';
-import 'dart:_js_helper' show Creates, JSName, Native, Null, Returns, convertDartClosureToJS;
+import 'dart:_js_helper' show Creates, JSName, Native, Returns, convertDartClosureToJS;
 import 'dart:_foreign_helper' show JS;
 import 'dart:_interceptors' show Interceptor, JSExtendableArray;
 // DO NOT EDIT - unless you are editing documentation as per:
diff --git a/sdk/lib/web_gl/dartium/web_gl_dartium.dart b/sdk/lib/web_gl/dartium/web_gl_dartium.dart
index d587afd..1fdf4c7 100644
--- a/sdk/lib/web_gl/dartium/web_gl_dartium.dart
+++ b/sdk/lib/web_gl/dartium/web_gl_dartium.dart
@@ -5,12 +5,13 @@
 
 import 'dart:async';
 import 'dart:collection';
-import 'dart:_internal' hide deprecated;
+import 'dart:_internal';
 import 'dart:html';
 import 'dart:html_common';
 import 'dart:nativewrappers';
 import 'dart:typed_data';
 import 'dart:_blink' as _blink;
+import 'dart:js' as js;
 // DO NOT EDIT
 // Auto-generated dart:web_gl library.
 
@@ -19,6 +20,7 @@
 
 
 // FIXME: Can we make this private?
+@Deprecated("Internal Use Only")
 final web_glBlinkMap = {
   'ANGLEInstancedArrays': () => AngleInstancedArrays,
   'EXTBlendMinMax': () => ExtBlendMinMax,
@@ -58,6 +60,45 @@
 
 };
 
+// FIXME: Can we make this private?
+@Deprecated("Internal Use Only")
+final web_glBlinkFunctionMap = {
+  'ANGLEInstancedArrays': () => AngleInstancedArrays.internalCreateAngleInstancedArrays,
+  'EXTBlendMinMax': () => ExtBlendMinMax.internalCreateExtBlendMinMax,
+  'EXTFragDepth': () => ExtFragDepth.internalCreateExtFragDepth,
+  'EXTShaderTextureLOD': () => ExtShaderTextureLod.internalCreateExtShaderTextureLod,
+  'EXTTextureFilterAnisotropic': () => ExtTextureFilterAnisotropic.internalCreateExtTextureFilterAnisotropic,
+  'OESElementIndexUint': () => OesElementIndexUint.internalCreateOesElementIndexUint,
+  'OESStandardDerivatives': () => OesStandardDerivatives.internalCreateOesStandardDerivatives,
+  'OESTextureFloat': () => OesTextureFloat.internalCreateOesTextureFloat,
+  'OESTextureFloatLinear': () => OesTextureFloatLinear.internalCreateOesTextureFloatLinear,
+  'OESTextureHalfFloat': () => OesTextureHalfFloat.internalCreateOesTextureHalfFloat,
+  'OESTextureHalfFloatLinear': () => OesTextureHalfFloatLinear.internalCreateOesTextureHalfFloatLinear,
+  'OESVertexArrayObject': () => OesVertexArrayObject.internalCreateOesVertexArrayObject,
+  'WebGLActiveInfo': () => ActiveInfo.internalCreateActiveInfo,
+  'WebGLBuffer': () => Buffer.internalCreateBuffer,
+  'WebGLCompressedTextureATC': () => CompressedTextureAtc.internalCreateCompressedTextureAtc,
+  'WebGLCompressedTextureETC1': () => CompressedTextureETC1.internalCreateCompressedTextureETC1,
+  'WebGLCompressedTexturePVRTC': () => CompressedTexturePvrtc.internalCreateCompressedTexturePvrtc,
+  'WebGLCompressedTextureS3TC': () => CompressedTextureS3TC.internalCreateCompressedTextureS3TC,
+  'WebGLContextAttributes': () => ContextAttributes.internalCreateContextAttributes,
+  'WebGLContextEvent': () => ContextEvent.internalCreateContextEvent,
+  'WebGLDebugRendererInfo': () => DebugRendererInfo.internalCreateDebugRendererInfo,
+  'WebGLDebugShaders': () => DebugShaders.internalCreateDebugShaders,
+  'WebGLDepthTexture': () => DepthTexture.internalCreateDepthTexture,
+  'WebGLDrawBuffers': () => DrawBuffers.internalCreateDrawBuffers,
+  'WebGLFramebuffer': () => Framebuffer.internalCreateFramebuffer,
+  'WebGLLoseContext': () => LoseContext.internalCreateLoseContext,
+  'WebGLProgram': () => Program.internalCreateProgram,
+  'WebGLRenderbuffer': () => Renderbuffer.internalCreateRenderbuffer,
+  'WebGLRenderingContext': () => RenderingContext.internalCreateRenderingContext,
+  'WebGLShader': () => Shader.internalCreateShader,
+  'WebGLShaderPrecisionFormat': () => ShaderPrecisionFormat.internalCreateShaderPrecisionFormat,
+  'WebGLTexture': () => Texture.internalCreateTexture,
+  'WebGLUniformLocation': () => UniformLocation.internalCreateUniformLocation,
+  'WebGLVertexArrayObjectOES': () => VertexArrayObject.internalCreateVertexArrayObject,
+
+};
 // 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.
@@ -369,10 +410,25 @@
 @DocsEditable()
 @DomName('WebGLActiveInfo')
 @Unstable()
-class ActiveInfo extends NativeFieldWrapperClass2 {
+class ActiveInfo extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory ActiveInfo._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static ActiveInfo internalCreateActiveInfo() {
+    return new ActiveInfo._internalWrap();
+  }
+
+  factory ActiveInfo._internalWrap() {
+    return new ActiveInfo.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  ActiveInfo.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('WebGLActiveInfo.name')
   @DocsEditable()
   String get name => _blink.BlinkWebGLActiveInfo.instance.name_Getter_(unwrap_jso(this));
@@ -396,10 +452,25 @@
 @DocsEditable()
 @DomName('ANGLEInstancedArrays')
 @Experimental() // untriaged
-class AngleInstancedArrays extends NativeFieldWrapperClass2 {
+class AngleInstancedArrays extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory AngleInstancedArrays._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static AngleInstancedArrays internalCreateAngleInstancedArrays() {
+    return new AngleInstancedArrays._internalWrap();
+  }
+
+  factory AngleInstancedArrays._internalWrap() {
+    return new AngleInstancedArrays.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  AngleInstancedArrays.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('ANGLEInstancedArrays.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE')
   @DocsEditable()
   @Experimental() // untriaged
@@ -431,10 +502,25 @@
 @DocsEditable()
 @DomName('WebGLBuffer')
 @Unstable()
-class Buffer extends NativeFieldWrapperClass2 {
+class Buffer extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory Buffer._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static Buffer internalCreateBuffer() {
+    return new Buffer._internalWrap();
+  }
+
+  factory Buffer._internalWrap() {
+    return new Buffer.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  Buffer.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -447,10 +533,25 @@
 @DomName('WebGLCompressedTextureATC')
 // http://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_atc/
 @Experimental()
-class CompressedTextureAtc extends NativeFieldWrapperClass2 {
+class CompressedTextureAtc extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory CompressedTextureAtc._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static CompressedTextureAtc internalCreateCompressedTextureAtc() {
+    return new CompressedTextureAtc._internalWrap();
+  }
+
+  factory CompressedTextureAtc._internalWrap() {
+    return new CompressedTextureAtc.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  CompressedTextureAtc.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('WebGLCompressedTextureATC.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL')
   @DocsEditable()
   static const int COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL = 0x8C93;
@@ -474,10 +575,25 @@
 @DocsEditable()
 @DomName('WebGLCompressedTextureETC1')
 @Experimental() // untriaged
-class CompressedTextureETC1 extends NativeFieldWrapperClass2 {
+class CompressedTextureETC1 extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory CompressedTextureETC1._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static CompressedTextureETC1 internalCreateCompressedTextureETC1() {
+    return new CompressedTextureETC1._internalWrap();
+  }
+
+  factory CompressedTextureETC1._internalWrap() {
+    return new CompressedTextureETC1.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  CompressedTextureETC1.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('WebGLCompressedTextureETC1.COMPRESSED_RGB_ETC1_WEBGL')
   @DocsEditable()
   @Experimental() // untriaged
@@ -495,10 +611,25 @@
 @DomName('WebGLCompressedTexturePVRTC')
 // http://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_pvrtc/
 @Experimental() // experimental
-class CompressedTexturePvrtc extends NativeFieldWrapperClass2 {
+class CompressedTexturePvrtc extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory CompressedTexturePvrtc._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static CompressedTexturePvrtc internalCreateCompressedTexturePvrtc() {
+    return new CompressedTexturePvrtc._internalWrap();
+  }
+
+  factory CompressedTexturePvrtc._internalWrap() {
+    return new CompressedTexturePvrtc.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  CompressedTexturePvrtc.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('WebGLCompressedTexturePVRTC.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG')
   @DocsEditable()
   static const int COMPRESSED_RGBA_PVRTC_2BPPV1_IMG = 0x8C03;
@@ -527,10 +658,25 @@
 @DomName('WebGLCompressedTextureS3TC')
 // http://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_s3tc/
 @Experimental() // experimental
-class CompressedTextureS3TC extends NativeFieldWrapperClass2 {
+class CompressedTextureS3TC extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory CompressedTextureS3TC._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static CompressedTextureS3TC internalCreateCompressedTextureS3TC() {
+    return new CompressedTextureS3TC._internalWrap();
+  }
+
+  factory CompressedTextureS3TC._internalWrap() {
+    return new CompressedTextureS3TC.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  CompressedTextureS3TC.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('WebGLCompressedTextureS3TC.COMPRESSED_RGBA_S3TC_DXT1_EXT')
   @DocsEditable()
   static const int COMPRESSED_RGBA_S3TC_DXT1_EXT = 0x83F1;
@@ -580,17 +726,32 @@
  */
 @DomName('WebGLContextAttributes')
 @Unstable()
-class ContextAttributes extends NativeFieldWrapperClass2 {
+class ContextAttributes extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory ContextAttributes._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static ContextAttributes internalCreateContextAttributes() {
+    return new ContextAttributes._internalWrap();
+  }
+
+  factory ContextAttributes._internalWrap() {
+    return new ContextAttributes.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  ContextAttributes.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('WebGLContextAttributes.alpha')
   @DocsEditable()
   bool get alpha => _blink.BlinkWebGLContextAttributes.instance.alpha_Getter_(unwrap_jso(this));
   
   @DomName('WebGLContextAttributes.alpha')
   @DocsEditable()
-  void set alpha(bool value) => _blink.BlinkWebGLContextAttributes.instance.alpha_Setter_(unwrap_jso(this), value);
+  set alpha(bool value) => _blink.BlinkWebGLContextAttributes.instance.alpha_Setter_(unwrap_jso(this), value);
   
   @DomName('WebGLContextAttributes.antialias')
   @DocsEditable()
@@ -598,7 +759,7 @@
   
   @DomName('WebGLContextAttributes.antialias')
   @DocsEditable()
-  void set antialias(bool value) => _blink.BlinkWebGLContextAttributes.instance.antialias_Setter_(unwrap_jso(this), value);
+  set antialias(bool value) => _blink.BlinkWebGLContextAttributes.instance.antialias_Setter_(unwrap_jso(this), value);
   
   @DomName('WebGLContextAttributes.depth')
   @DocsEditable()
@@ -606,7 +767,7 @@
   
   @DomName('WebGLContextAttributes.depth')
   @DocsEditable()
-  void set depth(bool value) => _blink.BlinkWebGLContextAttributes.instance.depth_Setter_(unwrap_jso(this), value);
+  set depth(bool value) => _blink.BlinkWebGLContextAttributes.instance.depth_Setter_(unwrap_jso(this), value);
   
   @DomName('WebGLContextAttributes.failIfMajorPerformanceCaveat')
   @DocsEditable()
@@ -616,7 +777,7 @@
   @DomName('WebGLContextAttributes.failIfMajorPerformanceCaveat')
   @DocsEditable()
   @Experimental() // untriaged
-  void set failIfMajorPerformanceCaveat(bool value) => _blink.BlinkWebGLContextAttributes.instance.failIfMajorPerformanceCaveat_Setter_(unwrap_jso(this), value);
+  set failIfMajorPerformanceCaveat(bool value) => _blink.BlinkWebGLContextAttributes.instance.failIfMajorPerformanceCaveat_Setter_(unwrap_jso(this), value);
   
   @DomName('WebGLContextAttributes.premultipliedAlpha')
   @DocsEditable()
@@ -624,7 +785,7 @@
   
   @DomName('WebGLContextAttributes.premultipliedAlpha')
   @DocsEditable()
-  void set premultipliedAlpha(bool value) => _blink.BlinkWebGLContextAttributes.instance.premultipliedAlpha_Setter_(unwrap_jso(this), value);
+  set premultipliedAlpha(bool value) => _blink.BlinkWebGLContextAttributes.instance.premultipliedAlpha_Setter_(unwrap_jso(this), value);
   
   @DomName('WebGLContextAttributes.preserveDrawingBuffer')
   @DocsEditable()
@@ -632,7 +793,7 @@
   
   @DomName('WebGLContextAttributes.preserveDrawingBuffer')
   @DocsEditable()
-  void set preserveDrawingBuffer(bool value) => _blink.BlinkWebGLContextAttributes.instance.preserveDrawingBuffer_Setter_(unwrap_jso(this), value);
+  set preserveDrawingBuffer(bool value) => _blink.BlinkWebGLContextAttributes.instance.preserveDrawingBuffer_Setter_(unwrap_jso(this), value);
   
   @DomName('WebGLContextAttributes.stencil')
   @DocsEditable()
@@ -640,7 +801,7 @@
   
   @DomName('WebGLContextAttributes.stencil')
   @DocsEditable()
-  void set stencil(bool value) => _blink.BlinkWebGLContextAttributes.instance.stencil_Setter_(unwrap_jso(this), value);
+  set stencil(bool value) => _blink.BlinkWebGLContextAttributes.instance.stencil_Setter_(unwrap_jso(this), value);
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -657,6 +818,20 @@
   // To suppress missing implicit constructor warnings.
   factory ContextEvent._() { throw new UnsupportedError("Not supported"); }
 
+
+  @Deprecated("Internal Use Only")
+  static ContextEvent internalCreateContextEvent() {
+    return new ContextEvent._internalWrap();
+  }
+
+  factory ContextEvent._internalWrap() {
+    return new ContextEvent.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  ContextEvent.internal_() : super.internal_();
+
+
   @DomName('WebGLContextEvent.statusMessage')
   @DocsEditable()
   String get statusMessage => _blink.BlinkWebGLContextEvent.instance.statusMessage_Getter_(unwrap_jso(this));
@@ -673,10 +848,25 @@
 @DomName('WebGLDebugRendererInfo')
 // http://www.khronos.org/registry/webgl/extensions/WEBGL_debug_renderer_info/
 @Experimental() // experimental
-class DebugRendererInfo extends NativeFieldWrapperClass2 {
+class DebugRendererInfo extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory DebugRendererInfo._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static DebugRendererInfo internalCreateDebugRendererInfo() {
+    return new DebugRendererInfo._internalWrap();
+  }
+
+  factory DebugRendererInfo._internalWrap() {
+    return new DebugRendererInfo.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  DebugRendererInfo.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('WebGLDebugRendererInfo.UNMASKED_RENDERER_WEBGL')
   @DocsEditable()
   static const int UNMASKED_RENDERER_WEBGL = 0x9246;
@@ -697,10 +887,25 @@
 @DomName('WebGLDebugShaders')
 // http://www.khronos.org/registry/webgl/extensions/WEBGL_debug_shaders/
 @Experimental() // experimental
-class DebugShaders extends NativeFieldWrapperClass2 {
+class DebugShaders extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory DebugShaders._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static DebugShaders internalCreateDebugShaders() {
+    return new DebugShaders._internalWrap();
+  }
+
+  factory DebugShaders._internalWrap() {
+    return new DebugShaders.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  DebugShaders.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('WebGLDebugShaders.getTranslatedShaderSource')
   @DocsEditable()
   String getTranslatedShaderSource(Shader shader) => _blink.BlinkWebGLDebugShaders.instance.getTranslatedShaderSource_Callback_1_(unwrap_jso(this), unwrap_jso(shader));
@@ -717,10 +922,25 @@
 @DomName('WebGLDepthTexture')
 // http://www.khronos.org/registry/webgl/extensions/WEBGL_depth_texture/
 @Experimental() // experimental
-class DepthTexture extends NativeFieldWrapperClass2 {
+class DepthTexture extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory DepthTexture._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static DepthTexture internalCreateDepthTexture() {
+    return new DepthTexture._internalWrap();
+  }
+
+  factory DepthTexture._internalWrap() {
+    return new DepthTexture.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  DepthTexture.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('WebGLDepthTexture.UNSIGNED_INT_24_8_WEBGL')
   @DocsEditable()
   static const int UNSIGNED_INT_24_8_WEBGL = 0x84FA;
@@ -737,10 +957,25 @@
 @DomName('WebGLDrawBuffers')
 // http://www.khronos.org/registry/webgl/specs/latest/
 @Experimental() // stable
-class DrawBuffers extends NativeFieldWrapperClass2 {
+class DrawBuffers extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory DrawBuffers._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static DrawBuffers internalCreateDrawBuffers() {
+    return new DrawBuffers._internalWrap();
+  }
+
+  factory DrawBuffers._internalWrap() {
+    return new DrawBuffers.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  DrawBuffers.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('WebGLDrawBuffers.COLOR_ATTACHMENT0_WEBGL')
   @DocsEditable()
   static const int COLOR_ATTACHMENT0_WEBGL = 0x8CE0;
@@ -892,10 +1127,25 @@
 @DocsEditable()
 @DomName('EXTBlendMinMax')
 @Experimental() // untriaged
-class ExtBlendMinMax extends NativeFieldWrapperClass2 {
+class ExtBlendMinMax extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory ExtBlendMinMax._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static ExtBlendMinMax internalCreateExtBlendMinMax() {
+    return new ExtBlendMinMax._internalWrap();
+  }
+
+  factory ExtBlendMinMax._internalWrap() {
+    return new ExtBlendMinMax.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  ExtBlendMinMax.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('EXTBlendMinMax.MAX_EXT')
   @DocsEditable()
   @Experimental() // untriaged
@@ -918,10 +1168,25 @@
 @DomName('EXTFragDepth')
 // http://www.khronos.org/registry/webgl/extensions/EXT_frag_depth/
 @Experimental()
-class ExtFragDepth extends NativeFieldWrapperClass2 {
+class ExtFragDepth extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory ExtFragDepth._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static ExtFragDepth internalCreateExtFragDepth() {
+    return new ExtFragDepth._internalWrap();
+  }
+
+  factory ExtFragDepth._internalWrap() {
+    return new ExtFragDepth.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  ExtFragDepth.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -933,10 +1198,25 @@
 @DocsEditable()
 @DomName('EXTShaderTextureLOD')
 @Experimental() // untriaged
-class ExtShaderTextureLod extends NativeFieldWrapperClass2 {
+class ExtShaderTextureLod extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory ExtShaderTextureLod._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static ExtShaderTextureLod internalCreateExtShaderTextureLod() {
+    return new ExtShaderTextureLod._internalWrap();
+  }
+
+  factory ExtShaderTextureLod._internalWrap() {
+    return new ExtShaderTextureLod.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  ExtShaderTextureLod.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -949,10 +1229,25 @@
 @DomName('EXTTextureFilterAnisotropic')
 // http://www.khronos.org/registry/webgl/extensions/EXT_texture_filter_anisotropic/
 @Experimental()
-class ExtTextureFilterAnisotropic extends NativeFieldWrapperClass2 {
+class ExtTextureFilterAnisotropic extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory ExtTextureFilterAnisotropic._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static ExtTextureFilterAnisotropic internalCreateExtTextureFilterAnisotropic() {
+    return new ExtTextureFilterAnisotropic._internalWrap();
+  }
+
+  factory ExtTextureFilterAnisotropic._internalWrap() {
+    return new ExtTextureFilterAnisotropic.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  ExtTextureFilterAnisotropic.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('EXTTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT')
   @DocsEditable()
   static const int MAX_TEXTURE_MAX_ANISOTROPY_EXT = 0x84FF;
@@ -972,10 +1267,25 @@
 @DocsEditable()
 @DomName('WebGLFramebuffer')
 @Unstable()
-class Framebuffer extends NativeFieldWrapperClass2 {
+class Framebuffer extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory Framebuffer._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static Framebuffer internalCreateFramebuffer() {
+    return new Framebuffer._internalWrap();
+  }
+
+  factory Framebuffer._internalWrap() {
+    return new Framebuffer.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  Framebuffer.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -988,10 +1298,25 @@
 @DomName('WebGLLoseContext')
 // http://www.khronos.org/registry/webgl/extensions/WEBGL_lose_context/
 @Experimental()
-class LoseContext extends NativeFieldWrapperClass2 {
+class LoseContext extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory LoseContext._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static LoseContext internalCreateLoseContext() {
+    return new LoseContext._internalWrap();
+  }
+
+  factory LoseContext._internalWrap() {
+    return new LoseContext.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  LoseContext.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('WebGLLoseContext.loseContext')
   @DocsEditable()
   void loseContext() => _blink.BlinkWebGLLoseContext.instance.loseContext_Callback_0_(unwrap_jso(this));
@@ -1012,10 +1337,25 @@
 @DomName('OESElementIndexUint')
 // http://www.khronos.org/registry/webgl/extensions/OES_element_index_uint/
 @Experimental() // experimental
-class OesElementIndexUint extends NativeFieldWrapperClass2 {
+class OesElementIndexUint extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory OesElementIndexUint._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static OesElementIndexUint internalCreateOesElementIndexUint() {
+    return new OesElementIndexUint._internalWrap();
+  }
+
+  factory OesElementIndexUint._internalWrap() {
+    return new OesElementIndexUint.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  OesElementIndexUint.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -1028,10 +1368,25 @@
 @DomName('OESStandardDerivatives')
 // http://www.khronos.org/registry/webgl/extensions/OES_standard_derivatives/
 @Experimental() // experimental
-class OesStandardDerivatives extends NativeFieldWrapperClass2 {
+class OesStandardDerivatives extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory OesStandardDerivatives._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static OesStandardDerivatives internalCreateOesStandardDerivatives() {
+    return new OesStandardDerivatives._internalWrap();
+  }
+
+  factory OesStandardDerivatives._internalWrap() {
+    return new OesStandardDerivatives.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  OesStandardDerivatives.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('OESStandardDerivatives.FRAGMENT_SHADER_DERIVATIVE_HINT_OES')
   @DocsEditable()
   static const int FRAGMENT_SHADER_DERIVATIVE_HINT_OES = 0x8B8B;
@@ -1048,10 +1403,25 @@
 @DomName('OESTextureFloat')
 // http://www.khronos.org/registry/webgl/extensions/OES_texture_float/
 @Experimental() // experimental
-class OesTextureFloat extends NativeFieldWrapperClass2 {
+class OesTextureFloat extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory OesTextureFloat._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static OesTextureFloat internalCreateOesTextureFloat() {
+    return new OesTextureFloat._internalWrap();
+  }
+
+  factory OesTextureFloat._internalWrap() {
+    return new OesTextureFloat.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  OesTextureFloat.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -1064,10 +1434,25 @@
 @DomName('OESTextureFloatLinear')
 // http://www.khronos.org/registry/webgl/extensions/OES_texture_float_linear/
 @Experimental()
-class OesTextureFloatLinear extends NativeFieldWrapperClass2 {
+class OesTextureFloatLinear extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory OesTextureFloatLinear._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static OesTextureFloatLinear internalCreateOesTextureFloatLinear() {
+    return new OesTextureFloatLinear._internalWrap();
+  }
+
+  factory OesTextureFloatLinear._internalWrap() {
+    return new OesTextureFloatLinear.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  OesTextureFloatLinear.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -1080,10 +1465,25 @@
 @DomName('OESTextureHalfFloat')
 // http://www.khronos.org/registry/webgl/extensions/OES_texture_half_float/
 @Experimental() // experimental
-class OesTextureHalfFloat extends NativeFieldWrapperClass2 {
+class OesTextureHalfFloat extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory OesTextureHalfFloat._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static OesTextureHalfFloat internalCreateOesTextureHalfFloat() {
+    return new OesTextureHalfFloat._internalWrap();
+  }
+
+  factory OesTextureHalfFloat._internalWrap() {
+    return new OesTextureHalfFloat.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  OesTextureHalfFloat.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('OESTextureHalfFloat.HALF_FLOAT_OES')
   @DocsEditable()
   static const int HALF_FLOAT_OES = 0x8D61;
@@ -1100,10 +1500,25 @@
 @DomName('OESTextureHalfFloatLinear')
 // http://www.khronos.org/registry/webgl/extensions/OES_texture_half_float_linear/
 @Experimental()
-class OesTextureHalfFloatLinear extends NativeFieldWrapperClass2 {
+class OesTextureHalfFloatLinear extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory OesTextureHalfFloatLinear._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static OesTextureHalfFloatLinear internalCreateOesTextureHalfFloatLinear() {
+    return new OesTextureHalfFloatLinear._internalWrap();
+  }
+
+  factory OesTextureHalfFloatLinear._internalWrap() {
+    return new OesTextureHalfFloatLinear.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  OesTextureHalfFloatLinear.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -1116,10 +1531,25 @@
 @DomName('OESVertexArrayObject')
 // http://www.khronos.org/registry/webgl/extensions/OES_vertex_array_object/
 @Experimental() // experimental
-class OesVertexArrayObject extends NativeFieldWrapperClass2 {
+class OesVertexArrayObject extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory OesVertexArrayObject._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static OesVertexArrayObject internalCreateOesVertexArrayObject() {
+    return new OesVertexArrayObject._internalWrap();
+  }
+
+  factory OesVertexArrayObject._internalWrap() {
+    return new OesVertexArrayObject.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  OesVertexArrayObject.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('OESVertexArrayObject.VERTEX_ARRAY_BINDING_OES')
   @DocsEditable()
   static const int VERTEX_ARRAY_BINDING_OES = 0x85B5;
@@ -1130,7 +1560,7 @@
   
   @DomName('OESVertexArrayObject.createVertexArrayOES')
   @DocsEditable()
-  VertexArrayObject createVertexArray() => _blink.BlinkOESVertexArrayObject.instance.createVertexArrayOES_Callback_0_(unwrap_jso(this));
+  VertexArrayObject createVertexArray() => wrap_jso(_blink.BlinkOESVertexArrayObject.instance.createVertexArrayOES_Callback_0_(unwrap_jso(this)));
   
   @DomName('OESVertexArrayObject.deleteVertexArrayOES')
   @DocsEditable()
@@ -1151,10 +1581,25 @@
 @DocsEditable()
 @DomName('WebGLProgram')
 @Unstable()
-class Program extends NativeFieldWrapperClass2 {
+class Program extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory Program._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static Program internalCreateProgram() {
+    return new Program._internalWrap();
+  }
+
+  factory Program._internalWrap() {
+    return new Program.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  Program.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -1166,10 +1611,25 @@
 @DocsEditable()
 @DomName('WebGLRenderbuffer')
 @Unstable()
-class Renderbuffer extends NativeFieldWrapperClass2 {
+class Renderbuffer extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory Renderbuffer._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static Renderbuffer internalCreateRenderbuffer() {
+    return new Renderbuffer._internalWrap();
+  }
+
+  factory Renderbuffer._internalWrap() {
+    return new Renderbuffer.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  Renderbuffer.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
 }
 // 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
@@ -1181,10 +1641,25 @@
 @SupportedBrowser(SupportedBrowser.FIREFOX)
 @Experimental()
 @Unstable()
-class RenderingContext extends NativeFieldWrapperClass2 implements CanvasRenderingContext {
+class RenderingContext extends DartHtmlDomObject implements CanvasRenderingContext {
   // To suppress missing implicit constructor warnings.
   factory RenderingContext._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static RenderingContext internalCreateRenderingContext() {
+    return new RenderingContext._internalWrap();
+  }
+
+  factory RenderingContext._internalWrap() {
+    return new RenderingContext.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  RenderingContext.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   /// Checks if this type is supported on the current platform.
   static bool get supported => true;
 
@@ -2529,27 +3004,27 @@
   
   @DomName('WebGLRenderingContext.createBuffer')
   @DocsEditable()
-  Buffer createBuffer() => _blink.BlinkWebGLRenderingContext.instance.createBuffer_Callback_0_(unwrap_jso(this));
+  Buffer createBuffer() => wrap_jso(_blink.BlinkWebGLRenderingContext.instance.createBuffer_Callback_0_(unwrap_jso(this)));
   
   @DomName('WebGLRenderingContext.createFramebuffer')
   @DocsEditable()
-  Framebuffer createFramebuffer() => _blink.BlinkWebGLRenderingContext.instance.createFramebuffer_Callback_0_(unwrap_jso(this));
+  Framebuffer createFramebuffer() => wrap_jso(_blink.BlinkWebGLRenderingContext.instance.createFramebuffer_Callback_0_(unwrap_jso(this)));
   
   @DomName('WebGLRenderingContext.createProgram')
   @DocsEditable()
-  Program createProgram() => _blink.BlinkWebGLRenderingContext.instance.createProgram_Callback_0_(unwrap_jso(this));
+  Program createProgram() => wrap_jso(_blink.BlinkWebGLRenderingContext.instance.createProgram_Callback_0_(unwrap_jso(this)));
   
   @DomName('WebGLRenderingContext.createRenderbuffer')
   @DocsEditable()
-  Renderbuffer createRenderbuffer() => _blink.BlinkWebGLRenderingContext.instance.createRenderbuffer_Callback_0_(unwrap_jso(this));
+  Renderbuffer createRenderbuffer() => wrap_jso(_blink.BlinkWebGLRenderingContext.instance.createRenderbuffer_Callback_0_(unwrap_jso(this)));
   
   @DomName('WebGLRenderingContext.createShader')
   @DocsEditable()
-  Shader createShader(int type) => _blink.BlinkWebGLRenderingContext.instance.createShader_Callback_1_(unwrap_jso(this), type);
+  Shader createShader(int type) => wrap_jso(_blink.BlinkWebGLRenderingContext.instance.createShader_Callback_1_(unwrap_jso(this), type));
   
   @DomName('WebGLRenderingContext.createTexture')
   @DocsEditable()
-  Texture createTexture() => _blink.BlinkWebGLRenderingContext.instance.createTexture_Callback_0_(unwrap_jso(this));
+  Texture createTexture() => wrap_jso(_blink.BlinkWebGLRenderingContext.instance.createTexture_Callback_0_(unwrap_jso(this)));
   
   @DomName('WebGLRenderingContext.cullFace')
   @DocsEditable()
@@ -2645,15 +3120,15 @@
   
   @DomName('WebGLRenderingContext.getActiveAttrib')
   @DocsEditable()
-  ActiveInfo getActiveAttrib(Program program, int index) => _blink.BlinkWebGLRenderingContext.instance.getActiveAttrib_Callback_2_(unwrap_jso(this), unwrap_jso(program), index);
+  ActiveInfo getActiveAttrib(Program program, int index) => wrap_jso(_blink.BlinkWebGLRenderingContext.instance.getActiveAttrib_Callback_2_(unwrap_jso(this), unwrap_jso(program), index));
   
   @DomName('WebGLRenderingContext.getActiveUniform')
   @DocsEditable()
-  ActiveInfo getActiveUniform(Program program, int index) => _blink.BlinkWebGLRenderingContext.instance.getActiveUniform_Callback_2_(unwrap_jso(this), unwrap_jso(program), index);
+  ActiveInfo getActiveUniform(Program program, int index) => wrap_jso(_blink.BlinkWebGLRenderingContext.instance.getActiveUniform_Callback_2_(unwrap_jso(this), unwrap_jso(program), index));
   
   @DomName('WebGLRenderingContext.getAttachedShaders')
   @DocsEditable()
-  List<Shader> getAttachedShaders(Program program) => _blink.BlinkWebGLRenderingContext.instance.getAttachedShaders_Callback_1_(unwrap_jso(this), unwrap_jso(program));
+  List<Shader> getAttachedShaders(Program program) => wrap_jso(_blink.BlinkWebGLRenderingContext.instance.getAttachedShaders_Callback_1_(unwrap_jso(this), unwrap_jso(program)));
   
   @DomName('WebGLRenderingContext.getAttribLocation')
   @DocsEditable()
@@ -2665,7 +3140,7 @@
   
   @DomName('WebGLRenderingContext.getContextAttributes')
   @DocsEditable()
-  ContextAttributes getContextAttributes() => _blink.BlinkWebGLRenderingContext.instance.getContextAttributes_Callback_0_(unwrap_jso(this));
+  ContextAttributes getContextAttributes() => wrap_jso(_blink.BlinkWebGLRenderingContext.instance.getContextAttributes_Callback_0_(unwrap_jso(this)));
   
   @DomName('WebGLRenderingContext.getError')
   @DocsEditable()
@@ -2705,7 +3180,7 @@
   
   @DomName('WebGLRenderingContext.getShaderPrecisionFormat')
   @DocsEditable()
-  ShaderPrecisionFormat getShaderPrecisionFormat(int shadertype, int precisiontype) => _blink.BlinkWebGLRenderingContext.instance.getShaderPrecisionFormat_Callback_2_(unwrap_jso(this), shadertype, precisiontype);
+  ShaderPrecisionFormat getShaderPrecisionFormat(int shadertype, int precisiontype) => wrap_jso(_blink.BlinkWebGLRenderingContext.instance.getShaderPrecisionFormat_Callback_2_(unwrap_jso(this), shadertype, precisiontype));
   
   @DomName('WebGLRenderingContext.getShaderSource')
   @DocsEditable()
@@ -2725,7 +3200,7 @@
   
   @DomName('WebGLRenderingContext.getUniformLocation')
   @DocsEditable()
-  UniformLocation getUniformLocation(Program program, String name) => _blink.BlinkWebGLRenderingContext.instance.getUniformLocation_Callback_2_(unwrap_jso(this), unwrap_jso(program), name);
+  UniformLocation getUniformLocation(Program program, String name) => wrap_jso(_blink.BlinkWebGLRenderingContext.instance.getUniformLocation_Callback_2_(unwrap_jso(this), unwrap_jso(program), name));
   
   @DomName('WebGLRenderingContext.getVertexAttrib')
   @DocsEditable()
@@ -3113,10 +3588,25 @@
 
 @DocsEditable()
 @DomName('WebGLShader')
-class Shader extends NativeFieldWrapperClass2 {
+class Shader extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory Shader._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static Shader internalCreateShader() {
+    return new Shader._internalWrap();
+  }
+
+  factory Shader._internalWrap() {
+    return new Shader.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  Shader.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -3127,10 +3617,25 @@
 
 @DocsEditable()
 @DomName('WebGLShaderPrecisionFormat')
-class ShaderPrecisionFormat extends NativeFieldWrapperClass2 {
+class ShaderPrecisionFormat extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory ShaderPrecisionFormat._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static ShaderPrecisionFormat internalCreateShaderPrecisionFormat() {
+    return new ShaderPrecisionFormat._internalWrap();
+  }
+
+  factory ShaderPrecisionFormat._internalWrap() {
+    return new ShaderPrecisionFormat.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  ShaderPrecisionFormat.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('WebGLShaderPrecisionFormat.precision')
   @DocsEditable()
   int get precision => _blink.BlinkWebGLShaderPrecisionFormat.instance.precision_Getter_(unwrap_jso(this));
@@ -3153,10 +3658,25 @@
 
 @DocsEditable()
 @DomName('WebGLTexture')
-class Texture extends NativeFieldWrapperClass2 {
+class Texture extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory Texture._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static Texture internalCreateTexture() {
+    return new Texture._internalWrap();
+  }
+
+  factory Texture._internalWrap() {
+    return new Texture.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  Texture.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -3167,10 +3687,25 @@
 
 @DocsEditable()
 @DomName('WebGLUniformLocation')
-class UniformLocation extends NativeFieldWrapperClass2 {
+class UniformLocation extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory UniformLocation._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static UniformLocation internalCreateUniformLocation() {
+    return new UniformLocation._internalWrap();
+  }
+
+  factory UniformLocation._internalWrap() {
+    return new UniformLocation.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  UniformLocation.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -3183,10 +3718,25 @@
 @DomName('WebGLVertexArrayObjectOES')
 // http://www.khronos.org/registry/webgl/extensions/OES_vertex_array_object/
 @Experimental() // experimental
-class VertexArrayObject extends NativeFieldWrapperClass2 {
+class VertexArrayObject extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory VertexArrayObject._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static VertexArrayObject internalCreateVertexArrayObject() {
+    return new VertexArrayObject._internalWrap();
+  }
+
+  factory VertexArrayObject._internalWrap() {
+    return new VertexArrayObject.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  VertexArrayObject.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -3198,7 +3748,7 @@
 @DocsEditable()
 @DomName('WebGLRenderingContextBase')
 @Experimental() // untriaged
-abstract class _WebGLRenderingContextBase extends NativeFieldWrapperClass2 {
+class _WebGLRenderingContextBase extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory _WebGLRenderingContextBase._() { throw new UnsupportedError("Not supported"); }
 
diff --git a/sdk/lib/web_sql/dart2js/web_sql_dart2js.dart b/sdk/lib/web_sql/dart2js/web_sql_dart2js.dart
index d19fa39..34838d5 100644
--- a/sdk/lib/web_sql/dart2js/web_sql_dart2js.dart
+++ b/sdk/lib/web_sql/dart2js/web_sql_dart2js.dart
@@ -12,7 +12,7 @@
 
 import 'dart:async';
 import 'dart:collection';
-import 'dart:_internal' hide deprecated;
+import 'dart:_internal';
 import 'dart:html';
 import 'dart:html_common';
 import 'dart:_js_helper' show convertDartClosureToJS, Creates, JSName, Native;
@@ -228,7 +228,7 @@
   // Map is the element type.
 
 
-  void set length(int value) {
+  set length(int value) {
     throw new UnsupportedError("Cannot resize immutable List.");
   }
 
diff --git a/sdk/lib/web_sql/dartium/web_sql_dartium.dart b/sdk/lib/web_sql/dartium/web_sql_dartium.dart
index 540f88d..c7e6c93 100644
--- a/sdk/lib/web_sql/dartium/web_sql_dartium.dart
+++ b/sdk/lib/web_sql/dartium/web_sql_dartium.dart
@@ -12,11 +12,13 @@
 
 import 'dart:async';
 import 'dart:collection';
-import 'dart:_internal' hide deprecated;
+import 'dart:_internal';
 import 'dart:html';
 import 'dart:html_common';
 import 'dart:nativewrappers';
 import 'dart:_blink' as _blink;
+import 'dart:js' as js;
+
 // DO NOT EDIT - unless you are editing documentation as per:
 // https://code.google.com/p/dart/wiki/ContributingHTMLDocumentation
 // Auto-generated dart:audio library.
@@ -25,6 +27,7 @@
 
 
 // FIXME: Can we make this private?
+@Deprecated("Internal Use Only")
 final web_sqlBlinkMap = {
   'Database': () => SqlDatabase,
   'SQLError': () => SqlError,
@@ -34,6 +37,16 @@
 
 };
 
+// FIXME: Can we make this private?
+@Deprecated("Internal Use Only")
+final web_sqlBlinkFunctionMap = {
+  'Database': () => SqlDatabase.internalCreateSqlDatabase,
+  'SQLError': () => SqlError.internalCreateSqlError,
+  'SQLResultSet': () => SqlResultSet.internalCreateSqlResultSet,
+  'SQLResultSetRowList': () => SqlResultSetRowList.internalCreateSqlResultSetRowList,
+  'SQLTransaction': () => SqlTransaction.internalCreateSqlTransaction,
+
+};
 // Copyright (c) 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.
@@ -92,10 +105,25 @@
 @Experimental()
 // http://www.w3.org/TR/webdatabase/#asynchronous-database-api
 @Experimental() // deprecated
-class SqlDatabase extends NativeFieldWrapperClass2 {
+class SqlDatabase extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory SqlDatabase._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static SqlDatabase internalCreateSqlDatabase() {
+    return new SqlDatabase._internalWrap();
+  }
+
+  factory SqlDatabase._internalWrap() {
+    return new SqlDatabase.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  SqlDatabase.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   /// Checks if this type is supported on the current platform.
   static bool get supported => true;
 
@@ -105,15 +133,15 @@
   
   void changeVersion(String oldVersion, String newVersion, [SqlTransactionCallback callback, SqlTransactionErrorCallback errorCallback, VoidCallback successCallback]) {
     if (successCallback != null) {
-      _blink.BlinkDatabase.instance.changeVersion_Callback_5_(unwrap_jso(this), oldVersion, newVersion, unwrap_jso(callback), unwrap_jso(errorCallback), unwrap_jso(successCallback));
+      _blink.BlinkDatabase.instance.changeVersion_Callback_5_(unwrap_jso(this), oldVersion, newVersion, unwrap_jso((transaction) => callback(wrap_jso(transaction))), unwrap_jso((error) => errorCallback(wrap_jso(error))), unwrap_jso(() => successCallback()));
       return;
     }
     if (errorCallback != null) {
-      _blink.BlinkDatabase.instance.changeVersion_Callback_4_(unwrap_jso(this), oldVersion, newVersion, unwrap_jso(callback), unwrap_jso(errorCallback));
+      _blink.BlinkDatabase.instance.changeVersion_Callback_4_(unwrap_jso(this), oldVersion, newVersion, unwrap_jso((transaction) => callback(wrap_jso(transaction))), unwrap_jso((error) => errorCallback(wrap_jso(error))));
       return;
     }
     if (callback != null) {
-      _blink.BlinkDatabase.instance.changeVersion_Callback_3_(unwrap_jso(this), oldVersion, newVersion, unwrap_jso(callback));
+      _blink.BlinkDatabase.instance.changeVersion_Callback_3_(unwrap_jso(this), oldVersion, newVersion, unwrap_jso((transaction) => callback(wrap_jso(transaction))));
       return;
     }
     _blink.BlinkDatabase.instance.changeVersion_Callback_2_(unwrap_jso(this), oldVersion, newVersion);
@@ -122,27 +150,27 @@
 
   void readTransaction(SqlTransactionCallback callback, [SqlTransactionErrorCallback errorCallback, VoidCallback successCallback]) {
     if (successCallback != null) {
-      _blink.BlinkDatabase.instance.readTransaction_Callback_3_(unwrap_jso(this), unwrap_jso(callback), unwrap_jso(errorCallback), unwrap_jso(successCallback));
+      _blink.BlinkDatabase.instance.readTransaction_Callback_3_(unwrap_jso(this), unwrap_jso((transaction) => callback(wrap_jso(transaction))), unwrap_jso((error) => errorCallback(wrap_jso(error))), unwrap_jso(() => successCallback()));
       return;
     }
     if (errorCallback != null) {
-      _blink.BlinkDatabase.instance.readTransaction_Callback_2_(unwrap_jso(this), unwrap_jso(callback), unwrap_jso(errorCallback));
+      _blink.BlinkDatabase.instance.readTransaction_Callback_2_(unwrap_jso(this), unwrap_jso((transaction) => callback(wrap_jso(transaction))), unwrap_jso((error) => errorCallback(wrap_jso(error))));
       return;
     }
-    _blink.BlinkDatabase.instance.readTransaction_Callback_1_(unwrap_jso(this), unwrap_jso(callback));
+    _blink.BlinkDatabase.instance.readTransaction_Callback_1_(unwrap_jso(this), unwrap_jso((transaction) => callback(wrap_jso(transaction))));
     return;
   }
 
   void transaction(SqlTransactionCallback callback, [SqlTransactionErrorCallback errorCallback, VoidCallback successCallback]) {
     if (successCallback != null) {
-      _blink.BlinkDatabase.instance.transaction_Callback_3_(unwrap_jso(this), unwrap_jso(callback), unwrap_jso(errorCallback), unwrap_jso(successCallback));
+      _blink.BlinkDatabase.instance.transaction_Callback_3_(unwrap_jso(this), unwrap_jso((transaction) => callback(wrap_jso(transaction))), unwrap_jso((error) => errorCallback(wrap_jso(error))), unwrap_jso(() => successCallback()));
       return;
     }
     if (errorCallback != null) {
-      _blink.BlinkDatabase.instance.transaction_Callback_2_(unwrap_jso(this), unwrap_jso(callback), unwrap_jso(errorCallback));
+      _blink.BlinkDatabase.instance.transaction_Callback_2_(unwrap_jso(this), unwrap_jso((transaction) => callback(wrap_jso(transaction))), unwrap_jso((error) => errorCallback(wrap_jso(error))));
       return;
     }
-    _blink.BlinkDatabase.instance.transaction_Callback_1_(unwrap_jso(this), unwrap_jso(callback));
+    _blink.BlinkDatabase.instance.transaction_Callback_1_(unwrap_jso(this), unwrap_jso((transaction) => callback(wrap_jso(transaction))));
     return;
   }
 
@@ -158,10 +186,25 @@
 @DomName('SQLError')
 // http://www.w3.org/TR/webdatabase/#sqlerror
 @Experimental() // deprecated
-class SqlError extends NativeFieldWrapperClass2 {
+class SqlError extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory SqlError._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static SqlError internalCreateSqlError() {
+    return new SqlError._internalWrap();
+  }
+
+  factory SqlError._internalWrap() {
+    return new SqlError.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  SqlError.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('SQLError.CONSTRAINT_ERR')
   @DocsEditable()
   static const int CONSTRAINT_ERR = 6;
@@ -214,10 +257,25 @@
 @DomName('SQLResultSet')
 // http://www.w3.org/TR/webdatabase/#sqlresultset
 @Experimental() // deprecated
-class SqlResultSet extends NativeFieldWrapperClass2 {
+class SqlResultSet extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory SqlResultSet._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static SqlResultSet internalCreateSqlResultSet() {
+    return new SqlResultSet._internalWrap();
+  }
+
+  factory SqlResultSet._internalWrap() {
+    return new SqlResultSet.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  SqlResultSet.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('SQLResultSet.insertId')
   @DocsEditable()
   int get insertId => _blink.BlinkSQLResultSet.instance.insertId_Getter_(unwrap_jso(this));
@@ -242,10 +300,25 @@
 @DomName('SQLResultSetRowList')
 // http://www.w3.org/TR/webdatabase/#sqlresultsetrowlist
 @Experimental() // deprecated
-class SqlResultSetRowList extends NativeFieldWrapperClass2 with ListMixin<Map>, ImmutableListMixin<Map> implements List<Map> {
+class SqlResultSetRowList extends DartHtmlDomObject with ListMixin<Map>, ImmutableListMixin<Map> implements List<Map> {
   // To suppress missing implicit constructor warnings.
   factory SqlResultSetRowList._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static SqlResultSetRowList internalCreateSqlResultSetRowList() {
+    return new SqlResultSetRowList._internalWrap();
+  }
+
+  factory SqlResultSetRowList._internalWrap() {
+    return new SqlResultSetRowList.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  SqlResultSetRowList.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('SQLResultSetRowList.length')
   @DocsEditable()
   int get length => _blink.BlinkSQLResultSetRowList.instance.length_Getter_(unwrap_jso(this));
@@ -253,11 +326,11 @@
   Map operator[](int index) {
     if (index < 0 || index >= length)
       throw new RangeError.index(index, this);
-    return _blink.BlinkSQLResultSetRowList.instance.item_Callback_1_(unwrap_jso(this), index);
+    return wrap_jso(_blink.BlinkSQLResultSetRowList.instance.item_Callback_1_(unwrap_jso(this), index));
   }
 
-  Map _nativeIndexedGetter(int index) => _blink.BlinkSQLResultSetRowList.instance.item_Callback_1_(unwrap_jso(this), index);
- 
+  Map _nativeIndexedGetter(int index) => wrap_jso(_blink.BlinkSQLResultSetRowList.instance.item_Callback_1_(unwrap_jso(this), index));
+
   void operator[]=(int index, Map value) {
     throw new UnsupportedError("Cannot assign element of immutable List.");
   }
@@ -265,7 +338,7 @@
   // Map is the element type.
 
 
-  void set length(int value) {
+  set length(int value) {
     throw new UnsupportedError("Cannot resize immutable List.");
   }
 
@@ -298,7 +371,7 @@
 
   @DomName('SQLResultSetRowList.item')
   @DocsEditable()
-  Map item(int index) => _blink.BlinkSQLResultSetRowList.instance.item_Callback_1_(unwrap_jso(this), index);
+  Map item(int index) => wrap_jso(_blink.BlinkSQLResultSetRowList.instance.item_Callback_1_(unwrap_jso(this), index));
   
 }
 // Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
@@ -315,12 +388,27 @@
 @Experimental()
 // http://www.w3.org/TR/webdatabase/#sqltransaction
 @deprecated // deprecated
-class SqlTransaction extends NativeFieldWrapperClass2 {
+class SqlTransaction extends DartHtmlDomObject {
   // To suppress missing implicit constructor warnings.
   factory SqlTransaction._() { throw new UnsupportedError("Not supported"); }
 
+  @Deprecated("Internal Use Only")
+  static SqlTransaction internalCreateSqlTransaction() {
+    return new SqlTransaction._internalWrap();
+  }
+
+  factory SqlTransaction._internalWrap() {
+    return new SqlTransaction.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  SqlTransaction.internal_() { }
+
+  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);
+  int get hashCode => unwrap_jso(this).hashCode;
+
   @DomName('SQLTransaction.executeSql')
   @DocsEditable()
-  void executeSql(String sqlStatement, List<Object> arguments, [SqlStatementCallback callback, SqlStatementErrorCallback errorCallback]) => _blink.BlinkSQLTransaction.instance.executeSql_Callback_4_(unwrap_jso(this), sqlStatement, arguments, unwrap_jso(callback), unwrap_jso(errorCallback));
+  void executeSql(String sqlStatement, List<Object> arguments, [SqlStatementCallback callback, SqlStatementErrorCallback errorCallback]) => _blink.BlinkSQLTransaction.instance.executeSql_Callback_4_(unwrap_jso(this), sqlStatement, unwrap_jso(arguments), unwrap_jso((transaction, resultSet) => callback(wrap_jso(transaction), wrap_jso(resultSet))), unwrap_jso((transaction, error) => errorCallback(wrap_jso(transaction), wrap_jso(error))));
   
 }
diff --git a/site/try/poi/poi.dart b/site/try/poi/poi.dart
index e86bfc5..b9f7753 100644
--- a/site/try/poi/poi.dart
+++ b/site/try/poi/poi.dart
@@ -26,11 +26,13 @@
 
 import 'package:compiler/compiler.dart' as api;
 
-import 'package:compiler/src/dart2jslib.dart' show
-    Compiler,
-    CompilerTask,
-    Enqueuer,
-    QueueFilter,
+import 'package:compiler/src/compiler.dart' show
+    Compiler;
+
+import 'package:compiler/src/common/tasks.dart' show
+    CompilerTask;
+
+import 'package:compiler/src/common/work.dart' show
     WorkItem;
 
 import 'package:compiler/src/elements/visitor.dart' show
@@ -51,16 +53,24 @@
 import 'package:compiler/src/elements/modelx.dart' show
     DeclarationSite;
 
+import 'package:compiler/src/enqueue.dart' show
+    Enqueuer,
+    QueueFilter;
+
 import 'package:compiler/src/dart_types.dart' show
     DartType;
 
-import 'package:compiler/src/scanner/scannerlib.dart' show
+import 'package:compiler/src/parser/partial_elements.dart' show
+    PartialClassElement,
+    PartialElement;
+
+import 'package:compiler/src/tokens/token.dart' show
+    Token;
+
+import 'package:compiler/src/tokens/token_constants.dart' show
     EOF_TOKEN,
     IDENTIFIER_TOKEN,
-    KEYWORD_TOKEN,
-    PartialClassElement,
-    PartialElement,
-    Token;
+    KEYWORD_TOKEN;
 
 import 'package:compiler/src/js/js.dart' show
     js;
diff --git a/site/try/poi/scope_information_visitor.dart b/site/try/poi/scope_information_visitor.dart
index fa4572d..5f1b5a1 100644
--- a/site/try/poi/scope_information_visitor.dart
+++ b/site/try/poi/scope_information_visitor.dart
@@ -13,7 +13,7 @@
 import 'package:compiler/src/elements/visitor.dart' show
     BaseElementVisitor;
 
-import 'package:compiler/src/dart2jslib.dart' show
+import 'package:compiler/src/compiler.dart' show
     Compiler;
 
 import 'package:compiler/src/elements/elements.dart' show
@@ -74,7 +74,7 @@
         // TODO(ahe): We omit the import scope if there is no current
         // class. That's wrong.
         omitEnclosing: ignoreImports || currentClass == null,
-        name: e.getLibraryName(),
+        name: e.libraryName,
         serializeEnclosing: () {
           // The enclosing scope of a library is a scope which contains all the
           // imported names.
@@ -120,7 +120,7 @@
       {bool isStatic: false,
        bool omitEnclosing: false,
        bool includeSuper: false}) {
-    e.ensureResolved(compiler);
+    e.ensureResolved(compiler.resolution);
     bool isFirst = true;
     var serializeEnclosing;
     String kind;
@@ -231,7 +231,7 @@
     if (category == ElementCategory.FUNCTION ||
         category == ElementCategory.VARIABLE ||
         element.isConstructor) {
-      type = element.computeType(compiler);
+      type = element.computeType(compiler.resolution);
     }
     if (name == null) {
       name = element.name;
diff --git a/site/try/src/compiler_isolate.dart b/site/try/src/compiler_isolate.dart
index 810de41..ea82650 100644
--- a/site/try/src/compiler_isolate.dart
+++ b/site/try/src/compiler_isolate.dart
@@ -19,7 +19,7 @@
 import 'package:dart2js_incremental/dart2js_incremental.dart' show
     reuseCompiler, OutputProvider;
 
-import 'package:compiler/src/dart2jslib.dart' show
+import 'package:compiler/src/compiler.dart' show
     Compiler;
 
 const bool THROW_ON_ERROR = false;
diff --git a/site/try/src/editor.dart b/site/try/src/editor.dart
index 1345404..abe3f3c 100644
--- a/site/try/src/editor.dart
+++ b/site/try/src/editor.dart
@@ -6,12 +6,16 @@
 
 import 'dart:html';
 
-import 'package:compiler/src/scanner/scannerlib.dart' show
-    EOF_TOKEN,
+import 'package:compiler/src/scanner/string_scanner.dart' show
+    StringScanner;
+
+import 'package:compiler/src/tokens/token.dart' show
     ErrorToken,
-    StringScanner,
     Token;
 
+import 'package:compiler/src/tokens/token_constants.dart' show
+    EOF_TOKEN;
+
 import 'ui.dart' show
     currentTheme,
     hackDiv,
diff --git a/site/try/src/interaction_manager.dart b/site/try/src/interaction_manager.dart
index 2c566e3..89ddf76 100644
--- a/site/try/src/interaction_manager.dart
+++ b/site/try/src/interaction_manager.dart
@@ -21,18 +21,22 @@
 import 'dart:collection' show
     Queue;
 
-import 'package:compiler/src/scanner/scannerlib.dart' show
+import 'package:compiler/src/scanner/string_scanner.dart' show
+    StringScanner;
+
+import 'package:compiler/src/tokens/token.dart' show
     BeginGroupToken,
-    EOF_TOKEN,
     ErrorToken,
-    STRING_INTERPOLATION_IDENTIFIER_TOKEN,
-    STRING_INTERPOLATION_TOKEN,
-    STRING_TOKEN,
-    StringScanner,
     Token,
     UnmatchedToken,
     UnterminatedToken;
 
+import 'package:compiler/src/tokens/token_constants.dart' show
+    EOF_TOKEN,
+    STRING_INTERPOLATION_IDENTIFIER_TOKEN,
+    STRING_INTERPOLATION_TOKEN,
+    STRING_TOKEN;
+
 import 'package:compiler/src/io/source_file.dart' show
     StringSourceFile;
 
diff --git a/site/try/src/leap.dart b/site/try/src/leap.dart
index 626048f..3688bed 100644
--- a/site/try/src/leap.dart
+++ b/site/try/src/leap.dart
@@ -16,7 +16,6 @@
     SendPort;
 
 import 'compilation.dart' show
-    compilerIsolate,
     compilerPort,
     currentSource;
 
diff --git a/tests/co19/co19-analyzer.status b/tests/co19/co19-analyzer.status
index ed616b4..c11877e 100644
--- a/tests/co19/co19-analyzer.status
+++ b/tests/co19/co19-analyzer.status
@@ -291,3 +291,4 @@
 WebPlatformTest/html/semantics/forms/the-input-element/email_t02: StaticWarning # co19 issue 701
 Language/12_Expressions/12_Instance_Creation/2_Const_A11_t01: MissingCompileTimeError # Issue 22010
 Language/12_Expressions/12_Instance_Creation/2_Const_A11_t03: MissingCompileTimeError # Issue 22010
+
diff --git a/tests/co19/co19-analyzer2.status b/tests/co19/co19-analyzer2.status
index 6790464..aa341d6 100644
--- a/tests/co19/co19-analyzer2.status
+++ b/tests/co19/co19-analyzer2.status
@@ -12,6 +12,10 @@
 # TBF: Static members should not be accessible via subclasses.
 Language/07_Classes/9_Superclasses/1_Inheritance_and_Overriding_A01_t05: MissingStaticWarning
 
+# TBF: noSuchMethod can now be inherited
+Language/07_Classes/4_Abstract_Instance_Members_A02_t03: fail, OK
+Language/07_Classes/4_Abstract_Instance_Members_A02_t04: fail, OK
+
 # co19 issue #442, undefined name "Expect"
 Language/15_Types/4_Interface_Types_A08_t03: fail, OK
 
@@ -290,3 +294,26 @@
 Language/13_Statements/15_Assert_A04_t07: StaticWarning # Issue 23663
 Language/13_Statements/15_Assert_A03_t08: StaticWarning # Issue 23663
 
+# isProtocolHandlerRegistered and unregisterProtocolHandler don't exist
+LayoutTests/fast/dom/navigatorcontentutils/is-protocol-handler-registered_t01: Skip
+WebPlatformTest/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/t01: StaticWarning
+WebPlatformTest/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/t02: StaticWarning
+WebPlatformTest/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/t03: StaticWarning
+WebPlatformTest/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/t04: StaticWarning
+WebPlatformTest/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/t05: StaticWarning
+WebPlatformTest/html/webappapis/system-state-and-capabilities/the-navigator-object/protocol/t06: StaticWarning
+LayoutTests/fast/dom/navigatorcontentutils/unregister-protocol-handler_t01: StaticWarning
+
+# Missing concrete implementation of setter 'XPathNSResolver.blink_jsObject' and getter 'XPathNSResolver.blink_jsObject'
+# TODO(terry): Dartium only because of implements instead of extends consider fixing by making blink_jsObject private
+#              with private wrap_jso and unwrap_jso in each library that delegates to the public wrap/unwrap_jso.
+LayoutTests/fast/xpath/4XPath/Core/test_core_functions_t02: StaticWarning
+LayoutTests/fast/xpath/4XPath/Core/test_node_test_t01: StaticWarning
+LayoutTests/fast/xpath/4XPath/Core/test_node_test_t02: StaticWarning
+LayoutTests/fast/xpath/attr-namespace_t01: StaticWarning
+LayoutTests/fast/xpath/attr-namespace_t02: StaticWarning
+LayoutTests/fast/xpath/node-name-case-sensitivity_t01: StaticWarning
+LayoutTests/fast/xpath/node-name-case-sensitivity_t02: StaticWarning
+LayoutTests/fast/xpath/py-dom-xpath/data_t01: StaticWarning
+LayoutTests/fast/svg/getbbox_t01: StaticWarning
+
diff --git a/tests/co19/co19-co19.status b/tests/co19/co19-co19.status
index 2e60ccc..c28d8d8 100644
--- a/tests/co19/co19-co19.status
+++ b/tests/co19/co19-co19.status
@@ -4,7 +4,8 @@
 
 # This file contains the tests that have been identified as broken and
 # have been filed on the co19 issue tracker at
-#    https://code.google.com/p/co19/issues/list .
+#    https://code.google.com/p/co19/issues/list (read-only).
+#    https://github.com/dart-lang/co19/issues .
 #
 # In order to qualify here these tests need to fail both on the VM and dart2js.
 
@@ -13,6 +14,10 @@
 [ $runtime == vm || $runtime != vm ]
 # Tests that fail everywhere, including the analyzer.
 
+# Super is now allowed in mixins and mixins may now extend a subclass of Object.
+Language/09_Mixins/09_Mixins_A01_t01: Skip # co19 issue 9.
+Language/09_Mixins/09_Mixins_A03_t01: Skip # co19 issue 9.
+
 # No longer correct, y#$ now has a meaning. github.com/dart-lang/co19/issues/2
 Language/12_Expressions/30_Identifier_Reference_A01_t03: Skip
 
diff --git a/tests/co19/co19-dart2js.status b/tests/co19/co19-dart2js.status
index 3434fcf..ee0adbe 100644
--- a/tests/co19/co19-dart2js.status
+++ b/tests/co19/co19-dart2js.status
@@ -3,8 +3,9 @@
 # BSD-style license that can be found in the LICENSE file.
 
 [ $compiler == dart2js ]
-Language/03_Overview/1_Scoping_A02_t05: CompileTimeError # Issue 21072
-Language/03_Overview/1_Scoping_A02_t06: CompileTimeError # Issue 21072
+Language/12_Expressions/00_Object_Identity/1_Object_Identity_A05_t02: RuntimeError # Issue 1533 (int/double related)
+Language/03_Overview/1_Scoping_A02_t05: RuntimeError # co19 issue 3
+Language/03_Overview/1_Scoping_A02_t06: RuntimeError # co19 issue 3
 Language/03_Overview/1_Scoping_A02_t28: fail # Issue 21092 and co19 issue 713
 Language/05_Variables/05_Variables_A05_t01: fail # Issue 21093
 Language/05_Variables/05_Variables_A05_t02: fail # Issue 21093
@@ -25,9 +26,6 @@
 Language/07_Classes/6_Constructors/1_Generative_Constructors_A13_t01: RuntimeError # compiler cancelled: cannot resolve type T
 Language/07_Classes/6_Constructors/1_Generative_Constructors_A13_t01: RuntimeError, OK # co19 issue 258
 Language/07_Classes/6_Constructors/1_Generative_Constructors_A20_t02: fail # Issue 13363
-Language/07_Classes/6_Constructors/2_Factories_A08_t02: fail # Issue 21202
-Language/07_Classes/6_Constructors/2_Factories_A10_t02: fail # Issue 21202
-Language/07_Classes/6_Constructors/2_Factories_A10_t03: fail # Issue 21202
 Language/10_Generics/09_Generics_A01_t17: fail # Issue 21203
 Language/12_Expressions/00_Object_Identity/1_Object_Identity_A02_t02: fail # Issue 11551, also related to issue 563, 18738
 Language/12_Expressions/00_Object_Identity/1_Object_Identity_A06_t01: fail # Issue 11551, also related to issue 563, 18738
@@ -35,11 +33,6 @@
 Language/12_Expressions/03_Numbers_A01_t06: fail # Issue 21098
 Language/12_Expressions/03_Numbers_A01_t09: fail # Issue 21098
 Language/12_Expressions/07_Maps_A11_t01: CompileTimeError # Maybe ok. Issue 17207
-Language/12_Expressions/12_Instance_Creation/1_New_A02_t03: fail # Issue 21092 and co19 issue 713
-Language/12_Expressions/12_Instance_Creation/1_New_A02_t05: fail # Issue 21092 and co19 issue 713
-Language/12_Expressions/12_Instance_Creation/1_New_A02_t06: fail # Issue 21092 and co19 issue 713
-Language/12_Expressions/12_Instance_Creation/1_New_A02_t07: fail # Issue 21092 and co19 issue 713
-Language/12_Expressions/12_Instance_Creation/1_New_A06_t15: CompileTimeError # Issue 21092
 Language/12_Expressions/12_Instance_Creation/2_Const_A11_t01: fail # Issue 21134 and co19 issue 714
 Language/12_Expressions/12_Instance_Creation/2_Const_A11_t03: fail # Issue 21134 and co19 issue 714
 Language/12_Expressions/30_Identifier_Reference_A02_t01: fail # Issue 21154
@@ -205,8 +198,8 @@
 LibTest/typed_data/Uint8List/Uint8List_A02_t01: fail # co19-roll r576: Please triage this failure
 Utils/tests/Expect/identical_A01_t01: fail # co19-roll r546: Please triage this failure
 WebPlatformTest/Utils/test/testFail_t01: RuntimeError # co19-roll r722: Please triage this failure.
-WebPlatformTest/dom/nodes/DOMImplementation-createHTMLDocument_t01: CompileTimeError # co19-roll r722: Please triage this failure.
 WebPlatformTest/dom/nodes/Document-createElement_t01: CompileTimeError # co19-roll r722: Please triage this failure.
+WebPlatformTest/dom/nodes/DOMImplementation-createHTMLDocument_t01: CompileTimeError # co19-roll r722: Please triage this failure.
 WebPlatformTest/dom/nodes/Element-childElementCount-nochild_t01: CompileTimeError # co19-roll r722: Please triage this failure.
 WebPlatformTest/webstorage/storage_session_setitem_quotaexceedederr_t01: Pass, Slow
 LayoutTests/fast/loader/loadInProgress_t01: Skip # Issue 23466
@@ -240,7 +233,6 @@
 LibTest/core/List/List_class_A01_t01: Pass, Timeout
 
 [ $compiler == dart2js && $runtime == jsshell ]
-Language/12_Expressions/00_Object_Identity/1_Object_Identity_A05_t02: RuntimeError # Issue 21198 (int/double related)
 LibTest/async/Future/Future.delayed_A01_t01: RuntimeError # Issue 7728, timer not supported in jsshell
 LibTest/async/Future/Future.delayed_A03_t01: fail # Issue 7728, timer not supported in jsshell
 LibTest/async/Future/wait_A01_t07: RuntimeError # Issue 7728, timer not supported in jsshell
@@ -321,7 +313,6 @@
 
 [ $compiler == dart2js && $runtime == d8 ]
 LibTest/typed_data/Float32x4List/Float32x4List.view_A06_t01: fail # co19-roll r587: Please triage this failure
-Language/12_Expressions/00_Object_Identity/1_Object_Identity_A05_t02: RuntimeError # Issue 21198 (int/double related)
 LibTest/typed_data/Int32x4/operator_OR_A01_t01: RuntimeError # Issue 7728, timer not supported in jsshell
 
 [ $compiler == dart2js && $runtime == d8 && $system == windows ]
@@ -382,7 +373,6 @@
 LayoutTests/fast/multicol/orphans-relayout_t01: Pass, RuntimeError
 LayoutTests/fast/multicol/zeroColumnCount_t01: RuntimeError
 LayoutTests/fast/media/media-query-serialization_t01: RuntimeError
-LayoutTests/fast/media/color-does-not-include-alpha_t01: RuntimeError
 LayoutTests/fast/media/mq-append-delete_t01: RuntimeError
 LayoutTests/fast/media/mq-color-index_t02: RuntimeError
 LayoutTests/fast/media/mq-js-media-except_t02: RuntimeError
@@ -528,7 +518,6 @@
 #
 
 [ $compiler == dart2js && $runtime == chromeOnAndroid ]
-Language/12_Expressions/00_Object_Identity/1_Object_Identity_A05_t02: RuntimeError # Please triage this failure.
 Language/12_Expressions/05_Strings_A06_t01: Pass, Slow # 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.
@@ -558,7 +547,6 @@
 LibTest/typed_data/Uint8ClampedList/map_A02_t01: Pass, Slow # Please triage this failure.
 
 [ $compiler == dart2js && $runtime == chrome ]
-Language/12_Expressions/00_Object_Identity/1_Object_Identity_A05_t02: RuntimeError # 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
@@ -579,7 +567,7 @@
 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
 LayoutTests/fast/canvas/canvas-blending-text_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/canvas/canvas-currentTransform_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-currentTransform_t01: RuntimeError # Feature is behind a flag.
 LayoutTests/fast/canvas/canvas-empty-image-pattern_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/canvas-getImageData-invalid_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/canvas-getImageData-large-crash_t01: RuntimeError # Please triage this failure
@@ -687,6 +675,7 @@
 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-position-serialize_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/checked-pseudo-selector_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/collapsed-whitespace-reattach-in-style-recalc_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/content-language-case-insensitivity_t01: RuntimeError # Issue 23506
@@ -713,10 +702,13 @@
 LayoutTests/fast/css/font-face-unicode-range-load_t01: Pass, RuntimeError # Please triage this failure
 LayoutTests/fast/css/font-face-unicode-range-monospace_t01: Pass, RuntimeError # Please triage this failure
 LayoutTests/fast/css/font-face-unicode-range-overlap-load_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/css/font-shorthand-from-longhands_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/fontfaceset-events_t01: Pass, RuntimeError # Please triage this failure
 LayoutTests/fast/css/fontfaceset-loadingdone_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/css/getComputedStyle/computed-style-font_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/getComputedStyle/computed-style-properties_t01: RuntimeError # Issue 23506
 LayoutTests/fast/css/getComputedStyle/counterIncrement-without-counter_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/getPropertyValue-columns_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
 LayoutTests/fast/css/image-set-setting_t01: RuntimeError # Please triage this failure
@@ -732,8 +724,10 @@
 LayoutTests/fast/css/media-query-recovery_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/modify-ua-rules-from-javascript_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/nested-at-rules_t01: RuntimeError # Issue 23506
+LayoutTests/fast/css/parse-color-int-or-percent-crash_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/parsing-at-rule-recovery_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/parsing-css-allowed-string-characters_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/parsing-css-nonascii_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/parsing-css-nth-child_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/parsing-page-rule_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/parsing-selector-error-recovery_t01: RuntimeError # Please triage this failure
@@ -747,6 +741,7 @@
 LayoutTests/fast/css/readonly-pseudoclass-opera-003_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/readonly-pseudoclass-opera-004_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/readonly-pseudoclass-opera-005_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/css/selector-text-escape_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/shadow-current-color_t01: Skip # Times out. Please triage this failure
 LayoutTests/fast/css/sticky/parsing-position-sticky_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/string-quote-binary_t01: RuntimeError # Please triage this failure
@@ -789,7 +784,6 @@
 LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-protocol_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-search_t01: Pass, RuntimeError # Please triage this failure
 LayoutTests/fast/dom/HTMLDialogElement/dialog-autofocus_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/dom/HTMLDialogElement/dialog-return-value_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/HTMLDialogElement/dialog-scrolled-viewport_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/HTMLDialogElement/inert-node-is-unfocusable_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/HTMLDialogElement/inert-node-is-unselectable_t01: RuntimeError # Please triage this failure
@@ -815,6 +809,7 @@
 LayoutTests/fast/dom/HTMLScriptElement/defer-inline-script_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/HTMLScriptElement/defer-onbeforeload_t01: RuntimeError # 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/HTMLScriptElement/script-set-src_t01: Pass, RuntimeError # Please triage this failure
 LayoutTests/fast/dom/HTMLSelectElement/selected-index-preserved-when-option-text-changes_t01: RuntimeError # Issue 18127
 LayoutTests/fast/dom/HTMLTemplateElement/custom-element-wrapper-gc_t01: RuntimeError # Please triage this failure
@@ -835,11 +830,11 @@
 LayoutTests/fast/dom/Range/range-insertNode-separate-endContainer_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/Range/range-insertNode-splittext_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/SelectorAPI/dumpNodeList-2_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/dom/SelectorAPI/dumpNodeList-almost-strict_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/SelectorAPI/dumpNodeList_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/StyleSheet/css-medialist-item_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/TreeWalker/TreeWalker-basic_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/Window/getMatchedCSSRules-nested-rules_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/dom/Window/getMatchedCSSRules-with-pseudo-elements-complex_t01: RuntimeError # Please triage this failure
 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
@@ -850,6 +845,7 @@
 LayoutTests/fast/dom/characterdata-api-arguments_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/client-width-height-quirks_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/css-selectorText_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/custom/document-register-basic_t01: RuntimeError # Dartium JSInterop failure
 LayoutTests/fast/dom/custom/document-register-svg-extends_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/custom/element-names_t01: Pass, RuntimeError # Please triage this failure
 LayoutTests/fast/dom/dataset-xhtml_t01: RuntimeError # Please triage this failure
@@ -863,9 +859,10 @@
 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/implementation-createHTMLDocument_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/location-hash_t01: Pass, RuntimeError # Please triage this failure
-LayoutTests/fast/dom/navigatorcontentutils/is-protocol-handler-registered_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/navigatorcontentutils/is-protocol-handler-registered_t01: Skip # API not supported.
+LayoutTests/fast/dom/navigatorcontentutils/register-protocol-handler_t01: Skip # API not supported.
+LayoutTests/fast/dom/navigatorcontentutils/unregister-protocol-handler_t01: Skip # API not supported.
 LayoutTests/fast/dom/option-properties_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/partial-layout-overlay-scrollbars_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/set-innerHTML_t01: RuntimeError # Please triage this failure
@@ -928,6 +925,7 @@
 LayoutTests/fast/filesystem/directory-entry-to-uri_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/filesystem/file-entry-to-uri_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/filesystem/filesystem-reference_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/forms/ValidityState-customError_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/forms/autofocus-focus-only-once_t01: Skip # Times out. Please triage this failure
 LayoutTests/fast/forms/autofocus-input-css-style-change_t01: Skip # Times out. Please triage this failure
 LayoutTests/fast/forms/autofocus-opera-007_t01: Skip # Times out. Please triage this failure
@@ -938,7 +936,6 @@
 LayoutTests/fast/forms/date-multiple-fields/date-multiple-fields-onblur-setvalue-onfocusremoved_t01: Pass, RuntimeError # Please triage this failure
 LayoutTests/fast/forms/date/input-valueasdate-date_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 # 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: Pass, RuntimeError # Please triage this failure
@@ -960,6 +957,7 @@
 LayoutTests/fast/forms/select-clientheight-large-size_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/forms/select-clientheight-with-multiple-attr_t01: Pass, RuntimeError # Please triage this failure
 LayoutTests/fast/forms/select-list-box-mouse-focus_t01: Pass, RuntimeError # Please triage this failure
+LayoutTests/fast/forms/select-max-length_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/forms/setrangetext_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/forms/textarea-paste-newline_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/forms/textfield-focus-out_t01: Skip # Times out. Please triage this failure
@@ -989,11 +987,10 @@
 LayoutTests/fast/masking/parsing-mask_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/media/media-query-list-syntax_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/mediastream/RTCPeerConnection-AddRemoveStream_t01: Skip # Issue 23475
-LayoutTests/fast/multicol/balance-short-trailing-empty-block_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/multicol/balance-trailing-border_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/multicol/balance-trailing-border_t02: RuntimeError # Please triage this failure
 LayoutTests/fast/multicol/break-after-always-bottom-margin_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/multicol/break-properties_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/multicol/columns-shorthand-parsing_t02: RuntimeError # Please triage this failure
 LayoutTests/fast/multicol/cssom-view_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/multicol/flipped-blocks-hit-test_t01: Pass, RuntimeError # Please triage this failure
 LayoutTests/fast/multicol/float-truncation_t01: RuntimeError # Please triage this failure
@@ -1014,7 +1011,6 @@
 LayoutTests/fast/multicol/vertical-rl/float-truncation_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/multicol/vertical-rl/image-inside-nested-blocks-with-border_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/multicol/widows_t01: Pass, RuntimeError # Please triage this failure
-LayoutTests/fast/multicol/widows_t02: RuntimeError # Please triage this failure
 LayoutTests/fast/overflow/replaced-child-100percent-height-inside-fixed-container-with-overflow-auto_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/parser/foster-parent-adopted_t02: RuntimeError # Please triage this failure
 LayoutTests/fast/parser/fragment-parser-doctype_t01: RuntimeError # Please triage this failure
@@ -1119,6 +1115,7 @@
 LayoutTests/fast/xpath/4XPath/Core/test_core_functions_t02: RuntimeError # Please triage this failure
 LayoutTests/fast/xpath/4XPath/Core/test_node_test_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/xpath/4XPath/Core/test_node_test_t02: RuntimeError # Please triage this failure
+LayoutTests/fast/xpath/4XPath/Core/test_parser_t01: RuntimeError # Dartium JSInterop failure
 LayoutTests/fast/xpath/ambiguous-operators_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/xpath/attr-namespace_t02: RuntimeError # Please triage this failure
 LayoutTests/fast/xpath/ensure-null-namespace_t01: RuntimeError # Please triage this failure
@@ -1127,6 +1124,7 @@
 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/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
@@ -1265,7 +1263,6 @@
 WebPlatformTest/html/browsers/browsing-the-web/read-media/pageload-image_t01: RuntimeError # Please triage this failure
 WebPlatformTest/html/browsers/browsing-the-web/read-media/pageload-video_t01: RuntimeError # Please triage this failure
 WebPlatformTest/html/browsers/browsing-the-web/read-text/load-text-plain_t01: RuntimeError # Please triage this failure
-WebPlatformTest/html/dom/documents/dom-tree-accessors/Document.getElementsByClassName-null_t01: RuntimeError # Please triage this failure
 WebPlatformTest/html/dom/documents/dom-tree-accessors/document.body-getter_t01: RuntimeError # Please triage this failure
 WebPlatformTest/html/dom/documents/dom-tree-accessors/document.body-setter_t01: RuntimeError # Please triage this failure
 WebPlatformTest/html/dom/documents/dom-tree-accessors/document.getElementsByName-namespace_t01: RuntimeError # Please triage this failure
@@ -1329,7 +1326,6 @@
 WebPlatformTest/html/semantics/selectors/pseudo-classes/link_t01: RuntimeError # Please triage this failure
 WebPlatformTest/html/semantics/selectors/pseudo-classes/valid-invalid_t01: Pass, RuntimeError # Please triage this failure
 WebPlatformTest/html/semantics/tabular-data/the-table-element/table-rows_t01: RuntimeError # Please triage this failure
-WebPlatformTest/html/semantics/tabular-data/the-tr-element/rowIndex_t01: RuntimeError # Please triage this failure
 WebPlatformTest/html/syntax/parsing/Document.getElementsByTagName-foreign_t01: Pass, 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
@@ -1378,8 +1374,6 @@
 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/storage_local_setitem_t01: RuntimeError # Please triage this failure
-WebPlatformTest/webstorage/storage_session_setitem_t01: RuntimeError # Please triage this failure
 
 [ $compiler == dart2js && $runtime == chrome && $checked ]
 LayoutTests/fast/css-intrinsic-dimensions/css-tables_t01: RuntimeError # Please triage this failure
@@ -1441,6 +1435,8 @@
 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
 WebPlatformTest/DOMEvents/approved/Propagation.path.target.removed_t01: RuntimeError # Please triage this failure
@@ -1463,6 +1459,7 @@
 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
+WebPlatformTest/shadow-dom/events/retargeting-focus-events/test-002_t01: Skip # Times out. Please triage this failure
 
 [ $compiler == dart2js && $runtime == chrome && $system != macos ]
 LayoutTests/fast/canvas/webgl/WebGLContextEvent_t01: RuntimeError # Please triage this failure
@@ -1547,8 +1544,43 @@
 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 ]
+LayoutTests/fast/canvas/canvas-blend-image_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-blend-solid_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-blending-clipping_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-blending-color-over-color_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-blending-color-over-gradient_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-blending-color-over-image_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-blending-color-over-pattern_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-blending-fill-style_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-blending-global-alpha_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-blending-gradient-over-color_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-blending-gradient-over-gradient_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-blending-gradient-over-image_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-blending-gradient-over-pattern_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-blending-image-over-color_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-blending-image-over-gradient_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-blending-image-over-image_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-blending-image-over-pattern_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-blending-pattern-over-color_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-blending-pattern-over-gradient_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-blending-pattern-over-image_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-blending-pattern-over-pattern_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-blending-shadow_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-blending-transforms_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-composite-alpha_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-composite-canvas_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-composite-image_t01: RuntimeError # 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
+
+[ $compiler == dart2js && $runtime == chrome && $system != linux ]
+LayoutTests/fast/xpath/py-dom-xpath/abbreviations_t01: RuntimeError # Issue 24398
+
+[ $compiler == dart2js && $runtime == chrome && $system == linux]
+LayoutTests/fast/xpath/py-dom-xpath/abbreviations_t01: RuntimeError # Dartium JSInterop failure
+
 [ $compiler == dart2js && $runtime == ff ]
-Language/12_Expressions/00_Object_Identity/1_Object_Identity_A05_t02: RuntimeError # Please triage this failure
 Language/12_Expressions/28_Postfix_Expressions_A07_t02: 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
@@ -1584,7 +1616,7 @@
 LayoutTests/fast/canvas/canvas-composite-text-alpha_t01: Pass, RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/canvas-css-crazy_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/canvas-currentColor_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/canvas/canvas-currentTransform_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
 LayoutTests/fast/canvas/canvas-ellipse-360-winding_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/canvas-ellipse-negative-radius_t01: RuntimeError # Please triage this failure
@@ -1844,19 +1876,15 @@
 LayoutTests/fast/css/first-child-display-change-inverse_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/focus-display-block-inline_t01: Pass, RuntimeError # Please triage this failure
 LayoutTests/fast/css/font-face-insert-link_t01: Pass, RuntimeError # Please triage this failure
-LayoutTests/fast/css/font-face-multiple-ranges-for-unicode-range_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/font-face-unicode-range-load_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/font-face-unicode-range-monospace_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/font-face-unicode-range-overlap-load_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/css/font-face-used-after-retired_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/font-family-trailing-bracket-gunk_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/font-property-priority_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/font-shorthand-from-longhands_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/font-shorthand-mix-inherit_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/fontface-properties_t01: RuntimeError # Uses FontFace class, not defined for this browser.
 LayoutTests/fast/css/fontfaceset-download-error_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/css/fontfaceset-events_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/css/fontfaceset-loadingdone_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/getComputedStyle/computed-style-border-image_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/getComputedStyle/computed-style-cross-fade_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/getComputedStyle/computed-style-font_t01: RuntimeError # Please triage this failure
@@ -1906,7 +1934,6 @@
 LayoutTests/fast/css/link-alternate-stylesheet-4_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/link-alternate-stylesheet-5_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/link-disabled-attr-parser_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/css/list-item-text-align_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/margin-start-end_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/max-device-aspect-ratio_t01: Pass, RuntimeError # Please triage this failure
 LayoutTests/fast/css/media-query-recovery_t01: RuntimeError # Please triage this failure
@@ -1936,7 +1963,6 @@
 LayoutTests/fast/css/pseudo-target-indirect-sibling-002_t01: Skip # Times out. Please triage this failure
 LayoutTests/fast/css/pseudo-valid-dynamic_t01: Pass, RuntimeError # Passes on ff 35. Please triage this failure
 LayoutTests/fast/css/pseudo-valid-unapplied_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/css/pseudostyle-anonymous-text_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/readonly-pseudoclass-opera-001_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/readonly-pseudoclass-opera-002_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/readonly-pseudoclass-opera-003_t01: RuntimeError # Please triage this failure
@@ -1944,7 +1970,6 @@
 LayoutTests/fast/css/readonly-pseudoclass-opera-005_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/readwrite-contenteditable-recalc_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/recalc-optgroup-inherit_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/css/relative-positioned-block-crash_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/remove-attribute-style_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/remove-class-name_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/css/selector-text-escape_t01: RuntimeError # Please triage this failure
@@ -2009,7 +2034,6 @@
 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 # Please triage this 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
@@ -2067,7 +2091,7 @@
 LayoutTests/fast/dom/HTMLLinkElement/prefetch_t01: Skip # Times out. Please triage this failure
 LayoutTests/fast/dom/HTMLLinkElement/resolve-url-on-insertion_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/HTMLMeterElement/set-meter-properties_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/dom/HTMLObjectElement/beforeload-set-text-crash_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLObjectElement/beforeload-set-text-crash_t01: Skip # Times out. Issue 24455
 LayoutTests/fast/dom/HTMLObjectElement/form/test1_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/HTMLObjectElement/set-type-to-null-crash_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/HTMLOptionElement/collection-setter-getter_t01: RuntimeError # Please triage this failure
@@ -2114,7 +2138,6 @@
 LayoutTests/fast/dom/Range/range-insertNode-splittext_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/SelectorAPI/caseTagX_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/SelectorAPI/dumpNodeList-2_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/dom/SelectorAPI/dumpNodeList-almost-strict_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/SelectorAPI/dumpNodeList_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/StyleSheet/css-insert-import-rule-to-shadow-stylesheets_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/StyleSheet/css-medialist-item_t01: RuntimeError # Please triage this failure
@@ -2134,6 +2157,7 @@
 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-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
@@ -2146,7 +2170,6 @@
 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/css-delete-doc_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/dom/css-mediarule-functions_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
 LayoutTests/fast/dom/css-shortHands_t01: RuntimeError # Please triage this failure
@@ -2184,7 +2207,7 @@
 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/implementation-createHTMLDocument_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLDialogElement/dialog-return-value_t01: RuntimeError # Dartium JSInterop failure
 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
 LayoutTests/fast/dom/insertBefore-refChild-crash_t01: RuntimeError # Please triage this failure
@@ -2192,9 +2215,9 @@
 LayoutTests/fast/dom/length-attribute-mapping_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/location-hash_t01: Skip # Times out. Please triage this failure
 LayoutTests/fast/dom/navigator-userAgent_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/dom/navigatorcontentutils/is-protocol-handler-registered_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/dom/navigatorcontentutils/register-protocol-handler_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/dom/navigatorcontentutils/unregister-protocol-handler_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/navigatorcontentutils/is-protocol-handler-registered_t01: Skip # API not supported.
+LayoutTests/fast/dom/navigatorcontentutils/register-protocol-handler_t01: Skip # API not supported.
+LayoutTests/fast/dom/navigatorcontentutils/unregister-protocol-handler_t01: Skip # API not supported.
 LayoutTests/fast/dom/object-plugin-hides-properties_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/offset-position-writing-modes_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/option-properties_t01: RuntimeError # Please triage this failure
@@ -2284,11 +2307,11 @@
 LayoutTests/fast/dynamic/insertAdjacentElement_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dynamic/insertAdjacentHTML-allowed-parents_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dynamic/recursive-layout_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/encoding/css-charset-dom_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/events/add-event-without-document_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/events/change-overflow-on-overflow-change_t01: Skip # Times out. Please triage this failure
-LayoutTests/fast/events/clipboard-clearData_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/events/clipboard-dataTransferItemList-remove_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/events/clipboard-dataTransferItemList_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/events/clipboard-clearData_t01: Skip # Times out. Issue 24455
+LayoutTests/fast/events/clipboard-dataTransferItemList_t01: Skip # Times out. Issue 24455
 LayoutTests/fast/events/div-focus_t01: Pass, RuntimeError # Please triage this failure
 LayoutTests/fast/events/document-elementFromPoint_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/events/event-attributes-after-exception_t01: RuntimeError # Please triage this failure
@@ -2387,6 +2410,7 @@
 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/change-form-element-document-crash_t01: RuntimeError # Dartium JSInterop failure, or else Firefox roll error. Issue 24409
 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
@@ -2408,6 +2432,7 @@
 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
@@ -2415,7 +2440,6 @@
 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 # Please triage this 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
@@ -2474,7 +2498,6 @@
 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
 LayoutTests/fast/forms/textarea-paste-newline_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/forms/textarea-rows-cols_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/forms/textarea-set-defaultvalue-after-value_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/forms/textarea-trailing-newline_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/forms/textfield-clone_t01: RuntimeError # Please triage this failure
@@ -2522,7 +2545,6 @@
 LayoutTests/fast/masking/parsing-clip-path-shape_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/masking/parsing-mask-source-type_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/masking/parsing-mask_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/media/color-does-not-include-alpha_t01: Pass, RuntimeError # Please triage this failure
 LayoutTests/fast/media/invalid-lengths_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/media/matchmedium-query-api_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/media/media-query-list-syntax_t01: RuntimeError # Please triage this failure
@@ -2654,7 +2676,6 @@
 LayoutTests/fast/text/sub-pixel/text-scaling-vertical_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/text/sub-pixel/text-scaling-webfont_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/text/text-combine-shrink-to-fit_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/text/text-fragment-first-letter-update-crash_t01: RuntimeError # Please triage this failure
 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
@@ -2702,6 +2723,7 @@
 LayoutTests/fast/xpath/4XPath/Core/test_core_functions_t02: RuntimeError # Please triage this failure
 LayoutTests/fast/xpath/4XPath/Core/test_node_test_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/xpath/4XPath/Core/test_node_test_t02: RuntimeError # Please triage this failure
+LayoutTests/fast/xpath/4XPath/Core/test_parser_t01: RuntimeError # Dartium JSInterop failure
 LayoutTests/fast/xpath/ambiguous-operators_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/xpath/attr-namespace_t02: RuntimeError # Please triage this failure
 LayoutTests/fast/xpath/ensure-null-namespace_t01: RuntimeError # Please triage this failure
@@ -2710,6 +2732,8 @@
 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/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
@@ -2888,7 +2912,6 @@
 WebPlatformTest/html/browsers/browsing-the-web/read-media/pageload-image_t01: RuntimeError # Please triage this failure
 WebPlatformTest/html/browsers/browsing-the-web/read-media/pageload-video_t01: RuntimeError # Please triage this failure
 WebPlatformTest/html/browsers/browsing-the-web/read-text/load-text-plain_t01: RuntimeError # Please triage this failure
-WebPlatformTest/html/dom/documents/dom-tree-accessors/Document.getElementsByClassName-null_t01: RuntimeError # Please triage this failure
 WebPlatformTest/html/dom/documents/dom-tree-accessors/document.body-getter_t01: RuntimeError # Please triage this failure
 WebPlatformTest/html/dom/documents/dom-tree-accessors/document.body-setter_t01: RuntimeError # Please triage this failure
 WebPlatformTest/html/dom/documents/dom-tree-accessors/document.getElementsByName-namespace_t01: RuntimeError # Please triage this failure
@@ -3064,49 +3087,19 @@
 WebPlatformTest/webstorage/event_constructor_t01: RuntimeError # Please triage this failure
 WebPlatformTest/webstorage/event_constructor_t02: RuntimeError # Please triage this failure
 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_local_setitem_t01: RuntimeError # Please triage this failure
 WebPlatformTest/webstorage/storage_session_setitem_quotaexceedederr_t01: Skip # Times out. Please triage this failure
-WebPlatformTest/webstorage/storage_session_setitem_t01: RuntimeError # Please triage this failure
 
 [ $compiler == dart2js && $runtime == ff && $system == windows ]
-LayoutTests/fast/dom/Window/window-scroll-arguments_t01: RuntimeError # Issue 22564
+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
-LayoutTests/fast/dom/Attr/access-after-element-destruction_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/dom/HTMLOutputElement/htmloutputelement-value_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/dom/Range/surroundContents-check-boundary-points_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/dom/Range/surroundContents-for-detached-node_t01: RuntimeError # Please triage this failure
-LibTest/html/Element/insertAdjacentElement_A01_t01: RuntimeError # Please triage this failure
-LibTest/html/Element/insertAllBefore_A01_t01: RuntimeError # Please triage this failure
-LibTest/html/Element/insertAllBefore_A02_t01: RuntimeError # Please triage this failure
-LibTest/html/Element/insertBefore_A01_t01: RuntimeError # Please triage this failure
-LibTest/html/Element/insertBefore_A02_t01: RuntimeError # Please triage this failure
-LibTest/html/Element/nodes_A01_t02: RuntimeError # Please triage this failure
-LibTest/html/Element/replaceWith_A01_t01: RuntimeError # Please triage this failure
-LibTest/html/IFrameElement/children_A01_t02: RuntimeError # Please triage this failure
-LibTest/html/IFrameElement/insertAdjacentElement_A01_t01: RuntimeError # Please triage this failure
-LibTest/html/IFrameElement/insertAllBefore_A01_t01: RuntimeError # Please triage this failure
-LibTest/html/IFrameElement/insertAllBefore_A02_t01: RuntimeError # Please triage this failure
-LibTest/html/IFrameElement/insertBefore_A01_t01: RuntimeError # Please triage this failure
-LibTest/html/IFrameElement/insertBefore_A02_t01: RuntimeError # Please triage this failure
-LibTest/html/IFrameElement/nodes_A01_t02: RuntimeError # Please triage this failure
-LibTest/html/IFrameElement/nodes_setter_A01_t01: RuntimeError # Please triage this failure
-LibTest/html/IFrameElement/replaceWith_A01_t01: RuntimeError # Please triage this failure
-WebPlatformTest/dom/nodes/attributes/setAttributeNS_A03_t01: RuntimeError # Please triage this failure
-WebPlatformTest/html-templates/serializing-html-templates/outerhtml_t01: RuntimeError # Please triage this failure
 
 [ $compiler == dart2js && $runtime == ff && $system != windows ]
 LayoutTests/fast/canvas/canvas-resetTransform_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/canvas-setTransform_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/css/parsing-object-fit_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-style_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/dom/MutationObserver/observe-options-attributes_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/dom/MutationObserver/observe-options-character-data_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/table/incorrect-colgroup-span-values_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/xmlhttprequest/xmlhttprequest-responsetype-before-open_t01: RuntimeError # Please triage this failure
-LibTest/html/HttpRequest/responseType_A01_t02: 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
 
 [ $compiler == dart2js && $runtime == safari ]
-Language/12_Expressions/00_Object_Identity/1_Object_Identity_A05_t02: RuntimeError # 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
@@ -3151,7 +3144,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-currentTransform_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/canvas/canvas-currentTransform_t01: RuntimeError # Feature is not implemented
 LayoutTests/fast/canvas/canvas-drawImage-scaled-copy-to-self_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/canvas-ellipse-360-winding_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/canvas-ellipse-negative-radius_t01: RuntimeError # Please triage this failure
@@ -3455,7 +3448,6 @@
 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 # Please triage this 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
@@ -3518,7 +3510,6 @@
 LayoutTests/fast/dom/Range/range-on-detached-node_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/Range/surroundContents-for-detached-node_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/SelectorAPI/dumpNodeList-2_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/dom/SelectorAPI/dumpNodeList-almost-strict_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/SelectorAPI/dumpNodeList_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/StyleSheet/css-insert-import-rule-to-shadow-stylesheets_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/StyleSheet/css-medialist-item_t01: RuntimeError # Please triage this failure
@@ -3565,14 +3556,13 @@
 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/html-collections-named-getter-mandatory-arg_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLDialogElement/dialog-return-value_t01: RuntimeError # Dartium JSInterop failure
 LayoutTests/fast/dom/implementation-api-args_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/dom/implementation-createHTMLDocument_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/importNode-unsupported-node-type_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/location-hash_t01: Skip # Times out. Please triage this failure
-LayoutTests/fast/dom/location-missing-arguments_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/dom/navigatorcontentutils/is-protocol-handler-registered_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/dom/navigatorcontentutils/register-protocol-handler_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/dom/navigatorcontentutils/unregister-protocol-handler_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/navigatorcontentutils/is-protocol-handler-registered_t01: Skip # API not supported.
+LayoutTests/fast/dom/navigatorcontentutils/register-protocol-handler_t01: Skip # API not supported.
+LayoutTests/fast/dom/navigatorcontentutils/unregister-protocol-handler_t01: Skip # API not supported.
 LayoutTests/fast/dom/object-plugin-hides-properties_t01: Pass, RuntimeError # Please triage this failure
 LayoutTests/fast/dom/option-properties_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/partial-layout-overlay-scrollbars_t01: RuntimeError # Please triage this failure
@@ -3735,6 +3725,7 @@
 LayoutTests/fast/forms/color/input-value-sanitization-color_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/forms/datalist/datalist_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/forms/datalist/input-list_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/datetimelocal/input-valueasnumber-datetimelocal_t01: RuntimeError # Dartium JSInterop failure
 LayoutTests/fast/forms/date-multiple-fields/date-multiple-fields-change-layout-by-value_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/forms/date-multiple-fields/date-multiple-fields-onblur-setvalue-onfocusremoved_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/forms/date/ValidityState-rangeOverflow-date_t01: RuntimeError # Please triage this failure
@@ -3757,7 +3748,6 @@
 LayoutTests/fast/forms/datetimelocal/datetimelocal-pseudo-classes_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/forms/datetimelocal/datetimelocal-setrangetext_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 # Please triage this failure
 LayoutTests/fast/forms/file/file-input-capture_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/forms/form-attribute_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/forms/input-appearance-elementFromPoint_t01: RuntimeError # Please triage this failure
@@ -3979,6 +3969,7 @@
 LayoutTests/fast/xpath/4XPath/Core/test_core_functions_t02: RuntimeError # Please triage this failure
 LayoutTests/fast/xpath/4XPath/Core/test_node_test_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/xpath/4XPath/Core/test_node_test_t02: RuntimeError # Please triage this failure
+LayoutTests/fast/xpath/4XPath/Core/test_parser_t01: RuntimeError # Dartium JSInterop failure
 LayoutTests/fast/xpath/ambiguous-operators_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/xpath/attr-namespace_t02: RuntimeError # Please triage this failure
 LayoutTests/fast/xpath/ensure-null-namespace_t01: RuntimeError # Please triage this failure
@@ -3987,6 +3978,7 @@
 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/abbreviations_t01: RuntimeError # Dartium JSInterop failure
 LayoutTests/fast/xpath/py-dom-xpath/axes_t01: RuntimeError # Please triage this 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
@@ -4169,7 +4161,6 @@
 WebPlatformTest/html/browsers/browsing-the-web/read-media/pageload-image_t01: RuntimeError # Please triage this failure
 WebPlatformTest/html/browsers/browsing-the-web/read-media/pageload-video_t01: Skip # Times out. Please triage this failure
 WebPlatformTest/html/browsers/browsing-the-web/read-text/load-text-plain_t01: RuntimeError # Please triage this failure
-WebPlatformTest/html/dom/documents/dom-tree-accessors/Document.getElementsByClassName-null_t01: RuntimeError # Please triage this failure
 WebPlatformTest/html/dom/documents/dom-tree-accessors/document.body-getter_t01: RuntimeError # Please triage this failure
 WebPlatformTest/html/dom/documents/dom-tree-accessors/document.body-setter_t01: RuntimeError # Please triage this failure
 WebPlatformTest/html/dom/documents/dom-tree-accessors/document.getElementsByName-namespace_t01: RuntimeError # Please triage this failure
@@ -4350,12 +4341,9 @@
 WebPlatformTest/webstorage/event_session_key_t01: RuntimeError # Please triage this failure
 WebPlatformTest/webstorage/event_session_storagearea_t01: Pass, RuntimeError # Fails on 7.1. Please triage this failure
 WebPlatformTest/webstorage/event_session_url_t01: Skip # Times out. Please triage this failure
-WebPlatformTest/webstorage/storage_local_setitem_t01: RuntimeError # Please triage this failure
 WebPlatformTest/webstorage/storage_session_setitem_quotaexceedederr_t01: Skip # Times out. Please triage this failure
-WebPlatformTest/webstorage/storage_session_setitem_t01: Skip # Times out. Please triage this failure
 
 [ $compiler == dart2js && $runtime == safarimobilesim ]
-Language/12_Expressions/00_Object_Identity/1_Object_Identity_A05_t02: RuntimeError # 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
@@ -4401,7 +4389,7 @@
 LayoutTests/fast/canvas/canvas-composite-canvas_t01: RuntimeError # 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 # Please triage this failure
+LayoutTests/fast/canvas/canvas-currentTransform_t01: RuntimeError # Feature is not implemented
 LayoutTests/fast/canvas/canvas-drawImage-scaled-copy-to-self_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/canvas-ellipse-360-winding_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/canvas-ellipse-negative-radius_t01: RuntimeError # Please triage this failure
@@ -4714,7 +4702,6 @@
 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 # Please triage this 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
@@ -4791,7 +4778,7 @@
 LayoutTests/fast/dom/SelectorAPI/caseID-almost-strict_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/SelectorAPI/caseID_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/SelectorAPI/dumpNodeList-2_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/dom/SelectorAPI/dumpNodeList-almost-strict_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/SelectorAPI/dumpNodeList-almost-strict_t01: RuntimeError # Dartium JSInterop failure
 LayoutTests/fast/dom/SelectorAPI/dumpNodeList_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/SelectorAPI/id-fastpath-almost-strict_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/SelectorAPI/id-fastpath-strict_t01: RuntimeError # Please triage this failure
@@ -4849,15 +4836,14 @@
 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/html-collections-named-getter-mandatory-arg_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/HTMLDialogElement/dialog-return-value_t01: RuntimeError # Dartium JSInterop failure
 LayoutTests/fast/dom/implementation-api-args_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/dom/implementation-createHTMLDocument_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/importNode-unsupported-node-type_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/jsDevicePixelRatio_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/location-hash_t01: Pass, RuntimeError # Please triage this failure
-LayoutTests/fast/dom/location-missing-arguments_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/dom/navigatorcontentutils/is-protocol-handler-registered_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/dom/navigatorcontentutils/register-protocol-handler_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/dom/navigatorcontentutils/unregister-protocol-handler_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/navigatorcontentutils/is-protocol-handler-registered_t01: Skip # API not supported.
+LayoutTests/fast/dom/navigatorcontentutils/register-protocol-handler_t01: Skip # API not supported.
+LayoutTests/fast/dom/navigatorcontentutils/unregister-protocol-handler_t01: Skip # API not supported.
 LayoutTests/fast/dom/node-iterator-with-doctype-root_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/option-properties_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/partial-layout-non-overlay-scrollbars_t01: RuntimeError # Please triage this failure
@@ -5034,7 +5020,7 @@
 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-valueasdate-datetimelocal_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/forms/datetimelocal/input-valueasnumber-datetimelocal_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/forms/datetimelocal/input-valueasnumber-datetimelocal_t01: RuntimeError # Dartium JSInterop 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/form-attribute_t01: RuntimeError # Please triage this failure
@@ -5273,6 +5259,7 @@
 LayoutTests/fast/xpath/4XPath/Core/test_core_functions_t02: RuntimeError # Please triage this failure
 LayoutTests/fast/xpath/4XPath/Core/test_node_test_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/xpath/4XPath/Core/test_node_test_t02: RuntimeError # Please triage this failure
+LayoutTests/fast/xpath/4XPath/Core/test_parser_t01: RuntimeError # Dartium JSInterop failure
 LayoutTests/fast/xpath/ambiguous-operators_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/xpath/attr-namespace_t02: RuntimeError # Please triage this failure
 LayoutTests/fast/xpath/ensure-null-namespace_t01: RuntimeError # Please triage this failure
@@ -5281,6 +5268,7 @@
 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/abbreviations_t01: RuntimeError # Dartium JSInterop failure
 LayoutTests/fast/xpath/py-dom-xpath/axes_t01: RuntimeError # Please triage this 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
@@ -5492,7 +5480,6 @@
 WebPlatformTest/html/browsers/browsing-the-web/read-media/pageload-image_t01: RuntimeError # Please triage this failure
 WebPlatformTest/html/browsers/browsing-the-web/read-media/pageload-video_t01: Skip # Times out. Please triage this failure
 WebPlatformTest/html/browsers/browsing-the-web/read-text/load-text-plain_t01: RuntimeError # Please triage this failure
-WebPlatformTest/html/dom/documents/dom-tree-accessors/Document.getElementsByClassName-null_t01: RuntimeError # Please triage this failure
 WebPlatformTest/html/dom/documents/dom-tree-accessors/document.body-getter_t01: RuntimeError # Please triage this failure
 WebPlatformTest/html/dom/documents/dom-tree-accessors/document.body-setter_t01: RuntimeError # Please triage this failure
 WebPlatformTest/html/dom/documents/dom-tree-accessors/document.getElementsByName-namespace_t01: RuntimeError # Please triage this failure
@@ -5671,8 +5658,6 @@
 WebPlatformTest/webstorage/event_constructor_t02: RuntimeError # Please triage this failure
 WebPlatformTest/webstorage/event_local_key_t01: RuntimeError # Please triage this failure
 WebPlatformTest/webstorage/event_session_key_t01: RuntimeError # Please triage this failure
-WebPlatformTest/webstorage/storage_local_setitem_t01: RuntimeError # Please triage this failure
-WebPlatformTest/webstorage/storage_session_setitem_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
@@ -5681,7 +5666,6 @@
 LayoutTests/fast/table/hittest-tablecell-with-borders-bottom-edge_t01: RuntimeError, Pass # Issue 22752. Please triage this failure.
 
 [ $compiler == dart2js && $runtime == ie10 ]
-Language/12_Expressions/00_Object_Identity/1_Object_Identity_A05_t02: RuntimeError # Please triage this failure
 Language/12_Expressions/17_Getter_Invocation_A03_t02: 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
@@ -5741,7 +5725,7 @@
 LayoutTests/fast/canvas/canvas-composite-canvas_t01: Pass, RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/canvas-css-crazy_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/canvas-currentColor_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/canvas/canvas-currentTransform_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
 LayoutTests/fast/canvas/canvas-ellipse-negative-radius_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/canvas-ellipse-zero-lineto_t01: RuntimeError # Please triage this failure
@@ -6200,7 +6184,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 # Please triage this failure
+LayoutTests/fast/dom/HTMLDialogElement/dialog-return-value_t01: RuntimeError # Issue 24396
 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
@@ -6375,7 +6359,6 @@
 LayoutTests/fast/dom/SelectorAPI/caseID_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/SelectorAPI/caseTagX_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/SelectorAPI/dumpNodeList-2_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/dom/SelectorAPI/dumpNodeList-almost-strict_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/SelectorAPI/dumpNodeList_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/StyleSheet/css-insert-import-rule-to-shadow-stylesheets_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/StyleSheet/css-medialist-item_t01: RuntimeError # Please triage this failure
@@ -6473,7 +6456,6 @@
 LayoutTests/fast/dom/icon-size-property_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/image-object_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/implementation-api-args_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/dom/implementation-createHTMLDocument_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/importNode-unsupported-node-type_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/importNodeHTML_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/importNodeXML_t01: RuntimeError # Please triage this failure
@@ -6483,9 +6465,9 @@
 LayoutTests/fast/dom/location-hash_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/navigator-userAgent_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/navigator-vendorSub_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/dom/navigatorcontentutils/is-protocol-handler-registered_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/dom/navigatorcontentutils/register-protocol-handler_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/dom/navigatorcontentutils/unregister-protocol-handler_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/navigatorcontentutils/is-protocol-handler-registered_t01: Skip # API not supported.
+LayoutTests/fast/dom/navigatorcontentutils/register-protocol-handler_t01: Skip # API not supported.
+LayoutTests/fast/dom/navigatorcontentutils/unregister-protocol-handler_t01: Skip # API not supported.
 LayoutTests/fast/dom/node-iterator-with-doctype-root_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/noscript-style_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/offset-position-writing-modes_t01: RuntimeError # Please triage this failure
@@ -7499,7 +7481,6 @@
 WebPlatformTest/html/browsers/browsing-the-web/read-media/pageload-image_t01: Skip # Times out. Please triage this failure
 WebPlatformTest/html/browsers/browsing-the-web/read-media/pageload-video_t01: Skip # Times out. Please triage this failure
 WebPlatformTest/html/browsers/browsing-the-web/read-text/load-text-plain_t01: RuntimeError # Please triage this failure
-WebPlatformTest/html/dom/documents/dom-tree-accessors/Document.getElementsByClassName-null_t01: RuntimeError # Please triage this failure
 WebPlatformTest/html/dom/documents/dom-tree-accessors/document.body-getter_t01: RuntimeError # Please triage this failure
 WebPlatformTest/html/dom/documents/dom-tree-accessors/document.body-setter_t01: RuntimeError # Please triage this failure
 WebPlatformTest/html/dom/documents/dom-tree-accessors/document.getElementsByName-namespace_t01: RuntimeError # Please triage this failure
@@ -7704,13 +7685,10 @@
 WebPlatformTest/webstorage/event_session_url_t01: RuntimeError # Please triage this failure
 WebPlatformTest/webstorage/storage_builtins_t01: RuntimeError # Please triage this failure
 WebPlatformTest/webstorage/storage_local_setitem_quotaexceedederr_t01: Skip # Times out. Please triage this failure
-WebPlatformTest/webstorage/storage_local_setitem_t01: RuntimeError # Please triage this failure
-WebPlatformTest/webstorage/storage_session_setitem_t01: RuntimeError # Please triage this failure
 
 [ $compiler == dart2js && $runtime == ie11 ]
 Language/05_Variables/05_Variables_A14_t07: Skip # Times out. Please triage this failure
 Language/06_Functions/2_Formal_Parameters_A02_t01: Skip # Times out. Please triage this failure
-Language/12_Expressions/00_Object_Identity/1_Object_Identity_A05_t02: RuntimeError # Please triage this failure
 Language/12_Expressions/19_Conditional_A06_t04: Skip # Times out. Please triage this failure
 Language/12_Expressions/30_Identifier_Reference_A10_t02: Skip # Times out. Please triage this failure
 Language/13_Statements/03_Variable_Declaration_A01_t18: Skip # Times out. Please triage this failure
@@ -7771,7 +7749,7 @@
 LayoutTests/fast/canvas/canvas-composite-text-alpha_t01: Pass, RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/canvas-css-crazy_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/canvas-currentColor_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/canvas/canvas-currentTransform_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
 LayoutTests/fast/canvas/canvas-ellipse-negative-radius_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/canvas/canvas-ellipse-zero-lineto_t01: RuntimeError # Please triage this failure
@@ -8214,7 +8192,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 # Please triage this failure
+LayoutTests/fast/dom/HTMLDialogElement/dialog-return-value_t01: RuntimeError # Issue 24396
 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
@@ -8370,7 +8348,6 @@
 LayoutTests/fast/dom/SelectorAPI/caseID_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/SelectorAPI/caseTagX_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/SelectorAPI/dumpNodeList-2_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/dom/SelectorAPI/dumpNodeList-almost-strict_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/SelectorAPI/dumpNodeList_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/StyleSheet/css-insert-import-rule-to-shadow-stylesheets_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/StyleSheet/css-medialist-item_t01: RuntimeError # Please triage this failure
@@ -8465,7 +8442,6 @@
 LayoutTests/fast/dom/horizontal-scrollbar-when-dir-change_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/icon-size-property_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/image-object_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/dom/implementation-createHTMLDocument_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/importNode-unsupported-node-type_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/importNodeHTML_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/importNodeXML_t01: RuntimeError # Please triage this failure
@@ -8474,9 +8450,9 @@
 LayoutTests/fast/dom/location-hash_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/navigator-userAgent_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/navigator-vendorSub_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/dom/navigatorcontentutils/is-protocol-handler-registered_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/dom/navigatorcontentutils/register-protocol-handler_t01: RuntimeError # Please triage this failure
-LayoutTests/fast/dom/navigatorcontentutils/unregister-protocol-handler_t01: RuntimeError # Please triage this failure
+LayoutTests/fast/dom/navigatorcontentutils/is-protocol-handler-registered_t01: Skip # API not supported.
+LayoutTests/fast/dom/navigatorcontentutils/register-protocol-handler_t01: Skip # API not supported.
+LayoutTests/fast/dom/navigatorcontentutils/unregister-protocol-handler_t01: Skip # API not supported.
 LayoutTests/fast/dom/node-iterator-with-doctype-root_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/noscript-style_t01: RuntimeError # Please triage this failure
 LayoutTests/fast/dom/offset-position-writing-modes_t01: RuntimeError # Please triage this failure
@@ -9367,7 +9343,6 @@
 WebPlatformTest/html/browsers/browsing-the-web/read-media/pageload-image_t01: Skip # Times out. Please triage this failure
 WebPlatformTest/html/browsers/browsing-the-web/read-media/pageload-video_t01: Skip # Times out. Please triage this failure
 WebPlatformTest/html/browsers/browsing-the-web/read-text/load-text-plain_t01: RuntimeError # Please triage this failure
-WebPlatformTest/html/dom/documents/dom-tree-accessors/Document.getElementsByClassName-null_t01: RuntimeError # Please triage this failure
 WebPlatformTest/html/dom/documents/dom-tree-accessors/document.body-getter_t01: RuntimeError # Please triage this failure
 WebPlatformTest/html/dom/documents/dom-tree-accessors/document.body-setter_t01: RuntimeError # Please triage this failure
 WebPlatformTest/html/dom/documents/dom-tree-accessors/document.getElementsByName-namespace_t01: RuntimeError # Please triage this failure
@@ -9570,8 +9545,6 @@
 WebPlatformTest/webstorage/event_session_url_t01: RuntimeError # Please triage this failure
 WebPlatformTest/webstorage/storage_builtins_t01: RuntimeError # Please triage this failure
 WebPlatformTest/webstorage/storage_local_setitem_quotaexceedederr_t01: Skip # Times out. Please triage this failure
-WebPlatformTest/webstorage/storage_local_setitem_t01: RuntimeError # Please triage this failure
-WebPlatformTest/webstorage/storage_session_setitem_t01: RuntimeError # Please triage this failure
 
 [ $compiler == dart2js && $cps_ir ]
 Language/12_Expressions/12_Instance_Creation/1_New_A06_t12: RuntimeError # Please triage this failure.
@@ -9586,6 +9559,7 @@
 Language/13_Statements/14_Continue_A02_t13: Crash # (switch (2){case 2:continue L;L:case 1:flag=true;}): continue to a labeled switch case
 Language/15_Types/4_Interface_Types_A12_t09: RuntimeError # Please triage this failure.
 LibTest/async/DeferredLibrary/DeferredLibrary_A01_t01: Crash # (lazy.method()): deferred access is not implemented
+LibTest/collection/ListBase/ListBase_class_A01_t02: Pass, Timeout
 LibTest/core/Invocation/isAccessor_A01_t01: Crash # Class 'PartialMethodElement' has no instance getter 'initializer'.
 LibTest/core/Invocation/isGetter_A01_t01: RuntimeError # Please triage this failure.
 LibTest/core/Invocation/isGetter_A01_t02: RuntimeError # Please triage this failure.
@@ -9599,30 +9573,3 @@
 LibTest/core/Symbol/Symbol_A01_t05: RuntimeError # Please triage this failure.
 LibTest/core/double/INFINITY_A01_t04: Pass # Please triage this failure.
 LibTest/core/double/NEGATIVE_INFINITY_A01_t04: Pass # Please triage this failure.
-LibTest/typed_data/Float32List/setAll_A01_t01: RuntimeError # this.get$length is not a function
-LibTest/typed_data/Float32List/setRange_A01_t01: RuntimeError # this.get$length is not a function
-LibTest/typed_data/Float32List/setRange_A02_t01: RuntimeError # this.get$length is not a function
-LibTest/typed_data/Float64List/setAll_A01_t01: RuntimeError # this.get$length is not a function
-LibTest/typed_data/Float64List/setRange_A01_t01: RuntimeError # this.get$length is not a function
-LibTest/typed_data/Float64List/setRange_A02_t01: RuntimeError # this.get$length is not a function
-LibTest/typed_data/Int16List/setAll_A01_t01: RuntimeError # this.get$length is not a function
-LibTest/typed_data/Int16List/setRange_A01_t01: RuntimeError # this.get$length is not a function
-LibTest/typed_data/Int16List/setRange_A02_t01: RuntimeError # this.get$length is not a function
-LibTest/typed_data/Int32List/setAll_A01_t01: RuntimeError # this.get$length is not a function
-LibTest/typed_data/Int32List/setRange_A01_t01: RuntimeError # this.get$length is not a function
-LibTest/typed_data/Int32List/setRange_A02_t01: RuntimeError # this.get$length is not a function
-LibTest/typed_data/Int8List/setAll_A01_t01: RuntimeError # this.get$length is not a function
-LibTest/typed_data/Int8List/setRange_A01_t01: RuntimeError # this.get$length is not a function
-LibTest/typed_data/Int8List/setRange_A02_t01: RuntimeError # this.get$length is not a function
-LibTest/typed_data/Uint16List/setAll_A01_t01: RuntimeError # this.get$length is not a function
-LibTest/typed_data/Uint16List/setRange_A01_t01: RuntimeError # this.get$length is not a function
-LibTest/typed_data/Uint16List/setRange_A02_t01: RuntimeError # this.get$length is not a function
-LibTest/typed_data/Uint32List/setAll_A01_t01: RuntimeError # this.get$length is not a function
-LibTest/typed_data/Uint32List/setRange_A01_t01: RuntimeError # this.get$length is not a function
-LibTest/typed_data/Uint32List/setRange_A02_t01: RuntimeError # this.get$length is not a function
-LibTest/typed_data/Uint8ClampedList/setAll_A01_t01: RuntimeError # this.get$length is not a function
-LibTest/typed_data/Uint8ClampedList/setRange_A01_t01: RuntimeError # this.get$length is not a function
-LibTest/typed_data/Uint8ClampedList/setRange_A02_t01: RuntimeError # this.get$length is not a function
-LibTest/typed_data/Uint8List/setAll_A01_t01: RuntimeError # this.get$length is not a function
-LibTest/typed_data/Uint8List/setRange_A01_t01: RuntimeError # this.get$length is not a function
-LibTest/typed_data/Uint8List/setRange_A02_t01: RuntimeError # this.get$length is not a function
diff --git a/tests/co19/co19-dartium.status b/tests/co19/co19-dartium.status
index 26e1d15..5136124 100644
--- a/tests/co19/co19-dartium.status
+++ b/tests/co19/co19-dartium.status
@@ -11,6 +11,26 @@
 LayoutTests/fast/writing-mode/vertical-inline-block-hittest_t01: Pass, RuntimeError # Issue 21605
 LayoutTests/fast/writing-mode/flipped-blocks-hit-test-overflow_t01: Pass, RuntimeError # Issue 21605
 
+[ $compiler == none && $runtime == dartium && $system == windows ]
+LayoutTests/fast/writing-mode/vertical-inline-block-hittest_t01: Pass, RuntimeError # Issue 21605
+
+[ $compiler == none && $runtime == dartium ]
+LayoutTests/fast/dom/custom/document-register-basic_t01: RuntimeError # Bad test can't register HtmlElement.
+LayoutTests/fast/dom/StyleSheet/css-medialist-item_t01: RuntimeError # Dartium JSInterop 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/events/remove-event-listener_t01: RuntimeError # Dartium JSInterop failure
+LayoutTests/fast/xpath/4XPath/Core/test_parser_t01: RuntimeError # Dartium JSInterop failure
+LayoutTests/fast/xpath/attr-namespace_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
+WebPlatformTest/shadow-dom/events/retargeting-focus-events/test-001_t01: Pass, RuntimeError # Flaky with Dartium JsInterop. Seems like timing issues in the test.
+LibTest/html/IFrameElement/IFrameElement.created_A01_t01: RuntimeError # Issue 24568
+LibTest/html/Window/requestFileSystem_A02_t01: Skip # Issue 24585.
+
+[ $compiler == none && $runtime == dartium && $checked ]
+LayoutTests/fast/css/style-scoped/style-scoped-scoping-nodes-different-order_t01: RuntimeError # Dartium JSInterop failure
+
 [ $compiler == none && ($runtime == dartium || $runtime == ContentShellOnAndroid) ]
 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-rgb565_t01: Skip # Issue 20540
@@ -38,9 +58,6 @@
 LayoutTests/fast/sub-pixel/size-of-span-with-different-positions_t01: Skip # co19 issue 732.
 LayoutTests/fast/text/international/complex-text-rectangle_t01: Skip # co19 issue 732.
 LayoutTests/fast/text/line-breaks-after-hyphen-before-number_t01: Skip # co19 issue 732.
-LibTest/html/Window/document_A01_t01: RuntimeError # Issue 20146
-LibTest/html/Window/postMessage_A01_t02: RuntimeError # Issue 20146
-LibTest/html/Window/moveBy_A01_t01: RuntimeError # Issue 20146
 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.
 LayoutTests/fast/dom/HTMLButtonElement/change-type_t01: Skip # Test reloads itself. Issue 18558.
@@ -197,14 +214,12 @@
 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/IFrameElement/IFrameElement.created_A01_t01: RuntimeError # co19-roll r706.  Please triage this failure.
 LibTest/html/IFrameElement/appendHtml_A01_t01: 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/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 # co19-roll r706.  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.
@@ -223,7 +238,6 @@
 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/requestFileSystem_A02_t01: RuntimeError, Pass # co19-roll r706.  Please triage this failure.
 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/SendPort/send_A01_t01: RuntimeError # co19-roll r706.  Please triage this failure.
@@ -253,7 +267,6 @@
 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/HTMLOutputElement/dom-settable-token-list_t01: RuntimeError # Issue 18931
-LayoutTests/fast/dom/HTMLObjectElement/set-type-to-null-crash_t01: RuntimeError # Issue 18931
 LayoutTests/fast/dom/HTMLDialogElement/show-modal-focusing-steps_t01: RuntimeError # co19-roll r722: Please triage this failure.
 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.
@@ -292,13 +305,11 @@
 WebPlatformTest/shadow-dom/events/event-dispatch/test-001_t01: RuntimeError # co19-roll r722: 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 # 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: RuntimeError, Skip # co19-roll r722: Please triage this failure.
 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: RuntimeError, Pass # co19-roll r722: Please triage this failure.
 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.
@@ -323,7 +334,6 @@
 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/observe-attributes_t01: RuntimeError # Issue 18931
 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/initial-values_t01: RuntimeError # co19-roll r722: Please triage this failure.
@@ -369,9 +379,6 @@
 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-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/events/event-dispatch/test-002_t01: RuntimeError # Please triage this failure.
-WebPlatformTest/shadow-dom/events/retargeting-relatedtarget/test-001_t01: RuntimeError # Please triage this failure.
-WebPlatformTest/shadow-dom/events/retargeting-relatedtarget/test-002_t01: RuntimeError # Please triage this failure.
 WebPlatformTest/shadow-dom/shadow-trees/upper-boundary-encapsulation/test-009_t01: RuntimeError # Please triage this failure.
 
 LayoutTests/fast/dom/css-innerHTML_t01: RuntimeError # Test is incorrect.
@@ -388,8 +395,6 @@
 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-mediarule-functions_t01: RuntimeError # co19-roll r738: Please triage this failure.
-LayoutTests/fast/dom/custom/attribute-changed-callback_t01: RuntimeError # co19-roll r738: Please triage this failure.
 LayoutTests/fast/dom/custom/document-register-svg-extends_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/dataset_t01: RuntimeError # co19-roll r738: Please triage this failure.
@@ -413,7 +418,6 @@
 WebPlatformTest/DOMEvents/approved/addEventListener.optional.useCapture_t01: RuntimeError # co19-roll r738: 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: RuntimeError # co19-roll r738: Please triage this failure.
 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-namespace_t01: RuntimeError # co19-roll r738: Please triage this failure.
@@ -446,8 +450,6 @@
 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/alpha_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/canvas-2d-imageData-create-nonfinite_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-empty-image-pattern_t01: RuntimeError # co19-roll r761: Please triage this failure.
@@ -456,12 +458,9 @@
 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/canvas-putImageData_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/linearGradient-infinite-values_t01: RuntimeError # co19-roll r761: Please triage this failure.
-LayoutTests/fast/canvas/radialGradient-infinite-values_t01: RuntimeError # co19-roll r761: Please triage this failure.
 LayoutTests/fast/canvas/webgl/bad-arguments-test_t01: RuntimeError # co19-roll r761: Please triage this failure.
 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/context-attributes-alpha-depth-stencil-antialias-t01: RuntimeError # co19-roll r761: Please triage this failure.
@@ -576,6 +575,7 @@
 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/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/t05: RuntimeError # co19-roll r761: Please triage this failure.
@@ -679,9 +679,6 @@
 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_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/files/blob-constructor_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/files/file-reader-methods-illegal-arguments_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/files/url-null_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.
@@ -774,7 +771,6 @@
 WebPlatformTest/html/semantics/forms/the-input-element/password_t01: RuntimeError # co19-roll r786: Please triage this failure.
 WebPlatformTest/html/syntax/parsing/Document.getElementsByTagName-foreign_t02: RuntimeError # co19-roll r786: Please triage this failure.
 LayoutTests/fast/dom/52776_t01: RuntimeError # Please triage this failure.
-LayoutTests/fast/dom/DOMException/XPathException_t01: RuntimeError # Please triage this failure.
 LayoutTests/fast/dom/Node/fragment-mutation_t01: RuntimeError # Please triage this failure.
 LayoutTests/fast/dom/Range/bug-19527_t01: RuntimeError # Please triage this failure.
 LayoutTests/fast/dom/Range/insertNode-empty-fragment-crash_t01: RuntimeError # Please triage this failure.
@@ -784,9 +780,8 @@
 LayoutTests/fast/dom/Range/range-insertNode-separate-endContainer_t01: RuntimeError # Please triage this failure.
 LayoutTests/fast/dom/Range/range-insertNode-splittext_t01: RuntimeError # Please triage this failure.
 LayoutTests/fast/dom/document-importNode-arguments_t01: RuntimeError # Please triage this failure.
-LayoutTests/fast/dom/domparser-parsefromstring-mimetype-support_t01: RuntimeError # Please triage this failure.
 LayoutTests/fast/dom/horizontal-scrollbar-in-rtl_t01: RuntimeError # Please triage this failure.
-LayoutTests/fast/dom/text-api-arguments_t01: RuntimeError # Please triage this failure.
+
 
 # co19-roll r801
 LayoutTests/fast/canvas/webgl/canvas-test_t01: Pass, RuntimeError # co19-roll r801: Please triage this failure.
@@ -852,9 +847,7 @@
 LayoutTests/fast/loader/onhashchange-attribute-listeners_t01: Skip # Times out. co19-roll r801: 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/pushstate-updates-location_t01: RuntimeError # 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/loader/stateobjects/replacestate-updates-location_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.
@@ -942,7 +935,6 @@
 LayoutTests/fast/multicol/orphans-relayout_t01: Pass, RuntimeError
 LayoutTests/fast/multicol/zeroColumnCount_t01: RuntimeError
 LayoutTests/fast/media/media-query-serialization_t01: RuntimeError
-LayoutTests/fast/media/color-does-not-include-alpha_t01: RuntimeError
 LayoutTests/fast/media/mq-append-delete_t01: RuntimeError
 LayoutTests/fast/media/mq-color-index_t02: RuntimeError
 LayoutTests/fast/media/mq-js-media-except_t02: RuntimeError
@@ -1153,8 +1145,6 @@
 LayoutTests/fast/text/line-break-after-inline-latin1_t01: RuntimeError # co19-roll r786: Please triage this failure.
 LayoutTests/fast/url/trivial-segments_t01: RuntimeError # co19-roll r786: Please triage this failure.
 LayoutTests/fast/url/trivial_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/xmlhttprequest/xmlhttprequest-bad-mimetype_t01: RuntimeError # co19-roll r786: Please triage this failure.
-LayoutTests/fast/xmlhttprequest/xmlhttprequest-invalid-values_t01: RuntimeError # co19-roll r786: Please triage this failure.
 LayoutTests/fast/dom/HTMLDialogElement/top-layer-position-relative_t01: RuntimeError # Please triage this failure.
 LayoutTests/fast/dom/HTMLDialogElement/top-layer-position-static_t01: RuntimeError # Please triage this failure.
 
@@ -1328,6 +1318,10 @@
 LayoutTests/fast/css/fontfaceset-events_t01: Pass, RuntimeError # Issue 23433
 LayoutTests/fast/events/clipboard-dataTransferItemList-remove_t01: RuntimeError # Issue 22532
 LayoutTests/fast/forms/textarea-paste-newline_t01: Pass, RuntimeError # Issue 23433
+LayoutTests/fast/canvas/canvas-currentTransform_t01: RuntimeError # Feature is behind a flag in Chrome
+LayoutTests/fast/files/blob-close-revoke_t01: RuntimeError # Experimental feature not exposed anywhere yet
+LayoutTests/fast/forms/file/file-input-capture_t01: RuntimeError # Experimental feature not exposed in Chrome yet
+LayoutTests/fast/forms/input-inputmode_t01: RuntimeError # Experimental feature not exposed in Chrome yet
 
 [ $compiler == none && ($runtime == dartium || $runtime == ContentShellOnAndroid) && $system != windows ]
 LayoutTests/fast/css/font-face-unicode-range-monospace_t01: RuntimeError # co19-roll r761: Please triage this failure.
diff --git a/tests/co19/co19-runtime.status b/tests/co19/co19-runtime.status
index b5c5bc4c..e4edb77 100644
--- a/tests/co19/co19-runtime.status
+++ b/tests/co19/co19-runtime.status
@@ -84,3 +84,6 @@
 
 [ $runtime == vm && $mode == debug && $builder_tag == asan ]
 Language/15_Types/4_Interface_Types_A11_t01: Skip  # Issue 21174.
+
+[ $runtime == vm && $arch == arm ]
+LibTest/typed_data/Float32x4/operator_multiplication_A01_t01: Fail # Dart issue 24416
diff --git a/tests/compiler/dart2js/analyze_api_test.dart b/tests/compiler/dart2js/analyze_api_test.dart
index faeebaa..91b4ae2 100644
--- a/tests/compiler/dart2js/analyze_api_test.dart
+++ b/tests/compiler/dart2js/analyze_api_test.dart
@@ -24,7 +24,7 @@
 
 void main() {
   var uriList = new List<Uri>();
-  LIBRARIES.forEach((String name, LibraryInfo info) {
+  libraries.forEach((String name, LibraryInfo info) {
     if (info.documented) {
       uriList.add(new Uri(scheme: 'dart', path: name));
     }
diff --git a/tests/compiler/dart2js/analyze_dart2js_helpers_test.dart b/tests/compiler/dart2js/analyze_dart2js_helpers_test.dart
new file mode 100644
index 0000000..0787dd3
--- /dev/null
+++ b/tests/compiler/dart2js/analyze_dart2js_helpers_test.dart
@@ -0,0 +1,236 @@
+// 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 dart2js.analyze_helpers.test;
+
+import 'dart:io';
+
+import 'package:async_helper/async_helper.dart';
+import 'package:compiler/compiler_new.dart' show
+    Diagnostic;
+import 'package:compiler/src/apiimpl.dart' show
+    Compiler;
+import 'package:compiler/src/commandline_options.dart';
+import 'package:compiler/src/constants/expressions.dart' show
+    ConstructedConstantExpression;
+import 'package:compiler/src/dart_types.dart' show
+    InterfaceType;
+import 'package:compiler/src/diagnostics/source_span.dart' show
+    SourceSpan;
+import 'package:compiler/src/elements/elements.dart';
+import 'package:compiler/src/filenames.dart' show
+    nativeToUriPath;
+import 'package:compiler/src/resolution/semantic_visitor.dart';
+import 'package:compiler/src/resolution/tree_elements.dart' show
+    TreeElements;
+import 'package:compiler/src/source_file_provider.dart' show
+    FormattingDiagnosticHandler;
+import 'package:compiler/src/tree/tree.dart';
+import 'package:compiler/src/universe/call_structure.dart' show
+    CallStructure;
+import 'package:expect/expect.dart';
+
+import 'memory_compiler.dart';
+
+main(List<String> arguments) {
+  bool verbose = arguments.contains('-v');
+
+  List<String> options = <String>[
+    Flags.analyzeOnly,
+    Flags.analyzeMain,
+    '--categories=Client,Server'];
+  if (verbose) {
+    options.add(Flags.verbose);
+  }
+  asyncTest(() async {
+    Compiler compiler = compilerFor(
+        options: options, showDiagnostics: verbose);
+    FormattingDiagnosticHandler diagnostics =
+        new FormattingDiagnosticHandler(compiler.provider);
+    HelperAnalyzer analyzer = new HelperAnalyzer(diagnostics);
+    Directory dir =
+        new Directory.fromUri(Uri.base.resolve('pkg/compiler/lib/'));
+    for (FileSystemEntity entity in dir.listSync(recursive: true)) {
+      if (entity is File && entity.path.endsWith('.dart')) {
+        Uri file = Uri.base.resolve(nativeToUriPath(entity.path));
+        if (verbose) {
+          print('---- analyzing $file ----');
+        }
+        LibraryElement library = await compiler.analyzeUri(file);
+        if (library != null) {
+          library.forEachLocalMember((Element element) {
+            if (element is ClassElement) {
+              element.forEachLocalMember((AstElement member) {
+                analyzer.analyze(member.resolvedAst);
+              });
+            } else if (element is MemberElement) {
+              analyzer.analyze(element.resolvedAst);
+            }
+          });
+        }
+      }
+    }
+    Expect.isTrue(analyzer.errors.isEmpty, "Errors found.");
+  });
+}
+
+class HelperAnalyzer extends TraversalVisitor {
+  final FormattingDiagnosticHandler diagnostics;
+  List<SourceSpan> errors = <SourceSpan>[];
+
+  ResolvedAst resolvedAst;
+
+  @override
+  TreeElements get elements => resolvedAst.elements;
+
+  AnalyzableElement get analyzedElement => resolvedAst.element;
+
+  HelperAnalyzer(this.diagnostics) : super(null);
+
+  @override
+  void apply(Node node, [_]) {
+    node.accept(this);
+  }
+
+  void analyze(ResolvedAst resolvedAst) {
+    if (resolvedAst.node == null) {
+      // Skip synthesized members.
+      return;
+    }
+    this.resolvedAst = resolvedAst;
+    apply(resolvedAst.node);
+    this.resolvedAst = null;
+  }
+
+  bool isHelper(Element element) {
+    Uri uri = element.library.canonicalUri;
+    return uri.path.endsWith('src/helpers/helpers.dart');
+  }
+
+  void checkAccess(Node node, MemberElement element) {
+    if (isHelper(element) && !isHelper(analyzedElement)) {
+      Uri uri = analyzedElement.implementation.sourcePosition.uri;
+      SourceSpan span = new SourceSpan.fromNode(uri, node);
+      diagnostics.report(null, span.uri, span.begin, span.end,
+          "Helper used in production code.",
+          Diagnostic.ERROR);
+      errors.add(span);
+    }
+  }
+
+  @override
+  void visitTopLevelFieldInvoke(
+      Send node,
+      FieldElement field,
+      NodeList arguments,
+      CallStructure callStructure,
+      _) {
+    checkAccess(node, field);
+    apply(arguments);
+  }
+
+  @override
+  void visitTopLevelGetterInvoke(
+      Send node,
+      GetterElement getter,
+      NodeList arguments,
+      CallStructure callStructure,
+      _) {
+    checkAccess(node, getter);
+    apply(arguments);
+  }
+
+  @override
+  void visitTopLevelFunctionInvoke(
+      Send node,
+      MethodElement method,
+      NodeList arguments,
+      CallStructure callStructure,
+      _) {
+    checkAccess(node, method);
+    apply(arguments);
+  }
+
+  @override
+  void visitTopLevelFieldGet(
+      Send node,
+      FieldElement field,
+      _) {
+    checkAccess(node, field);
+  }
+
+  @override
+  void visitTopLevelGetterGet(
+      Send node,
+      GetterElement getter,
+      _) {
+    checkAccess(node, getter);
+  }
+
+  @override
+  void visitTopLevelFunctionGet(
+      Send node,
+      MethodElement method,
+      _) {
+    checkAccess(node, method);
+  }
+
+  @override
+  void visitGenerativeConstructorInvoke(
+      NewExpression node,
+      ConstructorElement constructor,
+      InterfaceType type,
+      NodeList arguments,
+      CallStructure callStructure,
+      _) {
+    checkAccess(node, constructor);
+    apply(arguments);
+  }
+
+  @override
+  void visitRedirectingGenerativeConstructorInvoke(
+      NewExpression node,
+      ConstructorElement constructor,
+      InterfaceType type,
+      NodeList arguments,
+      CallStructure callStructure,
+      _) {
+    checkAccess(node, constructor);
+    apply(arguments);
+  }
+
+  @override
+  void visitFactoryConstructorInvoke(
+      NewExpression node,
+      ConstructorElement constructor,
+      InterfaceType type,
+      NodeList arguments,
+      CallStructure callStructure,
+      _) {
+    checkAccess(node, constructor);
+    apply(arguments);
+  }
+
+  @override
+  void visitRedirectingFactoryConstructorInvoke(
+      NewExpression node,
+      ConstructorElement constructor,
+      InterfaceType type,
+      ConstructorElement effectiveTarget,
+      InterfaceType effectiveTargetType,
+      NodeList arguments,
+      CallStructure callStructure,
+      _) {
+    checkAccess(node, constructor);
+    apply(arguments);
+  }
+
+  @override
+  void visitConstConstructorInvoke(
+      NewExpression node,
+      ConstructedConstantExpression constant,
+      _) {
+    checkAccess(node, constant.target);
+  }
+}
\ No newline at end of file
diff --git a/tests/compiler/dart2js/analyze_dart2js_test.dart b/tests/compiler/dart2js/analyze_dart2js_test.dart
index 5fb720d..f5fc77c 100644
--- a/tests/compiler/dart2js/analyze_dart2js_test.dart
+++ b/tests/compiler/dart2js/analyze_dart2js_test.dart
@@ -4,10 +4,11 @@
 
 library analyze_dart2js;
 
-import "package:expect/expect.dart";
+import 'package:async_helper/async_helper.dart';
 import 'package:compiler/src/filenames.dart';
+import 'package:compiler/src/compiler.dart';
 import 'analyze_helper.dart';
-import "package:async_helper/async_helper.dart";
+import 'related_types.dart';
 
 /**
  * Map of whitelisted warnings and errors.
@@ -25,5 +26,11 @@
 
 void main() {
   var uri = currentDirectory.resolve('pkg/compiler/lib/src/dart2js.dart');
-  asyncTest(() => analyze([uri], WHITE_LIST));
+  asyncTest(() => analyze([uri], WHITE_LIST, checkResults: checkResults));
 }
+
+bool checkResults(Compiler compiler,
+                  CollectingDiagnosticHandler handler) {
+  checkRelatedTypes(compiler);
+  return !handler.hasHint;
+}
\ No newline at end of file
diff --git a/tests/compiler/dart2js/analyze_helper.dart b/tests/compiler/dart2js/analyze_helper.dart
index 3ed51d4..7d84392 100644
--- a/tests/compiler/dart2js/analyze_helper.dart
+++ b/tests/compiler/dart2js/analyze_helper.dart
@@ -8,8 +8,9 @@
 import 'dart:io';
 import 'package:compiler/compiler.dart' as api;
 import 'package:compiler/src/apiimpl.dart';
-import 'package:compiler/src/dart2jslib.dart'
-    hide Compiler;
+import 'package:compiler/src/commandline_options.dart';
+import 'package:compiler/src/diagnostics/messages.dart' show
+    Message;
 import 'package:compiler/src/filenames.dart';
 import 'package:compiler/src/source_file_provider.dart';
 import 'package:compiler/src/util/uri_extras.dart';
@@ -136,6 +137,7 @@
 Future analyze(List<Uri> uriList,
                Map<String, List<String>> whiteList,
                {bool analyzeAll: true,
+                bool analyzeMain: false,
                 CheckResults checkResults}) {
   String testFileName =
       relativize(Uri.base, Platform.script, Platform.isWindows);
@@ -155,9 +157,10 @@
       currentDirectory.resolveUri(new Uri.file('${Platform.packageRoot}/'));
   var provider = new CompilerSourceFileProvider();
   var handler = new CollectingDiagnosticHandler(whiteList, provider);
-  var options = <String>['--analyze-only', '--categories=Client,Server',
-    '--show-package-warnings'];
-  if (analyzeAll) options.add('--analyze-all');
+  var options = <String>[Flags.analyzeOnly, '--categories=Client,Server',
+      Flags.showPackageWarnings];
+  if (analyzeAll) options.add(Flags.analyzeAll);
+  if (analyzeMain) options.add(Flags.analyzeMain);
   var compiler = new Compiler(
       provider,
       null,
@@ -188,7 +191,7 @@
       exit(1);
     }
   }
-  if (analyzeAll) {
+  if (analyzeAll || analyzeMain) {
     compiler.librariesToAnalyzeWhenRun = uriList;
     return compiler.run(null).then(onCompletion);
   } else {
diff --git a/tests/compiler/dart2js/analyze_only_test.dart b/tests/compiler/dart2js/analyze_only_test.dart
index ff28085..08100a6 100644
--- a/tests/compiler/dart2js/analyze_only_test.dart
+++ b/tests/compiler/dart2js/analyze_only_test.dart
@@ -11,8 +11,8 @@
 
 import '../../utils/dummy_compiler_test.dart' as dummy;
 import 'package:compiler/compiler.dart';
-
-import 'package:compiler/src/warnings.dart' show
+import 'package:compiler/src/commandline_options.dart';
+import 'package:compiler/src/diagnostics/messages.dart' show
     MessageKind, MessageTemplate;
 
 import 'output_collector.dart';
@@ -64,7 +64,7 @@
 main() {
   runCompiler(
     "",
-    ['--generate-code-with-compile-time-errors'],
+    [Flags.generateCodeWithCompileTimeErrors],
     (String code, List errors, List warnings) {
       Expect.isNotNull(code);
       Expect.isTrue(errors.isEmpty, 'errors is not empty: $errors');
@@ -77,7 +77,7 @@
 
   runCompiler(
     "main() {}",
-    ['--generate-code-with-compile-time-errors'],
+    [Flags.generateCodeWithCompileTimeErrors],
     (String code, List errors, List warnings) {
       Expect.isNotNull(code);
       Expect.isTrue(errors.isEmpty);
@@ -86,7 +86,7 @@
 
   runCompiler(
     "",
-    ['--analyze-only'],
+    [Flags.analyzeOnly],
     (String code, List errors, List warnings) {
       Expect.isNull(code);
       Expect.isTrue(errors.isEmpty, 'errors is not empty: $errors');
@@ -99,7 +99,7 @@
 
   runCompiler(
     "main() {}",
-    ['--analyze-only'],
+    [Flags.analyzeOnly],
     (String code, List errors, List warnings) {
       Expect.isNull(code);
       Expect.isTrue(errors.isEmpty);
@@ -108,7 +108,7 @@
 
   runCompiler(
     "Foo foo; // Unresolved but not analyzed.",
-    ['--analyze-only'],
+    [Flags.analyzeOnly],
     (String code, List errors, List warnings) {
       Expect.isNull(code);
       Expect.isTrue(errors.isEmpty, 'errors is not empty: $errors');
@@ -123,7 +123,7 @@
     """main() {
          Foo foo; // Unresolved and analyzed.
        }""",
-    ['--analyze-only'],
+    [Flags.analyzeOnly],
     (String code, List errors, List warnings) {
       Expect.isNull(code);
       Expect.isTrue(errors.isEmpty);
@@ -136,7 +136,7 @@
     """main() {
          Foo foo; // Unresolved and analyzed.
        }""",
-    ['--analyze-only', '--analyze-signatures-only'],
+    [Flags.analyzeOnly, Flags.analyzeSignaturesOnly],
     (String code, List errors, List warnings) {
       Expect.isNull(code);
       Expect.isTrue(errors.isEmpty);
@@ -145,7 +145,7 @@
 
   runCompiler(
     "Foo foo; // Unresolved and analyzed.",
-    ['--analyze-only', '--analyze-all'],
+    [Flags.analyzeOnly, Flags.analyzeAll],
     (String code, List errors, List warnings) {
       Expect.isNull(code);
       Expect.isTrue(errors.isEmpty);
@@ -156,7 +156,7 @@
   runCompiler(
     """Foo foo; // Unresolved and analyzed.
        main() {}""",
-    ['--analyze-only', '--analyze-all'],
+    [Flags.analyzeOnly, Flags.analyzeAll],
     (String code, List errors, List warnings) {
       Expect.isNull(code);
       Expect.isTrue(errors.isEmpty, 'Unexpected errors: $errors.');
@@ -167,7 +167,7 @@
 
   runCompiler(
     "",
-    ['--analyze-only', '--analyze-all'],
+    [Flags.analyzeOnly, Flags.analyzeAll],
     (String code, List errors, List warnings) {
       Expect.isNull(code);
       Expect.isTrue(errors.isEmpty);
@@ -177,7 +177,7 @@
   // --analyze-signatures-only implies --analyze-only
   runCompiler(
     "",
-    ['--analyze-signatures-only', '--analyze-all'],
+    [Flags.analyzeSignaturesOnly, Flags.analyzeAll],
     (String code, List errors, List warnings) {
       Expect.isNull(code);
       Expect.isTrue(errors.isEmpty);
diff --git a/tests/compiler/dart2js/analyze_unused_dart2js_test.dart b/tests/compiler/dart2js/analyze_unused_dart2js_test.dart
index dc2aeef..90fc59b2 100644
--- a/tests/compiler/dart2js/analyze_unused_dart2js_test.dart
+++ b/tests/compiler/dart2js/analyze_unused_dart2js_test.dart
@@ -6,7 +6,8 @@
 
 import 'package:async_helper/async_helper.dart';
 
-import 'package:compiler/src/dart2jslib.dart';
+import 'package:compiler/src/compiler.dart';
+import 'package:compiler/src/diagnostics/messages.dart';
 import 'package:compiler/src/filenames.dart';
 
 import 'analyze_helper.dart';
@@ -17,9 +18,10 @@
   // Helper methods for debugging should never be called from production code:
   "lib/src/helpers/": const [" is never "],
 
-  // Node.asLiteralBool is never used.
+  // Node.asAssert, Node.asLiteralBool is never used.
   "lib/src/tree/nodes.dart": const [
-      "The method 'asLiteralBool' is never called"],
+      "The method 'asAssert' is never called.",
+      "The method 'asLiteralBool' is never called."],
 
   // Some things in dart_printer are not yet used
   "lib/src/dart_backend/backend_ast_nodes.dart": const [" is never "],
@@ -28,16 +30,15 @@
   "lib/src/resolution/semantic_visitor.dart": const [
       "The method 'error"],
   "lib/src/resolution/semantic_visitor_mixins.dart": const [
-      "The class 'Base", "The method 'error", "The method 'visit"],
+      "The class 'SuperBulkMixin'",
+      "The class 'Base",
+      "The method 'error",
+      "The method 'visit"],
 
   // Uncalled type predicate.  Keep while related predicates are used.
   "lib/src/ssa/nodes.dart": const [
       "The method 'isArray' is never called"],
 
-  // Method in abstract class. Currently only instantiated trough tests.
-  "lib/src/constants/expressions.dart": const [
-      "The method 'readFromEnvironment' is never called"],
-
   // Serialization code is only used in test.
   "lib/src/serialization/": const [
       "is never"],
@@ -55,16 +56,28 @@
     "accept", "CreateFunction",
   ],
 
-  "/lib/src/dart_backend/backend_ast_to_frontend_ast.dart": const [
+  "lib/src/dart_backend/backend_ast_to_frontend_ast.dart": const [
     " is never "
   ],
+
+  // Useful utility functions that are not currently used.
+  "lib/src/cps_ir/cps_fragment.dart": const [
+    "The method 'beginLoop' is never called.",
+    "The method 'continueLoop' is never called.",
+    "The method 'invokeMethod' is never called.",
+  ],
 };
 
 void main() {
   var uri = currentDirectory.resolve(
       'pkg/compiler/lib/src/use_unused_api.dart');
-  asyncTest(() => analyze([uri], WHITE_LIST,
-      analyzeAll: false, checkResults: checkResults));
+  asyncTest(() => analyze(
+      [uri],
+      // TODO(johnniwinther): Use [WHITE_LIST] again when
+      // [Compiler.reportUnusedCode] is reenabled.
+      const {}, // WHITE_LIST
+      analyzeAll: false,
+      checkResults: checkResults));
 }
 
 bool checkResults(Compiler compiler, CollectingDiagnosticHandler handler) {
@@ -72,20 +85,23 @@
       'pkg/compiler/lib/src/helpers/helpers.dart');
   void checkLive(member) {
     if (member.isFunction) {
-      if (compiler.enqueuer.resolution.hasBeenResolved(member)) {
-        compiler.reportHint(member, MessageKind.GENERIC,
+      if (compiler.enqueuer.resolution.hasBeenProcessed(member)) {
+        compiler.reporter.reportHintMessage(
+            member, MessageKind.GENERIC,
             {'text': "Helper function in production code '$member'."});
       }
     } else if (member.isClass) {
       if (member.isResolved) {
-        compiler.reportHint(member, MessageKind.GENERIC,
+        compiler.reporter.reportHintMessage(
+            member, MessageKind.GENERIC,
             {'text': "Helper class in production code '$member'."});
       } else {
         member.forEachLocalMember(checkLive);
       }
     } else if (member.isTypedef) {
       if (member.isResolved) {
-        compiler.reportHint(member, MessageKind.GENERIC,
+        compiler.reporter.reportHintMessage(
+            member, MessageKind.GENERIC,
             {'text': "Helper typedef in production code '$member'."});
       }
     }
diff --git a/tests/compiler/dart2js/arithmetic_simplification_test.dart b/tests/compiler/dart2js/arithmetic_simplification_test.dart
index 8b69d50..039a844 100644
--- a/tests/compiler/dart2js/arithmetic_simplification_test.dart
+++ b/tests/compiler/dart2js/arithmetic_simplification_test.dart
@@ -81,7 +81,8 @@
   asyncTest(() => Future.wait([
     compileAndDoNotMatch(INT_PLUS_ZERO, 'main', plusZero),
     compileAndDoNotMatch(ZERO_PLUS_INT, 'main', zeroPlus),
-    compileAndMatch(NUM_PLUS_ZERO, 'main', plusZero),
+    // TODO(johnniwinther): Find out why this doesn't work without [useMock].
+    compileAndMatch(NUM_PLUS_ZERO, 'main', plusZero, useMock: true),
     compileAndMatch(ZERO_PLUS_NUM, 'main', zeroPlus),
     compileAndDoNotMatch(INT_TIMES_ONE, 'main', timesOne),
     compileAndDoNotMatch(ONE_TIMES_INT, 'main', oneTimes),
diff --git a/tests/compiler/dart2js/array_static_intercept_test.dart b/tests/compiler/dart2js/array_static_intercept_test.dart
index d53e10b1..bd0a02f 100644
--- a/tests/compiler/dart2js/array_static_intercept_test.dart
+++ b/tests/compiler/dart2js/array_static_intercept_test.dart
@@ -18,6 +18,7 @@
   asyncTest(() => compile(TEST_ONE, entry: 'foo', check: (String generated) {
     Expect.isTrue(generated.contains(r'.add$1('));
     Expect.isTrue(generated.contains(r'.removeLast$0('));
-    Expect.isTrue(generated.contains(r'.length'));
+    Expect.isTrue(generated.contains(r'.length'),
+        "Unexpected code to contain '.length':\n$generated");
   }));
 }
diff --git a/tests/compiler/dart2js/array_tracing_mirror_test.dart b/tests/compiler/dart2js/array_tracing_mirror_test.dart
index 2c4c9aa..6a083ca 100644
--- a/tests/compiler/dart2js/array_tracing_mirror_test.dart
+++ b/tests/compiler/dart2js/array_tracing_mirror_test.dart
@@ -34,9 +34,10 @@
   asyncTest(() async {
     var result = await runCompiler(memorySourceFiles: MEMORY_SOURCE_FILES);
     var compiler = result.compiler;
-    var element = compiler.mainApp.findExported('main');
-    var code = compiler.backend.assembleCode(element);
-    Expect.isTrue(code.contains('return 2'));
+    var element = compiler.mainFunction;
+    var code = compiler.backend.getGeneratedCode(element);
+    Expect.isTrue(code.contains('return 2'),
+        "Unexpected code:\n$code");
   });
 }
 
diff --git a/tests/compiler/dart2js/async_await_js_transform_test.dart b/tests/compiler/dart2js/async_await_js_transform_test.dart
index 863f1c8..d0f4c85 100644
--- a/tests/compiler/dart2js/async_await_js_transform_test.dart
+++ b/tests/compiler/dart2js/async_await_js_transform_test.dart
@@ -7,8 +7,6 @@
 import "package:compiler/src/js/rewrite_async.dart";
 import "package:compiler/src/js_backend/js_backend.dart" show StringBackedName;
 
-import "backend_dart/dart_printer_test.dart" show PrintDiagnosticListener;
-
 void testTransform(String source, String expected, AsyncRewriterBase rewriter) {
   Fun fun = js(source);
   Fun rewritten = rewriter.rewrite(fun);
@@ -27,6 +25,7 @@
       null,
       asyncHelper: new VariableUse("thenHelper"),
       newCompleter: new VariableUse("Completer"),
+      wrapBody: new VariableUse("_wrapJsFunctionForAsync"),
       safeVariableName: (String name) => "__$name",
       bodyName: new StringBackedName("body")));
 }
@@ -44,6 +43,52 @@
 }
 
 main() {
+  testAsyncTransform(  /// 01: ok
+r"""function() async {
+  var closures = [new A.main_closure()], v0 = await closures, v1 = 0, v2, v3;
+  if (v1 < 0 || v1 >= v0.length)
+    H.ioore(v0, v1);
+  v2 = 4;
+  v3 = 2;
+  P.print(v0[v1].call$2(v2, v3));
+}"""
+,  /// 01: ok
+ r"""function() {
+  var __goto = 0, __completer = new Completer(), __handler = 1, __currentError, closures, v0, v1, v2, v3;
+  var body = _wrapJsFunctionForAsync(function(__errorCode, __result) {
+    if (__errorCode === 1) {
+      __currentError = __result;
+      __goto = __handler;
+    }
+    while (true)
+      switch (__goto) {
+        case 0:
+          // Function start
+          __goto = 2;
+        closures = [new A.main_closure()];
+        return thenHelper(closures, body, __completer);
+        case 2:
+          // returning from await.
+          v0 = __result, v1 = 0;
+          if (v1 < 0 || v1 >= v0.length)
+            H.ioore(v0, v1);
+          else
+            ;
+          v2 = 4;
+          v3 = 2;
+          P.print(v0[v1].call$2(v2, v3));
+          // implicit return
+          return thenHelper(null, 0, __completer, null);
+        case 1:
+          // rethrow
+          return thenHelper(__currentError, 1, __completer);
+      }
+  });
+  return thenHelper(null, body, __completer, null);
+}"""
+  )  /// 01: ok
+  ;
+
   testAsyncTransform("""
 function(a) async {
   print(this.x); // Ensure `this` is translated in the helper function.
@@ -51,7 +96,7 @@
 }""", """
 function(a) {
   var __goto = 0, __completer = new Completer(), __handler = 1, __currentError, __self = this;
-  function body(__errorCode, __result) {
+  var body = _wrapJsFunctionForAsync(function(__errorCode, __result) {
     if (__errorCode === 1) {
       __currentError = __result;
       __goto = __handler;
@@ -71,7 +116,7 @@
           // rethrow
           return thenHelper(__currentError, 1, __completer);
       }
-  }
+  });
   return thenHelper(null, body, __completer, null);
 }""");
 
@@ -101,7 +146,7 @@
   }""", """
 function(b) {
   var __goto = 0, __completer = new Completer(), __returnValue, __handler = 2, __currentError, __next = [], __helper;
-  function body(__errorCode, __result) {
+  var body = _wrapJsFunctionForAsync(function(__errorCode, __result) {
     if (__errorCode === 1) {
       __currentError = __result;
       __goto = __handler;
@@ -195,7 +240,7 @@
             // rethrow
             return thenHelper(__currentError, 1, __completer);
         }
-  }
+  });
   return thenHelper(null, body, __completer, null);
 }""");
 
@@ -211,7 +256,7 @@
 }""", """
 function(c) {
   var __goto = 0, __completer = new Completer(), __handler = 1, __currentError, a, b, c, d, e, f, __temp1;
-  function body(__errorCode, __result) {
+  var body = _wrapJsFunctionForAsync(function(__errorCode, __result) {
     if (__errorCode === 1) {
       __currentError = __result;
       __goto = __handler;
@@ -250,7 +295,7 @@
           // rethrow
           return thenHelper(__currentError, 1, __completer);
       }
-  }
+  });
   return thenHelper(null, body, __completer, null);
 }""");
 
@@ -268,7 +313,7 @@
   }""", """
 function(d2) {
   var __goto = 0, __completer = new Completer(), __handler = 1, __currentError, a, b, c, d, e, f, g, h, __temp1;
-  function body(__errorCode, __result) {
+  var body = _wrapJsFunctionForAsync(function(__errorCode, __result) {
     if (__errorCode === 1) {
       __currentError = __result;
       __goto = __handler;
@@ -383,7 +428,7 @@
           // rethrow
           return thenHelper(__currentError, 1, __completer);
       }
-  }
+  });
   return thenHelper(null, body, __completer, null);
 }""");
 
@@ -405,7 +450,7 @@
 }""", """
 function(x, y) {
   var __goto = 0, __completer = new Completer(), __handler = 1, __currentError;
-  function body(__errorCode, __result) {
+  var body = _wrapJsFunctionForAsync(function(__errorCode, __result) {
     if (__errorCode === 1) {
       __currentError = __result;
       __goto = __handler;
@@ -477,7 +522,7 @@
           // rethrow
           return thenHelper(__currentError, 1, __completer);
       }
-  }
+  });
   return thenHelper(null, body, __completer, null);
 }""");
 
@@ -494,7 +539,7 @@
   """, """
 function(f) {
   var __goto = 0, __completer = new Completer(), __handler = 1, __currentError, a;
-  function body(__errorCode, __result) {
+  var body = _wrapJsFunctionForAsync(function(__errorCode, __result) {
     if (__errorCode === 1) {
       __currentError = __result;
       __goto = __handler;
@@ -538,7 +583,7 @@
           // rethrow
           return thenHelper(__currentError, 1, __completer);
       }
-  }
+  });
   return thenHelper(null, body, __completer, null);
 }""");
 
@@ -559,7 +604,7 @@
 """, """
 function(g) {
   var __goto = 0, __completer = new Completer(), __returnValue, __handler = 2, __currentError, i, __temp1;
-  function body(__errorCode, __result) {
+  var body = _wrapJsFunctionForAsync(function(__errorCode, __result) {
     if (__errorCode === 1) {
       __currentError = __result;
       __goto = __handler;
@@ -628,7 +673,7 @@
           // rethrow
           return thenHelper(__currentError, 1, __completer);
       }
-  }
+  });
   return thenHelper(null, body, __completer, null);
 }""");
 
@@ -644,7 +689,7 @@
   """, """
 function(a, h) {
   var __goto = 0, __completer = new Completer(), __handler = 1, __currentError, x, __temp1, __temp2;
-  function body(__errorCode, __result) {
+  var body = _wrapJsFunctionForAsync(function(__errorCode, __result) {
     if (__errorCode === 1) {
       __currentError = __result;
       __goto = __handler;
@@ -703,7 +748,7 @@
           // rethrow
           return thenHelper(__currentError, 1, __completer);
       }
-  }
+  });
   return thenHelper(null, body, __completer, null);
 }""");
 
@@ -725,7 +770,7 @@
 """, """
 function(c, i) {
   var __goto = 0, __completer = new Completer(), __handler = 1, __currentError, __next = [], x, y, __error, __error1;
-  function body(__errorCode, __result) {
+  var body = _wrapJsFunctionForAsync(function(__errorCode, __result) {
     if (__errorCode === 1) {
       __currentError = __result;
       __goto = __handler;
@@ -820,7 +865,7 @@
           // rethrow
           return thenHelper(__currentError, 1, __completer);
       }
-  }
+  });
   return thenHelper(null, body, __completer, null);
 }""");
 
@@ -835,7 +880,7 @@
   """, """
 function(x, y, j) {
   var __goto = 0, __completer = new Completer(), __handler = 1, __currentError, __temp1, __temp2, __temp3;
-  function body(__errorCode, __result) {
+  var body = _wrapJsFunctionForAsync(function(__errorCode, __result) {
     if (__errorCode === 1) {
       __currentError = __result;
       __goto = __handler;
@@ -886,7 +931,7 @@
           // rethrow
           return thenHelper(__currentError, 1, __completer);
       }
-  }
+  });
   return thenHelper(null, body, __completer, null);
 }""");
 
@@ -918,7 +963,7 @@
 }""", """
 function(x, y, k) {
   var __goto = 0, __completer = new Completer(), __returnValue, __handler = 2, __currentError, __temp1;
-  function body(__errorCode, __result) {
+  var body = _wrapJsFunctionForAsync(function(__errorCode, __result) {
     if (__errorCode === 1) {
       __currentError = __result;
       __goto = __handler;
@@ -1026,7 +1071,7 @@
           // rethrow
           return thenHelper(__currentError, 1, __completer);
       }
-  }
+  });
   return thenHelper(null, body, __completer, null);
 }""");
 
@@ -1046,7 +1091,7 @@
   }""", """
 function(l) {
   var __goto = 0, __completer = new Completer(), __handler = 1, __currentError;
-  function body(__errorCode, __result) {
+  var body = _wrapJsFunctionForAsync(function(__errorCode, __result) {
     if (__errorCode === 1) {
       __currentError = __result;
       __goto = __handler;
@@ -1075,7 +1120,7 @@
           // rethrow
           return thenHelper(__currentError, 1, __completer);
       }
-  }
+  });
   return thenHelper(null, body, __completer, null);
 }""");
 
@@ -1098,7 +1143,7 @@
   }""", """
 function(m) {
   var __goto = 0, __completer = new Completer(), __handler = 1, __currentError, __next = [], exception, __exception;
-  function body(__errorCode, __result) {
+  var body = _wrapJsFunctionForAsync(function(__errorCode, __result) {
     if (__errorCode === 1) {
       __currentError = __result;
       __goto = __handler;
@@ -1154,7 +1199,7 @@
           // rethrow
           return thenHelper(__currentError, 1, __completer);
       }
-  }
+  });
   return thenHelper(null, body, __completer, null);
 }""");
 
diff --git a/tests/compiler/dart2js/backend_dart/dart_backend_test.dart b/tests/compiler/dart2js/backend_dart/dart_backend_test.dart
index ea10c9c..597f056 100644
--- a/tests/compiler/dart2js/backend_dart/dart_backend_test.dart
+++ b/tests/compiler/dart2js/backend_dart/dart_backend_test.dart
@@ -9,7 +9,7 @@
 import '../mock_libraries.dart';
 import '../output_collector.dart';
 import 'package:compiler/compiler.dart';
-import 'package:compiler/src/dart2jslib.dart' as leg;
+import 'package:compiler/src/common/names.dart' show Identifiers;
 import 'package:compiler/src/dart_backend/dart_backend.dart';
 import 'package:compiler/src/elements/elements.dart';
 import 'package:compiler/src/tree/tree.dart';
@@ -614,7 +614,8 @@
 
 PlaceholderCollector collectPlaceholders(compiler, element) {
   DartBackend backend = compiler.backend;
-  return new PlaceholderCollector(compiler,
+  return new PlaceholderCollector(
+      compiler.reporter,
       backend.mirrorRenamer,
       new Set<String>(),
       new DynoMap(compiler),
@@ -633,7 +634,7 @@
   asyncTest(() => compiler.init().then((_) {
     assert(compiler.backend is DartBackend);
     compiler.parseScript(src);
-    FunctionElement mainElement = compiler.mainApp.find(leg.Compiler.MAIN);
+    FunctionElement mainElement = compiler.mainApp.find(Identifiers.main);
     compiler.processQueue(compiler.enqueuer.resolution, mainElement);
     PlaceholderCollector collector = collectPlaceholders(compiler, mainElement);
     FunctionExpression mainNode = mainElement.node;
diff --git a/tests/compiler/dart2js/backend_dart/dart_printer_test.dart b/tests/compiler/dart2js/backend_dart/dart_printer_test.dart
index 407b149..88eabca 100644
--- a/tests/compiler/dart2js/backend_dart/dart_printer_test.dart
+++ b/tests/compiler/dart2js/backend_dart/dart_printer_test.dart
@@ -4,18 +4,24 @@
 
 library dart_printer_test;
 
-import "package:expect/expect.dart";
+import 'dart:mirrors';
+import 'package:expect/expect.dart';
 import 'package:compiler/src/constants/values.dart';
 import 'package:compiler/src/dart_backend/backend_ast_nodes.dart';
-import 'package:compiler/src/scanner/scannerlib.dart';
-import 'package:compiler/src/io/source_file.dart';
-import 'package:compiler/src/dart2jslib.dart';
-import 'package:compiler/src/tree/tree.dart' show DartString;
-import 'dart:mirrors';
-import 'package:compiler/src/tree/tree.dart' as tree;
-import 'package:compiler/src/string_validator.dart';
 import 'package:compiler/src/dart_backend/backend_ast_to_frontend_ast.dart'
     show TreePrinter;
+import 'package:compiler/src/diagnostics/diagnostic_listener.dart';
+import 'package:compiler/src/diagnostics/messages.dart';
+import 'package:compiler/src/diagnostics/spannable.dart' show Spannable;
+import 'package:compiler/src/parser/listener.dart';
+import 'package:compiler/src/parser/parser.dart';
+import 'package:compiler/src/scanner/scanner.dart';
+import 'package:compiler/src/tokens/token.dart';
+import 'package:compiler/src/tokens/token_constants.dart';
+import 'package:compiler/src/io/source_file.dart';
+import 'package:compiler/src/string_validator.dart';
+import 'package:compiler/src/tree/tree.dart' show DartString;
+import 'package:compiler/src/tree/tree.dart' as tree;
 
 /// For debugging the [AstBuilder] stack. Prints information about [x].
 void show(x) {
@@ -45,7 +51,7 @@
   print("${x.runtimeType}: ${buf.toString()}");
 }
 
-class PrintDiagnosticListener implements DiagnosticListener {
+class PrintDiagnosticListener implements DiagnosticReporter {
   void log(message) {
     print(message);
   }
@@ -581,9 +587,14 @@
     push(new ForIn(declaredIdentifier, exp, body));
   }
 
-  handleAssertStatement(Token assertKeyword, Token semicolonToken) {
+  handleAssertStatement(Token assertKeyword,
+                        Token commaToken, Token semicolonToken) {
+    Expression message;
+    if (commaToken != null) message = pop();
     Expression exp = pop();
-    Expression call = new CallFunction(new Identifier("assert"), [exp]);
+    var arguments = [exp];
+    if (message != null) arguments.add(message);
+    Expression call = new CallFunction(new Identifier("assert"), arguments);
     push(new ExpressionStatement(call));
   }
 
diff --git a/tests/compiler/dart2js/backend_dart/end2end_test.dart b/tests/compiler/dart2js/backend_dart/end2end_test.dart
index 3a7f902..60156c7 100644
--- a/tests/compiler/dart2js/backend_dart/end2end_test.dart
+++ b/tests/compiler/dart2js/backend_dart/end2end_test.dart
@@ -6,7 +6,7 @@
 library dart_backend.end2end_test;
 
 import 'package:async_helper/async_helper.dart';
-import 'package:compiler/src/dart2jslib.dart';
+import 'package:compiler/src/compiler.dart';
 import 'package:compiler/src/dart_backend/dart_backend.dart';
 import 'package:expect/expect.dart';
 
diff --git a/tests/compiler/dart2js/backend_dart/sexpr2_test.dart b/tests/compiler/dart2js/backend_dart/sexpr2_test.dart
index 71d294b..03803bd 100644
--- a/tests/compiler/dart2js/backend_dart/sexpr2_test.dart
+++ b/tests/compiler/dart2js/backend_dart/sexpr2_test.dart
@@ -5,7 +5,7 @@
 /// Unittest test of the CPS ir generated by the dart2dart compiler.
 library dart_backend.sexpr2_test;
 
-import 'package:compiler/src/dart2jslib.dart';
+import 'package:compiler/src/compiler.dart';
 import 'package:compiler/src/cps_ir/cps_ir_nodes.dart';
 import 'package:compiler/src/cps_ir/cps_ir_nodes_sexpr.dart';
 import 'package:compiler/src/elements/elements.dart';
diff --git a/tests/compiler/dart2js/backend_dart/sexpr_test.dart b/tests/compiler/dart2js/backend_dart/sexpr_test.dart
index bbe09e2..2293cdb 100644
--- a/tests/compiler/dart2js/backend_dart/sexpr_test.dart
+++ b/tests/compiler/dart2js/backend_dart/sexpr_test.dart
@@ -7,7 +7,7 @@
 import 'dart:async';
 
 import 'package:async_helper/async_helper.dart';
-import 'package:compiler/src/dart2jslib.dart';
+import 'package:compiler/src/compiler.dart';
 import 'package:compiler/src/cps_ir/cps_ir_nodes.dart';
 import 'package:compiler/src/cps_ir/cps_ir_nodes_sexpr.dart';
 import 'package:expect/expect.dart';
diff --git a/tests/compiler/dart2js/backend_dart/sexpr_unstringifier.dart b/tests/compiler/dart2js/backend_dart/sexpr_unstringifier.dart
index df70baf..e0252e7 100644
--- a/tests/compiler/dart2js/backend_dart/sexpr_unstringifier.dart
+++ b/tests/compiler/dart2js/backend_dart/sexpr_unstringifier.dart
@@ -9,16 +9,18 @@
 
 import 'package:compiler/src/constants/expressions.dart';
 import 'package:compiler/src/constants/values.dart';
-import 'package:compiler/src/dart2jslib.dart' as dart2js
-    show MessageKind;
 import 'package:compiler/src/dart_types.dart' as dart_types
     show DartType;
+import 'package:compiler/src/diagnostics/messages.dart'
+    show MessageKind;
 import 'package:compiler/src/elements/elements.dart';
 import 'package:compiler/src/elements/modelx.dart'
     show ErroneousElementX, TypeVariableElementX;
 import 'package:compiler/src/tree/tree.dart' show LiteralDartString;
-import 'package:compiler/src/universe/universe.dart'
-    show Selector, SelectorKind, CallStructure;
+import 'package:compiler/src/universe/call_structure.dart'
+    show CallStructure;
+import 'package:compiler/src/universe/selector.dart'
+    show Selector, SelectorKind;
 import 'package:compiler/src/cps_ir/cps_ir_nodes.dart';
 
 /// Used whenever a node constructed by [SExpressionUnstringifier] needs a
@@ -48,7 +50,7 @@
 class DummyElement extends ErroneousElementX
     implements TypeVariableElement, FieldElement {
   DummyElement(String name)
-      : super(dart2js.MessageKind.GENERIC, {}, name, null);
+      : super(MessageKind.GENERIC, {}, name, null);
 
   final dart_types.DartType bound = null;
   final TypeDeclarationElement typeDeclaration = null;
diff --git a/tests/compiler/dart2js/backend_dart/test_helper.dart b/tests/compiler/dart2js/backend_dart/test_helper.dart
index a355d7e..0eeb656 100644
--- a/tests/compiler/dart2js/backend_dart/test_helper.dart
+++ b/tests/compiler/dart2js/backend_dart/test_helper.dart
@@ -7,7 +7,7 @@
 import 'dart:async';
 import 'package:async_helper/async_helper.dart';
 import 'package:compiler/compiler.dart' as api;
-import 'package:compiler/src/dart2jslib.dart';
+import 'package:compiler/src/compiler.dart';
 import '../../../../pkg/analyzer2dart/test/test_helper.dart';
 import '../compiler_helper.dart';
 
diff --git a/tests/compiler/dart2js/bad_loop_test.dart b/tests/compiler/dart2js/bad_loop_test.dart
index 82d8607..bd1053c 100644
--- a/tests/compiler/dart2js/bad_loop_test.dart
+++ b/tests/compiler/dart2js/bad_loop_test.dart
@@ -8,6 +8,7 @@
 
 import 'package:compiler/compiler.dart'
        show Diagnostic;
+import 'package:compiler/src/commandline_options.dart';
 import 'package:compiler/src/old_to_new_api.dart';
 
 main() {
@@ -38,7 +39,7 @@
       new LegacyCompilerDiagnostics(diagnosticHandler),
       libraryRoot,
       packageRoot,
-      ['--analyze-only'],
+      [Flags.analyzeOnly],
       {});
   asyncTest(() => compiler.run(Uri.parse('memory:main.dart')).then((_) {
     Expect.isTrue(compiler.compilationFailed);
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 0c94f8e..41ed1ba 100644
--- a/tests/compiler/dart2js/call_site_simple_type_inferer_test.dart
+++ b/tests/compiler/dart2js/call_site_simple_type_inferer_test.dart
@@ -4,11 +4,8 @@
 
 import 'package:expect/expect.dart';
 import "package:async_helper/async_helper.dart";
-import 'package:compiler/src/types/types.dart'
-    show TypeMask;
 
 import 'compiler_helper.dart';
-import 'parser_helper.dart';
 import 'type_mask_test_helper.dart';
 
 void compileAndFind(String code,
@@ -221,7 +218,7 @@
     enableInlining,
     (compiler, element) {
       var expectedTypes = f(compiler);
-      var signature = element.computeSignature(compiler);
+      var signature = element.functionSignature;
       int index = 0;
       var inferrer = compiler.typesTask.typesInferrer;
       signature.forEachParameter((Element element) {
diff --git a/tests/compiler/dart2js/categories_test.dart b/tests/compiler/dart2js/categories_test.dart
new file mode 100644
index 0000000..3b22453
--- /dev/null
+++ b/tests/compiler/dart2js/categories_test.dart
@@ -0,0 +1,35 @@
+// 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 "package:expect/expect.dart";
+import 'package:async_helper/async_helper.dart';
+
+import "memory_compiler.dart";
+
+runTest(String source, String categories, int expectedErrors) async {
+  var collector = new DiagnosticCollector();
+  await runCompiler(
+      memorySourceFiles: {"main.dart": source},
+      options: ["--categories=$categories"],
+      diagnosticHandler: collector);
+  Expect.equals(expectedErrors, collector.errors.length);
+  Expect.equals(0, collector.warnings.length);
+}
+
+void main() {
+  asyncTest(() async {
+    await runTest("import 'dart:async'; main() {}", "Embedded", 1);
+    await runTest("import 'dart:async'; main() {}", "Client", 0);
+    await runTest("import 'dart:async'; main() {}", "Server", 0);
+    await runTest("import 'dart:html'; main() {}", "Embedded", 1);
+    await runTest("import 'dart:html'; main() {}", "Client", 0);
+    await runTest("import 'dart:html'; main() {}", "Server", 1);
+    await runTest("import 'dart:io'; main() {}", "Embedded", 1);
+    await runTest("import 'dart:io'; main() {}", "Client", 1);
+    await runTest("import 'dart:io'; main() {}", "Server", 0);
+    await runTest("import 'dart:_internal'; main() {}", "Embedded", 2);
+    await runTest("import 'dart:_internal'; main() {}", "Client", 2);
+    await runTest("import 'dart:_internal'; main() {}", "Server", 2);
+  });
+}
diff --git a/tests/compiler/dart2js/class_codegen2_test.dart b/tests/compiler/dart2js/class_codegen2_test.dart
index 0169e4e..7b4f479 100644
--- a/tests/compiler/dart2js/class_codegen2_test.dart
+++ b/tests/compiler/dart2js/class_codegen2_test.dart
@@ -7,7 +7,6 @@
 import "package:expect/expect.dart";
 import "package:async_helper/async_helper.dart";
 import 'compiler_helper.dart';
-import 'parser_helper.dart';
 
 const String TEST_ONE = r"""
 class A { foo() => 499; }
diff --git a/tests/compiler/dart2js/class_codegen_test.dart b/tests/compiler/dart2js/class_codegen_test.dart
index 13c21f0..58c49bd 100644
--- a/tests/compiler/dart2js/class_codegen_test.dart
+++ b/tests/compiler/dart2js/class_codegen_test.dart
@@ -3,11 +3,9 @@
 // BSD-style license that can be found in the LICENSE file.
 // Test that parameters keep their names in the output.
 
-import 'dart:async';
 import "package:expect/expect.dart";
 import "package:async_helper/async_helper.dart";
 import 'compiler_helper.dart';
-import 'parser_helper.dart';
 
 const String TEST_ONE = r"""
 class A { }
diff --git a/tests/compiler/dart2js/class_set_test.dart b/tests/compiler/dart2js/class_set_test.dart
index cd8abdd..c3ee031 100644
--- a/tests/compiler/dart2js/class_set_test.dart
+++ b/tests/compiler/dart2js/class_set_test.dart
@@ -11,9 +11,9 @@
 import 'type_test_helper.dart';
 import 'package:compiler/src/elements/elements.dart'
        show Element, ClassElement;
-import 'package:compiler/src/dart2jslib.dart';
 import 'package:compiler/src/universe/class_set.dart';
 import 'package:compiler/src/util/util.dart';
+import 'package:compiler/src/world.dart';
 
 void main() {
   asyncTest(() => TypeEnvironment.create(r"""
@@ -55,7 +55,7 @@
     void checkClass(ClassElement cls,
                     {bool directlyInstantiated: false,
                      bool indirectlyInstantiated: false}) {
-      ClassHierarchyNode node = world.classHierarchyNode(cls);
+      ClassHierarchyNode node = world.getClassHierarchyNode(cls);
       Expect.isNotNull(node, "Expected ClassHierarchyNode for $cls.");
       Expect.equals(
           directlyInstantiated || indirectlyInstantiated,
@@ -131,7 +131,7 @@
     }
 
     iterator = new ClassHierarchyNodeIterable(
-        world.classHierarchyNode(G)).iterator;
+        world.getClassHierarchyNode(G)).iterator;
     checkState(G, currentNode: null, stack: null);
     Expect.isNull(iterator.current);
     Expect.isTrue(iterator.moveNext());
@@ -142,7 +142,8 @@
     Expect.isNull(iterator.current);
 
     iterator = new ClassHierarchyNodeIterable(
-        world.classHierarchyNode(G), includeRoot: false).iterator;
+        world.getClassHierarchyNode(G),
+        includeRoot: false).iterator;
     checkState(G, currentNode: null, stack: null);
     Expect.isNull(iterator.current);
     Expect.isFalse(iterator.moveNext());
@@ -150,7 +151,7 @@
     Expect.isNull(iterator.current);
 
     iterator = new ClassHierarchyNodeIterable(
-        world.classHierarchyNode(C)).iterator;
+        world.getClassHierarchyNode(C)).iterator;
     checkState(C, currentNode: null, stack: null);
     Expect.isNull(iterator.current);
     Expect.isTrue(iterator.moveNext());
@@ -170,7 +171,7 @@
     Expect.isNull(iterator.current);
 
     iterator = new ClassHierarchyNodeIterable(
-        world.classHierarchyNode(D)).iterator;
+        world.getClassHierarchyNode(D)).iterator;
     checkState(D, currentNode: null, stack: null);
     Expect.isNull(iterator.current);
     Expect.isTrue(iterator.moveNext());
@@ -181,7 +182,7 @@
     Expect.isNull(iterator.current);
 
     iterator = new ClassHierarchyNodeIterable(
-        world.classHierarchyNode(B)).iterator;
+        world.getClassHierarchyNode(B)).iterator;
     checkState(B, currentNode: null, stack: null);
     Expect.isNull(iterator.current);
     Expect.isTrue(iterator.moveNext());
@@ -195,7 +196,8 @@
     Expect.isNull(iterator.current);
 
     iterator = new ClassHierarchyNodeIterable(
-        world.classHierarchyNode(B), includeRoot: false).iterator;
+        world.getClassHierarchyNode(B),
+        includeRoot: false).iterator;
     checkState(B, currentNode: null, stack: null);
     Expect.isNull(iterator.current);
     Expect.isTrue(iterator.moveNext());
@@ -206,7 +208,8 @@
     Expect.isNull(iterator.current);
 
     iterator = new ClassHierarchyNodeIterable(
-        world.classHierarchyNode(B), directlyInstantiatedOnly: true).iterator;
+        world.getClassHierarchyNode(B),
+        includeIndirectlyInstantiated: false).iterator;
     checkState(B, currentNode: null, stack: null);
     Expect.isNull(iterator.current);
     Expect.isTrue(iterator.moveNext());
@@ -217,7 +220,7 @@
     Expect.isNull(iterator.current);
 
     iterator = new ClassHierarchyNodeIterable(
-        world.classHierarchyNode(A)).iterator;
+        world.getClassHierarchyNode(A)).iterator;
     checkState(A, currentNode: null, stack: null);
     Expect.isNull(iterator.current);
     Expect.isTrue(iterator.moveNext());
@@ -246,7 +249,8 @@
     Expect.isNull(iterator.current);
 
     iterator = new ClassHierarchyNodeIterable(
-        world.classHierarchyNode(A), includeRoot: false).iterator;
+        world.getClassHierarchyNode(A),
+        includeRoot: false).iterator;
     checkState(A, currentNode: null, stack: null);
     Expect.isNull(iterator.current);
     Expect.isTrue(iterator.moveNext());
@@ -272,7 +276,8 @@
     Expect.isNull(iterator.current);
 
     iterator = new ClassHierarchyNodeIterable(
-        world.classHierarchyNode(A), directlyInstantiatedOnly: true).iterator;
+        world.getClassHierarchyNode(A),
+        includeIndirectlyInstantiated: false).iterator;
     checkState(A, currentNode: null, stack: null);
     Expect.isNull(iterator.current);
     Expect.isTrue(iterator.moveNext());
@@ -298,8 +303,9 @@
     Expect.isNull(iterator.current);
 
     iterator = new ClassHierarchyNodeIterable(
-        world.classHierarchyNode(A),
-        includeRoot: false, directlyInstantiatedOnly: true).iterator;
+        world.getClassHierarchyNode(A),
+        includeRoot: false,
+        includeIndirectlyInstantiated: false).iterator;
     checkState(A, currentNode: null, stack: null);
     Expect.isNull(iterator.current);
     Expect.isTrue(iterator.moveNext());
diff --git a/tests/compiler/dart2js/closure_tracer_test.dart b/tests/compiler/dart2js/closure_tracer_test.dart
index 8d68083..8053c01 100644
--- a/tests/compiler/dart2js/closure_tracer_test.dart
+++ b/tests/compiler/dart2js/closure_tracer_test.dart
@@ -6,7 +6,6 @@
 import "package:async_helper/async_helper.dart";
 
 import 'compiler_helper.dart';
-import 'parser_helper.dart';
 import 'type_mask_test_helper.dart';
 
 const String TEST = '''
diff --git a/tests/compiler/dart2js/codegen_helper.dart b/tests/compiler/dart2js/codegen_helper.dart
index 1512442..36fadff 100644
--- a/tests/compiler/dart2js/codegen_helper.dart
+++ b/tests/compiler/dart2js/codegen_helper.dart
@@ -31,7 +31,7 @@
     for (var element in backend.generatedCode.keys) {
       if (element.compilationUnit.script.readableUri != uri) continue;
       var name = element.name;
-      var code = backend.assembleCode(element);
+      var code = backend.getGeneratedCode(element);
       result[name] = code;
     }
     return result;
diff --git a/tests/compiler/dart2js/combinator_hint_test.dart b/tests/compiler/dart2js/combinator_hint_test.dart
new file mode 100644
index 0000000..f8b9c26
--- /dev/null
+++ b/tests/compiler/dart2js/combinator_hint_test.dart
@@ -0,0 +1,125 @@
+// 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.
+
+// Test that the hint on empty combinators works as intended.
+
+import 'dart:async';
+import 'package:async_helper/async_helper.dart';
+import 'package:expect/expect.dart';
+import 'package:compiler/src/commandline_options.dart';
+import 'package:compiler/src/compiler.dart';
+import 'memory_compiler.dart';
+
+const SOURCE = const {
+  'show_local.dart': """
+import 'lib.dart' show Foo;
+
+main() {}
+""",
+
+  'hide_local.dart': """
+import 'lib.dart' hide Foo;
+
+main() {}
+""",
+
+  'show_package.dart': """
+import 'package:pkg/pkg.dart' show Foo;
+
+main() {}
+""",
+
+  'hide_package.dart': """
+import 'package:pkg/pkg.dart' hide Foo;
+
+main() {}
+""",
+
+  'lib.dart': '',
+
+  'pkg/pkg/pkg.dart': '',
+};
+
+Future<Compiler> test(Uri entryPoint,
+                      {bool showPackageWarnings: false,
+                       bool suppressHints: false,
+                       int hints: 0,
+                       Compiler cachedCompiler}) async {
+  print('==================================================================');
+  print('test: $entryPoint showPackageWarnings=$showPackageWarnings '
+        'suppressHints=$suppressHints');
+  var options = [Flags.analyzeOnly];
+  if (showPackageWarnings) {
+    options.add(Flags.showPackageWarnings);
+  }
+  if (suppressHints) {
+    options.add(Flags.suppressHints);
+  }
+  var collector = new DiagnosticCollector();
+  CompilationResult result = await runCompiler(
+      entryPoint: entryPoint,
+      memorySourceFiles: SOURCE,
+      options: options,
+      packageRoot: Uri.parse('memory:pkg/'),
+      diagnosticHandler: collector,
+      cachedCompiler: cachedCompiler);
+  Expect.equals(0, collector.errors.length,
+                'Unexpected errors: ${collector.errors}');
+  Expect.equals(0, collector.warnings.length,
+                'Unexpected warnings: ${collector.warnings}');
+  Expect.equals(hints, collector.hints.length,
+                'Unexpected hints: ${collector.hints}');
+  Expect.equals(0, collector.infos.length,
+                'Unexpected infos: ${collector.infos}');
+  print('==================================================================');
+  return result.compiler;
+}
+
+Future<Compiler> testUri(Uri entrypoint,
+                         {bool suppressed: false,
+                          Compiler cachedCompiler}) async {
+  cachedCompiler = await test(
+      entrypoint,
+      showPackageWarnings: true,
+      suppressHints: false,
+      hints: 1,
+      cachedCompiler: cachedCompiler);
+  cachedCompiler = await test(
+      entrypoint,
+      showPackageWarnings: false,
+      suppressHints: false,
+      hints: suppressed ? 0 : 1,
+      cachedCompiler: cachedCompiler);
+  cachedCompiler = await test(
+      entrypoint,
+      showPackageWarnings: true,
+      suppressHints: true,
+      hints: 0,
+      cachedCompiler: cachedCompiler);
+  cachedCompiler = await test(
+      entrypoint,
+      showPackageWarnings: false,
+      suppressHints: true,
+      hints: 0,
+      cachedCompiler: cachedCompiler);
+  return cachedCompiler;
+}
+
+void main() {
+  asyncTest(() async {
+    Compiler cachedCompiler = await testUri(
+        Uri.parse('memory:show_local.dart'));
+    cachedCompiler = await testUri(
+        Uri.parse('memory:hide_local.dart'),
+        cachedCompiler: cachedCompiler);
+    cachedCompiler = await testUri(
+        Uri.parse('memory:show_package.dart'),
+        cachedCompiler: cachedCompiler);
+    cachedCompiler = await testUri(
+        Uri.parse('memory:hide_package.dart'),
+        suppressed: true,
+        cachedCompiler: cachedCompiler);
+  });
+}
+
diff --git a/tests/compiler/dart2js/compile_with_empty_libraries_test.dart b/tests/compiler/dart2js/compile_with_empty_libraries_test.dart
new file mode 100644
index 0000000..b133d85
--- /dev/null
+++ b/tests/compiler/dart2js/compile_with_empty_libraries_test.dart
@@ -0,0 +1,18 @@
+// 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.
+
+/// Test that the dart2js compiler can compile an empty script without
+/// references to core library definitions.
+
+import 'package:async_helper/async_helper.dart';
+import 'mock_compiler.dart';
+
+const String TEST = r"main() {}";
+
+main() {
+  Uri uri = new Uri(scheme: 'source');
+  MockCompiler compiler =
+    new MockCompiler.internal(librariesOverride: (_) => '');
+  asyncTest(() => compiler.runCompiler(uri));
+}
diff --git a/tests/compiler/dart2js/compiler_helper.dart b/tests/compiler/dart2js/compiler_helper.dart
index ce972e5..d3ac2ac 100644
--- a/tests/compiler/dart2js/compiler_helper.dart
+++ b/tests/compiler/dart2js/compiler_helper.dart
@@ -7,8 +7,6 @@
 import 'dart:async';
 import "package:expect/expect.dart";
 
-import 'package:compiler/compiler.dart' as api;
-
 import 'package:compiler/src/elements/elements.dart'
        as lego;
 export 'package:compiler/src/elements/elements.dart';
@@ -16,17 +14,13 @@
 import 'package:compiler/src/js_backend/js_backend.dart'
        as js;
 
-import 'package:compiler/src/dart2jslib.dart'
-       as leg;
-export 'package:compiler/src/dart2jslib.dart'
-       show Constant,
-            Message,
-            MessageKind,
-            MessageTemplate,
-            Selector,
-            TypedSelector,
-            SourceSpan,
-            World;
+import 'package:compiler/src/commandline_options.dart';
+import 'package:compiler/src/common/codegen.dart';
+import 'package:compiler/src/common/resolution.dart';
+
+export 'package:compiler/src/diagnostics/messages.dart';
+export 'package:compiler/src/diagnostics/source_span.dart';
+export 'package:compiler/src/diagnostics/spannable.dart';
 
 import 'package:compiler/src/types/types.dart'
        as types;
@@ -36,7 +30,7 @@
 import 'package:compiler/src/util/util.dart';
 export 'package:compiler/src/util/util.dart';
 
-import 'package:compiler/src/dart2jslib.dart'
+import 'package:compiler/src/compiler.dart'
        show Compiler;
 
 export 'package:compiler/src/tree/tree.dart';
@@ -44,24 +38,35 @@
 import 'mock_compiler.dart';
 export 'mock_compiler.dart';
 
+import 'memory_compiler.dart' hide compilerFor;
+
 import 'output_collector.dart';
 export 'output_collector.dart';
 
+/// Compile [code] and returns the code for [entry].
+///
+/// If [check] is provided, it is executed on the code for [entry] before
+/// returning. If [useMock] is `true` the [MockCompiler] is used for
+/// compilation, otherwise the memory compiler is used.
 Future<String> compile(String code,
                        {String entry: 'main',
                         bool enableTypeAssertions: false,
                         bool minify: false,
                         bool analyzeAll: false,
                         bool disableInlining: true,
-                        void check(String generated)}) {
-  MockCompiler compiler = new MockCompiler.internal(
-      enableTypeAssertions: enableTypeAssertions,
-      // Type inference does not run when manually
-      // compiling a method.
-      disableTypeInference: true,
-      enableMinification: minify,
-      disableInlining: disableInlining);
-  return compiler.init().then((_) {
+                        bool useMock: false,
+                        void check(String generated)}) async {
+  if (useMock) {
+    // TODO(johnniwinther): Remove this when no longer needed by
+    // `arithmetic_simplication_test.dart`.
+    MockCompiler compiler = new MockCompiler.internal(
+        enableTypeAssertions: enableTypeAssertions,
+        // Type inference does not run when manually
+        // compiling a method.
+        disableTypeInference: true,
+        enableMinification: minify,
+        disableInlining: disableInlining);
+    await compiler.init();
     compiler.parseScript(code);
     lego.Element element = compiler.mainApp.find(entry);
     if (element == null) return null;
@@ -72,46 +77,57 @@
     compiler.world.populate();
     compiler.backend.onResolutionComplete();
     var context = new js.JavaScriptItemCompilationContext();
-    leg.ResolutionWorkItem resolutionWork =
-        new leg.ResolutionWorkItem(element, context);
+    ResolutionWorkItem resolutionWork =
+        new ResolutionWorkItem(element, context);
     resolutionWork.run(compiler, compiler.enqueuer.resolution);
-    leg.CodegenWorkItem work =
-        new leg.CodegenWorkItem(compiler, element, context);
+    CodegenWorkItem work =
+        new CodegenWorkItem(compiler, element, context);
     compiler.phase = Compiler.PHASE_COMPILING;
     work.run(compiler, compiler.enqueuer.codegen);
     js.JavaScriptBackend backend = compiler.backend;
-    String generated = backend.assembleCode(element);
+    String generated = backend.getGeneratedCode(element);
     if (check != null) {
       check(generated);
     }
     return generated;
-  });
-}
+  } else {
+    List<String> options = <String>[
+        Flags.disableTypeInference];
+    if (enableTypeAssertions) {
+      options.add(Flags.enableCheckedMode);
+    }
+    if (minify) {
+      options.add(Flags.minify);
+    }
+    if (analyzeAll) {
+      options.add(Flags.analyzeAll);
+    }
 
-// TODO(herhut): Disallow warnings and errors during compilation by default.
-MockCompiler compilerFor(String code, Uri uri,
-                         {bool analyzeAll: false,
-                          bool analyzeOnly: false,
-                          Map<String, String> coreSource,
-                          bool disableInlining: true,
-                          bool minify: false,
-                          bool trustTypeAnnotations: false,
-                          int expectedErrors,
-                          int expectedWarnings,
-                          api.CompilerOutputProvider outputProvider}) {
-  MockCompiler compiler = new MockCompiler.internal(
-      analyzeAll: analyzeAll,
-      analyzeOnly: analyzeOnly,
-      coreSource: coreSource,
-      disableInlining: disableInlining,
-      enableMinification: minify,
-      trustTypeAnnotations: trustTypeAnnotations,
-      expectedErrors: expectedErrors,
-      expectedWarnings: expectedWarnings,
-      outputProvider: outputProvider);
-  compiler.registerSource(uri, code);
-  compiler.diagnosticHandler = createHandler(compiler, code);
-  return compiler;
+    Map<String, String> source;
+    if (entry != 'main') {
+      source = {'main.dart': "$code\n\nmain() => $entry;" };
+    } else {
+      source = {'main.dart': code};
+    }
+
+    CompilationResult result = await runCompiler(
+        memorySourceFiles: source,
+        options: options,
+        beforeRun: (compiler) {
+          if (disableInlining) {
+            compiler.disableInlining = true;
+          }
+        });
+    Expect.isTrue(result.isSuccess);
+    Compiler compiler =  result.compiler;
+    lego.Element element = compiler.mainApp.find(entry);
+    js.JavaScriptBackend backend = compiler.backend;
+    String generated = backend.getGeneratedCode(element);
+    if (check != null) {
+      check(generated);
+    }
+    return generated;
+  }
 }
 
 Future<String> compileAll(String code,
@@ -228,8 +244,11 @@
   Expect.isFalse(hasNext, "Found more than $nb matches");
 }
 
-Future compileAndMatch(String code, String entry, RegExp regexp) {
-  return compile(code, entry: entry, check: (String generated) {
+Future compileAndMatch(String code, String entry, RegExp regexp,
+                       {bool useMock: false}) {
+  return compile(code, entry: entry,
+      useMock: useMock,
+      check: (String generated) {
     Expect.isTrue(regexp.hasMatch(generated),
                   '"$generated" does not match /$regexp/');
   });
diff --git a/tests/compiler/dart2js/compiler_test.dart b/tests/compiler/dart2js/compiler_test.dart
index 6e16da6..74f9b17 100644
--- a/tests/compiler/dart2js/compiler_test.dart
+++ b/tests/compiler/dart2js/compiler_test.dart
@@ -5,15 +5,26 @@
 import "dart:async";
 import "package:expect/expect.dart";
 import "package:async_helper/async_helper.dart";
-import "package:compiler/src/dart2jslib.dart";
 import "package:compiler/src/elements/elements.dart";
-import "package:compiler/src/resolution/resolution.dart";
-import "package:compiler/src/util/util.dart";
+import "package:compiler/src/resolution/members.dart";
+import "package:compiler/src/diagnostics/diagnostic_listener.dart";
 import "mock_compiler.dart";
+import "diagnostic_reporter_helper.dart";
 
 
 class CallbackMockCompiler extends MockCompiler {
-  CallbackMockCompiler() : super.internal();
+  CallbackReporter reporter;
+
+  CallbackMockCompiler() : super.internal() {
+    reporter = new CallbackReporter(super.reporter);
+  }
+
+}
+
+class CallbackReporter extends DiagnosticReporterWrapper {
+  final DiagnosticReporter reporter;
+
+  CallbackReporter(this.reporter);
 
   var onError;
   var onWarning;
@@ -21,24 +32,22 @@
   setOnError(var f) => onError = f;
   setOnWarning(var f) => onWarning = f;
 
-  void reportWarning(Spannable node,
-                     MessageKind messageKind,
-                     [Map arguments = const {}]) {
+  void reportWarning(
+      DiagnosticMessage message,
+      [List<DiagnosticMessage> infos = const <DiagnosticMessage>[]]) {
     if (onWarning != null) {
-      MessageTemplate template = MessageTemplate.TEMPLATES[messageKind];
-      onWarning(this, node, template.message(arguments));
+      onWarning(this, message.spannable, message.message);
     }
-    super.reportWarning(node, messageKind, arguments);
+    super.reportWarning(message, infos);
   }
 
-  void reportError(Spannable node,
-                   MessageKind messageKind,
-                   [Map arguments = const {}]) {
+  void reportError(
+      DiagnosticMessage message,
+      [List<DiagnosticMessage> infos = const <DiagnosticMessage>[]]) {
     if (onError != null) {
-      MessageTemplate template = MessageTemplate.TEMPLATES[messageKind];
-      onError(this, node, template.message(arguments));
+      onError(this, message.spannable, message.message);
     }
-    super.reportError(node, messageKind, arguments);
+    super.reportError(message, infos);
   }
 }
 
@@ -50,9 +59,9 @@
     ResolverVisitor visitor = compiler.resolverVisitor();
     compiler.parseScript('NoSuchPrefix.NoSuchType foo() {}');
     FunctionElement foo = compiler.mainApp.find('foo');
-    compiler.setOnWarning(
+    compiler.reporter.setOnWarning(
         (c, n, m) => Expect.equals(foo, compiler.currentElement));
-    foo.computeType(compiler);
+    foo.computeType(compiler.resolution);
     Expect.equals(1, compiler.warnings.length);
   });
 }
diff --git a/tests/compiler/dart2js/concrete_type_inference_test.dart b/tests/compiler/dart2js/concrete_type_inference_test.dart
index fb94801..8a53a44 100644
--- a/tests/compiler/dart2js/concrete_type_inference_test.dart
+++ b/tests/compiler/dart2js/concrete_type_inference_test.dart
@@ -3,10 +3,9 @@
 // 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";
+import 'package:expect/expect.dart';
+import 'package:async_helper/async_helper.dart';
 import 'compiler_helper.dart';
-import 'parser_helper.dart';
 
 Future compileAndFind(String code, String name,
                     check(compiler, element)) {
@@ -24,7 +23,7 @@
       'print',
       (compiler, printElement) {
         var parameter =
-          printElement.computeSignature(compiler).requiredParameters.first;
+          printElement.functionSignature.requiredParameters.first;
         var type = compiler.typesTask.getGuaranteedTypeOfElement(parameter);
         checkType(compiler, type);
       }));
@@ -34,7 +33,7 @@
       'print',
       (compiler, printElement) {
         var parameter =
-          printElement.computeSignature(compiler).requiredParameters.first;
+          printElement.functionSignature.requiredParameters.first;
         var type = compiler.typesTask.getGuaranteedTypeOfElement(parameter);
         checkType(compiler, type);
       }));
@@ -44,7 +43,7 @@
       'print',
       (compiler, printElement) {
         var parameter =
-          printElement.computeSignature(compiler).requiredParameters.first;
+          printElement.functionSignature.requiredParameters.first;
         var type = compiler.typesTask.getGuaranteedTypeOfElement(parameter);
         checkType(compiler, type);
       }));
@@ -52,28 +51,23 @@
 
 void testBasicTypes() {
   checkPrintType('true', (compiler, type) {
-    var inferrer = compiler.typesTask.typesInferrer;
+    if (type.isForwarding) type = type.forwardTo;
     Expect.identical(compiler.typesTask.boolType, type);
   });
   checkPrintType('1.5', (compiler, type) {
-    var inferrer = compiler.typesTask.typesInferrer;
     Expect.identical(compiler.typesTask.doubleType, type);
   });
   checkPrintType('1', (compiler, type) {
-    var inferrer = compiler.typesTask.typesInferrer;
     Expect.identical(compiler.typesTask.uint31Type, type);
   });
   checkPrintType('[]', (compiler, type) {
-    var inferrer = compiler.typesTask.typesInferrer;
     if (type.isForwarding) type = type.forwardTo;
     Expect.identical(compiler.typesTask.growableListType, type);
   });
   checkPrintType('null', (compiler, type) {
-    var inferrer = compiler.typesTask.typesInferrer;
     Expect.identical(compiler.typesTask.nullType, type);
   });
   checkPrintType('"foo"', (compiler, type) {
-    var inferrer = compiler.typesTask.typesInferrer;
     Expect.isTrue(
         compiler.typesTask.stringType.containsOnlyString(compiler.world));
   });
@@ -84,14 +78,13 @@
       'fisk(a, [b, c]) {} main() { fisk(1); }',
       'fisk',
       (compiler, fiskElement) {
-        var firstParameter =
-          fiskElement.computeSignature(compiler).requiredParameters[0];
-        var secondParameter =
-          fiskElement.computeSignature(compiler).optionalParameters[0];
-        var thirdParameter =
-          fiskElement.computeSignature(compiler).optionalParameters[1];
+        var firstParameter = fiskElement.functionSignature
+            .requiredParameters[0];
+        var secondParameter = fiskElement.functionSignature
+          .optionalParameters[0];
+        var thirdParameter = fiskElement.functionSignature
+          .optionalParameters[1];
         var typesTask = compiler.typesTask;
-        var inferrer = typesTask.typesInferrer;
         Expect.identical(
             typesTask.uint31Type,
             typesTask.getGuaranteedTypeOfElement(firstParameter));
diff --git a/tests/compiler/dart2js/constant_expression_evaluate_test.dart b/tests/compiler/dart2js/constant_expression_evaluate_test.dart
index fba3a20..5fa34cc 100644
--- a/tests/compiler/dart2js/constant_expression_evaluate_test.dart
+++ b/tests/compiler/dart2js/constant_expression_evaluate_test.dart
@@ -7,10 +7,11 @@
 import 'dart:async';
 import 'package:async_helper/async_helper.dart';
 import 'package:expect/expect.dart';
+import 'package:compiler/src/constants/evaluation.dart';
 import 'package:compiler/src/constants/expressions.dart';
 import 'package:compiler/src/constants/values.dart';
 import 'package:compiler/src/constant_system_dart.dart';
-import 'package:compiler/src/dart2jslib.dart';
+import 'package:compiler/src/compiler.dart';
 import 'package:compiler/src/elements/elements.dart';
 import 'memory_compiler.dart';
 
diff --git a/tests/compiler/dart2js/constant_expression_test.dart b/tests/compiler/dart2js/constant_expression_test.dart
index 166a0ae..e028ac6 100644
--- a/tests/compiler/dart2js/constant_expression_test.dart
+++ b/tests/compiler/dart2js/constant_expression_test.dart
@@ -8,7 +8,7 @@
 import 'package:async_helper/async_helper.dart';
 import 'package:expect/expect.dart';
 import 'package:compiler/src/constants/expressions.dart';
-import 'package:compiler/src/dart2jslib.dart';
+import 'package:compiler/src/compiler.dart';
 import 'package:compiler/src/elements/elements.dart';
 import 'memory_compiler.dart';
 
diff --git a/tests/compiler/dart2js/constant_folding_codeUnitAt_test.dart b/tests/compiler/dart2js/constant_folding_codeUnitAt_test.dart
index 1238724..0bb8f6f 100644
--- a/tests/compiler/dart2js/constant_folding_codeUnitAt_test.dart
+++ b/tests/compiler/dart2js/constant_folding_codeUnitAt_test.dart
@@ -4,7 +4,6 @@
 // Test constant folding on numbers.
 
 import 'dart:async';
-import 'package:expect/expect.dart';
 import 'package:async_helper/async_helper.dart';
 import 'compiler_helper.dart';
 
diff --git a/tests/compiler/dart2js/cpa_inference_test.dart b/tests/compiler/dart2js/cpa_inference_test.dart
deleted file mode 100644
index 0d36b71..0000000
--- a/tests/compiler/dart2js/cpa_inference_test.dart
+++ /dev/null
@@ -1,2152 +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.
-
-import 'dart:async';
-import "package:expect/expect.dart";
-import "package:async_helper/async_helper.dart";
-import 'package:compiler/src/types/types.dart';
-import 'package:compiler/src/inferrer/concrete_types_inferrer.dart';
-
-import "compiler_helper.dart";
-import "type_mask_test_helper.dart";
-
-/**
- * Finds the node corresponding to the last occurence of the substring
- * [: identifier; :] in the program represented by the visited AST.
- */
-class VariableFinderVisitor extends Visitor {
-  final String identifier;
-  Node result;
-
-  VariableFinderVisitor(this.identifier);
-
-  visitSend(Send node) {
-    if (node.isPropertyAccess
-        && node.selector.asIdentifier().source == identifier) {
-      result = node;
-    } else {
-      node.visitChildren(this);
-    }
-  }
-
-  visitNode(Node node) {
-    node.visitChildren(this);
-  }
-}
-
-class AnalysisResult {
-  MockCompiler compiler;
-  ConcreteTypesInferrer inferrer;
-  Node ast;
-
-  BaseType int;
-  BaseType double;
-  BaseType num;
-  BaseType bool;
-  BaseType string;
-  BaseType list;
-  BaseType growableList;
-  BaseType map;
-  BaseType nullType;
-  BaseType functionType;
-
-  AnalysisResult(MockCompiler compiler) : this.compiler = compiler {
-    inferrer = compiler.typesTask.concreteTypesInferrer;
-    int = inferrer.baseTypes.intBaseType;
-    double = inferrer.baseTypes.doubleBaseType;
-    num = inferrer.baseTypes.numBaseType;
-    bool = inferrer.baseTypes.boolBaseType;
-    string = inferrer.baseTypes.stringBaseType;
-    list = inferrer.baseTypes.listBaseType;
-    growableList = inferrer.baseTypes.growableListBaseType;
-    map = inferrer.baseTypes.mapBaseType;
-    nullType = const NullBaseType();
-    functionType = inferrer.baseTypes.functionBaseType;
-    FunctionElement mainElement = compiler.mainApp.find('main');
-    ast = mainElement.node;
-  }
-
-  BaseType base(String className) {
-    final source = className;
-    return new ClassBaseType(compiler.mainApp.find(source));
-  }
-
-  /**
-   * Finds the [Node] corresponding to the last occurence of the substring
-   * [: identifier; :] in the program represented by the visited AST. For
-   * instance, returns the AST node representing [: foo; :] in
-   * [: main() { foo = 1; foo; } :].
-   */
-  Node findNode(String identifier) {
-    VariableFinderVisitor finder = new VariableFinderVisitor(identifier);
-    ast.accept(finder);
-    return finder.result;
-  }
-
-  /**
-   * Finds the [Element] corresponding to [: className#fieldName :].
-   */
-  Element findField(String className, String fieldName) {
-    ClassElement element = compiler.mainApp.find(className);
-    return element.lookupLocalMember(fieldName);
-  }
-
-  ConcreteType concreteFrom(List<BaseType> baseTypes) {
-    ConcreteType result = inferrer.emptyConcreteType;
-    for (final baseType in baseTypes) {
-      result = result.union(inferrer.singletonConcreteType(baseType));
-    }
-    // We make sure the concrete types expected by the tests don't default to
-    // dynamic because of widening.
-    assert(!result.isUnknown());
-    return result;
-  }
-
-  /**
-   * Checks that the inferred type of the node corresponding to the last
-   * occurence of [: variable; :] in the program is the concrete type
-   * made of [baseTypes].
-   */
-  void checkNodeHasType(String variable, List<BaseType> baseTypes) {
-    Expect.equals(
-        concreteFrom(baseTypes),
-        inferrer.inferredTypes[findNode(variable)]);
-  }
-
-  /**
-   * Checks that the inferred type of the node corresponding to the last
-   * occurence of [: variable; :] in the program is the unknown concrete type.
-   */
-  void checkNodeHasUnknownType(String variable) {
-    Expect.isTrue(inferrer.inferredTypes[findNode(variable)].isUnknown());
-  }
-
-  /**
-   * Checks that [: className#fieldName :]'s inferred type is the concrete type
-   * made of [baseTypes].
-   */
-  void checkFieldHasType(String className, String fieldName,
-                         List<BaseType> baseTypes) {
-    Expect.equals(
-        concreteFrom(baseTypes),
-        inferrer.inferredFieldTypes[findField(className, fieldName)]);
-  }
-
-  /**
-   * Checks that [: className#fieldName :]'s inferred type is the unknown
-   * concrete type.
-   */
-  void checkFieldHasUknownType(String className, String fieldName) {
-    Expect.isTrue(
-        inferrer.inferredFieldTypes[findField(className, fieldName)]
-                .isUnknown());
-  }
-
-  /** Checks that the inferred type for [selector] is [mask]. */
-  void checkSelectorHasType(Selector selector,
-                            TypeMask mask,
-                            TypeMask expectedMask) {
-    Expect.equals(expectedMask, inferrer.getTypeOfSelector(selector, mask));
-  }
-}
-
-const String DYNAMIC = '"__dynamic_for_test"';
-
-Future<AnalysisResult> analyze(String code, {int maxConcreteTypeSize: 1000}) {
-  Uri uri = new Uri(scheme: 'dart', path: 'test');
-  MockCompiler compiler = new MockCompiler.internal(
-      enableConcreteTypeInference: true,
-      maxConcreteTypeSize: maxConcreteTypeSize);
-  compiler.registerSource(uri, code);
-  compiler.typesTask.concreteTypesInferrer.testMode = true;
-  return compiler.runCompiler(uri).then((_) {
-    return new AnalysisResult(compiler);
-  });
-}
-
-testDynamicBackDoor() {
-  final String source = """
-    main () {
-      var x = $DYNAMIC;
-      x;
-    }
-    """;
-  return analyze(source).then((result) {
-    result.checkNodeHasUnknownType('x');
-  });
-}
-
-testVariableDeclaration() {
-  final String source = r"""
-      main() {
-        var v1;
-        var v2;
-        v2 = 1;
-        v1; v2;
-      }
-      """;
-  return analyze(source).then((result) {
-    result.checkNodeHasType('v1', [result.nullType]);
-    result.checkNodeHasType('v2', [result.int]);
-  });
-}
-
-testLiterals() {
-  final String source = r"""
-      main() {
-        var v1 = 42;
-        var v2 = 42.1;
-        var v3 = 'abc';
-        var v4 = true;
-        var v5 = null;
-        v1; v2; v3; v4; v5;
-      }
-      """;
-  return analyze(source).then((result) {
-    result.checkNodeHasType('v1', [result.int]);
-    result.checkNodeHasType('v2', [result.double]);
-    result.checkNodeHasType('v3', [result.string]);
-    result.checkNodeHasType('v4', [result.bool]);
-    result.checkNodeHasType('v5', [result.nullType]);
-  });
-}
-
-testRedefinition() {
-  final String source = r"""
-      main() {
-        var foo = 42;
-        foo = 'abc';
-        foo;
-      }
-      """;
-  return analyze(source).then((result) {
-    result.checkNodeHasType('foo', [result.string]);
-  });
-}
-
-testIfThenElse() {
-  final String source = r"""
-      main() {
-        var foo = 42;
-        if (true) {
-          foo = 'abc';
-        } else {
-          foo = false;
-        }
-        foo;
-      }
-      """;
-  return analyze(source).then((result) {
-    result.checkNodeHasType('foo', [result.string, result.bool]);
-  });
-}
-
-testTernaryIf() {
-  final String source = r"""
-      main() {
-        var foo = 42;
-        foo = true ? 'abc' : false;
-        foo;
-      }
-      """;
-  return analyze(source).then((result) {
-    result.checkNodeHasType('foo', [result.string, result.bool]);
-  });
-}
-
-testWhile() {
-  final String source = r"""
-      class A { f() => new B(); }
-      class B { f() => new C(); }
-      class C { f() => new A(); }
-      main() {
-        var bar = null;
-        var foo = new A();
-        while(bar = 42) {
-          foo = foo.f();
-        }
-        foo; bar;
-      }
-      """;
-  return analyze(source).then((result) {
-    result.checkNodeHasType(
-        'foo',
-        [result.base('A'), result.base('B'), result.base('C')]);
-    // Check that the condition is evaluated.
-    // TODO(polux): bar's type could be inferred to be {int} here.
-    result.checkNodeHasType('bar', [result.int, result.nullType]);
-  });
-}
-
-testDoWhile() {
-  final String source = r"""
-      class A { f() => new B(); }
-      class B { f() => new C(); }
-      class C { f() => new A(); }
-      main() {
-        var bar = null;
-        var foo = new A();
-        do {
-          foo = foo.f();
-        } while (bar = 42);
-        foo; bar;
-      }
-      """;
-  return analyze(source).then((AnalysisResult result) {
-    result.checkNodeHasType(
-        'foo',
-        [result.base('A'), result.base('B'), result.base('C')]);
-    // Check that the condition is evaluated.
-    result.checkNodeHasType('bar', [result.int]);
-  });
-}
-
-testFor1() {
-  final String source = r"""
-      class A { f() => new B(); }
-      class B { f() => new C(); }
-      class C { f() => new A(); }
-      main() {
-        var foo = new A();
-        for(;;) {
-          foo = foo.f();
-        }
-        foo;
-      }
-      """;
-  return analyze(source).then((result) {
-    result.checkNodeHasType(
-        'foo',
-        [result.base('A'), result.base('B'), result.base('C')]);
-  });
-}
-
-testFor2() {
-  final String source = r"""
-      class A { f() => new B(); test() => true; }
-      class B { f() => new A(); test() => true; }
-      main() {
-        var bar = null;
-        var foo = new A();
-        for(var i = new A(); bar = 42; i = i.f()) {
-           foo = i;
-        }
-        foo; bar;
-      }
-      """;
-  return analyze(source).then((result) {
-    result.checkNodeHasType('foo', [result.base('A'), result.base('B')]);
-    // Check that the condition is evaluated.
-    // TODO(polux): bar's type could be inferred to be {int} here.
-    result.checkNodeHasType('bar', [result.int, result.nullType]);
-  });
-}
-
-testFor3() {
-  final String source = r"""
-      main() {
-        var i = 1;
-        for(;;) {
-          var x = 2;
-          i = x;
-        }
-        i;
-      }
-      """;
-  return analyze(source).then((result) {
-    result.checkNodeHasType('i', [result.int]);
-  });
-}
-
-testForIn() {
-  final String source = r"""
-      class MyIterator {
-        var counter = 0;
-
-        moveNext() {
-          if (counter == 0) {
-            counter = 1;
-            return true;
-          } else if (counter == 1) {
-            counter = 2;
-            return true;
-          } else {
-            return false;
-          }
-        }
-
-        get current => (counter == 1) ? "foo" : 42;
-      }
-
-      class MyIterable {
-        get iterator => new MyIterator();
-      }
-
-      main() {
-        var res;
-        for (var i in new MyIterable()) {
-          res = i;
-        }
-        res;
-      }
-      """;
-  return analyze(source).then((AnalysisResult result) {
-    result.checkNodeHasType('res',
-        [result.int, result.string, result.nullType]);
-  });
-}
-
-testToplevelVariable() {
-  final String source = r"""
-      final top = 'abc';
-      class A {
-         f() => top;
-      }
-      main() {
-        var foo = top;
-        var bar = new A().f();
-        foo; bar;
-      }
-      """;
-  return analyze(source).then((result) {
-    result.checkNodeHasType('foo', [result.string]);
-    result.checkNodeHasType('bar', [result.string]);
-  });
-}
-
-testToplevelVariable2() {
-  final String source = r"""
-      class A {
-        var x;
-      }
-      final top = new A().x;
-
-      main() {
-        var a = new A();
-        a.x = 42;
-        a.x = "abc";
-        var foo = top;
-        foo;
-      }
-      """;
-  return analyze(source).then((result) {
-    result.checkNodeHasType('foo', [result.nullType, result.int,
-                                    result.string]);
-  });
-}
-
-testToplevelVariable3() {
-  final String source = r"""
-      var top = "a";
-
-      f() => top;
-
-      main() {
-        var foo = f();
-        var bar = top;
-        top = 42;
-        var baz = top;
-        foo; bar; baz;
-      }
-      """;
-  return analyze(source).then((result) {
-    result.checkNodeHasType('foo', [result.int, result.string]);
-    result.checkNodeHasType('bar', [result.int, result.string]);
-    result.checkNodeHasType('baz', [result.int, result.string]);
-  });
-}
-
-testNonRecusiveFunction() {
-  final String source = r"""
-      f(x, y) => true ? x : y;
-      main() { var foo = f(42, "abc"); foo; }
-      """;
-  return analyze(source).then((result) {
-    result.checkNodeHasType('foo', [result.int, result.string]);
-  });
-}
-
-testMultipleReturns() {
-  final String source = r"""
-      f(x, y) {
-        if (true) return x;
-        else return y;
-      }
-      main() { var foo = f(42, "abc"); foo; }
-      """;
-  return analyze(source).then((result) {
-    result.checkNodeHasType('foo', [result.int, result.string]);
-  });
-}
-
-testRecusiveFunction() {
-  final String source = r"""
-      f(x) {
-        if (true) return x;
-        else return f(true ? x : "abc");
-      }
-      main() { var foo = f(42); foo; }
-      """;
-  return analyze(source).then((result) {
-    result.checkNodeHasType('foo', [result.int, result.string]);
-  });
-}
-
-testMutuallyRecusiveFunction() {
-  final String source = r"""
-      f() => true ? 42 : g();
-      g() => true ? "abc" : f();
-      main() { var foo = f(); foo; }
-      """;
-  return analyze(source).then((result) {
-    result.checkNodeHasType('foo', [result.int, result.string]);
-  });
-}
-
-testSimpleSend() {
-  final String source = """
-      class A {
-        f(x) => x;
-      }
-      class B {
-        f(x) => 'abc';
-      }
-      class C {
-        f(x) => 3.14;
-      }
-      class D {
-        var f;  // we check that this field is ignored in calls to dynamic.f()
-        D(this.f);
-      }
-      main() {
-        new B(); new D(42); // we instantiate B and D but not C
-        var foo = new A().f(42);
-        var bar = $DYNAMIC.f(42);
-        foo; bar;
-      }
-      """;
-  return analyze(source).then((result) {
-    result.checkNodeHasType('foo', [result.int]);
-    result.checkNodeHasType('bar', [result.int, result.string]);
-  });
-}
-
-testSendToThis1() {
-  final String source = r"""
-      class A {
-        A();
-        f() => g();
-        g() => 42;
-      }
-      main() {
-        var foo = new A().f();
-        foo;
-      }
-      """;
-  return analyze(source).then((result) {
-    result.checkNodeHasType('foo', [result.int]);
-  });
-}
-
-testSendToThis2() {
-  final String source = r"""
-      class A {
-        foo() => this;
-      }
-      class B extends A {
-        bar() => foo();
-      }
-      main() {
-        var x = new B().bar();
-        x;
-      }
-      """;
-  return analyze(source).then((result) {
-    result.checkNodeHasType('x', [result.base('B')]);
-  });
-}
-
-testSendToThis3() {
-  final String source = r"""
-      class A {
-        bar() => 42;
-        foo() => bar();
-      }
-      class B extends A {
-        bar() => "abc";
-      }
-      main() {
-        var x = new B().foo();
-        x;
-      }
-      """;
-  return analyze(source).then((AnalysisResult result) {
-    result.checkNodeHasType('x', [result.string]);
-  });
-}
-
-testSendToThis4() {
-  final String source = """
-      class A {
-        bar() => 42;
-        foo() => bar();
-      }
-      class B extends A {
-        bar() => "abc";
-      }
-      main() {
-        new A(); new B();  // make A and B seen
-        var x = $DYNAMIC.foo();
-        x;
-      }
-      """;
-  return analyze(source).then((AnalysisResult result) {
-    result.checkNodeHasType('x', [result.int, result.string]);
-  });
-}
-
-testConstructor() {
-  final String source = r"""
-      class A {
-        var x, y, z;
-        A(this.x, a) : y = a { z = 'abc'; }
-      }
-      main() {
-        new A(42, 'abc');
-        new A(true, null);
-      }
-      """;
-  return analyze(source).then((result) {
-    result.checkFieldHasType('A', 'x', [result.int, result.bool]);
-    result.checkFieldHasType('A', 'y', [result.string, result.nullType]);
-    result.checkFieldHasType('A', 'z', [result.string]);
-  });
-}
-
-testGetters() {
-  final String source = """
-      class A {
-        var x;
-        A(this.x);
-        get y => x;
-        get z => y;
-      }
-      class B {
-        var x;
-        B(this.x);
-      }
-      main() {
-        var a = new A(42);
-        var b = new B('abc');
-        var foo = a.x;
-        var bar = a.y;
-        var baz = a.z;
-        var qux = null.x;
-        var quux = $DYNAMIC.x;
-        foo; bar; baz; qux; quux;
-      }
-      """;
-  return analyze(source).then((result) {
-    result.checkNodeHasType('foo', [result.int]);
-    result.checkNodeHasType('bar', [result.int]);
-    result.checkNodeHasType('baz', [result.int]);
-    result.checkNodeHasType('qux', []);
-    result.checkNodeHasType('quux', [result.int, result.string]);
-  });
-}
-
-testDynamicGetters() {
-  final String source = """
-      class A {
-        get x => f();
-        f() => 42;
-      }
-      class B extends A {
-        f() => "abc";
-      }
-      main() {
-        new A(); new B();  // make A and B seen
-        var x = $DYNAMIC.x;
-        x;
-      }
-      """;
-  return analyze(source).then((result) {
-    result.checkNodeHasType('x', [result.int, result.string]);
-  });
-}
-
-testToplevelGetters() {
-  final String source = """
-      int _x = 42;
-      get x => _x;
-
-      f() => x;
-
-      main() {
-        var foo = f();
-        var bar = x;
-        _x = "a";
-        var baz = x;
-        foo; bar; baz;
-      }
-      """;
-  return analyze(source).then((result) {
-    result.checkNodeHasType('foo', [result.int, result.string]);
-    result.checkNodeHasType('bar', [result.int, result.string]);
-    result.checkNodeHasType('baz', [result.int, result.string]);
-  });
-}
-
-testSetters() {
-  final String source = """
-      class A {
-        var x;
-        var w;
-        A(this.x, this.w);
-        set y(a) { x = a; z = a; }
-        set z(a) { w = a; }
-      }
-      class B {
-        var x;
-        B(this.x);
-      }
-      main() {
-        var a = new A(42, 42);
-        var b = new B(42);
-        a.x = 'abc';
-        a.y = true;
-        null.x = 42;  // should be ignored
-        $DYNAMIC.x = null;
-        $DYNAMIC.y = 3.14;
-      }
-      """;
-  return analyze(source).then((result) {
-    result.checkFieldHasType('B', 'x',
-                             [result.int,         // new B(42)
-                              result.nullType]);  // dynamic.x = null
-    result.checkFieldHasType('A', 'x',
-                             [result.int,       // new A(42, ...)
-                              result.string,    // a.x = 'abc'
-                              result.bool,      // a.y = true
-                              result.nullType,  // dynamic.x = null
-                              result.double]);  // dynamic.y = 3.14
-    result.checkFieldHasType('A', 'w',
-                             [result.int,       // new A(..., 42)
-                              result.bool,      // a.y = true
-                              result.double]);  // dynamic.y = 3.14
-  });
-}
-
-testToplevelSetters() {
-  final String source = """
-      int _x = 42;
-      set x(y) => _x = y;
-
-      f(y) { x = y; }
-
-      main() {
-        var foo = _x;
-        x = "a";
-        var bar = _x;
-        f(true);
-        var baz = _x;
-        foo; bar; baz;
-      }
-      """;
-  return analyze(source).then((result) {
-    result.checkNodeHasType('foo', [result.int, result.string, result.bool]);
-    result.checkNodeHasType('bar', [result.int, result.string, result.bool]);
-    result.checkNodeHasType('baz', [result.int, result.string, result.bool]);
-  });
-}
-
-
-testOptionalNamedParameters() {
-  final String source = r"""
-      class A {
-        var x, y, z, w;
-        A(this.x, {this.y, this.z, this.w});
-      }
-      class B {
-        var x, y;
-        B(this.x, {this.y});
-      }
-      class C {
-        var x, y;
-        C(this.x, {this.y});
-      }
-      class Test {
-        var a, b, c, d;
-        var e, f;
-        var g, h;
-
-        Test(this.a, this.b, this.c, this.d,
-             this.e, this.f,
-             this.g, this.h);
-
-        f1(x, {y, z, w}) {
-          a = x;
-          b = y;
-          c = z;
-          d = w;
-        }
-        f2(x, {y}) {
-          e = x;
-          f = y;
-        }
-        f3(x, {y}) {
-          g = x;
-          h = y;
-        }
-      }
-      class Foo {
-      }
-      main() {
-        // We want to test expiclitely for null later so we initialize all the
-        // fields of Test with a placeholder type: Foo.
-        var foo = new Foo();
-        var test = new Test(foo, foo, foo, foo, foo, foo, foo, foo);
-
-        new A(42);
-        new A('abc', w: true, z: 42.1);
-        test.f1(42);
-        test.f1('abc', w: true, z: 42.1);
-
-        new B('abc', y: true);
-        new B(1, 2);  // too many positional arguments
-        test.f2('abc', y: true);
-        test.f2(1, 2);  // too many positional arguments
-
-        new C('abc', y: true);
-        new C(1, z: 2);  // non-existing named parameter
-        test.f3('abc', y: true);
-        test.f3(1, z: 2);  // non-existing named parameter
-      }
-      """;
-  return analyze(source).then((result) {
-
-    final foo = result.base('Foo');
-    final nil = result.nullType;
-
-    result.checkFieldHasType('A', 'x', [result.int, result.string]);
-    result.checkFieldHasType('A', 'y', [nil]);
-    result.checkFieldHasType('A', 'z', [nil, result.double]);
-    result.checkFieldHasType('A', 'w', [nil, result.bool]);
-    result.checkFieldHasType('Test', 'a', [foo, result.int, result.string]);
-    result.checkFieldHasType('Test', 'b', [foo, nil]);
-    result.checkFieldHasType('Test', 'c', [foo, nil, result.double]);
-    result.checkFieldHasType('Test', 'd', [foo, nil, result.bool]);
-
-    result.checkFieldHasType('B', 'x', [result.string]);
-    result.checkFieldHasType('B', 'y', [result.bool]);
-    result.checkFieldHasType('Test', 'e', [foo, result.string]);
-    result.checkFieldHasType('Test', 'f', [foo, result.bool]);
-
-    result.checkFieldHasType('C', 'x', [result.string]);
-    result.checkFieldHasType('C', 'y', [result.bool]);
-    result.checkFieldHasType('Test', 'g', [foo, result.string]);
-    result.checkFieldHasType('Test', 'h', [foo, result.bool]);
-  });
-}
-
-testOptionalPositionalParameters() {
-  final String source = r"""
-    class A {
-      var x, y, z, w;
-      A(this.x, [this.y, this.z, this.w]);
-    }
-    class B {
-      var x, y;
-      B(this.x, [this.y]);
-    }
-    class Test {
-      var a, b, c, d;
-      var e, f;
-
-      Test(this.a, this.b, this.c, this.d,
-           this.e, this.f);
-
-      f1(x, [y, z, w]) {
-        a = x;
-        b = y;
-        c = z;
-        d = w;
-      }
-      f2(x, [y]) {
-        e = x;
-        f = y;
-      }
-    }
-    class Foo {
-    }
-    main() {
-      // We want to test expiclitely for null later so we initialize all the
-      // fields of Test with a placeholder type: Foo.
-      var foo = new Foo();
-      var test = new Test(foo, foo, foo, foo, foo, foo);
-
-      new A(42);
-      new A('abc', true, 42.1);
-      test.f1(42);
-      test.f1('abc', true, 42.1);
-
-      new B('a', true);
-      new B(1, 2, 3);  // too many arguments
-      test.f2('a', true);
-      test.f2(1, 2, 3);  // too many arguments
-    }
-  """;
-  return analyze(source).then((result) {
-
-    final foo = result.base('Foo');
-    final nil = result.nullType;
-
-    result.checkFieldHasType('A', 'x', [result.int, result.string]);
-    result.checkFieldHasType('A', 'y', [nil, result.bool]);
-    result.checkFieldHasType('A', 'z', [nil, result.double]);
-    result.checkFieldHasType('A', 'w', [nil]);
-    result.checkFieldHasType('Test', 'a', [foo, result.int, result.string]);
-    result.checkFieldHasType('Test', 'b', [foo, nil, result.bool]);
-    result.checkFieldHasType('Test', 'c', [foo, nil, result.double]);
-    result.checkFieldHasType('Test', 'd', [foo, nil]);
-
-    result.checkFieldHasType('B', 'x', [result.string]);
-    result.checkFieldHasType('B', 'y', [result.bool]);
-    result.checkFieldHasType('Test', 'e', [foo, result.string]);
-    result.checkFieldHasType('Test', 'f', [foo, result.bool]);
-  });
-}
-
-testListLiterals() {
-  final String source = r"""
-      class A {
-        var x;
-        A(this.x);
-      }
-      main() {
-        var x = [];
-        var y = [1, "a", null, new A(42)];
-        x; y;
-      }
-      """;
-  return analyze(source).then((result) {
-    result.checkNodeHasType('x', [result.growableList]);
-    result.checkNodeHasType('y', [result.growableList]);
-    result.checkFieldHasType('A', 'x', [result.int]);
-  });
-}
-
-testMapLiterals() {
-  final String source = r"""
-      class A {
-        var x;
-        A(this.x);
-      }
-      main() {
-        var x = {};
-        var y = {'a': "foo", 'b': new A(42) };
-        x; y;
-      }
-      """;
-  return analyze(source).then((result) {
-    result.checkNodeHasType('x', [result.map]);
-    result.checkNodeHasType('y', [result.map]);
-    result.checkFieldHasType('A', 'x', [result.int]);
-  });
-}
-
-testReturn() {
-  final String source = r"""
-      f() { if (true) { return 1; }; return "a"; }
-      g() { f(); return; }
-      main() {
-        var x = f();
-        var y = g();
-        x; y;
-      }
-      """;
-  return analyze(source).then((result) {
-    result.checkNodeHasType('x', [result.int, result.string]);
-    result.checkNodeHasType('y', [result.nullType]);
-  });
-}
-
-testNoReturn() {
-  final String source = r"""
-      f() { if (true) { return 1; }; }
-      g() { f(); }
-      main() {
-        var x = f();
-        var y = g();
-        x; y;
-      }
-      """;
-  return analyze(source).then((result) {
-    result.checkNodeHasType('x', [result.int, result.nullType]);
-    result.checkNodeHasType('y', [result.nullType]);
-  });
-}
-
-testArithmeticOperators() {
-  String source(op) {
-    return """
-        main() {
-          var a = 1 $op 2;
-          var b = 1 $op 2.1;
-          var c = 1.1 $op 2;
-          var d = 1.1 $op 2.1;
-          var e = (1 $op 2.1) $op 1;
-          var f = 1 $op (1 $op 2.1);
-          var g = (1 $op 2.1) $op 1.1;
-          var h = 1.1 $op (1 $op 2);
-          var i = (1 $op 2) $op 1;
-          var j = 1 $op (1 $op 2);
-          var k = (1.1 $op 2.1) $op 1.1;
-          var l = 1.1 $op (1.1 $op 2.1);
-          a; b; c; d; e; f; g; h; i; j; k; l;
-        }""";
-  }
-  return Future.forEach(['+', '*', '-'], (String op) {
-    return analyze(source(op)).then((result) {
-      result.checkNodeHasType('a', [result.int]);
-      result.checkNodeHasType('b', [result.num]);
-      result.checkNodeHasType('c', [result.num]);
-      result.checkNodeHasType('d', [result.double]);
-      result.checkNodeHasType('e', [result.num]);
-      result.checkNodeHasType('f', [result.num]);
-      result.checkNodeHasType('g', [result.num]);
-      result.checkNodeHasType('h', [result.num]);
-      result.checkNodeHasType('i', [result.int]);
-      result.checkNodeHasType('j', [result.int]);
-      result.checkNodeHasType('k', [result.double]);
-      result.checkNodeHasType('l', [result.double]);
-    });
-  });
-}
-
-testBooleanOperators() {
-  String source(op) {
-    return """
-        main() {
-          var a = true $op null;
-          var b = null $op true;
-          var c = 1 $op true;
-          var d = true $op "a";
-          a; b; c; d;
-        }""";
-  }
-  return Future.forEach(['&&', '||'], (String op) {
-    return analyze(source(op)).then((result) {
-      result.checkNodeHasType('a', [result.bool]);
-      result.checkNodeHasType('b', [result.bool]);
-      result.checkNodeHasType('c', [result.bool]);
-      result.checkNodeHasType('d', [result.bool]);
-    });
-  });
-}
-
-testBooleanOperatorsShortCirtcuit() {
-  String source(op) {
-    return """
-        main() {
-          var x = null;
-          "foo" $op (x = 42);
-          x;
-        }""";
-  }
-  return Future.forEach(['&&', '||'], (String op) {
-    return analyze(source(op)).then((AnalysisResult result) {
-      result.checkNodeHasType('x', [result.nullType, result.int]);
-    });
-  });
-}
-
-testOperators() {
-  final String source = r"""
-      class A {
-        operator <(x) => 42;
-        operator <<(x) => "a";
-      }
-      main() {
-        var x = new A() < "foo";
-        var y = new A() << "foo";
-        x; y;
-      }
-      """;
-  return analyze(source).then((result) {
-    result.checkNodeHasType('x', [result.int]);
-    result.checkNodeHasType('y', [result.string]);
-  });
-}
-
-testSetIndexOperator() {
-  final String source = r"""
-      class A {
-        var witness1;
-        var witness2;
-        operator []=(i, x) { witness1 = i; witness2 = x; }
-      }
-      main() {
-        var x = new A()[42] = "abc";
-        x;
-      }
-      """;
-  return analyze(source).then((result) {
-    result.checkNodeHasType('x', [result.string]);
-    result.checkFieldHasType('A', 'witness1', [result.int, result.nullType]);
-    result.checkFieldHasType('A', 'witness2', [result.string, result.nullType]);
-  });
-}
-
-testCompoundOperators1() {
-  final String source = r"""
-      class A {
-        operator +(x) => "foo";
-      }
-      main() {
-        var x1 = 1;
-        x1++;
-        var x2 = 1;
-        ++x2;
-        var x3 = 1;
-        x3 += 42;
-        var x4 = new A();
-        x4++;
-        var x5 = new A();
-        ++x5;
-        var x6 = new A();
-        x6 += true;
-
-        x1; x2; x3; x4; x5; x6;
-      }
-      """;
-  return analyze(source).then((result) {
-    result.checkNodeHasType('x1', [result.int]);
-    result.checkNodeHasType('x2', [result.int]);
-    result.checkNodeHasType('x3', [result.int]);
-    result.checkNodeHasType('x4', [result.string]);
-    result.checkNodeHasType('x5', [result.string]);
-    result.checkNodeHasType('x6', [result.string]);
-  });
-}
-
-
-testCompoundOperators2() {
-  final String source = r"""
-    class A {
-      var xx;
-      var yy;
-      var witness1;
-      var witness2;
-      var witness3;
-      var witness4;
-
-      A(this.xx, this.yy);
-      get x { witness1 = "foo"; return xx; }
-      set x(a) { witness2 = "foo"; xx = a; }
-      get y { witness3 = "foo"; return yy; }
-      set y(a) { witness4 = "foo"; yy = a; }
-    }
-    main () {
-      var a = new A(1, 1);
-      a.x++;
-      a.y++;
-    }
-    """;
-  return analyze(source).then((result) {
-    result.checkFieldHasType('A', 'xx', [result.int]);
-    result.checkFieldHasType('A', 'yy', [result.int]);
-    result.checkFieldHasType('A', 'witness1', [result.string, result.nullType]);
-    result.checkFieldHasType('A', 'witness2', [result.string, result.nullType]);
-    result.checkFieldHasType('A', 'witness3', [result.string, result.nullType]);
-    result.checkFieldHasType('A', 'witness4', [result.string, result.nullType]);
-  });
-}
-
-testInequality() {
-  final String source = r"""
-      class A {
-        var witness;
-        operator ==(x) { witness = "foo"; return "abc"; }
-      }
-      class B {
-        operator ==(x) { throw "error"; }
-      }
-      main() {
-        var foo = 1 != 2;
-        var bar = (new A() != 2);
-        var baz = (new B() != 2);
-        foo; bar; baz;
-      }
-      """;
-  return analyze(source).then((result) {
-    result.checkNodeHasType('foo', [result.bool]);
-    result.checkNodeHasType('bar', [result.bool]);
-    // TODO(polux): could be even better: empty
-    result.checkNodeHasType('baz', [result.bool]);
-    result.checkFieldHasType('A', 'witness', [result.string, result.nullType]);
-  });
-}
-
-testFieldInitialization1() {
-  final String source = r"""
-    class A {
-      var x;
-      var y = 1;
-    }
-    class B extends A {
-      var z = "foo";
-    }
-    main () {
-      // we need to access y and z once to trigger their analysis
-      new B().y;
-      new B().z;
-    }
-    """;
-  return analyze(source).then((result) {
-    result.checkFieldHasType('A', 'x', [result.nullType]);
-    result.checkFieldHasType('A', 'y', [result.int]);
-    result.checkFieldHasType('B', 'z', [result.string]);
-  });
-}
-
-testFieldInitialization2() {
-  final String source = r"""
-    var top = 42;
-    class A {
-      var x = top;
-    }
-    main () {
-      // we need to access X once to trigger its analysis
-      new A().x;
-    }
-    """;
-  return analyze(source).then((result) {
-    result.checkFieldHasType('A', 'x', [result.int]);
-  });
-}
-
-testFieldInitialization3() {
-  final String source = r"""
-    class A {
-      var x;
-    }
-    f() => new A().x;
-    class B {
-      var x = new A().x;
-      var y = f();
-    }
-    main () {
-      var foo = new B().x;
-      var bar = new B().y;
-      new A().x = "a";
-      foo; bar;
-    }
-    """;
-  return analyze(source).then((result) {
-    // checks that B.B is set as a reader of A.x
-    result.checkFieldHasType('B', 'x', [result.nullType, result.string]);
-    // checks that B.B is set as a caller of f
-    result.checkFieldHasType('B', 'y', [result.nullType, result.string]);
-    // checks that readers of x are notified by changes in x's type
-    result.checkNodeHasType('foo', [result.nullType, result.string]);
-    // checks that readers of y are notified by changes in y's type
-    result.checkNodeHasType('bar', [result.nullType, result.string]);
-  });
-}
-
-testLists() {
-  final String source = """
-    class A {}
-    class B {}
-    class C {}
-    class D {}
-    class E {}
-    class F {}
-    class G {}
-
-    main() {
-      var l1 = [new A()];
-      var l2 = [];
-      l1['a'] = new B();  // raises an error, so B should not be recorded
-      l1[1] = new C();
-      l1.add(new D());
-      l1.insert('a', new E());  // raises an error, so E should not be recorded
-      l1.insert(1, new F());
-      $DYNAMIC[1] = new G();
-      var x1 = l1[1];
-      var x2 = l2[1];
-      var x3 = l1['foo'];  // raises an error, should return empty
-      var x4 = l1.removeAt(1);
-      var x5 = l2.removeAt(1);
-      var x6 = l1.removeAt('a');  // raises an error, should return empty
-      var x7 = l1.removeLast();
-      var x8 = l2.removeLast();
-      x1; x2; x3; x4; x5; x6; x7; x8;
-    }""";
-  return analyze(source).then((result) {
-    final expectedTypes = ['A', 'C', 'D', 'F', 'G'].map(result.base).toList();
-    result.checkNodeHasType('x1', expectedTypes);
-    result.checkNodeHasType('x2', expectedTypes);
-    result.checkNodeHasType('x3', []);
-    result.checkNodeHasType('x4', expectedTypes);
-    result.checkNodeHasType('x5', expectedTypes);
-    result.checkNodeHasType('x6', []);
-    result.checkNodeHasType('x7', expectedTypes);
-    result.checkNodeHasType('x8', expectedTypes);
-  });
-}
-
-testListWithCapacity() {
-  final String source = r"""
-    main() {
-      var l = new List(10);
-      var x = [][0];
-      x;
-    }""";
-  return analyze(source).then((result) {
-    result.checkNodeHasType('x', [result.nullType]);
-  });
-}
-
-testEmptyList() {
-  final String source = r"""
-    main() {
-      var l = new List();
-      var x = l[0];
-      x;
-    }""";
-  return analyze(source).then((result) {
-    result.checkNodeHasType('x', []);
-  });
-}
-
-testSendWithWrongArity() {
-  final String source = r"""
-    f(x) { }
-    class A { g(x) { } }
-    main () {
-      var x = f();
-      var y = f(1, 2);
-      var z = new A().g();
-      var w = new A().g(1, 2);
-      x; y; z; w;
-    }
-    """;
-  return analyze(source).then((result) {
-    // TODO(polux): It would be better if x and y also had the empty type. This
-    // requires a change in SimpleTypeInferrerVisitor.visitStaticSend which
-    // would impact the default type inference and possibly break dart2js.
-    // Keeping this change for a later CL.
-    result.checkNodeHasUnknownType('x');
-    result.checkNodeHasUnknownType('y');
-    result.checkNodeHasType('z', []);
-    result.checkNodeHasType('w', []);
-  });
-}
-
-testBigTypesWidening1() {
-  final String source = r"""
-    small() => true ? 1 : 'abc';
-    big() => true ? 1 : (true ? 'abc' : false);
-    main () {
-      var x = small();
-      var y = big();
-      x; y;
-    }
-    """;
-  return analyze(source, maxConcreteTypeSize: 2).then((result) {
-    result.checkNodeHasType('x', [result.int, result.string]);
-    result.checkNodeHasUnknownType('y');
-  });
-}
-
-testBigTypesWidening2() {
-  final String source = r"""
-    class A {
-      var x, y;
-      A(this.x, this.y);
-    }
-    main () {
-      var a = new A(1, 1);
-      a.x = 'abc';
-      a.y = 'abc';
-      a.y = true;
-    }
-    """;
-  return analyze(source, maxConcreteTypeSize: 2).then((result) {
-    result.checkFieldHasType('A', 'x', [result.int, result.string]);
-    result.checkFieldHasUknownType('A', 'y');
-  });
-}
-
-testDynamicIsAbsorbing() {
-  final String source = """
-    main () {
-      var x = 1;
-      if (true) {
-        x = $DYNAMIC;
-      } else {
-        x = 42;
-      }
-      x;
-    }
-    """;
-  return analyze(source).then((result) {
-    result.checkNodeHasUnknownType('x');
-  });
-}
-
-testJsCall() {
-  final String source = r"""
-    import 'dart:_foreign_helper';
-    import 'dart:_interceptors';
-
-    abstract class AbstractA {}
-    class A extends AbstractA {}
-    class B extends A {}
-    class BB extends B {}
-    class C extends A {}
-    class D implements A {}
-    class E extends A {}
-
-    class X {}
-
-    main () {
-      // we don't create any E on purpose
-      new B(); new BB(); new C(); new D();
-
-      var a = JS('', '1');
-      var b = JS('Object', '1');
-      var c = JS('JSExtendableArray', '1');
-      var cNull = JS('JSExtendableArray|Null', '1');
-      var d = JS('String', '1');
-      var dNull = JS('String|Null', '1');
-      var e = JS('int', '1');
-      var eNull = JS('int|Null', '1');
-      var f = JS('double', '1');
-      var fNull = JS('double|Null', '1');
-      var g = JS('num', '1');
-      var gNull = JS('num|Null', '1');
-      var h = JS('bool', '1');
-      var hNull = JS('bool|Null', '1');
-      var i = JS('AbstractA', '1');
-      var iNull = JS('AbstractA|Null', '1');
-
-      a; b; c; cNull; d; dNull; e; eNull; f; fNull; g; gNull; h; hNull; i;
-      iNull;
-    }
-    """;
-  return analyze(source, maxConcreteTypeSize: 6).then((result) {
-    List maybe(List types) => new List.from(types)..add(result.nullType);
-    // a and b have all the types seen by the resolver, which are more than 6
-    result.checkNodeHasUnknownType('a');
-    result.checkNodeHasUnknownType('b');
-    final expectedCType = [result.growableList];
-    result.checkNodeHasType('c', expectedCType);
-    result.checkNodeHasType('cNull', maybe(expectedCType));
-    final expectedDType = [result.string];
-    result.checkNodeHasType('d', expectedDType);
-    result.checkNodeHasType('dNull', maybe(expectedDType));
-    final expectedEType = [result.int];
-    result.checkNodeHasType('e', expectedEType);
-    result.checkNodeHasType('eNull', maybe(expectedEType));
-    final expectedFType = [result.double];
-    result.checkNodeHasType('f', expectedFType);
-    result.checkNodeHasType('fNull', maybe(expectedFType));
-    final expectedGType = [result.num];
-    result.checkNodeHasType('g', expectedGType);
-    result.checkNodeHasType('gNull', maybe(expectedGType));
-    final expectedType = [result.bool];
-    result.checkNodeHasType('h', expectedType);
-    result.checkNodeHasType('hNull', maybe(expectedType));
-    final expectedIType = [result.base('B'),
-                           result.base('BB'),
-                           result.base('C'),
-                           result.base('D')];
-    result.checkNodeHasType('i', expectedIType);
-    result.checkNodeHasType('iNull', maybe(expectedIType));
-  });
-}
-
-testJsCallAugmentsSeenClasses() {
-  final String source1 = """
-    main () {
-      var x = $DYNAMIC.truncate();
-      x;
-    }
-    """;
-  return analyze(source1).then((AnalysisResult result) {
-    result.checkNodeHasType('x', []);
-  }).whenComplete(() {
-
-    final String source2 = """
-      import 'dart:_foreign_helper';
-
-      main () {
-        var x = $DYNAMIC.truncate();
-        JS('double', 'foo');
-        x;
-      }
-      """;
-    return analyze(source2).then((AnalysisResult result) {
-      result.checkNodeHasType('x', [result.int]);
-    });
-  });
-}
-
-testIsCheck() {
-  final String source = r"""
-    main () {
-      var x = (1 is String);
-      x;
-    }
-    """;
-  return analyze(source).then((result) {
-    result.checkNodeHasType('x', [result.bool]);
-  });
-}
-
-testSeenClasses() {
-  final String source = """
-      class A {
-        witness() => 42;
-      }
-      class B {
-        witness() => "string";
-      }
-      class AFactory {
-        onlyCalledInAFactory() => new A();
-      }
-      class BFactory {
-        onlyCalledInAFactory() => new B();
-      }
-
-      main() {
-        new AFactory().onlyCalledInAFactory();
-        new BFactory();
-        // should be of type {int} and not {int, String} since B is unreachable
-        var foo = $DYNAMIC.witness();
-        foo;
-      }
-      """;
-  return analyze(source).then((result) {
-    result.checkNodeHasType('foo', [result.int]);
-  });
-}
-
-testIntDoubleNum() {
-  final String source = r"""
-      main() {
-        var a = 1;
-        var b = 1.1;
-        var c = true ? 1 : 1.1;
-        a; b; c;
-      }
-      """;
-  return analyze(source).then((result) {
-    result.checkNodeHasType('a', [result.int]);
-    result.checkNodeHasType('b', [result.double]);
-    result.checkNodeHasType('c', [result.num]);
-  });
-}
-
-testConcreteTypeToTypeMask() {
-  final String source = r"""
-      class A {}
-      class B extends A {}
-      class C extends A {}
-      class D implements A {}
-      main() {
-        new A();
-        new B();
-        new C();
-        new D();
-      }
-      """;
-  return analyze(source).then((result) {
-
-  convert(ConcreteType type) {
-    return result.compiler.typesTask.concreteTypesInferrer
-        .types.concreteTypeToTypeMask(type);
-  }
-
-    final nullSingleton =
-        result.compiler.typesTask.concreteTypesInferrer.singletonConcreteType(
-            new NullBaseType());
-
-    singleton(ClassElement element) {
-      return result.compiler.typesTask.concreteTypesInferrer
-          .singletonConcreteType(new ClassBaseType(element));
-    }
-
-    var world = result.compiler.world;
-
-    ClassElement a = findElement(result.compiler, 'A');
-    ClassElement b = findElement(result.compiler, 'B');
-    ClassElement c = findElement(result.compiler, 'C');
-    ClassElement d = findElement(result.compiler, 'D');
-
-    for (ClassElement cls in [a, b, c, d]) {
-      Expect.equals(convert(singleton(cls)),
-                    new TypeMask.nonNullExact(cls, world));
-    }
-
-    for (ClassElement cls in [a, b, c, d]) {
-      Expect.equals(convert(singleton(cls).union(nullSingleton)),
-                    new TypeMask.exact(cls, world));
-    }
-
-    Expect.equals(convert(singleton(a).union(singleton(b))),
-                  new TypeMask.nonNullSubclass(a, world));
-
-    Expect.equals(
-        convert(singleton(a).union(singleton(b)).union(nullSingleton)),
-                  new TypeMask.subclass(a, world));
-
-    Expect.equals(
-        simplify(convert(singleton(b).union(singleton(d))), result.compiler),
-        new TypeMask.nonNullSubtype(a, world));
-  });
-}
-
-testSelectors() {
-  final String source = r"""
-      // ABC <--- A
-      //       `- BC <--- B
-      //               `- C
-
-      class ABC {}
-      class A extends ABC {}
-      class BC extends ABC {}
-      class B extends BC {}
-      class C extends BC {}
-
-      class XY {}
-      class X extends XY { foo() => new B(); }
-      class Y extends XY { foo() => new C(); }
-      class Z { foo() => new A(); }
-
-      main() {
-        new X().foo();
-        new Y().foo();
-        new Z().foo();
-      }
-      """;
-  return analyze(source).then((result) {
-
-    var world = result.compiler.world;
-
-    ClassElement a = findElement(result.compiler, 'A');
-    ClassElement b = findElement(result.compiler, 'B');
-    ClassElement c = findElement(result.compiler, 'C');
-    ClassElement xy = findElement(result.compiler, 'XY');
-    ClassElement x = findElement(result.compiler, 'X');
-    ClassElement y = findElement(result.compiler, 'Y');
-    ClassElement z = findElement(result.compiler, 'Z');
-
-    Selector foo = new Selector.call("foo", null, 0);
-
-    result.checkSelectorHasType(
-        foo,
-        null,
-        new TypeMask.unionOf([a, b, c]
-            .map((cls) => new TypeMask.nonNullExact(cls, world)),
-            result.compiler.world));
-    result.checkSelectorHasType(
-        foo,
-        new TypeMask.subclass(x, world),
-        new TypeMask.nonNullExact(b, world));
-    result.checkSelectorHasType(
-        foo,
-        new TypeMask.subclass(y, world),
-        new TypeMask.nonNullExact(c, world));
-    result.checkSelectorHasType(
-        foo,
-        new TypeMask.subclass(z, world),
-        new TypeMask.nonNullExact(a, world));
-    result.checkSelectorHasType(
-        foo,
-        new TypeMask.subclass(xy, world),
-        new TypeMask.unionOf([b, c].map((cls) =>
-            new TypeMask.nonNullExact(cls, world)), world));
-
-    result.checkSelectorHasType(new Selector.call("bar", null, 0), null, null);
-  });
-}
-
-testEqualsNullSelector() {
-  final String source = r"""
-      main() {
-        1 == null;
-      }
-      """;
-  return analyze(source).then((result) {
-    ClassElement bool = result.compiler.backend.boolImplementation;
-    result.checkSelectorHasType(new Selector.binaryOperator('=='),
-                                null,
-                                new TypeMask.nonNullExact(bool,
-                                    result.compiler.world));
-  });
-}
-
-testMixins() {
-  final String source = r"""
-      class A {
-        foo() => "abc";
-        get x => 42;
-      }
-      class B extends Object with A {
-        bar() => foo();
-        baz() => x;
-      }
-      main() {
-        var b = new B();
-        var x = b.foo();
-        var y = b.bar();
-        var z = b.x;
-        var w = b.baz();
-        x; y; z; w;
-      }
-      """;
-  return analyze(source).then((result) {
-    result.checkNodeHasType('x', [result.string]);
-    result.checkNodeHasType('y', [result.string]);
-    result.checkNodeHasType('z', [result.int]);
-    result.checkNodeHasType('w', [result.int]);
-  });
-}
-
-testClosures1() {
-  final String source = r"""
-      class A {
-        final foo = 42;
-      }
-      class B {
-        final foo = "abc";
-      }
-      class C {
-        final foo = true;
-      }
-      main() {
-        var a;
-        var f = (x) {
-          a = x.foo;
-        };
-        // We make sure that x doesn't have type dynamic by adding C to the
-        // set of seen classes and by checking that a's type doesn't contain
-        // bool.
-        new C();
-        f(new A());
-        f(new B());
-        a;
-      }
-      """;
-  return analyze(source).then((AnalysisResult result) {
-    result.checkNodeHasType('a', [result.nullType, result.int, result.string]);
-  });
-}
-
-testClosures2() {
-  final String source = r"""
-      class A {
-        final foo = 42;
-      }
-      class B {
-        final foo = "abc";
-      }
-      class C {
-        final foo = true;
-      }
-      main() {
-        // We make sure that x doesn't have type dynamic by adding C to the
-        // set of seen classes and by checking that a's type doesn't contain
-        // bool.
-        new C();
-
-        var a;
-        f(x) {
-          a = x.foo;
-        }
-        f(new A());
-        f(new B());
-        a; f;
-      }
-      """;
-  return analyze(source).then((AnalysisResult result) {
-    result.checkNodeHasType('a', [result.nullType, result.int, result.string]);
-    result.checkNodeHasType('f', [result.functionType]);
-  });
-}
-
-testClosures3() {
-  final String source = r"""
-      class A {
-        var g;
-        A(this.g);
-      }
-      main() {
-        var foo = new A((x) => x).g(42);
-        foo;
-      }
-      """;
-  return analyze(source).then((result) {
-    result.checkNodeHasType('foo', [result.int]);
-  });
-}
-
-testClosures4() {
-  final String source = """
-      class A {
-        var f = $DYNAMIC;
-      }
-      main() {
-        var f = (x) => x;
-        var g = (x) => "a";
-        var h = (x, y) => true;
-
-        var foo = $DYNAMIC(42);
-        var bar = new A().f(1.2);
-        var baz = $DYNAMIC.f(null);
-
-        foo; bar; baz;
-      }
-      """;
-  return analyze(source).then((result) {
-    result.checkNodeHasType('foo', [result.int, result.string]);
-    result.checkNodeHasType('bar', [result.double, result.string]);
-    result.checkNodeHasType('baz', [result.nullType, result.string]);
-  });
-}
-
-testClosures5() {
-  final String source = r"""
-      f(x) => x;
-      class A {
-        var g;
-        A(this.g);
-      }
-      main() {
-        var foo = new A(f).g(42);
-        foo;
-      }
-      """;
-  return analyze(source).then((result) {
-    result.checkNodeHasType('foo', [result.int]);
-  });
-}
-
-testClosures6() {
-  final String source = r"""
-      class A {
-        var g;
-        A(this.g);
-      }
-      class B {
-        f(x) => x;
-      }
-      main() {
-        var foo = new A(new B().f).g(42);
-        foo;
-      }
-      """;
-  return analyze(source).then((result) {
-    result.checkNodeHasType('foo', [result.int]);
-  });
-}
-
-testClosures7() {
-  final String source = r"""
-      class A {
-        final x = 42;
-        f() => () => x;
-      }
-      main() {
-        var foo = new A().f()();
-        foo;
-      }
-      """;
-  return analyze(source).then((result) {
-    result.checkNodeHasType('foo', [result.int]);
-  });
-}
-
-testClosures8() {
-  final String source = r"""
-      class A {
-        final x = 42;
-        f() => () => x;
-      }
-      class B extends A {
-        get x => "a";
-      }
-      main() {
-        var foo = new B().f()();
-        foo;
-      }
-      """;
-  return analyze(source).then((result) {
-    result.checkNodeHasType('foo', [result.string]);
-  });
-}
-
-testClosures9() {
-  final String source = r"""
-      class A {
-        g() => 42;
-        f() => () => g();
-      }
-      class B extends A {
-        g() => "a";
-      }
-      main() {
-        var foo = new B().f()();
-        foo;
-      }
-      """;
-  return analyze(source).then((result) {
-    result.checkNodeHasType('foo', [result.string]);
-  });
-}
-
-testClosures10() {
-  final String source = r"""
-      class A {
-        f() => 42;
-      }
-      main() {
-        var a = new A();
-        g() => a.f();
-        var foo = g();
-        foo; a;
-      }
-      """;
-  return analyze(source).then((result) {
-    result.checkNodeHasType('foo', [result.int]);
-  });
-}
-
-testClosures11() {
-  final String source = r"""
-      class A {
-        var x;
-        f() => x;
-      }
-      main() {
-        var a = new A();
-        f() => a.f();
-        a.x = 42;
-        var foo = f();
-        foo;
-      }
-      """;
-  return analyze(source).then((result) {
-    result.checkNodeHasType('foo', [result.nullType, result.int]);
-  });
-}
-
-testClosures12() {
-  final String source = r"""
-      var f = (x) => x;
-      main() {
-        var foo = f(1);
-        foo;
-      }
-      """;
-  return analyze(source).then((result) {
-    result.checkNodeHasType('foo', [result.int]);
-  });
-}
-
-testRefinement() {
-  final String source = """
-      class A {
-        f() => null;
-        g() => 42;
-      }
-      class B {
-        g() => "aa";
-      }
-      main() {
-        var x = $DYNAMIC ? new A() : new B();
-        x.f();
-        var foo = x.g();
-        foo;
-      }
-      """;
-  return analyze(source).then((result) {
-    result.checkNodeHasType('foo', [result.int]);
-  });
-}
-
-testDefaultArguments() {
-  final String source = r"""
-      f1([x = 42]) => x;
-      g1([x]) => x;
-
-      f2({x: 42}) => x;
-      g2({x}) => x;
-
-      main() {
-        var xf1 = f1();
-        var xg1 = g1();
-        var xf2 = f2();
-        var xg2 = g2();
-        xf1; xg1; xf2; xg2;
-      }
-      """;
-  return analyze(source).then((result) {
-    result.checkNodeHasType('xf1', [result.int]);
-    result.checkNodeHasType('xg1', [result.nullType]);
-    result.checkNodeHasType('xf2', [result.int]);
-    result.checkNodeHasType('xg2', [result.nullType]);
-  });
-}
-
-testSuperConstructorCall() {
-  final String source = r"""
-      class A {
-        final x;
-        A(this.x);
-      }
-
-      class B extends A {
-        B(x) : super(x);
-      }
-      main() {
-        var b = new B(42);
-        var foo = b.x;
-        foo;
-      }
-      """;
-  return analyze(source).then((result) {
-    result.checkFieldHasType('A', 'x', [result.int]);
-    result.checkNodeHasType('foo', [result.int]);
-  });
-}
-
-testSuperConstructorCall2() {
-  final String source = r"""
-      class A {
-        var x;
-        A() {
-          x = 42;
-        }
-      }
-      class B extends A {
-      }
-      main() {
-        new B();
-      }
-      """;
-  return analyze(source).then((result) {
-    result.checkFieldHasType('A', 'x', [result.int]);
-  });
-}
-
-testSuperConstructorCall3() {
-  final String source = r"""
-      class A {
-        var x;
-        A() {
-          x = 42;
-        }
-      }
-      class B extends A {
-        B(unused) {}
-      }
-      main() {
-        new B("abc");
-      }
-      """;
-  return analyze(source).then((result) {
-    result.checkFieldHasType('A', 'x', [result.int]);
-  });
-}
-
-void main() {
-  asyncTest(() => Future.forEach([
-    testDynamicBackDoor,
-    testVariableDeclaration,
-    testLiterals,
-    testRedefinition,
-    testIfThenElse,
-    testTernaryIf,
-    testWhile,
-    testDoWhile,
-    testFor1,
-    testFor2,
-    testFor3,
-    testForIn,
-    testToplevelVariable,
-    testToplevelVariable2,
-    testToplevelVariable3,
-    testNonRecusiveFunction,
-    testMultipleReturns,
-    testRecusiveFunction,
-    testMutuallyRecusiveFunction,
-    testSimpleSend,
-    testSendToThis1,
-    testSendToThis2,
-    testSendToThis3,
-    testSendToThis4,
-    testConstructor,
-    testGetters,
-    testToplevelGetters,
-    testDynamicGetters,
-    testSetters,
-    testToplevelSetters,
-    testOptionalNamedParameters,
-    testOptionalPositionalParameters,
-    testListLiterals,
-    testMapLiterals,
-    testReturn,
-    testNoReturn,
-    testArithmeticOperators,
-    testBooleanOperators,
-    testBooleanOperatorsShortCirtcuit,
-    testOperators,
-    testCompoundOperators1,
-    testCompoundOperators2,
-    testSetIndexOperator,
-    testInequality,
-    testFieldInitialization1,
-    testFieldInitialization2,
-    testFieldInitialization3,
-    testSendWithWrongArity,
-    testBigTypesWidening1,
-    testBigTypesWidening2,
-    testDynamicIsAbsorbing,
-    testLists,
-    testListWithCapacity,
-    testEmptyList,
-    testJsCall,
-    testJsCallAugmentsSeenClasses,
-    testIsCheck,
-    testSeenClasses,
-    testIntDoubleNum,
-    testConcreteTypeToTypeMask,
-    testSelectors,
-    // TODO(polux): this test is failing, see http://dartbug.com/16825.
-    //testEqualsNullSelector,
-    testMixins,
-    testClosures1,
-    testClosures2,
-    testClosures3,
-    testClosures4,
-    testClosures5,
-    testClosures6,
-    testClosures7,
-    testClosures8,
-    testClosures9,
-    testClosures10,
-    testClosures11,
-    testClosures12,
-    testRefinement,
-    testDefaultArguments,
-    testSuperConstructorCall,
-    testSuperConstructorCall2,
-    testSuperConstructorCall3,
-  ], (f) => f()));
-}
diff --git a/tests/compiler/dart2js/dart2js.status b/tests/compiler/dart2js/dart2js.status
index 096a7bc..3b0aae1 100644
--- a/tests/compiler/dart2js/dart2js.status
+++ b/tests/compiler/dart2js/dart2js.status
@@ -2,8 +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.
 
+compile_with_empty_libraries_test: Fail # Issue 24223
+
 boolified_operator_test: Fail # Issue 8001
 
+async_await_js_transform_test/01: RuntimeError # Issue 23997
+
 # Don't mark these tests as failing. Instead, fix the errors/warnings that they
 # report or update the whitelist in the test-files to temporarily allow
 # digression.
@@ -32,6 +36,8 @@
 
 patch_test/bug: RuntimeError # Issue 21132
 
+http_test: Pass, Slow
+
 # These tests are for the now-deleted dart2dart variant of the CPS IR.
 # We want to adapt them to test the JS variant of the CPS IR instead,
 # but for now they are disabled.
@@ -56,8 +62,8 @@
 mirror_final_field_inferrer2_test: Pass, Slow
 check_elements_invariants_test: Slow, Pass
 import_mirrors_test: Slow, Pass
-http_test: Pass, Slow
 exit_code_test: Pass, Slow
+value_range_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_custom_element_test.dart b/tests/compiler/dart2js/deferred_custom_element_test.dart
index b1f1b3e..07851d8 100644
--- a/tests/compiler/dart2js/deferred_custom_element_test.dart
+++ b/tests/compiler/dart2js/deferred_custom_element_test.dart
@@ -7,7 +7,7 @@
 // much be included in the initial download (loaded eagerly).
 
 import 'package:async_helper/async_helper.dart';
-import 'package:compiler/src/dart2jslib.dart';
+import 'package:compiler/src/compiler.dart';
 import 'package:expect/expect.dart';
 import 'memory_compiler.dart';
 
diff --git a/tests/compiler/dart2js/deferred_dont_inline_deferred_constants_test.dart b/tests/compiler/dart2js/deferred_dont_inline_deferred_constants_test.dart
index fa9753e..ae6fd61 100644
--- a/tests/compiler/dart2js/deferred_dont_inline_deferred_constants_test.dart
+++ b/tests/compiler/dart2js/deferred_dont_inline_deferred_constants_test.dart
@@ -6,7 +6,7 @@
 // Files when using deferred loading.
 
 import 'package:async_helper/async_helper.dart';
-import 'package:compiler/src/dart2jslib.dart';
+import 'package:compiler/src/compiler.dart';
 import 'package:expect/expect.dart';
 import 'memory_compiler.dart';
 import 'output_collector.dart';
@@ -23,7 +23,7 @@
       return compiler.libraryLoader.lookupLibrary(Uri.parse(name));
     }
 
-    var main = compiler.mainApp.find(Compiler.MAIN);
+    var main = compiler.mainFunction;
     Expect.isNotNull(main, "Could not find 'main'");
     compiler.deferredLoadTask.onResolutionComplete(main);
 
diff --git a/tests/compiler/dart2js/deferred_dont_inline_deferred_globals_test.dart b/tests/compiler/dart2js/deferred_dont_inline_deferred_globals_test.dart
index 1a85a12..46674f0 100644
--- a/tests/compiler/dart2js/deferred_dont_inline_deferred_globals_test.dart
+++ b/tests/compiler/dart2js/deferred_dont_inline_deferred_globals_test.dart
@@ -6,7 +6,7 @@
 // Files when using deferred loading.
 
 import 'package:async_helper/async_helper.dart';
-import 'package:compiler/src/dart2jslib.dart';
+import 'package:compiler/src/compiler.dart';
 import 'package:expect/expect.dart';
 import 'memory_compiler.dart';
 import 'output_collector.dart';
@@ -22,7 +22,7 @@
       return compiler.libraryLoader.lookupLibrary(Uri.parse(name));
     }
 
-    var main = compiler.mainApp.find(Compiler.MAIN);
+    var main = compiler.mainFunction;
     Expect.isNotNull(main, "Could not find 'main'");
     compiler.deferredLoadTask.onResolutionComplete(main);
 
diff --git a/tests/compiler/dart2js/deferred_emit_type_checks_test.dart b/tests/compiler/dart2js/deferred_emit_type_checks_test.dart
index 2132fde..f6df078 100644
--- a/tests/compiler/dart2js/deferred_emit_type_checks_test.dart
+++ b/tests/compiler/dart2js/deferred_emit_type_checks_test.dart
@@ -6,7 +6,7 @@
 // Files when using deferred loading.
 
 import 'package:async_helper/async_helper.dart';
-import 'package:compiler/src/dart2jslib.dart';
+import 'package:compiler/src/compiler.dart';
 import 'package:compiler/src/js_backend/js_backend.dart'
        show JavaScriptBackend;
 import 'package:expect/expect.dart';
diff --git a/tests/compiler/dart2js/deferred_follow_constant_dependencies_test.dart b/tests/compiler/dart2js/deferred_follow_constant_dependencies_test.dart
index 7d2c686..d1175e7 100644
--- a/tests/compiler/dart2js/deferred_follow_constant_dependencies_test.dart
+++ b/tests/compiler/dart2js/deferred_follow_constant_dependencies_test.dart
@@ -6,7 +6,7 @@
 
 import 'package:async_helper/async_helper.dart';
 import 'package:compiler/src/constants/values.dart';
-import 'package:compiler/src/dart2jslib.dart';
+import 'package:compiler/src/compiler.dart';
 import 'package:expect/expect.dart';
 import 'memory_compiler.dart';
 
diff --git a/tests/compiler/dart2js/deferred_follow_implicit_super_regression_test.dart b/tests/compiler/dart2js/deferred_follow_implicit_super_regression_test.dart
index acd0146..b083958 100644
--- a/tests/compiler/dart2js/deferred_follow_implicit_super_regression_test.dart
+++ b/tests/compiler/dart2js/deferred_follow_implicit_super_regression_test.dart
@@ -6,7 +6,7 @@
 import 'package:async_helper/async_helper.dart';
 import 'memory_compiler.dart';
 
-import 'package:compiler/src/dart2jslib.dart'
+import 'package:compiler/src/compiler.dart'
        as dart2js;
 
 void main() {
@@ -19,7 +19,7 @@
       return compiler.libraryLoader.lookupLibrary(Uri.parse(name));
     }
 
-    var main = compiler.mainApp.find(dart2js.Compiler.MAIN);
+    var main = compiler.mainFunction;
     Expect.isNotNull(main, "Could not find 'main'");
     compiler.deferredLoadTask.onResolutionComplete(main);
 
diff --git a/tests/compiler/dart2js/deferred_inline_restrictions_test.dart b/tests/compiler/dart2js/deferred_inline_restrictions_test.dart
index a750587..14d0a7b 100644
--- a/tests/compiler/dart2js/deferred_inline_restrictions_test.dart
+++ b/tests/compiler/dart2js/deferred_inline_restrictions_test.dart
@@ -6,7 +6,7 @@
 // allow inlining of empty functions and from main.
 
 import 'package:async_helper/async_helper.dart';
-import 'package:compiler/src/dart2jslib.dart';
+import 'package:compiler/src/compiler.dart';
 import 'package:expect/expect.dart';
 import 'memory_compiler.dart';
 
diff --git a/tests/compiler/dart2js/deferred_load_graph_segmentation2_test.dart b/tests/compiler/dart2js/deferred_load_graph_segmentation2_test.dart
index 0b79a13..52ad4d4 100644
--- a/tests/compiler/dart2js/deferred_load_graph_segmentation2_test.dart
+++ b/tests/compiler/dart2js/deferred_load_graph_segmentation2_test.dart
@@ -7,7 +7,7 @@
 // much be included in the initial download (loaded eagerly).
 
 import 'package:async_helper/async_helper.dart';
-import 'package:compiler/src/dart2jslib.dart';
+import 'package:compiler/src/compiler.dart';
 import 'package:expect/expect.dart';
 import 'memory_compiler.dart';
 
diff --git a/tests/compiler/dart2js/deferred_load_graph_segmentation_test.dart b/tests/compiler/dart2js/deferred_load_graph_segmentation_test.dart
index 1fa3534..9c91d69 100644
--- a/tests/compiler/dart2js/deferred_load_graph_segmentation_test.dart
+++ b/tests/compiler/dart2js/deferred_load_graph_segmentation_test.dart
@@ -7,7 +7,7 @@
 // much be included in the initial download (loaded eagerly).
 
 import 'package:async_helper/async_helper.dart';
-import 'package:compiler/src/dart2jslib.dart';
+import 'package:compiler/src/compiler.dart';
 import 'package:compiler/src/deferred_load.dart';
 import 'package:expect/expect.dart';
 import 'memory_compiler.dart';
@@ -22,7 +22,7 @@
       return compiler.libraryLoader.lookupLibrary(Uri.parse(name));
     }
 
-    var main = compiler.mainApp.find(Compiler.MAIN);
+    var main = compiler.mainFunction;
     Expect.isNotNull(main, "Could not find 'main'");
     compiler.deferredLoadTask.onResolutionComplete(main);
 
diff --git a/tests/compiler/dart2js/deferred_mirrors_test.dart b/tests/compiler/dart2js/deferred_mirrors_test.dart
index c92aaa1..d48550c 100644
--- a/tests/compiler/dart2js/deferred_mirrors_test.dart
+++ b/tests/compiler/dart2js/deferred_mirrors_test.dart
@@ -10,7 +10,7 @@
 import 'package:expect/expect.dart';
 import 'package:async_helper/async_helper.dart';
 import 'memory_compiler.dart';
-import 'package:compiler/src/dart2jslib.dart'
+import 'package:compiler/src/compiler.dart'
        as dart2js;
 
 Future runTest(String mainScript, test) async {
@@ -30,7 +30,7 @@
 
 runTests() async {
   await runTest('memory:main.dart', (compiler) {
-    var main = compiler.mainApp.find(dart2js.Compiler.MAIN);
+    var main = compiler.mainFunction;
     Expect.isNotNull(main, "Could not find 'main'");
     compiler.deferredLoadTask.onResolutionComplete(main);
     var outputUnitForElement = compiler.deferredLoadTask.outputUnitForElement;
@@ -53,7 +53,7 @@
     Expect.isTrue(true);
   });
   await runTest('memory:main3.dart', (compiler) {
-    var main = compiler.mainApp.find(dart2js.Compiler.MAIN);
+    var main = compiler.mainFunction;
     Expect.isNotNull(main, "Could not find 'main'");
     compiler.deferredLoadTask.onResolutionComplete(main);
     var outputUnitForElement = compiler.deferredLoadTask.outputUnitForElement;
@@ -68,7 +68,7 @@
     Expect.equals(outputUnitForElement(main), outputUnitForElement(C));
   });
   await runTest('memory:main4.dart', (compiler) {
-    var main = compiler.mainApp.find(dart2js.Compiler.MAIN);
+    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/deferred_not_in_main_test.dart b/tests/compiler/dart2js/deferred_not_in_main_test.dart
index 002d9e5..2955879 100644
--- a/tests/compiler/dart2js/deferred_not_in_main_test.dart
+++ b/tests/compiler/dart2js/deferred_not_in_main_test.dart
@@ -7,26 +7,30 @@
 // much be included in the initial download (loaded eagerly).
 
 import 'package:async_helper/async_helper.dart';
-import 'package:compiler/src/dart2jslib.dart';
+import 'package:compiler/src/compiler.dart';
 import 'package:expect/expect.dart';
 import 'memory_compiler.dart';
 
 void main() {
+  deferredTest1();
+  deferredTest2();
+}
+
+void deferredTest1() {
   asyncTest(() async {
     CompilationResult result =
-        await runCompiler(memorySourceFiles: MEMORY_SOURCE_FILES);
+        await runCompiler(memorySourceFiles: TEST1);
     Compiler compiler = result.compiler;
 
     lookupLibrary(name) {
       return compiler.libraryLoader.lookupLibrary(Uri.parse(name));
     }
 
-    var main = compiler.mainApp.find(Compiler.MAIN);
+    var main = compiler.mainFunction;
     var outputUnitForElement = compiler.deferredLoadTask.outputUnitForElement;
 
     var mainOutputUnit = compiler.deferredLoadTask.mainOutputUnit;
     var backend = compiler.backend;
-    var classes = backend.emitter.neededClasses;
     var lib1 = lookupLibrary("memory:lib1.dart");
     var lib2 = lookupLibrary("memory:lib2.dart");
     var foo1 = lib1.find("foo1");
@@ -36,9 +40,29 @@
   });
 }
 
+void deferredTest2() {
+  asyncTest(() async {
+    CompilationResult result = await runCompiler(memorySourceFiles: TEST2);
+    Compiler compiler = result.compiler;
+
+    lookupLibrary(name) {
+      return compiler.libraryLoader.lookupLibrary(Uri.parse(name));
+    }
+
+    var main = compiler.mainFunction;
+    var outputUnitForElement = compiler.deferredLoadTask.outputUnitForElement;
+
+    var mainOutputUnit = compiler.deferredLoadTask.mainOutputUnit;
+    var shared = lookupLibrary("memory:shared.dart");
+    var a = shared.find("A");
+
+    Expect.equals(mainOutputUnit, outputUnitForElement(a));
+  });
+}
+
 // lib1 imports lib2 deferred. But mainlib never uses DeferredLibrary.
 // Test that this case works.
-const Map MEMORY_SOURCE_FILES = const {
+const Map TEST1 = const {
   "main.dart":"""
 library mainlib;
 
@@ -65,3 +89,31 @@
 void foo2() {}
 """,
 };
+
+// main indirectly uses class A from shared. A should still be included in the
+// main fragment.
+const Map TEST2 = const {
+  "main.dart":"""
+import 'def.dart' deferred as def;
+import 'shared.dart';
+
+typedef void F(x);
+
+main() {
+  print(foo is F);
+  def.loadLibrary().then((_) {
+    def.toto();
+  });
+}
+""",
+  "def.dart":"""
+import 'shared.dart';
+
+toto() { print(new A()); }
+""",
+  "shared.dart":"""
+class A {}
+class B extends A {}
+foo(B b) => null;
+""",
+};
diff --git a/tests/compiler/dart2js/diagnostic_reporter_helper.dart b/tests/compiler/dart2js/diagnostic_reporter_helper.dart
new file mode 100644
index 0000000..0bff795
--- /dev/null
+++ b/tests/compiler/dart2js/diagnostic_reporter_helper.dart
@@ -0,0 +1,75 @@
+// 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 dart2js.diagnostic_reporter.helper;
+
+import 'package:compiler/src/diagnostics/diagnostic_listener.dart';
+import 'package:compiler/src/diagnostics/messages.dart';
+import 'package:compiler/src/diagnostics/spannable.dart';
+import 'package:compiler/src/diagnostics/source_span.dart';
+import 'package:compiler/src/elements/elements.dart';
+
+abstract class DiagnosticReporterWrapper extends DiagnosticReporter {
+  DiagnosticReporter get reporter;
+
+  @override
+  DiagnosticMessage createMessage(
+      Spannable spannable,
+      MessageKind messageKind,
+      [Map arguments = const {}]) {
+    return reporter.createMessage(spannable, messageKind, arguments);
+  }
+
+  @override
+  internalError(Spannable spannable, message) {
+    return reporter.internalError(spannable, message);
+  }
+
+  @override
+  void log(message) {
+    return reporter.log(message);
+  }
+
+  @override
+  DiagnosticOptions get options => reporter.options;
+
+  @override
+  void reportError(
+      DiagnosticMessage message,
+      [List<DiagnosticMessage> infos = const <DiagnosticMessage> []]) {
+    reporter.reportError(message, infos);
+  }
+
+  @override
+  void reportHint(
+      DiagnosticMessage message,
+      [List<DiagnosticMessage> infos = const <DiagnosticMessage> []]) {
+    reporter.reportHint(message, infos);
+  }
+
+  @override
+  void reportInfo(
+      Spannable node,
+      MessageKind errorCode,
+      [Map arguments = const {}]) {
+    reporter.reportInfo(node, errorCode, arguments);
+  }
+
+  @override
+  void reportWarning(
+      DiagnosticMessage message,
+      [List<DiagnosticMessage> infos = const <DiagnosticMessage> []]) {
+    reporter.reportWarning(message, infos);
+  }
+
+  @override
+  SourceSpan spanFromSpannable(Spannable node) {
+    return reporter.spanFromSpannable(node);
+  }
+
+  @override
+  withCurrentElement(Element element, f()) {
+    return reporter.withCurrentElement(element, f);
+  }
+}
diff --git a/tests/compiler/dart2js/dictionary_types_test.dart b/tests/compiler/dart2js/dictionary_types_test.dart
index af56b54..f173c23 100644
--- a/tests/compiler/dart2js/dictionary_types_test.dart
+++ b/tests/compiler/dart2js/dictionary_types_test.dart
@@ -146,8 +146,8 @@
   if (!createCode) {
     checker(typesTask, getType, compiler);
   } else {
-    var element = compiler.mainApp.findExported('main');
-    var code = compiler.backend.assembleCode(element);
+    var element = compiler.mainFunction;
+    var code = compiler.backend.getGeneratedCode(element);
     checker(code);
   }
 }
diff --git a/tests/compiler/dart2js/dump_info_test.dart b/tests/compiler/dart2js/dump_info_test.dart
index c5da18c..575d6d6 100644
--- a/tests/compiler/dart2js/dump_info_test.dart
+++ b/tests/compiler/dart2js/dump_info_test.dart
@@ -3,11 +3,10 @@
 // BSD-style license that can be found in the LICENSE file.
 // Test that parameters keep their names in the output.
 
-import "package:expect/expect.dart";
-import "package:async_helper/async_helper.dart";
-import 'memory_compiler.dart';
-import 'package:compiler/src/dump_info.dart';
 import 'dart:convert';
+import 'package:expect/expect.dart';
+import 'package:async_helper/async_helper.dart';
+import 'memory_compiler.dart';
 
 const String TEST_BASIC= r"""
 library main;
@@ -103,8 +102,6 @@
   var compiler = result.compiler;
   Expect.isFalse(compiler.compilationFailed);
   var dumpTask = compiler.dumpInfoTask;
-  dumpTask.collectInfo();
-  var info = dumpTask.infoCollector;
 
   StringBuffer sb = new StringBuffer();
   dumpTask.dumpInfoJson(sb);
diff --git a/tests/compiler/dart2js/duplicate_library_test.dart b/tests/compiler/dart2js/duplicate_library_test.dart
index 8536370..80aa6fe 100644
--- a/tests/compiler/dart2js/duplicate_library_test.dart
+++ b/tests/compiler/dart2js/duplicate_library_test.dart
@@ -8,7 +8,8 @@
 import 'dart:async';
 import 'package:async_helper/async_helper.dart';
 import 'package:expect/expect.dart';
-import 'package:compiler/src/dart2jslib.dart' show MessageKind;
+import 'package:compiler/src/commandline_options.dart';
+import 'package:compiler/src/diagnostics/messages.dart' show MessageKind;
 import 'memory_compiler.dart';
 
 void check(String kind,
@@ -30,7 +31,7 @@
       memorySourceFiles: source,
       diagnosticHandler: collector,
       showDiagnostics: true,
-      options: ['--analyze-only', '--analyze-all'],
+      options: [Flags.analyzeOnly, Flags.analyzeAll],
       packageRoot: Uri.parse('memory:pkg/'));
 
   Expect.isTrue(collector.errors.isEmpty);
diff --git a/tests/compiler/dart2js/embedded_category_api_boundary_test.dart b/tests/compiler/dart2js/embedded_category_api_boundary_test.dart
new file mode 100644
index 0000000..cbd973e
--- /dev/null
+++ b/tests/compiler/dart2js/embedded_category_api_boundary_test.dart
@@ -0,0 +1,48 @@
+// Copyright (c) 2015, the Fletch project authors. Please see the AUTHORS file
+// 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.
+
+/// Tests that analyzing everything from the libraries that are public from the
+/// embedded category does not cause elements from other libraries to be
+/// processed.
+library embedded_category_boundary_test;
+
+import 'package:expect/expect.dart';
+import 'package:async_helper/async_helper.dart';
+import 'package:compiler/src/compiler.dart';
+import 'package:compiler/src/elements/elements.dart';
+import 'package:sdk_library_metadata/libraries.dart';
+
+import 'analyze_helper.dart';
+
+main() async {
+  List<Uri> uriList = new List<Uri>();
+  libraries.forEach((String name, LibraryInfo info) {
+    if (info.categories.contains(Category.embedded)) {
+      uriList.add(new Uri(scheme: 'dart', path: name));
+    }
+  });
+  asyncTest(() async {
+    analyze(uriList, {},
+        checkResults: checkResults, analyzeMain: true, analyzeAll: false);
+  });
+}
+
+/// These elements are currently escaping from dart:async via
+/// `core._Resource#_readAsStream`.
+Set<String> whiteList = new Set.from([
+  "function(StreamController#addError)",
+  "getter(StreamController#stream)",
+  "setter(StreamController#onListen)"
+]);
+
+bool checkResults(Compiler compiler, CollectingDiagnosticHandler handler) {
+  return compiler.enqueuer.resolution.processedElements
+      .every((Element element) {
+    if (whiteList.contains("$element")) return true;
+    LibraryInfo info = libraries[element.library.canonicalUri.path];
+    bool isAllowedInEmbedded =
+        info.isInternal || info.categories.contains(Category.embedded);
+    return isAllowedInEmbedded;
+  });
+}
diff --git a/tests/compiler/dart2js/erroneous_element_test.dart b/tests/compiler/dart2js/erroneous_element_test.dart
index 154ff0a..737f721 100644
--- a/tests/compiler/dart2js/erroneous_element_test.dart
+++ b/tests/compiler/dart2js/erroneous_element_test.dart
@@ -2,16 +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 "package:expect/expect.dart";
-import 'package:compiler/src/elements/elements.dart';
-import 'parser_helper.dart';
+import 'package:expect/expect.dart';
 
+import 'package:compiler/src/diagnostics/messages.dart'
+    show MessageKind;
+import 'package:compiler/src/elements/elements.dart';
 import 'package:compiler/src/elements/modelx.dart'
     show ErroneousElementX;
 
-import 'package:compiler/src/dart2jslib.dart'
-    show MessageKind;
-
 void main() {
   ErroneousElement e = new ErroneousElementX(MessageKind.GENERIC,
                                              {'text': 'error'},
diff --git a/tests/compiler/dart2js/exit_code_test.dart b/tests/compiler/dart2js/exit_code_test.dart
index 0ef45e3..ff03975 100644
--- a/tests/compiler/dart2js/exit_code_test.dart
+++ b/tests/compiler/dart2js/exit_code_test.dart
@@ -13,22 +13,29 @@
 
 import 'package:compiler/compiler.dart' as old_api;
 import 'package:compiler/compiler_new.dart' as api;
+import 'package:compiler/src/common/codegen.dart';
 import 'package:compiler/src/compile_time_constants.dart';
+import 'package:compiler/src/compiler.dart';
 import 'package:compiler/src/dart2js.dart' as entry;
-import 'package:compiler/src/dart2jslib.dart';
+import 'package:compiler/src/diagnostics/diagnostic_listener.dart';
+import 'package:compiler/src/diagnostics/invariant.dart';
+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/library_loader.dart';
 import 'package:compiler/src/null_compiler_output.dart';
 import 'package:compiler/src/old_to_new_api.dart';
 import 'package:compiler/src/resolution/resolution.dart';
-import 'package:compiler/src/scanner/scannerlib.dart';
-import 'package:compiler/src/util/util.dart';
+import 'package:compiler/src/scanner/scanner_task.dart';
+import 'diagnostic_reporter_helper.dart';
 
 class TestCompiler extends apiimpl.Compiler {
   final String testMarker;
   final String testType;
   final Function onTest;
+  DiagnosticReporter reporter;
 
   TestCompiler(api.CompilerInput inputProvider,
                api.CompilerOutput outputProvider,
@@ -46,6 +53,7 @@
               packageRoot, options, environment, packageConfig, findPackages) {
     scanner = new TestScanner(this);
     resolver = new TestResolver(this, backend.constantCompilerTask);
+    reporter = new TestDiagnosticReporter(this, super.reporter);
     test('Compiler');
   }
 
@@ -74,13 +82,6 @@
     return super.codegen(work, world);
   }
 
-  withCurrentElement(Element element, f()) {
-    return super.withCurrentElement(element, () {
-      test('Compiler.withCurrentElement');
-      return f();
-    });
-  }
-
   test(String marker) {
     if (marker == testMarker) {
       switch (testType) {
@@ -94,17 +95,19 @@
         break;
       case 'warning':
         onTest(testMarker, testType);
-        reportWarning(NO_LOCATION_SPANNABLE,
-                      MessageKind.GENERIC, {'text': marker});
+        reporter.reportWarningMessage(
+            NO_LOCATION_SPANNABLE,
+            MessageKind.GENERIC, {'text': marker});
         break;
       case 'error':
         onTest(testMarker, testType);
-        reportError(NO_LOCATION_SPANNABLE,
-                    MessageKind.GENERIC, {'text': marker});
+        reporter.reportErrorMessage(
+            NO_LOCATION_SPANNABLE,
+            MessageKind.GENERIC, {'text': marker});
         break;
       case 'internalError':
         onTest(testMarker, testType);
-        internalError(NO_LOCATION_SPANNABLE, marker);
+        reporter.internalError(NO_LOCATION_SPANNABLE, marker);
         break;
       case 'NoSuchMethodError':
         onTest(testMarker, testType);
@@ -118,6 +121,21 @@
   }
 }
 
+class TestDiagnosticReporter extends DiagnosticReporterWrapper {
+  final TestCompiler compiler;
+  final DiagnosticReporter reporter;
+
+  TestDiagnosticReporter(this.compiler, this.reporter);
+
+  @override
+  withCurrentElement(Element element, f()) {
+    return super.withCurrentElement(element, () {
+      compiler.test('Compiler.withCurrentElement');
+      return f();
+    });
+  }
+}
+
 class TestScanner extends ScannerTask {
   TestScanner(TestCompiler compiler) : super(compiler);
 
diff --git a/tests/compiler/dart2js/expect_annotations_test.dart b/tests/compiler/dart2js/expect_annotations_test.dart
index e8ecc40..62e29ae 100644
--- a/tests/compiler/dart2js/expect_annotations_test.dart
+++ b/tests/compiler/dart2js/expect_annotations_test.dart
@@ -4,7 +4,7 @@
 
 import 'package:expect/expect.dart';
 import 'package:async_helper/async_helper.dart';
-import 'package:compiler/src/dart2jslib.dart';
+import 'package:compiler/src/compiler.dart';
 import 'package:compiler/src/elements/elements.dart';
 import 'package:compiler/src/js_backend/js_backend.dart';
 import 'package:compiler/src/types/types.dart';
diff --git a/tests/compiler/dart2js/field_codegen_test.dart b/tests/compiler/dart2js/field_codegen_test.dart
index eb1a6c4..c7036a4 100644
--- a/tests/compiler/dart2js/field_codegen_test.dart
+++ b/tests/compiler/dart2js/field_codegen_test.dart
@@ -6,7 +6,6 @@
 import "package:expect/expect.dart";
 import "package:async_helper/async_helper.dart";
 import 'compiler_helper.dart';
-import 'parser_helper.dart';
 
 const String TEST_NULL0 = r"""
 class A { static var x; }
diff --git a/tests/compiler/dart2js/field_type_simple_inferer_test.dart b/tests/compiler/dart2js/field_type_simple_inferer_test.dart
index be6259d..2a33d95 100644
--- a/tests/compiler/dart2js/field_type_simple_inferer_test.dart
+++ b/tests/compiler/dart2js/field_type_simple_inferer_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.
 
-import 'dart:async';
 import 'package:expect/expect.dart';
-import "package:async_helper/async_helper.dart";
+import 'package:async_helper/async_helper.dart';
 import 'package:compiler/src/types/types.dart'
     show TypeMask;
 
 import 'compiler_helper.dart';
-import 'parser_helper.dart';
 import 'type_mask_test_helper.dart';
 
 void compileAndFind(String code,
diff --git a/tests/compiler/dart2js/find_my_name_test.dart b/tests/compiler/dart2js/find_my_name_test.dart
index 60aba02c..dd93af3 100644
--- a/tests/compiler/dart2js/find_my_name_test.dart
+++ b/tests/compiler/dart2js/find_my_name_test.dart
@@ -36,7 +36,7 @@
 testClass(String code, MockCompiler compiler) {
   int skip = code.indexOf('{');
   ClassElementX cls = parseUnit(code, compiler, compiler.mainApp).head;
-  cls.parseNode(compiler);
+  cls.parseNode(compiler.parsing);
   cls.forEachLocalMember((Element e) {
     String name = e.name;
     if (e.isConstructor) {
diff --git a/tests/compiler/dart2js/frontend_checker.dart b/tests/compiler/dart2js/frontend_checker.dart
index 67b88d3..8624cfe 100644
--- a/tests/compiler/dart2js/frontend_checker.dart
+++ b/tests/compiler/dart2js/frontend_checker.dart
@@ -9,6 +9,7 @@
 import 'dart:io';
 
 import 'package:async_helper/async_helper.dart';
+import 'package:compiler/src/commandline_options.dart';
 import 'package:compiler/src/util/uri_extras.dart'
     show relativize;
 import 'memory_compiler.dart';
@@ -49,7 +50,7 @@
           entryPoint: Uri.parse('memory:$testFileName'),
           memorySourceFiles: {testFileName: testSources[testName]},
           diagnosticHandler: collector,
-          options: ['--analyze-only']..addAll(options),
+          options: [Flags.analyzeOnly]..addAll(options),
           showDiagnostics: verbose,
           cachedCompiler: cachedCompiler);
       var compiler = result.compiler;
diff --git a/tests/compiler/dart2js/generate_code_with_compile_time_errors_test.dart b/tests/compiler/dart2js/generate_code_with_compile_time_errors_test.dart
index 1f0ab5d..d2b29b0 100644
--- a/tests/compiler/dart2js/generate_code_with_compile_time_errors_test.dart
+++ b/tests/compiler/dart2js/generate_code_with_compile_time_errors_test.dart
@@ -9,7 +9,7 @@
 
 import 'package:expect/expect.dart';
 import 'package:async_helper/async_helper.dart';
-import 'package:compiler/src/dart2jslib.dart';
+import 'package:compiler/src/compiler.dart';
 import 'package:compiler/src/dart_backend/dart_backend.dart';
 import 'package:compiler/src/js_backend/js_backend.dart';
 import 'memory_compiler.dart';
diff --git a/tests/compiler/dart2js/gvn_dynamic_field_get_test.dart b/tests/compiler/dart2js/gvn_dynamic_field_get_test.dart
index 2da3b97..350dcc4 100644
--- a/tests/compiler/dart2js/gvn_dynamic_field_get_test.dart
+++ b/tests/compiler/dart2js/gvn_dynamic_field_get_test.dart
@@ -4,10 +4,10 @@
 // Test that dart2js gvns dynamic getters that don't have side
 // effects.
 
-import "package:expect/expect.dart";
-import "package:async_helper/async_helper.dart";
+import 'package:expect/expect.dart';
+import 'package:async_helper/async_helper.dart';
 import 'compiler_helper.dart';
-import 'parser_helper.dart';
+import 'package:compiler/src/universe/selector.dart' show Selector;
 
 const String TEST = r"""
 class A {
diff --git a/tests/compiler/dart2js/if_do_while_test.dart b/tests/compiler/dart2js/if_do_while_test.dart
index 64b76f8..406e981 100644
--- a/tests/compiler/dart2js/if_do_while_test.dart
+++ b/tests/compiler/dart2js/if_do_while_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.
 
-import 'dart:async';
 import 'package:expect/expect.dart';
 import 'package:async_helper/async_helper.dart';
 import 'compiler_helper.dart';
diff --git a/tests/compiler/dart2js/import_mirrors_test.dart b/tests/compiler/dart2js/import_mirrors_test.dart
index 190d414..514bedb 100644
--- a/tests/compiler/dart2js/import_mirrors_test.dart
+++ b/tests/compiler/dart2js/import_mirrors_test.dart
@@ -10,7 +10,9 @@
 import 'dart:async';
 import 'package:expect/expect.dart';
 import 'package:async_helper/async_helper.dart';
-import 'package:compiler/src/warnings.dart' show MessageKind, MessageTemplate;
+import 'package:compiler/src/diagnostics/messages.dart' show
+    MessageKind,
+    MessageTemplate;
 import 'memory_compiler.dart';
 
 const DIRECT_IMPORT = const {
diff --git a/tests/compiler/dart2js/in_user_code_test.dart b/tests/compiler/dart2js/in_user_code_test.dart
index 00b2549..0a6e13f 100644
--- a/tests/compiler/dart2js/in_user_code_test.dart
+++ b/tests/compiler/dart2js/in_user_code_test.dart
@@ -7,7 +7,8 @@
 import 'dart:async';
 import 'package:async_helper/async_helper.dart';
 import 'package:expect/expect.dart';
-import 'package:compiler/src/dart2jslib.dart' show Compiler;
+import 'package:compiler/src/commandline_options.dart';
+import 'package:compiler/src/compiler.dart' show Compiler;
 import 'memory_compiler.dart';
 
 const SOURCE = const {
@@ -47,7 +48,7 @@
   CompilationResult result = await runCompiler(
     entryPoints: entryPoints,
     memorySourceFiles: SOURCE,
-    options: ['--analyze-only', '--analyze-all'],
+    options: [Flags.analyzeOnly, Flags.analyzeAll],
     packageRoot: Uri.parse('memory:pkg/'));
   Compiler compiler = result.compiler;
   expectedResults.forEach((String uri, bool expectedResult) {
diff --git a/tests/compiler/dart2js/incremental/compile_all.dart b/tests/compiler/dart2js/incremental/compile_all.dart
index ea41d2c..a89ec32 100644
--- a/tests/compiler/dart2js/incremental/compile_all.dart
+++ b/tests/compiler/dart2js/incremental/compile_all.dart
@@ -43,7 +43,7 @@
   int testCount = 0;
   int skipCount = 0;
   Set<String> crashes = new Set<String>();
-  Compiler memoryCompiler = compilerFor(sources);
+  Compiler memoryCompiler = compilerFor(memorySourceFiles: sources);
   FormattingDiagnosticHandler handler = memoryCompiler.handler;
   handler.verbose = verbose;
   var options = ['--analyze-main'];
diff --git a/tests/compiler/dart2js/inference_stats_test.dart b/tests/compiler/dart2js/inference_stats_test.dart
new file mode 100644
index 0000000..e742b0a
--- /dev/null
+++ b/tests/compiler/dart2js/inference_stats_test.dart
@@ -0,0 +1,339 @@
+// 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.
+// SharedOptions=-Dsend_stats=true
+
+/// Tests that we compute send metrics correctly in many simple scenarios.
+library dart2js.test.send_measurements_test;
+
+import 'dart:async';
+import 'package:test/test.dart';
+import 'package:dart2js_info/info.dart';
+import 'memory_compiler.dart';
+import 'dart:io';
+
+main() {
+  test('nothing is reachable, nothing to count', () {
+    return _check('''
+      main() {}
+      test() { int x = 3; }
+      ''');
+  });
+
+  test('local variable read', () {
+    return _check('''
+      main() => test();
+      test() { int x = 3; int y = x; }
+      ''',
+      localSend: 1); // from `int y = x`;
+  });
+
+  test('generative constructor call', () {
+    return _check('''
+      class A {
+        get f => 1;
+      }
+      main() => test();
+      test() { new A(); }
+      ''',
+      constructorSend: 1);  // from new A()
+  });
+
+  group('instance call', () {
+    test('monomorphic only one implementor', () {
+      return _check('''
+        class A {
+          get f => 1;
+        }
+        main() => test();
+        test() { new A().f; }
+        ''',
+        constructorSend: 1, // new A()
+        instanceSend: 1);   // f resolved to A.f
+    });
+
+    test('monomorphic only one type possible from types', () {
+      return _check('''
+        class A {
+          get f => 1;
+        }
+        class B extends A {
+          get f => 1;
+        }
+        main() => test();
+        test() { new B().f; }
+        ''',
+        constructorSend: 1,
+        instanceSend: 1); // f resolved to B.f
+    });
+
+    test('monomorphic only one type possible from liveness', () {
+      return _check('''
+        class A {
+          get f => 1;
+        }
+        class B extends A {
+          get f => 1;
+        }
+        main() => test();
+        test() { A x = new B(); x.f; }
+        ''',
+        constructorSend: 1, // new B()
+        localSend: 1,       // x in x.f
+        instanceSend: 1);  // x.f known to resolve to B.f
+    });
+
+    test('monomorphic one possible, more than one live', () {
+      return _check('''
+        class A {
+          get f => 1;
+        }
+        class B extends A {
+          get f => 1;
+        }
+        main() { new A(); test(); }
+        test() { B x = new B(); x.f; }
+        ''',
+        constructorSend: 1, // new B()
+        localSend: 1,       // x in x.f
+        instanceSend: 1);   // x.f resolves to B.f
+    });
+
+    test('polymorphic-virtual couple possible types from liveness', () {
+        // Note: this would be an instanceSend if we used the inferrer.
+      return _check('''
+        class A {
+          get f => 1;
+        }
+        class B extends A {
+          get f => 1;
+        }
+        main() { new A(); test(); }
+        test() { A x = new B(); x.f; }
+        ''',
+        constructorSend: 1, // new B()
+        localSend: 1,       // x in x.f
+        virtualSend: 1);    // x.f may be A.f or B.f (types alone is not enough)
+    });
+
+    test("polymorphic-dynamic: type annotations don't help", () {
+      return _check('''
+        class A {
+          get f => 1;
+        }
+        class B extends A {
+          get f => 1;
+        }
+        main() { new A(); test(); }
+        test() { var x = new B(); x.f; }
+        ''',
+        constructorSend: 1, // new B()
+        localSend: 1,       // x in x.f
+        dynamicSend: 1);    // x.f could be any `f` or no `f`
+    });
+  });
+
+  group('instance this call', () {
+    test('monomorphic only one implementor', () {
+      return _check('''
+        class A {
+          get f => 1;
+          test() => this.f;
+        }
+        main() => new A().test();
+        ''',
+        instanceSend: 1);   // this.f resolved to A.f
+    });
+
+    test('monomorphic only one type possible from types & liveness', () {
+      return _check('''
+        class A {
+          get f => 1;
+          test() => this.f;
+        }
+        class B extends A {
+          get f => 1;
+        }
+        main() => new B().test();
+        ''',
+        instanceSend: 1); // this.f resolved to B.f
+    });
+
+    test('polymorphic-virtual couple possible types from liveness', () {
+        // Note: this would be an instanceSend if we used the inferrer.
+      return _check('''
+        class A {
+          get f => 1;
+          test() => this.f;
+        }
+        class B extends A {
+          get f => 1;
+        }
+        main() { new A(); new B().test(); }
+        ''',
+        virtualSend: 1);    // this.f may be A.f or B.f
+    });
+  });
+
+  group('noSuchMethod', () {
+    test('error will be thrown', () {
+      return _check('''
+        class A {
+        }
+        main() { test(); }
+        test() { new A().f; }
+        ''',
+        constructorSend: 1, // new B()
+        nsmErrorSend: 1);   // f not there, A has no nSM
+    });
+
+    test('nSM will be called - one option', () {
+      return _check('''
+        class A {
+          noSuchMethod(i) => null;
+        }
+        main() { test(); }
+        test() { new A().f; }
+        ''',
+        constructorSend: 1,    // new B()
+        singleNsmCallSend: 1); // f not there, A has nSM
+    });
+
+    // TODO(sigmund): is it worth splitting multiNSMvirtual?
+    test('nSM will be called - multiple options', () {
+      return _check('''
+        class A {
+          noSuchMethod(i) => null;
+        }
+        class B extends A {
+          noSuchMethod(i) => null;
+        }
+        main() { new A(); test(); }
+        test() { A x = new B(); x.f; }
+        ''',
+        constructorSend: 1,   // new B()
+        localSend: 1,         // x in x.f
+        multiNsmCallSend: 1); // f not there, A has nSM
+    });
+
+    // TODO(sigmund): is it worth splitting multiNSMvirtual?
+    test('nSM will be called - multiple options', () {
+      return _check('''
+        class A {
+          noSuchMethod(i) => null;
+        }
+        class B extends A {
+          // don't count A's nsm as distinct
+        }
+        main() { new A(); test(); }
+        test() { A x = new B(); x.f; }
+        ''',
+        constructorSend: 1,    // new B()
+        localSend: 1,          // x in x.f
+        singleNsmCallSend: 1); // f not there, A has nSM
+    });
+
+    test('nSM will be called - multiple options', () {
+      return _check('''
+        class A {
+          noSuchMethod(i) => null;
+        }
+        class B extends A {
+          get f => null;
+        }
+        main() { new A(); test(); }
+        test() { A x = new B(); x.f; }
+        ''',
+        constructorSend: 1,   // new B()
+        localSend: 1,         // x in x.f
+        dynamicSend: 1);      // f not known to be there there, A has nSM
+    });
+
+    test('nSM in super', () {
+      return _check('''
+        class A {
+          noSuchMethod(i) => null;
+        }
+        class B extends A {
+          get f => super.f;
+        }
+        main() { new A(); test(); }
+        test() { A x = new B(); x.f; }
+        ''',
+        singleNsmCallSend: 1, //   super.f
+        testMethod: 'f');
+    });
+  });
+}
+
+
+/// Checks that the `test` function in [code] produces the given distribution of
+/// sends.
+_check(String code, {int staticSend: 0, int superSend: 0, int localSend: 0,
+    int constructorSend: 0, int typeVariableSend: 0, int nsmErrorSend: 0,
+    int singleNsmCallSend: 0, int instanceSend: 0, int interceptorSend: 0,
+    int multiNsmCallSend: 0, int virtualSend: 0, int multiInterceptorSend: 0,
+    int dynamicSend: 0, String testMethod: 'test'}) async {
+
+  // Set up the expectation.
+  var expected = new Measurements();
+  int monomorphic = staticSend + superSend + localSend + constructorSend +
+    typeVariableSend + nsmErrorSend + singleNsmCallSend + instanceSend +
+    interceptorSend;
+  int polymorphic = multiNsmCallSend + virtualSend + multiInterceptorSend +
+    dynamicSend;
+
+  expected.counters[Metric.monomorphicSend] = monomorphic;
+  expected.counters[Metric.staticSend] = staticSend;
+  expected.counters[Metric.superSend] = superSend;
+  expected.counters[Metric.localSend] = localSend;
+  expected.counters[Metric.constructorSend] = constructorSend;
+  expected.counters[Metric.typeVariableSend] = typeVariableSend;
+  expected.counters[Metric.nsmErrorSend] = nsmErrorSend;
+  expected.counters[Metric.singleNsmCallSend] = singleNsmCallSend;
+  expected.counters[Metric.instanceSend] = instanceSend;
+  expected.counters[Metric.interceptorSend] = interceptorSend;
+
+  expected.counters[Metric.polymorphicSend] = polymorphic;
+  expected.counters[Metric.multiNsmCallSend] = multiNsmCallSend;
+  expected.counters[Metric.virtualSend] = virtualSend;
+  expected.counters[Metric.multiInterceptorSend] = multiInterceptorSend;
+  expected.counters[Metric.dynamicSend] = dynamicSend;
+
+  expected.counters[Metric.send] = monomorphic + polymorphic;
+
+  // Run the compiler to get the results.
+  var all = await _compileAndGetStats(code);
+  var function = all.functions.firstWhere((f) => f.name == testMethod,
+      orElse: () => null);
+  var result = function?.measurements;
+  if (function == null) {
+    expect(expected.counters[Metric.send], 0);
+    return;
+  }
+
+  expect(result, isNotNull);
+
+  _compareMetric(Metric key) {
+    var expectedValue = expected.counters[key];
+    var value = result.counters[key];
+    if (value == null) value = 0;
+    if (value == expectedValue) return;
+    expect(expectedValue, value,
+        reason: "count for `$key` didn't match:\n"
+        "expected measurements:\n${recursiveDiagnosticString(expected, key)}\n"
+        "actual measurements:\n${recursiveDiagnosticString(result, key)}");
+  }
+
+  _compareMetric(Metric.send);
+  expected.counters.keys.forEach(_compareMetric);
+}
+
+/// Helper that runs the compiler and returns the [GlobalResult] computed for
+/// it.
+Future<AllInfo> _compileAndGetStats(String program) async {
+  var result = await runCompiler(
+      memorySourceFiles: {'main.dart': program}, options: ['--dump-info']);
+  expect(result.compiler.compilationFailed, isFalse);
+  return result.compiler.dumpInfoTask.infoCollector.result;
+}
diff --git a/tests/compiler/dart2js/issue13354_test.dart b/tests/compiler/dart2js/issue13354_test.dart
index 6a38130..3402206 100644
--- a/tests/compiler/dart2js/issue13354_test.dart
+++ b/tests/compiler/dart2js/issue13354_test.dart
@@ -5,7 +5,6 @@
 import 'package:expect/expect.dart';
 import "package:async_helper/async_helper.dart";
 import 'compiler_helper.dart';
-import 'parser_helper.dart';
 import 'type_mask_test_helper.dart';
 
 const String TEST = """
diff --git a/tests/compiler/dart2js/js_backend_cps_ir.dart b/tests/compiler/dart2js/js_backend_cps_ir.dart
index f1fd70a..95852f1 100644
--- a/tests/compiler/dart2js/js_backend_cps_ir.dart
+++ b/tests/compiler/dart2js/js_backend_cps_ir.dart
@@ -7,11 +7,13 @@
 
 import 'package:async_helper/async_helper.dart';
 import 'package:expect/expect.dart';
-import 'package:compiler/src/apiimpl.dart'
-       show Compiler;
+import 'package:compiler/src/apiimpl.dart' show
+    Compiler;
 import 'memory_compiler.dart';
 import 'package:compiler/src/js/js.dart' as js;
-import 'package:compiler/src/common.dart' show Element, ClassElement;
+import 'package:compiler/src/elements/elements.dart' show
+    ClassElement,
+    Element;
 
 const String TEST_MAIN_FILE = 'test.dart';
 
@@ -79,8 +81,9 @@
             Expect.fail('Expected:\n$expected\nbut found\n$found');
           }
         }
-      } catch (e) {
+      } catch (e, st) {
         print(e);
+        print(st);
         Expect.fail('The following test failed to compile:\n'
                     '${formatTest(files)}');
       }
diff --git a/tests/compiler/dart2js/js_backend_cps_ir_basic_test.dart b/tests/compiler/dart2js/js_backend_cps_ir_basic_test.dart
index 6873d05..51d2762 100644
--- a/tests/compiler/dart2js/js_backend_cps_ir_basic_test.dart
+++ b/tests/compiler/dart2js/js_backend_cps_ir_basic_test.dart
@@ -25,18 +25,19 @@
   print('($m)');
 }""",r"""
 function() {
+  var l = [1, 2, 3], m = P.LinkedHashMap_LinkedHashMap$_literal(["s", 1]);
   P.print("()");
   P.print("(true)");
   P.print("(1)");
   P.print("(" + H.S([1, 2, 3]) + ")");
   P.print("(" + H.S(P.LinkedHashMap_LinkedHashMap$_literal(["s", 1])) + ")");
   P.print("(1)");
-  P.print("(" + H.S([1, 2, 3]) + ")");
-  P.print("(" + H.S(P.LinkedHashMap_LinkedHashMap$_literal(["s", 1])) + ")");
+  P.print("(" + H.S(l) + ")");
+  P.print("(" + H.S(m) + ")");
 }"""),
   const TestEntry("""
-foo(a, [b = "b"]) => b;
-bar(a, {b: "b", c: "c"}) => c;
+foo(a, [b = "b"]) { print(b); return b; }
+bar(a, {b: "b", c: "c"}) { print(c); return c; }
 main() {
   foo(0);
   foo(1, 2);
@@ -58,6 +59,7 @@
   const TestEntry(
   """
 foo(a) {
+  print(a);
   return a;
 }
 main() {
@@ -83,7 +85,7 @@
 }"""),
   const TestEntry(
   """
-foo() { return 42; }
+foo() { print(42); return 42; }
 main() { return foo(); }
   """,
   """function() {
diff --git a/tests/compiler/dart2js/js_backend_cps_ir_closures_test.dart b/tests/compiler/dart2js/js_backend_cps_ir_closures_test.dart
index 2f58293..820be3e 100644
--- a/tests/compiler/dart2js/js_backend_cps_ir_closures_test.dart
+++ b/tests/compiler/dart2js/js_backend_cps_ir_closures_test.dart
@@ -20,10 +20,26 @@
 """,
 r"""
 function(x) {
-  var _box_0 = {};
+  P.print(J.getInterceptor$ns(x).$add(x, "1"));
+}"""),
+
+  const TestEntry("""
+main(x) {
+  a() {
+    return x;
+  }
+  x = x + '1';
+  print(a());
+  return a;
+}
+""",
+r"""
+function(x) {
+  var _box_0 = {}, a = new V.main_a(_box_0);
   _box_0._captured_x_0 = x;
   _box_0._captured_x_0 = J.getInterceptor$ns(x = _box_0._captured_x_0).$add(x, "1");
-  P.print(new V.main_a(_box_0).call$0());
+  P.print(a.call$0());
+  return a;
 }"""),
 
   const TestEntry("""
@@ -36,7 +52,23 @@
 """,
 r"""
 function(x) {
-  P.print(new V.main_a(x).call$0());
+  P.print(x);
+}"""),
+
+  const TestEntry("""
+main(x) {
+  a() {
+    return x;
+  }
+  print(a());
+  return a;
+}
+""",
+r"""
+function(x) {
+  var a = new V.main_a(x);
+  P.print(a.call$0());
+  return a;
 }"""),
 
   const TestEntry("""
@@ -49,10 +81,25 @@
 """,
 r"""
 function() {
-  var _box_0 = {};
+  P.print(122 + 1);
+}"""),
+
+  const TestEntry("""
+main() {
+  var x = 122;
+  var a = () => x;
+  x = x + 1;
+  print(a());
+  return a;
+}
+""",
+r"""
+function() {
+  var _box_0 = {}, a = new V.main_closure(_box_0);
   _box_0._captured_x_0 = 122;
   _box_0._captured_x_0 = _box_0._captured_x_0 + 1;
-  P.print(new V.main_closure(_box_0).call$0());
+  P.print(a.call$0());
+  return a;
 }"""),
 
   const TestEntry("""
@@ -68,10 +115,28 @@
 """,
 r"""
 function() {
-  var _box_0 = {};
+  P.print(122 + 1);
+}"""),
+
+  const TestEntry("""
+main() {
+  var x = 122;
+  var a = () {
+    var y = x;
+    return () => y;
+  };
+  x = x + 1;
+  print(a()());
+  return a;
+}
+""",
+r"""
+function() {
+  var _box_0 = {}, a = new V.main_closure(_box_0);
   _box_0._captured_x_0 = 122;
   _box_0._captured_x_0 = _box_0._captured_x_0 + 1;
-  P.print(new V.main_closure(_box_0).call$0().call$0());
+  P.print(a.call$0().call$0());
+  return a;
 }"""),
 
   const TestEntry("""
@@ -86,10 +151,8 @@
 r"""
 function() {
   var a = null, i = 0;
-  while (i < 10) {
-    a = new V.main_closure(i);
-    i = i + 1;
-  }
+  for (; i < 10; a = new V.main_closure(i), i = i + 1)
+    ;
   P.print(a.call$0());
 }"""),
 
@@ -108,7 +171,7 @@
 }"""),
 
   const TestEntry("""
-staticMethod(x) => x;
+staticMethod(x) { print(x); return x; }
 main(x) {
   var tearOff = staticMethod;
   print(tearOff(123));
diff --git a/tests/compiler/dart2js/js_backend_cps_ir_control_flow_test.dart b/tests/compiler/dart2js/js_backend_cps_ir_control_flow_test.dart
index e777044..2365d4f 100644
--- a/tests/compiler/dart2js/js_backend_cps_ir_control_flow_test.dart
+++ b/tests/compiler/dart2js/js_backend_cps_ir_control_flow_test.dart
@@ -19,7 +19,7 @@
     ;
 }"""),
   const TestEntry("""
-foo(a) => a;
+foo(a) { print(a); return a; }
 
 main() {
   while (true) {
@@ -46,7 +46,7 @@
       }
 }"""),
   const TestEntry("""
-foo(a) => a;
+foo(a) { print(a); return a; }
 
 main() {
   for (int i = 0; foo(true); i = foo(i)) {
@@ -57,18 +57,18 @@
 }""", """
 function() {
   var i = 0;
-  while (P.identical(V.foo(true), true)) {
+  for (; V.foo(true) === true; i = V.foo(i)) {
     P.print(1);
-    if (P.identical(V.foo(false), true))
+    if (V.foo(false) === true)
       break;
-    i = V.foo(i);
   }
   P.print(2);
 }"""),
 const TestEntry("""
-foo(a) => a;
+foo(a) { print(a); return a; }
 
 main() {
+ foo(false);
  if (foo(true)) {
    print(1);
  } else {
@@ -77,13 +77,15 @@
  print(3);
 }""", """
 function() {
+  V.foo(false);
   V.foo(true) ? P.print(1) : P.print(2);
   P.print(3);
 }"""),
 const TestEntry("""
-foo(a) => a;
+foo(a) { print(a); return a; }
 
 main() {
+ foo(false);
  if (foo(true)) {
    print(1);
    print(1);
@@ -94,6 +96,7 @@
  print(3);
 }""", """
 function() {
+  V.foo(false);
   if (V.foo(true)) {
     P.print(1);
     P.print(1);
@@ -115,7 +118,7 @@
   P.print("good");
 }"""),
   const TestEntry("""
-foo() => 2;
+foo() { print('2'); return 2; }
 main() {
   if (foo()) {
     print('bad');
@@ -136,11 +139,10 @@
 }""",r"""
 function() {
   var list = [1, 2, 3, 4, 5, 6], $length = list.length, i = 0;
-  while (i < list.length) {
+  for (; i < list.length; i = i + 1) {
     P.print(list[i]);
     if ($length !== list.length)
       H.throwConcurrentModificationError(list);
-    i = i + 1;
   }
 }"""),
   const TestEntry("""
@@ -153,12 +155,8 @@
   }
 }""",r"""
 function() {
-  var xs = ["x", "y", "z"], ys = ["A", "B", "C"], $length = xs.length, length1 = ys.length, i, i1, current, current1;
-  if ($length !== xs.length)
-    H.throwConcurrentModificationError(xs);
-  i = 0;
-  i1 = 0;
-  while (i < xs.length) {
+  var xs = ["x", "y", "z"], ys = ["A", "B", "C"], $length = xs.length, length1 = ys.length, i = 0, i1 = 0, current, current1;
+  for (; i < xs.length; i = i + 1, i1 = i1 + 1) {
     current = xs[i];
     if (length1 !== ys.length)
       H.throwConcurrentModificationError(ys);
@@ -169,8 +167,6 @@
     P.print(current1);
     if ($length !== xs.length)
       H.throwConcurrentModificationError(xs);
-    i = i + 1;
-    i1 = i1 + 1;
   }
 }"""),
 ];
diff --git a/tests/compiler/dart2js/js_backend_cps_ir_interceptors_test.dart b/tests/compiler/dart2js/js_backend_cps_ir_interceptors_test.dart
index 4e7b0cf..947d919 100644
--- a/tests/compiler/dart2js/js_backend_cps_ir_interceptors_test.dart
+++ b/tests/compiler/dart2js/js_backend_cps_ir_interceptors_test.dart
@@ -34,17 +34,13 @@
 r"""
 function() {
   var l = ["hest", ["h", "e", "s", "t"]], i = 0, x_, x, j;
-  P.print(l.length);
-  while (i < l.length) {
-    if (i < 0 || i >= l.length)
-      H.ioore(l, i);
+  for (P.print(l.length); i < l.length; i = i + 1) {
     x_ = J.getInterceptor$as(x = l[i]);
-    j = 0;
-    while (j < x_.get$length(x)) {
-      P.print(x_.$index(x, j));
-      j = j + 1;
+    for (j = 0; j < x_.get$length(x); j = j + 1) {
+      if (j >= x.length)
+        H.ioore(x, j);
+      P.print(x[j]);
     }
-    i = i + 1;
   }
 }"""),
 ];
diff --git a/tests/compiler/dart2js/js_backend_cps_ir_operators_test.dart b/tests/compiler/dart2js/js_backend_cps_ir_operators_test.dart
index 138e684..a6d7a1c 100644
--- a/tests/compiler/dart2js/js_backend_cps_ir_operators_test.dart
+++ b/tests/compiler/dart2js/js_backend_cps_ir_operators_test.dart
@@ -11,7 +11,8 @@
 const List<TestEntry> tests = const [
   const TestEntry("main() { return true ? 42 : 'foo'; }"),
   const TestEntry("""
-foo() => foo();
+var x = 1;
+foo() => ++x > 10;
 main() {
   print(foo() ? "hello world" : "bad bad");
 }""","""
@@ -19,16 +20,17 @@
   P.print(V.foo() ? "hello world" : "bad bad");
 }"""),
   const TestEntry("""
-foo() => null;
+var x = 1;
+foo() => ++x > 10;
 main() {
   print(foo() ? "hello world" : "bad bad");
 }""","""
 function() {
-  V.foo();
-  P.print("bad bad");
+  P.print(V.foo() ? "hello world" : "bad bad");
 }"""),
   const TestEntry("""
-get foo => foo;
+var x = 1;
+get foo => ++x > 10;
 main() {
   print(foo ? "hello world" : "bad bad");
 }""","""
@@ -36,18 +38,27 @@
   P.print(V.foo() ? "hello world" : "bad bad");
 }"""),
   const TestEntry("""
-get foo => foo;
+var x = 1;
+get foo => ++x > 10;
 main() { print(foo && foo); }
 """, """
 function() {
-  P.print(V.foo() ? !!P.identical(V.foo(), true) : false);
+  P.print(V.foo() ? !!V.foo() : false);
 }"""),
   const TestEntry("""
+var x = 1;
+get foo => ++x > 10;
+main() { print(foo || foo); }
+""","""
+function() {
+  P.print(V.foo() ? true : !!V.foo());
+}"""),
+const TestEntry("""
 get foo => foo;
 main() { print(foo || foo); }
 ""","""
 function() {
-  P.print(V.foo() ? true : !!P.identical(V.foo(), true));
+  V.foo();
 }"""),
 
 // Needs interceptor calling convention
@@ -73,10 +84,8 @@
   print(list);
 }""", r"""
 function() {
-  var list = [1, 2, 3], v0 = 1;
-  if (v0 < 0 || v0 >= list.length)
-    H.ioore(list, v0);
-  list[v0] = 6;
+  var list = [1, 2, 3];
+  list[1] = 6;
   P.print(list);
 }"""),
 ];
diff --git a/tests/compiler/dart2js/js_backend_cps_ir_source_information_test.dart b/tests/compiler/dart2js/js_backend_cps_ir_source_information_test.dart
index 713281f..bbfbdd6 100644
--- a/tests/compiler/dart2js/js_backend_cps_ir_source_information_test.dart
+++ b/tests/compiler/dart2js/js_backend_cps_ir_source_information_test.dart
@@ -14,7 +14,7 @@
 import 'package:compiler/src/cps_ir/cps_ir_nodes.dart' as ir;
 import 'package:compiler/src/cps_ir/cps_ir_nodes_sexpr.dart' as ir;
 import 'package:compiler/src/js/js.dart' as js;
-import 'package:compiler/src/common.dart' show Element, ClassElement;
+import 'package:compiler/src/elements/elements.dart';
 
 const String TEST_MAIN_FILE = 'test.dart';
 
@@ -66,7 +66,8 @@
   for (TestEntry test in tests) {
     Map files = {TEST_MAIN_FILE: test.source};
     asyncTest(() {
-      Compiler compiler = compilerFor(files, options: <String>['--use-cps-ir']);
+      Compiler compiler = compilerFor(
+          memorySourceFiles: files, options: <String>['--use-cps-ir']);
       ir.FunctionDefinition irNodeForMain;
 
       void cacheIrNodeForMain(Element function, ir.FunctionDefinition irNode) {
@@ -77,7 +78,8 @@
       }
 
       Uri uri = Uri.parse('memory:$TEST_MAIN_FILE');
-      compiler.irBuilder.builderCallback = cacheIrNodeForMain;
+      compiler.backend.functionCompiler.cpsBuilderTask.builderCallback =
+          cacheIrNodeForMain;
 
       return compiler.run(uri).then((bool success) {
         Expect.isTrue(success);
@@ -121,7 +123,7 @@
   }
 }
 
-class IrSourceInformationVisitor extends ir.RecursiveVisitor {
+class IrSourceInformationVisitor extends ir.TrampolineRecursiveVisitor {
   List<String> sourceInformation = <String>[];
 
   @override
diff --git a/tests/compiler/dart2js/js_spec_optimization_test.dart b/tests/compiler/dart2js/js_spec_optimization_test.dart
index 078104f..8c83b3b 100644
--- a/tests/compiler/dart2js/js_spec_optimization_test.dart
+++ b/tests/compiler/dart2js/js_spec_optimization_test.dart
@@ -70,7 +70,7 @@
     return compiler.runCompiler(uri).then((_) {
       var element = findElement(compiler, 'main');
       var backend = compiler.backend;
-      String generated = backend.assembleCode(element);
+      String generated = backend.getGeneratedCode(element);
 
       for (Match match in directivePattern.allMatches(test)) {
         String directive = match.group(1);
diff --git a/tests/compiler/dart2js/js_spec_string_test.dart b/tests/compiler/dart2js/js_spec_string_test.dart
index 5344177..1481da4 100644
--- a/tests/compiler/dart2js/js_spec_string_test.dart
+++ b/tests/compiler/dart2js/js_spec_string_test.dart
@@ -6,25 +6,33 @@
 
 import 'package:expect/expect.dart';
 import 'package:compiler/src/native/native.dart';
-import 'package:compiler/src/dart2jslib.dart'
-    show DiagnosticListener;
-import 'package:compiler/src/universe/universe.dart'
+import 'package:compiler/src/diagnostics/diagnostic_listener.dart';
+import 'package:compiler/src/diagnostics/messages.dart';
+import 'package:compiler/src/universe/side_effects.dart'
     show SideEffects;
 
 const OBJECT = 'Object';
 const NULL = 'Null';
 
-class Listener implements DiagnosticListener {
+class Listener extends DiagnosticReporter {
   String errorMessage;
   internalError(spannable, message) {
     errorMessage = message;
     throw "error";
   }
-  reportError(spannable, kind, [arguments]) {
-    errorMessage = '$arguments';  // E.g.  "{text: Duplicate tag 'new'.}"
+  reportError(message, [infos]) {
+
+    errorMessage =
+        '${message.message.arguments}'; // E.g.  "{text: Duplicate tag 'new'.}"
     throw "error";
   }
 
+  @override
+  DiagnosticMessage createMessage(spannable, messageKind, [arguments]) {
+    return new DiagnosticMessage(null, spannable,
+        MessageTemplate.TEMPLATES[messageKind].message(arguments));
+  }
+
   noSuchMethod(_) => null;
 }
 
diff --git a/tests/compiler/dart2js/least_upper_bound_test.dart b/tests/compiler/dart2js/least_upper_bound_test.dart
index 23aa02b..c4706bf 100644
--- a/tests/compiler/dart2js/least_upper_bound_test.dart
+++ b/tests/compiler/dart2js/least_upper_bound_test.dart
@@ -6,11 +6,11 @@
 
 import 'package:expect/expect.dart';
 import 'package:async_helper/async_helper.dart';
-import 'type_test_helper.dart';
 import 'package:compiler/src/dart_types.dart';
-import "package:compiler/src/elements/elements.dart"
+import 'package:compiler/src/elements/elements.dart'
        show Element, ClassElement;
-import 'package:compiler/src/util/util.dart';
+
+import 'type_test_helper.dart';
 
 void main() {
   testInterface1();
@@ -381,12 +381,12 @@
     checkLub(DartType a, DartType b, DartType expectedLub) {
       DartType lub = env.computeLeastUpperBound(a, b);
       if (a != b) {
-        expectedLub = expectedLub.unalias(env.compiler);
-        lub = lub.unalias(env.compiler);
+        expectedLub = expectedLub.unaliased;
+        lub = lub.unaliased;
       }
       Expect.equals(expectedLub, lub,
-          'Unexpected lub(${a.unalias(env.compiler)},'
-                         '${b.unalias(env.compiler)}) = '
+          'Unexpected lub(${a.unaliased},'
+                         '${b.unaliased} = '
                          '${lub}, expected ${expectedLub}');
     }
 
diff --git a/tests/compiler/dart2js/library_resolution_test.dart b/tests/compiler/dart2js/library_resolution_test.dart
index 5eeb342..3d6c035 100644
--- a/tests/compiler/dart2js/library_resolution_test.dart
+++ b/tests/compiler/dart2js/library_resolution_test.dart
@@ -17,13 +17,13 @@
 import 'package:expect/expect.dart' show
     Expect;
 
-import 'package:compiler/src/elements/elements.dart' show
-    LibraryElement;
-
-import 'package:compiler/src/dart2jslib.dart' show
+import 'package:compiler/src/diagnostics/messages.dart' show
     MessageKind,
     MessageTemplate;
 
+import 'package:compiler/src/elements/elements.dart' show
+    LibraryElement;
+
 import 'package:compiler/src/null_compiler_output.dart' show
     NullCompilerOutput;
 
@@ -37,13 +37,13 @@
 
 const LibraryInfo mock1LibraryInfo = const LibraryInfo(
     "mock1.dart",
-    category: "Shared",
+    categories: "Client,Embedded",
     documented: false,
     platforms: DART2JS_PLATFORM);
 
 const LibraryInfo mock2LibraryInfo = const LibraryInfo(
     "mock2.dart",
-    category: "Shared",
+    categories: "Client,Embedded",
     documented: false,
     platforms: DART2JS_PLATFORM);
 
diff --git a/tests/compiler/dart2js/list_tracer2_test.dart b/tests/compiler/dart2js/list_tracer2_test.dart
index 249f956..5c60954 100644
--- a/tests/compiler/dart2js/list_tracer2_test.dart
+++ b/tests/compiler/dart2js/list_tracer2_test.dart
@@ -11,7 +11,6 @@
     show ContainerTypeMask, TypeMask;
 
 import 'compiler_helper.dart';
-import 'parser_helper.dart';
 import 'type_mask_test_helper.dart';
 
 const String TEST = r'''
diff --git a/tests/compiler/dart2js/list_tracer3_test.dart b/tests/compiler/dart2js/list_tracer3_test.dart
index 27451ba..e9decd9 100644
--- a/tests/compiler/dart2js/list_tracer3_test.dart
+++ b/tests/compiler/dart2js/list_tracer3_test.dart
@@ -11,7 +11,6 @@
     show ContainerTypeMask, TypeMask;
 
 import 'compiler_helper.dart';
-import 'parser_helper.dart';
 import 'type_mask_test_helper.dart';
 
 
diff --git a/tests/compiler/dart2js/list_tracer_test.dart b/tests/compiler/dart2js/list_tracer_test.dart
index 8391cb6..d6edb88 100644
--- a/tests/compiler/dart2js/list_tracer_test.dart
+++ b/tests/compiler/dart2js/list_tracer_test.dart
@@ -8,7 +8,6 @@
     show ContainerTypeMask, TypeMask;
 
 import 'compiler_helper.dart';
-import 'parser_helper.dart';
 import 'type_mask_test_helper.dart';
 
 String generateTest(String listAllocation) {
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 992aab0..77aa786 100644
--- a/tests/compiler/dart2js/list_tracer_typed_data_length_test.dart
+++ b/tests/compiler/dart2js/list_tracer_typed_data_length_test.dart
@@ -6,7 +6,7 @@
 import 'package:async_helper/async_helper.dart';
 import 'package:compiler/src/types/types.dart'
     show ContainerTypeMask, TypeMask;
-import 'package:compiler/src/dart2jslib.dart';
+import 'package:compiler/src/compiler.dart';
 
 import 'memory_compiler.dart';
 import 'compiler_helper.dart' show findElement;
diff --git a/tests/compiler/dart2js/lookup_map_test.dart b/tests/compiler/dart2js/lookup_map_test.dart
new file mode 100644
index 0000000..d3893b0
--- /dev/null
+++ b/tests/compiler/dart2js/lookup_map_test.dart
@@ -0,0 +1,394 @@
+// 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 tests.dart2js.lookup_map_test;
+
+import 'package:test/test.dart';
+import 'compiler_helper.dart';
+
+main() {
+  Map<String, String> testDeclarations = {
+    'types': r'''
+      import 'package:lookup_map/lookup_map.dart';
+      class A {}
+      class B {}
+      class C {}
+      class D {}
+      class E {}''',
+
+    'const keys': r'''
+      import 'package:lookup_map/lookup_map.dart';
+      class Key { final name; const Key(this.name); }
+      const A = const Key("A");
+      const B = const Key("B");
+      const C = const Key("C");
+      const D = const Key("D");
+      const E = const Key("E");''',
+
+    'mixed keys': r'''
+      import 'package:lookup_map/lookup_map.dart';
+      class Key { final name; const Key(this.name); }
+      const A = const Key("A");
+      class B {}
+      const C = const Key("C");
+      class D {}
+      const E = const Key("E");''',
+  };
+
+  testDeclarations.forEach((name, declarations) {
+    group(name, () => _commonTests(declarations));
+  });
+  group('generic', _genericTests);
+  group('metadata', _metadataTests);
+  group('unsupported', _unsupportedKeysTests);
+  group('mirrors', _mirrorsTests);
+}
+
+/// Common tests for both declarations that use Types or other const expressions
+/// as keys. The argument [declaration] should contain a declaration for
+/// constant keys named `A`, `B`, `C`, `D`, and `E`.
+_commonTests(String declarations) {
+  test('live entries are kept', () async {
+    String generated = await compileAll("""
+        $declarations
+        const map = const LookupMap(const [
+            A, "the-text-for-A",
+        ]);
+        main() => print(map[A]);
+    """);
+    expect(generated, contains("the-text-for-A"));
+  });
+
+  test('live entries are kept - single-pair', () async {
+    String generated = await compileAll("""
+        $declarations
+        const map = const LookupMap.pair(A, "the-text-for-A");
+        main() => print(map[A]);
+    """);
+    expect(generated, contains("the-text-for-A"));
+  });
+
+  test('unused entries are removed', () async {
+    String generated = await compileAll("""
+        $declarations
+        const map = const LookupMap(const [
+            A, "the-text-for-A",
+            B, "the-text-for-B",
+        ]);
+        main() => print(map[A]);
+    """);
+    expect(generated, isNot(contains("the-text-for-B")));
+  });
+
+  test('unused entries are removed - nested maps', () async {
+    String generated = await compileAll("""
+        $declarations
+        const map = const LookupMap(const [], const [
+          const LookupMap(const [
+              A, "the-text-for-A",
+              B, "the-text-for-B",
+          ]),
+        ]);
+        main() => print(map[A]);
+    """);
+    expect(generated, isNot(contains("the-text-for-B")));
+  });
+
+  test('unused entries are removed - single-pair', () async {
+    String generated = await compileAll("""
+        $declarations
+        const map = const LookupMap.pair(A, "the-text-for-A");
+        main() => print(map[A]);
+    """);
+    expect(generated, isNot(contains("the-text-for-B")));
+  });
+
+  test('unused entries are removed - nested single-pair', () async {
+    String generated = await compileAll("""
+        import 'package:lookup_map/lookup_map.dart';
+        $declarations
+        const map = const LookupMap(const [], const [
+          const LookupMap.pair(A, "the-text-for-A"),
+          const LookupMap.pair(B, "the-text-for-B"),
+        ]);
+        main() => print(map[A]);
+    """);
+    expect(generated, isNot(contains("the-text-for-B")));
+  });
+
+  test('works if entries are declared separate from map', () async {
+    String generated = await compileAll("""
+        $declarations
+        const entries = const [
+            A, "the-text-for-A",
+            B, "the-text-for-B",
+        ];
+        const map = const LookupMap(entries);
+        main() => print(map[A]);
+    """);
+    expect(generated, isNot(contains("the-text-for-B")));
+  });
+
+  test('escaping entries disable tree-shaking', () async {
+    String generated = await compileAll("""
+        $declarations
+        const entries = const [
+            A, "the-text-for-A",
+            B, "the-text-for-B",
+        ];
+        const map = const LookupMap(entries);
+        main() {
+          entries.forEach(print);
+          print(map[A]);
+        }
+    """);
+    expect(generated, contains("the-text-for-B"));
+  });
+
+  test('uses include recursively reachable data', () async {
+    String generated = await compileAll("""
+        $declarations
+        const map = const LookupMap(const [
+            A, const ["the-text-for-A", B],
+            B, const ["the-text-for-B", C],
+            C, const ["the-text-for-C"],
+            D, const ["the-text-for-D", E],
+            E, const ["the-text-for-E"],
+        ]);
+        main() => print(map[map[A][1]]);
+    """);
+    expect(generated, contains("the-text-for-A"));
+    expect(generated, contains("the-text-for-B"));
+    expect(generated, contains("the-text-for-C"));
+    expect(generated, isNot(contains("the-text-for-D")));
+    expect(generated, isNot(contains("the-text-for-E")));
+  });
+
+  test('uses are found through newly discovered code', () async {
+    String generated = await compileAll("""
+        $declarations
+        f1() => map[B][1]();
+        f2() => E;
+        const map = const LookupMap(const [
+            A, const ["the-text-for-A", f1],
+            B, const ["the-text-for-B", f2],
+            C, const ["the-text-for-C"],
+            D, const ["the-text-for-D"],
+            E, const ["the-text-for-E"],
+        ]);
+        main() => print(map[A][1]());
+    """);
+    expect(generated, contains("the-text-for-A"));
+    expect(generated, contains("the-text-for-B"));
+    expect(generated, isNot(contains("the-text-for-C")));
+    expect(generated, isNot(contains("the-text-for-C")));
+    expect(generated, contains("the-text-for-E"));
+  });
+
+  test('support subclassing LookupMap', () async {
+    String generated = await compileAll("""
+        $declarations
+        class S extends LookupMap {
+          const S(list) : super(list);
+        }
+        const map = const S(const [
+            A, "the-text-for-A",
+            B, "the-text-for-B",
+        ]);
+
+        main() => print(map[A]);
+    """);
+    expect(generated, contains("the-text-for-A"));
+    expect(generated, isNot(contains("the-text-for-B")));
+  });
+
+  test('constants keys are processed recursively', () async {
+    String generated = await compileAll("""
+        $declarations
+
+        const nested = const [ B ];
+        const map = const LookupMap(const [
+            A, "the-text-for-A",
+            B, "the-text-for-B",
+        ]);
+        main() => print(map[nested]);
+    """);
+    expect(generated, isNot(contains("the-text-for-A")));
+    expect(generated, contains("the-text-for-B"));
+  });
+}
+
+/// Tests specific to type keys, we ensure that generic type arguments are
+/// considered.
+_genericTests() {
+  test('generic type allocations are considered used', () async {
+    String generated = await compileAll(r"""
+        import 'package:lookup_map/lookup_map.dart';
+        class A{}
+        class M<T>{ get type => T; }
+        const map = const LookupMap(const [
+            A, "the-text-for-A",
+        ]);
+        main() => print(map[new M<A>().type]);
+    """);
+    expect(generated, contains("the-text-for-A"));
+  });
+
+  test('generics in type signatures are ignored', () async {
+    String generated = await compileAll(r"""
+        import 'package:lookup_map/lookup_map.dart';
+        class A{}
+        class B{}
+        class M<T>{ get type => T; }
+        _factory(M<B> t) => t;
+        const map = const LookupMap(const [
+            A, const ["the-text-for-A", _factory],
+            B, "the-text-for-B",
+        ]);
+        main() => print(map[A]);
+    """);
+    expect(generated, isNot(contains("the-text-for-B")));
+  });
+
+  // regression test for a failure when looking up `dynamic` in a generic.
+  test('do not choke with dynamic type arguments', () async {
+    await compileAll(r"""
+        import 'package:lookup_map/lookup_map.dart';
+        class A{}
+        class M<T>{ get type => T; }
+        const map = const LookupMap(const [
+            A, "the-text-for-A",
+        ]);
+        main() => print(map[new M<dynamic>().type]);
+    """);
+  });
+}
+
+/// Sanity checks about metadata: it is ignored for codegen even though it is
+/// visited during resolution.
+_metadataTests() {
+  test('metadata is ignored', () async {
+    String generated = await compileAll(r"""
+        import 'package:lookup_map/lookup_map.dart';
+        class A{ const A(); }
+
+        @A()
+        class M {}
+        const map = const LookupMap(const [
+            A, "the-text-for-A",
+        ]);
+        main() => print(map[M]);
+    """);
+    expect(generated, isNot(contains("the-text-for-A")));
+  });
+
+  test('shared constants used in metadata are ignored', () async {
+    String generated = await compileAll(r"""
+        import 'package:lookup_map/lookup_map.dart';
+        const annot = const B(foo: A);
+
+        @B(foo: annot)
+        class A{ const A(); }
+        class B{ final Type foo; const B({this.foo}); }
+
+        class M {}
+        const map = const LookupMap(const [
+            A, const ["the-text-for-A", annot]
+        ]);
+        main() => print(map[M]);
+    """);
+    expect(generated, isNot(contains("the-text-for-A")));
+  });
+}
+
+_unsupportedKeysTests() {
+  test('primitive and string keys are always kept', () async {
+    String generated = await compileAll("""
+        import 'package:lookup_map/lookup_map.dart';
+        const A = "A";
+        const B = "B";
+        const map = const LookupMap(const [
+            A, "the-text-for-A",
+            B, "the-text-for-B",
+            3, "the-text-for-3",
+            1.1, "the-text-for-1.1",
+            false, "the-text-for-false",
+        ]);
+        main() => print(map[A]);
+    """);
+    expect(generated, contains("the-text-for-A"));
+    expect(generated, contains("the-text-for-B"));
+    expect(generated, contains("the-text-for-3"));
+    expect(generated, contains("the-text-for-1.1"));
+    expect(generated, contains("the-text-for-false"));
+  });
+
+  test('non-type const keys implementing equals are not removed', () async {
+    String generated = await compileAll("""
+        import 'package:lookup_map/lookup_map.dart';
+        class Key {
+          final name;
+          const Key(this.name);
+          int get hashCode => name.hashCode * 13;
+          operator ==(other) => other is Key && name == other.name;
+        }
+        const A = const Key("A");
+        const B = const Key("B");
+        const map = const LookupMap(const [
+            A, "the-text-for-A",
+            B, "the-text-for-B",
+        ]);
+        main() => print(map[A]);
+    """);
+    expect(generated, contains("the-text-for-B"));
+  });
+}
+
+_mirrorsTests() {
+  test('retain entries if mirrors keep the type', () async {
+    String generated = await compileAll("""
+        import 'dart:mirrors';
+        import 'package:lookup_map/lookup_map.dart';
+        class A {}
+        class B {}
+        class C {}
+        const map = const LookupMap(const [
+          A, "the-text-for-A",
+          B, "the-text-for-B",
+          C, "the-text-for-C",
+        ]);
+        main() {
+          reflectType(A);
+          print(map[A]);
+        }
+    """);
+    expect(generated, contains("the-text-for-A"));
+    expect(generated, contains("the-text-for-B"));
+    expect(generated, contains("the-text-for-C"));
+  });
+
+  test('exclude entries if MirrorsUsed also exclude the type', () async {
+    String generated = await compileAll("""
+        library foo;
+        @MirrorsUsed(targets: const [B])
+        import 'dart:mirrors';
+        import 'package:lookup_map/lookup_map.dart';
+        class A {}
+        class B {}
+        class C {}
+        const map = const LookupMap(const [
+          A, "the-text-for-A",
+          B, "the-text-for-B",
+          C, "the-text-for-C",
+        ]);
+        main() {
+          reflectType(A);
+          print(map[A]);
+        }
+    """);
+    expect(generated, contains("the-text-for-A"));
+    expect(generated, contains("the-text-for-B"));
+    expect(generated, isNot(contains("the-text-for-C")));
+  });
+}
diff --git a/tests/compiler/dart2js/map_tracer_keys_test.dart b/tests/compiler/dart2js/map_tracer_keys_test.dart
index 5610c59..0c2edb7 100644
--- a/tests/compiler/dart2js/map_tracer_keys_test.dart
+++ b/tests/compiler/dart2js/map_tracer_keys_test.dart
@@ -8,8 +8,6 @@
     show ContainerTypeMask, TypeMask;
 
 import 'compiler_helper.dart';
-import 'parser_helper.dart';
-import 'type_mask_test_helper.dart';
 
 
 String generateTest(String key, String value, bool initial) {
diff --git a/tests/compiler/dart2js/map_tracer_test.dart b/tests/compiler/dart2js/map_tracer_test.dart
index 3405b5c..c45370a 100644
--- a/tests/compiler/dart2js/map_tracer_test.dart
+++ b/tests/compiler/dart2js/map_tracer_test.dart
@@ -8,7 +8,6 @@
     show MapTypeMask, TypeMask;
 
 import 'compiler_helper.dart';
-import 'parser_helper.dart';
 import 'type_mask_test_helper.dart';
 
 
diff --git a/tests/compiler/dart2js/memory_compiler.dart b/tests/compiler/dart2js/memory_compiler.dart
index 4d3c893..be6780f 100644
--- a/tests/compiler/dart2js/memory_compiler.dart
+++ b/tests/compiler/dart2js/memory_compiler.dart
@@ -4,32 +4,26 @@
 
 library dart2js.test.memory_compiler;
 
-import 'memory_source_file_helper.dart';
-
-
-import 'package:compiler/src/null_compiler_output.dart' show
-    NullCompilerOutput;
-
-import 'package:compiler/src/dart2jslib.dart' show
-    Message;
+import 'dart:async';
 
 import 'package:compiler/compiler.dart' show
     DiagnosticHandler;
-
 import 'package:compiler/compiler_new.dart' show
     CompilationResult,
     CompilerDiagnostics,
     CompilerOutput,
     Diagnostic,
     PackagesDiscoveryProvider;
-
-import 'dart:async';
-
+import 'package:compiler/src/diagnostics/messages.dart' show
+    Message;
 import 'package:compiler/src/mirrors/source_mirrors.dart';
 import 'package:compiler/src/mirrors/analyze.dart';
+import 'package:compiler/src/null_compiler_output.dart' show
+    NullCompilerOutput;
+import 'package:compiler/src/library_loader.dart' show
+    LoadedLibraries;
 
-import 'package:compiler/src/library_loader.dart'
-    show LoadedLibraries;
+import 'memory_source_file_helper.dart';
 
 export 'output_collector.dart';
 export 'package:compiler/compiler_new.dart' show
@@ -87,6 +81,10 @@
   bool get hasRegularMessages {
     return messages.any((m) => m.kind != Diagnostic.VERBOSE_INFO);
   }
+
+  void clear() {
+    messages.clear();
+  }
 }
 
 class MultiDiagnostics implements CompilerDiagnostics {
@@ -106,13 +104,15 @@
 CompilerDiagnostics createCompilerDiagnostics(
     CompilerDiagnostics diagnostics,
     SourceFileProvider provider,
-    bool showDiagnostics) {
+    {bool showDiagnostics: true,
+     bool verbose: false}) {
   CompilerDiagnostics handler = diagnostics;
   if (showDiagnostics) {
     if (diagnostics == null) {
-      handler = new FormattingDiagnosticHandler(provider);
+      handler = new FormattingDiagnosticHandler(provider)..verbose = verbose;
     } else {
-      var formattingHandler = new FormattingDiagnosticHandler(provider);
+      var formattingHandler =
+          new FormattingDiagnosticHandler(provider)..verbose = verbose;
       handler = new MultiDiagnostics([diagnostics, formattingHandler]);
     }
   } else if (diagnostics == null) {
@@ -141,7 +141,7 @@
     entryPoint = Uri.parse('memory:main.dart');
   }
   Compiler compiler = compilerFor(
-      memorySourceFiles,
+      memorySourceFiles: memorySourceFiles,
       diagnosticHandler: diagnosticHandler,
       outputProvider: outputProvider,
       options: options,
@@ -159,8 +159,8 @@
 }
 
 Compiler compilerFor(
-    Map<String, String> memorySourceFiles,
-    {CompilerDiagnostics diagnosticHandler,
+    {Map<String, String> memorySourceFiles: const <String, String>{},
+     CompilerDiagnostics diagnosticHandler,
      CompilerOutput outputProvider,
      List<String> options: const <String>[],
      Compiler cachedCompiler,
@@ -187,8 +187,10 @@
     provider = expando[cachedCompiler.provider];
     provider.memorySourceFiles = memorySourceFiles;
   }
-  diagnosticHandler =
-      createCompilerDiagnostics(diagnosticHandler, provider, showDiagnostics);
+  diagnosticHandler = createCompilerDiagnostics(
+      diagnosticHandler, provider,
+      showDiagnostics: showDiagnostics,
+      verbose: options.contains('-v') || options.contains('--verbose'));
 
   if (outputProvider == null) {
     outputProvider = const NullCompilerOutput();
@@ -208,7 +210,7 @@
   if (cachedCompiler != null) {
     compiler.coreLibrary =
         cachedCompiler.libraryLoader.lookupLibrary(Uri.parse('dart:core'));
-    compiler.types = cachedCompiler.types.copy(compiler);
+    compiler.types = cachedCompiler.types.copy(compiler.resolution);
     Map copiedLibraries = {};
     cachedCompiler.libraryLoader.libraries.forEach((library) {
       if (library.isPlatformLibrary) {
@@ -243,10 +245,10 @@
     compiler.deferredLibraryClass = cachedCompiler.deferredLibraryClass;
 
     Iterable cachedTreeElements =
-        cachedCompiler.enqueuer.resolution.resolvedElements;
+        cachedCompiler.enqueuer.resolution.processedElements;
     cachedTreeElements.forEach((element) {
       if (element.library.isPlatformLibrary) {
-        compiler.enqueuer.resolution.registerResolvedElement(element);
+        compiler.enqueuer.resolution.registerProcessedElement(element);
       }
     });
 
@@ -261,7 +263,6 @@
     cachedCompiler.resolver = null;
     cachedCompiler.closureToClassMapper = null;
     cachedCompiler.checker = null;
-    cachedCompiler.irBuilder = null;
     cachedCompiler.typesTask = null;
     cachedCompiler.backend = null;
     // Don't null out the enqueuer as it prevents us from using cachedCompiler
diff --git a/tests/compiler/dart2js/message_kind_helper.dart b/tests/compiler/dart2js/message_kind_helper.dart
index b579e95..9d60632 100644
--- a/tests/compiler/dart2js/message_kind_helper.dart
+++ b/tests/compiler/dart2js/message_kind_helper.dart
@@ -7,12 +7,14 @@
 import 'package:expect/expect.dart';
 import 'dart:async';
 
-import 'package:compiler/src/dart2jslib.dart' show
-    Compiler,
-    MessageKind,
-    MessageTemplate;
+import 'package:compiler/src/commandline_options.dart';
+import 'package:compiler/src/compiler.dart' show
+    Compiler;
 import 'package:compiler/src/dart_backend/dart_backend.dart' show
     DartBackend;
+import 'package:compiler/src/diagnostics/messages.dart' show
+    MessageKind,
+    MessageTemplate;
 import 'package:compiler/src/old_to_new_api.dart' show
     LegacyCompilerDiagnostics;
 
@@ -81,10 +83,10 @@
     bool newBackendIsDart = template.options.contains('--output-type=dart');
 
     Compiler compiler = compilerFor(
-        example,
+        memorySourceFiles: example,
         diagnosticHandler: new LegacyCompilerDiagnostics(collect),
-        options: ['--analyze-only',
-                  '--enable-experimental-mirrors']..addAll(template.options),
+        options: [Flags.analyzeOnly,
+                  Flags.enableExperimentalMirrors]..addAll(template.options),
         cachedCompiler:
              // TODO(johnniwinther): Remove this restriction when constant
              // values can be computed directly from the expressions.
@@ -112,7 +114,7 @@
         }
       }
       Expect.isTrue(messageFound, '"$pattern" does not match any in $messages');
-      Expect.isFalse(compiler.hasCrashed);
+      Expect.isFalse(compiler.reporter.hasCrashed);
       if (!unexpectedMessages.isEmpty) {
         for (String message in unexpectedMessages) {
           print("Unexpected message: $message");
@@ -127,13 +129,13 @@
       bool pendingStuff = false;
       for (var e in compiler.resolver.pendingClassesToBePostProcessed) {
         pendingStuff = true;
-        compiler.reportInfo(
+        compiler.reporter.reportInfo(
             e, MessageKind.GENERIC,
             {'text': 'Pending class to be post-processed.'});
       }
       for (var e in compiler.resolver.pendingClassesToBeResolved) {
         pendingStuff = true;
-        compiler.reportInfo(
+        compiler.reporter.reportInfo(
             e, MessageKind.GENERIC,
             {'text': 'Pending class to be resolved.'});
       }
diff --git a/tests/compiler/dart2js/message_kind_test.dart b/tests/compiler/dart2js/message_kind_test.dart
index 9796595..c3954f0 100644
--- a/tests/compiler/dart2js/message_kind_test.dart
+++ b/tests/compiler/dart2js/message_kind_test.dart
@@ -5,7 +5,7 @@
 import 'package:expect/expect.dart';
 import 'dart:async';
 import "package:async_helper/async_helper.dart";
-import 'package:compiler/src/warnings.dart' show
+import 'package:compiler/src/diagnostics/messages.dart' show
     MessageKind,
     MessageTemplate;
 
@@ -26,7 +26,13 @@
         || name == 'COMPILER_CRASHED'
         || name == 'PLEASE_REPORT_THE_CRASH'
         // We cannot provide examples for patch errors.
-        || name.startsWith('PATCH_')) continue;
+        || name.startsWith('PATCH_')
+        || name == 'LIBRARY_NOT_SUPPORTED'
+        // TODO(johnniwinther): Remove these when [Compiler.reportUnusedCode] is
+        // reenabled.
+        || name == 'UNUSED_METHOD'
+        || name == 'UNUSED_CLASS'
+        || name == 'UNUSED_TYPEDEF') continue;
     if (template.examples != null) {
       examples.add(template);
     } else {
diff --git a/tests/compiler/dart2js/metadata_test.dart b/tests/compiler/dart2js/metadata_test.dart
index 847f469..0f1e9fd 100644
--- a/tests/compiler/dart2js/metadata_test.dart
+++ b/tests/compiler/dart2js/metadata_test.dart
@@ -7,10 +7,16 @@
     show PrimitiveConstantValue;
 import 'package:expect/expect.dart';
 import 'compiler_helper.dart';
-import 'parser_helper.dart';
+import 'package:compiler/src/parser/partial_elements.dart' show
+    PartialMetadataAnnotation;
+import 'package:compiler/src/diagnostics/diagnostic_listener.dart' show
+    DiagnosticReporter;
 
-void checkPosition(Spannable spannable, Node node, String source, compiler) {
-  SourceSpan span = compiler.spanFromSpannable(spannable);
+void checkPosition(Spannable spannable,
+                   Node node,
+                   String source,
+                   DiagnosticReporter reporter) {
+  SourceSpan span = reporter.spanFromSpannable(spannable);
   Expect.isTrue(span.begin < span.end,
                 'begin = ${span.begin}; end = ${span.end}');
   Expect.isTrue(span.end < source.length,
@@ -32,15 +38,16 @@
 
   compileAndCheck(source1, name, (compiler, element) {
     compiler.enqueuer.resolution.queueIsClosed = false;
-    Expect.equals(1, length(element.metadata),
+    Expect.equals(1, element.metadata.length,
         'Unexpected metadata count on $element.');
-    PartialMetadataAnnotation annotation = element.metadata.head;
-    annotation.ensureResolved(compiler);
+    PartialMetadataAnnotation annotation = element.metadata.first;
+    annotation.ensureResolved(compiler.resolution);
     PrimitiveConstantValue value =
         compiler.constants.getConstantValue(annotation.constant);
     Expect.stringEquals('xyz', value.primitiveValue.slowToString());
 
-    checkPosition(annotation, annotation.cachedNode, source1, compiler);
+    checkPosition(
+        annotation, annotation.cachedNode, source1, compiler.reporter);
   });
 
   // Ensure that each repeated annotation has a unique instance of
@@ -52,11 +59,11 @@
 
   compileAndCheck(source2, name, (compiler, element) {
     compiler.enqueuer.resolution.queueIsClosed = false;
-    Expect.equals(2, length(element.metadata));
-    PartialMetadataAnnotation annotation1 = element.metadata.head;
-    PartialMetadataAnnotation annotation2 = element.metadata.tail.head;
-    annotation1.ensureResolved(compiler);
-    annotation2.ensureResolved(compiler);
+    Expect.equals(2, element.metadata.length);
+    PartialMetadataAnnotation annotation1 = element.metadata.elementAt(0);
+    PartialMetadataAnnotation annotation2 = element.metadata.elementAt(1);
+    annotation1.ensureResolved(compiler.resolution);
+    annotation2.ensureResolved(compiler.resolution);
     Expect.isFalse(identical(annotation1, annotation2),
                    'expected unique instances');
     Expect.notEquals(annotation1, annotation2, 'expected unequal instances');
@@ -68,8 +75,10 @@
     Expect.stringEquals('xyz', value1.primitiveValue.slowToString());
     Expect.stringEquals('xyz', value2.primitiveValue.slowToString());
 
-    checkPosition(annotation1, annotation1.cachedNode, source2, compiler);
-    checkPosition(annotation2, annotation2.cachedNode, source2, compiler);
+    checkPosition(
+        annotation1, annotation1.cachedNode, source2, compiler.reporter);
+    checkPosition(
+        annotation2, annotation2.cachedNode, source2, compiler.reporter);
   });
 
   if (isTopLevelOnly) return;
@@ -85,18 +94,19 @@
 
   compileAndCheck(source3, 'Foo', (compiler, element) {
     compiler.enqueuer.resolution.queueIsClosed = false;
-    Expect.equals(0, length(element.metadata));
-    element.ensureResolved(compiler);
-    Expect.equals(0, length(element.metadata));
+    Expect.equals(0, element.metadata.length);
+    element.ensureResolved(compiler.resolution);
+    Expect.equals(0, element.metadata.length);
     element = element.lookupLocalMember(name);
-    Expect.equals(1, length(element.metadata));
-    PartialMetadataAnnotation annotation = element.metadata.head;
-    annotation.ensureResolved(compiler);
+    Expect.equals(1, element.metadata.length);
+    PartialMetadataAnnotation annotation = element.metadata.first;
+    annotation.ensureResolved(compiler.resolution);
     PrimitiveConstantValue value =
         compiler.constants.getConstantValue(annotation.constant);
     Expect.stringEquals('xyz', value.primitiveValue.slowToString());
 
-    checkPosition(annotation, annotation.cachedNode, source3, compiler);
+    checkPosition(
+        annotation, annotation.cachedNode, source3, compiler.reporter);
   });
 
   // Ensure that each repeated annotation has a unique instance of
@@ -110,15 +120,15 @@
 
   compileAndCheck(source4, 'Foo', (compiler, element) {
     compiler.enqueuer.resolution.queueIsClosed = false;
-    Expect.equals(0, length(element.metadata));
-    element.ensureResolved(compiler);
-    Expect.equals(0, length(element.metadata));
+    Expect.equals(0, element.metadata.length);
+    element.ensureResolved(compiler.resolution);
+    Expect.equals(0, element.metadata.length);
     element = element.lookupLocalMember(name);
-    Expect.equals(2, length(element.metadata));
-    PartialMetadataAnnotation annotation1 = element.metadata.head;
-    PartialMetadataAnnotation annotation2 = element.metadata.tail.head;
-    annotation1.ensureResolved(compiler);
-    annotation2.ensureResolved(compiler);
+    Expect.equals(2, element.metadata.length);
+    PartialMetadataAnnotation annotation1 = element.metadata.elementAt(0);
+    PartialMetadataAnnotation annotation2 = element.metadata.elementAt(1);
+    annotation1.ensureResolved(compiler.resolution);
+    annotation2.ensureResolved(compiler.resolution);
     Expect.isFalse(identical(annotation1, annotation2),
                    'expected unique instances');
     Expect.notEquals(annotation1, annotation2, 'expected unequal instances');
@@ -130,8 +140,10 @@
     Expect.stringEquals('xyz', value1.primitiveValue.slowToString());
     Expect.stringEquals('xyz', value2.primitiveValue.slowToString());
 
-    checkPosition(annotation1, annotation1.cachedNode, source4, compiler);
-    checkPosition(annotation1, annotation2.cachedNode, source4, compiler);
+    checkPosition(
+        annotation1, annotation1.cachedNode, source4, compiler.reporter);
+    checkPosition(
+        annotation1, annotation2.cachedNode, source4, compiler.reporter);
   });
 }
 
@@ -151,7 +163,7 @@
 void testLibraryTags() {
   void compileAndCheckLibrary(
       String source,
-      Link<MetadataAnnotation> extractMetadata(LibraryElement element)) {
+      List<MetadataAnnotation> extractMetadata(LibraryElement element)) {
     Uri partUri = new Uri(scheme: 'source', path: 'part.dart');
     String partSource = '@native part of foo;';
 
@@ -169,16 +181,17 @@
       LibraryElement element = compiler.libraryLoader.lookupLibrary(uri);
       Expect.isNotNull(element, 'Cannot find $uri');
 
-      Link<MetadataAnnotation> metadata = extractMetadata(element);
-      Expect.equals(1, length(metadata));
+      List<MetadataAnnotation> metadata = extractMetadata(element);
+      Expect.equals(1, metadata.length);
 
-      PartialMetadataAnnotation annotation = metadata.head;
-      annotation.ensureResolved(compiler);
+      PartialMetadataAnnotation annotation = metadata.first;
+      annotation.ensureResolved(compiler.resolution);
       PrimitiveConstantValue value =
           compiler.constants.getConstantValue(annotation.constant);
       Expect.stringEquals('xyz', value.primitiveValue.slowToString());
 
-      checkPosition(annotation, annotation.cachedNode, source, compiler);
+      checkPosition(
+          annotation, annotation.cachedNode, source, compiler.reporter);
     }));
   }
 
diff --git a/tests/compiler/dart2js/minimal_resolution_test.dart b/tests/compiler/dart2js/minimal_resolution_test.dart
new file mode 100644
index 0000000..b46b340
--- /dev/null
+++ b/tests/compiler/dart2js/minimal_resolution_test.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.
+
+// Test that elements are not needlessly required by dart2js.
+
+import 'package:async_helper/async_helper.dart';
+import 'package:compiler/src/compiler.dart';
+import 'package:compiler/src/elements/elements.dart';
+import 'package:compiler/src/enqueue.dart';
+import 'package:compiler/src/js_backend/js_backend.dart';
+import 'package:expect/expect.dart';
+import 'memory_compiler.dart';
+
+main() {
+  asyncTest(() async {
+    await analyze('main() {}');
+    await analyze('main() => proxy;', proxyConstant: true);
+    await analyze('@deprecated main() {}');
+    await analyze('@deprecated main() => deprecated;', deprecatedClass: true);
+    await analyze('main() => deprecated;', deprecatedClass: true);
+  });
+}
+
+void checkInstantiated(Compiler compiler, ClassElement cls, bool expected) {
+  ResolutionEnqueuer enqueuer = compiler.enqueuer.resolution;
+  bool isInstantiated =
+      enqueuer.universe.directlyInstantiatedClasses.contains(cls);
+  bool isProcessed = enqueuer.isClassProcessed(cls);
+  Expect.equals(expected, isInstantiated,
+      'Unexpected instantiation state of class $cls.');
+  Expect.equals(expected, isProcessed,
+      'Unexpected processing state of class $cls.');
+}
+
+analyze(String code,
+        {bool proxyConstant: false,
+         bool deprecatedClass: false}) async {
+  CompilationResult result = await runCompiler(
+      memorySourceFiles: {'main.dart': code},
+      options: ['--analyze-only']);
+  Expect.isTrue(result.isSuccess);
+  Compiler compiler = result.compiler;
+  Expect.equals(proxyConstant, compiler.proxyConstant != null,
+      "Unexpected computation of proxy constant.");
+
+  checkInstantiated(
+      compiler, compiler.coreLibrary.find('_Proxy'), proxyConstant);
+  checkInstantiated(
+      compiler, compiler.coreLibrary.find('Deprecated'), deprecatedClass);
+
+  LibraryElement jsHelperLibrary =
+      compiler.libraryLoader.lookupLibrary(JavaScriptBackend.DART_JS_HELPER);
+  jsHelperLibrary.forEachLocalMember((Element element) {
+    Uri uri = element.compilationUnit.script.resourceUri;
+    if (element.isClass && uri.path.endsWith('annotations.dart')) {
+      checkInstantiated(compiler, element, false);
+    }
+  });
+}
diff --git a/tests/compiler/dart2js/mirror_tree_shaking_test.dart b/tests/compiler/dart2js/mirror_tree_shaking_test.dart
index 87accd5..2b69501 100644
--- a/tests/compiler/dart2js/mirror_tree_shaking_test.dart
+++ b/tests/compiler/dart2js/mirror_tree_shaking_test.dart
@@ -5,7 +5,7 @@
 // Test that tree-shaking hasn't been turned off.
 
 import 'package:async_helper/async_helper.dart';
-import 'package:compiler/src/dart2jslib.dart';
+import 'package:compiler/src/compiler.dart';
 import 'package:compiler/src/js_backend/js_backend.dart'
        show JavaScriptBackend;
 import 'package:expect/expect.dart';
diff --git a/tests/compiler/dart2js/mirrors/mirrors_reader_test.dart b/tests/compiler/dart2js/mirrors/mirrors_reader_test.dart
index bd41ab2..3059fd1 100644
--- a/tests/compiler/dart2js/mirrors/mirrors_reader_test.dart
+++ b/tests/compiler/dart2js/mirrors/mirrors_reader_test.dart
@@ -12,7 +12,7 @@
 
 import "mirrors_test_helper.dart";
 import "../../../lib/mirrors/mirrors_reader.dart";
-import "package:compiler/src/util/util.dart";
+import "package:compiler/src/diagnostics/spannable.dart";
 import "package:compiler/src/mirrors/dart2js_mirrors.dart";
 import "package:compiler/src/mirrors/source_mirrors.dart";
 
diff --git a/tests/compiler/dart2js/mirrors_exports_test.dart b/tests/compiler/dart2js/mirrors_exports_test.dart
index 07b70e7..302dd31 100644
--- a/tests/compiler/dart2js/mirrors_exports_test.dart
+++ b/tests/compiler/dart2js/mirrors_exports_test.dart
@@ -4,10 +4,10 @@
 
 import 'package:expect/expect.dart';
 import 'package:async_helper/async_helper.dart';
-import 'dart:async';
-import 'memory_compiler.dart';
 import 'package:compiler/src/mirrors/source_mirrors.dart';
 
+import 'memory_compiler.dart';
+
 const SOURCE_FILES = const {
 'main.dart': '''
 import 'a.dart' show A1, A2;
diff --git a/tests/compiler/dart2js/mirrors_test.dart b/tests/compiler/dart2js/mirrors_test.dart
index 2c7b09f..7d3c48c 100644
--- a/tests/compiler/dart2js/mirrors_test.dart
+++ b/tests/compiler/dart2js/mirrors_test.dart
@@ -183,7 +183,8 @@
   Expect.isTrue(metadata is InstanceMirror);
   Expect.isFalse(metadata.hasReflectee);
   Expect.throws(() => metadata.reflectee, (_) => true);
-  Expect.isTrue(metadata is CommentInstanceMirror);
+  Expect.isTrue(metadata is CommentInstanceMirror,
+      "Unexpected metadata: $metadata");
   Expect.equals(commentType.originalDeclaration, metadata.type);
   Expect.isTrue(metadata.isDocComment);
   Expect.stringEquals(
diff --git a/tests/compiler/dart2js/missing_file_test.dart b/tests/compiler/dart2js/missing_file_test.dart
index 26a4e9b..457a4f0 100644
--- a/tests/compiler/dart2js/missing_file_test.dart
+++ b/tests/compiler/dart2js/missing_file_test.dart
@@ -8,41 +8,79 @@
 
 import 'dart:async';
 import 'package:async_helper/async_helper.dart';
-import 'package:compiler/src/dart2jslib.dart';
+import "package:compiler/src/diagnostics/messages.dart";
 import 'package:expect/expect.dart';
 import 'memory_compiler.dart';
 
 const MEMORY_SOURCE_FILES = const {
   'main.dart': '''
-
 import 'foo.dart';
+main() {}
+''',
 
+'bar.dart': '''
+import 'dart:foo';
+main() {}
+''',
+
+'baz.dart': '''
+import 'dart:io';
 main() {}
 ''',
 };
 
-Future runTest(Uri main, MessageKind expectedMessageKind) async {
-  print("\n\n\n");
+Future runTest(Uri main,
+               {MessageKind error,
+                MessageKind info}) async {
+  print("----\nentry-point: $main\n");
 
   DiagnosticCollector diagnostics = new DiagnosticCollector();
   OutputCollector output = new OutputCollector();
   await runCompiler(
+      entryPoint: main,
       memorySourceFiles: MEMORY_SOURCE_FILES,
       diagnosticHandler: diagnostics,
       outputProvider: output);
 
   Expect.isFalse(output.hasExtraOutput);
-  Expect.equals(1, diagnostics.errors.length);
-  Expect.equals(expectedMessageKind, diagnostics.errors.first.message.kind);
+  Expect.equals(error != null ? 1 : 0, diagnostics.errors.length);
+  if (error != null) {
+    Expect.equals(error, diagnostics.errors.first.message.kind);
+  }
+  Expect.equals(info != null ? 1 : 0, diagnostics.infos.length);
+  if (info != null) {
+    Expect.equals(info, diagnostics.infos.first.message.kind);
+  }
+  Expect.equals(0, diagnostics.warnings.length);
+  Expect.equals(0, diagnostics.hints.length);
 }
 
 void main() {
   asyncTest(() async {
     await runTest(
-        Uri.parse('memory:main.dart'), MessageKind.READ_SCRIPT_ERROR);
+        Uri.parse('memory:main.dart'),
+        error: MessageKind.READ_SCRIPT_ERROR);
+
     await runTest(
-        Uri.parse('memory:foo.dart'), MessageKind.READ_SCRIPT_ERROR);
+        Uri.parse('memory:foo.dart'),
+        error: MessageKind.READ_SELF_ERROR);
+
     await runTest(
-        Uri.parse('dart:foo'), MessageKind.READ_SCRIPT_ERROR);
+        Uri.parse('dart:foo'),
+        error: MessageKind.LIBRARY_NOT_FOUND);
+
+    await runTest(
+        Uri.parse('dart:io'),
+        error: MessageKind.LIBRARY_NOT_SUPPORTED,
+        info: MessageKind.DISALLOWED_LIBRARY_IMPORT);
+
+    await runTest(
+        Uri.parse('memory:bar.dart'),
+        error: MessageKind.LIBRARY_NOT_FOUND);
+
+    await runTest(
+        Uri.parse('memory:baz.dart'),
+        error: MessageKind.LIBRARY_NOT_SUPPORTED,
+        info: MessageKind.DISALLOWED_LIBRARY_IMPORT);
   });
 }
diff --git a/tests/compiler/dart2js/mixin_constructor_default_parameter_values_test.dart b/tests/compiler/dart2js/mixin_constructor_default_parameter_values_test.dart
index 9d0fc86..a3924a8 100644
--- a/tests/compiler/dart2js/mixin_constructor_default_parameter_values_test.dart
+++ b/tests/compiler/dart2js/mixin_constructor_default_parameter_values_test.dart
@@ -7,8 +7,7 @@
 // to D without optional parameters is inferred using D's context, the default
 // value `_SECRET` will not be visible and compilation will fail.
 
-import 'package:expect/expect.dart';
-import "package:async_helper/async_helper.dart";
+import 'package:async_helper/async_helper.dart';
 import 'memory_compiler.dart';
 
 const Map MEMORY_SOURCE_FILES = const {
diff --git a/tests/compiler/dart2js/mock_compiler.dart b/tests/compiler/dart2js/mock_compiler.dart
index 6f8cb51..7456c29 100644
--- a/tests/compiler/dart2js/mock_compiler.dart
+++ b/tests/compiler/dart2js/mock_compiler.dart
@@ -9,15 +9,24 @@
 import 'dart:collection';
 
 import 'package:compiler/compiler.dart' as api;
+import 'package:compiler/src/common/names.dart' show
+    Uris;
 import 'package:compiler/src/constants/expressions.dart';
+import 'package:compiler/src/diagnostics/diagnostic_listener.dart';
+import 'package:compiler/src/diagnostics/messages.dart';
+import 'package:compiler/src/diagnostics/source_span.dart';
+import 'package:compiler/src/diagnostics/spannable.dart';
 import 'package:compiler/src/elements/elements.dart';
 import 'package:compiler/src/js_backend/js_backend.dart'
     show JavaScriptBackend;
-import 'package:compiler/src/resolution/resolution.dart';
 import 'package:compiler/src/io/source_file.dart';
+import 'package:compiler/src/resolution/members.dart';
+import 'package:compiler/src/resolution/registry.dart';
+import 'package:compiler/src/resolution/scope.dart';
+import 'package:compiler/src/resolution/tree_elements.dart';
+import 'package:compiler/src/script.dart';
 import 'package:compiler/src/tree/tree.dart';
 import 'package:compiler/src/old_to_new_api.dart';
-import 'package:compiler/src/util/util.dart';
 import 'parser_helper.dart';
 
 import 'package:compiler/src/elements/modelx.dart'
@@ -26,8 +35,7 @@
          ErroneousElementX,
          FunctionElementX;
 
-import 'package:compiler/src/dart2jslib.dart'
-    hide TreeElementMapping;
+import 'package:compiler/src/compiler.dart';
 
 import 'package:compiler/src/deferred_load.dart'
     show DeferredLoadTask,
@@ -40,11 +48,13 @@
   Message message;
   WarningMessage(this.node, this.message);
 
-  toString() => message.toString();
+  toString() => message.kind.toString();
 }
 
 final Uri PATCH_CORE = new Uri(scheme: 'patch', path: 'core');
 
+typedef String LibrarySourceProvider(Uri uri);
+
 class MockCompiler extends Compiler {
   api.DiagnosticHandler diagnosticHandler;
   List<WarningMessage> warnings;
@@ -60,12 +70,13 @@
   final Map<String, SourceFile> sourceFiles;
   Node parsedTree;
   final String testedPatchVersion;
+  final LibrarySourceProvider librariesOverride;
 
   MockCompiler.internal(
       {Map<String, String> coreSource,
        bool enableTypeAssertions: false,
+       bool enableUserAssertions: false,
        bool enableMinification: false,
-       bool enableConcreteTypeInference: false,
        int maxConcreteTypeSize: 5,
        bool disableTypeInference: false,
        bool analyzeAll: false,
@@ -80,12 +91,14 @@
        int this.expectedWarnings,
        int this.expectedErrors,
        api.CompilerOutputProvider outputProvider,
-       String patchVersion})
+       String patchVersion,
+       LibrarySourceProvider this.librariesOverride})
       : sourceFiles = new Map<String, SourceFile>(),
         testedPatchVersion = patchVersion,
         super(enableTypeAssertions: enableTypeAssertions,
+              enableUserAssertions: enableUserAssertions,
+              enableAssertMessage: true,
               enableMinification: enableMinification,
-              enableConcreteTypeInference: enableConcreteTypeInference,
               maxConcreteTypeSize: maxConcreteTypeSize,
               disableTypeInferenceFlag: disableTypeInference,
               analyzeAllFlag: analyzeAll,
@@ -93,7 +106,8 @@
               emitJavaScript: emitJavaScript,
               preserveComments: preserveComments,
               trustTypeAnnotations: trustTypeAnnotations,
-              showPackageWarnings: true,
+              diagnosticOptions:
+                  new DiagnosticOptions(showPackageWarnings: true),
               outputProvider: new LegacyCompilerOutput(outputProvider)) {
     this.disableInlining = disableInlining;
 
@@ -101,7 +115,7 @@
 
     clearMessages();
 
-    registerSource(Compiler.DART_CORE,
+    registerSource(Uris.dart_core,
                    buildLibrarySource(DEFAULT_CORE_LIBRARY, coreSource));
     registerSource(PATCH_CORE, DEFAULT_PATCH_CORE_SOURCE);
 
@@ -113,10 +127,19 @@
                    buildLibrarySource(DEFAULT_INTERCEPTORS_LIBRARY));
     registerSource(JavaScriptBackend.DART_ISOLATE_HELPER,
                    buildLibrarySource(DEFAULT_ISOLATE_HELPER_LIBRARY));
-    registerSource(Compiler.DART_MIRRORS,
-                   buildLibrarySource(DEFAULT_MIRRORS_LIBRARY));
-    registerSource(Compiler.DART_ASYNC,
-                   buildLibrarySource(DEFAULT_ASYNC_LIBRARY));
+    registerSource(Uris.dart_mirrors, DEFAULT_MIRRORS_SOURCE);
+    registerSource(JavaScriptBackend.DART_JS_MIRRORS,
+        DEFAULT_JS_MIRRORS_SOURCE);
+
+    Map<String, String> asyncLibrarySource = <String, String>{};
+    asyncLibrarySource.addAll(DEFAULT_ASYNC_LIBRARY);
+    if (enableAsyncAwait) {
+      asyncLibrarySource.addAll(ASYNC_AWAIT_LIBRARY);
+    }
+    registerSource(Uris.dart_async,
+                   buildLibrarySource(asyncLibrarySource));
+    registerSource(JavaScriptBackend.PACKAGE_LOOKUP_MAP,
+                   buildLibrarySource(DEFAULT_LOOKUP_MAP_LIBRARY));
   }
 
   String get patchVersion {
@@ -134,7 +157,7 @@
       // dynamic invocation the ArgumentTypesRegistry eventually iterates over
       // the interfaces of the Object class which would be 'null' if the class
       // wasn't resolved.
-      objectClass.ensureResolved(this);
+      objectClass.ensureResolved(resolution);
     }).then((_) => uri);
   }
 
@@ -156,45 +179,57 @@
 
   /**
    * Registers the [source] with [uri] making it possible load [source] as a
-   * library.
+   * library.  If an override has been provided in [librariesOverride], that
+   * is used instead.
    */
   void registerSource(Uri uri, String source) {
+    if (librariesOverride != null) {
+      String override = librariesOverride(uri);
+      if (override != null) {
+        source = override;
+      }
+    }
     sourceFiles[uri.toString()] = new MockFile(source);
   }
 
   // TODO(johnniwinther): Remove this when we don't filter certain type checker
   // warnings.
-  void reportWarning(Spannable node, MessageKind messageKind,
-                     [Map arguments = const {}]) {
-    MessageTemplate template = MessageTemplate.TEMPLATES[messageKind];
-    reportDiagnostic(node,
-                     template.message(arguments, terseDiagnostics),
-                     api.Diagnostic.WARNING);
+  void reportWarning(
+      DiagnosticMessage message,
+      [List<DiagnosticMessage> infos = const <DiagnosticMessage>[]]) {
+    reportDiagnostic(message, infos, api.Diagnostic.WARNING);
   }
 
-  void reportDiagnostic(Spannable node,
-                        Message message,
+  void reportDiagnostic(DiagnosticMessage message,
+                        List<DiagnosticMessage> infoMessages,
                         api.Diagnostic kind) {
-    var diagnostic = new WarningMessage(node, message);
-    if (kind == api.Diagnostic.CRASH) {
-      crashes.add(diagnostic);
-    } else if (kind == api.Diagnostic.ERROR) {
-      errors.add(diagnostic);
-    } else if (kind == api.Diagnostic.WARNING) {
-      warnings.add(diagnostic);
-    } else if (kind == api.Diagnostic.INFO) {
-      infos.add(diagnostic);
-    } else if (kind == api.Diagnostic.HINT) {
-      hints.add(diagnostic);
-    }
-    if (diagnosticHandler != null) {
-      SourceSpan span = spanFromSpannable(node);
-      if (span != null) {
-        diagnosticHandler(span.uri, span.begin, span.end, '$message', kind);
-      } else {
-        diagnosticHandler(null, null, null, '$message', kind);
+
+    void processMessage(DiagnosticMessage message, api.Diagnostic kind) {
+      var diagnostic = new WarningMessage(message.spannable, message.message);
+      if (kind == api.Diagnostic.CRASH) {
+        crashes.add(diagnostic);
+      } else if (kind == api.Diagnostic.ERROR) {
+        errors.add(diagnostic);
+      } else if (kind == api.Diagnostic.WARNING) {
+        warnings.add(diagnostic);
+      } else if (kind == api.Diagnostic.INFO) {
+        infos.add(diagnostic);
+      } else if (kind == api.Diagnostic.HINT) {
+        hints.add(diagnostic);
+      }
+      if (diagnosticHandler != null) {
+        SourceSpan span = message.sourceSpan;
+        if (span != null) {
+          diagnosticHandler(
+              span.uri, span.begin, span.end, '${message.message}', kind);
+        } else {
+          diagnosticHandler(null, null, null, '${message.message}', kind);
+        }
       }
     }
+
+    processMessage(message, kind);
+    infoMessages.forEach((i) => processMessage(i, api.Diagnostic.INFO));
   }
 
   bool get compilationFailed => !crashes.isEmpty || !errors.isEmpty;
@@ -216,7 +251,7 @@
                                           ExecutableElement element) {
     ResolverVisitor visitor =
         new ResolverVisitor(this, element,
-            new ResolutionRegistry.internal(this,
+            new ResolutionRegistry(this,
                 new CollectingTreeElements(element)));
     if (visitor.scope is LibraryScope) {
       visitor.scope = new MethodScope(visitor.scope, element);
@@ -230,7 +265,7 @@
     Element mockElement = new MockElement(mainApp.entryCompilationUnit);
     ResolverVisitor visitor =
         new ResolverVisitor(this, mockElement,
-          new ResolutionRegistry.internal(this,
+          new ResolutionRegistry(this,
               new CollectingTreeElements(mockElement)));
     visitor.scope = new MethodScope(visitor.scope, mockElement);
     return visitor;
@@ -252,7 +287,7 @@
   }
 
   Uri translateResolvedUri(LibraryElement importingLibrary,
-                           Uri resolvedUri, Node node) => resolvedUri;
+                           Uri resolvedUri, Spannable spannable) => resolvedUri;
 
   // The mock library doesn't need any patches.
   Uri resolvePatchUri(String dartLibraryName) {
@@ -343,7 +378,8 @@
   }
   if (foundIterator.hasNext) {
     do {
-      print('Additional $kind "${foundIterator.next()}"');
+      WarningMessage message = foundIterator.next();
+      print('Additional $kind "${message}: ${message.message}"');
     } while (foundIterator.hasNext);
     fail('Too many ${kind}s');
   }
@@ -409,3 +445,33 @@
 
   bool get hasNode => false;
 }
+
+// TODO(herhut): Disallow warnings and errors during compilation by default.
+MockCompiler compilerFor(String code, Uri uri,
+                         {bool analyzeAll: false,
+                          bool analyzeOnly: false,
+                          Map<String, String> coreSource,
+                          bool disableInlining: true,
+                          bool minify: false,
+                          bool trustTypeAnnotations: false,
+                          bool enableTypeAssertions: false,
+                          bool enableUserAssertions: false,
+                          int expectedErrors,
+                          int expectedWarnings,
+                          api.CompilerOutputProvider outputProvider}) {
+  MockCompiler compiler = new MockCompiler.internal(
+      analyzeAll: analyzeAll,
+      analyzeOnly: analyzeOnly,
+      coreSource: coreSource,
+      disableInlining: disableInlining,
+      enableMinification: minify,
+      trustTypeAnnotations: trustTypeAnnotations,
+      enableTypeAssertions: enableTypeAssertions,
+      enableUserAssertions: enableUserAssertions,
+      expectedErrors: expectedErrors,
+      expectedWarnings: expectedWarnings,
+      outputProvider: outputProvider);
+  compiler.registerSource(uri, code);
+  compiler.diagnosticHandler = createHandler(compiler, code);
+  return compiler;
+}
diff --git a/tests/compiler/dart2js/mock_libraries.dart b/tests/compiler/dart2js/mock_libraries.dart
index c823f6b..37135b2 100644
--- a/tests/compiler/dart2js/mock_libraries.dart
+++ b/tests/compiler/dart2js/mock_libraries.dart
@@ -39,10 +39,20 @@
         static var NAN = 0;
         static parse(s) {}
       }''',
-  'Function': 'class Function {}',
+  'Function': r'''
+      class Function {
+        static apply(Function fn, List positional, [Map named]) => null;
+      }''',
   'identical': 'bool identical(Object a, Object b) { return true; }',
   'int': 'abstract class int extends num { }',
-  'Iterable': 'abstract class Iterable {}',
+  'Iterable': '''
+      abstract class Iterable<E> {
+          Iterator<E> get iterator => null;
+      }''',
+  'Iterator': '''
+      abstract class Iterator<E> {
+          E get current => null;
+      }''',
   'LinkedHashMap': r'''
       class LinkedHashMap {
         factory LinkedHashMap._empty() => null;
@@ -51,7 +61,7 @@
         static _makeLiteral(elements) => null;
       }''',
   'List': r'''
-      class List<E> {
+      class List<E> extends Iterable<E> {
         var length;
         List([length]);
         List.filled(length, element);
@@ -81,6 +91,7 @@
         String toString() { return null; }
         noSuchMethod(im) { throw im; }
       }''',
+  'Resource': 'class Resource {}',
   'StackTrace': 'abstract class StackTrace {}',
   'String': 'class String implements Pattern {}',
   'Symbol': 'class Symbol { final name; const Symbol(this.name); }',
@@ -96,7 +107,10 @@
 ''';
 
 const Map<String, String> DEFAULT_JS_HELPER_LIBRARY = const <String, String>{
+  'assertTest': 'assertTest(a) {}',
+  'assertThrow': 'assertThrow(a) {}',
   'assertHelper': 'assertHelper(a) {}',
+  'assertUnreachable': 'assertUnreachable() {}',
   'assertIsSubtype': 'assertIsSubtype(subtype, supertype, message) {}',
   'assertSubtype': 'assertSubtype(object, isField, checks, asField) {}',
   'assertSubtypeOfRuntimeType': 'assertSubtypeOfRuntimeType(object, type) {}',
@@ -227,7 +241,12 @@
   'throwRuntimeError': 'throwRuntimeError(message) {}',
   'throwTypeError': 'throwTypeError(message) {}',
   'TypeImpl': 'class TypeImpl {}',
-  'TypeVariable': 'class TypeVariable {}',
+  'TypeVariable': '''class TypeVariable {
+    final Type owner;
+    final String name;
+    final int bound;
+    TypeVariable(this.owner, this.name, this.bound);
+  }''',
   'unwrapException': 'unwrapException(e) {}',
   'voidTypeCheck': 'voidTypeCheck(value) {}',
   'wrapException': 'wrapException(x) { return x; }',
@@ -277,6 +296,7 @@
             E removeAt(index) => this[0];
             E elementAt(index) => this[0];
             E singleWhere(f) => this[0];
+            Iterator<E> get iterator => null; 
           }''',
   'JSBool': 'class JSBool extends Interceptor implements bool {}',
   'JSDouble': 'class JSDouble extends JSNumber implements double {}',
@@ -327,11 +347,11 @@
         operator &(other) => 42;
         operator ^(other) => 42;
 
-        operator >(other) => true;
-        operator >=(other) => true;
-        operator <(other) => true;
-        operator <=(other) => true;
-        operator ==(other) => true;
+        operator >(other) => !identical(this, other);
+        operator >=(other) => !identical(this, other);
+        operator <(other) => !identical(this, other);
+        operator <=(other) => !identical(this, other);
+        operator ==(other) => identical(this, other);
         get hashCode => throw "JSNumber.hashCode not implemented.";
 
         // We force side effects on _tdivFast to mimic the shortcomings of
@@ -351,8 +371,8 @@
       }''',
   'JSString': r'''
       class JSString extends Interceptor implements String, JSIndexable {
-        var split;
-        var length;
+        split(pattern) => [];
+        int get length => 42;
         operator[](index) {}
         toString() {}
         operator+(other) => this;
@@ -361,8 +381,10 @@
   'JSUInt31': 'class JSUInt31 extends JSUInt32 {}',
   'JSUInt32': 'class JSUInt32 extends JSPositiveInt {}',
   'ObjectInterceptor': 'class ObjectInterceptor {}',
+  'JavaScriptObject': 'class JavaScriptObject {}',
   'PlainJavaScriptObject': 'class PlainJavaScriptObject {}',
   'UnknownJavaScriptObject': 'class UnknownJavaScriptObject {}',
+  'JavaScriptFunction': 'class JavaScriptFunction {}',
 };
 
 const Map<String, String> DEFAULT_ISOLATE_HELPER_LIBRARY =
@@ -375,7 +397,7 @@
 
 const Map<String, String> DEFAULT_ASYNC_LIBRARY = const <String, String>{
   'DeferredLibrary': 'class DeferredLibrary {}',
-  'Future': 
+  'Future':
       '''
       class Future<T> {
         Future.value([value]);
@@ -386,8 +408,49 @@
   'StreamIterator': 'class StreamIterator<T> {}',
 };
 
-const Map<String, String> DEFAULT_MIRRORS_LIBRARY = const <String, String>{
-  'Comment': 'class Comment {}',
-  'MirrorSystem': 'class MirrorSystem {}',
-  'MirrorsUsed': 'class MirrorsUsed {}',
+/// These members are only needed when async/await is used.
+const Map<String, String> ASYNC_AWAIT_LIBRARY = const <String, String>{
+  '_wrapJsFunctionForAsync': '_wrapJsFunctionForAsync(f) {}',
+  '_asyncHelper': '_asyncHelper(o, f, c) {}',
+  '_SyncStarIterable': 'class _SyncStarIterable {}',
+  '_IterationMarker': 'class _IterationMarker {}',
+  '_AsyncStarStreamController': 'class _AsyncStarStreamController {}',
+  '_asyncStarHelper': '_asyncStarHelper(x, y, z) {}',
+  '_streamOfController': '_streamOfController(x) {}',
+};
+
+const String DEFAULT_MIRRORS_SOURCE = r'''
+import 'dart:_js_mirrors' as js;
+class Comment {}
+class MirrorSystem {}
+class MirrorsUsed {
+  final targets;
+  const MirrorsUsed({this.targets});
+}
+void reflectType(Type t) => js.disableTreeShaking();
+''';
+
+const String DEFAULT_JS_MIRRORS_SOURCE = r'''
+disableTreeShaking(){}
+preserveMetadata(){}
+preserveUris(){}
+preserveLibraryNames(){}
+''';
+
+const Map<String, String> DEFAULT_LOOKUP_MAP_LIBRARY = const <String, String>{
+  'LookupMap': r'''
+  class LookupMap<K, V> {
+    final _key;
+    final _value;
+    final _entries;
+    final _nestedMaps;
+
+    const LookupMap(this._entries, [this._nestedMaps = const []])
+        : _key = null, _value = null;
+
+    const LookupMap.pair(this._key, this._value)
+        : _entries = const [], _nestedMaps = const [];
+    V operator[](K k) => null;
+  }''',
+  '_version': 'const _version = "0.0.1+1";',
 };
diff --git a/tests/compiler/dart2js/octagon_test.dart b/tests/compiler/dart2js/octagon_test.dart
new file mode 100644
index 0000000..2644c0e
--- /dev/null
+++ b/tests/compiler/dart2js/octagon_test.dart
@@ -0,0 +1,264 @@
+// 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 'package:compiler/src/cps_ir/octagon.dart';
+import 'package:expect/expect.dart';
+
+Octagon octagon;
+SignedVariable v1, v2, v3, v4;
+
+setup() {
+  octagon = new Octagon();
+  v1 = octagon.makeVariable();
+  v2 = octagon.makeVariable();
+  v3 = octagon.makeVariable();
+  v4 = octagon.makeVariable();
+}
+
+Constraint pushConstraint(SignedVariable w1, SignedVariable w2, int k) {
+  Constraint c = new Constraint(w1, w2, k);
+  octagon.pushConstraint(c);
+  return c;
+}
+
+void popConstraint(Constraint c) {
+  octagon.popConstraint(c);
+}
+
+negative_loop1() {
+  setup();
+  // Create the contradictory constraint:
+  //  v1 <= v2 <= v1 - 1 (loop weight = -1)
+  //
+  // As difference bounds:
+  //  v1 - v2 <= 0
+  //  v2 - v1 <= -1
+  pushConstraint(v1, v2.negated, 0);
+  Expect.isTrue(octagon.isSolvable, 'v1 <= v2: should be solvable');
+  var c = pushConstraint(v2, v1.negated, -1);
+  Expect.isTrue(octagon.isUnsolvable, 'v2 <= v1 - 1: should become unsolvable');
+
+  // Check that pop restores solvability.
+  popConstraint(c);
+  Expect.isTrue(octagon.isSolvable, 'Should be solvable without v2 <= v1 - 1');
+}
+
+negative_loop2() {
+  setup();
+  // Create a longer contradiction, and add the middle constraint last:
+  //  v1 <= v2 <= v3 <= v1 - 1
+  pushConstraint(v1, v2.negated, 0);
+  Expect.isTrue(octagon.isSolvable, 'v1 <= v2: should be solvable');
+  pushConstraint(v3, v1.negated, -1);
+  Expect.isTrue(octagon.isSolvable, 'v3 <= v1 - 1: should be solvable');
+  var c = pushConstraint(v2, v3.negated, 0);
+  Expect.isTrue(octagon.isUnsolvable, 'v2 <= v3: should become unsolvable');
+
+  // Check that pop restores solvability.
+  popConstraint(c);
+  Expect.isTrue(octagon.isSolvable, 'Should be solvable without v2 <= v3');
+}
+
+negative_loop3() {
+  setup();
+  // Add a circular constraint with offsets and negative weight:
+  //   v1 <= v2 - 1 <= v3 + 2 <= v1 - 1
+  // As difference bounds:
+  //   v1 - v2 <= -1
+  //   v2 - v3 <=  3
+  //   v3 - v1 <= -3
+  pushConstraint(v1, v2.negated, -1);
+  Expect.isTrue(octagon.isSolvable, 'v1 <= v2 - 1: should be solvable');
+  pushConstraint(v2, v3.negated, 3);
+  Expect.isTrue(octagon.isSolvable, 'v2 - 1 <= v3 + 2: should be solvable');
+  var c = pushConstraint(v3, v1.negated, -3);
+  Expect.isTrue(octagon.isUnsolvable, 'v3 + 2 <= v1 - 1: should become unsolvable');
+
+  // Check that pop restores solvability.
+  popConstraint(c);
+  Expect.isTrue(octagon.isSolvable, 'Should be solvable without v3 + 2 <= v1 - 1');
+}
+
+zero_loop1() {
+  setup();
+  // Add the circular constraint with zero weight:
+  //   v1 <= v2 <= v3 <= v1
+  pushConstraint(v1, v2.negated, 0);
+  Expect.isTrue(octagon.isSolvable, 'v1 <= v2: should be solvable');
+  pushConstraint(v2, v3.negated, 0);
+  Expect.isTrue(octagon.isSolvable, 'v2 <= v3: should be solvable');
+  pushConstraint(v3, v1.negated, 0);
+  Expect.isTrue(octagon.isSolvable, 'v3 <= v1: should be solvable');
+}
+
+zero_loop2() {
+  setup();
+  // Add a circular constraint with offsets:
+  //   v1 <= v2 - 1 <= v3 + 2 <= v1
+  // As difference bounds:
+  //   v1 - v2 <= -1
+  //   v2 - v3 <=  3
+  //   v3 - v1 <= -2
+  pushConstraint(v1, v2.negated, -1);
+  Expect.isTrue(octagon.isSolvable, 'v1 <= v2 - 1: should be solvable');
+  pushConstraint(v2, v3.negated, 3);
+  Expect.isTrue(octagon.isSolvable, 'v2 - 1 <= v3 + 2: should be solvable');
+  pushConstraint(v3, v1.negated, -2);
+  Expect.isTrue(octagon.isSolvable, 'v3 + 2 <= v1: should be solvable');
+}
+
+positive_loop1() {
+  setup();
+  // Add constraints with some slack (positive-weight loop):
+  //   v1 <= v2 <= v3 <= v1 + 1
+  pushConstraint(v1, v2.negated, 0);
+  Expect.isTrue(octagon.isSolvable, 'v1 <= v2: should be solvable');
+  pushConstraint(v2, v3.negated, 0);
+  Expect.isTrue(octagon.isSolvable, 'v2 <= v3: should be solvable');
+  pushConstraint(v3, v1.negated, 1);
+  Expect.isTrue(octagon.isSolvable, 'v3 <= v1 + 1: should be solvable');
+}
+
+positive_loop2() {
+  setup();
+  // Add constraints with offsets and slack at the end:
+  //   v1 <= v2 - 1 <= v3 + 2 <= v1 + 1
+  // As difference bounds:
+  //   v1 - v2 <= -1
+  //   v2 - v3 <=  3
+  //   v3 - v1 <= -1
+  pushConstraint(v1, v2.negated, -1);
+  Expect.isTrue(octagon.isSolvable, 'v1 <= v2 - 1: should be solvable');
+  pushConstraint(v2, v3.negated, 3);
+  Expect.isTrue(octagon.isSolvable, 'v2 - 1 <= v3 + 2: should be solvable');
+  pushConstraint(v3, v1.negated, -1);
+  Expect.isTrue(octagon.isSolvable, 'v3 + 2 <= v1: should be solvable');
+}
+
+positive_and_negative_loops1() {
+  setup();
+  //  v1 <= v2 <= v3 <= v1 + 1
+  //  v2 <= v3 - 2  (unsolvable: v3 - 2 <= (v1 + 1) - 2 = v1 - 1)
+  pushConstraint(v1, v2.negated, 0);
+  pushConstraint(v2, v3.negated, 0);
+  pushConstraint(v3, v1.negated, 1);
+  Expect.isTrue(octagon.isSolvable, 'should be solvable');
+  pushConstraint(v2, v3.negated, -2);
+  Expect.isTrue(octagon.isUnsolvable, 'v2 <= v3 - 2: should become unsolvable');
+}
+
+positive_and_negative_loops2() {
+  setup();
+  // Same as above, but constraints are added in a different order.
+  pushConstraint(v2, v3.negated, -2);
+  pushConstraint(v2, v3.negated, 0);
+  pushConstraint(v3, v1.negated, 1);
+  Expect.isTrue(octagon.isSolvable, 'should be solvable');
+  pushConstraint(v1, v2.negated, 0);
+  Expect.isTrue(octagon.isUnsolvable, 'v1 <= v2: should become unsolvable');
+}
+
+positive_and_negative_loops3() {
+  setup();
+  // Same as above, but constraints are added in a different order.
+  pushConstraint(v2, v3.negated, 0);
+  pushConstraint(v2, v3.negated, -2);
+  pushConstraint(v3, v1.negated, 1);
+  Expect.isTrue(octagon.isSolvable, 'should be solvable');
+  pushConstraint(v1, v2.negated, 0);
+  Expect.isTrue(octagon.isUnsolvable, 'v1 <= v2: should become unsolvable');
+}
+
+plus_minus1() {
+  setup();
+  // Given:
+  //   v1 = v2 + 1    (modeled as: v1 <= v2 + 1 <= v1)
+  //   v3 = v4 + 1
+  //   v1 <= v3
+  // prove:
+  //   v2 <= v4
+  pushConstraint(v1, v2.negated,  1); // v1 <= v2 + 1
+  pushConstraint(v2, v1.negated, -1); // v2 <= v1 - 1
+  pushConstraint(v3, v4.negated,  1); // v3 <= v4 + 1
+  pushConstraint(v4, v3.negated, -1); // v4 <= v3 - 1
+  pushConstraint(v1, v3.negated,  0); // v1 <= v3
+  Expect.isTrue(octagon.isSolvable, 'should be solvable');
+  // Push the negated constraint: v2 > v4 <=> v4 - v2 <= -1
+  pushConstraint(v4, v2.negated, -1);
+  Expect.isTrue(octagon.isUnsolvable, 'should be unsolvable');
+}
+
+constant1() {
+  setup();
+  // Given:
+  //   v1 = 10
+  //   v2 <= v3
+  //   v3 + v1 <= 3   (i.e. v2 <= v3 <= -v1 + 3 = 7)
+  // prove:
+  //   v2 <= 7  (modeled as: v2 + v2 <= 14)
+  pushConstraint(v1, v1, 20); // v1 + v1 <= 20
+  pushConstraint(v1.negated, v1.negated, -20); // -v1 - v1 <= -20
+  pushConstraint(v2, v3.negated, 0); // v2 <= v3
+  pushConstraint(v3, v1,  3); // v3 + v1 <= 3
+  Expect.isTrue(octagon.isSolvable, 'should be solvable');
+  // Push the negated constraint: v2 + v2 > 14 <=> -v2 - v2 <= -15
+  var c = pushConstraint(v2.negated, v2.negated, -15);
+  Expect.isTrue(octagon.isUnsolvable, 'should be unsolvable');
+  popConstraint(c);
+  // Push the thing we are trying to prove.
+  pushConstraint(v2, v2, 14);
+  Expect.isTrue(octagon.isSolvable, 'v2 + v2 <= 14: should be solvable');
+}
+
+contradict1() {
+  setup();
+  // v1 < v1  (v1 - v1 <= -1)
+  pushConstraint(v1, v1.negated, -1);
+  Expect.isTrue(octagon.isUnsolvable, 'v1 < v1: should be unsolvable');
+}
+
+contradict2() {
+  setup();
+  // v1 = 2
+  // v2 = 0
+  // v1 <= v2
+  pushConstraint(v1, v1, 2);
+  pushConstraint(v1.negated, v1.negated, -2);
+  pushConstraint(v2, v2, 0);
+  pushConstraint(v2.negated, v2.negated, 0);
+  Expect.isTrue(octagon.isSolvable, 'should be solvable');
+  pushConstraint(v1, v2.negated, 0);
+  Expect.isTrue(octagon.isUnsolvable, 'v1 <= v2: should be unsolvable');
+}
+
+lower_bounds_check() {
+  SignedVariable w = octagon.makeVariable(0, 1000);
+  pushConstraint(w, w, -1);
+  Expect.isTrue(octagon.isUnsolvable, 'Value in range 0..1000 is not <= -1');
+}
+
+upper_bounds_check() {
+  SignedVariable w = octagon.makeVariable(0, 1000);
+  pushConstraint(w.negated, w.negated, -5000);
+  Expect.isTrue(octagon.isUnsolvable, 'Value in range 0..1000 is not >= 5000');
+}
+
+void main() {
+  negative_loop1();
+  negative_loop2();
+  negative_loop3();
+  zero_loop1();
+  zero_loop2();
+  positive_loop1();
+  positive_loop2();
+  positive_and_negative_loops1();
+  positive_and_negative_loops2();
+  positive_and_negative_loops3();
+  plus_minus1();
+  constant1();
+  contradict1();
+  contradict2();
+  lower_bounds_check();
+  upper_bounds_check();
+}
diff --git a/tests/compiler/dart2js/override_inheritance_test.dart b/tests/compiler/dart2js/override_inheritance_test.dart
index 0e24785..c71e6b2 100644
--- a/tests/compiler/dart2js/override_inheritance_test.dart
+++ b/tests/compiler/dart2js/override_inheritance_test.dart
@@ -29,7 +29,7 @@
     compiler.diagnosticHandler = createHandler(compiler, source);
     compiler.parseScript(source);
     var cls = compiler.mainApp.find('Class');
-    cls.ensureResolved(compiler);
+    cls.ensureResolved(compiler.resolution);
     MembersCreator.computeAllClassMembers(compiler, cls);
 
     toList(o) => o == null ? [] : o is List ? o : [o];
diff --git a/tests/compiler/dart2js/package_root_test.dart b/tests/compiler/dart2js/package_root_test.dart
index 122170c..40cab4a 100644
--- a/tests/compiler/dart2js/package_root_test.dart
+++ b/tests/compiler/dart2js/package_root_test.dart
@@ -12,7 +12,7 @@
 import 'package:expect/expect.dart';
 import 'package:compiler/compiler.dart'
        show DiagnosticHandler, Diagnostic, PackagesDiscoveryProvider;
-import 'package:compiler/src/dart2jslib.dart'
+import 'package:compiler/src/diagnostics/messages.dart'
        show MessageKind;
 import 'package:package_config/packages.dart';
 
diff --git a/tests/compiler/dart2js/parser_helper.dart b/tests/compiler/dart2js/parser_helper.dart
index 4fe8790..572a082 100644
--- a/tests/compiler/dart2js/parser_helper.dart
+++ b/tests/compiler/dart2js/parser_helper.dart
@@ -8,21 +8,36 @@
 
 import "package:compiler/src/elements/elements.dart";
 import "package:compiler/src/tree/tree.dart";
-import "package:compiler/src/scanner/scannerlib.dart";
+import "package:compiler/src/parser/element_listener.dart";
+import "package:compiler/src/parser/node_listener.dart";
+import "package:compiler/src/parser/parser.dart";
+import "package:compiler/src/parser/partial_parser.dart";
+import "package:compiler/src/scanner/string_scanner.dart";
+import "package:compiler/src/tokens/token.dart";
+import "package:compiler/src/tokens/token_constants.dart";
 import "package:compiler/src/io/source_file.dart";
 import "package:compiler/src/util/util.dart";
 
 import "package:compiler/src/elements/modelx.dart"
     show CompilationUnitElementX, ElementX, LibraryElementX;
 
-import "package:compiler/src/dart2jslib.dart";
+import "package:compiler/src/compiler.dart";
+import "package:compiler/src/diagnostics/source_span.dart";
+import "package:compiler/src/diagnostics/spannable.dart";
+import "package:compiler/src/diagnostics/diagnostic_listener.dart";
+import "package:compiler/src/diagnostics/messages.dart";
+import "package:compiler/src/script.dart";
 
-export "package:compiler/src/dart2jslib.dart"
-    show DiagnosticListener;
-// TODO(ahe): We should have token library to export instead.
-export "package:compiler/src/scanner/scannerlib.dart";
+export "package:compiler/src/diagnostics/diagnostic_listener.dart";
+export 'package:compiler/src/parser/listener.dart';
+export 'package:compiler/src/parser/node_listener.dart';
+export 'package:compiler/src/parser/parser.dart';
+export 'package:compiler/src/parser/partial_parser.dart';
+export 'package:compiler/src/parser/partial_elements.dart';
+export "package:compiler/src/tokens/token.dart";
+export "package:compiler/src/tokens/token_constants.dart";
 
-class LoggerCanceler implements DiagnosticListener {
+class LoggerCanceler extends DiagnosticReporter {
   void log(message) {
     print(message);
   }
@@ -35,33 +50,42 @@
     throw 'unsupported operation';
   }
 
-  void reportMessage(SourceSpan span, Message message, kind) {
+  void reportError(
+      DiagnosticMessage message,
+      [List<DiagnosticMessage> infos = const <DiagnosticMessage>[]]) {
     log(message);
+    infos.forEach(log);
   }
 
-  void reportFatalError(Spannable node,
-                        MessageKind errorCode,
-                        [Map arguments]) {
-    log(new Message(MessageTemplate.TEMPLATES[errorCode], arguments, false));
-  }
-
-  void reportError(Spannable node, MessageKind errorCode, [Map arguments]) {
-    log(new Message(MessageTemplate.TEMPLATES[errorCode], arguments, false));
-  }
-
-  void reportWarning(Spannable node, MessageKind errorCode, [Map arguments]) {
-    log(new Message(MessageTemplate.TEMPLATES[errorCode], arguments, false));
+  void reportWarning(
+      DiagnosticMessage message,
+      [List<DiagnosticMessage> infos = const <DiagnosticMessage>[]]) {
+    log(message);
+    infos.forEach(log);
   }
 
   void reportInfo(Spannable node, MessageKind errorCode, [Map arguments]) {
     log(new Message(MessageTemplate.TEMPLATES[errorCode], arguments, false));
   }
 
-  void reportHint(Spannable node, MessageKind errorCode, [Map arguments]) {
-    log(new Message(MessageTemplate.TEMPLATES[errorCode], arguments, false));
+  void reportHint(
+      DiagnosticMessage message,
+      [List<DiagnosticMessage> infos = const <DiagnosticMessage>[]]) {
+    log(message);
+    infos.forEach(log);
   }
 
   withCurrentElement(Element element, f()) => f();
+
+  @override
+  DiagnosticMessage createMessage(
+      Spannable spannable,
+      MessageKind messageKind,
+      [Map arguments = const {}]) {
+    return new DiagnosticMessage(
+        null, spannable,
+        new Message(MessageTemplate.TEMPLATES[messageKind], arguments, false));
+  }
 }
 
 Token scan(String text) =>
@@ -69,15 +93,15 @@
     .tokenize();
 
 Node parseBodyCode(String text, Function parseMethod,
-                   {DiagnosticListener diagnosticHandler}) {
+                   {DiagnosticReporter reporter}) {
   Token tokens = scan(text);
-  if (diagnosticHandler == null) diagnosticHandler = new LoggerCanceler();
+  if (reporter == null) reporter = new LoggerCanceler();
   Uri uri = new Uri(scheme: "source");
   Script script = new Script(uri, uri,new MockFile(text));
   LibraryElement library = new LibraryElementX(script);
   library.canUseNative = true;
   NodeListener listener =
-      new NodeListener(diagnosticHandler, library.entryCompilationUnit);
+      new NodeListener(reporter, library.entryCompilationUnit);
   Parser parser = new Parser(listener);
   Token endToken = parseMethod(parser, tokens);
   assert(endToken.kind == EOF_TOKEN);
@@ -94,12 +118,14 @@
   ElementX element = parseUnit(text, compiler, compiler.mainApp).head;
   Expect.isNotNull(element);
   Expect.equals(ElementKind.FUNCTION, element.kind);
-  return element.parseNode(compiler);
+  return element.parseNode(compiler.parsing);
 }
 
-Node parseMember(String text, {DiagnosticListener diagnosticHandler}) {
-  return parseBodyCode(text, (parser, tokens) => parser.parseMember(tokens),
-                       diagnosticHandler: diagnosticHandler);
+Node parseMember(String text, {DiagnosticReporter reporter}) {
+  return parseBodyCode(
+      text,
+      (parser, tokens) => parser.parseMember(tokens),
+      reporter: reporter);
 }
 
 class MockFile extends StringSourceFile {
@@ -120,13 +146,16 @@
   var script = new Script(uri, uri, new MockFile(text));
   var unit = new CompilationUnitElementX(script, library);
   int id = 0;
-  ElementListener listener = new ElementListener(compiler, unit, () => id++);
+  DiagnosticReporter reporter = compiler.reporter;
+  ElementListener listener = new ElementListener(reporter, unit, () => id++);
   PartialParser parser = new PartialParser(listener);
-  compiler.withCurrentElement(unit, () => parser.parseUnit(tokens));
+  reporter.withCurrentElement(unit, () => parser.parseUnit(tokens));
   return unit.localMembers;
 }
 
-NodeList fullParseUnit(String source, {DiagnosticListener diagnosticHandler}) {
-  return parseBodyCode(source, (parser, tokens) => parser.parseUnit(tokens),
-                       diagnosticHandler: diagnosticHandler);
+NodeList fullParseUnit(String source, {DiagnosticReporter reporter}) {
+  return parseBodyCode(
+      source,
+      (parser, tokens) => parser.parseUnit(tokens),
+      reporter: reporter);
 }
diff --git a/tests/compiler/dart2js/parser_test.dart b/tests/compiler/dart2js/parser_test.dart
index 1f4cae9..4674201 100644
--- a/tests/compiler/dart2js/parser_test.dart
+++ b/tests/compiler/dart2js/parser_test.dart
@@ -292,27 +292,32 @@
   Expect.isNull(function.getOrSet);
 }
 
-class Collector implements DiagnosticListener {
+class Collector extends DiagnosticReporter {
   int token = -1;
 
-  void reportFatalError(Token token,
-                        messageKind,
-                        [Map arguments = const {}]) {
+  void reportFatalError(Token token) {
     this.token = token.kind;
     throw this;
   }
 
-  void reportError(Token token,
-                   messageKind,
-                   [Map arguments = const {}]) {
-    reportFatalError(token, messageKind, arguments);
+  void reportError(
+      DiagnosticMessage message,
+      [List<DiagnosticMessage> infos = const <DiagnosticMessage>[]]) {
+    reportFatalError(message.spannable);
   }
 
   void log(message) {
     print(message);
   }
 
-  noSuchMethod(Invocation invocation) => throw 'unsupported operation';
+  noSuchMethod(Invocation invocation) {
+    throw 'unsupported operation';
+  }
+
+  @override
+  DiagnosticMessage createMessage(spannable, messageKind, [arguments]) {
+    return new DiagnosticMessage(null, spannable, null);
+  }
 }
 
 void testMissingCloseParen() {
@@ -321,7 +326,7 @@
   return x;
 }''';
   parse() {
-    parseMember(source, diagnosticHandler: new Collector());
+    parseMember(source, reporter: new Collector());
   }
   check(Collector c) {
     Expect.equals(OPEN_CURLY_BRACKET_TOKEN, c.token);
@@ -333,7 +338,7 @@
 void testMissingCloseBraceInClass() {
   final String source = 'class Foo {'; // Missing close '}'.
   parse() {
-    fullParseUnit(source, diagnosticHandler: new Collector());
+    fullParseUnit(source, reporter: new Collector());
   }
   check(Collector c) {
     Expect.equals(BAD_INPUT_TOKEN, c.token);
@@ -345,7 +350,7 @@
 void testUnmatchedAngleBracket() {
   final String source = 'A<'; // unmatched '<'
   parse() {
-    fullParseUnit(source, diagnosticHandler: new Collector());
+    fullParseUnit(source, reporter: new Collector());
   }
   check(Collector c) {
     Expect.equals(LT_TOKEN, c.token);
diff --git a/tests/compiler/dart2js/part_of_test.dart b/tests/compiler/dart2js/part_of_test.dart
index 91aa645..979d9ca 100644
--- a/tests/compiler/dart2js/part_of_test.dart
+++ b/tests/compiler/dart2js/part_of_test.dart
@@ -6,9 +6,9 @@
 
 import "package:expect/expect.dart";
 import "package:async_helper/async_helper.dart";
+import 'package:compiler/src/diagnostics/messages.dart' show
+    MessageKind;
 import 'mock_compiler.dart';
-import 'package:compiler/src/dart2jslib.dart'
-    show MessageKind;
 
 final libraryUri = Uri.parse('test:library.dart');
 const String LIBRARY_SOURCE = '''
diff --git a/tests/compiler/dart2js/patch_test.dart b/tests/compiler/dart2js/patch_test.dart
index c198012..660a803 100644
--- a/tests/compiler/dart2js/patch_test.dart
+++ b/tests/compiler/dart2js/patch_test.dart
@@ -3,15 +3,23 @@
 // 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";
-import "package:compiler/src/dart2jslib.dart";
-import "package:compiler/src/elements/elements.dart";
-import "package:compiler/src/tree/tree.dart";
-import "package:compiler/src/types/types.dart";
-import "mock_compiler.dart";
-import "mock_libraries.dart";
+import 'package:expect/expect.dart';
+import 'package:async_helper/async_helper.dart';
+import 'package:compiler/src/compiler.dart';
+import 'package:compiler/src/diagnostics/messages.dart' show
+    MessageKind;
+import 'package:compiler/src/elements/elements.dart';
 import 'package:compiler/src/elements/modelx.dart';
+import 'package:compiler/src/tree/tree.dart';
+import 'package:compiler/src/types/types.dart';
+import 'package:compiler/src/universe/call_structure.dart' show
+    CallStructure;
+import 'package:compiler/src/universe/selector.dart' show
+    Selector;
+import 'package:compiler/src/world.dart';
+
+import 'mock_compiler.dart';
+import 'mock_libraries.dart';
 
 Future<Compiler> applyPatch(String script, String patch,
                             {bool analyzeAll: false,
@@ -37,7 +45,7 @@
 }
 
 void expectHasBody(compiler, ElementX element) {
-    var node = element.parseNode(compiler);
+    var node = element.parseNode(compiler.parsing);
     Expect.isNotNull(node, "Element isn't parseable, when a body was expected");
     Expect.isNotNull(node.body);
     // If the element has a body it is either a Block or a Return statement,
@@ -47,7 +55,7 @@
 }
 
 void expectHasNoBody(compiler, ElementX element) {
-    var node = element.parseNode(compiler);
+    var node = element.parseNode(compiler.parsing);
     Expect.isNotNull(node, "Element isn't parseable, when a body was expected");
     Expect.isFalse(node.hasBody());
 }
@@ -118,24 +126,49 @@
   return element;
 }
 
-testPatchFunction() {
-  asyncTest(() => applyPatch(
+Future testPatchFunction() async {
+  var compiler = await applyPatch(
       "external test();",
-      "@patch test() { return 'string'; } ").then((compiler) {
-    ensure(compiler, "test", compiler.coreLibrary.find,
-           expectIsPatched: true, checkHasBody: true);
-    ensure(compiler, "test", compiler.coreLibrary.patch.find,
-           expectIsPatch: true, checkHasBody: true);
+      "@patch test() { return 'string'; } ");
+  ensure(compiler, "test", compiler.coreLibrary.find,
+         expectIsPatched: true, checkHasBody: true);
+  ensure(compiler, "test", compiler.coreLibrary.patch.find,
+         expectIsPatch: true, checkHasBody: true);
 
-    Expect.isTrue(compiler.warnings.isEmpty,
-                  "Unexpected warnings: ${compiler.warnings}");
-    Expect.isTrue(compiler.errors.isEmpty,
-                  "Unexpected errors: ${compiler.errors}");
-  }));
+  Expect.isTrue(compiler.warnings.isEmpty,
+                "Unexpected warnings: ${compiler.warnings}");
+  Expect.isTrue(compiler.errors.isEmpty,
+                "Unexpected errors: ${compiler.errors}");
+}
+
+Future testPatchFunctionMetadata() async {
+  var compiler = await applyPatch(
+      """
+      const a = 0;
+      @a external test();
+      """,
+      """
+      const b = 1;
+      @patch @b test() {}
+      """);
+  Element origin = ensure(compiler, "test", compiler.coreLibrary.find,
+         expectIsPatched: true, checkHasBody: true);
+  Element patch = ensure(compiler, "test", compiler.coreLibrary.patch.find,
+         expectIsPatch: true, checkHasBody: true);
+
+  Expect.isTrue(compiler.warnings.isEmpty,
+                "Unexpected warnings: ${compiler.warnings}");
+  Expect.isTrue(compiler.errors.isEmpty,
+                "Unexpected errors: ${compiler.errors}");
+
+  Expect.equals(1, origin.metadata.length,
+                "Unexpected origin metadata: ${origin.metadata}.");
+  Expect.equals(3, patch.metadata.length,
+                "Unexpected patch metadata: ${patch.metadata}.");
 }
 
 
-testPatchVersioned() {
+Future testPatchVersioned() async {
   String fullPatch = "test(){return 'string';}";
   String lazyPatch = "test(){return 'new and improved string';}";
 
@@ -145,64 +178,64 @@
       @patch_lazy $lazyPatch
       """;
 
-  test(String patchVersion,
+  Future test(String patchVersion,
        {String patchText,
         bool expectIsPatched: true,
         String expectedError,
         String defaultPatch: '',
-        String expectedInternalError}) {
-    asyncTest(() => applyPatch(
+        String expectedInternalError}) async {
+    return applyPatch(
         "external test();",
         """
         $defaultPatch
         $patchSource
         """,
         patchVersion: patchVersion).then((compiler) {
-      Element origin =
-          ensure(compiler, "test", compiler.coreLibrary.find,
-               expectIsPatched: expectIsPatched, checkHasBody: true);
-      if (expectIsPatched) {
-        AstElement patch =
-            ensure(compiler, "test", compiler.coreLibrary.patch.find,
-                expectIsPatch: true, checkHasBody: true);
-        Expect.equals(origin.patch, patch);
-        Expect.equals(patch.origin, origin);
-        Expect.equals(patchText, patch.node.toString());
-      }
+        Element origin =
+            ensure(compiler, "test", compiler.coreLibrary.find,
+                 expectIsPatched: expectIsPatched, checkHasBody: true);
+        if (expectIsPatched) {
+          AstElement patch =
+              ensure(compiler, "test", compiler.coreLibrary.patch.find,
+                  expectIsPatch: true, checkHasBody: true);
+          Expect.equals(origin.patch, patch);
+          Expect.equals(patch.origin, origin);
+          Expect.equals(patchText, patch.node.toString());
+        }
 
-      compiler.analyzeElement(origin);
-      compiler.enqueuer.resolution.emptyDeferredTaskQueue();
+        compiler.analyzeElement(origin);
+        compiler.enqueuer.resolution.emptyDeferredTaskQueue();
 
-      Expect.isTrue(compiler.warnings.isEmpty,
-                    "Unexpected warnings: ${compiler.warnings}");
-      if (expectedError != null) {
-        Expect.equals(expectedError,
-                      compiler.errors[0].message.toString());
-      } else {
-        Expect.isTrue(compiler.errors.isEmpty,
-                      "Unexpected errors: ${compiler.errors}");
-      }
-    }).catchError((error) {
-      if (expectedInternalError != null) {
-        Expect.equals(
-            'Internal Error: $expectedInternalError', error.toString());
-      } else {
-        throw error;
-      }
-    }));
+        Expect.isTrue(compiler.warnings.isEmpty,
+                      "Unexpected warnings: ${compiler.warnings}");
+        if (expectedError != null) {
+          Expect.equals(expectedError,
+                        compiler.errors[0].message.toString());
+        } else {
+          Expect.isTrue(compiler.errors.isEmpty,
+                        "Unexpected errors: ${compiler.errors}");
+        }
+      }).catchError((error) {
+        if (expectedInternalError != null) {
+          Expect.equals(
+              'Internal Error: $expectedInternalError', error.toString());
+        } else {
+          throw error;
+        }
+      });
   }
 
-  test('full', patchText: fullPatch);
-  test('lazy', patchText: lazyPatch);
-  test('unknown', expectIsPatched: false,
+  await test('full', patchText: fullPatch);
+  await test('lazy', patchText: lazyPatch);
+  await test('unknown', expectIsPatched: false,
        expectedError: 'External method without an implementation.');
-  test('full',
+  await test('full',
        defaultPatch: "@patch test(){}",
        expectedInternalError: "Trying to patch a function more than once.");
 }
 
-testPatchConstructor() {
-  asyncTest(() => applyPatch(
+Future testPatchConstructor() async {
+  var compiler = await applyPatch(
       """
       class Class {
         external Class();
@@ -212,35 +245,34 @@
       @patch class Class {
         @patch Class();
       }
-      """).then((compiler) {
-    var classOrigin = ensure(compiler, "Class", compiler.coreLibrary.find,
-                             expectIsPatched: true);
-    classOrigin.ensureResolved(compiler);
-    var classPatch = ensure(compiler, "Class", compiler.coreLibrary.patch.find,
-                            expectIsPatch: true);
+      """);
+  var classOrigin = ensure(compiler, "Class", compiler.coreLibrary.find,
+                           expectIsPatched: true);
+  classOrigin.ensureResolved(compiler.resolution);
+  var classPatch = ensure(compiler, "Class", compiler.coreLibrary.patch.find,
+                          expectIsPatch: true);
 
-    Expect.equals(classPatch, classOrigin.patch);
-    Expect.equals(classOrigin, classPatch.origin);
+  Expect.equals(classPatch, classOrigin.patch);
+  Expect.equals(classOrigin, classPatch.origin);
 
-    var constructorOrigin = ensure(compiler, "",
-                                   (name) => classOrigin.localLookup(name),
-                                   expectIsPatched: true);
-    var constructorPatch = ensure(compiler, "",
-                                  (name) => classPatch.localLookup(name),
-                                  expectIsPatch: true);
+  var constructorOrigin = ensure(compiler, "",
+                                 (name) => classOrigin.localLookup(name),
+                                 expectIsPatched: true);
+  var constructorPatch = ensure(compiler, "",
+                                (name) => classPatch.localLookup(name),
+                                expectIsPatch: true);
 
-    Expect.equals(constructorPatch, constructorOrigin.patch);
-    Expect.equals(constructorOrigin, constructorPatch.origin);
+  Expect.equals(constructorPatch, constructorOrigin.patch);
+  Expect.equals(constructorOrigin, constructorPatch.origin);
 
-    Expect.isTrue(compiler.warnings.isEmpty,
-                  "Unexpected warnings: ${compiler.warnings}");
-    Expect.isTrue(compiler.errors.isEmpty,
-                  "Unexpected errors: ${compiler.errors}");
-  }));
+  Expect.isTrue(compiler.warnings.isEmpty,
+                "Unexpected warnings: ${compiler.warnings}");
+  Expect.isTrue(compiler.errors.isEmpty,
+                "Unexpected errors: ${compiler.errors}");
 }
 
-testPatchRedirectingConstructor() {
-  asyncTest(() => applyPatch(
+Future testPatchRedirectingConstructor() async {
+  var compiler = await applyPatch(
       """
       class Class {
         Class(x) : this._(x, false);
@@ -252,42 +284,41 @@
       @patch class Class {
         @patch Class._(x, y) { print('$x,$y'); }
       }
-      """).then((compiler) {
-    var classOrigin = ensure(compiler, "Class", compiler.coreLibrary.find,
-                             expectIsPatched: true);
-    classOrigin.ensureResolved(compiler);
+      """);
+  var classOrigin = ensure(compiler, "Class", compiler.coreLibrary.find,
+                           expectIsPatched: true);
+  classOrigin.ensureResolved(compiler.resolution);
 
-    var classPatch = ensure(compiler, "Class", compiler.coreLibrary.patch.find,
-                            expectIsPatch: true);
+  var classPatch = ensure(compiler, "Class", compiler.coreLibrary.patch.find,
+                          expectIsPatch: true);
 
-    Expect.equals(classOrigin, classPatch.origin);
-    Expect.equals(classPatch, classOrigin.patch);
+  Expect.equals(classOrigin, classPatch.origin);
+  Expect.equals(classPatch, classOrigin.patch);
 
-    var constructorRedirecting =
-        ensure(compiler, "",
-               (name) => classOrigin.localLookup(name));
-    var constructorOrigin =
-        ensure(compiler, "_",
-               (name) => classOrigin.localLookup(name),
-               expectIsPatched: true);
-    var constructorPatch =
-        ensure(compiler, "_",
-               (name) => classPatch.localLookup(name),
-               expectIsPatch: true);
-    Expect.equals(constructorOrigin, constructorPatch.origin);
-    Expect.equals(constructorPatch, constructorOrigin.patch);
+  var constructorRedirecting =
+      ensure(compiler, "",
+             (name) => classOrigin.localLookup(name));
+  var constructorOrigin =
+      ensure(compiler, "_",
+             (name) => classOrigin.localLookup(name),
+             expectIsPatched: true);
+  var constructorPatch =
+      ensure(compiler, "_",
+             (name) => classPatch.localLookup(name),
+             expectIsPatch: true);
+  Expect.equals(constructorOrigin, constructorPatch.origin);
+  Expect.equals(constructorPatch, constructorOrigin.patch);
 
-    compiler.resolver.resolve(constructorRedirecting);
+  compiler.resolver.resolve(constructorRedirecting);
 
-    Expect.isTrue(compiler.warnings.isEmpty,
-                  "Unexpected warnings: ${compiler.warnings}");
-    Expect.isTrue(compiler.errors.isEmpty,
-                  "Unexpected errors: ${compiler.errors}");
-   }));
+  Expect.isTrue(compiler.warnings.isEmpty,
+                "Unexpected warnings: ${compiler.warnings}");
+  Expect.isTrue(compiler.errors.isEmpty,
+                "Unexpected errors: ${compiler.errors}");
 }
 
-testPatchMember() {
-  asyncTest(() => applyPatch(
+Future testPatchMember() async {
+  var compiler = await applyPatch(
       """
       class Class {
         external String toString();
@@ -297,27 +328,26 @@
       @patch class Class {
         @patch String toString() => 'string';
       }
-      """).then((compiler) {
-    var container = ensure(compiler, "Class", compiler.coreLibrary.find,
-                           expectIsPatched: true);
-    container.parseNode(compiler);
-    ensure(compiler, "Class", compiler.coreLibrary.patch.find,
-           expectIsPatch: true);
+      """);
+  var container = ensure(compiler, "Class", compiler.coreLibrary.find,
+                         expectIsPatched: true);
+  container.parseNode(compiler.parsing);
+  ensure(compiler, "Class", compiler.coreLibrary.patch.find,
+         expectIsPatch: true);
 
-    ensure(compiler, "toString", container.lookupLocalMember,
-           expectIsPatched: true, checkHasBody: true);
-    ensure(compiler, "toString", container.patch.lookupLocalMember,
-           expectIsPatch: true, checkHasBody: true);
+  ensure(compiler, "toString", container.lookupLocalMember,
+         expectIsPatched: true, checkHasBody: true);
+  ensure(compiler, "toString", container.patch.lookupLocalMember,
+         expectIsPatch: true, checkHasBody: true);
 
-    Expect.isTrue(compiler.warnings.isEmpty,
-                  "Unexpected warnings: ${compiler.warnings}");
-    Expect.isTrue(compiler.errors.isEmpty,
-                  "Unexpected errors: ${compiler.errors}");
-  }));
+  Expect.isTrue(compiler.warnings.isEmpty,
+                "Unexpected warnings: ${compiler.warnings}");
+  Expect.isTrue(compiler.errors.isEmpty,
+                "Unexpected errors: ${compiler.errors}");
 }
 
-testPatchGetter() {
-  asyncTest(() => applyPatch(
+Future testPatchGetter() async {
+  var compiler = await applyPatch(
       """
       class Class {
         external int get field;
@@ -327,32 +357,31 @@
       @patch class Class {
         @patch int get field => 5;
       }
-      """).then((compiler) {
-    var container = ensure(compiler, "Class", compiler.coreLibrary.find,
-                           expectIsPatched: true);
-    container.parseNode(compiler);
-    ensure(compiler,
-           "field",
-           container.lookupLocalMember,
-           expectIsGetter: true,
-           expectIsPatched: true,
-           checkHasBody: true);
-    ensure(compiler,
-           "field",
-           container.patch.lookupLocalMember,
-           expectIsGetter: true,
-           expectIsPatch: true,
-           checkHasBody: true);
+      """);
+  var container = ensure(compiler, "Class", compiler.coreLibrary.find,
+                         expectIsPatched: true);
+  container.parseNode(compiler.parsing);
+  ensure(compiler,
+         "field",
+         container.lookupLocalMember,
+         expectIsGetter: true,
+         expectIsPatched: true,
+         checkHasBody: true);
+  ensure(compiler,
+         "field",
+         container.patch.lookupLocalMember,
+         expectIsGetter: true,
+         expectIsPatch: true,
+         checkHasBody: true);
 
-    Expect.isTrue(compiler.warnings.isEmpty,
-                  "Unexpected warnings: ${compiler.warnings}");
-    Expect.isTrue(compiler.errors.isEmpty,
-                  "Unexpected errors: ${compiler.errors}");
-  }));
+  Expect.isTrue(compiler.warnings.isEmpty,
+                "Unexpected warnings: ${compiler.warnings}");
+  Expect.isTrue(compiler.errors.isEmpty,
+                "Unexpected errors: ${compiler.errors}");
 }
 
-testRegularMember() {
-  asyncTest(() => applyPatch(
+Future testRegularMember() async {
+  var compiler = await applyPatch(
       """
       class Class {
         void regular() {}
@@ -361,27 +390,26 @@
       """
       @patch class Class {
       }
-      """).then((compiler) {
-    var container = ensure(compiler, "Class", compiler.coreLibrary.find,
-                           expectIsPatched: true);
-    container.parseNode(compiler);
-    ensure(compiler, "Class", compiler.coreLibrary.patch.find,
-           expectIsPatch: true);
+      """);
+  var container = ensure(compiler, "Class", compiler.coreLibrary.find,
+                         expectIsPatched: true);
+  container.parseNode(compiler.parsing);
+  ensure(compiler, "Class", compiler.coreLibrary.patch.find,
+         expectIsPatch: true);
 
-    ensure(compiler, "regular", container.lookupLocalMember,
-           checkHasBody: true, expectIsRegular: true);
-    ensure(compiler, "regular", container.patch.lookupLocalMember,
-           checkHasBody: true, expectIsRegular: true);
+  ensure(compiler, "regular", container.lookupLocalMember,
+         checkHasBody: true, expectIsRegular: true);
+  ensure(compiler, "regular", container.patch.lookupLocalMember,
+         checkHasBody: true, expectIsRegular: true);
 
-    Expect.isTrue(compiler.warnings.isEmpty,
-                  "Unexpected warnings: ${compiler.warnings}");
-    Expect.isTrue(compiler.errors.isEmpty,
-                  "Unexpected errors: ${compiler.errors}");
-  }));
+  Expect.isTrue(compiler.warnings.isEmpty,
+                "Unexpected warnings: ${compiler.warnings}");
+  Expect.isTrue(compiler.errors.isEmpty,
+                "Unexpected errors: ${compiler.errors}");
 }
 
-testGhostMember() {
-  asyncTest(() => applyPatch(
+Future testGhostMember() async {
+  var compiler = await applyPatch(
       """
       class Class {
       }
@@ -390,47 +418,45 @@
       @patch class Class {
         void ghost() {}
       }
-      """).then((compiler) {
-    var container = ensure(compiler, "Class", compiler.coreLibrary.find,
-                           expectIsPatched: true);
-    container.parseNode(compiler);
-    ensure(compiler, "Class", compiler.coreLibrary.patch.find,
-           expectIsPatch: true);
+      """);
+  var container = ensure(compiler, "Class", compiler.coreLibrary.find,
+                         expectIsPatched: true);
+  container.parseNode(compiler.parsing);
+  ensure(compiler, "Class", compiler.coreLibrary.patch.find,
+         expectIsPatch: true);
 
-    ensure(compiler, "ghost", container.lookupLocalMember,
-           expectIsFound: false);
-    ensure(compiler, "ghost", container.patch.lookupLocalMember,
-           checkHasBody: true, expectIsRegular: true);
+  ensure(compiler, "ghost", container.lookupLocalMember,
+         expectIsFound: false);
+  ensure(compiler, "ghost", container.patch.lookupLocalMember,
+         checkHasBody: true, expectIsRegular: true);
 
-    Expect.isTrue(compiler.warnings.isEmpty,
-                  "Unexpected warnings: ${compiler.warnings}");
-    Expect.isTrue(compiler.errors.isEmpty,
-                  "Unexpected errors: ${compiler.errors}");
-  }));
+  Expect.isTrue(compiler.warnings.isEmpty,
+                "Unexpected warnings: ${compiler.warnings}");
+  Expect.isTrue(compiler.errors.isEmpty,
+                "Unexpected errors: ${compiler.errors}");
 }
 
-testInjectFunction() {
-  asyncTest(() => applyPatch(
+Future testInjectFunction() async {
+  var compiler = await applyPatch(
       "",
-      "int _function() => 5;").then((compiler) {
-    ensure(compiler,
-           "_function",
-           compiler.coreLibrary.find,
-           expectIsFound: false);
-    ensure(compiler,
-           "_function",
-           compiler.coreLibrary.patch.find,
-           checkHasBody: true, expectIsRegular: true);
+      "int _function() => 5;");
+  ensure(compiler,
+         "_function",
+         compiler.coreLibrary.find,
+         expectIsFound: false);
+  ensure(compiler,
+         "_function",
+         compiler.coreLibrary.patch.find,
+         checkHasBody: true, expectIsRegular: true);
 
-    Expect.isTrue(compiler.warnings.isEmpty,
-                  "Unexpected warnings: ${compiler.warnings}");
-    Expect.isTrue(compiler.errors.isEmpty,
-                  "Unexpected errors: ${compiler.errors}");
-  }));
+  Expect.isTrue(compiler.warnings.isEmpty,
+                "Unexpected warnings: ${compiler.warnings}");
+  Expect.isTrue(compiler.errors.isEmpty,
+                "Unexpected errors: ${compiler.errors}");
 }
 
-testPatchSignatureCheck() {
-  asyncTest(() => applyPatch(
+Future testPatchSignatureCheck() async {
+  var compiler = await applyPatch(
       """
       class Class {
         external String method1();
@@ -460,78 +486,76 @@
         @patch void method10([int str]) {}
         @patch void method11({int str}) {}
       }
-      """).then((compiler) {
-    var container = ensure(compiler, "Class", compiler.coreLibrary.find,
-                           expectIsPatched: true);
-    container.ensureResolved(compiler);
-    container.parseNode(compiler);
+      """);
+  var container = ensure(compiler, "Class", compiler.coreLibrary.find,
+                         expectIsPatched: true);
+  container.ensureResolved(compiler.resolution);
+  container.parseNode(compiler.parsing);
 
-    void expect(String methodName, List infos, List errors) {
-      compiler.clearMessages();
-      compiler.resolver.resolveMethodElement(
-          ensure(compiler, methodName, container.lookupLocalMember,
-              expectIsPatched: true, checkHasBody: true));
-      Expect.equals(0, compiler.warnings.length);
-      Expect.equals(infos.length, compiler.infos.length,
-                    "Unexpected infos: ${compiler.infos} on $methodName");
-      for (int i = 0 ; i < infos.length ; i++) {
-        Expect.equals(infos[i], compiler.infos[i].message.kind);
-      }
-      Expect.equals(errors.length, compiler.errors.length,
-                    "Unexpected errors: ${compiler.errors} on $methodName");
-      for (int i = 0 ; i < errors.length ; i++) {
-        Expect.equals(errors[i], compiler.errors[i].message.kind);
-      }
+  void expect(String methodName, List infos, List errors) {
+    compiler.clearMessages();
+    compiler.resolver.resolveMethodElement(
+        ensure(compiler, methodName, container.lookupLocalMember,
+            expectIsPatched: true, checkHasBody: true));
+    Expect.equals(0, compiler.warnings.length);
+    Expect.equals(infos.length, compiler.infos.length,
+                  "Unexpected infos: ${compiler.infos} on $methodName");
+    for (int i = 0 ; i < infos.length ; i++) {
+      Expect.equals(infos[i], compiler.infos[i].message.kind);
     }
+    Expect.equals(errors.length, compiler.errors.length,
+                  "Unexpected errors: ${compiler.errors} on $methodName");
+    for (int i = 0 ; i < errors.length ; i++) {
+      Expect.equals(errors[i], compiler.errors[i].message.kind);
+    }
+  }
 
-    expect("method1", [], [MessageKind.PATCH_RETURN_TYPE_MISMATCH]);
-    expect("method2", [],
-           [MessageKind.PATCH_REQUIRED_PARAMETER_COUNT_MISMATCH]);
-    expect("method3", [MessageKind.PATCH_POINT_TO_PARAMETER],
-                      [MessageKind.PATCH_PARAMETER_MISMATCH]);
-    expect("method4", [],
-           [MessageKind.PATCH_OPTIONAL_PARAMETER_COUNT_MISMATCH]);
-    expect("method5", [],
-           [MessageKind.PATCH_OPTIONAL_PARAMETER_COUNT_MISMATCH]);
-    expect("method6", [],
-           [MessageKind.PATCH_OPTIONAL_PARAMETER_NAMED_MISMATCH]);
-    expect("method7", [MessageKind.PATCH_POINT_TO_PARAMETER],
-                      [MessageKind.PATCH_PARAMETER_MISMATCH]);
-    expect("method8", [MessageKind.PATCH_POINT_TO_PARAMETER],
-                      [MessageKind.PATCH_PARAMETER_MISMATCH]);
-    expect("method9", [MessageKind.PATCH_POINT_TO_PARAMETER],
-                      [MessageKind.PATCH_PARAMETER_TYPE_MISMATCH]);
-    expect("method10", [MessageKind.PATCH_POINT_TO_PARAMETER],
-                       [MessageKind.PATCH_PARAMETER_TYPE_MISMATCH]);
-    expect("method11", [MessageKind.PATCH_POINT_TO_PARAMETER],
-                       [MessageKind.PATCH_PARAMETER_TYPE_MISMATCH]);
-  }));
+  expect("method1", [], [MessageKind.PATCH_RETURN_TYPE_MISMATCH]);
+  expect("method2", [],
+         [MessageKind.PATCH_REQUIRED_PARAMETER_COUNT_MISMATCH]);
+  expect("method3", [MessageKind.PATCH_POINT_TO_PARAMETER],
+                    [MessageKind.PATCH_PARAMETER_MISMATCH]);
+  expect("method4", [],
+         [MessageKind.PATCH_OPTIONAL_PARAMETER_COUNT_MISMATCH]);
+  expect("method5", [],
+         [MessageKind.PATCH_OPTIONAL_PARAMETER_COUNT_MISMATCH]);
+  expect("method6", [],
+         [MessageKind.PATCH_OPTIONAL_PARAMETER_NAMED_MISMATCH]);
+  expect("method7", [MessageKind.PATCH_POINT_TO_PARAMETER],
+                    [MessageKind.PATCH_PARAMETER_MISMATCH]);
+  expect("method8", [MessageKind.PATCH_POINT_TO_PARAMETER],
+                    [MessageKind.PATCH_PARAMETER_MISMATCH]);
+  expect("method9", [MessageKind.PATCH_POINT_TO_PARAMETER],
+                    [MessageKind.PATCH_PARAMETER_TYPE_MISMATCH]);
+  expect("method10", [MessageKind.PATCH_POINT_TO_PARAMETER],
+                     [MessageKind.PATCH_PARAMETER_TYPE_MISMATCH]);
+  expect("method11", [MessageKind.PATCH_POINT_TO_PARAMETER],
+                     [MessageKind.PATCH_PARAMETER_TYPE_MISMATCH]);
 }
 
-testExternalWithoutImplementationTopLevel() {
-  asyncTest(() => applyPatch(
+Future testExternalWithoutImplementationTopLevel() async {
+  var compiler = await applyPatch(
       """
       external void foo();
       """,
       """
       // @patch void foo() {}
-      """).then((compiler) {
-    var function = ensure(compiler, "foo", compiler.coreLibrary.find);
-    compiler.resolver.resolve(function);
-    Expect.isTrue(compiler.warnings.isEmpty,
-                  "Unexpected warnings: ${compiler.warnings}");
-    print('testExternalWithoutImplementationTopLevel:${compiler.errors}');
-    Expect.equals(1, compiler.errors.length);
-    Expect.isTrue(
-        compiler.errors[0].message.kind ==
-            MessageKind.PATCH_EXTERNAL_WITHOUT_IMPLEMENTATION);
-    Expect.stringEquals('External method without an implementation.',
-                        compiler.errors[0].message.toString());
-  }));
+      """);
+  var function = ensure(compiler, "foo", compiler.coreLibrary.find);
+  compiler.resolver.resolve(function);
+  Expect.isTrue(compiler.warnings.isEmpty,
+                "Unexpected warnings: ${compiler.warnings}");
+  print('testExternalWithoutImplementationTopLevel:${compiler.errors}');
+  Expect.equals(1, compiler.errors.length);
+  Expect.isTrue(
+      compiler.errors[0].message.kind ==
+          MessageKind.PATCH_EXTERNAL_WITHOUT_IMPLEMENTATION);
+  Expect.stringEquals('External method without an implementation.',
+                      compiler.errors[0].message.toString());
 }
 
-testExternalWithoutImplementationMember() {
-  asyncTest(() => applyPatch(
+Future testExternalWithoutImplementationMember() async {
+  var compiler = await applyPatch(
       """
       class Class {
         external void foo();
@@ -541,63 +565,60 @@
       @patch class Class {
         // @patch void foo() {}
       }
-      """).then((compiler) {
-    var container = ensure(compiler, "Class", compiler.coreLibrary.find,
-                           expectIsPatched: true);
-    container.parseNode(compiler);
+      """);
+  var container = ensure(compiler, "Class", compiler.coreLibrary.find,
+                         expectIsPatched: true);
+  container.parseNode(compiler.parsing);
 
-    compiler.warnings.clear();
-    compiler.errors.clear();
-    compiler.resolver.resolveMethodElement(
-        ensure(compiler, "foo", container.lookupLocalMember));
-    Expect.isTrue(compiler.warnings.isEmpty,
-                  "Unexpected warnings: ${compiler.warnings}");
-    print('testExternalWithoutImplementationMember:${compiler.errors}');
-    Expect.equals(1, compiler.errors.length);
-    Expect.isTrue(
-        compiler.errors[0].message.kind ==
-            MessageKind.PATCH_EXTERNAL_WITHOUT_IMPLEMENTATION);
-    Expect.stringEquals('External method without an implementation.',
-                        compiler.errors[0].message.toString());
-  }));
+  compiler.warnings.clear();
+  compiler.errors.clear();
+  compiler.resolver.resolveMethodElement(
+      ensure(compiler, "foo", container.lookupLocalMember));
+  Expect.isTrue(compiler.warnings.isEmpty,
+                "Unexpected warnings: ${compiler.warnings}");
+  print('testExternalWithoutImplementationMember:${compiler.errors}');
+  Expect.equals(1, compiler.errors.length);
+  Expect.isTrue(
+      compiler.errors[0].message.kind ==
+          MessageKind.PATCH_EXTERNAL_WITHOUT_IMPLEMENTATION);
+  Expect.stringEquals('External method without an implementation.',
+                      compiler.errors[0].message.toString());
 }
 
-testIsSubclass() {
-  asyncTest(() => applyPatch(
+Future testIsSubclass() async {
+  var compiler = await applyPatch(
       """
       class A {}
       """,
       """
       @patch class A {}
-      """).then((compiler) {
-    ClassElement cls = ensure(compiler, "A", compiler.coreLibrary.find,
-                              expectIsPatched: true);
-    ClassElement patch = cls.patch;
-    Expect.isTrue(cls != patch);
-    Expect.isTrue(cls.isSubclassOf(patch));
-    Expect.isTrue(patch.isSubclassOf(cls));
-  }));
+      """);
+  ClassElement cls = ensure(compiler, "A", compiler.coreLibrary.find,
+                            expectIsPatched: true);
+  ClassElement patch = cls.patch;
+  Expect.isTrue(cls != patch);
+  Expect.isTrue(cls.isSubclassOf(patch));
+  Expect.isTrue(patch.isSubclassOf(cls));
 }
 
-testPatchNonExistingTopLevel() {
-  asyncTest(() => applyPatch(
+Future testPatchNonExistingTopLevel() async {
+  var compiler = await applyPatch(
       """
       // class Class {}
       """,
       """
       @patch class Class {}
-      """).then((compiler) {
-    Expect.isTrue(compiler.warnings.isEmpty,
-                  "Unexpected warnings: ${compiler.warnings}");
-    print('testPatchNonExistingTopLevel:${compiler.errors}');
-    Expect.equals(1, compiler.errors.length);
-    Expect.isTrue(
-        compiler.errors[0].message.kind == MessageKind.PATCH_NON_EXISTING);
-  }));
+      """);
+  Expect.isTrue(compiler.warnings.isEmpty,
+                "Unexpected warnings: ${compiler.warnings}");
+  print('testPatchNonExistingTopLevel:${compiler.errors}');
+  Expect.equals(1, compiler.errors.length);
+  Expect.isTrue(
+      compiler.errors[0].message.kind == MessageKind.PATCH_NON_EXISTING);
 }
 
-testPatchNonExistingMember() {
-  asyncTest(() => applyPatch(
+Future testPatchNonExistingMember() async {
+  var compiler = await applyPatch(
       """
       class Class {}
       """,
@@ -605,84 +626,80 @@
       @patch class Class {
         @patch void foo() {}
       }
-      """).then((compiler) {
-    var container = ensure(compiler, "Class", compiler.coreLibrary.find,
-                           expectIsPatched: true);
-    container.parseNode(compiler);
+      """);
+  var container = ensure(compiler, "Class", compiler.coreLibrary.find,
+                         expectIsPatched: true);
+  container.parseNode(compiler.parsing);
 
-    Expect.isTrue(compiler.warnings.isEmpty,
-                  "Unexpected warnings: ${compiler.warnings}");
-    print('testPatchNonExistingMember:${compiler.errors}');
-    Expect.equals(1, compiler.errors.length);
-    Expect.isTrue(
-        compiler.errors[0].message.kind == MessageKind.PATCH_NON_EXISTING);
-  }));
+  Expect.isTrue(compiler.warnings.isEmpty,
+                "Unexpected warnings: ${compiler.warnings}");
+  print('testPatchNonExistingMember:${compiler.errors}');
+  Expect.equals(1, compiler.errors.length);
+  Expect.isTrue(
+      compiler.errors[0].message.kind == MessageKind.PATCH_NON_EXISTING);
 }
 
-testPatchNonPatchablePatch() {
-  asyncTest(() => applyPatch(
+Future testPatchNonPatchablePatch() async {
+  var compiler = await applyPatch(
       """
       external get foo;
       """,
       """
       @patch var foo;
-      """).then((compiler) {
-    ensure(compiler, "foo", compiler.coreLibrary.find);
+      """);
+  ensure(compiler, "foo", compiler.coreLibrary.find);
 
-    Expect.isTrue(compiler.warnings.isEmpty,
-                  "Unexpected warnings: ${compiler.warnings}");
-    print('testPatchNonPatchablePatch:${compiler.errors}');
-    Expect.equals(1, compiler.errors.length);
-    Expect.isTrue(
-        compiler.errors[0].message.kind == MessageKind.PATCH_NONPATCHABLE);
-  }));
+  Expect.isTrue(compiler.warnings.isEmpty,
+                "Unexpected warnings: ${compiler.warnings}");
+  print('testPatchNonPatchablePatch:${compiler.errors}');
+  Expect.equals(1, compiler.errors.length);
+  Expect.isTrue(
+      compiler.errors[0].message.kind == MessageKind.PATCH_NONPATCHABLE);
 }
 
-testPatchNonPatchableOrigin() {
-  asyncTest(() => applyPatch(
+Future testPatchNonPatchableOrigin() async {
+  var compiler = await applyPatch(
       """
       external var foo;
       """,
       """
       @patch get foo => 0;
-      """).then((compiler) {
-    ensure(compiler, "foo", compiler.coreLibrary.find);
+      """);
+  ensure(compiler, "foo", compiler.coreLibrary.find);
 
-    Expect.isTrue(compiler.warnings.isEmpty,
-                  "Unexpected warnings: ${compiler.warnings}");
-    print('testPatchNonPatchableOrigin:${compiler.errors}');
-    Expect.equals(2, compiler.errors.length);
-    Expect.equals(
-        MessageKind.EXTRANEOUS_MODIFIER, compiler.errors[0].message.kind);
-    Expect.equals(
-        // TODO(ahe): Eventually, this error should be removed as it will be
-        // handled by the regular parser.
-        MessageKind.PATCH_NONPATCHABLE, compiler.errors[1].message.kind);
-  }));
+  Expect.isTrue(compiler.warnings.isEmpty,
+                "Unexpected warnings: ${compiler.warnings}");
+  print('testPatchNonPatchableOrigin:${compiler.errors}');
+  Expect.equals(2, compiler.errors.length);
+  Expect.equals(
+      MessageKind.EXTRANEOUS_MODIFIER, compiler.errors[0].message.kind);
+  Expect.equals(
+      // TODO(ahe): Eventually, this error should be removed as it will be
+      // handled by the regular parser.
+      MessageKind.PATCH_NONPATCHABLE, compiler.errors[1].message.kind);
 }
 
-testPatchNonExternalTopLevel() {
-  asyncTest(() => applyPatch(
+Future testPatchNonExternalTopLevel() async {
+  var compiler = await applyPatch(
       """
       void foo() {}
       """,
       """
       @patch void foo() {}
-      """).then((compiler) {
-    print('testPatchNonExternalTopLevel.errors:${compiler.errors}');
-    print('testPatchNonExternalTopLevel.warnings:${compiler.warnings}');
-    Expect.equals(1, compiler.errors.length);
-    Expect.isTrue(
-        compiler.errors[0].message.kind == MessageKind.PATCH_NON_EXTERNAL);
-    Expect.equals(0, compiler.warnings.length);
-    Expect.equals(1, compiler.infos.length);
-    Expect.isTrue(compiler.infos[0].message.kind ==
-        MessageKind.PATCH_POINT_TO_FUNCTION);
-  }));
+      """);
+  print('testPatchNonExternalTopLevel.errors:${compiler.errors}');
+  print('testPatchNonExternalTopLevel.warnings:${compiler.warnings}');
+  Expect.equals(1, compiler.errors.length);
+  Expect.isTrue(
+      compiler.errors[0].message.kind == MessageKind.PATCH_NON_EXTERNAL);
+  Expect.equals(0, compiler.warnings.length);
+  Expect.equals(1, compiler.infos.length);
+  Expect.isTrue(compiler.infos[0].message.kind ==
+      MessageKind.PATCH_POINT_TO_FUNCTION);
 }
 
-testPatchNonExternalMember() {
-  asyncTest(() => applyPatch(
+Future testPatchNonExternalMember() async {
+  var compiler = await applyPatch(
       """
       class Class {
         void foo() {}
@@ -692,146 +709,139 @@
       @patch class Class {
         @patch void foo() {}
       }
-      """).then((compiler) {
-    var container = ensure(compiler, "Class", compiler.coreLibrary.find,
-                           expectIsPatched: true);
-    container.parseNode(compiler);
+      """);
+  var container = ensure(compiler, "Class", compiler.coreLibrary.find,
+                         expectIsPatched: true);
+  container.parseNode(compiler.parsing);
 
-    print('testPatchNonExternalMember.errors:${compiler.errors}');
-    print('testPatchNonExternalMember.warnings:${compiler.warnings}');
-    Expect.equals(1, compiler.errors.length);
-    Expect.isTrue(
-        compiler.errors[0].message.kind == MessageKind.PATCH_NON_EXTERNAL);
-    Expect.equals(0, compiler.warnings.length);
-    Expect.equals(1, compiler.infos.length);
-    Expect.isTrue(compiler.infos[0].message.kind ==
-        MessageKind.PATCH_POINT_TO_FUNCTION);
-  }));
+  print('testPatchNonExternalMember.errors:${compiler.errors}');
+  print('testPatchNonExternalMember.warnings:${compiler.warnings}');
+  Expect.equals(1, compiler.errors.length);
+  Expect.isTrue(
+      compiler.errors[0].message.kind == MessageKind.PATCH_NON_EXTERNAL);
+  Expect.equals(0, compiler.warnings.length);
+  Expect.equals(1, compiler.infos.length);
+  Expect.isTrue(compiler.infos[0].message.kind ==
+      MessageKind.PATCH_POINT_TO_FUNCTION);
 }
 
-testPatchNonClass() {
-  asyncTest(() => applyPatch(
+Future testPatchNonClass() async {
+  var compiler = await applyPatch(
       """
       external void Class() {}
       """,
       """
       @patch class Class {}
-      """).then((compiler) {
-    print('testPatchNonClass.errors:${compiler.errors}');
-    print('testPatchNonClass.warnings:${compiler.warnings}');
-    Expect.equals(1, compiler.errors.length);
-    Expect.isTrue(
-        compiler.errors[0].message.kind == MessageKind.PATCH_NON_CLASS);
-    Expect.equals(0, compiler.warnings.length);
-    Expect.equals(1, compiler.infos.length);
-    Expect.isTrue(
-        compiler.infos[0].message.kind == MessageKind.PATCH_POINT_TO_CLASS);
-  }));
+      """);
+  print('testPatchNonClass.errors:${compiler.errors}');
+  print('testPatchNonClass.warnings:${compiler.warnings}');
+  Expect.equals(1, compiler.errors.length);
+  Expect.isTrue(
+      compiler.errors[0].message.kind == MessageKind.PATCH_NON_CLASS);
+  Expect.equals(0, compiler.warnings.length);
+  Expect.equals(1, compiler.infos.length);
+  Expect.isTrue(
+      compiler.infos[0].message.kind == MessageKind.PATCH_POINT_TO_CLASS);
 }
 
-testPatchNonGetter() {
-  asyncTest(() => applyPatch(
+Future testPatchNonGetter() async {
+  var compiler = await applyPatch(
       """
       external void foo() {}
       """,
       """
       @patch get foo => 0;
-      """).then((compiler) {
-    print('testPatchNonClass.errors:${compiler.errors}');
-    print('testPatchNonClass.warnings:${compiler.warnings}');
-    Expect.equals(1, compiler.errors.length);
-    Expect.isTrue(
-        compiler.errors[0].message.kind == MessageKind.PATCH_NON_GETTER);
-    Expect.equals(0, compiler.warnings.length);
-    Expect.equals(1, compiler.infos.length);
-    Expect.isTrue(
-        compiler.infos[0].message.kind == MessageKind.PATCH_POINT_TO_GETTER);
-  }));
+      """);
+  print('testPatchNonClass.errors:${compiler.errors}');
+  print('testPatchNonClass.warnings:${compiler.warnings}');
+  Expect.equals(1, compiler.errors.length);
+  Expect.isTrue(
+      compiler.errors[0].message.kind == MessageKind.PATCH_NON_GETTER);
+  Expect.equals(0, compiler.warnings.length);
+  Expect.equals(1, compiler.infos.length);
+  Expect.isTrue(
+      compiler.infos[0].message.kind == MessageKind.PATCH_POINT_TO_GETTER);
 }
 
-testPatchNoGetter() {
-  asyncTest(() => applyPatch(
+Future testPatchNoGetter() async {
+  var compiler = await applyPatch(
       """
       external set foo(var value) {}
       """,
       """
       @patch get foo => 0;
-      """).then((compiler) {
-    print('testPatchNonClass.errors:${compiler.errors}');
-    print('testPatchNonClass.warnings:${compiler.warnings}');
-    Expect.equals(1, compiler.errors.length);
-    Expect.isTrue(
-        compiler.errors[0].message.kind == MessageKind.PATCH_NO_GETTER);
-    Expect.equals(0, compiler.warnings.length);
-    Expect.equals(1, compiler.infos.length);
-    Expect.isTrue(
-        compiler.infos[0].message.kind == MessageKind.PATCH_POINT_TO_GETTER);
-  }));
+      """);
+  print('testPatchNonClass.errors:${compiler.errors}');
+  print('testPatchNonClass.warnings:${compiler.warnings}');
+  Expect.equals(1, compiler.errors.length);
+  Expect.isTrue(
+      compiler.errors[0].message.kind == MessageKind.PATCH_NO_GETTER);
+  Expect.equals(0, compiler.warnings.length);
+  Expect.equals(1, compiler.infos.length);
+  Expect.isTrue(
+      compiler.infos[0].message.kind == MessageKind.PATCH_POINT_TO_GETTER);
 }
 
-testPatchNonSetter() {
-  asyncTest(() => applyPatch(
+Future testPatchNonSetter() async {
+  var compiler = await applyPatch(
       """
       external void foo() {}
       """,
       """
       @patch set foo(var value) {}
-      """).then((compiler) {
-    print('testPatchNonClass.errors:${compiler.errors}');
-    print('testPatchNonClass.warnings:${compiler.warnings}');
-    Expect.equals(1, compiler.errors.length);
-    Expect.isTrue(
-        compiler.errors[0].message.kind == MessageKind.PATCH_NON_SETTER);
-    Expect.equals(0, compiler.warnings.length);
-    Expect.equals(1, compiler.infos.length);
-    Expect.isTrue(
-        compiler.infos[0].message.kind == MessageKind.PATCH_POINT_TO_SETTER);
-  }));
+      """);
+  print('testPatchNonClass.errors:${compiler.errors}');
+  print('testPatchNonClass.warnings:${compiler.warnings}');
+  Expect.equals(1, compiler.errors.length);
+  Expect.isTrue(
+      compiler.errors[0].message.kind == MessageKind.PATCH_NON_SETTER);
+  Expect.equals(0, compiler.warnings.length);
+  Expect.equals(1, compiler.infos.length);
+  Expect.isTrue(
+      compiler.infos[0].message.kind == MessageKind.PATCH_POINT_TO_SETTER);
 }
 
-testPatchNoSetter() {
-  asyncTest(() => applyPatch(
+Future testPatchNoSetter() async {
+  var compiler = await applyPatch(
       """
       external get foo;
       """,
       """
       @patch set foo(var value) {}
-      """).then((compiler) {
-    print('testPatchNonClass.errors:${compiler.errors}');
-    print('testPatchNonClass.warnings:${compiler.warnings}');
-    Expect.equals(1, compiler.errors.length);
-    Expect.isTrue(
-        compiler.errors[0].message.kind == MessageKind.PATCH_NO_SETTER);
-    Expect.equals(0, compiler.warnings.length);
-    Expect.equals(1, compiler.infos.length);
-    Expect.isTrue(
-        compiler.infos[0].message.kind == MessageKind.PATCH_POINT_TO_SETTER);
-  }));
+      """);
+  print('testPatchNonClass.errors:${compiler.errors}');
+  print('testPatchNonClass.warnings:${compiler.warnings}');
+  Expect.equals(1, compiler.errors.length);
+  Expect.isTrue(
+      compiler.errors[0].message.kind == MessageKind.PATCH_NO_SETTER);
+  Expect.equals(0, compiler.warnings.length);
+  Expect.equals(1, compiler.infos.length);
+  Expect.isTrue(
+      compiler.infos[0].message.kind == MessageKind.PATCH_POINT_TO_SETTER);
 }
 
-testPatchNonFunction() {
-  asyncTest(() => applyPatch(
+Future testPatchNonFunction() async {
+  var compiler = await applyPatch(
       """
       external get foo;
       """,
       """
       @patch void foo() {}
-      """).then((compiler) {
-    print('testPatchNonClass.errors:${compiler.errors}');
-    print('testPatchNonClass.warnings:${compiler.warnings}');
-    Expect.equals(1, compiler.errors.length);
-    Expect.isTrue(
-        compiler.errors[0].message.kind == MessageKind.PATCH_NON_FUNCTION);
-    Expect.equals(0, compiler.warnings.length);
-    Expect.equals(1, compiler.infos.length);
-    Expect.isTrue(
-        compiler.infos[0].message.kind ==
-            MessageKind.PATCH_POINT_TO_FUNCTION);
-  }));
+      """);
+  print('testPatchNonClass.errors:${compiler.errors}');
+  print('testPatchNonClass.warnings:${compiler.warnings}');
+  Expect.equals(1, compiler.errors.length);
+  Expect.isTrue(
+      compiler.errors[0].message.kind == MessageKind.PATCH_NON_FUNCTION);
+  Expect.equals(0, compiler.warnings.length);
+  Expect.equals(1, compiler.infos.length);
+  Expect.isTrue(
+      compiler.infos[0].message.kind ==
+          MessageKind.PATCH_POINT_TO_FUNCTION);
 }
 
-testPatchAndSelector() {
-  asyncTest(() => applyPatch(
+Future testPatchAndSelector() async {
+  var compiler = await applyPatch(
       """
       class A {
         external void clear();
@@ -851,74 +861,73 @@
         new B();
       }
       """,
-      runCompiler: true, analyzeOnly: true).then((Compiler compiler) {
-    World world = compiler.world;
+      runCompiler: true, analyzeOnly: true);
+  World world = compiler.world;
 
-    ClassElement cls = ensure(compiler, "A", compiler.coreLibrary.find,
-                              expectIsPatched: true);
-    cls.ensureResolved(compiler);
+  ClassElement cls = ensure(compiler, "A", compiler.coreLibrary.find,
+                            expectIsPatched: true);
+  cls.ensureResolved(compiler.resolution);
 
-    ensure(compiler, "method", cls.patch.lookupLocalMember,
-           checkHasBody: true, expectIsRegular: true);
+  ensure(compiler, "method", cls.patch.lookupLocalMember,
+         checkHasBody: true, expectIsRegular: true);
 
-    ensure(compiler, "clear", cls.lookupLocalMember,
-           checkHasBody: true, expectIsPatched: true);
+  ensure(compiler, "clear", cls.lookupLocalMember,
+         checkHasBody: true, expectIsPatched: true);
 
-    compiler.phase = Compiler.PHASE_DONE_RESOLVING;
+  compiler.phase = Compiler.PHASE_DONE_RESOLVING;
 
-    // Check that a method just in the patch class is a target for a
-    // typed selector.
-    Selector selector = new Selector.call('method', compiler.coreLibrary, 0);
-    TypeMask typeMask = new TypeMask.exact(cls, world);
-    FunctionElement method = cls.implementation.lookupLocalMember('method');
-    method.computeType(compiler);
-    Expect.isTrue(selector.applies(method, world));
-    Expect.isTrue(typeMask.canHit(method, selector, world));
+  // Check that a method just in the patch class is a target for a
+  // typed selector.
+  Selector selector =
+      new Selector.call(const PublicName('method'), CallStructure.NO_ARGS);
+  TypeMask typeMask = new TypeMask.exact(cls, world);
+  FunctionElement method = cls.implementation.lookupLocalMember('method');
+  method.computeType(compiler.resolution);
+  Expect.isTrue(selector.applies(method, world));
+  Expect.isTrue(typeMask.canHit(method, selector, world));
 
-    // Check that the declaration method in the declaration class is a target
-    // for a typed selector.
-    selector = new Selector.call('clear', compiler.coreLibrary, 0);
-    typeMask = new TypeMask.exact(cls, world);
-    method = cls.lookupLocalMember('clear');
-    method.computeType(compiler);
-    Expect.isTrue(selector.applies(method, world));
-    Expect.isTrue(typeMask.canHit(method, selector, world));
+  // Check that the declaration method in the declaration class is a target
+  // for a typed selector.
+  selector =
+      new Selector.call(const PublicName('clear'), CallStructure.NO_ARGS);
+  typeMask = new TypeMask.exact(cls, world);
+  method = cls.lookupLocalMember('clear');
+  method.computeType(compiler.resolution);
+  Expect.isTrue(selector.applies(method, world));
+  Expect.isTrue(typeMask.canHit(method, selector, world));
 
-    // Check that the declaration method in the declaration class is a target
-    // for a typed selector on a subclass.
-    cls = ensure(compiler, "B", compiler.coreLibrary.find);
-    cls.ensureResolved(compiler);
-    typeMask = new TypeMask.exact(cls, world);
-    Expect.isTrue(selector.applies(method, world));
-    Expect.isTrue(typeMask.canHit(method, selector, world));
-  }));
+  // Check that the declaration method in the declaration class is a target
+  // for a typed selector on a subclass.
+  cls = ensure(compiler, "B", compiler.coreLibrary.find);
+  cls.ensureResolved(compiler.resolution);
+  typeMask = new TypeMask.exact(cls, world);
+  Expect.isTrue(selector.applies(method, world));
+  Expect.isTrue(typeMask.canHit(method, selector, world));
 }
 
-void testAnalyzeAllInjectedMembers() {
-  void expect(String patchText, [expectedWarnings]) {
+Future testAnalyzeAllInjectedMembers() async {
+  Future expect(String patchText, [expectedWarnings]) async {
     if (expectedWarnings == null) expectedWarnings = [];
     if (expectedWarnings is! List) {
       expectedWarnings = <MessageKind>[expectedWarnings];
     }
 
-    asyncTest(() => applyPatch('', patchText, analyzeAll: true,
-               analyzeOnly: true).then((compiler) {
+    var compiler = await applyPatch('', patchText, analyzeAll: true,
+               analyzeOnly: true);
       compiler.librariesToAnalyzeWhenRun = [Uri.parse('dart:core')];
-      return compiler.runCompiler(null).then((_) {
-        compareWarningKinds(patchText, expectedWarnings, compiler.warnings);
-      });
-    }));
+    await compiler.runCompiler(null);
+    compareWarningKinds(patchText, expectedWarnings, compiler.warnings);
   }
 
-  expect('String s = 0;', MessageKind.NOT_ASSIGNABLE);
-  expect('void method() { String s = 0; }', MessageKind.NOT_ASSIGNABLE);
-  expect('''
+  await expect('String s = 0;', MessageKind.NOT_ASSIGNABLE);
+  await expect('void method() { String s = 0; }', MessageKind.NOT_ASSIGNABLE);
+  await expect('''
          class Class {
            String s = 0;
          }
          ''',
          MessageKind.NOT_ASSIGNABLE);
-  expect('''
+  await expect('''
          class Class {
            void method() {
              String s = 0;
@@ -928,7 +937,7 @@
          MessageKind.NOT_ASSIGNABLE);
 }
 
-void testEffectiveTarget() {
+Future testEffectiveTarget() async {
   String origin = """
     class A {
       A() : super();
@@ -944,81 +953,83 @@
     """;
   String patch = """
     @patch class B {
+      @patch
       B.patchTarget() : super();
+      @patch
       factory B.reflectBack() = B.originTarget;
     }
     """;
 
-  asyncTest(() => applyPatch(origin, patch, analyzeAll: true,
-                 analyzeOnly: true, runCompiler: true).then((compiler) {
-    ClassElement clsA = compiler.coreLibrary.find("A");
-    ClassElement clsB = compiler.coreLibrary.find("B");
+  var compiler = await applyPatch(origin, patch, analyzeAll: true,
+                 analyzeOnly: true, runCompiler: true);
+  ClassElement clsA = compiler.coreLibrary.find("A");
+  ClassElement clsB = compiler.coreLibrary.find("B");
 
-    ConstructorElement forward = clsA.lookupConstructor("forward");
-    ConstructorElement target = forward.effectiveTarget;
-    Expect.isTrue(target.isPatch);
-    Expect.equals("patchTarget", target.name);
+  ConstructorElement forward = clsA.lookupConstructor("forward");
+  ConstructorElement target = forward.effectiveTarget;
+  Expect.isTrue(target.isPatch);
+  Expect.equals("patchTarget", target.name);
 
-    ConstructorElement forwardTwo = clsA.lookupConstructor("forwardTwo");
-    target = forwardTwo.effectiveTarget;
-    Expect.isFalse(forwardTwo.isErroneous);
-    Expect.isFalse(target.isPatch);
-    Expect.equals("originTarget", target.name);
-  }));
+  ConstructorElement forwardTwo = clsA.lookupConstructor("forwardTwo");
+  target = forwardTwo.effectiveTarget;
+  Expect.isFalse(forwardTwo.isErroneous);
+  Expect.isFalse(target.isPatch);
+  Expect.equals("originTarget", target.name);
 }
 
-void testTypecheckPatchedMembers() {
+Future testTypecheckPatchedMembers() async {
   String originText = "external void method();";
   String patchText = """
                      @patch void method() {
                        String s = 0;
                      }
                      """;
-  asyncTest(() => applyPatch(originText, patchText,
-             analyzeAll: true, analyzeOnly: true).then((compiler) {
-    compiler.librariesToAnalyzeWhenRun = [Uri.parse('dart:core')];
-    return compiler.runCompiler(null).then((_) {
-      compareWarningKinds(patchText,
-          [MessageKind.NOT_ASSIGNABLE], compiler.warnings);
-    });
-  }));
+  var compiler = await applyPatch(originText, patchText,
+             analyzeAll: true, analyzeOnly: true);
+  compiler.librariesToAnalyzeWhenRun = [Uri.parse('dart:core')];
+  await compiler.runCompiler(null);
+  compareWarningKinds(patchText,
+      [MessageKind.NOT_ASSIGNABLE], compiler.warnings);
 }
 
 main() {
-  testPatchConstructor();
-  testPatchRedirectingConstructor();
-  testPatchFunction();
-  testPatchMember();
-  testPatchGetter();
-  testRegularMember();
-  testGhostMember();
-  testInjectFunction();
-  testPatchSignatureCheck();
+  asyncTest(() async {
+    await testPatchConstructor();
+    await testPatchRedirectingConstructor();
+    await testPatchFunction();
+    await testPatchFunctionMetadata();
+    await testPatchMember();
+    await testPatchGetter();
+    await testRegularMember();
+    await testGhostMember();
+    await testInjectFunction();
+    await testPatchSignatureCheck();
 
-  testPatchVersioned();
+    await testPatchVersioned();
 
-  testExternalWithoutImplementationTopLevel();
-  testExternalWithoutImplementationMember();
+    await testExternalWithoutImplementationTopLevel();
+    await testExternalWithoutImplementationMember();
 
-  testIsSubclass();
+    await testIsSubclass();
 
-  testPatchNonExistingTopLevel();
-  testPatchNonExistingMember();
-  testPatchNonPatchablePatch();
-  testPatchNonPatchableOrigin();
-  testPatchNonExternalTopLevel();
-  testPatchNonExternalMember();
-  testPatchNonClass();
-  testPatchNonGetter();
-  testPatchNoGetter();
-  testPatchNonSetter();
-  testPatchNoSetter();
-  testPatchNonFunction();
+    await testPatchNonExistingTopLevel();
+    await testPatchNonExistingMember();
+    await testPatchNonPatchablePatch();
+    await testPatchNonPatchableOrigin();
+    await testPatchNonExternalTopLevel();
+    await testPatchNonExternalMember();
+    await testPatchNonClass();
+    await testPatchNonGetter();
+    await testPatchNoGetter();
+    await testPatchNonSetter();
+    await testPatchNoSetter();
+    await testPatchNonFunction();
 
-  testPatchAndSelector();
+    await testPatchAndSelector();
 
-  testEffectiveTarget(); /// bug: ok
+    await testEffectiveTarget();
 
-  testAnalyzeAllInjectedMembers();
-  testTypecheckPatchedMembers();
+    await testAnalyzeAllInjectedMembers();
+    await testTypecheckPatchedMembers();
+  });
 }
diff --git a/tests/compiler/dart2js/preserve_uris_test.dart b/tests/compiler/dart2js/preserve_uris_test.dart
index 70d1d5e..9d58894 100644
--- a/tests/compiler/dart2js/preserve_uris_test.dart
+++ b/tests/compiler/dart2js/preserve_uris_test.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:async';
-
 import 'package:expect/expect.dart';
 import 'package:async_helper/async_helper.dart';
 import 'memory_compiler.dart' show runCompiler, OutputCollector;
diff --git a/tests/compiler/dart2js/pretty_parameter_test.dart b/tests/compiler/dart2js/pretty_parameter_test.dart
index 723683b..3aa4db1 100644
--- a/tests/compiler/dart2js/pretty_parameter_test.dart
+++ b/tests/compiler/dart2js/pretty_parameter_test.dart
@@ -35,7 +35,7 @@
 """;
 
 const String NO_LOCAL = r"""
-foo(bar, bar) {
+foo(bar, baz) {
   if (bar) {
     baz = 2;
   } else {
diff --git a/tests/compiler/dart2js/private_test.dart b/tests/compiler/dart2js/private_test.dart
index 5121422..ed55d66 100644
--- a/tests/compiler/dart2js/private_test.dart
+++ b/tests/compiler/dart2js/private_test.dart
@@ -3,12 +3,12 @@
 // 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";
-import 'mock_compiler.dart';
 
+import 'package:async_helper/async_helper.dart';
+import 'package:compiler/src/diagnostics/messages.dart' show MessageKind;
 import 'package:compiler/src/io/source_file.dart';
-import 'package:compiler/src/dart2jslib.dart';
+
+import 'mock_compiler.dart';
 
 const String PRIVATE_SOURCE_URI = 'src:private';
 const String PRIVATE_SOURCE = '''
diff --git a/tests/compiler/dart2js/reexport_handled_test.dart b/tests/compiler/dart2js/reexport_handled_test.dart
index 4bdd62d..ade3373 100644
--- a/tests/compiler/dart2js/reexport_handled_test.dart
+++ b/tests/compiler/dart2js/reexport_handled_test.dart
@@ -32,24 +32,15 @@
     return compiler.libraryLoader.loadLibrary(exportingLibraryUri);
   }).then((exportingLibrary) {
     Expect.isTrue(exportingLibrary.exportsHandled);
-    var foo = findInExports(exportingLibrary, 'foo');
+    var foo = exportingLibrary.findExported('foo');
     Expect.isNotNull(foo);
     Expect.isTrue(foo.isField);
 
     // Load reexporting library when exports are handled on the exporting library.
     return compiler.libraryLoader.loadLibrary(reexportingLibraryUri);
   }).then((reexportingLibrary) {
-    var foo = findInExports(reexportingLibrary, 'foo');
+    var foo = reexportingLibrary.findExported('foo');
     Expect.isNotNull(foo);
     Expect.isTrue(foo.isField);
   }));
 }
-
-Element findInExports(LibraryElement library, String name) {
-  for (var export in library.exports) {
-    if (export.name == name) {
-      return export;
-    }
-  }
-  return null;
-}
diff --git a/tests/compiler/dart2js/related_types.dart b/tests/compiler/dart2js/related_types.dart
new file mode 100644
index 0000000..d4d26d2
--- /dev/null
+++ b/tests/compiler/dart2js/related_types.dart
@@ -0,0 +1,436 @@
+// 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 related_types;
+
+import 'package:compiler/src/commandline_options.dart';
+import 'package:compiler/src/compiler.dart';
+import 'package:compiler/src/core_types.dart';
+import 'package:compiler/src/dart_types.dart';
+import 'package:compiler/src/diagnostics/diagnostic_listener.dart';
+import 'package:compiler/src/diagnostics/messages.dart';
+import 'package:compiler/src/elements/elements.dart';
+import 'package:compiler/src/filenames.dart';
+import 'package:compiler/src/resolution/semantic_visitor.dart';
+import 'package:compiler/src/tree/tree.dart';
+import 'package:compiler/src/universe/call_structure.dart';
+import 'package:compiler/src/universe/selector.dart';
+import 'package:compiler/src/world.dart';
+import 'memory_compiler.dart';
+
+main(List<String> arguments) async {
+  if (arguments.isNotEmpty) {
+    Uri entryPoint = Uri.base.resolve(nativeToUriPath(arguments.last));
+    CompilationResult result = await runCompiler(
+        entryPoint: entryPoint,
+        options: [Flags.analyzeOnly, '--categories=Client,Server']);
+    if (result.isSuccess) {
+      checkRelatedTypes(result.compiler);
+    }
+  } else {
+    print('Usage dart related_types.dart <entry-point>');
+  }
+}
+
+/// Check all loaded libraries in [compiler] for unrelated types.
+void checkRelatedTypes(Compiler compiler) {
+  for (LibraryElement library in compiler.libraryLoader.libraries) {
+    checkLibraryElement(compiler, library);
+  }
+}
+
+/// Check [library] for unrelated types.
+void checkLibraryElement(Compiler compiler, LibraryElement library) {
+  library.forEachLocalMember((Element element) {
+    if (element.isClass) {
+      ClassElement cls = element;
+      cls.forEachLocalMember((MemberElement member) {
+        checkMemberElement(compiler, member);
+      });
+    } else if (!element.isTypedef) {
+      checkMemberElement(compiler, element);
+    }
+  });
+}
+
+/// Check [member] for unrelated types.
+void checkMemberElement(Compiler compiler, MemberElement member) {
+  if (!compiler.resolution.hasBeenResolved(member)) return;
+
+  ResolvedAst resolvedAst = member.resolvedAst;
+  RelatedTypesChecker relatedTypesChecker =
+      new RelatedTypesChecker(compiler, resolvedAst);
+  if (resolvedAst.node != null) {
+    compiler.reporter.withCurrentElement(member.implementation, () {
+      relatedTypesChecker.apply(resolvedAst.node);
+    });
+  }
+}
+
+class RelatedTypesChecker extends TraversalVisitor<DartType, dynamic> {
+  final Compiler compiler;
+  final ResolvedAst resolvedAst;
+
+  RelatedTypesChecker(this.compiler, ResolvedAst resolvedAst)
+      : this.resolvedAst = resolvedAst,
+        super(resolvedAst.elements);
+
+  ClassWorld get world => compiler.world;
+
+  CoreTypes get coreTypes => compiler.coreTypes;
+
+  DiagnosticReporter get reporter => compiler.reporter;
+
+  InterfaceType get thisType => resolvedAst.element.enclosingClass.thisType;
+
+  /// Returns `true` if there exists no common subtype of [left] and [right].
+  bool hasEmptyIntersection(DartType left, DartType right) {
+    if (left == right) return false;
+    if (left == null || right == null) return false;
+    ClassElement leftClass = const ClassFinder().findClass(left);
+    ClassElement rightClass = const ClassFinder().findClass(right);
+    if (leftClass != null && rightClass != null) {
+      return !world.haveAnyCommonSubtypes(leftClass, rightClass);
+    }
+    return false;
+  }
+
+  /// Checks that there exists a common subtype of [left] and [right] or report
+  /// a hint otherwise.
+  void checkRelated(Node node, DartType left, DartType right) {
+    if (hasEmptyIntersection(left, right)) {
+      reporter.reportHintMessage(
+          node,
+          MessageKind.NO_COMMON_SUBTYPES,
+          {'left': left, 'right': right});
+    }
+  }
+
+  /// Check weakly typed collection methods, like `Map.containsKey`,
+  /// `Map.containsValue` and `Iterable.contains`.
+  void checkDynamicInvoke(
+      Node node,
+      DartType receiverType,
+      List<DartType> argumentTypes,
+      Selector selector) {
+    if (selector.name == 'containsKey' &&
+        selector.callStructure == CallStructure.ONE_ARG) {
+      InterfaceType mapType = findMapType(receiverType);
+      if (mapType != null) {
+        DartType keyType = findMapKeyType(mapType);
+        checkRelated(node, keyType, argumentTypes.first);
+      }
+    } else if (selector.name == 'containsValue' &&
+               selector.callStructure == CallStructure.ONE_ARG) {
+      InterfaceType mapType = findMapType(receiverType);
+      if (mapType != null) {
+        DartType valueType = findMapValueType(mapType);
+        checkRelated(node, valueType, argumentTypes.first);
+      }
+    } else if (selector.name == 'contains' &&
+               selector.callStructure == CallStructure.ONE_ARG) {
+      InterfaceType iterableType = findIterableType(receiverType);
+      if (iterableType != null) {
+        DartType elementType = findIterableElementType(iterableType);
+        checkRelated(node, elementType, argumentTypes.first);
+      }
+    } else if (selector.name == 'remove' &&
+               selector.callStructure == CallStructure.ONE_ARG) {
+      InterfaceType mapType = findMapType(receiverType);
+      if (mapType != null) {
+        DartType keyType = findMapKeyType(mapType);
+        checkRelated(node, keyType, argumentTypes.first);
+      }
+      InterfaceType listType = findListType(receiverType);
+      if (listType != null) {
+        DartType valueType = findListElementType(listType);
+        checkRelated(node, valueType, argumentTypes.first);
+      }
+    }
+  }
+
+  /// Return the interface type implemented by [type] or `null` if no interface
+  /// type is implied by [type].
+  InterfaceType findInterfaceType(DartType type) {
+    return Types.computeInterfaceType(compiler.resolution, type);
+  }
+
+  /// Returns the supertype of [receiver] that implements [cls], if any.
+  InterfaceType findClassType(DartType receiver, ClassElement cls) {
+    InterfaceType interfaceType = findInterfaceType(receiver);
+    if (interfaceType == null) return null;
+    InterfaceType mapType = interfaceType.asInstanceOf(cls);
+    if (mapType == null) return null;
+    return mapType;
+  }
+
+  /// Returns the supertype of [receiver] that implements `Iterable`, if any.
+  InterfaceType findIterableType(DartType receiver) {
+    return findClassType(receiver, compiler.iterableClass);
+  }
+
+  /// Returns the element type of the supertype of [receiver] that implements
+  /// `Iterable`, if any.
+  DartType findIterableElementType(InterfaceType iterableType) {
+    if (iterableType == null) return null;
+    return iterableType.typeArguments[0];
+  }
+
+  /// Returns the supertype of [receiver] that implements `Map`, if any.
+  InterfaceType findMapType(DartType receiver) {
+    return findClassType(receiver, compiler.mapClass);
+  }
+
+  /// Returns the key type of the supertype of [receiver] that implements
+  /// `Map`, if any.
+  DartType findMapKeyType(InterfaceType mapType) {
+    if (mapType == null) return null;
+    return mapType.typeArguments[0];
+  }
+
+  /// Returns the value type of the supertype of [receiver] that implements
+  /// `Map`, if any.
+  DartType findMapValueType(InterfaceType mapType) {
+    if (mapType == null) return null;
+    return mapType.typeArguments[1];
+  }
+
+  /// Returns the supertype of [receiver] that implements `List`, if any.
+  InterfaceType findListType(DartType receiver) {
+    return findClassType(receiver, compiler.listClass);
+  }
+
+  /// Returns the element type of the supertype of [receiver] that implements
+  /// `List`, if any.
+  DartType findListElementType(InterfaceType listType) {
+    if (listType == null) return null;
+    return listType.typeArguments[0];
+  }
+
+  /// Returns the implied return type of [type] or `dynamic` if no return type
+  /// is implied.
+  DartType findReturnType(DartType type) {
+    if (type is FunctionType) {
+      return type.returnType;
+    }
+    return const DynamicType();
+  }
+
+  /// Visits [arguments] and returns the list of their corresponding types.
+  List<DartType> findArgumentTypes(NodeList arguments) {
+    List<DartType> argumentTypes = <DartType>[];
+    for (Node argument in arguments) {
+      argumentTypes.add(apply(argument));
+    }
+    return argumentTypes;
+  }
+
+  /// Finds the [MemberSignature] of the [name] property on [type], if any.
+  MemberSignature lookupInterfaceMember(DartType type, Name name) {
+    InterfaceType interfaceType = findInterfaceType(type);
+    if (interfaceType == null) return null;
+    return interfaceType.lookupInterfaceMember(name);
+  }
+
+  /// Returns the type of an access of the [name] property on [type], or
+  /// `dynamic` if no property was found.
+  DartType lookupInterfaceMemberAccessType(DartType type, Name name) {
+    MemberSignature member = lookupInterfaceMember(type, name);
+    if (member == null) return const DynamicType();
+    return member.type;
+  }
+
+  /// Returns the function type of the [name] property on [type], or
+  /// `dynamic` if no property was found.
+  FunctionType lookupInterfaceMemberInvocationType(DartType type, Name name) {
+    MemberSignature member = lookupInterfaceMember(type, name);
+    if (member == null) return null;
+    return member.functionType;
+  }
+
+  DartType apply(Node node, [_]) {
+    DartType type = node.accept(this);
+    if (type == null) {
+      type = const DynamicType();
+    }
+    return type;
+  }
+
+  @override
+  DartType visitEquals(Send node, Node left, Node right, _) {
+    DartType leftType = apply(left);
+    DartType rightType = apply(right);
+    checkRelated(node, leftType, rightType);
+    return coreTypes.boolType;
+  }
+
+  @override
+  DartType visitNotEquals(Send node, Node left, Node right, _) {
+    DartType leftType = apply(left);
+    DartType rightType = apply(right);
+    checkRelated(node, leftType, rightType);
+    return coreTypes.boolType;
+  }
+
+  @override
+  DartType visitIndex(Send node, Node receiver, Node index, _) {
+    DartType receiverType = apply(receiver);
+    DartType indexType = apply(index);
+    InterfaceType mapType = findMapType(receiverType);
+    DartType keyType = findMapKeyType(mapType);
+    DartType valueType = findMapValueType(mapType);
+    checkRelated(index, keyType, indexType);
+    return valueType;
+  }
+
+  @override
+  DartType visitLiteralInt(LiteralInt node) {
+    return coreTypes.intType;
+  }
+
+  @override
+  DartType visitLiteralString(LiteralString node) {
+    return coreTypes.stringType;
+  }
+
+  @override
+  DartType visitLiteralBool(LiteralBool node) {
+    return coreTypes.boolType;
+  }
+
+  @override
+  DartType visitLiteralMap(LiteralMap node) {
+    return elements.getType(node);
+  }
+
+  @override
+  DartType visitLiteralList(LiteralList node) {
+    return elements.getType(node);
+  }
+
+  @override
+  DartType visitLiteralNull(LiteralNull node) {
+    return elements.getType(node);
+  }
+
+  @override
+  DartType visitLocalVariableGet(Send node, LocalVariableElement variable, _) {
+    return variable.type;
+  }
+
+  @override
+  DartType visitLocalFunctionGet(Send node, LocalFunctionElement function, _) {
+    return function.type;
+  }
+
+  @override
+  DartType visitParameterGet(Send node, ParameterElement parameter, _) {
+    return parameter.type;
+  }
+
+  @override
+  DartType visitThisPropertyGet(Send node, Name name, _) {
+    return lookupInterfaceMemberAccessType(thisType, name);
+  }
+
+  @override
+  DartType visitDynamicPropertyGet(Send node, Node receiver, Name name, _) {
+    DartType receiverType = apply(receiver);
+    return lookupInterfaceMemberAccessType(receiverType, name);
+  }
+
+  @override
+  DartType visitIfNotNullDynamicPropertyGet(
+      Send node, Node receiver, Name name, _) {
+    DartType receiverType = apply(receiver);
+    return lookupInterfaceMemberAccessType(receiverType, name);
+  }
+
+  @override
+  DartType visitStaticFieldGet(Send node, FieldElement field, _) {
+    return field.type;
+  }
+
+  @override
+  DartType visitTopLevelFieldGet(Send node, FieldElement field, _) {
+    return field.type;
+  }
+
+  @override
+  DartType visitDynamicPropertyInvoke(
+      Send node,
+      Node receiver,
+      NodeList arguments,
+      Selector selector, _) {
+    DartType receiverType = apply(receiver);
+    List<DartType> argumentTypes = findArgumentTypes(arguments);
+    FunctionType methodType = lookupInterfaceMemberInvocationType(
+        receiverType, selector.memberName);
+    checkDynamicInvoke(node, receiverType, argumentTypes, selector);
+    return findReturnType(methodType);
+  }
+
+  @override
+  DartType visitThisPropertyInvoke(
+      Send node,
+      NodeList arguments,
+      Selector selector, _) {
+    DartType receiverType = thisType;
+    List<DartType> argumentTypes = findArgumentTypes(arguments);
+    FunctionType methodType = lookupInterfaceMemberInvocationType(
+        receiverType, selector.memberName);
+    checkDynamicInvoke(node, receiverType, argumentTypes, selector);
+    return findReturnType(methodType);
+  }
+
+  @override
+  DartType visitIfNotNullDynamicPropertyInvoke(
+      Send node,
+      Node receiver,
+      NodeList arguments,
+      Selector selector, _) {
+    DartType receiverType = apply(receiver);
+    List<DartType> argumentTypes = findArgumentTypes(arguments);
+    FunctionType methodType = lookupInterfaceMemberInvocationType(
+        receiverType, selector.memberName);
+    checkDynamicInvoke(node, receiverType, argumentTypes, selector);
+    return findReturnType(methodType);
+  }
+
+  @override
+  DartType visitTopLevelFunctionInvoke(
+      Send node,
+      MethodElement function,
+      NodeList arguments,
+      CallStructure callStructure, _) {
+    apply(arguments);
+    return findReturnType(function.type);
+  }
+
+  @override
+  DartType visitStaticFunctionInvoke(
+      Send node,
+      MethodElement function,
+      NodeList arguments,
+      CallStructure callStructure, _) {
+    apply(arguments);
+    return findReturnType(function.type);
+  }
+}
+
+/// Computes the [ClassElement] implied by a type.
+// TODO(johnniwinther): Handle type variables, function types and typedefs.
+class ClassFinder extends BaseDartTypeVisitor<ClassElement, dynamic> {
+  const ClassFinder();
+
+  ClassElement findClass(DartType type) => type.accept(this, null);
+
+  @override
+  ClassElement visitType(DartType type, _) => null;
+
+  @override
+  ClassElement visitInterfaceType(InterfaceType type, _) {
+    return type.element;
+  }
+}
\ No newline at end of file
diff --git a/tests/compiler/dart2js/related_types_test.dart b/tests/compiler/dart2js/related_types_test.dart
new file mode 100644
index 0000000..dfb50b4
--- /dev/null
+++ b/tests/compiler/dart2js/related_types_test.dart
@@ -0,0 +1,294 @@
+// 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 related_types;
+
+import 'package:async_helper/async_helper.dart';
+import 'package:expect/expect.dart';
+import 'package:compiler/src/commandline_options.dart';
+import 'package:compiler/src/compiler.dart';
+import 'package:compiler/src/diagnostics/messages.dart';
+import 'package:compiler/src/elements/elements.dart';
+import 'memory_compiler.dart';
+
+import 'related_types.dart';
+
+const String CODE = '''
+Map<String, int> topLevelMap;
+List<String> topLevelList;
+
+Map<String, int> getTopLevelMap() => null;
+List<String> getTopLevelList() => null;
+
+class Class {
+  Map<String, int> instanceMap;
+  List<String> instanceList;
+
+  Map<String, int> getInstanceMap() => null;
+  List<String> getInstanceList() => null;
+
+  static Map<String, int> staticMap;
+  static List<String> staticList;
+
+  static Map<String, int> getStaticMap() => null;
+  static List<String> getStaticList() => null;
+  
+  test_instanceMapIndex() {
+    instanceMap[0];
+  }
+  test_instanceMapContainsKey() {
+    instanceMap.containsKey(0);
+  }
+  test_instanceMapContainsValue() {
+    instanceMap.containsValue('');
+  }
+  test_instanceMapRemove() {
+    instanceMap.remove(0);
+  }
+  test_instanceListContains() {
+    instanceList.contains(0);
+  }
+  test_instanceListRemove() {
+    instanceList.remove(0);
+  }
+  
+  test_getInstanceMapIndex() {
+    getInstanceMap()[0];
+  }
+  test_getInstanceMapContainsKey() {
+    getInstanceMap().containsKey(0);
+  }
+  test_getInstanceMapContainsValue() {
+    getInstanceMap().containsValue('');
+  }
+  test_getInstanceMapRemove() {
+    getInstanceMap().remove(0);
+  }
+  test_getInstanceListContains() {
+    getInstanceList().contains(0);
+  }
+  test_getInstanceListRemove() {
+    getInstanceList().remove(0);
+  }
+  
+  static test_staticMapIndex() {
+    staticMap[0];
+  }
+  static test_staticMapContainsKey() {
+    staticMap.containsKey(0);
+  }
+  static test_staticMapContainsValue() {
+    staticMap.containsValue('');
+  }
+  static test_staticMapRemove() {
+    staticMap.remove(0);
+  }
+  static test_staticListContains() {
+    staticList.contains(0);
+  }
+  static test_staticListRemove() {
+    staticList.remove(0);
+  }
+  
+  static test_getStaticMapIndex() {
+    getStaticMap()[0];
+  }
+  static test_getStaticMapContainsKey() {
+    getStaticMap().containsKey(0);
+  }
+  static test_getStaticMapContainsValue() {
+    getStaticMap().containsValue('');
+  }
+  static test_getStaticMapRemove() {
+    getStaticMap().remove(0);
+  }
+  static test_getStaticListContains() {
+    getStaticList().contains(0);
+  }
+  static test_getStaticListRemove() {
+    getStaticList().remove(0);
+  }
+}
+
+main() {}
+
+test_equals() => 0 == '';
+test_notEquals() => 0 != '';
+test_index() => <String, int>{}[0];
+
+test_localMapIndex() {
+  Map<String, int> map;
+  map[0];
+}
+test_localMapContainsKey() {
+  Map<String, int> map;
+  map.containsKey(0);
+}
+test_localMapContainsValue() {
+  Map<String, int> map;
+  map.containsValue('');
+}
+test_localMapRemove() {
+  Map<String, int> map;
+  map.remove(0);
+}
+test_localListContains() {
+  List<String> list;
+  list.contains(0);
+}
+test_localListRemove() {
+  List<String> list;
+  list.remove(0);
+}
+
+test_topLevelMapIndex() {
+  topLevelMap[0];
+}
+test_topLevelMapContainsKey() {
+  topLevelMap.containsKey(0);
+}
+test_topLevelMapContainsValue() {
+  topLevelMap.containsValue('');
+}
+test_topLevelMapRemove() {
+  topLevelMap.remove(0);
+}
+test_topLevelListContains() {
+  topLevelList.contains(0);
+}
+test_topLevelListRemove() {
+  topLevelList.remove(0);
+}
+
+test_getTopLevelMapIndex() {
+  getTopLevelMap()[0];
+}
+test_getTopLevelMapContainsKey() {
+  getTopLevelMap().containsKey(0);
+}
+test_getTopLevelMapContainsValue() {
+  getTopLevelMap().containsValue('');
+}
+test_getTopLevelMapRemove() {
+  getTopLevelMap().remove(0);
+}
+test_getTopLevelListContains() {
+  getTopLevelList().contains(0);
+}
+test_getTopLevelListRemove() {
+  getTopLevelList().remove(0);
+}
+
+test_staticMapIndex() {
+  Class.staticMap[0];
+}
+test_staticMapContainsKey() {
+  Class.staticMap.containsKey(0);
+}
+test_staticMapContainsValue() {
+  Class.staticMap.containsValue('');
+}
+test_staticMapRemove() {
+  Class.staticMap.remove(0);
+}
+test_staticListContains() {
+  Class.staticList.contains(0);
+}
+test_staticListRemove() {
+  Class.staticList.remove(0);
+}
+
+test_getStaticMapIndex() {
+  Class.getStaticMap()[0];
+}
+test_getStaticMapContainsKey() {
+  Class.getStaticMap().containsKey(0);
+}
+test_getStaticMapContainsValue() {
+  Class.getStaticMap().containsValue('');
+}
+test_getStaticMapRemove() {
+  Class.getStaticMap().remove(0);
+}
+test_getStaticListContains() {
+  Class.getStaticList().contains(0);
+}
+test_getStaticListRemove() {
+  Class.getStaticList().remove(0);
+}
+  
+test_instanceMapIndex(Class c) {
+  c.instanceMap[0];
+}
+test_instanceMapContainsKey(Class c) {
+  c.instanceMap.containsKey(0);
+}
+test_instanceMapContainsValue(Class c) {
+  c.instanceMap.containsValue('');
+}
+test_instanceMapRemove(Class c) {
+  c.instanceMap.remove(0);
+}
+test_instanceListContains(Class c) {
+  c.instanceList.contains(0);
+}
+test_instanceListRemove(Class c) {
+  c.instanceList.remove(0);
+}
+
+test_getInstanceMapIndex(Class c) {
+  c.getInstanceMap()[0];
+}
+test_getInstanceMapContainsKey(Class c) {
+  c.getInstanceMap().containsKey(0);
+}
+test_getInstanceMapContainsValue(Class c) {
+  c.getInstanceMap().containsValue('');
+}
+test_getInstanceMapRemove(Class c) {
+  c.getInstanceMap().remove(0);
+}
+test_getInstanceListContains(Class c) {
+  c.getInstanceList().contains(0);
+}
+test_getInstanceListRemove(Class c) {
+  c.getInstanceList().remove(0);
+}
+''';
+
+main(List<String> arguments) {
+  asyncTest(() async {
+    DiagnosticCollector collector = new DiagnosticCollector();
+    CompilationResult result = await runCompiler(
+        memorySourceFiles: {'main.dart': CODE},
+        options: [Flags.analyzeOnly, Flags.analyzeMain],
+        diagnosticHandler: collector);
+    Expect.isFalse(collector.hasRegularMessages, "Unexpected analysis messages.");
+    Compiler compiler = result.compiler;
+
+
+    void checkMember(MemberElement member) {
+      if (!member.name.startsWith('test_')) return;
+
+      collector.clear();
+      checkMemberElement(compiler, member);
+      Expect.equals(1, collector.hints.length,
+          "Unexpected hint count for $member.");
+      Expect.equals(
+          MessageKind.NO_COMMON_SUBTYPES,
+          collector.hints.first.message.kind,
+          "Unexpected message kind ${collector.hints.first.message.kind} "
+          "for $member.");
+    }
+
+    compiler.mainApp.forEachLocalMember((Element element) {
+      if (element.isClass) {
+        ClassElement cls = element;
+        cls.forEachLocalMember(checkMember);
+      } else {
+        checkMember(element);
+      }
+    });
+  });
+}
diff --git a/tests/compiler/dart2js/resolution_test.dart b/tests/compiler/dart2js/resolution_test.dart
index 2305eb8..639755a 100644
--- a/tests/compiler/dart2js/resolution_test.dart
+++ b/tests/compiler/dart2js/resolution_test.dart
@@ -5,11 +5,10 @@
 // Test that resolution does not resolve things we know will not be
 // needed by the backend.
 
+import 'package:async_helper/async_helper.dart';
 import 'package:expect/expect.dart';
-import "package:async_helper/async_helper.dart";
-import 'compiler_helper.dart';
-import 'parser_helper.dart';
 import 'package:compiler/src/apiimpl.dart';
+import 'compiler_helper.dart';
 
 const String NO_RUNTIME_TYPE = r"""
 import 'dart:core' as prefix;
diff --git a/tests/compiler/dart2js/resolver_test.dart b/tests/compiler/dart2js/resolver_test.dart
index 35c2ded..236b0bd 100644
--- a/tests/compiler/dart2js/resolver_test.dart
+++ b/tests/compiler/dart2js/resolver_test.dart
@@ -10,7 +10,12 @@
 import 'package:compiler/src/constants/expressions.dart';
 import 'package:compiler/src/dart_types.dart';
 import 'package:compiler/src/elements/modelx.dart';
-import 'package:compiler/src/resolution/resolution.dart';
+import 'package:compiler/src/resolution/constructors.dart';
+import 'package:compiler/src/resolution/members.dart';
+import 'package:compiler/src/resolution/registry.dart';
+import 'package:compiler/src/resolution/resolution_result.dart';
+import 'package:compiler/src/resolution/scope.dart';
+import 'package:compiler/src/resolution/tree_elements.dart';
 
 import 'compiler_helper.dart';
 import 'link_helper.dart';
@@ -188,9 +193,9 @@
                            '  bar() { g(Foo<T> f) {}; g(); }'
                            '}');
       ClassElement foo = compiler.mainApp.find('Foo');
-      foo.ensureResolved(compiler);
-      foo.lookupLocalMember('t').computeType(compiler);;
-      foo.lookupLocalMember('foo').computeType(compiler);;
+      foo.ensureResolved(compiler.resolution);
+      foo.lookupLocalMember('t').computeType(compiler.resolution);
+      foo.lookupLocalMember('foo').computeType(compiler.resolution);
       compiler.resolver.resolve(foo.lookupLocalMember('bar'));
       Expect.equals(0, compiler.warnings.length);
       Expect.equals(0, compiler.errors.length);
@@ -212,9 +217,10 @@
 
     ResolverVisitor visitor =
         new ResolverVisitor(compiler, fooB,
-            new ResolutionRegistry.internal(compiler,
+            new ResolutionRegistry(compiler,
                 new CollectingTreeElements(fooB)));
-    FunctionExpression node = (fooB as FunctionElementX).parseNode(compiler);
+    FunctionExpression node =
+        (fooB as FunctionElementX).parseNode(compiler.parsing);
     visitor.visit(node.body);
     Map mapping = map(visitor);
 
@@ -254,10 +260,10 @@
       FunctionElement funElement = fooElement.lookupLocalMember("foo");
       ResolverVisitor visitor =
           new ResolverVisitor(compiler, funElement,
-              new ResolutionRegistry.internal(compiler,
+              new ResolutionRegistry(compiler,
                   new CollectingTreeElements(funElement)));
       FunctionExpression function =
-          (funElement as FunctionElementX).parseNode(compiler);
+          (funElement as FunctionElementX).parseNode(compiler.parsing);
       visitor.visit(function.body);
       Map mapping = map(visitor);
       List<Element> values = mapping.values.toList();
@@ -277,10 +283,10 @@
       ClassElement fooElement = compiler.mainApp.find("Foo");
       FunctionElement funElement = fooElement.lookupLocalMember("foo");
       ResolverVisitor visitor = new ResolverVisitor(compiler, funElement,
-          new ResolutionRegistry.internal(compiler,
+          new ResolutionRegistry(compiler,
               new CollectingTreeElements(funElement)));
       FunctionExpression function =
-          (funElement as FunctionElementX).parseNode(compiler);
+          (funElement as FunctionElementX).parseNode(compiler.parsing);
       visitor.visit(function.body);
       Expect.equals(0, compiler.warnings.length);
       Expect.equals(1, compiler.errors.length);
@@ -421,7 +427,7 @@
 
     MethodScope scope = visitor.scope;
     Expect.equals(0, scope.elements.length);
-    Expect.equals(7, map(visitor).length);
+    Expect.equals(5, map(visitor).length);
 
     VariableDefinitions initializer = tree.initializer;
     Node iNode = initializer.definitions.nodes.head;
@@ -442,24 +448,16 @@
     checkSend(iElement, nodes[1], elements[1]);
 
     // for (int i = 0; i < 10; i = i + 1) { i = 5; };
-    //                         ^
-    checkIdentifier(iElement, nodes[2], elements[2]);
-
-    // for (int i = 0; i < 10; i = i + 1) { i = 5; };
     //                             ^
-    checkSend(iElement, nodes[3], elements[3]);
+    checkSend(iElement, nodes[2], elements[2]);
 
     // for (int i = 0; i < 10; i = i + 1) { i = 5; };
     //                         ^^^^^^^^^
-    checkSendSet(iElement, nodes[4], elements[4]);
-
-    // for (int i = 0; i < 10; i = i + 1) { i = 5; };
-    //                                      ^
-    checkIdentifier(iElement, nodes[5], elements[5]);
+    checkSendSet(iElement, nodes[3], elements[3]);
 
     // for (int i = 0; i < 10; i = i + 1) { i = 5; };
     //                                      ^^^^^
-    checkSendSet(iElement, nodes[6], elements[6]);
+    checkSendSet(iElement, nodes[4], elements[4]);
   });
 }
 
@@ -533,7 +531,7 @@
 
       ClassElement fooElement = compiler.mainApp.find('Foo');
       ClassElement barElement = compiler.mainApp.find('Bar');
-      Expect.equals(barElement.computeType(compiler),
+      Expect.equals(barElement.computeType(compiler.resolution),
                     fooElement.supertype);
       Expect.isTrue(fooElement.interfaces.isEmpty);
       Expect.isTrue(barElement.interfaces.isEmpty);
@@ -573,7 +571,7 @@
 
     ResolverVisitor visitor =
         new ResolverVisitor(compiler, null,
-            new ResolutionRegistry.internal(compiler,
+            new ResolutionRegistry(compiler,
                 new CollectingTreeElements(null)));
     compiler.resolveStatement("Foo bar;");
 
@@ -583,7 +581,7 @@
     Expect.equals(null, barElement.supertype);
     Expect.isTrue(barElement.interfaces.isEmpty);
 
-    Expect.equals(barElement.computeType(compiler),
+    Expect.equals(barElement.computeType(compiler.resolution),
                   fooElement.interfaces.head);
     Expect.equals(1, length(fooElement.interfaces));
   });
@@ -598,12 +596,12 @@
     compiler.resolveStatement("Foo bar;");
 
     ClassElement c = compiler.mainApp.find('C');
-    Element i1 = compiler.mainApp.find('I1');
-    Element i2 = compiler.mainApp.find('I2');
+    ClassElement i1 = compiler.mainApp.find('I1');
+    ClassElement i2 = compiler.mainApp.find('I2');
 
     Expect.equals(2, length(c.interfaces));
-    Expect.equals(i1.computeType(compiler), at(c.interfaces, 0));
-    Expect.equals(i2.computeType(compiler), at(c.interfaces, 1));
+    Expect.equals(i1.computeType(compiler.resolution), at(c.interfaces, 0));
+    Expect.equals(i2.computeType(compiler.resolution), at(c.interfaces, 1));
   });
 }
 
@@ -654,7 +652,8 @@
     compiler.parseScript("int a;");
     VariableElementX element = compiler.mainApp.find("a");
     Expect.equals(ElementKind.FIELD, element.kind);
-    VariableDefinitions node = element.variables.parseNode(element, compiler);
+    VariableDefinitions node =
+        element.variables.parseNode(element, compiler.parsing);
     Identifier typeName = node.type.typeName;
     Expect.equals(typeName.source, 'int');
 
@@ -665,8 +664,10 @@
     Expect.equals(ElementKind.FIELD, cElement.kind);
     Expect.isTrue(bElement != cElement);
 
-    VariableDefinitions bNode = bElement.variables.parseNode(bElement, compiler);
-    VariableDefinitions cNode = cElement.variables.parseNode(cElement, compiler);
+    VariableDefinitions bNode =
+        bElement.variables.parseNode(bElement, compiler.parsing);
+    VariableDefinitions cNode =
+        cElement.variables.parseNode(cElement, compiler.parsing);
     Expect.equals(bNode, cNode);
     Expect.isNull(bNode.type);
     Expect.isTrue(bNode.modifiers.isVar);
@@ -690,7 +691,7 @@
     FunctionExpression tree = (element as FunctionElement).node;
     ResolverVisitor visitor =
         new ResolverVisitor(compiler, element,
-            new ResolutionRegistry.internal(compiler,
+            new ResolutionRegistry(compiler,
                 new CollectingTreeElements(element)));
     new InitializerResolver(visitor, element, tree).resolveInitializers();
     visitor.visit(tree.body);
@@ -1082,7 +1083,7 @@
   Element memberElement = cls.lookupLocalMember(memberName);
   Expect.isNotNull(memberElement);
   Expect.isTrue(
-      compiler.enqueuer.resolution.hasBeenResolved(memberElement));
+      compiler.enqueuer.resolution.hasBeenProcessed(memberElement));
 }
 
 testToString() {
@@ -1222,7 +1223,9 @@
   checkWarningOn('''
       m() {}
       main() { m = 4; }
-      ''', [MessageKind.ASSIGNING_METHOD]);
+      ''', [MessageKind.ASSIGNING_METHOD,
+            // TODO(johnniwinther): Avoid duplicate warnings.
+            MessageKind.NOT_ASSIGNABLE]);
 
   // Can't override instance methods
   checkWarningOn('''
@@ -1255,7 +1258,9 @@
           super.mname = () => 6;
         }
       }
-      ''', [MessageKind.ASSIGNING_METHOD_IN_SUPER]);
+      ''', [MessageKind.ASSIGNING_METHOD_IN_SUPER,
+            // TODO(johnniwinther): Avoid duplicate warnings.
+            MessageKind.SETTER_NOT_FOUND]);
 
   // But index operators should be OK
   checkWarningOn('''
@@ -1331,7 +1336,9 @@
       class B extends A {
         m() { super.x = 2; }
       }
-      ''', [MessageKind.SETTER_NOT_FOUND_IN_SUPER]);
+      ''', [MessageKind.ASSIGNING_FINAL_FIELD_IN_SUPER,
+            // TODO(johnniwinther): Avoid duplicate warnings.
+            MessageKind.SETTER_NOT_FOUND]);
 
   // But non-final fields are OK:
   checkWarningOn('''
@@ -1343,14 +1350,30 @@
         m() { super.x = 2; }
       }
       ''', []);
+
+  // Check getter without setter.
+  checkWarningOn('''
+      main() => new B().m();
+      class A {
+        get x => 1;
+      }
+      class B extends A {
+        m() { super.x = 2; }
+      }
+      ''', [MessageKind.SETTER_NOT_FOUND_IN_SUPER,
+            // TODO(johnniwinther): Avoid duplicate warnings.
+            MessageKind.SETTER_NOT_FOUND]);
 }
 
 /// Helper to test that [script] produces all the given [warnings].
 checkWarningOn(String script, List<MessageKind> warnings) {
   Expect.isTrue(warnings.length >= 0 && warnings.length <= 2);
   asyncTest(() => compileScript(script).then((compiler) {
-    Expect.equals(0, compiler.errors.length);
-    Expect.equals(warnings.length, compiler.warnings.length);
+    Expect.equals(0, compiler.errors.length,
+        'Unexpected errors in\n$script\n${compiler.errors}');
+    Expect.equals(warnings.length, compiler.warnings.length,
+        'Unexpected warnings in\n$script\n'
+        'Expected:$warnings\nFound:${compiler.warnings}');
     for (int i = 0; i < warnings.length; i++) {
       Expect.equals(warnings[i], compiler.warnings[i].message.kind);
     }
diff --git a/tests/compiler/dart2js/scanner_offset_length_test.dart b/tests/compiler/dart2js/scanner_offset_length_test.dart
index 4c428dd..3eb5bb5 100644
--- a/tests/compiler/dart2js/scanner_offset_length_test.dart
+++ b/tests/compiler/dart2js/scanner_offset_length_test.dart
@@ -3,7 +3,9 @@
 // BSD-style license that can be found in the LICENSE file.
 
 import "package:expect/expect.dart";
-import 'package:compiler/src/scanner/scannerlib.dart';
+import 'package:compiler/src/scanner/string_scanner.dart';
+import 'package:compiler/src/tokens/token.dart';
+import 'package:compiler/src/tokens/token_constants.dart';
 
 Token scan(String text) =>
     new StringScanner.fromString(text, includeComments: true).tokenize();
diff --git a/tests/compiler/dart2js/scanner_test.dart b/tests/compiler/dart2js/scanner_test.dart
index e3a82fb..453ba42 100644
--- a/tests/compiler/dart2js/scanner_test.dart
+++ b/tests/compiler/dart2js/scanner_test.dart
@@ -3,7 +3,9 @@
 // BSD-style license that can be found in the LICENSE file.
 
 import "package:expect/expect.dart";
-import 'package:compiler/src/scanner/scannerlib.dart';
+import 'package:compiler/src/scanner/utf8_bytes_scanner.dart';
+import 'package:compiler/src/tokens/precedence_constants.dart';
+import 'package:compiler/src/tokens/token.dart';
 import 'package:compiler/src/util/characters.dart';
 import 'dart:typed_data';
 
diff --git a/tests/compiler/dart2js/semantic_visitor_test.dart b/tests/compiler/dart2js/semantic_visitor_test.dart
index 10833d3..f8ea57f 100644
--- a/tests/compiler/dart2js/semantic_visitor_test.dart
+++ b/tests/compiler/dart2js/semantic_visitor_test.dart
@@ -8,15 +8,21 @@
 import 'dart:mirrors';
 import 'package:async_helper/async_helper.dart';
 import 'package:expect/expect.dart';
+import 'package:compiler/src/commandline_options.dart';
 import 'package:compiler/src/constants/expressions.dart';
 import 'package:compiler/src/dart_types.dart';
-import 'package:compiler/src/dart2jslib.dart';
+import 'package:compiler/src/diagnostics/spannable.dart';
+import 'package:compiler/src/diagnostics/messages.dart' show MessageKind;
+import 'package:compiler/src/compiler.dart';
 import 'package:compiler/src/elements/elements.dart';
-import 'package:compiler/src/resolution/resolution.dart';
-import 'package:compiler/src/resolution/semantic_visitor.dart';
 import 'package:compiler/src/resolution/operators.dart';
+import 'package:compiler/src/resolution/semantic_visitor.dart';
+import 'package:compiler/src/resolution/tree_elements.dart';
 import 'package:compiler/src/tree/tree.dart';
-import 'package:compiler/src/util/util.dart';
+import 'package:compiler/src/universe/call_structure.dart' show
+    CallStructure;
+import 'package:compiler/src/universe/selector.dart' show
+    Selector;
 import 'memory_compiler.dart';
 
 part 'semantic_visitor_test_send_data.dart';
@@ -178,50 +184,29 @@
   // A final field shadowing a non-final field is currently not supported in
   // resolution.
   VisitKind.VISIT_SUPER_FIELD_FIELD_COMPOUND,
+  VisitKind.VISIT_SUPER_FIELD_FIELD_SET_IF_NULL,
   VisitKind.VISIT_SUPER_FIELD_FIELD_PREFIX,
   VisitKind.VISIT_SUPER_FIELD_FIELD_POSTFIX,
   // Combination of method and setter with the same name is currently not
   // supported by the element model.
   VisitKind.VISIT_STATIC_METHOD_SETTER_COMPOUND,
+  VisitKind.VISIT_STATIC_METHOD_SETTER_SET_IF_NULL,
   VisitKind.VISIT_STATIC_METHOD_SETTER_PREFIX,
   VisitKind.VISIT_STATIC_METHOD_SETTER_POSTFIX,
   VisitKind.VISIT_TOP_LEVEL_METHOD_SETTER_COMPOUND,
+  VisitKind.VISIT_TOP_LEVEL_METHOD_SETTER_SET_IF_NULL,
   VisitKind.VISIT_TOP_LEVEL_METHOD_SETTER_PREFIX,
   VisitKind.VISIT_TOP_LEVEL_METHOD_SETTER_POSTFIX,
   VisitKind.VISIT_SUPER_METHOD_SETTER_COMPOUND,
+  VisitKind.VISIT_SUPER_METHOD_SETTER_SET_IF_NULL,
   VisitKind.VISIT_SUPER_METHOD_SETTER_PREFIX,
   VisitKind.VISIT_SUPER_METHOD_SETTER_POSTFIX,
-  // The constant expressions of assignment to constant type literals cannot be
-  // handled the compile constant evaluator.
-  VisitKind.VISIT_CLASS_TYPE_LITERAL_SET,
-  VisitKind.VISIT_TYPEDEF_TYPE_LITERAL_SET,
-  VisitKind.VISIT_DYNAMIC_TYPE_LITERAL_SET,
-  // Invalid assignments is currently report through an erroneous element.
-  VisitKind.VISIT_TYPE_VARIABLE_TYPE_LITERAL_SET,
-  VisitKind.VISIT_FINAL_PARAMETER_SET,
-  VisitKind.VISIT_FINAL_LOCAL_VARIABLE_SET,
-  VisitKind.VISIT_LOCAL_FUNCTION_SET,
-  VisitKind.VISIT_STATIC_GETTER_SET,
-  VisitKind.VISIT_FINAL_STATIC_FIELD_SET,
-  VisitKind.VISIT_STATIC_FUNCTION_SET,
-  VisitKind.VISIT_FINAL_TOP_LEVEL_FIELD_SET,
-  VisitKind.VISIT_TOP_LEVEL_GETTER_SET,
-  VisitKind.VISIT_TOP_LEVEL_FUNCTION_SET,
-  VisitKind.VISIT_FINAL_SUPER_FIELD_SET,
-  VisitKind.VISIT_SUPER_GETTER_SET,
-  VisitKind.VISIT_SUPER_METHOD_SET,
   // The only undefined unary, `+`, is currently handled and skipped in the
   // parser.
   VisitKind.ERROR_UNDEFINED_UNARY_EXPRESSION,
   // Constant expression are currently not computed during resolution.
   VisitKind.VISIT_CONSTANT_GET,
   VisitKind.VISIT_CONSTANT_INVOKE,
-  // TODO(johnniwinther): Test these when ResolverVisitor.visitSendSet has been
-  // rewritten.
-  VisitKind.ERROR_INVALID_SET,
-  VisitKind.ERROR_INVALID_PREFIX,
-  VisitKind.ERROR_INVALID_POSTFIX,
-  VisitKind.ERROR_INVALID_COMPOUND,
 ];
 
 main(List<String> arguments) {
@@ -309,9 +294,7 @@
 
   CompilationResult result = await runCompiler(
       memorySourceFiles: sourceFiles,
-      options: ['--analyze-all',
-                '--analyze-only',
-                '--enable-null-aware-operators']);
+      options: [Flags.analyzeAll, Flags.analyzeOnly]);
   Compiler compiler = result.compiler;
   testMap.forEach((String filename, Test test) {
     LibraryElement library = compiler.libraryLoader.lookupLibrary(
@@ -347,7 +330,7 @@
       ResolvedAst resolvedAst = astElement.resolvedAst;
       SemanticTestVisitor visitor = createVisitor(resolvedAst.elements);
       try {
-        compiler.withCurrentElement(resolvedAst.element, () {
+        compiler.reporter.withCurrentElement(resolvedAst.element, () {
           //print(resolvedAst.node.toDebugString());
           resolvedAst.node.accept(visitor);
         });
@@ -392,10 +375,12 @@
   VISIT_PARAMETER_SET,
   VISIT_PARAMETER_INVOKE,
   VISIT_PARAMETER_COMPOUND,
+  VISIT_PARAMETER_SET_IF_NULL,
   VISIT_PARAMETER_PREFIX,
   VISIT_PARAMETER_POSTFIX,
   VISIT_FINAL_PARAMETER_SET,
   VISIT_FINAL_PARAMETER_COMPOUND,
+  VISIT_FINAL_PARAMETER_SET_IF_NULL,
   VISIT_FINAL_PARAMETER_PREFIX,
   VISIT_FINAL_PARAMETER_POSTFIX,
 
@@ -403,12 +388,14 @@
   VISIT_LOCAL_VARIABLE_SET,
   VISIT_LOCAL_VARIABLE_INVOKE,
   VISIT_LOCAL_VARIABLE_COMPOUND,
+  VISIT_LOCAL_VARIABLE_SET_IF_NULL,
   VISIT_LOCAL_VARIABLE_PREFIX,
   VISIT_LOCAL_VARIABLE_POSTFIX,
   VISIT_LOCAL_VARIABLE_DECL,
   VISIT_LOCAL_CONSTANT_DECL,
   VISIT_FINAL_LOCAL_VARIABLE_SET,
   VISIT_FINAL_LOCAL_VARIABLE_COMPOUND,
+  VISIT_FINAL_LOCAL_VARIABLE_SET_IF_NULL,
   VISIT_FINAL_LOCAL_VARIABLE_PREFIX,
   VISIT_FINAL_LOCAL_VARIABLE_POSTFIX,
 
@@ -419,6 +406,7 @@
   VISIT_CLOSURE_DECL,
   VISIT_LOCAL_FUNCTION_SET,
   VISIT_LOCAL_FUNCTION_COMPOUND,
+  VISIT_LOCAL_FUNCTION_SET_IF_NULL,
   VISIT_LOCAL_FUNCTION_PREFIX,
   VISIT_LOCAL_FUNCTION_POSTFIX,
 
@@ -426,6 +414,7 @@
   VISIT_STATIC_FIELD_SET,
   VISIT_STATIC_FIELD_INVOKE,
   VISIT_STATIC_FIELD_COMPOUND,
+  VISIT_STATIC_FIELD_SET_IF_NULL,
   VISIT_STATIC_FIELD_PREFIX,
   VISIT_STATIC_FIELD_POSTFIX,
   VISIT_STATIC_FIELD_DECL,
@@ -440,7 +429,9 @@
   VISIT_STATIC_SETTER_INVOKE,
 
   VISIT_STATIC_GETTER_SETTER_COMPOUND,
+  VISIT_STATIC_GETTER_SETTER_SET_IF_NULL,
   VISIT_STATIC_METHOD_SETTER_COMPOUND,
+  VISIT_STATIC_METHOD_SETTER_SET_IF_NULL,
   VISIT_STATIC_GETTER_SETTER_PREFIX,
   VISIT_STATIC_GETTER_SETTER_POSTFIX,
 
@@ -449,6 +440,7 @@
 
   VISIT_FINAL_STATIC_FIELD_SET,
   VISIT_STATIC_FINAL_FIELD_COMPOUND,
+  VISIT_STATIC_FINAL_FIELD_SET_IF_NULL,
   VISIT_STATIC_FINAL_FIELD_POSTFIX,
   VISIT_STATIC_FINAL_FIELD_PREFIX,
 
@@ -461,8 +453,11 @@
   VISIT_STATIC_METHOD_SETTER_POSTFIX,
 
   VISIT_UNRESOLVED_STATIC_GETTER_COMPOUND,
+  VISIT_UNRESOLVED_STATIC_GETTER_SET_IF_NULL,
   VISIT_UNRESOLVED_STATIC_SETTER_COMPOUND,
+  VISIT_UNRESOLVED_STATIC_SETTER_SET_IF_NULL,
   VISIT_STATIC_METHOD_COMPOUND,
+  VISIT_STATIC_METHOD_SET_IF_NULL,
   VISIT_UNRESOLVED_STATIC_GETTER_PREFIX,
   VISIT_UNRESOLVED_STATIC_SETTER_PREFIX,
   VISIT_STATIC_METHOD_PREFIX,
@@ -475,11 +470,13 @@
   VISIT_TOP_LEVEL_FIELD_INVOKE,
   VISIT_FINAL_TOP_LEVEL_FIELD_SET,
   VISIT_TOP_LEVEL_FIELD_COMPOUND,
+  VISIT_TOP_LEVEL_FIELD_SET_IF_NULL,
   VISIT_TOP_LEVEL_FIELD_PREFIX,
   VISIT_TOP_LEVEL_FIELD_POSTFIX,
   VISIT_TOP_LEVEL_FIELD_DECL,
   VISIT_TOP_LEVEL_CONSTANT_DECL,
   VISIT_TOP_LEVEL_FINAL_FIELD_COMPOUND,
+  VISIT_TOP_LEVEL_FINAL_FIELD_SET_IF_NULL,
   VISIT_TOP_LEVEL_FINAL_FIELD_POSTFIX,
   VISIT_TOP_LEVEL_FINAL_FIELD_PREFIX,
 
@@ -490,6 +487,7 @@
   VISIT_TOP_LEVEL_SETTER_SET,
   VISIT_TOP_LEVEL_SETTER_INVOKE,
   VISIT_TOP_LEVEL_GETTER_SETTER_COMPOUND,
+  VISIT_TOP_LEVEL_GETTER_SETTER_SET_IF_NULL,
   VISIT_TOP_LEVEL_GETTER_SETTER_PREFIX,
   VISIT_TOP_LEVEL_GETTER_SETTER_POSTFIX,
   VISIT_TOP_LEVEL_GETTER_DECL,
@@ -501,12 +499,16 @@
   VISIT_TOP_LEVEL_FUNCTION_INCOMPATIBLE_INVOKE,
   VISIT_TOP_LEVEL_FUNCTION_DECL,
   VISIT_TOP_LEVEL_METHOD_SETTER_COMPOUND,
+  VISIT_TOP_LEVEL_METHOD_SETTER_SET_IF_NULL,
   VISIT_TOP_LEVEL_METHOD_SETTER_PREFIX,
   VISIT_TOP_LEVEL_METHOD_SETTER_POSTFIX,
 
   VISIT_UNRESOLVED_TOP_LEVEL_GETTER_COMPOUND,
+  VISIT_UNRESOLVED_TOP_LEVEL_GETTER_SET_IF_NULL,
   VISIT_UNRESOLVED_TOP_LEVEL_SETTER_COMPOUND,
+  VISIT_UNRESOLVED_TOP_LEVEL_SETTER_SET_IF_NULL,
   VISIT_TOP_LEVEL_METHOD_COMPOUND,
+  VISIT_TOP_LEVEL_METHOD_SET_IF_NULL,
   VISIT_UNRESOLVED_TOP_LEVEL_GETTER_PREFIX,
   VISIT_UNRESOLVED_TOP_LEVEL_SETTER_PREFIX,
   VISIT_TOP_LEVEL_METHOD_PREFIX,
@@ -518,6 +520,7 @@
   VISIT_DYNAMIC_PROPERTY_SET,
   VISIT_DYNAMIC_PROPERTY_INVOKE,
   VISIT_DYNAMIC_PROPERTY_COMPOUND,
+  VISIT_DYNAMIC_PROPERTY_SET_IF_NULL,
   VISIT_DYNAMIC_PROPERTY_PREFIX,
   VISIT_DYNAMIC_PROPERTY_POSTFIX,
 
@@ -528,6 +531,7 @@
   VISIT_THIS_PROPERTY_SET,
   VISIT_THIS_PROPERTY_INVOKE,
   VISIT_THIS_PROPERTY_COMPOUND,
+  VISIT_THIS_PROPERTY_SET_IF_NULL,
   VISIT_THIS_PROPERTY_PREFIX,
   VISIT_THIS_PROPERTY_POSTFIX,
 
@@ -536,12 +540,15 @@
   VISIT_FINAL_SUPER_FIELD_SET,
   VISIT_SUPER_FIELD_INVOKE,
   VISIT_SUPER_FIELD_COMPOUND,
+  VISIT_SUPER_FIELD_SET_IF_NULL,
   VISIT_SUPER_FIELD_PREFIX,
   VISIT_SUPER_FIELD_POSTFIX,
   VISIT_SUPER_FINAL_FIELD_COMPOUND,
+  VISIT_SUPER_FINAL_FIELD_SET_IF_NULL,
   VISIT_SUPER_FINAL_FIELD_PREFIX,
   VISIT_SUPER_FINAL_FIELD_POSTFIX,
   VISIT_SUPER_FIELD_FIELD_COMPOUND,
+  VISIT_SUPER_FIELD_FIELD_SET_IF_NULL,
   VISIT_SUPER_FIELD_FIELD_PREFIX,
   VISIT_SUPER_FIELD_FIELD_POSTFIX,
 
@@ -552,8 +559,11 @@
   VISIT_SUPER_SETTER_SET,
   VISIT_SUPER_SETTER_INVOKE,
   VISIT_SUPER_GETTER_SETTER_COMPOUND,
+  VISIT_SUPER_GETTER_SETTER_SET_IF_NULL,
   VISIT_SUPER_GETTER_FIELD_COMPOUND,
+  VISIT_SUPER_GETTER_FIELD_SET_IF_NULL,
   VISIT_SUPER_FIELD_SETTER_COMPOUND,
+  VISIT_SUPER_FIELD_SETTER_SET_IF_NULL,
   VISIT_SUPER_GETTER_SETTER_PREFIX,
   VISIT_SUPER_GETTER_FIELD_PREFIX,
   VISIT_SUPER_FIELD_SETTER_PREFIX,
@@ -566,9 +576,11 @@
   VISIT_SUPER_METHOD_INVOKE,
   VISIT_SUPER_METHOD_INCOMPATIBLE_INVOKE,
   VISIT_SUPER_METHOD_SETTER_COMPOUND,
+  VISIT_SUPER_METHOD_SETTER_SET_IF_NULL,
   VISIT_SUPER_METHOD_SETTER_PREFIX,
   VISIT_SUPER_METHOD_SETTER_POSTFIX,
   VISIT_SUPER_METHOD_COMPOUND,
+  VISIT_SUPER_METHOD_SET_IF_NULL,
   VISIT_SUPER_METHOD_PREFIX,
   VISIT_SUPER_METHOD_POSTFIX,
 
@@ -593,7 +605,9 @@
   VISIT_SUPER_NOT_EQUALS,
   VISIT_SUPER_INDEX_PREFIX,
   VISIT_UNRESOLVED_SUPER_GETTER_COMPOUND,
+  VISIT_UNRESOLVED_SUPER_GETTER_SET_IF_NULL,
   VISIT_UNRESOLVED_SUPER_SETTER_COMPOUND,
+  VISIT_UNRESOLVED_SUPER_SETTER_SET_IF_NULL,
   VISIT_UNRESOLVED_SUPER_GETTER_PREFIX,
   VISIT_UNRESOLVED_SUPER_SETTER_PREFIX,
   VISIT_UNRESOLVED_SUPER_INDEX_PREFIX,
@@ -607,6 +621,7 @@
   VISIT_UNRESOLVED_SUPER_SETTER_INDEX_POSTFIX,
 
   VISIT_UNRESOLVED_SUPER_COMPOUND,
+  VISIT_UNRESOLVED_SUPER_SET_IF_NULL,
   VISIT_UNRESOLVED_SUPER_PREFIX,
   VISIT_UNRESOLVED_SUPER_POSTFIX,
 
@@ -621,6 +636,7 @@
   VISIT_CLASS_TYPE_LITERAL_SET,
   VISIT_CLASS_TYPE_LITERAL_INVOKE,
   VISIT_CLASS_TYPE_LITERAL_COMPOUND,
+  VISIT_CLASS_TYPE_LITERAL_SET_IF_NULL,
   VISIT_CLASS_TYPE_LITERAL_PREFIX,
   VISIT_CLASS_TYPE_LITERAL_POSTFIX,
 
@@ -628,6 +644,7 @@
   VISIT_TYPEDEF_TYPE_LITERAL_SET,
   VISIT_TYPEDEF_TYPE_LITERAL_INVOKE,
   VISIT_TYPEDEF_TYPE_LITERAL_COMPOUND,
+  VISIT_TYPEDEF_TYPE_LITERAL_SET_IF_NULL,
   VISIT_TYPEDEF_TYPE_LITERAL_PREFIX,
   VISIT_TYPEDEF_TYPE_LITERAL_POSTFIX,
 
@@ -635,6 +652,7 @@
   VISIT_TYPE_VARIABLE_TYPE_LITERAL_SET,
   VISIT_TYPE_VARIABLE_TYPE_LITERAL_INVOKE,
   VISIT_TYPE_VARIABLE_TYPE_LITERAL_COMPOUND,
+  VISIT_TYPE_VARIABLE_TYPE_LITERAL_SET_IF_NULL,
   VISIT_TYPE_VARIABLE_TYPE_LITERAL_PREFIX,
   VISIT_TYPE_VARIABLE_TYPE_LITERAL_POSTFIX,
 
@@ -642,6 +660,7 @@
   VISIT_DYNAMIC_TYPE_LITERAL_SET,
   VISIT_DYNAMIC_TYPE_LITERAL_INVOKE,
   VISIT_DYNAMIC_TYPE_LITERAL_COMPOUND,
+  VISIT_DYNAMIC_TYPE_LITERAL_SET_IF_NULL,
   VISIT_DYNAMIC_TYPE_LITERAL_PREFIX,
   VISIT_DYNAMIC_TYPE_LITERAL_POSTFIX,
 
@@ -654,7 +673,6 @@
   VISIT_UNRESOLVED_SUPER_GETTER_COMPOUND_INDEX_SET,
   VISIT_UNRESOLVED_SUPER_SETTER_COMPOUND_INDEX_SET,
 
-  VISIT_ASSERT,
   VISIT_LOGICAL_AND,
   VISIT_LOGICAL_OR,
   VISIT_IS,
@@ -703,6 +721,7 @@
   VISIT_NAMED_INITIALIZING_FORMAL_DECL,
 
   VISIT_UNRESOLVED_COMPOUND,
+  VISIT_UNRESOLVED_SET_IF_NULL,
   VISIT_UNRESOLVED_PREFIX,
   VISIT_UNRESOLVED_POSTFIX,
 
@@ -711,10 +730,10 @@
   VISIT_IF_NOT_NULL_DYNAMIC_PROPERTY_SET,
   VISIT_IF_NOT_NULL_DYNAMIC_PROPERTY_INVOKE,
   VISIT_IF_NOT_NULL_DYNAMIC_PROPERTY_COMPOUND,
+  VISIT_IF_NOT_NULL_DYNAMIC_PROPERTY_SET_IF_NULL,
   VISIT_IF_NOT_NULL_DYNAMIC_PROPERTY_PREFIX,
   VISIT_IF_NOT_NULL_DYNAMIC_PROPERTY_POSTFIX,
 
-  ERROR_INVALID_ASSERT,
   ERROR_UNDEFINED_UNARY_EXPRESSION,
   ERROR_UNDEFINED_BINARY_EXPRESSION,
   ERROR_INVALID_GET,
@@ -723,6 +742,7 @@
   ERROR_INVALID_PREFIX,
   ERROR_INVALID_POSTFIX,
   ERROR_INVALID_COMPOUND,
+  ERROR_INVALID_SET_IF_NULL,
   ERROR_INVALID_UNARY,
   ERROR_INVALID_EQUALS,
   ERROR_INVALID_NOT_EQUALS,
diff --git a/tests/compiler/dart2js/semantic_visitor_test_send_data.dart b/tests/compiler/dart2js/semantic_visitor_test_send_data.dart
index d1fa072..c407766 100644
--- a/tests/compiler/dart2js/semantic_visitor_test_send_data.dart
+++ b/tests/compiler/dart2js/semantic_visitor_test_send_data.dart
@@ -19,10 +19,9 @@
                     element: 'parameter(m#o)',
                     arguments: '(null,42)',
                     selector: 'CallStructure(arity=2)')),
-    // TODO(johnniwinther): Expect [VISIT_FINAL_PARAMETER_SET] instead.
     const Test('m(final o) { o = 42; }',
-        const Visit(VisitKind.VISIT_UNRESOLVED_SET,
-                    name: 'o',
+        const Visit(VisitKind.VISIT_FINAL_PARAMETER_SET,
+                    element: 'parameter(m#o)',
                     rhs:'42')),
   ],
   'Local variables': const [
@@ -39,15 +38,13 @@
                     element: 'variable(m#o)',
                     arguments: '(null,42)',
                     selector: 'CallStructure(arity=2)')),
-    // TODO(johnniwinther): Expect [VISIT_FINAL_LOCAL_VARIABLE_SET] instead.
     const Test('m() { final o = 0; o = 42; }',
-        const Visit(VisitKind.VISIT_UNRESOLVED_SET,
-                    name: 'o',
+        const Visit(VisitKind.VISIT_FINAL_LOCAL_VARIABLE_SET,
+                    element: 'variable(m#o)',
                     rhs:'42')),
-    // TODO(johnniwinther): Expect [VISIT_FINAL_LOCAL_VARIABLE_SET] instead.
     const Test('m() { const o = 0; o = 42; }',
-        const Visit(VisitKind.VISIT_UNRESOLVED_SET,
-                    name: 'o',
+        const Visit(VisitKind.VISIT_FINAL_LOCAL_VARIABLE_SET,
+                    element: 'variable(m#o)',
                     rhs:'42')),
   ],
   'Local functions': const [
@@ -65,10 +62,9 @@
                     element: 'function(m#o)',
                     arguments: '(null,42)',
                     selector: 'CallStructure(arity=2)')),
-    // TODO(johnniwinther): Expect [VISIT_LOCAL_FUNCTION_SET] instead.
     const Test('m() { o(a, b) {}; o = 42; }',
-        const Visit(VisitKind.VISIT_UNRESOLVED_SET,
-                    name: 'o',
+        const Visit(VisitKind.VISIT_LOCAL_FUNCTION_SET,
+                    element: 'function(m#o)',
                     rhs: '42')),
   ],
   'Static fields': const [
@@ -107,6 +103,15 @@
         'm() => p.C.o;',
         const Visit(VisitKind.VISIT_STATIC_FIELD_GET,
                     element: 'field(C#o)')),
+    const Test.clazz(
+        '''
+        class C {
+          var o;
+          static m() => o;
+        }
+        ''',
+        const Visit(VisitKind.ERROR_INVALID_GET,
+                    error: MessageKind.NO_INSTANCE_AVAILABLE)),
     const Test.prefix(
         '''
         class C {
@@ -133,6 +138,16 @@
     const Test(
         '''
         class C {
+          var o;
+        }
+        m() { C.o = 42; }
+        ''',
+        const Visit(VisitKind.VISIT_UNRESOLVED_SET,
+                    name: 'o',
+                    rhs: '42')),
+    const Test(
+        '''
+        class C {
           C.o();
         }
         m() => C.o;
@@ -189,7 +204,9 @@
         null),
     const Test(
         '''
-        class C { static var o; }
+        class C {
+          static var o;
+        }
         m() { C.o = 42; }
         ''',
         const Visit(VisitKind.VISIT_STATIC_FIELD_SET,
@@ -225,9 +242,21 @@
         const Visit(VisitKind.VISIT_STATIC_FIELD_SET,
                     element: 'field(C#o)',
                     rhs: '42')),
+    const Test.clazz(
+        '''
+        class C {
+          var o;
+          static m() { o = 42; }
+        }
+        ''',
+        const Visit(VisitKind.ERROR_INVALID_SET,
+                    error: MessageKind.NO_INSTANCE_AVAILABLE,
+                    rhs: '42')),
     const Test(
         '''
-        class C { static var o; }
+        class C {
+          static var o;
+        }
         m() { C.o(null, 42); }
         ''',
         const Visit(VisitKind.VISIT_STATIC_FIELD_INVOKE,
@@ -253,6 +282,16 @@
         const Visit(VisitKind.VISIT_STATIC_FIELD_INVOKE,
                     element: 'field(C#o)',
                     arguments: '(null,42)')),
+    const Test.clazz(
+        '''
+        class C {
+          var o;
+          static m() { o(null, 42); }
+        }
+        ''',
+        const Visit(VisitKind.ERROR_INVALID_INVOKE,
+                    error: MessageKind.NO_INSTANCE_AVAILABLE,
+                    arguments: '(null,42)')),
     const Test.prefix(
         '''
         class C {
@@ -269,15 +308,15 @@
         m() => C.this(null, 42);
         ''',
         const Visit(VisitKind.ERROR_INVALID_INVOKE,
-                    error: MessageKind.THIS_PROPERTY, arguments: '(null,42)')),
-    // TODO(johnniwinther): Expect [VISIT_FINAL_STATIC_FIELD_SET] instead.
+                    error: MessageKind.THIS_PROPERTY,
+                    arguments: '(null,42)')),
     const Test(
         '''
         class C { static final o = 0; }
         m() { C.o = 42; }
         ''',
-        const Visit(VisitKind.VISIT_UNRESOLVED_SET,
-                    name: 'o',
+        const Visit(VisitKind.VISIT_FINAL_STATIC_FIELD_SET,
+                    element: 'field(C#o)',
                     rhs: '42')),
     const Test.clazz(
         '''
@@ -286,8 +325,8 @@
           m() { o = 42; }
         }
         ''',
-        const Visit(VisitKind.VISIT_UNRESOLVED_SET,
-                    name: 'o',
+        const Visit(VisitKind.VISIT_FINAL_STATIC_FIELD_SET,
+                    element: 'field(C#o)',
                     rhs: '42')),
     const Test.clazz(
         '''
@@ -296,8 +335,8 @@
           m() { C.o = 42; }
         }
         ''',
-        const Visit(VisitKind.VISIT_UNRESOLVED_SET,
-                    name: 'o',
+        const Visit(VisitKind.VISIT_FINAL_STATIC_FIELD_SET,
+                    element: 'field(C#o)',
                     rhs: '42')),
     const Test.prefix(
         '''
@@ -306,16 +345,16 @@
         }
         ''',
         'm() { p.C.o = 42; }',
-        const Visit(VisitKind.VISIT_UNRESOLVED_SET,
-                    name: 'o',
+        const Visit(VisitKind.VISIT_FINAL_STATIC_FIELD_SET,
+                    element: 'field(C#o)',
                     rhs: '42')),
     const Test(
         '''
         class C { static const o = 0; }
         m() { C.o = 42; }
         ''',
-        const Visit(VisitKind.VISIT_UNRESOLVED_SET,
-                    name: 'o',
+        const Visit(VisitKind.VISIT_FINAL_STATIC_FIELD_SET,
+                    element: 'field(C#o)',
                     rhs: '42')),
     const Test.clazz(
         '''
@@ -324,8 +363,8 @@
           m() { o = 42; }
         }
         ''',
-        const Visit(VisitKind.VISIT_UNRESOLVED_SET,
-                    name: 'o',
+        const Visit(VisitKind.VISIT_FINAL_STATIC_FIELD_SET,
+                    element: 'field(C#o)',
                     rhs: '42')),
     const Test.clazz(
         '''
@@ -334,8 +373,8 @@
           m() { C.o = 42; }
         }
         ''',
-        const Visit(VisitKind.VISIT_UNRESOLVED_SET,
-                    name: 'o',
+        const Visit(VisitKind.VISIT_FINAL_STATIC_FIELD_SET,
+                    element: 'field(C#o)',
                     rhs: '42')),
     const Test.prefix(
         '''
@@ -344,8 +383,8 @@
         }
         ''',
         'm() { p.C.o = 42; }',
-        const Visit(VisitKind.VISIT_UNRESOLVED_SET,
-                    name: 'o',
+        const Visit(VisitKind.VISIT_FINAL_STATIC_FIELD_SET,
+                    element: 'field(C#o)',
                     rhs: '42')),
   ],
   'Static properties': const [
@@ -386,14 +425,13 @@
         'm() => p.C.o;',
         const Visit(VisitKind.VISIT_STATIC_GETTER_GET,
                     element: 'getter(C#o)')),
-    // TODO(johnniwinther): Expected [VISIT_STATIC_GETTER_SET] instead.
     const Test(
         '''
         class C { static get o => 42; }
         m() { C.o = 42; }
         ''',
-        const Visit(VisitKind.VISIT_UNRESOLVED_SET,
-                    name: 'o',
+        const Visit(VisitKind.VISIT_STATIC_GETTER_SET,
+                    element: 'getter(C#o)',
                     rhs: '42')),
     const Test.clazz(
         '''
@@ -402,8 +440,8 @@
           m() { o = 42; }
         }
         ''',
-        const Visit(VisitKind.VISIT_UNRESOLVED_SET,
-                    name: 'o',
+        const Visit(VisitKind.VISIT_STATIC_GETTER_SET,
+                    element: 'getter(C#o)',
                     rhs: '42')),
     const Test.clazz(
         '''
@@ -412,8 +450,8 @@
           m() { C.o = 42; }
         }
         ''',
-        const Visit(VisitKind.VISIT_UNRESOLVED_SET,
-                    name: 'o',
+        const Visit(VisitKind.VISIT_STATIC_GETTER_SET,
+                    element: 'getter(C#o)',
                     rhs: '42')),
     const Test.prefix(
         '''
@@ -422,8 +460,8 @@
         }
         ''',
         'm() { p.C.o = 42; }',
-        const Visit(VisitKind.VISIT_UNRESOLVED_SET,
-                    name: 'o',
+        const Visit(VisitKind.VISIT_STATIC_GETTER_SET,
+                    element: 'getter(C#o)',
                     rhs: '42')),
     const Test(
         '''
@@ -613,14 +651,13 @@
         ''',
         const Visit(VisitKind.VISIT_STATIC_FUNCTION_GET,
                     element: 'function(C#o)')),
-    // TODO(johnniwinther): Expect [VISIT_STATIC_FUNCTION_SET] instead.
     const Test(
         '''
         class C { static o(a, b) {} }
         m() { C.o = 42; }
         ''',
-        const Visit(VisitKind.VISIT_UNRESOLVED_SET,
-                    name: 'o',
+        const Visit(VisitKind.VISIT_STATIC_FUNCTION_SET,
+                    element: 'function(C#o)',
                     rhs: '42')),
     const Test.clazz(
         '''
@@ -629,8 +666,8 @@
           m() { o = 42; }
         }
         ''',
-        const Visit(VisitKind.VISIT_UNRESOLVED_SET,
-                    name: 'o',
+        const Visit(VisitKind.VISIT_STATIC_FUNCTION_SET,
+                    element: 'function(C#o)',
                     rhs: '42')),
     const Test.clazz(
         '''
@@ -639,8 +676,8 @@
           m() { C.o = 42; }
         }
         ''',
-        const Visit(VisitKind.VISIT_UNRESOLVED_SET,
-                    name: 'o',
+        const Visit(VisitKind.VISIT_STATIC_FUNCTION_SET,
+                    element: 'function(C#o)',
                     rhs: '42')),
     const Test.prefix(
         '''
@@ -649,8 +686,8 @@
         '''
         m() { p.C.o = 42; }
         ''',
-        const Visit(VisitKind.VISIT_UNRESOLVED_SET,
-                    name: 'o',
+        const Visit(VisitKind.VISIT_STATIC_FUNCTION_SET,
+                    element: 'function(C#o)',
                     rhs: '42')),
     const Test(
         '''
@@ -766,38 +803,37 @@
         const Visit(VisitKind.VISIT_TOP_LEVEL_FIELD_SET,
                     element: 'field(o)',
                     rhs: '42')),
-    // TODO(johnniwinther): Expect [VISIT_FINAL_TOP_LEVEL_FIELD_SET] instead.
     const Test(
         '''
         final o = 0;
         m() { o = 42; }
         ''',
-        const Visit(VisitKind.VISIT_UNRESOLVED_SET,
-                    name: 'o',
+        const Visit(VisitKind.VISIT_FINAL_TOP_LEVEL_FIELD_SET,
+                    element: 'field(o)',
                     rhs: '42')),
     const Test.prefix(
         '''
         final o = 0;
         ''',
         'm() { p.o = 42; }',
-        const Visit(VisitKind.VISIT_UNRESOLVED_SET,
-                    name: 'o',
+        const Visit(VisitKind.VISIT_FINAL_TOP_LEVEL_FIELD_SET,
+                    element: 'field(o)',
                     rhs: '42')),
     const Test(
         '''
         const o = 0;
         m() { o = 42; }
         ''',
-        const Visit(VisitKind.VISIT_UNRESOLVED_SET,
-                    name: 'o',
+        const Visit(VisitKind.VISIT_FINAL_TOP_LEVEL_FIELD_SET,
+                    element: 'field(o)',
                     rhs: '42')),
     const Test.prefix(
         '''
         const o = 0;
         ''',
         'm() { p.o = 42; }',
-        const Visit(VisitKind.VISIT_UNRESOLVED_SET,
-                    name: 'o',
+        const Visit(VisitKind.VISIT_FINAL_TOP_LEVEL_FIELD_SET,
+                    element: 'field(o)',
                     rhs: '42')),
     const Test(
         '''
@@ -821,6 +857,13 @@
         ''',
         const Visit(VisitKind.VISIT_UNRESOLVED_GET,
                     name: 'o')),
+    const Test(
+        '''
+        m() { o = 42; }
+        ''',
+        const Visit(VisitKind.VISIT_UNRESOLVED_SET,
+                    name: 'o',
+                    rhs: '42')),
   ],
   'Top level properties': const [
     // Top level properties
@@ -856,22 +899,21 @@
         ''',
         const Visit(VisitKind.VISIT_TOP_LEVEL_SETTER_GET,
                     element: 'setter(o)')),
-    // TODO(johnniwinther): Expect [VISIT_TOP_LEVEL_GETTER_SET] instead.
     const Test(
         '''
         get o => null;
         m() { o = 42; }
         ''',
-        const Visit(VisitKind.VISIT_UNRESOLVED_SET,
-                    name: 'o',
+        const Visit(VisitKind.VISIT_TOP_LEVEL_GETTER_SET,
+                    element: 'getter(o)',
                     rhs: '42')),
     const Test.prefix(
         '''
         get o => null;
         ''',
         'm() { p.o = 42; }',
-        const Visit(VisitKind.VISIT_UNRESOLVED_SET,
-                    name: 'o',
+        const Visit(VisitKind.VISIT_TOP_LEVEL_GETTER_SET,
+                    element: 'getter(o)',
                     rhs: '42')),
     const Test(
         '''
@@ -1001,22 +1043,21 @@
         const Visit(VisitKind.ERROR_INVALID_INVOKE,
                     error: MessageKind.PREFIX_AS_EXPRESSION,
                     arguments: '(null,42)')),
-    // TODO(johnniwinther): Expect [VISIT_TOP_LEVEL_FUNCTION_SET] instead.
     const Test(
         '''
         o(a, b) {}
         m() { o = 42; }
         ''',
-        const Visit(VisitKind.VISIT_UNRESOLVED_SET,
-                    name: 'o',
+        const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_SET,
+                    element: 'function(o)',
                     rhs: '42')),
     const Test.prefix(
         '''
         o(a, b) {}
         ''',
         'm() { p.o = 42; }',
-        const Visit(VisitKind.VISIT_UNRESOLVED_SET,
-                    name: 'o',
+        const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_SET,
+                    element: 'function(o)',
                     rhs: '42')),
   ],
   'Dynamic properties': const [
@@ -1066,6 +1107,16 @@
         ''',
         const Visit(VisitKind.VISIT_THIS_INVOKE,
                     arguments: '(null,42)')),
+    const Test.clazz(
+        '''
+        class C {
+          call(a, b) {}
+          static m() { this(null, 42); }
+        }
+        ''',
+        const Visit(VisitKind.ERROR_INVALID_INVOKE,
+                    error: MessageKind.NO_THIS_AVAILABLE,
+                    arguments: '(null,42)')),
   ],
   'This properties': const [
     // This properties
@@ -1099,6 +1150,15 @@
     const Test.clazz(
         '''
         class C {
+          var foo;
+          static m() => this.foo;
+        }
+        ''',
+        const Visit(VisitKind.ERROR_INVALID_GET,
+                    error: MessageKind.NO_THIS_AVAILABLE)),
+    const Test.clazz(
+        '''
+        class C {
           get foo => null;
           m() => this.foo;
         }
@@ -1165,6 +1225,16 @@
         const Visit(VisitKind.VISIT_THIS_PROPERTY_INVOKE,
                     name: 'foo',
                     arguments: '(null,42)')),
+    const Test.clazz(
+        '''
+        class C {
+          var foo;
+          static m() { this.foo(null, 42); }
+        }
+        ''',
+        const Visit(VisitKind.ERROR_INVALID_INVOKE,
+                    error: MessageKind.NO_THIS_AVAILABLE,
+                    arguments: '(null,42)')),
   ],
   'Super fields': const [
     // Super fields
@@ -1191,7 +1261,6 @@
         const Visit(VisitKind.VISIT_SUPER_FIELD_SET,
                     element: 'field(B#o)',
                     rhs: '42')),
-    // TODO(johnniwinther): Expect [VISIT_FINAL_SUPER_FIELD_SET] instead.
     const Test.clazz(
         '''
         class B {
@@ -1201,8 +1270,8 @@
           m() { super.o = 42; }
         }
         ''',
-        const Visit(VisitKind.VISIT_UNRESOLVED_SET,
-                    name: 'o',
+        const Visit(VisitKind.VISIT_FINAL_SUPER_FIELD_SET,
+                    element: 'field(B#o)',
                     rhs: '42')),
     const Test.clazz(
         '''
@@ -1250,7 +1319,6 @@
         ''',
         const Visit(VisitKind.VISIT_SUPER_SETTER_GET,
                     element: 'setter(B#o)')),
-    // TODO(johnniwinther): Expect [VISIT_SUPER_GETTER_SET] instead.
     const Test.clazz(
         '''
         class B {
@@ -1260,8 +1328,8 @@
           m() { super.o = 42; }
         }
         ''',
-        const Visit(VisitKind.VISIT_UNRESOLVED_SET,
-                    name: 'o',
+        const Visit(VisitKind.VISIT_SUPER_GETTER_SET,
+                    element: 'getter(B#o)',
                     rhs: '42')),
     const Test.clazz(
         '''
@@ -1319,6 +1387,18 @@
           o(a, b) {}
         }
         class C extends B {
+          m() { super.o = 42; }
+        }
+        ''',
+        const Visit(VisitKind.VISIT_SUPER_METHOD_SET,
+                    element: 'function(B#o)',
+                    rhs: '42')),
+    const Test.clazz(
+        '''
+        class B {
+          o(a, b) {}
+        }
+        class C extends B {
           m() { super.o(null, 42); }
         }
         ''',
@@ -1375,6 +1455,14 @@
     const Test(
         '''
         class C {}
+        m() => C = 42;
+        ''',
+        const Visit(VisitKind.VISIT_CLASS_TYPE_LITERAL_SET,
+                    constant: 'C',
+                    rhs: '42')),
+    const Test(
+        '''
+        class C {}
         m() => C += 42;
         ''',
         const Visit(VisitKind.VISIT_CLASS_TYPE_LITERAL_COMPOUND,
@@ -1384,6 +1472,14 @@
     const Test(
         '''
         class C {}
+        m() => C ??= 42;
+        ''',
+        const Visit(VisitKind.VISIT_CLASS_TYPE_LITERAL_SET_IF_NULL,
+                    constant: 'C',
+                    rhs: '42')),
+    const Test(
+        '''
+        class C {}
         m() => ++C;
         ''',
         const Visit(VisitKind.VISIT_CLASS_TYPE_LITERAL_PREFIX,
@@ -1429,6 +1525,14 @@
     const Test(
         '''
         typedef F();
+        m() => F = 42;
+        ''',
+        const Visit(VisitKind.VISIT_TYPEDEF_TYPE_LITERAL_SET,
+                    constant: 'F',
+                    rhs: '42')),
+    const Test(
+        '''
+        typedef F();
         m() => F += 42;
         ''',
         const Visit(VisitKind.VISIT_TYPEDEF_TYPE_LITERAL_COMPOUND,
@@ -1438,6 +1542,14 @@
     const Test(
         '''
         typedef F();
+        m() => F ??= 42;
+        ''',
+        const Visit(VisitKind.VISIT_TYPEDEF_TYPE_LITERAL_SET_IF_NULL,
+                    constant: 'F',
+                    rhs: '42')),
+    const Test(
+        '''
+        typedef F();
         m() => ++F;
         ''',
         const Visit(VisitKind.VISIT_TYPEDEF_TYPE_LITERAL_PREFIX,
@@ -1474,6 +1586,15 @@
     const Test.clazz(
         '''
         class C<T> {
+          m() => T = 42;
+        }
+        ''',
+        const Visit(VisitKind.VISIT_TYPE_VARIABLE_TYPE_LITERAL_SET,
+                    element: 'type_variable(C#T)',
+                    rhs: '42')),
+    const Test.clazz(
+        '''
+        class C<T> {
           m() => T += 42;
         }
         ''',
@@ -1484,6 +1605,15 @@
     const Test.clazz(
         '''
         class C<T> {
+          m() => T ??= 42;
+        }
+        ''',
+        const Visit(VisitKind.VISIT_TYPE_VARIABLE_TYPE_LITERAL_SET_IF_NULL,
+                    element: 'type_variable(C#T)',
+                    rhs: '42')),
+    const Test.clazz(
+        '''
+        class C<T> {
           m() => ++T;
         }
         ''',
@@ -1499,7 +1629,59 @@
         const Visit(VisitKind.VISIT_TYPE_VARIABLE_TYPE_LITERAL_POSTFIX,
                     element: 'type_variable(C#T)',
                     operator: '--')),
-
+    const Test.clazz(
+        '''
+        class C<T> {
+          static m() => T;
+        }
+        ''',
+        const Visit(VisitKind.ERROR_INVALID_GET,
+                    error: MessageKind.TYPE_VARIABLE_WITHIN_STATIC_MEMBER)),
+    const Test.clazz(
+        '''
+        class C<T> {
+          static m() => T(null, 42);
+        }
+        ''',
+        const Visit(VisitKind.ERROR_INVALID_INVOKE,
+                    error: MessageKind.TYPE_VARIABLE_WITHIN_STATIC_MEMBER,
+                    arguments: '(null,42)')),
+    const Test.clazz(
+        '''
+        class C<T> {
+          static m() => T ??= 42;
+        }
+        ''',
+        const Visit(VisitKind.ERROR_INVALID_SET_IF_NULL,
+                    error: MessageKind.TYPE_VARIABLE_WITHIN_STATIC_MEMBER,
+                    rhs: '42')),
+    const Test.clazz(
+        '''
+        class C<T> {
+          static m() => T ??= 42;
+        }
+        ''',
+        const Visit(VisitKind.ERROR_INVALID_SET_IF_NULL,
+                    error: MessageKind.TYPE_VARIABLE_WITHIN_STATIC_MEMBER,
+                    rhs: '42')),
+    const Test.clazz(
+        '''
+        class C<T> {
+          static m() => ++T;
+        }
+        ''',
+        const Visit(VisitKind.ERROR_INVALID_PREFIX,
+                    error: MessageKind.TYPE_VARIABLE_WITHIN_STATIC_MEMBER,
+                    operator: '++')),
+    const Test.clazz(
+        '''
+        class C<T> {
+          static m() => T--;
+        }
+        ''',
+        const Visit(VisitKind.ERROR_INVALID_POSTFIX,
+                    error: MessageKind.TYPE_VARIABLE_WITHIN_STATIC_MEMBER,
+                    operator: '--')),
   ],
   'Dynamic type literals': const [
     // Dynamic type literals
@@ -1521,44 +1703,50 @@
                     arguments: '(null,42)')),
     const Test(
         '''
+        m() => dynamic = 42;
+        ''',
+        const Visit(VisitKind.VISIT_DYNAMIC_TYPE_LITERAL_SET,
+                    constant: 'dynamic',
+                    rhs: '42')),
+    const Test(
+        '''
         m() => dynamic += 42;
         ''',
         const Visit(VisitKind.VISIT_DYNAMIC_TYPE_LITERAL_COMPOUND,
-                    constant: 'Type',
+                    constant: 'dynamic',
                     operator: '+=',
                     rhs: '42')),
     const Test(
         '''
+        m() => dynamic ??= 42;
+        ''',
+        const Visit(VisitKind.VISIT_DYNAMIC_TYPE_LITERAL_SET_IF_NULL,
+                    constant: 'dynamic',
+                    rhs: '42')),
+    const Test(
+        '''
         m() => ++dynamic;
         ''',
         const Visit(VisitKind.VISIT_DYNAMIC_TYPE_LITERAL_PREFIX,
-                    constant: 'Type',
+                    constant: 'dynamic',
                     operator: '++')),
     const Test(
         '''
         m() => dynamic--;
         ''',
         const Visit(VisitKind.VISIT_DYNAMIC_TYPE_LITERAL_POSTFIX,
-                    constant: 'Type',
+                    constant: 'dynamic',
                     operator: '--')),
   ],
   'Assert': const [
     // Assert
     const Test(
         '''
-        m() { assert(false); }
+        m() { assert(m()); }
         ''',
-        const Visit(VisitKind.VISIT_ASSERT, expression: 'false')),
-    const Test(
-        '''
-        m() { assert(); }
-        ''',
-        const Visit(VisitKind.ERROR_INVALID_ASSERT, arguments: '()')),
-    const Test(
-        '''
-        m() { assert(42, true); }
-        ''',
-        const Visit(VisitKind.ERROR_INVALID_ASSERT, arguments: '(42,true)')),
+        const Visit(VisitKind.VISIT_TOP_LEVEL_FUNCTION_INVOKE,
+                    element: 'function(m)',
+                    arguments: '()')),
   ],
   'Logical and': const [
     // Logical and
@@ -2118,9 +2306,7 @@
         ''',
         const [
           const Visit(VisitKind.VISIT_DYNAMIC_PROPERTY_COMPOUND,
-              receiver: 'a', operator: '+=', rhs: '42',
-              getter: 'Selector(getter, b, arity=0)',
-              setter: 'Selector(setter, b, arity=1)'),
+              receiver: 'a', name: 'b', operator: '+=', rhs: '42'),
           const Visit(VisitKind.VISIT_PARAMETER_GET,
               element: 'parameter(m#a)')
         ]),
@@ -2217,6 +2403,17 @@
         ''',
         const Visit(VisitKind.VISIT_STATIC_FIELD_COMPOUND,
             element: 'field(C#a)', operator: '+=', rhs: '42')),
+    const Test.clazz(
+        '''
+        class C {
+          var o;
+          static m() { o += 42; }
+        }
+        ''',
+        const Visit(VisitKind.ERROR_INVALID_COMPOUND,
+                    error: MessageKind.NO_INSTANCE_AVAILABLE,
+                    operator: '+=',
+                    rhs: '42')),
     const Test(
         '''
         class C {
@@ -2319,9 +2516,7 @@
         }
         ''',
         const Visit(VisitKind.VISIT_THIS_PROPERTY_COMPOUND,
-            operator: '+=', rhs: '42',
-            getter: 'Selector(getter, a, arity=0)',
-            setter: 'Selector(setter, a, arity=1)')),
+            operator: '+=', name: 'a', rhs: '42')),
     const Test.clazz(
         '''
         class C {
@@ -2330,9 +2525,7 @@
         }
         ''',
         const Visit(VisitKind.VISIT_THIS_PROPERTY_COMPOUND,
-            operator: '+=', rhs: '42',
-            getter: 'Selector(getter, a, arity=0)',
-            setter: 'Selector(setter, a, arity=1)')),
+            name: 'a', operator: '+=', rhs: '42')),
     const Test.clazz(
         '''
         class B {
@@ -2633,9 +2826,7 @@
         ''',
         const [
           const Visit(VisitKind.VISIT_DYNAMIC_PROPERTY_PREFIX,
-              receiver: 'a', operator: '--',
-              getter: 'Selector(getter, b, arity=0)',
-              setter: 'Selector(setter, b, arity=1)'),
+              receiver: 'a', name: 'b', operator: '--'),
           const Visit(VisitKind.VISIT_PARAMETER_GET,
               element: 'parameter(m#a)')
         ]),
@@ -2732,6 +2923,16 @@
         ''',
         const Visit(VisitKind.VISIT_STATIC_FIELD_PREFIX,
             element: 'field(C#a)', operator: '--')),
+    const Test.clazz(
+        '''
+        class C {
+          var o;
+          static m() { ++o; }
+        }
+        ''',
+        const Visit(VisitKind.ERROR_INVALID_PREFIX,
+                    error: MessageKind.NO_INSTANCE_AVAILABLE,
+                    operator: '++')),
     const Test(
         '''
         class C {
@@ -2786,9 +2987,7 @@
         }
         ''',
         const Visit(VisitKind.VISIT_THIS_PROPERTY_PREFIX,
-            operator: '--',
-            getter: 'Selector(getter, a, arity=0)',
-            setter: 'Selector(setter, a, arity=1)')),
+            name: 'a', operator: '--')),
     const Test.clazz(
         '''
         class C {
@@ -2797,9 +2996,7 @@
         }
         ''',
         const Visit(VisitKind.VISIT_THIS_PROPERTY_PREFIX,
-            operator: '++',
-            getter: 'Selector(getter, a, arity=0)',
-            setter: 'Selector(setter, a, arity=1)')),
+            name: 'a', operator: '++')),
     const Test.clazz(
         '''
         class B {
@@ -3014,9 +3211,7 @@
         ''',
         const [
           const Visit(VisitKind.VISIT_DYNAMIC_PROPERTY_POSTFIX,
-              receiver: 'a', operator: '--',
-              getter: 'Selector(getter, b, arity=0)',
-              setter: 'Selector(setter, b, arity=1)'),
+              receiver: 'a', name: 'b', operator: '--'),
           const Visit(VisitKind.VISIT_PARAMETER_GET,
               element: 'parameter(m#a)')
         ]),
@@ -3113,6 +3308,16 @@
         ''',
         const Visit(VisitKind.VISIT_STATIC_FIELD_POSTFIX,
             element: 'field(C#a)', operator: '--')),
+    const Test.clazz(
+        '''
+        class C {
+          var o;
+          static m() { o--; }
+        }
+        ''',
+        const Visit(VisitKind.ERROR_INVALID_POSTFIX,
+                    error: MessageKind.NO_INSTANCE_AVAILABLE,
+                    operator: '--')),
     const Test(
         '''
         class C {
@@ -3167,9 +3372,7 @@
         }
         ''',
         const Visit(VisitKind.VISIT_THIS_PROPERTY_POSTFIX,
-            operator: '--',
-            getter: 'Selector(getter, a, arity=0)',
-            setter: 'Selector(setter, a, arity=1)')),
+            name: 'a', operator: '--')),
     const Test.clazz(
         '''
         class C {
@@ -3178,9 +3381,7 @@
         }
         ''',
         const Visit(VisitKind.VISIT_THIS_PROPERTY_POSTFIX,
-            operator: '++',
-            getter: 'Selector(getter, a, arity=0)',
-            setter: 'Selector(setter, a, arity=1)')),
+            name: 'a', operator: '++')),
     const Test.clazz(
         '''
         class B {
@@ -3698,15 +3899,9 @@
         }
         m(a) => C?.b;
         ''',
-        const [
-          const Visit(
-              VisitKind.VISIT_IF_NOT_NULL_DYNAMIC_PROPERTY_GET,
-              receiver: 'C',
-              name: 'b'),
-          const Visit(
-              VisitKind.VISIT_CLASS_TYPE_LITERAL_GET,
-              constant: 'C'),
-        ]),
+        const Visit(
+            VisitKind.VISIT_STATIC_FIELD_GET,
+            element: 'field(C#b)')),
     const Test(
         '''
         m(a) => a?.b = 42;
@@ -3742,10 +3937,7 @@
         const [
           const Visit(
               VisitKind.VISIT_IF_NOT_NULL_DYNAMIC_PROPERTY_PREFIX,
-              receiver: 'a',
-              getter: 'Selector(getter, b, arity=0)',
-              setter: 'Selector(setter, b, arity=1)',
-              operator: '++'),
+              receiver: 'a', name: 'b', operator: '++'),
           const Visit(
               VisitKind.VISIT_PARAMETER_GET,
               element: 'parameter(m#a)'),
@@ -3757,10 +3949,7 @@
         const [
           const Visit(
               VisitKind.VISIT_IF_NOT_NULL_DYNAMIC_PROPERTY_POSTFIX,
-              receiver: 'a',
-              getter: 'Selector(getter, b, arity=0)',
-              setter: 'Selector(setter, b, arity=1)',
-              operator: '--'),
+              receiver: 'a', name: 'b', operator: '--'),
           const Visit(
               VisitKind.VISIT_PARAMETER_GET,
               element: 'parameter(m#a)'),
@@ -3772,11 +3961,19 @@
         const [
           const Visit(
               VisitKind.VISIT_IF_NOT_NULL_DYNAMIC_PROPERTY_COMPOUND,
-              receiver: 'a',
-              getter: 'Selector(getter, b, arity=0)',
-              setter: 'Selector(setter, b, arity=1)',
-              operator: '*=',
-              rhs: '42'),
+              receiver: 'a', name: 'b', operator: '*=', rhs: '42'),
+          const Visit(
+              VisitKind.VISIT_PARAMETER_GET,
+              element: 'parameter(m#a)'),
+        ]),
+    const Test(
+        '''
+        m(a) => a?.b ??= 42;
+        ''',
+        const [
+          const Visit(
+              VisitKind.VISIT_IF_NOT_NULL_DYNAMIC_PROPERTY_SET_IF_NULL,
+              receiver: 'a', name: 'b', rhs: '42'),
           const Visit(
               VisitKind.VISIT_PARAMETER_GET,
               element: 'parameter(m#a)'),
@@ -3800,9 +3997,464 @@
         m(a) => a ??= 42;
         ''',
         const Visit(
-            VisitKind.VISIT_PARAMETER_COMPOUND,
+            VisitKind.VISIT_PARAMETER_SET_IF_NULL,
             element: 'parameter(m#a)',
-            operator: '??=',
             rhs: '42')),
+    const Test.prefix(
+        '''
+        var o;
+        ''',
+        'm() => p?.o;',
+        const Visit(VisitKind.ERROR_INVALID_GET,
+            error: MessageKind.PREFIX_AS_EXPRESSION)),
+  ],
+  'Set if null': const [
+    const Test(
+        '''
+        m(a) => a.b ??= 42;
+        ''',
+        const [
+          const Visit(VisitKind.VISIT_DYNAMIC_PROPERTY_SET_IF_NULL,
+              receiver: 'a', name: 'b', rhs: '42'),
+          const Visit(VisitKind.VISIT_PARAMETER_GET,
+              element: 'parameter(m#a)')
+        ]),
+    const Test(
+        '''
+        m(a) => a ??= 42;
+        ''',
+        const Visit(VisitKind.VISIT_PARAMETER_SET_IF_NULL,
+            element: 'parameter(m#a)', rhs: '42')),
+    const Test(
+        '''
+        m(final a) => a ??= 42;
+        ''',
+        const Visit(VisitKind.VISIT_FINAL_PARAMETER_SET_IF_NULL,
+            element: 'parameter(m#a)', rhs: '42')),
+    const Test(
+        '''
+        m() {
+          var a;
+          a ??= 42;
+        }
+        ''',
+        const Visit(VisitKind.VISIT_LOCAL_VARIABLE_SET_IF_NULL,
+            element: 'variable(m#a)', rhs: '42')),
+    const Test(
+        '''
+        m() {
+          final a = 0;
+          a ??= 42;
+        }
+        ''',
+        const Visit(VisitKind.VISIT_FINAL_LOCAL_VARIABLE_SET_IF_NULL,
+            element: 'variable(m#a)', rhs: '42')),
+    const Test(
+        '''
+        m() {
+          a() {}
+          a ??= 42;
+        }
+        ''',
+        const Visit(VisitKind.VISIT_LOCAL_FUNCTION_SET_IF_NULL,
+            element: 'function(m#a)', rhs: '42')),
+    const Test(
+        '''
+        var a;
+        m() => a ??= 42;
+        ''',
+        const Visit(VisitKind.VISIT_TOP_LEVEL_FIELD_SET_IF_NULL,
+            element: 'field(a)', rhs: '42')),
+    const Test(
+        '''
+        get a => 0;
+        set a(_) {}
+        m() => a ??= 42;
+        ''',
+        const Visit(VisitKind.VISIT_TOP_LEVEL_GETTER_SETTER_SET_IF_NULL,
+            getter: 'getter(a)', setter: 'setter(a)',
+            rhs: '42')),
+    const Test(
+        '''
+        class C {
+          static var a;
+        }
+        m() => C.a ??= 42;
+        ''',
+        const Visit(VisitKind.VISIT_STATIC_FIELD_SET_IF_NULL,
+            element: 'field(C#a)', rhs: '42')),
+    const Test.clazz(
+        '''
+        class C {
+          static var a;
+          m() => C.a ??= 42;
+        }
+        ''',
+        const Visit(VisitKind.VISIT_STATIC_FIELD_SET_IF_NULL,
+            element: 'field(C#a)', rhs: '42')),
+    const Test.clazz(
+        '''
+        class C {
+          static var a;
+          m() => a ??= 42;
+        }
+        ''',
+        const Visit(VisitKind.VISIT_STATIC_FIELD_SET_IF_NULL,
+            element: 'field(C#a)', rhs: '42')),
+    const Test.prefix(
+        '''
+        class C {
+          static var a;
+        }
+        ''',
+        '''
+        m() => p.C.a ??= 42;
+        ''',
+        const Visit(VisitKind.VISIT_STATIC_FIELD_SET_IF_NULL,
+            element: 'field(C#a)', rhs: '42')),
+    const Test.clazz(
+        '''
+        class C {
+          var o;
+          static m() { o ??= 42; }
+        }
+        ''',
+        const Visit(VisitKind.ERROR_INVALID_SET_IF_NULL,
+                    error: MessageKind.NO_INSTANCE_AVAILABLE,
+                    rhs: '42')),
+    const Test(
+        '''
+        class C {
+          static get a => 0;
+          static set a(_) {}
+        }
+        m() => C.a ??= 42;
+        ''',
+        const Visit(VisitKind.VISIT_STATIC_GETTER_SETTER_SET_IF_NULL,
+            getter: 'getter(C#a)', setter: 'setter(C#a)',
+            rhs: '42')),
+    const Test.clazz(
+        '''
+        class C {
+          static get a => 0;
+          static set a(_) {}
+          m() => C.a ??= 42;
+        }
+        ''',
+        const Visit(VisitKind.VISIT_STATIC_GETTER_SETTER_SET_IF_NULL,
+            getter: 'getter(C#a)', setter: 'setter(C#a)',
+            rhs: '42')),
+    const Test.clazz(
+        '''
+        class C {
+          static get a => 0;
+          static set a(_) {}
+          m() => a ??= 42;
+        }
+        ''',
+        const Visit(VisitKind.VISIT_STATIC_GETTER_SETTER_SET_IF_NULL,
+            getter: 'getter(C#a)', setter: 'setter(C#a)',
+            rhs: '42')),
+    const Test.prefix(
+        '''
+        class C {
+          static get a => 0;
+          static set a(_) {}
+        }
+        ''',
+        '''
+        m() => p.C.a ??= 42;
+        ''',
+        const Visit(VisitKind.VISIT_STATIC_GETTER_SETTER_SET_IF_NULL,
+            getter: 'getter(C#a)', setter: 'setter(C#a)',
+            rhs: '42')),
+    // TODO(johnniwinther): Enable these when dart2js supports method and setter
+    // with the same name.
+    /*const Test(
+        '''
+        class C {
+          static a() {}
+          static set a(_) {}
+        }
+        m() => C.a ??= 42;
+        ''',
+        const Visit(VisitKind.VISIT_STATIC_METHOD_SETTER_SET_IF_NULL,
+            getter: 'function(C#a)', setter: 'setter(C#a)',
+            rhs: '42')),
+    const Test.clazz(
+        '''
+        class C {
+          static a() {}
+          static set a(_) {}
+          m() => C.a ??= 42;
+        }
+        ''',
+        const Visit(VisitKind.VISIT_STATIC_METHOD_SETTER_SET_IF_NULL,
+            getter: 'function(C#a)', setter: 'setter(C#a)',
+            rhs: '42')),
+    const Test.clazz(
+        '''
+        class C {
+          static a() {}
+          static set a(_) {}
+          m() => a ??= 42;
+        }
+        ''',
+        const Visit(VisitKind.VISIT_STATIC_METHOD_SETTER_SET_IF_NULL,
+            getter: 'function(C#a)', setter: 'setter(C#a)',
+            rhs: '42')),
+    const Test.prefix(
+        '''
+        class C {
+          static a() {}
+          static set a(_) {}
+        }
+        ''',
+        '''
+        m() => p.C.a ??= 42;
+        ''',
+        const Visit(VisitKind.VISIT_STATIC_METHOD_SETTER_SET_IF_NULL,
+            getter: 'function(C#a)', setter: 'setter(C#a)',
+            rhs: '42')),*/
+    const Test.clazz(
+        '''
+        class C {
+          var a;
+          m() => a ??= 42;
+        }
+        ''',
+        const Visit(VisitKind.VISIT_THIS_PROPERTY_SET_IF_NULL,
+            name: 'a', rhs: '42')),
+    const Test.clazz(
+        '''
+        class C {
+          var a = 0;
+          m() => this.a ??= 42;
+        }
+        ''',
+        const Visit(VisitKind.VISIT_THIS_PROPERTY_SET_IF_NULL,
+            name: 'a', rhs: '42')),
+    const Test.clazz(
+        '''
+        class B {
+          var a = 0;
+        }
+        class C extends B {
+          m() => super.a ??= 42;
+        }
+        ''',
+        const Visit(VisitKind.VISIT_SUPER_FIELD_SET_IF_NULL,
+            element: 'field(B#a)', rhs: '42')),
+    const Test.clazz(
+        '''
+        class B {
+          final a = 0;
+        }
+        class C extends B {
+          m() => super.a ??= 42;
+        }
+        ''',
+        const Visit(VisitKind.VISIT_SUPER_FINAL_FIELD_SET_IF_NULL,
+            element: 'field(B#a)', rhs: '42')),
+    const Test.clazz(
+        '''
+        class B {
+          get a => 0;
+          set a (_) {}
+        }
+        class C extends B {
+          m() => super.a ??= 42;
+        }
+        ''',
+        const Visit(VisitKind.VISIT_SUPER_GETTER_SETTER_SET_IF_NULL,
+            getter: 'getter(B#a)', setter: 'setter(B#a)',
+            rhs: '42')),
+    const Test.clazz(
+        '''
+        class A {
+          get a => 0;
+        }
+        class B extends A {
+          set a (_) {}
+        }
+        class C extends B {
+          m() => super.a ??= 42;
+        }
+        ''',
+        const Visit(VisitKind.VISIT_SUPER_GETTER_SETTER_SET_IF_NULL,
+            getter: 'getter(A#a)', setter: 'setter(B#a)',
+            rhs: '42')),
+    const Test.clazz(
+        '''
+        class A {
+          var a;
+        }
+        class B extends A {
+          get a => 0;
+        }
+
+        class C extends B {
+          m() => super.a ??= 42;
+        }
+        ''',
+        const Visit(VisitKind.VISIT_SUPER_GETTER_FIELD_SET_IF_NULL,
+            getter: 'getter(B#a)', setter: 'field(A#a)',
+            rhs: '42')),
+    const Test.clazz(
+        '''
+        class A {
+          var a;
+        }
+        class B extends A {
+          set a(_) {}
+        }
+
+        class C extends B {
+          m() => super.a ??= 42;
+        }
+        ''',
+        const Visit(VisitKind.VISIT_SUPER_FIELD_SETTER_SET_IF_NULL,
+            getter: 'field(A#a)', setter: 'setter(B#a)',
+            rhs: '42')),
+    // TODO(johnniwinther): Enable this when dart2js supports shadow setters.
+    /*const Test.clazz(
+        '''
+        class A {
+          var a;
+        }
+        class B extends A {
+          final a = 0;
+        }
+
+        class C extends B {
+          m() => super.a ??= 42;
+        }
+        ''',
+        const Visit(VisitKind.VISIT_SUPER_FIELD_FIELD_SET_IF_NULL,
+            getter: 'field(B#a)', setter: 'field(A#a)',
+            rhs: '42')),*/
+    const Test.clazz(
+        '''
+        class B {
+          a() {}
+        }
+        class C extends B {
+          m() => super.a ??= 42;
+        }
+        ''',
+        const Visit(VisitKind.VISIT_SUPER_METHOD_SET_IF_NULL,
+            element: 'function(B#a)',
+            rhs: '42')),
+    const Test.clazz(
+        '''
+        class B {
+        }
+        class C extends B {
+          m() => super.a ??= 42;
+        }
+        ''',
+        const Visit(VisitKind.VISIT_UNRESOLVED_SUPER_SET_IF_NULL,
+            name: 'a', rhs: '42')),
+    const Test.clazz(
+        '''
+        class B {
+          set a(_) {}
+        }
+        class C extends B {
+          m() => super.a ??= 42;
+        }
+        ''',
+        const Visit(VisitKind.VISIT_UNRESOLVED_SUPER_GETTER_SET_IF_NULL,
+            setter: 'setter(B#a)', rhs: '42')),
+    const Test.clazz(
+        '''
+        class B {
+          get a => 42;
+        }
+        class C extends B {
+          m() => super.a ??= 42;
+        }
+        ''',
+        const Visit(VisitKind.VISIT_UNRESOLVED_SUPER_SETTER_SET_IF_NULL,
+            getter: 'getter(B#a)', rhs: '42')),
+
+    const Test.clazz(
+        '''
+        class C {
+          static set a(var value) { }
+          m() => a ??= 42;
+        }
+        ''',
+        const Visit(VisitKind.VISIT_UNRESOLVED_STATIC_GETTER_SET_IF_NULL,
+            setter: 'setter(C#a)', rhs: '42')),
+
+    const Test.clazz(
+        '''
+        class C {
+          static get a => 42;
+          m() => C.a ??= 42;
+        }
+        ''',
+        const Visit(VisitKind.VISIT_UNRESOLVED_STATIC_SETTER_SET_IF_NULL,
+            getter: 'getter(C#a)', rhs: '42')),
+
+    const Test.clazz(
+        '''
+        class C {
+          static final a = 42;
+          m() => C.a ??= 42;
+        }
+        ''',
+        const Visit(VisitKind.VISIT_STATIC_FINAL_FIELD_SET_IF_NULL,
+            element: 'field(C#a)', rhs: '42')),
+
+    const Test(
+        '''
+        class C {
+          static a(var value) { }
+        }
+        m() => C.a ??= 42;
+        ''',
+        const Visit(VisitKind.VISIT_STATIC_METHOD_SET_IF_NULL,
+            element: 'function(C#a)', rhs: '42')),
+
+    const Test(
+        '''
+        set a(var value) { }
+        m() => a ??= 42;
+        ''',
+        const Visit(VisitKind.VISIT_UNRESOLVED_TOP_LEVEL_GETTER_SET_IF_NULL,
+            setter: 'setter(a)', rhs: '42')),
+
+    const Test(
+        '''
+        get a => 42;
+        m() => a ??= 42;
+        ''',
+        const Visit(VisitKind.VISIT_UNRESOLVED_TOP_LEVEL_SETTER_SET_IF_NULL,
+            getter: 'getter(a)', rhs: '42')),
+
+    const Test(
+        '''
+        a(var value) { }
+        m() => a ??= 42;
+        ''',
+        const Visit(VisitKind.VISIT_TOP_LEVEL_METHOD_SET_IF_NULL,
+            element: 'function(a)', rhs: '42')),
+
+    const Test(
+        '''
+        final a = 42;
+        m() => a ??= 42;
+        ''',
+        const Visit(VisitKind.VISIT_TOP_LEVEL_FINAL_FIELD_SET_IF_NULL,
+            element: 'field(a)', rhs: '42')),
+
+    const Test(
+        '''
+        m() => unresolved ??= 42;
+        ''',
+        const Visit(VisitKind.VISIT_UNRESOLVED_SET_IF_NULL,
+            name: 'unresolved', rhs: '42')),
   ],
 };
diff --git a/tests/compiler/dart2js/semantic_visitor_test_send_visitor.dart b/tests/compiler/dart2js/semantic_visitor_test_send_visitor.dart
index 97531f3..0125b43 100644
--- a/tests/compiler/dart2js/semantic_visitor_test_send_visitor.dart
+++ b/tests/compiler/dart2js/semantic_visitor_test_send_visitor.dart
@@ -20,24 +20,6 @@
   }
 
   @override
-  visitAssert(
-      Send node,
-      Node expression,
-      arg) {
-    visits.add(new Visit(VisitKind.VISIT_ASSERT, expression: expression));
-    super.visitAssert(node, expression, arg);
-  }
-
-  @override
-  errorInvalidAssert(
-      Send node,
-      NodeList arguments,
-      arg) {
-    visits.add(new Visit(VisitKind.ERROR_INVALID_ASSERT, arguments: arguments));
-    super.errorInvalidAssert(node, arguments, arg);
-  }
-
-  @override
   errorInvalidCompound(
       Send node,
       ErroneousElement error,
@@ -105,6 +87,17 @@
   }
 
   @override
+  errorInvalidSetIfNull(
+      Send node,
+      ErroneousElement error,
+      Node rhs,
+      arg) {
+    visits.add(new Visit(VisitKind.ERROR_INVALID_SET_IF_NULL,
+        error: error.messageKind, rhs: rhs));
+    super.errorInvalidSetIfNull(node, error, rhs, arg);
+  }
+
+  @override
   errorInvalidUnary(
       Send node,
       UnaryOperator operator,
@@ -272,7 +265,7 @@
       ConstantExpression constant,
       Node rhs,
       arg) {
-    visits.add(new Visit(VisitKind.VISIT_CLASS_TYPE_LITERAL_INVOKE,
+    visits.add(new Visit(VisitKind.VISIT_CLASS_TYPE_LITERAL_SET,
         constant: constant.getText(), rhs: rhs));
     super.visitClassTypeLiteralSet(node, constant, rhs, arg);
   }
@@ -293,39 +286,35 @@
   visitDynamicPropertyPrefix(
       Send node,
       Node receiver,
+      Name name,
       IncDecOperator operator,
-      Selector getterSelector,
-      Selector setterSelector,
       arg) {
     visits.add(new Visit(VisitKind.VISIT_DYNAMIC_PROPERTY_PREFIX,
-        receiver: receiver, operator: operator,
-        getter: getterSelector, setter: setterSelector));
-    apply(receiver, arg);
+        receiver: receiver, operator: operator, name: name));
+    super.visitDynamicPropertyPrefix(node, receiver, name, operator, arg);
   }
 
   @override
   visitDynamicPropertyPostfix(
       Send node,
       Node receiver,
+      Name name,
       IncDecOperator operator,
-      Selector getterSelector,
-      Selector setterSelector,
       arg) {
     visits.add(new Visit(VisitKind.VISIT_DYNAMIC_PROPERTY_POSTFIX,
-        receiver: receiver, operator: operator,
-        getter: getterSelector, setter: setterSelector));
-    apply(receiver, arg);
+        receiver: receiver, operator: operator, name: name));
+    super.visitDynamicPropertyPostfix(node, receiver, name, operator, arg);
   }
 
   @override
   visitDynamicPropertyGet(
       Send node,
       Node receiver,
-      Selector selector,
+      Name name,
       arg) {
     visits.add(new Visit(VisitKind.VISIT_DYNAMIC_PROPERTY_GET,
-        receiver: receiver, name: selector.name));
-    apply(receiver, arg);
+        receiver: receiver, name: name));
+    super.visitDynamicPropertyGet(node, receiver, name, arg);
   }
 
   @override
@@ -337,20 +326,19 @@
       arg) {
     visits.add(new Visit(VisitKind.VISIT_DYNAMIC_PROPERTY_INVOKE,
         receiver: receiver, name: selector.name, arguments: arguments));
-    apply(receiver, arg);
-    apply(arguments, arg);
+    super.visitDynamicPropertyInvoke(node, receiver, arguments, selector, arg);
   }
 
   @override
   visitDynamicPropertySet(
       SendSet node,
       Node receiver,
-      Selector selector,
+      Name name,
       Node rhs,
       arg) {
     visits.add(new Visit(VisitKind.VISIT_DYNAMIC_PROPERTY_SET,
-        receiver: receiver, name: selector.name, rhs: rhs));
-    super.visitDynamicPropertySet(node, receiver, selector, rhs, arg);
+        receiver: receiver, name: name, rhs: rhs));
+    super.visitDynamicPropertySet(node, receiver, name, rhs, arg);
   }
 
   @override
@@ -380,7 +368,7 @@
       Node rhs,
       arg) {
     visits.add(new Visit(VisitKind.VISIT_DYNAMIC_TYPE_LITERAL_SET,
-        rhs: rhs));
+        constant: constant.getText(), rhs: rhs));
     super.visitDynamicTypeLiteralSet(node, constant, rhs, arg);
   }
 
@@ -389,7 +377,7 @@
       Send node,
       Node expression,
       NodeList arguments,
-      Selector selector,
+      CallStructure callStructure,
       arg) {
     visits.add(new Visit(VisitKind.VISIT_EXPRESSION_INVOKE,
         receiver: expression, arguments: arguments));
@@ -800,10 +788,11 @@
   @override
   visitThisPropertyGet(
       Send node,
-      Selector selector,
+      Name name,
       arg) {
     visits.add(new Visit(VisitKind.VISIT_THIS_PROPERTY_GET,
-                         name: selector.name));
+                         name: name));
+    super.visitThisPropertyGet(node, name, arg);
   }
 
   @override
@@ -814,18 +803,18 @@
       arg) {
     visits.add(new Visit(VisitKind.VISIT_THIS_PROPERTY_INVOKE,
                          name: selector.name, arguments: arguments));
-    apply(arguments, arg);
+    super.visitThisPropertyInvoke(node, arguments, selector, arg);
   }
 
   @override
   visitThisPropertySet(
       SendSet node,
-      Selector selector,
+      Name name,
       Node rhs,
       arg) {
     visits.add(new Visit(VisitKind.VISIT_THIS_PROPERTY_SET,
-                         name: selector.name, rhs: rhs));
-    apply(rhs, arg);
+                         name: name, rhs: rhs));
+    super.visitThisPropertySet(node, name, rhs, arg);
   }
 
   @override
@@ -1319,16 +1308,15 @@
   visitDynamicPropertyCompound(
       Send node,
       Node receiver,
+      Name name,
       AssignmentOperator operator,
       Node rhs,
-      Selector getterSelector,
-      Selector setterSelector,
       arg) {
     visits.add(new Visit(VisitKind.VISIT_DYNAMIC_PROPERTY_COMPOUND,
         receiver: receiver, operator: operator, rhs: rhs,
-        getter: getterSelector, setter: setterSelector));
-    apply(receiver, arg);
-    apply(rhs, arg);
+        name: name));
+    super.visitDynamicPropertyCompound(
+        node, receiver, name, operator, rhs, arg);
   }
 
   @override
@@ -1562,15 +1550,13 @@
   @override
   visitThisPropertyCompound(
       Send node,
+      Name name,
       AssignmentOperator operator,
       Node rhs,
-      Selector getterSelector,
-      Selector setterSelector,
       arg) {
     visits.add(new Visit(VisitKind.VISIT_THIS_PROPERTY_COMPOUND,
-        operator: operator, rhs: rhs,
-        getter: getterSelector, setter: setterSelector));
-    apply(rhs, arg);
+        name: name, operator: operator, rhs: rhs));
+    super.visitThisPropertyCompound(node, name, operator, rhs, arg);
   }
 
   @override
@@ -1983,13 +1969,12 @@
   @override
   visitThisPropertyPrefix(
       Send node,
+      Name name,
       IncDecOperator operator,
-      Selector getterSelector,
-      Selector setterSelector,
       arg) {
     visits.add(new Visit(VisitKind.VISIT_THIS_PROPERTY_PREFIX,
-        operator: operator,
-        getter: getterSelector, setter: setterSelector));
+        name: name, operator: operator));
+    super.visitThisPropertyPrefix(node, name, operator, arg);
   }
 
   @override
@@ -2204,13 +2189,12 @@
   @override
   visitThisPropertyPostfix(
       Send node,
+      Name name,
       IncDecOperator operator,
-      Selector getterSelector,
-      Selector setterSelector,
       arg) {
     visits.add(new Visit(VisitKind.VISIT_THIS_PROPERTY_POSTFIX,
-        operator: operator,
-        getter: getterSelector, setter: setterSelector));
+        name: name, operator: operator));
+    super.visitThisPropertyPostfix(node, name, operator, arg);
   }
 
   @override
@@ -3003,23 +2987,23 @@
   visitIfNotNullDynamicPropertyGet(
       Send node,
       Node receiver,
-      Selector selector,
+      Name name,
       arg) {
     visits.add(new Visit(VisitKind.VISIT_IF_NOT_NULL_DYNAMIC_PROPERTY_GET,
-        receiver: receiver, name: selector.name));
-    super.visitIfNotNullDynamicPropertyGet(node, receiver, selector, arg);
+        receiver: receiver, name: name));
+    super.visitIfNotNullDynamicPropertyGet(node, receiver, name, arg);
   }
 
   @override
   visitIfNotNullDynamicPropertySet(
       Send node,
       Node receiver,
-      Selector selector,
+      Name name,
       Node rhs,
       arg) {
     visits.add(new Visit(VisitKind.VISIT_IF_NOT_NULL_DYNAMIC_PROPERTY_SET,
-        receiver: receiver, name: selector.name, rhs: rhs));
-    super.visitIfNotNullDynamicPropertySet(node, receiver, selector, rhs, arg);
+        receiver: receiver, name: name, rhs: rhs));
+    super.visitIfNotNullDynamicPropertySet(node, receiver, name, rhs, arg);
   }
 
   @override
@@ -3039,46 +3023,40 @@
   visitIfNotNullDynamicPropertyPrefix(
       Send node,
       Node receiver,
+      Name name,
       IncDecOperator operator,
-      Selector getterSelector,
-      Selector setterSelector,
       arg) {
     visits.add(new Visit(VisitKind.VISIT_IF_NOT_NULL_DYNAMIC_PROPERTY_PREFIX,
-        receiver: receiver, operator: operator,
-        getter: getterSelector, setter: setterSelector));
+        receiver: receiver, name: name, operator: operator));
     super.visitIfNotNullDynamicPropertyPrefix(
-        node, receiver, operator, getterSelector, setterSelector, arg);
+        node, receiver, name, operator, arg);
   }
 
   @override
   visitIfNotNullDynamicPropertyPostfix(
       Send node,
       Node receiver,
+      Name name,
       IncDecOperator operator,
-      Selector getterSelector,
-      Selector setterSelector,
       arg) {
     visits.add(new Visit(VisitKind.VISIT_IF_NOT_NULL_DYNAMIC_PROPERTY_POSTFIX,
-        receiver: receiver, operator: operator,
-        getter: getterSelector, setter: setterSelector));
+        receiver: receiver, name: name, operator: operator));
     super.visitIfNotNullDynamicPropertyPostfix(
-        node, receiver, operator, getterSelector, setterSelector, arg);
+        node, receiver, name, operator, arg);
   }
 
   @override
   visitIfNotNullDynamicPropertyCompound(
       Send node,
       Node receiver,
+      Name name,
       AssignmentOperator operator,
       Node rhs,
-      Selector getterSelector,
-      Selector setterSelector,
       arg) {
     visits.add(new Visit(VisitKind.VISIT_IF_NOT_NULL_DYNAMIC_PROPERTY_COMPOUND,
-        receiver: receiver, operator: operator, rhs: rhs,
-        getter: getterSelector, setter: setterSelector));
+        receiver: receiver, name: name, operator: operator, rhs: rhs));
     super.visitIfNotNullDynamicPropertyCompound(
-        node, receiver, operator, rhs, getterSelector, setterSelector, arg);
+        node, receiver, name, operator, rhs, arg);
   }
 
   @override
@@ -3120,4 +3098,446 @@
       arg) {
     visits.add(new Visit(VisitKind.PREVISIT_DEFERRED_ACCESS, element: prefix));
   }
+
+  @override
+  visitClassTypeLiteralSetIfNull(
+      Send node,
+      ConstantExpression constant,
+      Node rhs,
+      arg) {
+    visits.add(new Visit(VisitKind.VISIT_CLASS_TYPE_LITERAL_SET_IF_NULL,
+        constant: constant.getText(), rhs: rhs));
+    super.visitClassTypeLiteralSetIfNull(node, constant, rhs, arg);
+  }
+
+  @override
+  visitDynamicPropertySetIfNull(
+      Send node,
+      Node receiver,
+      Name name,
+      Node rhs,
+      arg) {
+    visits.add(new Visit(VisitKind.VISIT_DYNAMIC_PROPERTY_SET_IF_NULL,
+        receiver: receiver, name: name, rhs: rhs));
+    super.visitDynamicPropertySetIfNull(node, receiver, name, rhs, arg);
+  }
+
+  @override
+  visitDynamicTypeLiteralSetIfNull(
+      Send node,
+      ConstantExpression constant,
+      Node rhs,
+      arg) {
+    visits.add(new Visit(VisitKind.VISIT_DYNAMIC_TYPE_LITERAL_SET_IF_NULL,
+        constant: constant.getText(), rhs: rhs));
+    super.visitDynamicTypeLiteralSetIfNull(node, constant, rhs, arg);
+  }
+
+  @override
+  visitFinalLocalVariableSetIfNull(
+      Send node,
+      LocalVariableElement variable,
+      Node rhs,
+      arg) {
+    visits.add(new Visit(VisitKind.VISIT_FINAL_LOCAL_VARIABLE_SET_IF_NULL,
+        element: variable, rhs: rhs));
+    super.visitFinalLocalVariableSetIfNull(node, variable, rhs, arg);
+  }
+
+  @override
+  visitFinalParameterSetIfNull(
+      Send node,
+      ParameterElement parameter,
+      Node rhs,
+      arg) {
+    visits.add(new Visit(VisitKind.VISIT_FINAL_PARAMETER_SET_IF_NULL,
+        element: parameter, rhs: rhs));
+    super.visitFinalParameterSetIfNull(node, parameter, rhs, arg);
+  }
+
+  @override
+  visitFinalStaticFieldSetIfNull(
+      Send node,
+      FieldElement field,
+      Node rhs,
+      arg) {
+    visits.add(new Visit(VisitKind.VISIT_STATIC_FINAL_FIELD_SET_IF_NULL,
+        element: field, rhs: rhs));
+    super.visitFinalStaticFieldSetIfNull(node, field, rhs, arg);
+  }
+
+  @override
+  visitFinalSuperFieldSetIfNull(
+      Send node,
+      FieldElement field,
+      Node rhs,
+      arg) {
+    visits.add(new Visit(VisitKind.VISIT_SUPER_FINAL_FIELD_SET_IF_NULL,
+        element: field, rhs: rhs));
+    super.visitFinalSuperFieldSetIfNull(node, field, rhs, arg);
+  }
+
+  @override
+  visitFinalTopLevelFieldSetIfNull(
+      Send node,
+      FieldElement field,
+      Node rhs,
+      arg) {
+    visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_FINAL_FIELD_SET_IF_NULL,
+        element: field, rhs: rhs));
+    super.visitFinalTopLevelFieldSetIfNull(node, field, rhs, arg);
+  }
+
+  @override
+  visitIfNotNullDynamicPropertySetIfNull(
+      Send node,
+      Node receiver,
+      Name name,
+      Node rhs,
+      arg) {
+    visits.add(new Visit(
+        VisitKind.VISIT_IF_NOT_NULL_DYNAMIC_PROPERTY_SET_IF_NULL,
+        receiver: receiver, name: name, rhs: rhs));
+    super.visitIfNotNullDynamicPropertySetIfNull(
+        node, receiver, name, rhs, arg);
+  }
+
+  @override
+  visitLocalFunctionSetIfNull(
+      Send node,
+      LocalFunctionElement function,
+      Node rhs,
+      arg) {
+    visits.add(new Visit(VisitKind.VISIT_LOCAL_FUNCTION_SET_IF_NULL,
+        element: function, rhs: rhs));
+    super.visitLocalFunctionSetIfNull(node, function, rhs, arg);
+  }
+
+  @override
+  visitLocalVariableSetIfNull(
+      Send node,
+      LocalVariableElement variable,
+      Node rhs,
+      arg) {
+    visits.add(new Visit(VisitKind.VISIT_LOCAL_VARIABLE_SET_IF_NULL,
+        element: variable, rhs: rhs));
+    super.visitLocalVariableSetIfNull(node, variable, rhs, arg);
+  }
+
+  @override
+  visitParameterSetIfNull(
+      Send node,
+      ParameterElement parameter,
+      Node rhs,
+      arg) {
+    visits.add(new Visit(VisitKind.VISIT_PARAMETER_SET_IF_NULL,
+        element: parameter, rhs: rhs));
+    super.visitParameterSetIfNull(node, parameter, rhs, arg);
+  }
+
+  @override
+  visitStaticFieldSetIfNull(
+      Send node,
+      FieldElement field,
+      Node rhs,
+      arg) {
+    visits.add(new Visit(VisitKind.VISIT_STATIC_FIELD_SET_IF_NULL,
+        element: field, rhs: rhs));
+    super.visitStaticFieldSetIfNull(node, field, rhs, arg);
+  }
+
+  @override
+  visitStaticGetterSetterSetIfNull(
+      Send node,
+      FunctionElement getter,
+      FunctionElement setter,
+      Node rhs,
+      arg) {
+    visits.add(new Visit(VisitKind.VISIT_STATIC_GETTER_SETTER_SET_IF_NULL,
+        getter: getter, setter: setter, rhs: rhs));
+    super.visitStaticGetterSetterSetIfNull(node, getter, setter, rhs, arg);
+  }
+
+  @override
+  visitStaticMethodSetIfNull(
+      Send node,
+      FunctionElement method,
+      Node rhs,
+      arg) {
+    visits.add(new Visit(VisitKind.VISIT_STATIC_METHOD_SET_IF_NULL,
+        element: method, rhs: rhs));
+    super.visitStaticMethodSetIfNull(node, method, rhs, arg);
+  }
+
+  @override
+  visitStaticMethodSetterSetIfNull(
+      Send node,
+      MethodElement method,
+      MethodElement setter,
+      Node rhs,
+      arg) {
+    visits.add(new Visit(VisitKind.VISIT_STATIC_METHOD_SETTER_SET_IF_NULL,
+        getter: method, setter: setter, rhs: rhs));
+    super.visitStaticMethodSetterSetIfNull(node, method, setter, rhs, arg);
+  }
+
+  @override
+  visitSuperFieldFieldSetIfNull(
+      Send node,
+      FieldElement readField,
+      FieldElement writtenField,
+      Node rhs,
+      arg) {
+    visits.add(new Visit(VisitKind.VISIT_SUPER_FIELD_FIELD_SET_IF_NULL,
+        getter: readField, setter: writtenField, rhs: rhs));
+    super.visitSuperFieldFieldSetIfNull(
+        node, readField, writtenField, rhs, arg);
+  }
+
+  @override
+  visitSuperFieldSetIfNull(
+      Send node,
+      FieldElement field,
+      Node rhs,
+      arg) {
+    visits.add(new Visit(VisitKind.VISIT_SUPER_FIELD_SET_IF_NULL,
+        element: field, rhs: rhs));
+    super.visitSuperFieldSetIfNull(node, field, rhs, arg);
+  }
+
+  @override
+  visitSuperFieldSetterSetIfNull(
+      Send node,
+      FieldElement field,
+      FunctionElement setter,
+      Node rhs,
+      arg) {
+    visits.add(new Visit(VisitKind.VISIT_SUPER_FIELD_SETTER_SET_IF_NULL,
+        getter: field, setter: setter, rhs: rhs));
+    super.visitSuperFieldSetterSetIfNull(node, field, setter, rhs, arg);
+  }
+
+  @override
+  visitSuperGetterFieldSetIfNull(
+      Send node,
+      FunctionElement getter,
+      FieldElement field,
+      Node rhs,
+      arg) {
+    visits.add(new Visit(VisitKind.VISIT_SUPER_GETTER_FIELD_SET_IF_NULL,
+        getter: getter, setter: field, rhs: rhs));
+    super.visitSuperGetterFieldSetIfNull(node, getter, field, rhs, arg);
+  }
+
+  @override
+  visitSuperGetterSetterSetIfNull(
+      Send node,
+      FunctionElement getter,
+      FunctionElement setter,
+      Node rhs,
+      arg) {
+    visits.add(new Visit(VisitKind.VISIT_SUPER_GETTER_SETTER_SET_IF_NULL,
+        getter: getter, setter: setter, rhs: rhs));
+    super.visitSuperGetterSetterSetIfNull(node, getter, setter, rhs, arg);
+  }
+
+  @override
+  visitSuperMethodSetIfNull(
+      Send node,
+      FunctionElement method,
+      Node rhs,
+      arg) {
+    visits.add(new Visit(VisitKind.VISIT_SUPER_METHOD_SET_IF_NULL,
+        element: method, rhs: rhs));
+    super.visitSuperMethodSetIfNull(node, method, rhs, arg);
+  }
+
+  @override
+  visitSuperMethodSetterSetIfNull(
+      Send node,
+      FunctionElement method,
+      FunctionElement setter,
+      Node rhs,
+      arg) {
+    visits.add(new Visit(VisitKind.VISIT_SUPER_METHOD_SETTER_SET_IF_NULL,
+        getter: method, setter: setter, rhs: rhs));
+    super.visitSuperMethodSetterSetIfNull(node, method, setter, rhs, arg);
+  }
+
+  @override
+  visitThisPropertySetIfNull(
+      Send node,
+      Name name,
+      Node rhs,
+      arg) {
+    visits.add(new Visit(VisitKind.VISIT_THIS_PROPERTY_SET_IF_NULL,
+        name: name, rhs: rhs));
+    super.visitThisPropertySetIfNull(node, name, rhs, arg);
+  }
+
+  @override
+  visitTopLevelFieldSetIfNull(
+      Send node,
+      FieldElement field,
+      Node rhs,
+      arg) {
+    visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_FIELD_SET_IF_NULL,
+        element: field, rhs: rhs));
+    super.visitTopLevelFieldSetIfNull(node, field, rhs, arg);
+  }
+
+  @override
+  visitTopLevelGetterSetterSetIfNull(
+      Send node,
+      FunctionElement getter,
+      FunctionElement setter,
+      Node rhs,
+      arg) {
+    visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_GETTER_SETTER_SET_IF_NULL,
+        getter: getter, setter: setter, rhs: rhs));
+    super.visitTopLevelGetterSetterSetIfNull(node, getter, setter, rhs, arg);
+  }
+
+  @override
+  visitTopLevelMethodSetIfNull(
+      Send node,
+      FunctionElement method,
+      Node rhs,
+      arg) {
+    visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_METHOD_SET_IF_NULL,
+        element: method, rhs: rhs));
+    super.visitTopLevelMethodSetIfNull(node, method, rhs, arg);
+  }
+
+  @override
+  visitTopLevelMethodSetterSetIfNull(
+      Send node,
+      FunctionElement method,
+      FunctionElement setter,
+      Node rhs,
+      arg) {
+    visits.add(new Visit(VisitKind.VISIT_TOP_LEVEL_METHOD_SETTER_SET_IF_NULL,
+        getter: method, setter: setter, rhs: rhs));
+    super.visitTopLevelMethodSetterSetIfNull(node, method, setter, rhs, arg);
+  }
+
+  @override
+  visitTypeVariableTypeLiteralSetIfNull(
+      Send node,
+      TypeVariableElement element,
+      Node rhs,
+      arg) {
+    visits.add(new Visit(VisitKind.VISIT_TYPE_VARIABLE_TYPE_LITERAL_SET_IF_NULL,
+        element: element, rhs: rhs));
+    super.visitTypeVariableTypeLiteralSetIfNull(node, element, rhs, arg);
+  }
+
+  @override
+  visitTypedefTypeLiteralSetIfNull(
+      Send node,
+      ConstantExpression constant,
+      Node rhs,
+      arg) {
+    visits.add(new Visit(VisitKind.VISIT_TYPEDEF_TYPE_LITERAL_SET_IF_NULL,
+        constant: constant.getText(), rhs: rhs));
+    super.visitTypedefTypeLiteralSetIfNull(node, constant, rhs, arg);
+  }
+
+  @override
+  visitUnresolvedSetIfNull(
+      Send node,
+      Element element,
+      Node rhs,
+      arg) {
+    visits.add(new Visit(VisitKind.VISIT_UNRESOLVED_SET_IF_NULL,
+        name: element.name, rhs: rhs));
+    super.visitUnresolvedSetIfNull(node, element, rhs, arg);
+  }
+
+  @override
+  visitUnresolvedStaticGetterSetIfNull(
+      Send node,
+      Element element,
+      MethodElement setter,
+      Node rhs,
+      arg) {
+    visits.add(new Visit(VisitKind.VISIT_UNRESOLVED_STATIC_GETTER_SET_IF_NULL,
+        setter: setter, rhs: rhs));
+    super.visitUnresolvedStaticGetterSetIfNull(node, element, setter, rhs, arg);
+  }
+
+  @override
+  visitUnresolvedStaticSetterSetIfNull(
+      Send node,
+      MethodElement getter,
+      Element element,
+      Node rhs,
+      arg) {
+    visits.add(new Visit(VisitKind.VISIT_UNRESOLVED_STATIC_SETTER_SET_IF_NULL,
+        getter: getter, rhs: rhs));
+    super.visitUnresolvedStaticSetterSetIfNull(node, getter, element, rhs, arg);
+  }
+
+  @override
+  visitUnresolvedSuperGetterSetIfNull(
+      Send node,
+      Element element,
+      MethodElement setter,
+      Node rhs,
+      arg) {
+    visits.add(new Visit(VisitKind.VISIT_UNRESOLVED_SUPER_GETTER_SET_IF_NULL,
+        setter: setter, rhs: rhs));
+    super.visitUnresolvedSuperGetterSetIfNull(node, element, setter, rhs, arg);
+  }
+
+  @override
+  visitUnresolvedSuperSetIfNull(
+      Send node,
+      Element element,
+      Node rhs,
+      arg) {
+    visits.add(new Visit(VisitKind.VISIT_UNRESOLVED_SUPER_SET_IF_NULL,
+        name: element.name, rhs: rhs));
+    super.visitUnresolvedSuperSetIfNull(node, element, rhs, arg);
+  }
+
+  @override
+  visitUnresolvedSuperSetterSetIfNull(
+      Send node,
+      MethodElement getter,
+      Element element,
+      Node rhs,
+      arg) {
+    visits.add(new Visit(VisitKind.VISIT_UNRESOLVED_SUPER_SETTER_SET_IF_NULL,
+        getter: getter, rhs: rhs));
+    super.visitUnresolvedSuperSetterSetIfNull(node, getter, element, rhs, arg);
+  }
+
+  @override
+  visitUnresolvedTopLevelGetterSetIfNull(
+      Send node,
+      Element element,
+      MethodElement setter,
+      Node rhs,
+      arg) {
+    visits.add(new Visit(
+        VisitKind.VISIT_UNRESOLVED_TOP_LEVEL_GETTER_SET_IF_NULL,
+        setter: setter, rhs: rhs));
+    super.visitUnresolvedTopLevelGetterSetIfNull(
+        node, element, setter, rhs, arg);
+  }
+
+  @override
+  visitUnresolvedTopLevelSetterSetIfNull(
+      Send node,
+      MethodElement getter,
+      Element element,
+      Node rhs,
+      arg) {
+    visits.add(new Visit(
+        VisitKind.VISIT_UNRESOLVED_TOP_LEVEL_SETTER_SET_IF_NULL,
+        getter: getter, rhs: rhs));
+    super.visitUnresolvedTopLevelSetterSetIfNull(
+        node, getter, element, rhs, arg);
+  }
 }
diff --git a/tests/compiler/dart2js/serialization_analysis_test.dart b/tests/compiler/dart2js/serialization_analysis_test.dart
index 147c82b..445ea45 100644
--- a/tests/compiler/dart2js/serialization_analysis_test.dart
+++ b/tests/compiler/dart2js/serialization_analysis_test.dart
@@ -7,12 +7,14 @@
 import 'dart:async';
 import 'package:async_helper/async_helper.dart';
 import 'package:expect/expect.dart';
+import 'package:compiler/src/commandline_options.dart';
 import 'package:compiler/src/elements/elements.dart';
+import 'package:compiler/src/compiler.dart';
+import 'package:compiler/src/enqueue.dart';
+import 'package:compiler/src/filenames.dart';
 import 'package:compiler/src/serialization/serialization.dart';
 import 'package:compiler/src/serialization/json_serializer.dart';
 import 'package:compiler/src/serialization/task.dart';
-import 'package:compiler/src/dart2jslib.dart';
-import 'package:compiler/src/filenames.dart';
 import 'memory_compiler.dart';
 
 const List<Test> TESTS = const <Test>[
@@ -179,7 +181,7 @@
   await runCompiler(
       entryPoint: entryPoint,
       memorySourceFiles: test != null ? test.sourceFiles : const {},
-      options: ['--analyze-only', '--output-type=dart'],
+      options: [Flags.analyzeOnly, '--output-type=dart'],
       diagnosticHandler: diagnosticCollector,
       beforeRun: (Compiler compiler) {
         compiler.serialization.deserializer =
@@ -200,7 +202,7 @@
 }
 
 Future<String> serializeDartCore() async {
-  Compiler compiler = compilerFor({},
+  Compiler compiler = compilerFor(
       options: ['--analyze-all', '--output-type=dart']);
   await compiler.runCompiler(Uri.parse('dart:core'));
   return serialize(compiler.libraryLoader.libraries);
diff --git a/tests/compiler/dart2js/serialization_test.dart b/tests/compiler/dart2js/serialization_test.dart
index 5f4b19b..c913a3c 100644
--- a/tests/compiler/dart2js/serialization_test.dart
+++ b/tests/compiler/dart2js/serialization_test.dart
@@ -7,9 +7,11 @@
 import 'dart:io';
 import 'memory_compiler.dart';
 import 'package:async_helper/async_helper.dart';
+import 'package:compiler/src/constants/constructors.dart';
 import 'package:compiler/src/constants/expressions.dart';
 import 'package:compiler/src/dart_types.dart';
-import 'package:compiler/src/dart2jslib.dart';
+import 'package:compiler/src/compiler.dart';
+import 'package:compiler/src/diagnostics/invariant.dart';
 import 'package:compiler/src/elements/elements.dart';
 import 'package:compiler/src/elements/visitor.dart';
 import 'package:compiler/src/ordered_typeset.dart';
@@ -425,6 +427,26 @@
           element1.name, element2.name);
     visit(element1.functionDeclaration, element2.functionDeclaration);
   }
+
+  @override
+  void visitImportElement(ImportElement element1, ImportElement element2) {
+    visit(element1.importedLibrary, element2.importedLibrary);
+    visit(element1.library, element2.library);
+  }
+
+  @override
+  void visitExportElement(ExportElement element1, ExportElement element2) {
+    visit(element1.exportedLibrary, element2.exportedLibrary);
+    visit(element1.library, element2.library);
+  }
+
+  @override
+  void visitPrefixElement(PrefixElement element1, PrefixElement element2) {
+    check(element1, element2,
+          'name',
+          element1.name, element2.name);
+    visit(element1.library, element2.library);
+  }
 }
 
 /// Visitor that checks for equivalence of [Element] properties.
@@ -446,8 +468,8 @@
   void visitLibraryElement(LibraryElement element1, LibraryElement element2) {
     checkElementIdentities(null, null, null, element1, element2);
     check(element1, element2, 'name', element1.name, element2.name);
-    check(element1, element2, 'getLibraryName',
-          element1.getLibraryName(), element2.getLibraryName());
+    check(element1, element2, 'libraryName',
+          element1.libraryName, element2.libraryName);
     visitMembers(element1, element2);
     visit(element1.entryCompilationUnit, element2.entryCompilationUnit);
     checkElementLists(
@@ -455,18 +477,10 @@
         element1.compilationUnits.toList(),
         element2.compilationUnits.toList());
 
-    bool filterTags(LibraryTag tag) => tag.asLibraryDependency() != null;
-
-    List<LibraryTag> tags1 = element1.tags.where(filterTags).toList();
-    List<LibraryTag> tags2 = element2.tags.where(filterTags).toList();
-    checkListEquivalence(element1, element2, 'tags', tags1, tags2,
-        (Object object1, Object object2, String property,
-         LibraryDependency tag1, LibraryDependency tag2) {
-      checkElementIdentities(
-          tag1, tag2, 'getLibraryFromTag',
-          element1.getLibraryFromTag(tag1),
-          element2.getLibraryFromTag(tag2));
-    });
+    checkElementListIdentities(
+        element1, element2, 'imports', element1.imports, element2.imports);
+    checkElementListIdentities(
+        element1, element2, 'exports', element1.exports, element2.exports);
 
     List<Element> imports1 = <Element>[];
     List<Element> imports2 = <Element>[];
@@ -479,7 +493,7 @@
       imports2.add(import);
     });
     checkElementListIdentities(
-        element1, element2, 'imports', imports1, imports2);
+        element1, element2, 'importScope', imports1, imports2);
 
     List<Element> exports1 = <Element>[];
     List<Element> exports2 = <Element>[];
@@ -492,7 +506,7 @@
       exports2.add(export);
     });
     checkElementListIdentities(
-        element1, element2, 'exports', exports1, exports2);
+        element1, element2, 'exportScope', exports1, exports2);
   }
 
   @override
@@ -777,6 +791,39 @@
         element1, element2, 'fieldElement',
         element1.fieldElement, element2.fieldElement);
   }
+
+  @override
+  void visitImportElement(ImportElement element1, ImportElement element2) {
+    check(element1, element2, 'uri', element1.uri, element2.uri);
+    check(
+        element1, element2, 'isDeferred',
+        element1.isDeferred, element2.isDeferred);
+    checkElementProperties(
+        element1, element2, 'prefix',
+        element1.prefix, element2.prefix);
+    checkElementIdentities(
+        element1, element2, 'importedLibrary',
+        element1.importedLibrary, element2.importedLibrary);
+  }
+
+  @override
+  void visitExportElement(ExportElement element1, ExportElement element2) {
+    check(element1, element2, 'uri', element1.uri, element2.uri);
+    checkElementIdentities(
+        element1, element2, 'importedLibrary',
+        element1.exportedLibrary, element2.exportedLibrary);
+  }
+
+  @override
+  void visitPrefixElement(PrefixElement element1, PrefixElement element2) {
+    check(
+        element1, element2, 'isDeferred',
+        element1.isDeferred, element2.isDeferred);
+    checkElementIdentities(
+        element1, element2, 'importedLibrary',
+        element1.deferredImport, element2.deferredImport);
+    // TODO(johnniwinther): Check members.
+  }
 }
 
 /// Visitor that checks for equivalence of [DartType]s.
diff --git a/tests/compiler/dart2js/show_package_warnings_test.dart b/tests/compiler/dart2js/show_package_warnings_test.dart
index 5673032..e94983c 100644
--- a/tests/compiler/dart2js/show_package_warnings_test.dart
+++ b/tests/compiler/dart2js/show_package_warnings_test.dart
@@ -7,6 +7,7 @@
 import 'dart:async';
 import 'package:async_helper/async_helper.dart';
 import 'package:expect/expect.dart';
+import 'package:compiler/src/commandline_options.dart';
 import 'memory_compiler.dart';
 
 /// Error code that creates 1 warning, 1 hint, and 1 info.
@@ -47,9 +48,9 @@
              int warnings: 0,
              int hints: 0,
              int infos: 0}) async {
-  var options = ['--analyze-only', '--analyze-all'];
+  var options = [Flags.analyzeOnly, Flags.analyzeAll];
   if (showPackageWarnings) {
-    options.add('--show-package-warnings');
+    options.add(Flags.showPackageWarnings);
   }
   var collector = new DiagnosticCollector();
   await runCompiler(
diff --git a/tests/compiler/dart2js/side_effect_tdiv_regression_test.dart b/tests/compiler/dart2js/side_effect_tdiv_regression_test.dart
index 1cede18..59d30805 100644
--- a/tests/compiler/dart2js/side_effect_tdiv_regression_test.dart
+++ b/tests/compiler/dart2js/side_effect_tdiv_regression_test.dart
@@ -6,7 +6,6 @@
 import "package:async_helper/async_helper.dart";
 
 import 'compiler_helper.dart';
-import 'parser_helper.dart';
 
 const String TEST = r'''
 class A {
@@ -26,5 +25,5 @@
 void main() {
   asyncTest(() => compileAll(TEST).then((generated) {
     Expect.isTrue(generated.contains('return c + c;'));
-  }));  
+  }));
 }
diff --git a/tests/compiler/dart2js/simple_inferrer_callers_test.dart b/tests/compiler/dart2js/simple_inferrer_callers_test.dart
index acd8872..4f2e5a8 100644
--- a/tests/compiler/dart2js/simple_inferrer_callers_test.dart
+++ b/tests/compiler/dart2js/simple_inferrer_callers_test.dart
@@ -5,13 +5,11 @@
 // Test that computation of callers of an element works when two
 // elements of the same name are being invoked in the same method.
 
+import 'package:async_helper/async_helper.dart';
 import 'package:expect/expect.dart';
-import "package:async_helper/async_helper.dart";
-import 'package:compiler/src/types/types.dart';
 import 'package:compiler/src/inferrer/type_graph_inferrer.dart';
 
 import 'compiler_helper.dart';
-import 'parser_helper.dart';
 
 const String TEST = """
 class A {
diff --git a/tests/compiler/dart2js/simple_inferrer_const_closure_default_test.dart b/tests/compiler/dart2js/simple_inferrer_const_closure_default_test.dart
new file mode 100644
index 0000000..b5bc4e6
--- /dev/null
+++ b/tests/compiler/dart2js/simple_inferrer_const_closure_default_test.dart
@@ -0,0 +1,84 @@
+// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:expect/expect.dart';
+import "package:async_helper/async_helper.dart";
+import 'compiler_helper.dart';
+import 'type_mask_test_helper.dart';
+
+
+
+const String TEST = """
+
+// [defaultFn_i] is called only via [foo_i]'s default value with a small integer.
+
+defaultFn1(a) => a;
+defaultFn2(a) => a;
+defaultFn3(a) => a;
+defaultFn4(a) => a;
+defaultFn5(a) => a;
+defaultFn6(a) => a;
+
+foo1([fn = defaultFn1]) => fn(54);
+foo2({fn: defaultFn2}) => fn(54);
+foo3([fn = defaultFn3]) => fn(54);
+foo4({fn: defaultFn4}) => fn(54);
+foo5([fn = defaultFn5]) => fn(54);
+foo6({fn: defaultFn6}) => fn(54);
+
+main() {
+  // Direct calls.
+  foo1();
+  foo2();
+  // Indirect calls.
+  (foo3)();
+  (foo4)();
+  // Calls via Function.apply.
+  Function.apply(foo5, []);
+  Function.apply(foo6, []);
+}
+""";
+
+
+void main() {
+  Uri uri = new Uri(scheme: 'source');
+  var compiler = compilerFor(TEST, uri);
+  asyncTest(() => compiler.runCompiler(uri).then((_) {
+    var typesInferrer = compiler.typesTask.typesInferrer;
+
+    checkArgument(String functionName, type) {
+      var functionElement = findElement(compiler, functionName);
+      var signature = functionElement.functionSignature;
+      var element = signature.requiredParameterCount > 0
+          ? signature.requiredParameters.first
+          : signature.optionalParameters.first;
+      Expect.equals(type,
+          simplify(typesInferrer.getTypeOfElement(element), compiler),
+          functionName);
+    }
+
+    checkOptionalArgument(String functionName, type) {
+      var functionElement = findElement(compiler, functionName);
+      var signature = functionElement.functionSignature;
+      var element = signature.optionalParameters.first;
+      Expect.equals(type,
+          simplify(typesInferrer.getTypeOfElement(element), compiler),
+          functionName);
+    }
+
+    checkArgument('foo1', compiler.typesTask.functionType);   /// 01: ok
+    checkArgument('foo2', compiler.typesTask.functionType);   /// 02: ok
+    checkArgument('foo3', compiler.typesTask.functionType);   /// 03: ok
+    checkArgument('foo4', compiler.typesTask.functionType);   /// 04: ok
+    checkArgument('foo5', compiler.typesTask.dynamicType);    /// 05: ok
+    checkArgument('foo6', compiler.typesTask.dynamicType);    /// 06: ok
+
+    checkArgument('defaultFn1', compiler.typesTask.uint31Type);   /// 07: ok
+    checkArgument('defaultFn2', compiler.typesTask.uint31Type);   /// 08: ok
+    checkArgument('defaultFn3', compiler.typesTask.uint31Type);   /// 09: ok
+    checkArgument('defaultFn4', compiler.typesTask.uint31Type);   /// 10: ok
+    checkArgument('defaultFn5', compiler.typesTask.uint31Type);   /// 11: ok
+    checkArgument('defaultFn6', compiler.typesTask.uint31Type);   /// 12: ok
+  }));
+}
diff --git a/tests/compiler/dart2js/simple_inferrer_final_field2_test.dart b/tests/compiler/dart2js/simple_inferrer_final_field2_test.dart
index 30181fe..36019136 100644
--- a/tests/compiler/dart2js/simple_inferrer_final_field2_test.dart
+++ b/tests/compiler/dart2js/simple_inferrer_final_field2_test.dart
@@ -5,10 +5,10 @@
 // Test that a non-used generative constructor does not prevent
 // infering types for fields.
 
+import 'package:async_helper/async_helper.dart';
 import 'package:expect/expect.dart';
-import "package:async_helper/async_helper.dart";
+
 import 'compiler_helper.dart';
-import 'parser_helper.dart';
 
 const String TEST = """
 
diff --git a/tests/compiler/dart2js/simple_inferrer_final_field3_test.dart b/tests/compiler/dart2js/simple_inferrer_final_field3_test.dart
index 817747c..e010677 100644
--- a/tests/compiler/dart2js/simple_inferrer_final_field3_test.dart
+++ b/tests/compiler/dart2js/simple_inferrer_final_field3_test.dart
@@ -7,7 +7,6 @@
 import 'package:expect/expect.dart';
 import "package:async_helper/async_helper.dart";
 import 'compiler_helper.dart';
-import 'parser_helper.dart';
 import 'type_mask_test_helper.dart';
 
 const String TEST = """
diff --git a/tests/compiler/dart2js/simple_inferrer_final_field_test.dart b/tests/compiler/dart2js/simple_inferrer_final_field_test.dart
index 29d0940..7e5853c 100644
--- a/tests/compiler/dart2js/simple_inferrer_final_field_test.dart
+++ b/tests/compiler/dart2js/simple_inferrer_final_field_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.
 
+import 'package:async_helper/async_helper.dart';
 import 'package:expect/expect.dart';
-import "package:async_helper/async_helper.dart";
+
 import 'compiler_helper.dart';
-import 'parser_helper.dart';
 import 'type_mask_test_helper.dart';
 
 const String TEST = """
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 3f91350..f3e44d4 100644
--- a/tests/compiler/dart2js/simple_inferrer_no_such_method_test.dart
+++ b/tests/compiler/dart2js/simple_inferrer_no_such_method_test.dart
@@ -7,7 +7,6 @@
 import "package:async_helper/async_helper.dart";
 import 'compiler_helper.dart';
 import 'package:compiler/src/types/types.dart';
-import 'parser_helper.dart';
 import 'type_mask_test_helper.dart';
 
 const String TEST1 = """
diff --git a/tests/compiler/dart2js/simple_inferrer_postfix_prefix_test.dart b/tests/compiler/dart2js/simple_inferrer_postfix_prefix_test.dart
index 2050354..c26104d 100644
--- a/tests/compiler/dart2js/simple_inferrer_postfix_prefix_test.dart
+++ b/tests/compiler/dart2js/simple_inferrer_postfix_prefix_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.
 
+import 'package:async_helper/async_helper.dart';
 import 'package:expect/expect.dart';
-import "package:async_helper/async_helper.dart";
+
 import 'compiler_helper.dart';
-import 'parser_helper.dart';
 import 'type_mask_test_helper.dart';
 
 const String TEST = """
diff --git a/tests/compiler/dart2js/simple_inferrer_relations_test.dart b/tests/compiler/dart2js/simple_inferrer_relations_test.dart
index de080f4..a076955 100644
--- a/tests/compiler/dart2js/simple_inferrer_relations_test.dart
+++ b/tests/compiler/dart2js/simple_inferrer_relations_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.
 
+import 'package:async_helper/async_helper.dart';
 import 'package:expect/expect.dart';
-import "package:async_helper/async_helper.dart";
-import 'package:compiler/src/types/types.dart' show TypeMask;
 
 import 'compiler_helper.dart';
-import 'parser_helper.dart';
 
 // Test that if (x == y) where we know nothing about x and y will get optimized
 // to if ($.$eq(x, y)) and not
diff --git a/tests/compiler/dart2js/simple_inferrer_test.dart b/tests/compiler/dart2js/simple_inferrer_test.dart
index 5999741..1bc1cf5 100644
--- a/tests/compiler/dart2js/simple_inferrer_test.dart
+++ b/tests/compiler/dart2js/simple_inferrer_test.dart
@@ -8,8 +8,6 @@
 import 'type_mask_test_helper.dart';
 
 import 'compiler_helper.dart';
-import 'parser_helper.dart';
-import 'type_mask_test_helper.dart';
 
 const String TEST = """
 returnNum1(a) {
diff --git a/tests/compiler/dart2js/simple_inferrer_unregister_call_test.dart b/tests/compiler/dart2js/simple_inferrer_unregister_call_test.dart
index 5c2e11f..06bba80 100644
--- a/tests/compiler/dart2js/simple_inferrer_unregister_call_test.dart
+++ b/tests/compiler/dart2js/simple_inferrer_unregister_call_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.
 
+import 'package:async_helper/async_helper.dart';
 import 'package:expect/expect.dart';
-import "package:async_helper/async_helper.dart";
+
 import 'compiler_helper.dart';
-import 'parser_helper.dart';
 
 const String TEST = """
 var a = '';
diff --git a/tests/compiler/dart2js/source_map_name_test.dart b/tests/compiler/dart2js/source_map_name_test.dart
index 46aeb86..fae5649 100644
--- a/tests/compiler/dart2js/source_map_name_test.dart
+++ b/tests/compiler/dart2js/source_map_name_test.dart
@@ -6,7 +6,7 @@
 
 import 'package:async_helper/async_helper.dart';
 import 'package:expect/expect.dart';
-import 'package:compiler/src/dart2jslib.dart';
+import 'package:compiler/src/compiler.dart';
 import 'package:compiler/src/elements/elements.dart';
 import 'package:compiler/src/io/source_information.dart';
 import 'memory_compiler.dart';
diff --git a/tests/compiler/dart2js/source_mapping_test.dart b/tests/compiler/dart2js/source_mapping_test.dart
index 9c350f6..6c7b46f 100644
--- a/tests/compiler/dart2js/source_mapping_test.dart
+++ b/tests/compiler/dart2js/source_mapping_test.dart
@@ -3,17 +3,17 @@
 // 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";
-import "package:compiler/src/io/code_output.dart";
+import 'package:expect/expect.dart';
+import 'package:async_helper/async_helper.dart';
+import 'package:compiler/src/io/code_output.dart';
 import 'package:compiler/src/io/source_file.dart';
 import 'package:compiler/src/io/source_information.dart';
-import "mock_compiler.dart";
 import 'package:compiler/src/js_backend/js_backend.dart';
-import 'package:compiler/src/js_emitter/js_emitter.dart';
 import 'package:compiler/src/js_emitter/full_emitter/emitter.dart'
     as full show Emitter;
 
+import 'mock_compiler.dart';
+
 Future<CodeBuffer> compileAll(SourceFile sourceFile) {
   MockCompiler compiler = new MockCompiler.internal();
   Uri uri = new Uri(path: sourceFile.filename);
@@ -68,7 +68,7 @@
 
 String RETURN_TEST = 'void main() { print(((x) { @return x; })(0)); }';
 
-String NOT_TEST = 'void main() { ((x) { if (@!x) print(x); })(false); }';
+String NOT_TEST = 'void main() { ((x) { if (@!x) print(x); })(1==2); }';
 
 String UNARY_TEST = 'void main() { ((x, y) { print(@-x + @~y); })(1,2); }';
 
diff --git a/tests/compiler/dart2js/sourcemaps/source_mapping_test_viewer.dart b/tests/compiler/dart2js/sourcemaps/source_mapping_test_viewer.dart
index 4691568..215092a 100644
--- a/tests/compiler/dart2js/sourcemaps/source_mapping_test_viewer.dart
+++ b/tests/compiler/dart2js/sourcemaps/source_mapping_test_viewer.dart
@@ -133,19 +133,19 @@
   TestResult result =
       await runTests(config, filename, options, verbose: verbose);
   if (outputUri != null) {
-    if (result.failureMap.isNotEmpty) {
-      result.failureMap.forEach((info, missingCodePoints) {
-        print("Missing code points for ${info.element} in '$filename' "
-              "in config '$config':");
-        for (CodePoint codePoint in missingCodePoints) {
-          print("  $codePoint");
-        }
-      });
+    if (result.missingCodePointsMap.isNotEmpty) {
+      result.printMissingCodePoints();
+    }
+    if (result.multipleNodesMap.isNotEmpty) {
+      result.printMultipleNodes();
+    }
+    if (result.multipleOffsetsMap.isNotEmpty) {
+      result.printMultipleOffsets();
     }
     createTraceSourceMapHtml(outputUri, result.processor, result.userInfoList);
   }
   return new Measurement(config, filename,
-      result.failureMap.values.fold(0, (s, i) => s + i.length),
+      result.missingCodePointsMap.values.fold(0, (s, i) => s + i.length),
       result.userInfoList.fold(0, (s, i) => s + i.codePoints.length));
 }
 
diff --git a/tests/compiler/dart2js/sourcemaps/source_mapping_tester.dart b/tests/compiler/dart2js/sourcemaps/source_mapping_tester.dart
index 9e7d5b6..5149b87 100644
--- a/tests/compiler/dart2js/sourcemaps/source_mapping_tester.dart
+++ b/tests/compiler/dart2js/sourcemaps/source_mapping_tester.dart
@@ -5,6 +5,9 @@
 import 'dart:async';
 import 'package:async_helper/async_helper.dart';
 import 'package:expect/expect.dart';
+import 'package:compiler/src/io/source_information.dart';
+import 'package:compiler/src/js/js_debug.dart';
+import 'package:js_ast/js_ast.dart';
 import 'sourcemap_helper.dart';
 
 main(List<String> arguments) {
@@ -25,26 +28,28 @@
   }
 
   asyncTest(() async {
-    bool missingCodePointsFound = false;
+    bool errorsFound = false;
     for (String config in configurations) {
       List<String> options = TEST_CONFIGURATIONS[config];
       for (String file in files) {
         String filename = TEST_FILES[file];
         TestResult result = await runTests(config, filename, options);
-        if (result.failureMap.isNotEmpty) {
-          result.failureMap.forEach((info, missingCodePoints) {
-            print("Missing code points for ${info.element} in '$filename' "
-                  "in config '$config':");
-            for (CodePoint codePoint in missingCodePoints) {
-              print("  $codePoint");
-            }
-          });
-          missingCodePointsFound = true;
+        if (result.missingCodePointsMap.isNotEmpty) {
+          result.printMissingCodePoints();
+          errorsFound = true;
+        }
+        if (result.multipleNodesMap.isNotEmpty) {
+          result.printMultipleNodes();
+          errorsFound = true;
+        }
+        if (result.multipleOffsetsMap.isNotEmpty) {
+          result.printMultipleOffsets();
+          errorsFound = true;
         }
       }
     }
-    Expect.isFalse(missingCodePointsFound,
-        "Missing code points found. "
+    Expect.isFalse(errorsFound,
+        "Errors found. "
         "Run the test with a URI option, "
         "`source_mapping_test_viewer [--out=<uri>] [configs] [tests]`, to "
         "create a html visualization of the missing code points.");
@@ -101,8 +106,34 @@
     Iterable<CodePoint> missingCodePoints =
         info.codePoints.where((c) => c.isMissing);
     if (missingCodePoints.isNotEmpty) {
-      result.failureMap[info] = missingCodePoints;
+      result.missingCodePointsMap[info] = missingCodePoints;
     }
+    Map<int, Set<SourceLocation>> offsetToLocationsMap =
+        <int, Set<SourceLocation>>{};
+    for (Node node in info.nodeMap.nodes) {
+      info.nodeMap[node].forEach(
+            (int targetOffset, List<SourceLocation> sourceLocations) {
+        if (sourceLocations.length > 1) {
+          Map<Node, List<SourceLocation>> multipleMap =
+              result.multipleNodesMap.putIfAbsent(info,
+                  () => <Node, List<SourceLocation>>{});
+          multipleMap[node] = sourceLocations;
+        } else {
+          offsetToLocationsMap
+              .putIfAbsent(targetOffset, () => new Set<SourceLocation>())
+              .addAll(sourceLocations);
+        }
+      });
+    }
+    offsetToLocationsMap.forEach(
+          (int targetOffset, Set<SourceLocation> sourceLocations) {
+      if (sourceLocations.length > 1) {
+        Map<int, Set<SourceLocation>> multipleMap =
+            result.multipleOffsetsMap.putIfAbsent(info,
+                () => <int, Set<SourceLocation>>{});
+        multipleMap[targetOffset] = sourceLocations;
+      }
+    });
   }
   return result;
 }
@@ -112,8 +143,48 @@
   final String file;
   final SourceMapProcessor processor;
   List<SourceMapInfo> userInfoList = <SourceMapInfo>[];
-  Map<SourceMapInfo, Iterable<CodePoint>> failureMap =
+  Map<SourceMapInfo, Iterable<CodePoint>> missingCodePointsMap =
       <SourceMapInfo, Iterable<CodePoint>>{};
 
+  /// For each [SourceMapInfo] a map from JS node to multiple source locations
+  /// associated with the node.
+  Map<SourceMapInfo, Map<Node, List<SourceLocation>>> multipleNodesMap =
+      <SourceMapInfo, Map<Node, List<SourceLocation>>>{};
+
+  /// For each [SourceMapInfo] a map from JS offset to multiple source locations
+  /// associated with the offset.
+  Map<SourceMapInfo, Map<int, Set<SourceLocation>>> multipleOffsetsMap =
+      <SourceMapInfo, Map<int, Set<SourceLocation>>>{};
+
   TestResult(this.config, this.file, this.processor);
+
+  void printMissingCodePoints() {
+    missingCodePointsMap.forEach((info, missingCodePoints) {
+      print("Missing code points for ${info.element} in '$file' "
+            "in config '$config':");
+      for (CodePoint codePoint in missingCodePoints) {
+        print("  $codePoint");
+      }
+    });
+  }
+
+  void printMultipleNodes() {
+    multipleNodesMap.forEach((info, multipleMap) {
+      multipleMap.forEach((node, sourceLocations) {
+        print('Multiple source locations:\n ${sourceLocations.join('\n ')}\n'
+              'for `${nodeToString(node)}` in ${info.element} in '
+              '$file.');
+      });
+    });
+  }
+
+  void printMultipleOffsets() {
+    multipleOffsetsMap.forEach((info, multipleMap) {
+      multipleMap.forEach((targetOffset, sourceLocations) {
+        print(
+            'Multiple source locations:\n ${sourceLocations.join('\n ')}\n'
+            'for offset $targetOffset in ${info.element} in $file.');
+      });
+    });
+  }
 }
diff --git a/tests/compiler/dart2js/sourcemaps/sourcemap_helper.dart b/tests/compiler/dart2js/sourcemaps/sourcemap_helper.dart
index 1dbbc1f..eac4637 100644
--- a/tests/compiler/dart2js/sourcemaps/sourcemap_helper.dart
+++ b/tests/compiler/dart2js/sourcemaps/sourcemap_helper.dart
@@ -120,7 +120,7 @@
       if (verbose) print('Using the new source information system.');
       useNewSourceInfo = true;
     }
-    api.Compiler compiler = await compilerFor({},
+    api.Compiler compiler = await compilerFor(
         outputProvider: outputProvider,
         // TODO(johnniwinther): Use [verbose] to avoid showing diagnostics.
         options: ['--out=$targetUri', '--source-map=$sourceMapFileUri']
diff --git a/tests/compiler/dart2js/space_test.dart b/tests/compiler/dart2js/space_test.dart
index fbf933d..b721952 100644
--- a/tests/compiler/dart2js/space_test.dart
+++ b/tests/compiler/dart2js/space_test.dart
@@ -5,6 +5,7 @@
 import 'dart:io';
 import 'package:compiler/src/dart2js.dart'
   as dart2js;
+import 'package:compiler/src/commandline_options.dart';
 
 main() {
   Uri currentDirectory = Uri.base;
@@ -13,6 +14,6 @@
   Directory.current = script.resolve("path with spaces").toFilePath();
 
   return dart2js.main(["--library-root=${libraryRoot.toFilePath()}",
-                       "--analyze-only",
+                       Flags.analyzeOnly,
                        "file with spaces.dart"]);
 }
diff --git a/tests/compiler/dart2js/subtypeset_test.dart b/tests/compiler/dart2js/subtypeset_test.dart
new file mode 100644
index 0000000..6673041
--- /dev/null
+++ b/tests/compiler/dart2js/subtypeset_test.dart
@@ -0,0 +1,81 @@
+// 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.
+
+// Test for iterators on for [SubclassNode].
+
+library world_test;
+
+import 'package:expect/expect.dart';
+import 'package:async_helper/async_helper.dart';
+import 'type_test_helper.dart';
+import 'package:compiler/src/elements/elements.dart'
+       show Element, ClassElement;
+import 'package:compiler/src/universe/class_set.dart';
+import 'package:compiler/src/world.dart';
+
+void main() {
+  asyncTest(() => TypeEnvironment.create(r"""
+      ///        A
+      ///       / \
+      ///      B   C
+      ///     /   /|\
+      ///    D   E F G 
+      ///
+      class A {
+        call(H h, I i) {} // Make `H` and `I` part of the world.
+      }
+      class B extends A implements C {}
+      class C extends A {}
+      class D extends B implements A {}
+      class E extends C implements B {}
+      class F extends C {}
+      class G extends C {}
+      class H implements C {}
+      class I implements H {}
+      """,
+        mainSource: r"""
+      main() {
+        new A();
+        new C();
+        new D();
+        new E();
+        new F();
+        new G();
+      }
+      """,
+      useMockCompiler: false).then((env) {
+    World world = env.compiler.world;
+
+    ClassElement A = env.getElement("A");
+    ClassElement B = env.getElement("B");
+    ClassElement C = env.getElement("C");
+    ClassElement D = env.getElement("D");
+    ClassElement E = env.getElement("E");
+    ClassElement F = env.getElement("F");
+    ClassElement G = env.getElement("G");
+    ClassElement H = env.getElement("H");
+    ClassElement I = env.getElement("I");
+
+    void checkClass(ClassElement cls,
+                    List<ClassElement> subtypes) {
+      ClassSet node = world.getClassSet(cls);
+      print('$cls:\n${node}');
+      Expect.listEquals(subtypes,
+          node.subtypes().toList(),
+          "Unexpected subtypes of ${cls.name}:\n"
+          "Expected: $subtypes\n"
+          "Found   : ${node.subtypes().toList()}");
+    }
+
+    checkClass(A, [A, C, E, F, G, B, D, H, I]);
+    checkClass(B, [B, D, E]);
+    checkClass(C, [C, E, F, G, H, B, D, I]);
+    checkClass(D, [D]);
+    checkClass(E, [E]);
+    checkClass(F, [F]);
+    checkClass(G, [G]);
+    checkClass(H, [H, I]);
+    checkClass(I, [I]);
+  }));
+}
diff --git a/tests/compiler/dart2js/tag_mapping_test.dart b/tests/compiler/dart2js/tag_mapping_test.dart
index 04af1fc..ed781f3 100644
--- a/tests/compiler/dart2js/tag_mapping_test.dart
+++ b/tests/compiler/dart2js/tag_mapping_test.dart
@@ -33,11 +33,11 @@
     Expect.isNotNull(mainApp, 'Could not find main.dart library');
     Expect.isNotNull(lib, 'Could not find library.dart library');
 
-    Import tag = mainApp.tags.single;
-    Expect.isNotNull(tag, 'Could not find import tag in $mainApp');
+    ImportElement import = mainApp.imports.single;
+    Expect.isNotNull(import, 'Could not find import tag in $mainApp');
 
     // Test that we can get from the import tag in main.dart to the
     // library element representing library.dart.
-    Expect.identical(lib, mainApp.getLibraryFromTag(tag));
+    Expect.identical(lib, import.importedLibrary);
   }));
 }
diff --git a/tests/compiler/dart2js/trust_type_annotations2_test.dart b/tests/compiler/dart2js/trust_type_annotations2_test.dart
index cf8ad8a..f688380 100644
--- a/tests/compiler/dart2js/trust_type_annotations2_test.dart
+++ b/tests/compiler/dart2js/trust_type_annotations2_test.dart
@@ -29,8 +29,8 @@
         memorySourceFiles: MEMORY_SOURCE_FILES,
         options: ['--trust-type-annotations']);
     var compiler = result.compiler;
-    var element = compiler.mainApp.findExported('main');
-    var code = compiler.backend.assembleCode(element);
+    var element = compiler.mainFunction;
+    var code = compiler.backend.getGeneratedCode(element);
     Expect.isTrue(code.contains('+'), code);
   });
 }
diff --git a/tests/compiler/dart2js/type_checker_test.dart b/tests/compiler/dart2js/type_checker_test.dart
index f6be4cf..045d2be 100644
--- a/tests/compiler/dart2js/type_checker_test.dart
+++ b/tests/compiler/dart2js/type_checker_test.dart
@@ -3,21 +3,29 @@
 // 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/elements/elements.dart';
-import 'package:compiler/src/tree/tree.dart';
-import 'package:compiler/src/util/util.dart';
-import 'package:compiler/src/io/source_file.dart';
-import 'mock_compiler.dart';
-import 'parser_helper.dart';
-
-import 'package:compiler/src/elements/modelx.dart'
-  show ClassElementX, CompilationUnitElementX, ElementX, FunctionElementX;
-
-import 'package:compiler/src/dart2jslib.dart';
 
 import 'package:compiler/src/dart_types.dart';
+import 'package:compiler/src/diagnostics/messages.dart';
+import 'package:compiler/src/elements/elements.dart';
+import 'package:compiler/src/elements/modelx.dart' show
+    ClassElementX,
+    CompilationUnitElementX,
+    ElementX,
+    FunctionElementX;
+import 'package:compiler/src/io/source_file.dart';
+import 'package:compiler/src/resolution/tree_elements.dart' show
+    TreeElements,
+    TreeElementMapping;
+import 'package:compiler/src/tree/tree.dart';
+import 'package:compiler/src/typechecker.dart';
+import 'package:compiler/src/script.dart';
+import 'package:compiler/src/util/util.dart';
+
+import 'mock_compiler.dart';
+import 'parser_helper.dart';
 
 final MessageKind NOT_ASSIGNABLE = MessageKind.NOT_ASSIGNABLE;
 final MessageKind MEMBER_NOT_FOUND = MessageKind.MEMBER_NOT_FOUND;
@@ -26,6 +34,8 @@
   List tests = [testSimpleTypes,
                 testReturn,
                 testFor,
+                testSyncForIn,
+                testAsyncForIn,
                 testWhile,
                 testTry,
                 testSwitch,
@@ -65,10 +75,11 @@
     Expect.equals(type, analyzeType(compiler, code));
   }
 
-  checkType(compiler.intClass.computeType(compiler), "3");
-  checkType(compiler.boolClass.computeType(compiler), "false");
-  checkType(compiler.boolClass.computeType(compiler), "true");
-  checkType(compiler.stringClass.computeType(compiler), "'hestfisk'");
+  checkType(compiler.intClass.computeType(compiler.resolution), "3");
+  checkType(compiler.boolClass.computeType(compiler.resolution), "false");
+  checkType(compiler.boolClass.computeType(compiler.resolution), "true");
+  checkType(
+      compiler.stringClass.computeType(compiler.resolution), "'hestfisk'");
 }
 
 Future testReturn(MockCompiler compiler) {
@@ -118,6 +129,302 @@
 //  check("for (String s in true) {}", MessageKind.METHOD_NOT_FOUND);
 }
 
+
+testSyncForIn(MockCompiler compiler) {
+  String script = """
+class HasUntypedIterator {
+  get iterator => null;
+}
+
+class HasIntIterator {
+  Iterator<int> get iterator => null;
+}
+
+class HasNoIterator {
+}
+
+class HasCustomIntIterator {
+  CustomIntIterator get iterator => null;
+}
+
+class CustomIntIterator {
+  int current;
+}
+
+class HasCustomNoCurrentIterator {
+  CustomNoCurrentIterator get iterator => null;
+}
+
+class CustomNoCurrentIterator {
+}
+
+var topLevelDyn;
+String topLevelString;
+int topLevelInt;
+
+class Class {
+  void forIn() {}
+
+  var instanceDyn;
+  String instanceString;
+  int instanceInt;
+
+  static var staticDyn;
+  static String staticString;
+  static int staticInt;
+}
+""";
+  compiler.parseScript(script);
+  ClassElement foo = compiler.mainApp.find("Class");
+  foo.ensureResolved(compiler.resolution);
+  FunctionElement method = foo.lookupLocalMember('forIn');
+
+  analyzeIn(compiler, method, """{ 
+      for (var e in <String>[]) {} 
+  }""");
+  analyzeIn(compiler, method, """{ 
+      for (String e in <String>[]) {} 
+  }""");
+  analyzeIn(compiler, method, """{ 
+      for (int e in <String>[]) {} 
+  }""", hints: MessageKind.FORIN_NOT_ASSIGNABLE);
+  analyzeIn(compiler, method, """{ 
+      for (int e in []) {} 
+  }""");
+
+  analyzeIn(compiler, method, """{ 
+      for (var e in new HasUntypedIterator()) {} 
+  }""");
+  analyzeIn(compiler, method, """{ 
+      for (String e in new HasUntypedIterator()) {} 
+  }""");
+  analyzeIn(compiler, method, """{ 
+      for (int e in new HasUntypedIterator()) {} 
+  }""");
+
+  analyzeIn(compiler, method, """{ 
+      for (var e in new HasIntIterator()) {} 
+  }""");
+  analyzeIn(compiler, method, """{ 
+      for (String e in new HasIntIterator()) {} 
+  }""", hints: MessageKind.FORIN_NOT_ASSIGNABLE);
+  analyzeIn(compiler, method, """{ 
+      for (int e in new HasIntIterator()) {} 
+  }""");
+
+  analyzeIn(compiler, method, """{ 
+      for (var e in new HasNoIterator()) {} 
+  }""", warnings: MessageKind.MEMBER_NOT_FOUND);
+  analyzeIn(compiler, method, """{ 
+      for (String e in new HasNoIterator()) {} 
+  }""", warnings: MessageKind.MEMBER_NOT_FOUND);
+  analyzeIn(compiler, method, """{ 
+      for (int e in new HasNoIterator()) {} 
+  }""", warnings: MessageKind.MEMBER_NOT_FOUND);
+
+  analyzeIn(compiler, method, """{ 
+      for (var e in new HasCustomIntIterator()) {} 
+  }""");
+  analyzeIn(compiler, method, """{ 
+      for (String e in new HasCustomIntIterator()) {} 
+  }""", hints: MessageKind.FORIN_NOT_ASSIGNABLE);
+  analyzeIn(compiler, method, """{ 
+      for (int e in new HasCustomIntIterator()) {} 
+  }""");
+
+  analyzeIn(compiler, method, """{ 
+      for (var e in new HasCustomNoCurrentIterator()) {} 
+  }""", hints: MessageKind.MEMBER_NOT_FOUND);
+  analyzeIn(compiler, method, """{ 
+      for (String e in new HasCustomNoCurrentIterator()) {} 
+  }""", hints: MessageKind.MEMBER_NOT_FOUND);
+  analyzeIn(compiler, method, """{ 
+      for (int e in new HasCustomNoCurrentIterator()) {} 
+  }""", hints: MessageKind.MEMBER_NOT_FOUND);
+
+  analyzeIn(compiler, method, """{ 
+      var localDyn; 
+      for (localDyn in <String>[]) {} 
+  }""");
+  analyzeIn(compiler, method, """{ 
+      String localString; 
+      for (localString in <String>[]) {} 
+  }""");
+  analyzeIn(compiler, method, """{ 
+      int localInt; 
+      for (localInt in <String>[]) {} 
+  }""", hints: MessageKind.FORIN_NOT_ASSIGNABLE);
+
+  analyzeIn(compiler, method, """{ 
+      for (topLevelDyn in <String>[]) {} 
+  }""");
+  analyzeIn(compiler, method, """{ 
+      for (topLevelString in <String>[]) {} 
+  }""");
+  analyzeIn(compiler, method, """{ 
+      for (topLevelInt in <String>[]) {} 
+  }""", hints: MessageKind.FORIN_NOT_ASSIGNABLE);
+
+  analyzeIn(compiler, method, """{ 
+      for (instanceDyn in <String>[]) {} 
+  }""");
+  analyzeIn(compiler, method, """{ 
+      for (instanceString in <String>[]) {} 
+  }""");
+  analyzeIn(compiler, method, """{ 
+      for (instanceInt in <String>[]) {} 
+  }""", hints: MessageKind.FORIN_NOT_ASSIGNABLE);
+
+  analyzeIn(compiler, method, """{ 
+      for (staticDyn in <String>[]) {} 
+  }""");
+  analyzeIn(compiler, method, """{ 
+      for (staticString in <String>[]) {} 
+  }""");
+  analyzeIn(compiler, method, """{ 
+      for (staticInt in <String>[]) {} 
+  }""", hints: MessageKind.FORIN_NOT_ASSIGNABLE);
+}
+
+testAsyncForIn(MockCompiler compiler) {
+  String script = """
+abstract class CustomStream<T> implements Stream<T> {}
+abstract class StringStream implements Stream<String> {}
+
+var topLevelDyn;
+String topLevelString;
+int topLevelInt;
+
+class Class {
+  void forIn() async {}
+
+  var instanceDyn;
+  String instanceString;
+  int instanceInt;
+
+  static var staticDyn;
+  static String staticString;
+  static int staticInt;
+}
+""";
+  compiler.parseScript(script);
+  ClassElement foo = compiler.mainApp.find("Class");
+  foo.ensureResolved(compiler.resolution);
+  FunctionElement method = foo.lookupLocalMember('forIn');
+
+  analyzeIn(compiler, method, """{
+      var stream;
+      await for (var e in stream) {} 
+  }""");
+  analyzeIn(compiler, method, """{ 
+      var stream;
+      await for (String e in stream) {} 
+  }""");
+  analyzeIn(compiler, method, """{ 
+      var stream;
+      await for (int e in stream) {} 
+  }""");
+
+  analyzeIn(compiler, method, """{ 
+      await for (var e in []) {} 
+  }""", hints: MessageKind.NOT_ASSIGNABLE);
+
+  analyzeIn(compiler, method, """{ 
+      Stream<String> stream;
+      await for (var e in stream) {} 
+  }""");
+  analyzeIn(compiler, method, """{ 
+      Stream<String> stream;
+      await for (String e in stream) {} 
+  }""");
+  analyzeIn(compiler, method, """{ 
+      Stream<String> stream;
+      await for (int e in stream) {} 
+  }""", hints: MessageKind.FORIN_NOT_ASSIGNABLE);
+
+  analyzeIn(compiler, method, """{ 
+      CustomStream<String> stream;
+      await for (var e in stream) {} 
+  }""");
+  analyzeIn(compiler, method, """{ 
+      CustomStream<String> stream;
+      await for (String e in stream) {} 
+  }""");
+  analyzeIn(compiler, method, """{ 
+      CustomStream<String> stream;
+      await for (int e in stream) {} 
+  }""", hints: MessageKind.FORIN_NOT_ASSIGNABLE);
+
+  analyzeIn(compiler, method, """{ 
+      StringStream stream;
+      await for (var e in stream) {} 
+  }""");
+  analyzeIn(compiler, method, """{ 
+      StringStream stream;
+      await for (String e in stream) {} 
+  }""");
+  analyzeIn(compiler, method, """{ 
+      StringStream stream;
+      await for (int e in stream) {} 
+  }""", hints: MessageKind.FORIN_NOT_ASSIGNABLE);
+
+  analyzeIn(compiler, method, """{ 
+      Stream<String> stream;
+      var localDyn; 
+      await for (localDyn in stream) {} 
+  }""");
+  analyzeIn(compiler, method, """{ 
+      Stream<String> stream;
+      String localString; 
+      await for (localString in stream) {} 
+  }""");
+  analyzeIn(compiler, method, """{ 
+      Stream<String> stream;
+      int localInt; 
+      await for (localInt in stream) {} 
+  }""", hints: MessageKind.FORIN_NOT_ASSIGNABLE);
+
+  analyzeIn(compiler, method, """{ 
+      Stream<String> stream;
+      await for (topLevelDyn in stream) {} 
+  }""");
+  analyzeIn(compiler, method, """{ 
+      Stream<String> stream;
+      await for (topLevelString in stream) {} 
+  }""");
+  analyzeIn(compiler, method, """{ 
+      Stream<String> stream;
+      await for (topLevelInt in stream) {} 
+  }""", hints: MessageKind.FORIN_NOT_ASSIGNABLE);
+
+  analyzeIn(compiler, method, """{ 
+      Stream<String> stream;
+      await for (instanceDyn in stream) {} 
+  }""");
+  analyzeIn(compiler, method, """{ 
+      Stream<String> stream;
+      await for (instanceString in stream) {} 
+  }""");
+  analyzeIn(compiler, method, """{ 
+      Stream<String> stream;
+      await for (instanceInt in stream) {} 
+  }""", hints: MessageKind.FORIN_NOT_ASSIGNABLE);
+
+  analyzeIn(compiler, method, """{ 
+      Stream<String> stream;
+      await for (staticDyn in stream) {} 
+  }""");
+  analyzeIn(compiler, method, """{ 
+      Stream<String> stream;
+      await for (staticString in stream) {} 
+  }""");
+  analyzeIn(compiler, method, """{ 
+      Stream<String> stream;
+      await for (staticInt in stream) {} 
+  }""", hints: MessageKind.FORIN_NOT_ASSIGNABLE);
+}
+
+
 testWhile(MockCompiler compiler) {
   check(String code, {warnings}) {
     analyze(compiler, code, warnings: warnings);
@@ -588,11 +895,11 @@
     LibraryElement library = compiler.mainApp;
     compiler.parseScript(CLASS_WITH_METHODS, library);
     ClassElement ClassWithMethods = library.find("ClassWithMethods");
-    ClassWithMethods.ensureResolved(compiler);
+    ClassWithMethods.ensureResolved(compiler.resolution);
     Element c = ClassWithMethods.lookupLocalMember('method');
     assert(c != null);
     ClassElement SubClass = library.find("SubClass");
-    SubClass.ensureResolved(compiler);
+    SubClass.ensureResolved(compiler.resolution);
     Element d = SubClass.lookupLocalMember('method');
     assert(d != null);
 
@@ -606,7 +913,7 @@
                      int localMethod(String str) { return 0; }
                      $text
                    }""",
-                expectedWarnings);
+                warnings: expectedWarnings);
     }
 
 
@@ -884,9 +1191,9 @@
                      }""";
   compiler.parseScript(script);
   ClassElement foo = compiler.mainApp.find("Foo");
-  foo.ensureResolved(compiler);
+  foo.ensureResolved(compiler.resolution);
   Element method = foo.lookupLocalMember('method');
-  analyzeIn(compiler, method, "{ int i = this; }", NOT_ASSIGNABLE);
+  analyzeIn(compiler, method, "{ int i = this; }", warnings: NOT_ASSIGNABLE);
   analyzeIn(compiler, method, "{ Object o = this; }");
   analyzeIn(compiler, method, "{ Foo f = this; }");
 }
@@ -904,9 +1211,10 @@
     ''';
   compiler.parseScript(script);
   ClassElement B = compiler.mainApp.find("B");
-  B.ensureResolved(compiler);
+  B.ensureResolved(compiler.resolution);
   Element method = B.lookupLocalMember('method');
-  analyzeIn(compiler, method, "{ int i = super.field; }", NOT_ASSIGNABLE);
+  analyzeIn(compiler, method, "{ int i = super.field; }",
+      warnings: NOT_ASSIGNABLE);
   analyzeIn(compiler, method, "{ Object o = super.field; }");
   analyzeIn(compiler, method, "{ String s = super.field; }");
 }
@@ -1210,18 +1518,21 @@
                      }""";
   compiler.parseScript(script);
   ClassElement foo = compiler.mainApp.find("Foo");
-  foo.ensureResolved(compiler);
+  foo.ensureResolved(compiler.resolution);
   Element method = foo.lookupLocalMember('method');
 
   analyzeIn(compiler, method, "{ Type type = T; }");
-  analyzeIn(compiler, method, "{ T type = T; }", NOT_ASSIGNABLE);
-  analyzeIn(compiler, method, "{ int type = T; }", NOT_ASSIGNABLE);
+  analyzeIn(compiler, method, "{ T type = T; }", warnings: NOT_ASSIGNABLE);
+  analyzeIn(compiler, method, "{ int type = T; }", warnings: NOT_ASSIGNABLE);
 
   analyzeIn(compiler, method, "{ String typeName = T.toString(); }");
-  analyzeIn(compiler, method, "{ T.foo; }", MEMBER_NOT_FOUND);
-  analyzeIn(compiler, method, "{ T.foo = 0; }", MessageKind.SETTER_NOT_FOUND);
-  analyzeIn(compiler, method, "{ T.foo(); }", MessageKind.METHOD_NOT_FOUND);
-  analyzeIn(compiler, method, "{ T + 1; }", MessageKind.OPERATOR_NOT_FOUND);
+  analyzeIn(compiler, method, "{ T.foo; }", warnings: MEMBER_NOT_FOUND);
+  analyzeIn(compiler, method, "{ T.foo = 0; }",
+      warnings: MessageKind.SETTER_NOT_FOUND);
+  analyzeIn(compiler, method, "{ T.foo(); }",
+      warnings: MessageKind.METHOD_NOT_FOUND);
+  analyzeIn(compiler, method, "{ T + 1; }",
+      warnings: MessageKind.OPERATOR_NOT_FOUND);
 }
 
 void testTypeVariableLookup1(MockCompiler compiler) {
@@ -1242,11 +1553,11 @@
 
   compiler.parseScript(script);
   ClassElement classTest = compiler.mainApp.find("Test");
-  classTest.ensureResolved(compiler);
+  classTest.ensureResolved(compiler.resolution);
   FunctionElement methodTest = classTest.lookupLocalMember("test");
 
   test(String expression, [message]) {
-    analyzeIn(compiler, methodTest, "{ $expression; }", message);
+    analyzeIn(compiler, methodTest, "{ $expression; }", warnings: message);
   }
 
   test('s.field');
@@ -1282,11 +1593,11 @@
 
   compiler.parseScript(script);
   ClassElement classTest = compiler.mainApp.find("Test");
-  classTest.ensureResolved(compiler);
+  classTest.ensureResolved(compiler.resolution);
   FunctionElement methodTest = classTest.lookupLocalMember("test");
 
   test(String expression, [message]) {
-    analyzeIn(compiler, methodTest, "{ $expression; }", message);
+    analyzeIn(compiler, methodTest, "{ $expression; }", warnings: message);
   }
 
   test('s.field');
@@ -1304,11 +1615,11 @@
 
   compiler.parseScript(script);
   ClassElement classTest = compiler.mainApp.find("Test");
-  classTest.ensureResolved(compiler);
+  classTest.ensureResolved(compiler.resolution);
   FunctionElement methodTest = classTest.lookupLocalMember("test");
 
   test(String expression, [message]) {
-    analyzeIn(compiler, methodTest, "{ $expression; }", message);
+    analyzeIn(compiler, methodTest, "{ $expression; }", warnings: message);
   }
 
   test('s.toString');
@@ -2015,22 +2326,23 @@
                      }""";
   compiler.parseScript(script);
   ClassElement foo = compiler.mainApp.find("Foo");
-  foo.ensureResolved(compiler);
+  foo.ensureResolved(compiler.resolution);
   FunctionElement method = foo.lookupLocalMember('method');
   analyzeIn(compiler, method, "{ await 0; }");
   analyzeIn(compiler, method, "{ int i = await 0; }");
-  analyzeIn(compiler, method, "{ String s = await 0; }", NOT_ASSIGNABLE);
+  analyzeIn(compiler, method, "{ String s = await 0; }",
+      warnings: NOT_ASSIGNABLE);
   analyzeIn(compiler, method, "{ await asyncInt(); }");
   analyzeIn(compiler, method, "{ int i = await asyncInt(); }");
   analyzeIn(compiler, method, "{ String s = await asyncInt(); }",
-            NOT_ASSIGNABLE);
+      warnings: NOT_ASSIGNABLE);
   analyzeIn(compiler, method, "{ Foo f = self(); }");
   analyzeIn(compiler, method, "{ Foo f = await self(); }");
   analyzeIn(compiler, method, "{ Foo f = await self().asyncInt(); }",
-            NOT_ASSIGNABLE);
+      warnings: NOT_ASSIGNABLE);
   analyzeIn(compiler, method, "{ int i = await self().asyncInt(); }");
   analyzeIn(compiler, method, "{ String s = await self().asyncInt(); }",
-            NOT_ASSIGNABLE);
+      warnings: NOT_ASSIGNABLE);
 }
 
 testAsyncReturn(MockCompiler compiler) {
@@ -2074,6 +2386,8 @@
     check("int foo() async => 0;", NOT_ASSIGNABLE),
     check("int foo() async => new Future<int>.value();",
           NOT_ASSIGNABLE),
+    check("Iterable<int> foo() sync* { return; }"),
+    check("Stream<int> foo() async* { return; }"),
   ]);
 }
 
@@ -2173,7 +2487,7 @@
   if (expectedWarnings == null) expectedWarnings = [];
   if (expectedWarnings is !List) expectedWarnings = [expectedWarnings];
 
-  MockCompiler compiler = new MockCompiler.internal();
+  MockCompiler compiler = new MockCompiler.internal(enableAsyncAwait: true);
   compiler.diagnosticHandler = createHandler(compiler, text);
 
   return compiler.init("import 'dart:async';").then((_) {
@@ -2192,17 +2506,17 @@
       element = elements.head;
       if (element.isClass) {
         ClassElementX classElement = element;
-        classElement.ensureResolved(compiler);
+        classElement.ensureResolved(compiler.resolution);
         classElement.forEachLocalMember((Element e) {
           if (!e.isSynthesized) {
             element = e;
-            node = element.parseNode(compiler);
+            node = element.parseNode(compiler.parsing);
             compiler.resolver.resolve(element);
             mapping = element.treeElements;
           }
         });
       } else {
-        node = element.parseNode(compiler);
+        node = element.parseNode(compiler.parsing);
         compiler.resolver.resolve(element);
         mapping = element.treeElements;
       }
@@ -2236,7 +2550,7 @@
   compiler.diagnosticHandler = createHandler(compiler, text);
 
   Token tokens = scan(text);
-  NodeListener listener = new NodeListener(compiler, null);
+  NodeListener listener = new NodeListener(compiler.reporter, null);
   Parser parser = new Parser(listener);
   parser.parseStatement(tokens);
   Node node = listener.popNode();
@@ -2275,13 +2589,15 @@
 analyzeIn(MockCompiler compiler,
           FunctionElement element,
           String text,
-          [expectedWarnings]) {
-  if (expectedWarnings == null) expectedWarnings = [];
-  if (expectedWarnings is !List) expectedWarnings = [expectedWarnings];
+          {warnings, hints}) {
+  if (warnings == null) warnings = [];
+  if (warnings is !List) warnings = [warnings];
+  if (hints == null) hints = [];
+  if (hints is !List) hints = [hints];
 
   compiler.resolver.resolve(element);
   Token tokens = scan(text);
-  NodeListener listener = new NodeListener(compiler, null);
+  NodeListener listener = new NodeListener(compiler.reporter, null);
   Parser parser = new Parser(listener,
       yieldIsKeyword: element.asyncMarker.isYielding,
       awaitIsKeyword: element.asyncMarker.isAsync);
@@ -2293,5 +2609,6 @@
   compiler.clearMessages();
   checker.analyze(node);
   generateOutput(compiler, text);
-  compareWarningKinds(text, expectedWarnings, compiler.warnings);
+  compareWarningKinds(text, warnings, compiler.warnings);
+  compareWarningKinds(text, hints, compiler.hints);
 }
diff --git a/tests/compiler/dart2js/type_combination_test.dart b/tests/compiler/dart2js/type_combination_test.dart
index fa2b503d..c75ad56 100644
--- a/tests/compiler/dart2js/type_combination_test.dart
+++ b/tests/compiler/dart2js/type_combination_test.dart
@@ -2,12 +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 "package:async_helper/async_helper.dart";
-import "package:expect/expect.dart";
-import "compiler_helper.dart";
-import "package:compiler/src/types/types.dart";
-import "type_mask_test_helper.dart";
+import 'package:async_helper/async_helper.dart';
+import 'package:expect/expect.dart';
 import 'package:compiler/src/js_backend/js_backend.dart';
+import 'package:compiler/src/types/types.dart';
+import 'package:compiler/src/world.dart';
+import 'compiler_helper.dart';
+import 'type_mask_test_helper.dart';
 
 TypeMask nullType;
 TypeMask objectType;
@@ -733,13 +734,21 @@
     World world = compiler.world;
     backend.interceptorsLibrary.forEachLocalMember((element) {
       if (element.isClass) {
-        element.ensureResolved(compiler);
-        compiler.enqueuer.resolution.registerInstantiatedType(
-            element.rawType, compiler.globalDependencies);
+        element.ensureResolved(compiler.resolution);
+        backend.registerInstantiatedType(
+            element.rawType,
+            compiler.enqueuer.resolution,
+            compiler.globalDependencies);
       }
     });
-    compiler.enqueuer.resolution.registerInstantiatedType(
-        compiler.coreTypes.mapType(), compiler.globalDependencies);
+    backend.registerInstantiatedType(
+        compiler.coreTypes.mapType(),
+        compiler.enqueuer.resolution,
+        compiler.globalDependencies);
+    backend.registerInstantiatedType(
+        compiler.coreTypes.functionType,
+        compiler.enqueuer.resolution,
+        compiler.globalDependencies);
     compiler.world.populate();
 
     // Grab hold of a supertype for String so we can produce potential
diff --git a/tests/compiler/dart2js/type_equals_test.dart b/tests/compiler/dart2js/type_equals_test.dart
index 16e1066..0911d60 100644
--- a/tests/compiler/dart2js/type_equals_test.dart
+++ b/tests/compiler/dart2js/type_equals_test.dart
@@ -6,20 +6,21 @@
 import "package:async_helper/async_helper.dart";
 import 'package:compiler/src/dart_types.dart';
 import "compiler_helper.dart";
-import "parser_helper.dart";
 
 bool test(compiler, String name1, String name2, {bool expect}) {
   Expect.isTrue((expect != null), 'required parameter "expect" not given');
   var clazz = findElement(compiler, "Class");
-  clazz.ensureResolved(compiler);
+  clazz.ensureResolved(compiler.resolution);
   var element1 = clazz.buildScope().lookup(name1);
   var element2 = clazz.buildScope().lookup(name2);
   Expect.isNotNull(element1);
   Expect.isNotNull(element2);
   Expect.equals(element1.kind, ElementKind.FUNCTION);
   Expect.equals(element2.kind, ElementKind.FUNCTION);
-  FunctionSignature signature1 = element1.computeSignature(compiler);
-  FunctionSignature signature2 = element2.computeSignature(compiler);
+  element1.computeType(compiler.resolution);
+  element2.computeType(compiler.resolution);
+  FunctionSignature signature1 = element1.functionSignature;
+  FunctionSignature signature2 = element2.functionSignature;
 
   // Function signatures are used to be to provide void types (only occuring as
   // as return types) and (inlined) function types (only occuring as method
diff --git a/tests/compiler/dart2js/type_inference7_test.dart b/tests/compiler/dart2js/type_inference7_test.dart
new file mode 100644
index 0000000..64b8cbc
--- /dev/null
+++ b/tests/compiler/dart2js/type_inference7_test.dart
@@ -0,0 +1,79 @@
+// Copyright (c) 2011, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import "package:async_helper/async_helper.dart";
+import "package:expect/expect.dart";
+import 'compiler_helper.dart';
+import 'type_mask_test_helper.dart';
+import 'dart:async';
+
+const String TEST = r"""
+foo(x, [y]) => y;
+
+main() {
+  assert(foo('Hi', true), foo(true));
+  foo(1);
+}
+""";
+
+Future runTest() async {
+  Uri uri = new Uri(scheme: 'source');
+  {
+    // Assertions enabled:
+    var compiler = compilerFor(TEST, uri, enableUserAssertions: true);
+    await compiler.runCompiler(uri);
+    var typesTask = compiler.typesTask;
+    var typesInferrer = typesTask.typesInferrer;
+    var foo = findElement(compiler, "foo");
+    // Return type is null|bool.
+    var mask = typesInferrer.getReturnTypeOfElement(foo);
+    Expect.isTrue(mask.isNullable);
+    Expect.equals(typesTask.boolType, simplify(mask.nonNullable(), compiler));
+    // First parameter is uint31|String|bool.
+    var mask1 = typesInferrer.getTypeOfElement(foo.parameters[0]);
+    Expect.isTrue(mask1.isUnion);
+    var expectedTypes = new Set.from([typesTask.uint31Type,
+                                      typesTask.stringType,
+                                      typesTask.boolType]);
+    for (var typeMask in mask1.disjointMasks) {
+      Expect.isFalse(typeMask.isNullable);
+      var simpleType = simplify(typeMask, compiler);
+      Expect.isTrue(expectedTypes.remove(simpleType), "$simpleType");
+    }
+    Expect.isTrue(expectedTypes.isEmpty);
+    // Second parameter is bool or null.
+    var mask2 = typesInferrer.getTypeOfElement(foo.parameters[1]);
+    Expect.isTrue(mask2.isNullable);
+    Expect.equals(typesTask.boolType, simplify(mask2.nonNullable(), compiler));
+  }
+
+  {
+    // Assertions disabled:
+    var compiler = compilerFor(TEST, uri, enableUserAssertions: false);
+    await compiler.runCompiler(uri);
+    var typesTask = compiler.typesTask;
+    var typesInferrer = typesTask.typesInferrer;
+    var foo = findElement(compiler, "foo");
+    // Return type is null.
+    var mask = typesInferrer.getReturnTypeOfElement(foo);
+    Expect.isTrue(mask.isNullable);
+    Expect.isTrue(mask.nonNullable().isEmpty);
+    // First parameter is uint31.
+    var mask1 = typesInferrer.getTypeOfElement(foo.parameters[0]);
+    Expect.isFalse(mask1.isNullable);
+    Expect.equals(typesTask.uint31Type, simplify(mask1, compiler));
+    // Second parameter is null.
+    var mask2 = typesInferrer.getTypeOfElement(foo.parameters[1]);
+    Expect.isTrue(mask2.isNullable);
+    Expect.isTrue(simplify(mask2.nonNullable(), compiler).isEmpty);
+  }
+}
+
+main() {
+  asyncStart();
+  runTest().then((_) {
+    // Make sure that the type is still correct when we do a second compilation.
+    return runTest();
+  }).whenComplete(asyncEnd);
+}
diff --git a/tests/compiler/dart2js/type_inference8_test.dart b/tests/compiler/dart2js/type_inference8_test.dart
new file mode 100644
index 0000000..570e43a
--- /dev/null
+++ b/tests/compiler/dart2js/type_inference8_test.dart
@@ -0,0 +1,103 @@
+// 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 "package:async_helper/async_helper.dart";
+import "package:compiler/src/constants/values.dart";
+import "package:compiler/src/types/types.dart";
+import "package:expect/expect.dart";
+import 'compiler_helper.dart';
+import 'type_mask_test_helper.dart';
+
+import 'dart:async';
+
+const String TEST1 = r"""
+foo(x) {
+  return x;
+}
+
+bar(x) {
+  if (x) {
+    print("aaa");
+  } else {
+    print("bbb");
+  }
+}
+
+main() {
+  bar(foo(false));
+  bar(foo(foo(false)));
+}
+""";
+
+Future runTest1() {
+  Uri uri = new Uri(scheme: 'source');
+  var compiler = compilerFor(TEST1, uri);
+  return compiler.runCompiler(uri).then((_) {
+    var typesTask = compiler.typesTask;
+    var typesInferrer = typesTask.typesInferrer;
+    var element = findElement(compiler, "foo");
+    var mask = typesInferrer.getReturnTypeOfElement(element);
+    var falseType =
+        new ValueTypeMask(typesTask.boolType, new FalseConstantValue());
+    // 'foo' should always return false
+    Expect.equals(falseType, mask);
+    // the argument to 'bar' is always false
+    var bar = findElement(compiler, "bar");
+    var barArg = bar.parameters.first;
+    var barArgMask = typesInferrer.getTypeOfElement(barArg);
+    Expect.equals(falseType, barArgMask);
+    var barCode = compiler.backend.getGeneratedCode(bar);
+    Expect.isTrue(barCode.contains('"bbb"'));
+    Expect.isFalse(barCode.contains('"aaa"'));
+  });
+}
+
+const String TEST2 = r"""
+foo(x) {
+  if (x > 3) return true;
+  return false;
+}
+
+bar(x) {
+  if (x) {
+    print("aaa");
+  } else {
+    print("bbb");
+  }
+}
+
+main() {
+  bar(foo(5));
+  bar(foo(6));
+}
+""";
+
+Future runTest2() {
+  Uri uri = new Uri(scheme: 'source');
+  var compiler = compilerFor(TEST2, uri);
+  return compiler.runCompiler(uri).then((_) {
+    var typesTask = compiler.typesTask;
+    var typesInferrer = typesTask.typesInferrer;
+    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
+    Expect.identical(typesTask.boolType, mask);
+    var bar = findElement(compiler, "bar");
+    var barArg = bar.parameters.first;
+    var barArgMask = typesInferrer.getTypeOfElement(barArg);
+    // The argument to bar should have the same type as the return type of foo
+    Expect.identical(typesTask.boolType, barArgMask);
+    var barCode = compiler.backend.getGeneratedCode(bar);
+    Expect.isTrue(barCode.contains('"bbb"'));
+    // Still must output the print for "aaa"
+    Expect.isTrue(barCode.contains('"aaa"'));
+  });
+}
+
+main() {
+  asyncStart();
+  runTest1().then((_) {
+    return runTest2();
+  }).whenComplete(asyncEnd);
+}
diff --git a/tests/compiler/dart2js/type_mask_test.dart b/tests/compiler/dart2js/type_mask_test.dart
index 7cbe9e4..fa7d108 100644
--- a/tests/compiler/dart2js/type_mask_test.dart
+++ b/tests/compiler/dart2js/type_mask_test.dart
@@ -2,11 +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:async_helper/async_helper.dart';
 import 'package:expect/expect.dart';
-import "package:async_helper/async_helper.dart";
+import 'package:compiler/src/types/types.dart';
+
 import 'compiler_helper.dart';
-import 'parser_helper.dart';
-import "package:compiler/src/types/types.dart";
 
 const String CODE = """
 class A {}
diff --git a/tests/compiler/dart2js/type_mask_test_helper.dart b/tests/compiler/dart2js/type_mask_test_helper.dart
index 1efb937..e27c463 100644
--- a/tests/compiler/dart2js/type_mask_test_helper.dart
+++ b/tests/compiler/dart2js/type_mask_test_helper.dart
@@ -5,7 +5,7 @@
 library type_mask_test_helper;
 
 import 'package:compiler/src/types/types.dart';
-import 'package:compiler/src/dart2jslib.dart'
+import 'package:compiler/src/compiler.dart'
     show Compiler;
 
 TypeMask simplify(TypeMask mask, Compiler compiler) {
diff --git a/tests/compiler/dart2js/type_order_test.dart b/tests/compiler/dart2js/type_order_test.dart
index e4faa01..dff24fc 100644
--- a/tests/compiler/dart2js/type_order_test.dart
+++ b/tests/compiler/dart2js/type_order_test.dart
@@ -44,15 +44,15 @@
     InterfaceType A_X_Y = add(instantiate(A, [X, Y]));
     InterfaceType A_Y_X = add(instantiate(A, [Y, X]));
 
-    TypedefType B_this = add(B.computeType(env.compiler));
+    TypedefType B_this = add(B.computeType(env.compiler.resolution));
     TypedefType B_raw = add(B.rawType);
     TypeVariableType BT = add(B_this.typeArguments[0]);
     TypeVariableType BS = add(B_this.typeArguments[1]);
     FunctionType B_this_alias = add(B.alias);
     TypedefType B_X_Y = add(instantiate(B, [X, Y]));
-    FunctionType B_X_Y_alias = add(B_X_Y.unalias(env.compiler));
+    FunctionType B_X_Y_alias = add(B_X_Y.unaliased);
     TypedefType B_Y_X = add(instantiate(B, [Y, X]));
-    FunctionType B_Y_X_alias = add(B_Y_X.unalias(env.compiler));
+    FunctionType B_Y_X_alias = add(B_Y_X.unaliased);
 
     InterfaceType C_this = add(C.thisType);
     InterfaceType C_raw = add(C.rawType);
diff --git a/tests/compiler/dart2js/type_representation_test.dart b/tests/compiler/dart2js/type_representation_test.dart
index 81c3654..83f4806 100644
--- a/tests/compiler/dart2js/type_representation_test.dart
+++ b/tests/compiler/dart2js/type_representation_test.dart
@@ -133,7 +133,8 @@
     expect(dynamic_, 'null');
 
     // List<E>
-    expect(List_.computeType(env.compiler), '[$List_rep, $List_E_rep]');
+    expect(List_.computeType(env.compiler.resolution),
+        '[$List_rep, $List_E_rep]');
     // List
     expect(List_.rawType, '$List_rep');
     // List<dynamic>
@@ -194,7 +195,7 @@
           '$args: [$int_rep], $opt: [,]}], $typedefTag: $Typedef10_rep}]');
 
     // Map<K,V>
-    expect(Map_.computeType(env.compiler),
+    expect(Map_.computeType(env.compiler.resolution),
            '[$Map_rep, $Map_K_rep, $Map_V_rep]');
     // Map
     expect(Map_.rawType, '$Map_rep');
@@ -206,49 +207,49 @@
 
 
     // void m1() {}
-    expect(env.getElement('m1').computeType(env.compiler),
+    expect(env.getElement('m1').computeType(env.compiler.resolution),
            '{$func: 1, $retvoid: true}');
 
     // int m2() => 0;
-    expect(env.getElement('m2').computeType(env.compiler),
+    expect(env.getElement('m2').computeType(env.compiler.resolution),
            '{$func: 1, $ret: $int_rep}');
 
     // List<int> m3() => null;
-    expect(env.getElement('m3').computeType(env.compiler),
+    expect(env.getElement('m3').computeType(env.compiler.resolution),
            '{$func: 1, $ret: [$List_rep, $int_rep]}');
 
     // m4() {}
-    expect(env.getElement('m4').computeType(env.compiler),
+    expect(env.getElement('m4').computeType(env.compiler.resolution),
            '{$func: 1}');
 
     // m5(int a, String b) {}
-    expect(env.getElement('m5').computeType(env.compiler),
+    expect(env.getElement('m5').computeType(env.compiler.resolution),
            '{$func: 1, $args: [$int_rep, $String_rep]}');
 
     // m6(int a, [String b]) {}
-    expect(env.getElement('m6').computeType(env.compiler),
+    expect(env.getElement('m6').computeType(env.compiler.resolution),
            '{$func: 1, $args: [$int_rep],'
            ' $opt: [$String_rep]}');
 
     // m7(int a, String b, [List<int> c, d]) {}
-    expect(env.getElement('m7').computeType(env.compiler),
+    expect(env.getElement('m7').computeType(env.compiler.resolution),
            '{$func: 1,'
            ' $args: [$int_rep, $String_rep],'
            ' $opt: [[$List_rep, $int_rep],,]}');
 
     // m8(int a, {String b}) {}
-    expect(env.getElement('m8').computeType(env.compiler),
+    expect(env.getElement('m8').computeType(env.compiler.resolution),
            '{$func: 1,'
            ' $args: [$int_rep], $named: {b: $String_rep}}');
 
     // m9(int a, String b, {List<int> c, d}) {}
-    expect(env.getElement('m9').computeType(env.compiler),
+    expect(env.getElement('m9').computeType(env.compiler.resolution),
            '{$func: 1,'
            ' $args: [$int_rep, $String_rep],'
            ' $named: {c: [$List_rep, $int_rep], d: null}}');
 
     // m10(void f(int a, [b])) {}
-    expect(env.getElement('m10').computeType(env.compiler),
+    expect(env.getElement('m10').computeType(env.compiler.resolution),
            '{$func: 1, $args:'
            ' [{$func: 1,'
            ' $retvoid: true, $args: [$int_rep], $opt: [,]}]}');
diff --git a/tests/compiler/dart2js/type_substitution_test.dart b/tests/compiler/dart2js/type_substitution_test.dart
index 17a4b14..c8040e5 100644
--- a/tests/compiler/dart2js/type_substitution_test.dart
+++ b/tests/compiler/dart2js/type_substitution_test.dart
@@ -4,20 +4,20 @@
 
 library type_substitution_test;
 
-import "package:expect/expect.dart";
-import "package:async_helper/async_helper.dart";
+import 'package:expect/expect.dart';
+import 'package:async_helper/async_helper.dart';
 import 'package:compiler/src/dart_types.dart';
-import "compiler_helper.dart";
-import "parser_helper.dart";
-import "type_test_helper.dart";
+import 'compiler_helper.dart';
+import 'type_test_helper.dart';
 
 DartType getType(compiler, String name) {
   var clazz = findElement(compiler, "Class");
-  clazz.ensureResolved(compiler);
+  clazz.ensureResolved(compiler.resolution);
   var element = clazz.buildScope().lookup(name);
   Expect.isNotNull(element);
   Expect.equals(element.kind, ElementKind.FUNCTION);
-  FunctionSignature signature = element.computeSignature(compiler);
+  element.computeType(compiler.resolution);
+  FunctionSignature signature = element.functionSignature;
 
   // Function signatures are used to be to provide void types (only occuring as
   // as return types) and (inlined) function types (only occuring as method
@@ -211,7 +211,7 @@
     Expect.isNotNull(Typedef2_int_String);
     DartType Function_int_String = getType(compiler, "Function2b");
     Expect.isNotNull(Function_int_String);
-    DartType unalias1 = Typedef2_int_String.unalias(compiler);
+    DartType unalias1 = Typedef2_int_String.unaliased;
     Expect.equals(Function_int_String, unalias1,
         '$Typedef2_int_String.unalias=$unalias1 != $Function_int_String');
 
@@ -219,7 +219,7 @@
     Expect.isNotNull(Typedef1);
     DartType Function_dynamic_dynamic = getType(compiler, "Function1c");
     Expect.isNotNull(Function_dynamic_dynamic);
-    DartType unalias2 = Typedef1.unalias(compiler);
+    DartType unalias2 = Typedef1.unaliased;
     Expect.equals(Function_dynamic_dynamic, unalias2,
         '$Typedef1.unalias=$unalias2 != $Function_dynamic_dynamic');
   }));
diff --git a/tests/compiler/dart2js/type_test_helper.dart b/tests/compiler/dart2js/type_test_helper.dart
index f571b36..32ed3ff 100644
--- a/tests/compiler/dart2js/type_test_helper.dart
+++ b/tests/compiler/dart2js/type_test_helper.dart
@@ -8,8 +8,9 @@
 import 'package:expect/expect.dart';
 import 'compiler_helper.dart' as mock;
 import 'memory_compiler.dart' as memory;
+import 'package:compiler/src/commandline_options.dart';
 import 'package:compiler/src/dart_types.dart';
-import 'package:compiler/src/dart2jslib.dart'
+import 'package:compiler/src/compiler.dart'
     show Compiler;
 import 'package:compiler/src/elements/elements.dart'
     show Element,
@@ -62,10 +63,10 @@
       memory.DiagnosticCollector collector = new memory.DiagnosticCollector();
       uri = Uri.parse('memory:main.dart');
       compiler = memory.compilerFor(
-          {'main.dart': source},
+          memorySourceFiles: {'main.dart': source},
           diagnosticHandler: collector,
           options: stopAfterTypeInference
-              ? [] : ['--analyze-all', '--analyze-only']);
+              ? [] : [Flags.analyzeAll, Flags.analyzeOnly]);
       getErrors = () => collector.errors;
       getWarnings = () => collector.warnings;
     }
@@ -91,15 +92,15 @@
     var element = compiler.mainApp.find(name);
     Expect.isNotNull(element);
     if (element.isClass) {
-      element.ensureResolved(compiler);
+      element.ensureResolved(compiler.resolution);
     } else if (element.isTypedef) {
-      element.computeType(compiler);
+      element.computeType(compiler.resolution);
     }
     return element;
   }
 
   DartType getElementType(String name) {
-    return getElement(name).computeType(compiler);
+    return getElement(name).computeType(compiler.resolution);
   }
 
   DartType operator[] (String name) {
@@ -110,7 +111,7 @@
 
   DartType getMemberType(ClassElement element, String name) {
     Element member = element.localLookup(name);
-    return member.computeType(compiler);
+    return member.computeType(compiler.resolution);
   }
 
   bool isSubtype(DartType T, DartType S) {
diff --git a/tests/compiler/dart2js/type_variable_bound_test.dart b/tests/compiler/dart2js/type_variable_bound_test.dart
index 6844abb..b93c42d 100644
--- a/tests/compiler/dart2js/type_variable_bound_test.dart
+++ b/tests/compiler/dart2js/type_variable_bound_test.dart
@@ -9,7 +9,8 @@
 
 Future compile(String source) {
   Uri uri = Uri.parse('test:code');
-  var compiler = compilerFor(source, uri, analyzeOnly: true);
+  var compiler =
+      compilerFor(source, uri, analyzeOnly: true, enableTypeAssertions: true);
   compiler.diagnosticHandler = createHandler(compiler, source);
   return compiler.runCompiler(uri).then((_) {
     return compiler;
@@ -71,7 +72,7 @@
     print(compiler.errors);
     Expect.isTrue(compiler.errors.isEmpty, 'unexpected errors');
     Expect.equals(2, compiler.warnings.length,
-                  'expected exactly one error, but got ${compiler.warnings}');
+                  'expected exactly two errors, but got ${compiler.warnings}');
 
     Expect.equals(MessageKind.CYCLIC_TYPE_VARIABLE,
                   compiler.warnings[0].message.kind);
@@ -214,6 +215,41 @@
                 MessageKind.INVALID_TYPE_VARIABLE_BOUND]);
 }
 
+test10() {
+  test(r"""
+class A {
+  const A();
+}
+class Test<T extends A> {
+  final T x = const A();
+  const Test();
+}
+main() {
+  print(const Test<A>());
+}
+""");
+}
+
+// TODO(het): The error is reported twice because both the Dart and JS constant
+// compilers are run on the const constructor, investigate why.
+test11() {
+  test(r"""
+class A {
+  const A();
+}
+class B extends A {
+  const B();
+}
+class Test<T extends A> {
+  final T x = const A();
+  const Test();
+}
+main() {
+  print(const Test<B>());
+}
+""", errors: [MessageKind.NOT_ASSIGNABLE, MessageKind.NOT_ASSIGNABLE]);
+}
+
 main() {
   test1();
   test2();
@@ -224,4 +260,6 @@
   test7();
   test8();
   test9();
+  test10();
+  test11();
 }
diff --git a/tests/compiler/dart2js/union_type_test.dart b/tests/compiler/dart2js/union_type_test.dart
index 1b7e095..c103d6f 100644
--- a/tests/compiler/dart2js/union_type_test.dart
+++ b/tests/compiler/dart2js/union_type_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:expect/expect.dart";
 import "package:async_helper/async_helper.dart";
-import "compiler_helper.dart";
-import "parser_helper.dart";
-
+import "package:expect/expect.dart";
 import "package:compiler/src/types/types.dart";
-import "package:compiler/src/dart_types.dart";
+
+import "compiler_helper.dart";
 
 main() {
   MockCompiler compiler = new MockCompiler.internal(analyzeOnly: true);
diff --git a/tests/compiler/dart2js/unparser2_test.dart b/tests/compiler/dart2js/unparser2_test.dart
index 88940b6..91e13aa 100644
--- a/tests/compiler/dart2js/unparser2_test.dart
+++ b/tests/compiler/dart2js/unparser2_test.dart
@@ -3,20 +3,20 @@
 // BSD-style license that can be found in the LICENSE file.
 
 import "package:expect/expect.dart";
-import "package:compiler/src/scanner/scannerlib.dart";
+import "package:compiler/src/parser/node_listener.dart";
+import "package:compiler/src/parser/parser.dart";
+import "package:compiler/src/scanner/string_scanner.dart";
+import "package:compiler/src/tokens/token.dart";
 import "package:compiler/src/tree/tree.dart";
 
-import "package:compiler/src/dart2jslib.dart"
-    show DiagnosticListener,
-         Script;
-
+import "package:compiler/src/diagnostics/diagnostic_listener.dart";
 import "package:compiler/src/elements/elements.dart"
     show CompilationUnitElement,
          LibraryElement;
-
 import "package:compiler/src/elements/modelx.dart"
     show CompilationUnitElementX,
          LibraryElementX;
+import "package:compiler/src/script.dart";
 
 main() {
   testClassDef();
@@ -99,7 +99,7 @@
   return unparse(node);
 }
 
-class MessageCollector implements DiagnosticListener {
+class MessageCollector extends DiagnosticReporter {
   List<String> messages;
   MessageCollector() {
     messages = [];
diff --git a/tests/compiler/dart2js/unparser_test.dart b/tests/compiler/dart2js/unparser_test.dart
index 86d8ab9..4b9a815 100644
--- a/tests/compiler/dart2js/unparser_test.dart
+++ b/tests/compiler/dart2js/unparser_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 'package:expect/expect.dart';
 import 'parser_helper.dart';
-import 'mock_compiler.dart';
 import 'package:compiler/src/tree/tree.dart';
 
 testUnparse(String statement) {
diff --git a/tests/compiler/dart2js/use_checks_test.dart b/tests/compiler/dart2js/use_checks_test.dart
index 24013ad..4056696 100644
--- a/tests/compiler/dart2js/use_checks_test.dart
+++ b/tests/compiler/dart2js/use_checks_test.dart
@@ -28,8 +28,8 @@
         memorySourceFiles: MEMORY_SOURCE_FILES,
         options: ['--enable-checked-mode']);
     var compiler = result.compiler;
-    var element = compiler.mainApp.findExported('main');
-    var code = compiler.backend.assembleCode(element);
+    var element = compiler.mainFunction;
+    var code = compiler.backend.getGeneratedCode(element);
     Expect.isTrue(code.contains('+'), code);
   });
 }
diff --git a/tests/compiler/dart2js/use_strict_test.dart b/tests/compiler/dart2js/use_strict_test.dart
index b99bfe0..d3eb09b 100644
--- a/tests/compiler/dart2js/use_strict_test.dart
+++ b/tests/compiler/dart2js/use_strict_test.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:async';
-
 import 'package:async_helper/async_helper.dart';
 import 'package:expect/expect.dart';
 import 'memory_compiler.dart';
diff --git a/tests/compiler/dart2js/value_range3_test.dart b/tests/compiler/dart2js/value_range3_test.dart
index 5a483ed..91c3c37 100644
--- a/tests/compiler/dart2js/value_range3_test.dart
+++ b/tests/compiler/dart2js/value_range3_test.dart
@@ -26,8 +26,8 @@
   asyncTest(() async {
     var result = await runCompiler(memorySourceFiles: MEMORY_SOURCE_FILES);
     var compiler = result.compiler;
-    var element = compiler.mainApp.findExported('main');
-    var code = compiler.backend.assembleCode(element);
+    var element = compiler.mainFunction;
+    var code = compiler.backend.getGeneratedCode(element);
     Expect.isFalse(code.contains('ioore'));
   });
 }
diff --git a/tests/compiler/dart2js/warnings_checker.dart b/tests/compiler/dart2js/warnings_checker.dart
index cf31943..1652a1e 100644
--- a/tests/compiler/dart2js/warnings_checker.dart
+++ b/tests/compiler/dart2js/warnings_checker.dart
@@ -10,6 +10,7 @@
 import 'package:expect/expect.dart';
 import 'package:async_helper/async_helper.dart';
 import 'memory_compiler.dart';
+import 'package:compiler/src/commandline_options.dart';
 import 'package:compiler/src/filenames.dart';
 import 'package:compiler/src/io/source_file.dart';
 import 'package:compiler/src/source_file_provider.dart';
@@ -41,7 +42,7 @@
     await runCompiler(
         entryPoint: uri,
         diagnosticHandler: collector,
-        options: ['--analyze-only'],
+        options: [Flags.analyzeOnly],
         showDiagnostics: verbose);
     Map<String, List<int>> statusMap = tests[test];
     // Line numbers with known unexpected warnings.
diff --git a/tests/compiler/dart2js/world_test.dart b/tests/compiler/dart2js/world_test.dart
index 4acd90f..13a0821 100644
--- a/tests/compiler/dart2js/world_test.dart
+++ b/tests/compiler/dart2js/world_test.dart
@@ -9,7 +9,7 @@
 import 'type_test_helper.dart';
 import 'package:compiler/src/elements/elements.dart'
        show Element, ClassElement;
-import 'package:compiler/src/dart2jslib.dart';
+import 'package:compiler/src/world.dart' show ClassWorld;
 
 void main() {
   asyncTest(() => TypeEnvironment.create(r"""
diff --git a/tests/compiler/dart2js_extra/22868_test.dart b/tests/compiler/dart2js_extra/22868_test.dart
index 185e0f6..0d83b955 100644
--- a/tests/compiler/dart2js_extra/22868_test.dart
+++ b/tests/compiler/dart2js_extra/22868_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.
 
-// Regression test for http://dartbug.com/22868/
+// Regression test for http://dartbug.com/22868/ and http://dartbug.com/22895/.
 // Ensure that the closure tracer properly handles await.
 
 main() async {
   var closures = [(x, y) => x + y];
   print(((await closures)[0])(4, 2));
 }
-
diff --git a/tests/compiler/dart2js_extra/22895_test.dart b/tests/compiler/dart2js_extra/22895_test.dart
deleted file mode 100644
index 73f120d..0000000
--- a/tests/compiler/dart2js_extra/22895_test.dart
+++ /dev/null
@@ -1,11 +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.
-
-// Regression test for http://dartbug.com/22895/
-// Ensure that the type graph is retained in presence of await.
-
-main() async {
-  var closures = [(x, y) => x + y];
-  print(((await closures)[0])(4, 2));
-}
diff --git a/tests/compiler/dart2js_extra/assert_with_message_test.dart b/tests/compiler/dart2js_extra/assert_with_message_test.dart
new file mode 100644
index 0000000..58b7796
--- /dev/null
+++ b/tests/compiler/dart2js_extra/assert_with_message_test.dart
@@ -0,0 +1,109 @@
+// 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.
+// SharedOptions=--assert-message
+
+import "package:expect/expect.dart";
+
+@AssumeDynamic() @NoInline()
+confuse(x) => x;
+
+
+testFalse(name, fault) {
+  try {
+    fault();
+  } catch (e) {
+    Expect.isTrue(e is AssertionError, '$name: is AssertionError');
+    Expect.isTrue('$e'.contains('Mumble'), '$name: <<$e>> contains "Mumble"');
+    return;
+  }
+  Expect.fail('Expected assert to throw');
+}
+
+test1() {
+  testFalse('constant false', () { assert(false, 'Mumble'); });
+}
+
+test2() {
+  testFalse('constant function', () { assert(() => false, 'Mumble'); });
+}
+
+test3() {
+  testFalse('variable false', () { assert(confuse(false), 'Mumble'); });
+}
+
+test4() {
+  testFalse('variable function',
+      () { assert(confuse(() => false), 'Mumble'); });
+}
+
+testTypeErrors() {
+  check(name, fault) {
+    try {
+      fault();
+    } catch (e) {
+      Expect.isTrue(e is TypeError,
+          'name: <<$e>> (${e.runtimeType}) is TypeError');
+      return;
+    }
+    Expect.fail('Expected assert to throw');
+  }
+
+  check('constant type error', () { assert(null, 'Mumble'); });
+  check('variable type error', () { assert(confuse(null), 'Mumble'); });
+  check('function type error', () { assert(confuse(() => null), 'Mumble'); });
+}
+
+testMessageEffect1() {
+  var v = 1;
+  // Message is not evaluated on succeeding assert.
+  assert(confuse(true), '${v = 123}');
+  Expect.equals(1, v);
+}
+
+testMessageEffect2() {
+  var v = 1;
+  try {
+    // Message is evaluated to produce AssertionError argument on failing
+    // assert.
+    assert(confuse(false), '${v = 123}');
+  } catch (e) {
+    Expect.equals(123, v);
+    Expect.isTrue('$e'.contains('123'), '<<$e>> contains "123"');
+    return;
+  }
+  Expect.fail('Expected assert to throw');
+}
+
+testMessageEffect3() {
+  var v = 1;
+  try {
+    // Message is evaluated to produce AssertionError argument on failing
+    // assert.
+    assert(confuse(() => ++v > 100), '${++v}');
+  } catch (e) {
+    Expect.equals(3, v);
+    Expect.isTrue('$e'.contains('3'), '<<$e>> contains "3"');
+    return;
+  }
+  Expect.fail('Expected assert to throw');
+}
+
+bool get checkedMode {
+  bool b = false;
+  assert((b = true));
+  return b;
+}
+
+main() {
+  if (!checkedMode) return;
+
+  test1();
+  test2();
+  test3();
+  test4();
+  testTypeErrors();
+  testMessageEffect1();
+  testMessageEffect2();
+  testMessageEffect3();
+}
diff --git a/tests/compiler/dart2js_extra/dart2js_extra.status b/tests/compiler/dart2js_extra/dart2js_extra.status
index 635ce98..c530b1e 100644
--- a/tests/compiler/dart2js_extra/dart2js_extra.status
+++ b/tests/compiler/dart2js_extra/dart2js_extra.status
@@ -63,28 +63,21 @@
 [ $host_checked && $compiler == dart2js && $cps_ir ]
 21724_test: Crash # Please triage this failure.
 
-[ $compiler == dart2js && $cps_ir ]
-16407_test: Pass # Please triage this failure.
-22868_test: Crash # (main()async{var clo...  cannot handle async/sync*/async* functions
-22895_test: Crash # (main()async{var clo...  cannot handle async/sync*/async* functions
-23432_test: RuntimeError, Pass # Please triage this failure. (Passes for the wrong reason)
-async_stacktrace_test/asyncStar: Crash # (runTests()async{awa...  cannot handle async/sync*/async* functions
-async_stacktrace_test/none: Crash # (runTests()async{awa...  cannot handle async/sync*/async* functions
-closure_capture5_test: Crash # (i=0): For-loop variable captured in loop header
-deferred/deferred_class_test: RuntimeError # Z.loadLibrary is not a function
-deferred/deferred_constant2_test: Crash # (lib.C1): deferred access is not implemented
-deferred/deferred_constant3_test: Crash # (lib.C1): deferred access is not implemented
-deferred/deferred_constant4_test: RuntimeError # B.loadLibrary is not a function
-deferred/deferred_function_test: Crash # (lib.foo): deferred access is not implemented
-deferred/deferred_mirrors1_test: Crash # (lazy.foo()): deferred access is not implemented
-deferred/deferred_overlapping_test: RuntimeError # E.loadLibrary is not a function
-deferred_fail_and_retry_test: Crash # (lib.foo()): deferred access is not implemented
-deferred_fail_and_retry_worker_test: Crash # (lib.foo()): deferred access is not implemented
-deferred_split_test: Crash # (b.createA()): deferred access is not implemented
-mirror_printer_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirror_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-reflect_native_types_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-switch_test/none: Crash # (switch (val){foo:ba...  continue to a labeled switch case
-
 [ $compiler == none && $runtime == vm ]
 invalid_annotation_test/01: MissingCompileTimeError, OK # vm is lazy
+lookup_map/dead_entry_through_mirrors_test: SkipByDesign # Test for tree-shaking, vm never tree-shakes
+
+[ $compiler == dart2js && $cps_ir ]
+16407_test: Pass # Please triage this failure.
+23432_test: RuntimeError # Issue 23432
+async_stacktrace_test/asyncStar: Crash # (foo()async*{try {tr...  cannot handle sync*/async* functions
+closure_capture5_test: Crash # (i=0): For-loop variable captured in loop header
+deferred/deferred_class_test: RuntimeError # Z.loadLibrary is not a function
+deferred/deferred_constant2_test: RuntimeError # U.loadLibrary is not a function
+deferred/deferred_constant3_test: RuntimeError # Y.loadLibrary is not a function
+deferred/deferred_constant4_test: RuntimeError # B.loadLibrary is not a function
+deferred/deferred_function_test: Crash # (lib.foo('a')): deferred access is not implemented
+deferred/deferred_mirrors1_test: RuntimeError # U.loadLibrary is not a function
+deferred/deferred_overlapping_test: RuntimeError # E.loadLibrary is not a function
+deferred_split_test: RuntimeError # Z.loadLibrary is not a function
+switch_test/none: Crash # (switch (val){foo:ba...  continue to a labeled switch case
diff --git a/tests/compiler/dart2js_extra/js_array_index_error_test.dart b/tests/compiler/dart2js_extra/js_array_index_error_test.dart
new file mode 100644
index 0000000..9cfc873
--- /dev/null
+++ b/tests/compiler/dart2js_extra/js_array_index_error_test.dart
@@ -0,0 +1,330 @@
+// 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.
+
+// Test that optimized JSArray indexers enerate the same error as dyncamically
+// dispatched calls.
+
+
+import 'package:expect/expect.dart';
+
+@NoInline() @AssumeDynamic()
+confuse(x) => x;
+
+
+Error getError(action(), name, part) {
+  try {
+    action();
+  } catch (e) {
+    return e;
+  }
+  Expect.fail('must throw: $name: $part');
+}
+
+indexErrorContainsIndex() {
+  makeFault(i) => () => confuse([])[i];
+
+  var name = 'index error contains index';
+  var e1 = getError(makeFault(1234), name, 'small');
+  var e2 = getError(makeFault(1234000), name, 'medium');
+  var e3 = getError(makeFault(1234000000000), name, 'large');
+
+  Expect.equals('$e1', '$e2'.replaceAll('000', ''));
+  Expect.equals('$e1', '$e3'.replaceAll('000', ''));
+  Expect.equals('$e1'.length + 3, '$e2'.length);
+  Expect.equals('$e1'.length + 9, '$e3'.length);
+}
+
+
+compare(name, fault1(), fault2(), fault3()) {
+  var e1 = getError(fault1, name, 'fault1');
+  var e2 = getError(fault2, name, 'fault2');
+  var e3 = getError(fault3, name, 'fault3');
+
+  Expect.equals('$e1', '$e2', '$name: fault1 vs fault2');
+  Expect.equals('$e1', '$e3', '$name: fault1 vs fault3');
+}
+
+// These tests are a bit tedious and avoid common helpers with higher order
+// functions to keep the type inference for each test independent from the
+// others.
+//
+// The 'constant' tests have a constant index which might permit different
+// optimizations to a variable index.  e.g. the compiler might determine HUGE is
+// always out of range since the maximum JavaScript Array length is 2^32.
+//
+// The 'variable' forms take the index as an argument.
+
+const int HUGE = 1000000000000;
+
+constantIndexEmpty() {
+  // Single dynamic receiver indexing might go via one-shot interceptor that
+  // might have an accelerated path.
+  fault1() => confuse([])[0];
+
+  fault2() {
+    var a = [];
+    while (confuse(false)) a.add(1);
+    // Easily inferred type and open coded indexer.
+    return a[0];
+  }
+
+  fault3() {
+    var a = confuse([]);
+    // Multiple indexing might go via shared interceptor.
+    return [a[0], a[1], a[2]];
+  }
+
+  compare('constant index on empty list', fault1, fault2, fault3);
+}
+
+constantIndexHugeEmpty() {
+  // Single dynamic receiver indexing might go via one-shot interceptor that
+  // might have an accelerated path.
+  fault1() => confuse([])[HUGE];
+
+  fault2() {
+    var a = [];
+    while (confuse(false)) a.add(1);
+    return a[HUGE];
+  }
+
+  fault3() {
+    var a = confuse([]);
+    return [a[HUGE], a[1], a[2]];
+  }
+
+  compare('constant index on empty list with huge index',
+      fault1, fault2, fault3);
+}
+
+constantIndexNonempty() {
+  // Single dynamic receiver indexing might go via one-shot interceptor that
+  // might have an accelerated path.
+  fault1() => confuse([1])[1];
+
+  fault2() {
+    var a = [1];
+    while (confuse(false)) a.add(1);
+    // Easily inferred type and open coded indexer.
+    return a[1];
+  }
+
+  fault3() {
+    var a = confuse([1]);
+    // Multiple indexing might go via shared interceptor.
+    return [a[1], a[2], a[3]];
+  }
+
+  compare('constant index on non-empty list', fault1, fault2, fault3);
+}
+
+constantIndexHugeNonempty() {
+  // Single dynamic receiver indexing might go via one-shot interceptor that
+  // might have an accelerated path.
+  fault1() => confuse([1])[HUGE];
+
+  fault2() {
+    var a = [1];
+    while (confuse(false)) a.add(1);
+    // Easily inferred type and open coded indexer.
+    return a[HUGE];
+  }
+
+  fault3() {
+    var a = confuse([1]);
+    // Multiple indexing might go via shared interceptor.
+    return [a[HUGE], a[1], a[2]];
+  }
+
+  compare('constant index on non-empty list with huge index',
+      fault1, fault2, fault3);
+}
+
+constantIndexSetEmpty() {
+  fault1() {
+    // Single dynamic receiver indexing might go via one-shot interceptor that
+    // might have an accelerated path.
+    confuse([])[0] = 0;
+  }
+
+  fault2() {
+    var a = [];
+    while (confuse(false)) a.add(1);
+    // Easily inferred type and open coded indexer.
+    a[0] = 0;
+    return a;
+  }
+
+  fault3() {
+    var a = confuse([]);
+    // Multiple indexing might go via shared interceptor.
+    a[0] = 0;
+    a[1] = 0;
+    a[2] = 0;
+    return a;
+  }
+
+  compare('coinstant index-set on empty list', fault1, fault2, fault3);
+}
+
+constantIndexSetNonempty() {
+  fault1() {
+    // Single dynamic receiver indexing might go via one-shot interceptor that
+    // might have an accelerated path.
+    confuse([1])[1] = 0;
+  }
+
+  fault2() {
+    var a = [1];
+    while (confuse(false)) a.add(1);
+    // Easily inferred type and open coded indexer.
+    a[1] = 0;
+    return a;
+  }
+
+  fault3() {
+    var a = confuse([1]);
+    // Multiple indexing might go via shared interceptor.
+    a[0] = 0;
+    a[1] = 0;
+    a[2] = 0;
+    return a;
+  }
+
+  compare('constant index-set on non-empty list', fault1, fault2, fault3);
+}
+
+
+variableIndexEmpty(index, qualifier) {
+  // Single dynamic receiver indexing might go via one-shot interceptor that
+  // might have an accelerated path.
+  fault1() => confuse([])[index];
+
+  fault2() {
+    var a = [];
+    while (confuse(false)) a.add(1);
+    // Easily inferred type and open coded indexer.
+    return a[index];
+  }
+
+  fault3() {
+    var a = confuse([]);
+    // Multiple indexing might go via shared interceptor.
+    return [a[index], a[1], a[2]];
+  }
+
+  compare('general index on empty list $qualifier', fault1, fault2, fault3);
+}
+
+variableIndexNonempty(index, qualifier) {
+  // Single dynamic receiver indexing might go via one-shot interceptor that
+  // might have an accelerated path.
+  fault1() => confuse([1])[index];
+
+  fault2() {
+    var a = [1];
+    while (confuse(false)) a.add(1);
+    // Easily inferred type and open coded indexer.
+    return a[index];
+  }
+
+  fault3() {
+    var a = confuse([1]);
+    // Multiple indexing might go via shared interceptor.
+    return [a[index], a[1], a[2]];
+  }
+
+  compare('variable index on non-empty list $qualifier',
+      fault1, fault2, fault3);
+}
+
+variableIndexSetEmpty(index, qualifier) {
+  fault1() {
+    var a = confuse([]);
+    // Single dynamic receiver indexing might go via one-shot interceptor that
+    // might have an accelerated path.
+    a[index] = 1;
+    return a;
+  }
+
+  fault2() {
+    var a = [];
+    while (confuse(false)) a.add(1);
+    // Easily inferred type and open coded indexer.
+    a[index] = 1;
+    return a;
+  }
+
+  fault3() {
+    var a = confuse([]);
+    // Multiple indexing might go via shared interceptor.
+    a[index] = 1;
+    a[2] = 2;
+    a[3] = 3;
+    return a;
+  }
+
+  compare('variable index-set on empty list $qualifier',
+      fault1, fault2, fault3);
+}
+
+variableIndexSetNonempty(index, qualifier) {
+  fault1() {
+    var a = confuse([1]);
+    // Single dynamic receiver indexing might go via one-shot interceptor that
+    // might have an accelerated path.
+    a[index] = 1;
+    return a;
+  }
+
+  fault2() {
+    var a = [1];
+    while (confuse(false)) a.add(1);
+    // Easily inferred type and open coded indexer.
+    a[index] = 1;
+    return a;
+  }
+
+  fault3() {
+    var a = confuse([1]);
+    // Multiple indexing might go via shared interceptor.
+    a[index] = 1;
+    a[2] = 2;
+    a[3] = 3;
+    return a;
+  }
+
+  compare('variable index-set on non-empty list $qualifier',
+      fault1, fault2, fault3);
+}
+
+
+main() {
+  indexErrorContainsIndex();
+
+  constantIndexEmpty();
+  constantIndexHugeEmpty();
+  constantIndexNonempty();
+  constantIndexHugeNonempty();
+  constantIndexSetEmpty();
+  constantIndexSetNonempty();
+
+  variableIndexEmpty(0, 'zero index');
+  variableIndexEmpty(10, 'small index');
+  variableIndexEmpty(-1, 'negative index');
+  variableIndexEmpty(HUGE, 'huge index');
+
+  variableIndexNonempty(10, 'small index');
+  variableIndexNonempty(-1, 'negative index');
+  variableIndexNonempty(HUGE, 'huge index');
+
+  variableIndexSetEmpty(0, 'zero index');
+  variableIndexSetEmpty(10, 'small index');
+  variableIndexSetEmpty(-1, 'negative index');
+  variableIndexSetEmpty(HUGE, 'huge index');
+
+  variableIndexSetNonempty(10, 'small index');
+  variableIndexSetNonempty(-1, 'negative index');
+  variableIndexSetNonempty(HUGE, 'huge index');
+}
diff --git a/tests/compiler/dart2js_extra/js_array_removeLast_error_test.dart b/tests/compiler/dart2js_extra/js_array_removeLast_error_test.dart
new file mode 100644
index 0000000..6fc14dc
--- /dev/null
+++ b/tests/compiler/dart2js_extra/js_array_removeLast_error_test.dart
@@ -0,0 +1,39 @@
+// 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.
+
+// Test that optimized JSArray removeLast() calls generate the same error as
+// dyncamically dispatched calls.
+
+import 'package:expect/expect.dart';
+
+@NoInline() @AssumeDynamic()
+confuse(x) => x;
+
+
+Error getError(action()) {
+  try {
+    action();
+    Expect.fail('must throw');
+  } catch (e) {
+    return e;
+  }
+}
+
+main() {
+  fault1() {
+    return confuse([]).removeLast();
+  }
+
+  fault2() {
+    var a = [];
+    while (confuse(false)) a.add(1);
+    // This one should be optimized since [a] is a growable JSArray.
+    return a.removeLast();
+  }
+
+  var e1 = getError(fault1);
+  var e2 = getError(fault2);
+
+  Expect.equals('$e1', '$e2');
+}
diff --git a/tests/compiler/dart2js_extra/lookup_map/dead_entry_single_nested_pairs_test.dart b/tests/compiler/dart2js_extra/lookup_map/dead_entry_single_nested_pairs_test.dart
new file mode 100644
index 0000000..79446f2
--- /dev/null
+++ b/tests/compiler/dart2js_extra/lookup_map/dead_entry_single_nested_pairs_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 'package:lookup_map/lookup_map.dart';
+import 'package:expect/expect.dart';
+class A{}
+class B{}
+const map = const LookupMap(const [], const [
+    const LookupMap.pair(A, "the-text-for-A"),
+    const LookupMap.pair(B, "the-text-for-B"),
+]);
+
+main() {
+  Expect.equals(map[A], "the-text-for-A");
+}
diff --git a/tests/compiler/dart2js_extra/lookup_map/dead_entry_test.dart b/tests/compiler/dart2js_extra/lookup_map/dead_entry_test.dart
new file mode 100644
index 0000000..c5fb956
--- /dev/null
+++ b/tests/compiler/dart2js_extra/lookup_map/dead_entry_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 'package:lookup_map/lookup_map.dart';
+import 'package:expect/expect.dart';
+class A{}
+class B{}
+const map = const LookupMap(const [
+    A, "the-text-for-A",
+    B, "the-text-for-B",
+]);
+
+main() {
+  Expect.equals(map[A], "the-text-for-A");
+}
diff --git a/tests/compiler/dart2js_extra/lookup_map/dead_entry_through_mirrors_test.dart b/tests/compiler/dart2js_extra/lookup_map/dead_entry_through_mirrors_test.dart
new file mode 100644
index 0000000..6de44b4
--- /dev/null
+++ b/tests/compiler/dart2js_extra/lookup_map/dead_entry_through_mirrors_test.dart
@@ -0,0 +1,30 @@
+// 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 dead_entry_through_mirrors_test;
+
+import 'package:lookup_map/lookup_map.dart';
+import 'package:expect/expect.dart';
+
+@MirrorsUsed(targets: const [A])
+import 'dart:mirrors';
+
+class A{}
+class B{}
+const map = const LookupMap(const [
+    A, "the-text-for-A",
+    B, "the-text-for-B",
+]);
+
+main() {
+  LibraryMirror lib = currentMirrorSystem().findLibrary(
+      #dead_entry_through_mirrors_test);
+
+  // `A` is included by @MirrorsUsed, so its entry is retained too.
+  ClassMirror aClass = lib.declarations[#A];
+  Expect.equals(map[aClass.reflectedType], "the-text-for-A");
+
+  // `B` is not included altogether.
+  Expect.equals(lib.declarations[#B], null);
+}
diff --git a/tests/compiler/dart2js_extra/lookup_map/discovered_code_test.dart b/tests/compiler/dart2js_extra/lookup_map/discovered_code_test.dart
new file mode 100644
index 0000000..a20af73
--- /dev/null
+++ b/tests/compiler/dart2js_extra/lookup_map/discovered_code_test.dart
@@ -0,0 +1,23 @@
+// 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 'package:lookup_map/lookup_map.dart';
+import 'package:expect/expect.dart';
+
+class A{ A(B x);}
+class B{}
+class C{}
+class D{}
+class E{}
+createA() => new A(map[B][1]());
+createB() => new B();
+const map = const LookupMap(const [
+    A, const ["the-text-for-A", createA],
+    B, const ["the-text-for-B", createB],
+    C, const ["the-text-for-C"],
+]);
+
+main() {
+  Expect.isTrue(map[A][1]() is A);
+}
diff --git a/tests/compiler/dart2js_extra/lookup_map/entries_aside_test.dart b/tests/compiler/dart2js_extra/lookup_map/entries_aside_test.dart
new file mode 100644
index 0000000..6f72418
--- /dev/null
+++ b/tests/compiler/dart2js_extra/lookup_map/entries_aside_test.dart
@@ -0,0 +1,18 @@
+// 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 'package:lookup_map/lookup_map.dart';
+import 'package:expect/expect.dart';
+
+class A{}
+class B{}
+const entries = const [
+  A, "the-text-for-A",
+  B, "the-text-for-B",
+];
+const map = const LookupMap(entries );
+
+main() {
+  Expect.equals(map[A], 'the-text-for-A');
+}
diff --git a/tests/compiler/dart2js_extra/lookup_map/escaping_entries_test.dart b/tests/compiler/dart2js_extra/lookup_map/escaping_entries_test.dart
new file mode 100644
index 0000000..30fa3d3
--- /dev/null
+++ b/tests/compiler/dart2js_extra/lookup_map/escaping_entries_test.dart
@@ -0,0 +1,17 @@
+// 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 'package:lookup_map/lookup_map.dart';
+import 'package:expect/expect.dart';
+class A{}
+class B{}
+const entries = const [
+  A, "the-text-for-A",
+  B, "the-text-for-B",
+];
+const map = const LookupMap(entries);
+main() {
+  entries.forEach(print);
+  Expect.equals(map[A], 'the-text-for-A');
+}
diff --git a/tests/compiler/dart2js_extra/lookup_map/generic_type_test.dart b/tests/compiler/dart2js_extra/lookup_map/generic_type_test.dart
new file mode 100644
index 0000000..1a2fd6e
--- /dev/null
+++ b/tests/compiler/dart2js_extra/lookup_map/generic_type_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 'package:lookup_map/lookup_map.dart';
+import 'package:expect/expect.dart';
+
+class A{}
+class M<T>{ get type => T; }
+const map = const LookupMap(const [
+    A, 'the-text-for-A',
+]);
+
+main() {
+  Expect.equals(map[new M<A>().type], 'the-text-for-A');
+}
diff --git a/tests/compiler/dart2js_extra/lookup_map/live_entry_single_pair_test.dart b/tests/compiler/dart2js_extra/lookup_map/live_entry_single_pair_test.dart
new file mode 100644
index 0000000..2954e23
--- /dev/null
+++ b/tests/compiler/dart2js_extra/lookup_map/live_entry_single_pair_test.dart
@@ -0,0 +1,11 @@
+// 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 'package:lookup_map/lookup_map.dart';
+import 'package:expect/expect.dart';
+class A{}
+const map = const LookupMap.pair(A, "the-text-for-A");
+main() {
+  Expect.equals(map[A], 'the-text-for-A');
+}
diff --git a/tests/compiler/dart2js_extra/lookup_map/live_entry_test.dart b/tests/compiler/dart2js_extra/lookup_map/live_entry_test.dart
new file mode 100644
index 0000000..aa835a8
--- /dev/null
+++ b/tests/compiler/dart2js_extra/lookup_map/live_entry_test.dart
@@ -0,0 +1,13 @@
+// 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 'package:lookup_map/lookup_map.dart';
+import 'package:expect/expect.dart';
+class A{}
+const map = const LookupMap(const [
+    A, "the-text-for-A",
+]);
+main() {
+  Expect.equals(map[A], 'the-text-for-A');
+}
diff --git a/tests/compiler/dart2js_extra/lookup_map/live_entry_through_mirrors_test.dart b/tests/compiler/dart2js_extra/lookup_map/live_entry_through_mirrors_test.dart
new file mode 100644
index 0000000..9ad99cf
--- /dev/null
+++ b/tests/compiler/dart2js_extra/lookup_map/live_entry_through_mirrors_test.dart
@@ -0,0 +1,29 @@
+// 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 live_entry_through_mirrors_test;
+
+import 'package:lookup_map/lookup_map.dart';
+import 'package:expect/expect.dart';
+import 'dart:mirrors';
+
+class A{}
+class B{}
+const map = const LookupMap(const [
+    A, "the-text-for-A",
+    B, "the-text-for-B",
+]);
+
+main() {
+  // `A` is referenced explicitly, so its entry should be retained regardless.
+  ClassMirror aClass = reflectClass(A);
+  Expect.equals(map[aClass.reflectedType], "the-text-for-A");
+
+  // `B` is used via mirrors. Because no @MirrorsUsed was found that's enough to
+  // retain the entry.
+  LibraryMirror lib = currentMirrorSystem().findLibrary(
+      #live_entry_through_mirrors_test);
+  ClassMirror bClass = lib.declarations[#B];
+  Expect.equals(map[bClass.reflectedType], "the-text-for-B");
+}
diff --git a/tests/compiler/dart2js_extra/lookup_map/live_entry_through_mirrors_used_test.dart b/tests/compiler/dart2js_extra/lookup_map/live_entry_through_mirrors_used_test.dart
new file mode 100644
index 0000000..c5b752c
--- /dev/null
+++ b/tests/compiler/dart2js_extra/lookup_map/live_entry_through_mirrors_used_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.
+
+// Subset of dead_entry_through_mirrors_test that is not affected by
+// tree-shaking. This subset can be run in the VM.
+library live_entry_through_mirrors_used_test;
+
+import 'package:lookup_map/lookup_map.dart';
+import 'package:expect/expect.dart';
+
+@MirrorsUsed(targets: const [A])
+import 'dart:mirrors';
+
+class A{}
+class B{}
+const map = const LookupMap(const [
+    A, "the-text-for-A",
+    B, "the-text-for-B",
+]);
+
+main() {
+  // `A` is included by @MirrorsUsed, so its entry is retained too.
+  LibraryMirror lib = currentMirrorSystem().findLibrary(
+      #live_entry_through_mirrors_used_test);
+  ClassMirror aClass = lib.declarations[#A];
+  Expect.equals(map[aClass.reflectedType], "the-text-for-A");
+}
diff --git a/tests/compiler/dart2js_extra/lookup_map/reachable_data2_test.dart b/tests/compiler/dart2js_extra/lookup_map/reachable_data2_test.dart
new file mode 100644
index 0000000..9c82430
--- /dev/null
+++ b/tests/compiler/dart2js_extra/lookup_map/reachable_data2_test.dart
@@ -0,0 +1,23 @@
+// 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 'package:lookup_map/lookup_map.dart';
+import 'package:expect/expect.dart';
+
+class Key { final x; const Key(this.x); }
+const A = const Key(1);
+const B = const Key(2);
+const C = const Key(3);
+const D = const Key(4);
+const E = const Key(5);
+const map = const LookupMap(const [
+    A, const ["the-text-for-A", B],
+    B, const ["the-text-for-B", C],
+    C, const ["the-text-for-C"],
+    D, const ["the-text-for-D", E],
+    E, const ["the-text-for-E"],
+]);
+main() {
+  Expect.equals(map[map[A][1]][0], 'the-text-for-B');
+}
diff --git a/tests/compiler/dart2js_extra/lookup_map/reachable_data_test.dart b/tests/compiler/dart2js_extra/lookup_map/reachable_data_test.dart
new file mode 100644
index 0000000..8e71ea7
--- /dev/null
+++ b/tests/compiler/dart2js_extra/lookup_map/reachable_data_test.dart
@@ -0,0 +1,22 @@
+// 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 'package:lookup_map/lookup_map.dart';
+import 'package:expect/expect.dart';
+
+class A{}
+class B{}
+class C{}
+class D{}
+class E{}
+const map = const LookupMap(const [
+    A, const ["the-text-for-A", B],
+    B, const ["the-text-for-B", C],
+    C, const ["the-text-for-C"],
+    D, const ["the-text-for-D", E],
+    E, const ["the-text-for-E"],
+]);
+main() {
+  Expect.equals(map[map[A][1]][0], 'the-text-for-B');
+}
diff --git a/tests/compiler/dart2js_extra/lookup_map/subclass_lookup_map_test.dart b/tests/compiler/dart2js_extra/lookup_map/subclass_lookup_map_test.dart
new file mode 100644
index 0000000..ebf7416
--- /dev/null
+++ b/tests/compiler/dart2js_extra/lookup_map/subclass_lookup_map_test.dart
@@ -0,0 +1,19 @@
+// 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 'package:lookup_map/lookup_map.dart';
+import 'package:expect/expect.dart';
+class A{}
+class B{}
+class S extends LookupMap {
+  const S(list) : super(list);
+}
+const map = const S(const [
+    A, "the-text-for-A",
+    B, "the-text-for-B",
+]);
+
+main() {
+  Expect.equals(map[A], "the-text-for-A");
+}
diff --git a/tests/compiler/dart2js_native/dart2js_native.status b/tests/compiler/dart2js_native/dart2js_native.status
index 9ea2884..2066a92 100644
--- a/tests/compiler/dart2js_native/dart2js_native.status
+++ b/tests/compiler/dart2js_native/dart2js_native.status
@@ -21,15 +21,11 @@
 compute_this_script_test: Skip # Issue 17458
 
 [ $compiler == dart2js && $cps_ir ]
-mirror_intercepted_field_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-native_exception_test: RuntimeError # value_.toString$0 is not a function
+native_exception_test: RuntimeError # Issue 24421
 native_method_inlining_test: RuntimeError # Please triage this failure.
-native_mirror_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
 native_no_such_method_exception3_frog_test: RuntimeError # Please triage this failure.
 optimization_hints_test: RuntimeError # Please triage this failure.
 subclassing_constructor_1_test: RuntimeError # Please triage this failure.
 subclassing_constructor_2_test: RuntimeError # Please triage this failure.
-subclassing_super_call_test: RuntimeError # this.get$afield is not a function
 subclassing_super_field_1_test: RuntimeError # Please triage this failure.
 subclassing_super_field_2_test: RuntimeError # Please triage this failure.
-super_call_test: RuntimeError # this.bar$0 is not a function
diff --git a/tests/compiler/dart2js_native/error_safeToString_test.dart b/tests/compiler/dart2js_native/error_safeToString_test.dart
new file mode 100644
index 0000000..3322560
--- /dev/null
+++ b/tests/compiler/dart2js_native/error_safeToString_test.dart
@@ -0,0 +1,169 @@
+// 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 "package:expect/expect.dart";
+import 'dart:_foreign_helper' show JS_INTERCEPTOR_CONSTANT, JS;
+import 'dart:_js_helper' show Native, Creates;
+import 'dart:_interceptors' show
+    Interceptor,
+    JavaScriptObject,
+    PlainJavaScriptObject,
+    UnknownJavaScriptObject;
+
+// Test for safe formatting of JavaScript objects by Error.safeToString.
+
+@Native('PPPP')
+class Purple {}
+
+@Native('QQQQ')
+class Q {}
+
+@Native('RRRR')
+class Rascal {
+  toString() => 'RRRRRRRR';
+}
+
+makeA() native;
+makeB() native;
+makeC() native;
+makeD() native;
+makeE() native;
+makeP() native;
+makeQ() native;
+makeR() native;
+
+void setup() native r"""
+makeA = function(){return {hello: 123};};
+
+function BB(){}
+makeB = function(){return new BB();};
+
+function CC(){}
+makeC = function(){
+  var x = new CC();
+  x.constructor = null;  // Foils constructor lookup.
+  return x;
+};
+
+function DD(){}
+makeD = function(){
+  var x = new DD();
+  x.constructor = {name: 'DDxxx'};  // Foils constructor lookup.
+  return x;
+};
+
+function EE(){}
+makeE = function(){
+  var x = new EE();
+  x.constructor = function Liar(){};  // Looks like a legitimate constructor.
+  return x;
+};
+
+function PPPP(){}
+makeP = function(){return new PPPP();};
+
+function QQQQ(){}
+makeQ = function(){return new QQQQ();};
+
+function RRRR(){}
+makeR = function(){return new RRRR();};
+
+""";
+
+
+expectTypeName(expectedName, s) {
+  var m = new RegExp(r"Instance of '(.*)'").firstMatch(s);
+  Expect.isNotNull(m);
+  var name = m.group(1);
+  Expect.isTrue(expectedName == name || name.length <= 3,
+      "Is '$expectedName' or minified: '$name'");
+}
+
+final plainJsString =
+    Error.safeToString(JS_INTERCEPTOR_CONSTANT(PlainJavaScriptObject));
+
+final unknownJsString =
+    Error.safeToString(JS_INTERCEPTOR_CONSTANT(UnknownJavaScriptObject));
+
+final interceptorString =
+    Error.safeToString(JS_INTERCEPTOR_CONSTANT(Interceptor));
+
+
+testDistinctInterceptors() {
+  // Test invariants needed for the other tests.
+
+  Expect.notEquals(plainJsString, unknownJsString);
+  Expect.notEquals(plainJsString, interceptorString);
+  Expect.notEquals(unknownJsString, interceptorString);
+
+  expectTypeName('PlainJavaScriptObject', plainJsString);
+  expectTypeName('UnknownJavaScriptObject', unknownJsString);
+  expectTypeName('Interceptor', interceptorString);
+
+  // Sometimes interceptor *objects* are used instead of the prototypes. Check
+  // these work too.
+  var plain2 = Error.safeToString(const PlainJavaScriptObject());
+  Expect.equals(plainJsString, plain2);
+
+  var unk2 = Error.safeToString(const UnknownJavaScriptObject());
+  Expect.equals(unknownJsString, unk2);
+}
+
+
+testExternal() {
+  var x = makeA();
+  Expect.equals(plainJsString, Error.safeToString(x));
+
+  x = makeB();
+  // Gets name from constructor, regardless of minification.
+  Expect.equals("Instance of 'BB'", Error.safeToString(x));
+
+  x = makeC();
+  Expect.equals(unknownJsString, Error.safeToString(x));
+
+  x = makeD();
+  Expect.equals(unknownJsString, Error.safeToString(x));
+
+  x = makeE();
+  Expect.equals("Instance of 'Liar'", Error.safeToString(x));
+}
+
+testNative() {
+  var x = makeP();
+  Expect.isTrue(x is Purple);  // This test forces Purple to be distinguished.
+  Expect.notEquals(plainJsString, Error.safeToString(x));
+  Expect.notEquals(unknownJsString, Error.safeToString(x));
+  Expect.notEquals(interceptorString, Error.safeToString(x));
+  // And not the native class constructor.
+  Expect.notEquals("Instance of 'PPPP'", Error.safeToString(x));
+  expectTypeName('Purple', Error.safeToString(x));
+
+  x = makeQ();
+  print('Q:  $x  ${Error.safeToString(x)}');
+  // We are going to get either the general interceptor or the JavaScript
+  // constructor.
+  Expect.isTrue(
+      "Instance of 'QQQQ'" == Error.safeToString(x) ||
+      interceptorString == Error.safeToString(x));
+
+  x = makeR();
+
+  // Rascal overrides 'toString'.  The toString() call causes Rascal to be
+  // distinguished.
+  x.toString();
+  Expect.notEquals(plainJsString, Error.safeToString(x));
+  Expect.notEquals(unknownJsString, Error.safeToString(x));
+  Expect.notEquals(interceptorString, Error.safeToString(x));
+  // And not the native class constructor.
+  Expect.notEquals("Instance of 'RRRR'", Error.safeToString(x));
+  expectTypeName('Rascal', Error.safeToString(x));
+}
+
+main() {
+  setup();
+
+  testDistinctInterceptors();
+  testExternal();
+  testNative();
+}
diff --git a/tests/corelib/corelib.status b/tests/corelib/corelib.status
index 648543c..9bda275 100644
--- a/tests/corelib/corelib.status
+++ b/tests/corelib/corelib.status
@@ -83,7 +83,7 @@
 # and only looks at the first 20 significant digits.
 # The Dart VM and the other ECMAScript implementations follow the correct
 # IEEE-754 rounding algorithm.
-double_parse_test: Fail, OK
+double_parse_test/02: Fail, OK
 
 [ $runtime == safari || $runtime == safarimobilesim ]
 double_round3_test: Fail, OK # Runtime rounds 0.49999999999999994 to 1.
@@ -99,7 +99,6 @@
 unicode_test: Fail # Issue 14694
 
 [ $compiler == dart2js ]
-growable_list_test: RuntimeError # Fails to detect concurrent modification in addAll.
 error_stack_trace1_test: RuntimeError # Issue 12399
 hash_set_test/01: RuntimeError # Issue 11551
 integer_to_string_test/01: RuntimeError # Issue 1533
@@ -205,6 +204,12 @@
 [ $runtime == vm ]
 regexp/global_test: Skip # Timeout. Issue 21709 and 21708
 
+[ $runtime != vm && $compiler != dartanalyzer && $compiler != dart2analyzer]
+package_resource_test: RuntimeError # Issue 23825 (not implemented yet).
+data_resource_test: RuntimeError # Issue 23825 (not implemented yet).
+file_resource_test: Skip, OK # VM specific test, uses dart:io.
+http_resource_test: Skip, OK # VM specific test, uses dart:io.
+
 [ $mode == debug ]
 regexp/pcre_test: Pass, Slow # Timeout. Issue 22008
 
@@ -213,24 +218,26 @@
 big_integer_parsed_mul_div_vm_test: Pass, Slow
 
 [ $compiler == dart2js && $cps_ir ]
+data_resource_test: Crash # (await for(var byteSlice in resource.openRead()){streamBytes.addAll(byteSlice);}): await for
 error_stack_trace1_test: Pass # H.unwrapException(...).get$stackTrace is not a function
+growable_list_test: RuntimeError # Typed lists
 iterable_empty_test: RuntimeError # Please triage this failure.
 iterable_return_type_test/none: RuntimeError # Please triage this failure.
 iterable_to_list_test: RuntimeError # Please triage this failure.
 iterable_to_set_test: RuntimeError # Please triage this failure.
 list_filled_type_argument_test: RuntimeError # Please triage this failure.
-list_test/01: RuntimeError # this.get$length is not a function
-list_test/none: RuntimeError # this.get$length is not a function
 list_unmodifiable_test: RuntimeError # Please triage this failure.
 map_values2_test: RuntimeError # Please triage this failure.
 map_values3_test: RuntimeError # Please triage this failure.
 map_values4_test: RuntimeError # Please triage this failure.
-regexp/pcre_test: Crash # Stack Overflow
-shuffle_test: RuntimeError # this.get$length is not a function
-string_fromcharcodes_test: RuntimeError # this.get$length is not a function
+package_resource_test: Crash # (await for(var byteSlice in resource.openRead()){streamBytes.addAll(byteSlice);}): await for
+regexp/pcre_test: Crash # Stack Overflow in LoopHierarchy.
 symbol_operator_test/03: RuntimeError # Please triage this failure.
 symbol_reserved_word_test/03: Pass # Please triage this failure.
 symbol_reserved_word_test/06: RuntimeError # Please triage this failure.
 symbol_reserved_word_test/09: RuntimeError # Please triage this failure.
 symbol_reserved_word_test/12: RuntimeError # Please triage this failure.
-symbol_test/none: RuntimeError # Expected a NoSuchMethodError or a TypeError
+symbol_test/none: RuntimeError # Please triage this failure.
+
+[ $compiler == dart2js && $cps_ir && $host_checked ]
+regexp/pcre_test: Crash # Stack Overflow
diff --git a/tests/corelib/data_resource_test.dart b/tests/corelib/data_resource_test.dart
new file mode 100644
index 0000000..3b9703e
--- /dev/null
+++ b/tests/corelib/data_resource_test.dart
@@ -0,0 +1,51 @@
+// 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.
+
+const sampleText = "Sample text file.";
+
+main() async {
+  var uriEncoded = sampleText.replaceAll(' ', '%20');
+  await testUri("data:application/dart;charset=utf-8,$uriEncoded");
+  // TODO: Support other data: URI formats too.
+  // See: https://github.com/dart-lang/sdk/issues/24030
+  // await testUri("data:text/plain;charset=utf-8,$uriEncoded");
+  var base64Encoded = "U2FtcGxlIHRleHQgZmlsZS4=";
+  // await testUri("data:application/dart;charset=utf-8;base64,$base64Encoded");
+  // await testUri("data:text/plain;charset=utf-8;base64,$base64Encoded");
+}
+
+testUri(uriText) async {
+  var resource = new Resource(uriText);
+
+  if (resource.uri != Uri.parse(uriText)) {
+    throw "uriText: Incorrect URI: ${resource.uri}";
+  }
+
+  var text = await resource.readAsString();
+  if (text != sampleText) {
+    throw "uriText: Incorrect reading of text file: $text";
+  }
+
+  var bytes = await resource.readAsBytes();
+  if (!compareBytes(bytes, sampleText.codeUnits)) {
+    throw "uriText: Incorrect reading of bytes: $bytes";
+  }
+
+  var streamBytes = [];
+  await for (var byteSlice in resource.openRead()) {
+    streamBytes.addAll(byteSlice);
+  }
+  if (!compareBytes(streamBytes, sampleText.codeUnits)) {
+    throw "uriText: Incorrect reading of bytes: $bytes";
+  }
+}
+
+/// Checks that [bytes] and [expectedBytes] have the same contents.
+bool compareBytes(bytes, expectedBytes) {
+  if (bytes.length != expectedBytes.length) return false;
+  for (int i = 0; i < expectedBytes.length; i++) {
+    if (bytes[i] != expectedBytes[i]) return false;
+  }
+  return true;
+}
diff --git a/tests/corelib/double_parse_test.dart b/tests/corelib/double_parse_test.dart
index 5fb6e76..6f7e8fb 100644
--- a/tests/corelib/double_parse_test.dart
+++ b/tests/corelib/double_parse_test.dart
@@ -232,26 +232,26 @@
             "4555072551893136908362547791869486679949683240497058210285131854"
             "51396213837722826145437693412532098591327667236328125",
             0.0);
-  testParse("0.00000000000000000000000000000000000000000000000000000000000000"
-            "0000000000000000000000000000000000000000000000000000000000000000"
-            "0000000000000000000000000000000000000000000000000000000000000000"
-            "0000000000000000000000000000000000000000000000000000000000000000"
-            "0000000000000000000000000000000000000000000000000000000000000000"
-            "0000024703282292062327208828439643411068627545332140664243314532"
-            "8041234170109088178685677591650492652607243027730579814636067699"
-            "1112238669661707327453443265068702897439863329200619332642599205"
-            "1806252781222000513169502627641523911022607448403553068808609405"
-            "1727798181294290864842608522062097649849550765341204993205100587"
-            "2127469658709242016690593998242808606978027857019419997429604579"
-            "7572623273334010723772922131119806567715298322567005234345331218"
-            "5169920860031716486480793611343761679481328431956040281530986197"
-            "8304604971452253283193290744072288902141724247846767401941767720"
-            "8561650585989659548591956327689896895290365125294085321852619688"
-            "9863888974446146846024033780172178553364579041996676675092137151"
-            "9705456298034409473812692774776868254618683783877327369245051207"
-            "5931578479504396230612962142122846982018227555473696607567828620"
-            "5497859173707553281928994692862033843994140625",
-            5e-324);
+  testParse("0.00000000000000000000000000000000000000000000000000000000000000" /// 03: ok
+            "0000000000000000000000000000000000000000000000000000000000000000" /// 03: ok
+            "0000000000000000000000000000000000000000000000000000000000000000" /// 03: ok
+            "0000000000000000000000000000000000000000000000000000000000000000" /// 03: ok
+            "0000000000000000000000000000000000000000000000000000000000000000" /// 03: ok
+            "0000024703282292062327208828439643411068627545332140664243314532" /// 03: ok
+            "8041234170109088178685677591650492652607243027730579814636067699" /// 03: ok
+            "1112238669661707327453443265068702897439863329200619332642599205" /// 03: ok
+            "1806252781222000513169502627641523911022607448403553068808609405" /// 03: ok
+            "1727798181294290864842608522062097649849550765341204993205100587" /// 03: ok
+            "2127469658709242016690593998242808606978027857019419997429604579" /// 03: ok
+            "7572623273334010723772922131119806567715298322567005234345331218" /// 03: ok
+            "5169920860031716486480793611343761679481328431956040281530986197" /// 03: ok
+            "8304604971452253283193290744072288902141724247846767401941767720" /// 03: ok
+            "8561650585989659548591956327689896895290365125294085321852619688" /// 03: ok
+            "9863888974446146846024033780172178553364579041996676675092137151" /// 03: ok
+            "9705456298034409473812692774776868254618683783877327369245051207" /// 03: ok
+            "5931578479504396230612962142122846982018227555473696607567828620" /// 03: ok
+            "5497859173707553281928994692862033843994140625",                  /// 03: ok
+            5e-324);                                                           /// 03: ok
   testParse("0.00000000000000000000000000000000000000000000000000000000000000"
             "0000000000000000000000000000000000000000000000000000000000000000"
             "0000000000000000000000000000000000000000000000000000000000000000"
@@ -368,44 +368,44 @@
             "8136843040991207538774075715754306035963544889052606784864342758"
             "900428165258489343614201061427593231201171875",
             5e-324);
-  testParse("0.00000000000000000000000000000000000000000000000000000000000000"
-            "0000000000000000000000000000000000000000000000000000000000000000"
-            "0000000000000000000000000000000000000000000000000000000000000000"
-            "0000000000000000000000000000000000000000000000000000000000000000"
-            "0000000000000000000000000000000000000000000000000000000000000000"
-            "0000074109846876186981626485318930233205854758970392148714663837"
-            "8523751013260905313127797949754542453988569694847043168576596389"
-            "9850655339096945981621940161728171894510697854671067917687257517"
-            "7347315553307795408549809608457500958111373034747658096871009590"
-            "9754422710047573078097111189357848386756539987835030152280559340"
-            "4659373979179073872386829939581848166016912201945649993128979841"
-            "1362062484498678713572180352209017023903285791732520220528974020"
-            "8029068540216066123755499834026713000358124864790413857434018755"
-            "2090159017259254714629617513415977493871857473787096164563890871"
-            "8119841271673056017045493004705269590165763776884908267986972573"
-            "3665217655679410725087643375608460039849049721491174630855395563"
-            "54188641513168478436313080237596295773983001708984375",
-            1e-323);
-  testParse("0.00000000000000000000000000000000000000000000000000000000000000"
-            "0000000000000000000000000000000000000000000000000000000000000000"
-            "0000000000000000000000000000000000000000000000000000000000000000"
-            "0000000000000000000000000000000000000000000000000000000000000000"
-            "0000000000000000000000000000000000000000000000000000000000000000"
-            "0000074109846876186981626485318930233205873343654412044724850344"
-            "8923718677971811461747287833219166123210675953743507352131000861"
-            "5508029119022396648780866584046796426383292609958261304514284249"
-            "6061610746879932829188941791435548141415672575056325503240888674"
-            "0040403932604439422384254107243478095284614859960753370503720954"
-            "5808063977144841990843464643012899935961693114687389992568869106"
-            "5599267374834247685403237712975952143398358575711517208866987110"
-            "6349531233468788347546753834029761025748698485508885182206645314"
-            "0639262948657591471263120659283236968907400986955900192071499065"
-            "6496581595870337769532410323614883653969318176216473399700896902"
-            "4282850500785430600410615352213843786678841324490411560469406158"
-            "4550533979841101562169154890806946368370134291387467238490102415"
-            "1863156959008792461225924284245693964036455110947393215135657241"
-            "099571834741510656385798938572406768798828125",
-            1e-323);
+  testParse("0.00000000000000000000000000000000000000000000000000000000000000" /// 02: ok
+            "0000000000000000000000000000000000000000000000000000000000000000" /// 02: ok
+            "0000000000000000000000000000000000000000000000000000000000000000" /// 02: ok
+            "0000000000000000000000000000000000000000000000000000000000000000" /// 02: ok
+            "0000000000000000000000000000000000000000000000000000000000000000" /// 02: ok
+            "0000074109846876186981626485318930233205854758970392148714663837" /// 02: ok
+            "8523751013260905313127797949754542453988569694847043168576596389" /// 02: ok
+            "9850655339096945981621940161728171894510697854671067917687257517" /// 02: ok
+            "7347315553307795408549809608457500958111373034747658096871009590" /// 02: ok
+            "9754422710047573078097111189357848386756539987835030152280559340" /// 02: ok
+            "4659373979179073872386829939581848166016912201945649993128979841" /// 02: ok
+            "1362062484498678713572180352209017023903285791732520220528974020" /// 02: ok
+            "8029068540216066123755499834026713000358124864790413857434018755" /// 02: ok
+            "2090159017259254714629617513415977493871857473787096164563890871" /// 02: ok
+            "8119841271673056017045493004705269590165763776884908267986972573" /// 02: ok
+            "3665217655679410725087643375608460039849049721491174630855395563" /// 02: ok
+            "54188641513168478436313080237596295773983001708984375",           /// 02: ok
+            1e-323);                                                           /// 02: ok
+  testParse("0.00000000000000000000000000000000000000000000000000000000000000" /// 03: ok
+            "0000000000000000000000000000000000000000000000000000000000000000" /// 03: ok
+            "0000000000000000000000000000000000000000000000000000000000000000" /// 03: ok
+            "0000000000000000000000000000000000000000000000000000000000000000" /// 03: ok
+            "0000000000000000000000000000000000000000000000000000000000000000" /// 03: ok
+            "0000074109846876186981626485318930233205873343654412044724850344" /// 03: ok
+            "8923718677971811461747287833219166123210675953743507352131000861" /// 03: ok
+            "5508029119022396648780866584046796426383292609958261304514284249" /// 03: ok
+            "6061610746879932829188941791435548141415672575056325503240888674" /// 03: ok
+            "0040403932604439422384254107243478095284614859960753370503720954" /// 03: ok
+            "5808063977144841990843464643012899935961693114687389992568869106" /// 03: ok
+            "5599267374834247685403237712975952143398358575711517208866987110" /// 03: ok
+            "6349531233468788347546753834029761025748698485508885182206645314" /// 03: ok
+            "0639262948657591471263120659283236968907400986955900192071499065" /// 03: ok
+            "6496581595870337769532410323614883653969318176216473399700896902" /// 03: ok
+            "4282850500785430600410615352213843786678841324490411560469406158" /// 03: ok
+            "4550533979841101562169154890806946368370134291387467238490102415" /// 03: ok
+            "1863156959008792461225924284245693964036455110947393215135657241" /// 03: ok
+            "099571834741510656385798938572406768798828125",                   /// 03: ok
+            1e-323);                                                           /// 03: ok
   testParse("0.00000000000000000000000000000000000000000000000000000000000000"
             "0000000000000000000000000000000000000000000000000000000000000000"
             "0000000000000000000000000000000000000000000000000000000000000000"
@@ -482,26 +482,26 @@
             "0239620254961370692713747131027132020441991845959370908649389667"
             "01396213837722826145437693412532098591327667236328125",
             1.1125369292536007e-308);
-  testParse("0.00000000000000000000000000000000000000000000000000000000000000"
-            "0000000000000000000000000000000000000000000000000000000000000000"
-            "0000000000000000000000000000000000000000000000000000000000000000"
-            "0000000000000000000000000000000000000000000000000000000000000000"
-            "0000000000000000000000000000000000000000000000000000011125369292"
-            "5360093857793927928947412039400442434185228365340521456608629527"
-            "0200315929606120759250932815416474352736201659755028987189999989"
-            "3220987486513026766686796443888026815774211444057134206415720396"
-            "3510525564718487986029401249963455450110781777556316353975973978"
-            "4825173851725161436876623857879887229903814003929524302244972629"
-            "6795040225381805100879491255387164751912585073962051947893527710"
-            "5170790163081944841764003984818943810636714040207972316616704045"
-            "0220895038833513659790739432367709097880422198053807344762226099"
-            "3129277744388529754345873069706690065083079768940685222309466301"
-            "4235389404255004774284573740536646273496781023858510820692328908"
-            "0857253100067390568036719107632515767271783448958607838263400261"
-            "9271291212296536333081616208300526650104600844121842238490102415"
-            "1863156959008792461225924284245693964036455110947393215135657241"
-            "099571834741510656385798938572406768798828125",
-            1.112536929253601e-308);
+  testParse("0.00000000000000000000000000000000000000000000000000000000000000" /// 03: ok
+            "0000000000000000000000000000000000000000000000000000000000000000" /// 03: ok
+            "0000000000000000000000000000000000000000000000000000000000000000" /// 03: ok
+            "0000000000000000000000000000000000000000000000000000000000000000" /// 03: ok
+            "0000000000000000000000000000000000000000000000000000011125369292" /// 03: ok
+            "5360093857793927928947412039400442434185228365340521456608629527" /// 03: ok
+            "0200315929606120759250932815416474352736201659755028987189999989" /// 03: ok
+            "3220987486513026766686796443888026815774211444057134206415720396" /// 03: ok
+            "3510525564718487986029401249963455450110781777556316353975973978" /// 03: ok
+            "4825173851725161436876623857879887229903814003929524302244972629" /// 03: ok
+            "6795040225381805100879491255387164751912585073962051947893527710" /// 03: ok
+            "5170790163081944841764003984818943810636714040207972316616704045" /// 03: ok
+            "0220895038833513659790739432367709097880422198053807344762226099" /// 03: ok
+            "3129277744388529754345873069706690065083079768940685222309466301" /// 03: ok
+            "4235389404255004774284573740536646273496781023858510820692328908" /// 03: ok
+            "0857253100067390568036719107632515767271783448958607838263400261" /// 03: ok
+            "9271291212296536333081616208300526650104600844121842238490102415" /// 03: ok
+            "1863156959008792461225924284245693964036455110947393215135657241" /// 03: ok
+            "099571834741510656385798938572406768798828125",                   /// 03: ok
+            1.112536929253601e-308);                                           /// 03: ok
   testParse("0.00000000000000000000000000000000000000000000000000000000000000"
             "0000000000000000000000000000000000000000000000000000000000000000"
             "0000000000000000000000000000000000000000000000000000000000000000"
@@ -560,44 +560,44 @@
             "8136843040991207538774075715754306035963544889052606784864342758"
             "900428165258489343614201061427593231201171875",
             1.112536929253601e-308);
-  testParse("0.00000000000000000000000000000000000000000000000000000000000000"
-            "0000000000000000000000000000000000000000000000000000000000000000"
-            "0000000000000000000000000000000000000000000000000000000000000000"
-            "0000000000000000000000000000000000000000000000000000000000000000"
-            "0000000000000000000000000000000000000000000000000000011125369292"
-            "5360143264358512053601829696279729256322446286636762993074885578"
-            "5482848940402484819383308231788212319506475197423260249353326444"
-            "4130717265985540087275830129388183546908748591883986098046865342"
-            "9694440740018214171090142139290408905547397593746087678853434622"
-            "7708807769200010477987555066232823112546765790360487852208850575"
-            "8752599546868752897347409845010678425979078962517411943872958339"
-            "1841626929078828345647733525524686707077165117383988808631340302"
-            "3919811372391502185169818655049136406061931820528945258278945377"
-            "2640279824496362807465448266116748919295441238296611971177785355"
-            "4605209927839760366494651758097211936470402475783551200969719627"
-            "9349765358747644509438842714766105380341358326953487329219653376"
-            "04188641513168478436313080237596295773983001708984375",
-            1.1125369292536017e-308);
-  testParse("0.00000000000000000000000000000000000000000000000000000000000000"
-            "0000000000000000000000000000000000000000000000000000000000000000"
-            "0000000000000000000000000000000000000000000000000000000000000000"
-            "0000000000000000000000000000000000000000000000000000000000000000"
-            "0000000000000000000000000000000000000000000000000000011125369292"
-            "5360143264358512053601829696279729256322464871320782889085072085"
-            "5882816605113390968002798115252835988728581456319724432907730915"
-            "9788091045910990754434756551706808078781343347171179484873892074"
-            "8408735933590351591729274322268456088851697134054755085223313705"
-            "7994788991756876822274697984118452821074840662486211070432012189"
-            "9901289544834521015804044548441730195923859875259151943312847604"
-            "6078831819414397317478790886291621826572237901362985796969353392"
-            "2240274065644224408961072655052184431452505441247416583051571936"
-            "1189383755894699564098951411984008394330984751465415998685393549"
-            "2981950252037042118981569077006826000273956875115116332683643956"
-            "9967398203853664384761814691371489127171149929952724258833663970"
-            "9550533979841101562169154890806946368370134291387467238490102415"
-            "1863156959008792461225924284245693964036455110947393215135657241"
-            "099571834741510656385798938572406768798828125",
-            1.1125369292536017e-308);
+  testParse("0.00000000000000000000000000000000000000000000000000000000000000" /// 02: ok
+            "0000000000000000000000000000000000000000000000000000000000000000" /// 02: ok
+            "0000000000000000000000000000000000000000000000000000000000000000" /// 02: ok
+            "0000000000000000000000000000000000000000000000000000000000000000" /// 02: ok
+            "0000000000000000000000000000000000000000000000000000011125369292" /// 02: ok
+            "5360143264358512053601829696279729256322446286636762993074885578" /// 02: ok
+            "5482848940402484819383308231788212319506475197423260249353326444" /// 02: ok
+            "4130717265985540087275830129388183546908748591883986098046865342" /// 02: ok
+            "9694440740018214171090142139290408905547397593746087678853434622" /// 02: ok
+            "7708807769200010477987555066232823112546765790360487852208850575" /// 02: ok
+            "8752599546868752897347409845010678425979078962517411943872958339" /// 02: ok
+            "1841626929078828345647733525524686707077165117383988808631340302" /// 02: ok
+            "3919811372391502185169818655049136406061931820528945258278945377" /// 02: ok
+            "2640279824496362807465448266116748919295441238296611971177785355" /// 02: ok
+            "4605209927839760366494651758097211936470402475783551200969719627" /// 02: ok
+            "9349765358747644509438842714766105380341358326953487329219653376" /// 02: ok
+            "04188641513168478436313080237596295773983001708984375",           /// 02: ok
+            1.1125369292536017e-308);                                          /// 02: ok
+  testParse("0.00000000000000000000000000000000000000000000000000000000000000" /// 03: ok
+            "0000000000000000000000000000000000000000000000000000000000000000" /// 03: ok
+            "0000000000000000000000000000000000000000000000000000000000000000" /// 03: ok
+            "0000000000000000000000000000000000000000000000000000000000000000" /// 03: ok
+            "0000000000000000000000000000000000000000000000000000011125369292" /// 03: ok
+            "5360143264358512053601829696279729256322464871320782889085072085" /// 03: ok
+            "5882816605113390968002798115252835988728581456319724432907730915" /// 03: ok
+            "9788091045910990754434756551706808078781343347171179484873892074" /// 03: ok
+            "8408735933590351591729274322268456088851697134054755085223313705" /// 03: ok
+            "7994788991756876822274697984118452821074840662486211070432012189" /// 03: ok
+            "9901289544834521015804044548441730195923859875259151943312847604" /// 03: ok
+            "6078831819414397317478790886291621826572237901362985796969353392" /// 03: ok
+            "2240274065644224408961072655052184431452505441247416583051571936" /// 03: ok
+            "1189383755894699564098951411984008394330984751465415998685393549" /// 03: ok
+            "2981950252037042118981569077006826000273956875115116332683643956" /// 03: ok
+            "9967398203853664384761814691371489127171149929952724258833663970" /// 03: ok
+            "9550533979841101562169154890806946368370134291387467238490102415" /// 03: ok
+            "1863156959008792461225924284245693964036455110947393215135657241" /// 03: ok
+            "099571834741510656385798938572406768798828125",                   /// 03: ok
+            1.1125369292536017e-308);                                          /// 03: ok
   testParse("0.00000000000000000000000000000000000000000000000000000000000000"
             "0000000000000000000000000000000000000000000000000000000000000000"
             "0000000000000000000000000000000000000000000000000000000000000000"
@@ -673,26 +673,26 @@
             "5924167958029604477064946470184777360934300451421683607013647479"
             "51396213837722826145437693412532098591327667236328125",
             2.2250738585072014e-308);
-  testParse("0.00000000000000000000000000000000000000000000000000000000000000"
-            "0000000000000000000000000000000000000000000000000000000000000000"
-            "0000000000000000000000000000000000000000000000000000000000000000"
-            "0000000000000000000000000000000000000000000000000000000000000000"
-            "0000000000000000000000000000000000000000000000000000022250738585"
-            "0720163012305563795567615250361241457301819893006892300968851267"
-            "7159413856747700265506443097450144218254107162331246067966730043"
-            "7501049413401620872340686411548038468172262181270052386775328221"
-            "5857650751428906748569733780796363397546806336554745935958399010"
-            "2779558910877598836767067734754861955694039806454982002173263865"
-            "0888265793071484125840071160815995011874751834533813898637506208"
-            "5650354607662094473839557158134613493810593365859440904719070326"
-            "6111637871008949721205058253390132503584229153792338745607152721"
-            "3679398551625637847181703822407461490506663533450201028923360785"
-            "0720758060421709123733732493928588619801419722757153753675075962"
-            "6541800803135624352387918446790161107764092054420920536627658074"
-            "4271291212296536333081616208300526650104600844121842238490102415"
-            "1863156959008792461225924284245693964036455110947393215135657241"
-            "099571834741510656385798938572406768798828125",
-            2.225073858507202e-308);
+  testParse("0.00000000000000000000000000000000000000000000000000000000000000" /// 03: ok
+            "0000000000000000000000000000000000000000000000000000000000000000" /// 03: ok
+            "0000000000000000000000000000000000000000000000000000000000000000" /// 03: ok
+            "0000000000000000000000000000000000000000000000000000000000000000" /// 03: ok
+            "0000000000000000000000000000000000000000000000000000022250738585" /// 03: ok
+            "0720163012305563795567615250361241457301819893006892300968851267" /// 03: ok
+            "7159413856747700265506443097450144218254107162331246067966730043" /// 03: ok
+            "7501049413401620872340686411548038468172262181270052386775328221" /// 03: ok
+            "5857650751428906748569733780796363397546806336554745935958399010" /// 03: ok
+            "2779558910877598836767067734754861955694039806454982002173263865" /// 03: ok
+            "0888265793071484125840071160815995011874751834533813898637506208" /// 03: ok
+            "5650354607662094473839557158134613493810593365859440904719070326" /// 03: ok
+            "6111637871008949721205058253390132503584229153792338745607152721" /// 03: ok
+            "3679398551625637847181703822407461490506663533450201028923360785" /// 03: ok
+            "0720758060421709123733732493928588619801419722757153753675075962" /// 03: ok
+            "6541800803135624352387918446790161107764092054420920536627658074" /// 03: ok
+            "4271291212296536333081616208300526650104600844121842238490102415" /// 03: ok
+            "1863156959008792461225924284245693964036455110947393215135657241" /// 03: ok
+            "099571834741510656385798938572406768798828125",                   /// 03: ok
+            2.225073858507202e-308);                                           /// 03: ok
   testParse("0.00000000000000000000000000000000000000000000000000000000000000"
             "0000000000000000000000000000000000000000000000000000000000000000"
             "0000000000000000000000000000000000000000000000000000000000000000"
@@ -751,44 +751,44 @@
             "8136843040991207538774075715754306035963544889052606784864342758"
             "900428165258489343614201061427593231201171875",
             2.225073858507202e-308);
-  testParse("0.00000000000000000000000000000000000000000000000000000000000000"
-            "0000000000000000000000000000000000000000000000000000000000000000"
-            "0000000000000000000000000000000000000000000000000000000000000000"
-            "0000000000000000000000000000000000000000000000000000000000000000"
-            "0000000000000000000000000000000000000000000000000000022250738585"
-            "0720212418870147920222032907240528279439037814303133837435107319"
-            "2441946867544064325638818513821882185024380699999477330130056498"
-            "8410779192874134192929720097048195199306799329096904278406473168"
-            "2041565926728632933630474670123316852983422152744517260835859654"
-            "5663192828352447877877998943107797838336991592885945552137141811"
-            "2845825114558431922307989750439508685941245723089173894616936837"
-            "2321191373658977977723286698840356390251044443035457396733706583"
-            "9810554204566938246584137476071559811765738776267476659123871999"
-            "3190400631733470900301279018817520344719025002806127777791679839"
-            "1090578584006464715943810511489154282775041174682194133952466682"
-            "5034313061815878293790042053923750720833666932415800027583911188"
-            "54188641513168478436313080237596295773983001708984375",
-            2.2250738585072024e-308);
-  testParse("0.00000000000000000000000000000000000000000000000000000000000000"
-            "0000000000000000000000000000000000000000000000000000000000000000"
-            "0000000000000000000000000000000000000000000000000000000000000000"
-            "0000000000000000000000000000000000000000000000000000000000000000"
-            "0000000000000000000000000000000000000000000000000000022250738585"
-            "0720212418870147920222032907240528279439056398987153733445293826"
-            "2841914532254970474258308397286505854246486958895941513684460970"
-            "4068152972799584860088646519366819731179394084384097665233499900"
-            "0755861120300770354269606853101364036287721693053184667205738737"
-            "5949174050909314222165141860993427546865066465011668770360303425"
-            "3994515112524200040764624453870560455886026635830913894056826102"
-            "6558396263994546949554344059607291509746117227014454385071719673"
-            "8131016897819660470375391476074607837156312396985947983896498558"
-            "1739504563131807656934782164684779819754568515974931805299288032"
-            "9467318908203746468430727830398768346578595574013759265666391011"
-            "5651945906921898169113014030529134467663458535415036957197921783"
-            "4550533979841101562169154890806946368370134291387467238490102415"
-            "1863156959008792461225924284245693964036455110947393215135657241"
-            "099571834741510656385798938572406768798828125",
-            2.2250738585072024e-308);
+  testParse("0.00000000000000000000000000000000000000000000000000000000000000" /// 03: ok
+            "0000000000000000000000000000000000000000000000000000000000000000" /// 03: ok
+            "0000000000000000000000000000000000000000000000000000000000000000" /// 03: ok
+            "0000000000000000000000000000000000000000000000000000000000000000" /// 03: ok
+            "0000000000000000000000000000000000000000000000000000022250738585" /// 03: ok
+            "0720212418870147920222032907240528279439037814303133837435107319" /// 03: ok
+            "2441946867544064325638818513821882185024380699999477330130056498" /// 03: ok
+            "8410779192874134192929720097048195199306799329096904278406473168" /// 03: ok
+            "2041565926728632933630474670123316852983422152744517260835859654" /// 03: ok
+            "5663192828352447877877998943107797838336991592885945552137141811" /// 03: ok
+            "2845825114558431922307989750439508685941245723089173894616936837" /// 03: ok
+            "2321191373658977977723286698840356390251044443035457396733706583" /// 03: ok
+            "9810554204566938246584137476071559811765738776267476659123871999" /// 03: ok
+            "3190400631733470900301279018817520344719025002806127777791679839" /// 03: ok
+            "1090578584006464715943810511489154282775041174682194133952466682" /// 03: ok
+            "5034313061815878293790042053923750720833666932415800027583911188" /// 03: ok
+            "54188641513168478436313080237596295773983001708984375",           /// 03: ok
+            2.2250738585072024e-308);                                          /// 03: ok
+  testParse("0.00000000000000000000000000000000000000000000000000000000000000" /// 03: ok
+            "0000000000000000000000000000000000000000000000000000000000000000" /// 03: ok
+            "0000000000000000000000000000000000000000000000000000000000000000" /// 03: ok
+            "0000000000000000000000000000000000000000000000000000000000000000" /// 03: ok
+            "0000000000000000000000000000000000000000000000000000022250738585" /// 03: ok
+            "0720212418870147920222032907240528279439056398987153733445293826" /// 03: ok
+            "2841914532254970474258308397286505854246486958895941513684460970" /// 03: ok
+            "4068152972799584860088646519366819731179394084384097665233499900" /// 03: ok
+            "0755861120300770354269606853101364036287721693053184667205738737" /// 03: ok
+            "5949174050909314222165141860993427546865066465011668770360303425" /// 03: ok
+            "3994515112524200040764624453870560455886026635830913894056826102" /// 03: ok
+            "6558396263994546949554344059607291509746117227014454385071719673" /// 03: ok
+            "8131016897819660470375391476074607837156312396985947983896498558" /// 03: ok
+            "1739504563131807656934782164684779819754568515974931805299288032" /// 03: ok
+            "9467318908203746468430727830398768346578595574013759265666391011" /// 03: ok
+            "5651945906921898169113014030529134467663458535415036957197921783" /// 03: ok
+            "4550533979841101562169154890806946368370134291387467238490102415" /// 03: ok
+            "1863156959008792461225924284245693964036455110947393215135657241" /// 03: ok
+            "099571834741510656385798938572406768798828125",                   /// 03: ok
+            2.2250738585072024e-308);                                          /// 03: ok
   testParse("0.00000000000000000000000000000000000000000000000000000000000000"
             "0000000000000000000000000000000000000000000000000000000000000000"
             "0000000000000000000000000000000000000000000000000000000000000000"
@@ -862,25 +862,25 @@
             "8909645359318233784351199339157645340492308605462312698364257812"
             "5",
             1.0020841800044864e-292);
-  testParse("0.00000000000000000000000000000000000000000000000000000000000000"
-            "0000000000000000000000000000000000000000000000000000000000000000"
-            "0000000000000000000000000000000000000000000000000000000000000000"
-            "0000000000000000000000000000000000000000000000000000000000000000"
-            "0000000000000000000000000000000000000100208418000448650025174695"
-            "1035150178458809017822159251011531515138151971877843746285762442"
-            "8545112214057342269294258292239779301929355259416640067909319649"
-            "7365336576866690449490575153391617964764463657240626936945707789"
-            "0322677840073401894046998179185686691822730198820493814317137229"
-            "5822164306994752582767555905533610628109411569344063803273395309"
-            "4016739578124191615155910675820643598048478728683293279406596985"
-            "3795142966229399885915374796852136102192598807080147602085351627"
-            "7462738186176388661491270541112149644974737467220377156516124492"
-            "5297987696655648150350049348782647584189423429523649017245633309"
-            "0650703736050481424426844685046761507858235356421727632283550512"
-            "9294184882356332903145058239310065886479547694117011957754993659"
-            "5152049332041520812604025151794328168042160636342216519487980314"
-            "421878240614097350935640662328296457417309284210205078125",
-            1.0020841800044866e-292);
+  testParse("0.00000000000000000000000000000000000000000000000000000000000000" /// 03: ok
+            "0000000000000000000000000000000000000000000000000000000000000000" /// 03: ok
+            "0000000000000000000000000000000000000000000000000000000000000000" /// 03: ok
+            "0000000000000000000000000000000000000000000000000000000000000000" /// 03: ok
+            "0000000000000000000000000000000000000100208418000448650025174695" /// 03: ok
+            "1035150178458809017822159251011531515138151971877843746285762442" /// 03: ok
+            "8545112214057342269294258292239779301929355259416640067909319649" /// 03: ok
+            "7365336576866690449490575153391617964764463657240626936945707789" /// 03: ok
+            "0322677840073401894046998179185686691822730198820493814317137229" /// 03: ok
+            "5822164306994752582767555905533610628109411569344063803273395309" /// 03: ok
+            "4016739578124191615155910675820643598048478728683293279406596985" /// 03: ok
+            "3795142966229399885915374796852136102192598807080147602085351627" /// 03: ok
+            "7462738186176388661491270541112149644974737467220377156516124492" /// 03: ok
+            "5297987696655648150350049348782647584189423429523649017245633309" /// 03: ok
+            "0650703736050481424426844685046761507858235356421727632283550512" /// 03: ok
+            "9294184882356332903145058239310065886479547694117011957754993659" /// 03: ok
+            "5152049332041520812604025151794328168042160636342216519487980314" /// 03: ok
+            "421878240614097350935640662328296457417309284210205078125",       /// 03: ok
+            1.0020841800044866e-292);                                          /// 03: ok
   testParse("0.00000000000000000000000000000000000000000000000000000000000000"
             "0000000000000000000000000000000000000000000000000000000000000000"
             "0000000000000000000000000000000000000000000000000000000000000000"
@@ -936,43 +936,43 @@
             "4847950667958479187395974848205671831957839363657783480512019685"
             "578121759385902649064359337671703542582690715789794921875",
             2.0041683600089726e-292);
-  testParse("0.00000000000000000000000000000000000000000000000000000000000000"
-            "0000000000000000000000000000000000000000000000000000000000000000"
-            "0000000000000000000000000000000000000000000000000000000000000000"
-            "0000000000000000000000000000000000000000000000000000000000000000"
-            "0000000000000000000000000000000000000200416836000897266674241512"
-            "5990092893382710435783708701744713907322363070003179054747514262"
-            "7385611700512865061525449421701203817286652851291627374287240329"
-            "3753705169156289950978164746871212513772283206234057202629821353"
-            "8809538439162226010550634208659737749820025430842192660178060615"
-            "3474267718174236120090795958487048484027109406716660005865875254"
-            "7540730218997620056025234843183240653494745917236268600971966054"
-            "2572750817920844689872038240532666937066187074066929436725783508"
-            "0513647350599865639683590212819431367049178252060735656411044144"
-            "5314088186163138416702979387974756763836546863081940712096908853"
-            "9929165937080868658779320353585122361868059050079309936626251244"
-            "0765647609431766215648800660842354659507691394537687301635742187"
-            "5",
-            2.004168360008973e-292);
-  testParse("0.00000000000000000000000000000000000000000000000000000000000000"
-            "0000000000000000000000000000000000000000000000000000000000000000"
-            "0000000000000000000000000000000000000000000000000000000000000000"
-            "0000000000000000000000000000000000000000000000000000000000000000"
-            "0000000000000000000000000000000000000200416836000897266674241512"
-            "5990092893382710435783708785442689934124446215379877007119186963"
-            "1799271173601405540673717580039876412295823431198128133887844732"
-            "7822096271111944266498822575337206743053529154538278267721206728"
-            "1206759279588886755511816487266193645578706075743945771432529989"
-            "5627720577353214542977288069464672781437627568914207256313896083"
-            "6647266336088483105727658239269018534852601546443784653776612265"
-            "4362171708319597782738064157144965045964873355636409438294693959"
-            "3883447613213167389211587415988230219943616159642947883454256631"
-            "7129850578881555219447792913718868827972321214300345663373246010"
-            "5887233720340859229642766731751409169335306833113418201122555553"
-            "1150187132469865334442659560994775205494930483192386561026478034"
-            "5152049332041520812604025151794328168042160636342216519487980314"
-            "421878240614097350935640662328296457417309284210205078125",
-            2.004168360008973e-292);
+  testParse("0.00000000000000000000000000000000000000000000000000000000000000" /// 03: ok
+            "0000000000000000000000000000000000000000000000000000000000000000" /// 03: ok
+            "0000000000000000000000000000000000000000000000000000000000000000" /// 03: ok
+            "0000000000000000000000000000000000000000000000000000000000000000" /// 03: ok
+            "0000000000000000000000000000000000000200416836000897266674241512" /// 03: ok
+            "5990092893382710435783708701744713907322363070003179054747514262" /// 03: ok
+            "7385611700512865061525449421701203817286652851291627374287240329" /// 03: ok
+            "3753705169156289950978164746871212513772283206234057202629821353" /// 03: ok
+            "8809538439162226010550634208659737749820025430842192660178060615" /// 03: ok
+            "3474267718174236120090795958487048484027109406716660005865875254" /// 03: ok
+            "7540730218997620056025234843183240653494745917236268600971966054" /// 03: ok
+            "2572750817920844689872038240532666937066187074066929436725783508" /// 03: ok
+            "0513647350599865639683590212819431367049178252060735656411044144" /// 03: ok
+            "5314088186163138416702979387974756763836546863081940712096908853" /// 03: ok
+            "9929165937080868658779320353585122361868059050079309936626251244" /// 03: ok
+            "0765647609431766215648800660842354659507691394537687301635742187" /// 03: ok
+            "5",                                                               /// 03: ok
+            2.004168360008973e-292);                                           /// 03: ok
+  testParse("0.00000000000000000000000000000000000000000000000000000000000000" /// 03: ok
+            "0000000000000000000000000000000000000000000000000000000000000000" /// 03: ok
+            "0000000000000000000000000000000000000000000000000000000000000000" /// 03: ok
+            "0000000000000000000000000000000000000000000000000000000000000000" /// 03: ok
+            "0000000000000000000000000000000000000200416836000897266674241512" /// 03: ok
+            "5990092893382710435783708785442689934124446215379877007119186963" /// 03: ok
+            "1799271173601405540673717580039876412295823431198128133887844732" /// 03: ok
+            "7822096271111944266498822575337206743053529154538278267721206728" /// 03: ok
+            "1206759279588886755511816487266193645578706075743945771432529989" /// 03: ok
+            "5627720577353214542977288069464672781437627568914207256313896083" /// 03: ok
+            "6647266336088483105727658239269018534852601546443784653776612265" /// 03: ok
+            "4362171708319597782738064157144965045964873355636409438294693959" /// 03: ok
+            "3883447613213167389211587415988230219943616159642947883454256631" /// 03: ok
+            "7129850578881555219447792913718868827972321214300345663373246010" /// 03: ok
+            "5887233720340859229642766731751409169335306833113418201122555553" /// 03: ok
+            "1150187132469865334442659560994775205494930483192386561026478034" /// 03: ok
+            "5152049332041520812604025151794328168042160636342216519487980314" /// 03: ok
+            "421878240614097350935640662328296457417309284210205078125",       /// 03: ok
+            2.004168360008973e-292);                                           /// 03: ok
   testParse("0.99999999999999988897769753748434595763683319091796875",
             0.9999999999999999);
   testParse("0.99999999999999988897769753748434595763683319091796879176194859"
@@ -983,12 +983,12 @@
             "4809443029054117700758095643512548748358614094344726684993771234"
             "576088145773464788135242997668683528900146484375",
             0.9999999999999999);
-  testParse("0.999999999999999944488848768742172978818416595458984375",
-            1.0);
-  testParse("0.99999999999999994448884876874217297881841659545898441676194859"
-            "5190556970945882299241904356487451251641385905655273315006228765"
-            "423911854226535211864757002331316471099853515625",
-            1.0);
+  testParse("0.999999999999999944488848768742172978818416595458984375", /// 03: ok
+            1.0);                                                       /// 03: ok
+  testParse("0.99999999999999994448884876874217297881841659545898441676194859" /// 03: ok
+            "5190556970945882299241904356487451251641385905655273315006228765" /// 03: ok
+            "423911854226535211864757002331316471099853515625",                /// 03: ok
+            1.0);                                                              /// 03: ok
   testParse("0.499999999999999944488848768742172978818416595458984375",
             0.49999999999999994);
   testParse("0.49999999999999994448884876874217297881841659545898439588097429"
@@ -999,12 +999,12 @@
             "2404721514527058850379047821756274374179307047172363342496885617"
             "2880440728867323940676214988343417644500732421875",
             0.49999999999999994);
-  testParse("0.4999999999999999722444243843710864894092082977294921875",
-            0.5);
-  testParse("0.49999999999999997224442438437108648940920829772949220838097429"
-            "7595278485472941149620952178243725625820692952827636657503114382"
-            "7119559271132676059323785011656582355499267578125",
-            0.5);
+  testParse("0.4999999999999999722444243843710864894092082977294921875", /// 03: ok
+            0.5);                                                        /// 03: ok
+  testParse("0.49999999999999997224442438437108648940920829772949220838097429" /// 03: ok
+            "7595278485472941149620952178243725625820692952827636657503114382" /// 03: ok
+            "7119559271132676059323785011656582355499267578125",               /// 03: ok
+            0.5);                                                              /// 03: ok
   testParse("1.9999999999999997779553950749686919152736663818359375",
             1.9999999999999998);
   testParse("1.99999999999999977795539507496869191527366638183593758352389719"
@@ -1015,12 +1015,12 @@
             "9618886058108235401516191287025097496717228188689453369987542469"
             "15217629154692957627048599533736705780029296875",
             1.9999999999999998);
-  testParse("1.99999999999999988897769753748434595763683319091796875",
-            2.0);
-  testParse("1.99999999999999988897769753748434595763683319091796883352389719"
-            "0381113941891764598483808712974902503282771811310546630012457530"
-            "84782370845307042372951400466263294219970703125",
-            2.0);
+  testParse("1.99999999999999988897769753748434595763683319091796875", /// 03: ok
+            2.0);                                                      /// 03: ok
+  testParse("1.99999999999999988897769753748434595763683319091796883352389719" /// 03: ok
+            "0381113941891764598483808712974902503282771811310546630012457530" /// 03: ok
+            "84782370845307042372951400466263294219970703125",                 /// 03: ok
+            2.0);                                                              /// 03: ok
   testParse("4503599627370495.5",
             4503599627370495.5);
   testParse("4503599627370495.50000000000000000000000000000000000018807909613"
diff --git a/tests/corelib/file_resource_test.dart b/tests/corelib/file_resource_test.dart
new file mode 100644
index 0000000..c9da8f7
--- /dev/null
+++ b/tests/corelib/file_resource_test.dart
@@ -0,0 +1,63 @@
+// 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:io";
+
+const sampleText = "Sample text file.";
+
+main() async {
+  var file = await createFile();
+  var uri = new Uri.file(file.path);
+
+  var resource = new Resource(uri.toString());
+
+  if (resource.uri != uri) {
+    throw "Incorrect URI: ${resource.uri}";
+  }
+
+  var text = await resource.readAsString();
+  if (text != sampleText) {
+    throw "Incorrect reading of text file: $text";
+  }
+
+  var bytes = await resource.readAsBytes();
+  if (!compareBytes(bytes, sampleText.codeUnits)) {
+    throw "Incorrect reading of bytes: $bytes";
+  }
+
+  var streamBytes = [];
+  await for (var byteSlice in resource.openRead()) {
+    streamBytes.addAll(byteSlice);
+  }
+  if (!compareBytes(streamBytes, sampleText.codeUnits)) {
+    throw "Incorrect reading of bytes: $bytes";
+  }
+
+  await deleteFile(file);
+}
+
+/// Checks that [bytes] and [expectedBytes] have the same contents.
+bool compareBytes(bytes, expectedBytes) {
+  if (bytes.length != expectedBytes.length) return false;
+  for (int i = 0; i < expectedBytes.length; i++) {
+    if (bytes[i] != expectedBytes[i]) return false;
+  }
+  return true;
+}
+
+createFile() async {
+  var tempDir = await Directory.systemTemp.createTemp("sample");
+  var filePath = tempDir.path + Platform.pathSeparator + "sample.txt";
+  var file = new File(filePath);
+  await file.create();
+  await file.writeAsString(sampleText);
+  return file;
+}
+
+deleteFile(File file) async {
+  // Removes the file and the temporary directory it's in.
+  var parentDir = new Directory(file.path.substring(0,
+                                file.path.lastIndexOf(Platform.pathSeparator)));
+  await parentDir.delete(recursive: true);
+}
diff --git a/tests/corelib/growable_list_test.dart b/tests/corelib/growable_list_test.dart
index 98b4e1f..b1d6e09 100644
--- a/tests/corelib/growable_list_test.dart
+++ b/tests/corelib/growable_list_test.dart
@@ -5,11 +5,19 @@
 // Sanity check on the growing behavior of a growable list.
 
 import "package:expect/expect.dart";
-import "dart:collection" show IterableBase;
+
+void main() {
+  testConstructor();
+
+  bool checked = false;
+  assert((checked = true));
+  // Concurrent modification checks are only guaranteed in checked mode.
+  if (checked) testConcurrentModification();
+}
 
 // Iterable generating numbers in range [0..count).
 // May perform callback at some point underways.
-class TestIterableBase extends IterableBase<int> {
+class TestIterableBase extends Iterable<int> {
   final int length;
   final int count;
   // call [callback] if generating callbackIndex.
@@ -55,29 +63,66 @@
   int get current => _current;
 }
 
+void testConstructor() {
+  // Constructor can make both growable and fixed-length lists.
+  testGrowable(list) {
+    Expect.isTrue(list is List<int>);
+    Expect.isFalse(list is List<String>);
+    int length = list.length;
+    list.add(42);
+    Expect.equals(list.length, length + 1);
+  }
 
-void main() {
+  testFixedLength(list) {
+    Expect.isTrue(list is List<int>);
+    int length = list.length;
+    Expect.throws(() { list.add(42); }, null, "adding to fixed-length list");
+    Expect.equals(length, list.length);
+  }
+
+  bool checked = false;
+  assert((checked = true));
+  testThrowsOrTypeError(fn, test, [name]) {
+    Expect.throws(fn, checked ? null : test,
+                      checked ? name : "$name w/ TypeError");
+  }
+  testFixedLength(new List<int>(0));
+  testFixedLength(new List<int>(5));
+  testGrowable(new List<int>());
+  testGrowable(new List<int>()..length = 5);
+  Expect.throws(() => new List<int>(-1), (e) => e is ArgumentError, "-1");
+  // There must be limits. Fix this test if we ever allow 10^30 elements.
+  Expect.throws(() => new List<int>(0x1000000000000000000000000000000),
+                (e) => e is ArgumentError, "bignum");
+  Expect.throws(() => new List<int>(null), (e) => e is ArgumentError, "null");
+  testThrowsOrTypeError(() => new List([] as Object),  // Cast to avoid warning.
+                        (e) => e is ArgumentError, 'list');
+  testThrowsOrTypeError(() => new List([42] as Object),
+                        (e) => e is ArgumentError, "list2");
+}
+
+void testConcurrentModification() {
   // Without EfficientLength interface
   {
-    // Change length of list after 20 additions.
+    // Change length of list after 200 additions.
     var l = [];
     var ci = new TestIterable(257, 200, () {
       l.add("X");
     });
     Expect.throws(() {
       l.addAll(ci);
-    }, (e) => e is ConcurrentModificationError);
+    }, (e) => e is ConcurrentModificationError, "cm1");
   }
 
   {
-    // Change length of list after 20 additions.
+    // Change length of list after 200 additions.
     var l = [];
     var ci = new TestIterable(257, 200, () {
       l.length = 0;
     });
     Expect.throws(() {
       l.addAll(ci);
-    }, (e) => e is ConcurrentModificationError);
+    }, (e) => e is ConcurrentModificationError, "cm2");
   }
 
   // With EfficientLength interface (uses length).
@@ -89,7 +134,7 @@
     });
     Expect.throws(() {
       l.addAll(ci);
-    }, (e) => e is ConcurrentModificationError);
+    }, (e) => e is ConcurrentModificationError, "cm3");
   }
 
   {
@@ -99,35 +144,37 @@
     });
     Expect.throws(() {
       l.addAll(ci);
-    }, (e) => e is ConcurrentModificationError);
+    }, (e) => e is ConcurrentModificationError, "cm4");
   }
 
   {
-    // Length 50, only 25 elements.
+    // Length 500, only 250 elements.
     var l = [];
     var ci = new EfficientTestIterable(500, 250);
     l.addAll(ci);
-    Expect.listEquals(new List.generate(250, (x)=>x), l);
+    Expect.listEquals(new List.generate(250, (x)=>x), l, "cm5");
   }
 
   {
-    // Length 25, but 50 elements.
+    // Length 250, but 500 elements.
     var l = [];
     var ci = new EfficientTestIterable(250, 500);
     l.addAll(ci);
-    Expect.listEquals(new List.generate(500, (x)=>x), l);
+    Expect.listEquals(new List.generate(500, (x)=>x), l, "cm6");
   }
 
   {
     // Adding to yourself.
     var l = [1];
-    Expect.throws(() { l.addAll(l); }, (e) => e is ConcurrentModificationError);
+    Expect.throws(() { l.addAll(l); },
+                  (e) => e is ConcurrentModificationError, "cm7");
   }
 
   {
     // Adding to yourself.
     var l = [1, 2, 3];
-    Expect.throws(() { l.addAll(l); }, (e) => e is ConcurrentModificationError);
+    Expect.throws(() { l.addAll(l); },
+                  (e) => e is ConcurrentModificationError, "cm8");
   }
 }
 
diff --git a/tests/corelib/http_resource_test.dart b/tests/corelib/http_resource_test.dart
new file mode 100644
index 0000000..815fe9b
--- /dev/null
+++ b/tests/corelib/http_resource_test.dart
@@ -0,0 +1,62 @@
+// 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:io";
+
+const sampleText = "Sample text file.";
+
+main() async {
+  var server = await startServer();
+  var uriText = "http://localhost:${server.port}/sample.txt?query#fragment";
+  var resource = new Resource(uriText);
+
+  if (resource.uri != Uri.parse(uriText)) {
+    throw "Incorrect URI: ${resource.uri}";
+  }
+
+  var text = await resource.readAsString();
+  if (text != sampleText) {
+    throw "Incorrect reading of text file: $text";
+  }
+
+  var bytes = await resource.readAsBytes();
+  if (!compareBytes(bytes, sampleText.codeUnits)) {
+    throw "Incorrect reading of bytes: $bytes";
+  }
+
+  var streamBytes = [];
+  await for (var byteSlice in resource.openRead()) {
+    streamBytes.addAll(byteSlice);
+  }
+  if (!compareBytes(streamBytes, sampleText.codeUnits)) {
+    throw "Incorrect reading of bytes: $bytes";
+  }
+
+  await server.close();
+}
+
+/// Checks that [bytes] and [expectedBytes] have the same contents.
+bool compareBytes(bytes, expectedBytes) {
+  if (bytes.length != expectedBytes.length) return false;
+  for (int i = 0; i < expectedBytes.length; i++) {
+    if (bytes[i] != expectedBytes[i]) return false;
+  }
+  return true;
+}
+
+startServer() async {
+  var server = await HttpServer.bind(InternetAddress.LOOPBACK_IP_V4, 0);
+  var expectedUri = new Uri(path: "/sample.txt", query: "query");
+  server.forEach((request) async {
+    await request.drain();
+    var response = request.response;
+    if (request.uri == expectedUri) {
+      response.write(sampleText);
+    } else {
+      response.write("INCORRECT PATH!: ${request.uri}");
+    }
+    response.close();
+  });
+  return server;
+}
diff --git a/tests/corelib/list_test.dart b/tests/corelib/list_test.dart
index 5187ee8..c26c1cf 100644
--- a/tests/corelib/list_test.dart
+++ b/tests/corelib/list_test.dart
@@ -46,6 +46,89 @@
   testTypedGrowableList(new Int32List(0).toList());
 
   testListConstructor();
+
+  testErrors();
+}
+
+void testErrors() {
+  // Regression for issue http://dartbug.com/24295
+  testIndexError(list, index, name) {
+    try {
+      list[list.length];
+    } catch (err, s) {
+      Expect.isTrue(err is RangeError, "$name[$index]");
+      Expect.equals(list.length, err.invalidValue, "$name[$index] value");
+      Expect.equals(list.length - 1, err.end, "$name[$index] end");
+      Expect.equals(0, err.start, "$name[$index] start");
+    }
+  }
+  testIndex(list, name) {
+    testIndexError(list, list.length, name);   // Just too big.
+    testIndexError(list, -1, name);            // Negative.
+    testIndexError(list, 0x123456789, name);   // > 2^32.
+    testIndexError(list, -0x123456789, name);  // < -2^32.
+  }
+
+  // Slices.
+  testSliceError(list, start, end, name) {
+    name = "$name[$start:$end]";
+    var realError;
+    try {
+      RangeError.checkValidRange(start, end, list.length);
+    } catch (e) {
+      realError = e;
+    }
+    var result;
+    try {
+      result = list.sublist(start, end);
+    } catch (actualError) {
+      Expect.isNotNull(realError, "$name should not fail");
+      Expect.isTrue(actualError is RangeError, "$name is-error: $actualError");
+      Expect.equals(realError.name, actualError.name, "$name name");
+      Expect.equals(realError.invalidValue, actualError.invalidValue,
+                    "$name[0:l+1] value");
+      Expect.equals(realError.start, actualError.start, "$name[0:l+1] start");
+      Expect.equals(realError.end, actualError.end, "$name[0:l+1] end");
+      return;
+    }
+    // Didn't throw.
+    Expect.isNull(realError, "$name should fail");
+    Expect.equals(end - start, result.length, "$name result length");
+  }
+
+  testSlice(list, name) {
+    testSliceError(list, 0, list.length, name);  // Should not fail.
+    testSliceError(list, 0, list.length + 1, name);
+    testSliceError(list, 0, 0x123456789, name);
+    testSliceError(list, -1, list.length, name);
+    testSliceError(list, -0x123456789, list.length, name);
+    testSliceError(list, list.length + 1, list.length + 1, name);
+    testSliceError(list, -1, null, name);
+    if (list.length > 0) {
+      testSliceError(list, list.length, list.length - 1, name);
+    }
+  }
+
+  testRangeErrors(list, name) {
+    testIndex(list, "$name#${list.length} index");
+    testSlice(list, "$name#${list.length} slice");
+  }
+  // Empty lists.
+  testRangeErrors([], "list");
+  testRangeErrors(new List(0), "fixed-list");
+  testRangeErrors(const [], "const-list");
+  testRangeErrors(new List.unmodifiable([]), "unmodifiable");
+  testRangeErrors(new Uint8List(0), "typed-list");
+  testRangeErrors(new Uint8List.view(new Uint8List(0).buffer), "typed-list");
+  testRangeErrors([1, 2, 3].sublist(1, 1), "sub-list");
+  // Non-empty lists.
+  testRangeErrors([1, 2, 3], "list");
+  testRangeErrors(new List(3), "fixed-list");
+  testRangeErrors(const [1, 2, 3], "const-list");
+  testRangeErrors(new List.unmodifiable([1, 2, 3]), "unmodifiable");
+  testRangeErrors(new Uint8List(3), "typed-list");
+  testRangeErrors(new Uint8List.view(new Uint8List(3).buffer), "typed-list");
+  testRangeErrors([1, 2, 3, 4, 5].sublist(1, 3), "sub-list");
 }
 
 void testLength(int length, List list) {
@@ -475,6 +558,7 @@
 
 class Yes {
   operator ==(var other) => true;
+  int get hashCode => 0;
 }
 
 class MyList<E> extends ListBase<E> {
diff --git a/tests/corelib/map_test.dart b/tests/corelib/map_test.dart
index 79d1ace..dff5e61 100644
--- a/tests/corelib/map_test.dart
+++ b/tests/corelib/map_test.dart
@@ -392,13 +392,27 @@
 }
 
 void testTypes() {
-  Map<int, dynamic> map;
-  testMap(Map map) {
-    map[42] = "text";
-    map[43] = "text";
-    map[42] = "text";
-    map.remove(42);
-    map[42] = "text";
+  testMap(Map<num, String> map) {
+    Expect.isTrue(map is Map<num, String>);
+    Expect.isTrue(map is! Map<String, dynamic>);
+    Expect.isTrue(map is! Map<dynamic, int>);
+
+    // Use with properly typed keys and values.
+    map[42] = "text1";
+    map[43] = "text2";
+    map[42] = "text3";
+    Expect.equals("text3", map.remove(42));
+    Expect.equals(null, map[42]);
+    map[42] = "text4";
+
+    // Ensure that "containsKey", "containsValue" and "remove"
+    // accepts any object.
+    for (var object in [true, null, new Object()]) {
+      Expect.isFalse(map.containsKey(object));
+      Expect.isFalse(map.containsValue(object));
+      Expect.isNull(map.remove(object));
+      Expect.isNull(map[object]);
+    }
   }
   testMap(new HashMap<int, String>());
   testMap(new LinkedHashMap<int, String>());
diff --git a/tests/corelib/package_resource_test.dart b/tests/corelib/package_resource_test.dart
new file mode 100644
index 0000000..767cd8b
--- /dev/null
+++ b/tests/corelib/package_resource_test.dart
@@ -0,0 +1,48 @@
+// 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.
+
+const sampleText = "Sample text file.";
+
+main() async {
+  const uriText = "package:package_test_data/resources/sample.txt";
+  const resource = const Resource(uriText);
+
+  if (resource.uri != Uri.parse(uriText)) {
+    throw "Incorrect URI: ${resource.uri}";
+  }
+
+  var text = await resource.readAsString();
+  if (!text.startsWith("Sample text file.")) {
+    throw "Incorrect reading of text file: $text";
+  }
+
+  var bytes = await resource.readAsBytes();
+  if (!compareBytes(bytes, sampleText.codeUnits)) {
+    throw "Incorrect reading of bytes: $bytes";
+  }
+
+  var streamBytes = [];
+  await for (var byteSlice in resource.openRead()) {
+    streamBytes.addAll(byteSlice);
+  }
+  if (!compareBytes(streamBytes, sampleText.codeUnits)) {
+    throw "Incorrect reading of bytes: $bytes";
+  }
+
+  if (!compareBytes(streamBytes, bytes)) {
+    throw "Inconsistent reading of bytes: $bytes / $streamBytes";
+  }
+}
+
+/// Checks that [bytes] starts with [expectedBytes].
+///
+/// The bytes may be longer (because the test file is a text file and its
+/// terminating line ending may be mangled on some platforms).
+bool compareBytes(bytes, expectedBytes) {
+  if (bytes.length < expectedBytes.length) return false;
+  for (int i = 0; i < expectedBytes.length; i++) {
+    if (bytes[i] != expectedBytes[i]) return false;
+  }
+  return true;
+}
diff --git a/tests/corelib/uri_test.dart b/tests/corelib/uri_test.dart
index 834cadc..fd281c5 100644
--- a/tests/corelib/uri_test.dart
+++ b/tests/corelib/uri_test.dart
@@ -7,13 +7,25 @@
 import "package:expect/expect.dart";
 import 'dart:convert';
 
-testUri(String uri, bool isAbsolute) {
-  Expect.equals(isAbsolute, Uri.parse(uri).isAbsolute);
-  Expect.stringEquals(uri, Uri.parse(uri).toString());
+testUri(String uriText, bool isAbsolute) {
+  var uri = Uri.parse(uriText);
+
+  Expect.equals(isAbsolute, uri.isAbsolute);
+  Expect.stringEquals(uriText, uri.toString());
 
   // Test equals and hashCode members.
-  Expect.equals(Uri.parse(uri), Uri.parse(uri));
-  Expect.equals(Uri.parse(uri).hashCode, Uri.parse(uri).hashCode);
+  var uri2 = Uri.parse(uriText);
+  Expect.equals(uri, uri2);
+  Expect.equals(uri.hashCode, uri2.hashCode);
+
+  // Test that removeFragment doesn't change anything else.
+  if (uri.hasFragment) {
+    Expect.equals(Uri.parse(uriText.substring(0, uriText.indexOf('#'))),
+                  uri.removeFragment());
+  } else {
+    Expect.equals(uri,
+                  Uri.parse(uriText + "#fragment").removeFragment());
+  }
 }
 
 testEncodeDecode(String orig, String encoded) {
diff --git a/tests/html/custom/entered_left_view_test.dart b/tests/html/custom/entered_left_view_test.dart
index a2804bc..d04c74f 100644
--- a/tests/html/custom/entered_left_view_test.dart
+++ b/tests/html/custom/entered_left_view_test.dart
@@ -126,7 +126,7 @@
 
 
   // TODO(jmesserly): remove after deprecation period.
-  group('standard_events -- old callback names', () {
+  group('standard_events_old_callback_names', () {
     var a;
     setUp(() {
       invocations = [];
diff --git a/tests/html/fontface_loaded_test.dart b/tests/html/fontface_loaded_test.dart
index d192688..8a80f5d 100644
--- a/tests/html/fontface_loaded_test.dart
+++ b/tests/html/fontface_loaded_test.dart
@@ -8,17 +8,18 @@
 import 'dart:html';
 
 class NullTreeSanitizer implements NodeTreeSanitizer {
-    void sanitizeTree(Node node) {}
+  void sanitizeTree(Node node) {}
 }
 
 main() {
   useHtmlConfiguration();
 
-  var style = new Element.html('''
+  var style = new Element.html(
+      '''
       <style>
       @font-face {
         font-family: 'Ahem';
-        src: url(../../resources/Ahem.ttf);
+        src: url(/root_dart/tests/html/Ahem.ttf);
         font-style: italic;
         font-weight: 300;
         unicode-range: U+0-3FF;
@@ -27,20 +28,26 @@
         /* font-stretch property is not supported */
       }
       </style>
-      ''', treeSanitizer: new NullTreeSanitizer());
+      ''',
+      treeSanitizer: new NullTreeSanitizer());
   document.head.append(style);
 
-
   test('document fonts - temporary', () {
     var atLeastOneFont = false;
+    var loaded = [];
     document.fonts.forEach((FontFace fontFace, _, __) {
       atLeastOneFont = true;
       Future f1 = fontFace.loaded;
       Future f2 = fontFace.loaded;
-      expect(f1, equals(f2)); // Repeated calls should answer the same Future.
-
-      expect(fontFace.load(), throws);
+      loaded.add(fontFace.load());
+      loaded.add(f1);
+      loaded.add(f2);
     });
     expect(atLeastOneFont, isTrue);
+    return Future.wait(loaded).then(expectAsync((_) {
+      document.fonts.forEach((fontFace, _, __) {
+        expect(fontFace.status, 'loaded');
+      });
+    }));
   });
 }
diff --git a/tests/html/html.status b/tests/html/html.status
index 0b02629..56276ae 100644
--- a/tests/html/html.status
+++ b/tests/html/html.status
@@ -6,27 +6,35 @@
 dromaeo_smoke_test: Skip # Issue 14521, 8257
 cross_frame_test: Skip # Test reloads itself. Issue 18558
 
-js_array_test: Skip # Issue 23676, 23677
-js_typed_interop_test: Skip # Issue 23676, 23677
+[ $compiler == none && ($runtime == dartium || $runtime == drt) ]
 
-[ $compiler == none && ($runtime == drt || $runtime == dartium || $runtime == ContentShellOnAndroid) ]
-custom/attribute_changed_callback_test/unsupported_on_polyfill: Fail # Issue 18931 (Disabled for Chrome 35 roll)
-form_data_test/functional: Skip # Issue 19726
-indexeddb_1_test/functional: Skip # Issue 19512 (timing out)
-indexeddb_4_test: Skip # Issue 19726
-mouse_event_test: Fail # Issue 20437
+js_array_test: Skip # Dartium JSInterop failure
+js_typed_interop_test: Skip # Dartium JSInterop failure
+mirrors_js_typed_interop_test: Skip # Dartium JSInterop failure
+
+cross_domain_iframe_test: RuntimeError # Dartium JSInterop failure
+indexeddb_2_test: Fail # Dartium JSInterop failure. Identity preservation on array deferred copy.
+js_test/transferrables: RuntimeError # Dartium JSInterop failure
+js_test/JsArray: RuntimeError # Dartium JSInterop failure
+native_gc_test: Skip # Dartium JSInterop failure
+transferables_test: RuntimeError # Dartium JSInterop failure
+
+
+[ $compiler == none && ($runtime == drt || $runtime == dartium ) ]
 worker_api_test: Fail # Issue 10223
-media_stream_test/constructors: Pass, Crash # Issue 22267
-element_animate_test/simple_timing: Fail # Not supported on Dartium
-element_animate_test/omit_timing: Fail # Not supported on Dartium
-element_animate_test/timing_dict: Fail # Not supported on Dartium
-trusted_html_tree_sanitizer_test/untrusted: Fail # We make adoptNode throw to verify it's not being called. That doesn't work on Dartium.
+resource_http_test: Fail # Issue 24203
+js_function_getter_trust_types_test: Skip # dartium doesn't support trust types.
 
-[ $compiler == none && $mode == debug && ($runtime == drt || $runtime == dartium || $runtime == ContentShellOnAndroid) ]
+[ $compiler == none && $mode == debug && ($runtime == drt || $runtime == dartium ) ]
 datalistelement_test: Skip # Issue 20540
 
 [ $compiler == dart2js ]
 input_element_test/attributes: Fail # Issue 21555
+wrapping_collections_test: SkipByDesign # Testing an issue that is only relevant to Dartium
+
+[ $compiler == dart2js && $checked ]
+js_function_getter_trust_types_test: Skip # --trust-type-annotations incompatible with --checked
+js_typed_interop_test: Pass, Fail # Issue 24822
 
 [ $compiler == dart2js && $csp && $browser ]
 custom/js_custom_test: Fail # Issue 14643
@@ -35,7 +43,6 @@
 [ $compiler == dart2js && $browser ]
 custom/created_callback_test: Fail # Support for created constructor. Issue 14835
 fontface_loaded_test: Fail # Support for promises.
-storage_quota_test: Fail # Support for promises.
 
 [ $compiler == dart2js && ($runtime == safari || $runtime == safarimobilesim || $runtime == ff  || $ie) ]
 custom/entered_left_view_test/viewless_document: Fail # Polyfill does not handle this
@@ -46,33 +53,22 @@
 [ $compiler == none && $runtime == dartium && $system == macos]
 canvasrenderingcontext2d_test/drawImage_video_element_dataUrl: Pass,Fail # Issue 11834
 
-[ $compiler == none && ($runtime == drt || $runtime == dartium || $runtime == ContentShellOnAndroid) ]
+[ $compiler == none && ($runtime == drt || $runtime == dartium ) ]
 # postMessage in dartium always transfers the typed array buffer, never a view
 postmessage_structured_test/typed_arrays: Fail
 # Dartium seems to lose the data from the dispatchEvent.
-postmessage_structured_test/more_primitives: Fail
 async_test: Fail # Uses spawn, not implemented from a DOM isolate in Dartium
 keyboard_event_test: Fail # Issue 13902
 isolates_test: Fail # Issue 13921
-indexeddb_3_test: Skip # Issue 19578.  Timeouts and RuntimeError
 fileapi_test/getFile: Pass, Fail # Issue 20488
 
-# DO NOT Suppress/Skip the below XSS security test for dart2js - any failure is a P0 bug.
-node_validator_important_if_you_suppress_make_the_bug_critical_test/dom_clobbering: Fail # Dartium is immune to DOM clobbering, so the HTML passes through the sanitizer.
-
-[ $compiler == none && ($runtime == drt || $runtime == dartium || $runtime == ContentShellOnAndroid) && $mode == debug ]
+[ $compiler == none && ($runtime == drt || $runtime == dartium ) && $mode == debug ]
 websocket_test/websocket: Skip # Issue 17666
 canvasrenderingcontext2d_test/drawImage_video_element_dataUrl: Skip # Issue 17666
 
-[ $compiler == none && $runtime == ContentShellOnAndroid ]
-canvasrenderingcontext2d_test/drawImage_video_element: RuntimeError # Issue 19127
-canvasrenderingcontext2d_test/drawImage_video_element_dataUrl: Pass, Fail # Issue 20524
-notification_test/constructors: Skip # Times out on Android Dartium. Issue 22835
-
 element_offset_test/offset: RuntimeError # Issue 17550
 request_animation_frame_test: Skip # Times out, and also passes while taking 4.00 minutes. Issue 19127.
 fileapi_test/fileEntry: Pass, RuntimeError # Issue 20488
-indexeddb_5_test: Pass, RuntimeError # Issue 21262
 native_gc_test: Pass, Slow
 
 [ $compiler == none && $runtime == drt && $system == windows ]
@@ -108,8 +104,11 @@
 touchevent_test/supported: Fail # Touch events are only supported on touch devices
 element_animate_test/omit_timing: RuntimeError # Also timing out on MacOS. Issue 23507
 element_animate_test/timing_dict: RuntimeError # Also timing out on MacOS. Issue 23507
+element_animate_test/simple_timing: RuntimeError # Please triage this failure
 
 [ $runtime == chrome && $system == macos ]
+canvasrenderingcontext2d_test/drawImage_video_element: Skip # Times out. Please triage this failure.
+canvasrenderingcontext2d_test/drawImage_video_element_dataUrl: Skip # Times out. Please triage this failure.
 element_animate_test/omit_timing: Skip # Timing out on MacOS. Issue 23507
 element_animate_test/timing_dict: Skip # Timing out on MacOS. Issue 23507
 transition_event_test/functional: Skip # Times out. Issue 22167
@@ -118,7 +117,7 @@
 [$runtime == drt || $runtime == dartium || $runtime == chrome || $runtime == chromeOnAndroid || $runtime == ContentShellOnAndroid ]
 webgl_1_test: Pass, Fail # Issue 8219
 
-[ $compiler == none && ($runtime == drt || $runtime == dartium) && $system == windows]
+[ $compiler == none && ($runtime == drt || $runtime == dartium) && $system == windows ]
 websql_test: Skip # Issue 4941: stderr contains a backtrace.
 
 [ $compiler == none && ($runtime == drt || $runtime == dartium) && $mode == debug]
@@ -127,10 +126,10 @@
 
 [$runtime == ie10 || $runtime == ie11]
 indexeddb_5_test: Fail # Issue 12893
-js_test: Fail # Issue 14246
-element_test/click: Fail                # IE does not support firing this event.
+js_test/transferrables: RuntimeError # Issue 14246
+element_test/click: Fail # IE does not support firing this event.
 serialized_script_value_test: Fail
-websocket_test/websocket: Fail # TODO(efortuna): Issue 7875.
+websocket_test/websocket: Fail # Issue 7875. Closed with "working as intended".
 canvasrenderingcontext2d_test/drawImage_video_element: Fail # IE does not support drawImage w/ video element
 canvasrenderingcontext2d_test/drawImage_video_element_dataUrl: Fail # IE does not support drawImage w/ video element
 no_linked_scripts_htmltest: Skip # Times out on IE.  Issue 21537
@@ -342,7 +341,8 @@
 speechrecognition_test/supported: Fail
 websql_test/supported: Fail
 
-[ $runtime == ff ]
+[  $compiler == dart2js && $runtime == ff ]
+history_test/history: Skip # Issue 22050
 xhr_test/xhr: Pass, Fail # Issue 11602
 dart_object_local_storage_test: Skip  # sessionStorage NS_ERROR_DOM_NOT_SUPPORTED_ERR
 webgl_1_test: Pass, Fail   # Issue 8219
@@ -379,15 +379,18 @@
 [ $compiler == dart2js && ($runtime == drt || $runtime == ff) ]
 request_animation_frame_test: Skip # Async test hangs.
 
-[ $compiler == dart2js && $runtime == ff ]
-history_test/history: Skip # Issue 22050
-
 [ $compiler == dart2js && $csp && ($runtime == drt || $runtime == safari || $runtime == ff || $runtime == chrome || $runtime == chromeOnAndroid) ]
 # Note: these tests are all injecting scripts by design.  This is not allowed under CSP.
-event_customevent_test: Fail       # Test cannot run under CSP restrictions.
-js_interop_1_test: Skip            # Test cannot run under CSP restrictions (times out).
-js_test: Skip                      # Test cannot run under CSP restrictions (times out).
-postmessage_structured_test: Skip  # Test cannot run under CSP restrictions (times out).
+event_customevent_test: Fail        # Test cannot run under CSP restrictions.
+js_interop_1_test: Skip             # Test cannot run under CSP restrictions (times out).
+js_test: Skip                       # Test cannot run under CSP restrictions (times out).
+js_array_test: Skip                 # Test cannot run under CSP restrictions.
+js_typed_interop_test: Skip         # Test cannot run under CSP restrictions.
+js_function_getter_test: Skip       # Test cannot run under CSP restrictions.
+js_function_getter_trust_types_test: Skip  # Test cannot run under CSP restrictions.
+js_dart_to_string_test: Skip        # Test cannot run under CSP restrictions.
+mirrors_js_typed_interop_test: Skip # Test cannot run under CSP restrictions.
+postmessage_structured_test: Skip   # Test cannot run under CSP restrictions (times out).
 
 [ $compiler == dart2js &&  $runtime == chrome]
 svgelement_test/supported_altGlyph: RuntimeError # Issue 23144
@@ -408,6 +411,7 @@
 element_test: StaticWarning
 events_test: StaticWarning
 htmlelement_test: StaticWarning
+js_function_getter_trust_types_test: skip # dart2js specific flags.
 localstorage_test: StaticWarning
 mutationobserver_test: StaticWarning
 queryall_test: fail
@@ -418,3 +422,5 @@
 webgl_1_test: StaticWarning
 window_nosuchmethod_test: StaticWarning
 
+[ $compiler == dart2js && $cps_ir ]
+resource_http_test: Crash # (await for(var b in r.openRead()){bytes.addAll(b);}): await for
diff --git a/tests/html/js_array_test.dart b/tests/html/js_array_test.dart
index 4ede8ed..598cadf 100644
--- a/tests/html/js_array_test.dart
+++ b/tests/html/js_array_test.dart
@@ -2,165 +2,180 @@
 // for 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 jsArrayTest;
+@JS("ArrayTest.Util")
+library js_array_test;
 
 import 'dart:html';
-import 'dart:js';
 
+import 'dart:js' as js;
+import 'package:js/js.dart';
 import 'package:unittest/unittest.dart';
 import 'package:unittest/html_config.dart';
+import 'json_helper.dart' as json_helper;
 
 _injectJs() {
   document.body.append(new ScriptElement()
     ..type = 'text/javascript'
     ..innerHtml = r"""
-function callJsMethod(jsObj, jsMethodName, args) {
-  return jsObj[jsMethodName].apply(jsObj, args);
-}
+ArrayTest = {};
+ArrayTest.Util = {
+  callJsMethod: function(jsObj, jsMethodName, args) {
+    return jsObj[jsMethodName].apply(jsObj, args);
+  },
 
-function jsEnumerateIndices(obj) {
-  var ret = [];
-  for(var i in obj) {
-    ret.push(i);
-  }
-  return ret;
-}
-
-function setValue(obj, index, value) {
-  return obj[index] = value;
-}
-
-function getValue(obj, index) {
-  return obj[index];
-}
-
-function checkIsArray(obj) {
-  return Array.isArray(obj);
-}
-
-function concatValues(obj) {
-  return obj.concat("a", "b", ["c", "d"], 42, {foo: 10});
-}
-
-function concatOntoArray(obj) {
-  return [1,2,3].concat(obj, "foo");
-}
-
-function repeatedConcatOntoArray(obj) {
-  return [1,2,3].concat(obj, obj);
-}
-
-function everyGreaterThanZero(obj) {
-  return obj.every(function(currentValue, index, array) {
-    return currentValue > 0;
-  });
-}
-
-function everyGreaterThanZeroCheckThisArg(obj) {
-  var j = 0;
-  return obj.every(function(currentValue, index, array) {
-    if (j != index) {
-      throw "Unxpected index";
+  jsEnumerateIndices: function(obj) {
+    var ret = [];
+    for(var i in obj) {
+      ret.push(i);
     }
-    j++;
-    if (array !== obj) {
-      throw "Array argument doesn't match obj";
-    }
-    return currentValue > 0;
-  });
-}
+    return ret;
+  },
 
-function filterGreater42(obj) {
-  return obj.filter(function(currentValue, index, array) {
-    return currentValue > 42;
-  });
-}
+  checkIsArray: function(obj) {
+    return Array.isArray(obj);
+  },
 
-function forEachCollectResult(array, callback) {
-  var result = [];
-  array.forEach(function(currentValue) {
-    result.push(currentValue * 2);
-  });
-  return result;
-}
+  concatValues: function(obj) {
+    return obj.concat("a", "b", ["c", "d"], 42, {foo: 10});
+  },
 
-function someEqual42(array, callback) {
-  return array.some(function(currentValue) {
-    return currentValue == 42;
-  });
-}
+  concatOntoArray: function(obj) {
+    return [1,2,3].concat(obj, "foo");
+  },
 
-function sortNumbersBackwards(array) {
-  return array.sort(function(a, b) {
-    return b - a;
-  });
-}
+  repeatedConcatOntoArray: function(obj) {
+    return [1,2,3].concat(obj, obj);
+  },
 
-function spliceDummyItems(array) {
-  return array.splice(1, 2, "quick" ,"brown", "fox");
-}
+  everyGreaterThanZero: function(obj) {
+    return obj.every(function(currentValue, index, array) {
+      return currentValue > 0;
+    });
+  },
 
-function spliceTestStringArgs(array) {
-  return array.splice("1.2", "2.01", "quick" ,"brown", "fox");
-}
+  everyGreaterThanZeroCheckThisArg: function(obj) {
+    var j = 0;
+    return obj.every(function(currentValue, index, array) {
+      if (j != index) {
+        throw "Unxpected index";
+      }
+      j++;
+      if (array !== obj) {
+        throw "Array argument doesn't match obj";
+      }
+      return currentValue > 0;
+    });
+  },
 
-function splicePastEnd(array) {
-  return array.splice(1, 5332, "quick" ,"brown", "fox");
-}
+  filterGreater42: function(obj) {
+    return obj.filter(function(currentValue, index, array) {
+      return currentValue > 42;
+    });
+  },
 
-function callJsToString(array) {
-  return array.toString();
-}
+  forEachCollectResult: function(array) {
+    var result = [];
+    array.forEach(function(currentValue) {
+      result.push(currentValue * 2);
+    });
+    return result;
+  },
 
-function mapAddIndexToEachElement(array) {
-  return array.map(function(currentValue, index) {
-    return currentValue + index;
-  });
-}
+  someEqual42: function(array) {
+    return array.some(function(currentValue) {
+      return currentValue == 42;
+    });
+  },
 
-function reduceSumDoubledElements(array) {
-  return array.reduce(function(previousValue, currentValue) {
-        return previousValue + currentValue*2;
-      },
-      0);
-}
+  sortNumbersBackwards: function(array) {
+    return array.sort(function(a, b) {
+      return b - a;
+    });
+  },
 
-// TODO(jacobr): add a test that distinguishes reduce from reduceRight.
-function reduceRightSumDoubledElements(array) {
-  return array.reduceRight(function(previousValue, currentValue) {
-        return previousValue + currentValue*2;
-      },
-      0);
-}
+  spliceDummyItems: function(array) {
+    return array.splice(1, 2, "quick" ,"brown", "fox");
+  },
 
-function identical(o1, o2) {
-  return o1 === o2;
-}
+  spliceTestStringArgs: function(array) {
+    return array.splice("1.2", "2.01", "quick" ,"brown", "fox");
+  },
 
-function getOwnPropertyDescriptorJson(array, property) {
-  return JSON.stringify(Object.getOwnPropertyDescriptor(array, property));
-}
+  splicePastEnd: function(array) {
+    return array.splice(1, 5332, "quick" ,"brown", "fox");
+  },
 
-function setLength(array, len) {
-  return array.length = len;
-}
+  callJsToString: function(array) {
+    return array.toString();
+  },
 
-function jsonStringify(o) {
-  return JSON.stringify(o);
-}
+  mapAddIndexToEachElement: function(array) {
+    return array.map(function(currentValue, index) {
+      return currentValue + index;
+    });
+  },
 
-// Calling a method from Dart List on an arbitrary target object.
-function callListMethodOnTarget(dartArray, target, methodName, args) {
-  return dartArray[methodName].apply(target, args);
-}
+  reduceSumDoubledElements: function(array) {
+    return array.reduce(function(previousValue, currentValue) {
+          return previousValue + currentValue*2;
+        },
+        0);
+  },
 
+  // TODO(jacobr): add a test that distinguishes reduce from reduceRight.
+  reduceRightSumDoubledElements: function(array) {
+    return array.reduceRight(function(previousValue, currentValue) {
+          return previousValue + currentValue*2;
+        },
+        0);
+  },
+
+  getOwnPropertyDescriptor: function(array, property) {
+    return Object.getOwnPropertyDescriptor(array, property);
+  },
+
+  setLength: function(array, len) {
+    return array.length = len;
+  },
+
+  getValue: function(obj, index) {
+    return obj[index];
+  },
+
+  setValue: function(obj, index, value) {
+    return obj[index] = value;
+  },
+
+  // Calling a method from Dart List on an arbitrary target object.
+  callListMethodOnTarget: function(dartArray, target, methodName, args) {
+    return dartArray[methodName].apply(target, args);
+  },
+
+  newArray: function() { return []; },
+
+  newLiteral: function() { return {}; },
+
+};
 """);
 }
 
+@JS()
+class PropertyDescriptor {
+  external get value;
+  external bool get writable;
+  external bool get enumerable;
+  external bool get configurable;
+}
+
+@JS()
+class SimpleJsLiteralClass {
+  external get foo;
+}
+
 class Foo {}
 
-callJsMethod(List array, String methodName, List args) =>
-    context.callMethod("callJsMethod", [array, methodName, args]);
+@JS()
+external callJsMethod(List array, String methodName, List args);
 
 callIndexOf(List array, value) => callJsMethod(array, "indexOf", [value]);
 callLastIndexOf(List array, value) =>
@@ -170,13 +185,78 @@
 callPush(List array, element) => callJsMethod(array, "push", [element]);
 callShift(List array) => callJsMethod(array, "shift", []);
 callReverse(List array) => callJsMethod(array, "reverse", []);
-callSetLength(List array, length) =>
-    context.callMethod("setLength", [array, length]);
 
-callListMethodOnObject(JsObject object, String methodName, List args) => context
-    .callMethod("callListMethodOnTarget", [[], object, methodName, args]);
+callListMethodOnObject(object, String methodName, List args) =>
+    callListMethodOnTarget([], object, methodName, args);
 
-jsonStringify(JsObject object) => context.callMethod("jsonStringify", [object]);
+@JS()
+external jsEnumerateIndices(obj);
+@JS()
+external bool checkIsArray(obj);
+@JS()
+external concatValues(obj);
+
+@JS()
+external concatOntoArray(obj);
+
+@JS()
+external repeatedConcatOntoArray(obj);
+@JS()
+external bool everyGreaterThanZero(obj);
+@JS()
+external bool everyGreaterThanZeroCheckThisArg(obj);
+
+@JS()
+external filterGreater42(obj);
+
+@JS()
+external forEachCollectResult(List array);
+@JS()
+external someEqual42(List array);
+@JS()
+external sortNumbersBackwards(List array);
+
+@JS()
+external List spliceDummyItems(List array);
+
+@JS()
+external List spliceTestStringArgs(List array);
+
+@JS()
+external List splicePastEnd(List array);
+
+@JS()
+external String callJsToString(List array);
+
+@JS()
+external mapAddIndexToEachElement(List array);
+@JS()
+external reduceSumDoubledElements(List array);
+
+// TODO(jacobr): add a test that distinguishes reduce from reduceRight.
+@JS()
+external reduceRightSumDoubledElements(List array);
+
+@JS()
+external PropertyDescriptor getOwnPropertyDescriptor(obj, property);
+
+@JS("setLength")
+external callSetLength(List array, length);
+
+@JS()
+external getValue(obj, index);
+
+@JS()
+external setValue(obj, index, value);
+
+@JS()
+external callListMethodOnTarget(List target, object, String methodName, List args);
+
+@JS()
+external newArray();
+
+@JS()
+external newLiteral();
 
 main() {
   _injectJs();
@@ -238,7 +318,7 @@
     test('default', () {
       expect(callJsMethod(list, "join", []), equals("3,42,foo"));
       expect(callJsMethod(listWithDartClasses, "join", []),
-          equals("3,Instance of 'Foo',42,foo,Instance of 'Object'"));
+          equals("3,${new Foo()},42,foo,${new Object()}"));
     });
 
     test('custom separator', () {
@@ -375,7 +455,8 @@
   group("js snippet tests", () {
     test("enumerate indices", () {
       var list = ["a", "b", "c", "d"];
-      var indices = context.callMethod('jsEnumerateIndices', [list]);
+      var indices =
+          jsEnumerateIndices(list);
       expect(indices.length, equals(4));
       for (int i = 0; i < 4; i++) {
         expect(indices[i], equals('$i'));
@@ -384,55 +465,60 @@
 
     test("set element", () {
       var list = ["a", "b", "c", "d"];
-      context.callMethod('setValue', [list, 0, 42]);
+      setValue(list, 0, 42);
       expect(list[0], equals(42));
-      context.callMethod('setValue', [list, 1, 84]);
+      setValue(list, 1, 84);
       expect(list[1], equals(84));
-      context.callMethod(
-          'setValue', [list, 6, 100]); // Off the end of the list.
+      setValue(list, 6, 100); // Off the end of the list.
       expect(list.length, equals(7));
       expect(list[4], equals(null));
       expect(list[6], equals(100));
 
       // These tests have to be commented out because we don't persist
       // JS proxies for Dart objects like we could/should.
-      // context.callMethod('setValue', [list, -1, "foo"]); // Not a valid array index
-      // expect(context.callMethod('getValue', [list, -1]), equals("foo"));
-      // expect(context.callMethod('getValue', [list, "-1"]), equals("foo"));
+      // setValue(list, -1, "foo"); // Not a valid array index
+      // expect(getValue(list, -1), equals("foo"));
+      // expect(getValue(list, "-1"), equals("foo"));
     });
 
     test("get element", () {
       var list = ["a", "b", "c", "d"];
-      expect(context.callMethod('getValue', [list, 0]), equals("a"));
-      expect(context.callMethod('getValue', [list, 1]), equals("b"));
-      expect(context.callMethod('getValue', [list, 6]), equals(null));
-      expect(context.callMethod('getValue', [list, -1]), equals(null));
+      expect(getValue(list, 0),
+          equals("a"));
+      expect(getValue(list, 1),
+          equals("b"));
+      expect(getValue(list, 6),
+          equals(null));
+      expect(getValue(list, -1),
+          equals(null));
 
-      expect(context.callMethod('getValue', [list, "0"]), equals("a"));
-      expect(context.callMethod('getValue', [list, "1"]), equals("b"));
+      expect(getValue(list, "0"),
+          equals("a"));
+      expect(getValue(list, "1"),
+          equals("b"));
     });
 
     test("is array", () {
       var list = ["a", "b"];
-      expect(context.callMethod("checkIsArray", [list]), isTrue);
+      expect(checkIsArray(list), isTrue);
     });
 
     test("property descriptors", () {
       // This test matters to make behavior consistent with JS native arrays
       // and to make devtools integration work well.
       var list = ["a", "b"];
-      expect(context.callMethod("getOwnPropertyDescriptorJson", [list, 0]),
-          equals('{"value":"a",'
-              '"writable":true,'
-              '"enumerable":true,'
-              '"configurable":true}'));
+      var descriptor = getOwnPropertyDescriptor(list, 0);
 
-      expect(
-          context.callMethod("getOwnPropertyDescriptorJson", [list, "length"]),
-          equals('{"value":2,'
-              '"writable":true,'
-              '"enumerable":false,'
-              '"configurable":false}'));
+      expect(descriptor.value, equals("a"));
+      expect(descriptor.writable, isTrue);
+      expect(descriptor.enumerable, isTrue);
+      expect(descriptor.configurable, isTrue);
+
+      descriptor = getOwnPropertyDescriptor(list, "length");
+      expect(descriptor.value, equals(2));
+      expect(descriptor.writable, isTrue);
+      expect(descriptor.enumerable, isFalse);
+      expect(descriptor.configurable, isFalse);
     });
 
     test("concat js arrays", () {
@@ -440,21 +526,22 @@
       // Tests that calling the concat method from JS will flatten out JS arrays
       // We concat the array with "a", "b", ["c", "d"], 42, {foo: 10}
       // which should generate ["1", "2", "a", "b", ["c", "d"], 42, {foo: 10}]
-      var ret = context.callMethod("concatValues", [list]);
+      var ret = concatValues(list);
       expect(list.length, equals(2));
       expect(ret.length, equals(8));
       expect(ret[0], equals("1"));
       expect(ret[3], equals("b"));
       expect(ret[5], equals("d"));
       expect(ret[6], equals(42));
-      expect(ret[7]['foo'], equals(10));
+      SimpleJsLiteralClass item = ret[7];
+      expect(item.foo, equals(10));
     });
 
     test("concat onto arrays", () {
       // This test only passes if we have monkey patched the core Array object
       // prototype to handle Dart Lists.
       var list = ["a", "b"];
-      var ret = context.callMethod("concatOntoArray", [list]);
+      var ret = concatOntoArray(list);
       expect(list.length, equals(2));
       expect(ret, equals([1, 2, 3, "a", "b", "foo"]));
     });
@@ -463,47 +550,62 @@
       // This test only passes if we have monkey patched the core Array object
       // prototype to handle Dart Lists.
       var list = ["a", "b"];
-      var ret = callJsMethod(list, "concat", [["c", "d"], "e", ["f", "g"]]);
+      var ret = callJsMethod(list, "concat", [
+        ["c", "d"],
+        "e",
+        ["f", "g"]
+      ]);
       expect(list.length, equals(2));
       expect(ret, equals(["a", "b", "c", "d", "e", "f", "g"]));
     });
 
     test("every greater than zero", () {
-      expect(context.callMethod("everyGreaterThanZero", [[1, 5]]), isTrue);
-      expect(context.callMethod("everyGreaterThanZeroCheckThisArg", [[1, 5]]),
+      expect(
+          everyGreaterThanZero([1, 5]),
           isTrue);
-      expect(context.callMethod("everyGreaterThanZero", [[1, 0]]), isFalse);
-      expect(context.callMethod("everyGreaterThanZero", [[]]), isTrue);
+      expect(
+          everyGreaterThanZeroCheckThisArg([1, 5]),
+          isTrue);
+      expect(
+          everyGreaterThanZero([1, 0]),
+          isFalse);
+      expect(everyGreaterThanZero([]),
+          isTrue);
     });
 
     test("filter greater than 42", () {
-      expect(context.callMethod("filterGreater42", [[1, 5]]), equals([]));
-      expect(context.callMethod("filterGreater42", [[43, 5, 49]]),
+      expect(filterGreater42([1, 5]), equals([]));
+      expect(
+          filterGreater42([43, 5, 49]),
           equals([43, 49]));
-      expect(context.callMethod("filterGreater42", [["43", "5", "49"]]),
+      expect(
+          filterGreater42(["43", "5", "49"]),
           equals(["43", "49"]));
     });
 
     test("for each collect result", () {
-      expect(context.callMethod("forEachCollectResult", [[1, 5, 7]]),
+      expect(
+          forEachCollectResult([1, 5, 7]),
           equals([2, 10, 14]));
     });
 
     test("some", () {
-      expect(context.callMethod("someEqual42", [[1, 5, 9]]), isFalse);
-      expect(context.callMethod("someEqual42", [[1, 42, 9]]), isTrue);
+      expect(someEqual42([1, 5, 9]),
+          isFalse);
+      expect(someEqual42([1, 42, 9]),
+          isTrue);
     });
 
     test("sort backwards", () {
       var arr = [1, 5, 9];
-      var ret = context.callMethod("sortNumbersBackwards", [arr]);
+      var ret = sortNumbersBackwards(arr);
       expect(identical(arr, ret), isTrue);
       expect(ret, equals([9, 5, 1]));
     });
 
     test("splice dummy items", () {
       var list = [1, 2, 3, 4];
-      var removed = context.callMethod("spliceDummyItems", [list]);
+      var removed = spliceDummyItems(list);
       expect(removed.length, equals(2));
       expect(removed[0], equals(2));
       expect(removed[1], equals(3));
@@ -516,7 +618,7 @@
 
     test("splice string args", () {
       var list = [1, 2, 3, 4];
-      var removed = context.callMethod("spliceTestStringArgs", [list]);
+      var removed = spliceTestStringArgs(list);
       expect(removed.length, equals(2));
       expect(removed[0], equals(2));
       expect(removed[1], equals(3));
@@ -529,7 +631,7 @@
 
     test("splice pastEndOfArray", () {
       var list = [1, 2, 3, 4];
-      var removed = context.callMethod("splicePastEnd", [list]);
+      var removed = splicePastEnd(list);
       expect(removed.length, equals(3));
       expect(list.first, equals(1));
       expect(list.length, equals(4));
@@ -540,7 +642,7 @@
 
     test("splice both bounds past end of array", () {
       var list = [1];
-      var removed = context.callMethod("splicePastEnd", [list]);
+      var removed = splicePastEnd(list);
       expect(removed.length, equals(0));
       expect(list.first, equals(1));
       expect(list.length, equals(4));
@@ -550,25 +652,25 @@
     });
 
     test("call List method on JavaScript object", () {
-      var jsObject = new JsObject.jsify({});
+      var jsObject = newLiteral();
       callListMethodOnObject(jsObject, 'push', ["a"]);
       callListMethodOnObject(jsObject, 'push', ["b"]);
       callListMethodOnObject(jsObject, 'push', ["c", "d"]);
       callListMethodOnObject(jsObject, 'push', []);
 
-      expect(jsonStringify(jsObject),
+      expect(json_helper.stringify(jsObject),
           equals('{"0":"a","1":"b","2":"c","3":"d","length":4}'));
 
       expect(callListMethodOnObject(jsObject, 'pop', []), equals("d"));
       expect(callListMethodOnObject(jsObject, 'join', ["#"]), equals("a#b#c"));
 
-      var jsArray = new JsObject.jsify([]);
+      var jsArray = newArray();
       callListMethodOnObject(jsArray, 'push', ["a"]);
       callListMethodOnObject(jsArray, 'push', ["b"]);
       callListMethodOnObject(jsArray, 'push', ["c", "d"]);
       callListMethodOnObject(jsArray, 'push', []);
 
-      expect(jsonStringify(jsArray), equals('["a","b","c","d"]'));
+      expect(json_helper.stringify(jsArray), equals('["a","b","c","d"]'));
     });
   });
 
@@ -584,10 +686,10 @@
       var listView = new UnmodifiableListView(list.getRange(1,3));
       expect(listView is List, isTrue);
       expect(listView.length, equals(2));
-      expect(context.callMethod("checkIsArray", [listView]), isFalse);
-      expect(context.callMethod("checkIsArray", [listView.toList()]), isTrue);
-      expect(context.callMethod("getOwnPropertyDescriptorJson",
-          [listView, "length"]), equals("null"));
+      expect(checkIsArray(listView), isFalse);
+      expect(checkIsArray(listView.toList()), isTrue);
+      expect(getOwnPropertyDescriptor(
+          listView, "length"), equals(null));
     });
   });
   */
diff --git a/tests/html/js_dart_to_string_test.dart b/tests/html/js_dart_to_string_test.dart
new file mode 100644
index 0000000..5293053
--- /dev/null
+++ b/tests/html/js_dart_to_string_test.dart
@@ -0,0 +1,46 @@
+// 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_test;
+
+import 'dart:html';
+
+import 'package:js/js.dart';
+import 'package:unittest/unittest.dart';
+import 'package:unittest/html_config.dart';
+
+_injectJs() {
+  document.body.append(new ScriptElement()
+    ..type = 'text/javascript'
+    ..innerHtml = r"""
+
+  function jsToStringViaCoercion(a) {
+    return a + '';
+  };
+""");
+}
+
+@JS()
+external String jsToStringViaCoercion(obj);
+
+class ExampleClassWithCustomToString {
+  var x;
+  ExampleClassWithCustomToString(this.x);
+  String toString() => "#$x#";
+}
+
+main() {
+  _injectJs();
+
+  useHtmlConfiguration();
+
+  group('toString', () {
+    test('custom dart', () {
+      var x = new ExampleClassWithCustomToString("fooBar");
+      expect(jsToStringViaCoercion(x), equals("#fooBar#"));
+      expect(jsToStringViaCoercion({'a' : 1, 'b': 2}), equals("{a: 1, b: 2}"));
+    });
+  });
+}
diff --git a/tests/html/js_function_getter_test.dart b/tests/html/js_function_getter_test.dart
new file mode 100644
index 0000000..c8a61b8
--- /dev/null
+++ b/tests/html/js_function_getter_test.dart
@@ -0,0 +1,109 @@
+// 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_function_getter_test;
+
+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';
+
+_injectJs() {
+  document.body.append(new ScriptElement()
+    ..type = 'text/javascript'
+    ..innerHtml = r"""
+  var bar = { };
+
+  bar.instanceMember = function() {
+    if (this !== bar) {
+      throw 'Unexpected this!';
+    }
+    return arguments.length;
+  };
+
+  bar.staticMember = function() {
+    return arguments.length * 2;
+  };
+
+  bar.dynamicStatic = function() {
+    return arguments.length;
+  };
+
+  bar.add = function(a, b) {
+    return a + b;
+  };
+
+  var foo = { 'bar' : bar };
+""");
+}
+
+typedef int AddFn(int x, int y);
+
+@JS()
+abstract class Bar {
+  external Function get staticMember;
+  external Function get instanceMember;
+  external AddFn get add;
+  external get dynamicStatic;
+  external num get nonFunctionStatic;
+}
+
+@JS()
+abstract class Foo {
+  external Bar get bar;
+}
+
+@JS()
+external Foo get foo;
+
+main() {
+  _injectJs();
+
+  useHtmlIndividualConfiguration();
+
+  group('call getter as function', () {
+    test('member function', () {
+      expect(foo.bar.instanceMember(), equals(0));
+      expect(foo.bar.instanceMember(0), equals(1));
+      expect(foo.bar.instanceMember(0,0), equals(2));
+      expect(foo.bar.instanceMember(0,0,0,0,0,0), equals(6));
+      var instanceMember = foo.bar.instanceMember;
+      expect(() => instanceMember(), throws);
+      expect(() => instanceMember(0), throws);
+      expect(() => instanceMember(0,0), throws);
+      expect(() => instanceMember(0,0,0,0,0,0), throws);
+    });
+
+    test('static function', () {
+      expect(foo.bar.staticMember(), equals(0));
+      expect(foo.bar.staticMember(0), equals(2));
+      expect(foo.bar.staticMember(0,0), equals(4));
+      expect(foo.bar.staticMember(0,0,0,0,0,0), equals(12));
+      var staticMember = foo.bar.staticMember;
+      expect(staticMember(), equals(0));
+      expect(staticMember(0), equals(2));
+      expect(staticMember(0,0), equals(4));
+      expect(staticMember(0,0,0,0,0,0), equals(12));
+    });
+
+    test('static dynamicStatic', () {
+      expect(foo.bar.dynamicStatic(), equals(0));
+      expect(foo.bar.dynamicStatic(0), equals(1));
+      expect(foo.bar.dynamicStatic(0,0), equals(2));
+      expect(foo.bar.dynamicStatic(0,0,0,0,0,0), equals(6));
+      var dynamicStatic = foo.bar.dynamicStatic;
+      expect(dynamicStatic(), equals(0));
+      expect(dynamicStatic(0), equals(1));
+      expect(dynamicStatic(0,0), equals(2));
+      expect(dynamicStatic(0,0,0,0,0,0), equals(6));
+    });
+
+    test('typedef function', () {
+      expect(foo.bar.add(4,5), equals(9));
+    });
+  });
+}
diff --git a/tests/html/js_function_getter_trust_types_test.dart b/tests/html/js_function_getter_trust_types_test.dart
new file mode 100644
index 0000000..3e94b503
--- /dev/null
+++ b/tests/html/js_function_getter_trust_types_test.dart
@@ -0,0 +1,72 @@
+// 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.
+
+// SharedOptions=--trust-type-annotations
+@JS()
+library js_function_getter_trust_types_test;
+
+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';
+
+_injectJs() {
+  document.body.append(new ScriptElement()
+    ..type = 'text/javascript'
+    ..innerHtml = r"""
+  var bar = { };
+
+  bar.nonFunctionStatic = function() {
+    return arguments.length * 2;
+  };
+
+  bar.add = function(a, b) {
+    return a + b;
+  };
+
+  var foo = { 'bar' : bar };
+""");
+}
+
+typedef int AddFn(int x, int y);
+
+@JS()
+class NotAFn { }
+
+@JS()
+abstract class Bar {
+  external AddFn get add;
+  external NotAFn get nonFunctionStatic;
+}
+
+@JS()
+abstract class Foo {
+  external Bar get bar;
+}
+
+@JS()
+external Foo get foo;
+
+main() {
+  _injectJs();
+
+  useHtmlIndividualConfiguration();
+
+  group('trust types', () {
+    test('static nonFunctionStatic', () {
+      expect(() => foo.bar.nonFunctionStatic(), throws);
+      expect(() => foo.bar.nonFunctionStatic(0), throws);
+      expect(() => foo.bar.nonFunctionStatic(0,0), throws);
+      expect(() => foo.bar.nonFunctionStatic(0,0,0,0,0,0), throws);
+    });
+
+    test('typedef function', () {
+      expect(() => foo.bar.add(4), throws);
+      expect(() => foo.bar.add(4,5,10), throws);
+      expect(foo.bar.add(4,5), equals(9));
+    });
+  });
+}
diff --git a/tests/html/js_test.dart b/tests/html/js_test.dart
index 081ab02..37c73ab 100644
--- a/tests/html/js_test.dart
+++ b/tests/html/js_test.dart
@@ -11,7 +11,7 @@
 import 'dart:js';
 
 import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
+import 'package:unittest/html_individual_config.dart';
 
 _injectJs() {
   final script = new ScriptElement();
@@ -230,7 +230,7 @@
 
 main() {
   _injectJs();
-  useHtmlConfiguration();
+  useHtmlIndividualConfiguration();
 
   group('identity', () {
 
@@ -552,7 +552,7 @@
       array.length = 3;
       expect(array, [1, 2, null]);
     });
- 
+
      test('add', () {
       var array = new JsArray();
       array.add('a');
@@ -852,6 +852,8 @@
         expect(context['window'] is Window, isTrue);
       });
 
+      // Bug: dartbug.com/24520
+      /*
       test('foreign browser objects should be proxied', () {
         var iframe = new IFrameElement();
         document.body.children.add(iframe);
@@ -878,6 +880,7 @@
         context.callMethod('fireClickEvent', [contentWindow]);
         expect(clicked, isTrue);
       });
+      */
 
       test('document', () {
         expect(context['document'] is Document, isTrue);
diff --git a/tests/html/js_typed_interop_test.dart b/tests/html/js_typed_interop_test.dart
index c8c0260..0e7cd0c 100644
--- a/tests/html/js_typed_interop_test.dart
+++ b/tests/html/js_typed_interop_test.dart
@@ -2,24 +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.
 
-library jsArrayTest;
+@JS()
+library js_typed_interop_test;
 
 import 'dart:html';
-import 'dart:js';
 
+import 'package:js/js.dart';
 import 'package:unittest/unittest.dart';
 import 'package:unittest/html_config.dart';
+import 'package:unittest/html_individual_config.dart';
 
 _injectJs() {
   document.body.append(new ScriptElement()
     ..type = 'text/javascript'
     ..innerHtml = r"""
+  var Foo = {
+    multiplyDefault2: function(a, b) {
+      if (arguments.length >= 2) return a *b;
+      return a * 2;
+    }
+  };
+
   var foo = {
     x: 3,
     z: 40, // Not specified in typed Dart API so should fail in checked mode.
     multiplyByX: function(arg) { return arg * this.x; },
     // This function can be torn off without having to bind this.
-    multiplyBy2: function(arg) { return arg * 2; }
+    multiplyBy2: function(arg) { return arg * 2; },
+    multiplyDefault2Function: function(a, b) {
+      if (arguments.length >= 2) return a * b;
+      return a * 2;
+    },
+    callClosureWithArg1: function(closure, arg) {
+      return closure(arg);
+    },
+    callClosureWithArg2: function(closure, arg1, arg2) {
+      return closure(arg1, arg2);
+    },
+    callClosureWithArgAndThis: function(closure, arg) {
+      return closure.apply(this, [arg]);
+    },
+
+    getBar: function() {
+      return bar;
+    }
   };
 
   var foob = {
@@ -30,51 +56,159 @@
 
   var bar = {
     x: "foo",
-    multiplyByX: true
+    multiplyByX: true,
+    getFoo: function() {
+      return foo;
+    }
+  };
+
+  function ClassWithConstructor(a, b) {
+    this.a = a;
+    this.b = b;
+  };
+
+  ClassWithConstructor.prototype = {
+    getA: function() { return this.a;}
   };
 
   var selection = ["a", "b", "c", foo, bar];  
-  selection.doubleLength = function() { return this.length * 2; };
+
+  function returnNumArgs() { return arguments.length; };
+  function returnLastArg() { return arguments[arguments.length-1]; };
+
+  function confuse(obj) { return obj; }
+
+  function StringWrapper(str) {
+    this.str = str;
+  }
+  StringWrapper.prototype = {
+    charCodeAt: function(index) {
+      return this.str.charCodeAt(index);
+    }
+  };
 """);
 }
 
-abstract class Foo {
-  int get x;
-  set x(int v);
-  num multiplyByX(num y);
-  num multiplyBy2(num y);
+class RegularClass {
+  factory RegularClass(a) {
+    return new RegularClass.fooConstructor(a);
+  }
+  RegularClass.fooConstructor(this.a);
+  var a;
 }
 
-abstract class Foob extends Foo {
-  final String y;
+@JS()
+class ClassWithConstructor {
+  external ClassWithConstructor(aParam, bParam);
+  external getA();
+  external get a;
+  external get b;
 }
 
-abstract class Bar {
-  String get x;
-  bool get multiplyByX;
+typedef num MultiplyWithDefault(num a, [num b]);
+
+@JS()
+class Foo {
+  external int get x;
+  external set x(int v);
+  external num multiplyByX(num y);
+  external num multiplyBy2(num y);
+  external MultiplyWithDefault get multiplyDefault2Function;
+
+  external callClosureWithArgAndThis(Function closure, arg);
+  external callClosureWithArg1(Function closure, arg1);
+  external callClosureWithArg2(Function closure, arg1, arg2);
+  external Bar getBar();
+  external static num multiplyDefault2(num a, [num b]);
 }
 
-class Baz {}
+@anonymous
+@JS()
+class ExampleLiteral {
+  external factory ExampleLiteral({int x, String y, num z});
 
-// This class shows the pattern used by APIs such as jQuery that add methods
-// to Arrays.
-abstract class Selection implements List {
-  num doubleLength();
+  external int get x;
+  external String get y;
+  external num get z;
 }
 
-Foo get foo => context['foo'];
-Foob get foob => context['foob'];
-Bar get bar => context['bar'];
-Selection get selection => context['selection'];
+@anonymous
+@JS()
+class EmptyLiteral {
+  external factory EmptyLiteral();
+}
+
+@JS('Foob')
+class Foob extends Foo {
+  external String get y;
+}
+
+@JS('Bar')
+class Bar {
+  external String get x;
+  external bool get multiplyByX;
+  external Foo getFoo();
+}
+
+// No @JS is required for these external methods as the library is
+// annotated with Js.
+external Foo get foo;
+external Foob get foob;
+external Bar get bar;
+external Selection get selection;
+
+addWithDefault(a, [b = 100]) => a + b;
+
+external Function get returnNumArgs;
+external Function get returnLastArg;
+
+const STRINGIFY_LOCATION = "JSON.stringify";
+@JS(STRINGIFY_LOCATION)
+external String stringify(obj);
+
+@JS()
+class StringWrapper {
+  external StringWrapper(String str);
+  external int charCodeAt(int i);
+}
+
+// Defeat JS type inference by calling through JavaScript interop.
+@JS()
+external confuse(obj);
 
 main() {
-  // Call experimental API to register Dart interfaces implemented by
-  // JavaScript classes.
-  registerJsInterfaces([Foo, Foob, Bar, Selection]);
-
   _injectJs();
 
-  useHtmlConfiguration();
+  useHtmlIndividualConfiguration();
+
+  group('object literal', () {
+    test('simple', () {
+      var l = new ExampleLiteral(x: 3, y: "foo");
+      expect(l.x, equals(3));
+      expect(l.y, equals("foo"));
+      expect(l.z, isNull);
+      expect(stringify(l), equals('{"x":3,"y":"foo"}'));
+      l = new ExampleLiteral(z: 100);
+      expect(l.x, isNull);
+      expect(l.y, isNull);
+      expect(l.z, equals(100));
+      expect(stringify(l), equals('{"z":100}'));
+    });
+
+    test('empty', () {
+      var l = new EmptyLiteral();
+      expect(stringify(l), equals('{}'));
+    });
+  });
+
+  group('constructor', () {
+    test('simple', () {
+      var o = new ClassWithConstructor("foo", "bar");
+      expect(o.a, equals("foo"));
+      expect(o.b, equals("bar"));
+      expect(o.getA(), equals("foo"));
+    });
+  });
 
   group('property', () {
     test('get', () {
@@ -83,15 +217,15 @@
       expect(foob.y, equals("why"));
 
       // Exists in JS but not in API.
-      expect(() => foo.z, throws);
+      expect(() => (foo as dynamic).zSomeInvalidName, throws);
       expect(bar.multiplyByX, isTrue);
     });
     test('set', () {
       foo.x = 42;
       expect(foo.x, equals(42));
       // Property tagged as read only in typed API.
-      expect(() => foob.y = "bla", throws);
-      expect(() => foo.unknownName = 42, throws);
+      expect(() => (foob as dynamic).y = "bla", throws);
+      expect(() => (foo as dynamic).unknownName = 42, throws);
     });
   });
 
@@ -105,22 +239,134 @@
 
     test('tearoff', () {
       foo.x = 10;
-      // TODO(jacobr): should we automatically bind "this" for tearoffs of JS
-      // objects?
-      JsFunction multiplyBy2 = foo.multiplyBy2;
+      Function multiplyBy2 = foo.multiplyBy2;
       expect(multiplyBy2(5), equals(10));
+      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);
+
+      MultiplyWithDefault multiplyWithDefault = foo.multiplyDefault2Function;
+      expect(multiplyWithDefault(6, 6), equals(36));
+      expect(multiplyWithDefault(6), equals(12));
+      Function untypedFunction = foo.multiplyDefault2Function;
+      // Calling with extra bogus arguments has no impact for JavaScript
+      // methods.
+      expect(untypedFunction(6, 6, "ignored", "ignored"), equals(36));
+      expect(untypedFunction(6, 6, "ignored", 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), equals(36));
+      // 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);
+
+    });
+  });
+
+  group('static method', () {
+    test('call from dart', () {
+      expect(Foo.multiplyDefault2(6, 7), equals(42));
+      expect(Foo.multiplyDefault2(6), equals(12));
+      MultiplyWithDefault tearOffMethod = Foo.multiplyDefault2;
+      expect(tearOffMethod(6, 6), equals(36));
+      expect(tearOffMethod(6), equals(12));
+      Function untypedTearOff = Foo.multiplyDefault2;
+    });
+  });
+
+  group('closure', () {
+    test('call from js', () {
+      localClosure(x) => x * 10;
+      var wrappedLocalClosure = allowInterop(localClosure);
+      expect(
+          identical(allowInterop(localClosure), wrappedLocalClosure), isTrue);
+      expect(foo.callClosureWithArg1(wrappedLocalClosure, 10), equals(100));
+      expect(foo.callClosureWithArg1(wrappedLocalClosure, "a"),
+          equals("aaaaaaaaaa"));
+      expect(foo.callClosureWithArg1(allowInterop(addWithDefault), 10),
+          equals(110));
+      expect(foo.callClosureWithArg2(allowInterop(addWithDefault), 10, 20),
+          equals(30));
+      addThisXAndArg(Foo that, int arg) {
+        return foo.x + arg;
+      }
+
+      var wrappedCaptureThisClosure = allowInteropCaptureThis(addThisXAndArg);
+      foo.x = 20;
+      expect(foo.callClosureWithArgAndThis(wrappedCaptureThisClosure, 10),
+          equals(30));
+      foo.x = 50;
+      expect(foo.callClosureWithArgAndThis(wrappedCaptureThisClosure, 10),
+          equals(60));
+      expect(
+          identical(allowInteropCaptureThis(addThisXAndArg),
+              wrappedCaptureThisClosure),
+          isTrue);
+
+      ExampleLiteral addXValues(that, ExampleLiteral arg) {
+        return new ExampleLiteral(x: that.x + arg.x);
+      }
+
+      // Check to make sure returning a JavaScript value from a Dart closure
+      // works as expected.
+      expect(
+          foo
+              .callClosureWithArg2(allowInterop(addXValues),
+                  new ExampleLiteral(x: 20), new ExampleLiteral(x: 10))
+              .x,
+          equals(30));
+
+      foo.x = 50;
+      expect(
+          foo
+              .callClosureWithArgAndThis(allowInteropCaptureThis(addXValues),
+                  new ExampleLiteral(x: 10))
+              .x,
+          equals(60));
+    });
+
+    test('call from dart', () {
+      var returnNumArgsFn = returnNumArgs;
+      var returnLastArgFn = returnLastArg;
+      expect(returnNumArgsFn(), equals(0));
+      expect(returnNumArgsFn("a", "b", "c"), equals(3));
+      expect(returnNumArgsFn("a", "b", "c", null, null), equals(5));
+      expect(returnNumArgsFn(1, 2, 3, 4, 5, 6, null), equals(7));
+      expect(returnNumArgsFn(1, 2, 3, 4, 5, 6, 7, 8), equals(8));
+      expect(returnLastArgFn(1, 2, "foo"), equals("foo"));
+      expect(returnLastArgFn(1, 2, 3, 4, 5, 6, "foo"), equals("foo"));
+    });
+  });
+
+  group('chain calls', () {
+    test("method calls", () {
+      // In dart2js make sure we still use interceptors when making nested
+      // calls to objects.
+      var bar = foo.getBar().getFoo().getBar().getFoo().getBar();
+      expect(bar.x, equals("foo"));
+    });
+  });
+
+  group('avoid leaks on dart:core', () {
+    test('String', () {
+      var s = confuse('Hello');
+      var stringWrapper = confuse(new StringWrapper('Hello'));
+      // Make sure we don't allow calling JavaScript methods on String.
+      expect(() => s.charCodeAt(0), throws);
+      expect(stringWrapper.charCodeAt(0), equals(72));
     });
   });
 
   group('type check', () {
     test('js interfaces', () {
-      expect(foo is JsObject, isTrue);
-      // Cross-casts are allowed.
+      // Is checks return true for all  JavaScript interfaces.
       expect(foo is Bar, isTrue);
-      expect(selection is JsArray, isTrue);
+      expect(foo is Foob, isTrue);
+
+      expect(selection is List, isTrue);
 
       // We do know at runtime whether something is a JsArray or not.
-      expect(foo is JsArray, isFalse);
+      expect(foo is List, isFalse);
     });
 
     test('dart interfaces', () {
@@ -128,12 +374,4 @@
       expect(selection is List, isTrue);
     });
   });
-
-  group("registration", () {
-    test('repeated fails', () {
-      // The experimental registerJsInterfaces API has already been called so
-      // it cannot be called a second time.
-      expect(() => registerJsInterfaces([Baz]), throws);
-    });
-  });
 }
diff --git a/tests/html/json_helper.dart b/tests/html/json_helper.dart
new file mode 100644
index 0000000..7d037ae
--- /dev/null
+++ b/tests/html/json_helper.dart
@@ -0,0 +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.
+
+@JS("JSON")
+library json_helper;
+
+import 'package:js/js.dart';
+
+external String stringify(object);
diff --git a/tests/html/messageevent_test.dart b/tests/html/messageevent_test.dart
index 9ef3681..86348fd 100644
--- a/tests/html/messageevent_test.dart
+++ b/tests/html/messageevent_test.dart
@@ -17,7 +17,7 @@
       expect(event.origin, equals('origin'));
       // IE allows setting this but just ignores it.
       // expect(event.lastEventId, equals('lastEventId'));
-      expect(event.source, same(window));
+      expect(event.source, window);
       // TODO(antonm): accessing ports is not supported yet.
   });
 }
diff --git a/tests/html/mirrors_js_typed_interop_test.dart b/tests/html/mirrors_js_typed_interop_test.dart
new file mode 100644
index 0000000..a34bf1b
--- /dev/null
+++ b/tests/html/mirrors_js_typed_interop_test.dart
@@ -0,0 +1,48 @@
+// 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 tests.html.mirrors_js_typed_interop_test;
+
+import 'dart:mirrors';
+import 'dart:html';
+
+import 'package:js/js.dart';
+import 'package:unittest/unittest.dart';
+import 'package:unittest/html_config.dart';
+
+_injectJs() {
+  document.body.append(new ScriptElement()
+    ..type = 'text/javascript'
+    ..innerHtml = r"""
+  window.foo = {
+    x: 3,
+    z: 100,
+    multiplyBy2: function(arg) { return arg * 2; },
+  };
+""");
+}
+
+@JS()
+external Foo get foo;
+
+@JS()
+class Foo {
+  external int get x;
+  external set x(v);
+  external num multiplyBy2(num y);
+}
+
+main() {
+  _injectJs();
+
+  useHtmlConfiguration();
+
+  test('dynamic dispatch', () {
+    var f = foo;
+    expect(f.x, 3);
+    // JsInterop methods are not accessible using reflection.
+    expect(() => reflect(f).setField(#x, 123), throws);
+    expect(f.x, 3);
+  });
+}
diff --git a/tests/html/node_validator_important_if_you_suppress_make_the_bug_critical_test.dart b/tests/html/node_validator_important_if_you_suppress_make_the_bug_critical_test.dart
index e5c5622..4d7d338 100644
--- a/tests/html/node_validator_important_if_you_suppress_make_the_bug_critical_test.dart
+++ b/tests/html/node_validator_important_if_you_suppress_make_the_bug_critical_test.dart
@@ -298,7 +298,7 @@
       ..allowElement(
           'a',
           attributes: ['href']);
-  
+
     testHtml('reject different-origin link',
       validator,
         '<a href="http://www.google.com/foo">Google-Foo</a>',
@@ -511,7 +511,7 @@
 
     testHtml('DOM clobbering of attributes with single node',
     validator,
-    "<form onmouseover='alert(1)'><input name='attributes'>",
+    "<form id='single_node_clobbering' onmouseover='alert(1)'><input name='attributes'>",
     "");
 
     testHtml('DOM clobbering of attributes with multiple nodes',
diff --git a/tests/html/resource_data.txt b/tests/html/resource_data.txt
new file mode 100644
index 0000000..37308e5
--- /dev/null
+++ b/tests/html/resource_data.txt
@@ -0,0 +1 @@
+This file was read by a Resource!
\ No newline at end of file
diff --git a/tests/html/resource_http_test.dart b/tests/html/resource_http_test.dart
new file mode 100644
index 0000000..042e8b3
--- /dev/null
+++ b/tests/html/resource_http_test.dart
@@ -0,0 +1,41 @@
+// 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 resource_http_test;
+import 'dart:async';
+import 'package:unittest/html_individual_config.dart';
+import 'package:unittest/unittest.dart';
+
+main() {
+  useHtmlIndividualConfiguration();
+  // Cache blocker is a workaround for:
+  // https://code.google.com/p/dart/issues/detail?id=11834
+  var cacheBlocker = new DateTime.now().millisecondsSinceEpoch;
+  var url = '/root_dart/tests/html/resource_data.txt?cacheBlock=$cacheBlocker';
+
+  void validateResponse(data) {
+    expect(data, equals('This file was read by a Resource!'));
+  }
+
+  group('resource', () {
+    test('readAsString', () async {
+      Resource r = new Resource(url);
+      var data = await r.readAsString();
+      validateResponse(data);
+    });
+    test('readAsBytes', () async {
+      Resource r = new Resource(url);
+      var data = await r.readAsBytes();
+      validateResponse(new String.fromCharCodes(data));
+    });
+    test('openRead', () async {
+      Resource r = new Resource(url);
+      var bytes = [];
+      await for (var b in r.openRead()) {
+        bytes.addAll(b);
+      }
+      validateResponse(new String.fromCharCodes(bytes));
+    });
+  });
+}
diff --git a/tests/html/storage_quota_test.dart b/tests/html/storage_quota_test.dart
deleted file mode 100644
index 54e5346..0000000
--- a/tests/html/storage_quota_test.dart
+++ /dev/null
@@ -1,38 +0,0 @@
-library storage_quota_test;
-
-import 'package:unittest/unittest.dart';
-import 'package:unittest/html_config.dart';
-
-import 'dart:async';
-import 'dart:isolate';
-import 'dart:html';
-
-main() {
-  useHtmlConfiguration();
-
-  expectSaneStorageInfo(StorageInfo storageInfo) {
-     expect(storageInfo.usage, isNotNull);
-     expect(storageInfo.quota, isNotNull);
-     expect(storageInfo.usage >= 0, isTrue);
-     expect(storageInfo.quota >= storageInfo.usage, isNotNull);
-  };
-
-  test('storage quota - temporary', () {
-    Future f = window.navigator.storageQuota.queryInfo('temporary');
-    expect(f.then(expectSaneStorageInfo), completes);
-  });
-
-  test('storage quota - persistent', () {
-    Future f = window.navigator.storageQuota.queryInfo('persistent');
-    expect(f.then(expectSaneStorageInfo), completes);
-  });
-
-  test('storage quota - unknown', () {
-    // Throwing synchronously is bogus upstream behavior; should result in a
-    // smashed promise.
-    expect(() => window.navigator.storageQuota.queryInfo("foo"), throws);  /// missingenumcheck: ok
-    var wrongType = 3;
-    expect(() => window.navigator.storageQuota.queryInfo(wrongType), throws);
-    expect(() => window.navigator.storageQuota.queryInfo(null), throws);
-  });
-}
diff --git a/tests/html/worker_test.dart b/tests/html/worker_test.dart
index dccb8b5..a43887b 100644
--- a/tests/html/worker_test.dart
+++ b/tests/html/worker_test.dart
@@ -50,4 +50,3 @@
     });
   });
 }
-
diff --git a/tests/html/wrapping_collections_test.dart b/tests/html/wrapping_collections_test.dart
new file mode 100644
index 0000000..176bcad
--- /dev/null
+++ b/tests/html/wrapping_collections_test.dart
@@ -0,0 +1,27 @@
+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';
+
+/// Test that if we access objects through JS-interop we get the
+/// appropriate objects, even if dart:html maps them.
+main() {
+  test("Access through JS-interop", () {
+    var performance = js.context['performance'];
+    var entries = performance.callMethod('getEntries', const []);
+    entries.forEach((x) {
+        expect(x is js.JsObject, isTrue);
+    });
+  });
+
+  test("Access through dart:html", () {
+    var dartPerformance = wrap_jso(js.context['performance']);
+    var dartEntries = dartPerformance.getEntries();
+    dartEntries.forEach((x) {
+        expect(x is PerformanceEntry, isTrue);
+    });
+  });
+}
\ No newline at end of file
diff --git a/tests/isolate/isolate.status b/tests/isolate/isolate.status
index 4073b51..95b36d0 100644
--- a/tests/isolate/isolate.status
+++ b/tests/isolate/isolate.status
@@ -18,7 +18,6 @@
 ping_pause_test: Skip     # Resolve test issues
 kill3_test: Pass, Fail    # Bad test: expects total message order
 
-message3_test/byteBuffer: Crash # Issue 21818
 message3_test/int32x4: Crash # Issue 21818
 
 [ $compiler == none && $runtime == ContentShellOnAndroid ]
@@ -45,6 +44,7 @@
 issue_21398_parent_isolate_test: SkipByDesign # Test uses a ".dart" URI.
 issue_21398_parent_isolate1_test: SkipByDesign # Test uses a ".dart" URI.
 issue_21398_parent_isolate2_test: SkipByDesign # Test uses a ".dart" URI.
+issue_24243_parent_isolate_test: SkipByDesign # Test uses a ".dart" URI.
 function_send1_test: SkipByDesign   # Test uses a ".dart" URI.
 error_exit_at_spawnuri_test: SkipByDesign  # Test uses a ".dart" URI.
 error_at_spawnuri_test: SkipByDesign  # Test uses a ".dart" URI.
@@ -135,12 +135,9 @@
 mint_maker_test: StaticWarning
 
 [ $compiler != none || $runtime != vm ]
-package_root_test: SkipByDesign # Uses dart:io.
+package_root_test: SkipByDesign  # Uses Isolate.packageRoot
+package_map_test: SkipByDesign  # Uses Isolate.packageMap
 
 [ $compiler == dart2js && $cps_ir ]
-deferred_in_isolate2_test: Crash # (lib.f()): deferred access is not implemented
+deferred_in_isolate2_test: RuntimeError # A.loadLibrary is not a function
 isolate_current_test: RuntimeError # Please triage this failure.
-message3_test/byteBuffer: RuntimeError # Please triage this failure.
-message3_test/fun: RuntimeError # Please triage this failure.
-message3_test/int32x4: RuntimeError # Please triage this failure.
-message3_test/none: RuntimeError # Please triage this failure.
diff --git a/tests/isolate/issue_24243_child1_isolate.dart b/tests/isolate/issue_24243_child1_isolate.dart
new file mode 100644
index 0000000..950f123
--- /dev/null
+++ b/tests/isolate/issue_24243_child1_isolate.dart
@@ -0,0 +1,18 @@
+// 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';
+
+main(List<String> args, message) {
+  var sendPort = message;
+  try {
+    var list0 = <int>[1, 2, 3];
+    var list1 = <int>[4, 5, 6];
+    var list2 = <int>[7, 8, 9];
+    var list = new List<List<int>>.from([list0, list1, list2]);
+    sendPort.send(list);
+  } catch(error) {
+    sendPort.send("Invalid Argument(s).");
+  }
+}
diff --git a/tests/isolate/issue_24243_child2_isolate.dart b/tests/isolate/issue_24243_child2_isolate.dart
new file mode 100644
index 0000000..0196653
--- /dev/null
+++ b/tests/isolate/issue_24243_child2_isolate.dart
@@ -0,0 +1,18 @@
+// 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';
+
+main(List<String> args, message) {
+  var sendPort = message;
+  try {
+    var map0 = <int, String>{1:'one', 2:'two', 3:'three'};
+    var map1 = <int, String>{4:'four', 5:'five', 6:'six'};
+    var map2 = <int, String>{7:'seven', 8:'eight', 9:'nine'};
+    var map = new Map<int, Map<int, String>>.from({0:map0, 1:map1, 2:map2});
+    sendPort.send(map);
+  } catch(error) {
+    sendPort.send("Invalid Argument(s).");
+  }
+}
diff --git a/tests/isolate/issue_24243_child3_isolate.dart b/tests/isolate/issue_24243_child3_isolate.dart
new file mode 100644
index 0000000..9667a91
--- /dev/null
+++ b/tests/isolate/issue_24243_child3_isolate.dart
@@ -0,0 +1,30 @@
+// 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';
+import 'dart:isolate';
+
+main(List<String> args, message) {
+  var sendPort = message;
+  try {
+    var map0 = new LinkedHashMap<int, String>();
+    map0[1] = 'one';
+    map0[2] = 'two';
+    map0[3] = 'three';
+    var map1 = new LinkedHashMap<int, String>();
+    map1[4] = 'four';
+    map1[5] = 'five';
+    map1[6] = 'size';
+    var map2 = new LinkedHashMap<int, String>();
+    map2[7] = 'seven';
+    map2[8] = 'eight';
+    map2[9] = 'nine';
+
+    var map = new Map<int, LinkedHashMap<int, String>>.from(
+        { 0:map0, 1:map1, 2:map2 });
+    sendPort.send(map);
+  } catch(error) {
+    sendPort.send("Invalid Argument(s).");
+  }
+}
diff --git a/tests/isolate/issue_24243_parent_isolate_test.dart b/tests/isolate/issue_24243_parent_isolate_test.dart
new file mode 100644
index 0000000..b4e20ca
--- /dev/null
+++ b/tests/isolate/issue_24243_parent_isolate_test.dart
@@ -0,0 +1,99 @@
+// 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.
+
+// Note: the following comment is used by test.dart to additionally compile the
+// other isolate's code.
+// OtherScripts=issue_24243_child1_isolate.dart
+// OtherScripts=issue_24243_child2_isolate.dart
+// OtherScripts=issue_24243_child3_isolate.dart
+// VMOptions=--checked
+
+import 'dart:collection';
+import 'dart:isolate';
+
+import "package:expect/expect.dart";
+
+main() {
+  // First spawn an isolate using spawnURI and have it
+  // send back a "literal" like list object.
+  var receive1 = new ReceivePort();
+  Isolate.spawnUri(Uri.parse('issue_24243_child1_isolate.dart'),
+                   [],
+                   receive1.sendPort).then(
+    (isolate) {
+      receive1.listen(
+        (msg) {
+          var list0 = <int>[1, 2, 3];
+          var list1 = <int>[4, 5, 6];
+          var list2 = <int>[7, 8, 9];
+          Expect.isTrue(msg is List<List<int>>);
+          Expect.listEquals(msg[0], list0);
+          Expect.listEquals(msg[1], list1);
+          Expect.listEquals(msg[2], list2);
+          Expect.throws(() => msg[0] = "throw an exception");
+          receive1.close();
+        },
+        onError: (e) => print('$e')
+      );
+    }
+  );
+
+  // Now spawn an isolate using spawnURI and have it
+  // send back a "literal" like map object.
+  var receive2 = new ReceivePort();
+  Isolate.spawnUri(Uri.parse('issue_24243_child2_isolate.dart'),
+                   [],
+                   receive2.sendPort).then(
+    (isolate) {
+      receive2.listen(
+        (msg) {
+          var map0 = <int, String>{1:'one', 2:'two', 3:'three'};
+          var map1 = <int, String>{4:'four', 5:'five', 6:'six'};
+          var map2 = <int, String>{7:'seven', 8:'eight', 9:'nine'};
+          Expect.isTrue(msg is Map<int, Map<int, String>>);
+          Expect.mapEquals(msg[0], map0);
+          Expect.mapEquals(msg[1], map1);
+          Expect.mapEquals(msg[2], map2);
+          Expect.throws(() => msg[0] = "throw an exception");
+          receive2.close();
+        },
+        onError: (e) => print('$e')
+      );
+    }
+  );
+
+  // Now spawn an isolate using spawnURI and have it
+  // send back a "literal" like LinkedHashMap object.
+  var receive3 = new ReceivePort();
+  Isolate.spawnUri(Uri.parse('issue_24243_child3_isolate.dart'),
+                   [],
+                   receive3.sendPort).then(
+    (isolate) {
+      receive3.listen(
+        (msg) {
+          var map0 = new LinkedHashMap<int, String>();
+          map0[1] = 'one';
+          map0[2] = 'two';
+          map0[3] = 'three';
+          var map1 = new LinkedHashMap<int, String>();
+          map1[4] = 'four';
+          map1[5] = 'five';
+          map1[6] = 'size';
+          var map2 = new LinkedHashMap<int, String>();
+          map2[7] = 'seven';
+          map2[8] = 'eight';
+          map2[9] = 'nine';
+          Expect.isTrue(msg is Map<int, LinkedHashMap<int, String>>);
+          Expect.mapEquals(msg[0], map0);
+          Expect.mapEquals(msg[1], map1);
+          Expect.mapEquals(msg[2], map2);
+          Expect.throws(() => msg[0] = "throw an exception");
+          receive3.close();
+        },
+        onError: (e) => print('$e')
+      );
+    }
+  );
+
+}
diff --git a/tests/isolate/nested_spawn2_test.dart b/tests/isolate/nested_spawn2_test.dart
index fbeaeef..faf105d 100644
--- a/tests/isolate/nested_spawn2_test.dart
+++ b/tests/isolate/nested_spawn2_test.dart
@@ -57,7 +57,7 @@
   test("spawned isolate can spawn other isolates", () {
     ReceivePort init = new ReceivePort();
     Isolate.spawn(isolateA, init.sendPort);
-    init.first.then(expectAsync((port) {
+    return init.first.then(expectAsync((port) {
       _call(port, "launch nested!", expectAsync((msg, replyTo) {
         expect(msg[0], "0");
         _call(replyTo, msg1, expectAsync((msg, replyTo) {
diff --git a/tests/isolate/nested_spawn_test.dart b/tests/isolate/nested_spawn_test.dart
index 0dc35a0..083a94a 100644
--- a/tests/isolate/nested_spawn_test.dart
+++ b/tests/isolate/nested_spawn_test.dart
@@ -24,7 +24,7 @@
   test("spawned isolates can spawn nested isolates", () {
     ReceivePort port = new ReceivePort();
     Isolate.spawn(isolateA, [port.sendPort, "main"]);
-    port.first.then((message) {
+    return port.first.then((message) {
       expect("main", message[1]);
       expect("isolateA", message[2]);
       expect("isolateB", message[3]);
diff --git a/tests/isolate/package_root_test.dart b/tests/isolate/package_root_test.dart
deleted file mode 100644
index 2ee6b30..0000000
--- a/tests/isolate/package_root_test.dart
+++ /dev/null
@@ -1,36 +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 'dart:isolate';
-
-final SPAWN_PACKAGE_ROOT = Uri.parse("otherPackageRoot");
-
-void main([args, port]) {
-  if (port != null) {
-    testPackageRoot(args);
-    return;
-  }
-  var p = new ReceivePort();
-  Isolate.spawnUri(Platform.script,
-                   [p.sendPort, Platform.packageRoot],
-                   {},
-                   packageRoot: SPAWN_PACKAGE_ROOT);
-  p.listen((msg) {
-    p.close();
-  });
-}
-
-
-void testPackageRoot(args) {
-  var parentPackageRoot = args[1];
-  if (parentPackageRoot == Platform.packageRoot) {
-    throw "Got parent package root";
-  }
-  if (Uri.parse(Platform.packageRoot) != SPAWN_PACKAGE_ROOT) {
-    throw "Wrong package root";
-  }
-  args[0].send(null);
-}
-
diff --git a/tests/isolate/raw_port_test.dart b/tests/isolate/raw_port_test.dart
index 1da1484..1b88949 100644
--- a/tests/isolate/raw_port_test.dart
+++ b/tests/isolate/raw_port_test.dart
@@ -31,6 +31,12 @@
     });
   });
 
+  test("raw receive hashCode", () {
+    RawReceivePort port = new RawReceivePort();
+    expect(port.hashCode is int, true);
+    port.close();
+  });
+
   test("raw receive twice - change handler", () {
     RawReceivePort port = new RawReceivePort();
     Isolate.spawn(remote2, port.sendPort);
diff --git a/tests/language/assertion_test.dart b/tests/language/assertion_test.dart
index 68bdf04..2f0a12d 100644
--- a/tests/language/assertion_test.dart
+++ b/tests/language/assertion_test.dart
@@ -1,7 +1,7 @@
 // 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.
-// VMOptions=--enable_type_checks
+// VMOptions=--enable_asserts
 //
 // Dart test program testing assert statements.
 
diff --git a/tests/language/async_return_types_test.dart b/tests/language/async_return_types_test.dart
index 83eb9a8..1134e25 100644
--- a/tests/language/async_return_types_test.dart
+++ b/tests/language/async_return_types_test.dart
@@ -40,6 +40,23 @@
   return new Future<int>.value(3);
 }
 
+
+Iterable<int> foo8() sync* {
+  yield 1;
+  // Can only have valueless return in sync* functions.
+  return
+      8 /// return_value_sync_star: compile-time error
+       ;
+}
+
+Stream<int> foo9() async* {
+  yield 1;
+  // Can only have valueless return in async* functions.
+  return
+      8 /// return_value_sync_star: compile-time error
+       ;
+}
+
 test() async {
   Expect.equals(3, await foo1());
   Expect.equals(3, await foo2());
@@ -48,6 +65,8 @@
   Expect.equals(3, await foo5());
   Expect.equals(3, await await foo6());
   Expect.equals(3, await await foo7());
+  Expect.listEquals([1], foo8().toList());
+  Expect.listEquals([1], await foo9().toList());
 }
 
 main() {
diff --git a/tests/language/async_star_regression_fisk_test.dart b/tests/language/async_star_regression_fisk_test.dart
index b05356a9..b46d90f 100644
--- a/tests/language/async_star_regression_fisk_test.dart
+++ b/tests/language/async_star_regression_fisk_test.dart
@@ -34,10 +34,11 @@
   fugl(3).whenComplete(() => fugl(2))
       .whenComplete(() => fugl(1))
       .whenComplete(() {
-    Expect.listEquals(res,
+    Expect.listEquals(
         ["fisk 3", "+fisk", 0, 1, "-fisk", "done",
          "fisk 2", "+fisk", 0, 1, "-fisk", "done",
-         "fisk 1", "+fisk", 0, "done", "-fisk", ]);
+         "fisk 1", "+fisk", 0, "-fisk", "done"],
+        res);
     asyncEnd();
   });
 }
diff --git a/tests/language/await_regression_test.dart b/tests/language/await_regression_test.dart
index 9c3e663..90a562d 100644
--- a/tests/language/await_regression_test.dart
+++ b/tests/language/await_regression_test.dart
@@ -30,7 +30,19 @@
   Expect.equals(sum, 0);
 }
 
+testSideEffects() async {
+  Future foo(int a1, int a2) {
+    Expect.equals(10, a1);
+    Expect.equals(11, a2);
+    return new Future.value();
+  }
+  int a = 10;
+  await foo(a++, a++);
+  Expect.equals(12, a);
+}
+
 main() async {
   testNestedFunctions();
   testNamedArguments();
+  testSideEffects();
 }
diff --git a/tests/language/bit_shift_test.dart b/tests/language/bit_shift_test.dart
index 3032736..8493936 100644
--- a/tests/language/bit_shift_test.dart
+++ b/tests/language/bit_shift_test.dart
@@ -1,12 +1,15 @@
 // Copyright (c) 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.
+// VMOptions=--optimization-counter-threshold=10
 
 import "package:expect/expect.dart";
 
 constants() {
   Expect.equals(0, 499 >> 33);
   Expect.equals(0, (499 << 33) & 0xFFFFFFFF);
+  Expect.equals(0, (499 << 32) >> 65);
+  Expect.equals(0, ((499 << 32) << 65) & 0xFFFFFFFFFFFFFFFF);
 }
 
 foo(i) {
@@ -29,20 +32,27 @@
 interceptors() {
   Expect.equals(0, id(499) >> 33);
   Expect.equals(0, (id(499) << 33) & 0xFFFFFFFF);
+  Expect.equals(0, id(499 << 32) >> 65);
+  Expect.equals(0, (id(499 << 32) << 65) & 0xFFFFFFFFFFFFFFFF);
 }
 
 speculative() {
   var a = id(499);
+  var b = id(499 << 32);
   for (int i = 0; i < 1; i++) {
     Expect.equals(0, a >> 33);
     Expect.equals(0, (a << 33) & 0xFFFFFFFF);
+    Expect.equals(0, b >> 65);
+    Expect.equals(0, (b << 65) & 0xFFFFFFFFFFFFFFFF);
   }
 }
 
 // JavaScript shifts by the amount modulo 32. That is x << y is equivalent to
 // x << (y & 0x1F). Dart does not.
 main() {
-  constants();
-  interceptors();
-  speculative();
+  for (var i = 0; i < 10; ++i) {
+    constants();
+    interceptors();
+    speculative();
+  }
 }
diff --git a/tests/language/deferred_super_dependency_lib.dart b/tests/language/deferred_super_dependency_lib.dart
new file mode 100644
index 0000000..a592dab
--- /dev/null
+++ b/tests/language/deferred_super_dependency_lib.dart
@@ -0,0 +1,12 @@
+// 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.
+
+class A {
+}
+
+class C extends A {
+  foo() {
+    super.foo = 3;
+  }
+}
\ No newline at end of file
diff --git a/tests/language/deferred_super_dependency_test.dart b/tests/language/deferred_super_dependency_test.dart
new file mode 100644
index 0000000..d2f801f
--- /dev/null
+++ b/tests/language/deferred_super_dependency_test.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.
+
+// Regression test.
+// lib.C.foo has code that references `super.foo=` that does not exist. This
+// used to cause a crash.
+
+import "package:expect/expect.dart";
+import "deferred_super_dependency_lib.dart" deferred as lib; /// 01: static type warning
+
+main() async {
+  await lib.loadLibrary(); /// 01: continued
+  Expect.throws(() => new lib.C().foo(), (e) => e is NoSuchMethodError); /// 01: continued
+}
\ No newline at end of file
diff --git a/tests/language/inheritance_chain_lib.dart b/tests/language/inheritance_chain_lib.dart
new file mode 100644
index 0000000..1a8ef51
--- /dev/null
+++ b/tests/language/inheritance_chain_lib.dart
@@ -0,0 +1,25 @@
+// 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 "inheritance_chain_test.dart";
+
+class B extends C {
+  get id => "B";
+  get length => 2;
+}
+
+class D extends Z {
+  get id => "D";
+  get length => 4;
+}
+
+class W {
+  get id => "W";
+  get length => -4;
+}
+
+class Y extends X {
+  get id => "Y";
+  get length => -2;
+}
\ No newline at end of file
diff --git a/tests/language/inheritance_chain_test.dart b/tests/language/inheritance_chain_test.dart
new file mode 100644
index 0000000..ef60152
--- /dev/null
+++ b/tests/language/inheritance_chain_test.dart
@@ -0,0 +1,103 @@
+// 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 "package:expect/expect.dart";
+import "inheritance_chain_lib.dart";
+
+class A extends B {
+  get id => "A";
+  get length => 1;
+}
+
+class C extends  D {
+  get id => "C";
+  get length => 3;
+}
+
+class X extends W {
+  get id => "X";
+  get length => -3;
+}
+
+class Z extends Y {
+  get id => "Z";
+  get length => -1;
+}
+
+main() {
+  var instances = [
+    new A(),
+    new B(),
+    new C(),
+    new D(),
+    new W(),
+    new X(),
+    new Y(),
+    new Z(),
+    [],
+  ];
+
+  var o = instances[0];
+  Expect.equals("A", o.id);
+  Expect.equals(1, o.length);
+  Expect.isTrue(o is A);
+  Expect.isTrue(o is B);
+  Expect.isTrue(o is C);
+  Expect.isTrue(o is D);
+  Expect.isTrue(o is W);
+  Expect.isTrue(o is X);
+  Expect.isTrue(o is Y);
+  Expect.isTrue(o is Z);
+  o = instances[1];
+  Expect.equals("B", o.id);
+  Expect.equals(2, o.length);
+  Expect.isTrue(o is B);
+  Expect.isTrue(o is C);
+  Expect.isTrue(o is D);
+  Expect.isTrue(o is W);
+  Expect.isTrue(o is X);
+  Expect.isTrue(o is Y);
+  Expect.isTrue(o is Z);
+  o = instances[2];
+  Expect.equals("C", o.id);
+  Expect.equals(3, o.length);
+  Expect.isTrue(o is C);
+  Expect.isTrue(o is D);
+  Expect.isTrue(o is W);
+  Expect.isTrue(o is X);
+  Expect.isTrue(o is Y);
+  Expect.isTrue(o is Z);
+  o = instances[3];
+  Expect.equals("D", o.id);
+  Expect.equals(4, o.length);
+  Expect.isTrue(o is D);
+  Expect.isTrue(o is W);
+  Expect.isTrue(o is X);
+  Expect.isTrue(o is Y);
+  Expect.isTrue(o is Z);
+  o = instances[4];
+  Expect.equals("W", o.id);
+  Expect.equals(-4, o.length);
+  Expect.isTrue(o is W);
+  o = instances[5];
+  Expect.equals("X", o.id);
+  Expect.equals(-3, o.length);
+  Expect.isTrue(o is X);
+  Expect.isTrue(o is W);
+  o = instances[6];
+  Expect.equals("Y", o.id);
+  Expect.equals(-2, o.length);
+  Expect.isTrue(o is Y);
+  Expect.isTrue(o is X);
+  Expect.isTrue(o is W);
+  o = instances[7];
+  Expect.equals("Z", o.id);
+  Expect.equals(-1, o.length);
+  Expect.isTrue(o is Z);
+  Expect.isTrue(o is Y);
+  Expect.isTrue(o is X);
+  Expect.isTrue(o is W);
+  o = instances[8];
+  Expect.equals(0, o.length);
+}
\ No newline at end of file
diff --git a/tests/language/invocation_mirror_empty_arguments_test.dart b/tests/language/invocation_mirror_empty_arguments_test.dart
new file mode 100644
index 0000000..8212536
--- /dev/null
+++ b/tests/language/invocation_mirror_empty_arguments_test.dart
@@ -0,0 +1,46 @@
+// 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 "package:expect/expect.dart";
+
+class Getter {
+  noSuchMethod(invocation) {
+    Expect.isTrue(invocation.isGetter);
+    Expect.identical(const [], invocation.positionalArguments);
+    Expect.identical(const {}, invocation.namedArguments);
+  }
+}
+
+class Setter {
+  noSuchMethod(invocation) {
+    Expect.isTrue(invocation.isSetter);
+    Expect.identical(const {}, invocation.namedArguments);
+  }
+}
+
+class Method {
+  noSuchMethod(invocation) {
+    Expect.isTrue(invocation.isMethod);
+    Expect.identical(const [], invocation.positionalArguments);
+    Expect.identical(const {}, invocation.namedArguments);
+  }
+}
+
+class Operator {
+  noSuchMethod(invocation) {
+    Expect.isTrue(invocation.isMethod);
+    Expect.identical(const {}, invocation.namedArguments);
+  }
+}
+
+main() {
+  var g = new Getter();
+  print(g.getterThatDoesNotExist);
+  var s = new Setter();
+  print(s.setterThatDoesNotExist = 42);
+  var m = new Method();
+  print(m.methodThatDoesNotExist());
+  var o = new Operator();
+  print(o + 42); // Operator that does not exist.
+}
diff --git a/tests/language/language.status b/tests/language/language.status
index ce9ff2e..28dedba 100644
--- a/tests/language/language.status
+++ b/tests/language/language.status
@@ -30,7 +30,6 @@
 async_star_regression_2238_test: CompileTimeError, RuntimeError # drt only runtime-errs.
 async_star_cancel_while_paused_test: RuntimeError
 async_star_await_pauses_test: Skip # Times out. Issue 23996
-async_star_regression_fisk_test: RuntimeError # Issue 23994
 
 [ $compiler == none && $runtime == vm ]
 class_keyword_test/02: MissingCompileTimeError # Issue 13627
@@ -74,6 +73,9 @@
 mirror_in_static_init_test: Fail # Issue 22071
 vm/debug_break_enabled_vm_test/*: Skip # Issue 14651.
 
+[ $compiler == none && $runtime == dartium && $system == linux && $arch != x64 ]
+issue_22780_test/01 : Pass, Timeout # Issue 24473
+
 [ $compiler == none && $runtime == drt ]
 disassemble_test: Pass, Fail # Issue 18122
 
@@ -95,6 +97,7 @@
 vm/load_to_load_unaligned_forwarding_vm_test: Pass, Crash # Unaligned offset. Issue 22151
 
 [ $compiler == none && ( $runtime == dartium || $runtime == drt ) ]
-mixin_super_test: Fail # Can't pass VMOptions to dartium.
-mixin_super_bound2_test: Fail # Can't pass VMOptions to dartium.
 issue23244_test: Fail # Can't run spawnFunction on dartium.
+
+[ $compiler == none && ($runtime == vm || $runtime == drt || $runtime == dartium) && $arch == ia32 ]
+vm/regress_24517_test: Pass, Fail # Issue 24517.
diff --git a/tests/language/language_analyzer.status b/tests/language/language_analyzer.status
index bb3cf05..a5f91bf 100644
--- a/tests/language/language_analyzer.status
+++ b/tests/language/language_analyzer.status
@@ -362,6 +362,9 @@
 mixin_super_bound_test: StaticWarning # legitimate StaticWarning, cannot be annotated
 mixin_super_bound2_test: CompileTimeError # Issue 23772
 mixin_super_test: CompileTimeError # Issue 23772
+mixin_super_2_test: CompileTimeError # Issue 23772
+mixin_super_use_test: CompileTimeError # Issue 23772
+mixin_superclass_test: CompileTimeError # Issue 23772
 named_constructor_test/01: StaticWarning
 named_constructor_test/03: StaticWarning
 named_parameters2_test: StaticWarning
diff --git a/tests/language/language_analyzer2.status b/tests/language/language_analyzer2.status
index a539fa1..a51dda3 100644
--- a/tests/language/language_analyzer2.status
+++ b/tests/language/language_analyzer2.status
@@ -7,9 +7,6 @@
 # Runtime negative test. No static errors or warnings.
 closure_call_wrong_argument_count_negative_test: skip
 
-enum_syntax_test/02: Fail # 21649
-enum_syntax_test/03: Fail # 21649
-enum_syntax_test/04: Fail # 21649
 enum_syntax_test/05: Fail # 21649
 enum_syntax_test/06: Fail # 21649
 
@@ -180,11 +177,6 @@
 factory_redirection_test/14: StaticWarning # Issue 18230
 factory_redirection_test/none: StaticWarning # Issue 18230
 
-# analyzer does not handle @proxy and noSuchMethod correctly
-override_inheritance_no_such_method_test/03: StaticWarning # Issue 16132
-override_inheritance_no_such_method_test/04: StaticWarning # Issue 16132
-override_inheritance_no_such_method_test/05: StaticWarning # Issue 16132
-
 # The following tests are currently assumed to be failing because the test is wrong.
 #
 application_negative_test: CompileTimeError # Test Issue 14528
@@ -306,8 +298,11 @@
 mixin_invalid_bound_test/none: StaticWarning # legitimate StaticWarning, cannot be annotated
 mixin_invalid_bound2_test/none: StaticWarning # legitimate StaticWarning, cannot be annotated
 mixin_super_bound_test: StaticWarning # legitimate StaticWarning, cannot be annotated
-mixin_super_bound2_test: CompileTimeError # Issue 23772
-mixin_super_test: CompileTimeError # Issue 23772
+mixin_super_bound2_test: CompileTimeError # Issue 24478
+mixin_super_test: CompileTimeError # Issue 24478
+mixin_super_2_test: CompileTimeError # Issue 24478
+mixin_super_use_test: CompileTimeError # Issue 24478
+mixin_superclass_test: CompileTimeError # Issue 24478
 named_constructor_test/01: StaticWarning
 named_constructor_test/03: StaticWarning
 named_parameters2_test: StaticWarning
@@ -393,14 +388,12 @@
 string_interpolate1_negative_test: CompileTimeError
 string_interpolate2_negative_test: CompileTimeError
 string_interpolate_test: StaticWarning
-string_interpolation_and_buffer_test: StaticWarning
 string_interpolation1_negative_test: CompileTimeError
 string_interpolation2_negative_test: CompileTimeError
 string_interpolation3_negative_test: CompileTimeError
 string_interpolation4_negative_test: CompileTimeError
 string_interpolation5_negative_test: CompileTimeError
 string_interpolation6_negative_test: CompileTimeError
-string_split_test: StaticWarning
 string_test: StaticWarning
 string_unicode1_negative_test: CompileTimeError
 string_unicode2_negative_test: CompileTimeError
@@ -423,7 +416,8 @@
 switch7_negative_test: CompileTimeError
 switch_fallthru_test: StaticWarning
 test_negative_test: CompileTimeError
-top_level_non_prefixed_library_test: StaticWarning
+# Note: test is in error but analyzer doesn't notice due to bug #24502
+# top_level_non_prefixed_library_test: StaticWarning
 try_catch4_test: StaticWarning
 try_catch5_test: StaticWarning
 type_argument_in_super_type_test: StaticWarning
diff --git a/tests/language/language_dart2js.status b/tests/language/language_dart2js.status
index 0d39999..a0c0638 100644
--- a/tests/language/language_dart2js.status
+++ b/tests/language/language_dart2js.status
@@ -18,67 +18,12 @@
 
 call_function_apply_test: RuntimeError # Issue 23873
 
-conditional_method_invocation_test/12: Fail # Issue 23795
-conditional_method_invocation_test/13: Fail # Issue 23795
-conditional_method_invocation_test/14: Fail # Issue 23795
-conditional_method_invocation_test/15: Fail # Issue 23795
-conditional_method_invocation_test/16: Fail # Issue 23795
-conditional_method_invocation_test/17: Fail # Issue 23795
-conditional_method_invocation_test/18: Fail # Issue 23795
-conditional_method_invocation_test/19: Fail # Issue 23795
-conditional_property_access_test/10: Fail # Issue 23795
-conditional_property_access_test/11: Fail # Issue 23795
-conditional_property_access_test/12: Fail # Issue 23795
-conditional_property_access_test/13: Fail # Issue 23795
-conditional_property_access_test/14: Fail # Issue 23795
-conditional_property_access_test/15: Fail # Issue 23795
-conditional_property_access_test/16: Fail # Issue 23795
-conditional_property_access_test/17: Fail # Issue 23795
-conditional_property_assignment_test/23: Fail # Issue 23795
-conditional_property_assignment_test/24: Fail # Issue 23795
-conditional_property_assignment_test/25: Fail # Issue 23795
-conditional_property_assignment_test/26: Fail # Issue 23795
-conditional_property_assignment_test/27: Fail # Issue 23795
-conditional_property_assignment_test/28: Fail # Issue 23795
-conditional_property_assignment_test/29: Fail # Issue 23795
-conditional_property_assignment_test/30: Fail # Issue 23795
-conditional_property_assignment_test/31: Fail # Issue 23795
-conditional_property_assignment_test/32: Fail # Issue 23795
-conditional_property_assignment_test/33: Fail # Issue 23795
-conditional_property_assignment_test/34: Fail # Issue 23795
-conditional_property_assignment_test/35: Fail # Issue 23795
-conditional_property_increment_decrement_test/17: Fail # Issue 23795
-conditional_property_increment_decrement_test/18: Fail # Issue 23795
-conditional_property_increment_decrement_test/19: Fail # Issue 23795
-conditional_property_increment_decrement_test/20: Fail # Issue 23795
-conditional_property_increment_decrement_test/21: Fail # Issue 23795
-conditional_property_increment_decrement_test/22: Fail # Issue 23795
-conditional_property_increment_decrement_test/23: Fail # Issue 23795
-conditional_property_increment_decrement_test/24: Fail # Issue 23795
-conditional_property_increment_decrement_test/25: Fail # Issue 23795
-conditional_property_increment_decrement_test/26: Fail # Issue 23795
-conditional_property_increment_decrement_test/27: Fail # Issue 23795
-conditional_property_increment_decrement_test/28: Fail # Issue 23795
-conditional_property_increment_decrement_test/29: Fail # Issue 23795
-conditional_property_increment_decrement_test/30: Fail # Issue 23795
-conditional_property_increment_decrement_test/31: Fail # Issue 23795
-conditional_property_increment_decrement_test/32: Fail # Issue 23795
-conditional_property_increment_decrement_test/33: Fail # Issue 23795
-conditional_property_increment_decrement_test/34: Fail # Issue 23795
-conditional_property_increment_decrement_test/35: Fail # Issue 23795
-conditional_property_increment_decrement_test/36: Fail # Issue 23795
-conditional_property_increment_decrement_test/37: Fail # Issue 23795
-conditional_property_increment_decrement_test/38: Fail # Issue 23795
-conditional_property_increment_decrement_test/39: Fail # Issue 23795
-conditional_property_increment_decrement_test/40: Fail # Issue 23795
-if_null_assignment_behavior_test/31: Fail # Issue 23795
-if_null_assignment_behavior_test/32: Fail # Issue 23795
-
 [ $compiler == dart2js && $runtime == jsshell ]
 await_for_test: Skip # Jsshell does not provide periodic timers, Issue 7728
 async_star_test: RuntimeError # Jsshell does not provide non-zero timers, Issue 7728
 
 [ $compiler == dart2js ]
+invocation_mirror_empty_arguments_test: Fail # Issue 24331
 nan_identical_test: Fail # Issue 11551
 symbol_literal_test/*: Fail # Issue 21825
 constructor_duplicate_final_test/01: Fail # Issue 13363
@@ -92,7 +37,6 @@
 stacktrace_test: Pass, RuntimeError # # Issue 12698
 stacktrace_rethrow_nonerror_test: Pass, RuntimeError # Issue 12698
 stacktrace_rethrow_error_test: Pass, RuntimeError # Issue 12698
-instantiate_type_variable_test/01: CompileTimeError # Issue 13631
 type_variable_conflict_test/01: Fail # Issue 13702
 type_variable_conflict_test/02: Fail # Issue 13702
 type_variable_conflict_test/03: Fail # Issue 13702
@@ -105,7 +49,10 @@
 mixin_super_constructor_named_test/01: Fail # Issue 15101
 mixin_super_constructor_positionals_test/01: Fail # Issue 15101
 mixin_super_test: CompileTimeError # Issue 23773
+mixin_super_2_test: CompileTimeError # Issue 23773
 mixin_super_bound2_test: CompileTimeError # Issue 23773
+mixin_super_use_test: CompileTimeError # Issue 23773
+mixin_superclass_test: CompileTimeError # Issue 23773
 
 ref_before_declaration_test/00: MissingCompileTimeError
 ref_before_declaration_test/01: MissingCompileTimeError
@@ -159,22 +106,6 @@
 malbounded_type_test2_test: Fail # Issue 14121
 default_factory2_test/01: Fail # Issue 14121
 
-[ $compiler == dart2js && $checked ]
-compile_time_constant_checked5_test/06: Fail # Issue 23182
-compile_time_constant_checked5_test/07: Fail # Issue 23182
-compile_time_constant_checked5_test/10: Fail # Issue 23182
-compile_time_constant_checked5_test/11: Fail # Issue 23182
-compile_time_constant_checked5_test/12: Fail # Issue 23182
-compile_time_constant_checked5_test/15: Fail # Issue 23182
-compile_time_constant_checked5_test/16: Fail # Issue 23182
-compile_time_constant_checked5_test/17: Fail # Issue 23182
-compile_time_constant_checked5_test/20: Fail # Issue 23182
-compile_time_constant_checked5_test/21: Fail # Issue 23182
-compile_time_constant_checked5_test/22: Fail # Issue 23182
-compile_time_constant_checked5_test/23: Fail # Issue 23182
-compile_time_constant_checked5_test/24: Fail # Issue 23182
-compile_time_constant_checked5_test/25: Fail # Issue 23182
-
 [ $compiler == dart2js && $unchecked ]
 type_checks_in_factory_method_test: RuntimeError # Issue 12746
 assertion_test: RuntimeError # Issue 12748
@@ -218,12 +149,10 @@
 integer_division_by_zero_test: RuntimeError # Issue 8301
 built_in_identifier_prefix_test: CompileTimeError # Issue 6972
 number_identity2_test: RuntimeError # Issue 12596
-new_expression_type_args_test/00: CompileTimeError # Issue 5519
-new_expression_type_args_test/01: CompileTimeError # Issue 5519
 double_int_to_string_test: RuntimeError # Issue 1533
 mint_arithmetic_test: RuntimeError # Issue 1533
 left_shift_test: RuntimeError # Issue 1533
-factory_redirection_test/01: CompileTimeError # Issue 12752
+regress_24283_test: RuntimeError # Issue 1533
 bad_override_test/01: CompileTimeError # Issue 11496
 bad_override_test/02: CompileTimeError # Issue 11496
 constructor_named_arguments_test/01: CompileTimeError # Issue 5519
@@ -246,6 +175,8 @@
 const_dynamic_type_literal_test/02: CompileTimeError # Issue 23009
 const_dynamic_type_literal_test/03: CompileTimeError # Issue 23009
 
+generic_field_mixin4_test: Crash # Issue 18651
+
 # Compilation errors.
 method_override5_test: RuntimeError # Issue 12809
 external_test/10: CompileTimeError # Issue 12887
@@ -296,191 +227,117 @@
 regress_22443_test: Pass,RuntimeError # Issue 17458
 
 [ $compiler == dart2js && $cps_ir == false ]
-generic_field_mixin4_test: Crash # Issue 18651
 generic_field_mixin5_test: Crash # Issue 18651
 many_method_calls_test: Crash # Stack overflow in HGraphVisitor.visitPostDominatorTree.visitBasicBlockAndSuccessors
 
+[ $compiler == dart2js && ($runtime == d8 || $runtime == jsshell) ]
+issue23244_test: RuntimeError # 23244
+
 [ $compiler == dart2js && $cps_ir ]
-async_and_or_test: Crash # (test()async{await test1();await test2();}): cannot handle async/sync*/async* functions
-async_await_catch_regression_test: Crash # (test()async{var exc...  cannot handle async/sync*/async* functions
-async_await_syntax_test/a01a: Crash # (a01a()async=>null;): cannot handle async/sync*/async* functions
-async_await_syntax_test/a02a: Crash # (a02a()async{}): cannot handle async/sync*/async* functions
-async_await_syntax_test/a03a: Crash # (a03a()async*{}): cannot handle async/sync*/async* functions
-async_await_syntax_test/a03b: Crash # (a03b()async*{}): cannot handle async/sync*/async* functions
-async_await_syntax_test/a04a: Crash # (a04a()sync*{}): cannot handle async/sync*/async* functions
-async_await_syntax_test/a04c: Crash # (a04c()sync*{}): cannot handle async/sync*/async* functions
-async_await_syntax_test/a05a: Crash # (a05a()async{await 0;}): cannot handle async/sync*/async* functions
-async_await_syntax_test/a05b: Crash # (a05b()async{await (a){};await (0);}): cannot handle async/sync*/async* functions
-async_await_syntax_test/a05h: Crash # (a05h()async{yield*st;}): cannot handle async/sync*/async* functions
-async_await_syntax_test/a06a: Crash # (a06a()async{await for(var o in st){}}): cannot handle async/sync*/async* functions
-async_await_syntax_test/a07a: Crash # (a07a()sync*{yield 0;}): cannot handle async/sync*/async* functions
-async_await_syntax_test/a08a: Crash # (a08a()sync*{yield* [] ;}): cannot handle async/sync*/async* functions
-async_await_syntax_test/a09a: Crash # (a09a()async*{yield 0;}): cannot handle async/sync*/async* functions
-async_await_syntax_test/a10a: Crash # (a10a()async*{yield* [] ;}): cannot handle async/sync*/async* functions
-async_await_syntax_test/a11b: Crash # (get sync sync*{}): cannot handle async/sync*/async* functions
-async_await_syntax_test/a11c: Crash # (get async async{}): cannot handle async/sync*/async* functions
-async_await_syntax_test/a11d: Crash # (get async async*{}): cannot handle async/sync*/async* functions
-async_await_syntax_test/a12g: Crash # (get a12g async=>null;): cannot handle async/sync*/async* functions
-async_await_syntax_test/b01a: Crash # (b01a()async=>null;): cannot handle async/sync*/async* functions
-async_await_syntax_test/b02a: Crash # (b02a()async{}): cannot handle async/sync*/async* functions
-async_await_syntax_test/b03a: Crash # (b03a()async*{}): cannot handle async/sync*/async* functions
-async_await_syntax_test/b04a: Crash # (b04a()sync*{}): cannot handle async/sync*/async* functions
-async_await_syntax_test/b05a: Crash # (b05a()async{await 0;}): cannot handle async/sync*/async* functions
-async_await_syntax_test/b06a: Crash # (b06a()async{await for(var o in st){}}): cannot handle async/sync*/async* functions
-async_await_syntax_test/b07a: Crash # (b07a()sync*{yield 0;}): cannot handle async/sync*/async* functions
-async_await_syntax_test/b08a: Crash # (b08a()sync*{yield* [] ;}): cannot handle async/sync*/async* functions
-async_await_syntax_test/b09a: Crash # (b09a()async*{yield 0;}): cannot handle async/sync*/async* functions
-async_await_syntax_test/b10a: Crash # (b10a()async*{yield* [] ;}): cannot handle async/sync*/async* functions
-async_await_syntax_test/b11b: Crash # (get sync sync*{}): cannot handle async/sync*/async* functions
-async_await_syntax_test/b11c: Crash # (get async async{}): cannot handle async/sync*/async* functions
-async_await_syntax_test/b11d: Crash # (get async async*{}): cannot handle async/sync*/async* functions
-async_await_syntax_test/b12g: Crash # (get b12g async=>null;): cannot handle async/sync*/async* functions
-async_await_syntax_test/c01a: Crash # (c01a()async=>null;): cannot handle async/sync*/async* functions
-async_await_syntax_test/c02a: Crash # (c02a()async{}): cannot handle async/sync*/async* functions
-async_await_syntax_test/c03a: Crash # (c03a()async*{}): cannot handle async/sync*/async* functions
-async_await_syntax_test/c04a: Crash # (c04a()sync*{}): cannot handle async/sync*/async* functions
-async_await_syntax_test/c05a: Crash # (c05a()async{await 0;}): cannot handle async/sync*/async* functions
-async_await_syntax_test/c06a: Crash # (c06a()async{await for(var o in st){}}): cannot handle async/sync*/async* functions
-async_await_syntax_test/c07a: Crash # (c07a()sync*{yield 0;}): cannot handle async/sync*/async* functions
-async_await_syntax_test/c08a: Crash # (c08a()sync*{yield* [] ;}): cannot handle async/sync*/async* functions
-async_await_syntax_test/c09a: Crash # (c09a()async*{yield 0;}): cannot handle async/sync*/async* functions
-async_await_syntax_test/c10a: Crash # (c10a()async*{yield* [] ;}): cannot handle async/sync*/async* functions
-async_await_syntax_test/c11a: Crash # (c11a()async{yield-5;}): cannot handle async/sync*/async* functions
-async_await_syntax_test/c11b: Crash # (c11b()async{yield*st;}): cannot handle async/sync*/async* functions
-async_await_syntax_test/d01a: Crash # (()async=>null): cannot handle async/sync*/async* functions
-async_await_syntax_test/d02a: Crash # (()async{}): cannot handle async/sync*/async* functions
-async_await_syntax_test/d03a: Crash # (()async*{}): cannot handle async/sync*/async* functions
-async_await_syntax_test/d04a: Crash # (()sync*{}): cannot handle async/sync*/async* functions
-async_await_syntax_test/d05a: Crash # (()async{await 0;}): cannot handle async/sync*/async* functions
-async_await_syntax_test/d06a: Crash # (()async{await for(var o in st){}}): cannot handle async/sync*/async* functions
-async_await_syntax_test/d07a: Crash # (()sync*{yield 0;}): cannot handle async/sync*/async* functions
-async_await_syntax_test/d08a: Crash # (()sync*{yield* [] ;}): cannot handle async/sync*/async* functions
-async_await_syntax_test/d08b: Crash # (()sync*{yield* 0+1;}): cannot handle async/sync*/async* functions
-async_await_syntax_test/d09a: Crash # (()async*{yield 0;}): cannot handle async/sync*/async* functions
-async_await_syntax_test/d10a: Crash # (()async*{yield* [] ;}): cannot handle async/sync*/async* functions
-async_await_test/02: Crash # (f()async{return id(42);}): cannot handle async/sync*/async* functions
-async_await_test/03: Crash # (f()async{return id(42);}): cannot handle async/sync*/async* functions
-async_await_test/none: Crash # (f()async{return id(42);}): cannot handle async/sync*/async* functions
-async_break_in_finally_test: Crash # (test()async{Expect....  cannot handle async/sync*/async* functions
-async_continue_label_test/await_in_body: Crash # (test()async{await t...  cannot handle async/sync*/async* functions
-async_continue_label_test/await_in_condition: Crash # (test()async{await t...  cannot handle async/sync*/async* functions
-async_continue_label_test/await_in_init: Crash # (test()async{await t...  cannot handle async/sync*/async* functions
-async_continue_label_test/await_in_update: Crash # (test()async{await t...  cannot handle async/sync*/async* functions
-async_continue_label_test/none: Crash # (test()async{await t...  cannot handle async/sync*/async* functions
-async_control_structures_test: Crash # (asyncImplicitReturn...  cannot handle async/sync*/async* functions
-async_finally_rethrow_test: Crash # (main()async{var err...  cannot handle async/sync*/async* functions
-async_or_generator_return_type_stacktrace_test/01: Crash # (void badReturnTypeAsync()async{}): cannot handle async/sync*/async* functions
-async_or_generator_return_type_stacktrace_test/02: Crash # (void badReturnTypeAsyncStar()async*{}): cannot handle async/sync*/async* functions
-async_or_generator_return_type_stacktrace_test/03: Crash # (void badReturnTypeSyncStar()sync*{}): cannot handle async/sync*/async* functions
-async_regression_23058_test: Crash # (foo()async{return x.foo==2?42:x.foo;}): cannot handle async/sync*/async* functions
-async_rethrow_test: Crash # (rethrowString()asyn...  cannot handle async/sync*/async* functions
-async_return_types_test/nestedFuture: Crash # (test()async{Expect....  cannot handle async/sync*/async* functions
-async_return_types_test/none: Crash # (test()async{Expect....  cannot handle async/sync*/async* functions
-async_return_types_test/tooManyTypeParameters: Crash # (test()async{Expect....  cannot handle async/sync*/async* functions
-async_return_types_test/wrongReturnType: Crash # (test()async{Expect....  cannot handle async/sync*/async* functions
-async_return_types_test/wrongTypeParameter: Crash # (test()async{Expect....  cannot handle async/sync*/async* functions
-async_star_cancel_and_throw_in_finally_test: Crash # (test()async{var com...  cannot handle async/sync*/async* functions
-async_star_regression_23116_test: Crash # (test()async{Complet...  cannot handle async/sync*/async* functions
-async_star_regression_2238_test: Crash # (f()async*{}): cannot handle async/sync*/async* functions
-async_star_cancel_while_paused_test: Crash # (f()async*{}): cannot handle async/sync*/async* functions
-async_star_stream_take_test: Crash # (f()async*{}): cannot handle async/sync*/async* functions
-async_star_take_reyield_test: Crash # (f()async*{}): cannot handle async/sync*/async* functions
-async_star_await_pauses_test: Crash # (f()async*{}): cannot handle async/sync*/async* functions
-async_star_test: Crash # (f()async*{}): cannot handle async/sync*/async* functions
-async_switch_test/none: Crash # (test()async{Expect....  cannot handle async/sync*/async* functions
-async_switch_test/withDefault: Crash # (test()async{Expect....  cannot handle async/sync*/async* functions
-async_test/none: Crash # (bar(int p1,p2)async{var z=8;return p2+z+foo;}): cannot handle async/sync*/async* functions
-async_test/type-mismatch1: Crash # (bar(int p1,p2)async{var z=8;return p2+z+foo;}): cannot handle async/sync*/async* functions
-async_test/type-mismatch2: Crash # (bar(int p1,p2)async{var z=8;return p2+z+foo;}): cannot handle async/sync*/async* functions
-async_test/type-mismatch3: Crash # (bar(int p1,p2)async{var z=8;return p2+z+foo;}): cannot handle async/sync*/async* functions
-async_test/type-mismatch4: Crash # (bar(int p1,p2)async{var z=8;return p2+z+foo;}): cannot handle async/sync*/async* functions
-async_this_bound_test: Crash # (test()async{await testA();await testB();}): cannot handle async/sync*/async* functions
-async_throw_in_catch_test/forceAwait: Crash # (test()async{await r...  cannot handle async/sync*/async* functions
-async_throw_in_catch_test/none: Crash # (test()async{await r...  cannot handle async/sync*/async* functions
-asyncstar_concat_test: Crash # (test()async{Expect....  cannot handle async/sync*/async* functions
-asyncstar_throw_in_catch_test: Crash # (test()async{await r...  cannot handle async/sync*/async* functions
-asyncstar_yield_test: Crash # (test()async{Expect....  cannot handle async/sync*/async* functions
-asyncstar_yieldstar_test: Crash # (test()async{Expect....  cannot handle async/sync*/async* functions
-await_backwards_compatibility_test/none: Crash # (test1()async{var x=await 9;Expect.equals(9,x);}): cannot handle async/sync*/async* functions
-await_exceptions_test: Crash # (awaitFoo()async{await foo();}): cannot handle async/sync*/async* functions
-await_for_cancel_test: Crash # (test()async{await test1();await test2();}): cannot handle async/sync*/async* functions
-await_for_test: Crash # (consumeSomeOfInfini...  cannot handle async/sync*/async* functions
-await_for_use_local_test: Crash # (test()async{var cou...  cannot handle async/sync*/async* functions
-await_future_test: Crash # (test()async{var res...  cannot handle async/sync*/async* functions
-await_nonfuture_test: Crash # (foo()async{Expect.equals(X,10);return await 5;}): cannot handle async/sync*/async* functions
-await_not_started_immediately_test: Crash # (foo()async{x++ ;await 1;x++ ;}): cannot handle async/sync*/async* functions
-await_postfix_expr_test: Crash # (test()async{Expect....  cannot handle async/sync*/async* functions
-await_regression_test: Crash # (main()async{testNes...  cannot handle async/sync*/async* functions
-await_test: Crash # (others()async{var a...  cannot handle async/sync*/async* functions
+assert_assignable_type_test: Crash # Internal Error: Pending statics.
+async_await_syntax_test/a03a: Crash # (a03a()async*{}): cannot handle sync*/async* functions
+async_await_syntax_test/a03b: Crash # (a03b()async*{}): cannot handle sync*/async* functions
+async_await_syntax_test/a06a: Crash # (await for(var o in st){}): await for
+async_await_syntax_test/a09a: Crash # (a09a()async*{yield 0;}): cannot handle sync*/async* functions
+async_await_syntax_test/a10a: Crash # (a10a()async*{yield* [] ;}): cannot handle sync*/async* functions
+async_await_syntax_test/a11d: Crash # (get async async*{}): cannot handle sync*/async* functions
+async_await_syntax_test/b03a: Crash # (b03a()async*{}): cannot handle sync*/async* functions
+async_await_syntax_test/b06a: Crash # (await for(var o in st){}): await for
+async_await_syntax_test/b09a: Crash # (b09a()async*{yield 0;}): cannot handle sync*/async* functions
+async_await_syntax_test/b10a: Crash # (b10a()async*{yield* [] ;}): cannot handle sync*/async* functions
+async_await_syntax_test/b11d: Crash # (get async async*{}): cannot handle sync*/async* functions
+async_await_syntax_test/c03a: Crash # (c03a()async*{}): cannot handle sync*/async* functions
+async_await_syntax_test/c06a: Crash # (await for(var o in st){}): await for
+async_await_syntax_test/c09a: Crash # (c09a()async*{yield 0;}): cannot handle sync*/async* functions
+async_await_syntax_test/c10a: Crash # (c10a()async*{yield* [] ;}): cannot handle sync*/async* functions
+async_await_syntax_test/d03a: Crash # (()async*{}): cannot handle sync*/async* functions
+async_await_syntax_test/d06a: Crash # (await for(var o in st){}): await for
+async_await_syntax_test/d09a: Crash # (()async*{yield 0;}): cannot handle sync*/async* functions
+async_await_syntax_test/d10a: Crash # (()async*{yield* [] ;}): cannot handle sync*/async* functions
+async_await_test/02: Crash # (switch (v){label:ca...  continue to a labeled switch case
+async_await_test/03: Crash # (switch (v){label:ca...  continue to a labeled switch case
+async_await_test/none: Crash # (switch (v){label:ca...  continue to a labeled switch case
+async_or_generator_return_type_stacktrace_test/02: Crash # (void badReturnTypeAsyncStar()async*{}): cannot handle sync*/async* functions
+async_return_types_test/nestedFuture: Crash #  cannot handle sync*/async* functions
+async_return_types_test/none: Crash # cannot handle sync*/async* functions
+async_return_types_test/tooManyTypeParameters: Crash # cannot handle sync*/async* functions
+async_return_types_test/wrongReturnType: Crash # cannot handle sync*/async* functions
+async_return_types_test/wrongTypeParameter: Crash # cannot handle sync*/async* functions
+async_star_await_pauses_test: Crash # (await for(var i in ...  await for
+async_star_cancel_and_throw_in_finally_test: Crash # (foo()async*{try {in...  cannot handle sync*/async* functions
+async_star_cancel_while_paused_test: Crash # (f()async*{list.add(...  cannot handle sync*/async* functions
+async_star_regression_2238_test: Crash # (f()async*{label1:label2:yield 0;}): cannot handle sync*/async* functions
+async_star_regression_23116_test: Crash # (Stream<int> foo(Com...  cannot handle sync*/async* functions
+async_star_regression_fisk_test: Crash # (fisk()async*{res.ad...  cannot handle sync*/async* functions
+async_star_stream_take_test: Crash # (Stream makeStream(i...  cannot handle sync*/async* functions
+async_star_take_reyield_test: Crash # (fivePartialSums(Str...  cannot handle sync*/async* functions
+async_star_test: Crash # (f()async*{}): cannot handle sync*/async* functions
+async_this_bound_test: RuntimeError # Cannot read property 'set$f' of undefined
+asyncstar_concat_test: Crash # (concat(a,b)async*{yield* a;yield* b;}): cannot handle sync*/async* functions
+asyncstar_throw_in_catch_test: Crash # (foo4(Tracer tracer)...  cannot handle sync*/async* functions
+asyncstar_yield_test: Crash # (Stream<int> foo4()a...  cannot handle sync*/async* functions
+asyncstar_yieldstar_test: Crash # (foo2(Stream subStream)async*{yield* subStream;}): cannot handle sync*/async* functions
+await_for_cancel_test: Crash # (await for(var x in controller.stream){for(int j=0;j<10;j++ ){if(j==5)continue outer;}}): await for
+await_for_test: Crash # (await for(var x in infiniteStream()){i++ ;if(i>10)break;t4.record(x);}): await for
+await_for_use_local_test: Crash # (await for(var v in s){accum+= v;}): await for
+await_future_test: RuntimeError # Cannot read property '_await_future_test$_box_0' of undefined
+await_postfix_expr_test: RuntimeError # Please triage this failure.
+await_regression_test: RuntimeError # "Obelix".then$1 is not a function
+await_test: RuntimeError # Cannot read property '$add' of undefined
 cha_deopt1_test: Crash # (d.make_u()): deferred access is not implemented
 cha_deopt2_test: Crash # (d.make_u()): deferred access is not implemented
 cha_deopt3_test: Crash # (d.make_u()): deferred access is not implemented
-closure_in_constructor_test: Crash # Invalid argument(s)
-closure_type_variables_test: Crash # Invalid argument(s)
+closure_in_constructor_test: RuntimeError # Please triage this failure.
 closures_initializer_test: RuntimeError # Please triage this failure.
-const_evaluation_test/01: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
 constructor12_test: RuntimeError # Please triage this failure.
 crash_6725_test/01: Crash # unsupported operation on erroneous element
-custom_await_stack_trace_test: Crash # (main()async{try {va...  cannot handle async/sync*/async* functions
+cyclic_default_values_test: RuntimeError # Z.cyclic_default_values_test__foo$closure is not a function
 deferred_call_empty_before_load_test: Crash # (lib1.thefun()): deferred access is not implemented
-deferred_closurize_load_library_test: Crash # (lib.trueVar): deferred access is not implemented
-deferred_constant_list_test: Crash # (lib.finalConstList): deferred access is not implemented
-deferred_constraints_constants_test/none: Crash # (lib.constantInstance): deferred access is not implemented
-deferred_constraints_constants_test/reference_after_load: Crash # (lib.constantInstance): deferred access is not implemented
-deferred_constraints_type_annotation_test/as_operation: Crash # (lib.constantInstance): deferred access is not implemented
-deferred_constraints_type_annotation_test/catch_check: Crash # (lib.constantInstance): deferred access is not implemented
-deferred_constraints_type_annotation_test/is_check: Crash # (lib.constantInstance): deferred access is not implemented
-deferred_constraints_type_annotation_test/new: Crash # (lib.constantInstance): deferred access is not implemented
-deferred_constraints_type_annotation_test/new_before_load: Crash # (lib.constantInstance): deferred access is not implemented
-deferred_constraints_type_annotation_test/new_generic1: Crash # (lib.constantInstance): deferred access is not implemented
-deferred_constraints_type_annotation_test/new_generic2: Crash # (lib.constantInstance): deferred access is not implemented
-deferred_constraints_type_annotation_test/new_generic3: Crash # (lib.constantInstance): deferred access is not implemented
-deferred_constraints_type_annotation_test/none: Crash # (lib.constantInstance): deferred access is not implemented
-deferred_constraints_type_annotation_test/static_method: Crash # (lib.constantInstance): deferred access is not implemented
-deferred_constraints_type_annotation_test/type_annotation1: Crash # (lib.constantInstance): deferred access is not implemented
-deferred_constraints_type_annotation_test/type_annotation_generic1: Crash # (lib.constantInstance): deferred access is not implemented
-deferred_constraints_type_annotation_test/type_annotation_generic2: Crash # (lib.constantInstance): deferred access is not implemented
-deferred_constraints_type_annotation_test/type_annotation_generic3: Crash # (lib.constantInstance): deferred access is not implemented
-deferred_constraints_type_annotation_test/type_annotation_generic4: Crash # (lib.constantInstance): deferred access is not implemented
-deferred_constraints_type_annotation_test/type_annotation_non_deferred: Crash # (lib.constantInstance): deferred access is not implemented
-deferred_constraints_type_annotation_test/type_annotation_null: Crash # (lib.constantInstance): deferred access is not implemented
-deferred_constraints_type_annotation_test/type_annotation_top_level: Crash # (lib.constantInstance): deferred access is not implemented
-deferred_function_type_test: Crash # (lib.runTest()): deferred access is not implemented
-deferred_global_test: Crash # (lib.finalConstGlobal): deferred access is not implemented
+deferred_closurize_load_library_test: RuntimeError # D.loadLibrary is not a function
+deferred_constant_list_test: RuntimeError # K.loadLibrary is not a function
+deferred_constraints_constants_test/none: RuntimeError # S.loadLibrary is not a function
+deferred_constraints_constants_test/reference_after_load: RuntimeError # G.loadLibrary is not a function
+deferred_constraints_type_annotation_test/as_operation: RuntimeError # Z.loadLibrary is not a function
+deferred_constraints_type_annotation_test/catch_check: RuntimeError # D.loadLibrary is not a function
+deferred_constraints_type_annotation_test/is_check: RuntimeError # L.loadLibrary is not a function
+deferred_constraints_type_annotation_test/new: RuntimeError # R.loadLibrary is not a function
+deferred_constraints_type_annotation_test/new_before_load: RuntimeError # K.loadLibrary is not a function
+deferred_constraints_type_annotation_test/new_generic1: RuntimeError # R.loadLibrary is not a function
+deferred_constraints_type_annotation_test/new_generic2: RuntimeError # X.loadLibrary is not a function
+deferred_constraints_type_annotation_test/new_generic3: RuntimeError # K.loadLibrary is not a function
+deferred_constraints_type_annotation_test/none: RuntimeError # D.loadLibrary is not a function
+deferred_constraints_type_annotation_test/static_method: RuntimeError # F.loadLibrary is not a function
+deferred_constraints_type_annotation_test/type_annotation1: RuntimeError # K.loadLibrary is not a function
+deferred_constraints_type_annotation_test/type_annotation_generic1: RuntimeError # T.loadLibrary is not a function
+deferred_constraints_type_annotation_test/type_annotation_generic2: RuntimeError # Q.loadLibrary is not a function
+deferred_constraints_type_annotation_test/type_annotation_generic3: RuntimeError # Z.loadLibrary is not a function
+deferred_constraints_type_annotation_test/type_annotation_generic4: RuntimeError # Q.loadLibrary is not a function
+deferred_constraints_type_annotation_test/type_annotation_non_deferred: RuntimeError # R.loadLibrary is not a function
+deferred_constraints_type_annotation_test/type_annotation_null: RuntimeError # Z.loadLibrary is not a function
+deferred_constraints_type_annotation_test/type_annotation_top_level: RuntimeError # U.loadLibrary is not a function
+deferred_function_type_test: RuntimeError # N.loadLibrary is not a function
+deferred_global_test: RuntimeError # Y.loadLibrary is not a function
 deferred_inlined_test: Crash # (lib.foo()): deferred access is not implemented
-deferred_load_constants_test/none: Crash # (foo.c): deferred access is not implemented
+deferred_load_constants_test/none: Crash # (foo.toplevel): deferred access is not implemented
 deferred_load_inval_code_test: Crash # (d.foo()): deferred access is not implemented
 deferred_load_library_wrong_args_test/none: RuntimeError # Y.loadLibrary is not a function
 deferred_mixin_test: RuntimeError # X.loadLibrary is not a function
 deferred_no_such_method_test: RuntimeError # D.loadLibrary is not a function
 deferred_not_loaded_check_test: Crash # (lib.closure(sideEffect())): deferred access is not implemented
-deferred_only_constant_test: Crash # (lib.constant): deferred access is not implemented
+deferred_only_constant_test: RuntimeError # O.loadLibrary is not a function
 deferred_optimized_test: Crash # (lib.foo()): deferred access is not implemented
-deferred_redirecting_factory_test: Crash # (test()async{await t...  cannot handle async/sync*/async* functions
-deferred_regression_22995_test: Crash # (lib.foofoo()): deferred access is not implemented
-deferred_shadow_load_library_test: Crash # (lib.trueVar): deferred access is not implemented
-deferred_shared_and_unshared_classes_test: Crash # (lib2.foo()): deferred access is not implemented
-deferred_static_seperate_test: Crash # (lib1.x): deferred access is not implemented
-deferred_type_dependency_test/as: Crash # (main()async{await l...  cannot handle async/sync*/async* functions
-deferred_type_dependency_test/is: Crash # (main()async{await l...  cannot handle async/sync*/async* functions
-deferred_type_dependency_test/none: Crash # (main()async{await l...  cannot handle async/sync*/async* functions
-deferred_type_dependency_test/type_annotation: Crash # (main()async{await l...  cannot handle async/sync*/async* functions
-enum_mirror_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-final_super_field_set_test/01: RuntimeError # Please triage this failure.
+deferred_redirecting_factory_test: Crash # (lib1.loadLib2()): deferred access is not implemented
+deferred_regression_22995_test: RuntimeError # U.loadLibrary is not a function
+deferred_shadow_load_library_test: RuntimeError # Y.loadLibrary is not a function
+deferred_shared_and_unshared_classes_test: RuntimeError # U.loadLibrary is not a function
+deferred_static_seperate_test: RuntimeError # L.loadLibrary is not a function
+deferred_super_dependency_test/01: RuntimeError # $async$temp1.loadLibrary is not a function
+deferred_type_dependency_test/as: Crash # (lib1.fooAs("string")): deferred access is not implemented
+deferred_type_dependency_test/is: Crash # (lib1.fooIs("string")): deferred access is not implemented
+deferred_type_dependency_test/none: Crash # (lib2.getInstance()): deferred access is not implemented
+deferred_type_dependency_test/type_annotation: Crash # (lib1.fooAnnotation("string")): deferred access is not implemented
+field3a_negative_test: Fail # Bogus result from type inference in case of invalid program.
 first_class_types_test: RuntimeError # Please triage this failure.
-flatten_test/01: Crash # (test()async{int x=await new Derived<int>();}): cannot handle async/sync*/async* functions
-flatten_test/02: Crash # (test()async{Future<int> f()async=>new Derived<int>();}): cannot handle async/sync*/async* functions
-flatten_test/03: Crash # (test()async{Future<...  cannot handle async/sync*/async* functions
-flatten_test/04: Crash # (test()async{Future<...  cannot handle async/sync*/async* functions
-flatten_test/05: Crash # (test()async{FixedPo...  cannot handle async/sync*/async* functions
-flatten_test/06: Crash # (test()async{Future<...  cannot handle async/sync*/async* functions
-flatten_test/07: Crash # (test()async{Future<...  cannot handle async/sync*/async* functions
-flatten_test/08: Crash # (test()async{Future<...  cannot handle async/sync*/async* functions
-flatten_test/09: Crash # (test()async{Diverge...  cannot handle async/sync*/async* functions
-flatten_test/10: Crash # (test()async{Future<...  cannot handle async/sync*/async* functions
-flatten_test/11: Crash # (test()async{Future<...  cannot handle async/sync*/async* functions
-flatten_test/12: Crash # (test()async{Future<...  cannot handle async/sync*/async* functions
-flatten_test/none: Crash # (test()async{}): cannot handle async/sync*/async* functions
 for2_test: Crash # The null object does not have a getter 'field'.
 for_variable_capture_test: Crash # (i=0): For-loop variable captured in loop header
 generic2_test: RuntimeError # Please triage this failure.
@@ -488,7 +345,6 @@
 generic_instanceof_test: RuntimeError # Please triage this failure.
 generic_native_test: RuntimeError # Please triage this failure.
 infinite_switch_label_test: Crash # (switch (target){l0:...  continue to a labeled switch case
-instance_creation_in_function_annotation_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
 instanceof2_test: RuntimeError # Please triage this failure.
 instanceof4_test/01: RuntimeError # Please triage this failure.
 invocation_mirror_invoke_on_test: RuntimeError # Please triage this failure.
@@ -500,21 +356,10 @@
 many_overridden_no_such_method_test: RuntimeError # Please triage this failure.
 nested_switch_label_test: Crash # (switch (target){out...  continue to a labeled switch case
 no_such_method_test: RuntimeError # Please triage this failure.
-null_test/none: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
 overridden_no_such_method_test: RuntimeError # Please triage this failure.
-redirecting_factory_reflection_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-regress_18535_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-regress_22438_test: Crash # (main()async{var err...  cannot handle async/sync*/async* functions
 regress_22443_test: RuntimeError # M.loadLibrary is not a function
-regress_22445_test: Crash # (main()async{var err...  cannot handle async/sync*/async* functions
-regress_22579_test: Crash # (main()async{var err...  cannot handle async/sync*/async* functions
-regress_22728_test: Crash # (main()async{bool fa...  cannot handle async/sync*/async* functions
-regress_22777_test: Crash # (test()async{try {te...  cannot handle async/sync*/async* functions
 regress_23408_test: RuntimeError # G.loadLibrary is not a function
-regress_23498_test: Crash # (main()async{var err...  cannot handle async/sync*/async* functions
-regress_23500_test/01: Crash # (main()async{var err...  cannot handle async/sync*/async* functions
-regress_23500_test/02: Crash # (main()async{var err...  cannot handle async/sync*/async* functions
-regress_23500_test/none: Crash # (main()async{var err...  cannot handle async/sync*/async* functions
+regress_23500_test/01: Crash # (await for(var c in new Stream.fromIterable([] )){}): await for
 super_bound_closure_test/01: RuntimeError # Cannot read property 'call' of undefined
 super_bound_closure_test/none: RuntimeError # Cannot read property 'call' of undefined
 super_call4_test: RuntimeError # Please triage this failure.
@@ -528,30 +373,21 @@
 switch_label2_test: Crash # (switch (target){cas...  continue to a labeled switch case
 switch_label_test: Crash # (switch (animal){cas...  continue to a labeled switch case
 switch_try_catch_test: Crash # (switch (0){_0:case ...  continue to a labeled switch case
-sync_generator1_test/01: Crash # (dreiVier()sync*{yield* 3;}): cannot handle async/sync*/async* functions
-sync_generator1_test/none: Crash # (einsZwei()sync*{yie...  cannot handle async/sync*/async* functions
-sync_generator2_test/07: Crash # (sync()sync*{yield sync;}): cannot handle async/sync*/async* functions
-sync_generator2_test/08: Crash # (sync()sync*{yield sync;}): cannot handle async/sync*/async* functions
-sync_generator2_test/10: Crash # (sync()sync*{yield sync;}): cannot handle async/sync*/async* functions
-sync_generator2_test/none: Crash # (sync()sync*{yield sync;}): cannot handle async/sync*/async* functions
-sync_generator3_test/test1: Crash # (f()sync*{try {yield...  cannot handle async/sync*/async* functions
-sync_generator3_test/test2: Crash # (g()sync*{try {yield...  cannot handle async/sync*/async* functions
-syncstar_less_than_test: Crash # (Iterable<int> foo()...  cannot handle async/sync*/async* functions
-syncstar_yield_test/copyParameters: Crash # (Iterable<int> foo3(...  cannot handle async/sync*/async* functions
-syncstar_yield_test/none: Crash # (Iterable<int> foo3(...  cannot handle async/sync*/async* functions
-syncstar_yieldstar_test: Crash # (main()async{Expect....  cannot handle async/sync*/async* functions
-type_parameter_test/01: Crash # Invalid argument(s)
-type_parameter_test/02: Crash # Invalid argument(s)
-type_parameter_test/03: Crash # Invalid argument(s)
-type_parameter_test/04: Crash # Invalid argument(s)
-type_parameter_test/05: Crash # Invalid argument(s)
-type_parameter_test/06: Crash # Invalid argument(s)
-type_parameter_test/none: Crash # Invalid argument(s)
+sync_generator1_test/01: RuntimeError # Expect.equals(expected: <(1, 2, 3, 5, [6])>, actual: <(1)>) fails.
+sync_generator1_test/none: RuntimeError # Expect.equals(expected: <(1, 2, 3, 5, [6])>, actual: <(1)>) fails.
+sync_generator3_test/test1: RuntimeError # Please triage this failure.
+sync_generator3_test/test2: RuntimeError # Please triage this failure.
+syncstar_yield_test/copyParameters: RuntimeError # Please triage this failure.
+syncstar_yield_test/none: RuntimeError # Please triage this failure.
+syncstar_yieldstar_test: RuntimeError # Please triage this failure.
 type_variable_closure2_test: RuntimeError # Please triage this failure.
-type_variable_closure_test: Crash # Invalid argument(s)
 type_variable_field_initializer_closure_test: RuntimeError # Please triage this failure.
 type_variable_field_initializer_test: RuntimeError # Please triage this failure.
 type_variable_nested_test: RuntimeError # Please triage this failure.
 
-[ $compiler == dart2js && ($runtime == d8 || $runtime == jsshell) ]
-issue23244_test: RuntimeError # 23244
+[ $compiler == dart2js && $cps_ir && $host_checked ]
+async_throw_in_catch_test/forceAwait: Crash # Issue 24485
+async_throw_in_catch_test/none: Crash # Issue 24485
+execute_finally9_test: Crash # Issue 24485
+regress_21795_test: Crash # Issue 24485
+regress_23537_test: Crash # Issue 24485
diff --git a/tests/language/mixin_illegal_super_use_test.dart b/tests/language/mixin_illegal_super_use_test.dart
deleted file mode 100644
index 7f0d64a..0000000
--- a/tests/language/mixin_illegal_super_use_test.dart
+++ /dev/null
@@ -1,71 +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";
-
-class M {
-}
-
-class P0 {
-  foo() {
-    super.toString();    /// 01: compile-time error
-    super.foo();         /// 02: compile-time error
-    super.bar = 100;     /// 03: compile-time error
-
-    void inner() {
-      super.toString();  /// 04: compile-time error
-      super.foo();       /// 05: compile-time error
-      super.bar = 100;   /// 06: compile-time error
-    }
-    inner();
-
-    (() {
-      super.toString();  /// 07: compile-time error
-      super.foo();       /// 08: compile-time error
-      super.bar = 100;   /// 09: compile-time error
-    })();
-
-    return 42;
-  }
-}
-
-class P1 {
-  bar() {
-    super.toString();    /// 10: compile-time error
-    return 87;
-  }
-
-  // The test method is strategically placed here to try to force the
-  // P1 class and its bar method to be resolved before resolving the
-  // mixin applications.
-  test() {
-    new C();
-    var d = new D();
-    var e = new E();
-    var f = new F();
-    Expect.equals(42, d.foo());
-    Expect.equals(87, e.bar());
-    Expect.equals(99, f.baz());
-  }
-}
-
-class P2 {
-  baz() {
-    super.toString();   /// 11: compile-time error
-    return 99;
-  }
-}
-
-class C = Object with M;
-class D = Object with P0;
-class E = Object with M, P1;
-class F = Object with P2, M;
-
-main() {
-  var p1 = new P1();
-  var p2 = new P2();
-  Expect.equals(87, p1.bar());
-  p1.test();
-  Expect.equals(99, p2.baz());
-}
diff --git a/tests/language/mixin_illegal_superclass_test.dart b/tests/language/mixin_illegal_superclass_test.dart
deleted file mode 100644
index 03d2e6a..0000000
--- a/tests/language/mixin_illegal_superclass_test.dart
+++ /dev/null
@@ -1,121 +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.
-
-class S0 { }
-class S1 extends Object { }
-class S2 extends S0 { }
-
-class M0 { }
-class M1 extends Object { }
-class M2 extends M0 { }
-
-class C00 = S0 with M0;
-class C01 = S0 with M1;
-class C02 = S0 with M2;      /// 01: compile-time error
-class C03 = S0 with M0, M1;
-class C04 = S0 with M0, M2;  /// 02: compile-time error
-class C05 = S0 with M2, M0;  /// 03: compile-time error
-class C06 = S0 with M1, M2;  /// 04: compile-time error
-class C07 = S0 with M2, M1;  /// 05: compile-time error
-
-class C10 = S1 with M0;
-class C11 = S1 with M1;
-class C12 = S1 with M2;      /// 06: compile-time error
-class C13 = S1 with M0, M1;
-class C14 = S1 with M0, M2;  /// 07: compile-time error
-class C15 = S1 with M2, M0;  /// 08: compile-time error
-class C16 = S1 with M1, M2;  /// 09: compile-time error
-class C17 = S1 with M2, M1;  /// 10: compile-time error
-
-class C20 = S2 with M0;
-class C21 = S2 with M1;
-class C22 = S2 with M2;      /// 11: compile-time error
-class C23 = S2 with M0, M1;
-class C24 = S2 with M0, M2;  /// 12: compile-time error
-class C25 = S2 with M2, M0;  /// 13: compile-time error
-class C26 = S2 with M1, M2;  /// 14: compile-time error
-class C27 = S2 with M2, M1;  /// 15: compile-time error
-
-class D00 extends S0 with M0 { }
-class D01 extends S0 with M1 { }
-class D02 extends S0 with M2 { }      /// 16: compile-time error
-class D03 extends S0 with M0, M1 { }
-class D04 extends S0 with M0, M2 { }  /// 17: compile-time error
-class D05 extends S0 with M2, M0 { }  /// 18: compile-time error
-class D06 extends S0 with M1, M2 { }  /// 19: compile-time error
-class D07 extends S0 with M2, M1 { }  /// 20: compile-time error
-
-class D10 extends S1 with M0 { }
-class D11 extends S1 with M1 { }
-class D12 extends S1 with M2 { }      /// 21: compile-time error
-class D13 extends S1 with M0, M1 { }
-class D14 extends S1 with M0, M2 { }  /// 22: compile-time error
-class D15 extends S1 with M2, M0 { }  /// 23: compile-time error
-class D16 extends S1 with M1, M2 { }  /// 24: compile-time error
-class D17 extends S1 with M2, M1 { }  /// 25: compile-time error
-
-class D20 extends S2 with M0 { }
-class D21 extends S2 with M1 { }
-class D22 extends S2 with M2 { }      /// 26: compile-time error
-class D23 extends S2 with M0, M1 { }
-class D24 extends S2 with M0, M2 { }  /// 27: compile-time error
-class D25 extends S2 with M2, M0 { }  /// 28: compile-time error
-class D26 extends S2 with M1, M2 { }  /// 29: compile-time error
-class D27 extends S2 with M2, M1 { }  /// 30: compile-time error
-
-main() {
-  new C00();
-  new C01();
-  new C02();  /// 01: continued
-  new C03();
-  new C04();  /// 02: continued
-  new C05();  /// 03: continued
-  new C06();  /// 04: continued
-  new C07();  /// 05: continued
-
-  new C10();
-  new C11();
-  new C12();  /// 06: continued
-  new C13();
-  new C14();  /// 07: continued
-  new C15();  /// 08: continued
-  new C16();  /// 09: continued
-  new C17();  /// 10: continued
-
-  new C20();
-  new C21();
-  new C22();  /// 11: continued
-  new C23();
-  new C24();  /// 12: continued
-  new C25();  /// 13: continued
-  new C26();  /// 14: continued
-  new C27();  /// 15: continued
-
-  new D00();
-  new D01();
-  new D02();  /// 16: continued
-  new D03();
-  new D04();  /// 17: continued
-  new D05();  /// 18: continued
-  new D06();  /// 19: continued
-  new D07();  /// 20: continued
-
-  new D10();
-  new D11();
-  new D12();  /// 21: continued
-  new D13();
-  new D14();  /// 22: continued
-  new D15();  /// 23: continued
-  new D16();  /// 24: continued
-  new D17();  /// 25: continued
-
-  new D20();
-  new D21();
-  new D22();  /// 26: continued
-  new D23();
-  new D24();  /// 27: continued
-  new D25();  /// 28: continued
-  new D26();  /// 29: continued
-  new D27();  /// 30: continued
-}
diff --git a/tests/language/mixin_super_2_test.dart b/tests/language/mixin_super_2_test.dart
new file mode 100644
index 0000000..ad86c08
--- /dev/null
+++ b/tests/language/mixin_super_2_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.
+
+import "package:expect/expect.dart";
+
+class B {
+  // 'super' resolves to Object, and in some tests, multiple points in the
+  // inheritance chain.
+  toString() => 'B(' + super.toString() + ')';
+}
+
+class R {
+  toString() => 'R[' + super.toString() + ']';
+}
+
+class D extends R with B {
+  toString() => 'D<' + super.toString() + '>';
+}
+
+class E extends D with B {
+  toString() => 'E{' + super.toString() + '}';
+}
+
+class F = R with B, B;
+
+class G extends F with B {
+  toString() => 'G{' + super.toString() + '}';
+}
+
+main(){
+  check(object, String expected) {
+    Expect.equals(expected, object.toString());
+  }
+
+  check(new B(), "B(Instance of 'B')");
+  check(new R(), "R[Instance of 'R']");
+  check(new D(), "D<B(R[Instance of 'D'])>");
+  check(new E(), "E{B(D<B(R[Instance of 'E'])>)}");
+  check(new F(), "B(B(R[Instance of 'F']))");
+  check(new G(), "G{B(B(B(R[Instance of 'G'])))}");
+}
diff --git a/tests/language/mixin_super_bound2_test.dart b/tests/language/mixin_super_bound2_test.dart
index 87e8b7a..c6fcd7a 100644
--- a/tests/language/mixin_super_bound2_test.dart
+++ b/tests/language/mixin_super_bound2_test.dart
@@ -1,7 +1,6 @@
 // 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.
-// SharedOptions=--supermixin
 
 import "package:expect/expect.dart";
 
diff --git a/tests/language/mixin_super_test.dart b/tests/language/mixin_super_test.dart
index 8a4ee98..6a5d5a3 100644
--- a/tests/language/mixin_super_test.dart
+++ b/tests/language/mixin_super_test.dart
@@ -1,7 +1,6 @@
 // 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.
-// SharedOptions=--supermixin
 
 import "package:expect/expect.dart";
 
diff --git a/tests/language/mixin_super_use_test.dart b/tests/language/mixin_super_use_test.dart
new file mode 100644
index 0000000..cd95846
--- /dev/null
+++ b/tests/language/mixin_super_use_test.dart
@@ -0,0 +1,65 @@
+// Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import "package:expect/expect.dart";
+
+class M {
+}
+
+class P0 {
+  foo() {
+    super.toString();
+
+    void inner() {
+      super.toString();
+    }
+    inner();
+
+    (() {
+      super.toString();
+    })();
+
+    return 42;
+  }
+}
+
+class P1 {
+  bar() {
+    super.toString();
+    return 87;
+  }
+
+  // The test method is strategically placed here to try to force the
+  // P1 class and its bar method to be resolved before resolving the
+  // mixin applications.
+  test() {
+    new C();
+    var d = new D();
+    var e = new E();
+    var f = new F();
+    Expect.equals(42, d.foo());
+    Expect.equals(87, e.bar());
+    Expect.equals(99, f.baz());
+  }
+}
+
+class P2 {
+  baz() {
+    super.toString();
+    return 99;
+  }
+}
+
+class C = Object with M;
+class D = Object with P0;
+class E = Object with M, P1;
+class F = Object with P2, M;
+
+main() {
+  var p1 = new P1();
+  var p2 = new P2();
+  Expect.equals(87, p1.bar());
+  p1.test();
+  Expect.equals(99, p2.baz());
+}
diff --git a/tests/language/mixin_superclass_test.dart b/tests/language/mixin_superclass_test.dart
new file mode 100644
index 0000000..ade41da
--- /dev/null
+++ b/tests/language/mixin_superclass_test.dart
@@ -0,0 +1,121 @@
+// 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.
+
+class S0 { }
+class S1 extends Object { }
+class S2 extends S0 { }
+
+class M0 { }
+class M1 extends Object { }
+class M2 extends M0 { }
+
+class C00 = S0 with M0;
+class C01 = S0 with M1;
+class C02 = S0 with M2;
+class C03 = S0 with M0, M1;
+class C04 = S0 with M0, M2;
+class C05 = S0 with M2, M0;
+class C06 = S0 with M1, M2;
+class C07 = S0 with M2, M1;
+
+class C10 = S1 with M0;
+class C11 = S1 with M1;
+class C12 = S1 with M2;
+class C13 = S1 with M0, M1;
+class C14 = S1 with M0, M2;
+class C15 = S1 with M2, M0;
+class C16 = S1 with M1, M2;
+class C17 = S1 with M2, M1;
+
+class C20 = S2 with M0;
+class C21 = S2 with M1;
+class C22 = S2 with M2;
+class C23 = S2 with M0, M1;
+class C24 = S2 with M0, M2;
+class C25 = S2 with M2, M0;
+class C26 = S2 with M1, M2;
+class C27 = S2 with M2, M1;
+
+class D00 extends S0 with M0 { }
+class D01 extends S0 with M1 { }
+class D02 extends S0 with M2 { }
+class D03 extends S0 with M0, M1 { }
+class D04 extends S0 with M0, M2 { }
+class D05 extends S0 with M2, M0 { }
+class D06 extends S0 with M1, M2 { }
+class D07 extends S0 with M2, M1 { }
+
+class D10 extends S1 with M0 { }
+class D11 extends S1 with M1 { }
+class D12 extends S1 with M2 { }
+class D13 extends S1 with M0, M1 { }
+class D14 extends S1 with M0, M2 { }
+class D15 extends S1 with M2, M0 { }
+class D16 extends S1 with M1, M2 { }
+class D17 extends S1 with M2, M1 { }
+
+class D20 extends S2 with M0 { }
+class D21 extends S2 with M1 { }
+class D22 extends S2 with M2 { }
+class D23 extends S2 with M0, M1 { }
+class D24 extends S2 with M0, M2 { }
+class D25 extends S2 with M2, M0 { }
+class D26 extends S2 with M1, M2 { }
+class D27 extends S2 with M2, M1 { }
+
+main() {
+  new C00();
+  new C01();
+  new C02();
+  new C03();
+  new C04();
+  new C05();
+  new C06();
+  new C07();
+
+  new C10();
+  new C11();
+  new C12();
+  new C13();
+  new C14();
+  new C15();
+  new C16();
+  new C17();
+
+  new C20();
+  new C21();
+  new C22();
+  new C23();
+  new C24();
+  new C25();
+  new C26();
+  new C27();
+
+  new D00();
+  new D01();
+  new D02();
+  new D03();
+  new D04();
+  new D05();
+  new D06();
+  new D07();
+
+  new D10();
+  new D11();
+  new D12();
+  new D13();
+  new D14();
+  new D15();
+  new D16();
+  new D17();
+
+  new D20();
+  new D21();
+  new D22();
+  new D23();
+  new D24();
+  new D25();
+  new D26();
+  new D27();
+}
diff --git a/tests/language/override_inheritance_no_such_method_test.dart b/tests/language/override_inheritance_no_such_method_test.dart
index 45be62e..80409e0 100644
--- a/tests/language/override_inheritance_no_such_method_test.dart
+++ b/tests/language/override_inheritance_no_such_method_test.dart
@@ -43,7 +43,7 @@
 class B {
   method12(); /// 12: continued
 
-  noSuchMethod(_) => null; /// 13: static type warning
+  noSuchMethod(_) => null; /// 13: ok
   method13(); /// 13: continued
 }
 
diff --git a/tests/language/private_super_constructor_lib.dart b/tests/language/private_super_constructor_lib.dart
new file mode 100644
index 0000000..8a34b6d
--- /dev/null
+++ b/tests/language/private_super_constructor_lib.dart
@@ -0,0 +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.
+
+library private_super_constructor_lib;
+
+class B {
+  B();
+  B._foo();
+}
\ No newline at end of file
diff --git a/tests/language/private_super_constructor_test.dart b/tests/language/private_super_constructor_test.dart
new file mode 100644
index 0000000..a203f4a
--- /dev/null
+++ b/tests/language/private_super_constructor_test.dart
@@ -0,0 +1,13 @@
+// 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 private_super_constructor_test;
+
+import 'private_super_constructor_lib.dart';
+
+class C extends B {
+  C() : super._foo(); /// 01: compile-time error
+}
+
+main() => new C();
\ No newline at end of file
diff --git a/tests/language/regress_24283_test.dart b/tests/language/regress_24283_test.dart
new file mode 100644
index 0000000..d98e829
--- /dev/null
+++ b/tests/language/regress_24283_test.dart
@@ -0,0 +1,23 @@
+// 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 "package:expect/expect.dart";
+
+main() {
+  // Smi
+  var i = 1 << 30;
+  var j = -i;
+  Expect.equals(0, i >> 37);
+  Expect.equals(-1, j >> 37);
+  // Mint
+  i = 1 << 50;
+  j = -i;
+  Expect.equals(0, i >> 67);
+  Expect.equals(-1, j >> 67);
+  // Bigint
+  i = i << 120;
+  j = -i;
+  Expect.equals(0, i >> 199);
+  Expect.equals(-1, j >> 199);
+}
diff --git a/tests/language/string_interpolation_and_buffer_test.dart b/tests/language/string_interpolation_and_buffer_test.dart
index 5006d6e..4569027 100644
--- a/tests/language/string_interpolation_and_buffer_test.dart
+++ b/tests/language/string_interpolation_and_buffer_test.dart
@@ -20,8 +20,9 @@
 final bool checkedMode = computeCheckedMode();
 bool computeCheckedMode() {
   try {
-    int x = "foo";
-  } on Error {
+    var i = 42;
+    String s = i;
+  } on TypeError catch (e) {
     return true;
   }
   return false;
diff --git a/tests/language/string_split_test.dart b/tests/language/string_split_test.dart
index 56189cc..8cf00bb 100644
--- a/tests/language/string_split_test.dart
+++ b/tests/language/string_split_test.dart
@@ -8,6 +8,7 @@
 class EvilMatch implements Match {
   int get start => 100000000;
   int get end => 3;
+  bool noSuchMethod(Invocation im) {}  // To appease dartanalyzer.
 }
 
 class EvilIterator implements Iterator {
@@ -20,7 +21,8 @@
 }
 
 class EvilPattern implements Pattern {
-  Iterable allMatches(String s) => new EvilIterable();
+  Iterable allMatches(String s, [int start=0]) => new EvilIterable();
+  bool noSuchMethod(Invocation im) {}  // To appease dartanalyzer.
 }
 
 void main() {
diff --git a/tests/language/super_mixin_test.dart b/tests/language/super_mixin_test.dart
new file mode 100644
index 0000000..8263a1b
--- /dev/null
+++ b/tests/language/super_mixin_test.dart
@@ -0,0 +1,25 @@
+// 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.
+
+// Dart2js regression test: Test that the type mask for non-null exact Mixin is
+// created for Mixin.getter.
+
+import 'package:expect/expect.dart';
+
+class Mixin {
+  @NoInline()
+  get getter => 42;
+}
+
+class Superclass {
+
+}
+
+class Subclass extends Superclass with Mixin {
+  method() => super.getter;
+}
+
+void main() {
+  Expect.equals(42, new Subclass().method());
+}
\ No newline at end of file
diff --git a/tests/language/vm/regress_24517_test.dart b/tests/language/vm/regress_24517_test.dart
new file mode 100644
index 0000000..654caf9
--- /dev/null
+++ b/tests/language/vm/regress_24517_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.
+
+// VMOptions=--no-intrinsify
+
+// Test that math runtime function (non-intrinsified) produce the expected
+// result and don't deviate due to double-rounding when using 80-bit FP ops.
+
+import "dart:math";
+import "package:expect/expect.dart";
+
+main() {
+  var x = 2.028240960366921e+31;
+  Expect.equals(4503599627372443.0, sqrt(x));
+}
diff --git a/tests/lib/analyzer/analyze_library.status b/tests/lib/analyzer/analyze_library.status
index 5d72855..4016986 100644
--- a/tests/lib/analyzer/analyze_library.status
+++ b/tests/lib/analyzer/analyze_library.status
@@ -24,3 +24,5 @@
 lib/indexed_db/dartium/indexed_db_dartium: CompileTimeError # Issue 21647
 lib/web_audio/dartium/web_audio_dartium: CompileTimeError # Issue 21647
 lib/svg/dartium/svg_dartium: CompileTimeError # Issue 21647
+lib/_blink/dartium/_blink_dartium: CompileTimeError # Dartium JsInterop roll (js.JsObjectImpl)
+lib/js/dartium/js_dartium: CompileTimeError # Dartium JsInterop roll (js.JsObjectImpl)
diff --git a/tests/lib/async/async_await_sync_completer_test.dart b/tests/lib/async/async_await_sync_completer_test.dart
new file mode 100644
index 0000000..5865729
--- /dev/null
+++ b/tests/lib/async/async_await_sync_completer_test.dart
@@ -0,0 +1,49 @@
+// 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 'package:expect/expect.dart';
+import 'package:async_helper/async_helper.dart';
+
+import 'dart:async';
+
+var events = [];
+var delayedValue = new Completer();
+var delayedError = new Completer();
+
+foo() async {
+  new Future.microtask(() => 'in microtask')
+      .then(events.add)
+      .then(delayedValue.complete);
+  return 'in async function';
+}
+
+bar() async {
+  new Future.microtask(() => throw 'in microtask error')
+      .catchError(events.add)
+      .then(delayedError.complete);
+  throw 'in async function error';
+}
+
+void main() {
+  asyncStart();
+  var asyncValueFuture = foo().then(events.add);
+  var asyncErrorFuture = bar().catchError(events.add);
+  Future.wait([
+      asyncValueFuture,
+      delayedValue.future,
+      asyncErrorFuture,
+      delayedError.future]).then((_) {
+    // The body completed before nested microtask. So they should appear
+    // before the delayed functions. In other words, the async function should
+    // not unnecessarily delay the propagation of errors and values.
+    Expect.listEquals([
+        "in async function",
+        "in async function error",
+        "in microtask",
+        "in microtask error"],
+        events);
+    asyncEnd();
+  });
+}
diff --git a/tests/lib/async/async_await_zones_test.dart b/tests/lib/async/async_await_zones_test.dart
new file mode 100644
index 0000000..210b05d
--- /dev/null
+++ b/tests/lib/async/async_await_zones_test.dart
@@ -0,0 +1,142 @@
+// 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.
+
+// Test that async functions don't zone-register their callbacks for each
+// await. Async functions should register their callback once in the beginning
+// and then reuse it for all awaits in their body.
+// This has two advantages: it is faster, when there are several awaits (on
+// the Future class from dart:async), and it avoids zone-nesting when tracing
+// stacktraces.
+// See http://dartbug.com/23394 for more information.
+
+import 'dart:async';
+import 'package:expect/expect.dart';
+import 'package:async_helper/async_helper.dart';
+
+gee(i) async {
+  return await i;
+}
+
+bar() async* {
+  var i = 0;
+  while (true) yield await gee(i++);
+}
+
+
+awaitForTest() async {
+  var sum = 0;
+  await for (var x in bar().take(100)) {
+    sum += x;
+  }
+  Expect.equals(4950, sum);
+}
+
+awaitTest() async {
+  await null;
+  await null;
+  await null;
+  await null;
+  await null;
+  await null;
+  await null;
+  await null;
+  await null;
+  await null;
+  await null;
+  await null;
+  await null;
+  await null;
+  await null;
+  await null;
+  await null;
+  await null;
+  await null;
+  await null;
+  await null;
+  await null;
+  await null;
+  await null;
+  await null;
+  await null;
+  await null;
+  await null;
+  await null;
+  await null;
+  await null;
+  await null;
+  await null;
+  await null;
+  await null;
+  await null;
+  await null;
+  await null;
+  await null;
+  await null;
+  return await 499;
+}
+
+runTests() async {
+  await awaitTest();
+  await awaitForTest();
+}
+
+var depth = 0;
+
+var depthIncreases = 0;
+
+increaseDepth() {
+  depthIncreases++;
+  depth++;
+  // The async/await code should not register callbacks recursively in the
+  // then-calls. As such the depth should never grow too much. We don't want
+  // to commit to a specific value, since implementations still have some
+  // room in how async/await is implemented, but 20 should be safe.
+  Expect.isTrue(depth < 20);
+}
+
+registerCallback(Zone self, ZoneDelegate parent, Zone zone, f) {
+  var oldDepth = depth;
+  increaseDepth();
+  return parent.registerCallback(zone, () {
+    depth = oldDepth;
+    return f();
+  });
+}
+registerUnaryCallback(Zone self, ZoneDelegate parent, Zone zone, f) {
+  var oldDepth = depth;
+  increaseDepth();
+  return parent.registerUnaryCallback(zone, (x) {
+    depth = oldDepth;
+    return f(x);
+  });
+}
+registerBinaryCallback(Zone self, ZoneDelegate parent, Zone zone, f) {
+  var oldDepth = depth;
+  increaseDepth();
+  return parent.registerBinaryCallback(zone, (x, y) {
+    depth = oldDepth;
+    return f(x, y);
+  });
+}
+
+sm(Zone self, ZoneDelegate parent, Zone zone, f) {
+  var oldDepth = depth;
+  increaseDepth();
+  return parent.scheduleMicrotask(zone, () {
+    depth = oldDepth;
+    return f();
+  });
+}
+
+main() {
+  asyncStart();
+  var desc = new ZoneSpecification(
+      registerCallback: registerCallback,
+      registerUnaryCallback: registerUnaryCallback,
+      registerBinaryCallback: registerBinaryCallback,
+      scheduleMicrotask: sm
+      );
+  var future = runZoned(runTests, zoneSpecification: desc);
+  future.then((_) => asyncEnd());
+}
diff --git a/tests/lib/async/future_constructor2_test.dart b/tests/lib/async/future_constructor2_test.dart
new file mode 100644
index 0000000..2d64ff4
--- /dev/null
+++ b/tests/lib/async/future_constructor2_test.dart
@@ -0,0 +1,62 @@
+// 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 future_delayed_test;
+
+import 'package:async_helper/async_helper.dart';
+import "package:expect/expect.dart";
+import 'dart:async';
+
+Future<int> createIntFuture() {
+  return new Future<int>.value(499);
+}
+
+unnamed() {
+  asyncStart();
+  new Future<int>(createIntFuture)
+      .then((x) {
+    Expect.equals(499, x);
+    asyncEnd();
+  });
+}
+
+delayed() {
+  asyncStart();
+  new Future<int>.delayed(const Duration(milliseconds: 2), createIntFuture)
+      .then((x) {
+    Expect.equals(499, x);
+    asyncEnd();
+  });
+}
+
+microtask() {
+  asyncStart();
+  new Future<int>.microtask(createIntFuture)
+      .then((x) {
+    Expect.equals(499, x);
+    asyncEnd();
+  });
+}
+
+sync() {
+  asyncStart();
+  new Future<int>.sync(createIntFuture)
+      .then((x) {
+    Expect.equals(499, x);
+    asyncEnd();
+  });
+}
+
+main() {
+  asyncStart();
+  // Test that all the Future constructors take functions that return a Future
+  // as argument.
+  // In particular the constructors must not type their argument as
+  // `T computation()`.
+  unnamed();
+  delayed();
+  microtask();
+  sync();
+  asyncEnd();
+}
diff --git a/tests/lib/async/stream_controller_test.dart b/tests/lib/async/stream_controller_test.dart
index c9ef021..afc7bb5 100644
--- a/tests/lib/async/stream_controller_test.dart
+++ b/tests/lib/async/stream_controller_test.dart
@@ -729,10 +729,25 @@
   var stream = controller.stream;
   var state = initial;
 
-  controller..onListen = () { state = running; }
-            ..onPause  = () { state = paused; }
-            ..onResume = () { state = running; }
-            ..onCancel = () { state = canceled; };
+  var onListen = () { state = running; };
+  var onPause  = () { state = paused; };
+  var onResume = () { state = running; };
+  var onCancel = () { state = canceled; };
+
+  Expect.isNull(controller.onListen);
+  Expect.isNull(controller.onPause);
+  Expect.isNull(controller.onResume);
+  Expect.isNull(controller.onCancel);
+
+  controller..onListen = onListen
+            ..onPause  = onPause
+            ..onResume = onResume
+            ..onCancel = onCancel;
+
+  Expect.equals(onListen, controller.onListen);
+  Expect.equals(onPause,  controller.onPause);
+  Expect.equals(onResume, controller.onResume);
+  Expect.equals(onCancel, controller.onCancel);
 
   Expect.equals(initial, state);
   var sub = stream.listen(null);
@@ -744,11 +759,20 @@
   Expect.equals(running, state);
   Expect.isFalse(controller.isPaused);
 
+  var onListen2 = () { state = -running; };
+  var onPause2  = () { state = -paused; };
+  var onResume2 = () { state = -running; };
+  var onCancel2 = () { state = -canceled; };
   // Changing them later does make a difference.
-  controller..onListen = () { throw "Second listen?"; }
-            ..onPause  = () { state = -paused; }
-            ..onResume = () { state = -running; }
-            ..onCancel = () { state = -canceled; };
+  controller..onListen = onListen2
+            ..onPause  = onPause2
+            ..onResume = onResume2
+            ..onCancel = onCancel2;
+
+  Expect.equals(onListen2, controller.onListen);
+  Expect.equals(onPause2,  controller.onPause);
+  Expect.equals(onResume2, controller.onResume);
+  Expect.equals(onCancel2, controller.onCancel);
 
   Expect.equals(running, state);
   sub.pause();
@@ -773,28 +797,36 @@
   Expect.isFalse(controller.hasListener);
   Expect.isTrue(controller.isPaused);
 
+  Expect.isNotNull(controller.onListen);
   controller.onListen = null;
+  Expect.isNull(controller.onListen);
 
   var sub = stream.listen(null);
 
   Expect.isTrue(controller.hasListener);
   Expect.isFalse(controller.isPaused);
 
+  Expect.isNotNull(controller.onPause);
   controller.onPause = null;
+  Expect.isNull(controller.onPause);
 
   sub.pause();
 
   Expect.isTrue(controller.hasListener);
   Expect.isTrue(controller.isPaused);
 
+  Expect.isNotNull(controller.onResume);
   controller.onResume = null;
+  Expect.isNull(controller.onResume);
 
   sub.resume();
 
   Expect.isTrue(controller.hasListener);
   Expect.isFalse(controller.isPaused);
 
+  Expect.isNotNull(controller.onCancel);
   controller.onCancel = null;
+  Expect.isNull(controller.onCancel);
 
   sub.cancel();
 
diff --git a/tests/lib/async/stream_subscription_as_future_test.dart b/tests/lib/async/stream_subscription_as_future_test.dart
index ef868e2..ac1293b 100644
--- a/tests/lib/async/stream_subscription_as_future_test.dart
+++ b/tests/lib/async/stream_subscription_as_future_test.dart
@@ -40,6 +40,18 @@
     }));
   });
 
+  test("subscription.asStream different type", () {
+    Stream stream = new Stream<int>.fromIterable([1, 2, 3]);
+    var asyncCallback = expectAsync(() => {});
+    var output = [];
+    var subscription = stream.listen((x) { output.add(x); });
+    subscription.asFuture("string").then((String o) {
+      Expect.listEquals([1, 2, 3], output);
+      Expect.equals("string", o);
+      asyncCallback();
+    });
+  });
+
   test("subscription.asStream failure", () {
     StreamController controller = new StreamController(sync: true);
     [1, 2, 3].forEach(controller.add);
diff --git a/tests/lib/async/wait_for_cancel_test.dart b/tests/lib/async/wait_for_cancel_test.dart
new file mode 100644
index 0000000..7c40084
--- /dev/null
+++ b/tests/lib/async/wait_for_cancel_test.dart
@@ -0,0 +1,25 @@
+// 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 "package:expect/expect.dart";
+import "package:async_helper/async_helper.dart";
+
+main() {
+  asyncStart();
+
+  bool waitedForCancel = false;
+
+  var controller = new StreamController(
+      onCancel: () => new Future(() => waitedForCancel = true));
+  var sub = controller.stream.take(1).listen((x) {
+    Expect.fail("onData should not be called");
+  });
+  var cancelFuture = sub.cancel();
+  Expect.isNotNull(cancelFuture);
+  cancelFuture.then((_) {
+    Expect.isTrue(waitedForCancel);
+    asyncEnd();
+  });
+}
diff --git a/tests/lib/convert/base64_test.dart b/tests/lib/convert/base64_test.dart
new file mode 100644
index 0000000..ccbed3d
--- /dev/null
+++ b/tests/lib/convert/base64_test.dart
@@ -0,0 +1,238 @@
+// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'dart:convert';
+import "dart:typed_data";
+import "package:expect/expect.dart";
+
+main() {
+  for (var list in [[],
+                    [0x00],
+                    [0xff, 0x00],
+                    [0xff, 0xaa, 0x55],
+                    [0x00, 0x01, 0x02, 0x03],
+                    new Iterable.generate(13).toList(),
+                    new Iterable.generate(254).toList(),
+                    new Iterable.generate(255).toList(),
+                    new Iterable.generate(256).toList()]) {
+    testRoundtrip(list, "List#${list.length}");
+    testRoundtrip(new Uint8List.fromList(list), "Uint8List#${list.length}");
+  }
+  testErrors();
+
+  // Decoder is lenienet with mixed styles.
+  Expect.listEquals([0xfb, 0xff, 0xbf, 0x00], BASE64.decode("-_+/AA%3D="));
+  Expect.listEquals([0xfb, 0xff, 0xbf, 0x00], BASE64.decode("-_+/AA=%3D"));
+}
+
+void testRoundtrip(list, name) {
+  // Direct.
+  String encodedNormal = BASE64.encode(list);
+  String encodedPercent = encodedNormal.replaceAll("=", "%3D");
+  String uriEncoded = encodedNormal.replaceAll("+", "-").replaceAll("/", "_");
+  List result = BASE64.decode(encodedNormal);
+  Expect.listEquals(list, result, name);
+  result = BASE64.decode(encodedPercent);
+  Expect.listEquals(list, result, name);
+
+  int increment = list.length ~/ 7 + 1;
+  // Chunked.
+  for (int i = 0; i < list.length; i += increment) {
+    for (int j = i; j < list.length; j += increment) {
+      {
+        // Using add/close
+        var results;
+        var sink = new ChunkedConversionSink.withCallback((v) { results = v; });
+        var encoder = BASE64.encoder.startChunkedConversion(sink);
+        encoder.add(list.sublist(0, i));
+        encoder.add(list.sublist(i, j));
+        encoder.add(list.sublist(j, list.length));
+        encoder.close();
+        var name = "0-$i-$j-${list.length}: list";
+        Expect.equals(encodedNormal, results.join(""), name);
+      }
+      {
+        // Using addSlice
+        var results;
+        var sink = new ChunkedConversionSink.withCallback((v) { results = v; });
+        var encoder = BASE64.encoder.startChunkedConversion(sink);
+        encoder.addSlice(list, 0, i, false);
+        encoder.addSlice(list, i, j, false);
+        encoder.addSlice(list, j, list.length, true);
+        var name = "0-$i-$j-${list.length}: $list";
+        Expect.equals(encodedNormal, results.join(""), name);
+      }
+    }
+  }
+
+  for (var encoded in [encodedNormal, encodedPercent, uriEncoded]) {
+    increment = encoded.length ~/ 7 + 1;
+    for (int i = 0; i < encoded.length; i += increment) {
+      for (int j = i; j < encoded.length; j += increment) {
+        {
+          // Using add/close
+          var results;
+          var sink =
+              new ChunkedConversionSink.withCallback((v) { results = v; });
+          var decoder = BASE64.decoder.startChunkedConversion(sink);
+          decoder.add(encoded.substring(0, i));
+          decoder.add(encoded.substring(i, j));
+          decoder.add(encoded.substring(j, encoded.length));
+          decoder.close();
+          var name = "0-$i-$j-${encoded.length}: $encoded";
+          Expect.listEquals(list, results.expand((x)=>x).toList(), name);
+        }
+        {
+          // Using addSlice
+          var results;
+          var sink =
+              new ChunkedConversionSink.withCallback((v) { results = v; });
+          var decoder = BASE64.decoder.startChunkedConversion(sink);
+          decoder.addSlice(encoded, 0, i, false);
+          decoder.addSlice(encoded, i, j, false);
+          decoder.addSlice(encoded, j, encoded.length, true);
+          var name = "0-$i-$j-${encoded.length}: $encoded";
+          Expect.listEquals(list, results.expand((x)=>x).toList(), name);
+        }
+      }
+    }
+  }
+}
+
+bool isFormatException(e) => e is FormatException;
+bool isArgumentError(e) => e is ArgumentError;
+
+void testErrors() {
+  void badChunkDecode(List<String> list) {
+    Expect.throws(() {
+      var sink = new ChunkedConversionSink.withCallback((v) {
+        Expect.fail("Should have thrown: chunk $list");
+      });
+      var c = BASE64.decoder.startChunkedConversion(sink);
+      for (String string in list) {
+        c.add(string);
+      }
+      c.close();
+    }, isFormatException, "chunk $list");
+  }
+  void badDecode(String string) {
+    Expect.throws(() => BASE64.decode(string), isFormatException, string);
+    badChunkDecode([string]);
+    badChunkDecode(["", string]);
+    badChunkDecode([string, ""]);
+    badChunkDecode([string, "", ""]);
+    badChunkDecode(["", string, ""]);
+  }
+
+  badDecode("A");
+  badDecode("AA");
+  badDecode("AAA");
+  badDecode("AAAAA");
+  badDecode("AAAAAA");
+  badDecode("AAAAAAA");
+  badDecode("AAAA=");
+  badDecode("AAAA==");
+  badDecode("AAAA===");
+  badDecode("AAAA====");
+  badDecode("AAAA%");
+  badDecode("AAAA%3");
+  badDecode("AAAA%3D");
+  badDecode("AAA%3D%");
+  badDecode("AAA%3D=");
+  badDecode("A=");
+  badDecode("A=A");
+  badDecode("A==");
+  badDecode("A==A");
+  badDecode("A===");
+  badDecode("====");
+  badDecode("AA=");
+  badDecode("AA%=");
+  badDecode("AA%3");
+  badDecode("AA%3D");
+  badDecode("AA===");
+  badDecode("AAA==");
+  badDecode("AAA=AAAA");
+  badDecode("AAA\x00");
+  badDecode("AAA=\x00");
+  badDecode("AAA\x80");
+  badDecode("AAA\xFF");
+  badDecode("AAA\u{141}");
+  badDecode("AAA\u{1041}");
+  badDecode("AAA\u{10041}");
+  badDecode("AA\u{141}=");
+  badDecode("AA\u{1041}=");
+  badDecode("AA\u{10041}=");
+
+  var alphabet =
+    "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz+/-_";
+  var units = alphabet.codeUnits;
+  for (int i = 0; i < 128; i++) {
+    if (!units.contains(i)) {
+      badDecode(new String.fromCharCode(i) * 4);
+    }
+  }
+
+  badChunkDecode(["A", "A"]);
+  badChunkDecode(["A", "A", "A"]);
+  badChunkDecode(["A", "A", "="]);
+  badChunkDecode(["A", "A", "=", ""]);
+  badChunkDecode(["A", "A", "=", "=", "="]);
+  badChunkDecode(["AAA", "=="]);
+  badChunkDecode(["A", "A", "A"]);
+  badChunkDecode(["AAA", ""]);
+  badChunkDecode(["AA=", ""]);
+  badChunkDecode(["AB==", ""]);
+
+
+  badChunkEncode(list) {
+    for (int i = 0; i < list.length; i++) {
+      for (int j = 0; j < list.length; j++) {
+        Expect.throws(() {
+          var sink = new ChunkedConversionSink.withCallback((v) {
+            Expect.fail("Should have thrown: chunked $list");
+          });
+          var c = BASE64.encoder.startChunkedConversion(sink);
+          c.add(list.sublist(0, i));
+          c.add(list.sublist(i, j));
+          c.add(list.sublist(j, list.length));
+          c.close();
+        }, isArgumentError, "chunk $list");
+      }
+    }
+    for (int i = 0; i < list.length; i++) {
+      for (int j = 0; j < list.length; j++) {
+        Expect.throws(() {
+          var sink = new ChunkedConversionSink.withCallback((v) {
+            Expect.fail("Should have thrown: chunked $list");
+          });
+          var c = BASE64.encoder.startChunkedConversion(sink);
+          c.addSlice(list, 0, i, false);
+          c.addSlice(list, i, j, false);
+          c.addSlice(list, j, list.length, true);
+        }, isArgumentError, "chunk $list");
+      }
+    }
+  }
+
+  void badEncode(int invalid) {
+    Expect.throws(() {
+      BASE64.encode([invalid]);
+    }, isArgumentError, "$invalid");
+    Expect.throws(() {
+      BASE64.encode([0, invalid, 0]);
+    }, isArgumentError, "$invalid");
+    badChunkEncode([invalid]);
+    badChunkEncode([0, invalid]);
+    badChunkEncode([0, 0, invalid]);
+    badChunkEncode([0, invalid, 0]);
+    badChunkEncode([invalid, 0, 0]);
+  }
+
+  badEncode(-1);
+  badEncode(0x100);
+  badEncode(0x1000);
+  badEncode(0x10000);
+  badEncode(0x100000000);          /// 01: ok
+  badEncode(0x10000000000000000);  /// 01: continued
+}
diff --git a/tests/lib/convert/line_splitter_test.dart b/tests/lib/convert/line_splitter_test.dart
index d9956e0..5e240a9 100644
--- a/tests/lib/convert/line_splitter_test.dart
+++ b/tests/lib/convert/line_splitter_test.dart
@@ -9,6 +9,8 @@
 import 'dart:math' as MATH;
 
 
+const lineTerminators = const ['\n', '\r', '\r\n'];
+
 void main() {
   testSimpleConvert();
   testSplit();
@@ -20,18 +22,16 @@
 }
 
 void testManyLines() {
-  const breaks = const ['\n', '\r\n'];
   int breakIndex = 0;
 
   var inputs = const ['line1', 'line2', 'long line 3', ' line 4 ', 'l5'];
 
-
   var buffer = inputs.fold(new StringBuffer(), (buff, e) {
     buff.write(e);
-    buff.write(breaks[breakIndex]);
+    buff.write(lineTerminators[breakIndex]);
 
     breakIndex++;
-    breakIndex = breakIndex % breaks.length;
+    breakIndex = breakIndex % lineTerminators.length;
 
     return buff;
   });
@@ -62,22 +62,18 @@
 }
 
 void testSimpleConvert() {
-  var test = """line1
-line2
-line3""";
-
-
   var decoder = new LineSplitter();
+  for (var lf in lineTerminators) {
+    var test = "line1${lf}line2${lf}line3";
+
+    var result = decoder.convert(test);
+
+    Expect.listEquals(['line1', 'line2', 'line3'], result);
+  }
+
+  var test = "Line1\nLine2\r\nLine3\rLine4\n\n\n\r\n\r\n\r\r";
   var result = decoder.convert(test);
 
-  Expect.listEquals(['line1', 'line2', 'line3'], result);
-
-  test = "Line1\nLine2\r\nLine3\rLi"
-      "ne4\n"
-       "\n\n\r\n\r\n\r\r";
-
-  result = decoder.convert(test);
-
   Expect.listEquals(
       ['Line1', 'Line2', 'Line3', 'Line4', '', '', '', '', '', ''],
       result);
@@ -142,51 +138,45 @@
 
 
 void testSplit() {
-  var test = """line1
-line2
-line3""";
+  for (var lf in lineTerminators) {
+    var test = "line1${lf}line2${lf}line3";
+    var result = LineSplitter.split(test).toList();
+    Expect.listEquals(['line1', 'line2', 'line3'], result);
+  }
 
-
+  var test = "Line1\nLine2\r\nLine3\rLine4\n\n\n\r\n\r\n\r\r";
   var result = LineSplitter.split(test).toList();
 
-  Expect.listEquals(['line1', 'line2', 'line3'], result);
-
-  test = "Line1\nLine2\r\nLine3\rLi"
-      "ne4\n"
-       "\n\n\r\n\r\n\r\r";
-
-  result = LineSplitter.split(test).toList();
-
   Expect.listEquals(
       ['Line1', 'Line2', 'Line3', 'Line4', '', '', '', '', '', ''],
       result);
 }
 
 void testSplitWithOffsets() {
-  var test = """line1
-line2
-line3""";
+  for (var lf in lineTerminators) {
+    var test = "line1${lf}line2${lf}line3";
+    var i2 = 5 + lf.length;  // index of "line2".
+    Expect.equals(5 + lf.length, i2);
 
-  var result = LineSplitter.split(test, 4).toList();
-  Expect.listEquals(['1', 'line2', 'line3'], result);
+    var result = LineSplitter.split(test, 4).toList();
+    Expect.listEquals(['1', 'line2', 'line3'], result);
 
-  result = LineSplitter.split(test, 5).toList();
-  Expect.listEquals(['', 'line2', 'line3'], result);
+    result = LineSplitter.split(test, 5).toList();
+    Expect.listEquals(['', 'line2', 'line3'], result);
 
-  result = LineSplitter.split(test, 6).toList();
-  Expect.listEquals(['line2', 'line3'], result);
+    result = LineSplitter.split(test, i2).toList();
+    Expect.listEquals(['line2', 'line3'], result);
 
-  result = LineSplitter.split(test, 0, 8).toList();
-  Expect.listEquals(['line1', 'li'], result);
+    result = LineSplitter.split(test, 0, i2 + 2).toList();
+    Expect.listEquals(['line1', 'li'], result);
 
-  result = LineSplitter.split(test, 6, 11).toList();
-  Expect.listEquals(['line2'], result);
+    result = LineSplitter.split(test, i2, i2 + 5).toList();
+    Expect.listEquals(['line2'], result);
+  }
 
-  test = "Line1\nLine2\r\nLine3\rLi"
-      "ne4\n"
-       "\n\n\r\n\r\n\r\r";
+  var test = "Line1\nLine2\r\nLine3\rLine4\n\n\n\r\n\r\n\r\r";
 
-  result = LineSplitter.split(test).toList();
+  var result = LineSplitter.split(test).toList();
 
   Expect.listEquals(
       ['Line1', 'Line2', 'Line3', 'Line4', '', '', '', '', '', ''],
diff --git a/tests/lib/lib.status b/tests/lib/lib.status
index 5e6a2b9..00412af 100644
--- a/tests/lib/lib.status
+++ b/tests/lib/lib.status
@@ -170,6 +170,7 @@
 async/stream_asyncmap_test: RuntimeError # Timer interface not supported: Issue 7728.
 async/stream_transformation_broadcast_test: RuntimeError # Timer interface not supported: Issue 7728.
 async/stream_controller_test: Fail # Timer interface not supported: Issue 7728.
+async/future_constructor2_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 ]
@@ -179,6 +180,7 @@
 [ $compiler == dart2js ]
 convert/chunked_conversion_utf88_test: Slow, Pass
 convert/utf85_test: Slow, Pass
+convert/base64_test/01: Fail, OK # Uses bit-wise operations to detect invalid values. Some large invalid values accepted by dart2js.
 mirrors/globalized_closures_test/00: RuntimeError # Issue 17118. Please remove the multi-test comments when this test starts succeeding.
 mirrors/globalized_closures2_test/00: RuntimeError # Issue 17118. Please remove the multi-test comments when this test starts succeeding.
 
@@ -255,6 +257,9 @@
 async/multiple_timer_test: Fail, Pass # See Issue 10982
 async/timer_test: Fail, Pass # See Issue 10982
 
+[ $compiler == none && $runtime == drt && $checked ]
+async/slow_consumer_test: Fail, Pass # Dartium JsInterop failure, dartbug.com/24460
+
 [$compiler == none && $runtime == ContentShellOnAndroid ]
 async/stream_timeout_test: RuntimeError, Pass # Issue 19127
 async/slow_consumer3_test: SkipSlow # Times out flakily. Issue 20956
@@ -331,239 +336,23 @@
 mirrors/immutable_collections_test: SkipSlow  # Timeout.
 convert/streamed_conversion_json_utf8_decode_test: Skip  # Timeout.
 
-[ $compiler == dart2js && $system == windows && $runtime == chrome ]
-convert/line_splitter_test: RuntimeError
-
-[ $compiler == dart2js && $system == windows && $runtime == ff ]
-convert/line_splitter_test: RuntimeError
-
 [ $compiler == dart2js && $cps_ir ]
-async/future_test/01: Crash # (()async=>new Future.value(value)): cannot handle async/sync*/async* functions
-async/stream_empty_test: Crash # (Future runTest()asy...  cannot handle async/sync*/async* functions
-async/stream_iterator_test: Crash # (()async{var stream=...  cannot handle async/sync*/async* functions
-convert/ascii_test: RuntimeError # this.get$length is not a function
-convert/json_pretty_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-convert/latin1_test: RuntimeError # this.get$length is not a function
-convert/line_splitter_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/abstract_class_test/00: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/abstract_class_test/none: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/abstract_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/accessor_cache_overflow_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/array_tracing2_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/array_tracing_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/basic_types_in_dart_core_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/circular_factory_redirection_test/none: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/class_declarations_test/01: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/class_declarations_test/none: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/class_mirror_location_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/class_mirror_type_variables_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/closures_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/closurization_equivalence_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/constructor_kinds_test/01: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/constructor_kinds_test/none: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/constructors_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/dart2js_mirrors_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/declarations_type_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/deferred_mirrors_metadata_test: Crash # (lib1.foo()): deferred access is not implemented
-mirrors/deferred_mirrors_metatarget_test: Crash # (lib.foo()): deferred access is not implemented
-mirrors/deferred_mirrors_update_test: Crash # (l.foo()): deferred access is not implemented
-mirrors/deferred_type_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
+async/async_await_zones_test: Crash # (await for(var x in bar().take(100)){sum+= x;}): await for
+async/stream_empty_test: RuntimeError # $async$temp1.runTest_unreachable is not a function
+async/stream_iterator_test: Crash # (Stream createCancel...  cannot handle sync*/async* functions
+convert/json_pretty_test: RuntimeError # Please triage this failure.
+convert/line_splitter_test: RuntimeError # Please triage this failure.
+mirrors/deferred_mirrors_metadata_test: RuntimeError # U.loadLibrary is not a function
+mirrors/deferred_mirrors_metatarget_test: RuntimeError # X.loadLibrary is not a function
+mirrors/deferred_mirrors_update_test: RuntimeError # U.loadLibrary is not a function
 mirrors/delegate_call_through_getter_test: RuntimeError # Please triage this failure.
 mirrors/delegate_test: RuntimeError # Please triage this failure.
-mirrors/disable_tree_shaking_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/empty_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/enum_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/equality_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/fake_function_with_call_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/fake_function_without_call_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/field_type_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/function_type_mirror_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/generic_bounded_by_type_parameter_test/01: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/generic_bounded_by_type_parameter_test/02: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/generic_bounded_by_type_parameter_test/none: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/generic_bounded_test/01: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/generic_bounded_test/02: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/generic_bounded_test/none: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/generic_class_declaration_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/generic_f_bounded_mixin_application_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/generic_f_bounded_test/01: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/generic_f_bounded_test/none: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/generic_function_typedef_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/generic_interface_test/01: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/generic_interface_test/none: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/generic_list_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/generic_local_function_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/generic_mixin_applications_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/generic_mixin_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/generic_superclass_test/01: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/generic_superclass_test/none: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/generic_type_mirror_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/generics_double_substitution_test/01: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/generics_double_substitution_test/none: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/generics_dynamic_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/generics_special_types_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/generics_substitution_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/generics_test/01: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/generics_test/none: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/globalized_closures2_test/00: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/globalized_closures2_test/none: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/globalized_closures_test/00: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/globalized_closures_test/none: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/hierarchy_invariants_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/immutable_collections_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/inherit_field_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/initializing_formals_test/01: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/initializing_formals_test/none: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/instance_members_easier_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/instance_members_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/instance_members_unimplemented_interface_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/instance_members_with_override_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/instantiate_abstract_class_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/intercepted_cache_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/intercepted_class_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/intercepted_object_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/intercepted_superclass_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/invocation_fuzz_test/emptyarray: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/invocation_fuzz_test/false: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/invocation_fuzz_test/none: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/invocation_fuzz_test/smi: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/invocation_fuzz_test/string: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/invoke_call_on_closure_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/invoke_call_through_getter_previously_accessed_test/named: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/invoke_call_through_getter_previously_accessed_test/none: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/invoke_call_through_getter_test/named: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/invoke_call_through_getter_test/none: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/invoke_call_through_implicit_getter_previously_accessed_test/named: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/invoke_call_through_implicit_getter_previously_accessed_test/none: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/invoke_call_through_implicit_getter_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/invoke_closurization2_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/invoke_closurization_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/invoke_import_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/invoke_named_test/01: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/invoke_named_test/none: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/invoke_natives_malicious_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/invoke_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/invoke_throws_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/is_odd_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/lazy_static_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/libraries_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/library_declarations_test/01: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/library_declarations_test/none: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/library_enumeration_deferred_loading_test: Crash # (other.topLevelMethod()): deferred access is not implemented
-mirrors/library_exports_hidden_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/library_exports_shown_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/library_import_deferred_loading_test: Crash # (other.topLevelMethod()): deferred access is not implemented
-mirrors/library_imports_bad_metadata_test/none: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/library_imports_deferred_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/library_imports_hidden_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/library_imports_metadata_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/library_imports_prefixed_show_hide_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/library_imports_prefixed_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/library_imports_shown_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/library_metadata2_test/none: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/library_metadata_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/library_uri_package_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/list_constructor_test/01: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/list_constructor_test/none: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/load_library_test: Crash # (other.topLevelMethod()): deferred access is not implemented
-mirrors/local_function_is_static_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/local_isolate_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/metadata_allowed_values_test/01: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/metadata_allowed_values_test/05: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/metadata_allowed_values_test/10: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/metadata_allowed_values_test/11: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/metadata_allowed_values_test/13: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/metadata_allowed_values_test/14: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/metadata_allowed_values_test/none: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/metadata_class_mirror_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/metadata_constructed_constant_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/metadata_constructor_arguments_test/none: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/metadata_nested_constructor_call_test/none: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/metadata_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/method_mirror_location_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/method_mirror_name_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/method_mirror_properties_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/method_mirror_returntype_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/method_mirror_source_line_ending_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/method_mirror_source_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/mirror_in_static_init_test/none: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/mirrors_nsm_mismatch_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/mirrors_nsm_test/dart2js: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/mirrors_nsm_test/none: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/mirrors_reader_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/mirrors_resolve_fields_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/mirrors_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/mixin_application_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/mixin_members_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/mixin_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/native_class_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/new_instance_with_type_arguments_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/no_metadata_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/null2_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/null_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/operator_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/parameter_is_const_test/none: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/parameter_metadata_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/parameter_of_mixin_app_constructor_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/private_symbol_mangling_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/private_types_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/proxy_type_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/raw_type_test/01: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/raw_type_test/none: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/redirecting_factory_test/01: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/redirecting_factory_test/02: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/redirecting_factory_test/none: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/reflect_class_test/01: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/reflect_class_test/02: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/reflect_class_test/none: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/reflect_model_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/reflect_runtime_type_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/reflect_uninstantiated_class_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/reflected_type_classes_test/01: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/reflected_type_classes_test/02: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/reflected_type_classes_test/03: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/reflected_type_classes_test/none: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/reflected_type_function_type_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/reflected_type_special_types_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/reflected_type_test/01: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/reflected_type_test/02: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/reflected_type_test/03: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/reflected_type_test/none: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/reflected_type_typedefs_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/reflected_type_typevars_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/reflectively_instantiate_uninstantiated_class_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/regress_14304_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/regress_16321_test/01: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/regress_16321_test/none: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/regress_19731_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/relation_assignable_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/relation_subclass_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/relation_subtype_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/removed_api_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/repeated_private_anon_mixin_app_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/set_field_with_final_inheritance_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/set_field_with_final_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/spawn_function_root_library_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/static_members_easier_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/static_members_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/static_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/superclass2_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/superclass_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/symbol_validation_test/01: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
+mirrors/library_enumeration_deferred_loading_test: RuntimeError # L.loadLibrary is not a function
 mirrors/symbol_validation_test/none: RuntimeError # Please triage this failure.
-mirrors/syntax_error_test/none: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/synthetic_accessor_properties_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/to_string_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/top_level_accessors_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/type_argument_is_type_variable_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/type_variable_is_static_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/type_variable_owner_test/01: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/type_variable_owner_test/none: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/typearguments_mirror_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
 mirrors/typedef_deferred_library_test: RuntimeError # G.loadLibrary is not a function
-mirrors/typedef_metadata_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/typedef_reflected_type_test/01: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/typedef_reflected_type_test/none: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/unnamed_library_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-mirrors/variable_is_const_test/none: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-typed_data/typed_data_list_test: RuntimeError # this.get$length is not a function
+
+[ $compiler == dart2js && $cps_ir && $host_checked ]
+mirrors/circular_factory_redirection_test/02: Crash # Assertion failure: Constant constructor already computed for generative_constructor(A#circular2)
+mirrors/mirrors_used_typedef_declaration_test/01: Crash # Assertion failure: typedef(Foo) has not been checked for cycles.
+mirrors/mirrors_used_typedef_declaration_test/none: Crash # Assertion failure: typedef(Foo) has not been checked for cycles.
+mirrors/typedef_library_test: Crash # Assertion failure: typedef(G) has not been checked for cycles.
diff --git a/tests/lib/mirrors/function_apply_mirrors_lib.dart b/tests/lib/mirrors/function_apply_mirrors_lib.dart
new file mode 100644
index 0000000..e94a55a
--- /dev/null
+++ b/tests/lib/mirrors/function_apply_mirrors_lib.dart
@@ -0,0 +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.
+
+library function_apply_mirrors_lib;
+
+@MirrorsUsed(targets: "function_apply_mirrors_lib")
+import "dart:mirrors";
+
+bar() => reflect(499).reflectee;
diff --git a/tests/lib/mirrors/function_apply_mirrors_test.dart b/tests/lib/mirrors/function_apply_mirrors_test.dart
new file mode 100644
index 0000000..81d3b9e
--- /dev/null
+++ b/tests/lib/mirrors/function_apply_mirrors_test.dart
@@ -0,0 +1,21 @@
+// 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.
+
+// Only 'lib' imports mirrors.
+// Function.apply is resolved, before it is known that mirrors are used.
+// Dart2js has different implementations of Function.apply for different
+// emitters (like --fast-startup). Dart2js must not switch the resolved
+// Function.apply when it discovers the use of mirrors.
+// In particular it must not switch from the fast-startup emitter to the full
+// emitter without updating the Function.apply reference.
+import 'function_apply_mirrors_lib.dart' as lib;
+
+import "package:expect/expect.dart";
+
+int foo({x: 499, y: 42}) => x + y;
+
+main() {
+  Expect.equals(709, Function.apply(foo, [], {#y: 210}));
+  Expect.equals(499, lib.bar());
+}
diff --git a/tests/lib/mirrors/invocation_fuzz_test.dart b/tests/lib/mirrors/invocation_fuzz_test.dart
index 7a43d3cbb..8add257 100644
--- a/tests/lib/mirrors/invocation_fuzz_test.dart
+++ b/tests/lib/mirrors/invocation_fuzz_test.dart
@@ -41,6 +41,12 @@
   'dart.io.SystemEncoding.decode',  // Windows only
   'dart.io.SystemEncoding.encode',  // Windows only
 
+  // These construct an object with an uninitialized native field.
+  // TODO(23869): We could make this safer, but making the failure non-fatal
+  //   would we worthless aside from this test.
+  'dart.io.X509Certificate.X509Certificate._',
+  'dart.io._X509Impl._X509Impl',
+
   // Don't call private methods in dart.async as they may circumvent the zoned
   // error handling below.
   new RegExp(r"^dart\.async\._.*$"),
diff --git a/tests/standalone/full_coverage_test.dart b/tests/standalone/full_coverage_test.dart
index 2ee1979..9eab81d 100644
--- a/tests/standalone/full_coverage_test.dart
+++ b/tests/standalone/full_coverage_test.dart
@@ -49,8 +49,8 @@
   }
 }
 ''',
-    'expectedHits': [-1, 0, 0, -1, -1, -1, -1, -1, 1, 1, -1, -1, -1, -1, 1, -1,
-                     0, -1, 1, -1, -1]
+    'expectedHits': [-1, 0, 0, -1, -1, -1, -1, -1, 1, 1, -1, -1, -1, -1, -1,
+                     -1, 0, -1, 1, -1, -1]
   },{
     'name': 'closures',
     'program': '''
@@ -64,7 +64,7 @@
   });
 }
 ''',
-    'expectedHits': [1, -1, 1, -1, -1, 1, 1, -1, -1]
+    'expectedHits': [-1, -1, 1, -1, -1, 1, 1, -1, -1]
   }
 ];
 
diff --git a/tests/standalone/io/certificates/README b/tests/standalone/io/certificates/README
new file mode 100644
index 0000000..1268432
--- /dev/null
+++ b/tests/standalone/io/certificates/README
@@ -0,0 +1,34 @@
+    This directory, tests/standalone/io/certificates, contains the
+X509 TLS certificates and private keys needed to run tests of Dart's
+secure networking code.  The SecureSocket and SecureServer classes
+are tested by making TLS (formerly called SSL) connections, secured
+by certificates from a self-signed test root authority.
+
+The certificates are created by running ../create_sample_certificates.sh
+in a bash or sh shell, with the openssl tools installed.  Run the script
+twice to create the untrusted_* files.
+
+server_chain.pem:
+  Contains the chain of certificates, from the self-signed
+test certificate authority, through the intermediate CA, to the server
+certificate, used on the server side of a test connection.
+
+server_key.pem:
+  Contains the private key for the server certificate
+
+trusted_certs.pem:
+  Contains the self-signed certificate of the test certificate authority.
+This certificate is set as "trusted" by the client side of the connection
+in its SecurityContext object, so that a verified TLS connection to the
+server can be made.
+
+untrusted_server_chain.pem:
+  Contains a chain of certificates, from a different self-signed
+test certificate authority, through an intermediate CA, to a server
+certificate, used on the server side of a test connection that is intended
+to fail because the client does not accept this certificate authority
+
+untrusted_server_key.pem:
+  Contains the private key for the untrusted server certificate 
+in untrusted_server_chain.pem
+
diff --git a/tests/standalone/io/certificates/client1.pem b/tests/standalone/io/certificates/client1.pem
new file mode 100644
index 0000000..429cd72
--- /dev/null
+++ b/tests/standalone/io/certificates/client1.pem
@@ -0,0 +1,19 @@
+-----BEGIN CERTIFICATE-----
+MIIDBzCCAe+gAwIBAgIBAjANBgkqhkiG9w0BAQsFADAaMRgwFgYDVQQDEw9jbGll
+bnRhdXRob3JpdHkwHhcNMTUxMDI3MTAyNjM1WhcNMjUxMDI0MTAyNjM1WjAQMQ4w
+DAYDVQQDDAV1c2VyMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALlg
+zRZlohMtAg44+kPk04G/gIkdeyh7toUA3nR/2sS11j8EutHewezvMV8YyxBxQn8f
+8x8FkDbrE/6GYg2Dsu6TxrXIFre9Lt5jLlJi/6qEaVtXNTdP3vKO87FJ7YVLCeYe
+MxuTCdHloeUICP5x3GJz3AVdcg/S9qRWrpm8LdRdFk66l8vD+aDf+Oqe+mLVtAr6
+kqkdq1nUJOkRBp+zFMmB3Zfm28aYew6BmFQSscxemZyJxiv4dB+EDr821kEjgGBY
+IQGpdADrfh3j9JAzEr30o6sjfr6QWKHG6ZD7xhSl7rIxmx1yoKoJh8vLpcQfdv79
+7VZZT5N7xjz0xkjqTA0CAwEAAaNiMGAwCQYDVR0TBAIwADAdBgNVHQ4EFgQUMpcX
+0o3lu3BTmaKwCfIJMO5aMs4wHwYDVR0jBBgwFoAUtyLBueMoMi7TborRvM7CnwOi
+SQ4wEwYDVR0lBAwwCgYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBAAB1rNFg
+wdK79r7WO0OvE90uvtFf8sO2kqwW/7JIP/kcnIwIIkNiffUEfLfVr7aecK0rPer4
+DDZFAciuaOcts7dTxXRU+la1ZEPaEyx1mHaC6HJbgFYC9cG30L6GJGkZkIGOCTn+
+/yPxTM//dSc7YACc90GNTeUFVnAw6vskH91Ph4VYbdYxt7L1d1pzvBeun6Qi0eJq
+rkWQ2DOO9h9E6Rnt8Jea3w7WzX5P8pBjm74bv38YBKefawPeiiXck2Q/lUehLePV
+U1MRdy1QWC924+p6cXbR1GEhg0FZyvS/9WdpLMGIat/j/98juN6qyAbw7XXhlB1g
+fBHlfXbx+KMZAuY=
+-----END CERTIFICATE-----
diff --git a/tests/standalone/io/certificates/client1_key.pem b/tests/standalone/io/certificates/client1_key.pem
new file mode 100644
index 0000000..0e2ef5e
--- /dev/null
+++ b/tests/standalone/io/certificates/client1_key.pem
@@ -0,0 +1,29 @@
+-----BEGIN ENCRYPTED PRIVATE KEY-----
+MIIE4jAcBgoqhkiG9w0BDAEBMA4ECF4ZB27y60SWAgIIAASCBMCEL3ZCzfC0q+m+
+B8gM9jQe1JFRD5reAuwK6+3speBS4KE+wjbcyQq09/5UoQu3Dci1WG1nKLB1u0Bk
+w9NuRahWCpvVLzz/GQ6Psesixq3V69zD3N6iMl/XQKymQBwGK51xIkeJO+6Skh2d
++qoyBHINTlKY9+548Zgqu+Z3mI3pGmdhd7hCiamiffDwCLEqRxbXdZdLpC9GpAP5
+HOqXHzN2aZbAGHb1GkHVxskSNzAwlEEZhh4Ibe6o7U65hoL9borewT+gj6sQohI5
+/LHL0P2bVvtRZiwBVPUX8HZWuVYIFb6GEGTTqOofNhNHvHaKUlD8Uxi5/h/Xi8fq
+xpdkjIn7VXj9e+I3TkfiphDtk0+Q+f+UkuPyuzU1PafinPfRK1J6gk+ZqAQHW/sp
+g6GVr2r4PkOrBPsA6jmCnQhs2C4MlZyR2p65qjVutdkKU5NgftW+giK9shgglcza
+38RF8i01THOnD3j+2teM/t/Ziqb2PGWv/bmvhcYqt1aG186Pe3bBCxhh/L7bqNKD
+q7sxDmaDE2pTkfyvh07udarmBQc5gvfXYqwghbqP/n7wizqjeEJgAwwHyi8LLsFV
+XreBQ/8Z2gQwXurrh5WD+7KSgvgopW/oVC8a3++8Hmf5Nkj27lACzoDWTG2/Swah
+O1MmdtPyy/KCbf5ujt2BlXM9D206Rsr6hoO9UZ1s1ohRdJReVGc4NZ4XrVWc4TKT
+gUAFTaHIKgFe/DgLaQn8L8Pqb8B/JfoSgQ74r69S434Kc+EDKui8wnkgso5bqrr1
+M07H9Xo+OtG1D6rma2EUlpoU06CAIcyqNx5fHJ3xfk9GHScQi4U6vEDCAQTNTS65
+I5AOHthZ2kZzfXvP6TF39S5D37NrV7/WJu7ZFaJx3bUGwnS2HYTwjFPABHpVLMwJ
+nBylVJs+h7bCZdBNCWgTytcn1mYMCvXVmrW8VTwBRjUQsy4rgE2wjpZuIM9rx+gZ
+HtNvy5t2RlOSqVKapyvV0ll7qbT1lwGIePxjttiWmNbgbwRBQzjv6FZ1Yo331Fl4
+qgXGcvZWgsgQFPXviKmDx+9KJ2oL35cLnDcMCRN7lLPdAhk8J/XrUq/iIYXNxud6
+f9mfVOsd0LT030je/N25IdEoPimTnps/INGGNug+FuJ3dCeIQGwB7uQB5ozoHL5h
+hzdQYq5+FWksuHPCOL1YLRJux9sH6OYxlXy2oigLtA05EHhq83Wwb2oTW6boo+rs
+gKqzc7OtFgYDsV8R1raoqlzAv3GNgkzyuHTSUakDdnJYmfcoOuK+Ch+MjVeZW5bS
+Ir7uqugUqqI/AiO/eHkvoGpQs0c67ao0qPR7ZQna/1FBj1O8J/dI4JBUtPvDa0tW
+7U+Ja/twJWri+Nn6/iEEWEuM/xx/xFmxrTb4WYza1ysrCls5l6POjQu2n6dT52+o
+cobwltkJmSNoIT2SYRuvEfgGlwyzY5p5B8U24HIAkNJIkO7hc9oD1mbq+K526HNl
+h6TG7RGUOffXIYuykrMmCTRRnv3bXmjTgsvWhVFujpCSQf9PqkQpv+KQPeFmy12h
+TA1QNtdVOZlh2GLEUgZuJVytyEz4m+3BfvBql5K9rlAUSQqsLJDKVxsmBDl132o3
+yy9JR7iC
+-----END ENCRYPTED PRIVATE KEY-----
diff --git a/tests/standalone/io/certificates/client2.pem b/tests/standalone/io/certificates/client2.pem
new file mode 100644
index 0000000..f34bde4
--- /dev/null
+++ b/tests/standalone/io/certificates/client2.pem
@@ -0,0 +1,19 @@
+-----BEGIN CERTIFICATE-----
+MIIDBzCCAe+gAwIBAgIBAzANBgkqhkiG9w0BAQsFADAaMRgwFgYDVQQDEw9jbGll
+bnRhdXRob3JpdHkwHhcNMTUxMDI3MTAyNjM1WhcNMjUxMDI0MTAyNjM1WjAQMQ4w
+DAYDVQQDDAV1c2VyMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMay
+a0BYpNJHlwcNz6TyX+D6dKnqxUfdHQDgW9/5Hl4RiHDKAH+2iVYEsedksOmxNDlV
+HqZg4fBsyPVRzeGqia7nCsN3KlMbaqZgNI3ynvvMFIJkb3e/ZJtodg+cYzqnOu2F
+G3LijzRJG363aavTnjLdFumLnsOtSDdYnjRM43eeE3X2ajAiKkE9r6b6/wt8Ki5T
+GVIm9kG674iCloawK6dgCBA1dDPsKmzhcFoAl5UMpQSvd1OuW034qryE+RzQ0RCe
+G5u2leVgiuoq2rpmPL6fA0BHsyJ3wP1Gs74i+NhZdhiBhv+E89sfKaJOPpmDBW7b
+3jCpEmgRSm5h5SDm8KsCAwEAAaNiMGAwCQYDVR0TBAIwADAdBgNVHQ4EFgQUj0t8
+BdHrTqd7aKIV4+OLWvT6WX4wHwYDVR0jBBgwFoAUtyLBueMoMi7TborRvM7CnwOi
+SQ4wEwYDVR0lBAwwCgYIKwYBBQUHAwIwDQYJKoZIhvcNAQELBQADggEBABQ4PKRG
+VJYhWtktqpilP+C8CXsMArsqkEdMwHgQi8Xv3WVvXZpiLZHvO0To9J3+dgD2sOys
+MphZBXMJuOfX/+3IGerxsBxVj7Pnx37nn83g6PfCvGgVQQw7cGUjn5/Dw6apH2HH
+eO3yG+fgYeMNXyKt1KVWYeIToZfXUFvm+oMbWxxdpcctsKLRgCRvf1+r5EK9xE8+
+jYYk3S3pXvsk3qwWJz3pjg6zR3IbakkEuhE1Gl0Wrf4zZ9DOB8rd00/xirAuuYwm
+aIZ3KcFCTgVdGtB41q03D31xWNZPODCxAEADiICNE+3cuUMCi3wwBeCrybXSLhj/
+6St8K4NBvg+xL/w=
+-----END CERTIFICATE-----
diff --git a/tests/standalone/io/certificates/client2_key.pem b/tests/standalone/io/certificates/client2_key.pem
new file mode 100644
index 0000000..b4074f9
--- /dev/null
+++ b/tests/standalone/io/certificates/client2_key.pem
@@ -0,0 +1,29 @@
+-----BEGIN ENCRYPTED PRIVATE KEY-----
+MIIE5DAcBgoqhkiG9w0BDAEBMA4ECC/vc3ONj4KfAgIIAASCBMI1liT+B00kYYj+
+VRcEHQVrWsvD648OCd6BNQ9gKTYL5767lHUN0iG2JAdTHTKJy7XeEVVdPweU58jb
+HnS1yWbs0IuUFkCGy9wH3Lb6SkZtEScoAmzsNRdSY3WwmNhUG/yHrLITKM1SGkg3
+nf3ywIJYwO3YH22InVK0puVT/y943F1GXZSvklG/TGawR0uIyNuZOl0rg+5bsCaf
+1VSCWvt/Czgqm9Pc+Iz2PAKwyyjmvqRMBCtKvJTGNEPB63eDyHWQTtvQe0un06AF
+lvB7JYWaTXiwccSww2BuqTdJdBYKWxzPbdBfcqUT5Q9/LE0JhwvfZY/oDeJFP0HC
+HVBajuESZPJgb06xcsiX1qmk/iqAjZVZQ/CQ9K08qXem7YRFxJCy90wjLu3abjzQ
+Nvq0VsI8a8vlODQlr/Z5iXSYEKMYvUwh5Y9e8fc0BOOc1QzOYV2vxy28OVHmigOn
+tVHdj/FXK6N97QgtFzVUTjisO3YFygI2wybrz1BEys/vwqfCBiT+/hu+ur/lCrkn
+E2S6I967TyTvaxn+WCo9EW2Rb66XdI7tL09AkV2VZqJN4PTyis9YYgkr2uKjj4qX
+ySAQp/XHGEF1mmvjeptKTb2CMut0vcP+nl1bsUUXpSiKYGQ2BBcqgTcEFUEd75ms
+kcPMOuHdioaYh72nCRVzsRoDTDGF08NMTndW5PC8RpFsNS0vx8dq/A3VHAvJa2Rc
+9lP939FAU/Ck9b3NxH6hUgfDEFHQ61oW2Inpu4s3eRoClkgyf+aQEZZI7GTiNICm
+xqHosZ+hLe2mYoGk6xl1AruMk7kGeebRaPxzvS0UKfftOQDahFcDp8iEtLAcM1nx
+8Pdu4csyWFk+eBsTT6sPur2ZkD2LO0gLjR+N2nZNTqEJYy7n1jyV7M/JZBfh0fGi
+VX+sb+urTBAlDszX6b1LV7M78MDs6QwziDsrytjuClOWN47wzYbYYnSZZnDtTR+B
+CDHyK5wa8gNs4A+643HvD6sJz6zALOu2UI/9SrvuyYPltCwCUmWJ3A2XxoBmdJ/e
+yHEj/VdsNi6TtQ5qpBWqm43LpF0WAKNgksGnbFjOc/0QsUVk0txB9D6/oC9HyCd8
+u9nR8vLUC7l1dtYL0CwpocqU67qzVoRxrkkyCE4iblusKjr1ZlfstHDS0tPELodo
+8RroSs4vKXV9dzhzLQyqp6PzzdB7y/5Bpn0grxXrwln6/shoSR462h2CB4z9chGA
+Vdsp+KE8LDogIwZDT6iVVrpaBQDLoSxmX+E2IKRCUcj/l+gepEPyHbhOAn8/NxGX
+h16v89aDMtnyWqUcc/Gm2/Qep3o7goRfodyoyWvwy8nq9Lgf/wJIfEGn0lEeR0I/
+/Om/UAiId1o47C3LsGMm+qO+FcWesLA67eMQnp1WYoWpnanb3q4t8PWATzAlW05n
+cA59dYjutUmKJEjrh595AptMLXn6RM1GzA7x53+uAKvXaI+aR8wrtujiJLg9DwY2
++f4ehwfwNptBxzZX97a7/3lGZ5U7BgDeJhNo9T02VQTvXxB29H6J/v6XYyPCKpuM
+upPhiHzrs9UyMvINfDnd/fJ58qr6TvEuBi0QxMMmOCfccYlj6Q5Bfqp+iuST0igg
+SLmBml+LkIM=
+-----END ENCRYPTED PRIVATE KEY-----
diff --git a/tests/standalone/io/certificates/client_authority.pem b/tests/standalone/io/certificates/client_authority.pem
new file mode 100644
index 0000000..ae9ae5b
--- /dev/null
+++ b/tests/standalone/io/certificates/client_authority.pem
@@ -0,0 +1,19 @@
+-----BEGIN CERTIFICATE-----
+MIIDKjCCAhKgAwIBAgIBATANBgkqhkiG9w0BAQsFADAaMRgwFgYDVQQDEw9jbGll
+bnRhdXRob3JpdHkwHhcNMTUxMDI3MTAyNjM1WhcNMjUxMDI0MTAyNjM1WjAaMRgw
+FgYDVQQDEw9jbGllbnRhdXRob3JpdHkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw
+ggEKAoIBAQCi6wJAs6nppNmTZ3e/wE9l0pAmkMtDONwB9o115XXTG3rmSKfZOxa8
+TFjSn818Pr1OYb9fPdI1Y6x4WY9PELUtQyEBlNcKjwg96vhrP4p2DhqbWsI5nASH
+DSjJsM75bQ7D7qHYzriuAl0Fk1C4LcodRj+5wmErMtvGJG0x06qFbxCCMAJ2kC+h
+SneTN955/YHSXADgxjFlt3s1T0QPnqrr+G7Ro6PrVKLPBulglq7wAeTwrGkPRUt0
+3lDGOSi6i97NbpiXwrGp5XiLUtVCiID6Ro0xKWH4sjJ4JnVjIUG8CQWERc6sFDJM
+4adgFQJagkTUoxWtDGL58+WcbcJa73XJAgMBAAGjezB5MBIGA1UdEwEB/wQIMAYB
+Af8CAQAwHQYDVR0OBBYEFLciwbnjKDIu026K0bzOwp8DokkOMB8GA1UdIwQYMBaA
+FLciwbnjKDIu026K0bzOwp8DokkOMA4GA1UdDwEB/wQEAwICBDATBgNVHSUEDDAK
+BggrBgEFBQcDAjANBgkqhkiG9w0BAQsFAAOCAQEAh8rryWFoGjFdm0i4FLRktF8B
+aUqVCCpFVHIYlFcsQstznIb01X2Zq5nfSfrFxbr5STVGzGJ0HGDuFpicT8+qMnJX
+dou5AuaqubIDWeKL+oAgvI71Nt1gsesixqzFQAoCTRgUjrSGpY2fL7rElV0Ndy9b
+YepVouktP1/GULc8XbIG9ZLx70Id7YTyrITDgbH3hSnbjmmZSr9RKyKas4MXN0s8
+oKGHEgAx7KyNQRppjydz3bDeH/jVbM4W98vwL6rjKUJlOlo0Ru+3+oioFHqLMSvN
+w4f5rQEiuF260h7y8KKxRxQ8rw188gsBapZr4Rcp+y8gdQvlzJONtv3d1dap5A==
+-----END CERTIFICATE-----
diff --git a/tests/standalone/io/certificates/server_chain.pem b/tests/standalone/io/certificates/server_chain.pem
new file mode 100644
index 0000000..341a86f
--- /dev/null
+++ b/tests/standalone/io/certificates/server_chain.pem
@@ -0,0 +1,59 @@
+-----BEGIN CERTIFICATE-----
+MIIDZDCCAkygAwIBAgIBATANBgkqhkiG9w0BAQsFADAgMR4wHAYDVQQDDBVpbnRl
+cm1lZGlhdGVhdXRob3JpdHkwHhcNMTUxMDI3MTAyNjM1WhcNMjUxMDI0MTAyNjM1
+WjAUMRIwEAYDVQQDDAlsb2NhbGhvc3QwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw
+ggEKAoIBAQCkg/Qr8RQeLTOSgCkyiEX2ztgkgscX8hKGHEHdvlkmVK3JVEIIwkvu
+/Y9LtHZUia3nPAgqEEbexzTENZjSCcC0V6I2XW/e5tIE3rO0KLZyhtZhN/2SfJ6p
+KbOh0HLr1VtkKJGp1tzUmHW/aZI32pK60ZJ/N917NLPCJpCaL8+wHo3+w3oNqln6
+oJsfgxy9SUM8Bsc9WMYKMUdqLO1QKs1A5YwqZuO7Mwj+4LY2QDixC7Ua7V9YAPo2
+1SBeLvMCHbYxSPCuxcZ/kDkgax/DF9u7aZnGhMImkwBka0OQFvpfjKtTIuoobTpe
+PAG7MQYXk4RjnjdyEX/9XAQzvNo1CDObAgMBAAGjgbQwgbEwPAYDVR0RBDUwM4IJ
+bG9jYWxob3N0ggkxMjcuMC4wLjGCAzo6MYcEfwAAAYcQAAAAAAAAAAAAAAAAAAAA
+ATAMBgNVHRMBAf8EAjAAMB0GA1UdDgQWBBSvhJo6taTggJQBukEvMo/PDk8tKTAf
+BgNVHSMEGDAWgBS98L4T5RaIToE3DkBRsoeWPil0eDAOBgNVHQ8BAf8EBAMCA6gw
+EwYDVR0lBAwwCgYIKwYBBQUHAwEwDQYJKoZIhvcNAQELBQADggEBAHLOt0mL2S4A
+B7vN7KsfQeGlVgZUVlEjem6kqBh4fIzl4CsQuOO8oJ0FlO1z5JAIo98hZinymJx1
+phBVpyGIKakT/etMH0op5evLe9dD36VA3IM/FEv5ibk35iGnPokiJXIAcdHd1zam
+YaTHRAnZET5S03+7BgRTKoRuszhbvuFz/vKXaIAnVNOF4Gf2NUJ/Ax7ssJtRkN+5
+UVxe8TZVxzgiRv1uF6NTr+J8PDepkHCbJ6zEQNudcFKAuC56DN1vUe06gRDrNbVq
+2JHEh4pRfMpdsPCrS5YHBjVq/XHtFHgwDR6g0WTwSUJvDeM4OPQY5f61FB0JbFza
+PkLkXmoIod8=
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIDLjCCAhagAwIBAgIBAjANBgkqhkiG9w0BAQsFADAYMRYwFAYDVQQDDA1yb290
+YXV0aG9yaXR5MB4XDTE1MTAyNzEwMjYzNVoXDTI1MTAyNDEwMjYzNVowIDEeMBwG
+A1UEAwwVaW50ZXJtZWRpYXRlYXV0aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEFAAOC
+AQ8AMIIBCgKCAQEA6GndRFiXk+2q+Ig7ZOWKKGta+is8137qyXz+eVFs5sA0ajMN
+ZBAMWS0TIXw/Yks+y6fEcV/tfv91k1eUN4YXPcoxTdDF97d2hO9wxumeYOMnQeDy
+VZVDKQBZ+jFMeI+VkNpMEdmsLErpZDGob/1dC8tLEuR6RuRR8X6IDGMPOCMw1jLK
+V1bQjPtzqKadTscfjLuKxuLgspJdTrzsu6hdcl1mm8K6CjTY2HNXWxs1yYmwfuQ2
+Z4/8sOMNqFqLjN+ChD7pksTMq7IosqGiJzi2bpd5f44ek/k822Y0ATncJHk4h1Z+
+kZBnW6kgcLna1gDri9heRwSZ+M8T8nlHgIMZIQIDAQABo3sweTASBgNVHRMBAf8E
+CDAGAQH/AgEAMB0GA1UdDgQWBBS98L4T5RaIToE3DkBRsoeWPil0eDAfBgNVHSME
+GDAWgBRxD5DQHTmtpDFKDOiMf5FAi6vfbzAOBgNVHQ8BAf8EBAMCAgQwEwYDVR0l
+BAwwCgYIKwYBBQUHAwEwDQYJKoZIhvcNAQELBQADggEBAD+4KpUeV5mUPw5IG/7w
+eOXnUpeS96XFGuS1JuFo/TbgntPWSPyo+rD4GrPIkUXyoHaMCDd2UBEjyGbBIKlB
+NZA3RJOAEp7DTkLNK4RFn/OEcLwG0J5brL7kaLRO4vwvItVIdZ2XIqzypRQTc0MG
+MmF08zycnSlaN01ryM67AsMhwdHqVa+uXQPo8R8sdFGnZ33yywTYD73FeImXilQ2
+rDnFUVqmrW1fjl0Fi4rV5XI0EQiPrzKvRtmF8ZqjGATPOsRd64cwQX6V+P5hNeIR
+9pba6td7AbNGausHfacRYMyoGJWWWkFPd+7jWOCPqW7Fk1tmBgdB8GzXa3inWIRM
+RUE=
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIC+zCCAeOgAwIBAgIBATANBgkqhkiG9w0BAQsFADAYMRYwFAYDVQQDDA1yb290
+YXV0aG9yaXR5MB4XDTE1MTAyNzEwMjYzNFoXDTI1MTAyNDEwMjYzNFowGDEWMBQG
+A1UEAwwNcm9vdGF1dGhvcml0eTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
+ggEBAMl+dcraUM/E7E6zl7+7hK9oUJYXJLnfiMtP/TRFVbH4+2aEN8vXzPbzKdR3
+FfaHczXQTwnTCaYA4u4uSDvSOsFFEfxEwYORsdKmQEM8nGpVX2NVvKsMcGIhh8kh
+ZwJfkMIOcAxmGIHGdMhF8VghonJ8uGiuqktxdfpARq0g3fqIjDHsF9/LpfshUfk9
+wsRyTF0yr90U/dsfnE+u8l7GvVl8j2Zegp0sagAGtLaNv7tP17AibqEGg2yDBrBN
+9r9ihe4CqMjx+Q2kQ2S9Gz2V2ReO/n6vm2VQxsPRB/lV/9jh7cUcS0/9mggLYrDy
+cq1v7rLLQrWuxMz1E3gOhyCYJ38CAwEAAaNQME4wHQYDVR0OBBYEFHEPkNAdOa2k
+MUoM6Ix/kUCLq99vMB8GA1UdIwQYMBaAFHEPkNAdOa2kMUoM6Ix/kUCLq99vMAwG
+A1UdEwQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBABrhjnWC6b+z9Kw73C/niOwo
+9sPdufjS6tb0sCwDjt3mjvE4NdNWt+/+ZOugW6dqtvqhtqZM1q0u9pJkNwIrqgFD
+ZHcfNaf31G6Z2YE+Io7woTVw6fFobg/EFo+a/qwbvWL26McmiRL5yiSBjVjpX4a5
+kdZ+aPQUCBaLrTWwlCDqzSVIULWUQvveRWbToMFKPNID58NtEpymAx3Pgir7YjV9
+UnlU2l5vZrh1PTCqZxvC/IdRESUfW80LdHaeyizRUP+6vKxGgSz2MRuYINjbd6GO
+hGiCpWlwziW2xLV1l2qSRLko2kIafLZP18N0ThM9zKbU5ps9NgFOf//wqSGtLaE=
+-----END CERTIFICATE-----
diff --git a/tests/standalone/io/certificates/server_key.pem b/tests/standalone/io/certificates/server_key.pem
new file mode 100644
index 0000000..895b7d2
--- /dev/null
+++ b/tests/standalone/io/certificates/server_key.pem
@@ -0,0 +1,29 @@
+-----BEGIN ENCRYPTED PRIVATE KEY-----
+MIIE4zAcBgoqhkiG9w0BDAEBMA4ECBMCjlg8JYZ4AgIIAASCBMFd9cBoZ5xcTock
+AVQcg/HzYJtMceKn1gtMDdC7mmXuyN0shoxhG4BpQInHkFARL+nenesXFxEm4X5e
+L603Pcgw72/ratxVpTW7hPMjiLTEBqza0GjQm7Sarbdy+Vzdp/6XFrAcPfFl1juY
+oyYzbozPsvFHz3Re44y1KmI4HAzU/qkjJUbNTTiPPVI2cDP6iYN2XXxBb1wwp8jR
+iqdZqFG7lU/wvPEbD7BVPpmJBHWNG681zb4ea5Zn4hW8UaxpiIBiaH0/IWc2SVZd
+RliAFo3NEsGxCcsnBo/n00oudGbOJxdOp7FbH5hJpeqX2WhCyJRxIeHOWmeuMAet
+03HFriiEmJ99m2nEJN1x0A3QUUM7ji6vZAb4qb1dyq7LlX4M2aaqixRnaTcQkapf
+DOxX35DEBXSKrDpyWp6Rx4wNpUyi1TKyhaVnYgD3Gn0VfC/2w86gSFlrf9PMYGM0
+PvFxTDzTyjOuPBRa728gZOGXgDOL7qvdInU/opVew7kFeRQHXxHzFCLK5dD+Vrig
+5fS3m0++f55ODkxqHXB8gbXbd3GMmsW6MrGpU7VsCNtbVPdSMW0FalovEB0M+2lj
+1VfuvL+0F5huTe+BgZAt6xgET/CIcZXdNMRPVhraqUjqWtI9Rdk4STPCpU1rDkjG
+YDl/fo4W2T6qQWFUpiC9IvVVGkVxaqfZZ4Qu+V5xPUi6vk95QiTNkN1t+m+sCCgS
+Llkea8Um0aHMy33Lj3NsfL0LMrnpniqcAks8BvcgIZwk1VRqcj7BQVCygJSYrmAR
+DBhMpjWlXuSggnyVPuduZDtnTN+8lCHLOKL3a3bDb6ySaKX49Km6GutDLfpDtEA0
+3mQvmEG4XVm7zy+AlN72qFbtSLDRi/D/uQh2q/ZrFQLOBQBQB56TvEbKouLimUDM
+ascQA3aUyhOE7e+d02NOFIFTozwc/C//CIFeA+ZEwxyfha/3Bor6Jez7PC/eHNxZ
+w7YMXzPW9NhcCcerhYGebuCJxLwzqJ+IGdukjKsGV2ytWDoB2xZiJNu096j4RKcq
+YSJoen0R7IH8N4eDujXR8m9kAl724Uqs1OoAs4VNICvzTutbsgVZ6Z+NMOcfnPw9
+jZkFhot16w8znD+OmhBR7/bzOLpaeUhk7EhNq5M6U0NNWx3WwkDlvU/jx+6/EQe3
+iLEHptH2HYBF1xscaKGbtKNtuQsfdzgWpOX0qK2YbK3yCKvL/xIm1DQmDZDKkWdW
+VNh8oGV1H96CivWlvxhAgXKz9F/83CjMw8YXRk7RJvWR4vtNvXFAvGkFIYCN9Jv9
+p+1ukaYoxSLGBik907I6gWSHqumJiCprUyAX/bVfZfNiYh4hzeA3lhwxZSax3JG4
+7QFPvyepOmF/3AAzS/Pusx6jOZnuCMCkfQi6Wpem1o3s4x+fP7kz00Xuj01ErucM
+S10ixfIh84kXBN3dTRDtDdeCyoMsBKO0W5jDBBlWL02YfdF6Opo1Q4cPh2DYgXMh
+XEszNZSK5LB0y+f3A6Kdx/hkZzHVvMONA70OyrkoZzGyWENhcB0c7ntTJyPPD2qM
+s0HRA2VwF/0ypU3OKERM1Ua5NSkTgvnnVTlV9GO90Tkn5v4fxdl8NzIuJLyGguTP
+Xc0tRM34Lg==
+-----END ENCRYPTED PRIVATE KEY-----
diff --git a/tests/standalone/io/certificates/server_trusted.pem b/tests/standalone/io/certificates/server_trusted.pem
new file mode 100644
index 0000000..b943cf9
--- /dev/null
+++ b/tests/standalone/io/certificates/server_trusted.pem
@@ -0,0 +1,57 @@
+-----BEGIN CERTIFICATE-----
+MIIDLjCCAhagAwIBAgIBAjANBgkqhkiG9w0BAQsFADAYMRYwFAYDVQQDDA1yb290
+YXV0aG9yaXR5MB4XDTE1MTAyNzEwMjYzNVoXDTI1MTAyNDEwMjYzNVowIDEeMBwG
+A1UEAwwVaW50ZXJtZWRpYXRlYXV0aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEFAAOC
+AQ8AMIIBCgKCAQEA6GndRFiXk+2q+Ig7ZOWKKGta+is8137qyXz+eVFs5sA0ajMN
+ZBAMWS0TIXw/Yks+y6fEcV/tfv91k1eUN4YXPcoxTdDF97d2hO9wxumeYOMnQeDy
+VZVDKQBZ+jFMeI+VkNpMEdmsLErpZDGob/1dC8tLEuR6RuRR8X6IDGMPOCMw1jLK
+V1bQjPtzqKadTscfjLuKxuLgspJdTrzsu6hdcl1mm8K6CjTY2HNXWxs1yYmwfuQ2
+Z4/8sOMNqFqLjN+ChD7pksTMq7IosqGiJzi2bpd5f44ek/k822Y0ATncJHk4h1Z+
+kZBnW6kgcLna1gDri9heRwSZ+M8T8nlHgIMZIQIDAQABo3sweTASBgNVHRMBAf8E
+CDAGAQH/AgEAMB0GA1UdDgQWBBS98L4T5RaIToE3DkBRsoeWPil0eDAfBgNVHSME
+GDAWgBRxD5DQHTmtpDFKDOiMf5FAi6vfbzAOBgNVHQ8BAf8EBAMCAgQwEwYDVR0l
+BAwwCgYIKwYBBQUHAwEwDQYJKoZIhvcNAQELBQADggEBAD+4KpUeV5mUPw5IG/7w
+eOXnUpeS96XFGuS1JuFo/TbgntPWSPyo+rD4GrPIkUXyoHaMCDd2UBEjyGbBIKlB
+NZA3RJOAEp7DTkLNK4RFn/OEcLwG0J5brL7kaLRO4vwvItVIdZ2XIqzypRQTc0MG
+MmF08zycnSlaN01ryM67AsMhwdHqVa+uXQPo8R8sdFGnZ33yywTYD73FeImXilQ2
+rDnFUVqmrW1fjl0Fi4rV5XI0EQiPrzKvRtmF8ZqjGATPOsRd64cwQX6V+P5hNeIR
+9pba6td7AbNGausHfacRYMyoGJWWWkFPd+7jWOCPqW7Fk1tmBgdB8GzXa3inWIRM
+RUE=
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIC+zCCAeOgAwIBAgIBATANBgkqhkiG9w0BAQsFADAYMRYwFAYDVQQDDA1yb290
+YXV0aG9yaXR5MB4XDTE1MTAyNzEwMjYzNFoXDTI1MTAyNDEwMjYzNFowGDEWMBQG
+A1UEAwwNcm9vdGF1dGhvcml0eTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
+ggEBAMl+dcraUM/E7E6zl7+7hK9oUJYXJLnfiMtP/TRFVbH4+2aEN8vXzPbzKdR3
+FfaHczXQTwnTCaYA4u4uSDvSOsFFEfxEwYORsdKmQEM8nGpVX2NVvKsMcGIhh8kh
+ZwJfkMIOcAxmGIHGdMhF8VghonJ8uGiuqktxdfpARq0g3fqIjDHsF9/LpfshUfk9
+wsRyTF0yr90U/dsfnE+u8l7GvVl8j2Zegp0sagAGtLaNv7tP17AibqEGg2yDBrBN
+9r9ihe4CqMjx+Q2kQ2S9Gz2V2ReO/n6vm2VQxsPRB/lV/9jh7cUcS0/9mggLYrDy
+cq1v7rLLQrWuxMz1E3gOhyCYJ38CAwEAAaNQME4wHQYDVR0OBBYEFHEPkNAdOa2k
+MUoM6Ix/kUCLq99vMB8GA1UdIwQYMBaAFHEPkNAdOa2kMUoM6Ix/kUCLq99vMAwG
+A1UdEwQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBABrhjnWC6b+z9Kw73C/niOwo
+9sPdufjS6tb0sCwDjt3mjvE4NdNWt+/+ZOugW6dqtvqhtqZM1q0u9pJkNwIrqgFD
+ZHcfNaf31G6Z2YE+Io7woTVw6fFobg/EFo+a/qwbvWL26McmiRL5yiSBjVjpX4a5
+kdZ+aPQUCBaLrTWwlCDqzSVIULWUQvveRWbToMFKPNID58NtEpymAx3Pgir7YjV9
+UnlU2l5vZrh1PTCqZxvC/IdRESUfW80LdHaeyizRUP+6vKxGgSz2MRuYINjbd6GO
+hGiCpWlwziW2xLV1l2qSRLko2kIafLZP18N0ThM9zKbU5ps9NgFOf//wqSGtLaE=
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIDKjCCAhKgAwIBAgIBATANBgkqhkiG9w0BAQsFADAaMRgwFgYDVQQDEw9jbGll
+bnRhdXRob3JpdHkwHhcNMTUxMDI3MTAyNjM1WhcNMjUxMDI0MTAyNjM1WjAaMRgw
+FgYDVQQDEw9jbGllbnRhdXRob3JpdHkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw
+ggEKAoIBAQCi6wJAs6nppNmTZ3e/wE9l0pAmkMtDONwB9o115XXTG3rmSKfZOxa8
+TFjSn818Pr1OYb9fPdI1Y6x4WY9PELUtQyEBlNcKjwg96vhrP4p2DhqbWsI5nASH
+DSjJsM75bQ7D7qHYzriuAl0Fk1C4LcodRj+5wmErMtvGJG0x06qFbxCCMAJ2kC+h
+SneTN955/YHSXADgxjFlt3s1T0QPnqrr+G7Ro6PrVKLPBulglq7wAeTwrGkPRUt0
+3lDGOSi6i97NbpiXwrGp5XiLUtVCiID6Ro0xKWH4sjJ4JnVjIUG8CQWERc6sFDJM
+4adgFQJagkTUoxWtDGL58+WcbcJa73XJAgMBAAGjezB5MBIGA1UdEwEB/wQIMAYB
+Af8CAQAwHQYDVR0OBBYEFLciwbnjKDIu026K0bzOwp8DokkOMB8GA1UdIwQYMBaA
+FLciwbnjKDIu026K0bzOwp8DokkOMA4GA1UdDwEB/wQEAwICBDATBgNVHSUEDDAK
+BggrBgEFBQcDAjANBgkqhkiG9w0BAQsFAAOCAQEAh8rryWFoGjFdm0i4FLRktF8B
+aUqVCCpFVHIYlFcsQstznIb01X2Zq5nfSfrFxbr5STVGzGJ0HGDuFpicT8+qMnJX
+dou5AuaqubIDWeKL+oAgvI71Nt1gsesixqzFQAoCTRgUjrSGpY2fL7rElV0Ndy9b
+YepVouktP1/GULc8XbIG9ZLx70Id7YTyrITDgbH3hSnbjmmZSr9RKyKas4MXN0s8
+oKGHEgAx7KyNQRppjydz3bDeH/jVbM4W98vwL6rjKUJlOlo0Ru+3+oioFHqLMSvN
+w4f5rQEiuF260h7y8KKxRxQ8rw188gsBapZr4Rcp+y8gdQvlzJONtv3d1dap5A==
+-----END CERTIFICATE-----
diff --git a/tests/standalone/io/certificates/trusted_certs.pem b/tests/standalone/io/certificates/trusted_certs.pem
new file mode 100644
index 0000000..8b5bf3e
--- /dev/null
+++ b/tests/standalone/io/certificates/trusted_certs.pem
@@ -0,0 +1,18 @@
+-----BEGIN CERTIFICATE-----
+MIIC+zCCAeOgAwIBAgIBATANBgkqhkiG9w0BAQsFADAYMRYwFAYDVQQDDA1yb290
+YXV0aG9yaXR5MB4XDTE1MTAyNzEwMjYzNFoXDTI1MTAyNDEwMjYzNFowGDEWMBQG
+A1UEAwwNcm9vdGF1dGhvcml0eTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
+ggEBAMl+dcraUM/E7E6zl7+7hK9oUJYXJLnfiMtP/TRFVbH4+2aEN8vXzPbzKdR3
+FfaHczXQTwnTCaYA4u4uSDvSOsFFEfxEwYORsdKmQEM8nGpVX2NVvKsMcGIhh8kh
+ZwJfkMIOcAxmGIHGdMhF8VghonJ8uGiuqktxdfpARq0g3fqIjDHsF9/LpfshUfk9
+wsRyTF0yr90U/dsfnE+u8l7GvVl8j2Zegp0sagAGtLaNv7tP17AibqEGg2yDBrBN
+9r9ihe4CqMjx+Q2kQ2S9Gz2V2ReO/n6vm2VQxsPRB/lV/9jh7cUcS0/9mggLYrDy
+cq1v7rLLQrWuxMz1E3gOhyCYJ38CAwEAAaNQME4wHQYDVR0OBBYEFHEPkNAdOa2k
+MUoM6Ix/kUCLq99vMB8GA1UdIwQYMBaAFHEPkNAdOa2kMUoM6Ix/kUCLq99vMAwG
+A1UdEwQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBABrhjnWC6b+z9Kw73C/niOwo
+9sPdufjS6tb0sCwDjt3mjvE4NdNWt+/+ZOugW6dqtvqhtqZM1q0u9pJkNwIrqgFD
+ZHcfNaf31G6Z2YE+Io7woTVw6fFobg/EFo+a/qwbvWL26McmiRL5yiSBjVjpX4a5
+kdZ+aPQUCBaLrTWwlCDqzSVIULWUQvveRWbToMFKPNID58NtEpymAx3Pgir7YjV9
+UnlU2l5vZrh1PTCqZxvC/IdRESUfW80LdHaeyizRUP+6vKxGgSz2MRuYINjbd6GO
+hGiCpWlwziW2xLV1l2qSRLko2kIafLZP18N0ThM9zKbU5ps9NgFOf//wqSGtLaE=
+-----END CERTIFICATE-----
diff --git a/tests/standalone/io/certificates/untrusted_server_chain.pem b/tests/standalone/io/certificates/untrusted_server_chain.pem
new file mode 100644
index 0000000..ff6e568
--- /dev/null
+++ b/tests/standalone/io/certificates/untrusted_server_chain.pem
@@ -0,0 +1,59 @@
+-----BEGIN CERTIFICATE-----
+MIIDZDCCAkygAwIBAgIBATANBgkqhkiG9w0BAQsFADAgMR4wHAYDVQQDDBVpbnRl
+cm1lZGlhdGVhdXRob3JpdHkwHhcNMTUxMDE5MTE1NTEyWhcNMjUxMDE2MTE1NTEy
+WjAUMRIwEAYDVQQDDAlsb2NhbGhvc3QwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw
+ggEKAoIBAQDca2l3VIWhnlTqazrA07hiHjgXACUYS/nVox+a2Jar383kBz2kzN6B
+u4K7IwD2msym2IOBp1YT9OKPh9/KkSGvpPelu7ToCoehala32W+0ozh53CR8IpzQ
+tmh7J9oHtN2PcbLgEzHfAWyrY3xp9RpWUONjxoG8xXPedNsZL0Rj65Z3fKAjOypl
++XJsgrqrNNAi3x0OMdhextMmLrYl+YQjgdND8UpykTSc8Q0vwngDZuLH/Nhx0cAA
+Ade0ZfXS6snwWVxrWke+zGF6yANoiV00gsBhq+WZZ50SmE2mz5LT9uj4t5WpcOI/
+2TlbV9HSjdOEAFD8cJIrK5FkEmz383E1AgMBAAGjgbQwgbEwPAYDVR0RBDUwM4IJ
+bG9jYWxob3N0ggkxMjcuMC4wLjGCAzo6MYcEfwAAAYcQAAAAAAAAAAAAAAAAAAAA
+ATAMBgNVHRMBAf8EAjAAMB0GA1UdDgQWBBQO+6Atr6tkTBmPasN4oTDUlbxQ1zAf
+BgNVHSMEGDAWgBRrkK4hOni2neySWQNmMfb9imn/+DAOBgNVHQ8BAf8EBAMCA6gw
+EwYDVR0lBAwwCgYIKwYBBQUHAwEwDQYJKoZIhvcNAQELBQADggEBACdVUzrhfXoW
+wG0zI9aT6CxD7T0i0WK4fC6Yrx0Pqz53xnuiwBfvuAJ/PRXKYsJMxa2LuHGJKU/A
+nImCXGJHoUwL6x4Eor6fg7L9nPNqtIrQ6tzubxNtVPpLj4tK6Ps3IM+FICYUSX0b
+FLSfnv74afUp/2+0OHsoUVsL1rCTO2WgEkEShLERdJvdcvUSTWHfC5IQORS9vfzG
++cZGOOPebfm8TY2DJxMYj/t7CHs1Sk550x590sKb/prwtJAYtQxGe7v0m9rihiM3
+dFKZiNh99yXbQ1ELYyhkFP8WAdK8ZTnynGqgAYJmV89Dg8k2uU8z+dahlE3foORD
+Y/Gn0CZE1NY=
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIDLjCCAhagAwIBAgIBATANBgkqhkiG9w0BAQsFADAYMRYwFAYDVQQDDA1yb290
+YXV0aG9yaXR5MB4XDTE1MTAxOTExNTUxMloXDTI1MTAxNjExNTUxMlowIDEeMBwG
+A1UEAwwVaW50ZXJtZWRpYXRlYXV0aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEFAAOC
+AQ8AMIIBCgKCAQEA1OV9iea75DPQ18NppXxEFW26J7IfjUvp4wVnj9m7pOhsByqd
+wwS6hpjlkpEwCyugKD/t7u/VGwp2BB+BeaX7FPj6rnYY82bOJQlyB/vvDmOZfAe2
+84ug9O7QcsQHSQ7YQFuvYKaeYCKdrGjzQPVYkoVdv2js2dYTDG3QSIxpbi305Vef
+ia6Zfs5CAW/SfL36+ETo2pXNlD1ZBGRL8H3z+mMnIEj1Tbaipf+1Npr2l3xqIs1k
+RWsM3X+9xMkWGyvsDdbLIGiTTVxM9kOF0aNLdQIKb2tZsg4jRrFIgiO+5TXwp0FW
+4ldc5/GhtaoPDcsIALyIQc7CJ/PpPm9hnxIy7QIDAQABo3sweTASBgNVHRMBAf8E
+CDAGAQH/AgEAMB0GA1UdDgQWBBRrkK4hOni2neySWQNmMfb9imn/+DAfBgNVHSME
+GDAWgBRpz+jRK9iGqijrL/4WCsGsIjxoETAOBgNVHQ8BAf8EBAMCAgQwEwYDVR0l
+BAwwCgYIKwYBBQUHAwEwDQYJKoZIhvcNAQELBQADggEBACcwiLJUPzYGIeGIYGlo
+XlP4++adiPlXvsyTxLdGVSFWJMBV5EhtiXQXaUsOs2PyC7SWxiiUdAgE8Y2tMsF3
+Bh5LY/kKxZQXZuFa+RN1kPlhlYJWdiPyqcBziSPFBtqwudWLDUVSaVAQDhYYVB3K
+5+pFaeQKfhYmPvJKR9U2nTvukOhN1fZM8GUBnm2uaiA3giQ0wxXyQIuqC9S52qbh
+x4D4ZdbshQAgThPkHBoZVmd/NF1TNzitZZy7uaU7GpGrS1dcevN7pEUwm3+KIkIT
+AOSLB2FbFOwPUg6a/lWkFPotT3gl0tdyCaqkfneGCHzVciT0JTS/AqpdYEtuxEMe
+PJk=
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIC+zCCAeOgAwIBAgIBATANBgkqhkiG9w0BAQsFADAYMRYwFAYDVQQDDA1yb290
+YXV0aG9yaXR5MB4XDTE1MTAxOTExNTUxMloXDTI1MTAxNjExNTUxMlowGDEWMBQG
+A1UEAwwNcm9vdGF1dGhvcml0eTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
+ggEBAMDzkcftGzdNJz5vXEAZSCAO2J6bCPz896pK3qtaViR/aF8I2vHZQm0IEoJc
+Y1NUMF3F50d6fMYCkEoORAkC0d7iAwTprhBdIg35+TxwGObcStrohDtEgwFmFRzg
+LtYeXiU0t0dBWOOQ9k2f9VGqbzKwZ2dbhOHSTXMTFoEcMStbeFc++oiOLY+QSq/J
+Xd/BXqvwVM3Mt+OwLvyUu45Kw18ENo77qubIPJUwoyaf+N2nFRqcc7bmNy0Wvk2Q
+StvQXy6DpN3KOoZx/sR7Ff8hYuHXcxbSsJ1hOO+tIJyOZyEJvU2BBOYVlKr4E4JU
+mkex0CM1IfIFqfcEkbvjwLjaojsCAwEAAaNQME4wHQYDVR0OBBYEFGnP6NEr2Iaq
+KOsv/hYKwawiPGgRMB8GA1UdIwQYMBaAFGnP6NEr2IaqKOsv/hYKwawiPGgRMAwG
+A1UdEwQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAJKl4RCEaXwtosNeurZlS3b9
+owXdsXDRdnfEawcc//AbRkrS4bHCQyOJNp/3DibEKkeAXCJrJ5cvXRjE5gb3Q+rl
+0AqziLY15xuMAxUK3zv0e8Zir21PQzQ9x8zbmlucEoT/jn7KvMSSqfEoer77cXev
+BpmQDQzE3FNgKohmHIzIDoTPiU3ahv6x8IhJ1e47UmRsSPFgtqglHcdCYIEclXpY
+bHvctT6+pFZuJfIs9+BATMXPJWSX7NhlMcnyP+xdDxDKuF/nwVFy6xA+njuWnnZT
+TyiGCnx+u/VpKzOrwMfzv2DW8Db80UERoox5n6QNQLnXNWPMddUL92/p9lMzWJY=
+-----END CERTIFICATE-----
diff --git a/tests/standalone/io/certificates/untrusted_server_key.pem b/tests/standalone/io/certificates/untrusted_server_key.pem
new file mode 100644
index 0000000..29a9e32
--- /dev/null
+++ b/tests/standalone/io/certificates/untrusted_server_key.pem
@@ -0,0 +1,29 @@
+-----BEGIN ENCRYPTED PRIVATE KEY-----
+MIIE5TAcBgoqhkiG9w0BDAEBMA4ECKAry4fwmB/TAgIIAASCBMNsKbVVvIs/l6/N
+/1J9WXSiA1gnRTd2n58GJUV6mkiaRUMiWu3fK+V7iHpIi7KeLeD+JGsDeqxw0bB5
+lmS/RJy0wNBP0PL0oiI8VUe3wxTUU2b5wW9fomeOTGWOIUL5VZXHkTCf5KMcFWMY
+GMnDpIN/f/m9zvz/3FogxIZlIAxG7gKKrfEcKExIShAJ5wYDbDSFZWfNcjMODGPn
+xz3W04aRsJGf3KlOQvSuNtcBpsuwXuAXezzuFETM20xrWW3iJIsO5UmqJ1OJcdet
+A+k5k0K+1/WwLkceWJYSd19O+7LNULsZhKUJ515ZSO1TJGgfd5DznkgRXYUx5ucS
+tvJLYvShGbaYulsVKn8q2nkIxnQCov3my1hIRk/qCKb+uOvRD9dIkjSlNubqaRb6
+geEOfTh1g5PCeKPlSTkVueLQqWxKMye4eWYqUxExkUNuGJ0d2ndBGJRo6bulnc7I
+kt44DzEufV5OLvyTufimpohqRm3Yzq87DWSSThCKOGkhfGutn8B7cJR8ZPrG2euT
+J7Bv4EuFjhpKDieqDi8yoXgIkWSgyzFNMsewV4lxFNP/wbvoKPFrKsU4ny6jRfzy
+WTjMN1UOTBvsyZbVvjLII79cBKLqlowHAZQ7YwuxtbjeB9FRH+ZwkzYeyn4GNHdf
+QoVwOMKAiOMjzAK9qdW7isVXy/7v9EXaZplRmwMRhCZevC9zeY2Rueahq8qpHpH1
+GPjrew5elPkBRQhxX6IiL7kI7upE65UI5hnnTnrdrZkRmMYOFEZLyLbTU4wMCxui
+4BmEiGp6qCWe3UND1b8YhG+gsRYzHK5oEJV+Ck7m+e9iU3/axggUfAhZeBmdlgqd
+bUajlzcgbtfaSgZ08XXU1YPw0aLlmJGzb+oWMFwBJHAUYpOV2uqDHiXZZt4SoAF9
+gJQaXvqMGzY8JyP5ZQauljVtPGcopA+jbix3Rbwf97lLqJHSpWoHpcCa6FrfaMqG
+dx8oQsO67WN0gm5DIN3kB2jHOj9Nf7kr3HGjyC5tPq8s1+aT6baZcHWzVfyVr10c
+9X13Pz5XzEa1oiaO7JDPkzb9T7aPJZwskATNB8h6tWfqdGyUY5eURtsCnVrtG/1p
+pAXyY/0vAksfDPjMChKLKxZ7rBbscoNzr2f7Vw4CTnIpaxA4eLEx6UdpG4/5RzYJ
+0YuR+SzCkuNti7uZGi9DCGkZkYl6VndatW+Pk/+JVBexdKt6MsER6aVsS8ev9UbW
+JG+2C8bjMlfKy21644KwYOtZbVcE9jwlsz8w+e6YbOzBvbwiPmoCi0xcMxRJPa2y
+cKMrs2hSKmhUP6uIH0b0qNcHEPA32mVzGC0MToC5R+yb6OdyvoEsisqS7tEAMfTJ
+0yowcZr2lPehaMr4efSB8JY6DuofitfgI6X6bmiIPQ9v//djxhkxkRAbpTRGmFZx
+1YIKDa72S8jUxHWlVvmoqTWI8T+jltF2pYBctS6IMKEot/CcBCHb5l1zfMyo5a0x
+73ooh5tq+vRWJGaLRMj66VVSWGQoJmfAGwWpjBpTLa0UQoHO0/J1IbfjFOj5HV3J
+bscmoGWhVwuJM5ActB0MOvXGQe9mf2X4p/1Rp+yBuipH1SJzFEzbOZ3kE50Z6aXH
+CoJJOKkcuf43
+-----END ENCRYPTED PRIVATE KEY-----
diff --git a/tests/standalone/io/create_sample_certificates.sh b/tests/standalone/io/create_sample_certificates.sh
new file mode 100755
index 0000000..7ab6f75
--- /dev/null
+++ b/tests/standalone/io/create_sample_certificates.sh
@@ -0,0 +1,104 @@
+#!/bin/bash
+# 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.
+
+# Script to create sample certificates for the dart:io SecureSocket tests.
+# Creates a root certificate authority, an intermediate authority,
+# and a server certificate,
+
+password=pass:dartdart
+
+# We need a server certificate chain where we don't trust the root.  Take the
+# server certificate from the previous run of this script, for that purpose.
+if [ -d "certificates" ]; then
+  mv certificates/server_key.pem certificates/untrusted_server_key.pem
+  mv certificates/server_chain.pem certificates/untrusted_server_chain.pem
+else
+  mkdir certificates
+fi
+
+mkdir -p certificate_authority
+cd certificate_authority
+
+# Create a self-signed certificate authority.
+openssl req -subj /CN=rootauthority -set_serial 1 -batch -verbose \
+    -passout $password -new -x509 -keyout root_authority_key.pem \
+    -out root_authority.pem -days 3650
+
+# Create a certificate request for the intermediate authority.
+openssl req -subj /CN=intermediateauthority -batch -verbose \
+    -passout $password -new -keyout intermediate_authority_key.pem \
+    -out intermediate_authority_request.pem
+
+# Sign the certificate of the intermediate authority with the root authority.
+# Add the certificate extensions marking it as a certificate authority.
+openssl x509 -req -in intermediate_authority_request.pem \
+    -out intermediate_authority.pem -set_serial 2 \
+    -CA root_authority.pem -CAkey root_authority_key.pem \
+    -passin $password -extfile ../sample_certificate_v3_extensions \
+    -extensions intermediate_authority -days 3650
+
+# Create a certificate request for the server certificate
+openssl req -subj /CN=localhost -batch -verbose -passout $password -new \
+    -keyout localhost_key.pem -out localhost_request.pem
+
+# Sign the server certificate with the intermediate authority.  Add the
+# certificate extensions for SubjectAltName and that it is not a CA itself.
+openssl x509 -req -in localhost_request.pem -out localhost.pem -set_serial 1 \
+    -CA intermediate_authority.pem -CAkey intermediate_authority_key.pem \
+    -passin $password -extfile ../sample_certificate_v3_extensions \
+    -extensions localhost -days 3650
+
+# Create a self-signed client certificate authority.
+openssl req -subj /CN=clientauthority -set_serial 1 -batch -verbose \
+    -passout $password -new -x509 -keyout client_authority_key.pem \
+    -out client_authority.pem -config ../sample_certificate_v3_extensions \
+    -extensions client_authority -days 3650
+
+# Create certificate requests for the client certificates
+openssl req -subj /CN=user1 -batch -verbose -passout $password -new \
+    -keyout client1_key.pem -out client1_request.pem
+openssl req -subj /CN=user2 -batch -verbose -passout $password -new \
+    -keyout client2_key.pem -out client2_request.pem
+
+# Sign the certificate requests with the client authority
+openssl x509 -req -in client1_request.pem -out client1.pem -set_serial 2 \
+    -CA client_authority.pem -CAkey client_authority_key.pem \
+    -passin $password -extfile ../sample_certificate_v3_extensions \
+    -extensions client_certificate -days 3650
+openssl x509 -req -in client2_request.pem -out client2.pem -set_serial 3 \
+    -CA client_authority.pem -CAkey client_authority_key.pem \
+    -passin $password -extfile ../sample_certificate_v3_extensions \
+    -extensions client_certificate -days 3650
+
+# Delete all the signing keys for the authorities, so testers that add
+# them as trusted are less vulnerable: only the sample server certificate
+# and client certificates will be signed by them. No more certificates
+# will ever be signed.
+rm root_authority_key.pem
+rm intermediate_authority.pem
+rm client_authority_key.pem
+
+# Copy the certificates we will use to the 'certificates' directory.
+CERTS=../certificates
+cat localhost.pem intermediate_authority.pem root_authority.pem \
+    > $CERTS/server_chain.pem
+
+cat intermediate_authority.pem root_authority.pem client_authority.pem \
+    > $CERTS/server_trusted.pem
+
+# BoringSSL only accepts private keys signed with the PBE-SHA1-RC4-128 cipher.
+openssl pkcs8 -in localhost_key.pem -out $CERTS/server_key.pem \
+    -topk8 -v1 PBE-SHA1-RC4-128 -passin $password -passout $password
+openssl pkcs8 -in client1_key.pem -out $CERTS/client1_key.pem \
+    -topk8 -v1 PBE-SHA1-RC4-128 -passin $password -passout $password
+openssl pkcs8 -in client2_key.pem -out $CERTS/client2_key.pem \
+    -topk8 -v1 PBE-SHA1-RC4-128 -passin $password -passout $password
+
+cp root_authority.pem $CERTS/trusted_certs.pem
+cp client_authority.pem $CERTS
+cp client1.pem $CERTS
+cp client2.pem $CERTS
+
+cd ..
diff --git a/tests/standalone/io/http_cookie_date_test.dart b/tests/standalone/io/http_cookie_date_test.dart
index 51e3e1f..bb7a1a2 100644
--- a/tests/standalone/io/http_cookie_date_test.dart
+++ b/tests/standalone/io/http_cookie_date_test.dart
@@ -8,6 +8,7 @@
 import "dart:async";
 import "dart:collection";
 import "dart:convert";
+import "dart:developer";
 import "dart:math";
 import "dart:typed_data";
 import "dart:isolate";
@@ -28,6 +29,7 @@
 part "../../../sdk/lib/io/http_parser.dart";
 part "../../../sdk/lib/io/http_headers.dart";
 part "../../../sdk/lib/io/http_session.dart";
+part "../../../sdk/lib/io/io_resource_info.dart";
 part "../../../sdk/lib/io/io_service.dart";
 part "../../../sdk/lib/io/io_sink.dart";
 part "../../../sdk/lib/io/platform.dart";
@@ -35,6 +37,7 @@
 part "../../../sdk/lib/io/service_object.dart";
 part "../../../sdk/lib/io/secure_socket.dart";
 part "../../../sdk/lib/io/secure_server_socket.dart";
+part "../../../sdk/lib/io/security_context.dart";
 part "../../../sdk/lib/io/socket.dart";
 
 void testParseHttpCookieDate() {
diff --git a/tests/standalone/io/http_headers_test.dart b/tests/standalone/io/http_headers_test.dart
index 6d2b92d..6dbdcd4 100644
--- a/tests/standalone/io/http_headers_test.dart
+++ b/tests/standalone/io/http_headers_test.dart
@@ -8,6 +8,7 @@
 import "dart:async";
 import "dart:collection";
 import "dart:convert";
+import "dart:developer";
 import "dart:math";
 import "dart:typed_data";
 import "dart:isolate";
@@ -28,6 +29,7 @@
 part "../../../sdk/lib/io/http_parser.dart";
 part "../../../sdk/lib/io/http_headers.dart";
 part "../../../sdk/lib/io/http_session.dart";
+part "../../../sdk/lib/io/io_resource_info.dart";
 part "../../../sdk/lib/io/io_service.dart";
 part "../../../sdk/lib/io/io_sink.dart";
 part "../../../sdk/lib/io/platform.dart";
@@ -35,6 +37,7 @@
 part "../../../sdk/lib/io/service_object.dart";
 part "../../../sdk/lib/io/secure_socket.dart";
 part "../../../sdk/lib/io/secure_server_socket.dart";
+part "../../../sdk/lib/io/security_context.dart";
 part "../../../sdk/lib/io/socket.dart";
 
 void testMultiValue() {
diff --git a/tests/standalone/io/http_parser_test.dart b/tests/standalone/io/http_parser_test.dart
index 6302dc6..95edf3b 100644
--- a/tests/standalone/io/http_parser_test.dart
+++ b/tests/standalone/io/http_parser_test.dart
@@ -8,6 +8,7 @@
 import "dart:async";
 import "dart:collection";
 import "dart:convert";
+import "dart:developer";
 import "dart:math";
 import "dart:typed_data";
 import "dart:isolate";
@@ -28,6 +29,7 @@
 part "../../../sdk/lib/io/http_parser.dart";
 part "../../../sdk/lib/io/http_headers.dart";
 part "../../../sdk/lib/io/http_session.dart";
+part "../../../sdk/lib/io/io_resource_info.dart";
 part "../../../sdk/lib/io/io_service.dart";
 part "../../../sdk/lib/io/io_sink.dart";
 part "../../../sdk/lib/io/platform.dart";
@@ -35,6 +37,7 @@
 part "../../../sdk/lib/io/service_object.dart";
 part "../../../sdk/lib/io/secure_socket.dart";
 part "../../../sdk/lib/io/secure_server_socket.dart";
+part "../../../sdk/lib/io/security_context.dart";
 part "../../../sdk/lib/io/socket.dart";
 
 class HttpParserTest {
diff --git a/tests/standalone/io/http_proxy_advanced_test.dart b/tests/standalone/io/http_proxy_advanced_test.dart
new file mode 100644
index 0000000..aeafaf0
--- /dev/null
+++ b/tests/standalone/io/http_proxy_advanced_test.dart
@@ -0,0 +1,636 @@
+// 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:crypto/crypto.dart";
+import "package:expect/expect.dart";
+import "package:path/path.dart";
+import "dart:async";
+import "dart:io";
+import 'dart:convert';
+
+String localFile(path) => Platform.script.resolve(path).toFilePath();
+
+SecurityContext serverContext = new SecurityContext()
+  ..useCertificateChain(localFile('certificates/server_chain.pem'))
+  ..usePrivateKey(localFile('certificates/server_key.pem'),
+                  password: 'dartdart');
+
+SecurityContext clientContext = new SecurityContext()
+  ..setTrustedCertificates(file: localFile('certificates/trusted_certs.pem'));
+
+class Server {
+  HttpServer server;
+  bool secure;
+  int proxyHops;
+  List<String> directRequestPaths;
+  int requestCount = 0;
+
+  Server(this.proxyHops, this.directRequestPaths, this.secure);
+
+  Future<Server> start() {
+    return (secure ?
+        HttpServer.bindSecure("localhost", 0, serverContext) :
+        HttpServer.bind("localhost", 0))
+    .then((s) {
+      server = s;
+      server.listen(requestHandler);
+      return this;
+    });
+  }
+
+  void requestHandler(HttpRequest request) {
+    var response = request.response;
+    requestCount++;
+    // Check whether a proxy or direct connection is expected.
+    bool direct = directRequestPaths.fold(
+        false,
+        (prev, path) => prev ? prev : path == request.uri.path);
+    if (!secure && !direct && proxyHops > 0) {
+      Expect.isNotNull(request.headers[HttpHeaders.VIA]);
+      Expect.equals(1, request.headers[HttpHeaders.VIA].length);
+      Expect.equals(
+          proxyHops,
+          request.headers[HttpHeaders.VIA][0].split(",").length);
+    } else {
+      Expect.isNull(request.headers[HttpHeaders.VIA]);
+    }
+    var body = new StringBuffer();
+    onRequestComplete() {
+      String path = request.uri.path.substring(1);
+      if (path != "A") {
+        String content = "$path$path$path";
+        Expect.equals(content, body.toString());
+      }
+      response.write(request.uri.path);
+      response.close();
+    }
+    request.listen((data) {
+      body.write(new String.fromCharCodes(data));
+    }, onDone: onRequestComplete);
+  }
+
+  void shutdown() {
+    server.close();
+  }
+
+  int get port => server.port;
+}
+
+Future<Server> setupServer(int proxyHops,
+                   {List<String> directRequestPaths: const <String>[],
+                    secure: false}) {
+  Server server = new Server(proxyHops, directRequestPaths, secure);
+  return server.start();
+}
+
+class ProxyServer {
+  final bool ipV6;
+  HttpServer server;
+  HttpClient client;
+  int requestCount = 0;
+  String authScheme;
+  String realm = "test";
+  String username;
+  String password;
+
+  var ha1;
+  String serverAlgorithm = "MD5";
+  String serverQop = "auth";
+  Set ncs = new Set();
+
+  var nonce = "12345678";  // No need for random nonce in test.
+
+  ProxyServer({this.ipV6: false}) : client = new HttpClient();
+
+  void useBasicAuthentication(String username, String password) {
+    this.username = username;
+    this.password = password;
+    authScheme = "Basic";
+  }
+
+  void useDigestAuthentication(String username, String password) {
+    this.username = username;
+    this.password = password;
+    authScheme = "Digest";
+
+    // Calculate ha1.
+    var hasher = new MD5();
+    hasher.add("${username}:${realm}:${password}".codeUnits);
+    ha1 = CryptoUtils.bytesToHex(hasher.close());
+  }
+
+  basicAuthenticationRequired(request) {
+    request.fold(null, (x, y) {}).then((_) {
+      var response = request.response;
+      response.headers.set(HttpHeaders.PROXY_AUTHENTICATE,
+                           "Basic, realm=$realm");
+      response.statusCode = HttpStatus.PROXY_AUTHENTICATION_REQUIRED;
+      response.close();
+    });
+  }
+
+  digestAuthenticationRequired(request, {stale: false}) {
+    request.fold(null, (x, y) {}).then((_) {
+      var response = request.response;
+      response.statusCode = HttpStatus.PROXY_AUTHENTICATION_REQUIRED;
+      StringBuffer authHeader = new StringBuffer();
+      authHeader.write('Digest');
+      authHeader.write(', realm="$realm"');
+      authHeader.write(', nonce="$nonce"');
+      if (stale) authHeader.write(', stale="true"');
+      if (serverAlgorithm != null) {
+        authHeader.write(', algorithm=$serverAlgorithm');
+      }
+      if (serverQop != null) authHeader.write(', qop="$serverQop"');
+      response.headers.set(HttpHeaders.PROXY_AUTHENTICATE, authHeader);
+      response.close();
+    });
+  }
+
+  Future<ProxyServer> start() {
+    var x = new Completer();
+    var host = ipV6 ? "::1" : "localhost";
+    HttpServer.bind(host, 0).then((s) {
+      server = s;
+      x.complete(this);
+      server.listen((HttpRequest request) {
+        requestCount++;
+        if (username != null && password != null) {
+          if (request.headers[HttpHeaders.PROXY_AUTHORIZATION] == null) {
+            if (authScheme == "Digest") {
+              digestAuthenticationRequired(request);
+            } else {
+              basicAuthenticationRequired(request);
+            }
+            return;
+          } else {
+            Expect.equals(
+                1, request.headers[HttpHeaders.PROXY_AUTHORIZATION].length);
+            String authorization =
+              request.headers[HttpHeaders.PROXY_AUTHORIZATION][0];
+            if (authScheme == "Basic") {
+              List<String> tokens = authorization.split(" ");
+              Expect.equals("Basic", tokens[0]);
+              String auth =
+                  CryptoUtils.bytesToBase64(UTF8.encode("$username:$password"));
+              if (auth != tokens[1]) {
+                basicAuthenticationRequired(request);
+                return;
+              }
+            } else {
+              HeaderValue header =
+                  HeaderValue.parse(
+                      authorization, parameterSeparator: ",");
+              Expect.equals("Digest", header.value);
+              var uri = header.parameters["uri"];
+              var qop = header.parameters["qop"];
+              var cnonce = header.parameters["cnonce"];
+              var nc = header.parameters["nc"];
+              Expect.equals(username, header.parameters["username"]);
+              Expect.equals(realm, header.parameters["realm"]);
+              Expect.equals("MD5", header.parameters["algorithm"]);
+              Expect.equals(nonce, header.parameters["nonce"]);
+              Expect.equals(request.uri.toString(), uri);
+              if (qop != null) {
+                // A server qop of auth-int is downgraded to none by the client.
+                Expect.equals("auth", serverQop);
+                Expect.equals("auth", header.parameters["qop"]);
+                Expect.isNotNull(cnonce);
+                Expect.isNotNull(nc);
+                Expect.isFalse(ncs.contains(nc));
+                ncs.add(nc);
+              } else {
+                Expect.isNull(cnonce);
+                Expect.isNull(nc);
+              }
+              Expect.isNotNull(header.parameters["response"]);
+
+              var hasher = new MD5();
+              hasher.add("${request.method}:${uri}".codeUnits);
+              var ha2 = CryptoUtils.bytesToHex(hasher.close());
+
+              var x;
+              hasher = new MD5();
+              if (qop == null || qop == "" || qop == "none") {
+                hasher.add("$ha1:${nonce}:$ha2".codeUnits);
+              } else {
+                hasher.add(
+                    "$ha1:${nonce}:${nc}:${cnonce}:${qop}:$ha2".codeUnits);
+              }
+              Expect.equals(CryptoUtils.bytesToHex(hasher.close()),
+                            header.parameters["response"]);
+
+              // Add a bogus Proxy-Authentication-Info for testing.
+              var info = 'rspauth="77180d1ab3d6c9de084766977790f482", '
+                         'cnonce="8f971178", '
+                         'nc=000002c74, '
+                         'qop=auth';
+              request.response.headers.set("Proxy-Authentication-Info", info);
+            }
+          }
+        }
+        // Open the connection from the proxy.
+        if (request.method == "CONNECT") {
+          var tmp = request.uri.toString().split(":");
+          Socket.connect(tmp[0], int.parse(tmp[1]))
+              .then((socket) {
+                request.response.reasonPhrase = "Connection established";
+                request.response.detachSocket()
+                    .then((detached) {
+                      socket.pipe(detached);
+                      detached.pipe(socket);
+                    });
+              });
+        } else {
+          client.openUrl(request.method, request.uri)
+            .then((HttpClientRequest clientRequest) {
+              // Forward all headers.
+              request.headers.forEach((String name, List<String> values) {
+                values.forEach((String value) {
+                  if (name != "content-length" && name != "via") {
+                    clientRequest.headers.add(name, value);
+                  }
+                });
+              });
+              // Special handling of Content-Length and Via.
+              clientRequest.contentLength = request.contentLength;
+              List<String> via = request.headers[HttpHeaders.VIA];
+              String viaPrefix = via == null ? "" : "${via[0]}, ";
+              clientRequest.headers.add(
+                  HttpHeaders.VIA, "${viaPrefix}1.1 localhost:$port");
+              // Copy all content.
+              return request.pipe(clientRequest);
+            })
+            .then((HttpClientResponse clientResponse) {
+              clientResponse.pipe(request.response);
+            });
+        }
+      });
+    });
+    return x.future;
+  }
+
+  void shutdown() {
+    server.close();
+    client.close();
+  }
+
+  int get port => server.port;
+}
+
+Future<ProxyServer> setupProxyServer({ipV6: false}) {
+  ProxyServer proxyServer = new ProxyServer(ipV6: ipV6);
+  return proxyServer.start();
+}
+
+
+int testProxyIPV6DoneCount = 0;
+void testProxyIPV6() {
+  setupProxyServer(ipV6: true).then((proxyServer) {
+  setupServer(1, directRequestPaths: ["/4"]).then((server) {
+  setupServer(1, directRequestPaths: ["/4"], secure: true).then((secureServer) {
+    HttpClient client = new HttpClient(context: clientContext);
+
+    List<String> proxy = ["PROXY [::1]:${proxyServer.port}"];
+    client.findProxy = (Uri uri) {
+      // Pick the proxy configuration based on the request path.
+      int index = int.parse(uri.path.substring(1));
+      return proxy[index];
+    };
+
+    for (int i = 0; i < proxy.length; i++) {
+      test(bool secure) {
+        String url = secure
+            ? "https://localhost:${secureServer.port}/$i"
+            : "http://localhost:${server.port}/$i";
+
+        client.postUrl(Uri.parse(url))
+          .then((HttpClientRequest clientRequest) {
+            String content = "$i$i$i";
+            clientRequest.write(content);
+            return clientRequest.close();
+          })
+          .then((HttpClientResponse response) {
+            response.listen((_) {}, onDone: () {
+              testProxyIPV6DoneCount++;
+              if (testProxyIPV6DoneCount == proxy.length * 2) {
+                Expect.equals(proxy.length, server.requestCount);
+                Expect.equals(proxy.length, secureServer.requestCount);
+                proxyServer.shutdown();
+                server.shutdown();
+                secureServer.shutdown();
+                client.close();
+              }
+            });
+          });
+      }
+
+      test(false);
+      test(true);
+    }
+  });
+  });
+  });
+}
+
+
+int testProxyFromEnviromentDoneCount = 0;
+void testProxyFromEnviroment() {
+  setupProxyServer().then((proxyServer) {
+  setupServer(1).then((server) {
+  setupServer(1, secure: true).then((secureServer) {
+    HttpClient client = new HttpClient(context: clientContext);
+
+    client.findProxy = (Uri uri) {
+      return HttpClient.findProxyFromEnvironment(
+          uri,
+          environment: {"http_proxy": "localhost:${proxyServer.port}",
+                        "https_proxy": "localhost:${proxyServer.port}"});
+    };
+
+    const int loopCount = 5;
+    for (int i = 0; i < loopCount; i++) {
+      test(bool secure) {
+        String url = secure
+            ? "https://localhost:${secureServer.port}/$i"
+            : "http://localhost:${server.port}/$i";
+
+        client.postUrl(Uri.parse(url))
+          .then((HttpClientRequest clientRequest) {
+            String content = "$i$i$i";
+            clientRequest.write(content);
+            return clientRequest.close();
+          })
+          .then((HttpClientResponse response) {
+            response.listen((_) {}, onDone: () {
+              testProxyFromEnviromentDoneCount++;
+              if (testProxyFromEnviromentDoneCount == loopCount * 2) {
+                Expect.equals(loopCount, server.requestCount);
+                Expect.equals(loopCount, secureServer.requestCount);
+                proxyServer.shutdown();
+                server.shutdown();
+                secureServer.shutdown();
+                client.close();
+              }
+            });
+          });
+      }
+
+      test(false);
+      test(true);
+    }
+  });
+  });
+  });
+}
+
+
+int testProxyAuthenticateCount = 0;
+Future testProxyAuthenticate(bool useDigestAuthentication) {
+  testProxyAuthenticateCount = 0;
+  var completer = new Completer();
+
+  setupProxyServer().then((proxyServer) {
+  setupServer(1).then((server) {
+  setupServer(1, secure: true).then((secureServer) {
+    HttpClient client = new HttpClient(context: clientContext);
+
+    Completer step1 = new Completer();
+    Completer step2 = new Completer();
+
+    if (useDigestAuthentication) {
+      proxyServer.useDigestAuthentication("dart", "password");
+    } else {
+      proxyServer.useBasicAuthentication("dart", "password");
+    }
+
+    // Test with no authentication.
+    client.findProxy = (Uri uri) {
+      return "PROXY localhost:${proxyServer.port}";
+    };
+
+    const int loopCount = 2;
+    for (int i = 0; i < loopCount; i++) {
+      test(bool secure) {
+        String url = secure
+            ? "https://localhost:${secureServer.port}/$i"
+            : "http://localhost:${server.port}/$i";
+
+        client.postUrl(Uri.parse(url))
+          .then((HttpClientRequest clientRequest) {
+            String content = "$i$i$i";
+            clientRequest.write(content);
+            return clientRequest.close();
+          })
+          .then((HttpClientResponse response) {
+            Expect.fail("No response expected");
+          }).
+          catchError((e) {
+            testProxyAuthenticateCount++;
+            if (testProxyAuthenticateCount == loopCount * 2) {
+              Expect.equals(0, server.requestCount);
+              Expect.equals(0, secureServer.requestCount);
+              step1.complete(null);
+            }
+        });
+      }
+
+      test(false);
+      test(true);
+    }
+    step1.future.then((_) {
+      testProxyAuthenticateCount = 0;
+      if (useDigestAuthentication) {
+        client.findProxy = (Uri uri) => "PROXY localhost:${proxyServer.port}";
+        client.addProxyCredentials(
+            "localhost",
+            proxyServer.port,
+            "test",
+            new HttpClientDigestCredentials("dart", "password"));
+      } else {
+        client.findProxy = (Uri uri) {
+          return "PROXY dart:password@localhost:${proxyServer.port}";
+        };
+      }
+
+      for (int i = 0; i < loopCount; i++) {
+        test(bool secure) {
+          var path = useDigestAuthentication ? "A" : "$i";
+          String url = secure
+              ? "https://localhost:${secureServer.port}/$path"
+              : "http://localhost:${server.port}/$path";
+
+          client.postUrl(Uri.parse(url))
+            .then((HttpClientRequest clientRequest) {
+              String content = "$i$i$i";
+              clientRequest.write(content);
+              return clientRequest.close();
+            })
+            .then((HttpClientResponse response) {
+              response.listen((_) {}, onDone: () {
+                testProxyAuthenticateCount++;
+                Expect.equals(HttpStatus.OK, response.statusCode);
+                if (testProxyAuthenticateCount == loopCount * 2) {
+                  Expect.equals(loopCount, server.requestCount);
+                  Expect.equals(loopCount, secureServer.requestCount);
+                  step2.complete(null);
+                }
+              });
+            });
+        }
+
+        test(false);
+        test(true);
+      }
+    });
+
+    step2.future.then((_) {
+      testProxyAuthenticateCount = 0;
+      client.findProxy = (Uri uri) {
+        return "PROXY localhost:${proxyServer.port}";
+      };
+
+      client.authenticateProxy = (host, port, scheme, realm) {
+        client.addProxyCredentials(
+            "localhost",
+            proxyServer.port,
+            "realm",
+            new HttpClientBasicCredentials("dart", "password"));
+        return new Future.value(true);
+      };
+
+      for (int i = 0; i < loopCount; i++) {
+        test(bool secure) {
+          String url = secure
+              ? "https://localhost:${secureServer.port}/A"
+              : "http://localhost:${server.port}/A";
+
+          client.postUrl(Uri.parse(url))
+            .then((HttpClientRequest clientRequest) {
+              String content = "$i$i$i";
+              clientRequest.write(content);
+              return clientRequest.close();
+            })
+            .then((HttpClientResponse response) {
+              response.listen((_) {}, onDone: () {
+                testProxyAuthenticateCount++;
+                Expect.equals(HttpStatus.OK, response.statusCode);
+                if (testProxyAuthenticateCount == loopCount * 2) {
+                  Expect.equals(loopCount * 2, server.requestCount);
+                  Expect.equals(loopCount * 2, secureServer.requestCount);
+                  proxyServer.shutdown();
+                  server.shutdown();
+                  secureServer.shutdown();
+                  client.close();
+                  completer.complete(null);
+                }
+              });
+            });
+        }
+        test(false);
+        test(true);
+      }
+    });
+
+  });
+  });
+  });
+
+  return completer.future;
+}
+
+int testRealProxyDoneCount = 0;
+void testRealProxy() {
+  setupServer(1).then((server) {
+    HttpClient client = new HttpClient(context: clientContext);
+     client.addProxyCredentials(
+         "localhost",
+         8080,
+         "test",
+         new HttpClientBasicCredentials("dart", "password"));
+
+    List<String> proxy =
+        ["PROXY localhost:8080",
+         "PROXY localhost:8080; PROXY hede.hule.hest:8080",
+         "PROXY hede.hule.hest:8080; PROXY localhost:8080",
+         "PROXY localhost:8080; DIRECT"];
+
+    client.findProxy = (Uri uri) {
+      // Pick the proxy configuration based on the request path.
+      int index = int.parse(uri.path.substring(1));
+      return proxy[index];
+    };
+
+    for (int i = 0; i < proxy.length; i++) {
+      client.getUrl(Uri.parse("http://localhost:${server.port}/$i"))
+        .then((HttpClientRequest clientRequest) {
+          String content = "$i$i$i";
+          clientRequest.contentLength = content.length;
+          clientRequest.write(content);
+          return clientRequest.close();
+        })
+        .then((HttpClientResponse response) {
+          response.listen((_) {}, onDone: () {
+            if (++testRealProxyDoneCount == proxy.length) {
+              Expect.equals(proxy.length, server.requestCount);
+              server.shutdown();
+              client.close();
+            }
+          });
+        });
+    }
+  });
+}
+
+int testRealProxyAuthDoneCount = 0;
+void testRealProxyAuth() {
+  setupServer(1).then((server) {
+    HttpClient client = new HttpClient(context: clientContext);
+
+    List<String> proxy =
+        ["PROXY dart:password@localhost:8080",
+         "PROXY dart:password@localhost:8080; PROXY hede.hule.hest:8080",
+         "PROXY hede.hule.hest:8080; PROXY dart:password@localhost:8080",
+         "PROXY dart:password@localhost:8080; DIRECT"];
+
+    client.findProxy = (Uri uri) {
+      // Pick the proxy configuration based on the request path.
+      int index = int.parse(uri.path.substring(1));
+      return proxy[index];
+    };
+
+    for (int i = 0; i < proxy.length; i++) {
+      client.getUrl(Uri.parse("http://localhost:${server.port}/$i"))
+        .then((HttpClientRequest clientRequest) {
+          String content = "$i$i$i";
+          clientRequest.contentLength = content.length;
+          clientRequest.write(content);
+          return clientRequest.close();
+        })
+        .then((HttpClientResponse response) {
+          response.listen((_) {}, onDone: () {
+            if (++testRealProxyAuthDoneCount == proxy.length) {
+              Expect.equals(proxy.length, server.requestCount);
+              server.shutdown();
+              client.close();
+            }
+          });
+        });
+    }
+  });
+}
+
+main() {
+  testProxyIPV6();
+  testProxyFromEnviroment();
+  // The two invocations use the same global variable for state -
+  // run one after the other.
+  testProxyAuthenticate(false)
+      .then((_) => testProxyAuthenticate(true));
+
+  // This test is not normally run. It can be used for locally testing
+  // with a real proxy server (e.g. Apache).
+  // testRealProxy();
+  // testRealProxyAuth();
+}
diff --git a/tests/standalone/io/http_proxy_test.dart b/tests/standalone/io/http_proxy_test.dart
index 63a125f..e5607e9 100644
--- a/tests/standalone/io/http_proxy_test.dart
+++ b/tests/standalone/io/http_proxy_test.dart
@@ -9,6 +9,16 @@
 import "dart:io";
 import 'dart:convert';
 
+String localFile(path) => Platform.script.resolve(path).toFilePath();
+
+SecurityContext serverContext = new SecurityContext()
+  ..useCertificateChain(localFile('certificates/server_chain.pem'))
+  ..usePrivateKey(localFile('certificates/server_key.pem'),
+                  password: 'dartdart');
+
+SecurityContext clientContext = new SecurityContext()
+  ..setTrustedCertificates(file: localFile('certificates/trusted_certs.pem'));
+
 class Server {
   HttpServer server;
   bool secure;
@@ -19,49 +29,47 @@
   Server(this.proxyHops, this.directRequestPaths, this.secure);
 
   Future<Server> start() {
-    var x = new Completer();
-    Future f = secure
-        ? HttpServer.bindSecure(
-            "localhost", 0, certificateName: 'localhost_cert')
-        : HttpServer.bind("localhost", 0);
-    return f.then((s) {
+    return (secure ?
+        HttpServer.bindSecure("localhost", 0, serverContext) :
+        HttpServer.bind("localhost", 0))
+    .then((s) {
       server = s;
-      x.complete(this);
-      server.listen((request) {
-        var response = request.response;
-        requestCount++;
-        // Check whether a proxy or direct connection is expected.
-        bool direct = directRequestPaths.fold(
-            false,
-            (prev, path) => prev ? prev : path == request.uri.path);
-        if (!secure && !direct && proxyHops > 0) {
-          Expect.isNotNull(request.headers[HttpHeaders.VIA]);
-          Expect.equals(1, request.headers[HttpHeaders.VIA].length);
-          Expect.equals(
-              proxyHops,
-              request.headers[HttpHeaders.VIA][0].split(",").length);
-        } else {
-          Expect.isNull(request.headers[HttpHeaders.VIA]);
-        }
-        var body = new StringBuffer();
-        request.listen(
-            (data) {
-              body.write(new String.fromCharCodes(data));
-            },
-            onDone: () {
-              String path = request.uri.path.substring(1);
-              if (path != "A") {
-                String content = "$path$path$path";
-                Expect.equals(content, body.toString());
-              }
-              response.write(request.uri.path);
-              response.close();
-            });
-      });
-      return x.future;
+      server.listen(requestHandler);
+      return this;
     });
   }
 
+  void requestHandler(HttpRequest request) {
+    var response = request.response;
+    requestCount++;
+    // Check whether a proxy or direct connection is expected.
+    bool direct = directRequestPaths.fold(
+        false,
+        (prev, path) => prev ? prev : path == request.uri.path);
+    if (!secure && !direct && proxyHops > 0) {
+      Expect.isNotNull(request.headers[HttpHeaders.VIA]);
+      Expect.equals(1, request.headers[HttpHeaders.VIA].length);
+      Expect.equals(
+          proxyHops,
+          request.headers[HttpHeaders.VIA][0].split(",").length);
+    } else {
+      Expect.isNull(request.headers[HttpHeaders.VIA]);
+    }
+    var body = new StringBuffer();
+    onRequestComplete() {
+      String path = request.uri.path.substring(1);
+      if (path != "A") {
+        String content = "$path$path$path";
+        Expect.equals(content, body.toString());
+      }
+      response.write(request.uri.path);
+      response.close();
+    }
+    request.listen((data) {
+      body.write(new String.fromCharCodes(data));
+    }, onDone: onRequestComplete);
+  }
+
   void shutdown() {
     server.close();
   }
@@ -277,7 +285,7 @@
 }
 
 testInvalidProxy() {
-  HttpClient client = new HttpClient();
+  HttpClient client = new HttpClient(context: clientContext);
 
   client.findProxy = (Uri uri) => "";
   client.getUrl(Uri.parse("http://www.google.com/test"))
@@ -299,7 +307,7 @@
 int testDirectDoneCount = 0;
 void testDirectProxy() {
   setupServer(0).then((server) {
-    HttpClient client = new HttpClient();
+    HttpClient client = new HttpClient(context: clientContext);
     List<String> proxy =
         ["DIRECT", " DIRECT ", "DIRECT ;", " DIRECT ; ",
          ";DIRECT", " ; DIRECT ", ";;DIRECT;;"];
@@ -336,7 +344,7 @@
   setupProxyServer().then((proxyServer) {
   setupServer(1, directRequestPaths: ["/4"]).then((server) {
   setupServer(1, directRequestPaths: ["/4"], secure: true).then((secureServer) {
-    HttpClient client = new HttpClient();
+    HttpClient client = new HttpClient(context: clientContext);
 
     List<String> proxy;
     if (Platform.operatingSystem == "windows") {
@@ -399,54 +407,6 @@
   });
 }
 
-int testProxyIPV6DoneCount = 0;
-void testProxyIPV6() {
-  setupProxyServer(ipV6: true).then((proxyServer) {
-  setupServer(1, directRequestPaths: ["/4"]).then((server) {
-  setupServer(1, directRequestPaths: ["/4"], secure: true).then((secureServer) {
-    HttpClient client = new HttpClient();
-
-    List<String> proxy = ["PROXY [::1]:${proxyServer.port}"];
-    client.findProxy = (Uri uri) {
-      // Pick the proxy configuration based on the request path.
-      int index = int.parse(uri.path.substring(1));
-      return proxy[index];
-    };
-
-    for (int i = 0; i < proxy.length; i++) {
-      test(bool secure) {
-        String url = secure
-            ? "https://localhost:${secureServer.port}/$i"
-            : "http://localhost:${server.port}/$i";
-
-        client.postUrl(Uri.parse(url))
-          .then((HttpClientRequest clientRequest) {
-            String content = "$i$i$i";
-            clientRequest.write(content);
-            return clientRequest.close();
-          })
-          .then((HttpClientResponse response) {
-            response.listen((_) {}, onDone: () {
-              testProxyIPV6DoneCount++;
-              if (testProxyIPV6DoneCount == proxy.length * 2) {
-                Expect.equals(proxy.length, server.requestCount);
-                Expect.equals(proxy.length, secureServer.requestCount);
-                proxyServer.shutdown();
-                server.shutdown();
-                secureServer.shutdown();
-                client.close();
-              }
-            });
-          });
-      }
-
-      test(false);
-      test(true);
-    }
-  });
-  });
-  });
-}
 
 int testProxyChainDoneCount = 0;
 void testProxyChain() {
@@ -456,7 +416,7 @@
   proxyServer1.client.findProxy = (_) => "PROXY localhost:${proxyServer2.port}";
 
   setupServer(2, directRequestPaths: ["/4"]).then((server) {
-    HttpClient client = new HttpClient();
+    HttpClient client = new HttpClient(context: clientContext);
 
     List<String> proxy;
     if (Platform.operatingSystem == "windows") {
@@ -510,312 +470,9 @@
   });
 }
 
-int testProxyFromEnviromentDoneCount = 0;
-void testProxyFromEnviroment() {
-  setupProxyServer().then((proxyServer) {
-  setupServer(1).then((server) {
-  setupServer(1, secure: true).then((secureServer) {
-    HttpClient client = new HttpClient();
-
-    client.findProxy = (Uri uri) {
-      return HttpClient.findProxyFromEnvironment(
-          uri,
-          environment: {"http_proxy": "localhost:${proxyServer.port}",
-                        "https_proxy": "localhost:${proxyServer.port}"});
-    };
-
-    const int loopCount = 5;
-    for (int i = 0; i < loopCount; i++) {
-      test(bool secure) {
-        String url = secure
-            ? "https://localhost:${secureServer.port}/$i"
-            : "http://localhost:${server.port}/$i";
-
-        client.postUrl(Uri.parse(url))
-          .then((HttpClientRequest clientRequest) {
-            String content = "$i$i$i";
-            clientRequest.write(content);
-            return clientRequest.close();
-          })
-          .then((HttpClientResponse response) {
-            response.listen((_) {}, onDone: () {
-              testProxyFromEnviromentDoneCount++;
-              if (testProxyFromEnviromentDoneCount == loopCount * 2) {
-                Expect.equals(loopCount, server.requestCount);
-                Expect.equals(loopCount, secureServer.requestCount);
-                proxyServer.shutdown();
-                server.shutdown();
-                secureServer.shutdown();
-                client.close();
-              }
-            });
-          });
-      }
-
-      test(false);
-      test(true);
-    }
-  });
-  });
-  });
-}
-
-
-int testProxyAuthenticateCount = 0;
-Future testProxyAuthenticate(bool useDigestAuthentication) {
-  testProxyAuthenticateCount = 0;
-  var completer = new Completer();
-
-  setupProxyServer().then((proxyServer) {
-  setupServer(1).then((server) {
-  setupServer(1, secure: true).then((secureServer) {
-    HttpClient client = new HttpClient();
-
-    Completer step1 = new Completer();
-    Completer step2 = new Completer();
-
-    if (useDigestAuthentication) {
-      proxyServer.useDigestAuthentication("dart", "password");
-    } else {
-      proxyServer.useBasicAuthentication("dart", "password");
-    }
-
-    // Test with no authentication.
-    client.findProxy = (Uri uri) {
-      return "PROXY localhost:${proxyServer.port}";
-    };
-
-    const int loopCount = 2;
-    for (int i = 0; i < loopCount; i++) {
-      test(bool secure) {
-        String url = secure
-            ? "https://localhost:${secureServer.port}/$i"
-            : "http://localhost:${server.port}/$i";
-
-        client.postUrl(Uri.parse(url))
-          .then((HttpClientRequest clientRequest) {
-            String content = "$i$i$i";
-            clientRequest.write(content);
-            return clientRequest.close();
-          })
-          .then((HttpClientResponse response) {
-            Expect.fail("No response expected");
-          }).
-          catchError((e) {
-            testProxyAuthenticateCount++;
-            if (testProxyAuthenticateCount == loopCount * 2) {
-              Expect.equals(0, server.requestCount);
-              Expect.equals(0, secureServer.requestCount);
-              step1.complete(null);
-            }
-        });
-      }
-
-      test(false);
-      test(true);
-    }
-    step1.future.then((_) {
-      testProxyAuthenticateCount = 0;
-      if (useDigestAuthentication) {
-        client.findProxy = (Uri uri) => "PROXY localhost:${proxyServer.port}";
-        client.addProxyCredentials(
-            "localhost",
-            proxyServer.port,
-            "test",
-            new HttpClientDigestCredentials("dart", "password"));
-      } else {
-        client.findProxy = (Uri uri) {
-          return "PROXY dart:password@localhost:${proxyServer.port}";
-        };
-      }
-
-      for (int i = 0; i < loopCount; i++) {
-        test(bool secure) {
-          var path = useDigestAuthentication ? "A" : "$i";
-          String url = secure
-              ? "https://localhost:${secureServer.port}/$path"
-              : "http://localhost:${server.port}/$path";
-
-          client.postUrl(Uri.parse(url))
-            .then((HttpClientRequest clientRequest) {
-              String content = "$i$i$i";
-              clientRequest.write(content);
-              return clientRequest.close();
-            })
-            .then((HttpClientResponse response) {
-              response.listen((_) {}, onDone: () {
-                testProxyAuthenticateCount++;
-                Expect.equals(HttpStatus.OK, response.statusCode);
-                if (testProxyAuthenticateCount == loopCount * 2) {
-                  Expect.equals(loopCount, server.requestCount);
-                  Expect.equals(loopCount, secureServer.requestCount);
-                  step2.complete(null);
-                }
-              });
-            });
-        }
-
-        test(false);
-        test(true);
-      }
-    });
-
-    step2.future.then((_) {
-      testProxyAuthenticateCount = 0;
-      client.findProxy = (Uri uri) {
-        return "PROXY localhost:${proxyServer.port}";
-      };
-
-      client.authenticateProxy = (host, port, scheme, realm) {
-        client.addProxyCredentials(
-            "localhost",
-            proxyServer.port,
-            "realm",
-            new HttpClientBasicCredentials("dart", "password"));
-        return new Future.value(true);
-      };
-
-      for (int i = 0; i < loopCount; i++) {
-        test(bool secure) {
-          String url = secure
-              ? "https://localhost:${secureServer.port}/A"
-              : "http://localhost:${server.port}/A";
-
-          client.postUrl(Uri.parse(url))
-            .then((HttpClientRequest clientRequest) {
-              String content = "$i$i$i";
-              clientRequest.write(content);
-              return clientRequest.close();
-            })
-            .then((HttpClientResponse response) {
-              response.listen((_) {}, onDone: () {
-                testProxyAuthenticateCount++;
-                Expect.equals(HttpStatus.OK, response.statusCode);
-                if (testProxyAuthenticateCount == loopCount * 2) {
-                  Expect.equals(loopCount * 2, server.requestCount);
-                  Expect.equals(loopCount * 2, secureServer.requestCount);
-                  proxyServer.shutdown();
-                  server.shutdown();
-                  secureServer.shutdown();
-                  client.close();
-                  completer.complete(null);
-                }
-              });
-            });
-        }
-        test(false);
-        test(true);
-      }
-    });
-
-  });
-  });
-  });
-
-  return completer.future;
-}
-
-int testRealProxyDoneCount = 0;
-void testRealProxy() {
-  setupServer(1).then((server) {
-    HttpClient client = new HttpClient();
-     client.addProxyCredentials(
-         "localhost",
-         8080,
-         "test",
-         new HttpClientBasicCredentials("dart", "password"));
-
-    List<String> proxy =
-        ["PROXY localhost:8080",
-         "PROXY localhost:8080; PROXY hede.hule.hest:8080",
-         "PROXY hede.hule.hest:8080; PROXY localhost:8080",
-         "PROXY localhost:8080; DIRECT"];
-
-    client.findProxy = (Uri uri) {
-      // Pick the proxy configuration based on the request path.
-      int index = int.parse(uri.path.substring(1));
-      return proxy[index];
-    };
-
-    for (int i = 0; i < proxy.length; i++) {
-      client.getUrl(Uri.parse("http://localhost:${server.port}/$i"))
-        .then((HttpClientRequest clientRequest) {
-          String content = "$i$i$i";
-          clientRequest.contentLength = content.length;
-          clientRequest.write(content);
-          return clientRequest.close();
-        })
-        .then((HttpClientResponse response) {
-          response.listen((_) {}, onDone: () {
-            if (++testRealProxyDoneCount == proxy.length) {
-              Expect.equals(proxy.length, server.requestCount);
-              server.shutdown();
-              client.close();
-            }
-          });
-        });
-    }
-  });
-}
-
-int testRealProxyAuthDoneCount = 0;
-void testRealProxyAuth() {
-  setupServer(1).then((server) {
-    HttpClient client = new HttpClient();
-
-    List<String> proxy =
-        ["PROXY dart:password@localhost:8080",
-         "PROXY dart:password@localhost:8080; PROXY hede.hule.hest:8080",
-         "PROXY hede.hule.hest:8080; PROXY dart:password@localhost:8080",
-         "PROXY dart:password@localhost:8080; DIRECT"];
-
-    client.findProxy = (Uri uri) {
-      // Pick the proxy configuration based on the request path.
-      int index = int.parse(uri.path.substring(1));
-      return proxy[index];
-    };
-
-    for (int i = 0; i < proxy.length; i++) {
-      client.getUrl(Uri.parse("http://localhost:${server.port}/$i"))
-        .then((HttpClientRequest clientRequest) {
-          String content = "$i$i$i";
-          clientRequest.contentLength = content.length;
-          clientRequest.write(content);
-          return clientRequest.close();
-        })
-        .then((HttpClientResponse response) {
-          response.listen((_) {}, onDone: () {
-            if (++testRealProxyAuthDoneCount == proxy.length) {
-              Expect.equals(proxy.length, server.requestCount);
-              server.shutdown();
-              client.close();
-            }
-          });
-        });
-    }
-  });
-}
-
-void InitializeSSL() {
-  var testPkcertDatabase = Platform.script.resolve('pkcert').toFilePath();
-  SecureSocket.initialize(database: testPkcertDatabase,
-                          password: 'dartdart');
-}
-
 main() {
-  InitializeSSL();
   testInvalidProxy();
   testDirectProxy();
   testProxy();
-  testProxyIPV6();
   testProxyChain();
-  testProxyFromEnviroment();
-  // The two invocations of uses the same global variable for state -
-  // run one after the other.
-  testProxyAuthenticate(false)
-      .then((_) => testProxyAuthenticate(true));
-  // This test is not normally run. It can be used for locally testing
-  // with a real proxy server (e.g. Apache).
-  //testRealProxy();
-  //testRealProxyAuth();
 }
diff --git a/tests/standalone/io/http_requested_uri_test.dart b/tests/standalone/io/http_requested_uri_test.dart
index f573c03..03db108 100644
--- a/tests/standalone/io/http_requested_uri_test.dart
+++ b/tests/standalone/io/http_requested_uri_test.dart
@@ -7,19 +7,20 @@
 import "dart:async";
 import "dart:io";
 
-const PATH = '/path?a=b#c';
+const sendPath = '/path?a=b#c';
+const expectedPath = '/path?a=b';
 
 void test(String expected, Map headers) {
   asyncStart();
   HttpServer.bind("localhost", 0).then((server) {
     expected = expected.replaceAll('%PORT', server.port.toString());
     server.listen((request) {
-      Expect.equals("$expected$PATH",
+      Expect.equals("$expected$expectedPath",
                     request.requestedUri.toString());
       request.response.close();
     });
     HttpClient client = new HttpClient();
-    client.get("localhost", server.port, PATH)
+    client.get("localhost", server.port, sendPath)
       .then((request) {
         for (var v in headers.keys) {
           if (headers[v] != null) {
diff --git a/tests/standalone/io/https_bad_certificate_client.dart b/tests/standalone/io/https_bad_certificate_client.dart
deleted file mode 100644
index c2f79cd..0000000
--- a/tests/standalone/io/https_bad_certificate_client.dart
+++ /dev/null
@@ -1,81 +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.
-
-// Client for https_bad_certificate_test, that runs in a subprocess.
-// It verifies that the client bad certificate callback works in HttpClient.
-
-import "dart:async";
-import "dart:io";
-
-class ExpectException implements Exception {
-  ExpectException(this.message);
-  String toString() => "ExpectException: $message";
-  String message;
-}
-
-void expect(condition) {
-  if (!condition) {
-    throw new ExpectException('');
-  }
-}
-
-const HOST_NAME = "localhost";
-
-Future runHttpClient(int port, result) async {
-  bool badCertificateCallback(X509Certificate certificate,
-                              String host,
-                              int callbackPort) {
-    expect(HOST_NAME == host);
-    expect(callbackPort == port);
-    expect('CN=localhost' == certificate.subject);
-    expect('CN=myauthority' == certificate.issuer);
-    expect(result != 'exception');  // Throw exception if one is requested.
-    if (result == 'true') return true;
-    if (result == 'false') return false;
-    return result;
-  }
-
-  HttpClient client = new HttpClient();
-
-  await client.getUrl(Uri.parse('https://$HOST_NAME:$port/$result'))
-    .then((HttpClientRequest request) {
-      expect(result == 'true');  // The session cache may keep the session.
-      return request.close();
-    }, onError: (e) {
-      expect(e is HandshakeException || e is SocketException);
-    });
-
-  client.badCertificateCallback = badCertificateCallback;
-  await client.getUrl(Uri.parse('https://$HOST_NAME:$port/$result'))
-    .then((HttpClientRequest request) {
-      expect(result == 'true');
-      return request.close();
-    }, onError: (e) {
-      if (result == 'false') expect (e is HandshakeException ||
-                                     e is SocketException);
-      else if (result == 'exception') expect (e is ExpectException ||
-                                              e is SocketException);
-      else {
-        expect (e is ArgumentError || e is SocketException);
-      }
-    });
-
-  client.badCertificateCallback = null;
-  await client.getUrl(Uri.parse('https://$HOST_NAME:$port/$result'))
-    .then((HttpClientRequest request) {
-      expect(result == 'true');  // The session cache may keep the session.
-      return request.close();
-    }, onError: (e) {
-      expect(e is HandshakeException || e is SocketException);
-    });
-
-  client.close();
-}
-
-void main(List<String> args) {
-  SecureSocket.initialize();
-  int port = int.parse(args[0]);
-  runHttpClient(port, args[1])
-    .then((_) => print('SUCCESS'));
-}
diff --git a/tests/standalone/io/https_bad_certificate_test.dart b/tests/standalone/io/https_bad_certificate_test.dart
index d07961a..fdd83e3 100644
--- a/tests/standalone/io/https_bad_certificate_test.dart
+++ b/tests/standalone/io/https_bad_certificate_test.dart
@@ -4,52 +4,78 @@
 
 // This test verifies that the bad certificate callback works in HttpClient.
 
-import "package:expect/expect.dart";
-import "package:path/path.dart";
 import "dart:async";
 import "dart:io";
 
-const HOST_NAME = "localhost";
-const CERTIFICATE = "localhost_cert";
+import "package:expect/expect.dart";
 
-Future<SecureServerSocket> runServer() {
-  SecureSocket.initialize(
-      database: Platform.script.resolve('pkcert').toFilePath(),
+final HOST_NAME = 'localhost';
+
+String localFile(path) => Platform.script.resolve(path).toFilePath();
+
+SecurityContext serverContext = new SecurityContext()
+  ..useCertificateChain(localFile('certificates/server_chain.pem'))
+  ..usePrivateKey(localFile('certificates/server_key.pem'),
       password: 'dartdart');
 
-  return HttpServer.bindSecure(
-      HOST_NAME, 0, backlog: 5, certificateName: 'localhost_cert')
-  .then((server) {
-    server.listen((HttpRequest request) {
-      request.listen((_) { }, onDone: () { request.response.close(); });
-    }, onError: (e) { if (e is! HandshakeException) throw e; });
-    return server;
-  });
-}
+class CustomException {}
 
 main() async {
-  var clientScript = Platform.script
-                             .resolve('https_bad_certificate_client.dart')
-                             .toFilePath();
-  Future clientProcess(int port, String acceptCertificate) {
-    return Process.run(Platform.executable,
-        [clientScript, port.toString(), acceptCertificate])
-    .then((ProcessResult result) {
-      if (result.exitCode != 0 || !result.stdout.contains('SUCCESS')) {
-        print("Client failed, acceptCertificate: $acceptCertificate");
-        print("  stdout:");
-        print(result.stdout);
-        print("  stderr:");
-        print(result.stderr);
-        Expect.fail('Client subprocess exit code: ${result.exitCode}');
-      }
+  var HOST = (await InternetAddress.lookup(HOST_NAME)).first;
+  var server = await HttpServer.bindSecure(HOST, 0, serverContext, backlog: 5);
+  server.listen((request) {
+    request.listen((_) {
+    }, onDone: () {
+      request.response.close();
     });
-  }
+  });
 
-  var server = await runServer();
-  await clientProcess(server.port, 'true');
-  await clientProcess(server.port, 'false');
-  await clientProcess(server.port, 'fisk');
-  await clientProcess(server.port, 'exception');
+  SecurityContext goodContext = new SecurityContext()
+    ..setTrustedCertificates(file: localFile('certificates/trusted_certs.pem'));
+  SecurityContext badContext = new SecurityContext();
+  SecurityContext defaultContext = SecurityContext.defaultContext;
+
+  await runClient(server.port, goodContext, true, 'pass');
+  await runClient(server.port, goodContext, false, 'pass');
+  await runClient(server.port, goodContext, 'fisk', 'pass');
+  await runClient(server.port, goodContext, 'exception', 'pass');
+  await runClient(server.port, badContext, true, 'pass');
+  await runClient(server.port, badContext, false, 'fail');
+  await runClient(server.port, badContext, 'fisk', 'fail');
+  await runClient(server.port, badContext, 'exception', 'throw');
+  await runClient(server.port, defaultContext, true, 'pass');
+  await runClient(server.port, defaultContext, false, 'fail');
+  await runClient(server.port, defaultContext, 'fisk', 'fail');
+  await runClient(server.port, defaultContext, 'exception', 'throw');
   server.close();
 }
+
+
+Future runClient(int port,
+                 SecurityContext context,
+                 callbackReturns,
+                 result) async {
+  HttpClient client = new HttpClient(context: context);
+  client.badCertificateCallback = (X509Certificate certificate, host, port) {
+    Expect.equals('/CN=rootauthority', certificate.subject);
+    Expect.equals('/CN=rootauthority', certificate.issuer);
+    // Throw exception if one is requested.
+    if (callbackReturns == 'exception') throw new CustomException();
+    return callbackReturns;
+  };
+
+  try {
+    var request = await client.getUrl(Uri.parse('https://$HOST_NAME:$port/'));
+    Expect.equals('pass', result);
+    await request.close();
+  } catch (error) {
+    Expect.notEquals(result, 'pass');
+    if (result == 'fail') {
+      Expect.isTrue(error is HandshakeException);
+    } else if (result == 'throw') {
+      Expect.isTrue(error is CustomException);
+    } else {
+      Expect.fail('Unknown expectation $result');
+    }
+  }
+}
diff --git a/tests/standalone/io/https_client_certificate_test.dart b/tests/standalone/io/https_client_certificate_test.dart
index f63d383..24d3978 100644
--- a/tests/standalone/io/https_client_certificate_test.dart
+++ b/tests/standalone/io/https_client_certificate_test.dart
@@ -10,14 +10,27 @@
 import "package:path/path.dart";
 
 const HOST_NAME = "localhost";
+String localFile(path) => Platform.script.resolve(path).toFilePath();
 
+SecurityContext serverContext = new SecurityContext()
+  ..useCertificateChain(localFile('certificates/server_chain.pem'))
+  ..usePrivateKey(localFile('certificates/server_key.pem'),
+                  password: 'dartdart');
+// TODO: Specify which client certificate roots to trust.
 
-Function test() {
+SecurityContext clientContext = new SecurityContext()
+  ..setTrustedCertificates(file: localFile('certificates/trusted_certs.pem'))
+// TODO: Set a client certificate here.
+  ..useCertificateChain(localFile('certificates/server_chain.pem'))
+  ..usePrivateKey(localFile('certificates/server_key.pem'),
+                  password: 'dartdart');
+
+void main() {
   asyncStart();
   HttpServer.bindSecure(HOST_NAME,
                         0,
+                        serverContext,
                         backlog: 5,
-                        certificateName: 'localhost_cert',
                         requestClientCertificate: true).then((server) {
     server.listen((HttpRequest request) {
       Expect.isNotNull(request.certificate);
@@ -26,7 +39,7 @@
       request.response.close();
     });
 
-    HttpClient client = new HttpClient();
+    HttpClient client = new HttpClient(context: clientContext);
     client.getUrl(Uri.parse("https://$HOST_NAME:${server.port}/"))
         .then((request) => request.close())
         .then((response) {
@@ -44,14 +57,3 @@
         });
   });
 }
-
-void InitializeSSL() {
-  var testPkcertDatabase = Platform.script.resolve('pkcert').toFilePath();
-  SecureSocket.initialize(database: testPkcertDatabase,
-                          password: 'dartdart');
-}
-
-void main() {
-  InitializeSSL();
-  test();
-}
diff --git a/tests/standalone/io/https_server_test.dart b/tests/standalone/io/https_server_test.dart
index cdba064..88a8b2a 100644
--- a/tests/standalone/io/https_server_test.dart
+++ b/tests/standalone/io/https_server_test.dart
@@ -9,14 +9,23 @@
 import "package:expect/expect.dart";
 
 InternetAddress HOST;
-const CERTIFICATE = "localhost_cert";
+
+String localFile(path) => Platform.script.resolve(path).toFilePath();
+
+SecurityContext serverContext = new SecurityContext()
+  ..useCertificateChain(localFile('certificates/server_chain.pem'))
+  ..usePrivateKey(localFile('certificates/server_key.pem'),
+                  password: 'dartdart');
+
+SecurityContext clientContext = new SecurityContext()
+  ..setTrustedCertificates(file: localFile('certificates/trusted_certs.pem'));
 
 void testListenOn() {
   void test(void onDone()) {
     HttpServer.bindSecure(HOST,
                           0,
-                          backlog: 5,
-                          certificateName: CERTIFICATE).then((server) {
+                          serverContext,
+                          backlog: 5).then((server) {
       ReceivePort serverPort = new ReceivePort();
       server.listen((HttpRequest request) {
         request.listen(
@@ -27,7 +36,7 @@
           });
       });
 
-      HttpClient client = new HttpClient();
+      HttpClient client = new HttpClient(context: clientContext);
       ReceivePort clientPort = new ReceivePort();
       client.getUrl(Uri.parse("https://${HOST.host}:${server.port}/"))
         .then((HttpClientRequest request) {
@@ -58,16 +67,10 @@
   });
 }
 
-void InitializeSSL() {
-  var testPkcertDatabase = Platform.script.resolve('pkcert').toFilePath();
-  SecureSocket.initialize(database: testPkcertDatabase,
-                          password: 'dartdart');
-}
-
 void testEarlyClientClose() {
   HttpServer.bindSecure(HOST,
                         0,
-                        certificateName: 'localhost_cert').then((server) {
+                        serverContext).then((server) {
     server.listen(
       (request) {
         String name = Platform.script.toFilePath();
@@ -96,7 +99,6 @@
 }
 
 void main() {
-  InitializeSSL();
   InternetAddress.lookup("localhost").then((hosts) {
     HOST = hosts.first;
     testListenOn();
diff --git a/tests/standalone/io/https_unauthorized_client.dart b/tests/standalone/io/https_unauthorized_client.dart
index 925ccba..673fdf0 100644
--- a/tests/standalone/io/https_unauthorized_client.dart
+++ b/tests/standalone/io/https_unauthorized_client.dart
@@ -15,9 +15,9 @@
   String message;
 }
 
-void expect(condition) {
+void expect(condition, message) {
   if (!condition) {
-    throw new ExpectException('');
+    throw new ExpectException(message);
   }
 }
 
@@ -31,16 +31,19 @@
     testFutures.add(
         client.getUrl(Uri.parse('https://$HOST_NAME:$port/'))
           .then((HttpClientRequest request) {
-            expect(false);
+            expect(false, "Request succeeded");
           }, onError: (e) {
-            expect(e is HandshakeException || e is SocketException);
+            // Remove ArgumentError once null default context is supported.
+            expect(e is HandshakeException ||
+                   e is SocketException ||
+                   e is ArgumentError,
+                   "Error is wrong type: $e");
           }));
   }
   return Future.wait(testFutures);
 }
 
 void main(List<String> args) {
-  SecureSocket.initialize();
   runClients(int.parse(args[0]))
     .then((_) => print('SUCCESS'));
 }
diff --git a/tests/standalone/io/https_unauthorized_test.dart b/tests/standalone/io/https_unauthorized_test.dart
index 0bb6c89..43f3e53 100644
--- a/tests/standalone/io/https_unauthorized_test.dart
+++ b/tests/standalone/io/https_unauthorized_test.dart
@@ -13,13 +13,19 @@
 const HOST_NAME = "localhost";
 const CERTIFICATE = "localhost_cert";
 
-Future<SecureServerSocket> runServer() {
-  SecureSocket.initialize(
-      database: Platform.script.resolve('pkcert').toFilePath(),
-      password: 'dartdart');
+String localFile(path) => Platform.script.resolve(path).toFilePath();
 
+SecurityContext untrustedServerContext = new SecurityContext()
+  ..useCertificateChain(localFile('certificates/untrusted_server_chain.pem'))
+  ..usePrivateKey(localFile('certificates/untrusted_server_key.pem'),
+                  password: 'dartdart');
+
+SecurityContext clientContext = new SecurityContext()
+  ..setTrustedCertificates(file: localFile('certificates/trusted_certs.pem'));
+
+Future<SecureServerSocket> runServer() {
   return HttpServer.bindSecure(
-      HOST_NAME, 0, backlog: 5, certificateName: 'localhost_cert')
+      HOST_NAME, 0, untrustedServerContext, backlog: 5)
   .then((server) {
     server.listen((HttpRequest request) {
       request.listen((_) { }, onDone: () { request.response.close(); });
diff --git a/tests/standalone/io/pkcert/README b/tests/standalone/io/pkcert/README
deleted file mode 100644
index fe764a9..0000000
--- a/tests/standalone/io/pkcert/README
+++ /dev/null
@@ -1,16 +0,0 @@
-This is a certificate database used by Dart for testing purposes.
-
-It is created as a certificate database by NSS (Network Security Services),
-a library from Mozilla, using the certutil tool.  It uses a cert9.db file,
-rather than a cert8.db file, so the database directory must be specified with
-"sql:" in front of the directory path, or the environment variable
-NSS_DEFAULT_DB_TYPE must be set to "sql".
-
-The password for the key database is "dartdart".
-
-The database contains a root certificate from Equifax, used to verify the
-client https connection to www.google.dk.  It contains a self-signed
-certificate for a local certificate authority myauthority_cert, and a
-server certificate for localhost called localhost_cert, signed by
-myauthority_cert.  It contains the key for localhost_cert, but
-not the key for myauthority_cert.
diff --git a/tests/standalone/io/pkcert/cert9.db b/tests/standalone/io/pkcert/cert9.db
deleted file mode 100644
index 497fca6..0000000
--- a/tests/standalone/io/pkcert/cert9.db
+++ /dev/null
Binary files differ
diff --git a/tests/standalone/io/pkcert/key4.db b/tests/standalone/io/pkcert/key4.db
deleted file mode 100644
index fc06432..0000000
--- a/tests/standalone/io/pkcert/key4.db
+++ /dev/null
Binary files differ
diff --git a/tests/standalone/io/raw_datagram_socket_test.dart b/tests/standalone/io/raw_datagram_socket_test.dart
index 9b952d6..20d841e 100644
--- a/tests/standalone/io/raw_datagram_socket_test.dart
+++ b/tests/standalone/io/raw_datagram_socket_test.dart
@@ -127,7 +127,8 @@
             asyncEnd();
           }
         }
-        broadcastTimer = new Timer.periodic(new Duration(milliseconds: 10), send);
+        broadcastTimer =
+            new Timer.periodic(new Duration(milliseconds: 10), send);
       });
   }
 
@@ -194,7 +195,7 @@
   }
 }
 
-testSendReceive(InternetAddress bindAddress) {
+testSendReceive(InternetAddress bindAddress, int dataSize) {
   asyncStart();
 
   var total = 1000;
@@ -218,7 +219,7 @@
       }
 
       Uint8List createDataPackage(int seq) {
-        var data = new Uint8List(1000);
+        var data = new Uint8List(dataSize);
         (new ByteData.view(data.buffer, 0, 4)).setUint32(0, seq);
         return data;
       }
@@ -236,7 +237,7 @@
         // Send a datagram acknowledging the received sequence.
         int bytes = sender.send(
             createDataPackage(seq), bindAddress, receiver.port);
-        Expect.isTrue(bytes == 0 || bytes == 1000);
+        Expect.isTrue(bytes == 0 || bytes == dataSize);
       }
 
       void sendAck(address, port) {
@@ -287,6 +288,7 @@
             var datagram = receiver.receive();
             if (datagram != null) {
               Expect.equals(datagram.port, sender.port);
+              Expect.equals(dataSize, datagram.data.length);
               if (!bindAddress.isMulticast) {
                 Expect.equals(receiver.address, datagram.address);
               }
@@ -318,6 +320,12 @@
   }
   testBroadcast();
   testLoopbackMulticast();
-  testSendReceive(InternetAddress.LOOPBACK_IP_V4);
-  testSendReceive(InternetAddress.LOOPBACK_IP_V6);
+  testSendReceive(InternetAddress.LOOPBACK_IP_V4, 1000);
+  testSendReceive(InternetAddress.LOOPBACK_IP_V6, 1000);
+  if (!Platform.isMacOS) {
+    testSendReceive(InternetAddress.LOOPBACK_IP_V4, 32 * 1024);
+    testSendReceive(InternetAddress.LOOPBACK_IP_V6, 32 * 1024);
+    testSendReceive(InternetAddress.LOOPBACK_IP_V4, 64 * 1024 - 32);
+    testSendReceive(InternetAddress.LOOPBACK_IP_V6, 64 * 1024 - 32);
+  }
 }
diff --git a/tests/standalone/io/raw_secure_server_closing_test.dart b/tests/standalone/io/raw_secure_server_closing_test.dart
index 16fffe3..63e9cd4 100644
--- a/tests/standalone/io/raw_secure_server_closing_test.dart
+++ b/tests/standalone/io/raw_secure_server_closing_test.dart
@@ -14,7 +14,15 @@
 import "package:expect/expect.dart";
 
 InternetAddress HOST;
-const CERTIFICATE = "localhost_cert";
+String localFile(path) => Platform.script.resolve(path).toFilePath();
+
+SecurityContext serverContext = new SecurityContext()
+  ..useCertificateChain(localFile('certificates/server_chain.pem'))
+  ..usePrivateKey(localFile('certificates/server_key.pem'),
+                  password: 'dartdart');
+
+SecurityContext clientContext = new SecurityContext()
+  ..setTrustedCertificates(file: localFile('certificates/trusted_certs.pem'));
 
 void testCloseOneEnd(String toClose) {
   asyncStart();
@@ -25,7 +33,7 @@
       .then((_) {
         asyncEnd();
       });
-  RawSecureServerSocket.bind(HOST, 0, CERTIFICATE).then((server) {
+  RawSecureServerSocket.bind(HOST, 0, serverContext).then((server) {
     server.listen((serverConnection) {
       serverConnection.listen((event) {
         if (toClose == "server" || event == RawSocketEvent.READ_CLOSED) {
@@ -39,7 +47,8 @@
     onDone: () {
       serverDone.complete(null);
     });
-    RawSecureSocket.connect(HOST, server.port).then((clientConnection) {
+    RawSecureSocket.connect(HOST, server.port, context: clientContext)
+    .then((clientConnection) {
       clientConnection.listen((event){
         if (toClose == "client" || event == RawSocketEvent.READ_CLOSED) {
           clientConnection.shutdown(SocketDirection.SEND);
@@ -55,8 +64,9 @@
 
 void testCloseBothEnds() {
   asyncStart();
-  RawSecureServerSocket.bind(HOST, 0, CERTIFICATE).then((server) {
-    var clientEndFuture = RawSecureSocket.connect(HOST, server.port);
+  RawSecureServerSocket.bind(HOST, 0, serverContext).then((server) {
+    var clientEndFuture =
+        RawSecureSocket.connect(HOST, server.port, context: clientContext);
     server.listen((serverEnd) {
       clientEndFuture.then((clientEnd) {
         clientEnd.close();
@@ -77,7 +87,7 @@
 
   RawSecureServerSocket.bind(HOST,
                              0,
-                             CERTIFICATE,
+                             serverContext,
                              backlog: 2 * socketCount).then((server) {
     Expect.isTrue(server.port > 0);
     var subscription;
@@ -96,7 +106,8 @@
     subscription.pause();
     var connectCount = 0;
     for (int i = 0; i < socketCount; i++) {
-      RawSecureSocket.connect(HOST, server.port).then((connection) {
+      RawSecureSocket.connect(HOST, server.port, context: clientContext)
+      .then((connection) {
         connection.shutdown(SocketDirection.SEND);
       });
     }
@@ -104,7 +115,8 @@
       subscription.resume();
       resumed = true;
       for (int i = 0; i < socketCount; i++) {
-        RawSecureSocket.connect(HOST, server.port).then((connection) {
+        RawSecureSocket.connect(HOST, server.port, context: clientContext)
+        .then((connection) {
           connection.shutdown(SocketDirection.SEND);
         });
       }
@@ -117,7 +129,7 @@
   asyncStart();
   List ends = [];
 
-  RawSecureServerSocket.bind(HOST, 0, CERTIFICATE).then((server) {
+  RawSecureServerSocket.bind(HOST, 0, serverContext).then((server) {
     Expect.isTrue(server.port > 0);
     void checkDone() {
       if (ends.length < 2 * socketCount) return;
@@ -134,7 +146,8 @@
     });
 
     for (int i = 0; i < socketCount; i++) {
-      RawSecureSocket.connect(HOST, server.port).then((connection) {
+      RawSecureSocket.connect(HOST, server.port, context: clientContext)
+      .then((connection) {
         ends.add(connection);
         checkDone();
       });
@@ -145,10 +158,6 @@
 
 main() {
   asyncStart();
-  var certificateDatabase = Platform.script.resolve('pkcert').toFilePath();
-  SecureSocket.initialize(database: certificateDatabase,
-                          password: 'dartdart',
-                          useBuiltinRoots: false);
   InternetAddress.lookup("localhost").then((hosts) {
     HOST = hosts.first;
     runTests();
diff --git a/tests/standalone/io/raw_secure_server_socket_argument_test.dart b/tests/standalone/io/raw_secure_server_socket_argument_test.dart
index 2513f6d..029b750 100644
--- a/tests/standalone/io/raw_secure_server_socket_argument_test.dart
+++ b/tests/standalone/io/raw_secure_server_socket_argument_test.dart
@@ -20,17 +20,13 @@
 void testArguments() {
   bool isArgOrTypeError(e) => e is ArgumentError || e is TypeError;
   Expect.throws(() =>
-                RawSecureServerSocket.bind(SERVER_ADDRESS, 65536, CERTIFICATE),
+                RawSecureServerSocket.bind(SERVER_ADDRESS, 65536, null),
                 isArgOrTypeError);
   Expect.throws(() =>
-                RawSecureServerSocket.bind(SERVER_ADDRESS, -1, CERTIFICATE),
+                RawSecureServerSocket.bind(SERVER_ADDRESS, -1, null),
                 isArgOrTypeError);
   Expect.throws(() => RawSecureServerSocket.bind(SERVER_ADDRESS, 0,
-                                                 CERTIFICATE, backlog: -1),
-                isArgOrTypeError);
-  Expect.throws(() => RawSecureSocket.connect(SERVER_ADDRESS, 3456,
-                                              sendClientCertificate: true,
-                                              certificateName: 12.3),
+                                                 null, backlog: -1),
                 isArgOrTypeError);
   Expect.throws(() => RawSecureSocket.connect(SERVER_ADDRESS, null),
                 isArgOrTypeError);
@@ -43,21 +39,11 @@
   Expect.throws(() => RawSecureSocket.connect(null, 0),
                 isArgOrTypeError);
   Expect.throws(() => RawSecureSocket.connect(SERVER_ADDRESS, 0,
-                                              certificateName: 77),
-                isArgOrTypeError);
-  Expect.throws(() => RawSecureSocket.connect(SERVER_ADDRESS, 0,
-                                              sendClientCertificate: 'fisk'),
-                isArgOrTypeError);
-  Expect.throws(() => RawSecureSocket.connect(SERVER_ADDRESS, 0,
                                               onBadCertificate: 'hund'),
                 isArgOrTypeError);
 }
 
 
 main() {
-  var certificateDatabase = Platform.script.resolve('pkcert').toFilePath();
-  SecureSocket.initialize(database: certificateDatabase,
-                          password: 'dartdart',
-                          useBuiltinRoots: false);
   testArguments();
 }
diff --git a/tests/standalone/io/raw_secure_server_socket_test.dart b/tests/standalone/io/raw_secure_server_socket_test.dart
index 33fc191..560722f 100644
--- a/tests/standalone/io/raw_secure_server_socket_test.dart
+++ b/tests/standalone/io/raw_secure_server_socket_test.dart
@@ -14,11 +14,19 @@
 import "package:expect/expect.dart";
 
 InternetAddress HOST;
-const CERTIFICATE = "localhost_cert";
+String localFile(path) => Platform.script.resolve(path).toFilePath();
+
+SecurityContext serverContext = new SecurityContext()
+  ..useCertificateChain(localFile('certificates/server_chain.pem'))
+  ..usePrivateKey(localFile('certificates/server_key.pem'),
+                  password: 'dartdart');
+
+SecurityContext clientContext = new SecurityContext()
+  ..setTrustedCertificates(file: localFile('certificates/trusted_certs.pem'));
 
 void testSimpleBind() {
   asyncStart();
-  RawSecureServerSocket.bind(HOST, 0, CERTIFICATE).then((s) {
+  RawSecureServerSocket.bind(HOST, 0, serverContext).then((s) {
     Expect.isTrue(s.port > 0);
     s.close();
     asyncEnd();
@@ -30,7 +38,7 @@
 
   // Bind to a unknown DNS name.
   asyncStart();
-  RawSecureServerSocket.bind("ko.faar.__hest__", 0, CERTIFICATE).then((_) {
+  RawSecureServerSocket.bind("ko.faar.__hest__", 0, serverContext).then((_) {
     Expect.fail("Failure expected");
   }).catchError((error) {
     Expect.isTrue(error is SocketException);
@@ -39,7 +47,7 @@
 
   // Bind to an unavaliable IP-address.
   asyncStart();
-  RawSecureServerSocket.bind("8.8.8.8", 0, CERTIFICATE).then((_) {
+  RawSecureServerSocket.bind("8.8.8.8", 0, serverContext).then((_) {
     Expect.fail("Failure expected");
   }).catchError((error) {
     Expect.isTrue(error is SocketException);
@@ -48,10 +56,10 @@
 
   // Bind to a port already in use.
   asyncStart();
-  RawSecureServerSocket.bind(HOST, 0, CERTIFICATE).then((s) {
+  RawSecureServerSocket.bind(HOST, 0, serverContext).then((s) {
     RawSecureServerSocket.bind(HOST,
                                s.port,
-                               CERTIFICATE).then((t) {
+                               serverContext).then((t) {
       s.close();
       t.close();
       Expect.fail("Multiple listens on same port");
@@ -64,12 +72,14 @@
   });
 }
 
-void testSimpleConnect(String certificate) {
+void testSimpleConnect() {
   asyncStart();
-  RawSecureServerSocket.bind(HOST, 0, certificate).then((server) {
-    var clientEndFuture = RawSecureSocket.connect(HOST, server.port);
+  RawSecureServerSocket.bind(HOST, 0, serverContext).then((server) {
+    var clientEndFuture =
+    RawSecureSocket.connect(HOST, server.port, context: clientContext);
     server.listen((serverEnd) {
       clientEndFuture.then((clientEnd) {
+        // TODO(whesse): Shutdown(SEND) not supported on secure sockets.
         clientEnd.shutdown(SocketDirection.SEND);
         serverEnd.shutdown(SocketDirection.SEND);
         server.close();
@@ -79,10 +89,11 @@
   });
 }
 
-void testSimpleConnectFail(String certificate, bool cancelOnError) {
+void testSimpleConnectFail(SecurityContext context, bool cancelOnError) {
   asyncStart();
-  RawSecureServerSocket.bind(HOST, 0, certificate).then((server) {
-    var clientEndFuture = RawSecureSocket.connect(HOST, server.port)
+  RawSecureServerSocket.bind(HOST, 0, context).then((server) {
+    var clientEndFuture =
+        RawSecureSocket.connect(HOST, server.port, context: clientContext)
       .then((clientEnd) {
         Expect.fail("No client connection expected.");
       })
@@ -94,7 +105,7 @@
       Expect.fail("No server connection expected.");
     },
     onError: (error) {
-      Expect.isTrue(error is CertificateException);
+      Expect.isTrue(error is HandshakeException);
       clientEndFuture.then((_) {
         if (!cancelOnError) server.close();
         asyncEnd();
@@ -106,9 +117,10 @@
 
 void testServerListenAfterConnect() {
   asyncStart();
-  RawSecureServerSocket.bind(HOST, 0, CERTIFICATE).then((server) {
+  RawSecureServerSocket.bind(HOST, 0, serverContext).then((server) {
     Expect.isTrue(server.port > 0);
-    var clientEndFuture = RawSecureSocket.connect(HOST, server.port);
+    var clientEndFuture =
+        RawSecureSocket.connect(HOST, server.port, context: clientContext);
     new Timer(const Duration(milliseconds: 500), () {
       server.listen((serverEnd) {
         clientEndFuture.then((clientEnd) {
@@ -422,15 +434,17 @@
 
   Future<RawSecureSocket> connectClient(int port) {
     if (connectSecure) {
-      return RawSecureSocket.connect(HOST, port);
+      return RawSecureSocket.connect(HOST, port, context: clientContext);
     } else if (!handshakeBeforeSecure) {
       return RawSocket.connect(HOST, port).then((socket) {
-        return RawSecureSocket.secure(socket);
+        return RawSecureSocket.secure(socket, context: clientContext);
       });
     } else {
       return RawSocket.connect(HOST, port).then((socket) {
         return runClientHandshake(socket).then((subscription) {
-            return RawSecureSocket.secure(socket, subscription: subscription);
+            return RawSecureSocket.secure(socket,
+                                          context: clientContext,
+                                          subscription: subscription);
         });
       });
     }
@@ -441,14 +455,14 @@
       if (listenSecure) {
         runServer(client).then((_) => server.close());
       } else if (!handshakeBeforeSecure) {
-        RawSecureSocket.secureServer(client, CERTIFICATE).then((client) {
+        RawSecureSocket.secureServer(client, serverContext).then((client) {
           runServer(client).then((_) => server.close());
         });
       } else {
         runServerHandshake(client).then((secure) {
             RawSecureSocket.secureServer(
                 client,
-                CERTIFICATE,
+                serverContext,
                 subscription: secure[0],
                 bufferedData: secure[1]).then((client) {
             runServer(client).then((_) => server.close());
@@ -465,7 +479,7 @@
 
   if (listenSecure) {
     RawSecureServerSocket.bind(
-        HOST, 0, CERTIFICATE).then(serverReady);
+        HOST, 0, serverContext).then(serverReady);
   } else {
     RawServerSocket.bind(HOST, 0).then(serverReady);
   }
@@ -490,7 +504,7 @@
         }
         try {
           RawSecureSocket.secureServer(
-              client, CERTIFICATE, subscription: subscription)
+              client, serverContext, subscription: subscription)
             .catchError((_) {})
             .whenComplete(() {
               if (pausedServer) {
@@ -543,10 +557,6 @@
 
 main() {
   asyncStart();
-  var certificateDatabase = Platform.script.resolve('pkcert').toFilePath();
-  SecureSocket.initialize(database: certificateDatabase,
-                          password: 'dartdart',
-                          useBuiltinRoots: false);
   InternetAddress.lookup("localhost").then((hosts) {
     HOST = hosts.first;
     runTests();
@@ -557,12 +567,22 @@
 runTests() {
   testSimpleBind();
   testInvalidBind();
-  testSimpleConnect(CERTIFICATE);
-  testSimpleConnect("CN=localhost");
-  testSimpleConnectFail("not_a_nickname", false);
-  testSimpleConnectFail("CN=notARealDistinguishedName", false);
-  testSimpleConnectFail("not_a_nickname", true);
-  testSimpleConnectFail("CN=notARealDistinguishedName", true);
+  testSimpleConnect();
+  SecurityContext context = new SecurityContext();
+  testSimpleConnectFail(context, false);
+  testSimpleConnectFail(context, true);
+  var chain =
+      Platform.script.resolve('certificates/untrusted_server_chain.pem')
+      .toFilePath();
+  context.useCertificateChain(chain);
+  testSimpleConnectFail(context, false);
+  testSimpleConnectFail(context, true);
+  var key =
+      Platform.script.resolve('certificates/untrusted_server_key.pem')
+       .toFilePath();
+  context.usePrivateKey(key, password: 'dartdart');
+  testSimpleConnectFail(context, false);
+  testSimpleConnectFail(context, true);
   testServerListenAfterConnect();
 
   testSimpleReadWrite(listenSecure: true,
@@ -575,11 +595,13 @@
                       handshakeBeforeSecure: false,
                       postponeSecure: false,
                       dropReads: false);
+
   testSimpleReadWrite(listenSecure: false,
                       connectSecure: true,
                       handshakeBeforeSecure: false,
                       postponeSecure: false,
                       dropReads: false);
+
   testSimpleReadWrite(listenSecure: false,
                       connectSecure: false,
                       handshakeBeforeSecure: false,
diff --git a/tests/standalone/io/raw_secure_socket_pause_test.dart b/tests/standalone/io/raw_secure_socket_pause_test.dart
index 3ca26cb..c3bfc43 100644
--- a/tests/standalone/io/raw_secure_socket_pause_test.dart
+++ b/tests/standalone/io/raw_secure_socket_pause_test.dart
@@ -13,12 +13,22 @@
 import "dart:io";
 import "dart:isolate";
 
+String localFile(path) => Platform.script.resolve(path).toFilePath();
+
+SecurityContext serverContext = new SecurityContext()
+  ..useCertificateChain(localFile('certificates/server_chain.pem'))
+  ..usePrivateKey(localFile('certificates/server_key.pem'),
+                  password: 'dartdart');
+
+SecurityContext clientContext = new SecurityContext()
+  ..setTrustedCertificates(file: localFile('certificates/trusted_certs.pem'));
+
 Future<HttpServer> startServer() {
   return HttpServer.bindSecure(
       "localhost",
       0,
-      backlog: 5,
-      certificateName: 'localhost_cert').then((server) {
+      serverContext,
+      backlog: 5).then((server) {
     server.listen((HttpRequest request) {
       request.listen(
         (_) { },
@@ -34,77 +44,72 @@
   });
 }
 
-void InitializeSSL() {
-  var testPkcertDatabase = Platform.script.resolve('pkcert').toFilePath();
-  SecureSocket.initialize(database: testPkcertDatabase,
-                          password: 'dartdart');
-}
-
-void main() {
+main() async {
   List<int> message = "GET / HTTP/1.0\r\nHost: localhost\r\n\r\n".codeUnits;
   int written = 0;
   List<int> body = <int>[];
-  InitializeSSL();
-  startServer().then((server) {
-    RawSecureSocket.connect("localhost", server.port).then((socket) {
-      StreamSubscription subscription;
-      bool paused = false;
-      bool readEventsTested = false;
-      bool readEventsPaused = false;
+  var server = await startServer();
+  var socket = await RawSecureSocket.connect("localhost",
+                                             server.port,
+                                             context: clientContext);
+  StreamSubscription subscription;
+  bool paused = false;
+  bool readEventsTested = false;
+  bool readEventsPaused = false;
 
-      void runPauseTest() {
-        subscription.pause();
-        paused = true;
-        new Timer(const Duration(milliseconds: 500), () {
-            paused = false;
-            subscription.resume();
-        });
-      }
-
-      void runReadEventTest() {
-        if (readEventsTested) return;
-        readEventsTested = true;
-        socket.readEventsEnabled = false;
-        readEventsPaused = true;
-        new Timer(const Duration(milliseconds: 500), () {
-            readEventsPaused = false;
-            socket.readEventsEnabled = true;
-        });
-      }
-
-      subscription = socket.listen(
-          (RawSocketEvent event) {
-            Expect.isFalse(paused);
-            switch (event) {
-              case RawSocketEvent.READ:
-                Expect.isFalse(readEventsPaused);
-                runReadEventTest();
-                body.addAll(socket.read());
-                break;
-              case RawSocketEvent.WRITE:
-                written +=
-                    socket.write(message, written, message.length - written);
-                if (written < message.length) {
-                  socket.writeEventsEnabled = true;
-                } else {
-                  socket.shutdown(SocketDirection.SEND);
-                  runPauseTest();
-                }
-                break;
-              case RawSocketEvent.READ_CLOSED:
-                Expect.isTrue(body.length > 100);
-                Expect.equals(72, body[0]);
-                Expect.equals(9, body[body.length - 1]);
-                server.close();
-                break;
-              default: throw "Unexpected event $event";
-            }
-          },
-          onError: (e, trace) {
-            String msg = "onError handler of RawSecureSocket stream hit: $e";
-            if (trace != null) msg += "\nStackTrace: $trace";
-            Expect.fail(msg);
-          });
+  void runPauseTest() {
+    subscription.pause();
+    paused = true;
+    new Timer(const Duration(milliseconds: 500), () {
+        paused = false;
+        subscription.resume();
     });
-  });
+  }
+
+  void runReadEventTest() {
+    if (readEventsTested) return;
+    readEventsTested = true;
+    socket.readEventsEnabled = false;
+    readEventsPaused = true;
+    new Timer(const Duration(milliseconds: 500), () {
+        readEventsPaused = false;
+        socket.readEventsEnabled = true;
+    });
+  }
+
+  void handleRawEvent(RawSocketEvent event) {
+    Expect.isFalse(paused);
+    switch (event) {
+      case RawSocketEvent.READ:
+        Expect.isFalse(readEventsPaused);
+        runReadEventTest();
+        body.addAll(socket.read());
+        break;
+      case RawSocketEvent.WRITE:
+        written +=
+            socket.write(message, written, message.length - written);
+        if (written < message.length) {
+          socket.writeEventsEnabled = true;
+        } else {
+          socket.shutdown(SocketDirection.SEND);
+          runPauseTest();
+        }
+        break;
+      case RawSocketEvent.READ_CLOSED:
+        Expect.isTrue(body.length > 100);
+        Expect.equals(72, body.first);
+        Expect.equals(9, body.last);
+        server.close();
+        break;
+      default: throw "Unexpected event $event";
+    }
+  }
+
+  subscription = socket.listen(
+      handleRawEvent,
+      onError: (e, trace) {
+        String msg = "onError handler of RawSecureSocket stream hit: $e";
+        if (trace != null) msg += "\nStackTrace: $trace";
+        Expect.fail(msg);
+      });
 }
diff --git a/tests/standalone/io/raw_secure_socket_test.dart b/tests/standalone/io/raw_secure_socket_test.dart
index cd327ec..9cd54a1 100644
--- a/tests/standalone/io/raw_secure_socket_test.dart
+++ b/tests/standalone/io/raw_secure_socket_test.dart
@@ -13,69 +13,61 @@
 import "dart:io";
 import "dart:isolate";
 
-Future<HttpServer> startServer() {
-  return HttpServer.bindSecure(
-      "localhost",
-      0,
-      backlog: 5,
-      certificateName: 'localhost_cert').then((server) {
-    server.listen((HttpRequest request) {
-      request.listen(
-        (_) { },
-        onDone: () {
-          request.response.contentLength = 100;
-          for (int i = 0; i < 10; i++) {
-            request.response.add([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]);
-          }
-          request.response.close();
-        });
-    });
-    return server;
-  });
-}
+String localFile(path) => Platform.script.resolve(path).toFilePath();
 
-void InitializeSSL() {
-  var testPkcertDatabase = Platform.script.resolve('pkcert').toFilePath();
-  SecureSocket.initialize(database: testPkcertDatabase,
-                          password: 'dartdart');
-}
+SecurityContext serverContext = new SecurityContext()
+  ..useCertificateChain(localFile('certificates/server_chain.pem'))
+  ..usePrivateKey(localFile('certificates/server_key.pem'),
+                  password: 'dartdart');
 
-void main() {
+SecurityContext clientContext = new SecurityContext()
+  ..setTrustedCertificates(file: localFile('certificates/trusted_certs.pem'));
+
+main() async {
   List<int> message = "GET / HTTP/1.0\r\nHost: localhost\r\n\r\n".codeUnits;
   int written = 0;
   List<int> body = <int>[];
-  InitializeSSL();
-  startServer().then((server) {
-    RawSecureSocket.connect("localhost", server.port).then((socket) {
-      socket.listen(
-          (RawSocketEvent event) {
-            switch (event) {
-              case RawSocketEvent.READ:
-                body.addAll(socket.read());
-                break;
-              case RawSocketEvent.WRITE:
-                written +=
-                    socket.write(message, written, message.length - written);
-                if (written < message.length) {
-                  socket.writeEventsEnabled = true;
-                } else {
-                  socket.shutdown(SocketDirection.SEND);
-                }
-                break;
-              case RawSocketEvent.READ_CLOSED:
-                Expect.isTrue(body.length > 100, "$body\n${body.length}");
-                Expect.equals(72, body[0]);
-                Expect.equals(9, body[body.length - 1]);
-                server.close();
-                break;
-              default: throw "Unexpected event $event";
-            }
-          },
-          onError: (e, trace) {
-            String msg = "onError handler of RawSecureSocket stream hit $e";
-            if (trace != null) msg += "\nStackTrace: $trace";
-            Expect.fail(msg);
-          });
-    });
+  var server = await HttpServer.bindSecure(
+      "localhost",
+      0,
+      serverContext,
+      backlog: 5);
+  server.listen((HttpRequest request) async {
+    await request.drain();
+    request.response.contentLength = 100;
+    for (int i = 0; i < 10; i++) {
+      request.response.add([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]);
+    }
+    request.response.close();
+  });
+  var socket = await RawSecureSocket.connect("localhost",
+                                             server.port,
+                                             context: clientContext);
+  socket.listen((RawSocketEvent event) {
+    switch (event) {
+      case RawSocketEvent.READ:
+        body.addAll(socket.read());
+        break;
+      case RawSocketEvent.WRITE:
+        written +=
+            socket.write(message, written, message.length - written);
+        if (written < message.length) {
+          socket.writeEventsEnabled = true;
+        } else {
+          socket.shutdown(SocketDirection.SEND);
+        }
+        break;
+      case RawSocketEvent.READ_CLOSED:
+        Expect.isTrue(body.length > 100, "$body\n${body.length}");
+        Expect.equals(72, body[0]);
+        Expect.equals(9, body[body.length - 1]);
+        server.close();
+        break;
+      default: throw "Unexpected event $event";
+    }
+  }, onError: (e, trace) {
+    String msg = "onError handler of RawSecureSocket stream hit $e";
+    if (trace != null) msg += "\nStackTrace: $trace";
+    Expect.fail(msg);
   });
 }
diff --git a/tests/standalone/io/regress_21160_test.dart b/tests/standalone/io/regress_21160_test.dart
index 69cbcf1..95ccfca 100644
--- a/tests/standalone/io/regress_21160_test.dart
+++ b/tests/standalone/io/regress_21160_test.dart
@@ -10,6 +10,16 @@
 import "dart:io";
 import "dart:typed_data";
 
+String localFile(path) => Platform.script.resolve(path).toFilePath();
+
+SecurityContext serverContext = new SecurityContext()
+  ..useCertificateChain(localFile('certificates/server_chain.pem'))
+  ..usePrivateKey(localFile('certificates/server_key.pem'),
+                  password: 'dartdart');
+
+SecurityContext clientContext = new SecurityContext()
+  ..setTrustedCertificates(file: localFile('certificates/trusted_certs.pem'));
+
 // 10 KiB of i%256 data.
 Uint8List DATA = new Uint8List.fromList(
     new List.generate(10 * 1024, (i) => i % 256));
@@ -17,63 +27,54 @@
 Future<SecureServerSocket> startServer() {
   return SecureServerSocket.bind("localhost",
                                  0,
-                                 'localhost_cert').then((server) {
-    server.listen((SecureSocket request) {
-      request.drain().then((_) {
-        request
-            ..add(DATA)
-            ..close();
-      });
+                                 serverContext).then((server) {
+    server.listen((SecureSocket request) async {
+      await request.drain();
+      request..add(DATA)..close();
     });
     return server;
   });
 }
 
-void InitializeSSL() {
-  var testPkcertDatabase = Platform.script.resolve('pkcert').toFilePath();
-  SecureSocket.initialize(database: testPkcertDatabase,
-                          password: 'dartdart');
-}
-
-void main() {
-  InitializeSSL();
-
+main() async {
   asyncStart();
-  startServer().then((SecureServerSocket server) {
-    RawSecureSocket.connect("localhost", server.port).then((socket) {
-      List<int> body = <int>[];
+  var server = await SecureServerSocket.bind("localhost", 0, serverContext);
+  server.listen((SecureSocket request) async {
+    await request.drain();
+    request..add(DATA)..close();
+  });
 
-      // Close our end, since we're not sending data.
-      socket.shutdown(SocketDirection.SEND);
+  var socket = await RawSecureSocket.connect("localhost",
+                                             server.port,
+                                             context: clientContext);
+  List<int> body = <int>[];
+  // Close our end, since we're not sending data.
+  socket.shutdown(SocketDirection.SEND);
 
-      socket.listen((RawSocketEvent event) {
-            switch (event) {
-              case RawSocketEvent.READ:
-                // NOTE: We have a very low prime number here. The internal
-                // ring buffers will not have a size of 3. This means that
-                // we'll reach the point where we would like to read 1/2 bytes
-                // at the end and then wrap around and read the next 2/1 bytes.
-                // [This will ensure we trigger the bug.]
-                body.addAll(socket.read(3));
-                break;
-              case RawSocketEvent.WRITE:
-                break;
-              case RawSocketEvent.READ_CLOSED:
-                break;
-              default: throw "Unexpected event $event";
-            }
-          },
-          onError: (e, _) {
-            Expect.fail('Unexpected error: $e');
-          },
-          onDone: () {
-            Expect.equals(body.length, DATA.length);
-            for (int i = 0; i < body.length; i++) {
-              Expect.equals(body[i], DATA[i]);
-            }
-            server.close();
-            asyncEnd();
-          });
-    });
+  socket.listen((RawSocketEvent event) {
+    switch (event) {
+      case RawSocketEvent.READ:
+        // NOTE: We have a very low prime number here. The internal
+        // ring buffers will not have a size of 3. This means that
+        // we'll reach the point where we would like to read 1/2 bytes
+        // at the end and then wrap around and read the next 2/1 bytes.
+        // [This will ensure we trigger the bug.]
+        body.addAll(socket.read(3));
+        break;
+      case RawSocketEvent.WRITE:
+        break;
+      case RawSocketEvent.READ_CLOSED:
+        break;
+      default: throw "Unexpected event $event";
+    }
+  }, onError: (e, _) {
+    Expect.fail('Unexpected error: $e');
+  }, onDone: () {
+    Expect.equals(body.length, DATA.length);
+    for (int i = 0; i < body.length; i++) {
+      Expect.equals(body[i], DATA[i]);
+    }
+    server.close();
+    asyncEnd();
   });
 }
diff --git a/tests/standalone/io/sample_certificate_v3_extensions b/tests/standalone/io/sample_certificate_v3_extensions
new file mode 100644
index 0000000..f9e741e
--- /dev/null
+++ b/tests/standalone/io/sample_certificate_v3_extensions
@@ -0,0 +1,46 @@
+# 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.
+
+# OpenSSL configuration file giving the v3 extensions for the sample
+# certificates created by create_sample_certificates.sh
+
+default_bits = 2048
+distinguished_name = name_section
+[name_section]
+CN = foo
+
+[localhost]
+subjectAltName = @alt_names
+basicConstraints = critical,CA:false
+subjectKeyIdentifier = hash
+authorityKeyIdentifier=keyid,issuer
+keyUsage=critical, digitalSignature, keyEncipherment, keyAgreement
+extendedKeyUsage=serverAuth
+
+[alt_names]
+DNS.1 = localhost
+DNS.2 = 127.0.0.1
+DNS.3 = ::1
+IP.1 = 127.0.0.1
+IP.2 = ::1
+
+[intermediate_authority]
+basicConstraints = critical, CA:true, pathlen:0
+subjectKeyIdentifier=hash
+authorityKeyIdentifier=keyid:always, issuer
+keyUsage=critical, keyCertSign
+extendedKeyUsage=serverAuth
+
+[client_authority]
+basicConstraints = critical,CA:true,pathlen:0
+subjectKeyIdentifier=hash
+authorityKeyIdentifier=keyid:always, issuer
+keyUsage=critical, keyCertSign
+extendedKeyUsage=clientAuth
+
+[client_certificate]
+basicConstraints = CA:false
+subjectKeyIdentifier=hash
+authorityKeyIdentifier=keyid:always, issuer
+extendedKeyUsage=clientAuth
diff --git a/tests/standalone/io/secure_bad_certificate_client.dart b/tests/standalone/io/secure_bad_certificate_client.dart
deleted file mode 100644
index c3922ae..0000000
--- a/tests/standalone/io/secure_bad_certificate_client.dart
+++ /dev/null
@@ -1,58 +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.
-
-// Client for secure_bad_certificate_test, that runs in a subprocess.
-// The test verifies that the client bad certificate callback works.
-
-import "dart:async";
-import "dart:io";
-
-class ExpectException implements Exception {
-  ExpectException(this.message);
-  String toString() => "ExpectException: $message";
-  String message;
-}
-
-void expect(condition) {
-  if (!condition) {
-    throw new ExpectException('');
-  }
-}
-
-const HOST_NAME = "localhost";
-
-void runClient(int port, result) {
-  bool badCertificateCallback(X509Certificate certificate) {
-    expect('CN=localhost' == certificate.subject);
-    expect('CN=myauthority' == certificate.issuer);
-    expect(result != 'exception');  // Throw exception if one is requested.
-    if (result == 'true') result = true;
-    if (result == 'false') result = false;
-    return result;
-  }
-
-  SecureSocket.connect(HOST_NAME,
-                       port,
-                       onBadCertificate: badCertificateCallback)
-      .then((SecureSocket socket) {
-        expect(result);
-        socket.close();
-      },
-      onError: (error) {
-        expect(result != true);
-        if (result == false) {
-          expect(error is HandshakeException);
-        } else if (result == 'exception') {
-          expect(error is ExpectException);
-        } else {
-          expect(error is ArgumentError);
-        }
-      });
-}
-
-
-void main(List<String> args) {
-  SecureSocket.initialize();
-  runClient(int.parse(args[0]), args[1]);
-}
diff --git a/tests/standalone/io/secure_bad_certificate_test.dart b/tests/standalone/io/secure_bad_certificate_test.dart
index 3388a8d..6a7e93a 100644
--- a/tests/standalone/io/secure_bad_certificate_test.dart
+++ b/tests/standalone/io/secure_bad_certificate_test.dart
@@ -4,59 +4,81 @@
 
 // This test verifies that the bad certificate callback works.
 
-import "package:expect/expect.dart";
-import "package:path/path.dart";
 import "dart:async";
 import "dart:io";
 
-const HOST_NAME = "localhost";
-const CERTIFICATE = "localhost_cert";
+import "package:expect/expect.dart";
 
+final HOST_NAME = 'localhost';
 
-String certificateDatabase() => Platform.script.resolve('pkcert').toFilePath();
+String localFile(path) => Platform.script.resolve(path).toFilePath();
 
-Future<SecureServerSocket> runServer() {
-  SecureSocket.initialize(database: certificateDatabase(),
-                          password: 'dartdart');
+SecurityContext serverContext = new SecurityContext()
+  ..useCertificateChain(localFile('certificates/server_chain.pem'))
+  ..usePrivateKey(localFile('certificates/server_key.pem'),
+      password: 'dartdart');
 
-  return SecureServerSocket.bind(HOST_NAME, 0, CERTIFICATE)
-      .then((SecureServerSocket server) {
-    server.listen((SecureSocket socket) {
-      socket.listen((_) { },
-                    onDone: () {
-                      socket.close();
-                    });
-    }, onError: (e) => Expect.isTrue(e is HandshakeException));
-    return server;
-  });
+class CustomException {}
+
+main() async {
+  var HOST = (await InternetAddress.lookup(HOST_NAME)).first;
+  var server = await SecureServerSocket.bind(HOST_NAME, 0, serverContext);
+  server.listen((SecureSocket socket) {
+      socket.listen((_) {}, onDone: () {
+        socket.close();
+      });
+    }, onError: (e) { if (e is! HandshakeException) throw e; });
+
+  SecurityContext goodContext = new SecurityContext()
+    ..setTrustedCertificates(file: localFile('certificates/trusted_certs.pem'));
+  SecurityContext badContext = new SecurityContext();
+  SecurityContext defaultContext = SecurityContext.defaultContext;
+
+  await runClient(server.port, goodContext, true, 'pass');
+  await runClient(server.port, goodContext, false, 'pass');
+  await runClient(server.port, goodContext, 'fisk', 'pass');
+  await runClient(server.port, goodContext, 'exception', 'pass');
+  await runClient(server.port, badContext, true, 'pass');
+  await runClient(server.port, badContext, false, 'fail');
+  await runClient(server.port, badContext, 'fisk', 'fail');
+  await runClient(server.port, badContext, 'exception', 'throw');
+  await runClient(server.port, defaultContext, true, 'pass');
+  await runClient(server.port, defaultContext, false, 'fail');
+  await runClient(server.port, defaultContext, 'fisk', 'fail');
+  await runClient(server.port, defaultContext, 'exception', 'throw');
+  server.close();
 }
 
 
-void main() {
-  var clientScript = Platform.script
-                             .resolve('secure_bad_certificate_client.dart')
-                             .toFilePath();
-
-  Future clientProcess(int port, String acceptCertificate) {
-    return Process.run(Platform.executable,
-        [clientScript, port.toString(), acceptCertificate])
-        .then((ProcessResult result) {
-      if (result.exitCode != 0) {
-        print("Client failed, stdout:");
-        print(result.stdout);
-        print("  stderr:");
-        print(result.stderr);
-        Expect.fail('Client subprocess exit code: ${result.exitCode}');
-      }
-    });
+Future runClient(int port,
+                 SecurityContext context,
+                 callbackReturns,
+                 result) async {
+  badCertificateCallback(X509Certificate certificate) {
+    Expect.equals('/CN=rootauthority', certificate.subject);
+    Expect.equals('/CN=rootauthority', certificate.issuer);
+    // Throw exception if one is requested.
+    if (callbackReturns == 'exception') throw new CustomException();
+    return callbackReturns;
   }
 
-  runServer().then((server) {
-    Future.wait([clientProcess(server.port, 'true'),
-                 clientProcess(server.port, 'false'),
-                 clientProcess(server.port, 'fisk'),
-                 clientProcess(server.port, 'exception')]).then((_) {
-      server.close();
-    });
-  });
-}
+  try {
+    var socket = await SecureSocket.connect(
+        HOST_NAME,
+        port,
+        context: context,
+        onBadCertificate: badCertificateCallback);
+    Expect.equals('pass', result);  // Is rethrown below
+    await socket.close();
+  } catch (error)  {
+    if (error is ExpectException) rethrow;
+    Expect.notEquals(result, 'pass');
+    if (result == 'fail') {
+      Expect.isTrue(error is HandshakeException || error is ArgumentError);
+    } else if (result == 'throw') {
+      Expect.isTrue(error is CustomException);
+    } else {
+      Expect.fail('Unknown expectation $result');
+    }
+  }
+}
\ No newline at end of file
diff --git a/tests/standalone/io/secure_builtin_roots_test.dart b/tests/standalone/io/secure_builtin_roots_test.dart
index 875ea09..6cb85d6 100644
--- a/tests/standalone/io/secure_builtin_roots_test.dart
+++ b/tests/standalone/io/secure_builtin_roots_test.dart
@@ -7,86 +7,33 @@
 
 import "package:async_helper/async_helper.dart";
 import "package:expect/expect.dart";
-import "package:path/path.dart";
 
-void main(List<String> args) {
-  if (!args.contains('--child')) {
-    runAllTestsInChildProcesses();
-  } else {
-    InitializeSSL(useDatabase: args.contains('--database'),
-                  useBuiltinRoots: args.contains('--builtin-roots'));
-    testGoogleUrl(args.contains('--builtin-roots'));
-  }
-}
-
-void InitializeSSL({bool useDatabase, bool useBuiltinRoots}) {
-  // If the built-in root certificates aren't loaded, the connection
-  // should signal an error.  Even when an external database is loaded,
-  // they should not be loaded.
-  if (useDatabase) {
-    var certificateDatabase = Platform.script.resolve('pkcert').toFilePath();
-    SecureSocket.initialize(database: certificateDatabase,
-                            password: 'dartdart',
-                            useBuiltinRoots: useBuiltinRoots);
-  } else {
-    SecureSocket.initialize(useBuiltinRoots: useBuiltinRoots);
-  }
-}
-
-void testGoogleUrl(bool expectSuccess) {
+Future testGoogleUrl(SecurityContext context, String outcome) async {
+  var client = new HttpClient(context: context);
   // We need to use an external server that is backed by a
   // built-in root certificate authority.
-
-  // First, check if the lookup fails.  If not then run the test.
-  InternetAddress.lookup('www.google.com').then((_) {
-    HttpClient client = new HttpClient();
-    client.getUrl(Uri.parse('https://www.google.com'))
-      .then((request) {
-        request.followRedirects = false;
-        return request.close();
-      })
-      .then((response) {
-        Expect.isTrue(expectSuccess, "Unexpected successful connection");
-        print('SUCCESS');
-        return response.drain().catchError((_) {});
-      })
-      .catchError((error) {
-        // Allow SocketExceptions if www.google.com is unreachable or down.
-        Expect.isTrue((!expectSuccess && error is HandshakeException) ||
-                      error is SocketException);
-        print('SUCCESS');
-      })
-      .whenComplete(client.close);
-  },
-  onError: (e) {
-    // Lookup failed.
-    Expect.isTrue(e is SocketException);
-    print('SUCCESS');
-  });
+  try {
+  // First, check if the lookup works.
+    await InternetAddress.lookup('www.google.com');
+    var request = await client.getUrl(Uri.parse('https://www.google.com'));
+    request.followRedirects = false;
+    var response = await request.close();
+    Expect.equals('pass', outcome, 'Unexpected successful connection');
+    try { await response.drain(); } catch (e) { }
+  } on HandshakeException {
+    Expect.equals('fail', outcome, 'Unexpected failed connection');
+  } on SocketException {
+    // Lookup failed or connection failed.  Don't report a failure.
+  } finally {
+    client.close();
+  }
 }
 
-void runAllTestsInChildProcesses() {
-  Future runChild(List<String> scriptArguments) {
-    return Process.run(Platform.executable,
-                       []..addAll(Platform.executableArguments)
-                         ..add(Platform.script.toFilePath())
-                         ..addAll(scriptArguments))
-    .then((ProcessResult result) {
-      if (result.exitCode != 0 || !result.stdout.contains('SUCCESS')) {
-        print("Client failed");
-        print("  stdout:");
-        print(result.stdout);
-        print("  stderr:");
-        print(result.stderr);
-        Expect.fail('Client subprocess exit code: ${result.exitCode}');
-      }
-    });
-  }
 
+main() async {
   asyncStart();
-  Future.wait([runChild(['--child']),
-               runChild(['--child', '--database']),
-               runChild(['--child', '--builtin-roots']),
-               runChild(['--child', '--builtin-roots', '--database'])])
-      .then((_) => asyncEnd());
-  }
+  await testGoogleUrl(null, "pass");
+  await testGoogleUrl(SecurityContext.defaultContext, "pass");
+  await testGoogleUrl(new SecurityContext(), "fail");
+  asyncEnd();
+}
diff --git a/tests/standalone/io/secure_client_raw_server_test.dart b/tests/standalone/io/secure_client_raw_server_test.dart
index e380f75..318edeb 100644
--- a/tests/standalone/io/secure_client_raw_server_test.dart
+++ b/tests/standalone/io/secure_client_raw_server_test.dart
@@ -13,12 +13,21 @@
 import "package:async_helper/async_helper.dart";
 import "package:expect/expect.dart";
 
+String localFile(path) => Platform.script.resolve(path).toFilePath();
+
+SecurityContext serverContext = new SecurityContext()
+  ..useCertificateChain(localFile('certificates/server_chain.pem'))
+  ..usePrivateKey(localFile('certificates/server_key.pem'),
+                  password: 'dartdart');
+
+SecurityContext clientContext = new SecurityContext()
+  ..setTrustedCertificates(file: localFile('certificates/trusted_certs.pem'));
+
 InternetAddress HOST;
-const CERTIFICATE = "localhost_cert";
 Future<RawSecureServerSocket> startEchoServer() {
   return RawSecureServerSocket.bind(HOST,
                                     0,
-                                    CERTIFICATE).then((server) {
+                                    serverContext).then((server) {
     server.listen((RawSecureSocket client) {
       List<List<int>> readChunks = <List<int>>[];
       List<int> dataToWrite = null;
@@ -60,7 +69,8 @@
 Future testClient(server) {
   Completer success = new Completer();
   List<String> chunks = <String>[];
-  SecureSocket.connect(HOST, server.port).then((socket) {
+  SecureSocket.connect(HOST, server.port, context: clientContext)
+  .then((socket) {
     socket.write("Hello server.");
     socket.close();
     socket.listen(
@@ -79,9 +89,6 @@
 
 void main() {
   asyncStart();
-  String certificateDatabase = Platform.script.resolve('pkcert').toFilePath();
-  SecureSocket.initialize(database: certificateDatabase,
-                          password: 'dartdart');
   InternetAddress.lookup("localhost").then((hosts) => HOST = hosts.first)
       .then((_) => startEchoServer())
       .then(testClient)
diff --git a/tests/standalone/io/secure_client_server_test.dart b/tests/standalone/io/secure_client_server_test.dart
index 3c41266..b4f3db14 100644
--- a/tests/standalone/io/secure_client_server_test.dart
+++ b/tests/standalone/io/secure_client_server_test.dart
@@ -14,11 +14,22 @@
 import "package:expect/expect.dart";
 
 InternetAddress HOST;
-const CERTIFICATE = "localhost_cert";
+
+String localFile(path) => Platform.script.resolve(path).toFilePath();
+
+SecurityContext serverContext = new SecurityContext()
+  ..useCertificateChain(localFile('certificates/server_chain.pem'))
+  ..usePrivateKey(localFile('certificates/server_key.pem'),
+                  password: 'dartdart');
+
+SecurityContext clientContext = new SecurityContext()
+  ..setTrustedCertificates(file: localFile('certificates/trusted_certs.pem'));
+
+
 Future<SecureServerSocket> startEchoServer() {
   return SecureServerSocket.bind(HOST,
                                  0,
-                                 CERTIFICATE).then((server) {
+                                 serverContext).then((server) {
     server.listen((SecureSocket client) {
       client.fold(<int>[], (message, data) => message..addAll(data))
           .then((message) {
@@ -31,7 +42,8 @@
 }
 
 Future testClient(server) {
-  return SecureSocket.connect(HOST, server.port).then((socket) {
+  return SecureSocket.connect(HOST, server.port, context: clientContext)
+  .then((socket) {
     socket.write("Hello server.");
     socket.close();
     return socket.fold(<int>[], (message, data) => message..addAll(data))
@@ -44,9 +56,6 @@
 
 void main() {
   asyncStart();
-  String certificateDatabase = Platform.script.resolve('pkcert').toFilePath();
-  SecureSocket.initialize(database: certificateDatabase,
-                          password: 'dartdart');
   InternetAddress.lookup("localhost").then((hosts) => HOST = hosts.first )
       .then((_) => startEchoServer())
       .then(testClient)
diff --git a/tests/standalone/io/secure_multiple_client_server_test.dart b/tests/standalone/io/secure_multiple_client_server_test.dart
index 2eeeed2..586105d 100644
--- a/tests/standalone/io/secure_multiple_client_server_test.dart
+++ b/tests/standalone/io/secure_multiple_client_server_test.dart
@@ -15,10 +15,19 @@
 
 InternetAddress HOST;
 SecureServerSocket SERVER;
-const CERTIFICATE = "localhost_cert";
+
+String localFile(path) => Platform.script.resolve(path).toFilePath();
+
+SecurityContext serverContext = new SecurityContext()
+  ..useCertificateChain(localFile('certificates/server_chain.pem'))
+  ..usePrivateKey(localFile('certificates/server_key.pem'),
+                  password: 'dartdart');
+
+SecurityContext clientContext = new SecurityContext()
+  ..setTrustedCertificates(file: localFile('certificates/trusted_certs.pem'));
 
 Future startServer() {
-  return SecureServerSocket.bind(HOST, 0, CERTIFICATE).then((server) {
+  return SecureServerSocket.bind(HOST, 0, serverContext).then((server) {
     SERVER = server;
     SERVER.listen((SecureSocket client) {
       client.fold(<int>[], (message, data) => message..addAll(data))
@@ -34,7 +43,8 @@
 }
 
 Future testClient(name) {
-  return SecureSocket.connect(HOST, SERVER.port).then((socket) {
+  return SecureSocket.connect(HOST, SERVER.port, context: clientContext)
+  .then((socket) {
     socket.add("Hello from client $name".codeUnits);
     socket.close();
     return socket.fold(<int>[], (message, data) => message..addAll(data))
@@ -46,9 +56,6 @@
 
 void main() {
   asyncStart();
-  var certificateDatabase = Platform.script.resolve('pkcert').toFilePath();
-  SecureSocket.initialize(database: certificateDatabase,
-                          password: 'dartdart');
   InternetAddress.lookup("localhost").then((hosts) => HOST = hosts.first)
       .then((_) => startServer())
       .then((_) => ['ale', 'bar', 'che', 'den', 'els'].map(testClient))
diff --git a/tests/standalone/io/secure_server_client_certificate_test.dart b/tests/standalone/io/secure_server_client_certificate_test.dart
index 34de17d..c104dba 100644
--- a/tests/standalone/io/secure_server_client_certificate_test.dart
+++ b/tests/standalone/io/secure_server_client_certificate_test.dart
@@ -9,75 +9,68 @@
 import "package:expect/expect.dart";
 
 InternetAddress HOST;
-const CERTIFICATE = "localhost_cert";
 
-Future testClientCertificate() {
-  var completer = new Completer();
-  SecureServerSocket.bind(HOST,
-                          0,
-                          CERTIFICATE,
-                          requestClientCertificate: true).then((server) {
-    var clientEndFuture = SecureSocket.connect(HOST,
-                                               server.port,
-                                               sendClientCertificate: true);
-    server.listen((serverEnd) {
-      X509Certificate certificate = serverEnd.peerCertificate;
-      Expect.isNotNull(certificate);
-      Expect.equals("CN=localhost", certificate.subject);
-      Expect.equals("CN=myauthority", certificate.issuer);
-      clientEndFuture.then((clientEnd) {
-        X509Certificate certificate = clientEnd.peerCertificate;
-        Expect.isNotNull(certificate);
-        Expect.equals("CN=localhost", certificate.subject);
-        Expect.equals("CN=myauthority", certificate.issuer);
-        clientEnd.close();
-        serverEnd.close();
-        server.close();
-        completer.complete();
-      });
-    });
-  });
-  return completer.future;
+String localFile(path) => Platform.script.resolve(path).toFilePath();
+
+SecurityContext serverContext = new SecurityContext()
+  ..useCertificateChain(localFile('certificates/server_chain.pem'))
+  ..usePrivateKey(localFile('certificates/server_key.pem'),
+      password: 'dartdart')
+  ..setTrustedCertificates(file: localFile('certificates/client_authority.pem'))
+  ..setClientAuthorities(localFile('certificates/client_authority.pem'));
+
+SecurityContext clientCertContext = new SecurityContext()
+  ..setTrustedCertificates(file: localFile('certificates/trusted_certs.pem'))
+  ..useCertificateChain(localFile('certificates/client1.pem'))
+  ..usePrivateKey(localFile('certificates/client1_key.pem'),
+      password: 'dartdart');
+
+SecurityContext clientNoCertContext = new SecurityContext()
+  ..setTrustedCertificates(file: localFile('certificates/trusted_certs.pem'));
+
+Future testClientCertificate({bool required, bool sendCert}) async {
+  var server = await SecureServerSocket.bind(HOST, 0, serverContext,
+      requestClientCertificate: true, requireClientCertificate: required);
+  var clientContext = sendCert ? clientCertContext : clientNoCertContext;
+  var clientEndFuture =
+      SecureSocket.connect(HOST, server.port, context: clientContext);
+  if (required && !sendCert) {
+    try {
+      await server.first;
+    } catch (e) {
+      try {
+        await clientEndFuture;
+      } catch (e) {
+        return;
+      }
+    }
+    Expect.fail("Connection succeeded with no required client certificate");
+  }
+  var serverEnd = await server.first;
+  var clientEnd = await clientEndFuture;
+
+  X509Certificate clientCertificate = serverEnd.peerCertificate;
+  if (sendCert) {
+    Expect.isNotNull(clientCertificate);
+    Expect.equals("/CN=user1", clientCertificate.subject);
+    Expect.equals("/CN=clientauthority", clientCertificate.issuer);
+  } else {
+    Expect.isNull(clientCertificate);
+  }
+  X509Certificate serverCertificate = clientEnd.peerCertificate;
+  Expect.isNotNull(serverCertificate);
+  Expect.equals("/CN=localhost", serverCertificate.subject);
+  Expect.equals("/CN=intermediateauthority", serverCertificate.issuer);
+  clientEnd.close();
+  serverEnd.close();
 }
 
-Future testRequiredClientCertificate() {
-  var completer = new Completer();
-  SecureServerSocket.bind(HOST,
-                          0,
-                          CERTIFICATE,
-                          requireClientCertificate: true).then((server) {
-    var clientEndFuture = SecureSocket.connect(HOST,
-                                               server.port,
-                                               sendClientCertificate: true);
-    server.listen((serverEnd) {
-      X509Certificate certificate = serverEnd.peerCertificate;
-      Expect.isNotNull(certificate);
-      Expect.equals("CN=localhost", certificate.subject);
-      Expect.equals("CN=myauthority", certificate.issuer);
-      clientEndFuture.then((clientEnd) {
-        X509Certificate certificate = clientEnd.peerCertificate;
-        Expect.isNotNull(certificate);
-        Expect.equals("CN=localhost", certificate.subject);
-        Expect.equals("CN=myauthority", certificate.issuer);
-        clientEnd.close();
-        serverEnd.close();
-        server.close();
-        completer.complete();
-      });
-    });
-  });
-  return completer.future;
-}
-
-void main() {
-  String certificateDatabase = Platform.script.resolve('pkcert').toFilePath();
-  SecureSocket.initialize(database: certificateDatabase,
-                          password: 'dartdart',
-                          useBuiltinRoots: false);
-
+main() async {
   asyncStart();
-  InternetAddress.lookup("localhost").then((hosts) => HOST = hosts.first)
-    .then((_) => testClientCertificate())
-    .then((_) => testRequiredClientCertificate())
-    .then((_) => asyncEnd());
+  HOST = (await InternetAddress.lookup("localhost")).first;
+  await testClientCertificate(required: false, sendCert: true);
+  await testClientCertificate(required: true, sendCert: true);
+  await testClientCertificate(required: false, sendCert: false);
+  await testClientCertificate(required: true, sendCert: false);
+  asyncEnd();
 }
diff --git a/tests/standalone/io/secure_server_client_no_certificate_test.dart b/tests/standalone/io/secure_server_client_no_certificate_test.dart
deleted file mode 100644
index 888f988..0000000
--- a/tests/standalone/io/secure_server_client_no_certificate_test.dart
+++ /dev/null
@@ -1,70 +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 "dart:async";
-import "dart:io";
-
-import "package:async_helper/async_helper.dart";
-import "package:expect/expect.dart";
-
-InternetAddress HOST;
-const CERTIFICATE = "localhost_cert";
-
-Future testNoClientCertificate() {
-  var completer = new Completer();
-  SecureServerSocket.bind(HOST,
-                          0,
-                          CERTIFICATE,
-                          requestClientCertificate: true).then((server) {
-    var clientEndFuture = SecureSocket.connect(HOST,
-                                               server.port);
-    server.listen((serverEnd) {
-      X509Certificate certificate = serverEnd.peerCertificate;
-      Expect.isNull(certificate);
-      clientEndFuture.then((clientEnd) {
-        clientEnd.close();
-        serverEnd.close();
-        server.close();
-        completer.complete();
-      });
-    });
-  });
-  return completer.future;
-}
-
-Future testNoRequiredClientCertificate() {
-  var completer = new Completer();
-  bool clientError = false;
-  SecureServerSocket.bind(HOST,
-                          0,
-                          CERTIFICATE,
-                          requireClientCertificate: true).then((server) {
-    Future clientDone = SecureSocket.connect(HOST, server.port)
-      .catchError((e) { clientError = true; });
-    server.listen((serverEnd) {
-      Expect.fail("Got a unverifiable connection");
-    },
-    onError: (e) {
-      clientDone.then((_) {
-        Expect.isTrue(clientError);
-        server.close();
-        completer.complete();
-      });
-    });
-  });
-  return completer.future;
-}
-
-void main() {
-  String certificateDatabase = Platform.script.resolve('pkcert').toFilePath();
-  SecureSocket.initialize(database: certificateDatabase,
-                          password: 'dartdart',
-                          useBuiltinRoots: false);
-
-  asyncStart();
-  InternetAddress.lookup("localhost").then((hosts) => HOST = hosts.first)
-    .then((_) => testNoRequiredClientCertificate())
-    .then((_) => testNoClientCertificate())
-    .then((_) => asyncEnd());
-}
diff --git a/tests/standalone/io/secure_server_closing_test.dart b/tests/standalone/io/secure_server_closing_test.dart
index a45877b..0677a41 100644
--- a/tests/standalone/io/secure_server_closing_test.dart
+++ b/tests/standalone/io/secure_server_closing_test.dart
@@ -14,7 +14,16 @@
 import "package:expect/expect.dart";
 
 InternetAddress HOST;
-const CERTIFICATE = "localhost_cert";
+
+String localFile(path) => Platform.script.resolve(path).toFilePath();
+
+SecurityContext serverContext = new SecurityContext()
+  ..useCertificateChain(localFile('certificates/server_chain.pem'))
+  ..usePrivateKey(localFile('certificates/server_key.pem'),
+                  password: 'dartdart');
+
+SecurityContext clientContext = new SecurityContext()
+  ..setTrustedCertificates(file: localFile('certificates/trusted_certs.pem'));
 
 void testCloseOneEnd(String toClose) {
   asyncStart();
@@ -25,7 +34,7 @@
       .then((_) {
         asyncEnd();
       });
-  SecureServerSocket.bind(HOST, 0, CERTIFICATE).then((server) {
+  SecureServerSocket.bind(HOST, 0, serverContext).then((server) {
     server.listen((serverConnection) {
       serverConnection.listen(
         (data) {
@@ -43,7 +52,8 @@
     onDone: () {
       serverDone.complete(null);
     });
-    SecureSocket.connect(HOST, server.port).then((clientConnection) {
+    SecureSocket.connect(HOST, server.port, context: clientContext)
+                .then((clientConnection) {
       clientConnection.listen(
         (data) {
           Expect.fail("No data should be received by client");
@@ -61,8 +71,9 @@
 
 void testCloseBothEnds() {
   asyncStart();
-  SecureServerSocket.bind(HOST, 0, CERTIFICATE).then((server) {
-    var clientEndFuture = SecureSocket.connect(HOST, server.port);
+  SecureServerSocket.bind(HOST, 0, serverContext).then((server) {
+    var clientEndFuture =
+        SecureSocket.connect(HOST, server.port, context: clientContext);
     server.listen((serverEnd) {
       clientEndFuture.then((clientEnd) {
         clientEnd.destroy();
@@ -83,7 +94,7 @@
 
   SecureServerSocket.bind(HOST,
                           0,
-                          CERTIFICATE,
+                          serverContext,
                           backlog: 2 * socketCount).then((server) {
     Expect.isTrue(server.port > 0);
     var subscription;
@@ -97,12 +108,12 @@
     });
 
     // Pause the server socket subscription and resume it after having
-    // connected a number client sockets. Then connect more client
-    // sockets.
+    // connected a number client sockets. Then connect more client sockets.
     subscription.pause();
     var connectCount = 0;
     for (int i = 0; i < socketCount; i++) {
-      SecureSocket.connect(HOST, server.port).then((connection) {
+      SecureSocket.connect(HOST, server.port, context: clientContext)
+      .then((connection) {
         connection.close();
       });
     }
@@ -110,7 +121,8 @@
       subscription.resume();
       resumed = true;
       for (int i = 0; i < socketCount; i++) {
-        SecureSocket.connect(HOST, server.port).then((connection) {
+        SecureSocket.connect(HOST, server.port, context: clientContext)
+        .then((connection) {
           connection.close();
         });
       }
@@ -125,7 +137,7 @@
   asyncStart();
   List ends = [];
 
-  SecureServerSocket.bind(HOST, 0, CERTIFICATE).then((server) {
+  SecureServerSocket.bind(HOST, 0, serverContext).then((server) {
     Expect.isTrue(server.port > 0);
     void checkDone() {
       if (ends.length < 2 * socketCount) return;
@@ -142,7 +154,8 @@
     });
 
     for (int i = 0; i < socketCount; i++) {
-      SecureSocket.connect(HOST, server.port).then((connection) {
+      SecureSocket.connect(HOST, server.port, context: clientContext)
+      .then((connection) {
         ends.add(connection);
         checkDone();
       });
@@ -153,10 +166,6 @@
 
 main() {
   asyncStart();
-  String certificateDatabase = Platform.script.resolve('pkcert').toFilePath();
-  SecureSocket.initialize(database: certificateDatabase,
-                          password: 'dartdart',
-                          useBuiltinRoots: false);
   InternetAddress.lookup("localhost").then((hosts) {
     HOST = hosts.first;
     runTests();
diff --git a/tests/standalone/io/secure_server_socket_test.dart b/tests/standalone/io/secure_server_socket_test.dart
index a6a1087..6ef7f27 100644
--- a/tests/standalone/io/secure_server_socket_test.dart
+++ b/tests/standalone/io/secure_server_socket_test.dart
@@ -14,11 +14,20 @@
 import "package:expect/expect.dart";
 
 InternetAddress HOST;
-const CERTIFICATE = "localhost_cert";
+
+String localFile(path) => Platform.script.resolve(path).toFilePath();
+
+SecurityContext serverContext = new SecurityContext()
+  ..useCertificateChain(localFile('certificates/server_chain.pem'))
+  ..usePrivateKey(localFile('certificates/server_key.pem'),
+                  password: 'dartdart');
+
+SecurityContext clientContext = new SecurityContext()
+  ..setTrustedCertificates(file: localFile('certificates/trusted_certs.pem'));
 
 void testSimpleBind() {
   asyncStart();
-  SecureServerSocket.bind(HOST, 0, CERTIFICATE).then((s) {
+  SecureServerSocket.bind(HOST, 0, serverContext).then((s) {
     Expect.isTrue(s.port > 0);
     s.close();
     asyncEnd();
@@ -30,7 +39,7 @@
 
   // Bind to a unknown DNS name.
   asyncStart();
-  SecureServerSocket.bind("ko.faar.__hest__", 0, CERTIFICATE).then((_) {
+  SecureServerSocket.bind("ko.faar.__hest__", 0, serverContext).then((_) {
     Expect.fail("Failure expected");
   }).catchError((error) {
     Expect.isTrue(error is SocketException);
@@ -39,7 +48,7 @@
 
   // Bind to an unavaliable IP-address.
   asyncStart();
-  SecureServerSocket.bind("8.8.8.8", 0, CERTIFICATE).then((_) {
+  SecureServerSocket.bind("8.8.8.8", 0, serverContext).then((_) {
     Expect.fail("Failure expected");
   }).catchError((error) {
     Expect.isTrue(error is SocketException);
@@ -48,10 +57,10 @@
 
   // Bind to a port already in use.
   asyncStart();
-  SecureServerSocket.bind(HOST, 0, CERTIFICATE).then((s) {
+  SecureServerSocket.bind(HOST, 0, serverContext).then((s) {
     SecureServerSocket.bind(HOST,
                             s.port,
-                            CERTIFICATE).then((t) {
+                            serverContext).then((t) {
       Expect.fail("Multiple listens on same port");
     }).catchError((error) {
       Expect.isTrue(error is SocketException);
@@ -61,12 +70,18 @@
   });
 }
 
-void testSimpleConnect(String certificate) {
+void testSimpleConnect() {
   asyncStart();
-  SecureServerSocket.bind(HOST, 0, certificate).then((server) {
-    var clientEndFuture = SecureSocket.connect(HOST, server.port);
+  SecureServerSocket.bind(HOST, 0, serverContext).then((server) {
+    var clientEndFuture =
+        SecureSocket.connect(HOST, server.port, context: clientContext);
     server.listen((serverEnd) {
       clientEndFuture.then((clientEnd) {
+        var x5 = clientEnd.peerCertificate;
+        print(x5.subject);
+        print(x5.issuer);
+        print(x5.startValidity);
+        print(x5.endValidity);
         clientEnd.close();
         serverEnd.close();
         server.close();
@@ -76,22 +91,32 @@
   });
 }
 
-void testSimpleConnectFail(String certificate, bool cancelOnError) {
+void testSimpleConnectFail(SecurityContext serverContext,
+                           SecurityContext clientContext,
+                           bool cancelOnError) {
+  print('$serverContext $clientContext $cancelOnError');
   asyncStart();
-  SecureServerSocket.bind(HOST, 0, certificate).then((server) {
-    var clientEndFuture = SecureSocket.connect(HOST, server.port)
+  SecureServerSocket.bind(HOST, 0, serverContext).then((server) {
+    var clientEndFuture =
+        SecureSocket.connect(HOST, server.port, context: clientContext)
       .then((clientEnd) {
         Expect.fail("No client connection expected.");
       })
       .catchError((error) {
-        Expect.isTrue(error is HandshakeException ||
+        // TODO(whesse): When null context is supported, disallow
+        // the ArgumentError type here.
+        Expect.isTrue(error is ArgumentError ||
+                      error is HandshakeException ||
                       error is SocketException);
       });
     server.listen((serverEnd) {
       Expect.fail("No server connection expected.");
     },
     onError: (error) {
-      Expect.isTrue(error is CertificateException);
+      // TODO(whesse): When null context is supported, disallow
+      // the ArgumentError type here.
+      Expect.isTrue(error is ArgumentError ||
+                    error is HandshakeException);
       clientEndFuture.then((_) {
         if (!cancelOnError) server.close();
         asyncEnd();
@@ -103,9 +128,10 @@
 
 void testServerListenAfterConnect() {
   asyncStart();
-  SecureServerSocket.bind(HOST, 0, CERTIFICATE).then((server) {
+  SecureServerSocket.bind(HOST, 0, serverContext).then((server) {
     Expect.isTrue(server.port > 0);
-    var clientEndFuture = SecureSocket.connect(HOST, server.port);
+    var clientEndFuture =
+        SecureSocket.connect(HOST, server.port, context: clientContext);
     new Timer(const Duration(milliseconds: 500), () {
       server.listen((serverEnd) {
         clientEndFuture.then((clientEnd) {
@@ -144,7 +170,7 @@
     }
   }
 
-  SecureServerSocket.bind(HOST, 0, CERTIFICATE).then((server) {
+  SecureServerSocket.bind(HOST, 0, serverContext).then((server) {
     server.listen((client) {
       int bytesRead = 0;
       int bytesWritten = 0;
@@ -166,7 +192,8 @@
         });
     });
 
-    SecureSocket.connect(HOST, server.port).then((socket) {
+    SecureSocket.connect(HOST, server.port, context: clientContext)
+    .then((socket) {
       int bytesRead = 0;
       int bytesWritten = 0;
       List<int> dataSent = createTestData();
@@ -189,10 +216,6 @@
 
 main() {
   asyncStart();
-  String certificateDatabase = Platform.script.resolve('pkcert').toFilePath();
-  SecureSocket.initialize(database: certificateDatabase,
-                          password: 'dartdart',
-                          useBuiltinRoots: false);
   InternetAddress.lookup("localhost").then((hosts) {
     HOST = hosts.first;
     runTests();
@@ -203,12 +226,16 @@
 runTests() {
   testSimpleBind();
   testInvalidBind();
-  testSimpleConnect(CERTIFICATE);
-  testSimpleConnect("CN=localhost");
-  testSimpleConnectFail("not_a_nickname", false);
-  testSimpleConnectFail("CN=notARealDistinguishedName", false);
-  testSimpleConnectFail("not_a_nickname", true);
-  testSimpleConnectFail("CN=notARealDistinguishedName", true);
+  testSimpleConnect();
+  for (var server in [serverContext, null]) {
+    for (var client in [clientContext, null]) {
+      for (bool cancelOnError in [true, false]) {
+        if (server == null || client == null) {
+          testSimpleConnectFail(server, client, cancelOnError);
+        }
+      }
+    }
+  }
   testServerListenAfterConnect();
   testSimpleReadWrite();
 }
diff --git a/tests/standalone/io/secure_session_resume_test.dart b/tests/standalone/io/secure_session_resume_test.dart
index 5b8a3a3..8ec99a4 100644
--- a/tests/standalone/io/secure_session_resume_test.dart
+++ b/tests/standalone/io/secure_session_resume_test.dart
@@ -24,11 +24,21 @@
 import "package:async_helper/async_helper.dart";
 
 InternetAddress HOST;
-const CERTIFICATE = "localhost_cert";
+
+String localFile(path) => Platform.script.resolve(path).toFilePath();
+
+SecurityContext serverContext = new SecurityContext()
+  ..useCertificateChain(localFile('certificates/server_chain.pem'))
+  ..usePrivateKey(localFile('certificates/server_key.pem'),
+                  password: 'dartdart');
+
+SecurityContext clientContext = new SecurityContext()
+  ..setTrustedCertificates(file: localFile('certificates/trusted_certs.pem'));
+
 Future<SecureServerSocket> startServer() {
   return SecureServerSocket.bind(HOST,
                                  0,
-                                 CERTIFICATE).then((server) {
+                                 serverContext).then((server) {
     server.listen((SecureSocket client) {
       client.fold(<int>[], (message, data) => message..addAll(data))
           .then((message) {
@@ -44,7 +54,8 @@
 }
 
 Future testClient(server, name) {
-  return SecureSocket.connect(HOST, server.port).then((socket) {
+  return SecureSocket.connect(HOST, server.port, context: clientContext)
+  .then((socket) {
     socket.write("Hello from client $name");
     socket.close();
     return socket.fold(<int>[], (message, data) => message..addAll(data))
@@ -57,9 +68,6 @@
 
 void main() {
   asyncStart();
-  String certificateDatabase = Platform.script.resolve('pkcert').toFilePath();
-  SecureSocket.initialize(database: certificateDatabase,
-                          password: 'dartdart');
   InternetAddress.lookup("localhost").then((hosts) {
     HOST = hosts.first;
     runTests().then((_) => asyncEnd());
diff --git a/tests/standalone/io/secure_socket_alpn_test.dart b/tests/standalone/io/secure_socket_alpn_test.dart
index 963fb74..3ad9112 100644
--- a/tests/standalone/io/secure_socket_alpn_test.dart
+++ b/tests/standalone/io/secure_socket_alpn_test.dart
@@ -1,4 +1,4 @@
-// Copyright (c) 2014, the Dart project authors.  Please see the AUTHORS file
+// 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.
 
@@ -8,26 +8,31 @@
 import 'package:expect/expect.dart';
 import 'package:async_helper/async_helper.dart';
 
-const String MAX_LEN_ERROR =
+const String NAME_LENGTH_ERROR =
     'Length of protocol must be between 1 and 255';
 
-const String MAX_MSG_LEN_ERROR =
-    'The maximum message length supported is 2^15-1';
+const String MESSAGE_LENGTH_ERROR =
+    'The maximum message length supported is 2^13-1';
 
-void InitializeSSL() {
-  var testPkcertDatabase = Platform.script.resolve('pkcert').toFilePath();
-  SecureSocket.initialize(database: testPkcertDatabase,
-                          password: 'dartdart');
-}
+String localFile(path) => Platform.script.resolve(path).toFilePath();
 
-// Tests that client/server with same protocol can securly establish a
-// connection, negogiate the protocol and can send data to each other.
-void testSuccessfulAlpnNegogiationConnection(List<String> clientProtocols,
+SecurityContext clientContext() => new SecurityContext()
+  ..setTrustedCertificates(file: localFile('certificates/trusted_certs.pem'));
+
+SecurityContext serverContext() => new SecurityContext()
+  ..useCertificateChain(localFile('certificates/server_chain.pem'))
+  ..usePrivateKey(localFile('certificates/server_key.pem'),
+                    password: 'dartdart');
+
+// Tests that client/server with same protocol can securely establish a
+// connection, negotiate the protocol and can send data to each other.
+void testSuccessfulAlpnNegotiationConnection(List<String> clientProtocols,
                                              List<String> serverProtocols,
                                              String selectedProtocol) {
   asyncStart();
-  SecureServerSocket.bind('localhost', 0, 'localhost_cert',
-     supportedProtocols: serverProtocols).then((SecureServerSocket server) {
+  var sContext = serverContext()..setAlpnProtocols(serverProtocols, true);
+  SecureServerSocket.bind('localhost', 0, sContext)
+     .then((SecureServerSocket server) {
 
     asyncStart();
     server.first.then((SecureSocket socket) {
@@ -40,7 +45,7 @@
     });
 
     asyncStart();
-    SecureSocket.connect('localhost', server.port,
+    SecureSocket.connect('localhost', server.port, context: clientContext(),
         supportedProtocols: clientProtocols).then((socket) {
       Expect.equals(selectedProtocol, socket.selectedProtocol);
       socket..write('client message')..close();
@@ -55,160 +60,145 @@
   });
 }
 
-void testFailedAlpnNegogiationConnection(List<String> clientProtocols,
-                                         List<String> serverProtocols) {
-  asyncStart();
-  SecureServerSocket.bind('localhost', 0, 'localhost_cert',
-     supportedProtocols: serverProtocols).then((SecureServerSocket server) {
+void testInvalidArgument(List<String> protocols, String errorIncludes) {
+  testInvalidArgumentServerContext(protocols, errorIncludes);
+  testInvalidArgumentClientContext(protocols, errorIncludes);
+  testInvalidArgumentClientConnect(protocols, errorIncludes);
+}
 
-    asyncStart();
-    server.first.catchError((error, stack) {
-      Expect.isTrue(error is HandshakeException);
-      asyncEnd();
-    });
-
-    asyncStart();
-    SecureSocket.connect('localhost',
-                         server.port,
-                         supportedProtocols: clientProtocols)
-        .catchError((error, stack) {
-      Expect.isTrue(error is HandshakeException);
-      asyncEnd();
-    });
-
-    asyncEnd();
+void testInvalidArgumentServerContext(List<String> protocols,
+                                      String errorIncludes) { 
+  Expect.throws(() => serverContext().setAlpnProtocols(protocols, true), (e) {
+    Expect.isTrue(e is ArgumentError);
+    Expect.isTrue(e.toString().contains(errorIncludes));
+    return true;
   });
 }
 
-void testInvalidArgumentsLongName(List<String> protocols,
-                                  bool isLenError,
-                                  bool isMsgLenError) {
+void testInvalidArgumentClientContext(List<String> protocols,
+                                      String errorIncludes) { 
+  Expect.throws(() => clientContext().setAlpnProtocols(protocols, false), (e) {
+    Expect.isTrue(e is ArgumentError);
+    Expect.isTrue(e.toString().contains(errorIncludes));
+    return true;
+  });
+}
+
+void testInvalidArgumentClientConnect(List<String> protocols,
+                                      String errorIncludes) {
   asyncStart();
-  SecureServerSocket.bind('localhost', 0, 'localhost_cert',
-     supportedProtocols: protocols).then((SecureServerSocket server) {
+  var sContext = serverContext()..setAlpnProtocols(['abc'], true);
+  SecureServerSocket.bind('localhost', 0, sContext).then((server) async {
+    asyncStart();
+    server.listen((SecureSocket socket) {
+      Expect.fail(
+          "Unexpected connection made to server, with bad client argument");
+    }, onError: (e) {
+      Expect.fail("Unexpected error on server stream: $e");
+    }, onDone: () { asyncEnd();});
 
     asyncStart();
-    server.first.catchError((error, stack) {
-      String errorString = '${(error as ArgumentError)}';
-      if (isLenError) {
-        Expect.isTrue(errorString.contains(MAX_LEN_ERROR));
-      } else if (isMsgLenError) {
-        Expect.isTrue(errorString.contains(MAX_MSG_LEN_ERROR));
-      } else {
-        throw 'unreachable';
-      }
+    SecureSocket.connect('localhost', server.port, context: clientContext(),
+          supportedProtocols: protocols).then((socket) {
+      Expect.fail(
+          "Unexpected connection made from client, with bad client argument");
+    }, onError: (e) {
+      Expect.isTrue(e is ArgumentError);
+      Expect.isTrue(e.toString().contains(errorIncludes));
+      server.close();
       asyncEnd();
     });
-
-    asyncStart();
-    SecureSocket.connect('localhost',
-                         server.port,
-                         supportedProtocols: protocols)
-        .catchError((error, stack) {
-      String errorString = '${(error as ArgumentError)}';
-      if (isLenError) {
-        Expect.isTrue(errorString.contains(MAX_LEN_ERROR));
-      } else if (isMsgLenError) {
-        Expect.isTrue(errorString.contains(MAX_MSG_LEN_ERROR));
-      } else {
-        throw 'unreachable';
-      }
-      asyncEnd();
-    });
-
     asyncEnd();
   });
 }
 
 main() {
-  InitializeSSL();
   final longname256 = 'p' * 256;
   final String longname255 = 'p' * 255;
   final String strangelongname255 = 'ø' + 'p' * 253;
   final String strangelongname256 = 'ø' + 'p' * 254;
 
-  // This produces a message of (1 << 15)-2 bytes (1 length and 1 ascii byte).
-  final List<String> allProtocols = new Iterable.generate(
-      (1 << 14) - 1, (i) => '0').toList();
+  // This produces a message of (1 << 13) - 2 bytes. 2^12 -1 strings are each
+  // encoded by 1 length byte and 1 ascii byte.
+  final List<String> manyProtocols = new Iterable.generate(
+      (1 << 12) - 1, (i) => '0').toList();
 
-  // This produces a message of (1 << 15) bytes (1 length and 1 ascii byte).
-  final List<String> allProtocolsPlusOne = new Iterable.generate(
-      (1 << 14), (i) => '0').toList();
+  // This produces a message of (1 << 13) bytes. 2^12 strings are each
+  // encoded by 1 length byte and 1 ascii byte.
+  final List<String> tooManyProtocols = new Iterable.generate(
+      (1 << 12), (i) => '0').toList();
 
-  // Protocols are in order of decreasing priority. First matching protocol
-  // will be taken.
-
-  // Test successfull negotiation, including priority.
-  testSuccessfulAlpnNegogiationConnection(['a'],
+  // Protocols are in order of decreasing priority. The server will select
+  // the first protocol from its list that has a match in the client list.
+  // Test successful negotiation, including priority.
+  testSuccessfulAlpnNegotiationConnection(['a'],
                                           ['a'],
                                           'a');
 
-  testSuccessfulAlpnNegogiationConnection([longname255],
+  testSuccessfulAlpnNegotiationConnection([longname255],
                                           [longname255],
                                           longname255);
 
-  testSuccessfulAlpnNegogiationConnection([strangelongname255],
+  testSuccessfulAlpnNegotiationConnection([strangelongname255],
                                           [strangelongname255],
                                           strangelongname255);
-
-  testSuccessfulAlpnNegogiationConnection(allProtocols,
-                                          allProtocols,
+  testSuccessfulAlpnNegotiationConnection(manyProtocols,
+                                          manyProtocols,
                                           '0');
-
-  testSuccessfulAlpnNegogiationConnection(['a', 'b', 'c'],
+  testSuccessfulAlpnNegotiationConnection(['a', 'b', 'c'],
                                           ['a', 'b', 'c'],
                                           'a');
 
-  testSuccessfulAlpnNegogiationConnection(['a', 'b', 'c'],
+  testSuccessfulAlpnNegotiationConnection(['a', 'b', 'c'],
                                           ['c'],
                                           'c');
 
   // Server precedence.
-  testSuccessfulAlpnNegogiationConnection(['a', 'b', 'c'],
+  testSuccessfulAlpnNegotiationConnection(['a', 'b', 'c'],
                                           ['c', 'b', 'a'],
-                                          'a');
+                                          'c');
 
-  testSuccessfulAlpnNegogiationConnection(['c'],
+  testSuccessfulAlpnNegotiationConnection(['c'],
                                           ['a', 'b', 'c'],
                                           'c');
 
-  testSuccessfulAlpnNegogiationConnection(['s1', 'b', 'e1'],
+  testSuccessfulAlpnNegotiationConnection(['s1', 'b', 'e1'],
                                           ['s2', 'b', 'e2'],
                                           'b');
-
   // Test no protocol negotiation support
-  testSuccessfulAlpnNegogiationConnection(null,
+  testSuccessfulAlpnNegotiationConnection(null,
                                           null,
                                           null);
 
-  testSuccessfulAlpnNegogiationConnection(['a', 'b', 'c'],
+  testSuccessfulAlpnNegotiationConnection(['a', 'b', 'c'],
                                           null,
                                           null);
 
-  testSuccessfulAlpnNegogiationConnection(null,
+  testSuccessfulAlpnNegotiationConnection(null,
                                           ['a', 'b', 'c'],
                                           null);
 
-  testSuccessfulAlpnNegogiationConnection([],
+  testSuccessfulAlpnNegotiationConnection([],
                                           [],
                                           null);
 
-  testSuccessfulAlpnNegogiationConnection(['a', 'b', 'c'],
+  testSuccessfulAlpnNegotiationConnection(['a', 'b', 'c'],
                                           [],
                                           null);
 
-  testSuccessfulAlpnNegogiationConnection([],
+  testSuccessfulAlpnNegotiationConnection([],
                                           ['a', 'b', 'c'],
                                           null);
 
-  // Test non-overlapping protocols.
-  testFailedAlpnNegogiationConnection(['a'], ['b']);
-
+  // Test non-overlapping protocols.  The ALPN RFC says the connection
+  // should be terminated, but OpenSSL continues as if no ALPN is present.
+  // Issue  https://github.com/dart-lang/sdk/issues/23580
+  // Chromium issue https://code.google.com/p/chromium/issues/detail?id=497770
+  testSuccessfulAlpnNegotiationConnection(['a'], ['b'], null);
 
   // Test too short / too long protocol names.
-  testInvalidArgumentsLongName([longname256], true, false);
-  testInvalidArgumentsLongName([strangelongname256], true, false);
-  testInvalidArgumentsLongName([''], true, false);
-  testInvalidArgumentsLongName(allProtocolsPlusOne, false, true);
-  testInvalidArgumentsLongName(allProtocolsPlusOne, false, true);
+  testInvalidArgument([longname256], NAME_LENGTH_ERROR);
+  testInvalidArgument([strangelongname256], NAME_LENGTH_ERROR);
+  testInvalidArgument([''], NAME_LENGTH_ERROR);
+  testInvalidArgument(tooManyProtocols, MESSAGE_LENGTH_ERROR);
 }
diff --git a/tests/standalone/io/secure_socket_argument_test.dart b/tests/standalone/io/secure_socket_argument_test.dart
index 6caf84e..1fb3456 100644
--- a/tests/standalone/io/secure_socket_argument_test.dart
+++ b/tests/standalone/io/secure_socket_argument_test.dart
@@ -5,23 +5,15 @@
 import "package:expect/expect.dart";
 import "dart:io";
 
-void testInitialzeArguments() {
-  Expect.throws(() => SecureSocket.initialize(database: "foo.txt"));
-  Expect.throws(() => SecureSocket.initialize(password: false));
-  Expect.throws(() => SecureSocket.initialize(useBuiltinRoots: 7));
-}
-
 void testServerSocketArguments() {
   Expect.throws(() =>
-      SecureServerSocket.bind(SERVER_ADDRESS, 65536, 5, CERTIFICATE));
+      SecureServerSocket.bind(SERVER_ADDRESS, 65536, null));
   Expect.throws(() =>
-      SecureServerSocket.bind(SERVER_ADDRESS, -1, CERTIFICATE));
+      SecureServerSocket.bind(SERVER_ADDRESS, -1, null));
   Expect.throws(() =>
-      SecureServerSocket.bind(SERVER_ADDRESS, 0, -1, CERTIFICATE));
+      SecureServerSocket.bind(SERVER_ADDRESS, 0, "not a context"));
 }
 
 void main() {
-  testInitialzeArguments();
-  SecureSocket.initialize();
   testServerSocketArguments();
 }
diff --git a/tests/standalone/io/secure_socket_bad_data_test.dart b/tests/standalone/io/secure_socket_bad_data_test.dart
index f0c3fa5..2826107 100644
--- a/tests/standalone/io/secure_socket_bad_data_test.dart
+++ b/tests/standalone/io/secure_socket_bad_data_test.dart
@@ -158,10 +158,6 @@
 
 
 main() {
-  String certificateDatabase = Platform.script.resolve('pkcert').toFilePath();
-  SecureSocket.initialize(database: certificateDatabase,
-                          password: 'dartdart',
-                          useBuiltinRoots: false);
   asyncStart();
   InternetAddress.lookup("localhost").then((hosts) {
     HOST = hosts.first;
diff --git a/tests/standalone/io/secure_socket_renegotiate_client.dart b/tests/standalone/io/secure_socket_renegotiate_client.dart
index cc3905a..d277012 100644
--- a/tests/standalone/io/secure_socket_renegotiate_client.dart
+++ b/tests/standalone/io/secure_socket_renegotiate_client.dart
@@ -12,8 +12,10 @@
 import "dart:io";
 
 const HOST_NAME = "localhost";
-const CERTIFICATE = "localhost_cert";
+String localFile(path) => Platform.script.resolve(path).toFilePath();
 
+SecurityContext clientContext = new SecurityContext()
+  ..setTrustedCertificates(file: localFile('certificates/trusted_certs.pem'));
 
 class ExpectException implements Exception {
   ExpectException(this.message);
@@ -37,7 +39,9 @@
 
 
 void runClient(int port) {
-  SecureSocket.connect(HOST_NAME, port, sendClientCertificate: true)
+  SecureSocket.connect(HOST_NAME,
+                       port,
+                       context: clientContext)
     .then((SecureSocket socket) {
       X509Certificate certificate = socket.peerCertificate;
       expect(certificate != null);
@@ -74,6 +78,5 @@
 
 
 void main(List<String> args) {
-  SecureSocket.initialize(database: args[1], password: 'dartdart');
   runClient(int.parse(args[0]));
 }
diff --git a/tests/standalone/io/secure_socket_renegotiate_test.dart b/tests/standalone/io/secure_socket_renegotiate_test.dart
index 595dd0d..457cee6 100644
--- a/tests/standalone/io/secure_socket_renegotiate_test.dart
+++ b/tests/standalone/io/secure_socket_renegotiate_test.dart
@@ -14,17 +14,15 @@
 import "package:path/path.dart";
 
 const HOST_NAME = "localhost";
-const CERTIFICATE = "localhost_cert";
+String localFile(path) => Platform.script.resolve(path).toFilePath();
 
-
-String certificateDatabase() => Platform.script.resolve('pkcert').toFilePath();
-
+SecurityContext serverContext = new SecurityContext()
+  ..useCertificateChain(localFile('certificates/server_chain.pem'))
+  ..usePrivateKey(localFile('certificates/server_key.pem'),
+                  password: 'dartdart');
 
 Future<SecureServerSocket> runServer() {
-  SecureSocket.initialize(database: certificateDatabase(),
-                          password: 'dartdart');
-
-  return SecureServerSocket.bind(HOST_NAME, 0, CERTIFICATE)
+  return SecureServerSocket.bind(HOST_NAME, 0, serverContext)
     .then((SecureServerSocket server) {
       server.listen((SecureSocket socket) {
         Expect.isNull(socket.peerCertificate);
@@ -71,8 +69,7 @@
       Expect.isTrue(clientScript.endsWith("_client.dart"));
       Process.run(Platform.executable,
                   [clientScript,
-                   server.port.toString(),
-                   certificateDatabase()])
+                   server.port.toString()])
         .then((ProcessResult result) {
           if (result.exitCode != 0) {
             print("Client failed, stdout:");
diff --git a/tests/standalone/io/secure_socket_test.dart b/tests/standalone/io/secure_socket_test.dart
index 143b73d..897bd84 100644
--- a/tests/standalone/io/secure_socket_test.dart
+++ b/tests/standalone/io/secure_socket_test.dart
@@ -12,12 +12,22 @@
 import "dart:async";
 import "dart:io";
 
+String localFile(path) => Platform.script.resolve(path).toFilePath();
+
+SecurityContext serverContext = new SecurityContext()
+  ..useCertificateChain(localFile('certificates/server_chain.pem'))
+  ..usePrivateKey(localFile('certificates/server_key.pem'),
+                  password: 'dartdart');
+
+SecurityContext clientContext = new SecurityContext()
+  ..setTrustedCertificates(file: localFile('certificates/trusted_certs.pem'));
+
 Future<HttpServer> startServer() {
   return HttpServer.bindSecure(
       "localhost",
       0,
-      backlog: 5,
-      certificateName: 'localhost_cert').then((server) {
+      serverContext,
+      backlog: 5).then((server) {
     server.listen((HttpRequest request) {
       request.listen(
         (_) { },
@@ -33,17 +43,11 @@
   });
 }
 
-void InitializeSSL() {
-  var testPkcertDatabase = Platform.script.resolve('pkcert').toFilePath();
-  SecureSocket.initialize(database: testPkcertDatabase,
-                          password: 'dartdart');
-}
-
 void main() {
-  InitializeSSL();
   List<int> body = <int>[];
   startServer().then((server) {
-    SecureSocket.connect("localhost", server.port).then((socket) {
+    SecureSocket.connect("localhost", server.port, context: clientContext)
+    .then((socket) {
       socket.write("GET / HTTP/1.0\r\nHost: localhost\r\n\r\n");
       socket.close();
       socket.listen(
diff --git a/tests/standalone/io/secure_unauthorized_client.dart b/tests/standalone/io/secure_unauthorized_client.dart
index 043577f..8677bec 100644
--- a/tests/standalone/io/secure_unauthorized_client.dart
+++ b/tests/standalone/io/secure_unauthorized_client.dart
@@ -8,6 +8,11 @@
 import "dart:async";
 import "dart:io";
 
+String localFile(path) => Platform.script.resolve(path).toFilePath();
+
+SecurityContext clientContext = new SecurityContext()
+  ..setTrustedCertificates(file: localFile('certificates/trusted_certs.pem'));
+
 class ExpectException implements Exception {
   ExpectException(this.message);
   String toString() => "ExpectException: $message";
@@ -26,7 +31,7 @@
   var testFutures = [];
   for (int i = 0; i < 20; ++i) {
     testFutures.add(
-        SecureSocket.connect(HOST_NAME, port)
+        SecureSocket.connect(HOST_NAME, port, context: clientContext)
           .then((SecureSocket socket) {
             expect(false);
           }, onError: (e) {
@@ -38,7 +43,6 @@
 
 
 void main(List<String> args) {
-  SecureSocket.initialize();
   runClients(int.parse(args[0]))
     .then((_) => print('SUCCESS'));
 }
diff --git a/tests/standalone/io/secure_unauthorized_test.dart b/tests/standalone/io/secure_unauthorized_test.dart
index 453b8b1..a600d74 100644
--- a/tests/standalone/io/secure_unauthorized_test.dart
+++ b/tests/standalone/io/secure_unauthorized_test.dart
@@ -11,14 +11,15 @@
 import "dart:io";
 
 const HOST_NAME = "localhost";
-const CERTIFICATE = "localhost_cert";
+String localFile(path) => Platform.script.resolve(path).toFilePath();
+
+SecurityContext serverContext = new SecurityContext()
+  ..useCertificateChain(localFile('certificates/untrusted_server_chain.pem'))
+  ..usePrivateKey(localFile('certificates/untrusted_server_key.pem'),
+                  password: 'dartdart');
 
 Future<SecureServerSocket> runServer() {
-  SecureSocket.initialize(
-      database: Platform.script.resolve('pkcert').toFilePath(),
-      password: 'dartdart');
-
-  return SecureServerSocket.bind(HOST_NAME, 0, CERTIFICATE)
+  return SecureServerSocket.bind(HOST_NAME, 0, serverContext)
       .then((SecureServerSocket server) {
     server.listen((SecureSocket socket) {
       socket.listen((_) { },
diff --git a/tests/standalone/io/security_context_argument_test.dart b/tests/standalone/io/security_context_argument_test.dart
new file mode 100644
index 0000000..5e263f6
--- /dev/null
+++ b/tests/standalone/io/security_context_argument_test.dart
@@ -0,0 +1,41 @@
+// 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 "package:expect/expect.dart";
+import "dart:io";
+
+String localFile(path) => Platform.script.resolve(path).toFilePath();
+
+bool printException(e) { print(e); return true; }
+bool argumentError(e) => e is ArgumentError;
+bool argumentOrTypeError(e) => e is ArgumentError || e is TypeError;
+bool tlsException(e) => e is TlsException;
+
+void testUsePrivateKeyArguments() {
+    var c = new SecurityContext();
+    c.useCertificateChain(localFile('certificates/server_chain.pem'));
+    Expect.throws(() => c.usePrivateKey(
+          localFile('certificates/server_key.pem'), password: "dart" * 1000),
+        argumentError);
+    Expect.throws(() => c.usePrivateKey(
+          localFile('certificates/server_key.pem')),
+        tlsException);
+    Expect.throws(() => c.usePrivateKey(
+          localFile('certificates/server_key.pem'), password: "iHackSites"),
+        tlsException);
+    Expect.throws(() => c.usePrivateKey(
+          localFile('certificates/server_key_oops.pem'), password: "dartdart"),
+        tlsException);
+    Expect.throws(() => c.usePrivateKey(1), argumentOrTypeError);
+    Expect.throws(() => c.usePrivateKey(null), argumentError);
+    Expect.throws(() => c.usePrivateKey(
+          localFile('certificates/server_key_oops.pem'), password: 3),
+        argumentOrTypeError);
+    c.usePrivateKey(
+        localFile('certificates/server_key.pem'), password: "dartdart");
+}    
+
+void main() {
+  testUsePrivateKeyArguments();
+}
diff --git a/tests/standalone/io/server_socket_reference_issue21383_and_issue21384_test.dart b/tests/standalone/io/server_socket_reference_issue21383_and_issue21384_test.dart
deleted file mode 100644
index 95e0363..0000000
--- a/tests/standalone/io/server_socket_reference_issue21383_and_issue21384_test.dart
+++ /dev/null
@@ -1,73 +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 'dart:async';
-import 'dart:io';
-
-import 'package:async_helper/async_helper.dart';
-
-
-testBothListen() {
-  asyncStart();
-  ServerSocket.bind('127.0.0.1', 0).then((mainServer) {
-    mainServer.reference.create().then((refServer) {
-      refServer.listen((_) {});
-      mainServer.listen((_) {});
-      Timer.run(() {
-        mainServer.close();
-        refServer.close();
-        asyncEnd();
-      });
-    });
-  });
-}
-
-testRefServerListen() {
-  asyncStart();
-  ServerSocket.bind('127.0.0.1', 0).then((mainServer) {
-    mainServer.reference.create().then((refServer) {
-      refServer.listen((_) {});
-      Timer.run(() {
-        mainServer.close();
-        refServer.close();
-        asyncEnd();
-      });
-    });
-  });
-}
-
-testMainServerListen() {
-  asyncStart();
-  ServerSocket.bind('127.0.0.1', 0).then((mainServer) {
-    mainServer.reference.create().then((refServer) {
-      mainServer.listen((_) {});
-      Timer.run(() {
-        mainServer.close();
-        refServer.close();
-        asyncEnd();
-      });
-    });
-  });
-}
-
-testNoneListen() {
-  asyncStart();
-  ServerSocket.bind('127.0.0.1', 0).then((mainServer) {
-    mainServer.reference.create().then((refServer) {
-      Timer.run(() {
-        mainServer.close();
-        refServer.close();
-        asyncEnd();
-      });
-    });
-  });
-}
-
-main() {
-  testNoneListen();
-  testMainServerListen();
-  testRefServerListen();
-  testBothListen();
-}
-
diff --git a/tests/standalone/io/socket_bind_test.dart b/tests/standalone/io/socket_bind_test.dart
index 9d36c22..9c4e1ed 100644
--- a/tests/standalone/io/socket_bind_test.dart
+++ b/tests/standalone/io/socket_bind_test.dart
@@ -82,69 +82,6 @@
   });
 }
 
-testSocketReferenceInteroperability(String host) {
-  asyncStart();
-    ServerSocket.bind(host, 0).then((ServerSocket socket) {
-      Expect.isTrue(socket.port > 0);
-
-      asyncStart();
-      socket.reference.create().then((socket2) {
-        bool gotResponseFrom1;
-        bool gotResponseFrom2;
-
-        Expect.isTrue(socket.port > 0);
-        Expect.equals(socket.port, socket2.port);
-
-        asyncStart();
-        asyncStart();
-        asyncStart();
-        socket.listen((client) {
-          client.drain().whenComplete(asyncEnd);
-          client.write('1: hello world');
-          client.close().whenComplete(asyncEnd);
-          // NOTE: Closing the socket un-subscribes as well, which means the
-          // other client connection must go to the other socket.
-          socket.close().whenComplete(asyncEnd);
-        }, onDone: asyncEnd);
-
-        asyncStart();
-        asyncStart();
-        asyncStart();
-        socket2.listen((client) {
-          client.drain().whenComplete(asyncEnd);
-          client.write('2: hello world');
-          client.close().whenComplete(asyncEnd);
-          // NOTE: Closing the socket un-subscribes as well, which means the
-          // other client connection must go to the other socket.
-          socket2.close().whenComplete(asyncEnd);
-        }, onDone: asyncEnd);
-
-        var futures = [];
-        for (int i = 0; i < 2; i++) {
-          asyncStart();
-          futures.add(
-              Socket.connect(socket.address, socket.port).then((Socket socket) {
-            socket.close().whenComplete(asyncEnd);
-            asyncStart();
-            return socket
-                .transform(ASCII.decoder).join('').then((String result) {
-                if (result == '1: hello world') gotResponseFrom1 = true;
-                else if (result == '2: hello world') gotResponseFrom2 = true;
-                else throw 'Unexpected result from server: $result';
-                asyncEnd();
-             });
-          }));
-        }
-        asyncStart();
-        Future.wait(futures).then((_) {
-          Expect.isTrue(gotResponseFrom1);
-          Expect.isTrue(gotResponseFrom2);
-          asyncEnd();
-        });
-      });
-   });
-}
-
 testListenCloseListenClose(String host) async {
   asyncStart();
 
@@ -184,8 +121,6 @@
     negTestBindV6OnlyMismatch(host, true);
     negTestBindV6OnlyMismatch(host, false);
 
-    testSocketReferenceInteroperability(host);
-
     testListenCloseListenClose(host);
   }
 
diff --git a/tests/standalone/io/socket_upgrade_to_secure_test.dart b/tests/standalone/io/socket_upgrade_to_secure_test.dart
index d973a78..5873d00 100644
--- a/tests/standalone/io/socket_upgrade_to_secure_test.dart
+++ b/tests/standalone/io/socket_upgrade_to_secure_test.dart
@@ -14,7 +14,15 @@
 import "package:expect/expect.dart";
 
 InternetAddress HOST;
-const CERTIFICATE = "localhost_cert";
+String localFile(path) => Platform.script.resolve(path).toFilePath();
+
+SecurityContext serverContext = new SecurityContext()
+  ..useCertificateChain(localFile('certificates/server_chain.pem'))
+  ..usePrivateKey(localFile('certificates/server_key.pem'),
+                  password: 'dartdart');
+
+SecurityContext clientContext = new SecurityContext()
+  ..setTrustedCertificates(file: localFile('certificates/trusted_certs.pem'));
 
 // This test creates a server and a client connects. After connecting
 // and an optional initial handshake the connection is secured by
@@ -156,9 +164,11 @@
       return Socket.connect(HOST, port).then((socket) {
         var future;
         if (hostnameInConnect) {
-          future = SecureSocket.secure(socket);
+          future = SecureSocket.secure(socket, context: clientContext);
         } else {
-          future = SecureSocket.secure(socket, host: HOST);
+          future = SecureSocket.secure(socket,
+                                       host: HOST,
+                                       context: clientContext);
         }
         return future.then((secureSocket) {
           socket.add([0]);
@@ -170,9 +180,11 @@
         return runClientHandshake(socket).then((_) {
             var future;
             if (hostnameInConnect) {
-              future = SecureSocket.secure(socket);
+              future = SecureSocket.secure(socket, context: clientContext);
             } else {
-              future = SecureSocket.secure(socket, host: HOST.host);
+              future = SecureSocket.secure(socket,
+                                           host: HOST,
+                                           context: clientContext);
             }
             return future.then((secureSocket) {
               socket.add([0]);
@@ -186,7 +198,7 @@
   serverReady(server) {
     server.listen((client) {
       if (!handshakeBeforeSecure) {
-        SecureSocket.secureServer(client, CERTIFICATE).then((secureClient) {
+        SecureSocket.secureServer(client, serverContext).then((secureClient) {
           client.add([0]);
           runServer(secureClient).then((_) => server.close());
         });
@@ -194,7 +206,7 @@
         runServerHandshake(client).then((carryOverData) {
           SecureSocket.secureServer(
               client,
-              CERTIFICATE,
+              serverContext,
               bufferedData: carryOverData).then((secureClient) {
             client.add([0]);
             runServer(secureClient).then((_) => server.close());
@@ -213,18 +225,15 @@
 
 main() {
   asyncStart();
-  var certificateDatabase = Platform.script.resolve('pkcert').toFilePath();
-  SecureSocket.initialize(database: certificateDatabase,
-                          password: 'dartdart',
-                          useBuiltinRoots: false);
   InternetAddress.lookup("localhost").then((hosts) {
     HOST = hosts.first;
     test(false, false);
-    test(true, false);
-    test(false, true);
-    test(true, true);
-    test(false, true, true);
-    test(true, true, true);
+    // TODO(whesse): Enable the test with all argument combinations:
+    //  test(true, false);
+    //  test(false, true);
+    //  test(true, true);
+    //  test(false, true, true);
+    //  test(true, true, true);
     asyncEnd();
   });
 }
diff --git a/tests/standalone/io/web_socket_error_test.dart b/tests/standalone/io/web_socket_error_test.dart
index 7081dca7..cc16bde 100644
--- a/tests/standalone/io/web_socket_error_test.dart
+++ b/tests/standalone/io/web_socket_error_test.dart
@@ -25,6 +25,16 @@
 const String CERT_NAME = 'localhost_cert';
 const String HOST_NAME = 'localhost';
 
+String localFile(path) => Platform.script.resolve(path).toFilePath();
+
+SecurityContext serverContext = new SecurityContext()
+  ..useCertificateChain(localFile('certificates/server_chain.pem'))
+  ..usePrivateKey(localFile('certificates/server_key.pem'),
+                  password: 'dartdart');
+
+SecurityContext clientContext = new SecurityContext()
+  ..setTrustedCertificates(file: localFile('certificates/trusted_certs.pem'));
+
 /**
  * A SecurityConfiguration lets us run the tests over HTTP or HTTPS.
  */
@@ -36,13 +46,14 @@
   Future<HttpServer> createServer({int backlog: 0}) =>
       secure ? HttpServer.bindSecure(HOST_NAME,
                                      0,
-                                     backlog: backlog,
-                                     certificateName: CERT_NAME)
+                                     serverContext,
+                                     backlog: backlog)
              : HttpServer.bind(HOST_NAME,
                                0,
                                backlog: backlog);
 
   Future<WebSocket> createClient(int port) =>
+    // TODO(whesse): Add a client context argument to WebSocket.connect.
     WebSocket.connect('${secure ? "wss" : "ws"}://$HOST_NAME:$port/');
 
 
@@ -89,18 +100,11 @@
 }
 
 
-void initializeSSL() {
-  var testPkcertDatabase = Platform.script.resolve('pkcert').toFilePath();
-  SecureSocket.initialize(database: testPkcertDatabase,
-                          password: "dartdart");
-}
-
-
 main() {
   asyncStart();
   new SecurityConfiguration(secure: false).runTests();
-  initializeSSL();
-  new SecurityConfiguration(secure: true).runTests();
+  // TODO(whesse): WebSocket.connect needs an optional context: parameter
+  // new SecurityConfiguration(secure: true).runTests();
   asyncEnd();
 }
 
diff --git a/tests/standalone/io/web_socket_protocol_processor_test.dart b/tests/standalone/io/web_socket_protocol_processor_test.dart
index 179fe0b..0f7c1fa 100644
--- a/tests/standalone/io/web_socket_protocol_processor_test.dart
+++ b/tests/standalone/io/web_socket_protocol_processor_test.dart
@@ -9,6 +9,7 @@
 import "dart:async";
 import "dart:collection";
 import "dart:convert";
+import "dart:developer";
 import "dart:math";
 import "dart:typed_data";
 import "dart:isolate";
@@ -29,6 +30,7 @@
 part "../../../sdk/lib/io/http_parser.dart";
 part "../../../sdk/lib/io/http_headers.dart";
 part "../../../sdk/lib/io/http_session.dart";
+part "../../../sdk/lib/io/io_resource_info.dart";
 part "../../../sdk/lib/io/io_service.dart";
 part "../../../sdk/lib/io/io_sink.dart";
 part "../../../sdk/lib/io/platform.dart";
@@ -36,6 +38,7 @@
 part "../../../sdk/lib/io/service_object.dart";
 part "../../../sdk/lib/io/secure_socket.dart";
 part "../../../sdk/lib/io/secure_server_socket.dart";
+part "../../../sdk/lib/io/security_context.dart";
 part "../../../sdk/lib/io/socket.dart";
 part "../../../sdk/lib/io/websocket.dart";
 part "../../../sdk/lib/io/websocket_impl.dart";
diff --git a/tests/standalone/io/web_socket_test.dart b/tests/standalone/io/web_socket_test.dart
index ae38307..695b2cd 100644
--- a/tests/standalone/io/web_socket_test.dart
+++ b/tests/standalone/io/web_socket_test.dart
@@ -19,9 +19,18 @@
 
 const WEB_SOCKET_GUID = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11";
 
-const String CERT_NAME = 'localhost_cert';
 const String HOST_NAME = 'localhost';
 
+String localFile(path) => Platform.script.resolve(path).toFilePath();
+
+SecurityContext serverContext = new SecurityContext()
+  ..useCertificateChain(localFile('certificates/server_chain.pem'))
+  ..usePrivateKey(localFile('certificates/server_key.pem'),
+                  password: 'dartdart');
+
+SecurityContext clientContext = new SecurityContext()
+  ..setTrustedCertificates(file: localFile('certificates/trusted_certs.pem'));
+
 /**
  * A SecurityConfiguration lets us run the tests over HTTP or HTTPS.
  */
@@ -33,13 +42,14 @@
   Future<HttpServer> createServer({int backlog: 0}) =>
       secure ? HttpServer.bindSecure(HOST_NAME,
                                      0,
-                                     backlog: backlog,
-                                     certificateName: CERT_NAME)
+                                     serverContext,
+                                     backlog: backlog)
              : HttpServer.bind(HOST_NAME,
                                0,
                                backlog: backlog);
 
   Future<WebSocket> createClient(int port) =>
+    // TODO(whesse): Add client context argument to WebSocket.connect
     WebSocket.connect('${secure ? "wss" : "ws"}://$HOST_NAME:$port/');
 
   checkCloseStatus(webSocket, closeStatus, closeReason) {
@@ -581,15 +591,8 @@
 }
 
 
-void initializeSSL() {
-  var testPkcertDatabase = Platform.script.resolve('pkcert').toFilePath();
-  SecureSocket.initialize(database: testPkcertDatabase,
-                          password: "dartdart");
-}
-
-
 main() {
   new SecurityConfiguration(secure: false).runTests();
-  initializeSSL();
-  new SecurityConfiguration(secure: true).runTests();
+  // TODO(whesse): Make WebSocket.connect() take an optional context: parameter.
+  // new SecurityConfiguration(secure: true).runTests();
 }
diff --git a/tests/standalone/io/zlib_test.dart b/tests/standalone/io/zlib_test.dart
index 3392ffd..acb6e86 100644
--- a/tests/standalone/io/zlib_test.dart
+++ b/tests/standalone/io/zlib_test.dart
@@ -4,6 +4,7 @@
 
 import 'dart:async';
 import 'dart:io';
+import 'dart:typed_data';
 
 import "package:async_helper/async_helper.dart";
 import "package:expect/expect.dart";
@@ -39,9 +40,8 @@
   controller.close();
 }
 
-void testZLibDeflate() {
+void testZLibDeflate(List<int> data) {
   asyncStart();
-  var data = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
   var controller = new StreamController(sync: true);
   controller.stream.transform(new ZLibEncoder(gzip: false, level: 6))
       .fold([], (buffer, data) {
@@ -59,9 +59,8 @@
   controller.close();
 }
 
-void testZLibDeflateGZip() {
+void testZLibDeflateGZip(List<int> data) {
   asyncStart();
-  var data = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
   var controller = new StreamController(sync: true);
   controller.stream.transform(new ZLibEncoder(gzip: true))
       .fold([], (buffer, data) {
@@ -80,9 +79,8 @@
   controller.close();
 }
 
-void testZLibDeflateRaw() {
+void testZLibDeflateRaw(List<int> data) {
   asyncStart();
-  var data = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
   var controller = new StreamController(sync: true);
   controller.stream.transform(new ZLibEncoder(raw: true, level: 6))
       .fold([], (buffer, data) {
@@ -112,9 +110,7 @@
   };
 }
 
-void testZLibInflate() {
-  var data = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
-
+void testZLibInflate(List<int> data) {
   [true, false].forEach((gzip) {
     [ZLibOption.STRATEGY_FILTERED, ZLibOption.STRATEGY_HUFFMAN_ONLY,
         ZLibOption.STRATEGY_RLE, ZLibOption.STRATEGY_FIXED,
@@ -141,9 +137,7 @@
   });
 }
 
-void testZLibInflateRaw() {
-  var data = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
-
+void testZLibInflateRaw(List<int> data) {
   [3, 6, 9].forEach((level) {
     asyncStart();
     var controller = new StreamController(sync: true);
@@ -163,9 +157,7 @@
   });
 }
 
-void testZLibInflateSync() {
-  var data = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
-
+void testZLibInflateSync(List<int> data) {
   [true, false].forEach((gzip) {
     [3, 6, 9].forEach((level) {
       var encoded = new ZLibEncoder(gzip: gzip, level: level).convert(data);
@@ -219,19 +211,48 @@
   });
 }
 
+var generateListTypes = [
+  (list) => list,
+  (list) => new Uint8List.fromList(list),
+  (list) => new Int8List.fromList(list),
+  (list) => new Uint16List.fromList(list),
+  (list) => new Int16List.fromList(list),
+  (list) => new Uint32List.fromList(list),
+  (list) => new Int32List.fromList(list),
+];
+
+var generateViewTypes = [
+  (list) => new Uint8List.view((new Uint8List.fromList(list)).buffer, 1, 8),
+  (list) => new Int8List.view((new Int8List.fromList(list)).buffer, 1, 8),
+  (list) => new Uint16List.view((new Uint16List.fromList(list)).buffer, 2, 6),
+  (list) => new Int16List.view((new Int16List.fromList(list)).buffer, 2, 6),
+  (list) => new Uint32List.view((new Uint32List.fromList(list)).buffer, 4, 4),
+  (list) => new Int32List.view((new Int32List.fromList(list)).buffer, 4, 4),
+];
+
+
 void main() {
   asyncStart();
-  testZLibDeflate();
   testZLibDeflateEmpty();
   testZLibDeflateEmptyGzip();
-  testZLibDeflateGZip();
   testZLibDeflateInvalidLevel();
-  testZLibInflate();
-  testZLibInflateSync();
+  generateListTypes.forEach((f) {
+    var data = f([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]);
+    testZLibDeflate(data);
+    testZLibDeflateGZip(data);
+    testZLibDeflateRaw(data);
+    testZLibInflate(data);
+    testZLibInflateSync(data);
+    testZLibInflateRaw(data);
+  });
+  generateViewTypes.forEach((f) {
+    var data = f([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]);
+    testZLibInflate(data);
+    testZLibInflateSync(data);
+    testZLibInflateRaw(data);
+  });
   testZlibInflateThrowsWithSmallerWindow();
   testZlibInflateWithLargerWindow();
-  testZLibDeflateRaw();
-  testZLibInflateRaw();
   testZlibWithDictionary();
   asyncEnd();
 }
diff --git a/tests/standalone/no_assert_test.dart b/tests/standalone/no_assert_test.dart
new file mode 100644
index 0000000..825578b
--- /dev/null
+++ b/tests/standalone/no_assert_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.
+// VMOptions=--no-enable_asserts --enable_type_checks
+
+// Ensure that enabling of type checks does not automatically enable asserts.
+
+main() {
+  assert(false);
+  try {
+    int i = "String";
+    throw "FAIL";
+  } on TypeError catch (e) {
+    print("PASS");
+  }
+}
diff --git a/tests/standalone/noopt_test.dart b/tests/standalone/noopt_test.dart
new file mode 100644
index 0000000..171f3a5
--- /dev/null
+++ b/tests/standalone/noopt_test.dart
@@ -0,0 +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.
+
+/// VMOptions=--noopt
+
+main() {
+  print("Hello, --noopt World!");
+}
diff --git a/tests/standalone/package/scenarios/both_dir_and_file/.packages b/tests/standalone/package/scenarios/both_dir_and_file/.packages
new file mode 100644
index 0000000..17ae735
--- /dev/null
+++ b/tests/standalone/package/scenarios/both_dir_and_file/.packages
@@ -0,0 +1 @@
+foo:foo/
\ No newline at end of file
diff --git a/tests/standalone/package/scenarios/both_dir_and_file/both_dir_and_file_noimports_test.dart b/tests/standalone/package/scenarios/both_dir_and_file/both_dir_and_file_noimports_test.dart
new file mode 100644
index 0000000..962f916
--- /dev/null
+++ b/tests/standalone/package/scenarios/both_dir_and_file/both_dir_and_file_noimports_test.dart
@@ -0,0 +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.
+
+// PackageRoot=none
+
+library both_dir_and_file_noimports_test;
+
+main() {
+}
\ No newline at end of file
diff --git a/tests/standalone/package/scenarios/both_dir_and_file/foo/foo.dart b/tests/standalone/package/scenarios/both_dir_and_file/foo/foo.dart
new file mode 100644
index 0000000..d9d42ab
--- /dev/null
+++ b/tests/standalone/package/scenarios/both_dir_and_file/foo/foo.dart
@@ -0,0 +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.
+
+library foo;
+
+String bar = 'good';
\ No newline at end of file
diff --git a/tests/standalone/package/scenarios/both_dir_and_file/packages/foo/foo.dart b/tests/standalone/package/scenarios/both_dir_and_file/packages/foo/foo.dart
new file mode 100644
index 0000000..f438ca7
--- /dev/null
+++ b/tests/standalone/package/scenarios/both_dir_and_file/packages/foo/foo.dart
@@ -0,0 +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.
+
+library foo;
+
+String bar = 'bad';
\ No newline at end of file
diff --git a/tests/standalone/package/scenarios/both_dir_and_file/prefers_packages_file_test.dart b/tests/standalone/package/scenarios/both_dir_and_file/prefers_packages_file_test.dart
new file mode 100644
index 0000000..32251bc
--- /dev/null
+++ b/tests/standalone/package/scenarios/both_dir_and_file/prefers_packages_file_test.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.
+
+// PackageRoot=none
+
+library prefers_packages_file_test;
+
+import 'package:foo/foo.dart' as foo;
+
+main() {
+  if (foo.bar != 'good') {
+    throw new Exception('package "foo" was not resolved correctly');
+  }
+}
\ No newline at end of file
diff --git a/tests/standalone/package/scenarios/empty_packages_file/.packages b/tests/standalone/package/scenarios/empty_packages_file/.packages
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/standalone/package/scenarios/empty_packages_file/.packages
diff --git a/tests/standalone/package/scenarios/empty_packages_file/empty_packages_file_discovery_test.dart b/tests/standalone/package/scenarios/empty_packages_file/empty_packages_file_discovery_test.dart
new file mode 100644
index 0000000..929bd55
--- /dev/null
+++ b/tests/standalone/package/scenarios/empty_packages_file/empty_packages_file_discovery_test.dart
@@ -0,0 +1,12 @@
+// 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.
+
+// PackageRoot=none
+
+library empty_packages_file_discovery_test;
+
+import 'package:foo/foo.dart';
+
+main() {
+}
diff --git a/tests/standalone/package/scenarios/empty_packages_file/empty_packages_file_noimports_test.dart b/tests/standalone/package/scenarios/empty_packages_file/empty_packages_file_noimports_test.dart
new file mode 100644
index 0000000..580bb01
--- /dev/null
+++ b/tests/standalone/package/scenarios/empty_packages_file/empty_packages_file_noimports_test.dart
@@ -0,0 +1,13 @@
+// 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.
+
+// PackageRoot=none
+// Packages=.packages
+
+// We expect this to not cause any errors. An empty packages file is valid,
+// you should only run into problems if you try to resolve a package import.
+library empty_packages_file_noimports_test;
+
+main() {
+}
diff --git a/tests/standalone/package/scenarios/empty_packages_file/empty_packages_file_option_test.dart b/tests/standalone/package/scenarios/empty_packages_file/empty_packages_file_option_test.dart
new file mode 100644
index 0000000..38fff19
--- /dev/null
+++ b/tests/standalone/package/scenarios/empty_packages_file/empty_packages_file_option_test.dart
@@ -0,0 +1,13 @@
+// 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.
+
+// PackageRoot=none
+// Packages=.packages
+
+library empty_packages_file_option_test;
+
+import 'package:foo/foo.dart';
+
+main() {
+}
diff --git a/tests/standalone/package/scenarios/invalid/foo/foo.dart b/tests/standalone/package/scenarios/invalid/foo/foo.dart
new file mode 100644
index 0000000..3e2fa50
--- /dev/null
+++ b/tests/standalone/package/scenarios/invalid/foo/foo.dart
@@ -0,0 +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.
+
+library foo;
+
+String foo = 'foo';
\ No newline at end of file
diff --git a/tests/standalone/package/scenarios/invalid/invalid_package_name.packages b/tests/standalone/package/scenarios/invalid/invalid_package_name.packages
new file mode 100644
index 0000000..d74d280
--- /dev/null
+++ b/tests/standalone/package/scenarios/invalid/invalid_package_name.packages
@@ -0,0 +1,2 @@
+..:nonexistent/
+foo:foo/
\ No newline at end of file
diff --git a/tests/standalone/package/scenarios/invalid/invalid_package_name_test.dart b/tests/standalone/package/scenarios/invalid/invalid_package_name_test.dart
new file mode 100644
index 0000000..ef37f27
--- /dev/null
+++ b/tests/standalone/package/scenarios/invalid/invalid_package_name_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.
+
+// PackageRoot=none
+// Packages=invalid_package_name.packages
+
+library invalid_package_name_test;
+
+import 'package:foo/foo.dart' as foo;
+
+main() {
+  if (foo.foo != 'foo') {
+    throw new Exception('package "foo" was not resolved correctly');
+  }
+}
diff --git a/tests/standalone/package/scenarios/invalid/invalid_utf8.packages b/tests/standalone/package/scenarios/invalid/invalid_utf8.packages
new file mode 100644
index 0000000..b0c09d0
--- /dev/null
+++ b/tests/standalone/package/scenarios/invalid/invalid_utf8.packages
@@ -0,0 +1 @@
+þ:foo/
diff --git a/tests/standalone/package/scenarios/invalid/invalid_utf8_test.dart b/tests/standalone/package/scenarios/invalid/invalid_utf8_test.dart
new file mode 100644
index 0000000..0d93b35
--- /dev/null
+++ b/tests/standalone/package/scenarios/invalid/invalid_utf8_test.dart
@@ -0,0 +1,11 @@
+// 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.
+
+// PackageRoot=none
+// Packages=invalid_utf8.packages
+
+library invalid_utf8_test;
+
+main() {
+}
diff --git a/tests/standalone/package/scenarios/invalid/non_existent_packages_file_test.dart b/tests/standalone/package/scenarios/invalid/non_existent_packages_file_test.dart
new file mode 100644
index 0000000..7c333f7
--- /dev/null
+++ b/tests/standalone/package/scenarios/invalid/non_existent_packages_file_test.dart
@@ -0,0 +1,11 @@
+// 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.
+
+// PackageRoot=none
+// Packages=non_existent.packages
+
+library non_existent_packages_file_test;
+
+main() {
+}
diff --git a/tests/standalone/package/scenarios/invalid/same_package_twice.packages b/tests/standalone/package/scenarios/invalid/same_package_twice.packages
new file mode 100644
index 0000000..bdd57b6
--- /dev/null
+++ b/tests/standalone/package/scenarios/invalid/same_package_twice.packages
@@ -0,0 +1,3 @@
+foo:nonexistentdir/
+# This overrides the previous entry
+foo:foo/
\ No newline at end of file
diff --git a/tests/standalone/package/scenarios/invalid/same_package_twice_test.dart b/tests/standalone/package/scenarios/invalid/same_package_twice_test.dart
new file mode 100644
index 0000000..e539e71
--- /dev/null
+++ b/tests/standalone/package/scenarios/invalid/same_package_twice_test.dart
@@ -0,0 +1,13 @@
+// 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.
+
+// PackageRoot=none
+// Packages=same_package_twice.packages
+
+library same_package_twice_test;
+
+import 'package:foo/foo.dart' as foo;
+
+main() {
+}
diff --git a/tests/standalone/package/scenarios/packages_dir_only/packages/foo/foo.dart b/tests/standalone/package/scenarios/packages_dir_only/packages/foo/foo.dart
new file mode 100644
index 0000000..87b2fe1
--- /dev/null
+++ b/tests/standalone/package/scenarios/packages_dir_only/packages/foo/foo.dart
@@ -0,0 +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.
+
+library foo;
+
+String bar = 'hello';
\ No newline at end of file
diff --git a/tests/standalone/package/scenarios/packages_dir_only/packages_dir_only_noimports_test.dart b/tests/standalone/package/scenarios/packages_dir_only/packages_dir_only_noimports_test.dart
new file mode 100644
index 0000000..3f72d32
--- /dev/null
+++ b/tests/standalone/package/scenarios/packages_dir_only/packages_dir_only_noimports_test.dart
@@ -0,0 +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.
+
+// PackageRoot=none
+
+library packages_dir_only_noimports_test;
+
+main() {
+}
diff --git a/tests/standalone/package/scenarios/packages_dir_only/packages_dir_only_test.dart b/tests/standalone/package/scenarios/packages_dir_only/packages_dir_only_test.dart
new file mode 100644
index 0000000..afec5b5
--- /dev/null
+++ b/tests/standalone/package/scenarios/packages_dir_only/packages_dir_only_test.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.
+
+// PackageRoot=none
+
+library packages_dir_only_test;
+
+import 'package:foo/foo.dart' as foo;
+
+main() {
+  if (foo.bar != 'hello') {
+    throw new Exception('package "foo" was not resolved correctly');
+  }
+}
diff --git a/tests/standalone/package/scenarios/packages_file_in_parent/.packages b/tests/standalone/package/scenarios/packages_file_in_parent/.packages
new file mode 100644
index 0000000..17ae735
--- /dev/null
+++ b/tests/standalone/package/scenarios/packages_file_in_parent/.packages
@@ -0,0 +1 @@
+foo:foo/
\ No newline at end of file
diff --git a/tests/standalone/package/scenarios/packages_file_in_parent/foo/foo.dart b/tests/standalone/package/scenarios/packages_file_in_parent/foo/foo.dart
new file mode 100644
index 0000000..87b2fe1
--- /dev/null
+++ b/tests/standalone/package/scenarios/packages_file_in_parent/foo/foo.dart
@@ -0,0 +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.
+
+library foo;
+
+String bar = 'hello';
\ No newline at end of file
diff --git a/tests/standalone/package/scenarios/packages_file_in_parent/sub/packages_file_in_parent_noimports_test.dart b/tests/standalone/package/scenarios/packages_file_in_parent/sub/packages_file_in_parent_noimports_test.dart
new file mode 100644
index 0000000..d47d8b0
--- /dev/null
+++ b/tests/standalone/package/scenarios/packages_file_in_parent/sub/packages_file_in_parent_noimports_test.dart
@@ -0,0 +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.
+
+// PackageRoot=none
+
+library packages_file_in_parent_noimports_test;
+
+main() {
+}
\ No newline at end of file
diff --git a/tests/standalone/package/scenarios/packages_file_in_parent/sub/packages_file_in_parent_test.dart b/tests/standalone/package/scenarios/packages_file_in_parent/sub/packages_file_in_parent_test.dart
new file mode 100644
index 0000000..106b1af
--- /dev/null
+++ b/tests/standalone/package/scenarios/packages_file_in_parent/sub/packages_file_in_parent_test.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.
+
+// PackageRoot=none
+
+library packages_file_in_parent_test;
+
+import 'package:foo/foo.dart' as foo;
+
+main() {
+  if (foo.bar != 'hello') {
+    throw new Exception('package "foo" was not resolved correctly');
+  }
+}
diff --git a/tests/standalone/package/scenarios/packages_file_only/.packages b/tests/standalone/package/scenarios/packages_file_only/.packages
new file mode 100644
index 0000000..17ae735
--- /dev/null
+++ b/tests/standalone/package/scenarios/packages_file_only/.packages
@@ -0,0 +1 @@
+foo:foo/
\ No newline at end of file
diff --git a/tests/standalone/package/scenarios/packages_file_only/foo/foo.dart b/tests/standalone/package/scenarios/packages_file_only/foo/foo.dart
new file mode 100644
index 0000000..87b2fe1
--- /dev/null
+++ b/tests/standalone/package/scenarios/packages_file_only/foo/foo.dart
@@ -0,0 +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.
+
+library foo;
+
+String bar = 'hello';
\ No newline at end of file
diff --git a/tests/standalone/package/scenarios/packages_file_only/packages_file_only_noimports_test.dart b/tests/standalone/package/scenarios/packages_file_only/packages_file_only_noimports_test.dart
new file mode 100644
index 0000000..aa8e85f
--- /dev/null
+++ b/tests/standalone/package/scenarios/packages_file_only/packages_file_only_noimports_test.dart
@@ -0,0 +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.
+
+// PackageRoot=none
+
+library packages_file_only_noimports_test;
+
+main() {
+}
\ No newline at end of file
diff --git a/tests/standalone/package/scenarios/packages_file_only/packages_file_only_test.dart b/tests/standalone/package/scenarios/packages_file_only/packages_file_only_test.dart
new file mode 100644
index 0000000..5339533
--- /dev/null
+++ b/tests/standalone/package/scenarios/packages_file_only/packages_file_only_test.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.
+
+// PackageRoot=none
+
+library packages_file_only_test;
+
+import 'package:foo/foo.dart' as foo;
+
+main() {
+  if (foo.bar != 'hello') {
+    throw new Exception('package "foo" was not resolved correctly');
+  }
+}
diff --git a/tests/standalone/package/scenarios/packages_file_strange_formatting/bar/bar.dart b/tests/standalone/package/scenarios/packages_file_strange_formatting/bar/bar.dart
new file mode 100644
index 0000000..6eed31b
--- /dev/null
+++ b/tests/standalone/package/scenarios/packages_file_strange_formatting/bar/bar.dart
@@ -0,0 +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.
+
+library bar;
+
+String bar = 'bar';
\ No newline at end of file
diff --git a/tests/standalone/package/scenarios/packages_file_strange_formatting/baz/baz.dart b/tests/standalone/package/scenarios/packages_file_strange_formatting/baz/baz.dart
new file mode 100644
index 0000000..1502af0
--- /dev/null
+++ b/tests/standalone/package/scenarios/packages_file_strange_formatting/baz/baz.dart
@@ -0,0 +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.
+
+library baz;
+
+String baz = 'baz';
\ No newline at end of file
diff --git a/tests/standalone/package/scenarios/packages_file_strange_formatting/empty_lines.packages b/tests/standalone/package/scenarios/packages_file_strange_formatting/empty_lines.packages
new file mode 100644
index 0000000..e81099e
--- /dev/null
+++ b/tests/standalone/package/scenarios/packages_file_strange_formatting/empty_lines.packages
@@ -0,0 +1,20 @@
+
+
+
+
+foo:foo/
+
+
+bar:bar/
+
+
+
+
+
+
+
+
+baz:baz/
+
+
+
diff --git a/tests/standalone/package/scenarios/packages_file_strange_formatting/empty_lines_test.dart b/tests/standalone/package/scenarios/packages_file_strange_formatting/empty_lines_test.dart
new file mode 100644
index 0000000..a5ec547
--- /dev/null
+++ b/tests/standalone/package/scenarios/packages_file_strange_formatting/empty_lines_test.dart
@@ -0,0 +1,24 @@
+// 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.
+
+// PackageRoot=none
+// Packages=empty_lines.packages
+
+library empty_lines_test;
+
+import 'package:foo/foo.dart' as foo;
+import 'package:bar/bar.dart' as bar;
+import 'package:baz/baz.dart' as baz;
+
+main() {
+  if (foo.foo != 'foo') {
+    throw new Exception('package "foo" was not resolved correctly');
+  }
+  if (bar.bar != 'bar') {
+    throw new Exception('package "bar" was not resolved correctly');
+  }
+  if (baz.baz != 'baz') {
+    throw new Exception('package "baz" was not resolved correctly');
+  }
+}
diff --git a/tests/standalone/package/scenarios/packages_file_strange_formatting/empty_package_dir.packages b/tests/standalone/package/scenarios/packages_file_strange_formatting/empty_package_dir.packages
new file mode 100644
index 0000000..0152a79
--- /dev/null
+++ b/tests/standalone/package/scenarios/packages_file_strange_formatting/empty_package_dir.packages
@@ -0,0 +1 @@
+foo:
diff --git a/tests/standalone/package/scenarios/packages_file_strange_formatting/empty_package_dir_test.dart b/tests/standalone/package/scenarios/packages_file_strange_formatting/empty_package_dir_test.dart
new file mode 100644
index 0000000..5c7eb39
--- /dev/null
+++ b/tests/standalone/package/scenarios/packages_file_strange_formatting/empty_package_dir_test.dart
@@ -0,0 +1,17 @@
+// 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.
+
+// PackageRoot=none
+// Packages=empty_package_dir.packages
+
+// In this test, we give a packages file that associates the package 'foo' with
+// the empty string. This causes both the VM and dart2js to resolve
+// 'package:foo' imports relative to the root directory. So the import statement
+// `import 'package:foo/foo.dart'` is equivalent to `import '/foo.dart'`.
+library empty_package_dir_test;
+
+import 'package:foo/foo.dart';
+
+main() {
+}
diff --git a/tests/standalone/package/scenarios/packages_file_strange_formatting/foo/foo.dart b/tests/standalone/package/scenarios/packages_file_strange_formatting/foo/foo.dart
new file mode 100644
index 0000000..3e2fa50
--- /dev/null
+++ b/tests/standalone/package/scenarios/packages_file_strange_formatting/foo/foo.dart
@@ -0,0 +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.
+
+library foo;
+
+String foo = 'foo';
\ No newline at end of file
diff --git a/tests/standalone/package/scenarios/packages_file_strange_formatting/mixed_line_ends.packages b/tests/standalone/package/scenarios/packages_file_strange_formatting/mixed_line_ends.packages
new file mode 100644
index 0000000..c3d3e75
--- /dev/null
+++ b/tests/standalone/package/scenarios/packages_file_strange_formatting/mixed_line_ends.packages
@@ -0,0 +1,3 @@
+foo:foo/
+bar:bar/

+baz:baz/
diff --git a/tests/standalone/package/scenarios/packages_file_strange_formatting/mixed_line_ends_test.dart b/tests/standalone/package/scenarios/packages_file_strange_formatting/mixed_line_ends_test.dart
new file mode 100644
index 0000000..8f4b629
--- /dev/null
+++ b/tests/standalone/package/scenarios/packages_file_strange_formatting/mixed_line_ends_test.dart
@@ -0,0 +1,24 @@
+// 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.
+
+// PackageRoot=none
+// Packages=mixed_line_ends.packages
+
+library mixed_line_ends_test;
+
+import 'package:foo/foo.dart' as foo;
+import 'package:bar/bar.dart' as bar;
+import 'package:baz/baz.dart' as baz;
+
+main() {
+  if (foo.foo != 'foo') {
+    throw new Exception('package "foo" was not resolved correctly');
+  }
+  if (bar.bar != 'bar') {
+    throw new Exception('package "bar" was not resolved correctly');
+  }
+  if (baz.baz != 'baz') {
+    throw new Exception('package "baz" was not resolved correctly');
+  }
+}
diff --git a/tests/standalone/package/scenarios/packages_option_only/packages_option_only_noimports_test.dart b/tests/standalone/package/scenarios/packages_option_only/packages_option_only_noimports_test.dart
new file mode 100644
index 0000000..a6a8273
--- /dev/null
+++ b/tests/standalone/package/scenarios/packages_option_only/packages_option_only_noimports_test.dart
@@ -0,0 +1,11 @@
+// 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.
+
+// PackageRoot=none
+// Packages=sub/.packages
+
+library packages_option_only_noimports_test;
+
+main() {
+}
\ No newline at end of file
diff --git a/tests/standalone/package/scenarios/packages_option_only/packages_option_only_test.dart b/tests/standalone/package/scenarios/packages_option_only/packages_option_only_test.dart
new file mode 100644
index 0000000..e873350
--- /dev/null
+++ b/tests/standalone/package/scenarios/packages_option_only/packages_option_only_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.
+
+// PackageRoot=none
+// Packages=sub/.packages
+
+library packages_option_only_test;
+
+import 'package:foo/foo.dart' as foo;
+
+main() {
+  if (foo.bar != 'hello') {
+    throw new Exception('package "foo" was not resolved correctly');
+  }
+}
diff --git a/tests/standalone/package/scenarios/packages_option_only/sub/.packages b/tests/standalone/package/scenarios/packages_option_only/sub/.packages
new file mode 100644
index 0000000..17ae735
--- /dev/null
+++ b/tests/standalone/package/scenarios/packages_option_only/sub/.packages
@@ -0,0 +1 @@
+foo:foo/
\ No newline at end of file
diff --git a/tests/standalone/package/scenarios/packages_option_only/sub/foo/foo.dart b/tests/standalone/package/scenarios/packages_option_only/sub/foo/foo.dart
new file mode 100644
index 0000000..87b2fe1
--- /dev/null
+++ b/tests/standalone/package/scenarios/packages_option_only/sub/foo/foo.dart
@@ -0,0 +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.
+
+library foo;
+
+String bar = 'hello';
\ No newline at end of file
diff --git a/tests/standalone/precompilation_test.dart b/tests/standalone/precompilation_test.dart
new file mode 100644
index 0000000..047ac0d
--- /dev/null
+++ b/tests/standalone/precompilation_test.dart
@@ -0,0 +1,105 @@
+// 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.
+
+// Test generating and running a simple precompiled snapshot of this script.
+
+import 'dart:io';
+
+main(List args) {
+  if (args.length > 0 && args[0] == "--hello") {
+    print("Hello");
+    return;
+  }
+
+  var cc, cc_flags, shared, libname;
+  if (Platform.isLinux) {
+    cc = 'gcc';
+    shared = '-shared';
+    libname = 'libprecompiled.so';
+  } else if (Platform.isMacOS) {
+    cc = 'clang';
+    shared = '-dynamiclib';
+    libname = 'libprecompiled.dylib';
+  } else {
+    print("Test only supports Linux and Mac");
+    return;
+  }
+
+  if (Platform.version.contains("x64")) {
+    cc_flags = "-m64";
+  } else if (Platform.version.contains("simarm64")) {
+    cc_flags = "-m64";
+  } else if (Platform.version.contains("simarm")) {
+    cc_flags = "-m32";
+  } else if (Platform.version.contains("simmips")) {
+    cc_flags = "-m32";
+  } else if (Platform.version.contains("arm")) {
+    cc_flags = "";
+  } else if (Platform.version.contains("mips")) {
+    cc_flags = "-EL";
+  } else {
+    print("Architecture not supported: ${Platform.version}");
+    return;
+  }
+
+  var dart_executable =
+      Directory.current.path + Platform.pathSeparator + Platform.executable;
+  Directory tmp;
+  try {
+    tmp = Directory.current.createTempSync("temp_precompilation_test");
+    var result = Process.runSync(
+       "${dart_executable}_no_snapshot",
+       ["--gen-precompiled-snapshot", Platform.script.path],
+       workingDirectory: tmp.path);
+    if (result.exitCode != 0) {
+      print(result.stdout);
+      print(result.stderr);
+      throw "Snapshot generation failed.";
+    }
+
+    // Check if gcc is present, and skip test if it is not.
+    try {
+      result = Process.runSync(
+          cc,
+          ["--version"],
+          workingDirectory: tmp.path);
+      if (result.exitCode != 0) {
+        throw "$cc --version failed.";
+      }
+    } catch(e) {
+      print("Skipping test because $cc is not present: $e");
+      return;
+    }
+
+    result = Process.runSync(
+        cc,
+        [shared, cc_flags, "-o", libname, "precompiled.S"],
+        workingDirectory: tmp.path);
+    if (result.exitCode != 0) {
+      print(result.stdout);
+      print(result.stderr);
+      throw "Shared library creation failed!";
+    }
+
+    var ld_library_path = new String.fromEnvironment("LD_LIBRARY_PATH");
+    ld_library_path = "${ld_library_path}:${tmp.path}";
+
+    result = Process.runSync(
+       "${dart_executable}",
+       ["--run-precompiled-snapshot", "ignored_script", "--hello"],
+       workingDirectory: tmp.path,
+       environment: {"LD_LIBRARY_PATH": ld_library_path});
+    if (result.exitCode != 0) {
+      print(result.stdout);
+      print(result.stderr);
+      throw "Precompiled binary failed.";
+    }
+    print(result.stdout);
+    if (result.stdout != "Hello\n") {
+      throw "Precompiled binary output mismatch.";
+    }
+  } finally {
+    tmp?.deleteSync(recursive: true);
+  }
+}
diff --git a/tests/standalone/standalone.status b/tests/standalone/standalone.status
index 2819827e..2831a9c 100644
--- a/tests/standalone/standalone.status
+++ b/tests/standalone/standalone.status
@@ -8,14 +8,22 @@
 # prefix.
 
 package/invalid_uri_test: Fail, OK # CompileTimeErrors intentionally
+package/scenarios/packages_file_strange_formatting/empty_package_dir_test: Fail, OK # CompileTimeErrors intentionally
+package/scenarios/empty_packages_file/empty_packages_file_discovery_test: Fail, OK # CompileTimeErrors intentionally
+package/scenarios/empty_packages_file/empty_packages_file_option_test: Fail, OK # CompileTimeErrors intentionally
+package/scenarios/invalid/*: Fail, OK # CompileTimeErrors intentionally
 
 issue14236_test: Pass # Do not remove this line. It serves as a marker for Issue 14516 comment #4.
 
 javascript_compatibility_errors_test/none: Fail, OK  # Not possible to exclude or annotate with '/// none:'
 
+[ $runtime != vm && ($runtime != drt || $compiler != none)) ]
+no_assert_test: Fail, OK # This is testing a vm flag.
+
 [ $runtime == vm ]
 package/package_isolate_test: Fail # Issue 12474
 io/observatory_test: Fail
+package/scenarios/invalid/same_package_twice_test: Pass # Issue 24119
 
 [ $runtime == vm && $checked ]
 # These tests have type errors on purpose.
@@ -53,6 +61,8 @@
 oom_error_stacktrace_test: Skip
 out_of_memory_test: Skip
 verbose_gc_to_bmu_test: Skip
+precompilation_test: Skip # Standalone only test.
+noopt_test: Skip # Standalone only test.
 
 [ $compiler == dartanalyzer || $compiler == dart2analyzer ]
 javascript_int_overflow_literal_test/01: Fail, OK
@@ -95,6 +105,15 @@
 javascript_compatibility_warnings_test: Skip
 unboxed_int_converter_test: Skip
 pair_location_remapping_test: Skip
+precompilation_test: Skip # Standalone only test.
+noopt_test: Skip # Standalone only test.
+
+[ $runtime == vm && $arch == ia32]
+precompilation_test: Skip # Not expected to pass on ia32.
+noopt_test: Skip # Not expected to pass on ia32.
+
+[ $runtime == vm && $arch == arm]
+precompilation_test: Skip # Issue 24427
 
 [ $compiler == dart2js && $jscl ]
 assert_test: RuntimeError, OK # Assumes unspecified fields on the AssertionError.
@@ -138,6 +157,9 @@
 javascript_int_overflow_literal_test/01: Fail # Issue 14651.
 javascript_int_overflow_test: Fail # Issue 14651.
 
+[ $compiler == none && $runtime == drt ]
+map_literal_oom_test: RuntimeError # Issue 24571
+
 [ $compiler == dartanalyzer || $compiler == dart2analyzer ]
 io/directory_invalid_arguments_test: StaticWarning
 io/process_invalid_arguments_test: StaticWarning
@@ -146,6 +168,10 @@
 io/stdout_bad_argument_test: StaticWarning
 package/package1_test: StaticWarning
 package/package_test: StaticWarning
+package/scenarios/packages_dir_only/packages_dir_only_test: StaticWarning
+package/scenarios/packages_file_only/packages_file_only_test: StaticWarning
+package/scenarios/both_dir_and_file/prefers_packages_file_test: StaticWarning
+package/scenarios/packages_file_in_parent/sub/packages_file_in_parent_test: StaticWarning
 typed_data_test: StaticWarning
 typed_data_view_test: StaticWarning
 javascript_compatibility_errors_test: Skip
@@ -154,6 +180,14 @@
 [ $compiler == dart2analyzer ]
 package/package1_test: CompileTimeError
 package/package_test: CompileTimeError
+package/scenarios/packages_dir_only/packages_dir_only_test: CompileTimeError
+package/scenarios/packages_file_only/packages_file_only_test: CompileTimeError
+package/scenarios/both_dir_and_file/prefers_packages_file_test: CompileTimeError
+package/scenarios/packages_file_in_parent/sub/packages_file_in_parent_test: CompileTimeError
+package/scenarios/invalid/non_existent_packages_file_test: Crash, OK # Analyzer exits on invalid package config
+package/scenarios/invalid/invalid_utf8_test: Crash, OK # Analyzer exits on invalid package config
+package/scenarios/invalid/invalid_package_name_test: Crash, OK # Analyzer exits on invalid package config
+package/scenarios/invalid/same_package_twice_test: Crash, OK # Analyzer exits on invalid package config
 
 [ $system == windows ]
 io/skipping_dart2js_compilations_test: Fail # Issue 19551.
@@ -169,20 +203,11 @@
 io/test_runner_test: Skip  # Timeout.
 io/http_client_stays_alive_test: Skip  # Timeout.
 
+[ $runtime == vm ]
+# Failures in secure networking while NSS is replaced with BoringSSL
+io/https_client_certificate_test: RuntimeError # Issue 24070
+io/secure_socket_renegotiate_test: RuntimeError
+io/secure_socket_bad_data_test: RuntimeError  # An error in a secure connection just puts a READ_CLOSED on the stream, rather than signaling an error on the stream.
+
 [ $compiler == dart2js && $cps_ir ]
-coverage_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-io/addlatexhash_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-io/file_error_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-io/file_read_encoded_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-io/file_test: Crash # (static testWriteFro...  cannot handle async/sync*/async* functions
-io/file_write_only_test: Crash # (main()async{asyncSt...  cannot handle async/sync*/async* functions
-io/http_bind_test: Crash # (testBindShared(Stri...  cannot handle async/sync*/async* functions
-io/http_client_connect_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-io/https_bad_certificate_test: Crash # (main()async{var cli...  cannot handle async/sync*/async* functions
-io/issue_22636_test: Crash # (test()async{server=...  cannot handle async/sync*/async* functions
-io/issue_22637_test: Crash # (test()async{server=...  cannot handle async/sync*/async* functions
-io/observatory_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-io/skipping_dart2js_compilations_test: Crash # (static Iterable<Str...  cannot handle async/sync*/async* functions
-io/socket_bind_test: Crash # (testListenCloseList...  cannot handle async/sync*/async* functions
-io/socket_source_address_test: Crash # (Future testConnect(...  cannot handle async/sync*/async* functions
-priority_queue_stress_test: RuntimeError # Cannot read property 'any$1' of undefined
+priority_queue_stress_test: RuntimeError # Cannot read property 'length' of undefined
diff --git a/tests/try/poi/apply_updates_test.dart b/tests/try/poi/apply_updates_test.dart
index c26d283..e8c8429 100644
--- a/tests/try/poi/apply_updates_test.dart
+++ b/tests/try/poi/apply_updates_test.dart
@@ -11,10 +11,10 @@
     LibraryUpdater,
     Update;
 
-import 'package:compiler/src/scanner/scannerlib.dart' show
+import 'package:compiler/src/parser/partial_elements.dart' show
     PartialFunctionElement;
 
-import 'package:compiler/src/dart2jslib.dart' show
+import 'package:compiler/src/script.dart' show
     Script;
 
 import 'package:compiler/src/io/source_file.dart' show
@@ -40,7 +40,7 @@
   Future run() => loadMainApp().then((LibraryElement library) {
     // Capture the current version of [before] before invoking the [updater].
     PartialFunctionElement before = library.localLookup(expectedUpdate);
-    var beforeNode = before.parseNode(compiler);
+    var beforeNode = before.parseNode(compiler.parsing);
 
     var context = new IncrementalCompilerContext();
     LibraryUpdater updater =
@@ -56,10 +56,10 @@
 
     // Check that the [updater] didn't modify the changed element.
     Expect.identical(before, update.before);
-    Expect.identical(beforeNode, before.parseNode(compiler));
+    Expect.identical(beforeNode, before.parseNode(compiler.parsing));
 
     PartialFunctionElement after = update.after;
-    var afterNode = after.parseNode(compiler);
+    var afterNode = after.parseNode(compiler.parsing);
 
     // Check that pretty-printing the elements match [source] (before), and
     // [newSource] (after).
@@ -72,7 +72,7 @@
 
     // Check that the update was applied by pretty-printing [before]. Make no
     // assumptions about [after], as the update may destroy that element.
-    beforeNode = before.parseNode(compiler);
+    beforeNode = before.parseNode(compiler.parsing);
     Expect.notEquals(source, '$beforeNode');
     Expect.stringEquals(newSource, '$beforeNode');
   });
diff --git a/tests/try/poi/compiler_test_case.dart b/tests/try/poi/compiler_test_case.dart
index 8827c97..a1df70a 100644
--- a/tests/try/poi/compiler_test_case.dart
+++ b/tests/try/poi/compiler_test_case.dart
@@ -14,7 +14,7 @@
 import 'package:async_helper/async_helper.dart' show
     asyncTest;
 
-import '../../compiler/dart2js/compiler_helper.dart' show
+import '../../compiler/dart2js/mock_compiler.dart' show
     MockCompiler,
     compilerFor;
 
diff --git a/tests/try/poi/diff_test.dart b/tests/try/poi/diff_test.dart
index 33cffb5..c6de2fd 100644
--- a/tests/try/poi/diff_test.dart
+++ b/tests/try/poi/diff_test.dart
@@ -14,9 +14,8 @@
 import 'package:async_helper/async_helper.dart' show
     asyncTest;
 
-import 'package:compiler/src/dart2jslib.dart' show
-    Compiler,
-    Script;
+import 'package:compiler/src/compiler.dart' show
+    Compiler;
 
 import 'package:compiler/src/io/source_file.dart' show
     StringSourceFile;
@@ -25,11 +24,14 @@
     Element,
     LibraryElement;
 
+import 'package:compiler/src/script.dart' show
+    Script;
+
 import 'package:dart2js_incremental/diff.dart' show
     Difference,
     computeDifference;
 
-import '../../compiler/dart2js/compiler_helper.dart' show
+import '../../compiler/dart2js/mock_compiler.dart' show
     MockCompiler,
     compilerFor;
 
diff --git a/tests/try/poi/forget_element_assertion.dart b/tests/try/poi/forget_element_assertion.dart
index c098234..a825532 100644
--- a/tests/try/poi/forget_element_assertion.dart
+++ b/tests/try/poi/forget_element_assertion.dart
@@ -6,7 +6,7 @@
 // Remove this file when dart2js support such features.
 library trydart.forget_element_assertion;
 
-import '../../compiler/dart2js/compiler_helper.dart' show
+import '../../compiler/dart2js/mock_compiler.dart' show
     compilerFor;
 
 import 'compiler_test_case.dart';
diff --git a/tests/try/poi/forget_element_test.dart b/tests/try/poi/forget_element_test.dart
index e1ebd3b..22b61ce 100644
--- a/tests/try/poi/forget_element_test.dart
+++ b/tests/try/poi/forget_element_test.dart
@@ -20,7 +20,7 @@
 
 import 'package:compiler/src/tree/tree.dart' as tree;
 
-import 'package:compiler/src/scanner/scannerlib.dart' show
+import 'package:compiler/src/parser/partial_elements.dart' show
     PartialMetadataAnnotation;
 
 import 'package:compiler/src/elements/visitor.dart' show
diff --git a/tests/try/poi/library_updater_test.dart b/tests/try/poi/library_updater_test.dart
index 8513442..b37fac5 100644
--- a/tests/try/poi/library_updater_test.dart
+++ b/tests/try/poi/library_updater_test.dart
@@ -10,7 +10,7 @@
     LibraryUpdater,
     Update;
 
-import 'package:compiler/src/dart2jslib.dart' show
+import 'package:compiler/src/script.dart' show
     Script;
 
 import 'package:compiler/src/io/source_file.dart' show
diff --git a/tests/try/try.status b/tests/try/try.status
index 722e5b9..d6d7ca7 100644
--- a/tests/try/try.status
+++ b/tests/try/try.status
@@ -10,6 +10,9 @@
 [ $compiler == dart2js && $runtime == drt ]
 web/end_to_end_test: Fail, Pass # https://code.google.com/p/v8/issues/detail?id=3347
 
+[ $compiler == none && $runtime == drt ]
+web/end_to_end_test: Fail # Issue 24568
+
 [ $csp ]
 web/end_to_end_test: Fail, OK # Issue 17935
 web/incremental_compilation_update_test: SkipByDesign # Test uses eval, not supported in CSP mode.
diff --git a/tests/try/web/incremental_compilation_update_test.dart b/tests/try/web/incremental_compilation_update_test.dart
index 63ca651..d434b47 100644
--- a/tests/try/web/incremental_compilation_update_test.dart
+++ b/tests/try/web/incremental_compilation_update_test.dart
@@ -37,7 +37,7 @@
     Element,
     LibraryElement;
 
-import 'package:compiler/src/dart2jslib.dart' show
+import 'package:compiler/src/compiler.dart' show
     Compiler;
 
 import 'package:dart2js_incremental/dart2js_incremental.dart' show
diff --git a/tests/utils/utils.status b/tests/utils/utils.status
index f793816..43fb007 100644
--- a/tests/utils/utils.status
+++ b/tests/utils/utils.status
@@ -8,6 +8,7 @@
 [ $compiler == dart2js ]
 dummy_compiler_test: Slow, Pass
 recursive_import_test: Slow, Pass
+source_mirrors_test: Slow, Pass
 
 [ $compiler == none && $runtime == drt ]
 dummy_compiler_test: Skip # Issue 7233
@@ -20,7 +21,6 @@
 
 
 [ $compiler == dart2js && $mode == debug ]
-source_mirrors_test: Slow, Pass
 dummy_compiler_test: Slow, Pass
 
 [ $compiler == none && $runtime == ContentShellOnAndroid ]
@@ -31,4 +31,4 @@
 [ $compiler == dart2js && $cps_ir ]
 dummy_compiler_test: Crash # (switch (function.na...  continue to a labeled switch case
 recursive_import_test: Crash # (switch (function.na...  continue to a labeled switch case
-source_mirrors_test: Crash # (switch (function.na...  continue to a labeled switch case
+source_mirrors_test: Crash, Slow # (switch (function.na...  continue to a labeled switch case
diff --git a/third_party/.gitignore b/third_party/.gitignore
index cbe3480..a55ad28 100644
--- a/third_party/.gitignore
+++ b/third_party/.gitignore
@@ -1,7 +1,9 @@
 # ignore everything
 *
-# except for items in the pkg directory and self
+# except for items in the pkg directory and self.
+# except for our files in boringssl.  The checkout is in boringssl/src.
 !.gitignore
 !pkg
 !pkg_tested
+!boringssl
 !d8
diff --git a/third_party/boringssl/.gitignore b/third_party/boringssl/.gitignore
new file mode 100644
index 0000000..6eda124
--- /dev/null
+++ b/third_party/boringssl/.gitignore
@@ -0,0 +1,2 @@
+# ignore the checkout of boringssl.
+src/
diff --git a/third_party/boringssl/README b/third_party/boringssl/README
new file mode 100644
index 0000000..f151cb2
--- /dev/null
+++ b/third_party/boringssl/README
@@ -0,0 +1,17 @@
+The files in this directory, except for src/, boringssl_dart.gyp, and
+boringssl_configurations.gypi, are generated from the checkout of
+boringssl in src/, by running the script
+src/util/generate_build_files.py chromium.
+
+That script is maintained by the chromium team, to make a gyp build
+of boringssl that does not require go or perl.  We modify the main
+gyp file of this build, boringssl.gyp, to add configurations for
+the target architectures, creating boringssl_dart.gyp.
+
+When updating boringssl in Dart, delete this directory,
+and check out the new boringssl to src.  Then run the script, check out
+our two files boringssl_dart.gyp and boringssl_configurations.gypi and commit
+the changes and any added or deleted files, as well as a change to the
+boringssl revision in DEPS.  If there are changes in boringssl.gyp,
+consider making  similar changes to boringssl_dart.gyp
+Test the changes on all platforms before committing, of course.
diff --git a/third_party/boringssl/boringssl.gypi b/third_party/boringssl/boringssl.gypi
new file mode 100644
index 0000000..fb8e643
--- /dev/null
+++ b/third_party/boringssl/boringssl.gypi
@@ -0,0 +1,431 @@
+# 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 created by generate_build_files.py. Do not edit manually.
+
+{
+  'variables': {
+    'boringssl_ssl_sources': [
+      'src/ssl/d1_both.c',
+      'src/ssl/d1_clnt.c',
+      'src/ssl/d1_lib.c',
+      'src/ssl/d1_meth.c',
+      'src/ssl/d1_pkt.c',
+      'src/ssl/d1_srtp.c',
+      'src/ssl/d1_srvr.c',
+      'src/ssl/pqueue/pqueue.c',
+      'src/ssl/s3_both.c',
+      'src/ssl/s3_clnt.c',
+      'src/ssl/s3_enc.c',
+      'src/ssl/s3_lib.c',
+      'src/ssl/s3_meth.c',
+      'src/ssl/s3_pkt.c',
+      'src/ssl/s3_srvr.c',
+      'src/ssl/ssl_aead_ctx.c',
+      'src/ssl/ssl_algs.c',
+      'src/ssl/ssl_asn1.c',
+      'src/ssl/ssl_cert.c',
+      'src/ssl/ssl_cipher.c',
+      'src/ssl/ssl_lib.c',
+      'src/ssl/ssl_rsa.c',
+      'src/ssl/ssl_sess.c',
+      'src/ssl/ssl_stat.c',
+      'src/ssl/ssl_txt.c',
+      'src/ssl/t1_enc.c',
+      'src/ssl/t1_lib.c',
+      'src/ssl/t1_reneg.c',
+    ],
+    'boringssl_crypto_sources': [
+      'err_data.c',
+      'src/crypto/aes/aes.c',
+      'src/crypto/aes/mode_wrappers.c',
+      'src/crypto/asn1/a_bitstr.c',
+      'src/crypto/asn1/a_bool.c',
+      'src/crypto/asn1/a_bytes.c',
+      'src/crypto/asn1/a_d2i_fp.c',
+      'src/crypto/asn1/a_dup.c',
+      'src/crypto/asn1/a_enum.c',
+      'src/crypto/asn1/a_gentm.c',
+      'src/crypto/asn1/a_i2d_fp.c',
+      'src/crypto/asn1/a_int.c',
+      'src/crypto/asn1/a_mbstr.c',
+      'src/crypto/asn1/a_object.c',
+      'src/crypto/asn1/a_octet.c',
+      'src/crypto/asn1/a_print.c',
+      'src/crypto/asn1/a_strnid.c',
+      'src/crypto/asn1/a_time.c',
+      'src/crypto/asn1/a_type.c',
+      'src/crypto/asn1/a_utctm.c',
+      'src/crypto/asn1/a_utf8.c',
+      'src/crypto/asn1/asn1_lib.c',
+      'src/crypto/asn1/asn1_par.c',
+      'src/crypto/asn1/asn_pack.c',
+      'src/crypto/asn1/bio_asn1.c',
+      'src/crypto/asn1/bio_ndef.c',
+      'src/crypto/asn1/f_enum.c',
+      'src/crypto/asn1/f_int.c',
+      'src/crypto/asn1/f_string.c',
+      'src/crypto/asn1/t_bitst.c',
+      'src/crypto/asn1/t_pkey.c',
+      'src/crypto/asn1/tasn_dec.c',
+      'src/crypto/asn1/tasn_enc.c',
+      'src/crypto/asn1/tasn_fre.c',
+      'src/crypto/asn1/tasn_new.c',
+      'src/crypto/asn1/tasn_prn.c',
+      'src/crypto/asn1/tasn_typ.c',
+      'src/crypto/asn1/tasn_utl.c',
+      'src/crypto/asn1/x_bignum.c',
+      'src/crypto/asn1/x_long.c',
+      'src/crypto/base64/base64.c',
+      'src/crypto/bio/bio.c',
+      'src/crypto/bio/bio_mem.c',
+      'src/crypto/bio/buffer.c',
+      'src/crypto/bio/connect.c',
+      'src/crypto/bio/fd.c',
+      'src/crypto/bio/file.c',
+      'src/crypto/bio/hexdump.c',
+      'src/crypto/bio/pair.c',
+      'src/crypto/bio/printf.c',
+      'src/crypto/bio/socket.c',
+      'src/crypto/bio/socket_helper.c',
+      'src/crypto/bn/add.c',
+      'src/crypto/bn/asm/x86_64-gcc.c',
+      'src/crypto/bn/bn.c',
+      'src/crypto/bn/cmp.c',
+      'src/crypto/bn/convert.c',
+      'src/crypto/bn/ctx.c',
+      'src/crypto/bn/div.c',
+      'src/crypto/bn/exponentiation.c',
+      'src/crypto/bn/gcd.c',
+      'src/crypto/bn/generic.c',
+      'src/crypto/bn/kronecker.c',
+      'src/crypto/bn/montgomery.c',
+      'src/crypto/bn/mul.c',
+      'src/crypto/bn/prime.c',
+      'src/crypto/bn/random.c',
+      'src/crypto/bn/rsaz_exp.c',
+      'src/crypto/bn/shift.c',
+      'src/crypto/bn/sqrt.c',
+      'src/crypto/buf/buf.c',
+      'src/crypto/bytestring/ber.c',
+      'src/crypto/bytestring/cbb.c',
+      'src/crypto/bytestring/cbs.c',
+      'src/crypto/chacha/chacha_generic.c',
+      'src/crypto/chacha/chacha_vec.c',
+      'src/crypto/cipher/aead.c',
+      'src/crypto/cipher/cipher.c',
+      'src/crypto/cipher/derive_key.c',
+      'src/crypto/cipher/e_aes.c',
+      'src/crypto/cipher/e_chacha20poly1305.c',
+      'src/crypto/cipher/e_des.c',
+      'src/crypto/cipher/e_null.c',
+      'src/crypto/cipher/e_rc2.c',
+      'src/crypto/cipher/e_rc4.c',
+      'src/crypto/cipher/e_ssl3.c',
+      'src/crypto/cipher/e_tls.c',
+      'src/crypto/cipher/tls_cbc.c',
+      'src/crypto/cmac/cmac.c',
+      'src/crypto/conf/conf.c',
+      'src/crypto/cpu-arm.c',
+      'src/crypto/cpu-intel.c',
+      'src/crypto/crypto.c',
+      'src/crypto/des/des.c',
+      'src/crypto/dh/check.c',
+      'src/crypto/dh/dh.c',
+      'src/crypto/dh/dh_asn1.c',
+      'src/crypto/dh/dh_impl.c',
+      'src/crypto/dh/params.c',
+      'src/crypto/digest/digest.c',
+      'src/crypto/digest/digests.c',
+      'src/crypto/directory_posix.c',
+      'src/crypto/directory_win.c',
+      'src/crypto/dsa/dsa.c',
+      'src/crypto/dsa/dsa_asn1.c',
+      'src/crypto/dsa/dsa_impl.c',
+      'src/crypto/ec/ec.c',
+      'src/crypto/ec/ec_asn1.c',
+      'src/crypto/ec/ec_key.c',
+      'src/crypto/ec/ec_montgomery.c',
+      'src/crypto/ec/oct.c',
+      'src/crypto/ec/p256-64.c',
+      'src/crypto/ec/simple.c',
+      'src/crypto/ec/util-64.c',
+      'src/crypto/ec/wnaf.c',
+      'src/crypto/ecdh/ecdh.c',
+      'src/crypto/ecdsa/ecdsa.c',
+      'src/crypto/ecdsa/ecdsa_asn1.c',
+      'src/crypto/engine/engine.c',
+      'src/crypto/err/err.c',
+      'src/crypto/evp/algorithm.c',
+      'src/crypto/evp/asn1.c',
+      'src/crypto/evp/digestsign.c',
+      'src/crypto/evp/evp.c',
+      'src/crypto/evp/evp_ctx.c',
+      'src/crypto/evp/p_dsa_asn1.c',
+      'src/crypto/evp/p_ec.c',
+      'src/crypto/evp/p_ec_asn1.c',
+      'src/crypto/evp/p_rsa.c',
+      'src/crypto/evp/p_rsa_asn1.c',
+      'src/crypto/evp/pbkdf.c',
+      'src/crypto/evp/sign.c',
+      'src/crypto/ex_data.c',
+      'src/crypto/hkdf/hkdf.c',
+      'src/crypto/hmac/hmac.c',
+      'src/crypto/lhash/lhash.c',
+      'src/crypto/md4/md4.c',
+      'src/crypto/md5/md5.c',
+      'src/crypto/mem.c',
+      'src/crypto/modes/cbc.c',
+      'src/crypto/modes/cfb.c',
+      'src/crypto/modes/ctr.c',
+      'src/crypto/modes/gcm.c',
+      'src/crypto/modes/ofb.c',
+      'src/crypto/obj/obj.c',
+      'src/crypto/obj/obj_xref.c',
+      'src/crypto/pem/pem_all.c',
+      'src/crypto/pem/pem_info.c',
+      'src/crypto/pem/pem_lib.c',
+      'src/crypto/pem/pem_oth.c',
+      'src/crypto/pem/pem_pk8.c',
+      'src/crypto/pem/pem_pkey.c',
+      'src/crypto/pem/pem_x509.c',
+      'src/crypto/pem/pem_xaux.c',
+      'src/crypto/pkcs8/p5_pbe.c',
+      'src/crypto/pkcs8/p5_pbev2.c',
+      'src/crypto/pkcs8/p8_pkey.c',
+      'src/crypto/pkcs8/pkcs8.c',
+      'src/crypto/poly1305/poly1305.c',
+      'src/crypto/poly1305/poly1305_arm.c',
+      'src/crypto/poly1305/poly1305_vec.c',
+      'src/crypto/rand/hwrand.c',
+      'src/crypto/rand/rand.c',
+      'src/crypto/rand/urandom.c',
+      'src/crypto/rand/windows.c',
+      'src/crypto/rc4/rc4.c',
+      'src/crypto/refcount_c11.c',
+      'src/crypto/refcount_lock.c',
+      'src/crypto/rsa/blinding.c',
+      'src/crypto/rsa/padding.c',
+      'src/crypto/rsa/rsa.c',
+      'src/crypto/rsa/rsa_asn1.c',
+      'src/crypto/rsa/rsa_impl.c',
+      'src/crypto/sha/sha1.c',
+      'src/crypto/sha/sha256.c',
+      'src/crypto/sha/sha512.c',
+      'src/crypto/stack/stack.c',
+      'src/crypto/thread.c',
+      'src/crypto/thread_none.c',
+      'src/crypto/thread_pthread.c',
+      'src/crypto/thread_win.c',
+      'src/crypto/time_support.c',
+      'src/crypto/x509/a_digest.c',
+      'src/crypto/x509/a_sign.c',
+      'src/crypto/x509/a_strex.c',
+      'src/crypto/x509/a_verify.c',
+      'src/crypto/x509/asn1_gen.c',
+      'src/crypto/x509/by_dir.c',
+      'src/crypto/x509/by_file.c',
+      'src/crypto/x509/i2d_pr.c',
+      'src/crypto/x509/pkcs7.c',
+      'src/crypto/x509/t_crl.c',
+      'src/crypto/x509/t_req.c',
+      'src/crypto/x509/t_x509.c',
+      'src/crypto/x509/t_x509a.c',
+      'src/crypto/x509/x509.c',
+      'src/crypto/x509/x509_att.c',
+      'src/crypto/x509/x509_cmp.c',
+      'src/crypto/x509/x509_d2.c',
+      'src/crypto/x509/x509_def.c',
+      'src/crypto/x509/x509_ext.c',
+      'src/crypto/x509/x509_lu.c',
+      'src/crypto/x509/x509_obj.c',
+      'src/crypto/x509/x509_r2x.c',
+      'src/crypto/x509/x509_req.c',
+      'src/crypto/x509/x509_set.c',
+      'src/crypto/x509/x509_trs.c',
+      'src/crypto/x509/x509_txt.c',
+      'src/crypto/x509/x509_v3.c',
+      'src/crypto/x509/x509_vfy.c',
+      'src/crypto/x509/x509_vpm.c',
+      'src/crypto/x509/x509cset.c',
+      'src/crypto/x509/x509name.c',
+      'src/crypto/x509/x509rset.c',
+      'src/crypto/x509/x509spki.c',
+      'src/crypto/x509/x509type.c',
+      'src/crypto/x509/x_algor.c',
+      'src/crypto/x509/x_all.c',
+      'src/crypto/x509/x_attrib.c',
+      'src/crypto/x509/x_crl.c',
+      'src/crypto/x509/x_exten.c',
+      'src/crypto/x509/x_info.c',
+      'src/crypto/x509/x_name.c',
+      'src/crypto/x509/x_pkey.c',
+      'src/crypto/x509/x_pubkey.c',
+      'src/crypto/x509/x_req.c',
+      'src/crypto/x509/x_sig.c',
+      'src/crypto/x509/x_spki.c',
+      'src/crypto/x509/x_val.c',
+      'src/crypto/x509/x_x509.c',
+      'src/crypto/x509/x_x509a.c',
+      'src/crypto/x509v3/pcy_cache.c',
+      'src/crypto/x509v3/pcy_data.c',
+      'src/crypto/x509v3/pcy_lib.c',
+      'src/crypto/x509v3/pcy_map.c',
+      'src/crypto/x509v3/pcy_node.c',
+      'src/crypto/x509v3/pcy_tree.c',
+      'src/crypto/x509v3/v3_akey.c',
+      'src/crypto/x509v3/v3_akeya.c',
+      'src/crypto/x509v3/v3_alt.c',
+      'src/crypto/x509v3/v3_bcons.c',
+      'src/crypto/x509v3/v3_bitst.c',
+      'src/crypto/x509v3/v3_conf.c',
+      'src/crypto/x509v3/v3_cpols.c',
+      'src/crypto/x509v3/v3_crld.c',
+      'src/crypto/x509v3/v3_enum.c',
+      'src/crypto/x509v3/v3_extku.c',
+      'src/crypto/x509v3/v3_genn.c',
+      'src/crypto/x509v3/v3_ia5.c',
+      'src/crypto/x509v3/v3_info.c',
+      'src/crypto/x509v3/v3_int.c',
+      'src/crypto/x509v3/v3_lib.c',
+      'src/crypto/x509v3/v3_ncons.c',
+      'src/crypto/x509v3/v3_pci.c',
+      'src/crypto/x509v3/v3_pcia.c',
+      'src/crypto/x509v3/v3_pcons.c',
+      'src/crypto/x509v3/v3_pku.c',
+      'src/crypto/x509v3/v3_pmaps.c',
+      'src/crypto/x509v3/v3_prn.c',
+      'src/crypto/x509v3/v3_purp.c',
+      'src/crypto/x509v3/v3_skey.c',
+      'src/crypto/x509v3/v3_sxnet.c',
+      'src/crypto/x509v3/v3_utl.c',
+    ],
+    'boringssl_linux_aarch64_sources': [
+      'linux-aarch64/crypto/aes/aesv8-armx64.S',
+      'linux-aarch64/crypto/modes/ghashv8-armx64.S',
+      'linux-aarch64/crypto/sha/sha1-armv8.S',
+      'linux-aarch64/crypto/sha/sha256-armv8.S',
+      'linux-aarch64/crypto/sha/sha512-armv8.S',
+    ],
+    'boringssl_linux_arm_sources': [
+      'linux-arm/crypto/aes/aes-armv4.S',
+      'linux-arm/crypto/aes/aesv8-armx32.S',
+      'linux-arm/crypto/aes/bsaes-armv7.S',
+      'linux-arm/crypto/bn/armv4-mont.S',
+      'linux-arm/crypto/modes/ghash-armv4.S',
+      'linux-arm/crypto/modes/ghashv8-armx32.S',
+      'linux-arm/crypto/sha/sha1-armv4-large.S',
+      'linux-arm/crypto/sha/sha256-armv4.S',
+      'linux-arm/crypto/sha/sha512-armv4.S',
+      'src/crypto/chacha/chacha_vec_arm.S',
+      'src/crypto/cpu-arm-asm.S',
+      'src/crypto/poly1305/poly1305_arm_asm.S',
+    ],
+    'boringssl_linux_x86_sources': [
+      'linux-x86/crypto/aes/aes-586.S',
+      'linux-x86/crypto/aes/aesni-x86.S',
+      'linux-x86/crypto/aes/vpaes-x86.S',
+      'linux-x86/crypto/bn/bn-586.S',
+      'linux-x86/crypto/bn/co-586.S',
+      'linux-x86/crypto/bn/x86-mont.S',
+      'linux-x86/crypto/cpu-x86-asm.S',
+      'linux-x86/crypto/md5/md5-586.S',
+      'linux-x86/crypto/modes/ghash-x86.S',
+      'linux-x86/crypto/rc4/rc4-586.S',
+      'linux-x86/crypto/sha/sha1-586.S',
+      'linux-x86/crypto/sha/sha256-586.S',
+      'linux-x86/crypto/sha/sha512-586.S',
+    ],
+    'boringssl_linux_x86_64_sources': [
+      'linux-x86_64/crypto/aes/aes-x86_64.S',
+      'linux-x86_64/crypto/aes/aesni-x86_64.S',
+      'linux-x86_64/crypto/aes/bsaes-x86_64.S',
+      'linux-x86_64/crypto/aes/vpaes-x86_64.S',
+      'linux-x86_64/crypto/bn/rsaz-avx2.S',
+      'linux-x86_64/crypto/bn/rsaz-x86_64.S',
+      'linux-x86_64/crypto/bn/x86_64-mont.S',
+      'linux-x86_64/crypto/bn/x86_64-mont5.S',
+      'linux-x86_64/crypto/cpu-x86_64-asm.S',
+      'linux-x86_64/crypto/md5/md5-x86_64.S',
+      'linux-x86_64/crypto/modes/aesni-gcm-x86_64.S',
+      'linux-x86_64/crypto/modes/ghash-x86_64.S',
+      'linux-x86_64/crypto/rand/rdrand-x86_64.S',
+      'linux-x86_64/crypto/rc4/rc4-md5-x86_64.S',
+      'linux-x86_64/crypto/rc4/rc4-x86_64.S',
+      'linux-x86_64/crypto/sha/sha1-x86_64.S',
+      'linux-x86_64/crypto/sha/sha256-x86_64.S',
+      'linux-x86_64/crypto/sha/sha512-x86_64.S',
+    ],
+    'boringssl_mac_x86_sources': [
+      'mac-x86/crypto/aes/aes-586.S',
+      'mac-x86/crypto/aes/aesni-x86.S',
+      'mac-x86/crypto/aes/vpaes-x86.S',
+      'mac-x86/crypto/bn/bn-586.S',
+      'mac-x86/crypto/bn/co-586.S',
+      'mac-x86/crypto/bn/x86-mont.S',
+      'mac-x86/crypto/cpu-x86-asm.S',
+      'mac-x86/crypto/md5/md5-586.S',
+      'mac-x86/crypto/modes/ghash-x86.S',
+      'mac-x86/crypto/rc4/rc4-586.S',
+      'mac-x86/crypto/sha/sha1-586.S',
+      'mac-x86/crypto/sha/sha256-586.S',
+      'mac-x86/crypto/sha/sha512-586.S',
+    ],
+    'boringssl_mac_x86_64_sources': [
+      'mac-x86_64/crypto/aes/aes-x86_64.S',
+      'mac-x86_64/crypto/aes/aesni-x86_64.S',
+      'mac-x86_64/crypto/aes/bsaes-x86_64.S',
+      'mac-x86_64/crypto/aes/vpaes-x86_64.S',
+      'mac-x86_64/crypto/bn/rsaz-avx2.S',
+      'mac-x86_64/crypto/bn/rsaz-x86_64.S',
+      'mac-x86_64/crypto/bn/x86_64-mont.S',
+      'mac-x86_64/crypto/bn/x86_64-mont5.S',
+      'mac-x86_64/crypto/cpu-x86_64-asm.S',
+      'mac-x86_64/crypto/md5/md5-x86_64.S',
+      'mac-x86_64/crypto/modes/aesni-gcm-x86_64.S',
+      'mac-x86_64/crypto/modes/ghash-x86_64.S',
+      'mac-x86_64/crypto/rand/rdrand-x86_64.S',
+      'mac-x86_64/crypto/rc4/rc4-md5-x86_64.S',
+      'mac-x86_64/crypto/rc4/rc4-x86_64.S',
+      'mac-x86_64/crypto/sha/sha1-x86_64.S',
+      'mac-x86_64/crypto/sha/sha256-x86_64.S',
+      'mac-x86_64/crypto/sha/sha512-x86_64.S',
+    ],
+    'boringssl_win_x86_sources': [
+      'win-x86/crypto/aes/aes-586.asm',
+      'win-x86/crypto/aes/aesni-x86.asm',
+      'win-x86/crypto/aes/vpaes-x86.asm',
+      'win-x86/crypto/bn/bn-586.asm',
+      'win-x86/crypto/bn/co-586.asm',
+      'win-x86/crypto/bn/x86-mont.asm',
+      'win-x86/crypto/cpu-x86-asm.asm',
+      'win-x86/crypto/md5/md5-586.asm',
+      'win-x86/crypto/modes/ghash-x86.asm',
+      'win-x86/crypto/rc4/rc4-586.asm',
+      'win-x86/crypto/sha/sha1-586.asm',
+      'win-x86/crypto/sha/sha256-586.asm',
+      'win-x86/crypto/sha/sha512-586.asm',
+    ],
+    'boringssl_win_x86_64_sources': [
+      'win-x86_64/crypto/aes/aes-x86_64.asm',
+      'win-x86_64/crypto/aes/aesni-x86_64.asm',
+      'win-x86_64/crypto/aes/bsaes-x86_64.asm',
+      'win-x86_64/crypto/aes/vpaes-x86_64.asm',
+      'win-x86_64/crypto/bn/rsaz-avx2.asm',
+      'win-x86_64/crypto/bn/rsaz-x86_64.asm',
+      'win-x86_64/crypto/bn/x86_64-mont.asm',
+      'win-x86_64/crypto/bn/x86_64-mont5.asm',
+      'win-x86_64/crypto/cpu-x86_64-asm.asm',
+      'win-x86_64/crypto/md5/md5-x86_64.asm',
+      'win-x86_64/crypto/modes/aesni-gcm-x86_64.asm',
+      'win-x86_64/crypto/modes/ghash-x86_64.asm',
+      'win-x86_64/crypto/rand/rdrand-x86_64.asm',
+      'win-x86_64/crypto/rc4/rc4-md5-x86_64.asm',
+      'win-x86_64/crypto/rc4/rc4-x86_64.asm',
+      'win-x86_64/crypto/sha/sha1-x86_64.asm',
+      'win-x86_64/crypto/sha/sha256-x86_64.asm',
+      'win-x86_64/crypto/sha/sha512-x86_64.asm',
+    ],
+  }
+}
diff --git a/third_party/boringssl/boringssl_configurations.gypi b/third_party/boringssl/boringssl_configurations.gypi
new file mode 100644
index 0000000..91c76c1
--- /dev/null
+++ b/third_party/boringssl/boringssl_configurations.gypi
@@ -0,0 +1,99 @@
+# 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.
+
+# This file is included to modify the configurations to build third-party
+# code from BoringSSL.
+# This code is C code, not C++, and is not warning-free, so we need to remove
+# C++-specific flags, and add flags to supress the warnings in the code.
+{
+  'variables': {
+    # Used by third_party/nss, which is from Chromium.
+    # Include the built-in set of root certificate authorities.
+    'exclude_nss_root_certs': 0,
+    'os_posix%': 1,
+    'os_bsd%': 0,
+    'chromeos%': 0,
+    'clang%': 0,
+  },
+  'target_defaults': {
+    'cflags': [
+      '-w',
+      '-UHAVE_CVAR_BUILT_ON_SEM',
+    ],
+    # Removes these flags from the list cflags.
+    'cflags!': [
+      # NSS code from upstream mozilla builds with warnings,
+      # so we must allow warnings without failing.
+      '-Werror',
+      '-Wall',
+      '-ansi',
+      # Not supported for C, only for C++.
+      '-Wnon-virtual-dtor',
+      '-Wno-conversion-null',
+      '-fno-rtti',
+      '-fvisibility-inlines-hidden',
+      '-Woverloaded-virtual',
+    ],
+    'configurations': {
+      'Dart_Base': {
+        'xcode_settings': {
+          'WARNING_CFLAGS': [
+            '-w',
+          ],
+          'WARNING_CFLAGS!': [
+            '-Wall',
+            '-Wextra',
+          ],
+        },
+      },
+      # Dart_Macos_Debug and Dart_Macos_Release are merged after
+      # Dart_Macos_Base, so we can override the 'ansi' and '-Werror' flags set
+      # at the global level in tools/gyp/configurations_xcode.gypi.
+      'Dart_Macos_Debug': {
+        'abstract': 1,
+        'xcode_settings': {
+          # Remove 'ansi' setting.
+          'GCC_C_LANGUAGE_STANDARD': 'c99',
+          'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO', # -Werror off
+        },
+      },
+      'Dart_Macos_Release': {
+        'abstract': 1,
+        'xcode_settings': {
+          # Remove 'ansi' setting.
+          'GCC_C_LANGUAGE_STANDARD': 'c99',
+          'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO', # -Werror off
+        },
+      },
+      # When being built for Android nss expects __linux__ to be defined.
+      'Dart_Android_Base': {
+        'target_conditions': [
+          ['_toolset=="host"', {
+            'defines!': [
+              'ANDROID',
+            ],
+            # Define __linux__ on Android build for NSS.
+            'defines': [
+              '__linux__',
+            ],
+            'cflags!': [
+              '-U__linux__',
+            ],
+          }],
+          ['_toolset=="target"', {
+            'defines': [
+              '__linux__',
+              'CHECK_FORK_GETPID',  # Android does not provide pthread_atfork.
+              '__USE_LARGEFILE64',
+            ],
+            # Define __linux__ on Android build for NSS.
+            'cflags!': [
+              '-U__linux__',
+            ],
+          }]
+        ],
+      },
+    },
+  },
+}
\ No newline at end of file
diff --git a/third_party/boringssl/boringssl_dart.gyp b/third_party/boringssl/boringssl_dart.gyp
new file mode 100644
index 0000000..30270fa
--- /dev/null
+++ b/third_party/boringssl/boringssl_dart.gyp
@@ -0,0 +1,62 @@
+# 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.
+
+{
+  'includes': [
+    '../../runtime/tools/gyp/runtime-configurations.gypi',
+    'boringssl_configurations.gypi',
+  ],
+  'targets': [
+    {
+      'target_name': 'boringssl',
+      'type': '<(component)',
+      'toolsets': ['host', 'target'],
+      'includes': [
+        'boringssl.gypi',
+      ],
+      'sources': [
+        '<@(boringssl_crypto_sources)',
+        '<@(boringssl_ssl_sources)',
+      ],
+      'defines': [
+        'BORINGSSL_IMPLEMENTATION',
+        'BORINGSSL_NO_STATIC_INITIALIZER',
+      ],
+      # TODO(davidben): Fix size_t truncations in BoringSSL.
+      # https://crbug.com/429039
+      'msvs_disabled_warnings': [ 4267, ],
+      'conditions': [
+        ['OS == "mac"', {
+          'sources': [
+            '<@(boringssl_mac_x86_sources)',
+            '<@(boringssl_mac_x86_64_sources)'
+          ],
+        }],
+        ['OS == "linux" or OS == "android"', {
+          'sources': [
+            '<@(boringssl_linux_x86_64_sources)',
+            '<@(boringssl_linux_x86_sources)',
+            '<@(boringssl_linux_arm_sources)',
+            '<@(boringssl_linux_aarch64_sources)',
+          ],
+        }],
+        ['OS == "win"', {
+          'defines': [ 'OPENSSL_NO_ASM', 'WIN32_LEAN_AND_MEAN' ],
+        }],
+      ],
+      'include_dirs': [
+        'src/include',
+        # This is for arm_arch.h, which is needed by some asm files. Since the
+        # asm files are generated and kept in a different directory, they
+        # cannot use relative paths to find this file.
+        'src/crypto',
+      ],
+      'direct_dependent_settings': {
+        'include_dirs': [
+          'src/include',
+        ],
+      },
+    },
+  ],
+}
diff --git a/third_party/boringssl/boringssl_tests.gypi b/third_party/boringssl/boringssl_tests.gypi
new file mode 100644
index 0000000..9413d8c
--- /dev/null
+++ b/third_party/boringssl/boringssl_tests.gypi
@@ -0,0 +1,483 @@
+# 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 created by generate_build_files.py. Do not edit manually.
+
+{
+  'targets': [
+    {
+      'target_name': 'boringssl_base64_test',
+      'type': 'executable',
+      'dependencies': [
+        'boringssl.gyp:boringssl',
+      ],
+      'sources': [
+        'src/crypto/base64/base64_test.cc',
+        '<@(boringssl_test_support_sources)',
+      ],
+      # TODO(davidben): Fix size_t truncations in BoringSSL.
+      # https://crbug.com/429039
+      'msvs_disabled_warnings': [ 4267, ],
+    },
+    {
+      'target_name': 'boringssl_bio_test',
+      'type': 'executable',
+      'dependencies': [
+        'boringssl.gyp:boringssl',
+      ],
+      'sources': [
+        'src/crypto/bio/bio_test.cc',
+        '<@(boringssl_test_support_sources)',
+      ],
+      # TODO(davidben): Fix size_t truncations in BoringSSL.
+      # https://crbug.com/429039
+      'msvs_disabled_warnings': [ 4267, ],
+    },
+    {
+      'target_name': 'boringssl_bn_test',
+      'type': 'executable',
+      'dependencies': [
+        'boringssl.gyp:boringssl',
+      ],
+      'sources': [
+        'src/crypto/bn/bn_test.cc',
+        '<@(boringssl_test_support_sources)',
+      ],
+      # TODO(davidben): Fix size_t truncations in BoringSSL.
+      # https://crbug.com/429039
+      'msvs_disabled_warnings': [ 4267, ],
+    },
+    {
+      'target_name': 'boringssl_bytestring_test',
+      'type': 'executable',
+      'dependencies': [
+        'boringssl.gyp:boringssl',
+      ],
+      'sources': [
+        'src/crypto/bytestring/bytestring_test.cc',
+        '<@(boringssl_test_support_sources)',
+      ],
+      # TODO(davidben): Fix size_t truncations in BoringSSL.
+      # https://crbug.com/429039
+      'msvs_disabled_warnings': [ 4267, ],
+    },
+    {
+      'target_name': 'boringssl_aead_test',
+      'type': 'executable',
+      'dependencies': [
+        'boringssl.gyp:boringssl',
+      ],
+      'sources': [
+        'src/crypto/cipher/aead_test.cc',
+        '<@(boringssl_test_support_sources)',
+      ],
+      # TODO(davidben): Fix size_t truncations in BoringSSL.
+      # https://crbug.com/429039
+      'msvs_disabled_warnings': [ 4267, ],
+    },
+    {
+      'target_name': 'boringssl_cipher_test',
+      'type': 'executable',
+      'dependencies': [
+        'boringssl.gyp:boringssl',
+      ],
+      'sources': [
+        'src/crypto/cipher/cipher_test.cc',
+        '<@(boringssl_test_support_sources)',
+      ],
+      # TODO(davidben): Fix size_t truncations in BoringSSL.
+      # https://crbug.com/429039
+      'msvs_disabled_warnings': [ 4267, ],
+    },
+    {
+      'target_name': 'boringssl_cmac_test',
+      'type': 'executable',
+      'dependencies': [
+        'boringssl.gyp:boringssl',
+      ],
+      'sources': [
+        'src/crypto/cmac/cmac_test.cc',
+        '<@(boringssl_test_support_sources)',
+      ],
+      # TODO(davidben): Fix size_t truncations in BoringSSL.
+      # https://crbug.com/429039
+      'msvs_disabled_warnings': [ 4267, ],
+    },
+    {
+      'target_name': 'boringssl_constant_time_test',
+      'type': 'executable',
+      'dependencies': [
+        'boringssl.gyp:boringssl',
+      ],
+      'sources': [
+        'src/crypto/constant_time_test.c',
+        '<@(boringssl_test_support_sources)',
+      ],
+      # TODO(davidben): Fix size_t truncations in BoringSSL.
+      # https://crbug.com/429039
+      'msvs_disabled_warnings': [ 4267, ],
+    },
+    {
+      'target_name': 'boringssl_dh_test',
+      'type': 'executable',
+      'dependencies': [
+        'boringssl.gyp:boringssl',
+      ],
+      'sources': [
+        'src/crypto/dh/dh_test.cc',
+        '<@(boringssl_test_support_sources)',
+      ],
+      # TODO(davidben): Fix size_t truncations in BoringSSL.
+      # https://crbug.com/429039
+      'msvs_disabled_warnings': [ 4267, ],
+    },
+    {
+      'target_name': 'boringssl_digest_test',
+      'type': 'executable',
+      'dependencies': [
+        'boringssl.gyp:boringssl',
+      ],
+      'sources': [
+        'src/crypto/digest/digest_test.cc',
+        '<@(boringssl_test_support_sources)',
+      ],
+      # TODO(davidben): Fix size_t truncations in BoringSSL.
+      # https://crbug.com/429039
+      'msvs_disabled_warnings': [ 4267, ],
+    },
+    {
+      'target_name': 'boringssl_dsa_test',
+      'type': 'executable',
+      'dependencies': [
+        'boringssl.gyp:boringssl',
+      ],
+      'sources': [
+        'src/crypto/dsa/dsa_test.c',
+        '<@(boringssl_test_support_sources)',
+      ],
+      # TODO(davidben): Fix size_t truncations in BoringSSL.
+      # https://crbug.com/429039
+      'msvs_disabled_warnings': [ 4267, ],
+    },
+    {
+      'target_name': 'boringssl_ec_test',
+      'type': 'executable',
+      'dependencies': [
+        'boringssl.gyp:boringssl',
+      ],
+      'sources': [
+        'src/crypto/ec/ec_test.cc',
+        '<@(boringssl_test_support_sources)',
+      ],
+      # TODO(davidben): Fix size_t truncations in BoringSSL.
+      # https://crbug.com/429039
+      'msvs_disabled_warnings': [ 4267, ],
+    },
+    {
+      'target_name': 'boringssl_example_mul',
+      'type': 'executable',
+      'dependencies': [
+        'boringssl.gyp:boringssl',
+      ],
+      'sources': [
+        'src/crypto/ec/example_mul.c',
+        '<@(boringssl_test_support_sources)',
+      ],
+      # TODO(davidben): Fix size_t truncations in BoringSSL.
+      # https://crbug.com/429039
+      'msvs_disabled_warnings': [ 4267, ],
+    },
+    {
+      'target_name': 'boringssl_ecdsa_test',
+      'type': 'executable',
+      'dependencies': [
+        'boringssl.gyp:boringssl',
+      ],
+      'sources': [
+        'src/crypto/ecdsa/ecdsa_test.cc',
+        '<@(boringssl_test_support_sources)',
+      ],
+      # TODO(davidben): Fix size_t truncations in BoringSSL.
+      # https://crbug.com/429039
+      'msvs_disabled_warnings': [ 4267, ],
+    },
+    {
+      'target_name': 'boringssl_err_test',
+      'type': 'executable',
+      'dependencies': [
+        'boringssl.gyp:boringssl',
+      ],
+      'sources': [
+        'src/crypto/err/err_test.cc',
+        '<@(boringssl_test_support_sources)',
+      ],
+      # TODO(davidben): Fix size_t truncations in BoringSSL.
+      # https://crbug.com/429039
+      'msvs_disabled_warnings': [ 4267, ],
+    },
+    {
+      'target_name': 'boringssl_evp_extra_test',
+      'type': 'executable',
+      'dependencies': [
+        'boringssl.gyp:boringssl',
+      ],
+      'sources': [
+        'src/crypto/evp/evp_extra_test.cc',
+        '<@(boringssl_test_support_sources)',
+      ],
+      # TODO(davidben): Fix size_t truncations in BoringSSL.
+      # https://crbug.com/429039
+      'msvs_disabled_warnings': [ 4267, ],
+    },
+    {
+      'target_name': 'boringssl_evp_test',
+      'type': 'executable',
+      'dependencies': [
+        'boringssl.gyp:boringssl',
+      ],
+      'sources': [
+        'src/crypto/evp/evp_test.cc',
+        '<@(boringssl_test_support_sources)',
+      ],
+      # TODO(davidben): Fix size_t truncations in BoringSSL.
+      # https://crbug.com/429039
+      'msvs_disabled_warnings': [ 4267, ],
+    },
+    {
+      'target_name': 'boringssl_pbkdf_test',
+      'type': 'executable',
+      'dependencies': [
+        'boringssl.gyp:boringssl',
+      ],
+      'sources': [
+        'src/crypto/evp/pbkdf_test.cc',
+        '<@(boringssl_test_support_sources)',
+      ],
+      # TODO(davidben): Fix size_t truncations in BoringSSL.
+      # https://crbug.com/429039
+      'msvs_disabled_warnings': [ 4267, ],
+    },
+    {
+      'target_name': 'boringssl_hkdf_test',
+      'type': 'executable',
+      'dependencies': [
+        'boringssl.gyp:boringssl',
+      ],
+      'sources': [
+        'src/crypto/hkdf/hkdf_test.c',
+        '<@(boringssl_test_support_sources)',
+      ],
+      # TODO(davidben): Fix size_t truncations in BoringSSL.
+      # https://crbug.com/429039
+      'msvs_disabled_warnings': [ 4267, ],
+    },
+    {
+      'target_name': 'boringssl_hmac_test',
+      'type': 'executable',
+      'dependencies': [
+        'boringssl.gyp:boringssl',
+      ],
+      'sources': [
+        'src/crypto/hmac/hmac_test.cc',
+        '<@(boringssl_test_support_sources)',
+      ],
+      # TODO(davidben): Fix size_t truncations in BoringSSL.
+      # https://crbug.com/429039
+      'msvs_disabled_warnings': [ 4267, ],
+    },
+    {
+      'target_name': 'boringssl_lhash_test',
+      'type': 'executable',
+      'dependencies': [
+        'boringssl.gyp:boringssl',
+      ],
+      'sources': [
+        'src/crypto/lhash/lhash_test.c',
+        '<@(boringssl_test_support_sources)',
+      ],
+      # TODO(davidben): Fix size_t truncations in BoringSSL.
+      # https://crbug.com/429039
+      'msvs_disabled_warnings': [ 4267, ],
+    },
+    {
+      'target_name': 'boringssl_gcm_test',
+      'type': 'executable',
+      'dependencies': [
+        'boringssl.gyp:boringssl',
+      ],
+      'sources': [
+        'src/crypto/modes/gcm_test.c',
+        '<@(boringssl_test_support_sources)',
+      ],
+      # TODO(davidben): Fix size_t truncations in BoringSSL.
+      # https://crbug.com/429039
+      'msvs_disabled_warnings': [ 4267, ],
+    },
+    {
+      'target_name': 'boringssl_pkcs12_test',
+      'type': 'executable',
+      'dependencies': [
+        'boringssl.gyp:boringssl',
+      ],
+      'sources': [
+        'src/crypto/pkcs8/pkcs12_test.cc',
+        '<@(boringssl_test_support_sources)',
+      ],
+      # TODO(davidben): Fix size_t truncations in BoringSSL.
+      # https://crbug.com/429039
+      'msvs_disabled_warnings': [ 4267, ],
+    },
+    {
+      'target_name': 'boringssl_refcount_test',
+      'type': 'executable',
+      'dependencies': [
+        'boringssl.gyp:boringssl',
+      ],
+      'sources': [
+        'src/crypto/refcount_test.c',
+        '<@(boringssl_test_support_sources)',
+      ],
+      # TODO(davidben): Fix size_t truncations in BoringSSL.
+      # https://crbug.com/429039
+      'msvs_disabled_warnings': [ 4267, ],
+    },
+    {
+      'target_name': 'boringssl_rsa_test',
+      'type': 'executable',
+      'dependencies': [
+        'boringssl.gyp:boringssl',
+      ],
+      'sources': [
+        'src/crypto/rsa/rsa_test.cc',
+        '<@(boringssl_test_support_sources)',
+      ],
+      # TODO(davidben): Fix size_t truncations in BoringSSL.
+      # https://crbug.com/429039
+      'msvs_disabled_warnings': [ 4267, ],
+    },
+    {
+      'target_name': 'boringssl_thread_test',
+      'type': 'executable',
+      'dependencies': [
+        'boringssl.gyp:boringssl',
+      ],
+      'sources': [
+        'src/crypto/thread_test.c',
+        '<@(boringssl_test_support_sources)',
+      ],
+      # TODO(davidben): Fix size_t truncations in BoringSSL.
+      # https://crbug.com/429039
+      'msvs_disabled_warnings': [ 4267, ],
+    },
+    {
+      'target_name': 'boringssl_pkcs7_test',
+      'type': 'executable',
+      'dependencies': [
+        'boringssl.gyp:boringssl',
+      ],
+      'sources': [
+        'src/crypto/x509/pkcs7_test.c',
+        '<@(boringssl_test_support_sources)',
+      ],
+      # TODO(davidben): Fix size_t truncations in BoringSSL.
+      # https://crbug.com/429039
+      'msvs_disabled_warnings': [ 4267, ],
+    },
+    {
+      'target_name': 'boringssl_tab_test',
+      'type': 'executable',
+      'dependencies': [
+        'boringssl.gyp:boringssl',
+      ],
+      'sources': [
+        'src/crypto/x509v3/tab_test.c',
+        '<@(boringssl_test_support_sources)',
+      ],
+      # TODO(davidben): Fix size_t truncations in BoringSSL.
+      # https://crbug.com/429039
+      'msvs_disabled_warnings': [ 4267, ],
+    },
+    {
+      'target_name': 'boringssl_v3name_test',
+      'type': 'executable',
+      'dependencies': [
+        'boringssl.gyp:boringssl',
+      ],
+      'sources': [
+        'src/crypto/x509v3/v3name_test.c',
+        '<@(boringssl_test_support_sources)',
+      ],
+      # TODO(davidben): Fix size_t truncations in BoringSSL.
+      # https://crbug.com/429039
+      'msvs_disabled_warnings': [ 4267, ],
+    },
+    {
+      'target_name': 'boringssl_pqueue_test',
+      'type': 'executable',
+      'dependencies': [
+        'boringssl.gyp:boringssl',
+      ],
+      'sources': [
+        'src/ssl/pqueue/pqueue_test.c',
+        '<@(boringssl_test_support_sources)',
+      ],
+      # TODO(davidben): Fix size_t truncations in BoringSSL.
+      # https://crbug.com/429039
+      'msvs_disabled_warnings': [ 4267, ],
+    },
+    {
+      'target_name': 'boringssl_ssl_test',
+      'type': 'executable',
+      'dependencies': [
+        'boringssl.gyp:boringssl',
+      ],
+      'sources': [
+        'src/ssl/ssl_test.cc',
+        '<@(boringssl_test_support_sources)',
+      ],
+      # TODO(davidben): Fix size_t truncations in BoringSSL.
+      # https://crbug.com/429039
+      'msvs_disabled_warnings': [ 4267, ],
+    },
+  ],
+  'variables': {
+    'boringssl_test_support_sources': [
+      'src/crypto/test/file_test.cc',
+      'src/crypto/test/malloc.cc',
+    ],
+    'boringssl_test_targets': [
+      'boringssl_aead_test',
+      'boringssl_base64_test',
+      'boringssl_bio_test',
+      'boringssl_bn_test',
+      'boringssl_bytestring_test',
+      'boringssl_cipher_test',
+      'boringssl_cmac_test',
+      'boringssl_constant_time_test',
+      'boringssl_dh_test',
+      'boringssl_digest_test',
+      'boringssl_dsa_test',
+      'boringssl_ec_test',
+      'boringssl_ecdsa_test',
+      'boringssl_err_test',
+      'boringssl_evp_extra_test',
+      'boringssl_evp_test',
+      'boringssl_example_mul',
+      'boringssl_gcm_test',
+      'boringssl_hkdf_test',
+      'boringssl_hmac_test',
+      'boringssl_lhash_test',
+      'boringssl_pbkdf_test',
+      'boringssl_pkcs12_test',
+      'boringssl_pkcs7_test',
+      'boringssl_pqueue_test',
+      'boringssl_refcount_test',
+      'boringssl_rsa_test',
+      'boringssl_ssl_test',
+      'boringssl_tab_test',
+      'boringssl_thread_test',
+      'boringssl_v3name_test',
+    ],
+  }
+}
diff --git a/third_party/boringssl/err_data.c b/third_party/boringssl/err_data.c
new file mode 100644
index 0000000..27acc89
--- /dev/null
+++ b/third_party/boringssl/err_data.c
@@ -0,0 +1,2678 @@
+/* Copyright (c) 2015, Google Inc.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+ * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */
+
+ /* This file was generated by err_data_generate.go. */
+
+#include <openssl/base.h>
+#include <openssl/err.h>
+#include <openssl/type_check.h>
+
+
+OPENSSL_COMPILE_ASSERT(ERR_LIB_NONE == 1, library_values_changed_1);
+OPENSSL_COMPILE_ASSERT(ERR_LIB_SYS == 2, library_values_changed_2);
+OPENSSL_COMPILE_ASSERT(ERR_LIB_BN == 3, library_values_changed_3);
+OPENSSL_COMPILE_ASSERT(ERR_LIB_RSA == 4, library_values_changed_4);
+OPENSSL_COMPILE_ASSERT(ERR_LIB_DH == 5, library_values_changed_5);
+OPENSSL_COMPILE_ASSERT(ERR_LIB_EVP == 6, library_values_changed_6);
+OPENSSL_COMPILE_ASSERT(ERR_LIB_BUF == 7, library_values_changed_7);
+OPENSSL_COMPILE_ASSERT(ERR_LIB_OBJ == 8, library_values_changed_8);
+OPENSSL_COMPILE_ASSERT(ERR_LIB_PEM == 9, library_values_changed_9);
+OPENSSL_COMPILE_ASSERT(ERR_LIB_DSA == 10, library_values_changed_10);
+OPENSSL_COMPILE_ASSERT(ERR_LIB_X509 == 11, library_values_changed_11);
+OPENSSL_COMPILE_ASSERT(ERR_LIB_ASN1 == 12, library_values_changed_12);
+OPENSSL_COMPILE_ASSERT(ERR_LIB_CONF == 13, library_values_changed_13);
+OPENSSL_COMPILE_ASSERT(ERR_LIB_CRYPTO == 14, library_values_changed_14);
+OPENSSL_COMPILE_ASSERT(ERR_LIB_EC == 15, library_values_changed_15);
+OPENSSL_COMPILE_ASSERT(ERR_LIB_SSL == 16, library_values_changed_16);
+OPENSSL_COMPILE_ASSERT(ERR_LIB_BIO == 17, library_values_changed_17);
+OPENSSL_COMPILE_ASSERT(ERR_LIB_PKCS7 == 18, library_values_changed_18);
+OPENSSL_COMPILE_ASSERT(ERR_LIB_PKCS8 == 19, library_values_changed_19);
+OPENSSL_COMPILE_ASSERT(ERR_LIB_X509V3 == 20, library_values_changed_20);
+OPENSSL_COMPILE_ASSERT(ERR_LIB_RAND == 21, library_values_changed_21);
+OPENSSL_COMPILE_ASSERT(ERR_LIB_ENGINE == 22, library_values_changed_22);
+OPENSSL_COMPILE_ASSERT(ERR_LIB_OCSP == 23, library_values_changed_23);
+OPENSSL_COMPILE_ASSERT(ERR_LIB_UI == 24, library_values_changed_24);
+OPENSSL_COMPILE_ASSERT(ERR_LIB_COMP == 25, library_values_changed_25);
+OPENSSL_COMPILE_ASSERT(ERR_LIB_ECDSA == 26, library_values_changed_26);
+OPENSSL_COMPILE_ASSERT(ERR_LIB_ECDH == 27, library_values_changed_27);
+OPENSSL_COMPILE_ASSERT(ERR_LIB_HMAC == 28, library_values_changed_28);
+OPENSSL_COMPILE_ASSERT(ERR_LIB_DIGEST == 29, library_values_changed_29);
+OPENSSL_COMPILE_ASSERT(ERR_LIB_CIPHER == 30, library_values_changed_30);
+OPENSSL_COMPILE_ASSERT(ERR_LIB_USER == 31, library_values_changed_31);
+OPENSSL_COMPILE_ASSERT(ERR_LIB_HKDF == 32, library_values_changed_32);
+OPENSSL_COMPILE_ASSERT(ERR_NUM_LIBS == 33, library_values_changed_num);
+
+const uint32_t kOpenSSLFunctionValues[] = {
+    0xc32054b,
+    0xc328556,
+    0xc330561,
+    0xc33856e,
+    0xc340578,
+    0xc348582,
+    0xc350589,
+    0xc358595,
+    0xc36059c,
+    0xc3685b2,
+    0xc3705d1,
+    0xc3785e2,
+    0xc3805f2,
+    0xc38860c,
+    0xc390621,
+    0xc398630,
+    0xc3a0649,
+    0xc3a865d,
+    0xc3b0669,
+    0xc3b8670,
+    0xc3c0678,
+    0xc3c8690,
+    0xc3d0698,
+    0xc3d86a0,
+    0xc3e06ab,
+    0xc3e85c7,
+    0xc3f0686,
+    0x1032193d,
+    0x10329954,
+    0x1033196d,
+    0x10339983,
+    0x10341993,
+    0x103499bb,
+    0x103519c9,
+    0x103599d8,
+    0x103619f8,
+    0x10369a17,
+    0x10371a34,
+    0x10379a51,
+    0x10381a66,
+    0x10389a88,
+    0x10391aa7,
+    0x10399ac6,
+    0x103a1add,
+    0x103a9af4,
+    0x103b1afd,
+    0x103b9b08,
+    0x103c1b22,
+    0x103c9b2a,
+    0x103d1b32,
+    0x103d99a6,
+    0x103e1b4b,
+    0x103e9b5d,
+    0x103f1b70,
+    0x103f9b79,
+    0x10401b39,
+    0x14320a4e,
+    0x14328a5c,
+    0x14330a68,
+    0x14338a75,
+    0x18361224,
+    0x18371252,
+    0x18379263,
+    0x18381279,
+    0x1839129c,
+    0x183992b1,
+    0x183a12c3,
+    0x183c1307,
+    0x183c9315,
+    0x183d1328,
+    0x183d9338,
+    0x183e935e,
+    0x183f1371,
+    0x183f9380,
+    0x184093aa,
+    0x18411416,
+    0x18419427,
+    0x1842143a,
+    0x1842944c,
+    0x1843145e,
+    0x1843946f,
+    0x18441480,
+    0x18449491,
+    0x184514a2,
+    0x184594af,
+    0x184614d1,
+    0x184694e4,
+    0x184714f8,
+    0x18479505,
+    0x18481514,
+    0x18489523,
+    0x18491534,
+    0x18499550,
+    0x184a155e,
+    0x184a956f,
+    0x184b1580,
+    0x184b958e,
+    0x184c159e,
+    0x184c95c4,
+    0x184d15d3,
+    0x184d95e3,
+    0x184e15f3,
+    0x184e9602,
+    0x184f1541,
+    0x184f91b3,
+    0x18501156,
+    0x1850916e,
+    0x18511190,
+    0x185191a2,
+    0x185211d4,
+    0x185291ed,
+    0x185311fe,
+    0x18539214,
+    0x18541239,
+    0x1854928a,
+    0x185512d3,
+    0x185592e8,
+    0x185612f5,
+    0x1856934d,
+    0x18571390,
+    0x1857939d,
+    0x185813b9,
+    0x185893ca,
+    0x185913da,
+    0x185993ea,
+    0x185a13f9,
+    0x185a9408,
+    0x185b14bd,
+    0x1c3206b8,
+    0x1c3286c4,
+    0x1c3306cf,
+    0x1c3386db,
+    0x20321616,
+    0x20329621,
+    0x20331629,
+    0x20339635,
+    0x24321641,
+    0x2432964f,
+    0x24331661,
+    0x24339670,
+    0x24341683,
+    0x24349696,
+    0x243516ad,
+    0x243596c5,
+    0x243616d3,
+    0x243696eb,
+    0x243716f4,
+    0x24379706,
+    0x2438171a,
+    0x24389727,
+    0x2439173d,
+    0x24399755,
+    0x243a176d,
+    0x243a9777,
+    0x243b178c,
+    0x243b979a,
+    0x243c17b2,
+    0x243c97c9,
+    0x243d17d4,
+    0x243d97e2,
+    0x28320aae,
+    0x28328abd,
+    0x28330ac8,
+    0x28338acd,
+    0x28340ad8,
+    0x2c322b99,
+    0x2c32aba5,
+    0x2c332bb8,
+    0x2c33abc9,
+    0x2c342be2,
+    0x2c34ac0a,
+    0x2c352c21,
+    0x2c35ac3e,
+    0x2c362c5b,
+    0x2c36ac78,
+    0x2c372c91,
+    0x2c37acaa,
+    0x2c382cc0,
+    0x2c38acce,
+    0x2c392ce0,
+    0x2c39acfd,
+    0x2c3a2d1a,
+    0x2c3aad28,
+    0x2c3b2d46,
+    0x2c3bad64,
+    0x2c3c2d7f,
+    0x2c3cad93,
+    0x2c3d2da5,
+    0x2c3dadb5,
+    0x2c3e2dc3,
+    0x2c3eadd3,
+    0x2c3f2de3,
+    0x2c3fae22,
+    0x2c402e33,
+    0x2c40ae4e,
+    0x2c412e62,
+    0x2c41ae75,
+    0x2c422e94,
+    0x2c42aea8,
+    0x2c432ebb,
+    0x2c43aeca,
+    0x2c442ed9,
+    0x2c44aef0,
+    0x2c452f0b,
+    0x2c45af23,
+    0x2c462f37,
+    0x2c46af4a,
+    0x2c472f5b,
+    0x2c47af6c,
+    0x2c482f7d,
+    0x2c48af8e,
+    0x2c492f9d,
+    0x2c49afaa,
+    0x2c4a2fb7,
+    0x2c4aafc4,
+    0x2c4b2fcd,
+    0x2c4bafe1,
+    0x2c4c2ff0,
+    0x2c4caffe,
+    0x2c4d3020,
+    0x2c4db031,
+    0x2c4e3042,
+    0x2c4eb00d,
+    0x2c4f2bfb,
+    0x2c4fadfe,
+    0x2c502e10,
+    0x30320000,
+    0x30328018,
+    0x3033002c,
+    0x30338042,
+    0x3034005b,
+    0x3034806c,
+    0x3035007f,
+    0x3035808f,
+    0x3036009d,
+    0x303680b3,
+    0x303700c3,
+    0x303780d8,
+    0x303800e6,
+    0x303880f7,
+    0x30390103,
+    0x3039810c,
+    0x303a011d,
+    0x303a812d,
+    0x303b013a,
+    0x303b8146,
+    0x303c0157,
+    0x303c8165,
+    0x303d0176,
+    0x303d8188,
+    0x303e0199,
+    0x303e81a8,
+    0x303f01b9,
+    0x303f81cd,
+    0x304001df,
+    0x304081ec,
+    0x30410202,
+    0x30418215,
+    0x30420225,
+    0x30428239,
+    0x3043024a,
+    0x3043825a,
+    0x30440265,
+    0x3044826d,
+    0x3045027d,
+    0x30458294,
+    0x304602a1,
+    0x304682b7,
+    0x304702c9,
+    0x304782d5,
+    0x304802e1,
+    0x304882ef,
+    0x30490308,
+    0x30498316,
+    0x304a032b,
+    0x304a8343,
+    0x304b034d,
+    0x304b8361,
+    0x304c0372,
+    0x304c8382,
+    0x304d038f,
+    0x304d83a0,
+    0x304e03b0,
+    0x304e83c2,
+    0x304f03d3,
+    0x304f83e2,
+    0x305003f6,
+    0x30508404,
+    0x30510413,
+    0x3051841c,
+    0x343209d6,
+    0x343289e6,
+    0x343309f1,
+    0x343389fe,
+    0x38320a07,
+    0x38328a1f,
+    0x38330a32,
+    0x38338a3c,
+    0x3c320aeb,
+    0x3c328af9,
+    0x3c330b10,
+    0x3c338b24,
+    0x3c340b56,
+    0x3c348b67,
+    0x3c350b73,
+    0x3c358ba0,
+    0x3c360bb2,
+    0x3c368bdb,
+    0x3c370be8,
+    0x3c378bf5,
+    0x3c380c03,
+    0x3c388c10,
+    0x3c390c1d,
+    0x3c398c41,
+    0x3c3a0c51,
+    0x3c3a8c69,
+    0x3c3b0c7e,
+    0x3c3b8c93,
+    0x3c3c0ca0,
+    0x3c3c8cb3,
+    0x3c3d0cc6,
+    0x3c3d8cea,
+    0x3c3e0d12,
+    0x3c3e8d2b,
+    0x3c3f0d41,
+    0x3c3f8d4e,
+    0x3c400d61,
+    0x3c408d72,
+    0x3c410d83,
+    0x3c418d9c,
+    0x3c420db5,
+    0x3c428dcb,
+    0x3c430de8,
+    0x3c438dfe,
+    0x3c440e82,
+    0x3c448ea9,
+    0x3c450ec7,
+    0x3c458ee1,
+    0x3c460ef9,
+    0x3c468f11,
+    0x3c470f3c,
+    0x3c478f67,
+    0x3c480f88,
+    0x3c488fb1,
+    0x3c490fcc,
+    0x3c498ff5,
+    0x3c4a1002,
+    0x3c4a9019,
+    0x3c4b1030,
+    0x3c4b9059,
+    0x3c4c1069,
+    0x3c4c9075,
+    0x3c4d108d,
+    0x3c4d90a0,
+    0x3c4e10b1,
+    0x3c4e90c2,
+    0x3c4f10e8,
+    0x3c4f8adf,
+    0x3c500e1a,
+    0x3c508e3a,
+    0x3c510e67,
+    0x3c518fe7,
+    0x3c5210d2,
+    0x3c528b87,
+    0x3c530b3f,
+    0x40321bb9,
+    0x40329bf2,
+    0x40331c1a,
+    0x40339c32,
+    0x40341c50,
+    0x40349cb6,
+    0x40351ccd,
+    0x40359ce9,
+    0x40361d05,
+    0x40369d1f,
+    0x40371d3e,
+    0x40379d5d,
+    0x40381d75,
+    0x40389d92,
+    0x40391db5,
+    0x40399dd2,
+    0x403a1e07,
+    0x403a9e61,
+    0x403b1e76,
+    0x403b9e92,
+    0x403c1eac,
+    0x403c9eb7,
+    0x403d1eda,
+    0x403d9efe,
+    0x403e1f14,
+    0x403e9f1e,
+    0x403f1f2a,
+    0x403f9f3b,
+    0x40401f53,
+    0x40409f5b,
+    0x40411f64,
+    0x40419f6d,
+    0x40421f95,
+    0x40429fa9,
+    0x40431fb4,
+    0x40439fc0,
+    0x40442014,
+    0x4044a020,
+    0x4045202d,
+    0x4045a040,
+    0x40462058,
+    0x4046a070,
+    0x40472086,
+    0x4047a0a1,
+    0x404820bc,
+    0x4048a0d0,
+    0x404920e9,
+    0x4049a102,
+    0x404a211c,
+    0x404aa126,
+    0x404b1e29,
+    0x404b9e48,
+    0x404c2136,
+    0x404ca144,
+    0x404d2151,
+    0x404da165,
+    0x404e217d,
+    0x404ea18b,
+    0x404f21b5,
+    0x404fa1cc,
+    0x405021de,
+    0x4050a20f,
+    0x40512240,
+    0x4051a255,
+    0x40522278,
+    0x4052a298,
+    0x405322ad,
+    0x4053a2bd,
+    0x4054a2c9,
+    0x405522df,
+    0x4055a31f,
+    0x4056232c,
+    0x4056a336,
+    0x40572344,
+    0x4057a35f,
+    0x4058237a,
+    0x4058a399,
+    0x405923ae,
+    0x4059a3c3,
+    0x405a23e0,
+    0x405aa3f4,
+    0x405b2410,
+    0x405ba426,
+    0x405c2443,
+    0x405ca455,
+    0x405d246c,
+    0x405da47d,
+    0x405e2499,
+    0x405ea4ad,
+    0x405f24bd,
+    0x405fa4d9,
+    0x406024ee,
+    0x4060a504,
+    0x40612521,
+    0x4061a53a,
+    0x40622564,
+    0x4062a56d,
+    0x4063257d,
+    0x4063a5b6,
+    0x406425cc,
+    0x4064a5ea,
+    0x406525ff,
+    0x4065a61c,
+    0x40662633,
+    0x4066a651,
+    0x4067266e,
+    0x4067a685,
+    0x406826a3,
+    0x4068a6ba,
+    0x406926d2,
+    0x4069a6e3,
+    0x406a26f6,
+    0x406aa709,
+    0x406b271d,
+    0x406ba741,
+    0x406c275c,
+    0x406ca77d,
+    0x406d27a1,
+    0x406da7bc,
+    0x406e27dd,
+    0x406ea7f2,
+    0x406f280b,
+    0x406fa818,
+    0x40702826,
+    0x4070a833,
+    0x40712850,
+    0x4071a870,
+    0x4072288b,
+    0x4072a8a4,
+    0x407328bb,
+    0x4073a8d5,
+    0x407428f9,
+    0x4074a90f,
+    0x40752923,
+    0x4075a938,
+    0x40762952,
+    0x4076a964,
+    0x40772979,
+    0x4077a99f,
+    0x407829bc,
+    0x4078a9df,
+    0x40792a05,
+    0x4079aa22,
+    0x407a2a45,
+    0x407aaa61,
+    0x407b2a7d,
+    0x407baa8f,
+    0x407c2a9c,
+    0x407e2aa9,
+    0x407eaabf,
+    0x407f2ad7,
+    0x407faaea,
+    0x40802aff,
+    0x4080ab18,
+    0x40812b36,
+    0x4081ab56,
+    0x40822b5f,
+    0x4082ab7b,
+    0x40832b84,
+    0x4083a19a,
+    0x40842229,
+    0x4084a1f9,
+    0x408525a5,
+    0x4085a589,
+    0x40861c8e,
+    0x40869ca1,
+    0x40871ff4,
+    0x4087a003,
+    0x40881bfe,
+    0x40889f7d,
+    0x40891fdb,
+    0x4089a54d,
+    0x408a1b84,
+    0x408a9b95,
+    0x408b1ba7,
+    0x408ba266,
+    0x408c1df0,
+    0x408c9e17,
+    0x408d22fd,
+    0x408d9bd3,
+    0x408e1c6f,
+    0x4432042a,
+    0x4432843c,
+    0x44330445,
+    0x4433844d,
+    0x4434045a,
+    0x44348475,
+    0x44350490,
+    0x443584b0,
+    0x443604cc,
+    0x443684ed,
+    0x443704f4,
+    0x44378502,
+    0x4438050c,
+    0x44388518,
+    0x44390522,
+    0x4439852d,
+    0x443a0537,
+    0x443a8541,
+    0x443b046a,
+    0x4c3217ea,
+    0x4c3297f9,
+    0x4c331808,
+    0x4c339821,
+    0x4c34183c,
+    0x4c349858,
+    0x4c35186a,
+    0x4c359878,
+    0x4c36188d,
+    0x4c36989e,
+    0x4c3718ac,
+    0x4c3798ba,
+    0x4c3818cc,
+    0x4c3898dc,
+    0x4c3918e6,
+    0x4c3998fe,
+    0x4c3a1916,
+    0x4c3a9929,
+    0x50323053,
+    0x5032b068,
+    0x50333079,
+    0x5033b08c,
+    0x5034309d,
+    0x5034b0b0,
+    0x503530bf,
+    0x5035b0d4,
+    0x503630e4,
+    0x5036b0f3,
+    0x50373104,
+    0x5037b114,
+    0x50383125,
+    0x5038b138,
+    0x5039314a,
+    0x5039b160,
+    0x503a3172,
+    0x503ab183,
+    0x503b3194,
+    0x503bb1a5,
+    0x503c31b0,
+    0x503cb1bc,
+    0x503d31c7,
+    0x503db1d2,
+    0x503e31df,
+    0x503eb1f4,
+    0x503f3202,
+    0x503fb216,
+    0x50403229,
+    0x5040b23a,
+    0x50413254,
+    0x5041b263,
+    0x5042326c,
+    0x5042b27b,
+    0x5043328d,
+    0x5043b299,
+    0x504432a1,
+    0x5044b2b4,
+    0x504532c5,
+    0x5045b2db,
+    0x504632e7,
+    0x5046b2fb,
+    0x50473309,
+    0x5047b31d,
+    0x50483337,
+    0x5048b34b,
+    0x50493361,
+    0x5049b378,
+    0x504a338a,
+    0x504ab39e,
+    0x504b33b3,
+    0x504bb3ca,
+    0x504c33de,
+    0x504cb3e7,
+    0x504d33ef,
+    0x504db3fe,
+    0x504e340e,
+    0x68321109,
+    0x6832911a,
+    0x6833112a,
+    0x68339138,
+    0x68341145,
+    0x6c3210f8,
+    0x74320a89,
+    0x74328a9b,
+    0x783206e8,
+    0x7832871b,
+    0x7833072d,
+    0x7833873f,
+    0x78340753,
+    0x78348767,
+    0x78350785,
+    0x78358797,
+    0x783607ab,
+    0x78368819,
+    0x7837082b,
+    0x7837883d,
+    0x7838084f,
+    0x78388866,
+    0x7839087d,
+    0x78398894,
+    0x783a08b0,
+    0x783a88cc,
+    0x783b08e8,
+    0x783b88fe,
+    0x783c0914,
+    0x783c892a,
+    0x783d0947,
+    0x783d8956,
+    0x783e0965,
+    0x783e8974,
+    0x783f0990,
+    0x783f899e,
+    0x784009ac,
+    0x784089ba,
+    0x784109c7,
+    0x784186fa,
+    0x784207bf,
+    0x784287dd,
+    0x784307fb,
+    0x80321611,
+};
+
+const size_t kOpenSSLFunctionValuesLen = sizeof(kOpenSSLFunctionValues) / sizeof(kOpenSSLFunctionValues[0]);
+
+const char kOpenSSLFunctionStringData[] =
+    "ASN1_BIT_STRING_set_bit\0"
+    "ASN1_ENUMERATED_set\0"
+    "ASN1_ENUMERATED_to_BN\0"
+    "ASN1_GENERALIZEDTIME_adj\0"
+    "ASN1_INTEGER_set\0"
+    "ASN1_INTEGER_to_BN\0"
+    "ASN1_OBJECT_new\0"
+    "ASN1_PCTX_new\0"
+    "ASN1_STRING_TABLE_add\0"
+    "ASN1_STRING_set\0"
+    "ASN1_STRING_type_new\0"
+    "ASN1_TIME_adj\0"
+    "ASN1_UTCTIME_adj\0"
+    "ASN1_d2i_fp\0"
+    "ASN1_dup\0"
+    "ASN1_generate_v3\0"
+    "ASN1_get_object\0"
+    "ASN1_i2d_bio\0"
+    "ASN1_i2d_fp\0"
+    "ASN1_item_d2i_fp\0"
+    "ASN1_item_dup\0"
+    "ASN1_item_ex_d2i\0"
+    "ASN1_item_i2d_bio\0"
+    "ASN1_item_i2d_fp\0"
+    "ASN1_item_pack\0"
+    "ASN1_item_unpack\0"
+    "ASN1_mbstring_ncopy\0"
+    "ASN1_template_new\0"
+    "BIO_new_NDEF\0"
+    "BN_to_ASN1_ENUMERATED\0"
+    "BN_to_ASN1_INTEGER\0"
+    "a2d_ASN1_OBJECT\0"
+    "a2i_ASN1_ENUMERATED\0"
+    "a2i_ASN1_INTEGER\0"
+    "a2i_ASN1_STRING\0"
+    "append_exp\0"
+    "asn1_cb\0"
+    "asn1_check_tlen\0"
+    "asn1_collate_primitive\0"
+    "asn1_collect\0"
+    "asn1_d2i_ex_primitive\0"
+    "asn1_d2i_read_bio\0"
+    "asn1_do_adb\0"
+    "asn1_ex_c2i\0"
+    "asn1_find_end\0"
+    "asn1_item_ex_combine_new\0"
+    "asn1_str2type\0"
+    "asn1_template_ex_d2i\0"
+    "asn1_template_noexp_d2i\0"
+    "bitstr_cb\0"
+    "c2i_ASN1_BIT_STRING\0"
+    "c2i_ASN1_INTEGER\0"
+    "c2i_ASN1_OBJECT\0"
+    "collect_data\0"
+    "d2i_ASN1_BOOLEAN\0"
+    "d2i_ASN1_OBJECT\0"
+    "d2i_ASN1_UINTEGER\0"
+    "d2i_ASN1_UTCTIME\0"
+    "d2i_ASN1_bytes\0"
+    "d2i_ASN1_type_bytes\0"
+    "i2d_ASN1_TIME\0"
+    "i2d_PrivateKey\0"
+    "long_c2i\0"
+    "parse_tagging\0"
+    "BIO_callback_ctrl\0"
+    "BIO_ctrl\0"
+    "BIO_new\0"
+    "BIO_new_file\0"
+    "BIO_new_mem_buf\0"
+    "BIO_printf\0"
+    "BIO_zero_copy_get_read_buf\0"
+    "BIO_zero_copy_get_read_buf_done\0"
+    "BIO_zero_copy_get_write_buf\0"
+    "BIO_zero_copy_get_write_buf_done\0"
+    "bio_io\0"
+    "bio_make_pair\0"
+    "bio_write\0"
+    "buffer_ctrl\0"
+    "conn_ctrl\0"
+    "conn_state\0"
+    "file_ctrl\0"
+    "file_read\0"
+    "mem_write\0"
+    "BN_CTX_get\0"
+    "BN_CTX_new\0"
+    "BN_CTX_start\0"
+    "BN_bn2dec\0"
+    "BN_bn2hex\0"
+    "BN_div\0"
+    "BN_div_recp\0"
+    "BN_exp\0"
+    "BN_generate_dsa_nonce\0"
+    "BN_generate_prime_ex\0"
+    "BN_lshift\0"
+    "BN_mod_exp2_mont\0"
+    "BN_mod_exp_mont\0"
+    "BN_mod_exp_mont_consttime\0"
+    "BN_mod_exp_mont_word\0"
+    "BN_mod_inverse\0"
+    "BN_mod_inverse_no_branch\0"
+    "BN_mod_lshift_quick\0"
+    "BN_mod_sqrt\0"
+    "BN_new\0"
+    "BN_rand\0"
+    "BN_rand_range\0"
+    "BN_rshift\0"
+    "BN_sqrt\0"
+    "BN_usub\0"
+    "bn_wexpand\0"
+    "mod_exp_recp\0"
+    "BUF_MEM_new\0"
+    "BUF_memdup\0"
+    "BUF_strndup\0"
+    "buf_mem_grow\0"
+    "EVP_AEAD_CTX_init\0"
+    "EVP_AEAD_CTX_init_with_direction\0"
+    "EVP_AEAD_CTX_open\0"
+    "EVP_AEAD_CTX_seal\0"
+    "EVP_CIPHER_CTX_copy\0"
+    "EVP_CIPHER_CTX_ctrl\0"
+    "EVP_CIPHER_CTX_set_key_length\0"
+    "EVP_CipherInit_ex\0"
+    "EVP_DecryptFinal_ex\0"
+    "EVP_EncryptFinal_ex\0"
+    "aead_aes_ctr_hmac_sha256_init\0"
+    "aead_aes_ctr_hmac_sha256_open\0"
+    "aead_aes_ctr_hmac_sha256_seal\0"
+    "aead_aes_gcm_init\0"
+    "aead_aes_gcm_open\0"
+    "aead_aes_gcm_seal\0"
+    "aead_aes_key_wrap_init\0"
+    "aead_aes_key_wrap_open\0"
+    "aead_aes_key_wrap_seal\0"
+    "aead_chacha20_poly1305_init\0"
+    "aead_chacha20_poly1305_open\0"
+    "aead_chacha20_poly1305_seal\0"
+    "aead_rc4_md5_tls_init\0"
+    "aead_rc4_md5_tls_open\0"
+    "aead_rc4_md5_tls_seal\0"
+    "aead_ssl3_ensure_cipher_init\0"
+    "aead_ssl3_init\0"
+    "aead_ssl3_open\0"
+    "aead_ssl3_seal\0"
+    "aead_tls_ensure_cipher_init\0"
+    "aead_tls_init\0"
+    "aead_tls_open\0"
+    "aead_tls_seal\0"
+    "aes_init_key\0"
+    "aesni_init_key\0"
+    "CONF_parse_list\0"
+    "NCONF_load\0"
+    "def_load_bio\0"
+    "str_copy\0"
+    "CRYPTO_get_ex_new_index\0"
+    "CRYPTO_set_ex_data\0"
+    "get_class\0"
+    "get_func_pointers\0"
+    "DH_new_method\0"
+    "compute_key\0"
+    "generate_key\0"
+    "generate_parameters\0"
+    "EVP_DigestInit_ex\0"
+    "EVP_MD_CTX_copy_ex\0"
+    "DSA_new_method\0"
+    "dsa_sig_cb\0"
+    "sign\0"
+    "sign_setup\0"
+    "verify\0"
+    "BN_to_felem\0"
+    "EC_GROUP_copy\0"
+    "EC_GROUP_get_curve_GFp\0"
+    "EC_GROUP_get_degree\0"
+    "EC_GROUP_new_by_curve_name\0"
+    "EC_GROUP_new_curve_GFp\0"
+    "EC_KEY_check_key\0"
+    "EC_KEY_copy\0"
+    "EC_KEY_generate_key\0"
+    "EC_KEY_new_by_curve_name\0"
+    "EC_KEY_new_method\0"
+    "EC_KEY_set_public_key_affine_coordinates\0"
+    "EC_POINT_add\0"
+    "EC_POINT_cmp\0"
+    "EC_POINT_copy\0"
+    "EC_POINT_dbl\0"
+    "EC_POINT_dup\0"
+    "EC_POINT_get_affine_coordinates_GFp\0"
+    "EC_POINT_invert\0"
+    "EC_POINT_is_at_infinity\0"
+    "EC_POINT_is_on_curve\0"
+    "EC_POINT_make_affine\0"
+    "EC_POINT_new\0"
+    "EC_POINT_oct2point\0"
+    "EC_POINT_point2oct\0"
+    "EC_POINT_set_affine_coordinates_GFp\0"
+    "EC_POINT_set_compressed_coordinates_GFp\0"
+    "EC_POINT_set_to_infinity\0"
+    "EC_POINTs_make_affine\0"
+    "compute_wNAF\0"
+    "d2i_ECPKParameters\0"
+    "d2i_ECParameters\0"
+    "d2i_ECPrivateKey\0"
+    "ec_GFp_mont_field_decode\0"
+    "ec_GFp_mont_field_encode\0"
+    "ec_GFp_mont_field_mul\0"
+    "ec_GFp_mont_field_set_to_one\0"
+    "ec_GFp_mont_field_sqr\0"
+    "ec_GFp_mont_group_set_curve\0"
+    "ec_GFp_nistp256_group_set_curve\0"
+    "ec_GFp_nistp256_point_get_affine_coordinates\0"
+    "ec_GFp_nistp256_points_mul\0"
+    "ec_GFp_simple_group_check_discriminant\0"
+    "ec_GFp_simple_group_set_curve\0"
+    "ec_GFp_simple_make_affine\0"
+    "ec_GFp_simple_oct2point\0"
+    "ec_GFp_simple_point2oct\0"
+    "ec_GFp_simple_point_get_affine_coordinates\0"
+    "ec_GFp_simple_point_set_affine_coordinates\0"
+    "ec_GFp_simple_points_make_affine\0"
+    "ec_GFp_simple_set_compressed_coordinates\0"
+    "ec_asn1_group2pkparameters\0"
+    "ec_asn1_pkparameters2group\0"
+    "ec_group_copy\0"
+    "ec_group_new\0"
+    "ec_group_new_curve_GFp\0"
+    "ec_group_new_from_data\0"
+    "ec_point_set_Jprojective_coordinates_GFp\0"
+    "ec_pre_comp_new\0"
+    "ec_wNAF_mul\0"
+    "ec_wNAF_precompute_mult\0"
+    "i2d_ECPKParameters\0"
+    "i2d_ECParameters\0"
+    "i2d_ECPrivateKey\0"
+    "i2o_ECPublicKey\0"
+    "nistp256_pre_comp_new\0"
+    "o2i_ECPublicKey\0"
+    "ECDH_compute_key\0"
+    "ECDSA_do_sign_ex\0"
+    "ECDSA_do_verify\0"
+    "ECDSA_sign_ex\0"
+    "digest_to_bn\0"
+    "ecdsa_sign_setup\0"
+    "EVP_DigestSignAlgorithm\0"
+    "EVP_DigestVerifyInitFromAlgorithm\0"
+    "EVP_PKEY_CTX_ctrl\0"
+    "EVP_PKEY_CTX_dup\0"
+    "EVP_PKEY_CTX_get0_rsa_oaep_label\0"
+    "EVP_PKEY_copy_parameters\0"
+    "EVP_PKEY_decrypt\0"
+    "EVP_PKEY_decrypt_init\0"
+    "EVP_PKEY_derive\0"
+    "EVP_PKEY_derive_init\0"
+    "EVP_PKEY_derive_set_peer\0"
+    "EVP_PKEY_encrypt\0"
+    "EVP_PKEY_encrypt_init\0"
+    "EVP_PKEY_get1_DH\0"
+    "EVP_PKEY_get1_DSA\0"
+    "EVP_PKEY_get1_EC_KEY\0"
+    "EVP_PKEY_get1_RSA\0"
+    "EVP_PKEY_keygen\0"
+    "EVP_PKEY_keygen_init\0"
+    "EVP_PKEY_new\0"
+    "EVP_PKEY_set_type\0"
+    "EVP_PKEY_sign\0"
+    "EVP_PKEY_sign_init\0"
+    "EVP_PKEY_verify\0"
+    "EVP_PKEY_verify_init\0"
+    "check_padding_md\0"
+    "d2i_AutoPrivateKey\0"
+    "d2i_PrivateKey\0"
+    "do_EC_KEY_print\0"
+    "do_dsa_print\0"
+    "do_rsa_print\0"
+    "do_sigver_init\0"
+    "dsa_param_decode\0"
+    "dsa_priv_decode\0"
+    "dsa_priv_encode\0"
+    "dsa_pub_decode\0"
+    "dsa_pub_encode\0"
+    "dsa_sig_print\0"
+    "eckey_param2type\0"
+    "eckey_param_decode\0"
+    "eckey_priv_decode\0"
+    "eckey_priv_encode\0"
+    "eckey_pub_decode\0"
+    "eckey_pub_encode\0"
+    "eckey_type2param\0"
+    "evp_pkey_ctx_new\0"
+    "hmac_signctx\0"
+    "i2d_PublicKey\0"
+    "old_dsa_priv_decode\0"
+    "old_ec_priv_decode\0"
+    "old_rsa_priv_decode\0"
+    "pkey_ec_ctrl\0"
+    "pkey_ec_derive\0"
+    "pkey_ec_keygen\0"
+    "pkey_ec_paramgen\0"
+    "pkey_ec_sign\0"
+    "pkey_hmac_ctrl\0"
+    "pkey_rsa_ctrl\0"
+    "pkey_rsa_decrypt\0"
+    "pkey_rsa_encrypt\0"
+    "pkey_rsa_sign\0"
+    "rsa_algor_to_md\0"
+    "rsa_digest_verify_init_from_algorithm\0"
+    "rsa_mgf1_to_md\0"
+    "rsa_priv_decode\0"
+    "rsa_priv_encode\0"
+    "rsa_pss_to_ctx\0"
+    "rsa_pub_decode\0"
+    "HKDF\0"
+    "OBJ_create\0"
+    "OBJ_dup\0"
+    "OBJ_nid2obj\0"
+    "OBJ_txt2obj\0"
+    "PEM_ASN1_read\0"
+    "PEM_ASN1_read_bio\0"
+    "PEM_ASN1_write\0"
+    "PEM_ASN1_write_bio\0"
+    "PEM_X509_INFO_read\0"
+    "PEM_X509_INFO_read_bio\0"
+    "PEM_X509_INFO_write_bio\0"
+    "PEM_do_header\0"
+    "PEM_get_EVP_CIPHER_INFO\0"
+    "PEM_read\0"
+    "PEM_read_DHparams\0"
+    "PEM_read_PrivateKey\0"
+    "PEM_read_bio\0"
+    "PEM_read_bio_DHparams\0"
+    "PEM_read_bio_Parameters\0"
+    "PEM_read_bio_PrivateKey\0"
+    "PEM_write\0"
+    "PEM_write_PrivateKey\0"
+    "PEM_write_bio\0"
+    "d2i_PKCS8PrivateKey_bio\0"
+    "d2i_PKCS8PrivateKey_fp\0"
+    "do_pk8pkey\0"
+    "do_pk8pkey_fp\0"
+    "load_iv\0"
+    "EVP_PKCS82PKEY\0"
+    "EVP_PKEY2PKCS8\0"
+    "PKCS12_get_key_and_certs\0"
+    "PKCS12_handle_content_info\0"
+    "PKCS12_handle_content_infos\0"
+    "PKCS5_pbe2_set_iv\0"
+    "PKCS5_pbe_set\0"
+    "PKCS5_pbe_set0_algor\0"
+    "PKCS5_pbkdf2_set\0"
+    "PKCS8_decrypt\0"
+    "PKCS8_encrypt\0"
+    "PKCS8_encrypt_pbe\0"
+    "pbe_cipher_init\0"
+    "pbe_crypt\0"
+    "pkcs12_item_decrypt_d2i\0"
+    "pkcs12_item_i2d_encrypt\0"
+    "pkcs12_key_gen_raw\0"
+    "pkcs12_pbe_keyivgen\0"
+    "BN_BLINDING_convert_ex\0"
+    "BN_BLINDING_create_param\0"
+    "BN_BLINDING_invert_ex\0"
+    "BN_BLINDING_new\0"
+    "BN_BLINDING_update\0"
+    "RSA_add_pkcs1_prefix\0"
+    "RSA_check_key\0"
+    "RSA_new_method\0"
+    "RSA_padding_add_PKCS1_OAEP_mgf1\0"
+    "RSA_padding_add_PKCS1_PSS_mgf1\0"
+    "RSA_padding_add_PKCS1_type_1\0"
+    "RSA_padding_add_PKCS1_type_2\0"
+    "RSA_padding_add_none\0"
+    "RSA_padding_check_PKCS1_OAEP_mgf1\0"
+    "RSA_padding_check_PKCS1_type_1\0"
+    "RSA_padding_check_PKCS1_type_2\0"
+    "RSA_padding_check_none\0"
+    "RSA_recover_crt_params\0"
+    "RSA_sign\0"
+    "RSA_verify\0"
+    "RSA_verify_PKCS1_PSS_mgf1\0"
+    "decrypt\0"
+    "encrypt\0"
+    "keygen\0"
+    "keygen_multiprime\0"
+    "private_transform\0"
+    "rsa_setup_blinding\0"
+    "sign_raw\0"
+    "verify_raw\0"
+    "SSL_AEAD_CTX_new\0"
+    "SSL_AEAD_CTX_open\0"
+    "SSL_AEAD_CTX_seal\0"
+    "SSL_CTX_check_private_key\0"
+    "SSL_CTX_get_tlsext_ticket_keys\0"
+    "SSL_CTX_new\0"
+    "SSL_CTX_set1_tls_channel_id\0"
+    "SSL_CTX_set_cipher_list\0"
+    "SSL_CTX_set_cipher_list_tls11\0"
+    "SSL_CTX_set_session_id_context\0"
+    "SSL_CTX_set_tlsext_ticket_keys\0"
+    "SSL_CTX_set_tmp_dh\0"
+    "SSL_CTX_set_tmp_ecdh\0"
+    "SSL_CTX_use_PrivateKey\0"
+    "SSL_CTX_use_PrivateKey_ASN1\0"
+    "SSL_CTX_use_PrivateKey_file\0"
+    "SSL_CTX_use_RSAPrivateKey\0"
+    "SSL_CTX_use_RSAPrivateKey_ASN1\0"
+    "SSL_CTX_use_RSAPrivateKey_file\0"
+    "SSL_CTX_use_certificate\0"
+    "SSL_CTX_use_certificate_ASN1\0"
+    "SSL_CTX_use_certificate_chain_file\0"
+    "SSL_CTX_use_certificate_file\0"
+    "SSL_CTX_use_psk_identity_hint\0"
+    "SSL_SESSION_from_bytes\0"
+    "SSL_SESSION_new\0"
+    "SSL_SESSION_parse\0"
+    "SSL_SESSION_parse_octet_string\0"
+    "SSL_SESSION_parse_string\0"
+    "SSL_SESSION_print_fp\0"
+    "SSL_SESSION_set1_id_context\0"
+    "SSL_SESSION_to_bytes_full\0"
+    "SSL_accept\0"
+    "SSL_add_dir_cert_subjects_to_stack\0"
+    "SSL_add_file_cert_subjects_to_stack\0"
+    "SSL_check_private_key\0"
+    "SSL_clear\0"
+    "SSL_connect\0"
+    "SSL_do_handshake\0"
+    "SSL_load_client_CA_file\0"
+    "SSL_new\0"
+    "SSL_peek\0"
+    "SSL_read\0"
+    "SSL_renegotiate\0"
+    "SSL_set1_tls_channel_id\0"
+    "SSL_set_cipher_list\0"
+    "SSL_set_fd\0"
+    "SSL_set_rfd\0"
+    "SSL_set_session_id_context\0"
+    "SSL_set_tlsext_host_name\0"
+    "SSL_set_tmp_dh\0"
+    "SSL_set_tmp_ecdh\0"
+    "SSL_set_wfd\0"
+    "SSL_shutdown\0"
+    "SSL_use_PrivateKey\0"
+    "SSL_use_PrivateKey_ASN1\0"
+    "SSL_use_PrivateKey_file\0"
+    "SSL_use_RSAPrivateKey\0"
+    "SSL_use_RSAPrivateKey_ASN1\0"
+    "SSL_use_RSAPrivateKey_file\0"
+    "SSL_use_certificate\0"
+    "SSL_use_certificate_ASN1\0"
+    "SSL_use_certificate_file\0"
+    "SSL_use_psk_identity_hint\0"
+    "SSL_write\0"
+    "d2i_SSL_SESSION\0"
+    "do_ssl3_write\0"
+    "dtls1_accept\0"
+    "dtls1_buffer_record\0"
+    "dtls1_check_timeout_num\0"
+    "dtls1_connect\0"
+    "dtls1_do_write\0"
+    "dtls1_get_buffered_message\0"
+    "dtls1_get_hello_verify\0"
+    "dtls1_get_message\0"
+    "dtls1_get_message_fragment\0"
+    "dtls1_hm_fragment_new\0"
+    "dtls1_preprocess_fragment\0"
+    "dtls1_process_fragment\0"
+    "dtls1_process_record\0"
+    "dtls1_read_bytes\0"
+    "dtls1_seal_record\0"
+    "dtls1_send_hello_verify_request\0"
+    "dtls1_write_app_data\0"
+    "i2d_SSL_SESSION\0"
+    "ssl3_accept\0"
+    "ssl3_cert_verify_hash\0"
+    "ssl3_check_cert_and_algorithm\0"
+    "ssl3_check_certificate_for_cipher\0"
+    "ssl3_connect\0"
+    "ssl3_ctrl\0"
+    "ssl3_ctx_ctrl\0"
+    "ssl3_digest_cached_records\0"
+    "ssl3_do_change_cipher_spec\0"
+    "ssl3_expect_change_cipher_spec\0"
+    "ssl3_get_cert_status\0"
+    "ssl3_get_cert_verify\0"
+    "ssl3_get_certificate_request\0"
+    "ssl3_get_channel_id\0"
+    "ssl3_get_client_certificate\0"
+    "ssl3_get_client_hello\0"
+    "ssl3_get_client_key_exchange\0"
+    "ssl3_get_finished\0"
+    "ssl3_get_initial_bytes\0"
+    "ssl3_get_message\0"
+    "ssl3_get_new_session_ticket\0"
+    "ssl3_get_next_proto\0"
+    "ssl3_get_record\0"
+    "ssl3_get_server_certificate\0"
+    "ssl3_get_server_done\0"
+    "ssl3_get_server_hello\0"
+    "ssl3_get_server_key_exchange\0"
+    "ssl3_get_v2_client_hello\0"
+    "ssl3_handshake_mac\0"
+    "ssl3_output_cert_chain\0"
+    "ssl3_prf\0"
+    "ssl3_read_bytes\0"
+    "ssl3_read_n\0"
+    "ssl3_record_sequence_update\0"
+    "ssl3_seal_record\0"
+    "ssl3_send_cert_verify\0"
+    "ssl3_send_certificate_request\0"
+    "ssl3_send_channel_id\0"
+    "ssl3_send_client_certificate\0"
+    "ssl3_send_client_hello\0"
+    "ssl3_send_client_key_exchange\0"
+    "ssl3_send_server_certificate\0"
+    "ssl3_send_server_hello\0"
+    "ssl3_send_server_key_exchange\0"
+    "ssl3_setup_read_buffer\0"
+    "ssl3_setup_write_buffer\0"
+    "ssl3_write_bytes\0"
+    "ssl3_write_pending\0"
+    "ssl_add_cert_chain\0"
+    "ssl_add_cert_to_buf\0"
+    "ssl_add_clienthello_renegotiate_ext\0"
+    "ssl_add_clienthello_tlsext\0"
+    "ssl_add_clienthello_use_srtp_ext\0"
+    "ssl_add_serverhello_renegotiate_ext\0"
+    "ssl_add_serverhello_tlsext\0"
+    "ssl_add_serverhello_use_srtp_ext\0"
+    "ssl_build_cert_chain\0"
+    "ssl_bytes_to_cipher_list\0"
+    "ssl_cert_dup\0"
+    "ssl_cert_inst\0"
+    "ssl_cert_new\0"
+    "ssl_check_serverhello_tlsext\0"
+    "ssl_check_srvr_ecc_cert_and_alg\0"
+    "ssl_cipher_process_rulestr\0"
+    "ssl_cipher_strength_sort\0"
+    "ssl_create_cipher_list\0"
+    "ssl_ctx_log_master_secret\0"
+    "ssl_ctx_log_rsa_client_key_exchange\0"
+    "ssl_ctx_make_profiles\0"
+    "ssl_get_new_session\0"
+    "ssl_get_prev_session\0"
+    "ssl_get_server_cert_index\0"
+    "ssl_get_sign_pkey\0"
+    "ssl_init_wbio_buffer\0"
+    "ssl_parse_clienthello_renegotiate_ext\0"
+    "ssl_parse_clienthello_tlsext\0"
+    "ssl_parse_clienthello_use_srtp_ext\0"
+    "ssl_parse_serverhello_renegotiate_ext\0"
+    "ssl_parse_serverhello_tlsext\0"
+    "ssl_parse_serverhello_use_srtp_ext\0"
+    "ssl_scan_clienthello_tlsext\0"
+    "ssl_scan_serverhello_tlsext\0"
+    "ssl_sess_cert_new\0"
+    "ssl_set_cert\0"
+    "ssl_set_pkey\0"
+    "ssl_verify_cert_chain\0"
+    "tls12_check_peer_sigalg\0"
+    "tls1_aead_ctx_init\0"
+    "tls1_cert_verify_mac\0"
+    "tls1_change_cipher_state\0"
+    "tls1_change_cipher_state_aead\0"
+    "tls1_check_duplicate_extensions\0"
+    "tls1_enc\0"
+    "tls1_export_keying_material\0"
+    "tls1_prf\0"
+    "tls1_setup_key_block\0"
+    "ASN1_digest\0"
+    "ASN1_item_sign_ctx\0"
+    "ASN1_item_verify\0"
+    "NETSCAPE_SPKI_b64_decode\0"
+    "NETSCAPE_SPKI_b64_encode\0"
+    "PKCS7_get_CRLs\0"
+    "PKCS7_get_certificates\0"
+    "X509_ATTRIBUTE_create_by_NID\0"
+    "X509_ATTRIBUTE_create_by_OBJ\0"
+    "X509_ATTRIBUTE_create_by_txt\0"
+    "X509_ATTRIBUTE_get0_data\0"
+    "X509_ATTRIBUTE_set1_data\0"
+    "X509_CRL_add0_revoked\0"
+    "X509_CRL_diff\0"
+    "X509_CRL_print_fp\0"
+    "X509_EXTENSION_create_by_NID\0"
+    "X509_EXTENSION_create_by_OBJ\0"
+    "X509_INFO_new\0"
+    "X509_NAME_ENTRY_create_by_NID\0"
+    "X509_NAME_ENTRY_create_by_txt\0"
+    "X509_NAME_ENTRY_set_object\0"
+    "X509_NAME_add_entry\0"
+    "X509_NAME_oneline\0"
+    "X509_NAME_print\0"
+    "X509_PKEY_new\0"
+    "X509_PUBKEY_get\0"
+    "X509_PUBKEY_set\0"
+    "X509_REQ_check_private_key\0"
+    "X509_REQ_print_ex\0"
+    "X509_REQ_print_fp\0"
+    "X509_REQ_to_X509\0"
+    "X509_STORE_CTX_get1_issuer\0"
+    "X509_STORE_CTX_init\0"
+    "X509_STORE_CTX_new\0"
+    "X509_STORE_CTX_purpose_inherit\0"
+    "X509_STORE_add_cert\0"
+    "X509_STORE_add_crl\0"
+    "X509_TRUST_add\0"
+    "X509_TRUST_set\0"
+    "X509_check_private_key\0"
+    "X509_get_pubkey_parameters\0"
+    "X509_load_cert_crl_file\0"
+    "X509_load_cert_file\0"
+    "X509_load_crl_file\0"
+    "X509_print_ex_fp\0"
+    "X509_to_X509_REQ\0"
+    "X509_verify_cert\0"
+    "X509at_add1_attr\0"
+    "X509v3_add_ext\0"
+    "add_cert_dir\0"
+    "by_file_ctrl\0"
+    "check_policy\0"
+    "dir_ctrl\0"
+    "get_cert_by_subject\0"
+    "i2d_DSA_PUBKEY\0"
+    "i2d_EC_PUBKEY\0"
+    "i2d_RSA_PUBKEY\0"
+    "pkcs7_parse_header\0"
+    "x509_name_encode\0"
+    "x509_name_ex_d2i\0"
+    "x509_name_ex_new\0"
+    "SXNET_add_id_INTEGER\0"
+    "SXNET_add_id_asc\0"
+    "SXNET_add_id_ulong\0"
+    "SXNET_get_id_asc\0"
+    "SXNET_get_id_ulong\0"
+    "X509V3_EXT_add\0"
+    "X509V3_EXT_add_alias\0"
+    "X509V3_EXT_free\0"
+    "X509V3_EXT_i2d\0"
+    "X509V3_EXT_nconf\0"
+    "X509V3_add1_i2d\0"
+    "X509V3_add_value\0"
+    "X509V3_get_section\0"
+    "X509V3_get_string\0"
+    "X509V3_get_value_bool\0"
+    "X509V3_parse_list\0"
+    "X509_PURPOSE_add\0"
+    "X509_PURPOSE_set\0"
+    "a2i_GENERAL_NAME\0"
+    "copy_email\0"
+    "copy_issuer\0"
+    "do_dirname\0"
+    "do_ext_i2d\0"
+    "do_ext_nconf\0"
+    "gnames_from_sectname\0"
+    "hex_to_string\0"
+    "i2s_ASN1_ENUMERATED\0"
+    "i2s_ASN1_IA5STRING\0"
+    "i2s_ASN1_INTEGER\0"
+    "i2v_AUTHORITY_INFO_ACCESS\0"
+    "notice_section\0"
+    "nref_nos\0"
+    "policy_section\0"
+    "process_pci_value\0"
+    "r2i_certpol\0"
+    "r2i_pci\0"
+    "s2i_ASN1_IA5STRING\0"
+    "s2i_ASN1_INTEGER\0"
+    "s2i_ASN1_OCTET_STRING\0"
+    "s2i_skey_id\0"
+    "set_dist_point_name\0"
+    "string_to_hex\0"
+    "v2i_ASN1_BIT_STRING\0"
+    "v2i_AUTHORITY_INFO_ACCESS\0"
+    "v2i_AUTHORITY_KEYID\0"
+    "v2i_BASIC_CONSTRAINTS\0"
+    "v2i_EXTENDED_KEY_USAGE\0"
+    "v2i_GENERAL_NAMES\0"
+    "v2i_GENERAL_NAME_ex\0"
+    "v2i_NAME_CONSTRAINTS\0"
+    "v2i_POLICY_CONSTRAINTS\0"
+    "v2i_POLICY_MAPPINGS\0"
+    "v2i_crld\0"
+    "v2i_idp\0"
+    "v2i_issuer_alt\0"
+    "v2i_subject_alt\0"
+    "v3_generic_extension\0"
+    "";
+
+const uint32_t kOpenSSLReasonValues[] = {
+    0xc3207ba,
+    0xc3287c7,
+    0xc3307d6,
+    0xc3387e6,
+    0xc3407f5,
+    0xc34880e,
+    0xc35081a,
+    0xc358837,
+    0xc360849,
+    0xc368857,
+    0xc370867,
+    0xc378874,
+    0xc380884,
+    0xc38888f,
+    0xc3908a5,
+    0xc3988b4,
+    0xc3a08c8,
+    0x1032146b,
+    0x10329477,
+    0x10331490,
+    0x103394a3,
+    0x10340dd4,
+    0x103494b6,
+    0x103514cb,
+    0x103594fd,
+    0x10361516,
+    0x1036952b,
+    0x10371549,
+    0x10379558,
+    0x10381574,
+    0x1038958f,
+    0x1039159e,
+    0x103995ba,
+    0x103a15d5,
+    0x103a95ec,
+    0x103b15fd,
+    0x103b9611,
+    0x103c1630,
+    0x103c963f,
+    0x103d1656,
+    0x103d9669,
+    0x103e0b5f,
+    0x103e969a,
+    0x103f16ad,
+    0x103f96c7,
+    0x104016d7,
+    0x104096eb,
+    0x10411701,
+    0x10419719,
+    0x1042172e,
+    0x10429742,
+    0x10431754,
+    0x104385d0,
+    0x104408b4,
+    0x10449769,
+    0x10451780,
+    0x10459795,
+    0x104617a3,
+    0x1046967c,
+    0x104714de,
+    0x14320b42,
+    0x14328b50,
+    0x14330b5f,
+    0x14338b71,
+    0x18320083,
+    0x18328e3a,
+    0x18340e68,
+    0x18348e7c,
+    0x18358eb3,
+    0x18368ee0,
+    0x18370ef3,
+    0x18378f07,
+    0x18380f2b,
+    0x18388f39,
+    0x18390f4f,
+    0x18398f63,
+    0x183a0f73,
+    0x183b0f83,
+    0x183b8f98,
+    0x183c8fc3,
+    0x183d0fd7,
+    0x183d8fe7,
+    0x183e0b8e,
+    0x183e8ff4,
+    0x183f1006,
+    0x183f9011,
+    0x18401021,
+    0x18409032,
+    0x18411043,
+    0x18419055,
+    0x1842107e,
+    0x184290b0,
+    0x184310bf,
+    0x18451128,
+    0x1845913e,
+    0x18461159,
+    0x18468ecb,
+    0x184709cc,
+    0x18478094,
+    0x18480faf,
+    0x184890f4,
+    0x18490e50,
+    0x18498e91,
+    0x184a118f,
+    0x184a910c,
+    0x184b10d3,
+    0x184b8e2a,
+    0x184c1097,
+    0x184c866b,
+    0x184d1174,
+    0x203211b6,
+    0x243211c2,
+    0x243288fa,
+    0x243311d4,
+    0x243391e1,
+    0x243411ee,
+    0x24349200,
+    0x2435120f,
+    0x2435922c,
+    0x24361239,
+    0x24369247,
+    0x24371255,
+    0x24379263,
+    0x2438126c,
+    0x24389279,
+    0x2439128c,
+    0x28320b82,
+    0x28328b8e,
+    0x28330b5f,
+    0x28338ba1,
+    0x2c322b08,
+    0x2c32ab16,
+    0x2c332b28,
+    0x2c33ab3a,
+    0x2c342b4e,
+    0x2c34ab60,
+    0x2c352b7b,
+    0x2c35ab8d,
+    0x2c362ba0,
+    0x2c3682f3,
+    0x2c372bad,
+    0x2c37abbf,
+    0x2c382bd2,
+    0x2c38abe0,
+    0x2c392bf0,
+    0x2c39ac02,
+    0x2c3a2c16,
+    0x2c3aac27,
+    0x2c3b134c,
+    0x2c3bac38,
+    0x2c3c2c4c,
+    0x2c3cac62,
+    0x2c3d2c7b,
+    0x2c3daca9,
+    0x2c3e2cb7,
+    0x2c3eaccf,
+    0x2c3f2ce7,
+    0x2c3facf4,
+    0x2c402d17,
+    0x2c40ad36,
+    0x2c4111b6,
+    0x2c41ad47,
+    0x2c422d5a,
+    0x2c429128,
+    0x2c432d6b,
+    0x2c4386a2,
+    0x2c442c98,
+    0x30320000,
+    0x30328015,
+    0x3033001f,
+    0x30338038,
+    0x3034004a,
+    0x30348064,
+    0x3035006b,
+    0x30358083,
+    0x30360094,
+    0x303680a1,
+    0x303700b0,
+    0x303780bd,
+    0x303800d0,
+    0x303880eb,
+    0x30390100,
+    0x30398114,
+    0x303a0128,
+    0x303a8139,
+    0x303b0152,
+    0x303b816f,
+    0x303c017d,
+    0x303c8191,
+    0x303d01a1,
+    0x303d81ba,
+    0x303e01ca,
+    0x303e81dd,
+    0x303f01ec,
+    0x303f81f8,
+    0x3040020d,
+    0x3040821d,
+    0x30410234,
+    0x30418241,
+    0x30420254,
+    0x30428263,
+    0x30430278,
+    0x30438299,
+    0x304402ac,
+    0x304482bf,
+    0x304502d8,
+    0x304582f3,
+    0x30460310,
+    0x30468329,
+    0x30470337,
+    0x30478348,
+    0x30480357,
+    0x3048836f,
+    0x30490381,
+    0x30498395,
+    0x304a03b4,
+    0x304a83c7,
+    0x304b03d2,
+    0x304b83e1,
+    0x304c03f2,
+    0x304c83fe,
+    0x304d0414,
+    0x304d8422,
+    0x304e0438,
+    0x304e844a,
+    0x304f045c,
+    0x304f846f,
+    0x30500482,
+    0x30508493,
+    0x305104a3,
+    0x305184bb,
+    0x305204d0,
+    0x305284e8,
+    0x305304fc,
+    0x30538514,
+    0x3054052d,
+    0x30548546,
+    0x30550563,
+    0x3055856e,
+    0x30560586,
+    0x30568596,
+    0x305705a7,
+    0x305785ba,
+    0x305805d0,
+    0x305885d9,
+    0x305905ee,
+    0x30598601,
+    0x305a0610,
+    0x305a8630,
+    0x305b063f,
+    0x305b864b,
+    0x305c066b,
+    0x305c8687,
+    0x305d0698,
+    0x305d86a2,
+    0x34320abc,
+    0x34328ad0,
+    0x34330aed,
+    0x34338b00,
+    0x34340b0f,
+    0x34348b2c,
+    0x3c320083,
+    0x3c328bcb,
+    0x3c330be4,
+    0x3c338bff,
+    0x3c340c1c,
+    0x3c348c37,
+    0x3c350c52,
+    0x3c358c67,
+    0x3c360c80,
+    0x3c368c98,
+    0x3c370ca9,
+    0x3c378cb7,
+    0x3c380cc4,
+    0x3c388cd8,
+    0x3c390b8e,
+    0x3c398cec,
+    0x3c3a0d00,
+    0x3c3a8874,
+    0x3c3b0d10,
+    0x3c3b8d2b,
+    0x3c3c0d3d,
+    0x3c3c8d53,
+    0x3c3d0d5d,
+    0x3c3d8d71,
+    0x3c3e0d7f,
+    0x3c3e8da4,
+    0x3c3f0bb7,
+    0x3c3f8d8d,
+    0x403217ba,
+    0x403297d0,
+    0x403317fe,
+    0x40339808,
+    0x4034181f,
+    0x4034983d,
+    0x4035184d,
+    0x4035985f,
+    0x4036186c,
+    0x40369878,
+    0x4037188d,
+    0x403798a2,
+    0x403818b4,
+    0x403898bf,
+    0x403918d1,
+    0x40398dd4,
+    0x403a18e1,
+    0x403a98f4,
+    0x403b1915,
+    0x403b9926,
+    0x403c1936,
+    0x403c8064,
+    0x403d1942,
+    0x403d995e,
+    0x403e1974,
+    0x403e9983,
+    0x403f1996,
+    0x403f99b0,
+    0x404019be,
+    0x404099d3,
+    0x404119e7,
+    0x40419a04,
+    0x40421a1d,
+    0x40429a38,
+    0x40431a51,
+    0x40439a64,
+    0x40441a78,
+    0x40449a90,
+    0x40451aa0,
+    0x40459aae,
+    0x40461acc,
+    0x40468094,
+    0x40471ae1,
+    0x40479af3,
+    0x40481b17,
+    0x40489b37,
+    0x40491b4b,
+    0x40499b60,
+    0x404a1b79,
+    0x404a9bb3,
+    0x404b1bcd,
+    0x404b9beb,
+    0x404c1c06,
+    0x404c9c20,
+    0x404d1c37,
+    0x404d9c5f,
+    0x404e1c76,
+    0x404e9c92,
+    0x404f1cae,
+    0x404f9ccf,
+    0x40501cf1,
+    0x40509d0d,
+    0x40511d21,
+    0x40519d2e,
+    0x40521d45,
+    0x40529d55,
+    0x40531d65,
+    0x40539d79,
+    0x40541d94,
+    0x40549da4,
+    0x40551dbb,
+    0x40559dca,
+    0x40561de5,
+    0x40569dfd,
+    0x40571e19,
+    0x40579e32,
+    0x40581e45,
+    0x40589e5a,
+    0x40591e7d,
+    0x40599e8b,
+    0x405a1e98,
+    0x405a9eb1,
+    0x405b1ec9,
+    0x405b9edc,
+    0x405c1ef1,
+    0x405c9f03,
+    0x405d1f18,
+    0x405d9f28,
+    0x405e1f41,
+    0x405e9f55,
+    0x405f1f65,
+    0x405f9f7d,
+    0x40601f8e,
+    0x40609fa1,
+    0x40611fb2,
+    0x40619fd0,
+    0x40621fe1,
+    0x40629fee,
+    0x40632005,
+    0x4063a046,
+    0x4064205d,
+    0x4064a06a,
+    0x40652078,
+    0x4065a09a,
+    0x406620c2,
+    0x4066a0d7,
+    0x406720ee,
+    0x4067a0ff,
+    0x40682110,
+    0x4068a121,
+    0x40692136,
+    0x4069a14d,
+    0x406a215e,
+    0x406aa177,
+    0x406b2192,
+    0x406ba1a9,
+    0x406c2216,
+    0x406ca237,
+    0x406d224a,
+    0x406da26b,
+    0x406e2286,
+    0x406ea2a1,
+    0x406f22c2,
+    0x406fa2e8,
+    0x40702308,
+    0x4070a324,
+    0x407124b1,
+    0x4071a4d4,
+    0x407224ea,
+    0x4072a509,
+    0x40732521,
+    0x4073a541,
+    0x4074276b,
+    0x4074a790,
+    0x407527ab,
+    0x4075a7ca,
+    0x407627f9,
+    0x4076a821,
+    0x40772852,
+    0x4077a871,
+    0x40782896,
+    0x4078a8ad,
+    0x407928c0,
+    0x4079a8dd,
+    0x407a0782,
+    0x407aa8ef,
+    0x407b2902,
+    0x407ba91b,
+    0x407c2933,
+    0x407c90b0,
+    0x407d2947,
+    0x407da961,
+    0x407e2972,
+    0x407ea986,
+    0x407f2994,
+    0x407fa9af,
+    0x40801279,
+    0x4080a9d4,
+    0x408129f6,
+    0x4081aa11,
+    0x40822a26,
+    0x4082aa3e,
+    0x40832a56,
+    0x4083aa6d,
+    0x40842a83,
+    0x4084aa8f,
+    0x40852aa2,
+    0x4085aab7,
+    0x40862ac9,
+    0x4086aade,
+    0x40872ae7,
+    0x40879c4d,
+    0x40880083,
+    0x4088a025,
+    0x40890a0a,
+    0x4089a1c1,
+    0x408a1b9c,
+    0x408aa1eb,
+    0x408b283a,
+    0x41f423dc,
+    0x41f9246e,
+    0x41fe2361,
+    0x41fea592,
+    0x41ff2683,
+    0x420323f5,
+    0x42082417,
+    0x4208a453,
+    0x42092345,
+    0x4209a48d,
+    0x420a239c,
+    0x420aa37c,
+    0x420b23bc,
+    0x420ba435,
+    0x420c269f,
+    0x420ca55f,
+    0x420d2579,
+    0x420da5b0,
+    0x421225ca,
+    0x42172666,
+    0x4217a60c,
+    0x421c262e,
+    0x421f25e9,
+    0x422126b6,
+    0x42262649,
+    0x422b274f,
+    0x422ba718,
+    0x422c2737,
+    0x422ca6f2,
+    0x422d26d1,
+    0x443206ad,
+    0x443286bc,
+    0x443306c8,
+    0x443386d6,
+    0x443406e9,
+    0x443486fa,
+    0x44350701,
+    0x4435870b,
+    0x4436071e,
+    0x44368734,
+    0x44370746,
+    0x44378753,
+    0x44380762,
+    0x4438876a,
+    0x44390782,
+    0x44398790,
+    0x443a07a3,
+    0x4c3212a3,
+    0x4c3292b3,
+    0x4c3312c6,
+    0x4c3392e6,
+    0x4c340094,
+    0x4c3480b0,
+    0x4c3512f2,
+    0x4c359300,
+    0x4c36131c,
+    0x4c36932f,
+    0x4c37133e,
+    0x4c37934c,
+    0x4c381361,
+    0x4c38936d,
+    0x4c39138d,
+    0x4c3993b7,
+    0x4c3a13d0,
+    0x4c3a93e9,
+    0x4c3b05d0,
+    0x4c3b9402,
+    0x4c3c1414,
+    0x4c3c9423,
+    0x4c3d10b0,
+    0x4c3d943c,
+    0x4c3e1449,
+    0x50322d7d,
+    0x5032ad8c,
+    0x50332d97,
+    0x5033ada7,
+    0x50342dc0,
+    0x5034adda,
+    0x50352de8,
+    0x5035adfe,
+    0x50362e10,
+    0x5036ae26,
+    0x50372e3f,
+    0x5037ae52,
+    0x50382e6a,
+    0x5038ae7b,
+    0x50392e90,
+    0x5039aea4,
+    0x503a2ec4,
+    0x503aaeda,
+    0x503b2ef2,
+    0x503baf04,
+    0x503c2f20,
+    0x503caf37,
+    0x503d2f50,
+    0x503daf66,
+    0x503e2f73,
+    0x503eaf89,
+    0x503f2f9b,
+    0x503f8348,
+    0x50402fae,
+    0x5040afbe,
+    0x50412fd8,
+    0x5041afe7,
+    0x50423001,
+    0x5042b01e,
+    0x5043302e,
+    0x5043b03e,
+    0x5044304d,
+    0x50448414,
+    0x50453061,
+    0x5045b07f,
+    0x50463092,
+    0x5046b0a8,
+    0x504730ba,
+    0x5047b0cf,
+    0x504830f5,
+    0x5048b103,
+    0x50493116,
+    0x5049b12b,
+    0x504a3141,
+    0x504ab151,
+    0x504b3171,
+    0x504bb184,
+    0x504c31a7,
+    0x504cb1d5,
+    0x504d31e7,
+    0x504db204,
+    0x504e321f,
+    0x504eb23b,
+    0x504f324d,
+    0x504fb264,
+    0x50503273,
+    0x50508687,
+    0x50513286,
+    0x58320e12,
+    0x68320dd4,
+    0x68328b8e,
+    0x68330ba1,
+    0x68338de2,
+    0x68340df2,
+    0x6c320db0,
+    0x6c328b71,
+    0x6c330dbb,
+    0x74320980,
+    0x783208e5,
+    0x783288fa,
+    0x78330906,
+    0x78338083,
+    0x78340915,
+    0x7834892a,
+    0x78350949,
+    0x7835896b,
+    0x78360980,
+    0x78368996,
+    0x783709a6,
+    0x783789b9,
+    0x783809cc,
+    0x783889de,
+    0x783909eb,
+    0x78398a0a,
+    0x783a0a1f,
+    0x783a8a2d,
+    0x783b0a37,
+    0x783b8a4b,
+    0x783c0a62,
+    0x783c8a77,
+    0x783d0a8e,
+    0x783d8aa3,
+    0x783e09f9,
+    0x803211a5,
+};
+
+const size_t kOpenSSLReasonValuesLen = sizeof(kOpenSSLReasonValues) / sizeof(kOpenSSLReasonValues[0]);
+
+const char kOpenSSLReasonStringData[] =
+    "ASN1_LENGTH_MISMATCH\0"
+    "AUX_ERROR\0"
+    "BAD_GET_ASN1_OBJECT_CALL\0"
+    "BAD_OBJECT_HEADER\0"
+    "BMPSTRING_IS_WRONG_LENGTH\0"
+    "BN_LIB\0"
+    "BOOLEAN_IS_WRONG_LENGTH\0"
+    "BUFFER_TOO_SMALL\0"
+    "DECODE_ERROR\0"
+    "DEPTH_EXCEEDED\0"
+    "ENCODE_ERROR\0"
+    "ERROR_GETTING_TIME\0"
+    "EXPECTING_AN_ASN1_SEQUENCE\0"
+    "EXPECTING_AN_INTEGER\0"
+    "EXPECTING_AN_OBJECT\0"
+    "EXPECTING_A_BOOLEAN\0"
+    "EXPECTING_A_TIME\0"
+    "EXPLICIT_LENGTH_MISMATCH\0"
+    "EXPLICIT_TAG_NOT_CONSTRUCTED\0"
+    "FIELD_MISSING\0"
+    "FIRST_NUM_TOO_LARGE\0"
+    "HEADER_TOO_LONG\0"
+    "ILLEGAL_BITSTRING_FORMAT\0"
+    "ILLEGAL_BOOLEAN\0"
+    "ILLEGAL_CHARACTERS\0"
+    "ILLEGAL_FORMAT\0"
+    "ILLEGAL_HEX\0"
+    "ILLEGAL_IMPLICIT_TAG\0"
+    "ILLEGAL_INTEGER\0"
+    "ILLEGAL_NESTED_TAGGING\0"
+    "ILLEGAL_NULL\0"
+    "ILLEGAL_NULL_VALUE\0"
+    "ILLEGAL_OBJECT\0"
+    "ILLEGAL_OPTIONAL_ANY\0"
+    "ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE\0"
+    "ILLEGAL_TAGGED_ANY\0"
+    "ILLEGAL_TIME_VALUE\0"
+    "INTEGER_NOT_ASCII_FORMAT\0"
+    "INTEGER_TOO_LARGE_FOR_LONG\0"
+    "INVALID_BIT_STRING_BITS_LEFT\0"
+    "INVALID_BMPSTRING_LENGTH\0"
+    "INVALID_DIGIT\0"
+    "INVALID_MODIFIER\0"
+    "INVALID_NUMBER\0"
+    "INVALID_OBJECT_ENCODING\0"
+    "INVALID_SEPARATOR\0"
+    "INVALID_TIME_FORMAT\0"
+    "INVALID_UNIVERSALSTRING_LENGTH\0"
+    "INVALID_UTF8STRING\0"
+    "LIST_ERROR\0"
+    "MALLOC_FAILURE\0"
+    "MISSING_ASN1_EOS\0"
+    "MISSING_EOC\0"
+    "MISSING_SECOND_NUMBER\0"
+    "MISSING_VALUE\0"
+    "MSTRING_NOT_UNIVERSAL\0"
+    "MSTRING_WRONG_TAG\0"
+    "NESTED_ASN1_ERROR\0"
+    "NESTED_ASN1_STRING\0"
+    "NON_HEX_CHARACTERS\0"
+    "NOT_ASCII_FORMAT\0"
+    "NOT_ENOUGH_DATA\0"
+    "NO_MATCHING_CHOICE_TYPE\0"
+    "NULL_IS_WRONG_LENGTH\0"
+    "OBJECT_NOT_ASCII_FORMAT\0"
+    "ODD_NUMBER_OF_CHARS\0"
+    "SECOND_NUMBER_TOO_LARGE\0"
+    "SEQUENCE_LENGTH_MISMATCH\0"
+    "SEQUENCE_NOT_CONSTRUCTED\0"
+    "SEQUENCE_OR_SET_NEEDS_CONFIG\0"
+    "SHORT_LINE\0"
+    "STREAMING_NOT_SUPPORTED\0"
+    "STRING_TOO_LONG\0"
+    "STRING_TOO_SHORT\0"
+    "TAG_VALUE_TOO_HIGH\0"
+    "TIME_NOT_ASCII_FORMAT\0"
+    "TOO_LONG\0"
+    "TYPE_NOT_CONSTRUCTED\0"
+    "TYPE_NOT_PRIMITIVE\0"
+    "UNEXPECTED_EOC\0"
+    "UNIVERSALSTRING_IS_WRONG_LENGTH\0"
+    "UNKNOWN_FORMAT\0"
+    "UNKNOWN_TAG\0"
+    "UNSUPPORTED_ANY_DEFINED_BY_TYPE\0"
+    "UNSUPPORTED_PUBLIC_KEY_TYPE\0"
+    "UNSUPPORTED_TYPE\0"
+    "WRONG_TAG\0"
+    "WRONG_TYPE\0"
+    "BAD_FOPEN_MODE\0"
+    "BROKEN_PIPE\0"
+    "CONNECT_ERROR\0"
+    "ERROR_SETTING_NBIO\0"
+    "INVALID_ARGUMENT\0"
+    "IN_USE\0"
+    "KEEPALIVE\0"
+    "NBIO_CONNECT_ERROR\0"
+    "NO_HOSTNAME_SPECIFIED\0"
+    "NO_PORT_SPECIFIED\0"
+    "NO_SUCH_FILE\0"
+    "NULL_PARAMETER\0"
+    "SYS_LIB\0"
+    "UNABLE_TO_CREATE_SOCKET\0"
+    "UNINITIALIZED\0"
+    "UNSUPPORTED_METHOD\0"
+    "WRITE_TO_READ_ONLY_BIO\0"
+    "ARG2_LT_ARG3\0"
+    "BAD_RECIPROCAL\0"
+    "BIGNUM_TOO_LONG\0"
+    "BITS_TOO_SMALL\0"
+    "CALLED_WITH_EVEN_MODULUS\0"
+    "DIV_BY_ZERO\0"
+    "EXPAND_ON_STATIC_BIGNUM_DATA\0"
+    "INPUT_NOT_REDUCED\0"
+    "INVALID_RANGE\0"
+    "NEGATIVE_NUMBER\0"
+    "NOT_A_SQUARE\0"
+    "NOT_INITIALIZED\0"
+    "NO_INVERSE\0"
+    "PRIVATE_KEY_TOO_LARGE\0"
+    "P_IS_NOT_PRIME\0"
+    "TOO_MANY_ITERATIONS\0"
+    "TOO_MANY_TEMPORARY_VARIABLES\0"
+    "AES_KEY_SETUP_FAILED\0"
+    "BAD_DECRYPT\0"
+    "BAD_KEY_LENGTH\0"
+    "CTRL_NOT_IMPLEMENTED\0"
+    "CTRL_OPERATION_NOT_IMPLEMENTED\0"
+    "DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH\0"
+    "INITIALIZATION_ERROR\0"
+    "INPUT_NOT_INITIALIZED\0"
+    "INVALID_AD_SIZE\0"
+    "INVALID_KEY_LENGTH\0"
+    "INVALID_NONCE_SIZE\0"
+    "INVALID_OPERATION\0"
+    "IV_TOO_LARGE\0"
+    "NO_CIPHER_SET\0"
+    "NO_DIRECTION_SET\0"
+    "OUTPUT_ALIASES_INPUT\0"
+    "TAG_TOO_LARGE\0"
+    "TOO_LARGE\0"
+    "UNSUPPORTED_AD_SIZE\0"
+    "UNSUPPORTED_INPUT_SIZE\0"
+    "UNSUPPORTED_KEY_SIZE\0"
+    "UNSUPPORTED_NONCE_SIZE\0"
+    "UNSUPPORTED_TAG_SIZE\0"
+    "WRONG_FINAL_BLOCK_LENGTH\0"
+    "LIST_CANNOT_BE_NULL\0"
+    "MISSING_CLOSE_SQUARE_BRACKET\0"
+    "MISSING_EQUAL_SIGN\0"
+    "NO_CLOSE_BRACE\0"
+    "UNABLE_TO_CREATE_NEW_SECTION\0"
+    "VARIABLE_HAS_NO_VALUE\0"
+    "BAD_GENERATOR\0"
+    "INVALID_PUBKEY\0"
+    "MODULUS_TOO_LARGE\0"
+    "NO_PRIVATE_VALUE\0"
+    "BAD_Q_VALUE\0"
+    "MISSING_PARAMETERS\0"
+    "NEED_NEW_SETUP_VALUES\0"
+    "BIGNUM_OUT_OF_RANGE\0"
+    "COORDINATES_OUT_OF_RANGE\0"
+    "D2I_ECPKPARAMETERS_FAILURE\0"
+    "EC_GROUP_NEW_BY_NAME_FAILURE\0"
+    "GROUP2PKPARAMETERS_FAILURE\0"
+    "I2D_ECPKPARAMETERS_FAILURE\0"
+    "INCOMPATIBLE_OBJECTS\0"
+    "INVALID_COMPRESSED_POINT\0"
+    "INVALID_COMPRESSION_BIT\0"
+    "INVALID_ENCODING\0"
+    "INVALID_FIELD\0"
+    "INVALID_FORM\0"
+    "INVALID_GROUP_ORDER\0"
+    "INVALID_PRIVATE_KEY\0"
+    "MISSING_PRIVATE_KEY\0"
+    "NON_NAMED_CURVE\0"
+    "PKPARAMETERS2GROUP_FAILURE\0"
+    "POINT_AT_INFINITY\0"
+    "POINT_IS_NOT_ON_CURVE\0"
+    "SLOT_FULL\0"
+    "UNDEFINED_GENERATOR\0"
+    "UNKNOWN_GROUP\0"
+    "UNKNOWN_ORDER\0"
+    "WRONG_CURVE_PARAMETERS\0"
+    "WRONG_ORDER\0"
+    "KDF_FAILED\0"
+    "POINT_ARITHMETIC_FAILURE\0"
+    "BAD_SIGNATURE\0"
+    "NOT_IMPLEMENTED\0"
+    "RANDOM_NUMBER_GENERATION_FAILED\0"
+    "OPERATION_NOT_SUPPORTED\0"
+    "BN_DECODE_ERROR\0"
+    "COMMAND_NOT_SUPPORTED\0"
+    "CONTEXT_NOT_INITIALISED\0"
+    "DIFFERENT_KEY_TYPES\0"
+    "DIFFERENT_PARAMETERS\0"
+    "DIGEST_AND_KEY_TYPE_NOT_SUPPORTED\0"
+    "EXPECTING_AN_EC_KEY_KEY\0"
+    "EXPECTING_AN_RSA_KEY\0"
+    "EXPECTING_A_DH_KEY\0"
+    "EXPECTING_A_DSA_KEY\0"
+    "ILLEGAL_OR_UNSUPPORTED_PADDING_MODE\0"
+    "INVALID_CURVE\0"
+    "INVALID_DIGEST_LENGTH\0"
+    "INVALID_DIGEST_TYPE\0"
+    "INVALID_KEYBITS\0"
+    "INVALID_MGF1_MD\0"
+    "INVALID_PADDING_MODE\0"
+    "INVALID_PSS_PARAMETERS\0"
+    "INVALID_PSS_SALTLEN\0"
+    "INVALID_SALT_LENGTH\0"
+    "INVALID_TRAILER\0"
+    "KEYS_NOT_SET\0"
+    "NO_DEFAULT_DIGEST\0"
+    "NO_KEY_SET\0"
+    "NO_MDC2_SUPPORT\0"
+    "NO_NID_FOR_CURVE\0"
+    "NO_OPERATION_SET\0"
+    "NO_PARAMETERS_SET\0"
+    "OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE\0"
+    "OPERATON_NOT_INITIALIZED\0"
+    "PARAMETER_ENCODING_ERROR\0"
+    "UNKNOWN_DIGEST\0"
+    "UNKNOWN_MASK_DIGEST\0"
+    "UNKNOWN_MESSAGE_DIGEST_ALGORITHM\0"
+    "UNKNOWN_PUBLIC_KEY_TYPE\0"
+    "UNKNOWN_SIGNATURE_ALGORITHM\0"
+    "UNSUPPORTED_ALGORITHM\0"
+    "UNSUPPORTED_MASK_ALGORITHM\0"
+    "UNSUPPORTED_MASK_PARAMETER\0"
+    "UNSUPPORTED_SIGNATURE_TYPE\0"
+    "WRONG_PUBLIC_KEY_TYPE\0"
+    "OUTPUT_TOO_LARGE\0"
+    "UNKNOWN_NID\0"
+    "BAD_BASE64_DECODE\0"
+    "BAD_END_LINE\0"
+    "BAD_IV_CHARS\0"
+    "BAD_PASSWORD_READ\0"
+    "CIPHER_IS_NULL\0"
+    "ERROR_CONVERTING_PRIVATE_KEY\0"
+    "NOT_DEK_INFO\0"
+    "NOT_ENCRYPTED\0"
+    "NOT_PROC_TYPE\0"
+    "NO_START_LINE\0"
+    "READ_KEY\0"
+    "SHORT_HEADER\0"
+    "UNSUPPORTED_CIPHER\0"
+    "UNSUPPORTED_ENCRYPTION\0"
+    "BAD_PKCS12_DATA\0"
+    "BAD_PKCS12_VERSION\0"
+    "CIPHER_HAS_NO_OBJECT_IDENTIFIER\0"
+    "CRYPT_ERROR\0"
+    "ENCRYPT_ERROR\0"
+    "ERROR_SETTING_CIPHER_PARAMS\0"
+    "INCORRECT_PASSWORD\0"
+    "KEYGEN_FAILURE\0"
+    "KEY_GEN_ERROR\0"
+    "METHOD_NOT_SUPPORTED\0"
+    "MISSING_MAC\0"
+    "MULTIPLE_PRIVATE_KEYS_IN_PKCS12\0"
+    "PKCS12_PUBLIC_KEY_INTEGRITY_NOT_SUPPORTED\0"
+    "PKCS12_TOO_DEEPLY_NESTED\0"
+    "PRIVATE_KEY_DECODE_ERROR\0"
+    "PRIVATE_KEY_ENCODE_ERROR\0"
+    "UNKNOWN_ALGORITHM\0"
+    "UNKNOWN_CIPHER\0"
+    "UNKNOWN_CIPHER_ALGORITHM\0"
+    "UNKNOWN_HASH\0"
+    "UNSUPPORTED_PRIVATE_KEY_ALGORITHM\0"
+    "BAD_E_VALUE\0"
+    "BAD_FIXED_HEADER_DECRYPT\0"
+    "BAD_PAD_BYTE_COUNT\0"
+    "BAD_RSA_PARAMETERS\0"
+    "BLOCK_TYPE_IS_NOT_01\0"
+    "BN_NOT_INITIALIZED\0"
+    "CANNOT_RECOVER_MULTI_PRIME_KEY\0"
+    "CRT_PARAMS_ALREADY_GIVEN\0"
+    "CRT_VALUES_INCORRECT\0"
+    "DATA_LEN_NOT_EQUAL_TO_MOD_LEN\0"
+    "DATA_TOO_LARGE\0"
+    "DATA_TOO_LARGE_FOR_KEY_SIZE\0"
+    "DATA_TOO_LARGE_FOR_MODULUS\0"
+    "DATA_TOO_SMALL\0"
+    "DATA_TOO_SMALL_FOR_KEY_SIZE\0"
+    "DIGEST_TOO_BIG_FOR_RSA_KEY\0"
+    "D_E_NOT_CONGRUENT_TO_1\0"
+    "EMPTY_PUBLIC_KEY\0"
+    "FIRST_OCTET_INVALID\0"
+    "INCONSISTENT_SET_OF_CRT_VALUES\0"
+    "INTERNAL_ERROR\0"
+    "INVALID_MESSAGE_LENGTH\0"
+    "KEY_SIZE_TOO_SMALL\0"
+    "LAST_OCTET_INVALID\0"
+    "MUST_HAVE_AT_LEAST_TWO_PRIMES\0"
+    "NO_PUBLIC_EXPONENT\0"
+    "NULL_BEFORE_BLOCK_MISSING\0"
+    "N_NOT_EQUAL_P_Q\0"
+    "OAEP_DECODING_ERROR\0"
+    "ONLY_ONE_OF_P_Q_GIVEN\0"
+    "OUTPUT_BUFFER_TOO_SMALL\0"
+    "PADDING_CHECK_FAILED\0"
+    "PKCS_DECODING_ERROR\0"
+    "SLEN_CHECK_FAILED\0"
+    "SLEN_RECOVERY_FAILED\0"
+    "UNKNOWN_ALGORITHM_TYPE\0"
+    "UNKNOWN_PADDING_TYPE\0"
+    "VALUE_MISSING\0"
+    "WRONG_SIGNATURE_LENGTH\0"
+    "APP_DATA_IN_HANDSHAKE\0"
+    "ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT\0"
+    "BAD_ALERT\0"
+    "BAD_CHANGE_CIPHER_SPEC\0"
+    "BAD_DATA_RETURNED_BY_CALLBACK\0"
+    "BAD_DH_P_LENGTH\0"
+    "BAD_DIGEST_LENGTH\0"
+    "BAD_ECC_CERT\0"
+    "BAD_ECPOINT\0"
+    "BAD_HANDSHAKE_LENGTH\0"
+    "BAD_HANDSHAKE_RECORD\0"
+    "BAD_HELLO_REQUEST\0"
+    "BAD_LENGTH\0"
+    "BAD_PACKET_LENGTH\0"
+    "BAD_RSA_ENCRYPT\0"
+    "BAD_SRTP_MKI_VALUE\0"
+    "BAD_SRTP_PROTECTION_PROFILE_LIST\0"
+    "BAD_SSL_FILETYPE\0"
+    "BAD_WRITE_RETRY\0"
+    "BIO_NOT_SET\0"
+    "CANNOT_SERIALIZE_PUBLIC_KEY\0"
+    "CA_DN_LENGTH_MISMATCH\0"
+    "CA_DN_TOO_LONG\0"
+    "CCS_RECEIVED_EARLY\0"
+    "CERTIFICATE_VERIFY_FAILED\0"
+    "CERT_CB_ERROR\0"
+    "CERT_LENGTH_MISMATCH\0"
+    "CHANNEL_ID_NOT_P256\0"
+    "CHANNEL_ID_SIGNATURE_INVALID\0"
+    "CIPHER_CODE_WRONG_LENGTH\0"
+    "CIPHER_OR_HASH_UNAVAILABLE\0"
+    "CLIENTHELLO_PARSE_FAILED\0"
+    "CLIENTHELLO_TLSEXT\0"
+    "CONNECTION_REJECTED\0"
+    "CONNECTION_TYPE_NOT_SET\0"
+    "COOKIE_MISMATCH\0"
+    "D2I_ECDSA_SIG\0"
+    "DATA_BETWEEN_CCS_AND_FINISHED\0"
+    "DATA_LENGTH_TOO_LONG\0"
+    "DECRYPTION_FAILED\0"
+    "DECRYPTION_FAILED_OR_BAD_RECORD_MAC\0"
+    "DH_PUBLIC_VALUE_LENGTH_IS_WRONG\0"
+    "DIGEST_CHECK_FAILED\0"
+    "DTLS_MESSAGE_TOO_BIG\0"
+    "ECC_CERT_NOT_FOR_SIGNING\0"
+    "EMPTY_SRTP_PROTECTION_PROFILE_LIST\0"
+    "EMS_STATE_INCONSISTENT\0"
+    "ENCRYPTED_LENGTH_TOO_LONG\0"
+    "ERROR_IN_RECEIVED_CIPHER_LIST\0"
+    "EVP_DIGESTSIGNFINAL_FAILED\0"
+    "EVP_DIGESTSIGNINIT_FAILED\0"
+    "EXCESSIVE_MESSAGE_SIZE\0"
+    "EXTRA_DATA_IN_MESSAGE\0"
+    "FRAGMENT_MISMATCH\0"
+    "GOT_A_FIN_BEFORE_A_CCS\0"
+    "GOT_CHANNEL_ID_BEFORE_A_CCS\0"
+    "GOT_NEXT_PROTO_BEFORE_A_CCS\0"
+    "GOT_NEXT_PROTO_WITHOUT_EXTENSION\0"
+    "HANDSHAKE_FAILURE_ON_CLIENT_HELLO\0"
+    "HANDSHAKE_RECORD_BEFORE_CCS\0"
+    "HTTPS_PROXY_REQUEST\0"
+    "HTTP_REQUEST\0"
+    "INAPPROPRIATE_FALLBACK\0"
+    "INVALID_COMMAND\0"
+    "INVALID_MESSAGE\0"
+    "INVALID_SSL_SESSION\0"
+    "INVALID_TICKET_KEYS_LENGTH\0"
+    "LENGTH_MISMATCH\0"
+    "LIBRARY_HAS_NO_CIPHERS\0"
+    "MISSING_DH_KEY\0"
+    "MISSING_ECDSA_SIGNING_CERT\0"
+    "MISSING_RSA_CERTIFICATE\0"
+    "MISSING_RSA_ENCRYPTING_CERT\0"
+    "MISSING_RSA_SIGNING_CERT\0"
+    "MISSING_TMP_DH_KEY\0"
+    "MISSING_TMP_ECDH_KEY\0"
+    "MIXED_SPECIAL_OPERATOR_WITH_GROUPS\0"
+    "MTU_TOO_SMALL\0"
+    "NESTED_GROUP\0"
+    "NO_CERTIFICATES_RETURNED\0"
+    "NO_CERTIFICATE_ASSIGNED\0"
+    "NO_CERTIFICATE_SET\0"
+    "NO_CIPHERS_AVAILABLE\0"
+    "NO_CIPHERS_PASSED\0"
+    "NO_CIPHERS_SPECIFIED\0"
+    "NO_CIPHER_MATCH\0"
+    "NO_COMPRESSION_SPECIFIED\0"
+    "NO_METHOD_SPECIFIED\0"
+    "NO_P256_SUPPORT\0"
+    "NO_PRIVATE_KEY_ASSIGNED\0"
+    "NO_RENEGOTIATION\0"
+    "NO_REQUIRED_DIGEST\0"
+    "NO_SHARED_CIPHER\0"
+    "NO_SHARED_SIGATURE_ALGORITHMS\0"
+    "NO_SRTP_PROFILES\0"
+    "NULL_SSL_CTX\0"
+    "NULL_SSL_METHOD_PASSED\0"
+    "OLD_SESSION_CIPHER_NOT_RETURNED\0"
+    "OLD_SESSION_VERSION_NOT_RETURNED\0"
+    "PACKET_LENGTH_TOO_LONG\0"
+    "PARSE_TLSEXT\0"
+    "PATH_TOO_LONG\0"
+    "PEER_DID_NOT_RETURN_A_CERTIFICATE\0"
+    "PEER_ERROR_UNSUPPORTED_CERTIFICATE_TYPE\0"
+    "PROTOCOL_IS_SHUTDOWN\0"
+    "PSK_IDENTITY_NOT_FOUND\0"
+    "PSK_NO_CLIENT_CB\0"
+    "PSK_NO_SERVER_CB\0"
+    "READ_BIO_NOT_SET\0"
+    "READ_TIMEOUT_EXPIRED\0"
+    "RECORD_LENGTH_MISMATCH\0"
+    "RECORD_TOO_LARGE\0"
+    "RENEGOTIATE_EXT_TOO_LONG\0"
+    "RENEGOTIATION_ENCODING_ERR\0"
+    "RENEGOTIATION_MISMATCH\0"
+    "REQUIRED_CIPHER_MISSING\0"
+    "RESUMED_EMS_SESSION_WITHOUT_EMS_EXTENSION\0"
+    "RESUMED_NON_EMS_SESSION_WITH_EMS_EXTENSION\0"
+    "SCSV_RECEIVED_WHEN_RENEGOTIATING\0"
+    "SERVERHELLO_TLSEXT\0"
+    "SESSION_ID_CONTEXT_UNINITIALIZED\0"
+    "SESSION_MAY_NOT_BE_CREATED\0"
+    "SIGNATURE_ALGORITHMS_ERROR\0"
+    "SRTP_COULD_NOT_ALLOCATE_PROFILES\0"
+    "SRTP_PROTECTION_PROFILE_LIST_TOO_LONG\0"
+    "SRTP_UNKNOWN_PROTECTION_PROFILE\0"
+    "SSL3_EXT_INVALID_SERVERNAME\0"
+    "SSL3_EXT_INVALID_SERVERNAME_TYPE\0"
+    "SSLV3_ALERT_BAD_CERTIFICATE\0"
+    "SSLV3_ALERT_BAD_RECORD_MAC\0"
+    "SSLV3_ALERT_CERTIFICATE_EXPIRED\0"
+    "SSLV3_ALERT_CERTIFICATE_REVOKED\0"
+    "SSLV3_ALERT_CERTIFICATE_UNKNOWN\0"
+    "SSLV3_ALERT_CLOSE_NOTIFY\0"
+    "SSLV3_ALERT_DECOMPRESSION_FAILURE\0"
+    "SSLV3_ALERT_HANDSHAKE_FAILURE\0"
+    "SSLV3_ALERT_ILLEGAL_PARAMETER\0"
+    "SSLV3_ALERT_NO_CERTIFICATE\0"
+    "SSLV3_ALERT_UNEXPECTED_MESSAGE\0"
+    "SSLV3_ALERT_UNSUPPORTED_CERTIFICATE\0"
+    "SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION\0"
+    "SSL_HANDSHAKE_FAILURE\0"
+    "SSL_SESSION_ID_CALLBACK_FAILED\0"
+    "SSL_SESSION_ID_CONFLICT\0"
+    "SSL_SESSION_ID_CONTEXT_TOO_LONG\0"
+    "SSL_SESSION_ID_HAS_BAD_LENGTH\0"
+    "TLSV1_ALERT_ACCESS_DENIED\0"
+    "TLSV1_ALERT_DECODE_ERROR\0"
+    "TLSV1_ALERT_DECRYPTION_FAILED\0"
+    "TLSV1_ALERT_DECRYPT_ERROR\0"
+    "TLSV1_ALERT_EXPORT_RESTRICTION\0"
+    "TLSV1_ALERT_INAPPROPRIATE_FALLBACK\0"
+    "TLSV1_ALERT_INSUFFICIENT_SECURITY\0"
+    "TLSV1_ALERT_INTERNAL_ERROR\0"
+    "TLSV1_ALERT_NO_RENEGOTIATION\0"
+    "TLSV1_ALERT_PROTOCOL_VERSION\0"
+    "TLSV1_ALERT_RECORD_OVERFLOW\0"
+    "TLSV1_ALERT_UNKNOWN_CA\0"
+    "TLSV1_ALERT_USER_CANCELLED\0"
+    "TLSV1_BAD_CERTIFICATE_HASH_VALUE\0"
+    "TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE\0"
+    "TLSV1_CERTIFICATE_UNOBTAINABLE\0"
+    "TLSV1_UNRECOGNIZED_NAME\0"
+    "TLSV1_UNSUPPORTED_EXTENSION\0"
+    "TLS_CLIENT_CERT_REQ_WITH_ANON_CIPHER\0"
+    "TLS_ILLEGAL_EXPORTER_LABEL\0"
+    "TLS_INVALID_ECPOINTFORMAT_LIST\0"
+    "TLS_PEER_DID_NOT_RESPOND_WITH_CERTIFICATE_LIST\0"
+    "TLS_RSA_ENCRYPTED_VALUE_LENGTH_IS_WRONG\0"
+    "TOO_MANY_EMPTY_FRAGMENTS\0"
+    "TOO_MANY_WARNING_ALERTS\0"
+    "UNABLE_TO_FIND_ECDH_PARAMETERS\0"
+    "UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS\0"
+    "UNEXPECTED_GROUP_CLOSE\0"
+    "UNEXPECTED_MESSAGE\0"
+    "UNEXPECTED_OPERATOR_IN_GROUP\0"
+    "UNEXPECTED_RECORD\0"
+    "UNKNOWN_ALERT_TYPE\0"
+    "UNKNOWN_CERTIFICATE_TYPE\0"
+    "UNKNOWN_CIPHER_RETURNED\0"
+    "UNKNOWN_CIPHER_TYPE\0"
+    "UNKNOWN_KEY_EXCHANGE_TYPE\0"
+    "UNKNOWN_PROTOCOL\0"
+    "UNKNOWN_SSL_VERSION\0"
+    "UNKNOWN_STATE\0"
+    "UNPROCESSED_HANDSHAKE_DATA\0"
+    "UNSAFE_LEGACY_RENEGOTIATION_DISABLED\0"
+    "UNSUPPORTED_COMPRESSION_ALGORITHM\0"
+    "UNSUPPORTED_ELLIPTIC_CURVE\0"
+    "UNSUPPORTED_PROTOCOL\0"
+    "UNSUPPORTED_SSL_VERSION\0"
+    "USE_SRTP_NOT_NEGOTIATED\0"
+    "WRONG_CERTIFICATE_TYPE\0"
+    "WRONG_CIPHER_RETURNED\0"
+    "WRONG_CURVE\0"
+    "WRONG_MESSAGE_TYPE\0"
+    "WRONG_SIGNATURE_TYPE\0"
+    "WRONG_SSL_VERSION\0"
+    "WRONG_VERSION_NUMBER\0"
+    "X509_LIB\0"
+    "X509_VERIFICATION_SETUP_PROBLEMS\0"
+    "AKID_MISMATCH\0"
+    "BAD_PKCS7_VERSION\0"
+    "BAD_X509_FILETYPE\0"
+    "BASE64_DECODE_ERROR\0"
+    "CANT_CHECK_DH_KEY\0"
+    "CERT_ALREADY_IN_HASH_TABLE\0"
+    "CRL_ALREADY_DELTA\0"
+    "CRL_VERIFY_FAILURE\0"
+    "IDP_MISMATCH\0"
+    "INVALID_DIRECTORY\0"
+    "INVALID_FIELD_NAME\0"
+    "INVALID_TRUST\0"
+    "ISSUER_MISMATCH\0"
+    "KEY_TYPE_MISMATCH\0"
+    "KEY_VALUES_MISMATCH\0"
+    "LOADING_CERT_DIR\0"
+    "LOADING_DEFAULTS\0"
+    "NEWER_CRL_NOT_NEWER\0"
+    "NOT_PKCS7_SIGNED_DATA\0"
+    "NO_CERTIFICATES_INCLUDED\0"
+    "NO_CERT_SET_FOR_US_TO_VERIFY\0"
+    "NO_CRLS_INCLUDED\0"
+    "NO_CRL_NUMBER\0"
+    "PUBLIC_KEY_DECODE_ERROR\0"
+    "PUBLIC_KEY_ENCODE_ERROR\0"
+    "SHOULD_RETRY\0"
+    "UNABLE_TO_FIND_PARAMETERS_IN_CHAIN\0"
+    "UNABLE_TO_GET_CERTS_PUBLIC_KEY\0"
+    "UNKNOWN_KEY_TYPE\0"
+    "UNKNOWN_PURPOSE_ID\0"
+    "UNKNOWN_TRUST_ID\0"
+    "WRONG_LOOKUP_TYPE\0"
+    "BAD_IP_ADDRESS\0"
+    "BAD_OBJECT\0"
+    "BN_DEC2BN_ERROR\0"
+    "BN_TO_ASN1_INTEGER_ERROR\0"
+    "CANNOT_FIND_FREE_FUNCTION\0"
+    "DIRNAME_ERROR\0"
+    "DISTPOINT_ALREADY_SET\0"
+    "DUPLICATE_ZONE_ID\0"
+    "ERROR_CONVERTING_ZONE\0"
+    "ERROR_CREATING_EXTENSION\0"
+    "ERROR_IN_EXTENSION\0"
+    "EXPECTED_A_SECTION_NAME\0"
+    "EXTENSION_EXISTS\0"
+    "EXTENSION_NAME_ERROR\0"
+    "EXTENSION_NOT_FOUND\0"
+    "EXTENSION_SETTING_NOT_SUPPORTED\0"
+    "EXTENSION_VALUE_ERROR\0"
+    "ILLEGAL_EMPTY_EXTENSION\0"
+    "ILLEGAL_HEX_DIGIT\0"
+    "INCORRECT_POLICY_SYNTAX_TAG\0"
+    "INVALID_BOOLEAN_STRING\0"
+    "INVALID_EXTENSION_STRING\0"
+    "INVALID_MULTIPLE_RDNS\0"
+    "INVALID_NAME\0"
+    "INVALID_NULL_ARGUMENT\0"
+    "INVALID_NULL_NAME\0"
+    "INVALID_NULL_VALUE\0"
+    "INVALID_NUMBERS\0"
+    "INVALID_OBJECT_IDENTIFIER\0"
+    "INVALID_OPTION\0"
+    "INVALID_POLICY_IDENTIFIER\0"
+    "INVALID_PROXY_POLICY_SETTING\0"
+    "INVALID_PURPOSE\0"
+    "INVALID_SECTION\0"
+    "INVALID_SYNTAX\0"
+    "ISSUER_DECODE_ERROR\0"
+    "NEED_ORGANIZATION_AND_NUMBERS\0"
+    "NO_CONFIG_DATABASE\0"
+    "NO_ISSUER_CERTIFICATE\0"
+    "NO_ISSUER_DETAILS\0"
+    "NO_POLICY_IDENTIFIER\0"
+    "NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED\0"
+    "NO_PUBLIC_KEY\0"
+    "NO_SUBJECT_DETAILS\0"
+    "ODD_NUMBER_OF_DIGITS\0"
+    "OPERATION_NOT_DEFINED\0"
+    "OTHERNAME_ERROR\0"
+    "POLICY_LANGUAGE_ALREADY_DEFINED\0"
+    "POLICY_PATH_LENGTH\0"
+    "POLICY_PATH_LENGTH_ALREADY_DEFINED\0"
+    "POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY\0"
+    "SECTION_NOT_FOUND\0"
+    "UNABLE_TO_GET_ISSUER_DETAILS\0"
+    "UNABLE_TO_GET_ISSUER_KEYID\0"
+    "UNKNOWN_BIT_STRING_ARGUMENT\0"
+    "UNKNOWN_EXTENSION\0"
+    "UNKNOWN_EXTENSION_NAME\0"
+    "UNKNOWN_OPTION\0"
+    "UNSUPPORTED_OPTION\0"
+    "USER_TOO_LONG\0"
+    "";
+
diff --git a/third_party/boringssl/linux-aarch64/crypto/aes/aesv8-armx64.S b/third_party/boringssl/linux-aarch64/crypto/aes/aesv8-armx64.S
new file mode 100644
index 0000000..c414476
--- /dev/null
+++ b/third_party/boringssl/linux-aarch64/crypto/aes/aesv8-armx64.S
@@ -0,0 +1,751 @@
+#if defined(__aarch64__)
+#include "arm_arch.h"
+
+#if __ARM_MAX_ARCH__>=7
+.text
+#if !defined(__clang__)
+.arch	armv8-a+crypto
+#endif
+.align	5
+.Lrcon:
+.long	0x01,0x01,0x01,0x01
+.long	0x0c0f0e0d,0x0c0f0e0d,0x0c0f0e0d,0x0c0f0e0d	// rotate-n-splat
+.long	0x1b,0x1b,0x1b,0x1b
+
+.globl	aes_v8_set_encrypt_key
+.type	aes_v8_set_encrypt_key,%function
+.align	5
+aes_v8_set_encrypt_key:
+.Lenc_key:
+	stp	x29,x30,[sp,#-16]!
+	add	x29,sp,#0
+	mov	x3,#-1
+	cmp	x0,#0
+	b.eq	.Lenc_key_abort
+	cmp	x2,#0
+	b.eq	.Lenc_key_abort
+	mov	x3,#-2
+	cmp	w1,#128
+	b.lt	.Lenc_key_abort
+	cmp	w1,#256
+	b.gt	.Lenc_key_abort
+	tst	w1,#0x3f
+	b.ne	.Lenc_key_abort
+
+	adr	x3,.Lrcon
+	cmp	w1,#192
+
+	eor	v0.16b,v0.16b,v0.16b
+	ld1	{v3.16b},[x0],#16
+	mov	w1,#8		// reuse w1
+	ld1	{v1.4s,v2.4s},[x3],#32
+
+	b.lt	.Loop128
+	b.eq	.L192
+	b	.L256
+
+.align	4
+.Loop128:
+	tbl	v6.16b,{v3.16b},v2.16b
+	ext	v5.16b,v0.16b,v3.16b,#12
+	st1	{v3.4s},[x2],#16
+	aese	v6.16b,v0.16b
+	subs	w1,w1,#1
+
+	eor	v3.16b,v3.16b,v5.16b
+	ext	v5.16b,v0.16b,v5.16b,#12
+	eor	v3.16b,v3.16b,v5.16b
+	ext	v5.16b,v0.16b,v5.16b,#12
+	eor	v6.16b,v6.16b,v1.16b
+	eor	v3.16b,v3.16b,v5.16b
+	shl	v1.16b,v1.16b,#1
+	eor	v3.16b,v3.16b,v6.16b
+	b.ne	.Loop128
+
+	ld1	{v1.4s},[x3]
+
+	tbl	v6.16b,{v3.16b},v2.16b
+	ext	v5.16b,v0.16b,v3.16b,#12
+	st1	{v3.4s},[x2],#16
+	aese	v6.16b,v0.16b
+
+	eor	v3.16b,v3.16b,v5.16b
+	ext	v5.16b,v0.16b,v5.16b,#12
+	eor	v3.16b,v3.16b,v5.16b
+	ext	v5.16b,v0.16b,v5.16b,#12
+	eor	v6.16b,v6.16b,v1.16b
+	eor	v3.16b,v3.16b,v5.16b
+	shl	v1.16b,v1.16b,#1
+	eor	v3.16b,v3.16b,v6.16b
+
+	tbl	v6.16b,{v3.16b},v2.16b
+	ext	v5.16b,v0.16b,v3.16b,#12
+	st1	{v3.4s},[x2],#16
+	aese	v6.16b,v0.16b
+
+	eor	v3.16b,v3.16b,v5.16b
+	ext	v5.16b,v0.16b,v5.16b,#12
+	eor	v3.16b,v3.16b,v5.16b
+	ext	v5.16b,v0.16b,v5.16b,#12
+	eor	v6.16b,v6.16b,v1.16b
+	eor	v3.16b,v3.16b,v5.16b
+	eor	v3.16b,v3.16b,v6.16b
+	st1	{v3.4s},[x2]
+	add	x2,x2,#0x50
+
+	mov	w12,#10
+	b	.Ldone
+
+.align	4
+.L192:
+	ld1	{v4.8b},[x0],#8
+	movi	v6.16b,#8			// borrow v6.16b
+	st1	{v3.4s},[x2],#16
+	sub	v2.16b,v2.16b,v6.16b	// adjust the mask
+
+.Loop192:
+	tbl	v6.16b,{v4.16b},v2.16b
+	ext	v5.16b,v0.16b,v3.16b,#12
+	st1	{v4.8b},[x2],#8
+	aese	v6.16b,v0.16b
+	subs	w1,w1,#1
+
+	eor	v3.16b,v3.16b,v5.16b
+	ext	v5.16b,v0.16b,v5.16b,#12
+	eor	v3.16b,v3.16b,v5.16b
+	ext	v5.16b,v0.16b,v5.16b,#12
+	eor	v3.16b,v3.16b,v5.16b
+
+	dup	v5.4s,v3.s[3]
+	eor	v5.16b,v5.16b,v4.16b
+	eor	v6.16b,v6.16b,v1.16b
+	ext	v4.16b,v0.16b,v4.16b,#12
+	shl	v1.16b,v1.16b,#1
+	eor	v4.16b,v4.16b,v5.16b
+	eor	v3.16b,v3.16b,v6.16b
+	eor	v4.16b,v4.16b,v6.16b
+	st1	{v3.4s},[x2],#16
+	b.ne	.Loop192
+
+	mov	w12,#12
+	add	x2,x2,#0x20
+	b	.Ldone
+
+.align	4
+.L256:
+	ld1	{v4.16b},[x0]
+	mov	w1,#7
+	mov	w12,#14
+	st1	{v3.4s},[x2],#16
+
+.Loop256:
+	tbl	v6.16b,{v4.16b},v2.16b
+	ext	v5.16b,v0.16b,v3.16b,#12
+	st1	{v4.4s},[x2],#16
+	aese	v6.16b,v0.16b
+	subs	w1,w1,#1
+
+	eor	v3.16b,v3.16b,v5.16b
+	ext	v5.16b,v0.16b,v5.16b,#12
+	eor	v3.16b,v3.16b,v5.16b
+	ext	v5.16b,v0.16b,v5.16b,#12
+	eor	v6.16b,v6.16b,v1.16b
+	eor	v3.16b,v3.16b,v5.16b
+	shl	v1.16b,v1.16b,#1
+	eor	v3.16b,v3.16b,v6.16b
+	st1	{v3.4s},[x2],#16
+	b.eq	.Ldone
+
+	dup	v6.4s,v3.s[3]		// just splat
+	ext	v5.16b,v0.16b,v4.16b,#12
+	aese	v6.16b,v0.16b
+
+	eor	v4.16b,v4.16b,v5.16b
+	ext	v5.16b,v0.16b,v5.16b,#12
+	eor	v4.16b,v4.16b,v5.16b
+	ext	v5.16b,v0.16b,v5.16b,#12
+	eor	v4.16b,v4.16b,v5.16b
+
+	eor	v4.16b,v4.16b,v6.16b
+	b	.Loop256
+
+.Ldone:
+	str	w12,[x2]
+	mov	x3,#0
+
+.Lenc_key_abort:
+	mov	x0,x3			// return value
+	ldr	x29,[sp],#16
+	ret
+.size	aes_v8_set_encrypt_key,.-aes_v8_set_encrypt_key
+
+.globl	aes_v8_set_decrypt_key
+.type	aes_v8_set_decrypt_key,%function
+.align	5
+aes_v8_set_decrypt_key:
+	stp	x29,x30,[sp,#-16]!
+	add	x29,sp,#0
+	bl	.Lenc_key
+
+	cmp	x0,#0
+	b.ne	.Ldec_key_abort
+
+	sub	x2,x2,#240		// restore original x2
+	mov	x4,#-16
+	add	x0,x2,x12,lsl#4	// end of key schedule
+
+	ld1	{v0.4s},[x2]
+	ld1	{v1.4s},[x0]
+	st1	{v0.4s},[x0],x4
+	st1	{v1.4s},[x2],#16
+
+.Loop_imc:
+	ld1	{v0.4s},[x2]
+	ld1	{v1.4s},[x0]
+	aesimc	v0.16b,v0.16b
+	aesimc	v1.16b,v1.16b
+	st1	{v0.4s},[x0],x4
+	st1	{v1.4s},[x2],#16
+	cmp	x0,x2
+	b.hi	.Loop_imc
+
+	ld1	{v0.4s},[x2]
+	aesimc	v0.16b,v0.16b
+	st1	{v0.4s},[x0]
+
+	eor	x0,x0,x0		// return value
+.Ldec_key_abort:
+	ldp	x29,x30,[sp],#16
+	ret
+.size	aes_v8_set_decrypt_key,.-aes_v8_set_decrypt_key
+.globl	aes_v8_encrypt
+.type	aes_v8_encrypt,%function
+.align	5
+aes_v8_encrypt:
+	ldr	w3,[x2,#240]
+	ld1	{v0.4s},[x2],#16
+	ld1	{v2.16b},[x0]
+	sub	w3,w3,#2
+	ld1	{v1.4s},[x2],#16
+
+.Loop_enc:
+	aese	v2.16b,v0.16b
+	aesmc	v2.16b,v2.16b
+	ld1	{v0.4s},[x2],#16
+	subs	w3,w3,#2
+	aese	v2.16b,v1.16b
+	aesmc	v2.16b,v2.16b
+	ld1	{v1.4s},[x2],#16
+	b.gt	.Loop_enc
+
+	aese	v2.16b,v0.16b
+	aesmc	v2.16b,v2.16b
+	ld1	{v0.4s},[x2]
+	aese	v2.16b,v1.16b
+	eor	v2.16b,v2.16b,v0.16b
+
+	st1	{v2.16b},[x1]
+	ret
+.size	aes_v8_encrypt,.-aes_v8_encrypt
+.globl	aes_v8_decrypt
+.type	aes_v8_decrypt,%function
+.align	5
+aes_v8_decrypt:
+	ldr	w3,[x2,#240]
+	ld1	{v0.4s},[x2],#16
+	ld1	{v2.16b},[x0]
+	sub	w3,w3,#2
+	ld1	{v1.4s},[x2],#16
+
+.Loop_dec:
+	aesd	v2.16b,v0.16b
+	aesimc	v2.16b,v2.16b
+	ld1	{v0.4s},[x2],#16
+	subs	w3,w3,#2
+	aesd	v2.16b,v1.16b
+	aesimc	v2.16b,v2.16b
+	ld1	{v1.4s},[x2],#16
+	b.gt	.Loop_dec
+
+	aesd	v2.16b,v0.16b
+	aesimc	v2.16b,v2.16b
+	ld1	{v0.4s},[x2]
+	aesd	v2.16b,v1.16b
+	eor	v2.16b,v2.16b,v0.16b
+
+	st1	{v2.16b},[x1]
+	ret
+.size	aes_v8_decrypt,.-aes_v8_decrypt
+.globl	aes_v8_cbc_encrypt
+.type	aes_v8_cbc_encrypt,%function
+.align	5
+aes_v8_cbc_encrypt:
+	stp	x29,x30,[sp,#-16]!
+	add	x29,sp,#0
+	subs	x2,x2,#16
+	mov	x8,#16
+	b.lo	.Lcbc_abort
+	csel	x8,xzr,x8,eq
+
+	cmp	w5,#0			// en- or decrypting?
+	ldr	w5,[x3,#240]
+	and	x2,x2,#-16
+	ld1	{v6.16b},[x4]
+	ld1	{v0.16b},[x0],x8
+
+	ld1	{v16.4s,v17.4s},[x3]		// load key schedule...
+	sub	w5,w5,#6
+	add	x7,x3,x5,lsl#4	// pointer to last 7 round keys
+	sub	w5,w5,#2
+	ld1	{v18.4s,v19.4s},[x7],#32
+	ld1	{v20.4s,v21.4s},[x7],#32
+	ld1	{v22.4s,v23.4s},[x7],#32
+	ld1	{v7.4s},[x7]
+
+	add	x7,x3,#32
+	mov	w6,w5
+	b.eq	.Lcbc_dec
+
+	cmp	w5,#2
+	eor	v0.16b,v0.16b,v6.16b
+	eor	v5.16b,v16.16b,v7.16b
+	b.eq	.Lcbc_enc128
+
+	ld1	{v2.4s,v3.4s},[x7]
+	add	x7,x3,#16
+	add	x6,x3,#16*4
+	add	x12,x3,#16*5
+	aese	v0.16b,v16.16b
+	aesmc	v0.16b,v0.16b
+	add	x14,x3,#16*6
+	add	x3,x3,#16*7
+	b	.Lenter_cbc_enc
+
+.align	4
+.Loop_cbc_enc:
+	aese	v0.16b,v16.16b
+	aesmc	v0.16b,v0.16b
+	st1	{v6.16b},[x1],#16
+.Lenter_cbc_enc:
+	aese	v0.16b,v17.16b
+	aesmc	v0.16b,v0.16b
+	aese	v0.16b,v2.16b
+	aesmc	v0.16b,v0.16b
+	ld1	{v16.4s},[x6]
+	cmp	w5,#4
+	aese	v0.16b,v3.16b
+	aesmc	v0.16b,v0.16b
+	ld1	{v17.4s},[x12]
+	b.eq	.Lcbc_enc192
+
+	aese	v0.16b,v16.16b
+	aesmc	v0.16b,v0.16b
+	ld1	{v16.4s},[x14]
+	aese	v0.16b,v17.16b
+	aesmc	v0.16b,v0.16b
+	ld1	{v17.4s},[x3]
+	nop
+
+.Lcbc_enc192:
+	aese	v0.16b,v16.16b
+	aesmc	v0.16b,v0.16b
+	subs	x2,x2,#16
+	aese	v0.16b,v17.16b
+	aesmc	v0.16b,v0.16b
+	csel	x8,xzr,x8,eq
+	aese	v0.16b,v18.16b
+	aesmc	v0.16b,v0.16b
+	aese	v0.16b,v19.16b
+	aesmc	v0.16b,v0.16b
+	ld1	{v16.16b},[x0],x8
+	aese	v0.16b,v20.16b
+	aesmc	v0.16b,v0.16b
+	eor	v16.16b,v16.16b,v5.16b
+	aese	v0.16b,v21.16b
+	aesmc	v0.16b,v0.16b
+	ld1	{v17.4s},[x7]		// re-pre-load rndkey[1]
+	aese	v0.16b,v22.16b
+	aesmc	v0.16b,v0.16b
+	aese	v0.16b,v23.16b
+	eor	v6.16b,v0.16b,v7.16b
+	b.hs	.Loop_cbc_enc
+
+	st1	{v6.16b},[x1],#16
+	b	.Lcbc_done
+
+.align	5
+.Lcbc_enc128:
+	ld1	{v2.4s,v3.4s},[x7]
+	aese	v0.16b,v16.16b
+	aesmc	v0.16b,v0.16b
+	b	.Lenter_cbc_enc128
+.Loop_cbc_enc128:
+	aese	v0.16b,v16.16b
+	aesmc	v0.16b,v0.16b
+	st1	{v6.16b},[x1],#16
+.Lenter_cbc_enc128:
+	aese	v0.16b,v17.16b
+	aesmc	v0.16b,v0.16b
+	subs	x2,x2,#16
+	aese	v0.16b,v2.16b
+	aesmc	v0.16b,v0.16b
+	csel	x8,xzr,x8,eq
+	aese	v0.16b,v3.16b
+	aesmc	v0.16b,v0.16b
+	aese	v0.16b,v18.16b
+	aesmc	v0.16b,v0.16b
+	aese	v0.16b,v19.16b
+	aesmc	v0.16b,v0.16b
+	ld1	{v16.16b},[x0],x8
+	aese	v0.16b,v20.16b
+	aesmc	v0.16b,v0.16b
+	aese	v0.16b,v21.16b
+	aesmc	v0.16b,v0.16b
+	aese	v0.16b,v22.16b
+	aesmc	v0.16b,v0.16b
+	eor	v16.16b,v16.16b,v5.16b
+	aese	v0.16b,v23.16b
+	eor	v6.16b,v0.16b,v7.16b
+	b.hs	.Loop_cbc_enc128
+
+	st1	{v6.16b},[x1],#16
+	b	.Lcbc_done
+.align	5
+.Lcbc_dec:
+	ld1	{v18.16b},[x0],#16
+	subs	x2,x2,#32		// bias
+	add	w6,w5,#2
+	orr	v3.16b,v0.16b,v0.16b
+	orr	v1.16b,v0.16b,v0.16b
+	orr	v19.16b,v18.16b,v18.16b
+	b.lo	.Lcbc_dec_tail
+
+	orr	v1.16b,v18.16b,v18.16b
+	ld1	{v18.16b},[x0],#16
+	orr	v2.16b,v0.16b,v0.16b
+	orr	v3.16b,v1.16b,v1.16b
+	orr	v19.16b,v18.16b,v18.16b
+
+.Loop3x_cbc_dec:
+	aesd	v0.16b,v16.16b
+	aesimc	v0.16b,v0.16b
+	aesd	v1.16b,v16.16b
+	aesimc	v1.16b,v1.16b
+	aesd	v18.16b,v16.16b
+	aesimc	v18.16b,v18.16b
+	ld1	{v16.4s},[x7],#16
+	subs	w6,w6,#2
+	aesd	v0.16b,v17.16b
+	aesimc	v0.16b,v0.16b
+	aesd	v1.16b,v17.16b
+	aesimc	v1.16b,v1.16b
+	aesd	v18.16b,v17.16b
+	aesimc	v18.16b,v18.16b
+	ld1	{v17.4s},[x7],#16
+	b.gt	.Loop3x_cbc_dec
+
+	aesd	v0.16b,v16.16b
+	aesimc	v0.16b,v0.16b
+	aesd	v1.16b,v16.16b
+	aesimc	v1.16b,v1.16b
+	aesd	v18.16b,v16.16b
+	aesimc	v18.16b,v18.16b
+	eor	v4.16b,v6.16b,v7.16b
+	subs	x2,x2,#0x30
+	eor	v5.16b,v2.16b,v7.16b
+	csel	x6,x2,x6,lo			// x6, w6, is zero at this point
+	aesd	v0.16b,v17.16b
+	aesimc	v0.16b,v0.16b
+	aesd	v1.16b,v17.16b
+	aesimc	v1.16b,v1.16b
+	aesd	v18.16b,v17.16b
+	aesimc	v18.16b,v18.16b
+	eor	v17.16b,v3.16b,v7.16b
+	add	x0,x0,x6		// x0 is adjusted in such way that
+					// at exit from the loop v1.16b-v18.16b
+					// are loaded with last "words"
+	orr	v6.16b,v19.16b,v19.16b
+	mov	x7,x3
+	aesd	v0.16b,v20.16b
+	aesimc	v0.16b,v0.16b
+	aesd	v1.16b,v20.16b
+	aesimc	v1.16b,v1.16b
+	aesd	v18.16b,v20.16b
+	aesimc	v18.16b,v18.16b
+	ld1	{v2.16b},[x0],#16
+	aesd	v0.16b,v21.16b
+	aesimc	v0.16b,v0.16b
+	aesd	v1.16b,v21.16b
+	aesimc	v1.16b,v1.16b
+	aesd	v18.16b,v21.16b
+	aesimc	v18.16b,v18.16b
+	ld1	{v3.16b},[x0],#16
+	aesd	v0.16b,v22.16b
+	aesimc	v0.16b,v0.16b
+	aesd	v1.16b,v22.16b
+	aesimc	v1.16b,v1.16b
+	aesd	v18.16b,v22.16b
+	aesimc	v18.16b,v18.16b
+	ld1	{v19.16b},[x0],#16
+	aesd	v0.16b,v23.16b
+	aesd	v1.16b,v23.16b
+	aesd	v18.16b,v23.16b
+	ld1	{v16.4s},[x7],#16	// re-pre-load rndkey[0]
+	add	w6,w5,#2
+	eor	v4.16b,v4.16b,v0.16b
+	eor	v5.16b,v5.16b,v1.16b
+	eor	v18.16b,v18.16b,v17.16b
+	ld1	{v17.4s},[x7],#16	// re-pre-load rndkey[1]
+	st1	{v4.16b},[x1],#16
+	orr	v0.16b,v2.16b,v2.16b
+	st1	{v5.16b},[x1],#16
+	orr	v1.16b,v3.16b,v3.16b
+	st1	{v18.16b},[x1],#16
+	orr	v18.16b,v19.16b,v19.16b
+	b.hs	.Loop3x_cbc_dec
+
+	cmn	x2,#0x30
+	b.eq	.Lcbc_done
+	nop
+
+.Lcbc_dec_tail:
+	aesd	v1.16b,v16.16b
+	aesimc	v1.16b,v1.16b
+	aesd	v18.16b,v16.16b
+	aesimc	v18.16b,v18.16b
+	ld1	{v16.4s},[x7],#16
+	subs	w6,w6,#2
+	aesd	v1.16b,v17.16b
+	aesimc	v1.16b,v1.16b
+	aesd	v18.16b,v17.16b
+	aesimc	v18.16b,v18.16b
+	ld1	{v17.4s},[x7],#16
+	b.gt	.Lcbc_dec_tail
+
+	aesd	v1.16b,v16.16b
+	aesimc	v1.16b,v1.16b
+	aesd	v18.16b,v16.16b
+	aesimc	v18.16b,v18.16b
+	aesd	v1.16b,v17.16b
+	aesimc	v1.16b,v1.16b
+	aesd	v18.16b,v17.16b
+	aesimc	v18.16b,v18.16b
+	aesd	v1.16b,v20.16b
+	aesimc	v1.16b,v1.16b
+	aesd	v18.16b,v20.16b
+	aesimc	v18.16b,v18.16b
+	cmn	x2,#0x20
+	aesd	v1.16b,v21.16b
+	aesimc	v1.16b,v1.16b
+	aesd	v18.16b,v21.16b
+	aesimc	v18.16b,v18.16b
+	eor	v5.16b,v6.16b,v7.16b
+	aesd	v1.16b,v22.16b
+	aesimc	v1.16b,v1.16b
+	aesd	v18.16b,v22.16b
+	aesimc	v18.16b,v18.16b
+	eor	v17.16b,v3.16b,v7.16b
+	aesd	v1.16b,v23.16b
+	aesd	v18.16b,v23.16b
+	b.eq	.Lcbc_dec_one
+	eor	v5.16b,v5.16b,v1.16b
+	eor	v17.16b,v17.16b,v18.16b
+	orr	v6.16b,v19.16b,v19.16b
+	st1	{v5.16b},[x1],#16
+	st1	{v17.16b},[x1],#16
+	b	.Lcbc_done
+
+.Lcbc_dec_one:
+	eor	v5.16b,v5.16b,v18.16b
+	orr	v6.16b,v19.16b,v19.16b
+	st1	{v5.16b},[x1],#16
+
+.Lcbc_done:
+	st1	{v6.16b},[x4]
+.Lcbc_abort:
+	ldr	x29,[sp],#16
+	ret
+.size	aes_v8_cbc_encrypt,.-aes_v8_cbc_encrypt
+.globl	aes_v8_ctr32_encrypt_blocks
+.type	aes_v8_ctr32_encrypt_blocks,%function
+.align	5
+aes_v8_ctr32_encrypt_blocks:
+	stp	x29,x30,[sp,#-16]!
+	add	x29,sp,#0
+	ldr	w5,[x3,#240]
+
+	ldr	w8, [x4, #12]
+	ld1	{v0.4s},[x4]
+
+	ld1	{v16.4s,v17.4s},[x3]		// load key schedule...
+	sub	w5,w5,#4
+	mov	x12,#16
+	cmp	x2,#2
+	add	x7,x3,x5,lsl#4	// pointer to last 5 round keys
+	sub	w5,w5,#2
+	ld1	{v20.4s,v21.4s},[x7],#32
+	ld1	{v22.4s,v23.4s},[x7],#32
+	ld1	{v7.4s},[x7]
+	add	x7,x3,#32
+	mov	w6,w5
+	csel	x12,xzr,x12,lo
+#ifndef __ARMEB__
+	rev	w8, w8
+#endif
+	orr	v1.16b,v0.16b,v0.16b
+	add	w10, w8, #1
+	orr	v18.16b,v0.16b,v0.16b
+	add	w8, w8, #2
+	orr	v6.16b,v0.16b,v0.16b
+	rev	w10, w10
+	mov	v1.s[3],w10
+	b.ls	.Lctr32_tail
+	rev	w12, w8
+	sub	x2,x2,#3		// bias
+	mov	v18.s[3],w12
+	b	.Loop3x_ctr32
+
+.align	4
+.Loop3x_ctr32:
+	aese	v0.16b,v16.16b
+	aesmc	v0.16b,v0.16b
+	aese	v1.16b,v16.16b
+	aesmc	v1.16b,v1.16b
+	aese	v18.16b,v16.16b
+	aesmc	v18.16b,v18.16b
+	ld1	{v16.4s},[x7],#16
+	subs	w6,w6,#2
+	aese	v0.16b,v17.16b
+	aesmc	v0.16b,v0.16b
+	aese	v1.16b,v17.16b
+	aesmc	v1.16b,v1.16b
+	aese	v18.16b,v17.16b
+	aesmc	v18.16b,v18.16b
+	ld1	{v17.4s},[x7],#16
+	b.gt	.Loop3x_ctr32
+
+	aese	v0.16b,v16.16b
+	aesmc	v4.16b,v0.16b
+	aese	v1.16b,v16.16b
+	aesmc	v5.16b,v1.16b
+	ld1	{v2.16b},[x0],#16
+	orr	v0.16b,v6.16b,v6.16b
+	aese	v18.16b,v16.16b
+	aesmc	v18.16b,v18.16b
+	ld1	{v3.16b},[x0],#16
+	orr	v1.16b,v6.16b,v6.16b
+	aese	v4.16b,v17.16b
+	aesmc	v4.16b,v4.16b
+	aese	v5.16b,v17.16b
+	aesmc	v5.16b,v5.16b
+	ld1	{v19.16b},[x0],#16
+	mov	x7,x3
+	aese	v18.16b,v17.16b
+	aesmc	v17.16b,v18.16b
+	orr	v18.16b,v6.16b,v6.16b
+	add	w9,w8,#1
+	aese	v4.16b,v20.16b
+	aesmc	v4.16b,v4.16b
+	aese	v5.16b,v20.16b
+	aesmc	v5.16b,v5.16b
+	eor	v2.16b,v2.16b,v7.16b
+	add	w10,w8,#2
+	aese	v17.16b,v20.16b
+	aesmc	v17.16b,v17.16b
+	eor	v3.16b,v3.16b,v7.16b
+	add	w8,w8,#3
+	aese	v4.16b,v21.16b
+	aesmc	v4.16b,v4.16b
+	aese	v5.16b,v21.16b
+	aesmc	v5.16b,v5.16b
+	eor	v19.16b,v19.16b,v7.16b
+	rev	w9,w9
+	aese	v17.16b,v21.16b
+	aesmc	v17.16b,v17.16b
+	mov	v0.s[3], w9
+	rev	w10,w10
+	aese	v4.16b,v22.16b
+	aesmc	v4.16b,v4.16b
+	aese	v5.16b,v22.16b
+	aesmc	v5.16b,v5.16b
+	mov	v1.s[3], w10
+	rev	w12,w8
+	aese	v17.16b,v22.16b
+	aesmc	v17.16b,v17.16b
+	mov	v18.s[3], w12
+	subs	x2,x2,#3
+	aese	v4.16b,v23.16b
+	aese	v5.16b,v23.16b
+	aese	v17.16b,v23.16b
+
+	eor	v2.16b,v2.16b,v4.16b
+	ld1	{v16.4s},[x7],#16	// re-pre-load rndkey[0]
+	st1	{v2.16b},[x1],#16
+	eor	v3.16b,v3.16b,v5.16b
+	mov	w6,w5
+	st1	{v3.16b},[x1],#16
+	eor	v19.16b,v19.16b,v17.16b
+	ld1	{v17.4s},[x7],#16	// re-pre-load rndkey[1]
+	st1	{v19.16b},[x1],#16
+	b.hs	.Loop3x_ctr32
+
+	adds	x2,x2,#3
+	b.eq	.Lctr32_done
+	cmp	x2,#1
+	mov	x12,#16
+	csel	x12,xzr,x12,eq
+
+.Lctr32_tail:
+	aese	v0.16b,v16.16b
+	aesmc	v0.16b,v0.16b
+	aese	v1.16b,v16.16b
+	aesmc	v1.16b,v1.16b
+	ld1	{v16.4s},[x7],#16
+	subs	w6,w6,#2
+	aese	v0.16b,v17.16b
+	aesmc	v0.16b,v0.16b
+	aese	v1.16b,v17.16b
+	aesmc	v1.16b,v1.16b
+	ld1	{v17.4s},[x7],#16
+	b.gt	.Lctr32_tail
+
+	aese	v0.16b,v16.16b
+	aesmc	v0.16b,v0.16b
+	aese	v1.16b,v16.16b
+	aesmc	v1.16b,v1.16b
+	aese	v0.16b,v17.16b
+	aesmc	v0.16b,v0.16b
+	aese	v1.16b,v17.16b
+	aesmc	v1.16b,v1.16b
+	ld1	{v2.16b},[x0],x12
+	aese	v0.16b,v20.16b
+	aesmc	v0.16b,v0.16b
+	aese	v1.16b,v20.16b
+	aesmc	v1.16b,v1.16b
+	ld1	{v3.16b},[x0]
+	aese	v0.16b,v21.16b
+	aesmc	v0.16b,v0.16b
+	aese	v1.16b,v21.16b
+	aesmc	v1.16b,v1.16b
+	eor	v2.16b,v2.16b,v7.16b
+	aese	v0.16b,v22.16b
+	aesmc	v0.16b,v0.16b
+	aese	v1.16b,v22.16b
+	aesmc	v1.16b,v1.16b
+	eor	v3.16b,v3.16b,v7.16b
+	aese	v0.16b,v23.16b
+	aese	v1.16b,v23.16b
+
+	cmp	x2,#1
+	eor	v2.16b,v2.16b,v0.16b
+	eor	v3.16b,v3.16b,v1.16b
+	st1	{v2.16b},[x1],#16
+	b.eq	.Lctr32_done
+	st1	{v3.16b},[x1]
+
+.Lctr32_done:
+	ldr	x29,[sp],#16
+	ret
+.size	aes_v8_ctr32_encrypt_blocks,.-aes_v8_ctr32_encrypt_blocks
+#endif
+#endif
\ No newline at end of file
diff --git a/third_party/boringssl/linux-aarch64/crypto/modes/ghashv8-armx64.S b/third_party/boringssl/linux-aarch64/crypto/modes/ghashv8-armx64.S
new file mode 100644
index 0000000..a0a9b680
--- /dev/null
+++ b/third_party/boringssl/linux-aarch64/crypto/modes/ghashv8-armx64.S
@@ -0,0 +1,232 @@
+#if defined(__aarch64__)
+#include "arm_arch.h"
+
+.text
+#if !defined(__clang__)
+.arch	armv8-a+crypto
+#endif
+.globl	gcm_init_v8
+.type	gcm_init_v8,%function
+.align	4
+gcm_init_v8:
+	ld1	{v17.2d},[x1]		//load input H
+	movi	v19.16b,#0xe1
+	shl	v19.2d,v19.2d,#57		//0xc2.0
+	ext	v3.16b,v17.16b,v17.16b,#8
+	ushr	v18.2d,v19.2d,#63
+	dup	v17.4s,v17.s[1]
+	ext	v16.16b,v18.16b,v19.16b,#8		//t0=0xc2....01
+	ushr	v18.2d,v3.2d,#63
+	sshr	v17.4s,v17.4s,#31		//broadcast carry bit
+	and	v18.16b,v18.16b,v16.16b
+	shl	v3.2d,v3.2d,#1
+	ext	v18.16b,v18.16b,v18.16b,#8
+	and	v16.16b,v16.16b,v17.16b
+	orr	v3.16b,v3.16b,v18.16b		//H<<<=1
+	eor	v20.16b,v3.16b,v16.16b		//twisted H
+	st1	{v20.2d},[x0],#16		//store Htable[0]
+
+	//calculate H^2
+	ext	v16.16b,v20.16b,v20.16b,#8		//Karatsuba pre-processing
+	pmull	v0.1q,v20.1d,v20.1d
+	eor	v16.16b,v16.16b,v20.16b
+	pmull2	v2.1q,v20.2d,v20.2d
+	pmull	v1.1q,v16.1d,v16.1d
+
+	ext	v17.16b,v0.16b,v2.16b,#8		//Karatsuba post-processing
+	eor	v18.16b,v0.16b,v2.16b
+	eor	v1.16b,v1.16b,v17.16b
+	eor	v1.16b,v1.16b,v18.16b
+	pmull	v18.1q,v0.1d,v19.1d		//1st phase
+
+	ins	v2.d[0],v1.d[1]
+	ins	v1.d[1],v0.d[0]
+	eor	v0.16b,v1.16b,v18.16b
+
+	ext	v18.16b,v0.16b,v0.16b,#8		//2nd phase
+	pmull	v0.1q,v0.1d,v19.1d
+	eor	v18.16b,v18.16b,v2.16b
+	eor	v22.16b,v0.16b,v18.16b
+
+	ext	v17.16b,v22.16b,v22.16b,#8		//Karatsuba pre-processing
+	eor	v17.16b,v17.16b,v22.16b
+	ext	v21.16b,v16.16b,v17.16b,#8		//pack Karatsuba pre-processed
+	st1	{v21.2d,v22.2d},[x0]		//store Htable[1..2]
+
+	ret
+.size	gcm_init_v8,.-gcm_init_v8
+.globl	gcm_gmult_v8
+.type	gcm_gmult_v8,%function
+.align	4
+gcm_gmult_v8:
+	ld1	{v17.2d},[x0]		//load Xi
+	movi	v19.16b,#0xe1
+	ld1	{v20.2d,v21.2d},[x1]	//load twisted H, ...
+	shl	v19.2d,v19.2d,#57
+#ifndef __ARMEB__
+	rev64	v17.16b,v17.16b
+#endif
+	ext	v3.16b,v17.16b,v17.16b,#8
+
+	pmull	v0.1q,v20.1d,v3.1d		//H.lo·Xi.lo
+	eor	v17.16b,v17.16b,v3.16b		//Karatsuba pre-processing
+	pmull2	v2.1q,v20.2d,v3.2d		//H.hi·Xi.hi
+	pmull	v1.1q,v21.1d,v17.1d		//(H.lo+H.hi)·(Xi.lo+Xi.hi)
+
+	ext	v17.16b,v0.16b,v2.16b,#8		//Karatsuba post-processing
+	eor	v18.16b,v0.16b,v2.16b
+	eor	v1.16b,v1.16b,v17.16b
+	eor	v1.16b,v1.16b,v18.16b
+	pmull	v18.1q,v0.1d,v19.1d		//1st phase of reduction
+
+	ins	v2.d[0],v1.d[1]
+	ins	v1.d[1],v0.d[0]
+	eor	v0.16b,v1.16b,v18.16b
+
+	ext	v18.16b,v0.16b,v0.16b,#8		//2nd phase of reduction
+	pmull	v0.1q,v0.1d,v19.1d
+	eor	v18.16b,v18.16b,v2.16b
+	eor	v0.16b,v0.16b,v18.16b
+
+#ifndef __ARMEB__
+	rev64	v0.16b,v0.16b
+#endif
+	ext	v0.16b,v0.16b,v0.16b,#8
+	st1	{v0.2d},[x0]		//write out Xi
+
+	ret
+.size	gcm_gmult_v8,.-gcm_gmult_v8
+.globl	gcm_ghash_v8
+.type	gcm_ghash_v8,%function
+.align	4
+gcm_ghash_v8:
+	ld1	{v0.2d},[x0]		//load [rotated] Xi
+						//"[rotated]" means that
+						//loaded value would have
+						//to be rotated in order to
+						//make it appear as in
+						//alorithm specification
+	subs	x3,x3,#32		//see if x3 is 32 or larger
+	mov	x12,#16		//x12 is used as post-
+						//increment for input pointer;
+						//as loop is modulo-scheduled
+						//x12 is zeroed just in time
+						//to preclude oversteping
+						//inp[len], which means that
+						//last block[s] are actually
+						//loaded twice, but last
+						//copy is not processed
+	ld1	{v20.2d,v21.2d},[x1],#32	//load twisted H, ..., H^2
+	movi	v19.16b,#0xe1
+	ld1	{v22.2d},[x1]
+	csel	x12,xzr,x12,eq			//is it time to zero x12?
+	ext	v0.16b,v0.16b,v0.16b,#8		//rotate Xi
+	ld1	{v16.2d},[x2],#16	//load [rotated] I[0]
+	shl	v19.2d,v19.2d,#57		//compose 0xc2.0 constant
+#ifndef __ARMEB__
+	rev64	v16.16b,v16.16b
+	rev64	v0.16b,v0.16b
+#endif
+	ext	v3.16b,v16.16b,v16.16b,#8		//rotate I[0]
+	b.lo	.Lodd_tail_v8		//x3 was less than 32
+	ld1	{v17.2d},[x2],x12	//load [rotated] I[1]
+#ifndef __ARMEB__
+	rev64	v17.16b,v17.16b
+#endif
+	ext	v7.16b,v17.16b,v17.16b,#8
+	eor	v3.16b,v3.16b,v0.16b		//I[i]^=Xi
+	pmull	v4.1q,v20.1d,v7.1d		//H·Ii+1
+	eor	v17.16b,v17.16b,v7.16b		//Karatsuba pre-processing
+	pmull2	v6.1q,v20.2d,v7.2d
+	b	.Loop_mod2x_v8
+
+.align	4
+.Loop_mod2x_v8:
+	ext	v18.16b,v3.16b,v3.16b,#8
+	subs	x3,x3,#32		//is there more data?
+	pmull	v0.1q,v22.1d,v3.1d		//H^2.lo·Xi.lo
+	csel	x12,xzr,x12,lo			//is it time to zero x12?
+
+	pmull	v5.1q,v21.1d,v17.1d
+	eor	v18.16b,v18.16b,v3.16b		//Karatsuba pre-processing
+	pmull2	v2.1q,v22.2d,v3.2d		//H^2.hi·Xi.hi
+	eor	v0.16b,v0.16b,v4.16b		//accumulate
+	pmull2	v1.1q,v21.2d,v18.2d		//(H^2.lo+H^2.hi)·(Xi.lo+Xi.hi)
+	ld1	{v16.2d},[x2],x12	//load [rotated] I[i+2]
+
+	eor	v2.16b,v2.16b,v6.16b
+	csel	x12,xzr,x12,eq			//is it time to zero x12?
+	eor	v1.16b,v1.16b,v5.16b
+
+	ext	v17.16b,v0.16b,v2.16b,#8		//Karatsuba post-processing
+	eor	v18.16b,v0.16b,v2.16b
+	eor	v1.16b,v1.16b,v17.16b
+	ld1	{v17.2d},[x2],x12	//load [rotated] I[i+3]
+#ifndef __ARMEB__
+	rev64	v16.16b,v16.16b
+#endif
+	eor	v1.16b,v1.16b,v18.16b
+	pmull	v18.1q,v0.1d,v19.1d		//1st phase of reduction
+
+#ifndef __ARMEB__
+	rev64	v17.16b,v17.16b
+#endif
+	ins	v2.d[0],v1.d[1]
+	ins	v1.d[1],v0.d[0]
+	ext	v7.16b,v17.16b,v17.16b,#8
+	ext	v3.16b,v16.16b,v16.16b,#8
+	eor	v0.16b,v1.16b,v18.16b
+	pmull	v4.1q,v20.1d,v7.1d		//H·Ii+1
+	eor	v3.16b,v3.16b,v2.16b		//accumulate v3.16b early
+
+	ext	v18.16b,v0.16b,v0.16b,#8		//2nd phase of reduction
+	pmull	v0.1q,v0.1d,v19.1d
+	eor	v3.16b,v3.16b,v18.16b
+	eor	v17.16b,v17.16b,v7.16b		//Karatsuba pre-processing
+	eor	v3.16b,v3.16b,v0.16b
+	pmull2	v6.1q,v20.2d,v7.2d
+	b.hs	.Loop_mod2x_v8		//there was at least 32 more bytes
+
+	eor	v2.16b,v2.16b,v18.16b
+	ext	v3.16b,v16.16b,v16.16b,#8		//re-construct v3.16b
+	adds	x3,x3,#32		//re-construct x3
+	eor	v0.16b,v0.16b,v2.16b		//re-construct v0.16b
+	b.eq	.Ldone_v8		//is x3 zero?
+.Lodd_tail_v8:
+	ext	v18.16b,v0.16b,v0.16b,#8
+	eor	v3.16b,v3.16b,v0.16b		//inp^=Xi
+	eor	v17.16b,v16.16b,v18.16b		//v17.16b is rotated inp^Xi
+
+	pmull	v0.1q,v20.1d,v3.1d		//H.lo·Xi.lo
+	eor	v17.16b,v17.16b,v3.16b		//Karatsuba pre-processing
+	pmull2	v2.1q,v20.2d,v3.2d		//H.hi·Xi.hi
+	pmull	v1.1q,v21.1d,v17.1d		//(H.lo+H.hi)·(Xi.lo+Xi.hi)
+
+	ext	v17.16b,v0.16b,v2.16b,#8		//Karatsuba post-processing
+	eor	v18.16b,v0.16b,v2.16b
+	eor	v1.16b,v1.16b,v17.16b
+	eor	v1.16b,v1.16b,v18.16b
+	pmull	v18.1q,v0.1d,v19.1d		//1st phase of reduction
+
+	ins	v2.d[0],v1.d[1]
+	ins	v1.d[1],v0.d[0]
+	eor	v0.16b,v1.16b,v18.16b
+
+	ext	v18.16b,v0.16b,v0.16b,#8		//2nd phase of reduction
+	pmull	v0.1q,v0.1d,v19.1d
+	eor	v18.16b,v18.16b,v2.16b
+	eor	v0.16b,v0.16b,v18.16b
+
+.Ldone_v8:
+#ifndef __ARMEB__
+	rev64	v0.16b,v0.16b
+#endif
+	ext	v0.16b,v0.16b,v0.16b,#8
+	st1	{v0.2d},[x0]		//write out Xi
+
+	ret
+.size	gcm_ghash_v8,.-gcm_ghash_v8
+.byte	71,72,65,83,72,32,102,111,114,32,65,82,77,118,56,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0
+.align	2
+.align	2
+#endif
\ No newline at end of file
diff --git a/third_party/boringssl/linux-aarch64/crypto/sha/sha1-armv8.S b/third_party/boringssl/linux-aarch64/crypto/sha/sha1-armv8.S
new file mode 100644
index 0000000..487a497
--- /dev/null
+++ b/third_party/boringssl/linux-aarch64/crypto/sha/sha1-armv8.S
@@ -0,0 +1,1215 @@
+#if defined(__aarch64__)
+#include "arm_arch.h"
+
+.text
+
+
+.globl	sha1_block_data_order
+.type	sha1_block_data_order,%function
+.align	6
+sha1_block_data_order:
+	ldr	x16,.LOPENSSL_armcap_P
+	adr	x17,.LOPENSSL_armcap_P
+	add	x16,x16,x17
+	ldr	w16,[x16]
+	tst	w16,#ARMV8_SHA1
+	b.ne	.Lv8_entry
+
+	stp	x29,x30,[sp,#-96]!
+	add	x29,sp,#0
+	stp	x19,x20,[sp,#16]
+	stp	x21,x22,[sp,#32]
+	stp	x23,x24,[sp,#48]
+	stp	x25,x26,[sp,#64]
+	stp	x27,x28,[sp,#80]
+
+	ldp	w20,w21,[x0]
+	ldp	w22,w23,[x0,#8]
+	ldr	w24,[x0,#16]
+
+.Loop:
+	ldr	x3,[x1],#64
+	movz	w28,#0x7999
+	sub	x2,x2,#1
+	movk	w28,#0x5a82,lsl#16
+#ifdef	__ARMEB__
+	ror	x3,x3,#32
+#else
+	rev32	x3,x3
+#endif
+	add	w24,w24,w28		// warm it up
+	add	w24,w24,w3
+	lsr	x4,x3,#32
+	ldr	x5,[x1,#-56]
+	bic	w25,w23,w21
+	and	w26,w22,w21
+	ror	w27,w20,#27
+	add	w23,w23,w28		// future e+=K
+	orr	w25,w25,w26
+	add	w24,w24,w27		// e+=rot(a,5)
+	ror	w21,w21,#2
+	add	w23,w23,w4	// future e+=X[i]
+	add	w24,w24,w25		// e+=F(b,c,d)
+#ifdef	__ARMEB__
+	ror	x5,x5,#32
+#else
+	rev32	x5,x5
+#endif
+	bic	w25,w22,w20
+	and	w26,w21,w20
+	ror	w27,w24,#27
+	add	w22,w22,w28		// future e+=K
+	orr	w25,w25,w26
+	add	w23,w23,w27		// e+=rot(a,5)
+	ror	w20,w20,#2
+	add	w22,w22,w5	// future e+=X[i]
+	add	w23,w23,w25		// e+=F(b,c,d)
+	lsr	x6,x5,#32
+	ldr	x7,[x1,#-48]
+	bic	w25,w21,w24
+	and	w26,w20,w24
+	ror	w27,w23,#27
+	add	w21,w21,w28		// future e+=K
+	orr	w25,w25,w26
+	add	w22,w22,w27		// e+=rot(a,5)
+	ror	w24,w24,#2
+	add	w21,w21,w6	// future e+=X[i]
+	add	w22,w22,w25		// e+=F(b,c,d)
+#ifdef	__ARMEB__
+	ror	x7,x7,#32
+#else
+	rev32	x7,x7
+#endif
+	bic	w25,w20,w23
+	and	w26,w24,w23
+	ror	w27,w22,#27
+	add	w20,w20,w28		// future e+=K
+	orr	w25,w25,w26
+	add	w21,w21,w27		// e+=rot(a,5)
+	ror	w23,w23,#2
+	add	w20,w20,w7	// future e+=X[i]
+	add	w21,w21,w25		// e+=F(b,c,d)
+	lsr	x8,x7,#32
+	ldr	x9,[x1,#-40]
+	bic	w25,w24,w22
+	and	w26,w23,w22
+	ror	w27,w21,#27
+	add	w24,w24,w28		// future e+=K
+	orr	w25,w25,w26
+	add	w20,w20,w27		// e+=rot(a,5)
+	ror	w22,w22,#2
+	add	w24,w24,w8	// future e+=X[i]
+	add	w20,w20,w25		// e+=F(b,c,d)
+#ifdef	__ARMEB__
+	ror	x9,x9,#32
+#else
+	rev32	x9,x9
+#endif
+	bic	w25,w23,w21
+	and	w26,w22,w21
+	ror	w27,w20,#27
+	add	w23,w23,w28		// future e+=K
+	orr	w25,w25,w26
+	add	w24,w24,w27		// e+=rot(a,5)
+	ror	w21,w21,#2
+	add	w23,w23,w9	// future e+=X[i]
+	add	w24,w24,w25		// e+=F(b,c,d)
+	lsr	x10,x9,#32
+	ldr	x11,[x1,#-32]
+	bic	w25,w22,w20
+	and	w26,w21,w20
+	ror	w27,w24,#27
+	add	w22,w22,w28		// future e+=K
+	orr	w25,w25,w26
+	add	w23,w23,w27		// e+=rot(a,5)
+	ror	w20,w20,#2
+	add	w22,w22,w10	// future e+=X[i]
+	add	w23,w23,w25		// e+=F(b,c,d)
+#ifdef	__ARMEB__
+	ror	x11,x11,#32
+#else
+	rev32	x11,x11
+#endif
+	bic	w25,w21,w24
+	and	w26,w20,w24
+	ror	w27,w23,#27
+	add	w21,w21,w28		// future e+=K
+	orr	w25,w25,w26
+	add	w22,w22,w27		// e+=rot(a,5)
+	ror	w24,w24,#2
+	add	w21,w21,w11	// future e+=X[i]
+	add	w22,w22,w25		// e+=F(b,c,d)
+	lsr	x12,x11,#32
+	ldr	x13,[x1,#-24]
+	bic	w25,w20,w23
+	and	w26,w24,w23
+	ror	w27,w22,#27
+	add	w20,w20,w28		// future e+=K
+	orr	w25,w25,w26
+	add	w21,w21,w27		// e+=rot(a,5)
+	ror	w23,w23,#2
+	add	w20,w20,w12	// future e+=X[i]
+	add	w21,w21,w25		// e+=F(b,c,d)
+#ifdef	__ARMEB__
+	ror	x13,x13,#32
+#else
+	rev32	x13,x13
+#endif
+	bic	w25,w24,w22
+	and	w26,w23,w22
+	ror	w27,w21,#27
+	add	w24,w24,w28		// future e+=K
+	orr	w25,w25,w26
+	add	w20,w20,w27		// e+=rot(a,5)
+	ror	w22,w22,#2
+	add	w24,w24,w13	// future e+=X[i]
+	add	w20,w20,w25		// e+=F(b,c,d)
+	lsr	x14,x13,#32
+	ldr	x15,[x1,#-16]
+	bic	w25,w23,w21
+	and	w26,w22,w21
+	ror	w27,w20,#27
+	add	w23,w23,w28		// future e+=K
+	orr	w25,w25,w26
+	add	w24,w24,w27		// e+=rot(a,5)
+	ror	w21,w21,#2
+	add	w23,w23,w14	// future e+=X[i]
+	add	w24,w24,w25		// e+=F(b,c,d)
+#ifdef	__ARMEB__
+	ror	x15,x15,#32
+#else
+	rev32	x15,x15
+#endif
+	bic	w25,w22,w20
+	and	w26,w21,w20
+	ror	w27,w24,#27
+	add	w22,w22,w28		// future e+=K
+	orr	w25,w25,w26
+	add	w23,w23,w27		// e+=rot(a,5)
+	ror	w20,w20,#2
+	add	w22,w22,w15	// future e+=X[i]
+	add	w23,w23,w25		// e+=F(b,c,d)
+	lsr	x16,x15,#32
+	ldr	x17,[x1,#-8]
+	bic	w25,w21,w24
+	and	w26,w20,w24
+	ror	w27,w23,#27
+	add	w21,w21,w28		// future e+=K
+	orr	w25,w25,w26
+	add	w22,w22,w27		// e+=rot(a,5)
+	ror	w24,w24,#2
+	add	w21,w21,w16	// future e+=X[i]
+	add	w22,w22,w25		// e+=F(b,c,d)
+#ifdef	__ARMEB__
+	ror	x17,x17,#32
+#else
+	rev32	x17,x17
+#endif
+	bic	w25,w20,w23
+	and	w26,w24,w23
+	ror	w27,w22,#27
+	add	w20,w20,w28		// future e+=K
+	orr	w25,w25,w26
+	add	w21,w21,w27		// e+=rot(a,5)
+	ror	w23,w23,#2
+	add	w20,w20,w17	// future e+=X[i]
+	add	w21,w21,w25		// e+=F(b,c,d)
+	lsr	x19,x17,#32
+	eor	w3,w3,w5
+	bic	w25,w24,w22
+	and	w26,w23,w22
+	ror	w27,w21,#27
+	eor	w3,w3,w11
+	add	w24,w24,w28		// future e+=K
+	orr	w25,w25,w26
+	add	w20,w20,w27		// e+=rot(a,5)
+	eor	w3,w3,w16
+	ror	w22,w22,#2
+	add	w24,w24,w19	// future e+=X[i]
+	add	w20,w20,w25		// e+=F(b,c,d)
+	ror	w3,w3,#31
+	eor	w4,w4,w6
+	bic	w25,w23,w21
+	and	w26,w22,w21
+	ror	w27,w20,#27
+	eor	w4,w4,w12
+	add	w23,w23,w28		// future e+=K
+	orr	w25,w25,w26
+	add	w24,w24,w27		// e+=rot(a,5)
+	eor	w4,w4,w17
+	ror	w21,w21,#2
+	add	w23,w23,w3	// future e+=X[i]
+	add	w24,w24,w25		// e+=F(b,c,d)
+	ror	w4,w4,#31
+	eor	w5,w5,w7
+	bic	w25,w22,w20
+	and	w26,w21,w20
+	ror	w27,w24,#27
+	eor	w5,w5,w13
+	add	w22,w22,w28		// future e+=K
+	orr	w25,w25,w26
+	add	w23,w23,w27		// e+=rot(a,5)
+	eor	w5,w5,w19
+	ror	w20,w20,#2
+	add	w22,w22,w4	// future e+=X[i]
+	add	w23,w23,w25		// e+=F(b,c,d)
+	ror	w5,w5,#31
+	eor	w6,w6,w8
+	bic	w25,w21,w24
+	and	w26,w20,w24
+	ror	w27,w23,#27
+	eor	w6,w6,w14
+	add	w21,w21,w28		// future e+=K
+	orr	w25,w25,w26
+	add	w22,w22,w27		// e+=rot(a,5)
+	eor	w6,w6,w3
+	ror	w24,w24,#2
+	add	w21,w21,w5	// future e+=X[i]
+	add	w22,w22,w25		// e+=F(b,c,d)
+	ror	w6,w6,#31
+	eor	w7,w7,w9
+	bic	w25,w20,w23
+	and	w26,w24,w23
+	ror	w27,w22,#27
+	eor	w7,w7,w15
+	add	w20,w20,w28		// future e+=K
+	orr	w25,w25,w26
+	add	w21,w21,w27		// e+=rot(a,5)
+	eor	w7,w7,w4
+	ror	w23,w23,#2
+	add	w20,w20,w6	// future e+=X[i]
+	add	w21,w21,w25		// e+=F(b,c,d)
+	ror	w7,w7,#31
+	movz	w28,#0xeba1
+	movk	w28,#0x6ed9,lsl#16
+	eor	w8,w8,w10
+	bic	w25,w24,w22
+	and	w26,w23,w22
+	ror	w27,w21,#27
+	eor	w8,w8,w16
+	add	w24,w24,w28		// future e+=K
+	orr	w25,w25,w26
+	add	w20,w20,w27		// e+=rot(a,5)
+	eor	w8,w8,w5
+	ror	w22,w22,#2
+	add	w24,w24,w7	// future e+=X[i]
+	add	w20,w20,w25		// e+=F(b,c,d)
+	ror	w8,w8,#31
+	eor	w9,w9,w11
+	eor	w25,w23,w21
+	ror	w27,w20,#27
+	add	w23,w23,w28		// future e+=K
+	eor	w9,w9,w17
+	eor	w25,w25,w22
+	add	w24,w24,w27		// e+=rot(a,5)
+	ror	w21,w21,#2
+	eor	w9,w9,w6
+	add	w23,w23,w8	// future e+=X[i]
+	add	w24,w24,w25		// e+=F(b,c,d)
+	ror	w9,w9,#31
+	eor	w10,w10,w12
+	eor	w25,w22,w20
+	ror	w27,w24,#27
+	add	w22,w22,w28		// future e+=K
+	eor	w10,w10,w19
+	eor	w25,w25,w21
+	add	w23,w23,w27		// e+=rot(a,5)
+	ror	w20,w20,#2
+	eor	w10,w10,w7
+	add	w22,w22,w9	// future e+=X[i]
+	add	w23,w23,w25		// e+=F(b,c,d)
+	ror	w10,w10,#31
+	eor	w11,w11,w13
+	eor	w25,w21,w24
+	ror	w27,w23,#27
+	add	w21,w21,w28		// future e+=K
+	eor	w11,w11,w3
+	eor	w25,w25,w20
+	add	w22,w22,w27		// e+=rot(a,5)
+	ror	w24,w24,#2
+	eor	w11,w11,w8
+	add	w21,w21,w10	// future e+=X[i]
+	add	w22,w22,w25		// e+=F(b,c,d)
+	ror	w11,w11,#31
+	eor	w12,w12,w14
+	eor	w25,w20,w23
+	ror	w27,w22,#27
+	add	w20,w20,w28		// future e+=K
+	eor	w12,w12,w4
+	eor	w25,w25,w24
+	add	w21,w21,w27		// e+=rot(a,5)
+	ror	w23,w23,#2
+	eor	w12,w12,w9
+	add	w20,w20,w11	// future e+=X[i]
+	add	w21,w21,w25		// e+=F(b,c,d)
+	ror	w12,w12,#31
+	eor	w13,w13,w15
+	eor	w25,w24,w22
+	ror	w27,w21,#27
+	add	w24,w24,w28		// future e+=K
+	eor	w13,w13,w5
+	eor	w25,w25,w23
+	add	w20,w20,w27		// e+=rot(a,5)
+	ror	w22,w22,#2
+	eor	w13,w13,w10
+	add	w24,w24,w12	// future e+=X[i]
+	add	w20,w20,w25		// e+=F(b,c,d)
+	ror	w13,w13,#31
+	eor	w14,w14,w16
+	eor	w25,w23,w21
+	ror	w27,w20,#27
+	add	w23,w23,w28		// future e+=K
+	eor	w14,w14,w6
+	eor	w25,w25,w22
+	add	w24,w24,w27		// e+=rot(a,5)
+	ror	w21,w21,#2
+	eor	w14,w14,w11
+	add	w23,w23,w13	// future e+=X[i]
+	add	w24,w24,w25		// e+=F(b,c,d)
+	ror	w14,w14,#31
+	eor	w15,w15,w17
+	eor	w25,w22,w20
+	ror	w27,w24,#27
+	add	w22,w22,w28		// future e+=K
+	eor	w15,w15,w7
+	eor	w25,w25,w21
+	add	w23,w23,w27		// e+=rot(a,5)
+	ror	w20,w20,#2
+	eor	w15,w15,w12
+	add	w22,w22,w14	// future e+=X[i]
+	add	w23,w23,w25		// e+=F(b,c,d)
+	ror	w15,w15,#31
+	eor	w16,w16,w19
+	eor	w25,w21,w24
+	ror	w27,w23,#27
+	add	w21,w21,w28		// future e+=K
+	eor	w16,w16,w8
+	eor	w25,w25,w20
+	add	w22,w22,w27		// e+=rot(a,5)
+	ror	w24,w24,#2
+	eor	w16,w16,w13
+	add	w21,w21,w15	// future e+=X[i]
+	add	w22,w22,w25		// e+=F(b,c,d)
+	ror	w16,w16,#31
+	eor	w17,w17,w3
+	eor	w25,w20,w23
+	ror	w27,w22,#27
+	add	w20,w20,w28		// future e+=K
+	eor	w17,w17,w9
+	eor	w25,w25,w24
+	add	w21,w21,w27		// e+=rot(a,5)
+	ror	w23,w23,#2
+	eor	w17,w17,w14
+	add	w20,w20,w16	// future e+=X[i]
+	add	w21,w21,w25		// e+=F(b,c,d)
+	ror	w17,w17,#31
+	eor	w19,w19,w4
+	eor	w25,w24,w22
+	ror	w27,w21,#27
+	add	w24,w24,w28		// future e+=K
+	eor	w19,w19,w10
+	eor	w25,w25,w23
+	add	w20,w20,w27		// e+=rot(a,5)
+	ror	w22,w22,#2
+	eor	w19,w19,w15
+	add	w24,w24,w17	// future e+=X[i]
+	add	w20,w20,w25		// e+=F(b,c,d)
+	ror	w19,w19,#31
+	eor	w3,w3,w5
+	eor	w25,w23,w21
+	ror	w27,w20,#27
+	add	w23,w23,w28		// future e+=K
+	eor	w3,w3,w11
+	eor	w25,w25,w22
+	add	w24,w24,w27		// e+=rot(a,5)
+	ror	w21,w21,#2
+	eor	w3,w3,w16
+	add	w23,w23,w19	// future e+=X[i]
+	add	w24,w24,w25		// e+=F(b,c,d)
+	ror	w3,w3,#31
+	eor	w4,w4,w6
+	eor	w25,w22,w20
+	ror	w27,w24,#27
+	add	w22,w22,w28		// future e+=K
+	eor	w4,w4,w12
+	eor	w25,w25,w21
+	add	w23,w23,w27		// e+=rot(a,5)
+	ror	w20,w20,#2
+	eor	w4,w4,w17
+	add	w22,w22,w3	// future e+=X[i]
+	add	w23,w23,w25		// e+=F(b,c,d)
+	ror	w4,w4,#31
+	eor	w5,w5,w7
+	eor	w25,w21,w24
+	ror	w27,w23,#27
+	add	w21,w21,w28		// future e+=K
+	eor	w5,w5,w13
+	eor	w25,w25,w20
+	add	w22,w22,w27		// e+=rot(a,5)
+	ror	w24,w24,#2
+	eor	w5,w5,w19
+	add	w21,w21,w4	// future e+=X[i]
+	add	w22,w22,w25		// e+=F(b,c,d)
+	ror	w5,w5,#31
+	eor	w6,w6,w8
+	eor	w25,w20,w23
+	ror	w27,w22,#27
+	add	w20,w20,w28		// future e+=K
+	eor	w6,w6,w14
+	eor	w25,w25,w24
+	add	w21,w21,w27		// e+=rot(a,5)
+	ror	w23,w23,#2
+	eor	w6,w6,w3
+	add	w20,w20,w5	// future e+=X[i]
+	add	w21,w21,w25		// e+=F(b,c,d)
+	ror	w6,w6,#31
+	eor	w7,w7,w9
+	eor	w25,w24,w22
+	ror	w27,w21,#27
+	add	w24,w24,w28		// future e+=K
+	eor	w7,w7,w15
+	eor	w25,w25,w23
+	add	w20,w20,w27		// e+=rot(a,5)
+	ror	w22,w22,#2
+	eor	w7,w7,w4
+	add	w24,w24,w6	// future e+=X[i]
+	add	w20,w20,w25		// e+=F(b,c,d)
+	ror	w7,w7,#31
+	eor	w8,w8,w10
+	eor	w25,w23,w21
+	ror	w27,w20,#27
+	add	w23,w23,w28		// future e+=K
+	eor	w8,w8,w16
+	eor	w25,w25,w22
+	add	w24,w24,w27		// e+=rot(a,5)
+	ror	w21,w21,#2
+	eor	w8,w8,w5
+	add	w23,w23,w7	// future e+=X[i]
+	add	w24,w24,w25		// e+=F(b,c,d)
+	ror	w8,w8,#31
+	eor	w9,w9,w11
+	eor	w25,w22,w20
+	ror	w27,w24,#27
+	add	w22,w22,w28		// future e+=K
+	eor	w9,w9,w17
+	eor	w25,w25,w21
+	add	w23,w23,w27		// e+=rot(a,5)
+	ror	w20,w20,#2
+	eor	w9,w9,w6
+	add	w22,w22,w8	// future e+=X[i]
+	add	w23,w23,w25		// e+=F(b,c,d)
+	ror	w9,w9,#31
+	eor	w10,w10,w12
+	eor	w25,w21,w24
+	ror	w27,w23,#27
+	add	w21,w21,w28		// future e+=K
+	eor	w10,w10,w19
+	eor	w25,w25,w20
+	add	w22,w22,w27		// e+=rot(a,5)
+	ror	w24,w24,#2
+	eor	w10,w10,w7
+	add	w21,w21,w9	// future e+=X[i]
+	add	w22,w22,w25		// e+=F(b,c,d)
+	ror	w10,w10,#31
+	eor	w11,w11,w13
+	eor	w25,w20,w23
+	ror	w27,w22,#27
+	add	w20,w20,w28		// future e+=K
+	eor	w11,w11,w3
+	eor	w25,w25,w24
+	add	w21,w21,w27		// e+=rot(a,5)
+	ror	w23,w23,#2
+	eor	w11,w11,w8
+	add	w20,w20,w10	// future e+=X[i]
+	add	w21,w21,w25		// e+=F(b,c,d)
+	ror	w11,w11,#31
+	movz	w28,#0xbcdc
+	movk	w28,#0x8f1b,lsl#16
+	eor	w12,w12,w14
+	eor	w25,w24,w22
+	ror	w27,w21,#27
+	add	w24,w24,w28		// future e+=K
+	eor	w12,w12,w4
+	eor	w25,w25,w23
+	add	w20,w20,w27		// e+=rot(a,5)
+	ror	w22,w22,#2
+	eor	w12,w12,w9
+	add	w24,w24,w11	// future e+=X[i]
+	add	w20,w20,w25		// e+=F(b,c,d)
+	ror	w12,w12,#31
+	orr	w25,w21,w22
+	and	w26,w21,w22
+	eor	w13,w13,w15
+	ror	w27,w20,#27
+	and	w25,w25,w23
+	add	w23,w23,w28		// future e+=K
+	eor	w13,w13,w5
+	add	w24,w24,w27		// e+=rot(a,5)
+	orr	w25,w25,w26
+	ror	w21,w21,#2
+	eor	w13,w13,w10
+	add	w23,w23,w12	// future e+=X[i]
+	add	w24,w24,w25		// e+=F(b,c,d)
+	ror	w13,w13,#31
+	orr	w25,w20,w21
+	and	w26,w20,w21
+	eor	w14,w14,w16
+	ror	w27,w24,#27
+	and	w25,w25,w22
+	add	w22,w22,w28		// future e+=K
+	eor	w14,w14,w6
+	add	w23,w23,w27		// e+=rot(a,5)
+	orr	w25,w25,w26
+	ror	w20,w20,#2
+	eor	w14,w14,w11
+	add	w22,w22,w13	// future e+=X[i]
+	add	w23,w23,w25		// e+=F(b,c,d)
+	ror	w14,w14,#31
+	orr	w25,w24,w20
+	and	w26,w24,w20
+	eor	w15,w15,w17
+	ror	w27,w23,#27
+	and	w25,w25,w21
+	add	w21,w21,w28		// future e+=K
+	eor	w15,w15,w7
+	add	w22,w22,w27		// e+=rot(a,5)
+	orr	w25,w25,w26
+	ror	w24,w24,#2
+	eor	w15,w15,w12
+	add	w21,w21,w14	// future e+=X[i]
+	add	w22,w22,w25		// e+=F(b,c,d)
+	ror	w15,w15,#31
+	orr	w25,w23,w24
+	and	w26,w23,w24
+	eor	w16,w16,w19
+	ror	w27,w22,#27
+	and	w25,w25,w20
+	add	w20,w20,w28		// future e+=K
+	eor	w16,w16,w8
+	add	w21,w21,w27		// e+=rot(a,5)
+	orr	w25,w25,w26
+	ror	w23,w23,#2
+	eor	w16,w16,w13
+	add	w20,w20,w15	// future e+=X[i]
+	add	w21,w21,w25		// e+=F(b,c,d)
+	ror	w16,w16,#31
+	orr	w25,w22,w23
+	and	w26,w22,w23
+	eor	w17,w17,w3
+	ror	w27,w21,#27
+	and	w25,w25,w24
+	add	w24,w24,w28		// future e+=K
+	eor	w17,w17,w9
+	add	w20,w20,w27		// e+=rot(a,5)
+	orr	w25,w25,w26
+	ror	w22,w22,#2
+	eor	w17,w17,w14
+	add	w24,w24,w16	// future e+=X[i]
+	add	w20,w20,w25		// e+=F(b,c,d)
+	ror	w17,w17,#31
+	orr	w25,w21,w22
+	and	w26,w21,w22
+	eor	w19,w19,w4
+	ror	w27,w20,#27
+	and	w25,w25,w23
+	add	w23,w23,w28		// future e+=K
+	eor	w19,w19,w10
+	add	w24,w24,w27		// e+=rot(a,5)
+	orr	w25,w25,w26
+	ror	w21,w21,#2
+	eor	w19,w19,w15
+	add	w23,w23,w17	// future e+=X[i]
+	add	w24,w24,w25		// e+=F(b,c,d)
+	ror	w19,w19,#31
+	orr	w25,w20,w21
+	and	w26,w20,w21
+	eor	w3,w3,w5
+	ror	w27,w24,#27
+	and	w25,w25,w22
+	add	w22,w22,w28		// future e+=K
+	eor	w3,w3,w11
+	add	w23,w23,w27		// e+=rot(a,5)
+	orr	w25,w25,w26
+	ror	w20,w20,#2
+	eor	w3,w3,w16
+	add	w22,w22,w19	// future e+=X[i]
+	add	w23,w23,w25		// e+=F(b,c,d)
+	ror	w3,w3,#31
+	orr	w25,w24,w20
+	and	w26,w24,w20
+	eor	w4,w4,w6
+	ror	w27,w23,#27
+	and	w25,w25,w21
+	add	w21,w21,w28		// future e+=K
+	eor	w4,w4,w12
+	add	w22,w22,w27		// e+=rot(a,5)
+	orr	w25,w25,w26
+	ror	w24,w24,#2
+	eor	w4,w4,w17
+	add	w21,w21,w3	// future e+=X[i]
+	add	w22,w22,w25		// e+=F(b,c,d)
+	ror	w4,w4,#31
+	orr	w25,w23,w24
+	and	w26,w23,w24
+	eor	w5,w5,w7
+	ror	w27,w22,#27
+	and	w25,w25,w20
+	add	w20,w20,w28		// future e+=K
+	eor	w5,w5,w13
+	add	w21,w21,w27		// e+=rot(a,5)
+	orr	w25,w25,w26
+	ror	w23,w23,#2
+	eor	w5,w5,w19
+	add	w20,w20,w4	// future e+=X[i]
+	add	w21,w21,w25		// e+=F(b,c,d)
+	ror	w5,w5,#31
+	orr	w25,w22,w23
+	and	w26,w22,w23
+	eor	w6,w6,w8
+	ror	w27,w21,#27
+	and	w25,w25,w24
+	add	w24,w24,w28		// future e+=K
+	eor	w6,w6,w14
+	add	w20,w20,w27		// e+=rot(a,5)
+	orr	w25,w25,w26
+	ror	w22,w22,#2
+	eor	w6,w6,w3
+	add	w24,w24,w5	// future e+=X[i]
+	add	w20,w20,w25		// e+=F(b,c,d)
+	ror	w6,w6,#31
+	orr	w25,w21,w22
+	and	w26,w21,w22
+	eor	w7,w7,w9
+	ror	w27,w20,#27
+	and	w25,w25,w23
+	add	w23,w23,w28		// future e+=K
+	eor	w7,w7,w15
+	add	w24,w24,w27		// e+=rot(a,5)
+	orr	w25,w25,w26
+	ror	w21,w21,#2
+	eor	w7,w7,w4
+	add	w23,w23,w6	// future e+=X[i]
+	add	w24,w24,w25		// e+=F(b,c,d)
+	ror	w7,w7,#31
+	orr	w25,w20,w21
+	and	w26,w20,w21
+	eor	w8,w8,w10
+	ror	w27,w24,#27
+	and	w25,w25,w22
+	add	w22,w22,w28		// future e+=K
+	eor	w8,w8,w16
+	add	w23,w23,w27		// e+=rot(a,5)
+	orr	w25,w25,w26
+	ror	w20,w20,#2
+	eor	w8,w8,w5
+	add	w22,w22,w7	// future e+=X[i]
+	add	w23,w23,w25		// e+=F(b,c,d)
+	ror	w8,w8,#31
+	orr	w25,w24,w20
+	and	w26,w24,w20
+	eor	w9,w9,w11
+	ror	w27,w23,#27
+	and	w25,w25,w21
+	add	w21,w21,w28		// future e+=K
+	eor	w9,w9,w17
+	add	w22,w22,w27		// e+=rot(a,5)
+	orr	w25,w25,w26
+	ror	w24,w24,#2
+	eor	w9,w9,w6
+	add	w21,w21,w8	// future e+=X[i]
+	add	w22,w22,w25		// e+=F(b,c,d)
+	ror	w9,w9,#31
+	orr	w25,w23,w24
+	and	w26,w23,w24
+	eor	w10,w10,w12
+	ror	w27,w22,#27
+	and	w25,w25,w20
+	add	w20,w20,w28		// future e+=K
+	eor	w10,w10,w19
+	add	w21,w21,w27		// e+=rot(a,5)
+	orr	w25,w25,w26
+	ror	w23,w23,#2
+	eor	w10,w10,w7
+	add	w20,w20,w9	// future e+=X[i]
+	add	w21,w21,w25		// e+=F(b,c,d)
+	ror	w10,w10,#31
+	orr	w25,w22,w23
+	and	w26,w22,w23
+	eor	w11,w11,w13
+	ror	w27,w21,#27
+	and	w25,w25,w24
+	add	w24,w24,w28		// future e+=K
+	eor	w11,w11,w3
+	add	w20,w20,w27		// e+=rot(a,5)
+	orr	w25,w25,w26
+	ror	w22,w22,#2
+	eor	w11,w11,w8
+	add	w24,w24,w10	// future e+=X[i]
+	add	w20,w20,w25		// e+=F(b,c,d)
+	ror	w11,w11,#31
+	orr	w25,w21,w22
+	and	w26,w21,w22
+	eor	w12,w12,w14
+	ror	w27,w20,#27
+	and	w25,w25,w23
+	add	w23,w23,w28		// future e+=K
+	eor	w12,w12,w4
+	add	w24,w24,w27		// e+=rot(a,5)
+	orr	w25,w25,w26
+	ror	w21,w21,#2
+	eor	w12,w12,w9
+	add	w23,w23,w11	// future e+=X[i]
+	add	w24,w24,w25		// e+=F(b,c,d)
+	ror	w12,w12,#31
+	orr	w25,w20,w21
+	and	w26,w20,w21
+	eor	w13,w13,w15
+	ror	w27,w24,#27
+	and	w25,w25,w22
+	add	w22,w22,w28		// future e+=K
+	eor	w13,w13,w5
+	add	w23,w23,w27		// e+=rot(a,5)
+	orr	w25,w25,w26
+	ror	w20,w20,#2
+	eor	w13,w13,w10
+	add	w22,w22,w12	// future e+=X[i]
+	add	w23,w23,w25		// e+=F(b,c,d)
+	ror	w13,w13,#31
+	orr	w25,w24,w20
+	and	w26,w24,w20
+	eor	w14,w14,w16
+	ror	w27,w23,#27
+	and	w25,w25,w21
+	add	w21,w21,w28		// future e+=K
+	eor	w14,w14,w6
+	add	w22,w22,w27		// e+=rot(a,5)
+	orr	w25,w25,w26
+	ror	w24,w24,#2
+	eor	w14,w14,w11
+	add	w21,w21,w13	// future e+=X[i]
+	add	w22,w22,w25		// e+=F(b,c,d)
+	ror	w14,w14,#31
+	orr	w25,w23,w24
+	and	w26,w23,w24
+	eor	w15,w15,w17
+	ror	w27,w22,#27
+	and	w25,w25,w20
+	add	w20,w20,w28		// future e+=K
+	eor	w15,w15,w7
+	add	w21,w21,w27		// e+=rot(a,5)
+	orr	w25,w25,w26
+	ror	w23,w23,#2
+	eor	w15,w15,w12
+	add	w20,w20,w14	// future e+=X[i]
+	add	w21,w21,w25		// e+=F(b,c,d)
+	ror	w15,w15,#31
+	movz	w28,#0xc1d6
+	movk	w28,#0xca62,lsl#16
+	orr	w25,w22,w23
+	and	w26,w22,w23
+	eor	w16,w16,w19
+	ror	w27,w21,#27
+	and	w25,w25,w24
+	add	w24,w24,w28		// future e+=K
+	eor	w16,w16,w8
+	add	w20,w20,w27		// e+=rot(a,5)
+	orr	w25,w25,w26
+	ror	w22,w22,#2
+	eor	w16,w16,w13
+	add	w24,w24,w15	// future e+=X[i]
+	add	w20,w20,w25		// e+=F(b,c,d)
+	ror	w16,w16,#31
+	eor	w17,w17,w3
+	eor	w25,w23,w21
+	ror	w27,w20,#27
+	add	w23,w23,w28		// future e+=K
+	eor	w17,w17,w9
+	eor	w25,w25,w22
+	add	w24,w24,w27		// e+=rot(a,5)
+	ror	w21,w21,#2
+	eor	w17,w17,w14
+	add	w23,w23,w16	// future e+=X[i]
+	add	w24,w24,w25		// e+=F(b,c,d)
+	ror	w17,w17,#31
+	eor	w19,w19,w4
+	eor	w25,w22,w20
+	ror	w27,w24,#27
+	add	w22,w22,w28		// future e+=K
+	eor	w19,w19,w10
+	eor	w25,w25,w21
+	add	w23,w23,w27		// e+=rot(a,5)
+	ror	w20,w20,#2
+	eor	w19,w19,w15
+	add	w22,w22,w17	// future e+=X[i]
+	add	w23,w23,w25		// e+=F(b,c,d)
+	ror	w19,w19,#31
+	eor	w3,w3,w5
+	eor	w25,w21,w24
+	ror	w27,w23,#27
+	add	w21,w21,w28		// future e+=K
+	eor	w3,w3,w11
+	eor	w25,w25,w20
+	add	w22,w22,w27		// e+=rot(a,5)
+	ror	w24,w24,#2
+	eor	w3,w3,w16
+	add	w21,w21,w19	// future e+=X[i]
+	add	w22,w22,w25		// e+=F(b,c,d)
+	ror	w3,w3,#31
+	eor	w4,w4,w6
+	eor	w25,w20,w23
+	ror	w27,w22,#27
+	add	w20,w20,w28		// future e+=K
+	eor	w4,w4,w12
+	eor	w25,w25,w24
+	add	w21,w21,w27		// e+=rot(a,5)
+	ror	w23,w23,#2
+	eor	w4,w4,w17
+	add	w20,w20,w3	// future e+=X[i]
+	add	w21,w21,w25		// e+=F(b,c,d)
+	ror	w4,w4,#31
+	eor	w5,w5,w7
+	eor	w25,w24,w22
+	ror	w27,w21,#27
+	add	w24,w24,w28		// future e+=K
+	eor	w5,w5,w13
+	eor	w25,w25,w23
+	add	w20,w20,w27		// e+=rot(a,5)
+	ror	w22,w22,#2
+	eor	w5,w5,w19
+	add	w24,w24,w4	// future e+=X[i]
+	add	w20,w20,w25		// e+=F(b,c,d)
+	ror	w5,w5,#31
+	eor	w6,w6,w8
+	eor	w25,w23,w21
+	ror	w27,w20,#27
+	add	w23,w23,w28		// future e+=K
+	eor	w6,w6,w14
+	eor	w25,w25,w22
+	add	w24,w24,w27		// e+=rot(a,5)
+	ror	w21,w21,#2
+	eor	w6,w6,w3
+	add	w23,w23,w5	// future e+=X[i]
+	add	w24,w24,w25		// e+=F(b,c,d)
+	ror	w6,w6,#31
+	eor	w7,w7,w9
+	eor	w25,w22,w20
+	ror	w27,w24,#27
+	add	w22,w22,w28		// future e+=K
+	eor	w7,w7,w15
+	eor	w25,w25,w21
+	add	w23,w23,w27		// e+=rot(a,5)
+	ror	w20,w20,#2
+	eor	w7,w7,w4
+	add	w22,w22,w6	// future e+=X[i]
+	add	w23,w23,w25		// e+=F(b,c,d)
+	ror	w7,w7,#31
+	eor	w8,w8,w10
+	eor	w25,w21,w24
+	ror	w27,w23,#27
+	add	w21,w21,w28		// future e+=K
+	eor	w8,w8,w16
+	eor	w25,w25,w20
+	add	w22,w22,w27		// e+=rot(a,5)
+	ror	w24,w24,#2
+	eor	w8,w8,w5
+	add	w21,w21,w7	// future e+=X[i]
+	add	w22,w22,w25		// e+=F(b,c,d)
+	ror	w8,w8,#31
+	eor	w9,w9,w11
+	eor	w25,w20,w23
+	ror	w27,w22,#27
+	add	w20,w20,w28		// future e+=K
+	eor	w9,w9,w17
+	eor	w25,w25,w24
+	add	w21,w21,w27		// e+=rot(a,5)
+	ror	w23,w23,#2
+	eor	w9,w9,w6
+	add	w20,w20,w8	// future e+=X[i]
+	add	w21,w21,w25		// e+=F(b,c,d)
+	ror	w9,w9,#31
+	eor	w10,w10,w12
+	eor	w25,w24,w22
+	ror	w27,w21,#27
+	add	w24,w24,w28		// future e+=K
+	eor	w10,w10,w19
+	eor	w25,w25,w23
+	add	w20,w20,w27		// e+=rot(a,5)
+	ror	w22,w22,#2
+	eor	w10,w10,w7
+	add	w24,w24,w9	// future e+=X[i]
+	add	w20,w20,w25		// e+=F(b,c,d)
+	ror	w10,w10,#31
+	eor	w11,w11,w13
+	eor	w25,w23,w21
+	ror	w27,w20,#27
+	add	w23,w23,w28		// future e+=K
+	eor	w11,w11,w3
+	eor	w25,w25,w22
+	add	w24,w24,w27		// e+=rot(a,5)
+	ror	w21,w21,#2
+	eor	w11,w11,w8
+	add	w23,w23,w10	// future e+=X[i]
+	add	w24,w24,w25		// e+=F(b,c,d)
+	ror	w11,w11,#31
+	eor	w12,w12,w14
+	eor	w25,w22,w20
+	ror	w27,w24,#27
+	add	w22,w22,w28		// future e+=K
+	eor	w12,w12,w4
+	eor	w25,w25,w21
+	add	w23,w23,w27		// e+=rot(a,5)
+	ror	w20,w20,#2
+	eor	w12,w12,w9
+	add	w22,w22,w11	// future e+=X[i]
+	add	w23,w23,w25		// e+=F(b,c,d)
+	ror	w12,w12,#31
+	eor	w13,w13,w15
+	eor	w25,w21,w24
+	ror	w27,w23,#27
+	add	w21,w21,w28		// future e+=K
+	eor	w13,w13,w5
+	eor	w25,w25,w20
+	add	w22,w22,w27		// e+=rot(a,5)
+	ror	w24,w24,#2
+	eor	w13,w13,w10
+	add	w21,w21,w12	// future e+=X[i]
+	add	w22,w22,w25		// e+=F(b,c,d)
+	ror	w13,w13,#31
+	eor	w14,w14,w16
+	eor	w25,w20,w23
+	ror	w27,w22,#27
+	add	w20,w20,w28		// future e+=K
+	eor	w14,w14,w6
+	eor	w25,w25,w24
+	add	w21,w21,w27		// e+=rot(a,5)
+	ror	w23,w23,#2
+	eor	w14,w14,w11
+	add	w20,w20,w13	// future e+=X[i]
+	add	w21,w21,w25		// e+=F(b,c,d)
+	ror	w14,w14,#31
+	eor	w15,w15,w17
+	eor	w25,w24,w22
+	ror	w27,w21,#27
+	add	w24,w24,w28		// future e+=K
+	eor	w15,w15,w7
+	eor	w25,w25,w23
+	add	w20,w20,w27		// e+=rot(a,5)
+	ror	w22,w22,#2
+	eor	w15,w15,w12
+	add	w24,w24,w14	// future e+=X[i]
+	add	w20,w20,w25		// e+=F(b,c,d)
+	ror	w15,w15,#31
+	eor	w16,w16,w19
+	eor	w25,w23,w21
+	ror	w27,w20,#27
+	add	w23,w23,w28		// future e+=K
+	eor	w16,w16,w8
+	eor	w25,w25,w22
+	add	w24,w24,w27		// e+=rot(a,5)
+	ror	w21,w21,#2
+	eor	w16,w16,w13
+	add	w23,w23,w15	// future e+=X[i]
+	add	w24,w24,w25		// e+=F(b,c,d)
+	ror	w16,w16,#31
+	eor	w17,w17,w3
+	eor	w25,w22,w20
+	ror	w27,w24,#27
+	add	w22,w22,w28		// future e+=K
+	eor	w17,w17,w9
+	eor	w25,w25,w21
+	add	w23,w23,w27		// e+=rot(a,5)
+	ror	w20,w20,#2
+	eor	w17,w17,w14
+	add	w22,w22,w16	// future e+=X[i]
+	add	w23,w23,w25		// e+=F(b,c,d)
+	ror	w17,w17,#31
+	eor	w19,w19,w4
+	eor	w25,w21,w24
+	ror	w27,w23,#27
+	add	w21,w21,w28		// future e+=K
+	eor	w19,w19,w10
+	eor	w25,w25,w20
+	add	w22,w22,w27		// e+=rot(a,5)
+	ror	w24,w24,#2
+	eor	w19,w19,w15
+	add	w21,w21,w17	// future e+=X[i]
+	add	w22,w22,w25		// e+=F(b,c,d)
+	ror	w19,w19,#31
+	ldp	w4,w5,[x0]
+	eor	w25,w20,w23
+	ror	w27,w22,#27
+	add	w20,w20,w28		// future e+=K
+	eor	w25,w25,w24
+	add	w21,w21,w27		// e+=rot(a,5)
+	ror	w23,w23,#2
+	add	w20,w20,w19	// future e+=X[i]
+	add	w21,w21,w25		// e+=F(b,c,d)
+	ldp	w6,w7,[x0,#8]
+	eor	w25,w24,w22
+	ror	w27,w21,#27
+	eor	w25,w25,w23
+	add	w20,w20,w27		// e+=rot(a,5)
+	ror	w22,w22,#2
+	ldr	w8,[x0,#16]
+	add	w20,w20,w25		// e+=F(b,c,d)
+	add	w21,w21,w5
+	add	w22,w22,w6
+	add	w20,w20,w4
+	add	w23,w23,w7
+	add	w24,w24,w8
+	stp	w20,w21,[x0]
+	stp	w22,w23,[x0,#8]
+	str	w24,[x0,#16]
+	cbnz	x2,.Loop
+
+	ldp	x19,x20,[sp,#16]
+	ldp	x21,x22,[sp,#32]
+	ldp	x23,x24,[sp,#48]
+	ldp	x25,x26,[sp,#64]
+	ldp	x27,x28,[sp,#80]
+	ldr	x29,[sp],#96
+	ret
+.size	sha1_block_data_order,.-sha1_block_data_order
+.type	sha1_block_armv8,%function
+.align	6
+sha1_block_armv8:
+.Lv8_entry:
+	stp	x29,x30,[sp,#-16]!
+	add	x29,sp,#0
+
+	adr	x4,.Lconst
+	eor	v1.16b,v1.16b,v1.16b
+	ld1	{v0.4s},[x0],#16
+	ld1	{v1.s}[0],[x0]
+	sub	x0,x0,#16
+	ld1	{v16.4s,v17.4s,v18.4s,v19.4s},[x4]
+
+.Loop_hw:
+	ld1	{v4.16b,v5.16b,v6.16b,v7.16b},[x1],#64
+	sub	x2,x2,#1
+	rev32	v4.16b,v4.16b
+	rev32	v5.16b,v5.16b
+
+	add	v20.4s,v16.4s,v4.4s
+	rev32	v6.16b,v6.16b
+	orr	v22.16b,v0.16b,v0.16b	// offload
+
+	add	v21.4s,v16.4s,v5.4s
+	rev32	v7.16b,v7.16b
+.inst	0x5e280803	//sha1h v3.16b,v0.16b
+.inst	0x5e140020	//sha1c v0.16b,v1.16b,v20.4s		// 0
+	add	v20.4s,v16.4s,v6.4s
+.inst	0x5e0630a4	//sha1su0 v4.16b,v5.16b,v6.16b
+.inst	0x5e280802	//sha1h v2.16b,v0.16b		// 1
+.inst	0x5e150060	//sha1c v0.16b,v3.16b,v21.4s
+	add	v21.4s,v16.4s,v7.4s
+.inst	0x5e2818e4	//sha1su1 v4.16b,v7.16b
+.inst	0x5e0730c5	//sha1su0 v5.16b,v6.16b,v7.16b
+.inst	0x5e280803	//sha1h v3.16b,v0.16b		// 2
+.inst	0x5e140040	//sha1c v0.16b,v2.16b,v20.4s
+	add	v20.4s,v16.4s,v4.4s
+.inst	0x5e281885	//sha1su1 v5.16b,v4.16b
+.inst	0x5e0430e6	//sha1su0 v6.16b,v7.16b,v4.16b
+.inst	0x5e280802	//sha1h v2.16b,v0.16b		// 3
+.inst	0x5e150060	//sha1c v0.16b,v3.16b,v21.4s
+	add	v21.4s,v17.4s,v5.4s
+.inst	0x5e2818a6	//sha1su1 v6.16b,v5.16b
+.inst	0x5e053087	//sha1su0 v7.16b,v4.16b,v5.16b
+.inst	0x5e280803	//sha1h v3.16b,v0.16b		// 4
+.inst	0x5e140040	//sha1c v0.16b,v2.16b,v20.4s
+	add	v20.4s,v17.4s,v6.4s
+.inst	0x5e2818c7	//sha1su1 v7.16b,v6.16b
+.inst	0x5e0630a4	//sha1su0 v4.16b,v5.16b,v6.16b
+.inst	0x5e280802	//sha1h v2.16b,v0.16b		// 5
+.inst	0x5e151060	//sha1p v0.16b,v3.16b,v21.4s
+	add	v21.4s,v17.4s,v7.4s
+.inst	0x5e2818e4	//sha1su1 v4.16b,v7.16b
+.inst	0x5e0730c5	//sha1su0 v5.16b,v6.16b,v7.16b
+.inst	0x5e280803	//sha1h v3.16b,v0.16b		// 6
+.inst	0x5e141040	//sha1p v0.16b,v2.16b,v20.4s
+	add	v20.4s,v17.4s,v4.4s
+.inst	0x5e281885	//sha1su1 v5.16b,v4.16b
+.inst	0x5e0430e6	//sha1su0 v6.16b,v7.16b,v4.16b
+.inst	0x5e280802	//sha1h v2.16b,v0.16b		// 7
+.inst	0x5e151060	//sha1p v0.16b,v3.16b,v21.4s
+	add	v21.4s,v17.4s,v5.4s
+.inst	0x5e2818a6	//sha1su1 v6.16b,v5.16b
+.inst	0x5e053087	//sha1su0 v7.16b,v4.16b,v5.16b
+.inst	0x5e280803	//sha1h v3.16b,v0.16b		// 8
+.inst	0x5e141040	//sha1p v0.16b,v2.16b,v20.4s
+	add	v20.4s,v18.4s,v6.4s
+.inst	0x5e2818c7	//sha1su1 v7.16b,v6.16b
+.inst	0x5e0630a4	//sha1su0 v4.16b,v5.16b,v6.16b
+.inst	0x5e280802	//sha1h v2.16b,v0.16b		// 9
+.inst	0x5e151060	//sha1p v0.16b,v3.16b,v21.4s
+	add	v21.4s,v18.4s,v7.4s
+.inst	0x5e2818e4	//sha1su1 v4.16b,v7.16b
+.inst	0x5e0730c5	//sha1su0 v5.16b,v6.16b,v7.16b
+.inst	0x5e280803	//sha1h v3.16b,v0.16b		// 10
+.inst	0x5e142040	//sha1m v0.16b,v2.16b,v20.4s
+	add	v20.4s,v18.4s,v4.4s
+.inst	0x5e281885	//sha1su1 v5.16b,v4.16b
+.inst	0x5e0430e6	//sha1su0 v6.16b,v7.16b,v4.16b
+.inst	0x5e280802	//sha1h v2.16b,v0.16b		// 11
+.inst	0x5e152060	//sha1m v0.16b,v3.16b,v21.4s
+	add	v21.4s,v18.4s,v5.4s
+.inst	0x5e2818a6	//sha1su1 v6.16b,v5.16b
+.inst	0x5e053087	//sha1su0 v7.16b,v4.16b,v5.16b
+.inst	0x5e280803	//sha1h v3.16b,v0.16b		// 12
+.inst	0x5e142040	//sha1m v0.16b,v2.16b,v20.4s
+	add	v20.4s,v18.4s,v6.4s
+.inst	0x5e2818c7	//sha1su1 v7.16b,v6.16b
+.inst	0x5e0630a4	//sha1su0 v4.16b,v5.16b,v6.16b
+.inst	0x5e280802	//sha1h v2.16b,v0.16b		// 13
+.inst	0x5e152060	//sha1m v0.16b,v3.16b,v21.4s
+	add	v21.4s,v19.4s,v7.4s
+.inst	0x5e2818e4	//sha1su1 v4.16b,v7.16b
+.inst	0x5e0730c5	//sha1su0 v5.16b,v6.16b,v7.16b
+.inst	0x5e280803	//sha1h v3.16b,v0.16b		// 14
+.inst	0x5e142040	//sha1m v0.16b,v2.16b,v20.4s
+	add	v20.4s,v19.4s,v4.4s
+.inst	0x5e281885	//sha1su1 v5.16b,v4.16b
+.inst	0x5e0430e6	//sha1su0 v6.16b,v7.16b,v4.16b
+.inst	0x5e280802	//sha1h v2.16b,v0.16b		// 15
+.inst	0x5e151060	//sha1p v0.16b,v3.16b,v21.4s
+	add	v21.4s,v19.4s,v5.4s
+.inst	0x5e2818a6	//sha1su1 v6.16b,v5.16b
+.inst	0x5e053087	//sha1su0 v7.16b,v4.16b,v5.16b
+.inst	0x5e280803	//sha1h v3.16b,v0.16b		// 16
+.inst	0x5e141040	//sha1p v0.16b,v2.16b,v20.4s
+	add	v20.4s,v19.4s,v6.4s
+.inst	0x5e2818c7	//sha1su1 v7.16b,v6.16b
+.inst	0x5e280802	//sha1h v2.16b,v0.16b		// 17
+.inst	0x5e151060	//sha1p v0.16b,v3.16b,v21.4s
+	add	v21.4s,v19.4s,v7.4s
+
+.inst	0x5e280803	//sha1h v3.16b,v0.16b		// 18
+.inst	0x5e141040	//sha1p v0.16b,v2.16b,v20.4s
+
+.inst	0x5e280802	//sha1h v2.16b,v0.16b		// 19
+.inst	0x5e151060	//sha1p v0.16b,v3.16b,v21.4s
+
+	add	v1.4s,v1.4s,v2.4s
+	add	v0.4s,v0.4s,v22.4s
+
+	cbnz	x2,.Loop_hw
+
+	st1	{v0.4s},[x0],#16
+	st1	{v1.s}[0],[x0]
+
+	ldr	x29,[sp],#16
+	ret
+.size	sha1_block_armv8,.-sha1_block_armv8
+.align	6
+.Lconst:
+.long	0x5a827999,0x5a827999,0x5a827999,0x5a827999	//K_00_19
+.long	0x6ed9eba1,0x6ed9eba1,0x6ed9eba1,0x6ed9eba1	//K_20_39
+.long	0x8f1bbcdc,0x8f1bbcdc,0x8f1bbcdc,0x8f1bbcdc	//K_40_59
+.long	0xca62c1d6,0xca62c1d6,0xca62c1d6,0xca62c1d6	//K_60_79
+.LOPENSSL_armcap_P:
+.quad	OPENSSL_armcap_P-.
+.byte	83,72,65,49,32,98,108,111,99,107,32,116,114,97,110,115,102,111,114,109,32,102,111,114,32,65,82,77,118,56,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0
+.align	2
+.align	2
+.comm	OPENSSL_armcap_P,4,4
+#endif
\ No newline at end of file
diff --git a/third_party/boringssl/linux-aarch64/crypto/sha/sha256-armv8.S b/third_party/boringssl/linux-aarch64/crypto/sha/sha256-armv8.S
new file mode 100644
index 0000000..4834553
--- /dev/null
+++ b/third_party/boringssl/linux-aarch64/crypto/sha/sha256-armv8.S
@@ -0,0 +1,1145 @@
+#if defined(__aarch64__)
+#include "arm_arch.h"
+
+.text
+
+
+.globl	sha256_block_data_order
+.type	sha256_block_data_order,%function
+.align	6
+sha256_block_data_order:
+	ldr	x16,.LOPENSSL_armcap_P
+	adr	x17,.LOPENSSL_armcap_P
+	add	x16,x16,x17
+	ldr	w16,[x16]
+	tst	w16,#ARMV8_SHA256
+	b.ne	.Lv8_entry
+	stp	x29,x30,[sp,#-128]!
+	add	x29,sp,#0
+
+	stp	x19,x20,[sp,#16]
+	stp	x21,x22,[sp,#32]
+	stp	x23,x24,[sp,#48]
+	stp	x25,x26,[sp,#64]
+	stp	x27,x28,[sp,#80]
+	sub	sp,sp,#4*4
+
+	ldp	w20,w21,[x0]				// load context
+	ldp	w22,w23,[x0,#2*4]
+	ldp	w24,w25,[x0,#4*4]
+	add	x2,x1,x2,lsl#6	// end of input
+	ldp	w26,w27,[x0,#6*4]
+	adr	x30,.LK256
+	stp	x0,x2,[x29,#96]
+
+.Loop:
+	ldp	w3,w4,[x1],#2*4
+	ldr	w19,[x30],#4			// *K++
+	eor	w28,w21,w22				// magic seed
+	str	x1,[x29,#112]
+#ifndef	__ARMEB__
+	rev	w3,w3			// 0
+#endif
+	ror	w16,w24,#6
+	add	w27,w27,w19			// h+=K[i]
+	eor	w6,w24,w24,ror#14
+	and	w17,w25,w24
+	bic	w19,w26,w24
+	add	w27,w27,w3			// h+=X[i]
+	orr	w17,w17,w19			// Ch(e,f,g)
+	eor	w19,w20,w21			// a^b, b^c in next round
+	eor	w16,w16,w6,ror#11	// Sigma1(e)
+	ror	w6,w20,#2
+	add	w27,w27,w17			// h+=Ch(e,f,g)
+	eor	w17,w20,w20,ror#9
+	add	w27,w27,w16			// h+=Sigma1(e)
+	and	w28,w28,w19			// (b^c)&=(a^b)
+	add	w23,w23,w27			// d+=h
+	eor	w28,w28,w21			// Maj(a,b,c)
+	eor	w17,w6,w17,ror#13	// Sigma0(a)
+	add	w27,w27,w28			// h+=Maj(a,b,c)
+	ldr	w28,[x30],#4		// *K++, w19 in next round
+	//add	w27,w27,w17			// h+=Sigma0(a)
+#ifndef	__ARMEB__
+	rev	w4,w4			// 1
+#endif
+	ldp	w5,w6,[x1],#2*4
+	add	w27,w27,w17			// h+=Sigma0(a)
+	ror	w16,w23,#6
+	add	w26,w26,w28			// h+=K[i]
+	eor	w7,w23,w23,ror#14
+	and	w17,w24,w23
+	bic	w28,w25,w23
+	add	w26,w26,w4			// h+=X[i]
+	orr	w17,w17,w28			// Ch(e,f,g)
+	eor	w28,w27,w20			// a^b, b^c in next round
+	eor	w16,w16,w7,ror#11	// Sigma1(e)
+	ror	w7,w27,#2
+	add	w26,w26,w17			// h+=Ch(e,f,g)
+	eor	w17,w27,w27,ror#9
+	add	w26,w26,w16			// h+=Sigma1(e)
+	and	w19,w19,w28			// (b^c)&=(a^b)
+	add	w22,w22,w26			// d+=h
+	eor	w19,w19,w20			// Maj(a,b,c)
+	eor	w17,w7,w17,ror#13	// Sigma0(a)
+	add	w26,w26,w19			// h+=Maj(a,b,c)
+	ldr	w19,[x30],#4		// *K++, w28 in next round
+	//add	w26,w26,w17			// h+=Sigma0(a)
+#ifndef	__ARMEB__
+	rev	w5,w5			// 2
+#endif
+	add	w26,w26,w17			// h+=Sigma0(a)
+	ror	w16,w22,#6
+	add	w25,w25,w19			// h+=K[i]
+	eor	w8,w22,w22,ror#14
+	and	w17,w23,w22
+	bic	w19,w24,w22
+	add	w25,w25,w5			// h+=X[i]
+	orr	w17,w17,w19			// Ch(e,f,g)
+	eor	w19,w26,w27			// a^b, b^c in next round
+	eor	w16,w16,w8,ror#11	// Sigma1(e)
+	ror	w8,w26,#2
+	add	w25,w25,w17			// h+=Ch(e,f,g)
+	eor	w17,w26,w26,ror#9
+	add	w25,w25,w16			// h+=Sigma1(e)
+	and	w28,w28,w19			// (b^c)&=(a^b)
+	add	w21,w21,w25			// d+=h
+	eor	w28,w28,w27			// Maj(a,b,c)
+	eor	w17,w8,w17,ror#13	// Sigma0(a)
+	add	w25,w25,w28			// h+=Maj(a,b,c)
+	ldr	w28,[x30],#4		// *K++, w19 in next round
+	//add	w25,w25,w17			// h+=Sigma0(a)
+#ifndef	__ARMEB__
+	rev	w6,w6			// 3
+#endif
+	ldp	w7,w8,[x1],#2*4
+	add	w25,w25,w17			// h+=Sigma0(a)
+	ror	w16,w21,#6
+	add	w24,w24,w28			// h+=K[i]
+	eor	w9,w21,w21,ror#14
+	and	w17,w22,w21
+	bic	w28,w23,w21
+	add	w24,w24,w6			// h+=X[i]
+	orr	w17,w17,w28			// Ch(e,f,g)
+	eor	w28,w25,w26			// a^b, b^c in next round
+	eor	w16,w16,w9,ror#11	// Sigma1(e)
+	ror	w9,w25,#2
+	add	w24,w24,w17			// h+=Ch(e,f,g)
+	eor	w17,w25,w25,ror#9
+	add	w24,w24,w16			// h+=Sigma1(e)
+	and	w19,w19,w28			// (b^c)&=(a^b)
+	add	w20,w20,w24			// d+=h
+	eor	w19,w19,w26			// Maj(a,b,c)
+	eor	w17,w9,w17,ror#13	// Sigma0(a)
+	add	w24,w24,w19			// h+=Maj(a,b,c)
+	ldr	w19,[x30],#4		// *K++, w28 in next round
+	//add	w24,w24,w17			// h+=Sigma0(a)
+#ifndef	__ARMEB__
+	rev	w7,w7			// 4
+#endif
+	add	w24,w24,w17			// h+=Sigma0(a)
+	ror	w16,w20,#6
+	add	w23,w23,w19			// h+=K[i]
+	eor	w10,w20,w20,ror#14
+	and	w17,w21,w20
+	bic	w19,w22,w20
+	add	w23,w23,w7			// h+=X[i]
+	orr	w17,w17,w19			// Ch(e,f,g)
+	eor	w19,w24,w25			// a^b, b^c in next round
+	eor	w16,w16,w10,ror#11	// Sigma1(e)
+	ror	w10,w24,#2
+	add	w23,w23,w17			// h+=Ch(e,f,g)
+	eor	w17,w24,w24,ror#9
+	add	w23,w23,w16			// h+=Sigma1(e)
+	and	w28,w28,w19			// (b^c)&=(a^b)
+	add	w27,w27,w23			// d+=h
+	eor	w28,w28,w25			// Maj(a,b,c)
+	eor	w17,w10,w17,ror#13	// Sigma0(a)
+	add	w23,w23,w28			// h+=Maj(a,b,c)
+	ldr	w28,[x30],#4		// *K++, w19 in next round
+	//add	w23,w23,w17			// h+=Sigma0(a)
+#ifndef	__ARMEB__
+	rev	w8,w8			// 5
+#endif
+	ldp	w9,w10,[x1],#2*4
+	add	w23,w23,w17			// h+=Sigma0(a)
+	ror	w16,w27,#6
+	add	w22,w22,w28			// h+=K[i]
+	eor	w11,w27,w27,ror#14
+	and	w17,w20,w27
+	bic	w28,w21,w27
+	add	w22,w22,w8			// h+=X[i]
+	orr	w17,w17,w28			// Ch(e,f,g)
+	eor	w28,w23,w24			// a^b, b^c in next round
+	eor	w16,w16,w11,ror#11	// Sigma1(e)
+	ror	w11,w23,#2
+	add	w22,w22,w17			// h+=Ch(e,f,g)
+	eor	w17,w23,w23,ror#9
+	add	w22,w22,w16			// h+=Sigma1(e)
+	and	w19,w19,w28			// (b^c)&=(a^b)
+	add	w26,w26,w22			// d+=h
+	eor	w19,w19,w24			// Maj(a,b,c)
+	eor	w17,w11,w17,ror#13	// Sigma0(a)
+	add	w22,w22,w19			// h+=Maj(a,b,c)
+	ldr	w19,[x30],#4		// *K++, w28 in next round
+	//add	w22,w22,w17			// h+=Sigma0(a)
+#ifndef	__ARMEB__
+	rev	w9,w9			// 6
+#endif
+	add	w22,w22,w17			// h+=Sigma0(a)
+	ror	w16,w26,#6
+	add	w21,w21,w19			// h+=K[i]
+	eor	w12,w26,w26,ror#14
+	and	w17,w27,w26
+	bic	w19,w20,w26
+	add	w21,w21,w9			// h+=X[i]
+	orr	w17,w17,w19			// Ch(e,f,g)
+	eor	w19,w22,w23			// a^b, b^c in next round
+	eor	w16,w16,w12,ror#11	// Sigma1(e)
+	ror	w12,w22,#2
+	add	w21,w21,w17			// h+=Ch(e,f,g)
+	eor	w17,w22,w22,ror#9
+	add	w21,w21,w16			// h+=Sigma1(e)
+	and	w28,w28,w19			// (b^c)&=(a^b)
+	add	w25,w25,w21			// d+=h
+	eor	w28,w28,w23			// Maj(a,b,c)
+	eor	w17,w12,w17,ror#13	// Sigma0(a)
+	add	w21,w21,w28			// h+=Maj(a,b,c)
+	ldr	w28,[x30],#4		// *K++, w19 in next round
+	//add	w21,w21,w17			// h+=Sigma0(a)
+#ifndef	__ARMEB__
+	rev	w10,w10			// 7
+#endif
+	ldp	w11,w12,[x1],#2*4
+	add	w21,w21,w17			// h+=Sigma0(a)
+	ror	w16,w25,#6
+	add	w20,w20,w28			// h+=K[i]
+	eor	w13,w25,w25,ror#14
+	and	w17,w26,w25
+	bic	w28,w27,w25
+	add	w20,w20,w10			// h+=X[i]
+	orr	w17,w17,w28			// Ch(e,f,g)
+	eor	w28,w21,w22			// a^b, b^c in next round
+	eor	w16,w16,w13,ror#11	// Sigma1(e)
+	ror	w13,w21,#2
+	add	w20,w20,w17			// h+=Ch(e,f,g)
+	eor	w17,w21,w21,ror#9
+	add	w20,w20,w16			// h+=Sigma1(e)
+	and	w19,w19,w28			// (b^c)&=(a^b)
+	add	w24,w24,w20			// d+=h
+	eor	w19,w19,w22			// Maj(a,b,c)
+	eor	w17,w13,w17,ror#13	// Sigma0(a)
+	add	w20,w20,w19			// h+=Maj(a,b,c)
+	ldr	w19,[x30],#4		// *K++, w28 in next round
+	//add	w20,w20,w17			// h+=Sigma0(a)
+#ifndef	__ARMEB__
+	rev	w11,w11			// 8
+#endif
+	add	w20,w20,w17			// h+=Sigma0(a)
+	ror	w16,w24,#6
+	add	w27,w27,w19			// h+=K[i]
+	eor	w14,w24,w24,ror#14
+	and	w17,w25,w24
+	bic	w19,w26,w24
+	add	w27,w27,w11			// h+=X[i]
+	orr	w17,w17,w19			// Ch(e,f,g)
+	eor	w19,w20,w21			// a^b, b^c in next round
+	eor	w16,w16,w14,ror#11	// Sigma1(e)
+	ror	w14,w20,#2
+	add	w27,w27,w17			// h+=Ch(e,f,g)
+	eor	w17,w20,w20,ror#9
+	add	w27,w27,w16			// h+=Sigma1(e)
+	and	w28,w28,w19			// (b^c)&=(a^b)
+	add	w23,w23,w27			// d+=h
+	eor	w28,w28,w21			// Maj(a,b,c)
+	eor	w17,w14,w17,ror#13	// Sigma0(a)
+	add	w27,w27,w28			// h+=Maj(a,b,c)
+	ldr	w28,[x30],#4		// *K++, w19 in next round
+	//add	w27,w27,w17			// h+=Sigma0(a)
+#ifndef	__ARMEB__
+	rev	w12,w12			// 9
+#endif
+	ldp	w13,w14,[x1],#2*4
+	add	w27,w27,w17			// h+=Sigma0(a)
+	ror	w16,w23,#6
+	add	w26,w26,w28			// h+=K[i]
+	eor	w15,w23,w23,ror#14
+	and	w17,w24,w23
+	bic	w28,w25,w23
+	add	w26,w26,w12			// h+=X[i]
+	orr	w17,w17,w28			// Ch(e,f,g)
+	eor	w28,w27,w20			// a^b, b^c in next round
+	eor	w16,w16,w15,ror#11	// Sigma1(e)
+	ror	w15,w27,#2
+	add	w26,w26,w17			// h+=Ch(e,f,g)
+	eor	w17,w27,w27,ror#9
+	add	w26,w26,w16			// h+=Sigma1(e)
+	and	w19,w19,w28			// (b^c)&=(a^b)
+	add	w22,w22,w26			// d+=h
+	eor	w19,w19,w20			// Maj(a,b,c)
+	eor	w17,w15,w17,ror#13	// Sigma0(a)
+	add	w26,w26,w19			// h+=Maj(a,b,c)
+	ldr	w19,[x30],#4		// *K++, w28 in next round
+	//add	w26,w26,w17			// h+=Sigma0(a)
+#ifndef	__ARMEB__
+	rev	w13,w13			// 10
+#endif
+	add	w26,w26,w17			// h+=Sigma0(a)
+	ror	w16,w22,#6
+	add	w25,w25,w19			// h+=K[i]
+	eor	w0,w22,w22,ror#14
+	and	w17,w23,w22
+	bic	w19,w24,w22
+	add	w25,w25,w13			// h+=X[i]
+	orr	w17,w17,w19			// Ch(e,f,g)
+	eor	w19,w26,w27			// a^b, b^c in next round
+	eor	w16,w16,w0,ror#11	// Sigma1(e)
+	ror	w0,w26,#2
+	add	w25,w25,w17			// h+=Ch(e,f,g)
+	eor	w17,w26,w26,ror#9
+	add	w25,w25,w16			// h+=Sigma1(e)
+	and	w28,w28,w19			// (b^c)&=(a^b)
+	add	w21,w21,w25			// d+=h
+	eor	w28,w28,w27			// Maj(a,b,c)
+	eor	w17,w0,w17,ror#13	// Sigma0(a)
+	add	w25,w25,w28			// h+=Maj(a,b,c)
+	ldr	w28,[x30],#4		// *K++, w19 in next round
+	//add	w25,w25,w17			// h+=Sigma0(a)
+#ifndef	__ARMEB__
+	rev	w14,w14			// 11
+#endif
+	ldp	w15,w0,[x1],#2*4
+	add	w25,w25,w17			// h+=Sigma0(a)
+	str	w6,[sp,#12]
+	ror	w16,w21,#6
+	add	w24,w24,w28			// h+=K[i]
+	eor	w6,w21,w21,ror#14
+	and	w17,w22,w21
+	bic	w28,w23,w21
+	add	w24,w24,w14			// h+=X[i]
+	orr	w17,w17,w28			// Ch(e,f,g)
+	eor	w28,w25,w26			// a^b, b^c in next round
+	eor	w16,w16,w6,ror#11	// Sigma1(e)
+	ror	w6,w25,#2
+	add	w24,w24,w17			// h+=Ch(e,f,g)
+	eor	w17,w25,w25,ror#9
+	add	w24,w24,w16			// h+=Sigma1(e)
+	and	w19,w19,w28			// (b^c)&=(a^b)
+	add	w20,w20,w24			// d+=h
+	eor	w19,w19,w26			// Maj(a,b,c)
+	eor	w17,w6,w17,ror#13	// Sigma0(a)
+	add	w24,w24,w19			// h+=Maj(a,b,c)
+	ldr	w19,[x30],#4		// *K++, w28 in next round
+	//add	w24,w24,w17			// h+=Sigma0(a)
+#ifndef	__ARMEB__
+	rev	w15,w15			// 12
+#endif
+	add	w24,w24,w17			// h+=Sigma0(a)
+	str	w7,[sp,#0]
+	ror	w16,w20,#6
+	add	w23,w23,w19			// h+=K[i]
+	eor	w7,w20,w20,ror#14
+	and	w17,w21,w20
+	bic	w19,w22,w20
+	add	w23,w23,w15			// h+=X[i]
+	orr	w17,w17,w19			// Ch(e,f,g)
+	eor	w19,w24,w25			// a^b, b^c in next round
+	eor	w16,w16,w7,ror#11	// Sigma1(e)
+	ror	w7,w24,#2
+	add	w23,w23,w17			// h+=Ch(e,f,g)
+	eor	w17,w24,w24,ror#9
+	add	w23,w23,w16			// h+=Sigma1(e)
+	and	w28,w28,w19			// (b^c)&=(a^b)
+	add	w27,w27,w23			// d+=h
+	eor	w28,w28,w25			// Maj(a,b,c)
+	eor	w17,w7,w17,ror#13	// Sigma0(a)
+	add	w23,w23,w28			// h+=Maj(a,b,c)
+	ldr	w28,[x30],#4		// *K++, w19 in next round
+	//add	w23,w23,w17			// h+=Sigma0(a)
+#ifndef	__ARMEB__
+	rev	w0,w0			// 13
+#endif
+	ldp	w1,w2,[x1]
+	add	w23,w23,w17			// h+=Sigma0(a)
+	str	w8,[sp,#4]
+	ror	w16,w27,#6
+	add	w22,w22,w28			// h+=K[i]
+	eor	w8,w27,w27,ror#14
+	and	w17,w20,w27
+	bic	w28,w21,w27
+	add	w22,w22,w0			// h+=X[i]
+	orr	w17,w17,w28			// Ch(e,f,g)
+	eor	w28,w23,w24			// a^b, b^c in next round
+	eor	w16,w16,w8,ror#11	// Sigma1(e)
+	ror	w8,w23,#2
+	add	w22,w22,w17			// h+=Ch(e,f,g)
+	eor	w17,w23,w23,ror#9
+	add	w22,w22,w16			// h+=Sigma1(e)
+	and	w19,w19,w28			// (b^c)&=(a^b)
+	add	w26,w26,w22			// d+=h
+	eor	w19,w19,w24			// Maj(a,b,c)
+	eor	w17,w8,w17,ror#13	// Sigma0(a)
+	add	w22,w22,w19			// h+=Maj(a,b,c)
+	ldr	w19,[x30],#4		// *K++, w28 in next round
+	//add	w22,w22,w17			// h+=Sigma0(a)
+#ifndef	__ARMEB__
+	rev	w1,w1			// 14
+#endif
+	ldr	w6,[sp,#12]
+	add	w22,w22,w17			// h+=Sigma0(a)
+	str	w9,[sp,#8]
+	ror	w16,w26,#6
+	add	w21,w21,w19			// h+=K[i]
+	eor	w9,w26,w26,ror#14
+	and	w17,w27,w26
+	bic	w19,w20,w26
+	add	w21,w21,w1			// h+=X[i]
+	orr	w17,w17,w19			// Ch(e,f,g)
+	eor	w19,w22,w23			// a^b, b^c in next round
+	eor	w16,w16,w9,ror#11	// Sigma1(e)
+	ror	w9,w22,#2
+	add	w21,w21,w17			// h+=Ch(e,f,g)
+	eor	w17,w22,w22,ror#9
+	add	w21,w21,w16			// h+=Sigma1(e)
+	and	w28,w28,w19			// (b^c)&=(a^b)
+	add	w25,w25,w21			// d+=h
+	eor	w28,w28,w23			// Maj(a,b,c)
+	eor	w17,w9,w17,ror#13	// Sigma0(a)
+	add	w21,w21,w28			// h+=Maj(a,b,c)
+	ldr	w28,[x30],#4		// *K++, w19 in next round
+	//add	w21,w21,w17			// h+=Sigma0(a)
+#ifndef	__ARMEB__
+	rev	w2,w2			// 15
+#endif
+	ldr	w7,[sp,#0]
+	add	w21,w21,w17			// h+=Sigma0(a)
+	str	w10,[sp,#12]
+	ror	w16,w25,#6
+	add	w20,w20,w28			// h+=K[i]
+	ror	w9,w4,#7
+	and	w17,w26,w25
+	ror	w8,w1,#17
+	bic	w28,w27,w25
+	ror	w10,w21,#2
+	add	w20,w20,w2			// h+=X[i]
+	eor	w16,w16,w25,ror#11
+	eor	w9,w9,w4,ror#18
+	orr	w17,w17,w28			// Ch(e,f,g)
+	eor	w28,w21,w22			// a^b, b^c in next round
+	eor	w16,w16,w25,ror#25	// Sigma1(e)
+	eor	w10,w10,w21,ror#13
+	add	w20,w20,w17			// h+=Ch(e,f,g)
+	and	w19,w19,w28			// (b^c)&=(a^b)
+	eor	w8,w8,w1,ror#19
+	eor	w9,w9,w4,lsr#3	// sigma0(X[i+1])
+	add	w20,w20,w16			// h+=Sigma1(e)
+	eor	w19,w19,w22			// Maj(a,b,c)
+	eor	w17,w10,w21,ror#22	// Sigma0(a)
+	eor	w8,w8,w1,lsr#10	// sigma1(X[i+14])
+	add	w3,w3,w12
+	add	w24,w24,w20			// d+=h
+	add	w20,w20,w19			// h+=Maj(a,b,c)
+	ldr	w19,[x30],#4		// *K++, w28 in next round
+	add	w3,w3,w9
+	add	w20,w20,w17			// h+=Sigma0(a)
+	add	w3,w3,w8
+.Loop_16_xx:
+	ldr	w8,[sp,#4]
+	str	w11,[sp,#0]
+	ror	w16,w24,#6
+	add	w27,w27,w19			// h+=K[i]
+	ror	w10,w5,#7
+	and	w17,w25,w24
+	ror	w9,w2,#17
+	bic	w19,w26,w24
+	ror	w11,w20,#2
+	add	w27,w27,w3			// h+=X[i]
+	eor	w16,w16,w24,ror#11
+	eor	w10,w10,w5,ror#18
+	orr	w17,w17,w19			// Ch(e,f,g)
+	eor	w19,w20,w21			// a^b, b^c in next round
+	eor	w16,w16,w24,ror#25	// Sigma1(e)
+	eor	w11,w11,w20,ror#13
+	add	w27,w27,w17			// h+=Ch(e,f,g)
+	and	w28,w28,w19			// (b^c)&=(a^b)
+	eor	w9,w9,w2,ror#19
+	eor	w10,w10,w5,lsr#3	// sigma0(X[i+1])
+	add	w27,w27,w16			// h+=Sigma1(e)
+	eor	w28,w28,w21			// Maj(a,b,c)
+	eor	w17,w11,w20,ror#22	// Sigma0(a)
+	eor	w9,w9,w2,lsr#10	// sigma1(X[i+14])
+	add	w4,w4,w13
+	add	w23,w23,w27			// d+=h
+	add	w27,w27,w28			// h+=Maj(a,b,c)
+	ldr	w28,[x30],#4		// *K++, w19 in next round
+	add	w4,w4,w10
+	add	w27,w27,w17			// h+=Sigma0(a)
+	add	w4,w4,w9
+	ldr	w9,[sp,#8]
+	str	w12,[sp,#4]
+	ror	w16,w23,#6
+	add	w26,w26,w28			// h+=K[i]
+	ror	w11,w6,#7
+	and	w17,w24,w23
+	ror	w10,w3,#17
+	bic	w28,w25,w23
+	ror	w12,w27,#2
+	add	w26,w26,w4			// h+=X[i]
+	eor	w16,w16,w23,ror#11
+	eor	w11,w11,w6,ror#18
+	orr	w17,w17,w28			// Ch(e,f,g)
+	eor	w28,w27,w20			// a^b, b^c in next round
+	eor	w16,w16,w23,ror#25	// Sigma1(e)
+	eor	w12,w12,w27,ror#13
+	add	w26,w26,w17			// h+=Ch(e,f,g)
+	and	w19,w19,w28			// (b^c)&=(a^b)
+	eor	w10,w10,w3,ror#19
+	eor	w11,w11,w6,lsr#3	// sigma0(X[i+1])
+	add	w26,w26,w16			// h+=Sigma1(e)
+	eor	w19,w19,w20			// Maj(a,b,c)
+	eor	w17,w12,w27,ror#22	// Sigma0(a)
+	eor	w10,w10,w3,lsr#10	// sigma1(X[i+14])
+	add	w5,w5,w14
+	add	w22,w22,w26			// d+=h
+	add	w26,w26,w19			// h+=Maj(a,b,c)
+	ldr	w19,[x30],#4		// *K++, w28 in next round
+	add	w5,w5,w11
+	add	w26,w26,w17			// h+=Sigma0(a)
+	add	w5,w5,w10
+	ldr	w10,[sp,#12]
+	str	w13,[sp,#8]
+	ror	w16,w22,#6
+	add	w25,w25,w19			// h+=K[i]
+	ror	w12,w7,#7
+	and	w17,w23,w22
+	ror	w11,w4,#17
+	bic	w19,w24,w22
+	ror	w13,w26,#2
+	add	w25,w25,w5			// h+=X[i]
+	eor	w16,w16,w22,ror#11
+	eor	w12,w12,w7,ror#18
+	orr	w17,w17,w19			// Ch(e,f,g)
+	eor	w19,w26,w27			// a^b, b^c in next round
+	eor	w16,w16,w22,ror#25	// Sigma1(e)
+	eor	w13,w13,w26,ror#13
+	add	w25,w25,w17			// h+=Ch(e,f,g)
+	and	w28,w28,w19			// (b^c)&=(a^b)
+	eor	w11,w11,w4,ror#19
+	eor	w12,w12,w7,lsr#3	// sigma0(X[i+1])
+	add	w25,w25,w16			// h+=Sigma1(e)
+	eor	w28,w28,w27			// Maj(a,b,c)
+	eor	w17,w13,w26,ror#22	// Sigma0(a)
+	eor	w11,w11,w4,lsr#10	// sigma1(X[i+14])
+	add	w6,w6,w15
+	add	w21,w21,w25			// d+=h
+	add	w25,w25,w28			// h+=Maj(a,b,c)
+	ldr	w28,[x30],#4		// *K++, w19 in next round
+	add	w6,w6,w12
+	add	w25,w25,w17			// h+=Sigma0(a)
+	add	w6,w6,w11
+	ldr	w11,[sp,#0]
+	str	w14,[sp,#12]
+	ror	w16,w21,#6
+	add	w24,w24,w28			// h+=K[i]
+	ror	w13,w8,#7
+	and	w17,w22,w21
+	ror	w12,w5,#17
+	bic	w28,w23,w21
+	ror	w14,w25,#2
+	add	w24,w24,w6			// h+=X[i]
+	eor	w16,w16,w21,ror#11
+	eor	w13,w13,w8,ror#18
+	orr	w17,w17,w28			// Ch(e,f,g)
+	eor	w28,w25,w26			// a^b, b^c in next round
+	eor	w16,w16,w21,ror#25	// Sigma1(e)
+	eor	w14,w14,w25,ror#13
+	add	w24,w24,w17			// h+=Ch(e,f,g)
+	and	w19,w19,w28			// (b^c)&=(a^b)
+	eor	w12,w12,w5,ror#19
+	eor	w13,w13,w8,lsr#3	// sigma0(X[i+1])
+	add	w24,w24,w16			// h+=Sigma1(e)
+	eor	w19,w19,w26			// Maj(a,b,c)
+	eor	w17,w14,w25,ror#22	// Sigma0(a)
+	eor	w12,w12,w5,lsr#10	// sigma1(X[i+14])
+	add	w7,w7,w0
+	add	w20,w20,w24			// d+=h
+	add	w24,w24,w19			// h+=Maj(a,b,c)
+	ldr	w19,[x30],#4		// *K++, w28 in next round
+	add	w7,w7,w13
+	add	w24,w24,w17			// h+=Sigma0(a)
+	add	w7,w7,w12
+	ldr	w12,[sp,#4]
+	str	w15,[sp,#0]
+	ror	w16,w20,#6
+	add	w23,w23,w19			// h+=K[i]
+	ror	w14,w9,#7
+	and	w17,w21,w20
+	ror	w13,w6,#17
+	bic	w19,w22,w20
+	ror	w15,w24,#2
+	add	w23,w23,w7			// h+=X[i]
+	eor	w16,w16,w20,ror#11
+	eor	w14,w14,w9,ror#18
+	orr	w17,w17,w19			// Ch(e,f,g)
+	eor	w19,w24,w25			// a^b, b^c in next round
+	eor	w16,w16,w20,ror#25	// Sigma1(e)
+	eor	w15,w15,w24,ror#13
+	add	w23,w23,w17			// h+=Ch(e,f,g)
+	and	w28,w28,w19			// (b^c)&=(a^b)
+	eor	w13,w13,w6,ror#19
+	eor	w14,w14,w9,lsr#3	// sigma0(X[i+1])
+	add	w23,w23,w16			// h+=Sigma1(e)
+	eor	w28,w28,w25			// Maj(a,b,c)
+	eor	w17,w15,w24,ror#22	// Sigma0(a)
+	eor	w13,w13,w6,lsr#10	// sigma1(X[i+14])
+	add	w8,w8,w1
+	add	w27,w27,w23			// d+=h
+	add	w23,w23,w28			// h+=Maj(a,b,c)
+	ldr	w28,[x30],#4		// *K++, w19 in next round
+	add	w8,w8,w14
+	add	w23,w23,w17			// h+=Sigma0(a)
+	add	w8,w8,w13
+	ldr	w13,[sp,#8]
+	str	w0,[sp,#4]
+	ror	w16,w27,#6
+	add	w22,w22,w28			// h+=K[i]
+	ror	w15,w10,#7
+	and	w17,w20,w27
+	ror	w14,w7,#17
+	bic	w28,w21,w27
+	ror	w0,w23,#2
+	add	w22,w22,w8			// h+=X[i]
+	eor	w16,w16,w27,ror#11
+	eor	w15,w15,w10,ror#18
+	orr	w17,w17,w28			// Ch(e,f,g)
+	eor	w28,w23,w24			// a^b, b^c in next round
+	eor	w16,w16,w27,ror#25	// Sigma1(e)
+	eor	w0,w0,w23,ror#13
+	add	w22,w22,w17			// h+=Ch(e,f,g)
+	and	w19,w19,w28			// (b^c)&=(a^b)
+	eor	w14,w14,w7,ror#19
+	eor	w15,w15,w10,lsr#3	// sigma0(X[i+1])
+	add	w22,w22,w16			// h+=Sigma1(e)
+	eor	w19,w19,w24			// Maj(a,b,c)
+	eor	w17,w0,w23,ror#22	// Sigma0(a)
+	eor	w14,w14,w7,lsr#10	// sigma1(X[i+14])
+	add	w9,w9,w2
+	add	w26,w26,w22			// d+=h
+	add	w22,w22,w19			// h+=Maj(a,b,c)
+	ldr	w19,[x30],#4		// *K++, w28 in next round
+	add	w9,w9,w15
+	add	w22,w22,w17			// h+=Sigma0(a)
+	add	w9,w9,w14
+	ldr	w14,[sp,#12]
+	str	w1,[sp,#8]
+	ror	w16,w26,#6
+	add	w21,w21,w19			// h+=K[i]
+	ror	w0,w11,#7
+	and	w17,w27,w26
+	ror	w15,w8,#17
+	bic	w19,w20,w26
+	ror	w1,w22,#2
+	add	w21,w21,w9			// h+=X[i]
+	eor	w16,w16,w26,ror#11
+	eor	w0,w0,w11,ror#18
+	orr	w17,w17,w19			// Ch(e,f,g)
+	eor	w19,w22,w23			// a^b, b^c in next round
+	eor	w16,w16,w26,ror#25	// Sigma1(e)
+	eor	w1,w1,w22,ror#13
+	add	w21,w21,w17			// h+=Ch(e,f,g)
+	and	w28,w28,w19			// (b^c)&=(a^b)
+	eor	w15,w15,w8,ror#19
+	eor	w0,w0,w11,lsr#3	// sigma0(X[i+1])
+	add	w21,w21,w16			// h+=Sigma1(e)
+	eor	w28,w28,w23			// Maj(a,b,c)
+	eor	w17,w1,w22,ror#22	// Sigma0(a)
+	eor	w15,w15,w8,lsr#10	// sigma1(X[i+14])
+	add	w10,w10,w3
+	add	w25,w25,w21			// d+=h
+	add	w21,w21,w28			// h+=Maj(a,b,c)
+	ldr	w28,[x30],#4		// *K++, w19 in next round
+	add	w10,w10,w0
+	add	w21,w21,w17			// h+=Sigma0(a)
+	add	w10,w10,w15
+	ldr	w15,[sp,#0]
+	str	w2,[sp,#12]
+	ror	w16,w25,#6
+	add	w20,w20,w28			// h+=K[i]
+	ror	w1,w12,#7
+	and	w17,w26,w25
+	ror	w0,w9,#17
+	bic	w28,w27,w25
+	ror	w2,w21,#2
+	add	w20,w20,w10			// h+=X[i]
+	eor	w16,w16,w25,ror#11
+	eor	w1,w1,w12,ror#18
+	orr	w17,w17,w28			// Ch(e,f,g)
+	eor	w28,w21,w22			// a^b, b^c in next round
+	eor	w16,w16,w25,ror#25	// Sigma1(e)
+	eor	w2,w2,w21,ror#13
+	add	w20,w20,w17			// h+=Ch(e,f,g)
+	and	w19,w19,w28			// (b^c)&=(a^b)
+	eor	w0,w0,w9,ror#19
+	eor	w1,w1,w12,lsr#3	// sigma0(X[i+1])
+	add	w20,w20,w16			// h+=Sigma1(e)
+	eor	w19,w19,w22			// Maj(a,b,c)
+	eor	w17,w2,w21,ror#22	// Sigma0(a)
+	eor	w0,w0,w9,lsr#10	// sigma1(X[i+14])
+	add	w11,w11,w4
+	add	w24,w24,w20			// d+=h
+	add	w20,w20,w19			// h+=Maj(a,b,c)
+	ldr	w19,[x30],#4		// *K++, w28 in next round
+	add	w11,w11,w1
+	add	w20,w20,w17			// h+=Sigma0(a)
+	add	w11,w11,w0
+	ldr	w0,[sp,#4]
+	str	w3,[sp,#0]
+	ror	w16,w24,#6
+	add	w27,w27,w19			// h+=K[i]
+	ror	w2,w13,#7
+	and	w17,w25,w24
+	ror	w1,w10,#17
+	bic	w19,w26,w24
+	ror	w3,w20,#2
+	add	w27,w27,w11			// h+=X[i]
+	eor	w16,w16,w24,ror#11
+	eor	w2,w2,w13,ror#18
+	orr	w17,w17,w19			// Ch(e,f,g)
+	eor	w19,w20,w21			// a^b, b^c in next round
+	eor	w16,w16,w24,ror#25	// Sigma1(e)
+	eor	w3,w3,w20,ror#13
+	add	w27,w27,w17			// h+=Ch(e,f,g)
+	and	w28,w28,w19			// (b^c)&=(a^b)
+	eor	w1,w1,w10,ror#19
+	eor	w2,w2,w13,lsr#3	// sigma0(X[i+1])
+	add	w27,w27,w16			// h+=Sigma1(e)
+	eor	w28,w28,w21			// Maj(a,b,c)
+	eor	w17,w3,w20,ror#22	// Sigma0(a)
+	eor	w1,w1,w10,lsr#10	// sigma1(X[i+14])
+	add	w12,w12,w5
+	add	w23,w23,w27			// d+=h
+	add	w27,w27,w28			// h+=Maj(a,b,c)
+	ldr	w28,[x30],#4		// *K++, w19 in next round
+	add	w12,w12,w2
+	add	w27,w27,w17			// h+=Sigma0(a)
+	add	w12,w12,w1
+	ldr	w1,[sp,#8]
+	str	w4,[sp,#4]
+	ror	w16,w23,#6
+	add	w26,w26,w28			// h+=K[i]
+	ror	w3,w14,#7
+	and	w17,w24,w23
+	ror	w2,w11,#17
+	bic	w28,w25,w23
+	ror	w4,w27,#2
+	add	w26,w26,w12			// h+=X[i]
+	eor	w16,w16,w23,ror#11
+	eor	w3,w3,w14,ror#18
+	orr	w17,w17,w28			// Ch(e,f,g)
+	eor	w28,w27,w20			// a^b, b^c in next round
+	eor	w16,w16,w23,ror#25	// Sigma1(e)
+	eor	w4,w4,w27,ror#13
+	add	w26,w26,w17			// h+=Ch(e,f,g)
+	and	w19,w19,w28			// (b^c)&=(a^b)
+	eor	w2,w2,w11,ror#19
+	eor	w3,w3,w14,lsr#3	// sigma0(X[i+1])
+	add	w26,w26,w16			// h+=Sigma1(e)
+	eor	w19,w19,w20			// Maj(a,b,c)
+	eor	w17,w4,w27,ror#22	// Sigma0(a)
+	eor	w2,w2,w11,lsr#10	// sigma1(X[i+14])
+	add	w13,w13,w6
+	add	w22,w22,w26			// d+=h
+	add	w26,w26,w19			// h+=Maj(a,b,c)
+	ldr	w19,[x30],#4		// *K++, w28 in next round
+	add	w13,w13,w3
+	add	w26,w26,w17			// h+=Sigma0(a)
+	add	w13,w13,w2
+	ldr	w2,[sp,#12]
+	str	w5,[sp,#8]
+	ror	w16,w22,#6
+	add	w25,w25,w19			// h+=K[i]
+	ror	w4,w15,#7
+	and	w17,w23,w22
+	ror	w3,w12,#17
+	bic	w19,w24,w22
+	ror	w5,w26,#2
+	add	w25,w25,w13			// h+=X[i]
+	eor	w16,w16,w22,ror#11
+	eor	w4,w4,w15,ror#18
+	orr	w17,w17,w19			// Ch(e,f,g)
+	eor	w19,w26,w27			// a^b, b^c in next round
+	eor	w16,w16,w22,ror#25	// Sigma1(e)
+	eor	w5,w5,w26,ror#13
+	add	w25,w25,w17			// h+=Ch(e,f,g)
+	and	w28,w28,w19			// (b^c)&=(a^b)
+	eor	w3,w3,w12,ror#19
+	eor	w4,w4,w15,lsr#3	// sigma0(X[i+1])
+	add	w25,w25,w16			// h+=Sigma1(e)
+	eor	w28,w28,w27			// Maj(a,b,c)
+	eor	w17,w5,w26,ror#22	// Sigma0(a)
+	eor	w3,w3,w12,lsr#10	// sigma1(X[i+14])
+	add	w14,w14,w7
+	add	w21,w21,w25			// d+=h
+	add	w25,w25,w28			// h+=Maj(a,b,c)
+	ldr	w28,[x30],#4		// *K++, w19 in next round
+	add	w14,w14,w4
+	add	w25,w25,w17			// h+=Sigma0(a)
+	add	w14,w14,w3
+	ldr	w3,[sp,#0]
+	str	w6,[sp,#12]
+	ror	w16,w21,#6
+	add	w24,w24,w28			// h+=K[i]
+	ror	w5,w0,#7
+	and	w17,w22,w21
+	ror	w4,w13,#17
+	bic	w28,w23,w21
+	ror	w6,w25,#2
+	add	w24,w24,w14			// h+=X[i]
+	eor	w16,w16,w21,ror#11
+	eor	w5,w5,w0,ror#18
+	orr	w17,w17,w28			// Ch(e,f,g)
+	eor	w28,w25,w26			// a^b, b^c in next round
+	eor	w16,w16,w21,ror#25	// Sigma1(e)
+	eor	w6,w6,w25,ror#13
+	add	w24,w24,w17			// h+=Ch(e,f,g)
+	and	w19,w19,w28			// (b^c)&=(a^b)
+	eor	w4,w4,w13,ror#19
+	eor	w5,w5,w0,lsr#3	// sigma0(X[i+1])
+	add	w24,w24,w16			// h+=Sigma1(e)
+	eor	w19,w19,w26			// Maj(a,b,c)
+	eor	w17,w6,w25,ror#22	// Sigma0(a)
+	eor	w4,w4,w13,lsr#10	// sigma1(X[i+14])
+	add	w15,w15,w8
+	add	w20,w20,w24			// d+=h
+	add	w24,w24,w19			// h+=Maj(a,b,c)
+	ldr	w19,[x30],#4		// *K++, w28 in next round
+	add	w15,w15,w5
+	add	w24,w24,w17			// h+=Sigma0(a)
+	add	w15,w15,w4
+	ldr	w4,[sp,#4]
+	str	w7,[sp,#0]
+	ror	w16,w20,#6
+	add	w23,w23,w19			// h+=K[i]
+	ror	w6,w1,#7
+	and	w17,w21,w20
+	ror	w5,w14,#17
+	bic	w19,w22,w20
+	ror	w7,w24,#2
+	add	w23,w23,w15			// h+=X[i]
+	eor	w16,w16,w20,ror#11
+	eor	w6,w6,w1,ror#18
+	orr	w17,w17,w19			// Ch(e,f,g)
+	eor	w19,w24,w25			// a^b, b^c in next round
+	eor	w16,w16,w20,ror#25	// Sigma1(e)
+	eor	w7,w7,w24,ror#13
+	add	w23,w23,w17			// h+=Ch(e,f,g)
+	and	w28,w28,w19			// (b^c)&=(a^b)
+	eor	w5,w5,w14,ror#19
+	eor	w6,w6,w1,lsr#3	// sigma0(X[i+1])
+	add	w23,w23,w16			// h+=Sigma1(e)
+	eor	w28,w28,w25			// Maj(a,b,c)
+	eor	w17,w7,w24,ror#22	// Sigma0(a)
+	eor	w5,w5,w14,lsr#10	// sigma1(X[i+14])
+	add	w0,w0,w9
+	add	w27,w27,w23			// d+=h
+	add	w23,w23,w28			// h+=Maj(a,b,c)
+	ldr	w28,[x30],#4		// *K++, w19 in next round
+	add	w0,w0,w6
+	add	w23,w23,w17			// h+=Sigma0(a)
+	add	w0,w0,w5
+	ldr	w5,[sp,#8]
+	str	w8,[sp,#4]
+	ror	w16,w27,#6
+	add	w22,w22,w28			// h+=K[i]
+	ror	w7,w2,#7
+	and	w17,w20,w27
+	ror	w6,w15,#17
+	bic	w28,w21,w27
+	ror	w8,w23,#2
+	add	w22,w22,w0			// h+=X[i]
+	eor	w16,w16,w27,ror#11
+	eor	w7,w7,w2,ror#18
+	orr	w17,w17,w28			// Ch(e,f,g)
+	eor	w28,w23,w24			// a^b, b^c in next round
+	eor	w16,w16,w27,ror#25	// Sigma1(e)
+	eor	w8,w8,w23,ror#13
+	add	w22,w22,w17			// h+=Ch(e,f,g)
+	and	w19,w19,w28			// (b^c)&=(a^b)
+	eor	w6,w6,w15,ror#19
+	eor	w7,w7,w2,lsr#3	// sigma0(X[i+1])
+	add	w22,w22,w16			// h+=Sigma1(e)
+	eor	w19,w19,w24			// Maj(a,b,c)
+	eor	w17,w8,w23,ror#22	// Sigma0(a)
+	eor	w6,w6,w15,lsr#10	// sigma1(X[i+14])
+	add	w1,w1,w10
+	add	w26,w26,w22			// d+=h
+	add	w22,w22,w19			// h+=Maj(a,b,c)
+	ldr	w19,[x30],#4		// *K++, w28 in next round
+	add	w1,w1,w7
+	add	w22,w22,w17			// h+=Sigma0(a)
+	add	w1,w1,w6
+	ldr	w6,[sp,#12]
+	str	w9,[sp,#8]
+	ror	w16,w26,#6
+	add	w21,w21,w19			// h+=K[i]
+	ror	w8,w3,#7
+	and	w17,w27,w26
+	ror	w7,w0,#17
+	bic	w19,w20,w26
+	ror	w9,w22,#2
+	add	w21,w21,w1			// h+=X[i]
+	eor	w16,w16,w26,ror#11
+	eor	w8,w8,w3,ror#18
+	orr	w17,w17,w19			// Ch(e,f,g)
+	eor	w19,w22,w23			// a^b, b^c in next round
+	eor	w16,w16,w26,ror#25	// Sigma1(e)
+	eor	w9,w9,w22,ror#13
+	add	w21,w21,w17			// h+=Ch(e,f,g)
+	and	w28,w28,w19			// (b^c)&=(a^b)
+	eor	w7,w7,w0,ror#19
+	eor	w8,w8,w3,lsr#3	// sigma0(X[i+1])
+	add	w21,w21,w16			// h+=Sigma1(e)
+	eor	w28,w28,w23			// Maj(a,b,c)
+	eor	w17,w9,w22,ror#22	// Sigma0(a)
+	eor	w7,w7,w0,lsr#10	// sigma1(X[i+14])
+	add	w2,w2,w11
+	add	w25,w25,w21			// d+=h
+	add	w21,w21,w28			// h+=Maj(a,b,c)
+	ldr	w28,[x30],#4		// *K++, w19 in next round
+	add	w2,w2,w8
+	add	w21,w21,w17			// h+=Sigma0(a)
+	add	w2,w2,w7
+	ldr	w7,[sp,#0]
+	str	w10,[sp,#12]
+	ror	w16,w25,#6
+	add	w20,w20,w28			// h+=K[i]
+	ror	w9,w4,#7
+	and	w17,w26,w25
+	ror	w8,w1,#17
+	bic	w28,w27,w25
+	ror	w10,w21,#2
+	add	w20,w20,w2			// h+=X[i]
+	eor	w16,w16,w25,ror#11
+	eor	w9,w9,w4,ror#18
+	orr	w17,w17,w28			// Ch(e,f,g)
+	eor	w28,w21,w22			// a^b, b^c in next round
+	eor	w16,w16,w25,ror#25	// Sigma1(e)
+	eor	w10,w10,w21,ror#13
+	add	w20,w20,w17			// h+=Ch(e,f,g)
+	and	w19,w19,w28			// (b^c)&=(a^b)
+	eor	w8,w8,w1,ror#19
+	eor	w9,w9,w4,lsr#3	// sigma0(X[i+1])
+	add	w20,w20,w16			// h+=Sigma1(e)
+	eor	w19,w19,w22			// Maj(a,b,c)
+	eor	w17,w10,w21,ror#22	// Sigma0(a)
+	eor	w8,w8,w1,lsr#10	// sigma1(X[i+14])
+	add	w3,w3,w12
+	add	w24,w24,w20			// d+=h
+	add	w20,w20,w19			// h+=Maj(a,b,c)
+	ldr	w19,[x30],#4		// *K++, w28 in next round
+	add	w3,w3,w9
+	add	w20,w20,w17			// h+=Sigma0(a)
+	add	w3,w3,w8
+	cbnz	w19,.Loop_16_xx
+
+	ldp	x0,x2,[x29,#96]
+	ldr	x1,[x29,#112]
+	sub	x30,x30,#260		// rewind
+
+	ldp	w3,w4,[x0]
+	ldp	w5,w6,[x0,#2*4]
+	add	x1,x1,#14*4			// advance input pointer
+	ldp	w7,w8,[x0,#4*4]
+	add	w20,w20,w3
+	ldp	w9,w10,[x0,#6*4]
+	add	w21,w21,w4
+	add	w22,w22,w5
+	add	w23,w23,w6
+	stp	w20,w21,[x0]
+	add	w24,w24,w7
+	add	w25,w25,w8
+	stp	w22,w23,[x0,#2*4]
+	add	w26,w26,w9
+	add	w27,w27,w10
+	cmp	x1,x2
+	stp	w24,w25,[x0,#4*4]
+	stp	w26,w27,[x0,#6*4]
+	b.ne	.Loop
+
+	ldp	x19,x20,[x29,#16]
+	add	sp,sp,#4*4
+	ldp	x21,x22,[x29,#32]
+	ldp	x23,x24,[x29,#48]
+	ldp	x25,x26,[x29,#64]
+	ldp	x27,x28,[x29,#80]
+	ldp	x29,x30,[sp],#128
+	ret
+.size	sha256_block_data_order,.-sha256_block_data_order
+
+.align	6
+.type	.LK256,%object
+.LK256:
+.long	0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5
+.long	0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5
+.long	0xd807aa98,0x12835b01,0x243185be,0x550c7dc3
+.long	0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174
+.long	0xe49b69c1,0xefbe4786,0x0fc19dc6,0x240ca1cc
+.long	0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da
+.long	0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7
+.long	0xc6e00bf3,0xd5a79147,0x06ca6351,0x14292967
+.long	0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13
+.long	0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85
+.long	0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3
+.long	0xd192e819,0xd6990624,0xf40e3585,0x106aa070
+.long	0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5
+.long	0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3
+.long	0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208
+.long	0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2
+.long	0	//terminator
+.size	.LK256,.-.LK256
+.align	3
+.LOPENSSL_armcap_P:
+.quad	OPENSSL_armcap_P-.
+.byte	83,72,65,50,53,54,32,98,108,111,99,107,32,116,114,97,110,115,102,111,114,109,32,102,111,114,32,65,82,77,118,56,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0
+.align	2
+.align	2
+.type	sha256_block_armv8,%function
+.align	6
+sha256_block_armv8:
+.Lv8_entry:
+	stp	x29,x30,[sp,#-16]!
+	add	x29,sp,#0
+
+	ld1	{v0.4s,v1.4s},[x0]
+	adr	x3,.LK256
+
+.Loop_hw:
+	ld1	{v4.16b,v5.16b,v6.16b,v7.16b},[x1],#64
+	sub	x2,x2,#1
+	ld1	{v16.4s},[x3],#16
+	rev32	v4.16b,v4.16b
+	rev32	v5.16b,v5.16b
+	rev32	v6.16b,v6.16b
+	rev32	v7.16b,v7.16b
+	orr	v18.16b,v0.16b,v0.16b		// offload
+	orr	v19.16b,v1.16b,v1.16b
+	ld1	{v17.4s},[x3],#16
+	add	v16.4s,v16.4s,v4.4s
+.inst	0x5e2828a4	//sha256su0 v4.16b,v5.16b
+	orr	v2.16b,v0.16b,v0.16b
+.inst	0x5e104020	//sha256h v0.16b,v1.16b,v16.4s
+.inst	0x5e105041	//sha256h2 v1.16b,v2.16b,v16.4s
+.inst	0x5e0760c4	//sha256su1 v4.16b,v6.16b,v7.16b
+	ld1	{v16.4s},[x3],#16
+	add	v17.4s,v17.4s,v5.4s
+.inst	0x5e2828c5	//sha256su0 v5.16b,v6.16b
+	orr	v2.16b,v0.16b,v0.16b
+.inst	0x5e114020	//sha256h v0.16b,v1.16b,v17.4s
+.inst	0x5e115041	//sha256h2 v1.16b,v2.16b,v17.4s
+.inst	0x5e0460e5	//sha256su1 v5.16b,v7.16b,v4.16b
+	ld1	{v17.4s},[x3],#16
+	add	v16.4s,v16.4s,v6.4s
+.inst	0x5e2828e6	//sha256su0 v6.16b,v7.16b
+	orr	v2.16b,v0.16b,v0.16b
+.inst	0x5e104020	//sha256h v0.16b,v1.16b,v16.4s
+.inst	0x5e105041	//sha256h2 v1.16b,v2.16b,v16.4s
+.inst	0x5e056086	//sha256su1 v6.16b,v4.16b,v5.16b
+	ld1	{v16.4s},[x3],#16
+	add	v17.4s,v17.4s,v7.4s
+.inst	0x5e282887	//sha256su0 v7.16b,v4.16b
+	orr	v2.16b,v0.16b,v0.16b
+.inst	0x5e114020	//sha256h v0.16b,v1.16b,v17.4s
+.inst	0x5e115041	//sha256h2 v1.16b,v2.16b,v17.4s
+.inst	0x5e0660a7	//sha256su1 v7.16b,v5.16b,v6.16b
+	ld1	{v17.4s},[x3],#16
+	add	v16.4s,v16.4s,v4.4s
+.inst	0x5e2828a4	//sha256su0 v4.16b,v5.16b
+	orr	v2.16b,v0.16b,v0.16b
+.inst	0x5e104020	//sha256h v0.16b,v1.16b,v16.4s
+.inst	0x5e105041	//sha256h2 v1.16b,v2.16b,v16.4s
+.inst	0x5e0760c4	//sha256su1 v4.16b,v6.16b,v7.16b
+	ld1	{v16.4s},[x3],#16
+	add	v17.4s,v17.4s,v5.4s
+.inst	0x5e2828c5	//sha256su0 v5.16b,v6.16b
+	orr	v2.16b,v0.16b,v0.16b
+.inst	0x5e114020	//sha256h v0.16b,v1.16b,v17.4s
+.inst	0x5e115041	//sha256h2 v1.16b,v2.16b,v17.4s
+.inst	0x5e0460e5	//sha256su1 v5.16b,v7.16b,v4.16b
+	ld1	{v17.4s},[x3],#16
+	add	v16.4s,v16.4s,v6.4s
+.inst	0x5e2828e6	//sha256su0 v6.16b,v7.16b
+	orr	v2.16b,v0.16b,v0.16b
+.inst	0x5e104020	//sha256h v0.16b,v1.16b,v16.4s
+.inst	0x5e105041	//sha256h2 v1.16b,v2.16b,v16.4s
+.inst	0x5e056086	//sha256su1 v6.16b,v4.16b,v5.16b
+	ld1	{v16.4s},[x3],#16
+	add	v17.4s,v17.4s,v7.4s
+.inst	0x5e282887	//sha256su0 v7.16b,v4.16b
+	orr	v2.16b,v0.16b,v0.16b
+.inst	0x5e114020	//sha256h v0.16b,v1.16b,v17.4s
+.inst	0x5e115041	//sha256h2 v1.16b,v2.16b,v17.4s
+.inst	0x5e0660a7	//sha256su1 v7.16b,v5.16b,v6.16b
+	ld1	{v17.4s},[x3],#16
+	add	v16.4s,v16.4s,v4.4s
+.inst	0x5e2828a4	//sha256su0 v4.16b,v5.16b
+	orr	v2.16b,v0.16b,v0.16b
+.inst	0x5e104020	//sha256h v0.16b,v1.16b,v16.4s
+.inst	0x5e105041	//sha256h2 v1.16b,v2.16b,v16.4s
+.inst	0x5e0760c4	//sha256su1 v4.16b,v6.16b,v7.16b
+	ld1	{v16.4s},[x3],#16
+	add	v17.4s,v17.4s,v5.4s
+.inst	0x5e2828c5	//sha256su0 v5.16b,v6.16b
+	orr	v2.16b,v0.16b,v0.16b
+.inst	0x5e114020	//sha256h v0.16b,v1.16b,v17.4s
+.inst	0x5e115041	//sha256h2 v1.16b,v2.16b,v17.4s
+.inst	0x5e0460e5	//sha256su1 v5.16b,v7.16b,v4.16b
+	ld1	{v17.4s},[x3],#16
+	add	v16.4s,v16.4s,v6.4s
+.inst	0x5e2828e6	//sha256su0 v6.16b,v7.16b
+	orr	v2.16b,v0.16b,v0.16b
+.inst	0x5e104020	//sha256h v0.16b,v1.16b,v16.4s
+.inst	0x5e105041	//sha256h2 v1.16b,v2.16b,v16.4s
+.inst	0x5e056086	//sha256su1 v6.16b,v4.16b,v5.16b
+	ld1	{v16.4s},[x3],#16
+	add	v17.4s,v17.4s,v7.4s
+.inst	0x5e282887	//sha256su0 v7.16b,v4.16b
+	orr	v2.16b,v0.16b,v0.16b
+.inst	0x5e114020	//sha256h v0.16b,v1.16b,v17.4s
+.inst	0x5e115041	//sha256h2 v1.16b,v2.16b,v17.4s
+.inst	0x5e0660a7	//sha256su1 v7.16b,v5.16b,v6.16b
+	ld1	{v17.4s},[x3],#16
+	add	v16.4s,v16.4s,v4.4s
+	orr	v2.16b,v0.16b,v0.16b
+.inst	0x5e104020	//sha256h v0.16b,v1.16b,v16.4s
+.inst	0x5e105041	//sha256h2 v1.16b,v2.16b,v16.4s
+
+	ld1	{v16.4s},[x3],#16
+	add	v17.4s,v17.4s,v5.4s
+	orr	v2.16b,v0.16b,v0.16b
+.inst	0x5e114020	//sha256h v0.16b,v1.16b,v17.4s
+.inst	0x5e115041	//sha256h2 v1.16b,v2.16b,v17.4s
+
+	ld1	{v17.4s},[x3]
+	add	v16.4s,v16.4s,v6.4s
+	sub	x3,x3,#64*4-16	// rewind
+	orr	v2.16b,v0.16b,v0.16b
+.inst	0x5e104020	//sha256h v0.16b,v1.16b,v16.4s
+.inst	0x5e105041	//sha256h2 v1.16b,v2.16b,v16.4s
+
+	add	v17.4s,v17.4s,v7.4s
+	orr	v2.16b,v0.16b,v0.16b
+.inst	0x5e114020	//sha256h v0.16b,v1.16b,v17.4s
+.inst	0x5e115041	//sha256h2 v1.16b,v2.16b,v17.4s
+
+	add	v0.4s,v0.4s,v18.4s
+	add	v1.4s,v1.4s,v19.4s
+
+	cbnz	x2,.Loop_hw
+
+	st1	{v0.4s,v1.4s},[x0]
+
+	ldr	x29,[sp],#16
+	ret
+.size	sha256_block_armv8,.-sha256_block_armv8
+.comm	OPENSSL_armcap_P,4,4
+#endif
\ No newline at end of file
diff --git a/third_party/boringssl/linux-aarch64/crypto/sha/sha512-armv8.S b/third_party/boringssl/linux-aarch64/crypto/sha/sha512-armv8.S
new file mode 100644
index 0000000..654c473
--- /dev/null
+++ b/third_party/boringssl/linux-aarch64/crypto/sha/sha512-armv8.S
@@ -0,0 +1,1025 @@
+#if defined(__aarch64__)
+#include "arm_arch.h"
+
+.text
+
+
+.globl	sha512_block_data_order
+.type	sha512_block_data_order,%function
+.align	6
+sha512_block_data_order:
+	stp	x29,x30,[sp,#-128]!
+	add	x29,sp,#0
+
+	stp	x19,x20,[sp,#16]
+	stp	x21,x22,[sp,#32]
+	stp	x23,x24,[sp,#48]
+	stp	x25,x26,[sp,#64]
+	stp	x27,x28,[sp,#80]
+	sub	sp,sp,#4*8
+
+	ldp	x20,x21,[x0]				// load context
+	ldp	x22,x23,[x0,#2*8]
+	ldp	x24,x25,[x0,#4*8]
+	add	x2,x1,x2,lsl#7	// end of input
+	ldp	x26,x27,[x0,#6*8]
+	adr	x30,.LK512
+	stp	x0,x2,[x29,#96]
+
+.Loop:
+	ldp	x3,x4,[x1],#2*8
+	ldr	x19,[x30],#8			// *K++
+	eor	x28,x21,x22				// magic seed
+	str	x1,[x29,#112]
+#ifndef	__ARMEB__
+	rev	x3,x3			// 0
+#endif
+	ror	x16,x24,#14
+	add	x27,x27,x19			// h+=K[i]
+	eor	x6,x24,x24,ror#23
+	and	x17,x25,x24
+	bic	x19,x26,x24
+	add	x27,x27,x3			// h+=X[i]
+	orr	x17,x17,x19			// Ch(e,f,g)
+	eor	x19,x20,x21			// a^b, b^c in next round
+	eor	x16,x16,x6,ror#18	// Sigma1(e)
+	ror	x6,x20,#28
+	add	x27,x27,x17			// h+=Ch(e,f,g)
+	eor	x17,x20,x20,ror#5
+	add	x27,x27,x16			// h+=Sigma1(e)
+	and	x28,x28,x19			// (b^c)&=(a^b)
+	add	x23,x23,x27			// d+=h
+	eor	x28,x28,x21			// Maj(a,b,c)
+	eor	x17,x6,x17,ror#34	// Sigma0(a)
+	add	x27,x27,x28			// h+=Maj(a,b,c)
+	ldr	x28,[x30],#8		// *K++, x19 in next round
+	//add	x27,x27,x17			// h+=Sigma0(a)
+#ifndef	__ARMEB__
+	rev	x4,x4			// 1
+#endif
+	ldp	x5,x6,[x1],#2*8
+	add	x27,x27,x17			// h+=Sigma0(a)
+	ror	x16,x23,#14
+	add	x26,x26,x28			// h+=K[i]
+	eor	x7,x23,x23,ror#23
+	and	x17,x24,x23
+	bic	x28,x25,x23
+	add	x26,x26,x4			// h+=X[i]
+	orr	x17,x17,x28			// Ch(e,f,g)
+	eor	x28,x27,x20			// a^b, b^c in next round
+	eor	x16,x16,x7,ror#18	// Sigma1(e)
+	ror	x7,x27,#28
+	add	x26,x26,x17			// h+=Ch(e,f,g)
+	eor	x17,x27,x27,ror#5
+	add	x26,x26,x16			// h+=Sigma1(e)
+	and	x19,x19,x28			// (b^c)&=(a^b)
+	add	x22,x22,x26			// d+=h
+	eor	x19,x19,x20			// Maj(a,b,c)
+	eor	x17,x7,x17,ror#34	// Sigma0(a)
+	add	x26,x26,x19			// h+=Maj(a,b,c)
+	ldr	x19,[x30],#8		// *K++, x28 in next round
+	//add	x26,x26,x17			// h+=Sigma0(a)
+#ifndef	__ARMEB__
+	rev	x5,x5			// 2
+#endif
+	add	x26,x26,x17			// h+=Sigma0(a)
+	ror	x16,x22,#14
+	add	x25,x25,x19			// h+=K[i]
+	eor	x8,x22,x22,ror#23
+	and	x17,x23,x22
+	bic	x19,x24,x22
+	add	x25,x25,x5			// h+=X[i]
+	orr	x17,x17,x19			// Ch(e,f,g)
+	eor	x19,x26,x27			// a^b, b^c in next round
+	eor	x16,x16,x8,ror#18	// Sigma1(e)
+	ror	x8,x26,#28
+	add	x25,x25,x17			// h+=Ch(e,f,g)
+	eor	x17,x26,x26,ror#5
+	add	x25,x25,x16			// h+=Sigma1(e)
+	and	x28,x28,x19			// (b^c)&=(a^b)
+	add	x21,x21,x25			// d+=h
+	eor	x28,x28,x27			// Maj(a,b,c)
+	eor	x17,x8,x17,ror#34	// Sigma0(a)
+	add	x25,x25,x28			// h+=Maj(a,b,c)
+	ldr	x28,[x30],#8		// *K++, x19 in next round
+	//add	x25,x25,x17			// h+=Sigma0(a)
+#ifndef	__ARMEB__
+	rev	x6,x6			// 3
+#endif
+	ldp	x7,x8,[x1],#2*8
+	add	x25,x25,x17			// h+=Sigma0(a)
+	ror	x16,x21,#14
+	add	x24,x24,x28			// h+=K[i]
+	eor	x9,x21,x21,ror#23
+	and	x17,x22,x21
+	bic	x28,x23,x21
+	add	x24,x24,x6			// h+=X[i]
+	orr	x17,x17,x28			// Ch(e,f,g)
+	eor	x28,x25,x26			// a^b, b^c in next round
+	eor	x16,x16,x9,ror#18	// Sigma1(e)
+	ror	x9,x25,#28
+	add	x24,x24,x17			// h+=Ch(e,f,g)
+	eor	x17,x25,x25,ror#5
+	add	x24,x24,x16			// h+=Sigma1(e)
+	and	x19,x19,x28			// (b^c)&=(a^b)
+	add	x20,x20,x24			// d+=h
+	eor	x19,x19,x26			// Maj(a,b,c)
+	eor	x17,x9,x17,ror#34	// Sigma0(a)
+	add	x24,x24,x19			// h+=Maj(a,b,c)
+	ldr	x19,[x30],#8		// *K++, x28 in next round
+	//add	x24,x24,x17			// h+=Sigma0(a)
+#ifndef	__ARMEB__
+	rev	x7,x7			// 4
+#endif
+	add	x24,x24,x17			// h+=Sigma0(a)
+	ror	x16,x20,#14
+	add	x23,x23,x19			// h+=K[i]
+	eor	x10,x20,x20,ror#23
+	and	x17,x21,x20
+	bic	x19,x22,x20
+	add	x23,x23,x7			// h+=X[i]
+	orr	x17,x17,x19			// Ch(e,f,g)
+	eor	x19,x24,x25			// a^b, b^c in next round
+	eor	x16,x16,x10,ror#18	// Sigma1(e)
+	ror	x10,x24,#28
+	add	x23,x23,x17			// h+=Ch(e,f,g)
+	eor	x17,x24,x24,ror#5
+	add	x23,x23,x16			// h+=Sigma1(e)
+	and	x28,x28,x19			// (b^c)&=(a^b)
+	add	x27,x27,x23			// d+=h
+	eor	x28,x28,x25			// Maj(a,b,c)
+	eor	x17,x10,x17,ror#34	// Sigma0(a)
+	add	x23,x23,x28			// h+=Maj(a,b,c)
+	ldr	x28,[x30],#8		// *K++, x19 in next round
+	//add	x23,x23,x17			// h+=Sigma0(a)
+#ifndef	__ARMEB__
+	rev	x8,x8			// 5
+#endif
+	ldp	x9,x10,[x1],#2*8
+	add	x23,x23,x17			// h+=Sigma0(a)
+	ror	x16,x27,#14
+	add	x22,x22,x28			// h+=K[i]
+	eor	x11,x27,x27,ror#23
+	and	x17,x20,x27
+	bic	x28,x21,x27
+	add	x22,x22,x8			// h+=X[i]
+	orr	x17,x17,x28			// Ch(e,f,g)
+	eor	x28,x23,x24			// a^b, b^c in next round
+	eor	x16,x16,x11,ror#18	// Sigma1(e)
+	ror	x11,x23,#28
+	add	x22,x22,x17			// h+=Ch(e,f,g)
+	eor	x17,x23,x23,ror#5
+	add	x22,x22,x16			// h+=Sigma1(e)
+	and	x19,x19,x28			// (b^c)&=(a^b)
+	add	x26,x26,x22			// d+=h
+	eor	x19,x19,x24			// Maj(a,b,c)
+	eor	x17,x11,x17,ror#34	// Sigma0(a)
+	add	x22,x22,x19			// h+=Maj(a,b,c)
+	ldr	x19,[x30],#8		// *K++, x28 in next round
+	//add	x22,x22,x17			// h+=Sigma0(a)
+#ifndef	__ARMEB__
+	rev	x9,x9			// 6
+#endif
+	add	x22,x22,x17			// h+=Sigma0(a)
+	ror	x16,x26,#14
+	add	x21,x21,x19			// h+=K[i]
+	eor	x12,x26,x26,ror#23
+	and	x17,x27,x26
+	bic	x19,x20,x26
+	add	x21,x21,x9			// h+=X[i]
+	orr	x17,x17,x19			// Ch(e,f,g)
+	eor	x19,x22,x23			// a^b, b^c in next round
+	eor	x16,x16,x12,ror#18	// Sigma1(e)
+	ror	x12,x22,#28
+	add	x21,x21,x17			// h+=Ch(e,f,g)
+	eor	x17,x22,x22,ror#5
+	add	x21,x21,x16			// h+=Sigma1(e)
+	and	x28,x28,x19			// (b^c)&=(a^b)
+	add	x25,x25,x21			// d+=h
+	eor	x28,x28,x23			// Maj(a,b,c)
+	eor	x17,x12,x17,ror#34	// Sigma0(a)
+	add	x21,x21,x28			// h+=Maj(a,b,c)
+	ldr	x28,[x30],#8		// *K++, x19 in next round
+	//add	x21,x21,x17			// h+=Sigma0(a)
+#ifndef	__ARMEB__
+	rev	x10,x10			// 7
+#endif
+	ldp	x11,x12,[x1],#2*8
+	add	x21,x21,x17			// h+=Sigma0(a)
+	ror	x16,x25,#14
+	add	x20,x20,x28			// h+=K[i]
+	eor	x13,x25,x25,ror#23
+	and	x17,x26,x25
+	bic	x28,x27,x25
+	add	x20,x20,x10			// h+=X[i]
+	orr	x17,x17,x28			// Ch(e,f,g)
+	eor	x28,x21,x22			// a^b, b^c in next round
+	eor	x16,x16,x13,ror#18	// Sigma1(e)
+	ror	x13,x21,#28
+	add	x20,x20,x17			// h+=Ch(e,f,g)
+	eor	x17,x21,x21,ror#5
+	add	x20,x20,x16			// h+=Sigma1(e)
+	and	x19,x19,x28			// (b^c)&=(a^b)
+	add	x24,x24,x20			// d+=h
+	eor	x19,x19,x22			// Maj(a,b,c)
+	eor	x17,x13,x17,ror#34	// Sigma0(a)
+	add	x20,x20,x19			// h+=Maj(a,b,c)
+	ldr	x19,[x30],#8		// *K++, x28 in next round
+	//add	x20,x20,x17			// h+=Sigma0(a)
+#ifndef	__ARMEB__
+	rev	x11,x11			// 8
+#endif
+	add	x20,x20,x17			// h+=Sigma0(a)
+	ror	x16,x24,#14
+	add	x27,x27,x19			// h+=K[i]
+	eor	x14,x24,x24,ror#23
+	and	x17,x25,x24
+	bic	x19,x26,x24
+	add	x27,x27,x11			// h+=X[i]
+	orr	x17,x17,x19			// Ch(e,f,g)
+	eor	x19,x20,x21			// a^b, b^c in next round
+	eor	x16,x16,x14,ror#18	// Sigma1(e)
+	ror	x14,x20,#28
+	add	x27,x27,x17			// h+=Ch(e,f,g)
+	eor	x17,x20,x20,ror#5
+	add	x27,x27,x16			// h+=Sigma1(e)
+	and	x28,x28,x19			// (b^c)&=(a^b)
+	add	x23,x23,x27			// d+=h
+	eor	x28,x28,x21			// Maj(a,b,c)
+	eor	x17,x14,x17,ror#34	// Sigma0(a)
+	add	x27,x27,x28			// h+=Maj(a,b,c)
+	ldr	x28,[x30],#8		// *K++, x19 in next round
+	//add	x27,x27,x17			// h+=Sigma0(a)
+#ifndef	__ARMEB__
+	rev	x12,x12			// 9
+#endif
+	ldp	x13,x14,[x1],#2*8
+	add	x27,x27,x17			// h+=Sigma0(a)
+	ror	x16,x23,#14
+	add	x26,x26,x28			// h+=K[i]
+	eor	x15,x23,x23,ror#23
+	and	x17,x24,x23
+	bic	x28,x25,x23
+	add	x26,x26,x12			// h+=X[i]
+	orr	x17,x17,x28			// Ch(e,f,g)
+	eor	x28,x27,x20			// a^b, b^c in next round
+	eor	x16,x16,x15,ror#18	// Sigma1(e)
+	ror	x15,x27,#28
+	add	x26,x26,x17			// h+=Ch(e,f,g)
+	eor	x17,x27,x27,ror#5
+	add	x26,x26,x16			// h+=Sigma1(e)
+	and	x19,x19,x28			// (b^c)&=(a^b)
+	add	x22,x22,x26			// d+=h
+	eor	x19,x19,x20			// Maj(a,b,c)
+	eor	x17,x15,x17,ror#34	// Sigma0(a)
+	add	x26,x26,x19			// h+=Maj(a,b,c)
+	ldr	x19,[x30],#8		// *K++, x28 in next round
+	//add	x26,x26,x17			// h+=Sigma0(a)
+#ifndef	__ARMEB__
+	rev	x13,x13			// 10
+#endif
+	add	x26,x26,x17			// h+=Sigma0(a)
+	ror	x16,x22,#14
+	add	x25,x25,x19			// h+=K[i]
+	eor	x0,x22,x22,ror#23
+	and	x17,x23,x22
+	bic	x19,x24,x22
+	add	x25,x25,x13			// h+=X[i]
+	orr	x17,x17,x19			// Ch(e,f,g)
+	eor	x19,x26,x27			// a^b, b^c in next round
+	eor	x16,x16,x0,ror#18	// Sigma1(e)
+	ror	x0,x26,#28
+	add	x25,x25,x17			// h+=Ch(e,f,g)
+	eor	x17,x26,x26,ror#5
+	add	x25,x25,x16			// h+=Sigma1(e)
+	and	x28,x28,x19			// (b^c)&=(a^b)
+	add	x21,x21,x25			// d+=h
+	eor	x28,x28,x27			// Maj(a,b,c)
+	eor	x17,x0,x17,ror#34	// Sigma0(a)
+	add	x25,x25,x28			// h+=Maj(a,b,c)
+	ldr	x28,[x30],#8		// *K++, x19 in next round
+	//add	x25,x25,x17			// h+=Sigma0(a)
+#ifndef	__ARMEB__
+	rev	x14,x14			// 11
+#endif
+	ldp	x15,x0,[x1],#2*8
+	add	x25,x25,x17			// h+=Sigma0(a)
+	str	x6,[sp,#24]
+	ror	x16,x21,#14
+	add	x24,x24,x28			// h+=K[i]
+	eor	x6,x21,x21,ror#23
+	and	x17,x22,x21
+	bic	x28,x23,x21
+	add	x24,x24,x14			// h+=X[i]
+	orr	x17,x17,x28			// Ch(e,f,g)
+	eor	x28,x25,x26			// a^b, b^c in next round
+	eor	x16,x16,x6,ror#18	// Sigma1(e)
+	ror	x6,x25,#28
+	add	x24,x24,x17			// h+=Ch(e,f,g)
+	eor	x17,x25,x25,ror#5
+	add	x24,x24,x16			// h+=Sigma1(e)
+	and	x19,x19,x28			// (b^c)&=(a^b)
+	add	x20,x20,x24			// d+=h
+	eor	x19,x19,x26			// Maj(a,b,c)
+	eor	x17,x6,x17,ror#34	// Sigma0(a)
+	add	x24,x24,x19			// h+=Maj(a,b,c)
+	ldr	x19,[x30],#8		// *K++, x28 in next round
+	//add	x24,x24,x17			// h+=Sigma0(a)
+#ifndef	__ARMEB__
+	rev	x15,x15			// 12
+#endif
+	add	x24,x24,x17			// h+=Sigma0(a)
+	str	x7,[sp,#0]
+	ror	x16,x20,#14
+	add	x23,x23,x19			// h+=K[i]
+	eor	x7,x20,x20,ror#23
+	and	x17,x21,x20
+	bic	x19,x22,x20
+	add	x23,x23,x15			// h+=X[i]
+	orr	x17,x17,x19			// Ch(e,f,g)
+	eor	x19,x24,x25			// a^b, b^c in next round
+	eor	x16,x16,x7,ror#18	// Sigma1(e)
+	ror	x7,x24,#28
+	add	x23,x23,x17			// h+=Ch(e,f,g)
+	eor	x17,x24,x24,ror#5
+	add	x23,x23,x16			// h+=Sigma1(e)
+	and	x28,x28,x19			// (b^c)&=(a^b)
+	add	x27,x27,x23			// d+=h
+	eor	x28,x28,x25			// Maj(a,b,c)
+	eor	x17,x7,x17,ror#34	// Sigma0(a)
+	add	x23,x23,x28			// h+=Maj(a,b,c)
+	ldr	x28,[x30],#8		// *K++, x19 in next round
+	//add	x23,x23,x17			// h+=Sigma0(a)
+#ifndef	__ARMEB__
+	rev	x0,x0			// 13
+#endif
+	ldp	x1,x2,[x1]
+	add	x23,x23,x17			// h+=Sigma0(a)
+	str	x8,[sp,#8]
+	ror	x16,x27,#14
+	add	x22,x22,x28			// h+=K[i]
+	eor	x8,x27,x27,ror#23
+	and	x17,x20,x27
+	bic	x28,x21,x27
+	add	x22,x22,x0			// h+=X[i]
+	orr	x17,x17,x28			// Ch(e,f,g)
+	eor	x28,x23,x24			// a^b, b^c in next round
+	eor	x16,x16,x8,ror#18	// Sigma1(e)
+	ror	x8,x23,#28
+	add	x22,x22,x17			// h+=Ch(e,f,g)
+	eor	x17,x23,x23,ror#5
+	add	x22,x22,x16			// h+=Sigma1(e)
+	and	x19,x19,x28			// (b^c)&=(a^b)
+	add	x26,x26,x22			// d+=h
+	eor	x19,x19,x24			// Maj(a,b,c)
+	eor	x17,x8,x17,ror#34	// Sigma0(a)
+	add	x22,x22,x19			// h+=Maj(a,b,c)
+	ldr	x19,[x30],#8		// *K++, x28 in next round
+	//add	x22,x22,x17			// h+=Sigma0(a)
+#ifndef	__ARMEB__
+	rev	x1,x1			// 14
+#endif
+	ldr	x6,[sp,#24]
+	add	x22,x22,x17			// h+=Sigma0(a)
+	str	x9,[sp,#16]
+	ror	x16,x26,#14
+	add	x21,x21,x19			// h+=K[i]
+	eor	x9,x26,x26,ror#23
+	and	x17,x27,x26
+	bic	x19,x20,x26
+	add	x21,x21,x1			// h+=X[i]
+	orr	x17,x17,x19			// Ch(e,f,g)
+	eor	x19,x22,x23			// a^b, b^c in next round
+	eor	x16,x16,x9,ror#18	// Sigma1(e)
+	ror	x9,x22,#28
+	add	x21,x21,x17			// h+=Ch(e,f,g)
+	eor	x17,x22,x22,ror#5
+	add	x21,x21,x16			// h+=Sigma1(e)
+	and	x28,x28,x19			// (b^c)&=(a^b)
+	add	x25,x25,x21			// d+=h
+	eor	x28,x28,x23			// Maj(a,b,c)
+	eor	x17,x9,x17,ror#34	// Sigma0(a)
+	add	x21,x21,x28			// h+=Maj(a,b,c)
+	ldr	x28,[x30],#8		// *K++, x19 in next round
+	//add	x21,x21,x17			// h+=Sigma0(a)
+#ifndef	__ARMEB__
+	rev	x2,x2			// 15
+#endif
+	ldr	x7,[sp,#0]
+	add	x21,x21,x17			// h+=Sigma0(a)
+	str	x10,[sp,#24]
+	ror	x16,x25,#14
+	add	x20,x20,x28			// h+=K[i]
+	ror	x9,x4,#1
+	and	x17,x26,x25
+	ror	x8,x1,#19
+	bic	x28,x27,x25
+	ror	x10,x21,#28
+	add	x20,x20,x2			// h+=X[i]
+	eor	x16,x16,x25,ror#18
+	eor	x9,x9,x4,ror#8
+	orr	x17,x17,x28			// Ch(e,f,g)
+	eor	x28,x21,x22			// a^b, b^c in next round
+	eor	x16,x16,x25,ror#41	// Sigma1(e)
+	eor	x10,x10,x21,ror#34
+	add	x20,x20,x17			// h+=Ch(e,f,g)
+	and	x19,x19,x28			// (b^c)&=(a^b)
+	eor	x8,x8,x1,ror#61
+	eor	x9,x9,x4,lsr#7	// sigma0(X[i+1])
+	add	x20,x20,x16			// h+=Sigma1(e)
+	eor	x19,x19,x22			// Maj(a,b,c)
+	eor	x17,x10,x21,ror#39	// Sigma0(a)
+	eor	x8,x8,x1,lsr#6	// sigma1(X[i+14])
+	add	x3,x3,x12
+	add	x24,x24,x20			// d+=h
+	add	x20,x20,x19			// h+=Maj(a,b,c)
+	ldr	x19,[x30],#8		// *K++, x28 in next round
+	add	x3,x3,x9
+	add	x20,x20,x17			// h+=Sigma0(a)
+	add	x3,x3,x8
+.Loop_16_xx:
+	ldr	x8,[sp,#8]
+	str	x11,[sp,#0]
+	ror	x16,x24,#14
+	add	x27,x27,x19			// h+=K[i]
+	ror	x10,x5,#1
+	and	x17,x25,x24
+	ror	x9,x2,#19
+	bic	x19,x26,x24
+	ror	x11,x20,#28
+	add	x27,x27,x3			// h+=X[i]
+	eor	x16,x16,x24,ror#18
+	eor	x10,x10,x5,ror#8
+	orr	x17,x17,x19			// Ch(e,f,g)
+	eor	x19,x20,x21			// a^b, b^c in next round
+	eor	x16,x16,x24,ror#41	// Sigma1(e)
+	eor	x11,x11,x20,ror#34
+	add	x27,x27,x17			// h+=Ch(e,f,g)
+	and	x28,x28,x19			// (b^c)&=(a^b)
+	eor	x9,x9,x2,ror#61
+	eor	x10,x10,x5,lsr#7	// sigma0(X[i+1])
+	add	x27,x27,x16			// h+=Sigma1(e)
+	eor	x28,x28,x21			// Maj(a,b,c)
+	eor	x17,x11,x20,ror#39	// Sigma0(a)
+	eor	x9,x9,x2,lsr#6	// sigma1(X[i+14])
+	add	x4,x4,x13
+	add	x23,x23,x27			// d+=h
+	add	x27,x27,x28			// h+=Maj(a,b,c)
+	ldr	x28,[x30],#8		// *K++, x19 in next round
+	add	x4,x4,x10
+	add	x27,x27,x17			// h+=Sigma0(a)
+	add	x4,x4,x9
+	ldr	x9,[sp,#16]
+	str	x12,[sp,#8]
+	ror	x16,x23,#14
+	add	x26,x26,x28			// h+=K[i]
+	ror	x11,x6,#1
+	and	x17,x24,x23
+	ror	x10,x3,#19
+	bic	x28,x25,x23
+	ror	x12,x27,#28
+	add	x26,x26,x4			// h+=X[i]
+	eor	x16,x16,x23,ror#18
+	eor	x11,x11,x6,ror#8
+	orr	x17,x17,x28			// Ch(e,f,g)
+	eor	x28,x27,x20			// a^b, b^c in next round
+	eor	x16,x16,x23,ror#41	// Sigma1(e)
+	eor	x12,x12,x27,ror#34
+	add	x26,x26,x17			// h+=Ch(e,f,g)
+	and	x19,x19,x28			// (b^c)&=(a^b)
+	eor	x10,x10,x3,ror#61
+	eor	x11,x11,x6,lsr#7	// sigma0(X[i+1])
+	add	x26,x26,x16			// h+=Sigma1(e)
+	eor	x19,x19,x20			// Maj(a,b,c)
+	eor	x17,x12,x27,ror#39	// Sigma0(a)
+	eor	x10,x10,x3,lsr#6	// sigma1(X[i+14])
+	add	x5,x5,x14
+	add	x22,x22,x26			// d+=h
+	add	x26,x26,x19			// h+=Maj(a,b,c)
+	ldr	x19,[x30],#8		// *K++, x28 in next round
+	add	x5,x5,x11
+	add	x26,x26,x17			// h+=Sigma0(a)
+	add	x5,x5,x10
+	ldr	x10,[sp,#24]
+	str	x13,[sp,#16]
+	ror	x16,x22,#14
+	add	x25,x25,x19			// h+=K[i]
+	ror	x12,x7,#1
+	and	x17,x23,x22
+	ror	x11,x4,#19
+	bic	x19,x24,x22
+	ror	x13,x26,#28
+	add	x25,x25,x5			// h+=X[i]
+	eor	x16,x16,x22,ror#18
+	eor	x12,x12,x7,ror#8
+	orr	x17,x17,x19			// Ch(e,f,g)
+	eor	x19,x26,x27			// a^b, b^c in next round
+	eor	x16,x16,x22,ror#41	// Sigma1(e)
+	eor	x13,x13,x26,ror#34
+	add	x25,x25,x17			// h+=Ch(e,f,g)
+	and	x28,x28,x19			// (b^c)&=(a^b)
+	eor	x11,x11,x4,ror#61
+	eor	x12,x12,x7,lsr#7	// sigma0(X[i+1])
+	add	x25,x25,x16			// h+=Sigma1(e)
+	eor	x28,x28,x27			// Maj(a,b,c)
+	eor	x17,x13,x26,ror#39	// Sigma0(a)
+	eor	x11,x11,x4,lsr#6	// sigma1(X[i+14])
+	add	x6,x6,x15
+	add	x21,x21,x25			// d+=h
+	add	x25,x25,x28			// h+=Maj(a,b,c)
+	ldr	x28,[x30],#8		// *K++, x19 in next round
+	add	x6,x6,x12
+	add	x25,x25,x17			// h+=Sigma0(a)
+	add	x6,x6,x11
+	ldr	x11,[sp,#0]
+	str	x14,[sp,#24]
+	ror	x16,x21,#14
+	add	x24,x24,x28			// h+=K[i]
+	ror	x13,x8,#1
+	and	x17,x22,x21
+	ror	x12,x5,#19
+	bic	x28,x23,x21
+	ror	x14,x25,#28
+	add	x24,x24,x6			// h+=X[i]
+	eor	x16,x16,x21,ror#18
+	eor	x13,x13,x8,ror#8
+	orr	x17,x17,x28			// Ch(e,f,g)
+	eor	x28,x25,x26			// a^b, b^c in next round
+	eor	x16,x16,x21,ror#41	// Sigma1(e)
+	eor	x14,x14,x25,ror#34
+	add	x24,x24,x17			// h+=Ch(e,f,g)
+	and	x19,x19,x28			// (b^c)&=(a^b)
+	eor	x12,x12,x5,ror#61
+	eor	x13,x13,x8,lsr#7	// sigma0(X[i+1])
+	add	x24,x24,x16			// h+=Sigma1(e)
+	eor	x19,x19,x26			// Maj(a,b,c)
+	eor	x17,x14,x25,ror#39	// Sigma0(a)
+	eor	x12,x12,x5,lsr#6	// sigma1(X[i+14])
+	add	x7,x7,x0
+	add	x20,x20,x24			// d+=h
+	add	x24,x24,x19			// h+=Maj(a,b,c)
+	ldr	x19,[x30],#8		// *K++, x28 in next round
+	add	x7,x7,x13
+	add	x24,x24,x17			// h+=Sigma0(a)
+	add	x7,x7,x12
+	ldr	x12,[sp,#8]
+	str	x15,[sp,#0]
+	ror	x16,x20,#14
+	add	x23,x23,x19			// h+=K[i]
+	ror	x14,x9,#1
+	and	x17,x21,x20
+	ror	x13,x6,#19
+	bic	x19,x22,x20
+	ror	x15,x24,#28
+	add	x23,x23,x7			// h+=X[i]
+	eor	x16,x16,x20,ror#18
+	eor	x14,x14,x9,ror#8
+	orr	x17,x17,x19			// Ch(e,f,g)
+	eor	x19,x24,x25			// a^b, b^c in next round
+	eor	x16,x16,x20,ror#41	// Sigma1(e)
+	eor	x15,x15,x24,ror#34
+	add	x23,x23,x17			// h+=Ch(e,f,g)
+	and	x28,x28,x19			// (b^c)&=(a^b)
+	eor	x13,x13,x6,ror#61
+	eor	x14,x14,x9,lsr#7	// sigma0(X[i+1])
+	add	x23,x23,x16			// h+=Sigma1(e)
+	eor	x28,x28,x25			// Maj(a,b,c)
+	eor	x17,x15,x24,ror#39	// Sigma0(a)
+	eor	x13,x13,x6,lsr#6	// sigma1(X[i+14])
+	add	x8,x8,x1
+	add	x27,x27,x23			// d+=h
+	add	x23,x23,x28			// h+=Maj(a,b,c)
+	ldr	x28,[x30],#8		// *K++, x19 in next round
+	add	x8,x8,x14
+	add	x23,x23,x17			// h+=Sigma0(a)
+	add	x8,x8,x13
+	ldr	x13,[sp,#16]
+	str	x0,[sp,#8]
+	ror	x16,x27,#14
+	add	x22,x22,x28			// h+=K[i]
+	ror	x15,x10,#1
+	and	x17,x20,x27
+	ror	x14,x7,#19
+	bic	x28,x21,x27
+	ror	x0,x23,#28
+	add	x22,x22,x8			// h+=X[i]
+	eor	x16,x16,x27,ror#18
+	eor	x15,x15,x10,ror#8
+	orr	x17,x17,x28			// Ch(e,f,g)
+	eor	x28,x23,x24			// a^b, b^c in next round
+	eor	x16,x16,x27,ror#41	// Sigma1(e)
+	eor	x0,x0,x23,ror#34
+	add	x22,x22,x17			// h+=Ch(e,f,g)
+	and	x19,x19,x28			// (b^c)&=(a^b)
+	eor	x14,x14,x7,ror#61
+	eor	x15,x15,x10,lsr#7	// sigma0(X[i+1])
+	add	x22,x22,x16			// h+=Sigma1(e)
+	eor	x19,x19,x24			// Maj(a,b,c)
+	eor	x17,x0,x23,ror#39	// Sigma0(a)
+	eor	x14,x14,x7,lsr#6	// sigma1(X[i+14])
+	add	x9,x9,x2
+	add	x26,x26,x22			// d+=h
+	add	x22,x22,x19			// h+=Maj(a,b,c)
+	ldr	x19,[x30],#8		// *K++, x28 in next round
+	add	x9,x9,x15
+	add	x22,x22,x17			// h+=Sigma0(a)
+	add	x9,x9,x14
+	ldr	x14,[sp,#24]
+	str	x1,[sp,#16]
+	ror	x16,x26,#14
+	add	x21,x21,x19			// h+=K[i]
+	ror	x0,x11,#1
+	and	x17,x27,x26
+	ror	x15,x8,#19
+	bic	x19,x20,x26
+	ror	x1,x22,#28
+	add	x21,x21,x9			// h+=X[i]
+	eor	x16,x16,x26,ror#18
+	eor	x0,x0,x11,ror#8
+	orr	x17,x17,x19			// Ch(e,f,g)
+	eor	x19,x22,x23			// a^b, b^c in next round
+	eor	x16,x16,x26,ror#41	// Sigma1(e)
+	eor	x1,x1,x22,ror#34
+	add	x21,x21,x17			// h+=Ch(e,f,g)
+	and	x28,x28,x19			// (b^c)&=(a^b)
+	eor	x15,x15,x8,ror#61
+	eor	x0,x0,x11,lsr#7	// sigma0(X[i+1])
+	add	x21,x21,x16			// h+=Sigma1(e)
+	eor	x28,x28,x23			// Maj(a,b,c)
+	eor	x17,x1,x22,ror#39	// Sigma0(a)
+	eor	x15,x15,x8,lsr#6	// sigma1(X[i+14])
+	add	x10,x10,x3
+	add	x25,x25,x21			// d+=h
+	add	x21,x21,x28			// h+=Maj(a,b,c)
+	ldr	x28,[x30],#8		// *K++, x19 in next round
+	add	x10,x10,x0
+	add	x21,x21,x17			// h+=Sigma0(a)
+	add	x10,x10,x15
+	ldr	x15,[sp,#0]
+	str	x2,[sp,#24]
+	ror	x16,x25,#14
+	add	x20,x20,x28			// h+=K[i]
+	ror	x1,x12,#1
+	and	x17,x26,x25
+	ror	x0,x9,#19
+	bic	x28,x27,x25
+	ror	x2,x21,#28
+	add	x20,x20,x10			// h+=X[i]
+	eor	x16,x16,x25,ror#18
+	eor	x1,x1,x12,ror#8
+	orr	x17,x17,x28			// Ch(e,f,g)
+	eor	x28,x21,x22			// a^b, b^c in next round
+	eor	x16,x16,x25,ror#41	// Sigma1(e)
+	eor	x2,x2,x21,ror#34
+	add	x20,x20,x17			// h+=Ch(e,f,g)
+	and	x19,x19,x28			// (b^c)&=(a^b)
+	eor	x0,x0,x9,ror#61
+	eor	x1,x1,x12,lsr#7	// sigma0(X[i+1])
+	add	x20,x20,x16			// h+=Sigma1(e)
+	eor	x19,x19,x22			// Maj(a,b,c)
+	eor	x17,x2,x21,ror#39	// Sigma0(a)
+	eor	x0,x0,x9,lsr#6	// sigma1(X[i+14])
+	add	x11,x11,x4
+	add	x24,x24,x20			// d+=h
+	add	x20,x20,x19			// h+=Maj(a,b,c)
+	ldr	x19,[x30],#8		// *K++, x28 in next round
+	add	x11,x11,x1
+	add	x20,x20,x17			// h+=Sigma0(a)
+	add	x11,x11,x0
+	ldr	x0,[sp,#8]
+	str	x3,[sp,#0]
+	ror	x16,x24,#14
+	add	x27,x27,x19			// h+=K[i]
+	ror	x2,x13,#1
+	and	x17,x25,x24
+	ror	x1,x10,#19
+	bic	x19,x26,x24
+	ror	x3,x20,#28
+	add	x27,x27,x11			// h+=X[i]
+	eor	x16,x16,x24,ror#18
+	eor	x2,x2,x13,ror#8
+	orr	x17,x17,x19			// Ch(e,f,g)
+	eor	x19,x20,x21			// a^b, b^c in next round
+	eor	x16,x16,x24,ror#41	// Sigma1(e)
+	eor	x3,x3,x20,ror#34
+	add	x27,x27,x17			// h+=Ch(e,f,g)
+	and	x28,x28,x19			// (b^c)&=(a^b)
+	eor	x1,x1,x10,ror#61
+	eor	x2,x2,x13,lsr#7	// sigma0(X[i+1])
+	add	x27,x27,x16			// h+=Sigma1(e)
+	eor	x28,x28,x21			// Maj(a,b,c)
+	eor	x17,x3,x20,ror#39	// Sigma0(a)
+	eor	x1,x1,x10,lsr#6	// sigma1(X[i+14])
+	add	x12,x12,x5
+	add	x23,x23,x27			// d+=h
+	add	x27,x27,x28			// h+=Maj(a,b,c)
+	ldr	x28,[x30],#8		// *K++, x19 in next round
+	add	x12,x12,x2
+	add	x27,x27,x17			// h+=Sigma0(a)
+	add	x12,x12,x1
+	ldr	x1,[sp,#16]
+	str	x4,[sp,#8]
+	ror	x16,x23,#14
+	add	x26,x26,x28			// h+=K[i]
+	ror	x3,x14,#1
+	and	x17,x24,x23
+	ror	x2,x11,#19
+	bic	x28,x25,x23
+	ror	x4,x27,#28
+	add	x26,x26,x12			// h+=X[i]
+	eor	x16,x16,x23,ror#18
+	eor	x3,x3,x14,ror#8
+	orr	x17,x17,x28			// Ch(e,f,g)
+	eor	x28,x27,x20			// a^b, b^c in next round
+	eor	x16,x16,x23,ror#41	// Sigma1(e)
+	eor	x4,x4,x27,ror#34
+	add	x26,x26,x17			// h+=Ch(e,f,g)
+	and	x19,x19,x28			// (b^c)&=(a^b)
+	eor	x2,x2,x11,ror#61
+	eor	x3,x3,x14,lsr#7	// sigma0(X[i+1])
+	add	x26,x26,x16			// h+=Sigma1(e)
+	eor	x19,x19,x20			// Maj(a,b,c)
+	eor	x17,x4,x27,ror#39	// Sigma0(a)
+	eor	x2,x2,x11,lsr#6	// sigma1(X[i+14])
+	add	x13,x13,x6
+	add	x22,x22,x26			// d+=h
+	add	x26,x26,x19			// h+=Maj(a,b,c)
+	ldr	x19,[x30],#8		// *K++, x28 in next round
+	add	x13,x13,x3
+	add	x26,x26,x17			// h+=Sigma0(a)
+	add	x13,x13,x2
+	ldr	x2,[sp,#24]
+	str	x5,[sp,#16]
+	ror	x16,x22,#14
+	add	x25,x25,x19			// h+=K[i]
+	ror	x4,x15,#1
+	and	x17,x23,x22
+	ror	x3,x12,#19
+	bic	x19,x24,x22
+	ror	x5,x26,#28
+	add	x25,x25,x13			// h+=X[i]
+	eor	x16,x16,x22,ror#18
+	eor	x4,x4,x15,ror#8
+	orr	x17,x17,x19			// Ch(e,f,g)
+	eor	x19,x26,x27			// a^b, b^c in next round
+	eor	x16,x16,x22,ror#41	// Sigma1(e)
+	eor	x5,x5,x26,ror#34
+	add	x25,x25,x17			// h+=Ch(e,f,g)
+	and	x28,x28,x19			// (b^c)&=(a^b)
+	eor	x3,x3,x12,ror#61
+	eor	x4,x4,x15,lsr#7	// sigma0(X[i+1])
+	add	x25,x25,x16			// h+=Sigma1(e)
+	eor	x28,x28,x27			// Maj(a,b,c)
+	eor	x17,x5,x26,ror#39	// Sigma0(a)
+	eor	x3,x3,x12,lsr#6	// sigma1(X[i+14])
+	add	x14,x14,x7
+	add	x21,x21,x25			// d+=h
+	add	x25,x25,x28			// h+=Maj(a,b,c)
+	ldr	x28,[x30],#8		// *K++, x19 in next round
+	add	x14,x14,x4
+	add	x25,x25,x17			// h+=Sigma0(a)
+	add	x14,x14,x3
+	ldr	x3,[sp,#0]
+	str	x6,[sp,#24]
+	ror	x16,x21,#14
+	add	x24,x24,x28			// h+=K[i]
+	ror	x5,x0,#1
+	and	x17,x22,x21
+	ror	x4,x13,#19
+	bic	x28,x23,x21
+	ror	x6,x25,#28
+	add	x24,x24,x14			// h+=X[i]
+	eor	x16,x16,x21,ror#18
+	eor	x5,x5,x0,ror#8
+	orr	x17,x17,x28			// Ch(e,f,g)
+	eor	x28,x25,x26			// a^b, b^c in next round
+	eor	x16,x16,x21,ror#41	// Sigma1(e)
+	eor	x6,x6,x25,ror#34
+	add	x24,x24,x17			// h+=Ch(e,f,g)
+	and	x19,x19,x28			// (b^c)&=(a^b)
+	eor	x4,x4,x13,ror#61
+	eor	x5,x5,x0,lsr#7	// sigma0(X[i+1])
+	add	x24,x24,x16			// h+=Sigma1(e)
+	eor	x19,x19,x26			// Maj(a,b,c)
+	eor	x17,x6,x25,ror#39	// Sigma0(a)
+	eor	x4,x4,x13,lsr#6	// sigma1(X[i+14])
+	add	x15,x15,x8
+	add	x20,x20,x24			// d+=h
+	add	x24,x24,x19			// h+=Maj(a,b,c)
+	ldr	x19,[x30],#8		// *K++, x28 in next round
+	add	x15,x15,x5
+	add	x24,x24,x17			// h+=Sigma0(a)
+	add	x15,x15,x4
+	ldr	x4,[sp,#8]
+	str	x7,[sp,#0]
+	ror	x16,x20,#14
+	add	x23,x23,x19			// h+=K[i]
+	ror	x6,x1,#1
+	and	x17,x21,x20
+	ror	x5,x14,#19
+	bic	x19,x22,x20
+	ror	x7,x24,#28
+	add	x23,x23,x15			// h+=X[i]
+	eor	x16,x16,x20,ror#18
+	eor	x6,x6,x1,ror#8
+	orr	x17,x17,x19			// Ch(e,f,g)
+	eor	x19,x24,x25			// a^b, b^c in next round
+	eor	x16,x16,x20,ror#41	// Sigma1(e)
+	eor	x7,x7,x24,ror#34
+	add	x23,x23,x17			// h+=Ch(e,f,g)
+	and	x28,x28,x19			// (b^c)&=(a^b)
+	eor	x5,x5,x14,ror#61
+	eor	x6,x6,x1,lsr#7	// sigma0(X[i+1])
+	add	x23,x23,x16			// h+=Sigma1(e)
+	eor	x28,x28,x25			// Maj(a,b,c)
+	eor	x17,x7,x24,ror#39	// Sigma0(a)
+	eor	x5,x5,x14,lsr#6	// sigma1(X[i+14])
+	add	x0,x0,x9
+	add	x27,x27,x23			// d+=h
+	add	x23,x23,x28			// h+=Maj(a,b,c)
+	ldr	x28,[x30],#8		// *K++, x19 in next round
+	add	x0,x0,x6
+	add	x23,x23,x17			// h+=Sigma0(a)
+	add	x0,x0,x5
+	ldr	x5,[sp,#16]
+	str	x8,[sp,#8]
+	ror	x16,x27,#14
+	add	x22,x22,x28			// h+=K[i]
+	ror	x7,x2,#1
+	and	x17,x20,x27
+	ror	x6,x15,#19
+	bic	x28,x21,x27
+	ror	x8,x23,#28
+	add	x22,x22,x0			// h+=X[i]
+	eor	x16,x16,x27,ror#18
+	eor	x7,x7,x2,ror#8
+	orr	x17,x17,x28			// Ch(e,f,g)
+	eor	x28,x23,x24			// a^b, b^c in next round
+	eor	x16,x16,x27,ror#41	// Sigma1(e)
+	eor	x8,x8,x23,ror#34
+	add	x22,x22,x17			// h+=Ch(e,f,g)
+	and	x19,x19,x28			// (b^c)&=(a^b)
+	eor	x6,x6,x15,ror#61
+	eor	x7,x7,x2,lsr#7	// sigma0(X[i+1])
+	add	x22,x22,x16			// h+=Sigma1(e)
+	eor	x19,x19,x24			// Maj(a,b,c)
+	eor	x17,x8,x23,ror#39	// Sigma0(a)
+	eor	x6,x6,x15,lsr#6	// sigma1(X[i+14])
+	add	x1,x1,x10
+	add	x26,x26,x22			// d+=h
+	add	x22,x22,x19			// h+=Maj(a,b,c)
+	ldr	x19,[x30],#8		// *K++, x28 in next round
+	add	x1,x1,x7
+	add	x22,x22,x17			// h+=Sigma0(a)
+	add	x1,x1,x6
+	ldr	x6,[sp,#24]
+	str	x9,[sp,#16]
+	ror	x16,x26,#14
+	add	x21,x21,x19			// h+=K[i]
+	ror	x8,x3,#1
+	and	x17,x27,x26
+	ror	x7,x0,#19
+	bic	x19,x20,x26
+	ror	x9,x22,#28
+	add	x21,x21,x1			// h+=X[i]
+	eor	x16,x16,x26,ror#18
+	eor	x8,x8,x3,ror#8
+	orr	x17,x17,x19			// Ch(e,f,g)
+	eor	x19,x22,x23			// a^b, b^c in next round
+	eor	x16,x16,x26,ror#41	// Sigma1(e)
+	eor	x9,x9,x22,ror#34
+	add	x21,x21,x17			// h+=Ch(e,f,g)
+	and	x28,x28,x19			// (b^c)&=(a^b)
+	eor	x7,x7,x0,ror#61
+	eor	x8,x8,x3,lsr#7	// sigma0(X[i+1])
+	add	x21,x21,x16			// h+=Sigma1(e)
+	eor	x28,x28,x23			// Maj(a,b,c)
+	eor	x17,x9,x22,ror#39	// Sigma0(a)
+	eor	x7,x7,x0,lsr#6	// sigma1(X[i+14])
+	add	x2,x2,x11
+	add	x25,x25,x21			// d+=h
+	add	x21,x21,x28			// h+=Maj(a,b,c)
+	ldr	x28,[x30],#8		// *K++, x19 in next round
+	add	x2,x2,x8
+	add	x21,x21,x17			// h+=Sigma0(a)
+	add	x2,x2,x7
+	ldr	x7,[sp,#0]
+	str	x10,[sp,#24]
+	ror	x16,x25,#14
+	add	x20,x20,x28			// h+=K[i]
+	ror	x9,x4,#1
+	and	x17,x26,x25
+	ror	x8,x1,#19
+	bic	x28,x27,x25
+	ror	x10,x21,#28
+	add	x20,x20,x2			// h+=X[i]
+	eor	x16,x16,x25,ror#18
+	eor	x9,x9,x4,ror#8
+	orr	x17,x17,x28			// Ch(e,f,g)
+	eor	x28,x21,x22			// a^b, b^c in next round
+	eor	x16,x16,x25,ror#41	// Sigma1(e)
+	eor	x10,x10,x21,ror#34
+	add	x20,x20,x17			// h+=Ch(e,f,g)
+	and	x19,x19,x28			// (b^c)&=(a^b)
+	eor	x8,x8,x1,ror#61
+	eor	x9,x9,x4,lsr#7	// sigma0(X[i+1])
+	add	x20,x20,x16			// h+=Sigma1(e)
+	eor	x19,x19,x22			// Maj(a,b,c)
+	eor	x17,x10,x21,ror#39	// Sigma0(a)
+	eor	x8,x8,x1,lsr#6	// sigma1(X[i+14])
+	add	x3,x3,x12
+	add	x24,x24,x20			// d+=h
+	add	x20,x20,x19			// h+=Maj(a,b,c)
+	ldr	x19,[x30],#8		// *K++, x28 in next round
+	add	x3,x3,x9
+	add	x20,x20,x17			// h+=Sigma0(a)
+	add	x3,x3,x8
+	cbnz	x19,.Loop_16_xx
+
+	ldp	x0,x2,[x29,#96]
+	ldr	x1,[x29,#112]
+	sub	x30,x30,#648		// rewind
+
+	ldp	x3,x4,[x0]
+	ldp	x5,x6,[x0,#2*8]
+	add	x1,x1,#14*8			// advance input pointer
+	ldp	x7,x8,[x0,#4*8]
+	add	x20,x20,x3
+	ldp	x9,x10,[x0,#6*8]
+	add	x21,x21,x4
+	add	x22,x22,x5
+	add	x23,x23,x6
+	stp	x20,x21,[x0]
+	add	x24,x24,x7
+	add	x25,x25,x8
+	stp	x22,x23,[x0,#2*8]
+	add	x26,x26,x9
+	add	x27,x27,x10
+	cmp	x1,x2
+	stp	x24,x25,[x0,#4*8]
+	stp	x26,x27,[x0,#6*8]
+	b.ne	.Loop
+
+	ldp	x19,x20,[x29,#16]
+	add	sp,sp,#4*8
+	ldp	x21,x22,[x29,#32]
+	ldp	x23,x24,[x29,#48]
+	ldp	x25,x26,[x29,#64]
+	ldp	x27,x28,[x29,#80]
+	ldp	x29,x30,[sp],#128
+	ret
+.size	sha512_block_data_order,.-sha512_block_data_order
+
+.align	6
+.type	.LK512,%object
+.LK512:
+.quad	0x428a2f98d728ae22,0x7137449123ef65cd
+.quad	0xb5c0fbcfec4d3b2f,0xe9b5dba58189dbbc
+.quad	0x3956c25bf348b538,0x59f111f1b605d019
+.quad	0x923f82a4af194f9b,0xab1c5ed5da6d8118
+.quad	0xd807aa98a3030242,0x12835b0145706fbe
+.quad	0x243185be4ee4b28c,0x550c7dc3d5ffb4e2
+.quad	0x72be5d74f27b896f,0x80deb1fe3b1696b1
+.quad	0x9bdc06a725c71235,0xc19bf174cf692694
+.quad	0xe49b69c19ef14ad2,0xefbe4786384f25e3
+.quad	0x0fc19dc68b8cd5b5,0x240ca1cc77ac9c65
+.quad	0x2de92c6f592b0275,0x4a7484aa6ea6e483
+.quad	0x5cb0a9dcbd41fbd4,0x76f988da831153b5
+.quad	0x983e5152ee66dfab,0xa831c66d2db43210
+.quad	0xb00327c898fb213f,0xbf597fc7beef0ee4
+.quad	0xc6e00bf33da88fc2,0xd5a79147930aa725
+.quad	0x06ca6351e003826f,0x142929670a0e6e70
+.quad	0x27b70a8546d22ffc,0x2e1b21385c26c926
+.quad	0x4d2c6dfc5ac42aed,0x53380d139d95b3df
+.quad	0x650a73548baf63de,0x766a0abb3c77b2a8
+.quad	0x81c2c92e47edaee6,0x92722c851482353b
+.quad	0xa2bfe8a14cf10364,0xa81a664bbc423001
+.quad	0xc24b8b70d0f89791,0xc76c51a30654be30
+.quad	0xd192e819d6ef5218,0xd69906245565a910
+.quad	0xf40e35855771202a,0x106aa07032bbd1b8
+.quad	0x19a4c116b8d2d0c8,0x1e376c085141ab53
+.quad	0x2748774cdf8eeb99,0x34b0bcb5e19b48a8
+.quad	0x391c0cb3c5c95a63,0x4ed8aa4ae3418acb
+.quad	0x5b9cca4f7763e373,0x682e6ff3d6b2b8a3
+.quad	0x748f82ee5defb2fc,0x78a5636f43172f60
+.quad	0x84c87814a1f0ab72,0x8cc702081a6439ec
+.quad	0x90befffa23631e28,0xa4506cebde82bde9
+.quad	0xbef9a3f7b2c67915,0xc67178f2e372532b
+.quad	0xca273eceea26619c,0xd186b8c721c0c207
+.quad	0xeada7dd6cde0eb1e,0xf57d4f7fee6ed178
+.quad	0x06f067aa72176fba,0x0a637dc5a2c898a6
+.quad	0x113f9804bef90dae,0x1b710b35131c471b
+.quad	0x28db77f523047d84,0x32caab7b40c72493
+.quad	0x3c9ebe0a15c9bebc,0x431d67c49c100d4c
+.quad	0x4cc5d4becb3e42b6,0x597f299cfc657e2a
+.quad	0x5fcb6fab3ad6faec,0x6c44198c4a475817
+.quad	0	// terminator
+.size	.LK512,.-.LK512
+.align	3
+.LOPENSSL_armcap_P:
+.quad	OPENSSL_armcap_P-.
+.byte	83,72,65,53,49,50,32,98,108,111,99,107,32,116,114,97,110,115,102,111,114,109,32,102,111,114,32,65,82,77,118,56,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0
+.align	2
+.align	2
+.comm	OPENSSL_armcap_P,4,4
+#endif
\ No newline at end of file
diff --git a/third_party/boringssl/linux-arm/crypto/aes/aes-armv4.S b/third_party/boringssl/linux-arm/crypto/aes/aes-armv4.S
new file mode 100644
index 0000000..cb94841
--- /dev/null
+++ b/third_party/boringssl/linux-arm/crypto/aes/aes-armv4.S
@@ -0,0 +1,1200 @@
+#if defined(__arm__)
+
+@ ====================================================================
+@ Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+@ project. The module is, however, dual licensed under OpenSSL and
+@ CRYPTOGAMS licenses depending on where you obtain it. For further
+@ details see http://www.openssl.org/~appro/cryptogams/.
+@ ====================================================================
+
+@ AES for ARMv4
+
+@ January 2007.
+@
+@ Code uses single 1K S-box and is >2 times faster than code generated
+@ by gcc-3.4.1. This is thanks to unique feature of ARMv4 ISA, which
+@ allows to merge logical or arithmetic operation with shift or rotate
+@ in one instruction and emit combined result every cycle. The module
+@ is endian-neutral. The performance is ~42 cycles/byte for 128-bit
+@ key [on single-issue Xscale PXA250 core].
+
+@ May 2007.
+@
+@ AES_set_[en|de]crypt_key is added.
+
+@ July 2010.
+@
+@ Rescheduling for dual-issue pipeline resulted in 12% improvement on
+@ Cortex A8 core and ~25 cycles per byte processed with 128-bit key.
+
+@ February 2011.
+@
+@ Profiler-assisted and platform-specific optimization resulted in 16%
+@ improvement on Cortex A8 core and ~21.5 cycles per byte.
+
+#if defined(__arm__)
+#ifndef __KERNEL__
+# include "arm_arch.h"
+#else
+# define __ARM_ARCH__ __LINUX_ARM_ARCH__
+#endif
+
+.text
+#if __ARM_ARCH__<7
+.code	32
+#else
+.syntax	unified
+# if defined(__thumb2__) && !defined(__APPLE__)
+.thumb
+# else
+.code	32
+# endif
+#endif
+
+.type	AES_Te,%object
+.align	5
+AES_Te:
+.word	0xc66363a5, 0xf87c7c84, 0xee777799, 0xf67b7b8d
+.word	0xfff2f20d, 0xd66b6bbd, 0xde6f6fb1, 0x91c5c554
+.word	0x60303050, 0x02010103, 0xce6767a9, 0x562b2b7d
+.word	0xe7fefe19, 0xb5d7d762, 0x4dababe6, 0xec76769a
+.word	0x8fcaca45, 0x1f82829d, 0x89c9c940, 0xfa7d7d87
+.word	0xeffafa15, 0xb25959eb, 0x8e4747c9, 0xfbf0f00b
+.word	0x41adadec, 0xb3d4d467, 0x5fa2a2fd, 0x45afafea
+.word	0x239c9cbf, 0x53a4a4f7, 0xe4727296, 0x9bc0c05b
+.word	0x75b7b7c2, 0xe1fdfd1c, 0x3d9393ae, 0x4c26266a
+.word	0x6c36365a, 0x7e3f3f41, 0xf5f7f702, 0x83cccc4f
+.word	0x6834345c, 0x51a5a5f4, 0xd1e5e534, 0xf9f1f108
+.word	0xe2717193, 0xabd8d873, 0x62313153, 0x2a15153f
+.word	0x0804040c, 0x95c7c752, 0x46232365, 0x9dc3c35e
+.word	0x30181828, 0x379696a1, 0x0a05050f, 0x2f9a9ab5
+.word	0x0e070709, 0x24121236, 0x1b80809b, 0xdfe2e23d
+.word	0xcdebeb26, 0x4e272769, 0x7fb2b2cd, 0xea75759f
+.word	0x1209091b, 0x1d83839e, 0x582c2c74, 0x341a1a2e
+.word	0x361b1b2d, 0xdc6e6eb2, 0xb45a5aee, 0x5ba0a0fb
+.word	0xa45252f6, 0x763b3b4d, 0xb7d6d661, 0x7db3b3ce
+.word	0x5229297b, 0xdde3e33e, 0x5e2f2f71, 0x13848497
+.word	0xa65353f5, 0xb9d1d168, 0x00000000, 0xc1eded2c
+.word	0x40202060, 0xe3fcfc1f, 0x79b1b1c8, 0xb65b5bed
+.word	0xd46a6abe, 0x8dcbcb46, 0x67bebed9, 0x7239394b
+.word	0x944a4ade, 0x984c4cd4, 0xb05858e8, 0x85cfcf4a
+.word	0xbbd0d06b, 0xc5efef2a, 0x4faaaae5, 0xedfbfb16
+.word	0x864343c5, 0x9a4d4dd7, 0x66333355, 0x11858594
+.word	0x8a4545cf, 0xe9f9f910, 0x04020206, 0xfe7f7f81
+.word	0xa05050f0, 0x783c3c44, 0x259f9fba, 0x4ba8a8e3
+.word	0xa25151f3, 0x5da3a3fe, 0x804040c0, 0x058f8f8a
+.word	0x3f9292ad, 0x219d9dbc, 0x70383848, 0xf1f5f504
+.word	0x63bcbcdf, 0x77b6b6c1, 0xafdada75, 0x42212163
+.word	0x20101030, 0xe5ffff1a, 0xfdf3f30e, 0xbfd2d26d
+.word	0x81cdcd4c, 0x180c0c14, 0x26131335, 0xc3ecec2f
+.word	0xbe5f5fe1, 0x359797a2, 0x884444cc, 0x2e171739
+.word	0x93c4c457, 0x55a7a7f2, 0xfc7e7e82, 0x7a3d3d47
+.word	0xc86464ac, 0xba5d5de7, 0x3219192b, 0xe6737395
+.word	0xc06060a0, 0x19818198, 0x9e4f4fd1, 0xa3dcdc7f
+.word	0x44222266, 0x542a2a7e, 0x3b9090ab, 0x0b888883
+.word	0x8c4646ca, 0xc7eeee29, 0x6bb8b8d3, 0x2814143c
+.word	0xa7dede79, 0xbc5e5ee2, 0x160b0b1d, 0xaddbdb76
+.word	0xdbe0e03b, 0x64323256, 0x743a3a4e, 0x140a0a1e
+.word	0x924949db, 0x0c06060a, 0x4824246c, 0xb85c5ce4
+.word	0x9fc2c25d, 0xbdd3d36e, 0x43acacef, 0xc46262a6
+.word	0x399191a8, 0x319595a4, 0xd3e4e437, 0xf279798b
+.word	0xd5e7e732, 0x8bc8c843, 0x6e373759, 0xda6d6db7
+.word	0x018d8d8c, 0xb1d5d564, 0x9c4e4ed2, 0x49a9a9e0
+.word	0xd86c6cb4, 0xac5656fa, 0xf3f4f407, 0xcfeaea25
+.word	0xca6565af, 0xf47a7a8e, 0x47aeaee9, 0x10080818
+.word	0x6fbabad5, 0xf0787888, 0x4a25256f, 0x5c2e2e72
+.word	0x381c1c24, 0x57a6a6f1, 0x73b4b4c7, 0x97c6c651
+.word	0xcbe8e823, 0xa1dddd7c, 0xe874749c, 0x3e1f1f21
+.word	0x964b4bdd, 0x61bdbddc, 0x0d8b8b86, 0x0f8a8a85
+.word	0xe0707090, 0x7c3e3e42, 0x71b5b5c4, 0xcc6666aa
+.word	0x904848d8, 0x06030305, 0xf7f6f601, 0x1c0e0e12
+.word	0xc26161a3, 0x6a35355f, 0xae5757f9, 0x69b9b9d0
+.word	0x17868691, 0x99c1c158, 0x3a1d1d27, 0x279e9eb9
+.word	0xd9e1e138, 0xebf8f813, 0x2b9898b3, 0x22111133
+.word	0xd26969bb, 0xa9d9d970, 0x078e8e89, 0x339494a7
+.word	0x2d9b9bb6, 0x3c1e1e22, 0x15878792, 0xc9e9e920
+.word	0x87cece49, 0xaa5555ff, 0x50282878, 0xa5dfdf7a
+.word	0x038c8c8f, 0x59a1a1f8, 0x09898980, 0x1a0d0d17
+.word	0x65bfbfda, 0xd7e6e631, 0x844242c6, 0xd06868b8
+.word	0x824141c3, 0x299999b0, 0x5a2d2d77, 0x1e0f0f11
+.word	0x7bb0b0cb, 0xa85454fc, 0x6dbbbbd6, 0x2c16163a
+@ Te4[256]
+.byte	0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5
+.byte	0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76
+.byte	0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0
+.byte	0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0
+.byte	0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc
+.byte	0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15
+.byte	0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a
+.byte	0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75
+.byte	0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0
+.byte	0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84
+.byte	0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b
+.byte	0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf
+.byte	0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85
+.byte	0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8
+.byte	0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5
+.byte	0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2
+.byte	0xcd, 0x0c, 0x13, 0xec, 0x5f, 0x97, 0x44, 0x17
+.byte	0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73
+.byte	0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, 0x90, 0x88
+.byte	0x46, 0xee, 0xb8, 0x14, 0xde, 0x5e, 0x0b, 0xdb
+.byte	0xe0, 0x32, 0x3a, 0x0a, 0x49, 0x06, 0x24, 0x5c
+.byte	0xc2, 0xd3, 0xac, 0x62, 0x91, 0x95, 0xe4, 0x79
+.byte	0xe7, 0xc8, 0x37, 0x6d, 0x8d, 0xd5, 0x4e, 0xa9
+.byte	0x6c, 0x56, 0xf4, 0xea, 0x65, 0x7a, 0xae, 0x08
+.byte	0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6
+.byte	0xe8, 0xdd, 0x74, 0x1f, 0x4b, 0xbd, 0x8b, 0x8a
+.byte	0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e
+.byte	0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e
+.byte	0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94
+.byte	0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf
+.byte	0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68
+.byte	0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16
+@ rcon[]
+.word	0x01000000, 0x02000000, 0x04000000, 0x08000000
+.word	0x10000000, 0x20000000, 0x40000000, 0x80000000
+.word	0x1B000000, 0x36000000, 0, 0, 0, 0, 0, 0
+.size	AES_Te,.-AES_Te
+
+@ void asm_AES_encrypt(const unsigned char *in, unsigned char *out,
+@ 		       const AES_KEY *key) {
+.globl	asm_AES_encrypt
+.hidden	asm_AES_encrypt
+.type	asm_AES_encrypt,%function
+.align	5
+asm_AES_encrypt:
+#if __ARM_ARCH__<7
+	sub	r3,pc,#8		@ asm_AES_encrypt
+#else
+	adr	r3,asm_AES_encrypt
+#endif
+	stmdb	sp!,{r1,r4-r12,lr}
+#ifdef	__APPLE__
+	adr	r10,AES_Te
+#else
+	sub	r10,r3,#asm_AES_encrypt-AES_Te	@ Te
+#endif
+	mov	r12,r0		@ inp
+	mov	r11,r2
+#if __ARM_ARCH__<7
+	ldrb	r0,[r12,#3]	@ load input data in endian-neutral
+	ldrb	r4,[r12,#2]	@ manner...
+	ldrb	r5,[r12,#1]
+	ldrb	r6,[r12,#0]
+	orr	r0,r0,r4,lsl#8
+	ldrb	r1,[r12,#7]
+	orr	r0,r0,r5,lsl#16
+	ldrb	r4,[r12,#6]
+	orr	r0,r0,r6,lsl#24
+	ldrb	r5,[r12,#5]
+	ldrb	r6,[r12,#4]
+	orr	r1,r1,r4,lsl#8
+	ldrb	r2,[r12,#11]
+	orr	r1,r1,r5,lsl#16
+	ldrb	r4,[r12,#10]
+	orr	r1,r1,r6,lsl#24
+	ldrb	r5,[r12,#9]
+	ldrb	r6,[r12,#8]
+	orr	r2,r2,r4,lsl#8
+	ldrb	r3,[r12,#15]
+	orr	r2,r2,r5,lsl#16
+	ldrb	r4,[r12,#14]
+	orr	r2,r2,r6,lsl#24
+	ldrb	r5,[r12,#13]
+	ldrb	r6,[r12,#12]
+	orr	r3,r3,r4,lsl#8
+	orr	r3,r3,r5,lsl#16
+	orr	r3,r3,r6,lsl#24
+#else
+	ldr	r0,[r12,#0]
+	ldr	r1,[r12,#4]
+	ldr	r2,[r12,#8]
+	ldr	r3,[r12,#12]
+#ifdef __ARMEL__
+	rev	r0,r0
+	rev	r1,r1
+	rev	r2,r2
+	rev	r3,r3
+#endif
+#endif
+	bl	_armv4_AES_encrypt
+
+	ldr	r12,[sp],#4		@ pop out
+#if __ARM_ARCH__>=7
+#ifdef __ARMEL__
+	rev	r0,r0
+	rev	r1,r1
+	rev	r2,r2
+	rev	r3,r3
+#endif
+	str	r0,[r12,#0]
+	str	r1,[r12,#4]
+	str	r2,[r12,#8]
+	str	r3,[r12,#12]
+#else
+	mov	r4,r0,lsr#24		@ write output in endian-neutral
+	mov	r5,r0,lsr#16		@ manner...
+	mov	r6,r0,lsr#8
+	strb	r4,[r12,#0]
+	strb	r5,[r12,#1]
+	mov	r4,r1,lsr#24
+	strb	r6,[r12,#2]
+	mov	r5,r1,lsr#16
+	strb	r0,[r12,#3]
+	mov	r6,r1,lsr#8
+	strb	r4,[r12,#4]
+	strb	r5,[r12,#5]
+	mov	r4,r2,lsr#24
+	strb	r6,[r12,#6]
+	mov	r5,r2,lsr#16
+	strb	r1,[r12,#7]
+	mov	r6,r2,lsr#8
+	strb	r4,[r12,#8]
+	strb	r5,[r12,#9]
+	mov	r4,r3,lsr#24
+	strb	r6,[r12,#10]
+	mov	r5,r3,lsr#16
+	strb	r2,[r12,#11]
+	mov	r6,r3,lsr#8
+	strb	r4,[r12,#12]
+	strb	r5,[r12,#13]
+	strb	r6,[r12,#14]
+	strb	r3,[r12,#15]
+#endif
+#if __ARM_ARCH__>=5
+	ldmia	sp!,{r4,r5,r6,r7,r8,r9,r10,r11,r12,pc}
+#else
+	ldmia	sp!,{r4,r5,r6,r7,r8,r9,r10,r11,r12,lr}
+	tst	lr,#1
+	moveq	pc,lr			@ be binary compatible with V4, yet
+.word	0xe12fff1e			@ interoperable with Thumb ISA:-)
+#endif
+.size	asm_AES_encrypt,.-asm_AES_encrypt
+
+.type	_armv4_AES_encrypt,%function
+.align	2
+_armv4_AES_encrypt:
+	str	lr,[sp,#-4]!		@ push lr
+	ldmia	r11!,{r4,r5,r6,r7}
+	eor	r0,r0,r4
+	ldr	r12,[r11,#240-16]
+	eor	r1,r1,r5
+	eor	r2,r2,r6
+	eor	r3,r3,r7
+	sub	r12,r12,#1
+	mov	lr,#255
+
+	and	r7,lr,r0
+	and	r8,lr,r0,lsr#8
+	and	r9,lr,r0,lsr#16
+	mov	r0,r0,lsr#24
+.Lenc_loop:
+	ldr	r4,[r10,r7,lsl#2]	@ Te3[s0>>0]
+	and	r7,lr,r1,lsr#16	@ i0
+	ldr	r5,[r10,r8,lsl#2]	@ Te2[s0>>8]
+	and	r8,lr,r1
+	ldr	r6,[r10,r9,lsl#2]	@ Te1[s0>>16]
+	and	r9,lr,r1,lsr#8
+	ldr	r0,[r10,r0,lsl#2]	@ Te0[s0>>24]
+	mov	r1,r1,lsr#24
+
+	ldr	r7,[r10,r7,lsl#2]	@ Te1[s1>>16]
+	ldr	r8,[r10,r8,lsl#2]	@ Te3[s1>>0]
+	ldr	r9,[r10,r9,lsl#2]	@ Te2[s1>>8]
+	eor	r0,r0,r7,ror#8
+	ldr	r1,[r10,r1,lsl#2]	@ Te0[s1>>24]
+	and	r7,lr,r2,lsr#8	@ i0
+	eor	r5,r5,r8,ror#8
+	and	r8,lr,r2,lsr#16	@ i1
+	eor	r6,r6,r9,ror#8
+	and	r9,lr,r2
+	ldr	r7,[r10,r7,lsl#2]	@ Te2[s2>>8]
+	eor	r1,r1,r4,ror#24
+	ldr	r8,[r10,r8,lsl#2]	@ Te1[s2>>16]
+	mov	r2,r2,lsr#24
+
+	ldr	r9,[r10,r9,lsl#2]	@ Te3[s2>>0]
+	eor	r0,r0,r7,ror#16
+	ldr	r2,[r10,r2,lsl#2]	@ Te0[s2>>24]
+	and	r7,lr,r3		@ i0
+	eor	r1,r1,r8,ror#8
+	and	r8,lr,r3,lsr#8	@ i1
+	eor	r6,r6,r9,ror#16
+	and	r9,lr,r3,lsr#16	@ i2
+	ldr	r7,[r10,r7,lsl#2]	@ Te3[s3>>0]
+	eor	r2,r2,r5,ror#16
+	ldr	r8,[r10,r8,lsl#2]	@ Te2[s3>>8]
+	mov	r3,r3,lsr#24
+
+	ldr	r9,[r10,r9,lsl#2]	@ Te1[s3>>16]
+	eor	r0,r0,r7,ror#24
+	ldr	r7,[r11],#16
+	eor	r1,r1,r8,ror#16
+	ldr	r3,[r10,r3,lsl#2]	@ Te0[s3>>24]
+	eor	r2,r2,r9,ror#8
+	ldr	r4,[r11,#-12]
+	eor	r3,r3,r6,ror#8
+
+	ldr	r5,[r11,#-8]
+	eor	r0,r0,r7
+	ldr	r6,[r11,#-4]
+	and	r7,lr,r0
+	eor	r1,r1,r4
+	and	r8,lr,r0,lsr#8
+	eor	r2,r2,r5
+	and	r9,lr,r0,lsr#16
+	eor	r3,r3,r6
+	mov	r0,r0,lsr#24
+
+	subs	r12,r12,#1
+	bne	.Lenc_loop
+
+	add	r10,r10,#2
+
+	ldrb	r4,[r10,r7,lsl#2]	@ Te4[s0>>0]
+	and	r7,lr,r1,lsr#16	@ i0
+	ldrb	r5,[r10,r8,lsl#2]	@ Te4[s0>>8]
+	and	r8,lr,r1
+	ldrb	r6,[r10,r9,lsl#2]	@ Te4[s0>>16]
+	and	r9,lr,r1,lsr#8
+	ldrb	r0,[r10,r0,lsl#2]	@ Te4[s0>>24]
+	mov	r1,r1,lsr#24
+
+	ldrb	r7,[r10,r7,lsl#2]	@ Te4[s1>>16]
+	ldrb	r8,[r10,r8,lsl#2]	@ Te4[s1>>0]
+	ldrb	r9,[r10,r9,lsl#2]	@ Te4[s1>>8]
+	eor	r0,r7,r0,lsl#8
+	ldrb	r1,[r10,r1,lsl#2]	@ Te4[s1>>24]
+	and	r7,lr,r2,lsr#8	@ i0
+	eor	r5,r8,r5,lsl#8
+	and	r8,lr,r2,lsr#16	@ i1
+	eor	r6,r9,r6,lsl#8
+	and	r9,lr,r2
+	ldrb	r7,[r10,r7,lsl#2]	@ Te4[s2>>8]
+	eor	r1,r4,r1,lsl#24
+	ldrb	r8,[r10,r8,lsl#2]	@ Te4[s2>>16]
+	mov	r2,r2,lsr#24
+
+	ldrb	r9,[r10,r9,lsl#2]	@ Te4[s2>>0]
+	eor	r0,r7,r0,lsl#8
+	ldrb	r2,[r10,r2,lsl#2]	@ Te4[s2>>24]
+	and	r7,lr,r3		@ i0
+	eor	r1,r1,r8,lsl#16
+	and	r8,lr,r3,lsr#8	@ i1
+	eor	r6,r9,r6,lsl#8
+	and	r9,lr,r3,lsr#16	@ i2
+	ldrb	r7,[r10,r7,lsl#2]	@ Te4[s3>>0]
+	eor	r2,r5,r2,lsl#24
+	ldrb	r8,[r10,r8,lsl#2]	@ Te4[s3>>8]
+	mov	r3,r3,lsr#24
+
+	ldrb	r9,[r10,r9,lsl#2]	@ Te4[s3>>16]
+	eor	r0,r7,r0,lsl#8
+	ldr	r7,[r11,#0]
+	ldrb	r3,[r10,r3,lsl#2]	@ Te4[s3>>24]
+	eor	r1,r1,r8,lsl#8
+	ldr	r4,[r11,#4]
+	eor	r2,r2,r9,lsl#16
+	ldr	r5,[r11,#8]
+	eor	r3,r6,r3,lsl#24
+	ldr	r6,[r11,#12]
+
+	eor	r0,r0,r7
+	eor	r1,r1,r4
+	eor	r2,r2,r5
+	eor	r3,r3,r6
+
+	sub	r10,r10,#2
+	ldr	pc,[sp],#4		@ pop and return
+.size	_armv4_AES_encrypt,.-_armv4_AES_encrypt
+
+.globl	asm_AES_set_encrypt_key
+.hidden	asm_AES_set_encrypt_key
+.type	asm_AES_set_encrypt_key,%function
+.align	5
+asm_AES_set_encrypt_key:
+_armv4_AES_set_encrypt_key:
+#if __ARM_ARCH__<7
+	sub	r3,pc,#8		@ asm_AES_set_encrypt_key
+#else
+	adr	r3,asm_AES_set_encrypt_key
+#endif
+	teq	r0,#0
+#if __ARM_ARCH__>=7
+	itt	eq			@ Thumb2 thing, sanity check in ARM
+#endif
+	moveq	r0,#-1
+	beq	.Labrt
+	teq	r2,#0
+#if __ARM_ARCH__>=7
+	itt	eq			@ Thumb2 thing, sanity check in ARM
+#endif
+	moveq	r0,#-1
+	beq	.Labrt
+
+	teq	r1,#128
+	beq	.Lok
+	teq	r1,#192
+	beq	.Lok
+	teq	r1,#256
+#if __ARM_ARCH__>=7
+	itt	ne			@ Thumb2 thing, sanity check in ARM
+#endif
+	movne	r0,#-1
+	bne	.Labrt
+
+.Lok:	stmdb	sp!,{r4,r5,r6,r7,r8,r9,r10,r11,r12,lr}
+	mov	r12,r0		@ inp
+	mov	lr,r1			@ bits
+	mov	r11,r2			@ key
+
+#ifdef	__APPLE__
+	adr	r10,AES_Te+1024				@ Te4
+#else
+	sub	r10,r3,#_armv4_AES_set_encrypt_key-AES_Te-1024	@ Te4
+#endif
+
+#if __ARM_ARCH__<7
+	ldrb	r0,[r12,#3]	@ load input data in endian-neutral
+	ldrb	r4,[r12,#2]	@ manner...
+	ldrb	r5,[r12,#1]
+	ldrb	r6,[r12,#0]
+	orr	r0,r0,r4,lsl#8
+	ldrb	r1,[r12,#7]
+	orr	r0,r0,r5,lsl#16
+	ldrb	r4,[r12,#6]
+	orr	r0,r0,r6,lsl#24
+	ldrb	r5,[r12,#5]
+	ldrb	r6,[r12,#4]
+	orr	r1,r1,r4,lsl#8
+	ldrb	r2,[r12,#11]
+	orr	r1,r1,r5,lsl#16
+	ldrb	r4,[r12,#10]
+	orr	r1,r1,r6,lsl#24
+	ldrb	r5,[r12,#9]
+	ldrb	r6,[r12,#8]
+	orr	r2,r2,r4,lsl#8
+	ldrb	r3,[r12,#15]
+	orr	r2,r2,r5,lsl#16
+	ldrb	r4,[r12,#14]
+	orr	r2,r2,r6,lsl#24
+	ldrb	r5,[r12,#13]
+	ldrb	r6,[r12,#12]
+	orr	r3,r3,r4,lsl#8
+	str	r0,[r11],#16
+	orr	r3,r3,r5,lsl#16
+	str	r1,[r11,#-12]
+	orr	r3,r3,r6,lsl#24
+	str	r2,[r11,#-8]
+	str	r3,[r11,#-4]
+#else
+	ldr	r0,[r12,#0]
+	ldr	r1,[r12,#4]
+	ldr	r2,[r12,#8]
+	ldr	r3,[r12,#12]
+#ifdef __ARMEL__
+	rev	r0,r0
+	rev	r1,r1
+	rev	r2,r2
+	rev	r3,r3
+#endif
+	str	r0,[r11],#16
+	str	r1,[r11,#-12]
+	str	r2,[r11,#-8]
+	str	r3,[r11,#-4]
+#endif
+
+	teq	lr,#128
+	bne	.Lnot128
+	mov	r12,#10
+	str	r12,[r11,#240-16]
+	add	r6,r10,#256			@ rcon
+	mov	lr,#255
+
+.L128_loop:
+	and	r5,lr,r3,lsr#24
+	and	r7,lr,r3,lsr#16
+	ldrb	r5,[r10,r5]
+	and	r8,lr,r3,lsr#8
+	ldrb	r7,[r10,r7]
+	and	r9,lr,r3
+	ldrb	r8,[r10,r8]
+	orr	r5,r5,r7,lsl#24
+	ldrb	r9,[r10,r9]
+	orr	r5,r5,r8,lsl#16
+	ldr	r4,[r6],#4			@ rcon[i++]
+	orr	r5,r5,r9,lsl#8
+	eor	r5,r5,r4
+	eor	r0,r0,r5			@ rk[4]=rk[0]^...
+	eor	r1,r1,r0			@ rk[5]=rk[1]^rk[4]
+	str	r0,[r11],#16
+	eor	r2,r2,r1			@ rk[6]=rk[2]^rk[5]
+	str	r1,[r11,#-12]
+	eor	r3,r3,r2			@ rk[7]=rk[3]^rk[6]
+	str	r2,[r11,#-8]
+	subs	r12,r12,#1
+	str	r3,[r11,#-4]
+	bne	.L128_loop
+	sub	r2,r11,#176
+	b	.Ldone
+
+.Lnot128:
+#if __ARM_ARCH__<7
+	ldrb	r8,[r12,#19]
+	ldrb	r4,[r12,#18]
+	ldrb	r5,[r12,#17]
+	ldrb	r6,[r12,#16]
+	orr	r8,r8,r4,lsl#8
+	ldrb	r9,[r12,#23]
+	orr	r8,r8,r5,lsl#16
+	ldrb	r4,[r12,#22]
+	orr	r8,r8,r6,lsl#24
+	ldrb	r5,[r12,#21]
+	ldrb	r6,[r12,#20]
+	orr	r9,r9,r4,lsl#8
+	orr	r9,r9,r5,lsl#16
+	str	r8,[r11],#8
+	orr	r9,r9,r6,lsl#24
+	str	r9,[r11,#-4]
+#else
+	ldr	r8,[r12,#16]
+	ldr	r9,[r12,#20]
+#ifdef __ARMEL__
+	rev	r8,r8
+	rev	r9,r9
+#endif
+	str	r8,[r11],#8
+	str	r9,[r11,#-4]
+#endif
+
+	teq	lr,#192
+	bne	.Lnot192
+	mov	r12,#12
+	str	r12,[r11,#240-24]
+	add	r6,r10,#256			@ rcon
+	mov	lr,#255
+	mov	r12,#8
+
+.L192_loop:
+	and	r5,lr,r9,lsr#24
+	and	r7,lr,r9,lsr#16
+	ldrb	r5,[r10,r5]
+	and	r8,lr,r9,lsr#8
+	ldrb	r7,[r10,r7]
+	and	r9,lr,r9
+	ldrb	r8,[r10,r8]
+	orr	r5,r5,r7,lsl#24
+	ldrb	r9,[r10,r9]
+	orr	r5,r5,r8,lsl#16
+	ldr	r4,[r6],#4			@ rcon[i++]
+	orr	r5,r5,r9,lsl#8
+	eor	r9,r5,r4
+	eor	r0,r0,r9			@ rk[6]=rk[0]^...
+	eor	r1,r1,r0			@ rk[7]=rk[1]^rk[6]
+	str	r0,[r11],#24
+	eor	r2,r2,r1			@ rk[8]=rk[2]^rk[7]
+	str	r1,[r11,#-20]
+	eor	r3,r3,r2			@ rk[9]=rk[3]^rk[8]
+	str	r2,[r11,#-16]
+	subs	r12,r12,#1
+	str	r3,[r11,#-12]
+#if __ARM_ARCH__>=7
+	itt	eq				@ Thumb2 thing, sanity check in ARM
+#endif
+	subeq	r2,r11,#216
+	beq	.Ldone
+
+	ldr	r7,[r11,#-32]
+	ldr	r8,[r11,#-28]
+	eor	r7,r7,r3			@ rk[10]=rk[4]^rk[9]
+	eor	r9,r8,r7			@ rk[11]=rk[5]^rk[10]
+	str	r7,[r11,#-8]
+	str	r9,[r11,#-4]
+	b	.L192_loop
+
+.Lnot192:
+#if __ARM_ARCH__<7
+	ldrb	r8,[r12,#27]
+	ldrb	r4,[r12,#26]
+	ldrb	r5,[r12,#25]
+	ldrb	r6,[r12,#24]
+	orr	r8,r8,r4,lsl#8
+	ldrb	r9,[r12,#31]
+	orr	r8,r8,r5,lsl#16
+	ldrb	r4,[r12,#30]
+	orr	r8,r8,r6,lsl#24
+	ldrb	r5,[r12,#29]
+	ldrb	r6,[r12,#28]
+	orr	r9,r9,r4,lsl#8
+	orr	r9,r9,r5,lsl#16
+	str	r8,[r11],#8
+	orr	r9,r9,r6,lsl#24
+	str	r9,[r11,#-4]
+#else
+	ldr	r8,[r12,#24]
+	ldr	r9,[r12,#28]
+#ifdef __ARMEL__
+	rev	r8,r8
+	rev	r9,r9
+#endif
+	str	r8,[r11],#8
+	str	r9,[r11,#-4]
+#endif
+
+	mov	r12,#14
+	str	r12,[r11,#240-32]
+	add	r6,r10,#256			@ rcon
+	mov	lr,#255
+	mov	r12,#7
+
+.L256_loop:
+	and	r5,lr,r9,lsr#24
+	and	r7,lr,r9,lsr#16
+	ldrb	r5,[r10,r5]
+	and	r8,lr,r9,lsr#8
+	ldrb	r7,[r10,r7]
+	and	r9,lr,r9
+	ldrb	r8,[r10,r8]
+	orr	r5,r5,r7,lsl#24
+	ldrb	r9,[r10,r9]
+	orr	r5,r5,r8,lsl#16
+	ldr	r4,[r6],#4			@ rcon[i++]
+	orr	r5,r5,r9,lsl#8
+	eor	r9,r5,r4
+	eor	r0,r0,r9			@ rk[8]=rk[0]^...
+	eor	r1,r1,r0			@ rk[9]=rk[1]^rk[8]
+	str	r0,[r11],#32
+	eor	r2,r2,r1			@ rk[10]=rk[2]^rk[9]
+	str	r1,[r11,#-28]
+	eor	r3,r3,r2			@ rk[11]=rk[3]^rk[10]
+	str	r2,[r11,#-24]
+	subs	r12,r12,#1
+	str	r3,[r11,#-20]
+#if __ARM_ARCH__>=7
+	itt	eq				@ Thumb2 thing, sanity check in ARM
+#endif
+	subeq	r2,r11,#256
+	beq	.Ldone
+
+	and	r5,lr,r3
+	and	r7,lr,r3,lsr#8
+	ldrb	r5,[r10,r5]
+	and	r8,lr,r3,lsr#16
+	ldrb	r7,[r10,r7]
+	and	r9,lr,r3,lsr#24
+	ldrb	r8,[r10,r8]
+	orr	r5,r5,r7,lsl#8
+	ldrb	r9,[r10,r9]
+	orr	r5,r5,r8,lsl#16
+	ldr	r4,[r11,#-48]
+	orr	r5,r5,r9,lsl#24
+
+	ldr	r7,[r11,#-44]
+	ldr	r8,[r11,#-40]
+	eor	r4,r4,r5			@ rk[12]=rk[4]^...
+	ldr	r9,[r11,#-36]
+	eor	r7,r7,r4			@ rk[13]=rk[5]^rk[12]
+	str	r4,[r11,#-16]
+	eor	r8,r8,r7			@ rk[14]=rk[6]^rk[13]
+	str	r7,[r11,#-12]
+	eor	r9,r9,r8			@ rk[15]=rk[7]^rk[14]
+	str	r8,[r11,#-8]
+	str	r9,[r11,#-4]
+	b	.L256_loop
+
+.align	2
+.Ldone:	mov	r0,#0
+	ldmia	sp!,{r4,r5,r6,r7,r8,r9,r10,r11,r12,lr}
+.Labrt:
+#if __ARM_ARCH__>=5
+	bx	lr				@ .word	0xe12fff1e
+#else
+	tst	lr,#1
+	moveq	pc,lr			@ be binary compatible with V4, yet
+.word	0xe12fff1e			@ interoperable with Thumb ISA:-)
+#endif
+.size	asm_AES_set_encrypt_key,.-asm_AES_set_encrypt_key
+
+.globl	asm_AES_set_decrypt_key
+.hidden	asm_AES_set_decrypt_key
+.type	asm_AES_set_decrypt_key,%function
+.align	5
+asm_AES_set_decrypt_key:
+	str	lr,[sp,#-4]!            @ push lr
+	bl	_armv4_AES_set_encrypt_key
+	teq	r0,#0
+	ldr	lr,[sp],#4              @ pop lr
+	bne	.Labrt
+
+	mov	r0,r2			@ asm_AES_set_encrypt_key preserves r2,
+	mov	r1,r2			@ which is AES_KEY *key
+	b	_armv4_AES_set_enc2dec_key
+.size	asm_AES_set_decrypt_key,.-asm_AES_set_decrypt_key
+
+@ void AES_set_enc2dec_key(const AES_KEY *inp,AES_KEY *out)
+.globl	AES_set_enc2dec_key
+.hidden	AES_set_enc2dec_key
+.type	AES_set_enc2dec_key,%function
+.align	5
+AES_set_enc2dec_key:
+_armv4_AES_set_enc2dec_key:
+	stmdb	sp!,{r4,r5,r6,r7,r8,r9,r10,r11,r12,lr}
+
+	ldr	r12,[r0,#240]
+	mov	r7,r0			@ input
+	add	r8,r0,r12,lsl#4
+	mov	r11,r1			@ ouput
+	add	r10,r1,r12,lsl#4
+	str	r12,[r1,#240]
+
+.Linv:	ldr	r0,[r7],#16
+	ldr	r1,[r7,#-12]
+	ldr	r2,[r7,#-8]
+	ldr	r3,[r7,#-4]
+	ldr	r4,[r8],#-16
+	ldr	r5,[r8,#16+4]
+	ldr	r6,[r8,#16+8]
+	ldr	r9,[r8,#16+12]
+	str	r0,[r10],#-16
+	str	r1,[r10,#16+4]
+	str	r2,[r10,#16+8]
+	str	r3,[r10,#16+12]
+	str	r4,[r11],#16
+	str	r5,[r11,#-12]
+	str	r6,[r11,#-8]
+	str	r9,[r11,#-4]
+	teq	r7,r8
+	bne	.Linv
+
+	ldr	r0,[r7]
+	ldr	r1,[r7,#4]
+	ldr	r2,[r7,#8]
+	ldr	r3,[r7,#12]
+	str	r0,[r11]
+	str	r1,[r11,#4]
+	str	r2,[r11,#8]
+	str	r3,[r11,#12]
+	sub	r11,r11,r12,lsl#3
+	ldr	r0,[r11,#16]!		@ prefetch tp1
+	mov	r7,#0x80
+	mov	r8,#0x1b
+	orr	r7,r7,#0x8000
+	orr	r8,r8,#0x1b00
+	orr	r7,r7,r7,lsl#16
+	orr	r8,r8,r8,lsl#16
+	sub	r12,r12,#1
+	mvn	r9,r7
+	mov	r12,r12,lsl#2	@ (rounds-1)*4
+
+.Lmix:	and	r4,r0,r7
+	and	r1,r0,r9
+	sub	r4,r4,r4,lsr#7
+	and	r4,r4,r8
+	eor	r1,r4,r1,lsl#1	@ tp2
+
+	and	r4,r1,r7
+	and	r2,r1,r9
+	sub	r4,r4,r4,lsr#7
+	and	r4,r4,r8
+	eor	r2,r4,r2,lsl#1	@ tp4
+
+	and	r4,r2,r7
+	and	r3,r2,r9
+	sub	r4,r4,r4,lsr#7
+	and	r4,r4,r8
+	eor	r3,r4,r3,lsl#1	@ tp8
+
+	eor	r4,r1,r2
+	eor	r5,r0,r3		@ tp9
+	eor	r4,r4,r3		@ tpe
+	eor	r4,r4,r1,ror#24
+	eor	r4,r4,r5,ror#24	@ ^= ROTATE(tpb=tp9^tp2,8)
+	eor	r4,r4,r2,ror#16
+	eor	r4,r4,r5,ror#16	@ ^= ROTATE(tpd=tp9^tp4,16)
+	eor	r4,r4,r5,ror#8	@ ^= ROTATE(tp9,24)
+
+	ldr	r0,[r11,#4]		@ prefetch tp1
+	str	r4,[r11],#4
+	subs	r12,r12,#1
+	bne	.Lmix
+
+	mov	r0,#0
+#if __ARM_ARCH__>=5
+	ldmia	sp!,{r4,r5,r6,r7,r8,r9,r10,r11,r12,pc}
+#else
+	ldmia	sp!,{r4,r5,r6,r7,r8,r9,r10,r11,r12,lr}
+	tst	lr,#1
+	moveq	pc,lr			@ be binary compatible with V4, yet
+.word	0xe12fff1e			@ interoperable with Thumb ISA:-)
+#endif
+.size	AES_set_enc2dec_key,.-AES_set_enc2dec_key
+
+.type	AES_Td,%object
+.align	5
+AES_Td:
+.word	0x51f4a750, 0x7e416553, 0x1a17a4c3, 0x3a275e96
+.word	0x3bab6bcb, 0x1f9d45f1, 0xacfa58ab, 0x4be30393
+.word	0x2030fa55, 0xad766df6, 0x88cc7691, 0xf5024c25
+.word	0x4fe5d7fc, 0xc52acbd7, 0x26354480, 0xb562a38f
+.word	0xdeb15a49, 0x25ba1b67, 0x45ea0e98, 0x5dfec0e1
+.word	0xc32f7502, 0x814cf012, 0x8d4697a3, 0x6bd3f9c6
+.word	0x038f5fe7, 0x15929c95, 0xbf6d7aeb, 0x955259da
+.word	0xd4be832d, 0x587421d3, 0x49e06929, 0x8ec9c844
+.word	0x75c2896a, 0xf48e7978, 0x99583e6b, 0x27b971dd
+.word	0xbee14fb6, 0xf088ad17, 0xc920ac66, 0x7dce3ab4
+.word	0x63df4a18, 0xe51a3182, 0x97513360, 0x62537f45
+.word	0xb16477e0, 0xbb6bae84, 0xfe81a01c, 0xf9082b94
+.word	0x70486858, 0x8f45fd19, 0x94de6c87, 0x527bf8b7
+.word	0xab73d323, 0x724b02e2, 0xe31f8f57, 0x6655ab2a
+.word	0xb2eb2807, 0x2fb5c203, 0x86c57b9a, 0xd33708a5
+.word	0x302887f2, 0x23bfa5b2, 0x02036aba, 0xed16825c
+.word	0x8acf1c2b, 0xa779b492, 0xf307f2f0, 0x4e69e2a1
+.word	0x65daf4cd, 0x0605bed5, 0xd134621f, 0xc4a6fe8a
+.word	0x342e539d, 0xa2f355a0, 0x058ae132, 0xa4f6eb75
+.word	0x0b83ec39, 0x4060efaa, 0x5e719f06, 0xbd6e1051
+.word	0x3e218af9, 0x96dd063d, 0xdd3e05ae, 0x4de6bd46
+.word	0x91548db5, 0x71c45d05, 0x0406d46f, 0x605015ff
+.word	0x1998fb24, 0xd6bde997, 0x894043cc, 0x67d99e77
+.word	0xb0e842bd, 0x07898b88, 0xe7195b38, 0x79c8eedb
+.word	0xa17c0a47, 0x7c420fe9, 0xf8841ec9, 0x00000000
+.word	0x09808683, 0x322bed48, 0x1e1170ac, 0x6c5a724e
+.word	0xfd0efffb, 0x0f853856, 0x3daed51e, 0x362d3927
+.word	0x0a0fd964, 0x685ca621, 0x9b5b54d1, 0x24362e3a
+.word	0x0c0a67b1, 0x9357e70f, 0xb4ee96d2, 0x1b9b919e
+.word	0x80c0c54f, 0x61dc20a2, 0x5a774b69, 0x1c121a16
+.word	0xe293ba0a, 0xc0a02ae5, 0x3c22e043, 0x121b171d
+.word	0x0e090d0b, 0xf28bc7ad, 0x2db6a8b9, 0x141ea9c8
+.word	0x57f11985, 0xaf75074c, 0xee99ddbb, 0xa37f60fd
+.word	0xf701269f, 0x5c72f5bc, 0x44663bc5, 0x5bfb7e34
+.word	0x8b432976, 0xcb23c6dc, 0xb6edfc68, 0xb8e4f163
+.word	0xd731dcca, 0x42638510, 0x13972240, 0x84c61120
+.word	0x854a247d, 0xd2bb3df8, 0xaef93211, 0xc729a16d
+.word	0x1d9e2f4b, 0xdcb230f3, 0x0d8652ec, 0x77c1e3d0
+.word	0x2bb3166c, 0xa970b999, 0x119448fa, 0x47e96422
+.word	0xa8fc8cc4, 0xa0f03f1a, 0x567d2cd8, 0x223390ef
+.word	0x87494ec7, 0xd938d1c1, 0x8ccaa2fe, 0x98d40b36
+.word	0xa6f581cf, 0xa57ade28, 0xdab78e26, 0x3fadbfa4
+.word	0x2c3a9de4, 0x5078920d, 0x6a5fcc9b, 0x547e4662
+.word	0xf68d13c2, 0x90d8b8e8, 0x2e39f75e, 0x82c3aff5
+.word	0x9f5d80be, 0x69d0937c, 0x6fd52da9, 0xcf2512b3
+.word	0xc8ac993b, 0x10187da7, 0xe89c636e, 0xdb3bbb7b
+.word	0xcd267809, 0x6e5918f4, 0xec9ab701, 0x834f9aa8
+.word	0xe6956e65, 0xaaffe67e, 0x21bccf08, 0xef15e8e6
+.word	0xbae79bd9, 0x4a6f36ce, 0xea9f09d4, 0x29b07cd6
+.word	0x31a4b2af, 0x2a3f2331, 0xc6a59430, 0x35a266c0
+.word	0x744ebc37, 0xfc82caa6, 0xe090d0b0, 0x33a7d815
+.word	0xf104984a, 0x41ecdaf7, 0x7fcd500e, 0x1791f62f
+.word	0x764dd68d, 0x43efb04d, 0xccaa4d54, 0xe49604df
+.word	0x9ed1b5e3, 0x4c6a881b, 0xc12c1fb8, 0x4665517f
+.word	0x9d5eea04, 0x018c355d, 0xfa877473, 0xfb0b412e
+.word	0xb3671d5a, 0x92dbd252, 0xe9105633, 0x6dd64713
+.word	0x9ad7618c, 0x37a10c7a, 0x59f8148e, 0xeb133c89
+.word	0xcea927ee, 0xb761c935, 0xe11ce5ed, 0x7a47b13c
+.word	0x9cd2df59, 0x55f2733f, 0x1814ce79, 0x73c737bf
+.word	0x53f7cdea, 0x5ffdaa5b, 0xdf3d6f14, 0x7844db86
+.word	0xcaaff381, 0xb968c43e, 0x3824342c, 0xc2a3405f
+.word	0x161dc372, 0xbce2250c, 0x283c498b, 0xff0d9541
+.word	0x39a80171, 0x080cb3de, 0xd8b4e49c, 0x6456c190
+.word	0x7bcb8461, 0xd532b670, 0x486c5c74, 0xd0b85742
+@ Td4[256]
+.byte	0x52, 0x09, 0x6a, 0xd5, 0x30, 0x36, 0xa5, 0x38
+.byte	0xbf, 0x40, 0xa3, 0x9e, 0x81, 0xf3, 0xd7, 0xfb
+.byte	0x7c, 0xe3, 0x39, 0x82, 0x9b, 0x2f, 0xff, 0x87
+.byte	0x34, 0x8e, 0x43, 0x44, 0xc4, 0xde, 0xe9, 0xcb
+.byte	0x54, 0x7b, 0x94, 0x32, 0xa6, 0xc2, 0x23, 0x3d
+.byte	0xee, 0x4c, 0x95, 0x0b, 0x42, 0xfa, 0xc3, 0x4e
+.byte	0x08, 0x2e, 0xa1, 0x66, 0x28, 0xd9, 0x24, 0xb2
+.byte	0x76, 0x5b, 0xa2, 0x49, 0x6d, 0x8b, 0xd1, 0x25
+.byte	0x72, 0xf8, 0xf6, 0x64, 0x86, 0x68, 0x98, 0x16
+.byte	0xd4, 0xa4, 0x5c, 0xcc, 0x5d, 0x65, 0xb6, 0x92
+.byte	0x6c, 0x70, 0x48, 0x50, 0xfd, 0xed, 0xb9, 0xda
+.byte	0x5e, 0x15, 0x46, 0x57, 0xa7, 0x8d, 0x9d, 0x84
+.byte	0x90, 0xd8, 0xab, 0x00, 0x8c, 0xbc, 0xd3, 0x0a
+.byte	0xf7, 0xe4, 0x58, 0x05, 0xb8, 0xb3, 0x45, 0x06
+.byte	0xd0, 0x2c, 0x1e, 0x8f, 0xca, 0x3f, 0x0f, 0x02
+.byte	0xc1, 0xaf, 0xbd, 0x03, 0x01, 0x13, 0x8a, 0x6b
+.byte	0x3a, 0x91, 0x11, 0x41, 0x4f, 0x67, 0xdc, 0xea
+.byte	0x97, 0xf2, 0xcf, 0xce, 0xf0, 0xb4, 0xe6, 0x73
+.byte	0x96, 0xac, 0x74, 0x22, 0xe7, 0xad, 0x35, 0x85
+.byte	0xe2, 0xf9, 0x37, 0xe8, 0x1c, 0x75, 0xdf, 0x6e
+.byte	0x47, 0xf1, 0x1a, 0x71, 0x1d, 0x29, 0xc5, 0x89
+.byte	0x6f, 0xb7, 0x62, 0x0e, 0xaa, 0x18, 0xbe, 0x1b
+.byte	0xfc, 0x56, 0x3e, 0x4b, 0xc6, 0xd2, 0x79, 0x20
+.byte	0x9a, 0xdb, 0xc0, 0xfe, 0x78, 0xcd, 0x5a, 0xf4
+.byte	0x1f, 0xdd, 0xa8, 0x33, 0x88, 0x07, 0xc7, 0x31
+.byte	0xb1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xec, 0x5f
+.byte	0x60, 0x51, 0x7f, 0xa9, 0x19, 0xb5, 0x4a, 0x0d
+.byte	0x2d, 0xe5, 0x7a, 0x9f, 0x93, 0xc9, 0x9c, 0xef
+.byte	0xa0, 0xe0, 0x3b, 0x4d, 0xae, 0x2a, 0xf5, 0xb0
+.byte	0xc8, 0xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61
+.byte	0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26
+.byte	0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d
+.size	AES_Td,.-AES_Td
+
+@ void asm_AES_decrypt(const unsigned char *in, unsigned char *out,
+@ 		       const AES_KEY *key) {
+.globl	asm_AES_decrypt
+.hidden	asm_AES_decrypt
+.type	asm_AES_decrypt,%function
+.align	5
+asm_AES_decrypt:
+#if __ARM_ARCH__<7
+	sub	r3,pc,#8		@ asm_AES_decrypt
+#else
+	adr	r3,asm_AES_decrypt
+#endif
+	stmdb	sp!,{r1,r4-r12,lr}
+#ifdef	__APPLE__
+	adr	r10,AES_Td
+#else
+	sub	r10,r3,#asm_AES_decrypt-AES_Td	@ Td
+#endif
+	mov	r12,r0		@ inp
+	mov	r11,r2
+#if __ARM_ARCH__<7
+	ldrb	r0,[r12,#3]	@ load input data in endian-neutral
+	ldrb	r4,[r12,#2]	@ manner...
+	ldrb	r5,[r12,#1]
+	ldrb	r6,[r12,#0]
+	orr	r0,r0,r4,lsl#8
+	ldrb	r1,[r12,#7]
+	orr	r0,r0,r5,lsl#16
+	ldrb	r4,[r12,#6]
+	orr	r0,r0,r6,lsl#24
+	ldrb	r5,[r12,#5]
+	ldrb	r6,[r12,#4]
+	orr	r1,r1,r4,lsl#8
+	ldrb	r2,[r12,#11]
+	orr	r1,r1,r5,lsl#16
+	ldrb	r4,[r12,#10]
+	orr	r1,r1,r6,lsl#24
+	ldrb	r5,[r12,#9]
+	ldrb	r6,[r12,#8]
+	orr	r2,r2,r4,lsl#8
+	ldrb	r3,[r12,#15]
+	orr	r2,r2,r5,lsl#16
+	ldrb	r4,[r12,#14]
+	orr	r2,r2,r6,lsl#24
+	ldrb	r5,[r12,#13]
+	ldrb	r6,[r12,#12]
+	orr	r3,r3,r4,lsl#8
+	orr	r3,r3,r5,lsl#16
+	orr	r3,r3,r6,lsl#24
+#else
+	ldr	r0,[r12,#0]
+	ldr	r1,[r12,#4]
+	ldr	r2,[r12,#8]
+	ldr	r3,[r12,#12]
+#ifdef __ARMEL__
+	rev	r0,r0
+	rev	r1,r1
+	rev	r2,r2
+	rev	r3,r3
+#endif
+#endif
+	bl	_armv4_AES_decrypt
+
+	ldr	r12,[sp],#4		@ pop out
+#if __ARM_ARCH__>=7
+#ifdef __ARMEL__
+	rev	r0,r0
+	rev	r1,r1
+	rev	r2,r2
+	rev	r3,r3
+#endif
+	str	r0,[r12,#0]
+	str	r1,[r12,#4]
+	str	r2,[r12,#8]
+	str	r3,[r12,#12]
+#else
+	mov	r4,r0,lsr#24		@ write output in endian-neutral
+	mov	r5,r0,lsr#16		@ manner...
+	mov	r6,r0,lsr#8
+	strb	r4,[r12,#0]
+	strb	r5,[r12,#1]
+	mov	r4,r1,lsr#24
+	strb	r6,[r12,#2]
+	mov	r5,r1,lsr#16
+	strb	r0,[r12,#3]
+	mov	r6,r1,lsr#8
+	strb	r4,[r12,#4]
+	strb	r5,[r12,#5]
+	mov	r4,r2,lsr#24
+	strb	r6,[r12,#6]
+	mov	r5,r2,lsr#16
+	strb	r1,[r12,#7]
+	mov	r6,r2,lsr#8
+	strb	r4,[r12,#8]
+	strb	r5,[r12,#9]
+	mov	r4,r3,lsr#24
+	strb	r6,[r12,#10]
+	mov	r5,r3,lsr#16
+	strb	r2,[r12,#11]
+	mov	r6,r3,lsr#8
+	strb	r4,[r12,#12]
+	strb	r5,[r12,#13]
+	strb	r6,[r12,#14]
+	strb	r3,[r12,#15]
+#endif
+#if __ARM_ARCH__>=5
+	ldmia	sp!,{r4,r5,r6,r7,r8,r9,r10,r11,r12,pc}
+#else
+	ldmia	sp!,{r4,r5,r6,r7,r8,r9,r10,r11,r12,lr}
+	tst	lr,#1
+	moveq	pc,lr			@ be binary compatible with V4, yet
+.word	0xe12fff1e			@ interoperable with Thumb ISA:-)
+#endif
+.size	asm_AES_decrypt,.-asm_AES_decrypt
+
+.type	_armv4_AES_decrypt,%function
+.align	2
+_armv4_AES_decrypt:
+	str	lr,[sp,#-4]!		@ push lr
+	ldmia	r11!,{r4,r5,r6,r7}
+	eor	r0,r0,r4
+	ldr	r12,[r11,#240-16]
+	eor	r1,r1,r5
+	eor	r2,r2,r6
+	eor	r3,r3,r7
+	sub	r12,r12,#1
+	mov	lr,#255
+
+	and	r7,lr,r0,lsr#16
+	and	r8,lr,r0,lsr#8
+	and	r9,lr,r0
+	mov	r0,r0,lsr#24
+.Ldec_loop:
+	ldr	r4,[r10,r7,lsl#2]	@ Td1[s0>>16]
+	and	r7,lr,r1		@ i0
+	ldr	r5,[r10,r8,lsl#2]	@ Td2[s0>>8]
+	and	r8,lr,r1,lsr#16
+	ldr	r6,[r10,r9,lsl#2]	@ Td3[s0>>0]
+	and	r9,lr,r1,lsr#8
+	ldr	r0,[r10,r0,lsl#2]	@ Td0[s0>>24]
+	mov	r1,r1,lsr#24
+
+	ldr	r7,[r10,r7,lsl#2]	@ Td3[s1>>0]
+	ldr	r8,[r10,r8,lsl#2]	@ Td1[s1>>16]
+	ldr	r9,[r10,r9,lsl#2]	@ Td2[s1>>8]
+	eor	r0,r0,r7,ror#24
+	ldr	r1,[r10,r1,lsl#2]	@ Td0[s1>>24]
+	and	r7,lr,r2,lsr#8	@ i0
+	eor	r5,r8,r5,ror#8
+	and	r8,lr,r2		@ i1
+	eor	r6,r9,r6,ror#8
+	and	r9,lr,r2,lsr#16
+	ldr	r7,[r10,r7,lsl#2]	@ Td2[s2>>8]
+	eor	r1,r1,r4,ror#8
+	ldr	r8,[r10,r8,lsl#2]	@ Td3[s2>>0]
+	mov	r2,r2,lsr#24
+
+	ldr	r9,[r10,r9,lsl#2]	@ Td1[s2>>16]
+	eor	r0,r0,r7,ror#16
+	ldr	r2,[r10,r2,lsl#2]	@ Td0[s2>>24]
+	and	r7,lr,r3,lsr#16	@ i0
+	eor	r1,r1,r8,ror#24
+	and	r8,lr,r3,lsr#8	@ i1
+	eor	r6,r9,r6,ror#8
+	and	r9,lr,r3		@ i2
+	ldr	r7,[r10,r7,lsl#2]	@ Td1[s3>>16]
+	eor	r2,r2,r5,ror#8
+	ldr	r8,[r10,r8,lsl#2]	@ Td2[s3>>8]
+	mov	r3,r3,lsr#24
+
+	ldr	r9,[r10,r9,lsl#2]	@ Td3[s3>>0]
+	eor	r0,r0,r7,ror#8
+	ldr	r7,[r11],#16
+	eor	r1,r1,r8,ror#16
+	ldr	r3,[r10,r3,lsl#2]	@ Td0[s3>>24]
+	eor	r2,r2,r9,ror#24
+
+	ldr	r4,[r11,#-12]
+	eor	r0,r0,r7
+	ldr	r5,[r11,#-8]
+	eor	r3,r3,r6,ror#8
+	ldr	r6,[r11,#-4]
+	and	r7,lr,r0,lsr#16
+	eor	r1,r1,r4
+	and	r8,lr,r0,lsr#8
+	eor	r2,r2,r5
+	and	r9,lr,r0
+	eor	r3,r3,r6
+	mov	r0,r0,lsr#24
+
+	subs	r12,r12,#1
+	bne	.Ldec_loop
+
+	add	r10,r10,#1024
+
+	ldr	r5,[r10,#0]		@ prefetch Td4
+	ldr	r6,[r10,#32]
+	ldr	r4,[r10,#64]
+	ldr	r5,[r10,#96]
+	ldr	r6,[r10,#128]
+	ldr	r4,[r10,#160]
+	ldr	r5,[r10,#192]
+	ldr	r6,[r10,#224]
+
+	ldrb	r0,[r10,r0]		@ Td4[s0>>24]
+	ldrb	r4,[r10,r7]		@ Td4[s0>>16]
+	and	r7,lr,r1		@ i0
+	ldrb	r5,[r10,r8]		@ Td4[s0>>8]
+	and	r8,lr,r1,lsr#16
+	ldrb	r6,[r10,r9]		@ Td4[s0>>0]
+	and	r9,lr,r1,lsr#8
+
+	add	r1,r10,r1,lsr#24
+	ldrb	r7,[r10,r7]		@ Td4[s1>>0]
+	ldrb	r1,[r1]		@ Td4[s1>>24]
+	ldrb	r8,[r10,r8]		@ Td4[s1>>16]
+	eor	r0,r7,r0,lsl#24
+	ldrb	r9,[r10,r9]		@ Td4[s1>>8]
+	eor	r1,r4,r1,lsl#8
+	and	r7,lr,r2,lsr#8	@ i0
+	eor	r5,r5,r8,lsl#8
+	and	r8,lr,r2		@ i1
+	ldrb	r7,[r10,r7]		@ Td4[s2>>8]
+	eor	r6,r6,r9,lsl#8
+	ldrb	r8,[r10,r8]		@ Td4[s2>>0]
+	and	r9,lr,r2,lsr#16
+
+	add	r2,r10,r2,lsr#24
+	ldrb	r2,[r2]		@ Td4[s2>>24]
+	eor	r0,r0,r7,lsl#8
+	ldrb	r9,[r10,r9]		@ Td4[s2>>16]
+	eor	r1,r8,r1,lsl#16
+	and	r7,lr,r3,lsr#16	@ i0
+	eor	r2,r5,r2,lsl#16
+	and	r8,lr,r3,lsr#8	@ i1
+	ldrb	r7,[r10,r7]		@ Td4[s3>>16]
+	eor	r6,r6,r9,lsl#16
+	ldrb	r8,[r10,r8]		@ Td4[s3>>8]
+	and	r9,lr,r3		@ i2
+
+	add	r3,r10,r3,lsr#24
+	ldrb	r9,[r10,r9]		@ Td4[s3>>0]
+	ldrb	r3,[r3]		@ Td4[s3>>24]
+	eor	r0,r0,r7,lsl#16
+	ldr	r7,[r11,#0]
+	eor	r1,r1,r8,lsl#8
+	ldr	r4,[r11,#4]
+	eor	r2,r9,r2,lsl#8
+	ldr	r5,[r11,#8]
+	eor	r3,r6,r3,lsl#24
+	ldr	r6,[r11,#12]
+
+	eor	r0,r0,r7
+	eor	r1,r1,r4
+	eor	r2,r2,r5
+	eor	r3,r3,r6
+
+	sub	r10,r10,#1024
+	ldr	pc,[sp],#4		@ pop and return
+.size	_armv4_AES_decrypt,.-_armv4_AES_decrypt
+.byte	65,69,83,32,102,111,114,32,65,82,77,118,52,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0
+.align	2
+.align	2
+
+#endif
+#endif
\ No newline at end of file
diff --git a/third_party/boringssl/linux-arm/crypto/aes/aesv8-armx32.S b/third_party/boringssl/linux-arm/crypto/aes/aesv8-armx32.S
new file mode 100644
index 0000000..6f0ee7d
--- /dev/null
+++ b/third_party/boringssl/linux-arm/crypto/aes/aesv8-armx32.S
@@ -0,0 +1,756 @@
+#if defined(__arm__)
+#include "arm_arch.h"
+
+#if __ARM_MAX_ARCH__>=7
+.text
+.arch	armv7-a
+.fpu	neon
+.code	32
+.align	5
+.Lrcon:
+.long	0x01,0x01,0x01,0x01
+.long	0x0c0f0e0d,0x0c0f0e0d,0x0c0f0e0d,0x0c0f0e0d	@ rotate-n-splat
+.long	0x1b,0x1b,0x1b,0x1b
+
+.globl	aes_v8_set_encrypt_key
+.type	aes_v8_set_encrypt_key,%function
+.align	5
+aes_v8_set_encrypt_key:
+.Lenc_key:
+	mov	r3,#-1
+	cmp	r0,#0
+	beq	.Lenc_key_abort
+	cmp	r2,#0
+	beq	.Lenc_key_abort
+	mov	r3,#-2
+	cmp	r1,#128
+	blt	.Lenc_key_abort
+	cmp	r1,#256
+	bgt	.Lenc_key_abort
+	tst	r1,#0x3f
+	bne	.Lenc_key_abort
+
+	adr	r3,.Lrcon
+	cmp	r1,#192
+
+	veor	q0,q0,q0
+	vld1.8	{q3},[r0]!
+	mov	r1,#8		@ reuse r1
+	vld1.32	{q1,q2},[r3]!
+
+	blt	.Loop128
+	beq	.L192
+	b	.L256
+
+.align	4
+.Loop128:
+	vtbl.8	d20,{q3},d4
+	vtbl.8	d21,{q3},d5
+	vext.8	q9,q0,q3,#12
+	vst1.32	{q3},[r2]!
+.byte	0x00,0x43,0xf0,0xf3	@ aese q10,q0
+	subs	r1,r1,#1
+
+	veor	q3,q3,q9
+	vext.8	q9,q0,q9,#12
+	veor	q3,q3,q9
+	vext.8	q9,q0,q9,#12
+	veor	q10,q10,q1
+	veor	q3,q3,q9
+	vshl.u8	q1,q1,#1
+	veor	q3,q3,q10
+	bne	.Loop128
+
+	vld1.32	{q1},[r3]
+
+	vtbl.8	d20,{q3},d4
+	vtbl.8	d21,{q3},d5
+	vext.8	q9,q0,q3,#12
+	vst1.32	{q3},[r2]!
+.byte	0x00,0x43,0xf0,0xf3	@ aese q10,q0
+
+	veor	q3,q3,q9
+	vext.8	q9,q0,q9,#12
+	veor	q3,q3,q9
+	vext.8	q9,q0,q9,#12
+	veor	q10,q10,q1
+	veor	q3,q3,q9
+	vshl.u8	q1,q1,#1
+	veor	q3,q3,q10
+
+	vtbl.8	d20,{q3},d4
+	vtbl.8	d21,{q3},d5
+	vext.8	q9,q0,q3,#12
+	vst1.32	{q3},[r2]!
+.byte	0x00,0x43,0xf0,0xf3	@ aese q10,q0
+
+	veor	q3,q3,q9
+	vext.8	q9,q0,q9,#12
+	veor	q3,q3,q9
+	vext.8	q9,q0,q9,#12
+	veor	q10,q10,q1
+	veor	q3,q3,q9
+	veor	q3,q3,q10
+	vst1.32	{q3},[r2]
+	add	r2,r2,#0x50
+
+	mov	r12,#10
+	b	.Ldone
+
+.align	4
+.L192:
+	vld1.8	{d16},[r0]!
+	vmov.i8	q10,#8			@ borrow q10
+	vst1.32	{q3},[r2]!
+	vsub.i8	q2,q2,q10	@ adjust the mask
+
+.Loop192:
+	vtbl.8	d20,{q8},d4
+	vtbl.8	d21,{q8},d5
+	vext.8	q9,q0,q3,#12
+	vst1.32	{d16},[r2]!
+.byte	0x00,0x43,0xf0,0xf3	@ aese q10,q0
+	subs	r1,r1,#1
+
+	veor	q3,q3,q9
+	vext.8	q9,q0,q9,#12
+	veor	q3,q3,q9
+	vext.8	q9,q0,q9,#12
+	veor	q3,q3,q9
+
+	vdup.32	q9,d7[1]
+	veor	q9,q9,q8
+	veor	q10,q10,q1
+	vext.8	q8,q0,q8,#12
+	vshl.u8	q1,q1,#1
+	veor	q8,q8,q9
+	veor	q3,q3,q10
+	veor	q8,q8,q10
+	vst1.32	{q3},[r2]!
+	bne	.Loop192
+
+	mov	r12,#12
+	add	r2,r2,#0x20
+	b	.Ldone
+
+.align	4
+.L256:
+	vld1.8	{q8},[r0]
+	mov	r1,#7
+	mov	r12,#14
+	vst1.32	{q3},[r2]!
+
+.Loop256:
+	vtbl.8	d20,{q8},d4
+	vtbl.8	d21,{q8},d5
+	vext.8	q9,q0,q3,#12
+	vst1.32	{q8},[r2]!
+.byte	0x00,0x43,0xf0,0xf3	@ aese q10,q0
+	subs	r1,r1,#1
+
+	veor	q3,q3,q9
+	vext.8	q9,q0,q9,#12
+	veor	q3,q3,q9
+	vext.8	q9,q0,q9,#12
+	veor	q10,q10,q1
+	veor	q3,q3,q9
+	vshl.u8	q1,q1,#1
+	veor	q3,q3,q10
+	vst1.32	{q3},[r2]!
+	beq	.Ldone
+
+	vdup.32	q10,d7[1]
+	vext.8	q9,q0,q8,#12
+.byte	0x00,0x43,0xf0,0xf3	@ aese q10,q0
+
+	veor	q8,q8,q9
+	vext.8	q9,q0,q9,#12
+	veor	q8,q8,q9
+	vext.8	q9,q0,q9,#12
+	veor	q8,q8,q9
+
+	veor	q8,q8,q10
+	b	.Loop256
+
+.Ldone:
+	str	r12,[r2]
+	mov	r3,#0
+
+.Lenc_key_abort:
+	mov	r0,r3			@ return value
+
+	bx	lr
+.size	aes_v8_set_encrypt_key,.-aes_v8_set_encrypt_key
+
+.globl	aes_v8_set_decrypt_key
+.type	aes_v8_set_decrypt_key,%function
+.align	5
+aes_v8_set_decrypt_key:
+	stmdb	sp!,{r4,lr}
+	bl	.Lenc_key
+
+	cmp	r0,#0
+	bne	.Ldec_key_abort
+
+	sub	r2,r2,#240		@ restore original r2
+	mov	r4,#-16
+	add	r0,r2,r12,lsl#4	@ end of key schedule
+
+	vld1.32	{q0},[r2]
+	vld1.32	{q1},[r0]
+	vst1.32	{q0},[r0],r4
+	vst1.32	{q1},[r2]!
+
+.Loop_imc:
+	vld1.32	{q0},[r2]
+	vld1.32	{q1},[r0]
+.byte	0xc0,0x03,0xb0,0xf3	@ aesimc q0,q0
+.byte	0xc2,0x23,0xb0,0xf3	@ aesimc q1,q1
+	vst1.32	{q0},[r0],r4
+	vst1.32	{q1},[r2]!
+	cmp	r0,r2
+	bhi	.Loop_imc
+
+	vld1.32	{q0},[r2]
+.byte	0xc0,0x03,0xb0,0xf3	@ aesimc q0,q0
+	vst1.32	{q0},[r0]
+
+	eor	r0,r0,r0		@ return value
+.Ldec_key_abort:
+	ldmia	sp!,{r4,pc}
+.size	aes_v8_set_decrypt_key,.-aes_v8_set_decrypt_key
+.globl	aes_v8_encrypt
+.type	aes_v8_encrypt,%function
+.align	5
+aes_v8_encrypt:
+	ldr	r3,[r2,#240]
+	vld1.32	{q0},[r2]!
+	vld1.8	{q2},[r0]
+	sub	r3,r3,#2
+	vld1.32	{q1},[r2]!
+
+.Loop_enc:
+.byte	0x00,0x43,0xb0,0xf3	@ aese q2,q0
+.byte	0x84,0x43,0xb0,0xf3	@ aesmc q2,q2
+	vld1.32	{q0},[r2]!
+	subs	r3,r3,#2
+.byte	0x02,0x43,0xb0,0xf3	@ aese q2,q1
+.byte	0x84,0x43,0xb0,0xf3	@ aesmc q2,q2
+	vld1.32	{q1},[r2]!
+	bgt	.Loop_enc
+
+.byte	0x00,0x43,0xb0,0xf3	@ aese q2,q0
+.byte	0x84,0x43,0xb0,0xf3	@ aesmc q2,q2
+	vld1.32	{q0},[r2]
+.byte	0x02,0x43,0xb0,0xf3	@ aese q2,q1
+	veor	q2,q2,q0
+
+	vst1.8	{q2},[r1]
+	bx	lr
+.size	aes_v8_encrypt,.-aes_v8_encrypt
+.globl	aes_v8_decrypt
+.type	aes_v8_decrypt,%function
+.align	5
+aes_v8_decrypt:
+	ldr	r3,[r2,#240]
+	vld1.32	{q0},[r2]!
+	vld1.8	{q2},[r0]
+	sub	r3,r3,#2
+	vld1.32	{q1},[r2]!
+
+.Loop_dec:
+.byte	0x40,0x43,0xb0,0xf3	@ aesd q2,q0
+.byte	0xc4,0x43,0xb0,0xf3	@ aesimc q2,q2
+	vld1.32	{q0},[r2]!
+	subs	r3,r3,#2
+.byte	0x42,0x43,0xb0,0xf3	@ aesd q2,q1
+.byte	0xc4,0x43,0xb0,0xf3	@ aesimc q2,q2
+	vld1.32	{q1},[r2]!
+	bgt	.Loop_dec
+
+.byte	0x40,0x43,0xb0,0xf3	@ aesd q2,q0
+.byte	0xc4,0x43,0xb0,0xf3	@ aesimc q2,q2
+	vld1.32	{q0},[r2]
+.byte	0x42,0x43,0xb0,0xf3	@ aesd q2,q1
+	veor	q2,q2,q0
+
+	vst1.8	{q2},[r1]
+	bx	lr
+.size	aes_v8_decrypt,.-aes_v8_decrypt
+.globl	aes_v8_cbc_encrypt
+.type	aes_v8_cbc_encrypt,%function
+.align	5
+aes_v8_cbc_encrypt:
+	mov	ip,sp
+	stmdb	sp!,{r4,r5,r6,r7,r8,lr}
+	vstmdb	sp!,{d8,d9,d10,d11,d12,d13,d14,d15}            @ ABI specification says so
+	ldmia	ip,{r4,r5}		@ load remaining args
+	subs	r2,r2,#16
+	mov	r8,#16
+	blo	.Lcbc_abort
+	moveq	r8,#0
+
+	cmp	r5,#0			@ en- or decrypting?
+	ldr	r5,[r3,#240]
+	and	r2,r2,#-16
+	vld1.8	{q6},[r4]
+	vld1.8	{q0},[r0],r8
+
+	vld1.32	{q8,q9},[r3]		@ load key schedule...
+	sub	r5,r5,#6
+	add	r7,r3,r5,lsl#4	@ pointer to last 7 round keys
+	sub	r5,r5,#2
+	vld1.32	{q10,q11},[r7]!
+	vld1.32	{q12,q13},[r7]!
+	vld1.32	{q14,q15},[r7]!
+	vld1.32	{q7},[r7]
+
+	add	r7,r3,#32
+	mov	r6,r5
+	beq	.Lcbc_dec
+
+	cmp	r5,#2
+	veor	q0,q0,q6
+	veor	q5,q8,q7
+	beq	.Lcbc_enc128
+
+	vld1.32	{q2,q3},[r7]
+	add	r7,r3,#16
+	add	r6,r3,#16*4
+	add	r12,r3,#16*5
+.byte	0x20,0x03,0xb0,0xf3	@ aese q0,q8
+.byte	0x80,0x03,0xb0,0xf3	@ aesmc q0,q0
+	add	r14,r3,#16*6
+	add	r3,r3,#16*7
+	b	.Lenter_cbc_enc
+
+.align	4
+.Loop_cbc_enc:
+.byte	0x20,0x03,0xb0,0xf3	@ aese q0,q8
+.byte	0x80,0x03,0xb0,0xf3	@ aesmc q0,q0
+	vst1.8	{q6},[r1]!
+.Lenter_cbc_enc:
+.byte	0x22,0x03,0xb0,0xf3	@ aese q0,q9
+.byte	0x80,0x03,0xb0,0xf3	@ aesmc q0,q0
+.byte	0x04,0x03,0xb0,0xf3	@ aese q0,q2
+.byte	0x80,0x03,0xb0,0xf3	@ aesmc q0,q0
+	vld1.32	{q8},[r6]
+	cmp	r5,#4
+.byte	0x06,0x03,0xb0,0xf3	@ aese q0,q3
+.byte	0x80,0x03,0xb0,0xf3	@ aesmc q0,q0
+	vld1.32	{q9},[r12]
+	beq	.Lcbc_enc192
+
+.byte	0x20,0x03,0xb0,0xf3	@ aese q0,q8
+.byte	0x80,0x03,0xb0,0xf3	@ aesmc q0,q0
+	vld1.32	{q8},[r14]
+.byte	0x22,0x03,0xb0,0xf3	@ aese q0,q9
+.byte	0x80,0x03,0xb0,0xf3	@ aesmc q0,q0
+	vld1.32	{q9},[r3]
+	nop
+
+.Lcbc_enc192:
+.byte	0x20,0x03,0xb0,0xf3	@ aese q0,q8
+.byte	0x80,0x03,0xb0,0xf3	@ aesmc q0,q0
+	subs	r2,r2,#16
+.byte	0x22,0x03,0xb0,0xf3	@ aese q0,q9
+.byte	0x80,0x03,0xb0,0xf3	@ aesmc q0,q0
+	moveq	r8,#0
+.byte	0x24,0x03,0xb0,0xf3	@ aese q0,q10
+.byte	0x80,0x03,0xb0,0xf3	@ aesmc q0,q0
+.byte	0x26,0x03,0xb0,0xf3	@ aese q0,q11
+.byte	0x80,0x03,0xb0,0xf3	@ aesmc q0,q0
+	vld1.8	{q8},[r0],r8
+.byte	0x28,0x03,0xb0,0xf3	@ aese q0,q12
+.byte	0x80,0x03,0xb0,0xf3	@ aesmc q0,q0
+	veor	q8,q8,q5
+.byte	0x2a,0x03,0xb0,0xf3	@ aese q0,q13
+.byte	0x80,0x03,0xb0,0xf3	@ aesmc q0,q0
+	vld1.32	{q9},[r7]		@ re-pre-load rndkey[1]
+.byte	0x2c,0x03,0xb0,0xf3	@ aese q0,q14
+.byte	0x80,0x03,0xb0,0xf3	@ aesmc q0,q0
+.byte	0x2e,0x03,0xb0,0xf3	@ aese q0,q15
+	veor	q6,q0,q7
+	bhs	.Loop_cbc_enc
+
+	vst1.8	{q6},[r1]!
+	b	.Lcbc_done
+
+.align	5
+.Lcbc_enc128:
+	vld1.32	{q2,q3},[r7]
+.byte	0x20,0x03,0xb0,0xf3	@ aese q0,q8
+.byte	0x80,0x03,0xb0,0xf3	@ aesmc q0,q0
+	b	.Lenter_cbc_enc128
+.Loop_cbc_enc128:
+.byte	0x20,0x03,0xb0,0xf3	@ aese q0,q8
+.byte	0x80,0x03,0xb0,0xf3	@ aesmc q0,q0
+	vst1.8	{q6},[r1]!
+.Lenter_cbc_enc128:
+.byte	0x22,0x03,0xb0,0xf3	@ aese q0,q9
+.byte	0x80,0x03,0xb0,0xf3	@ aesmc q0,q0
+	subs	r2,r2,#16
+.byte	0x04,0x03,0xb0,0xf3	@ aese q0,q2
+.byte	0x80,0x03,0xb0,0xf3	@ aesmc q0,q0
+	moveq	r8,#0
+.byte	0x06,0x03,0xb0,0xf3	@ aese q0,q3
+.byte	0x80,0x03,0xb0,0xf3	@ aesmc q0,q0
+.byte	0x24,0x03,0xb0,0xf3	@ aese q0,q10
+.byte	0x80,0x03,0xb0,0xf3	@ aesmc q0,q0
+.byte	0x26,0x03,0xb0,0xf3	@ aese q0,q11
+.byte	0x80,0x03,0xb0,0xf3	@ aesmc q0,q0
+	vld1.8	{q8},[r0],r8
+.byte	0x28,0x03,0xb0,0xf3	@ aese q0,q12
+.byte	0x80,0x03,0xb0,0xf3	@ aesmc q0,q0
+.byte	0x2a,0x03,0xb0,0xf3	@ aese q0,q13
+.byte	0x80,0x03,0xb0,0xf3	@ aesmc q0,q0
+.byte	0x2c,0x03,0xb0,0xf3	@ aese q0,q14
+.byte	0x80,0x03,0xb0,0xf3	@ aesmc q0,q0
+	veor	q8,q8,q5
+.byte	0x2e,0x03,0xb0,0xf3	@ aese q0,q15
+	veor	q6,q0,q7
+	bhs	.Loop_cbc_enc128
+
+	vst1.8	{q6},[r1]!
+	b	.Lcbc_done
+.align	5
+.Lcbc_dec:
+	vld1.8	{q10},[r0]!
+	subs	r2,r2,#32		@ bias
+	add	r6,r5,#2
+	vorr	q3,q0,q0
+	vorr	q1,q0,q0
+	vorr	q11,q10,q10
+	blo	.Lcbc_dec_tail
+
+	vorr	q1,q10,q10
+	vld1.8	{q10},[r0]!
+	vorr	q2,q0,q0
+	vorr	q3,q1,q1
+	vorr	q11,q10,q10
+
+.Loop3x_cbc_dec:
+.byte	0x60,0x03,0xb0,0xf3	@ aesd q0,q8
+.byte	0xc0,0x03,0xb0,0xf3	@ aesimc q0,q0
+.byte	0x60,0x23,0xb0,0xf3	@ aesd q1,q8
+.byte	0xc2,0x23,0xb0,0xf3	@ aesimc q1,q1
+.byte	0x60,0x43,0xf0,0xf3	@ aesd q10,q8
+.byte	0xe4,0x43,0xf0,0xf3	@ aesimc q10,q10
+	vld1.32	{q8},[r7]!
+	subs	r6,r6,#2
+.byte	0x62,0x03,0xb0,0xf3	@ aesd q0,q9
+.byte	0xc0,0x03,0xb0,0xf3	@ aesimc q0,q0
+.byte	0x62,0x23,0xb0,0xf3	@ aesd q1,q9
+.byte	0xc2,0x23,0xb0,0xf3	@ aesimc q1,q1
+.byte	0x62,0x43,0xf0,0xf3	@ aesd q10,q9
+.byte	0xe4,0x43,0xf0,0xf3	@ aesimc q10,q10
+	vld1.32	{q9},[r7]!
+	bgt	.Loop3x_cbc_dec
+
+.byte	0x60,0x03,0xb0,0xf3	@ aesd q0,q8
+.byte	0xc0,0x03,0xb0,0xf3	@ aesimc q0,q0
+.byte	0x60,0x23,0xb0,0xf3	@ aesd q1,q8
+.byte	0xc2,0x23,0xb0,0xf3	@ aesimc q1,q1
+.byte	0x60,0x43,0xf0,0xf3	@ aesd q10,q8
+.byte	0xe4,0x43,0xf0,0xf3	@ aesimc q10,q10
+	veor	q4,q6,q7
+	subs	r2,r2,#0x30
+	veor	q5,q2,q7
+	movlo	r6,r2			@ r6, r6, is zero at this point
+.byte	0x62,0x03,0xb0,0xf3	@ aesd q0,q9
+.byte	0xc0,0x03,0xb0,0xf3	@ aesimc q0,q0
+.byte	0x62,0x23,0xb0,0xf3	@ aesd q1,q9
+.byte	0xc2,0x23,0xb0,0xf3	@ aesimc q1,q1
+.byte	0x62,0x43,0xf0,0xf3	@ aesd q10,q9
+.byte	0xe4,0x43,0xf0,0xf3	@ aesimc q10,q10
+	veor	q9,q3,q7
+	add	r0,r0,r6		@ r0 is adjusted in such way that
+					@ at exit from the loop q1-q10
+					@ are loaded with last "words"
+	vorr	q6,q11,q11
+	mov	r7,r3
+.byte	0x68,0x03,0xb0,0xf3	@ aesd q0,q12
+.byte	0xc0,0x03,0xb0,0xf3	@ aesimc q0,q0
+.byte	0x68,0x23,0xb0,0xf3	@ aesd q1,q12
+.byte	0xc2,0x23,0xb0,0xf3	@ aesimc q1,q1
+.byte	0x68,0x43,0xf0,0xf3	@ aesd q10,q12
+.byte	0xe4,0x43,0xf0,0xf3	@ aesimc q10,q10
+	vld1.8	{q2},[r0]!
+.byte	0x6a,0x03,0xb0,0xf3	@ aesd q0,q13
+.byte	0xc0,0x03,0xb0,0xf3	@ aesimc q0,q0
+.byte	0x6a,0x23,0xb0,0xf3	@ aesd q1,q13
+.byte	0xc2,0x23,0xb0,0xf3	@ aesimc q1,q1
+.byte	0x6a,0x43,0xf0,0xf3	@ aesd q10,q13
+.byte	0xe4,0x43,0xf0,0xf3	@ aesimc q10,q10
+	vld1.8	{q3},[r0]!
+.byte	0x6c,0x03,0xb0,0xf3	@ aesd q0,q14
+.byte	0xc0,0x03,0xb0,0xf3	@ aesimc q0,q0
+.byte	0x6c,0x23,0xb0,0xf3	@ aesd q1,q14
+.byte	0xc2,0x23,0xb0,0xf3	@ aesimc q1,q1
+.byte	0x6c,0x43,0xf0,0xf3	@ aesd q10,q14
+.byte	0xe4,0x43,0xf0,0xf3	@ aesimc q10,q10
+	vld1.8	{q11},[r0]!
+.byte	0x6e,0x03,0xb0,0xf3	@ aesd q0,q15
+.byte	0x6e,0x23,0xb0,0xf3	@ aesd q1,q15
+.byte	0x6e,0x43,0xf0,0xf3	@ aesd q10,q15
+	vld1.32	{q8},[r7]!	@ re-pre-load rndkey[0]
+	add	r6,r5,#2
+	veor	q4,q4,q0
+	veor	q5,q5,q1
+	veor	q10,q10,q9
+	vld1.32	{q9},[r7]!	@ re-pre-load rndkey[1]
+	vst1.8	{q4},[r1]!
+	vorr	q0,q2,q2
+	vst1.8	{q5},[r1]!
+	vorr	q1,q3,q3
+	vst1.8	{q10},[r1]!
+	vorr	q10,q11,q11
+	bhs	.Loop3x_cbc_dec
+
+	cmn	r2,#0x30
+	beq	.Lcbc_done
+	nop
+
+.Lcbc_dec_tail:
+.byte	0x60,0x23,0xb0,0xf3	@ aesd q1,q8
+.byte	0xc2,0x23,0xb0,0xf3	@ aesimc q1,q1
+.byte	0x60,0x43,0xf0,0xf3	@ aesd q10,q8
+.byte	0xe4,0x43,0xf0,0xf3	@ aesimc q10,q10
+	vld1.32	{q8},[r7]!
+	subs	r6,r6,#2
+.byte	0x62,0x23,0xb0,0xf3	@ aesd q1,q9
+.byte	0xc2,0x23,0xb0,0xf3	@ aesimc q1,q1
+.byte	0x62,0x43,0xf0,0xf3	@ aesd q10,q9
+.byte	0xe4,0x43,0xf0,0xf3	@ aesimc q10,q10
+	vld1.32	{q9},[r7]!
+	bgt	.Lcbc_dec_tail
+
+.byte	0x60,0x23,0xb0,0xf3	@ aesd q1,q8
+.byte	0xc2,0x23,0xb0,0xf3	@ aesimc q1,q1
+.byte	0x60,0x43,0xf0,0xf3	@ aesd q10,q8
+.byte	0xe4,0x43,0xf0,0xf3	@ aesimc q10,q10
+.byte	0x62,0x23,0xb0,0xf3	@ aesd q1,q9
+.byte	0xc2,0x23,0xb0,0xf3	@ aesimc q1,q1
+.byte	0x62,0x43,0xf0,0xf3	@ aesd q10,q9
+.byte	0xe4,0x43,0xf0,0xf3	@ aesimc q10,q10
+.byte	0x68,0x23,0xb0,0xf3	@ aesd q1,q12
+.byte	0xc2,0x23,0xb0,0xf3	@ aesimc q1,q1
+.byte	0x68,0x43,0xf0,0xf3	@ aesd q10,q12
+.byte	0xe4,0x43,0xf0,0xf3	@ aesimc q10,q10
+	cmn	r2,#0x20
+.byte	0x6a,0x23,0xb0,0xf3	@ aesd q1,q13
+.byte	0xc2,0x23,0xb0,0xf3	@ aesimc q1,q1
+.byte	0x6a,0x43,0xf0,0xf3	@ aesd q10,q13
+.byte	0xe4,0x43,0xf0,0xf3	@ aesimc q10,q10
+	veor	q5,q6,q7
+.byte	0x6c,0x23,0xb0,0xf3	@ aesd q1,q14
+.byte	0xc2,0x23,0xb0,0xf3	@ aesimc q1,q1
+.byte	0x6c,0x43,0xf0,0xf3	@ aesd q10,q14
+.byte	0xe4,0x43,0xf0,0xf3	@ aesimc q10,q10
+	veor	q9,q3,q7
+.byte	0x6e,0x23,0xb0,0xf3	@ aesd q1,q15
+.byte	0x6e,0x43,0xf0,0xf3	@ aesd q10,q15
+	beq	.Lcbc_dec_one
+	veor	q5,q5,q1
+	veor	q9,q9,q10
+	vorr	q6,q11,q11
+	vst1.8	{q5},[r1]!
+	vst1.8	{q9},[r1]!
+	b	.Lcbc_done
+
+.Lcbc_dec_one:
+	veor	q5,q5,q10
+	vorr	q6,q11,q11
+	vst1.8	{q5},[r1]!
+
+.Lcbc_done:
+	vst1.8	{q6},[r4]
+.Lcbc_abort:
+	vldmia	sp!,{d8,d9,d10,d11,d12,d13,d14,d15}
+	ldmia	sp!,{r4,r5,r6,r7,r8,pc}
+.size	aes_v8_cbc_encrypt,.-aes_v8_cbc_encrypt
+.globl	aes_v8_ctr32_encrypt_blocks
+.type	aes_v8_ctr32_encrypt_blocks,%function
+.align	5
+aes_v8_ctr32_encrypt_blocks:
+	mov	ip,sp
+	stmdb	sp!,{r4,r5,r6,r7,r8,r9,r10,lr}
+	vstmdb	sp!,{d8,d9,d10,d11,d12,d13,d14,d15}            @ ABI specification says so
+	ldr	r4, [ip]		@ load remaining arg
+	ldr	r5,[r3,#240]
+
+	ldr	r8, [r4, #12]
+	vld1.32	{q0},[r4]
+
+	vld1.32	{q8,q9},[r3]		@ load key schedule...
+	sub	r5,r5,#4
+	mov	r12,#16
+	cmp	r2,#2
+	add	r7,r3,r5,lsl#4	@ pointer to last 5 round keys
+	sub	r5,r5,#2
+	vld1.32	{q12,q13},[r7]!
+	vld1.32	{q14,q15},[r7]!
+	vld1.32	{q7},[r7]
+	add	r7,r3,#32
+	mov	r6,r5
+	movlo	r12,#0
+#ifndef __ARMEB__
+	rev	r8, r8
+#endif
+	vorr	q1,q0,q0
+	add	r10, r8, #1
+	vorr	q10,q0,q0
+	add	r8, r8, #2
+	vorr	q6,q0,q0
+	rev	r10, r10
+	vmov.32	d3[1],r10
+	bls	.Lctr32_tail
+	rev	r12, r8
+	sub	r2,r2,#3		@ bias
+	vmov.32	d21[1],r12
+	b	.Loop3x_ctr32
+
+.align	4
+.Loop3x_ctr32:
+.byte	0x20,0x03,0xb0,0xf3	@ aese q0,q8
+.byte	0x80,0x03,0xb0,0xf3	@ aesmc q0,q0
+.byte	0x20,0x23,0xb0,0xf3	@ aese q1,q8
+.byte	0x82,0x23,0xb0,0xf3	@ aesmc q1,q1
+.byte	0x20,0x43,0xf0,0xf3	@ aese q10,q8
+.byte	0xa4,0x43,0xf0,0xf3	@ aesmc q10,q10
+	vld1.32	{q8},[r7]!
+	subs	r6,r6,#2
+.byte	0x22,0x03,0xb0,0xf3	@ aese q0,q9
+.byte	0x80,0x03,0xb0,0xf3	@ aesmc q0,q0
+.byte	0x22,0x23,0xb0,0xf3	@ aese q1,q9
+.byte	0x82,0x23,0xb0,0xf3	@ aesmc q1,q1
+.byte	0x22,0x43,0xf0,0xf3	@ aese q10,q9
+.byte	0xa4,0x43,0xf0,0xf3	@ aesmc q10,q10
+	vld1.32	{q9},[r7]!
+	bgt	.Loop3x_ctr32
+
+.byte	0x20,0x03,0xb0,0xf3	@ aese q0,q8
+.byte	0x80,0x83,0xb0,0xf3	@ aesmc q4,q0
+.byte	0x20,0x23,0xb0,0xf3	@ aese q1,q8
+.byte	0x82,0xa3,0xb0,0xf3	@ aesmc q5,q1
+	vld1.8	{q2},[r0]!
+	vorr	q0,q6,q6
+.byte	0x20,0x43,0xf0,0xf3	@ aese q10,q8
+.byte	0xa4,0x43,0xf0,0xf3	@ aesmc q10,q10
+	vld1.8	{q3},[r0]!
+	vorr	q1,q6,q6
+.byte	0x22,0x83,0xb0,0xf3	@ aese q4,q9
+.byte	0x88,0x83,0xb0,0xf3	@ aesmc q4,q4
+.byte	0x22,0xa3,0xb0,0xf3	@ aese q5,q9
+.byte	0x8a,0xa3,0xb0,0xf3	@ aesmc q5,q5
+	vld1.8	{q11},[r0]!
+	mov	r7,r3
+.byte	0x22,0x43,0xf0,0xf3	@ aese q10,q9
+.byte	0xa4,0x23,0xf0,0xf3	@ aesmc q9,q10
+	vorr	q10,q6,q6
+	add	r9,r8,#1
+.byte	0x28,0x83,0xb0,0xf3	@ aese q4,q12
+.byte	0x88,0x83,0xb0,0xf3	@ aesmc q4,q4
+.byte	0x28,0xa3,0xb0,0xf3	@ aese q5,q12
+.byte	0x8a,0xa3,0xb0,0xf3	@ aesmc q5,q5
+	veor	q2,q2,q7
+	add	r10,r8,#2
+.byte	0x28,0x23,0xf0,0xf3	@ aese q9,q12
+.byte	0xa2,0x23,0xf0,0xf3	@ aesmc q9,q9
+	veor	q3,q3,q7
+	add	r8,r8,#3
+.byte	0x2a,0x83,0xb0,0xf3	@ aese q4,q13
+.byte	0x88,0x83,0xb0,0xf3	@ aesmc q4,q4
+.byte	0x2a,0xa3,0xb0,0xf3	@ aese q5,q13
+.byte	0x8a,0xa3,0xb0,0xf3	@ aesmc q5,q5
+	veor	q11,q11,q7
+	rev	r9,r9
+.byte	0x2a,0x23,0xf0,0xf3	@ aese q9,q13
+.byte	0xa2,0x23,0xf0,0xf3	@ aesmc q9,q9
+	vmov.32	d1[1], r9
+	rev	r10,r10
+.byte	0x2c,0x83,0xb0,0xf3	@ aese q4,q14
+.byte	0x88,0x83,0xb0,0xf3	@ aesmc q4,q4
+.byte	0x2c,0xa3,0xb0,0xf3	@ aese q5,q14
+.byte	0x8a,0xa3,0xb0,0xf3	@ aesmc q5,q5
+	vmov.32	d3[1], r10
+	rev	r12,r8
+.byte	0x2c,0x23,0xf0,0xf3	@ aese q9,q14
+.byte	0xa2,0x23,0xf0,0xf3	@ aesmc q9,q9
+	vmov.32	d21[1], r12
+	subs	r2,r2,#3
+.byte	0x2e,0x83,0xb0,0xf3	@ aese q4,q15
+.byte	0x2e,0xa3,0xb0,0xf3	@ aese q5,q15
+.byte	0x2e,0x23,0xf0,0xf3	@ aese q9,q15
+
+	veor	q2,q2,q4
+	vld1.32	{q8},[r7]!	@ re-pre-load rndkey[0]
+	vst1.8	{q2},[r1]!
+	veor	q3,q3,q5
+	mov	r6,r5
+	vst1.8	{q3},[r1]!
+	veor	q11,q11,q9
+	vld1.32	{q9},[r7]!	@ re-pre-load rndkey[1]
+	vst1.8	{q11},[r1]!
+	bhs	.Loop3x_ctr32
+
+	adds	r2,r2,#3
+	beq	.Lctr32_done
+	cmp	r2,#1
+	mov	r12,#16
+	moveq	r12,#0
+
+.Lctr32_tail:
+.byte	0x20,0x03,0xb0,0xf3	@ aese q0,q8
+.byte	0x80,0x03,0xb0,0xf3	@ aesmc q0,q0
+.byte	0x20,0x23,0xb0,0xf3	@ aese q1,q8
+.byte	0x82,0x23,0xb0,0xf3	@ aesmc q1,q1
+	vld1.32	{q8},[r7]!
+	subs	r6,r6,#2
+.byte	0x22,0x03,0xb0,0xf3	@ aese q0,q9
+.byte	0x80,0x03,0xb0,0xf3	@ aesmc q0,q0
+.byte	0x22,0x23,0xb0,0xf3	@ aese q1,q9
+.byte	0x82,0x23,0xb0,0xf3	@ aesmc q1,q1
+	vld1.32	{q9},[r7]!
+	bgt	.Lctr32_tail
+
+.byte	0x20,0x03,0xb0,0xf3	@ aese q0,q8
+.byte	0x80,0x03,0xb0,0xf3	@ aesmc q0,q0
+.byte	0x20,0x23,0xb0,0xf3	@ aese q1,q8
+.byte	0x82,0x23,0xb0,0xf3	@ aesmc q1,q1
+.byte	0x22,0x03,0xb0,0xf3	@ aese q0,q9
+.byte	0x80,0x03,0xb0,0xf3	@ aesmc q0,q0
+.byte	0x22,0x23,0xb0,0xf3	@ aese q1,q9
+.byte	0x82,0x23,0xb0,0xf3	@ aesmc q1,q1
+	vld1.8	{q2},[r0],r12
+.byte	0x28,0x03,0xb0,0xf3	@ aese q0,q12
+.byte	0x80,0x03,0xb0,0xf3	@ aesmc q0,q0
+.byte	0x28,0x23,0xb0,0xf3	@ aese q1,q12
+.byte	0x82,0x23,0xb0,0xf3	@ aesmc q1,q1
+	vld1.8	{q3},[r0]
+.byte	0x2a,0x03,0xb0,0xf3	@ aese q0,q13
+.byte	0x80,0x03,0xb0,0xf3	@ aesmc q0,q0
+.byte	0x2a,0x23,0xb0,0xf3	@ aese q1,q13
+.byte	0x82,0x23,0xb0,0xf3	@ aesmc q1,q1
+	veor	q2,q2,q7
+.byte	0x2c,0x03,0xb0,0xf3	@ aese q0,q14
+.byte	0x80,0x03,0xb0,0xf3	@ aesmc q0,q0
+.byte	0x2c,0x23,0xb0,0xf3	@ aese q1,q14
+.byte	0x82,0x23,0xb0,0xf3	@ aesmc q1,q1
+	veor	q3,q3,q7
+.byte	0x2e,0x03,0xb0,0xf3	@ aese q0,q15
+.byte	0x2e,0x23,0xb0,0xf3	@ aese q1,q15
+
+	cmp	r2,#1
+	veor	q2,q2,q0
+	veor	q3,q3,q1
+	vst1.8	{q2},[r1]!
+	beq	.Lctr32_done
+	vst1.8	{q3},[r1]
+
+.Lctr32_done:
+	vldmia	sp!,{d8,d9,d10,d11,d12,d13,d14,d15}
+	ldmia	sp!,{r4,r5,r6,r7,r8,r9,r10,pc}
+.size	aes_v8_ctr32_encrypt_blocks,.-aes_v8_ctr32_encrypt_blocks
+#endif
+#endif
\ No newline at end of file
diff --git a/third_party/boringssl/linux-arm/crypto/aes/bsaes-armv7.S b/third_party/boringssl/linux-arm/crypto/aes/bsaes-armv7.S
new file mode 100644
index 0000000..dd84f35
--- /dev/null
+++ b/third_party/boringssl/linux-arm/crypto/aes/bsaes-armv7.S
@@ -0,0 +1,2579 @@
+#if defined(__arm__)
+
+@ ====================================================================
+@ Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+@ project. The module is, however, dual licensed under OpenSSL and
+@ CRYPTOGAMS licenses depending on where you obtain it. For further
+@ details see http://www.openssl.org/~appro/cryptogams/.
+@
+@ Specific modes and adaptation for Linux kernel by Ard Biesheuvel
+@ <ard.biesheuvel@linaro.org>. Permission to use under GPL terms is
+@ granted.
+@ ====================================================================
+
+@ Bit-sliced AES for ARM NEON
+@
+@ February 2012.
+@
+@ This implementation is direct adaptation of bsaes-x86_64 module for
+@ ARM NEON. Except that this module is endian-neutral [in sense that
+@ it can be compiled for either endianness] by courtesy of vld1.8's
+@ neutrality. Initial version doesn't implement interface to OpenSSL,
+@ only low-level primitives and unsupported entry points, just enough
+@ to collect performance results, which for Cortex-A8 core are:
+@
+@ encrypt	19.5 cycles per byte processed with 128-bit key
+@ decrypt	22.1 cycles per byte processed with 128-bit key
+@ key conv.	440  cycles per 128-bit key/0.18 of 8x block
+@
+@ Snapdragon S4 encrypts byte in 17.6 cycles and decrypts in 19.7,
+@ which is [much] worse than anticipated (for further details see
+@ http://www.openssl.org/~appro/Snapdragon-S4.html).
+@
+@ Cortex-A15 manages in 14.2/16.1 cycles [when integer-only code
+@ manages in 20.0 cycles].
+@
+@ When comparing to x86_64 results keep in mind that NEON unit is
+@ [mostly] single-issue and thus can't [fully] benefit from
+@ instruction-level parallelism. And when comparing to aes-armv4
+@ results keep in mind key schedule conversion overhead (see
+@ bsaes-x86_64.pl for further details)...
+@
+@						<appro@openssl.org>
+
+@ April-August 2013
+@
+@ Add CBC, CTR and XTS subroutines, adapt for kernel use.
+@
+@					<ard.biesheuvel@linaro.org>
+
+#if defined(__arm__)
+#ifndef __KERNEL__
+# include "arm_arch.h"
+
+# define VFP_ABI_PUSH	vstmdb	sp!,{d8-d15}
+# define VFP_ABI_POP	vldmia	sp!,{d8-d15}
+# define VFP_ABI_FRAME	0x40
+#else
+# define VFP_ABI_PUSH
+# define VFP_ABI_POP
+# define VFP_ABI_FRAME	0
+# define BSAES_ASM_EXTENDED_KEY
+# define XTS_CHAIN_TWEAK
+# define __ARM_ARCH__ __LINUX_ARM_ARCH__
+# define __ARM_MAX_ARCH__ 7
+#endif
+
+#ifdef __thumb__
+# define adrl adr
+#endif
+
+#if __ARM_MAX_ARCH__>=7
+.arch	armv7-a
+.fpu	neon
+
+.text
+.syntax	unified 	@ ARMv7-capable assembler is expected to handle this
+#if defined(__thumb2__) && !defined(__APPLE__)
+.thumb
+#else
+.code	32
+#endif
+
+.type	_bsaes_decrypt8,%function
+.align	4
+_bsaes_decrypt8:
+	adr	r6,_bsaes_decrypt8
+	vldmia	r4!, {q9}		@ round 0 key
+#ifdef	__APPLE__
+	adr	r6,.LM0ISR
+#else
+	add	r6,r6,#.LM0ISR-_bsaes_decrypt8
+#endif
+
+	vldmia	r6!, {q8}		@ .LM0ISR
+	veor	q10, q0, q9	@ xor with round0 key
+	veor	q11, q1, q9
+	vtbl.8	d0, {q10}, d16
+	vtbl.8	d1, {q10}, d17
+	veor	q12, q2, q9
+	vtbl.8	d2, {q11}, d16
+	vtbl.8	d3, {q11}, d17
+	veor	q13, q3, q9
+	vtbl.8	d4, {q12}, d16
+	vtbl.8	d5, {q12}, d17
+	veor	q14, q4, q9
+	vtbl.8	d6, {q13}, d16
+	vtbl.8	d7, {q13}, d17
+	veor	q15, q5, q9
+	vtbl.8	d8, {q14}, d16
+	vtbl.8	d9, {q14}, d17
+	veor	q10, q6, q9
+	vtbl.8	d10, {q15}, d16
+	vtbl.8	d11, {q15}, d17
+	veor	q11, q7, q9
+	vtbl.8	d12, {q10}, d16
+	vtbl.8	d13, {q10}, d17
+	vtbl.8	d14, {q11}, d16
+	vtbl.8	d15, {q11}, d17
+	vmov.i8	q8,#0x55			@ compose .LBS0
+	vmov.i8	q9,#0x33			@ compose .LBS1
+	vshr.u64	q10, q6, #1
+	vshr.u64	q11, q4, #1
+	veor	q10, q10, q7
+	veor	q11, q11, q5
+	vand	q10, q10, q8
+	vand	q11, q11, q8
+	veor	q7, q7, q10
+	vshl.u64	q10, q10, #1
+	veor	q5, q5, q11
+	vshl.u64	q11, q11, #1
+	veor	q6, q6, q10
+	veor	q4, q4, q11
+	vshr.u64	q10, q2, #1
+	vshr.u64	q11, q0, #1
+	veor	q10, q10, q3
+	veor	q11, q11, q1
+	vand	q10, q10, q8
+	vand	q11, q11, q8
+	veor	q3, q3, q10
+	vshl.u64	q10, q10, #1
+	veor	q1, q1, q11
+	vshl.u64	q11, q11, #1
+	veor	q2, q2, q10
+	veor	q0, q0, q11
+	vmov.i8	q8,#0x0f			@ compose .LBS2
+	vshr.u64	q10, q5, #2
+	vshr.u64	q11, q4, #2
+	veor	q10, q10, q7
+	veor	q11, q11, q6
+	vand	q10, q10, q9
+	vand	q11, q11, q9
+	veor	q7, q7, q10
+	vshl.u64	q10, q10, #2
+	veor	q6, q6, q11
+	vshl.u64	q11, q11, #2
+	veor	q5, q5, q10
+	veor	q4, q4, q11
+	vshr.u64	q10, q1, #2
+	vshr.u64	q11, q0, #2
+	veor	q10, q10, q3
+	veor	q11, q11, q2
+	vand	q10, q10, q9
+	vand	q11, q11, q9
+	veor	q3, q3, q10
+	vshl.u64	q10, q10, #2
+	veor	q2, q2, q11
+	vshl.u64	q11, q11, #2
+	veor	q1, q1, q10
+	veor	q0, q0, q11
+	vshr.u64	q10, q3, #4
+	vshr.u64	q11, q2, #4
+	veor	q10, q10, q7
+	veor	q11, q11, q6
+	vand	q10, q10, q8
+	vand	q11, q11, q8
+	veor	q7, q7, q10
+	vshl.u64	q10, q10, #4
+	veor	q6, q6, q11
+	vshl.u64	q11, q11, #4
+	veor	q3, q3, q10
+	veor	q2, q2, q11
+	vshr.u64	q10, q1, #4
+	vshr.u64	q11, q0, #4
+	veor	q10, q10, q5
+	veor	q11, q11, q4
+	vand	q10, q10, q8
+	vand	q11, q11, q8
+	veor	q5, q5, q10
+	vshl.u64	q10, q10, #4
+	veor	q4, q4, q11
+	vshl.u64	q11, q11, #4
+	veor	q1, q1, q10
+	veor	q0, q0, q11
+	sub	r5,r5,#1
+	b	.Ldec_sbox
+.align	4
+.Ldec_loop:
+	vldmia	r4!, {q8,q9,q10,q11}
+	veor	q8, q8, q0
+	veor	q9, q9, q1
+	vtbl.8	d0, {q8}, d24
+	vtbl.8	d1, {q8}, d25
+	vldmia	r4!, {q8}
+	veor	q10, q10, q2
+	vtbl.8	d2, {q9}, d24
+	vtbl.8	d3, {q9}, d25
+	vldmia	r4!, {q9}
+	veor	q11, q11, q3
+	vtbl.8	d4, {q10}, d24
+	vtbl.8	d5, {q10}, d25
+	vldmia	r4!, {q10}
+	vtbl.8	d6, {q11}, d24
+	vtbl.8	d7, {q11}, d25
+	vldmia	r4!, {q11}
+	veor	q8, q8, q4
+	veor	q9, q9, q5
+	vtbl.8	d8, {q8}, d24
+	vtbl.8	d9, {q8}, d25
+	veor	q10, q10, q6
+	vtbl.8	d10, {q9}, d24
+	vtbl.8	d11, {q9}, d25
+	veor	q11, q11, q7
+	vtbl.8	d12, {q10}, d24
+	vtbl.8	d13, {q10}, d25
+	vtbl.8	d14, {q11}, d24
+	vtbl.8	d15, {q11}, d25
+.Ldec_sbox:
+	veor	q1, q1, q4
+	veor	q3, q3, q4
+
+	veor	q4, q4, q7
+	veor	q1, q1, q6
+	veor	q2, q2, q7
+	veor	q6, q6, q4
+
+	veor	q0, q0, q1
+	veor	q2, q2, q5
+	veor	q7, q7, q6
+	veor	q3, q3, q0
+	veor	q5, q5, q0
+	veor	q1, q1, q3
+	veor	q11, q3, q0
+	veor	q10, q7, q4
+	veor	q9, q1, q6
+	veor	q13, q4, q0
+	vmov	q8, q10
+	veor	q12, q5, q2
+
+	vorr	q10, q10, q9
+	veor	q15, q11, q8
+	vand	q14, q11, q12
+	vorr	q11, q11, q12
+	veor	q12, q12, q9
+	vand	q8, q8, q9
+	veor	q9, q6, q2
+	vand	q15, q15, q12
+	vand	q13, q13, q9
+	veor	q9, q3, q7
+	veor	q12, q1, q5
+	veor	q11, q11, q13
+	veor	q10, q10, q13
+	vand	q13, q9, q12
+	vorr	q9, q9, q12
+	veor	q11, q11, q15
+	veor	q8, q8, q13
+	veor	q10, q10, q14
+	veor	q9, q9, q15
+	veor	q8, q8, q14
+	vand	q12, q4, q6
+	veor	q9, q9, q14
+	vand	q13, q0, q2
+	vand	q14, q7, q1
+	vorr	q15, q3, q5
+	veor	q11, q11, q12
+	veor	q9, q9, q14
+	veor	q8, q8, q15
+	veor	q10, q10, q13
+
+	@ Inv_GF16 	0, 	1, 	2, 	3, s0, s1, s2, s3
+
+	@ new smaller inversion
+
+	vand	q14, q11, q9
+	vmov	q12, q8
+
+	veor	q13, q10, q14
+	veor	q15, q8, q14
+	veor	q14, q8, q14	@ q14=q15
+
+	vbsl	q13, q9, q8
+	vbsl	q15, q11, q10
+	veor	q11, q11, q10
+
+	vbsl	q12, q13, q14
+	vbsl	q8, q14, q13
+
+	vand	q14, q12, q15
+	veor	q9, q9, q8
+
+	veor	q14, q14, q11
+	veor	q12, q5, q2
+	veor	q8, q1, q6
+	veor	q10, q15, q14
+	vand	q10, q10, q5
+	veor	q5, q5, q1
+	vand	q11, q1, q15
+	vand	q5, q5, q14
+	veor	q1, q11, q10
+	veor	q5, q5, q11
+	veor	q15, q15, q13
+	veor	q14, q14, q9
+	veor	q11, q15, q14
+	veor	q10, q13, q9
+	vand	q11, q11, q12
+	vand	q10, q10, q2
+	veor	q12, q12, q8
+	veor	q2, q2, q6
+	vand	q8, q8, q15
+	vand	q6, q6, q13
+	vand	q12, q12, q14
+	vand	q2, q2, q9
+	veor	q8, q8, q12
+	veor	q2, q2, q6
+	veor	q12, q12, q11
+	veor	q6, q6, q10
+	veor	q5, q5, q12
+	veor	q2, q2, q12
+	veor	q1, q1, q8
+	veor	q6, q6, q8
+
+	veor	q12, q3, q0
+	veor	q8, q7, q4
+	veor	q11, q15, q14
+	veor	q10, q13, q9
+	vand	q11, q11, q12
+	vand	q10, q10, q0
+	veor	q12, q12, q8
+	veor	q0, q0, q4
+	vand	q8, q8, q15
+	vand	q4, q4, q13
+	vand	q12, q12, q14
+	vand	q0, q0, q9
+	veor	q8, q8, q12
+	veor	q0, q0, q4
+	veor	q12, q12, q11
+	veor	q4, q4, q10
+	veor	q15, q15, q13
+	veor	q14, q14, q9
+	veor	q10, q15, q14
+	vand	q10, q10, q3
+	veor	q3, q3, q7
+	vand	q11, q7, q15
+	vand	q3, q3, q14
+	veor	q7, q11, q10
+	veor	q3, q3, q11
+	veor	q3, q3, q12
+	veor	q0, q0, q12
+	veor	q7, q7, q8
+	veor	q4, q4, q8
+	veor	q1, q1, q7
+	veor	q6, q6, q5
+
+	veor	q4, q4, q1
+	veor	q2, q2, q7
+	veor	q5, q5, q7
+	veor	q4, q4, q2
+	veor	q7, q7, q0
+	veor	q4, q4, q5
+	veor	q3, q3, q6
+	veor	q6, q6, q1
+	veor	q3, q3, q4
+
+	veor	q4, q4, q0
+	veor	q7, q7, q3
+	subs	r5,r5,#1
+	bcc	.Ldec_done
+	@ multiplication by 0x05-0x00-0x04-0x00
+	vext.8	q8, q0, q0, #8
+	vext.8	q14, q3, q3, #8
+	vext.8	q15, q5, q5, #8
+	veor	q8, q8, q0
+	vext.8	q9, q1, q1, #8
+	veor	q14, q14, q3
+	vext.8	q10, q6, q6, #8
+	veor	q15, q15, q5
+	vext.8	q11, q4, q4, #8
+	veor	q9, q9, q1
+	vext.8	q12, q2, q2, #8
+	veor	q10, q10, q6
+	vext.8	q13, q7, q7, #8
+	veor	q11, q11, q4
+	veor	q12, q12, q2
+	veor	q13, q13, q7
+
+	veor	q0, q0, q14
+	veor	q1, q1, q14
+	veor	q6, q6, q8
+	veor	q2, q2, q10
+	veor	q4, q4, q9
+	veor	q1, q1, q15
+	veor	q6, q6, q15
+	veor	q2, q2, q14
+	veor	q7, q7, q11
+	veor	q4, q4, q14
+	veor	q3, q3, q12
+	veor	q2, q2, q15
+	veor	q7, q7, q15
+	veor	q5, q5, q13
+	vext.8	q8, q0, q0, #12	@ x0 <<< 32
+	vext.8	q9, q1, q1, #12
+	veor	q0, q0, q8		@ x0 ^ (x0 <<< 32)
+	vext.8	q10, q6, q6, #12
+	veor	q1, q1, q9
+	vext.8	q11, q4, q4, #12
+	veor	q6, q6, q10
+	vext.8	q12, q2, q2, #12
+	veor	q4, q4, q11
+	vext.8	q13, q7, q7, #12
+	veor	q2, q2, q12
+	vext.8	q14, q3, q3, #12
+	veor	q7, q7, q13
+	vext.8	q15, q5, q5, #12
+	veor	q3, q3, q14
+
+	veor	q9, q9, q0
+	veor	q5, q5, q15
+	vext.8	q0, q0, q0, #8		@ (x0 ^ (x0 <<< 32)) <<< 64)
+	veor	q10, q10, q1
+	veor	q8, q8, q5
+	veor	q9, q9, q5
+	vext.8	q1, q1, q1, #8
+	veor	q13, q13, q2
+	veor	q0, q0, q8
+	veor	q14, q14, q7
+	veor	q1, q1, q9
+	vext.8	q8, q2, q2, #8
+	veor	q12, q12, q4
+	vext.8	q9, q7, q7, #8
+	veor	q15, q15, q3
+	vext.8	q2, q4, q4, #8
+	veor	q11, q11, q6
+	vext.8	q7, q5, q5, #8
+	veor	q12, q12, q5
+	vext.8	q4, q3, q3, #8
+	veor	q11, q11, q5
+	vext.8	q3, q6, q6, #8
+	veor	q5, q9, q13
+	veor	q11, q11, q2
+	veor	q7, q7, q15
+	veor	q6, q4, q14
+	veor	q4, q8, q12
+	veor	q2, q3, q10
+	vmov	q3, q11
+	 @ vmov	q5, q9
+	vldmia	r6, {q12}		@ .LISR
+	ite	eq				@ Thumb2 thing, sanity check in ARM
+	addeq	r6,r6,#0x10
+	bne	.Ldec_loop
+	vldmia	r6, {q12}		@ .LISRM0
+	b	.Ldec_loop
+.align	4
+.Ldec_done:
+	vmov.i8	q8,#0x55			@ compose .LBS0
+	vmov.i8	q9,#0x33			@ compose .LBS1
+	vshr.u64	q10, q3, #1
+	vshr.u64	q11, q2, #1
+	veor	q10, q10, q5
+	veor	q11, q11, q7
+	vand	q10, q10, q8
+	vand	q11, q11, q8
+	veor	q5, q5, q10
+	vshl.u64	q10, q10, #1
+	veor	q7, q7, q11
+	vshl.u64	q11, q11, #1
+	veor	q3, q3, q10
+	veor	q2, q2, q11
+	vshr.u64	q10, q6, #1
+	vshr.u64	q11, q0, #1
+	veor	q10, q10, q4
+	veor	q11, q11, q1
+	vand	q10, q10, q8
+	vand	q11, q11, q8
+	veor	q4, q4, q10
+	vshl.u64	q10, q10, #1
+	veor	q1, q1, q11
+	vshl.u64	q11, q11, #1
+	veor	q6, q6, q10
+	veor	q0, q0, q11
+	vmov.i8	q8,#0x0f			@ compose .LBS2
+	vshr.u64	q10, q7, #2
+	vshr.u64	q11, q2, #2
+	veor	q10, q10, q5
+	veor	q11, q11, q3
+	vand	q10, q10, q9
+	vand	q11, q11, q9
+	veor	q5, q5, q10
+	vshl.u64	q10, q10, #2
+	veor	q3, q3, q11
+	vshl.u64	q11, q11, #2
+	veor	q7, q7, q10
+	veor	q2, q2, q11
+	vshr.u64	q10, q1, #2
+	vshr.u64	q11, q0, #2
+	veor	q10, q10, q4
+	veor	q11, q11, q6
+	vand	q10, q10, q9
+	vand	q11, q11, q9
+	veor	q4, q4, q10
+	vshl.u64	q10, q10, #2
+	veor	q6, q6, q11
+	vshl.u64	q11, q11, #2
+	veor	q1, q1, q10
+	veor	q0, q0, q11
+	vshr.u64	q10, q4, #4
+	vshr.u64	q11, q6, #4
+	veor	q10, q10, q5
+	veor	q11, q11, q3
+	vand	q10, q10, q8
+	vand	q11, q11, q8
+	veor	q5, q5, q10
+	vshl.u64	q10, q10, #4
+	veor	q3, q3, q11
+	vshl.u64	q11, q11, #4
+	veor	q4, q4, q10
+	veor	q6, q6, q11
+	vshr.u64	q10, q1, #4
+	vshr.u64	q11, q0, #4
+	veor	q10, q10, q7
+	veor	q11, q11, q2
+	vand	q10, q10, q8
+	vand	q11, q11, q8
+	veor	q7, q7, q10
+	vshl.u64	q10, q10, #4
+	veor	q2, q2, q11
+	vshl.u64	q11, q11, #4
+	veor	q1, q1, q10
+	veor	q0, q0, q11
+	vldmia	r4, {q8}			@ last round key
+	veor	q6, q6, q8
+	veor	q4, q4, q8
+	veor	q2, q2, q8
+	veor	q7, q7, q8
+	veor	q3, q3, q8
+	veor	q5, q5, q8
+	veor	q0, q0, q8
+	veor	q1, q1, q8
+	bx	lr
+.size	_bsaes_decrypt8,.-_bsaes_decrypt8
+
+.type	_bsaes_const,%object
+.align	6
+_bsaes_const:
+.LM0ISR:@ InvShiftRows constants
+.quad	0x0a0e0206070b0f03, 0x0004080c0d010509
+.LISR:
+.quad	0x0504070602010003, 0x0f0e0d0c080b0a09
+.LISRM0:
+.quad	0x01040b0e0205080f, 0x0306090c00070a0d
+.LM0SR:@ ShiftRows constants
+.quad	0x0a0e02060f03070b, 0x0004080c05090d01
+.LSR:
+.quad	0x0504070600030201, 0x0f0e0d0c0a09080b
+.LSRM0:
+.quad	0x0304090e00050a0f, 0x01060b0c0207080d
+.LM0:
+.quad	0x02060a0e03070b0f, 0x0004080c0105090d
+.LREVM0SR:
+.quad	0x090d01050c000408, 0x03070b0f060a0e02
+.byte	66,105,116,45,115,108,105,99,101,100,32,65,69,83,32,102,111,114,32,78,69,79,78,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0
+.align	2
+.align	6
+.size	_bsaes_const,.-_bsaes_const
+
+.type	_bsaes_encrypt8,%function
+.align	4
+_bsaes_encrypt8:
+	adr	r6,_bsaes_encrypt8
+	vldmia	r4!, {q9}		@ round 0 key
+#ifdef	__APPLE__
+	adr	r6,.LM0SR
+#else
+	sub	r6,r6,#_bsaes_encrypt8-.LM0SR
+#endif
+
+	vldmia	r6!, {q8}		@ .LM0SR
+_bsaes_encrypt8_alt:
+	veor	q10, q0, q9	@ xor with round0 key
+	veor	q11, q1, q9
+	vtbl.8	d0, {q10}, d16
+	vtbl.8	d1, {q10}, d17
+	veor	q12, q2, q9
+	vtbl.8	d2, {q11}, d16
+	vtbl.8	d3, {q11}, d17
+	veor	q13, q3, q9
+	vtbl.8	d4, {q12}, d16
+	vtbl.8	d5, {q12}, d17
+	veor	q14, q4, q9
+	vtbl.8	d6, {q13}, d16
+	vtbl.8	d7, {q13}, d17
+	veor	q15, q5, q9
+	vtbl.8	d8, {q14}, d16
+	vtbl.8	d9, {q14}, d17
+	veor	q10, q6, q9
+	vtbl.8	d10, {q15}, d16
+	vtbl.8	d11, {q15}, d17
+	veor	q11, q7, q9
+	vtbl.8	d12, {q10}, d16
+	vtbl.8	d13, {q10}, d17
+	vtbl.8	d14, {q11}, d16
+	vtbl.8	d15, {q11}, d17
+_bsaes_encrypt8_bitslice:
+	vmov.i8	q8,#0x55			@ compose .LBS0
+	vmov.i8	q9,#0x33			@ compose .LBS1
+	vshr.u64	q10, q6, #1
+	vshr.u64	q11, q4, #1
+	veor	q10, q10, q7
+	veor	q11, q11, q5
+	vand	q10, q10, q8
+	vand	q11, q11, q8
+	veor	q7, q7, q10
+	vshl.u64	q10, q10, #1
+	veor	q5, q5, q11
+	vshl.u64	q11, q11, #1
+	veor	q6, q6, q10
+	veor	q4, q4, q11
+	vshr.u64	q10, q2, #1
+	vshr.u64	q11, q0, #1
+	veor	q10, q10, q3
+	veor	q11, q11, q1
+	vand	q10, q10, q8
+	vand	q11, q11, q8
+	veor	q3, q3, q10
+	vshl.u64	q10, q10, #1
+	veor	q1, q1, q11
+	vshl.u64	q11, q11, #1
+	veor	q2, q2, q10
+	veor	q0, q0, q11
+	vmov.i8	q8,#0x0f			@ compose .LBS2
+	vshr.u64	q10, q5, #2
+	vshr.u64	q11, q4, #2
+	veor	q10, q10, q7
+	veor	q11, q11, q6
+	vand	q10, q10, q9
+	vand	q11, q11, q9
+	veor	q7, q7, q10
+	vshl.u64	q10, q10, #2
+	veor	q6, q6, q11
+	vshl.u64	q11, q11, #2
+	veor	q5, q5, q10
+	veor	q4, q4, q11
+	vshr.u64	q10, q1, #2
+	vshr.u64	q11, q0, #2
+	veor	q10, q10, q3
+	veor	q11, q11, q2
+	vand	q10, q10, q9
+	vand	q11, q11, q9
+	veor	q3, q3, q10
+	vshl.u64	q10, q10, #2
+	veor	q2, q2, q11
+	vshl.u64	q11, q11, #2
+	veor	q1, q1, q10
+	veor	q0, q0, q11
+	vshr.u64	q10, q3, #4
+	vshr.u64	q11, q2, #4
+	veor	q10, q10, q7
+	veor	q11, q11, q6
+	vand	q10, q10, q8
+	vand	q11, q11, q8
+	veor	q7, q7, q10
+	vshl.u64	q10, q10, #4
+	veor	q6, q6, q11
+	vshl.u64	q11, q11, #4
+	veor	q3, q3, q10
+	veor	q2, q2, q11
+	vshr.u64	q10, q1, #4
+	vshr.u64	q11, q0, #4
+	veor	q10, q10, q5
+	veor	q11, q11, q4
+	vand	q10, q10, q8
+	vand	q11, q11, q8
+	veor	q5, q5, q10
+	vshl.u64	q10, q10, #4
+	veor	q4, q4, q11
+	vshl.u64	q11, q11, #4
+	veor	q1, q1, q10
+	veor	q0, q0, q11
+	sub	r5,r5,#1
+	b	.Lenc_sbox
+.align	4
+.Lenc_loop:
+	vldmia	r4!, {q8,q9,q10,q11}
+	veor	q8, q8, q0
+	veor	q9, q9, q1
+	vtbl.8	d0, {q8}, d24
+	vtbl.8	d1, {q8}, d25
+	vldmia	r4!, {q8}
+	veor	q10, q10, q2
+	vtbl.8	d2, {q9}, d24
+	vtbl.8	d3, {q9}, d25
+	vldmia	r4!, {q9}
+	veor	q11, q11, q3
+	vtbl.8	d4, {q10}, d24
+	vtbl.8	d5, {q10}, d25
+	vldmia	r4!, {q10}
+	vtbl.8	d6, {q11}, d24
+	vtbl.8	d7, {q11}, d25
+	vldmia	r4!, {q11}
+	veor	q8, q8, q4
+	veor	q9, q9, q5
+	vtbl.8	d8, {q8}, d24
+	vtbl.8	d9, {q8}, d25
+	veor	q10, q10, q6
+	vtbl.8	d10, {q9}, d24
+	vtbl.8	d11, {q9}, d25
+	veor	q11, q11, q7
+	vtbl.8	d12, {q10}, d24
+	vtbl.8	d13, {q10}, d25
+	vtbl.8	d14, {q11}, d24
+	vtbl.8	d15, {q11}, d25
+.Lenc_sbox:
+	veor	q2, q2, q1
+	veor	q5, q5, q6
+	veor	q3, q3, q0
+	veor	q6, q6, q2
+	veor	q5, q5, q0
+
+	veor	q6, q6, q3
+	veor	q3, q3, q7
+	veor	q7, q7, q5
+	veor	q3, q3, q4
+	veor	q4, q4, q5
+
+	veor	q2, q2, q7
+	veor	q3, q3, q1
+	veor	q1, q1, q5
+	veor	q11, q7, q4
+	veor	q10, q1, q2
+	veor	q9, q5, q3
+	veor	q13, q2, q4
+	vmov	q8, q10
+	veor	q12, q6, q0
+
+	vorr	q10, q10, q9
+	veor	q15, q11, q8
+	vand	q14, q11, q12
+	vorr	q11, q11, q12
+	veor	q12, q12, q9
+	vand	q8, q8, q9
+	veor	q9, q3, q0
+	vand	q15, q15, q12
+	vand	q13, q13, q9
+	veor	q9, q7, q1
+	veor	q12, q5, q6
+	veor	q11, q11, q13
+	veor	q10, q10, q13
+	vand	q13, q9, q12
+	vorr	q9, q9, q12
+	veor	q11, q11, q15
+	veor	q8, q8, q13
+	veor	q10, q10, q14
+	veor	q9, q9, q15
+	veor	q8, q8, q14
+	vand	q12, q2, q3
+	veor	q9, q9, q14
+	vand	q13, q4, q0
+	vand	q14, q1, q5
+	vorr	q15, q7, q6
+	veor	q11, q11, q12
+	veor	q9, q9, q14
+	veor	q8, q8, q15
+	veor	q10, q10, q13
+
+	@ Inv_GF16 	0, 	1, 	2, 	3, s0, s1, s2, s3
+
+	@ new smaller inversion
+
+	vand	q14, q11, q9
+	vmov	q12, q8
+
+	veor	q13, q10, q14
+	veor	q15, q8, q14
+	veor	q14, q8, q14	@ q14=q15
+
+	vbsl	q13, q9, q8
+	vbsl	q15, q11, q10
+	veor	q11, q11, q10
+
+	vbsl	q12, q13, q14
+	vbsl	q8, q14, q13
+
+	vand	q14, q12, q15
+	veor	q9, q9, q8
+
+	veor	q14, q14, q11
+	veor	q12, q6, q0
+	veor	q8, q5, q3
+	veor	q10, q15, q14
+	vand	q10, q10, q6
+	veor	q6, q6, q5
+	vand	q11, q5, q15
+	vand	q6, q6, q14
+	veor	q5, q11, q10
+	veor	q6, q6, q11
+	veor	q15, q15, q13
+	veor	q14, q14, q9
+	veor	q11, q15, q14
+	veor	q10, q13, q9
+	vand	q11, q11, q12
+	vand	q10, q10, q0
+	veor	q12, q12, q8
+	veor	q0, q0, q3
+	vand	q8, q8, q15
+	vand	q3, q3, q13
+	vand	q12, q12, q14
+	vand	q0, q0, q9
+	veor	q8, q8, q12
+	veor	q0, q0, q3
+	veor	q12, q12, q11
+	veor	q3, q3, q10
+	veor	q6, q6, q12
+	veor	q0, q0, q12
+	veor	q5, q5, q8
+	veor	q3, q3, q8
+
+	veor	q12, q7, q4
+	veor	q8, q1, q2
+	veor	q11, q15, q14
+	veor	q10, q13, q9
+	vand	q11, q11, q12
+	vand	q10, q10, q4
+	veor	q12, q12, q8
+	veor	q4, q4, q2
+	vand	q8, q8, q15
+	vand	q2, q2, q13
+	vand	q12, q12, q14
+	vand	q4, q4, q9
+	veor	q8, q8, q12
+	veor	q4, q4, q2
+	veor	q12, q12, q11
+	veor	q2, q2, q10
+	veor	q15, q15, q13
+	veor	q14, q14, q9
+	veor	q10, q15, q14
+	vand	q10, q10, q7
+	veor	q7, q7, q1
+	vand	q11, q1, q15
+	vand	q7, q7, q14
+	veor	q1, q11, q10
+	veor	q7, q7, q11
+	veor	q7, q7, q12
+	veor	q4, q4, q12
+	veor	q1, q1, q8
+	veor	q2, q2, q8
+	veor	q7, q7, q0
+	veor	q1, q1, q6
+	veor	q6, q6, q0
+	veor	q4, q4, q7
+	veor	q0, q0, q1
+
+	veor	q1, q1, q5
+	veor	q5, q5, q2
+	veor	q2, q2, q3
+	veor	q3, q3, q5
+	veor	q4, q4, q5
+
+	veor	q6, q6, q3
+	subs	r5,r5,#1
+	bcc	.Lenc_done
+	vext.8	q8, q0, q0, #12	@ x0 <<< 32
+	vext.8	q9, q1, q1, #12
+	veor	q0, q0, q8		@ x0 ^ (x0 <<< 32)
+	vext.8	q10, q4, q4, #12
+	veor	q1, q1, q9
+	vext.8	q11, q6, q6, #12
+	veor	q4, q4, q10
+	vext.8	q12, q3, q3, #12
+	veor	q6, q6, q11
+	vext.8	q13, q7, q7, #12
+	veor	q3, q3, q12
+	vext.8	q14, q2, q2, #12
+	veor	q7, q7, q13
+	vext.8	q15, q5, q5, #12
+	veor	q2, q2, q14
+
+	veor	q9, q9, q0
+	veor	q5, q5, q15
+	vext.8	q0, q0, q0, #8		@ (x0 ^ (x0 <<< 32)) <<< 64)
+	veor	q10, q10, q1
+	veor	q8, q8, q5
+	veor	q9, q9, q5
+	vext.8	q1, q1, q1, #8
+	veor	q13, q13, q3
+	veor	q0, q0, q8
+	veor	q14, q14, q7
+	veor	q1, q1, q9
+	vext.8	q8, q3, q3, #8
+	veor	q12, q12, q6
+	vext.8	q9, q7, q7, #8
+	veor	q15, q15, q2
+	vext.8	q3, q6, q6, #8
+	veor	q11, q11, q4
+	vext.8	q7, q5, q5, #8
+	veor	q12, q12, q5
+	vext.8	q6, q2, q2, #8
+	veor	q11, q11, q5
+	vext.8	q2, q4, q4, #8
+	veor	q5, q9, q13
+	veor	q4, q8, q12
+	veor	q3, q3, q11
+	veor	q7, q7, q15
+	veor	q6, q6, q14
+	 @ vmov	q4, q8
+	veor	q2, q2, q10
+	 @ vmov	q5, q9
+	vldmia	r6, {q12}		@ .LSR
+	ite	eq				@ Thumb2 thing, samity check in ARM
+	addeq	r6,r6,#0x10
+	bne	.Lenc_loop
+	vldmia	r6, {q12}		@ .LSRM0
+	b	.Lenc_loop
+.align	4
+.Lenc_done:
+	vmov.i8	q8,#0x55			@ compose .LBS0
+	vmov.i8	q9,#0x33			@ compose .LBS1
+	vshr.u64	q10, q2, #1
+	vshr.u64	q11, q3, #1
+	veor	q10, q10, q5
+	veor	q11, q11, q7
+	vand	q10, q10, q8
+	vand	q11, q11, q8
+	veor	q5, q5, q10
+	vshl.u64	q10, q10, #1
+	veor	q7, q7, q11
+	vshl.u64	q11, q11, #1
+	veor	q2, q2, q10
+	veor	q3, q3, q11
+	vshr.u64	q10, q4, #1
+	vshr.u64	q11, q0, #1
+	veor	q10, q10, q6
+	veor	q11, q11, q1
+	vand	q10, q10, q8
+	vand	q11, q11, q8
+	veor	q6, q6, q10
+	vshl.u64	q10, q10, #1
+	veor	q1, q1, q11
+	vshl.u64	q11, q11, #1
+	veor	q4, q4, q10
+	veor	q0, q0, q11
+	vmov.i8	q8,#0x0f			@ compose .LBS2
+	vshr.u64	q10, q7, #2
+	vshr.u64	q11, q3, #2
+	veor	q10, q10, q5
+	veor	q11, q11, q2
+	vand	q10, q10, q9
+	vand	q11, q11, q9
+	veor	q5, q5, q10
+	vshl.u64	q10, q10, #2
+	veor	q2, q2, q11
+	vshl.u64	q11, q11, #2
+	veor	q7, q7, q10
+	veor	q3, q3, q11
+	vshr.u64	q10, q1, #2
+	vshr.u64	q11, q0, #2
+	veor	q10, q10, q6
+	veor	q11, q11, q4
+	vand	q10, q10, q9
+	vand	q11, q11, q9
+	veor	q6, q6, q10
+	vshl.u64	q10, q10, #2
+	veor	q4, q4, q11
+	vshl.u64	q11, q11, #2
+	veor	q1, q1, q10
+	veor	q0, q0, q11
+	vshr.u64	q10, q6, #4
+	vshr.u64	q11, q4, #4
+	veor	q10, q10, q5
+	veor	q11, q11, q2
+	vand	q10, q10, q8
+	vand	q11, q11, q8
+	veor	q5, q5, q10
+	vshl.u64	q10, q10, #4
+	veor	q2, q2, q11
+	vshl.u64	q11, q11, #4
+	veor	q6, q6, q10
+	veor	q4, q4, q11
+	vshr.u64	q10, q1, #4
+	vshr.u64	q11, q0, #4
+	veor	q10, q10, q7
+	veor	q11, q11, q3
+	vand	q10, q10, q8
+	vand	q11, q11, q8
+	veor	q7, q7, q10
+	vshl.u64	q10, q10, #4
+	veor	q3, q3, q11
+	vshl.u64	q11, q11, #4
+	veor	q1, q1, q10
+	veor	q0, q0, q11
+	vldmia	r4, {q8}			@ last round key
+	veor	q4, q4, q8
+	veor	q6, q6, q8
+	veor	q3, q3, q8
+	veor	q7, q7, q8
+	veor	q2, q2, q8
+	veor	q5, q5, q8
+	veor	q0, q0, q8
+	veor	q1, q1, q8
+	bx	lr
+.size	_bsaes_encrypt8,.-_bsaes_encrypt8
+.type	_bsaes_key_convert,%function
+.align	4
+_bsaes_key_convert:
+	adr	r6,_bsaes_key_convert
+	vld1.8	{q7},  [r4]!		@ load round 0 key
+#ifdef	__APPLE__
+	adr	r6,.LM0
+#else
+	sub	r6,r6,#_bsaes_key_convert-.LM0
+#endif
+	vld1.8	{q15}, [r4]!		@ load round 1 key
+
+	vmov.i8	q8,  #0x01			@ bit masks
+	vmov.i8	q9,  #0x02
+	vmov.i8	q10, #0x04
+	vmov.i8	q11, #0x08
+	vmov.i8	q12, #0x10
+	vmov.i8	q13, #0x20
+	vldmia	r6, {q14}		@ .LM0
+
+#ifdef __ARMEL__
+	vrev32.8	q7,  q7
+	vrev32.8	q15, q15
+#endif
+	sub	r5,r5,#1
+	vstmia	r12!, {q7}		@ save round 0 key
+	b	.Lkey_loop
+
+.align	4
+.Lkey_loop:
+	vtbl.8	d14,{q15},d28
+	vtbl.8	d15,{q15},d29
+	vmov.i8	q6,  #0x40
+	vmov.i8	q15, #0x80
+
+	vtst.8	q0, q7, q8
+	vtst.8	q1, q7, q9
+	vtst.8	q2, q7, q10
+	vtst.8	q3, q7, q11
+	vtst.8	q4, q7, q12
+	vtst.8	q5, q7, q13
+	vtst.8	q6, q7, q6
+	vtst.8	q7, q7, q15
+	vld1.8	{q15}, [r4]!		@ load next round key
+	vmvn	q0, q0		@ "pnot"
+	vmvn	q1, q1
+	vmvn	q5, q5
+	vmvn	q6, q6
+#ifdef __ARMEL__
+	vrev32.8	q15, q15
+#endif
+	subs	r5,r5,#1
+	vstmia	r12!,{q0,q1,q2,q3,q4,q5,q6,q7}		@ write bit-sliced round key
+	bne	.Lkey_loop
+
+	vmov.i8	q7,#0x63			@ compose .L63
+	@ don't save last round key
+	bx	lr
+.size	_bsaes_key_convert,.-_bsaes_key_convert
+
+
+
+.globl	bsaes_cbc_encrypt
+.hidden	bsaes_cbc_encrypt
+.type	bsaes_cbc_encrypt,%function
+.align	5
+bsaes_cbc_encrypt:
+#ifndef	__KERNEL__
+	cmp	r2, #128
+#ifndef	__thumb__
+	blo	AES_cbc_encrypt
+#else
+	bhs	1f
+	b	AES_cbc_encrypt
+1:
+#endif
+#endif
+
+	@ it is up to the caller to make sure we are called with enc == 0
+
+	mov	ip, sp
+	stmdb	sp!, {r4,r5,r6,r7,r8,r9,r10, lr}
+	VFP_ABI_PUSH
+	ldr	r8, [ip]			@ IV is 1st arg on the stack
+	mov	r2, r2, lsr#4		@ len in 16 byte blocks
+	sub	sp, #0x10			@ scratch space to carry over the IV
+	mov	r9, sp				@ save sp
+
+	ldr	r10, [r3, #240]		@ get # of rounds
+#ifndef	BSAES_ASM_EXTENDED_KEY
+	@ allocate the key schedule on the stack
+	sub	r12, sp, r10, lsl#7		@ 128 bytes per inner round key
+	add	r12, #96			@ sifze of bit-slices key schedule
+
+	@ populate the key schedule
+	mov	r4, r3			@ pass key
+	mov	r5, r10			@ pass # of rounds
+	mov	sp, r12				@ sp is sp
+	bl	_bsaes_key_convert
+	vldmia	sp, {q6}
+	vstmia	r12,  {q15}		@ save last round key
+	veor	q7, q7, q6	@ fix up round 0 key
+	vstmia	sp, {q7}
+#else
+	ldr	r12, [r3, #244]
+	eors	r12, #1
+	beq	0f
+
+	@ populate the key schedule
+	str	r12, [r3, #244]
+	mov	r4, r3			@ pass key
+	mov	r5, r10			@ pass # of rounds
+	add	r12, r3, #248			@ pass key schedule
+	bl	_bsaes_key_convert
+	add	r4, r3, #248
+	vldmia	r4, {q6}
+	vstmia	r12, {q15}			@ save last round key
+	veor	q7, q7, q6	@ fix up round 0 key
+	vstmia	r4, {q7}
+
+.align	2
+
+#endif
+
+	vld1.8	{q15}, [r8]		@ load IV
+	b	.Lcbc_dec_loop
+
+.align	4
+.Lcbc_dec_loop:
+	subs	r2, r2, #0x8
+	bmi	.Lcbc_dec_loop_finish
+
+	vld1.8	{q0,q1}, [r0]!	@ load input
+	vld1.8	{q2,q3}, [r0]!
+#ifndef	BSAES_ASM_EXTENDED_KEY
+	mov	r4, sp			@ pass the key
+#else
+	add	r4, r3, #248
+#endif
+	vld1.8	{q4,q5}, [r0]!
+	mov	r5, r10
+	vld1.8	{q6,q7}, [r0]
+	sub	r0, r0, #0x60
+	vstmia	r9, {q15}			@ put aside IV
+
+	bl	_bsaes_decrypt8
+
+	vldmia	r9, {q14}			@ reload IV
+	vld1.8	{q8,q9}, [r0]!	@ reload input
+	veor	q0, q0, q14	@ ^= IV
+	vld1.8	{q10,q11}, [r0]!
+	veor	q1, q1, q8
+	veor	q6, q6, q9
+	vld1.8	{q12,q13}, [r0]!
+	veor	q4, q4, q10
+	veor	q2, q2, q11
+	vld1.8	{q14,q15}, [r0]!
+	veor	q7, q7, q12
+	vst1.8	{q0,q1}, [r1]!	@ write output
+	veor	q3, q3, q13
+	vst1.8	{q6}, [r1]!
+	veor	q5, q5, q14
+	vst1.8	{q4}, [r1]!
+	vst1.8	{q2}, [r1]!
+	vst1.8	{q7}, [r1]!
+	vst1.8	{q3}, [r1]!
+	vst1.8	{q5}, [r1]!
+
+	b	.Lcbc_dec_loop
+
+.Lcbc_dec_loop_finish:
+	adds	r2, r2, #8
+	beq	.Lcbc_dec_done
+
+	vld1.8	{q0}, [r0]!		@ load input
+	cmp	r2, #2
+	blo	.Lcbc_dec_one
+	vld1.8	{q1}, [r0]!
+#ifndef	BSAES_ASM_EXTENDED_KEY
+	mov	r4, sp			@ pass the key
+#else
+	add	r4, r3, #248
+#endif
+	mov	r5, r10
+	vstmia	r9, {q15}			@ put aside IV
+	beq	.Lcbc_dec_two
+	vld1.8	{q2}, [r0]!
+	cmp	r2, #4
+	blo	.Lcbc_dec_three
+	vld1.8	{q3}, [r0]!
+	beq	.Lcbc_dec_four
+	vld1.8	{q4}, [r0]!
+	cmp	r2, #6
+	blo	.Lcbc_dec_five
+	vld1.8	{q5}, [r0]!
+	beq	.Lcbc_dec_six
+	vld1.8	{q6}, [r0]!
+	sub	r0, r0, #0x70
+
+	bl	_bsaes_decrypt8
+
+	vldmia	r9, {q14}			@ reload IV
+	vld1.8	{q8,q9}, [r0]!	@ reload input
+	veor	q0, q0, q14	@ ^= IV
+	vld1.8	{q10,q11}, [r0]!
+	veor	q1, q1, q8
+	veor	q6, q6, q9
+	vld1.8	{q12,q13}, [r0]!
+	veor	q4, q4, q10
+	veor	q2, q2, q11
+	vld1.8	{q15}, [r0]!
+	veor	q7, q7, q12
+	vst1.8	{q0,q1}, [r1]!	@ write output
+	veor	q3, q3, q13
+	vst1.8	{q6}, [r1]!
+	vst1.8	{q4}, [r1]!
+	vst1.8	{q2}, [r1]!
+	vst1.8	{q7}, [r1]!
+	vst1.8	{q3}, [r1]!
+	b	.Lcbc_dec_done
+.align	4
+.Lcbc_dec_six:
+	sub	r0, r0, #0x60
+	bl	_bsaes_decrypt8
+	vldmia	r9,{q14}			@ reload IV
+	vld1.8	{q8,q9}, [r0]!	@ reload input
+	veor	q0, q0, q14	@ ^= IV
+	vld1.8	{q10,q11}, [r0]!
+	veor	q1, q1, q8
+	veor	q6, q6, q9
+	vld1.8	{q12}, [r0]!
+	veor	q4, q4, q10
+	veor	q2, q2, q11
+	vld1.8	{q15}, [r0]!
+	veor	q7, q7, q12
+	vst1.8	{q0,q1}, [r1]!	@ write output
+	vst1.8	{q6}, [r1]!
+	vst1.8	{q4}, [r1]!
+	vst1.8	{q2}, [r1]!
+	vst1.8	{q7}, [r1]!
+	b	.Lcbc_dec_done
+.align	4
+.Lcbc_dec_five:
+	sub	r0, r0, #0x50
+	bl	_bsaes_decrypt8
+	vldmia	r9, {q14}			@ reload IV
+	vld1.8	{q8,q9}, [r0]!	@ reload input
+	veor	q0, q0, q14	@ ^= IV
+	vld1.8	{q10,q11}, [r0]!
+	veor	q1, q1, q8
+	veor	q6, q6, q9
+	vld1.8	{q15}, [r0]!
+	veor	q4, q4, q10
+	vst1.8	{q0,q1}, [r1]!	@ write output
+	veor	q2, q2, q11
+	vst1.8	{q6}, [r1]!
+	vst1.8	{q4}, [r1]!
+	vst1.8	{q2}, [r1]!
+	b	.Lcbc_dec_done
+.align	4
+.Lcbc_dec_four:
+	sub	r0, r0, #0x40
+	bl	_bsaes_decrypt8
+	vldmia	r9, {q14}			@ reload IV
+	vld1.8	{q8,q9}, [r0]!	@ reload input
+	veor	q0, q0, q14	@ ^= IV
+	vld1.8	{q10}, [r0]!
+	veor	q1, q1, q8
+	veor	q6, q6, q9
+	vld1.8	{q15}, [r0]!
+	veor	q4, q4, q10
+	vst1.8	{q0,q1}, [r1]!	@ write output
+	vst1.8	{q6}, [r1]!
+	vst1.8	{q4}, [r1]!
+	b	.Lcbc_dec_done
+.align	4
+.Lcbc_dec_three:
+	sub	r0, r0, #0x30
+	bl	_bsaes_decrypt8
+	vldmia	r9, {q14}			@ reload IV
+	vld1.8	{q8,q9}, [r0]!	@ reload input
+	veor	q0, q0, q14	@ ^= IV
+	vld1.8	{q15}, [r0]!
+	veor	q1, q1, q8
+	veor	q6, q6, q9
+	vst1.8	{q0,q1}, [r1]!	@ write output
+	vst1.8	{q6}, [r1]!
+	b	.Lcbc_dec_done
+.align	4
+.Lcbc_dec_two:
+	sub	r0, r0, #0x20
+	bl	_bsaes_decrypt8
+	vldmia	r9, {q14}			@ reload IV
+	vld1.8	{q8}, [r0]!		@ reload input
+	veor	q0, q0, q14	@ ^= IV
+	vld1.8	{q15}, [r0]!		@ reload input
+	veor	q1, q1, q8
+	vst1.8	{q0,q1}, [r1]!	@ write output
+	b	.Lcbc_dec_done
+.align	4
+.Lcbc_dec_one:
+	sub	r0, r0, #0x10
+	mov	r10, r1			@ save original out pointer
+	mov	r1, r9			@ use the iv scratch space as out buffer
+	mov	r2, r3
+	vmov	q4,q15		@ just in case ensure that IV
+	vmov	q5,q0			@ and input are preserved
+	bl	AES_decrypt
+	vld1.8	{q0}, [r9,:64]		@ load result
+	veor	q0, q0, q4	@ ^= IV
+	vmov	q15, q5		@ q5 holds input
+	vst1.8	{q0}, [r10]		@ write output
+
+.Lcbc_dec_done:
+#ifndef	BSAES_ASM_EXTENDED_KEY
+	vmov.i32	q0, #0
+	vmov.i32	q1, #0
+.Lcbc_dec_bzero:@ wipe key schedule [if any]
+	vstmia	sp!, {q0,q1}
+	cmp	sp, r9
+	bne	.Lcbc_dec_bzero
+#endif
+
+	mov	sp, r9
+	add	sp, #0x10			@ add sp,r9,#0x10 is no good for thumb
+	vst1.8	{q15}, [r8]		@ return IV
+	VFP_ABI_POP
+	ldmia	sp!, {r4,r5,r6,r7,r8,r9,r10, pc}
+.size	bsaes_cbc_encrypt,.-bsaes_cbc_encrypt
+
+.globl	bsaes_ctr32_encrypt_blocks
+.hidden	bsaes_ctr32_encrypt_blocks
+.type	bsaes_ctr32_encrypt_blocks,%function
+.align	5
+bsaes_ctr32_encrypt_blocks:
+	cmp	r2, #8			@ use plain AES for
+	blo	.Lctr_enc_short			@ small sizes
+
+	mov	ip, sp
+	stmdb	sp!, {r4,r5,r6,r7,r8,r9,r10, lr}
+	VFP_ABI_PUSH
+	ldr	r8, [ip]			@ ctr is 1st arg on the stack
+	sub	sp, sp, #0x10			@ scratch space to carry over the ctr
+	mov	r9, sp				@ save sp
+
+	ldr	r10, [r3, #240]		@ get # of rounds
+#ifndef	BSAES_ASM_EXTENDED_KEY
+	@ allocate the key schedule on the stack
+	sub	r12, sp, r10, lsl#7		@ 128 bytes per inner round key
+	add	r12, #96			@ size of bit-sliced key schedule
+
+	@ populate the key schedule
+	mov	r4, r3			@ pass key
+	mov	r5, r10			@ pass # of rounds
+	mov	sp, r12				@ sp is sp
+	bl	_bsaes_key_convert
+	veor	q7,q7,q15	@ fix up last round key
+	vstmia	r12, {q7}			@ save last round key
+
+	vld1.8	{q0}, [r8]		@ load counter
+#ifdef	__APPLE__
+	mov	r8, #:lower16:(.LREVM0SR-.LM0)
+	add	r8, r6, r8
+#else
+	add	r8, r6, #.LREVM0SR-.LM0	@ borrow r8
+#endif
+	vldmia	sp, {q4}		@ load round0 key
+#else
+	ldr	r12, [r3, #244]
+	eors	r12, #1
+	beq	0f
+
+	@ populate the key schedule
+	str	r12, [r3, #244]
+	mov	r4, r3			@ pass key
+	mov	r5, r10			@ pass # of rounds
+	add	r12, r3, #248			@ pass key schedule
+	bl	_bsaes_key_convert
+	veor	q7,q7,q15	@ fix up last round key
+	vstmia	r12, {q7}			@ save last round key
+
+.align	2
+	add	r12, r3, #248
+	vld1.8	{q0}, [r8]		@ load counter
+	adrl	r8, .LREVM0SR			@ borrow r8
+	vldmia	r12, {q4}			@ load round0 key
+	sub	sp, #0x10			@ place for adjusted round0 key
+#endif
+
+	vmov.i32	q8,#1		@ compose 1<<96
+	veor	q9,q9,q9
+	vrev32.8	q0,q0
+	vext.8	q8,q9,q8,#4
+	vrev32.8	q4,q4
+	vadd.u32	q9,q8,q8	@ compose 2<<96
+	vstmia	sp, {q4}		@ save adjusted round0 key
+	b	.Lctr_enc_loop
+
+.align	4
+.Lctr_enc_loop:
+	vadd.u32	q10, q8, q9	@ compose 3<<96
+	vadd.u32	q1, q0, q8	@ +1
+	vadd.u32	q2, q0, q9	@ +2
+	vadd.u32	q3, q0, q10	@ +3
+	vadd.u32	q4, q1, q10
+	vadd.u32	q5, q2, q10
+	vadd.u32	q6, q3, q10
+	vadd.u32	q7, q4, q10
+	vadd.u32	q10, q5, q10	@ next counter
+
+	@ Borrow prologue from _bsaes_encrypt8 to use the opportunity
+	@ to flip byte order in 32-bit counter
+
+	vldmia	sp, {q9}		@ load round0 key
+#ifndef	BSAES_ASM_EXTENDED_KEY
+	add	r4, sp, #0x10		@ pass next round key
+#else
+	add	r4, r3, #264
+#endif
+	vldmia	r8, {q8}			@ .LREVM0SR
+	mov	r5, r10			@ pass rounds
+	vstmia	r9, {q10}			@ save next counter
+#ifdef	__APPLE__
+	mov	r6, #:lower16:(.LREVM0SR-.LSR)
+	sub	r6, r8, r6
+#else
+	sub	r6, r8, #.LREVM0SR-.LSR	@ pass constants
+#endif
+
+	bl	_bsaes_encrypt8_alt
+
+	subs	r2, r2, #8
+	blo	.Lctr_enc_loop_done
+
+	vld1.8	{q8,q9}, [r0]!	@ load input
+	vld1.8	{q10,q11}, [r0]!
+	veor	q0, q8
+	veor	q1, q9
+	vld1.8	{q12,q13}, [r0]!
+	veor	q4, q10
+	veor	q6, q11
+	vld1.8	{q14,q15}, [r0]!
+	veor	q3, q12
+	vst1.8	{q0,q1}, [r1]!	@ write output
+	veor	q7, q13
+	veor	q2, q14
+	vst1.8	{q4}, [r1]!
+	veor	q5, q15
+	vst1.8	{q6}, [r1]!
+	vmov.i32	q8, #1			@ compose 1<<96
+	vst1.8	{q3}, [r1]!
+	veor	q9, q9, q9
+	vst1.8	{q7}, [r1]!
+	vext.8	q8, q9, q8, #4
+	vst1.8	{q2}, [r1]!
+	vadd.u32	q9,q8,q8		@ compose 2<<96
+	vst1.8	{q5}, [r1]!
+	vldmia	r9, {q0}			@ load counter
+
+	bne	.Lctr_enc_loop
+	b	.Lctr_enc_done
+
+.align	4
+.Lctr_enc_loop_done:
+	add	r2, r2, #8
+	vld1.8	{q8}, [r0]!	@ load input
+	veor	q0, q8
+	vst1.8	{q0}, [r1]!	@ write output
+	cmp	r2, #2
+	blo	.Lctr_enc_done
+	vld1.8	{q9}, [r0]!
+	veor	q1, q9
+	vst1.8	{q1}, [r1]!
+	beq	.Lctr_enc_done
+	vld1.8	{q10}, [r0]!
+	veor	q4, q10
+	vst1.8	{q4}, [r1]!
+	cmp	r2, #4
+	blo	.Lctr_enc_done
+	vld1.8	{q11}, [r0]!
+	veor	q6, q11
+	vst1.8	{q6}, [r1]!
+	beq	.Lctr_enc_done
+	vld1.8	{q12}, [r0]!
+	veor	q3, q12
+	vst1.8	{q3}, [r1]!
+	cmp	r2, #6
+	blo	.Lctr_enc_done
+	vld1.8	{q13}, [r0]!
+	veor	q7, q13
+	vst1.8	{q7}, [r1]!
+	beq	.Lctr_enc_done
+	vld1.8	{q14}, [r0]
+	veor	q2, q14
+	vst1.8	{q2}, [r1]!
+
+.Lctr_enc_done:
+	vmov.i32	q0, #0
+	vmov.i32	q1, #0
+#ifndef	BSAES_ASM_EXTENDED_KEY
+.Lctr_enc_bzero:@ wipe key schedule [if any]
+	vstmia	sp!, {q0,q1}
+	cmp	sp, r9
+	bne	.Lctr_enc_bzero
+#else
+	vstmia	sp, {q0,q1}
+#endif
+
+	mov	sp, r9
+	add	sp, #0x10		@ add sp,r9,#0x10 is no good for thumb
+	VFP_ABI_POP
+	ldmia	sp!, {r4,r5,r6,r7,r8,r9,r10, pc}	@ return
+
+.align	4
+.Lctr_enc_short:
+	ldr	ip, [sp]		@ ctr pointer is passed on stack
+	stmdb	sp!, {r4,r5,r6,r7,r8, lr}
+
+	mov	r4, r0		@ copy arguments
+	mov	r5, r1
+	mov	r6, r2
+	mov	r7, r3
+	ldr	r8, [ip, #12]		@ load counter .LSW
+	vld1.8	{q1}, [ip]		@ load whole counter value
+#ifdef __ARMEL__
+	rev	r8, r8
+#endif
+	sub	sp, sp, #0x10
+	vst1.8	{q1}, [sp]		@ copy counter value
+	sub	sp, sp, #0x10
+
+.Lctr_enc_short_loop:
+	add	r0, sp, #0x10		@ input counter value
+	mov	r1, sp			@ output on the stack
+	mov	r2, r7			@ key
+
+	bl	AES_encrypt
+
+	vld1.8	{q0}, [r4]!	@ load input
+	vld1.8	{q1}, [sp]		@ load encrypted counter
+	add	r8, r8, #1
+#ifdef __ARMEL__
+	rev	r0, r8
+	str	r0, [sp, #0x1c]		@ next counter value
+#else
+	str	r8, [sp, #0x1c]		@ next counter value
+#endif
+	veor	q0,q0,q1
+	vst1.8	{q0}, [r5]!	@ store output
+	subs	r6, r6, #1
+	bne	.Lctr_enc_short_loop
+
+	vmov.i32	q0, #0
+	vmov.i32	q1, #0
+	vstmia	sp!, {q0,q1}
+
+	ldmia	sp!, {r4,r5,r6,r7,r8, pc}
+.size	bsaes_ctr32_encrypt_blocks,.-bsaes_ctr32_encrypt_blocks
+.globl	bsaes_xts_encrypt
+.hidden	bsaes_xts_encrypt
+.type	bsaes_xts_encrypt,%function
+.align	4
+bsaes_xts_encrypt:
+	mov	ip, sp
+	stmdb	sp!, {r4,r5,r6,r7,r8,r9,r10, lr}		@ 0x20
+	VFP_ABI_PUSH
+	mov	r6, sp				@ future r3
+
+	mov	r7, r0
+	mov	r8, r1
+	mov	r9, r2
+	mov	r10, r3
+
+	sub	r0, sp, #0x10			@ 0x10
+	bic	r0, #0xf			@ align at 16 bytes
+	mov	sp, r0
+
+#ifdef	XTS_CHAIN_TWEAK
+	ldr	r0, [ip]			@ pointer to input tweak
+#else
+	@ generate initial tweak
+	ldr	r0, [ip, #4]			@ iv[]
+	mov	r1, sp
+	ldr	r2, [ip, #0]			@ key2
+	bl	AES_encrypt
+	mov	r0,sp				@ pointer to initial tweak
+#endif
+
+	ldr	r1, [r10, #240]		@ get # of rounds
+	mov	r3, r6
+#ifndef	BSAES_ASM_EXTENDED_KEY
+	@ allocate the key schedule on the stack
+	sub	r12, sp, r1, lsl#7		@ 128 bytes per inner round key
+	@ add	r12, #96			@ size of bit-sliced key schedule
+	sub	r12, #48			@ place for tweak[9]
+
+	@ populate the key schedule
+	mov	r4, r10			@ pass key
+	mov	r5, r1			@ pass # of rounds
+	mov	sp, r12
+	add	r12, #0x90			@ pass key schedule
+	bl	_bsaes_key_convert
+	veor	q7, q7, q15	@ fix up last round key
+	vstmia	r12, {q7}			@ save last round key
+#else
+	ldr	r12, [r10, #244]
+	eors	r12, #1
+	beq	0f
+
+	str	r12, [r10, #244]
+	mov	r4, r10			@ pass key
+	mov	r5, r1			@ pass # of rounds
+	add	r12, r10, #248			@ pass key schedule
+	bl	_bsaes_key_convert
+	veor	q7, q7, q15	@ fix up last round key
+	vstmia	r12, {q7}
+
+.align	2
+	sub	sp, #0x90			@ place for tweak[9]
+#endif
+
+	vld1.8	{q8}, [r0]			@ initial tweak
+	adr	r2, .Lxts_magic
+
+	subs	r9, #0x80
+	blo	.Lxts_enc_short
+	b	.Lxts_enc_loop
+
+.align	4
+.Lxts_enc_loop:
+	vldmia	r2, {q5}	@ load XTS magic
+	vshr.s64	q6, q8, #63
+	mov	r0, sp
+	vand	q6, q6, q5
+	vadd.u64	q9, q8, q8
+	vst1.64	{q8}, [r0,:128]!
+	vswp	d13,d12
+	vshr.s64	q7, q9, #63
+	veor	q9, q9, q6
+	vand	q7, q7, q5
+	vadd.u64	q10, q9, q9
+	vst1.64	{q9}, [r0,:128]!
+	vswp	d15,d14
+	vshr.s64	q6, q10, #63
+	veor	q10, q10, q7
+	vand	q6, q6, q5
+	vld1.8	{q0}, [r7]!
+	vadd.u64	q11, q10, q10
+	vst1.64	{q10}, [r0,:128]!
+	vswp	d13,d12
+	vshr.s64	q7, q11, #63
+	veor	q11, q11, q6
+	vand	q7, q7, q5
+	vld1.8	{q1}, [r7]!
+	veor	q0, q0, q8
+	vadd.u64	q12, q11, q11
+	vst1.64	{q11}, [r0,:128]!
+	vswp	d15,d14
+	vshr.s64	q6, q12, #63
+	veor	q12, q12, q7
+	vand	q6, q6, q5
+	vld1.8	{q2}, [r7]!
+	veor	q1, q1, q9
+	vadd.u64	q13, q12, q12
+	vst1.64	{q12}, [r0,:128]!
+	vswp	d13,d12
+	vshr.s64	q7, q13, #63
+	veor	q13, q13, q6
+	vand	q7, q7, q5
+	vld1.8	{q3}, [r7]!
+	veor	q2, q2, q10
+	vadd.u64	q14, q13, q13
+	vst1.64	{q13}, [r0,:128]!
+	vswp	d15,d14
+	vshr.s64	q6, q14, #63
+	veor	q14, q14, q7
+	vand	q6, q6, q5
+	vld1.8	{q4}, [r7]!
+	veor	q3, q3, q11
+	vadd.u64	q15, q14, q14
+	vst1.64	{q14}, [r0,:128]!
+	vswp	d13,d12
+	vshr.s64	q7, q15, #63
+	veor	q15, q15, q6
+	vand	q7, q7, q5
+	vld1.8	{q5}, [r7]!
+	veor	q4, q4, q12
+	vadd.u64	q8, q15, q15
+	vst1.64	{q15}, [r0,:128]!
+	vswp	d15,d14
+	veor	q8, q8, q7
+	vst1.64	{q8}, [r0,:128]		@ next round tweak
+
+	vld1.8	{q6,q7}, [r7]!
+	veor	q5, q5, q13
+#ifndef	BSAES_ASM_EXTENDED_KEY
+	add	r4, sp, #0x90			@ pass key schedule
+#else
+	add	r4, r10, #248			@ pass key schedule
+#endif
+	veor	q6, q6, q14
+	mov	r5, r1			@ pass rounds
+	veor	q7, q7, q15
+	mov	r0, sp
+
+	bl	_bsaes_encrypt8
+
+	vld1.64	{q8,q9}, [r0,:128]!
+	vld1.64	{q10,q11}, [r0,:128]!
+	veor	q0, q0, q8
+	vld1.64	{q12,q13}, [r0,:128]!
+	veor	q1, q1, q9
+	veor	q8, q4, q10
+	vst1.8	{q0,q1}, [r8]!
+	veor	q9, q6, q11
+	vld1.64	{q14,q15}, [r0,:128]!
+	veor	q10, q3, q12
+	vst1.8	{q8,q9}, [r8]!
+	veor	q11, q7, q13
+	veor	q12, q2, q14
+	vst1.8	{q10,q11}, [r8]!
+	veor	q13, q5, q15
+	vst1.8	{q12,q13}, [r8]!
+
+	vld1.64	{q8}, [r0,:128]		@ next round tweak
+
+	subs	r9, #0x80
+	bpl	.Lxts_enc_loop
+
+.Lxts_enc_short:
+	adds	r9, #0x70
+	bmi	.Lxts_enc_done
+
+	vldmia	r2, {q5}	@ load XTS magic
+	vshr.s64	q7, q8, #63
+	mov	r0, sp
+	vand	q7, q7, q5
+	vadd.u64	q9, q8, q8
+	vst1.64	{q8}, [r0,:128]!
+	vswp	d15,d14
+	vshr.s64	q6, q9, #63
+	veor	q9, q9, q7
+	vand	q6, q6, q5
+	vadd.u64	q10, q9, q9
+	vst1.64	{q9}, [r0,:128]!
+	vswp	d13,d12
+	vshr.s64	q7, q10, #63
+	veor	q10, q10, q6
+	vand	q7, q7, q5
+	vld1.8	{q0}, [r7]!
+	subs	r9, #0x10
+	bmi	.Lxts_enc_1
+	vadd.u64	q11, q10, q10
+	vst1.64	{q10}, [r0,:128]!
+	vswp	d15,d14
+	vshr.s64	q6, q11, #63
+	veor	q11, q11, q7
+	vand	q6, q6, q5
+	vld1.8	{q1}, [r7]!
+	subs	r9, #0x10
+	bmi	.Lxts_enc_2
+	veor	q0, q0, q8
+	vadd.u64	q12, q11, q11
+	vst1.64	{q11}, [r0,:128]!
+	vswp	d13,d12
+	vshr.s64	q7, q12, #63
+	veor	q12, q12, q6
+	vand	q7, q7, q5
+	vld1.8	{q2}, [r7]!
+	subs	r9, #0x10
+	bmi	.Lxts_enc_3
+	veor	q1, q1, q9
+	vadd.u64	q13, q12, q12
+	vst1.64	{q12}, [r0,:128]!
+	vswp	d15,d14
+	vshr.s64	q6, q13, #63
+	veor	q13, q13, q7
+	vand	q6, q6, q5
+	vld1.8	{q3}, [r7]!
+	subs	r9, #0x10
+	bmi	.Lxts_enc_4
+	veor	q2, q2, q10
+	vadd.u64	q14, q13, q13
+	vst1.64	{q13}, [r0,:128]!
+	vswp	d13,d12
+	vshr.s64	q7, q14, #63
+	veor	q14, q14, q6
+	vand	q7, q7, q5
+	vld1.8	{q4}, [r7]!
+	subs	r9, #0x10
+	bmi	.Lxts_enc_5
+	veor	q3, q3, q11
+	vadd.u64	q15, q14, q14
+	vst1.64	{q14}, [r0,:128]!
+	vswp	d15,d14
+	vshr.s64	q6, q15, #63
+	veor	q15, q15, q7
+	vand	q6, q6, q5
+	vld1.8	{q5}, [r7]!
+	subs	r9, #0x10
+	bmi	.Lxts_enc_6
+	veor	q4, q4, q12
+	sub	r9, #0x10
+	vst1.64	{q15}, [r0,:128]		@ next round tweak
+
+	vld1.8	{q6}, [r7]!
+	veor	q5, q5, q13
+#ifndef	BSAES_ASM_EXTENDED_KEY
+	add	r4, sp, #0x90			@ pass key schedule
+#else
+	add	r4, r10, #248			@ pass key schedule
+#endif
+	veor	q6, q6, q14
+	mov	r5, r1			@ pass rounds
+	mov	r0, sp
+
+	bl	_bsaes_encrypt8
+
+	vld1.64	{q8,q9}, [r0,:128]!
+	vld1.64	{q10,q11}, [r0,:128]!
+	veor	q0, q0, q8
+	vld1.64	{q12,q13}, [r0,:128]!
+	veor	q1, q1, q9
+	veor	q8, q4, q10
+	vst1.8	{q0,q1}, [r8]!
+	veor	q9, q6, q11
+	vld1.64	{q14}, [r0,:128]!
+	veor	q10, q3, q12
+	vst1.8	{q8,q9}, [r8]!
+	veor	q11, q7, q13
+	veor	q12, q2, q14
+	vst1.8	{q10,q11}, [r8]!
+	vst1.8	{q12}, [r8]!
+
+	vld1.64	{q8}, [r0,:128]		@ next round tweak
+	b	.Lxts_enc_done
+.align	4
+.Lxts_enc_6:
+	vst1.64	{q14}, [r0,:128]		@ next round tweak
+
+	veor	q4, q4, q12
+#ifndef	BSAES_ASM_EXTENDED_KEY
+	add	r4, sp, #0x90			@ pass key schedule
+#else
+	add	r4, r10, #248			@ pass key schedule
+#endif
+	veor	q5, q5, q13
+	mov	r5, r1			@ pass rounds
+	mov	r0, sp
+
+	bl	_bsaes_encrypt8
+
+	vld1.64	{q8,q9}, [r0,:128]!
+	vld1.64	{q10,q11}, [r0,:128]!
+	veor	q0, q0, q8
+	vld1.64	{q12,q13}, [r0,:128]!
+	veor	q1, q1, q9
+	veor	q8, q4, q10
+	vst1.8	{q0,q1}, [r8]!
+	veor	q9, q6, q11
+	veor	q10, q3, q12
+	vst1.8	{q8,q9}, [r8]!
+	veor	q11, q7, q13
+	vst1.8	{q10,q11}, [r8]!
+
+	vld1.64	{q8}, [r0,:128]		@ next round tweak
+	b	.Lxts_enc_done
+
+@ put this in range for both ARM and Thumb mode adr instructions
+.align	5
+.Lxts_magic:
+.quad	1, 0x87
+
+.align	5
+.Lxts_enc_5:
+	vst1.64	{q13}, [r0,:128]		@ next round tweak
+
+	veor	q3, q3, q11
+#ifndef	BSAES_ASM_EXTENDED_KEY
+	add	r4, sp, #0x90			@ pass key schedule
+#else
+	add	r4, r10, #248			@ pass key schedule
+#endif
+	veor	q4, q4, q12
+	mov	r5, r1			@ pass rounds
+	mov	r0, sp
+
+	bl	_bsaes_encrypt8
+
+	vld1.64	{q8,q9}, [r0,:128]!
+	vld1.64	{q10,q11}, [r0,:128]!
+	veor	q0, q0, q8
+	vld1.64	{q12}, [r0,:128]!
+	veor	q1, q1, q9
+	veor	q8, q4, q10
+	vst1.8	{q0,q1}, [r8]!
+	veor	q9, q6, q11
+	veor	q10, q3, q12
+	vst1.8	{q8,q9}, [r8]!
+	vst1.8	{q10}, [r8]!
+
+	vld1.64	{q8}, [r0,:128]		@ next round tweak
+	b	.Lxts_enc_done
+.align	4
+.Lxts_enc_4:
+	vst1.64	{q12}, [r0,:128]		@ next round tweak
+
+	veor	q2, q2, q10
+#ifndef	BSAES_ASM_EXTENDED_KEY
+	add	r4, sp, #0x90			@ pass key schedule
+#else
+	add	r4, r10, #248			@ pass key schedule
+#endif
+	veor	q3, q3, q11
+	mov	r5, r1			@ pass rounds
+	mov	r0, sp
+
+	bl	_bsaes_encrypt8
+
+	vld1.64	{q8,q9}, [r0,:128]!
+	vld1.64	{q10,q11}, [r0,:128]!
+	veor	q0, q0, q8
+	veor	q1, q1, q9
+	veor	q8, q4, q10
+	vst1.8	{q0,q1}, [r8]!
+	veor	q9, q6, q11
+	vst1.8	{q8,q9}, [r8]!
+
+	vld1.64	{q8}, [r0,:128]		@ next round tweak
+	b	.Lxts_enc_done
+.align	4
+.Lxts_enc_3:
+	vst1.64	{q11}, [r0,:128]		@ next round tweak
+
+	veor	q1, q1, q9
+#ifndef	BSAES_ASM_EXTENDED_KEY
+	add	r4, sp, #0x90			@ pass key schedule
+#else
+	add	r4, r10, #248			@ pass key schedule
+#endif
+	veor	q2, q2, q10
+	mov	r5, r1			@ pass rounds
+	mov	r0, sp
+
+	bl	_bsaes_encrypt8
+
+	vld1.64	{q8,q9}, [r0,:128]!
+	vld1.64	{q10}, [r0,:128]!
+	veor	q0, q0, q8
+	veor	q1, q1, q9
+	veor	q8, q4, q10
+	vst1.8	{q0,q1}, [r8]!
+	vst1.8	{q8}, [r8]!
+
+	vld1.64	{q8}, [r0,:128]		@ next round tweak
+	b	.Lxts_enc_done
+.align	4
+.Lxts_enc_2:
+	vst1.64	{q10}, [r0,:128]		@ next round tweak
+
+	veor	q0, q0, q8
+#ifndef	BSAES_ASM_EXTENDED_KEY
+	add	r4, sp, #0x90			@ pass key schedule
+#else
+	add	r4, r10, #248			@ pass key schedule
+#endif
+	veor	q1, q1, q9
+	mov	r5, r1			@ pass rounds
+	mov	r0, sp
+
+	bl	_bsaes_encrypt8
+
+	vld1.64	{q8,q9}, [r0,:128]!
+	veor	q0, q0, q8
+	veor	q1, q1, q9
+	vst1.8	{q0,q1}, [r8]!
+
+	vld1.64	{q8}, [r0,:128]		@ next round tweak
+	b	.Lxts_enc_done
+.align	4
+.Lxts_enc_1:
+	mov	r0, sp
+	veor	q0, q8
+	mov	r1, sp
+	vst1.8	{q0}, [sp,:128]
+	mov	r2, r10
+	mov	r4, r3				@ preserve fp
+
+	bl	AES_encrypt
+
+	vld1.8	{q0}, [sp,:128]
+	veor	q0, q0, q8
+	vst1.8	{q0}, [r8]!
+	mov	r3, r4
+
+	vmov	q8, q9		@ next round tweak
+
+.Lxts_enc_done:
+#ifndef	XTS_CHAIN_TWEAK
+	adds	r9, #0x10
+	beq	.Lxts_enc_ret
+	sub	r6, r8, #0x10
+
+.Lxts_enc_steal:
+	ldrb	r0, [r7], #1
+	ldrb	r1, [r8, #-0x10]
+	strb	r0, [r8, #-0x10]
+	strb	r1, [r8], #1
+
+	subs	r9, #1
+	bhi	.Lxts_enc_steal
+
+	vld1.8	{q0}, [r6]
+	mov	r0, sp
+	veor	q0, q0, q8
+	mov	r1, sp
+	vst1.8	{q0}, [sp,:128]
+	mov	r2, r10
+	mov	r4, r3			@ preserve fp
+
+	bl	AES_encrypt
+
+	vld1.8	{q0}, [sp,:128]
+	veor	q0, q0, q8
+	vst1.8	{q0}, [r6]
+	mov	r3, r4
+#endif
+
+.Lxts_enc_ret:
+	bic	r0, r3, #0xf
+	vmov.i32	q0, #0
+	vmov.i32	q1, #0
+#ifdef	XTS_CHAIN_TWEAK
+	ldr	r1, [r3, #0x20+VFP_ABI_FRAME]	@ chain tweak
+#endif
+.Lxts_enc_bzero:@ wipe key schedule [if any]
+	vstmia	sp!, {q0,q1}
+	cmp	sp, r0
+	bne	.Lxts_enc_bzero
+
+	mov	sp, r3
+#ifdef	XTS_CHAIN_TWEAK
+	vst1.8	{q8}, [r1]
+#endif
+	VFP_ABI_POP
+	ldmia	sp!, {r4,r5,r6,r7,r8,r9,r10, pc}	@ return
+
+.size	bsaes_xts_encrypt,.-bsaes_xts_encrypt
+
+.globl	bsaes_xts_decrypt
+.hidden	bsaes_xts_decrypt
+.type	bsaes_xts_decrypt,%function
+.align	4
+bsaes_xts_decrypt:
+	mov	ip, sp
+	stmdb	sp!, {r4,r5,r6,r7,r8,r9,r10, lr}		@ 0x20
+	VFP_ABI_PUSH
+	mov	r6, sp				@ future r3
+
+	mov	r7, r0
+	mov	r8, r1
+	mov	r9, r2
+	mov	r10, r3
+
+	sub	r0, sp, #0x10			@ 0x10
+	bic	r0, #0xf			@ align at 16 bytes
+	mov	sp, r0
+
+#ifdef	XTS_CHAIN_TWEAK
+	ldr	r0, [ip]			@ pointer to input tweak
+#else
+	@ generate initial tweak
+	ldr	r0, [ip, #4]			@ iv[]
+	mov	r1, sp
+	ldr	r2, [ip, #0]			@ key2
+	bl	AES_encrypt
+	mov	r0, sp				@ pointer to initial tweak
+#endif
+
+	ldr	r1, [r10, #240]		@ get # of rounds
+	mov	r3, r6
+#ifndef	BSAES_ASM_EXTENDED_KEY
+	@ allocate the key schedule on the stack
+	sub	r12, sp, r1, lsl#7		@ 128 bytes per inner round key
+	@ add	r12, #96			@ size of bit-sliced key schedule
+	sub	r12, #48			@ place for tweak[9]
+
+	@ populate the key schedule
+	mov	r4, r10			@ pass key
+	mov	r5, r1			@ pass # of rounds
+	mov	sp, r12
+	add	r12, #0x90			@ pass key schedule
+	bl	_bsaes_key_convert
+	add	r4, sp, #0x90
+	vldmia	r4, {q6}
+	vstmia	r12,  {q15}		@ save last round key
+	veor	q7, q7, q6	@ fix up round 0 key
+	vstmia	r4, {q7}
+#else
+	ldr	r12, [r10, #244]
+	eors	r12, #1
+	beq	0f
+
+	str	r12, [r10, #244]
+	mov	r4, r10			@ pass key
+	mov	r5, r1			@ pass # of rounds
+	add	r12, r10, #248			@ pass key schedule
+	bl	_bsaes_key_convert
+	add	r4, r10, #248
+	vldmia	r4, {q6}
+	vstmia	r12,  {q15}		@ save last round key
+	veor	q7, q7, q6	@ fix up round 0 key
+	vstmia	r4, {q7}
+
+.align	2
+	sub	sp, #0x90			@ place for tweak[9]
+#endif
+	vld1.8	{q8}, [r0]			@ initial tweak
+	adr	r2, .Lxts_magic
+
+#ifndef	XTS_CHAIN_TWEAK
+	tst	r9, #0xf			@ if not multiple of 16
+	it	ne				@ Thumb2 thing, sanity check in ARM
+	subne	r9, #0x10			@ subtract another 16 bytes
+#endif
+	subs	r9, #0x80
+
+	blo	.Lxts_dec_short
+	b	.Lxts_dec_loop
+
+.align	4
+.Lxts_dec_loop:
+	vldmia	r2, {q5}	@ load XTS magic
+	vshr.s64	q6, q8, #63
+	mov	r0, sp
+	vand	q6, q6, q5
+	vadd.u64	q9, q8, q8
+	vst1.64	{q8}, [r0,:128]!
+	vswp	d13,d12
+	vshr.s64	q7, q9, #63
+	veor	q9, q9, q6
+	vand	q7, q7, q5
+	vadd.u64	q10, q9, q9
+	vst1.64	{q9}, [r0,:128]!
+	vswp	d15,d14
+	vshr.s64	q6, q10, #63
+	veor	q10, q10, q7
+	vand	q6, q6, q5
+	vld1.8	{q0}, [r7]!
+	vadd.u64	q11, q10, q10
+	vst1.64	{q10}, [r0,:128]!
+	vswp	d13,d12
+	vshr.s64	q7, q11, #63
+	veor	q11, q11, q6
+	vand	q7, q7, q5
+	vld1.8	{q1}, [r7]!
+	veor	q0, q0, q8
+	vadd.u64	q12, q11, q11
+	vst1.64	{q11}, [r0,:128]!
+	vswp	d15,d14
+	vshr.s64	q6, q12, #63
+	veor	q12, q12, q7
+	vand	q6, q6, q5
+	vld1.8	{q2}, [r7]!
+	veor	q1, q1, q9
+	vadd.u64	q13, q12, q12
+	vst1.64	{q12}, [r0,:128]!
+	vswp	d13,d12
+	vshr.s64	q7, q13, #63
+	veor	q13, q13, q6
+	vand	q7, q7, q5
+	vld1.8	{q3}, [r7]!
+	veor	q2, q2, q10
+	vadd.u64	q14, q13, q13
+	vst1.64	{q13}, [r0,:128]!
+	vswp	d15,d14
+	vshr.s64	q6, q14, #63
+	veor	q14, q14, q7
+	vand	q6, q6, q5
+	vld1.8	{q4}, [r7]!
+	veor	q3, q3, q11
+	vadd.u64	q15, q14, q14
+	vst1.64	{q14}, [r0,:128]!
+	vswp	d13,d12
+	vshr.s64	q7, q15, #63
+	veor	q15, q15, q6
+	vand	q7, q7, q5
+	vld1.8	{q5}, [r7]!
+	veor	q4, q4, q12
+	vadd.u64	q8, q15, q15
+	vst1.64	{q15}, [r0,:128]!
+	vswp	d15,d14
+	veor	q8, q8, q7
+	vst1.64	{q8}, [r0,:128]		@ next round tweak
+
+	vld1.8	{q6,q7}, [r7]!
+	veor	q5, q5, q13
+#ifndef	BSAES_ASM_EXTENDED_KEY
+	add	r4, sp, #0x90			@ pass key schedule
+#else
+	add	r4, r10, #248			@ pass key schedule
+#endif
+	veor	q6, q6, q14
+	mov	r5, r1			@ pass rounds
+	veor	q7, q7, q15
+	mov	r0, sp
+
+	bl	_bsaes_decrypt8
+
+	vld1.64	{q8,q9}, [r0,:128]!
+	vld1.64	{q10,q11}, [r0,:128]!
+	veor	q0, q0, q8
+	vld1.64	{q12,q13}, [r0,:128]!
+	veor	q1, q1, q9
+	veor	q8, q6, q10
+	vst1.8	{q0,q1}, [r8]!
+	veor	q9, q4, q11
+	vld1.64	{q14,q15}, [r0,:128]!
+	veor	q10, q2, q12
+	vst1.8	{q8,q9}, [r8]!
+	veor	q11, q7, q13
+	veor	q12, q3, q14
+	vst1.8	{q10,q11}, [r8]!
+	veor	q13, q5, q15
+	vst1.8	{q12,q13}, [r8]!
+
+	vld1.64	{q8}, [r0,:128]		@ next round tweak
+
+	subs	r9, #0x80
+	bpl	.Lxts_dec_loop
+
+.Lxts_dec_short:
+	adds	r9, #0x70
+	bmi	.Lxts_dec_done
+
+	vldmia	r2, {q5}	@ load XTS magic
+	vshr.s64	q7, q8, #63
+	mov	r0, sp
+	vand	q7, q7, q5
+	vadd.u64	q9, q8, q8
+	vst1.64	{q8}, [r0,:128]!
+	vswp	d15,d14
+	vshr.s64	q6, q9, #63
+	veor	q9, q9, q7
+	vand	q6, q6, q5
+	vadd.u64	q10, q9, q9
+	vst1.64	{q9}, [r0,:128]!
+	vswp	d13,d12
+	vshr.s64	q7, q10, #63
+	veor	q10, q10, q6
+	vand	q7, q7, q5
+	vld1.8	{q0}, [r7]!
+	subs	r9, #0x10
+	bmi	.Lxts_dec_1
+	vadd.u64	q11, q10, q10
+	vst1.64	{q10}, [r0,:128]!
+	vswp	d15,d14
+	vshr.s64	q6, q11, #63
+	veor	q11, q11, q7
+	vand	q6, q6, q5
+	vld1.8	{q1}, [r7]!
+	subs	r9, #0x10
+	bmi	.Lxts_dec_2
+	veor	q0, q0, q8
+	vadd.u64	q12, q11, q11
+	vst1.64	{q11}, [r0,:128]!
+	vswp	d13,d12
+	vshr.s64	q7, q12, #63
+	veor	q12, q12, q6
+	vand	q7, q7, q5
+	vld1.8	{q2}, [r7]!
+	subs	r9, #0x10
+	bmi	.Lxts_dec_3
+	veor	q1, q1, q9
+	vadd.u64	q13, q12, q12
+	vst1.64	{q12}, [r0,:128]!
+	vswp	d15,d14
+	vshr.s64	q6, q13, #63
+	veor	q13, q13, q7
+	vand	q6, q6, q5
+	vld1.8	{q3}, [r7]!
+	subs	r9, #0x10
+	bmi	.Lxts_dec_4
+	veor	q2, q2, q10
+	vadd.u64	q14, q13, q13
+	vst1.64	{q13}, [r0,:128]!
+	vswp	d13,d12
+	vshr.s64	q7, q14, #63
+	veor	q14, q14, q6
+	vand	q7, q7, q5
+	vld1.8	{q4}, [r7]!
+	subs	r9, #0x10
+	bmi	.Lxts_dec_5
+	veor	q3, q3, q11
+	vadd.u64	q15, q14, q14
+	vst1.64	{q14}, [r0,:128]!
+	vswp	d15,d14
+	vshr.s64	q6, q15, #63
+	veor	q15, q15, q7
+	vand	q6, q6, q5
+	vld1.8	{q5}, [r7]!
+	subs	r9, #0x10
+	bmi	.Lxts_dec_6
+	veor	q4, q4, q12
+	sub	r9, #0x10
+	vst1.64	{q15}, [r0,:128]		@ next round tweak
+
+	vld1.8	{q6}, [r7]!
+	veor	q5, q5, q13
+#ifndef	BSAES_ASM_EXTENDED_KEY
+	add	r4, sp, #0x90			@ pass key schedule
+#else
+	add	r4, r10, #248			@ pass key schedule
+#endif
+	veor	q6, q6, q14
+	mov	r5, r1			@ pass rounds
+	mov	r0, sp
+
+	bl	_bsaes_decrypt8
+
+	vld1.64	{q8,q9}, [r0,:128]!
+	vld1.64	{q10,q11}, [r0,:128]!
+	veor	q0, q0, q8
+	vld1.64	{q12,q13}, [r0,:128]!
+	veor	q1, q1, q9
+	veor	q8, q6, q10
+	vst1.8	{q0,q1}, [r8]!
+	veor	q9, q4, q11
+	vld1.64	{q14}, [r0,:128]!
+	veor	q10, q2, q12
+	vst1.8	{q8,q9}, [r8]!
+	veor	q11, q7, q13
+	veor	q12, q3, q14
+	vst1.8	{q10,q11}, [r8]!
+	vst1.8	{q12}, [r8]!
+
+	vld1.64	{q8}, [r0,:128]		@ next round tweak
+	b	.Lxts_dec_done
+.align	4
+.Lxts_dec_6:
+	vst1.64	{q14}, [r0,:128]		@ next round tweak
+
+	veor	q4, q4, q12
+#ifndef	BSAES_ASM_EXTENDED_KEY
+	add	r4, sp, #0x90			@ pass key schedule
+#else
+	add	r4, r10, #248			@ pass key schedule
+#endif
+	veor	q5, q5, q13
+	mov	r5, r1			@ pass rounds
+	mov	r0, sp
+
+	bl	_bsaes_decrypt8
+
+	vld1.64	{q8,q9}, [r0,:128]!
+	vld1.64	{q10,q11}, [r0,:128]!
+	veor	q0, q0, q8
+	vld1.64	{q12,q13}, [r0,:128]!
+	veor	q1, q1, q9
+	veor	q8, q6, q10
+	vst1.8	{q0,q1}, [r8]!
+	veor	q9, q4, q11
+	veor	q10, q2, q12
+	vst1.8	{q8,q9}, [r8]!
+	veor	q11, q7, q13
+	vst1.8	{q10,q11}, [r8]!
+
+	vld1.64	{q8}, [r0,:128]		@ next round tweak
+	b	.Lxts_dec_done
+.align	4
+.Lxts_dec_5:
+	vst1.64	{q13}, [r0,:128]		@ next round tweak
+
+	veor	q3, q3, q11
+#ifndef	BSAES_ASM_EXTENDED_KEY
+	add	r4, sp, #0x90			@ pass key schedule
+#else
+	add	r4, r10, #248			@ pass key schedule
+#endif
+	veor	q4, q4, q12
+	mov	r5, r1			@ pass rounds
+	mov	r0, sp
+
+	bl	_bsaes_decrypt8
+
+	vld1.64	{q8,q9}, [r0,:128]!
+	vld1.64	{q10,q11}, [r0,:128]!
+	veor	q0, q0, q8
+	vld1.64	{q12}, [r0,:128]!
+	veor	q1, q1, q9
+	veor	q8, q6, q10
+	vst1.8	{q0,q1}, [r8]!
+	veor	q9, q4, q11
+	veor	q10, q2, q12
+	vst1.8	{q8,q9}, [r8]!
+	vst1.8	{q10}, [r8]!
+
+	vld1.64	{q8}, [r0,:128]		@ next round tweak
+	b	.Lxts_dec_done
+.align	4
+.Lxts_dec_4:
+	vst1.64	{q12}, [r0,:128]		@ next round tweak
+
+	veor	q2, q2, q10
+#ifndef	BSAES_ASM_EXTENDED_KEY
+	add	r4, sp, #0x90			@ pass key schedule
+#else
+	add	r4, r10, #248			@ pass key schedule
+#endif
+	veor	q3, q3, q11
+	mov	r5, r1			@ pass rounds
+	mov	r0, sp
+
+	bl	_bsaes_decrypt8
+
+	vld1.64	{q8,q9}, [r0,:128]!
+	vld1.64	{q10,q11}, [r0,:128]!
+	veor	q0, q0, q8
+	veor	q1, q1, q9
+	veor	q8, q6, q10
+	vst1.8	{q0,q1}, [r8]!
+	veor	q9, q4, q11
+	vst1.8	{q8,q9}, [r8]!
+
+	vld1.64	{q8}, [r0,:128]		@ next round tweak
+	b	.Lxts_dec_done
+.align	4
+.Lxts_dec_3:
+	vst1.64	{q11}, [r0,:128]		@ next round tweak
+
+	veor	q1, q1, q9
+#ifndef	BSAES_ASM_EXTENDED_KEY
+	add	r4, sp, #0x90			@ pass key schedule
+#else
+	add	r4, r10, #248			@ pass key schedule
+#endif
+	veor	q2, q2, q10
+	mov	r5, r1			@ pass rounds
+	mov	r0, sp
+
+	bl	_bsaes_decrypt8
+
+	vld1.64	{q8,q9}, [r0,:128]!
+	vld1.64	{q10}, [r0,:128]!
+	veor	q0, q0, q8
+	veor	q1, q1, q9
+	veor	q8, q6, q10
+	vst1.8	{q0,q1}, [r8]!
+	vst1.8	{q8}, [r8]!
+
+	vld1.64	{q8}, [r0,:128]		@ next round tweak
+	b	.Lxts_dec_done
+.align	4
+.Lxts_dec_2:
+	vst1.64	{q10}, [r0,:128]		@ next round tweak
+
+	veor	q0, q0, q8
+#ifndef	BSAES_ASM_EXTENDED_KEY
+	add	r4, sp, #0x90			@ pass key schedule
+#else
+	add	r4, r10, #248			@ pass key schedule
+#endif
+	veor	q1, q1, q9
+	mov	r5, r1			@ pass rounds
+	mov	r0, sp
+
+	bl	_bsaes_decrypt8
+
+	vld1.64	{q8,q9}, [r0,:128]!
+	veor	q0, q0, q8
+	veor	q1, q1, q9
+	vst1.8	{q0,q1}, [r8]!
+
+	vld1.64	{q8}, [r0,:128]		@ next round tweak
+	b	.Lxts_dec_done
+.align	4
+.Lxts_dec_1:
+	mov	r0, sp
+	veor	q0, q8
+	mov	r1, sp
+	vst1.8	{q0}, [sp,:128]
+	mov	r2, r10
+	mov	r4, r3				@ preserve fp
+	mov	r5, r2			@ preserve magic
+
+	bl	AES_decrypt
+
+	vld1.8	{q0}, [sp,:128]
+	veor	q0, q0, q8
+	vst1.8	{q0}, [r8]!
+	mov	r3, r4
+	mov	r2, r5
+
+	vmov	q8, q9		@ next round tweak
+
+.Lxts_dec_done:
+#ifndef	XTS_CHAIN_TWEAK
+	adds	r9, #0x10
+	beq	.Lxts_dec_ret
+
+	@ calculate one round of extra tweak for the stolen ciphertext
+	vldmia	r2, {q5}
+	vshr.s64	q6, q8, #63
+	vand	q6, q6, q5
+	vadd.u64	q9, q8, q8
+	vswp	d13,d12
+	veor	q9, q9, q6
+
+	@ perform the final decryption with the last tweak value
+	vld1.8	{q0}, [r7]!
+	mov	r0, sp
+	veor	q0, q0, q9
+	mov	r1, sp
+	vst1.8	{q0}, [sp,:128]
+	mov	r2, r10
+	mov	r4, r3			@ preserve fp
+
+	bl	AES_decrypt
+
+	vld1.8	{q0}, [sp,:128]
+	veor	q0, q0, q9
+	vst1.8	{q0}, [r8]
+
+	mov	r6, r8
+.Lxts_dec_steal:
+	ldrb	r1, [r8]
+	ldrb	r0, [r7], #1
+	strb	r1, [r8, #0x10]
+	strb	r0, [r8], #1
+
+	subs	r9, #1
+	bhi	.Lxts_dec_steal
+
+	vld1.8	{q0}, [r6]
+	mov	r0, sp
+	veor	q0, q8
+	mov	r1, sp
+	vst1.8	{q0}, [sp,:128]
+	mov	r2, r10
+
+	bl	AES_decrypt
+
+	vld1.8	{q0}, [sp,:128]
+	veor	q0, q0, q8
+	vst1.8	{q0}, [r6]
+	mov	r3, r4
+#endif
+
+.Lxts_dec_ret:
+	bic	r0, r3, #0xf
+	vmov.i32	q0, #0
+	vmov.i32	q1, #0
+#ifdef	XTS_CHAIN_TWEAK
+	ldr	r1, [r3, #0x20+VFP_ABI_FRAME]	@ chain tweak
+#endif
+.Lxts_dec_bzero:@ wipe key schedule [if any]
+	vstmia	sp!, {q0,q1}
+	cmp	sp, r0
+	bne	.Lxts_dec_bzero
+
+	mov	sp, r3
+#ifdef	XTS_CHAIN_TWEAK
+	vst1.8	{q8}, [r1]
+#endif
+	VFP_ABI_POP
+	ldmia	sp!, {r4,r5,r6,r7,r8,r9,r10, pc}	@ return
+
+.size	bsaes_xts_decrypt,.-bsaes_xts_decrypt
+#endif
+#endif
+#endif
\ No newline at end of file
diff --git a/third_party/boringssl/linux-arm/crypto/bn/armv4-mont.S b/third_party/boringssl/linux-arm/crypto/bn/armv4-mont.S
new file mode 100644
index 0000000..68dfb2c
--- /dev/null
+++ b/third_party/boringssl/linux-arm/crypto/bn/armv4-mont.S
@@ -0,0 +1,589 @@
+#if defined(__arm__)
+#include "arm_arch.h"
+
+.text
+.code	32
+
+#if __ARM_MAX_ARCH__>=7
+.align	5
+.LOPENSSL_armcap:
+.word	OPENSSL_armcap_P-.Lbn_mul_mont
+#endif
+
+.globl	bn_mul_mont
+.hidden	bn_mul_mont
+.type	bn_mul_mont,%function
+
+.align	5
+bn_mul_mont:
+.Lbn_mul_mont:
+	ldr	ip,[sp,#4]		@ load num
+	stmdb	sp!,{r0,r2}		@ sp points at argument block
+#if __ARM_MAX_ARCH__>=7
+	tst	ip,#7
+	bne	.Lialu
+	adr	r0,bn_mul_mont
+	ldr	r2,.LOPENSSL_armcap
+	ldr	r0,[r0,r2]
+#ifdef	__APPLE__
+	ldr	r0,[r0]
+#endif
+	tst	r0,#1			@ NEON available?
+	ldmia	sp, {r0,r2}
+	beq	.Lialu
+	add	sp,sp,#8
+	b	bn_mul8x_mont_neon
+.align	4
+.Lialu:
+#endif
+	cmp	ip,#2
+	mov	r0,ip			@ load num
+	movlt	r0,#0
+	addlt	sp,sp,#2*4
+	blt	.Labrt
+
+	stmdb	sp!,{r4,r5,r6,r7,r8,r9,r10,r11,r12,lr}		@ save 10 registers
+
+	mov	r0,r0,lsl#2		@ rescale r0 for byte count
+	sub	sp,sp,r0		@ alloca(4*num)
+	sub	sp,sp,#4		@ +extra dword
+	sub	r0,r0,#4		@ "num=num-1"
+	add	r4,r2,r0		@ &bp[num-1]
+
+	add	r0,sp,r0		@ r0 to point at &tp[num-1]
+	ldr	r8,[r0,#14*4]		@ &n0
+	ldr	r2,[r2]		@ bp[0]
+	ldr	r5,[r1],#4		@ ap[0],ap++
+	ldr	r6,[r3],#4		@ np[0],np++
+	ldr	r8,[r8]		@ *n0
+	str	r4,[r0,#15*4]		@ save &bp[num]
+
+	umull	r10,r11,r5,r2	@ ap[0]*bp[0]
+	str	r8,[r0,#14*4]		@ save n0 value
+	mul	r8,r10,r8		@ "tp[0]"*n0
+	mov	r12,#0
+	umlal	r10,r12,r6,r8	@ np[0]*n0+"t[0]"
+	mov	r4,sp
+
+.L1st:
+	ldr	r5,[r1],#4		@ ap[j],ap++
+	mov	r10,r11
+	ldr	r6,[r3],#4		@ np[j],np++
+	mov	r11,#0
+	umlal	r10,r11,r5,r2	@ ap[j]*bp[0]
+	mov	r14,#0
+	umlal	r12,r14,r6,r8	@ np[j]*n0
+	adds	r12,r12,r10
+	str	r12,[r4],#4		@ tp[j-1]=,tp++
+	adc	r12,r14,#0
+	cmp	r4,r0
+	bne	.L1st
+
+	adds	r12,r12,r11
+	ldr	r4,[r0,#13*4]		@ restore bp
+	mov	r14,#0
+	ldr	r8,[r0,#14*4]		@ restore n0
+	adc	r14,r14,#0
+	str	r12,[r0]		@ tp[num-1]=
+	str	r14,[r0,#4]		@ tp[num]=
+
+.Louter:
+	sub	r7,r0,sp		@ "original" r0-1 value
+	sub	r1,r1,r7		@ "rewind" ap to &ap[1]
+	ldr	r2,[r4,#4]!		@ *(++bp)
+	sub	r3,r3,r7		@ "rewind" np to &np[1]
+	ldr	r5,[r1,#-4]		@ ap[0]
+	ldr	r10,[sp]		@ tp[0]
+	ldr	r6,[r3,#-4]		@ np[0]
+	ldr	r7,[sp,#4]		@ tp[1]
+
+	mov	r11,#0
+	umlal	r10,r11,r5,r2	@ ap[0]*bp[i]+tp[0]
+	str	r4,[r0,#13*4]		@ save bp
+	mul	r8,r10,r8
+	mov	r12,#0
+	umlal	r10,r12,r6,r8	@ np[0]*n0+"tp[0]"
+	mov	r4,sp
+
+.Linner:
+	ldr	r5,[r1],#4		@ ap[j],ap++
+	adds	r10,r11,r7		@ +=tp[j]
+	ldr	r6,[r3],#4		@ np[j],np++
+	mov	r11,#0
+	umlal	r10,r11,r5,r2	@ ap[j]*bp[i]
+	mov	r14,#0
+	umlal	r12,r14,r6,r8	@ np[j]*n0
+	adc	r11,r11,#0
+	ldr	r7,[r4,#8]		@ tp[j+1]
+	adds	r12,r12,r10
+	str	r12,[r4],#4		@ tp[j-1]=,tp++
+	adc	r12,r14,#0
+	cmp	r4,r0
+	bne	.Linner
+
+	adds	r12,r12,r11
+	mov	r14,#0
+	ldr	r4,[r0,#13*4]		@ restore bp
+	adc	r14,r14,#0
+	ldr	r8,[r0,#14*4]		@ restore n0
+	adds	r12,r12,r7
+	ldr	r7,[r0,#15*4]		@ restore &bp[num]
+	adc	r14,r14,#0
+	str	r12,[r0]		@ tp[num-1]=
+	str	r14,[r0,#4]		@ tp[num]=
+
+	cmp	r4,r7
+	bne	.Louter
+
+	ldr	r2,[r0,#12*4]		@ pull rp
+	add	r0,r0,#4		@ r0 to point at &tp[num]
+	sub	r5,r0,sp		@ "original" num value
+	mov	r4,sp			@ "rewind" r4
+	mov	r1,r4			@ "borrow" r1
+	sub	r3,r3,r5		@ "rewind" r3 to &np[0]
+
+	subs	r7,r7,r7		@ "clear" carry flag
+.Lsub:	ldr	r7,[r4],#4
+	ldr	r6,[r3],#4
+	sbcs	r7,r7,r6		@ tp[j]-np[j]
+	str	r7,[r2],#4		@ rp[j]=
+	teq	r4,r0		@ preserve carry
+	bne	.Lsub
+	sbcs	r14,r14,#0		@ upmost carry
+	mov	r4,sp			@ "rewind" r4
+	sub	r2,r2,r5		@ "rewind" r2
+
+	and	r1,r4,r14
+	bic	r3,r2,r14
+	orr	r1,r1,r3		@ ap=borrow?tp:rp
+
+.Lcopy:	ldr	r7,[r1],#4		@ copy or in-place refresh
+	str	sp,[r4],#4		@ zap tp
+	str	r7,[r2],#4
+	cmp	r4,r0
+	bne	.Lcopy
+
+	add	sp,r0,#4		@ skip over tp[num+1]
+	ldmia	sp!,{r4,r5,r6,r7,r8,r9,r10,r11,r12,lr}		@ restore registers
+	add	sp,sp,#2*4		@ skip over {r0,r2}
+	mov	r0,#1
+.Labrt:
+#if __ARM_ARCH__>=5
+	bx	lr				@ .word	0xe12fff1e
+#else
+	tst	lr,#1
+	moveq	pc,lr			@ be binary compatible with V4, yet
+.word	0xe12fff1e			@ interoperable with Thumb ISA:-)
+#endif
+.size	bn_mul_mont,.-bn_mul_mont
+#if __ARM_MAX_ARCH__>=7
+.arch	armv7-a
+.fpu	neon
+
+.type	bn_mul8x_mont_neon,%function
+.align	5
+bn_mul8x_mont_neon:
+	mov	ip,sp
+	stmdb	sp!,{r4,r5,r6,r7,r8,r9,r10,r11}
+	vstmdb	sp!,{d8,d9,d10,d11,d12,d13,d14,d15}		@ ABI specification says so
+	ldmia	ip,{r4,r5}		@ load rest of parameter block
+
+	sub	r7,sp,#16
+	vld1.32	{d28[0]}, [r2,:32]!
+	sub	r7,r7,r5,lsl#4
+	vld1.32	{d0,d1,d2,d3},  [r1]!		@ can't specify :32 :-(
+	and	r7,r7,#-64
+	vld1.32	{d30[0]}, [r4,:32]
+	mov	sp,r7			@ alloca
+	veor	d8,d8,d8
+	subs	r8,r5,#8
+	vzip.16	d28,d8
+
+	vmull.u32	q6,d28,d0[0]
+	vmull.u32	q7,d28,d0[1]
+	vmull.u32	q8,d28,d1[0]
+	vshl.i64	d10,d13,#16
+	vmull.u32	q9,d28,d1[1]
+
+	vadd.u64	d10,d10,d12
+	veor	d8,d8,d8
+	vmul.u32	d29,d10,d30
+
+	vmull.u32	q10,d28,d2[0]
+	vld1.32	{d4,d5,d6,d7}, [r3]!
+	vmull.u32	q11,d28,d2[1]
+	vmull.u32	q12,d28,d3[0]
+	vzip.16	d29,d8
+	vmull.u32	q13,d28,d3[1]
+
+	bne	.LNEON_1st
+
+	@ special case for num=8, everything is in register bank...
+
+	vmlal.u32	q6,d29,d4[0]
+	sub	r9,r5,#1
+	vmlal.u32	q7,d29,d4[1]
+	vmlal.u32	q8,d29,d5[0]
+	vmlal.u32	q9,d29,d5[1]
+
+	vmlal.u32	q10,d29,d6[0]
+	vmov	q5,q6
+	vmlal.u32	q11,d29,d6[1]
+	vmov	q6,q7
+	vmlal.u32	q12,d29,d7[0]
+	vmov	q7,q8
+	vmlal.u32	q13,d29,d7[1]
+	vmov	q8,q9
+	vmov	q9,q10
+	vshr.u64	d10,d10,#16
+	vmov	q10,q11
+	vmov	q11,q12
+	vadd.u64	d10,d10,d11
+	vmov	q12,q13
+	veor	q13,q13
+	vshr.u64	d10,d10,#16
+
+	b	.LNEON_outer8
+
+.align	4
+.LNEON_outer8:
+	vld1.32	{d28[0]}, [r2,:32]!
+	veor	d8,d8,d8
+	vzip.16	d28,d8
+	vadd.u64	d12,d12,d10
+
+	vmlal.u32	q6,d28,d0[0]
+	vmlal.u32	q7,d28,d0[1]
+	vmlal.u32	q8,d28,d1[0]
+	vshl.i64	d10,d13,#16
+	vmlal.u32	q9,d28,d1[1]
+
+	vadd.u64	d10,d10,d12
+	veor	d8,d8,d8
+	subs	r9,r9,#1
+	vmul.u32	d29,d10,d30
+
+	vmlal.u32	q10,d28,d2[0]
+	vmlal.u32	q11,d28,d2[1]
+	vmlal.u32	q12,d28,d3[0]
+	vzip.16	d29,d8
+	vmlal.u32	q13,d28,d3[1]
+
+	vmlal.u32	q6,d29,d4[0]
+	vmlal.u32	q7,d29,d4[1]
+	vmlal.u32	q8,d29,d5[0]
+	vmlal.u32	q9,d29,d5[1]
+
+	vmlal.u32	q10,d29,d6[0]
+	vmov	q5,q6
+	vmlal.u32	q11,d29,d6[1]
+	vmov	q6,q7
+	vmlal.u32	q12,d29,d7[0]
+	vmov	q7,q8
+	vmlal.u32	q13,d29,d7[1]
+	vmov	q8,q9
+	vmov	q9,q10
+	vshr.u64	d10,d10,#16
+	vmov	q10,q11
+	vmov	q11,q12
+	vadd.u64	d10,d10,d11
+	vmov	q12,q13
+	veor	q13,q13
+	vshr.u64	d10,d10,#16
+
+	bne	.LNEON_outer8
+
+	vadd.u64	d12,d12,d10
+	mov	r7,sp
+	vshr.u64	d10,d12,#16
+	mov	r8,r5
+	vadd.u64	d13,d13,d10
+	add	r6,sp,#16
+	vshr.u64	d10,d13,#16
+	vzip.16	d12,d13
+
+	b	.LNEON_tail2
+
+.align	4
+.LNEON_1st:
+	vmlal.u32	q6,d29,d4[0]
+	vld1.32	{d0,d1,d2,d3}, [r1]!
+	vmlal.u32	q7,d29,d4[1]
+	subs	r8,r8,#8
+	vmlal.u32	q8,d29,d5[0]
+	vmlal.u32	q9,d29,d5[1]
+
+	vmlal.u32	q10,d29,d6[0]
+	vld1.32	{d4,d5}, [r3]!
+	vmlal.u32	q11,d29,d6[1]
+	vst1.64	{q6,q7}, [r7,:256]!
+	vmlal.u32	q12,d29,d7[0]
+	vmlal.u32	q13,d29,d7[1]
+	vst1.64	{q8,q9}, [r7,:256]!
+
+	vmull.u32	q6,d28,d0[0]
+	vld1.32	{d6,d7}, [r3]!
+	vmull.u32	q7,d28,d0[1]
+	vst1.64	{q10,q11}, [r7,:256]!
+	vmull.u32	q8,d28,d1[0]
+	vmull.u32	q9,d28,d1[1]
+	vst1.64	{q12,q13}, [r7,:256]!
+
+	vmull.u32	q10,d28,d2[0]
+	vmull.u32	q11,d28,d2[1]
+	vmull.u32	q12,d28,d3[0]
+	vmull.u32	q13,d28,d3[1]
+
+	bne	.LNEON_1st
+
+	vmlal.u32	q6,d29,d4[0]
+	add	r6,sp,#16
+	vmlal.u32	q7,d29,d4[1]
+	sub	r1,r1,r5,lsl#2		@ rewind r1
+	vmlal.u32	q8,d29,d5[0]
+	vld1.64	{q5}, [sp,:128]
+	vmlal.u32	q9,d29,d5[1]
+	sub	r9,r5,#1
+
+	vmlal.u32	q10,d29,d6[0]
+	vst1.64	{q6,q7}, [r7,:256]!
+	vmlal.u32	q11,d29,d6[1]
+	vshr.u64	d10,d10,#16
+	vld1.64	{q6},       [r6, :128]!
+	vmlal.u32	q12,d29,d7[0]
+	vst1.64	{q8,q9}, [r7,:256]!
+	vmlal.u32	q13,d29,d7[1]
+
+	vst1.64	{q10,q11}, [r7,:256]!
+	vadd.u64	d10,d10,d11
+	veor	q4,q4,q4
+	vst1.64	{q12,q13}, [r7,:256]!
+	vld1.64	{q7,q8}, [r6, :256]!
+	vst1.64	{q4},          [r7,:128]
+	vshr.u64	d10,d10,#16
+
+	b	.LNEON_outer
+
+.align	4
+.LNEON_outer:
+	vld1.32	{d28[0]}, [r2,:32]!
+	sub	r3,r3,r5,lsl#2		@ rewind r3
+	vld1.32	{d0,d1,d2,d3},  [r1]!
+	veor	d8,d8,d8
+	mov	r7,sp
+	vzip.16	d28,d8
+	sub	r8,r5,#8
+	vadd.u64	d12,d12,d10
+
+	vmlal.u32	q6,d28,d0[0]
+	vld1.64	{q9,q10},[r6,:256]!
+	vmlal.u32	q7,d28,d0[1]
+	vmlal.u32	q8,d28,d1[0]
+	vld1.64	{q11,q12},[r6,:256]!
+	vmlal.u32	q9,d28,d1[1]
+
+	vshl.i64	d10,d13,#16
+	veor	d8,d8,d8
+	vadd.u64	d10,d10,d12
+	vld1.64	{q13},[r6,:128]!
+	vmul.u32	d29,d10,d30
+
+	vmlal.u32	q10,d28,d2[0]
+	vld1.32	{d4,d5,d6,d7}, [r3]!
+	vmlal.u32	q11,d28,d2[1]
+	vmlal.u32	q12,d28,d3[0]
+	vzip.16	d29,d8
+	vmlal.u32	q13,d28,d3[1]
+
+.LNEON_inner:
+	vmlal.u32	q6,d29,d4[0]
+	vld1.32	{d0,d1,d2,d3}, [r1]!
+	vmlal.u32	q7,d29,d4[1]
+	subs	r8,r8,#8
+	vmlal.u32	q8,d29,d5[0]
+	vmlal.u32	q9,d29,d5[1]
+	vst1.64	{q6,q7}, [r7,:256]!
+
+	vmlal.u32	q10,d29,d6[0]
+	vld1.64	{q6},       [r6, :128]!
+	vmlal.u32	q11,d29,d6[1]
+	vst1.64	{q8,q9}, [r7,:256]!
+	vmlal.u32	q12,d29,d7[0]
+	vld1.64	{q7,q8}, [r6, :256]!
+	vmlal.u32	q13,d29,d7[1]
+	vst1.64	{q10,q11}, [r7,:256]!
+
+	vmlal.u32	q6,d28,d0[0]
+	vld1.64	{q9,q10}, [r6, :256]!
+	vmlal.u32	q7,d28,d0[1]
+	vst1.64	{q12,q13}, [r7,:256]!
+	vmlal.u32	q8,d28,d1[0]
+	vld1.64	{q11,q12}, [r6, :256]!
+	vmlal.u32	q9,d28,d1[1]
+	vld1.32	{d4,d5,d6,d7}, [r3]!
+
+	vmlal.u32	q10,d28,d2[0]
+	vld1.64	{q13},       [r6, :128]!
+	vmlal.u32	q11,d28,d2[1]
+	vmlal.u32	q12,d28,d3[0]
+	vmlal.u32	q13,d28,d3[1]
+
+	bne	.LNEON_inner
+
+	vmlal.u32	q6,d29,d4[0]
+	add	r6,sp,#16
+	vmlal.u32	q7,d29,d4[1]
+	sub	r1,r1,r5,lsl#2		@ rewind r1
+	vmlal.u32	q8,d29,d5[0]
+	vld1.64	{q5}, [sp,:128]
+	vmlal.u32	q9,d29,d5[1]
+	subs	r9,r9,#1
+
+	vmlal.u32	q10,d29,d6[0]
+	vst1.64	{q6,q7}, [r7,:256]!
+	vmlal.u32	q11,d29,d6[1]
+	vld1.64	{q6},       [r6, :128]!
+	vshr.u64	d10,d10,#16
+	vst1.64	{q8,q9}, [r7,:256]!
+	vmlal.u32	q12,d29,d7[0]
+	vld1.64	{q7,q8}, [r6, :256]!
+	vmlal.u32	q13,d29,d7[1]
+
+	vst1.64	{q10,q11}, [r7,:256]!
+	vadd.u64	d10,d10,d11
+	vst1.64	{q12,q13}, [r7,:256]!
+	vshr.u64	d10,d10,#16
+
+	bne	.LNEON_outer
+
+	mov	r7,sp
+	mov	r8,r5
+
+.LNEON_tail:
+	vadd.u64	d12,d12,d10
+	vld1.64	{q9,q10}, [r6, :256]!
+	vshr.u64	d10,d12,#16
+	vadd.u64	d13,d13,d10
+	vld1.64	{q11,q12}, [r6, :256]!
+	vshr.u64	d10,d13,#16
+	vld1.64	{q13},       [r6, :128]!
+	vzip.16	d12,d13
+
+.LNEON_tail2:
+	vadd.u64	d14,d14,d10
+	vst1.32	{d12[0]}, [r7, :32]!
+	vshr.u64	d10,d14,#16
+	vadd.u64	d15,d15,d10
+	vshr.u64	d10,d15,#16
+	vzip.16	d14,d15
+
+	vadd.u64	d16,d16,d10
+	vst1.32	{d14[0]}, [r7, :32]!
+	vshr.u64	d10,d16,#16
+	vadd.u64	d17,d17,d10
+	vshr.u64	d10,d17,#16
+	vzip.16	d16,d17
+
+	vadd.u64	d18,d18,d10
+	vst1.32	{d16[0]}, [r7, :32]!
+	vshr.u64	d10,d18,#16
+	vadd.u64	d19,d19,d10
+	vshr.u64	d10,d19,#16
+	vzip.16	d18,d19
+
+	vadd.u64	d20,d20,d10
+	vst1.32	{d18[0]}, [r7, :32]!
+	vshr.u64	d10,d20,#16
+	vadd.u64	d21,d21,d10
+	vshr.u64	d10,d21,#16
+	vzip.16	d20,d21
+
+	vadd.u64	d22,d22,d10
+	vst1.32	{d20[0]}, [r7, :32]!
+	vshr.u64	d10,d22,#16
+	vadd.u64	d23,d23,d10
+	vshr.u64	d10,d23,#16
+	vzip.16	d22,d23
+
+	vadd.u64	d24,d24,d10
+	vst1.32	{d22[0]}, [r7, :32]!
+	vshr.u64	d10,d24,#16
+	vadd.u64	d25,d25,d10
+	vld1.64	{q6}, [r6, :128]!
+	vshr.u64	d10,d25,#16
+	vzip.16	d24,d25
+
+	vadd.u64	d26,d26,d10
+	vst1.32	{d24[0]}, [r7, :32]!
+	vshr.u64	d10,d26,#16
+	vadd.u64	d27,d27,d10
+	vld1.64	{q7,q8},	[r6, :256]!
+	vshr.u64	d10,d27,#16
+	vzip.16	d26,d27
+	subs	r8,r8,#8
+	vst1.32	{d26[0]}, [r7, :32]!
+
+	bne	.LNEON_tail
+
+	vst1.32	{d10[0]}, [r7, :32]		@ top-most bit
+	sub	r3,r3,r5,lsl#2			@ rewind r3
+	subs	r1,sp,#0				@ clear carry flag
+	add	r2,sp,r5,lsl#2
+
+.LNEON_sub:
+	ldmia	r1!, {r4,r5,r6,r7}
+	ldmia	r3!, {r8,r9,r10,r11}
+	sbcs	r8, r4,r8
+	sbcs	r9, r5,r9
+	sbcs	r10,r6,r10
+	sbcs	r11,r7,r11
+	teq	r1,r2				@ preserves carry
+	stmia	r0!, {r8,r9,r10,r11}
+	bne	.LNEON_sub
+
+	ldr	r10, [r1]				@ load top-most bit
+	veor	q0,q0,q0
+	sub	r11,r2,sp				@ this is num*4
+	veor	q1,q1,q1
+	mov	r1,sp
+	sub	r0,r0,r11				@ rewind r0
+	mov	r3,r2				@ second 3/4th of frame
+	sbcs	r10,r10,#0				@ result is carry flag
+
+.LNEON_copy_n_zap:
+	ldmia	r1!, {r4,r5,r6,r7}
+	ldmia	r0,  {r8,r9,r10,r11}
+	movcc	r8, r4
+	vst1.64	{q0,q1}, [r3,:256]!			@ wipe
+	movcc	r9, r5
+	movcc	r10,r6
+	vst1.64	{q0,q1}, [r3,:256]!			@ wipe
+	movcc	r11,r7
+	ldmia	r1, {r4,r5,r6,r7}
+	stmia	r0!, {r8,r9,r10,r11}
+	sub	r1,r1,#16
+	ldmia	r0, {r8,r9,r10,r11}
+	movcc	r8, r4
+	vst1.64	{q0,q1}, [r1,:256]!			@ wipe
+	movcc	r9, r5
+	movcc	r10,r6
+	vst1.64	{q0,q1}, [r3,:256]!			@ wipe
+	movcc	r11,r7
+	teq	r1,r2				@ preserves carry
+	stmia	r0!, {r8,r9,r10,r11}
+	bne	.LNEON_copy_n_zap
+
+	sub	sp,ip,#96
+	vldmia	sp!,{d8,d9,d10,d11,d12,d13,d14,d15}
+	ldmia	sp!,{r4,r5,r6,r7,r8,r9,r10,r11}
+	bx	lr						@ .word	0xe12fff1e
+.size	bn_mul8x_mont_neon,.-bn_mul8x_mont_neon
+#endif
+.byte	77,111,110,116,103,111,109,101,114,121,32,109,117,108,116,105,112,108,105,99,97,116,105,111,110,32,102,111,114,32,65,82,77,118,52,47,78,69,79,78,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0
+.align	2
+.align	2
+#if __ARM_MAX_ARCH__>=7
+.comm	OPENSSL_armcap_P,4,4
+.hidden	OPENSSL_armcap_P
+#endif
+#endif
\ No newline at end of file
diff --git a/third_party/boringssl/linux-arm/crypto/modes/ghash-armv4.S b/third_party/boringssl/linux-arm/crypto/modes/ghash-armv4.S
new file mode 100644
index 0000000..c6f025d
--- /dev/null
+++ b/third_party/boringssl/linux-arm/crypto/modes/ghash-armv4.S
@@ -0,0 +1,541 @@
+#if defined(__arm__)
+#if defined(__arm__)
+#include "arm_arch.h"
+
+.syntax	unified
+
+.text
+.code	32
+
+#ifdef  __APPLE__
+#define ldrplb  ldrbpl
+#define ldrneb  ldrbne
+#endif
+
+.type	rem_4bit,%object
+.align	5
+rem_4bit:
+.short	0x0000,0x1C20,0x3840,0x2460
+.short	0x7080,0x6CA0,0x48C0,0x54E0
+.short	0xE100,0xFD20,0xD940,0xC560
+.short	0x9180,0x8DA0,0xA9C0,0xB5E0
+.size	rem_4bit,.-rem_4bit
+
+.type	rem_4bit_get,%function
+rem_4bit_get:
+	sub	r2,pc,#8
+	sub	r2,r2,#32	@ &rem_4bit
+	b	.Lrem_4bit_got
+	nop
+.size	rem_4bit_get,.-rem_4bit_get
+
+.globl	gcm_ghash_4bit
+.hidden	gcm_ghash_4bit
+.type	gcm_ghash_4bit,%function
+gcm_ghash_4bit:
+	sub	r12,pc,#8
+	add	r3,r2,r3		@ r3 to point at the end
+	stmdb	sp!,{r3,r4,r5,r6,r7,r8,r9,r10,r11,lr}		@ save r3/end too
+	sub	r12,r12,#48		@ &rem_4bit
+
+	ldmia	r12,{r4,r5,r6,r7,r8,r9,r10,r11}		@ copy rem_4bit ...
+	stmdb	sp!,{r4,r5,r6,r7,r8,r9,r10,r11}		@ ... to stack
+
+	ldrb	r12,[r2,#15]
+	ldrb	r14,[r0,#15]
+.Louter:
+	eor	r12,r12,r14
+	and	r14,r12,#0xf0
+	and	r12,r12,#0x0f
+	mov	r3,#14
+
+	add	r7,r1,r12,lsl#4
+	ldmia	r7,{r4,r5,r6,r7}	@ load Htbl[nlo]
+	add	r11,r1,r14
+	ldrb	r12,[r2,#14]
+
+	and	r14,r4,#0xf		@ rem
+	ldmia	r11,{r8,r9,r10,r11}	@ load Htbl[nhi]
+	add	r14,r14,r14
+	eor	r4,r8,r4,lsr#4
+	ldrh	r8,[sp,r14]		@ rem_4bit[rem]
+	eor	r4,r4,r5,lsl#28
+	ldrb	r14,[r0,#14]
+	eor	r5,r9,r5,lsr#4
+	eor	r5,r5,r6,lsl#28
+	eor	r6,r10,r6,lsr#4
+	eor	r6,r6,r7,lsl#28
+	eor	r7,r11,r7,lsr#4
+	eor	r12,r12,r14
+	and	r14,r12,#0xf0
+	and	r12,r12,#0x0f
+	eor	r7,r7,r8,lsl#16
+
+.Linner:
+	add	r11,r1,r12,lsl#4
+	and	r12,r4,#0xf		@ rem
+	subs	r3,r3,#1
+	add	r12,r12,r12
+	ldmia	r11,{r8,r9,r10,r11}	@ load Htbl[nlo]
+	eor	r4,r8,r4,lsr#4
+	eor	r4,r4,r5,lsl#28
+	eor	r5,r9,r5,lsr#4
+	eor	r5,r5,r6,lsl#28
+	ldrh	r8,[sp,r12]		@ rem_4bit[rem]
+	eor	r6,r10,r6,lsr#4
+	ldrbpl	r12,[r2,r3]
+	eor	r6,r6,r7,lsl#28
+	eor	r7,r11,r7,lsr#4
+
+	add	r11,r1,r14
+	and	r14,r4,#0xf		@ rem
+	eor	r7,r7,r8,lsl#16	@ ^= rem_4bit[rem]
+	add	r14,r14,r14
+	ldmia	r11,{r8,r9,r10,r11}	@ load Htbl[nhi]
+	eor	r4,r8,r4,lsr#4
+	ldrbpl	r8,[r0,r3]
+	eor	r4,r4,r5,lsl#28
+	eor	r5,r9,r5,lsr#4
+	ldrh	r9,[sp,r14]
+	eor	r5,r5,r6,lsl#28
+	eor	r6,r10,r6,lsr#4
+	eor	r6,r6,r7,lsl#28
+	eorpl	r12,r12,r8
+	eor	r7,r11,r7,lsr#4
+	andpl	r14,r12,#0xf0
+	andpl	r12,r12,#0x0f
+	eor	r7,r7,r9,lsl#16	@ ^= rem_4bit[rem]
+	bpl	.Linner
+
+	ldr	r3,[sp,#32]		@ re-load r3/end
+	add	r2,r2,#16
+	mov	r14,r4
+#if __ARM_ARCH__>=7 && defined(__ARMEL__)
+	rev	r4,r4
+	str	r4,[r0,#12]
+#elif defined(__ARMEB__)
+	str	r4,[r0,#12]
+#else
+	mov	r9,r4,lsr#8
+	strb	r4,[r0,#12+3]
+	mov	r10,r4,lsr#16
+	strb	r9,[r0,#12+2]
+	mov	r11,r4,lsr#24
+	strb	r10,[r0,#12+1]
+	strb	r11,[r0,#12]
+#endif
+	cmp	r2,r3
+#if __ARM_ARCH__>=7 && defined(__ARMEL__)
+	rev	r5,r5
+	str	r5,[r0,#8]
+#elif defined(__ARMEB__)
+	str	r5,[r0,#8]
+#else
+	mov	r9,r5,lsr#8
+	strb	r5,[r0,#8+3]
+	mov	r10,r5,lsr#16
+	strb	r9,[r0,#8+2]
+	mov	r11,r5,lsr#24
+	strb	r10,[r0,#8+1]
+	strb	r11,[r0,#8]
+#endif
+	ldrbne	r12,[r2,#15]
+#if __ARM_ARCH__>=7 && defined(__ARMEL__)
+	rev	r6,r6
+	str	r6,[r0,#4]
+#elif defined(__ARMEB__)
+	str	r6,[r0,#4]
+#else
+	mov	r9,r6,lsr#8
+	strb	r6,[r0,#4+3]
+	mov	r10,r6,lsr#16
+	strb	r9,[r0,#4+2]
+	mov	r11,r6,lsr#24
+	strb	r10,[r0,#4+1]
+	strb	r11,[r0,#4]
+#endif
+
+#if __ARM_ARCH__>=7 && defined(__ARMEL__)
+	rev	r7,r7
+	str	r7,[r0,#0]
+#elif defined(__ARMEB__)
+	str	r7,[r0,#0]
+#else
+	mov	r9,r7,lsr#8
+	strb	r7,[r0,#0+3]
+	mov	r10,r7,lsr#16
+	strb	r9,[r0,#0+2]
+	mov	r11,r7,lsr#24
+	strb	r10,[r0,#0+1]
+	strb	r11,[r0,#0]
+#endif
+
+	bne	.Louter
+
+	add	sp,sp,#36
+#if __ARM_ARCH__>=5
+	ldmia	sp!,{r4,r5,r6,r7,r8,r9,r10,r11,pc}
+#else
+	ldmia	sp!,{r4,r5,r6,r7,r8,r9,r10,r11,lr}
+	tst	lr,#1
+	moveq	pc,lr			@ be binary compatible with V4, yet
+.word	0xe12fff1e			@ interoperable with Thumb ISA:-)
+#endif
+.size	gcm_ghash_4bit,.-gcm_ghash_4bit
+
+.globl	gcm_gmult_4bit
+.hidden	gcm_gmult_4bit
+.type	gcm_gmult_4bit,%function
+gcm_gmult_4bit:
+	stmdb	sp!,{r4,r5,r6,r7,r8,r9,r10,r11,lr}
+	ldrb	r12,[r0,#15]
+	b	rem_4bit_get
+.Lrem_4bit_got:
+	and	r14,r12,#0xf0
+	and	r12,r12,#0x0f
+	mov	r3,#14
+
+	add	r7,r1,r12,lsl#4
+	ldmia	r7,{r4,r5,r6,r7}	@ load Htbl[nlo]
+	ldrb	r12,[r0,#14]
+
+	add	r11,r1,r14
+	and	r14,r4,#0xf		@ rem
+	ldmia	r11,{r8,r9,r10,r11}	@ load Htbl[nhi]
+	add	r14,r14,r14
+	eor	r4,r8,r4,lsr#4
+	ldrh	r8,[r2,r14]	@ rem_4bit[rem]
+	eor	r4,r4,r5,lsl#28
+	eor	r5,r9,r5,lsr#4
+	eor	r5,r5,r6,lsl#28
+	eor	r6,r10,r6,lsr#4
+	eor	r6,r6,r7,lsl#28
+	eor	r7,r11,r7,lsr#4
+	and	r14,r12,#0xf0
+	eor	r7,r7,r8,lsl#16
+	and	r12,r12,#0x0f
+
+.Loop:
+	add	r11,r1,r12,lsl#4
+	and	r12,r4,#0xf		@ rem
+	subs	r3,r3,#1
+	add	r12,r12,r12
+	ldmia	r11,{r8,r9,r10,r11}	@ load Htbl[nlo]
+	eor	r4,r8,r4,lsr#4
+	eor	r4,r4,r5,lsl#28
+	eor	r5,r9,r5,lsr#4
+	eor	r5,r5,r6,lsl#28
+	ldrh	r8,[r2,r12]	@ rem_4bit[rem]
+	eor	r6,r10,r6,lsr#4
+	ldrbpl	r12,[r0,r3]
+	eor	r6,r6,r7,lsl#28
+	eor	r7,r11,r7,lsr#4
+
+	add	r11,r1,r14
+	and	r14,r4,#0xf		@ rem
+	eor	r7,r7,r8,lsl#16	@ ^= rem_4bit[rem]
+	add	r14,r14,r14
+	ldmia	r11,{r8,r9,r10,r11}	@ load Htbl[nhi]
+	eor	r4,r8,r4,lsr#4
+	eor	r4,r4,r5,lsl#28
+	eor	r5,r9,r5,lsr#4
+	ldrh	r8,[r2,r14]	@ rem_4bit[rem]
+	eor	r5,r5,r6,lsl#28
+	eor	r6,r10,r6,lsr#4
+	eor	r6,r6,r7,lsl#28
+	eor	r7,r11,r7,lsr#4
+	andpl	r14,r12,#0xf0
+	andpl	r12,r12,#0x0f
+	eor	r7,r7,r8,lsl#16	@ ^= rem_4bit[rem]
+	bpl	.Loop
+#if __ARM_ARCH__>=7 && defined(__ARMEL__)
+	rev	r4,r4
+	str	r4,[r0,#12]
+#elif defined(__ARMEB__)
+	str	r4,[r0,#12]
+#else
+	mov	r9,r4,lsr#8
+	strb	r4,[r0,#12+3]
+	mov	r10,r4,lsr#16
+	strb	r9,[r0,#12+2]
+	mov	r11,r4,lsr#24
+	strb	r10,[r0,#12+1]
+	strb	r11,[r0,#12]
+#endif
+
+#if __ARM_ARCH__>=7 && defined(__ARMEL__)
+	rev	r5,r5
+	str	r5,[r0,#8]
+#elif defined(__ARMEB__)
+	str	r5,[r0,#8]
+#else
+	mov	r9,r5,lsr#8
+	strb	r5,[r0,#8+3]
+	mov	r10,r5,lsr#16
+	strb	r9,[r0,#8+2]
+	mov	r11,r5,lsr#24
+	strb	r10,[r0,#8+1]
+	strb	r11,[r0,#8]
+#endif
+
+#if __ARM_ARCH__>=7 && defined(__ARMEL__)
+	rev	r6,r6
+	str	r6,[r0,#4]
+#elif defined(__ARMEB__)
+	str	r6,[r0,#4]
+#else
+	mov	r9,r6,lsr#8
+	strb	r6,[r0,#4+3]
+	mov	r10,r6,lsr#16
+	strb	r9,[r0,#4+2]
+	mov	r11,r6,lsr#24
+	strb	r10,[r0,#4+1]
+	strb	r11,[r0,#4]
+#endif
+
+#if __ARM_ARCH__>=7 && defined(__ARMEL__)
+	rev	r7,r7
+	str	r7,[r0,#0]
+#elif defined(__ARMEB__)
+	str	r7,[r0,#0]
+#else
+	mov	r9,r7,lsr#8
+	strb	r7,[r0,#0+3]
+	mov	r10,r7,lsr#16
+	strb	r9,[r0,#0+2]
+	mov	r11,r7,lsr#24
+	strb	r10,[r0,#0+1]
+	strb	r11,[r0,#0]
+#endif
+
+#if __ARM_ARCH__>=5
+	ldmia	sp!,{r4,r5,r6,r7,r8,r9,r10,r11,pc}
+#else
+	ldmia	sp!,{r4,r5,r6,r7,r8,r9,r10,r11,lr}
+	tst	lr,#1
+	moveq	pc,lr			@ be binary compatible with V4, yet
+.word	0xe12fff1e			@ interoperable with Thumb ISA:-)
+#endif
+.size	gcm_gmult_4bit,.-gcm_gmult_4bit
+#if __ARM_MAX_ARCH__>=7
+.arch	armv7-a
+.fpu	neon
+
+.globl	gcm_init_neon
+.hidden	gcm_init_neon
+.type	gcm_init_neon,%function
+.align	4
+gcm_init_neon:
+	vld1.64	d7,[r1]!		@ load H
+	vmov.i8	q8,#0xe1
+	vld1.64	d6,[r1]
+	vshl.i64	d17,#57
+	vshr.u64	d16,#63		@ t0=0xc2....01
+	vdup.8	q9,d7[7]
+	vshr.u64	d26,d6,#63
+	vshr.s8	q9,#7			@ broadcast carry bit
+	vshl.i64	q3,q3,#1
+	vand	q8,q8,q9
+	vorr	d7,d26		@ H<<<=1
+	veor	q3,q3,q8		@ twisted H
+	vstmia	r0,{q3}
+
+	bx	lr					@ bx lr
+.size	gcm_init_neon,.-gcm_init_neon
+
+.globl	gcm_gmult_neon
+.hidden	gcm_gmult_neon
+.type	gcm_gmult_neon,%function
+.align	4
+gcm_gmult_neon:
+	vld1.64	d7,[r0]!		@ load Xi
+	vld1.64	d6,[r0]!
+	vmov.i64	d29,#0x0000ffffffffffff
+	vldmia	r1,{d26,d27}	@ load twisted H
+	vmov.i64	d30,#0x00000000ffffffff
+#ifdef __ARMEL__
+	vrev64.8	q3,q3
+#endif
+	vmov.i64	d31,#0x000000000000ffff
+	veor	d28,d26,d27		@ Karatsuba pre-processing
+	mov	r3,#16
+	b	.Lgmult_neon
+.size	gcm_gmult_neon,.-gcm_gmult_neon
+
+.globl	gcm_ghash_neon
+.hidden	gcm_ghash_neon
+.type	gcm_ghash_neon,%function
+.align	4
+gcm_ghash_neon:
+	vld1.64	d1,[r0]!		@ load Xi
+	vld1.64	d0,[r0]!
+	vmov.i64	d29,#0x0000ffffffffffff
+	vldmia	r1,{d26,d27}	@ load twisted H
+	vmov.i64	d30,#0x00000000ffffffff
+#ifdef __ARMEL__
+	vrev64.8	q0,q0
+#endif
+	vmov.i64	d31,#0x000000000000ffff
+	veor	d28,d26,d27		@ Karatsuba pre-processing
+
+.Loop_neon:
+	vld1.64	d7,[r2]!		@ load inp
+	vld1.64	d6,[r2]!
+#ifdef __ARMEL__
+	vrev64.8	q3,q3
+#endif
+	veor	q3,q0			@ inp^=Xi
+.Lgmult_neon:
+	vext.8	d16, d26, d26, #1	@ A1
+	vmull.p8	q8, d16, d6		@ F = A1*B
+	vext.8	d0, d6, d6, #1	@ B1
+	vmull.p8	q0, d26, d0		@ E = A*B1
+	vext.8	d18, d26, d26, #2	@ A2
+	vmull.p8	q9, d18, d6		@ H = A2*B
+	vext.8	d22, d6, d6, #2	@ B2
+	vmull.p8	q11, d26, d22		@ G = A*B2
+	vext.8	d20, d26, d26, #3	@ A3
+	veor	q8, q8, q0		@ L = E + F
+	vmull.p8	q10, d20, d6		@ J = A3*B
+	vext.8	d0, d6, d6, #3	@ B3
+	veor	q9, q9, q11		@ M = G + H
+	vmull.p8	q0, d26, d0		@ I = A*B3
+	veor	d16, d16, d17	@ t0 = (L) (P0 + P1) << 8
+	vand	d17, d17, d29
+	vext.8	d22, d6, d6, #4	@ B4
+	veor	d18, d18, d19	@ t1 = (M) (P2 + P3) << 16
+	vand	d19, d19, d30
+	vmull.p8	q11, d26, d22		@ K = A*B4
+	veor	q10, q10, q0		@ N = I + J
+	veor	d16, d16, d17
+	veor	d18, d18, d19
+	veor	d20, d20, d21	@ t2 = (N) (P4 + P5) << 24
+	vand	d21, d21, d31
+	vext.8	q8, q8, q8, #15
+	veor	d22, d22, d23	@ t3 = (K) (P6 + P7) << 32
+	vmov.i64	d23, #0
+	vext.8	q9, q9, q9, #14
+	veor	d20, d20, d21
+	vmull.p8	q0, d26, d6		@ D = A*B
+	vext.8	q11, q11, q11, #12
+	vext.8	q10, q10, q10, #13
+	veor	q8, q8, q9
+	veor	q10, q10, q11
+	veor	q0, q0, q8
+	veor	q0, q0, q10
+	veor	d6,d6,d7	@ Karatsuba pre-processing
+	vext.8	d16, d28, d28, #1	@ A1
+	vmull.p8	q8, d16, d6		@ F = A1*B
+	vext.8	d2, d6, d6, #1	@ B1
+	vmull.p8	q1, d28, d2		@ E = A*B1
+	vext.8	d18, d28, d28, #2	@ A2
+	vmull.p8	q9, d18, d6		@ H = A2*B
+	vext.8	d22, d6, d6, #2	@ B2
+	vmull.p8	q11, d28, d22		@ G = A*B2
+	vext.8	d20, d28, d28, #3	@ A3
+	veor	q8, q8, q1		@ L = E + F
+	vmull.p8	q10, d20, d6		@ J = A3*B
+	vext.8	d2, d6, d6, #3	@ B3
+	veor	q9, q9, q11		@ M = G + H
+	vmull.p8	q1, d28, d2		@ I = A*B3
+	veor	d16, d16, d17	@ t0 = (L) (P0 + P1) << 8
+	vand	d17, d17, d29
+	vext.8	d22, d6, d6, #4	@ B4
+	veor	d18, d18, d19	@ t1 = (M) (P2 + P3) << 16
+	vand	d19, d19, d30
+	vmull.p8	q11, d28, d22		@ K = A*B4
+	veor	q10, q10, q1		@ N = I + J
+	veor	d16, d16, d17
+	veor	d18, d18, d19
+	veor	d20, d20, d21	@ t2 = (N) (P4 + P5) << 24
+	vand	d21, d21, d31
+	vext.8	q8, q8, q8, #15
+	veor	d22, d22, d23	@ t3 = (K) (P6 + P7) << 32
+	vmov.i64	d23, #0
+	vext.8	q9, q9, q9, #14
+	veor	d20, d20, d21
+	vmull.p8	q1, d28, d6		@ D = A*B
+	vext.8	q11, q11, q11, #12
+	vext.8	q10, q10, q10, #13
+	veor	q8, q8, q9
+	veor	q10, q10, q11
+	veor	q1, q1, q8
+	veor	q1, q1, q10
+	vext.8	d16, d27, d27, #1	@ A1
+	vmull.p8	q8, d16, d7		@ F = A1*B
+	vext.8	d4, d7, d7, #1	@ B1
+	vmull.p8	q2, d27, d4		@ E = A*B1
+	vext.8	d18, d27, d27, #2	@ A2
+	vmull.p8	q9, d18, d7		@ H = A2*B
+	vext.8	d22, d7, d7, #2	@ B2
+	vmull.p8	q11, d27, d22		@ G = A*B2
+	vext.8	d20, d27, d27, #3	@ A3
+	veor	q8, q8, q2		@ L = E + F
+	vmull.p8	q10, d20, d7		@ J = A3*B
+	vext.8	d4, d7, d7, #3	@ B3
+	veor	q9, q9, q11		@ M = G + H
+	vmull.p8	q2, d27, d4		@ I = A*B3
+	veor	d16, d16, d17	@ t0 = (L) (P0 + P1) << 8
+	vand	d17, d17, d29
+	vext.8	d22, d7, d7, #4	@ B4
+	veor	d18, d18, d19	@ t1 = (M) (P2 + P3) << 16
+	vand	d19, d19, d30
+	vmull.p8	q11, d27, d22		@ K = A*B4
+	veor	q10, q10, q2		@ N = I + J
+	veor	d16, d16, d17
+	veor	d18, d18, d19
+	veor	d20, d20, d21	@ t2 = (N) (P4 + P5) << 24
+	vand	d21, d21, d31
+	vext.8	q8, q8, q8, #15
+	veor	d22, d22, d23	@ t3 = (K) (P6 + P7) << 32
+	vmov.i64	d23, #0
+	vext.8	q9, q9, q9, #14
+	veor	d20, d20, d21
+	vmull.p8	q2, d27, d7		@ D = A*B
+	vext.8	q11, q11, q11, #12
+	vext.8	q10, q10, q10, #13
+	veor	q8, q8, q9
+	veor	q10, q10, q11
+	veor	q2, q2, q8
+	veor	q2, q2, q10
+	veor	q1,q1,q0		@ Karatsuba post-processing
+	veor	q1,q1,q2
+	veor	d1,d1,d2
+	veor	d4,d4,d3	@ Xh|Xl - 256-bit result
+
+	@ equivalent of reduction_avx from ghash-x86_64.pl
+	vshl.i64	q9,q0,#57		@ 1st phase
+	vshl.i64	q10,q0,#62
+	veor	q10,q10,q9		@
+	vshl.i64	q9,q0,#63
+	veor	q10, q10, q9		@
+	veor	d1,d1,d20	@
+	veor	d4,d4,d21
+
+	vshr.u64	q10,q0,#1		@ 2nd phase
+	veor	q2,q2,q0
+	veor	q0,q0,q10		@
+	vshr.u64	q10,q10,#6
+	vshr.u64	q0,q0,#1		@
+	veor	q0,q0,q2		@
+	veor	q0,q0,q10		@
+
+	subs	r3,#16
+	bne	.Loop_neon
+
+#ifdef __ARMEL__
+	vrev64.8	q0,q0
+#endif
+	sub	r0,#16
+	vst1.64	d1,[r0]!		@ write out Xi
+	vst1.64	d0,[r0]
+
+	bx	lr					@ bx lr
+.size	gcm_ghash_neon,.-gcm_ghash_neon
+#endif
+.byte	71,72,65,83,72,32,102,111,114,32,65,82,77,118,52,47,78,69,79,78,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0
+.align	2
+.align	2
+
+#endif
+#endif
\ No newline at end of file
diff --git a/third_party/boringssl/linux-arm/crypto/modes/ghashv8-armx32.S b/third_party/boringssl/linux-arm/crypto/modes/ghashv8-armx32.S
new file mode 100644
index 0000000..bdbbae9
--- /dev/null
+++ b/third_party/boringssl/linux-arm/crypto/modes/ghashv8-armx32.S
@@ -0,0 +1,233 @@
+#if defined(__arm__)
+#include "arm_arch.h"
+
+.text
+.fpu	neon
+.code	32
+.globl	gcm_init_v8
+.type	gcm_init_v8,%function
+.align	4
+gcm_init_v8:
+	vld1.64	{q9},[r1]		@ load input H
+	vmov.i8	q11,#0xe1
+	vshl.i64	q11,q11,#57		@ 0xc2.0
+	vext.8	q3,q9,q9,#8
+	vshr.u64	q10,q11,#63
+	vdup.32	q9,d18[1]
+	vext.8	q8,q10,q11,#8		@ t0=0xc2....01
+	vshr.u64	q10,q3,#63
+	vshr.s32	q9,q9,#31		@ broadcast carry bit
+	vand	q10,q10,q8
+	vshl.i64	q3,q3,#1
+	vext.8	q10,q10,q10,#8
+	vand	q8,q8,q9
+	vorr	q3,q3,q10		@ H<<<=1
+	veor	q12,q3,q8		@ twisted H
+	vst1.64	{q12},[r0]!		@ store Htable[0]
+
+	@ calculate H^2
+	vext.8	q8,q12,q12,#8		@ Karatsuba pre-processing
+.byte	0xa8,0x0e,0xa8,0xf2	@ pmull q0,q12,q12
+	veor	q8,q8,q12
+.byte	0xa9,0x4e,0xa9,0xf2	@ pmull2 q2,q12,q12
+.byte	0xa0,0x2e,0xa0,0xf2	@ pmull q1,q8,q8
+
+	vext.8	q9,q0,q2,#8		@ Karatsuba post-processing
+	veor	q10,q0,q2
+	veor	q1,q1,q9
+	veor	q1,q1,q10
+.byte	0x26,0x4e,0xe0,0xf2	@ pmull q10,q0,q11		@ 1st phase
+
+	vmov	d4,d3		@ Xh|Xm - 256-bit result
+	vmov	d3,d0		@ Xm is rotated Xl
+	veor	q0,q1,q10
+
+	vext.8	q10,q0,q0,#8		@ 2nd phase
+.byte	0x26,0x0e,0xa0,0xf2	@ pmull q0,q0,q11
+	veor	q10,q10,q2
+	veor	q14,q0,q10
+
+	vext.8	q9,q14,q14,#8		@ Karatsuba pre-processing
+	veor	q9,q9,q14
+	vext.8	q13,q8,q9,#8		@ pack Karatsuba pre-processed
+	vst1.64	{q13,q14},[r0]		@ store Htable[1..2]
+
+	bx	lr
+.size	gcm_init_v8,.-gcm_init_v8
+.globl	gcm_gmult_v8
+.type	gcm_gmult_v8,%function
+.align	4
+gcm_gmult_v8:
+	vld1.64	{q9},[r0]		@ load Xi
+	vmov.i8	q11,#0xe1
+	vld1.64	{q12,q13},[r1]	@ load twisted H, ...
+	vshl.u64	q11,q11,#57
+#ifndef __ARMEB__
+	vrev64.8	q9,q9
+#endif
+	vext.8	q3,q9,q9,#8
+
+.byte	0x86,0x0e,0xa8,0xf2	@ pmull q0,q12,q3		@ H.lo·Xi.lo
+	veor	q9,q9,q3		@ Karatsuba pre-processing
+.byte	0x87,0x4e,0xa9,0xf2	@ pmull2 q2,q12,q3		@ H.hi·Xi.hi
+.byte	0xa2,0x2e,0xaa,0xf2	@ pmull q1,q13,q9		@ (H.lo+H.hi)·(Xi.lo+Xi.hi)
+
+	vext.8	q9,q0,q2,#8		@ Karatsuba post-processing
+	veor	q10,q0,q2
+	veor	q1,q1,q9
+	veor	q1,q1,q10
+.byte	0x26,0x4e,0xe0,0xf2	@ pmull q10,q0,q11		@ 1st phase of reduction
+
+	vmov	d4,d3		@ Xh|Xm - 256-bit result
+	vmov	d3,d0		@ Xm is rotated Xl
+	veor	q0,q1,q10
+
+	vext.8	q10,q0,q0,#8		@ 2nd phase of reduction
+.byte	0x26,0x0e,0xa0,0xf2	@ pmull q0,q0,q11
+	veor	q10,q10,q2
+	veor	q0,q0,q10
+
+#ifndef __ARMEB__
+	vrev64.8	q0,q0
+#endif
+	vext.8	q0,q0,q0,#8
+	vst1.64	{q0},[r0]		@ write out Xi
+
+	bx	lr
+.size	gcm_gmult_v8,.-gcm_gmult_v8
+.globl	gcm_ghash_v8
+.type	gcm_ghash_v8,%function
+.align	4
+gcm_ghash_v8:
+	vstmdb	sp!,{d8,d9,d10,d11,d12,d13,d14,d15}		@ 32-bit ABI says so
+	vld1.64	{q0},[r0]		@ load [rotated] Xi
+						@ "[rotated]" means that
+						@ loaded value would have
+						@ to be rotated in order to
+						@ make it appear as in
+						@ alorithm specification
+	subs	r3,r3,#32		@ see if r3 is 32 or larger
+	mov	r12,#16		@ r12 is used as post-
+						@ increment for input pointer;
+						@ as loop is modulo-scheduled
+						@ r12 is zeroed just in time
+						@ to preclude oversteping
+						@ inp[len], which means that
+						@ last block[s] are actually
+						@ loaded twice, but last
+						@ copy is not processed
+	vld1.64	{q12,q13},[r1]!	@ load twisted H, ..., H^2
+	vmov.i8	q11,#0xe1
+	vld1.64	{q14},[r1]
+	moveq	r12,#0			@ is it time to zero r12?
+	vext.8	q0,q0,q0,#8		@ rotate Xi
+	vld1.64	{q8},[r2]!	@ load [rotated] I[0]
+	vshl.u64	q11,q11,#57		@ compose 0xc2.0 constant
+#ifndef __ARMEB__
+	vrev64.8	q8,q8
+	vrev64.8	q0,q0
+#endif
+	vext.8	q3,q8,q8,#8		@ rotate I[0]
+	blo	.Lodd_tail_v8		@ r3 was less than 32
+	vld1.64	{q9},[r2],r12	@ load [rotated] I[1]
+#ifndef __ARMEB__
+	vrev64.8	q9,q9
+#endif
+	vext.8	q7,q9,q9,#8
+	veor	q3,q3,q0		@ I[i]^=Xi
+.byte	0x8e,0x8e,0xa8,0xf2	@ pmull q4,q12,q7		@ H·Ii+1
+	veor	q9,q9,q7		@ Karatsuba pre-processing
+.byte	0x8f,0xce,0xa9,0xf2	@ pmull2 q6,q12,q7
+	b	.Loop_mod2x_v8
+
+.align	4
+.Loop_mod2x_v8:
+	vext.8	q10,q3,q3,#8
+	subs	r3,r3,#32		@ is there more data?
+.byte	0x86,0x0e,0xac,0xf2	@ pmull q0,q14,q3		@ H^2.lo·Xi.lo
+	movlo	r12,#0			@ is it time to zero r12?
+
+.byte	0xa2,0xae,0xaa,0xf2	@ pmull q5,q13,q9
+	veor	q10,q10,q3		@ Karatsuba pre-processing
+.byte	0x87,0x4e,0xad,0xf2	@ pmull2 q2,q14,q3		@ H^2.hi·Xi.hi
+	veor	q0,q0,q4		@ accumulate
+.byte	0xa5,0x2e,0xab,0xf2	@ pmull2 q1,q13,q10		@ (H^2.lo+H^2.hi)·(Xi.lo+Xi.hi)
+	vld1.64	{q8},[r2],r12	@ load [rotated] I[i+2]
+
+	veor	q2,q2,q6
+	moveq	r12,#0			@ is it time to zero r12?
+	veor	q1,q1,q5
+
+	vext.8	q9,q0,q2,#8		@ Karatsuba post-processing
+	veor	q10,q0,q2
+	veor	q1,q1,q9
+	vld1.64	{q9},[r2],r12	@ load [rotated] I[i+3]
+#ifndef __ARMEB__
+	vrev64.8	q8,q8
+#endif
+	veor	q1,q1,q10
+.byte	0x26,0x4e,0xe0,0xf2	@ pmull q10,q0,q11		@ 1st phase of reduction
+
+#ifndef __ARMEB__
+	vrev64.8	q9,q9
+#endif
+	vmov	d4,d3		@ Xh|Xm - 256-bit result
+	vmov	d3,d0		@ Xm is rotated Xl
+	vext.8	q7,q9,q9,#8
+	vext.8	q3,q8,q8,#8
+	veor	q0,q1,q10
+.byte	0x8e,0x8e,0xa8,0xf2	@ pmull q4,q12,q7		@ H·Ii+1
+	veor	q3,q3,q2		@ accumulate q3 early
+
+	vext.8	q10,q0,q0,#8		@ 2nd phase of reduction
+.byte	0x26,0x0e,0xa0,0xf2	@ pmull q0,q0,q11
+	veor	q3,q3,q10
+	veor	q9,q9,q7		@ Karatsuba pre-processing
+	veor	q3,q3,q0
+.byte	0x8f,0xce,0xa9,0xf2	@ pmull2 q6,q12,q7
+	bhs	.Loop_mod2x_v8		@ there was at least 32 more bytes
+
+	veor	q2,q2,q10
+	vext.8	q3,q8,q8,#8		@ re-construct q3
+	adds	r3,r3,#32		@ re-construct r3
+	veor	q0,q0,q2		@ re-construct q0
+	beq	.Ldone_v8		@ is r3 zero?
+.Lodd_tail_v8:
+	vext.8	q10,q0,q0,#8
+	veor	q3,q3,q0		@ inp^=Xi
+	veor	q9,q8,q10		@ q9 is rotated inp^Xi
+
+.byte	0x86,0x0e,0xa8,0xf2	@ pmull q0,q12,q3		@ H.lo·Xi.lo
+	veor	q9,q9,q3		@ Karatsuba pre-processing
+.byte	0x87,0x4e,0xa9,0xf2	@ pmull2 q2,q12,q3		@ H.hi·Xi.hi
+.byte	0xa2,0x2e,0xaa,0xf2	@ pmull q1,q13,q9		@ (H.lo+H.hi)·(Xi.lo+Xi.hi)
+
+	vext.8	q9,q0,q2,#8		@ Karatsuba post-processing
+	veor	q10,q0,q2
+	veor	q1,q1,q9
+	veor	q1,q1,q10
+.byte	0x26,0x4e,0xe0,0xf2	@ pmull q10,q0,q11		@ 1st phase of reduction
+
+	vmov	d4,d3		@ Xh|Xm - 256-bit result
+	vmov	d3,d0		@ Xm is rotated Xl
+	veor	q0,q1,q10
+
+	vext.8	q10,q0,q0,#8		@ 2nd phase of reduction
+.byte	0x26,0x0e,0xa0,0xf2	@ pmull q0,q0,q11
+	veor	q10,q10,q2
+	veor	q0,q0,q10
+
+.Ldone_v8:
+#ifndef __ARMEB__
+	vrev64.8	q0,q0
+#endif
+	vext.8	q0,q0,q0,#8
+	vst1.64	{q0},[r0]		@ write out Xi
+
+	vldmia	sp!,{d8,d9,d10,d11,d12,d13,d14,d15}		@ 32-bit ABI says so
+	bx	lr
+.size	gcm_ghash_v8,.-gcm_ghash_v8
+.byte	71,72,65,83,72,32,102,111,114,32,65,82,77,118,56,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0
+.align	2
+.align	2
+#endif
\ No newline at end of file
diff --git a/third_party/boringssl/linux-arm/crypto/sha/sha1-armv4-large.S b/third_party/boringssl/linux-arm/crypto/sha/sha1-armv4-large.S
new file mode 100644
index 0000000..4911458
--- /dev/null
+++ b/third_party/boringssl/linux-arm/crypto/sha/sha1-armv4-large.S
@@ -0,0 +1,1462 @@
+#if defined(__arm__)
+#include "arm_arch.h"
+
+.text
+.code	32
+
+.globl	sha1_block_data_order
+.type	sha1_block_data_order,%function
+
+.align	5
+sha1_block_data_order:
+#if __ARM_MAX_ARCH__>=7
+	sub	r3,pc,#8		@ sha1_block_data_order
+	ldr	r12,.LOPENSSL_armcap
+	ldr	r12,[r3,r12]		@ OPENSSL_armcap_P
+#ifdef	__APPLE__
+	ldr	r12,[r12]
+#endif
+	tst	r12,#ARMV8_SHA1
+	bne	.LARMv8
+	tst	r12,#ARMV7_NEON
+	bne	.LNEON
+#endif
+	stmdb	sp!,{r4,r5,r6,r7,r8,r9,r10,r11,r12,lr}
+	add	r2,r1,r2,lsl#6	@ r2 to point at the end of r1
+	ldmia	r0,{r3,r4,r5,r6,r7}
+.Lloop:
+	ldr	r8,.LK_00_19
+	mov	r14,sp
+	sub	sp,sp,#15*4
+	mov	r5,r5,ror#30
+	mov	r6,r6,ror#30
+	mov	r7,r7,ror#30		@ [6]
+.L_00_15:
+#if __ARM_ARCH__<7
+	ldrb	r10,[r1,#2]
+	ldrb	r9,[r1,#3]
+	ldrb	r11,[r1,#1]
+	add	r7,r8,r7,ror#2			@ E+=K_00_19
+	ldrb	r12,[r1],#4
+	orr	r9,r9,r10,lsl#8
+	eor	r10,r5,r6			@ F_xx_xx
+	orr	r9,r9,r11,lsl#16
+	add	r7,r7,r3,ror#27			@ E+=ROR(A,27)
+	orr	r9,r9,r12,lsl#24
+#else
+	ldr	r9,[r1],#4			@ handles unaligned
+	add	r7,r8,r7,ror#2			@ E+=K_00_19
+	eor	r10,r5,r6			@ F_xx_xx
+	add	r7,r7,r3,ror#27			@ E+=ROR(A,27)
+#ifdef __ARMEL__
+	rev	r9,r9				@ byte swap
+#endif
+#endif
+	and	r10,r4,r10,ror#2
+	add	r7,r7,r9			@ E+=X[i]
+	eor	r10,r10,r6,ror#2		@ F_00_19(B,C,D)
+	str	r9,[r14,#-4]!
+	add	r7,r7,r10			@ E+=F_00_19(B,C,D)
+#if __ARM_ARCH__<7
+	ldrb	r10,[r1,#2]
+	ldrb	r9,[r1,#3]
+	ldrb	r11,[r1,#1]
+	add	r6,r8,r6,ror#2			@ E+=K_00_19
+	ldrb	r12,[r1],#4
+	orr	r9,r9,r10,lsl#8
+	eor	r10,r4,r5			@ F_xx_xx
+	orr	r9,r9,r11,lsl#16
+	add	r6,r6,r7,ror#27			@ E+=ROR(A,27)
+	orr	r9,r9,r12,lsl#24
+#else
+	ldr	r9,[r1],#4			@ handles unaligned
+	add	r6,r8,r6,ror#2			@ E+=K_00_19
+	eor	r10,r4,r5			@ F_xx_xx
+	add	r6,r6,r7,ror#27			@ E+=ROR(A,27)
+#ifdef __ARMEL__
+	rev	r9,r9				@ byte swap
+#endif
+#endif
+	and	r10,r3,r10,ror#2
+	add	r6,r6,r9			@ E+=X[i]
+	eor	r10,r10,r5,ror#2		@ F_00_19(B,C,D)
+	str	r9,[r14,#-4]!
+	add	r6,r6,r10			@ E+=F_00_19(B,C,D)
+#if __ARM_ARCH__<7
+	ldrb	r10,[r1,#2]
+	ldrb	r9,[r1,#3]
+	ldrb	r11,[r1,#1]
+	add	r5,r8,r5,ror#2			@ E+=K_00_19
+	ldrb	r12,[r1],#4
+	orr	r9,r9,r10,lsl#8
+	eor	r10,r3,r4			@ F_xx_xx
+	orr	r9,r9,r11,lsl#16
+	add	r5,r5,r6,ror#27			@ E+=ROR(A,27)
+	orr	r9,r9,r12,lsl#24
+#else
+	ldr	r9,[r1],#4			@ handles unaligned
+	add	r5,r8,r5,ror#2			@ E+=K_00_19
+	eor	r10,r3,r4			@ F_xx_xx
+	add	r5,r5,r6,ror#27			@ E+=ROR(A,27)
+#ifdef __ARMEL__
+	rev	r9,r9				@ byte swap
+#endif
+#endif
+	and	r10,r7,r10,ror#2
+	add	r5,r5,r9			@ E+=X[i]
+	eor	r10,r10,r4,ror#2		@ F_00_19(B,C,D)
+	str	r9,[r14,#-4]!
+	add	r5,r5,r10			@ E+=F_00_19(B,C,D)
+#if __ARM_ARCH__<7
+	ldrb	r10,[r1,#2]
+	ldrb	r9,[r1,#3]
+	ldrb	r11,[r1,#1]
+	add	r4,r8,r4,ror#2			@ E+=K_00_19
+	ldrb	r12,[r1],#4
+	orr	r9,r9,r10,lsl#8
+	eor	r10,r7,r3			@ F_xx_xx
+	orr	r9,r9,r11,lsl#16
+	add	r4,r4,r5,ror#27			@ E+=ROR(A,27)
+	orr	r9,r9,r12,lsl#24
+#else
+	ldr	r9,[r1],#4			@ handles unaligned
+	add	r4,r8,r4,ror#2			@ E+=K_00_19
+	eor	r10,r7,r3			@ F_xx_xx
+	add	r4,r4,r5,ror#27			@ E+=ROR(A,27)
+#ifdef __ARMEL__
+	rev	r9,r9				@ byte swap
+#endif
+#endif
+	and	r10,r6,r10,ror#2
+	add	r4,r4,r9			@ E+=X[i]
+	eor	r10,r10,r3,ror#2		@ F_00_19(B,C,D)
+	str	r9,[r14,#-4]!
+	add	r4,r4,r10			@ E+=F_00_19(B,C,D)
+#if __ARM_ARCH__<7
+	ldrb	r10,[r1,#2]
+	ldrb	r9,[r1,#3]
+	ldrb	r11,[r1,#1]
+	add	r3,r8,r3,ror#2			@ E+=K_00_19
+	ldrb	r12,[r1],#4
+	orr	r9,r9,r10,lsl#8
+	eor	r10,r6,r7			@ F_xx_xx
+	orr	r9,r9,r11,lsl#16
+	add	r3,r3,r4,ror#27			@ E+=ROR(A,27)
+	orr	r9,r9,r12,lsl#24
+#else
+	ldr	r9,[r1],#4			@ handles unaligned
+	add	r3,r8,r3,ror#2			@ E+=K_00_19
+	eor	r10,r6,r7			@ F_xx_xx
+	add	r3,r3,r4,ror#27			@ E+=ROR(A,27)
+#ifdef __ARMEL__
+	rev	r9,r9				@ byte swap
+#endif
+#endif
+	and	r10,r5,r10,ror#2
+	add	r3,r3,r9			@ E+=X[i]
+	eor	r10,r10,r7,ror#2		@ F_00_19(B,C,D)
+	str	r9,[r14,#-4]!
+	add	r3,r3,r10			@ E+=F_00_19(B,C,D)
+	teq	r14,sp
+	bne	.L_00_15		@ [((11+4)*5+2)*3]
+	sub	sp,sp,#25*4
+#if __ARM_ARCH__<7
+	ldrb	r10,[r1,#2]
+	ldrb	r9,[r1,#3]
+	ldrb	r11,[r1,#1]
+	add	r7,r8,r7,ror#2			@ E+=K_00_19
+	ldrb	r12,[r1],#4
+	orr	r9,r9,r10,lsl#8
+	eor	r10,r5,r6			@ F_xx_xx
+	orr	r9,r9,r11,lsl#16
+	add	r7,r7,r3,ror#27			@ E+=ROR(A,27)
+	orr	r9,r9,r12,lsl#24
+#else
+	ldr	r9,[r1],#4			@ handles unaligned
+	add	r7,r8,r7,ror#2			@ E+=K_00_19
+	eor	r10,r5,r6			@ F_xx_xx
+	add	r7,r7,r3,ror#27			@ E+=ROR(A,27)
+#ifdef __ARMEL__
+	rev	r9,r9				@ byte swap
+#endif
+#endif
+	and	r10,r4,r10,ror#2
+	add	r7,r7,r9			@ E+=X[i]
+	eor	r10,r10,r6,ror#2		@ F_00_19(B,C,D)
+	str	r9,[r14,#-4]!
+	add	r7,r7,r10			@ E+=F_00_19(B,C,D)
+	ldr	r9,[r14,#15*4]
+	ldr	r10,[r14,#13*4]
+	ldr	r11,[r14,#7*4]
+	add	r6,r8,r6,ror#2			@ E+=K_xx_xx
+	ldr	r12,[r14,#2*4]
+	eor	r9,r9,r10
+	eor	r11,r11,r12			@ 1 cycle stall
+	eor	r10,r4,r5			@ F_xx_xx
+	mov	r9,r9,ror#31
+	add	r6,r6,r7,ror#27			@ E+=ROR(A,27)
+	eor	r9,r9,r11,ror#31
+	str	r9,[r14,#-4]!
+	and	r10,r3,r10,ror#2					@ F_xx_xx
+						@ F_xx_xx
+	add	r6,r6,r9			@ E+=X[i]
+	eor	r10,r10,r5,ror#2		@ F_00_19(B,C,D)
+	add	r6,r6,r10			@ E+=F_00_19(B,C,D)
+	ldr	r9,[r14,#15*4]
+	ldr	r10,[r14,#13*4]
+	ldr	r11,[r14,#7*4]
+	add	r5,r8,r5,ror#2			@ E+=K_xx_xx
+	ldr	r12,[r14,#2*4]
+	eor	r9,r9,r10
+	eor	r11,r11,r12			@ 1 cycle stall
+	eor	r10,r3,r4			@ F_xx_xx
+	mov	r9,r9,ror#31
+	add	r5,r5,r6,ror#27			@ E+=ROR(A,27)
+	eor	r9,r9,r11,ror#31
+	str	r9,[r14,#-4]!
+	and	r10,r7,r10,ror#2					@ F_xx_xx
+						@ F_xx_xx
+	add	r5,r5,r9			@ E+=X[i]
+	eor	r10,r10,r4,ror#2		@ F_00_19(B,C,D)
+	add	r5,r5,r10			@ E+=F_00_19(B,C,D)
+	ldr	r9,[r14,#15*4]
+	ldr	r10,[r14,#13*4]
+	ldr	r11,[r14,#7*4]
+	add	r4,r8,r4,ror#2			@ E+=K_xx_xx
+	ldr	r12,[r14,#2*4]
+	eor	r9,r9,r10
+	eor	r11,r11,r12			@ 1 cycle stall
+	eor	r10,r7,r3			@ F_xx_xx
+	mov	r9,r9,ror#31
+	add	r4,r4,r5,ror#27			@ E+=ROR(A,27)
+	eor	r9,r9,r11,ror#31
+	str	r9,[r14,#-4]!
+	and	r10,r6,r10,ror#2					@ F_xx_xx
+						@ F_xx_xx
+	add	r4,r4,r9			@ E+=X[i]
+	eor	r10,r10,r3,ror#2		@ F_00_19(B,C,D)
+	add	r4,r4,r10			@ E+=F_00_19(B,C,D)
+	ldr	r9,[r14,#15*4]
+	ldr	r10,[r14,#13*4]
+	ldr	r11,[r14,#7*4]
+	add	r3,r8,r3,ror#2			@ E+=K_xx_xx
+	ldr	r12,[r14,#2*4]
+	eor	r9,r9,r10
+	eor	r11,r11,r12			@ 1 cycle stall
+	eor	r10,r6,r7			@ F_xx_xx
+	mov	r9,r9,ror#31
+	add	r3,r3,r4,ror#27			@ E+=ROR(A,27)
+	eor	r9,r9,r11,ror#31
+	str	r9,[r14,#-4]!
+	and	r10,r5,r10,ror#2					@ F_xx_xx
+						@ F_xx_xx
+	add	r3,r3,r9			@ E+=X[i]
+	eor	r10,r10,r7,ror#2		@ F_00_19(B,C,D)
+	add	r3,r3,r10			@ E+=F_00_19(B,C,D)
+
+	ldr	r8,.LK_20_39		@ [+15+16*4]
+	cmn	sp,#0			@ [+3], clear carry to denote 20_39
+.L_20_39_or_60_79:
+	ldr	r9,[r14,#15*4]
+	ldr	r10,[r14,#13*4]
+	ldr	r11,[r14,#7*4]
+	add	r7,r8,r7,ror#2			@ E+=K_xx_xx
+	ldr	r12,[r14,#2*4]
+	eor	r9,r9,r10
+	eor	r11,r11,r12			@ 1 cycle stall
+	eor	r10,r5,r6			@ F_xx_xx
+	mov	r9,r9,ror#31
+	add	r7,r7,r3,ror#27			@ E+=ROR(A,27)
+	eor	r9,r9,r11,ror#31
+	str	r9,[r14,#-4]!
+	eor	r10,r4,r10,ror#2					@ F_xx_xx
+						@ F_xx_xx
+	add	r7,r7,r9			@ E+=X[i]
+	add	r7,r7,r10			@ E+=F_20_39(B,C,D)
+	ldr	r9,[r14,#15*4]
+	ldr	r10,[r14,#13*4]
+	ldr	r11,[r14,#7*4]
+	add	r6,r8,r6,ror#2			@ E+=K_xx_xx
+	ldr	r12,[r14,#2*4]
+	eor	r9,r9,r10
+	eor	r11,r11,r12			@ 1 cycle stall
+	eor	r10,r4,r5			@ F_xx_xx
+	mov	r9,r9,ror#31
+	add	r6,r6,r7,ror#27			@ E+=ROR(A,27)
+	eor	r9,r9,r11,ror#31
+	str	r9,[r14,#-4]!
+	eor	r10,r3,r10,ror#2					@ F_xx_xx
+						@ F_xx_xx
+	add	r6,r6,r9			@ E+=X[i]
+	add	r6,r6,r10			@ E+=F_20_39(B,C,D)
+	ldr	r9,[r14,#15*4]
+	ldr	r10,[r14,#13*4]
+	ldr	r11,[r14,#7*4]
+	add	r5,r8,r5,ror#2			@ E+=K_xx_xx
+	ldr	r12,[r14,#2*4]
+	eor	r9,r9,r10
+	eor	r11,r11,r12			@ 1 cycle stall
+	eor	r10,r3,r4			@ F_xx_xx
+	mov	r9,r9,ror#31
+	add	r5,r5,r6,ror#27			@ E+=ROR(A,27)
+	eor	r9,r9,r11,ror#31
+	str	r9,[r14,#-4]!
+	eor	r10,r7,r10,ror#2					@ F_xx_xx
+						@ F_xx_xx
+	add	r5,r5,r9			@ E+=X[i]
+	add	r5,r5,r10			@ E+=F_20_39(B,C,D)
+	ldr	r9,[r14,#15*4]
+	ldr	r10,[r14,#13*4]
+	ldr	r11,[r14,#7*4]
+	add	r4,r8,r4,ror#2			@ E+=K_xx_xx
+	ldr	r12,[r14,#2*4]
+	eor	r9,r9,r10
+	eor	r11,r11,r12			@ 1 cycle stall
+	eor	r10,r7,r3			@ F_xx_xx
+	mov	r9,r9,ror#31
+	add	r4,r4,r5,ror#27			@ E+=ROR(A,27)
+	eor	r9,r9,r11,ror#31
+	str	r9,[r14,#-4]!
+	eor	r10,r6,r10,ror#2					@ F_xx_xx
+						@ F_xx_xx
+	add	r4,r4,r9			@ E+=X[i]
+	add	r4,r4,r10			@ E+=F_20_39(B,C,D)
+	ldr	r9,[r14,#15*4]
+	ldr	r10,[r14,#13*4]
+	ldr	r11,[r14,#7*4]
+	add	r3,r8,r3,ror#2			@ E+=K_xx_xx
+	ldr	r12,[r14,#2*4]
+	eor	r9,r9,r10
+	eor	r11,r11,r12			@ 1 cycle stall
+	eor	r10,r6,r7			@ F_xx_xx
+	mov	r9,r9,ror#31
+	add	r3,r3,r4,ror#27			@ E+=ROR(A,27)
+	eor	r9,r9,r11,ror#31
+	str	r9,[r14,#-4]!
+	eor	r10,r5,r10,ror#2					@ F_xx_xx
+						@ F_xx_xx
+	add	r3,r3,r9			@ E+=X[i]
+	add	r3,r3,r10			@ E+=F_20_39(B,C,D)
+	teq	r14,sp			@ preserve carry
+	bne	.L_20_39_or_60_79	@ [+((12+3)*5+2)*4]
+	bcs	.L_done			@ [+((12+3)*5+2)*4], spare 300 bytes
+
+	ldr	r8,.LK_40_59
+	sub	sp,sp,#20*4		@ [+2]
+.L_40_59:
+	ldr	r9,[r14,#15*4]
+	ldr	r10,[r14,#13*4]
+	ldr	r11,[r14,#7*4]
+	add	r7,r8,r7,ror#2			@ E+=K_xx_xx
+	ldr	r12,[r14,#2*4]
+	eor	r9,r9,r10
+	eor	r11,r11,r12			@ 1 cycle stall
+	eor	r10,r5,r6			@ F_xx_xx
+	mov	r9,r9,ror#31
+	add	r7,r7,r3,ror#27			@ E+=ROR(A,27)
+	eor	r9,r9,r11,ror#31
+	str	r9,[r14,#-4]!
+	and	r10,r4,r10,ror#2					@ F_xx_xx
+	and	r11,r5,r6					@ F_xx_xx
+	add	r7,r7,r9			@ E+=X[i]
+	add	r7,r7,r10			@ E+=F_40_59(B,C,D)
+	add	r7,r7,r11,ror#2
+	ldr	r9,[r14,#15*4]
+	ldr	r10,[r14,#13*4]
+	ldr	r11,[r14,#7*4]
+	add	r6,r8,r6,ror#2			@ E+=K_xx_xx
+	ldr	r12,[r14,#2*4]
+	eor	r9,r9,r10
+	eor	r11,r11,r12			@ 1 cycle stall
+	eor	r10,r4,r5			@ F_xx_xx
+	mov	r9,r9,ror#31
+	add	r6,r6,r7,ror#27			@ E+=ROR(A,27)
+	eor	r9,r9,r11,ror#31
+	str	r9,[r14,#-4]!
+	and	r10,r3,r10,ror#2					@ F_xx_xx
+	and	r11,r4,r5					@ F_xx_xx
+	add	r6,r6,r9			@ E+=X[i]
+	add	r6,r6,r10			@ E+=F_40_59(B,C,D)
+	add	r6,r6,r11,ror#2
+	ldr	r9,[r14,#15*4]
+	ldr	r10,[r14,#13*4]
+	ldr	r11,[r14,#7*4]
+	add	r5,r8,r5,ror#2			@ E+=K_xx_xx
+	ldr	r12,[r14,#2*4]
+	eor	r9,r9,r10
+	eor	r11,r11,r12			@ 1 cycle stall
+	eor	r10,r3,r4			@ F_xx_xx
+	mov	r9,r9,ror#31
+	add	r5,r5,r6,ror#27			@ E+=ROR(A,27)
+	eor	r9,r9,r11,ror#31
+	str	r9,[r14,#-4]!
+	and	r10,r7,r10,ror#2					@ F_xx_xx
+	and	r11,r3,r4					@ F_xx_xx
+	add	r5,r5,r9			@ E+=X[i]
+	add	r5,r5,r10			@ E+=F_40_59(B,C,D)
+	add	r5,r5,r11,ror#2
+	ldr	r9,[r14,#15*4]
+	ldr	r10,[r14,#13*4]
+	ldr	r11,[r14,#7*4]
+	add	r4,r8,r4,ror#2			@ E+=K_xx_xx
+	ldr	r12,[r14,#2*4]
+	eor	r9,r9,r10
+	eor	r11,r11,r12			@ 1 cycle stall
+	eor	r10,r7,r3			@ F_xx_xx
+	mov	r9,r9,ror#31
+	add	r4,r4,r5,ror#27			@ E+=ROR(A,27)
+	eor	r9,r9,r11,ror#31
+	str	r9,[r14,#-4]!
+	and	r10,r6,r10,ror#2					@ F_xx_xx
+	and	r11,r7,r3					@ F_xx_xx
+	add	r4,r4,r9			@ E+=X[i]
+	add	r4,r4,r10			@ E+=F_40_59(B,C,D)
+	add	r4,r4,r11,ror#2
+	ldr	r9,[r14,#15*4]
+	ldr	r10,[r14,#13*4]
+	ldr	r11,[r14,#7*4]
+	add	r3,r8,r3,ror#2			@ E+=K_xx_xx
+	ldr	r12,[r14,#2*4]
+	eor	r9,r9,r10
+	eor	r11,r11,r12			@ 1 cycle stall
+	eor	r10,r6,r7			@ F_xx_xx
+	mov	r9,r9,ror#31
+	add	r3,r3,r4,ror#27			@ E+=ROR(A,27)
+	eor	r9,r9,r11,ror#31
+	str	r9,[r14,#-4]!
+	and	r10,r5,r10,ror#2					@ F_xx_xx
+	and	r11,r6,r7					@ F_xx_xx
+	add	r3,r3,r9			@ E+=X[i]
+	add	r3,r3,r10			@ E+=F_40_59(B,C,D)
+	add	r3,r3,r11,ror#2
+	teq	r14,sp
+	bne	.L_40_59		@ [+((12+5)*5+2)*4]
+
+	ldr	r8,.LK_60_79
+	sub	sp,sp,#20*4
+	cmp	sp,#0			@ set carry to denote 60_79
+	b	.L_20_39_or_60_79	@ [+4], spare 300 bytes
+.L_done:
+	add	sp,sp,#80*4		@ "deallocate" stack frame
+	ldmia	r0,{r8,r9,r10,r11,r12}
+	add	r3,r8,r3
+	add	r4,r9,r4
+	add	r5,r10,r5,ror#2
+	add	r6,r11,r6,ror#2
+	add	r7,r12,r7,ror#2
+	stmia	r0,{r3,r4,r5,r6,r7}
+	teq	r1,r2
+	bne	.Lloop			@ [+18], total 1307
+
+#if __ARM_ARCH__>=5
+	ldmia	sp!,{r4,r5,r6,r7,r8,r9,r10,r11,r12,pc}
+#else
+	ldmia	sp!,{r4,r5,r6,r7,r8,r9,r10,r11,r12,lr}
+	tst	lr,#1
+	moveq	pc,lr			@ be binary compatible with V4, yet
+.word	0xe12fff1e			@ interoperable with Thumb ISA:-)
+#endif
+.size	sha1_block_data_order,.-sha1_block_data_order
+
+.align	5
+.LK_00_19:.word	0x5a827999
+.LK_20_39:.word	0x6ed9eba1
+.LK_40_59:.word	0x8f1bbcdc
+.LK_60_79:.word	0xca62c1d6
+#if __ARM_MAX_ARCH__>=7
+.LOPENSSL_armcap:
+.word	OPENSSL_armcap_P-sha1_block_data_order
+#endif
+.byte	83,72,65,49,32,98,108,111,99,107,32,116,114,97,110,115,102,111,114,109,32,102,111,114,32,65,82,77,118,52,47,78,69,79,78,47,65,82,77,118,56,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0
+.align	2
+.align	5
+#if __ARM_MAX_ARCH__>=7
+.arch	armv7-a
+.fpu	neon
+
+.type	sha1_block_data_order_neon,%function
+.align	4
+sha1_block_data_order_neon:
+.LNEON:
+	stmdb	sp!,{r4,r5,r6,r7,r8,r9,r10,r11,r12,lr}
+	add	r2,r1,r2,lsl#6	@ r2 to point at the end of r1
+	@ dmb				@ errata #451034 on early Cortex A8
+	@ vstmdb	sp!,{d8-d15}	@ ABI specification says so
+	mov	r14,sp
+	sub	sp,sp,#64		@ alloca
+	adr	r8,.LK_00_19
+	bic	sp,sp,#15		@ align for 128-bit stores
+
+	ldmia	r0,{r3,r4,r5,r6,r7}	@ load context
+	mov	r12,sp
+
+	vld1.8	{q0,q1},[r1]!	@ handles unaligned
+	veor	q15,q15,q15
+	vld1.8	{q2,q3},[r1]!
+	vld1.32	{d28[],d29[]},[r8,:32]!	@ load K_00_19
+	vrev32.8	q0,q0		@ yes, even on
+	vrev32.8	q1,q1		@ big-endian...
+	vrev32.8	q2,q2
+	vadd.i32	q8,q0,q14
+	vrev32.8	q3,q3
+	vadd.i32	q9,q1,q14
+	vst1.32	{q8},[r12,:128]!
+	vadd.i32	q10,q2,q14
+	vst1.32	{q9},[r12,:128]!
+	vst1.32	{q10},[r12,:128]!
+	ldr	r9,[sp]			@ big RAW stall
+
+.Loop_neon:
+	vext.8	q8,q0,q1,#8
+	bic	r10,r6,r4
+	add	r7,r7,r9
+	and	r11,r5,r4
+	vadd.i32	q13,q3,q14
+	ldr	r9,[sp,#4]
+	add	r7,r7,r3,ror#27
+	vext.8	q12,q3,q15,#4
+	eor	r11,r11,r10
+	mov	r4,r4,ror#2
+	add	r7,r7,r11
+	veor	q8,q8,q0
+	bic	r10,r5,r3
+	add	r6,r6,r9
+	veor	q12,q12,q2
+	and	r11,r4,r3
+	ldr	r9,[sp,#8]
+	veor	q12,q12,q8
+	add	r6,r6,r7,ror#27
+	eor	r11,r11,r10
+	vst1.32	{q13},[r12,:128]!
+	sub	r12,r12,#64
+	mov	r3,r3,ror#2
+	add	r6,r6,r11
+	vext.8	q13,q15,q12,#4
+	bic	r10,r4,r7
+	add	r5,r5,r9
+	vadd.i32	q8,q12,q12
+	and	r11,r3,r7
+	ldr	r9,[sp,#12]
+	vsri.32	q8,q12,#31
+	add	r5,r5,r6,ror#27
+	eor	r11,r11,r10
+	mov	r7,r7,ror#2
+	vshr.u32	q12,q13,#30
+	add	r5,r5,r11
+	bic	r10,r3,r6
+	vshl.u32	q13,q13,#2
+	add	r4,r4,r9
+	and	r11,r7,r6
+	veor	q8,q8,q12
+	ldr	r9,[sp,#16]
+	add	r4,r4,r5,ror#27
+	veor	q8,q8,q13
+	eor	r11,r11,r10
+	mov	r6,r6,ror#2
+	add	r4,r4,r11
+	vext.8	q9,q1,q2,#8
+	bic	r10,r7,r5
+	add	r3,r3,r9
+	and	r11,r6,r5
+	vadd.i32	q13,q8,q14
+	ldr	r9,[sp,#20]
+	vld1.32	{d28[],d29[]},[r8,:32]!
+	add	r3,r3,r4,ror#27
+	vext.8	q12,q8,q15,#4
+	eor	r11,r11,r10
+	mov	r5,r5,ror#2
+	add	r3,r3,r11
+	veor	q9,q9,q1
+	bic	r10,r6,r4
+	add	r7,r7,r9
+	veor	q12,q12,q3
+	and	r11,r5,r4
+	ldr	r9,[sp,#24]
+	veor	q12,q12,q9
+	add	r7,r7,r3,ror#27
+	eor	r11,r11,r10
+	vst1.32	{q13},[r12,:128]!
+	mov	r4,r4,ror#2
+	add	r7,r7,r11
+	vext.8	q13,q15,q12,#4
+	bic	r10,r5,r3
+	add	r6,r6,r9
+	vadd.i32	q9,q12,q12
+	and	r11,r4,r3
+	ldr	r9,[sp,#28]
+	vsri.32	q9,q12,#31
+	add	r6,r6,r7,ror#27
+	eor	r11,r11,r10
+	mov	r3,r3,ror#2
+	vshr.u32	q12,q13,#30
+	add	r6,r6,r11
+	bic	r10,r4,r7
+	vshl.u32	q13,q13,#2
+	add	r5,r5,r9
+	and	r11,r3,r7
+	veor	q9,q9,q12
+	ldr	r9,[sp,#32]
+	add	r5,r5,r6,ror#27
+	veor	q9,q9,q13
+	eor	r11,r11,r10
+	mov	r7,r7,ror#2
+	add	r5,r5,r11
+	vext.8	q10,q2,q3,#8
+	bic	r10,r3,r6
+	add	r4,r4,r9
+	and	r11,r7,r6
+	vadd.i32	q13,q9,q14
+	ldr	r9,[sp,#36]
+	add	r4,r4,r5,ror#27
+	vext.8	q12,q9,q15,#4
+	eor	r11,r11,r10
+	mov	r6,r6,ror#2
+	add	r4,r4,r11
+	veor	q10,q10,q2
+	bic	r10,r7,r5
+	add	r3,r3,r9
+	veor	q12,q12,q8
+	and	r11,r6,r5
+	ldr	r9,[sp,#40]
+	veor	q12,q12,q10
+	add	r3,r3,r4,ror#27
+	eor	r11,r11,r10
+	vst1.32	{q13},[r12,:128]!
+	mov	r5,r5,ror#2
+	add	r3,r3,r11
+	vext.8	q13,q15,q12,#4
+	bic	r10,r6,r4
+	add	r7,r7,r9
+	vadd.i32	q10,q12,q12
+	and	r11,r5,r4
+	ldr	r9,[sp,#44]
+	vsri.32	q10,q12,#31
+	add	r7,r7,r3,ror#27
+	eor	r11,r11,r10
+	mov	r4,r4,ror#2
+	vshr.u32	q12,q13,#30
+	add	r7,r7,r11
+	bic	r10,r5,r3
+	vshl.u32	q13,q13,#2
+	add	r6,r6,r9
+	and	r11,r4,r3
+	veor	q10,q10,q12
+	ldr	r9,[sp,#48]
+	add	r6,r6,r7,ror#27
+	veor	q10,q10,q13
+	eor	r11,r11,r10
+	mov	r3,r3,ror#2
+	add	r6,r6,r11
+	vext.8	q11,q3,q8,#8
+	bic	r10,r4,r7
+	add	r5,r5,r9
+	and	r11,r3,r7
+	vadd.i32	q13,q10,q14
+	ldr	r9,[sp,#52]
+	add	r5,r5,r6,ror#27
+	vext.8	q12,q10,q15,#4
+	eor	r11,r11,r10
+	mov	r7,r7,ror#2
+	add	r5,r5,r11
+	veor	q11,q11,q3
+	bic	r10,r3,r6
+	add	r4,r4,r9
+	veor	q12,q12,q9
+	and	r11,r7,r6
+	ldr	r9,[sp,#56]
+	veor	q12,q12,q11
+	add	r4,r4,r5,ror#27
+	eor	r11,r11,r10
+	vst1.32	{q13},[r12,:128]!
+	mov	r6,r6,ror#2
+	add	r4,r4,r11
+	vext.8	q13,q15,q12,#4
+	bic	r10,r7,r5
+	add	r3,r3,r9
+	vadd.i32	q11,q12,q12
+	and	r11,r6,r5
+	ldr	r9,[sp,#60]
+	vsri.32	q11,q12,#31
+	add	r3,r3,r4,ror#27
+	eor	r11,r11,r10
+	mov	r5,r5,ror#2
+	vshr.u32	q12,q13,#30
+	add	r3,r3,r11
+	bic	r10,r6,r4
+	vshl.u32	q13,q13,#2
+	add	r7,r7,r9
+	and	r11,r5,r4
+	veor	q11,q11,q12
+	ldr	r9,[sp,#0]
+	add	r7,r7,r3,ror#27
+	veor	q11,q11,q13
+	eor	r11,r11,r10
+	mov	r4,r4,ror#2
+	add	r7,r7,r11
+	vext.8	q12,q10,q11,#8
+	bic	r10,r5,r3
+	add	r6,r6,r9
+	and	r11,r4,r3
+	veor	q0,q0,q8
+	ldr	r9,[sp,#4]
+	add	r6,r6,r7,ror#27
+	veor	q0,q0,q1
+	eor	r11,r11,r10
+	mov	r3,r3,ror#2
+	vadd.i32	q13,q11,q14
+	add	r6,r6,r11
+	bic	r10,r4,r7
+	veor	q12,q12,q0
+	add	r5,r5,r9
+	and	r11,r3,r7
+	vshr.u32	q0,q12,#30
+	ldr	r9,[sp,#8]
+	add	r5,r5,r6,ror#27
+	vst1.32	{q13},[r12,:128]!
+	sub	r12,r12,#64
+	eor	r11,r11,r10
+	mov	r7,r7,ror#2
+	vsli.32	q0,q12,#2
+	add	r5,r5,r11
+	bic	r10,r3,r6
+	add	r4,r4,r9
+	and	r11,r7,r6
+	ldr	r9,[sp,#12]
+	add	r4,r4,r5,ror#27
+	eor	r11,r11,r10
+	mov	r6,r6,ror#2
+	add	r4,r4,r11
+	bic	r10,r7,r5
+	add	r3,r3,r9
+	and	r11,r6,r5
+	ldr	r9,[sp,#16]
+	add	r3,r3,r4,ror#27
+	eor	r11,r11,r10
+	mov	r5,r5,ror#2
+	add	r3,r3,r11
+	vext.8	q12,q11,q0,#8
+	eor	r10,r4,r6
+	add	r7,r7,r9
+	ldr	r9,[sp,#20]
+	veor	q1,q1,q9
+	eor	r11,r10,r5
+	add	r7,r7,r3,ror#27
+	veor	q1,q1,q2
+	mov	r4,r4,ror#2
+	add	r7,r7,r11
+	vadd.i32	q13,q0,q14
+	eor	r10,r3,r5
+	add	r6,r6,r9
+	veor	q12,q12,q1
+	ldr	r9,[sp,#24]
+	eor	r11,r10,r4
+	vshr.u32	q1,q12,#30
+	add	r6,r6,r7,ror#27
+	mov	r3,r3,ror#2
+	vst1.32	{q13},[r12,:128]!
+	add	r6,r6,r11
+	eor	r10,r7,r4
+	vsli.32	q1,q12,#2
+	add	r5,r5,r9
+	ldr	r9,[sp,#28]
+	eor	r11,r10,r3
+	add	r5,r5,r6,ror#27
+	mov	r7,r7,ror#2
+	add	r5,r5,r11
+	eor	r10,r6,r3
+	add	r4,r4,r9
+	ldr	r9,[sp,#32]
+	eor	r11,r10,r7
+	add	r4,r4,r5,ror#27
+	mov	r6,r6,ror#2
+	add	r4,r4,r11
+	vext.8	q12,q0,q1,#8
+	eor	r10,r5,r7
+	add	r3,r3,r9
+	ldr	r9,[sp,#36]
+	veor	q2,q2,q10
+	eor	r11,r10,r6
+	add	r3,r3,r4,ror#27
+	veor	q2,q2,q3
+	mov	r5,r5,ror#2
+	add	r3,r3,r11
+	vadd.i32	q13,q1,q14
+	eor	r10,r4,r6
+	vld1.32	{d28[],d29[]},[r8,:32]!
+	add	r7,r7,r9
+	veor	q12,q12,q2
+	ldr	r9,[sp,#40]
+	eor	r11,r10,r5
+	vshr.u32	q2,q12,#30
+	add	r7,r7,r3,ror#27
+	mov	r4,r4,ror#2
+	vst1.32	{q13},[r12,:128]!
+	add	r7,r7,r11
+	eor	r10,r3,r5
+	vsli.32	q2,q12,#2
+	add	r6,r6,r9
+	ldr	r9,[sp,#44]
+	eor	r11,r10,r4
+	add	r6,r6,r7,ror#27
+	mov	r3,r3,ror#2
+	add	r6,r6,r11
+	eor	r10,r7,r4
+	add	r5,r5,r9
+	ldr	r9,[sp,#48]
+	eor	r11,r10,r3
+	add	r5,r5,r6,ror#27
+	mov	r7,r7,ror#2
+	add	r5,r5,r11
+	vext.8	q12,q1,q2,#8
+	eor	r10,r6,r3
+	add	r4,r4,r9
+	ldr	r9,[sp,#52]
+	veor	q3,q3,q11
+	eor	r11,r10,r7
+	add	r4,r4,r5,ror#27
+	veor	q3,q3,q8
+	mov	r6,r6,ror#2
+	add	r4,r4,r11
+	vadd.i32	q13,q2,q14
+	eor	r10,r5,r7
+	add	r3,r3,r9
+	veor	q12,q12,q3
+	ldr	r9,[sp,#56]
+	eor	r11,r10,r6
+	vshr.u32	q3,q12,#30
+	add	r3,r3,r4,ror#27
+	mov	r5,r5,ror#2
+	vst1.32	{q13},[r12,:128]!
+	add	r3,r3,r11
+	eor	r10,r4,r6
+	vsli.32	q3,q12,#2
+	add	r7,r7,r9
+	ldr	r9,[sp,#60]
+	eor	r11,r10,r5
+	add	r7,r7,r3,ror#27
+	mov	r4,r4,ror#2
+	add	r7,r7,r11
+	eor	r10,r3,r5
+	add	r6,r6,r9
+	ldr	r9,[sp,#0]
+	eor	r11,r10,r4
+	add	r6,r6,r7,ror#27
+	mov	r3,r3,ror#2
+	add	r6,r6,r11
+	vext.8	q12,q2,q3,#8
+	eor	r10,r7,r4
+	add	r5,r5,r9
+	ldr	r9,[sp,#4]
+	veor	q8,q8,q0
+	eor	r11,r10,r3
+	add	r5,r5,r6,ror#27
+	veor	q8,q8,q9
+	mov	r7,r7,ror#2
+	add	r5,r5,r11
+	vadd.i32	q13,q3,q14
+	eor	r10,r6,r3
+	add	r4,r4,r9
+	veor	q12,q12,q8
+	ldr	r9,[sp,#8]
+	eor	r11,r10,r7
+	vshr.u32	q8,q12,#30
+	add	r4,r4,r5,ror#27
+	mov	r6,r6,ror#2
+	vst1.32	{q13},[r12,:128]!
+	sub	r12,r12,#64
+	add	r4,r4,r11
+	eor	r10,r5,r7
+	vsli.32	q8,q12,#2
+	add	r3,r3,r9
+	ldr	r9,[sp,#12]
+	eor	r11,r10,r6
+	add	r3,r3,r4,ror#27
+	mov	r5,r5,ror#2
+	add	r3,r3,r11
+	eor	r10,r4,r6
+	add	r7,r7,r9
+	ldr	r9,[sp,#16]
+	eor	r11,r10,r5
+	add	r7,r7,r3,ror#27
+	mov	r4,r4,ror#2
+	add	r7,r7,r11
+	vext.8	q12,q3,q8,#8
+	eor	r10,r3,r5
+	add	r6,r6,r9
+	ldr	r9,[sp,#20]
+	veor	q9,q9,q1
+	eor	r11,r10,r4
+	add	r6,r6,r7,ror#27
+	veor	q9,q9,q10
+	mov	r3,r3,ror#2
+	add	r6,r6,r11
+	vadd.i32	q13,q8,q14
+	eor	r10,r7,r4
+	add	r5,r5,r9
+	veor	q12,q12,q9
+	ldr	r9,[sp,#24]
+	eor	r11,r10,r3
+	vshr.u32	q9,q12,#30
+	add	r5,r5,r6,ror#27
+	mov	r7,r7,ror#2
+	vst1.32	{q13},[r12,:128]!
+	add	r5,r5,r11
+	eor	r10,r6,r3
+	vsli.32	q9,q12,#2
+	add	r4,r4,r9
+	ldr	r9,[sp,#28]
+	eor	r11,r10,r7
+	add	r4,r4,r5,ror#27
+	mov	r6,r6,ror#2
+	add	r4,r4,r11
+	eor	r10,r5,r7
+	add	r3,r3,r9
+	ldr	r9,[sp,#32]
+	eor	r11,r10,r6
+	add	r3,r3,r4,ror#27
+	mov	r5,r5,ror#2
+	add	r3,r3,r11
+	vext.8	q12,q8,q9,#8
+	add	r7,r7,r9
+	and	r10,r5,r6
+	ldr	r9,[sp,#36]
+	veor	q10,q10,q2
+	add	r7,r7,r3,ror#27
+	eor	r11,r5,r6
+	veor	q10,q10,q11
+	add	r7,r7,r10
+	and	r11,r11,r4
+	vadd.i32	q13,q9,q14
+	mov	r4,r4,ror#2
+	add	r7,r7,r11
+	veor	q12,q12,q10
+	add	r6,r6,r9
+	and	r10,r4,r5
+	vshr.u32	q10,q12,#30
+	ldr	r9,[sp,#40]
+	add	r6,r6,r7,ror#27
+	vst1.32	{q13},[r12,:128]!
+	eor	r11,r4,r5
+	add	r6,r6,r10
+	vsli.32	q10,q12,#2
+	and	r11,r11,r3
+	mov	r3,r3,ror#2
+	add	r6,r6,r11
+	add	r5,r5,r9
+	and	r10,r3,r4
+	ldr	r9,[sp,#44]
+	add	r5,r5,r6,ror#27
+	eor	r11,r3,r4
+	add	r5,r5,r10
+	and	r11,r11,r7
+	mov	r7,r7,ror#2
+	add	r5,r5,r11
+	add	r4,r4,r9
+	and	r10,r7,r3
+	ldr	r9,[sp,#48]
+	add	r4,r4,r5,ror#27
+	eor	r11,r7,r3
+	add	r4,r4,r10
+	and	r11,r11,r6
+	mov	r6,r6,ror#2
+	add	r4,r4,r11
+	vext.8	q12,q9,q10,#8
+	add	r3,r3,r9
+	and	r10,r6,r7
+	ldr	r9,[sp,#52]
+	veor	q11,q11,q3
+	add	r3,r3,r4,ror#27
+	eor	r11,r6,r7
+	veor	q11,q11,q0
+	add	r3,r3,r10
+	and	r11,r11,r5
+	vadd.i32	q13,q10,q14
+	mov	r5,r5,ror#2
+	vld1.32	{d28[],d29[]},[r8,:32]!
+	add	r3,r3,r11
+	veor	q12,q12,q11
+	add	r7,r7,r9
+	and	r10,r5,r6
+	vshr.u32	q11,q12,#30
+	ldr	r9,[sp,#56]
+	add	r7,r7,r3,ror#27
+	vst1.32	{q13},[r12,:128]!
+	eor	r11,r5,r6
+	add	r7,r7,r10
+	vsli.32	q11,q12,#2
+	and	r11,r11,r4
+	mov	r4,r4,ror#2
+	add	r7,r7,r11
+	add	r6,r6,r9
+	and	r10,r4,r5
+	ldr	r9,[sp,#60]
+	add	r6,r6,r7,ror#27
+	eor	r11,r4,r5
+	add	r6,r6,r10
+	and	r11,r11,r3
+	mov	r3,r3,ror#2
+	add	r6,r6,r11
+	add	r5,r5,r9
+	and	r10,r3,r4
+	ldr	r9,[sp,#0]
+	add	r5,r5,r6,ror#27
+	eor	r11,r3,r4
+	add	r5,r5,r10
+	and	r11,r11,r7
+	mov	r7,r7,ror#2
+	add	r5,r5,r11
+	vext.8	q12,q10,q11,#8
+	add	r4,r4,r9
+	and	r10,r7,r3
+	ldr	r9,[sp,#4]
+	veor	q0,q0,q8
+	add	r4,r4,r5,ror#27
+	eor	r11,r7,r3
+	veor	q0,q0,q1
+	add	r4,r4,r10
+	and	r11,r11,r6
+	vadd.i32	q13,q11,q14
+	mov	r6,r6,ror#2
+	add	r4,r4,r11
+	veor	q12,q12,q0
+	add	r3,r3,r9
+	and	r10,r6,r7
+	vshr.u32	q0,q12,#30
+	ldr	r9,[sp,#8]
+	add	r3,r3,r4,ror#27
+	vst1.32	{q13},[r12,:128]!
+	sub	r12,r12,#64
+	eor	r11,r6,r7
+	add	r3,r3,r10
+	vsli.32	q0,q12,#2
+	and	r11,r11,r5
+	mov	r5,r5,ror#2
+	add	r3,r3,r11
+	add	r7,r7,r9
+	and	r10,r5,r6
+	ldr	r9,[sp,#12]
+	add	r7,r7,r3,ror#27
+	eor	r11,r5,r6
+	add	r7,r7,r10
+	and	r11,r11,r4
+	mov	r4,r4,ror#2
+	add	r7,r7,r11
+	add	r6,r6,r9
+	and	r10,r4,r5
+	ldr	r9,[sp,#16]
+	add	r6,r6,r7,ror#27
+	eor	r11,r4,r5
+	add	r6,r6,r10
+	and	r11,r11,r3
+	mov	r3,r3,ror#2
+	add	r6,r6,r11
+	vext.8	q12,q11,q0,#8
+	add	r5,r5,r9
+	and	r10,r3,r4
+	ldr	r9,[sp,#20]
+	veor	q1,q1,q9
+	add	r5,r5,r6,ror#27
+	eor	r11,r3,r4
+	veor	q1,q1,q2
+	add	r5,r5,r10
+	and	r11,r11,r7
+	vadd.i32	q13,q0,q14
+	mov	r7,r7,ror#2
+	add	r5,r5,r11
+	veor	q12,q12,q1
+	add	r4,r4,r9
+	and	r10,r7,r3
+	vshr.u32	q1,q12,#30
+	ldr	r9,[sp,#24]
+	add	r4,r4,r5,ror#27
+	vst1.32	{q13},[r12,:128]!
+	eor	r11,r7,r3
+	add	r4,r4,r10
+	vsli.32	q1,q12,#2
+	and	r11,r11,r6
+	mov	r6,r6,ror#2
+	add	r4,r4,r11
+	add	r3,r3,r9
+	and	r10,r6,r7
+	ldr	r9,[sp,#28]
+	add	r3,r3,r4,ror#27
+	eor	r11,r6,r7
+	add	r3,r3,r10
+	and	r11,r11,r5
+	mov	r5,r5,ror#2
+	add	r3,r3,r11
+	add	r7,r7,r9
+	and	r10,r5,r6
+	ldr	r9,[sp,#32]
+	add	r7,r7,r3,ror#27
+	eor	r11,r5,r6
+	add	r7,r7,r10
+	and	r11,r11,r4
+	mov	r4,r4,ror#2
+	add	r7,r7,r11
+	vext.8	q12,q0,q1,#8
+	add	r6,r6,r9
+	and	r10,r4,r5
+	ldr	r9,[sp,#36]
+	veor	q2,q2,q10
+	add	r6,r6,r7,ror#27
+	eor	r11,r4,r5
+	veor	q2,q2,q3
+	add	r6,r6,r10
+	and	r11,r11,r3
+	vadd.i32	q13,q1,q14
+	mov	r3,r3,ror#2
+	add	r6,r6,r11
+	veor	q12,q12,q2
+	add	r5,r5,r9
+	and	r10,r3,r4
+	vshr.u32	q2,q12,#30
+	ldr	r9,[sp,#40]
+	add	r5,r5,r6,ror#27
+	vst1.32	{q13},[r12,:128]!
+	eor	r11,r3,r4
+	add	r5,r5,r10
+	vsli.32	q2,q12,#2
+	and	r11,r11,r7
+	mov	r7,r7,ror#2
+	add	r5,r5,r11
+	add	r4,r4,r9
+	and	r10,r7,r3
+	ldr	r9,[sp,#44]
+	add	r4,r4,r5,ror#27
+	eor	r11,r7,r3
+	add	r4,r4,r10
+	and	r11,r11,r6
+	mov	r6,r6,ror#2
+	add	r4,r4,r11
+	add	r3,r3,r9
+	and	r10,r6,r7
+	ldr	r9,[sp,#48]
+	add	r3,r3,r4,ror#27
+	eor	r11,r6,r7
+	add	r3,r3,r10
+	and	r11,r11,r5
+	mov	r5,r5,ror#2
+	add	r3,r3,r11
+	vext.8	q12,q1,q2,#8
+	eor	r10,r4,r6
+	add	r7,r7,r9
+	ldr	r9,[sp,#52]
+	veor	q3,q3,q11
+	eor	r11,r10,r5
+	add	r7,r7,r3,ror#27
+	veor	q3,q3,q8
+	mov	r4,r4,ror#2
+	add	r7,r7,r11
+	vadd.i32	q13,q2,q14
+	eor	r10,r3,r5
+	add	r6,r6,r9
+	veor	q12,q12,q3
+	ldr	r9,[sp,#56]
+	eor	r11,r10,r4
+	vshr.u32	q3,q12,#30
+	add	r6,r6,r7,ror#27
+	mov	r3,r3,ror#2
+	vst1.32	{q13},[r12,:128]!
+	add	r6,r6,r11
+	eor	r10,r7,r4
+	vsli.32	q3,q12,#2
+	add	r5,r5,r9
+	ldr	r9,[sp,#60]
+	eor	r11,r10,r3
+	add	r5,r5,r6,ror#27
+	mov	r7,r7,ror#2
+	add	r5,r5,r11
+	eor	r10,r6,r3
+	add	r4,r4,r9
+	ldr	r9,[sp,#0]
+	eor	r11,r10,r7
+	add	r4,r4,r5,ror#27
+	mov	r6,r6,ror#2
+	add	r4,r4,r11
+	vadd.i32	q13,q3,q14
+	eor	r10,r5,r7
+	add	r3,r3,r9
+	vst1.32	{q13},[r12,:128]!
+	sub	r12,r12,#64
+	teq	r1,r2
+	sub	r8,r8,#16
+	subeq	r1,r1,#64
+	vld1.8	{q0,q1},[r1]!
+	ldr	r9,[sp,#4]
+	eor	r11,r10,r6
+	vld1.8	{q2,q3},[r1]!
+	add	r3,r3,r4,ror#27
+	mov	r5,r5,ror#2
+	vld1.32	{d28[],d29[]},[r8,:32]!
+	add	r3,r3,r11
+	eor	r10,r4,r6
+	vrev32.8	q0,q0
+	add	r7,r7,r9
+	ldr	r9,[sp,#8]
+	eor	r11,r10,r5
+	add	r7,r7,r3,ror#27
+	mov	r4,r4,ror#2
+	add	r7,r7,r11
+	eor	r10,r3,r5
+	add	r6,r6,r9
+	ldr	r9,[sp,#12]
+	eor	r11,r10,r4
+	add	r6,r6,r7,ror#27
+	mov	r3,r3,ror#2
+	add	r6,r6,r11
+	eor	r10,r7,r4
+	add	r5,r5,r9
+	ldr	r9,[sp,#16]
+	eor	r11,r10,r3
+	add	r5,r5,r6,ror#27
+	mov	r7,r7,ror#2
+	add	r5,r5,r11
+	vrev32.8	q1,q1
+	eor	r10,r6,r3
+	add	r4,r4,r9
+	vadd.i32	q8,q0,q14
+	ldr	r9,[sp,#20]
+	eor	r11,r10,r7
+	vst1.32	{q8},[r12,:128]!
+	add	r4,r4,r5,ror#27
+	mov	r6,r6,ror#2
+	add	r4,r4,r11
+	eor	r10,r5,r7
+	add	r3,r3,r9
+	ldr	r9,[sp,#24]
+	eor	r11,r10,r6
+	add	r3,r3,r4,ror#27
+	mov	r5,r5,ror#2
+	add	r3,r3,r11
+	eor	r10,r4,r6
+	add	r7,r7,r9
+	ldr	r9,[sp,#28]
+	eor	r11,r10,r5
+	add	r7,r7,r3,ror#27
+	mov	r4,r4,ror#2
+	add	r7,r7,r11
+	eor	r10,r3,r5
+	add	r6,r6,r9
+	ldr	r9,[sp,#32]
+	eor	r11,r10,r4
+	add	r6,r6,r7,ror#27
+	mov	r3,r3,ror#2
+	add	r6,r6,r11
+	vrev32.8	q2,q2
+	eor	r10,r7,r4
+	add	r5,r5,r9
+	vadd.i32	q9,q1,q14
+	ldr	r9,[sp,#36]
+	eor	r11,r10,r3
+	vst1.32	{q9},[r12,:128]!
+	add	r5,r5,r6,ror#27
+	mov	r7,r7,ror#2
+	add	r5,r5,r11
+	eor	r10,r6,r3
+	add	r4,r4,r9
+	ldr	r9,[sp,#40]
+	eor	r11,r10,r7
+	add	r4,r4,r5,ror#27
+	mov	r6,r6,ror#2
+	add	r4,r4,r11
+	eor	r10,r5,r7
+	add	r3,r3,r9
+	ldr	r9,[sp,#44]
+	eor	r11,r10,r6
+	add	r3,r3,r4,ror#27
+	mov	r5,r5,ror#2
+	add	r3,r3,r11
+	eor	r10,r4,r6
+	add	r7,r7,r9
+	ldr	r9,[sp,#48]
+	eor	r11,r10,r5
+	add	r7,r7,r3,ror#27
+	mov	r4,r4,ror#2
+	add	r7,r7,r11
+	vrev32.8	q3,q3
+	eor	r10,r3,r5
+	add	r6,r6,r9
+	vadd.i32	q10,q2,q14
+	ldr	r9,[sp,#52]
+	eor	r11,r10,r4
+	vst1.32	{q10},[r12,:128]!
+	add	r6,r6,r7,ror#27
+	mov	r3,r3,ror#2
+	add	r6,r6,r11
+	eor	r10,r7,r4
+	add	r5,r5,r9
+	ldr	r9,[sp,#56]
+	eor	r11,r10,r3
+	add	r5,r5,r6,ror#27
+	mov	r7,r7,ror#2
+	add	r5,r5,r11
+	eor	r10,r6,r3
+	add	r4,r4,r9
+	ldr	r9,[sp,#60]
+	eor	r11,r10,r7
+	add	r4,r4,r5,ror#27
+	mov	r6,r6,ror#2
+	add	r4,r4,r11
+	eor	r10,r5,r7
+	add	r3,r3,r9
+	eor	r11,r10,r6
+	add	r3,r3,r4,ror#27
+	mov	r5,r5,ror#2
+	add	r3,r3,r11
+	ldmia	r0,{r9,r10,r11,r12}	@ accumulate context
+	add	r3,r3,r9
+	ldr	r9,[r0,#16]
+	add	r4,r4,r10
+	add	r5,r5,r11
+	add	r6,r6,r12
+	moveq	sp,r14
+	add	r7,r7,r9
+	ldrne	r9,[sp]
+	stmia	r0,{r3,r4,r5,r6,r7}
+	addne	r12,sp,#3*16
+	bne	.Loop_neon
+
+	@ vldmia	sp!,{d8-d15}
+	ldmia	sp!,{r4,r5,r6,r7,r8,r9,r10,r11,r12,pc}
+.size	sha1_block_data_order_neon,.-sha1_block_data_order_neon
+#endif
+#if __ARM_MAX_ARCH__>=7
+.type	sha1_block_data_order_armv8,%function
+.align	5
+sha1_block_data_order_armv8:
+.LARMv8:
+	vstmdb	sp!,{d8,d9,d10,d11,d12,d13,d14,d15}		@ ABI specification says so
+
+	veor	q1,q1,q1
+	adr	r3,.LK_00_19
+	vld1.32	{q0},[r0]!
+	vld1.32	{d2[0]},[r0]
+	sub	r0,r0,#16
+	vld1.32	{d16[],d17[]},[r3,:32]!
+	vld1.32	{d18[],d19[]},[r3,:32]!
+	vld1.32	{d20[],d21[]},[r3,:32]!
+	vld1.32	{d22[],d23[]},[r3,:32]
+
+.Loop_v8:
+	vld1.8	{q4,q5},[r1]!
+	vld1.8	{q6,q7},[r1]!
+	vrev32.8	q4,q4
+	vrev32.8	q5,q5
+
+	vadd.i32	q12,q8,q4
+	vrev32.8	q6,q6
+	vmov	q14,q0	@ offload
+	subs	r2,r2,#1
+
+	vadd.i32	q13,q8,q5
+	vrev32.8	q7,q7
+.byte	0xc0,0x62,0xb9,0xf3	@ sha1h q3,q0		@ 0
+.byte	0x68,0x0c,0x02,0xf2	@ sha1c q0,q1,q12
+	vadd.i32	q12,q8,q6
+.byte	0x4c,0x8c,0x3a,0xf2	@ sha1su0 q4,q5,q6
+.byte	0xc0,0x42,0xb9,0xf3	@ sha1h q2,q0		@ 1
+.byte	0x6a,0x0c,0x06,0xf2	@ sha1c q0,q3,q13
+	vadd.i32	q13,q8,q7
+.byte	0x8e,0x83,0xba,0xf3	@ sha1su1 q4,q7
+.byte	0x4e,0xac,0x3c,0xf2	@ sha1su0 q5,q6,q7
+.byte	0xc0,0x62,0xb9,0xf3	@ sha1h q3,q0		@ 2
+.byte	0x68,0x0c,0x04,0xf2	@ sha1c q0,q2,q12
+	vadd.i32	q12,q8,q4
+.byte	0x88,0xa3,0xba,0xf3	@ sha1su1 q5,q4
+.byte	0x48,0xcc,0x3e,0xf2	@ sha1su0 q6,q7,q4
+.byte	0xc0,0x42,0xb9,0xf3	@ sha1h q2,q0		@ 3
+.byte	0x6a,0x0c,0x06,0xf2	@ sha1c q0,q3,q13
+	vadd.i32	q13,q9,q5
+.byte	0x8a,0xc3,0xba,0xf3	@ sha1su1 q6,q5
+.byte	0x4a,0xec,0x38,0xf2	@ sha1su0 q7,q4,q5
+.byte	0xc0,0x62,0xb9,0xf3	@ sha1h q3,q0		@ 4
+.byte	0x68,0x0c,0x04,0xf2	@ sha1c q0,q2,q12
+	vadd.i32	q12,q9,q6
+.byte	0x8c,0xe3,0xba,0xf3	@ sha1su1 q7,q6
+.byte	0x4c,0x8c,0x3a,0xf2	@ sha1su0 q4,q5,q6
+.byte	0xc0,0x42,0xb9,0xf3	@ sha1h q2,q0		@ 5
+.byte	0x6a,0x0c,0x16,0xf2	@ sha1p q0,q3,q13
+	vadd.i32	q13,q9,q7
+.byte	0x8e,0x83,0xba,0xf3	@ sha1su1 q4,q7
+.byte	0x4e,0xac,0x3c,0xf2	@ sha1su0 q5,q6,q7
+.byte	0xc0,0x62,0xb9,0xf3	@ sha1h q3,q0		@ 6
+.byte	0x68,0x0c,0x14,0xf2	@ sha1p q0,q2,q12
+	vadd.i32	q12,q9,q4
+.byte	0x88,0xa3,0xba,0xf3	@ sha1su1 q5,q4
+.byte	0x48,0xcc,0x3e,0xf2	@ sha1su0 q6,q7,q4
+.byte	0xc0,0x42,0xb9,0xf3	@ sha1h q2,q0		@ 7
+.byte	0x6a,0x0c,0x16,0xf2	@ sha1p q0,q3,q13
+	vadd.i32	q13,q9,q5
+.byte	0x8a,0xc3,0xba,0xf3	@ sha1su1 q6,q5
+.byte	0x4a,0xec,0x38,0xf2	@ sha1su0 q7,q4,q5
+.byte	0xc0,0x62,0xb9,0xf3	@ sha1h q3,q0		@ 8
+.byte	0x68,0x0c,0x14,0xf2	@ sha1p q0,q2,q12
+	vadd.i32	q12,q10,q6
+.byte	0x8c,0xe3,0xba,0xf3	@ sha1su1 q7,q6
+.byte	0x4c,0x8c,0x3a,0xf2	@ sha1su0 q4,q5,q6
+.byte	0xc0,0x42,0xb9,0xf3	@ sha1h q2,q0		@ 9
+.byte	0x6a,0x0c,0x16,0xf2	@ sha1p q0,q3,q13
+	vadd.i32	q13,q10,q7
+.byte	0x8e,0x83,0xba,0xf3	@ sha1su1 q4,q7
+.byte	0x4e,0xac,0x3c,0xf2	@ sha1su0 q5,q6,q7
+.byte	0xc0,0x62,0xb9,0xf3	@ sha1h q3,q0		@ 10
+.byte	0x68,0x0c,0x24,0xf2	@ sha1m q0,q2,q12
+	vadd.i32	q12,q10,q4
+.byte	0x88,0xa3,0xba,0xf3	@ sha1su1 q5,q4
+.byte	0x48,0xcc,0x3e,0xf2	@ sha1su0 q6,q7,q4
+.byte	0xc0,0x42,0xb9,0xf3	@ sha1h q2,q0		@ 11
+.byte	0x6a,0x0c,0x26,0xf2	@ sha1m q0,q3,q13
+	vadd.i32	q13,q10,q5
+.byte	0x8a,0xc3,0xba,0xf3	@ sha1su1 q6,q5
+.byte	0x4a,0xec,0x38,0xf2	@ sha1su0 q7,q4,q5
+.byte	0xc0,0x62,0xb9,0xf3	@ sha1h q3,q0		@ 12
+.byte	0x68,0x0c,0x24,0xf2	@ sha1m q0,q2,q12
+	vadd.i32	q12,q10,q6
+.byte	0x8c,0xe3,0xba,0xf3	@ sha1su1 q7,q6
+.byte	0x4c,0x8c,0x3a,0xf2	@ sha1su0 q4,q5,q6
+.byte	0xc0,0x42,0xb9,0xf3	@ sha1h q2,q0		@ 13
+.byte	0x6a,0x0c,0x26,0xf2	@ sha1m q0,q3,q13
+	vadd.i32	q13,q11,q7
+.byte	0x8e,0x83,0xba,0xf3	@ sha1su1 q4,q7
+.byte	0x4e,0xac,0x3c,0xf2	@ sha1su0 q5,q6,q7
+.byte	0xc0,0x62,0xb9,0xf3	@ sha1h q3,q0		@ 14
+.byte	0x68,0x0c,0x24,0xf2	@ sha1m q0,q2,q12
+	vadd.i32	q12,q11,q4
+.byte	0x88,0xa3,0xba,0xf3	@ sha1su1 q5,q4
+.byte	0x48,0xcc,0x3e,0xf2	@ sha1su0 q6,q7,q4
+.byte	0xc0,0x42,0xb9,0xf3	@ sha1h q2,q0		@ 15
+.byte	0x6a,0x0c,0x16,0xf2	@ sha1p q0,q3,q13
+	vadd.i32	q13,q11,q5
+.byte	0x8a,0xc3,0xba,0xf3	@ sha1su1 q6,q5
+.byte	0x4a,0xec,0x38,0xf2	@ sha1su0 q7,q4,q5
+.byte	0xc0,0x62,0xb9,0xf3	@ sha1h q3,q0		@ 16
+.byte	0x68,0x0c,0x14,0xf2	@ sha1p q0,q2,q12
+	vadd.i32	q12,q11,q6
+.byte	0x8c,0xe3,0xba,0xf3	@ sha1su1 q7,q6
+.byte	0xc0,0x42,0xb9,0xf3	@ sha1h q2,q0		@ 17
+.byte	0x6a,0x0c,0x16,0xf2	@ sha1p q0,q3,q13
+	vadd.i32	q13,q11,q7
+
+.byte	0xc0,0x62,0xb9,0xf3	@ sha1h q3,q0		@ 18
+.byte	0x68,0x0c,0x14,0xf2	@ sha1p q0,q2,q12
+
+.byte	0xc0,0x42,0xb9,0xf3	@ sha1h q2,q0		@ 19
+.byte	0x6a,0x0c,0x16,0xf2	@ sha1p q0,q3,q13
+
+	vadd.i32	q1,q1,q2
+	vadd.i32	q0,q0,q14
+	bne	.Loop_v8
+
+	vst1.32	{q0},[r0]!
+	vst1.32	{d2[0]},[r0]
+
+	vldmia	sp!,{d8,d9,d10,d11,d12,d13,d14,d15}
+	bx	lr					@ bx lr
+.size	sha1_block_data_order_armv8,.-sha1_block_data_order_armv8
+#endif
+#if __ARM_MAX_ARCH__>=7
+.comm	OPENSSL_armcap_P,4,4
+.hidden	OPENSSL_armcap_P
+#endif
+#endif
\ No newline at end of file
diff --git a/third_party/boringssl/linux-arm/crypto/sha/sha256-armv4.S b/third_party/boringssl/linux-arm/crypto/sha/sha256-armv4.S
new file mode 100644
index 0000000..ac9f2f1
--- /dev/null
+++ b/third_party/boringssl/linux-arm/crypto/sha/sha256-armv4.S
@@ -0,0 +1,2818 @@
+#if defined(__arm__)
+
+@ ====================================================================
+@ Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+@ project. The module is, however, dual licensed under OpenSSL and
+@ CRYPTOGAMS licenses depending on where you obtain it. For further
+@ details see http://www.openssl.org/~appro/cryptogams/.
+@
+@ Permission to use under GPL terms is granted.
+@ ====================================================================
+
+@ SHA256 block procedure for ARMv4. May 2007.
+
+@ Performance is ~2x better than gcc 3.4 generated code and in "abso-
+@ lute" terms is ~2250 cycles per 64-byte block or ~35 cycles per
+@ byte [on single-issue Xscale PXA250 core].
+
+@ July 2010.
+@
+@ Rescheduling for dual-issue pipeline resulted in 22% improvement on
+@ Cortex A8 core and ~20 cycles per processed byte.
+
+@ February 2011.
+@
+@ Profiler-assisted and platform-specific optimization resulted in 16%
+@ improvement on Cortex A8 core and ~15.4 cycles per processed byte.
+
+@ September 2013.
+@
+@ Add NEON implementation. On Cortex A8 it was measured to process one
+@ byte in 12.5 cycles or 23% faster than integer-only code. Snapdragon
+@ S4 does it in 12.5 cycles too, but it's 50% faster than integer-only
+@ code (meaning that latter performs sub-optimally, nothing was done
+@ about it).
+
+@ May 2014.
+@
+@ Add ARMv8 code path performing at 2.0 cpb on Apple A7.
+
+#ifndef __KERNEL__
+# include "arm_arch.h"
+#else
+# define __ARM_ARCH__ __LINUX_ARM_ARCH__
+# define __ARM_MAX_ARCH__ 7
+#endif
+
+.text
+#if __ARM_ARCH__<7
+.code	32
+#else
+.syntax	unified
+# if defined(__thumb2__) && !defined(__APPLE__)
+#  define adrl adr
+.thumb
+# else
+.code	32
+# endif
+#endif
+
+.type	K256,%object
+.align	5
+K256:
+.word	0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5
+.word	0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5
+.word	0xd807aa98,0x12835b01,0x243185be,0x550c7dc3
+.word	0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174
+.word	0xe49b69c1,0xefbe4786,0x0fc19dc6,0x240ca1cc
+.word	0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da
+.word	0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7
+.word	0xc6e00bf3,0xd5a79147,0x06ca6351,0x14292967
+.word	0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13
+.word	0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85
+.word	0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3
+.word	0xd192e819,0xd6990624,0xf40e3585,0x106aa070
+.word	0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5
+.word	0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3
+.word	0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208
+.word	0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2
+.size	K256,.-K256
+.word	0				@ terminator
+#if __ARM_MAX_ARCH__>=7 && !defined(__KERNEL__)
+.LOPENSSL_armcap:
+.word	OPENSSL_armcap_P-.Lsha256_block_data_order
+#endif
+.align	5
+
+.globl	sha256_block_data_order
+.type	sha256_block_data_order,%function
+sha256_block_data_order:
+.Lsha256_block_data_order:
+#if __ARM_ARCH__<7
+	sub	r3,pc,#8		@ sha256_block_data_order
+#else
+	adr	r3,sha256_block_data_order
+#endif
+#if __ARM_MAX_ARCH__>=7 && !defined(__KERNEL__)
+	ldr	r12,.LOPENSSL_armcap
+	ldr	r12,[r3,r12]		@ OPENSSL_armcap_P
+#ifdef	__APPLE__
+	ldr	r12,[r12]
+#endif
+	tst	r12,#ARMV8_SHA256
+	bne	.LARMv8
+	tst	r12,#ARMV7_NEON
+	bne	.LNEON
+#endif
+	add	r2,r1,r2,lsl#6	@ len to point at the end of inp
+	stmdb	sp!,{r0,r1,r2,r4-r11,lr}
+	ldmia	r0,{r4,r5,r6,r7,r8,r9,r10,r11}
+	sub	r14,r3,#256+32	@ K256
+	sub	sp,sp,#16*4		@ alloca(X[16])
+.Loop:
+# if __ARM_ARCH__>=7
+	ldr	r2,[r1],#4
+# else
+	ldrb	r2,[r1,#3]
+# endif
+	eor	r3,r5,r6		@ magic
+	eor	r12,r12,r12
+#if __ARM_ARCH__>=7
+	@ ldr	r2,[r1],#4			@ 0
+# if 0==15
+	str	r1,[sp,#17*4]			@ make room for r1
+# endif
+	eor	r0,r8,r8,ror#5
+	add	r4,r4,r12			@ h+=Maj(a,b,c) from the past
+	eor	r0,r0,r8,ror#19	@ Sigma1(e)
+# ifndef __ARMEB__
+	rev	r2,r2
+# endif
+#else
+	@ ldrb	r2,[r1,#3]			@ 0
+	add	r4,r4,r12			@ h+=Maj(a,b,c) from the past
+	ldrb	r12,[r1,#2]
+	ldrb	r0,[r1,#1]
+	orr	r2,r2,r12,lsl#8
+	ldrb	r12,[r1],#4
+	orr	r2,r2,r0,lsl#16
+# if 0==15
+	str	r1,[sp,#17*4]			@ make room for r1
+# endif
+	eor	r0,r8,r8,ror#5
+	orr	r2,r2,r12,lsl#24
+	eor	r0,r0,r8,ror#19	@ Sigma1(e)
+#endif
+	ldr	r12,[r14],#4			@ *K256++
+	add	r11,r11,r2			@ h+=X[i]
+	str	r2,[sp,#0*4]
+	eor	r2,r9,r10
+	add	r11,r11,r0,ror#6	@ h+=Sigma1(e)
+	and	r2,r2,r8
+	add	r11,r11,r12			@ h+=K256[i]
+	eor	r2,r2,r10			@ Ch(e,f,g)
+	eor	r0,r4,r4,ror#11
+	add	r11,r11,r2			@ h+=Ch(e,f,g)
+#if 0==31
+	and	r12,r12,#0xff
+	cmp	r12,#0xf2			@ done?
+#endif
+#if 0<15
+# if __ARM_ARCH__>=7
+	ldr	r2,[r1],#4			@ prefetch
+# else
+	ldrb	r2,[r1,#3]
+# endif
+	eor	r12,r4,r5			@ a^b, b^c in next round
+#else
+	ldr	r2,[sp,#2*4]		@ from future BODY_16_xx
+	eor	r12,r4,r5			@ a^b, b^c in next round
+	ldr	r1,[sp,#15*4]	@ from future BODY_16_xx
+#endif
+	eor	r0,r0,r4,ror#20	@ Sigma0(a)
+	and	r3,r3,r12			@ (b^c)&=(a^b)
+	add	r7,r7,r11			@ d+=h
+	eor	r3,r3,r5			@ Maj(a,b,c)
+	add	r11,r11,r0,ror#2	@ h+=Sigma0(a)
+	@ add	r11,r11,r3			@ h+=Maj(a,b,c)
+#if __ARM_ARCH__>=7
+	@ ldr	r2,[r1],#4			@ 1
+# if 1==15
+	str	r1,[sp,#17*4]			@ make room for r1
+# endif
+	eor	r0,r7,r7,ror#5
+	add	r11,r11,r3			@ h+=Maj(a,b,c) from the past
+	eor	r0,r0,r7,ror#19	@ Sigma1(e)
+# ifndef __ARMEB__
+	rev	r2,r2
+# endif
+#else
+	@ ldrb	r2,[r1,#3]			@ 1
+	add	r11,r11,r3			@ h+=Maj(a,b,c) from the past
+	ldrb	r3,[r1,#2]
+	ldrb	r0,[r1,#1]
+	orr	r2,r2,r3,lsl#8
+	ldrb	r3,[r1],#4
+	orr	r2,r2,r0,lsl#16
+# if 1==15
+	str	r1,[sp,#17*4]			@ make room for r1
+# endif
+	eor	r0,r7,r7,ror#5
+	orr	r2,r2,r3,lsl#24
+	eor	r0,r0,r7,ror#19	@ Sigma1(e)
+#endif
+	ldr	r3,[r14],#4			@ *K256++
+	add	r10,r10,r2			@ h+=X[i]
+	str	r2,[sp,#1*4]
+	eor	r2,r8,r9
+	add	r10,r10,r0,ror#6	@ h+=Sigma1(e)
+	and	r2,r2,r7
+	add	r10,r10,r3			@ h+=K256[i]
+	eor	r2,r2,r9			@ Ch(e,f,g)
+	eor	r0,r11,r11,ror#11
+	add	r10,r10,r2			@ h+=Ch(e,f,g)
+#if 1==31
+	and	r3,r3,#0xff
+	cmp	r3,#0xf2			@ done?
+#endif
+#if 1<15
+# if __ARM_ARCH__>=7
+	ldr	r2,[r1],#4			@ prefetch
+# else
+	ldrb	r2,[r1,#3]
+# endif
+	eor	r3,r11,r4			@ a^b, b^c in next round
+#else
+	ldr	r2,[sp,#3*4]		@ from future BODY_16_xx
+	eor	r3,r11,r4			@ a^b, b^c in next round
+	ldr	r1,[sp,#0*4]	@ from future BODY_16_xx
+#endif
+	eor	r0,r0,r11,ror#20	@ Sigma0(a)
+	and	r12,r12,r3			@ (b^c)&=(a^b)
+	add	r6,r6,r10			@ d+=h
+	eor	r12,r12,r4			@ Maj(a,b,c)
+	add	r10,r10,r0,ror#2	@ h+=Sigma0(a)
+	@ add	r10,r10,r12			@ h+=Maj(a,b,c)
+#if __ARM_ARCH__>=7
+	@ ldr	r2,[r1],#4			@ 2
+# if 2==15
+	str	r1,[sp,#17*4]			@ make room for r1
+# endif
+	eor	r0,r6,r6,ror#5
+	add	r10,r10,r12			@ h+=Maj(a,b,c) from the past
+	eor	r0,r0,r6,ror#19	@ Sigma1(e)
+# ifndef __ARMEB__
+	rev	r2,r2
+# endif
+#else
+	@ ldrb	r2,[r1,#3]			@ 2
+	add	r10,r10,r12			@ h+=Maj(a,b,c) from the past
+	ldrb	r12,[r1,#2]
+	ldrb	r0,[r1,#1]
+	orr	r2,r2,r12,lsl#8
+	ldrb	r12,[r1],#4
+	orr	r2,r2,r0,lsl#16
+# if 2==15
+	str	r1,[sp,#17*4]			@ make room for r1
+# endif
+	eor	r0,r6,r6,ror#5
+	orr	r2,r2,r12,lsl#24
+	eor	r0,r0,r6,ror#19	@ Sigma1(e)
+#endif
+	ldr	r12,[r14],#4			@ *K256++
+	add	r9,r9,r2			@ h+=X[i]
+	str	r2,[sp,#2*4]
+	eor	r2,r7,r8
+	add	r9,r9,r0,ror#6	@ h+=Sigma1(e)
+	and	r2,r2,r6
+	add	r9,r9,r12			@ h+=K256[i]
+	eor	r2,r2,r8			@ Ch(e,f,g)
+	eor	r0,r10,r10,ror#11
+	add	r9,r9,r2			@ h+=Ch(e,f,g)
+#if 2==31
+	and	r12,r12,#0xff
+	cmp	r12,#0xf2			@ done?
+#endif
+#if 2<15
+# if __ARM_ARCH__>=7
+	ldr	r2,[r1],#4			@ prefetch
+# else
+	ldrb	r2,[r1,#3]
+# endif
+	eor	r12,r10,r11			@ a^b, b^c in next round
+#else
+	ldr	r2,[sp,#4*4]		@ from future BODY_16_xx
+	eor	r12,r10,r11			@ a^b, b^c in next round
+	ldr	r1,[sp,#1*4]	@ from future BODY_16_xx
+#endif
+	eor	r0,r0,r10,ror#20	@ Sigma0(a)
+	and	r3,r3,r12			@ (b^c)&=(a^b)
+	add	r5,r5,r9			@ d+=h
+	eor	r3,r3,r11			@ Maj(a,b,c)
+	add	r9,r9,r0,ror#2	@ h+=Sigma0(a)
+	@ add	r9,r9,r3			@ h+=Maj(a,b,c)
+#if __ARM_ARCH__>=7
+	@ ldr	r2,[r1],#4			@ 3
+# if 3==15
+	str	r1,[sp,#17*4]			@ make room for r1
+# endif
+	eor	r0,r5,r5,ror#5
+	add	r9,r9,r3			@ h+=Maj(a,b,c) from the past
+	eor	r0,r0,r5,ror#19	@ Sigma1(e)
+# ifndef __ARMEB__
+	rev	r2,r2
+# endif
+#else
+	@ ldrb	r2,[r1,#3]			@ 3
+	add	r9,r9,r3			@ h+=Maj(a,b,c) from the past
+	ldrb	r3,[r1,#2]
+	ldrb	r0,[r1,#1]
+	orr	r2,r2,r3,lsl#8
+	ldrb	r3,[r1],#4
+	orr	r2,r2,r0,lsl#16
+# if 3==15
+	str	r1,[sp,#17*4]			@ make room for r1
+# endif
+	eor	r0,r5,r5,ror#5
+	orr	r2,r2,r3,lsl#24
+	eor	r0,r0,r5,ror#19	@ Sigma1(e)
+#endif
+	ldr	r3,[r14],#4			@ *K256++
+	add	r8,r8,r2			@ h+=X[i]
+	str	r2,[sp,#3*4]
+	eor	r2,r6,r7
+	add	r8,r8,r0,ror#6	@ h+=Sigma1(e)
+	and	r2,r2,r5
+	add	r8,r8,r3			@ h+=K256[i]
+	eor	r2,r2,r7			@ Ch(e,f,g)
+	eor	r0,r9,r9,ror#11
+	add	r8,r8,r2			@ h+=Ch(e,f,g)
+#if 3==31
+	and	r3,r3,#0xff
+	cmp	r3,#0xf2			@ done?
+#endif
+#if 3<15
+# if __ARM_ARCH__>=7
+	ldr	r2,[r1],#4			@ prefetch
+# else
+	ldrb	r2,[r1,#3]
+# endif
+	eor	r3,r9,r10			@ a^b, b^c in next round
+#else
+	ldr	r2,[sp,#5*4]		@ from future BODY_16_xx
+	eor	r3,r9,r10			@ a^b, b^c in next round
+	ldr	r1,[sp,#2*4]	@ from future BODY_16_xx
+#endif
+	eor	r0,r0,r9,ror#20	@ Sigma0(a)
+	and	r12,r12,r3			@ (b^c)&=(a^b)
+	add	r4,r4,r8			@ d+=h
+	eor	r12,r12,r10			@ Maj(a,b,c)
+	add	r8,r8,r0,ror#2	@ h+=Sigma0(a)
+	@ add	r8,r8,r12			@ h+=Maj(a,b,c)
+#if __ARM_ARCH__>=7
+	@ ldr	r2,[r1],#4			@ 4
+# if 4==15
+	str	r1,[sp,#17*4]			@ make room for r1
+# endif
+	eor	r0,r4,r4,ror#5
+	add	r8,r8,r12			@ h+=Maj(a,b,c) from the past
+	eor	r0,r0,r4,ror#19	@ Sigma1(e)
+# ifndef __ARMEB__
+	rev	r2,r2
+# endif
+#else
+	@ ldrb	r2,[r1,#3]			@ 4
+	add	r8,r8,r12			@ h+=Maj(a,b,c) from the past
+	ldrb	r12,[r1,#2]
+	ldrb	r0,[r1,#1]
+	orr	r2,r2,r12,lsl#8
+	ldrb	r12,[r1],#4
+	orr	r2,r2,r0,lsl#16
+# if 4==15
+	str	r1,[sp,#17*4]			@ make room for r1
+# endif
+	eor	r0,r4,r4,ror#5
+	orr	r2,r2,r12,lsl#24
+	eor	r0,r0,r4,ror#19	@ Sigma1(e)
+#endif
+	ldr	r12,[r14],#4			@ *K256++
+	add	r7,r7,r2			@ h+=X[i]
+	str	r2,[sp,#4*4]
+	eor	r2,r5,r6
+	add	r7,r7,r0,ror#6	@ h+=Sigma1(e)
+	and	r2,r2,r4
+	add	r7,r7,r12			@ h+=K256[i]
+	eor	r2,r2,r6			@ Ch(e,f,g)
+	eor	r0,r8,r8,ror#11
+	add	r7,r7,r2			@ h+=Ch(e,f,g)
+#if 4==31
+	and	r12,r12,#0xff
+	cmp	r12,#0xf2			@ done?
+#endif
+#if 4<15
+# if __ARM_ARCH__>=7
+	ldr	r2,[r1],#4			@ prefetch
+# else
+	ldrb	r2,[r1,#3]
+# endif
+	eor	r12,r8,r9			@ a^b, b^c in next round
+#else
+	ldr	r2,[sp,#6*4]		@ from future BODY_16_xx
+	eor	r12,r8,r9			@ a^b, b^c in next round
+	ldr	r1,[sp,#3*4]	@ from future BODY_16_xx
+#endif
+	eor	r0,r0,r8,ror#20	@ Sigma0(a)
+	and	r3,r3,r12			@ (b^c)&=(a^b)
+	add	r11,r11,r7			@ d+=h
+	eor	r3,r3,r9			@ Maj(a,b,c)
+	add	r7,r7,r0,ror#2	@ h+=Sigma0(a)
+	@ add	r7,r7,r3			@ h+=Maj(a,b,c)
+#if __ARM_ARCH__>=7
+	@ ldr	r2,[r1],#4			@ 5
+# if 5==15
+	str	r1,[sp,#17*4]			@ make room for r1
+# endif
+	eor	r0,r11,r11,ror#5
+	add	r7,r7,r3			@ h+=Maj(a,b,c) from the past
+	eor	r0,r0,r11,ror#19	@ Sigma1(e)
+# ifndef __ARMEB__
+	rev	r2,r2
+# endif
+#else
+	@ ldrb	r2,[r1,#3]			@ 5
+	add	r7,r7,r3			@ h+=Maj(a,b,c) from the past
+	ldrb	r3,[r1,#2]
+	ldrb	r0,[r1,#1]
+	orr	r2,r2,r3,lsl#8
+	ldrb	r3,[r1],#4
+	orr	r2,r2,r0,lsl#16
+# if 5==15
+	str	r1,[sp,#17*4]			@ make room for r1
+# endif
+	eor	r0,r11,r11,ror#5
+	orr	r2,r2,r3,lsl#24
+	eor	r0,r0,r11,ror#19	@ Sigma1(e)
+#endif
+	ldr	r3,[r14],#4			@ *K256++
+	add	r6,r6,r2			@ h+=X[i]
+	str	r2,[sp,#5*4]
+	eor	r2,r4,r5
+	add	r6,r6,r0,ror#6	@ h+=Sigma1(e)
+	and	r2,r2,r11
+	add	r6,r6,r3			@ h+=K256[i]
+	eor	r2,r2,r5			@ Ch(e,f,g)
+	eor	r0,r7,r7,ror#11
+	add	r6,r6,r2			@ h+=Ch(e,f,g)
+#if 5==31
+	and	r3,r3,#0xff
+	cmp	r3,#0xf2			@ done?
+#endif
+#if 5<15
+# if __ARM_ARCH__>=7
+	ldr	r2,[r1],#4			@ prefetch
+# else
+	ldrb	r2,[r1,#3]
+# endif
+	eor	r3,r7,r8			@ a^b, b^c in next round
+#else
+	ldr	r2,[sp,#7*4]		@ from future BODY_16_xx
+	eor	r3,r7,r8			@ a^b, b^c in next round
+	ldr	r1,[sp,#4*4]	@ from future BODY_16_xx
+#endif
+	eor	r0,r0,r7,ror#20	@ Sigma0(a)
+	and	r12,r12,r3			@ (b^c)&=(a^b)
+	add	r10,r10,r6			@ d+=h
+	eor	r12,r12,r8			@ Maj(a,b,c)
+	add	r6,r6,r0,ror#2	@ h+=Sigma0(a)
+	@ add	r6,r6,r12			@ h+=Maj(a,b,c)
+#if __ARM_ARCH__>=7
+	@ ldr	r2,[r1],#4			@ 6
+# if 6==15
+	str	r1,[sp,#17*4]			@ make room for r1
+# endif
+	eor	r0,r10,r10,ror#5
+	add	r6,r6,r12			@ h+=Maj(a,b,c) from the past
+	eor	r0,r0,r10,ror#19	@ Sigma1(e)
+# ifndef __ARMEB__
+	rev	r2,r2
+# endif
+#else
+	@ ldrb	r2,[r1,#3]			@ 6
+	add	r6,r6,r12			@ h+=Maj(a,b,c) from the past
+	ldrb	r12,[r1,#2]
+	ldrb	r0,[r1,#1]
+	orr	r2,r2,r12,lsl#8
+	ldrb	r12,[r1],#4
+	orr	r2,r2,r0,lsl#16
+# if 6==15
+	str	r1,[sp,#17*4]			@ make room for r1
+# endif
+	eor	r0,r10,r10,ror#5
+	orr	r2,r2,r12,lsl#24
+	eor	r0,r0,r10,ror#19	@ Sigma1(e)
+#endif
+	ldr	r12,[r14],#4			@ *K256++
+	add	r5,r5,r2			@ h+=X[i]
+	str	r2,[sp,#6*4]
+	eor	r2,r11,r4
+	add	r5,r5,r0,ror#6	@ h+=Sigma1(e)
+	and	r2,r2,r10
+	add	r5,r5,r12			@ h+=K256[i]
+	eor	r2,r2,r4			@ Ch(e,f,g)
+	eor	r0,r6,r6,ror#11
+	add	r5,r5,r2			@ h+=Ch(e,f,g)
+#if 6==31
+	and	r12,r12,#0xff
+	cmp	r12,#0xf2			@ done?
+#endif
+#if 6<15
+# if __ARM_ARCH__>=7
+	ldr	r2,[r1],#4			@ prefetch
+# else
+	ldrb	r2,[r1,#3]
+# endif
+	eor	r12,r6,r7			@ a^b, b^c in next round
+#else
+	ldr	r2,[sp,#8*4]		@ from future BODY_16_xx
+	eor	r12,r6,r7			@ a^b, b^c in next round
+	ldr	r1,[sp,#5*4]	@ from future BODY_16_xx
+#endif
+	eor	r0,r0,r6,ror#20	@ Sigma0(a)
+	and	r3,r3,r12			@ (b^c)&=(a^b)
+	add	r9,r9,r5			@ d+=h
+	eor	r3,r3,r7			@ Maj(a,b,c)
+	add	r5,r5,r0,ror#2	@ h+=Sigma0(a)
+	@ add	r5,r5,r3			@ h+=Maj(a,b,c)
+#if __ARM_ARCH__>=7
+	@ ldr	r2,[r1],#4			@ 7
+# if 7==15
+	str	r1,[sp,#17*4]			@ make room for r1
+# endif
+	eor	r0,r9,r9,ror#5
+	add	r5,r5,r3			@ h+=Maj(a,b,c) from the past
+	eor	r0,r0,r9,ror#19	@ Sigma1(e)
+# ifndef __ARMEB__
+	rev	r2,r2
+# endif
+#else
+	@ ldrb	r2,[r1,#3]			@ 7
+	add	r5,r5,r3			@ h+=Maj(a,b,c) from the past
+	ldrb	r3,[r1,#2]
+	ldrb	r0,[r1,#1]
+	orr	r2,r2,r3,lsl#8
+	ldrb	r3,[r1],#4
+	orr	r2,r2,r0,lsl#16
+# if 7==15
+	str	r1,[sp,#17*4]			@ make room for r1
+# endif
+	eor	r0,r9,r9,ror#5
+	orr	r2,r2,r3,lsl#24
+	eor	r0,r0,r9,ror#19	@ Sigma1(e)
+#endif
+	ldr	r3,[r14],#4			@ *K256++
+	add	r4,r4,r2			@ h+=X[i]
+	str	r2,[sp,#7*4]
+	eor	r2,r10,r11
+	add	r4,r4,r0,ror#6	@ h+=Sigma1(e)
+	and	r2,r2,r9
+	add	r4,r4,r3			@ h+=K256[i]
+	eor	r2,r2,r11			@ Ch(e,f,g)
+	eor	r0,r5,r5,ror#11
+	add	r4,r4,r2			@ h+=Ch(e,f,g)
+#if 7==31
+	and	r3,r3,#0xff
+	cmp	r3,#0xf2			@ done?
+#endif
+#if 7<15
+# if __ARM_ARCH__>=7
+	ldr	r2,[r1],#4			@ prefetch
+# else
+	ldrb	r2,[r1,#3]
+# endif
+	eor	r3,r5,r6			@ a^b, b^c in next round
+#else
+	ldr	r2,[sp,#9*4]		@ from future BODY_16_xx
+	eor	r3,r5,r6			@ a^b, b^c in next round
+	ldr	r1,[sp,#6*4]	@ from future BODY_16_xx
+#endif
+	eor	r0,r0,r5,ror#20	@ Sigma0(a)
+	and	r12,r12,r3			@ (b^c)&=(a^b)
+	add	r8,r8,r4			@ d+=h
+	eor	r12,r12,r6			@ Maj(a,b,c)
+	add	r4,r4,r0,ror#2	@ h+=Sigma0(a)
+	@ add	r4,r4,r12			@ h+=Maj(a,b,c)
+#if __ARM_ARCH__>=7
+	@ ldr	r2,[r1],#4			@ 8
+# if 8==15
+	str	r1,[sp,#17*4]			@ make room for r1
+# endif
+	eor	r0,r8,r8,ror#5
+	add	r4,r4,r12			@ h+=Maj(a,b,c) from the past
+	eor	r0,r0,r8,ror#19	@ Sigma1(e)
+# ifndef __ARMEB__
+	rev	r2,r2
+# endif
+#else
+	@ ldrb	r2,[r1,#3]			@ 8
+	add	r4,r4,r12			@ h+=Maj(a,b,c) from the past
+	ldrb	r12,[r1,#2]
+	ldrb	r0,[r1,#1]
+	orr	r2,r2,r12,lsl#8
+	ldrb	r12,[r1],#4
+	orr	r2,r2,r0,lsl#16
+# if 8==15
+	str	r1,[sp,#17*4]			@ make room for r1
+# endif
+	eor	r0,r8,r8,ror#5
+	orr	r2,r2,r12,lsl#24
+	eor	r0,r0,r8,ror#19	@ Sigma1(e)
+#endif
+	ldr	r12,[r14],#4			@ *K256++
+	add	r11,r11,r2			@ h+=X[i]
+	str	r2,[sp,#8*4]
+	eor	r2,r9,r10
+	add	r11,r11,r0,ror#6	@ h+=Sigma1(e)
+	and	r2,r2,r8
+	add	r11,r11,r12			@ h+=K256[i]
+	eor	r2,r2,r10			@ Ch(e,f,g)
+	eor	r0,r4,r4,ror#11
+	add	r11,r11,r2			@ h+=Ch(e,f,g)
+#if 8==31
+	and	r12,r12,#0xff
+	cmp	r12,#0xf2			@ done?
+#endif
+#if 8<15
+# if __ARM_ARCH__>=7
+	ldr	r2,[r1],#4			@ prefetch
+# else
+	ldrb	r2,[r1,#3]
+# endif
+	eor	r12,r4,r5			@ a^b, b^c in next round
+#else
+	ldr	r2,[sp,#10*4]		@ from future BODY_16_xx
+	eor	r12,r4,r5			@ a^b, b^c in next round
+	ldr	r1,[sp,#7*4]	@ from future BODY_16_xx
+#endif
+	eor	r0,r0,r4,ror#20	@ Sigma0(a)
+	and	r3,r3,r12			@ (b^c)&=(a^b)
+	add	r7,r7,r11			@ d+=h
+	eor	r3,r3,r5			@ Maj(a,b,c)
+	add	r11,r11,r0,ror#2	@ h+=Sigma0(a)
+	@ add	r11,r11,r3			@ h+=Maj(a,b,c)
+#if __ARM_ARCH__>=7
+	@ ldr	r2,[r1],#4			@ 9
+# if 9==15
+	str	r1,[sp,#17*4]			@ make room for r1
+# endif
+	eor	r0,r7,r7,ror#5
+	add	r11,r11,r3			@ h+=Maj(a,b,c) from the past
+	eor	r0,r0,r7,ror#19	@ Sigma1(e)
+# ifndef __ARMEB__
+	rev	r2,r2
+# endif
+#else
+	@ ldrb	r2,[r1,#3]			@ 9
+	add	r11,r11,r3			@ h+=Maj(a,b,c) from the past
+	ldrb	r3,[r1,#2]
+	ldrb	r0,[r1,#1]
+	orr	r2,r2,r3,lsl#8
+	ldrb	r3,[r1],#4
+	orr	r2,r2,r0,lsl#16
+# if 9==15
+	str	r1,[sp,#17*4]			@ make room for r1
+# endif
+	eor	r0,r7,r7,ror#5
+	orr	r2,r2,r3,lsl#24
+	eor	r0,r0,r7,ror#19	@ Sigma1(e)
+#endif
+	ldr	r3,[r14],#4			@ *K256++
+	add	r10,r10,r2			@ h+=X[i]
+	str	r2,[sp,#9*4]
+	eor	r2,r8,r9
+	add	r10,r10,r0,ror#6	@ h+=Sigma1(e)
+	and	r2,r2,r7
+	add	r10,r10,r3			@ h+=K256[i]
+	eor	r2,r2,r9			@ Ch(e,f,g)
+	eor	r0,r11,r11,ror#11
+	add	r10,r10,r2			@ h+=Ch(e,f,g)
+#if 9==31
+	and	r3,r3,#0xff
+	cmp	r3,#0xf2			@ done?
+#endif
+#if 9<15
+# if __ARM_ARCH__>=7
+	ldr	r2,[r1],#4			@ prefetch
+# else
+	ldrb	r2,[r1,#3]
+# endif
+	eor	r3,r11,r4			@ a^b, b^c in next round
+#else
+	ldr	r2,[sp,#11*4]		@ from future BODY_16_xx
+	eor	r3,r11,r4			@ a^b, b^c in next round
+	ldr	r1,[sp,#8*4]	@ from future BODY_16_xx
+#endif
+	eor	r0,r0,r11,ror#20	@ Sigma0(a)
+	and	r12,r12,r3			@ (b^c)&=(a^b)
+	add	r6,r6,r10			@ d+=h
+	eor	r12,r12,r4			@ Maj(a,b,c)
+	add	r10,r10,r0,ror#2	@ h+=Sigma0(a)
+	@ add	r10,r10,r12			@ h+=Maj(a,b,c)
+#if __ARM_ARCH__>=7
+	@ ldr	r2,[r1],#4			@ 10
+# if 10==15
+	str	r1,[sp,#17*4]			@ make room for r1
+# endif
+	eor	r0,r6,r6,ror#5
+	add	r10,r10,r12			@ h+=Maj(a,b,c) from the past
+	eor	r0,r0,r6,ror#19	@ Sigma1(e)
+# ifndef __ARMEB__
+	rev	r2,r2
+# endif
+#else
+	@ ldrb	r2,[r1,#3]			@ 10
+	add	r10,r10,r12			@ h+=Maj(a,b,c) from the past
+	ldrb	r12,[r1,#2]
+	ldrb	r0,[r1,#1]
+	orr	r2,r2,r12,lsl#8
+	ldrb	r12,[r1],#4
+	orr	r2,r2,r0,lsl#16
+# if 10==15
+	str	r1,[sp,#17*4]			@ make room for r1
+# endif
+	eor	r0,r6,r6,ror#5
+	orr	r2,r2,r12,lsl#24
+	eor	r0,r0,r6,ror#19	@ Sigma1(e)
+#endif
+	ldr	r12,[r14],#4			@ *K256++
+	add	r9,r9,r2			@ h+=X[i]
+	str	r2,[sp,#10*4]
+	eor	r2,r7,r8
+	add	r9,r9,r0,ror#6	@ h+=Sigma1(e)
+	and	r2,r2,r6
+	add	r9,r9,r12			@ h+=K256[i]
+	eor	r2,r2,r8			@ Ch(e,f,g)
+	eor	r0,r10,r10,ror#11
+	add	r9,r9,r2			@ h+=Ch(e,f,g)
+#if 10==31
+	and	r12,r12,#0xff
+	cmp	r12,#0xf2			@ done?
+#endif
+#if 10<15
+# if __ARM_ARCH__>=7
+	ldr	r2,[r1],#4			@ prefetch
+# else
+	ldrb	r2,[r1,#3]
+# endif
+	eor	r12,r10,r11			@ a^b, b^c in next round
+#else
+	ldr	r2,[sp,#12*4]		@ from future BODY_16_xx
+	eor	r12,r10,r11			@ a^b, b^c in next round
+	ldr	r1,[sp,#9*4]	@ from future BODY_16_xx
+#endif
+	eor	r0,r0,r10,ror#20	@ Sigma0(a)
+	and	r3,r3,r12			@ (b^c)&=(a^b)
+	add	r5,r5,r9			@ d+=h
+	eor	r3,r3,r11			@ Maj(a,b,c)
+	add	r9,r9,r0,ror#2	@ h+=Sigma0(a)
+	@ add	r9,r9,r3			@ h+=Maj(a,b,c)
+#if __ARM_ARCH__>=7
+	@ ldr	r2,[r1],#4			@ 11
+# if 11==15
+	str	r1,[sp,#17*4]			@ make room for r1
+# endif
+	eor	r0,r5,r5,ror#5
+	add	r9,r9,r3			@ h+=Maj(a,b,c) from the past
+	eor	r0,r0,r5,ror#19	@ Sigma1(e)
+# ifndef __ARMEB__
+	rev	r2,r2
+# endif
+#else
+	@ ldrb	r2,[r1,#3]			@ 11
+	add	r9,r9,r3			@ h+=Maj(a,b,c) from the past
+	ldrb	r3,[r1,#2]
+	ldrb	r0,[r1,#1]
+	orr	r2,r2,r3,lsl#8
+	ldrb	r3,[r1],#4
+	orr	r2,r2,r0,lsl#16
+# if 11==15
+	str	r1,[sp,#17*4]			@ make room for r1
+# endif
+	eor	r0,r5,r5,ror#5
+	orr	r2,r2,r3,lsl#24
+	eor	r0,r0,r5,ror#19	@ Sigma1(e)
+#endif
+	ldr	r3,[r14],#4			@ *K256++
+	add	r8,r8,r2			@ h+=X[i]
+	str	r2,[sp,#11*4]
+	eor	r2,r6,r7
+	add	r8,r8,r0,ror#6	@ h+=Sigma1(e)
+	and	r2,r2,r5
+	add	r8,r8,r3			@ h+=K256[i]
+	eor	r2,r2,r7			@ Ch(e,f,g)
+	eor	r0,r9,r9,ror#11
+	add	r8,r8,r2			@ h+=Ch(e,f,g)
+#if 11==31
+	and	r3,r3,#0xff
+	cmp	r3,#0xf2			@ done?
+#endif
+#if 11<15
+# if __ARM_ARCH__>=7
+	ldr	r2,[r1],#4			@ prefetch
+# else
+	ldrb	r2,[r1,#3]
+# endif
+	eor	r3,r9,r10			@ a^b, b^c in next round
+#else
+	ldr	r2,[sp,#13*4]		@ from future BODY_16_xx
+	eor	r3,r9,r10			@ a^b, b^c in next round
+	ldr	r1,[sp,#10*4]	@ from future BODY_16_xx
+#endif
+	eor	r0,r0,r9,ror#20	@ Sigma0(a)
+	and	r12,r12,r3			@ (b^c)&=(a^b)
+	add	r4,r4,r8			@ d+=h
+	eor	r12,r12,r10			@ Maj(a,b,c)
+	add	r8,r8,r0,ror#2	@ h+=Sigma0(a)
+	@ add	r8,r8,r12			@ h+=Maj(a,b,c)
+#if __ARM_ARCH__>=7
+	@ ldr	r2,[r1],#4			@ 12
+# if 12==15
+	str	r1,[sp,#17*4]			@ make room for r1
+# endif
+	eor	r0,r4,r4,ror#5
+	add	r8,r8,r12			@ h+=Maj(a,b,c) from the past
+	eor	r0,r0,r4,ror#19	@ Sigma1(e)
+# ifndef __ARMEB__
+	rev	r2,r2
+# endif
+#else
+	@ ldrb	r2,[r1,#3]			@ 12
+	add	r8,r8,r12			@ h+=Maj(a,b,c) from the past
+	ldrb	r12,[r1,#2]
+	ldrb	r0,[r1,#1]
+	orr	r2,r2,r12,lsl#8
+	ldrb	r12,[r1],#4
+	orr	r2,r2,r0,lsl#16
+# if 12==15
+	str	r1,[sp,#17*4]			@ make room for r1
+# endif
+	eor	r0,r4,r4,ror#5
+	orr	r2,r2,r12,lsl#24
+	eor	r0,r0,r4,ror#19	@ Sigma1(e)
+#endif
+	ldr	r12,[r14],#4			@ *K256++
+	add	r7,r7,r2			@ h+=X[i]
+	str	r2,[sp,#12*4]
+	eor	r2,r5,r6
+	add	r7,r7,r0,ror#6	@ h+=Sigma1(e)
+	and	r2,r2,r4
+	add	r7,r7,r12			@ h+=K256[i]
+	eor	r2,r2,r6			@ Ch(e,f,g)
+	eor	r0,r8,r8,ror#11
+	add	r7,r7,r2			@ h+=Ch(e,f,g)
+#if 12==31
+	and	r12,r12,#0xff
+	cmp	r12,#0xf2			@ done?
+#endif
+#if 12<15
+# if __ARM_ARCH__>=7
+	ldr	r2,[r1],#4			@ prefetch
+# else
+	ldrb	r2,[r1,#3]
+# endif
+	eor	r12,r8,r9			@ a^b, b^c in next round
+#else
+	ldr	r2,[sp,#14*4]		@ from future BODY_16_xx
+	eor	r12,r8,r9			@ a^b, b^c in next round
+	ldr	r1,[sp,#11*4]	@ from future BODY_16_xx
+#endif
+	eor	r0,r0,r8,ror#20	@ Sigma0(a)
+	and	r3,r3,r12			@ (b^c)&=(a^b)
+	add	r11,r11,r7			@ d+=h
+	eor	r3,r3,r9			@ Maj(a,b,c)
+	add	r7,r7,r0,ror#2	@ h+=Sigma0(a)
+	@ add	r7,r7,r3			@ h+=Maj(a,b,c)
+#if __ARM_ARCH__>=7
+	@ ldr	r2,[r1],#4			@ 13
+# if 13==15
+	str	r1,[sp,#17*4]			@ make room for r1
+# endif
+	eor	r0,r11,r11,ror#5
+	add	r7,r7,r3			@ h+=Maj(a,b,c) from the past
+	eor	r0,r0,r11,ror#19	@ Sigma1(e)
+# ifndef __ARMEB__
+	rev	r2,r2
+# endif
+#else
+	@ ldrb	r2,[r1,#3]			@ 13
+	add	r7,r7,r3			@ h+=Maj(a,b,c) from the past
+	ldrb	r3,[r1,#2]
+	ldrb	r0,[r1,#1]
+	orr	r2,r2,r3,lsl#8
+	ldrb	r3,[r1],#4
+	orr	r2,r2,r0,lsl#16
+# if 13==15
+	str	r1,[sp,#17*4]			@ make room for r1
+# endif
+	eor	r0,r11,r11,ror#5
+	orr	r2,r2,r3,lsl#24
+	eor	r0,r0,r11,ror#19	@ Sigma1(e)
+#endif
+	ldr	r3,[r14],#4			@ *K256++
+	add	r6,r6,r2			@ h+=X[i]
+	str	r2,[sp,#13*4]
+	eor	r2,r4,r5
+	add	r6,r6,r0,ror#6	@ h+=Sigma1(e)
+	and	r2,r2,r11
+	add	r6,r6,r3			@ h+=K256[i]
+	eor	r2,r2,r5			@ Ch(e,f,g)
+	eor	r0,r7,r7,ror#11
+	add	r6,r6,r2			@ h+=Ch(e,f,g)
+#if 13==31
+	and	r3,r3,#0xff
+	cmp	r3,#0xf2			@ done?
+#endif
+#if 13<15
+# if __ARM_ARCH__>=7
+	ldr	r2,[r1],#4			@ prefetch
+# else
+	ldrb	r2,[r1,#3]
+# endif
+	eor	r3,r7,r8			@ a^b, b^c in next round
+#else
+	ldr	r2,[sp,#15*4]		@ from future BODY_16_xx
+	eor	r3,r7,r8			@ a^b, b^c in next round
+	ldr	r1,[sp,#12*4]	@ from future BODY_16_xx
+#endif
+	eor	r0,r0,r7,ror#20	@ Sigma0(a)
+	and	r12,r12,r3			@ (b^c)&=(a^b)
+	add	r10,r10,r6			@ d+=h
+	eor	r12,r12,r8			@ Maj(a,b,c)
+	add	r6,r6,r0,ror#2	@ h+=Sigma0(a)
+	@ add	r6,r6,r12			@ h+=Maj(a,b,c)
+#if __ARM_ARCH__>=7
+	@ ldr	r2,[r1],#4			@ 14
+# if 14==15
+	str	r1,[sp,#17*4]			@ make room for r1
+# endif
+	eor	r0,r10,r10,ror#5
+	add	r6,r6,r12			@ h+=Maj(a,b,c) from the past
+	eor	r0,r0,r10,ror#19	@ Sigma1(e)
+# ifndef __ARMEB__
+	rev	r2,r2
+# endif
+#else
+	@ ldrb	r2,[r1,#3]			@ 14
+	add	r6,r6,r12			@ h+=Maj(a,b,c) from the past
+	ldrb	r12,[r1,#2]
+	ldrb	r0,[r1,#1]
+	orr	r2,r2,r12,lsl#8
+	ldrb	r12,[r1],#4
+	orr	r2,r2,r0,lsl#16
+# if 14==15
+	str	r1,[sp,#17*4]			@ make room for r1
+# endif
+	eor	r0,r10,r10,ror#5
+	orr	r2,r2,r12,lsl#24
+	eor	r0,r0,r10,ror#19	@ Sigma1(e)
+#endif
+	ldr	r12,[r14],#4			@ *K256++
+	add	r5,r5,r2			@ h+=X[i]
+	str	r2,[sp,#14*4]
+	eor	r2,r11,r4
+	add	r5,r5,r0,ror#6	@ h+=Sigma1(e)
+	and	r2,r2,r10
+	add	r5,r5,r12			@ h+=K256[i]
+	eor	r2,r2,r4			@ Ch(e,f,g)
+	eor	r0,r6,r6,ror#11
+	add	r5,r5,r2			@ h+=Ch(e,f,g)
+#if 14==31
+	and	r12,r12,#0xff
+	cmp	r12,#0xf2			@ done?
+#endif
+#if 14<15
+# if __ARM_ARCH__>=7
+	ldr	r2,[r1],#4			@ prefetch
+# else
+	ldrb	r2,[r1,#3]
+# endif
+	eor	r12,r6,r7			@ a^b, b^c in next round
+#else
+	ldr	r2,[sp,#0*4]		@ from future BODY_16_xx
+	eor	r12,r6,r7			@ a^b, b^c in next round
+	ldr	r1,[sp,#13*4]	@ from future BODY_16_xx
+#endif
+	eor	r0,r0,r6,ror#20	@ Sigma0(a)
+	and	r3,r3,r12			@ (b^c)&=(a^b)
+	add	r9,r9,r5			@ d+=h
+	eor	r3,r3,r7			@ Maj(a,b,c)
+	add	r5,r5,r0,ror#2	@ h+=Sigma0(a)
+	@ add	r5,r5,r3			@ h+=Maj(a,b,c)
+#if __ARM_ARCH__>=7
+	@ ldr	r2,[r1],#4			@ 15
+# if 15==15
+	str	r1,[sp,#17*4]			@ make room for r1
+# endif
+	eor	r0,r9,r9,ror#5
+	add	r5,r5,r3			@ h+=Maj(a,b,c) from the past
+	eor	r0,r0,r9,ror#19	@ Sigma1(e)
+# ifndef __ARMEB__
+	rev	r2,r2
+# endif
+#else
+	@ ldrb	r2,[r1,#3]			@ 15
+	add	r5,r5,r3			@ h+=Maj(a,b,c) from the past
+	ldrb	r3,[r1,#2]
+	ldrb	r0,[r1,#1]
+	orr	r2,r2,r3,lsl#8
+	ldrb	r3,[r1],#4
+	orr	r2,r2,r0,lsl#16
+# if 15==15
+	str	r1,[sp,#17*4]			@ make room for r1
+# endif
+	eor	r0,r9,r9,ror#5
+	orr	r2,r2,r3,lsl#24
+	eor	r0,r0,r9,ror#19	@ Sigma1(e)
+#endif
+	ldr	r3,[r14],#4			@ *K256++
+	add	r4,r4,r2			@ h+=X[i]
+	str	r2,[sp,#15*4]
+	eor	r2,r10,r11
+	add	r4,r4,r0,ror#6	@ h+=Sigma1(e)
+	and	r2,r2,r9
+	add	r4,r4,r3			@ h+=K256[i]
+	eor	r2,r2,r11			@ Ch(e,f,g)
+	eor	r0,r5,r5,ror#11
+	add	r4,r4,r2			@ h+=Ch(e,f,g)
+#if 15==31
+	and	r3,r3,#0xff
+	cmp	r3,#0xf2			@ done?
+#endif
+#if 15<15
+# if __ARM_ARCH__>=7
+	ldr	r2,[r1],#4			@ prefetch
+# else
+	ldrb	r2,[r1,#3]
+# endif
+	eor	r3,r5,r6			@ a^b, b^c in next round
+#else
+	ldr	r2,[sp,#1*4]		@ from future BODY_16_xx
+	eor	r3,r5,r6			@ a^b, b^c in next round
+	ldr	r1,[sp,#14*4]	@ from future BODY_16_xx
+#endif
+	eor	r0,r0,r5,ror#20	@ Sigma0(a)
+	and	r12,r12,r3			@ (b^c)&=(a^b)
+	add	r8,r8,r4			@ d+=h
+	eor	r12,r12,r6			@ Maj(a,b,c)
+	add	r4,r4,r0,ror#2	@ h+=Sigma0(a)
+	@ add	r4,r4,r12			@ h+=Maj(a,b,c)
+.Lrounds_16_xx:
+	@ ldr	r2,[sp,#1*4]		@ 16
+	@ ldr	r1,[sp,#14*4]
+	mov	r0,r2,ror#7
+	add	r4,r4,r12			@ h+=Maj(a,b,c) from the past
+	mov	r12,r1,ror#17
+	eor	r0,r0,r2,ror#18
+	eor	r12,r12,r1,ror#19
+	eor	r0,r0,r2,lsr#3	@ sigma0(X[i+1])
+	ldr	r2,[sp,#0*4]
+	eor	r12,r12,r1,lsr#10	@ sigma1(X[i+14])
+	ldr	r1,[sp,#9*4]
+
+	add	r12,r12,r0
+	eor	r0,r8,r8,ror#5	@ from BODY_00_15
+	add	r2,r2,r12
+	eor	r0,r0,r8,ror#19	@ Sigma1(e)
+	add	r2,r2,r1			@ X[i]
+	ldr	r12,[r14],#4			@ *K256++
+	add	r11,r11,r2			@ h+=X[i]
+	str	r2,[sp,#0*4]
+	eor	r2,r9,r10
+	add	r11,r11,r0,ror#6	@ h+=Sigma1(e)
+	and	r2,r2,r8
+	add	r11,r11,r12			@ h+=K256[i]
+	eor	r2,r2,r10			@ Ch(e,f,g)
+	eor	r0,r4,r4,ror#11
+	add	r11,r11,r2			@ h+=Ch(e,f,g)
+#if 16==31
+	and	r12,r12,#0xff
+	cmp	r12,#0xf2			@ done?
+#endif
+#if 16<15
+# if __ARM_ARCH__>=7
+	ldr	r2,[r1],#4			@ prefetch
+# else
+	ldrb	r2,[r1,#3]
+# endif
+	eor	r12,r4,r5			@ a^b, b^c in next round
+#else
+	ldr	r2,[sp,#2*4]		@ from future BODY_16_xx
+	eor	r12,r4,r5			@ a^b, b^c in next round
+	ldr	r1,[sp,#15*4]	@ from future BODY_16_xx
+#endif
+	eor	r0,r0,r4,ror#20	@ Sigma0(a)
+	and	r3,r3,r12			@ (b^c)&=(a^b)
+	add	r7,r7,r11			@ d+=h
+	eor	r3,r3,r5			@ Maj(a,b,c)
+	add	r11,r11,r0,ror#2	@ h+=Sigma0(a)
+	@ add	r11,r11,r3			@ h+=Maj(a,b,c)
+	@ ldr	r2,[sp,#2*4]		@ 17
+	@ ldr	r1,[sp,#15*4]
+	mov	r0,r2,ror#7
+	add	r11,r11,r3			@ h+=Maj(a,b,c) from the past
+	mov	r3,r1,ror#17
+	eor	r0,r0,r2,ror#18
+	eor	r3,r3,r1,ror#19
+	eor	r0,r0,r2,lsr#3	@ sigma0(X[i+1])
+	ldr	r2,[sp,#1*4]
+	eor	r3,r3,r1,lsr#10	@ sigma1(X[i+14])
+	ldr	r1,[sp,#10*4]
+
+	add	r3,r3,r0
+	eor	r0,r7,r7,ror#5	@ from BODY_00_15
+	add	r2,r2,r3
+	eor	r0,r0,r7,ror#19	@ Sigma1(e)
+	add	r2,r2,r1			@ X[i]
+	ldr	r3,[r14],#4			@ *K256++
+	add	r10,r10,r2			@ h+=X[i]
+	str	r2,[sp,#1*4]
+	eor	r2,r8,r9
+	add	r10,r10,r0,ror#6	@ h+=Sigma1(e)
+	and	r2,r2,r7
+	add	r10,r10,r3			@ h+=K256[i]
+	eor	r2,r2,r9			@ Ch(e,f,g)
+	eor	r0,r11,r11,ror#11
+	add	r10,r10,r2			@ h+=Ch(e,f,g)
+#if 17==31
+	and	r3,r3,#0xff
+	cmp	r3,#0xf2			@ done?
+#endif
+#if 17<15
+# if __ARM_ARCH__>=7
+	ldr	r2,[r1],#4			@ prefetch
+# else
+	ldrb	r2,[r1,#3]
+# endif
+	eor	r3,r11,r4			@ a^b, b^c in next round
+#else
+	ldr	r2,[sp,#3*4]		@ from future BODY_16_xx
+	eor	r3,r11,r4			@ a^b, b^c in next round
+	ldr	r1,[sp,#0*4]	@ from future BODY_16_xx
+#endif
+	eor	r0,r0,r11,ror#20	@ Sigma0(a)
+	and	r12,r12,r3			@ (b^c)&=(a^b)
+	add	r6,r6,r10			@ d+=h
+	eor	r12,r12,r4			@ Maj(a,b,c)
+	add	r10,r10,r0,ror#2	@ h+=Sigma0(a)
+	@ add	r10,r10,r12			@ h+=Maj(a,b,c)
+	@ ldr	r2,[sp,#3*4]		@ 18
+	@ ldr	r1,[sp,#0*4]
+	mov	r0,r2,ror#7
+	add	r10,r10,r12			@ h+=Maj(a,b,c) from the past
+	mov	r12,r1,ror#17
+	eor	r0,r0,r2,ror#18
+	eor	r12,r12,r1,ror#19
+	eor	r0,r0,r2,lsr#3	@ sigma0(X[i+1])
+	ldr	r2,[sp,#2*4]
+	eor	r12,r12,r1,lsr#10	@ sigma1(X[i+14])
+	ldr	r1,[sp,#11*4]
+
+	add	r12,r12,r0
+	eor	r0,r6,r6,ror#5	@ from BODY_00_15
+	add	r2,r2,r12
+	eor	r0,r0,r6,ror#19	@ Sigma1(e)
+	add	r2,r2,r1			@ X[i]
+	ldr	r12,[r14],#4			@ *K256++
+	add	r9,r9,r2			@ h+=X[i]
+	str	r2,[sp,#2*4]
+	eor	r2,r7,r8
+	add	r9,r9,r0,ror#6	@ h+=Sigma1(e)
+	and	r2,r2,r6
+	add	r9,r9,r12			@ h+=K256[i]
+	eor	r2,r2,r8			@ Ch(e,f,g)
+	eor	r0,r10,r10,ror#11
+	add	r9,r9,r2			@ h+=Ch(e,f,g)
+#if 18==31
+	and	r12,r12,#0xff
+	cmp	r12,#0xf2			@ done?
+#endif
+#if 18<15
+# if __ARM_ARCH__>=7
+	ldr	r2,[r1],#4			@ prefetch
+# else
+	ldrb	r2,[r1,#3]
+# endif
+	eor	r12,r10,r11			@ a^b, b^c in next round
+#else
+	ldr	r2,[sp,#4*4]		@ from future BODY_16_xx
+	eor	r12,r10,r11			@ a^b, b^c in next round
+	ldr	r1,[sp,#1*4]	@ from future BODY_16_xx
+#endif
+	eor	r0,r0,r10,ror#20	@ Sigma0(a)
+	and	r3,r3,r12			@ (b^c)&=(a^b)
+	add	r5,r5,r9			@ d+=h
+	eor	r3,r3,r11			@ Maj(a,b,c)
+	add	r9,r9,r0,ror#2	@ h+=Sigma0(a)
+	@ add	r9,r9,r3			@ h+=Maj(a,b,c)
+	@ ldr	r2,[sp,#4*4]		@ 19
+	@ ldr	r1,[sp,#1*4]
+	mov	r0,r2,ror#7
+	add	r9,r9,r3			@ h+=Maj(a,b,c) from the past
+	mov	r3,r1,ror#17
+	eor	r0,r0,r2,ror#18
+	eor	r3,r3,r1,ror#19
+	eor	r0,r0,r2,lsr#3	@ sigma0(X[i+1])
+	ldr	r2,[sp,#3*4]
+	eor	r3,r3,r1,lsr#10	@ sigma1(X[i+14])
+	ldr	r1,[sp,#12*4]
+
+	add	r3,r3,r0
+	eor	r0,r5,r5,ror#5	@ from BODY_00_15
+	add	r2,r2,r3
+	eor	r0,r0,r5,ror#19	@ Sigma1(e)
+	add	r2,r2,r1			@ X[i]
+	ldr	r3,[r14],#4			@ *K256++
+	add	r8,r8,r2			@ h+=X[i]
+	str	r2,[sp,#3*4]
+	eor	r2,r6,r7
+	add	r8,r8,r0,ror#6	@ h+=Sigma1(e)
+	and	r2,r2,r5
+	add	r8,r8,r3			@ h+=K256[i]
+	eor	r2,r2,r7			@ Ch(e,f,g)
+	eor	r0,r9,r9,ror#11
+	add	r8,r8,r2			@ h+=Ch(e,f,g)
+#if 19==31
+	and	r3,r3,#0xff
+	cmp	r3,#0xf2			@ done?
+#endif
+#if 19<15
+# if __ARM_ARCH__>=7
+	ldr	r2,[r1],#4			@ prefetch
+# else
+	ldrb	r2,[r1,#3]
+# endif
+	eor	r3,r9,r10			@ a^b, b^c in next round
+#else
+	ldr	r2,[sp,#5*4]		@ from future BODY_16_xx
+	eor	r3,r9,r10			@ a^b, b^c in next round
+	ldr	r1,[sp,#2*4]	@ from future BODY_16_xx
+#endif
+	eor	r0,r0,r9,ror#20	@ Sigma0(a)
+	and	r12,r12,r3			@ (b^c)&=(a^b)
+	add	r4,r4,r8			@ d+=h
+	eor	r12,r12,r10			@ Maj(a,b,c)
+	add	r8,r8,r0,ror#2	@ h+=Sigma0(a)
+	@ add	r8,r8,r12			@ h+=Maj(a,b,c)
+	@ ldr	r2,[sp,#5*4]		@ 20
+	@ ldr	r1,[sp,#2*4]
+	mov	r0,r2,ror#7
+	add	r8,r8,r12			@ h+=Maj(a,b,c) from the past
+	mov	r12,r1,ror#17
+	eor	r0,r0,r2,ror#18
+	eor	r12,r12,r1,ror#19
+	eor	r0,r0,r2,lsr#3	@ sigma0(X[i+1])
+	ldr	r2,[sp,#4*4]
+	eor	r12,r12,r1,lsr#10	@ sigma1(X[i+14])
+	ldr	r1,[sp,#13*4]
+
+	add	r12,r12,r0
+	eor	r0,r4,r4,ror#5	@ from BODY_00_15
+	add	r2,r2,r12
+	eor	r0,r0,r4,ror#19	@ Sigma1(e)
+	add	r2,r2,r1			@ X[i]
+	ldr	r12,[r14],#4			@ *K256++
+	add	r7,r7,r2			@ h+=X[i]
+	str	r2,[sp,#4*4]
+	eor	r2,r5,r6
+	add	r7,r7,r0,ror#6	@ h+=Sigma1(e)
+	and	r2,r2,r4
+	add	r7,r7,r12			@ h+=K256[i]
+	eor	r2,r2,r6			@ Ch(e,f,g)
+	eor	r0,r8,r8,ror#11
+	add	r7,r7,r2			@ h+=Ch(e,f,g)
+#if 20==31
+	and	r12,r12,#0xff
+	cmp	r12,#0xf2			@ done?
+#endif
+#if 20<15
+# if __ARM_ARCH__>=7
+	ldr	r2,[r1],#4			@ prefetch
+# else
+	ldrb	r2,[r1,#3]
+# endif
+	eor	r12,r8,r9			@ a^b, b^c in next round
+#else
+	ldr	r2,[sp,#6*4]		@ from future BODY_16_xx
+	eor	r12,r8,r9			@ a^b, b^c in next round
+	ldr	r1,[sp,#3*4]	@ from future BODY_16_xx
+#endif
+	eor	r0,r0,r8,ror#20	@ Sigma0(a)
+	and	r3,r3,r12			@ (b^c)&=(a^b)
+	add	r11,r11,r7			@ d+=h
+	eor	r3,r3,r9			@ Maj(a,b,c)
+	add	r7,r7,r0,ror#2	@ h+=Sigma0(a)
+	@ add	r7,r7,r3			@ h+=Maj(a,b,c)
+	@ ldr	r2,[sp,#6*4]		@ 21
+	@ ldr	r1,[sp,#3*4]
+	mov	r0,r2,ror#7
+	add	r7,r7,r3			@ h+=Maj(a,b,c) from the past
+	mov	r3,r1,ror#17
+	eor	r0,r0,r2,ror#18
+	eor	r3,r3,r1,ror#19
+	eor	r0,r0,r2,lsr#3	@ sigma0(X[i+1])
+	ldr	r2,[sp,#5*4]
+	eor	r3,r3,r1,lsr#10	@ sigma1(X[i+14])
+	ldr	r1,[sp,#14*4]
+
+	add	r3,r3,r0
+	eor	r0,r11,r11,ror#5	@ from BODY_00_15
+	add	r2,r2,r3
+	eor	r0,r0,r11,ror#19	@ Sigma1(e)
+	add	r2,r2,r1			@ X[i]
+	ldr	r3,[r14],#4			@ *K256++
+	add	r6,r6,r2			@ h+=X[i]
+	str	r2,[sp,#5*4]
+	eor	r2,r4,r5
+	add	r6,r6,r0,ror#6	@ h+=Sigma1(e)
+	and	r2,r2,r11
+	add	r6,r6,r3			@ h+=K256[i]
+	eor	r2,r2,r5			@ Ch(e,f,g)
+	eor	r0,r7,r7,ror#11
+	add	r6,r6,r2			@ h+=Ch(e,f,g)
+#if 21==31
+	and	r3,r3,#0xff
+	cmp	r3,#0xf2			@ done?
+#endif
+#if 21<15
+# if __ARM_ARCH__>=7
+	ldr	r2,[r1],#4			@ prefetch
+# else
+	ldrb	r2,[r1,#3]
+# endif
+	eor	r3,r7,r8			@ a^b, b^c in next round
+#else
+	ldr	r2,[sp,#7*4]		@ from future BODY_16_xx
+	eor	r3,r7,r8			@ a^b, b^c in next round
+	ldr	r1,[sp,#4*4]	@ from future BODY_16_xx
+#endif
+	eor	r0,r0,r7,ror#20	@ Sigma0(a)
+	and	r12,r12,r3			@ (b^c)&=(a^b)
+	add	r10,r10,r6			@ d+=h
+	eor	r12,r12,r8			@ Maj(a,b,c)
+	add	r6,r6,r0,ror#2	@ h+=Sigma0(a)
+	@ add	r6,r6,r12			@ h+=Maj(a,b,c)
+	@ ldr	r2,[sp,#7*4]		@ 22
+	@ ldr	r1,[sp,#4*4]
+	mov	r0,r2,ror#7
+	add	r6,r6,r12			@ h+=Maj(a,b,c) from the past
+	mov	r12,r1,ror#17
+	eor	r0,r0,r2,ror#18
+	eor	r12,r12,r1,ror#19
+	eor	r0,r0,r2,lsr#3	@ sigma0(X[i+1])
+	ldr	r2,[sp,#6*4]
+	eor	r12,r12,r1,lsr#10	@ sigma1(X[i+14])
+	ldr	r1,[sp,#15*4]
+
+	add	r12,r12,r0
+	eor	r0,r10,r10,ror#5	@ from BODY_00_15
+	add	r2,r2,r12
+	eor	r0,r0,r10,ror#19	@ Sigma1(e)
+	add	r2,r2,r1			@ X[i]
+	ldr	r12,[r14],#4			@ *K256++
+	add	r5,r5,r2			@ h+=X[i]
+	str	r2,[sp,#6*4]
+	eor	r2,r11,r4
+	add	r5,r5,r0,ror#6	@ h+=Sigma1(e)
+	and	r2,r2,r10
+	add	r5,r5,r12			@ h+=K256[i]
+	eor	r2,r2,r4			@ Ch(e,f,g)
+	eor	r0,r6,r6,ror#11
+	add	r5,r5,r2			@ h+=Ch(e,f,g)
+#if 22==31
+	and	r12,r12,#0xff
+	cmp	r12,#0xf2			@ done?
+#endif
+#if 22<15
+# if __ARM_ARCH__>=7
+	ldr	r2,[r1],#4			@ prefetch
+# else
+	ldrb	r2,[r1,#3]
+# endif
+	eor	r12,r6,r7			@ a^b, b^c in next round
+#else
+	ldr	r2,[sp,#8*4]		@ from future BODY_16_xx
+	eor	r12,r6,r7			@ a^b, b^c in next round
+	ldr	r1,[sp,#5*4]	@ from future BODY_16_xx
+#endif
+	eor	r0,r0,r6,ror#20	@ Sigma0(a)
+	and	r3,r3,r12			@ (b^c)&=(a^b)
+	add	r9,r9,r5			@ d+=h
+	eor	r3,r3,r7			@ Maj(a,b,c)
+	add	r5,r5,r0,ror#2	@ h+=Sigma0(a)
+	@ add	r5,r5,r3			@ h+=Maj(a,b,c)
+	@ ldr	r2,[sp,#8*4]		@ 23
+	@ ldr	r1,[sp,#5*4]
+	mov	r0,r2,ror#7
+	add	r5,r5,r3			@ h+=Maj(a,b,c) from the past
+	mov	r3,r1,ror#17
+	eor	r0,r0,r2,ror#18
+	eor	r3,r3,r1,ror#19
+	eor	r0,r0,r2,lsr#3	@ sigma0(X[i+1])
+	ldr	r2,[sp,#7*4]
+	eor	r3,r3,r1,lsr#10	@ sigma1(X[i+14])
+	ldr	r1,[sp,#0*4]
+
+	add	r3,r3,r0
+	eor	r0,r9,r9,ror#5	@ from BODY_00_15
+	add	r2,r2,r3
+	eor	r0,r0,r9,ror#19	@ Sigma1(e)
+	add	r2,r2,r1			@ X[i]
+	ldr	r3,[r14],#4			@ *K256++
+	add	r4,r4,r2			@ h+=X[i]
+	str	r2,[sp,#7*4]
+	eor	r2,r10,r11
+	add	r4,r4,r0,ror#6	@ h+=Sigma1(e)
+	and	r2,r2,r9
+	add	r4,r4,r3			@ h+=K256[i]
+	eor	r2,r2,r11			@ Ch(e,f,g)
+	eor	r0,r5,r5,ror#11
+	add	r4,r4,r2			@ h+=Ch(e,f,g)
+#if 23==31
+	and	r3,r3,#0xff
+	cmp	r3,#0xf2			@ done?
+#endif
+#if 23<15
+# if __ARM_ARCH__>=7
+	ldr	r2,[r1],#4			@ prefetch
+# else
+	ldrb	r2,[r1,#3]
+# endif
+	eor	r3,r5,r6			@ a^b, b^c in next round
+#else
+	ldr	r2,[sp,#9*4]		@ from future BODY_16_xx
+	eor	r3,r5,r6			@ a^b, b^c in next round
+	ldr	r1,[sp,#6*4]	@ from future BODY_16_xx
+#endif
+	eor	r0,r0,r5,ror#20	@ Sigma0(a)
+	and	r12,r12,r3			@ (b^c)&=(a^b)
+	add	r8,r8,r4			@ d+=h
+	eor	r12,r12,r6			@ Maj(a,b,c)
+	add	r4,r4,r0,ror#2	@ h+=Sigma0(a)
+	@ add	r4,r4,r12			@ h+=Maj(a,b,c)
+	@ ldr	r2,[sp,#9*4]		@ 24
+	@ ldr	r1,[sp,#6*4]
+	mov	r0,r2,ror#7
+	add	r4,r4,r12			@ h+=Maj(a,b,c) from the past
+	mov	r12,r1,ror#17
+	eor	r0,r0,r2,ror#18
+	eor	r12,r12,r1,ror#19
+	eor	r0,r0,r2,lsr#3	@ sigma0(X[i+1])
+	ldr	r2,[sp,#8*4]
+	eor	r12,r12,r1,lsr#10	@ sigma1(X[i+14])
+	ldr	r1,[sp,#1*4]
+
+	add	r12,r12,r0
+	eor	r0,r8,r8,ror#5	@ from BODY_00_15
+	add	r2,r2,r12
+	eor	r0,r0,r8,ror#19	@ Sigma1(e)
+	add	r2,r2,r1			@ X[i]
+	ldr	r12,[r14],#4			@ *K256++
+	add	r11,r11,r2			@ h+=X[i]
+	str	r2,[sp,#8*4]
+	eor	r2,r9,r10
+	add	r11,r11,r0,ror#6	@ h+=Sigma1(e)
+	and	r2,r2,r8
+	add	r11,r11,r12			@ h+=K256[i]
+	eor	r2,r2,r10			@ Ch(e,f,g)
+	eor	r0,r4,r4,ror#11
+	add	r11,r11,r2			@ h+=Ch(e,f,g)
+#if 24==31
+	and	r12,r12,#0xff
+	cmp	r12,#0xf2			@ done?
+#endif
+#if 24<15
+# if __ARM_ARCH__>=7
+	ldr	r2,[r1],#4			@ prefetch
+# else
+	ldrb	r2,[r1,#3]
+# endif
+	eor	r12,r4,r5			@ a^b, b^c in next round
+#else
+	ldr	r2,[sp,#10*4]		@ from future BODY_16_xx
+	eor	r12,r4,r5			@ a^b, b^c in next round
+	ldr	r1,[sp,#7*4]	@ from future BODY_16_xx
+#endif
+	eor	r0,r0,r4,ror#20	@ Sigma0(a)
+	and	r3,r3,r12			@ (b^c)&=(a^b)
+	add	r7,r7,r11			@ d+=h
+	eor	r3,r3,r5			@ Maj(a,b,c)
+	add	r11,r11,r0,ror#2	@ h+=Sigma0(a)
+	@ add	r11,r11,r3			@ h+=Maj(a,b,c)
+	@ ldr	r2,[sp,#10*4]		@ 25
+	@ ldr	r1,[sp,#7*4]
+	mov	r0,r2,ror#7
+	add	r11,r11,r3			@ h+=Maj(a,b,c) from the past
+	mov	r3,r1,ror#17
+	eor	r0,r0,r2,ror#18
+	eor	r3,r3,r1,ror#19
+	eor	r0,r0,r2,lsr#3	@ sigma0(X[i+1])
+	ldr	r2,[sp,#9*4]
+	eor	r3,r3,r1,lsr#10	@ sigma1(X[i+14])
+	ldr	r1,[sp,#2*4]
+
+	add	r3,r3,r0
+	eor	r0,r7,r7,ror#5	@ from BODY_00_15
+	add	r2,r2,r3
+	eor	r0,r0,r7,ror#19	@ Sigma1(e)
+	add	r2,r2,r1			@ X[i]
+	ldr	r3,[r14],#4			@ *K256++
+	add	r10,r10,r2			@ h+=X[i]
+	str	r2,[sp,#9*4]
+	eor	r2,r8,r9
+	add	r10,r10,r0,ror#6	@ h+=Sigma1(e)
+	and	r2,r2,r7
+	add	r10,r10,r3			@ h+=K256[i]
+	eor	r2,r2,r9			@ Ch(e,f,g)
+	eor	r0,r11,r11,ror#11
+	add	r10,r10,r2			@ h+=Ch(e,f,g)
+#if 25==31
+	and	r3,r3,#0xff
+	cmp	r3,#0xf2			@ done?
+#endif
+#if 25<15
+# if __ARM_ARCH__>=7
+	ldr	r2,[r1],#4			@ prefetch
+# else
+	ldrb	r2,[r1,#3]
+# endif
+	eor	r3,r11,r4			@ a^b, b^c in next round
+#else
+	ldr	r2,[sp,#11*4]		@ from future BODY_16_xx
+	eor	r3,r11,r4			@ a^b, b^c in next round
+	ldr	r1,[sp,#8*4]	@ from future BODY_16_xx
+#endif
+	eor	r0,r0,r11,ror#20	@ Sigma0(a)
+	and	r12,r12,r3			@ (b^c)&=(a^b)
+	add	r6,r6,r10			@ d+=h
+	eor	r12,r12,r4			@ Maj(a,b,c)
+	add	r10,r10,r0,ror#2	@ h+=Sigma0(a)
+	@ add	r10,r10,r12			@ h+=Maj(a,b,c)
+	@ ldr	r2,[sp,#11*4]		@ 26
+	@ ldr	r1,[sp,#8*4]
+	mov	r0,r2,ror#7
+	add	r10,r10,r12			@ h+=Maj(a,b,c) from the past
+	mov	r12,r1,ror#17
+	eor	r0,r0,r2,ror#18
+	eor	r12,r12,r1,ror#19
+	eor	r0,r0,r2,lsr#3	@ sigma0(X[i+1])
+	ldr	r2,[sp,#10*4]
+	eor	r12,r12,r1,lsr#10	@ sigma1(X[i+14])
+	ldr	r1,[sp,#3*4]
+
+	add	r12,r12,r0
+	eor	r0,r6,r6,ror#5	@ from BODY_00_15
+	add	r2,r2,r12
+	eor	r0,r0,r6,ror#19	@ Sigma1(e)
+	add	r2,r2,r1			@ X[i]
+	ldr	r12,[r14],#4			@ *K256++
+	add	r9,r9,r2			@ h+=X[i]
+	str	r2,[sp,#10*4]
+	eor	r2,r7,r8
+	add	r9,r9,r0,ror#6	@ h+=Sigma1(e)
+	and	r2,r2,r6
+	add	r9,r9,r12			@ h+=K256[i]
+	eor	r2,r2,r8			@ Ch(e,f,g)
+	eor	r0,r10,r10,ror#11
+	add	r9,r9,r2			@ h+=Ch(e,f,g)
+#if 26==31
+	and	r12,r12,#0xff
+	cmp	r12,#0xf2			@ done?
+#endif
+#if 26<15
+# if __ARM_ARCH__>=7
+	ldr	r2,[r1],#4			@ prefetch
+# else
+	ldrb	r2,[r1,#3]
+# endif
+	eor	r12,r10,r11			@ a^b, b^c in next round
+#else
+	ldr	r2,[sp,#12*4]		@ from future BODY_16_xx
+	eor	r12,r10,r11			@ a^b, b^c in next round
+	ldr	r1,[sp,#9*4]	@ from future BODY_16_xx
+#endif
+	eor	r0,r0,r10,ror#20	@ Sigma0(a)
+	and	r3,r3,r12			@ (b^c)&=(a^b)
+	add	r5,r5,r9			@ d+=h
+	eor	r3,r3,r11			@ Maj(a,b,c)
+	add	r9,r9,r0,ror#2	@ h+=Sigma0(a)
+	@ add	r9,r9,r3			@ h+=Maj(a,b,c)
+	@ ldr	r2,[sp,#12*4]		@ 27
+	@ ldr	r1,[sp,#9*4]
+	mov	r0,r2,ror#7
+	add	r9,r9,r3			@ h+=Maj(a,b,c) from the past
+	mov	r3,r1,ror#17
+	eor	r0,r0,r2,ror#18
+	eor	r3,r3,r1,ror#19
+	eor	r0,r0,r2,lsr#3	@ sigma0(X[i+1])
+	ldr	r2,[sp,#11*4]
+	eor	r3,r3,r1,lsr#10	@ sigma1(X[i+14])
+	ldr	r1,[sp,#4*4]
+
+	add	r3,r3,r0
+	eor	r0,r5,r5,ror#5	@ from BODY_00_15
+	add	r2,r2,r3
+	eor	r0,r0,r5,ror#19	@ Sigma1(e)
+	add	r2,r2,r1			@ X[i]
+	ldr	r3,[r14],#4			@ *K256++
+	add	r8,r8,r2			@ h+=X[i]
+	str	r2,[sp,#11*4]
+	eor	r2,r6,r7
+	add	r8,r8,r0,ror#6	@ h+=Sigma1(e)
+	and	r2,r2,r5
+	add	r8,r8,r3			@ h+=K256[i]
+	eor	r2,r2,r7			@ Ch(e,f,g)
+	eor	r0,r9,r9,ror#11
+	add	r8,r8,r2			@ h+=Ch(e,f,g)
+#if 27==31
+	and	r3,r3,#0xff
+	cmp	r3,#0xf2			@ done?
+#endif
+#if 27<15
+# if __ARM_ARCH__>=7
+	ldr	r2,[r1],#4			@ prefetch
+# else
+	ldrb	r2,[r1,#3]
+# endif
+	eor	r3,r9,r10			@ a^b, b^c in next round
+#else
+	ldr	r2,[sp,#13*4]		@ from future BODY_16_xx
+	eor	r3,r9,r10			@ a^b, b^c in next round
+	ldr	r1,[sp,#10*4]	@ from future BODY_16_xx
+#endif
+	eor	r0,r0,r9,ror#20	@ Sigma0(a)
+	and	r12,r12,r3			@ (b^c)&=(a^b)
+	add	r4,r4,r8			@ d+=h
+	eor	r12,r12,r10			@ Maj(a,b,c)
+	add	r8,r8,r0,ror#2	@ h+=Sigma0(a)
+	@ add	r8,r8,r12			@ h+=Maj(a,b,c)
+	@ ldr	r2,[sp,#13*4]		@ 28
+	@ ldr	r1,[sp,#10*4]
+	mov	r0,r2,ror#7
+	add	r8,r8,r12			@ h+=Maj(a,b,c) from the past
+	mov	r12,r1,ror#17
+	eor	r0,r0,r2,ror#18
+	eor	r12,r12,r1,ror#19
+	eor	r0,r0,r2,lsr#3	@ sigma0(X[i+1])
+	ldr	r2,[sp,#12*4]
+	eor	r12,r12,r1,lsr#10	@ sigma1(X[i+14])
+	ldr	r1,[sp,#5*4]
+
+	add	r12,r12,r0
+	eor	r0,r4,r4,ror#5	@ from BODY_00_15
+	add	r2,r2,r12
+	eor	r0,r0,r4,ror#19	@ Sigma1(e)
+	add	r2,r2,r1			@ X[i]
+	ldr	r12,[r14],#4			@ *K256++
+	add	r7,r7,r2			@ h+=X[i]
+	str	r2,[sp,#12*4]
+	eor	r2,r5,r6
+	add	r7,r7,r0,ror#6	@ h+=Sigma1(e)
+	and	r2,r2,r4
+	add	r7,r7,r12			@ h+=K256[i]
+	eor	r2,r2,r6			@ Ch(e,f,g)
+	eor	r0,r8,r8,ror#11
+	add	r7,r7,r2			@ h+=Ch(e,f,g)
+#if 28==31
+	and	r12,r12,#0xff
+	cmp	r12,#0xf2			@ done?
+#endif
+#if 28<15
+# if __ARM_ARCH__>=7
+	ldr	r2,[r1],#4			@ prefetch
+# else
+	ldrb	r2,[r1,#3]
+# endif
+	eor	r12,r8,r9			@ a^b, b^c in next round
+#else
+	ldr	r2,[sp,#14*4]		@ from future BODY_16_xx
+	eor	r12,r8,r9			@ a^b, b^c in next round
+	ldr	r1,[sp,#11*4]	@ from future BODY_16_xx
+#endif
+	eor	r0,r0,r8,ror#20	@ Sigma0(a)
+	and	r3,r3,r12			@ (b^c)&=(a^b)
+	add	r11,r11,r7			@ d+=h
+	eor	r3,r3,r9			@ Maj(a,b,c)
+	add	r7,r7,r0,ror#2	@ h+=Sigma0(a)
+	@ add	r7,r7,r3			@ h+=Maj(a,b,c)
+	@ ldr	r2,[sp,#14*4]		@ 29
+	@ ldr	r1,[sp,#11*4]
+	mov	r0,r2,ror#7
+	add	r7,r7,r3			@ h+=Maj(a,b,c) from the past
+	mov	r3,r1,ror#17
+	eor	r0,r0,r2,ror#18
+	eor	r3,r3,r1,ror#19
+	eor	r0,r0,r2,lsr#3	@ sigma0(X[i+1])
+	ldr	r2,[sp,#13*4]
+	eor	r3,r3,r1,lsr#10	@ sigma1(X[i+14])
+	ldr	r1,[sp,#6*4]
+
+	add	r3,r3,r0
+	eor	r0,r11,r11,ror#5	@ from BODY_00_15
+	add	r2,r2,r3
+	eor	r0,r0,r11,ror#19	@ Sigma1(e)
+	add	r2,r2,r1			@ X[i]
+	ldr	r3,[r14],#4			@ *K256++
+	add	r6,r6,r2			@ h+=X[i]
+	str	r2,[sp,#13*4]
+	eor	r2,r4,r5
+	add	r6,r6,r0,ror#6	@ h+=Sigma1(e)
+	and	r2,r2,r11
+	add	r6,r6,r3			@ h+=K256[i]
+	eor	r2,r2,r5			@ Ch(e,f,g)
+	eor	r0,r7,r7,ror#11
+	add	r6,r6,r2			@ h+=Ch(e,f,g)
+#if 29==31
+	and	r3,r3,#0xff
+	cmp	r3,#0xf2			@ done?
+#endif
+#if 29<15
+# if __ARM_ARCH__>=7
+	ldr	r2,[r1],#4			@ prefetch
+# else
+	ldrb	r2,[r1,#3]
+# endif
+	eor	r3,r7,r8			@ a^b, b^c in next round
+#else
+	ldr	r2,[sp,#15*4]		@ from future BODY_16_xx
+	eor	r3,r7,r8			@ a^b, b^c in next round
+	ldr	r1,[sp,#12*4]	@ from future BODY_16_xx
+#endif
+	eor	r0,r0,r7,ror#20	@ Sigma0(a)
+	and	r12,r12,r3			@ (b^c)&=(a^b)
+	add	r10,r10,r6			@ d+=h
+	eor	r12,r12,r8			@ Maj(a,b,c)
+	add	r6,r6,r0,ror#2	@ h+=Sigma0(a)
+	@ add	r6,r6,r12			@ h+=Maj(a,b,c)
+	@ ldr	r2,[sp,#15*4]		@ 30
+	@ ldr	r1,[sp,#12*4]
+	mov	r0,r2,ror#7
+	add	r6,r6,r12			@ h+=Maj(a,b,c) from the past
+	mov	r12,r1,ror#17
+	eor	r0,r0,r2,ror#18
+	eor	r12,r12,r1,ror#19
+	eor	r0,r0,r2,lsr#3	@ sigma0(X[i+1])
+	ldr	r2,[sp,#14*4]
+	eor	r12,r12,r1,lsr#10	@ sigma1(X[i+14])
+	ldr	r1,[sp,#7*4]
+
+	add	r12,r12,r0
+	eor	r0,r10,r10,ror#5	@ from BODY_00_15
+	add	r2,r2,r12
+	eor	r0,r0,r10,ror#19	@ Sigma1(e)
+	add	r2,r2,r1			@ X[i]
+	ldr	r12,[r14],#4			@ *K256++
+	add	r5,r5,r2			@ h+=X[i]
+	str	r2,[sp,#14*4]
+	eor	r2,r11,r4
+	add	r5,r5,r0,ror#6	@ h+=Sigma1(e)
+	and	r2,r2,r10
+	add	r5,r5,r12			@ h+=K256[i]
+	eor	r2,r2,r4			@ Ch(e,f,g)
+	eor	r0,r6,r6,ror#11
+	add	r5,r5,r2			@ h+=Ch(e,f,g)
+#if 30==31
+	and	r12,r12,#0xff
+	cmp	r12,#0xf2			@ done?
+#endif
+#if 30<15
+# if __ARM_ARCH__>=7
+	ldr	r2,[r1],#4			@ prefetch
+# else
+	ldrb	r2,[r1,#3]
+# endif
+	eor	r12,r6,r7			@ a^b, b^c in next round
+#else
+	ldr	r2,[sp,#0*4]		@ from future BODY_16_xx
+	eor	r12,r6,r7			@ a^b, b^c in next round
+	ldr	r1,[sp,#13*4]	@ from future BODY_16_xx
+#endif
+	eor	r0,r0,r6,ror#20	@ Sigma0(a)
+	and	r3,r3,r12			@ (b^c)&=(a^b)
+	add	r9,r9,r5			@ d+=h
+	eor	r3,r3,r7			@ Maj(a,b,c)
+	add	r5,r5,r0,ror#2	@ h+=Sigma0(a)
+	@ add	r5,r5,r3			@ h+=Maj(a,b,c)
+	@ ldr	r2,[sp,#0*4]		@ 31
+	@ ldr	r1,[sp,#13*4]
+	mov	r0,r2,ror#7
+	add	r5,r5,r3			@ h+=Maj(a,b,c) from the past
+	mov	r3,r1,ror#17
+	eor	r0,r0,r2,ror#18
+	eor	r3,r3,r1,ror#19
+	eor	r0,r0,r2,lsr#3	@ sigma0(X[i+1])
+	ldr	r2,[sp,#15*4]
+	eor	r3,r3,r1,lsr#10	@ sigma1(X[i+14])
+	ldr	r1,[sp,#8*4]
+
+	add	r3,r3,r0
+	eor	r0,r9,r9,ror#5	@ from BODY_00_15
+	add	r2,r2,r3
+	eor	r0,r0,r9,ror#19	@ Sigma1(e)
+	add	r2,r2,r1			@ X[i]
+	ldr	r3,[r14],#4			@ *K256++
+	add	r4,r4,r2			@ h+=X[i]
+	str	r2,[sp,#15*4]
+	eor	r2,r10,r11
+	add	r4,r4,r0,ror#6	@ h+=Sigma1(e)
+	and	r2,r2,r9
+	add	r4,r4,r3			@ h+=K256[i]
+	eor	r2,r2,r11			@ Ch(e,f,g)
+	eor	r0,r5,r5,ror#11
+	add	r4,r4,r2			@ h+=Ch(e,f,g)
+#if 31==31
+	and	r3,r3,#0xff
+	cmp	r3,#0xf2			@ done?
+#endif
+#if 31<15
+# if __ARM_ARCH__>=7
+	ldr	r2,[r1],#4			@ prefetch
+# else
+	ldrb	r2,[r1,#3]
+# endif
+	eor	r3,r5,r6			@ a^b, b^c in next round
+#else
+	ldr	r2,[sp,#1*4]		@ from future BODY_16_xx
+	eor	r3,r5,r6			@ a^b, b^c in next round
+	ldr	r1,[sp,#14*4]	@ from future BODY_16_xx
+#endif
+	eor	r0,r0,r5,ror#20	@ Sigma0(a)
+	and	r12,r12,r3			@ (b^c)&=(a^b)
+	add	r8,r8,r4			@ d+=h
+	eor	r12,r12,r6			@ Maj(a,b,c)
+	add	r4,r4,r0,ror#2	@ h+=Sigma0(a)
+	@ add	r4,r4,r12			@ h+=Maj(a,b,c)
+#if __ARM_ARCH__>=7
+	ite	eq			@ Thumb2 thing, sanity check in ARM
+#endif
+	ldreq	r3,[sp,#16*4]		@ pull ctx
+	bne	.Lrounds_16_xx
+
+	add	r4,r4,r12		@ h+=Maj(a,b,c) from the past
+	ldr	r0,[r3,#0]
+	ldr	r2,[r3,#4]
+	ldr	r12,[r3,#8]
+	add	r4,r4,r0
+	ldr	r0,[r3,#12]
+	add	r5,r5,r2
+	ldr	r2,[r3,#16]
+	add	r6,r6,r12
+	ldr	r12,[r3,#20]
+	add	r7,r7,r0
+	ldr	r0,[r3,#24]
+	add	r8,r8,r2
+	ldr	r2,[r3,#28]
+	add	r9,r9,r12
+	ldr	r1,[sp,#17*4]		@ pull inp
+	ldr	r12,[sp,#18*4]		@ pull inp+len
+	add	r10,r10,r0
+	add	r11,r11,r2
+	stmia	r3,{r4,r5,r6,r7,r8,r9,r10,r11}
+	cmp	r1,r12
+	sub	r14,r14,#256	@ rewind Ktbl
+	bne	.Loop
+
+	add	sp,sp,#19*4	@ destroy frame
+#if __ARM_ARCH__>=5
+	ldmia	sp!,{r4,r5,r6,r7,r8,r9,r10,r11,pc}
+#else
+	ldmia	sp!,{r4,r5,r6,r7,r8,r9,r10,r11,lr}
+	tst	lr,#1
+	moveq	pc,lr			@ be binary compatible with V4, yet
+.word	0xe12fff1e			@ interoperable with Thumb ISA:-)
+#endif
+.size	sha256_block_data_order,.-sha256_block_data_order
+#if __ARM_MAX_ARCH__>=7
+.arch	armv7-a
+.fpu	neon
+
+.globl	sha256_block_data_order_neon
+.type	sha256_block_data_order_neon,%function
+.align	4
+sha256_block_data_order_neon:
+.LNEON:
+	stmdb	sp!,{r4,r5,r6,r7,r8,r9,r10,r11,r12,lr}
+
+	sub	r11,sp,#16*4+16
+	adrl	r14,K256
+	bic	r11,r11,#15		@ align for 128-bit stores
+	mov	r12,sp
+	mov	sp,r11			@ alloca
+	add	r2,r1,r2,lsl#6	@ len to point at the end of inp
+
+	vld1.8	{q0},[r1]!
+	vld1.8	{q1},[r1]!
+	vld1.8	{q2},[r1]!
+	vld1.8	{q3},[r1]!
+	vld1.32	{q8},[r14,:128]!
+	vld1.32	{q9},[r14,:128]!
+	vld1.32	{q10},[r14,:128]!
+	vld1.32	{q11},[r14,:128]!
+	vrev32.8	q0,q0		@ yes, even on
+	str	r0,[sp,#64]
+	vrev32.8	q1,q1		@ big-endian
+	str	r1,[sp,#68]
+	mov	r1,sp
+	vrev32.8	q2,q2
+	str	r2,[sp,#72]
+	vrev32.8	q3,q3
+	str	r12,[sp,#76]		@ save original sp
+	vadd.i32	q8,q8,q0
+	vadd.i32	q9,q9,q1
+	vst1.32	{q8},[r1,:128]!
+	vadd.i32	q10,q10,q2
+	vst1.32	{q9},[r1,:128]!
+	vadd.i32	q11,q11,q3
+	vst1.32	{q10},[r1,:128]!
+	vst1.32	{q11},[r1,:128]!
+
+	ldmia	r0,{r4,r5,r6,r7,r8,r9,r10,r11}
+	sub	r1,r1,#64
+	ldr	r2,[sp,#0]
+	eor	r12,r12,r12
+	eor	r3,r5,r6
+	b	.L_00_48
+
+.align	4
+.L_00_48:
+	vext.8	q8,q0,q1,#4
+	add	r11,r11,r2
+	eor	r2,r9,r10
+	eor	r0,r8,r8,ror#5
+	vext.8	q9,q2,q3,#4
+	add	r4,r4,r12
+	and	r2,r2,r8
+	eor	r12,r0,r8,ror#19
+	vshr.u32	q10,q8,#7
+	eor	r0,r4,r4,ror#11
+	eor	r2,r2,r10
+	vadd.i32	q0,q0,q9
+	add	r11,r11,r12,ror#6
+	eor	r12,r4,r5
+	vshr.u32	q9,q8,#3
+	eor	r0,r0,r4,ror#20
+	add	r11,r11,r2
+	vsli.32	q10,q8,#25
+	ldr	r2,[sp,#4]
+	and	r3,r3,r12
+	vshr.u32	q11,q8,#18
+	add	r7,r7,r11
+	add	r11,r11,r0,ror#2
+	eor	r3,r3,r5
+	veor	q9,q9,q10
+	add	r10,r10,r2
+	vsli.32	q11,q8,#14
+	eor	r2,r8,r9
+	eor	r0,r7,r7,ror#5
+	vshr.u32	d24,d7,#17
+	add	r11,r11,r3
+	and	r2,r2,r7
+	veor	q9,q9,q11
+	eor	r3,r0,r7,ror#19
+	eor	r0,r11,r11,ror#11
+	vsli.32	d24,d7,#15
+	eor	r2,r2,r9
+	add	r10,r10,r3,ror#6
+	vshr.u32	d25,d7,#10
+	eor	r3,r11,r4
+	eor	r0,r0,r11,ror#20
+	vadd.i32	q0,q0,q9
+	add	r10,r10,r2
+	ldr	r2,[sp,#8]
+	veor	d25,d25,d24
+	and	r12,r12,r3
+	add	r6,r6,r10
+	vshr.u32	d24,d7,#19
+	add	r10,r10,r0,ror#2
+	eor	r12,r12,r4
+	vsli.32	d24,d7,#13
+	add	r9,r9,r2
+	eor	r2,r7,r8
+	veor	d25,d25,d24
+	eor	r0,r6,r6,ror#5
+	add	r10,r10,r12
+	vadd.i32	d0,d0,d25
+	and	r2,r2,r6
+	eor	r12,r0,r6,ror#19
+	vshr.u32	d24,d0,#17
+	eor	r0,r10,r10,ror#11
+	eor	r2,r2,r8
+	vsli.32	d24,d0,#15
+	add	r9,r9,r12,ror#6
+	eor	r12,r10,r11
+	vshr.u32	d25,d0,#10
+	eor	r0,r0,r10,ror#20
+	add	r9,r9,r2
+	veor	d25,d25,d24
+	ldr	r2,[sp,#12]
+	and	r3,r3,r12
+	vshr.u32	d24,d0,#19
+	add	r5,r5,r9
+	add	r9,r9,r0,ror#2
+	eor	r3,r3,r11
+	vld1.32	{q8},[r14,:128]!
+	add	r8,r8,r2
+	vsli.32	d24,d0,#13
+	eor	r2,r6,r7
+	eor	r0,r5,r5,ror#5
+	veor	d25,d25,d24
+	add	r9,r9,r3
+	and	r2,r2,r5
+	vadd.i32	d1,d1,d25
+	eor	r3,r0,r5,ror#19
+	eor	r0,r9,r9,ror#11
+	vadd.i32	q8,q8,q0
+	eor	r2,r2,r7
+	add	r8,r8,r3,ror#6
+	eor	r3,r9,r10
+	eor	r0,r0,r9,ror#20
+	add	r8,r8,r2
+	ldr	r2,[sp,#16]
+	and	r12,r12,r3
+	add	r4,r4,r8
+	vst1.32	{q8},[r1,:128]!
+	add	r8,r8,r0,ror#2
+	eor	r12,r12,r10
+	vext.8	q8,q1,q2,#4
+	add	r7,r7,r2
+	eor	r2,r5,r6
+	eor	r0,r4,r4,ror#5
+	vext.8	q9,q3,q0,#4
+	add	r8,r8,r12
+	and	r2,r2,r4
+	eor	r12,r0,r4,ror#19
+	vshr.u32	q10,q8,#7
+	eor	r0,r8,r8,ror#11
+	eor	r2,r2,r6
+	vadd.i32	q1,q1,q9
+	add	r7,r7,r12,ror#6
+	eor	r12,r8,r9
+	vshr.u32	q9,q8,#3
+	eor	r0,r0,r8,ror#20
+	add	r7,r7,r2
+	vsli.32	q10,q8,#25
+	ldr	r2,[sp,#20]
+	and	r3,r3,r12
+	vshr.u32	q11,q8,#18
+	add	r11,r11,r7
+	add	r7,r7,r0,ror#2
+	eor	r3,r3,r9
+	veor	q9,q9,q10
+	add	r6,r6,r2
+	vsli.32	q11,q8,#14
+	eor	r2,r4,r5
+	eor	r0,r11,r11,ror#5
+	vshr.u32	d24,d1,#17
+	add	r7,r7,r3
+	and	r2,r2,r11
+	veor	q9,q9,q11
+	eor	r3,r0,r11,ror#19
+	eor	r0,r7,r7,ror#11
+	vsli.32	d24,d1,#15
+	eor	r2,r2,r5
+	add	r6,r6,r3,ror#6
+	vshr.u32	d25,d1,#10
+	eor	r3,r7,r8
+	eor	r0,r0,r7,ror#20
+	vadd.i32	q1,q1,q9
+	add	r6,r6,r2
+	ldr	r2,[sp,#24]
+	veor	d25,d25,d24
+	and	r12,r12,r3
+	add	r10,r10,r6
+	vshr.u32	d24,d1,#19
+	add	r6,r6,r0,ror#2
+	eor	r12,r12,r8
+	vsli.32	d24,d1,#13
+	add	r5,r5,r2
+	eor	r2,r11,r4
+	veor	d25,d25,d24
+	eor	r0,r10,r10,ror#5
+	add	r6,r6,r12
+	vadd.i32	d2,d2,d25
+	and	r2,r2,r10
+	eor	r12,r0,r10,ror#19
+	vshr.u32	d24,d2,#17
+	eor	r0,r6,r6,ror#11
+	eor	r2,r2,r4
+	vsli.32	d24,d2,#15
+	add	r5,r5,r12,ror#6
+	eor	r12,r6,r7
+	vshr.u32	d25,d2,#10
+	eor	r0,r0,r6,ror#20
+	add	r5,r5,r2
+	veor	d25,d25,d24
+	ldr	r2,[sp,#28]
+	and	r3,r3,r12
+	vshr.u32	d24,d2,#19
+	add	r9,r9,r5
+	add	r5,r5,r0,ror#2
+	eor	r3,r3,r7
+	vld1.32	{q8},[r14,:128]!
+	add	r4,r4,r2
+	vsli.32	d24,d2,#13
+	eor	r2,r10,r11
+	eor	r0,r9,r9,ror#5
+	veor	d25,d25,d24
+	add	r5,r5,r3
+	and	r2,r2,r9
+	vadd.i32	d3,d3,d25
+	eor	r3,r0,r9,ror#19
+	eor	r0,r5,r5,ror#11
+	vadd.i32	q8,q8,q1
+	eor	r2,r2,r11
+	add	r4,r4,r3,ror#6
+	eor	r3,r5,r6
+	eor	r0,r0,r5,ror#20
+	add	r4,r4,r2
+	ldr	r2,[sp,#32]
+	and	r12,r12,r3
+	add	r8,r8,r4
+	vst1.32	{q8},[r1,:128]!
+	add	r4,r4,r0,ror#2
+	eor	r12,r12,r6
+	vext.8	q8,q2,q3,#4
+	add	r11,r11,r2
+	eor	r2,r9,r10
+	eor	r0,r8,r8,ror#5
+	vext.8	q9,q0,q1,#4
+	add	r4,r4,r12
+	and	r2,r2,r8
+	eor	r12,r0,r8,ror#19
+	vshr.u32	q10,q8,#7
+	eor	r0,r4,r4,ror#11
+	eor	r2,r2,r10
+	vadd.i32	q2,q2,q9
+	add	r11,r11,r12,ror#6
+	eor	r12,r4,r5
+	vshr.u32	q9,q8,#3
+	eor	r0,r0,r4,ror#20
+	add	r11,r11,r2
+	vsli.32	q10,q8,#25
+	ldr	r2,[sp,#36]
+	and	r3,r3,r12
+	vshr.u32	q11,q8,#18
+	add	r7,r7,r11
+	add	r11,r11,r0,ror#2
+	eor	r3,r3,r5
+	veor	q9,q9,q10
+	add	r10,r10,r2
+	vsli.32	q11,q8,#14
+	eor	r2,r8,r9
+	eor	r0,r7,r7,ror#5
+	vshr.u32	d24,d3,#17
+	add	r11,r11,r3
+	and	r2,r2,r7
+	veor	q9,q9,q11
+	eor	r3,r0,r7,ror#19
+	eor	r0,r11,r11,ror#11
+	vsli.32	d24,d3,#15
+	eor	r2,r2,r9
+	add	r10,r10,r3,ror#6
+	vshr.u32	d25,d3,#10
+	eor	r3,r11,r4
+	eor	r0,r0,r11,ror#20
+	vadd.i32	q2,q2,q9
+	add	r10,r10,r2
+	ldr	r2,[sp,#40]
+	veor	d25,d25,d24
+	and	r12,r12,r3
+	add	r6,r6,r10
+	vshr.u32	d24,d3,#19
+	add	r10,r10,r0,ror#2
+	eor	r12,r12,r4
+	vsli.32	d24,d3,#13
+	add	r9,r9,r2
+	eor	r2,r7,r8
+	veor	d25,d25,d24
+	eor	r0,r6,r6,ror#5
+	add	r10,r10,r12
+	vadd.i32	d4,d4,d25
+	and	r2,r2,r6
+	eor	r12,r0,r6,ror#19
+	vshr.u32	d24,d4,#17
+	eor	r0,r10,r10,ror#11
+	eor	r2,r2,r8
+	vsli.32	d24,d4,#15
+	add	r9,r9,r12,ror#6
+	eor	r12,r10,r11
+	vshr.u32	d25,d4,#10
+	eor	r0,r0,r10,ror#20
+	add	r9,r9,r2
+	veor	d25,d25,d24
+	ldr	r2,[sp,#44]
+	and	r3,r3,r12
+	vshr.u32	d24,d4,#19
+	add	r5,r5,r9
+	add	r9,r9,r0,ror#2
+	eor	r3,r3,r11
+	vld1.32	{q8},[r14,:128]!
+	add	r8,r8,r2
+	vsli.32	d24,d4,#13
+	eor	r2,r6,r7
+	eor	r0,r5,r5,ror#5
+	veor	d25,d25,d24
+	add	r9,r9,r3
+	and	r2,r2,r5
+	vadd.i32	d5,d5,d25
+	eor	r3,r0,r5,ror#19
+	eor	r0,r9,r9,ror#11
+	vadd.i32	q8,q8,q2
+	eor	r2,r2,r7
+	add	r8,r8,r3,ror#6
+	eor	r3,r9,r10
+	eor	r0,r0,r9,ror#20
+	add	r8,r8,r2
+	ldr	r2,[sp,#48]
+	and	r12,r12,r3
+	add	r4,r4,r8
+	vst1.32	{q8},[r1,:128]!
+	add	r8,r8,r0,ror#2
+	eor	r12,r12,r10
+	vext.8	q8,q3,q0,#4
+	add	r7,r7,r2
+	eor	r2,r5,r6
+	eor	r0,r4,r4,ror#5
+	vext.8	q9,q1,q2,#4
+	add	r8,r8,r12
+	and	r2,r2,r4
+	eor	r12,r0,r4,ror#19
+	vshr.u32	q10,q8,#7
+	eor	r0,r8,r8,ror#11
+	eor	r2,r2,r6
+	vadd.i32	q3,q3,q9
+	add	r7,r7,r12,ror#6
+	eor	r12,r8,r9
+	vshr.u32	q9,q8,#3
+	eor	r0,r0,r8,ror#20
+	add	r7,r7,r2
+	vsli.32	q10,q8,#25
+	ldr	r2,[sp,#52]
+	and	r3,r3,r12
+	vshr.u32	q11,q8,#18
+	add	r11,r11,r7
+	add	r7,r7,r0,ror#2
+	eor	r3,r3,r9
+	veor	q9,q9,q10
+	add	r6,r6,r2
+	vsli.32	q11,q8,#14
+	eor	r2,r4,r5
+	eor	r0,r11,r11,ror#5
+	vshr.u32	d24,d5,#17
+	add	r7,r7,r3
+	and	r2,r2,r11
+	veor	q9,q9,q11
+	eor	r3,r0,r11,ror#19
+	eor	r0,r7,r7,ror#11
+	vsli.32	d24,d5,#15
+	eor	r2,r2,r5
+	add	r6,r6,r3,ror#6
+	vshr.u32	d25,d5,#10
+	eor	r3,r7,r8
+	eor	r0,r0,r7,ror#20
+	vadd.i32	q3,q3,q9
+	add	r6,r6,r2
+	ldr	r2,[sp,#56]
+	veor	d25,d25,d24
+	and	r12,r12,r3
+	add	r10,r10,r6
+	vshr.u32	d24,d5,#19
+	add	r6,r6,r0,ror#2
+	eor	r12,r12,r8
+	vsli.32	d24,d5,#13
+	add	r5,r5,r2
+	eor	r2,r11,r4
+	veor	d25,d25,d24
+	eor	r0,r10,r10,ror#5
+	add	r6,r6,r12
+	vadd.i32	d6,d6,d25
+	and	r2,r2,r10
+	eor	r12,r0,r10,ror#19
+	vshr.u32	d24,d6,#17
+	eor	r0,r6,r6,ror#11
+	eor	r2,r2,r4
+	vsli.32	d24,d6,#15
+	add	r5,r5,r12,ror#6
+	eor	r12,r6,r7
+	vshr.u32	d25,d6,#10
+	eor	r0,r0,r6,ror#20
+	add	r5,r5,r2
+	veor	d25,d25,d24
+	ldr	r2,[sp,#60]
+	and	r3,r3,r12
+	vshr.u32	d24,d6,#19
+	add	r9,r9,r5
+	add	r5,r5,r0,ror#2
+	eor	r3,r3,r7
+	vld1.32	{q8},[r14,:128]!
+	add	r4,r4,r2
+	vsli.32	d24,d6,#13
+	eor	r2,r10,r11
+	eor	r0,r9,r9,ror#5
+	veor	d25,d25,d24
+	add	r5,r5,r3
+	and	r2,r2,r9
+	vadd.i32	d7,d7,d25
+	eor	r3,r0,r9,ror#19
+	eor	r0,r5,r5,ror#11
+	vadd.i32	q8,q8,q3
+	eor	r2,r2,r11
+	add	r4,r4,r3,ror#6
+	eor	r3,r5,r6
+	eor	r0,r0,r5,ror#20
+	add	r4,r4,r2
+	ldr	r2,[r14]
+	and	r12,r12,r3
+	add	r8,r8,r4
+	vst1.32	{q8},[r1,:128]!
+	add	r4,r4,r0,ror#2
+	eor	r12,r12,r6
+	teq	r2,#0				@ check for K256 terminator
+	ldr	r2,[sp,#0]
+	sub	r1,r1,#64
+	bne	.L_00_48
+
+	ldr	r1,[sp,#68]
+	ldr	r0,[sp,#72]
+	sub	r14,r14,#256	@ rewind r14
+	teq	r1,r0
+	it	eq
+	subeq	r1,r1,#64		@ avoid SEGV
+	vld1.8	{q0},[r1]!		@ load next input block
+	vld1.8	{q1},[r1]!
+	vld1.8	{q2},[r1]!
+	vld1.8	{q3},[r1]!
+	it	ne
+	strne	r1,[sp,#68]
+	mov	r1,sp
+	add	r11,r11,r2
+	eor	r2,r9,r10
+	eor	r0,r8,r8,ror#5
+	add	r4,r4,r12
+	vld1.32	{q8},[r14,:128]!
+	and	r2,r2,r8
+	eor	r12,r0,r8,ror#19
+	eor	r0,r4,r4,ror#11
+	eor	r2,r2,r10
+	vrev32.8	q0,q0
+	add	r11,r11,r12,ror#6
+	eor	r12,r4,r5
+	eor	r0,r0,r4,ror#20
+	add	r11,r11,r2
+	vadd.i32	q8,q8,q0
+	ldr	r2,[sp,#4]
+	and	r3,r3,r12
+	add	r7,r7,r11
+	add	r11,r11,r0,ror#2
+	eor	r3,r3,r5
+	add	r10,r10,r2
+	eor	r2,r8,r9
+	eor	r0,r7,r7,ror#5
+	add	r11,r11,r3
+	and	r2,r2,r7
+	eor	r3,r0,r7,ror#19
+	eor	r0,r11,r11,ror#11
+	eor	r2,r2,r9
+	add	r10,r10,r3,ror#6
+	eor	r3,r11,r4
+	eor	r0,r0,r11,ror#20
+	add	r10,r10,r2
+	ldr	r2,[sp,#8]
+	and	r12,r12,r3
+	add	r6,r6,r10
+	add	r10,r10,r0,ror#2
+	eor	r12,r12,r4
+	add	r9,r9,r2
+	eor	r2,r7,r8
+	eor	r0,r6,r6,ror#5
+	add	r10,r10,r12
+	and	r2,r2,r6
+	eor	r12,r0,r6,ror#19
+	eor	r0,r10,r10,ror#11
+	eor	r2,r2,r8
+	add	r9,r9,r12,ror#6
+	eor	r12,r10,r11
+	eor	r0,r0,r10,ror#20
+	add	r9,r9,r2
+	ldr	r2,[sp,#12]
+	and	r3,r3,r12
+	add	r5,r5,r9
+	add	r9,r9,r0,ror#2
+	eor	r3,r3,r11
+	add	r8,r8,r2
+	eor	r2,r6,r7
+	eor	r0,r5,r5,ror#5
+	add	r9,r9,r3
+	and	r2,r2,r5
+	eor	r3,r0,r5,ror#19
+	eor	r0,r9,r9,ror#11
+	eor	r2,r2,r7
+	add	r8,r8,r3,ror#6
+	eor	r3,r9,r10
+	eor	r0,r0,r9,ror#20
+	add	r8,r8,r2
+	ldr	r2,[sp,#16]
+	and	r12,r12,r3
+	add	r4,r4,r8
+	add	r8,r8,r0,ror#2
+	eor	r12,r12,r10
+	vst1.32	{q8},[r1,:128]!
+	add	r7,r7,r2
+	eor	r2,r5,r6
+	eor	r0,r4,r4,ror#5
+	add	r8,r8,r12
+	vld1.32	{q8},[r14,:128]!
+	and	r2,r2,r4
+	eor	r12,r0,r4,ror#19
+	eor	r0,r8,r8,ror#11
+	eor	r2,r2,r6
+	vrev32.8	q1,q1
+	add	r7,r7,r12,ror#6
+	eor	r12,r8,r9
+	eor	r0,r0,r8,ror#20
+	add	r7,r7,r2
+	vadd.i32	q8,q8,q1
+	ldr	r2,[sp,#20]
+	and	r3,r3,r12
+	add	r11,r11,r7
+	add	r7,r7,r0,ror#2
+	eor	r3,r3,r9
+	add	r6,r6,r2
+	eor	r2,r4,r5
+	eor	r0,r11,r11,ror#5
+	add	r7,r7,r3
+	and	r2,r2,r11
+	eor	r3,r0,r11,ror#19
+	eor	r0,r7,r7,ror#11
+	eor	r2,r2,r5
+	add	r6,r6,r3,ror#6
+	eor	r3,r7,r8
+	eor	r0,r0,r7,ror#20
+	add	r6,r6,r2
+	ldr	r2,[sp,#24]
+	and	r12,r12,r3
+	add	r10,r10,r6
+	add	r6,r6,r0,ror#2
+	eor	r12,r12,r8
+	add	r5,r5,r2
+	eor	r2,r11,r4
+	eor	r0,r10,r10,ror#5
+	add	r6,r6,r12
+	and	r2,r2,r10
+	eor	r12,r0,r10,ror#19
+	eor	r0,r6,r6,ror#11
+	eor	r2,r2,r4
+	add	r5,r5,r12,ror#6
+	eor	r12,r6,r7
+	eor	r0,r0,r6,ror#20
+	add	r5,r5,r2
+	ldr	r2,[sp,#28]
+	and	r3,r3,r12
+	add	r9,r9,r5
+	add	r5,r5,r0,ror#2
+	eor	r3,r3,r7
+	add	r4,r4,r2
+	eor	r2,r10,r11
+	eor	r0,r9,r9,ror#5
+	add	r5,r5,r3
+	and	r2,r2,r9
+	eor	r3,r0,r9,ror#19
+	eor	r0,r5,r5,ror#11
+	eor	r2,r2,r11
+	add	r4,r4,r3,ror#6
+	eor	r3,r5,r6
+	eor	r0,r0,r5,ror#20
+	add	r4,r4,r2
+	ldr	r2,[sp,#32]
+	and	r12,r12,r3
+	add	r8,r8,r4
+	add	r4,r4,r0,ror#2
+	eor	r12,r12,r6
+	vst1.32	{q8},[r1,:128]!
+	add	r11,r11,r2
+	eor	r2,r9,r10
+	eor	r0,r8,r8,ror#5
+	add	r4,r4,r12
+	vld1.32	{q8},[r14,:128]!
+	and	r2,r2,r8
+	eor	r12,r0,r8,ror#19
+	eor	r0,r4,r4,ror#11
+	eor	r2,r2,r10
+	vrev32.8	q2,q2
+	add	r11,r11,r12,ror#6
+	eor	r12,r4,r5
+	eor	r0,r0,r4,ror#20
+	add	r11,r11,r2
+	vadd.i32	q8,q8,q2
+	ldr	r2,[sp,#36]
+	and	r3,r3,r12
+	add	r7,r7,r11
+	add	r11,r11,r0,ror#2
+	eor	r3,r3,r5
+	add	r10,r10,r2
+	eor	r2,r8,r9
+	eor	r0,r7,r7,ror#5
+	add	r11,r11,r3
+	and	r2,r2,r7
+	eor	r3,r0,r7,ror#19
+	eor	r0,r11,r11,ror#11
+	eor	r2,r2,r9
+	add	r10,r10,r3,ror#6
+	eor	r3,r11,r4
+	eor	r0,r0,r11,ror#20
+	add	r10,r10,r2
+	ldr	r2,[sp,#40]
+	and	r12,r12,r3
+	add	r6,r6,r10
+	add	r10,r10,r0,ror#2
+	eor	r12,r12,r4
+	add	r9,r9,r2
+	eor	r2,r7,r8
+	eor	r0,r6,r6,ror#5
+	add	r10,r10,r12
+	and	r2,r2,r6
+	eor	r12,r0,r6,ror#19
+	eor	r0,r10,r10,ror#11
+	eor	r2,r2,r8
+	add	r9,r9,r12,ror#6
+	eor	r12,r10,r11
+	eor	r0,r0,r10,ror#20
+	add	r9,r9,r2
+	ldr	r2,[sp,#44]
+	and	r3,r3,r12
+	add	r5,r5,r9
+	add	r9,r9,r0,ror#2
+	eor	r3,r3,r11
+	add	r8,r8,r2
+	eor	r2,r6,r7
+	eor	r0,r5,r5,ror#5
+	add	r9,r9,r3
+	and	r2,r2,r5
+	eor	r3,r0,r5,ror#19
+	eor	r0,r9,r9,ror#11
+	eor	r2,r2,r7
+	add	r8,r8,r3,ror#6
+	eor	r3,r9,r10
+	eor	r0,r0,r9,ror#20
+	add	r8,r8,r2
+	ldr	r2,[sp,#48]
+	and	r12,r12,r3
+	add	r4,r4,r8
+	add	r8,r8,r0,ror#2
+	eor	r12,r12,r10
+	vst1.32	{q8},[r1,:128]!
+	add	r7,r7,r2
+	eor	r2,r5,r6
+	eor	r0,r4,r4,ror#5
+	add	r8,r8,r12
+	vld1.32	{q8},[r14,:128]!
+	and	r2,r2,r4
+	eor	r12,r0,r4,ror#19
+	eor	r0,r8,r8,ror#11
+	eor	r2,r2,r6
+	vrev32.8	q3,q3
+	add	r7,r7,r12,ror#6
+	eor	r12,r8,r9
+	eor	r0,r0,r8,ror#20
+	add	r7,r7,r2
+	vadd.i32	q8,q8,q3
+	ldr	r2,[sp,#52]
+	and	r3,r3,r12
+	add	r11,r11,r7
+	add	r7,r7,r0,ror#2
+	eor	r3,r3,r9
+	add	r6,r6,r2
+	eor	r2,r4,r5
+	eor	r0,r11,r11,ror#5
+	add	r7,r7,r3
+	and	r2,r2,r11
+	eor	r3,r0,r11,ror#19
+	eor	r0,r7,r7,ror#11
+	eor	r2,r2,r5
+	add	r6,r6,r3,ror#6
+	eor	r3,r7,r8
+	eor	r0,r0,r7,ror#20
+	add	r6,r6,r2
+	ldr	r2,[sp,#56]
+	and	r12,r12,r3
+	add	r10,r10,r6
+	add	r6,r6,r0,ror#2
+	eor	r12,r12,r8
+	add	r5,r5,r2
+	eor	r2,r11,r4
+	eor	r0,r10,r10,ror#5
+	add	r6,r6,r12
+	and	r2,r2,r10
+	eor	r12,r0,r10,ror#19
+	eor	r0,r6,r6,ror#11
+	eor	r2,r2,r4
+	add	r5,r5,r12,ror#6
+	eor	r12,r6,r7
+	eor	r0,r0,r6,ror#20
+	add	r5,r5,r2
+	ldr	r2,[sp,#60]
+	and	r3,r3,r12
+	add	r9,r9,r5
+	add	r5,r5,r0,ror#2
+	eor	r3,r3,r7
+	add	r4,r4,r2
+	eor	r2,r10,r11
+	eor	r0,r9,r9,ror#5
+	add	r5,r5,r3
+	and	r2,r2,r9
+	eor	r3,r0,r9,ror#19
+	eor	r0,r5,r5,ror#11
+	eor	r2,r2,r11
+	add	r4,r4,r3,ror#6
+	eor	r3,r5,r6
+	eor	r0,r0,r5,ror#20
+	add	r4,r4,r2
+	ldr	r2,[sp,#64]
+	and	r12,r12,r3
+	add	r8,r8,r4
+	add	r4,r4,r0,ror#2
+	eor	r12,r12,r6
+	vst1.32	{q8},[r1,:128]!
+	ldr	r0,[r2,#0]
+	add	r4,r4,r12			@ h+=Maj(a,b,c) from the past
+	ldr	r12,[r2,#4]
+	ldr	r3,[r2,#8]
+	ldr	r1,[r2,#12]
+	add	r4,r4,r0			@ accumulate
+	ldr	r0,[r2,#16]
+	add	r5,r5,r12
+	ldr	r12,[r2,#20]
+	add	r6,r6,r3
+	ldr	r3,[r2,#24]
+	add	r7,r7,r1
+	ldr	r1,[r2,#28]
+	add	r8,r8,r0
+	str	r4,[r2],#4
+	add	r9,r9,r12
+	str	r5,[r2],#4
+	add	r10,r10,r3
+	str	r6,[r2],#4
+	add	r11,r11,r1
+	str	r7,[r2],#4
+	stmia	r2,{r8,r9,r10,r11}
+
+	ittte	ne
+	movne	r1,sp
+	ldrne	r2,[sp,#0]
+	eorne	r12,r12,r12
+	ldreq	sp,[sp,#76]			@ restore original sp
+	itt	ne
+	eorne	r3,r5,r6
+	bne	.L_00_48
+
+	ldmia	sp!,{r4,r5,r6,r7,r8,r9,r10,r11,r12,pc}
+.size	sha256_block_data_order_neon,.-sha256_block_data_order_neon
+#endif
+#if __ARM_MAX_ARCH__>=7 && !defined(__KERNEL__)
+
+# if defined(__thumb2__) && !defined(__APPLE__)
+#  define INST(a,b,c,d)	.byte	c,d|0xc,a,b
+# else
+#  define INST(a,b,c,d)	.byte	a,b,c,d
+# endif
+
+.type	sha256_block_data_order_armv8,%function
+.align	5
+sha256_block_data_order_armv8:
+.LARMv8:
+	vld1.32	{q0,q1},[r0]
+# ifdef	__APPLE__
+	sub	r3,r3,#256+32
+# elif	defined(__thumb2__)
+	adr	r3,.LARMv8
+	sub	r3,r3,#.LARMv8-K256
+# else
+	adrl	r3,K256
+# endif
+	add	r2,r1,r2,lsl#6	@ len to point at the end of inp
+
+.Loop_v8:
+	vld1.8	{q8,q9},[r1]!
+	vld1.8	{q10,q11},[r1]!
+	vld1.32	{q12},[r3]!
+	vrev32.8	q8,q8
+	vrev32.8	q9,q9
+	vrev32.8	q10,q10
+	vrev32.8	q11,q11
+	vmov	q14,q0	@ offload
+	vmov	q15,q1
+	teq	r1,r2
+	vld1.32	{q13},[r3]!
+	vadd.i32	q12,q12,q8
+	INST(0xe2,0x03,0xfa,0xf3)	@ sha256su0 q8,q9
+	vmov	q2,q0
+	INST(0x68,0x0c,0x02,0xf3)	@ sha256h q0,q1,q12
+	INST(0x68,0x2c,0x14,0xf3)	@ sha256h2 q1,q2,q12
+	INST(0xe6,0x0c,0x64,0xf3)	@ sha256su1 q8,q10,q11
+	vld1.32	{q12},[r3]!
+	vadd.i32	q13,q13,q9
+	INST(0xe4,0x23,0xfa,0xf3)	@ sha256su0 q9,q10
+	vmov	q2,q0
+	INST(0x6a,0x0c,0x02,0xf3)	@ sha256h q0,q1,q13
+	INST(0x6a,0x2c,0x14,0xf3)	@ sha256h2 q1,q2,q13
+	INST(0xe0,0x2c,0x66,0xf3)	@ sha256su1 q9,q11,q8
+	vld1.32	{q13},[r3]!
+	vadd.i32	q12,q12,q10
+	INST(0xe6,0x43,0xfa,0xf3)	@ sha256su0 q10,q11
+	vmov	q2,q0
+	INST(0x68,0x0c,0x02,0xf3)	@ sha256h q0,q1,q12
+	INST(0x68,0x2c,0x14,0xf3)	@ sha256h2 q1,q2,q12
+	INST(0xe2,0x4c,0x60,0xf3)	@ sha256su1 q10,q8,q9
+	vld1.32	{q12},[r3]!
+	vadd.i32	q13,q13,q11
+	INST(0xe0,0x63,0xfa,0xf3)	@ sha256su0 q11,q8
+	vmov	q2,q0
+	INST(0x6a,0x0c,0x02,0xf3)	@ sha256h q0,q1,q13
+	INST(0x6a,0x2c,0x14,0xf3)	@ sha256h2 q1,q2,q13
+	INST(0xe4,0x6c,0x62,0xf3)	@ sha256su1 q11,q9,q10
+	vld1.32	{q13},[r3]!
+	vadd.i32	q12,q12,q8
+	INST(0xe2,0x03,0xfa,0xf3)	@ sha256su0 q8,q9
+	vmov	q2,q0
+	INST(0x68,0x0c,0x02,0xf3)	@ sha256h q0,q1,q12
+	INST(0x68,0x2c,0x14,0xf3)	@ sha256h2 q1,q2,q12
+	INST(0xe6,0x0c,0x64,0xf3)	@ sha256su1 q8,q10,q11
+	vld1.32	{q12},[r3]!
+	vadd.i32	q13,q13,q9
+	INST(0xe4,0x23,0xfa,0xf3)	@ sha256su0 q9,q10
+	vmov	q2,q0
+	INST(0x6a,0x0c,0x02,0xf3)	@ sha256h q0,q1,q13
+	INST(0x6a,0x2c,0x14,0xf3)	@ sha256h2 q1,q2,q13
+	INST(0xe0,0x2c,0x66,0xf3)	@ sha256su1 q9,q11,q8
+	vld1.32	{q13},[r3]!
+	vadd.i32	q12,q12,q10
+	INST(0xe6,0x43,0xfa,0xf3)	@ sha256su0 q10,q11
+	vmov	q2,q0
+	INST(0x68,0x0c,0x02,0xf3)	@ sha256h q0,q1,q12
+	INST(0x68,0x2c,0x14,0xf3)	@ sha256h2 q1,q2,q12
+	INST(0xe2,0x4c,0x60,0xf3)	@ sha256su1 q10,q8,q9
+	vld1.32	{q12},[r3]!
+	vadd.i32	q13,q13,q11
+	INST(0xe0,0x63,0xfa,0xf3)	@ sha256su0 q11,q8
+	vmov	q2,q0
+	INST(0x6a,0x0c,0x02,0xf3)	@ sha256h q0,q1,q13
+	INST(0x6a,0x2c,0x14,0xf3)	@ sha256h2 q1,q2,q13
+	INST(0xe4,0x6c,0x62,0xf3)	@ sha256su1 q11,q9,q10
+	vld1.32	{q13},[r3]!
+	vadd.i32	q12,q12,q8
+	INST(0xe2,0x03,0xfa,0xf3)	@ sha256su0 q8,q9
+	vmov	q2,q0
+	INST(0x68,0x0c,0x02,0xf3)	@ sha256h q0,q1,q12
+	INST(0x68,0x2c,0x14,0xf3)	@ sha256h2 q1,q2,q12
+	INST(0xe6,0x0c,0x64,0xf3)	@ sha256su1 q8,q10,q11
+	vld1.32	{q12},[r3]!
+	vadd.i32	q13,q13,q9
+	INST(0xe4,0x23,0xfa,0xf3)	@ sha256su0 q9,q10
+	vmov	q2,q0
+	INST(0x6a,0x0c,0x02,0xf3)	@ sha256h q0,q1,q13
+	INST(0x6a,0x2c,0x14,0xf3)	@ sha256h2 q1,q2,q13
+	INST(0xe0,0x2c,0x66,0xf3)	@ sha256su1 q9,q11,q8
+	vld1.32	{q13},[r3]!
+	vadd.i32	q12,q12,q10
+	INST(0xe6,0x43,0xfa,0xf3)	@ sha256su0 q10,q11
+	vmov	q2,q0
+	INST(0x68,0x0c,0x02,0xf3)	@ sha256h q0,q1,q12
+	INST(0x68,0x2c,0x14,0xf3)	@ sha256h2 q1,q2,q12
+	INST(0xe2,0x4c,0x60,0xf3)	@ sha256su1 q10,q8,q9
+	vld1.32	{q12},[r3]!
+	vadd.i32	q13,q13,q11
+	INST(0xe0,0x63,0xfa,0xf3)	@ sha256su0 q11,q8
+	vmov	q2,q0
+	INST(0x6a,0x0c,0x02,0xf3)	@ sha256h q0,q1,q13
+	INST(0x6a,0x2c,0x14,0xf3)	@ sha256h2 q1,q2,q13
+	INST(0xe4,0x6c,0x62,0xf3)	@ sha256su1 q11,q9,q10
+	vld1.32	{q13},[r3]!
+	vadd.i32	q12,q12,q8
+	vmov	q2,q0
+	INST(0x68,0x0c,0x02,0xf3)	@ sha256h q0,q1,q12
+	INST(0x68,0x2c,0x14,0xf3)	@ sha256h2 q1,q2,q12
+
+	vld1.32	{q12},[r3]!
+	vadd.i32	q13,q13,q9
+	vmov	q2,q0
+	INST(0x6a,0x0c,0x02,0xf3)	@ sha256h q0,q1,q13
+	INST(0x6a,0x2c,0x14,0xf3)	@ sha256h2 q1,q2,q13
+
+	vld1.32	{q13},[r3]
+	vadd.i32	q12,q12,q10
+	sub	r3,r3,#256-16	@ rewind
+	vmov	q2,q0
+	INST(0x68,0x0c,0x02,0xf3)	@ sha256h q0,q1,q12
+	INST(0x68,0x2c,0x14,0xf3)	@ sha256h2 q1,q2,q12
+
+	vadd.i32	q13,q13,q11
+	vmov	q2,q0
+	INST(0x6a,0x0c,0x02,0xf3)	@ sha256h q0,q1,q13
+	INST(0x6a,0x2c,0x14,0xf3)	@ sha256h2 q1,q2,q13
+
+	vadd.i32	q0,q0,q14
+	vadd.i32	q1,q1,q15
+	it	ne
+	bne	.Loop_v8
+
+	vst1.32	{q0,q1},[r0]
+
+	bx	lr		@ bx lr
+.size	sha256_block_data_order_armv8,.-sha256_block_data_order_armv8
+#endif
+.byte	83,72,65,50,53,54,32,98,108,111,99,107,32,116,114,97,110,115,102,111,114,109,32,102,111,114,32,65,82,77,118,52,47,78,69,79,78,47,65,82,77,118,56,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0
+.align	2
+.align	2
+#if __ARM_MAX_ARCH__>=7 && !defined(__KERNEL__)
+.comm	OPENSSL_armcap_P,4,4
+.hidden	OPENSSL_armcap_P
+#endif
+#endif
\ No newline at end of file
diff --git a/third_party/boringssl/linux-arm/crypto/sha/sha512-armv4.S b/third_party/boringssl/linux-arm/crypto/sha/sha512-armv4.S
new file mode 100644
index 0000000..c794f87
--- /dev/null
+++ b/third_party/boringssl/linux-arm/crypto/sha/sha512-armv4.S
@@ -0,0 +1,1869 @@
+#if defined(__arm__)
+
+@ ====================================================================
+@ Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
+@ project. The module is, however, dual licensed under OpenSSL and
+@ CRYPTOGAMS licenses depending on where you obtain it. For further
+@ details see http://www.openssl.org/~appro/cryptogams/.
+@
+@ Permission to use under GPL terms is granted.
+@ ====================================================================
+
+@ SHA512 block procedure for ARMv4. September 2007.
+
+@ This code is ~4.5 (four and a half) times faster than code generated
+@ by gcc 3.4 and it spends ~72 clock cycles per byte [on single-issue
+@ Xscale PXA250 core].
+@
+@ July 2010.
+@
+@ Rescheduling for dual-issue pipeline resulted in 6% improvement on
+@ Cortex A8 core and ~40 cycles per processed byte.
+
+@ February 2011.
+@
+@ Profiler-assisted and platform-specific optimization resulted in 7%
+@ improvement on Coxtex A8 core and ~38 cycles per byte.
+
+@ March 2011.
+@
+@ Add NEON implementation. On Cortex A8 it was measured to process
+@ one byte in 23.3 cycles or ~60% faster than integer-only code.
+
+@ August 2012.
+@
+@ Improve NEON performance by 12% on Snapdragon S4. In absolute
+@ terms it's 22.6 cycles per byte, which is disappointing result.
+@ Technical writers asserted that 3-way S4 pipeline can sustain
+@ multiple NEON instructions per cycle, but dual NEON issue could
+@ not be observed, see http://www.openssl.org/~appro/Snapdragon-S4.html
+@ for further details. On side note Cortex-A15 processes one byte in
+@ 16 cycles.
+
+@ Byte order [in]dependence. =========================================
+@
+@ Originally caller was expected to maintain specific *dword* order in
+@ h[0-7], namely with most significant dword at *lower* address, which
+@ was reflected in below two parameters as 0 and 4. Now caller is
+@ expected to maintain native byte order for whole 64-bit values.
+#ifndef __KERNEL__
+# include "arm_arch.h"
+# define VFP_ABI_PUSH	vstmdb	sp!,{d8-d15}
+# define VFP_ABI_POP	vldmia	sp!,{d8-d15}
+#else
+# define __ARM_ARCH__ __LINUX_ARM_ARCH__
+# define __ARM_MAX_ARCH__ 7
+# define VFP_ABI_PUSH
+# define VFP_ABI_POP
+#endif
+
+#ifdef __ARMEL__
+# define LO 0
+# define HI 4
+# define WORD64(hi0,lo0,hi1,lo1)	.word	lo0,hi0, lo1,hi1
+#else
+# define HI 0
+# define LO 4
+# define WORD64(hi0,lo0,hi1,lo1)	.word	hi0,lo0, hi1,lo1
+#endif
+
+.text
+#if __ARM_ARCH__<7 || defined(__APPLE__)
+.code	32
+#else
+.syntax	unified
+# ifdef __thumb2__
+#  define adrl adr
+.thumb
+# else
+.code	32
+# endif
+#endif
+
+.type	K512,%object
+.align	5
+K512:
+	WORD64(0x428a2f98,0xd728ae22,	0x71374491,0x23ef65cd)
+	WORD64(0xb5c0fbcf,0xec4d3b2f,	0xe9b5dba5,0x8189dbbc)
+	WORD64(0x3956c25b,0xf348b538,	0x59f111f1,0xb605d019)
+	WORD64(0x923f82a4,0xaf194f9b,	0xab1c5ed5,0xda6d8118)
+	WORD64(0xd807aa98,0xa3030242,	0x12835b01,0x45706fbe)
+	WORD64(0x243185be,0x4ee4b28c,	0x550c7dc3,0xd5ffb4e2)
+	WORD64(0x72be5d74,0xf27b896f,	0x80deb1fe,0x3b1696b1)
+	WORD64(0x9bdc06a7,0x25c71235,	0xc19bf174,0xcf692694)
+	WORD64(0xe49b69c1,0x9ef14ad2,	0xefbe4786,0x384f25e3)
+	WORD64(0x0fc19dc6,0x8b8cd5b5,	0x240ca1cc,0x77ac9c65)
+	WORD64(0x2de92c6f,0x592b0275,	0x4a7484aa,0x6ea6e483)
+	WORD64(0x5cb0a9dc,0xbd41fbd4,	0x76f988da,0x831153b5)
+	WORD64(0x983e5152,0xee66dfab,	0xa831c66d,0x2db43210)
+	WORD64(0xb00327c8,0x98fb213f,	0xbf597fc7,0xbeef0ee4)
+	WORD64(0xc6e00bf3,0x3da88fc2,	0xd5a79147,0x930aa725)
+	WORD64(0x06ca6351,0xe003826f,	0x14292967,0x0a0e6e70)
+	WORD64(0x27b70a85,0x46d22ffc,	0x2e1b2138,0x5c26c926)
+	WORD64(0x4d2c6dfc,0x5ac42aed,	0x53380d13,0x9d95b3df)
+	WORD64(0x650a7354,0x8baf63de,	0x766a0abb,0x3c77b2a8)
+	WORD64(0x81c2c92e,0x47edaee6,	0x92722c85,0x1482353b)
+	WORD64(0xa2bfe8a1,0x4cf10364,	0xa81a664b,0xbc423001)
+	WORD64(0xc24b8b70,0xd0f89791,	0xc76c51a3,0x0654be30)
+	WORD64(0xd192e819,0xd6ef5218,	0xd6990624,0x5565a910)
+	WORD64(0xf40e3585,0x5771202a,	0x106aa070,0x32bbd1b8)
+	WORD64(0x19a4c116,0xb8d2d0c8,	0x1e376c08,0x5141ab53)
+	WORD64(0x2748774c,0xdf8eeb99,	0x34b0bcb5,0xe19b48a8)
+	WORD64(0x391c0cb3,0xc5c95a63,	0x4ed8aa4a,0xe3418acb)
+	WORD64(0x5b9cca4f,0x7763e373,	0x682e6ff3,0xd6b2b8a3)
+	WORD64(0x748f82ee,0x5defb2fc,	0x78a5636f,0x43172f60)
+	WORD64(0x84c87814,0xa1f0ab72,	0x8cc70208,0x1a6439ec)
+	WORD64(0x90befffa,0x23631e28,	0xa4506ceb,0xde82bde9)
+	WORD64(0xbef9a3f7,0xb2c67915,	0xc67178f2,0xe372532b)
+	WORD64(0xca273ece,0xea26619c,	0xd186b8c7,0x21c0c207)
+	WORD64(0xeada7dd6,0xcde0eb1e,	0xf57d4f7f,0xee6ed178)
+	WORD64(0x06f067aa,0x72176fba,	0x0a637dc5,0xa2c898a6)
+	WORD64(0x113f9804,0xbef90dae,	0x1b710b35,0x131c471b)
+	WORD64(0x28db77f5,0x23047d84,	0x32caab7b,0x40c72493)
+	WORD64(0x3c9ebe0a,0x15c9bebc,	0x431d67c4,0x9c100d4c)
+	WORD64(0x4cc5d4be,0xcb3e42b6,	0x597f299c,0xfc657e2a)
+	WORD64(0x5fcb6fab,0x3ad6faec,	0x6c44198c,0x4a475817)
+.size	K512,.-K512
+#if __ARM_MAX_ARCH__>=7 && !defined(__KERNEL__)
+.LOPENSSL_armcap:
+.word	OPENSSL_armcap_P-.Lsha512_block_data_order
+.skip	32-4
+#else
+.skip	32
+#endif
+
+.globl	sha512_block_data_order
+.type	sha512_block_data_order,%function
+sha512_block_data_order:
+.Lsha512_block_data_order:
+#if __ARM_ARCH__<7
+	sub	r3,pc,#8		@ sha512_block_data_order
+#else
+	adr	r3,sha512_block_data_order
+#endif
+#if __ARM_MAX_ARCH__>=7 && !defined(__KERNEL__)
+	ldr	r12,.LOPENSSL_armcap
+	ldr	r12,[r3,r12]		@ OPENSSL_armcap_P
+#ifdef	__APPLE__
+	ldr	r12,[r12]
+#endif
+	tst	r12,#1
+	bne	.LNEON
+#endif
+	add	r2,r1,r2,lsl#7	@ len to point at the end of inp
+	stmdb	sp!,{r4,r5,r6,r7,r8,r9,r10,r11,r12,lr}
+	sub	r14,r3,#672		@ K512
+	sub	sp,sp,#9*8
+
+	ldr	r7,[r0,#32+LO]
+	ldr	r8,[r0,#32+HI]
+	ldr	r9, [r0,#48+LO]
+	ldr	r10, [r0,#48+HI]
+	ldr	r11, [r0,#56+LO]
+	ldr	r12, [r0,#56+HI]
+.Loop:
+	str	r9, [sp,#48+0]
+	str	r10, [sp,#48+4]
+	str	r11, [sp,#56+0]
+	str	r12, [sp,#56+4]
+	ldr	r5,[r0,#0+LO]
+	ldr	r6,[r0,#0+HI]
+	ldr	r3,[r0,#8+LO]
+	ldr	r4,[r0,#8+HI]
+	ldr	r9, [r0,#16+LO]
+	ldr	r10, [r0,#16+HI]
+	ldr	r11, [r0,#24+LO]
+	ldr	r12, [r0,#24+HI]
+	str	r3,[sp,#8+0]
+	str	r4,[sp,#8+4]
+	str	r9, [sp,#16+0]
+	str	r10, [sp,#16+4]
+	str	r11, [sp,#24+0]
+	str	r12, [sp,#24+4]
+	ldr	r3,[r0,#40+LO]
+	ldr	r4,[r0,#40+HI]
+	str	r3,[sp,#40+0]
+	str	r4,[sp,#40+4]
+
+.L00_15:
+#if __ARM_ARCH__<7
+	ldrb	r3,[r1,#7]
+	ldrb	r9, [r1,#6]
+	ldrb	r10, [r1,#5]
+	ldrb	r11, [r1,#4]
+	ldrb	r4,[r1,#3]
+	ldrb	r12, [r1,#2]
+	orr	r3,r3,r9,lsl#8
+	ldrb	r9, [r1,#1]
+	orr	r3,r3,r10,lsl#16
+	ldrb	r10, [r1],#8
+	orr	r3,r3,r11,lsl#24
+	orr	r4,r4,r12,lsl#8
+	orr	r4,r4,r9,lsl#16
+	orr	r4,r4,r10,lsl#24
+#else
+	ldr	r3,[r1,#4]
+	ldr	r4,[r1],#8
+#ifdef __ARMEL__
+	rev	r3,r3
+	rev	r4,r4
+#endif
+#endif
+	@ Sigma1(x)	(ROTR((x),14) ^ ROTR((x),18)  ^ ROTR((x),41))
+	@ LO		lo>>14^hi<<18 ^ lo>>18^hi<<14 ^ hi>>9^lo<<23
+	@ HI		hi>>14^lo<<18 ^ hi>>18^lo<<14 ^ lo>>9^hi<<23
+	mov	r9,r7,lsr#14
+	str	r3,[sp,#64+0]
+	mov	r10,r8,lsr#14
+	str	r4,[sp,#64+4]
+	eor	r9,r9,r8,lsl#18
+	ldr	r11,[sp,#56+0]	@ h.lo
+	eor	r10,r10,r7,lsl#18
+	ldr	r12,[sp,#56+4]	@ h.hi
+	eor	r9,r9,r7,lsr#18
+	eor	r10,r10,r8,lsr#18
+	eor	r9,r9,r8,lsl#14
+	eor	r10,r10,r7,lsl#14
+	eor	r9,r9,r8,lsr#9
+	eor	r10,r10,r7,lsr#9
+	eor	r9,r9,r7,lsl#23
+	eor	r10,r10,r8,lsl#23	@ Sigma1(e)
+	adds	r3,r3,r9
+	ldr	r9,[sp,#40+0]	@ f.lo
+	adc	r4,r4,r10		@ T += Sigma1(e)
+	ldr	r10,[sp,#40+4]	@ f.hi
+	adds	r3,r3,r11
+	ldr	r11,[sp,#48+0]	@ g.lo
+	adc	r4,r4,r12		@ T += h
+	ldr	r12,[sp,#48+4]	@ g.hi
+
+	eor	r9,r9,r11
+	str	r7,[sp,#32+0]
+	eor	r10,r10,r12
+	str	r8,[sp,#32+4]
+	and	r9,r9,r7
+	str	r5,[sp,#0+0]
+	and	r10,r10,r8
+	str	r6,[sp,#0+4]
+	eor	r9,r9,r11
+	ldr	r11,[r14,#LO]	@ K[i].lo
+	eor	r10,r10,r12		@ Ch(e,f,g)
+	ldr	r12,[r14,#HI]	@ K[i].hi
+
+	adds	r3,r3,r9
+	ldr	r7,[sp,#24+0]	@ d.lo
+	adc	r4,r4,r10		@ T += Ch(e,f,g)
+	ldr	r8,[sp,#24+4]	@ d.hi
+	adds	r3,r3,r11
+	and	r9,r11,#0xff
+	adc	r4,r4,r12		@ T += K[i]
+	adds	r7,r7,r3
+	ldr	r11,[sp,#8+0]	@ b.lo
+	adc	r8,r8,r4		@ d += T
+	teq	r9,#148
+
+	ldr	r12,[sp,#16+0]	@ c.lo
+#if __ARM_ARCH__>=7
+	it	eq			@ Thumb2 thing, sanity check in ARM
+#endif
+	orreq	r14,r14,#1
+	@ Sigma0(x)	(ROTR((x),28) ^ ROTR((x),34) ^ ROTR((x),39))
+	@ LO		lo>>28^hi<<4  ^ hi>>2^lo<<30 ^ hi>>7^lo<<25
+	@ HI		hi>>28^lo<<4  ^ lo>>2^hi<<30 ^ lo>>7^hi<<25
+	mov	r9,r5,lsr#28
+	mov	r10,r6,lsr#28
+	eor	r9,r9,r6,lsl#4
+	eor	r10,r10,r5,lsl#4
+	eor	r9,r9,r6,lsr#2
+	eor	r10,r10,r5,lsr#2
+	eor	r9,r9,r5,lsl#30
+	eor	r10,r10,r6,lsl#30
+	eor	r9,r9,r6,lsr#7
+	eor	r10,r10,r5,lsr#7
+	eor	r9,r9,r5,lsl#25
+	eor	r10,r10,r6,lsl#25	@ Sigma0(a)
+	adds	r3,r3,r9
+	and	r9,r5,r11
+	adc	r4,r4,r10		@ T += Sigma0(a)
+
+	ldr	r10,[sp,#8+4]	@ b.hi
+	orr	r5,r5,r11
+	ldr	r11,[sp,#16+4]	@ c.hi
+	and	r5,r5,r12
+	and	r12,r6,r10
+	orr	r6,r6,r10
+	orr	r5,r5,r9		@ Maj(a,b,c).lo
+	and	r6,r6,r11
+	adds	r5,r5,r3
+	orr	r6,r6,r12		@ Maj(a,b,c).hi
+	sub	sp,sp,#8
+	adc	r6,r6,r4		@ h += T
+	tst	r14,#1
+	add	r14,r14,#8
+	tst	r14,#1
+	beq	.L00_15
+	ldr	r9,[sp,#184+0]
+	ldr	r10,[sp,#184+4]
+	bic	r14,r14,#1
+.L16_79:
+	@ sigma0(x)	(ROTR((x),1)  ^ ROTR((x),8)  ^ ((x)>>7))
+	@ LO		lo>>1^hi<<31  ^ lo>>8^hi<<24 ^ lo>>7^hi<<25
+	@ HI		hi>>1^lo<<31  ^ hi>>8^lo<<24 ^ hi>>7
+	mov	r3,r9,lsr#1
+	ldr	r11,[sp,#80+0]
+	mov	r4,r10,lsr#1
+	ldr	r12,[sp,#80+4]
+	eor	r3,r3,r10,lsl#31
+	eor	r4,r4,r9,lsl#31
+	eor	r3,r3,r9,lsr#8
+	eor	r4,r4,r10,lsr#8
+	eor	r3,r3,r10,lsl#24
+	eor	r4,r4,r9,lsl#24
+	eor	r3,r3,r9,lsr#7
+	eor	r4,r4,r10,lsr#7
+	eor	r3,r3,r10,lsl#25
+
+	@ sigma1(x)	(ROTR((x),19) ^ ROTR((x),61) ^ ((x)>>6))
+	@ LO		lo>>19^hi<<13 ^ hi>>29^lo<<3 ^ lo>>6^hi<<26
+	@ HI		hi>>19^lo<<13 ^ lo>>29^hi<<3 ^ hi>>6
+	mov	r9,r11,lsr#19
+	mov	r10,r12,lsr#19
+	eor	r9,r9,r12,lsl#13
+	eor	r10,r10,r11,lsl#13
+	eor	r9,r9,r12,lsr#29
+	eor	r10,r10,r11,lsr#29
+	eor	r9,r9,r11,lsl#3
+	eor	r10,r10,r12,lsl#3
+	eor	r9,r9,r11,lsr#6
+	eor	r10,r10,r12,lsr#6
+	ldr	r11,[sp,#120+0]
+	eor	r9,r9,r12,lsl#26
+
+	ldr	r12,[sp,#120+4]
+	adds	r3,r3,r9
+	ldr	r9,[sp,#192+0]
+	adc	r4,r4,r10
+
+	ldr	r10,[sp,#192+4]
+	adds	r3,r3,r11
+	adc	r4,r4,r12
+	adds	r3,r3,r9
+	adc	r4,r4,r10
+	@ Sigma1(x)	(ROTR((x),14) ^ ROTR((x),18)  ^ ROTR((x),41))
+	@ LO		lo>>14^hi<<18 ^ lo>>18^hi<<14 ^ hi>>9^lo<<23
+	@ HI		hi>>14^lo<<18 ^ hi>>18^lo<<14 ^ lo>>9^hi<<23
+	mov	r9,r7,lsr#14
+	str	r3,[sp,#64+0]
+	mov	r10,r8,lsr#14
+	str	r4,[sp,#64+4]
+	eor	r9,r9,r8,lsl#18
+	ldr	r11,[sp,#56+0]	@ h.lo
+	eor	r10,r10,r7,lsl#18
+	ldr	r12,[sp,#56+4]	@ h.hi
+	eor	r9,r9,r7,lsr#18
+	eor	r10,r10,r8,lsr#18
+	eor	r9,r9,r8,lsl#14
+	eor	r10,r10,r7,lsl#14
+	eor	r9,r9,r8,lsr#9
+	eor	r10,r10,r7,lsr#9
+	eor	r9,r9,r7,lsl#23
+	eor	r10,r10,r8,lsl#23	@ Sigma1(e)
+	adds	r3,r3,r9
+	ldr	r9,[sp,#40+0]	@ f.lo
+	adc	r4,r4,r10		@ T += Sigma1(e)
+	ldr	r10,[sp,#40+4]	@ f.hi
+	adds	r3,r3,r11
+	ldr	r11,[sp,#48+0]	@ g.lo
+	adc	r4,r4,r12		@ T += h
+	ldr	r12,[sp,#48+4]	@ g.hi
+
+	eor	r9,r9,r11
+	str	r7,[sp,#32+0]
+	eor	r10,r10,r12
+	str	r8,[sp,#32+4]
+	and	r9,r9,r7
+	str	r5,[sp,#0+0]
+	and	r10,r10,r8
+	str	r6,[sp,#0+4]
+	eor	r9,r9,r11
+	ldr	r11,[r14,#LO]	@ K[i].lo
+	eor	r10,r10,r12		@ Ch(e,f,g)
+	ldr	r12,[r14,#HI]	@ K[i].hi
+
+	adds	r3,r3,r9
+	ldr	r7,[sp,#24+0]	@ d.lo
+	adc	r4,r4,r10		@ T += Ch(e,f,g)
+	ldr	r8,[sp,#24+4]	@ d.hi
+	adds	r3,r3,r11
+	and	r9,r11,#0xff
+	adc	r4,r4,r12		@ T += K[i]
+	adds	r7,r7,r3
+	ldr	r11,[sp,#8+0]	@ b.lo
+	adc	r8,r8,r4		@ d += T
+	teq	r9,#23
+
+	ldr	r12,[sp,#16+0]	@ c.lo
+#if __ARM_ARCH__>=7
+	it	eq			@ Thumb2 thing, sanity check in ARM
+#endif
+	orreq	r14,r14,#1
+	@ Sigma0(x)	(ROTR((x),28) ^ ROTR((x),34) ^ ROTR((x),39))
+	@ LO		lo>>28^hi<<4  ^ hi>>2^lo<<30 ^ hi>>7^lo<<25
+	@ HI		hi>>28^lo<<4  ^ lo>>2^hi<<30 ^ lo>>7^hi<<25
+	mov	r9,r5,lsr#28
+	mov	r10,r6,lsr#28
+	eor	r9,r9,r6,lsl#4
+	eor	r10,r10,r5,lsl#4
+	eor	r9,r9,r6,lsr#2
+	eor	r10,r10,r5,lsr#2
+	eor	r9,r9,r5,lsl#30
+	eor	r10,r10,r6,lsl#30
+	eor	r9,r9,r6,lsr#7
+	eor	r10,r10,r5,lsr#7
+	eor	r9,r9,r5,lsl#25
+	eor	r10,r10,r6,lsl#25	@ Sigma0(a)
+	adds	r3,r3,r9
+	and	r9,r5,r11
+	adc	r4,r4,r10		@ T += Sigma0(a)
+
+	ldr	r10,[sp,#8+4]	@ b.hi
+	orr	r5,r5,r11
+	ldr	r11,[sp,#16+4]	@ c.hi
+	and	r5,r5,r12
+	and	r12,r6,r10
+	orr	r6,r6,r10
+	orr	r5,r5,r9		@ Maj(a,b,c).lo
+	and	r6,r6,r11
+	adds	r5,r5,r3
+	orr	r6,r6,r12		@ Maj(a,b,c).hi
+	sub	sp,sp,#8
+	adc	r6,r6,r4		@ h += T
+	tst	r14,#1
+	add	r14,r14,#8
+#if __ARM_ARCH__>=7
+	ittt	eq			@ Thumb2 thing, sanity check in ARM
+#endif
+	ldreq	r9,[sp,#184+0]
+	ldreq	r10,[sp,#184+4]
+	beq	.L16_79
+	bic	r14,r14,#1
+
+	ldr	r3,[sp,#8+0]
+	ldr	r4,[sp,#8+4]
+	ldr	r9, [r0,#0+LO]
+	ldr	r10, [r0,#0+HI]
+	ldr	r11, [r0,#8+LO]
+	ldr	r12, [r0,#8+HI]
+	adds	r9,r5,r9
+	str	r9, [r0,#0+LO]
+	adc	r10,r6,r10
+	str	r10, [r0,#0+HI]
+	adds	r11,r3,r11
+	str	r11, [r0,#8+LO]
+	adc	r12,r4,r12
+	str	r12, [r0,#8+HI]
+
+	ldr	r5,[sp,#16+0]
+	ldr	r6,[sp,#16+4]
+	ldr	r3,[sp,#24+0]
+	ldr	r4,[sp,#24+4]
+	ldr	r9, [r0,#16+LO]
+	ldr	r10, [r0,#16+HI]
+	ldr	r11, [r0,#24+LO]
+	ldr	r12, [r0,#24+HI]
+	adds	r9,r5,r9
+	str	r9, [r0,#16+LO]
+	adc	r10,r6,r10
+	str	r10, [r0,#16+HI]
+	adds	r11,r3,r11
+	str	r11, [r0,#24+LO]
+	adc	r12,r4,r12
+	str	r12, [r0,#24+HI]
+
+	ldr	r3,[sp,#40+0]
+	ldr	r4,[sp,#40+4]
+	ldr	r9, [r0,#32+LO]
+	ldr	r10, [r0,#32+HI]
+	ldr	r11, [r0,#40+LO]
+	ldr	r12, [r0,#40+HI]
+	adds	r7,r7,r9
+	str	r7,[r0,#32+LO]
+	adc	r8,r8,r10
+	str	r8,[r0,#32+HI]
+	adds	r11,r3,r11
+	str	r11, [r0,#40+LO]
+	adc	r12,r4,r12
+	str	r12, [r0,#40+HI]
+
+	ldr	r5,[sp,#48+0]
+	ldr	r6,[sp,#48+4]
+	ldr	r3,[sp,#56+0]
+	ldr	r4,[sp,#56+4]
+	ldr	r9, [r0,#48+LO]
+	ldr	r10, [r0,#48+HI]
+	ldr	r11, [r0,#56+LO]
+	ldr	r12, [r0,#56+HI]
+	adds	r9,r5,r9
+	str	r9, [r0,#48+LO]
+	adc	r10,r6,r10
+	str	r10, [r0,#48+HI]
+	adds	r11,r3,r11
+	str	r11, [r0,#56+LO]
+	adc	r12,r4,r12
+	str	r12, [r0,#56+HI]
+
+	add	sp,sp,#640
+	sub	r14,r14,#640
+
+	teq	r1,r2
+	bne	.Loop
+
+	add	sp,sp,#8*9		@ destroy frame
+#if __ARM_ARCH__>=5
+	ldmia	sp!,{r4,r5,r6,r7,r8,r9,r10,r11,r12,pc}
+#else
+	ldmia	sp!,{r4,r5,r6,r7,r8,r9,r10,r11,r12,lr}
+	tst	lr,#1
+	moveq	pc,lr			@ be binary compatible with V4, yet
+.word	0xe12fff1e			@ interoperable with Thumb ISA:-)
+#endif
+.size	sha512_block_data_order,.-sha512_block_data_order
+#if __ARM_MAX_ARCH__>=7
+.arch	armv7-a
+.fpu	neon
+
+.globl	sha512_block_data_order_neon
+.type	sha512_block_data_order_neon,%function
+.align	4
+sha512_block_data_order_neon:
+.LNEON:
+	dmb	@ errata #451034 on early Cortex A8
+	add	r2,r1,r2,lsl#7	@ len to point at the end of inp
+	adr	r3,K512
+	VFP_ABI_PUSH
+	vldmia	r0,{d16,d17,d18,d19,d20,d21,d22,d23}		@ load context
+.Loop_neon:
+	vshr.u64	d24,d20,#14	@ 0
+#if 0<16
+	vld1.64	{d0},[r1]!	@ handles unaligned
+#endif
+	vshr.u64	d25,d20,#18
+#if 0>0
+	vadd.i64	d16,d30			@ h+=Maj from the past
+#endif
+	vshr.u64	d26,d20,#41
+	vld1.64	{d28},[r3,:64]!	@ K[i++]
+	vsli.64	d24,d20,#50
+	vsli.64	d25,d20,#46
+	vmov	d29,d20
+	vsli.64	d26,d20,#23
+#if 0<16 && defined(__ARMEL__)
+	vrev64.8	d0,d0
+#endif
+	veor	d25,d24
+	vbsl	d29,d21,d22		@ Ch(e,f,g)
+	vshr.u64	d24,d16,#28
+	veor	d26,d25			@ Sigma1(e)
+	vadd.i64	d27,d29,d23
+	vshr.u64	d25,d16,#34
+	vsli.64	d24,d16,#36
+	vadd.i64	d27,d26
+	vshr.u64	d26,d16,#39
+	vadd.i64	d28,d0
+	vsli.64	d25,d16,#30
+	veor	d30,d16,d17
+	vsli.64	d26,d16,#25
+	veor	d23,d24,d25
+	vadd.i64	d27,d28
+	vbsl	d30,d18,d17		@ Maj(a,b,c)
+	veor	d23,d26			@ Sigma0(a)
+	vadd.i64	d19,d27
+	vadd.i64	d30,d27
+	@ vadd.i64	d23,d30
+	vshr.u64	d24,d19,#14	@ 1
+#if 1<16
+	vld1.64	{d1},[r1]!	@ handles unaligned
+#endif
+	vshr.u64	d25,d19,#18
+#if 1>0
+	vadd.i64	d23,d30			@ h+=Maj from the past
+#endif
+	vshr.u64	d26,d19,#41
+	vld1.64	{d28},[r3,:64]!	@ K[i++]
+	vsli.64	d24,d19,#50
+	vsli.64	d25,d19,#46
+	vmov	d29,d19
+	vsli.64	d26,d19,#23
+#if 1<16 && defined(__ARMEL__)
+	vrev64.8	d1,d1
+#endif
+	veor	d25,d24
+	vbsl	d29,d20,d21		@ Ch(e,f,g)
+	vshr.u64	d24,d23,#28
+	veor	d26,d25			@ Sigma1(e)
+	vadd.i64	d27,d29,d22
+	vshr.u64	d25,d23,#34
+	vsli.64	d24,d23,#36
+	vadd.i64	d27,d26
+	vshr.u64	d26,d23,#39
+	vadd.i64	d28,d1
+	vsli.64	d25,d23,#30
+	veor	d30,d23,d16
+	vsli.64	d26,d23,#25
+	veor	d22,d24,d25
+	vadd.i64	d27,d28
+	vbsl	d30,d17,d16		@ Maj(a,b,c)
+	veor	d22,d26			@ Sigma0(a)
+	vadd.i64	d18,d27
+	vadd.i64	d30,d27
+	@ vadd.i64	d22,d30
+	vshr.u64	d24,d18,#14	@ 2
+#if 2<16
+	vld1.64	{d2},[r1]!	@ handles unaligned
+#endif
+	vshr.u64	d25,d18,#18
+#if 2>0
+	vadd.i64	d22,d30			@ h+=Maj from the past
+#endif
+	vshr.u64	d26,d18,#41
+	vld1.64	{d28},[r3,:64]!	@ K[i++]
+	vsli.64	d24,d18,#50
+	vsli.64	d25,d18,#46
+	vmov	d29,d18
+	vsli.64	d26,d18,#23
+#if 2<16 && defined(__ARMEL__)
+	vrev64.8	d2,d2
+#endif
+	veor	d25,d24
+	vbsl	d29,d19,d20		@ Ch(e,f,g)
+	vshr.u64	d24,d22,#28
+	veor	d26,d25			@ Sigma1(e)
+	vadd.i64	d27,d29,d21
+	vshr.u64	d25,d22,#34
+	vsli.64	d24,d22,#36
+	vadd.i64	d27,d26
+	vshr.u64	d26,d22,#39
+	vadd.i64	d28,d2
+	vsli.64	d25,d22,#30
+	veor	d30,d22,d23
+	vsli.64	d26,d22,#25
+	veor	d21,d24,d25
+	vadd.i64	d27,d28
+	vbsl	d30,d16,d23		@ Maj(a,b,c)
+	veor	d21,d26			@ Sigma0(a)
+	vadd.i64	d17,d27
+	vadd.i64	d30,d27
+	@ vadd.i64	d21,d30
+	vshr.u64	d24,d17,#14	@ 3
+#if 3<16
+	vld1.64	{d3},[r1]!	@ handles unaligned
+#endif
+	vshr.u64	d25,d17,#18
+#if 3>0
+	vadd.i64	d21,d30			@ h+=Maj from the past
+#endif
+	vshr.u64	d26,d17,#41
+	vld1.64	{d28},[r3,:64]!	@ K[i++]
+	vsli.64	d24,d17,#50
+	vsli.64	d25,d17,#46
+	vmov	d29,d17
+	vsli.64	d26,d17,#23
+#if 3<16 && defined(__ARMEL__)
+	vrev64.8	d3,d3
+#endif
+	veor	d25,d24
+	vbsl	d29,d18,d19		@ Ch(e,f,g)
+	vshr.u64	d24,d21,#28
+	veor	d26,d25			@ Sigma1(e)
+	vadd.i64	d27,d29,d20
+	vshr.u64	d25,d21,#34
+	vsli.64	d24,d21,#36
+	vadd.i64	d27,d26
+	vshr.u64	d26,d21,#39
+	vadd.i64	d28,d3
+	vsli.64	d25,d21,#30
+	veor	d30,d21,d22
+	vsli.64	d26,d21,#25
+	veor	d20,d24,d25
+	vadd.i64	d27,d28
+	vbsl	d30,d23,d22		@ Maj(a,b,c)
+	veor	d20,d26			@ Sigma0(a)
+	vadd.i64	d16,d27
+	vadd.i64	d30,d27
+	@ vadd.i64	d20,d30
+	vshr.u64	d24,d16,#14	@ 4
+#if 4<16
+	vld1.64	{d4},[r1]!	@ handles unaligned
+#endif
+	vshr.u64	d25,d16,#18
+#if 4>0
+	vadd.i64	d20,d30			@ h+=Maj from the past
+#endif
+	vshr.u64	d26,d16,#41
+	vld1.64	{d28},[r3,:64]!	@ K[i++]
+	vsli.64	d24,d16,#50
+	vsli.64	d25,d16,#46
+	vmov	d29,d16
+	vsli.64	d26,d16,#23
+#if 4<16 && defined(__ARMEL__)
+	vrev64.8	d4,d4
+#endif
+	veor	d25,d24
+	vbsl	d29,d17,d18		@ Ch(e,f,g)
+	vshr.u64	d24,d20,#28
+	veor	d26,d25			@ Sigma1(e)
+	vadd.i64	d27,d29,d19
+	vshr.u64	d25,d20,#34
+	vsli.64	d24,d20,#36
+	vadd.i64	d27,d26
+	vshr.u64	d26,d20,#39
+	vadd.i64	d28,d4
+	vsli.64	d25,d20,#30
+	veor	d30,d20,d21
+	vsli.64	d26,d20,#25
+	veor	d19,d24,d25
+	vadd.i64	d27,d28
+	vbsl	d30,d22,d21		@ Maj(a,b,c)
+	veor	d19,d26			@ Sigma0(a)
+	vadd.i64	d23,d27
+	vadd.i64	d30,d27
+	@ vadd.i64	d19,d30
+	vshr.u64	d24,d23,#14	@ 5
+#if 5<16
+	vld1.64	{d5},[r1]!	@ handles unaligned
+#endif
+	vshr.u64	d25,d23,#18
+#if 5>0
+	vadd.i64	d19,d30			@ h+=Maj from the past
+#endif
+	vshr.u64	d26,d23,#41
+	vld1.64	{d28},[r3,:64]!	@ K[i++]
+	vsli.64	d24,d23,#50
+	vsli.64	d25,d23,#46
+	vmov	d29,d23
+	vsli.64	d26,d23,#23
+#if 5<16 && defined(__ARMEL__)
+	vrev64.8	d5,d5
+#endif
+	veor	d25,d24
+	vbsl	d29,d16,d17		@ Ch(e,f,g)
+	vshr.u64	d24,d19,#28
+	veor	d26,d25			@ Sigma1(e)
+	vadd.i64	d27,d29,d18
+	vshr.u64	d25,d19,#34
+	vsli.64	d24,d19,#36
+	vadd.i64	d27,d26
+	vshr.u64	d26,d19,#39
+	vadd.i64	d28,d5
+	vsli.64	d25,d19,#30
+	veor	d30,d19,d20
+	vsli.64	d26,d19,#25
+	veor	d18,d24,d25
+	vadd.i64	d27,d28
+	vbsl	d30,d21,d20		@ Maj(a,b,c)
+	veor	d18,d26			@ Sigma0(a)
+	vadd.i64	d22,d27
+	vadd.i64	d30,d27
+	@ vadd.i64	d18,d30
+	vshr.u64	d24,d22,#14	@ 6
+#if 6<16
+	vld1.64	{d6},[r1]!	@ handles unaligned
+#endif
+	vshr.u64	d25,d22,#18
+#if 6>0
+	vadd.i64	d18,d30			@ h+=Maj from the past
+#endif
+	vshr.u64	d26,d22,#41
+	vld1.64	{d28},[r3,:64]!	@ K[i++]
+	vsli.64	d24,d22,#50
+	vsli.64	d25,d22,#46
+	vmov	d29,d22
+	vsli.64	d26,d22,#23
+#if 6<16 && defined(__ARMEL__)
+	vrev64.8	d6,d6
+#endif
+	veor	d25,d24
+	vbsl	d29,d23,d16		@ Ch(e,f,g)
+	vshr.u64	d24,d18,#28
+	veor	d26,d25			@ Sigma1(e)
+	vadd.i64	d27,d29,d17
+	vshr.u64	d25,d18,#34
+	vsli.64	d24,d18,#36
+	vadd.i64	d27,d26
+	vshr.u64	d26,d18,#39
+	vadd.i64	d28,d6
+	vsli.64	d25,d18,#30
+	veor	d30,d18,d19
+	vsli.64	d26,d18,#25
+	veor	d17,d24,d25
+	vadd.i64	d27,d28
+	vbsl	d30,d20,d19		@ Maj(a,b,c)
+	veor	d17,d26			@ Sigma0(a)
+	vadd.i64	d21,d27
+	vadd.i64	d30,d27
+	@ vadd.i64	d17,d30
+	vshr.u64	d24,d21,#14	@ 7
+#if 7<16
+	vld1.64	{d7},[r1]!	@ handles unaligned
+#endif
+	vshr.u64	d25,d21,#18
+#if 7>0
+	vadd.i64	d17,d30			@ h+=Maj from the past
+#endif
+	vshr.u64	d26,d21,#41
+	vld1.64	{d28},[r3,:64]!	@ K[i++]
+	vsli.64	d24,d21,#50
+	vsli.64	d25,d21,#46
+	vmov	d29,d21
+	vsli.64	d26,d21,#23
+#if 7<16 && defined(__ARMEL__)
+	vrev64.8	d7,d7
+#endif
+	veor	d25,d24
+	vbsl	d29,d22,d23		@ Ch(e,f,g)
+	vshr.u64	d24,d17,#28
+	veor	d26,d25			@ Sigma1(e)
+	vadd.i64	d27,d29,d16
+	vshr.u64	d25,d17,#34
+	vsli.64	d24,d17,#36
+	vadd.i64	d27,d26
+	vshr.u64	d26,d17,#39
+	vadd.i64	d28,d7
+	vsli.64	d25,d17,#30
+	veor	d30,d17,d18
+	vsli.64	d26,d17,#25
+	veor	d16,d24,d25
+	vadd.i64	d27,d28
+	vbsl	d30,d19,d18		@ Maj(a,b,c)
+	veor	d16,d26			@ Sigma0(a)
+	vadd.i64	d20,d27
+	vadd.i64	d30,d27
+	@ vadd.i64	d16,d30
+	vshr.u64	d24,d20,#14	@ 8
+#if 8<16
+	vld1.64	{d8},[r1]!	@ handles unaligned
+#endif
+	vshr.u64	d25,d20,#18
+#if 8>0
+	vadd.i64	d16,d30			@ h+=Maj from the past
+#endif
+	vshr.u64	d26,d20,#41
+	vld1.64	{d28},[r3,:64]!	@ K[i++]
+	vsli.64	d24,d20,#50
+	vsli.64	d25,d20,#46
+	vmov	d29,d20
+	vsli.64	d26,d20,#23
+#if 8<16 && defined(__ARMEL__)
+	vrev64.8	d8,d8
+#endif
+	veor	d25,d24
+	vbsl	d29,d21,d22		@ Ch(e,f,g)
+	vshr.u64	d24,d16,#28
+	veor	d26,d25			@ Sigma1(e)
+	vadd.i64	d27,d29,d23
+	vshr.u64	d25,d16,#34
+	vsli.64	d24,d16,#36
+	vadd.i64	d27,d26
+	vshr.u64	d26,d16,#39
+	vadd.i64	d28,d8
+	vsli.64	d25,d16,#30
+	veor	d30,d16,d17
+	vsli.64	d26,d16,#25
+	veor	d23,d24,d25
+	vadd.i64	d27,d28
+	vbsl	d30,d18,d17		@ Maj(a,b,c)
+	veor	d23,d26			@ Sigma0(a)
+	vadd.i64	d19,d27
+	vadd.i64	d30,d27
+	@ vadd.i64	d23,d30
+	vshr.u64	d24,d19,#14	@ 9
+#if 9<16
+	vld1.64	{d9},[r1]!	@ handles unaligned
+#endif
+	vshr.u64	d25,d19,#18
+#if 9>0
+	vadd.i64	d23,d30			@ h+=Maj from the past
+#endif
+	vshr.u64	d26,d19,#41
+	vld1.64	{d28},[r3,:64]!	@ K[i++]
+	vsli.64	d24,d19,#50
+	vsli.64	d25,d19,#46
+	vmov	d29,d19
+	vsli.64	d26,d19,#23
+#if 9<16 && defined(__ARMEL__)
+	vrev64.8	d9,d9
+#endif
+	veor	d25,d24
+	vbsl	d29,d20,d21		@ Ch(e,f,g)
+	vshr.u64	d24,d23,#28
+	veor	d26,d25			@ Sigma1(e)
+	vadd.i64	d27,d29,d22
+	vshr.u64	d25,d23,#34
+	vsli.64	d24,d23,#36
+	vadd.i64	d27,d26
+	vshr.u64	d26,d23,#39
+	vadd.i64	d28,d9
+	vsli.64	d25,d23,#30
+	veor	d30,d23,d16
+	vsli.64	d26,d23,#25
+	veor	d22,d24,d25
+	vadd.i64	d27,d28
+	vbsl	d30,d17,d16		@ Maj(a,b,c)
+	veor	d22,d26			@ Sigma0(a)
+	vadd.i64	d18,d27
+	vadd.i64	d30,d27
+	@ vadd.i64	d22,d30
+	vshr.u64	d24,d18,#14	@ 10
+#if 10<16
+	vld1.64	{d10},[r1]!	@ handles unaligned
+#endif
+	vshr.u64	d25,d18,#18
+#if 10>0
+	vadd.i64	d22,d30			@ h+=Maj from the past
+#endif
+	vshr.u64	d26,d18,#41
+	vld1.64	{d28},[r3,:64]!	@ K[i++]
+	vsli.64	d24,d18,#50
+	vsli.64	d25,d18,#46
+	vmov	d29,d18
+	vsli.64	d26,d18,#23
+#if 10<16 && defined(__ARMEL__)
+	vrev64.8	d10,d10
+#endif
+	veor	d25,d24
+	vbsl	d29,d19,d20		@ Ch(e,f,g)
+	vshr.u64	d24,d22,#28
+	veor	d26,d25			@ Sigma1(e)
+	vadd.i64	d27,d29,d21
+	vshr.u64	d25,d22,#34
+	vsli.64	d24,d22,#36
+	vadd.i64	d27,d26
+	vshr.u64	d26,d22,#39
+	vadd.i64	d28,d10
+	vsli.64	d25,d22,#30
+	veor	d30,d22,d23
+	vsli.64	d26,d22,#25
+	veor	d21,d24,d25
+	vadd.i64	d27,d28
+	vbsl	d30,d16,d23		@ Maj(a,b,c)
+	veor	d21,d26			@ Sigma0(a)
+	vadd.i64	d17,d27
+	vadd.i64	d30,d27
+	@ vadd.i64	d21,d30
+	vshr.u64	d24,d17,#14	@ 11
+#if 11<16
+	vld1.64	{d11},[r1]!	@ handles unaligned
+#endif
+	vshr.u64	d25,d17,#18
+#if 11>0
+	vadd.i64	d21,d30			@ h+=Maj from the past
+#endif
+	vshr.u64	d26,d17,#41
+	vld1.64	{d28},[r3,:64]!	@ K[i++]
+	vsli.64	d24,d17,#50
+	vsli.64	d25,d17,#46
+	vmov	d29,d17
+	vsli.64	d26,d17,#23
+#if 11<16 && defined(__ARMEL__)
+	vrev64.8	d11,d11
+#endif
+	veor	d25,d24
+	vbsl	d29,d18,d19		@ Ch(e,f,g)
+	vshr.u64	d24,d21,#28
+	veor	d26,d25			@ Sigma1(e)
+	vadd.i64	d27,d29,d20
+	vshr.u64	d25,d21,#34
+	vsli.64	d24,d21,#36
+	vadd.i64	d27,d26
+	vshr.u64	d26,d21,#39
+	vadd.i64	d28,d11
+	vsli.64	d25,d21,#30
+	veor	d30,d21,d22
+	vsli.64	d26,d21,#25
+	veor	d20,d24,d25
+	vadd.i64	d27,d28
+	vbsl	d30,d23,d22		@ Maj(a,b,c)
+	veor	d20,d26			@ Sigma0(a)
+	vadd.i64	d16,d27
+	vadd.i64	d30,d27
+	@ vadd.i64	d20,d30
+	vshr.u64	d24,d16,#14	@ 12
+#if 12<16
+	vld1.64	{d12},[r1]!	@ handles unaligned
+#endif
+	vshr.u64	d25,d16,#18
+#if 12>0
+	vadd.i64	d20,d30			@ h+=Maj from the past
+#endif
+	vshr.u64	d26,d16,#41
+	vld1.64	{d28},[r3,:64]!	@ K[i++]
+	vsli.64	d24,d16,#50
+	vsli.64	d25,d16,#46
+	vmov	d29,d16
+	vsli.64	d26,d16,#23
+#if 12<16 && defined(__ARMEL__)
+	vrev64.8	d12,d12
+#endif
+	veor	d25,d24
+	vbsl	d29,d17,d18		@ Ch(e,f,g)
+	vshr.u64	d24,d20,#28
+	veor	d26,d25			@ Sigma1(e)
+	vadd.i64	d27,d29,d19
+	vshr.u64	d25,d20,#34
+	vsli.64	d24,d20,#36
+	vadd.i64	d27,d26
+	vshr.u64	d26,d20,#39
+	vadd.i64	d28,d12
+	vsli.64	d25,d20,#30
+	veor	d30,d20,d21
+	vsli.64	d26,d20,#25
+	veor	d19,d24,d25
+	vadd.i64	d27,d28
+	vbsl	d30,d22,d21		@ Maj(a,b,c)
+	veor	d19,d26			@ Sigma0(a)
+	vadd.i64	d23,d27
+	vadd.i64	d30,d27
+	@ vadd.i64	d19,d30
+	vshr.u64	d24,d23,#14	@ 13
+#if 13<16
+	vld1.64	{d13},[r1]!	@ handles unaligned
+#endif
+	vshr.u64	d25,d23,#18
+#if 13>0
+	vadd.i64	d19,d30			@ h+=Maj from the past
+#endif
+	vshr.u64	d26,d23,#41
+	vld1.64	{d28},[r3,:64]!	@ K[i++]
+	vsli.64	d24,d23,#50
+	vsli.64	d25,d23,#46
+	vmov	d29,d23
+	vsli.64	d26,d23,#23
+#if 13<16 && defined(__ARMEL__)
+	vrev64.8	d13,d13
+#endif
+	veor	d25,d24
+	vbsl	d29,d16,d17		@ Ch(e,f,g)
+	vshr.u64	d24,d19,#28
+	veor	d26,d25			@ Sigma1(e)
+	vadd.i64	d27,d29,d18
+	vshr.u64	d25,d19,#34
+	vsli.64	d24,d19,#36
+	vadd.i64	d27,d26
+	vshr.u64	d26,d19,#39
+	vadd.i64	d28,d13
+	vsli.64	d25,d19,#30
+	veor	d30,d19,d20
+	vsli.64	d26,d19,#25
+	veor	d18,d24,d25
+	vadd.i64	d27,d28
+	vbsl	d30,d21,d20		@ Maj(a,b,c)
+	veor	d18,d26			@ Sigma0(a)
+	vadd.i64	d22,d27
+	vadd.i64	d30,d27
+	@ vadd.i64	d18,d30
+	vshr.u64	d24,d22,#14	@ 14
+#if 14<16
+	vld1.64	{d14},[r1]!	@ handles unaligned
+#endif
+	vshr.u64	d25,d22,#18
+#if 14>0
+	vadd.i64	d18,d30			@ h+=Maj from the past
+#endif
+	vshr.u64	d26,d22,#41
+	vld1.64	{d28},[r3,:64]!	@ K[i++]
+	vsli.64	d24,d22,#50
+	vsli.64	d25,d22,#46
+	vmov	d29,d22
+	vsli.64	d26,d22,#23
+#if 14<16 && defined(__ARMEL__)
+	vrev64.8	d14,d14
+#endif
+	veor	d25,d24
+	vbsl	d29,d23,d16		@ Ch(e,f,g)
+	vshr.u64	d24,d18,#28
+	veor	d26,d25			@ Sigma1(e)
+	vadd.i64	d27,d29,d17
+	vshr.u64	d25,d18,#34
+	vsli.64	d24,d18,#36
+	vadd.i64	d27,d26
+	vshr.u64	d26,d18,#39
+	vadd.i64	d28,d14
+	vsli.64	d25,d18,#30
+	veor	d30,d18,d19
+	vsli.64	d26,d18,#25
+	veor	d17,d24,d25
+	vadd.i64	d27,d28
+	vbsl	d30,d20,d19		@ Maj(a,b,c)
+	veor	d17,d26			@ Sigma0(a)
+	vadd.i64	d21,d27
+	vadd.i64	d30,d27
+	@ vadd.i64	d17,d30
+	vshr.u64	d24,d21,#14	@ 15
+#if 15<16
+	vld1.64	{d15},[r1]!	@ handles unaligned
+#endif
+	vshr.u64	d25,d21,#18
+#if 15>0
+	vadd.i64	d17,d30			@ h+=Maj from the past
+#endif
+	vshr.u64	d26,d21,#41
+	vld1.64	{d28},[r3,:64]!	@ K[i++]
+	vsli.64	d24,d21,#50
+	vsli.64	d25,d21,#46
+	vmov	d29,d21
+	vsli.64	d26,d21,#23
+#if 15<16 && defined(__ARMEL__)
+	vrev64.8	d15,d15
+#endif
+	veor	d25,d24
+	vbsl	d29,d22,d23		@ Ch(e,f,g)
+	vshr.u64	d24,d17,#28
+	veor	d26,d25			@ Sigma1(e)
+	vadd.i64	d27,d29,d16
+	vshr.u64	d25,d17,#34
+	vsli.64	d24,d17,#36
+	vadd.i64	d27,d26
+	vshr.u64	d26,d17,#39
+	vadd.i64	d28,d15
+	vsli.64	d25,d17,#30
+	veor	d30,d17,d18
+	vsli.64	d26,d17,#25
+	veor	d16,d24,d25
+	vadd.i64	d27,d28
+	vbsl	d30,d19,d18		@ Maj(a,b,c)
+	veor	d16,d26			@ Sigma0(a)
+	vadd.i64	d20,d27
+	vadd.i64	d30,d27
+	@ vadd.i64	d16,d30
+	mov	r12,#4
+.L16_79_neon:
+	subs	r12,#1
+	vshr.u64	q12,q7,#19
+	vshr.u64	q13,q7,#61
+	vadd.i64	d16,d30			@ h+=Maj from the past
+	vshr.u64	q15,q7,#6
+	vsli.64	q12,q7,#45
+	vext.8	q14,q0,q1,#8	@ X[i+1]
+	vsli.64	q13,q7,#3
+	veor	q15,q12
+	vshr.u64	q12,q14,#1
+	veor	q15,q13				@ sigma1(X[i+14])
+	vshr.u64	q13,q14,#8
+	vadd.i64	q0,q15
+	vshr.u64	q15,q14,#7
+	vsli.64	q12,q14,#63
+	vsli.64	q13,q14,#56
+	vext.8	q14,q4,q5,#8	@ X[i+9]
+	veor	q15,q12
+	vshr.u64	d24,d20,#14		@ from NEON_00_15
+	vadd.i64	q0,q14
+	vshr.u64	d25,d20,#18		@ from NEON_00_15
+	veor	q15,q13				@ sigma0(X[i+1])
+	vshr.u64	d26,d20,#41		@ from NEON_00_15
+	vadd.i64	q0,q15
+	vld1.64	{d28},[r3,:64]!	@ K[i++]
+	vsli.64	d24,d20,#50
+	vsli.64	d25,d20,#46
+	vmov	d29,d20
+	vsli.64	d26,d20,#23
+#if 16<16 && defined(__ARMEL__)
+	vrev64.8	,
+#endif
+	veor	d25,d24
+	vbsl	d29,d21,d22		@ Ch(e,f,g)
+	vshr.u64	d24,d16,#28
+	veor	d26,d25			@ Sigma1(e)
+	vadd.i64	d27,d29,d23
+	vshr.u64	d25,d16,#34
+	vsli.64	d24,d16,#36
+	vadd.i64	d27,d26
+	vshr.u64	d26,d16,#39
+	vadd.i64	d28,d0
+	vsli.64	d25,d16,#30
+	veor	d30,d16,d17
+	vsli.64	d26,d16,#25
+	veor	d23,d24,d25
+	vadd.i64	d27,d28
+	vbsl	d30,d18,d17		@ Maj(a,b,c)
+	veor	d23,d26			@ Sigma0(a)
+	vadd.i64	d19,d27
+	vadd.i64	d30,d27
+	@ vadd.i64	d23,d30
+	vshr.u64	d24,d19,#14	@ 17
+#if 17<16
+	vld1.64	{d1},[r1]!	@ handles unaligned
+#endif
+	vshr.u64	d25,d19,#18
+#if 17>0
+	vadd.i64	d23,d30			@ h+=Maj from the past
+#endif
+	vshr.u64	d26,d19,#41
+	vld1.64	{d28},[r3,:64]!	@ K[i++]
+	vsli.64	d24,d19,#50
+	vsli.64	d25,d19,#46
+	vmov	d29,d19
+	vsli.64	d26,d19,#23
+#if 17<16 && defined(__ARMEL__)
+	vrev64.8	,
+#endif
+	veor	d25,d24
+	vbsl	d29,d20,d21		@ Ch(e,f,g)
+	vshr.u64	d24,d23,#28
+	veor	d26,d25			@ Sigma1(e)
+	vadd.i64	d27,d29,d22
+	vshr.u64	d25,d23,#34
+	vsli.64	d24,d23,#36
+	vadd.i64	d27,d26
+	vshr.u64	d26,d23,#39
+	vadd.i64	d28,d1
+	vsli.64	d25,d23,#30
+	veor	d30,d23,d16
+	vsli.64	d26,d23,#25
+	veor	d22,d24,d25
+	vadd.i64	d27,d28
+	vbsl	d30,d17,d16		@ Maj(a,b,c)
+	veor	d22,d26			@ Sigma0(a)
+	vadd.i64	d18,d27
+	vadd.i64	d30,d27
+	@ vadd.i64	d22,d30
+	vshr.u64	q12,q0,#19
+	vshr.u64	q13,q0,#61
+	vadd.i64	d22,d30			@ h+=Maj from the past
+	vshr.u64	q15,q0,#6
+	vsli.64	q12,q0,#45
+	vext.8	q14,q1,q2,#8	@ X[i+1]
+	vsli.64	q13,q0,#3
+	veor	q15,q12
+	vshr.u64	q12,q14,#1
+	veor	q15,q13				@ sigma1(X[i+14])
+	vshr.u64	q13,q14,#8
+	vadd.i64	q1,q15
+	vshr.u64	q15,q14,#7
+	vsli.64	q12,q14,#63
+	vsli.64	q13,q14,#56
+	vext.8	q14,q5,q6,#8	@ X[i+9]
+	veor	q15,q12
+	vshr.u64	d24,d18,#14		@ from NEON_00_15
+	vadd.i64	q1,q14
+	vshr.u64	d25,d18,#18		@ from NEON_00_15
+	veor	q15,q13				@ sigma0(X[i+1])
+	vshr.u64	d26,d18,#41		@ from NEON_00_15
+	vadd.i64	q1,q15
+	vld1.64	{d28},[r3,:64]!	@ K[i++]
+	vsli.64	d24,d18,#50
+	vsli.64	d25,d18,#46
+	vmov	d29,d18
+	vsli.64	d26,d18,#23
+#if 18<16 && defined(__ARMEL__)
+	vrev64.8	,
+#endif
+	veor	d25,d24
+	vbsl	d29,d19,d20		@ Ch(e,f,g)
+	vshr.u64	d24,d22,#28
+	veor	d26,d25			@ Sigma1(e)
+	vadd.i64	d27,d29,d21
+	vshr.u64	d25,d22,#34
+	vsli.64	d24,d22,#36
+	vadd.i64	d27,d26
+	vshr.u64	d26,d22,#39
+	vadd.i64	d28,d2
+	vsli.64	d25,d22,#30
+	veor	d30,d22,d23
+	vsli.64	d26,d22,#25
+	veor	d21,d24,d25
+	vadd.i64	d27,d28
+	vbsl	d30,d16,d23		@ Maj(a,b,c)
+	veor	d21,d26			@ Sigma0(a)
+	vadd.i64	d17,d27
+	vadd.i64	d30,d27
+	@ vadd.i64	d21,d30
+	vshr.u64	d24,d17,#14	@ 19
+#if 19<16
+	vld1.64	{d3},[r1]!	@ handles unaligned
+#endif
+	vshr.u64	d25,d17,#18
+#if 19>0
+	vadd.i64	d21,d30			@ h+=Maj from the past
+#endif
+	vshr.u64	d26,d17,#41
+	vld1.64	{d28},[r3,:64]!	@ K[i++]
+	vsli.64	d24,d17,#50
+	vsli.64	d25,d17,#46
+	vmov	d29,d17
+	vsli.64	d26,d17,#23
+#if 19<16 && defined(__ARMEL__)
+	vrev64.8	,
+#endif
+	veor	d25,d24
+	vbsl	d29,d18,d19		@ Ch(e,f,g)
+	vshr.u64	d24,d21,#28
+	veor	d26,d25			@ Sigma1(e)
+	vadd.i64	d27,d29,d20
+	vshr.u64	d25,d21,#34
+	vsli.64	d24,d21,#36
+	vadd.i64	d27,d26
+	vshr.u64	d26,d21,#39
+	vadd.i64	d28,d3
+	vsli.64	d25,d21,#30
+	veor	d30,d21,d22
+	vsli.64	d26,d21,#25
+	veor	d20,d24,d25
+	vadd.i64	d27,d28
+	vbsl	d30,d23,d22		@ Maj(a,b,c)
+	veor	d20,d26			@ Sigma0(a)
+	vadd.i64	d16,d27
+	vadd.i64	d30,d27
+	@ vadd.i64	d20,d30
+	vshr.u64	q12,q1,#19
+	vshr.u64	q13,q1,#61
+	vadd.i64	d20,d30			@ h+=Maj from the past
+	vshr.u64	q15,q1,#6
+	vsli.64	q12,q1,#45
+	vext.8	q14,q2,q3,#8	@ X[i+1]
+	vsli.64	q13,q1,#3
+	veor	q15,q12
+	vshr.u64	q12,q14,#1
+	veor	q15,q13				@ sigma1(X[i+14])
+	vshr.u64	q13,q14,#8
+	vadd.i64	q2,q15
+	vshr.u64	q15,q14,#7
+	vsli.64	q12,q14,#63
+	vsli.64	q13,q14,#56
+	vext.8	q14,q6,q7,#8	@ X[i+9]
+	veor	q15,q12
+	vshr.u64	d24,d16,#14		@ from NEON_00_15
+	vadd.i64	q2,q14
+	vshr.u64	d25,d16,#18		@ from NEON_00_15
+	veor	q15,q13				@ sigma0(X[i+1])
+	vshr.u64	d26,d16,#41		@ from NEON_00_15
+	vadd.i64	q2,q15
+	vld1.64	{d28},[r3,:64]!	@ K[i++]
+	vsli.64	d24,d16,#50
+	vsli.64	d25,d16,#46
+	vmov	d29,d16
+	vsli.64	d26,d16,#23
+#if 20<16 && defined(__ARMEL__)
+	vrev64.8	,
+#endif
+	veor	d25,d24
+	vbsl	d29,d17,d18		@ Ch(e,f,g)
+	vshr.u64	d24,d20,#28
+	veor	d26,d25			@ Sigma1(e)
+	vadd.i64	d27,d29,d19
+	vshr.u64	d25,d20,#34
+	vsli.64	d24,d20,#36
+	vadd.i64	d27,d26
+	vshr.u64	d26,d20,#39
+	vadd.i64	d28,d4
+	vsli.64	d25,d20,#30
+	veor	d30,d20,d21
+	vsli.64	d26,d20,#25
+	veor	d19,d24,d25
+	vadd.i64	d27,d28
+	vbsl	d30,d22,d21		@ Maj(a,b,c)
+	veor	d19,d26			@ Sigma0(a)
+	vadd.i64	d23,d27
+	vadd.i64	d30,d27
+	@ vadd.i64	d19,d30
+	vshr.u64	d24,d23,#14	@ 21
+#if 21<16
+	vld1.64	{d5},[r1]!	@ handles unaligned
+#endif
+	vshr.u64	d25,d23,#18
+#if 21>0
+	vadd.i64	d19,d30			@ h+=Maj from the past
+#endif
+	vshr.u64	d26,d23,#41
+	vld1.64	{d28},[r3,:64]!	@ K[i++]
+	vsli.64	d24,d23,#50
+	vsli.64	d25,d23,#46
+	vmov	d29,d23
+	vsli.64	d26,d23,#23
+#if 21<16 && defined(__ARMEL__)
+	vrev64.8	,
+#endif
+	veor	d25,d24
+	vbsl	d29,d16,d17		@ Ch(e,f,g)
+	vshr.u64	d24,d19,#28
+	veor	d26,d25			@ Sigma1(e)
+	vadd.i64	d27,d29,d18
+	vshr.u64	d25,d19,#34
+	vsli.64	d24,d19,#36
+	vadd.i64	d27,d26
+	vshr.u64	d26,d19,#39
+	vadd.i64	d28,d5
+	vsli.64	d25,d19,#30
+	veor	d30,d19,d20
+	vsli.64	d26,d19,#25
+	veor	d18,d24,d25
+	vadd.i64	d27,d28
+	vbsl	d30,d21,d20		@ Maj(a,b,c)
+	veor	d18,d26			@ Sigma0(a)
+	vadd.i64	d22,d27
+	vadd.i64	d30,d27
+	@ vadd.i64	d18,d30
+	vshr.u64	q12,q2,#19
+	vshr.u64	q13,q2,#61
+	vadd.i64	d18,d30			@ h+=Maj from the past
+	vshr.u64	q15,q2,#6
+	vsli.64	q12,q2,#45
+	vext.8	q14,q3,q4,#8	@ X[i+1]
+	vsli.64	q13,q2,#3
+	veor	q15,q12
+	vshr.u64	q12,q14,#1
+	veor	q15,q13				@ sigma1(X[i+14])
+	vshr.u64	q13,q14,#8
+	vadd.i64	q3,q15
+	vshr.u64	q15,q14,#7
+	vsli.64	q12,q14,#63
+	vsli.64	q13,q14,#56
+	vext.8	q14,q7,q0,#8	@ X[i+9]
+	veor	q15,q12
+	vshr.u64	d24,d22,#14		@ from NEON_00_15
+	vadd.i64	q3,q14
+	vshr.u64	d25,d22,#18		@ from NEON_00_15
+	veor	q15,q13				@ sigma0(X[i+1])
+	vshr.u64	d26,d22,#41		@ from NEON_00_15
+	vadd.i64	q3,q15
+	vld1.64	{d28},[r3,:64]!	@ K[i++]
+	vsli.64	d24,d22,#50
+	vsli.64	d25,d22,#46
+	vmov	d29,d22
+	vsli.64	d26,d22,#23
+#if 22<16 && defined(__ARMEL__)
+	vrev64.8	,
+#endif
+	veor	d25,d24
+	vbsl	d29,d23,d16		@ Ch(e,f,g)
+	vshr.u64	d24,d18,#28
+	veor	d26,d25			@ Sigma1(e)
+	vadd.i64	d27,d29,d17
+	vshr.u64	d25,d18,#34
+	vsli.64	d24,d18,#36
+	vadd.i64	d27,d26
+	vshr.u64	d26,d18,#39
+	vadd.i64	d28,d6
+	vsli.64	d25,d18,#30
+	veor	d30,d18,d19
+	vsli.64	d26,d18,#25
+	veor	d17,d24,d25
+	vadd.i64	d27,d28
+	vbsl	d30,d20,d19		@ Maj(a,b,c)
+	veor	d17,d26			@ Sigma0(a)
+	vadd.i64	d21,d27
+	vadd.i64	d30,d27
+	@ vadd.i64	d17,d30
+	vshr.u64	d24,d21,#14	@ 23
+#if 23<16
+	vld1.64	{d7},[r1]!	@ handles unaligned
+#endif
+	vshr.u64	d25,d21,#18
+#if 23>0
+	vadd.i64	d17,d30			@ h+=Maj from the past
+#endif
+	vshr.u64	d26,d21,#41
+	vld1.64	{d28},[r3,:64]!	@ K[i++]
+	vsli.64	d24,d21,#50
+	vsli.64	d25,d21,#46
+	vmov	d29,d21
+	vsli.64	d26,d21,#23
+#if 23<16 && defined(__ARMEL__)
+	vrev64.8	,
+#endif
+	veor	d25,d24
+	vbsl	d29,d22,d23		@ Ch(e,f,g)
+	vshr.u64	d24,d17,#28
+	veor	d26,d25			@ Sigma1(e)
+	vadd.i64	d27,d29,d16
+	vshr.u64	d25,d17,#34
+	vsli.64	d24,d17,#36
+	vadd.i64	d27,d26
+	vshr.u64	d26,d17,#39
+	vadd.i64	d28,d7
+	vsli.64	d25,d17,#30
+	veor	d30,d17,d18
+	vsli.64	d26,d17,#25
+	veor	d16,d24,d25
+	vadd.i64	d27,d28
+	vbsl	d30,d19,d18		@ Maj(a,b,c)
+	veor	d16,d26			@ Sigma0(a)
+	vadd.i64	d20,d27
+	vadd.i64	d30,d27
+	@ vadd.i64	d16,d30
+	vshr.u64	q12,q3,#19
+	vshr.u64	q13,q3,#61
+	vadd.i64	d16,d30			@ h+=Maj from the past
+	vshr.u64	q15,q3,#6
+	vsli.64	q12,q3,#45
+	vext.8	q14,q4,q5,#8	@ X[i+1]
+	vsli.64	q13,q3,#3
+	veor	q15,q12
+	vshr.u64	q12,q14,#1
+	veor	q15,q13				@ sigma1(X[i+14])
+	vshr.u64	q13,q14,#8
+	vadd.i64	q4,q15
+	vshr.u64	q15,q14,#7
+	vsli.64	q12,q14,#63
+	vsli.64	q13,q14,#56
+	vext.8	q14,q0,q1,#8	@ X[i+9]
+	veor	q15,q12
+	vshr.u64	d24,d20,#14		@ from NEON_00_15
+	vadd.i64	q4,q14
+	vshr.u64	d25,d20,#18		@ from NEON_00_15
+	veor	q15,q13				@ sigma0(X[i+1])
+	vshr.u64	d26,d20,#41		@ from NEON_00_15
+	vadd.i64	q4,q15
+	vld1.64	{d28},[r3,:64]!	@ K[i++]
+	vsli.64	d24,d20,#50
+	vsli.64	d25,d20,#46
+	vmov	d29,d20
+	vsli.64	d26,d20,#23
+#if 24<16 && defined(__ARMEL__)
+	vrev64.8	,
+#endif
+	veor	d25,d24
+	vbsl	d29,d21,d22		@ Ch(e,f,g)
+	vshr.u64	d24,d16,#28
+	veor	d26,d25			@ Sigma1(e)
+	vadd.i64	d27,d29,d23
+	vshr.u64	d25,d16,#34
+	vsli.64	d24,d16,#36
+	vadd.i64	d27,d26
+	vshr.u64	d26,d16,#39
+	vadd.i64	d28,d8
+	vsli.64	d25,d16,#30
+	veor	d30,d16,d17
+	vsli.64	d26,d16,#25
+	veor	d23,d24,d25
+	vadd.i64	d27,d28
+	vbsl	d30,d18,d17		@ Maj(a,b,c)
+	veor	d23,d26			@ Sigma0(a)
+	vadd.i64	d19,d27
+	vadd.i64	d30,d27
+	@ vadd.i64	d23,d30
+	vshr.u64	d24,d19,#14	@ 25
+#if 25<16
+	vld1.64	{d9},[r1]!	@ handles unaligned
+#endif
+	vshr.u64	d25,d19,#18
+#if 25>0
+	vadd.i64	d23,d30			@ h+=Maj from the past
+#endif
+	vshr.u64	d26,d19,#41
+	vld1.64	{d28},[r3,:64]!	@ K[i++]
+	vsli.64	d24,d19,#50
+	vsli.64	d25,d19,#46
+	vmov	d29,d19
+	vsli.64	d26,d19,#23
+#if 25<16 && defined(__ARMEL__)
+	vrev64.8	,
+#endif
+	veor	d25,d24
+	vbsl	d29,d20,d21		@ Ch(e,f,g)
+	vshr.u64	d24,d23,#28
+	veor	d26,d25			@ Sigma1(e)
+	vadd.i64	d27,d29,d22
+	vshr.u64	d25,d23,#34
+	vsli.64	d24,d23,#36
+	vadd.i64	d27,d26
+	vshr.u64	d26,d23,#39
+	vadd.i64	d28,d9
+	vsli.64	d25,d23,#30
+	veor	d30,d23,d16
+	vsli.64	d26,d23,#25
+	veor	d22,d24,d25
+	vadd.i64	d27,d28
+	vbsl	d30,d17,d16		@ Maj(a,b,c)
+	veor	d22,d26			@ Sigma0(a)
+	vadd.i64	d18,d27
+	vadd.i64	d30,d27
+	@ vadd.i64	d22,d30
+	vshr.u64	q12,q4,#19
+	vshr.u64	q13,q4,#61
+	vadd.i64	d22,d30			@ h+=Maj from the past
+	vshr.u64	q15,q4,#6
+	vsli.64	q12,q4,#45
+	vext.8	q14,q5,q6,#8	@ X[i+1]
+	vsli.64	q13,q4,#3
+	veor	q15,q12
+	vshr.u64	q12,q14,#1
+	veor	q15,q13				@ sigma1(X[i+14])
+	vshr.u64	q13,q14,#8
+	vadd.i64	q5,q15
+	vshr.u64	q15,q14,#7
+	vsli.64	q12,q14,#63
+	vsli.64	q13,q14,#56
+	vext.8	q14,q1,q2,#8	@ X[i+9]
+	veor	q15,q12
+	vshr.u64	d24,d18,#14		@ from NEON_00_15
+	vadd.i64	q5,q14
+	vshr.u64	d25,d18,#18		@ from NEON_00_15
+	veor	q15,q13				@ sigma0(X[i+1])
+	vshr.u64	d26,d18,#41		@ from NEON_00_15
+	vadd.i64	q5,q15
+	vld1.64	{d28},[r3,:64]!	@ K[i++]
+	vsli.64	d24,d18,#50
+	vsli.64	d25,d18,#46
+	vmov	d29,d18
+	vsli.64	d26,d18,#23
+#if 26<16 && defined(__ARMEL__)
+	vrev64.8	,
+#endif
+	veor	d25,d24
+	vbsl	d29,d19,d20		@ Ch(e,f,g)
+	vshr.u64	d24,d22,#28
+	veor	d26,d25			@ Sigma1(e)
+	vadd.i64	d27,d29,d21
+	vshr.u64	d25,d22,#34
+	vsli.64	d24,d22,#36
+	vadd.i64	d27,d26
+	vshr.u64	d26,d22,#39
+	vadd.i64	d28,d10
+	vsli.64	d25,d22,#30
+	veor	d30,d22,d23
+	vsli.64	d26,d22,#25
+	veor	d21,d24,d25
+	vadd.i64	d27,d28
+	vbsl	d30,d16,d23		@ Maj(a,b,c)
+	veor	d21,d26			@ Sigma0(a)
+	vadd.i64	d17,d27
+	vadd.i64	d30,d27
+	@ vadd.i64	d21,d30
+	vshr.u64	d24,d17,#14	@ 27
+#if 27<16
+	vld1.64	{d11},[r1]!	@ handles unaligned
+#endif
+	vshr.u64	d25,d17,#18
+#if 27>0
+	vadd.i64	d21,d30			@ h+=Maj from the past
+#endif
+	vshr.u64	d26,d17,#41
+	vld1.64	{d28},[r3,:64]!	@ K[i++]
+	vsli.64	d24,d17,#50
+	vsli.64	d25,d17,#46
+	vmov	d29,d17
+	vsli.64	d26,d17,#23
+#if 27<16 && defined(__ARMEL__)
+	vrev64.8	,
+#endif
+	veor	d25,d24
+	vbsl	d29,d18,d19		@ Ch(e,f,g)
+	vshr.u64	d24,d21,#28
+	veor	d26,d25			@ Sigma1(e)
+	vadd.i64	d27,d29,d20
+	vshr.u64	d25,d21,#34
+	vsli.64	d24,d21,#36
+	vadd.i64	d27,d26
+	vshr.u64	d26,d21,#39
+	vadd.i64	d28,d11
+	vsli.64	d25,d21,#30
+	veor	d30,d21,d22
+	vsli.64	d26,d21,#25
+	veor	d20,d24,d25
+	vadd.i64	d27,d28
+	vbsl	d30,d23,d22		@ Maj(a,b,c)
+	veor	d20,d26			@ Sigma0(a)
+	vadd.i64	d16,d27
+	vadd.i64	d30,d27
+	@ vadd.i64	d20,d30
+	vshr.u64	q12,q5,#19
+	vshr.u64	q13,q5,#61
+	vadd.i64	d20,d30			@ h+=Maj from the past
+	vshr.u64	q15,q5,#6
+	vsli.64	q12,q5,#45
+	vext.8	q14,q6,q7,#8	@ X[i+1]
+	vsli.64	q13,q5,#3
+	veor	q15,q12
+	vshr.u64	q12,q14,#1
+	veor	q15,q13				@ sigma1(X[i+14])
+	vshr.u64	q13,q14,#8
+	vadd.i64	q6,q15
+	vshr.u64	q15,q14,#7
+	vsli.64	q12,q14,#63
+	vsli.64	q13,q14,#56
+	vext.8	q14,q2,q3,#8	@ X[i+9]
+	veor	q15,q12
+	vshr.u64	d24,d16,#14		@ from NEON_00_15
+	vadd.i64	q6,q14
+	vshr.u64	d25,d16,#18		@ from NEON_00_15
+	veor	q15,q13				@ sigma0(X[i+1])
+	vshr.u64	d26,d16,#41		@ from NEON_00_15
+	vadd.i64	q6,q15
+	vld1.64	{d28},[r3,:64]!	@ K[i++]
+	vsli.64	d24,d16,#50
+	vsli.64	d25,d16,#46
+	vmov	d29,d16
+	vsli.64	d26,d16,#23
+#if 28<16 && defined(__ARMEL__)
+	vrev64.8	,
+#endif
+	veor	d25,d24
+	vbsl	d29,d17,d18		@ Ch(e,f,g)
+	vshr.u64	d24,d20,#28
+	veor	d26,d25			@ Sigma1(e)
+	vadd.i64	d27,d29,d19
+	vshr.u64	d25,d20,#34
+	vsli.64	d24,d20,#36
+	vadd.i64	d27,d26
+	vshr.u64	d26,d20,#39
+	vadd.i64	d28,d12
+	vsli.64	d25,d20,#30
+	veor	d30,d20,d21
+	vsli.64	d26,d20,#25
+	veor	d19,d24,d25
+	vadd.i64	d27,d28
+	vbsl	d30,d22,d21		@ Maj(a,b,c)
+	veor	d19,d26			@ Sigma0(a)
+	vadd.i64	d23,d27
+	vadd.i64	d30,d27
+	@ vadd.i64	d19,d30
+	vshr.u64	d24,d23,#14	@ 29
+#if 29<16
+	vld1.64	{d13},[r1]!	@ handles unaligned
+#endif
+	vshr.u64	d25,d23,#18
+#if 29>0
+	vadd.i64	d19,d30			@ h+=Maj from the past
+#endif
+	vshr.u64	d26,d23,#41
+	vld1.64	{d28},[r3,:64]!	@ K[i++]
+	vsli.64	d24,d23,#50
+	vsli.64	d25,d23,#46
+	vmov	d29,d23
+	vsli.64	d26,d23,#23
+#if 29<16 && defined(__ARMEL__)
+	vrev64.8	,
+#endif
+	veor	d25,d24
+	vbsl	d29,d16,d17		@ Ch(e,f,g)
+	vshr.u64	d24,d19,#28
+	veor	d26,d25			@ Sigma1(e)
+	vadd.i64	d27,d29,d18
+	vshr.u64	d25,d19,#34
+	vsli.64	d24,d19,#36
+	vadd.i64	d27,d26
+	vshr.u64	d26,d19,#39
+	vadd.i64	d28,d13
+	vsli.64	d25,d19,#30
+	veor	d30,d19,d20
+	vsli.64	d26,d19,#25
+	veor	d18,d24,d25
+	vadd.i64	d27,d28
+	vbsl	d30,d21,d20		@ Maj(a,b,c)
+	veor	d18,d26			@ Sigma0(a)
+	vadd.i64	d22,d27
+	vadd.i64	d30,d27
+	@ vadd.i64	d18,d30
+	vshr.u64	q12,q6,#19
+	vshr.u64	q13,q6,#61
+	vadd.i64	d18,d30			@ h+=Maj from the past
+	vshr.u64	q15,q6,#6
+	vsli.64	q12,q6,#45
+	vext.8	q14,q7,q0,#8	@ X[i+1]
+	vsli.64	q13,q6,#3
+	veor	q15,q12
+	vshr.u64	q12,q14,#1
+	veor	q15,q13				@ sigma1(X[i+14])
+	vshr.u64	q13,q14,#8
+	vadd.i64	q7,q15
+	vshr.u64	q15,q14,#7
+	vsli.64	q12,q14,#63
+	vsli.64	q13,q14,#56
+	vext.8	q14,q3,q4,#8	@ X[i+9]
+	veor	q15,q12
+	vshr.u64	d24,d22,#14		@ from NEON_00_15
+	vadd.i64	q7,q14
+	vshr.u64	d25,d22,#18		@ from NEON_00_15
+	veor	q15,q13				@ sigma0(X[i+1])
+	vshr.u64	d26,d22,#41		@ from NEON_00_15
+	vadd.i64	q7,q15
+	vld1.64	{d28},[r3,:64]!	@ K[i++]
+	vsli.64	d24,d22,#50
+	vsli.64	d25,d22,#46
+	vmov	d29,d22
+	vsli.64	d26,d22,#23
+#if 30<16 && defined(__ARMEL__)
+	vrev64.8	,
+#endif
+	veor	d25,d24
+	vbsl	d29,d23,d16		@ Ch(e,f,g)
+	vshr.u64	d24,d18,#28
+	veor	d26,d25			@ Sigma1(e)
+	vadd.i64	d27,d29,d17
+	vshr.u64	d25,d18,#34
+	vsli.64	d24,d18,#36
+	vadd.i64	d27,d26
+	vshr.u64	d26,d18,#39
+	vadd.i64	d28,d14
+	vsli.64	d25,d18,#30
+	veor	d30,d18,d19
+	vsli.64	d26,d18,#25
+	veor	d17,d24,d25
+	vadd.i64	d27,d28
+	vbsl	d30,d20,d19		@ Maj(a,b,c)
+	veor	d17,d26			@ Sigma0(a)
+	vadd.i64	d21,d27
+	vadd.i64	d30,d27
+	@ vadd.i64	d17,d30
+	vshr.u64	d24,d21,#14	@ 31
+#if 31<16
+	vld1.64	{d15},[r1]!	@ handles unaligned
+#endif
+	vshr.u64	d25,d21,#18
+#if 31>0
+	vadd.i64	d17,d30			@ h+=Maj from the past
+#endif
+	vshr.u64	d26,d21,#41
+	vld1.64	{d28},[r3,:64]!	@ K[i++]
+	vsli.64	d24,d21,#50
+	vsli.64	d25,d21,#46
+	vmov	d29,d21
+	vsli.64	d26,d21,#23
+#if 31<16 && defined(__ARMEL__)
+	vrev64.8	,
+#endif
+	veor	d25,d24
+	vbsl	d29,d22,d23		@ Ch(e,f,g)
+	vshr.u64	d24,d17,#28
+	veor	d26,d25			@ Sigma1(e)
+	vadd.i64	d27,d29,d16
+	vshr.u64	d25,d17,#34
+	vsli.64	d24,d17,#36
+	vadd.i64	d27,d26
+	vshr.u64	d26,d17,#39
+	vadd.i64	d28,d15
+	vsli.64	d25,d17,#30
+	veor	d30,d17,d18
+	vsli.64	d26,d17,#25
+	veor	d16,d24,d25
+	vadd.i64	d27,d28
+	vbsl	d30,d19,d18		@ Maj(a,b,c)
+	veor	d16,d26			@ Sigma0(a)
+	vadd.i64	d20,d27
+	vadd.i64	d30,d27
+	@ vadd.i64	d16,d30
+	bne	.L16_79_neon
+
+	vadd.i64	d16,d30		@ h+=Maj from the past
+	vldmia	r0,{d24,d25,d26,d27,d28,d29,d30,d31}	@ load context to temp
+	vadd.i64	q8,q12		@ vectorized accumulate
+	vadd.i64	q9,q13
+	vadd.i64	q10,q14
+	vadd.i64	q11,q15
+	vstmia	r0,{d16,d17,d18,d19,d20,d21,d22,d23}	@ save context
+	teq	r1,r2
+	sub	r3,#640	@ rewind K512
+	bne	.Loop_neon
+
+	VFP_ABI_POP
+	bx	lr				@ .word	0xe12fff1e
+.size	sha512_block_data_order_neon,.-sha512_block_data_order_neon
+#endif
+.byte	83,72,65,53,49,50,32,98,108,111,99,107,32,116,114,97,110,115,102,111,114,109,32,102,111,114,32,65,82,77,118,52,47,78,69,79,78,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0
+.align	2
+.align	2
+#if __ARM_MAX_ARCH__>=7 && !defined(__KERNEL__)
+.comm	OPENSSL_armcap_P,4,4
+.hidden	OPENSSL_armcap_P
+#endif
+#endif
\ No newline at end of file
diff --git a/third_party/boringssl/linux-x86/crypto/aes/aes-586.S b/third_party/boringssl/linux-x86/crypto/aes/aes-586.S
new file mode 100644
index 0000000..7428274
--- /dev/null
+++ b/third_party/boringssl/linux-x86/crypto/aes/aes-586.S
@@ -0,0 +1,3257 @@
+#if defined(__i386__)
+.file	"aes-586.S"
+.text
+.hidden	_x86_AES_encrypt_compact
+.type	_x86_AES_encrypt_compact,@function
+.align	16
+_x86_AES_encrypt_compact:
+	movl	%edi,20(%esp)
+	xorl	(%edi),%eax
+	xorl	4(%edi),%ebx
+	xorl	8(%edi),%ecx
+	xorl	12(%edi),%edx
+	movl	240(%edi),%esi
+	leal	-2(%esi,%esi,1),%esi
+	leal	(%edi,%esi,8),%esi
+	movl	%esi,24(%esp)
+	movl	-128(%ebp),%edi
+	movl	-96(%ebp),%esi
+	movl	-64(%ebp),%edi
+	movl	-32(%ebp),%esi
+	movl	(%ebp),%edi
+	movl	32(%ebp),%esi
+	movl	64(%ebp),%edi
+	movl	96(%ebp),%esi
+.align	16
+.L000loop:
+	movl	%eax,%esi
+	andl	$255,%esi
+	movzbl	-128(%ebp,%esi,1),%esi
+	movzbl	%bh,%edi
+	movzbl	-128(%ebp,%edi,1),%edi
+	shll	$8,%edi
+	xorl	%edi,%esi
+	movl	%ecx,%edi
+	shrl	$16,%edi
+	andl	$255,%edi
+	movzbl	-128(%ebp,%edi,1),%edi
+	shll	$16,%edi
+	xorl	%edi,%esi
+	movl	%edx,%edi
+	shrl	$24,%edi
+	movzbl	-128(%ebp,%edi,1),%edi
+	shll	$24,%edi
+	xorl	%edi,%esi
+	movl	%esi,4(%esp)
+
+	movl	%ebx,%esi
+	andl	$255,%esi
+	shrl	$16,%ebx
+	movzbl	-128(%ebp,%esi,1),%esi
+	movzbl	%ch,%edi
+	movzbl	-128(%ebp,%edi,1),%edi
+	shll	$8,%edi
+	xorl	%edi,%esi
+	movl	%edx,%edi
+	shrl	$16,%edi
+	andl	$255,%edi
+	movzbl	-128(%ebp,%edi,1),%edi
+	shll	$16,%edi
+	xorl	%edi,%esi
+	movl	%eax,%edi
+	shrl	$24,%edi
+	movzbl	-128(%ebp,%edi,1),%edi
+	shll	$24,%edi
+	xorl	%edi,%esi
+	movl	%esi,8(%esp)
+
+	movl	%ecx,%esi
+	andl	$255,%esi
+	shrl	$24,%ecx
+	movzbl	-128(%ebp,%esi,1),%esi
+	movzbl	%dh,%edi
+	movzbl	-128(%ebp,%edi,1),%edi
+	shll	$8,%edi
+	xorl	%edi,%esi
+	movl	%eax,%edi
+	shrl	$16,%edi
+	andl	$255,%edx
+	andl	$255,%edi
+	movzbl	-128(%ebp,%edi,1),%edi
+	shll	$16,%edi
+	xorl	%edi,%esi
+	movzbl	%bh,%edi
+	movzbl	-128(%ebp,%edi,1),%edi
+	shll	$24,%edi
+	xorl	%edi,%esi
+
+	andl	$255,%edx
+	movzbl	-128(%ebp,%edx,1),%edx
+	movzbl	%ah,%eax
+	movzbl	-128(%ebp,%eax,1),%eax
+	shll	$8,%eax
+	xorl	%eax,%edx
+	movl	4(%esp),%eax
+	andl	$255,%ebx
+	movzbl	-128(%ebp,%ebx,1),%ebx
+	shll	$16,%ebx
+	xorl	%ebx,%edx
+	movl	8(%esp),%ebx
+	movzbl	-128(%ebp,%ecx,1),%ecx
+	shll	$24,%ecx
+	xorl	%ecx,%edx
+	movl	%esi,%ecx
+
+	movl	$2155905152,%ebp
+	andl	%ecx,%ebp
+	leal	(%ecx,%ecx,1),%edi
+	movl	%ebp,%esi
+	shrl	$7,%ebp
+	andl	$4278124286,%edi
+	subl	%ebp,%esi
+	movl	%ecx,%ebp
+	andl	$454761243,%esi
+	rorl	$16,%ebp
+	xorl	%edi,%esi
+	movl	%ecx,%edi
+	xorl	%esi,%ecx
+	rorl	$24,%edi
+	xorl	%ebp,%esi
+	roll	$24,%ecx
+	xorl	%edi,%esi
+	movl	$2155905152,%ebp
+	xorl	%esi,%ecx
+	andl	%edx,%ebp
+	leal	(%edx,%edx,1),%edi
+	movl	%ebp,%esi
+	shrl	$7,%ebp
+	andl	$4278124286,%edi
+	subl	%ebp,%esi
+	movl	%edx,%ebp
+	andl	$454761243,%esi
+	rorl	$16,%ebp
+	xorl	%edi,%esi
+	movl	%edx,%edi
+	xorl	%esi,%edx
+	rorl	$24,%edi
+	xorl	%ebp,%esi
+	roll	$24,%edx
+	xorl	%edi,%esi
+	movl	$2155905152,%ebp
+	xorl	%esi,%edx
+	andl	%eax,%ebp
+	leal	(%eax,%eax,1),%edi
+	movl	%ebp,%esi
+	shrl	$7,%ebp
+	andl	$4278124286,%edi
+	subl	%ebp,%esi
+	movl	%eax,%ebp
+	andl	$454761243,%esi
+	rorl	$16,%ebp
+	xorl	%edi,%esi
+	movl	%eax,%edi
+	xorl	%esi,%eax
+	rorl	$24,%edi
+	xorl	%ebp,%esi
+	roll	$24,%eax
+	xorl	%edi,%esi
+	movl	$2155905152,%ebp
+	xorl	%esi,%eax
+	andl	%ebx,%ebp
+	leal	(%ebx,%ebx,1),%edi
+	movl	%ebp,%esi
+	shrl	$7,%ebp
+	andl	$4278124286,%edi
+	subl	%ebp,%esi
+	movl	%ebx,%ebp
+	andl	$454761243,%esi
+	rorl	$16,%ebp
+	xorl	%edi,%esi
+	movl	%ebx,%edi
+	xorl	%esi,%ebx
+	rorl	$24,%edi
+	xorl	%ebp,%esi
+	roll	$24,%ebx
+	xorl	%edi,%esi
+	xorl	%esi,%ebx
+	movl	20(%esp),%edi
+	movl	28(%esp),%ebp
+	addl	$16,%edi
+	xorl	(%edi),%eax
+	xorl	4(%edi),%ebx
+	xorl	8(%edi),%ecx
+	xorl	12(%edi),%edx
+	cmpl	24(%esp),%edi
+	movl	%edi,20(%esp)
+	jb	.L000loop
+	movl	%eax,%esi
+	andl	$255,%esi
+	movzbl	-128(%ebp,%esi,1),%esi
+	movzbl	%bh,%edi
+	movzbl	-128(%ebp,%edi,1),%edi
+	shll	$8,%edi
+	xorl	%edi,%esi
+	movl	%ecx,%edi
+	shrl	$16,%edi
+	andl	$255,%edi
+	movzbl	-128(%ebp,%edi,1),%edi
+	shll	$16,%edi
+	xorl	%edi,%esi
+	movl	%edx,%edi
+	shrl	$24,%edi
+	movzbl	-128(%ebp,%edi,1),%edi
+	shll	$24,%edi
+	xorl	%edi,%esi
+	movl	%esi,4(%esp)
+
+	movl	%ebx,%esi
+	andl	$255,%esi
+	shrl	$16,%ebx
+	movzbl	-128(%ebp,%esi,1),%esi
+	movzbl	%ch,%edi
+	movzbl	-128(%ebp,%edi,1),%edi
+	shll	$8,%edi
+	xorl	%edi,%esi
+	movl	%edx,%edi
+	shrl	$16,%edi
+	andl	$255,%edi
+	movzbl	-128(%ebp,%edi,1),%edi
+	shll	$16,%edi
+	xorl	%edi,%esi
+	movl	%eax,%edi
+	shrl	$24,%edi
+	movzbl	-128(%ebp,%edi,1),%edi
+	shll	$24,%edi
+	xorl	%edi,%esi
+	movl	%esi,8(%esp)
+
+	movl	%ecx,%esi
+	andl	$255,%esi
+	shrl	$24,%ecx
+	movzbl	-128(%ebp,%esi,1),%esi
+	movzbl	%dh,%edi
+	movzbl	-128(%ebp,%edi,1),%edi
+	shll	$8,%edi
+	xorl	%edi,%esi
+	movl	%eax,%edi
+	shrl	$16,%edi
+	andl	$255,%edx
+	andl	$255,%edi
+	movzbl	-128(%ebp,%edi,1),%edi
+	shll	$16,%edi
+	xorl	%edi,%esi
+	movzbl	%bh,%edi
+	movzbl	-128(%ebp,%edi,1),%edi
+	shll	$24,%edi
+	xorl	%edi,%esi
+
+	movl	20(%esp),%edi
+	andl	$255,%edx
+	movzbl	-128(%ebp,%edx,1),%edx
+	movzbl	%ah,%eax
+	movzbl	-128(%ebp,%eax,1),%eax
+	shll	$8,%eax
+	xorl	%eax,%edx
+	movl	4(%esp),%eax
+	andl	$255,%ebx
+	movzbl	-128(%ebp,%ebx,1),%ebx
+	shll	$16,%ebx
+	xorl	%ebx,%edx
+	movl	8(%esp),%ebx
+	movzbl	-128(%ebp,%ecx,1),%ecx
+	shll	$24,%ecx
+	xorl	%ecx,%edx
+	movl	%esi,%ecx
+
+	xorl	16(%edi),%eax
+	xorl	20(%edi),%ebx
+	xorl	24(%edi),%ecx
+	xorl	28(%edi),%edx
+	ret
+.size	_x86_AES_encrypt_compact,.-_x86_AES_encrypt_compact
+.hidden	_sse_AES_encrypt_compact
+.type	_sse_AES_encrypt_compact,@function
+.align	16
+_sse_AES_encrypt_compact:
+	pxor	(%edi),%mm0
+	pxor	8(%edi),%mm4
+	movl	240(%edi),%esi
+	leal	-2(%esi,%esi,1),%esi
+	leal	(%edi,%esi,8),%esi
+	movl	%esi,24(%esp)
+	movl	$454761243,%eax
+	movl	%eax,8(%esp)
+	movl	%eax,12(%esp)
+	movl	-128(%ebp),%eax
+	movl	-96(%ebp),%ebx
+	movl	-64(%ebp),%ecx
+	movl	-32(%ebp),%edx
+	movl	(%ebp),%eax
+	movl	32(%ebp),%ebx
+	movl	64(%ebp),%ecx
+	movl	96(%ebp),%edx
+.align	16
+.L001loop:
+	pshufw	$8,%mm0,%mm1
+	pshufw	$13,%mm4,%mm5
+	movd	%mm1,%eax
+	movd	%mm5,%ebx
+	movl	%edi,20(%esp)
+	movzbl	%al,%esi
+	movzbl	%ah,%edx
+	pshufw	$13,%mm0,%mm2
+	movzbl	-128(%ebp,%esi,1),%ecx
+	movzbl	%bl,%edi
+	movzbl	-128(%ebp,%edx,1),%edx
+	shrl	$16,%eax
+	shll	$8,%edx
+	movzbl	-128(%ebp,%edi,1),%esi
+	movzbl	%bh,%edi
+	shll	$16,%esi
+	pshufw	$8,%mm4,%mm6
+	orl	%esi,%ecx
+	movzbl	-128(%ebp,%edi,1),%esi
+	movzbl	%ah,%edi
+	shll	$24,%esi
+	shrl	$16,%ebx
+	orl	%esi,%edx
+	movzbl	-128(%ebp,%edi,1),%esi
+	movzbl	%bh,%edi
+	shll	$8,%esi
+	orl	%esi,%ecx
+	movzbl	-128(%ebp,%edi,1),%esi
+	movzbl	%al,%edi
+	shll	$24,%esi
+	orl	%esi,%ecx
+	movzbl	-128(%ebp,%edi,1),%esi
+	movzbl	%bl,%edi
+	movd	%mm2,%eax
+	movd	%ecx,%mm0
+	movzbl	-128(%ebp,%edi,1),%ecx
+	movzbl	%ah,%edi
+	shll	$16,%ecx
+	movd	%mm6,%ebx
+	orl	%esi,%ecx
+	movzbl	-128(%ebp,%edi,1),%esi
+	movzbl	%bh,%edi
+	shll	$24,%esi
+	orl	%esi,%ecx
+	movzbl	-128(%ebp,%edi,1),%esi
+	movzbl	%bl,%edi
+	shll	$8,%esi
+	shrl	$16,%ebx
+	orl	%esi,%ecx
+	movzbl	-128(%ebp,%edi,1),%esi
+	movzbl	%al,%edi
+	shrl	$16,%eax
+	movd	%ecx,%mm1
+	movzbl	-128(%ebp,%edi,1),%ecx
+	movzbl	%ah,%edi
+	shll	$16,%ecx
+	andl	$255,%eax
+	orl	%esi,%ecx
+	punpckldq	%mm1,%mm0
+	movzbl	-128(%ebp,%edi,1),%esi
+	movzbl	%bh,%edi
+	shll	$24,%esi
+	andl	$255,%ebx
+	movzbl	-128(%ebp,%eax,1),%eax
+	orl	%esi,%ecx
+	shll	$16,%eax
+	movzbl	-128(%ebp,%edi,1),%esi
+	orl	%eax,%edx
+	shll	$8,%esi
+	movzbl	-128(%ebp,%ebx,1),%ebx
+	orl	%esi,%ecx
+	orl	%ebx,%edx
+	movl	20(%esp),%edi
+	movd	%ecx,%mm4
+	movd	%edx,%mm5
+	punpckldq	%mm5,%mm4
+	addl	$16,%edi
+	cmpl	24(%esp),%edi
+	ja	.L002out
+	movq	8(%esp),%mm2
+	pxor	%mm3,%mm3
+	pxor	%mm7,%mm7
+	movq	%mm0,%mm1
+	movq	%mm4,%mm5
+	pcmpgtb	%mm0,%mm3
+	pcmpgtb	%mm4,%mm7
+	pand	%mm2,%mm3
+	pand	%mm2,%mm7
+	pshufw	$177,%mm0,%mm2
+	pshufw	$177,%mm4,%mm6
+	paddb	%mm0,%mm0
+	paddb	%mm4,%mm4
+	pxor	%mm3,%mm0
+	pxor	%mm7,%mm4
+	pshufw	$177,%mm2,%mm3
+	pshufw	$177,%mm6,%mm7
+	pxor	%mm0,%mm1
+	pxor	%mm4,%mm5
+	pxor	%mm2,%mm0
+	pxor	%mm6,%mm4
+	movq	%mm3,%mm2
+	movq	%mm7,%mm6
+	pslld	$8,%mm3
+	pslld	$8,%mm7
+	psrld	$24,%mm2
+	psrld	$24,%mm6
+	pxor	%mm3,%mm0
+	pxor	%mm7,%mm4
+	pxor	%mm2,%mm0
+	pxor	%mm6,%mm4
+	movq	%mm1,%mm3
+	movq	%mm5,%mm7
+	movq	(%edi),%mm2
+	movq	8(%edi),%mm6
+	psrld	$8,%mm1
+	psrld	$8,%mm5
+	movl	-128(%ebp),%eax
+	pslld	$24,%mm3
+	pslld	$24,%mm7
+	movl	-64(%ebp),%ebx
+	pxor	%mm1,%mm0
+	pxor	%mm5,%mm4
+	movl	(%ebp),%ecx
+	pxor	%mm3,%mm0
+	pxor	%mm7,%mm4
+	movl	64(%ebp),%edx
+	pxor	%mm2,%mm0
+	pxor	%mm6,%mm4
+	jmp	.L001loop
+.align	16
+.L002out:
+	pxor	(%edi),%mm0
+	pxor	8(%edi),%mm4
+	ret
+.size	_sse_AES_encrypt_compact,.-_sse_AES_encrypt_compact
+.hidden	_x86_AES_encrypt
+.type	_x86_AES_encrypt,@function
+.align	16
+_x86_AES_encrypt:
+	movl	%edi,20(%esp)
+	xorl	(%edi),%eax
+	xorl	4(%edi),%ebx
+	xorl	8(%edi),%ecx
+	xorl	12(%edi),%edx
+	movl	240(%edi),%esi
+	leal	-2(%esi,%esi,1),%esi
+	leal	(%edi,%esi,8),%esi
+	movl	%esi,24(%esp)
+.align	16
+.L003loop:
+	movl	%eax,%esi
+	andl	$255,%esi
+	movl	(%ebp,%esi,8),%esi
+	movzbl	%bh,%edi
+	xorl	3(%ebp,%edi,8),%esi
+	movl	%ecx,%edi
+	shrl	$16,%edi
+	andl	$255,%edi
+	xorl	2(%ebp,%edi,8),%esi
+	movl	%edx,%edi
+	shrl	$24,%edi
+	xorl	1(%ebp,%edi,8),%esi
+	movl	%esi,4(%esp)
+
+	movl	%ebx,%esi
+	andl	$255,%esi
+	shrl	$16,%ebx
+	movl	(%ebp,%esi,8),%esi
+	movzbl	%ch,%edi
+	xorl	3(%ebp,%edi,8),%esi
+	movl	%edx,%edi
+	shrl	$16,%edi
+	andl	$255,%edi
+	xorl	2(%ebp,%edi,8),%esi
+	movl	%eax,%edi
+	shrl	$24,%edi
+	xorl	1(%ebp,%edi,8),%esi
+	movl	%esi,8(%esp)
+
+	movl	%ecx,%esi
+	andl	$255,%esi
+	shrl	$24,%ecx
+	movl	(%ebp,%esi,8),%esi
+	movzbl	%dh,%edi
+	xorl	3(%ebp,%edi,8),%esi
+	movl	%eax,%edi
+	shrl	$16,%edi
+	andl	$255,%edx
+	andl	$255,%edi
+	xorl	2(%ebp,%edi,8),%esi
+	movzbl	%bh,%edi
+	xorl	1(%ebp,%edi,8),%esi
+
+	movl	20(%esp),%edi
+	movl	(%ebp,%edx,8),%edx
+	movzbl	%ah,%eax
+	xorl	3(%ebp,%eax,8),%edx
+	movl	4(%esp),%eax
+	andl	$255,%ebx
+	xorl	2(%ebp,%ebx,8),%edx
+	movl	8(%esp),%ebx
+	xorl	1(%ebp,%ecx,8),%edx
+	movl	%esi,%ecx
+
+	addl	$16,%edi
+	xorl	(%edi),%eax
+	xorl	4(%edi),%ebx
+	xorl	8(%edi),%ecx
+	xorl	12(%edi),%edx
+	cmpl	24(%esp),%edi
+	movl	%edi,20(%esp)
+	jb	.L003loop
+	movl	%eax,%esi
+	andl	$255,%esi
+	movl	2(%ebp,%esi,8),%esi
+	andl	$255,%esi
+	movzbl	%bh,%edi
+	movl	(%ebp,%edi,8),%edi
+	andl	$65280,%edi
+	xorl	%edi,%esi
+	movl	%ecx,%edi
+	shrl	$16,%edi
+	andl	$255,%edi
+	movl	(%ebp,%edi,8),%edi
+	andl	$16711680,%edi
+	xorl	%edi,%esi
+	movl	%edx,%edi
+	shrl	$24,%edi
+	movl	2(%ebp,%edi,8),%edi
+	andl	$4278190080,%edi
+	xorl	%edi,%esi
+	movl	%esi,4(%esp)
+	movl	%ebx,%esi
+	andl	$255,%esi
+	shrl	$16,%ebx
+	movl	2(%ebp,%esi,8),%esi
+	andl	$255,%esi
+	movzbl	%ch,%edi
+	movl	(%ebp,%edi,8),%edi
+	andl	$65280,%edi
+	xorl	%edi,%esi
+	movl	%edx,%edi
+	shrl	$16,%edi
+	andl	$255,%edi
+	movl	(%ebp,%edi,8),%edi
+	andl	$16711680,%edi
+	xorl	%edi,%esi
+	movl	%eax,%edi
+	shrl	$24,%edi
+	movl	2(%ebp,%edi,8),%edi
+	andl	$4278190080,%edi
+	xorl	%edi,%esi
+	movl	%esi,8(%esp)
+	movl	%ecx,%esi
+	andl	$255,%esi
+	shrl	$24,%ecx
+	movl	2(%ebp,%esi,8),%esi
+	andl	$255,%esi
+	movzbl	%dh,%edi
+	movl	(%ebp,%edi,8),%edi
+	andl	$65280,%edi
+	xorl	%edi,%esi
+	movl	%eax,%edi
+	shrl	$16,%edi
+	andl	$255,%edx
+	andl	$255,%edi
+	movl	(%ebp,%edi,8),%edi
+	andl	$16711680,%edi
+	xorl	%edi,%esi
+	movzbl	%bh,%edi
+	movl	2(%ebp,%edi,8),%edi
+	andl	$4278190080,%edi
+	xorl	%edi,%esi
+	movl	20(%esp),%edi
+	andl	$255,%edx
+	movl	2(%ebp,%edx,8),%edx
+	andl	$255,%edx
+	movzbl	%ah,%eax
+	movl	(%ebp,%eax,8),%eax
+	andl	$65280,%eax
+	xorl	%eax,%edx
+	movl	4(%esp),%eax
+	andl	$255,%ebx
+	movl	(%ebp,%ebx,8),%ebx
+	andl	$16711680,%ebx
+	xorl	%ebx,%edx
+	movl	8(%esp),%ebx
+	movl	2(%ebp,%ecx,8),%ecx
+	andl	$4278190080,%ecx
+	xorl	%ecx,%edx
+	movl	%esi,%ecx
+	addl	$16,%edi
+	xorl	(%edi),%eax
+	xorl	4(%edi),%ebx
+	xorl	8(%edi),%ecx
+	xorl	12(%edi),%edx
+	ret
+.align	64
+.LAES_Te:
+.long	2774754246,2774754246
+.long	2222750968,2222750968
+.long	2574743534,2574743534
+.long	2373680118,2373680118
+.long	234025727,234025727
+.long	3177933782,3177933782
+.long	2976870366,2976870366
+.long	1422247313,1422247313
+.long	1345335392,1345335392
+.long	50397442,50397442
+.long	2842126286,2842126286
+.long	2099981142,2099981142
+.long	436141799,436141799
+.long	1658312629,1658312629
+.long	3870010189,3870010189
+.long	2591454956,2591454956
+.long	1170918031,1170918031
+.long	2642575903,2642575903
+.long	1086966153,1086966153
+.long	2273148410,2273148410
+.long	368769775,368769775
+.long	3948501426,3948501426
+.long	3376891790,3376891790
+.long	200339707,200339707
+.long	3970805057,3970805057
+.long	1742001331,1742001331
+.long	4255294047,4255294047
+.long	3937382213,3937382213
+.long	3214711843,3214711843
+.long	4154762323,4154762323
+.long	2524082916,2524082916
+.long	1539358875,1539358875
+.long	3266819957,3266819957
+.long	486407649,486407649
+.long	2928907069,2928907069
+.long	1780885068,1780885068
+.long	1513502316,1513502316
+.long	1094664062,1094664062
+.long	49805301,49805301
+.long	1338821763,1338821763
+.long	1546925160,1546925160
+.long	4104496465,4104496465
+.long	887481809,887481809
+.long	150073849,150073849
+.long	2473685474,2473685474
+.long	1943591083,1943591083
+.long	1395732834,1395732834
+.long	1058346282,1058346282
+.long	201589768,201589768
+.long	1388824469,1388824469
+.long	1696801606,1696801606
+.long	1589887901,1589887901
+.long	672667696,672667696
+.long	2711000631,2711000631
+.long	251987210,251987210
+.long	3046808111,3046808111
+.long	151455502,151455502
+.long	907153956,907153956
+.long	2608889883,2608889883
+.long	1038279391,1038279391
+.long	652995533,652995533
+.long	1764173646,1764173646
+.long	3451040383,3451040383
+.long	2675275242,2675275242
+.long	453576978,453576978
+.long	2659418909,2659418909
+.long	1949051992,1949051992
+.long	773462580,773462580
+.long	756751158,756751158
+.long	2993581788,2993581788
+.long	3998898868,3998898868
+.long	4221608027,4221608027
+.long	4132590244,4132590244
+.long	1295727478,1295727478
+.long	1641469623,1641469623
+.long	3467883389,3467883389
+.long	2066295122,2066295122
+.long	1055122397,1055122397
+.long	1898917726,1898917726
+.long	2542044179,2542044179
+.long	4115878822,4115878822
+.long	1758581177,1758581177
+.long	0,0
+.long	753790401,753790401
+.long	1612718144,1612718144
+.long	536673507,536673507
+.long	3367088505,3367088505
+.long	3982187446,3982187446
+.long	3194645204,3194645204
+.long	1187761037,1187761037
+.long	3653156455,3653156455
+.long	1262041458,1262041458
+.long	3729410708,3729410708
+.long	3561770136,3561770136
+.long	3898103984,3898103984
+.long	1255133061,1255133061
+.long	1808847035,1808847035
+.long	720367557,720367557
+.long	3853167183,3853167183
+.long	385612781,385612781
+.long	3309519750,3309519750
+.long	3612167578,3612167578
+.long	1429418854,1429418854
+.long	2491778321,2491778321
+.long	3477423498,3477423498
+.long	284817897,284817897
+.long	100794884,100794884
+.long	2172616702,2172616702
+.long	4031795360,4031795360
+.long	1144798328,1144798328
+.long	3131023141,3131023141
+.long	3819481163,3819481163
+.long	4082192802,4082192802
+.long	4272137053,4272137053
+.long	3225436288,3225436288
+.long	2324664069,2324664069
+.long	2912064063,2912064063
+.long	3164445985,3164445985
+.long	1211644016,1211644016
+.long	83228145,83228145
+.long	3753688163,3753688163
+.long	3249976951,3249976951
+.long	1977277103,1977277103
+.long	1663115586,1663115586
+.long	806359072,806359072
+.long	452984805,452984805
+.long	250868733,250868733
+.long	1842533055,1842533055
+.long	1288555905,1288555905
+.long	336333848,336333848
+.long	890442534,890442534
+.long	804056259,804056259
+.long	3781124030,3781124030
+.long	2727843637,2727843637
+.long	3427026056,3427026056
+.long	957814574,957814574
+.long	1472513171,1472513171
+.long	4071073621,4071073621
+.long	2189328124,2189328124
+.long	1195195770,1195195770
+.long	2892260552,2892260552
+.long	3881655738,3881655738
+.long	723065138,723065138
+.long	2507371494,2507371494
+.long	2690670784,2690670784
+.long	2558624025,2558624025
+.long	3511635870,3511635870
+.long	2145180835,2145180835
+.long	1713513028,1713513028
+.long	2116692564,2116692564
+.long	2878378043,2878378043
+.long	2206763019,2206763019
+.long	3393603212,3393603212
+.long	703524551,703524551
+.long	3552098411,3552098411
+.long	1007948840,1007948840
+.long	2044649127,2044649127
+.long	3797835452,3797835452
+.long	487262998,487262998
+.long	1994120109,1994120109
+.long	1004593371,1004593371
+.long	1446130276,1446130276
+.long	1312438900,1312438900
+.long	503974420,503974420
+.long	3679013266,3679013266
+.long	168166924,168166924
+.long	1814307912,1814307912
+.long	3831258296,3831258296
+.long	1573044895,1573044895
+.long	1859376061,1859376061
+.long	4021070915,4021070915
+.long	2791465668,2791465668
+.long	2828112185,2828112185
+.long	2761266481,2761266481
+.long	937747667,937747667
+.long	2339994098,2339994098
+.long	854058965,854058965
+.long	1137232011,1137232011
+.long	1496790894,1496790894
+.long	3077402074,3077402074
+.long	2358086913,2358086913
+.long	1691735473,1691735473
+.long	3528347292,3528347292
+.long	3769215305,3769215305
+.long	3027004632,3027004632
+.long	4199962284,4199962284
+.long	133494003,133494003
+.long	636152527,636152527
+.long	2942657994,2942657994
+.long	2390391540,2390391540
+.long	3920539207,3920539207
+.long	403179536,403179536
+.long	3585784431,3585784431
+.long	2289596656,2289596656
+.long	1864705354,1864705354
+.long	1915629148,1915629148
+.long	605822008,605822008
+.long	4054230615,4054230615
+.long	3350508659,3350508659
+.long	1371981463,1371981463
+.long	602466507,602466507
+.long	2094914977,2094914977
+.long	2624877800,2624877800
+.long	555687742,555687742
+.long	3712699286,3712699286
+.long	3703422305,3703422305
+.long	2257292045,2257292045
+.long	2240449039,2240449039
+.long	2423288032,2423288032
+.long	1111375484,1111375484
+.long	3300242801,3300242801
+.long	2858837708,2858837708
+.long	3628615824,3628615824
+.long	84083462,84083462
+.long	32962295,32962295
+.long	302911004,302911004
+.long	2741068226,2741068226
+.long	1597322602,1597322602
+.long	4183250862,4183250862
+.long	3501832553,3501832553
+.long	2441512471,2441512471
+.long	1489093017,1489093017
+.long	656219450,656219450
+.long	3114180135,3114180135
+.long	954327513,954327513
+.long	335083755,335083755
+.long	3013122091,3013122091
+.long	856756514,856756514
+.long	3144247762,3144247762
+.long	1893325225,1893325225
+.long	2307821063,2307821063
+.long	2811532339,2811532339
+.long	3063651117,3063651117
+.long	572399164,572399164
+.long	2458355477,2458355477
+.long	552200649,552200649
+.long	1238290055,1238290055
+.long	4283782570,4283782570
+.long	2015897680,2015897680
+.long	2061492133,2061492133
+.long	2408352771,2408352771
+.long	4171342169,4171342169
+.long	2156497161,2156497161
+.long	386731290,386731290
+.long	3669999461,3669999461
+.long	837215959,837215959
+.long	3326231172,3326231172
+.long	3093850320,3093850320
+.long	3275833730,3275833730
+.long	2962856233,2962856233
+.long	1999449434,1999449434
+.long	286199582,286199582
+.long	3417354363,3417354363
+.long	4233385128,4233385128
+.long	3602627437,3602627437
+.long	974525996,974525996
+.byte	99,124,119,123,242,107,111,197
+.byte	48,1,103,43,254,215,171,118
+.byte	202,130,201,125,250,89,71,240
+.byte	173,212,162,175,156,164,114,192
+.byte	183,253,147,38,54,63,247,204
+.byte	52,165,229,241,113,216,49,21
+.byte	4,199,35,195,24,150,5,154
+.byte	7,18,128,226,235,39,178,117
+.byte	9,131,44,26,27,110,90,160
+.byte	82,59,214,179,41,227,47,132
+.byte	83,209,0,237,32,252,177,91
+.byte	106,203,190,57,74,76,88,207
+.byte	208,239,170,251,67,77,51,133
+.byte	69,249,2,127,80,60,159,168
+.byte	81,163,64,143,146,157,56,245
+.byte	188,182,218,33,16,255,243,210
+.byte	205,12,19,236,95,151,68,23
+.byte	196,167,126,61,100,93,25,115
+.byte	96,129,79,220,34,42,144,136
+.byte	70,238,184,20,222,94,11,219
+.byte	224,50,58,10,73,6,36,92
+.byte	194,211,172,98,145,149,228,121
+.byte	231,200,55,109,141,213,78,169
+.byte	108,86,244,234,101,122,174,8
+.byte	186,120,37,46,28,166,180,198
+.byte	232,221,116,31,75,189,139,138
+.byte	112,62,181,102,72,3,246,14
+.byte	97,53,87,185,134,193,29,158
+.byte	225,248,152,17,105,217,142,148
+.byte	155,30,135,233,206,85,40,223
+.byte	140,161,137,13,191,230,66,104
+.byte	65,153,45,15,176,84,187,22
+.byte	99,124,119,123,242,107,111,197
+.byte	48,1,103,43,254,215,171,118
+.byte	202,130,201,125,250,89,71,240
+.byte	173,212,162,175,156,164,114,192
+.byte	183,253,147,38,54,63,247,204
+.byte	52,165,229,241,113,216,49,21
+.byte	4,199,35,195,24,150,5,154
+.byte	7,18,128,226,235,39,178,117
+.byte	9,131,44,26,27,110,90,160
+.byte	82,59,214,179,41,227,47,132
+.byte	83,209,0,237,32,252,177,91
+.byte	106,203,190,57,74,76,88,207
+.byte	208,239,170,251,67,77,51,133
+.byte	69,249,2,127,80,60,159,168
+.byte	81,163,64,143,146,157,56,245
+.byte	188,182,218,33,16,255,243,210
+.byte	205,12,19,236,95,151,68,23
+.byte	196,167,126,61,100,93,25,115
+.byte	96,129,79,220,34,42,144,136
+.byte	70,238,184,20,222,94,11,219
+.byte	224,50,58,10,73,6,36,92
+.byte	194,211,172,98,145,149,228,121
+.byte	231,200,55,109,141,213,78,169
+.byte	108,86,244,234,101,122,174,8
+.byte	186,120,37,46,28,166,180,198
+.byte	232,221,116,31,75,189,139,138
+.byte	112,62,181,102,72,3,246,14
+.byte	97,53,87,185,134,193,29,158
+.byte	225,248,152,17,105,217,142,148
+.byte	155,30,135,233,206,85,40,223
+.byte	140,161,137,13,191,230,66,104
+.byte	65,153,45,15,176,84,187,22
+.byte	99,124,119,123,242,107,111,197
+.byte	48,1,103,43,254,215,171,118
+.byte	202,130,201,125,250,89,71,240
+.byte	173,212,162,175,156,164,114,192
+.byte	183,253,147,38,54,63,247,204
+.byte	52,165,229,241,113,216,49,21
+.byte	4,199,35,195,24,150,5,154
+.byte	7,18,128,226,235,39,178,117
+.byte	9,131,44,26,27,110,90,160
+.byte	82,59,214,179,41,227,47,132
+.byte	83,209,0,237,32,252,177,91
+.byte	106,203,190,57,74,76,88,207
+.byte	208,239,170,251,67,77,51,133
+.byte	69,249,2,127,80,60,159,168
+.byte	81,163,64,143,146,157,56,245
+.byte	188,182,218,33,16,255,243,210
+.byte	205,12,19,236,95,151,68,23
+.byte	196,167,126,61,100,93,25,115
+.byte	96,129,79,220,34,42,144,136
+.byte	70,238,184,20,222,94,11,219
+.byte	224,50,58,10,73,6,36,92
+.byte	194,211,172,98,145,149,228,121
+.byte	231,200,55,109,141,213,78,169
+.byte	108,86,244,234,101,122,174,8
+.byte	186,120,37,46,28,166,180,198
+.byte	232,221,116,31,75,189,139,138
+.byte	112,62,181,102,72,3,246,14
+.byte	97,53,87,185,134,193,29,158
+.byte	225,248,152,17,105,217,142,148
+.byte	155,30,135,233,206,85,40,223
+.byte	140,161,137,13,191,230,66,104
+.byte	65,153,45,15,176,84,187,22
+.byte	99,124,119,123,242,107,111,197
+.byte	48,1,103,43,254,215,171,118
+.byte	202,130,201,125,250,89,71,240
+.byte	173,212,162,175,156,164,114,192
+.byte	183,253,147,38,54,63,247,204
+.byte	52,165,229,241,113,216,49,21
+.byte	4,199,35,195,24,150,5,154
+.byte	7,18,128,226,235,39,178,117
+.byte	9,131,44,26,27,110,90,160
+.byte	82,59,214,179,41,227,47,132
+.byte	83,209,0,237,32,252,177,91
+.byte	106,203,190,57,74,76,88,207
+.byte	208,239,170,251,67,77,51,133
+.byte	69,249,2,127,80,60,159,168
+.byte	81,163,64,143,146,157,56,245
+.byte	188,182,218,33,16,255,243,210
+.byte	205,12,19,236,95,151,68,23
+.byte	196,167,126,61,100,93,25,115
+.byte	96,129,79,220,34,42,144,136
+.byte	70,238,184,20,222,94,11,219
+.byte	224,50,58,10,73,6,36,92
+.byte	194,211,172,98,145,149,228,121
+.byte	231,200,55,109,141,213,78,169
+.byte	108,86,244,234,101,122,174,8
+.byte	186,120,37,46,28,166,180,198
+.byte	232,221,116,31,75,189,139,138
+.byte	112,62,181,102,72,3,246,14
+.byte	97,53,87,185,134,193,29,158
+.byte	225,248,152,17,105,217,142,148
+.byte	155,30,135,233,206,85,40,223
+.byte	140,161,137,13,191,230,66,104
+.byte	65,153,45,15,176,84,187,22
+.long	1,2,4,8
+.long	16,32,64,128
+.long	27,54,0,0
+.long	0,0,0,0
+.size	_x86_AES_encrypt,.-_x86_AES_encrypt
+.globl	asm_AES_encrypt
+.hidden	asm_AES_encrypt
+.type	asm_AES_encrypt,@function
+.align	16
+asm_AES_encrypt:
+.L_asm_AES_encrypt_begin:
+	pushl	%ebp
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+	movl	20(%esp),%esi
+	movl	28(%esp),%edi
+	movl	%esp,%eax
+	subl	$36,%esp
+	andl	$-64,%esp
+	leal	-127(%edi),%ebx
+	subl	%esp,%ebx
+	negl	%ebx
+	andl	$960,%ebx
+	subl	%ebx,%esp
+	addl	$4,%esp
+	movl	%eax,28(%esp)
+	call	.L004pic_point
+.L004pic_point:
+	popl	%ebp
+	leal	OPENSSL_ia32cap_P-.L004pic_point(%ebp),%eax
+	leal	.LAES_Te-.L004pic_point(%ebp),%ebp
+	leal	764(%esp),%ebx
+	subl	%ebp,%ebx
+	andl	$768,%ebx
+	leal	2176(%ebp,%ebx,1),%ebp
+	btl	$25,(%eax)
+	jnc	.L005x86
+	movq	(%esi),%mm0
+	movq	8(%esi),%mm4
+	call	_sse_AES_encrypt_compact
+	movl	28(%esp),%esp
+	movl	24(%esp),%esi
+	movq	%mm0,(%esi)
+	movq	%mm4,8(%esi)
+	emms
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.align	16
+.L005x86:
+	movl	%ebp,24(%esp)
+	movl	(%esi),%eax
+	movl	4(%esi),%ebx
+	movl	8(%esi),%ecx
+	movl	12(%esi),%edx
+	call	_x86_AES_encrypt_compact
+	movl	28(%esp),%esp
+	movl	24(%esp),%esi
+	movl	%eax,(%esi)
+	movl	%ebx,4(%esi)
+	movl	%ecx,8(%esi)
+	movl	%edx,12(%esi)
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.size	asm_AES_encrypt,.-.L_asm_AES_encrypt_begin
+.hidden	_x86_AES_decrypt_compact
+.type	_x86_AES_decrypt_compact,@function
+.align	16
+_x86_AES_decrypt_compact:
+	movl	%edi,20(%esp)
+	xorl	(%edi),%eax
+	xorl	4(%edi),%ebx
+	xorl	8(%edi),%ecx
+	xorl	12(%edi),%edx
+	movl	240(%edi),%esi
+	leal	-2(%esi,%esi,1),%esi
+	leal	(%edi,%esi,8),%esi
+	movl	%esi,24(%esp)
+	movl	-128(%ebp),%edi
+	movl	-96(%ebp),%esi
+	movl	-64(%ebp),%edi
+	movl	-32(%ebp),%esi
+	movl	(%ebp),%edi
+	movl	32(%ebp),%esi
+	movl	64(%ebp),%edi
+	movl	96(%ebp),%esi
+.align	16
+.L006loop:
+	movl	%eax,%esi
+	andl	$255,%esi
+	movzbl	-128(%ebp,%esi,1),%esi
+	movzbl	%dh,%edi
+	movzbl	-128(%ebp,%edi,1),%edi
+	shll	$8,%edi
+	xorl	%edi,%esi
+	movl	%ecx,%edi
+	shrl	$16,%edi
+	andl	$255,%edi
+	movzbl	-128(%ebp,%edi,1),%edi
+	shll	$16,%edi
+	xorl	%edi,%esi
+	movl	%ebx,%edi
+	shrl	$24,%edi
+	movzbl	-128(%ebp,%edi,1),%edi
+	shll	$24,%edi
+	xorl	%edi,%esi
+	movl	%esi,4(%esp)
+	movl	%ebx,%esi
+	andl	$255,%esi
+	movzbl	-128(%ebp,%esi,1),%esi
+	movzbl	%ah,%edi
+	movzbl	-128(%ebp,%edi,1),%edi
+	shll	$8,%edi
+	xorl	%edi,%esi
+	movl	%edx,%edi
+	shrl	$16,%edi
+	andl	$255,%edi
+	movzbl	-128(%ebp,%edi,1),%edi
+	shll	$16,%edi
+	xorl	%edi,%esi
+	movl	%ecx,%edi
+	shrl	$24,%edi
+	movzbl	-128(%ebp,%edi,1),%edi
+	shll	$24,%edi
+	xorl	%edi,%esi
+	movl	%esi,8(%esp)
+	movl	%ecx,%esi
+	andl	$255,%esi
+	movzbl	-128(%ebp,%esi,1),%esi
+	movzbl	%bh,%edi
+	movzbl	-128(%ebp,%edi,1),%edi
+	shll	$8,%edi
+	xorl	%edi,%esi
+	movl	%eax,%edi
+	shrl	$16,%edi
+	andl	$255,%edi
+	movzbl	-128(%ebp,%edi,1),%edi
+	shll	$16,%edi
+	xorl	%edi,%esi
+	movl	%edx,%edi
+	shrl	$24,%edi
+	movzbl	-128(%ebp,%edi,1),%edi
+	shll	$24,%edi
+	xorl	%edi,%esi
+	andl	$255,%edx
+	movzbl	-128(%ebp,%edx,1),%edx
+	movzbl	%ch,%ecx
+	movzbl	-128(%ebp,%ecx,1),%ecx
+	shll	$8,%ecx
+	xorl	%ecx,%edx
+	movl	%esi,%ecx
+	shrl	$16,%ebx
+	andl	$255,%ebx
+	movzbl	-128(%ebp,%ebx,1),%ebx
+	shll	$16,%ebx
+	xorl	%ebx,%edx
+	shrl	$24,%eax
+	movzbl	-128(%ebp,%eax,1),%eax
+	shll	$24,%eax
+	xorl	%eax,%edx
+	movl	$2155905152,%edi
+	andl	%ecx,%edi
+	movl	%edi,%esi
+	shrl	$7,%edi
+	leal	(%ecx,%ecx,1),%eax
+	subl	%edi,%esi
+	andl	$4278124286,%eax
+	andl	$454761243,%esi
+	xorl	%esi,%eax
+	movl	$2155905152,%edi
+	andl	%eax,%edi
+	movl	%edi,%esi
+	shrl	$7,%edi
+	leal	(%eax,%eax,1),%ebx
+	subl	%edi,%esi
+	andl	$4278124286,%ebx
+	andl	$454761243,%esi
+	xorl	%ecx,%eax
+	xorl	%esi,%ebx
+	movl	$2155905152,%edi
+	andl	%ebx,%edi
+	movl	%edi,%esi
+	shrl	$7,%edi
+	leal	(%ebx,%ebx,1),%ebp
+	subl	%edi,%esi
+	andl	$4278124286,%ebp
+	andl	$454761243,%esi
+	xorl	%ecx,%ebx
+	roll	$8,%ecx
+	xorl	%esi,%ebp
+	xorl	%eax,%ecx
+	xorl	%ebp,%eax
+	xorl	%ebx,%ecx
+	xorl	%ebp,%ebx
+	roll	$24,%eax
+	xorl	%ebp,%ecx
+	roll	$16,%ebx
+	xorl	%eax,%ecx
+	roll	$8,%ebp
+	xorl	%ebx,%ecx
+	movl	4(%esp),%eax
+	xorl	%ebp,%ecx
+	movl	%ecx,12(%esp)
+	movl	$2155905152,%edi
+	andl	%edx,%edi
+	movl	%edi,%esi
+	shrl	$7,%edi
+	leal	(%edx,%edx,1),%ebx
+	subl	%edi,%esi
+	andl	$4278124286,%ebx
+	andl	$454761243,%esi
+	xorl	%esi,%ebx
+	movl	$2155905152,%edi
+	andl	%ebx,%edi
+	movl	%edi,%esi
+	shrl	$7,%edi
+	leal	(%ebx,%ebx,1),%ecx
+	subl	%edi,%esi
+	andl	$4278124286,%ecx
+	andl	$454761243,%esi
+	xorl	%edx,%ebx
+	xorl	%esi,%ecx
+	movl	$2155905152,%edi
+	andl	%ecx,%edi
+	movl	%edi,%esi
+	shrl	$7,%edi
+	leal	(%ecx,%ecx,1),%ebp
+	subl	%edi,%esi
+	andl	$4278124286,%ebp
+	andl	$454761243,%esi
+	xorl	%edx,%ecx
+	roll	$8,%edx
+	xorl	%esi,%ebp
+	xorl	%ebx,%edx
+	xorl	%ebp,%ebx
+	xorl	%ecx,%edx
+	xorl	%ebp,%ecx
+	roll	$24,%ebx
+	xorl	%ebp,%edx
+	roll	$16,%ecx
+	xorl	%ebx,%edx
+	roll	$8,%ebp
+	xorl	%ecx,%edx
+	movl	8(%esp),%ebx
+	xorl	%ebp,%edx
+	movl	%edx,16(%esp)
+	movl	$2155905152,%edi
+	andl	%eax,%edi
+	movl	%edi,%esi
+	shrl	$7,%edi
+	leal	(%eax,%eax,1),%ecx
+	subl	%edi,%esi
+	andl	$4278124286,%ecx
+	andl	$454761243,%esi
+	xorl	%esi,%ecx
+	movl	$2155905152,%edi
+	andl	%ecx,%edi
+	movl	%edi,%esi
+	shrl	$7,%edi
+	leal	(%ecx,%ecx,1),%edx
+	subl	%edi,%esi
+	andl	$4278124286,%edx
+	andl	$454761243,%esi
+	xorl	%eax,%ecx
+	xorl	%esi,%edx
+	movl	$2155905152,%edi
+	andl	%edx,%edi
+	movl	%edi,%esi
+	shrl	$7,%edi
+	leal	(%edx,%edx,1),%ebp
+	subl	%edi,%esi
+	andl	$4278124286,%ebp
+	andl	$454761243,%esi
+	xorl	%eax,%edx
+	roll	$8,%eax
+	xorl	%esi,%ebp
+	xorl	%ecx,%eax
+	xorl	%ebp,%ecx
+	xorl	%edx,%eax
+	xorl	%ebp,%edx
+	roll	$24,%ecx
+	xorl	%ebp,%eax
+	roll	$16,%edx
+	xorl	%ecx,%eax
+	roll	$8,%ebp
+	xorl	%edx,%eax
+	xorl	%ebp,%eax
+	movl	$2155905152,%edi
+	andl	%ebx,%edi
+	movl	%edi,%esi
+	shrl	$7,%edi
+	leal	(%ebx,%ebx,1),%ecx
+	subl	%edi,%esi
+	andl	$4278124286,%ecx
+	andl	$454761243,%esi
+	xorl	%esi,%ecx
+	movl	$2155905152,%edi
+	andl	%ecx,%edi
+	movl	%edi,%esi
+	shrl	$7,%edi
+	leal	(%ecx,%ecx,1),%edx
+	subl	%edi,%esi
+	andl	$4278124286,%edx
+	andl	$454761243,%esi
+	xorl	%ebx,%ecx
+	xorl	%esi,%edx
+	movl	$2155905152,%edi
+	andl	%edx,%edi
+	movl	%edi,%esi
+	shrl	$7,%edi
+	leal	(%edx,%edx,1),%ebp
+	subl	%edi,%esi
+	andl	$4278124286,%ebp
+	andl	$454761243,%esi
+	xorl	%ebx,%edx
+	roll	$8,%ebx
+	xorl	%esi,%ebp
+	xorl	%ecx,%ebx
+	xorl	%ebp,%ecx
+	xorl	%edx,%ebx
+	xorl	%ebp,%edx
+	roll	$24,%ecx
+	xorl	%ebp,%ebx
+	roll	$16,%edx
+	xorl	%ecx,%ebx
+	roll	$8,%ebp
+	xorl	%edx,%ebx
+	movl	12(%esp),%ecx
+	xorl	%ebp,%ebx
+	movl	16(%esp),%edx
+	movl	20(%esp),%edi
+	movl	28(%esp),%ebp
+	addl	$16,%edi
+	xorl	(%edi),%eax
+	xorl	4(%edi),%ebx
+	xorl	8(%edi),%ecx
+	xorl	12(%edi),%edx
+	cmpl	24(%esp),%edi
+	movl	%edi,20(%esp)
+	jb	.L006loop
+	movl	%eax,%esi
+	andl	$255,%esi
+	movzbl	-128(%ebp,%esi,1),%esi
+	movzbl	%dh,%edi
+	movzbl	-128(%ebp,%edi,1),%edi
+	shll	$8,%edi
+	xorl	%edi,%esi
+	movl	%ecx,%edi
+	shrl	$16,%edi
+	andl	$255,%edi
+	movzbl	-128(%ebp,%edi,1),%edi
+	shll	$16,%edi
+	xorl	%edi,%esi
+	movl	%ebx,%edi
+	shrl	$24,%edi
+	movzbl	-128(%ebp,%edi,1),%edi
+	shll	$24,%edi
+	xorl	%edi,%esi
+	movl	%esi,4(%esp)
+	movl	%ebx,%esi
+	andl	$255,%esi
+	movzbl	-128(%ebp,%esi,1),%esi
+	movzbl	%ah,%edi
+	movzbl	-128(%ebp,%edi,1),%edi
+	shll	$8,%edi
+	xorl	%edi,%esi
+	movl	%edx,%edi
+	shrl	$16,%edi
+	andl	$255,%edi
+	movzbl	-128(%ebp,%edi,1),%edi
+	shll	$16,%edi
+	xorl	%edi,%esi
+	movl	%ecx,%edi
+	shrl	$24,%edi
+	movzbl	-128(%ebp,%edi,1),%edi
+	shll	$24,%edi
+	xorl	%edi,%esi
+	movl	%esi,8(%esp)
+	movl	%ecx,%esi
+	andl	$255,%esi
+	movzbl	-128(%ebp,%esi,1),%esi
+	movzbl	%bh,%edi
+	movzbl	-128(%ebp,%edi,1),%edi
+	shll	$8,%edi
+	xorl	%edi,%esi
+	movl	%eax,%edi
+	shrl	$16,%edi
+	andl	$255,%edi
+	movzbl	-128(%ebp,%edi,1),%edi
+	shll	$16,%edi
+	xorl	%edi,%esi
+	movl	%edx,%edi
+	shrl	$24,%edi
+	movzbl	-128(%ebp,%edi,1),%edi
+	shll	$24,%edi
+	xorl	%edi,%esi
+	movl	20(%esp),%edi
+	andl	$255,%edx
+	movzbl	-128(%ebp,%edx,1),%edx
+	movzbl	%ch,%ecx
+	movzbl	-128(%ebp,%ecx,1),%ecx
+	shll	$8,%ecx
+	xorl	%ecx,%edx
+	movl	%esi,%ecx
+	shrl	$16,%ebx
+	andl	$255,%ebx
+	movzbl	-128(%ebp,%ebx,1),%ebx
+	shll	$16,%ebx
+	xorl	%ebx,%edx
+	movl	8(%esp),%ebx
+	shrl	$24,%eax
+	movzbl	-128(%ebp,%eax,1),%eax
+	shll	$24,%eax
+	xorl	%eax,%edx
+	movl	4(%esp),%eax
+	xorl	16(%edi),%eax
+	xorl	20(%edi),%ebx
+	xorl	24(%edi),%ecx
+	xorl	28(%edi),%edx
+	ret
+.size	_x86_AES_decrypt_compact,.-_x86_AES_decrypt_compact
+.hidden	_sse_AES_decrypt_compact
+.type	_sse_AES_decrypt_compact,@function
+.align	16
+_sse_AES_decrypt_compact:
+	pxor	(%edi),%mm0
+	pxor	8(%edi),%mm4
+	movl	240(%edi),%esi
+	leal	-2(%esi,%esi,1),%esi
+	leal	(%edi,%esi,8),%esi
+	movl	%esi,24(%esp)
+	movl	$454761243,%eax
+	movl	%eax,8(%esp)
+	movl	%eax,12(%esp)
+	movl	-128(%ebp),%eax
+	movl	-96(%ebp),%ebx
+	movl	-64(%ebp),%ecx
+	movl	-32(%ebp),%edx
+	movl	(%ebp),%eax
+	movl	32(%ebp),%ebx
+	movl	64(%ebp),%ecx
+	movl	96(%ebp),%edx
+.align	16
+.L007loop:
+	pshufw	$12,%mm0,%mm1
+	pshufw	$9,%mm4,%mm5
+	movd	%mm1,%eax
+	movd	%mm5,%ebx
+	movl	%edi,20(%esp)
+	movzbl	%al,%esi
+	movzbl	%ah,%edx
+	pshufw	$6,%mm0,%mm2
+	movzbl	-128(%ebp,%esi,1),%ecx
+	movzbl	%bl,%edi
+	movzbl	-128(%ebp,%edx,1),%edx
+	shrl	$16,%eax
+	shll	$8,%edx
+	movzbl	-128(%ebp,%edi,1),%esi
+	movzbl	%bh,%edi
+	shll	$16,%esi
+	pshufw	$3,%mm4,%mm6
+	orl	%esi,%ecx
+	movzbl	-128(%ebp,%edi,1),%esi
+	movzbl	%ah,%edi
+	shll	$24,%esi
+	shrl	$16,%ebx
+	orl	%esi,%edx
+	movzbl	-128(%ebp,%edi,1),%esi
+	movzbl	%bh,%edi
+	shll	$24,%esi
+	orl	%esi,%ecx
+	movzbl	-128(%ebp,%edi,1),%esi
+	movzbl	%al,%edi
+	shll	$8,%esi
+	movd	%mm2,%eax
+	orl	%esi,%ecx
+	movzbl	-128(%ebp,%edi,1),%esi
+	movzbl	%bl,%edi
+	shll	$16,%esi
+	movd	%mm6,%ebx
+	movd	%ecx,%mm0
+	movzbl	-128(%ebp,%edi,1),%ecx
+	movzbl	%al,%edi
+	orl	%esi,%ecx
+	movzbl	-128(%ebp,%edi,1),%esi
+	movzbl	%bl,%edi
+	orl	%esi,%edx
+	movzbl	-128(%ebp,%edi,1),%esi
+	movzbl	%ah,%edi
+	shll	$16,%esi
+	shrl	$16,%eax
+	orl	%esi,%edx
+	movzbl	-128(%ebp,%edi,1),%esi
+	movzbl	%bh,%edi
+	shrl	$16,%ebx
+	shll	$8,%esi
+	movd	%edx,%mm1
+	movzbl	-128(%ebp,%edi,1),%edx
+	movzbl	%bh,%edi
+	shll	$24,%edx
+	andl	$255,%ebx
+	orl	%esi,%edx
+	punpckldq	%mm1,%mm0
+	movzbl	-128(%ebp,%edi,1),%esi
+	movzbl	%al,%edi
+	shll	$8,%esi
+	movzbl	%ah,%eax
+	movzbl	-128(%ebp,%ebx,1),%ebx
+	orl	%esi,%ecx
+	movzbl	-128(%ebp,%edi,1),%esi
+	orl	%ebx,%edx
+	shll	$16,%esi
+	movzbl	-128(%ebp,%eax,1),%eax
+	orl	%esi,%edx
+	shll	$24,%eax
+	orl	%eax,%ecx
+	movl	20(%esp),%edi
+	movd	%edx,%mm4
+	movd	%ecx,%mm5
+	punpckldq	%mm5,%mm4
+	addl	$16,%edi
+	cmpl	24(%esp),%edi
+	ja	.L008out
+	movq	%mm0,%mm3
+	movq	%mm4,%mm7
+	pshufw	$228,%mm0,%mm2
+	pshufw	$228,%mm4,%mm6
+	movq	%mm0,%mm1
+	movq	%mm4,%mm5
+	pshufw	$177,%mm0,%mm0
+	pshufw	$177,%mm4,%mm4
+	pslld	$8,%mm2
+	pslld	$8,%mm6
+	psrld	$8,%mm3
+	psrld	$8,%mm7
+	pxor	%mm2,%mm0
+	pxor	%mm6,%mm4
+	pxor	%mm3,%mm0
+	pxor	%mm7,%mm4
+	pslld	$16,%mm2
+	pslld	$16,%mm6
+	psrld	$16,%mm3
+	psrld	$16,%mm7
+	pxor	%mm2,%mm0
+	pxor	%mm6,%mm4
+	pxor	%mm3,%mm0
+	pxor	%mm7,%mm4
+	movq	8(%esp),%mm3
+	pxor	%mm2,%mm2
+	pxor	%mm6,%mm6
+	pcmpgtb	%mm1,%mm2
+	pcmpgtb	%mm5,%mm6
+	pand	%mm3,%mm2
+	pand	%mm3,%mm6
+	paddb	%mm1,%mm1
+	paddb	%mm5,%mm5
+	pxor	%mm2,%mm1
+	pxor	%mm6,%mm5
+	movq	%mm1,%mm3
+	movq	%mm5,%mm7
+	movq	%mm1,%mm2
+	movq	%mm5,%mm6
+	pxor	%mm1,%mm0
+	pxor	%mm5,%mm4
+	pslld	$24,%mm3
+	pslld	$24,%mm7
+	psrld	$8,%mm2
+	psrld	$8,%mm6
+	pxor	%mm3,%mm0
+	pxor	%mm7,%mm4
+	pxor	%mm2,%mm0
+	pxor	%mm6,%mm4
+	movq	8(%esp),%mm2
+	pxor	%mm3,%mm3
+	pxor	%mm7,%mm7
+	pcmpgtb	%mm1,%mm3
+	pcmpgtb	%mm5,%mm7
+	pand	%mm2,%mm3
+	pand	%mm2,%mm7
+	paddb	%mm1,%mm1
+	paddb	%mm5,%mm5
+	pxor	%mm3,%mm1
+	pxor	%mm7,%mm5
+	pshufw	$177,%mm1,%mm3
+	pshufw	$177,%mm5,%mm7
+	pxor	%mm1,%mm0
+	pxor	%mm5,%mm4
+	pxor	%mm3,%mm0
+	pxor	%mm7,%mm4
+	pxor	%mm3,%mm3
+	pxor	%mm7,%mm7
+	pcmpgtb	%mm1,%mm3
+	pcmpgtb	%mm5,%mm7
+	pand	%mm2,%mm3
+	pand	%mm2,%mm7
+	paddb	%mm1,%mm1
+	paddb	%mm5,%mm5
+	pxor	%mm3,%mm1
+	pxor	%mm7,%mm5
+	pxor	%mm1,%mm0
+	pxor	%mm5,%mm4
+	movq	%mm1,%mm3
+	movq	%mm5,%mm7
+	pshufw	$177,%mm1,%mm2
+	pshufw	$177,%mm5,%mm6
+	pxor	%mm2,%mm0
+	pxor	%mm6,%mm4
+	pslld	$8,%mm1
+	pslld	$8,%mm5
+	psrld	$8,%mm3
+	psrld	$8,%mm7
+	movq	(%edi),%mm2
+	movq	8(%edi),%mm6
+	pxor	%mm1,%mm0
+	pxor	%mm5,%mm4
+	pxor	%mm3,%mm0
+	pxor	%mm7,%mm4
+	movl	-128(%ebp),%eax
+	pslld	$16,%mm1
+	pslld	$16,%mm5
+	movl	-64(%ebp),%ebx
+	psrld	$16,%mm3
+	psrld	$16,%mm7
+	movl	(%ebp),%ecx
+	pxor	%mm1,%mm0
+	pxor	%mm5,%mm4
+	movl	64(%ebp),%edx
+	pxor	%mm3,%mm0
+	pxor	%mm7,%mm4
+	pxor	%mm2,%mm0
+	pxor	%mm6,%mm4
+	jmp	.L007loop
+.align	16
+.L008out:
+	pxor	(%edi),%mm0
+	pxor	8(%edi),%mm4
+	ret
+.size	_sse_AES_decrypt_compact,.-_sse_AES_decrypt_compact
+.hidden	_x86_AES_decrypt
+.type	_x86_AES_decrypt,@function
+.align	16
+_x86_AES_decrypt:
+	movl	%edi,20(%esp)
+	xorl	(%edi),%eax
+	xorl	4(%edi),%ebx
+	xorl	8(%edi),%ecx
+	xorl	12(%edi),%edx
+	movl	240(%edi),%esi
+	leal	-2(%esi,%esi,1),%esi
+	leal	(%edi,%esi,8),%esi
+	movl	%esi,24(%esp)
+.align	16
+.L009loop:
+	movl	%eax,%esi
+	andl	$255,%esi
+	movl	(%ebp,%esi,8),%esi
+	movzbl	%dh,%edi
+	xorl	3(%ebp,%edi,8),%esi
+	movl	%ecx,%edi
+	shrl	$16,%edi
+	andl	$255,%edi
+	xorl	2(%ebp,%edi,8),%esi
+	movl	%ebx,%edi
+	shrl	$24,%edi
+	xorl	1(%ebp,%edi,8),%esi
+	movl	%esi,4(%esp)
+
+	movl	%ebx,%esi
+	andl	$255,%esi
+	movl	(%ebp,%esi,8),%esi
+	movzbl	%ah,%edi
+	xorl	3(%ebp,%edi,8),%esi
+	movl	%edx,%edi
+	shrl	$16,%edi
+	andl	$255,%edi
+	xorl	2(%ebp,%edi,8),%esi
+	movl	%ecx,%edi
+	shrl	$24,%edi
+	xorl	1(%ebp,%edi,8),%esi
+	movl	%esi,8(%esp)
+
+	movl	%ecx,%esi
+	andl	$255,%esi
+	movl	(%ebp,%esi,8),%esi
+	movzbl	%bh,%edi
+	xorl	3(%ebp,%edi,8),%esi
+	movl	%eax,%edi
+	shrl	$16,%edi
+	andl	$255,%edi
+	xorl	2(%ebp,%edi,8),%esi
+	movl	%edx,%edi
+	shrl	$24,%edi
+	xorl	1(%ebp,%edi,8),%esi
+
+	movl	20(%esp),%edi
+	andl	$255,%edx
+	movl	(%ebp,%edx,8),%edx
+	movzbl	%ch,%ecx
+	xorl	3(%ebp,%ecx,8),%edx
+	movl	%esi,%ecx
+	shrl	$16,%ebx
+	andl	$255,%ebx
+	xorl	2(%ebp,%ebx,8),%edx
+	movl	8(%esp),%ebx
+	shrl	$24,%eax
+	xorl	1(%ebp,%eax,8),%edx
+	movl	4(%esp),%eax
+
+	addl	$16,%edi
+	xorl	(%edi),%eax
+	xorl	4(%edi),%ebx
+	xorl	8(%edi),%ecx
+	xorl	12(%edi),%edx
+	cmpl	24(%esp),%edi
+	movl	%edi,20(%esp)
+	jb	.L009loop
+	leal	2176(%ebp),%ebp
+	movl	-128(%ebp),%edi
+	movl	-96(%ebp),%esi
+	movl	-64(%ebp),%edi
+	movl	-32(%ebp),%esi
+	movl	(%ebp),%edi
+	movl	32(%ebp),%esi
+	movl	64(%ebp),%edi
+	movl	96(%ebp),%esi
+	leal	-128(%ebp),%ebp
+	movl	%eax,%esi
+	andl	$255,%esi
+	movzbl	(%ebp,%esi,1),%esi
+	movzbl	%dh,%edi
+	movzbl	(%ebp,%edi,1),%edi
+	shll	$8,%edi
+	xorl	%edi,%esi
+	movl	%ecx,%edi
+	shrl	$16,%edi
+	andl	$255,%edi
+	movzbl	(%ebp,%edi,1),%edi
+	shll	$16,%edi
+	xorl	%edi,%esi
+	movl	%ebx,%edi
+	shrl	$24,%edi
+	movzbl	(%ebp,%edi,1),%edi
+	shll	$24,%edi
+	xorl	%edi,%esi
+	movl	%esi,4(%esp)
+	movl	%ebx,%esi
+	andl	$255,%esi
+	movzbl	(%ebp,%esi,1),%esi
+	movzbl	%ah,%edi
+	movzbl	(%ebp,%edi,1),%edi
+	shll	$8,%edi
+	xorl	%edi,%esi
+	movl	%edx,%edi
+	shrl	$16,%edi
+	andl	$255,%edi
+	movzbl	(%ebp,%edi,1),%edi
+	shll	$16,%edi
+	xorl	%edi,%esi
+	movl	%ecx,%edi
+	shrl	$24,%edi
+	movzbl	(%ebp,%edi,1),%edi
+	shll	$24,%edi
+	xorl	%edi,%esi
+	movl	%esi,8(%esp)
+	movl	%ecx,%esi
+	andl	$255,%esi
+	movzbl	(%ebp,%esi,1),%esi
+	movzbl	%bh,%edi
+	movzbl	(%ebp,%edi,1),%edi
+	shll	$8,%edi
+	xorl	%edi,%esi
+	movl	%eax,%edi
+	shrl	$16,%edi
+	andl	$255,%edi
+	movzbl	(%ebp,%edi,1),%edi
+	shll	$16,%edi
+	xorl	%edi,%esi
+	movl	%edx,%edi
+	shrl	$24,%edi
+	movzbl	(%ebp,%edi,1),%edi
+	shll	$24,%edi
+	xorl	%edi,%esi
+	movl	20(%esp),%edi
+	andl	$255,%edx
+	movzbl	(%ebp,%edx,1),%edx
+	movzbl	%ch,%ecx
+	movzbl	(%ebp,%ecx,1),%ecx
+	shll	$8,%ecx
+	xorl	%ecx,%edx
+	movl	%esi,%ecx
+	shrl	$16,%ebx
+	andl	$255,%ebx
+	movzbl	(%ebp,%ebx,1),%ebx
+	shll	$16,%ebx
+	xorl	%ebx,%edx
+	movl	8(%esp),%ebx
+	shrl	$24,%eax
+	movzbl	(%ebp,%eax,1),%eax
+	shll	$24,%eax
+	xorl	%eax,%edx
+	movl	4(%esp),%eax
+	leal	-2048(%ebp),%ebp
+	addl	$16,%edi
+	xorl	(%edi),%eax
+	xorl	4(%edi),%ebx
+	xorl	8(%edi),%ecx
+	xorl	12(%edi),%edx
+	ret
+.align	64
+.LAES_Td:
+.long	1353184337,1353184337
+.long	1399144830,1399144830
+.long	3282310938,3282310938
+.long	2522752826,2522752826
+.long	3412831035,3412831035
+.long	4047871263,4047871263
+.long	2874735276,2874735276
+.long	2466505547,2466505547
+.long	1442459680,1442459680
+.long	4134368941,4134368941
+.long	2440481928,2440481928
+.long	625738485,625738485
+.long	4242007375,4242007375
+.long	3620416197,3620416197
+.long	2151953702,2151953702
+.long	2409849525,2409849525
+.long	1230680542,1230680542
+.long	1729870373,1729870373
+.long	2551114309,2551114309
+.long	3787521629,3787521629
+.long	41234371,41234371
+.long	317738113,317738113
+.long	2744600205,2744600205
+.long	3338261355,3338261355
+.long	3881799427,3881799427
+.long	2510066197,2510066197
+.long	3950669247,3950669247
+.long	3663286933,3663286933
+.long	763608788,763608788
+.long	3542185048,3542185048
+.long	694804553,694804553
+.long	1154009486,1154009486
+.long	1787413109,1787413109
+.long	2021232372,2021232372
+.long	1799248025,1799248025
+.long	3715217703,3715217703
+.long	3058688446,3058688446
+.long	397248752,397248752
+.long	1722556617,1722556617
+.long	3023752829,3023752829
+.long	407560035,407560035
+.long	2184256229,2184256229
+.long	1613975959,1613975959
+.long	1165972322,1165972322
+.long	3765920945,3765920945
+.long	2226023355,2226023355
+.long	480281086,480281086
+.long	2485848313,2485848313
+.long	1483229296,1483229296
+.long	436028815,436028815
+.long	2272059028,2272059028
+.long	3086515026,3086515026
+.long	601060267,601060267
+.long	3791801202,3791801202
+.long	1468997603,1468997603
+.long	715871590,715871590
+.long	120122290,120122290
+.long	63092015,63092015
+.long	2591802758,2591802758
+.long	2768779219,2768779219
+.long	4068943920,4068943920
+.long	2997206819,2997206819
+.long	3127509762,3127509762
+.long	1552029421,1552029421
+.long	723308426,723308426
+.long	2461301159,2461301159
+.long	4042393587,4042393587
+.long	2715969870,2715969870
+.long	3455375973,3455375973
+.long	3586000134,3586000134
+.long	526529745,526529745
+.long	2331944644,2331944644
+.long	2639474228,2639474228
+.long	2689987490,2689987490
+.long	853641733,853641733
+.long	1978398372,1978398372
+.long	971801355,971801355
+.long	2867814464,2867814464
+.long	111112542,111112542
+.long	1360031421,1360031421
+.long	4186579262,4186579262
+.long	1023860118,1023860118
+.long	2919579357,2919579357
+.long	1186850381,1186850381
+.long	3045938321,3045938321
+.long	90031217,90031217
+.long	1876166148,1876166148
+.long	4279586912,4279586912
+.long	620468249,620468249
+.long	2548678102,2548678102
+.long	3426959497,3426959497
+.long	2006899047,2006899047
+.long	3175278768,3175278768
+.long	2290845959,2290845959
+.long	945494503,945494503
+.long	3689859193,3689859193
+.long	1191869601,1191869601
+.long	3910091388,3910091388
+.long	3374220536,3374220536
+.long	0,0
+.long	2206629897,2206629897
+.long	1223502642,1223502642
+.long	2893025566,2893025566
+.long	1316117100,1316117100
+.long	4227796733,4227796733
+.long	1446544655,1446544655
+.long	517320253,517320253
+.long	658058550,658058550
+.long	1691946762,1691946762
+.long	564550760,564550760
+.long	3511966619,3511966619
+.long	976107044,976107044
+.long	2976320012,2976320012
+.long	266819475,266819475
+.long	3533106868,3533106868
+.long	2660342555,2660342555
+.long	1338359936,1338359936
+.long	2720062561,2720062561
+.long	1766553434,1766553434
+.long	370807324,370807324
+.long	179999714,179999714
+.long	3844776128,3844776128
+.long	1138762300,1138762300
+.long	488053522,488053522
+.long	185403662,185403662
+.long	2915535858,2915535858
+.long	3114841645,3114841645
+.long	3366526484,3366526484
+.long	2233069911,2233069911
+.long	1275557295,1275557295
+.long	3151862254,3151862254
+.long	4250959779,4250959779
+.long	2670068215,2670068215
+.long	3170202204,3170202204
+.long	3309004356,3309004356
+.long	880737115,880737115
+.long	1982415755,1982415755
+.long	3703972811,3703972811
+.long	1761406390,1761406390
+.long	1676797112,1676797112
+.long	3403428311,3403428311
+.long	277177154,277177154
+.long	1076008723,1076008723
+.long	538035844,538035844
+.long	2099530373,2099530373
+.long	4164795346,4164795346
+.long	288553390,288553390
+.long	1839278535,1839278535
+.long	1261411869,1261411869
+.long	4080055004,4080055004
+.long	3964831245,3964831245
+.long	3504587127,3504587127
+.long	1813426987,1813426987
+.long	2579067049,2579067049
+.long	4199060497,4199060497
+.long	577038663,577038663
+.long	3297574056,3297574056
+.long	440397984,440397984
+.long	3626794326,3626794326
+.long	4019204898,4019204898
+.long	3343796615,3343796615
+.long	3251714265,3251714265
+.long	4272081548,4272081548
+.long	906744984,906744984
+.long	3481400742,3481400742
+.long	685669029,685669029
+.long	646887386,646887386
+.long	2764025151,2764025151
+.long	3835509292,3835509292
+.long	227702864,227702864
+.long	2613862250,2613862250
+.long	1648787028,1648787028
+.long	3256061430,3256061430
+.long	3904428176,3904428176
+.long	1593260334,1593260334
+.long	4121936770,4121936770
+.long	3196083615,3196083615
+.long	2090061929,2090061929
+.long	2838353263,2838353263
+.long	3004310991,3004310991
+.long	999926984,999926984
+.long	2809993232,2809993232
+.long	1852021992,1852021992
+.long	2075868123,2075868123
+.long	158869197,158869197
+.long	4095236462,4095236462
+.long	28809964,28809964
+.long	2828685187,2828685187
+.long	1701746150,1701746150
+.long	2129067946,2129067946
+.long	147831841,147831841
+.long	3873969647,3873969647
+.long	3650873274,3650873274
+.long	3459673930,3459673930
+.long	3557400554,3557400554
+.long	3598495785,3598495785
+.long	2947720241,2947720241
+.long	824393514,824393514
+.long	815048134,815048134
+.long	3227951669,3227951669
+.long	935087732,935087732
+.long	2798289660,2798289660
+.long	2966458592,2966458592
+.long	366520115,366520115
+.long	1251476721,1251476721
+.long	4158319681,4158319681
+.long	240176511,240176511
+.long	804688151,804688151
+.long	2379631990,2379631990
+.long	1303441219,1303441219
+.long	1414376140,1414376140
+.long	3741619940,3741619940
+.long	3820343710,3820343710
+.long	461924940,461924940
+.long	3089050817,3089050817
+.long	2136040774,2136040774
+.long	82468509,82468509
+.long	1563790337,1563790337
+.long	1937016826,1937016826
+.long	776014843,776014843
+.long	1511876531,1511876531
+.long	1389550482,1389550482
+.long	861278441,861278441
+.long	323475053,323475053
+.long	2355222426,2355222426
+.long	2047648055,2047648055
+.long	2383738969,2383738969
+.long	2302415851,2302415851
+.long	3995576782,3995576782
+.long	902390199,902390199
+.long	3991215329,3991215329
+.long	1018251130,1018251130
+.long	1507840668,1507840668
+.long	1064563285,1064563285
+.long	2043548696,2043548696
+.long	3208103795,3208103795
+.long	3939366739,3939366739
+.long	1537932639,1537932639
+.long	342834655,342834655
+.long	2262516856,2262516856
+.long	2180231114,2180231114
+.long	1053059257,1053059257
+.long	741614648,741614648
+.long	1598071746,1598071746
+.long	1925389590,1925389590
+.long	203809468,203809468
+.long	2336832552,2336832552
+.long	1100287487,1100287487
+.long	1895934009,1895934009
+.long	3736275976,3736275976
+.long	2632234200,2632234200
+.long	2428589668,2428589668
+.long	1636092795,1636092795
+.long	1890988757,1890988757
+.long	1952214088,1952214088
+.long	1113045200,1113045200
+.byte	82,9,106,213,48,54,165,56
+.byte	191,64,163,158,129,243,215,251
+.byte	124,227,57,130,155,47,255,135
+.byte	52,142,67,68,196,222,233,203
+.byte	84,123,148,50,166,194,35,61
+.byte	238,76,149,11,66,250,195,78
+.byte	8,46,161,102,40,217,36,178
+.byte	118,91,162,73,109,139,209,37
+.byte	114,248,246,100,134,104,152,22
+.byte	212,164,92,204,93,101,182,146
+.byte	108,112,72,80,253,237,185,218
+.byte	94,21,70,87,167,141,157,132
+.byte	144,216,171,0,140,188,211,10
+.byte	247,228,88,5,184,179,69,6
+.byte	208,44,30,143,202,63,15,2
+.byte	193,175,189,3,1,19,138,107
+.byte	58,145,17,65,79,103,220,234
+.byte	151,242,207,206,240,180,230,115
+.byte	150,172,116,34,231,173,53,133
+.byte	226,249,55,232,28,117,223,110
+.byte	71,241,26,113,29,41,197,137
+.byte	111,183,98,14,170,24,190,27
+.byte	252,86,62,75,198,210,121,32
+.byte	154,219,192,254,120,205,90,244
+.byte	31,221,168,51,136,7,199,49
+.byte	177,18,16,89,39,128,236,95
+.byte	96,81,127,169,25,181,74,13
+.byte	45,229,122,159,147,201,156,239
+.byte	160,224,59,77,174,42,245,176
+.byte	200,235,187,60,131,83,153,97
+.byte	23,43,4,126,186,119,214,38
+.byte	225,105,20,99,85,33,12,125
+.byte	82,9,106,213,48,54,165,56
+.byte	191,64,163,158,129,243,215,251
+.byte	124,227,57,130,155,47,255,135
+.byte	52,142,67,68,196,222,233,203
+.byte	84,123,148,50,166,194,35,61
+.byte	238,76,149,11,66,250,195,78
+.byte	8,46,161,102,40,217,36,178
+.byte	118,91,162,73,109,139,209,37
+.byte	114,248,246,100,134,104,152,22
+.byte	212,164,92,204,93,101,182,146
+.byte	108,112,72,80,253,237,185,218
+.byte	94,21,70,87,167,141,157,132
+.byte	144,216,171,0,140,188,211,10
+.byte	247,228,88,5,184,179,69,6
+.byte	208,44,30,143,202,63,15,2
+.byte	193,175,189,3,1,19,138,107
+.byte	58,145,17,65,79,103,220,234
+.byte	151,242,207,206,240,180,230,115
+.byte	150,172,116,34,231,173,53,133
+.byte	226,249,55,232,28,117,223,110
+.byte	71,241,26,113,29,41,197,137
+.byte	111,183,98,14,170,24,190,27
+.byte	252,86,62,75,198,210,121,32
+.byte	154,219,192,254,120,205,90,244
+.byte	31,221,168,51,136,7,199,49
+.byte	177,18,16,89,39,128,236,95
+.byte	96,81,127,169,25,181,74,13
+.byte	45,229,122,159,147,201,156,239
+.byte	160,224,59,77,174,42,245,176
+.byte	200,235,187,60,131,83,153,97
+.byte	23,43,4,126,186,119,214,38
+.byte	225,105,20,99,85,33,12,125
+.byte	82,9,106,213,48,54,165,56
+.byte	191,64,163,158,129,243,215,251
+.byte	124,227,57,130,155,47,255,135
+.byte	52,142,67,68,196,222,233,203
+.byte	84,123,148,50,166,194,35,61
+.byte	238,76,149,11,66,250,195,78
+.byte	8,46,161,102,40,217,36,178
+.byte	118,91,162,73,109,139,209,37
+.byte	114,248,246,100,134,104,152,22
+.byte	212,164,92,204,93,101,182,146
+.byte	108,112,72,80,253,237,185,218
+.byte	94,21,70,87,167,141,157,132
+.byte	144,216,171,0,140,188,211,10
+.byte	247,228,88,5,184,179,69,6
+.byte	208,44,30,143,202,63,15,2
+.byte	193,175,189,3,1,19,138,107
+.byte	58,145,17,65,79,103,220,234
+.byte	151,242,207,206,240,180,230,115
+.byte	150,172,116,34,231,173,53,133
+.byte	226,249,55,232,28,117,223,110
+.byte	71,241,26,113,29,41,197,137
+.byte	111,183,98,14,170,24,190,27
+.byte	252,86,62,75,198,210,121,32
+.byte	154,219,192,254,120,205,90,244
+.byte	31,221,168,51,136,7,199,49
+.byte	177,18,16,89,39,128,236,95
+.byte	96,81,127,169,25,181,74,13
+.byte	45,229,122,159,147,201,156,239
+.byte	160,224,59,77,174,42,245,176
+.byte	200,235,187,60,131,83,153,97
+.byte	23,43,4,126,186,119,214,38
+.byte	225,105,20,99,85,33,12,125
+.byte	82,9,106,213,48,54,165,56
+.byte	191,64,163,158,129,243,215,251
+.byte	124,227,57,130,155,47,255,135
+.byte	52,142,67,68,196,222,233,203
+.byte	84,123,148,50,166,194,35,61
+.byte	238,76,149,11,66,250,195,78
+.byte	8,46,161,102,40,217,36,178
+.byte	118,91,162,73,109,139,209,37
+.byte	114,248,246,100,134,104,152,22
+.byte	212,164,92,204,93,101,182,146
+.byte	108,112,72,80,253,237,185,218
+.byte	94,21,70,87,167,141,157,132
+.byte	144,216,171,0,140,188,211,10
+.byte	247,228,88,5,184,179,69,6
+.byte	208,44,30,143,202,63,15,2
+.byte	193,175,189,3,1,19,138,107
+.byte	58,145,17,65,79,103,220,234
+.byte	151,242,207,206,240,180,230,115
+.byte	150,172,116,34,231,173,53,133
+.byte	226,249,55,232,28,117,223,110
+.byte	71,241,26,113,29,41,197,137
+.byte	111,183,98,14,170,24,190,27
+.byte	252,86,62,75,198,210,121,32
+.byte	154,219,192,254,120,205,90,244
+.byte	31,221,168,51,136,7,199,49
+.byte	177,18,16,89,39,128,236,95
+.byte	96,81,127,169,25,181,74,13
+.byte	45,229,122,159,147,201,156,239
+.byte	160,224,59,77,174,42,245,176
+.byte	200,235,187,60,131,83,153,97
+.byte	23,43,4,126,186,119,214,38
+.byte	225,105,20,99,85,33,12,125
+.size	_x86_AES_decrypt,.-_x86_AES_decrypt
+.globl	asm_AES_decrypt
+.hidden	asm_AES_decrypt
+.type	asm_AES_decrypt,@function
+.align	16
+asm_AES_decrypt:
+.L_asm_AES_decrypt_begin:
+	pushl	%ebp
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+	movl	20(%esp),%esi
+	movl	28(%esp),%edi
+	movl	%esp,%eax
+	subl	$36,%esp
+	andl	$-64,%esp
+	leal	-127(%edi),%ebx
+	subl	%esp,%ebx
+	negl	%ebx
+	andl	$960,%ebx
+	subl	%ebx,%esp
+	addl	$4,%esp
+	movl	%eax,28(%esp)
+	call	.L010pic_point
+.L010pic_point:
+	popl	%ebp
+	leal	OPENSSL_ia32cap_P-.L010pic_point(%ebp),%eax
+	leal	.LAES_Td-.L010pic_point(%ebp),%ebp
+	leal	764(%esp),%ebx
+	subl	%ebp,%ebx
+	andl	$768,%ebx
+	leal	2176(%ebp,%ebx,1),%ebp
+	btl	$25,(%eax)
+	jnc	.L011x86
+	movq	(%esi),%mm0
+	movq	8(%esi),%mm4
+	call	_sse_AES_decrypt_compact
+	movl	28(%esp),%esp
+	movl	24(%esp),%esi
+	movq	%mm0,(%esi)
+	movq	%mm4,8(%esi)
+	emms
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.align	16
+.L011x86:
+	movl	%ebp,24(%esp)
+	movl	(%esi),%eax
+	movl	4(%esi),%ebx
+	movl	8(%esi),%ecx
+	movl	12(%esi),%edx
+	call	_x86_AES_decrypt_compact
+	movl	28(%esp),%esp
+	movl	24(%esp),%esi
+	movl	%eax,(%esi)
+	movl	%ebx,4(%esi)
+	movl	%ecx,8(%esi)
+	movl	%edx,12(%esi)
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.size	asm_AES_decrypt,.-.L_asm_AES_decrypt_begin
+.globl	asm_AES_cbc_encrypt
+.hidden	asm_AES_cbc_encrypt
+.type	asm_AES_cbc_encrypt,@function
+.align	16
+asm_AES_cbc_encrypt:
+.L_asm_AES_cbc_encrypt_begin:
+	pushl	%ebp
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+	movl	28(%esp),%ecx
+	cmpl	$0,%ecx
+	je	.L012drop_out
+	call	.L013pic_point
+.L013pic_point:
+	popl	%ebp
+	leal	OPENSSL_ia32cap_P-.L013pic_point(%ebp),%eax
+	cmpl	$0,40(%esp)
+	leal	.LAES_Te-.L013pic_point(%ebp),%ebp
+	jne	.L014picked_te
+	leal	.LAES_Td-.LAES_Te(%ebp),%ebp
+.L014picked_te:
+	pushfl
+	cld
+	cmpl	$512,%ecx
+	jb	.L015slow_way
+	testl	$15,%ecx
+	jnz	.L015slow_way
+	btl	$28,(%eax)
+	jc	.L015slow_way
+	leal	-324(%esp),%esi
+	andl	$-64,%esi
+	movl	%ebp,%eax
+	leal	2304(%ebp),%ebx
+	movl	%esi,%edx
+	andl	$4095,%eax
+	andl	$4095,%ebx
+	andl	$4095,%edx
+	cmpl	%ebx,%edx
+	jb	.L016tbl_break_out
+	subl	%ebx,%edx
+	subl	%edx,%esi
+	jmp	.L017tbl_ok
+.align	4
+.L016tbl_break_out:
+	subl	%eax,%edx
+	andl	$4095,%edx
+	addl	$384,%edx
+	subl	%edx,%esi
+.align	4
+.L017tbl_ok:
+	leal	24(%esp),%edx
+	xchgl	%esi,%esp
+	addl	$4,%esp
+	movl	%ebp,24(%esp)
+	movl	%esi,28(%esp)
+	movl	(%edx),%eax
+	movl	4(%edx),%ebx
+	movl	12(%edx),%edi
+	movl	16(%edx),%esi
+	movl	20(%edx),%edx
+	movl	%eax,32(%esp)
+	movl	%ebx,36(%esp)
+	movl	%ecx,40(%esp)
+	movl	%edi,44(%esp)
+	movl	%esi,48(%esp)
+	movl	$0,316(%esp)
+	movl	%edi,%ebx
+	movl	$61,%ecx
+	subl	%ebp,%ebx
+	movl	%edi,%esi
+	andl	$4095,%ebx
+	leal	76(%esp),%edi
+	cmpl	$2304,%ebx
+	jb	.L018do_copy
+	cmpl	$3852,%ebx
+	jb	.L019skip_copy
+.align	4
+.L018do_copy:
+	movl	%edi,44(%esp)
+.long	2784229001
+.L019skip_copy:
+	movl	$16,%edi
+.align	4
+.L020prefetch_tbl:
+	movl	(%ebp),%eax
+	movl	32(%ebp),%ebx
+	movl	64(%ebp),%ecx
+	movl	96(%ebp),%esi
+	leal	128(%ebp),%ebp
+	subl	$1,%edi
+	jnz	.L020prefetch_tbl
+	subl	$2048,%ebp
+	movl	32(%esp),%esi
+	movl	48(%esp),%edi
+	cmpl	$0,%edx
+	je	.L021fast_decrypt
+	movl	(%edi),%eax
+	movl	4(%edi),%ebx
+.align	16
+.L022fast_enc_loop:
+	movl	8(%edi),%ecx
+	movl	12(%edi),%edx
+	xorl	(%esi),%eax
+	xorl	4(%esi),%ebx
+	xorl	8(%esi),%ecx
+	xorl	12(%esi),%edx
+	movl	44(%esp),%edi
+	call	_x86_AES_encrypt
+	movl	32(%esp),%esi
+	movl	36(%esp),%edi
+	movl	%eax,(%edi)
+	movl	%ebx,4(%edi)
+	movl	%ecx,8(%edi)
+	movl	%edx,12(%edi)
+	leal	16(%esi),%esi
+	movl	40(%esp),%ecx
+	movl	%esi,32(%esp)
+	leal	16(%edi),%edx
+	movl	%edx,36(%esp)
+	subl	$16,%ecx
+	movl	%ecx,40(%esp)
+	jnz	.L022fast_enc_loop
+	movl	48(%esp),%esi
+	movl	8(%edi),%ecx
+	movl	12(%edi),%edx
+	movl	%eax,(%esi)
+	movl	%ebx,4(%esi)
+	movl	%ecx,8(%esi)
+	movl	%edx,12(%esi)
+	cmpl	$0,316(%esp)
+	movl	44(%esp),%edi
+	je	.L023skip_ezero
+	movl	$60,%ecx
+	xorl	%eax,%eax
+.align	4
+.long	2884892297
+.L023skip_ezero:
+	movl	28(%esp),%esp
+	popfl
+.L012drop_out:
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+	pushfl
+.align	16
+.L021fast_decrypt:
+	cmpl	36(%esp),%esi
+	je	.L024fast_dec_in_place
+	movl	%edi,52(%esp)
+.align	4
+.align	16
+.L025fast_dec_loop:
+	movl	(%esi),%eax
+	movl	4(%esi),%ebx
+	movl	8(%esi),%ecx
+	movl	12(%esi),%edx
+	movl	44(%esp),%edi
+	call	_x86_AES_decrypt
+	movl	52(%esp),%edi
+	movl	40(%esp),%esi
+	xorl	(%edi),%eax
+	xorl	4(%edi),%ebx
+	xorl	8(%edi),%ecx
+	xorl	12(%edi),%edx
+	movl	36(%esp),%edi
+	movl	32(%esp),%esi
+	movl	%eax,(%edi)
+	movl	%ebx,4(%edi)
+	movl	%ecx,8(%edi)
+	movl	%edx,12(%edi)
+	movl	40(%esp),%ecx
+	movl	%esi,52(%esp)
+	leal	16(%esi),%esi
+	movl	%esi,32(%esp)
+	leal	16(%edi),%edi
+	movl	%edi,36(%esp)
+	subl	$16,%ecx
+	movl	%ecx,40(%esp)
+	jnz	.L025fast_dec_loop
+	movl	52(%esp),%edi
+	movl	48(%esp),%esi
+	movl	(%edi),%eax
+	movl	4(%edi),%ebx
+	movl	8(%edi),%ecx
+	movl	12(%edi),%edx
+	movl	%eax,(%esi)
+	movl	%ebx,4(%esi)
+	movl	%ecx,8(%esi)
+	movl	%edx,12(%esi)
+	jmp	.L026fast_dec_out
+.align	16
+.L024fast_dec_in_place:
+.L027fast_dec_in_place_loop:
+	movl	(%esi),%eax
+	movl	4(%esi),%ebx
+	movl	8(%esi),%ecx
+	movl	12(%esi),%edx
+	leal	60(%esp),%edi
+	movl	%eax,(%edi)
+	movl	%ebx,4(%edi)
+	movl	%ecx,8(%edi)
+	movl	%edx,12(%edi)
+	movl	44(%esp),%edi
+	call	_x86_AES_decrypt
+	movl	48(%esp),%edi
+	movl	36(%esp),%esi
+	xorl	(%edi),%eax
+	xorl	4(%edi),%ebx
+	xorl	8(%edi),%ecx
+	xorl	12(%edi),%edx
+	movl	%eax,(%esi)
+	movl	%ebx,4(%esi)
+	movl	%ecx,8(%esi)
+	movl	%edx,12(%esi)
+	leal	16(%esi),%esi
+	movl	%esi,36(%esp)
+	leal	60(%esp),%esi
+	movl	(%esi),%eax
+	movl	4(%esi),%ebx
+	movl	8(%esi),%ecx
+	movl	12(%esi),%edx
+	movl	%eax,(%edi)
+	movl	%ebx,4(%edi)
+	movl	%ecx,8(%edi)
+	movl	%edx,12(%edi)
+	movl	32(%esp),%esi
+	movl	40(%esp),%ecx
+	leal	16(%esi),%esi
+	movl	%esi,32(%esp)
+	subl	$16,%ecx
+	movl	%ecx,40(%esp)
+	jnz	.L027fast_dec_in_place_loop
+.align	4
+.L026fast_dec_out:
+	cmpl	$0,316(%esp)
+	movl	44(%esp),%edi
+	je	.L028skip_dzero
+	movl	$60,%ecx
+	xorl	%eax,%eax
+.align	4
+.long	2884892297
+.L028skip_dzero:
+	movl	28(%esp),%esp
+	popfl
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+	pushfl
+.align	16
+.L015slow_way:
+	movl	(%eax),%eax
+	movl	36(%esp),%edi
+	leal	-80(%esp),%esi
+	andl	$-64,%esi
+	leal	-143(%edi),%ebx
+	subl	%esi,%ebx
+	negl	%ebx
+	andl	$960,%ebx
+	subl	%ebx,%esi
+	leal	768(%esi),%ebx
+	subl	%ebp,%ebx
+	andl	$768,%ebx
+	leal	2176(%ebp,%ebx,1),%ebp
+	leal	24(%esp),%edx
+	xchgl	%esi,%esp
+	addl	$4,%esp
+	movl	%ebp,24(%esp)
+	movl	%esi,28(%esp)
+	movl	%eax,52(%esp)
+	movl	(%edx),%eax
+	movl	4(%edx),%ebx
+	movl	16(%edx),%esi
+	movl	20(%edx),%edx
+	movl	%eax,32(%esp)
+	movl	%ebx,36(%esp)
+	movl	%ecx,40(%esp)
+	movl	%edi,44(%esp)
+	movl	%esi,48(%esp)
+	movl	%esi,%edi
+	movl	%eax,%esi
+	cmpl	$0,%edx
+	je	.L029slow_decrypt
+	cmpl	$16,%ecx
+	movl	%ebx,%edx
+	jb	.L030slow_enc_tail
+	btl	$25,52(%esp)
+	jnc	.L031slow_enc_x86
+	movq	(%edi),%mm0
+	movq	8(%edi),%mm4
+.align	16
+.L032slow_enc_loop_sse:
+	pxor	(%esi),%mm0
+	pxor	8(%esi),%mm4
+	movl	44(%esp),%edi
+	call	_sse_AES_encrypt_compact
+	movl	32(%esp),%esi
+	movl	36(%esp),%edi
+	movl	40(%esp),%ecx
+	movq	%mm0,(%edi)
+	movq	%mm4,8(%edi)
+	leal	16(%esi),%esi
+	movl	%esi,32(%esp)
+	leal	16(%edi),%edx
+	movl	%edx,36(%esp)
+	subl	$16,%ecx
+	cmpl	$16,%ecx
+	movl	%ecx,40(%esp)
+	jae	.L032slow_enc_loop_sse
+	testl	$15,%ecx
+	jnz	.L030slow_enc_tail
+	movl	48(%esp),%esi
+	movq	%mm0,(%esi)
+	movq	%mm4,8(%esi)
+	emms
+	movl	28(%esp),%esp
+	popfl
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+	pushfl
+.align	16
+.L031slow_enc_x86:
+	movl	(%edi),%eax
+	movl	4(%edi),%ebx
+.align	4
+.L033slow_enc_loop_x86:
+	movl	8(%edi),%ecx
+	movl	12(%edi),%edx
+	xorl	(%esi),%eax
+	xorl	4(%esi),%ebx
+	xorl	8(%esi),%ecx
+	xorl	12(%esi),%edx
+	movl	44(%esp),%edi
+	call	_x86_AES_encrypt_compact
+	movl	32(%esp),%esi
+	movl	36(%esp),%edi
+	movl	%eax,(%edi)
+	movl	%ebx,4(%edi)
+	movl	%ecx,8(%edi)
+	movl	%edx,12(%edi)
+	movl	40(%esp),%ecx
+	leal	16(%esi),%esi
+	movl	%esi,32(%esp)
+	leal	16(%edi),%edx
+	movl	%edx,36(%esp)
+	subl	$16,%ecx
+	cmpl	$16,%ecx
+	movl	%ecx,40(%esp)
+	jae	.L033slow_enc_loop_x86
+	testl	$15,%ecx
+	jnz	.L030slow_enc_tail
+	movl	48(%esp),%esi
+	movl	8(%edi),%ecx
+	movl	12(%edi),%edx
+	movl	%eax,(%esi)
+	movl	%ebx,4(%esi)
+	movl	%ecx,8(%esi)
+	movl	%edx,12(%esi)
+	movl	28(%esp),%esp
+	popfl
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+	pushfl
+.align	16
+.L030slow_enc_tail:
+	emms
+	movl	%edx,%edi
+	movl	$16,%ebx
+	subl	%ecx,%ebx
+	cmpl	%esi,%edi
+	je	.L034enc_in_place
+.align	4
+.long	2767451785
+	jmp	.L035enc_skip_in_place
+.L034enc_in_place:
+	leal	(%edi,%ecx,1),%edi
+.L035enc_skip_in_place:
+	movl	%ebx,%ecx
+	xorl	%eax,%eax
+.align	4
+.long	2868115081
+	movl	48(%esp),%edi
+	movl	%edx,%esi
+	movl	(%edi),%eax
+	movl	4(%edi),%ebx
+	movl	$16,40(%esp)
+	jmp	.L033slow_enc_loop_x86
+.align	16
+.L029slow_decrypt:
+	btl	$25,52(%esp)
+	jnc	.L036slow_dec_loop_x86
+.align	4
+.L037slow_dec_loop_sse:
+	movq	(%esi),%mm0
+	movq	8(%esi),%mm4
+	movl	44(%esp),%edi
+	call	_sse_AES_decrypt_compact
+	movl	32(%esp),%esi
+	leal	60(%esp),%eax
+	movl	36(%esp),%ebx
+	movl	40(%esp),%ecx
+	movl	48(%esp),%edi
+	movq	(%esi),%mm1
+	movq	8(%esi),%mm5
+	pxor	(%edi),%mm0
+	pxor	8(%edi),%mm4
+	movq	%mm1,(%edi)
+	movq	%mm5,8(%edi)
+	subl	$16,%ecx
+	jc	.L038slow_dec_partial_sse
+	movq	%mm0,(%ebx)
+	movq	%mm4,8(%ebx)
+	leal	16(%ebx),%ebx
+	movl	%ebx,36(%esp)
+	leal	16(%esi),%esi
+	movl	%esi,32(%esp)
+	movl	%ecx,40(%esp)
+	jnz	.L037slow_dec_loop_sse
+	emms
+	movl	28(%esp),%esp
+	popfl
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+	pushfl
+.align	16
+.L038slow_dec_partial_sse:
+	movq	%mm0,(%eax)
+	movq	%mm4,8(%eax)
+	emms
+	addl	$16,%ecx
+	movl	%ebx,%edi
+	movl	%eax,%esi
+.align	4
+.long	2767451785
+	movl	28(%esp),%esp
+	popfl
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+	pushfl
+.align	16
+.L036slow_dec_loop_x86:
+	movl	(%esi),%eax
+	movl	4(%esi),%ebx
+	movl	8(%esi),%ecx
+	movl	12(%esi),%edx
+	leal	60(%esp),%edi
+	movl	%eax,(%edi)
+	movl	%ebx,4(%edi)
+	movl	%ecx,8(%edi)
+	movl	%edx,12(%edi)
+	movl	44(%esp),%edi
+	call	_x86_AES_decrypt_compact
+	movl	48(%esp),%edi
+	movl	40(%esp),%esi
+	xorl	(%edi),%eax
+	xorl	4(%edi),%ebx
+	xorl	8(%edi),%ecx
+	xorl	12(%edi),%edx
+	subl	$16,%esi
+	jc	.L039slow_dec_partial_x86
+	movl	%esi,40(%esp)
+	movl	36(%esp),%esi
+	movl	%eax,(%esi)
+	movl	%ebx,4(%esi)
+	movl	%ecx,8(%esi)
+	movl	%edx,12(%esi)
+	leal	16(%esi),%esi
+	movl	%esi,36(%esp)
+	leal	60(%esp),%esi
+	movl	(%esi),%eax
+	movl	4(%esi),%ebx
+	movl	8(%esi),%ecx
+	movl	12(%esi),%edx
+	movl	%eax,(%edi)
+	movl	%ebx,4(%edi)
+	movl	%ecx,8(%edi)
+	movl	%edx,12(%edi)
+	movl	32(%esp),%esi
+	leal	16(%esi),%esi
+	movl	%esi,32(%esp)
+	jnz	.L036slow_dec_loop_x86
+	movl	28(%esp),%esp
+	popfl
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+	pushfl
+.align	16
+.L039slow_dec_partial_x86:
+	leal	60(%esp),%esi
+	movl	%eax,(%esi)
+	movl	%ebx,4(%esi)
+	movl	%ecx,8(%esi)
+	movl	%edx,12(%esi)
+	movl	32(%esp),%esi
+	movl	(%esi),%eax
+	movl	4(%esi),%ebx
+	movl	8(%esi),%ecx
+	movl	12(%esi),%edx
+	movl	%eax,(%edi)
+	movl	%ebx,4(%edi)
+	movl	%ecx,8(%edi)
+	movl	%edx,12(%edi)
+	movl	40(%esp),%ecx
+	movl	36(%esp),%edi
+	leal	60(%esp),%esi
+.align	4
+.long	2767451785
+	movl	28(%esp),%esp
+	popfl
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.size	asm_AES_cbc_encrypt,.-.L_asm_AES_cbc_encrypt_begin
+.hidden	_x86_AES_set_encrypt_key
+.type	_x86_AES_set_encrypt_key,@function
+.align	16
+_x86_AES_set_encrypt_key:
+	pushl	%ebp
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+	movl	24(%esp),%esi
+	movl	32(%esp),%edi
+	testl	$-1,%esi
+	jz	.L040badpointer
+	testl	$-1,%edi
+	jz	.L040badpointer
+	call	.L041pic_point
+.L041pic_point:
+	popl	%ebp
+	leal	.LAES_Te-.L041pic_point(%ebp),%ebp
+	leal	2176(%ebp),%ebp
+	movl	-128(%ebp),%eax
+	movl	-96(%ebp),%ebx
+	movl	-64(%ebp),%ecx
+	movl	-32(%ebp),%edx
+	movl	(%ebp),%eax
+	movl	32(%ebp),%ebx
+	movl	64(%ebp),%ecx
+	movl	96(%ebp),%edx
+	movl	28(%esp),%ecx
+	cmpl	$128,%ecx
+	je	.L04210rounds
+	cmpl	$192,%ecx
+	je	.L04312rounds
+	cmpl	$256,%ecx
+	je	.L04414rounds
+	movl	$-2,%eax
+	jmp	.L045exit
+.L04210rounds:
+	movl	(%esi),%eax
+	movl	4(%esi),%ebx
+	movl	8(%esi),%ecx
+	movl	12(%esi),%edx
+	movl	%eax,(%edi)
+	movl	%ebx,4(%edi)
+	movl	%ecx,8(%edi)
+	movl	%edx,12(%edi)
+	xorl	%ecx,%ecx
+	jmp	.L04610shortcut
+.align	4
+.L04710loop:
+	movl	(%edi),%eax
+	movl	12(%edi),%edx
+.L04610shortcut:
+	movzbl	%dl,%esi
+	movzbl	-128(%ebp,%esi,1),%ebx
+	movzbl	%dh,%esi
+	shll	$24,%ebx
+	xorl	%ebx,%eax
+	movzbl	-128(%ebp,%esi,1),%ebx
+	shrl	$16,%edx
+	movzbl	%dl,%esi
+	xorl	%ebx,%eax
+	movzbl	-128(%ebp,%esi,1),%ebx
+	movzbl	%dh,%esi
+	shll	$8,%ebx
+	xorl	%ebx,%eax
+	movzbl	-128(%ebp,%esi,1),%ebx
+	shll	$16,%ebx
+	xorl	%ebx,%eax
+	xorl	896(%ebp,%ecx,4),%eax
+	movl	%eax,16(%edi)
+	xorl	4(%edi),%eax
+	movl	%eax,20(%edi)
+	xorl	8(%edi),%eax
+	movl	%eax,24(%edi)
+	xorl	12(%edi),%eax
+	movl	%eax,28(%edi)
+	incl	%ecx
+	addl	$16,%edi
+	cmpl	$10,%ecx
+	jl	.L04710loop
+	movl	$10,80(%edi)
+	xorl	%eax,%eax
+	jmp	.L045exit
+.L04312rounds:
+	movl	(%esi),%eax
+	movl	4(%esi),%ebx
+	movl	8(%esi),%ecx
+	movl	12(%esi),%edx
+	movl	%eax,(%edi)
+	movl	%ebx,4(%edi)
+	movl	%ecx,8(%edi)
+	movl	%edx,12(%edi)
+	movl	16(%esi),%ecx
+	movl	20(%esi),%edx
+	movl	%ecx,16(%edi)
+	movl	%edx,20(%edi)
+	xorl	%ecx,%ecx
+	jmp	.L04812shortcut
+.align	4
+.L04912loop:
+	movl	(%edi),%eax
+	movl	20(%edi),%edx
+.L04812shortcut:
+	movzbl	%dl,%esi
+	movzbl	-128(%ebp,%esi,1),%ebx
+	movzbl	%dh,%esi
+	shll	$24,%ebx
+	xorl	%ebx,%eax
+	movzbl	-128(%ebp,%esi,1),%ebx
+	shrl	$16,%edx
+	movzbl	%dl,%esi
+	xorl	%ebx,%eax
+	movzbl	-128(%ebp,%esi,1),%ebx
+	movzbl	%dh,%esi
+	shll	$8,%ebx
+	xorl	%ebx,%eax
+	movzbl	-128(%ebp,%esi,1),%ebx
+	shll	$16,%ebx
+	xorl	%ebx,%eax
+	xorl	896(%ebp,%ecx,4),%eax
+	movl	%eax,24(%edi)
+	xorl	4(%edi),%eax
+	movl	%eax,28(%edi)
+	xorl	8(%edi),%eax
+	movl	%eax,32(%edi)
+	xorl	12(%edi),%eax
+	movl	%eax,36(%edi)
+	cmpl	$7,%ecx
+	je	.L05012break
+	incl	%ecx
+	xorl	16(%edi),%eax
+	movl	%eax,40(%edi)
+	xorl	20(%edi),%eax
+	movl	%eax,44(%edi)
+	addl	$24,%edi
+	jmp	.L04912loop
+.L05012break:
+	movl	$12,72(%edi)
+	xorl	%eax,%eax
+	jmp	.L045exit
+.L04414rounds:
+	movl	(%esi),%eax
+	movl	4(%esi),%ebx
+	movl	8(%esi),%ecx
+	movl	12(%esi),%edx
+	movl	%eax,(%edi)
+	movl	%ebx,4(%edi)
+	movl	%ecx,8(%edi)
+	movl	%edx,12(%edi)
+	movl	16(%esi),%eax
+	movl	20(%esi),%ebx
+	movl	24(%esi),%ecx
+	movl	28(%esi),%edx
+	movl	%eax,16(%edi)
+	movl	%ebx,20(%edi)
+	movl	%ecx,24(%edi)
+	movl	%edx,28(%edi)
+	xorl	%ecx,%ecx
+	jmp	.L05114shortcut
+.align	4
+.L05214loop:
+	movl	28(%edi),%edx
+.L05114shortcut:
+	movl	(%edi),%eax
+	movzbl	%dl,%esi
+	movzbl	-128(%ebp,%esi,1),%ebx
+	movzbl	%dh,%esi
+	shll	$24,%ebx
+	xorl	%ebx,%eax
+	movzbl	-128(%ebp,%esi,1),%ebx
+	shrl	$16,%edx
+	movzbl	%dl,%esi
+	xorl	%ebx,%eax
+	movzbl	-128(%ebp,%esi,1),%ebx
+	movzbl	%dh,%esi
+	shll	$8,%ebx
+	xorl	%ebx,%eax
+	movzbl	-128(%ebp,%esi,1),%ebx
+	shll	$16,%ebx
+	xorl	%ebx,%eax
+	xorl	896(%ebp,%ecx,4),%eax
+	movl	%eax,32(%edi)
+	xorl	4(%edi),%eax
+	movl	%eax,36(%edi)
+	xorl	8(%edi),%eax
+	movl	%eax,40(%edi)
+	xorl	12(%edi),%eax
+	movl	%eax,44(%edi)
+	cmpl	$6,%ecx
+	je	.L05314break
+	incl	%ecx
+	movl	%eax,%edx
+	movl	16(%edi),%eax
+	movzbl	%dl,%esi
+	movzbl	-128(%ebp,%esi,1),%ebx
+	movzbl	%dh,%esi
+	xorl	%ebx,%eax
+	movzbl	-128(%ebp,%esi,1),%ebx
+	shrl	$16,%edx
+	shll	$8,%ebx
+	movzbl	%dl,%esi
+	xorl	%ebx,%eax
+	movzbl	-128(%ebp,%esi,1),%ebx
+	movzbl	%dh,%esi
+	shll	$16,%ebx
+	xorl	%ebx,%eax
+	movzbl	-128(%ebp,%esi,1),%ebx
+	shll	$24,%ebx
+	xorl	%ebx,%eax
+	movl	%eax,48(%edi)
+	xorl	20(%edi),%eax
+	movl	%eax,52(%edi)
+	xorl	24(%edi),%eax
+	movl	%eax,56(%edi)
+	xorl	28(%edi),%eax
+	movl	%eax,60(%edi)
+	addl	$32,%edi
+	jmp	.L05214loop
+.L05314break:
+	movl	$14,48(%edi)
+	xorl	%eax,%eax
+	jmp	.L045exit
+.L040badpointer:
+	movl	$-1,%eax
+.L045exit:
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.size	_x86_AES_set_encrypt_key,.-_x86_AES_set_encrypt_key
+.globl	asm_AES_set_encrypt_key
+.hidden	asm_AES_set_encrypt_key
+.type	asm_AES_set_encrypt_key,@function
+.align	16
+asm_AES_set_encrypt_key:
+.L_asm_AES_set_encrypt_key_begin:
+	call	_x86_AES_set_encrypt_key
+	ret
+.size	asm_AES_set_encrypt_key,.-.L_asm_AES_set_encrypt_key_begin
+.globl	asm_AES_set_decrypt_key
+.hidden	asm_AES_set_decrypt_key
+.type	asm_AES_set_decrypt_key,@function
+.align	16
+asm_AES_set_decrypt_key:
+.L_asm_AES_set_decrypt_key_begin:
+	call	_x86_AES_set_encrypt_key
+	cmpl	$0,%eax
+	je	.L054proceed
+	ret
+.L054proceed:
+	pushl	%ebp
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+	movl	28(%esp),%esi
+	movl	240(%esi),%ecx
+	leal	(,%ecx,4),%ecx
+	leal	(%esi,%ecx,4),%edi
+.align	4
+.L055invert:
+	movl	(%esi),%eax
+	movl	4(%esi),%ebx
+	movl	(%edi),%ecx
+	movl	4(%edi),%edx
+	movl	%eax,(%edi)
+	movl	%ebx,4(%edi)
+	movl	%ecx,(%esi)
+	movl	%edx,4(%esi)
+	movl	8(%esi),%eax
+	movl	12(%esi),%ebx
+	movl	8(%edi),%ecx
+	movl	12(%edi),%edx
+	movl	%eax,8(%edi)
+	movl	%ebx,12(%edi)
+	movl	%ecx,8(%esi)
+	movl	%edx,12(%esi)
+	addl	$16,%esi
+	subl	$16,%edi
+	cmpl	%edi,%esi
+	jne	.L055invert
+	movl	28(%esp),%edi
+	movl	240(%edi),%esi
+	leal	-2(%esi,%esi,1),%esi
+	leal	(%edi,%esi,8),%esi
+	movl	%esi,28(%esp)
+	movl	16(%edi),%eax
+.align	4
+.L056permute:
+	addl	$16,%edi
+	movl	$2155905152,%ebp
+	andl	%eax,%ebp
+	leal	(%eax,%eax,1),%ebx
+	movl	%ebp,%esi
+	shrl	$7,%ebp
+	subl	%ebp,%esi
+	andl	$4278124286,%ebx
+	andl	$454761243,%esi
+	xorl	%esi,%ebx
+	movl	$2155905152,%ebp
+	andl	%ebx,%ebp
+	leal	(%ebx,%ebx,1),%ecx
+	movl	%ebp,%esi
+	shrl	$7,%ebp
+	subl	%ebp,%esi
+	andl	$4278124286,%ecx
+	andl	$454761243,%esi
+	xorl	%eax,%ebx
+	xorl	%esi,%ecx
+	movl	$2155905152,%ebp
+	andl	%ecx,%ebp
+	leal	(%ecx,%ecx,1),%edx
+	movl	%ebp,%esi
+	shrl	$7,%ebp
+	xorl	%eax,%ecx
+	subl	%ebp,%esi
+	andl	$4278124286,%edx
+	andl	$454761243,%esi
+	roll	$8,%eax
+	xorl	%esi,%edx
+	movl	4(%edi),%ebp
+	xorl	%ebx,%eax
+	xorl	%edx,%ebx
+	xorl	%ecx,%eax
+	roll	$24,%ebx
+	xorl	%edx,%ecx
+	xorl	%edx,%eax
+	roll	$16,%ecx
+	xorl	%ebx,%eax
+	roll	$8,%edx
+	xorl	%ecx,%eax
+	movl	%ebp,%ebx
+	xorl	%edx,%eax
+	movl	%eax,(%edi)
+	movl	$2155905152,%ebp
+	andl	%ebx,%ebp
+	leal	(%ebx,%ebx,1),%ecx
+	movl	%ebp,%esi
+	shrl	$7,%ebp
+	subl	%ebp,%esi
+	andl	$4278124286,%ecx
+	andl	$454761243,%esi
+	xorl	%esi,%ecx
+	movl	$2155905152,%ebp
+	andl	%ecx,%ebp
+	leal	(%ecx,%ecx,1),%edx
+	movl	%ebp,%esi
+	shrl	$7,%ebp
+	subl	%ebp,%esi
+	andl	$4278124286,%edx
+	andl	$454761243,%esi
+	xorl	%ebx,%ecx
+	xorl	%esi,%edx
+	movl	$2155905152,%ebp
+	andl	%edx,%ebp
+	leal	(%edx,%edx,1),%eax
+	movl	%ebp,%esi
+	shrl	$7,%ebp
+	xorl	%ebx,%edx
+	subl	%ebp,%esi
+	andl	$4278124286,%eax
+	andl	$454761243,%esi
+	roll	$8,%ebx
+	xorl	%esi,%eax
+	movl	8(%edi),%ebp
+	xorl	%ecx,%ebx
+	xorl	%eax,%ecx
+	xorl	%edx,%ebx
+	roll	$24,%ecx
+	xorl	%eax,%edx
+	xorl	%eax,%ebx
+	roll	$16,%edx
+	xorl	%ecx,%ebx
+	roll	$8,%eax
+	xorl	%edx,%ebx
+	movl	%ebp,%ecx
+	xorl	%eax,%ebx
+	movl	%ebx,4(%edi)
+	movl	$2155905152,%ebp
+	andl	%ecx,%ebp
+	leal	(%ecx,%ecx,1),%edx
+	movl	%ebp,%esi
+	shrl	$7,%ebp
+	subl	%ebp,%esi
+	andl	$4278124286,%edx
+	andl	$454761243,%esi
+	xorl	%esi,%edx
+	movl	$2155905152,%ebp
+	andl	%edx,%ebp
+	leal	(%edx,%edx,1),%eax
+	movl	%ebp,%esi
+	shrl	$7,%ebp
+	subl	%ebp,%esi
+	andl	$4278124286,%eax
+	andl	$454761243,%esi
+	xorl	%ecx,%edx
+	xorl	%esi,%eax
+	movl	$2155905152,%ebp
+	andl	%eax,%ebp
+	leal	(%eax,%eax,1),%ebx
+	movl	%ebp,%esi
+	shrl	$7,%ebp
+	xorl	%ecx,%eax
+	subl	%ebp,%esi
+	andl	$4278124286,%ebx
+	andl	$454761243,%esi
+	roll	$8,%ecx
+	xorl	%esi,%ebx
+	movl	12(%edi),%ebp
+	xorl	%edx,%ecx
+	xorl	%ebx,%edx
+	xorl	%eax,%ecx
+	roll	$24,%edx
+	xorl	%ebx,%eax
+	xorl	%ebx,%ecx
+	roll	$16,%eax
+	xorl	%edx,%ecx
+	roll	$8,%ebx
+	xorl	%eax,%ecx
+	movl	%ebp,%edx
+	xorl	%ebx,%ecx
+	movl	%ecx,8(%edi)
+	movl	$2155905152,%ebp
+	andl	%edx,%ebp
+	leal	(%edx,%edx,1),%eax
+	movl	%ebp,%esi
+	shrl	$7,%ebp
+	subl	%ebp,%esi
+	andl	$4278124286,%eax
+	andl	$454761243,%esi
+	xorl	%esi,%eax
+	movl	$2155905152,%ebp
+	andl	%eax,%ebp
+	leal	(%eax,%eax,1),%ebx
+	movl	%ebp,%esi
+	shrl	$7,%ebp
+	subl	%ebp,%esi
+	andl	$4278124286,%ebx
+	andl	$454761243,%esi
+	xorl	%edx,%eax
+	xorl	%esi,%ebx
+	movl	$2155905152,%ebp
+	andl	%ebx,%ebp
+	leal	(%ebx,%ebx,1),%ecx
+	movl	%ebp,%esi
+	shrl	$7,%ebp
+	xorl	%edx,%ebx
+	subl	%ebp,%esi
+	andl	$4278124286,%ecx
+	andl	$454761243,%esi
+	roll	$8,%edx
+	xorl	%esi,%ecx
+	movl	16(%edi),%ebp
+	xorl	%eax,%edx
+	xorl	%ecx,%eax
+	xorl	%ebx,%edx
+	roll	$24,%eax
+	xorl	%ecx,%ebx
+	xorl	%ecx,%edx
+	roll	$16,%ebx
+	xorl	%eax,%edx
+	roll	$8,%ecx
+	xorl	%ebx,%edx
+	movl	%ebp,%eax
+	xorl	%ecx,%edx
+	movl	%edx,12(%edi)
+	cmpl	28(%esp),%edi
+	jb	.L056permute
+	xorl	%eax,%eax
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.size	asm_AES_set_decrypt_key,.-.L_asm_AES_set_decrypt_key_begin
+.byte	65,69,83,32,102,111,114,32,120,56,54,44,32,67,82,89
+.byte	80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114
+.byte	111,64,111,112,101,110,115,115,108,46,111,114,103,62,0
+#endif
diff --git a/third_party/boringssl/linux-x86/crypto/aes/aesni-x86.S b/third_party/boringssl/linux-x86/crypto/aes/aesni-x86.S
new file mode 100644
index 0000000..aec110d
--- /dev/null
+++ b/third_party/boringssl/linux-x86/crypto/aes/aesni-x86.S
@@ -0,0 +1,2469 @@
+#if defined(__i386__)
+.file	"src/crypto/aes/asm/aesni-x86.S"
+.text
+.globl	aesni_encrypt
+.hidden	aesni_encrypt
+.type	aesni_encrypt,@function
+.align	16
+aesni_encrypt:
+.L_aesni_encrypt_begin:
+	movl	4(%esp),%eax
+	movl	12(%esp),%edx
+	movups	(%eax),%xmm2
+	movl	240(%edx),%ecx
+	movl	8(%esp),%eax
+	movups	(%edx),%xmm0
+	movups	16(%edx),%xmm1
+	leal	32(%edx),%edx
+	xorps	%xmm0,%xmm2
+.L000enc1_loop_1:
+.byte	102,15,56,220,209
+	decl	%ecx
+	movups	(%edx),%xmm1
+	leal	16(%edx),%edx
+	jnz	.L000enc1_loop_1
+.byte	102,15,56,221,209
+	pxor	%xmm0,%xmm0
+	pxor	%xmm1,%xmm1
+	movups	%xmm2,(%eax)
+	pxor	%xmm2,%xmm2
+	ret
+.size	aesni_encrypt,.-.L_aesni_encrypt_begin
+.globl	aesni_decrypt
+.hidden	aesni_decrypt
+.type	aesni_decrypt,@function
+.align	16
+aesni_decrypt:
+.L_aesni_decrypt_begin:
+	movl	4(%esp),%eax
+	movl	12(%esp),%edx
+	movups	(%eax),%xmm2
+	movl	240(%edx),%ecx
+	movl	8(%esp),%eax
+	movups	(%edx),%xmm0
+	movups	16(%edx),%xmm1
+	leal	32(%edx),%edx
+	xorps	%xmm0,%xmm2
+.L001dec1_loop_2:
+.byte	102,15,56,222,209
+	decl	%ecx
+	movups	(%edx),%xmm1
+	leal	16(%edx),%edx
+	jnz	.L001dec1_loop_2
+.byte	102,15,56,223,209
+	pxor	%xmm0,%xmm0
+	pxor	%xmm1,%xmm1
+	movups	%xmm2,(%eax)
+	pxor	%xmm2,%xmm2
+	ret
+.size	aesni_decrypt,.-.L_aesni_decrypt_begin
+.hidden	_aesni_encrypt2
+.type	_aesni_encrypt2,@function
+.align	16
+_aesni_encrypt2:
+	movups	(%edx),%xmm0
+	shll	$4,%ecx
+	movups	16(%edx),%xmm1
+	xorps	%xmm0,%xmm2
+	pxor	%xmm0,%xmm3
+	movups	32(%edx),%xmm0
+	leal	32(%edx,%ecx,1),%edx
+	negl	%ecx
+	addl	$16,%ecx
+.L002enc2_loop:
+.byte	102,15,56,220,209
+.byte	102,15,56,220,217
+	movups	(%edx,%ecx,1),%xmm1
+	addl	$32,%ecx
+.byte	102,15,56,220,208
+.byte	102,15,56,220,216
+	movups	-16(%edx,%ecx,1),%xmm0
+	jnz	.L002enc2_loop
+.byte	102,15,56,220,209
+.byte	102,15,56,220,217
+.byte	102,15,56,221,208
+.byte	102,15,56,221,216
+	ret
+.size	_aesni_encrypt2,.-_aesni_encrypt2
+.hidden	_aesni_decrypt2
+.type	_aesni_decrypt2,@function
+.align	16
+_aesni_decrypt2:
+	movups	(%edx),%xmm0
+	shll	$4,%ecx
+	movups	16(%edx),%xmm1
+	xorps	%xmm0,%xmm2
+	pxor	%xmm0,%xmm3
+	movups	32(%edx),%xmm0
+	leal	32(%edx,%ecx,1),%edx
+	negl	%ecx
+	addl	$16,%ecx
+.L003dec2_loop:
+.byte	102,15,56,222,209
+.byte	102,15,56,222,217
+	movups	(%edx,%ecx,1),%xmm1
+	addl	$32,%ecx
+.byte	102,15,56,222,208
+.byte	102,15,56,222,216
+	movups	-16(%edx,%ecx,1),%xmm0
+	jnz	.L003dec2_loop
+.byte	102,15,56,222,209
+.byte	102,15,56,222,217
+.byte	102,15,56,223,208
+.byte	102,15,56,223,216
+	ret
+.size	_aesni_decrypt2,.-_aesni_decrypt2
+.hidden	_aesni_encrypt3
+.type	_aesni_encrypt3,@function
+.align	16
+_aesni_encrypt3:
+	movups	(%edx),%xmm0
+	shll	$4,%ecx
+	movups	16(%edx),%xmm1
+	xorps	%xmm0,%xmm2
+	pxor	%xmm0,%xmm3
+	pxor	%xmm0,%xmm4
+	movups	32(%edx),%xmm0
+	leal	32(%edx,%ecx,1),%edx
+	negl	%ecx
+	addl	$16,%ecx
+.L004enc3_loop:
+.byte	102,15,56,220,209
+.byte	102,15,56,220,217
+.byte	102,15,56,220,225
+	movups	(%edx,%ecx,1),%xmm1
+	addl	$32,%ecx
+.byte	102,15,56,220,208
+.byte	102,15,56,220,216
+.byte	102,15,56,220,224
+	movups	-16(%edx,%ecx,1),%xmm0
+	jnz	.L004enc3_loop
+.byte	102,15,56,220,209
+.byte	102,15,56,220,217
+.byte	102,15,56,220,225
+.byte	102,15,56,221,208
+.byte	102,15,56,221,216
+.byte	102,15,56,221,224
+	ret
+.size	_aesni_encrypt3,.-_aesni_encrypt3
+.hidden	_aesni_decrypt3
+.type	_aesni_decrypt3,@function
+.align	16
+_aesni_decrypt3:
+	movups	(%edx),%xmm0
+	shll	$4,%ecx
+	movups	16(%edx),%xmm1
+	xorps	%xmm0,%xmm2
+	pxor	%xmm0,%xmm3
+	pxor	%xmm0,%xmm4
+	movups	32(%edx),%xmm0
+	leal	32(%edx,%ecx,1),%edx
+	negl	%ecx
+	addl	$16,%ecx
+.L005dec3_loop:
+.byte	102,15,56,222,209
+.byte	102,15,56,222,217
+.byte	102,15,56,222,225
+	movups	(%edx,%ecx,1),%xmm1
+	addl	$32,%ecx
+.byte	102,15,56,222,208
+.byte	102,15,56,222,216
+.byte	102,15,56,222,224
+	movups	-16(%edx,%ecx,1),%xmm0
+	jnz	.L005dec3_loop
+.byte	102,15,56,222,209
+.byte	102,15,56,222,217
+.byte	102,15,56,222,225
+.byte	102,15,56,223,208
+.byte	102,15,56,223,216
+.byte	102,15,56,223,224
+	ret
+.size	_aesni_decrypt3,.-_aesni_decrypt3
+.hidden	_aesni_encrypt4
+.type	_aesni_encrypt4,@function
+.align	16
+_aesni_encrypt4:
+	movups	(%edx),%xmm0
+	movups	16(%edx),%xmm1
+	shll	$4,%ecx
+	xorps	%xmm0,%xmm2
+	pxor	%xmm0,%xmm3
+	pxor	%xmm0,%xmm4
+	pxor	%xmm0,%xmm5
+	movups	32(%edx),%xmm0
+	leal	32(%edx,%ecx,1),%edx
+	negl	%ecx
+.byte	15,31,64,0
+	addl	$16,%ecx
+.L006enc4_loop:
+.byte	102,15,56,220,209
+.byte	102,15,56,220,217
+.byte	102,15,56,220,225
+.byte	102,15,56,220,233
+	movups	(%edx,%ecx,1),%xmm1
+	addl	$32,%ecx
+.byte	102,15,56,220,208
+.byte	102,15,56,220,216
+.byte	102,15,56,220,224
+.byte	102,15,56,220,232
+	movups	-16(%edx,%ecx,1),%xmm0
+	jnz	.L006enc4_loop
+.byte	102,15,56,220,209
+.byte	102,15,56,220,217
+.byte	102,15,56,220,225
+.byte	102,15,56,220,233
+.byte	102,15,56,221,208
+.byte	102,15,56,221,216
+.byte	102,15,56,221,224
+.byte	102,15,56,221,232
+	ret
+.size	_aesni_encrypt4,.-_aesni_encrypt4
+.hidden	_aesni_decrypt4
+.type	_aesni_decrypt4,@function
+.align	16
+_aesni_decrypt4:
+	movups	(%edx),%xmm0
+	movups	16(%edx),%xmm1
+	shll	$4,%ecx
+	xorps	%xmm0,%xmm2
+	pxor	%xmm0,%xmm3
+	pxor	%xmm0,%xmm4
+	pxor	%xmm0,%xmm5
+	movups	32(%edx),%xmm0
+	leal	32(%edx,%ecx,1),%edx
+	negl	%ecx
+.byte	15,31,64,0
+	addl	$16,%ecx
+.L007dec4_loop:
+.byte	102,15,56,222,209
+.byte	102,15,56,222,217
+.byte	102,15,56,222,225
+.byte	102,15,56,222,233
+	movups	(%edx,%ecx,1),%xmm1
+	addl	$32,%ecx
+.byte	102,15,56,222,208
+.byte	102,15,56,222,216
+.byte	102,15,56,222,224
+.byte	102,15,56,222,232
+	movups	-16(%edx,%ecx,1),%xmm0
+	jnz	.L007dec4_loop
+.byte	102,15,56,222,209
+.byte	102,15,56,222,217
+.byte	102,15,56,222,225
+.byte	102,15,56,222,233
+.byte	102,15,56,223,208
+.byte	102,15,56,223,216
+.byte	102,15,56,223,224
+.byte	102,15,56,223,232
+	ret
+.size	_aesni_decrypt4,.-_aesni_decrypt4
+.hidden	_aesni_encrypt6
+.type	_aesni_encrypt6,@function
+.align	16
+_aesni_encrypt6:
+	movups	(%edx),%xmm0
+	shll	$4,%ecx
+	movups	16(%edx),%xmm1
+	xorps	%xmm0,%xmm2
+	pxor	%xmm0,%xmm3
+	pxor	%xmm0,%xmm4
+.byte	102,15,56,220,209
+	pxor	%xmm0,%xmm5
+	pxor	%xmm0,%xmm6
+.byte	102,15,56,220,217
+	leal	32(%edx,%ecx,1),%edx
+	negl	%ecx
+.byte	102,15,56,220,225
+	pxor	%xmm0,%xmm7
+	movups	(%edx,%ecx,1),%xmm0
+	addl	$16,%ecx
+	jmp	.L008_aesni_encrypt6_inner
+.align	16
+.L009enc6_loop:
+.byte	102,15,56,220,209
+.byte	102,15,56,220,217
+.byte	102,15,56,220,225
+.L008_aesni_encrypt6_inner:
+.byte	102,15,56,220,233
+.byte	102,15,56,220,241
+.byte	102,15,56,220,249
+.L_aesni_encrypt6_enter:
+	movups	(%edx,%ecx,1),%xmm1
+	addl	$32,%ecx
+.byte	102,15,56,220,208
+.byte	102,15,56,220,216
+.byte	102,15,56,220,224
+.byte	102,15,56,220,232
+.byte	102,15,56,220,240
+.byte	102,15,56,220,248
+	movups	-16(%edx,%ecx,1),%xmm0
+	jnz	.L009enc6_loop
+.byte	102,15,56,220,209
+.byte	102,15,56,220,217
+.byte	102,15,56,220,225
+.byte	102,15,56,220,233
+.byte	102,15,56,220,241
+.byte	102,15,56,220,249
+.byte	102,15,56,221,208
+.byte	102,15,56,221,216
+.byte	102,15,56,221,224
+.byte	102,15,56,221,232
+.byte	102,15,56,221,240
+.byte	102,15,56,221,248
+	ret
+.size	_aesni_encrypt6,.-_aesni_encrypt6
+.hidden	_aesni_decrypt6
+.type	_aesni_decrypt6,@function
+.align	16
+_aesni_decrypt6:
+	movups	(%edx),%xmm0
+	shll	$4,%ecx
+	movups	16(%edx),%xmm1
+	xorps	%xmm0,%xmm2
+	pxor	%xmm0,%xmm3
+	pxor	%xmm0,%xmm4
+.byte	102,15,56,222,209
+	pxor	%xmm0,%xmm5
+	pxor	%xmm0,%xmm6
+.byte	102,15,56,222,217
+	leal	32(%edx,%ecx,1),%edx
+	negl	%ecx
+.byte	102,15,56,222,225
+	pxor	%xmm0,%xmm7
+	movups	(%edx,%ecx,1),%xmm0
+	addl	$16,%ecx
+	jmp	.L010_aesni_decrypt6_inner
+.align	16
+.L011dec6_loop:
+.byte	102,15,56,222,209
+.byte	102,15,56,222,217
+.byte	102,15,56,222,225
+.L010_aesni_decrypt6_inner:
+.byte	102,15,56,222,233
+.byte	102,15,56,222,241
+.byte	102,15,56,222,249
+.L_aesni_decrypt6_enter:
+	movups	(%edx,%ecx,1),%xmm1
+	addl	$32,%ecx
+.byte	102,15,56,222,208
+.byte	102,15,56,222,216
+.byte	102,15,56,222,224
+.byte	102,15,56,222,232
+.byte	102,15,56,222,240
+.byte	102,15,56,222,248
+	movups	-16(%edx,%ecx,1),%xmm0
+	jnz	.L011dec6_loop
+.byte	102,15,56,222,209
+.byte	102,15,56,222,217
+.byte	102,15,56,222,225
+.byte	102,15,56,222,233
+.byte	102,15,56,222,241
+.byte	102,15,56,222,249
+.byte	102,15,56,223,208
+.byte	102,15,56,223,216
+.byte	102,15,56,223,224
+.byte	102,15,56,223,232
+.byte	102,15,56,223,240
+.byte	102,15,56,223,248
+	ret
+.size	_aesni_decrypt6,.-_aesni_decrypt6
+.globl	aesni_ecb_encrypt
+.hidden	aesni_ecb_encrypt
+.type	aesni_ecb_encrypt,@function
+.align	16
+aesni_ecb_encrypt:
+.L_aesni_ecb_encrypt_begin:
+	pushl	%ebp
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+	movl	20(%esp),%esi
+	movl	24(%esp),%edi
+	movl	28(%esp),%eax
+	movl	32(%esp),%edx
+	movl	36(%esp),%ebx
+	andl	$-16,%eax
+	jz	.L012ecb_ret
+	movl	240(%edx),%ecx
+	testl	%ebx,%ebx
+	jz	.L013ecb_decrypt
+	movl	%edx,%ebp
+	movl	%ecx,%ebx
+	cmpl	$96,%eax
+	jb	.L014ecb_enc_tail
+	movdqu	(%esi),%xmm2
+	movdqu	16(%esi),%xmm3
+	movdqu	32(%esi),%xmm4
+	movdqu	48(%esi),%xmm5
+	movdqu	64(%esi),%xmm6
+	movdqu	80(%esi),%xmm7
+	leal	96(%esi),%esi
+	subl	$96,%eax
+	jmp	.L015ecb_enc_loop6_enter
+.align	16
+.L016ecb_enc_loop6:
+	movups	%xmm2,(%edi)
+	movdqu	(%esi),%xmm2
+	movups	%xmm3,16(%edi)
+	movdqu	16(%esi),%xmm3
+	movups	%xmm4,32(%edi)
+	movdqu	32(%esi),%xmm4
+	movups	%xmm5,48(%edi)
+	movdqu	48(%esi),%xmm5
+	movups	%xmm6,64(%edi)
+	movdqu	64(%esi),%xmm6
+	movups	%xmm7,80(%edi)
+	leal	96(%edi),%edi
+	movdqu	80(%esi),%xmm7
+	leal	96(%esi),%esi
+.L015ecb_enc_loop6_enter:
+	call	_aesni_encrypt6
+	movl	%ebp,%edx
+	movl	%ebx,%ecx
+	subl	$96,%eax
+	jnc	.L016ecb_enc_loop6
+	movups	%xmm2,(%edi)
+	movups	%xmm3,16(%edi)
+	movups	%xmm4,32(%edi)
+	movups	%xmm5,48(%edi)
+	movups	%xmm6,64(%edi)
+	movups	%xmm7,80(%edi)
+	leal	96(%edi),%edi
+	addl	$96,%eax
+	jz	.L012ecb_ret
+.L014ecb_enc_tail:
+	movups	(%esi),%xmm2
+	cmpl	$32,%eax
+	jb	.L017ecb_enc_one
+	movups	16(%esi),%xmm3
+	je	.L018ecb_enc_two
+	movups	32(%esi),%xmm4
+	cmpl	$64,%eax
+	jb	.L019ecb_enc_three
+	movups	48(%esi),%xmm5
+	je	.L020ecb_enc_four
+	movups	64(%esi),%xmm6
+	xorps	%xmm7,%xmm7
+	call	_aesni_encrypt6
+	movups	%xmm2,(%edi)
+	movups	%xmm3,16(%edi)
+	movups	%xmm4,32(%edi)
+	movups	%xmm5,48(%edi)
+	movups	%xmm6,64(%edi)
+	jmp	.L012ecb_ret
+.align	16
+.L017ecb_enc_one:
+	movups	(%edx),%xmm0
+	movups	16(%edx),%xmm1
+	leal	32(%edx),%edx
+	xorps	%xmm0,%xmm2
+.L021enc1_loop_3:
+.byte	102,15,56,220,209
+	decl	%ecx
+	movups	(%edx),%xmm1
+	leal	16(%edx),%edx
+	jnz	.L021enc1_loop_3
+.byte	102,15,56,221,209
+	movups	%xmm2,(%edi)
+	jmp	.L012ecb_ret
+.align	16
+.L018ecb_enc_two:
+	call	_aesni_encrypt2
+	movups	%xmm2,(%edi)
+	movups	%xmm3,16(%edi)
+	jmp	.L012ecb_ret
+.align	16
+.L019ecb_enc_three:
+	call	_aesni_encrypt3
+	movups	%xmm2,(%edi)
+	movups	%xmm3,16(%edi)
+	movups	%xmm4,32(%edi)
+	jmp	.L012ecb_ret
+.align	16
+.L020ecb_enc_four:
+	call	_aesni_encrypt4
+	movups	%xmm2,(%edi)
+	movups	%xmm3,16(%edi)
+	movups	%xmm4,32(%edi)
+	movups	%xmm5,48(%edi)
+	jmp	.L012ecb_ret
+.align	16
+.L013ecb_decrypt:
+	movl	%edx,%ebp
+	movl	%ecx,%ebx
+	cmpl	$96,%eax
+	jb	.L022ecb_dec_tail
+	movdqu	(%esi),%xmm2
+	movdqu	16(%esi),%xmm3
+	movdqu	32(%esi),%xmm4
+	movdqu	48(%esi),%xmm5
+	movdqu	64(%esi),%xmm6
+	movdqu	80(%esi),%xmm7
+	leal	96(%esi),%esi
+	subl	$96,%eax
+	jmp	.L023ecb_dec_loop6_enter
+.align	16
+.L024ecb_dec_loop6:
+	movups	%xmm2,(%edi)
+	movdqu	(%esi),%xmm2
+	movups	%xmm3,16(%edi)
+	movdqu	16(%esi),%xmm3
+	movups	%xmm4,32(%edi)
+	movdqu	32(%esi),%xmm4
+	movups	%xmm5,48(%edi)
+	movdqu	48(%esi),%xmm5
+	movups	%xmm6,64(%edi)
+	movdqu	64(%esi),%xmm6
+	movups	%xmm7,80(%edi)
+	leal	96(%edi),%edi
+	movdqu	80(%esi),%xmm7
+	leal	96(%esi),%esi
+.L023ecb_dec_loop6_enter:
+	call	_aesni_decrypt6
+	movl	%ebp,%edx
+	movl	%ebx,%ecx
+	subl	$96,%eax
+	jnc	.L024ecb_dec_loop6
+	movups	%xmm2,(%edi)
+	movups	%xmm3,16(%edi)
+	movups	%xmm4,32(%edi)
+	movups	%xmm5,48(%edi)
+	movups	%xmm6,64(%edi)
+	movups	%xmm7,80(%edi)
+	leal	96(%edi),%edi
+	addl	$96,%eax
+	jz	.L012ecb_ret
+.L022ecb_dec_tail:
+	movups	(%esi),%xmm2
+	cmpl	$32,%eax
+	jb	.L025ecb_dec_one
+	movups	16(%esi),%xmm3
+	je	.L026ecb_dec_two
+	movups	32(%esi),%xmm4
+	cmpl	$64,%eax
+	jb	.L027ecb_dec_three
+	movups	48(%esi),%xmm5
+	je	.L028ecb_dec_four
+	movups	64(%esi),%xmm6
+	xorps	%xmm7,%xmm7
+	call	_aesni_decrypt6
+	movups	%xmm2,(%edi)
+	movups	%xmm3,16(%edi)
+	movups	%xmm4,32(%edi)
+	movups	%xmm5,48(%edi)
+	movups	%xmm6,64(%edi)
+	jmp	.L012ecb_ret
+.align	16
+.L025ecb_dec_one:
+	movups	(%edx),%xmm0
+	movups	16(%edx),%xmm1
+	leal	32(%edx),%edx
+	xorps	%xmm0,%xmm2
+.L029dec1_loop_4:
+.byte	102,15,56,222,209
+	decl	%ecx
+	movups	(%edx),%xmm1
+	leal	16(%edx),%edx
+	jnz	.L029dec1_loop_4
+.byte	102,15,56,223,209
+	movups	%xmm2,(%edi)
+	jmp	.L012ecb_ret
+.align	16
+.L026ecb_dec_two:
+	call	_aesni_decrypt2
+	movups	%xmm2,(%edi)
+	movups	%xmm3,16(%edi)
+	jmp	.L012ecb_ret
+.align	16
+.L027ecb_dec_three:
+	call	_aesni_decrypt3
+	movups	%xmm2,(%edi)
+	movups	%xmm3,16(%edi)
+	movups	%xmm4,32(%edi)
+	jmp	.L012ecb_ret
+.align	16
+.L028ecb_dec_four:
+	call	_aesni_decrypt4
+	movups	%xmm2,(%edi)
+	movups	%xmm3,16(%edi)
+	movups	%xmm4,32(%edi)
+	movups	%xmm5,48(%edi)
+.L012ecb_ret:
+	pxor	%xmm0,%xmm0
+	pxor	%xmm1,%xmm1
+	pxor	%xmm2,%xmm2
+	pxor	%xmm3,%xmm3
+	pxor	%xmm4,%xmm4
+	pxor	%xmm5,%xmm5
+	pxor	%xmm6,%xmm6
+	pxor	%xmm7,%xmm7
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.size	aesni_ecb_encrypt,.-.L_aesni_ecb_encrypt_begin
+.globl	aesni_ccm64_encrypt_blocks
+.hidden	aesni_ccm64_encrypt_blocks
+.type	aesni_ccm64_encrypt_blocks,@function
+.align	16
+aesni_ccm64_encrypt_blocks:
+.L_aesni_ccm64_encrypt_blocks_begin:
+	pushl	%ebp
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+	movl	20(%esp),%esi
+	movl	24(%esp),%edi
+	movl	28(%esp),%eax
+	movl	32(%esp),%edx
+	movl	36(%esp),%ebx
+	movl	40(%esp),%ecx
+	movl	%esp,%ebp
+	subl	$60,%esp
+	andl	$-16,%esp
+	movl	%ebp,48(%esp)
+	movdqu	(%ebx),%xmm7
+	movdqu	(%ecx),%xmm3
+	movl	240(%edx),%ecx
+	movl	$202182159,(%esp)
+	movl	$134810123,4(%esp)
+	movl	$67438087,8(%esp)
+	movl	$66051,12(%esp)
+	movl	$1,%ebx
+	xorl	%ebp,%ebp
+	movl	%ebx,16(%esp)
+	movl	%ebp,20(%esp)
+	movl	%ebp,24(%esp)
+	movl	%ebp,28(%esp)
+	shll	$4,%ecx
+	movl	$16,%ebx
+	leal	(%edx),%ebp
+	movdqa	(%esp),%xmm5
+	movdqa	%xmm7,%xmm2
+	leal	32(%edx,%ecx,1),%edx
+	subl	%ecx,%ebx
+.byte	102,15,56,0,253
+.L030ccm64_enc_outer:
+	movups	(%ebp),%xmm0
+	movl	%ebx,%ecx
+	movups	(%esi),%xmm6
+	xorps	%xmm0,%xmm2
+	movups	16(%ebp),%xmm1
+	xorps	%xmm6,%xmm0
+	xorps	%xmm0,%xmm3
+	movups	32(%ebp),%xmm0
+.L031ccm64_enc2_loop:
+.byte	102,15,56,220,209
+.byte	102,15,56,220,217
+	movups	(%edx,%ecx,1),%xmm1
+	addl	$32,%ecx
+.byte	102,15,56,220,208
+.byte	102,15,56,220,216
+	movups	-16(%edx,%ecx,1),%xmm0
+	jnz	.L031ccm64_enc2_loop
+.byte	102,15,56,220,209
+.byte	102,15,56,220,217
+	paddq	16(%esp),%xmm7
+	decl	%eax
+.byte	102,15,56,221,208
+.byte	102,15,56,221,216
+	leal	16(%esi),%esi
+	xorps	%xmm2,%xmm6
+	movdqa	%xmm7,%xmm2
+	movups	%xmm6,(%edi)
+.byte	102,15,56,0,213
+	leal	16(%edi),%edi
+	jnz	.L030ccm64_enc_outer
+	movl	48(%esp),%esp
+	movl	40(%esp),%edi
+	movups	%xmm3,(%edi)
+	pxor	%xmm0,%xmm0
+	pxor	%xmm1,%xmm1
+	pxor	%xmm2,%xmm2
+	pxor	%xmm3,%xmm3
+	pxor	%xmm4,%xmm4
+	pxor	%xmm5,%xmm5
+	pxor	%xmm6,%xmm6
+	pxor	%xmm7,%xmm7
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.size	aesni_ccm64_encrypt_blocks,.-.L_aesni_ccm64_encrypt_blocks_begin
+.globl	aesni_ccm64_decrypt_blocks
+.hidden	aesni_ccm64_decrypt_blocks
+.type	aesni_ccm64_decrypt_blocks,@function
+.align	16
+aesni_ccm64_decrypt_blocks:
+.L_aesni_ccm64_decrypt_blocks_begin:
+	pushl	%ebp
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+	movl	20(%esp),%esi
+	movl	24(%esp),%edi
+	movl	28(%esp),%eax
+	movl	32(%esp),%edx
+	movl	36(%esp),%ebx
+	movl	40(%esp),%ecx
+	movl	%esp,%ebp
+	subl	$60,%esp
+	andl	$-16,%esp
+	movl	%ebp,48(%esp)
+	movdqu	(%ebx),%xmm7
+	movdqu	(%ecx),%xmm3
+	movl	240(%edx),%ecx
+	movl	$202182159,(%esp)
+	movl	$134810123,4(%esp)
+	movl	$67438087,8(%esp)
+	movl	$66051,12(%esp)
+	movl	$1,%ebx
+	xorl	%ebp,%ebp
+	movl	%ebx,16(%esp)
+	movl	%ebp,20(%esp)
+	movl	%ebp,24(%esp)
+	movl	%ebp,28(%esp)
+	movdqa	(%esp),%xmm5
+	movdqa	%xmm7,%xmm2
+	movl	%edx,%ebp
+	movl	%ecx,%ebx
+.byte	102,15,56,0,253
+	movups	(%edx),%xmm0
+	movups	16(%edx),%xmm1
+	leal	32(%edx),%edx
+	xorps	%xmm0,%xmm2
+.L032enc1_loop_5:
+.byte	102,15,56,220,209
+	decl	%ecx
+	movups	(%edx),%xmm1
+	leal	16(%edx),%edx
+	jnz	.L032enc1_loop_5
+.byte	102,15,56,221,209
+	shll	$4,%ebx
+	movl	$16,%ecx
+	movups	(%esi),%xmm6
+	paddq	16(%esp),%xmm7
+	leal	16(%esi),%esi
+	subl	%ebx,%ecx
+	leal	32(%ebp,%ebx,1),%edx
+	movl	%ecx,%ebx
+	jmp	.L033ccm64_dec_outer
+.align	16
+.L033ccm64_dec_outer:
+	xorps	%xmm2,%xmm6
+	movdqa	%xmm7,%xmm2
+	movups	%xmm6,(%edi)
+	leal	16(%edi),%edi
+.byte	102,15,56,0,213
+	subl	$1,%eax
+	jz	.L034ccm64_dec_break
+	movups	(%ebp),%xmm0
+	movl	%ebx,%ecx
+	movups	16(%ebp),%xmm1
+	xorps	%xmm0,%xmm6
+	xorps	%xmm0,%xmm2
+	xorps	%xmm6,%xmm3
+	movups	32(%ebp),%xmm0
+.L035ccm64_dec2_loop:
+.byte	102,15,56,220,209
+.byte	102,15,56,220,217
+	movups	(%edx,%ecx,1),%xmm1
+	addl	$32,%ecx
+.byte	102,15,56,220,208
+.byte	102,15,56,220,216
+	movups	-16(%edx,%ecx,1),%xmm0
+	jnz	.L035ccm64_dec2_loop
+	movups	(%esi),%xmm6
+	paddq	16(%esp),%xmm7
+.byte	102,15,56,220,209
+.byte	102,15,56,220,217
+.byte	102,15,56,221,208
+.byte	102,15,56,221,216
+	leal	16(%esi),%esi
+	jmp	.L033ccm64_dec_outer
+.align	16
+.L034ccm64_dec_break:
+	movl	240(%ebp),%ecx
+	movl	%ebp,%edx
+	movups	(%edx),%xmm0
+	movups	16(%edx),%xmm1
+	xorps	%xmm0,%xmm6
+	leal	32(%edx),%edx
+	xorps	%xmm6,%xmm3
+.L036enc1_loop_6:
+.byte	102,15,56,220,217
+	decl	%ecx
+	movups	(%edx),%xmm1
+	leal	16(%edx),%edx
+	jnz	.L036enc1_loop_6
+.byte	102,15,56,221,217
+	movl	48(%esp),%esp
+	movl	40(%esp),%edi
+	movups	%xmm3,(%edi)
+	pxor	%xmm0,%xmm0
+	pxor	%xmm1,%xmm1
+	pxor	%xmm2,%xmm2
+	pxor	%xmm3,%xmm3
+	pxor	%xmm4,%xmm4
+	pxor	%xmm5,%xmm5
+	pxor	%xmm6,%xmm6
+	pxor	%xmm7,%xmm7
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.size	aesni_ccm64_decrypt_blocks,.-.L_aesni_ccm64_decrypt_blocks_begin
+.globl	aesni_ctr32_encrypt_blocks
+.hidden	aesni_ctr32_encrypt_blocks
+.type	aesni_ctr32_encrypt_blocks,@function
+.align	16
+aesni_ctr32_encrypt_blocks:
+.L_aesni_ctr32_encrypt_blocks_begin:
+	pushl	%ebp
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+	movl	20(%esp),%esi
+	movl	24(%esp),%edi
+	movl	28(%esp),%eax
+	movl	32(%esp),%edx
+	movl	36(%esp),%ebx
+	movl	%esp,%ebp
+	subl	$88,%esp
+	andl	$-16,%esp
+	movl	%ebp,80(%esp)
+	cmpl	$1,%eax
+	je	.L037ctr32_one_shortcut
+	movdqu	(%ebx),%xmm7
+	movl	$202182159,(%esp)
+	movl	$134810123,4(%esp)
+	movl	$67438087,8(%esp)
+	movl	$66051,12(%esp)
+	movl	$6,%ecx
+	xorl	%ebp,%ebp
+	movl	%ecx,16(%esp)
+	movl	%ecx,20(%esp)
+	movl	%ecx,24(%esp)
+	movl	%ebp,28(%esp)
+.byte	102,15,58,22,251,3
+.byte	102,15,58,34,253,3
+	movl	240(%edx),%ecx
+	bswap	%ebx
+	pxor	%xmm0,%xmm0
+	pxor	%xmm1,%xmm1
+	movdqa	(%esp),%xmm2
+.byte	102,15,58,34,195,0
+	leal	3(%ebx),%ebp
+.byte	102,15,58,34,205,0
+	incl	%ebx
+.byte	102,15,58,34,195,1
+	incl	%ebp
+.byte	102,15,58,34,205,1
+	incl	%ebx
+.byte	102,15,58,34,195,2
+	incl	%ebp
+.byte	102,15,58,34,205,2
+	movdqa	%xmm0,48(%esp)
+.byte	102,15,56,0,194
+	movdqu	(%edx),%xmm6
+	movdqa	%xmm1,64(%esp)
+.byte	102,15,56,0,202
+	pshufd	$192,%xmm0,%xmm2
+	pshufd	$128,%xmm0,%xmm3
+	cmpl	$6,%eax
+	jb	.L038ctr32_tail
+	pxor	%xmm6,%xmm7
+	shll	$4,%ecx
+	movl	$16,%ebx
+	movdqa	%xmm7,32(%esp)
+	movl	%edx,%ebp
+	subl	%ecx,%ebx
+	leal	32(%edx,%ecx,1),%edx
+	subl	$6,%eax
+	jmp	.L039ctr32_loop6
+.align	16
+.L039ctr32_loop6:
+	pshufd	$64,%xmm0,%xmm4
+	movdqa	32(%esp),%xmm0
+	pshufd	$192,%xmm1,%xmm5
+	pxor	%xmm0,%xmm2
+	pshufd	$128,%xmm1,%xmm6
+	pxor	%xmm0,%xmm3
+	pshufd	$64,%xmm1,%xmm7
+	movups	16(%ebp),%xmm1
+	pxor	%xmm0,%xmm4
+	pxor	%xmm0,%xmm5
+.byte	102,15,56,220,209
+	pxor	%xmm0,%xmm6
+	pxor	%xmm0,%xmm7
+.byte	102,15,56,220,217
+	movups	32(%ebp),%xmm0
+	movl	%ebx,%ecx
+.byte	102,15,56,220,225
+.byte	102,15,56,220,233
+.byte	102,15,56,220,241
+.byte	102,15,56,220,249
+	call	.L_aesni_encrypt6_enter
+	movups	(%esi),%xmm1
+	movups	16(%esi),%xmm0
+	xorps	%xmm1,%xmm2
+	movups	32(%esi),%xmm1
+	xorps	%xmm0,%xmm3
+	movups	%xmm2,(%edi)
+	movdqa	16(%esp),%xmm0
+	xorps	%xmm1,%xmm4
+	movdqa	64(%esp),%xmm1
+	movups	%xmm3,16(%edi)
+	movups	%xmm4,32(%edi)
+	paddd	%xmm0,%xmm1
+	paddd	48(%esp),%xmm0
+	movdqa	(%esp),%xmm2
+	movups	48(%esi),%xmm3
+	movups	64(%esi),%xmm4
+	xorps	%xmm3,%xmm5
+	movups	80(%esi),%xmm3
+	leal	96(%esi),%esi
+	movdqa	%xmm0,48(%esp)
+.byte	102,15,56,0,194
+	xorps	%xmm4,%xmm6
+	movups	%xmm5,48(%edi)
+	xorps	%xmm3,%xmm7
+	movdqa	%xmm1,64(%esp)
+.byte	102,15,56,0,202
+	movups	%xmm6,64(%edi)
+	pshufd	$192,%xmm0,%xmm2
+	movups	%xmm7,80(%edi)
+	leal	96(%edi),%edi
+	pshufd	$128,%xmm0,%xmm3
+	subl	$6,%eax
+	jnc	.L039ctr32_loop6
+	addl	$6,%eax
+	jz	.L040ctr32_ret
+	movdqu	(%ebp),%xmm7
+	movl	%ebp,%edx
+	pxor	32(%esp),%xmm7
+	movl	240(%ebp),%ecx
+.L038ctr32_tail:
+	por	%xmm7,%xmm2
+	cmpl	$2,%eax
+	jb	.L041ctr32_one
+	pshufd	$64,%xmm0,%xmm4
+	por	%xmm7,%xmm3
+	je	.L042ctr32_two
+	pshufd	$192,%xmm1,%xmm5
+	por	%xmm7,%xmm4
+	cmpl	$4,%eax
+	jb	.L043ctr32_three
+	pshufd	$128,%xmm1,%xmm6
+	por	%xmm7,%xmm5
+	je	.L044ctr32_four
+	por	%xmm7,%xmm6
+	call	_aesni_encrypt6
+	movups	(%esi),%xmm1
+	movups	16(%esi),%xmm0
+	xorps	%xmm1,%xmm2
+	movups	32(%esi),%xmm1
+	xorps	%xmm0,%xmm3
+	movups	48(%esi),%xmm0
+	xorps	%xmm1,%xmm4
+	movups	64(%esi),%xmm1
+	xorps	%xmm0,%xmm5
+	movups	%xmm2,(%edi)
+	xorps	%xmm1,%xmm6
+	movups	%xmm3,16(%edi)
+	movups	%xmm4,32(%edi)
+	movups	%xmm5,48(%edi)
+	movups	%xmm6,64(%edi)
+	jmp	.L040ctr32_ret
+.align	16
+.L037ctr32_one_shortcut:
+	movups	(%ebx),%xmm2
+	movl	240(%edx),%ecx
+.L041ctr32_one:
+	movups	(%edx),%xmm0
+	movups	16(%edx),%xmm1
+	leal	32(%edx),%edx
+	xorps	%xmm0,%xmm2
+.L045enc1_loop_7:
+.byte	102,15,56,220,209
+	decl	%ecx
+	movups	(%edx),%xmm1
+	leal	16(%edx),%edx
+	jnz	.L045enc1_loop_7
+.byte	102,15,56,221,209
+	movups	(%esi),%xmm6
+	xorps	%xmm2,%xmm6
+	movups	%xmm6,(%edi)
+	jmp	.L040ctr32_ret
+.align	16
+.L042ctr32_two:
+	call	_aesni_encrypt2
+	movups	(%esi),%xmm5
+	movups	16(%esi),%xmm6
+	xorps	%xmm5,%xmm2
+	xorps	%xmm6,%xmm3
+	movups	%xmm2,(%edi)
+	movups	%xmm3,16(%edi)
+	jmp	.L040ctr32_ret
+.align	16
+.L043ctr32_three:
+	call	_aesni_encrypt3
+	movups	(%esi),%xmm5
+	movups	16(%esi),%xmm6
+	xorps	%xmm5,%xmm2
+	movups	32(%esi),%xmm7
+	xorps	%xmm6,%xmm3
+	movups	%xmm2,(%edi)
+	xorps	%xmm7,%xmm4
+	movups	%xmm3,16(%edi)
+	movups	%xmm4,32(%edi)
+	jmp	.L040ctr32_ret
+.align	16
+.L044ctr32_four:
+	call	_aesni_encrypt4
+	movups	(%esi),%xmm6
+	movups	16(%esi),%xmm7
+	movups	32(%esi),%xmm1
+	xorps	%xmm6,%xmm2
+	movups	48(%esi),%xmm0
+	xorps	%xmm7,%xmm3
+	movups	%xmm2,(%edi)
+	xorps	%xmm1,%xmm4
+	movups	%xmm3,16(%edi)
+	xorps	%xmm0,%xmm5
+	movups	%xmm4,32(%edi)
+	movups	%xmm5,48(%edi)
+.L040ctr32_ret:
+	pxor	%xmm0,%xmm0
+	pxor	%xmm1,%xmm1
+	pxor	%xmm2,%xmm2
+	pxor	%xmm3,%xmm3
+	pxor	%xmm4,%xmm4
+	movdqa	%xmm0,32(%esp)
+	pxor	%xmm5,%xmm5
+	movdqa	%xmm0,48(%esp)
+	pxor	%xmm6,%xmm6
+	movdqa	%xmm0,64(%esp)
+	pxor	%xmm7,%xmm7
+	movl	80(%esp),%esp
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.size	aesni_ctr32_encrypt_blocks,.-.L_aesni_ctr32_encrypt_blocks_begin
+.globl	aesni_xts_encrypt
+.hidden	aesni_xts_encrypt
+.type	aesni_xts_encrypt,@function
+.align	16
+aesni_xts_encrypt:
+.L_aesni_xts_encrypt_begin:
+	pushl	%ebp
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+	movl	36(%esp),%edx
+	movl	40(%esp),%esi
+	movl	240(%edx),%ecx
+	movups	(%esi),%xmm2
+	movups	(%edx),%xmm0
+	movups	16(%edx),%xmm1
+	leal	32(%edx),%edx
+	xorps	%xmm0,%xmm2
+.L046enc1_loop_8:
+.byte	102,15,56,220,209
+	decl	%ecx
+	movups	(%edx),%xmm1
+	leal	16(%edx),%edx
+	jnz	.L046enc1_loop_8
+.byte	102,15,56,221,209
+	movl	20(%esp),%esi
+	movl	24(%esp),%edi
+	movl	28(%esp),%eax
+	movl	32(%esp),%edx
+	movl	%esp,%ebp
+	subl	$120,%esp
+	movl	240(%edx),%ecx
+	andl	$-16,%esp
+	movl	$135,96(%esp)
+	movl	$0,100(%esp)
+	movl	$1,104(%esp)
+	movl	$0,108(%esp)
+	movl	%eax,112(%esp)
+	movl	%ebp,116(%esp)
+	movdqa	%xmm2,%xmm1
+	pxor	%xmm0,%xmm0
+	movdqa	96(%esp),%xmm3
+	pcmpgtd	%xmm1,%xmm0
+	andl	$-16,%eax
+	movl	%edx,%ebp
+	movl	%ecx,%ebx
+	subl	$96,%eax
+	jc	.L047xts_enc_short
+	shll	$4,%ecx
+	movl	$16,%ebx
+	subl	%ecx,%ebx
+	leal	32(%edx,%ecx,1),%edx
+	jmp	.L048xts_enc_loop6
+.align	16
+.L048xts_enc_loop6:
+	pshufd	$19,%xmm0,%xmm2
+	pxor	%xmm0,%xmm0
+	movdqa	%xmm1,(%esp)
+	paddq	%xmm1,%xmm1
+	pand	%xmm3,%xmm2
+	pcmpgtd	%xmm1,%xmm0
+	pxor	%xmm2,%xmm1
+	pshufd	$19,%xmm0,%xmm2
+	pxor	%xmm0,%xmm0
+	movdqa	%xmm1,16(%esp)
+	paddq	%xmm1,%xmm1
+	pand	%xmm3,%xmm2
+	pcmpgtd	%xmm1,%xmm0
+	pxor	%xmm2,%xmm1
+	pshufd	$19,%xmm0,%xmm2
+	pxor	%xmm0,%xmm0
+	movdqa	%xmm1,32(%esp)
+	paddq	%xmm1,%xmm1
+	pand	%xmm3,%xmm2
+	pcmpgtd	%xmm1,%xmm0
+	pxor	%xmm2,%xmm1
+	pshufd	$19,%xmm0,%xmm2
+	pxor	%xmm0,%xmm0
+	movdqa	%xmm1,48(%esp)
+	paddq	%xmm1,%xmm1
+	pand	%xmm3,%xmm2
+	pcmpgtd	%xmm1,%xmm0
+	pxor	%xmm2,%xmm1
+	pshufd	$19,%xmm0,%xmm7
+	movdqa	%xmm1,64(%esp)
+	paddq	%xmm1,%xmm1
+	movups	(%ebp),%xmm0
+	pand	%xmm3,%xmm7
+	movups	(%esi),%xmm2
+	pxor	%xmm1,%xmm7
+	movl	%ebx,%ecx
+	movdqu	16(%esi),%xmm3
+	xorps	%xmm0,%xmm2
+	movdqu	32(%esi),%xmm4
+	pxor	%xmm0,%xmm3
+	movdqu	48(%esi),%xmm5
+	pxor	%xmm0,%xmm4
+	movdqu	64(%esi),%xmm6
+	pxor	%xmm0,%xmm5
+	movdqu	80(%esi),%xmm1
+	pxor	%xmm0,%xmm6
+	leal	96(%esi),%esi
+	pxor	(%esp),%xmm2
+	movdqa	%xmm7,80(%esp)
+	pxor	%xmm1,%xmm7
+	movups	16(%ebp),%xmm1
+	pxor	16(%esp),%xmm3
+	pxor	32(%esp),%xmm4
+.byte	102,15,56,220,209
+	pxor	48(%esp),%xmm5
+	pxor	64(%esp),%xmm6
+.byte	102,15,56,220,217
+	pxor	%xmm0,%xmm7
+	movups	32(%ebp),%xmm0
+.byte	102,15,56,220,225
+.byte	102,15,56,220,233
+.byte	102,15,56,220,241
+.byte	102,15,56,220,249
+	call	.L_aesni_encrypt6_enter
+	movdqa	80(%esp),%xmm1
+	pxor	%xmm0,%xmm0
+	xorps	(%esp),%xmm2
+	pcmpgtd	%xmm1,%xmm0
+	xorps	16(%esp),%xmm3
+	movups	%xmm2,(%edi)
+	xorps	32(%esp),%xmm4
+	movups	%xmm3,16(%edi)
+	xorps	48(%esp),%xmm5
+	movups	%xmm4,32(%edi)
+	xorps	64(%esp),%xmm6
+	movups	%xmm5,48(%edi)
+	xorps	%xmm1,%xmm7
+	movups	%xmm6,64(%edi)
+	pshufd	$19,%xmm0,%xmm2
+	movups	%xmm7,80(%edi)
+	leal	96(%edi),%edi
+	movdqa	96(%esp),%xmm3
+	pxor	%xmm0,%xmm0
+	paddq	%xmm1,%xmm1
+	pand	%xmm3,%xmm2
+	pcmpgtd	%xmm1,%xmm0
+	pxor	%xmm2,%xmm1
+	subl	$96,%eax
+	jnc	.L048xts_enc_loop6
+	movl	240(%ebp),%ecx
+	movl	%ebp,%edx
+	movl	%ecx,%ebx
+.L047xts_enc_short:
+	addl	$96,%eax
+	jz	.L049xts_enc_done6x
+	movdqa	%xmm1,%xmm5
+	cmpl	$32,%eax
+	jb	.L050xts_enc_one
+	pshufd	$19,%xmm0,%xmm2
+	pxor	%xmm0,%xmm0
+	paddq	%xmm1,%xmm1
+	pand	%xmm3,%xmm2
+	pcmpgtd	%xmm1,%xmm0
+	pxor	%xmm2,%xmm1
+	je	.L051xts_enc_two
+	pshufd	$19,%xmm0,%xmm2
+	pxor	%xmm0,%xmm0
+	movdqa	%xmm1,%xmm6
+	paddq	%xmm1,%xmm1
+	pand	%xmm3,%xmm2
+	pcmpgtd	%xmm1,%xmm0
+	pxor	%xmm2,%xmm1
+	cmpl	$64,%eax
+	jb	.L052xts_enc_three
+	pshufd	$19,%xmm0,%xmm2
+	pxor	%xmm0,%xmm0
+	movdqa	%xmm1,%xmm7
+	paddq	%xmm1,%xmm1
+	pand	%xmm3,%xmm2
+	pcmpgtd	%xmm1,%xmm0
+	pxor	%xmm2,%xmm1
+	movdqa	%xmm5,(%esp)
+	movdqa	%xmm6,16(%esp)
+	je	.L053xts_enc_four
+	movdqa	%xmm7,32(%esp)
+	pshufd	$19,%xmm0,%xmm7
+	movdqa	%xmm1,48(%esp)
+	paddq	%xmm1,%xmm1
+	pand	%xmm3,%xmm7
+	pxor	%xmm1,%xmm7
+	movdqu	(%esi),%xmm2
+	movdqu	16(%esi),%xmm3
+	movdqu	32(%esi),%xmm4
+	pxor	(%esp),%xmm2
+	movdqu	48(%esi),%xmm5
+	pxor	16(%esp),%xmm3
+	movdqu	64(%esi),%xmm6
+	pxor	32(%esp),%xmm4
+	leal	80(%esi),%esi
+	pxor	48(%esp),%xmm5
+	movdqa	%xmm7,64(%esp)
+	pxor	%xmm7,%xmm6
+	call	_aesni_encrypt6
+	movaps	64(%esp),%xmm1
+	xorps	(%esp),%xmm2
+	xorps	16(%esp),%xmm3
+	xorps	32(%esp),%xmm4
+	movups	%xmm2,(%edi)
+	xorps	48(%esp),%xmm5
+	movups	%xmm3,16(%edi)
+	xorps	%xmm1,%xmm6
+	movups	%xmm4,32(%edi)
+	movups	%xmm5,48(%edi)
+	movups	%xmm6,64(%edi)
+	leal	80(%edi),%edi
+	jmp	.L054xts_enc_done
+.align	16
+.L050xts_enc_one:
+	movups	(%esi),%xmm2
+	leal	16(%esi),%esi
+	xorps	%xmm5,%xmm2
+	movups	(%edx),%xmm0
+	movups	16(%edx),%xmm1
+	leal	32(%edx),%edx
+	xorps	%xmm0,%xmm2
+.L055enc1_loop_9:
+.byte	102,15,56,220,209
+	decl	%ecx
+	movups	(%edx),%xmm1
+	leal	16(%edx),%edx
+	jnz	.L055enc1_loop_9
+.byte	102,15,56,221,209
+	xorps	%xmm5,%xmm2
+	movups	%xmm2,(%edi)
+	leal	16(%edi),%edi
+	movdqa	%xmm5,%xmm1
+	jmp	.L054xts_enc_done
+.align	16
+.L051xts_enc_two:
+	movaps	%xmm1,%xmm6
+	movups	(%esi),%xmm2
+	movups	16(%esi),%xmm3
+	leal	32(%esi),%esi
+	xorps	%xmm5,%xmm2
+	xorps	%xmm6,%xmm3
+	call	_aesni_encrypt2
+	xorps	%xmm5,%xmm2
+	xorps	%xmm6,%xmm3
+	movups	%xmm2,(%edi)
+	movups	%xmm3,16(%edi)
+	leal	32(%edi),%edi
+	movdqa	%xmm6,%xmm1
+	jmp	.L054xts_enc_done
+.align	16
+.L052xts_enc_three:
+	movaps	%xmm1,%xmm7
+	movups	(%esi),%xmm2
+	movups	16(%esi),%xmm3
+	movups	32(%esi),%xmm4
+	leal	48(%esi),%esi
+	xorps	%xmm5,%xmm2
+	xorps	%xmm6,%xmm3
+	xorps	%xmm7,%xmm4
+	call	_aesni_encrypt3
+	xorps	%xmm5,%xmm2
+	xorps	%xmm6,%xmm3
+	xorps	%xmm7,%xmm4
+	movups	%xmm2,(%edi)
+	movups	%xmm3,16(%edi)
+	movups	%xmm4,32(%edi)
+	leal	48(%edi),%edi
+	movdqa	%xmm7,%xmm1
+	jmp	.L054xts_enc_done
+.align	16
+.L053xts_enc_four:
+	movaps	%xmm1,%xmm6
+	movups	(%esi),%xmm2
+	movups	16(%esi),%xmm3
+	movups	32(%esi),%xmm4
+	xorps	(%esp),%xmm2
+	movups	48(%esi),%xmm5
+	leal	64(%esi),%esi
+	xorps	16(%esp),%xmm3
+	xorps	%xmm7,%xmm4
+	xorps	%xmm6,%xmm5
+	call	_aesni_encrypt4
+	xorps	(%esp),%xmm2
+	xorps	16(%esp),%xmm3
+	xorps	%xmm7,%xmm4
+	movups	%xmm2,(%edi)
+	xorps	%xmm6,%xmm5
+	movups	%xmm3,16(%edi)
+	movups	%xmm4,32(%edi)
+	movups	%xmm5,48(%edi)
+	leal	64(%edi),%edi
+	movdqa	%xmm6,%xmm1
+	jmp	.L054xts_enc_done
+.align	16
+.L049xts_enc_done6x:
+	movl	112(%esp),%eax
+	andl	$15,%eax
+	jz	.L056xts_enc_ret
+	movdqa	%xmm1,%xmm5
+	movl	%eax,112(%esp)
+	jmp	.L057xts_enc_steal
+.align	16
+.L054xts_enc_done:
+	movl	112(%esp),%eax
+	pxor	%xmm0,%xmm0
+	andl	$15,%eax
+	jz	.L056xts_enc_ret
+	pcmpgtd	%xmm1,%xmm0
+	movl	%eax,112(%esp)
+	pshufd	$19,%xmm0,%xmm5
+	paddq	%xmm1,%xmm1
+	pand	96(%esp),%xmm5
+	pxor	%xmm1,%xmm5
+.L057xts_enc_steal:
+	movzbl	(%esi),%ecx
+	movzbl	-16(%edi),%edx
+	leal	1(%esi),%esi
+	movb	%cl,-16(%edi)
+	movb	%dl,(%edi)
+	leal	1(%edi),%edi
+	subl	$1,%eax
+	jnz	.L057xts_enc_steal
+	subl	112(%esp),%edi
+	movl	%ebp,%edx
+	movl	%ebx,%ecx
+	movups	-16(%edi),%xmm2
+	xorps	%xmm5,%xmm2
+	movups	(%edx),%xmm0
+	movups	16(%edx),%xmm1
+	leal	32(%edx),%edx
+	xorps	%xmm0,%xmm2
+.L058enc1_loop_10:
+.byte	102,15,56,220,209
+	decl	%ecx
+	movups	(%edx),%xmm1
+	leal	16(%edx),%edx
+	jnz	.L058enc1_loop_10
+.byte	102,15,56,221,209
+	xorps	%xmm5,%xmm2
+	movups	%xmm2,-16(%edi)
+.L056xts_enc_ret:
+	pxor	%xmm0,%xmm0
+	pxor	%xmm1,%xmm1
+	pxor	%xmm2,%xmm2
+	movdqa	%xmm0,(%esp)
+	pxor	%xmm3,%xmm3
+	movdqa	%xmm0,16(%esp)
+	pxor	%xmm4,%xmm4
+	movdqa	%xmm0,32(%esp)
+	pxor	%xmm5,%xmm5
+	movdqa	%xmm0,48(%esp)
+	pxor	%xmm6,%xmm6
+	movdqa	%xmm0,64(%esp)
+	pxor	%xmm7,%xmm7
+	movdqa	%xmm0,80(%esp)
+	movl	116(%esp),%esp
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.size	aesni_xts_encrypt,.-.L_aesni_xts_encrypt_begin
+.globl	aesni_xts_decrypt
+.hidden	aesni_xts_decrypt
+.type	aesni_xts_decrypt,@function
+.align	16
+aesni_xts_decrypt:
+.L_aesni_xts_decrypt_begin:
+	pushl	%ebp
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+	movl	36(%esp),%edx
+	movl	40(%esp),%esi
+	movl	240(%edx),%ecx
+	movups	(%esi),%xmm2
+	movups	(%edx),%xmm0
+	movups	16(%edx),%xmm1
+	leal	32(%edx),%edx
+	xorps	%xmm0,%xmm2
+.L059enc1_loop_11:
+.byte	102,15,56,220,209
+	decl	%ecx
+	movups	(%edx),%xmm1
+	leal	16(%edx),%edx
+	jnz	.L059enc1_loop_11
+.byte	102,15,56,221,209
+	movl	20(%esp),%esi
+	movl	24(%esp),%edi
+	movl	28(%esp),%eax
+	movl	32(%esp),%edx
+	movl	%esp,%ebp
+	subl	$120,%esp
+	andl	$-16,%esp
+	xorl	%ebx,%ebx
+	testl	$15,%eax
+	setnz	%bl
+	shll	$4,%ebx
+	subl	%ebx,%eax
+	movl	$135,96(%esp)
+	movl	$0,100(%esp)
+	movl	$1,104(%esp)
+	movl	$0,108(%esp)
+	movl	%eax,112(%esp)
+	movl	%ebp,116(%esp)
+	movl	240(%edx),%ecx
+	movl	%edx,%ebp
+	movl	%ecx,%ebx
+	movdqa	%xmm2,%xmm1
+	pxor	%xmm0,%xmm0
+	movdqa	96(%esp),%xmm3
+	pcmpgtd	%xmm1,%xmm0
+	andl	$-16,%eax
+	subl	$96,%eax
+	jc	.L060xts_dec_short
+	shll	$4,%ecx
+	movl	$16,%ebx
+	subl	%ecx,%ebx
+	leal	32(%edx,%ecx,1),%edx
+	jmp	.L061xts_dec_loop6
+.align	16
+.L061xts_dec_loop6:
+	pshufd	$19,%xmm0,%xmm2
+	pxor	%xmm0,%xmm0
+	movdqa	%xmm1,(%esp)
+	paddq	%xmm1,%xmm1
+	pand	%xmm3,%xmm2
+	pcmpgtd	%xmm1,%xmm0
+	pxor	%xmm2,%xmm1
+	pshufd	$19,%xmm0,%xmm2
+	pxor	%xmm0,%xmm0
+	movdqa	%xmm1,16(%esp)
+	paddq	%xmm1,%xmm1
+	pand	%xmm3,%xmm2
+	pcmpgtd	%xmm1,%xmm0
+	pxor	%xmm2,%xmm1
+	pshufd	$19,%xmm0,%xmm2
+	pxor	%xmm0,%xmm0
+	movdqa	%xmm1,32(%esp)
+	paddq	%xmm1,%xmm1
+	pand	%xmm3,%xmm2
+	pcmpgtd	%xmm1,%xmm0
+	pxor	%xmm2,%xmm1
+	pshufd	$19,%xmm0,%xmm2
+	pxor	%xmm0,%xmm0
+	movdqa	%xmm1,48(%esp)
+	paddq	%xmm1,%xmm1
+	pand	%xmm3,%xmm2
+	pcmpgtd	%xmm1,%xmm0
+	pxor	%xmm2,%xmm1
+	pshufd	$19,%xmm0,%xmm7
+	movdqa	%xmm1,64(%esp)
+	paddq	%xmm1,%xmm1
+	movups	(%ebp),%xmm0
+	pand	%xmm3,%xmm7
+	movups	(%esi),%xmm2
+	pxor	%xmm1,%xmm7
+	movl	%ebx,%ecx
+	movdqu	16(%esi),%xmm3
+	xorps	%xmm0,%xmm2
+	movdqu	32(%esi),%xmm4
+	pxor	%xmm0,%xmm3
+	movdqu	48(%esi),%xmm5
+	pxor	%xmm0,%xmm4
+	movdqu	64(%esi),%xmm6
+	pxor	%xmm0,%xmm5
+	movdqu	80(%esi),%xmm1
+	pxor	%xmm0,%xmm6
+	leal	96(%esi),%esi
+	pxor	(%esp),%xmm2
+	movdqa	%xmm7,80(%esp)
+	pxor	%xmm1,%xmm7
+	movups	16(%ebp),%xmm1
+	pxor	16(%esp),%xmm3
+	pxor	32(%esp),%xmm4
+.byte	102,15,56,222,209
+	pxor	48(%esp),%xmm5
+	pxor	64(%esp),%xmm6
+.byte	102,15,56,222,217
+	pxor	%xmm0,%xmm7
+	movups	32(%ebp),%xmm0
+.byte	102,15,56,222,225
+.byte	102,15,56,222,233
+.byte	102,15,56,222,241
+.byte	102,15,56,222,249
+	call	.L_aesni_decrypt6_enter
+	movdqa	80(%esp),%xmm1
+	pxor	%xmm0,%xmm0
+	xorps	(%esp),%xmm2
+	pcmpgtd	%xmm1,%xmm0
+	xorps	16(%esp),%xmm3
+	movups	%xmm2,(%edi)
+	xorps	32(%esp),%xmm4
+	movups	%xmm3,16(%edi)
+	xorps	48(%esp),%xmm5
+	movups	%xmm4,32(%edi)
+	xorps	64(%esp),%xmm6
+	movups	%xmm5,48(%edi)
+	xorps	%xmm1,%xmm7
+	movups	%xmm6,64(%edi)
+	pshufd	$19,%xmm0,%xmm2
+	movups	%xmm7,80(%edi)
+	leal	96(%edi),%edi
+	movdqa	96(%esp),%xmm3
+	pxor	%xmm0,%xmm0
+	paddq	%xmm1,%xmm1
+	pand	%xmm3,%xmm2
+	pcmpgtd	%xmm1,%xmm0
+	pxor	%xmm2,%xmm1
+	subl	$96,%eax
+	jnc	.L061xts_dec_loop6
+	movl	240(%ebp),%ecx
+	movl	%ebp,%edx
+	movl	%ecx,%ebx
+.L060xts_dec_short:
+	addl	$96,%eax
+	jz	.L062xts_dec_done6x
+	movdqa	%xmm1,%xmm5
+	cmpl	$32,%eax
+	jb	.L063xts_dec_one
+	pshufd	$19,%xmm0,%xmm2
+	pxor	%xmm0,%xmm0
+	paddq	%xmm1,%xmm1
+	pand	%xmm3,%xmm2
+	pcmpgtd	%xmm1,%xmm0
+	pxor	%xmm2,%xmm1
+	je	.L064xts_dec_two
+	pshufd	$19,%xmm0,%xmm2
+	pxor	%xmm0,%xmm0
+	movdqa	%xmm1,%xmm6
+	paddq	%xmm1,%xmm1
+	pand	%xmm3,%xmm2
+	pcmpgtd	%xmm1,%xmm0
+	pxor	%xmm2,%xmm1
+	cmpl	$64,%eax
+	jb	.L065xts_dec_three
+	pshufd	$19,%xmm0,%xmm2
+	pxor	%xmm0,%xmm0
+	movdqa	%xmm1,%xmm7
+	paddq	%xmm1,%xmm1
+	pand	%xmm3,%xmm2
+	pcmpgtd	%xmm1,%xmm0
+	pxor	%xmm2,%xmm1
+	movdqa	%xmm5,(%esp)
+	movdqa	%xmm6,16(%esp)
+	je	.L066xts_dec_four
+	movdqa	%xmm7,32(%esp)
+	pshufd	$19,%xmm0,%xmm7
+	movdqa	%xmm1,48(%esp)
+	paddq	%xmm1,%xmm1
+	pand	%xmm3,%xmm7
+	pxor	%xmm1,%xmm7
+	movdqu	(%esi),%xmm2
+	movdqu	16(%esi),%xmm3
+	movdqu	32(%esi),%xmm4
+	pxor	(%esp),%xmm2
+	movdqu	48(%esi),%xmm5
+	pxor	16(%esp),%xmm3
+	movdqu	64(%esi),%xmm6
+	pxor	32(%esp),%xmm4
+	leal	80(%esi),%esi
+	pxor	48(%esp),%xmm5
+	movdqa	%xmm7,64(%esp)
+	pxor	%xmm7,%xmm6
+	call	_aesni_decrypt6
+	movaps	64(%esp),%xmm1
+	xorps	(%esp),%xmm2
+	xorps	16(%esp),%xmm3
+	xorps	32(%esp),%xmm4
+	movups	%xmm2,(%edi)
+	xorps	48(%esp),%xmm5
+	movups	%xmm3,16(%edi)
+	xorps	%xmm1,%xmm6
+	movups	%xmm4,32(%edi)
+	movups	%xmm5,48(%edi)
+	movups	%xmm6,64(%edi)
+	leal	80(%edi),%edi
+	jmp	.L067xts_dec_done
+.align	16
+.L063xts_dec_one:
+	movups	(%esi),%xmm2
+	leal	16(%esi),%esi
+	xorps	%xmm5,%xmm2
+	movups	(%edx),%xmm0
+	movups	16(%edx),%xmm1
+	leal	32(%edx),%edx
+	xorps	%xmm0,%xmm2
+.L068dec1_loop_12:
+.byte	102,15,56,222,209
+	decl	%ecx
+	movups	(%edx),%xmm1
+	leal	16(%edx),%edx
+	jnz	.L068dec1_loop_12
+.byte	102,15,56,223,209
+	xorps	%xmm5,%xmm2
+	movups	%xmm2,(%edi)
+	leal	16(%edi),%edi
+	movdqa	%xmm5,%xmm1
+	jmp	.L067xts_dec_done
+.align	16
+.L064xts_dec_two:
+	movaps	%xmm1,%xmm6
+	movups	(%esi),%xmm2
+	movups	16(%esi),%xmm3
+	leal	32(%esi),%esi
+	xorps	%xmm5,%xmm2
+	xorps	%xmm6,%xmm3
+	call	_aesni_decrypt2
+	xorps	%xmm5,%xmm2
+	xorps	%xmm6,%xmm3
+	movups	%xmm2,(%edi)
+	movups	%xmm3,16(%edi)
+	leal	32(%edi),%edi
+	movdqa	%xmm6,%xmm1
+	jmp	.L067xts_dec_done
+.align	16
+.L065xts_dec_three:
+	movaps	%xmm1,%xmm7
+	movups	(%esi),%xmm2
+	movups	16(%esi),%xmm3
+	movups	32(%esi),%xmm4
+	leal	48(%esi),%esi
+	xorps	%xmm5,%xmm2
+	xorps	%xmm6,%xmm3
+	xorps	%xmm7,%xmm4
+	call	_aesni_decrypt3
+	xorps	%xmm5,%xmm2
+	xorps	%xmm6,%xmm3
+	xorps	%xmm7,%xmm4
+	movups	%xmm2,(%edi)
+	movups	%xmm3,16(%edi)
+	movups	%xmm4,32(%edi)
+	leal	48(%edi),%edi
+	movdqa	%xmm7,%xmm1
+	jmp	.L067xts_dec_done
+.align	16
+.L066xts_dec_four:
+	movaps	%xmm1,%xmm6
+	movups	(%esi),%xmm2
+	movups	16(%esi),%xmm3
+	movups	32(%esi),%xmm4
+	xorps	(%esp),%xmm2
+	movups	48(%esi),%xmm5
+	leal	64(%esi),%esi
+	xorps	16(%esp),%xmm3
+	xorps	%xmm7,%xmm4
+	xorps	%xmm6,%xmm5
+	call	_aesni_decrypt4
+	xorps	(%esp),%xmm2
+	xorps	16(%esp),%xmm3
+	xorps	%xmm7,%xmm4
+	movups	%xmm2,(%edi)
+	xorps	%xmm6,%xmm5
+	movups	%xmm3,16(%edi)
+	movups	%xmm4,32(%edi)
+	movups	%xmm5,48(%edi)
+	leal	64(%edi),%edi
+	movdqa	%xmm6,%xmm1
+	jmp	.L067xts_dec_done
+.align	16
+.L062xts_dec_done6x:
+	movl	112(%esp),%eax
+	andl	$15,%eax
+	jz	.L069xts_dec_ret
+	movl	%eax,112(%esp)
+	jmp	.L070xts_dec_only_one_more
+.align	16
+.L067xts_dec_done:
+	movl	112(%esp),%eax
+	pxor	%xmm0,%xmm0
+	andl	$15,%eax
+	jz	.L069xts_dec_ret
+	pcmpgtd	%xmm1,%xmm0
+	movl	%eax,112(%esp)
+	pshufd	$19,%xmm0,%xmm2
+	pxor	%xmm0,%xmm0
+	movdqa	96(%esp),%xmm3
+	paddq	%xmm1,%xmm1
+	pand	%xmm3,%xmm2
+	pcmpgtd	%xmm1,%xmm0
+	pxor	%xmm2,%xmm1
+.L070xts_dec_only_one_more:
+	pshufd	$19,%xmm0,%xmm5
+	movdqa	%xmm1,%xmm6
+	paddq	%xmm1,%xmm1
+	pand	%xmm3,%xmm5
+	pxor	%xmm1,%xmm5
+	movl	%ebp,%edx
+	movl	%ebx,%ecx
+	movups	(%esi),%xmm2
+	xorps	%xmm5,%xmm2
+	movups	(%edx),%xmm0
+	movups	16(%edx),%xmm1
+	leal	32(%edx),%edx
+	xorps	%xmm0,%xmm2
+.L071dec1_loop_13:
+.byte	102,15,56,222,209
+	decl	%ecx
+	movups	(%edx),%xmm1
+	leal	16(%edx),%edx
+	jnz	.L071dec1_loop_13
+.byte	102,15,56,223,209
+	xorps	%xmm5,%xmm2
+	movups	%xmm2,(%edi)
+.L072xts_dec_steal:
+	movzbl	16(%esi),%ecx
+	movzbl	(%edi),%edx
+	leal	1(%esi),%esi
+	movb	%cl,(%edi)
+	movb	%dl,16(%edi)
+	leal	1(%edi),%edi
+	subl	$1,%eax
+	jnz	.L072xts_dec_steal
+	subl	112(%esp),%edi
+	movl	%ebp,%edx
+	movl	%ebx,%ecx
+	movups	(%edi),%xmm2
+	xorps	%xmm6,%xmm2
+	movups	(%edx),%xmm0
+	movups	16(%edx),%xmm1
+	leal	32(%edx),%edx
+	xorps	%xmm0,%xmm2
+.L073dec1_loop_14:
+.byte	102,15,56,222,209
+	decl	%ecx
+	movups	(%edx),%xmm1
+	leal	16(%edx),%edx
+	jnz	.L073dec1_loop_14
+.byte	102,15,56,223,209
+	xorps	%xmm6,%xmm2
+	movups	%xmm2,(%edi)
+.L069xts_dec_ret:
+	pxor	%xmm0,%xmm0
+	pxor	%xmm1,%xmm1
+	pxor	%xmm2,%xmm2
+	movdqa	%xmm0,(%esp)
+	pxor	%xmm3,%xmm3
+	movdqa	%xmm0,16(%esp)
+	pxor	%xmm4,%xmm4
+	movdqa	%xmm0,32(%esp)
+	pxor	%xmm5,%xmm5
+	movdqa	%xmm0,48(%esp)
+	pxor	%xmm6,%xmm6
+	movdqa	%xmm0,64(%esp)
+	pxor	%xmm7,%xmm7
+	movdqa	%xmm0,80(%esp)
+	movl	116(%esp),%esp
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.size	aesni_xts_decrypt,.-.L_aesni_xts_decrypt_begin
+.globl	aesni_cbc_encrypt
+.hidden	aesni_cbc_encrypt
+.type	aesni_cbc_encrypt,@function
+.align	16
+aesni_cbc_encrypt:
+.L_aesni_cbc_encrypt_begin:
+	pushl	%ebp
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+	movl	20(%esp),%esi
+	movl	%esp,%ebx
+	movl	24(%esp),%edi
+	subl	$24,%ebx
+	movl	28(%esp),%eax
+	andl	$-16,%ebx
+	movl	32(%esp),%edx
+	movl	36(%esp),%ebp
+	testl	%eax,%eax
+	jz	.L074cbc_abort
+	cmpl	$0,40(%esp)
+	xchgl	%esp,%ebx
+	movups	(%ebp),%xmm7
+	movl	240(%edx),%ecx
+	movl	%edx,%ebp
+	movl	%ebx,16(%esp)
+	movl	%ecx,%ebx
+	je	.L075cbc_decrypt
+	movaps	%xmm7,%xmm2
+	cmpl	$16,%eax
+	jb	.L076cbc_enc_tail
+	subl	$16,%eax
+	jmp	.L077cbc_enc_loop
+.align	16
+.L077cbc_enc_loop:
+	movups	(%esi),%xmm7
+	leal	16(%esi),%esi
+	movups	(%edx),%xmm0
+	movups	16(%edx),%xmm1
+	xorps	%xmm0,%xmm7
+	leal	32(%edx),%edx
+	xorps	%xmm7,%xmm2
+.L078enc1_loop_15:
+.byte	102,15,56,220,209
+	decl	%ecx
+	movups	(%edx),%xmm1
+	leal	16(%edx),%edx
+	jnz	.L078enc1_loop_15
+.byte	102,15,56,221,209
+	movl	%ebx,%ecx
+	movl	%ebp,%edx
+	movups	%xmm2,(%edi)
+	leal	16(%edi),%edi
+	subl	$16,%eax
+	jnc	.L077cbc_enc_loop
+	addl	$16,%eax
+	jnz	.L076cbc_enc_tail
+	movaps	%xmm2,%xmm7
+	pxor	%xmm2,%xmm2
+	jmp	.L079cbc_ret
+.L076cbc_enc_tail:
+	movl	%eax,%ecx
+.long	2767451785
+	movl	$16,%ecx
+	subl	%eax,%ecx
+	xorl	%eax,%eax
+.long	2868115081
+	leal	-16(%edi),%edi
+	movl	%ebx,%ecx
+	movl	%edi,%esi
+	movl	%ebp,%edx
+	jmp	.L077cbc_enc_loop
+.align	16
+.L075cbc_decrypt:
+	cmpl	$80,%eax
+	jbe	.L080cbc_dec_tail
+	movaps	%xmm7,(%esp)
+	subl	$80,%eax
+	jmp	.L081cbc_dec_loop6_enter
+.align	16
+.L082cbc_dec_loop6:
+	movaps	%xmm0,(%esp)
+	movups	%xmm7,(%edi)
+	leal	16(%edi),%edi
+.L081cbc_dec_loop6_enter:
+	movdqu	(%esi),%xmm2
+	movdqu	16(%esi),%xmm3
+	movdqu	32(%esi),%xmm4
+	movdqu	48(%esi),%xmm5
+	movdqu	64(%esi),%xmm6
+	movdqu	80(%esi),%xmm7
+	call	_aesni_decrypt6
+	movups	(%esi),%xmm1
+	movups	16(%esi),%xmm0
+	xorps	(%esp),%xmm2
+	xorps	%xmm1,%xmm3
+	movups	32(%esi),%xmm1
+	xorps	%xmm0,%xmm4
+	movups	48(%esi),%xmm0
+	xorps	%xmm1,%xmm5
+	movups	64(%esi),%xmm1
+	xorps	%xmm0,%xmm6
+	movups	80(%esi),%xmm0
+	xorps	%xmm1,%xmm7
+	movups	%xmm2,(%edi)
+	movups	%xmm3,16(%edi)
+	leal	96(%esi),%esi
+	movups	%xmm4,32(%edi)
+	movl	%ebx,%ecx
+	movups	%xmm5,48(%edi)
+	movl	%ebp,%edx
+	movups	%xmm6,64(%edi)
+	leal	80(%edi),%edi
+	subl	$96,%eax
+	ja	.L082cbc_dec_loop6
+	movaps	%xmm7,%xmm2
+	movaps	%xmm0,%xmm7
+	addl	$80,%eax
+	jle	.L083cbc_dec_clear_tail_collected
+	movups	%xmm2,(%edi)
+	leal	16(%edi),%edi
+.L080cbc_dec_tail:
+	movups	(%esi),%xmm2
+	movaps	%xmm2,%xmm6
+	cmpl	$16,%eax
+	jbe	.L084cbc_dec_one
+	movups	16(%esi),%xmm3
+	movaps	%xmm3,%xmm5
+	cmpl	$32,%eax
+	jbe	.L085cbc_dec_two
+	movups	32(%esi),%xmm4
+	cmpl	$48,%eax
+	jbe	.L086cbc_dec_three
+	movups	48(%esi),%xmm5
+	cmpl	$64,%eax
+	jbe	.L087cbc_dec_four
+	movups	64(%esi),%xmm6
+	movaps	%xmm7,(%esp)
+	movups	(%esi),%xmm2
+	xorps	%xmm7,%xmm7
+	call	_aesni_decrypt6
+	movups	(%esi),%xmm1
+	movups	16(%esi),%xmm0
+	xorps	(%esp),%xmm2
+	xorps	%xmm1,%xmm3
+	movups	32(%esi),%xmm1
+	xorps	%xmm0,%xmm4
+	movups	48(%esi),%xmm0
+	xorps	%xmm1,%xmm5
+	movups	64(%esi),%xmm7
+	xorps	%xmm0,%xmm6
+	movups	%xmm2,(%edi)
+	movups	%xmm3,16(%edi)
+	pxor	%xmm3,%xmm3
+	movups	%xmm4,32(%edi)
+	pxor	%xmm4,%xmm4
+	movups	%xmm5,48(%edi)
+	pxor	%xmm5,%xmm5
+	leal	64(%edi),%edi
+	movaps	%xmm6,%xmm2
+	pxor	%xmm6,%xmm6
+	subl	$80,%eax
+	jmp	.L088cbc_dec_tail_collected
+.align	16
+.L084cbc_dec_one:
+	movups	(%edx),%xmm0
+	movups	16(%edx),%xmm1
+	leal	32(%edx),%edx
+	xorps	%xmm0,%xmm2
+.L089dec1_loop_16:
+.byte	102,15,56,222,209
+	decl	%ecx
+	movups	(%edx),%xmm1
+	leal	16(%edx),%edx
+	jnz	.L089dec1_loop_16
+.byte	102,15,56,223,209
+	xorps	%xmm7,%xmm2
+	movaps	%xmm6,%xmm7
+	subl	$16,%eax
+	jmp	.L088cbc_dec_tail_collected
+.align	16
+.L085cbc_dec_two:
+	call	_aesni_decrypt2
+	xorps	%xmm7,%xmm2
+	xorps	%xmm6,%xmm3
+	movups	%xmm2,(%edi)
+	movaps	%xmm3,%xmm2
+	pxor	%xmm3,%xmm3
+	leal	16(%edi),%edi
+	movaps	%xmm5,%xmm7
+	subl	$32,%eax
+	jmp	.L088cbc_dec_tail_collected
+.align	16
+.L086cbc_dec_three:
+	call	_aesni_decrypt3
+	xorps	%xmm7,%xmm2
+	xorps	%xmm6,%xmm3
+	xorps	%xmm5,%xmm4
+	movups	%xmm2,(%edi)
+	movaps	%xmm4,%xmm2
+	pxor	%xmm4,%xmm4
+	movups	%xmm3,16(%edi)
+	pxor	%xmm3,%xmm3
+	leal	32(%edi),%edi
+	movups	32(%esi),%xmm7
+	subl	$48,%eax
+	jmp	.L088cbc_dec_tail_collected
+.align	16
+.L087cbc_dec_four:
+	call	_aesni_decrypt4
+	movups	16(%esi),%xmm1
+	movups	32(%esi),%xmm0
+	xorps	%xmm7,%xmm2
+	movups	48(%esi),%xmm7
+	xorps	%xmm6,%xmm3
+	movups	%xmm2,(%edi)
+	xorps	%xmm1,%xmm4
+	movups	%xmm3,16(%edi)
+	pxor	%xmm3,%xmm3
+	xorps	%xmm0,%xmm5
+	movups	%xmm4,32(%edi)
+	pxor	%xmm4,%xmm4
+	leal	48(%edi),%edi
+	movaps	%xmm5,%xmm2
+	pxor	%xmm5,%xmm5
+	subl	$64,%eax
+	jmp	.L088cbc_dec_tail_collected
+.align	16
+.L083cbc_dec_clear_tail_collected:
+	pxor	%xmm3,%xmm3
+	pxor	%xmm4,%xmm4
+	pxor	%xmm5,%xmm5
+	pxor	%xmm6,%xmm6
+.L088cbc_dec_tail_collected:
+	andl	$15,%eax
+	jnz	.L090cbc_dec_tail_partial
+	movups	%xmm2,(%edi)
+	pxor	%xmm0,%xmm0
+	jmp	.L079cbc_ret
+.align	16
+.L090cbc_dec_tail_partial:
+	movaps	%xmm2,(%esp)
+	pxor	%xmm0,%xmm0
+	movl	$16,%ecx
+	movl	%esp,%esi
+	subl	%eax,%ecx
+.long	2767451785
+	movdqa	%xmm2,(%esp)
+.L079cbc_ret:
+	movl	16(%esp),%esp
+	movl	36(%esp),%ebp
+	pxor	%xmm2,%xmm2
+	pxor	%xmm1,%xmm1
+	movups	%xmm7,(%ebp)
+	pxor	%xmm7,%xmm7
+.L074cbc_abort:
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.size	aesni_cbc_encrypt,.-.L_aesni_cbc_encrypt_begin
+.hidden	_aesni_set_encrypt_key
+.type	_aesni_set_encrypt_key,@function
+.align	16
+_aesni_set_encrypt_key:
+	pushl	%ebp
+	pushl	%ebx
+	testl	%eax,%eax
+	jz	.L091bad_pointer
+	testl	%edx,%edx
+	jz	.L091bad_pointer
+	call	.L092pic
+.L092pic:
+	popl	%ebx
+	leal	.Lkey_const-.L092pic(%ebx),%ebx
+	leal	OPENSSL_ia32cap_P-.Lkey_const(%ebx),%ebp
+	movups	(%eax),%xmm0
+	xorps	%xmm4,%xmm4
+	movl	4(%ebp),%ebp
+	leal	16(%edx),%edx
+	andl	$268437504,%ebp
+	cmpl	$256,%ecx
+	je	.L09314rounds
+	cmpl	$192,%ecx
+	je	.L09412rounds
+	cmpl	$128,%ecx
+	jne	.L095bad_keybits
+.align	16
+.L09610rounds:
+	cmpl	$268435456,%ebp
+	je	.L09710rounds_alt
+	movl	$9,%ecx
+	movups	%xmm0,-16(%edx)
+.byte	102,15,58,223,200,1
+	call	.L098key_128_cold
+.byte	102,15,58,223,200,2
+	call	.L099key_128
+.byte	102,15,58,223,200,4
+	call	.L099key_128
+.byte	102,15,58,223,200,8
+	call	.L099key_128
+.byte	102,15,58,223,200,16
+	call	.L099key_128
+.byte	102,15,58,223,200,32
+	call	.L099key_128
+.byte	102,15,58,223,200,64
+	call	.L099key_128
+.byte	102,15,58,223,200,128
+	call	.L099key_128
+.byte	102,15,58,223,200,27
+	call	.L099key_128
+.byte	102,15,58,223,200,54
+	call	.L099key_128
+	movups	%xmm0,(%edx)
+	movl	%ecx,80(%edx)
+	jmp	.L100good_key
+.align	16
+.L099key_128:
+	movups	%xmm0,(%edx)
+	leal	16(%edx),%edx
+.L098key_128_cold:
+	shufps	$16,%xmm0,%xmm4
+	xorps	%xmm4,%xmm0
+	shufps	$140,%xmm0,%xmm4
+	xorps	%xmm4,%xmm0
+	shufps	$255,%xmm1,%xmm1
+	xorps	%xmm1,%xmm0
+	ret
+.align	16
+.L09710rounds_alt:
+	movdqa	(%ebx),%xmm5
+	movl	$8,%ecx
+	movdqa	32(%ebx),%xmm4
+	movdqa	%xmm0,%xmm2
+	movdqu	%xmm0,-16(%edx)
+.L101loop_key128:
+.byte	102,15,56,0,197
+.byte	102,15,56,221,196
+	pslld	$1,%xmm4
+	leal	16(%edx),%edx
+	movdqa	%xmm2,%xmm3
+	pslldq	$4,%xmm2
+	pxor	%xmm2,%xmm3
+	pslldq	$4,%xmm2
+	pxor	%xmm2,%xmm3
+	pslldq	$4,%xmm2
+	pxor	%xmm3,%xmm2
+	pxor	%xmm2,%xmm0
+	movdqu	%xmm0,-16(%edx)
+	movdqa	%xmm0,%xmm2
+	decl	%ecx
+	jnz	.L101loop_key128
+	movdqa	48(%ebx),%xmm4
+.byte	102,15,56,0,197
+.byte	102,15,56,221,196
+	pslld	$1,%xmm4
+	movdqa	%xmm2,%xmm3
+	pslldq	$4,%xmm2
+	pxor	%xmm2,%xmm3
+	pslldq	$4,%xmm2
+	pxor	%xmm2,%xmm3
+	pslldq	$4,%xmm2
+	pxor	%xmm3,%xmm2
+	pxor	%xmm2,%xmm0
+	movdqu	%xmm0,(%edx)
+	movdqa	%xmm0,%xmm2
+.byte	102,15,56,0,197
+.byte	102,15,56,221,196
+	movdqa	%xmm2,%xmm3
+	pslldq	$4,%xmm2
+	pxor	%xmm2,%xmm3
+	pslldq	$4,%xmm2
+	pxor	%xmm2,%xmm3
+	pslldq	$4,%xmm2
+	pxor	%xmm3,%xmm2
+	pxor	%xmm2,%xmm0
+	movdqu	%xmm0,16(%edx)
+	movl	$9,%ecx
+	movl	%ecx,96(%edx)
+	jmp	.L100good_key
+.align	16
+.L09412rounds:
+	movq	16(%eax),%xmm2
+	cmpl	$268435456,%ebp
+	je	.L10212rounds_alt
+	movl	$11,%ecx
+	movups	%xmm0,-16(%edx)
+.byte	102,15,58,223,202,1
+	call	.L103key_192a_cold
+.byte	102,15,58,223,202,2
+	call	.L104key_192b
+.byte	102,15,58,223,202,4
+	call	.L105key_192a
+.byte	102,15,58,223,202,8
+	call	.L104key_192b
+.byte	102,15,58,223,202,16
+	call	.L105key_192a
+.byte	102,15,58,223,202,32
+	call	.L104key_192b
+.byte	102,15,58,223,202,64
+	call	.L105key_192a
+.byte	102,15,58,223,202,128
+	call	.L104key_192b
+	movups	%xmm0,(%edx)
+	movl	%ecx,48(%edx)
+	jmp	.L100good_key
+.align	16
+.L105key_192a:
+	movups	%xmm0,(%edx)
+	leal	16(%edx),%edx
+.align	16
+.L103key_192a_cold:
+	movaps	%xmm2,%xmm5
+.L106key_192b_warm:
+	shufps	$16,%xmm0,%xmm4
+	movdqa	%xmm2,%xmm3
+	xorps	%xmm4,%xmm0
+	shufps	$140,%xmm0,%xmm4
+	pslldq	$4,%xmm3
+	xorps	%xmm4,%xmm0
+	pshufd	$85,%xmm1,%xmm1
+	pxor	%xmm3,%xmm2
+	pxor	%xmm1,%xmm0
+	pshufd	$255,%xmm0,%xmm3
+	pxor	%xmm3,%xmm2
+	ret
+.align	16
+.L104key_192b:
+	movaps	%xmm0,%xmm3
+	shufps	$68,%xmm0,%xmm5
+	movups	%xmm5,(%edx)
+	shufps	$78,%xmm2,%xmm3
+	movups	%xmm3,16(%edx)
+	leal	32(%edx),%edx
+	jmp	.L106key_192b_warm
+.align	16
+.L10212rounds_alt:
+	movdqa	16(%ebx),%xmm5
+	movdqa	32(%ebx),%xmm4
+	movl	$8,%ecx
+	movdqu	%xmm0,-16(%edx)
+.L107loop_key192:
+	movq	%xmm2,(%edx)
+	movdqa	%xmm2,%xmm1
+.byte	102,15,56,0,213
+.byte	102,15,56,221,212
+	pslld	$1,%xmm4
+	leal	24(%edx),%edx
+	movdqa	%xmm0,%xmm3
+	pslldq	$4,%xmm0
+	pxor	%xmm0,%xmm3
+	pslldq	$4,%xmm0
+	pxor	%xmm0,%xmm3
+	pslldq	$4,%xmm0
+	pxor	%xmm3,%xmm0
+	pshufd	$255,%xmm0,%xmm3
+	pxor	%xmm1,%xmm3
+	pslldq	$4,%xmm1
+	pxor	%xmm1,%xmm3
+	pxor	%xmm2,%xmm0
+	pxor	%xmm3,%xmm2
+	movdqu	%xmm0,-16(%edx)
+	decl	%ecx
+	jnz	.L107loop_key192
+	movl	$11,%ecx
+	movl	%ecx,32(%edx)
+	jmp	.L100good_key
+.align	16
+.L09314rounds:
+	movups	16(%eax),%xmm2
+	leal	16(%edx),%edx
+	cmpl	$268435456,%ebp
+	je	.L10814rounds_alt
+	movl	$13,%ecx
+	movups	%xmm0,-32(%edx)
+	movups	%xmm2,-16(%edx)
+.byte	102,15,58,223,202,1
+	call	.L109key_256a_cold
+.byte	102,15,58,223,200,1
+	call	.L110key_256b
+.byte	102,15,58,223,202,2
+	call	.L111key_256a
+.byte	102,15,58,223,200,2
+	call	.L110key_256b
+.byte	102,15,58,223,202,4
+	call	.L111key_256a
+.byte	102,15,58,223,200,4
+	call	.L110key_256b
+.byte	102,15,58,223,202,8
+	call	.L111key_256a
+.byte	102,15,58,223,200,8
+	call	.L110key_256b
+.byte	102,15,58,223,202,16
+	call	.L111key_256a
+.byte	102,15,58,223,200,16
+	call	.L110key_256b
+.byte	102,15,58,223,202,32
+	call	.L111key_256a
+.byte	102,15,58,223,200,32
+	call	.L110key_256b
+.byte	102,15,58,223,202,64
+	call	.L111key_256a
+	movups	%xmm0,(%edx)
+	movl	%ecx,16(%edx)
+	xorl	%eax,%eax
+	jmp	.L100good_key
+.align	16
+.L111key_256a:
+	movups	%xmm2,(%edx)
+	leal	16(%edx),%edx
+.L109key_256a_cold:
+	shufps	$16,%xmm0,%xmm4
+	xorps	%xmm4,%xmm0
+	shufps	$140,%xmm0,%xmm4
+	xorps	%xmm4,%xmm0
+	shufps	$255,%xmm1,%xmm1
+	xorps	%xmm1,%xmm0
+	ret
+.align	16
+.L110key_256b:
+	movups	%xmm0,(%edx)
+	leal	16(%edx),%edx
+	shufps	$16,%xmm2,%xmm4
+	xorps	%xmm4,%xmm2
+	shufps	$140,%xmm2,%xmm4
+	xorps	%xmm4,%xmm2
+	shufps	$170,%xmm1,%xmm1
+	xorps	%xmm1,%xmm2
+	ret
+.align	16
+.L10814rounds_alt:
+	movdqa	(%ebx),%xmm5
+	movdqa	32(%ebx),%xmm4
+	movl	$7,%ecx
+	movdqu	%xmm0,-32(%edx)
+	movdqa	%xmm2,%xmm1
+	movdqu	%xmm2,-16(%edx)
+.L112loop_key256:
+.byte	102,15,56,0,213
+.byte	102,15,56,221,212
+	movdqa	%xmm0,%xmm3
+	pslldq	$4,%xmm0
+	pxor	%xmm0,%xmm3
+	pslldq	$4,%xmm0
+	pxor	%xmm0,%xmm3
+	pslldq	$4,%xmm0
+	pxor	%xmm3,%xmm0
+	pslld	$1,%xmm4
+	pxor	%xmm2,%xmm0
+	movdqu	%xmm0,(%edx)
+	decl	%ecx
+	jz	.L113done_key256
+	pshufd	$255,%xmm0,%xmm2
+	pxor	%xmm3,%xmm3
+.byte	102,15,56,221,211
+	movdqa	%xmm1,%xmm3
+	pslldq	$4,%xmm1
+	pxor	%xmm1,%xmm3
+	pslldq	$4,%xmm1
+	pxor	%xmm1,%xmm3
+	pslldq	$4,%xmm1
+	pxor	%xmm3,%xmm1
+	pxor	%xmm1,%xmm2
+	movdqu	%xmm2,16(%edx)
+	leal	32(%edx),%edx
+	movdqa	%xmm2,%xmm1
+	jmp	.L112loop_key256
+.L113done_key256:
+	movl	$13,%ecx
+	movl	%ecx,16(%edx)
+.L100good_key:
+	pxor	%xmm0,%xmm0
+	pxor	%xmm1,%xmm1
+	pxor	%xmm2,%xmm2
+	pxor	%xmm3,%xmm3
+	pxor	%xmm4,%xmm4
+	pxor	%xmm5,%xmm5
+	xorl	%eax,%eax
+	popl	%ebx
+	popl	%ebp
+	ret
+.align	4
+.L091bad_pointer:
+	movl	$-1,%eax
+	popl	%ebx
+	popl	%ebp
+	ret
+.align	4
+.L095bad_keybits:
+	pxor	%xmm0,%xmm0
+	movl	$-2,%eax
+	popl	%ebx
+	popl	%ebp
+	ret
+.size	_aesni_set_encrypt_key,.-_aesni_set_encrypt_key
+.globl	aesni_set_encrypt_key
+.hidden	aesni_set_encrypt_key
+.type	aesni_set_encrypt_key,@function
+.align	16
+aesni_set_encrypt_key:
+.L_aesni_set_encrypt_key_begin:
+	movl	4(%esp),%eax
+	movl	8(%esp),%ecx
+	movl	12(%esp),%edx
+	call	_aesni_set_encrypt_key
+	ret
+.size	aesni_set_encrypt_key,.-.L_aesni_set_encrypt_key_begin
+.globl	aesni_set_decrypt_key
+.hidden	aesni_set_decrypt_key
+.type	aesni_set_decrypt_key,@function
+.align	16
+aesni_set_decrypt_key:
+.L_aesni_set_decrypt_key_begin:
+	movl	4(%esp),%eax
+	movl	8(%esp),%ecx
+	movl	12(%esp),%edx
+	call	_aesni_set_encrypt_key
+	movl	12(%esp),%edx
+	shll	$4,%ecx
+	testl	%eax,%eax
+	jnz	.L114dec_key_ret
+	leal	16(%edx,%ecx,1),%eax
+	movups	(%edx),%xmm0
+	movups	(%eax),%xmm1
+	movups	%xmm0,(%eax)
+	movups	%xmm1,(%edx)
+	leal	16(%edx),%edx
+	leal	-16(%eax),%eax
+.L115dec_key_inverse:
+	movups	(%edx),%xmm0
+	movups	(%eax),%xmm1
+.byte	102,15,56,219,192
+.byte	102,15,56,219,201
+	leal	16(%edx),%edx
+	leal	-16(%eax),%eax
+	movups	%xmm0,16(%eax)
+	movups	%xmm1,-16(%edx)
+	cmpl	%edx,%eax
+	ja	.L115dec_key_inverse
+	movups	(%edx),%xmm0
+.byte	102,15,56,219,192
+	movups	%xmm0,(%edx)
+	pxor	%xmm0,%xmm0
+	pxor	%xmm1,%xmm1
+	xorl	%eax,%eax
+.L114dec_key_ret:
+	ret
+.size	aesni_set_decrypt_key,.-.L_aesni_set_decrypt_key_begin
+.align	64
+.Lkey_const:
+.long	202313229,202313229,202313229,202313229
+.long	67569157,67569157,67569157,67569157
+.long	1,1,1,1
+.long	27,27,27,27
+.byte	65,69,83,32,102,111,114,32,73,110,116,101,108,32,65,69
+.byte	83,45,78,73,44,32,67,82,89,80,84,79,71,65,77,83
+.byte	32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115
+.byte	115,108,46,111,114,103,62,0
+#endif
diff --git a/third_party/boringssl/linux-x86/crypto/aes/vpaes-x86.S b/third_party/boringssl/linux-x86/crypto/aes/vpaes-x86.S
new file mode 100644
index 0000000..9aede39
--- /dev/null
+++ b/third_party/boringssl/linux-x86/crypto/aes/vpaes-x86.S
@@ -0,0 +1,676 @@
+#if defined(__i386__)
+.file	"vpaes-x86.S"
+.text
+.align	64
+.L_vpaes_consts:
+.long	218628480,235210255,168496130,67568393
+.long	252381056,17041926,33884169,51187212
+.long	252645135,252645135,252645135,252645135
+.long	1512730624,3266504856,1377990664,3401244816
+.long	830229760,1275146365,2969422977,3447763452
+.long	3411033600,2979783055,338359620,2782886510
+.long	4209124096,907596821,221174255,1006095553
+.long	191964160,3799684038,3164090317,1589111125
+.long	182528256,1777043520,2877432650,3265356744
+.long	1874708224,3503451415,3305285752,363511674
+.long	1606117888,3487855781,1093350906,2384367825
+.long	197121,67569157,134941193,202313229
+.long	67569157,134941193,202313229,197121
+.long	134941193,202313229,197121,67569157
+.long	202313229,197121,67569157,134941193
+.long	33619971,100992007,168364043,235736079
+.long	235736079,33619971,100992007,168364043
+.long	168364043,235736079,33619971,100992007
+.long	100992007,168364043,235736079,33619971
+.long	50462976,117835012,185207048,252579084
+.long	252314880,51251460,117574920,184942860
+.long	184682752,252054788,50987272,118359308
+.long	118099200,185467140,251790600,50727180
+.long	2946363062,528716217,1300004225,1881839624
+.long	1532713819,1532713819,1532713819,1532713819
+.long	3602276352,4288629033,3737020424,4153884961
+.long	1354558464,32357713,2958822624,3775749553
+.long	1201988352,132424512,1572796698,503232858
+.long	2213177600,1597421020,4103937655,675398315
+.long	2749646592,4273543773,1511898873,121693092
+.long	3040248576,1103263732,2871565598,1608280554
+.long	2236667136,2588920351,482954393,64377734
+.long	3069987328,291237287,2117370568,3650299247
+.long	533321216,3573750986,2572112006,1401264716
+.long	1339849704,2721158661,548607111,3445553514
+.long	2128193280,3054596040,2183486460,1257083700
+.long	655635200,1165381986,3923443150,2344132524
+.long	190078720,256924420,290342170,357187870
+.long	1610966272,2263057382,4103205268,309794674
+.long	2592527872,2233205587,1335446729,3402964816
+.long	3973531904,3225098121,3002836325,1918774430
+.long	3870401024,2102906079,2284471353,4117666579
+.long	617007872,1021508343,366931923,691083277
+.long	2528395776,3491914898,2968704004,1613121270
+.long	3445188352,3247741094,844474987,4093578302
+.long	651481088,1190302358,1689581232,574775300
+.long	4289380608,206939853,2555985458,2489840491
+.long	2130264064,327674451,3566485037,3349835193
+.long	2470714624,316102159,3636825756,3393945945
+.byte	86,101,99,116,111,114,32,80,101,114,109,117,116,97,116,105
+.byte	111,110,32,65,69,83,32,102,111,114,32,120,56,54,47,83
+.byte	83,83,69,51,44,32,77,105,107,101,32,72,97,109,98,117
+.byte	114,103,32,40,83,116,97,110,102,111,114,100,32,85,110,105
+.byte	118,101,114,115,105,116,121,41,0
+.align	64
+.hidden	_vpaes_preheat
+.type	_vpaes_preheat,@function
+.align	16
+_vpaes_preheat:
+	addl	(%esp),%ebp
+	movdqa	-48(%ebp),%xmm7
+	movdqa	-16(%ebp),%xmm6
+	ret
+.size	_vpaes_preheat,.-_vpaes_preheat
+.hidden	_vpaes_encrypt_core
+.type	_vpaes_encrypt_core,@function
+.align	16
+_vpaes_encrypt_core:
+	movl	$16,%ecx
+	movl	240(%edx),%eax
+	movdqa	%xmm6,%xmm1
+	movdqa	(%ebp),%xmm2
+	pandn	%xmm0,%xmm1
+	pand	%xmm6,%xmm0
+	movdqu	(%edx),%xmm5
+.byte	102,15,56,0,208
+	movdqa	16(%ebp),%xmm0
+	pxor	%xmm5,%xmm2
+	psrld	$4,%xmm1
+	addl	$16,%edx
+.byte	102,15,56,0,193
+	leal	192(%ebp),%ebx
+	pxor	%xmm2,%xmm0
+	jmp	.L000enc_entry
+.align	16
+.L001enc_loop:
+	movdqa	32(%ebp),%xmm4
+	movdqa	48(%ebp),%xmm0
+.byte	102,15,56,0,226
+.byte	102,15,56,0,195
+	pxor	%xmm5,%xmm4
+	movdqa	64(%ebp),%xmm5
+	pxor	%xmm4,%xmm0
+	movdqa	-64(%ebx,%ecx,1),%xmm1
+.byte	102,15,56,0,234
+	movdqa	80(%ebp),%xmm2
+	movdqa	(%ebx,%ecx,1),%xmm4
+.byte	102,15,56,0,211
+	movdqa	%xmm0,%xmm3
+	pxor	%xmm5,%xmm2
+.byte	102,15,56,0,193
+	addl	$16,%edx
+	pxor	%xmm2,%xmm0
+.byte	102,15,56,0,220
+	addl	$16,%ecx
+	pxor	%xmm0,%xmm3
+.byte	102,15,56,0,193
+	andl	$48,%ecx
+	subl	$1,%eax
+	pxor	%xmm3,%xmm0
+.L000enc_entry:
+	movdqa	%xmm6,%xmm1
+	movdqa	-32(%ebp),%xmm5
+	pandn	%xmm0,%xmm1
+	psrld	$4,%xmm1
+	pand	%xmm6,%xmm0
+.byte	102,15,56,0,232
+	movdqa	%xmm7,%xmm3
+	pxor	%xmm1,%xmm0
+.byte	102,15,56,0,217
+	movdqa	%xmm7,%xmm4
+	pxor	%xmm5,%xmm3
+.byte	102,15,56,0,224
+	movdqa	%xmm7,%xmm2
+	pxor	%xmm5,%xmm4
+.byte	102,15,56,0,211
+	movdqa	%xmm7,%xmm3
+	pxor	%xmm0,%xmm2
+.byte	102,15,56,0,220
+	movdqu	(%edx),%xmm5
+	pxor	%xmm1,%xmm3
+	jnz	.L001enc_loop
+	movdqa	96(%ebp),%xmm4
+	movdqa	112(%ebp),%xmm0
+.byte	102,15,56,0,226
+	pxor	%xmm5,%xmm4
+.byte	102,15,56,0,195
+	movdqa	64(%ebx,%ecx,1),%xmm1
+	pxor	%xmm4,%xmm0
+.byte	102,15,56,0,193
+	ret
+.size	_vpaes_encrypt_core,.-_vpaes_encrypt_core
+.hidden	_vpaes_decrypt_core
+.type	_vpaes_decrypt_core,@function
+.align	16
+_vpaes_decrypt_core:
+	leal	608(%ebp),%ebx
+	movl	240(%edx),%eax
+	movdqa	%xmm6,%xmm1
+	movdqa	-64(%ebx),%xmm2
+	pandn	%xmm0,%xmm1
+	movl	%eax,%ecx
+	psrld	$4,%xmm1
+	movdqu	(%edx),%xmm5
+	shll	$4,%ecx
+	pand	%xmm6,%xmm0
+.byte	102,15,56,0,208
+	movdqa	-48(%ebx),%xmm0
+	xorl	$48,%ecx
+.byte	102,15,56,0,193
+	andl	$48,%ecx
+	pxor	%xmm5,%xmm2
+	movdqa	176(%ebp),%xmm5
+	pxor	%xmm2,%xmm0
+	addl	$16,%edx
+	leal	-352(%ebx,%ecx,1),%ecx
+	jmp	.L002dec_entry
+.align	16
+.L003dec_loop:
+	movdqa	-32(%ebx),%xmm4
+	movdqa	-16(%ebx),%xmm1
+.byte	102,15,56,0,226
+.byte	102,15,56,0,203
+	pxor	%xmm4,%xmm0
+	movdqa	(%ebx),%xmm4
+	pxor	%xmm1,%xmm0
+	movdqa	16(%ebx),%xmm1
+.byte	102,15,56,0,226
+.byte	102,15,56,0,197
+.byte	102,15,56,0,203
+	pxor	%xmm4,%xmm0
+	movdqa	32(%ebx),%xmm4
+	pxor	%xmm1,%xmm0
+	movdqa	48(%ebx),%xmm1
+.byte	102,15,56,0,226
+.byte	102,15,56,0,197
+.byte	102,15,56,0,203
+	pxor	%xmm4,%xmm0
+	movdqa	64(%ebx),%xmm4
+	pxor	%xmm1,%xmm0
+	movdqa	80(%ebx),%xmm1
+.byte	102,15,56,0,226
+.byte	102,15,56,0,197
+.byte	102,15,56,0,203
+	pxor	%xmm4,%xmm0
+	addl	$16,%edx
+.byte	102,15,58,15,237,12
+	pxor	%xmm1,%xmm0
+	subl	$1,%eax
+.L002dec_entry:
+	movdqa	%xmm6,%xmm1
+	movdqa	-32(%ebp),%xmm2
+	pandn	%xmm0,%xmm1
+	pand	%xmm6,%xmm0
+	psrld	$4,%xmm1
+.byte	102,15,56,0,208
+	movdqa	%xmm7,%xmm3
+	pxor	%xmm1,%xmm0
+.byte	102,15,56,0,217
+	movdqa	%xmm7,%xmm4
+	pxor	%xmm2,%xmm3
+.byte	102,15,56,0,224
+	pxor	%xmm2,%xmm4
+	movdqa	%xmm7,%xmm2
+.byte	102,15,56,0,211
+	movdqa	%xmm7,%xmm3
+	pxor	%xmm0,%xmm2
+.byte	102,15,56,0,220
+	movdqu	(%edx),%xmm0
+	pxor	%xmm1,%xmm3
+	jnz	.L003dec_loop
+	movdqa	96(%ebx),%xmm4
+.byte	102,15,56,0,226
+	pxor	%xmm0,%xmm4
+	movdqa	112(%ebx),%xmm0
+	movdqa	(%ecx),%xmm2
+.byte	102,15,56,0,195
+	pxor	%xmm4,%xmm0
+.byte	102,15,56,0,194
+	ret
+.size	_vpaes_decrypt_core,.-_vpaes_decrypt_core
+.hidden	_vpaes_schedule_core
+.type	_vpaes_schedule_core,@function
+.align	16
+_vpaes_schedule_core:
+	addl	(%esp),%ebp
+	movdqu	(%esi),%xmm0
+	movdqa	320(%ebp),%xmm2
+	movdqa	%xmm0,%xmm3
+	leal	(%ebp),%ebx
+	movdqa	%xmm2,4(%esp)
+	call	_vpaes_schedule_transform
+	movdqa	%xmm0,%xmm7
+	testl	%edi,%edi
+	jnz	.L004schedule_am_decrypting
+	movdqu	%xmm0,(%edx)
+	jmp	.L005schedule_go
+.L004schedule_am_decrypting:
+	movdqa	256(%ebp,%ecx,1),%xmm1
+.byte	102,15,56,0,217
+	movdqu	%xmm3,(%edx)
+	xorl	$48,%ecx
+.L005schedule_go:
+	cmpl	$192,%eax
+	ja	.L006schedule_256
+	je	.L007schedule_192
+.L008schedule_128:
+	movl	$10,%eax
+.L009loop_schedule_128:
+	call	_vpaes_schedule_round
+	decl	%eax
+	jz	.L010schedule_mangle_last
+	call	_vpaes_schedule_mangle
+	jmp	.L009loop_schedule_128
+.align	16
+.L007schedule_192:
+	movdqu	8(%esi),%xmm0
+	call	_vpaes_schedule_transform
+	movdqa	%xmm0,%xmm6
+	pxor	%xmm4,%xmm4
+	movhlps	%xmm4,%xmm6
+	movl	$4,%eax
+.L011loop_schedule_192:
+	call	_vpaes_schedule_round
+.byte	102,15,58,15,198,8
+	call	_vpaes_schedule_mangle
+	call	_vpaes_schedule_192_smear
+	call	_vpaes_schedule_mangle
+	call	_vpaes_schedule_round
+	decl	%eax
+	jz	.L010schedule_mangle_last
+	call	_vpaes_schedule_mangle
+	call	_vpaes_schedule_192_smear
+	jmp	.L011loop_schedule_192
+.align	16
+.L006schedule_256:
+	movdqu	16(%esi),%xmm0
+	call	_vpaes_schedule_transform
+	movl	$7,%eax
+.L012loop_schedule_256:
+	call	_vpaes_schedule_mangle
+	movdqa	%xmm0,%xmm6
+	call	_vpaes_schedule_round
+	decl	%eax
+	jz	.L010schedule_mangle_last
+	call	_vpaes_schedule_mangle
+	pshufd	$255,%xmm0,%xmm0
+	movdqa	%xmm7,20(%esp)
+	movdqa	%xmm6,%xmm7
+	call	.L_vpaes_schedule_low_round
+	movdqa	20(%esp),%xmm7
+	jmp	.L012loop_schedule_256
+.align	16
+.L010schedule_mangle_last:
+	leal	384(%ebp),%ebx
+	testl	%edi,%edi
+	jnz	.L013schedule_mangle_last_dec
+	movdqa	256(%ebp,%ecx,1),%xmm1
+.byte	102,15,56,0,193
+	leal	352(%ebp),%ebx
+	addl	$32,%edx
+.L013schedule_mangle_last_dec:
+	addl	$-16,%edx
+	pxor	336(%ebp),%xmm0
+	call	_vpaes_schedule_transform
+	movdqu	%xmm0,(%edx)
+	pxor	%xmm0,%xmm0
+	pxor	%xmm1,%xmm1
+	pxor	%xmm2,%xmm2
+	pxor	%xmm3,%xmm3
+	pxor	%xmm4,%xmm4
+	pxor	%xmm5,%xmm5
+	pxor	%xmm6,%xmm6
+	pxor	%xmm7,%xmm7
+	ret
+.size	_vpaes_schedule_core,.-_vpaes_schedule_core
+.hidden	_vpaes_schedule_192_smear
+.type	_vpaes_schedule_192_smear,@function
+.align	16
+_vpaes_schedule_192_smear:
+	pshufd	$128,%xmm6,%xmm1
+	pshufd	$254,%xmm7,%xmm0
+	pxor	%xmm1,%xmm6
+	pxor	%xmm1,%xmm1
+	pxor	%xmm0,%xmm6
+	movdqa	%xmm6,%xmm0
+	movhlps	%xmm1,%xmm6
+	ret
+.size	_vpaes_schedule_192_smear,.-_vpaes_schedule_192_smear
+.hidden	_vpaes_schedule_round
+.type	_vpaes_schedule_round,@function
+.align	16
+_vpaes_schedule_round:
+	movdqa	8(%esp),%xmm2
+	pxor	%xmm1,%xmm1
+.byte	102,15,58,15,202,15
+.byte	102,15,58,15,210,15
+	pxor	%xmm1,%xmm7
+	pshufd	$255,%xmm0,%xmm0
+.byte	102,15,58,15,192,1
+	movdqa	%xmm2,8(%esp)
+.L_vpaes_schedule_low_round:
+	movdqa	%xmm7,%xmm1
+	pslldq	$4,%xmm7
+	pxor	%xmm1,%xmm7
+	movdqa	%xmm7,%xmm1
+	pslldq	$8,%xmm7
+	pxor	%xmm1,%xmm7
+	pxor	336(%ebp),%xmm7
+	movdqa	-16(%ebp),%xmm4
+	movdqa	-48(%ebp),%xmm5
+	movdqa	%xmm4,%xmm1
+	pandn	%xmm0,%xmm1
+	psrld	$4,%xmm1
+	pand	%xmm4,%xmm0
+	movdqa	-32(%ebp),%xmm2
+.byte	102,15,56,0,208
+	pxor	%xmm1,%xmm0
+	movdqa	%xmm5,%xmm3
+.byte	102,15,56,0,217
+	pxor	%xmm2,%xmm3
+	movdqa	%xmm5,%xmm4
+.byte	102,15,56,0,224
+	pxor	%xmm2,%xmm4
+	movdqa	%xmm5,%xmm2
+.byte	102,15,56,0,211
+	pxor	%xmm0,%xmm2
+	movdqa	%xmm5,%xmm3
+.byte	102,15,56,0,220
+	pxor	%xmm1,%xmm3
+	movdqa	32(%ebp),%xmm4
+.byte	102,15,56,0,226
+	movdqa	48(%ebp),%xmm0
+.byte	102,15,56,0,195
+	pxor	%xmm4,%xmm0
+	pxor	%xmm7,%xmm0
+	movdqa	%xmm0,%xmm7
+	ret
+.size	_vpaes_schedule_round,.-_vpaes_schedule_round
+.hidden	_vpaes_schedule_transform
+.type	_vpaes_schedule_transform,@function
+.align	16
+_vpaes_schedule_transform:
+	movdqa	-16(%ebp),%xmm2
+	movdqa	%xmm2,%xmm1
+	pandn	%xmm0,%xmm1
+	psrld	$4,%xmm1
+	pand	%xmm2,%xmm0
+	movdqa	(%ebx),%xmm2
+.byte	102,15,56,0,208
+	movdqa	16(%ebx),%xmm0
+.byte	102,15,56,0,193
+	pxor	%xmm2,%xmm0
+	ret
+.size	_vpaes_schedule_transform,.-_vpaes_schedule_transform
+.hidden	_vpaes_schedule_mangle
+.type	_vpaes_schedule_mangle,@function
+.align	16
+_vpaes_schedule_mangle:
+	movdqa	%xmm0,%xmm4
+	movdqa	128(%ebp),%xmm5
+	testl	%edi,%edi
+	jnz	.L014schedule_mangle_dec
+	addl	$16,%edx
+	pxor	336(%ebp),%xmm4
+.byte	102,15,56,0,229
+	movdqa	%xmm4,%xmm3
+.byte	102,15,56,0,229
+	pxor	%xmm4,%xmm3
+.byte	102,15,56,0,229
+	pxor	%xmm4,%xmm3
+	jmp	.L015schedule_mangle_both
+.align	16
+.L014schedule_mangle_dec:
+	movdqa	-16(%ebp),%xmm2
+	leal	416(%ebp),%esi
+	movdqa	%xmm2,%xmm1
+	pandn	%xmm4,%xmm1
+	psrld	$4,%xmm1
+	pand	%xmm2,%xmm4
+	movdqa	(%esi),%xmm2
+.byte	102,15,56,0,212
+	movdqa	16(%esi),%xmm3
+.byte	102,15,56,0,217
+	pxor	%xmm2,%xmm3
+.byte	102,15,56,0,221
+	movdqa	32(%esi),%xmm2
+.byte	102,15,56,0,212
+	pxor	%xmm3,%xmm2
+	movdqa	48(%esi),%xmm3
+.byte	102,15,56,0,217
+	pxor	%xmm2,%xmm3
+.byte	102,15,56,0,221
+	movdqa	64(%esi),%xmm2
+.byte	102,15,56,0,212
+	pxor	%xmm3,%xmm2
+	movdqa	80(%esi),%xmm3
+.byte	102,15,56,0,217
+	pxor	%xmm2,%xmm3
+.byte	102,15,56,0,221
+	movdqa	96(%esi),%xmm2
+.byte	102,15,56,0,212
+	pxor	%xmm3,%xmm2
+	movdqa	112(%esi),%xmm3
+.byte	102,15,56,0,217
+	pxor	%xmm2,%xmm3
+	addl	$-16,%edx
+.L015schedule_mangle_both:
+	movdqa	256(%ebp,%ecx,1),%xmm1
+.byte	102,15,56,0,217
+	addl	$-16,%ecx
+	andl	$48,%ecx
+	movdqu	%xmm3,(%edx)
+	ret
+.size	_vpaes_schedule_mangle,.-_vpaes_schedule_mangle
+.globl	vpaes_set_encrypt_key
+.hidden	vpaes_set_encrypt_key
+.type	vpaes_set_encrypt_key,@function
+.align	16
+vpaes_set_encrypt_key:
+.L_vpaes_set_encrypt_key_begin:
+	pushl	%ebp
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+	movl	20(%esp),%esi
+	leal	-56(%esp),%ebx
+	movl	24(%esp),%eax
+	andl	$-16,%ebx
+	movl	28(%esp),%edx
+	xchgl	%esp,%ebx
+	movl	%ebx,48(%esp)
+	movl	%eax,%ebx
+	shrl	$5,%ebx
+	addl	$5,%ebx
+	movl	%ebx,240(%edx)
+	movl	$48,%ecx
+	movl	$0,%edi
+	leal	.L_vpaes_consts+0x30-.L016pic_point,%ebp
+	call	_vpaes_schedule_core
+.L016pic_point:
+	movl	48(%esp),%esp
+	xorl	%eax,%eax
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.size	vpaes_set_encrypt_key,.-.L_vpaes_set_encrypt_key_begin
+.globl	vpaes_set_decrypt_key
+.hidden	vpaes_set_decrypt_key
+.type	vpaes_set_decrypt_key,@function
+.align	16
+vpaes_set_decrypt_key:
+.L_vpaes_set_decrypt_key_begin:
+	pushl	%ebp
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+	movl	20(%esp),%esi
+	leal	-56(%esp),%ebx
+	movl	24(%esp),%eax
+	andl	$-16,%ebx
+	movl	28(%esp),%edx
+	xchgl	%esp,%ebx
+	movl	%ebx,48(%esp)
+	movl	%eax,%ebx
+	shrl	$5,%ebx
+	addl	$5,%ebx
+	movl	%ebx,240(%edx)
+	shll	$4,%ebx
+	leal	16(%edx,%ebx,1),%edx
+	movl	$1,%edi
+	movl	%eax,%ecx
+	shrl	$1,%ecx
+	andl	$32,%ecx
+	xorl	$32,%ecx
+	leal	.L_vpaes_consts+0x30-.L017pic_point,%ebp
+	call	_vpaes_schedule_core
+.L017pic_point:
+	movl	48(%esp),%esp
+	xorl	%eax,%eax
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.size	vpaes_set_decrypt_key,.-.L_vpaes_set_decrypt_key_begin
+.globl	vpaes_encrypt
+.hidden	vpaes_encrypt
+.type	vpaes_encrypt,@function
+.align	16
+vpaes_encrypt:
+.L_vpaes_encrypt_begin:
+	pushl	%ebp
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+	leal	.L_vpaes_consts+0x30-.L018pic_point,%ebp
+	call	_vpaes_preheat
+.L018pic_point:
+	movl	20(%esp),%esi
+	leal	-56(%esp),%ebx
+	movl	24(%esp),%edi
+	andl	$-16,%ebx
+	movl	28(%esp),%edx
+	xchgl	%esp,%ebx
+	movl	%ebx,48(%esp)
+	movdqu	(%esi),%xmm0
+	call	_vpaes_encrypt_core
+	movdqu	%xmm0,(%edi)
+	movl	48(%esp),%esp
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.size	vpaes_encrypt,.-.L_vpaes_encrypt_begin
+.globl	vpaes_decrypt
+.hidden	vpaes_decrypt
+.type	vpaes_decrypt,@function
+.align	16
+vpaes_decrypt:
+.L_vpaes_decrypt_begin:
+	pushl	%ebp
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+	leal	.L_vpaes_consts+0x30-.L019pic_point,%ebp
+	call	_vpaes_preheat
+.L019pic_point:
+	movl	20(%esp),%esi
+	leal	-56(%esp),%ebx
+	movl	24(%esp),%edi
+	andl	$-16,%ebx
+	movl	28(%esp),%edx
+	xchgl	%esp,%ebx
+	movl	%ebx,48(%esp)
+	movdqu	(%esi),%xmm0
+	call	_vpaes_decrypt_core
+	movdqu	%xmm0,(%edi)
+	movl	48(%esp),%esp
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.size	vpaes_decrypt,.-.L_vpaes_decrypt_begin
+.globl	vpaes_cbc_encrypt
+.hidden	vpaes_cbc_encrypt
+.type	vpaes_cbc_encrypt,@function
+.align	16
+vpaes_cbc_encrypt:
+.L_vpaes_cbc_encrypt_begin:
+	pushl	%ebp
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+	movl	20(%esp),%esi
+	movl	24(%esp),%edi
+	movl	28(%esp),%eax
+	movl	32(%esp),%edx
+	subl	$16,%eax
+	jc	.L020cbc_abort
+	leal	-56(%esp),%ebx
+	movl	36(%esp),%ebp
+	andl	$-16,%ebx
+	movl	40(%esp),%ecx
+	xchgl	%esp,%ebx
+	movdqu	(%ebp),%xmm1
+	subl	%esi,%edi
+	movl	%ebx,48(%esp)
+	movl	%edi,(%esp)
+	movl	%edx,4(%esp)
+	movl	%ebp,8(%esp)
+	movl	%eax,%edi
+	leal	.L_vpaes_consts+0x30-.L021pic_point,%ebp
+	call	_vpaes_preheat
+.L021pic_point:
+	cmpl	$0,%ecx
+	je	.L022cbc_dec_loop
+	jmp	.L023cbc_enc_loop
+.align	16
+.L023cbc_enc_loop:
+	movdqu	(%esi),%xmm0
+	pxor	%xmm1,%xmm0
+	call	_vpaes_encrypt_core
+	movl	(%esp),%ebx
+	movl	4(%esp),%edx
+	movdqa	%xmm0,%xmm1
+	movdqu	%xmm0,(%ebx,%esi,1)
+	leal	16(%esi),%esi
+	subl	$16,%edi
+	jnc	.L023cbc_enc_loop
+	jmp	.L024cbc_done
+.align	16
+.L022cbc_dec_loop:
+	movdqu	(%esi),%xmm0
+	movdqa	%xmm1,16(%esp)
+	movdqa	%xmm0,32(%esp)
+	call	_vpaes_decrypt_core
+	movl	(%esp),%ebx
+	movl	4(%esp),%edx
+	pxor	16(%esp),%xmm0
+	movdqa	32(%esp),%xmm1
+	movdqu	%xmm0,(%ebx,%esi,1)
+	leal	16(%esi),%esi
+	subl	$16,%edi
+	jnc	.L022cbc_dec_loop
+.L024cbc_done:
+	movl	8(%esp),%ebx
+	movl	48(%esp),%esp
+	movdqu	%xmm1,(%ebx)
+.L020cbc_abort:
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.size	vpaes_cbc_encrypt,.-.L_vpaes_cbc_encrypt_begin
+#endif
diff --git a/third_party/boringssl/linux-x86/crypto/bn/bn-586.S b/third_party/boringssl/linux-x86/crypto/bn/bn-586.S
new file mode 100644
index 0000000..773beff
--- /dev/null
+++ b/third_party/boringssl/linux-x86/crypto/bn/bn-586.S
@@ -0,0 +1,1538 @@
+#if defined(__i386__)
+.file	"src/crypto/bn/asm/bn-586.S"
+.text
+.globl	bn_mul_add_words
+.hidden	bn_mul_add_words
+.type	bn_mul_add_words,@function
+.align	16
+bn_mul_add_words:
+.L_bn_mul_add_words_begin:
+	call	.L000PIC_me_up
+.L000PIC_me_up:
+	popl	%eax
+	leal	OPENSSL_ia32cap_P-.L000PIC_me_up(%eax),%eax
+	btl	$26,(%eax)
+	jnc	.L001maw_non_sse2
+	movl	4(%esp),%eax
+	movl	8(%esp),%edx
+	movl	12(%esp),%ecx
+	movd	16(%esp),%mm0
+	pxor	%mm1,%mm1
+	jmp	.L002maw_sse2_entry
+.align	16
+.L003maw_sse2_unrolled:
+	movd	(%eax),%mm3
+	paddq	%mm3,%mm1
+	movd	(%edx),%mm2
+	pmuludq	%mm0,%mm2
+	movd	4(%edx),%mm4
+	pmuludq	%mm0,%mm4
+	movd	8(%edx),%mm6
+	pmuludq	%mm0,%mm6
+	movd	12(%edx),%mm7
+	pmuludq	%mm0,%mm7
+	paddq	%mm2,%mm1
+	movd	4(%eax),%mm3
+	paddq	%mm4,%mm3
+	movd	8(%eax),%mm5
+	paddq	%mm6,%mm5
+	movd	12(%eax),%mm4
+	paddq	%mm4,%mm7
+	movd	%mm1,(%eax)
+	movd	16(%edx),%mm2
+	pmuludq	%mm0,%mm2
+	psrlq	$32,%mm1
+	movd	20(%edx),%mm4
+	pmuludq	%mm0,%mm4
+	paddq	%mm3,%mm1
+	movd	24(%edx),%mm6
+	pmuludq	%mm0,%mm6
+	movd	%mm1,4(%eax)
+	psrlq	$32,%mm1
+	movd	28(%edx),%mm3
+	addl	$32,%edx
+	pmuludq	%mm0,%mm3
+	paddq	%mm5,%mm1
+	movd	16(%eax),%mm5
+	paddq	%mm5,%mm2
+	movd	%mm1,8(%eax)
+	psrlq	$32,%mm1
+	paddq	%mm7,%mm1
+	movd	20(%eax),%mm5
+	paddq	%mm5,%mm4
+	movd	%mm1,12(%eax)
+	psrlq	$32,%mm1
+	paddq	%mm2,%mm1
+	movd	24(%eax),%mm5
+	paddq	%mm5,%mm6
+	movd	%mm1,16(%eax)
+	psrlq	$32,%mm1
+	paddq	%mm4,%mm1
+	movd	28(%eax),%mm5
+	paddq	%mm5,%mm3
+	movd	%mm1,20(%eax)
+	psrlq	$32,%mm1
+	paddq	%mm6,%mm1
+	movd	%mm1,24(%eax)
+	psrlq	$32,%mm1
+	paddq	%mm3,%mm1
+	movd	%mm1,28(%eax)
+	leal	32(%eax),%eax
+	psrlq	$32,%mm1
+	subl	$8,%ecx
+	jz	.L004maw_sse2_exit
+.L002maw_sse2_entry:
+	testl	$4294967288,%ecx
+	jnz	.L003maw_sse2_unrolled
+.align	4
+.L005maw_sse2_loop:
+	movd	(%edx),%mm2
+	movd	(%eax),%mm3
+	pmuludq	%mm0,%mm2
+	leal	4(%edx),%edx
+	paddq	%mm3,%mm1
+	paddq	%mm2,%mm1
+	movd	%mm1,(%eax)
+	subl	$1,%ecx
+	psrlq	$32,%mm1
+	leal	4(%eax),%eax
+	jnz	.L005maw_sse2_loop
+.L004maw_sse2_exit:
+	movd	%mm1,%eax
+	emms
+	ret
+.align	16
+.L001maw_non_sse2:
+	pushl	%ebp
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+
+	xorl	%esi,%esi
+	movl	20(%esp),%edi
+	movl	28(%esp),%ecx
+	movl	24(%esp),%ebx
+	andl	$4294967288,%ecx
+	movl	32(%esp),%ebp
+	pushl	%ecx
+	jz	.L006maw_finish
+.align	16
+.L007maw_loop:
+
+	movl	(%ebx),%eax
+	mull	%ebp
+	addl	%esi,%eax
+	adcl	$0,%edx
+	addl	(%edi),%eax
+	adcl	$0,%edx
+	movl	%eax,(%edi)
+	movl	%edx,%esi
+
+	movl	4(%ebx),%eax
+	mull	%ebp
+	addl	%esi,%eax
+	adcl	$0,%edx
+	addl	4(%edi),%eax
+	adcl	$0,%edx
+	movl	%eax,4(%edi)
+	movl	%edx,%esi
+
+	movl	8(%ebx),%eax
+	mull	%ebp
+	addl	%esi,%eax
+	adcl	$0,%edx
+	addl	8(%edi),%eax
+	adcl	$0,%edx
+	movl	%eax,8(%edi)
+	movl	%edx,%esi
+
+	movl	12(%ebx),%eax
+	mull	%ebp
+	addl	%esi,%eax
+	adcl	$0,%edx
+	addl	12(%edi),%eax
+	adcl	$0,%edx
+	movl	%eax,12(%edi)
+	movl	%edx,%esi
+
+	movl	16(%ebx),%eax
+	mull	%ebp
+	addl	%esi,%eax
+	adcl	$0,%edx
+	addl	16(%edi),%eax
+	adcl	$0,%edx
+	movl	%eax,16(%edi)
+	movl	%edx,%esi
+
+	movl	20(%ebx),%eax
+	mull	%ebp
+	addl	%esi,%eax
+	adcl	$0,%edx
+	addl	20(%edi),%eax
+	adcl	$0,%edx
+	movl	%eax,20(%edi)
+	movl	%edx,%esi
+
+	movl	24(%ebx),%eax
+	mull	%ebp
+	addl	%esi,%eax
+	adcl	$0,%edx
+	addl	24(%edi),%eax
+	adcl	$0,%edx
+	movl	%eax,24(%edi)
+	movl	%edx,%esi
+
+	movl	28(%ebx),%eax
+	mull	%ebp
+	addl	%esi,%eax
+	adcl	$0,%edx
+	addl	28(%edi),%eax
+	adcl	$0,%edx
+	movl	%eax,28(%edi)
+	movl	%edx,%esi
+
+	subl	$8,%ecx
+	leal	32(%ebx),%ebx
+	leal	32(%edi),%edi
+	jnz	.L007maw_loop
+.L006maw_finish:
+	movl	32(%esp),%ecx
+	andl	$7,%ecx
+	jnz	.L008maw_finish2
+	jmp	.L009maw_end
+.L008maw_finish2:
+
+	movl	(%ebx),%eax
+	mull	%ebp
+	addl	%esi,%eax
+	adcl	$0,%edx
+	addl	(%edi),%eax
+	adcl	$0,%edx
+	decl	%ecx
+	movl	%eax,(%edi)
+	movl	%edx,%esi
+	jz	.L009maw_end
+
+	movl	4(%ebx),%eax
+	mull	%ebp
+	addl	%esi,%eax
+	adcl	$0,%edx
+	addl	4(%edi),%eax
+	adcl	$0,%edx
+	decl	%ecx
+	movl	%eax,4(%edi)
+	movl	%edx,%esi
+	jz	.L009maw_end
+
+	movl	8(%ebx),%eax
+	mull	%ebp
+	addl	%esi,%eax
+	adcl	$0,%edx
+	addl	8(%edi),%eax
+	adcl	$0,%edx
+	decl	%ecx
+	movl	%eax,8(%edi)
+	movl	%edx,%esi
+	jz	.L009maw_end
+
+	movl	12(%ebx),%eax
+	mull	%ebp
+	addl	%esi,%eax
+	adcl	$0,%edx
+	addl	12(%edi),%eax
+	adcl	$0,%edx
+	decl	%ecx
+	movl	%eax,12(%edi)
+	movl	%edx,%esi
+	jz	.L009maw_end
+
+	movl	16(%ebx),%eax
+	mull	%ebp
+	addl	%esi,%eax
+	adcl	$0,%edx
+	addl	16(%edi),%eax
+	adcl	$0,%edx
+	decl	%ecx
+	movl	%eax,16(%edi)
+	movl	%edx,%esi
+	jz	.L009maw_end
+
+	movl	20(%ebx),%eax
+	mull	%ebp
+	addl	%esi,%eax
+	adcl	$0,%edx
+	addl	20(%edi),%eax
+	adcl	$0,%edx
+	decl	%ecx
+	movl	%eax,20(%edi)
+	movl	%edx,%esi
+	jz	.L009maw_end
+
+	movl	24(%ebx),%eax
+	mull	%ebp
+	addl	%esi,%eax
+	adcl	$0,%edx
+	addl	24(%edi),%eax
+	adcl	$0,%edx
+	movl	%eax,24(%edi)
+	movl	%edx,%esi
+.L009maw_end:
+	movl	%esi,%eax
+	popl	%ecx
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.size	bn_mul_add_words,.-.L_bn_mul_add_words_begin
+.globl	bn_mul_words
+.hidden	bn_mul_words
+.type	bn_mul_words,@function
+.align	16
+bn_mul_words:
+.L_bn_mul_words_begin:
+	call	.L010PIC_me_up
+.L010PIC_me_up:
+	popl	%eax
+	leal	OPENSSL_ia32cap_P-.L010PIC_me_up(%eax),%eax
+	btl	$26,(%eax)
+	jnc	.L011mw_non_sse2
+	movl	4(%esp),%eax
+	movl	8(%esp),%edx
+	movl	12(%esp),%ecx
+	movd	16(%esp),%mm0
+	pxor	%mm1,%mm1
+.align	16
+.L012mw_sse2_loop:
+	movd	(%edx),%mm2
+	pmuludq	%mm0,%mm2
+	leal	4(%edx),%edx
+	paddq	%mm2,%mm1
+	movd	%mm1,(%eax)
+	subl	$1,%ecx
+	psrlq	$32,%mm1
+	leal	4(%eax),%eax
+	jnz	.L012mw_sse2_loop
+	movd	%mm1,%eax
+	emms
+	ret
+.align	16
+.L011mw_non_sse2:
+	pushl	%ebp
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+
+	xorl	%esi,%esi
+	movl	20(%esp),%edi
+	movl	24(%esp),%ebx
+	movl	28(%esp),%ebp
+	movl	32(%esp),%ecx
+	andl	$4294967288,%ebp
+	jz	.L013mw_finish
+.L014mw_loop:
+
+	movl	(%ebx),%eax
+	mull	%ecx
+	addl	%esi,%eax
+	adcl	$0,%edx
+	movl	%eax,(%edi)
+	movl	%edx,%esi
+
+	movl	4(%ebx),%eax
+	mull	%ecx
+	addl	%esi,%eax
+	adcl	$0,%edx
+	movl	%eax,4(%edi)
+	movl	%edx,%esi
+
+	movl	8(%ebx),%eax
+	mull	%ecx
+	addl	%esi,%eax
+	adcl	$0,%edx
+	movl	%eax,8(%edi)
+	movl	%edx,%esi
+
+	movl	12(%ebx),%eax
+	mull	%ecx
+	addl	%esi,%eax
+	adcl	$0,%edx
+	movl	%eax,12(%edi)
+	movl	%edx,%esi
+
+	movl	16(%ebx),%eax
+	mull	%ecx
+	addl	%esi,%eax
+	adcl	$0,%edx
+	movl	%eax,16(%edi)
+	movl	%edx,%esi
+
+	movl	20(%ebx),%eax
+	mull	%ecx
+	addl	%esi,%eax
+	adcl	$0,%edx
+	movl	%eax,20(%edi)
+	movl	%edx,%esi
+
+	movl	24(%ebx),%eax
+	mull	%ecx
+	addl	%esi,%eax
+	adcl	$0,%edx
+	movl	%eax,24(%edi)
+	movl	%edx,%esi
+
+	movl	28(%ebx),%eax
+	mull	%ecx
+	addl	%esi,%eax
+	adcl	$0,%edx
+	movl	%eax,28(%edi)
+	movl	%edx,%esi
+
+	addl	$32,%ebx
+	addl	$32,%edi
+	subl	$8,%ebp
+	jz	.L013mw_finish
+	jmp	.L014mw_loop
+.L013mw_finish:
+	movl	28(%esp),%ebp
+	andl	$7,%ebp
+	jnz	.L015mw_finish2
+	jmp	.L016mw_end
+.L015mw_finish2:
+
+	movl	(%ebx),%eax
+	mull	%ecx
+	addl	%esi,%eax
+	adcl	$0,%edx
+	movl	%eax,(%edi)
+	movl	%edx,%esi
+	decl	%ebp
+	jz	.L016mw_end
+
+	movl	4(%ebx),%eax
+	mull	%ecx
+	addl	%esi,%eax
+	adcl	$0,%edx
+	movl	%eax,4(%edi)
+	movl	%edx,%esi
+	decl	%ebp
+	jz	.L016mw_end
+
+	movl	8(%ebx),%eax
+	mull	%ecx
+	addl	%esi,%eax
+	adcl	$0,%edx
+	movl	%eax,8(%edi)
+	movl	%edx,%esi
+	decl	%ebp
+	jz	.L016mw_end
+
+	movl	12(%ebx),%eax
+	mull	%ecx
+	addl	%esi,%eax
+	adcl	$0,%edx
+	movl	%eax,12(%edi)
+	movl	%edx,%esi
+	decl	%ebp
+	jz	.L016mw_end
+
+	movl	16(%ebx),%eax
+	mull	%ecx
+	addl	%esi,%eax
+	adcl	$0,%edx
+	movl	%eax,16(%edi)
+	movl	%edx,%esi
+	decl	%ebp
+	jz	.L016mw_end
+
+	movl	20(%ebx),%eax
+	mull	%ecx
+	addl	%esi,%eax
+	adcl	$0,%edx
+	movl	%eax,20(%edi)
+	movl	%edx,%esi
+	decl	%ebp
+	jz	.L016mw_end
+
+	movl	24(%ebx),%eax
+	mull	%ecx
+	addl	%esi,%eax
+	adcl	$0,%edx
+	movl	%eax,24(%edi)
+	movl	%edx,%esi
+.L016mw_end:
+	movl	%esi,%eax
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.size	bn_mul_words,.-.L_bn_mul_words_begin
+.globl	bn_sqr_words
+.hidden	bn_sqr_words
+.type	bn_sqr_words,@function
+.align	16
+bn_sqr_words:
+.L_bn_sqr_words_begin:
+	call	.L017PIC_me_up
+.L017PIC_me_up:
+	popl	%eax
+	leal	OPENSSL_ia32cap_P-.L017PIC_me_up(%eax),%eax
+	btl	$26,(%eax)
+	jnc	.L018sqr_non_sse2
+	movl	4(%esp),%eax
+	movl	8(%esp),%edx
+	movl	12(%esp),%ecx
+.align	16
+.L019sqr_sse2_loop:
+	movd	(%edx),%mm0
+	pmuludq	%mm0,%mm0
+	leal	4(%edx),%edx
+	movq	%mm0,(%eax)
+	subl	$1,%ecx
+	leal	8(%eax),%eax
+	jnz	.L019sqr_sse2_loop
+	emms
+	ret
+.align	16
+.L018sqr_non_sse2:
+	pushl	%ebp
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+
+	movl	20(%esp),%esi
+	movl	24(%esp),%edi
+	movl	28(%esp),%ebx
+	andl	$4294967288,%ebx
+	jz	.L020sw_finish
+.L021sw_loop:
+
+	movl	(%edi),%eax
+	mull	%eax
+	movl	%eax,(%esi)
+	movl	%edx,4(%esi)
+
+	movl	4(%edi),%eax
+	mull	%eax
+	movl	%eax,8(%esi)
+	movl	%edx,12(%esi)
+
+	movl	8(%edi),%eax
+	mull	%eax
+	movl	%eax,16(%esi)
+	movl	%edx,20(%esi)
+
+	movl	12(%edi),%eax
+	mull	%eax
+	movl	%eax,24(%esi)
+	movl	%edx,28(%esi)
+
+	movl	16(%edi),%eax
+	mull	%eax
+	movl	%eax,32(%esi)
+	movl	%edx,36(%esi)
+
+	movl	20(%edi),%eax
+	mull	%eax
+	movl	%eax,40(%esi)
+	movl	%edx,44(%esi)
+
+	movl	24(%edi),%eax
+	mull	%eax
+	movl	%eax,48(%esi)
+	movl	%edx,52(%esi)
+
+	movl	28(%edi),%eax
+	mull	%eax
+	movl	%eax,56(%esi)
+	movl	%edx,60(%esi)
+
+	addl	$32,%edi
+	addl	$64,%esi
+	subl	$8,%ebx
+	jnz	.L021sw_loop
+.L020sw_finish:
+	movl	28(%esp),%ebx
+	andl	$7,%ebx
+	jz	.L022sw_end
+
+	movl	(%edi),%eax
+	mull	%eax
+	movl	%eax,(%esi)
+	decl	%ebx
+	movl	%edx,4(%esi)
+	jz	.L022sw_end
+
+	movl	4(%edi),%eax
+	mull	%eax
+	movl	%eax,8(%esi)
+	decl	%ebx
+	movl	%edx,12(%esi)
+	jz	.L022sw_end
+
+	movl	8(%edi),%eax
+	mull	%eax
+	movl	%eax,16(%esi)
+	decl	%ebx
+	movl	%edx,20(%esi)
+	jz	.L022sw_end
+
+	movl	12(%edi),%eax
+	mull	%eax
+	movl	%eax,24(%esi)
+	decl	%ebx
+	movl	%edx,28(%esi)
+	jz	.L022sw_end
+
+	movl	16(%edi),%eax
+	mull	%eax
+	movl	%eax,32(%esi)
+	decl	%ebx
+	movl	%edx,36(%esi)
+	jz	.L022sw_end
+
+	movl	20(%edi),%eax
+	mull	%eax
+	movl	%eax,40(%esi)
+	decl	%ebx
+	movl	%edx,44(%esi)
+	jz	.L022sw_end
+
+	movl	24(%edi),%eax
+	mull	%eax
+	movl	%eax,48(%esi)
+	movl	%edx,52(%esi)
+.L022sw_end:
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.size	bn_sqr_words,.-.L_bn_sqr_words_begin
+.globl	bn_div_words
+.hidden	bn_div_words
+.type	bn_div_words,@function
+.align	16
+bn_div_words:
+.L_bn_div_words_begin:
+	movl	4(%esp),%edx
+	movl	8(%esp),%eax
+	movl	12(%esp),%ecx
+	divl	%ecx
+	ret
+.size	bn_div_words,.-.L_bn_div_words_begin
+.globl	bn_add_words
+.hidden	bn_add_words
+.type	bn_add_words,@function
+.align	16
+bn_add_words:
+.L_bn_add_words_begin:
+	pushl	%ebp
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+
+	movl	20(%esp),%ebx
+	movl	24(%esp),%esi
+	movl	28(%esp),%edi
+	movl	32(%esp),%ebp
+	xorl	%eax,%eax
+	andl	$4294967288,%ebp
+	jz	.L023aw_finish
+.L024aw_loop:
+
+	movl	(%esi),%ecx
+	movl	(%edi),%edx
+	addl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	addl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,(%ebx)
+
+	movl	4(%esi),%ecx
+	movl	4(%edi),%edx
+	addl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	addl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,4(%ebx)
+
+	movl	8(%esi),%ecx
+	movl	8(%edi),%edx
+	addl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	addl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,8(%ebx)
+
+	movl	12(%esi),%ecx
+	movl	12(%edi),%edx
+	addl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	addl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,12(%ebx)
+
+	movl	16(%esi),%ecx
+	movl	16(%edi),%edx
+	addl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	addl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,16(%ebx)
+
+	movl	20(%esi),%ecx
+	movl	20(%edi),%edx
+	addl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	addl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,20(%ebx)
+
+	movl	24(%esi),%ecx
+	movl	24(%edi),%edx
+	addl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	addl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,24(%ebx)
+
+	movl	28(%esi),%ecx
+	movl	28(%edi),%edx
+	addl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	addl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,28(%ebx)
+
+	addl	$32,%esi
+	addl	$32,%edi
+	addl	$32,%ebx
+	subl	$8,%ebp
+	jnz	.L024aw_loop
+.L023aw_finish:
+	movl	32(%esp),%ebp
+	andl	$7,%ebp
+	jz	.L025aw_end
+
+	movl	(%esi),%ecx
+	movl	(%edi),%edx
+	addl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	addl	%edx,%ecx
+	adcl	$0,%eax
+	decl	%ebp
+	movl	%ecx,(%ebx)
+	jz	.L025aw_end
+
+	movl	4(%esi),%ecx
+	movl	4(%edi),%edx
+	addl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	addl	%edx,%ecx
+	adcl	$0,%eax
+	decl	%ebp
+	movl	%ecx,4(%ebx)
+	jz	.L025aw_end
+
+	movl	8(%esi),%ecx
+	movl	8(%edi),%edx
+	addl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	addl	%edx,%ecx
+	adcl	$0,%eax
+	decl	%ebp
+	movl	%ecx,8(%ebx)
+	jz	.L025aw_end
+
+	movl	12(%esi),%ecx
+	movl	12(%edi),%edx
+	addl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	addl	%edx,%ecx
+	adcl	$0,%eax
+	decl	%ebp
+	movl	%ecx,12(%ebx)
+	jz	.L025aw_end
+
+	movl	16(%esi),%ecx
+	movl	16(%edi),%edx
+	addl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	addl	%edx,%ecx
+	adcl	$0,%eax
+	decl	%ebp
+	movl	%ecx,16(%ebx)
+	jz	.L025aw_end
+
+	movl	20(%esi),%ecx
+	movl	20(%edi),%edx
+	addl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	addl	%edx,%ecx
+	adcl	$0,%eax
+	decl	%ebp
+	movl	%ecx,20(%ebx)
+	jz	.L025aw_end
+
+	movl	24(%esi),%ecx
+	movl	24(%edi),%edx
+	addl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	addl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,24(%ebx)
+.L025aw_end:
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.size	bn_add_words,.-.L_bn_add_words_begin
+.globl	bn_sub_words
+.hidden	bn_sub_words
+.type	bn_sub_words,@function
+.align	16
+bn_sub_words:
+.L_bn_sub_words_begin:
+	pushl	%ebp
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+
+	movl	20(%esp),%ebx
+	movl	24(%esp),%esi
+	movl	28(%esp),%edi
+	movl	32(%esp),%ebp
+	xorl	%eax,%eax
+	andl	$4294967288,%ebp
+	jz	.L026aw_finish
+.L027aw_loop:
+
+	movl	(%esi),%ecx
+	movl	(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,(%ebx)
+
+	movl	4(%esi),%ecx
+	movl	4(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,4(%ebx)
+
+	movl	8(%esi),%ecx
+	movl	8(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,8(%ebx)
+
+	movl	12(%esi),%ecx
+	movl	12(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,12(%ebx)
+
+	movl	16(%esi),%ecx
+	movl	16(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,16(%ebx)
+
+	movl	20(%esi),%ecx
+	movl	20(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,20(%ebx)
+
+	movl	24(%esi),%ecx
+	movl	24(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,24(%ebx)
+
+	movl	28(%esi),%ecx
+	movl	28(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,28(%ebx)
+
+	addl	$32,%esi
+	addl	$32,%edi
+	addl	$32,%ebx
+	subl	$8,%ebp
+	jnz	.L027aw_loop
+.L026aw_finish:
+	movl	32(%esp),%ebp
+	andl	$7,%ebp
+	jz	.L028aw_end
+
+	movl	(%esi),%ecx
+	movl	(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	decl	%ebp
+	movl	%ecx,(%ebx)
+	jz	.L028aw_end
+
+	movl	4(%esi),%ecx
+	movl	4(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	decl	%ebp
+	movl	%ecx,4(%ebx)
+	jz	.L028aw_end
+
+	movl	8(%esi),%ecx
+	movl	8(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	decl	%ebp
+	movl	%ecx,8(%ebx)
+	jz	.L028aw_end
+
+	movl	12(%esi),%ecx
+	movl	12(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	decl	%ebp
+	movl	%ecx,12(%ebx)
+	jz	.L028aw_end
+
+	movl	16(%esi),%ecx
+	movl	16(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	decl	%ebp
+	movl	%ecx,16(%ebx)
+	jz	.L028aw_end
+
+	movl	20(%esi),%ecx
+	movl	20(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	decl	%ebp
+	movl	%ecx,20(%ebx)
+	jz	.L028aw_end
+
+	movl	24(%esi),%ecx
+	movl	24(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,24(%ebx)
+.L028aw_end:
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.size	bn_sub_words,.-.L_bn_sub_words_begin
+.globl	bn_sub_part_words
+.hidden	bn_sub_part_words
+.type	bn_sub_part_words,@function
+.align	16
+bn_sub_part_words:
+.L_bn_sub_part_words_begin:
+	pushl	%ebp
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+
+	movl	20(%esp),%ebx
+	movl	24(%esp),%esi
+	movl	28(%esp),%edi
+	movl	32(%esp),%ebp
+	xorl	%eax,%eax
+	andl	$4294967288,%ebp
+	jz	.L029aw_finish
+.L030aw_loop:
+
+	movl	(%esi),%ecx
+	movl	(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,(%ebx)
+
+	movl	4(%esi),%ecx
+	movl	4(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,4(%ebx)
+
+	movl	8(%esi),%ecx
+	movl	8(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,8(%ebx)
+
+	movl	12(%esi),%ecx
+	movl	12(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,12(%ebx)
+
+	movl	16(%esi),%ecx
+	movl	16(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,16(%ebx)
+
+	movl	20(%esi),%ecx
+	movl	20(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,20(%ebx)
+
+	movl	24(%esi),%ecx
+	movl	24(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,24(%ebx)
+
+	movl	28(%esi),%ecx
+	movl	28(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,28(%ebx)
+
+	addl	$32,%esi
+	addl	$32,%edi
+	addl	$32,%ebx
+	subl	$8,%ebp
+	jnz	.L030aw_loop
+.L029aw_finish:
+	movl	32(%esp),%ebp
+	andl	$7,%ebp
+	jz	.L031aw_end
+
+	movl	(%esi),%ecx
+	movl	(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,(%ebx)
+	addl	$4,%esi
+	addl	$4,%edi
+	addl	$4,%ebx
+	decl	%ebp
+	jz	.L031aw_end
+
+	movl	(%esi),%ecx
+	movl	(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,(%ebx)
+	addl	$4,%esi
+	addl	$4,%edi
+	addl	$4,%ebx
+	decl	%ebp
+	jz	.L031aw_end
+
+	movl	(%esi),%ecx
+	movl	(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,(%ebx)
+	addl	$4,%esi
+	addl	$4,%edi
+	addl	$4,%ebx
+	decl	%ebp
+	jz	.L031aw_end
+
+	movl	(%esi),%ecx
+	movl	(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,(%ebx)
+	addl	$4,%esi
+	addl	$4,%edi
+	addl	$4,%ebx
+	decl	%ebp
+	jz	.L031aw_end
+
+	movl	(%esi),%ecx
+	movl	(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,(%ebx)
+	addl	$4,%esi
+	addl	$4,%edi
+	addl	$4,%ebx
+	decl	%ebp
+	jz	.L031aw_end
+
+	movl	(%esi),%ecx
+	movl	(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,(%ebx)
+	addl	$4,%esi
+	addl	$4,%edi
+	addl	$4,%ebx
+	decl	%ebp
+	jz	.L031aw_end
+
+	movl	(%esi),%ecx
+	movl	(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,(%ebx)
+	addl	$4,%esi
+	addl	$4,%edi
+	addl	$4,%ebx
+.L031aw_end:
+	cmpl	$0,36(%esp)
+	je	.L032pw_end
+	movl	36(%esp),%ebp
+	cmpl	$0,%ebp
+	je	.L032pw_end
+	jge	.L033pw_pos
+
+	movl	$0,%edx
+	subl	%ebp,%edx
+	movl	%edx,%ebp
+	andl	$4294967288,%ebp
+	jz	.L034pw_neg_finish
+.L035pw_neg_loop:
+
+	movl	$0,%ecx
+	movl	(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,(%ebx)
+
+	movl	$0,%ecx
+	movl	4(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,4(%ebx)
+
+	movl	$0,%ecx
+	movl	8(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,8(%ebx)
+
+	movl	$0,%ecx
+	movl	12(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,12(%ebx)
+
+	movl	$0,%ecx
+	movl	16(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,16(%ebx)
+
+	movl	$0,%ecx
+	movl	20(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,20(%ebx)
+
+	movl	$0,%ecx
+	movl	24(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,24(%ebx)
+
+	movl	$0,%ecx
+	movl	28(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,28(%ebx)
+
+	addl	$32,%edi
+	addl	$32,%ebx
+	subl	$8,%ebp
+	jnz	.L035pw_neg_loop
+.L034pw_neg_finish:
+	movl	36(%esp),%edx
+	movl	$0,%ebp
+	subl	%edx,%ebp
+	andl	$7,%ebp
+	jz	.L032pw_end
+
+	movl	$0,%ecx
+	movl	(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	decl	%ebp
+	movl	%ecx,(%ebx)
+	jz	.L032pw_end
+
+	movl	$0,%ecx
+	movl	4(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	decl	%ebp
+	movl	%ecx,4(%ebx)
+	jz	.L032pw_end
+
+	movl	$0,%ecx
+	movl	8(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	decl	%ebp
+	movl	%ecx,8(%ebx)
+	jz	.L032pw_end
+
+	movl	$0,%ecx
+	movl	12(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	decl	%ebp
+	movl	%ecx,12(%ebx)
+	jz	.L032pw_end
+
+	movl	$0,%ecx
+	movl	16(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	decl	%ebp
+	movl	%ecx,16(%ebx)
+	jz	.L032pw_end
+
+	movl	$0,%ecx
+	movl	20(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	decl	%ebp
+	movl	%ecx,20(%ebx)
+	jz	.L032pw_end
+
+	movl	$0,%ecx
+	movl	24(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,24(%ebx)
+	jmp	.L032pw_end
+.L033pw_pos:
+	andl	$4294967288,%ebp
+	jz	.L036pw_pos_finish
+.L037pw_pos_loop:
+
+	movl	(%esi),%ecx
+	subl	%eax,%ecx
+	movl	%ecx,(%ebx)
+	jnc	.L038pw_nc0
+
+	movl	4(%esi),%ecx
+	subl	%eax,%ecx
+	movl	%ecx,4(%ebx)
+	jnc	.L039pw_nc1
+
+	movl	8(%esi),%ecx
+	subl	%eax,%ecx
+	movl	%ecx,8(%ebx)
+	jnc	.L040pw_nc2
+
+	movl	12(%esi),%ecx
+	subl	%eax,%ecx
+	movl	%ecx,12(%ebx)
+	jnc	.L041pw_nc3
+
+	movl	16(%esi),%ecx
+	subl	%eax,%ecx
+	movl	%ecx,16(%ebx)
+	jnc	.L042pw_nc4
+
+	movl	20(%esi),%ecx
+	subl	%eax,%ecx
+	movl	%ecx,20(%ebx)
+	jnc	.L043pw_nc5
+
+	movl	24(%esi),%ecx
+	subl	%eax,%ecx
+	movl	%ecx,24(%ebx)
+	jnc	.L044pw_nc6
+
+	movl	28(%esi),%ecx
+	subl	%eax,%ecx
+	movl	%ecx,28(%ebx)
+	jnc	.L045pw_nc7
+
+	addl	$32,%esi
+	addl	$32,%ebx
+	subl	$8,%ebp
+	jnz	.L037pw_pos_loop
+.L036pw_pos_finish:
+	movl	36(%esp),%ebp
+	andl	$7,%ebp
+	jz	.L032pw_end
+
+	movl	(%esi),%ecx
+	subl	%eax,%ecx
+	movl	%ecx,(%ebx)
+	jnc	.L046pw_tail_nc0
+	decl	%ebp
+	jz	.L032pw_end
+
+	movl	4(%esi),%ecx
+	subl	%eax,%ecx
+	movl	%ecx,4(%ebx)
+	jnc	.L047pw_tail_nc1
+	decl	%ebp
+	jz	.L032pw_end
+
+	movl	8(%esi),%ecx
+	subl	%eax,%ecx
+	movl	%ecx,8(%ebx)
+	jnc	.L048pw_tail_nc2
+	decl	%ebp
+	jz	.L032pw_end
+
+	movl	12(%esi),%ecx
+	subl	%eax,%ecx
+	movl	%ecx,12(%ebx)
+	jnc	.L049pw_tail_nc3
+	decl	%ebp
+	jz	.L032pw_end
+
+	movl	16(%esi),%ecx
+	subl	%eax,%ecx
+	movl	%ecx,16(%ebx)
+	jnc	.L050pw_tail_nc4
+	decl	%ebp
+	jz	.L032pw_end
+
+	movl	20(%esi),%ecx
+	subl	%eax,%ecx
+	movl	%ecx,20(%ebx)
+	jnc	.L051pw_tail_nc5
+	decl	%ebp
+	jz	.L032pw_end
+
+	movl	24(%esi),%ecx
+	subl	%eax,%ecx
+	movl	%ecx,24(%ebx)
+	jnc	.L052pw_tail_nc6
+	movl	$1,%eax
+	jmp	.L032pw_end
+.L053pw_nc_loop:
+	movl	(%esi),%ecx
+	movl	%ecx,(%ebx)
+.L038pw_nc0:
+	movl	4(%esi),%ecx
+	movl	%ecx,4(%ebx)
+.L039pw_nc1:
+	movl	8(%esi),%ecx
+	movl	%ecx,8(%ebx)
+.L040pw_nc2:
+	movl	12(%esi),%ecx
+	movl	%ecx,12(%ebx)
+.L041pw_nc3:
+	movl	16(%esi),%ecx
+	movl	%ecx,16(%ebx)
+.L042pw_nc4:
+	movl	20(%esi),%ecx
+	movl	%ecx,20(%ebx)
+.L043pw_nc5:
+	movl	24(%esi),%ecx
+	movl	%ecx,24(%ebx)
+.L044pw_nc6:
+	movl	28(%esi),%ecx
+	movl	%ecx,28(%ebx)
+.L045pw_nc7:
+
+	addl	$32,%esi
+	addl	$32,%ebx
+	subl	$8,%ebp
+	jnz	.L053pw_nc_loop
+	movl	36(%esp),%ebp
+	andl	$7,%ebp
+	jz	.L054pw_nc_end
+	movl	(%esi),%ecx
+	movl	%ecx,(%ebx)
+.L046pw_tail_nc0:
+	decl	%ebp
+	jz	.L054pw_nc_end
+	movl	4(%esi),%ecx
+	movl	%ecx,4(%ebx)
+.L047pw_tail_nc1:
+	decl	%ebp
+	jz	.L054pw_nc_end
+	movl	8(%esi),%ecx
+	movl	%ecx,8(%ebx)
+.L048pw_tail_nc2:
+	decl	%ebp
+	jz	.L054pw_nc_end
+	movl	12(%esi),%ecx
+	movl	%ecx,12(%ebx)
+.L049pw_tail_nc3:
+	decl	%ebp
+	jz	.L054pw_nc_end
+	movl	16(%esi),%ecx
+	movl	%ecx,16(%ebx)
+.L050pw_tail_nc4:
+	decl	%ebp
+	jz	.L054pw_nc_end
+	movl	20(%esi),%ecx
+	movl	%ecx,20(%ebx)
+.L051pw_tail_nc5:
+	decl	%ebp
+	jz	.L054pw_nc_end
+	movl	24(%esi),%ecx
+	movl	%ecx,24(%ebx)
+.L052pw_tail_nc6:
+.L054pw_nc_end:
+	movl	$0,%eax
+.L032pw_end:
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.size	bn_sub_part_words,.-.L_bn_sub_part_words_begin
+#endif
diff --git a/third_party/boringssl/linux-x86/crypto/bn/co-586.S b/third_party/boringssl/linux-x86/crypto/bn/co-586.S
new file mode 100644
index 0000000..e41c3a1
--- /dev/null
+++ b/third_party/boringssl/linux-x86/crypto/bn/co-586.S
@@ -0,0 +1,1260 @@
+#if defined(__i386__)
+.file	"src/crypto/bn/asm/co-586.S"
+.text
+.globl	bn_mul_comba8
+.hidden	bn_mul_comba8
+.type	bn_mul_comba8,@function
+.align	16
+bn_mul_comba8:
+.L_bn_mul_comba8_begin:
+	pushl	%esi
+	movl	12(%esp),%esi
+	pushl	%edi
+	movl	20(%esp),%edi
+	pushl	%ebp
+	pushl	%ebx
+	xorl	%ebx,%ebx
+	movl	(%esi),%eax
+	xorl	%ecx,%ecx
+	movl	(%edi),%edx
+
+	xorl	%ebp,%ebp
+
+	mull	%edx
+	addl	%eax,%ebx
+	movl	20(%esp),%eax
+	adcl	%edx,%ecx
+	movl	(%edi),%edx
+	adcl	$0,%ebp
+	movl	%ebx,(%eax)
+	movl	4(%esi),%eax
+
+
+	xorl	%ebx,%ebx
+
+	mull	%edx
+	addl	%eax,%ecx
+	movl	(%esi),%eax
+	adcl	%edx,%ebp
+	movl	4(%edi),%edx
+	adcl	$0,%ebx
+
+	mull	%edx
+	addl	%eax,%ecx
+	movl	20(%esp),%eax
+	adcl	%edx,%ebp
+	movl	(%edi),%edx
+	adcl	$0,%ebx
+	movl	%ecx,4(%eax)
+	movl	8(%esi),%eax
+
+
+	xorl	%ecx,%ecx
+
+	mull	%edx
+	addl	%eax,%ebp
+	movl	4(%esi),%eax
+	adcl	%edx,%ebx
+	movl	4(%edi),%edx
+	adcl	$0,%ecx
+
+	mull	%edx
+	addl	%eax,%ebp
+	movl	(%esi),%eax
+	adcl	%edx,%ebx
+	movl	8(%edi),%edx
+	adcl	$0,%ecx
+
+	mull	%edx
+	addl	%eax,%ebp
+	movl	20(%esp),%eax
+	adcl	%edx,%ebx
+	movl	(%edi),%edx
+	adcl	$0,%ecx
+	movl	%ebp,8(%eax)
+	movl	12(%esi),%eax
+
+
+	xorl	%ebp,%ebp
+
+	mull	%edx
+	addl	%eax,%ebx
+	movl	8(%esi),%eax
+	adcl	%edx,%ecx
+	movl	4(%edi),%edx
+	adcl	$0,%ebp
+
+	mull	%edx
+	addl	%eax,%ebx
+	movl	4(%esi),%eax
+	adcl	%edx,%ecx
+	movl	8(%edi),%edx
+	adcl	$0,%ebp
+
+	mull	%edx
+	addl	%eax,%ebx
+	movl	(%esi),%eax
+	adcl	%edx,%ecx
+	movl	12(%edi),%edx
+	adcl	$0,%ebp
+
+	mull	%edx
+	addl	%eax,%ebx
+	movl	20(%esp),%eax
+	adcl	%edx,%ecx
+	movl	(%edi),%edx
+	adcl	$0,%ebp
+	movl	%ebx,12(%eax)
+	movl	16(%esi),%eax
+
+
+	xorl	%ebx,%ebx
+
+	mull	%edx
+	addl	%eax,%ecx
+	movl	12(%esi),%eax
+	adcl	%edx,%ebp
+	movl	4(%edi),%edx
+	adcl	$0,%ebx
+
+	mull	%edx
+	addl	%eax,%ecx
+	movl	8(%esi),%eax
+	adcl	%edx,%ebp
+	movl	8(%edi),%edx
+	adcl	$0,%ebx
+
+	mull	%edx
+	addl	%eax,%ecx
+	movl	4(%esi),%eax
+	adcl	%edx,%ebp
+	movl	12(%edi),%edx
+	adcl	$0,%ebx
+
+	mull	%edx
+	addl	%eax,%ecx
+	movl	(%esi),%eax
+	adcl	%edx,%ebp
+	movl	16(%edi),%edx
+	adcl	$0,%ebx
+
+	mull	%edx
+	addl	%eax,%ecx
+	movl	20(%esp),%eax
+	adcl	%edx,%ebp
+	movl	(%edi),%edx
+	adcl	$0,%ebx
+	movl	%ecx,16(%eax)
+	movl	20(%esi),%eax
+
+
+	xorl	%ecx,%ecx
+
+	mull	%edx
+	addl	%eax,%ebp
+	movl	16(%esi),%eax
+	adcl	%edx,%ebx
+	movl	4(%edi),%edx
+	adcl	$0,%ecx
+
+	mull	%edx
+	addl	%eax,%ebp
+	movl	12(%esi),%eax
+	adcl	%edx,%ebx
+	movl	8(%edi),%edx
+	adcl	$0,%ecx
+
+	mull	%edx
+	addl	%eax,%ebp
+	movl	8(%esi),%eax
+	adcl	%edx,%ebx
+	movl	12(%edi),%edx
+	adcl	$0,%ecx
+
+	mull	%edx
+	addl	%eax,%ebp
+	movl	4(%esi),%eax
+	adcl	%edx,%ebx
+	movl	16(%edi),%edx
+	adcl	$0,%ecx
+
+	mull	%edx
+	addl	%eax,%ebp
+	movl	(%esi),%eax
+	adcl	%edx,%ebx
+	movl	20(%edi),%edx
+	adcl	$0,%ecx
+
+	mull	%edx
+	addl	%eax,%ebp
+	movl	20(%esp),%eax
+	adcl	%edx,%ebx
+	movl	(%edi),%edx
+	adcl	$0,%ecx
+	movl	%ebp,20(%eax)
+	movl	24(%esi),%eax
+
+
+	xorl	%ebp,%ebp
+
+	mull	%edx
+	addl	%eax,%ebx
+	movl	20(%esi),%eax
+	adcl	%edx,%ecx
+	movl	4(%edi),%edx
+	adcl	$0,%ebp
+
+	mull	%edx
+	addl	%eax,%ebx
+	movl	16(%esi),%eax
+	adcl	%edx,%ecx
+	movl	8(%edi),%edx
+	adcl	$0,%ebp
+
+	mull	%edx
+	addl	%eax,%ebx
+	movl	12(%esi),%eax
+	adcl	%edx,%ecx
+	movl	12(%edi),%edx
+	adcl	$0,%ebp
+
+	mull	%edx
+	addl	%eax,%ebx
+	movl	8(%esi),%eax
+	adcl	%edx,%ecx
+	movl	16(%edi),%edx
+	adcl	$0,%ebp
+
+	mull	%edx
+	addl	%eax,%ebx
+	movl	4(%esi),%eax
+	adcl	%edx,%ecx
+	movl	20(%edi),%edx
+	adcl	$0,%ebp
+
+	mull	%edx
+	addl	%eax,%ebx
+	movl	(%esi),%eax
+	adcl	%edx,%ecx
+	movl	24(%edi),%edx
+	adcl	$0,%ebp
+
+	mull	%edx
+	addl	%eax,%ebx
+	movl	20(%esp),%eax
+	adcl	%edx,%ecx
+	movl	(%edi),%edx
+	adcl	$0,%ebp
+	movl	%ebx,24(%eax)
+	movl	28(%esi),%eax
+
+
+	xorl	%ebx,%ebx
+
+	mull	%edx
+	addl	%eax,%ecx
+	movl	24(%esi),%eax
+	adcl	%edx,%ebp
+	movl	4(%edi),%edx
+	adcl	$0,%ebx
+
+	mull	%edx
+	addl	%eax,%ecx
+	movl	20(%esi),%eax
+	adcl	%edx,%ebp
+	movl	8(%edi),%edx
+	adcl	$0,%ebx
+
+	mull	%edx
+	addl	%eax,%ecx
+	movl	16(%esi),%eax
+	adcl	%edx,%ebp
+	movl	12(%edi),%edx
+	adcl	$0,%ebx
+
+	mull	%edx
+	addl	%eax,%ecx
+	movl	12(%esi),%eax
+	adcl	%edx,%ebp
+	movl	16(%edi),%edx
+	adcl	$0,%ebx
+
+	mull	%edx
+	addl	%eax,%ecx
+	movl	8(%esi),%eax
+	adcl	%edx,%ebp
+	movl	20(%edi),%edx
+	adcl	$0,%ebx
+
+	mull	%edx
+	addl	%eax,%ecx
+	movl	4(%esi),%eax
+	adcl	%edx,%ebp
+	movl	24(%edi),%edx
+	adcl	$0,%ebx
+
+	mull	%edx
+	addl	%eax,%ecx
+	movl	(%esi),%eax
+	adcl	%edx,%ebp
+	movl	28(%edi),%edx
+	adcl	$0,%ebx
+
+	mull	%edx
+	addl	%eax,%ecx
+	movl	20(%esp),%eax
+	adcl	%edx,%ebp
+	movl	4(%edi),%edx
+	adcl	$0,%ebx
+	movl	%ecx,28(%eax)
+	movl	28(%esi),%eax
+
+
+	xorl	%ecx,%ecx
+
+	mull	%edx
+	addl	%eax,%ebp
+	movl	24(%esi),%eax
+	adcl	%edx,%ebx
+	movl	8(%edi),%edx
+	adcl	$0,%ecx
+
+	mull	%edx
+	addl	%eax,%ebp
+	movl	20(%esi),%eax
+	adcl	%edx,%ebx
+	movl	12(%edi),%edx
+	adcl	$0,%ecx
+
+	mull	%edx
+	addl	%eax,%ebp
+	movl	16(%esi),%eax
+	adcl	%edx,%ebx
+	movl	16(%edi),%edx
+	adcl	$0,%ecx
+
+	mull	%edx
+	addl	%eax,%ebp
+	movl	12(%esi),%eax
+	adcl	%edx,%ebx
+	movl	20(%edi),%edx
+	adcl	$0,%ecx
+
+	mull	%edx
+	addl	%eax,%ebp
+	movl	8(%esi),%eax
+	adcl	%edx,%ebx
+	movl	24(%edi),%edx
+	adcl	$0,%ecx
+
+	mull	%edx
+	addl	%eax,%ebp
+	movl	4(%esi),%eax
+	adcl	%edx,%ebx
+	movl	28(%edi),%edx
+	adcl	$0,%ecx
+
+	mull	%edx
+	addl	%eax,%ebp
+	movl	20(%esp),%eax
+	adcl	%edx,%ebx
+	movl	8(%edi),%edx
+	adcl	$0,%ecx
+	movl	%ebp,32(%eax)
+	movl	28(%esi),%eax
+
+
+	xorl	%ebp,%ebp
+
+	mull	%edx
+	addl	%eax,%ebx
+	movl	24(%esi),%eax
+	adcl	%edx,%ecx
+	movl	12(%edi),%edx
+	adcl	$0,%ebp
+
+	mull	%edx
+	addl	%eax,%ebx
+	movl	20(%esi),%eax
+	adcl	%edx,%ecx
+	movl	16(%edi),%edx
+	adcl	$0,%ebp
+
+	mull	%edx
+	addl	%eax,%ebx
+	movl	16(%esi),%eax
+	adcl	%edx,%ecx
+	movl	20(%edi),%edx
+	adcl	$0,%ebp
+
+	mull	%edx
+	addl	%eax,%ebx
+	movl	12(%esi),%eax
+	adcl	%edx,%ecx
+	movl	24(%edi),%edx
+	adcl	$0,%ebp
+
+	mull	%edx
+	addl	%eax,%ebx
+	movl	8(%esi),%eax
+	adcl	%edx,%ecx
+	movl	28(%edi),%edx
+	adcl	$0,%ebp
+
+	mull	%edx
+	addl	%eax,%ebx
+	movl	20(%esp),%eax
+	adcl	%edx,%ecx
+	movl	12(%edi),%edx
+	adcl	$0,%ebp
+	movl	%ebx,36(%eax)
+	movl	28(%esi),%eax
+
+
+	xorl	%ebx,%ebx
+
+	mull	%edx
+	addl	%eax,%ecx
+	movl	24(%esi),%eax
+	adcl	%edx,%ebp
+	movl	16(%edi),%edx
+	adcl	$0,%ebx
+
+	mull	%edx
+	addl	%eax,%ecx
+	movl	20(%esi),%eax
+	adcl	%edx,%ebp
+	movl	20(%edi),%edx
+	adcl	$0,%ebx
+
+	mull	%edx
+	addl	%eax,%ecx
+	movl	16(%esi),%eax
+	adcl	%edx,%ebp
+	movl	24(%edi),%edx
+	adcl	$0,%ebx
+
+	mull	%edx
+	addl	%eax,%ecx
+	movl	12(%esi),%eax
+	adcl	%edx,%ebp
+	movl	28(%edi),%edx
+	adcl	$0,%ebx
+
+	mull	%edx
+	addl	%eax,%ecx
+	movl	20(%esp),%eax
+	adcl	%edx,%ebp
+	movl	16(%edi),%edx
+	adcl	$0,%ebx
+	movl	%ecx,40(%eax)
+	movl	28(%esi),%eax
+
+
+	xorl	%ecx,%ecx
+
+	mull	%edx
+	addl	%eax,%ebp
+	movl	24(%esi),%eax
+	adcl	%edx,%ebx
+	movl	20(%edi),%edx
+	adcl	$0,%ecx
+
+	mull	%edx
+	addl	%eax,%ebp
+	movl	20(%esi),%eax
+	adcl	%edx,%ebx
+	movl	24(%edi),%edx
+	adcl	$0,%ecx
+
+	mull	%edx
+	addl	%eax,%ebp
+	movl	16(%esi),%eax
+	adcl	%edx,%ebx
+	movl	28(%edi),%edx
+	adcl	$0,%ecx
+
+	mull	%edx
+	addl	%eax,%ebp
+	movl	20(%esp),%eax
+	adcl	%edx,%ebx
+	movl	20(%edi),%edx
+	adcl	$0,%ecx
+	movl	%ebp,44(%eax)
+	movl	28(%esi),%eax
+
+
+	xorl	%ebp,%ebp
+
+	mull	%edx
+	addl	%eax,%ebx
+	movl	24(%esi),%eax
+	adcl	%edx,%ecx
+	movl	24(%edi),%edx
+	adcl	$0,%ebp
+
+	mull	%edx
+	addl	%eax,%ebx
+	movl	20(%esi),%eax
+	adcl	%edx,%ecx
+	movl	28(%edi),%edx
+	adcl	$0,%ebp
+
+	mull	%edx
+	addl	%eax,%ebx
+	movl	20(%esp),%eax
+	adcl	%edx,%ecx
+	movl	24(%edi),%edx
+	adcl	$0,%ebp
+	movl	%ebx,48(%eax)
+	movl	28(%esi),%eax
+
+
+	xorl	%ebx,%ebx
+
+	mull	%edx
+	addl	%eax,%ecx
+	movl	24(%esi),%eax
+	adcl	%edx,%ebp
+	movl	28(%edi),%edx
+	adcl	$0,%ebx
+
+	mull	%edx
+	addl	%eax,%ecx
+	movl	20(%esp),%eax
+	adcl	%edx,%ebp
+	movl	28(%edi),%edx
+	adcl	$0,%ebx
+	movl	%ecx,52(%eax)
+	movl	28(%esi),%eax
+
+
+	xorl	%ecx,%ecx
+
+	mull	%edx
+	addl	%eax,%ebp
+	movl	20(%esp),%eax
+	adcl	%edx,%ebx
+	adcl	$0,%ecx
+	movl	%ebp,56(%eax)
+
+
+	movl	%ebx,60(%eax)
+	popl	%ebx
+	popl	%ebp
+	popl	%edi
+	popl	%esi
+	ret
+.size	bn_mul_comba8,.-.L_bn_mul_comba8_begin
+.globl	bn_mul_comba4
+.hidden	bn_mul_comba4
+.type	bn_mul_comba4,@function
+.align	16
+bn_mul_comba4:
+.L_bn_mul_comba4_begin:
+	pushl	%esi
+	movl	12(%esp),%esi
+	pushl	%edi
+	movl	20(%esp),%edi
+	pushl	%ebp
+	pushl	%ebx
+	xorl	%ebx,%ebx
+	movl	(%esi),%eax
+	xorl	%ecx,%ecx
+	movl	(%edi),%edx
+
+	xorl	%ebp,%ebp
+
+	mull	%edx
+	addl	%eax,%ebx
+	movl	20(%esp),%eax
+	adcl	%edx,%ecx
+	movl	(%edi),%edx
+	adcl	$0,%ebp
+	movl	%ebx,(%eax)
+	movl	4(%esi),%eax
+
+
+	xorl	%ebx,%ebx
+
+	mull	%edx
+	addl	%eax,%ecx
+	movl	(%esi),%eax
+	adcl	%edx,%ebp
+	movl	4(%edi),%edx
+	adcl	$0,%ebx
+
+	mull	%edx
+	addl	%eax,%ecx
+	movl	20(%esp),%eax
+	adcl	%edx,%ebp
+	movl	(%edi),%edx
+	adcl	$0,%ebx
+	movl	%ecx,4(%eax)
+	movl	8(%esi),%eax
+
+
+	xorl	%ecx,%ecx
+
+	mull	%edx
+	addl	%eax,%ebp
+	movl	4(%esi),%eax
+	adcl	%edx,%ebx
+	movl	4(%edi),%edx
+	adcl	$0,%ecx
+
+	mull	%edx
+	addl	%eax,%ebp
+	movl	(%esi),%eax
+	adcl	%edx,%ebx
+	movl	8(%edi),%edx
+	adcl	$0,%ecx
+
+	mull	%edx
+	addl	%eax,%ebp
+	movl	20(%esp),%eax
+	adcl	%edx,%ebx
+	movl	(%edi),%edx
+	adcl	$0,%ecx
+	movl	%ebp,8(%eax)
+	movl	12(%esi),%eax
+
+
+	xorl	%ebp,%ebp
+
+	mull	%edx
+	addl	%eax,%ebx
+	movl	8(%esi),%eax
+	adcl	%edx,%ecx
+	movl	4(%edi),%edx
+	adcl	$0,%ebp
+
+	mull	%edx
+	addl	%eax,%ebx
+	movl	4(%esi),%eax
+	adcl	%edx,%ecx
+	movl	8(%edi),%edx
+	adcl	$0,%ebp
+
+	mull	%edx
+	addl	%eax,%ebx
+	movl	(%esi),%eax
+	adcl	%edx,%ecx
+	movl	12(%edi),%edx
+	adcl	$0,%ebp
+
+	mull	%edx
+	addl	%eax,%ebx
+	movl	20(%esp),%eax
+	adcl	%edx,%ecx
+	movl	4(%edi),%edx
+	adcl	$0,%ebp
+	movl	%ebx,12(%eax)
+	movl	12(%esi),%eax
+
+
+	xorl	%ebx,%ebx
+
+	mull	%edx
+	addl	%eax,%ecx
+	movl	8(%esi),%eax
+	adcl	%edx,%ebp
+	movl	8(%edi),%edx
+	adcl	$0,%ebx
+
+	mull	%edx
+	addl	%eax,%ecx
+	movl	4(%esi),%eax
+	adcl	%edx,%ebp
+	movl	12(%edi),%edx
+	adcl	$0,%ebx
+
+	mull	%edx
+	addl	%eax,%ecx
+	movl	20(%esp),%eax
+	adcl	%edx,%ebp
+	movl	8(%edi),%edx
+	adcl	$0,%ebx
+	movl	%ecx,16(%eax)
+	movl	12(%esi),%eax
+
+
+	xorl	%ecx,%ecx
+
+	mull	%edx
+	addl	%eax,%ebp
+	movl	8(%esi),%eax
+	adcl	%edx,%ebx
+	movl	12(%edi),%edx
+	adcl	$0,%ecx
+
+	mull	%edx
+	addl	%eax,%ebp
+	movl	20(%esp),%eax
+	adcl	%edx,%ebx
+	movl	12(%edi),%edx
+	adcl	$0,%ecx
+	movl	%ebp,20(%eax)
+	movl	12(%esi),%eax
+
+
+	xorl	%ebp,%ebp
+
+	mull	%edx
+	addl	%eax,%ebx
+	movl	20(%esp),%eax
+	adcl	%edx,%ecx
+	adcl	$0,%ebp
+	movl	%ebx,24(%eax)
+
+
+	movl	%ecx,28(%eax)
+	popl	%ebx
+	popl	%ebp
+	popl	%edi
+	popl	%esi
+	ret
+.size	bn_mul_comba4,.-.L_bn_mul_comba4_begin
+.globl	bn_sqr_comba8
+.hidden	bn_sqr_comba8
+.type	bn_sqr_comba8,@function
+.align	16
+bn_sqr_comba8:
+.L_bn_sqr_comba8_begin:
+	pushl	%esi
+	pushl	%edi
+	pushl	%ebp
+	pushl	%ebx
+	movl	20(%esp),%edi
+	movl	24(%esp),%esi
+	xorl	%ebx,%ebx
+	xorl	%ecx,%ecx
+	movl	(%esi),%eax
+
+	xorl	%ebp,%ebp
+
+	mull	%eax
+	addl	%eax,%ebx
+	adcl	%edx,%ecx
+	movl	(%esi),%edx
+	adcl	$0,%ebp
+	movl	%ebx,(%edi)
+	movl	4(%esi),%eax
+
+
+	xorl	%ebx,%ebx
+
+	mull	%edx
+	addl	%eax,%eax
+	adcl	%edx,%edx
+	adcl	$0,%ebx
+	addl	%eax,%ecx
+	adcl	%edx,%ebp
+	movl	8(%esi),%eax
+	adcl	$0,%ebx
+	movl	%ecx,4(%edi)
+	movl	(%esi),%edx
+
+
+	xorl	%ecx,%ecx
+
+	mull	%edx
+	addl	%eax,%eax
+	adcl	%edx,%edx
+	adcl	$0,%ecx
+	addl	%eax,%ebp
+	adcl	%edx,%ebx
+	movl	4(%esi),%eax
+	adcl	$0,%ecx
+
+	mull	%eax
+	addl	%eax,%ebp
+	adcl	%edx,%ebx
+	movl	(%esi),%edx
+	adcl	$0,%ecx
+	movl	%ebp,8(%edi)
+	movl	12(%esi),%eax
+
+
+	xorl	%ebp,%ebp
+
+	mull	%edx
+	addl	%eax,%eax
+	adcl	%edx,%edx
+	adcl	$0,%ebp
+	addl	%eax,%ebx
+	adcl	%edx,%ecx
+	movl	8(%esi),%eax
+	adcl	$0,%ebp
+	movl	4(%esi),%edx
+
+	mull	%edx
+	addl	%eax,%eax
+	adcl	%edx,%edx
+	adcl	$0,%ebp
+	addl	%eax,%ebx
+	adcl	%edx,%ecx
+	movl	16(%esi),%eax
+	adcl	$0,%ebp
+	movl	%ebx,12(%edi)
+	movl	(%esi),%edx
+
+
+	xorl	%ebx,%ebx
+
+	mull	%edx
+	addl	%eax,%eax
+	adcl	%edx,%edx
+	adcl	$0,%ebx
+	addl	%eax,%ecx
+	adcl	%edx,%ebp
+	movl	12(%esi),%eax
+	adcl	$0,%ebx
+	movl	4(%esi),%edx
+
+	mull	%edx
+	addl	%eax,%eax
+	adcl	%edx,%edx
+	adcl	$0,%ebx
+	addl	%eax,%ecx
+	adcl	%edx,%ebp
+	movl	8(%esi),%eax
+	adcl	$0,%ebx
+
+	mull	%eax
+	addl	%eax,%ecx
+	adcl	%edx,%ebp
+	movl	(%esi),%edx
+	adcl	$0,%ebx
+	movl	%ecx,16(%edi)
+	movl	20(%esi),%eax
+
+
+	xorl	%ecx,%ecx
+
+	mull	%edx
+	addl	%eax,%eax
+	adcl	%edx,%edx
+	adcl	$0,%ecx
+	addl	%eax,%ebp
+	adcl	%edx,%ebx
+	movl	16(%esi),%eax
+	adcl	$0,%ecx
+	movl	4(%esi),%edx
+
+	mull	%edx
+	addl	%eax,%eax
+	adcl	%edx,%edx
+	adcl	$0,%ecx
+	addl	%eax,%ebp
+	adcl	%edx,%ebx
+	movl	12(%esi),%eax
+	adcl	$0,%ecx
+	movl	8(%esi),%edx
+
+	mull	%edx
+	addl	%eax,%eax
+	adcl	%edx,%edx
+	adcl	$0,%ecx
+	addl	%eax,%ebp
+	adcl	%edx,%ebx
+	movl	24(%esi),%eax
+	adcl	$0,%ecx
+	movl	%ebp,20(%edi)
+	movl	(%esi),%edx
+
+
+	xorl	%ebp,%ebp
+
+	mull	%edx
+	addl	%eax,%eax
+	adcl	%edx,%edx
+	adcl	$0,%ebp
+	addl	%eax,%ebx
+	adcl	%edx,%ecx
+	movl	20(%esi),%eax
+	adcl	$0,%ebp
+	movl	4(%esi),%edx
+
+	mull	%edx
+	addl	%eax,%eax
+	adcl	%edx,%edx
+	adcl	$0,%ebp
+	addl	%eax,%ebx
+	adcl	%edx,%ecx
+	movl	16(%esi),%eax
+	adcl	$0,%ebp
+	movl	8(%esi),%edx
+
+	mull	%edx
+	addl	%eax,%eax
+	adcl	%edx,%edx
+	adcl	$0,%ebp
+	addl	%eax,%ebx
+	adcl	%edx,%ecx
+	movl	12(%esi),%eax
+	adcl	$0,%ebp
+
+	mull	%eax
+	addl	%eax,%ebx
+	adcl	%edx,%ecx
+	movl	(%esi),%edx
+	adcl	$0,%ebp
+	movl	%ebx,24(%edi)
+	movl	28(%esi),%eax
+
+
+	xorl	%ebx,%ebx
+
+	mull	%edx
+	addl	%eax,%eax
+	adcl	%edx,%edx
+	adcl	$0,%ebx
+	addl	%eax,%ecx
+	adcl	%edx,%ebp
+	movl	24(%esi),%eax
+	adcl	$0,%ebx
+	movl	4(%esi),%edx
+
+	mull	%edx
+	addl	%eax,%eax
+	adcl	%edx,%edx
+	adcl	$0,%ebx
+	addl	%eax,%ecx
+	adcl	%edx,%ebp
+	movl	20(%esi),%eax
+	adcl	$0,%ebx
+	movl	8(%esi),%edx
+
+	mull	%edx
+	addl	%eax,%eax
+	adcl	%edx,%edx
+	adcl	$0,%ebx
+	addl	%eax,%ecx
+	adcl	%edx,%ebp
+	movl	16(%esi),%eax
+	adcl	$0,%ebx
+	movl	12(%esi),%edx
+
+	mull	%edx
+	addl	%eax,%eax
+	adcl	%edx,%edx
+	adcl	$0,%ebx
+	addl	%eax,%ecx
+	adcl	%edx,%ebp
+	movl	28(%esi),%eax
+	adcl	$0,%ebx
+	movl	%ecx,28(%edi)
+	movl	4(%esi),%edx
+
+
+	xorl	%ecx,%ecx
+
+	mull	%edx
+	addl	%eax,%eax
+	adcl	%edx,%edx
+	adcl	$0,%ecx
+	addl	%eax,%ebp
+	adcl	%edx,%ebx
+	movl	24(%esi),%eax
+	adcl	$0,%ecx
+	movl	8(%esi),%edx
+
+	mull	%edx
+	addl	%eax,%eax
+	adcl	%edx,%edx
+	adcl	$0,%ecx
+	addl	%eax,%ebp
+	adcl	%edx,%ebx
+	movl	20(%esi),%eax
+	adcl	$0,%ecx
+	movl	12(%esi),%edx
+
+	mull	%edx
+	addl	%eax,%eax
+	adcl	%edx,%edx
+	adcl	$0,%ecx
+	addl	%eax,%ebp
+	adcl	%edx,%ebx
+	movl	16(%esi),%eax
+	adcl	$0,%ecx
+
+	mull	%eax
+	addl	%eax,%ebp
+	adcl	%edx,%ebx
+	movl	8(%esi),%edx
+	adcl	$0,%ecx
+	movl	%ebp,32(%edi)
+	movl	28(%esi),%eax
+
+
+	xorl	%ebp,%ebp
+
+	mull	%edx
+	addl	%eax,%eax
+	adcl	%edx,%edx
+	adcl	$0,%ebp
+	addl	%eax,%ebx
+	adcl	%edx,%ecx
+	movl	24(%esi),%eax
+	adcl	$0,%ebp
+	movl	12(%esi),%edx
+
+	mull	%edx
+	addl	%eax,%eax
+	adcl	%edx,%edx
+	adcl	$0,%ebp
+	addl	%eax,%ebx
+	adcl	%edx,%ecx
+	movl	20(%esi),%eax
+	adcl	$0,%ebp
+	movl	16(%esi),%edx
+
+	mull	%edx
+	addl	%eax,%eax
+	adcl	%edx,%edx
+	adcl	$0,%ebp
+	addl	%eax,%ebx
+	adcl	%edx,%ecx
+	movl	28(%esi),%eax
+	adcl	$0,%ebp
+	movl	%ebx,36(%edi)
+	movl	12(%esi),%edx
+
+
+	xorl	%ebx,%ebx
+
+	mull	%edx
+	addl	%eax,%eax
+	adcl	%edx,%edx
+	adcl	$0,%ebx
+	addl	%eax,%ecx
+	adcl	%edx,%ebp
+	movl	24(%esi),%eax
+	adcl	$0,%ebx
+	movl	16(%esi),%edx
+
+	mull	%edx
+	addl	%eax,%eax
+	adcl	%edx,%edx
+	adcl	$0,%ebx
+	addl	%eax,%ecx
+	adcl	%edx,%ebp
+	movl	20(%esi),%eax
+	adcl	$0,%ebx
+
+	mull	%eax
+	addl	%eax,%ecx
+	adcl	%edx,%ebp
+	movl	16(%esi),%edx
+	adcl	$0,%ebx
+	movl	%ecx,40(%edi)
+	movl	28(%esi),%eax
+
+
+	xorl	%ecx,%ecx
+
+	mull	%edx
+	addl	%eax,%eax
+	adcl	%edx,%edx
+	adcl	$0,%ecx
+	addl	%eax,%ebp
+	adcl	%edx,%ebx
+	movl	24(%esi),%eax
+	adcl	$0,%ecx
+	movl	20(%esi),%edx
+
+	mull	%edx
+	addl	%eax,%eax
+	adcl	%edx,%edx
+	adcl	$0,%ecx
+	addl	%eax,%ebp
+	adcl	%edx,%ebx
+	movl	28(%esi),%eax
+	adcl	$0,%ecx
+	movl	%ebp,44(%edi)
+	movl	20(%esi),%edx
+
+
+	xorl	%ebp,%ebp
+
+	mull	%edx
+	addl	%eax,%eax
+	adcl	%edx,%edx
+	adcl	$0,%ebp
+	addl	%eax,%ebx
+	adcl	%edx,%ecx
+	movl	24(%esi),%eax
+	adcl	$0,%ebp
+
+	mull	%eax
+	addl	%eax,%ebx
+	adcl	%edx,%ecx
+	movl	24(%esi),%edx
+	adcl	$0,%ebp
+	movl	%ebx,48(%edi)
+	movl	28(%esi),%eax
+
+
+	xorl	%ebx,%ebx
+
+	mull	%edx
+	addl	%eax,%eax
+	adcl	%edx,%edx
+	adcl	$0,%ebx
+	addl	%eax,%ecx
+	adcl	%edx,%ebp
+	movl	28(%esi),%eax
+	adcl	$0,%ebx
+	movl	%ecx,52(%edi)
+
+
+	xorl	%ecx,%ecx
+
+	mull	%eax
+	addl	%eax,%ebp
+	adcl	%edx,%ebx
+	adcl	$0,%ecx
+	movl	%ebp,56(%edi)
+
+	movl	%ebx,60(%edi)
+	popl	%ebx
+	popl	%ebp
+	popl	%edi
+	popl	%esi
+	ret
+.size	bn_sqr_comba8,.-.L_bn_sqr_comba8_begin
+.globl	bn_sqr_comba4
+.hidden	bn_sqr_comba4
+.type	bn_sqr_comba4,@function
+.align	16
+bn_sqr_comba4:
+.L_bn_sqr_comba4_begin:
+	pushl	%esi
+	pushl	%edi
+	pushl	%ebp
+	pushl	%ebx
+	movl	20(%esp),%edi
+	movl	24(%esp),%esi
+	xorl	%ebx,%ebx
+	xorl	%ecx,%ecx
+	movl	(%esi),%eax
+
+	xorl	%ebp,%ebp
+
+	mull	%eax
+	addl	%eax,%ebx
+	adcl	%edx,%ecx
+	movl	(%esi),%edx
+	adcl	$0,%ebp
+	movl	%ebx,(%edi)
+	movl	4(%esi),%eax
+
+
+	xorl	%ebx,%ebx
+
+	mull	%edx
+	addl	%eax,%eax
+	adcl	%edx,%edx
+	adcl	$0,%ebx
+	addl	%eax,%ecx
+	adcl	%edx,%ebp
+	movl	8(%esi),%eax
+	adcl	$0,%ebx
+	movl	%ecx,4(%edi)
+	movl	(%esi),%edx
+
+
+	xorl	%ecx,%ecx
+
+	mull	%edx
+	addl	%eax,%eax
+	adcl	%edx,%edx
+	adcl	$0,%ecx
+	addl	%eax,%ebp
+	adcl	%edx,%ebx
+	movl	4(%esi),%eax
+	adcl	$0,%ecx
+
+	mull	%eax
+	addl	%eax,%ebp
+	adcl	%edx,%ebx
+	movl	(%esi),%edx
+	adcl	$0,%ecx
+	movl	%ebp,8(%edi)
+	movl	12(%esi),%eax
+
+
+	xorl	%ebp,%ebp
+
+	mull	%edx
+	addl	%eax,%eax
+	adcl	%edx,%edx
+	adcl	$0,%ebp
+	addl	%eax,%ebx
+	adcl	%edx,%ecx
+	movl	8(%esi),%eax
+	adcl	$0,%ebp
+	movl	4(%esi),%edx
+
+	mull	%edx
+	addl	%eax,%eax
+	adcl	%edx,%edx
+	adcl	$0,%ebp
+	addl	%eax,%ebx
+	adcl	%edx,%ecx
+	movl	12(%esi),%eax
+	adcl	$0,%ebp
+	movl	%ebx,12(%edi)
+	movl	4(%esi),%edx
+
+
+	xorl	%ebx,%ebx
+
+	mull	%edx
+	addl	%eax,%eax
+	adcl	%edx,%edx
+	adcl	$0,%ebx
+	addl	%eax,%ecx
+	adcl	%edx,%ebp
+	movl	8(%esi),%eax
+	adcl	$0,%ebx
+
+	mull	%eax
+	addl	%eax,%ecx
+	adcl	%edx,%ebp
+	movl	8(%esi),%edx
+	adcl	$0,%ebx
+	movl	%ecx,16(%edi)
+	movl	12(%esi),%eax
+
+
+	xorl	%ecx,%ecx
+
+	mull	%edx
+	addl	%eax,%eax
+	adcl	%edx,%edx
+	adcl	$0,%ecx
+	addl	%eax,%ebp
+	adcl	%edx,%ebx
+	movl	12(%esi),%eax
+	adcl	$0,%ecx
+	movl	%ebp,20(%edi)
+
+
+	xorl	%ebp,%ebp
+
+	mull	%eax
+	addl	%eax,%ebx
+	adcl	%edx,%ecx
+	adcl	$0,%ebp
+	movl	%ebx,24(%edi)
+
+	movl	%ecx,28(%edi)
+	popl	%ebx
+	popl	%ebp
+	popl	%edi
+	popl	%esi
+	ret
+.size	bn_sqr_comba4,.-.L_bn_sqr_comba4_begin
+#endif
diff --git a/third_party/boringssl/linux-x86/crypto/bn/x86-mont.S b/third_party/boringssl/linux-x86/crypto/bn/x86-mont.S
new file mode 100644
index 0000000..1569b2c
--- /dev/null
+++ b/third_party/boringssl/linux-x86/crypto/bn/x86-mont.S
@@ -0,0 +1,460 @@
+#if defined(__i386__)
+.file	"src/crypto/bn/asm/x86-mont.S"
+.text
+.globl	bn_mul_mont
+.hidden	bn_mul_mont
+.type	bn_mul_mont,@function
+.align	16
+bn_mul_mont:
+.L_bn_mul_mont_begin:
+	pushl	%ebp
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+	xorl	%eax,%eax
+	movl	40(%esp),%edi
+	cmpl	$4,%edi
+	jl	.L000just_leave
+	leal	20(%esp),%esi
+	leal	24(%esp),%edx
+	movl	%esp,%ebp
+	addl	$2,%edi
+	negl	%edi
+	leal	-32(%esp,%edi,4),%esp
+	negl	%edi
+	movl	%esp,%eax
+	subl	%edx,%eax
+	andl	$2047,%eax
+	subl	%eax,%esp
+	xorl	%esp,%edx
+	andl	$2048,%edx
+	xorl	$2048,%edx
+	subl	%edx,%esp
+	andl	$-64,%esp
+	movl	(%esi),%eax
+	movl	4(%esi),%ebx
+	movl	8(%esi),%ecx
+	movl	12(%esi),%edx
+	movl	16(%esi),%esi
+	movl	(%esi),%esi
+	movl	%eax,4(%esp)
+	movl	%ebx,8(%esp)
+	movl	%ecx,12(%esp)
+	movl	%edx,16(%esp)
+	movl	%esi,20(%esp)
+	leal	-3(%edi),%ebx
+	movl	%ebp,24(%esp)
+	call	.L001PIC_me_up
+.L001PIC_me_up:
+	popl	%eax
+	leal	OPENSSL_ia32cap_P-.L001PIC_me_up(%eax),%eax
+	btl	$26,(%eax)
+	jnc	.L002non_sse2
+	movl	$-1,%eax
+	movd	%eax,%mm7
+	movl	8(%esp),%esi
+	movl	12(%esp),%edi
+	movl	16(%esp),%ebp
+	xorl	%edx,%edx
+	xorl	%ecx,%ecx
+	movd	(%edi),%mm4
+	movd	(%esi),%mm5
+	movd	(%ebp),%mm3
+	pmuludq	%mm4,%mm5
+	movq	%mm5,%mm2
+	movq	%mm5,%mm0
+	pand	%mm7,%mm0
+	pmuludq	20(%esp),%mm5
+	pmuludq	%mm5,%mm3
+	paddq	%mm0,%mm3
+	movd	4(%ebp),%mm1
+	movd	4(%esi),%mm0
+	psrlq	$32,%mm2
+	psrlq	$32,%mm3
+	incl	%ecx
+.align	16
+.L0031st:
+	pmuludq	%mm4,%mm0
+	pmuludq	%mm5,%mm1
+	paddq	%mm0,%mm2
+	paddq	%mm1,%mm3
+	movq	%mm2,%mm0
+	pand	%mm7,%mm0
+	movd	4(%ebp,%ecx,4),%mm1
+	paddq	%mm0,%mm3
+	movd	4(%esi,%ecx,4),%mm0
+	psrlq	$32,%mm2
+	movd	%mm3,28(%esp,%ecx,4)
+	psrlq	$32,%mm3
+	leal	1(%ecx),%ecx
+	cmpl	%ebx,%ecx
+	jl	.L0031st
+	pmuludq	%mm4,%mm0
+	pmuludq	%mm5,%mm1
+	paddq	%mm0,%mm2
+	paddq	%mm1,%mm3
+	movq	%mm2,%mm0
+	pand	%mm7,%mm0
+	paddq	%mm0,%mm3
+	movd	%mm3,28(%esp,%ecx,4)
+	psrlq	$32,%mm2
+	psrlq	$32,%mm3
+	paddq	%mm2,%mm3
+	movq	%mm3,32(%esp,%ebx,4)
+	incl	%edx
+.L004outer:
+	xorl	%ecx,%ecx
+	movd	(%edi,%edx,4),%mm4
+	movd	(%esi),%mm5
+	movd	32(%esp),%mm6
+	movd	(%ebp),%mm3
+	pmuludq	%mm4,%mm5
+	paddq	%mm6,%mm5
+	movq	%mm5,%mm0
+	movq	%mm5,%mm2
+	pand	%mm7,%mm0
+	pmuludq	20(%esp),%mm5
+	pmuludq	%mm5,%mm3
+	paddq	%mm0,%mm3
+	movd	36(%esp),%mm6
+	movd	4(%ebp),%mm1
+	movd	4(%esi),%mm0
+	psrlq	$32,%mm2
+	psrlq	$32,%mm3
+	paddq	%mm6,%mm2
+	incl	%ecx
+	decl	%ebx
+.L005inner:
+	pmuludq	%mm4,%mm0
+	pmuludq	%mm5,%mm1
+	paddq	%mm0,%mm2
+	paddq	%mm1,%mm3
+	movq	%mm2,%mm0
+	movd	36(%esp,%ecx,4),%mm6
+	pand	%mm7,%mm0
+	movd	4(%ebp,%ecx,4),%mm1
+	paddq	%mm0,%mm3
+	movd	4(%esi,%ecx,4),%mm0
+	psrlq	$32,%mm2
+	movd	%mm3,28(%esp,%ecx,4)
+	psrlq	$32,%mm3
+	paddq	%mm6,%mm2
+	decl	%ebx
+	leal	1(%ecx),%ecx
+	jnz	.L005inner
+	movl	%ecx,%ebx
+	pmuludq	%mm4,%mm0
+	pmuludq	%mm5,%mm1
+	paddq	%mm0,%mm2
+	paddq	%mm1,%mm3
+	movq	%mm2,%mm0
+	pand	%mm7,%mm0
+	paddq	%mm0,%mm3
+	movd	%mm3,28(%esp,%ecx,4)
+	psrlq	$32,%mm2
+	psrlq	$32,%mm3
+	movd	36(%esp,%ebx,4),%mm6
+	paddq	%mm2,%mm3
+	paddq	%mm6,%mm3
+	movq	%mm3,32(%esp,%ebx,4)
+	leal	1(%edx),%edx
+	cmpl	%ebx,%edx
+	jle	.L004outer
+	emms
+	jmp	.L006common_tail
+.align	16
+.L002non_sse2:
+	movl	8(%esp),%esi
+	leal	1(%ebx),%ebp
+	movl	12(%esp),%edi
+	xorl	%ecx,%ecx
+	movl	%esi,%edx
+	andl	$1,%ebp
+	subl	%edi,%edx
+	leal	4(%edi,%ebx,4),%eax
+	orl	%edx,%ebp
+	movl	(%edi),%edi
+	jz	.L007bn_sqr_mont
+	movl	%eax,28(%esp)
+	movl	(%esi),%eax
+	xorl	%edx,%edx
+.align	16
+.L008mull:
+	movl	%edx,%ebp
+	mull	%edi
+	addl	%eax,%ebp
+	leal	1(%ecx),%ecx
+	adcl	$0,%edx
+	movl	(%esi,%ecx,4),%eax
+	cmpl	%ebx,%ecx
+	movl	%ebp,28(%esp,%ecx,4)
+	jl	.L008mull
+	movl	%edx,%ebp
+	mull	%edi
+	movl	20(%esp),%edi
+	addl	%ebp,%eax
+	movl	16(%esp),%esi
+	adcl	$0,%edx
+	imull	32(%esp),%edi
+	movl	%eax,32(%esp,%ebx,4)
+	xorl	%ecx,%ecx
+	movl	%edx,36(%esp,%ebx,4)
+	movl	%ecx,40(%esp,%ebx,4)
+	movl	(%esi),%eax
+	mull	%edi
+	addl	32(%esp),%eax
+	movl	4(%esi),%eax
+	adcl	$0,%edx
+	incl	%ecx
+	jmp	.L0092ndmadd
+.align	16
+.L0101stmadd:
+	movl	%edx,%ebp
+	mull	%edi
+	addl	32(%esp,%ecx,4),%ebp
+	leal	1(%ecx),%ecx
+	adcl	$0,%edx
+	addl	%eax,%ebp
+	movl	(%esi,%ecx,4),%eax
+	adcl	$0,%edx
+	cmpl	%ebx,%ecx
+	movl	%ebp,28(%esp,%ecx,4)
+	jl	.L0101stmadd
+	movl	%edx,%ebp
+	mull	%edi
+	addl	32(%esp,%ebx,4),%eax
+	movl	20(%esp),%edi
+	adcl	$0,%edx
+	movl	16(%esp),%esi
+	addl	%eax,%ebp
+	adcl	$0,%edx
+	imull	32(%esp),%edi
+	xorl	%ecx,%ecx
+	addl	36(%esp,%ebx,4),%edx
+	movl	%ebp,32(%esp,%ebx,4)
+	adcl	$0,%ecx
+	movl	(%esi),%eax
+	movl	%edx,36(%esp,%ebx,4)
+	movl	%ecx,40(%esp,%ebx,4)
+	mull	%edi
+	addl	32(%esp),%eax
+	movl	4(%esi),%eax
+	adcl	$0,%edx
+	movl	$1,%ecx
+.align	16
+.L0092ndmadd:
+	movl	%edx,%ebp
+	mull	%edi
+	addl	32(%esp,%ecx,4),%ebp
+	leal	1(%ecx),%ecx
+	adcl	$0,%edx
+	addl	%eax,%ebp
+	movl	(%esi,%ecx,4),%eax
+	adcl	$0,%edx
+	cmpl	%ebx,%ecx
+	movl	%ebp,24(%esp,%ecx,4)
+	jl	.L0092ndmadd
+	movl	%edx,%ebp
+	mull	%edi
+	addl	32(%esp,%ebx,4),%ebp
+	adcl	$0,%edx
+	addl	%eax,%ebp
+	adcl	$0,%edx
+	movl	%ebp,28(%esp,%ebx,4)
+	xorl	%eax,%eax
+	movl	12(%esp),%ecx
+	addl	36(%esp,%ebx,4),%edx
+	adcl	40(%esp,%ebx,4),%eax
+	leal	4(%ecx),%ecx
+	movl	%edx,32(%esp,%ebx,4)
+	cmpl	28(%esp),%ecx
+	movl	%eax,36(%esp,%ebx,4)
+	je	.L006common_tail
+	movl	(%ecx),%edi
+	movl	8(%esp),%esi
+	movl	%ecx,12(%esp)
+	xorl	%ecx,%ecx
+	xorl	%edx,%edx
+	movl	(%esi),%eax
+	jmp	.L0101stmadd
+.align	16
+.L007bn_sqr_mont:
+	movl	%ebx,(%esp)
+	movl	%ecx,12(%esp)
+	movl	%edi,%eax
+	mull	%edi
+	movl	%eax,32(%esp)
+	movl	%edx,%ebx
+	shrl	$1,%edx
+	andl	$1,%ebx
+	incl	%ecx
+.align	16
+.L011sqr:
+	movl	(%esi,%ecx,4),%eax
+	movl	%edx,%ebp
+	mull	%edi
+	addl	%ebp,%eax
+	leal	1(%ecx),%ecx
+	adcl	$0,%edx
+	leal	(%ebx,%eax,2),%ebp
+	shrl	$31,%eax
+	cmpl	(%esp),%ecx
+	movl	%eax,%ebx
+	movl	%ebp,28(%esp,%ecx,4)
+	jl	.L011sqr
+	movl	(%esi,%ecx,4),%eax
+	movl	%edx,%ebp
+	mull	%edi
+	addl	%ebp,%eax
+	movl	20(%esp),%edi
+	adcl	$0,%edx
+	movl	16(%esp),%esi
+	leal	(%ebx,%eax,2),%ebp
+	imull	32(%esp),%edi
+	shrl	$31,%eax
+	movl	%ebp,32(%esp,%ecx,4)
+	leal	(%eax,%edx,2),%ebp
+	movl	(%esi),%eax
+	shrl	$31,%edx
+	movl	%ebp,36(%esp,%ecx,4)
+	movl	%edx,40(%esp,%ecx,4)
+	mull	%edi
+	addl	32(%esp),%eax
+	movl	%ecx,%ebx
+	adcl	$0,%edx
+	movl	4(%esi),%eax
+	movl	$1,%ecx
+.align	16
+.L0123rdmadd:
+	movl	%edx,%ebp
+	mull	%edi
+	addl	32(%esp,%ecx,4),%ebp
+	adcl	$0,%edx
+	addl	%eax,%ebp
+	movl	4(%esi,%ecx,4),%eax
+	adcl	$0,%edx
+	movl	%ebp,28(%esp,%ecx,4)
+	movl	%edx,%ebp
+	mull	%edi
+	addl	36(%esp,%ecx,4),%ebp
+	leal	2(%ecx),%ecx
+	adcl	$0,%edx
+	addl	%eax,%ebp
+	movl	(%esi,%ecx,4),%eax
+	adcl	$0,%edx
+	cmpl	%ebx,%ecx
+	movl	%ebp,24(%esp,%ecx,4)
+	jl	.L0123rdmadd
+	movl	%edx,%ebp
+	mull	%edi
+	addl	32(%esp,%ebx,4),%ebp
+	adcl	$0,%edx
+	addl	%eax,%ebp
+	adcl	$0,%edx
+	movl	%ebp,28(%esp,%ebx,4)
+	movl	12(%esp),%ecx
+	xorl	%eax,%eax
+	movl	8(%esp),%esi
+	addl	36(%esp,%ebx,4),%edx
+	adcl	40(%esp,%ebx,4),%eax
+	movl	%edx,32(%esp,%ebx,4)
+	cmpl	%ebx,%ecx
+	movl	%eax,36(%esp,%ebx,4)
+	je	.L006common_tail
+	movl	4(%esi,%ecx,4),%edi
+	leal	1(%ecx),%ecx
+	movl	%edi,%eax
+	movl	%ecx,12(%esp)
+	mull	%edi
+	addl	32(%esp,%ecx,4),%eax
+	adcl	$0,%edx
+	movl	%eax,32(%esp,%ecx,4)
+	xorl	%ebp,%ebp
+	cmpl	%ebx,%ecx
+	leal	1(%ecx),%ecx
+	je	.L013sqrlast
+	movl	%edx,%ebx
+	shrl	$1,%edx
+	andl	$1,%ebx
+.align	16
+.L014sqradd:
+	movl	(%esi,%ecx,4),%eax
+	movl	%edx,%ebp
+	mull	%edi
+	addl	%ebp,%eax
+	leal	(%eax,%eax,1),%ebp
+	adcl	$0,%edx
+	shrl	$31,%eax
+	addl	32(%esp,%ecx,4),%ebp
+	leal	1(%ecx),%ecx
+	adcl	$0,%eax
+	addl	%ebx,%ebp
+	adcl	$0,%eax
+	cmpl	(%esp),%ecx
+	movl	%ebp,28(%esp,%ecx,4)
+	movl	%eax,%ebx
+	jle	.L014sqradd
+	movl	%edx,%ebp
+	addl	%edx,%edx
+	shrl	$31,%ebp
+	addl	%ebx,%edx
+	adcl	$0,%ebp
+.L013sqrlast:
+	movl	20(%esp),%edi
+	movl	16(%esp),%esi
+	imull	32(%esp),%edi
+	addl	32(%esp,%ecx,4),%edx
+	movl	(%esi),%eax
+	adcl	$0,%ebp
+	movl	%edx,32(%esp,%ecx,4)
+	movl	%ebp,36(%esp,%ecx,4)
+	mull	%edi
+	addl	32(%esp),%eax
+	leal	-1(%ecx),%ebx
+	adcl	$0,%edx
+	movl	$1,%ecx
+	movl	4(%esi),%eax
+	jmp	.L0123rdmadd
+.align	16
+.L006common_tail:
+	movl	16(%esp),%ebp
+	movl	4(%esp),%edi
+	leal	32(%esp),%esi
+	movl	(%esi),%eax
+	movl	%ebx,%ecx
+	xorl	%edx,%edx
+.align	16
+.L015sub:
+	sbbl	(%ebp,%edx,4),%eax
+	movl	%eax,(%edi,%edx,4)
+	decl	%ecx
+	movl	4(%esi,%edx,4),%eax
+	leal	1(%edx),%edx
+	jge	.L015sub
+	sbbl	$0,%eax
+.align	16
+.L016copy:
+	movl	(%esi,%ebx,4),%edx
+	movl	(%edi,%ebx,4),%ebp
+	xorl	%ebp,%edx
+	andl	%eax,%edx
+	xorl	%ebp,%edx
+	movl	%ecx,(%esi,%ebx,4)
+	movl	%edx,(%edi,%ebx,4)
+	decl	%ebx
+	jge	.L016copy
+	movl	24(%esp),%esp
+	movl	$1,%eax
+.L000just_leave:
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.size	bn_mul_mont,.-.L_bn_mul_mont_begin
+.byte	77,111,110,116,103,111,109,101,114,121,32,77,117,108,116,105
+.byte	112,108,105,99,97,116,105,111,110,32,102,111,114,32,120,56
+.byte	54,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121
+.byte	32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46
+.byte	111,114,103,62,0
+#endif
diff --git a/third_party/boringssl/linux-x86/crypto/cpu-x86-asm.S b/third_party/boringssl/linux-x86/crypto/cpu-x86-asm.S
new file mode 100644
index 0000000..24a8dd4
--- /dev/null
+++ b/third_party/boringssl/linux-x86/crypto/cpu-x86-asm.S
@@ -0,0 +1,322 @@
+#if defined(__i386__)
+.file	"crypto/cpu-x86-asm.S"
+.text
+.globl	OPENSSL_ia32_cpuid
+.hidden	OPENSSL_ia32_cpuid
+.type	OPENSSL_ia32_cpuid,@function
+.align	16
+OPENSSL_ia32_cpuid:
+.L_OPENSSL_ia32_cpuid_begin:
+	pushl	%ebp
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+	xorl	%edx,%edx
+	pushfl
+	popl	%eax
+	movl	%eax,%ecx
+	xorl	$2097152,%eax
+	pushl	%eax
+	popfl
+	pushfl
+	popl	%eax
+	xorl	%eax,%ecx
+	xorl	%eax,%eax
+	btl	$21,%ecx
+	jnc	.L000nocpuid
+	movl	20(%esp),%esi
+	movl	%eax,8(%esi)
+	.byte	0x0f,0xa2
+	movl	%eax,%edi
+	xorl	%eax,%eax
+	cmpl	$1970169159,%ebx
+	setne	%al
+	movl	%eax,%ebp
+	cmpl	$1231384169,%edx
+	setne	%al
+	orl	%eax,%ebp
+	cmpl	$1818588270,%ecx
+	setne	%al
+	orl	%eax,%ebp
+	jz	.L001intel
+	cmpl	$1752462657,%ebx
+	setne	%al
+	movl	%eax,%esi
+	cmpl	$1769238117,%edx
+	setne	%al
+	orl	%eax,%esi
+	cmpl	$1145913699,%ecx
+	setne	%al
+	orl	%eax,%esi
+	jnz	.L001intel
+	movl	$2147483648,%eax
+	.byte	0x0f,0xa2
+	cmpl	$2147483649,%eax
+	jb	.L001intel
+	movl	%eax,%esi
+	movl	$2147483649,%eax
+	.byte	0x0f,0xa2
+	orl	%ecx,%ebp
+	andl	$2049,%ebp
+	cmpl	$2147483656,%esi
+	jb	.L001intel
+	movl	$2147483656,%eax
+	.byte	0x0f,0xa2
+	movzbl	%cl,%esi
+	incl	%esi
+	movl	$1,%eax
+	xorl	%ecx,%ecx
+	.byte	0x0f,0xa2
+	btl	$28,%edx
+	jnc	.L002generic
+	shrl	$16,%ebx
+	andl	$255,%ebx
+	cmpl	%esi,%ebx
+	ja	.L002generic
+	andl	$4026531839,%edx
+	jmp	.L002generic
+.L001intel:
+	cmpl	$7,%edi
+	jb	.L003cacheinfo
+	movl	20(%esp),%esi
+	movl	$7,%eax
+	xorl	%ecx,%ecx
+	.byte	0x0f,0xa2
+	movl	%ebx,8(%esi)
+.L003cacheinfo:
+	cmpl	$4,%edi
+	movl	$-1,%edi
+	jb	.L004nocacheinfo
+	movl	$4,%eax
+	movl	$0,%ecx
+	.byte	0x0f,0xa2
+	movl	%eax,%edi
+	shrl	$14,%edi
+	andl	$4095,%edi
+.L004nocacheinfo:
+	movl	$1,%eax
+	xorl	%ecx,%ecx
+	.byte	0x0f,0xa2
+	andl	$3220176895,%edx
+	cmpl	$0,%ebp
+	jne	.L005notintel
+	orl	$1073741824,%edx
+.L005notintel:
+	btl	$28,%edx
+	jnc	.L002generic
+	andl	$4026531839,%edx
+	cmpl	$0,%edi
+	je	.L002generic
+	orl	$268435456,%edx
+	shrl	$16,%ebx
+	cmpb	$1,%bl
+	ja	.L002generic
+	andl	$4026531839,%edx
+.L002generic:
+	andl	$2048,%ebp
+	andl	$4294965247,%ecx
+	movl	%edx,%esi
+	orl	%ecx,%ebp
+	btl	$27,%ecx
+	jnc	.L006clear_avx
+	xorl	%ecx,%ecx
+.byte	15,1,208
+	andl	$6,%eax
+	cmpl	$6,%eax
+	je	.L007done
+	cmpl	$2,%eax
+	je	.L006clear_avx
+.L008clear_xmm:
+	andl	$4261412861,%ebp
+	andl	$4278190079,%esi
+.L006clear_avx:
+	andl	$4026525695,%ebp
+	movl	20(%esp),%edi
+	andl	$4294967263,8(%edi)
+.L007done:
+	movl	%esi,%eax
+	movl	%ebp,%edx
+.L000nocpuid:
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.size	OPENSSL_ia32_cpuid,.-.L_OPENSSL_ia32_cpuid_begin
+.globl	OPENSSL_rdtsc
+.hidden	OPENSSL_rdtsc
+.type	OPENSSL_rdtsc,@function
+.align	16
+OPENSSL_rdtsc:
+.L_OPENSSL_rdtsc_begin:
+	xorl	%eax,%eax
+	xorl	%edx,%edx
+	call	.L009PIC_me_up
+.L009PIC_me_up:
+	popl	%ecx
+	leal	OPENSSL_ia32cap_P-.L009PIC_me_up(%ecx),%ecx
+	btl	$4,(%ecx)
+	jnc	.L010notsc
+	.byte	0x0f,0x31
+.L010notsc:
+	ret
+.size	OPENSSL_rdtsc,.-.L_OPENSSL_rdtsc_begin
+.globl	OPENSSL_instrument_halt
+.hidden	OPENSSL_instrument_halt
+.type	OPENSSL_instrument_halt,@function
+.align	16
+OPENSSL_instrument_halt:
+.L_OPENSSL_instrument_halt_begin:
+	call	.L011PIC_me_up
+.L011PIC_me_up:
+	popl	%ecx
+	leal	OPENSSL_ia32cap_P-.L011PIC_me_up(%ecx),%ecx
+	btl	$4,(%ecx)
+	jnc	.L012nohalt
+.long	2421723150
+	andl	$3,%eax
+	jnz	.L012nohalt
+	pushfl
+	popl	%eax
+	btl	$9,%eax
+	jnc	.L012nohalt
+	.byte	0x0f,0x31
+	pushl	%edx
+	pushl	%eax
+	hlt
+	.byte	0x0f,0x31
+	subl	(%esp),%eax
+	sbbl	4(%esp),%edx
+	addl	$8,%esp
+	ret
+.L012nohalt:
+	xorl	%eax,%eax
+	xorl	%edx,%edx
+	ret
+.size	OPENSSL_instrument_halt,.-.L_OPENSSL_instrument_halt_begin
+.globl	OPENSSL_far_spin
+.hidden	OPENSSL_far_spin
+.type	OPENSSL_far_spin,@function
+.align	16
+OPENSSL_far_spin:
+.L_OPENSSL_far_spin_begin:
+	pushfl
+	popl	%eax
+	btl	$9,%eax
+	jnc	.L013nospin
+	movl	4(%esp),%eax
+	movl	8(%esp),%ecx
+.long	2430111262
+	xorl	%eax,%eax
+	movl	(%ecx),%edx
+	jmp	.L014spin
+.align	16
+.L014spin:
+	incl	%eax
+	cmpl	(%ecx),%edx
+	je	.L014spin
+.long	529567888
+	ret
+.L013nospin:
+	xorl	%eax,%eax
+	xorl	%edx,%edx
+	ret
+.size	OPENSSL_far_spin,.-.L_OPENSSL_far_spin_begin
+.globl	OPENSSL_wipe_cpu
+.hidden	OPENSSL_wipe_cpu
+.type	OPENSSL_wipe_cpu,@function
+.align	16
+OPENSSL_wipe_cpu:
+.L_OPENSSL_wipe_cpu_begin:
+	xorl	%eax,%eax
+	xorl	%edx,%edx
+	call	.L015PIC_me_up
+.L015PIC_me_up:
+	popl	%ecx
+	leal	OPENSSL_ia32cap_P-.L015PIC_me_up(%ecx),%ecx
+	movl	(%ecx),%ecx
+	btl	$1,(%ecx)
+	jnc	.L016no_x87
+	andl	$83886080,%ecx
+	cmpl	$83886080,%ecx
+	jne	.L017no_sse2
+	pxor	%xmm0,%xmm0
+	pxor	%xmm1,%xmm1
+	pxor	%xmm2,%xmm2
+	pxor	%xmm3,%xmm3
+	pxor	%xmm4,%xmm4
+	pxor	%xmm5,%xmm5
+	pxor	%xmm6,%xmm6
+	pxor	%xmm7,%xmm7
+.L017no_sse2:
+.long	4007259865,4007259865,4007259865,4007259865,2430851995
+.L016no_x87:
+	leal	4(%esp),%eax
+	ret
+.size	OPENSSL_wipe_cpu,.-.L_OPENSSL_wipe_cpu_begin
+.globl	OPENSSL_atomic_add
+.hidden	OPENSSL_atomic_add
+.type	OPENSSL_atomic_add,@function
+.align	16
+OPENSSL_atomic_add:
+.L_OPENSSL_atomic_add_begin:
+	movl	4(%esp),%edx
+	movl	8(%esp),%ecx
+	pushl	%ebx
+	nop
+	movl	(%edx),%eax
+.L018spin:
+	leal	(%eax,%ecx,1),%ebx
+	nop
+.long	447811568
+	jne	.L018spin
+	movl	%ebx,%eax
+	popl	%ebx
+	ret
+.size	OPENSSL_atomic_add,.-.L_OPENSSL_atomic_add_begin
+.globl	OPENSSL_indirect_call
+.hidden	OPENSSL_indirect_call
+.type	OPENSSL_indirect_call,@function
+.align	16
+OPENSSL_indirect_call:
+.L_OPENSSL_indirect_call_begin:
+	pushl	%ebp
+	movl	%esp,%ebp
+	subl	$28,%esp
+	movl	12(%ebp),%ecx
+	movl	%ecx,(%esp)
+	movl	16(%ebp),%edx
+	movl	%edx,4(%esp)
+	movl	20(%ebp),%eax
+	movl	%eax,8(%esp)
+	movl	24(%ebp),%eax
+	movl	%eax,12(%esp)
+	movl	28(%ebp),%eax
+	movl	%eax,16(%esp)
+	movl	32(%ebp),%eax
+	movl	%eax,20(%esp)
+	movl	36(%ebp),%eax
+	movl	%eax,24(%esp)
+	call	*8(%ebp)
+	movl	%ebp,%esp
+	popl	%ebp
+	ret
+.size	OPENSSL_indirect_call,.-.L_OPENSSL_indirect_call_begin
+.globl	OPENSSL_ia32_rdrand
+.hidden	OPENSSL_ia32_rdrand
+.type	OPENSSL_ia32_rdrand,@function
+.align	16
+OPENSSL_ia32_rdrand:
+.L_OPENSSL_ia32_rdrand_begin:
+	movl	$8,%ecx
+.L019loop:
+.byte	15,199,240
+	jc	.L020break
+	loop	.L019loop
+.L020break:
+	cmpl	$0,%eax
+	cmovel	%ecx,%eax
+	ret
+.size	OPENSSL_ia32_rdrand,.-.L_OPENSSL_ia32_rdrand_begin
+.hidden	OPENSSL_ia32cap_P
+#endif
diff --git a/third_party/boringssl/linux-x86/crypto/md5/md5-586.S b/third_party/boringssl/linux-x86/crypto/md5/md5-586.S
new file mode 100644
index 0000000..734b941
--- /dev/null
+++ b/third_party/boringssl/linux-x86/crypto/md5/md5-586.S
@@ -0,0 +1,682 @@
+#if defined(__i386__)
+.file	"src/crypto/md5/asm/md5-586.S"
+.text
+.globl	md5_block_asm_data_order
+.hidden	md5_block_asm_data_order
+.type	md5_block_asm_data_order,@function
+.align	16
+md5_block_asm_data_order:
+.L_md5_block_asm_data_order_begin:
+	pushl	%esi
+	pushl	%edi
+	movl	12(%esp),%edi
+	movl	16(%esp),%esi
+	movl	20(%esp),%ecx
+	pushl	%ebp
+	shll	$6,%ecx
+	pushl	%ebx
+	addl	%esi,%ecx
+	subl	$64,%ecx
+	movl	(%edi),%eax
+	pushl	%ecx
+	movl	4(%edi),%ebx
+	movl	8(%edi),%ecx
+	movl	12(%edi),%edx
+.L000start:
+
+
+	movl	%ecx,%edi
+	movl	(%esi),%ebp
+
+	xorl	%edx,%edi
+	andl	%ebx,%edi
+	leal	3614090360(%eax,%ebp,1),%eax
+	xorl	%edx,%edi
+	addl	%edi,%eax
+	movl	%ebx,%edi
+	roll	$7,%eax
+	movl	4(%esi),%ebp
+	addl	%ebx,%eax
+
+	xorl	%ecx,%edi
+	andl	%eax,%edi
+	leal	3905402710(%edx,%ebp,1),%edx
+	xorl	%ecx,%edi
+	addl	%edi,%edx
+	movl	%eax,%edi
+	roll	$12,%edx
+	movl	8(%esi),%ebp
+	addl	%eax,%edx
+
+	xorl	%ebx,%edi
+	andl	%edx,%edi
+	leal	606105819(%ecx,%ebp,1),%ecx
+	xorl	%ebx,%edi
+	addl	%edi,%ecx
+	movl	%edx,%edi
+	roll	$17,%ecx
+	movl	12(%esi),%ebp
+	addl	%edx,%ecx
+
+	xorl	%eax,%edi
+	andl	%ecx,%edi
+	leal	3250441966(%ebx,%ebp,1),%ebx
+	xorl	%eax,%edi
+	addl	%edi,%ebx
+	movl	%ecx,%edi
+	roll	$22,%ebx
+	movl	16(%esi),%ebp
+	addl	%ecx,%ebx
+
+	xorl	%edx,%edi
+	andl	%ebx,%edi
+	leal	4118548399(%eax,%ebp,1),%eax
+	xorl	%edx,%edi
+	addl	%edi,%eax
+	movl	%ebx,%edi
+	roll	$7,%eax
+	movl	20(%esi),%ebp
+	addl	%ebx,%eax
+
+	xorl	%ecx,%edi
+	andl	%eax,%edi
+	leal	1200080426(%edx,%ebp,1),%edx
+	xorl	%ecx,%edi
+	addl	%edi,%edx
+	movl	%eax,%edi
+	roll	$12,%edx
+	movl	24(%esi),%ebp
+	addl	%eax,%edx
+
+	xorl	%ebx,%edi
+	andl	%edx,%edi
+	leal	2821735955(%ecx,%ebp,1),%ecx
+	xorl	%ebx,%edi
+	addl	%edi,%ecx
+	movl	%edx,%edi
+	roll	$17,%ecx
+	movl	28(%esi),%ebp
+	addl	%edx,%ecx
+
+	xorl	%eax,%edi
+	andl	%ecx,%edi
+	leal	4249261313(%ebx,%ebp,1),%ebx
+	xorl	%eax,%edi
+	addl	%edi,%ebx
+	movl	%ecx,%edi
+	roll	$22,%ebx
+	movl	32(%esi),%ebp
+	addl	%ecx,%ebx
+
+	xorl	%edx,%edi
+	andl	%ebx,%edi
+	leal	1770035416(%eax,%ebp,1),%eax
+	xorl	%edx,%edi
+	addl	%edi,%eax
+	movl	%ebx,%edi
+	roll	$7,%eax
+	movl	36(%esi),%ebp
+	addl	%ebx,%eax
+
+	xorl	%ecx,%edi
+	andl	%eax,%edi
+	leal	2336552879(%edx,%ebp,1),%edx
+	xorl	%ecx,%edi
+	addl	%edi,%edx
+	movl	%eax,%edi
+	roll	$12,%edx
+	movl	40(%esi),%ebp
+	addl	%eax,%edx
+
+	xorl	%ebx,%edi
+	andl	%edx,%edi
+	leal	4294925233(%ecx,%ebp,1),%ecx
+	xorl	%ebx,%edi
+	addl	%edi,%ecx
+	movl	%edx,%edi
+	roll	$17,%ecx
+	movl	44(%esi),%ebp
+	addl	%edx,%ecx
+
+	xorl	%eax,%edi
+	andl	%ecx,%edi
+	leal	2304563134(%ebx,%ebp,1),%ebx
+	xorl	%eax,%edi
+	addl	%edi,%ebx
+	movl	%ecx,%edi
+	roll	$22,%ebx
+	movl	48(%esi),%ebp
+	addl	%ecx,%ebx
+
+	xorl	%edx,%edi
+	andl	%ebx,%edi
+	leal	1804603682(%eax,%ebp,1),%eax
+	xorl	%edx,%edi
+	addl	%edi,%eax
+	movl	%ebx,%edi
+	roll	$7,%eax
+	movl	52(%esi),%ebp
+	addl	%ebx,%eax
+
+	xorl	%ecx,%edi
+	andl	%eax,%edi
+	leal	4254626195(%edx,%ebp,1),%edx
+	xorl	%ecx,%edi
+	addl	%edi,%edx
+	movl	%eax,%edi
+	roll	$12,%edx
+	movl	56(%esi),%ebp
+	addl	%eax,%edx
+
+	xorl	%ebx,%edi
+	andl	%edx,%edi
+	leal	2792965006(%ecx,%ebp,1),%ecx
+	xorl	%ebx,%edi
+	addl	%edi,%ecx
+	movl	%edx,%edi
+	roll	$17,%ecx
+	movl	60(%esi),%ebp
+	addl	%edx,%ecx
+
+	xorl	%eax,%edi
+	andl	%ecx,%edi
+	leal	1236535329(%ebx,%ebp,1),%ebx
+	xorl	%eax,%edi
+	addl	%edi,%ebx
+	movl	%ecx,%edi
+	roll	$22,%ebx
+	movl	4(%esi),%ebp
+	addl	%ecx,%ebx
+
+
+
+	leal	4129170786(%eax,%ebp,1),%eax
+	xorl	%ebx,%edi
+	andl	%edx,%edi
+	movl	24(%esi),%ebp
+	xorl	%ecx,%edi
+	addl	%edi,%eax
+	movl	%ebx,%edi
+	roll	$5,%eax
+	addl	%ebx,%eax
+
+	leal	3225465664(%edx,%ebp,1),%edx
+	xorl	%eax,%edi
+	andl	%ecx,%edi
+	movl	44(%esi),%ebp
+	xorl	%ebx,%edi
+	addl	%edi,%edx
+	movl	%eax,%edi
+	roll	$9,%edx
+	addl	%eax,%edx
+
+	leal	643717713(%ecx,%ebp,1),%ecx
+	xorl	%edx,%edi
+	andl	%ebx,%edi
+	movl	(%esi),%ebp
+	xorl	%eax,%edi
+	addl	%edi,%ecx
+	movl	%edx,%edi
+	roll	$14,%ecx
+	addl	%edx,%ecx
+
+	leal	3921069994(%ebx,%ebp,1),%ebx
+	xorl	%ecx,%edi
+	andl	%eax,%edi
+	movl	20(%esi),%ebp
+	xorl	%edx,%edi
+	addl	%edi,%ebx
+	movl	%ecx,%edi
+	roll	$20,%ebx
+	addl	%ecx,%ebx
+
+	leal	3593408605(%eax,%ebp,1),%eax
+	xorl	%ebx,%edi
+	andl	%edx,%edi
+	movl	40(%esi),%ebp
+	xorl	%ecx,%edi
+	addl	%edi,%eax
+	movl	%ebx,%edi
+	roll	$5,%eax
+	addl	%ebx,%eax
+
+	leal	38016083(%edx,%ebp,1),%edx
+	xorl	%eax,%edi
+	andl	%ecx,%edi
+	movl	60(%esi),%ebp
+	xorl	%ebx,%edi
+	addl	%edi,%edx
+	movl	%eax,%edi
+	roll	$9,%edx
+	addl	%eax,%edx
+
+	leal	3634488961(%ecx,%ebp,1),%ecx
+	xorl	%edx,%edi
+	andl	%ebx,%edi
+	movl	16(%esi),%ebp
+	xorl	%eax,%edi
+	addl	%edi,%ecx
+	movl	%edx,%edi
+	roll	$14,%ecx
+	addl	%edx,%ecx
+
+	leal	3889429448(%ebx,%ebp,1),%ebx
+	xorl	%ecx,%edi
+	andl	%eax,%edi
+	movl	36(%esi),%ebp
+	xorl	%edx,%edi
+	addl	%edi,%ebx
+	movl	%ecx,%edi
+	roll	$20,%ebx
+	addl	%ecx,%ebx
+
+	leal	568446438(%eax,%ebp,1),%eax
+	xorl	%ebx,%edi
+	andl	%edx,%edi
+	movl	56(%esi),%ebp
+	xorl	%ecx,%edi
+	addl	%edi,%eax
+	movl	%ebx,%edi
+	roll	$5,%eax
+	addl	%ebx,%eax
+
+	leal	3275163606(%edx,%ebp,1),%edx
+	xorl	%eax,%edi
+	andl	%ecx,%edi
+	movl	12(%esi),%ebp
+	xorl	%ebx,%edi
+	addl	%edi,%edx
+	movl	%eax,%edi
+	roll	$9,%edx
+	addl	%eax,%edx
+
+	leal	4107603335(%ecx,%ebp,1),%ecx
+	xorl	%edx,%edi
+	andl	%ebx,%edi
+	movl	32(%esi),%ebp
+	xorl	%eax,%edi
+	addl	%edi,%ecx
+	movl	%edx,%edi
+	roll	$14,%ecx
+	addl	%edx,%ecx
+
+	leal	1163531501(%ebx,%ebp,1),%ebx
+	xorl	%ecx,%edi
+	andl	%eax,%edi
+	movl	52(%esi),%ebp
+	xorl	%edx,%edi
+	addl	%edi,%ebx
+	movl	%ecx,%edi
+	roll	$20,%ebx
+	addl	%ecx,%ebx
+
+	leal	2850285829(%eax,%ebp,1),%eax
+	xorl	%ebx,%edi
+	andl	%edx,%edi
+	movl	8(%esi),%ebp
+	xorl	%ecx,%edi
+	addl	%edi,%eax
+	movl	%ebx,%edi
+	roll	$5,%eax
+	addl	%ebx,%eax
+
+	leal	4243563512(%edx,%ebp,1),%edx
+	xorl	%eax,%edi
+	andl	%ecx,%edi
+	movl	28(%esi),%ebp
+	xorl	%ebx,%edi
+	addl	%edi,%edx
+	movl	%eax,%edi
+	roll	$9,%edx
+	addl	%eax,%edx
+
+	leal	1735328473(%ecx,%ebp,1),%ecx
+	xorl	%edx,%edi
+	andl	%ebx,%edi
+	movl	48(%esi),%ebp
+	xorl	%eax,%edi
+	addl	%edi,%ecx
+	movl	%edx,%edi
+	roll	$14,%ecx
+	addl	%edx,%ecx
+
+	leal	2368359562(%ebx,%ebp,1),%ebx
+	xorl	%ecx,%edi
+	andl	%eax,%edi
+	movl	20(%esi),%ebp
+	xorl	%edx,%edi
+	addl	%edi,%ebx
+	movl	%ecx,%edi
+	roll	$20,%ebx
+	addl	%ecx,%ebx
+
+
+
+	xorl	%edx,%edi
+	xorl	%ebx,%edi
+	leal	4294588738(%eax,%ebp,1),%eax
+	addl	%edi,%eax
+	roll	$4,%eax
+	movl	32(%esi),%ebp
+	movl	%ebx,%edi
+
+	leal	2272392833(%edx,%ebp,1),%edx
+	addl	%ebx,%eax
+	xorl	%ecx,%edi
+	xorl	%eax,%edi
+	movl	44(%esi),%ebp
+	addl	%edi,%edx
+	movl	%eax,%edi
+	roll	$11,%edx
+	addl	%eax,%edx
+
+	xorl	%ebx,%edi
+	xorl	%edx,%edi
+	leal	1839030562(%ecx,%ebp,1),%ecx
+	addl	%edi,%ecx
+	roll	$16,%ecx
+	movl	56(%esi),%ebp
+	movl	%edx,%edi
+
+	leal	4259657740(%ebx,%ebp,1),%ebx
+	addl	%edx,%ecx
+	xorl	%eax,%edi
+	xorl	%ecx,%edi
+	movl	4(%esi),%ebp
+	addl	%edi,%ebx
+	movl	%ecx,%edi
+	roll	$23,%ebx
+	addl	%ecx,%ebx
+
+	xorl	%edx,%edi
+	xorl	%ebx,%edi
+	leal	2763975236(%eax,%ebp,1),%eax
+	addl	%edi,%eax
+	roll	$4,%eax
+	movl	16(%esi),%ebp
+	movl	%ebx,%edi
+
+	leal	1272893353(%edx,%ebp,1),%edx
+	addl	%ebx,%eax
+	xorl	%ecx,%edi
+	xorl	%eax,%edi
+	movl	28(%esi),%ebp
+	addl	%edi,%edx
+	movl	%eax,%edi
+	roll	$11,%edx
+	addl	%eax,%edx
+
+	xorl	%ebx,%edi
+	xorl	%edx,%edi
+	leal	4139469664(%ecx,%ebp,1),%ecx
+	addl	%edi,%ecx
+	roll	$16,%ecx
+	movl	40(%esi),%ebp
+	movl	%edx,%edi
+
+	leal	3200236656(%ebx,%ebp,1),%ebx
+	addl	%edx,%ecx
+	xorl	%eax,%edi
+	xorl	%ecx,%edi
+	movl	52(%esi),%ebp
+	addl	%edi,%ebx
+	movl	%ecx,%edi
+	roll	$23,%ebx
+	addl	%ecx,%ebx
+
+	xorl	%edx,%edi
+	xorl	%ebx,%edi
+	leal	681279174(%eax,%ebp,1),%eax
+	addl	%edi,%eax
+	roll	$4,%eax
+	movl	(%esi),%ebp
+	movl	%ebx,%edi
+
+	leal	3936430074(%edx,%ebp,1),%edx
+	addl	%ebx,%eax
+	xorl	%ecx,%edi
+	xorl	%eax,%edi
+	movl	12(%esi),%ebp
+	addl	%edi,%edx
+	movl	%eax,%edi
+	roll	$11,%edx
+	addl	%eax,%edx
+
+	xorl	%ebx,%edi
+	xorl	%edx,%edi
+	leal	3572445317(%ecx,%ebp,1),%ecx
+	addl	%edi,%ecx
+	roll	$16,%ecx
+	movl	24(%esi),%ebp
+	movl	%edx,%edi
+
+	leal	76029189(%ebx,%ebp,1),%ebx
+	addl	%edx,%ecx
+	xorl	%eax,%edi
+	xorl	%ecx,%edi
+	movl	36(%esi),%ebp
+	addl	%edi,%ebx
+	movl	%ecx,%edi
+	roll	$23,%ebx
+	addl	%ecx,%ebx
+
+	xorl	%edx,%edi
+	xorl	%ebx,%edi
+	leal	3654602809(%eax,%ebp,1),%eax
+	addl	%edi,%eax
+	roll	$4,%eax
+	movl	48(%esi),%ebp
+	movl	%ebx,%edi
+
+	leal	3873151461(%edx,%ebp,1),%edx
+	addl	%ebx,%eax
+	xorl	%ecx,%edi
+	xorl	%eax,%edi
+	movl	60(%esi),%ebp
+	addl	%edi,%edx
+	movl	%eax,%edi
+	roll	$11,%edx
+	addl	%eax,%edx
+
+	xorl	%ebx,%edi
+	xorl	%edx,%edi
+	leal	530742520(%ecx,%ebp,1),%ecx
+	addl	%edi,%ecx
+	roll	$16,%ecx
+	movl	8(%esi),%ebp
+	movl	%edx,%edi
+
+	leal	3299628645(%ebx,%ebp,1),%ebx
+	addl	%edx,%ecx
+	xorl	%eax,%edi
+	xorl	%ecx,%edi
+	movl	(%esi),%ebp
+	addl	%edi,%ebx
+	movl	$-1,%edi
+	roll	$23,%ebx
+	addl	%ecx,%ebx
+
+
+
+	xorl	%edx,%edi
+	orl	%ebx,%edi
+	leal	4096336452(%eax,%ebp,1),%eax
+	xorl	%ecx,%edi
+	movl	28(%esi),%ebp
+	addl	%edi,%eax
+	movl	$-1,%edi
+	roll	$6,%eax
+	xorl	%ecx,%edi
+	addl	%ebx,%eax
+
+	orl	%eax,%edi
+	leal	1126891415(%edx,%ebp,1),%edx
+	xorl	%ebx,%edi
+	movl	56(%esi),%ebp
+	addl	%edi,%edx
+	movl	$-1,%edi
+	roll	$10,%edx
+	xorl	%ebx,%edi
+	addl	%eax,%edx
+
+	orl	%edx,%edi
+	leal	2878612391(%ecx,%ebp,1),%ecx
+	xorl	%eax,%edi
+	movl	20(%esi),%ebp
+	addl	%edi,%ecx
+	movl	$-1,%edi
+	roll	$15,%ecx
+	xorl	%eax,%edi
+	addl	%edx,%ecx
+
+	orl	%ecx,%edi
+	leal	4237533241(%ebx,%ebp,1),%ebx
+	xorl	%edx,%edi
+	movl	48(%esi),%ebp
+	addl	%edi,%ebx
+	movl	$-1,%edi
+	roll	$21,%ebx
+	xorl	%edx,%edi
+	addl	%ecx,%ebx
+
+	orl	%ebx,%edi
+	leal	1700485571(%eax,%ebp,1),%eax
+	xorl	%ecx,%edi
+	movl	12(%esi),%ebp
+	addl	%edi,%eax
+	movl	$-1,%edi
+	roll	$6,%eax
+	xorl	%ecx,%edi
+	addl	%ebx,%eax
+
+	orl	%eax,%edi
+	leal	2399980690(%edx,%ebp,1),%edx
+	xorl	%ebx,%edi
+	movl	40(%esi),%ebp
+	addl	%edi,%edx
+	movl	$-1,%edi
+	roll	$10,%edx
+	xorl	%ebx,%edi
+	addl	%eax,%edx
+
+	orl	%edx,%edi
+	leal	4293915773(%ecx,%ebp,1),%ecx
+	xorl	%eax,%edi
+	movl	4(%esi),%ebp
+	addl	%edi,%ecx
+	movl	$-1,%edi
+	roll	$15,%ecx
+	xorl	%eax,%edi
+	addl	%edx,%ecx
+
+	orl	%ecx,%edi
+	leal	2240044497(%ebx,%ebp,1),%ebx
+	xorl	%edx,%edi
+	movl	32(%esi),%ebp
+	addl	%edi,%ebx
+	movl	$-1,%edi
+	roll	$21,%ebx
+	xorl	%edx,%edi
+	addl	%ecx,%ebx
+
+	orl	%ebx,%edi
+	leal	1873313359(%eax,%ebp,1),%eax
+	xorl	%ecx,%edi
+	movl	60(%esi),%ebp
+	addl	%edi,%eax
+	movl	$-1,%edi
+	roll	$6,%eax
+	xorl	%ecx,%edi
+	addl	%ebx,%eax
+
+	orl	%eax,%edi
+	leal	4264355552(%edx,%ebp,1),%edx
+	xorl	%ebx,%edi
+	movl	24(%esi),%ebp
+	addl	%edi,%edx
+	movl	$-1,%edi
+	roll	$10,%edx
+	xorl	%ebx,%edi
+	addl	%eax,%edx
+
+	orl	%edx,%edi
+	leal	2734768916(%ecx,%ebp,1),%ecx
+	xorl	%eax,%edi
+	movl	52(%esi),%ebp
+	addl	%edi,%ecx
+	movl	$-1,%edi
+	roll	$15,%ecx
+	xorl	%eax,%edi
+	addl	%edx,%ecx
+
+	orl	%ecx,%edi
+	leal	1309151649(%ebx,%ebp,1),%ebx
+	xorl	%edx,%edi
+	movl	16(%esi),%ebp
+	addl	%edi,%ebx
+	movl	$-1,%edi
+	roll	$21,%ebx
+	xorl	%edx,%edi
+	addl	%ecx,%ebx
+
+	orl	%ebx,%edi
+	leal	4149444226(%eax,%ebp,1),%eax
+	xorl	%ecx,%edi
+	movl	44(%esi),%ebp
+	addl	%edi,%eax
+	movl	$-1,%edi
+	roll	$6,%eax
+	xorl	%ecx,%edi
+	addl	%ebx,%eax
+
+	orl	%eax,%edi
+	leal	3174756917(%edx,%ebp,1),%edx
+	xorl	%ebx,%edi
+	movl	8(%esi),%ebp
+	addl	%edi,%edx
+	movl	$-1,%edi
+	roll	$10,%edx
+	xorl	%ebx,%edi
+	addl	%eax,%edx
+
+	orl	%edx,%edi
+	leal	718787259(%ecx,%ebp,1),%ecx
+	xorl	%eax,%edi
+	movl	36(%esi),%ebp
+	addl	%edi,%ecx
+	movl	$-1,%edi
+	roll	$15,%ecx
+	xorl	%eax,%edi
+	addl	%edx,%ecx
+
+	orl	%ecx,%edi
+	leal	3951481745(%ebx,%ebp,1),%ebx
+	xorl	%edx,%edi
+	movl	24(%esp),%ebp
+	addl	%edi,%ebx
+	addl	$64,%esi
+	roll	$21,%ebx
+	movl	(%ebp),%edi
+	addl	%ecx,%ebx
+	addl	%edi,%eax
+	movl	4(%ebp),%edi
+	addl	%edi,%ebx
+	movl	8(%ebp),%edi
+	addl	%edi,%ecx
+	movl	12(%ebp),%edi
+	addl	%edi,%edx
+	movl	%eax,(%ebp)
+	movl	%ebx,4(%ebp)
+	movl	(%esp),%edi
+	movl	%ecx,8(%ebp)
+	movl	%edx,12(%ebp)
+	cmpl	%esi,%edi
+	jae	.L000start
+	popl	%eax
+	popl	%ebx
+	popl	%ebp
+	popl	%edi
+	popl	%esi
+	ret
+.size	md5_block_asm_data_order,.-.L_md5_block_asm_data_order_begin
+#endif
diff --git a/third_party/boringssl/linux-x86/crypto/modes/ghash-x86.S b/third_party/boringssl/linux-x86/crypto/modes/ghash-x86.S
new file mode 100644
index 0000000..2872088
--- /dev/null
+++ b/third_party/boringssl/linux-x86/crypto/modes/ghash-x86.S
@@ -0,0 +1,1274 @@
+#if defined(__i386__)
+.file	"ghash-x86.S"
+.text
+.globl	gcm_gmult_4bit_x86
+.hidden	gcm_gmult_4bit_x86
+.type	gcm_gmult_4bit_x86,@function
+.align	16
+gcm_gmult_4bit_x86:
+.L_gcm_gmult_4bit_x86_begin:
+	pushl	%ebp
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+	subl	$84,%esp
+	movl	104(%esp),%edi
+	movl	108(%esp),%esi
+	movl	(%edi),%ebp
+	movl	4(%edi),%edx
+	movl	8(%edi),%ecx
+	movl	12(%edi),%ebx
+	movl	$0,16(%esp)
+	movl	$471859200,20(%esp)
+	movl	$943718400,24(%esp)
+	movl	$610271232,28(%esp)
+	movl	$1887436800,32(%esp)
+	movl	$1822425088,36(%esp)
+	movl	$1220542464,40(%esp)
+	movl	$1423966208,44(%esp)
+	movl	$3774873600,48(%esp)
+	movl	$4246732800,52(%esp)
+	movl	$3644850176,56(%esp)
+	movl	$3311403008,60(%esp)
+	movl	$2441084928,64(%esp)
+	movl	$2376073216,68(%esp)
+	movl	$2847932416,72(%esp)
+	movl	$3051356160,76(%esp)
+	movl	%ebp,(%esp)
+	movl	%edx,4(%esp)
+	movl	%ecx,8(%esp)
+	movl	%ebx,12(%esp)
+	shrl	$20,%ebx
+	andl	$240,%ebx
+	movl	4(%esi,%ebx,1),%ebp
+	movl	(%esi,%ebx,1),%edx
+	movl	12(%esi,%ebx,1),%ecx
+	movl	8(%esi,%ebx,1),%ebx
+	xorl	%eax,%eax
+	movl	$15,%edi
+	jmp	.L000x86_loop
+.align	16
+.L000x86_loop:
+	movb	%bl,%al
+	shrdl	$4,%ecx,%ebx
+	andb	$15,%al
+	shrdl	$4,%edx,%ecx
+	shrdl	$4,%ebp,%edx
+	shrl	$4,%ebp
+	xorl	16(%esp,%eax,4),%ebp
+	movb	(%esp,%edi,1),%al
+	andb	$240,%al
+	xorl	8(%esi,%eax,1),%ebx
+	xorl	12(%esi,%eax,1),%ecx
+	xorl	(%esi,%eax,1),%edx
+	xorl	4(%esi,%eax,1),%ebp
+	decl	%edi
+	js	.L001x86_break
+	movb	%bl,%al
+	shrdl	$4,%ecx,%ebx
+	andb	$15,%al
+	shrdl	$4,%edx,%ecx
+	shrdl	$4,%ebp,%edx
+	shrl	$4,%ebp
+	xorl	16(%esp,%eax,4),%ebp
+	movb	(%esp,%edi,1),%al
+	shlb	$4,%al
+	xorl	8(%esi,%eax,1),%ebx
+	xorl	12(%esi,%eax,1),%ecx
+	xorl	(%esi,%eax,1),%edx
+	xorl	4(%esi,%eax,1),%ebp
+	jmp	.L000x86_loop
+.align	16
+.L001x86_break:
+	bswap	%ebx
+	bswap	%ecx
+	bswap	%edx
+	bswap	%ebp
+	movl	104(%esp),%edi
+	movl	%ebx,12(%edi)
+	movl	%ecx,8(%edi)
+	movl	%edx,4(%edi)
+	movl	%ebp,(%edi)
+	addl	$84,%esp
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.size	gcm_gmult_4bit_x86,.-.L_gcm_gmult_4bit_x86_begin
+.globl	gcm_ghash_4bit_x86
+.hidden	gcm_ghash_4bit_x86
+.type	gcm_ghash_4bit_x86,@function
+.align	16
+gcm_ghash_4bit_x86:
+.L_gcm_ghash_4bit_x86_begin:
+	pushl	%ebp
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+	subl	$84,%esp
+	movl	104(%esp),%ebx
+	movl	108(%esp),%esi
+	movl	112(%esp),%edi
+	movl	116(%esp),%ecx
+	addl	%edi,%ecx
+	movl	%ecx,116(%esp)
+	movl	(%ebx),%ebp
+	movl	4(%ebx),%edx
+	movl	8(%ebx),%ecx
+	movl	12(%ebx),%ebx
+	movl	$0,16(%esp)
+	movl	$471859200,20(%esp)
+	movl	$943718400,24(%esp)
+	movl	$610271232,28(%esp)
+	movl	$1887436800,32(%esp)
+	movl	$1822425088,36(%esp)
+	movl	$1220542464,40(%esp)
+	movl	$1423966208,44(%esp)
+	movl	$3774873600,48(%esp)
+	movl	$4246732800,52(%esp)
+	movl	$3644850176,56(%esp)
+	movl	$3311403008,60(%esp)
+	movl	$2441084928,64(%esp)
+	movl	$2376073216,68(%esp)
+	movl	$2847932416,72(%esp)
+	movl	$3051356160,76(%esp)
+.align	16
+.L002x86_outer_loop:
+	xorl	12(%edi),%ebx
+	xorl	8(%edi),%ecx
+	xorl	4(%edi),%edx
+	xorl	(%edi),%ebp
+	movl	%ebx,12(%esp)
+	movl	%ecx,8(%esp)
+	movl	%edx,4(%esp)
+	movl	%ebp,(%esp)
+	shrl	$20,%ebx
+	andl	$240,%ebx
+	movl	4(%esi,%ebx,1),%ebp
+	movl	(%esi,%ebx,1),%edx
+	movl	12(%esi,%ebx,1),%ecx
+	movl	8(%esi,%ebx,1),%ebx
+	xorl	%eax,%eax
+	movl	$15,%edi
+	jmp	.L003x86_loop
+.align	16
+.L003x86_loop:
+	movb	%bl,%al
+	shrdl	$4,%ecx,%ebx
+	andb	$15,%al
+	shrdl	$4,%edx,%ecx
+	shrdl	$4,%ebp,%edx
+	shrl	$4,%ebp
+	xorl	16(%esp,%eax,4),%ebp
+	movb	(%esp,%edi,1),%al
+	andb	$240,%al
+	xorl	8(%esi,%eax,1),%ebx
+	xorl	12(%esi,%eax,1),%ecx
+	xorl	(%esi,%eax,1),%edx
+	xorl	4(%esi,%eax,1),%ebp
+	decl	%edi
+	js	.L004x86_break
+	movb	%bl,%al
+	shrdl	$4,%ecx,%ebx
+	andb	$15,%al
+	shrdl	$4,%edx,%ecx
+	shrdl	$4,%ebp,%edx
+	shrl	$4,%ebp
+	xorl	16(%esp,%eax,4),%ebp
+	movb	(%esp,%edi,1),%al
+	shlb	$4,%al
+	xorl	8(%esi,%eax,1),%ebx
+	xorl	12(%esi,%eax,1),%ecx
+	xorl	(%esi,%eax,1),%edx
+	xorl	4(%esi,%eax,1),%ebp
+	jmp	.L003x86_loop
+.align	16
+.L004x86_break:
+	bswap	%ebx
+	bswap	%ecx
+	bswap	%edx
+	bswap	%ebp
+	movl	112(%esp),%edi
+	leal	16(%edi),%edi
+	cmpl	116(%esp),%edi
+	movl	%edi,112(%esp)
+	jb	.L002x86_outer_loop
+	movl	104(%esp),%edi
+	movl	%ebx,12(%edi)
+	movl	%ecx,8(%edi)
+	movl	%edx,4(%edi)
+	movl	%ebp,(%edi)
+	addl	$84,%esp
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.size	gcm_ghash_4bit_x86,.-.L_gcm_ghash_4bit_x86_begin
+.globl	gcm_gmult_4bit_mmx
+.hidden	gcm_gmult_4bit_mmx
+.type	gcm_gmult_4bit_mmx,@function
+.align	16
+gcm_gmult_4bit_mmx:
+.L_gcm_gmult_4bit_mmx_begin:
+	pushl	%ebp
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+	movl	20(%esp),%edi
+	movl	24(%esp),%esi
+	call	.L005pic_point
+.L005pic_point:
+	popl	%eax
+	leal	.Lrem_4bit-.L005pic_point(%eax),%eax
+	movzbl	15(%edi),%ebx
+	xorl	%ecx,%ecx
+	movl	%ebx,%edx
+	movb	%dl,%cl
+	movl	$14,%ebp
+	shlb	$4,%cl
+	andl	$240,%edx
+	movq	8(%esi,%ecx,1),%mm0
+	movq	(%esi,%ecx,1),%mm1
+	movd	%mm0,%ebx
+	jmp	.L006mmx_loop
+.align	16
+.L006mmx_loop:
+	psrlq	$4,%mm0
+	andl	$15,%ebx
+	movq	%mm1,%mm2
+	psrlq	$4,%mm1
+	pxor	8(%esi,%edx,1),%mm0
+	movb	(%edi,%ebp,1),%cl
+	psllq	$60,%mm2
+	pxor	(%eax,%ebx,8),%mm1
+	decl	%ebp
+	movd	%mm0,%ebx
+	pxor	(%esi,%edx,1),%mm1
+	movl	%ecx,%edx
+	pxor	%mm2,%mm0
+	js	.L007mmx_break
+	shlb	$4,%cl
+	andl	$15,%ebx
+	psrlq	$4,%mm0
+	andl	$240,%edx
+	movq	%mm1,%mm2
+	psrlq	$4,%mm1
+	pxor	8(%esi,%ecx,1),%mm0
+	psllq	$60,%mm2
+	pxor	(%eax,%ebx,8),%mm1
+	movd	%mm0,%ebx
+	pxor	(%esi,%ecx,1),%mm1
+	pxor	%mm2,%mm0
+	jmp	.L006mmx_loop
+.align	16
+.L007mmx_break:
+	shlb	$4,%cl
+	andl	$15,%ebx
+	psrlq	$4,%mm0
+	andl	$240,%edx
+	movq	%mm1,%mm2
+	psrlq	$4,%mm1
+	pxor	8(%esi,%ecx,1),%mm0
+	psllq	$60,%mm2
+	pxor	(%eax,%ebx,8),%mm1
+	movd	%mm0,%ebx
+	pxor	(%esi,%ecx,1),%mm1
+	pxor	%mm2,%mm0
+	psrlq	$4,%mm0
+	andl	$15,%ebx
+	movq	%mm1,%mm2
+	psrlq	$4,%mm1
+	pxor	8(%esi,%edx,1),%mm0
+	psllq	$60,%mm2
+	pxor	(%eax,%ebx,8),%mm1
+	movd	%mm0,%ebx
+	pxor	(%esi,%edx,1),%mm1
+	pxor	%mm2,%mm0
+	psrlq	$32,%mm0
+	movd	%mm1,%edx
+	psrlq	$32,%mm1
+	movd	%mm0,%ecx
+	movd	%mm1,%ebp
+	bswap	%ebx
+	bswap	%edx
+	bswap	%ecx
+	bswap	%ebp
+	emms
+	movl	%ebx,12(%edi)
+	movl	%edx,4(%edi)
+	movl	%ecx,8(%edi)
+	movl	%ebp,(%edi)
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.size	gcm_gmult_4bit_mmx,.-.L_gcm_gmult_4bit_mmx_begin
+.globl	gcm_ghash_4bit_mmx
+.hidden	gcm_ghash_4bit_mmx
+.type	gcm_ghash_4bit_mmx,@function
+.align	16
+gcm_ghash_4bit_mmx:
+.L_gcm_ghash_4bit_mmx_begin:
+	pushl	%ebp
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+	movl	20(%esp),%eax
+	movl	24(%esp),%ebx
+	movl	28(%esp),%ecx
+	movl	32(%esp),%edx
+	movl	%esp,%ebp
+	call	.L008pic_point
+.L008pic_point:
+	popl	%esi
+	leal	.Lrem_8bit-.L008pic_point(%esi),%esi
+	subl	$544,%esp
+	andl	$-64,%esp
+	subl	$16,%esp
+	addl	%ecx,%edx
+	movl	%eax,544(%esp)
+	movl	%edx,552(%esp)
+	movl	%ebp,556(%esp)
+	addl	$128,%ebx
+	leal	144(%esp),%edi
+	leal	400(%esp),%ebp
+	movl	-120(%ebx),%edx
+	movq	-120(%ebx),%mm0
+	movq	-128(%ebx),%mm3
+	shll	$4,%edx
+	movb	%dl,(%esp)
+	movl	-104(%ebx),%edx
+	movq	-104(%ebx),%mm2
+	movq	-112(%ebx),%mm5
+	movq	%mm0,-128(%edi)
+	psrlq	$4,%mm0
+	movq	%mm3,(%edi)
+	movq	%mm3,%mm7
+	psrlq	$4,%mm3
+	shll	$4,%edx
+	movb	%dl,1(%esp)
+	movl	-88(%ebx),%edx
+	movq	-88(%ebx),%mm1
+	psllq	$60,%mm7
+	movq	-96(%ebx),%mm4
+	por	%mm7,%mm0
+	movq	%mm2,-120(%edi)
+	psrlq	$4,%mm2
+	movq	%mm5,8(%edi)
+	movq	%mm5,%mm6
+	movq	%mm0,-128(%ebp)
+	psrlq	$4,%mm5
+	movq	%mm3,(%ebp)
+	shll	$4,%edx
+	movb	%dl,2(%esp)
+	movl	-72(%ebx),%edx
+	movq	-72(%ebx),%mm0
+	psllq	$60,%mm6
+	movq	-80(%ebx),%mm3
+	por	%mm6,%mm2
+	movq	%mm1,-112(%edi)
+	psrlq	$4,%mm1
+	movq	%mm4,16(%edi)
+	movq	%mm4,%mm7
+	movq	%mm2,-120(%ebp)
+	psrlq	$4,%mm4
+	movq	%mm5,8(%ebp)
+	shll	$4,%edx
+	movb	%dl,3(%esp)
+	movl	-56(%ebx),%edx
+	movq	-56(%ebx),%mm2
+	psllq	$60,%mm7
+	movq	-64(%ebx),%mm5
+	por	%mm7,%mm1
+	movq	%mm0,-104(%edi)
+	psrlq	$4,%mm0
+	movq	%mm3,24(%edi)
+	movq	%mm3,%mm6
+	movq	%mm1,-112(%ebp)
+	psrlq	$4,%mm3
+	movq	%mm4,16(%ebp)
+	shll	$4,%edx
+	movb	%dl,4(%esp)
+	movl	-40(%ebx),%edx
+	movq	-40(%ebx),%mm1
+	psllq	$60,%mm6
+	movq	-48(%ebx),%mm4
+	por	%mm6,%mm0
+	movq	%mm2,-96(%edi)
+	psrlq	$4,%mm2
+	movq	%mm5,32(%edi)
+	movq	%mm5,%mm7
+	movq	%mm0,-104(%ebp)
+	psrlq	$4,%mm5
+	movq	%mm3,24(%ebp)
+	shll	$4,%edx
+	movb	%dl,5(%esp)
+	movl	-24(%ebx),%edx
+	movq	-24(%ebx),%mm0
+	psllq	$60,%mm7
+	movq	-32(%ebx),%mm3
+	por	%mm7,%mm2
+	movq	%mm1,-88(%edi)
+	psrlq	$4,%mm1
+	movq	%mm4,40(%edi)
+	movq	%mm4,%mm6
+	movq	%mm2,-96(%ebp)
+	psrlq	$4,%mm4
+	movq	%mm5,32(%ebp)
+	shll	$4,%edx
+	movb	%dl,6(%esp)
+	movl	-8(%ebx),%edx
+	movq	-8(%ebx),%mm2
+	psllq	$60,%mm6
+	movq	-16(%ebx),%mm5
+	por	%mm6,%mm1
+	movq	%mm0,-80(%edi)
+	psrlq	$4,%mm0
+	movq	%mm3,48(%edi)
+	movq	%mm3,%mm7
+	movq	%mm1,-88(%ebp)
+	psrlq	$4,%mm3
+	movq	%mm4,40(%ebp)
+	shll	$4,%edx
+	movb	%dl,7(%esp)
+	movl	8(%ebx),%edx
+	movq	8(%ebx),%mm1
+	psllq	$60,%mm7
+	movq	(%ebx),%mm4
+	por	%mm7,%mm0
+	movq	%mm2,-72(%edi)
+	psrlq	$4,%mm2
+	movq	%mm5,56(%edi)
+	movq	%mm5,%mm6
+	movq	%mm0,-80(%ebp)
+	psrlq	$4,%mm5
+	movq	%mm3,48(%ebp)
+	shll	$4,%edx
+	movb	%dl,8(%esp)
+	movl	24(%ebx),%edx
+	movq	24(%ebx),%mm0
+	psllq	$60,%mm6
+	movq	16(%ebx),%mm3
+	por	%mm6,%mm2
+	movq	%mm1,-64(%edi)
+	psrlq	$4,%mm1
+	movq	%mm4,64(%edi)
+	movq	%mm4,%mm7
+	movq	%mm2,-72(%ebp)
+	psrlq	$4,%mm4
+	movq	%mm5,56(%ebp)
+	shll	$4,%edx
+	movb	%dl,9(%esp)
+	movl	40(%ebx),%edx
+	movq	40(%ebx),%mm2
+	psllq	$60,%mm7
+	movq	32(%ebx),%mm5
+	por	%mm7,%mm1
+	movq	%mm0,-56(%edi)
+	psrlq	$4,%mm0
+	movq	%mm3,72(%edi)
+	movq	%mm3,%mm6
+	movq	%mm1,-64(%ebp)
+	psrlq	$4,%mm3
+	movq	%mm4,64(%ebp)
+	shll	$4,%edx
+	movb	%dl,10(%esp)
+	movl	56(%ebx),%edx
+	movq	56(%ebx),%mm1
+	psllq	$60,%mm6
+	movq	48(%ebx),%mm4
+	por	%mm6,%mm0
+	movq	%mm2,-48(%edi)
+	psrlq	$4,%mm2
+	movq	%mm5,80(%edi)
+	movq	%mm5,%mm7
+	movq	%mm0,-56(%ebp)
+	psrlq	$4,%mm5
+	movq	%mm3,72(%ebp)
+	shll	$4,%edx
+	movb	%dl,11(%esp)
+	movl	72(%ebx),%edx
+	movq	72(%ebx),%mm0
+	psllq	$60,%mm7
+	movq	64(%ebx),%mm3
+	por	%mm7,%mm2
+	movq	%mm1,-40(%edi)
+	psrlq	$4,%mm1
+	movq	%mm4,88(%edi)
+	movq	%mm4,%mm6
+	movq	%mm2,-48(%ebp)
+	psrlq	$4,%mm4
+	movq	%mm5,80(%ebp)
+	shll	$4,%edx
+	movb	%dl,12(%esp)
+	movl	88(%ebx),%edx
+	movq	88(%ebx),%mm2
+	psllq	$60,%mm6
+	movq	80(%ebx),%mm5
+	por	%mm6,%mm1
+	movq	%mm0,-32(%edi)
+	psrlq	$4,%mm0
+	movq	%mm3,96(%edi)
+	movq	%mm3,%mm7
+	movq	%mm1,-40(%ebp)
+	psrlq	$4,%mm3
+	movq	%mm4,88(%ebp)
+	shll	$4,%edx
+	movb	%dl,13(%esp)
+	movl	104(%ebx),%edx
+	movq	104(%ebx),%mm1
+	psllq	$60,%mm7
+	movq	96(%ebx),%mm4
+	por	%mm7,%mm0
+	movq	%mm2,-24(%edi)
+	psrlq	$4,%mm2
+	movq	%mm5,104(%edi)
+	movq	%mm5,%mm6
+	movq	%mm0,-32(%ebp)
+	psrlq	$4,%mm5
+	movq	%mm3,96(%ebp)
+	shll	$4,%edx
+	movb	%dl,14(%esp)
+	movl	120(%ebx),%edx
+	movq	120(%ebx),%mm0
+	psllq	$60,%mm6
+	movq	112(%ebx),%mm3
+	por	%mm6,%mm2
+	movq	%mm1,-16(%edi)
+	psrlq	$4,%mm1
+	movq	%mm4,112(%edi)
+	movq	%mm4,%mm7
+	movq	%mm2,-24(%ebp)
+	psrlq	$4,%mm4
+	movq	%mm5,104(%ebp)
+	shll	$4,%edx
+	movb	%dl,15(%esp)
+	psllq	$60,%mm7
+	por	%mm7,%mm1
+	movq	%mm0,-8(%edi)
+	psrlq	$4,%mm0
+	movq	%mm3,120(%edi)
+	movq	%mm3,%mm6
+	movq	%mm1,-16(%ebp)
+	psrlq	$4,%mm3
+	movq	%mm4,112(%ebp)
+	psllq	$60,%mm6
+	por	%mm6,%mm0
+	movq	%mm0,-8(%ebp)
+	movq	%mm3,120(%ebp)
+	movq	(%eax),%mm6
+	movl	8(%eax),%ebx
+	movl	12(%eax),%edx
+.align	16
+.L009outer:
+	xorl	12(%ecx),%edx
+	xorl	8(%ecx),%ebx
+	pxor	(%ecx),%mm6
+	leal	16(%ecx),%ecx
+	movl	%ebx,536(%esp)
+	movq	%mm6,528(%esp)
+	movl	%ecx,548(%esp)
+	xorl	%eax,%eax
+	roll	$8,%edx
+	movb	%dl,%al
+	movl	%eax,%ebp
+	andb	$15,%al
+	shrl	$4,%ebp
+	pxor	%mm0,%mm0
+	roll	$8,%edx
+	pxor	%mm1,%mm1
+	pxor	%mm2,%mm2
+	movq	16(%esp,%eax,8),%mm7
+	movq	144(%esp,%eax,8),%mm6
+	movb	%dl,%al
+	movd	%mm7,%ebx
+	psrlq	$8,%mm7
+	movq	%mm6,%mm3
+	movl	%eax,%edi
+	psrlq	$8,%mm6
+	pxor	272(%esp,%ebp,8),%mm7
+	andb	$15,%al
+	psllq	$56,%mm3
+	shrl	$4,%edi
+	pxor	16(%esp,%eax,8),%mm7
+	roll	$8,%edx
+	pxor	144(%esp,%eax,8),%mm6
+	pxor	%mm3,%mm7
+	pxor	400(%esp,%ebp,8),%mm6
+	xorb	(%esp,%ebp,1),%bl
+	movb	%dl,%al
+	movd	%mm7,%ecx
+	movzbl	%bl,%ebx
+	psrlq	$8,%mm7
+	movq	%mm6,%mm3
+	movl	%eax,%ebp
+	psrlq	$8,%mm6
+	pxor	272(%esp,%edi,8),%mm7
+	andb	$15,%al
+	psllq	$56,%mm3
+	shrl	$4,%ebp
+	pinsrw	$2,(%esi,%ebx,2),%mm2
+	pxor	16(%esp,%eax,8),%mm7
+	roll	$8,%edx
+	pxor	144(%esp,%eax,8),%mm6
+	pxor	%mm3,%mm7
+	pxor	400(%esp,%edi,8),%mm6
+	xorb	(%esp,%edi,1),%cl
+	movb	%dl,%al
+	movl	536(%esp),%edx
+	movd	%mm7,%ebx
+	movzbl	%cl,%ecx
+	psrlq	$8,%mm7
+	movq	%mm6,%mm3
+	movl	%eax,%edi
+	psrlq	$8,%mm6
+	pxor	272(%esp,%ebp,8),%mm7
+	andb	$15,%al
+	psllq	$56,%mm3
+	pxor	%mm2,%mm6
+	shrl	$4,%edi
+	pinsrw	$2,(%esi,%ecx,2),%mm1
+	pxor	16(%esp,%eax,8),%mm7
+	roll	$8,%edx
+	pxor	144(%esp,%eax,8),%mm6
+	pxor	%mm3,%mm7
+	pxor	400(%esp,%ebp,8),%mm6
+	xorb	(%esp,%ebp,1),%bl
+	movb	%dl,%al
+	movd	%mm7,%ecx
+	movzbl	%bl,%ebx
+	psrlq	$8,%mm7
+	movq	%mm6,%mm3
+	movl	%eax,%ebp
+	psrlq	$8,%mm6
+	pxor	272(%esp,%edi,8),%mm7
+	andb	$15,%al
+	psllq	$56,%mm3
+	pxor	%mm1,%mm6
+	shrl	$4,%ebp
+	pinsrw	$2,(%esi,%ebx,2),%mm0
+	pxor	16(%esp,%eax,8),%mm7
+	roll	$8,%edx
+	pxor	144(%esp,%eax,8),%mm6
+	pxor	%mm3,%mm7
+	pxor	400(%esp,%edi,8),%mm6
+	xorb	(%esp,%edi,1),%cl
+	movb	%dl,%al
+	movd	%mm7,%ebx
+	movzbl	%cl,%ecx
+	psrlq	$8,%mm7
+	movq	%mm6,%mm3
+	movl	%eax,%edi
+	psrlq	$8,%mm6
+	pxor	272(%esp,%ebp,8),%mm7
+	andb	$15,%al
+	psllq	$56,%mm3
+	pxor	%mm0,%mm6
+	shrl	$4,%edi
+	pinsrw	$2,(%esi,%ecx,2),%mm2
+	pxor	16(%esp,%eax,8),%mm7
+	roll	$8,%edx
+	pxor	144(%esp,%eax,8),%mm6
+	pxor	%mm3,%mm7
+	pxor	400(%esp,%ebp,8),%mm6
+	xorb	(%esp,%ebp,1),%bl
+	movb	%dl,%al
+	movd	%mm7,%ecx
+	movzbl	%bl,%ebx
+	psrlq	$8,%mm7
+	movq	%mm6,%mm3
+	movl	%eax,%ebp
+	psrlq	$8,%mm6
+	pxor	272(%esp,%edi,8),%mm7
+	andb	$15,%al
+	psllq	$56,%mm3
+	pxor	%mm2,%mm6
+	shrl	$4,%ebp
+	pinsrw	$2,(%esi,%ebx,2),%mm1
+	pxor	16(%esp,%eax,8),%mm7
+	roll	$8,%edx
+	pxor	144(%esp,%eax,8),%mm6
+	pxor	%mm3,%mm7
+	pxor	400(%esp,%edi,8),%mm6
+	xorb	(%esp,%edi,1),%cl
+	movb	%dl,%al
+	movl	532(%esp),%edx
+	movd	%mm7,%ebx
+	movzbl	%cl,%ecx
+	psrlq	$8,%mm7
+	movq	%mm6,%mm3
+	movl	%eax,%edi
+	psrlq	$8,%mm6
+	pxor	272(%esp,%ebp,8),%mm7
+	andb	$15,%al
+	psllq	$56,%mm3
+	pxor	%mm1,%mm6
+	shrl	$4,%edi
+	pinsrw	$2,(%esi,%ecx,2),%mm0
+	pxor	16(%esp,%eax,8),%mm7
+	roll	$8,%edx
+	pxor	144(%esp,%eax,8),%mm6
+	pxor	%mm3,%mm7
+	pxor	400(%esp,%ebp,8),%mm6
+	xorb	(%esp,%ebp,1),%bl
+	movb	%dl,%al
+	movd	%mm7,%ecx
+	movzbl	%bl,%ebx
+	psrlq	$8,%mm7
+	movq	%mm6,%mm3
+	movl	%eax,%ebp
+	psrlq	$8,%mm6
+	pxor	272(%esp,%edi,8),%mm7
+	andb	$15,%al
+	psllq	$56,%mm3
+	pxor	%mm0,%mm6
+	shrl	$4,%ebp
+	pinsrw	$2,(%esi,%ebx,2),%mm2
+	pxor	16(%esp,%eax,8),%mm7
+	roll	$8,%edx
+	pxor	144(%esp,%eax,8),%mm6
+	pxor	%mm3,%mm7
+	pxor	400(%esp,%edi,8),%mm6
+	xorb	(%esp,%edi,1),%cl
+	movb	%dl,%al
+	movd	%mm7,%ebx
+	movzbl	%cl,%ecx
+	psrlq	$8,%mm7
+	movq	%mm6,%mm3
+	movl	%eax,%edi
+	psrlq	$8,%mm6
+	pxor	272(%esp,%ebp,8),%mm7
+	andb	$15,%al
+	psllq	$56,%mm3
+	pxor	%mm2,%mm6
+	shrl	$4,%edi
+	pinsrw	$2,(%esi,%ecx,2),%mm1
+	pxor	16(%esp,%eax,8),%mm7
+	roll	$8,%edx
+	pxor	144(%esp,%eax,8),%mm6
+	pxor	%mm3,%mm7
+	pxor	400(%esp,%ebp,8),%mm6
+	xorb	(%esp,%ebp,1),%bl
+	movb	%dl,%al
+	movd	%mm7,%ecx
+	movzbl	%bl,%ebx
+	psrlq	$8,%mm7
+	movq	%mm6,%mm3
+	movl	%eax,%ebp
+	psrlq	$8,%mm6
+	pxor	272(%esp,%edi,8),%mm7
+	andb	$15,%al
+	psllq	$56,%mm3
+	pxor	%mm1,%mm6
+	shrl	$4,%ebp
+	pinsrw	$2,(%esi,%ebx,2),%mm0
+	pxor	16(%esp,%eax,8),%mm7
+	roll	$8,%edx
+	pxor	144(%esp,%eax,8),%mm6
+	pxor	%mm3,%mm7
+	pxor	400(%esp,%edi,8),%mm6
+	xorb	(%esp,%edi,1),%cl
+	movb	%dl,%al
+	movl	528(%esp),%edx
+	movd	%mm7,%ebx
+	movzbl	%cl,%ecx
+	psrlq	$8,%mm7
+	movq	%mm6,%mm3
+	movl	%eax,%edi
+	psrlq	$8,%mm6
+	pxor	272(%esp,%ebp,8),%mm7
+	andb	$15,%al
+	psllq	$56,%mm3
+	pxor	%mm0,%mm6
+	shrl	$4,%edi
+	pinsrw	$2,(%esi,%ecx,2),%mm2
+	pxor	16(%esp,%eax,8),%mm7
+	roll	$8,%edx
+	pxor	144(%esp,%eax,8),%mm6
+	pxor	%mm3,%mm7
+	pxor	400(%esp,%ebp,8),%mm6
+	xorb	(%esp,%ebp,1),%bl
+	movb	%dl,%al
+	movd	%mm7,%ecx
+	movzbl	%bl,%ebx
+	psrlq	$8,%mm7
+	movq	%mm6,%mm3
+	movl	%eax,%ebp
+	psrlq	$8,%mm6
+	pxor	272(%esp,%edi,8),%mm7
+	andb	$15,%al
+	psllq	$56,%mm3
+	pxor	%mm2,%mm6
+	shrl	$4,%ebp
+	pinsrw	$2,(%esi,%ebx,2),%mm1
+	pxor	16(%esp,%eax,8),%mm7
+	roll	$8,%edx
+	pxor	144(%esp,%eax,8),%mm6
+	pxor	%mm3,%mm7
+	pxor	400(%esp,%edi,8),%mm6
+	xorb	(%esp,%edi,1),%cl
+	movb	%dl,%al
+	movd	%mm7,%ebx
+	movzbl	%cl,%ecx
+	psrlq	$8,%mm7
+	movq	%mm6,%mm3
+	movl	%eax,%edi
+	psrlq	$8,%mm6
+	pxor	272(%esp,%ebp,8),%mm7
+	andb	$15,%al
+	psllq	$56,%mm3
+	pxor	%mm1,%mm6
+	shrl	$4,%edi
+	pinsrw	$2,(%esi,%ecx,2),%mm0
+	pxor	16(%esp,%eax,8),%mm7
+	roll	$8,%edx
+	pxor	144(%esp,%eax,8),%mm6
+	pxor	%mm3,%mm7
+	pxor	400(%esp,%ebp,8),%mm6
+	xorb	(%esp,%ebp,1),%bl
+	movb	%dl,%al
+	movd	%mm7,%ecx
+	movzbl	%bl,%ebx
+	psrlq	$8,%mm7
+	movq	%mm6,%mm3
+	movl	%eax,%ebp
+	psrlq	$8,%mm6
+	pxor	272(%esp,%edi,8),%mm7
+	andb	$15,%al
+	psllq	$56,%mm3
+	pxor	%mm0,%mm6
+	shrl	$4,%ebp
+	pinsrw	$2,(%esi,%ebx,2),%mm2
+	pxor	16(%esp,%eax,8),%mm7
+	roll	$8,%edx
+	pxor	144(%esp,%eax,8),%mm6
+	pxor	%mm3,%mm7
+	pxor	400(%esp,%edi,8),%mm6
+	xorb	(%esp,%edi,1),%cl
+	movb	%dl,%al
+	movl	524(%esp),%edx
+	movd	%mm7,%ebx
+	movzbl	%cl,%ecx
+	psrlq	$8,%mm7
+	movq	%mm6,%mm3
+	movl	%eax,%edi
+	psrlq	$8,%mm6
+	pxor	272(%esp,%ebp,8),%mm7
+	andb	$15,%al
+	psllq	$56,%mm3
+	pxor	%mm2,%mm6
+	shrl	$4,%edi
+	pinsrw	$2,(%esi,%ecx,2),%mm1
+	pxor	16(%esp,%eax,8),%mm7
+	pxor	144(%esp,%eax,8),%mm6
+	xorb	(%esp,%ebp,1),%bl
+	pxor	%mm3,%mm7
+	pxor	400(%esp,%ebp,8),%mm6
+	movzbl	%bl,%ebx
+	pxor	%mm2,%mm2
+	psllq	$4,%mm1
+	movd	%mm7,%ecx
+	psrlq	$4,%mm7
+	movq	%mm6,%mm3
+	psrlq	$4,%mm6
+	shll	$4,%ecx
+	pxor	16(%esp,%edi,8),%mm7
+	psllq	$60,%mm3
+	movzbl	%cl,%ecx
+	pxor	%mm3,%mm7
+	pxor	144(%esp,%edi,8),%mm6
+	pinsrw	$2,(%esi,%ebx,2),%mm0
+	pxor	%mm1,%mm6
+	movd	%mm7,%edx
+	pinsrw	$3,(%esi,%ecx,2),%mm2
+	psllq	$12,%mm0
+	pxor	%mm0,%mm6
+	psrlq	$32,%mm7
+	pxor	%mm2,%mm6
+	movl	548(%esp),%ecx
+	movd	%mm7,%ebx
+	movq	%mm6,%mm3
+	psllw	$8,%mm6
+	psrlw	$8,%mm3
+	por	%mm3,%mm6
+	bswap	%edx
+	pshufw	$27,%mm6,%mm6
+	bswap	%ebx
+	cmpl	552(%esp),%ecx
+	jne	.L009outer
+	movl	544(%esp),%eax
+	movl	%edx,12(%eax)
+	movl	%ebx,8(%eax)
+	movq	%mm6,(%eax)
+	movl	556(%esp),%esp
+	emms
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.size	gcm_ghash_4bit_mmx,.-.L_gcm_ghash_4bit_mmx_begin
+.globl	gcm_init_clmul
+.hidden	gcm_init_clmul
+.type	gcm_init_clmul,@function
+.align	16
+gcm_init_clmul:
+.L_gcm_init_clmul_begin:
+	movl	4(%esp),%edx
+	movl	8(%esp),%eax
+	call	.L010pic
+.L010pic:
+	popl	%ecx
+	leal	.Lbswap-.L010pic(%ecx),%ecx
+	movdqu	(%eax),%xmm2
+	pshufd	$78,%xmm2,%xmm2
+	pshufd	$255,%xmm2,%xmm4
+	movdqa	%xmm2,%xmm3
+	psllq	$1,%xmm2
+	pxor	%xmm5,%xmm5
+	psrlq	$63,%xmm3
+	pcmpgtd	%xmm4,%xmm5
+	pslldq	$8,%xmm3
+	por	%xmm3,%xmm2
+	pand	16(%ecx),%xmm5
+	pxor	%xmm5,%xmm2
+	movdqa	%xmm2,%xmm0
+	movdqa	%xmm0,%xmm1
+	pshufd	$78,%xmm0,%xmm3
+	pshufd	$78,%xmm2,%xmm4
+	pxor	%xmm0,%xmm3
+	pxor	%xmm2,%xmm4
+.byte	102,15,58,68,194,0
+.byte	102,15,58,68,202,17
+.byte	102,15,58,68,220,0
+	xorps	%xmm0,%xmm3
+	xorps	%xmm1,%xmm3
+	movdqa	%xmm3,%xmm4
+	psrldq	$8,%xmm3
+	pslldq	$8,%xmm4
+	pxor	%xmm3,%xmm1
+	pxor	%xmm4,%xmm0
+	movdqa	%xmm0,%xmm4
+	movdqa	%xmm0,%xmm3
+	psllq	$5,%xmm0
+	pxor	%xmm0,%xmm3
+	psllq	$1,%xmm0
+	pxor	%xmm3,%xmm0
+	psllq	$57,%xmm0
+	movdqa	%xmm0,%xmm3
+	pslldq	$8,%xmm0
+	psrldq	$8,%xmm3
+	pxor	%xmm4,%xmm0
+	pxor	%xmm3,%xmm1
+	movdqa	%xmm0,%xmm4
+	psrlq	$1,%xmm0
+	pxor	%xmm4,%xmm1
+	pxor	%xmm0,%xmm4
+	psrlq	$5,%xmm0
+	pxor	%xmm4,%xmm0
+	psrlq	$1,%xmm0
+	pxor	%xmm1,%xmm0
+	pshufd	$78,%xmm2,%xmm3
+	pshufd	$78,%xmm0,%xmm4
+	pxor	%xmm2,%xmm3
+	movdqu	%xmm2,(%edx)
+	pxor	%xmm0,%xmm4
+	movdqu	%xmm0,16(%edx)
+.byte	102,15,58,15,227,8
+	movdqu	%xmm4,32(%edx)
+	ret
+.size	gcm_init_clmul,.-.L_gcm_init_clmul_begin
+.globl	gcm_gmult_clmul
+.hidden	gcm_gmult_clmul
+.type	gcm_gmult_clmul,@function
+.align	16
+gcm_gmult_clmul:
+.L_gcm_gmult_clmul_begin:
+	movl	4(%esp),%eax
+	movl	8(%esp),%edx
+	call	.L011pic
+.L011pic:
+	popl	%ecx
+	leal	.Lbswap-.L011pic(%ecx),%ecx
+	movdqu	(%eax),%xmm0
+	movdqa	(%ecx),%xmm5
+	movups	(%edx),%xmm2
+.byte	102,15,56,0,197
+	movups	32(%edx),%xmm4
+	movdqa	%xmm0,%xmm1
+	pshufd	$78,%xmm0,%xmm3
+	pxor	%xmm0,%xmm3
+.byte	102,15,58,68,194,0
+.byte	102,15,58,68,202,17
+.byte	102,15,58,68,220,0
+	xorps	%xmm0,%xmm3
+	xorps	%xmm1,%xmm3
+	movdqa	%xmm3,%xmm4
+	psrldq	$8,%xmm3
+	pslldq	$8,%xmm4
+	pxor	%xmm3,%xmm1
+	pxor	%xmm4,%xmm0
+	movdqa	%xmm0,%xmm4
+	movdqa	%xmm0,%xmm3
+	psllq	$5,%xmm0
+	pxor	%xmm0,%xmm3
+	psllq	$1,%xmm0
+	pxor	%xmm3,%xmm0
+	psllq	$57,%xmm0
+	movdqa	%xmm0,%xmm3
+	pslldq	$8,%xmm0
+	psrldq	$8,%xmm3
+	pxor	%xmm4,%xmm0
+	pxor	%xmm3,%xmm1
+	movdqa	%xmm0,%xmm4
+	psrlq	$1,%xmm0
+	pxor	%xmm4,%xmm1
+	pxor	%xmm0,%xmm4
+	psrlq	$5,%xmm0
+	pxor	%xmm4,%xmm0
+	psrlq	$1,%xmm0
+	pxor	%xmm1,%xmm0
+.byte	102,15,56,0,197
+	movdqu	%xmm0,(%eax)
+	ret
+.size	gcm_gmult_clmul,.-.L_gcm_gmult_clmul_begin
+.globl	gcm_ghash_clmul
+.hidden	gcm_ghash_clmul
+.type	gcm_ghash_clmul,@function
+.align	16
+gcm_ghash_clmul:
+.L_gcm_ghash_clmul_begin:
+	pushl	%ebp
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+	movl	20(%esp),%eax
+	movl	24(%esp),%edx
+	movl	28(%esp),%esi
+	movl	32(%esp),%ebx
+	call	.L012pic
+.L012pic:
+	popl	%ecx
+	leal	.Lbswap-.L012pic(%ecx),%ecx
+	movdqu	(%eax),%xmm0
+	movdqa	(%ecx),%xmm5
+	movdqu	(%edx),%xmm2
+.byte	102,15,56,0,197
+	subl	$16,%ebx
+	jz	.L013odd_tail
+	movdqu	(%esi),%xmm3
+	movdqu	16(%esi),%xmm6
+.byte	102,15,56,0,221
+.byte	102,15,56,0,245
+	movdqu	32(%edx),%xmm5
+	pxor	%xmm3,%xmm0
+	pshufd	$78,%xmm6,%xmm3
+	movdqa	%xmm6,%xmm7
+	pxor	%xmm6,%xmm3
+	leal	32(%esi),%esi
+.byte	102,15,58,68,242,0
+.byte	102,15,58,68,250,17
+.byte	102,15,58,68,221,0
+	movups	16(%edx),%xmm2
+	nop
+	subl	$32,%ebx
+	jbe	.L014even_tail
+	jmp	.L015mod_loop
+.align	32
+.L015mod_loop:
+	pshufd	$78,%xmm0,%xmm4
+	movdqa	%xmm0,%xmm1
+	pxor	%xmm0,%xmm4
+	nop
+.byte	102,15,58,68,194,0
+.byte	102,15,58,68,202,17
+.byte	102,15,58,68,229,16
+	movups	(%edx),%xmm2
+	xorps	%xmm6,%xmm0
+	movdqa	(%ecx),%xmm5
+	xorps	%xmm7,%xmm1
+	movdqu	(%esi),%xmm7
+	pxor	%xmm0,%xmm3
+	movdqu	16(%esi),%xmm6
+	pxor	%xmm1,%xmm3
+.byte	102,15,56,0,253
+	pxor	%xmm3,%xmm4
+	movdqa	%xmm4,%xmm3
+	psrldq	$8,%xmm4
+	pslldq	$8,%xmm3
+	pxor	%xmm4,%xmm1
+	pxor	%xmm3,%xmm0
+.byte	102,15,56,0,245
+	pxor	%xmm7,%xmm1
+	movdqa	%xmm6,%xmm7
+	movdqa	%xmm0,%xmm4
+	movdqa	%xmm0,%xmm3
+	psllq	$5,%xmm0
+	pxor	%xmm0,%xmm3
+	psllq	$1,%xmm0
+	pxor	%xmm3,%xmm0
+.byte	102,15,58,68,242,0
+	movups	32(%edx),%xmm5
+	psllq	$57,%xmm0
+	movdqa	%xmm0,%xmm3
+	pslldq	$8,%xmm0
+	psrldq	$8,%xmm3
+	pxor	%xmm4,%xmm0
+	pxor	%xmm3,%xmm1
+	pshufd	$78,%xmm7,%xmm3
+	movdqa	%xmm0,%xmm4
+	psrlq	$1,%xmm0
+	pxor	%xmm7,%xmm3
+	pxor	%xmm4,%xmm1
+.byte	102,15,58,68,250,17
+	movups	16(%edx),%xmm2
+	pxor	%xmm0,%xmm4
+	psrlq	$5,%xmm0
+	pxor	%xmm4,%xmm0
+	psrlq	$1,%xmm0
+	pxor	%xmm1,%xmm0
+.byte	102,15,58,68,221,0
+	leal	32(%esi),%esi
+	subl	$32,%ebx
+	ja	.L015mod_loop
+.L014even_tail:
+	pshufd	$78,%xmm0,%xmm4
+	movdqa	%xmm0,%xmm1
+	pxor	%xmm0,%xmm4
+.byte	102,15,58,68,194,0
+.byte	102,15,58,68,202,17
+.byte	102,15,58,68,229,16
+	movdqa	(%ecx),%xmm5
+	xorps	%xmm6,%xmm0
+	xorps	%xmm7,%xmm1
+	pxor	%xmm0,%xmm3
+	pxor	%xmm1,%xmm3
+	pxor	%xmm3,%xmm4
+	movdqa	%xmm4,%xmm3
+	psrldq	$8,%xmm4
+	pslldq	$8,%xmm3
+	pxor	%xmm4,%xmm1
+	pxor	%xmm3,%xmm0
+	movdqa	%xmm0,%xmm4
+	movdqa	%xmm0,%xmm3
+	psllq	$5,%xmm0
+	pxor	%xmm0,%xmm3
+	psllq	$1,%xmm0
+	pxor	%xmm3,%xmm0
+	psllq	$57,%xmm0
+	movdqa	%xmm0,%xmm3
+	pslldq	$8,%xmm0
+	psrldq	$8,%xmm3
+	pxor	%xmm4,%xmm0
+	pxor	%xmm3,%xmm1
+	movdqa	%xmm0,%xmm4
+	psrlq	$1,%xmm0
+	pxor	%xmm4,%xmm1
+	pxor	%xmm0,%xmm4
+	psrlq	$5,%xmm0
+	pxor	%xmm4,%xmm0
+	psrlq	$1,%xmm0
+	pxor	%xmm1,%xmm0
+	testl	%ebx,%ebx
+	jnz	.L016done
+	movups	(%edx),%xmm2
+.L013odd_tail:
+	movdqu	(%esi),%xmm3
+.byte	102,15,56,0,221
+	pxor	%xmm3,%xmm0
+	movdqa	%xmm0,%xmm1
+	pshufd	$78,%xmm0,%xmm3
+	pshufd	$78,%xmm2,%xmm4
+	pxor	%xmm0,%xmm3
+	pxor	%xmm2,%xmm4
+.byte	102,15,58,68,194,0
+.byte	102,15,58,68,202,17
+.byte	102,15,58,68,220,0
+	xorps	%xmm0,%xmm3
+	xorps	%xmm1,%xmm3
+	movdqa	%xmm3,%xmm4
+	psrldq	$8,%xmm3
+	pslldq	$8,%xmm4
+	pxor	%xmm3,%xmm1
+	pxor	%xmm4,%xmm0
+	movdqa	%xmm0,%xmm4
+	movdqa	%xmm0,%xmm3
+	psllq	$5,%xmm0
+	pxor	%xmm0,%xmm3
+	psllq	$1,%xmm0
+	pxor	%xmm3,%xmm0
+	psllq	$57,%xmm0
+	movdqa	%xmm0,%xmm3
+	pslldq	$8,%xmm0
+	psrldq	$8,%xmm3
+	pxor	%xmm4,%xmm0
+	pxor	%xmm3,%xmm1
+	movdqa	%xmm0,%xmm4
+	psrlq	$1,%xmm0
+	pxor	%xmm4,%xmm1
+	pxor	%xmm0,%xmm4
+	psrlq	$5,%xmm0
+	pxor	%xmm4,%xmm0
+	psrlq	$1,%xmm0
+	pxor	%xmm1,%xmm0
+.L016done:
+.byte	102,15,56,0,197
+	movdqu	%xmm0,(%eax)
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.size	gcm_ghash_clmul,.-.L_gcm_ghash_clmul_begin
+.align	64
+.Lbswap:
+.byte	15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0
+.byte	1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,194
+.align	64
+.Lrem_8bit:
+.value	0,450,900,582,1800,1738,1164,1358
+.value	3600,4050,3476,3158,2328,2266,2716,2910
+.value	7200,7650,8100,7782,6952,6890,6316,6510
+.value	4656,5106,4532,4214,5432,5370,5820,6014
+.value	14400,14722,15300,14854,16200,16010,15564,15630
+.value	13904,14226,13780,13334,12632,12442,13020,13086
+.value	9312,9634,10212,9766,9064,8874,8428,8494
+.value	10864,11186,10740,10294,11640,11450,12028,12094
+.value	28800,28994,29444,29382,30600,30282,29708,30158
+.value	32400,32594,32020,31958,31128,30810,31260,31710
+.value	27808,28002,28452,28390,27560,27242,26668,27118
+.value	25264,25458,24884,24822,26040,25722,26172,26622
+.value	18624,18690,19268,19078,20424,19978,19532,19854
+.value	18128,18194,17748,17558,16856,16410,16988,17310
+.value	21728,21794,22372,22182,21480,21034,20588,20910
+.value	23280,23346,22900,22710,24056,23610,24188,24510
+.value	57600,57538,57988,58182,58888,59338,58764,58446
+.value	61200,61138,60564,60758,59416,59866,60316,59998
+.value	64800,64738,65188,65382,64040,64490,63916,63598
+.value	62256,62194,61620,61814,62520,62970,63420,63102
+.value	55616,55426,56004,56070,56904,57226,56780,56334
+.value	55120,54930,54484,54550,53336,53658,54236,53790
+.value	50528,50338,50916,50982,49768,50090,49644,49198
+.value	52080,51890,51444,51510,52344,52666,53244,52798
+.value	37248,36930,37380,37830,38536,38730,38156,38094
+.value	40848,40530,39956,40406,39064,39258,39708,39646
+.value	36256,35938,36388,36838,35496,35690,35116,35054
+.value	33712,33394,32820,33270,33976,34170,34620,34558
+.value	43456,43010,43588,43910,44744,44810,44364,44174
+.value	42960,42514,42068,42390,41176,41242,41820,41630
+.value	46560,46114,46692,47014,45800,45866,45420,45230
+.value	48112,47666,47220,47542,48376,48442,49020,48830
+.align	64
+.Lrem_4bit:
+.long	0,0,0,471859200,0,943718400,0,610271232
+.long	0,1887436800,0,1822425088,0,1220542464,0,1423966208
+.long	0,3774873600,0,4246732800,0,3644850176,0,3311403008
+.long	0,2441084928,0,2376073216,0,2847932416,0,3051356160
+.byte	71,72,65,83,72,32,102,111,114,32,120,56,54,44,32,67
+.byte	82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112
+.byte	112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62
+.byte	0
+#endif
diff --git a/third_party/boringssl/linux-x86/crypto/rc4/rc4-586.S b/third_party/boringssl/linux-x86/crypto/rc4/rc4-586.S
new file mode 100644
index 0000000..a5cce47
--- /dev/null
+++ b/third_party/boringssl/linux-x86/crypto/rc4/rc4-586.S
@@ -0,0 +1,385 @@
+#if defined(__i386__)
+.file	"rc4-586.S"
+.text
+.globl	asm_RC4
+.hidden	asm_RC4
+.type	asm_RC4,@function
+.align	16
+asm_RC4:
+.L_asm_RC4_begin:
+	pushl	%ebp
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+	movl	20(%esp),%edi
+	movl	24(%esp),%edx
+	movl	28(%esp),%esi
+	movl	32(%esp),%ebp
+	xorl	%eax,%eax
+	xorl	%ebx,%ebx
+	cmpl	$0,%edx
+	je	.L000abort
+	movb	(%edi),%al
+	movb	4(%edi),%bl
+	addl	$8,%edi
+	leal	(%esi,%edx,1),%ecx
+	subl	%esi,%ebp
+	movl	%ecx,24(%esp)
+	incb	%al
+	cmpl	$-1,256(%edi)
+	je	.L001RC4_CHAR
+	movl	(%edi,%eax,4),%ecx
+	andl	$-4,%edx
+	jz	.L002loop1
+	movl	%ebp,32(%esp)
+	testl	$-8,%edx
+	jz	.L003go4loop4
+	call	.L004PIC_me_up
+.L004PIC_me_up:
+	popl	%ebp
+	leal	OPENSSL_ia32cap_P-.L004PIC_me_up(%ebp),%ebp
+	btl	$26,(%ebp)
+	jnc	.L003go4loop4
+	movl	32(%esp),%ebp
+	andl	$-8,%edx
+	leal	-8(%esi,%edx,1),%edx
+	movl	%edx,-4(%edi)
+	addb	%cl,%bl
+	movl	(%edi,%ebx,4),%edx
+	movl	%ecx,(%edi,%ebx,4)
+	movl	%edx,(%edi,%eax,4)
+	incl	%eax
+	addl	%ecx,%edx
+	movzbl	%al,%eax
+	movzbl	%dl,%edx
+	movq	(%esi),%mm0
+	movl	(%edi,%eax,4),%ecx
+	movd	(%edi,%edx,4),%mm2
+	jmp	.L005loop_mmx_enter
+.align	16
+.L006loop_mmx:
+	addb	%cl,%bl
+	psllq	$56,%mm1
+	movl	(%edi,%ebx,4),%edx
+	movl	%ecx,(%edi,%ebx,4)
+	movl	%edx,(%edi,%eax,4)
+	incl	%eax
+	addl	%ecx,%edx
+	movzbl	%al,%eax
+	movzbl	%dl,%edx
+	pxor	%mm1,%mm2
+	movq	(%esi),%mm0
+	movq	%mm2,-8(%ebp,%esi,1)
+	movl	(%edi,%eax,4),%ecx
+	movd	(%edi,%edx,4),%mm2
+.L005loop_mmx_enter:
+	addb	%cl,%bl
+	movl	(%edi,%ebx,4),%edx
+	movl	%ecx,(%edi,%ebx,4)
+	movl	%edx,(%edi,%eax,4)
+	incl	%eax
+	addl	%ecx,%edx
+	movzbl	%al,%eax
+	movzbl	%dl,%edx
+	pxor	%mm0,%mm2
+	movl	(%edi,%eax,4),%ecx
+	movd	(%edi,%edx,4),%mm1
+	addb	%cl,%bl
+	psllq	$8,%mm1
+	movl	(%edi,%ebx,4),%edx
+	movl	%ecx,(%edi,%ebx,4)
+	movl	%edx,(%edi,%eax,4)
+	incl	%eax
+	addl	%ecx,%edx
+	movzbl	%al,%eax
+	movzbl	%dl,%edx
+	pxor	%mm1,%mm2
+	movl	(%edi,%eax,4),%ecx
+	movd	(%edi,%edx,4),%mm1
+	addb	%cl,%bl
+	psllq	$16,%mm1
+	movl	(%edi,%ebx,4),%edx
+	movl	%ecx,(%edi,%ebx,4)
+	movl	%edx,(%edi,%eax,4)
+	incl	%eax
+	addl	%ecx,%edx
+	movzbl	%al,%eax
+	movzbl	%dl,%edx
+	pxor	%mm1,%mm2
+	movl	(%edi,%eax,4),%ecx
+	movd	(%edi,%edx,4),%mm1
+	addb	%cl,%bl
+	psllq	$24,%mm1
+	movl	(%edi,%ebx,4),%edx
+	movl	%ecx,(%edi,%ebx,4)
+	movl	%edx,(%edi,%eax,4)
+	incl	%eax
+	addl	%ecx,%edx
+	movzbl	%al,%eax
+	movzbl	%dl,%edx
+	pxor	%mm1,%mm2
+	movl	(%edi,%eax,4),%ecx
+	movd	(%edi,%edx,4),%mm1
+	addb	%cl,%bl
+	psllq	$32,%mm1
+	movl	(%edi,%ebx,4),%edx
+	movl	%ecx,(%edi,%ebx,4)
+	movl	%edx,(%edi,%eax,4)
+	incl	%eax
+	addl	%ecx,%edx
+	movzbl	%al,%eax
+	movzbl	%dl,%edx
+	pxor	%mm1,%mm2
+	movl	(%edi,%eax,4),%ecx
+	movd	(%edi,%edx,4),%mm1
+	addb	%cl,%bl
+	psllq	$40,%mm1
+	movl	(%edi,%ebx,4),%edx
+	movl	%ecx,(%edi,%ebx,4)
+	movl	%edx,(%edi,%eax,4)
+	incl	%eax
+	addl	%ecx,%edx
+	movzbl	%al,%eax
+	movzbl	%dl,%edx
+	pxor	%mm1,%mm2
+	movl	(%edi,%eax,4),%ecx
+	movd	(%edi,%edx,4),%mm1
+	addb	%cl,%bl
+	psllq	$48,%mm1
+	movl	(%edi,%ebx,4),%edx
+	movl	%ecx,(%edi,%ebx,4)
+	movl	%edx,(%edi,%eax,4)
+	incl	%eax
+	addl	%ecx,%edx
+	movzbl	%al,%eax
+	movzbl	%dl,%edx
+	pxor	%mm1,%mm2
+	movl	(%edi,%eax,4),%ecx
+	movd	(%edi,%edx,4),%mm1
+	movl	%ebx,%edx
+	xorl	%ebx,%ebx
+	movb	%dl,%bl
+	cmpl	-4(%edi),%esi
+	leal	8(%esi),%esi
+	jb	.L006loop_mmx
+	psllq	$56,%mm1
+	pxor	%mm1,%mm2
+	movq	%mm2,-8(%ebp,%esi,1)
+	emms
+	cmpl	24(%esp),%esi
+	je	.L007done
+	jmp	.L002loop1
+.align	16
+.L003go4loop4:
+	leal	-4(%esi,%edx,1),%edx
+	movl	%edx,28(%esp)
+.L008loop4:
+	addb	%cl,%bl
+	movl	(%edi,%ebx,4),%edx
+	movl	%ecx,(%edi,%ebx,4)
+	movl	%edx,(%edi,%eax,4)
+	addl	%ecx,%edx
+	incb	%al
+	andl	$255,%edx
+	movl	(%edi,%eax,4),%ecx
+	movl	(%edi,%edx,4),%ebp
+	addb	%cl,%bl
+	movl	(%edi,%ebx,4),%edx
+	movl	%ecx,(%edi,%ebx,4)
+	movl	%edx,(%edi,%eax,4)
+	addl	%ecx,%edx
+	incb	%al
+	andl	$255,%edx
+	rorl	$8,%ebp
+	movl	(%edi,%eax,4),%ecx
+	orl	(%edi,%edx,4),%ebp
+	addb	%cl,%bl
+	movl	(%edi,%ebx,4),%edx
+	movl	%ecx,(%edi,%ebx,4)
+	movl	%edx,(%edi,%eax,4)
+	addl	%ecx,%edx
+	incb	%al
+	andl	$255,%edx
+	rorl	$8,%ebp
+	movl	(%edi,%eax,4),%ecx
+	orl	(%edi,%edx,4),%ebp
+	addb	%cl,%bl
+	movl	(%edi,%ebx,4),%edx
+	movl	%ecx,(%edi,%ebx,4)
+	movl	%edx,(%edi,%eax,4)
+	addl	%ecx,%edx
+	incb	%al
+	andl	$255,%edx
+	rorl	$8,%ebp
+	movl	32(%esp),%ecx
+	orl	(%edi,%edx,4),%ebp
+	rorl	$8,%ebp
+	xorl	(%esi),%ebp
+	cmpl	28(%esp),%esi
+	movl	%ebp,(%ecx,%esi,1)
+	leal	4(%esi),%esi
+	movl	(%edi,%eax,4),%ecx
+	jb	.L008loop4
+	cmpl	24(%esp),%esi
+	je	.L007done
+	movl	32(%esp),%ebp
+.align	16
+.L002loop1:
+	addb	%cl,%bl
+	movl	(%edi,%ebx,4),%edx
+	movl	%ecx,(%edi,%ebx,4)
+	movl	%edx,(%edi,%eax,4)
+	addl	%ecx,%edx
+	incb	%al
+	andl	$255,%edx
+	movl	(%edi,%edx,4),%edx
+	xorb	(%esi),%dl
+	leal	1(%esi),%esi
+	movl	(%edi,%eax,4),%ecx
+	cmpl	24(%esp),%esi
+	movb	%dl,-1(%ebp,%esi,1)
+	jb	.L002loop1
+	jmp	.L007done
+.align	16
+.L001RC4_CHAR:
+	movzbl	(%edi,%eax,1),%ecx
+.L009cloop1:
+	addb	%cl,%bl
+	movzbl	(%edi,%ebx,1),%edx
+	movb	%cl,(%edi,%ebx,1)
+	movb	%dl,(%edi,%eax,1)
+	addb	%cl,%dl
+	movzbl	(%edi,%edx,1),%edx
+	addb	$1,%al
+	xorb	(%esi),%dl
+	leal	1(%esi),%esi
+	movzbl	(%edi,%eax,1),%ecx
+	cmpl	24(%esp),%esi
+	movb	%dl,-1(%ebp,%esi,1)
+	jb	.L009cloop1
+.L007done:
+	decb	%al
+	movl	%ebx,-4(%edi)
+	movb	%al,-8(%edi)
+.L000abort:
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.size	asm_RC4,.-.L_asm_RC4_begin
+.globl	asm_RC4_set_key
+.hidden	asm_RC4_set_key
+.type	asm_RC4_set_key,@function
+.align	16
+asm_RC4_set_key:
+.L_asm_RC4_set_key_begin:
+	pushl	%ebp
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+	movl	20(%esp),%edi
+	movl	24(%esp),%ebp
+	movl	28(%esp),%esi
+	call	.L010PIC_me_up
+.L010PIC_me_up:
+	popl	%edx
+	leal	OPENSSL_ia32cap_P-.L010PIC_me_up(%edx),%edx
+	leal	8(%edi),%edi
+	leal	(%esi,%ebp,1),%esi
+	negl	%ebp
+	xorl	%eax,%eax
+	movl	%ebp,-4(%edi)
+	btl	$20,(%edx)
+	jc	.L011c1stloop
+.align	16
+.L012w1stloop:
+	movl	%eax,(%edi,%eax,4)
+	addb	$1,%al
+	jnc	.L012w1stloop
+	xorl	%ecx,%ecx
+	xorl	%edx,%edx
+.align	16
+.L013w2ndloop:
+	movl	(%edi,%ecx,4),%eax
+	addb	(%esi,%ebp,1),%dl
+	addb	%al,%dl
+	addl	$1,%ebp
+	movl	(%edi,%edx,4),%ebx
+	jnz	.L014wnowrap
+	movl	-4(%edi),%ebp
+.L014wnowrap:
+	movl	%eax,(%edi,%edx,4)
+	movl	%ebx,(%edi,%ecx,4)
+	addb	$1,%cl
+	jnc	.L013w2ndloop
+	jmp	.L015exit
+.align	16
+.L011c1stloop:
+	movb	%al,(%edi,%eax,1)
+	addb	$1,%al
+	jnc	.L011c1stloop
+	xorl	%ecx,%ecx
+	xorl	%edx,%edx
+	xorl	%ebx,%ebx
+.align	16
+.L016c2ndloop:
+	movb	(%edi,%ecx,1),%al
+	addb	(%esi,%ebp,1),%dl
+	addb	%al,%dl
+	addl	$1,%ebp
+	movb	(%edi,%edx,1),%bl
+	jnz	.L017cnowrap
+	movl	-4(%edi),%ebp
+.L017cnowrap:
+	movb	%al,(%edi,%edx,1)
+	movb	%bl,(%edi,%ecx,1)
+	addb	$1,%cl
+	jnc	.L016c2ndloop
+	movl	$-1,256(%edi)
+.L015exit:
+	xorl	%eax,%eax
+	movl	%eax,-8(%edi)
+	movl	%eax,-4(%edi)
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.size	asm_RC4_set_key,.-.L_asm_RC4_set_key_begin
+.globl	RC4_options
+.hidden	RC4_options
+.type	RC4_options,@function
+.align	16
+RC4_options:
+.L_RC4_options_begin:
+	call	.L018pic_point
+.L018pic_point:
+	popl	%eax
+	leal	.L019opts-.L018pic_point(%eax),%eax
+	call	.L020PIC_me_up
+.L020PIC_me_up:
+	popl	%edx
+	leal	OPENSSL_ia32cap_P-.L020PIC_me_up(%edx),%edx
+	movl	(%edx),%edx
+	btl	$20,%edx
+	jc	.L0211xchar
+	btl	$26,%edx
+	jnc	.L022ret
+	addl	$25,%eax
+	ret
+.L0211xchar:
+	addl	$12,%eax
+.L022ret:
+	ret
+.align	64
+.L019opts:
+.byte	114,99,52,40,52,120,44,105,110,116,41,0
+.byte	114,99,52,40,49,120,44,99,104,97,114,41,0
+.byte	114,99,52,40,56,120,44,109,109,120,41,0
+.byte	82,67,52,32,102,111,114,32,120,56,54,44,32,67,82,89
+.byte	80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114
+.byte	111,64,111,112,101,110,115,115,108,46,111,114,103,62,0
+.align	64
+.size	RC4_options,.-.L_RC4_options_begin
+#endif
diff --git a/third_party/boringssl/linux-x86/crypto/sha/sha1-586.S b/third_party/boringssl/linux-x86/crypto/sha/sha1-586.S
new file mode 100644
index 0000000..808ccac
--- /dev/null
+++ b/third_party/boringssl/linux-x86/crypto/sha/sha1-586.S
@@ -0,0 +1,2799 @@
+#if defined(__i386__)
+.file	"sha1-586.S"
+.text
+.globl	sha1_block_data_order
+.hidden	sha1_block_data_order
+.type	sha1_block_data_order,@function
+.align	16
+sha1_block_data_order:
+.L_sha1_block_data_order_begin:
+	pushl	%ebp
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+	call	.L000pic_point
+.L000pic_point:
+	popl	%ebp
+	leal	OPENSSL_ia32cap_P-.L000pic_point(%ebp),%esi
+	leal	.LK_XX_XX-.L000pic_point(%ebp),%ebp
+	movl	(%esi),%eax
+	movl	4(%esi),%edx
+	testl	$512,%edx
+	jz	.L001x86
+	movl	8(%esi),%ecx
+	testl	$16777216,%eax
+	jz	.L001x86
+	testl	$536870912,%ecx
+	jnz	.Lshaext_shortcut
+	jmp	.Lssse3_shortcut
+.align	16
+.L001x86:
+	movl	20(%esp),%ebp
+	movl	24(%esp),%esi
+	movl	28(%esp),%eax
+	subl	$76,%esp
+	shll	$6,%eax
+	addl	%esi,%eax
+	movl	%eax,104(%esp)
+	movl	16(%ebp),%edi
+	jmp	.L002loop
+.align	16
+.L002loop:
+	movl	(%esi),%eax
+	movl	4(%esi),%ebx
+	movl	8(%esi),%ecx
+	movl	12(%esi),%edx
+	bswap	%eax
+	bswap	%ebx
+	bswap	%ecx
+	bswap	%edx
+	movl	%eax,(%esp)
+	movl	%ebx,4(%esp)
+	movl	%ecx,8(%esp)
+	movl	%edx,12(%esp)
+	movl	16(%esi),%eax
+	movl	20(%esi),%ebx
+	movl	24(%esi),%ecx
+	movl	28(%esi),%edx
+	bswap	%eax
+	bswap	%ebx
+	bswap	%ecx
+	bswap	%edx
+	movl	%eax,16(%esp)
+	movl	%ebx,20(%esp)
+	movl	%ecx,24(%esp)
+	movl	%edx,28(%esp)
+	movl	32(%esi),%eax
+	movl	36(%esi),%ebx
+	movl	40(%esi),%ecx
+	movl	44(%esi),%edx
+	bswap	%eax
+	bswap	%ebx
+	bswap	%ecx
+	bswap	%edx
+	movl	%eax,32(%esp)
+	movl	%ebx,36(%esp)
+	movl	%ecx,40(%esp)
+	movl	%edx,44(%esp)
+	movl	48(%esi),%eax
+	movl	52(%esi),%ebx
+	movl	56(%esi),%ecx
+	movl	60(%esi),%edx
+	bswap	%eax
+	bswap	%ebx
+	bswap	%ecx
+	bswap	%edx
+	movl	%eax,48(%esp)
+	movl	%ebx,52(%esp)
+	movl	%ecx,56(%esp)
+	movl	%edx,60(%esp)
+	movl	%esi,100(%esp)
+	movl	(%ebp),%eax
+	movl	4(%ebp),%ebx
+	movl	8(%ebp),%ecx
+	movl	12(%ebp),%edx
+
+	movl	%ecx,%esi
+	movl	%eax,%ebp
+	roll	$5,%ebp
+	xorl	%edx,%esi
+	addl	%edi,%ebp
+	movl	(%esp),%edi
+	andl	%ebx,%esi
+	rorl	$2,%ebx
+	xorl	%edx,%esi
+	leal	1518500249(%ebp,%edi,1),%ebp
+	addl	%esi,%ebp
+
+	movl	%ebx,%edi
+	movl	%ebp,%esi
+	roll	$5,%ebp
+	xorl	%ecx,%edi
+	addl	%edx,%ebp
+	movl	4(%esp),%edx
+	andl	%eax,%edi
+	rorl	$2,%eax
+	xorl	%ecx,%edi
+	leal	1518500249(%ebp,%edx,1),%ebp
+	addl	%edi,%ebp
+
+	movl	%eax,%edx
+	movl	%ebp,%edi
+	roll	$5,%ebp
+	xorl	%ebx,%edx
+	addl	%ecx,%ebp
+	movl	8(%esp),%ecx
+	andl	%esi,%edx
+	rorl	$2,%esi
+	xorl	%ebx,%edx
+	leal	1518500249(%ebp,%ecx,1),%ebp
+	addl	%edx,%ebp
+
+	movl	%esi,%ecx
+	movl	%ebp,%edx
+	roll	$5,%ebp
+	xorl	%eax,%ecx
+	addl	%ebx,%ebp
+	movl	12(%esp),%ebx
+	andl	%edi,%ecx
+	rorl	$2,%edi
+	xorl	%eax,%ecx
+	leal	1518500249(%ebp,%ebx,1),%ebp
+	addl	%ecx,%ebp
+
+	movl	%edi,%ebx
+	movl	%ebp,%ecx
+	roll	$5,%ebp
+	xorl	%esi,%ebx
+	addl	%eax,%ebp
+	movl	16(%esp),%eax
+	andl	%edx,%ebx
+	rorl	$2,%edx
+	xorl	%esi,%ebx
+	leal	1518500249(%ebp,%eax,1),%ebp
+	addl	%ebx,%ebp
+
+	movl	%edx,%eax
+	movl	%ebp,%ebx
+	roll	$5,%ebp
+	xorl	%edi,%eax
+	addl	%esi,%ebp
+	movl	20(%esp),%esi
+	andl	%ecx,%eax
+	rorl	$2,%ecx
+	xorl	%edi,%eax
+	leal	1518500249(%ebp,%esi,1),%ebp
+	addl	%eax,%ebp
+
+	movl	%ecx,%esi
+	movl	%ebp,%eax
+	roll	$5,%ebp
+	xorl	%edx,%esi
+	addl	%edi,%ebp
+	movl	24(%esp),%edi
+	andl	%ebx,%esi
+	rorl	$2,%ebx
+	xorl	%edx,%esi
+	leal	1518500249(%ebp,%edi,1),%ebp
+	addl	%esi,%ebp
+
+	movl	%ebx,%edi
+	movl	%ebp,%esi
+	roll	$5,%ebp
+	xorl	%ecx,%edi
+	addl	%edx,%ebp
+	movl	28(%esp),%edx
+	andl	%eax,%edi
+	rorl	$2,%eax
+	xorl	%ecx,%edi
+	leal	1518500249(%ebp,%edx,1),%ebp
+	addl	%edi,%ebp
+
+	movl	%eax,%edx
+	movl	%ebp,%edi
+	roll	$5,%ebp
+	xorl	%ebx,%edx
+	addl	%ecx,%ebp
+	movl	32(%esp),%ecx
+	andl	%esi,%edx
+	rorl	$2,%esi
+	xorl	%ebx,%edx
+	leal	1518500249(%ebp,%ecx,1),%ebp
+	addl	%edx,%ebp
+
+	movl	%esi,%ecx
+	movl	%ebp,%edx
+	roll	$5,%ebp
+	xorl	%eax,%ecx
+	addl	%ebx,%ebp
+	movl	36(%esp),%ebx
+	andl	%edi,%ecx
+	rorl	$2,%edi
+	xorl	%eax,%ecx
+	leal	1518500249(%ebp,%ebx,1),%ebp
+	addl	%ecx,%ebp
+
+	movl	%edi,%ebx
+	movl	%ebp,%ecx
+	roll	$5,%ebp
+	xorl	%esi,%ebx
+	addl	%eax,%ebp
+	movl	40(%esp),%eax
+	andl	%edx,%ebx
+	rorl	$2,%edx
+	xorl	%esi,%ebx
+	leal	1518500249(%ebp,%eax,1),%ebp
+	addl	%ebx,%ebp
+
+	movl	%edx,%eax
+	movl	%ebp,%ebx
+	roll	$5,%ebp
+	xorl	%edi,%eax
+	addl	%esi,%ebp
+	movl	44(%esp),%esi
+	andl	%ecx,%eax
+	rorl	$2,%ecx
+	xorl	%edi,%eax
+	leal	1518500249(%ebp,%esi,1),%ebp
+	addl	%eax,%ebp
+
+	movl	%ecx,%esi
+	movl	%ebp,%eax
+	roll	$5,%ebp
+	xorl	%edx,%esi
+	addl	%edi,%ebp
+	movl	48(%esp),%edi
+	andl	%ebx,%esi
+	rorl	$2,%ebx
+	xorl	%edx,%esi
+	leal	1518500249(%ebp,%edi,1),%ebp
+	addl	%esi,%ebp
+
+	movl	%ebx,%edi
+	movl	%ebp,%esi
+	roll	$5,%ebp
+	xorl	%ecx,%edi
+	addl	%edx,%ebp
+	movl	52(%esp),%edx
+	andl	%eax,%edi
+	rorl	$2,%eax
+	xorl	%ecx,%edi
+	leal	1518500249(%ebp,%edx,1),%ebp
+	addl	%edi,%ebp
+
+	movl	%eax,%edx
+	movl	%ebp,%edi
+	roll	$5,%ebp
+	xorl	%ebx,%edx
+	addl	%ecx,%ebp
+	movl	56(%esp),%ecx
+	andl	%esi,%edx
+	rorl	$2,%esi
+	xorl	%ebx,%edx
+	leal	1518500249(%ebp,%ecx,1),%ebp
+	addl	%edx,%ebp
+
+	movl	%esi,%ecx
+	movl	%ebp,%edx
+	roll	$5,%ebp
+	xorl	%eax,%ecx
+	addl	%ebx,%ebp
+	movl	60(%esp),%ebx
+	andl	%edi,%ecx
+	rorl	$2,%edi
+	xorl	%eax,%ecx
+	leal	1518500249(%ebp,%ebx,1),%ebp
+	movl	(%esp),%ebx
+	addl	%ebp,%ecx
+
+	movl	%edi,%ebp
+	xorl	8(%esp),%ebx
+	xorl	%esi,%ebp
+	xorl	32(%esp),%ebx
+	andl	%edx,%ebp
+	xorl	52(%esp),%ebx
+	roll	$1,%ebx
+	xorl	%esi,%ebp
+	addl	%ebp,%eax
+	movl	%ecx,%ebp
+	rorl	$2,%edx
+	movl	%ebx,(%esp)
+	roll	$5,%ebp
+	leal	1518500249(%ebx,%eax,1),%ebx
+	movl	4(%esp),%eax
+	addl	%ebp,%ebx
+
+	movl	%edx,%ebp
+	xorl	12(%esp),%eax
+	xorl	%edi,%ebp
+	xorl	36(%esp),%eax
+	andl	%ecx,%ebp
+	xorl	56(%esp),%eax
+	roll	$1,%eax
+	xorl	%edi,%ebp
+	addl	%ebp,%esi
+	movl	%ebx,%ebp
+	rorl	$2,%ecx
+	movl	%eax,4(%esp)
+	roll	$5,%ebp
+	leal	1518500249(%eax,%esi,1),%eax
+	movl	8(%esp),%esi
+	addl	%ebp,%eax
+
+	movl	%ecx,%ebp
+	xorl	16(%esp),%esi
+	xorl	%edx,%ebp
+	xorl	40(%esp),%esi
+	andl	%ebx,%ebp
+	xorl	60(%esp),%esi
+	roll	$1,%esi
+	xorl	%edx,%ebp
+	addl	%ebp,%edi
+	movl	%eax,%ebp
+	rorl	$2,%ebx
+	movl	%esi,8(%esp)
+	roll	$5,%ebp
+	leal	1518500249(%esi,%edi,1),%esi
+	movl	12(%esp),%edi
+	addl	%ebp,%esi
+
+	movl	%ebx,%ebp
+	xorl	20(%esp),%edi
+	xorl	%ecx,%ebp
+	xorl	44(%esp),%edi
+	andl	%eax,%ebp
+	xorl	(%esp),%edi
+	roll	$1,%edi
+	xorl	%ecx,%ebp
+	addl	%ebp,%edx
+	movl	%esi,%ebp
+	rorl	$2,%eax
+	movl	%edi,12(%esp)
+	roll	$5,%ebp
+	leal	1518500249(%edi,%edx,1),%edi
+	movl	16(%esp),%edx
+	addl	%ebp,%edi
+
+	movl	%esi,%ebp
+	xorl	24(%esp),%edx
+	xorl	%eax,%ebp
+	xorl	48(%esp),%edx
+	xorl	%ebx,%ebp
+	xorl	4(%esp),%edx
+	roll	$1,%edx
+	addl	%ebp,%ecx
+	rorl	$2,%esi
+	movl	%edi,%ebp
+	roll	$5,%ebp
+	movl	%edx,16(%esp)
+	leal	1859775393(%edx,%ecx,1),%edx
+	movl	20(%esp),%ecx
+	addl	%ebp,%edx
+
+	movl	%edi,%ebp
+	xorl	28(%esp),%ecx
+	xorl	%esi,%ebp
+	xorl	52(%esp),%ecx
+	xorl	%eax,%ebp
+	xorl	8(%esp),%ecx
+	roll	$1,%ecx
+	addl	%ebp,%ebx
+	rorl	$2,%edi
+	movl	%edx,%ebp
+	roll	$5,%ebp
+	movl	%ecx,20(%esp)
+	leal	1859775393(%ecx,%ebx,1),%ecx
+	movl	24(%esp),%ebx
+	addl	%ebp,%ecx
+
+	movl	%edx,%ebp
+	xorl	32(%esp),%ebx
+	xorl	%edi,%ebp
+	xorl	56(%esp),%ebx
+	xorl	%esi,%ebp
+	xorl	12(%esp),%ebx
+	roll	$1,%ebx
+	addl	%ebp,%eax
+	rorl	$2,%edx
+	movl	%ecx,%ebp
+	roll	$5,%ebp
+	movl	%ebx,24(%esp)
+	leal	1859775393(%ebx,%eax,1),%ebx
+	movl	28(%esp),%eax
+	addl	%ebp,%ebx
+
+	movl	%ecx,%ebp
+	xorl	36(%esp),%eax
+	xorl	%edx,%ebp
+	xorl	60(%esp),%eax
+	xorl	%edi,%ebp
+	xorl	16(%esp),%eax
+	roll	$1,%eax
+	addl	%ebp,%esi
+	rorl	$2,%ecx
+	movl	%ebx,%ebp
+	roll	$5,%ebp
+	movl	%eax,28(%esp)
+	leal	1859775393(%eax,%esi,1),%eax
+	movl	32(%esp),%esi
+	addl	%ebp,%eax
+
+	movl	%ebx,%ebp
+	xorl	40(%esp),%esi
+	xorl	%ecx,%ebp
+	xorl	(%esp),%esi
+	xorl	%edx,%ebp
+	xorl	20(%esp),%esi
+	roll	$1,%esi
+	addl	%ebp,%edi
+	rorl	$2,%ebx
+	movl	%eax,%ebp
+	roll	$5,%ebp
+	movl	%esi,32(%esp)
+	leal	1859775393(%esi,%edi,1),%esi
+	movl	36(%esp),%edi
+	addl	%ebp,%esi
+
+	movl	%eax,%ebp
+	xorl	44(%esp),%edi
+	xorl	%ebx,%ebp
+	xorl	4(%esp),%edi
+	xorl	%ecx,%ebp
+	xorl	24(%esp),%edi
+	roll	$1,%edi
+	addl	%ebp,%edx
+	rorl	$2,%eax
+	movl	%esi,%ebp
+	roll	$5,%ebp
+	movl	%edi,36(%esp)
+	leal	1859775393(%edi,%edx,1),%edi
+	movl	40(%esp),%edx
+	addl	%ebp,%edi
+
+	movl	%esi,%ebp
+	xorl	48(%esp),%edx
+	xorl	%eax,%ebp
+	xorl	8(%esp),%edx
+	xorl	%ebx,%ebp
+	xorl	28(%esp),%edx
+	roll	$1,%edx
+	addl	%ebp,%ecx
+	rorl	$2,%esi
+	movl	%edi,%ebp
+	roll	$5,%ebp
+	movl	%edx,40(%esp)
+	leal	1859775393(%edx,%ecx,1),%edx
+	movl	44(%esp),%ecx
+	addl	%ebp,%edx
+
+	movl	%edi,%ebp
+	xorl	52(%esp),%ecx
+	xorl	%esi,%ebp
+	xorl	12(%esp),%ecx
+	xorl	%eax,%ebp
+	xorl	32(%esp),%ecx
+	roll	$1,%ecx
+	addl	%ebp,%ebx
+	rorl	$2,%edi
+	movl	%edx,%ebp
+	roll	$5,%ebp
+	movl	%ecx,44(%esp)
+	leal	1859775393(%ecx,%ebx,1),%ecx
+	movl	48(%esp),%ebx
+	addl	%ebp,%ecx
+
+	movl	%edx,%ebp
+	xorl	56(%esp),%ebx
+	xorl	%edi,%ebp
+	xorl	16(%esp),%ebx
+	xorl	%esi,%ebp
+	xorl	36(%esp),%ebx
+	roll	$1,%ebx
+	addl	%ebp,%eax
+	rorl	$2,%edx
+	movl	%ecx,%ebp
+	roll	$5,%ebp
+	movl	%ebx,48(%esp)
+	leal	1859775393(%ebx,%eax,1),%ebx
+	movl	52(%esp),%eax
+	addl	%ebp,%ebx
+
+	movl	%ecx,%ebp
+	xorl	60(%esp),%eax
+	xorl	%edx,%ebp
+	xorl	20(%esp),%eax
+	xorl	%edi,%ebp
+	xorl	40(%esp),%eax
+	roll	$1,%eax
+	addl	%ebp,%esi
+	rorl	$2,%ecx
+	movl	%ebx,%ebp
+	roll	$5,%ebp
+	movl	%eax,52(%esp)
+	leal	1859775393(%eax,%esi,1),%eax
+	movl	56(%esp),%esi
+	addl	%ebp,%eax
+
+	movl	%ebx,%ebp
+	xorl	(%esp),%esi
+	xorl	%ecx,%ebp
+	xorl	24(%esp),%esi
+	xorl	%edx,%ebp
+	xorl	44(%esp),%esi
+	roll	$1,%esi
+	addl	%ebp,%edi
+	rorl	$2,%ebx
+	movl	%eax,%ebp
+	roll	$5,%ebp
+	movl	%esi,56(%esp)
+	leal	1859775393(%esi,%edi,1),%esi
+	movl	60(%esp),%edi
+	addl	%ebp,%esi
+
+	movl	%eax,%ebp
+	xorl	4(%esp),%edi
+	xorl	%ebx,%ebp
+	xorl	28(%esp),%edi
+	xorl	%ecx,%ebp
+	xorl	48(%esp),%edi
+	roll	$1,%edi
+	addl	%ebp,%edx
+	rorl	$2,%eax
+	movl	%esi,%ebp
+	roll	$5,%ebp
+	movl	%edi,60(%esp)
+	leal	1859775393(%edi,%edx,1),%edi
+	movl	(%esp),%edx
+	addl	%ebp,%edi
+
+	movl	%esi,%ebp
+	xorl	8(%esp),%edx
+	xorl	%eax,%ebp
+	xorl	32(%esp),%edx
+	xorl	%ebx,%ebp
+	xorl	52(%esp),%edx
+	roll	$1,%edx
+	addl	%ebp,%ecx
+	rorl	$2,%esi
+	movl	%edi,%ebp
+	roll	$5,%ebp
+	movl	%edx,(%esp)
+	leal	1859775393(%edx,%ecx,1),%edx
+	movl	4(%esp),%ecx
+	addl	%ebp,%edx
+
+	movl	%edi,%ebp
+	xorl	12(%esp),%ecx
+	xorl	%esi,%ebp
+	xorl	36(%esp),%ecx
+	xorl	%eax,%ebp
+	xorl	56(%esp),%ecx
+	roll	$1,%ecx
+	addl	%ebp,%ebx
+	rorl	$2,%edi
+	movl	%edx,%ebp
+	roll	$5,%ebp
+	movl	%ecx,4(%esp)
+	leal	1859775393(%ecx,%ebx,1),%ecx
+	movl	8(%esp),%ebx
+	addl	%ebp,%ecx
+
+	movl	%edx,%ebp
+	xorl	16(%esp),%ebx
+	xorl	%edi,%ebp
+	xorl	40(%esp),%ebx
+	xorl	%esi,%ebp
+	xorl	60(%esp),%ebx
+	roll	$1,%ebx
+	addl	%ebp,%eax
+	rorl	$2,%edx
+	movl	%ecx,%ebp
+	roll	$5,%ebp
+	movl	%ebx,8(%esp)
+	leal	1859775393(%ebx,%eax,1),%ebx
+	movl	12(%esp),%eax
+	addl	%ebp,%ebx
+
+	movl	%ecx,%ebp
+	xorl	20(%esp),%eax
+	xorl	%edx,%ebp
+	xorl	44(%esp),%eax
+	xorl	%edi,%ebp
+	xorl	(%esp),%eax
+	roll	$1,%eax
+	addl	%ebp,%esi
+	rorl	$2,%ecx
+	movl	%ebx,%ebp
+	roll	$5,%ebp
+	movl	%eax,12(%esp)
+	leal	1859775393(%eax,%esi,1),%eax
+	movl	16(%esp),%esi
+	addl	%ebp,%eax
+
+	movl	%ebx,%ebp
+	xorl	24(%esp),%esi
+	xorl	%ecx,%ebp
+	xorl	48(%esp),%esi
+	xorl	%edx,%ebp
+	xorl	4(%esp),%esi
+	roll	$1,%esi
+	addl	%ebp,%edi
+	rorl	$2,%ebx
+	movl	%eax,%ebp
+	roll	$5,%ebp
+	movl	%esi,16(%esp)
+	leal	1859775393(%esi,%edi,1),%esi
+	movl	20(%esp),%edi
+	addl	%ebp,%esi
+
+	movl	%eax,%ebp
+	xorl	28(%esp),%edi
+	xorl	%ebx,%ebp
+	xorl	52(%esp),%edi
+	xorl	%ecx,%ebp
+	xorl	8(%esp),%edi
+	roll	$1,%edi
+	addl	%ebp,%edx
+	rorl	$2,%eax
+	movl	%esi,%ebp
+	roll	$5,%ebp
+	movl	%edi,20(%esp)
+	leal	1859775393(%edi,%edx,1),%edi
+	movl	24(%esp),%edx
+	addl	%ebp,%edi
+
+	movl	%esi,%ebp
+	xorl	32(%esp),%edx
+	xorl	%eax,%ebp
+	xorl	56(%esp),%edx
+	xorl	%ebx,%ebp
+	xorl	12(%esp),%edx
+	roll	$1,%edx
+	addl	%ebp,%ecx
+	rorl	$2,%esi
+	movl	%edi,%ebp
+	roll	$5,%ebp
+	movl	%edx,24(%esp)
+	leal	1859775393(%edx,%ecx,1),%edx
+	movl	28(%esp),%ecx
+	addl	%ebp,%edx
+
+	movl	%edi,%ebp
+	xorl	36(%esp),%ecx
+	xorl	%esi,%ebp
+	xorl	60(%esp),%ecx
+	xorl	%eax,%ebp
+	xorl	16(%esp),%ecx
+	roll	$1,%ecx
+	addl	%ebp,%ebx
+	rorl	$2,%edi
+	movl	%edx,%ebp
+	roll	$5,%ebp
+	movl	%ecx,28(%esp)
+	leal	1859775393(%ecx,%ebx,1),%ecx
+	movl	32(%esp),%ebx
+	addl	%ebp,%ecx
+
+	movl	%edi,%ebp
+	xorl	40(%esp),%ebx
+	xorl	%esi,%ebp
+	xorl	(%esp),%ebx
+	andl	%edx,%ebp
+	xorl	20(%esp),%ebx
+	roll	$1,%ebx
+	addl	%eax,%ebp
+	rorl	$2,%edx
+	movl	%ecx,%eax
+	roll	$5,%eax
+	movl	%ebx,32(%esp)
+	leal	2400959708(%ebx,%ebp,1),%ebx
+	movl	%edi,%ebp
+	addl	%eax,%ebx
+	andl	%esi,%ebp
+	movl	36(%esp),%eax
+	addl	%ebp,%ebx
+
+	movl	%edx,%ebp
+	xorl	44(%esp),%eax
+	xorl	%edi,%ebp
+	xorl	4(%esp),%eax
+	andl	%ecx,%ebp
+	xorl	24(%esp),%eax
+	roll	$1,%eax
+	addl	%esi,%ebp
+	rorl	$2,%ecx
+	movl	%ebx,%esi
+	roll	$5,%esi
+	movl	%eax,36(%esp)
+	leal	2400959708(%eax,%ebp,1),%eax
+	movl	%edx,%ebp
+	addl	%esi,%eax
+	andl	%edi,%ebp
+	movl	40(%esp),%esi
+	addl	%ebp,%eax
+
+	movl	%ecx,%ebp
+	xorl	48(%esp),%esi
+	xorl	%edx,%ebp
+	xorl	8(%esp),%esi
+	andl	%ebx,%ebp
+	xorl	28(%esp),%esi
+	roll	$1,%esi
+	addl	%edi,%ebp
+	rorl	$2,%ebx
+	movl	%eax,%edi
+	roll	$5,%edi
+	movl	%esi,40(%esp)
+	leal	2400959708(%esi,%ebp,1),%esi
+	movl	%ecx,%ebp
+	addl	%edi,%esi
+	andl	%edx,%ebp
+	movl	44(%esp),%edi
+	addl	%ebp,%esi
+
+	movl	%ebx,%ebp
+	xorl	52(%esp),%edi
+	xorl	%ecx,%ebp
+	xorl	12(%esp),%edi
+	andl	%eax,%ebp
+	xorl	32(%esp),%edi
+	roll	$1,%edi
+	addl	%edx,%ebp
+	rorl	$2,%eax
+	movl	%esi,%edx
+	roll	$5,%edx
+	movl	%edi,44(%esp)
+	leal	2400959708(%edi,%ebp,1),%edi
+	movl	%ebx,%ebp
+	addl	%edx,%edi
+	andl	%ecx,%ebp
+	movl	48(%esp),%edx
+	addl	%ebp,%edi
+
+	movl	%eax,%ebp
+	xorl	56(%esp),%edx
+	xorl	%ebx,%ebp
+	xorl	16(%esp),%edx
+	andl	%esi,%ebp
+	xorl	36(%esp),%edx
+	roll	$1,%edx
+	addl	%ecx,%ebp
+	rorl	$2,%esi
+	movl	%edi,%ecx
+	roll	$5,%ecx
+	movl	%edx,48(%esp)
+	leal	2400959708(%edx,%ebp,1),%edx
+	movl	%eax,%ebp
+	addl	%ecx,%edx
+	andl	%ebx,%ebp
+	movl	52(%esp),%ecx
+	addl	%ebp,%edx
+
+	movl	%esi,%ebp
+	xorl	60(%esp),%ecx
+	xorl	%eax,%ebp
+	xorl	20(%esp),%ecx
+	andl	%edi,%ebp
+	xorl	40(%esp),%ecx
+	roll	$1,%ecx
+	addl	%ebx,%ebp
+	rorl	$2,%edi
+	movl	%edx,%ebx
+	roll	$5,%ebx
+	movl	%ecx,52(%esp)
+	leal	2400959708(%ecx,%ebp,1),%ecx
+	movl	%esi,%ebp
+	addl	%ebx,%ecx
+	andl	%eax,%ebp
+	movl	56(%esp),%ebx
+	addl	%ebp,%ecx
+
+	movl	%edi,%ebp
+	xorl	(%esp),%ebx
+	xorl	%esi,%ebp
+	xorl	24(%esp),%ebx
+	andl	%edx,%ebp
+	xorl	44(%esp),%ebx
+	roll	$1,%ebx
+	addl	%eax,%ebp
+	rorl	$2,%edx
+	movl	%ecx,%eax
+	roll	$5,%eax
+	movl	%ebx,56(%esp)
+	leal	2400959708(%ebx,%ebp,1),%ebx
+	movl	%edi,%ebp
+	addl	%eax,%ebx
+	andl	%esi,%ebp
+	movl	60(%esp),%eax
+	addl	%ebp,%ebx
+
+	movl	%edx,%ebp
+	xorl	4(%esp),%eax
+	xorl	%edi,%ebp
+	xorl	28(%esp),%eax
+	andl	%ecx,%ebp
+	xorl	48(%esp),%eax
+	roll	$1,%eax
+	addl	%esi,%ebp
+	rorl	$2,%ecx
+	movl	%ebx,%esi
+	roll	$5,%esi
+	movl	%eax,60(%esp)
+	leal	2400959708(%eax,%ebp,1),%eax
+	movl	%edx,%ebp
+	addl	%esi,%eax
+	andl	%edi,%ebp
+	movl	(%esp),%esi
+	addl	%ebp,%eax
+
+	movl	%ecx,%ebp
+	xorl	8(%esp),%esi
+	xorl	%edx,%ebp
+	xorl	32(%esp),%esi
+	andl	%ebx,%ebp
+	xorl	52(%esp),%esi
+	roll	$1,%esi
+	addl	%edi,%ebp
+	rorl	$2,%ebx
+	movl	%eax,%edi
+	roll	$5,%edi
+	movl	%esi,(%esp)
+	leal	2400959708(%esi,%ebp,1),%esi
+	movl	%ecx,%ebp
+	addl	%edi,%esi
+	andl	%edx,%ebp
+	movl	4(%esp),%edi
+	addl	%ebp,%esi
+
+	movl	%ebx,%ebp
+	xorl	12(%esp),%edi
+	xorl	%ecx,%ebp
+	xorl	36(%esp),%edi
+	andl	%eax,%ebp
+	xorl	56(%esp),%edi
+	roll	$1,%edi
+	addl	%edx,%ebp
+	rorl	$2,%eax
+	movl	%esi,%edx
+	roll	$5,%edx
+	movl	%edi,4(%esp)
+	leal	2400959708(%edi,%ebp,1),%edi
+	movl	%ebx,%ebp
+	addl	%edx,%edi
+	andl	%ecx,%ebp
+	movl	8(%esp),%edx
+	addl	%ebp,%edi
+
+	movl	%eax,%ebp
+	xorl	16(%esp),%edx
+	xorl	%ebx,%ebp
+	xorl	40(%esp),%edx
+	andl	%esi,%ebp
+	xorl	60(%esp),%edx
+	roll	$1,%edx
+	addl	%ecx,%ebp
+	rorl	$2,%esi
+	movl	%edi,%ecx
+	roll	$5,%ecx
+	movl	%edx,8(%esp)
+	leal	2400959708(%edx,%ebp,1),%edx
+	movl	%eax,%ebp
+	addl	%ecx,%edx
+	andl	%ebx,%ebp
+	movl	12(%esp),%ecx
+	addl	%ebp,%edx
+
+	movl	%esi,%ebp
+	xorl	20(%esp),%ecx
+	xorl	%eax,%ebp
+	xorl	44(%esp),%ecx
+	andl	%edi,%ebp
+	xorl	(%esp),%ecx
+	roll	$1,%ecx
+	addl	%ebx,%ebp
+	rorl	$2,%edi
+	movl	%edx,%ebx
+	roll	$5,%ebx
+	movl	%ecx,12(%esp)
+	leal	2400959708(%ecx,%ebp,1),%ecx
+	movl	%esi,%ebp
+	addl	%ebx,%ecx
+	andl	%eax,%ebp
+	movl	16(%esp),%ebx
+	addl	%ebp,%ecx
+
+	movl	%edi,%ebp
+	xorl	24(%esp),%ebx
+	xorl	%esi,%ebp
+	xorl	48(%esp),%ebx
+	andl	%edx,%ebp
+	xorl	4(%esp),%ebx
+	roll	$1,%ebx
+	addl	%eax,%ebp
+	rorl	$2,%edx
+	movl	%ecx,%eax
+	roll	$5,%eax
+	movl	%ebx,16(%esp)
+	leal	2400959708(%ebx,%ebp,1),%ebx
+	movl	%edi,%ebp
+	addl	%eax,%ebx
+	andl	%esi,%ebp
+	movl	20(%esp),%eax
+	addl	%ebp,%ebx
+
+	movl	%edx,%ebp
+	xorl	28(%esp),%eax
+	xorl	%edi,%ebp
+	xorl	52(%esp),%eax
+	andl	%ecx,%ebp
+	xorl	8(%esp),%eax
+	roll	$1,%eax
+	addl	%esi,%ebp
+	rorl	$2,%ecx
+	movl	%ebx,%esi
+	roll	$5,%esi
+	movl	%eax,20(%esp)
+	leal	2400959708(%eax,%ebp,1),%eax
+	movl	%edx,%ebp
+	addl	%esi,%eax
+	andl	%edi,%ebp
+	movl	24(%esp),%esi
+	addl	%ebp,%eax
+
+	movl	%ecx,%ebp
+	xorl	32(%esp),%esi
+	xorl	%edx,%ebp
+	xorl	56(%esp),%esi
+	andl	%ebx,%ebp
+	xorl	12(%esp),%esi
+	roll	$1,%esi
+	addl	%edi,%ebp
+	rorl	$2,%ebx
+	movl	%eax,%edi
+	roll	$5,%edi
+	movl	%esi,24(%esp)
+	leal	2400959708(%esi,%ebp,1),%esi
+	movl	%ecx,%ebp
+	addl	%edi,%esi
+	andl	%edx,%ebp
+	movl	28(%esp),%edi
+	addl	%ebp,%esi
+
+	movl	%ebx,%ebp
+	xorl	36(%esp),%edi
+	xorl	%ecx,%ebp
+	xorl	60(%esp),%edi
+	andl	%eax,%ebp
+	xorl	16(%esp),%edi
+	roll	$1,%edi
+	addl	%edx,%ebp
+	rorl	$2,%eax
+	movl	%esi,%edx
+	roll	$5,%edx
+	movl	%edi,28(%esp)
+	leal	2400959708(%edi,%ebp,1),%edi
+	movl	%ebx,%ebp
+	addl	%edx,%edi
+	andl	%ecx,%ebp
+	movl	32(%esp),%edx
+	addl	%ebp,%edi
+
+	movl	%eax,%ebp
+	xorl	40(%esp),%edx
+	xorl	%ebx,%ebp
+	xorl	(%esp),%edx
+	andl	%esi,%ebp
+	xorl	20(%esp),%edx
+	roll	$1,%edx
+	addl	%ecx,%ebp
+	rorl	$2,%esi
+	movl	%edi,%ecx
+	roll	$5,%ecx
+	movl	%edx,32(%esp)
+	leal	2400959708(%edx,%ebp,1),%edx
+	movl	%eax,%ebp
+	addl	%ecx,%edx
+	andl	%ebx,%ebp
+	movl	36(%esp),%ecx
+	addl	%ebp,%edx
+
+	movl	%esi,%ebp
+	xorl	44(%esp),%ecx
+	xorl	%eax,%ebp
+	xorl	4(%esp),%ecx
+	andl	%edi,%ebp
+	xorl	24(%esp),%ecx
+	roll	$1,%ecx
+	addl	%ebx,%ebp
+	rorl	$2,%edi
+	movl	%edx,%ebx
+	roll	$5,%ebx
+	movl	%ecx,36(%esp)
+	leal	2400959708(%ecx,%ebp,1),%ecx
+	movl	%esi,%ebp
+	addl	%ebx,%ecx
+	andl	%eax,%ebp
+	movl	40(%esp),%ebx
+	addl	%ebp,%ecx
+
+	movl	%edi,%ebp
+	xorl	48(%esp),%ebx
+	xorl	%esi,%ebp
+	xorl	8(%esp),%ebx
+	andl	%edx,%ebp
+	xorl	28(%esp),%ebx
+	roll	$1,%ebx
+	addl	%eax,%ebp
+	rorl	$2,%edx
+	movl	%ecx,%eax
+	roll	$5,%eax
+	movl	%ebx,40(%esp)
+	leal	2400959708(%ebx,%ebp,1),%ebx
+	movl	%edi,%ebp
+	addl	%eax,%ebx
+	andl	%esi,%ebp
+	movl	44(%esp),%eax
+	addl	%ebp,%ebx
+
+	movl	%edx,%ebp
+	xorl	52(%esp),%eax
+	xorl	%edi,%ebp
+	xorl	12(%esp),%eax
+	andl	%ecx,%ebp
+	xorl	32(%esp),%eax
+	roll	$1,%eax
+	addl	%esi,%ebp
+	rorl	$2,%ecx
+	movl	%ebx,%esi
+	roll	$5,%esi
+	movl	%eax,44(%esp)
+	leal	2400959708(%eax,%ebp,1),%eax
+	movl	%edx,%ebp
+	addl	%esi,%eax
+	andl	%edi,%ebp
+	movl	48(%esp),%esi
+	addl	%ebp,%eax
+
+	movl	%ebx,%ebp
+	xorl	56(%esp),%esi
+	xorl	%ecx,%ebp
+	xorl	16(%esp),%esi
+	xorl	%edx,%ebp
+	xorl	36(%esp),%esi
+	roll	$1,%esi
+	addl	%ebp,%edi
+	rorl	$2,%ebx
+	movl	%eax,%ebp
+	roll	$5,%ebp
+	movl	%esi,48(%esp)
+	leal	3395469782(%esi,%edi,1),%esi
+	movl	52(%esp),%edi
+	addl	%ebp,%esi
+
+	movl	%eax,%ebp
+	xorl	60(%esp),%edi
+	xorl	%ebx,%ebp
+	xorl	20(%esp),%edi
+	xorl	%ecx,%ebp
+	xorl	40(%esp),%edi
+	roll	$1,%edi
+	addl	%ebp,%edx
+	rorl	$2,%eax
+	movl	%esi,%ebp
+	roll	$5,%ebp
+	movl	%edi,52(%esp)
+	leal	3395469782(%edi,%edx,1),%edi
+	movl	56(%esp),%edx
+	addl	%ebp,%edi
+
+	movl	%esi,%ebp
+	xorl	(%esp),%edx
+	xorl	%eax,%ebp
+	xorl	24(%esp),%edx
+	xorl	%ebx,%ebp
+	xorl	44(%esp),%edx
+	roll	$1,%edx
+	addl	%ebp,%ecx
+	rorl	$2,%esi
+	movl	%edi,%ebp
+	roll	$5,%ebp
+	movl	%edx,56(%esp)
+	leal	3395469782(%edx,%ecx,1),%edx
+	movl	60(%esp),%ecx
+	addl	%ebp,%edx
+
+	movl	%edi,%ebp
+	xorl	4(%esp),%ecx
+	xorl	%esi,%ebp
+	xorl	28(%esp),%ecx
+	xorl	%eax,%ebp
+	xorl	48(%esp),%ecx
+	roll	$1,%ecx
+	addl	%ebp,%ebx
+	rorl	$2,%edi
+	movl	%edx,%ebp
+	roll	$5,%ebp
+	movl	%ecx,60(%esp)
+	leal	3395469782(%ecx,%ebx,1),%ecx
+	movl	(%esp),%ebx
+	addl	%ebp,%ecx
+
+	movl	%edx,%ebp
+	xorl	8(%esp),%ebx
+	xorl	%edi,%ebp
+	xorl	32(%esp),%ebx
+	xorl	%esi,%ebp
+	xorl	52(%esp),%ebx
+	roll	$1,%ebx
+	addl	%ebp,%eax
+	rorl	$2,%edx
+	movl	%ecx,%ebp
+	roll	$5,%ebp
+	movl	%ebx,(%esp)
+	leal	3395469782(%ebx,%eax,1),%ebx
+	movl	4(%esp),%eax
+	addl	%ebp,%ebx
+
+	movl	%ecx,%ebp
+	xorl	12(%esp),%eax
+	xorl	%edx,%ebp
+	xorl	36(%esp),%eax
+	xorl	%edi,%ebp
+	xorl	56(%esp),%eax
+	roll	$1,%eax
+	addl	%ebp,%esi
+	rorl	$2,%ecx
+	movl	%ebx,%ebp
+	roll	$5,%ebp
+	movl	%eax,4(%esp)
+	leal	3395469782(%eax,%esi,1),%eax
+	movl	8(%esp),%esi
+	addl	%ebp,%eax
+
+	movl	%ebx,%ebp
+	xorl	16(%esp),%esi
+	xorl	%ecx,%ebp
+	xorl	40(%esp),%esi
+	xorl	%edx,%ebp
+	xorl	60(%esp),%esi
+	roll	$1,%esi
+	addl	%ebp,%edi
+	rorl	$2,%ebx
+	movl	%eax,%ebp
+	roll	$5,%ebp
+	movl	%esi,8(%esp)
+	leal	3395469782(%esi,%edi,1),%esi
+	movl	12(%esp),%edi
+	addl	%ebp,%esi
+
+	movl	%eax,%ebp
+	xorl	20(%esp),%edi
+	xorl	%ebx,%ebp
+	xorl	44(%esp),%edi
+	xorl	%ecx,%ebp
+	xorl	(%esp),%edi
+	roll	$1,%edi
+	addl	%ebp,%edx
+	rorl	$2,%eax
+	movl	%esi,%ebp
+	roll	$5,%ebp
+	movl	%edi,12(%esp)
+	leal	3395469782(%edi,%edx,1),%edi
+	movl	16(%esp),%edx
+	addl	%ebp,%edi
+
+	movl	%esi,%ebp
+	xorl	24(%esp),%edx
+	xorl	%eax,%ebp
+	xorl	48(%esp),%edx
+	xorl	%ebx,%ebp
+	xorl	4(%esp),%edx
+	roll	$1,%edx
+	addl	%ebp,%ecx
+	rorl	$2,%esi
+	movl	%edi,%ebp
+	roll	$5,%ebp
+	movl	%edx,16(%esp)
+	leal	3395469782(%edx,%ecx,1),%edx
+	movl	20(%esp),%ecx
+	addl	%ebp,%edx
+
+	movl	%edi,%ebp
+	xorl	28(%esp),%ecx
+	xorl	%esi,%ebp
+	xorl	52(%esp),%ecx
+	xorl	%eax,%ebp
+	xorl	8(%esp),%ecx
+	roll	$1,%ecx
+	addl	%ebp,%ebx
+	rorl	$2,%edi
+	movl	%edx,%ebp
+	roll	$5,%ebp
+	movl	%ecx,20(%esp)
+	leal	3395469782(%ecx,%ebx,1),%ecx
+	movl	24(%esp),%ebx
+	addl	%ebp,%ecx
+
+	movl	%edx,%ebp
+	xorl	32(%esp),%ebx
+	xorl	%edi,%ebp
+	xorl	56(%esp),%ebx
+	xorl	%esi,%ebp
+	xorl	12(%esp),%ebx
+	roll	$1,%ebx
+	addl	%ebp,%eax
+	rorl	$2,%edx
+	movl	%ecx,%ebp
+	roll	$5,%ebp
+	movl	%ebx,24(%esp)
+	leal	3395469782(%ebx,%eax,1),%ebx
+	movl	28(%esp),%eax
+	addl	%ebp,%ebx
+
+	movl	%ecx,%ebp
+	xorl	36(%esp),%eax
+	xorl	%edx,%ebp
+	xorl	60(%esp),%eax
+	xorl	%edi,%ebp
+	xorl	16(%esp),%eax
+	roll	$1,%eax
+	addl	%ebp,%esi
+	rorl	$2,%ecx
+	movl	%ebx,%ebp
+	roll	$5,%ebp
+	movl	%eax,28(%esp)
+	leal	3395469782(%eax,%esi,1),%eax
+	movl	32(%esp),%esi
+	addl	%ebp,%eax
+
+	movl	%ebx,%ebp
+	xorl	40(%esp),%esi
+	xorl	%ecx,%ebp
+	xorl	(%esp),%esi
+	xorl	%edx,%ebp
+	xorl	20(%esp),%esi
+	roll	$1,%esi
+	addl	%ebp,%edi
+	rorl	$2,%ebx
+	movl	%eax,%ebp
+	roll	$5,%ebp
+	movl	%esi,32(%esp)
+	leal	3395469782(%esi,%edi,1),%esi
+	movl	36(%esp),%edi
+	addl	%ebp,%esi
+
+	movl	%eax,%ebp
+	xorl	44(%esp),%edi
+	xorl	%ebx,%ebp
+	xorl	4(%esp),%edi
+	xorl	%ecx,%ebp
+	xorl	24(%esp),%edi
+	roll	$1,%edi
+	addl	%ebp,%edx
+	rorl	$2,%eax
+	movl	%esi,%ebp
+	roll	$5,%ebp
+	movl	%edi,36(%esp)
+	leal	3395469782(%edi,%edx,1),%edi
+	movl	40(%esp),%edx
+	addl	%ebp,%edi
+
+	movl	%esi,%ebp
+	xorl	48(%esp),%edx
+	xorl	%eax,%ebp
+	xorl	8(%esp),%edx
+	xorl	%ebx,%ebp
+	xorl	28(%esp),%edx
+	roll	$1,%edx
+	addl	%ebp,%ecx
+	rorl	$2,%esi
+	movl	%edi,%ebp
+	roll	$5,%ebp
+	movl	%edx,40(%esp)
+	leal	3395469782(%edx,%ecx,1),%edx
+	movl	44(%esp),%ecx
+	addl	%ebp,%edx
+
+	movl	%edi,%ebp
+	xorl	52(%esp),%ecx
+	xorl	%esi,%ebp
+	xorl	12(%esp),%ecx
+	xorl	%eax,%ebp
+	xorl	32(%esp),%ecx
+	roll	$1,%ecx
+	addl	%ebp,%ebx
+	rorl	$2,%edi
+	movl	%edx,%ebp
+	roll	$5,%ebp
+	movl	%ecx,44(%esp)
+	leal	3395469782(%ecx,%ebx,1),%ecx
+	movl	48(%esp),%ebx
+	addl	%ebp,%ecx
+
+	movl	%edx,%ebp
+	xorl	56(%esp),%ebx
+	xorl	%edi,%ebp
+	xorl	16(%esp),%ebx
+	xorl	%esi,%ebp
+	xorl	36(%esp),%ebx
+	roll	$1,%ebx
+	addl	%ebp,%eax
+	rorl	$2,%edx
+	movl	%ecx,%ebp
+	roll	$5,%ebp
+	movl	%ebx,48(%esp)
+	leal	3395469782(%ebx,%eax,1),%ebx
+	movl	52(%esp),%eax
+	addl	%ebp,%ebx
+
+	movl	%ecx,%ebp
+	xorl	60(%esp),%eax
+	xorl	%edx,%ebp
+	xorl	20(%esp),%eax
+	xorl	%edi,%ebp
+	xorl	40(%esp),%eax
+	roll	$1,%eax
+	addl	%ebp,%esi
+	rorl	$2,%ecx
+	movl	%ebx,%ebp
+	roll	$5,%ebp
+	leal	3395469782(%eax,%esi,1),%eax
+	movl	56(%esp),%esi
+	addl	%ebp,%eax
+
+	movl	%ebx,%ebp
+	xorl	(%esp),%esi
+	xorl	%ecx,%ebp
+	xorl	24(%esp),%esi
+	xorl	%edx,%ebp
+	xorl	44(%esp),%esi
+	roll	$1,%esi
+	addl	%ebp,%edi
+	rorl	$2,%ebx
+	movl	%eax,%ebp
+	roll	$5,%ebp
+	leal	3395469782(%esi,%edi,1),%esi
+	movl	60(%esp),%edi
+	addl	%ebp,%esi
+
+	movl	%eax,%ebp
+	xorl	4(%esp),%edi
+	xorl	%ebx,%ebp
+	xorl	28(%esp),%edi
+	xorl	%ecx,%ebp
+	xorl	48(%esp),%edi
+	roll	$1,%edi
+	addl	%ebp,%edx
+	rorl	$2,%eax
+	movl	%esi,%ebp
+	roll	$5,%ebp
+	leal	3395469782(%edi,%edx,1),%edi
+	addl	%ebp,%edi
+	movl	96(%esp),%ebp
+	movl	100(%esp),%edx
+	addl	(%ebp),%edi
+	addl	4(%ebp),%esi
+	addl	8(%ebp),%eax
+	addl	12(%ebp),%ebx
+	addl	16(%ebp),%ecx
+	movl	%edi,(%ebp)
+	addl	$64,%edx
+	movl	%esi,4(%ebp)
+	cmpl	104(%esp),%edx
+	movl	%eax,8(%ebp)
+	movl	%ecx,%edi
+	movl	%ebx,12(%ebp)
+	movl	%edx,%esi
+	movl	%ecx,16(%ebp)
+	jb	.L002loop
+	addl	$76,%esp
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.size	sha1_block_data_order,.-.L_sha1_block_data_order_begin
+.hidden	_sha1_block_data_order_shaext
+.type	_sha1_block_data_order_shaext,@function
+.align	16
+_sha1_block_data_order_shaext:
+	pushl	%ebp
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+	call	.L003pic_point
+.L003pic_point:
+	popl	%ebp
+	leal	.LK_XX_XX-.L003pic_point(%ebp),%ebp
+.Lshaext_shortcut:
+	movl	20(%esp),%edi
+	movl	%esp,%ebx
+	movl	24(%esp),%esi
+	movl	28(%esp),%ecx
+	subl	$32,%esp
+	movdqu	(%edi),%xmm0
+	movd	16(%edi),%xmm1
+	andl	$-32,%esp
+	movdqa	80(%ebp),%xmm3
+	movdqu	(%esi),%xmm4
+	pshufd	$27,%xmm0,%xmm0
+	movdqu	16(%esi),%xmm5
+	pshufd	$27,%xmm1,%xmm1
+	movdqu	32(%esi),%xmm6
+.byte	102,15,56,0,227
+	movdqu	48(%esi),%xmm7
+.byte	102,15,56,0,235
+.byte	102,15,56,0,243
+.byte	102,15,56,0,251
+	jmp	.L004loop_shaext
+.align	16
+.L004loop_shaext:
+	decl	%ecx
+	leal	64(%esi),%eax
+	movdqa	%xmm1,(%esp)
+	paddd	%xmm4,%xmm1
+	cmovnel	%eax,%esi
+	movdqa	%xmm0,16(%esp)
+.byte	15,56,201,229
+	movdqa	%xmm0,%xmm2
+.byte	15,58,204,193,0
+.byte	15,56,200,213
+	pxor	%xmm6,%xmm4
+.byte	15,56,201,238
+.byte	15,56,202,231
+	movdqa	%xmm0,%xmm1
+.byte	15,58,204,194,0
+.byte	15,56,200,206
+	pxor	%xmm7,%xmm5
+.byte	15,56,202,236
+.byte	15,56,201,247
+	movdqa	%xmm0,%xmm2
+.byte	15,58,204,193,0
+.byte	15,56,200,215
+	pxor	%xmm4,%xmm6
+.byte	15,56,201,252
+.byte	15,56,202,245
+	movdqa	%xmm0,%xmm1
+.byte	15,58,204,194,0
+.byte	15,56,200,204
+	pxor	%xmm5,%xmm7
+.byte	15,56,202,254
+.byte	15,56,201,229
+	movdqa	%xmm0,%xmm2
+.byte	15,58,204,193,0
+.byte	15,56,200,213
+	pxor	%xmm6,%xmm4
+.byte	15,56,201,238
+.byte	15,56,202,231
+	movdqa	%xmm0,%xmm1
+.byte	15,58,204,194,1
+.byte	15,56,200,206
+	pxor	%xmm7,%xmm5
+.byte	15,56,202,236
+.byte	15,56,201,247
+	movdqa	%xmm0,%xmm2
+.byte	15,58,204,193,1
+.byte	15,56,200,215
+	pxor	%xmm4,%xmm6
+.byte	15,56,201,252
+.byte	15,56,202,245
+	movdqa	%xmm0,%xmm1
+.byte	15,58,204,194,1
+.byte	15,56,200,204
+	pxor	%xmm5,%xmm7
+.byte	15,56,202,254
+.byte	15,56,201,229
+	movdqa	%xmm0,%xmm2
+.byte	15,58,204,193,1
+.byte	15,56,200,213
+	pxor	%xmm6,%xmm4
+.byte	15,56,201,238
+.byte	15,56,202,231
+	movdqa	%xmm0,%xmm1
+.byte	15,58,204,194,1
+.byte	15,56,200,206
+	pxor	%xmm7,%xmm5
+.byte	15,56,202,236
+.byte	15,56,201,247
+	movdqa	%xmm0,%xmm2
+.byte	15,58,204,193,2
+.byte	15,56,200,215
+	pxor	%xmm4,%xmm6
+.byte	15,56,201,252
+.byte	15,56,202,245
+	movdqa	%xmm0,%xmm1
+.byte	15,58,204,194,2
+.byte	15,56,200,204
+	pxor	%xmm5,%xmm7
+.byte	15,56,202,254
+.byte	15,56,201,229
+	movdqa	%xmm0,%xmm2
+.byte	15,58,204,193,2
+.byte	15,56,200,213
+	pxor	%xmm6,%xmm4
+.byte	15,56,201,238
+.byte	15,56,202,231
+	movdqa	%xmm0,%xmm1
+.byte	15,58,204,194,2
+.byte	15,56,200,206
+	pxor	%xmm7,%xmm5
+.byte	15,56,202,236
+.byte	15,56,201,247
+	movdqa	%xmm0,%xmm2
+.byte	15,58,204,193,2
+.byte	15,56,200,215
+	pxor	%xmm4,%xmm6
+.byte	15,56,201,252
+.byte	15,56,202,245
+	movdqa	%xmm0,%xmm1
+.byte	15,58,204,194,3
+.byte	15,56,200,204
+	pxor	%xmm5,%xmm7
+.byte	15,56,202,254
+	movdqu	(%esi),%xmm4
+	movdqa	%xmm0,%xmm2
+.byte	15,58,204,193,3
+.byte	15,56,200,213
+	movdqu	16(%esi),%xmm5
+.byte	102,15,56,0,227
+	movdqa	%xmm0,%xmm1
+.byte	15,58,204,194,3
+.byte	15,56,200,206
+	movdqu	32(%esi),%xmm6
+.byte	102,15,56,0,235
+	movdqa	%xmm0,%xmm2
+.byte	15,58,204,193,3
+.byte	15,56,200,215
+	movdqu	48(%esi),%xmm7
+.byte	102,15,56,0,243
+	movdqa	%xmm0,%xmm1
+.byte	15,58,204,194,3
+	movdqa	(%esp),%xmm2
+.byte	102,15,56,0,251
+.byte	15,56,200,202
+	paddd	16(%esp),%xmm0
+	jnz	.L004loop_shaext
+	pshufd	$27,%xmm0,%xmm0
+	pshufd	$27,%xmm1,%xmm1
+	movdqu	%xmm0,(%edi)
+	movd	%xmm1,16(%edi)
+	movl	%ebx,%esp
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.size	_sha1_block_data_order_shaext,.-_sha1_block_data_order_shaext
+.hidden	_sha1_block_data_order_ssse3
+.type	_sha1_block_data_order_ssse3,@function
+.align	16
+_sha1_block_data_order_ssse3:
+	pushl	%ebp
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+	call	.L005pic_point
+.L005pic_point:
+	popl	%ebp
+	leal	.LK_XX_XX-.L005pic_point(%ebp),%ebp
+.Lssse3_shortcut:
+	movdqa	(%ebp),%xmm7
+	movdqa	16(%ebp),%xmm0
+	movdqa	32(%ebp),%xmm1
+	movdqa	48(%ebp),%xmm2
+	movdqa	64(%ebp),%xmm6
+	movl	20(%esp),%edi
+	movl	24(%esp),%ebp
+	movl	28(%esp),%edx
+	movl	%esp,%esi
+	subl	$208,%esp
+	andl	$-64,%esp
+	movdqa	%xmm0,112(%esp)
+	movdqa	%xmm1,128(%esp)
+	movdqa	%xmm2,144(%esp)
+	shll	$6,%edx
+	movdqa	%xmm7,160(%esp)
+	addl	%ebp,%edx
+	movdqa	%xmm6,176(%esp)
+	addl	$64,%ebp
+	movl	%edi,192(%esp)
+	movl	%ebp,196(%esp)
+	movl	%edx,200(%esp)
+	movl	%esi,204(%esp)
+	movl	(%edi),%eax
+	movl	4(%edi),%ebx
+	movl	8(%edi),%ecx
+	movl	12(%edi),%edx
+	movl	16(%edi),%edi
+	movl	%ebx,%esi
+	movdqu	-64(%ebp),%xmm0
+	movdqu	-48(%ebp),%xmm1
+	movdqu	-32(%ebp),%xmm2
+	movdqu	-16(%ebp),%xmm3
+.byte	102,15,56,0,198
+.byte	102,15,56,0,206
+.byte	102,15,56,0,214
+	movdqa	%xmm7,96(%esp)
+.byte	102,15,56,0,222
+	paddd	%xmm7,%xmm0
+	paddd	%xmm7,%xmm1
+	paddd	%xmm7,%xmm2
+	movdqa	%xmm0,(%esp)
+	psubd	%xmm7,%xmm0
+	movdqa	%xmm1,16(%esp)
+	psubd	%xmm7,%xmm1
+	movdqa	%xmm2,32(%esp)
+	movl	%ecx,%ebp
+	psubd	%xmm7,%xmm2
+	xorl	%edx,%ebp
+	pshufd	$238,%xmm0,%xmm4
+	andl	%ebp,%esi
+	jmp	.L006loop
+.align	16
+.L006loop:
+	rorl	$2,%ebx
+	xorl	%edx,%esi
+	movl	%eax,%ebp
+	punpcklqdq	%xmm1,%xmm4
+	movdqa	%xmm3,%xmm6
+	addl	(%esp),%edi
+	xorl	%ecx,%ebx
+	paddd	%xmm3,%xmm7
+	movdqa	%xmm0,64(%esp)
+	roll	$5,%eax
+	addl	%esi,%edi
+	psrldq	$4,%xmm6
+	andl	%ebx,%ebp
+	xorl	%ecx,%ebx
+	pxor	%xmm0,%xmm4
+	addl	%eax,%edi
+	rorl	$7,%eax
+	pxor	%xmm2,%xmm6
+	xorl	%ecx,%ebp
+	movl	%edi,%esi
+	addl	4(%esp),%edx
+	pxor	%xmm6,%xmm4
+	xorl	%ebx,%eax
+	roll	$5,%edi
+	movdqa	%xmm7,48(%esp)
+	addl	%ebp,%edx
+	andl	%eax,%esi
+	movdqa	%xmm4,%xmm0
+	xorl	%ebx,%eax
+	addl	%edi,%edx
+	rorl	$7,%edi
+	movdqa	%xmm4,%xmm6
+	xorl	%ebx,%esi
+	pslldq	$12,%xmm0
+	paddd	%xmm4,%xmm4
+	movl	%edx,%ebp
+	addl	8(%esp),%ecx
+	psrld	$31,%xmm6
+	xorl	%eax,%edi
+	roll	$5,%edx
+	movdqa	%xmm0,%xmm7
+	addl	%esi,%ecx
+	andl	%edi,%ebp
+	xorl	%eax,%edi
+	psrld	$30,%xmm0
+	addl	%edx,%ecx
+	rorl	$7,%edx
+	por	%xmm6,%xmm4
+	xorl	%eax,%ebp
+	movl	%ecx,%esi
+	addl	12(%esp),%ebx
+	pslld	$2,%xmm7
+	xorl	%edi,%edx
+	roll	$5,%ecx
+	pxor	%xmm0,%xmm4
+	movdqa	96(%esp),%xmm0
+	addl	%ebp,%ebx
+	andl	%edx,%esi
+	pxor	%xmm7,%xmm4
+	pshufd	$238,%xmm1,%xmm5
+	xorl	%edi,%edx
+	addl	%ecx,%ebx
+	rorl	$7,%ecx
+	xorl	%edi,%esi
+	movl	%ebx,%ebp
+	punpcklqdq	%xmm2,%xmm5
+	movdqa	%xmm4,%xmm7
+	addl	16(%esp),%eax
+	xorl	%edx,%ecx
+	paddd	%xmm4,%xmm0
+	movdqa	%xmm1,80(%esp)
+	roll	$5,%ebx
+	addl	%esi,%eax
+	psrldq	$4,%xmm7
+	andl	%ecx,%ebp
+	xorl	%edx,%ecx
+	pxor	%xmm1,%xmm5
+	addl	%ebx,%eax
+	rorl	$7,%ebx
+	pxor	%xmm3,%xmm7
+	xorl	%edx,%ebp
+	movl	%eax,%esi
+	addl	20(%esp),%edi
+	pxor	%xmm7,%xmm5
+	xorl	%ecx,%ebx
+	roll	$5,%eax
+	movdqa	%xmm0,(%esp)
+	addl	%ebp,%edi
+	andl	%ebx,%esi
+	movdqa	%xmm5,%xmm1
+	xorl	%ecx,%ebx
+	addl	%eax,%edi
+	rorl	$7,%eax
+	movdqa	%xmm5,%xmm7
+	xorl	%ecx,%esi
+	pslldq	$12,%xmm1
+	paddd	%xmm5,%xmm5
+	movl	%edi,%ebp
+	addl	24(%esp),%edx
+	psrld	$31,%xmm7
+	xorl	%ebx,%eax
+	roll	$5,%edi
+	movdqa	%xmm1,%xmm0
+	addl	%esi,%edx
+	andl	%eax,%ebp
+	xorl	%ebx,%eax
+	psrld	$30,%xmm1
+	addl	%edi,%edx
+	rorl	$7,%edi
+	por	%xmm7,%xmm5
+	xorl	%ebx,%ebp
+	movl	%edx,%esi
+	addl	28(%esp),%ecx
+	pslld	$2,%xmm0
+	xorl	%eax,%edi
+	roll	$5,%edx
+	pxor	%xmm1,%xmm5
+	movdqa	112(%esp),%xmm1
+	addl	%ebp,%ecx
+	andl	%edi,%esi
+	pxor	%xmm0,%xmm5
+	pshufd	$238,%xmm2,%xmm6
+	xorl	%eax,%edi
+	addl	%edx,%ecx
+	rorl	$7,%edx
+	xorl	%eax,%esi
+	movl	%ecx,%ebp
+	punpcklqdq	%xmm3,%xmm6
+	movdqa	%xmm5,%xmm0
+	addl	32(%esp),%ebx
+	xorl	%edi,%edx
+	paddd	%xmm5,%xmm1
+	movdqa	%xmm2,96(%esp)
+	roll	$5,%ecx
+	addl	%esi,%ebx
+	psrldq	$4,%xmm0
+	andl	%edx,%ebp
+	xorl	%edi,%edx
+	pxor	%xmm2,%xmm6
+	addl	%ecx,%ebx
+	rorl	$7,%ecx
+	pxor	%xmm4,%xmm0
+	xorl	%edi,%ebp
+	movl	%ebx,%esi
+	addl	36(%esp),%eax
+	pxor	%xmm0,%xmm6
+	xorl	%edx,%ecx
+	roll	$5,%ebx
+	movdqa	%xmm1,16(%esp)
+	addl	%ebp,%eax
+	andl	%ecx,%esi
+	movdqa	%xmm6,%xmm2
+	xorl	%edx,%ecx
+	addl	%ebx,%eax
+	rorl	$7,%ebx
+	movdqa	%xmm6,%xmm0
+	xorl	%edx,%esi
+	pslldq	$12,%xmm2
+	paddd	%xmm6,%xmm6
+	movl	%eax,%ebp
+	addl	40(%esp),%edi
+	psrld	$31,%xmm0
+	xorl	%ecx,%ebx
+	roll	$5,%eax
+	movdqa	%xmm2,%xmm1
+	addl	%esi,%edi
+	andl	%ebx,%ebp
+	xorl	%ecx,%ebx
+	psrld	$30,%xmm2
+	addl	%eax,%edi
+	rorl	$7,%eax
+	por	%xmm0,%xmm6
+	xorl	%ecx,%ebp
+	movdqa	64(%esp),%xmm0
+	movl	%edi,%esi
+	addl	44(%esp),%edx
+	pslld	$2,%xmm1
+	xorl	%ebx,%eax
+	roll	$5,%edi
+	pxor	%xmm2,%xmm6
+	movdqa	112(%esp),%xmm2
+	addl	%ebp,%edx
+	andl	%eax,%esi
+	pxor	%xmm1,%xmm6
+	pshufd	$238,%xmm3,%xmm7
+	xorl	%ebx,%eax
+	addl	%edi,%edx
+	rorl	$7,%edi
+	xorl	%ebx,%esi
+	movl	%edx,%ebp
+	punpcklqdq	%xmm4,%xmm7
+	movdqa	%xmm6,%xmm1
+	addl	48(%esp),%ecx
+	xorl	%eax,%edi
+	paddd	%xmm6,%xmm2
+	movdqa	%xmm3,64(%esp)
+	roll	$5,%edx
+	addl	%esi,%ecx
+	psrldq	$4,%xmm1
+	andl	%edi,%ebp
+	xorl	%eax,%edi
+	pxor	%xmm3,%xmm7
+	addl	%edx,%ecx
+	rorl	$7,%edx
+	pxor	%xmm5,%xmm1
+	xorl	%eax,%ebp
+	movl	%ecx,%esi
+	addl	52(%esp),%ebx
+	pxor	%xmm1,%xmm7
+	xorl	%edi,%edx
+	roll	$5,%ecx
+	movdqa	%xmm2,32(%esp)
+	addl	%ebp,%ebx
+	andl	%edx,%esi
+	movdqa	%xmm7,%xmm3
+	xorl	%edi,%edx
+	addl	%ecx,%ebx
+	rorl	$7,%ecx
+	movdqa	%xmm7,%xmm1
+	xorl	%edi,%esi
+	pslldq	$12,%xmm3
+	paddd	%xmm7,%xmm7
+	movl	%ebx,%ebp
+	addl	56(%esp),%eax
+	psrld	$31,%xmm1
+	xorl	%edx,%ecx
+	roll	$5,%ebx
+	movdqa	%xmm3,%xmm2
+	addl	%esi,%eax
+	andl	%ecx,%ebp
+	xorl	%edx,%ecx
+	psrld	$30,%xmm3
+	addl	%ebx,%eax
+	rorl	$7,%ebx
+	por	%xmm1,%xmm7
+	xorl	%edx,%ebp
+	movdqa	80(%esp),%xmm1
+	movl	%eax,%esi
+	addl	60(%esp),%edi
+	pslld	$2,%xmm2
+	xorl	%ecx,%ebx
+	roll	$5,%eax
+	pxor	%xmm3,%xmm7
+	movdqa	112(%esp),%xmm3
+	addl	%ebp,%edi
+	andl	%ebx,%esi
+	pxor	%xmm2,%xmm7
+	pshufd	$238,%xmm6,%xmm2
+	xorl	%ecx,%ebx
+	addl	%eax,%edi
+	rorl	$7,%eax
+	pxor	%xmm4,%xmm0
+	punpcklqdq	%xmm7,%xmm2
+	xorl	%ecx,%esi
+	movl	%edi,%ebp
+	addl	(%esp),%edx
+	pxor	%xmm1,%xmm0
+	movdqa	%xmm4,80(%esp)
+	xorl	%ebx,%eax
+	roll	$5,%edi
+	movdqa	%xmm3,%xmm4
+	addl	%esi,%edx
+	paddd	%xmm7,%xmm3
+	andl	%eax,%ebp
+	pxor	%xmm2,%xmm0
+	xorl	%ebx,%eax
+	addl	%edi,%edx
+	rorl	$7,%edi
+	xorl	%ebx,%ebp
+	movdqa	%xmm0,%xmm2
+	movdqa	%xmm3,48(%esp)
+	movl	%edx,%esi
+	addl	4(%esp),%ecx
+	xorl	%eax,%edi
+	roll	$5,%edx
+	pslld	$2,%xmm0
+	addl	%ebp,%ecx
+	andl	%edi,%esi
+	psrld	$30,%xmm2
+	xorl	%eax,%edi
+	addl	%edx,%ecx
+	rorl	$7,%edx
+	xorl	%eax,%esi
+	movl	%ecx,%ebp
+	addl	8(%esp),%ebx
+	xorl	%edi,%edx
+	roll	$5,%ecx
+	por	%xmm2,%xmm0
+	addl	%esi,%ebx
+	andl	%edx,%ebp
+	movdqa	96(%esp),%xmm2
+	xorl	%edi,%edx
+	addl	%ecx,%ebx
+	addl	12(%esp),%eax
+	xorl	%edi,%ebp
+	movl	%ebx,%esi
+	pshufd	$238,%xmm7,%xmm3
+	roll	$5,%ebx
+	addl	%ebp,%eax
+	xorl	%edx,%esi
+	rorl	$7,%ecx
+	addl	%ebx,%eax
+	addl	16(%esp),%edi
+	pxor	%xmm5,%xmm1
+	punpcklqdq	%xmm0,%xmm3
+	xorl	%ecx,%esi
+	movl	%eax,%ebp
+	roll	$5,%eax
+	pxor	%xmm2,%xmm1
+	movdqa	%xmm5,96(%esp)
+	addl	%esi,%edi
+	xorl	%ecx,%ebp
+	movdqa	%xmm4,%xmm5
+	rorl	$7,%ebx
+	paddd	%xmm0,%xmm4
+	addl	%eax,%edi
+	pxor	%xmm3,%xmm1
+	addl	20(%esp),%edx
+	xorl	%ebx,%ebp
+	movl	%edi,%esi
+	roll	$5,%edi
+	movdqa	%xmm1,%xmm3
+	movdqa	%xmm4,(%esp)
+	addl	%ebp,%edx
+	xorl	%ebx,%esi
+	rorl	$7,%eax
+	addl	%edi,%edx
+	pslld	$2,%xmm1
+	addl	24(%esp),%ecx
+	xorl	%eax,%esi
+	psrld	$30,%xmm3
+	movl	%edx,%ebp
+	roll	$5,%edx
+	addl	%esi,%ecx
+	xorl	%eax,%ebp
+	rorl	$7,%edi
+	addl	%edx,%ecx
+	por	%xmm3,%xmm1
+	addl	28(%esp),%ebx
+	xorl	%edi,%ebp
+	movdqa	64(%esp),%xmm3
+	movl	%ecx,%esi
+	roll	$5,%ecx
+	addl	%ebp,%ebx
+	xorl	%edi,%esi
+	rorl	$7,%edx
+	pshufd	$238,%xmm0,%xmm4
+	addl	%ecx,%ebx
+	addl	32(%esp),%eax
+	pxor	%xmm6,%xmm2
+	punpcklqdq	%xmm1,%xmm4
+	xorl	%edx,%esi
+	movl	%ebx,%ebp
+	roll	$5,%ebx
+	pxor	%xmm3,%xmm2
+	movdqa	%xmm6,64(%esp)
+	addl	%esi,%eax
+	xorl	%edx,%ebp
+	movdqa	128(%esp),%xmm6
+	rorl	$7,%ecx
+	paddd	%xmm1,%xmm5
+	addl	%ebx,%eax
+	pxor	%xmm4,%xmm2
+	addl	36(%esp),%edi
+	xorl	%ecx,%ebp
+	movl	%eax,%esi
+	roll	$5,%eax
+	movdqa	%xmm2,%xmm4
+	movdqa	%xmm5,16(%esp)
+	addl	%ebp,%edi
+	xorl	%ecx,%esi
+	rorl	$7,%ebx
+	addl	%eax,%edi
+	pslld	$2,%xmm2
+	addl	40(%esp),%edx
+	xorl	%ebx,%esi
+	psrld	$30,%xmm4
+	movl	%edi,%ebp
+	roll	$5,%edi
+	addl	%esi,%edx
+	xorl	%ebx,%ebp
+	rorl	$7,%eax
+	addl	%edi,%edx
+	por	%xmm4,%xmm2
+	addl	44(%esp),%ecx
+	xorl	%eax,%ebp
+	movdqa	80(%esp),%xmm4
+	movl	%edx,%esi
+	roll	$5,%edx
+	addl	%ebp,%ecx
+	xorl	%eax,%esi
+	rorl	$7,%edi
+	pshufd	$238,%xmm1,%xmm5
+	addl	%edx,%ecx
+	addl	48(%esp),%ebx
+	pxor	%xmm7,%xmm3
+	punpcklqdq	%xmm2,%xmm5
+	xorl	%edi,%esi
+	movl	%ecx,%ebp
+	roll	$5,%ecx
+	pxor	%xmm4,%xmm3
+	movdqa	%xmm7,80(%esp)
+	addl	%esi,%ebx
+	xorl	%edi,%ebp
+	movdqa	%xmm6,%xmm7
+	rorl	$7,%edx
+	paddd	%xmm2,%xmm6
+	addl	%ecx,%ebx
+	pxor	%xmm5,%xmm3
+	addl	52(%esp),%eax
+	xorl	%edx,%ebp
+	movl	%ebx,%esi
+	roll	$5,%ebx
+	movdqa	%xmm3,%xmm5
+	movdqa	%xmm6,32(%esp)
+	addl	%ebp,%eax
+	xorl	%edx,%esi
+	rorl	$7,%ecx
+	addl	%ebx,%eax
+	pslld	$2,%xmm3
+	addl	56(%esp),%edi
+	xorl	%ecx,%esi
+	psrld	$30,%xmm5
+	movl	%eax,%ebp
+	roll	$5,%eax
+	addl	%esi,%edi
+	xorl	%ecx,%ebp
+	rorl	$7,%ebx
+	addl	%eax,%edi
+	por	%xmm5,%xmm3
+	addl	60(%esp),%edx
+	xorl	%ebx,%ebp
+	movdqa	96(%esp),%xmm5
+	movl	%edi,%esi
+	roll	$5,%edi
+	addl	%ebp,%edx
+	xorl	%ebx,%esi
+	rorl	$7,%eax
+	pshufd	$238,%xmm2,%xmm6
+	addl	%edi,%edx
+	addl	(%esp),%ecx
+	pxor	%xmm0,%xmm4
+	punpcklqdq	%xmm3,%xmm6
+	xorl	%eax,%esi
+	movl	%edx,%ebp
+	roll	$5,%edx
+	pxor	%xmm5,%xmm4
+	movdqa	%xmm0,96(%esp)
+	addl	%esi,%ecx
+	xorl	%eax,%ebp
+	movdqa	%xmm7,%xmm0
+	rorl	$7,%edi
+	paddd	%xmm3,%xmm7
+	addl	%edx,%ecx
+	pxor	%xmm6,%xmm4
+	addl	4(%esp),%ebx
+	xorl	%edi,%ebp
+	movl	%ecx,%esi
+	roll	$5,%ecx
+	movdqa	%xmm4,%xmm6
+	movdqa	%xmm7,48(%esp)
+	addl	%ebp,%ebx
+	xorl	%edi,%esi
+	rorl	$7,%edx
+	addl	%ecx,%ebx
+	pslld	$2,%xmm4
+	addl	8(%esp),%eax
+	xorl	%edx,%esi
+	psrld	$30,%xmm6
+	movl	%ebx,%ebp
+	roll	$5,%ebx
+	addl	%esi,%eax
+	xorl	%edx,%ebp
+	rorl	$7,%ecx
+	addl	%ebx,%eax
+	por	%xmm6,%xmm4
+	addl	12(%esp),%edi
+	xorl	%ecx,%ebp
+	movdqa	64(%esp),%xmm6
+	movl	%eax,%esi
+	roll	$5,%eax
+	addl	%ebp,%edi
+	xorl	%ecx,%esi
+	rorl	$7,%ebx
+	pshufd	$238,%xmm3,%xmm7
+	addl	%eax,%edi
+	addl	16(%esp),%edx
+	pxor	%xmm1,%xmm5
+	punpcklqdq	%xmm4,%xmm7
+	xorl	%ebx,%esi
+	movl	%edi,%ebp
+	roll	$5,%edi
+	pxor	%xmm6,%xmm5
+	movdqa	%xmm1,64(%esp)
+	addl	%esi,%edx
+	xorl	%ebx,%ebp
+	movdqa	%xmm0,%xmm1
+	rorl	$7,%eax
+	paddd	%xmm4,%xmm0
+	addl	%edi,%edx
+	pxor	%xmm7,%xmm5
+	addl	20(%esp),%ecx
+	xorl	%eax,%ebp
+	movl	%edx,%esi
+	roll	$5,%edx
+	movdqa	%xmm5,%xmm7
+	movdqa	%xmm0,(%esp)
+	addl	%ebp,%ecx
+	xorl	%eax,%esi
+	rorl	$7,%edi
+	addl	%edx,%ecx
+	pslld	$2,%xmm5
+	addl	24(%esp),%ebx
+	xorl	%edi,%esi
+	psrld	$30,%xmm7
+	movl	%ecx,%ebp
+	roll	$5,%ecx
+	addl	%esi,%ebx
+	xorl	%edi,%ebp
+	rorl	$7,%edx
+	addl	%ecx,%ebx
+	por	%xmm7,%xmm5
+	addl	28(%esp),%eax
+	movdqa	80(%esp),%xmm7
+	rorl	$7,%ecx
+	movl	%ebx,%esi
+	xorl	%edx,%ebp
+	roll	$5,%ebx
+	pshufd	$238,%xmm4,%xmm0
+	addl	%ebp,%eax
+	xorl	%ecx,%esi
+	xorl	%edx,%ecx
+	addl	%ebx,%eax
+	addl	32(%esp),%edi
+	pxor	%xmm2,%xmm6
+	punpcklqdq	%xmm5,%xmm0
+	andl	%ecx,%esi
+	xorl	%edx,%ecx
+	rorl	$7,%ebx
+	pxor	%xmm7,%xmm6
+	movdqa	%xmm2,80(%esp)
+	movl	%eax,%ebp
+	xorl	%ecx,%esi
+	roll	$5,%eax
+	movdqa	%xmm1,%xmm2
+	addl	%esi,%edi
+	paddd	%xmm5,%xmm1
+	xorl	%ebx,%ebp
+	pxor	%xmm0,%xmm6
+	xorl	%ecx,%ebx
+	addl	%eax,%edi
+	addl	36(%esp),%edx
+	andl	%ebx,%ebp
+	movdqa	%xmm6,%xmm0
+	movdqa	%xmm1,16(%esp)
+	xorl	%ecx,%ebx
+	rorl	$7,%eax
+	movl	%edi,%esi
+	xorl	%ebx,%ebp
+	roll	$5,%edi
+	pslld	$2,%xmm6
+	addl	%ebp,%edx
+	xorl	%eax,%esi
+	psrld	$30,%xmm0
+	xorl	%ebx,%eax
+	addl	%edi,%edx
+	addl	40(%esp),%ecx
+	andl	%eax,%esi
+	xorl	%ebx,%eax
+	rorl	$7,%edi
+	por	%xmm0,%xmm6
+	movl	%edx,%ebp
+	xorl	%eax,%esi
+	movdqa	96(%esp),%xmm0
+	roll	$5,%edx
+	addl	%esi,%ecx
+	xorl	%edi,%ebp
+	xorl	%eax,%edi
+	addl	%edx,%ecx
+	pshufd	$238,%xmm5,%xmm1
+	addl	44(%esp),%ebx
+	andl	%edi,%ebp
+	xorl	%eax,%edi
+	rorl	$7,%edx
+	movl	%ecx,%esi
+	xorl	%edi,%ebp
+	roll	$5,%ecx
+	addl	%ebp,%ebx
+	xorl	%edx,%esi
+	xorl	%edi,%edx
+	addl	%ecx,%ebx
+	addl	48(%esp),%eax
+	pxor	%xmm3,%xmm7
+	punpcklqdq	%xmm6,%xmm1
+	andl	%edx,%esi
+	xorl	%edi,%edx
+	rorl	$7,%ecx
+	pxor	%xmm0,%xmm7
+	movdqa	%xmm3,96(%esp)
+	movl	%ebx,%ebp
+	xorl	%edx,%esi
+	roll	$5,%ebx
+	movdqa	144(%esp),%xmm3
+	addl	%esi,%eax
+	paddd	%xmm6,%xmm2
+	xorl	%ecx,%ebp
+	pxor	%xmm1,%xmm7
+	xorl	%edx,%ecx
+	addl	%ebx,%eax
+	addl	52(%esp),%edi
+	andl	%ecx,%ebp
+	movdqa	%xmm7,%xmm1
+	movdqa	%xmm2,32(%esp)
+	xorl	%edx,%ecx
+	rorl	$7,%ebx
+	movl	%eax,%esi
+	xorl	%ecx,%ebp
+	roll	$5,%eax
+	pslld	$2,%xmm7
+	addl	%ebp,%edi
+	xorl	%ebx,%esi
+	psrld	$30,%xmm1
+	xorl	%ecx,%ebx
+	addl	%eax,%edi
+	addl	56(%esp),%edx
+	andl	%ebx,%esi
+	xorl	%ecx,%ebx
+	rorl	$7,%eax
+	por	%xmm1,%xmm7
+	movl	%edi,%ebp
+	xorl	%ebx,%esi
+	movdqa	64(%esp),%xmm1
+	roll	$5,%edi
+	addl	%esi,%edx
+	xorl	%eax,%ebp
+	xorl	%ebx,%eax
+	addl	%edi,%edx
+	pshufd	$238,%xmm6,%xmm2
+	addl	60(%esp),%ecx
+	andl	%eax,%ebp
+	xorl	%ebx,%eax
+	rorl	$7,%edi
+	movl	%edx,%esi
+	xorl	%eax,%ebp
+	roll	$5,%edx
+	addl	%ebp,%ecx
+	xorl	%edi,%esi
+	xorl	%eax,%edi
+	addl	%edx,%ecx
+	addl	(%esp),%ebx
+	pxor	%xmm4,%xmm0
+	punpcklqdq	%xmm7,%xmm2
+	andl	%edi,%esi
+	xorl	%eax,%edi
+	rorl	$7,%edx
+	pxor	%xmm1,%xmm0
+	movdqa	%xmm4,64(%esp)
+	movl	%ecx,%ebp
+	xorl	%edi,%esi
+	roll	$5,%ecx
+	movdqa	%xmm3,%xmm4
+	addl	%esi,%ebx
+	paddd	%xmm7,%xmm3
+	xorl	%edx,%ebp
+	pxor	%xmm2,%xmm0
+	xorl	%edi,%edx
+	addl	%ecx,%ebx
+	addl	4(%esp),%eax
+	andl	%edx,%ebp
+	movdqa	%xmm0,%xmm2
+	movdqa	%xmm3,48(%esp)
+	xorl	%edi,%edx
+	rorl	$7,%ecx
+	movl	%ebx,%esi
+	xorl	%edx,%ebp
+	roll	$5,%ebx
+	pslld	$2,%xmm0
+	addl	%ebp,%eax
+	xorl	%ecx,%esi
+	psrld	$30,%xmm2
+	xorl	%edx,%ecx
+	addl	%ebx,%eax
+	addl	8(%esp),%edi
+	andl	%ecx,%esi
+	xorl	%edx,%ecx
+	rorl	$7,%ebx
+	por	%xmm2,%xmm0
+	movl	%eax,%ebp
+	xorl	%ecx,%esi
+	movdqa	80(%esp),%xmm2
+	roll	$5,%eax
+	addl	%esi,%edi
+	xorl	%ebx,%ebp
+	xorl	%ecx,%ebx
+	addl	%eax,%edi
+	pshufd	$238,%xmm7,%xmm3
+	addl	12(%esp),%edx
+	andl	%ebx,%ebp
+	xorl	%ecx,%ebx
+	rorl	$7,%eax
+	movl	%edi,%esi
+	xorl	%ebx,%ebp
+	roll	$5,%edi
+	addl	%ebp,%edx
+	xorl	%eax,%esi
+	xorl	%ebx,%eax
+	addl	%edi,%edx
+	addl	16(%esp),%ecx
+	pxor	%xmm5,%xmm1
+	punpcklqdq	%xmm0,%xmm3
+	andl	%eax,%esi
+	xorl	%ebx,%eax
+	rorl	$7,%edi
+	pxor	%xmm2,%xmm1
+	movdqa	%xmm5,80(%esp)
+	movl	%edx,%ebp
+	xorl	%eax,%esi
+	roll	$5,%edx
+	movdqa	%xmm4,%xmm5
+	addl	%esi,%ecx
+	paddd	%xmm0,%xmm4
+	xorl	%edi,%ebp
+	pxor	%xmm3,%xmm1
+	xorl	%eax,%edi
+	addl	%edx,%ecx
+	addl	20(%esp),%ebx
+	andl	%edi,%ebp
+	movdqa	%xmm1,%xmm3
+	movdqa	%xmm4,(%esp)
+	xorl	%eax,%edi
+	rorl	$7,%edx
+	movl	%ecx,%esi
+	xorl	%edi,%ebp
+	roll	$5,%ecx
+	pslld	$2,%xmm1
+	addl	%ebp,%ebx
+	xorl	%edx,%esi
+	psrld	$30,%xmm3
+	xorl	%edi,%edx
+	addl	%ecx,%ebx
+	addl	24(%esp),%eax
+	andl	%edx,%esi
+	xorl	%edi,%edx
+	rorl	$7,%ecx
+	por	%xmm3,%xmm1
+	movl	%ebx,%ebp
+	xorl	%edx,%esi
+	movdqa	96(%esp),%xmm3
+	roll	$5,%ebx
+	addl	%esi,%eax
+	xorl	%ecx,%ebp
+	xorl	%edx,%ecx
+	addl	%ebx,%eax
+	pshufd	$238,%xmm0,%xmm4
+	addl	28(%esp),%edi
+	andl	%ecx,%ebp
+	xorl	%edx,%ecx
+	rorl	$7,%ebx
+	movl	%eax,%esi
+	xorl	%ecx,%ebp
+	roll	$5,%eax
+	addl	%ebp,%edi
+	xorl	%ebx,%esi
+	xorl	%ecx,%ebx
+	addl	%eax,%edi
+	addl	32(%esp),%edx
+	pxor	%xmm6,%xmm2
+	punpcklqdq	%xmm1,%xmm4
+	andl	%ebx,%esi
+	xorl	%ecx,%ebx
+	rorl	$7,%eax
+	pxor	%xmm3,%xmm2
+	movdqa	%xmm6,96(%esp)
+	movl	%edi,%ebp
+	xorl	%ebx,%esi
+	roll	$5,%edi
+	movdqa	%xmm5,%xmm6
+	addl	%esi,%edx
+	paddd	%xmm1,%xmm5
+	xorl	%eax,%ebp
+	pxor	%xmm4,%xmm2
+	xorl	%ebx,%eax
+	addl	%edi,%edx
+	addl	36(%esp),%ecx
+	andl	%eax,%ebp
+	movdqa	%xmm2,%xmm4
+	movdqa	%xmm5,16(%esp)
+	xorl	%ebx,%eax
+	rorl	$7,%edi
+	movl	%edx,%esi
+	xorl	%eax,%ebp
+	roll	$5,%edx
+	pslld	$2,%xmm2
+	addl	%ebp,%ecx
+	xorl	%edi,%esi
+	psrld	$30,%xmm4
+	xorl	%eax,%edi
+	addl	%edx,%ecx
+	addl	40(%esp),%ebx
+	andl	%edi,%esi
+	xorl	%eax,%edi
+	rorl	$7,%edx
+	por	%xmm4,%xmm2
+	movl	%ecx,%ebp
+	xorl	%edi,%esi
+	movdqa	64(%esp),%xmm4
+	roll	$5,%ecx
+	addl	%esi,%ebx
+	xorl	%edx,%ebp
+	xorl	%edi,%edx
+	addl	%ecx,%ebx
+	pshufd	$238,%xmm1,%xmm5
+	addl	44(%esp),%eax
+	andl	%edx,%ebp
+	xorl	%edi,%edx
+	rorl	$7,%ecx
+	movl	%ebx,%esi
+	xorl	%edx,%ebp
+	roll	$5,%ebx
+	addl	%ebp,%eax
+	xorl	%edx,%esi
+	addl	%ebx,%eax
+	addl	48(%esp),%edi
+	pxor	%xmm7,%xmm3
+	punpcklqdq	%xmm2,%xmm5
+	xorl	%ecx,%esi
+	movl	%eax,%ebp
+	roll	$5,%eax
+	pxor	%xmm4,%xmm3
+	movdqa	%xmm7,64(%esp)
+	addl	%esi,%edi
+	xorl	%ecx,%ebp
+	movdqa	%xmm6,%xmm7
+	rorl	$7,%ebx
+	paddd	%xmm2,%xmm6
+	addl	%eax,%edi
+	pxor	%xmm5,%xmm3
+	addl	52(%esp),%edx
+	xorl	%ebx,%ebp
+	movl	%edi,%esi
+	roll	$5,%edi
+	movdqa	%xmm3,%xmm5
+	movdqa	%xmm6,32(%esp)
+	addl	%ebp,%edx
+	xorl	%ebx,%esi
+	rorl	$7,%eax
+	addl	%edi,%edx
+	pslld	$2,%xmm3
+	addl	56(%esp),%ecx
+	xorl	%eax,%esi
+	psrld	$30,%xmm5
+	movl	%edx,%ebp
+	roll	$5,%edx
+	addl	%esi,%ecx
+	xorl	%eax,%ebp
+	rorl	$7,%edi
+	addl	%edx,%ecx
+	por	%xmm5,%xmm3
+	addl	60(%esp),%ebx
+	xorl	%edi,%ebp
+	movl	%ecx,%esi
+	roll	$5,%ecx
+	addl	%ebp,%ebx
+	xorl	%edi,%esi
+	rorl	$7,%edx
+	addl	%ecx,%ebx
+	addl	(%esp),%eax
+	xorl	%edx,%esi
+	movl	%ebx,%ebp
+	roll	$5,%ebx
+	addl	%esi,%eax
+	xorl	%edx,%ebp
+	rorl	$7,%ecx
+	paddd	%xmm3,%xmm7
+	addl	%ebx,%eax
+	addl	4(%esp),%edi
+	xorl	%ecx,%ebp
+	movl	%eax,%esi
+	movdqa	%xmm7,48(%esp)
+	roll	$5,%eax
+	addl	%ebp,%edi
+	xorl	%ecx,%esi
+	rorl	$7,%ebx
+	addl	%eax,%edi
+	addl	8(%esp),%edx
+	xorl	%ebx,%esi
+	movl	%edi,%ebp
+	roll	$5,%edi
+	addl	%esi,%edx
+	xorl	%ebx,%ebp
+	rorl	$7,%eax
+	addl	%edi,%edx
+	addl	12(%esp),%ecx
+	xorl	%eax,%ebp
+	movl	%edx,%esi
+	roll	$5,%edx
+	addl	%ebp,%ecx
+	xorl	%eax,%esi
+	rorl	$7,%edi
+	addl	%edx,%ecx
+	movl	196(%esp),%ebp
+	cmpl	200(%esp),%ebp
+	je	.L007done
+	movdqa	160(%esp),%xmm7
+	movdqa	176(%esp),%xmm6
+	movdqu	(%ebp),%xmm0
+	movdqu	16(%ebp),%xmm1
+	movdqu	32(%ebp),%xmm2
+	movdqu	48(%ebp),%xmm3
+	addl	$64,%ebp
+.byte	102,15,56,0,198
+	movl	%ebp,196(%esp)
+	movdqa	%xmm7,96(%esp)
+	addl	16(%esp),%ebx
+	xorl	%edi,%esi
+	movl	%ecx,%ebp
+	roll	$5,%ecx
+	addl	%esi,%ebx
+	xorl	%edi,%ebp
+	rorl	$7,%edx
+.byte	102,15,56,0,206
+	addl	%ecx,%ebx
+	addl	20(%esp),%eax
+	xorl	%edx,%ebp
+	movl	%ebx,%esi
+	paddd	%xmm7,%xmm0
+	roll	$5,%ebx
+	addl	%ebp,%eax
+	xorl	%edx,%esi
+	rorl	$7,%ecx
+	movdqa	%xmm0,(%esp)
+	addl	%ebx,%eax
+	addl	24(%esp),%edi
+	xorl	%ecx,%esi
+	movl	%eax,%ebp
+	psubd	%xmm7,%xmm0
+	roll	$5,%eax
+	addl	%esi,%edi
+	xorl	%ecx,%ebp
+	rorl	$7,%ebx
+	addl	%eax,%edi
+	addl	28(%esp),%edx
+	xorl	%ebx,%ebp
+	movl	%edi,%esi
+	roll	$5,%edi
+	addl	%ebp,%edx
+	xorl	%ebx,%esi
+	rorl	$7,%eax
+	addl	%edi,%edx
+	addl	32(%esp),%ecx
+	xorl	%eax,%esi
+	movl	%edx,%ebp
+	roll	$5,%edx
+	addl	%esi,%ecx
+	xorl	%eax,%ebp
+	rorl	$7,%edi
+.byte	102,15,56,0,214
+	addl	%edx,%ecx
+	addl	36(%esp),%ebx
+	xorl	%edi,%ebp
+	movl	%ecx,%esi
+	paddd	%xmm7,%xmm1
+	roll	$5,%ecx
+	addl	%ebp,%ebx
+	xorl	%edi,%esi
+	rorl	$7,%edx
+	movdqa	%xmm1,16(%esp)
+	addl	%ecx,%ebx
+	addl	40(%esp),%eax
+	xorl	%edx,%esi
+	movl	%ebx,%ebp
+	psubd	%xmm7,%xmm1
+	roll	$5,%ebx
+	addl	%esi,%eax
+	xorl	%edx,%ebp
+	rorl	$7,%ecx
+	addl	%ebx,%eax
+	addl	44(%esp),%edi
+	xorl	%ecx,%ebp
+	movl	%eax,%esi
+	roll	$5,%eax
+	addl	%ebp,%edi
+	xorl	%ecx,%esi
+	rorl	$7,%ebx
+	addl	%eax,%edi
+	addl	48(%esp),%edx
+	xorl	%ebx,%esi
+	movl	%edi,%ebp
+	roll	$5,%edi
+	addl	%esi,%edx
+	xorl	%ebx,%ebp
+	rorl	$7,%eax
+.byte	102,15,56,0,222
+	addl	%edi,%edx
+	addl	52(%esp),%ecx
+	xorl	%eax,%ebp
+	movl	%edx,%esi
+	paddd	%xmm7,%xmm2
+	roll	$5,%edx
+	addl	%ebp,%ecx
+	xorl	%eax,%esi
+	rorl	$7,%edi
+	movdqa	%xmm2,32(%esp)
+	addl	%edx,%ecx
+	addl	56(%esp),%ebx
+	xorl	%edi,%esi
+	movl	%ecx,%ebp
+	psubd	%xmm7,%xmm2
+	roll	$5,%ecx
+	addl	%esi,%ebx
+	xorl	%edi,%ebp
+	rorl	$7,%edx
+	addl	%ecx,%ebx
+	addl	60(%esp),%eax
+	xorl	%edx,%ebp
+	movl	%ebx,%esi
+	roll	$5,%ebx
+	addl	%ebp,%eax
+	rorl	$7,%ecx
+	addl	%ebx,%eax
+	movl	192(%esp),%ebp
+	addl	(%ebp),%eax
+	addl	4(%ebp),%esi
+	addl	8(%ebp),%ecx
+	movl	%eax,(%ebp)
+	addl	12(%ebp),%edx
+	movl	%esi,4(%ebp)
+	addl	16(%ebp),%edi
+	movl	%ecx,8(%ebp)
+	movl	%ecx,%ebx
+	movl	%edx,12(%ebp)
+	xorl	%edx,%ebx
+	movl	%edi,16(%ebp)
+	movl	%esi,%ebp
+	pshufd	$238,%xmm0,%xmm4
+	andl	%ebx,%esi
+	movl	%ebp,%ebx
+	jmp	.L006loop
+.align	16
+.L007done:
+	addl	16(%esp),%ebx
+	xorl	%edi,%esi
+	movl	%ecx,%ebp
+	roll	$5,%ecx
+	addl	%esi,%ebx
+	xorl	%edi,%ebp
+	rorl	$7,%edx
+	addl	%ecx,%ebx
+	addl	20(%esp),%eax
+	xorl	%edx,%ebp
+	movl	%ebx,%esi
+	roll	$5,%ebx
+	addl	%ebp,%eax
+	xorl	%edx,%esi
+	rorl	$7,%ecx
+	addl	%ebx,%eax
+	addl	24(%esp),%edi
+	xorl	%ecx,%esi
+	movl	%eax,%ebp
+	roll	$5,%eax
+	addl	%esi,%edi
+	xorl	%ecx,%ebp
+	rorl	$7,%ebx
+	addl	%eax,%edi
+	addl	28(%esp),%edx
+	xorl	%ebx,%ebp
+	movl	%edi,%esi
+	roll	$5,%edi
+	addl	%ebp,%edx
+	xorl	%ebx,%esi
+	rorl	$7,%eax
+	addl	%edi,%edx
+	addl	32(%esp),%ecx
+	xorl	%eax,%esi
+	movl	%edx,%ebp
+	roll	$5,%edx
+	addl	%esi,%ecx
+	xorl	%eax,%ebp
+	rorl	$7,%edi
+	addl	%edx,%ecx
+	addl	36(%esp),%ebx
+	xorl	%edi,%ebp
+	movl	%ecx,%esi
+	roll	$5,%ecx
+	addl	%ebp,%ebx
+	xorl	%edi,%esi
+	rorl	$7,%edx
+	addl	%ecx,%ebx
+	addl	40(%esp),%eax
+	xorl	%edx,%esi
+	movl	%ebx,%ebp
+	roll	$5,%ebx
+	addl	%esi,%eax
+	xorl	%edx,%ebp
+	rorl	$7,%ecx
+	addl	%ebx,%eax
+	addl	44(%esp),%edi
+	xorl	%ecx,%ebp
+	movl	%eax,%esi
+	roll	$5,%eax
+	addl	%ebp,%edi
+	xorl	%ecx,%esi
+	rorl	$7,%ebx
+	addl	%eax,%edi
+	addl	48(%esp),%edx
+	xorl	%ebx,%esi
+	movl	%edi,%ebp
+	roll	$5,%edi
+	addl	%esi,%edx
+	xorl	%ebx,%ebp
+	rorl	$7,%eax
+	addl	%edi,%edx
+	addl	52(%esp),%ecx
+	xorl	%eax,%ebp
+	movl	%edx,%esi
+	roll	$5,%edx
+	addl	%ebp,%ecx
+	xorl	%eax,%esi
+	rorl	$7,%edi
+	addl	%edx,%ecx
+	addl	56(%esp),%ebx
+	xorl	%edi,%esi
+	movl	%ecx,%ebp
+	roll	$5,%ecx
+	addl	%esi,%ebx
+	xorl	%edi,%ebp
+	rorl	$7,%edx
+	addl	%ecx,%ebx
+	addl	60(%esp),%eax
+	xorl	%edx,%ebp
+	movl	%ebx,%esi
+	roll	$5,%ebx
+	addl	%ebp,%eax
+	rorl	$7,%ecx
+	addl	%ebx,%eax
+	movl	192(%esp),%ebp
+	addl	(%ebp),%eax
+	movl	204(%esp),%esp
+	addl	4(%ebp),%esi
+	addl	8(%ebp),%ecx
+	movl	%eax,(%ebp)
+	addl	12(%ebp),%edx
+	movl	%esi,4(%ebp)
+	addl	16(%ebp),%edi
+	movl	%ecx,8(%ebp)
+	movl	%edx,12(%ebp)
+	movl	%edi,16(%ebp)
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.size	_sha1_block_data_order_ssse3,.-_sha1_block_data_order_ssse3
+.align	64
+.LK_XX_XX:
+.long	1518500249,1518500249,1518500249,1518500249
+.long	1859775393,1859775393,1859775393,1859775393
+.long	2400959708,2400959708,2400959708,2400959708
+.long	3395469782,3395469782,3395469782,3395469782
+.long	66051,67438087,134810123,202182159
+.byte	15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0
+.byte	83,72,65,49,32,98,108,111,99,107,32,116,114,97,110,115
+.byte	102,111,114,109,32,102,111,114,32,120,56,54,44,32,67,82
+.byte	89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112
+.byte	114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0
+#endif
diff --git a/third_party/boringssl/linux-x86/crypto/sha/sha256-586.S b/third_party/boringssl/linux-x86/crypto/sha/sha256-586.S
new file mode 100644
index 0000000..08d9484
--- /dev/null
+++ b/third_party/boringssl/linux-x86/crypto/sha/sha256-586.S
@@ -0,0 +1,4579 @@
+#if defined(__i386__)
+.file	"sha512-586.S"
+.text
+.globl	sha256_block_data_order
+.hidden	sha256_block_data_order
+.type	sha256_block_data_order,@function
+.align	16
+sha256_block_data_order:
+.L_sha256_block_data_order_begin:
+	pushl	%ebp
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+	movl	20(%esp),%esi
+	movl	24(%esp),%edi
+	movl	28(%esp),%eax
+	movl	%esp,%ebx
+	call	.L000pic_point
+.L000pic_point:
+	popl	%ebp
+	leal	.L001K256-.L000pic_point(%ebp),%ebp
+	subl	$16,%esp
+	andl	$-64,%esp
+	shll	$6,%eax
+	addl	%edi,%eax
+	movl	%esi,(%esp)
+	movl	%edi,4(%esp)
+	movl	%eax,8(%esp)
+	movl	%ebx,12(%esp)
+	leal	OPENSSL_ia32cap_P-.L001K256(%ebp),%edx
+	movl	(%edx),%ecx
+	movl	4(%edx),%ebx
+	testl	$1048576,%ecx
+	jnz	.L002loop
+	movl	8(%edx),%edx
+	testl	$16777216,%ecx
+	jz	.L003no_xmm
+	andl	$1073741824,%ecx
+	andl	$268435968,%ebx
+	testl	$536870912,%edx
+	jnz	.L004shaext
+	orl	%ebx,%ecx
+	andl	$1342177280,%ecx
+	cmpl	$1342177280,%ecx
+	testl	$512,%ebx
+	jnz	.L005SSSE3
+.L003no_xmm:
+	subl	%edi,%eax
+	cmpl	$256,%eax
+	jae	.L006unrolled
+	jmp	.L002loop
+.align	16
+.L002loop:
+	movl	(%edi),%eax
+	movl	4(%edi),%ebx
+	movl	8(%edi),%ecx
+	bswap	%eax
+	movl	12(%edi),%edx
+	bswap	%ebx
+	pushl	%eax
+	bswap	%ecx
+	pushl	%ebx
+	bswap	%edx
+	pushl	%ecx
+	pushl	%edx
+	movl	16(%edi),%eax
+	movl	20(%edi),%ebx
+	movl	24(%edi),%ecx
+	bswap	%eax
+	movl	28(%edi),%edx
+	bswap	%ebx
+	pushl	%eax
+	bswap	%ecx
+	pushl	%ebx
+	bswap	%edx
+	pushl	%ecx
+	pushl	%edx
+	movl	32(%edi),%eax
+	movl	36(%edi),%ebx
+	movl	40(%edi),%ecx
+	bswap	%eax
+	movl	44(%edi),%edx
+	bswap	%ebx
+	pushl	%eax
+	bswap	%ecx
+	pushl	%ebx
+	bswap	%edx
+	pushl	%ecx
+	pushl	%edx
+	movl	48(%edi),%eax
+	movl	52(%edi),%ebx
+	movl	56(%edi),%ecx
+	bswap	%eax
+	movl	60(%edi),%edx
+	bswap	%ebx
+	pushl	%eax
+	bswap	%ecx
+	pushl	%ebx
+	bswap	%edx
+	pushl	%ecx
+	pushl	%edx
+	addl	$64,%edi
+	leal	-36(%esp),%esp
+	movl	%edi,104(%esp)
+	movl	(%esi),%eax
+	movl	4(%esi),%ebx
+	movl	8(%esi),%ecx
+	movl	12(%esi),%edi
+	movl	%ebx,8(%esp)
+	xorl	%ecx,%ebx
+	movl	%ecx,12(%esp)
+	movl	%edi,16(%esp)
+	movl	%ebx,(%esp)
+	movl	16(%esi),%edx
+	movl	20(%esi),%ebx
+	movl	24(%esi),%ecx
+	movl	28(%esi),%edi
+	movl	%ebx,24(%esp)
+	movl	%ecx,28(%esp)
+	movl	%edi,32(%esp)
+.align	16
+.L00700_15:
+	movl	%edx,%ecx
+	movl	24(%esp),%esi
+	rorl	$14,%ecx
+	movl	28(%esp),%edi
+	xorl	%edx,%ecx
+	xorl	%edi,%esi
+	movl	96(%esp),%ebx
+	rorl	$5,%ecx
+	andl	%edx,%esi
+	movl	%edx,20(%esp)
+	xorl	%ecx,%edx
+	addl	32(%esp),%ebx
+	xorl	%edi,%esi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%esi,%ebx
+	rorl	$9,%ecx
+	addl	%edx,%ebx
+	movl	8(%esp),%edi
+	xorl	%eax,%ecx
+	movl	%eax,4(%esp)
+	leal	-4(%esp),%esp
+	rorl	$11,%ecx
+	movl	(%ebp),%esi
+	xorl	%eax,%ecx
+	movl	20(%esp),%edx
+	xorl	%edi,%eax
+	rorl	$2,%ecx
+	addl	%esi,%ebx
+	movl	%eax,(%esp)
+	addl	%ebx,%edx
+	andl	4(%esp),%eax
+	addl	%ecx,%ebx
+	xorl	%edi,%eax
+	addl	$4,%ebp
+	addl	%ebx,%eax
+	cmpl	$3248222580,%esi
+	jne	.L00700_15
+	movl	156(%esp),%ecx
+	jmp	.L00816_63
+.align	16
+.L00816_63:
+	movl	%ecx,%ebx
+	movl	104(%esp),%esi
+	rorl	$11,%ecx
+	movl	%esi,%edi
+	rorl	$2,%esi
+	xorl	%ebx,%ecx
+	shrl	$3,%ebx
+	rorl	$7,%ecx
+	xorl	%edi,%esi
+	xorl	%ecx,%ebx
+	rorl	$17,%esi
+	addl	160(%esp),%ebx
+	shrl	$10,%edi
+	addl	124(%esp),%ebx
+	movl	%edx,%ecx
+	xorl	%esi,%edi
+	movl	24(%esp),%esi
+	rorl	$14,%ecx
+	addl	%edi,%ebx
+	movl	28(%esp),%edi
+	xorl	%edx,%ecx
+	xorl	%edi,%esi
+	movl	%ebx,96(%esp)
+	rorl	$5,%ecx
+	andl	%edx,%esi
+	movl	%edx,20(%esp)
+	xorl	%ecx,%edx
+	addl	32(%esp),%ebx
+	xorl	%edi,%esi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%esi,%ebx
+	rorl	$9,%ecx
+	addl	%edx,%ebx
+	movl	8(%esp),%edi
+	xorl	%eax,%ecx
+	movl	%eax,4(%esp)
+	leal	-4(%esp),%esp
+	rorl	$11,%ecx
+	movl	(%ebp),%esi
+	xorl	%eax,%ecx
+	movl	20(%esp),%edx
+	xorl	%edi,%eax
+	rorl	$2,%ecx
+	addl	%esi,%ebx
+	movl	%eax,(%esp)
+	addl	%ebx,%edx
+	andl	4(%esp),%eax
+	addl	%ecx,%ebx
+	xorl	%edi,%eax
+	movl	156(%esp),%ecx
+	addl	$4,%ebp
+	addl	%ebx,%eax
+	cmpl	$3329325298,%esi
+	jne	.L00816_63
+	movl	356(%esp),%esi
+	movl	8(%esp),%ebx
+	movl	16(%esp),%ecx
+	addl	(%esi),%eax
+	addl	4(%esi),%ebx
+	addl	8(%esi),%edi
+	addl	12(%esi),%ecx
+	movl	%eax,(%esi)
+	movl	%ebx,4(%esi)
+	movl	%edi,8(%esi)
+	movl	%ecx,12(%esi)
+	movl	24(%esp),%eax
+	movl	28(%esp),%ebx
+	movl	32(%esp),%ecx
+	movl	360(%esp),%edi
+	addl	16(%esi),%edx
+	addl	20(%esi),%eax
+	addl	24(%esi),%ebx
+	addl	28(%esi),%ecx
+	movl	%edx,16(%esi)
+	movl	%eax,20(%esi)
+	movl	%ebx,24(%esi)
+	movl	%ecx,28(%esi)
+	leal	356(%esp),%esp
+	subl	$256,%ebp
+	cmpl	8(%esp),%edi
+	jb	.L002loop
+	movl	12(%esp),%esp
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.align	64
+.L001K256:
+.long	1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298
+.long	66051,67438087,134810123,202182159
+.byte	83,72,65,50,53,54,32,98,108,111,99,107,32,116,114,97
+.byte	110,115,102,111,114,109,32,102,111,114,32,120,56,54,44,32
+.byte	67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97
+.byte	112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103
+.byte	62,0
+.align	16
+.L006unrolled:
+	leal	-96(%esp),%esp
+	movl	(%esi),%eax
+	movl	4(%esi),%ebp
+	movl	8(%esi),%ecx
+	movl	12(%esi),%ebx
+	movl	%ebp,4(%esp)
+	xorl	%ecx,%ebp
+	movl	%ecx,8(%esp)
+	movl	%ebx,12(%esp)
+	movl	16(%esi),%edx
+	movl	20(%esi),%ebx
+	movl	24(%esi),%ecx
+	movl	28(%esi),%esi
+	movl	%ebx,20(%esp)
+	movl	%ecx,24(%esp)
+	movl	%esi,28(%esp)
+	jmp	.L009grand_loop
+.align	16
+.L009grand_loop:
+	movl	(%edi),%ebx
+	movl	4(%edi),%ecx
+	bswap	%ebx
+	movl	8(%edi),%esi
+	bswap	%ecx
+	movl	%ebx,32(%esp)
+	bswap	%esi
+	movl	%ecx,36(%esp)
+	movl	%esi,40(%esp)
+	movl	12(%edi),%ebx
+	movl	16(%edi),%ecx
+	bswap	%ebx
+	movl	20(%edi),%esi
+	bswap	%ecx
+	movl	%ebx,44(%esp)
+	bswap	%esi
+	movl	%ecx,48(%esp)
+	movl	%esi,52(%esp)
+	movl	24(%edi),%ebx
+	movl	28(%edi),%ecx
+	bswap	%ebx
+	movl	32(%edi),%esi
+	bswap	%ecx
+	movl	%ebx,56(%esp)
+	bswap	%esi
+	movl	%ecx,60(%esp)
+	movl	%esi,64(%esp)
+	movl	36(%edi),%ebx
+	movl	40(%edi),%ecx
+	bswap	%ebx
+	movl	44(%edi),%esi
+	bswap	%ecx
+	movl	%ebx,68(%esp)
+	bswap	%esi
+	movl	%ecx,72(%esp)
+	movl	%esi,76(%esp)
+	movl	48(%edi),%ebx
+	movl	52(%edi),%ecx
+	bswap	%ebx
+	movl	56(%edi),%esi
+	bswap	%ecx
+	movl	%ebx,80(%esp)
+	bswap	%esi
+	movl	%ecx,84(%esp)
+	movl	%esi,88(%esp)
+	movl	60(%edi),%ebx
+	addl	$64,%edi
+	bswap	%ebx
+	movl	%edi,100(%esp)
+	movl	%ebx,92(%esp)
+	movl	%edx,%ecx
+	movl	20(%esp),%esi
+	rorl	$14,%edx
+	movl	24(%esp),%edi
+	xorl	%ecx,%edx
+	movl	32(%esp),%ebx
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,16(%esp)
+	xorl	%ecx,%edx
+	addl	28(%esp),%ebx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%ebx
+	rorl	$9,%ecx
+	movl	%eax,%esi
+	movl	4(%esp),%edi
+	xorl	%eax,%ecx
+	movl	%eax,(%esp)
+	xorl	%edi,%eax
+	rorl	$11,%ecx
+	andl	%eax,%ebp
+	leal	1116352408(%ebx,%edx,1),%edx
+	xorl	%esi,%ecx
+	xorl	%edi,%ebp
+	rorl	$2,%ecx
+	addl	%edx,%ebp
+	addl	12(%esp),%edx
+	addl	%ecx,%ebp
+	movl	%edx,%esi
+	movl	16(%esp),%ecx
+	rorl	$14,%edx
+	movl	20(%esp),%edi
+	xorl	%esi,%edx
+	movl	36(%esp),%ebx
+	xorl	%edi,%ecx
+	rorl	$5,%edx
+	andl	%esi,%ecx
+	movl	%esi,12(%esp)
+	xorl	%esi,%edx
+	addl	24(%esp),%ebx
+	xorl	%ecx,%edi
+	rorl	$6,%edx
+	movl	%ebp,%esi
+	addl	%edi,%ebx
+	rorl	$9,%esi
+	movl	%ebp,%ecx
+	movl	(%esp),%edi
+	xorl	%ebp,%esi
+	movl	%ebp,28(%esp)
+	xorl	%edi,%ebp
+	rorl	$11,%esi
+	andl	%ebp,%eax
+	leal	1899447441(%ebx,%edx,1),%edx
+	xorl	%ecx,%esi
+	xorl	%edi,%eax
+	rorl	$2,%esi
+	addl	%edx,%eax
+	addl	8(%esp),%edx
+	addl	%esi,%eax
+	movl	%edx,%ecx
+	movl	12(%esp),%esi
+	rorl	$14,%edx
+	movl	16(%esp),%edi
+	xorl	%ecx,%edx
+	movl	40(%esp),%ebx
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,8(%esp)
+	xorl	%ecx,%edx
+	addl	20(%esp),%ebx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%ebx
+	rorl	$9,%ecx
+	movl	%eax,%esi
+	movl	28(%esp),%edi
+	xorl	%eax,%ecx
+	movl	%eax,24(%esp)
+	xorl	%edi,%eax
+	rorl	$11,%ecx
+	andl	%eax,%ebp
+	leal	3049323471(%ebx,%edx,1),%edx
+	xorl	%esi,%ecx
+	xorl	%edi,%ebp
+	rorl	$2,%ecx
+	addl	%edx,%ebp
+	addl	4(%esp),%edx
+	addl	%ecx,%ebp
+	movl	%edx,%esi
+	movl	8(%esp),%ecx
+	rorl	$14,%edx
+	movl	12(%esp),%edi
+	xorl	%esi,%edx
+	movl	44(%esp),%ebx
+	xorl	%edi,%ecx
+	rorl	$5,%edx
+	andl	%esi,%ecx
+	movl	%esi,4(%esp)
+	xorl	%esi,%edx
+	addl	16(%esp),%ebx
+	xorl	%ecx,%edi
+	rorl	$6,%edx
+	movl	%ebp,%esi
+	addl	%edi,%ebx
+	rorl	$9,%esi
+	movl	%ebp,%ecx
+	movl	24(%esp),%edi
+	xorl	%ebp,%esi
+	movl	%ebp,20(%esp)
+	xorl	%edi,%ebp
+	rorl	$11,%esi
+	andl	%ebp,%eax
+	leal	3921009573(%ebx,%edx,1),%edx
+	xorl	%ecx,%esi
+	xorl	%edi,%eax
+	rorl	$2,%esi
+	addl	%edx,%eax
+	addl	(%esp),%edx
+	addl	%esi,%eax
+	movl	%edx,%ecx
+	movl	4(%esp),%esi
+	rorl	$14,%edx
+	movl	8(%esp),%edi
+	xorl	%ecx,%edx
+	movl	48(%esp),%ebx
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,(%esp)
+	xorl	%ecx,%edx
+	addl	12(%esp),%ebx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%ebx
+	rorl	$9,%ecx
+	movl	%eax,%esi
+	movl	20(%esp),%edi
+	xorl	%eax,%ecx
+	movl	%eax,16(%esp)
+	xorl	%edi,%eax
+	rorl	$11,%ecx
+	andl	%eax,%ebp
+	leal	961987163(%ebx,%edx,1),%edx
+	xorl	%esi,%ecx
+	xorl	%edi,%ebp
+	rorl	$2,%ecx
+	addl	%edx,%ebp
+	addl	28(%esp),%edx
+	addl	%ecx,%ebp
+	movl	%edx,%esi
+	movl	(%esp),%ecx
+	rorl	$14,%edx
+	movl	4(%esp),%edi
+	xorl	%esi,%edx
+	movl	52(%esp),%ebx
+	xorl	%edi,%ecx
+	rorl	$5,%edx
+	andl	%esi,%ecx
+	movl	%esi,28(%esp)
+	xorl	%esi,%edx
+	addl	8(%esp),%ebx
+	xorl	%ecx,%edi
+	rorl	$6,%edx
+	movl	%ebp,%esi
+	addl	%edi,%ebx
+	rorl	$9,%esi
+	movl	%ebp,%ecx
+	movl	16(%esp),%edi
+	xorl	%ebp,%esi
+	movl	%ebp,12(%esp)
+	xorl	%edi,%ebp
+	rorl	$11,%esi
+	andl	%ebp,%eax
+	leal	1508970993(%ebx,%edx,1),%edx
+	xorl	%ecx,%esi
+	xorl	%edi,%eax
+	rorl	$2,%esi
+	addl	%edx,%eax
+	addl	24(%esp),%edx
+	addl	%esi,%eax
+	movl	%edx,%ecx
+	movl	28(%esp),%esi
+	rorl	$14,%edx
+	movl	(%esp),%edi
+	xorl	%ecx,%edx
+	movl	56(%esp),%ebx
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,24(%esp)
+	xorl	%ecx,%edx
+	addl	4(%esp),%ebx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%ebx
+	rorl	$9,%ecx
+	movl	%eax,%esi
+	movl	12(%esp),%edi
+	xorl	%eax,%ecx
+	movl	%eax,8(%esp)
+	xorl	%edi,%eax
+	rorl	$11,%ecx
+	andl	%eax,%ebp
+	leal	2453635748(%ebx,%edx,1),%edx
+	xorl	%esi,%ecx
+	xorl	%edi,%ebp
+	rorl	$2,%ecx
+	addl	%edx,%ebp
+	addl	20(%esp),%edx
+	addl	%ecx,%ebp
+	movl	%edx,%esi
+	movl	24(%esp),%ecx
+	rorl	$14,%edx
+	movl	28(%esp),%edi
+	xorl	%esi,%edx
+	movl	60(%esp),%ebx
+	xorl	%edi,%ecx
+	rorl	$5,%edx
+	andl	%esi,%ecx
+	movl	%esi,20(%esp)
+	xorl	%esi,%edx
+	addl	(%esp),%ebx
+	xorl	%ecx,%edi
+	rorl	$6,%edx
+	movl	%ebp,%esi
+	addl	%edi,%ebx
+	rorl	$9,%esi
+	movl	%ebp,%ecx
+	movl	8(%esp),%edi
+	xorl	%ebp,%esi
+	movl	%ebp,4(%esp)
+	xorl	%edi,%ebp
+	rorl	$11,%esi
+	andl	%ebp,%eax
+	leal	2870763221(%ebx,%edx,1),%edx
+	xorl	%ecx,%esi
+	xorl	%edi,%eax
+	rorl	$2,%esi
+	addl	%edx,%eax
+	addl	16(%esp),%edx
+	addl	%esi,%eax
+	movl	%edx,%ecx
+	movl	20(%esp),%esi
+	rorl	$14,%edx
+	movl	24(%esp),%edi
+	xorl	%ecx,%edx
+	movl	64(%esp),%ebx
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,16(%esp)
+	xorl	%ecx,%edx
+	addl	28(%esp),%ebx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%ebx
+	rorl	$9,%ecx
+	movl	%eax,%esi
+	movl	4(%esp),%edi
+	xorl	%eax,%ecx
+	movl	%eax,(%esp)
+	xorl	%edi,%eax
+	rorl	$11,%ecx
+	andl	%eax,%ebp
+	leal	3624381080(%ebx,%edx,1),%edx
+	xorl	%esi,%ecx
+	xorl	%edi,%ebp
+	rorl	$2,%ecx
+	addl	%edx,%ebp
+	addl	12(%esp),%edx
+	addl	%ecx,%ebp
+	movl	%edx,%esi
+	movl	16(%esp),%ecx
+	rorl	$14,%edx
+	movl	20(%esp),%edi
+	xorl	%esi,%edx
+	movl	68(%esp),%ebx
+	xorl	%edi,%ecx
+	rorl	$5,%edx
+	andl	%esi,%ecx
+	movl	%esi,12(%esp)
+	xorl	%esi,%edx
+	addl	24(%esp),%ebx
+	xorl	%ecx,%edi
+	rorl	$6,%edx
+	movl	%ebp,%esi
+	addl	%edi,%ebx
+	rorl	$9,%esi
+	movl	%ebp,%ecx
+	movl	(%esp),%edi
+	xorl	%ebp,%esi
+	movl	%ebp,28(%esp)
+	xorl	%edi,%ebp
+	rorl	$11,%esi
+	andl	%ebp,%eax
+	leal	310598401(%ebx,%edx,1),%edx
+	xorl	%ecx,%esi
+	xorl	%edi,%eax
+	rorl	$2,%esi
+	addl	%edx,%eax
+	addl	8(%esp),%edx
+	addl	%esi,%eax
+	movl	%edx,%ecx
+	movl	12(%esp),%esi
+	rorl	$14,%edx
+	movl	16(%esp),%edi
+	xorl	%ecx,%edx
+	movl	72(%esp),%ebx
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,8(%esp)
+	xorl	%ecx,%edx
+	addl	20(%esp),%ebx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%ebx
+	rorl	$9,%ecx
+	movl	%eax,%esi
+	movl	28(%esp),%edi
+	xorl	%eax,%ecx
+	movl	%eax,24(%esp)
+	xorl	%edi,%eax
+	rorl	$11,%ecx
+	andl	%eax,%ebp
+	leal	607225278(%ebx,%edx,1),%edx
+	xorl	%esi,%ecx
+	xorl	%edi,%ebp
+	rorl	$2,%ecx
+	addl	%edx,%ebp
+	addl	4(%esp),%edx
+	addl	%ecx,%ebp
+	movl	%edx,%esi
+	movl	8(%esp),%ecx
+	rorl	$14,%edx
+	movl	12(%esp),%edi
+	xorl	%esi,%edx
+	movl	76(%esp),%ebx
+	xorl	%edi,%ecx
+	rorl	$5,%edx
+	andl	%esi,%ecx
+	movl	%esi,4(%esp)
+	xorl	%esi,%edx
+	addl	16(%esp),%ebx
+	xorl	%ecx,%edi
+	rorl	$6,%edx
+	movl	%ebp,%esi
+	addl	%edi,%ebx
+	rorl	$9,%esi
+	movl	%ebp,%ecx
+	movl	24(%esp),%edi
+	xorl	%ebp,%esi
+	movl	%ebp,20(%esp)
+	xorl	%edi,%ebp
+	rorl	$11,%esi
+	andl	%ebp,%eax
+	leal	1426881987(%ebx,%edx,1),%edx
+	xorl	%ecx,%esi
+	xorl	%edi,%eax
+	rorl	$2,%esi
+	addl	%edx,%eax
+	addl	(%esp),%edx
+	addl	%esi,%eax
+	movl	%edx,%ecx
+	movl	4(%esp),%esi
+	rorl	$14,%edx
+	movl	8(%esp),%edi
+	xorl	%ecx,%edx
+	movl	80(%esp),%ebx
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,(%esp)
+	xorl	%ecx,%edx
+	addl	12(%esp),%ebx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%ebx
+	rorl	$9,%ecx
+	movl	%eax,%esi
+	movl	20(%esp),%edi
+	xorl	%eax,%ecx
+	movl	%eax,16(%esp)
+	xorl	%edi,%eax
+	rorl	$11,%ecx
+	andl	%eax,%ebp
+	leal	1925078388(%ebx,%edx,1),%edx
+	xorl	%esi,%ecx
+	xorl	%edi,%ebp
+	rorl	$2,%ecx
+	addl	%edx,%ebp
+	addl	28(%esp),%edx
+	addl	%ecx,%ebp
+	movl	%edx,%esi
+	movl	(%esp),%ecx
+	rorl	$14,%edx
+	movl	4(%esp),%edi
+	xorl	%esi,%edx
+	movl	84(%esp),%ebx
+	xorl	%edi,%ecx
+	rorl	$5,%edx
+	andl	%esi,%ecx
+	movl	%esi,28(%esp)
+	xorl	%esi,%edx
+	addl	8(%esp),%ebx
+	xorl	%ecx,%edi
+	rorl	$6,%edx
+	movl	%ebp,%esi
+	addl	%edi,%ebx
+	rorl	$9,%esi
+	movl	%ebp,%ecx
+	movl	16(%esp),%edi
+	xorl	%ebp,%esi
+	movl	%ebp,12(%esp)
+	xorl	%edi,%ebp
+	rorl	$11,%esi
+	andl	%ebp,%eax
+	leal	2162078206(%ebx,%edx,1),%edx
+	xorl	%ecx,%esi
+	xorl	%edi,%eax
+	rorl	$2,%esi
+	addl	%edx,%eax
+	addl	24(%esp),%edx
+	addl	%esi,%eax
+	movl	%edx,%ecx
+	movl	28(%esp),%esi
+	rorl	$14,%edx
+	movl	(%esp),%edi
+	xorl	%ecx,%edx
+	movl	88(%esp),%ebx
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,24(%esp)
+	xorl	%ecx,%edx
+	addl	4(%esp),%ebx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%ebx
+	rorl	$9,%ecx
+	movl	%eax,%esi
+	movl	12(%esp),%edi
+	xorl	%eax,%ecx
+	movl	%eax,8(%esp)
+	xorl	%edi,%eax
+	rorl	$11,%ecx
+	andl	%eax,%ebp
+	leal	2614888103(%ebx,%edx,1),%edx
+	xorl	%esi,%ecx
+	xorl	%edi,%ebp
+	rorl	$2,%ecx
+	addl	%edx,%ebp
+	addl	20(%esp),%edx
+	addl	%ecx,%ebp
+	movl	%edx,%esi
+	movl	24(%esp),%ecx
+	rorl	$14,%edx
+	movl	28(%esp),%edi
+	xorl	%esi,%edx
+	movl	92(%esp),%ebx
+	xorl	%edi,%ecx
+	rorl	$5,%edx
+	andl	%esi,%ecx
+	movl	%esi,20(%esp)
+	xorl	%esi,%edx
+	addl	(%esp),%ebx
+	xorl	%ecx,%edi
+	rorl	$6,%edx
+	movl	%ebp,%esi
+	addl	%edi,%ebx
+	rorl	$9,%esi
+	movl	%ebp,%ecx
+	movl	8(%esp),%edi
+	xorl	%ebp,%esi
+	movl	%ebp,4(%esp)
+	xorl	%edi,%ebp
+	rorl	$11,%esi
+	andl	%ebp,%eax
+	leal	3248222580(%ebx,%edx,1),%edx
+	xorl	%ecx,%esi
+	xorl	%edi,%eax
+	movl	36(%esp),%ecx
+	rorl	$2,%esi
+	addl	%edx,%eax
+	addl	16(%esp),%edx
+	addl	%esi,%eax
+	movl	88(%esp),%esi
+	movl	%ecx,%ebx
+	rorl	$11,%ecx
+	movl	%esi,%edi
+	rorl	$2,%esi
+	xorl	%ebx,%ecx
+	shrl	$3,%ebx
+	rorl	$7,%ecx
+	xorl	%edi,%esi
+	xorl	%ecx,%ebx
+	rorl	$17,%esi
+	addl	32(%esp),%ebx
+	shrl	$10,%edi
+	addl	68(%esp),%ebx
+	movl	%edx,%ecx
+	xorl	%esi,%edi
+	movl	20(%esp),%esi
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	24(%esp),%edi
+	xorl	%ecx,%edx
+	movl	%ebx,32(%esp)
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,16(%esp)
+	xorl	%ecx,%edx
+	addl	28(%esp),%ebx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%ebx
+	rorl	$9,%ecx
+	movl	%eax,%esi
+	movl	4(%esp),%edi
+	xorl	%eax,%ecx
+	movl	%eax,(%esp)
+	xorl	%edi,%eax
+	rorl	$11,%ecx
+	andl	%eax,%ebp
+	leal	3835390401(%ebx,%edx,1),%edx
+	xorl	%esi,%ecx
+	xorl	%edi,%ebp
+	movl	40(%esp),%esi
+	rorl	$2,%ecx
+	addl	%edx,%ebp
+	addl	12(%esp),%edx
+	addl	%ecx,%ebp
+	movl	92(%esp),%ecx
+	movl	%esi,%ebx
+	rorl	$11,%esi
+	movl	%ecx,%edi
+	rorl	$2,%ecx
+	xorl	%ebx,%esi
+	shrl	$3,%ebx
+	rorl	$7,%esi
+	xorl	%edi,%ecx
+	xorl	%esi,%ebx
+	rorl	$17,%ecx
+	addl	36(%esp),%ebx
+	shrl	$10,%edi
+	addl	72(%esp),%ebx
+	movl	%edx,%esi
+	xorl	%ecx,%edi
+	movl	16(%esp),%ecx
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	20(%esp),%edi
+	xorl	%esi,%edx
+	movl	%ebx,36(%esp)
+	xorl	%edi,%ecx
+	rorl	$5,%edx
+	andl	%esi,%ecx
+	movl	%esi,12(%esp)
+	xorl	%esi,%edx
+	addl	24(%esp),%ebx
+	xorl	%ecx,%edi
+	rorl	$6,%edx
+	movl	%ebp,%esi
+	addl	%edi,%ebx
+	rorl	$9,%esi
+	movl	%ebp,%ecx
+	movl	(%esp),%edi
+	xorl	%ebp,%esi
+	movl	%ebp,28(%esp)
+	xorl	%edi,%ebp
+	rorl	$11,%esi
+	andl	%ebp,%eax
+	leal	4022224774(%ebx,%edx,1),%edx
+	xorl	%ecx,%esi
+	xorl	%edi,%eax
+	movl	44(%esp),%ecx
+	rorl	$2,%esi
+	addl	%edx,%eax
+	addl	8(%esp),%edx
+	addl	%esi,%eax
+	movl	32(%esp),%esi
+	movl	%ecx,%ebx
+	rorl	$11,%ecx
+	movl	%esi,%edi
+	rorl	$2,%esi
+	xorl	%ebx,%ecx
+	shrl	$3,%ebx
+	rorl	$7,%ecx
+	xorl	%edi,%esi
+	xorl	%ecx,%ebx
+	rorl	$17,%esi
+	addl	40(%esp),%ebx
+	shrl	$10,%edi
+	addl	76(%esp),%ebx
+	movl	%edx,%ecx
+	xorl	%esi,%edi
+	movl	12(%esp),%esi
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	16(%esp),%edi
+	xorl	%ecx,%edx
+	movl	%ebx,40(%esp)
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,8(%esp)
+	xorl	%ecx,%edx
+	addl	20(%esp),%ebx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%ebx
+	rorl	$9,%ecx
+	movl	%eax,%esi
+	movl	28(%esp),%edi
+	xorl	%eax,%ecx
+	movl	%eax,24(%esp)
+	xorl	%edi,%eax
+	rorl	$11,%ecx
+	andl	%eax,%ebp
+	leal	264347078(%ebx,%edx,1),%edx
+	xorl	%esi,%ecx
+	xorl	%edi,%ebp
+	movl	48(%esp),%esi
+	rorl	$2,%ecx
+	addl	%edx,%ebp
+	addl	4(%esp),%edx
+	addl	%ecx,%ebp
+	movl	36(%esp),%ecx
+	movl	%esi,%ebx
+	rorl	$11,%esi
+	movl	%ecx,%edi
+	rorl	$2,%ecx
+	xorl	%ebx,%esi
+	shrl	$3,%ebx
+	rorl	$7,%esi
+	xorl	%edi,%ecx
+	xorl	%esi,%ebx
+	rorl	$17,%ecx
+	addl	44(%esp),%ebx
+	shrl	$10,%edi
+	addl	80(%esp),%ebx
+	movl	%edx,%esi
+	xorl	%ecx,%edi
+	movl	8(%esp),%ecx
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	12(%esp),%edi
+	xorl	%esi,%edx
+	movl	%ebx,44(%esp)
+	xorl	%edi,%ecx
+	rorl	$5,%edx
+	andl	%esi,%ecx
+	movl	%esi,4(%esp)
+	xorl	%esi,%edx
+	addl	16(%esp),%ebx
+	xorl	%ecx,%edi
+	rorl	$6,%edx
+	movl	%ebp,%esi
+	addl	%edi,%ebx
+	rorl	$9,%esi
+	movl	%ebp,%ecx
+	movl	24(%esp),%edi
+	xorl	%ebp,%esi
+	movl	%ebp,20(%esp)
+	xorl	%edi,%ebp
+	rorl	$11,%esi
+	andl	%ebp,%eax
+	leal	604807628(%ebx,%edx,1),%edx
+	xorl	%ecx,%esi
+	xorl	%edi,%eax
+	movl	52(%esp),%ecx
+	rorl	$2,%esi
+	addl	%edx,%eax
+	addl	(%esp),%edx
+	addl	%esi,%eax
+	movl	40(%esp),%esi
+	movl	%ecx,%ebx
+	rorl	$11,%ecx
+	movl	%esi,%edi
+	rorl	$2,%esi
+	xorl	%ebx,%ecx
+	shrl	$3,%ebx
+	rorl	$7,%ecx
+	xorl	%edi,%esi
+	xorl	%ecx,%ebx
+	rorl	$17,%esi
+	addl	48(%esp),%ebx
+	shrl	$10,%edi
+	addl	84(%esp),%ebx
+	movl	%edx,%ecx
+	xorl	%esi,%edi
+	movl	4(%esp),%esi
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	8(%esp),%edi
+	xorl	%ecx,%edx
+	movl	%ebx,48(%esp)
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,(%esp)
+	xorl	%ecx,%edx
+	addl	12(%esp),%ebx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%ebx
+	rorl	$9,%ecx
+	movl	%eax,%esi
+	movl	20(%esp),%edi
+	xorl	%eax,%ecx
+	movl	%eax,16(%esp)
+	xorl	%edi,%eax
+	rorl	$11,%ecx
+	andl	%eax,%ebp
+	leal	770255983(%ebx,%edx,1),%edx
+	xorl	%esi,%ecx
+	xorl	%edi,%ebp
+	movl	56(%esp),%esi
+	rorl	$2,%ecx
+	addl	%edx,%ebp
+	addl	28(%esp),%edx
+	addl	%ecx,%ebp
+	movl	44(%esp),%ecx
+	movl	%esi,%ebx
+	rorl	$11,%esi
+	movl	%ecx,%edi
+	rorl	$2,%ecx
+	xorl	%ebx,%esi
+	shrl	$3,%ebx
+	rorl	$7,%esi
+	xorl	%edi,%ecx
+	xorl	%esi,%ebx
+	rorl	$17,%ecx
+	addl	52(%esp),%ebx
+	shrl	$10,%edi
+	addl	88(%esp),%ebx
+	movl	%edx,%esi
+	xorl	%ecx,%edi
+	movl	(%esp),%ecx
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	4(%esp),%edi
+	xorl	%esi,%edx
+	movl	%ebx,52(%esp)
+	xorl	%edi,%ecx
+	rorl	$5,%edx
+	andl	%esi,%ecx
+	movl	%esi,28(%esp)
+	xorl	%esi,%edx
+	addl	8(%esp),%ebx
+	xorl	%ecx,%edi
+	rorl	$6,%edx
+	movl	%ebp,%esi
+	addl	%edi,%ebx
+	rorl	$9,%esi
+	movl	%ebp,%ecx
+	movl	16(%esp),%edi
+	xorl	%ebp,%esi
+	movl	%ebp,12(%esp)
+	xorl	%edi,%ebp
+	rorl	$11,%esi
+	andl	%ebp,%eax
+	leal	1249150122(%ebx,%edx,1),%edx
+	xorl	%ecx,%esi
+	xorl	%edi,%eax
+	movl	60(%esp),%ecx
+	rorl	$2,%esi
+	addl	%edx,%eax
+	addl	24(%esp),%edx
+	addl	%esi,%eax
+	movl	48(%esp),%esi
+	movl	%ecx,%ebx
+	rorl	$11,%ecx
+	movl	%esi,%edi
+	rorl	$2,%esi
+	xorl	%ebx,%ecx
+	shrl	$3,%ebx
+	rorl	$7,%ecx
+	xorl	%edi,%esi
+	xorl	%ecx,%ebx
+	rorl	$17,%esi
+	addl	56(%esp),%ebx
+	shrl	$10,%edi
+	addl	92(%esp),%ebx
+	movl	%edx,%ecx
+	xorl	%esi,%edi
+	movl	28(%esp),%esi
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	(%esp),%edi
+	xorl	%ecx,%edx
+	movl	%ebx,56(%esp)
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,24(%esp)
+	xorl	%ecx,%edx
+	addl	4(%esp),%ebx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%ebx
+	rorl	$9,%ecx
+	movl	%eax,%esi
+	movl	12(%esp),%edi
+	xorl	%eax,%ecx
+	movl	%eax,8(%esp)
+	xorl	%edi,%eax
+	rorl	$11,%ecx
+	andl	%eax,%ebp
+	leal	1555081692(%ebx,%edx,1),%edx
+	xorl	%esi,%ecx
+	xorl	%edi,%ebp
+	movl	64(%esp),%esi
+	rorl	$2,%ecx
+	addl	%edx,%ebp
+	addl	20(%esp),%edx
+	addl	%ecx,%ebp
+	movl	52(%esp),%ecx
+	movl	%esi,%ebx
+	rorl	$11,%esi
+	movl	%ecx,%edi
+	rorl	$2,%ecx
+	xorl	%ebx,%esi
+	shrl	$3,%ebx
+	rorl	$7,%esi
+	xorl	%edi,%ecx
+	xorl	%esi,%ebx
+	rorl	$17,%ecx
+	addl	60(%esp),%ebx
+	shrl	$10,%edi
+	addl	32(%esp),%ebx
+	movl	%edx,%esi
+	xorl	%ecx,%edi
+	movl	24(%esp),%ecx
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	28(%esp),%edi
+	xorl	%esi,%edx
+	movl	%ebx,60(%esp)
+	xorl	%edi,%ecx
+	rorl	$5,%edx
+	andl	%esi,%ecx
+	movl	%esi,20(%esp)
+	xorl	%esi,%edx
+	addl	(%esp),%ebx
+	xorl	%ecx,%edi
+	rorl	$6,%edx
+	movl	%ebp,%esi
+	addl	%edi,%ebx
+	rorl	$9,%esi
+	movl	%ebp,%ecx
+	movl	8(%esp),%edi
+	xorl	%ebp,%esi
+	movl	%ebp,4(%esp)
+	xorl	%edi,%ebp
+	rorl	$11,%esi
+	andl	%ebp,%eax
+	leal	1996064986(%ebx,%edx,1),%edx
+	xorl	%ecx,%esi
+	xorl	%edi,%eax
+	movl	68(%esp),%ecx
+	rorl	$2,%esi
+	addl	%edx,%eax
+	addl	16(%esp),%edx
+	addl	%esi,%eax
+	movl	56(%esp),%esi
+	movl	%ecx,%ebx
+	rorl	$11,%ecx
+	movl	%esi,%edi
+	rorl	$2,%esi
+	xorl	%ebx,%ecx
+	shrl	$3,%ebx
+	rorl	$7,%ecx
+	xorl	%edi,%esi
+	xorl	%ecx,%ebx
+	rorl	$17,%esi
+	addl	64(%esp),%ebx
+	shrl	$10,%edi
+	addl	36(%esp),%ebx
+	movl	%edx,%ecx
+	xorl	%esi,%edi
+	movl	20(%esp),%esi
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	24(%esp),%edi
+	xorl	%ecx,%edx
+	movl	%ebx,64(%esp)
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,16(%esp)
+	xorl	%ecx,%edx
+	addl	28(%esp),%ebx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%ebx
+	rorl	$9,%ecx
+	movl	%eax,%esi
+	movl	4(%esp),%edi
+	xorl	%eax,%ecx
+	movl	%eax,(%esp)
+	xorl	%edi,%eax
+	rorl	$11,%ecx
+	andl	%eax,%ebp
+	leal	2554220882(%ebx,%edx,1),%edx
+	xorl	%esi,%ecx
+	xorl	%edi,%ebp
+	movl	72(%esp),%esi
+	rorl	$2,%ecx
+	addl	%edx,%ebp
+	addl	12(%esp),%edx
+	addl	%ecx,%ebp
+	movl	60(%esp),%ecx
+	movl	%esi,%ebx
+	rorl	$11,%esi
+	movl	%ecx,%edi
+	rorl	$2,%ecx
+	xorl	%ebx,%esi
+	shrl	$3,%ebx
+	rorl	$7,%esi
+	xorl	%edi,%ecx
+	xorl	%esi,%ebx
+	rorl	$17,%ecx
+	addl	68(%esp),%ebx
+	shrl	$10,%edi
+	addl	40(%esp),%ebx
+	movl	%edx,%esi
+	xorl	%ecx,%edi
+	movl	16(%esp),%ecx
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	20(%esp),%edi
+	xorl	%esi,%edx
+	movl	%ebx,68(%esp)
+	xorl	%edi,%ecx
+	rorl	$5,%edx
+	andl	%esi,%ecx
+	movl	%esi,12(%esp)
+	xorl	%esi,%edx
+	addl	24(%esp),%ebx
+	xorl	%ecx,%edi
+	rorl	$6,%edx
+	movl	%ebp,%esi
+	addl	%edi,%ebx
+	rorl	$9,%esi
+	movl	%ebp,%ecx
+	movl	(%esp),%edi
+	xorl	%ebp,%esi
+	movl	%ebp,28(%esp)
+	xorl	%edi,%ebp
+	rorl	$11,%esi
+	andl	%ebp,%eax
+	leal	2821834349(%ebx,%edx,1),%edx
+	xorl	%ecx,%esi
+	xorl	%edi,%eax
+	movl	76(%esp),%ecx
+	rorl	$2,%esi
+	addl	%edx,%eax
+	addl	8(%esp),%edx
+	addl	%esi,%eax
+	movl	64(%esp),%esi
+	movl	%ecx,%ebx
+	rorl	$11,%ecx
+	movl	%esi,%edi
+	rorl	$2,%esi
+	xorl	%ebx,%ecx
+	shrl	$3,%ebx
+	rorl	$7,%ecx
+	xorl	%edi,%esi
+	xorl	%ecx,%ebx
+	rorl	$17,%esi
+	addl	72(%esp),%ebx
+	shrl	$10,%edi
+	addl	44(%esp),%ebx
+	movl	%edx,%ecx
+	xorl	%esi,%edi
+	movl	12(%esp),%esi
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	16(%esp),%edi
+	xorl	%ecx,%edx
+	movl	%ebx,72(%esp)
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,8(%esp)
+	xorl	%ecx,%edx
+	addl	20(%esp),%ebx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%ebx
+	rorl	$9,%ecx
+	movl	%eax,%esi
+	movl	28(%esp),%edi
+	xorl	%eax,%ecx
+	movl	%eax,24(%esp)
+	xorl	%edi,%eax
+	rorl	$11,%ecx
+	andl	%eax,%ebp
+	leal	2952996808(%ebx,%edx,1),%edx
+	xorl	%esi,%ecx
+	xorl	%edi,%ebp
+	movl	80(%esp),%esi
+	rorl	$2,%ecx
+	addl	%edx,%ebp
+	addl	4(%esp),%edx
+	addl	%ecx,%ebp
+	movl	68(%esp),%ecx
+	movl	%esi,%ebx
+	rorl	$11,%esi
+	movl	%ecx,%edi
+	rorl	$2,%ecx
+	xorl	%ebx,%esi
+	shrl	$3,%ebx
+	rorl	$7,%esi
+	xorl	%edi,%ecx
+	xorl	%esi,%ebx
+	rorl	$17,%ecx
+	addl	76(%esp),%ebx
+	shrl	$10,%edi
+	addl	48(%esp),%ebx
+	movl	%edx,%esi
+	xorl	%ecx,%edi
+	movl	8(%esp),%ecx
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	12(%esp),%edi
+	xorl	%esi,%edx
+	movl	%ebx,76(%esp)
+	xorl	%edi,%ecx
+	rorl	$5,%edx
+	andl	%esi,%ecx
+	movl	%esi,4(%esp)
+	xorl	%esi,%edx
+	addl	16(%esp),%ebx
+	xorl	%ecx,%edi
+	rorl	$6,%edx
+	movl	%ebp,%esi
+	addl	%edi,%ebx
+	rorl	$9,%esi
+	movl	%ebp,%ecx
+	movl	24(%esp),%edi
+	xorl	%ebp,%esi
+	movl	%ebp,20(%esp)
+	xorl	%edi,%ebp
+	rorl	$11,%esi
+	andl	%ebp,%eax
+	leal	3210313671(%ebx,%edx,1),%edx
+	xorl	%ecx,%esi
+	xorl	%edi,%eax
+	movl	84(%esp),%ecx
+	rorl	$2,%esi
+	addl	%edx,%eax
+	addl	(%esp),%edx
+	addl	%esi,%eax
+	movl	72(%esp),%esi
+	movl	%ecx,%ebx
+	rorl	$11,%ecx
+	movl	%esi,%edi
+	rorl	$2,%esi
+	xorl	%ebx,%ecx
+	shrl	$3,%ebx
+	rorl	$7,%ecx
+	xorl	%edi,%esi
+	xorl	%ecx,%ebx
+	rorl	$17,%esi
+	addl	80(%esp),%ebx
+	shrl	$10,%edi
+	addl	52(%esp),%ebx
+	movl	%edx,%ecx
+	xorl	%esi,%edi
+	movl	4(%esp),%esi
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	8(%esp),%edi
+	xorl	%ecx,%edx
+	movl	%ebx,80(%esp)
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,(%esp)
+	xorl	%ecx,%edx
+	addl	12(%esp),%ebx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%ebx
+	rorl	$9,%ecx
+	movl	%eax,%esi
+	movl	20(%esp),%edi
+	xorl	%eax,%ecx
+	movl	%eax,16(%esp)
+	xorl	%edi,%eax
+	rorl	$11,%ecx
+	andl	%eax,%ebp
+	leal	3336571891(%ebx,%edx,1),%edx
+	xorl	%esi,%ecx
+	xorl	%edi,%ebp
+	movl	88(%esp),%esi
+	rorl	$2,%ecx
+	addl	%edx,%ebp
+	addl	28(%esp),%edx
+	addl	%ecx,%ebp
+	movl	76(%esp),%ecx
+	movl	%esi,%ebx
+	rorl	$11,%esi
+	movl	%ecx,%edi
+	rorl	$2,%ecx
+	xorl	%ebx,%esi
+	shrl	$3,%ebx
+	rorl	$7,%esi
+	xorl	%edi,%ecx
+	xorl	%esi,%ebx
+	rorl	$17,%ecx
+	addl	84(%esp),%ebx
+	shrl	$10,%edi
+	addl	56(%esp),%ebx
+	movl	%edx,%esi
+	xorl	%ecx,%edi
+	movl	(%esp),%ecx
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	4(%esp),%edi
+	xorl	%esi,%edx
+	movl	%ebx,84(%esp)
+	xorl	%edi,%ecx
+	rorl	$5,%edx
+	andl	%esi,%ecx
+	movl	%esi,28(%esp)
+	xorl	%esi,%edx
+	addl	8(%esp),%ebx
+	xorl	%ecx,%edi
+	rorl	$6,%edx
+	movl	%ebp,%esi
+	addl	%edi,%ebx
+	rorl	$9,%esi
+	movl	%ebp,%ecx
+	movl	16(%esp),%edi
+	xorl	%ebp,%esi
+	movl	%ebp,12(%esp)
+	xorl	%edi,%ebp
+	rorl	$11,%esi
+	andl	%ebp,%eax
+	leal	3584528711(%ebx,%edx,1),%edx
+	xorl	%ecx,%esi
+	xorl	%edi,%eax
+	movl	92(%esp),%ecx
+	rorl	$2,%esi
+	addl	%edx,%eax
+	addl	24(%esp),%edx
+	addl	%esi,%eax
+	movl	80(%esp),%esi
+	movl	%ecx,%ebx
+	rorl	$11,%ecx
+	movl	%esi,%edi
+	rorl	$2,%esi
+	xorl	%ebx,%ecx
+	shrl	$3,%ebx
+	rorl	$7,%ecx
+	xorl	%edi,%esi
+	xorl	%ecx,%ebx
+	rorl	$17,%esi
+	addl	88(%esp),%ebx
+	shrl	$10,%edi
+	addl	60(%esp),%ebx
+	movl	%edx,%ecx
+	xorl	%esi,%edi
+	movl	28(%esp),%esi
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	(%esp),%edi
+	xorl	%ecx,%edx
+	movl	%ebx,88(%esp)
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,24(%esp)
+	xorl	%ecx,%edx
+	addl	4(%esp),%ebx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%ebx
+	rorl	$9,%ecx
+	movl	%eax,%esi
+	movl	12(%esp),%edi
+	xorl	%eax,%ecx
+	movl	%eax,8(%esp)
+	xorl	%edi,%eax
+	rorl	$11,%ecx
+	andl	%eax,%ebp
+	leal	113926993(%ebx,%edx,1),%edx
+	xorl	%esi,%ecx
+	xorl	%edi,%ebp
+	movl	32(%esp),%esi
+	rorl	$2,%ecx
+	addl	%edx,%ebp
+	addl	20(%esp),%edx
+	addl	%ecx,%ebp
+	movl	84(%esp),%ecx
+	movl	%esi,%ebx
+	rorl	$11,%esi
+	movl	%ecx,%edi
+	rorl	$2,%ecx
+	xorl	%ebx,%esi
+	shrl	$3,%ebx
+	rorl	$7,%esi
+	xorl	%edi,%ecx
+	xorl	%esi,%ebx
+	rorl	$17,%ecx
+	addl	92(%esp),%ebx
+	shrl	$10,%edi
+	addl	64(%esp),%ebx
+	movl	%edx,%esi
+	xorl	%ecx,%edi
+	movl	24(%esp),%ecx
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	28(%esp),%edi
+	xorl	%esi,%edx
+	movl	%ebx,92(%esp)
+	xorl	%edi,%ecx
+	rorl	$5,%edx
+	andl	%esi,%ecx
+	movl	%esi,20(%esp)
+	xorl	%esi,%edx
+	addl	(%esp),%ebx
+	xorl	%ecx,%edi
+	rorl	$6,%edx
+	movl	%ebp,%esi
+	addl	%edi,%ebx
+	rorl	$9,%esi
+	movl	%ebp,%ecx
+	movl	8(%esp),%edi
+	xorl	%ebp,%esi
+	movl	%ebp,4(%esp)
+	xorl	%edi,%ebp
+	rorl	$11,%esi
+	andl	%ebp,%eax
+	leal	338241895(%ebx,%edx,1),%edx
+	xorl	%ecx,%esi
+	xorl	%edi,%eax
+	movl	36(%esp),%ecx
+	rorl	$2,%esi
+	addl	%edx,%eax
+	addl	16(%esp),%edx
+	addl	%esi,%eax
+	movl	88(%esp),%esi
+	movl	%ecx,%ebx
+	rorl	$11,%ecx
+	movl	%esi,%edi
+	rorl	$2,%esi
+	xorl	%ebx,%ecx
+	shrl	$3,%ebx
+	rorl	$7,%ecx
+	xorl	%edi,%esi
+	xorl	%ecx,%ebx
+	rorl	$17,%esi
+	addl	32(%esp),%ebx
+	shrl	$10,%edi
+	addl	68(%esp),%ebx
+	movl	%edx,%ecx
+	xorl	%esi,%edi
+	movl	20(%esp),%esi
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	24(%esp),%edi
+	xorl	%ecx,%edx
+	movl	%ebx,32(%esp)
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,16(%esp)
+	xorl	%ecx,%edx
+	addl	28(%esp),%ebx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%ebx
+	rorl	$9,%ecx
+	movl	%eax,%esi
+	movl	4(%esp),%edi
+	xorl	%eax,%ecx
+	movl	%eax,(%esp)
+	xorl	%edi,%eax
+	rorl	$11,%ecx
+	andl	%eax,%ebp
+	leal	666307205(%ebx,%edx,1),%edx
+	xorl	%esi,%ecx
+	xorl	%edi,%ebp
+	movl	40(%esp),%esi
+	rorl	$2,%ecx
+	addl	%edx,%ebp
+	addl	12(%esp),%edx
+	addl	%ecx,%ebp
+	movl	92(%esp),%ecx
+	movl	%esi,%ebx
+	rorl	$11,%esi
+	movl	%ecx,%edi
+	rorl	$2,%ecx
+	xorl	%ebx,%esi
+	shrl	$3,%ebx
+	rorl	$7,%esi
+	xorl	%edi,%ecx
+	xorl	%esi,%ebx
+	rorl	$17,%ecx
+	addl	36(%esp),%ebx
+	shrl	$10,%edi
+	addl	72(%esp),%ebx
+	movl	%edx,%esi
+	xorl	%ecx,%edi
+	movl	16(%esp),%ecx
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	20(%esp),%edi
+	xorl	%esi,%edx
+	movl	%ebx,36(%esp)
+	xorl	%edi,%ecx
+	rorl	$5,%edx
+	andl	%esi,%ecx
+	movl	%esi,12(%esp)
+	xorl	%esi,%edx
+	addl	24(%esp),%ebx
+	xorl	%ecx,%edi
+	rorl	$6,%edx
+	movl	%ebp,%esi
+	addl	%edi,%ebx
+	rorl	$9,%esi
+	movl	%ebp,%ecx
+	movl	(%esp),%edi
+	xorl	%ebp,%esi
+	movl	%ebp,28(%esp)
+	xorl	%edi,%ebp
+	rorl	$11,%esi
+	andl	%ebp,%eax
+	leal	773529912(%ebx,%edx,1),%edx
+	xorl	%ecx,%esi
+	xorl	%edi,%eax
+	movl	44(%esp),%ecx
+	rorl	$2,%esi
+	addl	%edx,%eax
+	addl	8(%esp),%edx
+	addl	%esi,%eax
+	movl	32(%esp),%esi
+	movl	%ecx,%ebx
+	rorl	$11,%ecx
+	movl	%esi,%edi
+	rorl	$2,%esi
+	xorl	%ebx,%ecx
+	shrl	$3,%ebx
+	rorl	$7,%ecx
+	xorl	%edi,%esi
+	xorl	%ecx,%ebx
+	rorl	$17,%esi
+	addl	40(%esp),%ebx
+	shrl	$10,%edi
+	addl	76(%esp),%ebx
+	movl	%edx,%ecx
+	xorl	%esi,%edi
+	movl	12(%esp),%esi
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	16(%esp),%edi
+	xorl	%ecx,%edx
+	movl	%ebx,40(%esp)
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,8(%esp)
+	xorl	%ecx,%edx
+	addl	20(%esp),%ebx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%ebx
+	rorl	$9,%ecx
+	movl	%eax,%esi
+	movl	28(%esp),%edi
+	xorl	%eax,%ecx
+	movl	%eax,24(%esp)
+	xorl	%edi,%eax
+	rorl	$11,%ecx
+	andl	%eax,%ebp
+	leal	1294757372(%ebx,%edx,1),%edx
+	xorl	%esi,%ecx
+	xorl	%edi,%ebp
+	movl	48(%esp),%esi
+	rorl	$2,%ecx
+	addl	%edx,%ebp
+	addl	4(%esp),%edx
+	addl	%ecx,%ebp
+	movl	36(%esp),%ecx
+	movl	%esi,%ebx
+	rorl	$11,%esi
+	movl	%ecx,%edi
+	rorl	$2,%ecx
+	xorl	%ebx,%esi
+	shrl	$3,%ebx
+	rorl	$7,%esi
+	xorl	%edi,%ecx
+	xorl	%esi,%ebx
+	rorl	$17,%ecx
+	addl	44(%esp),%ebx
+	shrl	$10,%edi
+	addl	80(%esp),%ebx
+	movl	%edx,%esi
+	xorl	%ecx,%edi
+	movl	8(%esp),%ecx
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	12(%esp),%edi
+	xorl	%esi,%edx
+	movl	%ebx,44(%esp)
+	xorl	%edi,%ecx
+	rorl	$5,%edx
+	andl	%esi,%ecx
+	movl	%esi,4(%esp)
+	xorl	%esi,%edx
+	addl	16(%esp),%ebx
+	xorl	%ecx,%edi
+	rorl	$6,%edx
+	movl	%ebp,%esi
+	addl	%edi,%ebx
+	rorl	$9,%esi
+	movl	%ebp,%ecx
+	movl	24(%esp),%edi
+	xorl	%ebp,%esi
+	movl	%ebp,20(%esp)
+	xorl	%edi,%ebp
+	rorl	$11,%esi
+	andl	%ebp,%eax
+	leal	1396182291(%ebx,%edx,1),%edx
+	xorl	%ecx,%esi
+	xorl	%edi,%eax
+	movl	52(%esp),%ecx
+	rorl	$2,%esi
+	addl	%edx,%eax
+	addl	(%esp),%edx
+	addl	%esi,%eax
+	movl	40(%esp),%esi
+	movl	%ecx,%ebx
+	rorl	$11,%ecx
+	movl	%esi,%edi
+	rorl	$2,%esi
+	xorl	%ebx,%ecx
+	shrl	$3,%ebx
+	rorl	$7,%ecx
+	xorl	%edi,%esi
+	xorl	%ecx,%ebx
+	rorl	$17,%esi
+	addl	48(%esp),%ebx
+	shrl	$10,%edi
+	addl	84(%esp),%ebx
+	movl	%edx,%ecx
+	xorl	%esi,%edi
+	movl	4(%esp),%esi
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	8(%esp),%edi
+	xorl	%ecx,%edx
+	movl	%ebx,48(%esp)
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,(%esp)
+	xorl	%ecx,%edx
+	addl	12(%esp),%ebx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%ebx
+	rorl	$9,%ecx
+	movl	%eax,%esi
+	movl	20(%esp),%edi
+	xorl	%eax,%ecx
+	movl	%eax,16(%esp)
+	xorl	%edi,%eax
+	rorl	$11,%ecx
+	andl	%eax,%ebp
+	leal	1695183700(%ebx,%edx,1),%edx
+	xorl	%esi,%ecx
+	xorl	%edi,%ebp
+	movl	56(%esp),%esi
+	rorl	$2,%ecx
+	addl	%edx,%ebp
+	addl	28(%esp),%edx
+	addl	%ecx,%ebp
+	movl	44(%esp),%ecx
+	movl	%esi,%ebx
+	rorl	$11,%esi
+	movl	%ecx,%edi
+	rorl	$2,%ecx
+	xorl	%ebx,%esi
+	shrl	$3,%ebx
+	rorl	$7,%esi
+	xorl	%edi,%ecx
+	xorl	%esi,%ebx
+	rorl	$17,%ecx
+	addl	52(%esp),%ebx
+	shrl	$10,%edi
+	addl	88(%esp),%ebx
+	movl	%edx,%esi
+	xorl	%ecx,%edi
+	movl	(%esp),%ecx
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	4(%esp),%edi
+	xorl	%esi,%edx
+	movl	%ebx,52(%esp)
+	xorl	%edi,%ecx
+	rorl	$5,%edx
+	andl	%esi,%ecx
+	movl	%esi,28(%esp)
+	xorl	%esi,%edx
+	addl	8(%esp),%ebx
+	xorl	%ecx,%edi
+	rorl	$6,%edx
+	movl	%ebp,%esi
+	addl	%edi,%ebx
+	rorl	$9,%esi
+	movl	%ebp,%ecx
+	movl	16(%esp),%edi
+	xorl	%ebp,%esi
+	movl	%ebp,12(%esp)
+	xorl	%edi,%ebp
+	rorl	$11,%esi
+	andl	%ebp,%eax
+	leal	1986661051(%ebx,%edx,1),%edx
+	xorl	%ecx,%esi
+	xorl	%edi,%eax
+	movl	60(%esp),%ecx
+	rorl	$2,%esi
+	addl	%edx,%eax
+	addl	24(%esp),%edx
+	addl	%esi,%eax
+	movl	48(%esp),%esi
+	movl	%ecx,%ebx
+	rorl	$11,%ecx
+	movl	%esi,%edi
+	rorl	$2,%esi
+	xorl	%ebx,%ecx
+	shrl	$3,%ebx
+	rorl	$7,%ecx
+	xorl	%edi,%esi
+	xorl	%ecx,%ebx
+	rorl	$17,%esi
+	addl	56(%esp),%ebx
+	shrl	$10,%edi
+	addl	92(%esp),%ebx
+	movl	%edx,%ecx
+	xorl	%esi,%edi
+	movl	28(%esp),%esi
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	(%esp),%edi
+	xorl	%ecx,%edx
+	movl	%ebx,56(%esp)
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,24(%esp)
+	xorl	%ecx,%edx
+	addl	4(%esp),%ebx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%ebx
+	rorl	$9,%ecx
+	movl	%eax,%esi
+	movl	12(%esp),%edi
+	xorl	%eax,%ecx
+	movl	%eax,8(%esp)
+	xorl	%edi,%eax
+	rorl	$11,%ecx
+	andl	%eax,%ebp
+	leal	2177026350(%ebx,%edx,1),%edx
+	xorl	%esi,%ecx
+	xorl	%edi,%ebp
+	movl	64(%esp),%esi
+	rorl	$2,%ecx
+	addl	%edx,%ebp
+	addl	20(%esp),%edx
+	addl	%ecx,%ebp
+	movl	52(%esp),%ecx
+	movl	%esi,%ebx
+	rorl	$11,%esi
+	movl	%ecx,%edi
+	rorl	$2,%ecx
+	xorl	%ebx,%esi
+	shrl	$3,%ebx
+	rorl	$7,%esi
+	xorl	%edi,%ecx
+	xorl	%esi,%ebx
+	rorl	$17,%ecx
+	addl	60(%esp),%ebx
+	shrl	$10,%edi
+	addl	32(%esp),%ebx
+	movl	%edx,%esi
+	xorl	%ecx,%edi
+	movl	24(%esp),%ecx
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	28(%esp),%edi
+	xorl	%esi,%edx
+	movl	%ebx,60(%esp)
+	xorl	%edi,%ecx
+	rorl	$5,%edx
+	andl	%esi,%ecx
+	movl	%esi,20(%esp)
+	xorl	%esi,%edx
+	addl	(%esp),%ebx
+	xorl	%ecx,%edi
+	rorl	$6,%edx
+	movl	%ebp,%esi
+	addl	%edi,%ebx
+	rorl	$9,%esi
+	movl	%ebp,%ecx
+	movl	8(%esp),%edi
+	xorl	%ebp,%esi
+	movl	%ebp,4(%esp)
+	xorl	%edi,%ebp
+	rorl	$11,%esi
+	andl	%ebp,%eax
+	leal	2456956037(%ebx,%edx,1),%edx
+	xorl	%ecx,%esi
+	xorl	%edi,%eax
+	movl	68(%esp),%ecx
+	rorl	$2,%esi
+	addl	%edx,%eax
+	addl	16(%esp),%edx
+	addl	%esi,%eax
+	movl	56(%esp),%esi
+	movl	%ecx,%ebx
+	rorl	$11,%ecx
+	movl	%esi,%edi
+	rorl	$2,%esi
+	xorl	%ebx,%ecx
+	shrl	$3,%ebx
+	rorl	$7,%ecx
+	xorl	%edi,%esi
+	xorl	%ecx,%ebx
+	rorl	$17,%esi
+	addl	64(%esp),%ebx
+	shrl	$10,%edi
+	addl	36(%esp),%ebx
+	movl	%edx,%ecx
+	xorl	%esi,%edi
+	movl	20(%esp),%esi
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	24(%esp),%edi
+	xorl	%ecx,%edx
+	movl	%ebx,64(%esp)
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,16(%esp)
+	xorl	%ecx,%edx
+	addl	28(%esp),%ebx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%ebx
+	rorl	$9,%ecx
+	movl	%eax,%esi
+	movl	4(%esp),%edi
+	xorl	%eax,%ecx
+	movl	%eax,(%esp)
+	xorl	%edi,%eax
+	rorl	$11,%ecx
+	andl	%eax,%ebp
+	leal	2730485921(%ebx,%edx,1),%edx
+	xorl	%esi,%ecx
+	xorl	%edi,%ebp
+	movl	72(%esp),%esi
+	rorl	$2,%ecx
+	addl	%edx,%ebp
+	addl	12(%esp),%edx
+	addl	%ecx,%ebp
+	movl	60(%esp),%ecx
+	movl	%esi,%ebx
+	rorl	$11,%esi
+	movl	%ecx,%edi
+	rorl	$2,%ecx
+	xorl	%ebx,%esi
+	shrl	$3,%ebx
+	rorl	$7,%esi
+	xorl	%edi,%ecx
+	xorl	%esi,%ebx
+	rorl	$17,%ecx
+	addl	68(%esp),%ebx
+	shrl	$10,%edi
+	addl	40(%esp),%ebx
+	movl	%edx,%esi
+	xorl	%ecx,%edi
+	movl	16(%esp),%ecx
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	20(%esp),%edi
+	xorl	%esi,%edx
+	movl	%ebx,68(%esp)
+	xorl	%edi,%ecx
+	rorl	$5,%edx
+	andl	%esi,%ecx
+	movl	%esi,12(%esp)
+	xorl	%esi,%edx
+	addl	24(%esp),%ebx
+	xorl	%ecx,%edi
+	rorl	$6,%edx
+	movl	%ebp,%esi
+	addl	%edi,%ebx
+	rorl	$9,%esi
+	movl	%ebp,%ecx
+	movl	(%esp),%edi
+	xorl	%ebp,%esi
+	movl	%ebp,28(%esp)
+	xorl	%edi,%ebp
+	rorl	$11,%esi
+	andl	%ebp,%eax
+	leal	2820302411(%ebx,%edx,1),%edx
+	xorl	%ecx,%esi
+	xorl	%edi,%eax
+	movl	76(%esp),%ecx
+	rorl	$2,%esi
+	addl	%edx,%eax
+	addl	8(%esp),%edx
+	addl	%esi,%eax
+	movl	64(%esp),%esi
+	movl	%ecx,%ebx
+	rorl	$11,%ecx
+	movl	%esi,%edi
+	rorl	$2,%esi
+	xorl	%ebx,%ecx
+	shrl	$3,%ebx
+	rorl	$7,%ecx
+	xorl	%edi,%esi
+	xorl	%ecx,%ebx
+	rorl	$17,%esi
+	addl	72(%esp),%ebx
+	shrl	$10,%edi
+	addl	44(%esp),%ebx
+	movl	%edx,%ecx
+	xorl	%esi,%edi
+	movl	12(%esp),%esi
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	16(%esp),%edi
+	xorl	%ecx,%edx
+	movl	%ebx,72(%esp)
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,8(%esp)
+	xorl	%ecx,%edx
+	addl	20(%esp),%ebx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%ebx
+	rorl	$9,%ecx
+	movl	%eax,%esi
+	movl	28(%esp),%edi
+	xorl	%eax,%ecx
+	movl	%eax,24(%esp)
+	xorl	%edi,%eax
+	rorl	$11,%ecx
+	andl	%eax,%ebp
+	leal	3259730800(%ebx,%edx,1),%edx
+	xorl	%esi,%ecx
+	xorl	%edi,%ebp
+	movl	80(%esp),%esi
+	rorl	$2,%ecx
+	addl	%edx,%ebp
+	addl	4(%esp),%edx
+	addl	%ecx,%ebp
+	movl	68(%esp),%ecx
+	movl	%esi,%ebx
+	rorl	$11,%esi
+	movl	%ecx,%edi
+	rorl	$2,%ecx
+	xorl	%ebx,%esi
+	shrl	$3,%ebx
+	rorl	$7,%esi
+	xorl	%edi,%ecx
+	xorl	%esi,%ebx
+	rorl	$17,%ecx
+	addl	76(%esp),%ebx
+	shrl	$10,%edi
+	addl	48(%esp),%ebx
+	movl	%edx,%esi
+	xorl	%ecx,%edi
+	movl	8(%esp),%ecx
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	12(%esp),%edi
+	xorl	%esi,%edx
+	movl	%ebx,76(%esp)
+	xorl	%edi,%ecx
+	rorl	$5,%edx
+	andl	%esi,%ecx
+	movl	%esi,4(%esp)
+	xorl	%esi,%edx
+	addl	16(%esp),%ebx
+	xorl	%ecx,%edi
+	rorl	$6,%edx
+	movl	%ebp,%esi
+	addl	%edi,%ebx
+	rorl	$9,%esi
+	movl	%ebp,%ecx
+	movl	24(%esp),%edi
+	xorl	%ebp,%esi
+	movl	%ebp,20(%esp)
+	xorl	%edi,%ebp
+	rorl	$11,%esi
+	andl	%ebp,%eax
+	leal	3345764771(%ebx,%edx,1),%edx
+	xorl	%ecx,%esi
+	xorl	%edi,%eax
+	movl	84(%esp),%ecx
+	rorl	$2,%esi
+	addl	%edx,%eax
+	addl	(%esp),%edx
+	addl	%esi,%eax
+	movl	72(%esp),%esi
+	movl	%ecx,%ebx
+	rorl	$11,%ecx
+	movl	%esi,%edi
+	rorl	$2,%esi
+	xorl	%ebx,%ecx
+	shrl	$3,%ebx
+	rorl	$7,%ecx
+	xorl	%edi,%esi
+	xorl	%ecx,%ebx
+	rorl	$17,%esi
+	addl	80(%esp),%ebx
+	shrl	$10,%edi
+	addl	52(%esp),%ebx
+	movl	%edx,%ecx
+	xorl	%esi,%edi
+	movl	4(%esp),%esi
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	8(%esp),%edi
+	xorl	%ecx,%edx
+	movl	%ebx,80(%esp)
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,(%esp)
+	xorl	%ecx,%edx
+	addl	12(%esp),%ebx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%ebx
+	rorl	$9,%ecx
+	movl	%eax,%esi
+	movl	20(%esp),%edi
+	xorl	%eax,%ecx
+	movl	%eax,16(%esp)
+	xorl	%edi,%eax
+	rorl	$11,%ecx
+	andl	%eax,%ebp
+	leal	3516065817(%ebx,%edx,1),%edx
+	xorl	%esi,%ecx
+	xorl	%edi,%ebp
+	movl	88(%esp),%esi
+	rorl	$2,%ecx
+	addl	%edx,%ebp
+	addl	28(%esp),%edx
+	addl	%ecx,%ebp
+	movl	76(%esp),%ecx
+	movl	%esi,%ebx
+	rorl	$11,%esi
+	movl	%ecx,%edi
+	rorl	$2,%ecx
+	xorl	%ebx,%esi
+	shrl	$3,%ebx
+	rorl	$7,%esi
+	xorl	%edi,%ecx
+	xorl	%esi,%ebx
+	rorl	$17,%ecx
+	addl	84(%esp),%ebx
+	shrl	$10,%edi
+	addl	56(%esp),%ebx
+	movl	%edx,%esi
+	xorl	%ecx,%edi
+	movl	(%esp),%ecx
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	4(%esp),%edi
+	xorl	%esi,%edx
+	movl	%ebx,84(%esp)
+	xorl	%edi,%ecx
+	rorl	$5,%edx
+	andl	%esi,%ecx
+	movl	%esi,28(%esp)
+	xorl	%esi,%edx
+	addl	8(%esp),%ebx
+	xorl	%ecx,%edi
+	rorl	$6,%edx
+	movl	%ebp,%esi
+	addl	%edi,%ebx
+	rorl	$9,%esi
+	movl	%ebp,%ecx
+	movl	16(%esp),%edi
+	xorl	%ebp,%esi
+	movl	%ebp,12(%esp)
+	xorl	%edi,%ebp
+	rorl	$11,%esi
+	andl	%ebp,%eax
+	leal	3600352804(%ebx,%edx,1),%edx
+	xorl	%ecx,%esi
+	xorl	%edi,%eax
+	movl	92(%esp),%ecx
+	rorl	$2,%esi
+	addl	%edx,%eax
+	addl	24(%esp),%edx
+	addl	%esi,%eax
+	movl	80(%esp),%esi
+	movl	%ecx,%ebx
+	rorl	$11,%ecx
+	movl	%esi,%edi
+	rorl	$2,%esi
+	xorl	%ebx,%ecx
+	shrl	$3,%ebx
+	rorl	$7,%ecx
+	xorl	%edi,%esi
+	xorl	%ecx,%ebx
+	rorl	$17,%esi
+	addl	88(%esp),%ebx
+	shrl	$10,%edi
+	addl	60(%esp),%ebx
+	movl	%edx,%ecx
+	xorl	%esi,%edi
+	movl	28(%esp),%esi
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	(%esp),%edi
+	xorl	%ecx,%edx
+	movl	%ebx,88(%esp)
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,24(%esp)
+	xorl	%ecx,%edx
+	addl	4(%esp),%ebx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%ebx
+	rorl	$9,%ecx
+	movl	%eax,%esi
+	movl	12(%esp),%edi
+	xorl	%eax,%ecx
+	movl	%eax,8(%esp)
+	xorl	%edi,%eax
+	rorl	$11,%ecx
+	andl	%eax,%ebp
+	leal	4094571909(%ebx,%edx,1),%edx
+	xorl	%esi,%ecx
+	xorl	%edi,%ebp
+	movl	32(%esp),%esi
+	rorl	$2,%ecx
+	addl	%edx,%ebp
+	addl	20(%esp),%edx
+	addl	%ecx,%ebp
+	movl	84(%esp),%ecx
+	movl	%esi,%ebx
+	rorl	$11,%esi
+	movl	%ecx,%edi
+	rorl	$2,%ecx
+	xorl	%ebx,%esi
+	shrl	$3,%ebx
+	rorl	$7,%esi
+	xorl	%edi,%ecx
+	xorl	%esi,%ebx
+	rorl	$17,%ecx
+	addl	92(%esp),%ebx
+	shrl	$10,%edi
+	addl	64(%esp),%ebx
+	movl	%edx,%esi
+	xorl	%ecx,%edi
+	movl	24(%esp),%ecx
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	28(%esp),%edi
+	xorl	%esi,%edx
+	movl	%ebx,92(%esp)
+	xorl	%edi,%ecx
+	rorl	$5,%edx
+	andl	%esi,%ecx
+	movl	%esi,20(%esp)
+	xorl	%esi,%edx
+	addl	(%esp),%ebx
+	xorl	%ecx,%edi
+	rorl	$6,%edx
+	movl	%ebp,%esi
+	addl	%edi,%ebx
+	rorl	$9,%esi
+	movl	%ebp,%ecx
+	movl	8(%esp),%edi
+	xorl	%ebp,%esi
+	movl	%ebp,4(%esp)
+	xorl	%edi,%ebp
+	rorl	$11,%esi
+	andl	%ebp,%eax
+	leal	275423344(%ebx,%edx,1),%edx
+	xorl	%ecx,%esi
+	xorl	%edi,%eax
+	movl	36(%esp),%ecx
+	rorl	$2,%esi
+	addl	%edx,%eax
+	addl	16(%esp),%edx
+	addl	%esi,%eax
+	movl	88(%esp),%esi
+	movl	%ecx,%ebx
+	rorl	$11,%ecx
+	movl	%esi,%edi
+	rorl	$2,%esi
+	xorl	%ebx,%ecx
+	shrl	$3,%ebx
+	rorl	$7,%ecx
+	xorl	%edi,%esi
+	xorl	%ecx,%ebx
+	rorl	$17,%esi
+	addl	32(%esp),%ebx
+	shrl	$10,%edi
+	addl	68(%esp),%ebx
+	movl	%edx,%ecx
+	xorl	%esi,%edi
+	movl	20(%esp),%esi
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	24(%esp),%edi
+	xorl	%ecx,%edx
+	movl	%ebx,32(%esp)
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,16(%esp)
+	xorl	%ecx,%edx
+	addl	28(%esp),%ebx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%ebx
+	rorl	$9,%ecx
+	movl	%eax,%esi
+	movl	4(%esp),%edi
+	xorl	%eax,%ecx
+	movl	%eax,(%esp)
+	xorl	%edi,%eax
+	rorl	$11,%ecx
+	andl	%eax,%ebp
+	leal	430227734(%ebx,%edx,1),%edx
+	xorl	%esi,%ecx
+	xorl	%edi,%ebp
+	movl	40(%esp),%esi
+	rorl	$2,%ecx
+	addl	%edx,%ebp
+	addl	12(%esp),%edx
+	addl	%ecx,%ebp
+	movl	92(%esp),%ecx
+	movl	%esi,%ebx
+	rorl	$11,%esi
+	movl	%ecx,%edi
+	rorl	$2,%ecx
+	xorl	%ebx,%esi
+	shrl	$3,%ebx
+	rorl	$7,%esi
+	xorl	%edi,%ecx
+	xorl	%esi,%ebx
+	rorl	$17,%ecx
+	addl	36(%esp),%ebx
+	shrl	$10,%edi
+	addl	72(%esp),%ebx
+	movl	%edx,%esi
+	xorl	%ecx,%edi
+	movl	16(%esp),%ecx
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	20(%esp),%edi
+	xorl	%esi,%edx
+	movl	%ebx,36(%esp)
+	xorl	%edi,%ecx
+	rorl	$5,%edx
+	andl	%esi,%ecx
+	movl	%esi,12(%esp)
+	xorl	%esi,%edx
+	addl	24(%esp),%ebx
+	xorl	%ecx,%edi
+	rorl	$6,%edx
+	movl	%ebp,%esi
+	addl	%edi,%ebx
+	rorl	$9,%esi
+	movl	%ebp,%ecx
+	movl	(%esp),%edi
+	xorl	%ebp,%esi
+	movl	%ebp,28(%esp)
+	xorl	%edi,%ebp
+	rorl	$11,%esi
+	andl	%ebp,%eax
+	leal	506948616(%ebx,%edx,1),%edx
+	xorl	%ecx,%esi
+	xorl	%edi,%eax
+	movl	44(%esp),%ecx
+	rorl	$2,%esi
+	addl	%edx,%eax
+	addl	8(%esp),%edx
+	addl	%esi,%eax
+	movl	32(%esp),%esi
+	movl	%ecx,%ebx
+	rorl	$11,%ecx
+	movl	%esi,%edi
+	rorl	$2,%esi
+	xorl	%ebx,%ecx
+	shrl	$3,%ebx
+	rorl	$7,%ecx
+	xorl	%edi,%esi
+	xorl	%ecx,%ebx
+	rorl	$17,%esi
+	addl	40(%esp),%ebx
+	shrl	$10,%edi
+	addl	76(%esp),%ebx
+	movl	%edx,%ecx
+	xorl	%esi,%edi
+	movl	12(%esp),%esi
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	16(%esp),%edi
+	xorl	%ecx,%edx
+	movl	%ebx,40(%esp)
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,8(%esp)
+	xorl	%ecx,%edx
+	addl	20(%esp),%ebx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%ebx
+	rorl	$9,%ecx
+	movl	%eax,%esi
+	movl	28(%esp),%edi
+	xorl	%eax,%ecx
+	movl	%eax,24(%esp)
+	xorl	%edi,%eax
+	rorl	$11,%ecx
+	andl	%eax,%ebp
+	leal	659060556(%ebx,%edx,1),%edx
+	xorl	%esi,%ecx
+	xorl	%edi,%ebp
+	movl	48(%esp),%esi
+	rorl	$2,%ecx
+	addl	%edx,%ebp
+	addl	4(%esp),%edx
+	addl	%ecx,%ebp
+	movl	36(%esp),%ecx
+	movl	%esi,%ebx
+	rorl	$11,%esi
+	movl	%ecx,%edi
+	rorl	$2,%ecx
+	xorl	%ebx,%esi
+	shrl	$3,%ebx
+	rorl	$7,%esi
+	xorl	%edi,%ecx
+	xorl	%esi,%ebx
+	rorl	$17,%ecx
+	addl	44(%esp),%ebx
+	shrl	$10,%edi
+	addl	80(%esp),%ebx
+	movl	%edx,%esi
+	xorl	%ecx,%edi
+	movl	8(%esp),%ecx
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	12(%esp),%edi
+	xorl	%esi,%edx
+	movl	%ebx,44(%esp)
+	xorl	%edi,%ecx
+	rorl	$5,%edx
+	andl	%esi,%ecx
+	movl	%esi,4(%esp)
+	xorl	%esi,%edx
+	addl	16(%esp),%ebx
+	xorl	%ecx,%edi
+	rorl	$6,%edx
+	movl	%ebp,%esi
+	addl	%edi,%ebx
+	rorl	$9,%esi
+	movl	%ebp,%ecx
+	movl	24(%esp),%edi
+	xorl	%ebp,%esi
+	movl	%ebp,20(%esp)
+	xorl	%edi,%ebp
+	rorl	$11,%esi
+	andl	%ebp,%eax
+	leal	883997877(%ebx,%edx,1),%edx
+	xorl	%ecx,%esi
+	xorl	%edi,%eax
+	movl	52(%esp),%ecx
+	rorl	$2,%esi
+	addl	%edx,%eax
+	addl	(%esp),%edx
+	addl	%esi,%eax
+	movl	40(%esp),%esi
+	movl	%ecx,%ebx
+	rorl	$11,%ecx
+	movl	%esi,%edi
+	rorl	$2,%esi
+	xorl	%ebx,%ecx
+	shrl	$3,%ebx
+	rorl	$7,%ecx
+	xorl	%edi,%esi
+	xorl	%ecx,%ebx
+	rorl	$17,%esi
+	addl	48(%esp),%ebx
+	shrl	$10,%edi
+	addl	84(%esp),%ebx
+	movl	%edx,%ecx
+	xorl	%esi,%edi
+	movl	4(%esp),%esi
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	8(%esp),%edi
+	xorl	%ecx,%edx
+	movl	%ebx,48(%esp)
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,(%esp)
+	xorl	%ecx,%edx
+	addl	12(%esp),%ebx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%ebx
+	rorl	$9,%ecx
+	movl	%eax,%esi
+	movl	20(%esp),%edi
+	xorl	%eax,%ecx
+	movl	%eax,16(%esp)
+	xorl	%edi,%eax
+	rorl	$11,%ecx
+	andl	%eax,%ebp
+	leal	958139571(%ebx,%edx,1),%edx
+	xorl	%esi,%ecx
+	xorl	%edi,%ebp
+	movl	56(%esp),%esi
+	rorl	$2,%ecx
+	addl	%edx,%ebp
+	addl	28(%esp),%edx
+	addl	%ecx,%ebp
+	movl	44(%esp),%ecx
+	movl	%esi,%ebx
+	rorl	$11,%esi
+	movl	%ecx,%edi
+	rorl	$2,%ecx
+	xorl	%ebx,%esi
+	shrl	$3,%ebx
+	rorl	$7,%esi
+	xorl	%edi,%ecx
+	xorl	%esi,%ebx
+	rorl	$17,%ecx
+	addl	52(%esp),%ebx
+	shrl	$10,%edi
+	addl	88(%esp),%ebx
+	movl	%edx,%esi
+	xorl	%ecx,%edi
+	movl	(%esp),%ecx
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	4(%esp),%edi
+	xorl	%esi,%edx
+	movl	%ebx,52(%esp)
+	xorl	%edi,%ecx
+	rorl	$5,%edx
+	andl	%esi,%ecx
+	movl	%esi,28(%esp)
+	xorl	%esi,%edx
+	addl	8(%esp),%ebx
+	xorl	%ecx,%edi
+	rorl	$6,%edx
+	movl	%ebp,%esi
+	addl	%edi,%ebx
+	rorl	$9,%esi
+	movl	%ebp,%ecx
+	movl	16(%esp),%edi
+	xorl	%ebp,%esi
+	movl	%ebp,12(%esp)
+	xorl	%edi,%ebp
+	rorl	$11,%esi
+	andl	%ebp,%eax
+	leal	1322822218(%ebx,%edx,1),%edx
+	xorl	%ecx,%esi
+	xorl	%edi,%eax
+	movl	60(%esp),%ecx
+	rorl	$2,%esi
+	addl	%edx,%eax
+	addl	24(%esp),%edx
+	addl	%esi,%eax
+	movl	48(%esp),%esi
+	movl	%ecx,%ebx
+	rorl	$11,%ecx
+	movl	%esi,%edi
+	rorl	$2,%esi
+	xorl	%ebx,%ecx
+	shrl	$3,%ebx
+	rorl	$7,%ecx
+	xorl	%edi,%esi
+	xorl	%ecx,%ebx
+	rorl	$17,%esi
+	addl	56(%esp),%ebx
+	shrl	$10,%edi
+	addl	92(%esp),%ebx
+	movl	%edx,%ecx
+	xorl	%esi,%edi
+	movl	28(%esp),%esi
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	(%esp),%edi
+	xorl	%ecx,%edx
+	movl	%ebx,56(%esp)
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,24(%esp)
+	xorl	%ecx,%edx
+	addl	4(%esp),%ebx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%ebx
+	rorl	$9,%ecx
+	movl	%eax,%esi
+	movl	12(%esp),%edi
+	xorl	%eax,%ecx
+	movl	%eax,8(%esp)
+	xorl	%edi,%eax
+	rorl	$11,%ecx
+	andl	%eax,%ebp
+	leal	1537002063(%ebx,%edx,1),%edx
+	xorl	%esi,%ecx
+	xorl	%edi,%ebp
+	movl	64(%esp),%esi
+	rorl	$2,%ecx
+	addl	%edx,%ebp
+	addl	20(%esp),%edx
+	addl	%ecx,%ebp
+	movl	52(%esp),%ecx
+	movl	%esi,%ebx
+	rorl	$11,%esi
+	movl	%ecx,%edi
+	rorl	$2,%ecx
+	xorl	%ebx,%esi
+	shrl	$3,%ebx
+	rorl	$7,%esi
+	xorl	%edi,%ecx
+	xorl	%esi,%ebx
+	rorl	$17,%ecx
+	addl	60(%esp),%ebx
+	shrl	$10,%edi
+	addl	32(%esp),%ebx
+	movl	%edx,%esi
+	xorl	%ecx,%edi
+	movl	24(%esp),%ecx
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	28(%esp),%edi
+	xorl	%esi,%edx
+	movl	%ebx,60(%esp)
+	xorl	%edi,%ecx
+	rorl	$5,%edx
+	andl	%esi,%ecx
+	movl	%esi,20(%esp)
+	xorl	%esi,%edx
+	addl	(%esp),%ebx
+	xorl	%ecx,%edi
+	rorl	$6,%edx
+	movl	%ebp,%esi
+	addl	%edi,%ebx
+	rorl	$9,%esi
+	movl	%ebp,%ecx
+	movl	8(%esp),%edi
+	xorl	%ebp,%esi
+	movl	%ebp,4(%esp)
+	xorl	%edi,%ebp
+	rorl	$11,%esi
+	andl	%ebp,%eax
+	leal	1747873779(%ebx,%edx,1),%edx
+	xorl	%ecx,%esi
+	xorl	%edi,%eax
+	movl	68(%esp),%ecx
+	rorl	$2,%esi
+	addl	%edx,%eax
+	addl	16(%esp),%edx
+	addl	%esi,%eax
+	movl	56(%esp),%esi
+	movl	%ecx,%ebx
+	rorl	$11,%ecx
+	movl	%esi,%edi
+	rorl	$2,%esi
+	xorl	%ebx,%ecx
+	shrl	$3,%ebx
+	rorl	$7,%ecx
+	xorl	%edi,%esi
+	xorl	%ecx,%ebx
+	rorl	$17,%esi
+	addl	64(%esp),%ebx
+	shrl	$10,%edi
+	addl	36(%esp),%ebx
+	movl	%edx,%ecx
+	xorl	%esi,%edi
+	movl	20(%esp),%esi
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	24(%esp),%edi
+	xorl	%ecx,%edx
+	movl	%ebx,64(%esp)
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,16(%esp)
+	xorl	%ecx,%edx
+	addl	28(%esp),%ebx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%ebx
+	rorl	$9,%ecx
+	movl	%eax,%esi
+	movl	4(%esp),%edi
+	xorl	%eax,%ecx
+	movl	%eax,(%esp)
+	xorl	%edi,%eax
+	rorl	$11,%ecx
+	andl	%eax,%ebp
+	leal	1955562222(%ebx,%edx,1),%edx
+	xorl	%esi,%ecx
+	xorl	%edi,%ebp
+	movl	72(%esp),%esi
+	rorl	$2,%ecx
+	addl	%edx,%ebp
+	addl	12(%esp),%edx
+	addl	%ecx,%ebp
+	movl	60(%esp),%ecx
+	movl	%esi,%ebx
+	rorl	$11,%esi
+	movl	%ecx,%edi
+	rorl	$2,%ecx
+	xorl	%ebx,%esi
+	shrl	$3,%ebx
+	rorl	$7,%esi
+	xorl	%edi,%ecx
+	xorl	%esi,%ebx
+	rorl	$17,%ecx
+	addl	68(%esp),%ebx
+	shrl	$10,%edi
+	addl	40(%esp),%ebx
+	movl	%edx,%esi
+	xorl	%ecx,%edi
+	movl	16(%esp),%ecx
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	20(%esp),%edi
+	xorl	%esi,%edx
+	movl	%ebx,68(%esp)
+	xorl	%edi,%ecx
+	rorl	$5,%edx
+	andl	%esi,%ecx
+	movl	%esi,12(%esp)
+	xorl	%esi,%edx
+	addl	24(%esp),%ebx
+	xorl	%ecx,%edi
+	rorl	$6,%edx
+	movl	%ebp,%esi
+	addl	%edi,%ebx
+	rorl	$9,%esi
+	movl	%ebp,%ecx
+	movl	(%esp),%edi
+	xorl	%ebp,%esi
+	movl	%ebp,28(%esp)
+	xorl	%edi,%ebp
+	rorl	$11,%esi
+	andl	%ebp,%eax
+	leal	2024104815(%ebx,%edx,1),%edx
+	xorl	%ecx,%esi
+	xorl	%edi,%eax
+	movl	76(%esp),%ecx
+	rorl	$2,%esi
+	addl	%edx,%eax
+	addl	8(%esp),%edx
+	addl	%esi,%eax
+	movl	64(%esp),%esi
+	movl	%ecx,%ebx
+	rorl	$11,%ecx
+	movl	%esi,%edi
+	rorl	$2,%esi
+	xorl	%ebx,%ecx
+	shrl	$3,%ebx
+	rorl	$7,%ecx
+	xorl	%edi,%esi
+	xorl	%ecx,%ebx
+	rorl	$17,%esi
+	addl	72(%esp),%ebx
+	shrl	$10,%edi
+	addl	44(%esp),%ebx
+	movl	%edx,%ecx
+	xorl	%esi,%edi
+	movl	12(%esp),%esi
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	16(%esp),%edi
+	xorl	%ecx,%edx
+	movl	%ebx,72(%esp)
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,8(%esp)
+	xorl	%ecx,%edx
+	addl	20(%esp),%ebx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%ebx
+	rorl	$9,%ecx
+	movl	%eax,%esi
+	movl	28(%esp),%edi
+	xorl	%eax,%ecx
+	movl	%eax,24(%esp)
+	xorl	%edi,%eax
+	rorl	$11,%ecx
+	andl	%eax,%ebp
+	leal	2227730452(%ebx,%edx,1),%edx
+	xorl	%esi,%ecx
+	xorl	%edi,%ebp
+	movl	80(%esp),%esi
+	rorl	$2,%ecx
+	addl	%edx,%ebp
+	addl	4(%esp),%edx
+	addl	%ecx,%ebp
+	movl	68(%esp),%ecx
+	movl	%esi,%ebx
+	rorl	$11,%esi
+	movl	%ecx,%edi
+	rorl	$2,%ecx
+	xorl	%ebx,%esi
+	shrl	$3,%ebx
+	rorl	$7,%esi
+	xorl	%edi,%ecx
+	xorl	%esi,%ebx
+	rorl	$17,%ecx
+	addl	76(%esp),%ebx
+	shrl	$10,%edi
+	addl	48(%esp),%ebx
+	movl	%edx,%esi
+	xorl	%ecx,%edi
+	movl	8(%esp),%ecx
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	12(%esp),%edi
+	xorl	%esi,%edx
+	movl	%ebx,76(%esp)
+	xorl	%edi,%ecx
+	rorl	$5,%edx
+	andl	%esi,%ecx
+	movl	%esi,4(%esp)
+	xorl	%esi,%edx
+	addl	16(%esp),%ebx
+	xorl	%ecx,%edi
+	rorl	$6,%edx
+	movl	%ebp,%esi
+	addl	%edi,%ebx
+	rorl	$9,%esi
+	movl	%ebp,%ecx
+	movl	24(%esp),%edi
+	xorl	%ebp,%esi
+	movl	%ebp,20(%esp)
+	xorl	%edi,%ebp
+	rorl	$11,%esi
+	andl	%ebp,%eax
+	leal	2361852424(%ebx,%edx,1),%edx
+	xorl	%ecx,%esi
+	xorl	%edi,%eax
+	movl	84(%esp),%ecx
+	rorl	$2,%esi
+	addl	%edx,%eax
+	addl	(%esp),%edx
+	addl	%esi,%eax
+	movl	72(%esp),%esi
+	movl	%ecx,%ebx
+	rorl	$11,%ecx
+	movl	%esi,%edi
+	rorl	$2,%esi
+	xorl	%ebx,%ecx
+	shrl	$3,%ebx
+	rorl	$7,%ecx
+	xorl	%edi,%esi
+	xorl	%ecx,%ebx
+	rorl	$17,%esi
+	addl	80(%esp),%ebx
+	shrl	$10,%edi
+	addl	52(%esp),%ebx
+	movl	%edx,%ecx
+	xorl	%esi,%edi
+	movl	4(%esp),%esi
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	8(%esp),%edi
+	xorl	%ecx,%edx
+	movl	%ebx,80(%esp)
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,(%esp)
+	xorl	%ecx,%edx
+	addl	12(%esp),%ebx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%ebx
+	rorl	$9,%ecx
+	movl	%eax,%esi
+	movl	20(%esp),%edi
+	xorl	%eax,%ecx
+	movl	%eax,16(%esp)
+	xorl	%edi,%eax
+	rorl	$11,%ecx
+	andl	%eax,%ebp
+	leal	2428436474(%ebx,%edx,1),%edx
+	xorl	%esi,%ecx
+	xorl	%edi,%ebp
+	movl	88(%esp),%esi
+	rorl	$2,%ecx
+	addl	%edx,%ebp
+	addl	28(%esp),%edx
+	addl	%ecx,%ebp
+	movl	76(%esp),%ecx
+	movl	%esi,%ebx
+	rorl	$11,%esi
+	movl	%ecx,%edi
+	rorl	$2,%ecx
+	xorl	%ebx,%esi
+	shrl	$3,%ebx
+	rorl	$7,%esi
+	xorl	%edi,%ecx
+	xorl	%esi,%ebx
+	rorl	$17,%ecx
+	addl	84(%esp),%ebx
+	shrl	$10,%edi
+	addl	56(%esp),%ebx
+	movl	%edx,%esi
+	xorl	%ecx,%edi
+	movl	(%esp),%ecx
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	4(%esp),%edi
+	xorl	%esi,%edx
+	movl	%ebx,84(%esp)
+	xorl	%edi,%ecx
+	rorl	$5,%edx
+	andl	%esi,%ecx
+	movl	%esi,28(%esp)
+	xorl	%esi,%edx
+	addl	8(%esp),%ebx
+	xorl	%ecx,%edi
+	rorl	$6,%edx
+	movl	%ebp,%esi
+	addl	%edi,%ebx
+	rorl	$9,%esi
+	movl	%ebp,%ecx
+	movl	16(%esp),%edi
+	xorl	%ebp,%esi
+	movl	%ebp,12(%esp)
+	xorl	%edi,%ebp
+	rorl	$11,%esi
+	andl	%ebp,%eax
+	leal	2756734187(%ebx,%edx,1),%edx
+	xorl	%ecx,%esi
+	xorl	%edi,%eax
+	movl	92(%esp),%ecx
+	rorl	$2,%esi
+	addl	%edx,%eax
+	addl	24(%esp),%edx
+	addl	%esi,%eax
+	movl	80(%esp),%esi
+	movl	%ecx,%ebx
+	rorl	$11,%ecx
+	movl	%esi,%edi
+	rorl	$2,%esi
+	xorl	%ebx,%ecx
+	shrl	$3,%ebx
+	rorl	$7,%ecx
+	xorl	%edi,%esi
+	xorl	%ecx,%ebx
+	rorl	$17,%esi
+	addl	88(%esp),%ebx
+	shrl	$10,%edi
+	addl	60(%esp),%ebx
+	movl	%edx,%ecx
+	xorl	%esi,%edi
+	movl	28(%esp),%esi
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	(%esp),%edi
+	xorl	%ecx,%edx
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,24(%esp)
+	xorl	%ecx,%edx
+	addl	4(%esp),%ebx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%ebx
+	rorl	$9,%ecx
+	movl	%eax,%esi
+	movl	12(%esp),%edi
+	xorl	%eax,%ecx
+	movl	%eax,8(%esp)
+	xorl	%edi,%eax
+	rorl	$11,%ecx
+	andl	%eax,%ebp
+	leal	3204031479(%ebx,%edx,1),%edx
+	xorl	%esi,%ecx
+	xorl	%edi,%ebp
+	movl	32(%esp),%esi
+	rorl	$2,%ecx
+	addl	%edx,%ebp
+	addl	20(%esp),%edx
+	addl	%ecx,%ebp
+	movl	84(%esp),%ecx
+	movl	%esi,%ebx
+	rorl	$11,%esi
+	movl	%ecx,%edi
+	rorl	$2,%ecx
+	xorl	%ebx,%esi
+	shrl	$3,%ebx
+	rorl	$7,%esi
+	xorl	%edi,%ecx
+	xorl	%esi,%ebx
+	rorl	$17,%ecx
+	addl	92(%esp),%ebx
+	shrl	$10,%edi
+	addl	64(%esp),%ebx
+	movl	%edx,%esi
+	xorl	%ecx,%edi
+	movl	24(%esp),%ecx
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	28(%esp),%edi
+	xorl	%esi,%edx
+	xorl	%edi,%ecx
+	rorl	$5,%edx
+	andl	%esi,%ecx
+	movl	%esi,20(%esp)
+	xorl	%esi,%edx
+	addl	(%esp),%ebx
+	xorl	%ecx,%edi
+	rorl	$6,%edx
+	movl	%ebp,%esi
+	addl	%edi,%ebx
+	rorl	$9,%esi
+	movl	%ebp,%ecx
+	movl	8(%esp),%edi
+	xorl	%ebp,%esi
+	movl	%ebp,4(%esp)
+	xorl	%edi,%ebp
+	rorl	$11,%esi
+	andl	%ebp,%eax
+	leal	3329325298(%ebx,%edx,1),%edx
+	xorl	%ecx,%esi
+	xorl	%edi,%eax
+	rorl	$2,%esi
+	addl	%edx,%eax
+	addl	16(%esp),%edx
+	addl	%esi,%eax
+	movl	96(%esp),%esi
+	xorl	%edi,%ebp
+	movl	12(%esp),%ecx
+	addl	(%esi),%eax
+	addl	4(%esi),%ebp
+	addl	8(%esi),%edi
+	addl	12(%esi),%ecx
+	movl	%eax,(%esi)
+	movl	%ebp,4(%esi)
+	movl	%edi,8(%esi)
+	movl	%ecx,12(%esi)
+	movl	%ebp,4(%esp)
+	xorl	%edi,%ebp
+	movl	%edi,8(%esp)
+	movl	%ecx,12(%esp)
+	movl	20(%esp),%edi
+	movl	24(%esp),%ebx
+	movl	28(%esp),%ecx
+	addl	16(%esi),%edx
+	addl	20(%esi),%edi
+	addl	24(%esi),%ebx
+	addl	28(%esi),%ecx
+	movl	%edx,16(%esi)
+	movl	%edi,20(%esi)
+	movl	%ebx,24(%esi)
+	movl	%ecx,28(%esi)
+	movl	%edi,20(%esp)
+	movl	100(%esp),%edi
+	movl	%ebx,24(%esp)
+	movl	%ecx,28(%esp)
+	cmpl	104(%esp),%edi
+	jb	.L009grand_loop
+	movl	108(%esp),%esp
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.align	32
+.L004shaext:
+	subl	$32,%esp
+	movdqu	(%esi),%xmm1
+	leal	128(%ebp),%ebp
+	movdqu	16(%esi),%xmm2
+	movdqa	128(%ebp),%xmm7
+	pshufd	$27,%xmm1,%xmm0
+	pshufd	$177,%xmm1,%xmm1
+	pshufd	$27,%xmm2,%xmm2
+.byte	102,15,58,15,202,8
+	punpcklqdq	%xmm0,%xmm2
+	jmp	.L010loop_shaext
+.align	16
+.L010loop_shaext:
+	movdqu	(%edi),%xmm3
+	movdqu	16(%edi),%xmm4
+	movdqu	32(%edi),%xmm5
+.byte	102,15,56,0,223
+	movdqu	48(%edi),%xmm6
+	movdqa	%xmm2,16(%esp)
+	movdqa	-128(%ebp),%xmm0
+	paddd	%xmm3,%xmm0
+.byte	102,15,56,0,231
+.byte	15,56,203,209
+	pshufd	$14,%xmm0,%xmm0
+	nop
+	movdqa	%xmm1,(%esp)
+.byte	15,56,203,202
+	movdqa	-112(%ebp),%xmm0
+	paddd	%xmm4,%xmm0
+.byte	102,15,56,0,239
+.byte	15,56,203,209
+	pshufd	$14,%xmm0,%xmm0
+	leal	64(%edi),%edi
+.byte	15,56,204,220
+.byte	15,56,203,202
+	movdqa	-96(%ebp),%xmm0
+	paddd	%xmm5,%xmm0
+.byte	102,15,56,0,247
+.byte	15,56,203,209
+	pshufd	$14,%xmm0,%xmm0
+	movdqa	%xmm6,%xmm7
+.byte	102,15,58,15,253,4
+	nop
+	paddd	%xmm7,%xmm3
+.byte	15,56,204,229
+.byte	15,56,203,202
+	movdqa	-80(%ebp),%xmm0
+	paddd	%xmm6,%xmm0
+.byte	15,56,205,222
+.byte	15,56,203,209
+	pshufd	$14,%xmm0,%xmm0
+	movdqa	%xmm3,%xmm7
+.byte	102,15,58,15,254,4
+	nop
+	paddd	%xmm7,%xmm4
+.byte	15,56,204,238
+.byte	15,56,203,202
+	movdqa	-64(%ebp),%xmm0
+	paddd	%xmm3,%xmm0
+.byte	15,56,205,227
+.byte	15,56,203,209
+	pshufd	$14,%xmm0,%xmm0
+	movdqa	%xmm4,%xmm7
+.byte	102,15,58,15,251,4
+	nop
+	paddd	%xmm7,%xmm5
+.byte	15,56,204,243
+.byte	15,56,203,202
+	movdqa	-48(%ebp),%xmm0
+	paddd	%xmm4,%xmm0
+.byte	15,56,205,236
+.byte	15,56,203,209
+	pshufd	$14,%xmm0,%xmm0
+	movdqa	%xmm5,%xmm7
+.byte	102,15,58,15,252,4
+	nop
+	paddd	%xmm7,%xmm6
+.byte	15,56,204,220
+.byte	15,56,203,202
+	movdqa	-32(%ebp),%xmm0
+	paddd	%xmm5,%xmm0
+.byte	15,56,205,245
+.byte	15,56,203,209
+	pshufd	$14,%xmm0,%xmm0
+	movdqa	%xmm6,%xmm7
+.byte	102,15,58,15,253,4
+	nop
+	paddd	%xmm7,%xmm3
+.byte	15,56,204,229
+.byte	15,56,203,202
+	movdqa	-16(%ebp),%xmm0
+	paddd	%xmm6,%xmm0
+.byte	15,56,205,222
+.byte	15,56,203,209
+	pshufd	$14,%xmm0,%xmm0
+	movdqa	%xmm3,%xmm7
+.byte	102,15,58,15,254,4
+	nop
+	paddd	%xmm7,%xmm4
+.byte	15,56,204,238
+.byte	15,56,203,202
+	movdqa	(%ebp),%xmm0
+	paddd	%xmm3,%xmm0
+.byte	15,56,205,227
+.byte	15,56,203,209
+	pshufd	$14,%xmm0,%xmm0
+	movdqa	%xmm4,%xmm7
+.byte	102,15,58,15,251,4
+	nop
+	paddd	%xmm7,%xmm5
+.byte	15,56,204,243
+.byte	15,56,203,202
+	movdqa	16(%ebp),%xmm0
+	paddd	%xmm4,%xmm0
+.byte	15,56,205,236
+.byte	15,56,203,209
+	pshufd	$14,%xmm0,%xmm0
+	movdqa	%xmm5,%xmm7
+.byte	102,15,58,15,252,4
+	nop
+	paddd	%xmm7,%xmm6
+.byte	15,56,204,220
+.byte	15,56,203,202
+	movdqa	32(%ebp),%xmm0
+	paddd	%xmm5,%xmm0
+.byte	15,56,205,245
+.byte	15,56,203,209
+	pshufd	$14,%xmm0,%xmm0
+	movdqa	%xmm6,%xmm7
+.byte	102,15,58,15,253,4
+	nop
+	paddd	%xmm7,%xmm3
+.byte	15,56,204,229
+.byte	15,56,203,202
+	movdqa	48(%ebp),%xmm0
+	paddd	%xmm6,%xmm0
+.byte	15,56,205,222
+.byte	15,56,203,209
+	pshufd	$14,%xmm0,%xmm0
+	movdqa	%xmm3,%xmm7
+.byte	102,15,58,15,254,4
+	nop
+	paddd	%xmm7,%xmm4
+.byte	15,56,204,238
+.byte	15,56,203,202
+	movdqa	64(%ebp),%xmm0
+	paddd	%xmm3,%xmm0
+.byte	15,56,205,227
+.byte	15,56,203,209
+	pshufd	$14,%xmm0,%xmm0
+	movdqa	%xmm4,%xmm7
+.byte	102,15,58,15,251,4
+	nop
+	paddd	%xmm7,%xmm5
+.byte	15,56,204,243
+.byte	15,56,203,202
+	movdqa	80(%ebp),%xmm0
+	paddd	%xmm4,%xmm0
+.byte	15,56,205,236
+.byte	15,56,203,209
+	pshufd	$14,%xmm0,%xmm0
+	movdqa	%xmm5,%xmm7
+.byte	102,15,58,15,252,4
+.byte	15,56,203,202
+	paddd	%xmm7,%xmm6
+	movdqa	96(%ebp),%xmm0
+	paddd	%xmm5,%xmm0
+.byte	15,56,203,209
+	pshufd	$14,%xmm0,%xmm0
+.byte	15,56,205,245
+	movdqa	128(%ebp),%xmm7
+.byte	15,56,203,202
+	movdqa	112(%ebp),%xmm0
+	paddd	%xmm6,%xmm0
+	nop
+.byte	15,56,203,209
+	pshufd	$14,%xmm0,%xmm0
+	cmpl	%edi,%eax
+	nop
+.byte	15,56,203,202
+	paddd	16(%esp),%xmm2
+	paddd	(%esp),%xmm1
+	jnz	.L010loop_shaext
+	pshufd	$177,%xmm2,%xmm2
+	pshufd	$27,%xmm1,%xmm7
+	pshufd	$177,%xmm1,%xmm1
+	punpckhqdq	%xmm2,%xmm1
+.byte	102,15,58,15,215,8
+	movl	44(%esp),%esp
+	movdqu	%xmm1,(%esi)
+	movdqu	%xmm2,16(%esi)
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.align	32
+.L005SSSE3:
+	leal	-96(%esp),%esp
+	movl	(%esi),%eax
+	movl	4(%esi),%ebx
+	movl	8(%esi),%ecx
+	movl	12(%esi),%edi
+	movl	%ebx,4(%esp)
+	xorl	%ecx,%ebx
+	movl	%ecx,8(%esp)
+	movl	%edi,12(%esp)
+	movl	16(%esi),%edx
+	movl	20(%esi),%edi
+	movl	24(%esi),%ecx
+	movl	28(%esi),%esi
+	movl	%edi,20(%esp)
+	movl	100(%esp),%edi
+	movl	%ecx,24(%esp)
+	movl	%esi,28(%esp)
+	movdqa	256(%ebp),%xmm7
+	jmp	.L011grand_ssse3
+.align	16
+.L011grand_ssse3:
+	movdqu	(%edi),%xmm0
+	movdqu	16(%edi),%xmm1
+	movdqu	32(%edi),%xmm2
+	movdqu	48(%edi),%xmm3
+	addl	$64,%edi
+.byte	102,15,56,0,199
+	movl	%edi,100(%esp)
+.byte	102,15,56,0,207
+	movdqa	(%ebp),%xmm4
+.byte	102,15,56,0,215
+	movdqa	16(%ebp),%xmm5
+	paddd	%xmm0,%xmm4
+.byte	102,15,56,0,223
+	movdqa	32(%ebp),%xmm6
+	paddd	%xmm1,%xmm5
+	movdqa	48(%ebp),%xmm7
+	movdqa	%xmm4,32(%esp)
+	paddd	%xmm2,%xmm6
+	movdqa	%xmm5,48(%esp)
+	paddd	%xmm3,%xmm7
+	movdqa	%xmm6,64(%esp)
+	movdqa	%xmm7,80(%esp)
+	jmp	.L012ssse3_00_47
+.align	16
+.L012ssse3_00_47:
+	addl	$64,%ebp
+	movl	%edx,%ecx
+	movdqa	%xmm1,%xmm4
+	rorl	$14,%edx
+	movl	20(%esp),%esi
+	movdqa	%xmm3,%xmm7
+	xorl	%ecx,%edx
+	movl	24(%esp),%edi
+.byte	102,15,58,15,224,4
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+.byte	102,15,58,15,250,4
+	movl	%ecx,16(%esp)
+	xorl	%ecx,%edx
+	xorl	%esi,%edi
+	movdqa	%xmm4,%xmm5
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	movdqa	%xmm4,%xmm6
+	addl	%edi,%edx
+	movl	4(%esp),%edi
+	psrld	$3,%xmm4
+	movl	%eax,%esi
+	rorl	$9,%ecx
+	paddd	%xmm7,%xmm0
+	movl	%eax,(%esp)
+	xorl	%eax,%ecx
+	psrld	$7,%xmm6
+	xorl	%edi,%eax
+	addl	28(%esp),%edx
+	rorl	$11,%ecx
+	andl	%eax,%ebx
+	pshufd	$250,%xmm3,%xmm7
+	xorl	%esi,%ecx
+	addl	32(%esp),%edx
+	pslld	$14,%xmm5
+	xorl	%edi,%ebx
+	rorl	$2,%ecx
+	pxor	%xmm6,%xmm4
+	addl	%edx,%ebx
+	addl	12(%esp),%edx
+	psrld	$11,%xmm6
+	addl	%ecx,%ebx
+	movl	%edx,%ecx
+	rorl	$14,%edx
+	pxor	%xmm5,%xmm4
+	movl	16(%esp),%esi
+	xorl	%ecx,%edx
+	pslld	$11,%xmm5
+	movl	20(%esp),%edi
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	pxor	%xmm6,%xmm4
+	andl	%ecx,%esi
+	movl	%ecx,12(%esp)
+	movdqa	%xmm7,%xmm6
+	xorl	%ecx,%edx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	pxor	%xmm5,%xmm4
+	movl	%ebx,%ecx
+	addl	%edi,%edx
+	psrld	$10,%xmm7
+	movl	(%esp),%edi
+	movl	%ebx,%esi
+	rorl	$9,%ecx
+	paddd	%xmm4,%xmm0
+	movl	%ebx,28(%esp)
+	xorl	%ebx,%ecx
+	psrlq	$17,%xmm6
+	xorl	%edi,%ebx
+	addl	24(%esp),%edx
+	rorl	$11,%ecx
+	pxor	%xmm6,%xmm7
+	andl	%ebx,%eax
+	xorl	%esi,%ecx
+	psrlq	$2,%xmm6
+	addl	36(%esp),%edx
+	xorl	%edi,%eax
+	rorl	$2,%ecx
+	pxor	%xmm6,%xmm7
+	addl	%edx,%eax
+	addl	8(%esp),%edx
+	pshufd	$128,%xmm7,%xmm7
+	addl	%ecx,%eax
+	movl	%edx,%ecx
+	rorl	$14,%edx
+	movl	12(%esp),%esi
+	xorl	%ecx,%edx
+	movl	16(%esp),%edi
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	psrldq	$8,%xmm7
+	movl	%ecx,8(%esp)
+	xorl	%ecx,%edx
+	xorl	%esi,%edi
+	paddd	%xmm7,%xmm0
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%edx
+	movl	28(%esp),%edi
+	movl	%eax,%esi
+	rorl	$9,%ecx
+	movl	%eax,24(%esp)
+	pshufd	$80,%xmm0,%xmm7
+	xorl	%eax,%ecx
+	xorl	%edi,%eax
+	addl	20(%esp),%edx
+	movdqa	%xmm7,%xmm6
+	rorl	$11,%ecx
+	psrld	$10,%xmm7
+	andl	%eax,%ebx
+	psrlq	$17,%xmm6
+	xorl	%esi,%ecx
+	addl	40(%esp),%edx
+	xorl	%edi,%ebx
+	rorl	$2,%ecx
+	pxor	%xmm6,%xmm7
+	addl	%edx,%ebx
+	addl	4(%esp),%edx
+	psrlq	$2,%xmm6
+	addl	%ecx,%ebx
+	movl	%edx,%ecx
+	rorl	$14,%edx
+	pxor	%xmm6,%xmm7
+	movl	8(%esp),%esi
+	xorl	%ecx,%edx
+	movl	12(%esp),%edi
+	pshufd	$8,%xmm7,%xmm7
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	movdqa	(%ebp),%xmm6
+	andl	%ecx,%esi
+	movl	%ecx,4(%esp)
+	pslldq	$8,%xmm7
+	xorl	%ecx,%edx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%ebx,%ecx
+	addl	%edi,%edx
+	movl	24(%esp),%edi
+	movl	%ebx,%esi
+	rorl	$9,%ecx
+	paddd	%xmm7,%xmm0
+	movl	%ebx,20(%esp)
+	xorl	%ebx,%ecx
+	xorl	%edi,%ebx
+	addl	16(%esp),%edx
+	paddd	%xmm0,%xmm6
+	rorl	$11,%ecx
+	andl	%ebx,%eax
+	xorl	%esi,%ecx
+	addl	44(%esp),%edx
+	xorl	%edi,%eax
+	rorl	$2,%ecx
+	addl	%edx,%eax
+	addl	(%esp),%edx
+	addl	%ecx,%eax
+	movdqa	%xmm6,32(%esp)
+	movl	%edx,%ecx
+	movdqa	%xmm2,%xmm4
+	rorl	$14,%edx
+	movl	4(%esp),%esi
+	movdqa	%xmm0,%xmm7
+	xorl	%ecx,%edx
+	movl	8(%esp),%edi
+.byte	102,15,58,15,225,4
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+.byte	102,15,58,15,251,4
+	movl	%ecx,(%esp)
+	xorl	%ecx,%edx
+	xorl	%esi,%edi
+	movdqa	%xmm4,%xmm5
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	movdqa	%xmm4,%xmm6
+	addl	%edi,%edx
+	movl	20(%esp),%edi
+	psrld	$3,%xmm4
+	movl	%eax,%esi
+	rorl	$9,%ecx
+	paddd	%xmm7,%xmm1
+	movl	%eax,16(%esp)
+	xorl	%eax,%ecx
+	psrld	$7,%xmm6
+	xorl	%edi,%eax
+	addl	12(%esp),%edx
+	rorl	$11,%ecx
+	andl	%eax,%ebx
+	pshufd	$250,%xmm0,%xmm7
+	xorl	%esi,%ecx
+	addl	48(%esp),%edx
+	pslld	$14,%xmm5
+	xorl	%edi,%ebx
+	rorl	$2,%ecx
+	pxor	%xmm6,%xmm4
+	addl	%edx,%ebx
+	addl	28(%esp),%edx
+	psrld	$11,%xmm6
+	addl	%ecx,%ebx
+	movl	%edx,%ecx
+	rorl	$14,%edx
+	pxor	%xmm5,%xmm4
+	movl	(%esp),%esi
+	xorl	%ecx,%edx
+	pslld	$11,%xmm5
+	movl	4(%esp),%edi
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	pxor	%xmm6,%xmm4
+	andl	%ecx,%esi
+	movl	%ecx,28(%esp)
+	movdqa	%xmm7,%xmm6
+	xorl	%ecx,%edx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	pxor	%xmm5,%xmm4
+	movl	%ebx,%ecx
+	addl	%edi,%edx
+	psrld	$10,%xmm7
+	movl	16(%esp),%edi
+	movl	%ebx,%esi
+	rorl	$9,%ecx
+	paddd	%xmm4,%xmm1
+	movl	%ebx,12(%esp)
+	xorl	%ebx,%ecx
+	psrlq	$17,%xmm6
+	xorl	%edi,%ebx
+	addl	8(%esp),%edx
+	rorl	$11,%ecx
+	pxor	%xmm6,%xmm7
+	andl	%ebx,%eax
+	xorl	%esi,%ecx
+	psrlq	$2,%xmm6
+	addl	52(%esp),%edx
+	xorl	%edi,%eax
+	rorl	$2,%ecx
+	pxor	%xmm6,%xmm7
+	addl	%edx,%eax
+	addl	24(%esp),%edx
+	pshufd	$128,%xmm7,%xmm7
+	addl	%ecx,%eax
+	movl	%edx,%ecx
+	rorl	$14,%edx
+	movl	28(%esp),%esi
+	xorl	%ecx,%edx
+	movl	(%esp),%edi
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	psrldq	$8,%xmm7
+	movl	%ecx,24(%esp)
+	xorl	%ecx,%edx
+	xorl	%esi,%edi
+	paddd	%xmm7,%xmm1
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%edx
+	movl	12(%esp),%edi
+	movl	%eax,%esi
+	rorl	$9,%ecx
+	movl	%eax,8(%esp)
+	pshufd	$80,%xmm1,%xmm7
+	xorl	%eax,%ecx
+	xorl	%edi,%eax
+	addl	4(%esp),%edx
+	movdqa	%xmm7,%xmm6
+	rorl	$11,%ecx
+	psrld	$10,%xmm7
+	andl	%eax,%ebx
+	psrlq	$17,%xmm6
+	xorl	%esi,%ecx
+	addl	56(%esp),%edx
+	xorl	%edi,%ebx
+	rorl	$2,%ecx
+	pxor	%xmm6,%xmm7
+	addl	%edx,%ebx
+	addl	20(%esp),%edx
+	psrlq	$2,%xmm6
+	addl	%ecx,%ebx
+	movl	%edx,%ecx
+	rorl	$14,%edx
+	pxor	%xmm6,%xmm7
+	movl	24(%esp),%esi
+	xorl	%ecx,%edx
+	movl	28(%esp),%edi
+	pshufd	$8,%xmm7,%xmm7
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	movdqa	16(%ebp),%xmm6
+	andl	%ecx,%esi
+	movl	%ecx,20(%esp)
+	pslldq	$8,%xmm7
+	xorl	%ecx,%edx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%ebx,%ecx
+	addl	%edi,%edx
+	movl	8(%esp),%edi
+	movl	%ebx,%esi
+	rorl	$9,%ecx
+	paddd	%xmm7,%xmm1
+	movl	%ebx,4(%esp)
+	xorl	%ebx,%ecx
+	xorl	%edi,%ebx
+	addl	(%esp),%edx
+	paddd	%xmm1,%xmm6
+	rorl	$11,%ecx
+	andl	%ebx,%eax
+	xorl	%esi,%ecx
+	addl	60(%esp),%edx
+	xorl	%edi,%eax
+	rorl	$2,%ecx
+	addl	%edx,%eax
+	addl	16(%esp),%edx
+	addl	%ecx,%eax
+	movdqa	%xmm6,48(%esp)
+	movl	%edx,%ecx
+	movdqa	%xmm3,%xmm4
+	rorl	$14,%edx
+	movl	20(%esp),%esi
+	movdqa	%xmm1,%xmm7
+	xorl	%ecx,%edx
+	movl	24(%esp),%edi
+.byte	102,15,58,15,226,4
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+.byte	102,15,58,15,248,4
+	movl	%ecx,16(%esp)
+	xorl	%ecx,%edx
+	xorl	%esi,%edi
+	movdqa	%xmm4,%xmm5
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	movdqa	%xmm4,%xmm6
+	addl	%edi,%edx
+	movl	4(%esp),%edi
+	psrld	$3,%xmm4
+	movl	%eax,%esi
+	rorl	$9,%ecx
+	paddd	%xmm7,%xmm2
+	movl	%eax,(%esp)
+	xorl	%eax,%ecx
+	psrld	$7,%xmm6
+	xorl	%edi,%eax
+	addl	28(%esp),%edx
+	rorl	$11,%ecx
+	andl	%eax,%ebx
+	pshufd	$250,%xmm1,%xmm7
+	xorl	%esi,%ecx
+	addl	64(%esp),%edx
+	pslld	$14,%xmm5
+	xorl	%edi,%ebx
+	rorl	$2,%ecx
+	pxor	%xmm6,%xmm4
+	addl	%edx,%ebx
+	addl	12(%esp),%edx
+	psrld	$11,%xmm6
+	addl	%ecx,%ebx
+	movl	%edx,%ecx
+	rorl	$14,%edx
+	pxor	%xmm5,%xmm4
+	movl	16(%esp),%esi
+	xorl	%ecx,%edx
+	pslld	$11,%xmm5
+	movl	20(%esp),%edi
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	pxor	%xmm6,%xmm4
+	andl	%ecx,%esi
+	movl	%ecx,12(%esp)
+	movdqa	%xmm7,%xmm6
+	xorl	%ecx,%edx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	pxor	%xmm5,%xmm4
+	movl	%ebx,%ecx
+	addl	%edi,%edx
+	psrld	$10,%xmm7
+	movl	(%esp),%edi
+	movl	%ebx,%esi
+	rorl	$9,%ecx
+	paddd	%xmm4,%xmm2
+	movl	%ebx,28(%esp)
+	xorl	%ebx,%ecx
+	psrlq	$17,%xmm6
+	xorl	%edi,%ebx
+	addl	24(%esp),%edx
+	rorl	$11,%ecx
+	pxor	%xmm6,%xmm7
+	andl	%ebx,%eax
+	xorl	%esi,%ecx
+	psrlq	$2,%xmm6
+	addl	68(%esp),%edx
+	xorl	%edi,%eax
+	rorl	$2,%ecx
+	pxor	%xmm6,%xmm7
+	addl	%edx,%eax
+	addl	8(%esp),%edx
+	pshufd	$128,%xmm7,%xmm7
+	addl	%ecx,%eax
+	movl	%edx,%ecx
+	rorl	$14,%edx
+	movl	12(%esp),%esi
+	xorl	%ecx,%edx
+	movl	16(%esp),%edi
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	psrldq	$8,%xmm7
+	movl	%ecx,8(%esp)
+	xorl	%ecx,%edx
+	xorl	%esi,%edi
+	paddd	%xmm7,%xmm2
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%edx
+	movl	28(%esp),%edi
+	movl	%eax,%esi
+	rorl	$9,%ecx
+	movl	%eax,24(%esp)
+	pshufd	$80,%xmm2,%xmm7
+	xorl	%eax,%ecx
+	xorl	%edi,%eax
+	addl	20(%esp),%edx
+	movdqa	%xmm7,%xmm6
+	rorl	$11,%ecx
+	psrld	$10,%xmm7
+	andl	%eax,%ebx
+	psrlq	$17,%xmm6
+	xorl	%esi,%ecx
+	addl	72(%esp),%edx
+	xorl	%edi,%ebx
+	rorl	$2,%ecx
+	pxor	%xmm6,%xmm7
+	addl	%edx,%ebx
+	addl	4(%esp),%edx
+	psrlq	$2,%xmm6
+	addl	%ecx,%ebx
+	movl	%edx,%ecx
+	rorl	$14,%edx
+	pxor	%xmm6,%xmm7
+	movl	8(%esp),%esi
+	xorl	%ecx,%edx
+	movl	12(%esp),%edi
+	pshufd	$8,%xmm7,%xmm7
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	movdqa	32(%ebp),%xmm6
+	andl	%ecx,%esi
+	movl	%ecx,4(%esp)
+	pslldq	$8,%xmm7
+	xorl	%ecx,%edx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%ebx,%ecx
+	addl	%edi,%edx
+	movl	24(%esp),%edi
+	movl	%ebx,%esi
+	rorl	$9,%ecx
+	paddd	%xmm7,%xmm2
+	movl	%ebx,20(%esp)
+	xorl	%ebx,%ecx
+	xorl	%edi,%ebx
+	addl	16(%esp),%edx
+	paddd	%xmm2,%xmm6
+	rorl	$11,%ecx
+	andl	%ebx,%eax
+	xorl	%esi,%ecx
+	addl	76(%esp),%edx
+	xorl	%edi,%eax
+	rorl	$2,%ecx
+	addl	%edx,%eax
+	addl	(%esp),%edx
+	addl	%ecx,%eax
+	movdqa	%xmm6,64(%esp)
+	movl	%edx,%ecx
+	movdqa	%xmm0,%xmm4
+	rorl	$14,%edx
+	movl	4(%esp),%esi
+	movdqa	%xmm2,%xmm7
+	xorl	%ecx,%edx
+	movl	8(%esp),%edi
+.byte	102,15,58,15,227,4
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+.byte	102,15,58,15,249,4
+	movl	%ecx,(%esp)
+	xorl	%ecx,%edx
+	xorl	%esi,%edi
+	movdqa	%xmm4,%xmm5
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	movdqa	%xmm4,%xmm6
+	addl	%edi,%edx
+	movl	20(%esp),%edi
+	psrld	$3,%xmm4
+	movl	%eax,%esi
+	rorl	$9,%ecx
+	paddd	%xmm7,%xmm3
+	movl	%eax,16(%esp)
+	xorl	%eax,%ecx
+	psrld	$7,%xmm6
+	xorl	%edi,%eax
+	addl	12(%esp),%edx
+	rorl	$11,%ecx
+	andl	%eax,%ebx
+	pshufd	$250,%xmm2,%xmm7
+	xorl	%esi,%ecx
+	addl	80(%esp),%edx
+	pslld	$14,%xmm5
+	xorl	%edi,%ebx
+	rorl	$2,%ecx
+	pxor	%xmm6,%xmm4
+	addl	%edx,%ebx
+	addl	28(%esp),%edx
+	psrld	$11,%xmm6
+	addl	%ecx,%ebx
+	movl	%edx,%ecx
+	rorl	$14,%edx
+	pxor	%xmm5,%xmm4
+	movl	(%esp),%esi
+	xorl	%ecx,%edx
+	pslld	$11,%xmm5
+	movl	4(%esp),%edi
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	pxor	%xmm6,%xmm4
+	andl	%ecx,%esi
+	movl	%ecx,28(%esp)
+	movdqa	%xmm7,%xmm6
+	xorl	%ecx,%edx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	pxor	%xmm5,%xmm4
+	movl	%ebx,%ecx
+	addl	%edi,%edx
+	psrld	$10,%xmm7
+	movl	16(%esp),%edi
+	movl	%ebx,%esi
+	rorl	$9,%ecx
+	paddd	%xmm4,%xmm3
+	movl	%ebx,12(%esp)
+	xorl	%ebx,%ecx
+	psrlq	$17,%xmm6
+	xorl	%edi,%ebx
+	addl	8(%esp),%edx
+	rorl	$11,%ecx
+	pxor	%xmm6,%xmm7
+	andl	%ebx,%eax
+	xorl	%esi,%ecx
+	psrlq	$2,%xmm6
+	addl	84(%esp),%edx
+	xorl	%edi,%eax
+	rorl	$2,%ecx
+	pxor	%xmm6,%xmm7
+	addl	%edx,%eax
+	addl	24(%esp),%edx
+	pshufd	$128,%xmm7,%xmm7
+	addl	%ecx,%eax
+	movl	%edx,%ecx
+	rorl	$14,%edx
+	movl	28(%esp),%esi
+	xorl	%ecx,%edx
+	movl	(%esp),%edi
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	psrldq	$8,%xmm7
+	movl	%ecx,24(%esp)
+	xorl	%ecx,%edx
+	xorl	%esi,%edi
+	paddd	%xmm7,%xmm3
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%edx
+	movl	12(%esp),%edi
+	movl	%eax,%esi
+	rorl	$9,%ecx
+	movl	%eax,8(%esp)
+	pshufd	$80,%xmm3,%xmm7
+	xorl	%eax,%ecx
+	xorl	%edi,%eax
+	addl	4(%esp),%edx
+	movdqa	%xmm7,%xmm6
+	rorl	$11,%ecx
+	psrld	$10,%xmm7
+	andl	%eax,%ebx
+	psrlq	$17,%xmm6
+	xorl	%esi,%ecx
+	addl	88(%esp),%edx
+	xorl	%edi,%ebx
+	rorl	$2,%ecx
+	pxor	%xmm6,%xmm7
+	addl	%edx,%ebx
+	addl	20(%esp),%edx
+	psrlq	$2,%xmm6
+	addl	%ecx,%ebx
+	movl	%edx,%ecx
+	rorl	$14,%edx
+	pxor	%xmm6,%xmm7
+	movl	24(%esp),%esi
+	xorl	%ecx,%edx
+	movl	28(%esp),%edi
+	pshufd	$8,%xmm7,%xmm7
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	movdqa	48(%ebp),%xmm6
+	andl	%ecx,%esi
+	movl	%ecx,20(%esp)
+	pslldq	$8,%xmm7
+	xorl	%ecx,%edx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%ebx,%ecx
+	addl	%edi,%edx
+	movl	8(%esp),%edi
+	movl	%ebx,%esi
+	rorl	$9,%ecx
+	paddd	%xmm7,%xmm3
+	movl	%ebx,4(%esp)
+	xorl	%ebx,%ecx
+	xorl	%edi,%ebx
+	addl	(%esp),%edx
+	paddd	%xmm3,%xmm6
+	rorl	$11,%ecx
+	andl	%ebx,%eax
+	xorl	%esi,%ecx
+	addl	92(%esp),%edx
+	xorl	%edi,%eax
+	rorl	$2,%ecx
+	addl	%edx,%eax
+	addl	16(%esp),%edx
+	addl	%ecx,%eax
+	movdqa	%xmm6,80(%esp)
+	cmpl	$66051,64(%ebp)
+	jne	.L012ssse3_00_47
+	movl	%edx,%ecx
+	rorl	$14,%edx
+	movl	20(%esp),%esi
+	xorl	%ecx,%edx
+	movl	24(%esp),%edi
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,16(%esp)
+	xorl	%ecx,%edx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%edx
+	movl	4(%esp),%edi
+	movl	%eax,%esi
+	rorl	$9,%ecx
+	movl	%eax,(%esp)
+	xorl	%eax,%ecx
+	xorl	%edi,%eax
+	addl	28(%esp),%edx
+	rorl	$11,%ecx
+	andl	%eax,%ebx
+	xorl	%esi,%ecx
+	addl	32(%esp),%edx
+	xorl	%edi,%ebx
+	rorl	$2,%ecx
+	addl	%edx,%ebx
+	addl	12(%esp),%edx
+	addl	%ecx,%ebx
+	movl	%edx,%ecx
+	rorl	$14,%edx
+	movl	16(%esp),%esi
+	xorl	%ecx,%edx
+	movl	20(%esp),%edi
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,12(%esp)
+	xorl	%ecx,%edx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%ebx,%ecx
+	addl	%edi,%edx
+	movl	(%esp),%edi
+	movl	%ebx,%esi
+	rorl	$9,%ecx
+	movl	%ebx,28(%esp)
+	xorl	%ebx,%ecx
+	xorl	%edi,%ebx
+	addl	24(%esp),%edx
+	rorl	$11,%ecx
+	andl	%ebx,%eax
+	xorl	%esi,%ecx
+	addl	36(%esp),%edx
+	xorl	%edi,%eax
+	rorl	$2,%ecx
+	addl	%edx,%eax
+	addl	8(%esp),%edx
+	addl	%ecx,%eax
+	movl	%edx,%ecx
+	rorl	$14,%edx
+	movl	12(%esp),%esi
+	xorl	%ecx,%edx
+	movl	16(%esp),%edi
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,8(%esp)
+	xorl	%ecx,%edx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%edx
+	movl	28(%esp),%edi
+	movl	%eax,%esi
+	rorl	$9,%ecx
+	movl	%eax,24(%esp)
+	xorl	%eax,%ecx
+	xorl	%edi,%eax
+	addl	20(%esp),%edx
+	rorl	$11,%ecx
+	andl	%eax,%ebx
+	xorl	%esi,%ecx
+	addl	40(%esp),%edx
+	xorl	%edi,%ebx
+	rorl	$2,%ecx
+	addl	%edx,%ebx
+	addl	4(%esp),%edx
+	addl	%ecx,%ebx
+	movl	%edx,%ecx
+	rorl	$14,%edx
+	movl	8(%esp),%esi
+	xorl	%ecx,%edx
+	movl	12(%esp),%edi
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,4(%esp)
+	xorl	%ecx,%edx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%ebx,%ecx
+	addl	%edi,%edx
+	movl	24(%esp),%edi
+	movl	%ebx,%esi
+	rorl	$9,%ecx
+	movl	%ebx,20(%esp)
+	xorl	%ebx,%ecx
+	xorl	%edi,%ebx
+	addl	16(%esp),%edx
+	rorl	$11,%ecx
+	andl	%ebx,%eax
+	xorl	%esi,%ecx
+	addl	44(%esp),%edx
+	xorl	%edi,%eax
+	rorl	$2,%ecx
+	addl	%edx,%eax
+	addl	(%esp),%edx
+	addl	%ecx,%eax
+	movl	%edx,%ecx
+	rorl	$14,%edx
+	movl	4(%esp),%esi
+	xorl	%ecx,%edx
+	movl	8(%esp),%edi
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,(%esp)
+	xorl	%ecx,%edx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%edx
+	movl	20(%esp),%edi
+	movl	%eax,%esi
+	rorl	$9,%ecx
+	movl	%eax,16(%esp)
+	xorl	%eax,%ecx
+	xorl	%edi,%eax
+	addl	12(%esp),%edx
+	rorl	$11,%ecx
+	andl	%eax,%ebx
+	xorl	%esi,%ecx
+	addl	48(%esp),%edx
+	xorl	%edi,%ebx
+	rorl	$2,%ecx
+	addl	%edx,%ebx
+	addl	28(%esp),%edx
+	addl	%ecx,%ebx
+	movl	%edx,%ecx
+	rorl	$14,%edx
+	movl	(%esp),%esi
+	xorl	%ecx,%edx
+	movl	4(%esp),%edi
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,28(%esp)
+	xorl	%ecx,%edx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%ebx,%ecx
+	addl	%edi,%edx
+	movl	16(%esp),%edi
+	movl	%ebx,%esi
+	rorl	$9,%ecx
+	movl	%ebx,12(%esp)
+	xorl	%ebx,%ecx
+	xorl	%edi,%ebx
+	addl	8(%esp),%edx
+	rorl	$11,%ecx
+	andl	%ebx,%eax
+	xorl	%esi,%ecx
+	addl	52(%esp),%edx
+	xorl	%edi,%eax
+	rorl	$2,%ecx
+	addl	%edx,%eax
+	addl	24(%esp),%edx
+	addl	%ecx,%eax
+	movl	%edx,%ecx
+	rorl	$14,%edx
+	movl	28(%esp),%esi
+	xorl	%ecx,%edx
+	movl	(%esp),%edi
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,24(%esp)
+	xorl	%ecx,%edx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%edx
+	movl	12(%esp),%edi
+	movl	%eax,%esi
+	rorl	$9,%ecx
+	movl	%eax,8(%esp)
+	xorl	%eax,%ecx
+	xorl	%edi,%eax
+	addl	4(%esp),%edx
+	rorl	$11,%ecx
+	andl	%eax,%ebx
+	xorl	%esi,%ecx
+	addl	56(%esp),%edx
+	xorl	%edi,%ebx
+	rorl	$2,%ecx
+	addl	%edx,%ebx
+	addl	20(%esp),%edx
+	addl	%ecx,%ebx
+	movl	%edx,%ecx
+	rorl	$14,%edx
+	movl	24(%esp),%esi
+	xorl	%ecx,%edx
+	movl	28(%esp),%edi
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,20(%esp)
+	xorl	%ecx,%edx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%ebx,%ecx
+	addl	%edi,%edx
+	movl	8(%esp),%edi
+	movl	%ebx,%esi
+	rorl	$9,%ecx
+	movl	%ebx,4(%esp)
+	xorl	%ebx,%ecx
+	xorl	%edi,%ebx
+	addl	(%esp),%edx
+	rorl	$11,%ecx
+	andl	%ebx,%eax
+	xorl	%esi,%ecx
+	addl	60(%esp),%edx
+	xorl	%edi,%eax
+	rorl	$2,%ecx
+	addl	%edx,%eax
+	addl	16(%esp),%edx
+	addl	%ecx,%eax
+	movl	%edx,%ecx
+	rorl	$14,%edx
+	movl	20(%esp),%esi
+	xorl	%ecx,%edx
+	movl	24(%esp),%edi
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,16(%esp)
+	xorl	%ecx,%edx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%edx
+	movl	4(%esp),%edi
+	movl	%eax,%esi
+	rorl	$9,%ecx
+	movl	%eax,(%esp)
+	xorl	%eax,%ecx
+	xorl	%edi,%eax
+	addl	28(%esp),%edx
+	rorl	$11,%ecx
+	andl	%eax,%ebx
+	xorl	%esi,%ecx
+	addl	64(%esp),%edx
+	xorl	%edi,%ebx
+	rorl	$2,%ecx
+	addl	%edx,%ebx
+	addl	12(%esp),%edx
+	addl	%ecx,%ebx
+	movl	%edx,%ecx
+	rorl	$14,%edx
+	movl	16(%esp),%esi
+	xorl	%ecx,%edx
+	movl	20(%esp),%edi
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,12(%esp)
+	xorl	%ecx,%edx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%ebx,%ecx
+	addl	%edi,%edx
+	movl	(%esp),%edi
+	movl	%ebx,%esi
+	rorl	$9,%ecx
+	movl	%ebx,28(%esp)
+	xorl	%ebx,%ecx
+	xorl	%edi,%ebx
+	addl	24(%esp),%edx
+	rorl	$11,%ecx
+	andl	%ebx,%eax
+	xorl	%esi,%ecx
+	addl	68(%esp),%edx
+	xorl	%edi,%eax
+	rorl	$2,%ecx
+	addl	%edx,%eax
+	addl	8(%esp),%edx
+	addl	%ecx,%eax
+	movl	%edx,%ecx
+	rorl	$14,%edx
+	movl	12(%esp),%esi
+	xorl	%ecx,%edx
+	movl	16(%esp),%edi
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,8(%esp)
+	xorl	%ecx,%edx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%edx
+	movl	28(%esp),%edi
+	movl	%eax,%esi
+	rorl	$9,%ecx
+	movl	%eax,24(%esp)
+	xorl	%eax,%ecx
+	xorl	%edi,%eax
+	addl	20(%esp),%edx
+	rorl	$11,%ecx
+	andl	%eax,%ebx
+	xorl	%esi,%ecx
+	addl	72(%esp),%edx
+	xorl	%edi,%ebx
+	rorl	$2,%ecx
+	addl	%edx,%ebx
+	addl	4(%esp),%edx
+	addl	%ecx,%ebx
+	movl	%edx,%ecx
+	rorl	$14,%edx
+	movl	8(%esp),%esi
+	xorl	%ecx,%edx
+	movl	12(%esp),%edi
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,4(%esp)
+	xorl	%ecx,%edx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%ebx,%ecx
+	addl	%edi,%edx
+	movl	24(%esp),%edi
+	movl	%ebx,%esi
+	rorl	$9,%ecx
+	movl	%ebx,20(%esp)
+	xorl	%ebx,%ecx
+	xorl	%edi,%ebx
+	addl	16(%esp),%edx
+	rorl	$11,%ecx
+	andl	%ebx,%eax
+	xorl	%esi,%ecx
+	addl	76(%esp),%edx
+	xorl	%edi,%eax
+	rorl	$2,%ecx
+	addl	%edx,%eax
+	addl	(%esp),%edx
+	addl	%ecx,%eax
+	movl	%edx,%ecx
+	rorl	$14,%edx
+	movl	4(%esp),%esi
+	xorl	%ecx,%edx
+	movl	8(%esp),%edi
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,(%esp)
+	xorl	%ecx,%edx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%edx
+	movl	20(%esp),%edi
+	movl	%eax,%esi
+	rorl	$9,%ecx
+	movl	%eax,16(%esp)
+	xorl	%eax,%ecx
+	xorl	%edi,%eax
+	addl	12(%esp),%edx
+	rorl	$11,%ecx
+	andl	%eax,%ebx
+	xorl	%esi,%ecx
+	addl	80(%esp),%edx
+	xorl	%edi,%ebx
+	rorl	$2,%ecx
+	addl	%edx,%ebx
+	addl	28(%esp),%edx
+	addl	%ecx,%ebx
+	movl	%edx,%ecx
+	rorl	$14,%edx
+	movl	(%esp),%esi
+	xorl	%ecx,%edx
+	movl	4(%esp),%edi
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,28(%esp)
+	xorl	%ecx,%edx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%ebx,%ecx
+	addl	%edi,%edx
+	movl	16(%esp),%edi
+	movl	%ebx,%esi
+	rorl	$9,%ecx
+	movl	%ebx,12(%esp)
+	xorl	%ebx,%ecx
+	xorl	%edi,%ebx
+	addl	8(%esp),%edx
+	rorl	$11,%ecx
+	andl	%ebx,%eax
+	xorl	%esi,%ecx
+	addl	84(%esp),%edx
+	xorl	%edi,%eax
+	rorl	$2,%ecx
+	addl	%edx,%eax
+	addl	24(%esp),%edx
+	addl	%ecx,%eax
+	movl	%edx,%ecx
+	rorl	$14,%edx
+	movl	28(%esp),%esi
+	xorl	%ecx,%edx
+	movl	(%esp),%edi
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,24(%esp)
+	xorl	%ecx,%edx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%edx
+	movl	12(%esp),%edi
+	movl	%eax,%esi
+	rorl	$9,%ecx
+	movl	%eax,8(%esp)
+	xorl	%eax,%ecx
+	xorl	%edi,%eax
+	addl	4(%esp),%edx
+	rorl	$11,%ecx
+	andl	%eax,%ebx
+	xorl	%esi,%ecx
+	addl	88(%esp),%edx
+	xorl	%edi,%ebx
+	rorl	$2,%ecx
+	addl	%edx,%ebx
+	addl	20(%esp),%edx
+	addl	%ecx,%ebx
+	movl	%edx,%ecx
+	rorl	$14,%edx
+	movl	24(%esp),%esi
+	xorl	%ecx,%edx
+	movl	28(%esp),%edi
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,20(%esp)
+	xorl	%ecx,%edx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%ebx,%ecx
+	addl	%edi,%edx
+	movl	8(%esp),%edi
+	movl	%ebx,%esi
+	rorl	$9,%ecx
+	movl	%ebx,4(%esp)
+	xorl	%ebx,%ecx
+	xorl	%edi,%ebx
+	addl	(%esp),%edx
+	rorl	$11,%ecx
+	andl	%ebx,%eax
+	xorl	%esi,%ecx
+	addl	92(%esp),%edx
+	xorl	%edi,%eax
+	rorl	$2,%ecx
+	addl	%edx,%eax
+	addl	16(%esp),%edx
+	addl	%ecx,%eax
+	movl	96(%esp),%esi
+	xorl	%edi,%ebx
+	movl	12(%esp),%ecx
+	addl	(%esi),%eax
+	addl	4(%esi),%ebx
+	addl	8(%esi),%edi
+	addl	12(%esi),%ecx
+	movl	%eax,(%esi)
+	movl	%ebx,4(%esi)
+	movl	%edi,8(%esi)
+	movl	%ecx,12(%esi)
+	movl	%ebx,4(%esp)
+	xorl	%edi,%ebx
+	movl	%edi,8(%esp)
+	movl	%ecx,12(%esp)
+	movl	20(%esp),%edi
+	movl	24(%esp),%ecx
+	addl	16(%esi),%edx
+	addl	20(%esi),%edi
+	addl	24(%esi),%ecx
+	movl	%edx,16(%esi)
+	movl	%edi,20(%esi)
+	movl	%edi,20(%esp)
+	movl	28(%esp),%edi
+	movl	%ecx,24(%esi)
+	addl	28(%esi),%edi
+	movl	%ecx,24(%esp)
+	movl	%edi,28(%esi)
+	movl	%edi,28(%esp)
+	movl	100(%esp),%edi
+	movdqa	64(%ebp),%xmm7
+	subl	$192,%ebp
+	cmpl	104(%esp),%edi
+	jb	.L011grand_ssse3
+	movl	108(%esp),%esp
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.size	sha256_block_data_order,.-.L_sha256_block_data_order_begin
+#endif
diff --git a/third_party/boringssl/linux-x86/crypto/sha/sha512-586.S b/third_party/boringssl/linux-x86/crypto/sha/sha512-586.S
new file mode 100644
index 0000000..a928400
--- /dev/null
+++ b/third_party/boringssl/linux-x86/crypto/sha/sha512-586.S
@@ -0,0 +1,2831 @@
+#if defined(__i386__)
+.file	"sha512-586.S"
+.text
+.globl	sha512_block_data_order
+.hidden	sha512_block_data_order
+.type	sha512_block_data_order,@function
+.align	16
+sha512_block_data_order:
+.L_sha512_block_data_order_begin:
+	pushl	%ebp
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+	movl	20(%esp),%esi
+	movl	24(%esp),%edi
+	movl	28(%esp),%eax
+	movl	%esp,%ebx
+	call	.L000pic_point
+.L000pic_point:
+	popl	%ebp
+	leal	.L001K512-.L000pic_point(%ebp),%ebp
+	subl	$16,%esp
+	andl	$-64,%esp
+	shll	$7,%eax
+	addl	%edi,%eax
+	movl	%esi,(%esp)
+	movl	%edi,4(%esp)
+	movl	%eax,8(%esp)
+	movl	%ebx,12(%esp)
+	leal	OPENSSL_ia32cap_P-.L001K512(%ebp),%edx
+	movl	(%edx),%ecx
+	testl	$67108864,%ecx
+	jz	.L002loop_x86
+	movl	4(%edx),%edx
+	movq	(%esi),%mm0
+	andl	$16777216,%ecx
+	movq	8(%esi),%mm1
+	andl	$512,%edx
+	movq	16(%esi),%mm2
+	orl	%edx,%ecx
+	movq	24(%esi),%mm3
+	movq	32(%esi),%mm4
+	movq	40(%esi),%mm5
+	movq	48(%esi),%mm6
+	movq	56(%esi),%mm7
+	cmpl	$16777728,%ecx
+	je	.L003SSSE3
+	subl	$80,%esp
+	jmp	.L004loop_sse2
+.align	16
+.L004loop_sse2:
+	movq	%mm1,8(%esp)
+	movq	%mm2,16(%esp)
+	movq	%mm3,24(%esp)
+	movq	%mm5,40(%esp)
+	movq	%mm6,48(%esp)
+	pxor	%mm1,%mm2
+	movq	%mm7,56(%esp)
+	movq	%mm0,%mm3
+	movl	(%edi),%eax
+	movl	4(%edi),%ebx
+	addl	$8,%edi
+	movl	$15,%edx
+	bswap	%eax
+	bswap	%ebx
+	jmp	.L00500_14_sse2
+.align	16
+.L00500_14_sse2:
+	movd	%eax,%mm1
+	movl	(%edi),%eax
+	movd	%ebx,%mm7
+	movl	4(%edi),%ebx
+	addl	$8,%edi
+	bswap	%eax
+	bswap	%ebx
+	punpckldq	%mm1,%mm7
+	movq	%mm4,%mm1
+	pxor	%mm6,%mm5
+	psrlq	$14,%mm1
+	movq	%mm4,32(%esp)
+	pand	%mm4,%mm5
+	psllq	$23,%mm4
+	movq	%mm3,%mm0
+	movq	%mm7,72(%esp)
+	movq	%mm1,%mm3
+	psrlq	$4,%mm1
+	pxor	%mm6,%mm5
+	pxor	%mm4,%mm3
+	psllq	$23,%mm4
+	pxor	%mm1,%mm3
+	movq	%mm0,(%esp)
+	paddq	%mm5,%mm7
+	pxor	%mm4,%mm3
+	psrlq	$23,%mm1
+	paddq	56(%esp),%mm7
+	pxor	%mm1,%mm3
+	psllq	$4,%mm4
+	paddq	(%ebp),%mm7
+	pxor	%mm4,%mm3
+	movq	24(%esp),%mm4
+	paddq	%mm7,%mm3
+	movq	%mm0,%mm5
+	psrlq	$28,%mm5
+	paddq	%mm3,%mm4
+	movq	%mm0,%mm6
+	movq	%mm5,%mm7
+	psllq	$25,%mm6
+	movq	8(%esp),%mm1
+	psrlq	$6,%mm5
+	pxor	%mm6,%mm7
+	subl	$8,%esp
+	psllq	$5,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm0
+	psrlq	$5,%mm5
+	pxor	%mm6,%mm7
+	pand	%mm0,%mm2
+	psllq	$6,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm2
+	pxor	%mm7,%mm6
+	movq	40(%esp),%mm5
+	paddq	%mm2,%mm3
+	movq	%mm0,%mm2
+	addl	$8,%ebp
+	paddq	%mm6,%mm3
+	movq	48(%esp),%mm6
+	decl	%edx
+	jnz	.L00500_14_sse2
+	movd	%eax,%mm1
+	movd	%ebx,%mm7
+	punpckldq	%mm1,%mm7
+	movq	%mm4,%mm1
+	pxor	%mm6,%mm5
+	psrlq	$14,%mm1
+	movq	%mm4,32(%esp)
+	pand	%mm4,%mm5
+	psllq	$23,%mm4
+	movq	%mm3,%mm0
+	movq	%mm7,72(%esp)
+	movq	%mm1,%mm3
+	psrlq	$4,%mm1
+	pxor	%mm6,%mm5
+	pxor	%mm4,%mm3
+	psllq	$23,%mm4
+	pxor	%mm1,%mm3
+	movq	%mm0,(%esp)
+	paddq	%mm5,%mm7
+	pxor	%mm4,%mm3
+	psrlq	$23,%mm1
+	paddq	56(%esp),%mm7
+	pxor	%mm1,%mm3
+	psllq	$4,%mm4
+	paddq	(%ebp),%mm7
+	pxor	%mm4,%mm3
+	movq	24(%esp),%mm4
+	paddq	%mm7,%mm3
+	movq	%mm0,%mm5
+	psrlq	$28,%mm5
+	paddq	%mm3,%mm4
+	movq	%mm0,%mm6
+	movq	%mm5,%mm7
+	psllq	$25,%mm6
+	movq	8(%esp),%mm1
+	psrlq	$6,%mm5
+	pxor	%mm6,%mm7
+	subl	$8,%esp
+	psllq	$5,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm0
+	psrlq	$5,%mm5
+	pxor	%mm6,%mm7
+	pand	%mm0,%mm2
+	psllq	$6,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm2
+	pxor	%mm7,%mm6
+	movq	192(%esp),%mm7
+	paddq	%mm2,%mm3
+	movq	%mm0,%mm2
+	addl	$8,%ebp
+	paddq	%mm6,%mm3
+	pxor	%mm0,%mm0
+	movl	$32,%edx
+	jmp	.L00616_79_sse2
+.align	16
+.L00616_79_sse2:
+	movq	88(%esp),%mm5
+	movq	%mm7,%mm1
+	psrlq	$1,%mm7
+	movq	%mm5,%mm6
+	psrlq	$6,%mm5
+	psllq	$56,%mm1
+	paddq	%mm3,%mm0
+	movq	%mm7,%mm3
+	psrlq	$6,%mm7
+	pxor	%mm1,%mm3
+	psllq	$7,%mm1
+	pxor	%mm7,%mm3
+	psrlq	$1,%mm7
+	pxor	%mm1,%mm3
+	movq	%mm5,%mm1
+	psrlq	$13,%mm5
+	pxor	%mm3,%mm7
+	psllq	$3,%mm6
+	pxor	%mm5,%mm1
+	paddq	200(%esp),%mm7
+	pxor	%mm6,%mm1
+	psrlq	$42,%mm5
+	paddq	128(%esp),%mm7
+	pxor	%mm5,%mm1
+	psllq	$42,%mm6
+	movq	40(%esp),%mm5
+	pxor	%mm6,%mm1
+	movq	48(%esp),%mm6
+	paddq	%mm1,%mm7
+	movq	%mm4,%mm1
+	pxor	%mm6,%mm5
+	psrlq	$14,%mm1
+	movq	%mm4,32(%esp)
+	pand	%mm4,%mm5
+	psllq	$23,%mm4
+	movq	%mm7,72(%esp)
+	movq	%mm1,%mm3
+	psrlq	$4,%mm1
+	pxor	%mm6,%mm5
+	pxor	%mm4,%mm3
+	psllq	$23,%mm4
+	pxor	%mm1,%mm3
+	movq	%mm0,(%esp)
+	paddq	%mm5,%mm7
+	pxor	%mm4,%mm3
+	psrlq	$23,%mm1
+	paddq	56(%esp),%mm7
+	pxor	%mm1,%mm3
+	psllq	$4,%mm4
+	paddq	(%ebp),%mm7
+	pxor	%mm4,%mm3
+	movq	24(%esp),%mm4
+	paddq	%mm7,%mm3
+	movq	%mm0,%mm5
+	psrlq	$28,%mm5
+	paddq	%mm3,%mm4
+	movq	%mm0,%mm6
+	movq	%mm5,%mm7
+	psllq	$25,%mm6
+	movq	8(%esp),%mm1
+	psrlq	$6,%mm5
+	pxor	%mm6,%mm7
+	subl	$8,%esp
+	psllq	$5,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm0
+	psrlq	$5,%mm5
+	pxor	%mm6,%mm7
+	pand	%mm0,%mm2
+	psllq	$6,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm2
+	pxor	%mm7,%mm6
+	movq	192(%esp),%mm7
+	paddq	%mm6,%mm2
+	addl	$8,%ebp
+	movq	88(%esp),%mm5
+	movq	%mm7,%mm1
+	psrlq	$1,%mm7
+	movq	%mm5,%mm6
+	psrlq	$6,%mm5
+	psllq	$56,%mm1
+	paddq	%mm3,%mm2
+	movq	%mm7,%mm3
+	psrlq	$6,%mm7
+	pxor	%mm1,%mm3
+	psllq	$7,%mm1
+	pxor	%mm7,%mm3
+	psrlq	$1,%mm7
+	pxor	%mm1,%mm3
+	movq	%mm5,%mm1
+	psrlq	$13,%mm5
+	pxor	%mm3,%mm7
+	psllq	$3,%mm6
+	pxor	%mm5,%mm1
+	paddq	200(%esp),%mm7
+	pxor	%mm6,%mm1
+	psrlq	$42,%mm5
+	paddq	128(%esp),%mm7
+	pxor	%mm5,%mm1
+	psllq	$42,%mm6
+	movq	40(%esp),%mm5
+	pxor	%mm6,%mm1
+	movq	48(%esp),%mm6
+	paddq	%mm1,%mm7
+	movq	%mm4,%mm1
+	pxor	%mm6,%mm5
+	psrlq	$14,%mm1
+	movq	%mm4,32(%esp)
+	pand	%mm4,%mm5
+	psllq	$23,%mm4
+	movq	%mm7,72(%esp)
+	movq	%mm1,%mm3
+	psrlq	$4,%mm1
+	pxor	%mm6,%mm5
+	pxor	%mm4,%mm3
+	psllq	$23,%mm4
+	pxor	%mm1,%mm3
+	movq	%mm2,(%esp)
+	paddq	%mm5,%mm7
+	pxor	%mm4,%mm3
+	psrlq	$23,%mm1
+	paddq	56(%esp),%mm7
+	pxor	%mm1,%mm3
+	psllq	$4,%mm4
+	paddq	(%ebp),%mm7
+	pxor	%mm4,%mm3
+	movq	24(%esp),%mm4
+	paddq	%mm7,%mm3
+	movq	%mm2,%mm5
+	psrlq	$28,%mm5
+	paddq	%mm3,%mm4
+	movq	%mm2,%mm6
+	movq	%mm5,%mm7
+	psllq	$25,%mm6
+	movq	8(%esp),%mm1
+	psrlq	$6,%mm5
+	pxor	%mm6,%mm7
+	subl	$8,%esp
+	psllq	$5,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm2
+	psrlq	$5,%mm5
+	pxor	%mm6,%mm7
+	pand	%mm2,%mm0
+	psllq	$6,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm0
+	pxor	%mm7,%mm6
+	movq	192(%esp),%mm7
+	paddq	%mm6,%mm0
+	addl	$8,%ebp
+	decl	%edx
+	jnz	.L00616_79_sse2
+	paddq	%mm3,%mm0
+	movq	8(%esp),%mm1
+	movq	24(%esp),%mm3
+	movq	40(%esp),%mm5
+	movq	48(%esp),%mm6
+	movq	56(%esp),%mm7
+	pxor	%mm1,%mm2
+	paddq	(%esi),%mm0
+	paddq	8(%esi),%mm1
+	paddq	16(%esi),%mm2
+	paddq	24(%esi),%mm3
+	paddq	32(%esi),%mm4
+	paddq	40(%esi),%mm5
+	paddq	48(%esi),%mm6
+	paddq	56(%esi),%mm7
+	movl	$640,%eax
+	movq	%mm0,(%esi)
+	movq	%mm1,8(%esi)
+	movq	%mm2,16(%esi)
+	movq	%mm3,24(%esi)
+	movq	%mm4,32(%esi)
+	movq	%mm5,40(%esi)
+	movq	%mm6,48(%esi)
+	movq	%mm7,56(%esi)
+	leal	(%esp,%eax,1),%esp
+	subl	%eax,%ebp
+	cmpl	88(%esp),%edi
+	jb	.L004loop_sse2
+	movl	92(%esp),%esp
+	emms
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.align	32
+.L003SSSE3:
+	leal	-64(%esp),%edx
+	subl	$256,%esp
+	movdqa	640(%ebp),%xmm1
+	movdqu	(%edi),%xmm0
+.byte	102,15,56,0,193
+	movdqa	(%ebp),%xmm3
+	movdqa	%xmm1,%xmm2
+	movdqu	16(%edi),%xmm1
+	paddq	%xmm0,%xmm3
+.byte	102,15,56,0,202
+	movdqa	%xmm3,-128(%edx)
+	movdqa	16(%ebp),%xmm4
+	movdqa	%xmm2,%xmm3
+	movdqu	32(%edi),%xmm2
+	paddq	%xmm1,%xmm4
+.byte	102,15,56,0,211
+	movdqa	%xmm4,-112(%edx)
+	movdqa	32(%ebp),%xmm5
+	movdqa	%xmm3,%xmm4
+	movdqu	48(%edi),%xmm3
+	paddq	%xmm2,%xmm5
+.byte	102,15,56,0,220
+	movdqa	%xmm5,-96(%edx)
+	movdqa	48(%ebp),%xmm6
+	movdqa	%xmm4,%xmm5
+	movdqu	64(%edi),%xmm4
+	paddq	%xmm3,%xmm6
+.byte	102,15,56,0,229
+	movdqa	%xmm6,-80(%edx)
+	movdqa	64(%ebp),%xmm7
+	movdqa	%xmm5,%xmm6
+	movdqu	80(%edi),%xmm5
+	paddq	%xmm4,%xmm7
+.byte	102,15,56,0,238
+	movdqa	%xmm7,-64(%edx)
+	movdqa	%xmm0,(%edx)
+	movdqa	80(%ebp),%xmm0
+	movdqa	%xmm6,%xmm7
+	movdqu	96(%edi),%xmm6
+	paddq	%xmm5,%xmm0
+.byte	102,15,56,0,247
+	movdqa	%xmm0,-48(%edx)
+	movdqa	%xmm1,16(%edx)
+	movdqa	96(%ebp),%xmm1
+	movdqa	%xmm7,%xmm0
+	movdqu	112(%edi),%xmm7
+	paddq	%xmm6,%xmm1
+.byte	102,15,56,0,248
+	movdqa	%xmm1,-32(%edx)
+	movdqa	%xmm2,32(%edx)
+	movdqa	112(%ebp),%xmm2
+	movdqa	(%edx),%xmm0
+	paddq	%xmm7,%xmm2
+	movdqa	%xmm2,-16(%edx)
+	nop
+.align	32
+.L007loop_ssse3:
+	movdqa	16(%edx),%xmm2
+	movdqa	%xmm3,48(%edx)
+	leal	128(%ebp),%ebp
+	movq	%mm1,8(%esp)
+	movl	%edi,%ebx
+	movq	%mm2,16(%esp)
+	leal	128(%edi),%edi
+	movq	%mm3,24(%esp)
+	cmpl	%eax,%edi
+	movq	%mm5,40(%esp)
+	cmovbl	%edi,%ebx
+	movq	%mm6,48(%esp)
+	movl	$4,%ecx
+	pxor	%mm1,%mm2
+	movq	%mm7,56(%esp)
+	pxor	%mm3,%mm3
+	jmp	.L00800_47_ssse3
+.align	32
+.L00800_47_ssse3:
+	movdqa	%xmm5,%xmm3
+	movdqa	%xmm2,%xmm1
+.byte	102,15,58,15,208,8
+	movdqa	%xmm4,(%edx)
+.byte	102,15,58,15,220,8
+	movdqa	%xmm2,%xmm4
+	psrlq	$7,%xmm2
+	paddq	%xmm3,%xmm0
+	movdqa	%xmm4,%xmm3
+	psrlq	$1,%xmm4
+	psllq	$56,%xmm3
+	pxor	%xmm4,%xmm2
+	psrlq	$7,%xmm4
+	pxor	%xmm3,%xmm2
+	psllq	$7,%xmm3
+	pxor	%xmm4,%xmm2
+	movdqa	%xmm7,%xmm4
+	pxor	%xmm3,%xmm2
+	movdqa	%xmm7,%xmm3
+	psrlq	$6,%xmm4
+	paddq	%xmm2,%xmm0
+	movdqa	%xmm7,%xmm2
+	psrlq	$19,%xmm3
+	psllq	$3,%xmm2
+	pxor	%xmm3,%xmm4
+	psrlq	$42,%xmm3
+	pxor	%xmm2,%xmm4
+	psllq	$42,%xmm2
+	pxor	%xmm3,%xmm4
+	movdqa	32(%edx),%xmm3
+	pxor	%xmm2,%xmm4
+	movdqa	(%ebp),%xmm2
+	movq	%mm4,%mm1
+	paddq	%xmm4,%xmm0
+	movq	-128(%edx),%mm7
+	pxor	%mm6,%mm5
+	psrlq	$14,%mm1
+	movq	%mm4,32(%esp)
+	paddq	%xmm0,%xmm2
+	pand	%mm4,%mm5
+	psllq	$23,%mm4
+	paddq	%mm3,%mm0
+	movq	%mm1,%mm3
+	psrlq	$4,%mm1
+	pxor	%mm6,%mm5
+	pxor	%mm4,%mm3
+	psllq	$23,%mm4
+	pxor	%mm1,%mm3
+	movq	%mm0,(%esp)
+	paddq	%mm5,%mm7
+	pxor	%mm4,%mm3
+	psrlq	$23,%mm1
+	paddq	56(%esp),%mm7
+	pxor	%mm1,%mm3
+	psllq	$4,%mm4
+	pxor	%mm4,%mm3
+	movq	24(%esp),%mm4
+	paddq	%mm7,%mm3
+	movq	%mm0,%mm5
+	psrlq	$28,%mm5
+	paddq	%mm3,%mm4
+	movq	%mm0,%mm6
+	movq	%mm5,%mm7
+	psllq	$25,%mm6
+	movq	8(%esp),%mm1
+	psrlq	$6,%mm5
+	pxor	%mm6,%mm7
+	psllq	$5,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm0
+	psrlq	$5,%mm5
+	pxor	%mm6,%mm7
+	pand	%mm0,%mm2
+	psllq	$6,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm2
+	pxor	%mm7,%mm6
+	movq	32(%esp),%mm5
+	paddq	%mm6,%mm2
+	movq	40(%esp),%mm6
+	movq	%mm4,%mm1
+	movq	-120(%edx),%mm7
+	pxor	%mm6,%mm5
+	psrlq	$14,%mm1
+	movq	%mm4,24(%esp)
+	pand	%mm4,%mm5
+	psllq	$23,%mm4
+	paddq	%mm3,%mm2
+	movq	%mm1,%mm3
+	psrlq	$4,%mm1
+	pxor	%mm6,%mm5
+	pxor	%mm4,%mm3
+	psllq	$23,%mm4
+	pxor	%mm1,%mm3
+	movq	%mm2,56(%esp)
+	paddq	%mm5,%mm7
+	pxor	%mm4,%mm3
+	psrlq	$23,%mm1
+	paddq	48(%esp),%mm7
+	pxor	%mm1,%mm3
+	psllq	$4,%mm4
+	pxor	%mm4,%mm3
+	movq	16(%esp),%mm4
+	paddq	%mm7,%mm3
+	movq	%mm2,%mm5
+	psrlq	$28,%mm5
+	paddq	%mm3,%mm4
+	movq	%mm2,%mm6
+	movq	%mm5,%mm7
+	psllq	$25,%mm6
+	movq	(%esp),%mm1
+	psrlq	$6,%mm5
+	pxor	%mm6,%mm7
+	psllq	$5,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm2
+	psrlq	$5,%mm5
+	pxor	%mm6,%mm7
+	pand	%mm2,%mm0
+	psllq	$6,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm0
+	pxor	%mm7,%mm6
+	movq	24(%esp),%mm5
+	paddq	%mm6,%mm0
+	movq	32(%esp),%mm6
+	movdqa	%xmm2,-128(%edx)
+	movdqa	%xmm6,%xmm4
+	movdqa	%xmm3,%xmm2
+.byte	102,15,58,15,217,8
+	movdqa	%xmm5,16(%edx)
+.byte	102,15,58,15,229,8
+	movdqa	%xmm3,%xmm5
+	psrlq	$7,%xmm3
+	paddq	%xmm4,%xmm1
+	movdqa	%xmm5,%xmm4
+	psrlq	$1,%xmm5
+	psllq	$56,%xmm4
+	pxor	%xmm5,%xmm3
+	psrlq	$7,%xmm5
+	pxor	%xmm4,%xmm3
+	psllq	$7,%xmm4
+	pxor	%xmm5,%xmm3
+	movdqa	%xmm0,%xmm5
+	pxor	%xmm4,%xmm3
+	movdqa	%xmm0,%xmm4
+	psrlq	$6,%xmm5
+	paddq	%xmm3,%xmm1
+	movdqa	%xmm0,%xmm3
+	psrlq	$19,%xmm4
+	psllq	$3,%xmm3
+	pxor	%xmm4,%xmm5
+	psrlq	$42,%xmm4
+	pxor	%xmm3,%xmm5
+	psllq	$42,%xmm3
+	pxor	%xmm4,%xmm5
+	movdqa	48(%edx),%xmm4
+	pxor	%xmm3,%xmm5
+	movdqa	16(%ebp),%xmm3
+	movq	%mm4,%mm1
+	paddq	%xmm5,%xmm1
+	movq	-112(%edx),%mm7
+	pxor	%mm6,%mm5
+	psrlq	$14,%mm1
+	movq	%mm4,16(%esp)
+	paddq	%xmm1,%xmm3
+	pand	%mm4,%mm5
+	psllq	$23,%mm4
+	paddq	%mm3,%mm0
+	movq	%mm1,%mm3
+	psrlq	$4,%mm1
+	pxor	%mm6,%mm5
+	pxor	%mm4,%mm3
+	psllq	$23,%mm4
+	pxor	%mm1,%mm3
+	movq	%mm0,48(%esp)
+	paddq	%mm5,%mm7
+	pxor	%mm4,%mm3
+	psrlq	$23,%mm1
+	paddq	40(%esp),%mm7
+	pxor	%mm1,%mm3
+	psllq	$4,%mm4
+	pxor	%mm4,%mm3
+	movq	8(%esp),%mm4
+	paddq	%mm7,%mm3
+	movq	%mm0,%mm5
+	psrlq	$28,%mm5
+	paddq	%mm3,%mm4
+	movq	%mm0,%mm6
+	movq	%mm5,%mm7
+	psllq	$25,%mm6
+	movq	56(%esp),%mm1
+	psrlq	$6,%mm5
+	pxor	%mm6,%mm7
+	psllq	$5,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm0
+	psrlq	$5,%mm5
+	pxor	%mm6,%mm7
+	pand	%mm0,%mm2
+	psllq	$6,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm2
+	pxor	%mm7,%mm6
+	movq	16(%esp),%mm5
+	paddq	%mm6,%mm2
+	movq	24(%esp),%mm6
+	movq	%mm4,%mm1
+	movq	-104(%edx),%mm7
+	pxor	%mm6,%mm5
+	psrlq	$14,%mm1
+	movq	%mm4,8(%esp)
+	pand	%mm4,%mm5
+	psllq	$23,%mm4
+	paddq	%mm3,%mm2
+	movq	%mm1,%mm3
+	psrlq	$4,%mm1
+	pxor	%mm6,%mm5
+	pxor	%mm4,%mm3
+	psllq	$23,%mm4
+	pxor	%mm1,%mm3
+	movq	%mm2,40(%esp)
+	paddq	%mm5,%mm7
+	pxor	%mm4,%mm3
+	psrlq	$23,%mm1
+	paddq	32(%esp),%mm7
+	pxor	%mm1,%mm3
+	psllq	$4,%mm4
+	pxor	%mm4,%mm3
+	movq	(%esp),%mm4
+	paddq	%mm7,%mm3
+	movq	%mm2,%mm5
+	psrlq	$28,%mm5
+	paddq	%mm3,%mm4
+	movq	%mm2,%mm6
+	movq	%mm5,%mm7
+	psllq	$25,%mm6
+	movq	48(%esp),%mm1
+	psrlq	$6,%mm5
+	pxor	%mm6,%mm7
+	psllq	$5,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm2
+	psrlq	$5,%mm5
+	pxor	%mm6,%mm7
+	pand	%mm2,%mm0
+	psllq	$6,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm0
+	pxor	%mm7,%mm6
+	movq	8(%esp),%mm5
+	paddq	%mm6,%mm0
+	movq	16(%esp),%mm6
+	movdqa	%xmm3,-112(%edx)
+	movdqa	%xmm7,%xmm5
+	movdqa	%xmm4,%xmm3
+.byte	102,15,58,15,226,8
+	movdqa	%xmm6,32(%edx)
+.byte	102,15,58,15,238,8
+	movdqa	%xmm4,%xmm6
+	psrlq	$7,%xmm4
+	paddq	%xmm5,%xmm2
+	movdqa	%xmm6,%xmm5
+	psrlq	$1,%xmm6
+	psllq	$56,%xmm5
+	pxor	%xmm6,%xmm4
+	psrlq	$7,%xmm6
+	pxor	%xmm5,%xmm4
+	psllq	$7,%xmm5
+	pxor	%xmm6,%xmm4
+	movdqa	%xmm1,%xmm6
+	pxor	%xmm5,%xmm4
+	movdqa	%xmm1,%xmm5
+	psrlq	$6,%xmm6
+	paddq	%xmm4,%xmm2
+	movdqa	%xmm1,%xmm4
+	psrlq	$19,%xmm5
+	psllq	$3,%xmm4
+	pxor	%xmm5,%xmm6
+	psrlq	$42,%xmm5
+	pxor	%xmm4,%xmm6
+	psllq	$42,%xmm4
+	pxor	%xmm5,%xmm6
+	movdqa	(%edx),%xmm5
+	pxor	%xmm4,%xmm6
+	movdqa	32(%ebp),%xmm4
+	movq	%mm4,%mm1
+	paddq	%xmm6,%xmm2
+	movq	-96(%edx),%mm7
+	pxor	%mm6,%mm5
+	psrlq	$14,%mm1
+	movq	%mm4,(%esp)
+	paddq	%xmm2,%xmm4
+	pand	%mm4,%mm5
+	psllq	$23,%mm4
+	paddq	%mm3,%mm0
+	movq	%mm1,%mm3
+	psrlq	$4,%mm1
+	pxor	%mm6,%mm5
+	pxor	%mm4,%mm3
+	psllq	$23,%mm4
+	pxor	%mm1,%mm3
+	movq	%mm0,32(%esp)
+	paddq	%mm5,%mm7
+	pxor	%mm4,%mm3
+	psrlq	$23,%mm1
+	paddq	24(%esp),%mm7
+	pxor	%mm1,%mm3
+	psllq	$4,%mm4
+	pxor	%mm4,%mm3
+	movq	56(%esp),%mm4
+	paddq	%mm7,%mm3
+	movq	%mm0,%mm5
+	psrlq	$28,%mm5
+	paddq	%mm3,%mm4
+	movq	%mm0,%mm6
+	movq	%mm5,%mm7
+	psllq	$25,%mm6
+	movq	40(%esp),%mm1
+	psrlq	$6,%mm5
+	pxor	%mm6,%mm7
+	psllq	$5,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm0
+	psrlq	$5,%mm5
+	pxor	%mm6,%mm7
+	pand	%mm0,%mm2
+	psllq	$6,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm2
+	pxor	%mm7,%mm6
+	movq	(%esp),%mm5
+	paddq	%mm6,%mm2
+	movq	8(%esp),%mm6
+	movq	%mm4,%mm1
+	movq	-88(%edx),%mm7
+	pxor	%mm6,%mm5
+	psrlq	$14,%mm1
+	movq	%mm4,56(%esp)
+	pand	%mm4,%mm5
+	psllq	$23,%mm4
+	paddq	%mm3,%mm2
+	movq	%mm1,%mm3
+	psrlq	$4,%mm1
+	pxor	%mm6,%mm5
+	pxor	%mm4,%mm3
+	psllq	$23,%mm4
+	pxor	%mm1,%mm3
+	movq	%mm2,24(%esp)
+	paddq	%mm5,%mm7
+	pxor	%mm4,%mm3
+	psrlq	$23,%mm1
+	paddq	16(%esp),%mm7
+	pxor	%mm1,%mm3
+	psllq	$4,%mm4
+	pxor	%mm4,%mm3
+	movq	48(%esp),%mm4
+	paddq	%mm7,%mm3
+	movq	%mm2,%mm5
+	psrlq	$28,%mm5
+	paddq	%mm3,%mm4
+	movq	%mm2,%mm6
+	movq	%mm5,%mm7
+	psllq	$25,%mm6
+	movq	32(%esp),%mm1
+	psrlq	$6,%mm5
+	pxor	%mm6,%mm7
+	psllq	$5,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm2
+	psrlq	$5,%mm5
+	pxor	%mm6,%mm7
+	pand	%mm2,%mm0
+	psllq	$6,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm0
+	pxor	%mm7,%mm6
+	movq	56(%esp),%mm5
+	paddq	%mm6,%mm0
+	movq	(%esp),%mm6
+	movdqa	%xmm4,-96(%edx)
+	movdqa	%xmm0,%xmm6
+	movdqa	%xmm5,%xmm4
+.byte	102,15,58,15,235,8
+	movdqa	%xmm7,48(%edx)
+.byte	102,15,58,15,247,8
+	movdqa	%xmm5,%xmm7
+	psrlq	$7,%xmm5
+	paddq	%xmm6,%xmm3
+	movdqa	%xmm7,%xmm6
+	psrlq	$1,%xmm7
+	psllq	$56,%xmm6
+	pxor	%xmm7,%xmm5
+	psrlq	$7,%xmm7
+	pxor	%xmm6,%xmm5
+	psllq	$7,%xmm6
+	pxor	%xmm7,%xmm5
+	movdqa	%xmm2,%xmm7
+	pxor	%xmm6,%xmm5
+	movdqa	%xmm2,%xmm6
+	psrlq	$6,%xmm7
+	paddq	%xmm5,%xmm3
+	movdqa	%xmm2,%xmm5
+	psrlq	$19,%xmm6
+	psllq	$3,%xmm5
+	pxor	%xmm6,%xmm7
+	psrlq	$42,%xmm6
+	pxor	%xmm5,%xmm7
+	psllq	$42,%xmm5
+	pxor	%xmm6,%xmm7
+	movdqa	16(%edx),%xmm6
+	pxor	%xmm5,%xmm7
+	movdqa	48(%ebp),%xmm5
+	movq	%mm4,%mm1
+	paddq	%xmm7,%xmm3
+	movq	-80(%edx),%mm7
+	pxor	%mm6,%mm5
+	psrlq	$14,%mm1
+	movq	%mm4,48(%esp)
+	paddq	%xmm3,%xmm5
+	pand	%mm4,%mm5
+	psllq	$23,%mm4
+	paddq	%mm3,%mm0
+	movq	%mm1,%mm3
+	psrlq	$4,%mm1
+	pxor	%mm6,%mm5
+	pxor	%mm4,%mm3
+	psllq	$23,%mm4
+	pxor	%mm1,%mm3
+	movq	%mm0,16(%esp)
+	paddq	%mm5,%mm7
+	pxor	%mm4,%mm3
+	psrlq	$23,%mm1
+	paddq	8(%esp),%mm7
+	pxor	%mm1,%mm3
+	psllq	$4,%mm4
+	pxor	%mm4,%mm3
+	movq	40(%esp),%mm4
+	paddq	%mm7,%mm3
+	movq	%mm0,%mm5
+	psrlq	$28,%mm5
+	paddq	%mm3,%mm4
+	movq	%mm0,%mm6
+	movq	%mm5,%mm7
+	psllq	$25,%mm6
+	movq	24(%esp),%mm1
+	psrlq	$6,%mm5
+	pxor	%mm6,%mm7
+	psllq	$5,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm0
+	psrlq	$5,%mm5
+	pxor	%mm6,%mm7
+	pand	%mm0,%mm2
+	psllq	$6,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm2
+	pxor	%mm7,%mm6
+	movq	48(%esp),%mm5
+	paddq	%mm6,%mm2
+	movq	56(%esp),%mm6
+	movq	%mm4,%mm1
+	movq	-72(%edx),%mm7
+	pxor	%mm6,%mm5
+	psrlq	$14,%mm1
+	movq	%mm4,40(%esp)
+	pand	%mm4,%mm5
+	psllq	$23,%mm4
+	paddq	%mm3,%mm2
+	movq	%mm1,%mm3
+	psrlq	$4,%mm1
+	pxor	%mm6,%mm5
+	pxor	%mm4,%mm3
+	psllq	$23,%mm4
+	pxor	%mm1,%mm3
+	movq	%mm2,8(%esp)
+	paddq	%mm5,%mm7
+	pxor	%mm4,%mm3
+	psrlq	$23,%mm1
+	paddq	(%esp),%mm7
+	pxor	%mm1,%mm3
+	psllq	$4,%mm4
+	pxor	%mm4,%mm3
+	movq	32(%esp),%mm4
+	paddq	%mm7,%mm3
+	movq	%mm2,%mm5
+	psrlq	$28,%mm5
+	paddq	%mm3,%mm4
+	movq	%mm2,%mm6
+	movq	%mm5,%mm7
+	psllq	$25,%mm6
+	movq	16(%esp),%mm1
+	psrlq	$6,%mm5
+	pxor	%mm6,%mm7
+	psllq	$5,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm2
+	psrlq	$5,%mm5
+	pxor	%mm6,%mm7
+	pand	%mm2,%mm0
+	psllq	$6,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm0
+	pxor	%mm7,%mm6
+	movq	40(%esp),%mm5
+	paddq	%mm6,%mm0
+	movq	48(%esp),%mm6
+	movdqa	%xmm5,-80(%edx)
+	movdqa	%xmm1,%xmm7
+	movdqa	%xmm6,%xmm5
+.byte	102,15,58,15,244,8
+	movdqa	%xmm0,(%edx)
+.byte	102,15,58,15,248,8
+	movdqa	%xmm6,%xmm0
+	psrlq	$7,%xmm6
+	paddq	%xmm7,%xmm4
+	movdqa	%xmm0,%xmm7
+	psrlq	$1,%xmm0
+	psllq	$56,%xmm7
+	pxor	%xmm0,%xmm6
+	psrlq	$7,%xmm0
+	pxor	%xmm7,%xmm6
+	psllq	$7,%xmm7
+	pxor	%xmm0,%xmm6
+	movdqa	%xmm3,%xmm0
+	pxor	%xmm7,%xmm6
+	movdqa	%xmm3,%xmm7
+	psrlq	$6,%xmm0
+	paddq	%xmm6,%xmm4
+	movdqa	%xmm3,%xmm6
+	psrlq	$19,%xmm7
+	psllq	$3,%xmm6
+	pxor	%xmm7,%xmm0
+	psrlq	$42,%xmm7
+	pxor	%xmm6,%xmm0
+	psllq	$42,%xmm6
+	pxor	%xmm7,%xmm0
+	movdqa	32(%edx),%xmm7
+	pxor	%xmm6,%xmm0
+	movdqa	64(%ebp),%xmm6
+	movq	%mm4,%mm1
+	paddq	%xmm0,%xmm4
+	movq	-64(%edx),%mm7
+	pxor	%mm6,%mm5
+	psrlq	$14,%mm1
+	movq	%mm4,32(%esp)
+	paddq	%xmm4,%xmm6
+	pand	%mm4,%mm5
+	psllq	$23,%mm4
+	paddq	%mm3,%mm0
+	movq	%mm1,%mm3
+	psrlq	$4,%mm1
+	pxor	%mm6,%mm5
+	pxor	%mm4,%mm3
+	psllq	$23,%mm4
+	pxor	%mm1,%mm3
+	movq	%mm0,(%esp)
+	paddq	%mm5,%mm7
+	pxor	%mm4,%mm3
+	psrlq	$23,%mm1
+	paddq	56(%esp),%mm7
+	pxor	%mm1,%mm3
+	psllq	$4,%mm4
+	pxor	%mm4,%mm3
+	movq	24(%esp),%mm4
+	paddq	%mm7,%mm3
+	movq	%mm0,%mm5
+	psrlq	$28,%mm5
+	paddq	%mm3,%mm4
+	movq	%mm0,%mm6
+	movq	%mm5,%mm7
+	psllq	$25,%mm6
+	movq	8(%esp),%mm1
+	psrlq	$6,%mm5
+	pxor	%mm6,%mm7
+	psllq	$5,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm0
+	psrlq	$5,%mm5
+	pxor	%mm6,%mm7
+	pand	%mm0,%mm2
+	psllq	$6,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm2
+	pxor	%mm7,%mm6
+	movq	32(%esp),%mm5
+	paddq	%mm6,%mm2
+	movq	40(%esp),%mm6
+	movq	%mm4,%mm1
+	movq	-56(%edx),%mm7
+	pxor	%mm6,%mm5
+	psrlq	$14,%mm1
+	movq	%mm4,24(%esp)
+	pand	%mm4,%mm5
+	psllq	$23,%mm4
+	paddq	%mm3,%mm2
+	movq	%mm1,%mm3
+	psrlq	$4,%mm1
+	pxor	%mm6,%mm5
+	pxor	%mm4,%mm3
+	psllq	$23,%mm4
+	pxor	%mm1,%mm3
+	movq	%mm2,56(%esp)
+	paddq	%mm5,%mm7
+	pxor	%mm4,%mm3
+	psrlq	$23,%mm1
+	paddq	48(%esp),%mm7
+	pxor	%mm1,%mm3
+	psllq	$4,%mm4
+	pxor	%mm4,%mm3
+	movq	16(%esp),%mm4
+	paddq	%mm7,%mm3
+	movq	%mm2,%mm5
+	psrlq	$28,%mm5
+	paddq	%mm3,%mm4
+	movq	%mm2,%mm6
+	movq	%mm5,%mm7
+	psllq	$25,%mm6
+	movq	(%esp),%mm1
+	psrlq	$6,%mm5
+	pxor	%mm6,%mm7
+	psllq	$5,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm2
+	psrlq	$5,%mm5
+	pxor	%mm6,%mm7
+	pand	%mm2,%mm0
+	psllq	$6,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm0
+	pxor	%mm7,%mm6
+	movq	24(%esp),%mm5
+	paddq	%mm6,%mm0
+	movq	32(%esp),%mm6
+	movdqa	%xmm6,-64(%edx)
+	movdqa	%xmm2,%xmm0
+	movdqa	%xmm7,%xmm6
+.byte	102,15,58,15,253,8
+	movdqa	%xmm1,16(%edx)
+.byte	102,15,58,15,193,8
+	movdqa	%xmm7,%xmm1
+	psrlq	$7,%xmm7
+	paddq	%xmm0,%xmm5
+	movdqa	%xmm1,%xmm0
+	psrlq	$1,%xmm1
+	psllq	$56,%xmm0
+	pxor	%xmm1,%xmm7
+	psrlq	$7,%xmm1
+	pxor	%xmm0,%xmm7
+	psllq	$7,%xmm0
+	pxor	%xmm1,%xmm7
+	movdqa	%xmm4,%xmm1
+	pxor	%xmm0,%xmm7
+	movdqa	%xmm4,%xmm0
+	psrlq	$6,%xmm1
+	paddq	%xmm7,%xmm5
+	movdqa	%xmm4,%xmm7
+	psrlq	$19,%xmm0
+	psllq	$3,%xmm7
+	pxor	%xmm0,%xmm1
+	psrlq	$42,%xmm0
+	pxor	%xmm7,%xmm1
+	psllq	$42,%xmm7
+	pxor	%xmm0,%xmm1
+	movdqa	48(%edx),%xmm0
+	pxor	%xmm7,%xmm1
+	movdqa	80(%ebp),%xmm7
+	movq	%mm4,%mm1
+	paddq	%xmm1,%xmm5
+	movq	-48(%edx),%mm7
+	pxor	%mm6,%mm5
+	psrlq	$14,%mm1
+	movq	%mm4,16(%esp)
+	paddq	%xmm5,%xmm7
+	pand	%mm4,%mm5
+	psllq	$23,%mm4
+	paddq	%mm3,%mm0
+	movq	%mm1,%mm3
+	psrlq	$4,%mm1
+	pxor	%mm6,%mm5
+	pxor	%mm4,%mm3
+	psllq	$23,%mm4
+	pxor	%mm1,%mm3
+	movq	%mm0,48(%esp)
+	paddq	%mm5,%mm7
+	pxor	%mm4,%mm3
+	psrlq	$23,%mm1
+	paddq	40(%esp),%mm7
+	pxor	%mm1,%mm3
+	psllq	$4,%mm4
+	pxor	%mm4,%mm3
+	movq	8(%esp),%mm4
+	paddq	%mm7,%mm3
+	movq	%mm0,%mm5
+	psrlq	$28,%mm5
+	paddq	%mm3,%mm4
+	movq	%mm0,%mm6
+	movq	%mm5,%mm7
+	psllq	$25,%mm6
+	movq	56(%esp),%mm1
+	psrlq	$6,%mm5
+	pxor	%mm6,%mm7
+	psllq	$5,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm0
+	psrlq	$5,%mm5
+	pxor	%mm6,%mm7
+	pand	%mm0,%mm2
+	psllq	$6,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm2
+	pxor	%mm7,%mm6
+	movq	16(%esp),%mm5
+	paddq	%mm6,%mm2
+	movq	24(%esp),%mm6
+	movq	%mm4,%mm1
+	movq	-40(%edx),%mm7
+	pxor	%mm6,%mm5
+	psrlq	$14,%mm1
+	movq	%mm4,8(%esp)
+	pand	%mm4,%mm5
+	psllq	$23,%mm4
+	paddq	%mm3,%mm2
+	movq	%mm1,%mm3
+	psrlq	$4,%mm1
+	pxor	%mm6,%mm5
+	pxor	%mm4,%mm3
+	psllq	$23,%mm4
+	pxor	%mm1,%mm3
+	movq	%mm2,40(%esp)
+	paddq	%mm5,%mm7
+	pxor	%mm4,%mm3
+	psrlq	$23,%mm1
+	paddq	32(%esp),%mm7
+	pxor	%mm1,%mm3
+	psllq	$4,%mm4
+	pxor	%mm4,%mm3
+	movq	(%esp),%mm4
+	paddq	%mm7,%mm3
+	movq	%mm2,%mm5
+	psrlq	$28,%mm5
+	paddq	%mm3,%mm4
+	movq	%mm2,%mm6
+	movq	%mm5,%mm7
+	psllq	$25,%mm6
+	movq	48(%esp),%mm1
+	psrlq	$6,%mm5
+	pxor	%mm6,%mm7
+	psllq	$5,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm2
+	psrlq	$5,%mm5
+	pxor	%mm6,%mm7
+	pand	%mm2,%mm0
+	psllq	$6,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm0
+	pxor	%mm7,%mm6
+	movq	8(%esp),%mm5
+	paddq	%mm6,%mm0
+	movq	16(%esp),%mm6
+	movdqa	%xmm7,-48(%edx)
+	movdqa	%xmm3,%xmm1
+	movdqa	%xmm0,%xmm7
+.byte	102,15,58,15,198,8
+	movdqa	%xmm2,32(%edx)
+.byte	102,15,58,15,202,8
+	movdqa	%xmm0,%xmm2
+	psrlq	$7,%xmm0
+	paddq	%xmm1,%xmm6
+	movdqa	%xmm2,%xmm1
+	psrlq	$1,%xmm2
+	psllq	$56,%xmm1
+	pxor	%xmm2,%xmm0
+	psrlq	$7,%xmm2
+	pxor	%xmm1,%xmm0
+	psllq	$7,%xmm1
+	pxor	%xmm2,%xmm0
+	movdqa	%xmm5,%xmm2
+	pxor	%xmm1,%xmm0
+	movdqa	%xmm5,%xmm1
+	psrlq	$6,%xmm2
+	paddq	%xmm0,%xmm6
+	movdqa	%xmm5,%xmm0
+	psrlq	$19,%xmm1
+	psllq	$3,%xmm0
+	pxor	%xmm1,%xmm2
+	psrlq	$42,%xmm1
+	pxor	%xmm0,%xmm2
+	psllq	$42,%xmm0
+	pxor	%xmm1,%xmm2
+	movdqa	(%edx),%xmm1
+	pxor	%xmm0,%xmm2
+	movdqa	96(%ebp),%xmm0
+	movq	%mm4,%mm1
+	paddq	%xmm2,%xmm6
+	movq	-32(%edx),%mm7
+	pxor	%mm6,%mm5
+	psrlq	$14,%mm1
+	movq	%mm4,(%esp)
+	paddq	%xmm6,%xmm0
+	pand	%mm4,%mm5
+	psllq	$23,%mm4
+	paddq	%mm3,%mm0
+	movq	%mm1,%mm3
+	psrlq	$4,%mm1
+	pxor	%mm6,%mm5
+	pxor	%mm4,%mm3
+	psllq	$23,%mm4
+	pxor	%mm1,%mm3
+	movq	%mm0,32(%esp)
+	paddq	%mm5,%mm7
+	pxor	%mm4,%mm3
+	psrlq	$23,%mm1
+	paddq	24(%esp),%mm7
+	pxor	%mm1,%mm3
+	psllq	$4,%mm4
+	pxor	%mm4,%mm3
+	movq	56(%esp),%mm4
+	paddq	%mm7,%mm3
+	movq	%mm0,%mm5
+	psrlq	$28,%mm5
+	paddq	%mm3,%mm4
+	movq	%mm0,%mm6
+	movq	%mm5,%mm7
+	psllq	$25,%mm6
+	movq	40(%esp),%mm1
+	psrlq	$6,%mm5
+	pxor	%mm6,%mm7
+	psllq	$5,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm0
+	psrlq	$5,%mm5
+	pxor	%mm6,%mm7
+	pand	%mm0,%mm2
+	psllq	$6,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm2
+	pxor	%mm7,%mm6
+	movq	(%esp),%mm5
+	paddq	%mm6,%mm2
+	movq	8(%esp),%mm6
+	movq	%mm4,%mm1
+	movq	-24(%edx),%mm7
+	pxor	%mm6,%mm5
+	psrlq	$14,%mm1
+	movq	%mm4,56(%esp)
+	pand	%mm4,%mm5
+	psllq	$23,%mm4
+	paddq	%mm3,%mm2
+	movq	%mm1,%mm3
+	psrlq	$4,%mm1
+	pxor	%mm6,%mm5
+	pxor	%mm4,%mm3
+	psllq	$23,%mm4
+	pxor	%mm1,%mm3
+	movq	%mm2,24(%esp)
+	paddq	%mm5,%mm7
+	pxor	%mm4,%mm3
+	psrlq	$23,%mm1
+	paddq	16(%esp),%mm7
+	pxor	%mm1,%mm3
+	psllq	$4,%mm4
+	pxor	%mm4,%mm3
+	movq	48(%esp),%mm4
+	paddq	%mm7,%mm3
+	movq	%mm2,%mm5
+	psrlq	$28,%mm5
+	paddq	%mm3,%mm4
+	movq	%mm2,%mm6
+	movq	%mm5,%mm7
+	psllq	$25,%mm6
+	movq	32(%esp),%mm1
+	psrlq	$6,%mm5
+	pxor	%mm6,%mm7
+	psllq	$5,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm2
+	psrlq	$5,%mm5
+	pxor	%mm6,%mm7
+	pand	%mm2,%mm0
+	psllq	$6,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm0
+	pxor	%mm7,%mm6
+	movq	56(%esp),%mm5
+	paddq	%mm6,%mm0
+	movq	(%esp),%mm6
+	movdqa	%xmm0,-32(%edx)
+	movdqa	%xmm4,%xmm2
+	movdqa	%xmm1,%xmm0
+.byte	102,15,58,15,207,8
+	movdqa	%xmm3,48(%edx)
+.byte	102,15,58,15,211,8
+	movdqa	%xmm1,%xmm3
+	psrlq	$7,%xmm1
+	paddq	%xmm2,%xmm7
+	movdqa	%xmm3,%xmm2
+	psrlq	$1,%xmm3
+	psllq	$56,%xmm2
+	pxor	%xmm3,%xmm1
+	psrlq	$7,%xmm3
+	pxor	%xmm2,%xmm1
+	psllq	$7,%xmm2
+	pxor	%xmm3,%xmm1
+	movdqa	%xmm6,%xmm3
+	pxor	%xmm2,%xmm1
+	movdqa	%xmm6,%xmm2
+	psrlq	$6,%xmm3
+	paddq	%xmm1,%xmm7
+	movdqa	%xmm6,%xmm1
+	psrlq	$19,%xmm2
+	psllq	$3,%xmm1
+	pxor	%xmm2,%xmm3
+	psrlq	$42,%xmm2
+	pxor	%xmm1,%xmm3
+	psllq	$42,%xmm1
+	pxor	%xmm2,%xmm3
+	movdqa	16(%edx),%xmm2
+	pxor	%xmm1,%xmm3
+	movdqa	112(%ebp),%xmm1
+	movq	%mm4,%mm1
+	paddq	%xmm3,%xmm7
+	movq	-16(%edx),%mm7
+	pxor	%mm6,%mm5
+	psrlq	$14,%mm1
+	movq	%mm4,48(%esp)
+	paddq	%xmm7,%xmm1
+	pand	%mm4,%mm5
+	psllq	$23,%mm4
+	paddq	%mm3,%mm0
+	movq	%mm1,%mm3
+	psrlq	$4,%mm1
+	pxor	%mm6,%mm5
+	pxor	%mm4,%mm3
+	psllq	$23,%mm4
+	pxor	%mm1,%mm3
+	movq	%mm0,16(%esp)
+	paddq	%mm5,%mm7
+	pxor	%mm4,%mm3
+	psrlq	$23,%mm1
+	paddq	8(%esp),%mm7
+	pxor	%mm1,%mm3
+	psllq	$4,%mm4
+	pxor	%mm4,%mm3
+	movq	40(%esp),%mm4
+	paddq	%mm7,%mm3
+	movq	%mm0,%mm5
+	psrlq	$28,%mm5
+	paddq	%mm3,%mm4
+	movq	%mm0,%mm6
+	movq	%mm5,%mm7
+	psllq	$25,%mm6
+	movq	24(%esp),%mm1
+	psrlq	$6,%mm5
+	pxor	%mm6,%mm7
+	psllq	$5,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm0
+	psrlq	$5,%mm5
+	pxor	%mm6,%mm7
+	pand	%mm0,%mm2
+	psllq	$6,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm2
+	pxor	%mm7,%mm6
+	movq	48(%esp),%mm5
+	paddq	%mm6,%mm2
+	movq	56(%esp),%mm6
+	movq	%mm4,%mm1
+	movq	-8(%edx),%mm7
+	pxor	%mm6,%mm5
+	psrlq	$14,%mm1
+	movq	%mm4,40(%esp)
+	pand	%mm4,%mm5
+	psllq	$23,%mm4
+	paddq	%mm3,%mm2
+	movq	%mm1,%mm3
+	psrlq	$4,%mm1
+	pxor	%mm6,%mm5
+	pxor	%mm4,%mm3
+	psllq	$23,%mm4
+	pxor	%mm1,%mm3
+	movq	%mm2,8(%esp)
+	paddq	%mm5,%mm7
+	pxor	%mm4,%mm3
+	psrlq	$23,%mm1
+	paddq	(%esp),%mm7
+	pxor	%mm1,%mm3
+	psllq	$4,%mm4
+	pxor	%mm4,%mm3
+	movq	32(%esp),%mm4
+	paddq	%mm7,%mm3
+	movq	%mm2,%mm5
+	psrlq	$28,%mm5
+	paddq	%mm3,%mm4
+	movq	%mm2,%mm6
+	movq	%mm5,%mm7
+	psllq	$25,%mm6
+	movq	16(%esp),%mm1
+	psrlq	$6,%mm5
+	pxor	%mm6,%mm7
+	psllq	$5,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm2
+	psrlq	$5,%mm5
+	pxor	%mm6,%mm7
+	pand	%mm2,%mm0
+	psllq	$6,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm0
+	pxor	%mm7,%mm6
+	movq	40(%esp),%mm5
+	paddq	%mm6,%mm0
+	movq	48(%esp),%mm6
+	movdqa	%xmm1,-16(%edx)
+	leal	128(%ebp),%ebp
+	decl	%ecx
+	jnz	.L00800_47_ssse3
+	movdqa	(%ebp),%xmm1
+	leal	-640(%ebp),%ebp
+	movdqu	(%ebx),%xmm0
+.byte	102,15,56,0,193
+	movdqa	(%ebp),%xmm3
+	movdqa	%xmm1,%xmm2
+	movdqu	16(%ebx),%xmm1
+	paddq	%xmm0,%xmm3
+.byte	102,15,56,0,202
+	movq	%mm4,%mm1
+	movq	-128(%edx),%mm7
+	pxor	%mm6,%mm5
+	psrlq	$14,%mm1
+	movq	%mm4,32(%esp)
+	pand	%mm4,%mm5
+	psllq	$23,%mm4
+	paddq	%mm3,%mm0
+	movq	%mm1,%mm3
+	psrlq	$4,%mm1
+	pxor	%mm6,%mm5
+	pxor	%mm4,%mm3
+	psllq	$23,%mm4
+	pxor	%mm1,%mm3
+	movq	%mm0,(%esp)
+	paddq	%mm5,%mm7
+	pxor	%mm4,%mm3
+	psrlq	$23,%mm1
+	paddq	56(%esp),%mm7
+	pxor	%mm1,%mm3
+	psllq	$4,%mm4
+	pxor	%mm4,%mm3
+	movq	24(%esp),%mm4
+	paddq	%mm7,%mm3
+	movq	%mm0,%mm5
+	psrlq	$28,%mm5
+	paddq	%mm3,%mm4
+	movq	%mm0,%mm6
+	movq	%mm5,%mm7
+	psllq	$25,%mm6
+	movq	8(%esp),%mm1
+	psrlq	$6,%mm5
+	pxor	%mm6,%mm7
+	psllq	$5,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm0
+	psrlq	$5,%mm5
+	pxor	%mm6,%mm7
+	pand	%mm0,%mm2
+	psllq	$6,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm2
+	pxor	%mm7,%mm6
+	movq	32(%esp),%mm5
+	paddq	%mm6,%mm2
+	movq	40(%esp),%mm6
+	movq	%mm4,%mm1
+	movq	-120(%edx),%mm7
+	pxor	%mm6,%mm5
+	psrlq	$14,%mm1
+	movq	%mm4,24(%esp)
+	pand	%mm4,%mm5
+	psllq	$23,%mm4
+	paddq	%mm3,%mm2
+	movq	%mm1,%mm3
+	psrlq	$4,%mm1
+	pxor	%mm6,%mm5
+	pxor	%mm4,%mm3
+	psllq	$23,%mm4
+	pxor	%mm1,%mm3
+	movq	%mm2,56(%esp)
+	paddq	%mm5,%mm7
+	pxor	%mm4,%mm3
+	psrlq	$23,%mm1
+	paddq	48(%esp),%mm7
+	pxor	%mm1,%mm3
+	psllq	$4,%mm4
+	pxor	%mm4,%mm3
+	movq	16(%esp),%mm4
+	paddq	%mm7,%mm3
+	movq	%mm2,%mm5
+	psrlq	$28,%mm5
+	paddq	%mm3,%mm4
+	movq	%mm2,%mm6
+	movq	%mm5,%mm7
+	psllq	$25,%mm6
+	movq	(%esp),%mm1
+	psrlq	$6,%mm5
+	pxor	%mm6,%mm7
+	psllq	$5,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm2
+	psrlq	$5,%mm5
+	pxor	%mm6,%mm7
+	pand	%mm2,%mm0
+	psllq	$6,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm0
+	pxor	%mm7,%mm6
+	movq	24(%esp),%mm5
+	paddq	%mm6,%mm0
+	movq	32(%esp),%mm6
+	movdqa	%xmm3,-128(%edx)
+	movdqa	16(%ebp),%xmm4
+	movdqa	%xmm2,%xmm3
+	movdqu	32(%ebx),%xmm2
+	paddq	%xmm1,%xmm4
+.byte	102,15,56,0,211
+	movq	%mm4,%mm1
+	movq	-112(%edx),%mm7
+	pxor	%mm6,%mm5
+	psrlq	$14,%mm1
+	movq	%mm4,16(%esp)
+	pand	%mm4,%mm5
+	psllq	$23,%mm4
+	paddq	%mm3,%mm0
+	movq	%mm1,%mm3
+	psrlq	$4,%mm1
+	pxor	%mm6,%mm5
+	pxor	%mm4,%mm3
+	psllq	$23,%mm4
+	pxor	%mm1,%mm3
+	movq	%mm0,48(%esp)
+	paddq	%mm5,%mm7
+	pxor	%mm4,%mm3
+	psrlq	$23,%mm1
+	paddq	40(%esp),%mm7
+	pxor	%mm1,%mm3
+	psllq	$4,%mm4
+	pxor	%mm4,%mm3
+	movq	8(%esp),%mm4
+	paddq	%mm7,%mm3
+	movq	%mm0,%mm5
+	psrlq	$28,%mm5
+	paddq	%mm3,%mm4
+	movq	%mm0,%mm6
+	movq	%mm5,%mm7
+	psllq	$25,%mm6
+	movq	56(%esp),%mm1
+	psrlq	$6,%mm5
+	pxor	%mm6,%mm7
+	psllq	$5,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm0
+	psrlq	$5,%mm5
+	pxor	%mm6,%mm7
+	pand	%mm0,%mm2
+	psllq	$6,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm2
+	pxor	%mm7,%mm6
+	movq	16(%esp),%mm5
+	paddq	%mm6,%mm2
+	movq	24(%esp),%mm6
+	movq	%mm4,%mm1
+	movq	-104(%edx),%mm7
+	pxor	%mm6,%mm5
+	psrlq	$14,%mm1
+	movq	%mm4,8(%esp)
+	pand	%mm4,%mm5
+	psllq	$23,%mm4
+	paddq	%mm3,%mm2
+	movq	%mm1,%mm3
+	psrlq	$4,%mm1
+	pxor	%mm6,%mm5
+	pxor	%mm4,%mm3
+	psllq	$23,%mm4
+	pxor	%mm1,%mm3
+	movq	%mm2,40(%esp)
+	paddq	%mm5,%mm7
+	pxor	%mm4,%mm3
+	psrlq	$23,%mm1
+	paddq	32(%esp),%mm7
+	pxor	%mm1,%mm3
+	psllq	$4,%mm4
+	pxor	%mm4,%mm3
+	movq	(%esp),%mm4
+	paddq	%mm7,%mm3
+	movq	%mm2,%mm5
+	psrlq	$28,%mm5
+	paddq	%mm3,%mm4
+	movq	%mm2,%mm6
+	movq	%mm5,%mm7
+	psllq	$25,%mm6
+	movq	48(%esp),%mm1
+	psrlq	$6,%mm5
+	pxor	%mm6,%mm7
+	psllq	$5,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm2
+	psrlq	$5,%mm5
+	pxor	%mm6,%mm7
+	pand	%mm2,%mm0
+	psllq	$6,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm0
+	pxor	%mm7,%mm6
+	movq	8(%esp),%mm5
+	paddq	%mm6,%mm0
+	movq	16(%esp),%mm6
+	movdqa	%xmm4,-112(%edx)
+	movdqa	32(%ebp),%xmm5
+	movdqa	%xmm3,%xmm4
+	movdqu	48(%ebx),%xmm3
+	paddq	%xmm2,%xmm5
+.byte	102,15,56,0,220
+	movq	%mm4,%mm1
+	movq	-96(%edx),%mm7
+	pxor	%mm6,%mm5
+	psrlq	$14,%mm1
+	movq	%mm4,(%esp)
+	pand	%mm4,%mm5
+	psllq	$23,%mm4
+	paddq	%mm3,%mm0
+	movq	%mm1,%mm3
+	psrlq	$4,%mm1
+	pxor	%mm6,%mm5
+	pxor	%mm4,%mm3
+	psllq	$23,%mm4
+	pxor	%mm1,%mm3
+	movq	%mm0,32(%esp)
+	paddq	%mm5,%mm7
+	pxor	%mm4,%mm3
+	psrlq	$23,%mm1
+	paddq	24(%esp),%mm7
+	pxor	%mm1,%mm3
+	psllq	$4,%mm4
+	pxor	%mm4,%mm3
+	movq	56(%esp),%mm4
+	paddq	%mm7,%mm3
+	movq	%mm0,%mm5
+	psrlq	$28,%mm5
+	paddq	%mm3,%mm4
+	movq	%mm0,%mm6
+	movq	%mm5,%mm7
+	psllq	$25,%mm6
+	movq	40(%esp),%mm1
+	psrlq	$6,%mm5
+	pxor	%mm6,%mm7
+	psllq	$5,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm0
+	psrlq	$5,%mm5
+	pxor	%mm6,%mm7
+	pand	%mm0,%mm2
+	psllq	$6,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm2
+	pxor	%mm7,%mm6
+	movq	(%esp),%mm5
+	paddq	%mm6,%mm2
+	movq	8(%esp),%mm6
+	movq	%mm4,%mm1
+	movq	-88(%edx),%mm7
+	pxor	%mm6,%mm5
+	psrlq	$14,%mm1
+	movq	%mm4,56(%esp)
+	pand	%mm4,%mm5
+	psllq	$23,%mm4
+	paddq	%mm3,%mm2
+	movq	%mm1,%mm3
+	psrlq	$4,%mm1
+	pxor	%mm6,%mm5
+	pxor	%mm4,%mm3
+	psllq	$23,%mm4
+	pxor	%mm1,%mm3
+	movq	%mm2,24(%esp)
+	paddq	%mm5,%mm7
+	pxor	%mm4,%mm3
+	psrlq	$23,%mm1
+	paddq	16(%esp),%mm7
+	pxor	%mm1,%mm3
+	psllq	$4,%mm4
+	pxor	%mm4,%mm3
+	movq	48(%esp),%mm4
+	paddq	%mm7,%mm3
+	movq	%mm2,%mm5
+	psrlq	$28,%mm5
+	paddq	%mm3,%mm4
+	movq	%mm2,%mm6
+	movq	%mm5,%mm7
+	psllq	$25,%mm6
+	movq	32(%esp),%mm1
+	psrlq	$6,%mm5
+	pxor	%mm6,%mm7
+	psllq	$5,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm2
+	psrlq	$5,%mm5
+	pxor	%mm6,%mm7
+	pand	%mm2,%mm0
+	psllq	$6,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm0
+	pxor	%mm7,%mm6
+	movq	56(%esp),%mm5
+	paddq	%mm6,%mm0
+	movq	(%esp),%mm6
+	movdqa	%xmm5,-96(%edx)
+	movdqa	48(%ebp),%xmm6
+	movdqa	%xmm4,%xmm5
+	movdqu	64(%ebx),%xmm4
+	paddq	%xmm3,%xmm6
+.byte	102,15,56,0,229
+	movq	%mm4,%mm1
+	movq	-80(%edx),%mm7
+	pxor	%mm6,%mm5
+	psrlq	$14,%mm1
+	movq	%mm4,48(%esp)
+	pand	%mm4,%mm5
+	psllq	$23,%mm4
+	paddq	%mm3,%mm0
+	movq	%mm1,%mm3
+	psrlq	$4,%mm1
+	pxor	%mm6,%mm5
+	pxor	%mm4,%mm3
+	psllq	$23,%mm4
+	pxor	%mm1,%mm3
+	movq	%mm0,16(%esp)
+	paddq	%mm5,%mm7
+	pxor	%mm4,%mm3
+	psrlq	$23,%mm1
+	paddq	8(%esp),%mm7
+	pxor	%mm1,%mm3
+	psllq	$4,%mm4
+	pxor	%mm4,%mm3
+	movq	40(%esp),%mm4
+	paddq	%mm7,%mm3
+	movq	%mm0,%mm5
+	psrlq	$28,%mm5
+	paddq	%mm3,%mm4
+	movq	%mm0,%mm6
+	movq	%mm5,%mm7
+	psllq	$25,%mm6
+	movq	24(%esp),%mm1
+	psrlq	$6,%mm5
+	pxor	%mm6,%mm7
+	psllq	$5,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm0
+	psrlq	$5,%mm5
+	pxor	%mm6,%mm7
+	pand	%mm0,%mm2
+	psllq	$6,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm2
+	pxor	%mm7,%mm6
+	movq	48(%esp),%mm5
+	paddq	%mm6,%mm2
+	movq	56(%esp),%mm6
+	movq	%mm4,%mm1
+	movq	-72(%edx),%mm7
+	pxor	%mm6,%mm5
+	psrlq	$14,%mm1
+	movq	%mm4,40(%esp)
+	pand	%mm4,%mm5
+	psllq	$23,%mm4
+	paddq	%mm3,%mm2
+	movq	%mm1,%mm3
+	psrlq	$4,%mm1
+	pxor	%mm6,%mm5
+	pxor	%mm4,%mm3
+	psllq	$23,%mm4
+	pxor	%mm1,%mm3
+	movq	%mm2,8(%esp)
+	paddq	%mm5,%mm7
+	pxor	%mm4,%mm3
+	psrlq	$23,%mm1
+	paddq	(%esp),%mm7
+	pxor	%mm1,%mm3
+	psllq	$4,%mm4
+	pxor	%mm4,%mm3
+	movq	32(%esp),%mm4
+	paddq	%mm7,%mm3
+	movq	%mm2,%mm5
+	psrlq	$28,%mm5
+	paddq	%mm3,%mm4
+	movq	%mm2,%mm6
+	movq	%mm5,%mm7
+	psllq	$25,%mm6
+	movq	16(%esp),%mm1
+	psrlq	$6,%mm5
+	pxor	%mm6,%mm7
+	psllq	$5,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm2
+	psrlq	$5,%mm5
+	pxor	%mm6,%mm7
+	pand	%mm2,%mm0
+	psllq	$6,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm0
+	pxor	%mm7,%mm6
+	movq	40(%esp),%mm5
+	paddq	%mm6,%mm0
+	movq	48(%esp),%mm6
+	movdqa	%xmm6,-80(%edx)
+	movdqa	64(%ebp),%xmm7
+	movdqa	%xmm5,%xmm6
+	movdqu	80(%ebx),%xmm5
+	paddq	%xmm4,%xmm7
+.byte	102,15,56,0,238
+	movq	%mm4,%mm1
+	movq	-64(%edx),%mm7
+	pxor	%mm6,%mm5
+	psrlq	$14,%mm1
+	movq	%mm4,32(%esp)
+	pand	%mm4,%mm5
+	psllq	$23,%mm4
+	paddq	%mm3,%mm0
+	movq	%mm1,%mm3
+	psrlq	$4,%mm1
+	pxor	%mm6,%mm5
+	pxor	%mm4,%mm3
+	psllq	$23,%mm4
+	pxor	%mm1,%mm3
+	movq	%mm0,(%esp)
+	paddq	%mm5,%mm7
+	pxor	%mm4,%mm3
+	psrlq	$23,%mm1
+	paddq	56(%esp),%mm7
+	pxor	%mm1,%mm3
+	psllq	$4,%mm4
+	pxor	%mm4,%mm3
+	movq	24(%esp),%mm4
+	paddq	%mm7,%mm3
+	movq	%mm0,%mm5
+	psrlq	$28,%mm5
+	paddq	%mm3,%mm4
+	movq	%mm0,%mm6
+	movq	%mm5,%mm7
+	psllq	$25,%mm6
+	movq	8(%esp),%mm1
+	psrlq	$6,%mm5
+	pxor	%mm6,%mm7
+	psllq	$5,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm0
+	psrlq	$5,%mm5
+	pxor	%mm6,%mm7
+	pand	%mm0,%mm2
+	psllq	$6,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm2
+	pxor	%mm7,%mm6
+	movq	32(%esp),%mm5
+	paddq	%mm6,%mm2
+	movq	40(%esp),%mm6
+	movq	%mm4,%mm1
+	movq	-56(%edx),%mm7
+	pxor	%mm6,%mm5
+	psrlq	$14,%mm1
+	movq	%mm4,24(%esp)
+	pand	%mm4,%mm5
+	psllq	$23,%mm4
+	paddq	%mm3,%mm2
+	movq	%mm1,%mm3
+	psrlq	$4,%mm1
+	pxor	%mm6,%mm5
+	pxor	%mm4,%mm3
+	psllq	$23,%mm4
+	pxor	%mm1,%mm3
+	movq	%mm2,56(%esp)
+	paddq	%mm5,%mm7
+	pxor	%mm4,%mm3
+	psrlq	$23,%mm1
+	paddq	48(%esp),%mm7
+	pxor	%mm1,%mm3
+	psllq	$4,%mm4
+	pxor	%mm4,%mm3
+	movq	16(%esp),%mm4
+	paddq	%mm7,%mm3
+	movq	%mm2,%mm5
+	psrlq	$28,%mm5
+	paddq	%mm3,%mm4
+	movq	%mm2,%mm6
+	movq	%mm5,%mm7
+	psllq	$25,%mm6
+	movq	(%esp),%mm1
+	psrlq	$6,%mm5
+	pxor	%mm6,%mm7
+	psllq	$5,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm2
+	psrlq	$5,%mm5
+	pxor	%mm6,%mm7
+	pand	%mm2,%mm0
+	psllq	$6,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm0
+	pxor	%mm7,%mm6
+	movq	24(%esp),%mm5
+	paddq	%mm6,%mm0
+	movq	32(%esp),%mm6
+	movdqa	%xmm7,-64(%edx)
+	movdqa	%xmm0,(%edx)
+	movdqa	80(%ebp),%xmm0
+	movdqa	%xmm6,%xmm7
+	movdqu	96(%ebx),%xmm6
+	paddq	%xmm5,%xmm0
+.byte	102,15,56,0,247
+	movq	%mm4,%mm1
+	movq	-48(%edx),%mm7
+	pxor	%mm6,%mm5
+	psrlq	$14,%mm1
+	movq	%mm4,16(%esp)
+	pand	%mm4,%mm5
+	psllq	$23,%mm4
+	paddq	%mm3,%mm0
+	movq	%mm1,%mm3
+	psrlq	$4,%mm1
+	pxor	%mm6,%mm5
+	pxor	%mm4,%mm3
+	psllq	$23,%mm4
+	pxor	%mm1,%mm3
+	movq	%mm0,48(%esp)
+	paddq	%mm5,%mm7
+	pxor	%mm4,%mm3
+	psrlq	$23,%mm1
+	paddq	40(%esp),%mm7
+	pxor	%mm1,%mm3
+	psllq	$4,%mm4
+	pxor	%mm4,%mm3
+	movq	8(%esp),%mm4
+	paddq	%mm7,%mm3
+	movq	%mm0,%mm5
+	psrlq	$28,%mm5
+	paddq	%mm3,%mm4
+	movq	%mm0,%mm6
+	movq	%mm5,%mm7
+	psllq	$25,%mm6
+	movq	56(%esp),%mm1
+	psrlq	$6,%mm5
+	pxor	%mm6,%mm7
+	psllq	$5,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm0
+	psrlq	$5,%mm5
+	pxor	%mm6,%mm7
+	pand	%mm0,%mm2
+	psllq	$6,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm2
+	pxor	%mm7,%mm6
+	movq	16(%esp),%mm5
+	paddq	%mm6,%mm2
+	movq	24(%esp),%mm6
+	movq	%mm4,%mm1
+	movq	-40(%edx),%mm7
+	pxor	%mm6,%mm5
+	psrlq	$14,%mm1
+	movq	%mm4,8(%esp)
+	pand	%mm4,%mm5
+	psllq	$23,%mm4
+	paddq	%mm3,%mm2
+	movq	%mm1,%mm3
+	psrlq	$4,%mm1
+	pxor	%mm6,%mm5
+	pxor	%mm4,%mm3
+	psllq	$23,%mm4
+	pxor	%mm1,%mm3
+	movq	%mm2,40(%esp)
+	paddq	%mm5,%mm7
+	pxor	%mm4,%mm3
+	psrlq	$23,%mm1
+	paddq	32(%esp),%mm7
+	pxor	%mm1,%mm3
+	psllq	$4,%mm4
+	pxor	%mm4,%mm3
+	movq	(%esp),%mm4
+	paddq	%mm7,%mm3
+	movq	%mm2,%mm5
+	psrlq	$28,%mm5
+	paddq	%mm3,%mm4
+	movq	%mm2,%mm6
+	movq	%mm5,%mm7
+	psllq	$25,%mm6
+	movq	48(%esp),%mm1
+	psrlq	$6,%mm5
+	pxor	%mm6,%mm7
+	psllq	$5,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm2
+	psrlq	$5,%mm5
+	pxor	%mm6,%mm7
+	pand	%mm2,%mm0
+	psllq	$6,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm0
+	pxor	%mm7,%mm6
+	movq	8(%esp),%mm5
+	paddq	%mm6,%mm0
+	movq	16(%esp),%mm6
+	movdqa	%xmm0,-48(%edx)
+	movdqa	%xmm1,16(%edx)
+	movdqa	96(%ebp),%xmm1
+	movdqa	%xmm7,%xmm0
+	movdqu	112(%ebx),%xmm7
+	paddq	%xmm6,%xmm1
+.byte	102,15,56,0,248
+	movq	%mm4,%mm1
+	movq	-32(%edx),%mm7
+	pxor	%mm6,%mm5
+	psrlq	$14,%mm1
+	movq	%mm4,(%esp)
+	pand	%mm4,%mm5
+	psllq	$23,%mm4
+	paddq	%mm3,%mm0
+	movq	%mm1,%mm3
+	psrlq	$4,%mm1
+	pxor	%mm6,%mm5
+	pxor	%mm4,%mm3
+	psllq	$23,%mm4
+	pxor	%mm1,%mm3
+	movq	%mm0,32(%esp)
+	paddq	%mm5,%mm7
+	pxor	%mm4,%mm3
+	psrlq	$23,%mm1
+	paddq	24(%esp),%mm7
+	pxor	%mm1,%mm3
+	psllq	$4,%mm4
+	pxor	%mm4,%mm3
+	movq	56(%esp),%mm4
+	paddq	%mm7,%mm3
+	movq	%mm0,%mm5
+	psrlq	$28,%mm5
+	paddq	%mm3,%mm4
+	movq	%mm0,%mm6
+	movq	%mm5,%mm7
+	psllq	$25,%mm6
+	movq	40(%esp),%mm1
+	psrlq	$6,%mm5
+	pxor	%mm6,%mm7
+	psllq	$5,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm0
+	psrlq	$5,%mm5
+	pxor	%mm6,%mm7
+	pand	%mm0,%mm2
+	psllq	$6,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm2
+	pxor	%mm7,%mm6
+	movq	(%esp),%mm5
+	paddq	%mm6,%mm2
+	movq	8(%esp),%mm6
+	movq	%mm4,%mm1
+	movq	-24(%edx),%mm7
+	pxor	%mm6,%mm5
+	psrlq	$14,%mm1
+	movq	%mm4,56(%esp)
+	pand	%mm4,%mm5
+	psllq	$23,%mm4
+	paddq	%mm3,%mm2
+	movq	%mm1,%mm3
+	psrlq	$4,%mm1
+	pxor	%mm6,%mm5
+	pxor	%mm4,%mm3
+	psllq	$23,%mm4
+	pxor	%mm1,%mm3
+	movq	%mm2,24(%esp)
+	paddq	%mm5,%mm7
+	pxor	%mm4,%mm3
+	psrlq	$23,%mm1
+	paddq	16(%esp),%mm7
+	pxor	%mm1,%mm3
+	psllq	$4,%mm4
+	pxor	%mm4,%mm3
+	movq	48(%esp),%mm4
+	paddq	%mm7,%mm3
+	movq	%mm2,%mm5
+	psrlq	$28,%mm5
+	paddq	%mm3,%mm4
+	movq	%mm2,%mm6
+	movq	%mm5,%mm7
+	psllq	$25,%mm6
+	movq	32(%esp),%mm1
+	psrlq	$6,%mm5
+	pxor	%mm6,%mm7
+	psllq	$5,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm2
+	psrlq	$5,%mm5
+	pxor	%mm6,%mm7
+	pand	%mm2,%mm0
+	psllq	$6,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm0
+	pxor	%mm7,%mm6
+	movq	56(%esp),%mm5
+	paddq	%mm6,%mm0
+	movq	(%esp),%mm6
+	movdqa	%xmm1,-32(%edx)
+	movdqa	%xmm2,32(%edx)
+	movdqa	112(%ebp),%xmm2
+	movdqa	(%edx),%xmm0
+	paddq	%xmm7,%xmm2
+	movq	%mm4,%mm1
+	movq	-16(%edx),%mm7
+	pxor	%mm6,%mm5
+	psrlq	$14,%mm1
+	movq	%mm4,48(%esp)
+	pand	%mm4,%mm5
+	psllq	$23,%mm4
+	paddq	%mm3,%mm0
+	movq	%mm1,%mm3
+	psrlq	$4,%mm1
+	pxor	%mm6,%mm5
+	pxor	%mm4,%mm3
+	psllq	$23,%mm4
+	pxor	%mm1,%mm3
+	movq	%mm0,16(%esp)
+	paddq	%mm5,%mm7
+	pxor	%mm4,%mm3
+	psrlq	$23,%mm1
+	paddq	8(%esp),%mm7
+	pxor	%mm1,%mm3
+	psllq	$4,%mm4
+	pxor	%mm4,%mm3
+	movq	40(%esp),%mm4
+	paddq	%mm7,%mm3
+	movq	%mm0,%mm5
+	psrlq	$28,%mm5
+	paddq	%mm3,%mm4
+	movq	%mm0,%mm6
+	movq	%mm5,%mm7
+	psllq	$25,%mm6
+	movq	24(%esp),%mm1
+	psrlq	$6,%mm5
+	pxor	%mm6,%mm7
+	psllq	$5,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm0
+	psrlq	$5,%mm5
+	pxor	%mm6,%mm7
+	pand	%mm0,%mm2
+	psllq	$6,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm2
+	pxor	%mm7,%mm6
+	movq	48(%esp),%mm5
+	paddq	%mm6,%mm2
+	movq	56(%esp),%mm6
+	movq	%mm4,%mm1
+	movq	-8(%edx),%mm7
+	pxor	%mm6,%mm5
+	psrlq	$14,%mm1
+	movq	%mm4,40(%esp)
+	pand	%mm4,%mm5
+	psllq	$23,%mm4
+	paddq	%mm3,%mm2
+	movq	%mm1,%mm3
+	psrlq	$4,%mm1
+	pxor	%mm6,%mm5
+	pxor	%mm4,%mm3
+	psllq	$23,%mm4
+	pxor	%mm1,%mm3
+	movq	%mm2,8(%esp)
+	paddq	%mm5,%mm7
+	pxor	%mm4,%mm3
+	psrlq	$23,%mm1
+	paddq	(%esp),%mm7
+	pxor	%mm1,%mm3
+	psllq	$4,%mm4
+	pxor	%mm4,%mm3
+	movq	32(%esp),%mm4
+	paddq	%mm7,%mm3
+	movq	%mm2,%mm5
+	psrlq	$28,%mm5
+	paddq	%mm3,%mm4
+	movq	%mm2,%mm6
+	movq	%mm5,%mm7
+	psllq	$25,%mm6
+	movq	16(%esp),%mm1
+	psrlq	$6,%mm5
+	pxor	%mm6,%mm7
+	psllq	$5,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm2
+	psrlq	$5,%mm5
+	pxor	%mm6,%mm7
+	pand	%mm2,%mm0
+	psllq	$6,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm0
+	pxor	%mm7,%mm6
+	movq	40(%esp),%mm5
+	paddq	%mm6,%mm0
+	movq	48(%esp),%mm6
+	movdqa	%xmm2,-16(%edx)
+	movq	8(%esp),%mm1
+	paddq	%mm3,%mm0
+	movq	24(%esp),%mm3
+	movq	56(%esp),%mm7
+	pxor	%mm1,%mm2
+	paddq	(%esi),%mm0
+	paddq	8(%esi),%mm1
+	paddq	16(%esi),%mm2
+	paddq	24(%esi),%mm3
+	paddq	32(%esi),%mm4
+	paddq	40(%esi),%mm5
+	paddq	48(%esi),%mm6
+	paddq	56(%esi),%mm7
+	movq	%mm0,(%esi)
+	movq	%mm1,8(%esi)
+	movq	%mm2,16(%esi)
+	movq	%mm3,24(%esi)
+	movq	%mm4,32(%esi)
+	movq	%mm5,40(%esi)
+	movq	%mm6,48(%esi)
+	movq	%mm7,56(%esi)
+	cmpl	%eax,%edi
+	jb	.L007loop_ssse3
+	movl	76(%edx),%esp
+	emms
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.align	16
+.L002loop_x86:
+	movl	(%edi),%eax
+	movl	4(%edi),%ebx
+	movl	8(%edi),%ecx
+	movl	12(%edi),%edx
+	bswap	%eax
+	bswap	%ebx
+	bswap	%ecx
+	bswap	%edx
+	pushl	%eax
+	pushl	%ebx
+	pushl	%ecx
+	pushl	%edx
+	movl	16(%edi),%eax
+	movl	20(%edi),%ebx
+	movl	24(%edi),%ecx
+	movl	28(%edi),%edx
+	bswap	%eax
+	bswap	%ebx
+	bswap	%ecx
+	bswap	%edx
+	pushl	%eax
+	pushl	%ebx
+	pushl	%ecx
+	pushl	%edx
+	movl	32(%edi),%eax
+	movl	36(%edi),%ebx
+	movl	40(%edi),%ecx
+	movl	44(%edi),%edx
+	bswap	%eax
+	bswap	%ebx
+	bswap	%ecx
+	bswap	%edx
+	pushl	%eax
+	pushl	%ebx
+	pushl	%ecx
+	pushl	%edx
+	movl	48(%edi),%eax
+	movl	52(%edi),%ebx
+	movl	56(%edi),%ecx
+	movl	60(%edi),%edx
+	bswap	%eax
+	bswap	%ebx
+	bswap	%ecx
+	bswap	%edx
+	pushl	%eax
+	pushl	%ebx
+	pushl	%ecx
+	pushl	%edx
+	movl	64(%edi),%eax
+	movl	68(%edi),%ebx
+	movl	72(%edi),%ecx
+	movl	76(%edi),%edx
+	bswap	%eax
+	bswap	%ebx
+	bswap	%ecx
+	bswap	%edx
+	pushl	%eax
+	pushl	%ebx
+	pushl	%ecx
+	pushl	%edx
+	movl	80(%edi),%eax
+	movl	84(%edi),%ebx
+	movl	88(%edi),%ecx
+	movl	92(%edi),%edx
+	bswap	%eax
+	bswap	%ebx
+	bswap	%ecx
+	bswap	%edx
+	pushl	%eax
+	pushl	%ebx
+	pushl	%ecx
+	pushl	%edx
+	movl	96(%edi),%eax
+	movl	100(%edi),%ebx
+	movl	104(%edi),%ecx
+	movl	108(%edi),%edx
+	bswap	%eax
+	bswap	%ebx
+	bswap	%ecx
+	bswap	%edx
+	pushl	%eax
+	pushl	%ebx
+	pushl	%ecx
+	pushl	%edx
+	movl	112(%edi),%eax
+	movl	116(%edi),%ebx
+	movl	120(%edi),%ecx
+	movl	124(%edi),%edx
+	bswap	%eax
+	bswap	%ebx
+	bswap	%ecx
+	bswap	%edx
+	pushl	%eax
+	pushl	%ebx
+	pushl	%ecx
+	pushl	%edx
+	addl	$128,%edi
+	subl	$72,%esp
+	movl	%edi,204(%esp)
+	leal	8(%esp),%edi
+	movl	$16,%ecx
+.long	2784229001
+.align	16
+.L00900_15_x86:
+	movl	40(%esp),%ecx
+	movl	44(%esp),%edx
+	movl	%ecx,%esi
+	shrl	$9,%ecx
+	movl	%edx,%edi
+	shrl	$9,%edx
+	movl	%ecx,%ebx
+	shll	$14,%esi
+	movl	%edx,%eax
+	shll	$14,%edi
+	xorl	%esi,%ebx
+	shrl	$5,%ecx
+	xorl	%edi,%eax
+	shrl	$5,%edx
+	xorl	%ecx,%eax
+	shll	$4,%esi
+	xorl	%edx,%ebx
+	shll	$4,%edi
+	xorl	%esi,%ebx
+	shrl	$4,%ecx
+	xorl	%edi,%eax
+	shrl	$4,%edx
+	xorl	%ecx,%eax
+	shll	$5,%esi
+	xorl	%edx,%ebx
+	shll	$5,%edi
+	xorl	%esi,%eax
+	xorl	%edi,%ebx
+	movl	48(%esp),%ecx
+	movl	52(%esp),%edx
+	movl	56(%esp),%esi
+	movl	60(%esp),%edi
+	addl	64(%esp),%eax
+	adcl	68(%esp),%ebx
+	xorl	%esi,%ecx
+	xorl	%edi,%edx
+	andl	40(%esp),%ecx
+	andl	44(%esp),%edx
+	addl	192(%esp),%eax
+	adcl	196(%esp),%ebx
+	xorl	%esi,%ecx
+	xorl	%edi,%edx
+	movl	(%ebp),%esi
+	movl	4(%ebp),%edi
+	addl	%ecx,%eax
+	adcl	%edx,%ebx
+	movl	32(%esp),%ecx
+	movl	36(%esp),%edx
+	addl	%esi,%eax
+	adcl	%edi,%ebx
+	movl	%eax,(%esp)
+	movl	%ebx,4(%esp)
+	addl	%ecx,%eax
+	adcl	%edx,%ebx
+	movl	8(%esp),%ecx
+	movl	12(%esp),%edx
+	movl	%eax,32(%esp)
+	movl	%ebx,36(%esp)
+	movl	%ecx,%esi
+	shrl	$2,%ecx
+	movl	%edx,%edi
+	shrl	$2,%edx
+	movl	%ecx,%ebx
+	shll	$4,%esi
+	movl	%edx,%eax
+	shll	$4,%edi
+	xorl	%esi,%ebx
+	shrl	$5,%ecx
+	xorl	%edi,%eax
+	shrl	$5,%edx
+	xorl	%ecx,%ebx
+	shll	$21,%esi
+	xorl	%edx,%eax
+	shll	$21,%edi
+	xorl	%esi,%eax
+	shrl	$21,%ecx
+	xorl	%edi,%ebx
+	shrl	$21,%edx
+	xorl	%ecx,%eax
+	shll	$5,%esi
+	xorl	%edx,%ebx
+	shll	$5,%edi
+	xorl	%esi,%eax
+	xorl	%edi,%ebx
+	movl	8(%esp),%ecx
+	movl	12(%esp),%edx
+	movl	16(%esp),%esi
+	movl	20(%esp),%edi
+	addl	(%esp),%eax
+	adcl	4(%esp),%ebx
+	orl	%esi,%ecx
+	orl	%edi,%edx
+	andl	24(%esp),%ecx
+	andl	28(%esp),%edx
+	andl	8(%esp),%esi
+	andl	12(%esp),%edi
+	orl	%esi,%ecx
+	orl	%edi,%edx
+	addl	%ecx,%eax
+	adcl	%edx,%ebx
+	movl	%eax,(%esp)
+	movl	%ebx,4(%esp)
+	movb	(%ebp),%dl
+	subl	$8,%esp
+	leal	8(%ebp),%ebp
+	cmpb	$148,%dl
+	jne	.L00900_15_x86
+.align	16
+.L01016_79_x86:
+	movl	312(%esp),%ecx
+	movl	316(%esp),%edx
+	movl	%ecx,%esi
+	shrl	$1,%ecx
+	movl	%edx,%edi
+	shrl	$1,%edx
+	movl	%ecx,%eax
+	shll	$24,%esi
+	movl	%edx,%ebx
+	shll	$24,%edi
+	xorl	%esi,%ebx
+	shrl	$6,%ecx
+	xorl	%edi,%eax
+	shrl	$6,%edx
+	xorl	%ecx,%eax
+	shll	$7,%esi
+	xorl	%edx,%ebx
+	shll	$1,%edi
+	xorl	%esi,%ebx
+	shrl	$1,%ecx
+	xorl	%edi,%eax
+	shrl	$1,%edx
+	xorl	%ecx,%eax
+	shll	$6,%edi
+	xorl	%edx,%ebx
+	xorl	%edi,%eax
+	movl	%eax,(%esp)
+	movl	%ebx,4(%esp)
+	movl	208(%esp),%ecx
+	movl	212(%esp),%edx
+	movl	%ecx,%esi
+	shrl	$6,%ecx
+	movl	%edx,%edi
+	shrl	$6,%edx
+	movl	%ecx,%eax
+	shll	$3,%esi
+	movl	%edx,%ebx
+	shll	$3,%edi
+	xorl	%esi,%eax
+	shrl	$13,%ecx
+	xorl	%edi,%ebx
+	shrl	$13,%edx
+	xorl	%ecx,%eax
+	shll	$10,%esi
+	xorl	%edx,%ebx
+	shll	$10,%edi
+	xorl	%esi,%ebx
+	shrl	$10,%ecx
+	xorl	%edi,%eax
+	shrl	$10,%edx
+	xorl	%ecx,%ebx
+	shll	$13,%edi
+	xorl	%edx,%eax
+	xorl	%edi,%eax
+	movl	320(%esp),%ecx
+	movl	324(%esp),%edx
+	addl	(%esp),%eax
+	adcl	4(%esp),%ebx
+	movl	248(%esp),%esi
+	movl	252(%esp),%edi
+	addl	%ecx,%eax
+	adcl	%edx,%ebx
+	addl	%esi,%eax
+	adcl	%edi,%ebx
+	movl	%eax,192(%esp)
+	movl	%ebx,196(%esp)
+	movl	40(%esp),%ecx
+	movl	44(%esp),%edx
+	movl	%ecx,%esi
+	shrl	$9,%ecx
+	movl	%edx,%edi
+	shrl	$9,%edx
+	movl	%ecx,%ebx
+	shll	$14,%esi
+	movl	%edx,%eax
+	shll	$14,%edi
+	xorl	%esi,%ebx
+	shrl	$5,%ecx
+	xorl	%edi,%eax
+	shrl	$5,%edx
+	xorl	%ecx,%eax
+	shll	$4,%esi
+	xorl	%edx,%ebx
+	shll	$4,%edi
+	xorl	%esi,%ebx
+	shrl	$4,%ecx
+	xorl	%edi,%eax
+	shrl	$4,%edx
+	xorl	%ecx,%eax
+	shll	$5,%esi
+	xorl	%edx,%ebx
+	shll	$5,%edi
+	xorl	%esi,%eax
+	xorl	%edi,%ebx
+	movl	48(%esp),%ecx
+	movl	52(%esp),%edx
+	movl	56(%esp),%esi
+	movl	60(%esp),%edi
+	addl	64(%esp),%eax
+	adcl	68(%esp),%ebx
+	xorl	%esi,%ecx
+	xorl	%edi,%edx
+	andl	40(%esp),%ecx
+	andl	44(%esp),%edx
+	addl	192(%esp),%eax
+	adcl	196(%esp),%ebx
+	xorl	%esi,%ecx
+	xorl	%edi,%edx
+	movl	(%ebp),%esi
+	movl	4(%ebp),%edi
+	addl	%ecx,%eax
+	adcl	%edx,%ebx
+	movl	32(%esp),%ecx
+	movl	36(%esp),%edx
+	addl	%esi,%eax
+	adcl	%edi,%ebx
+	movl	%eax,(%esp)
+	movl	%ebx,4(%esp)
+	addl	%ecx,%eax
+	adcl	%edx,%ebx
+	movl	8(%esp),%ecx
+	movl	12(%esp),%edx
+	movl	%eax,32(%esp)
+	movl	%ebx,36(%esp)
+	movl	%ecx,%esi
+	shrl	$2,%ecx
+	movl	%edx,%edi
+	shrl	$2,%edx
+	movl	%ecx,%ebx
+	shll	$4,%esi
+	movl	%edx,%eax
+	shll	$4,%edi
+	xorl	%esi,%ebx
+	shrl	$5,%ecx
+	xorl	%edi,%eax
+	shrl	$5,%edx
+	xorl	%ecx,%ebx
+	shll	$21,%esi
+	xorl	%edx,%eax
+	shll	$21,%edi
+	xorl	%esi,%eax
+	shrl	$21,%ecx
+	xorl	%edi,%ebx
+	shrl	$21,%edx
+	xorl	%ecx,%eax
+	shll	$5,%esi
+	xorl	%edx,%ebx
+	shll	$5,%edi
+	xorl	%esi,%eax
+	xorl	%edi,%ebx
+	movl	8(%esp),%ecx
+	movl	12(%esp),%edx
+	movl	16(%esp),%esi
+	movl	20(%esp),%edi
+	addl	(%esp),%eax
+	adcl	4(%esp),%ebx
+	orl	%esi,%ecx
+	orl	%edi,%edx
+	andl	24(%esp),%ecx
+	andl	28(%esp),%edx
+	andl	8(%esp),%esi
+	andl	12(%esp),%edi
+	orl	%esi,%ecx
+	orl	%edi,%edx
+	addl	%ecx,%eax
+	adcl	%edx,%ebx
+	movl	%eax,(%esp)
+	movl	%ebx,4(%esp)
+	movb	(%ebp),%dl
+	subl	$8,%esp
+	leal	8(%ebp),%ebp
+	cmpb	$23,%dl
+	jne	.L01016_79_x86
+	movl	840(%esp),%esi
+	movl	844(%esp),%edi
+	movl	(%esi),%eax
+	movl	4(%esi),%ebx
+	movl	8(%esi),%ecx
+	movl	12(%esi),%edx
+	addl	8(%esp),%eax
+	adcl	12(%esp),%ebx
+	movl	%eax,(%esi)
+	movl	%ebx,4(%esi)
+	addl	16(%esp),%ecx
+	adcl	20(%esp),%edx
+	movl	%ecx,8(%esi)
+	movl	%edx,12(%esi)
+	movl	16(%esi),%eax
+	movl	20(%esi),%ebx
+	movl	24(%esi),%ecx
+	movl	28(%esi),%edx
+	addl	24(%esp),%eax
+	adcl	28(%esp),%ebx
+	movl	%eax,16(%esi)
+	movl	%ebx,20(%esi)
+	addl	32(%esp),%ecx
+	adcl	36(%esp),%edx
+	movl	%ecx,24(%esi)
+	movl	%edx,28(%esi)
+	movl	32(%esi),%eax
+	movl	36(%esi),%ebx
+	movl	40(%esi),%ecx
+	movl	44(%esi),%edx
+	addl	40(%esp),%eax
+	adcl	44(%esp),%ebx
+	movl	%eax,32(%esi)
+	movl	%ebx,36(%esi)
+	addl	48(%esp),%ecx
+	adcl	52(%esp),%edx
+	movl	%ecx,40(%esi)
+	movl	%edx,44(%esi)
+	movl	48(%esi),%eax
+	movl	52(%esi),%ebx
+	movl	56(%esi),%ecx
+	movl	60(%esi),%edx
+	addl	56(%esp),%eax
+	adcl	60(%esp),%ebx
+	movl	%eax,48(%esi)
+	movl	%ebx,52(%esi)
+	addl	64(%esp),%ecx
+	adcl	68(%esp),%edx
+	movl	%ecx,56(%esi)
+	movl	%edx,60(%esi)
+	addl	$840,%esp
+	subl	$640,%ebp
+	cmpl	8(%esp),%edi
+	jb	.L002loop_x86
+	movl	12(%esp),%esp
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.align	64
+.L001K512:
+.long	3609767458,1116352408
+.long	602891725,1899447441
+.long	3964484399,3049323471
+.long	2173295548,3921009573
+.long	4081628472,961987163
+.long	3053834265,1508970993
+.long	2937671579,2453635748
+.long	3664609560,2870763221
+.long	2734883394,3624381080
+.long	1164996542,310598401
+.long	1323610764,607225278
+.long	3590304994,1426881987
+.long	4068182383,1925078388
+.long	991336113,2162078206
+.long	633803317,2614888103
+.long	3479774868,3248222580
+.long	2666613458,3835390401
+.long	944711139,4022224774
+.long	2341262773,264347078
+.long	2007800933,604807628
+.long	1495990901,770255983
+.long	1856431235,1249150122
+.long	3175218132,1555081692
+.long	2198950837,1996064986
+.long	3999719339,2554220882
+.long	766784016,2821834349
+.long	2566594879,2952996808
+.long	3203337956,3210313671
+.long	1034457026,3336571891
+.long	2466948901,3584528711
+.long	3758326383,113926993
+.long	168717936,338241895
+.long	1188179964,666307205
+.long	1546045734,773529912
+.long	1522805485,1294757372
+.long	2643833823,1396182291
+.long	2343527390,1695183700
+.long	1014477480,1986661051
+.long	1206759142,2177026350
+.long	344077627,2456956037
+.long	1290863460,2730485921
+.long	3158454273,2820302411
+.long	3505952657,3259730800
+.long	106217008,3345764771
+.long	3606008344,3516065817
+.long	1432725776,3600352804
+.long	1467031594,4094571909
+.long	851169720,275423344
+.long	3100823752,430227734
+.long	1363258195,506948616
+.long	3750685593,659060556
+.long	3785050280,883997877
+.long	3318307427,958139571
+.long	3812723403,1322822218
+.long	2003034995,1537002063
+.long	3602036899,1747873779
+.long	1575990012,1955562222
+.long	1125592928,2024104815
+.long	2716904306,2227730452
+.long	442776044,2361852424
+.long	593698344,2428436474
+.long	3733110249,2756734187
+.long	2999351573,3204031479
+.long	3815920427,3329325298
+.long	3928383900,3391569614
+.long	566280711,3515267271
+.long	3454069534,3940187606
+.long	4000239992,4118630271
+.long	1914138554,116418474
+.long	2731055270,174292421
+.long	3203993006,289380356
+.long	320620315,460393269
+.long	587496836,685471733
+.long	1086792851,852142971
+.long	365543100,1017036298
+.long	2618297676,1126000580
+.long	3409855158,1288033470
+.long	4234509866,1501505948
+.long	987167468,1607167915
+.long	1246189591,1816402316
+.long	67438087,66051
+.long	202182159,134810123
+.size	sha512_block_data_order,.-.L_sha512_block_data_order_begin
+.byte	83,72,65,53,49,50,32,98,108,111,99,107,32,116,114,97
+.byte	110,115,102,111,114,109,32,102,111,114,32,120,56,54,44,32
+.byte	67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97
+.byte	112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103
+.byte	62,0
+#endif
diff --git a/third_party/boringssl/linux-x86_64/crypto/aes/aes-x86_64.S b/third_party/boringssl/linux-x86_64/crypto/aes/aes-x86_64.S
new file mode 100644
index 0000000..5f4b057
--- /dev/null
+++ b/third_party/boringssl/linux-x86_64/crypto/aes/aes-x86_64.S
@@ -0,0 +1,2536 @@
+#if defined(__x86_64__)
+.text	
+.type	_x86_64_AES_encrypt,@function
+.align	16
+_x86_64_AES_encrypt:
+	xorl	0(%r15),%eax
+	xorl	4(%r15),%ebx
+	xorl	8(%r15),%ecx
+	xorl	12(%r15),%edx
+
+	movl	240(%r15),%r13d
+	subl	$1,%r13d
+	jmp	.Lenc_loop
+.align	16
+.Lenc_loop:
+
+	movzbl	%al,%esi
+	movzbl	%bl,%edi
+	movzbl	%cl,%ebp
+	movl	0(%r14,%rsi,8),%r10d
+	movl	0(%r14,%rdi,8),%r11d
+	movl	0(%r14,%rbp,8),%r12d
+
+	movzbl	%bh,%esi
+	movzbl	%ch,%edi
+	movzbl	%dl,%ebp
+	xorl	3(%r14,%rsi,8),%r10d
+	xorl	3(%r14,%rdi,8),%r11d
+	movl	0(%r14,%rbp,8),%r8d
+
+	movzbl	%dh,%esi
+	shrl	$16,%ecx
+	movzbl	%ah,%ebp
+	xorl	3(%r14,%rsi,8),%r12d
+	shrl	$16,%edx
+	xorl	3(%r14,%rbp,8),%r8d
+
+	shrl	$16,%ebx
+	leaq	16(%r15),%r15
+	shrl	$16,%eax
+
+	movzbl	%cl,%esi
+	movzbl	%dl,%edi
+	movzbl	%al,%ebp
+	xorl	2(%r14,%rsi,8),%r10d
+	xorl	2(%r14,%rdi,8),%r11d
+	xorl	2(%r14,%rbp,8),%r12d
+
+	movzbl	%dh,%esi
+	movzbl	%ah,%edi
+	movzbl	%bl,%ebp
+	xorl	1(%r14,%rsi,8),%r10d
+	xorl	1(%r14,%rdi,8),%r11d
+	xorl	2(%r14,%rbp,8),%r8d
+
+	movl	12(%r15),%edx
+	movzbl	%bh,%edi
+	movzbl	%ch,%ebp
+	movl	0(%r15),%eax
+	xorl	1(%r14,%rdi,8),%r12d
+	xorl	1(%r14,%rbp,8),%r8d
+
+	movl	4(%r15),%ebx
+	movl	8(%r15),%ecx
+	xorl	%r10d,%eax
+	xorl	%r11d,%ebx
+	xorl	%r12d,%ecx
+	xorl	%r8d,%edx
+	subl	$1,%r13d
+	jnz	.Lenc_loop
+	movzbl	%al,%esi
+	movzbl	%bl,%edi
+	movzbl	%cl,%ebp
+	movzbl	2(%r14,%rsi,8),%r10d
+	movzbl	2(%r14,%rdi,8),%r11d
+	movzbl	2(%r14,%rbp,8),%r12d
+
+	movzbl	%dl,%esi
+	movzbl	%bh,%edi
+	movzbl	%ch,%ebp
+	movzbl	2(%r14,%rsi,8),%r8d
+	movl	0(%r14,%rdi,8),%edi
+	movl	0(%r14,%rbp,8),%ebp
+
+	andl	$65280,%edi
+	andl	$65280,%ebp
+
+	xorl	%edi,%r10d
+	xorl	%ebp,%r11d
+	shrl	$16,%ecx
+
+	movzbl	%dh,%esi
+	movzbl	%ah,%edi
+	shrl	$16,%edx
+	movl	0(%r14,%rsi,8),%esi
+	movl	0(%r14,%rdi,8),%edi
+
+	andl	$65280,%esi
+	andl	$65280,%edi
+	shrl	$16,%ebx
+	xorl	%esi,%r12d
+	xorl	%edi,%r8d
+	shrl	$16,%eax
+
+	movzbl	%cl,%esi
+	movzbl	%dl,%edi
+	movzbl	%al,%ebp
+	movl	0(%r14,%rsi,8),%esi
+	movl	0(%r14,%rdi,8),%edi
+	movl	0(%r14,%rbp,8),%ebp
+
+	andl	$16711680,%esi
+	andl	$16711680,%edi
+	andl	$16711680,%ebp
+
+	xorl	%esi,%r10d
+	xorl	%edi,%r11d
+	xorl	%ebp,%r12d
+
+	movzbl	%bl,%esi
+	movzbl	%dh,%edi
+	movzbl	%ah,%ebp
+	movl	0(%r14,%rsi,8),%esi
+	movl	2(%r14,%rdi,8),%edi
+	movl	2(%r14,%rbp,8),%ebp
+
+	andl	$16711680,%esi
+	andl	$4278190080,%edi
+	andl	$4278190080,%ebp
+
+	xorl	%esi,%r8d
+	xorl	%edi,%r10d
+	xorl	%ebp,%r11d
+
+	movzbl	%bh,%esi
+	movzbl	%ch,%edi
+	movl	16+12(%r15),%edx
+	movl	2(%r14,%rsi,8),%esi
+	movl	2(%r14,%rdi,8),%edi
+	movl	16+0(%r15),%eax
+
+	andl	$4278190080,%esi
+	andl	$4278190080,%edi
+
+	xorl	%esi,%r12d
+	xorl	%edi,%r8d
+
+	movl	16+4(%r15),%ebx
+	movl	16+8(%r15),%ecx
+	xorl	%r10d,%eax
+	xorl	%r11d,%ebx
+	xorl	%r12d,%ecx
+	xorl	%r8d,%edx
+.byte	0xf3,0xc3
+.size	_x86_64_AES_encrypt,.-_x86_64_AES_encrypt
+.type	_x86_64_AES_encrypt_compact,@function
+.align	16
+_x86_64_AES_encrypt_compact:
+	leaq	128(%r14),%r8
+	movl	0-128(%r8),%edi
+	movl	32-128(%r8),%ebp
+	movl	64-128(%r8),%r10d
+	movl	96-128(%r8),%r11d
+	movl	128-128(%r8),%edi
+	movl	160-128(%r8),%ebp
+	movl	192-128(%r8),%r10d
+	movl	224-128(%r8),%r11d
+	jmp	.Lenc_loop_compact
+.align	16
+.Lenc_loop_compact:
+	xorl	0(%r15),%eax
+	xorl	4(%r15),%ebx
+	xorl	8(%r15),%ecx
+	xorl	12(%r15),%edx
+	leaq	16(%r15),%r15
+	movzbl	%al,%r10d
+	movzbl	%bl,%r11d
+	movzbl	%cl,%r12d
+	movzbl	%dl,%r8d
+	movzbl	%bh,%esi
+	movzbl	%ch,%edi
+	shrl	$16,%ecx
+	movzbl	%dh,%ebp
+	movzbl	(%r14,%r10,1),%r10d
+	movzbl	(%r14,%r11,1),%r11d
+	movzbl	(%r14,%r12,1),%r12d
+	movzbl	(%r14,%r8,1),%r8d
+
+	movzbl	(%r14,%rsi,1),%r9d
+	movzbl	%ah,%esi
+	movzbl	(%r14,%rdi,1),%r13d
+	movzbl	%cl,%edi
+	movzbl	(%r14,%rbp,1),%ebp
+	movzbl	(%r14,%rsi,1),%esi
+
+	shll	$8,%r9d
+	shrl	$16,%edx
+	shll	$8,%r13d
+	xorl	%r9d,%r10d
+	shrl	$16,%eax
+	movzbl	%dl,%r9d
+	shrl	$16,%ebx
+	xorl	%r13d,%r11d
+	shll	$8,%ebp
+	movzbl	%al,%r13d
+	movzbl	(%r14,%rdi,1),%edi
+	xorl	%ebp,%r12d
+
+	shll	$8,%esi
+	movzbl	%bl,%ebp
+	shll	$16,%edi
+	xorl	%esi,%r8d
+	movzbl	(%r14,%r9,1),%r9d
+	movzbl	%dh,%esi
+	movzbl	(%r14,%r13,1),%r13d
+	xorl	%edi,%r10d
+
+	shrl	$8,%ecx
+	movzbl	%ah,%edi
+	shll	$16,%r9d
+	shrl	$8,%ebx
+	shll	$16,%r13d
+	xorl	%r9d,%r11d
+	movzbl	(%r14,%rbp,1),%ebp
+	movzbl	(%r14,%rsi,1),%esi
+	movzbl	(%r14,%rdi,1),%edi
+	movzbl	(%r14,%rcx,1),%edx
+	movzbl	(%r14,%rbx,1),%ecx
+
+	shll	$16,%ebp
+	xorl	%r13d,%r12d
+	shll	$24,%esi
+	xorl	%ebp,%r8d
+	shll	$24,%edi
+	xorl	%esi,%r10d
+	shll	$24,%edx
+	xorl	%edi,%r11d
+	shll	$24,%ecx
+	movl	%r10d,%eax
+	movl	%r11d,%ebx
+	xorl	%r12d,%ecx
+	xorl	%r8d,%edx
+	cmpq	16(%rsp),%r15
+	je	.Lenc_compact_done
+	movl	$2155905152,%r10d
+	movl	$2155905152,%r11d
+	andl	%eax,%r10d
+	andl	%ebx,%r11d
+	movl	%r10d,%esi
+	movl	%r11d,%edi
+	shrl	$7,%r10d
+	leal	(%rax,%rax,1),%r8d
+	shrl	$7,%r11d
+	leal	(%rbx,%rbx,1),%r9d
+	subl	%r10d,%esi
+	subl	%r11d,%edi
+	andl	$4278124286,%r8d
+	andl	$4278124286,%r9d
+	andl	$454761243,%esi
+	andl	$454761243,%edi
+	movl	%eax,%r10d
+	movl	%ebx,%r11d
+	xorl	%esi,%r8d
+	xorl	%edi,%r9d
+
+	xorl	%r8d,%eax
+	xorl	%r9d,%ebx
+	movl	$2155905152,%r12d
+	roll	$24,%eax
+	movl	$2155905152,%ebp
+	roll	$24,%ebx
+	andl	%ecx,%r12d
+	andl	%edx,%ebp
+	xorl	%r8d,%eax
+	xorl	%r9d,%ebx
+	movl	%r12d,%esi
+	rorl	$16,%r10d
+	movl	%ebp,%edi
+	rorl	$16,%r11d
+	leal	(%rcx,%rcx,1),%r8d
+	shrl	$7,%r12d
+	xorl	%r10d,%eax
+	shrl	$7,%ebp
+	xorl	%r11d,%ebx
+	rorl	$8,%r10d
+	leal	(%rdx,%rdx,1),%r9d
+	rorl	$8,%r11d
+	subl	%r12d,%esi
+	subl	%ebp,%edi
+	xorl	%r10d,%eax
+	xorl	%r11d,%ebx
+
+	andl	$4278124286,%r8d
+	andl	$4278124286,%r9d
+	andl	$454761243,%esi
+	andl	$454761243,%edi
+	movl	%ecx,%r12d
+	movl	%edx,%ebp
+	xorl	%esi,%r8d
+	xorl	%edi,%r9d
+
+	rorl	$16,%r12d
+	xorl	%r8d,%ecx
+	rorl	$16,%ebp
+	xorl	%r9d,%edx
+	roll	$24,%ecx
+	movl	0(%r14),%esi
+	roll	$24,%edx
+	xorl	%r8d,%ecx
+	movl	64(%r14),%edi
+	xorl	%r9d,%edx
+	movl	128(%r14),%r8d
+	xorl	%r12d,%ecx
+	rorl	$8,%r12d
+	xorl	%ebp,%edx
+	rorl	$8,%ebp
+	xorl	%r12d,%ecx
+	movl	192(%r14),%r9d
+	xorl	%ebp,%edx
+	jmp	.Lenc_loop_compact
+.align	16
+.Lenc_compact_done:
+	xorl	0(%r15),%eax
+	xorl	4(%r15),%ebx
+	xorl	8(%r15),%ecx
+	xorl	12(%r15),%edx
+.byte	0xf3,0xc3
+.size	_x86_64_AES_encrypt_compact,.-_x86_64_AES_encrypt_compact
+.align	16
+.globl	asm_AES_encrypt
+.hidden asm_AES_encrypt
+.type	asm_AES_encrypt,@function
+.hidden	asm_AES_encrypt
+asm_AES_encrypt:
+	pushq	%rbx
+	pushq	%rbp
+	pushq	%r12
+	pushq	%r13
+	pushq	%r14
+	pushq	%r15
+
+
+	movq	%rsp,%r10
+	leaq	-63(%rdx),%rcx
+	andq	$-64,%rsp
+	subq	%rsp,%rcx
+	negq	%rcx
+	andq	$960,%rcx
+	subq	%rcx,%rsp
+	subq	$32,%rsp
+
+	movq	%rsi,16(%rsp)
+	movq	%r10,24(%rsp)
+.Lenc_prologue:
+
+	movq	%rdx,%r15
+	movl	240(%r15),%r13d
+
+	movl	0(%rdi),%eax
+	movl	4(%rdi),%ebx
+	movl	8(%rdi),%ecx
+	movl	12(%rdi),%edx
+
+	shll	$4,%r13d
+	leaq	(%r15,%r13,1),%rbp
+	movq	%r15,(%rsp)
+	movq	%rbp,8(%rsp)
+
+
+	leaq	.LAES_Te+2048(%rip),%r14
+	leaq	768(%rsp),%rbp
+	subq	%r14,%rbp
+	andq	$768,%rbp
+	leaq	(%r14,%rbp,1),%r14
+
+	call	_x86_64_AES_encrypt_compact
+
+	movq	16(%rsp),%r9
+	movq	24(%rsp),%rsi
+	movl	%eax,0(%r9)
+	movl	%ebx,4(%r9)
+	movl	%ecx,8(%r9)
+	movl	%edx,12(%r9)
+
+	movq	(%rsi),%r15
+	movq	8(%rsi),%r14
+	movq	16(%rsi),%r13
+	movq	24(%rsi),%r12
+	movq	32(%rsi),%rbp
+	movq	40(%rsi),%rbx
+	leaq	48(%rsi),%rsp
+.Lenc_epilogue:
+	.byte	0xf3,0xc3
+.size	asm_AES_encrypt,.-asm_AES_encrypt
+.type	_x86_64_AES_decrypt,@function
+.align	16
+_x86_64_AES_decrypt:
+	xorl	0(%r15),%eax
+	xorl	4(%r15),%ebx
+	xorl	8(%r15),%ecx
+	xorl	12(%r15),%edx
+
+	movl	240(%r15),%r13d
+	subl	$1,%r13d
+	jmp	.Ldec_loop
+.align	16
+.Ldec_loop:
+
+	movzbl	%al,%esi
+	movzbl	%bl,%edi
+	movzbl	%cl,%ebp
+	movl	0(%r14,%rsi,8),%r10d
+	movl	0(%r14,%rdi,8),%r11d
+	movl	0(%r14,%rbp,8),%r12d
+
+	movzbl	%dh,%esi
+	movzbl	%ah,%edi
+	movzbl	%dl,%ebp
+	xorl	3(%r14,%rsi,8),%r10d
+	xorl	3(%r14,%rdi,8),%r11d
+	movl	0(%r14,%rbp,8),%r8d
+
+	movzbl	%bh,%esi
+	shrl	$16,%eax
+	movzbl	%ch,%ebp
+	xorl	3(%r14,%rsi,8),%r12d
+	shrl	$16,%edx
+	xorl	3(%r14,%rbp,8),%r8d
+
+	shrl	$16,%ebx
+	leaq	16(%r15),%r15
+	shrl	$16,%ecx
+
+	movzbl	%cl,%esi
+	movzbl	%dl,%edi
+	movzbl	%al,%ebp
+	xorl	2(%r14,%rsi,8),%r10d
+	xorl	2(%r14,%rdi,8),%r11d
+	xorl	2(%r14,%rbp,8),%r12d
+
+	movzbl	%bh,%esi
+	movzbl	%ch,%edi
+	movzbl	%bl,%ebp
+	xorl	1(%r14,%rsi,8),%r10d
+	xorl	1(%r14,%rdi,8),%r11d
+	xorl	2(%r14,%rbp,8),%r8d
+
+	movzbl	%dh,%esi
+	movl	12(%r15),%edx
+	movzbl	%ah,%ebp
+	xorl	1(%r14,%rsi,8),%r12d
+	movl	0(%r15),%eax
+	xorl	1(%r14,%rbp,8),%r8d
+
+	xorl	%r10d,%eax
+	movl	4(%r15),%ebx
+	movl	8(%r15),%ecx
+	xorl	%r12d,%ecx
+	xorl	%r11d,%ebx
+	xorl	%r8d,%edx
+	subl	$1,%r13d
+	jnz	.Ldec_loop
+	leaq	2048(%r14),%r14
+	movzbl	%al,%esi
+	movzbl	%bl,%edi
+	movzbl	%cl,%ebp
+	movzbl	(%r14,%rsi,1),%r10d
+	movzbl	(%r14,%rdi,1),%r11d
+	movzbl	(%r14,%rbp,1),%r12d
+
+	movzbl	%dl,%esi
+	movzbl	%dh,%edi
+	movzbl	%ah,%ebp
+	movzbl	(%r14,%rsi,1),%r8d
+	movzbl	(%r14,%rdi,1),%edi
+	movzbl	(%r14,%rbp,1),%ebp
+
+	shll	$8,%edi
+	shll	$8,%ebp
+
+	xorl	%edi,%r10d
+	xorl	%ebp,%r11d
+	shrl	$16,%edx
+
+	movzbl	%bh,%esi
+	movzbl	%ch,%edi
+	shrl	$16,%eax
+	movzbl	(%r14,%rsi,1),%esi
+	movzbl	(%r14,%rdi,1),%edi
+
+	shll	$8,%esi
+	shll	$8,%edi
+	shrl	$16,%ebx
+	xorl	%esi,%r12d
+	xorl	%edi,%r8d
+	shrl	$16,%ecx
+
+	movzbl	%cl,%esi
+	movzbl	%dl,%edi
+	movzbl	%al,%ebp
+	movzbl	(%r14,%rsi,1),%esi
+	movzbl	(%r14,%rdi,1),%edi
+	movzbl	(%r14,%rbp,1),%ebp
+
+	shll	$16,%esi
+	shll	$16,%edi
+	shll	$16,%ebp
+
+	xorl	%esi,%r10d
+	xorl	%edi,%r11d
+	xorl	%ebp,%r12d
+
+	movzbl	%bl,%esi
+	movzbl	%bh,%edi
+	movzbl	%ch,%ebp
+	movzbl	(%r14,%rsi,1),%esi
+	movzbl	(%r14,%rdi,1),%edi
+	movzbl	(%r14,%rbp,1),%ebp
+
+	shll	$16,%esi
+	shll	$24,%edi
+	shll	$24,%ebp
+
+	xorl	%esi,%r8d
+	xorl	%edi,%r10d
+	xorl	%ebp,%r11d
+
+	movzbl	%dh,%esi
+	movzbl	%ah,%edi
+	movl	16+12(%r15),%edx
+	movzbl	(%r14,%rsi,1),%esi
+	movzbl	(%r14,%rdi,1),%edi
+	movl	16+0(%r15),%eax
+
+	shll	$24,%esi
+	shll	$24,%edi
+
+	xorl	%esi,%r12d
+	xorl	%edi,%r8d
+
+	movl	16+4(%r15),%ebx
+	movl	16+8(%r15),%ecx
+	leaq	-2048(%r14),%r14
+	xorl	%r10d,%eax
+	xorl	%r11d,%ebx
+	xorl	%r12d,%ecx
+	xorl	%r8d,%edx
+.byte	0xf3,0xc3
+.size	_x86_64_AES_decrypt,.-_x86_64_AES_decrypt
+.type	_x86_64_AES_decrypt_compact,@function
+.align	16
+_x86_64_AES_decrypt_compact:
+	leaq	128(%r14),%r8
+	movl	0-128(%r8),%edi
+	movl	32-128(%r8),%ebp
+	movl	64-128(%r8),%r10d
+	movl	96-128(%r8),%r11d
+	movl	128-128(%r8),%edi
+	movl	160-128(%r8),%ebp
+	movl	192-128(%r8),%r10d
+	movl	224-128(%r8),%r11d
+	jmp	.Ldec_loop_compact
+
+.align	16
+.Ldec_loop_compact:
+	xorl	0(%r15),%eax
+	xorl	4(%r15),%ebx
+	xorl	8(%r15),%ecx
+	xorl	12(%r15),%edx
+	leaq	16(%r15),%r15
+	movzbl	%al,%r10d
+	movzbl	%bl,%r11d
+	movzbl	%cl,%r12d
+	movzbl	%dl,%r8d
+	movzbl	%dh,%esi
+	movzbl	%ah,%edi
+	shrl	$16,%edx
+	movzbl	%bh,%ebp
+	movzbl	(%r14,%r10,1),%r10d
+	movzbl	(%r14,%r11,1),%r11d
+	movzbl	(%r14,%r12,1),%r12d
+	movzbl	(%r14,%r8,1),%r8d
+
+	movzbl	(%r14,%rsi,1),%r9d
+	movzbl	%ch,%esi
+	movzbl	(%r14,%rdi,1),%r13d
+	movzbl	(%r14,%rbp,1),%ebp
+	movzbl	(%r14,%rsi,1),%esi
+
+	shrl	$16,%ecx
+	shll	$8,%r13d
+	shll	$8,%r9d
+	movzbl	%cl,%edi
+	shrl	$16,%eax
+	xorl	%r9d,%r10d
+	shrl	$16,%ebx
+	movzbl	%dl,%r9d
+
+	shll	$8,%ebp
+	xorl	%r13d,%r11d
+	shll	$8,%esi
+	movzbl	%al,%r13d
+	movzbl	(%r14,%rdi,1),%edi
+	xorl	%ebp,%r12d
+	movzbl	%bl,%ebp
+
+	shll	$16,%edi
+	xorl	%esi,%r8d
+	movzbl	(%r14,%r9,1),%r9d
+	movzbl	%bh,%esi
+	movzbl	(%r14,%rbp,1),%ebp
+	xorl	%edi,%r10d
+	movzbl	(%r14,%r13,1),%r13d
+	movzbl	%ch,%edi
+
+	shll	$16,%ebp
+	shll	$16,%r9d
+	shll	$16,%r13d
+	xorl	%ebp,%r8d
+	movzbl	%dh,%ebp
+	xorl	%r9d,%r11d
+	shrl	$8,%eax
+	xorl	%r13d,%r12d
+
+	movzbl	(%r14,%rsi,1),%esi
+	movzbl	(%r14,%rdi,1),%ebx
+	movzbl	(%r14,%rbp,1),%ecx
+	movzbl	(%r14,%rax,1),%edx
+
+	movl	%r10d,%eax
+	shll	$24,%esi
+	shll	$24,%ebx
+	shll	$24,%ecx
+	xorl	%esi,%eax
+	shll	$24,%edx
+	xorl	%r11d,%ebx
+	xorl	%r12d,%ecx
+	xorl	%r8d,%edx
+	cmpq	16(%rsp),%r15
+	je	.Ldec_compact_done
+
+	movq	256+0(%r14),%rsi
+	shlq	$32,%rbx
+	shlq	$32,%rdx
+	movq	256+8(%r14),%rdi
+	orq	%rbx,%rax
+	orq	%rdx,%rcx
+	movq	256+16(%r14),%rbp
+	movq	%rsi,%r9
+	movq	%rsi,%r12
+	andq	%rax,%r9
+	andq	%rcx,%r12
+	movq	%r9,%rbx
+	movq	%r12,%rdx
+	shrq	$7,%r9
+	leaq	(%rax,%rax,1),%r8
+	shrq	$7,%r12
+	leaq	(%rcx,%rcx,1),%r11
+	subq	%r9,%rbx
+	subq	%r12,%rdx
+	andq	%rdi,%r8
+	andq	%rdi,%r11
+	andq	%rbp,%rbx
+	andq	%rbp,%rdx
+	xorq	%rbx,%r8
+	xorq	%rdx,%r11
+	movq	%rsi,%r10
+	movq	%rsi,%r13
+
+	andq	%r8,%r10
+	andq	%r11,%r13
+	movq	%r10,%rbx
+	movq	%r13,%rdx
+	shrq	$7,%r10
+	leaq	(%r8,%r8,1),%r9
+	shrq	$7,%r13
+	leaq	(%r11,%r11,1),%r12
+	subq	%r10,%rbx
+	subq	%r13,%rdx
+	andq	%rdi,%r9
+	andq	%rdi,%r12
+	andq	%rbp,%rbx
+	andq	%rbp,%rdx
+	xorq	%rbx,%r9
+	xorq	%rdx,%r12
+	movq	%rsi,%r10
+	movq	%rsi,%r13
+
+	andq	%r9,%r10
+	andq	%r12,%r13
+	movq	%r10,%rbx
+	movq	%r13,%rdx
+	shrq	$7,%r10
+	xorq	%rax,%r8
+	shrq	$7,%r13
+	xorq	%rcx,%r11
+	subq	%r10,%rbx
+	subq	%r13,%rdx
+	leaq	(%r9,%r9,1),%r10
+	leaq	(%r12,%r12,1),%r13
+	xorq	%rax,%r9
+	xorq	%rcx,%r12
+	andq	%rdi,%r10
+	andq	%rdi,%r13
+	andq	%rbp,%rbx
+	andq	%rbp,%rdx
+	xorq	%rbx,%r10
+	xorq	%rdx,%r13
+
+	xorq	%r10,%rax
+	xorq	%r13,%rcx
+	xorq	%r10,%r8
+	xorq	%r13,%r11
+	movq	%rax,%rbx
+	movq	%rcx,%rdx
+	xorq	%r10,%r9
+	shrq	$32,%rbx
+	xorq	%r13,%r12
+	shrq	$32,%rdx
+	xorq	%r8,%r10
+	roll	$8,%eax
+	xorq	%r11,%r13
+	roll	$8,%ecx
+	xorq	%r9,%r10
+	roll	$8,%ebx
+	xorq	%r12,%r13
+
+	roll	$8,%edx
+	xorl	%r10d,%eax
+	shrq	$32,%r10
+	xorl	%r13d,%ecx
+	shrq	$32,%r13
+	xorl	%r10d,%ebx
+	xorl	%r13d,%edx
+
+	movq	%r8,%r10
+	roll	$24,%r8d
+	movq	%r11,%r13
+	roll	$24,%r11d
+	shrq	$32,%r10
+	xorl	%r8d,%eax
+	shrq	$32,%r13
+	xorl	%r11d,%ecx
+	roll	$24,%r10d
+	movq	%r9,%r8
+	roll	$24,%r13d
+	movq	%r12,%r11
+	shrq	$32,%r8
+	xorl	%r10d,%ebx
+	shrq	$32,%r11
+	xorl	%r13d,%edx
+
+	movq	0(%r14),%rsi
+	roll	$16,%r9d
+	movq	64(%r14),%rdi
+	roll	$16,%r12d
+	movq	128(%r14),%rbp
+	roll	$16,%r8d
+	movq	192(%r14),%r10
+	xorl	%r9d,%eax
+	roll	$16,%r11d
+	xorl	%r12d,%ecx
+	movq	256(%r14),%r13
+	xorl	%r8d,%ebx
+	xorl	%r11d,%edx
+	jmp	.Ldec_loop_compact
+.align	16
+.Ldec_compact_done:
+	xorl	0(%r15),%eax
+	xorl	4(%r15),%ebx
+	xorl	8(%r15),%ecx
+	xorl	12(%r15),%edx
+.byte	0xf3,0xc3
+.size	_x86_64_AES_decrypt_compact,.-_x86_64_AES_decrypt_compact
+.align	16
+.globl	asm_AES_decrypt
+.hidden asm_AES_decrypt
+.type	asm_AES_decrypt,@function
+.hidden	asm_AES_decrypt
+asm_AES_decrypt:
+	pushq	%rbx
+	pushq	%rbp
+	pushq	%r12
+	pushq	%r13
+	pushq	%r14
+	pushq	%r15
+
+
+	movq	%rsp,%r10
+	leaq	-63(%rdx),%rcx
+	andq	$-64,%rsp
+	subq	%rsp,%rcx
+	negq	%rcx
+	andq	$960,%rcx
+	subq	%rcx,%rsp
+	subq	$32,%rsp
+
+	movq	%rsi,16(%rsp)
+	movq	%r10,24(%rsp)
+.Ldec_prologue:
+
+	movq	%rdx,%r15
+	movl	240(%r15),%r13d
+
+	movl	0(%rdi),%eax
+	movl	4(%rdi),%ebx
+	movl	8(%rdi),%ecx
+	movl	12(%rdi),%edx
+
+	shll	$4,%r13d
+	leaq	(%r15,%r13,1),%rbp
+	movq	%r15,(%rsp)
+	movq	%rbp,8(%rsp)
+
+
+	leaq	.LAES_Td+2048(%rip),%r14
+	leaq	768(%rsp),%rbp
+	subq	%r14,%rbp
+	andq	$768,%rbp
+	leaq	(%r14,%rbp,1),%r14
+	shrq	$3,%rbp
+	addq	%rbp,%r14
+
+	call	_x86_64_AES_decrypt_compact
+
+	movq	16(%rsp),%r9
+	movq	24(%rsp),%rsi
+	movl	%eax,0(%r9)
+	movl	%ebx,4(%r9)
+	movl	%ecx,8(%r9)
+	movl	%edx,12(%r9)
+
+	movq	(%rsi),%r15
+	movq	8(%rsi),%r14
+	movq	16(%rsi),%r13
+	movq	24(%rsi),%r12
+	movq	32(%rsi),%rbp
+	movq	40(%rsi),%rbx
+	leaq	48(%rsi),%rsp
+.Ldec_epilogue:
+	.byte	0xf3,0xc3
+.size	asm_AES_decrypt,.-asm_AES_decrypt
+.align	16
+.globl	asm_AES_set_encrypt_key
+.hidden asm_AES_set_encrypt_key
+.type	asm_AES_set_encrypt_key,@function
+asm_AES_set_encrypt_key:
+	pushq	%rbx
+	pushq	%rbp
+	pushq	%r12
+	pushq	%r13
+	pushq	%r14
+	pushq	%r15
+	subq	$8,%rsp
+.Lenc_key_prologue:
+
+	call	_x86_64_AES_set_encrypt_key
+
+	movq	40(%rsp),%rbp
+	movq	48(%rsp),%rbx
+	addq	$56,%rsp
+.Lenc_key_epilogue:
+	.byte	0xf3,0xc3
+.size	asm_AES_set_encrypt_key,.-asm_AES_set_encrypt_key
+
+.type	_x86_64_AES_set_encrypt_key,@function
+.align	16
+_x86_64_AES_set_encrypt_key:
+	movl	%esi,%ecx
+	movq	%rdi,%rsi
+	movq	%rdx,%rdi
+
+	testq	$-1,%rsi
+	jz	.Lbadpointer
+	testq	$-1,%rdi
+	jz	.Lbadpointer
+
+	leaq	.LAES_Te(%rip),%rbp
+	leaq	2048+128(%rbp),%rbp
+
+
+	movl	0-128(%rbp),%eax
+	movl	32-128(%rbp),%ebx
+	movl	64-128(%rbp),%r8d
+	movl	96-128(%rbp),%edx
+	movl	128-128(%rbp),%eax
+	movl	160-128(%rbp),%ebx
+	movl	192-128(%rbp),%r8d
+	movl	224-128(%rbp),%edx
+
+	cmpl	$128,%ecx
+	je	.L10rounds
+	cmpl	$192,%ecx
+	je	.L12rounds
+	cmpl	$256,%ecx
+	je	.L14rounds
+	movq	$-2,%rax
+	jmp	.Lexit
+
+.L10rounds:
+	movq	0(%rsi),%rax
+	movq	8(%rsi),%rdx
+	movq	%rax,0(%rdi)
+	movq	%rdx,8(%rdi)
+
+	shrq	$32,%rdx
+	xorl	%ecx,%ecx
+	jmp	.L10shortcut
+.align	4
+.L10loop:
+	movl	0(%rdi),%eax
+	movl	12(%rdi),%edx
+.L10shortcut:
+	movzbl	%dl,%esi
+	movzbl	-128(%rbp,%rsi,1),%ebx
+	movzbl	%dh,%esi
+	shll	$24,%ebx
+	xorl	%ebx,%eax
+
+	movzbl	-128(%rbp,%rsi,1),%ebx
+	shrl	$16,%edx
+	movzbl	%dl,%esi
+	xorl	%ebx,%eax
+
+	movzbl	-128(%rbp,%rsi,1),%ebx
+	movzbl	%dh,%esi
+	shll	$8,%ebx
+	xorl	%ebx,%eax
+
+	movzbl	-128(%rbp,%rsi,1),%ebx
+	shll	$16,%ebx
+	xorl	%ebx,%eax
+
+	xorl	1024-128(%rbp,%rcx,4),%eax
+	movl	%eax,16(%rdi)
+	xorl	4(%rdi),%eax
+	movl	%eax,20(%rdi)
+	xorl	8(%rdi),%eax
+	movl	%eax,24(%rdi)
+	xorl	12(%rdi),%eax
+	movl	%eax,28(%rdi)
+	addl	$1,%ecx
+	leaq	16(%rdi),%rdi
+	cmpl	$10,%ecx
+	jl	.L10loop
+
+	movl	$10,80(%rdi)
+	xorq	%rax,%rax
+	jmp	.Lexit
+
+.L12rounds:
+	movq	0(%rsi),%rax
+	movq	8(%rsi),%rbx
+	movq	16(%rsi),%rdx
+	movq	%rax,0(%rdi)
+	movq	%rbx,8(%rdi)
+	movq	%rdx,16(%rdi)
+
+	shrq	$32,%rdx
+	xorl	%ecx,%ecx
+	jmp	.L12shortcut
+.align	4
+.L12loop:
+	movl	0(%rdi),%eax
+	movl	20(%rdi),%edx
+.L12shortcut:
+	movzbl	%dl,%esi
+	movzbl	-128(%rbp,%rsi,1),%ebx
+	movzbl	%dh,%esi
+	shll	$24,%ebx
+	xorl	%ebx,%eax
+
+	movzbl	-128(%rbp,%rsi,1),%ebx
+	shrl	$16,%edx
+	movzbl	%dl,%esi
+	xorl	%ebx,%eax
+
+	movzbl	-128(%rbp,%rsi,1),%ebx
+	movzbl	%dh,%esi
+	shll	$8,%ebx
+	xorl	%ebx,%eax
+
+	movzbl	-128(%rbp,%rsi,1),%ebx
+	shll	$16,%ebx
+	xorl	%ebx,%eax
+
+	xorl	1024-128(%rbp,%rcx,4),%eax
+	movl	%eax,24(%rdi)
+	xorl	4(%rdi),%eax
+	movl	%eax,28(%rdi)
+	xorl	8(%rdi),%eax
+	movl	%eax,32(%rdi)
+	xorl	12(%rdi),%eax
+	movl	%eax,36(%rdi)
+
+	cmpl	$7,%ecx
+	je	.L12break
+	addl	$1,%ecx
+
+	xorl	16(%rdi),%eax
+	movl	%eax,40(%rdi)
+	xorl	20(%rdi),%eax
+	movl	%eax,44(%rdi)
+
+	leaq	24(%rdi),%rdi
+	jmp	.L12loop
+.L12break:
+	movl	$12,72(%rdi)
+	xorq	%rax,%rax
+	jmp	.Lexit
+
+.L14rounds:
+	movq	0(%rsi),%rax
+	movq	8(%rsi),%rbx
+	movq	16(%rsi),%rcx
+	movq	24(%rsi),%rdx
+	movq	%rax,0(%rdi)
+	movq	%rbx,8(%rdi)
+	movq	%rcx,16(%rdi)
+	movq	%rdx,24(%rdi)
+
+	shrq	$32,%rdx
+	xorl	%ecx,%ecx
+	jmp	.L14shortcut
+.align	4
+.L14loop:
+	movl	0(%rdi),%eax
+	movl	28(%rdi),%edx
+.L14shortcut:
+	movzbl	%dl,%esi
+	movzbl	-128(%rbp,%rsi,1),%ebx
+	movzbl	%dh,%esi
+	shll	$24,%ebx
+	xorl	%ebx,%eax
+
+	movzbl	-128(%rbp,%rsi,1),%ebx
+	shrl	$16,%edx
+	movzbl	%dl,%esi
+	xorl	%ebx,%eax
+
+	movzbl	-128(%rbp,%rsi,1),%ebx
+	movzbl	%dh,%esi
+	shll	$8,%ebx
+	xorl	%ebx,%eax
+
+	movzbl	-128(%rbp,%rsi,1),%ebx
+	shll	$16,%ebx
+	xorl	%ebx,%eax
+
+	xorl	1024-128(%rbp,%rcx,4),%eax
+	movl	%eax,32(%rdi)
+	xorl	4(%rdi),%eax
+	movl	%eax,36(%rdi)
+	xorl	8(%rdi),%eax
+	movl	%eax,40(%rdi)
+	xorl	12(%rdi),%eax
+	movl	%eax,44(%rdi)
+
+	cmpl	$6,%ecx
+	je	.L14break
+	addl	$1,%ecx
+
+	movl	%eax,%edx
+	movl	16(%rdi),%eax
+	movzbl	%dl,%esi
+	movzbl	-128(%rbp,%rsi,1),%ebx
+	movzbl	%dh,%esi
+	xorl	%ebx,%eax
+
+	movzbl	-128(%rbp,%rsi,1),%ebx
+	shrl	$16,%edx
+	shll	$8,%ebx
+	movzbl	%dl,%esi
+	xorl	%ebx,%eax
+
+	movzbl	-128(%rbp,%rsi,1),%ebx
+	movzbl	%dh,%esi
+	shll	$16,%ebx
+	xorl	%ebx,%eax
+
+	movzbl	-128(%rbp,%rsi,1),%ebx
+	shll	$24,%ebx
+	xorl	%ebx,%eax
+
+	movl	%eax,48(%rdi)
+	xorl	20(%rdi),%eax
+	movl	%eax,52(%rdi)
+	xorl	24(%rdi),%eax
+	movl	%eax,56(%rdi)
+	xorl	28(%rdi),%eax
+	movl	%eax,60(%rdi)
+
+	leaq	32(%rdi),%rdi
+	jmp	.L14loop
+.L14break:
+	movl	$14,48(%rdi)
+	xorq	%rax,%rax
+	jmp	.Lexit
+
+.Lbadpointer:
+	movq	$-1,%rax
+.Lexit:
+.byte	0xf3,0xc3
+.size	_x86_64_AES_set_encrypt_key,.-_x86_64_AES_set_encrypt_key
+.align	16
+.globl	asm_AES_set_decrypt_key
+.hidden asm_AES_set_decrypt_key
+.type	asm_AES_set_decrypt_key,@function
+asm_AES_set_decrypt_key:
+	pushq	%rbx
+	pushq	%rbp
+	pushq	%r12
+	pushq	%r13
+	pushq	%r14
+	pushq	%r15
+	pushq	%rdx
+.Ldec_key_prologue:
+
+	call	_x86_64_AES_set_encrypt_key
+	movq	(%rsp),%r8
+	cmpl	$0,%eax
+	jne	.Labort
+
+	movl	240(%r8),%r14d
+	xorq	%rdi,%rdi
+	leaq	(%rdi,%r14,4),%rcx
+	movq	%r8,%rsi
+	leaq	(%r8,%rcx,4),%rdi
+.align	4
+.Linvert:
+	movq	0(%rsi),%rax
+	movq	8(%rsi),%rbx
+	movq	0(%rdi),%rcx
+	movq	8(%rdi),%rdx
+	movq	%rax,0(%rdi)
+	movq	%rbx,8(%rdi)
+	movq	%rcx,0(%rsi)
+	movq	%rdx,8(%rsi)
+	leaq	16(%rsi),%rsi
+	leaq	-16(%rdi),%rdi
+	cmpq	%rsi,%rdi
+	jne	.Linvert
+
+	leaq	.LAES_Te+2048+1024(%rip),%rax
+
+	movq	40(%rax),%rsi
+	movq	48(%rax),%rdi
+	movq	56(%rax),%rbp
+
+	movq	%r8,%r15
+	subl	$1,%r14d
+.align	4
+.Lpermute:
+	leaq	16(%r15),%r15
+	movq	0(%r15),%rax
+	movq	8(%r15),%rcx
+	movq	%rsi,%r9
+	movq	%rsi,%r12
+	andq	%rax,%r9
+	andq	%rcx,%r12
+	movq	%r9,%rbx
+	movq	%r12,%rdx
+	shrq	$7,%r9
+	leaq	(%rax,%rax,1),%r8
+	shrq	$7,%r12
+	leaq	(%rcx,%rcx,1),%r11
+	subq	%r9,%rbx
+	subq	%r12,%rdx
+	andq	%rdi,%r8
+	andq	%rdi,%r11
+	andq	%rbp,%rbx
+	andq	%rbp,%rdx
+	xorq	%rbx,%r8
+	xorq	%rdx,%r11
+	movq	%rsi,%r10
+	movq	%rsi,%r13
+
+	andq	%r8,%r10
+	andq	%r11,%r13
+	movq	%r10,%rbx
+	movq	%r13,%rdx
+	shrq	$7,%r10
+	leaq	(%r8,%r8,1),%r9
+	shrq	$7,%r13
+	leaq	(%r11,%r11,1),%r12
+	subq	%r10,%rbx
+	subq	%r13,%rdx
+	andq	%rdi,%r9
+	andq	%rdi,%r12
+	andq	%rbp,%rbx
+	andq	%rbp,%rdx
+	xorq	%rbx,%r9
+	xorq	%rdx,%r12
+	movq	%rsi,%r10
+	movq	%rsi,%r13
+
+	andq	%r9,%r10
+	andq	%r12,%r13
+	movq	%r10,%rbx
+	movq	%r13,%rdx
+	shrq	$7,%r10
+	xorq	%rax,%r8
+	shrq	$7,%r13
+	xorq	%rcx,%r11
+	subq	%r10,%rbx
+	subq	%r13,%rdx
+	leaq	(%r9,%r9,1),%r10
+	leaq	(%r12,%r12,1),%r13
+	xorq	%rax,%r9
+	xorq	%rcx,%r12
+	andq	%rdi,%r10
+	andq	%rdi,%r13
+	andq	%rbp,%rbx
+	andq	%rbp,%rdx
+	xorq	%rbx,%r10
+	xorq	%rdx,%r13
+
+	xorq	%r10,%rax
+	xorq	%r13,%rcx
+	xorq	%r10,%r8
+	xorq	%r13,%r11
+	movq	%rax,%rbx
+	movq	%rcx,%rdx
+	xorq	%r10,%r9
+	shrq	$32,%rbx
+	xorq	%r13,%r12
+	shrq	$32,%rdx
+	xorq	%r8,%r10
+	roll	$8,%eax
+	xorq	%r11,%r13
+	roll	$8,%ecx
+	xorq	%r9,%r10
+	roll	$8,%ebx
+	xorq	%r12,%r13
+
+	roll	$8,%edx
+	xorl	%r10d,%eax
+	shrq	$32,%r10
+	xorl	%r13d,%ecx
+	shrq	$32,%r13
+	xorl	%r10d,%ebx
+	xorl	%r13d,%edx
+
+	movq	%r8,%r10
+	roll	$24,%r8d
+	movq	%r11,%r13
+	roll	$24,%r11d
+	shrq	$32,%r10
+	xorl	%r8d,%eax
+	shrq	$32,%r13
+	xorl	%r11d,%ecx
+	roll	$24,%r10d
+	movq	%r9,%r8
+	roll	$24,%r13d
+	movq	%r12,%r11
+	shrq	$32,%r8
+	xorl	%r10d,%ebx
+	shrq	$32,%r11
+	xorl	%r13d,%edx
+
+
+	roll	$16,%r9d
+
+	roll	$16,%r12d
+
+	roll	$16,%r8d
+
+	xorl	%r9d,%eax
+	roll	$16,%r11d
+	xorl	%r12d,%ecx
+
+	xorl	%r8d,%ebx
+	xorl	%r11d,%edx
+	movl	%eax,0(%r15)
+	movl	%ebx,4(%r15)
+	movl	%ecx,8(%r15)
+	movl	%edx,12(%r15)
+	subl	$1,%r14d
+	jnz	.Lpermute
+
+	xorq	%rax,%rax
+.Labort:
+	movq	8(%rsp),%r15
+	movq	16(%rsp),%r14
+	movq	24(%rsp),%r13
+	movq	32(%rsp),%r12
+	movq	40(%rsp),%rbp
+	movq	48(%rsp),%rbx
+	addq	$56,%rsp
+.Ldec_key_epilogue:
+	.byte	0xf3,0xc3
+.size	asm_AES_set_decrypt_key,.-asm_AES_set_decrypt_key
+.align	16
+.globl	asm_AES_cbc_encrypt
+.hidden asm_AES_cbc_encrypt
+.type	asm_AES_cbc_encrypt,@function
+.extern	OPENSSL_ia32cap_P
+.hidden OPENSSL_ia32cap_P
+.hidden	asm_AES_cbc_encrypt
+asm_AES_cbc_encrypt:
+	cmpq	$0,%rdx
+	je	.Lcbc_epilogue
+	pushfq
+	pushq	%rbx
+	pushq	%rbp
+	pushq	%r12
+	pushq	%r13
+	pushq	%r14
+	pushq	%r15
+.Lcbc_prologue:
+
+	cld
+	movl	%r9d,%r9d
+
+	leaq	.LAES_Te(%rip),%r14
+	cmpq	$0,%r9
+	jne	.Lcbc_picked_te
+	leaq	.LAES_Td(%rip),%r14
+.Lcbc_picked_te:
+
+	movl	OPENSSL_ia32cap_P(%rip),%r10d
+	cmpq	$512,%rdx
+	jb	.Lcbc_slow_prologue
+	testq	$15,%rdx
+	jnz	.Lcbc_slow_prologue
+	btl	$28,%r10d
+	jc	.Lcbc_slow_prologue
+
+
+	leaq	-88-248(%rsp),%r15
+	andq	$-64,%r15
+
+
+	movq	%r14,%r10
+	leaq	2304(%r14),%r11
+	movq	%r15,%r12
+	andq	$4095,%r10
+	andq	$4095,%r11
+	andq	$4095,%r12
+
+	cmpq	%r11,%r12
+	jb	.Lcbc_te_break_out
+	subq	%r11,%r12
+	subq	%r12,%r15
+	jmp	.Lcbc_te_ok
+.Lcbc_te_break_out:
+	subq	%r10,%r12
+	andq	$4095,%r12
+	addq	$320,%r12
+	subq	%r12,%r15
+.align	4
+.Lcbc_te_ok:
+
+	xchgq	%rsp,%r15
+
+	movq	%r15,16(%rsp)
+.Lcbc_fast_body:
+	movq	%rdi,24(%rsp)
+	movq	%rsi,32(%rsp)
+	movq	%rdx,40(%rsp)
+	movq	%rcx,48(%rsp)
+	movq	%r8,56(%rsp)
+	movl	$0,80+240(%rsp)
+	movq	%r8,%rbp
+	movq	%r9,%rbx
+	movq	%rsi,%r9
+	movq	%rdi,%r8
+	movq	%rcx,%r15
+
+	movl	240(%r15),%eax
+
+	movq	%r15,%r10
+	subq	%r14,%r10
+	andq	$4095,%r10
+	cmpq	$2304,%r10
+	jb	.Lcbc_do_ecopy
+	cmpq	$4096-248,%r10
+	jb	.Lcbc_skip_ecopy
+.align	4
+.Lcbc_do_ecopy:
+	movq	%r15,%rsi
+	leaq	80(%rsp),%rdi
+	leaq	80(%rsp),%r15
+	movl	$30,%ecx
+.long	0x90A548F3
+	movl	%eax,(%rdi)
+.Lcbc_skip_ecopy:
+	movq	%r15,0(%rsp)
+
+	movl	$18,%ecx
+.align	4
+.Lcbc_prefetch_te:
+	movq	0(%r14),%r10
+	movq	32(%r14),%r11
+	movq	64(%r14),%r12
+	movq	96(%r14),%r13
+	leaq	128(%r14),%r14
+	subl	$1,%ecx
+	jnz	.Lcbc_prefetch_te
+	leaq	-2304(%r14),%r14
+
+	cmpq	$0,%rbx
+	je	.LFAST_DECRYPT
+
+
+	movl	0(%rbp),%eax
+	movl	4(%rbp),%ebx
+	movl	8(%rbp),%ecx
+	movl	12(%rbp),%edx
+
+.align	4
+.Lcbc_fast_enc_loop:
+	xorl	0(%r8),%eax
+	xorl	4(%r8),%ebx
+	xorl	8(%r8),%ecx
+	xorl	12(%r8),%edx
+	movq	0(%rsp),%r15
+	movq	%r8,24(%rsp)
+
+	call	_x86_64_AES_encrypt
+
+	movq	24(%rsp),%r8
+	movq	40(%rsp),%r10
+	movl	%eax,0(%r9)
+	movl	%ebx,4(%r9)
+	movl	%ecx,8(%r9)
+	movl	%edx,12(%r9)
+
+	leaq	16(%r8),%r8
+	leaq	16(%r9),%r9
+	subq	$16,%r10
+	testq	$-16,%r10
+	movq	%r10,40(%rsp)
+	jnz	.Lcbc_fast_enc_loop
+	movq	56(%rsp),%rbp
+	movl	%eax,0(%rbp)
+	movl	%ebx,4(%rbp)
+	movl	%ecx,8(%rbp)
+	movl	%edx,12(%rbp)
+
+	jmp	.Lcbc_fast_cleanup
+
+
+.align	16
+.LFAST_DECRYPT:
+	cmpq	%r8,%r9
+	je	.Lcbc_fast_dec_in_place
+
+	movq	%rbp,64(%rsp)
+.align	4
+.Lcbc_fast_dec_loop:
+	movl	0(%r8),%eax
+	movl	4(%r8),%ebx
+	movl	8(%r8),%ecx
+	movl	12(%r8),%edx
+	movq	0(%rsp),%r15
+	movq	%r8,24(%rsp)
+
+	call	_x86_64_AES_decrypt
+
+	movq	64(%rsp),%rbp
+	movq	24(%rsp),%r8
+	movq	40(%rsp),%r10
+	xorl	0(%rbp),%eax
+	xorl	4(%rbp),%ebx
+	xorl	8(%rbp),%ecx
+	xorl	12(%rbp),%edx
+	movq	%r8,%rbp
+
+	subq	$16,%r10
+	movq	%r10,40(%rsp)
+	movq	%rbp,64(%rsp)
+
+	movl	%eax,0(%r9)
+	movl	%ebx,4(%r9)
+	movl	%ecx,8(%r9)
+	movl	%edx,12(%r9)
+
+	leaq	16(%r8),%r8
+	leaq	16(%r9),%r9
+	jnz	.Lcbc_fast_dec_loop
+	movq	56(%rsp),%r12
+	movq	0(%rbp),%r10
+	movq	8(%rbp),%r11
+	movq	%r10,0(%r12)
+	movq	%r11,8(%r12)
+	jmp	.Lcbc_fast_cleanup
+
+.align	16
+.Lcbc_fast_dec_in_place:
+	movq	0(%rbp),%r10
+	movq	8(%rbp),%r11
+	movq	%r10,0+64(%rsp)
+	movq	%r11,8+64(%rsp)
+.align	4
+.Lcbc_fast_dec_in_place_loop:
+	movl	0(%r8),%eax
+	movl	4(%r8),%ebx
+	movl	8(%r8),%ecx
+	movl	12(%r8),%edx
+	movq	0(%rsp),%r15
+	movq	%r8,24(%rsp)
+
+	call	_x86_64_AES_decrypt
+
+	movq	24(%rsp),%r8
+	movq	40(%rsp),%r10
+	xorl	0+64(%rsp),%eax
+	xorl	4+64(%rsp),%ebx
+	xorl	8+64(%rsp),%ecx
+	xorl	12+64(%rsp),%edx
+
+	movq	0(%r8),%r11
+	movq	8(%r8),%r12
+	subq	$16,%r10
+	jz	.Lcbc_fast_dec_in_place_done
+
+	movq	%r11,0+64(%rsp)
+	movq	%r12,8+64(%rsp)
+
+	movl	%eax,0(%r9)
+	movl	%ebx,4(%r9)
+	movl	%ecx,8(%r9)
+	movl	%edx,12(%r9)
+
+	leaq	16(%r8),%r8
+	leaq	16(%r9),%r9
+	movq	%r10,40(%rsp)
+	jmp	.Lcbc_fast_dec_in_place_loop
+.Lcbc_fast_dec_in_place_done:
+	movq	56(%rsp),%rdi
+	movq	%r11,0(%rdi)
+	movq	%r12,8(%rdi)
+
+	movl	%eax,0(%r9)
+	movl	%ebx,4(%r9)
+	movl	%ecx,8(%r9)
+	movl	%edx,12(%r9)
+
+.align	4
+.Lcbc_fast_cleanup:
+	cmpl	$0,80+240(%rsp)
+	leaq	80(%rsp),%rdi
+	je	.Lcbc_exit
+	movl	$30,%ecx
+	xorq	%rax,%rax
+.long	0x90AB48F3
+
+	jmp	.Lcbc_exit
+
+
+.align	16
+.Lcbc_slow_prologue:
+
+	leaq	-88(%rsp),%rbp
+	andq	$-64,%rbp
+
+	leaq	-88-63(%rcx),%r10
+	subq	%rbp,%r10
+	negq	%r10
+	andq	$960,%r10
+	subq	%r10,%rbp
+
+	xchgq	%rsp,%rbp
+
+	movq	%rbp,16(%rsp)
+.Lcbc_slow_body:
+
+
+
+
+	movq	%r8,56(%rsp)
+	movq	%r8,%rbp
+	movq	%r9,%rbx
+	movq	%rsi,%r9
+	movq	%rdi,%r8
+	movq	%rcx,%r15
+	movq	%rdx,%r10
+
+	movl	240(%r15),%eax
+	movq	%r15,0(%rsp)
+	shll	$4,%eax
+	leaq	(%r15,%rax,1),%rax
+	movq	%rax,8(%rsp)
+
+
+	leaq	2048(%r14),%r14
+	leaq	768-8(%rsp),%rax
+	subq	%r14,%rax
+	andq	$768,%rax
+	leaq	(%r14,%rax,1),%r14
+
+	cmpq	$0,%rbx
+	je	.LSLOW_DECRYPT
+
+
+	testq	$-16,%r10
+	movl	0(%rbp),%eax
+	movl	4(%rbp),%ebx
+	movl	8(%rbp),%ecx
+	movl	12(%rbp),%edx
+	jz	.Lcbc_slow_enc_tail
+
+.align	4
+.Lcbc_slow_enc_loop:
+	xorl	0(%r8),%eax
+	xorl	4(%r8),%ebx
+	xorl	8(%r8),%ecx
+	xorl	12(%r8),%edx
+	movq	0(%rsp),%r15
+	movq	%r8,24(%rsp)
+	movq	%r9,32(%rsp)
+	movq	%r10,40(%rsp)
+
+	call	_x86_64_AES_encrypt_compact
+
+	movq	24(%rsp),%r8
+	movq	32(%rsp),%r9
+	movq	40(%rsp),%r10
+	movl	%eax,0(%r9)
+	movl	%ebx,4(%r9)
+	movl	%ecx,8(%r9)
+	movl	%edx,12(%r9)
+
+	leaq	16(%r8),%r8
+	leaq	16(%r9),%r9
+	subq	$16,%r10
+	testq	$-16,%r10
+	jnz	.Lcbc_slow_enc_loop
+	testq	$15,%r10
+	jnz	.Lcbc_slow_enc_tail
+	movq	56(%rsp),%rbp
+	movl	%eax,0(%rbp)
+	movl	%ebx,4(%rbp)
+	movl	%ecx,8(%rbp)
+	movl	%edx,12(%rbp)
+
+	jmp	.Lcbc_exit
+
+.align	4
+.Lcbc_slow_enc_tail:
+	movq	%rax,%r11
+	movq	%rcx,%r12
+	movq	%r10,%rcx
+	movq	%r8,%rsi
+	movq	%r9,%rdi
+.long	0x9066A4F3
+	movq	$16,%rcx
+	subq	%r10,%rcx
+	xorq	%rax,%rax
+.long	0x9066AAF3
+	movq	%r9,%r8
+	movq	$16,%r10
+	movq	%r11,%rax
+	movq	%r12,%rcx
+	jmp	.Lcbc_slow_enc_loop
+
+.align	16
+.LSLOW_DECRYPT:
+	shrq	$3,%rax
+	addq	%rax,%r14
+
+	movq	0(%rbp),%r11
+	movq	8(%rbp),%r12
+	movq	%r11,0+64(%rsp)
+	movq	%r12,8+64(%rsp)
+
+.align	4
+.Lcbc_slow_dec_loop:
+	movl	0(%r8),%eax
+	movl	4(%r8),%ebx
+	movl	8(%r8),%ecx
+	movl	12(%r8),%edx
+	movq	0(%rsp),%r15
+	movq	%r8,24(%rsp)
+	movq	%r9,32(%rsp)
+	movq	%r10,40(%rsp)
+
+	call	_x86_64_AES_decrypt_compact
+
+	movq	24(%rsp),%r8
+	movq	32(%rsp),%r9
+	movq	40(%rsp),%r10
+	xorl	0+64(%rsp),%eax
+	xorl	4+64(%rsp),%ebx
+	xorl	8+64(%rsp),%ecx
+	xorl	12+64(%rsp),%edx
+
+	movq	0(%r8),%r11
+	movq	8(%r8),%r12
+	subq	$16,%r10
+	jc	.Lcbc_slow_dec_partial
+	jz	.Lcbc_slow_dec_done
+
+	movq	%r11,0+64(%rsp)
+	movq	%r12,8+64(%rsp)
+
+	movl	%eax,0(%r9)
+	movl	%ebx,4(%r9)
+	movl	%ecx,8(%r9)
+	movl	%edx,12(%r9)
+
+	leaq	16(%r8),%r8
+	leaq	16(%r9),%r9
+	jmp	.Lcbc_slow_dec_loop
+.Lcbc_slow_dec_done:
+	movq	56(%rsp),%rdi
+	movq	%r11,0(%rdi)
+	movq	%r12,8(%rdi)
+
+	movl	%eax,0(%r9)
+	movl	%ebx,4(%r9)
+	movl	%ecx,8(%r9)
+	movl	%edx,12(%r9)
+
+	jmp	.Lcbc_exit
+
+.align	4
+.Lcbc_slow_dec_partial:
+	movq	56(%rsp),%rdi
+	movq	%r11,0(%rdi)
+	movq	%r12,8(%rdi)
+
+	movl	%eax,0+64(%rsp)
+	movl	%ebx,4+64(%rsp)
+	movl	%ecx,8+64(%rsp)
+	movl	%edx,12+64(%rsp)
+
+	movq	%r9,%rdi
+	leaq	64(%rsp),%rsi
+	leaq	16(%r10),%rcx
+.long	0x9066A4F3
+	jmp	.Lcbc_exit
+
+.align	16
+.Lcbc_exit:
+	movq	16(%rsp),%rsi
+	movq	(%rsi),%r15
+	movq	8(%rsi),%r14
+	movq	16(%rsi),%r13
+	movq	24(%rsi),%r12
+	movq	32(%rsi),%rbp
+	movq	40(%rsi),%rbx
+	leaq	48(%rsi),%rsp
+.Lcbc_popfq:
+	popfq
+.Lcbc_epilogue:
+	.byte	0xf3,0xc3
+.size	asm_AES_cbc_encrypt,.-asm_AES_cbc_encrypt
+.align	64
+.LAES_Te:
+.long	0xa56363c6,0xa56363c6
+.long	0x847c7cf8,0x847c7cf8
+.long	0x997777ee,0x997777ee
+.long	0x8d7b7bf6,0x8d7b7bf6
+.long	0x0df2f2ff,0x0df2f2ff
+.long	0xbd6b6bd6,0xbd6b6bd6
+.long	0xb16f6fde,0xb16f6fde
+.long	0x54c5c591,0x54c5c591
+.long	0x50303060,0x50303060
+.long	0x03010102,0x03010102
+.long	0xa96767ce,0xa96767ce
+.long	0x7d2b2b56,0x7d2b2b56
+.long	0x19fefee7,0x19fefee7
+.long	0x62d7d7b5,0x62d7d7b5
+.long	0xe6abab4d,0xe6abab4d
+.long	0x9a7676ec,0x9a7676ec
+.long	0x45caca8f,0x45caca8f
+.long	0x9d82821f,0x9d82821f
+.long	0x40c9c989,0x40c9c989
+.long	0x877d7dfa,0x877d7dfa
+.long	0x15fafaef,0x15fafaef
+.long	0xeb5959b2,0xeb5959b2
+.long	0xc947478e,0xc947478e
+.long	0x0bf0f0fb,0x0bf0f0fb
+.long	0xecadad41,0xecadad41
+.long	0x67d4d4b3,0x67d4d4b3
+.long	0xfda2a25f,0xfda2a25f
+.long	0xeaafaf45,0xeaafaf45
+.long	0xbf9c9c23,0xbf9c9c23
+.long	0xf7a4a453,0xf7a4a453
+.long	0x967272e4,0x967272e4
+.long	0x5bc0c09b,0x5bc0c09b
+.long	0xc2b7b775,0xc2b7b775
+.long	0x1cfdfde1,0x1cfdfde1
+.long	0xae93933d,0xae93933d
+.long	0x6a26264c,0x6a26264c
+.long	0x5a36366c,0x5a36366c
+.long	0x413f3f7e,0x413f3f7e
+.long	0x02f7f7f5,0x02f7f7f5
+.long	0x4fcccc83,0x4fcccc83
+.long	0x5c343468,0x5c343468
+.long	0xf4a5a551,0xf4a5a551
+.long	0x34e5e5d1,0x34e5e5d1
+.long	0x08f1f1f9,0x08f1f1f9
+.long	0x937171e2,0x937171e2
+.long	0x73d8d8ab,0x73d8d8ab
+.long	0x53313162,0x53313162
+.long	0x3f15152a,0x3f15152a
+.long	0x0c040408,0x0c040408
+.long	0x52c7c795,0x52c7c795
+.long	0x65232346,0x65232346
+.long	0x5ec3c39d,0x5ec3c39d
+.long	0x28181830,0x28181830
+.long	0xa1969637,0xa1969637
+.long	0x0f05050a,0x0f05050a
+.long	0xb59a9a2f,0xb59a9a2f
+.long	0x0907070e,0x0907070e
+.long	0x36121224,0x36121224
+.long	0x9b80801b,0x9b80801b
+.long	0x3de2e2df,0x3de2e2df
+.long	0x26ebebcd,0x26ebebcd
+.long	0x6927274e,0x6927274e
+.long	0xcdb2b27f,0xcdb2b27f
+.long	0x9f7575ea,0x9f7575ea
+.long	0x1b090912,0x1b090912
+.long	0x9e83831d,0x9e83831d
+.long	0x742c2c58,0x742c2c58
+.long	0x2e1a1a34,0x2e1a1a34
+.long	0x2d1b1b36,0x2d1b1b36
+.long	0xb26e6edc,0xb26e6edc
+.long	0xee5a5ab4,0xee5a5ab4
+.long	0xfba0a05b,0xfba0a05b
+.long	0xf65252a4,0xf65252a4
+.long	0x4d3b3b76,0x4d3b3b76
+.long	0x61d6d6b7,0x61d6d6b7
+.long	0xceb3b37d,0xceb3b37d
+.long	0x7b292952,0x7b292952
+.long	0x3ee3e3dd,0x3ee3e3dd
+.long	0x712f2f5e,0x712f2f5e
+.long	0x97848413,0x97848413
+.long	0xf55353a6,0xf55353a6
+.long	0x68d1d1b9,0x68d1d1b9
+.long	0x00000000,0x00000000
+.long	0x2cededc1,0x2cededc1
+.long	0x60202040,0x60202040
+.long	0x1ffcfce3,0x1ffcfce3
+.long	0xc8b1b179,0xc8b1b179
+.long	0xed5b5bb6,0xed5b5bb6
+.long	0xbe6a6ad4,0xbe6a6ad4
+.long	0x46cbcb8d,0x46cbcb8d
+.long	0xd9bebe67,0xd9bebe67
+.long	0x4b393972,0x4b393972
+.long	0xde4a4a94,0xde4a4a94
+.long	0xd44c4c98,0xd44c4c98
+.long	0xe85858b0,0xe85858b0
+.long	0x4acfcf85,0x4acfcf85
+.long	0x6bd0d0bb,0x6bd0d0bb
+.long	0x2aefefc5,0x2aefefc5
+.long	0xe5aaaa4f,0xe5aaaa4f
+.long	0x16fbfbed,0x16fbfbed
+.long	0xc5434386,0xc5434386
+.long	0xd74d4d9a,0xd74d4d9a
+.long	0x55333366,0x55333366
+.long	0x94858511,0x94858511
+.long	0xcf45458a,0xcf45458a
+.long	0x10f9f9e9,0x10f9f9e9
+.long	0x06020204,0x06020204
+.long	0x817f7ffe,0x817f7ffe
+.long	0xf05050a0,0xf05050a0
+.long	0x443c3c78,0x443c3c78
+.long	0xba9f9f25,0xba9f9f25
+.long	0xe3a8a84b,0xe3a8a84b
+.long	0xf35151a2,0xf35151a2
+.long	0xfea3a35d,0xfea3a35d
+.long	0xc0404080,0xc0404080
+.long	0x8a8f8f05,0x8a8f8f05
+.long	0xad92923f,0xad92923f
+.long	0xbc9d9d21,0xbc9d9d21
+.long	0x48383870,0x48383870
+.long	0x04f5f5f1,0x04f5f5f1
+.long	0xdfbcbc63,0xdfbcbc63
+.long	0xc1b6b677,0xc1b6b677
+.long	0x75dadaaf,0x75dadaaf
+.long	0x63212142,0x63212142
+.long	0x30101020,0x30101020
+.long	0x1affffe5,0x1affffe5
+.long	0x0ef3f3fd,0x0ef3f3fd
+.long	0x6dd2d2bf,0x6dd2d2bf
+.long	0x4ccdcd81,0x4ccdcd81
+.long	0x140c0c18,0x140c0c18
+.long	0x35131326,0x35131326
+.long	0x2fececc3,0x2fececc3
+.long	0xe15f5fbe,0xe15f5fbe
+.long	0xa2979735,0xa2979735
+.long	0xcc444488,0xcc444488
+.long	0x3917172e,0x3917172e
+.long	0x57c4c493,0x57c4c493
+.long	0xf2a7a755,0xf2a7a755
+.long	0x827e7efc,0x827e7efc
+.long	0x473d3d7a,0x473d3d7a
+.long	0xac6464c8,0xac6464c8
+.long	0xe75d5dba,0xe75d5dba
+.long	0x2b191932,0x2b191932
+.long	0x957373e6,0x957373e6
+.long	0xa06060c0,0xa06060c0
+.long	0x98818119,0x98818119
+.long	0xd14f4f9e,0xd14f4f9e
+.long	0x7fdcdca3,0x7fdcdca3
+.long	0x66222244,0x66222244
+.long	0x7e2a2a54,0x7e2a2a54
+.long	0xab90903b,0xab90903b
+.long	0x8388880b,0x8388880b
+.long	0xca46468c,0xca46468c
+.long	0x29eeeec7,0x29eeeec7
+.long	0xd3b8b86b,0xd3b8b86b
+.long	0x3c141428,0x3c141428
+.long	0x79dedea7,0x79dedea7
+.long	0xe25e5ebc,0xe25e5ebc
+.long	0x1d0b0b16,0x1d0b0b16
+.long	0x76dbdbad,0x76dbdbad
+.long	0x3be0e0db,0x3be0e0db
+.long	0x56323264,0x56323264
+.long	0x4e3a3a74,0x4e3a3a74
+.long	0x1e0a0a14,0x1e0a0a14
+.long	0xdb494992,0xdb494992
+.long	0x0a06060c,0x0a06060c
+.long	0x6c242448,0x6c242448
+.long	0xe45c5cb8,0xe45c5cb8
+.long	0x5dc2c29f,0x5dc2c29f
+.long	0x6ed3d3bd,0x6ed3d3bd
+.long	0xefacac43,0xefacac43
+.long	0xa66262c4,0xa66262c4
+.long	0xa8919139,0xa8919139
+.long	0xa4959531,0xa4959531
+.long	0x37e4e4d3,0x37e4e4d3
+.long	0x8b7979f2,0x8b7979f2
+.long	0x32e7e7d5,0x32e7e7d5
+.long	0x43c8c88b,0x43c8c88b
+.long	0x5937376e,0x5937376e
+.long	0xb76d6dda,0xb76d6dda
+.long	0x8c8d8d01,0x8c8d8d01
+.long	0x64d5d5b1,0x64d5d5b1
+.long	0xd24e4e9c,0xd24e4e9c
+.long	0xe0a9a949,0xe0a9a949
+.long	0xb46c6cd8,0xb46c6cd8
+.long	0xfa5656ac,0xfa5656ac
+.long	0x07f4f4f3,0x07f4f4f3
+.long	0x25eaeacf,0x25eaeacf
+.long	0xaf6565ca,0xaf6565ca
+.long	0x8e7a7af4,0x8e7a7af4
+.long	0xe9aeae47,0xe9aeae47
+.long	0x18080810,0x18080810
+.long	0xd5baba6f,0xd5baba6f
+.long	0x887878f0,0x887878f0
+.long	0x6f25254a,0x6f25254a
+.long	0x722e2e5c,0x722e2e5c
+.long	0x241c1c38,0x241c1c38
+.long	0xf1a6a657,0xf1a6a657
+.long	0xc7b4b473,0xc7b4b473
+.long	0x51c6c697,0x51c6c697
+.long	0x23e8e8cb,0x23e8e8cb
+.long	0x7cdddda1,0x7cdddda1
+.long	0x9c7474e8,0x9c7474e8
+.long	0x211f1f3e,0x211f1f3e
+.long	0xdd4b4b96,0xdd4b4b96
+.long	0xdcbdbd61,0xdcbdbd61
+.long	0x868b8b0d,0x868b8b0d
+.long	0x858a8a0f,0x858a8a0f
+.long	0x907070e0,0x907070e0
+.long	0x423e3e7c,0x423e3e7c
+.long	0xc4b5b571,0xc4b5b571
+.long	0xaa6666cc,0xaa6666cc
+.long	0xd8484890,0xd8484890
+.long	0x05030306,0x05030306
+.long	0x01f6f6f7,0x01f6f6f7
+.long	0x120e0e1c,0x120e0e1c
+.long	0xa36161c2,0xa36161c2
+.long	0x5f35356a,0x5f35356a
+.long	0xf95757ae,0xf95757ae
+.long	0xd0b9b969,0xd0b9b969
+.long	0x91868617,0x91868617
+.long	0x58c1c199,0x58c1c199
+.long	0x271d1d3a,0x271d1d3a
+.long	0xb99e9e27,0xb99e9e27
+.long	0x38e1e1d9,0x38e1e1d9
+.long	0x13f8f8eb,0x13f8f8eb
+.long	0xb398982b,0xb398982b
+.long	0x33111122,0x33111122
+.long	0xbb6969d2,0xbb6969d2
+.long	0x70d9d9a9,0x70d9d9a9
+.long	0x898e8e07,0x898e8e07
+.long	0xa7949433,0xa7949433
+.long	0xb69b9b2d,0xb69b9b2d
+.long	0x221e1e3c,0x221e1e3c
+.long	0x92878715,0x92878715
+.long	0x20e9e9c9,0x20e9e9c9
+.long	0x49cece87,0x49cece87
+.long	0xff5555aa,0xff5555aa
+.long	0x78282850,0x78282850
+.long	0x7adfdfa5,0x7adfdfa5
+.long	0x8f8c8c03,0x8f8c8c03
+.long	0xf8a1a159,0xf8a1a159
+.long	0x80898909,0x80898909
+.long	0x170d0d1a,0x170d0d1a
+.long	0xdabfbf65,0xdabfbf65
+.long	0x31e6e6d7,0x31e6e6d7
+.long	0xc6424284,0xc6424284
+.long	0xb86868d0,0xb86868d0
+.long	0xc3414182,0xc3414182
+.long	0xb0999929,0xb0999929
+.long	0x772d2d5a,0x772d2d5a
+.long	0x110f0f1e,0x110f0f1e
+.long	0xcbb0b07b,0xcbb0b07b
+.long	0xfc5454a8,0xfc5454a8
+.long	0xd6bbbb6d,0xd6bbbb6d
+.long	0x3a16162c,0x3a16162c
+.byte	0x63,0x7c,0x77,0x7b,0xf2,0x6b,0x6f,0xc5
+.byte	0x30,0x01,0x67,0x2b,0xfe,0xd7,0xab,0x76
+.byte	0xca,0x82,0xc9,0x7d,0xfa,0x59,0x47,0xf0
+.byte	0xad,0xd4,0xa2,0xaf,0x9c,0xa4,0x72,0xc0
+.byte	0xb7,0xfd,0x93,0x26,0x36,0x3f,0xf7,0xcc
+.byte	0x34,0xa5,0xe5,0xf1,0x71,0xd8,0x31,0x15
+.byte	0x04,0xc7,0x23,0xc3,0x18,0x96,0x05,0x9a
+.byte	0x07,0x12,0x80,0xe2,0xeb,0x27,0xb2,0x75
+.byte	0x09,0x83,0x2c,0x1a,0x1b,0x6e,0x5a,0xa0
+.byte	0x52,0x3b,0xd6,0xb3,0x29,0xe3,0x2f,0x84
+.byte	0x53,0xd1,0x00,0xed,0x20,0xfc,0xb1,0x5b
+.byte	0x6a,0xcb,0xbe,0x39,0x4a,0x4c,0x58,0xcf
+.byte	0xd0,0xef,0xaa,0xfb,0x43,0x4d,0x33,0x85
+.byte	0x45,0xf9,0x02,0x7f,0x50,0x3c,0x9f,0xa8
+.byte	0x51,0xa3,0x40,0x8f,0x92,0x9d,0x38,0xf5
+.byte	0xbc,0xb6,0xda,0x21,0x10,0xff,0xf3,0xd2
+.byte	0xcd,0x0c,0x13,0xec,0x5f,0x97,0x44,0x17
+.byte	0xc4,0xa7,0x7e,0x3d,0x64,0x5d,0x19,0x73
+.byte	0x60,0x81,0x4f,0xdc,0x22,0x2a,0x90,0x88
+.byte	0x46,0xee,0xb8,0x14,0xde,0x5e,0x0b,0xdb
+.byte	0xe0,0x32,0x3a,0x0a,0x49,0x06,0x24,0x5c
+.byte	0xc2,0xd3,0xac,0x62,0x91,0x95,0xe4,0x79
+.byte	0xe7,0xc8,0x37,0x6d,0x8d,0xd5,0x4e,0xa9
+.byte	0x6c,0x56,0xf4,0xea,0x65,0x7a,0xae,0x08
+.byte	0xba,0x78,0x25,0x2e,0x1c,0xa6,0xb4,0xc6
+.byte	0xe8,0xdd,0x74,0x1f,0x4b,0xbd,0x8b,0x8a
+.byte	0x70,0x3e,0xb5,0x66,0x48,0x03,0xf6,0x0e
+.byte	0x61,0x35,0x57,0xb9,0x86,0xc1,0x1d,0x9e
+.byte	0xe1,0xf8,0x98,0x11,0x69,0xd9,0x8e,0x94
+.byte	0x9b,0x1e,0x87,0xe9,0xce,0x55,0x28,0xdf
+.byte	0x8c,0xa1,0x89,0x0d,0xbf,0xe6,0x42,0x68
+.byte	0x41,0x99,0x2d,0x0f,0xb0,0x54,0xbb,0x16
+.byte	0x63,0x7c,0x77,0x7b,0xf2,0x6b,0x6f,0xc5
+.byte	0x30,0x01,0x67,0x2b,0xfe,0xd7,0xab,0x76
+.byte	0xca,0x82,0xc9,0x7d,0xfa,0x59,0x47,0xf0
+.byte	0xad,0xd4,0xa2,0xaf,0x9c,0xa4,0x72,0xc0
+.byte	0xb7,0xfd,0x93,0x26,0x36,0x3f,0xf7,0xcc
+.byte	0x34,0xa5,0xe5,0xf1,0x71,0xd8,0x31,0x15
+.byte	0x04,0xc7,0x23,0xc3,0x18,0x96,0x05,0x9a
+.byte	0x07,0x12,0x80,0xe2,0xeb,0x27,0xb2,0x75
+.byte	0x09,0x83,0x2c,0x1a,0x1b,0x6e,0x5a,0xa0
+.byte	0x52,0x3b,0xd6,0xb3,0x29,0xe3,0x2f,0x84
+.byte	0x53,0xd1,0x00,0xed,0x20,0xfc,0xb1,0x5b
+.byte	0x6a,0xcb,0xbe,0x39,0x4a,0x4c,0x58,0xcf
+.byte	0xd0,0xef,0xaa,0xfb,0x43,0x4d,0x33,0x85
+.byte	0x45,0xf9,0x02,0x7f,0x50,0x3c,0x9f,0xa8
+.byte	0x51,0xa3,0x40,0x8f,0x92,0x9d,0x38,0xf5
+.byte	0xbc,0xb6,0xda,0x21,0x10,0xff,0xf3,0xd2
+.byte	0xcd,0x0c,0x13,0xec,0x5f,0x97,0x44,0x17
+.byte	0xc4,0xa7,0x7e,0x3d,0x64,0x5d,0x19,0x73
+.byte	0x60,0x81,0x4f,0xdc,0x22,0x2a,0x90,0x88
+.byte	0x46,0xee,0xb8,0x14,0xde,0x5e,0x0b,0xdb
+.byte	0xe0,0x32,0x3a,0x0a,0x49,0x06,0x24,0x5c
+.byte	0xc2,0xd3,0xac,0x62,0x91,0x95,0xe4,0x79
+.byte	0xe7,0xc8,0x37,0x6d,0x8d,0xd5,0x4e,0xa9
+.byte	0x6c,0x56,0xf4,0xea,0x65,0x7a,0xae,0x08
+.byte	0xba,0x78,0x25,0x2e,0x1c,0xa6,0xb4,0xc6
+.byte	0xe8,0xdd,0x74,0x1f,0x4b,0xbd,0x8b,0x8a
+.byte	0x70,0x3e,0xb5,0x66,0x48,0x03,0xf6,0x0e
+.byte	0x61,0x35,0x57,0xb9,0x86,0xc1,0x1d,0x9e
+.byte	0xe1,0xf8,0x98,0x11,0x69,0xd9,0x8e,0x94
+.byte	0x9b,0x1e,0x87,0xe9,0xce,0x55,0x28,0xdf
+.byte	0x8c,0xa1,0x89,0x0d,0xbf,0xe6,0x42,0x68
+.byte	0x41,0x99,0x2d,0x0f,0xb0,0x54,0xbb,0x16
+.byte	0x63,0x7c,0x77,0x7b,0xf2,0x6b,0x6f,0xc5
+.byte	0x30,0x01,0x67,0x2b,0xfe,0xd7,0xab,0x76
+.byte	0xca,0x82,0xc9,0x7d,0xfa,0x59,0x47,0xf0
+.byte	0xad,0xd4,0xa2,0xaf,0x9c,0xa4,0x72,0xc0
+.byte	0xb7,0xfd,0x93,0x26,0x36,0x3f,0xf7,0xcc
+.byte	0x34,0xa5,0xe5,0xf1,0x71,0xd8,0x31,0x15
+.byte	0x04,0xc7,0x23,0xc3,0x18,0x96,0x05,0x9a
+.byte	0x07,0x12,0x80,0xe2,0xeb,0x27,0xb2,0x75
+.byte	0x09,0x83,0x2c,0x1a,0x1b,0x6e,0x5a,0xa0
+.byte	0x52,0x3b,0xd6,0xb3,0x29,0xe3,0x2f,0x84
+.byte	0x53,0xd1,0x00,0xed,0x20,0xfc,0xb1,0x5b
+.byte	0x6a,0xcb,0xbe,0x39,0x4a,0x4c,0x58,0xcf
+.byte	0xd0,0xef,0xaa,0xfb,0x43,0x4d,0x33,0x85
+.byte	0x45,0xf9,0x02,0x7f,0x50,0x3c,0x9f,0xa8
+.byte	0x51,0xa3,0x40,0x8f,0x92,0x9d,0x38,0xf5
+.byte	0xbc,0xb6,0xda,0x21,0x10,0xff,0xf3,0xd2
+.byte	0xcd,0x0c,0x13,0xec,0x5f,0x97,0x44,0x17
+.byte	0xc4,0xa7,0x7e,0x3d,0x64,0x5d,0x19,0x73
+.byte	0x60,0x81,0x4f,0xdc,0x22,0x2a,0x90,0x88
+.byte	0x46,0xee,0xb8,0x14,0xde,0x5e,0x0b,0xdb
+.byte	0xe0,0x32,0x3a,0x0a,0x49,0x06,0x24,0x5c
+.byte	0xc2,0xd3,0xac,0x62,0x91,0x95,0xe4,0x79
+.byte	0xe7,0xc8,0x37,0x6d,0x8d,0xd5,0x4e,0xa9
+.byte	0x6c,0x56,0xf4,0xea,0x65,0x7a,0xae,0x08
+.byte	0xba,0x78,0x25,0x2e,0x1c,0xa6,0xb4,0xc6
+.byte	0xe8,0xdd,0x74,0x1f,0x4b,0xbd,0x8b,0x8a
+.byte	0x70,0x3e,0xb5,0x66,0x48,0x03,0xf6,0x0e
+.byte	0x61,0x35,0x57,0xb9,0x86,0xc1,0x1d,0x9e
+.byte	0xe1,0xf8,0x98,0x11,0x69,0xd9,0x8e,0x94
+.byte	0x9b,0x1e,0x87,0xe9,0xce,0x55,0x28,0xdf
+.byte	0x8c,0xa1,0x89,0x0d,0xbf,0xe6,0x42,0x68
+.byte	0x41,0x99,0x2d,0x0f,0xb0,0x54,0xbb,0x16
+.byte	0x63,0x7c,0x77,0x7b,0xf2,0x6b,0x6f,0xc5
+.byte	0x30,0x01,0x67,0x2b,0xfe,0xd7,0xab,0x76
+.byte	0xca,0x82,0xc9,0x7d,0xfa,0x59,0x47,0xf0
+.byte	0xad,0xd4,0xa2,0xaf,0x9c,0xa4,0x72,0xc0
+.byte	0xb7,0xfd,0x93,0x26,0x36,0x3f,0xf7,0xcc
+.byte	0x34,0xa5,0xe5,0xf1,0x71,0xd8,0x31,0x15
+.byte	0x04,0xc7,0x23,0xc3,0x18,0x96,0x05,0x9a
+.byte	0x07,0x12,0x80,0xe2,0xeb,0x27,0xb2,0x75
+.byte	0x09,0x83,0x2c,0x1a,0x1b,0x6e,0x5a,0xa0
+.byte	0x52,0x3b,0xd6,0xb3,0x29,0xe3,0x2f,0x84
+.byte	0x53,0xd1,0x00,0xed,0x20,0xfc,0xb1,0x5b
+.byte	0x6a,0xcb,0xbe,0x39,0x4a,0x4c,0x58,0xcf
+.byte	0xd0,0xef,0xaa,0xfb,0x43,0x4d,0x33,0x85
+.byte	0x45,0xf9,0x02,0x7f,0x50,0x3c,0x9f,0xa8
+.byte	0x51,0xa3,0x40,0x8f,0x92,0x9d,0x38,0xf5
+.byte	0xbc,0xb6,0xda,0x21,0x10,0xff,0xf3,0xd2
+.byte	0xcd,0x0c,0x13,0xec,0x5f,0x97,0x44,0x17
+.byte	0xc4,0xa7,0x7e,0x3d,0x64,0x5d,0x19,0x73
+.byte	0x60,0x81,0x4f,0xdc,0x22,0x2a,0x90,0x88
+.byte	0x46,0xee,0xb8,0x14,0xde,0x5e,0x0b,0xdb
+.byte	0xe0,0x32,0x3a,0x0a,0x49,0x06,0x24,0x5c
+.byte	0xc2,0xd3,0xac,0x62,0x91,0x95,0xe4,0x79
+.byte	0xe7,0xc8,0x37,0x6d,0x8d,0xd5,0x4e,0xa9
+.byte	0x6c,0x56,0xf4,0xea,0x65,0x7a,0xae,0x08
+.byte	0xba,0x78,0x25,0x2e,0x1c,0xa6,0xb4,0xc6
+.byte	0xe8,0xdd,0x74,0x1f,0x4b,0xbd,0x8b,0x8a
+.byte	0x70,0x3e,0xb5,0x66,0x48,0x03,0xf6,0x0e
+.byte	0x61,0x35,0x57,0xb9,0x86,0xc1,0x1d,0x9e
+.byte	0xe1,0xf8,0x98,0x11,0x69,0xd9,0x8e,0x94
+.byte	0x9b,0x1e,0x87,0xe9,0xce,0x55,0x28,0xdf
+.byte	0x8c,0xa1,0x89,0x0d,0xbf,0xe6,0x42,0x68
+.byte	0x41,0x99,0x2d,0x0f,0xb0,0x54,0xbb,0x16
+.long	0x00000001, 0x00000002, 0x00000004, 0x00000008
+.long	0x00000010, 0x00000020, 0x00000040, 0x00000080
+.long	0x0000001b, 0x00000036, 0x80808080, 0x80808080
+.long	0xfefefefe, 0xfefefefe, 0x1b1b1b1b, 0x1b1b1b1b
+.align	64
+.LAES_Td:
+.long	0x50a7f451,0x50a7f451
+.long	0x5365417e,0x5365417e
+.long	0xc3a4171a,0xc3a4171a
+.long	0x965e273a,0x965e273a
+.long	0xcb6bab3b,0xcb6bab3b
+.long	0xf1459d1f,0xf1459d1f
+.long	0xab58faac,0xab58faac
+.long	0x9303e34b,0x9303e34b
+.long	0x55fa3020,0x55fa3020
+.long	0xf66d76ad,0xf66d76ad
+.long	0x9176cc88,0x9176cc88
+.long	0x254c02f5,0x254c02f5
+.long	0xfcd7e54f,0xfcd7e54f
+.long	0xd7cb2ac5,0xd7cb2ac5
+.long	0x80443526,0x80443526
+.long	0x8fa362b5,0x8fa362b5
+.long	0x495ab1de,0x495ab1de
+.long	0x671bba25,0x671bba25
+.long	0x980eea45,0x980eea45
+.long	0xe1c0fe5d,0xe1c0fe5d
+.long	0x02752fc3,0x02752fc3
+.long	0x12f04c81,0x12f04c81
+.long	0xa397468d,0xa397468d
+.long	0xc6f9d36b,0xc6f9d36b
+.long	0xe75f8f03,0xe75f8f03
+.long	0x959c9215,0x959c9215
+.long	0xeb7a6dbf,0xeb7a6dbf
+.long	0xda595295,0xda595295
+.long	0x2d83bed4,0x2d83bed4
+.long	0xd3217458,0xd3217458
+.long	0x2969e049,0x2969e049
+.long	0x44c8c98e,0x44c8c98e
+.long	0x6a89c275,0x6a89c275
+.long	0x78798ef4,0x78798ef4
+.long	0x6b3e5899,0x6b3e5899
+.long	0xdd71b927,0xdd71b927
+.long	0xb64fe1be,0xb64fe1be
+.long	0x17ad88f0,0x17ad88f0
+.long	0x66ac20c9,0x66ac20c9
+.long	0xb43ace7d,0xb43ace7d
+.long	0x184adf63,0x184adf63
+.long	0x82311ae5,0x82311ae5
+.long	0x60335197,0x60335197
+.long	0x457f5362,0x457f5362
+.long	0xe07764b1,0xe07764b1
+.long	0x84ae6bbb,0x84ae6bbb
+.long	0x1ca081fe,0x1ca081fe
+.long	0x942b08f9,0x942b08f9
+.long	0x58684870,0x58684870
+.long	0x19fd458f,0x19fd458f
+.long	0x876cde94,0x876cde94
+.long	0xb7f87b52,0xb7f87b52
+.long	0x23d373ab,0x23d373ab
+.long	0xe2024b72,0xe2024b72
+.long	0x578f1fe3,0x578f1fe3
+.long	0x2aab5566,0x2aab5566
+.long	0x0728ebb2,0x0728ebb2
+.long	0x03c2b52f,0x03c2b52f
+.long	0x9a7bc586,0x9a7bc586
+.long	0xa50837d3,0xa50837d3
+.long	0xf2872830,0xf2872830
+.long	0xb2a5bf23,0xb2a5bf23
+.long	0xba6a0302,0xba6a0302
+.long	0x5c8216ed,0x5c8216ed
+.long	0x2b1ccf8a,0x2b1ccf8a
+.long	0x92b479a7,0x92b479a7
+.long	0xf0f207f3,0xf0f207f3
+.long	0xa1e2694e,0xa1e2694e
+.long	0xcdf4da65,0xcdf4da65
+.long	0xd5be0506,0xd5be0506
+.long	0x1f6234d1,0x1f6234d1
+.long	0x8afea6c4,0x8afea6c4
+.long	0x9d532e34,0x9d532e34
+.long	0xa055f3a2,0xa055f3a2
+.long	0x32e18a05,0x32e18a05
+.long	0x75ebf6a4,0x75ebf6a4
+.long	0x39ec830b,0x39ec830b
+.long	0xaaef6040,0xaaef6040
+.long	0x069f715e,0x069f715e
+.long	0x51106ebd,0x51106ebd
+.long	0xf98a213e,0xf98a213e
+.long	0x3d06dd96,0x3d06dd96
+.long	0xae053edd,0xae053edd
+.long	0x46bde64d,0x46bde64d
+.long	0xb58d5491,0xb58d5491
+.long	0x055dc471,0x055dc471
+.long	0x6fd40604,0x6fd40604
+.long	0xff155060,0xff155060
+.long	0x24fb9819,0x24fb9819
+.long	0x97e9bdd6,0x97e9bdd6
+.long	0xcc434089,0xcc434089
+.long	0x779ed967,0x779ed967
+.long	0xbd42e8b0,0xbd42e8b0
+.long	0x888b8907,0x888b8907
+.long	0x385b19e7,0x385b19e7
+.long	0xdbeec879,0xdbeec879
+.long	0x470a7ca1,0x470a7ca1
+.long	0xe90f427c,0xe90f427c
+.long	0xc91e84f8,0xc91e84f8
+.long	0x00000000,0x00000000
+.long	0x83868009,0x83868009
+.long	0x48ed2b32,0x48ed2b32
+.long	0xac70111e,0xac70111e
+.long	0x4e725a6c,0x4e725a6c
+.long	0xfbff0efd,0xfbff0efd
+.long	0x5638850f,0x5638850f
+.long	0x1ed5ae3d,0x1ed5ae3d
+.long	0x27392d36,0x27392d36
+.long	0x64d90f0a,0x64d90f0a
+.long	0x21a65c68,0x21a65c68
+.long	0xd1545b9b,0xd1545b9b
+.long	0x3a2e3624,0x3a2e3624
+.long	0xb1670a0c,0xb1670a0c
+.long	0x0fe75793,0x0fe75793
+.long	0xd296eeb4,0xd296eeb4
+.long	0x9e919b1b,0x9e919b1b
+.long	0x4fc5c080,0x4fc5c080
+.long	0xa220dc61,0xa220dc61
+.long	0x694b775a,0x694b775a
+.long	0x161a121c,0x161a121c
+.long	0x0aba93e2,0x0aba93e2
+.long	0xe52aa0c0,0xe52aa0c0
+.long	0x43e0223c,0x43e0223c
+.long	0x1d171b12,0x1d171b12
+.long	0x0b0d090e,0x0b0d090e
+.long	0xadc78bf2,0xadc78bf2
+.long	0xb9a8b62d,0xb9a8b62d
+.long	0xc8a91e14,0xc8a91e14
+.long	0x8519f157,0x8519f157
+.long	0x4c0775af,0x4c0775af
+.long	0xbbdd99ee,0xbbdd99ee
+.long	0xfd607fa3,0xfd607fa3
+.long	0x9f2601f7,0x9f2601f7
+.long	0xbcf5725c,0xbcf5725c
+.long	0xc53b6644,0xc53b6644
+.long	0x347efb5b,0x347efb5b
+.long	0x7629438b,0x7629438b
+.long	0xdcc623cb,0xdcc623cb
+.long	0x68fcedb6,0x68fcedb6
+.long	0x63f1e4b8,0x63f1e4b8
+.long	0xcadc31d7,0xcadc31d7
+.long	0x10856342,0x10856342
+.long	0x40229713,0x40229713
+.long	0x2011c684,0x2011c684
+.long	0x7d244a85,0x7d244a85
+.long	0xf83dbbd2,0xf83dbbd2
+.long	0x1132f9ae,0x1132f9ae
+.long	0x6da129c7,0x6da129c7
+.long	0x4b2f9e1d,0x4b2f9e1d
+.long	0xf330b2dc,0xf330b2dc
+.long	0xec52860d,0xec52860d
+.long	0xd0e3c177,0xd0e3c177
+.long	0x6c16b32b,0x6c16b32b
+.long	0x99b970a9,0x99b970a9
+.long	0xfa489411,0xfa489411
+.long	0x2264e947,0x2264e947
+.long	0xc48cfca8,0xc48cfca8
+.long	0x1a3ff0a0,0x1a3ff0a0
+.long	0xd82c7d56,0xd82c7d56
+.long	0xef903322,0xef903322
+.long	0xc74e4987,0xc74e4987
+.long	0xc1d138d9,0xc1d138d9
+.long	0xfea2ca8c,0xfea2ca8c
+.long	0x360bd498,0x360bd498
+.long	0xcf81f5a6,0xcf81f5a6
+.long	0x28de7aa5,0x28de7aa5
+.long	0x268eb7da,0x268eb7da
+.long	0xa4bfad3f,0xa4bfad3f
+.long	0xe49d3a2c,0xe49d3a2c
+.long	0x0d927850,0x0d927850
+.long	0x9bcc5f6a,0x9bcc5f6a
+.long	0x62467e54,0x62467e54
+.long	0xc2138df6,0xc2138df6
+.long	0xe8b8d890,0xe8b8d890
+.long	0x5ef7392e,0x5ef7392e
+.long	0xf5afc382,0xf5afc382
+.long	0xbe805d9f,0xbe805d9f
+.long	0x7c93d069,0x7c93d069
+.long	0xa92dd56f,0xa92dd56f
+.long	0xb31225cf,0xb31225cf
+.long	0x3b99acc8,0x3b99acc8
+.long	0xa77d1810,0xa77d1810
+.long	0x6e639ce8,0x6e639ce8
+.long	0x7bbb3bdb,0x7bbb3bdb
+.long	0x097826cd,0x097826cd
+.long	0xf418596e,0xf418596e
+.long	0x01b79aec,0x01b79aec
+.long	0xa89a4f83,0xa89a4f83
+.long	0x656e95e6,0x656e95e6
+.long	0x7ee6ffaa,0x7ee6ffaa
+.long	0x08cfbc21,0x08cfbc21
+.long	0xe6e815ef,0xe6e815ef
+.long	0xd99be7ba,0xd99be7ba
+.long	0xce366f4a,0xce366f4a
+.long	0xd4099fea,0xd4099fea
+.long	0xd67cb029,0xd67cb029
+.long	0xafb2a431,0xafb2a431
+.long	0x31233f2a,0x31233f2a
+.long	0x3094a5c6,0x3094a5c6
+.long	0xc066a235,0xc066a235
+.long	0x37bc4e74,0x37bc4e74
+.long	0xa6ca82fc,0xa6ca82fc
+.long	0xb0d090e0,0xb0d090e0
+.long	0x15d8a733,0x15d8a733
+.long	0x4a9804f1,0x4a9804f1
+.long	0xf7daec41,0xf7daec41
+.long	0x0e50cd7f,0x0e50cd7f
+.long	0x2ff69117,0x2ff69117
+.long	0x8dd64d76,0x8dd64d76
+.long	0x4db0ef43,0x4db0ef43
+.long	0x544daacc,0x544daacc
+.long	0xdf0496e4,0xdf0496e4
+.long	0xe3b5d19e,0xe3b5d19e
+.long	0x1b886a4c,0x1b886a4c
+.long	0xb81f2cc1,0xb81f2cc1
+.long	0x7f516546,0x7f516546
+.long	0x04ea5e9d,0x04ea5e9d
+.long	0x5d358c01,0x5d358c01
+.long	0x737487fa,0x737487fa
+.long	0x2e410bfb,0x2e410bfb
+.long	0x5a1d67b3,0x5a1d67b3
+.long	0x52d2db92,0x52d2db92
+.long	0x335610e9,0x335610e9
+.long	0x1347d66d,0x1347d66d
+.long	0x8c61d79a,0x8c61d79a
+.long	0x7a0ca137,0x7a0ca137
+.long	0x8e14f859,0x8e14f859
+.long	0x893c13eb,0x893c13eb
+.long	0xee27a9ce,0xee27a9ce
+.long	0x35c961b7,0x35c961b7
+.long	0xede51ce1,0xede51ce1
+.long	0x3cb1477a,0x3cb1477a
+.long	0x59dfd29c,0x59dfd29c
+.long	0x3f73f255,0x3f73f255
+.long	0x79ce1418,0x79ce1418
+.long	0xbf37c773,0xbf37c773
+.long	0xeacdf753,0xeacdf753
+.long	0x5baafd5f,0x5baafd5f
+.long	0x146f3ddf,0x146f3ddf
+.long	0x86db4478,0x86db4478
+.long	0x81f3afca,0x81f3afca
+.long	0x3ec468b9,0x3ec468b9
+.long	0x2c342438,0x2c342438
+.long	0x5f40a3c2,0x5f40a3c2
+.long	0x72c31d16,0x72c31d16
+.long	0x0c25e2bc,0x0c25e2bc
+.long	0x8b493c28,0x8b493c28
+.long	0x41950dff,0x41950dff
+.long	0x7101a839,0x7101a839
+.long	0xdeb30c08,0xdeb30c08
+.long	0x9ce4b4d8,0x9ce4b4d8
+.long	0x90c15664,0x90c15664
+.long	0x6184cb7b,0x6184cb7b
+.long	0x70b632d5,0x70b632d5
+.long	0x745c6c48,0x745c6c48
+.long	0x4257b8d0,0x4257b8d0
+.byte	0x52,0x09,0x6a,0xd5,0x30,0x36,0xa5,0x38
+.byte	0xbf,0x40,0xa3,0x9e,0x81,0xf3,0xd7,0xfb
+.byte	0x7c,0xe3,0x39,0x82,0x9b,0x2f,0xff,0x87
+.byte	0x34,0x8e,0x43,0x44,0xc4,0xde,0xe9,0xcb
+.byte	0x54,0x7b,0x94,0x32,0xa6,0xc2,0x23,0x3d
+.byte	0xee,0x4c,0x95,0x0b,0x42,0xfa,0xc3,0x4e
+.byte	0x08,0x2e,0xa1,0x66,0x28,0xd9,0x24,0xb2
+.byte	0x76,0x5b,0xa2,0x49,0x6d,0x8b,0xd1,0x25
+.byte	0x72,0xf8,0xf6,0x64,0x86,0x68,0x98,0x16
+.byte	0xd4,0xa4,0x5c,0xcc,0x5d,0x65,0xb6,0x92
+.byte	0x6c,0x70,0x48,0x50,0xfd,0xed,0xb9,0xda
+.byte	0x5e,0x15,0x46,0x57,0xa7,0x8d,0x9d,0x84
+.byte	0x90,0xd8,0xab,0x00,0x8c,0xbc,0xd3,0x0a
+.byte	0xf7,0xe4,0x58,0x05,0xb8,0xb3,0x45,0x06
+.byte	0xd0,0x2c,0x1e,0x8f,0xca,0x3f,0x0f,0x02
+.byte	0xc1,0xaf,0xbd,0x03,0x01,0x13,0x8a,0x6b
+.byte	0x3a,0x91,0x11,0x41,0x4f,0x67,0xdc,0xea
+.byte	0x97,0xf2,0xcf,0xce,0xf0,0xb4,0xe6,0x73
+.byte	0x96,0xac,0x74,0x22,0xe7,0xad,0x35,0x85
+.byte	0xe2,0xf9,0x37,0xe8,0x1c,0x75,0xdf,0x6e
+.byte	0x47,0xf1,0x1a,0x71,0x1d,0x29,0xc5,0x89
+.byte	0x6f,0xb7,0x62,0x0e,0xaa,0x18,0xbe,0x1b
+.byte	0xfc,0x56,0x3e,0x4b,0xc6,0xd2,0x79,0x20
+.byte	0x9a,0xdb,0xc0,0xfe,0x78,0xcd,0x5a,0xf4
+.byte	0x1f,0xdd,0xa8,0x33,0x88,0x07,0xc7,0x31
+.byte	0xb1,0x12,0x10,0x59,0x27,0x80,0xec,0x5f
+.byte	0x60,0x51,0x7f,0xa9,0x19,0xb5,0x4a,0x0d
+.byte	0x2d,0xe5,0x7a,0x9f,0x93,0xc9,0x9c,0xef
+.byte	0xa0,0xe0,0x3b,0x4d,0xae,0x2a,0xf5,0xb0
+.byte	0xc8,0xeb,0xbb,0x3c,0x83,0x53,0x99,0x61
+.byte	0x17,0x2b,0x04,0x7e,0xba,0x77,0xd6,0x26
+.byte	0xe1,0x69,0x14,0x63,0x55,0x21,0x0c,0x7d
+.long	0x80808080, 0x80808080, 0xfefefefe, 0xfefefefe
+.long	0x1b1b1b1b, 0x1b1b1b1b, 0, 0
+.byte	0x52,0x09,0x6a,0xd5,0x30,0x36,0xa5,0x38
+.byte	0xbf,0x40,0xa3,0x9e,0x81,0xf3,0xd7,0xfb
+.byte	0x7c,0xe3,0x39,0x82,0x9b,0x2f,0xff,0x87
+.byte	0x34,0x8e,0x43,0x44,0xc4,0xde,0xe9,0xcb
+.byte	0x54,0x7b,0x94,0x32,0xa6,0xc2,0x23,0x3d
+.byte	0xee,0x4c,0x95,0x0b,0x42,0xfa,0xc3,0x4e
+.byte	0x08,0x2e,0xa1,0x66,0x28,0xd9,0x24,0xb2
+.byte	0x76,0x5b,0xa2,0x49,0x6d,0x8b,0xd1,0x25
+.byte	0x72,0xf8,0xf6,0x64,0x86,0x68,0x98,0x16
+.byte	0xd4,0xa4,0x5c,0xcc,0x5d,0x65,0xb6,0x92
+.byte	0x6c,0x70,0x48,0x50,0xfd,0xed,0xb9,0xda
+.byte	0x5e,0x15,0x46,0x57,0xa7,0x8d,0x9d,0x84
+.byte	0x90,0xd8,0xab,0x00,0x8c,0xbc,0xd3,0x0a
+.byte	0xf7,0xe4,0x58,0x05,0xb8,0xb3,0x45,0x06
+.byte	0xd0,0x2c,0x1e,0x8f,0xca,0x3f,0x0f,0x02
+.byte	0xc1,0xaf,0xbd,0x03,0x01,0x13,0x8a,0x6b
+.byte	0x3a,0x91,0x11,0x41,0x4f,0x67,0xdc,0xea
+.byte	0x97,0xf2,0xcf,0xce,0xf0,0xb4,0xe6,0x73
+.byte	0x96,0xac,0x74,0x22,0xe7,0xad,0x35,0x85
+.byte	0xe2,0xf9,0x37,0xe8,0x1c,0x75,0xdf,0x6e
+.byte	0x47,0xf1,0x1a,0x71,0x1d,0x29,0xc5,0x89
+.byte	0x6f,0xb7,0x62,0x0e,0xaa,0x18,0xbe,0x1b
+.byte	0xfc,0x56,0x3e,0x4b,0xc6,0xd2,0x79,0x20
+.byte	0x9a,0xdb,0xc0,0xfe,0x78,0xcd,0x5a,0xf4
+.byte	0x1f,0xdd,0xa8,0x33,0x88,0x07,0xc7,0x31
+.byte	0xb1,0x12,0x10,0x59,0x27,0x80,0xec,0x5f
+.byte	0x60,0x51,0x7f,0xa9,0x19,0xb5,0x4a,0x0d
+.byte	0x2d,0xe5,0x7a,0x9f,0x93,0xc9,0x9c,0xef
+.byte	0xa0,0xe0,0x3b,0x4d,0xae,0x2a,0xf5,0xb0
+.byte	0xc8,0xeb,0xbb,0x3c,0x83,0x53,0x99,0x61
+.byte	0x17,0x2b,0x04,0x7e,0xba,0x77,0xd6,0x26
+.byte	0xe1,0x69,0x14,0x63,0x55,0x21,0x0c,0x7d
+.long	0x80808080, 0x80808080, 0xfefefefe, 0xfefefefe
+.long	0x1b1b1b1b, 0x1b1b1b1b, 0, 0
+.byte	0x52,0x09,0x6a,0xd5,0x30,0x36,0xa5,0x38
+.byte	0xbf,0x40,0xa3,0x9e,0x81,0xf3,0xd7,0xfb
+.byte	0x7c,0xe3,0x39,0x82,0x9b,0x2f,0xff,0x87
+.byte	0x34,0x8e,0x43,0x44,0xc4,0xde,0xe9,0xcb
+.byte	0x54,0x7b,0x94,0x32,0xa6,0xc2,0x23,0x3d
+.byte	0xee,0x4c,0x95,0x0b,0x42,0xfa,0xc3,0x4e
+.byte	0x08,0x2e,0xa1,0x66,0x28,0xd9,0x24,0xb2
+.byte	0x76,0x5b,0xa2,0x49,0x6d,0x8b,0xd1,0x25
+.byte	0x72,0xf8,0xf6,0x64,0x86,0x68,0x98,0x16
+.byte	0xd4,0xa4,0x5c,0xcc,0x5d,0x65,0xb6,0x92
+.byte	0x6c,0x70,0x48,0x50,0xfd,0xed,0xb9,0xda
+.byte	0x5e,0x15,0x46,0x57,0xa7,0x8d,0x9d,0x84
+.byte	0x90,0xd8,0xab,0x00,0x8c,0xbc,0xd3,0x0a
+.byte	0xf7,0xe4,0x58,0x05,0xb8,0xb3,0x45,0x06
+.byte	0xd0,0x2c,0x1e,0x8f,0xca,0x3f,0x0f,0x02
+.byte	0xc1,0xaf,0xbd,0x03,0x01,0x13,0x8a,0x6b
+.byte	0x3a,0x91,0x11,0x41,0x4f,0x67,0xdc,0xea
+.byte	0x97,0xf2,0xcf,0xce,0xf0,0xb4,0xe6,0x73
+.byte	0x96,0xac,0x74,0x22,0xe7,0xad,0x35,0x85
+.byte	0xe2,0xf9,0x37,0xe8,0x1c,0x75,0xdf,0x6e
+.byte	0x47,0xf1,0x1a,0x71,0x1d,0x29,0xc5,0x89
+.byte	0x6f,0xb7,0x62,0x0e,0xaa,0x18,0xbe,0x1b
+.byte	0xfc,0x56,0x3e,0x4b,0xc6,0xd2,0x79,0x20
+.byte	0x9a,0xdb,0xc0,0xfe,0x78,0xcd,0x5a,0xf4
+.byte	0x1f,0xdd,0xa8,0x33,0x88,0x07,0xc7,0x31
+.byte	0xb1,0x12,0x10,0x59,0x27,0x80,0xec,0x5f
+.byte	0x60,0x51,0x7f,0xa9,0x19,0xb5,0x4a,0x0d
+.byte	0x2d,0xe5,0x7a,0x9f,0x93,0xc9,0x9c,0xef
+.byte	0xa0,0xe0,0x3b,0x4d,0xae,0x2a,0xf5,0xb0
+.byte	0xc8,0xeb,0xbb,0x3c,0x83,0x53,0x99,0x61
+.byte	0x17,0x2b,0x04,0x7e,0xba,0x77,0xd6,0x26
+.byte	0xe1,0x69,0x14,0x63,0x55,0x21,0x0c,0x7d
+.long	0x80808080, 0x80808080, 0xfefefefe, 0xfefefefe
+.long	0x1b1b1b1b, 0x1b1b1b1b, 0, 0
+.byte	0x52,0x09,0x6a,0xd5,0x30,0x36,0xa5,0x38
+.byte	0xbf,0x40,0xa3,0x9e,0x81,0xf3,0xd7,0xfb
+.byte	0x7c,0xe3,0x39,0x82,0x9b,0x2f,0xff,0x87
+.byte	0x34,0x8e,0x43,0x44,0xc4,0xde,0xe9,0xcb
+.byte	0x54,0x7b,0x94,0x32,0xa6,0xc2,0x23,0x3d
+.byte	0xee,0x4c,0x95,0x0b,0x42,0xfa,0xc3,0x4e
+.byte	0x08,0x2e,0xa1,0x66,0x28,0xd9,0x24,0xb2
+.byte	0x76,0x5b,0xa2,0x49,0x6d,0x8b,0xd1,0x25
+.byte	0x72,0xf8,0xf6,0x64,0x86,0x68,0x98,0x16
+.byte	0xd4,0xa4,0x5c,0xcc,0x5d,0x65,0xb6,0x92
+.byte	0x6c,0x70,0x48,0x50,0xfd,0xed,0xb9,0xda
+.byte	0x5e,0x15,0x46,0x57,0xa7,0x8d,0x9d,0x84
+.byte	0x90,0xd8,0xab,0x00,0x8c,0xbc,0xd3,0x0a
+.byte	0xf7,0xe4,0x58,0x05,0xb8,0xb3,0x45,0x06
+.byte	0xd0,0x2c,0x1e,0x8f,0xca,0x3f,0x0f,0x02
+.byte	0xc1,0xaf,0xbd,0x03,0x01,0x13,0x8a,0x6b
+.byte	0x3a,0x91,0x11,0x41,0x4f,0x67,0xdc,0xea
+.byte	0x97,0xf2,0xcf,0xce,0xf0,0xb4,0xe6,0x73
+.byte	0x96,0xac,0x74,0x22,0xe7,0xad,0x35,0x85
+.byte	0xe2,0xf9,0x37,0xe8,0x1c,0x75,0xdf,0x6e
+.byte	0x47,0xf1,0x1a,0x71,0x1d,0x29,0xc5,0x89
+.byte	0x6f,0xb7,0x62,0x0e,0xaa,0x18,0xbe,0x1b
+.byte	0xfc,0x56,0x3e,0x4b,0xc6,0xd2,0x79,0x20
+.byte	0x9a,0xdb,0xc0,0xfe,0x78,0xcd,0x5a,0xf4
+.byte	0x1f,0xdd,0xa8,0x33,0x88,0x07,0xc7,0x31
+.byte	0xb1,0x12,0x10,0x59,0x27,0x80,0xec,0x5f
+.byte	0x60,0x51,0x7f,0xa9,0x19,0xb5,0x4a,0x0d
+.byte	0x2d,0xe5,0x7a,0x9f,0x93,0xc9,0x9c,0xef
+.byte	0xa0,0xe0,0x3b,0x4d,0xae,0x2a,0xf5,0xb0
+.byte	0xc8,0xeb,0xbb,0x3c,0x83,0x53,0x99,0x61
+.byte	0x17,0x2b,0x04,0x7e,0xba,0x77,0xd6,0x26
+.byte	0xe1,0x69,0x14,0x63,0x55,0x21,0x0c,0x7d
+.long	0x80808080, 0x80808080, 0xfefefefe, 0xfefefefe
+.long	0x1b1b1b1b, 0x1b1b1b1b, 0, 0
+.byte	65,69,83,32,102,111,114,32,120,56,54,95,54,52,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0
+.align	64
+#endif
diff --git a/third_party/boringssl/linux-x86_64/crypto/aes/aesni-x86_64.S b/third_party/boringssl/linux-x86_64/crypto/aes/aesni-x86_64.S
new file mode 100644
index 0000000..1d51d5b
--- /dev/null
+++ b/third_party/boringssl/linux-x86_64/crypto/aes/aesni-x86_64.S
@@ -0,0 +1,3565 @@
+#if defined(__x86_64__)
+.text	
+.extern	OPENSSL_ia32cap_P
+.hidden OPENSSL_ia32cap_P
+.globl	aesni_encrypt
+.hidden aesni_encrypt
+.type	aesni_encrypt,@function
+.align	16
+aesni_encrypt:
+	movups	(%rdi),%xmm2
+	movl	240(%rdx),%eax
+	movups	(%rdx),%xmm0
+	movups	16(%rdx),%xmm1
+	leaq	32(%rdx),%rdx
+	xorps	%xmm0,%xmm2
+.Loop_enc1_1:
+.byte	102,15,56,220,209
+	decl	%eax
+	movups	(%rdx),%xmm1
+	leaq	16(%rdx),%rdx
+	jnz	.Loop_enc1_1
+.byte	102,15,56,221,209
+	pxor	%xmm0,%xmm0
+	pxor	%xmm1,%xmm1
+	movups	%xmm2,(%rsi)
+	pxor	%xmm2,%xmm2
+	.byte	0xf3,0xc3
+.size	aesni_encrypt,.-aesni_encrypt
+
+.globl	aesni_decrypt
+.hidden aesni_decrypt
+.type	aesni_decrypt,@function
+.align	16
+aesni_decrypt:
+	movups	(%rdi),%xmm2
+	movl	240(%rdx),%eax
+	movups	(%rdx),%xmm0
+	movups	16(%rdx),%xmm1
+	leaq	32(%rdx),%rdx
+	xorps	%xmm0,%xmm2
+.Loop_dec1_2:
+.byte	102,15,56,222,209
+	decl	%eax
+	movups	(%rdx),%xmm1
+	leaq	16(%rdx),%rdx
+	jnz	.Loop_dec1_2
+.byte	102,15,56,223,209
+	pxor	%xmm0,%xmm0
+	pxor	%xmm1,%xmm1
+	movups	%xmm2,(%rsi)
+	pxor	%xmm2,%xmm2
+	.byte	0xf3,0xc3
+.size	aesni_decrypt, .-aesni_decrypt
+.type	_aesni_encrypt2,@function
+.align	16
+_aesni_encrypt2:
+	movups	(%rcx),%xmm0
+	shll	$4,%eax
+	movups	16(%rcx),%xmm1
+	xorps	%xmm0,%xmm2
+	xorps	%xmm0,%xmm3
+	movups	32(%rcx),%xmm0
+	leaq	32(%rcx,%rax,1),%rcx
+	negq	%rax
+	addq	$16,%rax
+
+.Lenc_loop2:
+.byte	102,15,56,220,209
+.byte	102,15,56,220,217
+	movups	(%rcx,%rax,1),%xmm1
+	addq	$32,%rax
+.byte	102,15,56,220,208
+.byte	102,15,56,220,216
+	movups	-16(%rcx,%rax,1),%xmm0
+	jnz	.Lenc_loop2
+
+.byte	102,15,56,220,209
+.byte	102,15,56,220,217
+.byte	102,15,56,221,208
+.byte	102,15,56,221,216
+	.byte	0xf3,0xc3
+.size	_aesni_encrypt2,.-_aesni_encrypt2
+.type	_aesni_decrypt2,@function
+.align	16
+_aesni_decrypt2:
+	movups	(%rcx),%xmm0
+	shll	$4,%eax
+	movups	16(%rcx),%xmm1
+	xorps	%xmm0,%xmm2
+	xorps	%xmm0,%xmm3
+	movups	32(%rcx),%xmm0
+	leaq	32(%rcx,%rax,1),%rcx
+	negq	%rax
+	addq	$16,%rax
+
+.Ldec_loop2:
+.byte	102,15,56,222,209
+.byte	102,15,56,222,217
+	movups	(%rcx,%rax,1),%xmm1
+	addq	$32,%rax
+.byte	102,15,56,222,208
+.byte	102,15,56,222,216
+	movups	-16(%rcx,%rax,1),%xmm0
+	jnz	.Ldec_loop2
+
+.byte	102,15,56,222,209
+.byte	102,15,56,222,217
+.byte	102,15,56,223,208
+.byte	102,15,56,223,216
+	.byte	0xf3,0xc3
+.size	_aesni_decrypt2,.-_aesni_decrypt2
+.type	_aesni_encrypt3,@function
+.align	16
+_aesni_encrypt3:
+	movups	(%rcx),%xmm0
+	shll	$4,%eax
+	movups	16(%rcx),%xmm1
+	xorps	%xmm0,%xmm2
+	xorps	%xmm0,%xmm3
+	xorps	%xmm0,%xmm4
+	movups	32(%rcx),%xmm0
+	leaq	32(%rcx,%rax,1),%rcx
+	negq	%rax
+	addq	$16,%rax
+
+.Lenc_loop3:
+.byte	102,15,56,220,209
+.byte	102,15,56,220,217
+.byte	102,15,56,220,225
+	movups	(%rcx,%rax,1),%xmm1
+	addq	$32,%rax
+.byte	102,15,56,220,208
+.byte	102,15,56,220,216
+.byte	102,15,56,220,224
+	movups	-16(%rcx,%rax,1),%xmm0
+	jnz	.Lenc_loop3
+
+.byte	102,15,56,220,209
+.byte	102,15,56,220,217
+.byte	102,15,56,220,225
+.byte	102,15,56,221,208
+.byte	102,15,56,221,216
+.byte	102,15,56,221,224
+	.byte	0xf3,0xc3
+.size	_aesni_encrypt3,.-_aesni_encrypt3
+.type	_aesni_decrypt3,@function
+.align	16
+_aesni_decrypt3:
+	movups	(%rcx),%xmm0
+	shll	$4,%eax
+	movups	16(%rcx),%xmm1
+	xorps	%xmm0,%xmm2
+	xorps	%xmm0,%xmm3
+	xorps	%xmm0,%xmm4
+	movups	32(%rcx),%xmm0
+	leaq	32(%rcx,%rax,1),%rcx
+	negq	%rax
+	addq	$16,%rax
+
+.Ldec_loop3:
+.byte	102,15,56,222,209
+.byte	102,15,56,222,217
+.byte	102,15,56,222,225
+	movups	(%rcx,%rax,1),%xmm1
+	addq	$32,%rax
+.byte	102,15,56,222,208
+.byte	102,15,56,222,216
+.byte	102,15,56,222,224
+	movups	-16(%rcx,%rax,1),%xmm0
+	jnz	.Ldec_loop3
+
+.byte	102,15,56,222,209
+.byte	102,15,56,222,217
+.byte	102,15,56,222,225
+.byte	102,15,56,223,208
+.byte	102,15,56,223,216
+.byte	102,15,56,223,224
+	.byte	0xf3,0xc3
+.size	_aesni_decrypt3,.-_aesni_decrypt3
+.type	_aesni_encrypt4,@function
+.align	16
+_aesni_encrypt4:
+	movups	(%rcx),%xmm0
+	shll	$4,%eax
+	movups	16(%rcx),%xmm1
+	xorps	%xmm0,%xmm2
+	xorps	%xmm0,%xmm3
+	xorps	%xmm0,%xmm4
+	xorps	%xmm0,%xmm5
+	movups	32(%rcx),%xmm0
+	leaq	32(%rcx,%rax,1),%rcx
+	negq	%rax
+.byte	0x0f,0x1f,0x00
+	addq	$16,%rax
+
+.Lenc_loop4:
+.byte	102,15,56,220,209
+.byte	102,15,56,220,217
+.byte	102,15,56,220,225
+.byte	102,15,56,220,233
+	movups	(%rcx,%rax,1),%xmm1
+	addq	$32,%rax
+.byte	102,15,56,220,208
+.byte	102,15,56,220,216
+.byte	102,15,56,220,224
+.byte	102,15,56,220,232
+	movups	-16(%rcx,%rax,1),%xmm0
+	jnz	.Lenc_loop4
+
+.byte	102,15,56,220,209
+.byte	102,15,56,220,217
+.byte	102,15,56,220,225
+.byte	102,15,56,220,233
+.byte	102,15,56,221,208
+.byte	102,15,56,221,216
+.byte	102,15,56,221,224
+.byte	102,15,56,221,232
+	.byte	0xf3,0xc3
+.size	_aesni_encrypt4,.-_aesni_encrypt4
+.type	_aesni_decrypt4,@function
+.align	16
+_aesni_decrypt4:
+	movups	(%rcx),%xmm0
+	shll	$4,%eax
+	movups	16(%rcx),%xmm1
+	xorps	%xmm0,%xmm2
+	xorps	%xmm0,%xmm3
+	xorps	%xmm0,%xmm4
+	xorps	%xmm0,%xmm5
+	movups	32(%rcx),%xmm0
+	leaq	32(%rcx,%rax,1),%rcx
+	negq	%rax
+.byte	0x0f,0x1f,0x00
+	addq	$16,%rax
+
+.Ldec_loop4:
+.byte	102,15,56,222,209
+.byte	102,15,56,222,217
+.byte	102,15,56,222,225
+.byte	102,15,56,222,233
+	movups	(%rcx,%rax,1),%xmm1
+	addq	$32,%rax
+.byte	102,15,56,222,208
+.byte	102,15,56,222,216
+.byte	102,15,56,222,224
+.byte	102,15,56,222,232
+	movups	-16(%rcx,%rax,1),%xmm0
+	jnz	.Ldec_loop4
+
+.byte	102,15,56,222,209
+.byte	102,15,56,222,217
+.byte	102,15,56,222,225
+.byte	102,15,56,222,233
+.byte	102,15,56,223,208
+.byte	102,15,56,223,216
+.byte	102,15,56,223,224
+.byte	102,15,56,223,232
+	.byte	0xf3,0xc3
+.size	_aesni_decrypt4,.-_aesni_decrypt4
+.type	_aesni_encrypt6,@function
+.align	16
+_aesni_encrypt6:
+	movups	(%rcx),%xmm0
+	shll	$4,%eax
+	movups	16(%rcx),%xmm1
+	xorps	%xmm0,%xmm2
+	pxor	%xmm0,%xmm3
+	pxor	%xmm0,%xmm4
+.byte	102,15,56,220,209
+	leaq	32(%rcx,%rax,1),%rcx
+	negq	%rax
+.byte	102,15,56,220,217
+	pxor	%xmm0,%xmm5
+	pxor	%xmm0,%xmm6
+.byte	102,15,56,220,225
+	pxor	%xmm0,%xmm7
+	movups	(%rcx,%rax,1),%xmm0
+	addq	$16,%rax
+	jmp	.Lenc_loop6_enter
+.align	16
+.Lenc_loop6:
+.byte	102,15,56,220,209
+.byte	102,15,56,220,217
+.byte	102,15,56,220,225
+.Lenc_loop6_enter:
+.byte	102,15,56,220,233
+.byte	102,15,56,220,241
+.byte	102,15,56,220,249
+	movups	(%rcx,%rax,1),%xmm1
+	addq	$32,%rax
+.byte	102,15,56,220,208
+.byte	102,15,56,220,216
+.byte	102,15,56,220,224
+.byte	102,15,56,220,232
+.byte	102,15,56,220,240
+.byte	102,15,56,220,248
+	movups	-16(%rcx,%rax,1),%xmm0
+	jnz	.Lenc_loop6
+
+.byte	102,15,56,220,209
+.byte	102,15,56,220,217
+.byte	102,15,56,220,225
+.byte	102,15,56,220,233
+.byte	102,15,56,220,241
+.byte	102,15,56,220,249
+.byte	102,15,56,221,208
+.byte	102,15,56,221,216
+.byte	102,15,56,221,224
+.byte	102,15,56,221,232
+.byte	102,15,56,221,240
+.byte	102,15,56,221,248
+	.byte	0xf3,0xc3
+.size	_aesni_encrypt6,.-_aesni_encrypt6
+.type	_aesni_decrypt6,@function
+.align	16
+_aesni_decrypt6:
+	movups	(%rcx),%xmm0
+	shll	$4,%eax
+	movups	16(%rcx),%xmm1
+	xorps	%xmm0,%xmm2
+	pxor	%xmm0,%xmm3
+	pxor	%xmm0,%xmm4
+.byte	102,15,56,222,209
+	leaq	32(%rcx,%rax,1),%rcx
+	negq	%rax
+.byte	102,15,56,222,217
+	pxor	%xmm0,%xmm5
+	pxor	%xmm0,%xmm6
+.byte	102,15,56,222,225
+	pxor	%xmm0,%xmm7
+	movups	(%rcx,%rax,1),%xmm0
+	addq	$16,%rax
+	jmp	.Ldec_loop6_enter
+.align	16
+.Ldec_loop6:
+.byte	102,15,56,222,209
+.byte	102,15,56,222,217
+.byte	102,15,56,222,225
+.Ldec_loop6_enter:
+.byte	102,15,56,222,233
+.byte	102,15,56,222,241
+.byte	102,15,56,222,249
+	movups	(%rcx,%rax,1),%xmm1
+	addq	$32,%rax
+.byte	102,15,56,222,208
+.byte	102,15,56,222,216
+.byte	102,15,56,222,224
+.byte	102,15,56,222,232
+.byte	102,15,56,222,240
+.byte	102,15,56,222,248
+	movups	-16(%rcx,%rax,1),%xmm0
+	jnz	.Ldec_loop6
+
+.byte	102,15,56,222,209
+.byte	102,15,56,222,217
+.byte	102,15,56,222,225
+.byte	102,15,56,222,233
+.byte	102,15,56,222,241
+.byte	102,15,56,222,249
+.byte	102,15,56,223,208
+.byte	102,15,56,223,216
+.byte	102,15,56,223,224
+.byte	102,15,56,223,232
+.byte	102,15,56,223,240
+.byte	102,15,56,223,248
+	.byte	0xf3,0xc3
+.size	_aesni_decrypt6,.-_aesni_decrypt6
+.type	_aesni_encrypt8,@function
+.align	16
+_aesni_encrypt8:
+	movups	(%rcx),%xmm0
+	shll	$4,%eax
+	movups	16(%rcx),%xmm1
+	xorps	%xmm0,%xmm2
+	xorps	%xmm0,%xmm3
+	pxor	%xmm0,%xmm4
+	pxor	%xmm0,%xmm5
+	pxor	%xmm0,%xmm6
+	leaq	32(%rcx,%rax,1),%rcx
+	negq	%rax
+.byte	102,15,56,220,209
+	pxor	%xmm0,%xmm7
+	pxor	%xmm0,%xmm8
+.byte	102,15,56,220,217
+	pxor	%xmm0,%xmm9
+	movups	(%rcx,%rax,1),%xmm0
+	addq	$16,%rax
+	jmp	.Lenc_loop8_inner
+.align	16
+.Lenc_loop8:
+.byte	102,15,56,220,209
+.byte	102,15,56,220,217
+.Lenc_loop8_inner:
+.byte	102,15,56,220,225
+.byte	102,15,56,220,233
+.byte	102,15,56,220,241
+.byte	102,15,56,220,249
+.byte	102,68,15,56,220,193
+.byte	102,68,15,56,220,201
+.Lenc_loop8_enter:
+	movups	(%rcx,%rax,1),%xmm1
+	addq	$32,%rax
+.byte	102,15,56,220,208
+.byte	102,15,56,220,216
+.byte	102,15,56,220,224
+.byte	102,15,56,220,232
+.byte	102,15,56,220,240
+.byte	102,15,56,220,248
+.byte	102,68,15,56,220,192
+.byte	102,68,15,56,220,200
+	movups	-16(%rcx,%rax,1),%xmm0
+	jnz	.Lenc_loop8
+
+.byte	102,15,56,220,209
+.byte	102,15,56,220,217
+.byte	102,15,56,220,225
+.byte	102,15,56,220,233
+.byte	102,15,56,220,241
+.byte	102,15,56,220,249
+.byte	102,68,15,56,220,193
+.byte	102,68,15,56,220,201
+.byte	102,15,56,221,208
+.byte	102,15,56,221,216
+.byte	102,15,56,221,224
+.byte	102,15,56,221,232
+.byte	102,15,56,221,240
+.byte	102,15,56,221,248
+.byte	102,68,15,56,221,192
+.byte	102,68,15,56,221,200
+	.byte	0xf3,0xc3
+.size	_aesni_encrypt8,.-_aesni_encrypt8
+.type	_aesni_decrypt8,@function
+.align	16
+_aesni_decrypt8:
+	movups	(%rcx),%xmm0
+	shll	$4,%eax
+	movups	16(%rcx),%xmm1
+	xorps	%xmm0,%xmm2
+	xorps	%xmm0,%xmm3
+	pxor	%xmm0,%xmm4
+	pxor	%xmm0,%xmm5
+	pxor	%xmm0,%xmm6
+	leaq	32(%rcx,%rax,1),%rcx
+	negq	%rax
+.byte	102,15,56,222,209
+	pxor	%xmm0,%xmm7
+	pxor	%xmm0,%xmm8
+.byte	102,15,56,222,217
+	pxor	%xmm0,%xmm9
+	movups	(%rcx,%rax,1),%xmm0
+	addq	$16,%rax
+	jmp	.Ldec_loop8_inner
+.align	16
+.Ldec_loop8:
+.byte	102,15,56,222,209
+.byte	102,15,56,222,217
+.Ldec_loop8_inner:
+.byte	102,15,56,222,225
+.byte	102,15,56,222,233
+.byte	102,15,56,222,241
+.byte	102,15,56,222,249
+.byte	102,68,15,56,222,193
+.byte	102,68,15,56,222,201
+.Ldec_loop8_enter:
+	movups	(%rcx,%rax,1),%xmm1
+	addq	$32,%rax
+.byte	102,15,56,222,208
+.byte	102,15,56,222,216
+.byte	102,15,56,222,224
+.byte	102,15,56,222,232
+.byte	102,15,56,222,240
+.byte	102,15,56,222,248
+.byte	102,68,15,56,222,192
+.byte	102,68,15,56,222,200
+	movups	-16(%rcx,%rax,1),%xmm0
+	jnz	.Ldec_loop8
+
+.byte	102,15,56,222,209
+.byte	102,15,56,222,217
+.byte	102,15,56,222,225
+.byte	102,15,56,222,233
+.byte	102,15,56,222,241
+.byte	102,15,56,222,249
+.byte	102,68,15,56,222,193
+.byte	102,68,15,56,222,201
+.byte	102,15,56,223,208
+.byte	102,15,56,223,216
+.byte	102,15,56,223,224
+.byte	102,15,56,223,232
+.byte	102,15,56,223,240
+.byte	102,15,56,223,248
+.byte	102,68,15,56,223,192
+.byte	102,68,15,56,223,200
+	.byte	0xf3,0xc3
+.size	_aesni_decrypt8,.-_aesni_decrypt8
+.globl	aesni_ecb_encrypt
+.hidden aesni_ecb_encrypt
+.type	aesni_ecb_encrypt,@function
+.align	16
+aesni_ecb_encrypt:
+	andq	$-16,%rdx
+	jz	.Lecb_ret
+
+	movl	240(%rcx),%eax
+	movups	(%rcx),%xmm0
+	movq	%rcx,%r11
+	movl	%eax,%r10d
+	testl	%r8d,%r8d
+	jz	.Lecb_decrypt
+
+	cmpq	$128,%rdx
+	jb	.Lecb_enc_tail
+
+	movdqu	(%rdi),%xmm2
+	movdqu	16(%rdi),%xmm3
+	movdqu	32(%rdi),%xmm4
+	movdqu	48(%rdi),%xmm5
+	movdqu	64(%rdi),%xmm6
+	movdqu	80(%rdi),%xmm7
+	movdqu	96(%rdi),%xmm8
+	movdqu	112(%rdi),%xmm9
+	leaq	128(%rdi),%rdi
+	subq	$128,%rdx
+	jmp	.Lecb_enc_loop8_enter
+.align	16
+.Lecb_enc_loop8:
+	movups	%xmm2,(%rsi)
+	movq	%r11,%rcx
+	movdqu	(%rdi),%xmm2
+	movl	%r10d,%eax
+	movups	%xmm3,16(%rsi)
+	movdqu	16(%rdi),%xmm3
+	movups	%xmm4,32(%rsi)
+	movdqu	32(%rdi),%xmm4
+	movups	%xmm5,48(%rsi)
+	movdqu	48(%rdi),%xmm5
+	movups	%xmm6,64(%rsi)
+	movdqu	64(%rdi),%xmm6
+	movups	%xmm7,80(%rsi)
+	movdqu	80(%rdi),%xmm7
+	movups	%xmm8,96(%rsi)
+	movdqu	96(%rdi),%xmm8
+	movups	%xmm9,112(%rsi)
+	leaq	128(%rsi),%rsi
+	movdqu	112(%rdi),%xmm9
+	leaq	128(%rdi),%rdi
+.Lecb_enc_loop8_enter:
+
+	call	_aesni_encrypt8
+
+	subq	$128,%rdx
+	jnc	.Lecb_enc_loop8
+
+	movups	%xmm2,(%rsi)
+	movq	%r11,%rcx
+	movups	%xmm3,16(%rsi)
+	movl	%r10d,%eax
+	movups	%xmm4,32(%rsi)
+	movups	%xmm5,48(%rsi)
+	movups	%xmm6,64(%rsi)
+	movups	%xmm7,80(%rsi)
+	movups	%xmm8,96(%rsi)
+	movups	%xmm9,112(%rsi)
+	leaq	128(%rsi),%rsi
+	addq	$128,%rdx
+	jz	.Lecb_ret
+
+.Lecb_enc_tail:
+	movups	(%rdi),%xmm2
+	cmpq	$32,%rdx
+	jb	.Lecb_enc_one
+	movups	16(%rdi),%xmm3
+	je	.Lecb_enc_two
+	movups	32(%rdi),%xmm4
+	cmpq	$64,%rdx
+	jb	.Lecb_enc_three
+	movups	48(%rdi),%xmm5
+	je	.Lecb_enc_four
+	movups	64(%rdi),%xmm6
+	cmpq	$96,%rdx
+	jb	.Lecb_enc_five
+	movups	80(%rdi),%xmm7
+	je	.Lecb_enc_six
+	movdqu	96(%rdi),%xmm8
+	xorps	%xmm9,%xmm9
+	call	_aesni_encrypt8
+	movups	%xmm2,(%rsi)
+	movups	%xmm3,16(%rsi)
+	movups	%xmm4,32(%rsi)
+	movups	%xmm5,48(%rsi)
+	movups	%xmm6,64(%rsi)
+	movups	%xmm7,80(%rsi)
+	movups	%xmm8,96(%rsi)
+	jmp	.Lecb_ret
+.align	16
+.Lecb_enc_one:
+	movups	(%rcx),%xmm0
+	movups	16(%rcx),%xmm1
+	leaq	32(%rcx),%rcx
+	xorps	%xmm0,%xmm2
+.Loop_enc1_3:
+.byte	102,15,56,220,209
+	decl	%eax
+	movups	(%rcx),%xmm1
+	leaq	16(%rcx),%rcx
+	jnz	.Loop_enc1_3
+.byte	102,15,56,221,209
+	movups	%xmm2,(%rsi)
+	jmp	.Lecb_ret
+.align	16
+.Lecb_enc_two:
+	call	_aesni_encrypt2
+	movups	%xmm2,(%rsi)
+	movups	%xmm3,16(%rsi)
+	jmp	.Lecb_ret
+.align	16
+.Lecb_enc_three:
+	call	_aesni_encrypt3
+	movups	%xmm2,(%rsi)
+	movups	%xmm3,16(%rsi)
+	movups	%xmm4,32(%rsi)
+	jmp	.Lecb_ret
+.align	16
+.Lecb_enc_four:
+	call	_aesni_encrypt4
+	movups	%xmm2,(%rsi)
+	movups	%xmm3,16(%rsi)
+	movups	%xmm4,32(%rsi)
+	movups	%xmm5,48(%rsi)
+	jmp	.Lecb_ret
+.align	16
+.Lecb_enc_five:
+	xorps	%xmm7,%xmm7
+	call	_aesni_encrypt6
+	movups	%xmm2,(%rsi)
+	movups	%xmm3,16(%rsi)
+	movups	%xmm4,32(%rsi)
+	movups	%xmm5,48(%rsi)
+	movups	%xmm6,64(%rsi)
+	jmp	.Lecb_ret
+.align	16
+.Lecb_enc_six:
+	call	_aesni_encrypt6
+	movups	%xmm2,(%rsi)
+	movups	%xmm3,16(%rsi)
+	movups	%xmm4,32(%rsi)
+	movups	%xmm5,48(%rsi)
+	movups	%xmm6,64(%rsi)
+	movups	%xmm7,80(%rsi)
+	jmp	.Lecb_ret
+
+.align	16
+.Lecb_decrypt:
+	cmpq	$128,%rdx
+	jb	.Lecb_dec_tail
+
+	movdqu	(%rdi),%xmm2
+	movdqu	16(%rdi),%xmm3
+	movdqu	32(%rdi),%xmm4
+	movdqu	48(%rdi),%xmm5
+	movdqu	64(%rdi),%xmm6
+	movdqu	80(%rdi),%xmm7
+	movdqu	96(%rdi),%xmm8
+	movdqu	112(%rdi),%xmm9
+	leaq	128(%rdi),%rdi
+	subq	$128,%rdx
+	jmp	.Lecb_dec_loop8_enter
+.align	16
+.Lecb_dec_loop8:
+	movups	%xmm2,(%rsi)
+	movq	%r11,%rcx
+	movdqu	(%rdi),%xmm2
+	movl	%r10d,%eax
+	movups	%xmm3,16(%rsi)
+	movdqu	16(%rdi),%xmm3
+	movups	%xmm4,32(%rsi)
+	movdqu	32(%rdi),%xmm4
+	movups	%xmm5,48(%rsi)
+	movdqu	48(%rdi),%xmm5
+	movups	%xmm6,64(%rsi)
+	movdqu	64(%rdi),%xmm6
+	movups	%xmm7,80(%rsi)
+	movdqu	80(%rdi),%xmm7
+	movups	%xmm8,96(%rsi)
+	movdqu	96(%rdi),%xmm8
+	movups	%xmm9,112(%rsi)
+	leaq	128(%rsi),%rsi
+	movdqu	112(%rdi),%xmm9
+	leaq	128(%rdi),%rdi
+.Lecb_dec_loop8_enter:
+
+	call	_aesni_decrypt8
+
+	movups	(%r11),%xmm0
+	subq	$128,%rdx
+	jnc	.Lecb_dec_loop8
+
+	movups	%xmm2,(%rsi)
+	pxor	%xmm2,%xmm2
+	movq	%r11,%rcx
+	movups	%xmm3,16(%rsi)
+	pxor	%xmm3,%xmm3
+	movl	%r10d,%eax
+	movups	%xmm4,32(%rsi)
+	pxor	%xmm4,%xmm4
+	movups	%xmm5,48(%rsi)
+	pxor	%xmm5,%xmm5
+	movups	%xmm6,64(%rsi)
+	pxor	%xmm6,%xmm6
+	movups	%xmm7,80(%rsi)
+	pxor	%xmm7,%xmm7
+	movups	%xmm8,96(%rsi)
+	pxor	%xmm8,%xmm8
+	movups	%xmm9,112(%rsi)
+	pxor	%xmm9,%xmm9
+	leaq	128(%rsi),%rsi
+	addq	$128,%rdx
+	jz	.Lecb_ret
+
+.Lecb_dec_tail:
+	movups	(%rdi),%xmm2
+	cmpq	$32,%rdx
+	jb	.Lecb_dec_one
+	movups	16(%rdi),%xmm3
+	je	.Lecb_dec_two
+	movups	32(%rdi),%xmm4
+	cmpq	$64,%rdx
+	jb	.Lecb_dec_three
+	movups	48(%rdi),%xmm5
+	je	.Lecb_dec_four
+	movups	64(%rdi),%xmm6
+	cmpq	$96,%rdx
+	jb	.Lecb_dec_five
+	movups	80(%rdi),%xmm7
+	je	.Lecb_dec_six
+	movups	96(%rdi),%xmm8
+	movups	(%rcx),%xmm0
+	xorps	%xmm9,%xmm9
+	call	_aesni_decrypt8
+	movups	%xmm2,(%rsi)
+	pxor	%xmm2,%xmm2
+	movups	%xmm3,16(%rsi)
+	pxor	%xmm3,%xmm3
+	movups	%xmm4,32(%rsi)
+	pxor	%xmm4,%xmm4
+	movups	%xmm5,48(%rsi)
+	pxor	%xmm5,%xmm5
+	movups	%xmm6,64(%rsi)
+	pxor	%xmm6,%xmm6
+	movups	%xmm7,80(%rsi)
+	pxor	%xmm7,%xmm7
+	movups	%xmm8,96(%rsi)
+	pxor	%xmm8,%xmm8
+	pxor	%xmm9,%xmm9
+	jmp	.Lecb_ret
+.align	16
+.Lecb_dec_one:
+	movups	(%rcx),%xmm0
+	movups	16(%rcx),%xmm1
+	leaq	32(%rcx),%rcx
+	xorps	%xmm0,%xmm2
+.Loop_dec1_4:
+.byte	102,15,56,222,209
+	decl	%eax
+	movups	(%rcx),%xmm1
+	leaq	16(%rcx),%rcx
+	jnz	.Loop_dec1_4
+.byte	102,15,56,223,209
+	movups	%xmm2,(%rsi)
+	pxor	%xmm2,%xmm2
+	jmp	.Lecb_ret
+.align	16
+.Lecb_dec_two:
+	call	_aesni_decrypt2
+	movups	%xmm2,(%rsi)
+	pxor	%xmm2,%xmm2
+	movups	%xmm3,16(%rsi)
+	pxor	%xmm3,%xmm3
+	jmp	.Lecb_ret
+.align	16
+.Lecb_dec_three:
+	call	_aesni_decrypt3
+	movups	%xmm2,(%rsi)
+	pxor	%xmm2,%xmm2
+	movups	%xmm3,16(%rsi)
+	pxor	%xmm3,%xmm3
+	movups	%xmm4,32(%rsi)
+	pxor	%xmm4,%xmm4
+	jmp	.Lecb_ret
+.align	16
+.Lecb_dec_four:
+	call	_aesni_decrypt4
+	movups	%xmm2,(%rsi)
+	pxor	%xmm2,%xmm2
+	movups	%xmm3,16(%rsi)
+	pxor	%xmm3,%xmm3
+	movups	%xmm4,32(%rsi)
+	pxor	%xmm4,%xmm4
+	movups	%xmm5,48(%rsi)
+	pxor	%xmm5,%xmm5
+	jmp	.Lecb_ret
+.align	16
+.Lecb_dec_five:
+	xorps	%xmm7,%xmm7
+	call	_aesni_decrypt6
+	movups	%xmm2,(%rsi)
+	pxor	%xmm2,%xmm2
+	movups	%xmm3,16(%rsi)
+	pxor	%xmm3,%xmm3
+	movups	%xmm4,32(%rsi)
+	pxor	%xmm4,%xmm4
+	movups	%xmm5,48(%rsi)
+	pxor	%xmm5,%xmm5
+	movups	%xmm6,64(%rsi)
+	pxor	%xmm6,%xmm6
+	pxor	%xmm7,%xmm7
+	jmp	.Lecb_ret
+.align	16
+.Lecb_dec_six:
+	call	_aesni_decrypt6
+	movups	%xmm2,(%rsi)
+	pxor	%xmm2,%xmm2
+	movups	%xmm3,16(%rsi)
+	pxor	%xmm3,%xmm3
+	movups	%xmm4,32(%rsi)
+	pxor	%xmm4,%xmm4
+	movups	%xmm5,48(%rsi)
+	pxor	%xmm5,%xmm5
+	movups	%xmm6,64(%rsi)
+	pxor	%xmm6,%xmm6
+	movups	%xmm7,80(%rsi)
+	pxor	%xmm7,%xmm7
+
+.Lecb_ret:
+	xorps	%xmm0,%xmm0
+	pxor	%xmm1,%xmm1
+	.byte	0xf3,0xc3
+.size	aesni_ecb_encrypt,.-aesni_ecb_encrypt
+.globl	aesni_ccm64_encrypt_blocks
+.hidden aesni_ccm64_encrypt_blocks
+.type	aesni_ccm64_encrypt_blocks,@function
+.align	16
+aesni_ccm64_encrypt_blocks:
+	movl	240(%rcx),%eax
+	movdqu	(%r8),%xmm6
+	movdqa	.Lincrement64(%rip),%xmm9
+	movdqa	.Lbswap_mask(%rip),%xmm7
+
+	shll	$4,%eax
+	movl	$16,%r10d
+	leaq	0(%rcx),%r11
+	movdqu	(%r9),%xmm3
+	movdqa	%xmm6,%xmm2
+	leaq	32(%rcx,%rax,1),%rcx
+.byte	102,15,56,0,247
+	subq	%rax,%r10
+	jmp	.Lccm64_enc_outer
+.align	16
+.Lccm64_enc_outer:
+	movups	(%r11),%xmm0
+	movq	%r10,%rax
+	movups	(%rdi),%xmm8
+
+	xorps	%xmm0,%xmm2
+	movups	16(%r11),%xmm1
+	xorps	%xmm8,%xmm0
+	xorps	%xmm0,%xmm3
+	movups	32(%r11),%xmm0
+
+.Lccm64_enc2_loop:
+.byte	102,15,56,220,209
+.byte	102,15,56,220,217
+	movups	(%rcx,%rax,1),%xmm1
+	addq	$32,%rax
+.byte	102,15,56,220,208
+.byte	102,15,56,220,216
+	movups	-16(%rcx,%rax,1),%xmm0
+	jnz	.Lccm64_enc2_loop
+.byte	102,15,56,220,209
+.byte	102,15,56,220,217
+	paddq	%xmm9,%xmm6
+	decq	%rdx
+.byte	102,15,56,221,208
+.byte	102,15,56,221,216
+
+	leaq	16(%rdi),%rdi
+	xorps	%xmm2,%xmm8
+	movdqa	%xmm6,%xmm2
+	movups	%xmm8,(%rsi)
+.byte	102,15,56,0,215
+	leaq	16(%rsi),%rsi
+	jnz	.Lccm64_enc_outer
+
+	pxor	%xmm0,%xmm0
+	pxor	%xmm1,%xmm1
+	pxor	%xmm2,%xmm2
+	movups	%xmm3,(%r9)
+	pxor	%xmm3,%xmm3
+	pxor	%xmm8,%xmm8
+	pxor	%xmm6,%xmm6
+	.byte	0xf3,0xc3
+.size	aesni_ccm64_encrypt_blocks,.-aesni_ccm64_encrypt_blocks
+.globl	aesni_ccm64_decrypt_blocks
+.hidden aesni_ccm64_decrypt_blocks
+.type	aesni_ccm64_decrypt_blocks,@function
+.align	16
+aesni_ccm64_decrypt_blocks:
+	movl	240(%rcx),%eax
+	movups	(%r8),%xmm6
+	movdqu	(%r9),%xmm3
+	movdqa	.Lincrement64(%rip),%xmm9
+	movdqa	.Lbswap_mask(%rip),%xmm7
+
+	movaps	%xmm6,%xmm2
+	movl	%eax,%r10d
+	movq	%rcx,%r11
+.byte	102,15,56,0,247
+	movups	(%rcx),%xmm0
+	movups	16(%rcx),%xmm1
+	leaq	32(%rcx),%rcx
+	xorps	%xmm0,%xmm2
+.Loop_enc1_5:
+.byte	102,15,56,220,209
+	decl	%eax
+	movups	(%rcx),%xmm1
+	leaq	16(%rcx),%rcx
+	jnz	.Loop_enc1_5
+.byte	102,15,56,221,209
+	shll	$4,%r10d
+	movl	$16,%eax
+	movups	(%rdi),%xmm8
+	paddq	%xmm9,%xmm6
+	leaq	16(%rdi),%rdi
+	subq	%r10,%rax
+	leaq	32(%r11,%r10,1),%rcx
+	movq	%rax,%r10
+	jmp	.Lccm64_dec_outer
+.align	16
+.Lccm64_dec_outer:
+	xorps	%xmm2,%xmm8
+	movdqa	%xmm6,%xmm2
+	movups	%xmm8,(%rsi)
+	leaq	16(%rsi),%rsi
+.byte	102,15,56,0,215
+
+	subq	$1,%rdx
+	jz	.Lccm64_dec_break
+
+	movups	(%r11),%xmm0
+	movq	%r10,%rax
+	movups	16(%r11),%xmm1
+	xorps	%xmm0,%xmm8
+	xorps	%xmm0,%xmm2
+	xorps	%xmm8,%xmm3
+	movups	32(%r11),%xmm0
+	jmp	.Lccm64_dec2_loop
+.align	16
+.Lccm64_dec2_loop:
+.byte	102,15,56,220,209
+.byte	102,15,56,220,217
+	movups	(%rcx,%rax,1),%xmm1
+	addq	$32,%rax
+.byte	102,15,56,220,208
+.byte	102,15,56,220,216
+	movups	-16(%rcx,%rax,1),%xmm0
+	jnz	.Lccm64_dec2_loop
+	movups	(%rdi),%xmm8
+	paddq	%xmm9,%xmm6
+.byte	102,15,56,220,209
+.byte	102,15,56,220,217
+.byte	102,15,56,221,208
+.byte	102,15,56,221,216
+	leaq	16(%rdi),%rdi
+	jmp	.Lccm64_dec_outer
+
+.align	16
+.Lccm64_dec_break:
+
+	movl	240(%r11),%eax
+	movups	(%r11),%xmm0
+	movups	16(%r11),%xmm1
+	xorps	%xmm0,%xmm8
+	leaq	32(%r11),%r11
+	xorps	%xmm8,%xmm3
+.Loop_enc1_6:
+.byte	102,15,56,220,217
+	decl	%eax
+	movups	(%r11),%xmm1
+	leaq	16(%r11),%r11
+	jnz	.Loop_enc1_6
+.byte	102,15,56,221,217
+	pxor	%xmm0,%xmm0
+	pxor	%xmm1,%xmm1
+	pxor	%xmm2,%xmm2
+	movups	%xmm3,(%r9)
+	pxor	%xmm3,%xmm3
+	pxor	%xmm8,%xmm8
+	pxor	%xmm6,%xmm6
+	.byte	0xf3,0xc3
+.size	aesni_ccm64_decrypt_blocks,.-aesni_ccm64_decrypt_blocks
+.globl	aesni_ctr32_encrypt_blocks
+.hidden aesni_ctr32_encrypt_blocks
+.type	aesni_ctr32_encrypt_blocks,@function
+.align	16
+aesni_ctr32_encrypt_blocks:
+	cmpq	$1,%rdx
+	jne	.Lctr32_bulk
+
+
+
+	movups	(%r8),%xmm2
+	movups	(%rdi),%xmm3
+	movl	240(%rcx),%edx
+	movups	(%rcx),%xmm0
+	movups	16(%rcx),%xmm1
+	leaq	32(%rcx),%rcx
+	xorps	%xmm0,%xmm2
+.Loop_enc1_7:
+.byte	102,15,56,220,209
+	decl	%edx
+	movups	(%rcx),%xmm1
+	leaq	16(%rcx),%rcx
+	jnz	.Loop_enc1_7
+.byte	102,15,56,221,209
+	pxor	%xmm0,%xmm0
+	pxor	%xmm1,%xmm1
+	xorps	%xmm3,%xmm2
+	pxor	%xmm3,%xmm3
+	movups	%xmm2,(%rsi)
+	xorps	%xmm2,%xmm2
+	jmp	.Lctr32_epilogue
+
+.align	16
+.Lctr32_bulk:
+	leaq	(%rsp),%rax
+	pushq	%rbp
+	subq	$128,%rsp
+	andq	$-16,%rsp
+	leaq	-8(%rax),%rbp
+
+
+
+
+	movdqu	(%r8),%xmm2
+	movdqu	(%rcx),%xmm0
+	movl	12(%r8),%r8d
+	pxor	%xmm0,%xmm2
+	movl	12(%rcx),%r11d
+	movdqa	%xmm2,0(%rsp)
+	bswapl	%r8d
+	movdqa	%xmm2,%xmm3
+	movdqa	%xmm2,%xmm4
+	movdqa	%xmm2,%xmm5
+	movdqa	%xmm2,64(%rsp)
+	movdqa	%xmm2,80(%rsp)
+	movdqa	%xmm2,96(%rsp)
+	movq	%rdx,%r10
+	movdqa	%xmm2,112(%rsp)
+
+	leaq	1(%r8),%rax
+	leaq	2(%r8),%rdx
+	bswapl	%eax
+	bswapl	%edx
+	xorl	%r11d,%eax
+	xorl	%r11d,%edx
+.byte	102,15,58,34,216,3
+	leaq	3(%r8),%rax
+	movdqa	%xmm3,16(%rsp)
+.byte	102,15,58,34,226,3
+	bswapl	%eax
+	movq	%r10,%rdx
+	leaq	4(%r8),%r10
+	movdqa	%xmm4,32(%rsp)
+	xorl	%r11d,%eax
+	bswapl	%r10d
+.byte	102,15,58,34,232,3
+	xorl	%r11d,%r10d
+	movdqa	%xmm5,48(%rsp)
+	leaq	5(%r8),%r9
+	movl	%r10d,64+12(%rsp)
+	bswapl	%r9d
+	leaq	6(%r8),%r10
+	movl	240(%rcx),%eax
+	xorl	%r11d,%r9d
+	bswapl	%r10d
+	movl	%r9d,80+12(%rsp)
+	xorl	%r11d,%r10d
+	leaq	7(%r8),%r9
+	movl	%r10d,96+12(%rsp)
+	bswapl	%r9d
+	movl	OPENSSL_ia32cap_P+4(%rip),%r10d
+	xorl	%r11d,%r9d
+	andl	$71303168,%r10d
+	movl	%r9d,112+12(%rsp)
+
+	movups	16(%rcx),%xmm1
+
+	movdqa	64(%rsp),%xmm6
+	movdqa	80(%rsp),%xmm7
+
+	cmpq	$8,%rdx
+	jb	.Lctr32_tail
+
+	subq	$6,%rdx
+	cmpl	$4194304,%r10d
+	je	.Lctr32_6x
+
+	leaq	128(%rcx),%rcx
+	subq	$2,%rdx
+	jmp	.Lctr32_loop8
+
+.align	16
+.Lctr32_6x:
+	shll	$4,%eax
+	movl	$48,%r10d
+	bswapl	%r11d
+	leaq	32(%rcx,%rax,1),%rcx
+	subq	%rax,%r10
+	jmp	.Lctr32_loop6
+
+.align	16
+.Lctr32_loop6:
+	addl	$6,%r8d
+	movups	-48(%rcx,%r10,1),%xmm0
+.byte	102,15,56,220,209
+	movl	%r8d,%eax
+	xorl	%r11d,%eax
+.byte	102,15,56,220,217
+.byte	0x0f,0x38,0xf1,0x44,0x24,12
+	leal	1(%r8),%eax
+.byte	102,15,56,220,225
+	xorl	%r11d,%eax
+.byte	0x0f,0x38,0xf1,0x44,0x24,28
+.byte	102,15,56,220,233
+	leal	2(%r8),%eax
+	xorl	%r11d,%eax
+.byte	102,15,56,220,241
+.byte	0x0f,0x38,0xf1,0x44,0x24,44
+	leal	3(%r8),%eax
+.byte	102,15,56,220,249
+	movups	-32(%rcx,%r10,1),%xmm1
+	xorl	%r11d,%eax
+
+.byte	102,15,56,220,208
+.byte	0x0f,0x38,0xf1,0x44,0x24,60
+	leal	4(%r8),%eax
+.byte	102,15,56,220,216
+	xorl	%r11d,%eax
+.byte	0x0f,0x38,0xf1,0x44,0x24,76
+.byte	102,15,56,220,224
+	leal	5(%r8),%eax
+	xorl	%r11d,%eax
+.byte	102,15,56,220,232
+.byte	0x0f,0x38,0xf1,0x44,0x24,92
+	movq	%r10,%rax
+.byte	102,15,56,220,240
+.byte	102,15,56,220,248
+	movups	-16(%rcx,%r10,1),%xmm0
+
+	call	.Lenc_loop6
+
+	movdqu	(%rdi),%xmm8
+	movdqu	16(%rdi),%xmm9
+	movdqu	32(%rdi),%xmm10
+	movdqu	48(%rdi),%xmm11
+	movdqu	64(%rdi),%xmm12
+	movdqu	80(%rdi),%xmm13
+	leaq	96(%rdi),%rdi
+	movups	-64(%rcx,%r10,1),%xmm1
+	pxor	%xmm2,%xmm8
+	movaps	0(%rsp),%xmm2
+	pxor	%xmm3,%xmm9
+	movaps	16(%rsp),%xmm3
+	pxor	%xmm4,%xmm10
+	movaps	32(%rsp),%xmm4
+	pxor	%xmm5,%xmm11
+	movaps	48(%rsp),%xmm5
+	pxor	%xmm6,%xmm12
+	movaps	64(%rsp),%xmm6
+	pxor	%xmm7,%xmm13
+	movaps	80(%rsp),%xmm7
+	movdqu	%xmm8,(%rsi)
+	movdqu	%xmm9,16(%rsi)
+	movdqu	%xmm10,32(%rsi)
+	movdqu	%xmm11,48(%rsi)
+	movdqu	%xmm12,64(%rsi)
+	movdqu	%xmm13,80(%rsi)
+	leaq	96(%rsi),%rsi
+
+	subq	$6,%rdx
+	jnc	.Lctr32_loop6
+
+	addq	$6,%rdx
+	jz	.Lctr32_done
+
+	leal	-48(%r10),%eax
+	leaq	-80(%rcx,%r10,1),%rcx
+	negl	%eax
+	shrl	$4,%eax
+	jmp	.Lctr32_tail
+
+.align	32
+.Lctr32_loop8:
+	addl	$8,%r8d
+	movdqa	96(%rsp),%xmm8
+.byte	102,15,56,220,209
+	movl	%r8d,%r9d
+	movdqa	112(%rsp),%xmm9
+.byte	102,15,56,220,217
+	bswapl	%r9d
+	movups	32-128(%rcx),%xmm0
+.byte	102,15,56,220,225
+	xorl	%r11d,%r9d
+	nop
+.byte	102,15,56,220,233
+	movl	%r9d,0+12(%rsp)
+	leaq	1(%r8),%r9
+.byte	102,15,56,220,241
+.byte	102,15,56,220,249
+.byte	102,68,15,56,220,193
+.byte	102,68,15,56,220,201
+	movups	48-128(%rcx),%xmm1
+	bswapl	%r9d
+.byte	102,15,56,220,208
+.byte	102,15,56,220,216
+	xorl	%r11d,%r9d
+.byte	0x66,0x90
+.byte	102,15,56,220,224
+.byte	102,15,56,220,232
+	movl	%r9d,16+12(%rsp)
+	leaq	2(%r8),%r9
+.byte	102,15,56,220,240
+.byte	102,15,56,220,248
+.byte	102,68,15,56,220,192
+.byte	102,68,15,56,220,200
+	movups	64-128(%rcx),%xmm0
+	bswapl	%r9d
+.byte	102,15,56,220,209
+.byte	102,15,56,220,217
+	xorl	%r11d,%r9d
+.byte	0x66,0x90
+.byte	102,15,56,220,225
+.byte	102,15,56,220,233
+	movl	%r9d,32+12(%rsp)
+	leaq	3(%r8),%r9
+.byte	102,15,56,220,241
+.byte	102,15,56,220,249
+.byte	102,68,15,56,220,193
+.byte	102,68,15,56,220,201
+	movups	80-128(%rcx),%xmm1
+	bswapl	%r9d
+.byte	102,15,56,220,208
+.byte	102,15,56,220,216
+	xorl	%r11d,%r9d
+.byte	0x66,0x90
+.byte	102,15,56,220,224
+.byte	102,15,56,220,232
+	movl	%r9d,48+12(%rsp)
+	leaq	4(%r8),%r9
+.byte	102,15,56,220,240
+.byte	102,15,56,220,248
+.byte	102,68,15,56,220,192
+.byte	102,68,15,56,220,200
+	movups	96-128(%rcx),%xmm0
+	bswapl	%r9d
+.byte	102,15,56,220,209
+.byte	102,15,56,220,217
+	xorl	%r11d,%r9d
+.byte	0x66,0x90
+.byte	102,15,56,220,225
+.byte	102,15,56,220,233
+	movl	%r9d,64+12(%rsp)
+	leaq	5(%r8),%r9
+.byte	102,15,56,220,241
+.byte	102,15,56,220,249
+.byte	102,68,15,56,220,193
+.byte	102,68,15,56,220,201
+	movups	112-128(%rcx),%xmm1
+	bswapl	%r9d
+.byte	102,15,56,220,208
+.byte	102,15,56,220,216
+	xorl	%r11d,%r9d
+.byte	0x66,0x90
+.byte	102,15,56,220,224
+.byte	102,15,56,220,232
+	movl	%r9d,80+12(%rsp)
+	leaq	6(%r8),%r9
+.byte	102,15,56,220,240
+.byte	102,15,56,220,248
+.byte	102,68,15,56,220,192
+.byte	102,68,15,56,220,200
+	movups	128-128(%rcx),%xmm0
+	bswapl	%r9d
+.byte	102,15,56,220,209
+.byte	102,15,56,220,217
+	xorl	%r11d,%r9d
+.byte	0x66,0x90
+.byte	102,15,56,220,225
+.byte	102,15,56,220,233
+	movl	%r9d,96+12(%rsp)
+	leaq	7(%r8),%r9
+.byte	102,15,56,220,241
+.byte	102,15,56,220,249
+.byte	102,68,15,56,220,193
+.byte	102,68,15,56,220,201
+	movups	144-128(%rcx),%xmm1
+	bswapl	%r9d
+.byte	102,15,56,220,208
+.byte	102,15,56,220,216
+.byte	102,15,56,220,224
+	xorl	%r11d,%r9d
+	movdqu	0(%rdi),%xmm10
+.byte	102,15,56,220,232
+	movl	%r9d,112+12(%rsp)
+	cmpl	$11,%eax
+.byte	102,15,56,220,240
+.byte	102,15,56,220,248
+.byte	102,68,15,56,220,192
+.byte	102,68,15,56,220,200
+	movups	160-128(%rcx),%xmm0
+
+	jb	.Lctr32_enc_done
+
+.byte	102,15,56,220,209
+.byte	102,15,56,220,217
+.byte	102,15,56,220,225
+.byte	102,15,56,220,233
+.byte	102,15,56,220,241
+.byte	102,15,56,220,249
+.byte	102,68,15,56,220,193
+.byte	102,68,15,56,220,201
+	movups	176-128(%rcx),%xmm1
+
+.byte	102,15,56,220,208
+.byte	102,15,56,220,216
+.byte	102,15,56,220,224
+.byte	102,15,56,220,232
+.byte	102,15,56,220,240
+.byte	102,15,56,220,248
+.byte	102,68,15,56,220,192
+.byte	102,68,15,56,220,200
+	movups	192-128(%rcx),%xmm0
+	je	.Lctr32_enc_done
+
+.byte	102,15,56,220,209
+.byte	102,15,56,220,217
+.byte	102,15,56,220,225
+.byte	102,15,56,220,233
+.byte	102,15,56,220,241
+.byte	102,15,56,220,249
+.byte	102,68,15,56,220,193
+.byte	102,68,15,56,220,201
+	movups	208-128(%rcx),%xmm1
+
+.byte	102,15,56,220,208
+.byte	102,15,56,220,216
+.byte	102,15,56,220,224
+.byte	102,15,56,220,232
+.byte	102,15,56,220,240
+.byte	102,15,56,220,248
+.byte	102,68,15,56,220,192
+.byte	102,68,15,56,220,200
+	movups	224-128(%rcx),%xmm0
+	jmp	.Lctr32_enc_done
+
+.align	16
+.Lctr32_enc_done:
+	movdqu	16(%rdi),%xmm11
+	pxor	%xmm0,%xmm10
+	movdqu	32(%rdi),%xmm12
+	pxor	%xmm0,%xmm11
+	movdqu	48(%rdi),%xmm13
+	pxor	%xmm0,%xmm12
+	movdqu	64(%rdi),%xmm14
+	pxor	%xmm0,%xmm13
+	movdqu	80(%rdi),%xmm15
+	pxor	%xmm0,%xmm14
+	pxor	%xmm0,%xmm15
+.byte	102,15,56,220,209
+.byte	102,15,56,220,217
+.byte	102,15,56,220,225
+.byte	102,15,56,220,233
+.byte	102,15,56,220,241
+.byte	102,15,56,220,249
+.byte	102,68,15,56,220,193
+.byte	102,68,15,56,220,201
+	movdqu	96(%rdi),%xmm1
+	leaq	128(%rdi),%rdi
+
+.byte	102,65,15,56,221,210
+	pxor	%xmm0,%xmm1
+	movdqu	112-128(%rdi),%xmm10
+.byte	102,65,15,56,221,219
+	pxor	%xmm0,%xmm10
+	movdqa	0(%rsp),%xmm11
+.byte	102,65,15,56,221,228
+.byte	102,65,15,56,221,237
+	movdqa	16(%rsp),%xmm12
+	movdqa	32(%rsp),%xmm13
+.byte	102,65,15,56,221,246
+.byte	102,65,15,56,221,255
+	movdqa	48(%rsp),%xmm14
+	movdqa	64(%rsp),%xmm15
+.byte	102,68,15,56,221,193
+	movdqa	80(%rsp),%xmm0
+	movups	16-128(%rcx),%xmm1
+.byte	102,69,15,56,221,202
+
+	movups	%xmm2,(%rsi)
+	movdqa	%xmm11,%xmm2
+	movups	%xmm3,16(%rsi)
+	movdqa	%xmm12,%xmm3
+	movups	%xmm4,32(%rsi)
+	movdqa	%xmm13,%xmm4
+	movups	%xmm5,48(%rsi)
+	movdqa	%xmm14,%xmm5
+	movups	%xmm6,64(%rsi)
+	movdqa	%xmm15,%xmm6
+	movups	%xmm7,80(%rsi)
+	movdqa	%xmm0,%xmm7
+	movups	%xmm8,96(%rsi)
+	movups	%xmm9,112(%rsi)
+	leaq	128(%rsi),%rsi
+
+	subq	$8,%rdx
+	jnc	.Lctr32_loop8
+
+	addq	$8,%rdx
+	jz	.Lctr32_done
+	leaq	-128(%rcx),%rcx
+
+.Lctr32_tail:
+
+
+	leaq	16(%rcx),%rcx
+	cmpq	$4,%rdx
+	jb	.Lctr32_loop3
+	je	.Lctr32_loop4
+
+
+	shll	$4,%eax
+	movdqa	96(%rsp),%xmm8
+	pxor	%xmm9,%xmm9
+
+	movups	16(%rcx),%xmm0
+.byte	102,15,56,220,209
+.byte	102,15,56,220,217
+	leaq	32-16(%rcx,%rax,1),%rcx
+	negq	%rax
+.byte	102,15,56,220,225
+	addq	$16,%rax
+	movups	(%rdi),%xmm10
+.byte	102,15,56,220,233
+.byte	102,15,56,220,241
+	movups	16(%rdi),%xmm11
+	movups	32(%rdi),%xmm12
+.byte	102,15,56,220,249
+.byte	102,68,15,56,220,193
+
+	call	.Lenc_loop8_enter
+
+	movdqu	48(%rdi),%xmm13
+	pxor	%xmm10,%xmm2
+	movdqu	64(%rdi),%xmm10
+	pxor	%xmm11,%xmm3
+	movdqu	%xmm2,(%rsi)
+	pxor	%xmm12,%xmm4
+	movdqu	%xmm3,16(%rsi)
+	pxor	%xmm13,%xmm5
+	movdqu	%xmm4,32(%rsi)
+	pxor	%xmm10,%xmm6
+	movdqu	%xmm5,48(%rsi)
+	movdqu	%xmm6,64(%rsi)
+	cmpq	$6,%rdx
+	jb	.Lctr32_done
+
+	movups	80(%rdi),%xmm11
+	xorps	%xmm11,%xmm7
+	movups	%xmm7,80(%rsi)
+	je	.Lctr32_done
+
+	movups	96(%rdi),%xmm12
+	xorps	%xmm12,%xmm8
+	movups	%xmm8,96(%rsi)
+	jmp	.Lctr32_done
+
+.align	32
+.Lctr32_loop4:
+.byte	102,15,56,220,209
+	leaq	16(%rcx),%rcx
+	decl	%eax
+.byte	102,15,56,220,217
+.byte	102,15,56,220,225
+.byte	102,15,56,220,233
+	movups	(%rcx),%xmm1
+	jnz	.Lctr32_loop4
+.byte	102,15,56,221,209
+.byte	102,15,56,221,217
+	movups	(%rdi),%xmm10
+	movups	16(%rdi),%xmm11
+.byte	102,15,56,221,225
+.byte	102,15,56,221,233
+	movups	32(%rdi),%xmm12
+	movups	48(%rdi),%xmm13
+
+	xorps	%xmm10,%xmm2
+	movups	%xmm2,(%rsi)
+	xorps	%xmm11,%xmm3
+	movups	%xmm3,16(%rsi)
+	pxor	%xmm12,%xmm4
+	movdqu	%xmm4,32(%rsi)
+	pxor	%xmm13,%xmm5
+	movdqu	%xmm5,48(%rsi)
+	jmp	.Lctr32_done
+
+.align	32
+.Lctr32_loop3:
+.byte	102,15,56,220,209
+	leaq	16(%rcx),%rcx
+	decl	%eax
+.byte	102,15,56,220,217
+.byte	102,15,56,220,225
+	movups	(%rcx),%xmm1
+	jnz	.Lctr32_loop3
+.byte	102,15,56,221,209
+.byte	102,15,56,221,217
+.byte	102,15,56,221,225
+
+	movups	(%rdi),%xmm10
+	xorps	%xmm10,%xmm2
+	movups	%xmm2,(%rsi)
+	cmpq	$2,%rdx
+	jb	.Lctr32_done
+
+	movups	16(%rdi),%xmm11
+	xorps	%xmm11,%xmm3
+	movups	%xmm3,16(%rsi)
+	je	.Lctr32_done
+
+	movups	32(%rdi),%xmm12
+	xorps	%xmm12,%xmm4
+	movups	%xmm4,32(%rsi)
+
+.Lctr32_done:
+	xorps	%xmm0,%xmm0
+	xorl	%r11d,%r11d
+	pxor	%xmm1,%xmm1
+	pxor	%xmm2,%xmm2
+	pxor	%xmm3,%xmm3
+	pxor	%xmm4,%xmm4
+	pxor	%xmm5,%xmm5
+	pxor	%xmm6,%xmm6
+	pxor	%xmm7,%xmm7
+	movaps	%xmm0,0(%rsp)
+	pxor	%xmm8,%xmm8
+	movaps	%xmm0,16(%rsp)
+	pxor	%xmm9,%xmm9
+	movaps	%xmm0,32(%rsp)
+	pxor	%xmm10,%xmm10
+	movaps	%xmm0,48(%rsp)
+	pxor	%xmm11,%xmm11
+	movaps	%xmm0,64(%rsp)
+	pxor	%xmm12,%xmm12
+	movaps	%xmm0,80(%rsp)
+	pxor	%xmm13,%xmm13
+	movaps	%xmm0,96(%rsp)
+	pxor	%xmm14,%xmm14
+	movaps	%xmm0,112(%rsp)
+	pxor	%xmm15,%xmm15
+	leaq	(%rbp),%rsp
+	popq	%rbp
+.Lctr32_epilogue:
+	.byte	0xf3,0xc3
+.size	aesni_ctr32_encrypt_blocks,.-aesni_ctr32_encrypt_blocks
+.globl	aesni_xts_encrypt
+.hidden aesni_xts_encrypt
+.type	aesni_xts_encrypt,@function
+.align	16
+aesni_xts_encrypt:
+	leaq	(%rsp),%rax
+	pushq	%rbp
+	subq	$112,%rsp
+	andq	$-16,%rsp
+	leaq	-8(%rax),%rbp
+	movups	(%r9),%xmm2
+	movl	240(%r8),%eax
+	movl	240(%rcx),%r10d
+	movups	(%r8),%xmm0
+	movups	16(%r8),%xmm1
+	leaq	32(%r8),%r8
+	xorps	%xmm0,%xmm2
+.Loop_enc1_8:
+.byte	102,15,56,220,209
+	decl	%eax
+	movups	(%r8),%xmm1
+	leaq	16(%r8),%r8
+	jnz	.Loop_enc1_8
+.byte	102,15,56,221,209
+	movups	(%rcx),%xmm0
+	movq	%rcx,%r11
+	movl	%r10d,%eax
+	shll	$4,%r10d
+	movq	%rdx,%r9
+	andq	$-16,%rdx
+
+	movups	16(%rcx,%r10,1),%xmm1
+
+	movdqa	.Lxts_magic(%rip),%xmm8
+	movdqa	%xmm2,%xmm15
+	pshufd	$95,%xmm2,%xmm9
+	pxor	%xmm0,%xmm1
+	movdqa	%xmm9,%xmm14
+	paddd	%xmm9,%xmm9
+	movdqa	%xmm15,%xmm10
+	psrad	$31,%xmm14
+	paddq	%xmm15,%xmm15
+	pand	%xmm8,%xmm14
+	pxor	%xmm0,%xmm10
+	pxor	%xmm14,%xmm15
+	movdqa	%xmm9,%xmm14
+	paddd	%xmm9,%xmm9
+	movdqa	%xmm15,%xmm11
+	psrad	$31,%xmm14
+	paddq	%xmm15,%xmm15
+	pand	%xmm8,%xmm14
+	pxor	%xmm0,%xmm11
+	pxor	%xmm14,%xmm15
+	movdqa	%xmm9,%xmm14
+	paddd	%xmm9,%xmm9
+	movdqa	%xmm15,%xmm12
+	psrad	$31,%xmm14
+	paddq	%xmm15,%xmm15
+	pand	%xmm8,%xmm14
+	pxor	%xmm0,%xmm12
+	pxor	%xmm14,%xmm15
+	movdqa	%xmm9,%xmm14
+	paddd	%xmm9,%xmm9
+	movdqa	%xmm15,%xmm13
+	psrad	$31,%xmm14
+	paddq	%xmm15,%xmm15
+	pand	%xmm8,%xmm14
+	pxor	%xmm0,%xmm13
+	pxor	%xmm14,%xmm15
+	movdqa	%xmm15,%xmm14
+	psrad	$31,%xmm9
+	paddq	%xmm15,%xmm15
+	pand	%xmm8,%xmm9
+	pxor	%xmm0,%xmm14
+	pxor	%xmm9,%xmm15
+	movaps	%xmm1,96(%rsp)
+
+	subq	$96,%rdx
+	jc	.Lxts_enc_short
+
+	movl	$16+96,%eax
+	leaq	32(%r11,%r10,1),%rcx
+	subq	%r10,%rax
+	movups	16(%r11),%xmm1
+	movq	%rax,%r10
+	leaq	.Lxts_magic(%rip),%r8
+	jmp	.Lxts_enc_grandloop
+
+.align	32
+.Lxts_enc_grandloop:
+	movdqu	0(%rdi),%xmm2
+	movdqa	%xmm0,%xmm8
+	movdqu	16(%rdi),%xmm3
+	pxor	%xmm10,%xmm2
+	movdqu	32(%rdi),%xmm4
+	pxor	%xmm11,%xmm3
+.byte	102,15,56,220,209
+	movdqu	48(%rdi),%xmm5
+	pxor	%xmm12,%xmm4
+.byte	102,15,56,220,217
+	movdqu	64(%rdi),%xmm6
+	pxor	%xmm13,%xmm5
+.byte	102,15,56,220,225
+	movdqu	80(%rdi),%xmm7
+	pxor	%xmm15,%xmm8
+	movdqa	96(%rsp),%xmm9
+	pxor	%xmm14,%xmm6
+.byte	102,15,56,220,233
+	movups	32(%r11),%xmm0
+	leaq	96(%rdi),%rdi
+	pxor	%xmm8,%xmm7
+
+	pxor	%xmm9,%xmm10
+.byte	102,15,56,220,241
+	pxor	%xmm9,%xmm11
+	movdqa	%xmm10,0(%rsp)
+.byte	102,15,56,220,249
+	movups	48(%r11),%xmm1
+	pxor	%xmm9,%xmm12
+
+.byte	102,15,56,220,208
+	pxor	%xmm9,%xmm13
+	movdqa	%xmm11,16(%rsp)
+.byte	102,15,56,220,216
+	pxor	%xmm9,%xmm14
+	movdqa	%xmm12,32(%rsp)
+.byte	102,15,56,220,224
+.byte	102,15,56,220,232
+	pxor	%xmm9,%xmm8
+	movdqa	%xmm14,64(%rsp)
+.byte	102,15,56,220,240
+.byte	102,15,56,220,248
+	movups	64(%r11),%xmm0
+	movdqa	%xmm8,80(%rsp)
+	pshufd	$95,%xmm15,%xmm9
+	jmp	.Lxts_enc_loop6
+.align	32
+.Lxts_enc_loop6:
+.byte	102,15,56,220,209
+.byte	102,15,56,220,217
+.byte	102,15,56,220,225
+.byte	102,15,56,220,233
+.byte	102,15,56,220,241
+.byte	102,15,56,220,249
+	movups	-64(%rcx,%rax,1),%xmm1
+	addq	$32,%rax
+
+.byte	102,15,56,220,208
+.byte	102,15,56,220,216
+.byte	102,15,56,220,224
+.byte	102,15,56,220,232
+.byte	102,15,56,220,240
+.byte	102,15,56,220,248
+	movups	-80(%rcx,%rax,1),%xmm0
+	jnz	.Lxts_enc_loop6
+
+	movdqa	(%r8),%xmm8
+	movdqa	%xmm9,%xmm14
+	paddd	%xmm9,%xmm9
+.byte	102,15,56,220,209
+	paddq	%xmm15,%xmm15
+	psrad	$31,%xmm14
+.byte	102,15,56,220,217
+	pand	%xmm8,%xmm14
+	movups	(%r11),%xmm10
+.byte	102,15,56,220,225
+.byte	102,15,56,220,233
+.byte	102,15,56,220,241
+	pxor	%xmm14,%xmm15
+	movaps	%xmm10,%xmm11
+.byte	102,15,56,220,249
+	movups	-64(%rcx),%xmm1
+
+	movdqa	%xmm9,%xmm14
+.byte	102,15,56,220,208
+	paddd	%xmm9,%xmm9
+	pxor	%xmm15,%xmm10
+.byte	102,15,56,220,216
+	psrad	$31,%xmm14
+	paddq	%xmm15,%xmm15
+.byte	102,15,56,220,224
+.byte	102,15,56,220,232
+	pand	%xmm8,%xmm14
+	movaps	%xmm11,%xmm12
+.byte	102,15,56,220,240
+	pxor	%xmm14,%xmm15
+	movdqa	%xmm9,%xmm14
+.byte	102,15,56,220,248
+	movups	-48(%rcx),%xmm0
+
+	paddd	%xmm9,%xmm9
+.byte	102,15,56,220,209
+	pxor	%xmm15,%xmm11
+	psrad	$31,%xmm14
+.byte	102,15,56,220,217
+	paddq	%xmm15,%xmm15
+	pand	%xmm8,%xmm14
+.byte	102,15,56,220,225
+.byte	102,15,56,220,233
+	movdqa	%xmm13,48(%rsp)
+	pxor	%xmm14,%xmm15
+.byte	102,15,56,220,241
+	movaps	%xmm12,%xmm13
+	movdqa	%xmm9,%xmm14
+.byte	102,15,56,220,249
+	movups	-32(%rcx),%xmm1
+
+	paddd	%xmm9,%xmm9
+.byte	102,15,56,220,208
+	pxor	%xmm15,%xmm12
+	psrad	$31,%xmm14
+.byte	102,15,56,220,216
+	paddq	%xmm15,%xmm15
+	pand	%xmm8,%xmm14
+.byte	102,15,56,220,224
+.byte	102,15,56,220,232
+.byte	102,15,56,220,240
+	pxor	%xmm14,%xmm15
+	movaps	%xmm13,%xmm14
+.byte	102,15,56,220,248
+
+	movdqa	%xmm9,%xmm0
+	paddd	%xmm9,%xmm9
+.byte	102,15,56,220,209
+	pxor	%xmm15,%xmm13
+	psrad	$31,%xmm0
+.byte	102,15,56,220,217
+	paddq	%xmm15,%xmm15
+	pand	%xmm8,%xmm0
+.byte	102,15,56,220,225
+.byte	102,15,56,220,233
+	pxor	%xmm0,%xmm15
+	movups	(%r11),%xmm0
+.byte	102,15,56,220,241
+.byte	102,15,56,220,249
+	movups	16(%r11),%xmm1
+
+	pxor	%xmm15,%xmm14
+.byte	102,15,56,221,84,36,0
+	psrad	$31,%xmm9
+	paddq	%xmm15,%xmm15
+.byte	102,15,56,221,92,36,16
+.byte	102,15,56,221,100,36,32
+	pand	%xmm8,%xmm9
+	movq	%r10,%rax
+.byte	102,15,56,221,108,36,48
+.byte	102,15,56,221,116,36,64
+.byte	102,15,56,221,124,36,80
+	pxor	%xmm9,%xmm15
+
+	leaq	96(%rsi),%rsi
+	movups	%xmm2,-96(%rsi)
+	movups	%xmm3,-80(%rsi)
+	movups	%xmm4,-64(%rsi)
+	movups	%xmm5,-48(%rsi)
+	movups	%xmm6,-32(%rsi)
+	movups	%xmm7,-16(%rsi)
+	subq	$96,%rdx
+	jnc	.Lxts_enc_grandloop
+
+	movl	$16+96,%eax
+	subl	%r10d,%eax
+	movq	%r11,%rcx
+	shrl	$4,%eax
+
+.Lxts_enc_short:
+
+	movl	%eax,%r10d
+	pxor	%xmm0,%xmm10
+	addq	$96,%rdx
+	jz	.Lxts_enc_done
+
+	pxor	%xmm0,%xmm11
+	cmpq	$32,%rdx
+	jb	.Lxts_enc_one
+	pxor	%xmm0,%xmm12
+	je	.Lxts_enc_two
+
+	pxor	%xmm0,%xmm13
+	cmpq	$64,%rdx
+	jb	.Lxts_enc_three
+	pxor	%xmm0,%xmm14
+	je	.Lxts_enc_four
+
+	movdqu	(%rdi),%xmm2
+	movdqu	16(%rdi),%xmm3
+	movdqu	32(%rdi),%xmm4
+	pxor	%xmm10,%xmm2
+	movdqu	48(%rdi),%xmm5
+	pxor	%xmm11,%xmm3
+	movdqu	64(%rdi),%xmm6
+	leaq	80(%rdi),%rdi
+	pxor	%xmm12,%xmm4
+	pxor	%xmm13,%xmm5
+	pxor	%xmm14,%xmm6
+	pxor	%xmm7,%xmm7
+
+	call	_aesni_encrypt6
+
+	xorps	%xmm10,%xmm2
+	movdqa	%xmm15,%xmm10
+	xorps	%xmm11,%xmm3
+	xorps	%xmm12,%xmm4
+	movdqu	%xmm2,(%rsi)
+	xorps	%xmm13,%xmm5
+	movdqu	%xmm3,16(%rsi)
+	xorps	%xmm14,%xmm6
+	movdqu	%xmm4,32(%rsi)
+	movdqu	%xmm5,48(%rsi)
+	movdqu	%xmm6,64(%rsi)
+	leaq	80(%rsi),%rsi
+	jmp	.Lxts_enc_done
+
+.align	16
+.Lxts_enc_one:
+	movups	(%rdi),%xmm2
+	leaq	16(%rdi),%rdi
+	xorps	%xmm10,%xmm2
+	movups	(%rcx),%xmm0
+	movups	16(%rcx),%xmm1
+	leaq	32(%rcx),%rcx
+	xorps	%xmm0,%xmm2
+.Loop_enc1_9:
+.byte	102,15,56,220,209
+	decl	%eax
+	movups	(%rcx),%xmm1
+	leaq	16(%rcx),%rcx
+	jnz	.Loop_enc1_9
+.byte	102,15,56,221,209
+	xorps	%xmm10,%xmm2
+	movdqa	%xmm11,%xmm10
+	movups	%xmm2,(%rsi)
+	leaq	16(%rsi),%rsi
+	jmp	.Lxts_enc_done
+
+.align	16
+.Lxts_enc_two:
+	movups	(%rdi),%xmm2
+	movups	16(%rdi),%xmm3
+	leaq	32(%rdi),%rdi
+	xorps	%xmm10,%xmm2
+	xorps	%xmm11,%xmm3
+
+	call	_aesni_encrypt2
+
+	xorps	%xmm10,%xmm2
+	movdqa	%xmm12,%xmm10
+	xorps	%xmm11,%xmm3
+	movups	%xmm2,(%rsi)
+	movups	%xmm3,16(%rsi)
+	leaq	32(%rsi),%rsi
+	jmp	.Lxts_enc_done
+
+.align	16
+.Lxts_enc_three:
+	movups	(%rdi),%xmm2
+	movups	16(%rdi),%xmm3
+	movups	32(%rdi),%xmm4
+	leaq	48(%rdi),%rdi
+	xorps	%xmm10,%xmm2
+	xorps	%xmm11,%xmm3
+	xorps	%xmm12,%xmm4
+
+	call	_aesni_encrypt3
+
+	xorps	%xmm10,%xmm2
+	movdqa	%xmm13,%xmm10
+	xorps	%xmm11,%xmm3
+	xorps	%xmm12,%xmm4
+	movups	%xmm2,(%rsi)
+	movups	%xmm3,16(%rsi)
+	movups	%xmm4,32(%rsi)
+	leaq	48(%rsi),%rsi
+	jmp	.Lxts_enc_done
+
+.align	16
+.Lxts_enc_four:
+	movups	(%rdi),%xmm2
+	movups	16(%rdi),%xmm3
+	movups	32(%rdi),%xmm4
+	xorps	%xmm10,%xmm2
+	movups	48(%rdi),%xmm5
+	leaq	64(%rdi),%rdi
+	xorps	%xmm11,%xmm3
+	xorps	%xmm12,%xmm4
+	xorps	%xmm13,%xmm5
+
+	call	_aesni_encrypt4
+
+	pxor	%xmm10,%xmm2
+	movdqa	%xmm14,%xmm10
+	pxor	%xmm11,%xmm3
+	pxor	%xmm12,%xmm4
+	movdqu	%xmm2,(%rsi)
+	pxor	%xmm13,%xmm5
+	movdqu	%xmm3,16(%rsi)
+	movdqu	%xmm4,32(%rsi)
+	movdqu	%xmm5,48(%rsi)
+	leaq	64(%rsi),%rsi
+	jmp	.Lxts_enc_done
+
+.align	16
+.Lxts_enc_done:
+	andq	$15,%r9
+	jz	.Lxts_enc_ret
+	movq	%r9,%rdx
+
+.Lxts_enc_steal:
+	movzbl	(%rdi),%eax
+	movzbl	-16(%rsi),%ecx
+	leaq	1(%rdi),%rdi
+	movb	%al,-16(%rsi)
+	movb	%cl,0(%rsi)
+	leaq	1(%rsi),%rsi
+	subq	$1,%rdx
+	jnz	.Lxts_enc_steal
+
+	subq	%r9,%rsi
+	movq	%r11,%rcx
+	movl	%r10d,%eax
+
+	movups	-16(%rsi),%xmm2
+	xorps	%xmm10,%xmm2
+	movups	(%rcx),%xmm0
+	movups	16(%rcx),%xmm1
+	leaq	32(%rcx),%rcx
+	xorps	%xmm0,%xmm2
+.Loop_enc1_10:
+.byte	102,15,56,220,209
+	decl	%eax
+	movups	(%rcx),%xmm1
+	leaq	16(%rcx),%rcx
+	jnz	.Loop_enc1_10
+.byte	102,15,56,221,209
+	xorps	%xmm10,%xmm2
+	movups	%xmm2,-16(%rsi)
+
+.Lxts_enc_ret:
+	xorps	%xmm0,%xmm0
+	pxor	%xmm1,%xmm1
+	pxor	%xmm2,%xmm2
+	pxor	%xmm3,%xmm3
+	pxor	%xmm4,%xmm4
+	pxor	%xmm5,%xmm5
+	pxor	%xmm6,%xmm6
+	pxor	%xmm7,%xmm7
+	movaps	%xmm0,0(%rsp)
+	pxor	%xmm8,%xmm8
+	movaps	%xmm0,16(%rsp)
+	pxor	%xmm9,%xmm9
+	movaps	%xmm0,32(%rsp)
+	pxor	%xmm10,%xmm10
+	movaps	%xmm0,48(%rsp)
+	pxor	%xmm11,%xmm11
+	movaps	%xmm0,64(%rsp)
+	pxor	%xmm12,%xmm12
+	movaps	%xmm0,80(%rsp)
+	pxor	%xmm13,%xmm13
+	movaps	%xmm0,96(%rsp)
+	pxor	%xmm14,%xmm14
+	pxor	%xmm15,%xmm15
+	leaq	(%rbp),%rsp
+	popq	%rbp
+.Lxts_enc_epilogue:
+	.byte	0xf3,0xc3
+.size	aesni_xts_encrypt,.-aesni_xts_encrypt
+.globl	aesni_xts_decrypt
+.hidden aesni_xts_decrypt
+.type	aesni_xts_decrypt,@function
+.align	16
+aesni_xts_decrypt:
+	leaq	(%rsp),%rax
+	pushq	%rbp
+	subq	$112,%rsp
+	andq	$-16,%rsp
+	leaq	-8(%rax),%rbp
+	movups	(%r9),%xmm2
+	movl	240(%r8),%eax
+	movl	240(%rcx),%r10d
+	movups	(%r8),%xmm0
+	movups	16(%r8),%xmm1
+	leaq	32(%r8),%r8
+	xorps	%xmm0,%xmm2
+.Loop_enc1_11:
+.byte	102,15,56,220,209
+	decl	%eax
+	movups	(%r8),%xmm1
+	leaq	16(%r8),%r8
+	jnz	.Loop_enc1_11
+.byte	102,15,56,221,209
+	xorl	%eax,%eax
+	testq	$15,%rdx
+	setnz	%al
+	shlq	$4,%rax
+	subq	%rax,%rdx
+
+	movups	(%rcx),%xmm0
+	movq	%rcx,%r11
+	movl	%r10d,%eax
+	shll	$4,%r10d
+	movq	%rdx,%r9
+	andq	$-16,%rdx
+
+	movups	16(%rcx,%r10,1),%xmm1
+
+	movdqa	.Lxts_magic(%rip),%xmm8
+	movdqa	%xmm2,%xmm15
+	pshufd	$95,%xmm2,%xmm9
+	pxor	%xmm0,%xmm1
+	movdqa	%xmm9,%xmm14
+	paddd	%xmm9,%xmm9
+	movdqa	%xmm15,%xmm10
+	psrad	$31,%xmm14
+	paddq	%xmm15,%xmm15
+	pand	%xmm8,%xmm14
+	pxor	%xmm0,%xmm10
+	pxor	%xmm14,%xmm15
+	movdqa	%xmm9,%xmm14
+	paddd	%xmm9,%xmm9
+	movdqa	%xmm15,%xmm11
+	psrad	$31,%xmm14
+	paddq	%xmm15,%xmm15
+	pand	%xmm8,%xmm14
+	pxor	%xmm0,%xmm11
+	pxor	%xmm14,%xmm15
+	movdqa	%xmm9,%xmm14
+	paddd	%xmm9,%xmm9
+	movdqa	%xmm15,%xmm12
+	psrad	$31,%xmm14
+	paddq	%xmm15,%xmm15
+	pand	%xmm8,%xmm14
+	pxor	%xmm0,%xmm12
+	pxor	%xmm14,%xmm15
+	movdqa	%xmm9,%xmm14
+	paddd	%xmm9,%xmm9
+	movdqa	%xmm15,%xmm13
+	psrad	$31,%xmm14
+	paddq	%xmm15,%xmm15
+	pand	%xmm8,%xmm14
+	pxor	%xmm0,%xmm13
+	pxor	%xmm14,%xmm15
+	movdqa	%xmm15,%xmm14
+	psrad	$31,%xmm9
+	paddq	%xmm15,%xmm15
+	pand	%xmm8,%xmm9
+	pxor	%xmm0,%xmm14
+	pxor	%xmm9,%xmm15
+	movaps	%xmm1,96(%rsp)
+
+	subq	$96,%rdx
+	jc	.Lxts_dec_short
+
+	movl	$16+96,%eax
+	leaq	32(%r11,%r10,1),%rcx
+	subq	%r10,%rax
+	movups	16(%r11),%xmm1
+	movq	%rax,%r10
+	leaq	.Lxts_magic(%rip),%r8
+	jmp	.Lxts_dec_grandloop
+
+.align	32
+.Lxts_dec_grandloop:
+	movdqu	0(%rdi),%xmm2
+	movdqa	%xmm0,%xmm8
+	movdqu	16(%rdi),%xmm3
+	pxor	%xmm10,%xmm2
+	movdqu	32(%rdi),%xmm4
+	pxor	%xmm11,%xmm3
+.byte	102,15,56,222,209
+	movdqu	48(%rdi),%xmm5
+	pxor	%xmm12,%xmm4
+.byte	102,15,56,222,217
+	movdqu	64(%rdi),%xmm6
+	pxor	%xmm13,%xmm5
+.byte	102,15,56,222,225
+	movdqu	80(%rdi),%xmm7
+	pxor	%xmm15,%xmm8
+	movdqa	96(%rsp),%xmm9
+	pxor	%xmm14,%xmm6
+.byte	102,15,56,222,233
+	movups	32(%r11),%xmm0
+	leaq	96(%rdi),%rdi
+	pxor	%xmm8,%xmm7
+
+	pxor	%xmm9,%xmm10
+.byte	102,15,56,222,241
+	pxor	%xmm9,%xmm11
+	movdqa	%xmm10,0(%rsp)
+.byte	102,15,56,222,249
+	movups	48(%r11),%xmm1
+	pxor	%xmm9,%xmm12
+
+.byte	102,15,56,222,208
+	pxor	%xmm9,%xmm13
+	movdqa	%xmm11,16(%rsp)
+.byte	102,15,56,222,216
+	pxor	%xmm9,%xmm14
+	movdqa	%xmm12,32(%rsp)
+.byte	102,15,56,222,224
+.byte	102,15,56,222,232
+	pxor	%xmm9,%xmm8
+	movdqa	%xmm14,64(%rsp)
+.byte	102,15,56,222,240
+.byte	102,15,56,222,248
+	movups	64(%r11),%xmm0
+	movdqa	%xmm8,80(%rsp)
+	pshufd	$95,%xmm15,%xmm9
+	jmp	.Lxts_dec_loop6
+.align	32
+.Lxts_dec_loop6:
+.byte	102,15,56,222,209
+.byte	102,15,56,222,217
+.byte	102,15,56,222,225
+.byte	102,15,56,222,233
+.byte	102,15,56,222,241
+.byte	102,15,56,222,249
+	movups	-64(%rcx,%rax,1),%xmm1
+	addq	$32,%rax
+
+.byte	102,15,56,222,208
+.byte	102,15,56,222,216
+.byte	102,15,56,222,224
+.byte	102,15,56,222,232
+.byte	102,15,56,222,240
+.byte	102,15,56,222,248
+	movups	-80(%rcx,%rax,1),%xmm0
+	jnz	.Lxts_dec_loop6
+
+	movdqa	(%r8),%xmm8
+	movdqa	%xmm9,%xmm14
+	paddd	%xmm9,%xmm9
+.byte	102,15,56,222,209
+	paddq	%xmm15,%xmm15
+	psrad	$31,%xmm14
+.byte	102,15,56,222,217
+	pand	%xmm8,%xmm14
+	movups	(%r11),%xmm10
+.byte	102,15,56,222,225
+.byte	102,15,56,222,233
+.byte	102,15,56,222,241
+	pxor	%xmm14,%xmm15
+	movaps	%xmm10,%xmm11
+.byte	102,15,56,222,249
+	movups	-64(%rcx),%xmm1
+
+	movdqa	%xmm9,%xmm14
+.byte	102,15,56,222,208
+	paddd	%xmm9,%xmm9
+	pxor	%xmm15,%xmm10
+.byte	102,15,56,222,216
+	psrad	$31,%xmm14
+	paddq	%xmm15,%xmm15
+.byte	102,15,56,222,224
+.byte	102,15,56,222,232
+	pand	%xmm8,%xmm14
+	movaps	%xmm11,%xmm12
+.byte	102,15,56,222,240
+	pxor	%xmm14,%xmm15
+	movdqa	%xmm9,%xmm14
+.byte	102,15,56,222,248
+	movups	-48(%rcx),%xmm0
+
+	paddd	%xmm9,%xmm9
+.byte	102,15,56,222,209
+	pxor	%xmm15,%xmm11
+	psrad	$31,%xmm14
+.byte	102,15,56,222,217
+	paddq	%xmm15,%xmm15
+	pand	%xmm8,%xmm14
+.byte	102,15,56,222,225
+.byte	102,15,56,222,233
+	movdqa	%xmm13,48(%rsp)
+	pxor	%xmm14,%xmm15
+.byte	102,15,56,222,241
+	movaps	%xmm12,%xmm13
+	movdqa	%xmm9,%xmm14
+.byte	102,15,56,222,249
+	movups	-32(%rcx),%xmm1
+
+	paddd	%xmm9,%xmm9
+.byte	102,15,56,222,208
+	pxor	%xmm15,%xmm12
+	psrad	$31,%xmm14
+.byte	102,15,56,222,216
+	paddq	%xmm15,%xmm15
+	pand	%xmm8,%xmm14
+.byte	102,15,56,222,224
+.byte	102,15,56,222,232
+.byte	102,15,56,222,240
+	pxor	%xmm14,%xmm15
+	movaps	%xmm13,%xmm14
+.byte	102,15,56,222,248
+
+	movdqa	%xmm9,%xmm0
+	paddd	%xmm9,%xmm9
+.byte	102,15,56,222,209
+	pxor	%xmm15,%xmm13
+	psrad	$31,%xmm0
+.byte	102,15,56,222,217
+	paddq	%xmm15,%xmm15
+	pand	%xmm8,%xmm0
+.byte	102,15,56,222,225
+.byte	102,15,56,222,233
+	pxor	%xmm0,%xmm15
+	movups	(%r11),%xmm0
+.byte	102,15,56,222,241
+.byte	102,15,56,222,249
+	movups	16(%r11),%xmm1
+
+	pxor	%xmm15,%xmm14
+.byte	102,15,56,223,84,36,0
+	psrad	$31,%xmm9
+	paddq	%xmm15,%xmm15
+.byte	102,15,56,223,92,36,16
+.byte	102,15,56,223,100,36,32
+	pand	%xmm8,%xmm9
+	movq	%r10,%rax
+.byte	102,15,56,223,108,36,48
+.byte	102,15,56,223,116,36,64
+.byte	102,15,56,223,124,36,80
+	pxor	%xmm9,%xmm15
+
+	leaq	96(%rsi),%rsi
+	movups	%xmm2,-96(%rsi)
+	movups	%xmm3,-80(%rsi)
+	movups	%xmm4,-64(%rsi)
+	movups	%xmm5,-48(%rsi)
+	movups	%xmm6,-32(%rsi)
+	movups	%xmm7,-16(%rsi)
+	subq	$96,%rdx
+	jnc	.Lxts_dec_grandloop
+
+	movl	$16+96,%eax
+	subl	%r10d,%eax
+	movq	%r11,%rcx
+	shrl	$4,%eax
+
+.Lxts_dec_short:
+
+	movl	%eax,%r10d
+	pxor	%xmm0,%xmm10
+	pxor	%xmm0,%xmm11
+	addq	$96,%rdx
+	jz	.Lxts_dec_done
+
+	pxor	%xmm0,%xmm12
+	cmpq	$32,%rdx
+	jb	.Lxts_dec_one
+	pxor	%xmm0,%xmm13
+	je	.Lxts_dec_two
+
+	pxor	%xmm0,%xmm14
+	cmpq	$64,%rdx
+	jb	.Lxts_dec_three
+	je	.Lxts_dec_four
+
+	movdqu	(%rdi),%xmm2
+	movdqu	16(%rdi),%xmm3
+	movdqu	32(%rdi),%xmm4
+	pxor	%xmm10,%xmm2
+	movdqu	48(%rdi),%xmm5
+	pxor	%xmm11,%xmm3
+	movdqu	64(%rdi),%xmm6
+	leaq	80(%rdi),%rdi
+	pxor	%xmm12,%xmm4
+	pxor	%xmm13,%xmm5
+	pxor	%xmm14,%xmm6
+
+	call	_aesni_decrypt6
+
+	xorps	%xmm10,%xmm2
+	xorps	%xmm11,%xmm3
+	xorps	%xmm12,%xmm4
+	movdqu	%xmm2,(%rsi)
+	xorps	%xmm13,%xmm5
+	movdqu	%xmm3,16(%rsi)
+	xorps	%xmm14,%xmm6
+	movdqu	%xmm4,32(%rsi)
+	pxor	%xmm14,%xmm14
+	movdqu	%xmm5,48(%rsi)
+	pcmpgtd	%xmm15,%xmm14
+	movdqu	%xmm6,64(%rsi)
+	leaq	80(%rsi),%rsi
+	pshufd	$19,%xmm14,%xmm11
+	andq	$15,%r9
+	jz	.Lxts_dec_ret
+
+	movdqa	%xmm15,%xmm10
+	paddq	%xmm15,%xmm15
+	pand	%xmm8,%xmm11
+	pxor	%xmm15,%xmm11
+	jmp	.Lxts_dec_done2
+
+.align	16
+.Lxts_dec_one:
+	movups	(%rdi),%xmm2
+	leaq	16(%rdi),%rdi
+	xorps	%xmm10,%xmm2
+	movups	(%rcx),%xmm0
+	movups	16(%rcx),%xmm1
+	leaq	32(%rcx),%rcx
+	xorps	%xmm0,%xmm2
+.Loop_dec1_12:
+.byte	102,15,56,222,209
+	decl	%eax
+	movups	(%rcx),%xmm1
+	leaq	16(%rcx),%rcx
+	jnz	.Loop_dec1_12
+.byte	102,15,56,223,209
+	xorps	%xmm10,%xmm2
+	movdqa	%xmm11,%xmm10
+	movups	%xmm2,(%rsi)
+	movdqa	%xmm12,%xmm11
+	leaq	16(%rsi),%rsi
+	jmp	.Lxts_dec_done
+
+.align	16
+.Lxts_dec_two:
+	movups	(%rdi),%xmm2
+	movups	16(%rdi),%xmm3
+	leaq	32(%rdi),%rdi
+	xorps	%xmm10,%xmm2
+	xorps	%xmm11,%xmm3
+
+	call	_aesni_decrypt2
+
+	xorps	%xmm10,%xmm2
+	movdqa	%xmm12,%xmm10
+	xorps	%xmm11,%xmm3
+	movdqa	%xmm13,%xmm11
+	movups	%xmm2,(%rsi)
+	movups	%xmm3,16(%rsi)
+	leaq	32(%rsi),%rsi
+	jmp	.Lxts_dec_done
+
+.align	16
+.Lxts_dec_three:
+	movups	(%rdi),%xmm2
+	movups	16(%rdi),%xmm3
+	movups	32(%rdi),%xmm4
+	leaq	48(%rdi),%rdi
+	xorps	%xmm10,%xmm2
+	xorps	%xmm11,%xmm3
+	xorps	%xmm12,%xmm4
+
+	call	_aesni_decrypt3
+
+	xorps	%xmm10,%xmm2
+	movdqa	%xmm13,%xmm10
+	xorps	%xmm11,%xmm3
+	movdqa	%xmm14,%xmm11
+	xorps	%xmm12,%xmm4
+	movups	%xmm2,(%rsi)
+	movups	%xmm3,16(%rsi)
+	movups	%xmm4,32(%rsi)
+	leaq	48(%rsi),%rsi
+	jmp	.Lxts_dec_done
+
+.align	16
+.Lxts_dec_four:
+	movups	(%rdi),%xmm2
+	movups	16(%rdi),%xmm3
+	movups	32(%rdi),%xmm4
+	xorps	%xmm10,%xmm2
+	movups	48(%rdi),%xmm5
+	leaq	64(%rdi),%rdi
+	xorps	%xmm11,%xmm3
+	xorps	%xmm12,%xmm4
+	xorps	%xmm13,%xmm5
+
+	call	_aesni_decrypt4
+
+	pxor	%xmm10,%xmm2
+	movdqa	%xmm14,%xmm10
+	pxor	%xmm11,%xmm3
+	movdqa	%xmm15,%xmm11
+	pxor	%xmm12,%xmm4
+	movdqu	%xmm2,(%rsi)
+	pxor	%xmm13,%xmm5
+	movdqu	%xmm3,16(%rsi)
+	movdqu	%xmm4,32(%rsi)
+	movdqu	%xmm5,48(%rsi)
+	leaq	64(%rsi),%rsi
+	jmp	.Lxts_dec_done
+
+.align	16
+.Lxts_dec_done:
+	andq	$15,%r9
+	jz	.Lxts_dec_ret
+.Lxts_dec_done2:
+	movq	%r9,%rdx
+	movq	%r11,%rcx
+	movl	%r10d,%eax
+
+	movups	(%rdi),%xmm2
+	xorps	%xmm11,%xmm2
+	movups	(%rcx),%xmm0
+	movups	16(%rcx),%xmm1
+	leaq	32(%rcx),%rcx
+	xorps	%xmm0,%xmm2
+.Loop_dec1_13:
+.byte	102,15,56,222,209
+	decl	%eax
+	movups	(%rcx),%xmm1
+	leaq	16(%rcx),%rcx
+	jnz	.Loop_dec1_13
+.byte	102,15,56,223,209
+	xorps	%xmm11,%xmm2
+	movups	%xmm2,(%rsi)
+
+.Lxts_dec_steal:
+	movzbl	16(%rdi),%eax
+	movzbl	(%rsi),%ecx
+	leaq	1(%rdi),%rdi
+	movb	%al,(%rsi)
+	movb	%cl,16(%rsi)
+	leaq	1(%rsi),%rsi
+	subq	$1,%rdx
+	jnz	.Lxts_dec_steal
+
+	subq	%r9,%rsi
+	movq	%r11,%rcx
+	movl	%r10d,%eax
+
+	movups	(%rsi),%xmm2
+	xorps	%xmm10,%xmm2
+	movups	(%rcx),%xmm0
+	movups	16(%rcx),%xmm1
+	leaq	32(%rcx),%rcx
+	xorps	%xmm0,%xmm2
+.Loop_dec1_14:
+.byte	102,15,56,222,209
+	decl	%eax
+	movups	(%rcx),%xmm1
+	leaq	16(%rcx),%rcx
+	jnz	.Loop_dec1_14
+.byte	102,15,56,223,209
+	xorps	%xmm10,%xmm2
+	movups	%xmm2,(%rsi)
+
+.Lxts_dec_ret:
+	xorps	%xmm0,%xmm0
+	pxor	%xmm1,%xmm1
+	pxor	%xmm2,%xmm2
+	pxor	%xmm3,%xmm3
+	pxor	%xmm4,%xmm4
+	pxor	%xmm5,%xmm5
+	pxor	%xmm6,%xmm6
+	pxor	%xmm7,%xmm7
+	movaps	%xmm0,0(%rsp)
+	pxor	%xmm8,%xmm8
+	movaps	%xmm0,16(%rsp)
+	pxor	%xmm9,%xmm9
+	movaps	%xmm0,32(%rsp)
+	pxor	%xmm10,%xmm10
+	movaps	%xmm0,48(%rsp)
+	pxor	%xmm11,%xmm11
+	movaps	%xmm0,64(%rsp)
+	pxor	%xmm12,%xmm12
+	movaps	%xmm0,80(%rsp)
+	pxor	%xmm13,%xmm13
+	movaps	%xmm0,96(%rsp)
+	pxor	%xmm14,%xmm14
+	pxor	%xmm15,%xmm15
+	leaq	(%rbp),%rsp
+	popq	%rbp
+.Lxts_dec_epilogue:
+	.byte	0xf3,0xc3
+.size	aesni_xts_decrypt,.-aesni_xts_decrypt
+.globl	aesni_cbc_encrypt
+.hidden aesni_cbc_encrypt
+.type	aesni_cbc_encrypt,@function
+.align	16
+aesni_cbc_encrypt:
+	testq	%rdx,%rdx
+	jz	.Lcbc_ret
+
+	movl	240(%rcx),%r10d
+	movq	%rcx,%r11
+	testl	%r9d,%r9d
+	jz	.Lcbc_decrypt
+
+	movups	(%r8),%xmm2
+	movl	%r10d,%eax
+	cmpq	$16,%rdx
+	jb	.Lcbc_enc_tail
+	subq	$16,%rdx
+	jmp	.Lcbc_enc_loop
+.align	16
+.Lcbc_enc_loop:
+	movups	(%rdi),%xmm3
+	leaq	16(%rdi),%rdi
+
+	movups	(%rcx),%xmm0
+	movups	16(%rcx),%xmm1
+	xorps	%xmm0,%xmm3
+	leaq	32(%rcx),%rcx
+	xorps	%xmm3,%xmm2
+.Loop_enc1_15:
+.byte	102,15,56,220,209
+	decl	%eax
+	movups	(%rcx),%xmm1
+	leaq	16(%rcx),%rcx
+	jnz	.Loop_enc1_15
+.byte	102,15,56,221,209
+	movl	%r10d,%eax
+	movq	%r11,%rcx
+	movups	%xmm2,0(%rsi)
+	leaq	16(%rsi),%rsi
+	subq	$16,%rdx
+	jnc	.Lcbc_enc_loop
+	addq	$16,%rdx
+	jnz	.Lcbc_enc_tail
+	pxor	%xmm0,%xmm0
+	pxor	%xmm1,%xmm1
+	movups	%xmm2,(%r8)
+	pxor	%xmm2,%xmm2
+	pxor	%xmm3,%xmm3
+	jmp	.Lcbc_ret
+
+.Lcbc_enc_tail:
+	movq	%rdx,%rcx
+	xchgq	%rdi,%rsi
+.long	0x9066A4F3
+	movl	$16,%ecx
+	subq	%rdx,%rcx
+	xorl	%eax,%eax
+.long	0x9066AAF3
+	leaq	-16(%rdi),%rdi
+	movl	%r10d,%eax
+	movq	%rdi,%rsi
+	movq	%r11,%rcx
+	xorq	%rdx,%rdx
+	jmp	.Lcbc_enc_loop
+
+.align	16
+.Lcbc_decrypt:
+	cmpq	$16,%rdx
+	jne	.Lcbc_decrypt_bulk
+
+
+
+	movdqu	(%rdi),%xmm2
+	movdqu	(%r8),%xmm3
+	movdqa	%xmm2,%xmm4
+	movups	(%rcx),%xmm0
+	movups	16(%rcx),%xmm1
+	leaq	32(%rcx),%rcx
+	xorps	%xmm0,%xmm2
+.Loop_dec1_16:
+.byte	102,15,56,222,209
+	decl	%r10d
+	movups	(%rcx),%xmm1
+	leaq	16(%rcx),%rcx
+	jnz	.Loop_dec1_16
+.byte	102,15,56,223,209
+	pxor	%xmm0,%xmm0
+	pxor	%xmm1,%xmm1
+	movdqu	%xmm4,(%r8)
+	xorps	%xmm3,%xmm2
+	pxor	%xmm3,%xmm3
+	movups	%xmm2,(%rsi)
+	pxor	%xmm2,%xmm2
+	jmp	.Lcbc_ret
+.align	16
+.Lcbc_decrypt_bulk:
+	leaq	(%rsp),%rax
+	pushq	%rbp
+	subq	$16,%rsp
+	andq	$-16,%rsp
+	leaq	-8(%rax),%rbp
+	movups	(%r8),%xmm10
+	movl	%r10d,%eax
+	cmpq	$80,%rdx
+	jbe	.Lcbc_dec_tail
+
+	movups	(%rcx),%xmm0
+	movdqu	0(%rdi),%xmm2
+	movdqu	16(%rdi),%xmm3
+	movdqa	%xmm2,%xmm11
+	movdqu	32(%rdi),%xmm4
+	movdqa	%xmm3,%xmm12
+	movdqu	48(%rdi),%xmm5
+	movdqa	%xmm4,%xmm13
+	movdqu	64(%rdi),%xmm6
+	movdqa	%xmm5,%xmm14
+	movdqu	80(%rdi),%xmm7
+	movdqa	%xmm6,%xmm15
+	movl	OPENSSL_ia32cap_P+4(%rip),%r9d
+	cmpq	$112,%rdx
+	jbe	.Lcbc_dec_six_or_seven
+
+	andl	$71303168,%r9d
+	subq	$80,%rdx
+	cmpl	$4194304,%r9d
+	je	.Lcbc_dec_loop6_enter
+	subq	$32,%rdx
+	leaq	112(%rcx),%rcx
+	jmp	.Lcbc_dec_loop8_enter
+.align	16
+.Lcbc_dec_loop8:
+	movups	%xmm9,(%rsi)
+	leaq	16(%rsi),%rsi
+.Lcbc_dec_loop8_enter:
+	movdqu	96(%rdi),%xmm8
+	pxor	%xmm0,%xmm2
+	movdqu	112(%rdi),%xmm9
+	pxor	%xmm0,%xmm3
+	movups	16-112(%rcx),%xmm1
+	pxor	%xmm0,%xmm4
+	xorq	%r11,%r11
+	cmpq	$112,%rdx
+	pxor	%xmm0,%xmm5
+	pxor	%xmm0,%xmm6
+	pxor	%xmm0,%xmm7
+	pxor	%xmm0,%xmm8
+
+.byte	102,15,56,222,209
+	pxor	%xmm0,%xmm9
+	movups	32-112(%rcx),%xmm0
+.byte	102,15,56,222,217
+.byte	102,15,56,222,225
+.byte	102,15,56,222,233
+.byte	102,15,56,222,241
+.byte	102,15,56,222,249
+.byte	102,68,15,56,222,193
+	setnc	%r11b
+	shlq	$7,%r11
+.byte	102,68,15,56,222,201
+	addq	%rdi,%r11
+	movups	48-112(%rcx),%xmm1
+.byte	102,15,56,222,208
+.byte	102,15,56,222,216
+.byte	102,15,56,222,224
+.byte	102,15,56,222,232
+.byte	102,15,56,222,240
+.byte	102,15,56,222,248
+.byte	102,68,15,56,222,192
+.byte	102,68,15,56,222,200
+	movups	64-112(%rcx),%xmm0
+	nop
+.byte	102,15,56,222,209
+.byte	102,15,56,222,217
+.byte	102,15,56,222,225
+.byte	102,15,56,222,233
+.byte	102,15,56,222,241
+.byte	102,15,56,222,249
+.byte	102,68,15,56,222,193
+.byte	102,68,15,56,222,201
+	movups	80-112(%rcx),%xmm1
+	nop
+.byte	102,15,56,222,208
+.byte	102,15,56,222,216
+.byte	102,15,56,222,224
+.byte	102,15,56,222,232
+.byte	102,15,56,222,240
+.byte	102,15,56,222,248
+.byte	102,68,15,56,222,192
+.byte	102,68,15,56,222,200
+	movups	96-112(%rcx),%xmm0
+	nop
+.byte	102,15,56,222,209
+.byte	102,15,56,222,217
+.byte	102,15,56,222,225
+.byte	102,15,56,222,233
+.byte	102,15,56,222,241
+.byte	102,15,56,222,249
+.byte	102,68,15,56,222,193
+.byte	102,68,15,56,222,201
+	movups	112-112(%rcx),%xmm1
+	nop
+.byte	102,15,56,222,208
+.byte	102,15,56,222,216
+.byte	102,15,56,222,224
+.byte	102,15,56,222,232
+.byte	102,15,56,222,240
+.byte	102,15,56,222,248
+.byte	102,68,15,56,222,192
+.byte	102,68,15,56,222,200
+	movups	128-112(%rcx),%xmm0
+	nop
+.byte	102,15,56,222,209
+.byte	102,15,56,222,217
+.byte	102,15,56,222,225
+.byte	102,15,56,222,233
+.byte	102,15,56,222,241
+.byte	102,15,56,222,249
+.byte	102,68,15,56,222,193
+.byte	102,68,15,56,222,201
+	movups	144-112(%rcx),%xmm1
+	cmpl	$11,%eax
+.byte	102,15,56,222,208
+.byte	102,15,56,222,216
+.byte	102,15,56,222,224
+.byte	102,15,56,222,232
+.byte	102,15,56,222,240
+.byte	102,15,56,222,248
+.byte	102,68,15,56,222,192
+.byte	102,68,15,56,222,200
+	movups	160-112(%rcx),%xmm0
+	jb	.Lcbc_dec_done
+.byte	102,15,56,222,209
+.byte	102,15,56,222,217
+.byte	102,15,56,222,225
+.byte	102,15,56,222,233
+.byte	102,15,56,222,241
+.byte	102,15,56,222,249
+.byte	102,68,15,56,222,193
+.byte	102,68,15,56,222,201
+	movups	176-112(%rcx),%xmm1
+	nop
+.byte	102,15,56,222,208
+.byte	102,15,56,222,216
+.byte	102,15,56,222,224
+.byte	102,15,56,222,232
+.byte	102,15,56,222,240
+.byte	102,15,56,222,248
+.byte	102,68,15,56,222,192
+.byte	102,68,15,56,222,200
+	movups	192-112(%rcx),%xmm0
+	je	.Lcbc_dec_done
+.byte	102,15,56,222,209
+.byte	102,15,56,222,217
+.byte	102,15,56,222,225
+.byte	102,15,56,222,233
+.byte	102,15,56,222,241
+.byte	102,15,56,222,249
+.byte	102,68,15,56,222,193
+.byte	102,68,15,56,222,201
+	movups	208-112(%rcx),%xmm1
+	nop
+.byte	102,15,56,222,208
+.byte	102,15,56,222,216
+.byte	102,15,56,222,224
+.byte	102,15,56,222,232
+.byte	102,15,56,222,240
+.byte	102,15,56,222,248
+.byte	102,68,15,56,222,192
+.byte	102,68,15,56,222,200
+	movups	224-112(%rcx),%xmm0
+	jmp	.Lcbc_dec_done
+.align	16
+.Lcbc_dec_done:
+.byte	102,15,56,222,209
+.byte	102,15,56,222,217
+	pxor	%xmm0,%xmm10
+	pxor	%xmm0,%xmm11
+.byte	102,15,56,222,225
+.byte	102,15,56,222,233
+	pxor	%xmm0,%xmm12
+	pxor	%xmm0,%xmm13
+.byte	102,15,56,222,241
+.byte	102,15,56,222,249
+	pxor	%xmm0,%xmm14
+	pxor	%xmm0,%xmm15
+.byte	102,68,15,56,222,193
+.byte	102,68,15,56,222,201
+	movdqu	80(%rdi),%xmm1
+
+.byte	102,65,15,56,223,210
+	movdqu	96(%rdi),%xmm10
+	pxor	%xmm0,%xmm1
+.byte	102,65,15,56,223,219
+	pxor	%xmm0,%xmm10
+	movdqu	112(%rdi),%xmm0
+.byte	102,65,15,56,223,228
+	leaq	128(%rdi),%rdi
+	movdqu	0(%r11),%xmm11
+.byte	102,65,15,56,223,237
+.byte	102,65,15,56,223,246
+	movdqu	16(%r11),%xmm12
+	movdqu	32(%r11),%xmm13
+.byte	102,65,15,56,223,255
+.byte	102,68,15,56,223,193
+	movdqu	48(%r11),%xmm14
+	movdqu	64(%r11),%xmm15
+.byte	102,69,15,56,223,202
+	movdqa	%xmm0,%xmm10
+	movdqu	80(%r11),%xmm1
+	movups	-112(%rcx),%xmm0
+
+	movups	%xmm2,(%rsi)
+	movdqa	%xmm11,%xmm2
+	movups	%xmm3,16(%rsi)
+	movdqa	%xmm12,%xmm3
+	movups	%xmm4,32(%rsi)
+	movdqa	%xmm13,%xmm4
+	movups	%xmm5,48(%rsi)
+	movdqa	%xmm14,%xmm5
+	movups	%xmm6,64(%rsi)
+	movdqa	%xmm15,%xmm6
+	movups	%xmm7,80(%rsi)
+	movdqa	%xmm1,%xmm7
+	movups	%xmm8,96(%rsi)
+	leaq	112(%rsi),%rsi
+
+	subq	$128,%rdx
+	ja	.Lcbc_dec_loop8
+
+	movaps	%xmm9,%xmm2
+	leaq	-112(%rcx),%rcx
+	addq	$112,%rdx
+	jle	.Lcbc_dec_clear_tail_collected
+	movups	%xmm9,(%rsi)
+	leaq	16(%rsi),%rsi
+	cmpq	$80,%rdx
+	jbe	.Lcbc_dec_tail
+
+	movaps	%xmm11,%xmm2
+.Lcbc_dec_six_or_seven:
+	cmpq	$96,%rdx
+	ja	.Lcbc_dec_seven
+
+	movaps	%xmm7,%xmm8
+	call	_aesni_decrypt6
+	pxor	%xmm10,%xmm2
+	movaps	%xmm8,%xmm10
+	pxor	%xmm11,%xmm3
+	movdqu	%xmm2,(%rsi)
+	pxor	%xmm12,%xmm4
+	movdqu	%xmm3,16(%rsi)
+	pxor	%xmm3,%xmm3
+	pxor	%xmm13,%xmm5
+	movdqu	%xmm4,32(%rsi)
+	pxor	%xmm4,%xmm4
+	pxor	%xmm14,%xmm6
+	movdqu	%xmm5,48(%rsi)
+	pxor	%xmm5,%xmm5
+	pxor	%xmm15,%xmm7
+	movdqu	%xmm6,64(%rsi)
+	pxor	%xmm6,%xmm6
+	leaq	80(%rsi),%rsi
+	movdqa	%xmm7,%xmm2
+	pxor	%xmm7,%xmm7
+	jmp	.Lcbc_dec_tail_collected
+
+.align	16
+.Lcbc_dec_seven:
+	movups	96(%rdi),%xmm8
+	xorps	%xmm9,%xmm9
+	call	_aesni_decrypt8
+	movups	80(%rdi),%xmm9
+	pxor	%xmm10,%xmm2
+	movups	96(%rdi),%xmm10
+	pxor	%xmm11,%xmm3
+	movdqu	%xmm2,(%rsi)
+	pxor	%xmm12,%xmm4
+	movdqu	%xmm3,16(%rsi)
+	pxor	%xmm3,%xmm3
+	pxor	%xmm13,%xmm5
+	movdqu	%xmm4,32(%rsi)
+	pxor	%xmm4,%xmm4
+	pxor	%xmm14,%xmm6
+	movdqu	%xmm5,48(%rsi)
+	pxor	%xmm5,%xmm5
+	pxor	%xmm15,%xmm7
+	movdqu	%xmm6,64(%rsi)
+	pxor	%xmm6,%xmm6
+	pxor	%xmm9,%xmm8
+	movdqu	%xmm7,80(%rsi)
+	pxor	%xmm7,%xmm7
+	leaq	96(%rsi),%rsi
+	movdqa	%xmm8,%xmm2
+	pxor	%xmm8,%xmm8
+	pxor	%xmm9,%xmm9
+	jmp	.Lcbc_dec_tail_collected
+
+.align	16
+.Lcbc_dec_loop6:
+	movups	%xmm7,(%rsi)
+	leaq	16(%rsi),%rsi
+	movdqu	0(%rdi),%xmm2
+	movdqu	16(%rdi),%xmm3
+	movdqa	%xmm2,%xmm11
+	movdqu	32(%rdi),%xmm4
+	movdqa	%xmm3,%xmm12
+	movdqu	48(%rdi),%xmm5
+	movdqa	%xmm4,%xmm13
+	movdqu	64(%rdi),%xmm6
+	movdqa	%xmm5,%xmm14
+	movdqu	80(%rdi),%xmm7
+	movdqa	%xmm6,%xmm15
+.Lcbc_dec_loop6_enter:
+	leaq	96(%rdi),%rdi
+	movdqa	%xmm7,%xmm8
+
+	call	_aesni_decrypt6
+
+	pxor	%xmm10,%xmm2
+	movdqa	%xmm8,%xmm10
+	pxor	%xmm11,%xmm3
+	movdqu	%xmm2,(%rsi)
+	pxor	%xmm12,%xmm4
+	movdqu	%xmm3,16(%rsi)
+	pxor	%xmm13,%xmm5
+	movdqu	%xmm4,32(%rsi)
+	pxor	%xmm14,%xmm6
+	movq	%r11,%rcx
+	movdqu	%xmm5,48(%rsi)
+	pxor	%xmm15,%xmm7
+	movl	%r10d,%eax
+	movdqu	%xmm6,64(%rsi)
+	leaq	80(%rsi),%rsi
+	subq	$96,%rdx
+	ja	.Lcbc_dec_loop6
+
+	movdqa	%xmm7,%xmm2
+	addq	$80,%rdx
+	jle	.Lcbc_dec_clear_tail_collected
+	movups	%xmm7,(%rsi)
+	leaq	16(%rsi),%rsi
+
+.Lcbc_dec_tail:
+	movups	(%rdi),%xmm2
+	subq	$16,%rdx
+	jbe	.Lcbc_dec_one
+
+	movups	16(%rdi),%xmm3
+	movaps	%xmm2,%xmm11
+	subq	$16,%rdx
+	jbe	.Lcbc_dec_two
+
+	movups	32(%rdi),%xmm4
+	movaps	%xmm3,%xmm12
+	subq	$16,%rdx
+	jbe	.Lcbc_dec_three
+
+	movups	48(%rdi),%xmm5
+	movaps	%xmm4,%xmm13
+	subq	$16,%rdx
+	jbe	.Lcbc_dec_four
+
+	movups	64(%rdi),%xmm6
+	movaps	%xmm5,%xmm14
+	movaps	%xmm6,%xmm15
+	xorps	%xmm7,%xmm7
+	call	_aesni_decrypt6
+	pxor	%xmm10,%xmm2
+	movaps	%xmm15,%xmm10
+	pxor	%xmm11,%xmm3
+	movdqu	%xmm2,(%rsi)
+	pxor	%xmm12,%xmm4
+	movdqu	%xmm3,16(%rsi)
+	pxor	%xmm3,%xmm3
+	pxor	%xmm13,%xmm5
+	movdqu	%xmm4,32(%rsi)
+	pxor	%xmm4,%xmm4
+	pxor	%xmm14,%xmm6
+	movdqu	%xmm5,48(%rsi)
+	pxor	%xmm5,%xmm5
+	leaq	64(%rsi),%rsi
+	movdqa	%xmm6,%xmm2
+	pxor	%xmm6,%xmm6
+	pxor	%xmm7,%xmm7
+	subq	$16,%rdx
+	jmp	.Lcbc_dec_tail_collected
+
+.align	16
+.Lcbc_dec_one:
+	movaps	%xmm2,%xmm11
+	movups	(%rcx),%xmm0
+	movups	16(%rcx),%xmm1
+	leaq	32(%rcx),%rcx
+	xorps	%xmm0,%xmm2
+.Loop_dec1_17:
+.byte	102,15,56,222,209
+	decl	%eax
+	movups	(%rcx),%xmm1
+	leaq	16(%rcx),%rcx
+	jnz	.Loop_dec1_17
+.byte	102,15,56,223,209
+	xorps	%xmm10,%xmm2
+	movaps	%xmm11,%xmm10
+	jmp	.Lcbc_dec_tail_collected
+.align	16
+.Lcbc_dec_two:
+	movaps	%xmm3,%xmm12
+	call	_aesni_decrypt2
+	pxor	%xmm10,%xmm2
+	movaps	%xmm12,%xmm10
+	pxor	%xmm11,%xmm3
+	movdqu	%xmm2,(%rsi)
+	movdqa	%xmm3,%xmm2
+	pxor	%xmm3,%xmm3
+	leaq	16(%rsi),%rsi
+	jmp	.Lcbc_dec_tail_collected
+.align	16
+.Lcbc_dec_three:
+	movaps	%xmm4,%xmm13
+	call	_aesni_decrypt3
+	pxor	%xmm10,%xmm2
+	movaps	%xmm13,%xmm10
+	pxor	%xmm11,%xmm3
+	movdqu	%xmm2,(%rsi)
+	pxor	%xmm12,%xmm4
+	movdqu	%xmm3,16(%rsi)
+	pxor	%xmm3,%xmm3
+	movdqa	%xmm4,%xmm2
+	pxor	%xmm4,%xmm4
+	leaq	32(%rsi),%rsi
+	jmp	.Lcbc_dec_tail_collected
+.align	16
+.Lcbc_dec_four:
+	movaps	%xmm5,%xmm14
+	call	_aesni_decrypt4
+	pxor	%xmm10,%xmm2
+	movaps	%xmm14,%xmm10
+	pxor	%xmm11,%xmm3
+	movdqu	%xmm2,(%rsi)
+	pxor	%xmm12,%xmm4
+	movdqu	%xmm3,16(%rsi)
+	pxor	%xmm3,%xmm3
+	pxor	%xmm13,%xmm5
+	movdqu	%xmm4,32(%rsi)
+	pxor	%xmm4,%xmm4
+	movdqa	%xmm5,%xmm2
+	pxor	%xmm5,%xmm5
+	leaq	48(%rsi),%rsi
+	jmp	.Lcbc_dec_tail_collected
+
+.align	16
+.Lcbc_dec_clear_tail_collected:
+	pxor	%xmm3,%xmm3
+	pxor	%xmm4,%xmm4
+	pxor	%xmm5,%xmm5
+	pxor	%xmm6,%xmm6
+	pxor	%xmm7,%xmm7
+	pxor	%xmm8,%xmm8
+	pxor	%xmm9,%xmm9
+.Lcbc_dec_tail_collected:
+	movups	%xmm10,(%r8)
+	andq	$15,%rdx
+	jnz	.Lcbc_dec_tail_partial
+	movups	%xmm2,(%rsi)
+	pxor	%xmm2,%xmm2
+	jmp	.Lcbc_dec_ret
+.align	16
+.Lcbc_dec_tail_partial:
+	movaps	%xmm2,(%rsp)
+	pxor	%xmm2,%xmm2
+	movq	$16,%rcx
+	movq	%rsi,%rdi
+	subq	%rdx,%rcx
+	leaq	(%rsp),%rsi
+.long	0x9066A4F3
+	movdqa	%xmm2,(%rsp)
+
+.Lcbc_dec_ret:
+	xorps	%xmm0,%xmm0
+	pxor	%xmm1,%xmm1
+	leaq	(%rbp),%rsp
+	popq	%rbp
+.Lcbc_ret:
+	.byte	0xf3,0xc3
+.size	aesni_cbc_encrypt,.-aesni_cbc_encrypt
+.globl	aesni_set_decrypt_key
+.hidden aesni_set_decrypt_key
+.type	aesni_set_decrypt_key,@function
+.align	16
+aesni_set_decrypt_key:
+.byte	0x48,0x83,0xEC,0x08
+	call	__aesni_set_encrypt_key
+	shll	$4,%esi
+	testl	%eax,%eax
+	jnz	.Ldec_key_ret
+	leaq	16(%rdx,%rsi,1),%rdi
+
+	movups	(%rdx),%xmm0
+	movups	(%rdi),%xmm1
+	movups	%xmm0,(%rdi)
+	movups	%xmm1,(%rdx)
+	leaq	16(%rdx),%rdx
+	leaq	-16(%rdi),%rdi
+
+.Ldec_key_inverse:
+	movups	(%rdx),%xmm0
+	movups	(%rdi),%xmm1
+.byte	102,15,56,219,192
+.byte	102,15,56,219,201
+	leaq	16(%rdx),%rdx
+	leaq	-16(%rdi),%rdi
+	movups	%xmm0,16(%rdi)
+	movups	%xmm1,-16(%rdx)
+	cmpq	%rdx,%rdi
+	ja	.Ldec_key_inverse
+
+	movups	(%rdx),%xmm0
+.byte	102,15,56,219,192
+	pxor	%xmm1,%xmm1
+	movups	%xmm0,(%rdi)
+	pxor	%xmm0,%xmm0
+.Ldec_key_ret:
+	addq	$8,%rsp
+	.byte	0xf3,0xc3
+.LSEH_end_set_decrypt_key:
+.size	aesni_set_decrypt_key,.-aesni_set_decrypt_key
+.globl	aesni_set_encrypt_key
+.hidden aesni_set_encrypt_key
+.type	aesni_set_encrypt_key,@function
+.align	16
+aesni_set_encrypt_key:
+__aesni_set_encrypt_key:
+.byte	0x48,0x83,0xEC,0x08
+	movq	$-1,%rax
+	testq	%rdi,%rdi
+	jz	.Lenc_key_ret
+	testq	%rdx,%rdx
+	jz	.Lenc_key_ret
+
+	movl	$268437504,%r10d
+	movups	(%rdi),%xmm0
+	xorps	%xmm4,%xmm4
+	andl	OPENSSL_ia32cap_P+4(%rip),%r10d
+	leaq	16(%rdx),%rax
+	cmpl	$256,%esi
+	je	.L14rounds
+	cmpl	$192,%esi
+	je	.L12rounds
+	cmpl	$128,%esi
+	jne	.Lbad_keybits
+
+.L10rounds:
+	movl	$9,%esi
+	cmpl	$268435456,%r10d
+	je	.L10rounds_alt
+
+	movups	%xmm0,(%rdx)
+.byte	102,15,58,223,200,1
+	call	.Lkey_expansion_128_cold
+.byte	102,15,58,223,200,2
+	call	.Lkey_expansion_128
+.byte	102,15,58,223,200,4
+	call	.Lkey_expansion_128
+.byte	102,15,58,223,200,8
+	call	.Lkey_expansion_128
+.byte	102,15,58,223,200,16
+	call	.Lkey_expansion_128
+.byte	102,15,58,223,200,32
+	call	.Lkey_expansion_128
+.byte	102,15,58,223,200,64
+	call	.Lkey_expansion_128
+.byte	102,15,58,223,200,128
+	call	.Lkey_expansion_128
+.byte	102,15,58,223,200,27
+	call	.Lkey_expansion_128
+.byte	102,15,58,223,200,54
+	call	.Lkey_expansion_128
+	movups	%xmm0,(%rax)
+	movl	%esi,80(%rax)
+	xorl	%eax,%eax
+	jmp	.Lenc_key_ret
+
+.align	16
+.L10rounds_alt:
+	movdqa	.Lkey_rotate(%rip),%xmm5
+	movl	$8,%r10d
+	movdqa	.Lkey_rcon1(%rip),%xmm4
+	movdqa	%xmm0,%xmm2
+	movdqu	%xmm0,(%rdx)
+	jmp	.Loop_key128
+
+.align	16
+.Loop_key128:
+.byte	102,15,56,0,197
+.byte	102,15,56,221,196
+	pslld	$1,%xmm4
+	leaq	16(%rax),%rax
+
+	movdqa	%xmm2,%xmm3
+	pslldq	$4,%xmm2
+	pxor	%xmm2,%xmm3
+	pslldq	$4,%xmm2
+	pxor	%xmm2,%xmm3
+	pslldq	$4,%xmm2
+	pxor	%xmm3,%xmm2
+
+	pxor	%xmm2,%xmm0
+	movdqu	%xmm0,-16(%rax)
+	movdqa	%xmm0,%xmm2
+
+	decl	%r10d
+	jnz	.Loop_key128
+
+	movdqa	.Lkey_rcon1b(%rip),%xmm4
+
+.byte	102,15,56,0,197
+.byte	102,15,56,221,196
+	pslld	$1,%xmm4
+
+	movdqa	%xmm2,%xmm3
+	pslldq	$4,%xmm2
+	pxor	%xmm2,%xmm3
+	pslldq	$4,%xmm2
+	pxor	%xmm2,%xmm3
+	pslldq	$4,%xmm2
+	pxor	%xmm3,%xmm2
+
+	pxor	%xmm2,%xmm0
+	movdqu	%xmm0,(%rax)
+
+	movdqa	%xmm0,%xmm2
+.byte	102,15,56,0,197
+.byte	102,15,56,221,196
+
+	movdqa	%xmm2,%xmm3
+	pslldq	$4,%xmm2
+	pxor	%xmm2,%xmm3
+	pslldq	$4,%xmm2
+	pxor	%xmm2,%xmm3
+	pslldq	$4,%xmm2
+	pxor	%xmm3,%xmm2
+
+	pxor	%xmm2,%xmm0
+	movdqu	%xmm0,16(%rax)
+
+	movl	%esi,96(%rax)
+	xorl	%eax,%eax
+	jmp	.Lenc_key_ret
+
+.align	16
+.L12rounds:
+	movq	16(%rdi),%xmm2
+	movl	$11,%esi
+	cmpl	$268435456,%r10d
+	je	.L12rounds_alt
+
+	movups	%xmm0,(%rdx)
+.byte	102,15,58,223,202,1
+	call	.Lkey_expansion_192a_cold
+.byte	102,15,58,223,202,2
+	call	.Lkey_expansion_192b
+.byte	102,15,58,223,202,4
+	call	.Lkey_expansion_192a
+.byte	102,15,58,223,202,8
+	call	.Lkey_expansion_192b
+.byte	102,15,58,223,202,16
+	call	.Lkey_expansion_192a
+.byte	102,15,58,223,202,32
+	call	.Lkey_expansion_192b
+.byte	102,15,58,223,202,64
+	call	.Lkey_expansion_192a
+.byte	102,15,58,223,202,128
+	call	.Lkey_expansion_192b
+	movups	%xmm0,(%rax)
+	movl	%esi,48(%rax)
+	xorq	%rax,%rax
+	jmp	.Lenc_key_ret
+
+.align	16
+.L12rounds_alt:
+	movdqa	.Lkey_rotate192(%rip),%xmm5
+	movdqa	.Lkey_rcon1(%rip),%xmm4
+	movl	$8,%r10d
+	movdqu	%xmm0,(%rdx)
+	jmp	.Loop_key192
+
+.align	16
+.Loop_key192:
+	movq	%xmm2,0(%rax)
+	movdqa	%xmm2,%xmm1
+.byte	102,15,56,0,213
+.byte	102,15,56,221,212
+	pslld	$1,%xmm4
+	leaq	24(%rax),%rax
+
+	movdqa	%xmm0,%xmm3
+	pslldq	$4,%xmm0
+	pxor	%xmm0,%xmm3
+	pslldq	$4,%xmm0
+	pxor	%xmm0,%xmm3
+	pslldq	$4,%xmm0
+	pxor	%xmm3,%xmm0
+
+	pshufd	$255,%xmm0,%xmm3
+	pxor	%xmm1,%xmm3
+	pslldq	$4,%xmm1
+	pxor	%xmm1,%xmm3
+
+	pxor	%xmm2,%xmm0
+	pxor	%xmm3,%xmm2
+	movdqu	%xmm0,-16(%rax)
+
+	decl	%r10d
+	jnz	.Loop_key192
+
+	movl	%esi,32(%rax)
+	xorl	%eax,%eax
+	jmp	.Lenc_key_ret
+
+.align	16
+.L14rounds:
+	movups	16(%rdi),%xmm2
+	movl	$13,%esi
+	leaq	16(%rax),%rax
+	cmpl	$268435456,%r10d
+	je	.L14rounds_alt
+
+	movups	%xmm0,(%rdx)
+	movups	%xmm2,16(%rdx)
+.byte	102,15,58,223,202,1
+	call	.Lkey_expansion_256a_cold
+.byte	102,15,58,223,200,1
+	call	.Lkey_expansion_256b
+.byte	102,15,58,223,202,2
+	call	.Lkey_expansion_256a
+.byte	102,15,58,223,200,2
+	call	.Lkey_expansion_256b
+.byte	102,15,58,223,202,4
+	call	.Lkey_expansion_256a
+.byte	102,15,58,223,200,4
+	call	.Lkey_expansion_256b
+.byte	102,15,58,223,202,8
+	call	.Lkey_expansion_256a
+.byte	102,15,58,223,200,8
+	call	.Lkey_expansion_256b
+.byte	102,15,58,223,202,16
+	call	.Lkey_expansion_256a
+.byte	102,15,58,223,200,16
+	call	.Lkey_expansion_256b
+.byte	102,15,58,223,202,32
+	call	.Lkey_expansion_256a
+.byte	102,15,58,223,200,32
+	call	.Lkey_expansion_256b
+.byte	102,15,58,223,202,64
+	call	.Lkey_expansion_256a
+	movups	%xmm0,(%rax)
+	movl	%esi,16(%rax)
+	xorq	%rax,%rax
+	jmp	.Lenc_key_ret
+
+.align	16
+.L14rounds_alt:
+	movdqa	.Lkey_rotate(%rip),%xmm5
+	movdqa	.Lkey_rcon1(%rip),%xmm4
+	movl	$7,%r10d
+	movdqu	%xmm0,0(%rdx)
+	movdqa	%xmm2,%xmm1
+	movdqu	%xmm2,16(%rdx)
+	jmp	.Loop_key256
+
+.align	16
+.Loop_key256:
+.byte	102,15,56,0,213
+.byte	102,15,56,221,212
+
+	movdqa	%xmm0,%xmm3
+	pslldq	$4,%xmm0
+	pxor	%xmm0,%xmm3
+	pslldq	$4,%xmm0
+	pxor	%xmm0,%xmm3
+	pslldq	$4,%xmm0
+	pxor	%xmm3,%xmm0
+	pslld	$1,%xmm4
+
+	pxor	%xmm2,%xmm0
+	movdqu	%xmm0,(%rax)
+
+	decl	%r10d
+	jz	.Ldone_key256
+
+	pshufd	$255,%xmm0,%xmm2
+	pxor	%xmm3,%xmm3
+.byte	102,15,56,221,211
+
+	movdqa	%xmm1,%xmm3
+	pslldq	$4,%xmm1
+	pxor	%xmm1,%xmm3
+	pslldq	$4,%xmm1
+	pxor	%xmm1,%xmm3
+	pslldq	$4,%xmm1
+	pxor	%xmm3,%xmm1
+
+	pxor	%xmm1,%xmm2
+	movdqu	%xmm2,16(%rax)
+	leaq	32(%rax),%rax
+	movdqa	%xmm2,%xmm1
+
+	jmp	.Loop_key256
+
+.Ldone_key256:
+	movl	%esi,16(%rax)
+	xorl	%eax,%eax
+	jmp	.Lenc_key_ret
+
+.align	16
+.Lbad_keybits:
+	movq	$-2,%rax
+.Lenc_key_ret:
+	pxor	%xmm0,%xmm0
+	pxor	%xmm1,%xmm1
+	pxor	%xmm2,%xmm2
+	pxor	%xmm3,%xmm3
+	pxor	%xmm4,%xmm4
+	pxor	%xmm5,%xmm5
+	addq	$8,%rsp
+	.byte	0xf3,0xc3
+.LSEH_end_set_encrypt_key:
+
+.align	16
+.Lkey_expansion_128:
+	movups	%xmm0,(%rax)
+	leaq	16(%rax),%rax
+.Lkey_expansion_128_cold:
+	shufps	$16,%xmm0,%xmm4
+	xorps	%xmm4,%xmm0
+	shufps	$140,%xmm0,%xmm4
+	xorps	%xmm4,%xmm0
+	shufps	$255,%xmm1,%xmm1
+	xorps	%xmm1,%xmm0
+	.byte	0xf3,0xc3
+
+.align	16
+.Lkey_expansion_192a:
+	movups	%xmm0,(%rax)
+	leaq	16(%rax),%rax
+.Lkey_expansion_192a_cold:
+	movaps	%xmm2,%xmm5
+.Lkey_expansion_192b_warm:
+	shufps	$16,%xmm0,%xmm4
+	movdqa	%xmm2,%xmm3
+	xorps	%xmm4,%xmm0
+	shufps	$140,%xmm0,%xmm4
+	pslldq	$4,%xmm3
+	xorps	%xmm4,%xmm0
+	pshufd	$85,%xmm1,%xmm1
+	pxor	%xmm3,%xmm2
+	pxor	%xmm1,%xmm0
+	pshufd	$255,%xmm0,%xmm3
+	pxor	%xmm3,%xmm2
+	.byte	0xf3,0xc3
+
+.align	16
+.Lkey_expansion_192b:
+	movaps	%xmm0,%xmm3
+	shufps	$68,%xmm0,%xmm5
+	movups	%xmm5,(%rax)
+	shufps	$78,%xmm2,%xmm3
+	movups	%xmm3,16(%rax)
+	leaq	32(%rax),%rax
+	jmp	.Lkey_expansion_192b_warm
+
+.align	16
+.Lkey_expansion_256a:
+	movups	%xmm2,(%rax)
+	leaq	16(%rax),%rax
+.Lkey_expansion_256a_cold:
+	shufps	$16,%xmm0,%xmm4
+	xorps	%xmm4,%xmm0
+	shufps	$140,%xmm0,%xmm4
+	xorps	%xmm4,%xmm0
+	shufps	$255,%xmm1,%xmm1
+	xorps	%xmm1,%xmm0
+	.byte	0xf3,0xc3
+
+.align	16
+.Lkey_expansion_256b:
+	movups	%xmm0,(%rax)
+	leaq	16(%rax),%rax
+
+	shufps	$16,%xmm2,%xmm4
+	xorps	%xmm4,%xmm2
+	shufps	$140,%xmm2,%xmm4
+	xorps	%xmm4,%xmm2
+	shufps	$170,%xmm1,%xmm1
+	xorps	%xmm1,%xmm2
+	.byte	0xf3,0xc3
+.size	aesni_set_encrypt_key,.-aesni_set_encrypt_key
+.size	__aesni_set_encrypt_key,.-__aesni_set_encrypt_key
+.align	64
+.Lbswap_mask:
+.byte	15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0
+.Lincrement32:
+.long	6,6,6,0
+.Lincrement64:
+.long	1,0,0,0
+.Lxts_magic:
+.long	0x87,0,1,0
+.Lincrement1:
+.byte	0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
+.Lkey_rotate:
+.long	0x0c0f0e0d,0x0c0f0e0d,0x0c0f0e0d,0x0c0f0e0d
+.Lkey_rotate192:
+.long	0x04070605,0x04070605,0x04070605,0x04070605
+.Lkey_rcon1:
+.long	1,1,1,1
+.Lkey_rcon1b:
+.long	0x1b,0x1b,0x1b,0x1b
+
+.byte	65,69,83,32,102,111,114,32,73,110,116,101,108,32,65,69,83,45,78,73,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0
+.align	64
+#endif
diff --git a/third_party/boringssl/linux-x86_64/crypto/aes/bsaes-x86_64.S b/third_party/boringssl/linux-x86_64/crypto/aes/bsaes-x86_64.S
new file mode 100644
index 0000000..8cfa4df
--- /dev/null
+++ b/third_party/boringssl/linux-x86_64/crypto/aes/bsaes-x86_64.S
@@ -0,0 +1,2507 @@
+#if defined(__x86_64__)
+.text	
+
+.extern	asm_AES_encrypt
+.hidden asm_AES_encrypt
+.extern	asm_AES_decrypt
+.hidden asm_AES_decrypt
+
+.type	_bsaes_encrypt8,@function
+.align	64
+_bsaes_encrypt8:
+	leaq	.LBS0(%rip),%r11
+
+	movdqa	(%rax),%xmm8
+	leaq	16(%rax),%rax
+	movdqa	80(%r11),%xmm7
+	pxor	%xmm8,%xmm15
+	pxor	%xmm8,%xmm0
+	pxor	%xmm8,%xmm1
+	pxor	%xmm8,%xmm2
+.byte	102,68,15,56,0,255
+.byte	102,15,56,0,199
+	pxor	%xmm8,%xmm3
+	pxor	%xmm8,%xmm4
+.byte	102,15,56,0,207
+.byte	102,15,56,0,215
+	pxor	%xmm8,%xmm5
+	pxor	%xmm8,%xmm6
+.byte	102,15,56,0,223
+.byte	102,15,56,0,231
+.byte	102,15,56,0,239
+.byte	102,15,56,0,247
+_bsaes_encrypt8_bitslice:
+	movdqa	0(%r11),%xmm7
+	movdqa	16(%r11),%xmm8
+	movdqa	%xmm5,%xmm9
+	psrlq	$1,%xmm5
+	movdqa	%xmm3,%xmm10
+	psrlq	$1,%xmm3
+	pxor	%xmm6,%xmm5
+	pxor	%xmm4,%xmm3
+	pand	%xmm7,%xmm5
+	pand	%xmm7,%xmm3
+	pxor	%xmm5,%xmm6
+	psllq	$1,%xmm5
+	pxor	%xmm3,%xmm4
+	psllq	$1,%xmm3
+	pxor	%xmm9,%xmm5
+	pxor	%xmm10,%xmm3
+	movdqa	%xmm1,%xmm9
+	psrlq	$1,%xmm1
+	movdqa	%xmm15,%xmm10
+	psrlq	$1,%xmm15
+	pxor	%xmm2,%xmm1
+	pxor	%xmm0,%xmm15
+	pand	%xmm7,%xmm1
+	pand	%xmm7,%xmm15
+	pxor	%xmm1,%xmm2
+	psllq	$1,%xmm1
+	pxor	%xmm15,%xmm0
+	psllq	$1,%xmm15
+	pxor	%xmm9,%xmm1
+	pxor	%xmm10,%xmm15
+	movdqa	32(%r11),%xmm7
+	movdqa	%xmm4,%xmm9
+	psrlq	$2,%xmm4
+	movdqa	%xmm3,%xmm10
+	psrlq	$2,%xmm3
+	pxor	%xmm6,%xmm4
+	pxor	%xmm5,%xmm3
+	pand	%xmm8,%xmm4
+	pand	%xmm8,%xmm3
+	pxor	%xmm4,%xmm6
+	psllq	$2,%xmm4
+	pxor	%xmm3,%xmm5
+	psllq	$2,%xmm3
+	pxor	%xmm9,%xmm4
+	pxor	%xmm10,%xmm3
+	movdqa	%xmm0,%xmm9
+	psrlq	$2,%xmm0
+	movdqa	%xmm15,%xmm10
+	psrlq	$2,%xmm15
+	pxor	%xmm2,%xmm0
+	pxor	%xmm1,%xmm15
+	pand	%xmm8,%xmm0
+	pand	%xmm8,%xmm15
+	pxor	%xmm0,%xmm2
+	psllq	$2,%xmm0
+	pxor	%xmm15,%xmm1
+	psllq	$2,%xmm15
+	pxor	%xmm9,%xmm0
+	pxor	%xmm10,%xmm15
+	movdqa	%xmm2,%xmm9
+	psrlq	$4,%xmm2
+	movdqa	%xmm1,%xmm10
+	psrlq	$4,%xmm1
+	pxor	%xmm6,%xmm2
+	pxor	%xmm5,%xmm1
+	pand	%xmm7,%xmm2
+	pand	%xmm7,%xmm1
+	pxor	%xmm2,%xmm6
+	psllq	$4,%xmm2
+	pxor	%xmm1,%xmm5
+	psllq	$4,%xmm1
+	pxor	%xmm9,%xmm2
+	pxor	%xmm10,%xmm1
+	movdqa	%xmm0,%xmm9
+	psrlq	$4,%xmm0
+	movdqa	%xmm15,%xmm10
+	psrlq	$4,%xmm15
+	pxor	%xmm4,%xmm0
+	pxor	%xmm3,%xmm15
+	pand	%xmm7,%xmm0
+	pand	%xmm7,%xmm15
+	pxor	%xmm0,%xmm4
+	psllq	$4,%xmm0
+	pxor	%xmm15,%xmm3
+	psllq	$4,%xmm15
+	pxor	%xmm9,%xmm0
+	pxor	%xmm10,%xmm15
+	decl	%r10d
+	jmp	.Lenc_sbox
+.align	16
+.Lenc_loop:
+	pxor	0(%rax),%xmm15
+	pxor	16(%rax),%xmm0
+	pxor	32(%rax),%xmm1
+	pxor	48(%rax),%xmm2
+.byte	102,68,15,56,0,255
+.byte	102,15,56,0,199
+	pxor	64(%rax),%xmm3
+	pxor	80(%rax),%xmm4
+.byte	102,15,56,0,207
+.byte	102,15,56,0,215
+	pxor	96(%rax),%xmm5
+	pxor	112(%rax),%xmm6
+.byte	102,15,56,0,223
+.byte	102,15,56,0,231
+.byte	102,15,56,0,239
+.byte	102,15,56,0,247
+	leaq	128(%rax),%rax
+.Lenc_sbox:
+	pxor	%xmm5,%xmm4
+	pxor	%xmm0,%xmm1
+	pxor	%xmm15,%xmm2
+	pxor	%xmm1,%xmm5
+	pxor	%xmm15,%xmm4
+
+	pxor	%xmm2,%xmm5
+	pxor	%xmm6,%xmm2
+	pxor	%xmm4,%xmm6
+	pxor	%xmm3,%xmm2
+	pxor	%xmm4,%xmm3
+	pxor	%xmm0,%xmm2
+
+	pxor	%xmm6,%xmm1
+	pxor	%xmm4,%xmm0
+	movdqa	%xmm6,%xmm10
+	movdqa	%xmm0,%xmm9
+	movdqa	%xmm4,%xmm8
+	movdqa	%xmm1,%xmm12
+	movdqa	%xmm5,%xmm11
+
+	pxor	%xmm3,%xmm10
+	pxor	%xmm1,%xmm9
+	pxor	%xmm2,%xmm8
+	movdqa	%xmm10,%xmm13
+	pxor	%xmm3,%xmm12
+	movdqa	%xmm9,%xmm7
+	pxor	%xmm15,%xmm11
+	movdqa	%xmm10,%xmm14
+
+	por	%xmm8,%xmm9
+	por	%xmm11,%xmm10
+	pxor	%xmm7,%xmm14
+	pand	%xmm11,%xmm13
+	pxor	%xmm8,%xmm11
+	pand	%xmm8,%xmm7
+	pand	%xmm11,%xmm14
+	movdqa	%xmm2,%xmm11
+	pxor	%xmm15,%xmm11
+	pand	%xmm11,%xmm12
+	pxor	%xmm12,%xmm10
+	pxor	%xmm12,%xmm9
+	movdqa	%xmm6,%xmm12
+	movdqa	%xmm4,%xmm11
+	pxor	%xmm0,%xmm12
+	pxor	%xmm5,%xmm11
+	movdqa	%xmm12,%xmm8
+	pand	%xmm11,%xmm12
+	por	%xmm11,%xmm8
+	pxor	%xmm12,%xmm7
+	pxor	%xmm14,%xmm10
+	pxor	%xmm13,%xmm9
+	pxor	%xmm14,%xmm8
+	movdqa	%xmm1,%xmm11
+	pxor	%xmm13,%xmm7
+	movdqa	%xmm3,%xmm12
+	pxor	%xmm13,%xmm8
+	movdqa	%xmm0,%xmm13
+	pand	%xmm2,%xmm11
+	movdqa	%xmm6,%xmm14
+	pand	%xmm15,%xmm12
+	pand	%xmm4,%xmm13
+	por	%xmm5,%xmm14
+	pxor	%xmm11,%xmm10
+	pxor	%xmm12,%xmm9
+	pxor	%xmm13,%xmm8
+	pxor	%xmm14,%xmm7
+
+
+
+
+
+	movdqa	%xmm10,%xmm11
+	pand	%xmm8,%xmm10
+	pxor	%xmm9,%xmm11
+
+	movdqa	%xmm7,%xmm13
+	movdqa	%xmm11,%xmm14
+	pxor	%xmm10,%xmm13
+	pand	%xmm13,%xmm14
+
+	movdqa	%xmm8,%xmm12
+	pxor	%xmm9,%xmm14
+	pxor	%xmm7,%xmm12
+
+	pxor	%xmm9,%xmm10
+
+	pand	%xmm10,%xmm12
+
+	movdqa	%xmm13,%xmm9
+	pxor	%xmm7,%xmm12
+
+	pxor	%xmm12,%xmm9
+	pxor	%xmm12,%xmm8
+
+	pand	%xmm7,%xmm9
+
+	pxor	%xmm9,%xmm13
+	pxor	%xmm9,%xmm8
+
+	pand	%xmm14,%xmm13
+
+	pxor	%xmm11,%xmm13
+	movdqa	%xmm5,%xmm11
+	movdqa	%xmm4,%xmm7
+	movdqa	%xmm14,%xmm9
+	pxor	%xmm13,%xmm9
+	pand	%xmm5,%xmm9
+	pxor	%xmm4,%xmm5
+	pand	%xmm14,%xmm4
+	pand	%xmm13,%xmm5
+	pxor	%xmm4,%xmm5
+	pxor	%xmm9,%xmm4
+	pxor	%xmm15,%xmm11
+	pxor	%xmm2,%xmm7
+	pxor	%xmm12,%xmm14
+	pxor	%xmm8,%xmm13
+	movdqa	%xmm14,%xmm10
+	movdqa	%xmm12,%xmm9
+	pxor	%xmm13,%xmm10
+	pxor	%xmm8,%xmm9
+	pand	%xmm11,%xmm10
+	pand	%xmm15,%xmm9
+	pxor	%xmm7,%xmm11
+	pxor	%xmm2,%xmm15
+	pand	%xmm14,%xmm7
+	pand	%xmm12,%xmm2
+	pand	%xmm13,%xmm11
+	pand	%xmm8,%xmm15
+	pxor	%xmm11,%xmm7
+	pxor	%xmm2,%xmm15
+	pxor	%xmm10,%xmm11
+	pxor	%xmm9,%xmm2
+	pxor	%xmm11,%xmm5
+	pxor	%xmm11,%xmm15
+	pxor	%xmm7,%xmm4
+	pxor	%xmm7,%xmm2
+
+	movdqa	%xmm6,%xmm11
+	movdqa	%xmm0,%xmm7
+	pxor	%xmm3,%xmm11
+	pxor	%xmm1,%xmm7
+	movdqa	%xmm14,%xmm10
+	movdqa	%xmm12,%xmm9
+	pxor	%xmm13,%xmm10
+	pxor	%xmm8,%xmm9
+	pand	%xmm11,%xmm10
+	pand	%xmm3,%xmm9
+	pxor	%xmm7,%xmm11
+	pxor	%xmm1,%xmm3
+	pand	%xmm14,%xmm7
+	pand	%xmm12,%xmm1
+	pand	%xmm13,%xmm11
+	pand	%xmm8,%xmm3
+	pxor	%xmm11,%xmm7
+	pxor	%xmm1,%xmm3
+	pxor	%xmm10,%xmm11
+	pxor	%xmm9,%xmm1
+	pxor	%xmm12,%xmm14
+	pxor	%xmm8,%xmm13
+	movdqa	%xmm14,%xmm10
+	pxor	%xmm13,%xmm10
+	pand	%xmm6,%xmm10
+	pxor	%xmm0,%xmm6
+	pand	%xmm14,%xmm0
+	pand	%xmm13,%xmm6
+	pxor	%xmm0,%xmm6
+	pxor	%xmm10,%xmm0
+	pxor	%xmm11,%xmm6
+	pxor	%xmm11,%xmm3
+	pxor	%xmm7,%xmm0
+	pxor	%xmm7,%xmm1
+	pxor	%xmm15,%xmm6
+	pxor	%xmm5,%xmm0
+	pxor	%xmm6,%xmm3
+	pxor	%xmm15,%xmm5
+	pxor	%xmm0,%xmm15
+
+	pxor	%xmm4,%xmm0
+	pxor	%xmm1,%xmm4
+	pxor	%xmm2,%xmm1
+	pxor	%xmm4,%xmm2
+	pxor	%xmm4,%xmm3
+
+	pxor	%xmm2,%xmm5
+	decl	%r10d
+	jl	.Lenc_done
+	pshufd	$147,%xmm15,%xmm7
+	pshufd	$147,%xmm0,%xmm8
+	pxor	%xmm7,%xmm15
+	pshufd	$147,%xmm3,%xmm9
+	pxor	%xmm8,%xmm0
+	pshufd	$147,%xmm5,%xmm10
+	pxor	%xmm9,%xmm3
+	pshufd	$147,%xmm2,%xmm11
+	pxor	%xmm10,%xmm5
+	pshufd	$147,%xmm6,%xmm12
+	pxor	%xmm11,%xmm2
+	pshufd	$147,%xmm1,%xmm13
+	pxor	%xmm12,%xmm6
+	pshufd	$147,%xmm4,%xmm14
+	pxor	%xmm13,%xmm1
+	pxor	%xmm14,%xmm4
+
+	pxor	%xmm15,%xmm8
+	pxor	%xmm4,%xmm7
+	pxor	%xmm4,%xmm8
+	pshufd	$78,%xmm15,%xmm15
+	pxor	%xmm0,%xmm9
+	pshufd	$78,%xmm0,%xmm0
+	pxor	%xmm2,%xmm12
+	pxor	%xmm7,%xmm15
+	pxor	%xmm6,%xmm13
+	pxor	%xmm8,%xmm0
+	pxor	%xmm5,%xmm11
+	pshufd	$78,%xmm2,%xmm7
+	pxor	%xmm1,%xmm14
+	pshufd	$78,%xmm6,%xmm8
+	pxor	%xmm3,%xmm10
+	pshufd	$78,%xmm5,%xmm2
+	pxor	%xmm4,%xmm10
+	pshufd	$78,%xmm4,%xmm6
+	pxor	%xmm4,%xmm11
+	pshufd	$78,%xmm1,%xmm5
+	pxor	%xmm11,%xmm7
+	pshufd	$78,%xmm3,%xmm1
+	pxor	%xmm12,%xmm8
+	pxor	%xmm10,%xmm2
+	pxor	%xmm14,%xmm6
+	pxor	%xmm13,%xmm5
+	movdqa	%xmm7,%xmm3
+	pxor	%xmm9,%xmm1
+	movdqa	%xmm8,%xmm4
+	movdqa	48(%r11),%xmm7
+	jnz	.Lenc_loop
+	movdqa	64(%r11),%xmm7
+	jmp	.Lenc_loop
+.align	16
+.Lenc_done:
+	movdqa	0(%r11),%xmm7
+	movdqa	16(%r11),%xmm8
+	movdqa	%xmm1,%xmm9
+	psrlq	$1,%xmm1
+	movdqa	%xmm2,%xmm10
+	psrlq	$1,%xmm2
+	pxor	%xmm4,%xmm1
+	pxor	%xmm6,%xmm2
+	pand	%xmm7,%xmm1
+	pand	%xmm7,%xmm2
+	pxor	%xmm1,%xmm4
+	psllq	$1,%xmm1
+	pxor	%xmm2,%xmm6
+	psllq	$1,%xmm2
+	pxor	%xmm9,%xmm1
+	pxor	%xmm10,%xmm2
+	movdqa	%xmm3,%xmm9
+	psrlq	$1,%xmm3
+	movdqa	%xmm15,%xmm10
+	psrlq	$1,%xmm15
+	pxor	%xmm5,%xmm3
+	pxor	%xmm0,%xmm15
+	pand	%xmm7,%xmm3
+	pand	%xmm7,%xmm15
+	pxor	%xmm3,%xmm5
+	psllq	$1,%xmm3
+	pxor	%xmm15,%xmm0
+	psllq	$1,%xmm15
+	pxor	%xmm9,%xmm3
+	pxor	%xmm10,%xmm15
+	movdqa	32(%r11),%xmm7
+	movdqa	%xmm6,%xmm9
+	psrlq	$2,%xmm6
+	movdqa	%xmm2,%xmm10
+	psrlq	$2,%xmm2
+	pxor	%xmm4,%xmm6
+	pxor	%xmm1,%xmm2
+	pand	%xmm8,%xmm6
+	pand	%xmm8,%xmm2
+	pxor	%xmm6,%xmm4
+	psllq	$2,%xmm6
+	pxor	%xmm2,%xmm1
+	psllq	$2,%xmm2
+	pxor	%xmm9,%xmm6
+	pxor	%xmm10,%xmm2
+	movdqa	%xmm0,%xmm9
+	psrlq	$2,%xmm0
+	movdqa	%xmm15,%xmm10
+	psrlq	$2,%xmm15
+	pxor	%xmm5,%xmm0
+	pxor	%xmm3,%xmm15
+	pand	%xmm8,%xmm0
+	pand	%xmm8,%xmm15
+	pxor	%xmm0,%xmm5
+	psllq	$2,%xmm0
+	pxor	%xmm15,%xmm3
+	psllq	$2,%xmm15
+	pxor	%xmm9,%xmm0
+	pxor	%xmm10,%xmm15
+	movdqa	%xmm5,%xmm9
+	psrlq	$4,%xmm5
+	movdqa	%xmm3,%xmm10
+	psrlq	$4,%xmm3
+	pxor	%xmm4,%xmm5
+	pxor	%xmm1,%xmm3
+	pand	%xmm7,%xmm5
+	pand	%xmm7,%xmm3
+	pxor	%xmm5,%xmm4
+	psllq	$4,%xmm5
+	pxor	%xmm3,%xmm1
+	psllq	$4,%xmm3
+	pxor	%xmm9,%xmm5
+	pxor	%xmm10,%xmm3
+	movdqa	%xmm0,%xmm9
+	psrlq	$4,%xmm0
+	movdqa	%xmm15,%xmm10
+	psrlq	$4,%xmm15
+	pxor	%xmm6,%xmm0
+	pxor	%xmm2,%xmm15
+	pand	%xmm7,%xmm0
+	pand	%xmm7,%xmm15
+	pxor	%xmm0,%xmm6
+	psllq	$4,%xmm0
+	pxor	%xmm15,%xmm2
+	psllq	$4,%xmm15
+	pxor	%xmm9,%xmm0
+	pxor	%xmm10,%xmm15
+	movdqa	(%rax),%xmm7
+	pxor	%xmm7,%xmm3
+	pxor	%xmm7,%xmm5
+	pxor	%xmm7,%xmm2
+	pxor	%xmm7,%xmm6
+	pxor	%xmm7,%xmm1
+	pxor	%xmm7,%xmm4
+	pxor	%xmm7,%xmm15
+	pxor	%xmm7,%xmm0
+	.byte	0xf3,0xc3
+.size	_bsaes_encrypt8,.-_bsaes_encrypt8
+
+.type	_bsaes_decrypt8,@function
+.align	64
+_bsaes_decrypt8:
+	leaq	.LBS0(%rip),%r11
+
+	movdqa	(%rax),%xmm8
+	leaq	16(%rax),%rax
+	movdqa	-48(%r11),%xmm7
+	pxor	%xmm8,%xmm15
+	pxor	%xmm8,%xmm0
+	pxor	%xmm8,%xmm1
+	pxor	%xmm8,%xmm2
+.byte	102,68,15,56,0,255
+.byte	102,15,56,0,199
+	pxor	%xmm8,%xmm3
+	pxor	%xmm8,%xmm4
+.byte	102,15,56,0,207
+.byte	102,15,56,0,215
+	pxor	%xmm8,%xmm5
+	pxor	%xmm8,%xmm6
+.byte	102,15,56,0,223
+.byte	102,15,56,0,231
+.byte	102,15,56,0,239
+.byte	102,15,56,0,247
+	movdqa	0(%r11),%xmm7
+	movdqa	16(%r11),%xmm8
+	movdqa	%xmm5,%xmm9
+	psrlq	$1,%xmm5
+	movdqa	%xmm3,%xmm10
+	psrlq	$1,%xmm3
+	pxor	%xmm6,%xmm5
+	pxor	%xmm4,%xmm3
+	pand	%xmm7,%xmm5
+	pand	%xmm7,%xmm3
+	pxor	%xmm5,%xmm6
+	psllq	$1,%xmm5
+	pxor	%xmm3,%xmm4
+	psllq	$1,%xmm3
+	pxor	%xmm9,%xmm5
+	pxor	%xmm10,%xmm3
+	movdqa	%xmm1,%xmm9
+	psrlq	$1,%xmm1
+	movdqa	%xmm15,%xmm10
+	psrlq	$1,%xmm15
+	pxor	%xmm2,%xmm1
+	pxor	%xmm0,%xmm15
+	pand	%xmm7,%xmm1
+	pand	%xmm7,%xmm15
+	pxor	%xmm1,%xmm2
+	psllq	$1,%xmm1
+	pxor	%xmm15,%xmm0
+	psllq	$1,%xmm15
+	pxor	%xmm9,%xmm1
+	pxor	%xmm10,%xmm15
+	movdqa	32(%r11),%xmm7
+	movdqa	%xmm4,%xmm9
+	psrlq	$2,%xmm4
+	movdqa	%xmm3,%xmm10
+	psrlq	$2,%xmm3
+	pxor	%xmm6,%xmm4
+	pxor	%xmm5,%xmm3
+	pand	%xmm8,%xmm4
+	pand	%xmm8,%xmm3
+	pxor	%xmm4,%xmm6
+	psllq	$2,%xmm4
+	pxor	%xmm3,%xmm5
+	psllq	$2,%xmm3
+	pxor	%xmm9,%xmm4
+	pxor	%xmm10,%xmm3
+	movdqa	%xmm0,%xmm9
+	psrlq	$2,%xmm0
+	movdqa	%xmm15,%xmm10
+	psrlq	$2,%xmm15
+	pxor	%xmm2,%xmm0
+	pxor	%xmm1,%xmm15
+	pand	%xmm8,%xmm0
+	pand	%xmm8,%xmm15
+	pxor	%xmm0,%xmm2
+	psllq	$2,%xmm0
+	pxor	%xmm15,%xmm1
+	psllq	$2,%xmm15
+	pxor	%xmm9,%xmm0
+	pxor	%xmm10,%xmm15
+	movdqa	%xmm2,%xmm9
+	psrlq	$4,%xmm2
+	movdqa	%xmm1,%xmm10
+	psrlq	$4,%xmm1
+	pxor	%xmm6,%xmm2
+	pxor	%xmm5,%xmm1
+	pand	%xmm7,%xmm2
+	pand	%xmm7,%xmm1
+	pxor	%xmm2,%xmm6
+	psllq	$4,%xmm2
+	pxor	%xmm1,%xmm5
+	psllq	$4,%xmm1
+	pxor	%xmm9,%xmm2
+	pxor	%xmm10,%xmm1
+	movdqa	%xmm0,%xmm9
+	psrlq	$4,%xmm0
+	movdqa	%xmm15,%xmm10
+	psrlq	$4,%xmm15
+	pxor	%xmm4,%xmm0
+	pxor	%xmm3,%xmm15
+	pand	%xmm7,%xmm0
+	pand	%xmm7,%xmm15
+	pxor	%xmm0,%xmm4
+	psllq	$4,%xmm0
+	pxor	%xmm15,%xmm3
+	psllq	$4,%xmm15
+	pxor	%xmm9,%xmm0
+	pxor	%xmm10,%xmm15
+	decl	%r10d
+	jmp	.Ldec_sbox
+.align	16
+.Ldec_loop:
+	pxor	0(%rax),%xmm15
+	pxor	16(%rax),%xmm0
+	pxor	32(%rax),%xmm1
+	pxor	48(%rax),%xmm2
+.byte	102,68,15,56,0,255
+.byte	102,15,56,0,199
+	pxor	64(%rax),%xmm3
+	pxor	80(%rax),%xmm4
+.byte	102,15,56,0,207
+.byte	102,15,56,0,215
+	pxor	96(%rax),%xmm5
+	pxor	112(%rax),%xmm6
+.byte	102,15,56,0,223
+.byte	102,15,56,0,231
+.byte	102,15,56,0,239
+.byte	102,15,56,0,247
+	leaq	128(%rax),%rax
+.Ldec_sbox:
+	pxor	%xmm3,%xmm2
+
+	pxor	%xmm6,%xmm3
+	pxor	%xmm6,%xmm1
+	pxor	%xmm3,%xmm5
+	pxor	%xmm5,%xmm6
+	pxor	%xmm6,%xmm0
+
+	pxor	%xmm0,%xmm15
+	pxor	%xmm4,%xmm1
+	pxor	%xmm15,%xmm2
+	pxor	%xmm15,%xmm4
+	pxor	%xmm2,%xmm0
+	movdqa	%xmm2,%xmm10
+	movdqa	%xmm6,%xmm9
+	movdqa	%xmm0,%xmm8
+	movdqa	%xmm3,%xmm12
+	movdqa	%xmm4,%xmm11
+
+	pxor	%xmm15,%xmm10
+	pxor	%xmm3,%xmm9
+	pxor	%xmm5,%xmm8
+	movdqa	%xmm10,%xmm13
+	pxor	%xmm15,%xmm12
+	movdqa	%xmm9,%xmm7
+	pxor	%xmm1,%xmm11
+	movdqa	%xmm10,%xmm14
+
+	por	%xmm8,%xmm9
+	por	%xmm11,%xmm10
+	pxor	%xmm7,%xmm14
+	pand	%xmm11,%xmm13
+	pxor	%xmm8,%xmm11
+	pand	%xmm8,%xmm7
+	pand	%xmm11,%xmm14
+	movdqa	%xmm5,%xmm11
+	pxor	%xmm1,%xmm11
+	pand	%xmm11,%xmm12
+	pxor	%xmm12,%xmm10
+	pxor	%xmm12,%xmm9
+	movdqa	%xmm2,%xmm12
+	movdqa	%xmm0,%xmm11
+	pxor	%xmm6,%xmm12
+	pxor	%xmm4,%xmm11
+	movdqa	%xmm12,%xmm8
+	pand	%xmm11,%xmm12
+	por	%xmm11,%xmm8
+	pxor	%xmm12,%xmm7
+	pxor	%xmm14,%xmm10
+	pxor	%xmm13,%xmm9
+	pxor	%xmm14,%xmm8
+	movdqa	%xmm3,%xmm11
+	pxor	%xmm13,%xmm7
+	movdqa	%xmm15,%xmm12
+	pxor	%xmm13,%xmm8
+	movdqa	%xmm6,%xmm13
+	pand	%xmm5,%xmm11
+	movdqa	%xmm2,%xmm14
+	pand	%xmm1,%xmm12
+	pand	%xmm0,%xmm13
+	por	%xmm4,%xmm14
+	pxor	%xmm11,%xmm10
+	pxor	%xmm12,%xmm9
+	pxor	%xmm13,%xmm8
+	pxor	%xmm14,%xmm7
+
+
+
+
+
+	movdqa	%xmm10,%xmm11
+	pand	%xmm8,%xmm10
+	pxor	%xmm9,%xmm11
+
+	movdqa	%xmm7,%xmm13
+	movdqa	%xmm11,%xmm14
+	pxor	%xmm10,%xmm13
+	pand	%xmm13,%xmm14
+
+	movdqa	%xmm8,%xmm12
+	pxor	%xmm9,%xmm14
+	pxor	%xmm7,%xmm12
+
+	pxor	%xmm9,%xmm10
+
+	pand	%xmm10,%xmm12
+
+	movdqa	%xmm13,%xmm9
+	pxor	%xmm7,%xmm12
+
+	pxor	%xmm12,%xmm9
+	pxor	%xmm12,%xmm8
+
+	pand	%xmm7,%xmm9
+
+	pxor	%xmm9,%xmm13
+	pxor	%xmm9,%xmm8
+
+	pand	%xmm14,%xmm13
+
+	pxor	%xmm11,%xmm13
+	movdqa	%xmm4,%xmm11
+	movdqa	%xmm0,%xmm7
+	movdqa	%xmm14,%xmm9
+	pxor	%xmm13,%xmm9
+	pand	%xmm4,%xmm9
+	pxor	%xmm0,%xmm4
+	pand	%xmm14,%xmm0
+	pand	%xmm13,%xmm4
+	pxor	%xmm0,%xmm4
+	pxor	%xmm9,%xmm0
+	pxor	%xmm1,%xmm11
+	pxor	%xmm5,%xmm7
+	pxor	%xmm12,%xmm14
+	pxor	%xmm8,%xmm13
+	movdqa	%xmm14,%xmm10
+	movdqa	%xmm12,%xmm9
+	pxor	%xmm13,%xmm10
+	pxor	%xmm8,%xmm9
+	pand	%xmm11,%xmm10
+	pand	%xmm1,%xmm9
+	pxor	%xmm7,%xmm11
+	pxor	%xmm5,%xmm1
+	pand	%xmm14,%xmm7
+	pand	%xmm12,%xmm5
+	pand	%xmm13,%xmm11
+	pand	%xmm8,%xmm1
+	pxor	%xmm11,%xmm7
+	pxor	%xmm5,%xmm1
+	pxor	%xmm10,%xmm11
+	pxor	%xmm9,%xmm5
+	pxor	%xmm11,%xmm4
+	pxor	%xmm11,%xmm1
+	pxor	%xmm7,%xmm0
+	pxor	%xmm7,%xmm5
+
+	movdqa	%xmm2,%xmm11
+	movdqa	%xmm6,%xmm7
+	pxor	%xmm15,%xmm11
+	pxor	%xmm3,%xmm7
+	movdqa	%xmm14,%xmm10
+	movdqa	%xmm12,%xmm9
+	pxor	%xmm13,%xmm10
+	pxor	%xmm8,%xmm9
+	pand	%xmm11,%xmm10
+	pand	%xmm15,%xmm9
+	pxor	%xmm7,%xmm11
+	pxor	%xmm3,%xmm15
+	pand	%xmm14,%xmm7
+	pand	%xmm12,%xmm3
+	pand	%xmm13,%xmm11
+	pand	%xmm8,%xmm15
+	pxor	%xmm11,%xmm7
+	pxor	%xmm3,%xmm15
+	pxor	%xmm10,%xmm11
+	pxor	%xmm9,%xmm3
+	pxor	%xmm12,%xmm14
+	pxor	%xmm8,%xmm13
+	movdqa	%xmm14,%xmm10
+	pxor	%xmm13,%xmm10
+	pand	%xmm2,%xmm10
+	pxor	%xmm6,%xmm2
+	pand	%xmm14,%xmm6
+	pand	%xmm13,%xmm2
+	pxor	%xmm6,%xmm2
+	pxor	%xmm10,%xmm6
+	pxor	%xmm11,%xmm2
+	pxor	%xmm11,%xmm15
+	pxor	%xmm7,%xmm6
+	pxor	%xmm7,%xmm3
+	pxor	%xmm6,%xmm0
+	pxor	%xmm4,%xmm5
+
+	pxor	%xmm0,%xmm3
+	pxor	%xmm6,%xmm1
+	pxor	%xmm6,%xmm4
+	pxor	%xmm1,%xmm3
+	pxor	%xmm15,%xmm6
+	pxor	%xmm4,%xmm3
+	pxor	%xmm5,%xmm2
+	pxor	%xmm0,%xmm5
+	pxor	%xmm3,%xmm2
+
+	pxor	%xmm15,%xmm3
+	pxor	%xmm2,%xmm6
+	decl	%r10d
+	jl	.Ldec_done
+
+	pshufd	$78,%xmm15,%xmm7
+	pshufd	$78,%xmm2,%xmm13
+	pxor	%xmm15,%xmm7
+	pshufd	$78,%xmm4,%xmm14
+	pxor	%xmm2,%xmm13
+	pshufd	$78,%xmm0,%xmm8
+	pxor	%xmm4,%xmm14
+	pshufd	$78,%xmm5,%xmm9
+	pxor	%xmm0,%xmm8
+	pshufd	$78,%xmm3,%xmm10
+	pxor	%xmm5,%xmm9
+	pxor	%xmm13,%xmm15
+	pxor	%xmm13,%xmm0
+	pshufd	$78,%xmm1,%xmm11
+	pxor	%xmm3,%xmm10
+	pxor	%xmm7,%xmm5
+	pxor	%xmm8,%xmm3
+	pshufd	$78,%xmm6,%xmm12
+	pxor	%xmm1,%xmm11
+	pxor	%xmm14,%xmm0
+	pxor	%xmm9,%xmm1
+	pxor	%xmm6,%xmm12
+
+	pxor	%xmm14,%xmm5
+	pxor	%xmm13,%xmm3
+	pxor	%xmm13,%xmm1
+	pxor	%xmm10,%xmm6
+	pxor	%xmm11,%xmm2
+	pxor	%xmm14,%xmm1
+	pxor	%xmm14,%xmm6
+	pxor	%xmm12,%xmm4
+	pshufd	$147,%xmm15,%xmm7
+	pshufd	$147,%xmm0,%xmm8
+	pxor	%xmm7,%xmm15
+	pshufd	$147,%xmm5,%xmm9
+	pxor	%xmm8,%xmm0
+	pshufd	$147,%xmm3,%xmm10
+	pxor	%xmm9,%xmm5
+	pshufd	$147,%xmm1,%xmm11
+	pxor	%xmm10,%xmm3
+	pshufd	$147,%xmm6,%xmm12
+	pxor	%xmm11,%xmm1
+	pshufd	$147,%xmm2,%xmm13
+	pxor	%xmm12,%xmm6
+	pshufd	$147,%xmm4,%xmm14
+	pxor	%xmm13,%xmm2
+	pxor	%xmm14,%xmm4
+
+	pxor	%xmm15,%xmm8
+	pxor	%xmm4,%xmm7
+	pxor	%xmm4,%xmm8
+	pshufd	$78,%xmm15,%xmm15
+	pxor	%xmm0,%xmm9
+	pshufd	$78,%xmm0,%xmm0
+	pxor	%xmm1,%xmm12
+	pxor	%xmm7,%xmm15
+	pxor	%xmm6,%xmm13
+	pxor	%xmm8,%xmm0
+	pxor	%xmm3,%xmm11
+	pshufd	$78,%xmm1,%xmm7
+	pxor	%xmm2,%xmm14
+	pshufd	$78,%xmm6,%xmm8
+	pxor	%xmm5,%xmm10
+	pshufd	$78,%xmm3,%xmm1
+	pxor	%xmm4,%xmm10
+	pshufd	$78,%xmm4,%xmm6
+	pxor	%xmm4,%xmm11
+	pshufd	$78,%xmm2,%xmm3
+	pxor	%xmm11,%xmm7
+	pshufd	$78,%xmm5,%xmm2
+	pxor	%xmm12,%xmm8
+	pxor	%xmm1,%xmm10
+	pxor	%xmm14,%xmm6
+	pxor	%xmm3,%xmm13
+	movdqa	%xmm7,%xmm3
+	pxor	%xmm9,%xmm2
+	movdqa	%xmm13,%xmm5
+	movdqa	%xmm8,%xmm4
+	movdqa	%xmm2,%xmm1
+	movdqa	%xmm10,%xmm2
+	movdqa	-16(%r11),%xmm7
+	jnz	.Ldec_loop
+	movdqa	-32(%r11),%xmm7
+	jmp	.Ldec_loop
+.align	16
+.Ldec_done:
+	movdqa	0(%r11),%xmm7
+	movdqa	16(%r11),%xmm8
+	movdqa	%xmm2,%xmm9
+	psrlq	$1,%xmm2
+	movdqa	%xmm1,%xmm10
+	psrlq	$1,%xmm1
+	pxor	%xmm4,%xmm2
+	pxor	%xmm6,%xmm1
+	pand	%xmm7,%xmm2
+	pand	%xmm7,%xmm1
+	pxor	%xmm2,%xmm4
+	psllq	$1,%xmm2
+	pxor	%xmm1,%xmm6
+	psllq	$1,%xmm1
+	pxor	%xmm9,%xmm2
+	pxor	%xmm10,%xmm1
+	movdqa	%xmm5,%xmm9
+	psrlq	$1,%xmm5
+	movdqa	%xmm15,%xmm10
+	psrlq	$1,%xmm15
+	pxor	%xmm3,%xmm5
+	pxor	%xmm0,%xmm15
+	pand	%xmm7,%xmm5
+	pand	%xmm7,%xmm15
+	pxor	%xmm5,%xmm3
+	psllq	$1,%xmm5
+	pxor	%xmm15,%xmm0
+	psllq	$1,%xmm15
+	pxor	%xmm9,%xmm5
+	pxor	%xmm10,%xmm15
+	movdqa	32(%r11),%xmm7
+	movdqa	%xmm6,%xmm9
+	psrlq	$2,%xmm6
+	movdqa	%xmm1,%xmm10
+	psrlq	$2,%xmm1
+	pxor	%xmm4,%xmm6
+	pxor	%xmm2,%xmm1
+	pand	%xmm8,%xmm6
+	pand	%xmm8,%xmm1
+	pxor	%xmm6,%xmm4
+	psllq	$2,%xmm6
+	pxor	%xmm1,%xmm2
+	psllq	$2,%xmm1
+	pxor	%xmm9,%xmm6
+	pxor	%xmm10,%xmm1
+	movdqa	%xmm0,%xmm9
+	psrlq	$2,%xmm0
+	movdqa	%xmm15,%xmm10
+	psrlq	$2,%xmm15
+	pxor	%xmm3,%xmm0
+	pxor	%xmm5,%xmm15
+	pand	%xmm8,%xmm0
+	pand	%xmm8,%xmm15
+	pxor	%xmm0,%xmm3
+	psllq	$2,%xmm0
+	pxor	%xmm15,%xmm5
+	psllq	$2,%xmm15
+	pxor	%xmm9,%xmm0
+	pxor	%xmm10,%xmm15
+	movdqa	%xmm3,%xmm9
+	psrlq	$4,%xmm3
+	movdqa	%xmm5,%xmm10
+	psrlq	$4,%xmm5
+	pxor	%xmm4,%xmm3
+	pxor	%xmm2,%xmm5
+	pand	%xmm7,%xmm3
+	pand	%xmm7,%xmm5
+	pxor	%xmm3,%xmm4
+	psllq	$4,%xmm3
+	pxor	%xmm5,%xmm2
+	psllq	$4,%xmm5
+	pxor	%xmm9,%xmm3
+	pxor	%xmm10,%xmm5
+	movdqa	%xmm0,%xmm9
+	psrlq	$4,%xmm0
+	movdqa	%xmm15,%xmm10
+	psrlq	$4,%xmm15
+	pxor	%xmm6,%xmm0
+	pxor	%xmm1,%xmm15
+	pand	%xmm7,%xmm0
+	pand	%xmm7,%xmm15
+	pxor	%xmm0,%xmm6
+	psllq	$4,%xmm0
+	pxor	%xmm15,%xmm1
+	psllq	$4,%xmm15
+	pxor	%xmm9,%xmm0
+	pxor	%xmm10,%xmm15
+	movdqa	(%rax),%xmm7
+	pxor	%xmm7,%xmm5
+	pxor	%xmm7,%xmm3
+	pxor	%xmm7,%xmm1
+	pxor	%xmm7,%xmm6
+	pxor	%xmm7,%xmm2
+	pxor	%xmm7,%xmm4
+	pxor	%xmm7,%xmm15
+	pxor	%xmm7,%xmm0
+	.byte	0xf3,0xc3
+.size	_bsaes_decrypt8,.-_bsaes_decrypt8
+.type	_bsaes_key_convert,@function
+.align	16
+_bsaes_key_convert:
+	leaq	.Lmasks(%rip),%r11
+	movdqu	(%rcx),%xmm7
+	leaq	16(%rcx),%rcx
+	movdqa	0(%r11),%xmm0
+	movdqa	16(%r11),%xmm1
+	movdqa	32(%r11),%xmm2
+	movdqa	48(%r11),%xmm3
+	movdqa	64(%r11),%xmm4
+	pcmpeqd	%xmm5,%xmm5
+
+	movdqu	(%rcx),%xmm6
+	movdqa	%xmm7,(%rax)
+	leaq	16(%rax),%rax
+	decl	%r10d
+	jmp	.Lkey_loop
+.align	16
+.Lkey_loop:
+.byte	102,15,56,0,244
+
+	movdqa	%xmm0,%xmm8
+	movdqa	%xmm1,%xmm9
+
+	pand	%xmm6,%xmm8
+	pand	%xmm6,%xmm9
+	movdqa	%xmm2,%xmm10
+	pcmpeqb	%xmm0,%xmm8
+	psllq	$4,%xmm0
+	movdqa	%xmm3,%xmm11
+	pcmpeqb	%xmm1,%xmm9
+	psllq	$4,%xmm1
+
+	pand	%xmm6,%xmm10
+	pand	%xmm6,%xmm11
+	movdqa	%xmm0,%xmm12
+	pcmpeqb	%xmm2,%xmm10
+	psllq	$4,%xmm2
+	movdqa	%xmm1,%xmm13
+	pcmpeqb	%xmm3,%xmm11
+	psllq	$4,%xmm3
+
+	movdqa	%xmm2,%xmm14
+	movdqa	%xmm3,%xmm15
+	pxor	%xmm5,%xmm8
+	pxor	%xmm5,%xmm9
+
+	pand	%xmm6,%xmm12
+	pand	%xmm6,%xmm13
+	movdqa	%xmm8,0(%rax)
+	pcmpeqb	%xmm0,%xmm12
+	psrlq	$4,%xmm0
+	movdqa	%xmm9,16(%rax)
+	pcmpeqb	%xmm1,%xmm13
+	psrlq	$4,%xmm1
+	leaq	16(%rcx),%rcx
+
+	pand	%xmm6,%xmm14
+	pand	%xmm6,%xmm15
+	movdqa	%xmm10,32(%rax)
+	pcmpeqb	%xmm2,%xmm14
+	psrlq	$4,%xmm2
+	movdqa	%xmm11,48(%rax)
+	pcmpeqb	%xmm3,%xmm15
+	psrlq	$4,%xmm3
+	movdqu	(%rcx),%xmm6
+
+	pxor	%xmm5,%xmm13
+	pxor	%xmm5,%xmm14
+	movdqa	%xmm12,64(%rax)
+	movdqa	%xmm13,80(%rax)
+	movdqa	%xmm14,96(%rax)
+	movdqa	%xmm15,112(%rax)
+	leaq	128(%rax),%rax
+	decl	%r10d
+	jnz	.Lkey_loop
+
+	movdqa	80(%r11),%xmm7
+
+	.byte	0xf3,0xc3
+.size	_bsaes_key_convert,.-_bsaes_key_convert
+.extern	asm_AES_cbc_encrypt
+.hidden asm_AES_cbc_encrypt
+.globl	bsaes_cbc_encrypt
+.hidden bsaes_cbc_encrypt
+.type	bsaes_cbc_encrypt,@function
+.align	16
+bsaes_cbc_encrypt:
+	cmpl	$0,%r9d
+	jne	asm_AES_cbc_encrypt
+	cmpq	$128,%rdx
+	jb	asm_AES_cbc_encrypt
+
+	movq	%rsp,%rax
+.Lcbc_dec_prologue:
+	pushq	%rbp
+	pushq	%rbx
+	pushq	%r12
+	pushq	%r13
+	pushq	%r14
+	pushq	%r15
+	leaq	-72(%rsp),%rsp
+	movq	%rsp,%rbp
+	movl	240(%rcx),%eax
+	movq	%rdi,%r12
+	movq	%rsi,%r13
+	movq	%rdx,%r14
+	movq	%rcx,%r15
+	movq	%r8,%rbx
+	shrq	$4,%r14
+
+	movl	%eax,%edx
+	shlq	$7,%rax
+	subq	$96,%rax
+	subq	%rax,%rsp
+
+	movq	%rsp,%rax
+	movq	%r15,%rcx
+	movl	%edx,%r10d
+	call	_bsaes_key_convert
+	pxor	(%rsp),%xmm7
+	movdqa	%xmm6,(%rax)
+	movdqa	%xmm7,(%rsp)
+
+	movdqu	(%rbx),%xmm14
+	subq	$8,%r14
+.Lcbc_dec_loop:
+	movdqu	0(%r12),%xmm15
+	movdqu	16(%r12),%xmm0
+	movdqu	32(%r12),%xmm1
+	movdqu	48(%r12),%xmm2
+	movdqu	64(%r12),%xmm3
+	movdqu	80(%r12),%xmm4
+	movq	%rsp,%rax
+	movdqu	96(%r12),%xmm5
+	movl	%edx,%r10d
+	movdqu	112(%r12),%xmm6
+	movdqa	%xmm14,32(%rbp)
+
+	call	_bsaes_decrypt8
+
+	pxor	32(%rbp),%xmm15
+	movdqu	0(%r12),%xmm7
+	movdqu	16(%r12),%xmm8
+	pxor	%xmm7,%xmm0
+	movdqu	32(%r12),%xmm9
+	pxor	%xmm8,%xmm5
+	movdqu	48(%r12),%xmm10
+	pxor	%xmm9,%xmm3
+	movdqu	64(%r12),%xmm11
+	pxor	%xmm10,%xmm1
+	movdqu	80(%r12),%xmm12
+	pxor	%xmm11,%xmm6
+	movdqu	96(%r12),%xmm13
+	pxor	%xmm12,%xmm2
+	movdqu	112(%r12),%xmm14
+	pxor	%xmm13,%xmm4
+	movdqu	%xmm15,0(%r13)
+	leaq	128(%r12),%r12
+	movdqu	%xmm0,16(%r13)
+	movdqu	%xmm5,32(%r13)
+	movdqu	%xmm3,48(%r13)
+	movdqu	%xmm1,64(%r13)
+	movdqu	%xmm6,80(%r13)
+	movdqu	%xmm2,96(%r13)
+	movdqu	%xmm4,112(%r13)
+	leaq	128(%r13),%r13
+	subq	$8,%r14
+	jnc	.Lcbc_dec_loop
+
+	addq	$8,%r14
+	jz	.Lcbc_dec_done
+
+	movdqu	0(%r12),%xmm15
+	movq	%rsp,%rax
+	movl	%edx,%r10d
+	cmpq	$2,%r14
+	jb	.Lcbc_dec_one
+	movdqu	16(%r12),%xmm0
+	je	.Lcbc_dec_two
+	movdqu	32(%r12),%xmm1
+	cmpq	$4,%r14
+	jb	.Lcbc_dec_three
+	movdqu	48(%r12),%xmm2
+	je	.Lcbc_dec_four
+	movdqu	64(%r12),%xmm3
+	cmpq	$6,%r14
+	jb	.Lcbc_dec_five
+	movdqu	80(%r12),%xmm4
+	je	.Lcbc_dec_six
+	movdqu	96(%r12),%xmm5
+	movdqa	%xmm14,32(%rbp)
+	call	_bsaes_decrypt8
+	pxor	32(%rbp),%xmm15
+	movdqu	0(%r12),%xmm7
+	movdqu	16(%r12),%xmm8
+	pxor	%xmm7,%xmm0
+	movdqu	32(%r12),%xmm9
+	pxor	%xmm8,%xmm5
+	movdqu	48(%r12),%xmm10
+	pxor	%xmm9,%xmm3
+	movdqu	64(%r12),%xmm11
+	pxor	%xmm10,%xmm1
+	movdqu	80(%r12),%xmm12
+	pxor	%xmm11,%xmm6
+	movdqu	96(%r12),%xmm14
+	pxor	%xmm12,%xmm2
+	movdqu	%xmm15,0(%r13)
+	movdqu	%xmm0,16(%r13)
+	movdqu	%xmm5,32(%r13)
+	movdqu	%xmm3,48(%r13)
+	movdqu	%xmm1,64(%r13)
+	movdqu	%xmm6,80(%r13)
+	movdqu	%xmm2,96(%r13)
+	jmp	.Lcbc_dec_done
+.align	16
+.Lcbc_dec_six:
+	movdqa	%xmm14,32(%rbp)
+	call	_bsaes_decrypt8
+	pxor	32(%rbp),%xmm15
+	movdqu	0(%r12),%xmm7
+	movdqu	16(%r12),%xmm8
+	pxor	%xmm7,%xmm0
+	movdqu	32(%r12),%xmm9
+	pxor	%xmm8,%xmm5
+	movdqu	48(%r12),%xmm10
+	pxor	%xmm9,%xmm3
+	movdqu	64(%r12),%xmm11
+	pxor	%xmm10,%xmm1
+	movdqu	80(%r12),%xmm14
+	pxor	%xmm11,%xmm6
+	movdqu	%xmm15,0(%r13)
+	movdqu	%xmm0,16(%r13)
+	movdqu	%xmm5,32(%r13)
+	movdqu	%xmm3,48(%r13)
+	movdqu	%xmm1,64(%r13)
+	movdqu	%xmm6,80(%r13)
+	jmp	.Lcbc_dec_done
+.align	16
+.Lcbc_dec_five:
+	movdqa	%xmm14,32(%rbp)
+	call	_bsaes_decrypt8
+	pxor	32(%rbp),%xmm15
+	movdqu	0(%r12),%xmm7
+	movdqu	16(%r12),%xmm8
+	pxor	%xmm7,%xmm0
+	movdqu	32(%r12),%xmm9
+	pxor	%xmm8,%xmm5
+	movdqu	48(%r12),%xmm10
+	pxor	%xmm9,%xmm3
+	movdqu	64(%r12),%xmm14
+	pxor	%xmm10,%xmm1
+	movdqu	%xmm15,0(%r13)
+	movdqu	%xmm0,16(%r13)
+	movdqu	%xmm5,32(%r13)
+	movdqu	%xmm3,48(%r13)
+	movdqu	%xmm1,64(%r13)
+	jmp	.Lcbc_dec_done
+.align	16
+.Lcbc_dec_four:
+	movdqa	%xmm14,32(%rbp)
+	call	_bsaes_decrypt8
+	pxor	32(%rbp),%xmm15
+	movdqu	0(%r12),%xmm7
+	movdqu	16(%r12),%xmm8
+	pxor	%xmm7,%xmm0
+	movdqu	32(%r12),%xmm9
+	pxor	%xmm8,%xmm5
+	movdqu	48(%r12),%xmm14
+	pxor	%xmm9,%xmm3
+	movdqu	%xmm15,0(%r13)
+	movdqu	%xmm0,16(%r13)
+	movdqu	%xmm5,32(%r13)
+	movdqu	%xmm3,48(%r13)
+	jmp	.Lcbc_dec_done
+.align	16
+.Lcbc_dec_three:
+	movdqa	%xmm14,32(%rbp)
+	call	_bsaes_decrypt8
+	pxor	32(%rbp),%xmm15
+	movdqu	0(%r12),%xmm7
+	movdqu	16(%r12),%xmm8
+	pxor	%xmm7,%xmm0
+	movdqu	32(%r12),%xmm14
+	pxor	%xmm8,%xmm5
+	movdqu	%xmm15,0(%r13)
+	movdqu	%xmm0,16(%r13)
+	movdqu	%xmm5,32(%r13)
+	jmp	.Lcbc_dec_done
+.align	16
+.Lcbc_dec_two:
+	movdqa	%xmm14,32(%rbp)
+	call	_bsaes_decrypt8
+	pxor	32(%rbp),%xmm15
+	movdqu	0(%r12),%xmm7
+	movdqu	16(%r12),%xmm14
+	pxor	%xmm7,%xmm0
+	movdqu	%xmm15,0(%r13)
+	movdqu	%xmm0,16(%r13)
+	jmp	.Lcbc_dec_done
+.align	16
+.Lcbc_dec_one:
+	leaq	(%r12),%rdi
+	leaq	32(%rbp),%rsi
+	leaq	(%r15),%rdx
+	call	asm_AES_decrypt
+	pxor	32(%rbp),%xmm14
+	movdqu	%xmm14,(%r13)
+	movdqa	%xmm15,%xmm14
+
+.Lcbc_dec_done:
+	movdqu	%xmm14,(%rbx)
+	leaq	(%rsp),%rax
+	pxor	%xmm0,%xmm0
+.Lcbc_dec_bzero:
+	movdqa	%xmm0,0(%rax)
+	movdqa	%xmm0,16(%rax)
+	leaq	32(%rax),%rax
+	cmpq	%rax,%rbp
+	ja	.Lcbc_dec_bzero
+
+	leaq	(%rbp),%rsp
+	movq	72(%rsp),%r15
+	movq	80(%rsp),%r14
+	movq	88(%rsp),%r13
+	movq	96(%rsp),%r12
+	movq	104(%rsp),%rbx
+	movq	112(%rsp),%rax
+	leaq	120(%rsp),%rsp
+	movq	%rax,%rbp
+.Lcbc_dec_epilogue:
+	.byte	0xf3,0xc3
+.size	bsaes_cbc_encrypt,.-bsaes_cbc_encrypt
+
+.globl	bsaes_ctr32_encrypt_blocks
+.hidden bsaes_ctr32_encrypt_blocks
+.type	bsaes_ctr32_encrypt_blocks,@function
+.align	16
+bsaes_ctr32_encrypt_blocks:
+	movq	%rsp,%rax
+.Lctr_enc_prologue:
+	pushq	%rbp
+	pushq	%rbx
+	pushq	%r12
+	pushq	%r13
+	pushq	%r14
+	pushq	%r15
+	leaq	-72(%rsp),%rsp
+	movq	%rsp,%rbp
+	movdqu	(%r8),%xmm0
+	movl	240(%rcx),%eax
+	movq	%rdi,%r12
+	movq	%rsi,%r13
+	movq	%rdx,%r14
+	movq	%rcx,%r15
+	movdqa	%xmm0,32(%rbp)
+	cmpq	$8,%rdx
+	jb	.Lctr_enc_short
+
+	movl	%eax,%ebx
+	shlq	$7,%rax
+	subq	$96,%rax
+	subq	%rax,%rsp
+
+	movq	%rsp,%rax
+	movq	%r15,%rcx
+	movl	%ebx,%r10d
+	call	_bsaes_key_convert
+	pxor	%xmm6,%xmm7
+	movdqa	%xmm7,(%rax)
+
+	movdqa	(%rsp),%xmm8
+	leaq	.LADD1(%rip),%r11
+	movdqa	32(%rbp),%xmm15
+	movdqa	-32(%r11),%xmm7
+.byte	102,68,15,56,0,199
+.byte	102,68,15,56,0,255
+	movdqa	%xmm8,(%rsp)
+	jmp	.Lctr_enc_loop
+.align	16
+.Lctr_enc_loop:
+	movdqa	%xmm15,32(%rbp)
+	movdqa	%xmm15,%xmm0
+	movdqa	%xmm15,%xmm1
+	paddd	0(%r11),%xmm0
+	movdqa	%xmm15,%xmm2
+	paddd	16(%r11),%xmm1
+	movdqa	%xmm15,%xmm3
+	paddd	32(%r11),%xmm2
+	movdqa	%xmm15,%xmm4
+	paddd	48(%r11),%xmm3
+	movdqa	%xmm15,%xmm5
+	paddd	64(%r11),%xmm4
+	movdqa	%xmm15,%xmm6
+	paddd	80(%r11),%xmm5
+	paddd	96(%r11),%xmm6
+
+
+
+	movdqa	(%rsp),%xmm8
+	leaq	16(%rsp),%rax
+	movdqa	-16(%r11),%xmm7
+	pxor	%xmm8,%xmm15
+	pxor	%xmm8,%xmm0
+	pxor	%xmm8,%xmm1
+	pxor	%xmm8,%xmm2
+.byte	102,68,15,56,0,255
+.byte	102,15,56,0,199
+	pxor	%xmm8,%xmm3
+	pxor	%xmm8,%xmm4
+.byte	102,15,56,0,207
+.byte	102,15,56,0,215
+	pxor	%xmm8,%xmm5
+	pxor	%xmm8,%xmm6
+.byte	102,15,56,0,223
+.byte	102,15,56,0,231
+.byte	102,15,56,0,239
+.byte	102,15,56,0,247
+	leaq	.LBS0(%rip),%r11
+	movl	%ebx,%r10d
+
+	call	_bsaes_encrypt8_bitslice
+
+	subq	$8,%r14
+	jc	.Lctr_enc_loop_done
+
+	movdqu	0(%r12),%xmm7
+	movdqu	16(%r12),%xmm8
+	movdqu	32(%r12),%xmm9
+	movdqu	48(%r12),%xmm10
+	movdqu	64(%r12),%xmm11
+	movdqu	80(%r12),%xmm12
+	movdqu	96(%r12),%xmm13
+	movdqu	112(%r12),%xmm14
+	leaq	128(%r12),%r12
+	pxor	%xmm15,%xmm7
+	movdqa	32(%rbp),%xmm15
+	pxor	%xmm8,%xmm0
+	movdqu	%xmm7,0(%r13)
+	pxor	%xmm9,%xmm3
+	movdqu	%xmm0,16(%r13)
+	pxor	%xmm10,%xmm5
+	movdqu	%xmm3,32(%r13)
+	pxor	%xmm11,%xmm2
+	movdqu	%xmm5,48(%r13)
+	pxor	%xmm12,%xmm6
+	movdqu	%xmm2,64(%r13)
+	pxor	%xmm13,%xmm1
+	movdqu	%xmm6,80(%r13)
+	pxor	%xmm14,%xmm4
+	movdqu	%xmm1,96(%r13)
+	leaq	.LADD1(%rip),%r11
+	movdqu	%xmm4,112(%r13)
+	leaq	128(%r13),%r13
+	paddd	112(%r11),%xmm15
+	jnz	.Lctr_enc_loop
+
+	jmp	.Lctr_enc_done
+.align	16
+.Lctr_enc_loop_done:
+	addq	$8,%r14
+	movdqu	0(%r12),%xmm7
+	pxor	%xmm7,%xmm15
+	movdqu	%xmm15,0(%r13)
+	cmpq	$2,%r14
+	jb	.Lctr_enc_done
+	movdqu	16(%r12),%xmm8
+	pxor	%xmm8,%xmm0
+	movdqu	%xmm0,16(%r13)
+	je	.Lctr_enc_done
+	movdqu	32(%r12),%xmm9
+	pxor	%xmm9,%xmm3
+	movdqu	%xmm3,32(%r13)
+	cmpq	$4,%r14
+	jb	.Lctr_enc_done
+	movdqu	48(%r12),%xmm10
+	pxor	%xmm10,%xmm5
+	movdqu	%xmm5,48(%r13)
+	je	.Lctr_enc_done
+	movdqu	64(%r12),%xmm11
+	pxor	%xmm11,%xmm2
+	movdqu	%xmm2,64(%r13)
+	cmpq	$6,%r14
+	jb	.Lctr_enc_done
+	movdqu	80(%r12),%xmm12
+	pxor	%xmm12,%xmm6
+	movdqu	%xmm6,80(%r13)
+	je	.Lctr_enc_done
+	movdqu	96(%r12),%xmm13
+	pxor	%xmm13,%xmm1
+	movdqu	%xmm1,96(%r13)
+	jmp	.Lctr_enc_done
+
+.align	16
+.Lctr_enc_short:
+	leaq	32(%rbp),%rdi
+	leaq	48(%rbp),%rsi
+	leaq	(%r15),%rdx
+	call	asm_AES_encrypt
+	movdqu	(%r12),%xmm0
+	leaq	16(%r12),%r12
+	movl	44(%rbp),%eax
+	bswapl	%eax
+	pxor	48(%rbp),%xmm0
+	incl	%eax
+	movdqu	%xmm0,(%r13)
+	bswapl	%eax
+	leaq	16(%r13),%r13
+	movl	%eax,44(%rsp)
+	decq	%r14
+	jnz	.Lctr_enc_short
+
+.Lctr_enc_done:
+	leaq	(%rsp),%rax
+	pxor	%xmm0,%xmm0
+.Lctr_enc_bzero:
+	movdqa	%xmm0,0(%rax)
+	movdqa	%xmm0,16(%rax)
+	leaq	32(%rax),%rax
+	cmpq	%rax,%rbp
+	ja	.Lctr_enc_bzero
+
+	leaq	(%rbp),%rsp
+	movq	72(%rsp),%r15
+	movq	80(%rsp),%r14
+	movq	88(%rsp),%r13
+	movq	96(%rsp),%r12
+	movq	104(%rsp),%rbx
+	movq	112(%rsp),%rax
+	leaq	120(%rsp),%rsp
+	movq	%rax,%rbp
+.Lctr_enc_epilogue:
+	.byte	0xf3,0xc3
+.size	bsaes_ctr32_encrypt_blocks,.-bsaes_ctr32_encrypt_blocks
+.globl	bsaes_xts_encrypt
+.hidden bsaes_xts_encrypt
+.type	bsaes_xts_encrypt,@function
+.align	16
+bsaes_xts_encrypt:
+	movq	%rsp,%rax
+.Lxts_enc_prologue:
+	pushq	%rbp
+	pushq	%rbx
+	pushq	%r12
+	pushq	%r13
+	pushq	%r14
+	pushq	%r15
+	leaq	-72(%rsp),%rsp
+	movq	%rsp,%rbp
+	movq	%rdi,%r12
+	movq	%rsi,%r13
+	movq	%rdx,%r14
+	movq	%rcx,%r15
+
+	leaq	(%r9),%rdi
+	leaq	32(%rbp),%rsi
+	leaq	(%r8),%rdx
+	call	asm_AES_encrypt
+
+	movl	240(%r15),%eax
+	movq	%r14,%rbx
+
+	movl	%eax,%edx
+	shlq	$7,%rax
+	subq	$96,%rax
+	subq	%rax,%rsp
+
+	movq	%rsp,%rax
+	movq	%r15,%rcx
+	movl	%edx,%r10d
+	call	_bsaes_key_convert
+	pxor	%xmm6,%xmm7
+	movdqa	%xmm7,(%rax)
+
+	andq	$-16,%r14
+	subq	$128,%rsp
+	movdqa	32(%rbp),%xmm6
+
+	pxor	%xmm14,%xmm14
+	movdqa	.Lxts_magic(%rip),%xmm12
+	pcmpgtd	%xmm6,%xmm14
+
+	subq	$128,%r14
+	jc	.Lxts_enc_short
+	jmp	.Lxts_enc_loop
+
+.align	16
+.Lxts_enc_loop:
+	pshufd	$19,%xmm14,%xmm13
+	pxor	%xmm14,%xmm14
+	movdqa	%xmm6,%xmm15
+	movdqa	%xmm6,0(%rsp)
+	paddq	%xmm6,%xmm6
+	pand	%xmm12,%xmm13
+	pcmpgtd	%xmm6,%xmm14
+	pxor	%xmm13,%xmm6
+	pshufd	$19,%xmm14,%xmm13
+	pxor	%xmm14,%xmm14
+	movdqa	%xmm6,%xmm0
+	movdqa	%xmm6,16(%rsp)
+	paddq	%xmm6,%xmm6
+	pand	%xmm12,%xmm13
+	pcmpgtd	%xmm6,%xmm14
+	pxor	%xmm13,%xmm6
+	movdqu	0(%r12),%xmm7
+	pshufd	$19,%xmm14,%xmm13
+	pxor	%xmm14,%xmm14
+	movdqa	%xmm6,%xmm1
+	movdqa	%xmm6,32(%rsp)
+	paddq	%xmm6,%xmm6
+	pand	%xmm12,%xmm13
+	pcmpgtd	%xmm6,%xmm14
+	pxor	%xmm13,%xmm6
+	movdqu	16(%r12),%xmm8
+	pxor	%xmm7,%xmm15
+	pshufd	$19,%xmm14,%xmm13
+	pxor	%xmm14,%xmm14
+	movdqa	%xmm6,%xmm2
+	movdqa	%xmm6,48(%rsp)
+	paddq	%xmm6,%xmm6
+	pand	%xmm12,%xmm13
+	pcmpgtd	%xmm6,%xmm14
+	pxor	%xmm13,%xmm6
+	movdqu	32(%r12),%xmm9
+	pxor	%xmm8,%xmm0
+	pshufd	$19,%xmm14,%xmm13
+	pxor	%xmm14,%xmm14
+	movdqa	%xmm6,%xmm3
+	movdqa	%xmm6,64(%rsp)
+	paddq	%xmm6,%xmm6
+	pand	%xmm12,%xmm13
+	pcmpgtd	%xmm6,%xmm14
+	pxor	%xmm13,%xmm6
+	movdqu	48(%r12),%xmm10
+	pxor	%xmm9,%xmm1
+	pshufd	$19,%xmm14,%xmm13
+	pxor	%xmm14,%xmm14
+	movdqa	%xmm6,%xmm4
+	movdqa	%xmm6,80(%rsp)
+	paddq	%xmm6,%xmm6
+	pand	%xmm12,%xmm13
+	pcmpgtd	%xmm6,%xmm14
+	pxor	%xmm13,%xmm6
+	movdqu	64(%r12),%xmm11
+	pxor	%xmm10,%xmm2
+	pshufd	$19,%xmm14,%xmm13
+	pxor	%xmm14,%xmm14
+	movdqa	%xmm6,%xmm5
+	movdqa	%xmm6,96(%rsp)
+	paddq	%xmm6,%xmm6
+	pand	%xmm12,%xmm13
+	pcmpgtd	%xmm6,%xmm14
+	pxor	%xmm13,%xmm6
+	movdqu	80(%r12),%xmm12
+	pxor	%xmm11,%xmm3
+	movdqu	96(%r12),%xmm13
+	pxor	%xmm12,%xmm4
+	movdqu	112(%r12),%xmm14
+	leaq	128(%r12),%r12
+	movdqa	%xmm6,112(%rsp)
+	pxor	%xmm13,%xmm5
+	leaq	128(%rsp),%rax
+	pxor	%xmm14,%xmm6
+	movl	%edx,%r10d
+
+	call	_bsaes_encrypt8
+
+	pxor	0(%rsp),%xmm15
+	pxor	16(%rsp),%xmm0
+	movdqu	%xmm15,0(%r13)
+	pxor	32(%rsp),%xmm3
+	movdqu	%xmm0,16(%r13)
+	pxor	48(%rsp),%xmm5
+	movdqu	%xmm3,32(%r13)
+	pxor	64(%rsp),%xmm2
+	movdqu	%xmm5,48(%r13)
+	pxor	80(%rsp),%xmm6
+	movdqu	%xmm2,64(%r13)
+	pxor	96(%rsp),%xmm1
+	movdqu	%xmm6,80(%r13)
+	pxor	112(%rsp),%xmm4
+	movdqu	%xmm1,96(%r13)
+	movdqu	%xmm4,112(%r13)
+	leaq	128(%r13),%r13
+
+	movdqa	112(%rsp),%xmm6
+	pxor	%xmm14,%xmm14
+	movdqa	.Lxts_magic(%rip),%xmm12
+	pcmpgtd	%xmm6,%xmm14
+	pshufd	$19,%xmm14,%xmm13
+	pxor	%xmm14,%xmm14
+	paddq	%xmm6,%xmm6
+	pand	%xmm12,%xmm13
+	pcmpgtd	%xmm6,%xmm14
+	pxor	%xmm13,%xmm6
+
+	subq	$128,%r14
+	jnc	.Lxts_enc_loop
+
+.Lxts_enc_short:
+	addq	$128,%r14
+	jz	.Lxts_enc_done
+	pshufd	$19,%xmm14,%xmm13
+	pxor	%xmm14,%xmm14
+	movdqa	%xmm6,%xmm15
+	movdqa	%xmm6,0(%rsp)
+	paddq	%xmm6,%xmm6
+	pand	%xmm12,%xmm13
+	pcmpgtd	%xmm6,%xmm14
+	pxor	%xmm13,%xmm6
+	pshufd	$19,%xmm14,%xmm13
+	pxor	%xmm14,%xmm14
+	movdqa	%xmm6,%xmm0
+	movdqa	%xmm6,16(%rsp)
+	paddq	%xmm6,%xmm6
+	pand	%xmm12,%xmm13
+	pcmpgtd	%xmm6,%xmm14
+	pxor	%xmm13,%xmm6
+	movdqu	0(%r12),%xmm7
+	cmpq	$16,%r14
+	je	.Lxts_enc_1
+	pshufd	$19,%xmm14,%xmm13
+	pxor	%xmm14,%xmm14
+	movdqa	%xmm6,%xmm1
+	movdqa	%xmm6,32(%rsp)
+	paddq	%xmm6,%xmm6
+	pand	%xmm12,%xmm13
+	pcmpgtd	%xmm6,%xmm14
+	pxor	%xmm13,%xmm6
+	movdqu	16(%r12),%xmm8
+	cmpq	$32,%r14
+	je	.Lxts_enc_2
+	pxor	%xmm7,%xmm15
+	pshufd	$19,%xmm14,%xmm13
+	pxor	%xmm14,%xmm14
+	movdqa	%xmm6,%xmm2
+	movdqa	%xmm6,48(%rsp)
+	paddq	%xmm6,%xmm6
+	pand	%xmm12,%xmm13
+	pcmpgtd	%xmm6,%xmm14
+	pxor	%xmm13,%xmm6
+	movdqu	32(%r12),%xmm9
+	cmpq	$48,%r14
+	je	.Lxts_enc_3
+	pxor	%xmm8,%xmm0
+	pshufd	$19,%xmm14,%xmm13
+	pxor	%xmm14,%xmm14
+	movdqa	%xmm6,%xmm3
+	movdqa	%xmm6,64(%rsp)
+	paddq	%xmm6,%xmm6
+	pand	%xmm12,%xmm13
+	pcmpgtd	%xmm6,%xmm14
+	pxor	%xmm13,%xmm6
+	movdqu	48(%r12),%xmm10
+	cmpq	$64,%r14
+	je	.Lxts_enc_4
+	pxor	%xmm9,%xmm1
+	pshufd	$19,%xmm14,%xmm13
+	pxor	%xmm14,%xmm14
+	movdqa	%xmm6,%xmm4
+	movdqa	%xmm6,80(%rsp)
+	paddq	%xmm6,%xmm6
+	pand	%xmm12,%xmm13
+	pcmpgtd	%xmm6,%xmm14
+	pxor	%xmm13,%xmm6
+	movdqu	64(%r12),%xmm11
+	cmpq	$80,%r14
+	je	.Lxts_enc_5
+	pxor	%xmm10,%xmm2
+	pshufd	$19,%xmm14,%xmm13
+	pxor	%xmm14,%xmm14
+	movdqa	%xmm6,%xmm5
+	movdqa	%xmm6,96(%rsp)
+	paddq	%xmm6,%xmm6
+	pand	%xmm12,%xmm13
+	pcmpgtd	%xmm6,%xmm14
+	pxor	%xmm13,%xmm6
+	movdqu	80(%r12),%xmm12
+	cmpq	$96,%r14
+	je	.Lxts_enc_6
+	pxor	%xmm11,%xmm3
+	movdqu	96(%r12),%xmm13
+	pxor	%xmm12,%xmm4
+	movdqa	%xmm6,112(%rsp)
+	leaq	112(%r12),%r12
+	pxor	%xmm13,%xmm5
+	leaq	128(%rsp),%rax
+	movl	%edx,%r10d
+
+	call	_bsaes_encrypt8
+
+	pxor	0(%rsp),%xmm15
+	pxor	16(%rsp),%xmm0
+	movdqu	%xmm15,0(%r13)
+	pxor	32(%rsp),%xmm3
+	movdqu	%xmm0,16(%r13)
+	pxor	48(%rsp),%xmm5
+	movdqu	%xmm3,32(%r13)
+	pxor	64(%rsp),%xmm2
+	movdqu	%xmm5,48(%r13)
+	pxor	80(%rsp),%xmm6
+	movdqu	%xmm2,64(%r13)
+	pxor	96(%rsp),%xmm1
+	movdqu	%xmm6,80(%r13)
+	movdqu	%xmm1,96(%r13)
+	leaq	112(%r13),%r13
+
+	movdqa	112(%rsp),%xmm6
+	jmp	.Lxts_enc_done
+.align	16
+.Lxts_enc_6:
+	pxor	%xmm11,%xmm3
+	leaq	96(%r12),%r12
+	pxor	%xmm12,%xmm4
+	leaq	128(%rsp),%rax
+	movl	%edx,%r10d
+
+	call	_bsaes_encrypt8
+
+	pxor	0(%rsp),%xmm15
+	pxor	16(%rsp),%xmm0
+	movdqu	%xmm15,0(%r13)
+	pxor	32(%rsp),%xmm3
+	movdqu	%xmm0,16(%r13)
+	pxor	48(%rsp),%xmm5
+	movdqu	%xmm3,32(%r13)
+	pxor	64(%rsp),%xmm2
+	movdqu	%xmm5,48(%r13)
+	pxor	80(%rsp),%xmm6
+	movdqu	%xmm2,64(%r13)
+	movdqu	%xmm6,80(%r13)
+	leaq	96(%r13),%r13
+
+	movdqa	96(%rsp),%xmm6
+	jmp	.Lxts_enc_done
+.align	16
+.Lxts_enc_5:
+	pxor	%xmm10,%xmm2
+	leaq	80(%r12),%r12
+	pxor	%xmm11,%xmm3
+	leaq	128(%rsp),%rax
+	movl	%edx,%r10d
+
+	call	_bsaes_encrypt8
+
+	pxor	0(%rsp),%xmm15
+	pxor	16(%rsp),%xmm0
+	movdqu	%xmm15,0(%r13)
+	pxor	32(%rsp),%xmm3
+	movdqu	%xmm0,16(%r13)
+	pxor	48(%rsp),%xmm5
+	movdqu	%xmm3,32(%r13)
+	pxor	64(%rsp),%xmm2
+	movdqu	%xmm5,48(%r13)
+	movdqu	%xmm2,64(%r13)
+	leaq	80(%r13),%r13
+
+	movdqa	80(%rsp),%xmm6
+	jmp	.Lxts_enc_done
+.align	16
+.Lxts_enc_4:
+	pxor	%xmm9,%xmm1
+	leaq	64(%r12),%r12
+	pxor	%xmm10,%xmm2
+	leaq	128(%rsp),%rax
+	movl	%edx,%r10d
+
+	call	_bsaes_encrypt8
+
+	pxor	0(%rsp),%xmm15
+	pxor	16(%rsp),%xmm0
+	movdqu	%xmm15,0(%r13)
+	pxor	32(%rsp),%xmm3
+	movdqu	%xmm0,16(%r13)
+	pxor	48(%rsp),%xmm5
+	movdqu	%xmm3,32(%r13)
+	movdqu	%xmm5,48(%r13)
+	leaq	64(%r13),%r13
+
+	movdqa	64(%rsp),%xmm6
+	jmp	.Lxts_enc_done
+.align	16
+.Lxts_enc_3:
+	pxor	%xmm8,%xmm0
+	leaq	48(%r12),%r12
+	pxor	%xmm9,%xmm1
+	leaq	128(%rsp),%rax
+	movl	%edx,%r10d
+
+	call	_bsaes_encrypt8
+
+	pxor	0(%rsp),%xmm15
+	pxor	16(%rsp),%xmm0
+	movdqu	%xmm15,0(%r13)
+	pxor	32(%rsp),%xmm3
+	movdqu	%xmm0,16(%r13)
+	movdqu	%xmm3,32(%r13)
+	leaq	48(%r13),%r13
+
+	movdqa	48(%rsp),%xmm6
+	jmp	.Lxts_enc_done
+.align	16
+.Lxts_enc_2:
+	pxor	%xmm7,%xmm15
+	leaq	32(%r12),%r12
+	pxor	%xmm8,%xmm0
+	leaq	128(%rsp),%rax
+	movl	%edx,%r10d
+
+	call	_bsaes_encrypt8
+
+	pxor	0(%rsp),%xmm15
+	pxor	16(%rsp),%xmm0
+	movdqu	%xmm15,0(%r13)
+	movdqu	%xmm0,16(%r13)
+	leaq	32(%r13),%r13
+
+	movdqa	32(%rsp),%xmm6
+	jmp	.Lxts_enc_done
+.align	16
+.Lxts_enc_1:
+	pxor	%xmm15,%xmm7
+	leaq	16(%r12),%r12
+	movdqa	%xmm7,32(%rbp)
+	leaq	32(%rbp),%rdi
+	leaq	32(%rbp),%rsi
+	leaq	(%r15),%rdx
+	call	asm_AES_encrypt
+	pxor	32(%rbp),%xmm15
+
+
+
+
+
+	movdqu	%xmm15,0(%r13)
+	leaq	16(%r13),%r13
+
+	movdqa	16(%rsp),%xmm6
+
+.Lxts_enc_done:
+	andl	$15,%ebx
+	jz	.Lxts_enc_ret
+	movq	%r13,%rdx
+
+.Lxts_enc_steal:
+	movzbl	(%r12),%eax
+	movzbl	-16(%rdx),%ecx
+	leaq	1(%r12),%r12
+	movb	%al,-16(%rdx)
+	movb	%cl,0(%rdx)
+	leaq	1(%rdx),%rdx
+	subl	$1,%ebx
+	jnz	.Lxts_enc_steal
+
+	movdqu	-16(%r13),%xmm15
+	leaq	32(%rbp),%rdi
+	pxor	%xmm6,%xmm15
+	leaq	32(%rbp),%rsi
+	movdqa	%xmm15,32(%rbp)
+	leaq	(%r15),%rdx
+	call	asm_AES_encrypt
+	pxor	32(%rbp),%xmm6
+	movdqu	%xmm6,-16(%r13)
+
+.Lxts_enc_ret:
+	leaq	(%rsp),%rax
+	pxor	%xmm0,%xmm0
+.Lxts_enc_bzero:
+	movdqa	%xmm0,0(%rax)
+	movdqa	%xmm0,16(%rax)
+	leaq	32(%rax),%rax
+	cmpq	%rax,%rbp
+	ja	.Lxts_enc_bzero
+
+	leaq	(%rbp),%rsp
+	movq	72(%rsp),%r15
+	movq	80(%rsp),%r14
+	movq	88(%rsp),%r13
+	movq	96(%rsp),%r12
+	movq	104(%rsp),%rbx
+	movq	112(%rsp),%rax
+	leaq	120(%rsp),%rsp
+	movq	%rax,%rbp
+.Lxts_enc_epilogue:
+	.byte	0xf3,0xc3
+.size	bsaes_xts_encrypt,.-bsaes_xts_encrypt
+
+.globl	bsaes_xts_decrypt
+.hidden bsaes_xts_decrypt
+.type	bsaes_xts_decrypt,@function
+.align	16
+bsaes_xts_decrypt:
+	movq	%rsp,%rax
+.Lxts_dec_prologue:
+	pushq	%rbp
+	pushq	%rbx
+	pushq	%r12
+	pushq	%r13
+	pushq	%r14
+	pushq	%r15
+	leaq	-72(%rsp),%rsp
+	movq	%rsp,%rbp
+	movq	%rdi,%r12
+	movq	%rsi,%r13
+	movq	%rdx,%r14
+	movq	%rcx,%r15
+
+	leaq	(%r9),%rdi
+	leaq	32(%rbp),%rsi
+	leaq	(%r8),%rdx
+	call	asm_AES_encrypt
+
+	movl	240(%r15),%eax
+	movq	%r14,%rbx
+
+	movl	%eax,%edx
+	shlq	$7,%rax
+	subq	$96,%rax
+	subq	%rax,%rsp
+
+	movq	%rsp,%rax
+	movq	%r15,%rcx
+	movl	%edx,%r10d
+	call	_bsaes_key_convert
+	pxor	(%rsp),%xmm7
+	movdqa	%xmm6,(%rax)
+	movdqa	%xmm7,(%rsp)
+
+	xorl	%eax,%eax
+	andq	$-16,%r14
+	testl	$15,%ebx
+	setnz	%al
+	shlq	$4,%rax
+	subq	%rax,%r14
+
+	subq	$128,%rsp
+	movdqa	32(%rbp),%xmm6
+
+	pxor	%xmm14,%xmm14
+	movdqa	.Lxts_magic(%rip),%xmm12
+	pcmpgtd	%xmm6,%xmm14
+
+	subq	$128,%r14
+	jc	.Lxts_dec_short
+	jmp	.Lxts_dec_loop
+
+.align	16
+.Lxts_dec_loop:
+	pshufd	$19,%xmm14,%xmm13
+	pxor	%xmm14,%xmm14
+	movdqa	%xmm6,%xmm15
+	movdqa	%xmm6,0(%rsp)
+	paddq	%xmm6,%xmm6
+	pand	%xmm12,%xmm13
+	pcmpgtd	%xmm6,%xmm14
+	pxor	%xmm13,%xmm6
+	pshufd	$19,%xmm14,%xmm13
+	pxor	%xmm14,%xmm14
+	movdqa	%xmm6,%xmm0
+	movdqa	%xmm6,16(%rsp)
+	paddq	%xmm6,%xmm6
+	pand	%xmm12,%xmm13
+	pcmpgtd	%xmm6,%xmm14
+	pxor	%xmm13,%xmm6
+	movdqu	0(%r12),%xmm7
+	pshufd	$19,%xmm14,%xmm13
+	pxor	%xmm14,%xmm14
+	movdqa	%xmm6,%xmm1
+	movdqa	%xmm6,32(%rsp)
+	paddq	%xmm6,%xmm6
+	pand	%xmm12,%xmm13
+	pcmpgtd	%xmm6,%xmm14
+	pxor	%xmm13,%xmm6
+	movdqu	16(%r12),%xmm8
+	pxor	%xmm7,%xmm15
+	pshufd	$19,%xmm14,%xmm13
+	pxor	%xmm14,%xmm14
+	movdqa	%xmm6,%xmm2
+	movdqa	%xmm6,48(%rsp)
+	paddq	%xmm6,%xmm6
+	pand	%xmm12,%xmm13
+	pcmpgtd	%xmm6,%xmm14
+	pxor	%xmm13,%xmm6
+	movdqu	32(%r12),%xmm9
+	pxor	%xmm8,%xmm0
+	pshufd	$19,%xmm14,%xmm13
+	pxor	%xmm14,%xmm14
+	movdqa	%xmm6,%xmm3
+	movdqa	%xmm6,64(%rsp)
+	paddq	%xmm6,%xmm6
+	pand	%xmm12,%xmm13
+	pcmpgtd	%xmm6,%xmm14
+	pxor	%xmm13,%xmm6
+	movdqu	48(%r12),%xmm10
+	pxor	%xmm9,%xmm1
+	pshufd	$19,%xmm14,%xmm13
+	pxor	%xmm14,%xmm14
+	movdqa	%xmm6,%xmm4
+	movdqa	%xmm6,80(%rsp)
+	paddq	%xmm6,%xmm6
+	pand	%xmm12,%xmm13
+	pcmpgtd	%xmm6,%xmm14
+	pxor	%xmm13,%xmm6
+	movdqu	64(%r12),%xmm11
+	pxor	%xmm10,%xmm2
+	pshufd	$19,%xmm14,%xmm13
+	pxor	%xmm14,%xmm14
+	movdqa	%xmm6,%xmm5
+	movdqa	%xmm6,96(%rsp)
+	paddq	%xmm6,%xmm6
+	pand	%xmm12,%xmm13
+	pcmpgtd	%xmm6,%xmm14
+	pxor	%xmm13,%xmm6
+	movdqu	80(%r12),%xmm12
+	pxor	%xmm11,%xmm3
+	movdqu	96(%r12),%xmm13
+	pxor	%xmm12,%xmm4
+	movdqu	112(%r12),%xmm14
+	leaq	128(%r12),%r12
+	movdqa	%xmm6,112(%rsp)
+	pxor	%xmm13,%xmm5
+	leaq	128(%rsp),%rax
+	pxor	%xmm14,%xmm6
+	movl	%edx,%r10d
+
+	call	_bsaes_decrypt8
+
+	pxor	0(%rsp),%xmm15
+	pxor	16(%rsp),%xmm0
+	movdqu	%xmm15,0(%r13)
+	pxor	32(%rsp),%xmm5
+	movdqu	%xmm0,16(%r13)
+	pxor	48(%rsp),%xmm3
+	movdqu	%xmm5,32(%r13)
+	pxor	64(%rsp),%xmm1
+	movdqu	%xmm3,48(%r13)
+	pxor	80(%rsp),%xmm6
+	movdqu	%xmm1,64(%r13)
+	pxor	96(%rsp),%xmm2
+	movdqu	%xmm6,80(%r13)
+	pxor	112(%rsp),%xmm4
+	movdqu	%xmm2,96(%r13)
+	movdqu	%xmm4,112(%r13)
+	leaq	128(%r13),%r13
+
+	movdqa	112(%rsp),%xmm6
+	pxor	%xmm14,%xmm14
+	movdqa	.Lxts_magic(%rip),%xmm12
+	pcmpgtd	%xmm6,%xmm14
+	pshufd	$19,%xmm14,%xmm13
+	pxor	%xmm14,%xmm14
+	paddq	%xmm6,%xmm6
+	pand	%xmm12,%xmm13
+	pcmpgtd	%xmm6,%xmm14
+	pxor	%xmm13,%xmm6
+
+	subq	$128,%r14
+	jnc	.Lxts_dec_loop
+
+.Lxts_dec_short:
+	addq	$128,%r14
+	jz	.Lxts_dec_done
+	pshufd	$19,%xmm14,%xmm13
+	pxor	%xmm14,%xmm14
+	movdqa	%xmm6,%xmm15
+	movdqa	%xmm6,0(%rsp)
+	paddq	%xmm6,%xmm6
+	pand	%xmm12,%xmm13
+	pcmpgtd	%xmm6,%xmm14
+	pxor	%xmm13,%xmm6
+	pshufd	$19,%xmm14,%xmm13
+	pxor	%xmm14,%xmm14
+	movdqa	%xmm6,%xmm0
+	movdqa	%xmm6,16(%rsp)
+	paddq	%xmm6,%xmm6
+	pand	%xmm12,%xmm13
+	pcmpgtd	%xmm6,%xmm14
+	pxor	%xmm13,%xmm6
+	movdqu	0(%r12),%xmm7
+	cmpq	$16,%r14
+	je	.Lxts_dec_1
+	pshufd	$19,%xmm14,%xmm13
+	pxor	%xmm14,%xmm14
+	movdqa	%xmm6,%xmm1
+	movdqa	%xmm6,32(%rsp)
+	paddq	%xmm6,%xmm6
+	pand	%xmm12,%xmm13
+	pcmpgtd	%xmm6,%xmm14
+	pxor	%xmm13,%xmm6
+	movdqu	16(%r12),%xmm8
+	cmpq	$32,%r14
+	je	.Lxts_dec_2
+	pxor	%xmm7,%xmm15
+	pshufd	$19,%xmm14,%xmm13
+	pxor	%xmm14,%xmm14
+	movdqa	%xmm6,%xmm2
+	movdqa	%xmm6,48(%rsp)
+	paddq	%xmm6,%xmm6
+	pand	%xmm12,%xmm13
+	pcmpgtd	%xmm6,%xmm14
+	pxor	%xmm13,%xmm6
+	movdqu	32(%r12),%xmm9
+	cmpq	$48,%r14
+	je	.Lxts_dec_3
+	pxor	%xmm8,%xmm0
+	pshufd	$19,%xmm14,%xmm13
+	pxor	%xmm14,%xmm14
+	movdqa	%xmm6,%xmm3
+	movdqa	%xmm6,64(%rsp)
+	paddq	%xmm6,%xmm6
+	pand	%xmm12,%xmm13
+	pcmpgtd	%xmm6,%xmm14
+	pxor	%xmm13,%xmm6
+	movdqu	48(%r12),%xmm10
+	cmpq	$64,%r14
+	je	.Lxts_dec_4
+	pxor	%xmm9,%xmm1
+	pshufd	$19,%xmm14,%xmm13
+	pxor	%xmm14,%xmm14
+	movdqa	%xmm6,%xmm4
+	movdqa	%xmm6,80(%rsp)
+	paddq	%xmm6,%xmm6
+	pand	%xmm12,%xmm13
+	pcmpgtd	%xmm6,%xmm14
+	pxor	%xmm13,%xmm6
+	movdqu	64(%r12),%xmm11
+	cmpq	$80,%r14
+	je	.Lxts_dec_5
+	pxor	%xmm10,%xmm2
+	pshufd	$19,%xmm14,%xmm13
+	pxor	%xmm14,%xmm14
+	movdqa	%xmm6,%xmm5
+	movdqa	%xmm6,96(%rsp)
+	paddq	%xmm6,%xmm6
+	pand	%xmm12,%xmm13
+	pcmpgtd	%xmm6,%xmm14
+	pxor	%xmm13,%xmm6
+	movdqu	80(%r12),%xmm12
+	cmpq	$96,%r14
+	je	.Lxts_dec_6
+	pxor	%xmm11,%xmm3
+	movdqu	96(%r12),%xmm13
+	pxor	%xmm12,%xmm4
+	movdqa	%xmm6,112(%rsp)
+	leaq	112(%r12),%r12
+	pxor	%xmm13,%xmm5
+	leaq	128(%rsp),%rax
+	movl	%edx,%r10d
+
+	call	_bsaes_decrypt8
+
+	pxor	0(%rsp),%xmm15
+	pxor	16(%rsp),%xmm0
+	movdqu	%xmm15,0(%r13)
+	pxor	32(%rsp),%xmm5
+	movdqu	%xmm0,16(%r13)
+	pxor	48(%rsp),%xmm3
+	movdqu	%xmm5,32(%r13)
+	pxor	64(%rsp),%xmm1
+	movdqu	%xmm3,48(%r13)
+	pxor	80(%rsp),%xmm6
+	movdqu	%xmm1,64(%r13)
+	pxor	96(%rsp),%xmm2
+	movdqu	%xmm6,80(%r13)
+	movdqu	%xmm2,96(%r13)
+	leaq	112(%r13),%r13
+
+	movdqa	112(%rsp),%xmm6
+	jmp	.Lxts_dec_done
+.align	16
+.Lxts_dec_6:
+	pxor	%xmm11,%xmm3
+	leaq	96(%r12),%r12
+	pxor	%xmm12,%xmm4
+	leaq	128(%rsp),%rax
+	movl	%edx,%r10d
+
+	call	_bsaes_decrypt8
+
+	pxor	0(%rsp),%xmm15
+	pxor	16(%rsp),%xmm0
+	movdqu	%xmm15,0(%r13)
+	pxor	32(%rsp),%xmm5
+	movdqu	%xmm0,16(%r13)
+	pxor	48(%rsp),%xmm3
+	movdqu	%xmm5,32(%r13)
+	pxor	64(%rsp),%xmm1
+	movdqu	%xmm3,48(%r13)
+	pxor	80(%rsp),%xmm6
+	movdqu	%xmm1,64(%r13)
+	movdqu	%xmm6,80(%r13)
+	leaq	96(%r13),%r13
+
+	movdqa	96(%rsp),%xmm6
+	jmp	.Lxts_dec_done
+.align	16
+.Lxts_dec_5:
+	pxor	%xmm10,%xmm2
+	leaq	80(%r12),%r12
+	pxor	%xmm11,%xmm3
+	leaq	128(%rsp),%rax
+	movl	%edx,%r10d
+
+	call	_bsaes_decrypt8
+
+	pxor	0(%rsp),%xmm15
+	pxor	16(%rsp),%xmm0
+	movdqu	%xmm15,0(%r13)
+	pxor	32(%rsp),%xmm5
+	movdqu	%xmm0,16(%r13)
+	pxor	48(%rsp),%xmm3
+	movdqu	%xmm5,32(%r13)
+	pxor	64(%rsp),%xmm1
+	movdqu	%xmm3,48(%r13)
+	movdqu	%xmm1,64(%r13)
+	leaq	80(%r13),%r13
+
+	movdqa	80(%rsp),%xmm6
+	jmp	.Lxts_dec_done
+.align	16
+.Lxts_dec_4:
+	pxor	%xmm9,%xmm1
+	leaq	64(%r12),%r12
+	pxor	%xmm10,%xmm2
+	leaq	128(%rsp),%rax
+	movl	%edx,%r10d
+
+	call	_bsaes_decrypt8
+
+	pxor	0(%rsp),%xmm15
+	pxor	16(%rsp),%xmm0
+	movdqu	%xmm15,0(%r13)
+	pxor	32(%rsp),%xmm5
+	movdqu	%xmm0,16(%r13)
+	pxor	48(%rsp),%xmm3
+	movdqu	%xmm5,32(%r13)
+	movdqu	%xmm3,48(%r13)
+	leaq	64(%r13),%r13
+
+	movdqa	64(%rsp),%xmm6
+	jmp	.Lxts_dec_done
+.align	16
+.Lxts_dec_3:
+	pxor	%xmm8,%xmm0
+	leaq	48(%r12),%r12
+	pxor	%xmm9,%xmm1
+	leaq	128(%rsp),%rax
+	movl	%edx,%r10d
+
+	call	_bsaes_decrypt8
+
+	pxor	0(%rsp),%xmm15
+	pxor	16(%rsp),%xmm0
+	movdqu	%xmm15,0(%r13)
+	pxor	32(%rsp),%xmm5
+	movdqu	%xmm0,16(%r13)
+	movdqu	%xmm5,32(%r13)
+	leaq	48(%r13),%r13
+
+	movdqa	48(%rsp),%xmm6
+	jmp	.Lxts_dec_done
+.align	16
+.Lxts_dec_2:
+	pxor	%xmm7,%xmm15
+	leaq	32(%r12),%r12
+	pxor	%xmm8,%xmm0
+	leaq	128(%rsp),%rax
+	movl	%edx,%r10d
+
+	call	_bsaes_decrypt8
+
+	pxor	0(%rsp),%xmm15
+	pxor	16(%rsp),%xmm0
+	movdqu	%xmm15,0(%r13)
+	movdqu	%xmm0,16(%r13)
+	leaq	32(%r13),%r13
+
+	movdqa	32(%rsp),%xmm6
+	jmp	.Lxts_dec_done
+.align	16
+.Lxts_dec_1:
+	pxor	%xmm15,%xmm7
+	leaq	16(%r12),%r12
+	movdqa	%xmm7,32(%rbp)
+	leaq	32(%rbp),%rdi
+	leaq	32(%rbp),%rsi
+	leaq	(%r15),%rdx
+	call	asm_AES_decrypt
+	pxor	32(%rbp),%xmm15
+
+
+
+
+
+	movdqu	%xmm15,0(%r13)
+	leaq	16(%r13),%r13
+
+	movdqa	16(%rsp),%xmm6
+
+.Lxts_dec_done:
+	andl	$15,%ebx
+	jz	.Lxts_dec_ret
+
+	pxor	%xmm14,%xmm14
+	movdqa	.Lxts_magic(%rip),%xmm12
+	pcmpgtd	%xmm6,%xmm14
+	pshufd	$19,%xmm14,%xmm13
+	movdqa	%xmm6,%xmm5
+	paddq	%xmm6,%xmm6
+	pand	%xmm12,%xmm13
+	movdqu	(%r12),%xmm15
+	pxor	%xmm13,%xmm6
+
+	leaq	32(%rbp),%rdi
+	pxor	%xmm6,%xmm15
+	leaq	32(%rbp),%rsi
+	movdqa	%xmm15,32(%rbp)
+	leaq	(%r15),%rdx
+	call	asm_AES_decrypt
+	pxor	32(%rbp),%xmm6
+	movq	%r13,%rdx
+	movdqu	%xmm6,(%r13)
+
+.Lxts_dec_steal:
+	movzbl	16(%r12),%eax
+	movzbl	(%rdx),%ecx
+	leaq	1(%r12),%r12
+	movb	%al,(%rdx)
+	movb	%cl,16(%rdx)
+	leaq	1(%rdx),%rdx
+	subl	$1,%ebx
+	jnz	.Lxts_dec_steal
+
+	movdqu	(%r13),%xmm15
+	leaq	32(%rbp),%rdi
+	pxor	%xmm5,%xmm15
+	leaq	32(%rbp),%rsi
+	movdqa	%xmm15,32(%rbp)
+	leaq	(%r15),%rdx
+	call	asm_AES_decrypt
+	pxor	32(%rbp),%xmm5
+	movdqu	%xmm5,(%r13)
+
+.Lxts_dec_ret:
+	leaq	(%rsp),%rax
+	pxor	%xmm0,%xmm0
+.Lxts_dec_bzero:
+	movdqa	%xmm0,0(%rax)
+	movdqa	%xmm0,16(%rax)
+	leaq	32(%rax),%rax
+	cmpq	%rax,%rbp
+	ja	.Lxts_dec_bzero
+
+	leaq	(%rbp),%rsp
+	movq	72(%rsp),%r15
+	movq	80(%rsp),%r14
+	movq	88(%rsp),%r13
+	movq	96(%rsp),%r12
+	movq	104(%rsp),%rbx
+	movq	112(%rsp),%rax
+	leaq	120(%rsp),%rsp
+	movq	%rax,%rbp
+.Lxts_dec_epilogue:
+	.byte	0xf3,0xc3
+.size	bsaes_xts_decrypt,.-bsaes_xts_decrypt
+.type	_bsaes_const,@object
+.align	64
+_bsaes_const:
+.LM0ISR:
+.quad	0x0a0e0206070b0f03, 0x0004080c0d010509
+.LISRM0:
+.quad	0x01040b0e0205080f, 0x0306090c00070a0d
+.LISR:
+.quad	0x0504070602010003, 0x0f0e0d0c080b0a09
+.LBS0:
+.quad	0x5555555555555555, 0x5555555555555555
+.LBS1:
+.quad	0x3333333333333333, 0x3333333333333333
+.LBS2:
+.quad	0x0f0f0f0f0f0f0f0f, 0x0f0f0f0f0f0f0f0f
+.LSR:
+.quad	0x0504070600030201, 0x0f0e0d0c0a09080b
+.LSRM0:
+.quad	0x0304090e00050a0f, 0x01060b0c0207080d
+.LM0SR:
+.quad	0x0a0e02060f03070b, 0x0004080c05090d01
+.LSWPUP:
+.quad	0x0706050403020100, 0x0c0d0e0f0b0a0908
+.LSWPUPM0SR:
+.quad	0x0a0d02060c03070b, 0x0004080f05090e01
+.LADD1:
+.quad	0x0000000000000000, 0x0000000100000000
+.LADD2:
+.quad	0x0000000000000000, 0x0000000200000000
+.LADD3:
+.quad	0x0000000000000000, 0x0000000300000000
+.LADD4:
+.quad	0x0000000000000000, 0x0000000400000000
+.LADD5:
+.quad	0x0000000000000000, 0x0000000500000000
+.LADD6:
+.quad	0x0000000000000000, 0x0000000600000000
+.LADD7:
+.quad	0x0000000000000000, 0x0000000700000000
+.LADD8:
+.quad	0x0000000000000000, 0x0000000800000000
+.Lxts_magic:
+.long	0x87,0,1,0
+.Lmasks:
+.quad	0x0101010101010101, 0x0101010101010101
+.quad	0x0202020202020202, 0x0202020202020202
+.quad	0x0404040404040404, 0x0404040404040404
+.quad	0x0808080808080808, 0x0808080808080808
+.LM0:
+.quad	0x02060a0e03070b0f, 0x0004080c0105090d
+.L63:
+.quad	0x6363636363636363, 0x6363636363636363
+.byte	66,105,116,45,115,108,105,99,101,100,32,65,69,83,32,102,111,114,32,120,56,54,95,54,52,47,83,83,83,69,51,44,32,69,109,105,108,105,97,32,75,195,164,115,112,101,114,44,32,80,101,116,101,114,32,83,99,104,119,97,98,101,44,32,65,110,100,121,32,80,111,108,121,97,107,111,118,0
+.align	64
+.size	_bsaes_const,.-_bsaes_const
+#endif
diff --git a/third_party/boringssl/linux-x86_64/crypto/aes/vpaes-x86_64.S b/third_party/boringssl/linux-x86_64/crypto/aes/vpaes-x86_64.S
new file mode 100644
index 0000000..1d12424
--- /dev/null
+++ b/third_party/boringssl/linux-x86_64/crypto/aes/vpaes-x86_64.S
@@ -0,0 +1,834 @@
+#if defined(__x86_64__)
+.text	
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+.type	_vpaes_encrypt_core,@function
+.align	16
+_vpaes_encrypt_core:
+	movq	%rdx,%r9
+	movq	$16,%r11
+	movl	240(%rdx),%eax
+	movdqa	%xmm9,%xmm1
+	movdqa	.Lk_ipt(%rip),%xmm2
+	pandn	%xmm0,%xmm1
+	movdqu	(%r9),%xmm5
+	psrld	$4,%xmm1
+	pand	%xmm9,%xmm0
+.byte	102,15,56,0,208
+	movdqa	.Lk_ipt+16(%rip),%xmm0
+.byte	102,15,56,0,193
+	pxor	%xmm5,%xmm2
+	addq	$16,%r9
+	pxor	%xmm2,%xmm0
+	leaq	.Lk_mc_backward(%rip),%r10
+	jmp	.Lenc_entry
+
+.align	16
+.Lenc_loop:
+
+	movdqa	%xmm13,%xmm4
+	movdqa	%xmm12,%xmm0
+.byte	102,15,56,0,226
+.byte	102,15,56,0,195
+	pxor	%xmm5,%xmm4
+	movdqa	%xmm15,%xmm5
+	pxor	%xmm4,%xmm0
+	movdqa	-64(%r11,%r10,1),%xmm1
+.byte	102,15,56,0,234
+	movdqa	(%r11,%r10,1),%xmm4
+	movdqa	%xmm14,%xmm2
+.byte	102,15,56,0,211
+	movdqa	%xmm0,%xmm3
+	pxor	%xmm5,%xmm2
+.byte	102,15,56,0,193
+	addq	$16,%r9
+	pxor	%xmm2,%xmm0
+.byte	102,15,56,0,220
+	addq	$16,%r11
+	pxor	%xmm0,%xmm3
+.byte	102,15,56,0,193
+	andq	$48,%r11
+	subq	$1,%rax
+	pxor	%xmm3,%xmm0
+
+.Lenc_entry:
+
+	movdqa	%xmm9,%xmm1
+	movdqa	%xmm11,%xmm5
+	pandn	%xmm0,%xmm1
+	psrld	$4,%xmm1
+	pand	%xmm9,%xmm0
+.byte	102,15,56,0,232
+	movdqa	%xmm10,%xmm3
+	pxor	%xmm1,%xmm0
+.byte	102,15,56,0,217
+	movdqa	%xmm10,%xmm4
+	pxor	%xmm5,%xmm3
+.byte	102,15,56,0,224
+	movdqa	%xmm10,%xmm2
+	pxor	%xmm5,%xmm4
+.byte	102,15,56,0,211
+	movdqa	%xmm10,%xmm3
+	pxor	%xmm0,%xmm2
+.byte	102,15,56,0,220
+	movdqu	(%r9),%xmm5
+	pxor	%xmm1,%xmm3
+	jnz	.Lenc_loop
+
+
+	movdqa	-96(%r10),%xmm4
+	movdqa	-80(%r10),%xmm0
+.byte	102,15,56,0,226
+	pxor	%xmm5,%xmm4
+.byte	102,15,56,0,195
+	movdqa	64(%r11,%r10,1),%xmm1
+	pxor	%xmm4,%xmm0
+.byte	102,15,56,0,193
+	.byte	0xf3,0xc3
+.size	_vpaes_encrypt_core,.-_vpaes_encrypt_core
+
+
+
+
+
+
+.type	_vpaes_decrypt_core,@function
+.align	16
+_vpaes_decrypt_core:
+	movq	%rdx,%r9
+	movl	240(%rdx),%eax
+	movdqa	%xmm9,%xmm1
+	movdqa	.Lk_dipt(%rip),%xmm2
+	pandn	%xmm0,%xmm1
+	movq	%rax,%r11
+	psrld	$4,%xmm1
+	movdqu	(%r9),%xmm5
+	shlq	$4,%r11
+	pand	%xmm9,%xmm0
+.byte	102,15,56,0,208
+	movdqa	.Lk_dipt+16(%rip),%xmm0
+	xorq	$48,%r11
+	leaq	.Lk_dsbd(%rip),%r10
+.byte	102,15,56,0,193
+	andq	$48,%r11
+	pxor	%xmm5,%xmm2
+	movdqa	.Lk_mc_forward+48(%rip),%xmm5
+	pxor	%xmm2,%xmm0
+	addq	$16,%r9
+	addq	%r10,%r11
+	jmp	.Ldec_entry
+
+.align	16
+.Ldec_loop:
+
+
+
+	movdqa	-32(%r10),%xmm4
+	movdqa	-16(%r10),%xmm1
+.byte	102,15,56,0,226
+.byte	102,15,56,0,203
+	pxor	%xmm4,%xmm0
+	movdqa	0(%r10),%xmm4
+	pxor	%xmm1,%xmm0
+	movdqa	16(%r10),%xmm1
+
+.byte	102,15,56,0,226
+.byte	102,15,56,0,197
+.byte	102,15,56,0,203
+	pxor	%xmm4,%xmm0
+	movdqa	32(%r10),%xmm4
+	pxor	%xmm1,%xmm0
+	movdqa	48(%r10),%xmm1
+
+.byte	102,15,56,0,226
+.byte	102,15,56,0,197
+.byte	102,15,56,0,203
+	pxor	%xmm4,%xmm0
+	movdqa	64(%r10),%xmm4
+	pxor	%xmm1,%xmm0
+	movdqa	80(%r10),%xmm1
+
+.byte	102,15,56,0,226
+.byte	102,15,56,0,197
+.byte	102,15,56,0,203
+	pxor	%xmm4,%xmm0
+	addq	$16,%r9
+.byte	102,15,58,15,237,12
+	pxor	%xmm1,%xmm0
+	subq	$1,%rax
+
+.Ldec_entry:
+
+	movdqa	%xmm9,%xmm1
+	pandn	%xmm0,%xmm1
+	movdqa	%xmm11,%xmm2
+	psrld	$4,%xmm1
+	pand	%xmm9,%xmm0
+.byte	102,15,56,0,208
+	movdqa	%xmm10,%xmm3
+	pxor	%xmm1,%xmm0
+.byte	102,15,56,0,217
+	movdqa	%xmm10,%xmm4
+	pxor	%xmm2,%xmm3
+.byte	102,15,56,0,224
+	pxor	%xmm2,%xmm4
+	movdqa	%xmm10,%xmm2
+.byte	102,15,56,0,211
+	movdqa	%xmm10,%xmm3
+	pxor	%xmm0,%xmm2
+.byte	102,15,56,0,220
+	movdqu	(%r9),%xmm0
+	pxor	%xmm1,%xmm3
+	jnz	.Ldec_loop
+
+
+	movdqa	96(%r10),%xmm4
+.byte	102,15,56,0,226
+	pxor	%xmm0,%xmm4
+	movdqa	112(%r10),%xmm0
+	movdqa	-352(%r11),%xmm2
+.byte	102,15,56,0,195
+	pxor	%xmm4,%xmm0
+.byte	102,15,56,0,194
+	.byte	0xf3,0xc3
+.size	_vpaes_decrypt_core,.-_vpaes_decrypt_core
+
+
+
+
+
+
+.type	_vpaes_schedule_core,@function
+.align	16
+_vpaes_schedule_core:
+
+
+
+
+
+	call	_vpaes_preheat
+	movdqa	.Lk_rcon(%rip),%xmm8
+	movdqu	(%rdi),%xmm0
+
+
+	movdqa	%xmm0,%xmm3
+	leaq	.Lk_ipt(%rip),%r11
+	call	_vpaes_schedule_transform
+	movdqa	%xmm0,%xmm7
+
+	leaq	.Lk_sr(%rip),%r10
+	testq	%rcx,%rcx
+	jnz	.Lschedule_am_decrypting
+
+
+	movdqu	%xmm0,(%rdx)
+	jmp	.Lschedule_go
+
+.Lschedule_am_decrypting:
+
+	movdqa	(%r8,%r10,1),%xmm1
+.byte	102,15,56,0,217
+	movdqu	%xmm3,(%rdx)
+	xorq	$48,%r8
+
+.Lschedule_go:
+	cmpl	$192,%esi
+	ja	.Lschedule_256
+	je	.Lschedule_192
+
+
+
+
+
+
+
+
+
+
+.Lschedule_128:
+	movl	$10,%esi
+
+.Loop_schedule_128:
+	call	_vpaes_schedule_round
+	decq	%rsi
+	jz	.Lschedule_mangle_last
+	call	_vpaes_schedule_mangle
+	jmp	.Loop_schedule_128
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+.align	16
+.Lschedule_192:
+	movdqu	8(%rdi),%xmm0
+	call	_vpaes_schedule_transform
+	movdqa	%xmm0,%xmm6
+	pxor	%xmm4,%xmm4
+	movhlps	%xmm4,%xmm6
+	movl	$4,%esi
+
+.Loop_schedule_192:
+	call	_vpaes_schedule_round
+.byte	102,15,58,15,198,8
+	call	_vpaes_schedule_mangle
+	call	_vpaes_schedule_192_smear
+	call	_vpaes_schedule_mangle
+	call	_vpaes_schedule_round
+	decq	%rsi
+	jz	.Lschedule_mangle_last
+	call	_vpaes_schedule_mangle
+	call	_vpaes_schedule_192_smear
+	jmp	.Loop_schedule_192
+
+
+
+
+
+
+
+
+
+
+
+.align	16
+.Lschedule_256:
+	movdqu	16(%rdi),%xmm0
+	call	_vpaes_schedule_transform
+	movl	$7,%esi
+
+.Loop_schedule_256:
+	call	_vpaes_schedule_mangle
+	movdqa	%xmm0,%xmm6
+
+
+	call	_vpaes_schedule_round
+	decq	%rsi
+	jz	.Lschedule_mangle_last
+	call	_vpaes_schedule_mangle
+
+
+	pshufd	$255,%xmm0,%xmm0
+	movdqa	%xmm7,%xmm5
+	movdqa	%xmm6,%xmm7
+	call	_vpaes_schedule_low_round
+	movdqa	%xmm5,%xmm7
+
+	jmp	.Loop_schedule_256
+
+
+
+
+
+
+
+
+
+
+
+
+.align	16
+.Lschedule_mangle_last:
+
+	leaq	.Lk_deskew(%rip),%r11
+	testq	%rcx,%rcx
+	jnz	.Lschedule_mangle_last_dec
+
+
+	movdqa	(%r8,%r10,1),%xmm1
+.byte	102,15,56,0,193
+	leaq	.Lk_opt(%rip),%r11
+	addq	$32,%rdx
+
+.Lschedule_mangle_last_dec:
+	addq	$-16,%rdx
+	pxor	.Lk_s63(%rip),%xmm0
+	call	_vpaes_schedule_transform
+	movdqu	%xmm0,(%rdx)
+
+
+	pxor	%xmm0,%xmm0
+	pxor	%xmm1,%xmm1
+	pxor	%xmm2,%xmm2
+	pxor	%xmm3,%xmm3
+	pxor	%xmm4,%xmm4
+	pxor	%xmm5,%xmm5
+	pxor	%xmm6,%xmm6
+	pxor	%xmm7,%xmm7
+	.byte	0xf3,0xc3
+.size	_vpaes_schedule_core,.-_vpaes_schedule_core
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+.type	_vpaes_schedule_192_smear,@function
+.align	16
+_vpaes_schedule_192_smear:
+	pshufd	$128,%xmm6,%xmm1
+	pshufd	$254,%xmm7,%xmm0
+	pxor	%xmm1,%xmm6
+	pxor	%xmm1,%xmm1
+	pxor	%xmm0,%xmm6
+	movdqa	%xmm6,%xmm0
+	movhlps	%xmm1,%xmm6
+	.byte	0xf3,0xc3
+.size	_vpaes_schedule_192_smear,.-_vpaes_schedule_192_smear
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+.type	_vpaes_schedule_round,@function
+.align	16
+_vpaes_schedule_round:
+
+	pxor	%xmm1,%xmm1
+.byte	102,65,15,58,15,200,15
+.byte	102,69,15,58,15,192,15
+	pxor	%xmm1,%xmm7
+
+
+	pshufd	$255,%xmm0,%xmm0
+.byte	102,15,58,15,192,1
+
+
+
+
+_vpaes_schedule_low_round:
+
+	movdqa	%xmm7,%xmm1
+	pslldq	$4,%xmm7
+	pxor	%xmm1,%xmm7
+	movdqa	%xmm7,%xmm1
+	pslldq	$8,%xmm7
+	pxor	%xmm1,%xmm7
+	pxor	.Lk_s63(%rip),%xmm7
+
+
+	movdqa	%xmm9,%xmm1
+	pandn	%xmm0,%xmm1
+	psrld	$4,%xmm1
+	pand	%xmm9,%xmm0
+	movdqa	%xmm11,%xmm2
+.byte	102,15,56,0,208
+	pxor	%xmm1,%xmm0
+	movdqa	%xmm10,%xmm3
+.byte	102,15,56,0,217
+	pxor	%xmm2,%xmm3
+	movdqa	%xmm10,%xmm4
+.byte	102,15,56,0,224
+	pxor	%xmm2,%xmm4
+	movdqa	%xmm10,%xmm2
+.byte	102,15,56,0,211
+	pxor	%xmm0,%xmm2
+	movdqa	%xmm10,%xmm3
+.byte	102,15,56,0,220
+	pxor	%xmm1,%xmm3
+	movdqa	%xmm13,%xmm4
+.byte	102,15,56,0,226
+	movdqa	%xmm12,%xmm0
+.byte	102,15,56,0,195
+	pxor	%xmm4,%xmm0
+
+
+	pxor	%xmm7,%xmm0
+	movdqa	%xmm0,%xmm7
+	.byte	0xf3,0xc3
+.size	_vpaes_schedule_round,.-_vpaes_schedule_round
+
+
+
+
+
+
+
+
+
+
+.type	_vpaes_schedule_transform,@function
+.align	16
+_vpaes_schedule_transform:
+	movdqa	%xmm9,%xmm1
+	pandn	%xmm0,%xmm1
+	psrld	$4,%xmm1
+	pand	%xmm9,%xmm0
+	movdqa	(%r11),%xmm2
+.byte	102,15,56,0,208
+	movdqa	16(%r11),%xmm0
+.byte	102,15,56,0,193
+	pxor	%xmm2,%xmm0
+	.byte	0xf3,0xc3
+.size	_vpaes_schedule_transform,.-_vpaes_schedule_transform
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+.type	_vpaes_schedule_mangle,@function
+.align	16
+_vpaes_schedule_mangle:
+	movdqa	%xmm0,%xmm4
+	movdqa	.Lk_mc_forward(%rip),%xmm5
+	testq	%rcx,%rcx
+	jnz	.Lschedule_mangle_dec
+
+
+	addq	$16,%rdx
+	pxor	.Lk_s63(%rip),%xmm4
+.byte	102,15,56,0,229
+	movdqa	%xmm4,%xmm3
+.byte	102,15,56,0,229
+	pxor	%xmm4,%xmm3
+.byte	102,15,56,0,229
+	pxor	%xmm4,%xmm3
+
+	jmp	.Lschedule_mangle_both
+.align	16
+.Lschedule_mangle_dec:
+
+	leaq	.Lk_dksd(%rip),%r11
+	movdqa	%xmm9,%xmm1
+	pandn	%xmm4,%xmm1
+	psrld	$4,%xmm1
+	pand	%xmm9,%xmm4
+
+	movdqa	0(%r11),%xmm2
+.byte	102,15,56,0,212
+	movdqa	16(%r11),%xmm3
+.byte	102,15,56,0,217
+	pxor	%xmm2,%xmm3
+.byte	102,15,56,0,221
+
+	movdqa	32(%r11),%xmm2
+.byte	102,15,56,0,212
+	pxor	%xmm3,%xmm2
+	movdqa	48(%r11),%xmm3
+.byte	102,15,56,0,217
+	pxor	%xmm2,%xmm3
+.byte	102,15,56,0,221
+
+	movdqa	64(%r11),%xmm2
+.byte	102,15,56,0,212
+	pxor	%xmm3,%xmm2
+	movdqa	80(%r11),%xmm3
+.byte	102,15,56,0,217
+	pxor	%xmm2,%xmm3
+.byte	102,15,56,0,221
+
+	movdqa	96(%r11),%xmm2
+.byte	102,15,56,0,212
+	pxor	%xmm3,%xmm2
+	movdqa	112(%r11),%xmm3
+.byte	102,15,56,0,217
+	pxor	%xmm2,%xmm3
+
+	addq	$-16,%rdx
+
+.Lschedule_mangle_both:
+	movdqa	(%r8,%r10,1),%xmm1
+.byte	102,15,56,0,217
+	addq	$-16,%r8
+	andq	$48,%r8
+	movdqu	%xmm3,(%rdx)
+	.byte	0xf3,0xc3
+.size	_vpaes_schedule_mangle,.-_vpaes_schedule_mangle
+
+
+
+
+.globl	vpaes_set_encrypt_key
+.hidden vpaes_set_encrypt_key
+.type	vpaes_set_encrypt_key,@function
+.align	16
+vpaes_set_encrypt_key:
+	movl	%esi,%eax
+	shrl	$5,%eax
+	addl	$5,%eax
+	movl	%eax,240(%rdx)
+
+	movl	$0,%ecx
+	movl	$48,%r8d
+	call	_vpaes_schedule_core
+	xorl	%eax,%eax
+	.byte	0xf3,0xc3
+.size	vpaes_set_encrypt_key,.-vpaes_set_encrypt_key
+
+.globl	vpaes_set_decrypt_key
+.hidden vpaes_set_decrypt_key
+.type	vpaes_set_decrypt_key,@function
+.align	16
+vpaes_set_decrypt_key:
+	movl	%esi,%eax
+	shrl	$5,%eax
+	addl	$5,%eax
+	movl	%eax,240(%rdx)
+	shll	$4,%eax
+	leaq	16(%rdx,%rax,1),%rdx
+
+	movl	$1,%ecx
+	movl	%esi,%r8d
+	shrl	$1,%r8d
+	andl	$32,%r8d
+	xorl	$32,%r8d
+	call	_vpaes_schedule_core
+	xorl	%eax,%eax
+	.byte	0xf3,0xc3
+.size	vpaes_set_decrypt_key,.-vpaes_set_decrypt_key
+
+.globl	vpaes_encrypt
+.hidden vpaes_encrypt
+.type	vpaes_encrypt,@function
+.align	16
+vpaes_encrypt:
+	movdqu	(%rdi),%xmm0
+	call	_vpaes_preheat
+	call	_vpaes_encrypt_core
+	movdqu	%xmm0,(%rsi)
+	.byte	0xf3,0xc3
+.size	vpaes_encrypt,.-vpaes_encrypt
+
+.globl	vpaes_decrypt
+.hidden vpaes_decrypt
+.type	vpaes_decrypt,@function
+.align	16
+vpaes_decrypt:
+	movdqu	(%rdi),%xmm0
+	call	_vpaes_preheat
+	call	_vpaes_decrypt_core
+	movdqu	%xmm0,(%rsi)
+	.byte	0xf3,0xc3
+.size	vpaes_decrypt,.-vpaes_decrypt
+.globl	vpaes_cbc_encrypt
+.hidden vpaes_cbc_encrypt
+.type	vpaes_cbc_encrypt,@function
+.align	16
+vpaes_cbc_encrypt:
+	xchgq	%rcx,%rdx
+	subq	$16,%rcx
+	jc	.Lcbc_abort
+	movdqu	(%r8),%xmm6
+	subq	%rdi,%rsi
+	call	_vpaes_preheat
+	cmpl	$0,%r9d
+	je	.Lcbc_dec_loop
+	jmp	.Lcbc_enc_loop
+.align	16
+.Lcbc_enc_loop:
+	movdqu	(%rdi),%xmm0
+	pxor	%xmm6,%xmm0
+	call	_vpaes_encrypt_core
+	movdqa	%xmm0,%xmm6
+	movdqu	%xmm0,(%rsi,%rdi,1)
+	leaq	16(%rdi),%rdi
+	subq	$16,%rcx
+	jnc	.Lcbc_enc_loop
+	jmp	.Lcbc_done
+.align	16
+.Lcbc_dec_loop:
+	movdqu	(%rdi),%xmm0
+	movdqa	%xmm0,%xmm7
+	call	_vpaes_decrypt_core
+	pxor	%xmm6,%xmm0
+	movdqa	%xmm7,%xmm6
+	movdqu	%xmm0,(%rsi,%rdi,1)
+	leaq	16(%rdi),%rdi
+	subq	$16,%rcx
+	jnc	.Lcbc_dec_loop
+.Lcbc_done:
+	movdqu	%xmm6,(%r8)
+.Lcbc_abort:
+	.byte	0xf3,0xc3
+.size	vpaes_cbc_encrypt,.-vpaes_cbc_encrypt
+
+
+
+
+
+
+.type	_vpaes_preheat,@function
+.align	16
+_vpaes_preheat:
+	leaq	.Lk_s0F(%rip),%r10
+	movdqa	-32(%r10),%xmm10
+	movdqa	-16(%r10),%xmm11
+	movdqa	0(%r10),%xmm9
+	movdqa	48(%r10),%xmm13
+	movdqa	64(%r10),%xmm12
+	movdqa	80(%r10),%xmm15
+	movdqa	96(%r10),%xmm14
+	.byte	0xf3,0xc3
+.size	_vpaes_preheat,.-_vpaes_preheat
+
+
+
+
+
+.type	_vpaes_consts,@object
+.align	64
+_vpaes_consts:
+.Lk_inv:
+.quad	0x0E05060F0D080180, 0x040703090A0B0C02
+.quad	0x01040A060F0B0780, 0x030D0E0C02050809
+
+.Lk_s0F:
+.quad	0x0F0F0F0F0F0F0F0F, 0x0F0F0F0F0F0F0F0F
+
+.Lk_ipt:
+.quad	0xC2B2E8985A2A7000, 0xCABAE09052227808
+.quad	0x4C01307D317C4D00, 0xCD80B1FCB0FDCC81
+
+.Lk_sb1:
+.quad	0xB19BE18FCB503E00, 0xA5DF7A6E142AF544
+.quad	0x3618D415FAE22300, 0x3BF7CCC10D2ED9EF
+.Lk_sb2:
+.quad	0xE27A93C60B712400, 0x5EB7E955BC982FCD
+.quad	0x69EB88400AE12900, 0xC2A163C8AB82234A
+.Lk_sbo:
+.quad	0xD0D26D176FBDC700, 0x15AABF7AC502A878
+.quad	0xCFE474A55FBB6A00, 0x8E1E90D1412B35FA
+
+.Lk_mc_forward:
+.quad	0x0407060500030201, 0x0C0F0E0D080B0A09
+.quad	0x080B0A0904070605, 0x000302010C0F0E0D
+.quad	0x0C0F0E0D080B0A09, 0x0407060500030201
+.quad	0x000302010C0F0E0D, 0x080B0A0904070605
+
+.Lk_mc_backward:
+.quad	0x0605040702010003, 0x0E0D0C0F0A09080B
+.quad	0x020100030E0D0C0F, 0x0A09080B06050407
+.quad	0x0E0D0C0F0A09080B, 0x0605040702010003
+.quad	0x0A09080B06050407, 0x020100030E0D0C0F
+
+.Lk_sr:
+.quad	0x0706050403020100, 0x0F0E0D0C0B0A0908
+.quad	0x030E09040F0A0500, 0x0B06010C07020D08
+.quad	0x0F060D040B020900, 0x070E050C030A0108
+.quad	0x0B0E0104070A0D00, 0x0306090C0F020508
+
+.Lk_rcon:
+.quad	0x1F8391B9AF9DEEB6, 0x702A98084D7C7D81
+
+.Lk_s63:
+.quad	0x5B5B5B5B5B5B5B5B, 0x5B5B5B5B5B5B5B5B
+
+.Lk_opt:
+.quad	0xFF9F4929D6B66000, 0xF7974121DEBE6808
+.quad	0x01EDBD5150BCEC00, 0xE10D5DB1B05C0CE0
+
+.Lk_deskew:
+.quad	0x07E4A34047A4E300, 0x1DFEB95A5DBEF91A
+.quad	0x5F36B5DC83EA6900, 0x2841C2ABF49D1E77
+
+
+
+
+
+.Lk_dksd:
+.quad	0xFEB91A5DA3E44700, 0x0740E3A45A1DBEF9
+.quad	0x41C277F4B5368300, 0x5FDC69EAAB289D1E
+.Lk_dksb:
+.quad	0x9A4FCA1F8550D500, 0x03D653861CC94C99
+.quad	0x115BEDA7B6FC4A00, 0xD993256F7E3482C8
+.Lk_dkse:
+.quad	0xD5031CCA1FC9D600, 0x53859A4C994F5086
+.quad	0xA23196054FDC7BE8, 0xCD5EF96A20B31487
+.Lk_dks9:
+.quad	0xB6116FC87ED9A700, 0x4AED933482255BFC
+.quad	0x4576516227143300, 0x8BB89FACE9DAFDCE
+
+
+
+
+
+.Lk_dipt:
+.quad	0x0F505B040B545F00, 0x154A411E114E451A
+.quad	0x86E383E660056500, 0x12771772F491F194
+
+.Lk_dsb9:
+.quad	0x851C03539A86D600, 0xCAD51F504F994CC9
+.quad	0xC03B1789ECD74900, 0x725E2C9EB2FBA565
+.Lk_dsbd:
+.quad	0x7D57CCDFE6B1A200, 0xF56E9B13882A4439
+.quad	0x3CE2FAF724C6CB00, 0x2931180D15DEEFD3
+.Lk_dsbb:
+.quad	0xD022649296B44200, 0x602646F6B0F2D404
+.quad	0xC19498A6CD596700, 0xF3FF0C3E3255AA6B
+.Lk_dsbe:
+.quad	0x46F2929626D4D000, 0x2242600464B4F6B0
+.quad	0x0C55A6CDFFAAC100, 0x9467F36B98593E32
+.Lk_dsbo:
+.quad	0x1387EA537EF94000, 0xC7AA6DB9D4943E2D
+.quad	0x12D7560F93441D00, 0xCA4B8159D8C58E9C
+.byte	86,101,99,116,111,114,32,80,101,114,109,117,116,97,116,105,111,110,32,65,69,83,32,102,111,114,32,120,56,54,95,54,52,47,83,83,83,69,51,44,32,77,105,107,101,32,72,97,109,98,117,114,103,32,40,83,116,97,110,102,111,114,100,32,85,110,105,118,101,114,115,105,116,121,41,0
+.align	64
+.size	_vpaes_consts,.-_vpaes_consts
+#endif
diff --git a/third_party/boringssl/linux-x86_64/crypto/bn/rsaz-avx2.S b/third_party/boringssl/linux-x86_64/crypto/bn/rsaz-avx2.S
new file mode 100644
index 0000000..cd334d9
--- /dev/null
+++ b/third_party/boringssl/linux-x86_64/crypto/bn/rsaz-avx2.S
@@ -0,0 +1,34 @@
+#if defined(__x86_64__)
+.text	
+
+.globl	rsaz_avx2_eligible
+.hidden rsaz_avx2_eligible
+.type	rsaz_avx2_eligible,@function
+rsaz_avx2_eligible:
+	xorl	%eax,%eax
+	.byte	0xf3,0xc3
+.size	rsaz_avx2_eligible,.-rsaz_avx2_eligible
+
+.globl	rsaz_1024_sqr_avx2
+.hidden rsaz_1024_sqr_avx2
+.globl	rsaz_1024_mul_avx2
+.hidden rsaz_1024_mul_avx2
+.globl	rsaz_1024_norm2red_avx2
+.hidden rsaz_1024_norm2red_avx2
+.globl	rsaz_1024_red2norm_avx2
+.hidden rsaz_1024_red2norm_avx2
+.globl	rsaz_1024_scatter5_avx2
+.hidden rsaz_1024_scatter5_avx2
+.globl	rsaz_1024_gather5_avx2
+.hidden rsaz_1024_gather5_avx2
+.type	rsaz_1024_sqr_avx2,@function
+rsaz_1024_sqr_avx2:
+rsaz_1024_mul_avx2:
+rsaz_1024_norm2red_avx2:
+rsaz_1024_red2norm_avx2:
+rsaz_1024_scatter5_avx2:
+rsaz_1024_gather5_avx2:
+.byte	0x0f,0x0b
+	.byte	0xf3,0xc3
+.size	rsaz_1024_sqr_avx2,.-rsaz_1024_sqr_avx2
+#endif
diff --git a/third_party/boringssl/linux-x86_64/crypto/bn/rsaz-x86_64.S b/third_party/boringssl/linux-x86_64/crypto/bn/rsaz-x86_64.S
new file mode 100644
index 0000000..dd3d310
--- /dev/null
+++ b/third_party/boringssl/linux-x86_64/crypto/bn/rsaz-x86_64.S
@@ -0,0 +1,1127 @@
+#if defined(__x86_64__)
+.text	
+
+.extern	OPENSSL_ia32cap_P
+.hidden OPENSSL_ia32cap_P
+
+.globl	rsaz_512_sqr
+.hidden rsaz_512_sqr
+.type	rsaz_512_sqr,@function
+.align	32
+rsaz_512_sqr:
+	pushq	%rbx
+	pushq	%rbp
+	pushq	%r12
+	pushq	%r13
+	pushq	%r14
+	pushq	%r15
+
+	subq	$128+24,%rsp
+.Lsqr_body:
+	movq	%rdx,%rbp
+	movq	(%rsi),%rdx
+	movq	8(%rsi),%rax
+	movq	%rcx,128(%rsp)
+	jmp	.Loop_sqr
+
+.align	32
+.Loop_sqr:
+	movl	%r8d,128+8(%rsp)
+
+	movq	%rdx,%rbx
+	mulq	%rdx
+	movq	%rax,%r8
+	movq	16(%rsi),%rax
+	movq	%rdx,%r9
+
+	mulq	%rbx
+	addq	%rax,%r9
+	movq	24(%rsi),%rax
+	movq	%rdx,%r10
+	adcq	$0,%r10
+
+	mulq	%rbx
+	addq	%rax,%r10
+	movq	32(%rsi),%rax
+	movq	%rdx,%r11
+	adcq	$0,%r11
+
+	mulq	%rbx
+	addq	%rax,%r11
+	movq	40(%rsi),%rax
+	movq	%rdx,%r12
+	adcq	$0,%r12
+
+	mulq	%rbx
+	addq	%rax,%r12
+	movq	48(%rsi),%rax
+	movq	%rdx,%r13
+	adcq	$0,%r13
+
+	mulq	%rbx
+	addq	%rax,%r13
+	movq	56(%rsi),%rax
+	movq	%rdx,%r14
+	adcq	$0,%r14
+
+	mulq	%rbx
+	addq	%rax,%r14
+	movq	%rbx,%rax
+	movq	%rdx,%r15
+	adcq	$0,%r15
+
+	addq	%r8,%r8
+	movq	%r9,%rcx
+	adcq	%r9,%r9
+
+	mulq	%rax
+	movq	%rax,(%rsp)
+	addq	%rdx,%r8
+	adcq	$0,%r9
+
+	movq	%r8,8(%rsp)
+	shrq	$63,%rcx
+
+
+	movq	8(%rsi),%r8
+	movq	16(%rsi),%rax
+	mulq	%r8
+	addq	%rax,%r10
+	movq	24(%rsi),%rax
+	movq	%rdx,%rbx
+	adcq	$0,%rbx
+
+	mulq	%r8
+	addq	%rax,%r11
+	movq	32(%rsi),%rax
+	adcq	$0,%rdx
+	addq	%rbx,%r11
+	movq	%rdx,%rbx
+	adcq	$0,%rbx
+
+	mulq	%r8
+	addq	%rax,%r12
+	movq	40(%rsi),%rax
+	adcq	$0,%rdx
+	addq	%rbx,%r12
+	movq	%rdx,%rbx
+	adcq	$0,%rbx
+
+	mulq	%r8
+	addq	%rax,%r13
+	movq	48(%rsi),%rax
+	adcq	$0,%rdx
+	addq	%rbx,%r13
+	movq	%rdx,%rbx
+	adcq	$0,%rbx
+
+	mulq	%r8
+	addq	%rax,%r14
+	movq	56(%rsi),%rax
+	adcq	$0,%rdx
+	addq	%rbx,%r14
+	movq	%rdx,%rbx
+	adcq	$0,%rbx
+
+	mulq	%r8
+	addq	%rax,%r15
+	movq	%r8,%rax
+	adcq	$0,%rdx
+	addq	%rbx,%r15
+	movq	%rdx,%r8
+	movq	%r10,%rdx
+	adcq	$0,%r8
+
+	addq	%rdx,%rdx
+	leaq	(%rcx,%r10,2),%r10
+	movq	%r11,%rbx
+	adcq	%r11,%r11
+
+	mulq	%rax
+	addq	%rax,%r9
+	adcq	%rdx,%r10
+	adcq	$0,%r11
+
+	movq	%r9,16(%rsp)
+	movq	%r10,24(%rsp)
+	shrq	$63,%rbx
+
+
+	movq	16(%rsi),%r9
+	movq	24(%rsi),%rax
+	mulq	%r9
+	addq	%rax,%r12
+	movq	32(%rsi),%rax
+	movq	%rdx,%rcx
+	adcq	$0,%rcx
+
+	mulq	%r9
+	addq	%rax,%r13
+	movq	40(%rsi),%rax
+	adcq	$0,%rdx
+	addq	%rcx,%r13
+	movq	%rdx,%rcx
+	adcq	$0,%rcx
+
+	mulq	%r9
+	addq	%rax,%r14
+	movq	48(%rsi),%rax
+	adcq	$0,%rdx
+	addq	%rcx,%r14
+	movq	%rdx,%rcx
+	adcq	$0,%rcx
+
+	mulq	%r9
+	movq	%r12,%r10
+	leaq	(%rbx,%r12,2),%r12
+	addq	%rax,%r15
+	movq	56(%rsi),%rax
+	adcq	$0,%rdx
+	addq	%rcx,%r15
+	movq	%rdx,%rcx
+	adcq	$0,%rcx
+
+	mulq	%r9
+	shrq	$63,%r10
+	addq	%rax,%r8
+	movq	%r9,%rax
+	adcq	$0,%rdx
+	addq	%rcx,%r8
+	movq	%rdx,%r9
+	adcq	$0,%r9
+
+	movq	%r13,%rcx
+	leaq	(%r10,%r13,2),%r13
+
+	mulq	%rax
+	addq	%rax,%r11
+	adcq	%rdx,%r12
+	adcq	$0,%r13
+
+	movq	%r11,32(%rsp)
+	movq	%r12,40(%rsp)
+	shrq	$63,%rcx
+
+
+	movq	24(%rsi),%r10
+	movq	32(%rsi),%rax
+	mulq	%r10
+	addq	%rax,%r14
+	movq	40(%rsi),%rax
+	movq	%rdx,%rbx
+	adcq	$0,%rbx
+
+	mulq	%r10
+	addq	%rax,%r15
+	movq	48(%rsi),%rax
+	adcq	$0,%rdx
+	addq	%rbx,%r15
+	movq	%rdx,%rbx
+	adcq	$0,%rbx
+
+	mulq	%r10
+	movq	%r14,%r12
+	leaq	(%rcx,%r14,2),%r14
+	addq	%rax,%r8
+	movq	56(%rsi),%rax
+	adcq	$0,%rdx
+	addq	%rbx,%r8
+	movq	%rdx,%rbx
+	adcq	$0,%rbx
+
+	mulq	%r10
+	shrq	$63,%r12
+	addq	%rax,%r9
+	movq	%r10,%rax
+	adcq	$0,%rdx
+	addq	%rbx,%r9
+	movq	%rdx,%r10
+	adcq	$0,%r10
+
+	movq	%r15,%rbx
+	leaq	(%r12,%r15,2),%r15
+
+	mulq	%rax
+	addq	%rax,%r13
+	adcq	%rdx,%r14
+	adcq	$0,%r15
+
+	movq	%r13,48(%rsp)
+	movq	%r14,56(%rsp)
+	shrq	$63,%rbx
+
+
+	movq	32(%rsi),%r11
+	movq	40(%rsi),%rax
+	mulq	%r11
+	addq	%rax,%r8
+	movq	48(%rsi),%rax
+	movq	%rdx,%rcx
+	adcq	$0,%rcx
+
+	mulq	%r11
+	addq	%rax,%r9
+	movq	56(%rsi),%rax
+	adcq	$0,%rdx
+	movq	%r8,%r12
+	leaq	(%rbx,%r8,2),%r8
+	addq	%rcx,%r9
+	movq	%rdx,%rcx
+	adcq	$0,%rcx
+
+	mulq	%r11
+	shrq	$63,%r12
+	addq	%rax,%r10
+	movq	%r11,%rax
+	adcq	$0,%rdx
+	addq	%rcx,%r10
+	movq	%rdx,%r11
+	adcq	$0,%r11
+
+	movq	%r9,%rcx
+	leaq	(%r12,%r9,2),%r9
+
+	mulq	%rax
+	addq	%rax,%r15
+	adcq	%rdx,%r8
+	adcq	$0,%r9
+
+	movq	%r15,64(%rsp)
+	movq	%r8,72(%rsp)
+	shrq	$63,%rcx
+
+
+	movq	40(%rsi),%r12
+	movq	48(%rsi),%rax
+	mulq	%r12
+	addq	%rax,%r10
+	movq	56(%rsi),%rax
+	movq	%rdx,%rbx
+	adcq	$0,%rbx
+
+	mulq	%r12
+	addq	%rax,%r11
+	movq	%r12,%rax
+	movq	%r10,%r15
+	leaq	(%rcx,%r10,2),%r10
+	adcq	$0,%rdx
+	shrq	$63,%r15
+	addq	%rbx,%r11
+	movq	%rdx,%r12
+	adcq	$0,%r12
+
+	movq	%r11,%rbx
+	leaq	(%r15,%r11,2),%r11
+
+	mulq	%rax
+	addq	%rax,%r9
+	adcq	%rdx,%r10
+	adcq	$0,%r11
+
+	movq	%r9,80(%rsp)
+	movq	%r10,88(%rsp)
+
+
+	movq	48(%rsi),%r13
+	movq	56(%rsi),%rax
+	mulq	%r13
+	addq	%rax,%r12
+	movq	%r13,%rax
+	movq	%rdx,%r13
+	adcq	$0,%r13
+
+	xorq	%r14,%r14
+	shlq	$1,%rbx
+	adcq	%r12,%r12
+	adcq	%r13,%r13
+	adcq	%r14,%r14
+
+	mulq	%rax
+	addq	%rax,%r11
+	adcq	%rdx,%r12
+	adcq	$0,%r13
+
+	movq	%r11,96(%rsp)
+	movq	%r12,104(%rsp)
+
+
+	movq	56(%rsi),%rax
+	mulq	%rax
+	addq	%rax,%r13
+	adcq	$0,%rdx
+
+	addq	%rdx,%r14
+
+	movq	%r13,112(%rsp)
+	movq	%r14,120(%rsp)
+
+	movq	(%rsp),%r8
+	movq	8(%rsp),%r9
+	movq	16(%rsp),%r10
+	movq	24(%rsp),%r11
+	movq	32(%rsp),%r12
+	movq	40(%rsp),%r13
+	movq	48(%rsp),%r14
+	movq	56(%rsp),%r15
+
+	call	__rsaz_512_reduce
+
+	addq	64(%rsp),%r8
+	adcq	72(%rsp),%r9
+	adcq	80(%rsp),%r10
+	adcq	88(%rsp),%r11
+	adcq	96(%rsp),%r12
+	adcq	104(%rsp),%r13
+	adcq	112(%rsp),%r14
+	adcq	120(%rsp),%r15
+	sbbq	%rcx,%rcx
+
+	call	__rsaz_512_subtract
+
+	movq	%r8,%rdx
+	movq	%r9,%rax
+	movl	128+8(%rsp),%r8d
+	movq	%rdi,%rsi
+
+	decl	%r8d
+	jnz	.Loop_sqr
+
+	leaq	128+24+48(%rsp),%rax
+	movq	-48(%rax),%r15
+	movq	-40(%rax),%r14
+	movq	-32(%rax),%r13
+	movq	-24(%rax),%r12
+	movq	-16(%rax),%rbp
+	movq	-8(%rax),%rbx
+	leaq	(%rax),%rsp
+.Lsqr_epilogue:
+	.byte	0xf3,0xc3
+.size	rsaz_512_sqr,.-rsaz_512_sqr
+.globl	rsaz_512_mul
+.hidden rsaz_512_mul
+.type	rsaz_512_mul,@function
+.align	32
+rsaz_512_mul:
+	pushq	%rbx
+	pushq	%rbp
+	pushq	%r12
+	pushq	%r13
+	pushq	%r14
+	pushq	%r15
+
+	subq	$128+24,%rsp
+.Lmul_body:
+.byte	102,72,15,110,199
+.byte	102,72,15,110,201
+	movq	%r8,128(%rsp)
+	movq	(%rdx),%rbx
+	movq	%rdx,%rbp
+	call	__rsaz_512_mul
+
+.byte	102,72,15,126,199
+.byte	102,72,15,126,205
+
+	movq	(%rsp),%r8
+	movq	8(%rsp),%r9
+	movq	16(%rsp),%r10
+	movq	24(%rsp),%r11
+	movq	32(%rsp),%r12
+	movq	40(%rsp),%r13
+	movq	48(%rsp),%r14
+	movq	56(%rsp),%r15
+
+	call	__rsaz_512_reduce
+	addq	64(%rsp),%r8
+	adcq	72(%rsp),%r9
+	adcq	80(%rsp),%r10
+	adcq	88(%rsp),%r11
+	adcq	96(%rsp),%r12
+	adcq	104(%rsp),%r13
+	adcq	112(%rsp),%r14
+	adcq	120(%rsp),%r15
+	sbbq	%rcx,%rcx
+
+	call	__rsaz_512_subtract
+
+	leaq	128+24+48(%rsp),%rax
+	movq	-48(%rax),%r15
+	movq	-40(%rax),%r14
+	movq	-32(%rax),%r13
+	movq	-24(%rax),%r12
+	movq	-16(%rax),%rbp
+	movq	-8(%rax),%rbx
+	leaq	(%rax),%rsp
+.Lmul_epilogue:
+	.byte	0xf3,0xc3
+.size	rsaz_512_mul,.-rsaz_512_mul
+.globl	rsaz_512_mul_gather4
+.hidden rsaz_512_mul_gather4
+.type	rsaz_512_mul_gather4,@function
+.align	32
+rsaz_512_mul_gather4:
+	pushq	%rbx
+	pushq	%rbp
+	pushq	%r12
+	pushq	%r13
+	pushq	%r14
+	pushq	%r15
+
+	movl	%r9d,%r9d
+	subq	$128+24,%rsp
+.Lmul_gather4_body:
+	movl	64(%rdx,%r9,4),%eax
+.byte	102,72,15,110,199
+	movl	(%rdx,%r9,4),%ebx
+.byte	102,72,15,110,201
+	movq	%r8,128(%rsp)
+
+	shlq	$32,%rax
+	orq	%rax,%rbx
+	movq	(%rsi),%rax
+	movq	8(%rsi),%rcx
+	leaq	128(%rdx,%r9,4),%rbp
+	mulq	%rbx
+	movq	%rax,(%rsp)
+	movq	%rcx,%rax
+	movq	%rdx,%r8
+
+	mulq	%rbx
+	movd	(%rbp),%xmm4
+	addq	%rax,%r8
+	movq	16(%rsi),%rax
+	movq	%rdx,%r9
+	adcq	$0,%r9
+
+	mulq	%rbx
+	movd	64(%rbp),%xmm5
+	addq	%rax,%r9
+	movq	24(%rsi),%rax
+	movq	%rdx,%r10
+	adcq	$0,%r10
+
+	mulq	%rbx
+	pslldq	$4,%xmm5
+	addq	%rax,%r10
+	movq	32(%rsi),%rax
+	movq	%rdx,%r11
+	adcq	$0,%r11
+
+	mulq	%rbx
+	por	%xmm5,%xmm4
+	addq	%rax,%r11
+	movq	40(%rsi),%rax
+	movq	%rdx,%r12
+	adcq	$0,%r12
+
+	mulq	%rbx
+	addq	%rax,%r12
+	movq	48(%rsi),%rax
+	movq	%rdx,%r13
+	adcq	$0,%r13
+
+	mulq	%rbx
+	leaq	128(%rbp),%rbp
+	addq	%rax,%r13
+	movq	56(%rsi),%rax
+	movq	%rdx,%r14
+	adcq	$0,%r14
+
+	mulq	%rbx
+.byte	102,72,15,126,227
+	addq	%rax,%r14
+	movq	(%rsi),%rax
+	movq	%rdx,%r15
+	adcq	$0,%r15
+
+	leaq	8(%rsp),%rdi
+	movl	$7,%ecx
+	jmp	.Loop_mul_gather
+
+.align	32
+.Loop_mul_gather:
+	mulq	%rbx
+	addq	%rax,%r8
+	movq	8(%rsi),%rax
+	movq	%r8,(%rdi)
+	movq	%rdx,%r8
+	adcq	$0,%r8
+
+	mulq	%rbx
+	movd	(%rbp),%xmm4
+	addq	%rax,%r9
+	movq	16(%rsi),%rax
+	adcq	$0,%rdx
+	addq	%r9,%r8
+	movq	%rdx,%r9
+	adcq	$0,%r9
+
+	mulq	%rbx
+	movd	64(%rbp),%xmm5
+	addq	%rax,%r10
+	movq	24(%rsi),%rax
+	adcq	$0,%rdx
+	addq	%r10,%r9
+	movq	%rdx,%r10
+	adcq	$0,%r10
+
+	mulq	%rbx
+	pslldq	$4,%xmm5
+	addq	%rax,%r11
+	movq	32(%rsi),%rax
+	adcq	$0,%rdx
+	addq	%r11,%r10
+	movq	%rdx,%r11
+	adcq	$0,%r11
+
+	mulq	%rbx
+	por	%xmm5,%xmm4
+	addq	%rax,%r12
+	movq	40(%rsi),%rax
+	adcq	$0,%rdx
+	addq	%r12,%r11
+	movq	%rdx,%r12
+	adcq	$0,%r12
+
+	mulq	%rbx
+	addq	%rax,%r13
+	movq	48(%rsi),%rax
+	adcq	$0,%rdx
+	addq	%r13,%r12
+	movq	%rdx,%r13
+	adcq	$0,%r13
+
+	mulq	%rbx
+	addq	%rax,%r14
+	movq	56(%rsi),%rax
+	adcq	$0,%rdx
+	addq	%r14,%r13
+	movq	%rdx,%r14
+	adcq	$0,%r14
+
+	mulq	%rbx
+.byte	102,72,15,126,227
+	addq	%rax,%r15
+	movq	(%rsi),%rax
+	adcq	$0,%rdx
+	addq	%r15,%r14
+	movq	%rdx,%r15
+	adcq	$0,%r15
+
+	leaq	128(%rbp),%rbp
+	leaq	8(%rdi),%rdi
+
+	decl	%ecx
+	jnz	.Loop_mul_gather
+
+	movq	%r8,(%rdi)
+	movq	%r9,8(%rdi)
+	movq	%r10,16(%rdi)
+	movq	%r11,24(%rdi)
+	movq	%r12,32(%rdi)
+	movq	%r13,40(%rdi)
+	movq	%r14,48(%rdi)
+	movq	%r15,56(%rdi)
+
+.byte	102,72,15,126,199
+.byte	102,72,15,126,205
+
+	movq	(%rsp),%r8
+	movq	8(%rsp),%r9
+	movq	16(%rsp),%r10
+	movq	24(%rsp),%r11
+	movq	32(%rsp),%r12
+	movq	40(%rsp),%r13
+	movq	48(%rsp),%r14
+	movq	56(%rsp),%r15
+
+	call	__rsaz_512_reduce
+	addq	64(%rsp),%r8
+	adcq	72(%rsp),%r9
+	adcq	80(%rsp),%r10
+	adcq	88(%rsp),%r11
+	adcq	96(%rsp),%r12
+	adcq	104(%rsp),%r13
+	adcq	112(%rsp),%r14
+	adcq	120(%rsp),%r15
+	sbbq	%rcx,%rcx
+
+	call	__rsaz_512_subtract
+
+	leaq	128+24+48(%rsp),%rax
+	movq	-48(%rax),%r15
+	movq	-40(%rax),%r14
+	movq	-32(%rax),%r13
+	movq	-24(%rax),%r12
+	movq	-16(%rax),%rbp
+	movq	-8(%rax),%rbx
+	leaq	(%rax),%rsp
+.Lmul_gather4_epilogue:
+	.byte	0xf3,0xc3
+.size	rsaz_512_mul_gather4,.-rsaz_512_mul_gather4
+.globl	rsaz_512_mul_scatter4
+.hidden rsaz_512_mul_scatter4
+.type	rsaz_512_mul_scatter4,@function
+.align	32
+rsaz_512_mul_scatter4:
+	pushq	%rbx
+	pushq	%rbp
+	pushq	%r12
+	pushq	%r13
+	pushq	%r14
+	pushq	%r15
+
+	movl	%r9d,%r9d
+	subq	$128+24,%rsp
+.Lmul_scatter4_body:
+	leaq	(%r8,%r9,4),%r8
+.byte	102,72,15,110,199
+.byte	102,72,15,110,202
+.byte	102,73,15,110,208
+	movq	%rcx,128(%rsp)
+
+	movq	%rdi,%rbp
+	movq	(%rdi),%rbx
+	call	__rsaz_512_mul
+
+.byte	102,72,15,126,199
+.byte	102,72,15,126,205
+
+	movq	(%rsp),%r8
+	movq	8(%rsp),%r9
+	movq	16(%rsp),%r10
+	movq	24(%rsp),%r11
+	movq	32(%rsp),%r12
+	movq	40(%rsp),%r13
+	movq	48(%rsp),%r14
+	movq	56(%rsp),%r15
+
+	call	__rsaz_512_reduce
+	addq	64(%rsp),%r8
+	adcq	72(%rsp),%r9
+	adcq	80(%rsp),%r10
+	adcq	88(%rsp),%r11
+	adcq	96(%rsp),%r12
+	adcq	104(%rsp),%r13
+	adcq	112(%rsp),%r14
+	adcq	120(%rsp),%r15
+.byte	102,72,15,126,214
+	sbbq	%rcx,%rcx
+
+	call	__rsaz_512_subtract
+
+	movl	%r8d,0(%rsi)
+	shrq	$32,%r8
+	movl	%r9d,128(%rsi)
+	shrq	$32,%r9
+	movl	%r10d,256(%rsi)
+	shrq	$32,%r10
+	movl	%r11d,384(%rsi)
+	shrq	$32,%r11
+	movl	%r12d,512(%rsi)
+	shrq	$32,%r12
+	movl	%r13d,640(%rsi)
+	shrq	$32,%r13
+	movl	%r14d,768(%rsi)
+	shrq	$32,%r14
+	movl	%r15d,896(%rsi)
+	shrq	$32,%r15
+	movl	%r8d,64(%rsi)
+	movl	%r9d,192(%rsi)
+	movl	%r10d,320(%rsi)
+	movl	%r11d,448(%rsi)
+	movl	%r12d,576(%rsi)
+	movl	%r13d,704(%rsi)
+	movl	%r14d,832(%rsi)
+	movl	%r15d,960(%rsi)
+
+	leaq	128+24+48(%rsp),%rax
+	movq	-48(%rax),%r15
+	movq	-40(%rax),%r14
+	movq	-32(%rax),%r13
+	movq	-24(%rax),%r12
+	movq	-16(%rax),%rbp
+	movq	-8(%rax),%rbx
+	leaq	(%rax),%rsp
+.Lmul_scatter4_epilogue:
+	.byte	0xf3,0xc3
+.size	rsaz_512_mul_scatter4,.-rsaz_512_mul_scatter4
+.globl	rsaz_512_mul_by_one
+.hidden rsaz_512_mul_by_one
+.type	rsaz_512_mul_by_one,@function
+.align	32
+rsaz_512_mul_by_one:
+	pushq	%rbx
+	pushq	%rbp
+	pushq	%r12
+	pushq	%r13
+	pushq	%r14
+	pushq	%r15
+
+	subq	$128+24,%rsp
+.Lmul_by_one_body:
+	movq	%rdx,%rbp
+	movq	%rcx,128(%rsp)
+
+	movq	(%rsi),%r8
+	pxor	%xmm0,%xmm0
+	movq	8(%rsi),%r9
+	movq	16(%rsi),%r10
+	movq	24(%rsi),%r11
+	movq	32(%rsi),%r12
+	movq	40(%rsi),%r13
+	movq	48(%rsi),%r14
+	movq	56(%rsi),%r15
+
+	movdqa	%xmm0,(%rsp)
+	movdqa	%xmm0,16(%rsp)
+	movdqa	%xmm0,32(%rsp)
+	movdqa	%xmm0,48(%rsp)
+	movdqa	%xmm0,64(%rsp)
+	movdqa	%xmm0,80(%rsp)
+	movdqa	%xmm0,96(%rsp)
+	call	__rsaz_512_reduce
+	movq	%r8,(%rdi)
+	movq	%r9,8(%rdi)
+	movq	%r10,16(%rdi)
+	movq	%r11,24(%rdi)
+	movq	%r12,32(%rdi)
+	movq	%r13,40(%rdi)
+	movq	%r14,48(%rdi)
+	movq	%r15,56(%rdi)
+
+	leaq	128+24+48(%rsp),%rax
+	movq	-48(%rax),%r15
+	movq	-40(%rax),%r14
+	movq	-32(%rax),%r13
+	movq	-24(%rax),%r12
+	movq	-16(%rax),%rbp
+	movq	-8(%rax),%rbx
+	leaq	(%rax),%rsp
+.Lmul_by_one_epilogue:
+	.byte	0xf3,0xc3
+.size	rsaz_512_mul_by_one,.-rsaz_512_mul_by_one
+.type	__rsaz_512_reduce,@function
+.align	32
+__rsaz_512_reduce:
+	movq	%r8,%rbx
+	imulq	128+8(%rsp),%rbx
+	movq	0(%rbp),%rax
+	movl	$8,%ecx
+	jmp	.Lreduction_loop
+
+.align	32
+.Lreduction_loop:
+	mulq	%rbx
+	movq	8(%rbp),%rax
+	negq	%r8
+	movq	%rdx,%r8
+	adcq	$0,%r8
+
+	mulq	%rbx
+	addq	%rax,%r9
+	movq	16(%rbp),%rax
+	adcq	$0,%rdx
+	addq	%r9,%r8
+	movq	%rdx,%r9
+	adcq	$0,%r9
+
+	mulq	%rbx
+	addq	%rax,%r10
+	movq	24(%rbp),%rax
+	adcq	$0,%rdx
+	addq	%r10,%r9
+	movq	%rdx,%r10
+	adcq	$0,%r10
+
+	mulq	%rbx
+	addq	%rax,%r11
+	movq	32(%rbp),%rax
+	adcq	$0,%rdx
+	addq	%r11,%r10
+	movq	128+8(%rsp),%rsi
+
+
+	adcq	$0,%rdx
+	movq	%rdx,%r11
+
+	mulq	%rbx
+	addq	%rax,%r12
+	movq	40(%rbp),%rax
+	adcq	$0,%rdx
+	imulq	%r8,%rsi
+	addq	%r12,%r11
+	movq	%rdx,%r12
+	adcq	$0,%r12
+
+	mulq	%rbx
+	addq	%rax,%r13
+	movq	48(%rbp),%rax
+	adcq	$0,%rdx
+	addq	%r13,%r12
+	movq	%rdx,%r13
+	adcq	$0,%r13
+
+	mulq	%rbx
+	addq	%rax,%r14
+	movq	56(%rbp),%rax
+	adcq	$0,%rdx
+	addq	%r14,%r13
+	movq	%rdx,%r14
+	adcq	$0,%r14
+
+	mulq	%rbx
+	movq	%rsi,%rbx
+	addq	%rax,%r15
+	movq	0(%rbp),%rax
+	adcq	$0,%rdx
+	addq	%r15,%r14
+	movq	%rdx,%r15
+	adcq	$0,%r15
+
+	decl	%ecx
+	jne	.Lreduction_loop
+
+	.byte	0xf3,0xc3
+.size	__rsaz_512_reduce,.-__rsaz_512_reduce
+.type	__rsaz_512_subtract,@function
+.align	32
+__rsaz_512_subtract:
+	movq	%r8,(%rdi)
+	movq	%r9,8(%rdi)
+	movq	%r10,16(%rdi)
+	movq	%r11,24(%rdi)
+	movq	%r12,32(%rdi)
+	movq	%r13,40(%rdi)
+	movq	%r14,48(%rdi)
+	movq	%r15,56(%rdi)
+
+	movq	0(%rbp),%r8
+	movq	8(%rbp),%r9
+	negq	%r8
+	notq	%r9
+	andq	%rcx,%r8
+	movq	16(%rbp),%r10
+	andq	%rcx,%r9
+	notq	%r10
+	movq	24(%rbp),%r11
+	andq	%rcx,%r10
+	notq	%r11
+	movq	32(%rbp),%r12
+	andq	%rcx,%r11
+	notq	%r12
+	movq	40(%rbp),%r13
+	andq	%rcx,%r12
+	notq	%r13
+	movq	48(%rbp),%r14
+	andq	%rcx,%r13
+	notq	%r14
+	movq	56(%rbp),%r15
+	andq	%rcx,%r14
+	notq	%r15
+	andq	%rcx,%r15
+
+	addq	(%rdi),%r8
+	adcq	8(%rdi),%r9
+	adcq	16(%rdi),%r10
+	adcq	24(%rdi),%r11
+	adcq	32(%rdi),%r12
+	adcq	40(%rdi),%r13
+	adcq	48(%rdi),%r14
+	adcq	56(%rdi),%r15
+
+	movq	%r8,(%rdi)
+	movq	%r9,8(%rdi)
+	movq	%r10,16(%rdi)
+	movq	%r11,24(%rdi)
+	movq	%r12,32(%rdi)
+	movq	%r13,40(%rdi)
+	movq	%r14,48(%rdi)
+	movq	%r15,56(%rdi)
+
+	.byte	0xf3,0xc3
+.size	__rsaz_512_subtract,.-__rsaz_512_subtract
+.type	__rsaz_512_mul,@function
+.align	32
+__rsaz_512_mul:
+	leaq	8(%rsp),%rdi
+
+	movq	(%rsi),%rax
+	mulq	%rbx
+	movq	%rax,(%rdi)
+	movq	8(%rsi),%rax
+	movq	%rdx,%r8
+
+	mulq	%rbx
+	addq	%rax,%r8
+	movq	16(%rsi),%rax
+	movq	%rdx,%r9
+	adcq	$0,%r9
+
+	mulq	%rbx
+	addq	%rax,%r9
+	movq	24(%rsi),%rax
+	movq	%rdx,%r10
+	adcq	$0,%r10
+
+	mulq	%rbx
+	addq	%rax,%r10
+	movq	32(%rsi),%rax
+	movq	%rdx,%r11
+	adcq	$0,%r11
+
+	mulq	%rbx
+	addq	%rax,%r11
+	movq	40(%rsi),%rax
+	movq	%rdx,%r12
+	adcq	$0,%r12
+
+	mulq	%rbx
+	addq	%rax,%r12
+	movq	48(%rsi),%rax
+	movq	%rdx,%r13
+	adcq	$0,%r13
+
+	mulq	%rbx
+	addq	%rax,%r13
+	movq	56(%rsi),%rax
+	movq	%rdx,%r14
+	adcq	$0,%r14
+
+	mulq	%rbx
+	addq	%rax,%r14
+	movq	(%rsi),%rax
+	movq	%rdx,%r15
+	adcq	$0,%r15
+
+	leaq	8(%rbp),%rbp
+	leaq	8(%rdi),%rdi
+
+	movl	$7,%ecx
+	jmp	.Loop_mul
+
+.align	32
+.Loop_mul:
+	movq	(%rbp),%rbx
+	mulq	%rbx
+	addq	%rax,%r8
+	movq	8(%rsi),%rax
+	movq	%r8,(%rdi)
+	movq	%rdx,%r8
+	adcq	$0,%r8
+
+	mulq	%rbx
+	addq	%rax,%r9
+	movq	16(%rsi),%rax
+	adcq	$0,%rdx
+	addq	%r9,%r8
+	movq	%rdx,%r9
+	adcq	$0,%r9
+
+	mulq	%rbx
+	addq	%rax,%r10
+	movq	24(%rsi),%rax
+	adcq	$0,%rdx
+	addq	%r10,%r9
+	movq	%rdx,%r10
+	adcq	$0,%r10
+
+	mulq	%rbx
+	addq	%rax,%r11
+	movq	32(%rsi),%rax
+	adcq	$0,%rdx
+	addq	%r11,%r10
+	movq	%rdx,%r11
+	adcq	$0,%r11
+
+	mulq	%rbx
+	addq	%rax,%r12
+	movq	40(%rsi),%rax
+	adcq	$0,%rdx
+	addq	%r12,%r11
+	movq	%rdx,%r12
+	adcq	$0,%r12
+
+	mulq	%rbx
+	addq	%rax,%r13
+	movq	48(%rsi),%rax
+	adcq	$0,%rdx
+	addq	%r13,%r12
+	movq	%rdx,%r13
+	adcq	$0,%r13
+
+	mulq	%rbx
+	addq	%rax,%r14
+	movq	56(%rsi),%rax
+	adcq	$0,%rdx
+	addq	%r14,%r13
+	movq	%rdx,%r14
+	leaq	8(%rbp),%rbp
+	adcq	$0,%r14
+
+	mulq	%rbx
+	addq	%rax,%r15
+	movq	(%rsi),%rax
+	adcq	$0,%rdx
+	addq	%r15,%r14
+	movq	%rdx,%r15
+	adcq	$0,%r15
+
+	leaq	8(%rdi),%rdi
+
+	decl	%ecx
+	jnz	.Loop_mul
+
+	movq	%r8,(%rdi)
+	movq	%r9,8(%rdi)
+	movq	%r10,16(%rdi)
+	movq	%r11,24(%rdi)
+	movq	%r12,32(%rdi)
+	movq	%r13,40(%rdi)
+	movq	%r14,48(%rdi)
+	movq	%r15,56(%rdi)
+
+	.byte	0xf3,0xc3
+.size	__rsaz_512_mul,.-__rsaz_512_mul
+.globl	rsaz_512_scatter4
+.hidden rsaz_512_scatter4
+.type	rsaz_512_scatter4,@function
+.align	16
+rsaz_512_scatter4:
+	leaq	(%rdi,%rdx,4),%rdi
+	movl	$8,%r9d
+	jmp	.Loop_scatter
+.align	16
+.Loop_scatter:
+	movq	(%rsi),%rax
+	leaq	8(%rsi),%rsi
+	movl	%eax,(%rdi)
+	shrq	$32,%rax
+	movl	%eax,64(%rdi)
+	leaq	128(%rdi),%rdi
+	decl	%r9d
+	jnz	.Loop_scatter
+	.byte	0xf3,0xc3
+.size	rsaz_512_scatter4,.-rsaz_512_scatter4
+
+.globl	rsaz_512_gather4
+.hidden rsaz_512_gather4
+.type	rsaz_512_gather4,@function
+.align	16
+rsaz_512_gather4:
+	leaq	(%rsi,%rdx,4),%rsi
+	movl	$8,%r9d
+	jmp	.Loop_gather
+.align	16
+.Loop_gather:
+	movl	(%rsi),%eax
+	movl	64(%rsi),%r8d
+	leaq	128(%rsi),%rsi
+	shlq	$32,%r8
+	orq	%r8,%rax
+	movq	%rax,(%rdi)
+	leaq	8(%rdi),%rdi
+	decl	%r9d
+	jnz	.Loop_gather
+	.byte	0xf3,0xc3
+.size	rsaz_512_gather4,.-rsaz_512_gather4
+#endif
diff --git a/third_party/boringssl/linux-x86_64/crypto/bn/x86_64-mont.S b/third_party/boringssl/linux-x86_64/crypto/bn/x86_64-mont.S
new file mode 100644
index 0000000..4d401c6
--- /dev/null
+++ b/third_party/boringssl/linux-x86_64/crypto/bn/x86_64-mont.S
@@ -0,0 +1,728 @@
+#if defined(__x86_64__)
+.text	
+
+.extern	OPENSSL_ia32cap_P
+.hidden OPENSSL_ia32cap_P
+
+.globl	bn_mul_mont
+.hidden bn_mul_mont
+.type	bn_mul_mont,@function
+.align	16
+bn_mul_mont:
+	testl	$3,%r9d
+	jnz	.Lmul_enter
+	cmpl	$8,%r9d
+	jb	.Lmul_enter
+	cmpq	%rsi,%rdx
+	jne	.Lmul4x_enter
+	testl	$7,%r9d
+	jz	.Lsqr8x_enter
+	jmp	.Lmul4x_enter
+
+.align	16
+.Lmul_enter:
+	pushq	%rbx
+	pushq	%rbp
+	pushq	%r12
+	pushq	%r13
+	pushq	%r14
+	pushq	%r15
+
+	movl	%r9d,%r9d
+	leaq	2(%r9),%r10
+	movq	%rsp,%r11
+	negq	%r10
+	leaq	(%rsp,%r10,8),%rsp
+	andq	$-1024,%rsp
+
+	movq	%r11,8(%rsp,%r9,8)
+.Lmul_body:
+	movq	%rdx,%r12
+	movq	(%r8),%r8
+	movq	(%r12),%rbx
+	movq	(%rsi),%rax
+
+	xorq	%r14,%r14
+	xorq	%r15,%r15
+
+	movq	%r8,%rbp
+	mulq	%rbx
+	movq	%rax,%r10
+	movq	(%rcx),%rax
+
+	imulq	%r10,%rbp
+	movq	%rdx,%r11
+
+	mulq	%rbp
+	addq	%rax,%r10
+	movq	8(%rsi),%rax
+	adcq	$0,%rdx
+	movq	%rdx,%r13
+
+	leaq	1(%r15),%r15
+	jmp	.L1st_enter
+
+.align	16
+.L1st:
+	addq	%rax,%r13
+	movq	(%rsi,%r15,8),%rax
+	adcq	$0,%rdx
+	addq	%r11,%r13
+	movq	%r10,%r11
+	adcq	$0,%rdx
+	movq	%r13,-16(%rsp,%r15,8)
+	movq	%rdx,%r13
+
+.L1st_enter:
+	mulq	%rbx
+	addq	%rax,%r11
+	movq	(%rcx,%r15,8),%rax
+	adcq	$0,%rdx
+	leaq	1(%r15),%r15
+	movq	%rdx,%r10
+
+	mulq	%rbp
+	cmpq	%r9,%r15
+	jne	.L1st
+
+	addq	%rax,%r13
+	movq	(%rsi),%rax
+	adcq	$0,%rdx
+	addq	%r11,%r13
+	adcq	$0,%rdx
+	movq	%r13,-16(%rsp,%r15,8)
+	movq	%rdx,%r13
+	movq	%r10,%r11
+
+	xorq	%rdx,%rdx
+	addq	%r11,%r13
+	adcq	$0,%rdx
+	movq	%r13,-8(%rsp,%r9,8)
+	movq	%rdx,(%rsp,%r9,8)
+
+	leaq	1(%r14),%r14
+	jmp	.Louter
+.align	16
+.Louter:
+	movq	(%r12,%r14,8),%rbx
+	xorq	%r15,%r15
+	movq	%r8,%rbp
+	movq	(%rsp),%r10
+	mulq	%rbx
+	addq	%rax,%r10
+	movq	(%rcx),%rax
+	adcq	$0,%rdx
+
+	imulq	%r10,%rbp
+	movq	%rdx,%r11
+
+	mulq	%rbp
+	addq	%rax,%r10
+	movq	8(%rsi),%rax
+	adcq	$0,%rdx
+	movq	8(%rsp),%r10
+	movq	%rdx,%r13
+
+	leaq	1(%r15),%r15
+	jmp	.Linner_enter
+
+.align	16
+.Linner:
+	addq	%rax,%r13
+	movq	(%rsi,%r15,8),%rax
+	adcq	$0,%rdx
+	addq	%r10,%r13
+	movq	(%rsp,%r15,8),%r10
+	adcq	$0,%rdx
+	movq	%r13,-16(%rsp,%r15,8)
+	movq	%rdx,%r13
+
+.Linner_enter:
+	mulq	%rbx
+	addq	%rax,%r11
+	movq	(%rcx,%r15,8),%rax
+	adcq	$0,%rdx
+	addq	%r11,%r10
+	movq	%rdx,%r11
+	adcq	$0,%r11
+	leaq	1(%r15),%r15
+
+	mulq	%rbp
+	cmpq	%r9,%r15
+	jne	.Linner
+
+	addq	%rax,%r13
+	movq	(%rsi),%rax
+	adcq	$0,%rdx
+	addq	%r10,%r13
+	movq	(%rsp,%r15,8),%r10
+	adcq	$0,%rdx
+	movq	%r13,-16(%rsp,%r15,8)
+	movq	%rdx,%r13
+
+	xorq	%rdx,%rdx
+	addq	%r11,%r13
+	adcq	$0,%rdx
+	addq	%r10,%r13
+	adcq	$0,%rdx
+	movq	%r13,-8(%rsp,%r9,8)
+	movq	%rdx,(%rsp,%r9,8)
+
+	leaq	1(%r14),%r14
+	cmpq	%r9,%r14
+	jb	.Louter
+
+	xorq	%r14,%r14
+	movq	(%rsp),%rax
+	leaq	(%rsp),%rsi
+	movq	%r9,%r15
+	jmp	.Lsub
+.align	16
+.Lsub:	sbbq	(%rcx,%r14,8),%rax
+	movq	%rax,(%rdi,%r14,8)
+	movq	8(%rsi,%r14,8),%rax
+	leaq	1(%r14),%r14
+	decq	%r15
+	jnz	.Lsub
+
+	sbbq	$0,%rax
+	xorq	%r14,%r14
+	movq	%r9,%r15
+.align	16
+.Lcopy:
+	movq	(%rsp,%r14,8),%rsi
+	movq	(%rdi,%r14,8),%rcx
+	xorq	%rcx,%rsi
+	andq	%rax,%rsi
+	xorq	%rcx,%rsi
+	movq	%r14,(%rsp,%r14,8)
+	movq	%rsi,(%rdi,%r14,8)
+	leaq	1(%r14),%r14
+	subq	$1,%r15
+	jnz	.Lcopy
+
+	movq	8(%rsp,%r9,8),%rsi
+	movq	$1,%rax
+	movq	(%rsi),%r15
+	movq	8(%rsi),%r14
+	movq	16(%rsi),%r13
+	movq	24(%rsi),%r12
+	movq	32(%rsi),%rbp
+	movq	40(%rsi),%rbx
+	leaq	48(%rsi),%rsp
+.Lmul_epilogue:
+	.byte	0xf3,0xc3
+.size	bn_mul_mont,.-bn_mul_mont
+.type	bn_mul4x_mont,@function
+.align	16
+bn_mul4x_mont:
+.Lmul4x_enter:
+	pushq	%rbx
+	pushq	%rbp
+	pushq	%r12
+	pushq	%r13
+	pushq	%r14
+	pushq	%r15
+
+	movl	%r9d,%r9d
+	leaq	4(%r9),%r10
+	movq	%rsp,%r11
+	negq	%r10
+	leaq	(%rsp,%r10,8),%rsp
+	andq	$-1024,%rsp
+
+	movq	%r11,8(%rsp,%r9,8)
+.Lmul4x_body:
+	movq	%rdi,16(%rsp,%r9,8)
+	movq	%rdx,%r12
+	movq	(%r8),%r8
+	movq	(%r12),%rbx
+	movq	(%rsi),%rax
+
+	xorq	%r14,%r14
+	xorq	%r15,%r15
+
+	movq	%r8,%rbp
+	mulq	%rbx
+	movq	%rax,%r10
+	movq	(%rcx),%rax
+
+	imulq	%r10,%rbp
+	movq	%rdx,%r11
+
+	mulq	%rbp
+	addq	%rax,%r10
+	movq	8(%rsi),%rax
+	adcq	$0,%rdx
+	movq	%rdx,%rdi
+
+	mulq	%rbx
+	addq	%rax,%r11
+	movq	8(%rcx),%rax
+	adcq	$0,%rdx
+	movq	%rdx,%r10
+
+	mulq	%rbp
+	addq	%rax,%rdi
+	movq	16(%rsi),%rax
+	adcq	$0,%rdx
+	addq	%r11,%rdi
+	leaq	4(%r15),%r15
+	adcq	$0,%rdx
+	movq	%rdi,(%rsp)
+	movq	%rdx,%r13
+	jmp	.L1st4x
+.align	16
+.L1st4x:
+	mulq	%rbx
+	addq	%rax,%r10
+	movq	-16(%rcx,%r15,8),%rax
+	adcq	$0,%rdx
+	movq	%rdx,%r11
+
+	mulq	%rbp
+	addq	%rax,%r13
+	movq	-8(%rsi,%r15,8),%rax
+	adcq	$0,%rdx
+	addq	%r10,%r13
+	adcq	$0,%rdx
+	movq	%r13,-24(%rsp,%r15,8)
+	movq	%rdx,%rdi
+
+	mulq	%rbx
+	addq	%rax,%r11
+	movq	-8(%rcx,%r15,8),%rax
+	adcq	$0,%rdx
+	movq	%rdx,%r10
+
+	mulq	%rbp
+	addq	%rax,%rdi
+	movq	(%rsi,%r15,8),%rax
+	adcq	$0,%rdx
+	addq	%r11,%rdi
+	adcq	$0,%rdx
+	movq	%rdi,-16(%rsp,%r15,8)
+	movq	%rdx,%r13
+
+	mulq	%rbx
+	addq	%rax,%r10
+	movq	(%rcx,%r15,8),%rax
+	adcq	$0,%rdx
+	movq	%rdx,%r11
+
+	mulq	%rbp
+	addq	%rax,%r13
+	movq	8(%rsi,%r15,8),%rax
+	adcq	$0,%rdx
+	addq	%r10,%r13
+	adcq	$0,%rdx
+	movq	%r13,-8(%rsp,%r15,8)
+	movq	%rdx,%rdi
+
+	mulq	%rbx
+	addq	%rax,%r11
+	movq	8(%rcx,%r15,8),%rax
+	adcq	$0,%rdx
+	leaq	4(%r15),%r15
+	movq	%rdx,%r10
+
+	mulq	%rbp
+	addq	%rax,%rdi
+	movq	-16(%rsi,%r15,8),%rax
+	adcq	$0,%rdx
+	addq	%r11,%rdi
+	adcq	$0,%rdx
+	movq	%rdi,-32(%rsp,%r15,8)
+	movq	%rdx,%r13
+	cmpq	%r9,%r15
+	jb	.L1st4x
+
+	mulq	%rbx
+	addq	%rax,%r10
+	movq	-16(%rcx,%r15,8),%rax
+	adcq	$0,%rdx
+	movq	%rdx,%r11
+
+	mulq	%rbp
+	addq	%rax,%r13
+	movq	-8(%rsi,%r15,8),%rax
+	adcq	$0,%rdx
+	addq	%r10,%r13
+	adcq	$0,%rdx
+	movq	%r13,-24(%rsp,%r15,8)
+	movq	%rdx,%rdi
+
+	mulq	%rbx
+	addq	%rax,%r11
+	movq	-8(%rcx,%r15,8),%rax
+	adcq	$0,%rdx
+	movq	%rdx,%r10
+
+	mulq	%rbp
+	addq	%rax,%rdi
+	movq	(%rsi),%rax
+	adcq	$0,%rdx
+	addq	%r11,%rdi
+	adcq	$0,%rdx
+	movq	%rdi,-16(%rsp,%r15,8)
+	movq	%rdx,%r13
+
+	xorq	%rdi,%rdi
+	addq	%r10,%r13
+	adcq	$0,%rdi
+	movq	%r13,-8(%rsp,%r15,8)
+	movq	%rdi,(%rsp,%r15,8)
+
+	leaq	1(%r14),%r14
+.align	4
+.Louter4x:
+	movq	(%r12,%r14,8),%rbx
+	xorq	%r15,%r15
+	movq	(%rsp),%r10
+	movq	%r8,%rbp
+	mulq	%rbx
+	addq	%rax,%r10
+	movq	(%rcx),%rax
+	adcq	$0,%rdx
+
+	imulq	%r10,%rbp
+	movq	%rdx,%r11
+
+	mulq	%rbp
+	addq	%rax,%r10
+	movq	8(%rsi),%rax
+	adcq	$0,%rdx
+	movq	%rdx,%rdi
+
+	mulq	%rbx
+	addq	%rax,%r11
+	movq	8(%rcx),%rax
+	adcq	$0,%rdx
+	addq	8(%rsp),%r11
+	adcq	$0,%rdx
+	movq	%rdx,%r10
+
+	mulq	%rbp
+	addq	%rax,%rdi
+	movq	16(%rsi),%rax
+	adcq	$0,%rdx
+	addq	%r11,%rdi
+	leaq	4(%r15),%r15
+	adcq	$0,%rdx
+	movq	%rdi,(%rsp)
+	movq	%rdx,%r13
+	jmp	.Linner4x
+.align	16
+.Linner4x:
+	mulq	%rbx
+	addq	%rax,%r10
+	movq	-16(%rcx,%r15,8),%rax
+	adcq	$0,%rdx
+	addq	-16(%rsp,%r15,8),%r10
+	adcq	$0,%rdx
+	movq	%rdx,%r11
+
+	mulq	%rbp
+	addq	%rax,%r13
+	movq	-8(%rsi,%r15,8),%rax
+	adcq	$0,%rdx
+	addq	%r10,%r13
+	adcq	$0,%rdx
+	movq	%r13,-24(%rsp,%r15,8)
+	movq	%rdx,%rdi
+
+	mulq	%rbx
+	addq	%rax,%r11
+	movq	-8(%rcx,%r15,8),%rax
+	adcq	$0,%rdx
+	addq	-8(%rsp,%r15,8),%r11
+	adcq	$0,%rdx
+	movq	%rdx,%r10
+
+	mulq	%rbp
+	addq	%rax,%rdi
+	movq	(%rsi,%r15,8),%rax
+	adcq	$0,%rdx
+	addq	%r11,%rdi
+	adcq	$0,%rdx
+	movq	%rdi,-16(%rsp,%r15,8)
+	movq	%rdx,%r13
+
+	mulq	%rbx
+	addq	%rax,%r10
+	movq	(%rcx,%r15,8),%rax
+	adcq	$0,%rdx
+	addq	(%rsp,%r15,8),%r10
+	adcq	$0,%rdx
+	movq	%rdx,%r11
+
+	mulq	%rbp
+	addq	%rax,%r13
+	movq	8(%rsi,%r15,8),%rax
+	adcq	$0,%rdx
+	addq	%r10,%r13
+	adcq	$0,%rdx
+	movq	%r13,-8(%rsp,%r15,8)
+	movq	%rdx,%rdi
+
+	mulq	%rbx
+	addq	%rax,%r11
+	movq	8(%rcx,%r15,8),%rax
+	adcq	$0,%rdx
+	addq	8(%rsp,%r15,8),%r11
+	adcq	$0,%rdx
+	leaq	4(%r15),%r15
+	movq	%rdx,%r10
+
+	mulq	%rbp
+	addq	%rax,%rdi
+	movq	-16(%rsi,%r15,8),%rax
+	adcq	$0,%rdx
+	addq	%r11,%rdi
+	adcq	$0,%rdx
+	movq	%rdi,-32(%rsp,%r15,8)
+	movq	%rdx,%r13
+	cmpq	%r9,%r15
+	jb	.Linner4x
+
+	mulq	%rbx
+	addq	%rax,%r10
+	movq	-16(%rcx,%r15,8),%rax
+	adcq	$0,%rdx
+	addq	-16(%rsp,%r15,8),%r10
+	adcq	$0,%rdx
+	movq	%rdx,%r11
+
+	mulq	%rbp
+	addq	%rax,%r13
+	movq	-8(%rsi,%r15,8),%rax
+	adcq	$0,%rdx
+	addq	%r10,%r13
+	adcq	$0,%rdx
+	movq	%r13,-24(%rsp,%r15,8)
+	movq	%rdx,%rdi
+
+	mulq	%rbx
+	addq	%rax,%r11
+	movq	-8(%rcx,%r15,8),%rax
+	adcq	$0,%rdx
+	addq	-8(%rsp,%r15,8),%r11
+	adcq	$0,%rdx
+	leaq	1(%r14),%r14
+	movq	%rdx,%r10
+
+	mulq	%rbp
+	addq	%rax,%rdi
+	movq	(%rsi),%rax
+	adcq	$0,%rdx
+	addq	%r11,%rdi
+	adcq	$0,%rdx
+	movq	%rdi,-16(%rsp,%r15,8)
+	movq	%rdx,%r13
+
+	xorq	%rdi,%rdi
+	addq	%r10,%r13
+	adcq	$0,%rdi
+	addq	(%rsp,%r9,8),%r13
+	adcq	$0,%rdi
+	movq	%r13,-8(%rsp,%r15,8)
+	movq	%rdi,(%rsp,%r15,8)
+
+	cmpq	%r9,%r14
+	jb	.Louter4x
+	movq	16(%rsp,%r9,8),%rdi
+	movq	0(%rsp),%rax
+	movq	8(%rsp),%rdx
+	shrq	$2,%r9
+	leaq	(%rsp),%rsi
+	xorq	%r14,%r14
+
+	subq	0(%rcx),%rax
+	movq	16(%rsi),%rbx
+	movq	24(%rsi),%rbp
+	sbbq	8(%rcx),%rdx
+	leaq	-1(%r9),%r15
+	jmp	.Lsub4x
+.align	16
+.Lsub4x:
+	movq	%rax,0(%rdi,%r14,8)
+	movq	%rdx,8(%rdi,%r14,8)
+	sbbq	16(%rcx,%r14,8),%rbx
+	movq	32(%rsi,%r14,8),%rax
+	movq	40(%rsi,%r14,8),%rdx
+	sbbq	24(%rcx,%r14,8),%rbp
+	movq	%rbx,16(%rdi,%r14,8)
+	movq	%rbp,24(%rdi,%r14,8)
+	sbbq	32(%rcx,%r14,8),%rax
+	movq	48(%rsi,%r14,8),%rbx
+	movq	56(%rsi,%r14,8),%rbp
+	sbbq	40(%rcx,%r14,8),%rdx
+	leaq	4(%r14),%r14
+	decq	%r15
+	jnz	.Lsub4x
+
+	movq	%rax,0(%rdi,%r14,8)
+	movq	32(%rsi,%r14,8),%rax
+	sbbq	16(%rcx,%r14,8),%rbx
+	movq	%rdx,8(%rdi,%r14,8)
+	sbbq	24(%rcx,%r14,8),%rbp
+	movq	%rbx,16(%rdi,%r14,8)
+
+	sbbq	$0,%rax
+	movq	%rax,%xmm0
+	punpcklqdq	%xmm0,%xmm0
+	movq	%rbp,24(%rdi,%r14,8)
+	xorq	%r14,%r14
+
+	movq	%r9,%r15
+	pxor	%xmm5,%xmm5
+	jmp	.Lcopy4x
+.align	16
+.Lcopy4x:
+	movdqu	(%rsp,%r14,1),%xmm2
+	movdqu	16(%rsp,%r14,1),%xmm4
+	movdqu	(%rdi,%r14,1),%xmm1
+	movdqu	16(%rdi,%r14,1),%xmm3
+	pxor	%xmm1,%xmm2
+	pxor	%xmm3,%xmm4
+	pand	%xmm0,%xmm2
+	pand	%xmm0,%xmm4
+	pxor	%xmm1,%xmm2
+	pxor	%xmm3,%xmm4
+	movdqu	%xmm2,(%rdi,%r14,1)
+	movdqu	%xmm4,16(%rdi,%r14,1)
+	movdqa	%xmm5,(%rsp,%r14,1)
+	movdqa	%xmm5,16(%rsp,%r14,1)
+
+	leaq	32(%r14),%r14
+	decq	%r15
+	jnz	.Lcopy4x
+
+	shlq	$2,%r9
+	movq	8(%rsp,%r9,8),%rsi
+	movq	$1,%rax
+	movq	(%rsi),%r15
+	movq	8(%rsi),%r14
+	movq	16(%rsi),%r13
+	movq	24(%rsi),%r12
+	movq	32(%rsi),%rbp
+	movq	40(%rsi),%rbx
+	leaq	48(%rsi),%rsp
+.Lmul4x_epilogue:
+	.byte	0xf3,0xc3
+.size	bn_mul4x_mont,.-bn_mul4x_mont
+.extern	bn_sqr8x_internal
+.hidden bn_sqr8x_internal
+
+.type	bn_sqr8x_mont,@function
+.align	32
+bn_sqr8x_mont:
+.Lsqr8x_enter:
+	movq	%rsp,%rax
+	pushq	%rbx
+	pushq	%rbp
+	pushq	%r12
+	pushq	%r13
+	pushq	%r14
+	pushq	%r15
+
+	movl	%r9d,%r10d
+	shll	$3,%r9d
+	shlq	$3+2,%r10
+	negq	%r9
+
+
+
+
+
+
+	leaq	-64(%rsp,%r9,4),%r11
+	movq	(%r8),%r8
+	subq	%rsi,%r11
+	andq	$4095,%r11
+	cmpq	%r11,%r10
+	jb	.Lsqr8x_sp_alt
+	subq	%r11,%rsp
+	leaq	-64(%rsp,%r9,4),%rsp
+	jmp	.Lsqr8x_sp_done
+
+.align	32
+.Lsqr8x_sp_alt:
+	leaq	4096-64(,%r9,4),%r10
+	leaq	-64(%rsp,%r9,4),%rsp
+	subq	%r10,%r11
+	movq	$0,%r10
+	cmovcq	%r10,%r11
+	subq	%r11,%rsp
+.Lsqr8x_sp_done:
+	andq	$-64,%rsp
+	movq	%r9,%r10
+	negq	%r9
+
+	leaq	64(%rsp,%r9,2),%r11
+	movq	%r8,32(%rsp)
+	movq	%rax,40(%rsp)
+.Lsqr8x_body:
+
+	movq	%r9,%rbp
+.byte	102,73,15,110,211
+	shrq	$3+2,%rbp
+	movl	OPENSSL_ia32cap_P+8(%rip),%eax
+	jmp	.Lsqr8x_copy_n
+
+.align	32
+.Lsqr8x_copy_n:
+	movq	0(%rcx),%xmm0
+	movq	8(%rcx),%xmm1
+	movq	16(%rcx),%xmm3
+	movq	24(%rcx),%xmm4
+	leaq	32(%rcx),%rcx
+	movdqa	%xmm0,0(%r11)
+	movdqa	%xmm1,16(%r11)
+	movdqa	%xmm3,32(%r11)
+	movdqa	%xmm4,48(%r11)
+	leaq	64(%r11),%r11
+	decq	%rbp
+	jnz	.Lsqr8x_copy_n
+
+	pxor	%xmm0,%xmm0
+.byte	102,72,15,110,207
+.byte	102,73,15,110,218
+	call	bn_sqr8x_internal
+
+	pxor	%xmm0,%xmm0
+	leaq	48(%rsp),%rax
+	leaq	64(%rsp,%r9,2),%rdx
+	shrq	$3+2,%r9
+	movq	40(%rsp),%rsi
+	jmp	.Lsqr8x_zero
+
+.align	32
+.Lsqr8x_zero:
+	movdqa	%xmm0,0(%rax)
+	movdqa	%xmm0,16(%rax)
+	movdqa	%xmm0,32(%rax)
+	movdqa	%xmm0,48(%rax)
+	leaq	64(%rax),%rax
+	movdqa	%xmm0,0(%rdx)
+	movdqa	%xmm0,16(%rdx)
+	movdqa	%xmm0,32(%rdx)
+	movdqa	%xmm0,48(%rdx)
+	leaq	64(%rdx),%rdx
+	decq	%r9
+	jnz	.Lsqr8x_zero
+
+	movq	$1,%rax
+	movq	-48(%rsi),%r15
+	movq	-40(%rsi),%r14
+	movq	-32(%rsi),%r13
+	movq	-24(%rsi),%r12
+	movq	-16(%rsi),%rbp
+	movq	-8(%rsi),%rbx
+	leaq	(%rsi),%rsp
+.Lsqr8x_epilogue:
+	.byte	0xf3,0xc3
+.size	bn_sqr8x_mont,.-bn_sqr8x_mont
+.byte	77,111,110,116,103,111,109,101,114,121,32,77,117,108,116,105,112,108,105,99,97,116,105,111,110,32,102,111,114,32,120,56,54,95,54,52,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0
+.align	16
+#endif
diff --git a/third_party/boringssl/linux-x86_64/crypto/bn/x86_64-mont5.S b/third_party/boringssl/linux-x86_64/crypto/bn/x86_64-mont5.S
new file mode 100644
index 0000000..02edc69
--- /dev/null
+++ b/third_party/boringssl/linux-x86_64/crypto/bn/x86_64-mont5.S
@@ -0,0 +1,1823 @@
+#if defined(__x86_64__)
+.text	
+
+.extern	OPENSSL_ia32cap_P
+.hidden OPENSSL_ia32cap_P
+
+.globl	bn_mul_mont_gather5
+.hidden bn_mul_mont_gather5
+.type	bn_mul_mont_gather5,@function
+.align	64
+bn_mul_mont_gather5:
+	testl	$7,%r9d
+	jnz	.Lmul_enter
+	jmp	.Lmul4x_enter
+
+.align	16
+.Lmul_enter:
+	movl	%r9d,%r9d
+	movq	%rsp,%rax
+	movl	8(%rsp),%r10d
+	pushq	%rbx
+	pushq	%rbp
+	pushq	%r12
+	pushq	%r13
+	pushq	%r14
+	pushq	%r15
+	leaq	2(%r9),%r11
+	negq	%r11
+	leaq	(%rsp,%r11,8),%rsp
+	andq	$-1024,%rsp
+
+	movq	%rax,8(%rsp,%r9,8)
+.Lmul_body:
+	movq	%rdx,%r12
+	movq	%r10,%r11
+	shrq	$3,%r10
+	andq	$7,%r11
+	notq	%r10
+	leaq	.Lmagic_masks(%rip),%rax
+	andq	$3,%r10
+	leaq	96(%r12,%r11,8),%r12
+	movq	0(%rax,%r10,8),%xmm4
+	movq	8(%rax,%r10,8),%xmm5
+	movq	16(%rax,%r10,8),%xmm6
+	movq	24(%rax,%r10,8),%xmm7
+
+	movq	-96(%r12),%xmm0
+	movq	-32(%r12),%xmm1
+	pand	%xmm4,%xmm0
+	movq	32(%r12),%xmm2
+	pand	%xmm5,%xmm1
+	movq	96(%r12),%xmm3
+	pand	%xmm6,%xmm2
+	por	%xmm1,%xmm0
+	pand	%xmm7,%xmm3
+	por	%xmm2,%xmm0
+	leaq	256(%r12),%r12
+	por	%xmm3,%xmm0
+
+.byte	102,72,15,126,195
+
+	movq	(%r8),%r8
+	movq	(%rsi),%rax
+
+	xorq	%r14,%r14
+	xorq	%r15,%r15
+
+	movq	-96(%r12),%xmm0
+	movq	-32(%r12),%xmm1
+	pand	%xmm4,%xmm0
+	movq	32(%r12),%xmm2
+	pand	%xmm5,%xmm1
+
+	movq	%r8,%rbp
+	mulq	%rbx
+	movq	%rax,%r10
+	movq	(%rcx),%rax
+
+	movq	96(%r12),%xmm3
+	pand	%xmm6,%xmm2
+	por	%xmm1,%xmm0
+	pand	%xmm7,%xmm3
+
+	imulq	%r10,%rbp
+	movq	%rdx,%r11
+
+	por	%xmm2,%xmm0
+	leaq	256(%r12),%r12
+	por	%xmm3,%xmm0
+
+	mulq	%rbp
+	addq	%rax,%r10
+	movq	8(%rsi),%rax
+	adcq	$0,%rdx
+	movq	%rdx,%r13
+
+	leaq	1(%r15),%r15
+	jmp	.L1st_enter
+
+.align	16
+.L1st:
+	addq	%rax,%r13
+	movq	(%rsi,%r15,8),%rax
+	adcq	$0,%rdx
+	addq	%r11,%r13
+	movq	%r10,%r11
+	adcq	$0,%rdx
+	movq	%r13,-16(%rsp,%r15,8)
+	movq	%rdx,%r13
+
+.L1st_enter:
+	mulq	%rbx
+	addq	%rax,%r11
+	movq	(%rcx,%r15,8),%rax
+	adcq	$0,%rdx
+	leaq	1(%r15),%r15
+	movq	%rdx,%r10
+
+	mulq	%rbp
+	cmpq	%r9,%r15
+	jne	.L1st
+
+.byte	102,72,15,126,195
+
+	addq	%rax,%r13
+	movq	(%rsi),%rax
+	adcq	$0,%rdx
+	addq	%r11,%r13
+	adcq	$0,%rdx
+	movq	%r13,-16(%rsp,%r15,8)
+	movq	%rdx,%r13
+	movq	%r10,%r11
+
+	xorq	%rdx,%rdx
+	addq	%r11,%r13
+	adcq	$0,%rdx
+	movq	%r13,-8(%rsp,%r9,8)
+	movq	%rdx,(%rsp,%r9,8)
+
+	leaq	1(%r14),%r14
+	jmp	.Louter
+.align	16
+.Louter:
+	xorq	%r15,%r15
+	movq	%r8,%rbp
+	movq	(%rsp),%r10
+
+	movq	-96(%r12),%xmm0
+	movq	-32(%r12),%xmm1
+	pand	%xmm4,%xmm0
+	movq	32(%r12),%xmm2
+	pand	%xmm5,%xmm1
+
+	mulq	%rbx
+	addq	%rax,%r10
+	movq	(%rcx),%rax
+	adcq	$0,%rdx
+
+	movq	96(%r12),%xmm3
+	pand	%xmm6,%xmm2
+	por	%xmm1,%xmm0
+	pand	%xmm7,%xmm3
+
+	imulq	%r10,%rbp
+	movq	%rdx,%r11
+
+	por	%xmm2,%xmm0
+	leaq	256(%r12),%r12
+	por	%xmm3,%xmm0
+
+	mulq	%rbp
+	addq	%rax,%r10
+	movq	8(%rsi),%rax
+	adcq	$0,%rdx
+	movq	8(%rsp),%r10
+	movq	%rdx,%r13
+
+	leaq	1(%r15),%r15
+	jmp	.Linner_enter
+
+.align	16
+.Linner:
+	addq	%rax,%r13
+	movq	(%rsi,%r15,8),%rax
+	adcq	$0,%rdx
+	addq	%r10,%r13
+	movq	(%rsp,%r15,8),%r10
+	adcq	$0,%rdx
+	movq	%r13,-16(%rsp,%r15,8)
+	movq	%rdx,%r13
+
+.Linner_enter:
+	mulq	%rbx
+	addq	%rax,%r11
+	movq	(%rcx,%r15,8),%rax
+	adcq	$0,%rdx
+	addq	%r11,%r10
+	movq	%rdx,%r11
+	adcq	$0,%r11
+	leaq	1(%r15),%r15
+
+	mulq	%rbp
+	cmpq	%r9,%r15
+	jne	.Linner
+
+.byte	102,72,15,126,195
+
+	addq	%rax,%r13
+	movq	(%rsi),%rax
+	adcq	$0,%rdx
+	addq	%r10,%r13
+	movq	(%rsp,%r15,8),%r10
+	adcq	$0,%rdx
+	movq	%r13,-16(%rsp,%r15,8)
+	movq	%rdx,%r13
+
+	xorq	%rdx,%rdx
+	addq	%r11,%r13
+	adcq	$0,%rdx
+	addq	%r10,%r13
+	adcq	$0,%rdx
+	movq	%r13,-8(%rsp,%r9,8)
+	movq	%rdx,(%rsp,%r9,8)
+
+	leaq	1(%r14),%r14
+	cmpq	%r9,%r14
+	jb	.Louter
+
+	xorq	%r14,%r14
+	movq	(%rsp),%rax
+	leaq	(%rsp),%rsi
+	movq	%r9,%r15
+	jmp	.Lsub
+.align	16
+.Lsub:	sbbq	(%rcx,%r14,8),%rax
+	movq	%rax,(%rdi,%r14,8)
+	movq	8(%rsi,%r14,8),%rax
+	leaq	1(%r14),%r14
+	decq	%r15
+	jnz	.Lsub
+
+	sbbq	$0,%rax
+	xorq	%r14,%r14
+	movq	%r9,%r15
+.align	16
+.Lcopy:
+	movq	(%rsp,%r14,8),%rsi
+	movq	(%rdi,%r14,8),%rcx
+	xorq	%rcx,%rsi
+	andq	%rax,%rsi
+	xorq	%rcx,%rsi
+	movq	%r14,(%rsp,%r14,8)
+	movq	%rsi,(%rdi,%r14,8)
+	leaq	1(%r14),%r14
+	subq	$1,%r15
+	jnz	.Lcopy
+
+	movq	8(%rsp,%r9,8),%rsi
+	movq	$1,%rax
+	movq	-48(%rsi),%r15
+	movq	-40(%rsi),%r14
+	movq	-32(%rsi),%r13
+	movq	-24(%rsi),%r12
+	movq	-16(%rsi),%rbp
+	movq	-8(%rsi),%rbx
+	leaq	(%rsi),%rsp
+.Lmul_epilogue:
+	.byte	0xf3,0xc3
+.size	bn_mul_mont_gather5,.-bn_mul_mont_gather5
+.type	bn_mul4x_mont_gather5,@function
+.align	32
+bn_mul4x_mont_gather5:
+.Lmul4x_enter:
+.byte	0x67
+	movq	%rsp,%rax
+	pushq	%rbx
+	pushq	%rbp
+	pushq	%r12
+	pushq	%r13
+	pushq	%r14
+	pushq	%r15
+.byte	0x67
+	movl	%r9d,%r10d
+	shll	$3,%r9d
+	shll	$3+2,%r10d
+	negq	%r9
+
+
+
+
+
+
+
+
+	leaq	-64(%rsp,%r9,2),%r11
+	subq	%rsi,%r11
+	andq	$4095,%r11
+	cmpq	%r11,%r10
+	jb	.Lmul4xsp_alt
+	subq	%r11,%rsp
+	leaq	-64(%rsp,%r9,2),%rsp
+	jmp	.Lmul4xsp_done
+
+.align	32
+.Lmul4xsp_alt:
+	leaq	4096-64(,%r9,2),%r10
+	leaq	-64(%rsp,%r9,2),%rsp
+	subq	%r10,%r11
+	movq	$0,%r10
+	cmovcq	%r10,%r11
+	subq	%r11,%rsp
+.Lmul4xsp_done:
+	andq	$-64,%rsp
+	negq	%r9
+
+	movq	%rax,40(%rsp)
+.Lmul4x_body:
+
+	call	mul4x_internal
+
+	movq	40(%rsp),%rsi
+	movq	$1,%rax
+	movq	-48(%rsi),%r15
+	movq	-40(%rsi),%r14
+	movq	-32(%rsi),%r13
+	movq	-24(%rsi),%r12
+	movq	-16(%rsi),%rbp
+	movq	-8(%rsi),%rbx
+	leaq	(%rsi),%rsp
+.Lmul4x_epilogue:
+	.byte	0xf3,0xc3
+.size	bn_mul4x_mont_gather5,.-bn_mul4x_mont_gather5
+
+.type	mul4x_internal,@function
+.align	32
+mul4x_internal:
+	shlq	$5,%r9
+	movl	8(%rax),%r10d
+	leaq	256(%rdx,%r9,1),%r13
+	shrq	$5,%r9
+	movq	%r10,%r11
+	shrq	$3,%r10
+	andq	$7,%r11
+	notq	%r10
+	leaq	.Lmagic_masks(%rip),%rax
+	andq	$3,%r10
+	leaq	96(%rdx,%r11,8),%r12
+	movq	0(%rax,%r10,8),%xmm4
+	movq	8(%rax,%r10,8),%xmm5
+	addq	$7,%r11
+	movq	16(%rax,%r10,8),%xmm6
+	movq	24(%rax,%r10,8),%xmm7
+	andq	$7,%r11
+
+	movq	-96(%r12),%xmm0
+	leaq	256(%r12),%r14
+	movq	-32(%r12),%xmm1
+	pand	%xmm4,%xmm0
+	movq	32(%r12),%xmm2
+	pand	%xmm5,%xmm1
+	movq	96(%r12),%xmm3
+	pand	%xmm6,%xmm2
+.byte	0x67
+	por	%xmm1,%xmm0
+	movq	-96(%r14),%xmm1
+.byte	0x67
+	pand	%xmm7,%xmm3
+.byte	0x67
+	por	%xmm2,%xmm0
+	movq	-32(%r14),%xmm2
+.byte	0x67
+	pand	%xmm4,%xmm1
+.byte	0x67
+	por	%xmm3,%xmm0
+	movq	32(%r14),%xmm3
+
+.byte	102,72,15,126,195
+	movq	96(%r14),%xmm0
+	movq	%r13,16+8(%rsp)
+	movq	%rdi,56+8(%rsp)
+
+	movq	(%r8),%r8
+	movq	(%rsi),%rax
+	leaq	(%rsi,%r9,1),%rsi
+	negq	%r9
+
+	movq	%r8,%rbp
+	mulq	%rbx
+	movq	%rax,%r10
+	movq	(%rcx),%rax
+
+	pand	%xmm5,%xmm2
+	pand	%xmm6,%xmm3
+	por	%xmm2,%xmm1
+
+	imulq	%r10,%rbp
+
+
+
+
+
+
+
+	leaq	64+8(%rsp,%r11,8),%r14
+	movq	%rdx,%r11
+
+	pand	%xmm7,%xmm0
+	por	%xmm3,%xmm1
+	leaq	512(%r12),%r12
+	por	%xmm1,%xmm0
+
+	mulq	%rbp
+	addq	%rax,%r10
+	movq	8(%rsi,%r9,1),%rax
+	adcq	$0,%rdx
+	movq	%rdx,%rdi
+
+	mulq	%rbx
+	addq	%rax,%r11
+	movq	16(%rcx),%rax
+	adcq	$0,%rdx
+	movq	%rdx,%r10
+
+	mulq	%rbp
+	addq	%rax,%rdi
+	movq	16(%rsi,%r9,1),%rax
+	adcq	$0,%rdx
+	addq	%r11,%rdi
+	leaq	32(%r9),%r15
+	leaq	64(%rcx),%rcx
+	adcq	$0,%rdx
+	movq	%rdi,(%r14)
+	movq	%rdx,%r13
+	jmp	.L1st4x
+
+.align	32
+.L1st4x:
+	mulq	%rbx
+	addq	%rax,%r10
+	movq	-32(%rcx),%rax
+	leaq	32(%r14),%r14
+	adcq	$0,%rdx
+	movq	%rdx,%r11
+
+	mulq	%rbp
+	addq	%rax,%r13
+	movq	-8(%rsi,%r15,1),%rax
+	adcq	$0,%rdx
+	addq	%r10,%r13
+	adcq	$0,%rdx
+	movq	%r13,-24(%r14)
+	movq	%rdx,%rdi
+
+	mulq	%rbx
+	addq	%rax,%r11
+	movq	-16(%rcx),%rax
+	adcq	$0,%rdx
+	movq	%rdx,%r10
+
+	mulq	%rbp
+	addq	%rax,%rdi
+	movq	(%rsi,%r15,1),%rax
+	adcq	$0,%rdx
+	addq	%r11,%rdi
+	adcq	$0,%rdx
+	movq	%rdi,-16(%r14)
+	movq	%rdx,%r13
+
+	mulq	%rbx
+	addq	%rax,%r10
+	movq	0(%rcx),%rax
+	adcq	$0,%rdx
+	movq	%rdx,%r11
+
+	mulq	%rbp
+	addq	%rax,%r13
+	movq	8(%rsi,%r15,1),%rax
+	adcq	$0,%rdx
+	addq	%r10,%r13
+	adcq	$0,%rdx
+	movq	%r13,-8(%r14)
+	movq	%rdx,%rdi
+
+	mulq	%rbx
+	addq	%rax,%r11
+	movq	16(%rcx),%rax
+	adcq	$0,%rdx
+	movq	%rdx,%r10
+
+	mulq	%rbp
+	addq	%rax,%rdi
+	movq	16(%rsi,%r15,1),%rax
+	adcq	$0,%rdx
+	addq	%r11,%rdi
+	leaq	64(%rcx),%rcx
+	adcq	$0,%rdx
+	movq	%rdi,(%r14)
+	movq	%rdx,%r13
+
+	addq	$32,%r15
+	jnz	.L1st4x
+
+	mulq	%rbx
+	addq	%rax,%r10
+	movq	-32(%rcx),%rax
+	leaq	32(%r14),%r14
+	adcq	$0,%rdx
+	movq	%rdx,%r11
+
+	mulq	%rbp
+	addq	%rax,%r13
+	movq	-8(%rsi),%rax
+	adcq	$0,%rdx
+	addq	%r10,%r13
+	adcq	$0,%rdx
+	movq	%r13,-24(%r14)
+	movq	%rdx,%rdi
+
+	mulq	%rbx
+	addq	%rax,%r11
+	movq	-16(%rcx),%rax
+	adcq	$0,%rdx
+	movq	%rdx,%r10
+
+	mulq	%rbp
+	addq	%rax,%rdi
+	movq	(%rsi,%r9,1),%rax
+	adcq	$0,%rdx
+	addq	%r11,%rdi
+	adcq	$0,%rdx
+	movq	%rdi,-16(%r14)
+	movq	%rdx,%r13
+
+.byte	102,72,15,126,195
+	leaq	(%rcx,%r9,2),%rcx
+
+	xorq	%rdi,%rdi
+	addq	%r10,%r13
+	adcq	$0,%rdi
+	movq	%r13,-8(%r14)
+
+	jmp	.Louter4x
+
+.align	32
+.Louter4x:
+	movq	(%r14,%r9,1),%r10
+	movq	%r8,%rbp
+	mulq	%rbx
+	addq	%rax,%r10
+	movq	(%rcx),%rax
+	adcq	$0,%rdx
+
+	movq	-96(%r12),%xmm0
+	movq	-32(%r12),%xmm1
+	pand	%xmm4,%xmm0
+	movq	32(%r12),%xmm2
+	pand	%xmm5,%xmm1
+	movq	96(%r12),%xmm3
+
+	imulq	%r10,%rbp
+.byte	0x67
+	movq	%rdx,%r11
+	movq	%rdi,(%r14)
+
+	pand	%xmm6,%xmm2
+	por	%xmm1,%xmm0
+	pand	%xmm7,%xmm3
+	por	%xmm2,%xmm0
+	leaq	(%r14,%r9,1),%r14
+	leaq	256(%r12),%r12
+	por	%xmm3,%xmm0
+
+	mulq	%rbp
+	addq	%rax,%r10
+	movq	8(%rsi,%r9,1),%rax
+	adcq	$0,%rdx
+	movq	%rdx,%rdi
+
+	mulq	%rbx
+	addq	%rax,%r11
+	movq	16(%rcx),%rax
+	adcq	$0,%rdx
+	addq	8(%r14),%r11
+	adcq	$0,%rdx
+	movq	%rdx,%r10
+
+	mulq	%rbp
+	addq	%rax,%rdi
+	movq	16(%rsi,%r9,1),%rax
+	adcq	$0,%rdx
+	addq	%r11,%rdi
+	leaq	32(%r9),%r15
+	leaq	64(%rcx),%rcx
+	adcq	$0,%rdx
+	movq	%rdx,%r13
+	jmp	.Linner4x
+
+.align	32
+.Linner4x:
+	mulq	%rbx
+	addq	%rax,%r10
+	movq	-32(%rcx),%rax
+	adcq	$0,%rdx
+	addq	16(%r14),%r10
+	leaq	32(%r14),%r14
+	adcq	$0,%rdx
+	movq	%rdx,%r11
+
+	mulq	%rbp
+	addq	%rax,%r13
+	movq	-8(%rsi,%r15,1),%rax
+	adcq	$0,%rdx
+	addq	%r10,%r13
+	adcq	$0,%rdx
+	movq	%rdi,-32(%r14)
+	movq	%rdx,%rdi
+
+	mulq	%rbx
+	addq	%rax,%r11
+	movq	-16(%rcx),%rax
+	adcq	$0,%rdx
+	addq	-8(%r14),%r11
+	adcq	$0,%rdx
+	movq	%rdx,%r10
+
+	mulq	%rbp
+	addq	%rax,%rdi
+	movq	(%rsi,%r15,1),%rax
+	adcq	$0,%rdx
+	addq	%r11,%rdi
+	adcq	$0,%rdx
+	movq	%r13,-24(%r14)
+	movq	%rdx,%r13
+
+	mulq	%rbx
+	addq	%rax,%r10
+	movq	0(%rcx),%rax
+	adcq	$0,%rdx
+	addq	(%r14),%r10
+	adcq	$0,%rdx
+	movq	%rdx,%r11
+
+	mulq	%rbp
+	addq	%rax,%r13
+	movq	8(%rsi,%r15,1),%rax
+	adcq	$0,%rdx
+	addq	%r10,%r13
+	adcq	$0,%rdx
+	movq	%rdi,-16(%r14)
+	movq	%rdx,%rdi
+
+	mulq	%rbx
+	addq	%rax,%r11
+	movq	16(%rcx),%rax
+	adcq	$0,%rdx
+	addq	8(%r14),%r11
+	adcq	$0,%rdx
+	movq	%rdx,%r10
+
+	mulq	%rbp
+	addq	%rax,%rdi
+	movq	16(%rsi,%r15,1),%rax
+	adcq	$0,%rdx
+	addq	%r11,%rdi
+	leaq	64(%rcx),%rcx
+	adcq	$0,%rdx
+	movq	%r13,-8(%r14)
+	movq	%rdx,%r13
+
+	addq	$32,%r15
+	jnz	.Linner4x
+
+	mulq	%rbx
+	addq	%rax,%r10
+	movq	-32(%rcx),%rax
+	adcq	$0,%rdx
+	addq	16(%r14),%r10
+	leaq	32(%r14),%r14
+	adcq	$0,%rdx
+	movq	%rdx,%r11
+
+	mulq	%rbp
+	addq	%rax,%r13
+	movq	-8(%rsi),%rax
+	adcq	$0,%rdx
+	addq	%r10,%r13
+	adcq	$0,%rdx
+	movq	%rdi,-32(%r14)
+	movq	%rdx,%rdi
+
+	mulq	%rbx
+	addq	%rax,%r11
+	movq	%rbp,%rax
+	movq	-16(%rcx),%rbp
+	adcq	$0,%rdx
+	addq	-8(%r14),%r11
+	adcq	$0,%rdx
+	movq	%rdx,%r10
+
+	mulq	%rbp
+	addq	%rax,%rdi
+	movq	(%rsi,%r9,1),%rax
+	adcq	$0,%rdx
+	addq	%r11,%rdi
+	adcq	$0,%rdx
+	movq	%r13,-24(%r14)
+	movq	%rdx,%r13
+
+.byte	102,72,15,126,195
+	movq	%rdi,-16(%r14)
+	leaq	(%rcx,%r9,2),%rcx
+
+	xorq	%rdi,%rdi
+	addq	%r10,%r13
+	adcq	$0,%rdi
+	addq	(%r14),%r13
+	adcq	$0,%rdi
+	movq	%r13,-8(%r14)
+
+	cmpq	16+8(%rsp),%r12
+	jb	.Louter4x
+	subq	%r13,%rbp
+	adcq	%r15,%r15
+	orq	%r15,%rdi
+	xorq	$1,%rdi
+	leaq	(%r14,%r9,1),%rbx
+	leaq	(%rcx,%rdi,8),%rbp
+	movq	%r9,%rcx
+	sarq	$3+2,%rcx
+	movq	56+8(%rsp),%rdi
+	jmp	.Lsqr4x_sub
+.size	mul4x_internal,.-mul4x_internal
+.globl	bn_power5
+.hidden bn_power5
+.type	bn_power5,@function
+.align	32
+bn_power5:
+	movq	%rsp,%rax
+	pushq	%rbx
+	pushq	%rbp
+	pushq	%r12
+	pushq	%r13
+	pushq	%r14
+	pushq	%r15
+	movl	%r9d,%r10d
+	shll	$3,%r9d
+	shll	$3+2,%r10d
+	negq	%r9
+	movq	(%r8),%r8
+
+
+
+
+
+
+
+	leaq	-64(%rsp,%r9,2),%r11
+	subq	%rsi,%r11
+	andq	$4095,%r11
+	cmpq	%r11,%r10
+	jb	.Lpwr_sp_alt
+	subq	%r11,%rsp
+	leaq	-64(%rsp,%r9,2),%rsp
+	jmp	.Lpwr_sp_done
+
+.align	32
+.Lpwr_sp_alt:
+	leaq	4096-64(,%r9,2),%r10
+	leaq	-64(%rsp,%r9,2),%rsp
+	subq	%r10,%r11
+	movq	$0,%r10
+	cmovcq	%r10,%r11
+	subq	%r11,%rsp
+.Lpwr_sp_done:
+	andq	$-64,%rsp
+	movq	%r9,%r10
+	negq	%r9
+
+
+
+
+
+
+
+
+
+
+	movq	%r8,32(%rsp)
+	movq	%rax,40(%rsp)
+.Lpower5_body:
+.byte	102,72,15,110,207
+.byte	102,72,15,110,209
+.byte	102,73,15,110,218
+.byte	102,72,15,110,226
+
+	call	__bn_sqr8x_internal
+	call	__bn_sqr8x_internal
+	call	__bn_sqr8x_internal
+	call	__bn_sqr8x_internal
+	call	__bn_sqr8x_internal
+
+.byte	102,72,15,126,209
+.byte	102,72,15,126,226
+	movq	%rsi,%rdi
+	movq	40(%rsp),%rax
+	leaq	32(%rsp),%r8
+
+	call	mul4x_internal
+
+	movq	40(%rsp),%rsi
+	movq	$1,%rax
+	movq	-48(%rsi),%r15
+	movq	-40(%rsi),%r14
+	movq	-32(%rsi),%r13
+	movq	-24(%rsi),%r12
+	movq	-16(%rsi),%rbp
+	movq	-8(%rsi),%rbx
+	leaq	(%rsi),%rsp
+.Lpower5_epilogue:
+	.byte	0xf3,0xc3
+.size	bn_power5,.-bn_power5
+
+.globl	bn_sqr8x_internal
+.hidden bn_sqr8x_internal
+.hidden	bn_sqr8x_internal
+.type	bn_sqr8x_internal,@function
+.align	32
+bn_sqr8x_internal:
+__bn_sqr8x_internal:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+	leaq	32(%r10),%rbp
+	leaq	(%rsi,%r9,1),%rsi
+
+	movq	%r9,%rcx
+
+
+	movq	-32(%rsi,%rbp,1),%r14
+	leaq	48+8(%rsp,%r9,2),%rdi
+	movq	-24(%rsi,%rbp,1),%rax
+	leaq	-32(%rdi,%rbp,1),%rdi
+	movq	-16(%rsi,%rbp,1),%rbx
+	movq	%rax,%r15
+
+	mulq	%r14
+	movq	%rax,%r10
+	movq	%rbx,%rax
+	movq	%rdx,%r11
+	movq	%r10,-24(%rdi,%rbp,1)
+
+	mulq	%r14
+	addq	%rax,%r11
+	movq	%rbx,%rax
+	adcq	$0,%rdx
+	movq	%r11,-16(%rdi,%rbp,1)
+	movq	%rdx,%r10
+
+
+	movq	-8(%rsi,%rbp,1),%rbx
+	mulq	%r15
+	movq	%rax,%r12
+	movq	%rbx,%rax
+	movq	%rdx,%r13
+
+	leaq	(%rbp),%rcx
+	mulq	%r14
+	addq	%rax,%r10
+	movq	%rbx,%rax
+	movq	%rdx,%r11
+	adcq	$0,%r11
+	addq	%r12,%r10
+	adcq	$0,%r11
+	movq	%r10,-8(%rdi,%rcx,1)
+	jmp	.Lsqr4x_1st
+
+.align	32
+.Lsqr4x_1st:
+	movq	(%rsi,%rcx,1),%rbx
+	mulq	%r15
+	addq	%rax,%r13
+	movq	%rbx,%rax
+	movq	%rdx,%r12
+	adcq	$0,%r12
+
+	mulq	%r14
+	addq	%rax,%r11
+	movq	%rbx,%rax
+	movq	8(%rsi,%rcx,1),%rbx
+	movq	%rdx,%r10
+	adcq	$0,%r10
+	addq	%r13,%r11
+	adcq	$0,%r10
+
+
+	mulq	%r15
+	addq	%rax,%r12
+	movq	%rbx,%rax
+	movq	%r11,(%rdi,%rcx,1)
+	movq	%rdx,%r13
+	adcq	$0,%r13
+
+	mulq	%r14
+	addq	%rax,%r10
+	movq	%rbx,%rax
+	movq	16(%rsi,%rcx,1),%rbx
+	movq	%rdx,%r11
+	adcq	$0,%r11
+	addq	%r12,%r10
+	adcq	$0,%r11
+
+	mulq	%r15
+	addq	%rax,%r13
+	movq	%rbx,%rax
+	movq	%r10,8(%rdi,%rcx,1)
+	movq	%rdx,%r12
+	adcq	$0,%r12
+
+	mulq	%r14
+	addq	%rax,%r11
+	movq	%rbx,%rax
+	movq	24(%rsi,%rcx,1),%rbx
+	movq	%rdx,%r10
+	adcq	$0,%r10
+	addq	%r13,%r11
+	adcq	$0,%r10
+
+
+	mulq	%r15
+	addq	%rax,%r12
+	movq	%rbx,%rax
+	movq	%r11,16(%rdi,%rcx,1)
+	movq	%rdx,%r13
+	adcq	$0,%r13
+	leaq	32(%rcx),%rcx
+
+	mulq	%r14
+	addq	%rax,%r10
+	movq	%rbx,%rax
+	movq	%rdx,%r11
+	adcq	$0,%r11
+	addq	%r12,%r10
+	adcq	$0,%r11
+	movq	%r10,-8(%rdi,%rcx,1)
+
+	cmpq	$0,%rcx
+	jne	.Lsqr4x_1st
+
+	mulq	%r15
+	addq	%rax,%r13
+	leaq	16(%rbp),%rbp
+	adcq	$0,%rdx
+	addq	%r11,%r13
+	adcq	$0,%rdx
+
+	movq	%r13,(%rdi)
+	movq	%rdx,%r12
+	movq	%rdx,8(%rdi)
+	jmp	.Lsqr4x_outer
+
+.align	32
+.Lsqr4x_outer:
+	movq	-32(%rsi,%rbp,1),%r14
+	leaq	48+8(%rsp,%r9,2),%rdi
+	movq	-24(%rsi,%rbp,1),%rax
+	leaq	-32(%rdi,%rbp,1),%rdi
+	movq	-16(%rsi,%rbp,1),%rbx
+	movq	%rax,%r15
+
+	mulq	%r14
+	movq	-24(%rdi,%rbp,1),%r10
+	addq	%rax,%r10
+	movq	%rbx,%rax
+	adcq	$0,%rdx
+	movq	%r10,-24(%rdi,%rbp,1)
+	movq	%rdx,%r11
+
+	mulq	%r14
+	addq	%rax,%r11
+	movq	%rbx,%rax
+	adcq	$0,%rdx
+	addq	-16(%rdi,%rbp,1),%r11
+	movq	%rdx,%r10
+	adcq	$0,%r10
+	movq	%r11,-16(%rdi,%rbp,1)
+
+	xorq	%r12,%r12
+
+	movq	-8(%rsi,%rbp,1),%rbx
+	mulq	%r15
+	addq	%rax,%r12
+	movq	%rbx,%rax
+	adcq	$0,%rdx
+	addq	-8(%rdi,%rbp,1),%r12
+	movq	%rdx,%r13
+	adcq	$0,%r13
+
+	mulq	%r14
+	addq	%rax,%r10
+	movq	%rbx,%rax
+	adcq	$0,%rdx
+	addq	%r12,%r10
+	movq	%rdx,%r11
+	adcq	$0,%r11
+	movq	%r10,-8(%rdi,%rbp,1)
+
+	leaq	(%rbp),%rcx
+	jmp	.Lsqr4x_inner
+
+.align	32
+.Lsqr4x_inner:
+	movq	(%rsi,%rcx,1),%rbx
+	mulq	%r15
+	addq	%rax,%r13
+	movq	%rbx,%rax
+	movq	%rdx,%r12
+	adcq	$0,%r12
+	addq	(%rdi,%rcx,1),%r13
+	adcq	$0,%r12
+
+.byte	0x67
+	mulq	%r14
+	addq	%rax,%r11
+	movq	%rbx,%rax
+	movq	8(%rsi,%rcx,1),%rbx
+	movq	%rdx,%r10
+	adcq	$0,%r10
+	addq	%r13,%r11
+	adcq	$0,%r10
+
+	mulq	%r15
+	addq	%rax,%r12
+	movq	%r11,(%rdi,%rcx,1)
+	movq	%rbx,%rax
+	movq	%rdx,%r13
+	adcq	$0,%r13
+	addq	8(%rdi,%rcx,1),%r12
+	leaq	16(%rcx),%rcx
+	adcq	$0,%r13
+
+	mulq	%r14
+	addq	%rax,%r10
+	movq	%rbx,%rax
+	adcq	$0,%rdx
+	addq	%r12,%r10
+	movq	%rdx,%r11
+	adcq	$0,%r11
+	movq	%r10,-8(%rdi,%rcx,1)
+
+	cmpq	$0,%rcx
+	jne	.Lsqr4x_inner
+
+.byte	0x67
+	mulq	%r15
+	addq	%rax,%r13
+	adcq	$0,%rdx
+	addq	%r11,%r13
+	adcq	$0,%rdx
+
+	movq	%r13,(%rdi)
+	movq	%rdx,%r12
+	movq	%rdx,8(%rdi)
+
+	addq	$16,%rbp
+	jnz	.Lsqr4x_outer
+
+
+	movq	-32(%rsi),%r14
+	leaq	48+8(%rsp,%r9,2),%rdi
+	movq	-24(%rsi),%rax
+	leaq	-32(%rdi,%rbp,1),%rdi
+	movq	-16(%rsi),%rbx
+	movq	%rax,%r15
+
+	mulq	%r14
+	addq	%rax,%r10
+	movq	%rbx,%rax
+	movq	%rdx,%r11
+	adcq	$0,%r11
+
+	mulq	%r14
+	addq	%rax,%r11
+	movq	%rbx,%rax
+	movq	%r10,-24(%rdi)
+	movq	%rdx,%r10
+	adcq	$0,%r10
+	addq	%r13,%r11
+	movq	-8(%rsi),%rbx
+	adcq	$0,%r10
+
+	mulq	%r15
+	addq	%rax,%r12
+	movq	%rbx,%rax
+	movq	%r11,-16(%rdi)
+	movq	%rdx,%r13
+	adcq	$0,%r13
+
+	mulq	%r14
+	addq	%rax,%r10
+	movq	%rbx,%rax
+	movq	%rdx,%r11
+	adcq	$0,%r11
+	addq	%r12,%r10
+	adcq	$0,%r11
+	movq	%r10,-8(%rdi)
+
+	mulq	%r15
+	addq	%rax,%r13
+	movq	-16(%rsi),%rax
+	adcq	$0,%rdx
+	addq	%r11,%r13
+	adcq	$0,%rdx
+
+	movq	%r13,(%rdi)
+	movq	%rdx,%r12
+	movq	%rdx,8(%rdi)
+
+	mulq	%rbx
+	addq	$16,%rbp
+	xorq	%r14,%r14
+	subq	%r9,%rbp
+	xorq	%r15,%r15
+
+	addq	%r12,%rax
+	adcq	$0,%rdx
+	movq	%rax,8(%rdi)
+	movq	%rdx,16(%rdi)
+	movq	%r15,24(%rdi)
+
+	movq	-16(%rsi,%rbp,1),%rax
+	leaq	48+8(%rsp),%rdi
+	xorq	%r10,%r10
+	movq	8(%rdi),%r11
+
+	leaq	(%r14,%r10,2),%r12
+	shrq	$63,%r10
+	leaq	(%rcx,%r11,2),%r13
+	shrq	$63,%r11
+	orq	%r10,%r13
+	movq	16(%rdi),%r10
+	movq	%r11,%r14
+	mulq	%rax
+	negq	%r15
+	movq	24(%rdi),%r11
+	adcq	%rax,%r12
+	movq	-8(%rsi,%rbp,1),%rax
+	movq	%r12,(%rdi)
+	adcq	%rdx,%r13
+
+	leaq	(%r14,%r10,2),%rbx
+	movq	%r13,8(%rdi)
+	sbbq	%r15,%r15
+	shrq	$63,%r10
+	leaq	(%rcx,%r11,2),%r8
+	shrq	$63,%r11
+	orq	%r10,%r8
+	movq	32(%rdi),%r10
+	movq	%r11,%r14
+	mulq	%rax
+	negq	%r15
+	movq	40(%rdi),%r11
+	adcq	%rax,%rbx
+	movq	0(%rsi,%rbp,1),%rax
+	movq	%rbx,16(%rdi)
+	adcq	%rdx,%r8
+	leaq	16(%rbp),%rbp
+	movq	%r8,24(%rdi)
+	sbbq	%r15,%r15
+	leaq	64(%rdi),%rdi
+	jmp	.Lsqr4x_shift_n_add
+
+.align	32
+.Lsqr4x_shift_n_add:
+	leaq	(%r14,%r10,2),%r12
+	shrq	$63,%r10
+	leaq	(%rcx,%r11,2),%r13
+	shrq	$63,%r11
+	orq	%r10,%r13
+	movq	-16(%rdi),%r10
+	movq	%r11,%r14
+	mulq	%rax
+	negq	%r15
+	movq	-8(%rdi),%r11
+	adcq	%rax,%r12
+	movq	-8(%rsi,%rbp,1),%rax
+	movq	%r12,-32(%rdi)
+	adcq	%rdx,%r13
+
+	leaq	(%r14,%r10,2),%rbx
+	movq	%r13,-24(%rdi)
+	sbbq	%r15,%r15
+	shrq	$63,%r10
+	leaq	(%rcx,%r11,2),%r8
+	shrq	$63,%r11
+	orq	%r10,%r8
+	movq	0(%rdi),%r10
+	movq	%r11,%r14
+	mulq	%rax
+	negq	%r15
+	movq	8(%rdi),%r11
+	adcq	%rax,%rbx
+	movq	0(%rsi,%rbp,1),%rax
+	movq	%rbx,-16(%rdi)
+	adcq	%rdx,%r8
+
+	leaq	(%r14,%r10,2),%r12
+	movq	%r8,-8(%rdi)
+	sbbq	%r15,%r15
+	shrq	$63,%r10
+	leaq	(%rcx,%r11,2),%r13
+	shrq	$63,%r11
+	orq	%r10,%r13
+	movq	16(%rdi),%r10
+	movq	%r11,%r14
+	mulq	%rax
+	negq	%r15
+	movq	24(%rdi),%r11
+	adcq	%rax,%r12
+	movq	8(%rsi,%rbp,1),%rax
+	movq	%r12,0(%rdi)
+	adcq	%rdx,%r13
+
+	leaq	(%r14,%r10,2),%rbx
+	movq	%r13,8(%rdi)
+	sbbq	%r15,%r15
+	shrq	$63,%r10
+	leaq	(%rcx,%r11,2),%r8
+	shrq	$63,%r11
+	orq	%r10,%r8
+	movq	32(%rdi),%r10
+	movq	%r11,%r14
+	mulq	%rax
+	negq	%r15
+	movq	40(%rdi),%r11
+	adcq	%rax,%rbx
+	movq	16(%rsi,%rbp,1),%rax
+	movq	%rbx,16(%rdi)
+	adcq	%rdx,%r8
+	movq	%r8,24(%rdi)
+	sbbq	%r15,%r15
+	leaq	64(%rdi),%rdi
+	addq	$32,%rbp
+	jnz	.Lsqr4x_shift_n_add
+
+	leaq	(%r14,%r10,2),%r12
+.byte	0x67
+	shrq	$63,%r10
+	leaq	(%rcx,%r11,2),%r13
+	shrq	$63,%r11
+	orq	%r10,%r13
+	movq	-16(%rdi),%r10
+	movq	%r11,%r14
+	mulq	%rax
+	negq	%r15
+	movq	-8(%rdi),%r11
+	adcq	%rax,%r12
+	movq	-8(%rsi),%rax
+	movq	%r12,-32(%rdi)
+	adcq	%rdx,%r13
+
+	leaq	(%r14,%r10,2),%rbx
+	movq	%r13,-24(%rdi)
+	sbbq	%r15,%r15
+	shrq	$63,%r10
+	leaq	(%rcx,%r11,2),%r8
+	shrq	$63,%r11
+	orq	%r10,%r8
+	mulq	%rax
+	negq	%r15
+	adcq	%rax,%rbx
+	adcq	%rdx,%r8
+	movq	%rbx,-16(%rdi)
+	movq	%r8,-8(%rdi)
+.byte	102,72,15,126,213
+sqr8x_reduction:
+	xorq	%rax,%rax
+	leaq	(%rbp,%r9,2),%rcx
+	leaq	48+8(%rsp,%r9,2),%rdx
+	movq	%rcx,0+8(%rsp)
+	leaq	48+8(%rsp,%r9,1),%rdi
+	movq	%rdx,8+8(%rsp)
+	negq	%r9
+	jmp	.L8x_reduction_loop
+
+.align	32
+.L8x_reduction_loop:
+	leaq	(%rdi,%r9,1),%rdi
+.byte	0x66
+	movq	0(%rdi),%rbx
+	movq	8(%rdi),%r9
+	movq	16(%rdi),%r10
+	movq	24(%rdi),%r11
+	movq	32(%rdi),%r12
+	movq	40(%rdi),%r13
+	movq	48(%rdi),%r14
+	movq	56(%rdi),%r15
+	movq	%rax,(%rdx)
+	leaq	64(%rdi),%rdi
+
+.byte	0x67
+	movq	%rbx,%r8
+	imulq	32+8(%rsp),%rbx
+	movq	0(%rbp),%rax
+	movl	$8,%ecx
+	jmp	.L8x_reduce
+
+.align	32
+.L8x_reduce:
+	mulq	%rbx
+	movq	16(%rbp),%rax
+	negq	%r8
+	movq	%rdx,%r8
+	adcq	$0,%r8
+
+	mulq	%rbx
+	addq	%rax,%r9
+	movq	32(%rbp),%rax
+	adcq	$0,%rdx
+	addq	%r9,%r8
+	movq	%rbx,48-8+8(%rsp,%rcx,8)
+	movq	%rdx,%r9
+	adcq	$0,%r9
+
+	mulq	%rbx
+	addq	%rax,%r10
+	movq	48(%rbp),%rax
+	adcq	$0,%rdx
+	addq	%r10,%r9
+	movq	32+8(%rsp),%rsi
+	movq	%rdx,%r10
+	adcq	$0,%r10
+
+	mulq	%rbx
+	addq	%rax,%r11
+	movq	64(%rbp),%rax
+	adcq	$0,%rdx
+	imulq	%r8,%rsi
+	addq	%r11,%r10
+	movq	%rdx,%r11
+	adcq	$0,%r11
+
+	mulq	%rbx
+	addq	%rax,%r12
+	movq	80(%rbp),%rax
+	adcq	$0,%rdx
+	addq	%r12,%r11
+	movq	%rdx,%r12
+	adcq	$0,%r12
+
+	mulq	%rbx
+	addq	%rax,%r13
+	movq	96(%rbp),%rax
+	adcq	$0,%rdx
+	addq	%r13,%r12
+	movq	%rdx,%r13
+	adcq	$0,%r13
+
+	mulq	%rbx
+	addq	%rax,%r14
+	movq	112(%rbp),%rax
+	adcq	$0,%rdx
+	addq	%r14,%r13
+	movq	%rdx,%r14
+	adcq	$0,%r14
+
+	mulq	%rbx
+	movq	%rsi,%rbx
+	addq	%rax,%r15
+	movq	0(%rbp),%rax
+	adcq	$0,%rdx
+	addq	%r15,%r14
+	movq	%rdx,%r15
+	adcq	$0,%r15
+
+	decl	%ecx
+	jnz	.L8x_reduce
+
+	leaq	128(%rbp),%rbp
+	xorq	%rax,%rax
+	movq	8+8(%rsp),%rdx
+	cmpq	0+8(%rsp),%rbp
+	jae	.L8x_no_tail
+
+.byte	0x66
+	addq	0(%rdi),%r8
+	adcq	8(%rdi),%r9
+	adcq	16(%rdi),%r10
+	adcq	24(%rdi),%r11
+	adcq	32(%rdi),%r12
+	adcq	40(%rdi),%r13
+	adcq	48(%rdi),%r14
+	adcq	56(%rdi),%r15
+	sbbq	%rsi,%rsi
+
+	movq	48+56+8(%rsp),%rbx
+	movl	$8,%ecx
+	movq	0(%rbp),%rax
+	jmp	.L8x_tail
+
+.align	32
+.L8x_tail:
+	mulq	%rbx
+	addq	%rax,%r8
+	movq	16(%rbp),%rax
+	movq	%r8,(%rdi)
+	movq	%rdx,%r8
+	adcq	$0,%r8
+
+	mulq	%rbx
+	addq	%rax,%r9
+	movq	32(%rbp),%rax
+	adcq	$0,%rdx
+	addq	%r9,%r8
+	leaq	8(%rdi),%rdi
+	movq	%rdx,%r9
+	adcq	$0,%r9
+
+	mulq	%rbx
+	addq	%rax,%r10
+	movq	48(%rbp),%rax
+	adcq	$0,%rdx
+	addq	%r10,%r9
+	movq	%rdx,%r10
+	adcq	$0,%r10
+
+	mulq	%rbx
+	addq	%rax,%r11
+	movq	64(%rbp),%rax
+	adcq	$0,%rdx
+	addq	%r11,%r10
+	movq	%rdx,%r11
+	adcq	$0,%r11
+
+	mulq	%rbx
+	addq	%rax,%r12
+	movq	80(%rbp),%rax
+	adcq	$0,%rdx
+	addq	%r12,%r11
+	movq	%rdx,%r12
+	adcq	$0,%r12
+
+	mulq	%rbx
+	addq	%rax,%r13
+	movq	96(%rbp),%rax
+	adcq	$0,%rdx
+	addq	%r13,%r12
+	movq	%rdx,%r13
+	adcq	$0,%r13
+
+	mulq	%rbx
+	addq	%rax,%r14
+	movq	112(%rbp),%rax
+	adcq	$0,%rdx
+	addq	%r14,%r13
+	movq	%rdx,%r14
+	adcq	$0,%r14
+
+	mulq	%rbx
+	movq	48-16+8(%rsp,%rcx,8),%rbx
+	addq	%rax,%r15
+	adcq	$0,%rdx
+	addq	%r15,%r14
+	movq	0(%rbp),%rax
+	movq	%rdx,%r15
+	adcq	$0,%r15
+
+	decl	%ecx
+	jnz	.L8x_tail
+
+	leaq	128(%rbp),%rbp
+	movq	8+8(%rsp),%rdx
+	cmpq	0+8(%rsp),%rbp
+	jae	.L8x_tail_done
+
+	movq	48+56+8(%rsp),%rbx
+	negq	%rsi
+	movq	0(%rbp),%rax
+	adcq	0(%rdi),%r8
+	adcq	8(%rdi),%r9
+	adcq	16(%rdi),%r10
+	adcq	24(%rdi),%r11
+	adcq	32(%rdi),%r12
+	adcq	40(%rdi),%r13
+	adcq	48(%rdi),%r14
+	adcq	56(%rdi),%r15
+	sbbq	%rsi,%rsi
+
+	movl	$8,%ecx
+	jmp	.L8x_tail
+
+.align	32
+.L8x_tail_done:
+	addq	(%rdx),%r8
+	xorq	%rax,%rax
+
+	negq	%rsi
+.L8x_no_tail:
+	adcq	0(%rdi),%r8
+	adcq	8(%rdi),%r9
+	adcq	16(%rdi),%r10
+	adcq	24(%rdi),%r11
+	adcq	32(%rdi),%r12
+	adcq	40(%rdi),%r13
+	adcq	48(%rdi),%r14
+	adcq	56(%rdi),%r15
+	adcq	$0,%rax
+	movq	-16(%rbp),%rcx
+	xorq	%rsi,%rsi
+
+.byte	102,72,15,126,213
+
+	movq	%r8,0(%rdi)
+	movq	%r9,8(%rdi)
+.byte	102,73,15,126,217
+	movq	%r10,16(%rdi)
+	movq	%r11,24(%rdi)
+	movq	%r12,32(%rdi)
+	movq	%r13,40(%rdi)
+	movq	%r14,48(%rdi)
+	movq	%r15,56(%rdi)
+	leaq	64(%rdi),%rdi
+
+	cmpq	%rdx,%rdi
+	jb	.L8x_reduction_loop
+
+	subq	%r15,%rcx
+	leaq	(%rdi,%r9,1),%rbx
+	adcq	%rsi,%rsi
+	movq	%r9,%rcx
+	orq	%rsi,%rax
+.byte	102,72,15,126,207
+	xorq	$1,%rax
+.byte	102,72,15,126,206
+	leaq	(%rbp,%rax,8),%rbp
+	sarq	$3+2,%rcx
+	jmp	.Lsqr4x_sub
+
+.align	32
+.Lsqr4x_sub:
+.byte	0x66
+	movq	0(%rbx),%r12
+	movq	8(%rbx),%r13
+	sbbq	0(%rbp),%r12
+	movq	16(%rbx),%r14
+	sbbq	16(%rbp),%r13
+	movq	24(%rbx),%r15
+	leaq	32(%rbx),%rbx
+	sbbq	32(%rbp),%r14
+	movq	%r12,0(%rdi)
+	sbbq	48(%rbp),%r15
+	leaq	64(%rbp),%rbp
+	movq	%r13,8(%rdi)
+	movq	%r14,16(%rdi)
+	movq	%r15,24(%rdi)
+	leaq	32(%rdi),%rdi
+
+	incq	%rcx
+	jnz	.Lsqr4x_sub
+	movq	%r9,%r10
+	negq	%r9
+	.byte	0xf3,0xc3
+.size	bn_sqr8x_internal,.-bn_sqr8x_internal
+.globl	bn_from_montgomery
+.hidden bn_from_montgomery
+.type	bn_from_montgomery,@function
+.align	32
+bn_from_montgomery:
+	testl	$7,%r9d
+	jz	bn_from_mont8x
+	xorl	%eax,%eax
+	.byte	0xf3,0xc3
+.size	bn_from_montgomery,.-bn_from_montgomery
+
+.type	bn_from_mont8x,@function
+.align	32
+bn_from_mont8x:
+.byte	0x67
+	movq	%rsp,%rax
+	pushq	%rbx
+	pushq	%rbp
+	pushq	%r12
+	pushq	%r13
+	pushq	%r14
+	pushq	%r15
+.byte	0x67
+	movl	%r9d,%r10d
+	shll	$3,%r9d
+	shll	$3+2,%r10d
+	negq	%r9
+	movq	(%r8),%r8
+
+
+
+
+
+
+
+	leaq	-64(%rsp,%r9,2),%r11
+	subq	%rsi,%r11
+	andq	$4095,%r11
+	cmpq	%r11,%r10
+	jb	.Lfrom_sp_alt
+	subq	%r11,%rsp
+	leaq	-64(%rsp,%r9,2),%rsp
+	jmp	.Lfrom_sp_done
+
+.align	32
+.Lfrom_sp_alt:
+	leaq	4096-64(,%r9,2),%r10
+	leaq	-64(%rsp,%r9,2),%rsp
+	subq	%r10,%r11
+	movq	$0,%r10
+	cmovcq	%r10,%r11
+	subq	%r11,%rsp
+.Lfrom_sp_done:
+	andq	$-64,%rsp
+	movq	%r9,%r10
+	negq	%r9
+
+
+
+
+
+
+
+
+
+
+	movq	%r8,32(%rsp)
+	movq	%rax,40(%rsp)
+.Lfrom_body:
+	movq	%r9,%r11
+	leaq	48(%rsp),%rax
+	pxor	%xmm0,%xmm0
+	jmp	.Lmul_by_1
+
+.align	32
+.Lmul_by_1:
+	movdqu	(%rsi),%xmm1
+	movdqu	16(%rsi),%xmm2
+	movdqu	32(%rsi),%xmm3
+	movdqa	%xmm0,(%rax,%r9,1)
+	movdqu	48(%rsi),%xmm4
+	movdqa	%xmm0,16(%rax,%r9,1)
+.byte	0x48,0x8d,0xb6,0x40,0x00,0x00,0x00
+	movdqa	%xmm1,(%rax)
+	movdqa	%xmm0,32(%rax,%r9,1)
+	movdqa	%xmm2,16(%rax)
+	movdqa	%xmm0,48(%rax,%r9,1)
+	movdqa	%xmm3,32(%rax)
+	movdqa	%xmm4,48(%rax)
+	leaq	64(%rax),%rax
+	subq	$64,%r11
+	jnz	.Lmul_by_1
+
+.byte	102,72,15,110,207
+.byte	102,72,15,110,209
+.byte	0x67
+	movq	%rcx,%rbp
+.byte	102,73,15,110,218
+	call	sqr8x_reduction
+
+	pxor	%xmm0,%xmm0
+	leaq	48(%rsp),%rax
+	movq	40(%rsp),%rsi
+	jmp	.Lfrom_mont_zero
+
+.align	32
+.Lfrom_mont_zero:
+	movdqa	%xmm0,0(%rax)
+	movdqa	%xmm0,16(%rax)
+	movdqa	%xmm0,32(%rax)
+	movdqa	%xmm0,48(%rax)
+	leaq	64(%rax),%rax
+	subq	$32,%r9
+	jnz	.Lfrom_mont_zero
+
+	movq	$1,%rax
+	movq	-48(%rsi),%r15
+	movq	-40(%rsi),%r14
+	movq	-32(%rsi),%r13
+	movq	-24(%rsi),%r12
+	movq	-16(%rsi),%rbp
+	movq	-8(%rsi),%rbx
+	leaq	(%rsi),%rsp
+.Lfrom_epilogue:
+	.byte	0xf3,0xc3
+.size	bn_from_mont8x,.-bn_from_mont8x
+.globl	bn_scatter5
+.hidden bn_scatter5
+.type	bn_scatter5,@function
+.align	16
+bn_scatter5:
+	cmpl	$0,%esi
+	jz	.Lscatter_epilogue
+	leaq	(%rdx,%rcx,8),%rdx
+.Lscatter:
+	movq	(%rdi),%rax
+	leaq	8(%rdi),%rdi
+	movq	%rax,(%rdx)
+	leaq	256(%rdx),%rdx
+	subl	$1,%esi
+	jnz	.Lscatter
+.Lscatter_epilogue:
+	.byte	0xf3,0xc3
+.size	bn_scatter5,.-bn_scatter5
+
+.globl	bn_gather5
+.hidden bn_gather5
+.type	bn_gather5,@function
+.align	16
+bn_gather5:
+	movl	%ecx,%r11d
+	shrl	$3,%ecx
+	andq	$7,%r11
+	notl	%ecx
+	leaq	.Lmagic_masks(%rip),%rax
+	andl	$3,%ecx
+	leaq	128(%rdx,%r11,8),%rdx
+	movq	0(%rax,%rcx,8),%xmm4
+	movq	8(%rax,%rcx,8),%xmm5
+	movq	16(%rax,%rcx,8),%xmm6
+	movq	24(%rax,%rcx,8),%xmm7
+	jmp	.Lgather
+.align	16
+.Lgather:
+	movq	-128(%rdx),%xmm0
+	movq	-64(%rdx),%xmm1
+	pand	%xmm4,%xmm0
+	movq	0(%rdx),%xmm2
+	pand	%xmm5,%xmm1
+	movq	64(%rdx),%xmm3
+	pand	%xmm6,%xmm2
+	por	%xmm1,%xmm0
+	pand	%xmm7,%xmm3
+.byte	0x67,0x67
+	por	%xmm2,%xmm0
+	leaq	256(%rdx),%rdx
+	por	%xmm3,%xmm0
+
+	movq	%xmm0,(%rdi)
+	leaq	8(%rdi),%rdi
+	subl	$1,%esi
+	jnz	.Lgather
+	.byte	0xf3,0xc3
+.LSEH_end_bn_gather5:
+.size	bn_gather5,.-bn_gather5
+.align	64
+.Lmagic_masks:
+.long	0,0, 0,0, 0,0, -1,-1
+.long	0,0, 0,0, 0,0,  0,0
+.byte	77,111,110,116,103,111,109,101,114,121,32,77,117,108,116,105,112,108,105,99,97,116,105,111,110,32,119,105,116,104,32,115,99,97,116,116,101,114,47,103,97,116,104,101,114,32,102,111,114,32,120,56,54,95,54,52,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0
+#endif
diff --git a/third_party/boringssl/linux-x86_64/crypto/cpu-x86_64-asm.S b/third_party/boringssl/linux-x86_64/crypto/cpu-x86_64-asm.S
new file mode 100644
index 0000000..9eef154
--- /dev/null
+++ b/third_party/boringssl/linux-x86_64/crypto/cpu-x86_64-asm.S
@@ -0,0 +1,143 @@
+#if defined(__x86_64__)
+.text	
+
+.globl	OPENSSL_ia32_cpuid
+.hidden OPENSSL_ia32_cpuid
+.type	OPENSSL_ia32_cpuid,@function
+.align	16
+OPENSSL_ia32_cpuid:
+
+
+	movq	%rdi,%rdi
+	movq	%rbx,%r8
+
+	xorl	%eax,%eax
+	movl	%eax,8(%rdi)
+	cpuid
+	movl	%eax,%r11d
+
+	xorl	%eax,%eax
+	cmpl	$1970169159,%ebx
+	setne	%al
+	movl	%eax,%r9d
+	cmpl	$1231384169,%edx
+	setne	%al
+	orl	%eax,%r9d
+	cmpl	$1818588270,%ecx
+	setne	%al
+	orl	%eax,%r9d
+	jz	.Lintel
+
+	cmpl	$1752462657,%ebx
+	setne	%al
+	movl	%eax,%r10d
+	cmpl	$1769238117,%edx
+	setne	%al
+	orl	%eax,%r10d
+	cmpl	$1145913699,%ecx
+	setne	%al
+	orl	%eax,%r10d
+	jnz	.Lintel
+
+
+
+
+	movl	$2147483648,%eax
+	cpuid
+
+
+	cmpl	$2147483649,%eax
+	jb	.Lintel
+	movl	%eax,%r10d
+	movl	$2147483649,%eax
+	cpuid
+
+
+	orl	%ecx,%r9d
+	andl	$2049,%r9d
+
+	cmpl	$2147483656,%r10d
+	jb	.Lintel
+
+	movl	$2147483656,%eax
+	cpuid
+
+	movzbq	%cl,%r10
+	incq	%r10
+
+	movl	$1,%eax
+	cpuid
+
+	btl	$28,%edx
+	jnc	.Lgeneric
+	shrl	$16,%ebx
+	cmpb	%r10b,%bl
+	ja	.Lgeneric
+	andl	$4026531839,%edx
+	jmp	.Lgeneric
+
+.Lintel:
+	cmpl	$4,%r11d
+	movl	$-1,%r10d
+	jb	.Lnocacheinfo
+
+	movl	$4,%eax
+	movl	$0,%ecx
+	cpuid
+	movl	%eax,%r10d
+	shrl	$14,%r10d
+	andl	$4095,%r10d
+
+	cmpl	$7,%r11d
+	jb	.Lnocacheinfo
+
+	movl	$7,%eax
+	xorl	%ecx,%ecx
+	cpuid
+	movl	%ebx,8(%rdi)
+
+.Lnocacheinfo:
+	movl	$1,%eax
+	cpuid
+
+	andl	$3220176895,%edx
+	cmpl	$0,%r9d
+	jne	.Lnotintel
+	orl	$1073741824,%edx
+.Lnotintel:
+	btl	$28,%edx
+	jnc	.Lgeneric
+	andl	$4026531839,%edx
+	cmpl	$0,%r10d
+	je	.Lgeneric
+
+	orl	$268435456,%edx
+	shrl	$16,%ebx
+	cmpb	$1,%bl
+	ja	.Lgeneric
+	andl	$4026531839,%edx
+.Lgeneric:
+	andl	$2048,%r9d
+	andl	$4294965247,%ecx
+	orl	%ecx,%r9d
+
+	movl	%edx,%r10d
+	btl	$27,%r9d
+	jnc	.Lclear_avx
+	xorl	%ecx,%ecx
+.byte	0x0f,0x01,0xd0
+	andl	$6,%eax
+	cmpl	$6,%eax
+	je	.Ldone
+.Lclear_avx:
+	movl	$4026525695,%eax
+	andl	%eax,%r9d
+	andl	$4294967263,8(%rdi)
+.Ldone:
+	movl	%r9d,4(%rdi)
+	movl	%r10d,0(%rdi)
+	movq	%r8,%rbx
+	.byte	0xf3,0xc3
+.size	OPENSSL_ia32_cpuid,.-OPENSSL_ia32_cpuid
+
+#endif
diff --git a/third_party/boringssl/linux-x86_64/crypto/md5/md5-x86_64.S b/third_party/boringssl/linux-x86_64/crypto/md5/md5-x86_64.S
new file mode 100644
index 0000000..7644689
--- /dev/null
+++ b/third_party/boringssl/linux-x86_64/crypto/md5/md5-x86_64.S
@@ -0,0 +1,671 @@
+#if defined(__x86_64__)
+.text	
+.align	16
+
+.globl	md5_block_asm_data_order
+.hidden md5_block_asm_data_order
+.type	md5_block_asm_data_order,@function
+md5_block_asm_data_order:
+	pushq	%rbp
+	pushq	%rbx
+	pushq	%r12
+	pushq	%r14
+	pushq	%r15
+.Lprologue:
+
+
+
+
+	movq	%rdi,%rbp
+	shlq	$6,%rdx
+	leaq	(%rsi,%rdx,1),%rdi
+	movl	0(%rbp),%eax
+	movl	4(%rbp),%ebx
+	movl	8(%rbp),%ecx
+	movl	12(%rbp),%edx
+
+
+
+
+
+
+
+	cmpq	%rdi,%rsi
+	je	.Lend
+
+
+.Lloop:
+	movl	%eax,%r8d
+	movl	%ebx,%r9d
+	movl	%ecx,%r14d
+	movl	%edx,%r15d
+	movl	0(%rsi),%r10d
+	movl	%edx,%r11d
+	xorl	%ecx,%r11d
+	leal	-680876936(%rax,%r10,1),%eax
+	andl	%ebx,%r11d
+	xorl	%edx,%r11d
+	movl	4(%rsi),%r10d
+	addl	%r11d,%eax
+	roll	$7,%eax
+	movl	%ecx,%r11d
+	addl	%ebx,%eax
+	xorl	%ebx,%r11d
+	leal	-389564586(%rdx,%r10,1),%edx
+	andl	%eax,%r11d
+	xorl	%ecx,%r11d
+	movl	8(%rsi),%r10d
+	addl	%r11d,%edx
+	roll	$12,%edx
+	movl	%ebx,%r11d
+	addl	%eax,%edx
+	xorl	%eax,%r11d
+	leal	606105819(%rcx,%r10,1),%ecx
+	andl	%edx,%r11d
+	xorl	%ebx,%r11d
+	movl	12(%rsi),%r10d
+	addl	%r11d,%ecx
+	roll	$17,%ecx
+	movl	%eax,%r11d
+	addl	%edx,%ecx
+	xorl	%edx,%r11d
+	leal	-1044525330(%rbx,%r10,1),%ebx
+	andl	%ecx,%r11d
+	xorl	%eax,%r11d
+	movl	16(%rsi),%r10d
+	addl	%r11d,%ebx
+	roll	$22,%ebx
+	movl	%edx,%r11d
+	addl	%ecx,%ebx
+	xorl	%ecx,%r11d
+	leal	-176418897(%rax,%r10,1),%eax
+	andl	%ebx,%r11d
+	xorl	%edx,%r11d
+	movl	20(%rsi),%r10d
+	addl	%r11d,%eax
+	roll	$7,%eax
+	movl	%ecx,%r11d
+	addl	%ebx,%eax
+	xorl	%ebx,%r11d
+	leal	1200080426(%rdx,%r10,1),%edx
+	andl	%eax,%r11d
+	xorl	%ecx,%r11d
+	movl	24(%rsi),%r10d
+	addl	%r11d,%edx
+	roll	$12,%edx
+	movl	%ebx,%r11d
+	addl	%eax,%edx
+	xorl	%eax,%r11d
+	leal	-1473231341(%rcx,%r10,1),%ecx
+	andl	%edx,%r11d
+	xorl	%ebx,%r11d
+	movl	28(%rsi),%r10d
+	addl	%r11d,%ecx
+	roll	$17,%ecx
+	movl	%eax,%r11d
+	addl	%edx,%ecx
+	xorl	%edx,%r11d
+	leal	-45705983(%rbx,%r10,1),%ebx
+	andl	%ecx,%r11d
+	xorl	%eax,%r11d
+	movl	32(%rsi),%r10d
+	addl	%r11d,%ebx
+	roll	$22,%ebx
+	movl	%edx,%r11d
+	addl	%ecx,%ebx
+	xorl	%ecx,%r11d
+	leal	1770035416(%rax,%r10,1),%eax
+	andl	%ebx,%r11d
+	xorl	%edx,%r11d
+	movl	36(%rsi),%r10d
+	addl	%r11d,%eax
+	roll	$7,%eax
+	movl	%ecx,%r11d
+	addl	%ebx,%eax
+	xorl	%ebx,%r11d
+	leal	-1958414417(%rdx,%r10,1),%edx
+	andl	%eax,%r11d
+	xorl	%ecx,%r11d
+	movl	40(%rsi),%r10d
+	addl	%r11d,%edx
+	roll	$12,%edx
+	movl	%ebx,%r11d
+	addl	%eax,%edx
+	xorl	%eax,%r11d
+	leal	-42063(%rcx,%r10,1),%ecx
+	andl	%edx,%r11d
+	xorl	%ebx,%r11d
+	movl	44(%rsi),%r10d
+	addl	%r11d,%ecx
+	roll	$17,%ecx
+	movl	%eax,%r11d
+	addl	%edx,%ecx
+	xorl	%edx,%r11d
+	leal	-1990404162(%rbx,%r10,1),%ebx
+	andl	%ecx,%r11d
+	xorl	%eax,%r11d
+	movl	48(%rsi),%r10d
+	addl	%r11d,%ebx
+	roll	$22,%ebx
+	movl	%edx,%r11d
+	addl	%ecx,%ebx
+	xorl	%ecx,%r11d
+	leal	1804603682(%rax,%r10,1),%eax
+	andl	%ebx,%r11d
+	xorl	%edx,%r11d
+	movl	52(%rsi),%r10d
+	addl	%r11d,%eax
+	roll	$7,%eax
+	movl	%ecx,%r11d
+	addl	%ebx,%eax
+	xorl	%ebx,%r11d
+	leal	-40341101(%rdx,%r10,1),%edx
+	andl	%eax,%r11d
+	xorl	%ecx,%r11d
+	movl	56(%rsi),%r10d
+	addl	%r11d,%edx
+	roll	$12,%edx
+	movl	%ebx,%r11d
+	addl	%eax,%edx
+	xorl	%eax,%r11d
+	leal	-1502002290(%rcx,%r10,1),%ecx
+	andl	%edx,%r11d
+	xorl	%ebx,%r11d
+	movl	60(%rsi),%r10d
+	addl	%r11d,%ecx
+	roll	$17,%ecx
+	movl	%eax,%r11d
+	addl	%edx,%ecx
+	xorl	%edx,%r11d
+	leal	1236535329(%rbx,%r10,1),%ebx
+	andl	%ecx,%r11d
+	xorl	%eax,%r11d
+	movl	0(%rsi),%r10d
+	addl	%r11d,%ebx
+	roll	$22,%ebx
+	movl	%edx,%r11d
+	addl	%ecx,%ebx
+	movl	4(%rsi),%r10d
+	movl	%edx,%r11d
+	movl	%edx,%r12d
+	notl	%r11d
+	leal	-165796510(%rax,%r10,1),%eax
+	andl	%ebx,%r12d
+	andl	%ecx,%r11d
+	movl	24(%rsi),%r10d
+	orl	%r11d,%r12d
+	movl	%ecx,%r11d
+	addl	%r12d,%eax
+	movl	%ecx,%r12d
+	roll	$5,%eax
+	addl	%ebx,%eax
+	notl	%r11d
+	leal	-1069501632(%rdx,%r10,1),%edx
+	andl	%eax,%r12d
+	andl	%ebx,%r11d
+	movl	44(%rsi),%r10d
+	orl	%r11d,%r12d
+	movl	%ebx,%r11d
+	addl	%r12d,%edx
+	movl	%ebx,%r12d
+	roll	$9,%edx
+	addl	%eax,%edx
+	notl	%r11d
+	leal	643717713(%rcx,%r10,1),%ecx
+	andl	%edx,%r12d
+	andl	%eax,%r11d
+	movl	0(%rsi),%r10d
+	orl	%r11d,%r12d
+	movl	%eax,%r11d
+	addl	%r12d,%ecx
+	movl	%eax,%r12d
+	roll	$14,%ecx
+	addl	%edx,%ecx
+	notl	%r11d
+	leal	-373897302(%rbx,%r10,1),%ebx
+	andl	%ecx,%r12d
+	andl	%edx,%r11d
+	movl	20(%rsi),%r10d
+	orl	%r11d,%r12d
+	movl	%edx,%r11d
+	addl	%r12d,%ebx
+	movl	%edx,%r12d
+	roll	$20,%ebx
+	addl	%ecx,%ebx
+	notl	%r11d
+	leal	-701558691(%rax,%r10,1),%eax
+	andl	%ebx,%r12d
+	andl	%ecx,%r11d
+	movl	40(%rsi),%r10d
+	orl	%r11d,%r12d
+	movl	%ecx,%r11d
+	addl	%r12d,%eax
+	movl	%ecx,%r12d
+	roll	$5,%eax
+	addl	%ebx,%eax
+	notl	%r11d
+	leal	38016083(%rdx,%r10,1),%edx
+	andl	%eax,%r12d
+	andl	%ebx,%r11d
+	movl	60(%rsi),%r10d
+	orl	%r11d,%r12d
+	movl	%ebx,%r11d
+	addl	%r12d,%edx
+	movl	%ebx,%r12d
+	roll	$9,%edx
+	addl	%eax,%edx
+	notl	%r11d
+	leal	-660478335(%rcx,%r10,1),%ecx
+	andl	%edx,%r12d
+	andl	%eax,%r11d
+	movl	16(%rsi),%r10d
+	orl	%r11d,%r12d
+	movl	%eax,%r11d
+	addl	%r12d,%ecx
+	movl	%eax,%r12d
+	roll	$14,%ecx
+	addl	%edx,%ecx
+	notl	%r11d
+	leal	-405537848(%rbx,%r10,1),%ebx
+	andl	%ecx,%r12d
+	andl	%edx,%r11d
+	movl	36(%rsi),%r10d
+	orl	%r11d,%r12d
+	movl	%edx,%r11d
+	addl	%r12d,%ebx
+	movl	%edx,%r12d
+	roll	$20,%ebx
+	addl	%ecx,%ebx
+	notl	%r11d
+	leal	568446438(%rax,%r10,1),%eax
+	andl	%ebx,%r12d
+	andl	%ecx,%r11d
+	movl	56(%rsi),%r10d
+	orl	%r11d,%r12d
+	movl	%ecx,%r11d
+	addl	%r12d,%eax
+	movl	%ecx,%r12d
+	roll	$5,%eax
+	addl	%ebx,%eax
+	notl	%r11d
+	leal	-1019803690(%rdx,%r10,1),%edx
+	andl	%eax,%r12d
+	andl	%ebx,%r11d
+	movl	12(%rsi),%r10d
+	orl	%r11d,%r12d
+	movl	%ebx,%r11d
+	addl	%r12d,%edx
+	movl	%ebx,%r12d
+	roll	$9,%edx
+	addl	%eax,%edx
+	notl	%r11d
+	leal	-187363961(%rcx,%r10,1),%ecx
+	andl	%edx,%r12d
+	andl	%eax,%r11d
+	movl	32(%rsi),%r10d
+	orl	%r11d,%r12d
+	movl	%eax,%r11d
+	addl	%r12d,%ecx
+	movl	%eax,%r12d
+	roll	$14,%ecx
+	addl	%edx,%ecx
+	notl	%r11d
+	leal	1163531501(%rbx,%r10,1),%ebx
+	andl	%ecx,%r12d
+	andl	%edx,%r11d
+	movl	52(%rsi),%r10d
+	orl	%r11d,%r12d
+	movl	%edx,%r11d
+	addl	%r12d,%ebx
+	movl	%edx,%r12d
+	roll	$20,%ebx
+	addl	%ecx,%ebx
+	notl	%r11d
+	leal	-1444681467(%rax,%r10,1),%eax
+	andl	%ebx,%r12d
+	andl	%ecx,%r11d
+	movl	8(%rsi),%r10d
+	orl	%r11d,%r12d
+	movl	%ecx,%r11d
+	addl	%r12d,%eax
+	movl	%ecx,%r12d
+	roll	$5,%eax
+	addl	%ebx,%eax
+	notl	%r11d
+	leal	-51403784(%rdx,%r10,1),%edx
+	andl	%eax,%r12d
+	andl	%ebx,%r11d
+	movl	28(%rsi),%r10d
+	orl	%r11d,%r12d
+	movl	%ebx,%r11d
+	addl	%r12d,%edx
+	movl	%ebx,%r12d
+	roll	$9,%edx
+	addl	%eax,%edx
+	notl	%r11d
+	leal	1735328473(%rcx,%r10,1),%ecx
+	andl	%edx,%r12d
+	andl	%eax,%r11d
+	movl	48(%rsi),%r10d
+	orl	%r11d,%r12d
+	movl	%eax,%r11d
+	addl	%r12d,%ecx
+	movl	%eax,%r12d
+	roll	$14,%ecx
+	addl	%edx,%ecx
+	notl	%r11d
+	leal	-1926607734(%rbx,%r10,1),%ebx
+	andl	%ecx,%r12d
+	andl	%edx,%r11d
+	movl	0(%rsi),%r10d
+	orl	%r11d,%r12d
+	movl	%edx,%r11d
+	addl	%r12d,%ebx
+	movl	%edx,%r12d
+	roll	$20,%ebx
+	addl	%ecx,%ebx
+	movl	20(%rsi),%r10d
+	movl	%ecx,%r11d
+	leal	-378558(%rax,%r10,1),%eax
+	movl	32(%rsi),%r10d
+	xorl	%edx,%r11d
+	xorl	%ebx,%r11d
+	addl	%r11d,%eax
+	roll	$4,%eax
+	movl	%ebx,%r11d
+	addl	%ebx,%eax
+	leal	-2022574463(%rdx,%r10,1),%edx
+	movl	44(%rsi),%r10d
+	xorl	%ecx,%r11d
+	xorl	%eax,%r11d
+	addl	%r11d,%edx
+	roll	$11,%edx
+	movl	%eax,%r11d
+	addl	%eax,%edx
+	leal	1839030562(%rcx,%r10,1),%ecx
+	movl	56(%rsi),%r10d
+	xorl	%ebx,%r11d
+	xorl	%edx,%r11d
+	addl	%r11d,%ecx
+	roll	$16,%ecx
+	movl	%edx,%r11d
+	addl	%edx,%ecx
+	leal	-35309556(%rbx,%r10,1),%ebx
+	movl	4(%rsi),%r10d
+	xorl	%eax,%r11d
+	xorl	%ecx,%r11d
+	addl	%r11d,%ebx
+	roll	$23,%ebx
+	movl	%ecx,%r11d
+	addl	%ecx,%ebx
+	leal	-1530992060(%rax,%r10,1),%eax
+	movl	16(%rsi),%r10d
+	xorl	%edx,%r11d
+	xorl	%ebx,%r11d
+	addl	%r11d,%eax
+	roll	$4,%eax
+	movl	%ebx,%r11d
+	addl	%ebx,%eax
+	leal	1272893353(%rdx,%r10,1),%edx
+	movl	28(%rsi),%r10d
+	xorl	%ecx,%r11d
+	xorl	%eax,%r11d
+	addl	%r11d,%edx
+	roll	$11,%edx
+	movl	%eax,%r11d
+	addl	%eax,%edx
+	leal	-155497632(%rcx,%r10,1),%ecx
+	movl	40(%rsi),%r10d
+	xorl	%ebx,%r11d
+	xorl	%edx,%r11d
+	addl	%r11d,%ecx
+	roll	$16,%ecx
+	movl	%edx,%r11d
+	addl	%edx,%ecx
+	leal	-1094730640(%rbx,%r10,1),%ebx
+	movl	52(%rsi),%r10d
+	xorl	%eax,%r11d
+	xorl	%ecx,%r11d
+	addl	%r11d,%ebx
+	roll	$23,%ebx
+	movl	%ecx,%r11d
+	addl	%ecx,%ebx
+	leal	681279174(%rax,%r10,1),%eax
+	movl	0(%rsi),%r10d
+	xorl	%edx,%r11d
+	xorl	%ebx,%r11d
+	addl	%r11d,%eax
+	roll	$4,%eax
+	movl	%ebx,%r11d
+	addl	%ebx,%eax
+	leal	-358537222(%rdx,%r10,1),%edx
+	movl	12(%rsi),%r10d
+	xorl	%ecx,%r11d
+	xorl	%eax,%r11d
+	addl	%r11d,%edx
+	roll	$11,%edx
+	movl	%eax,%r11d
+	addl	%eax,%edx
+	leal	-722521979(%rcx,%r10,1),%ecx
+	movl	24(%rsi),%r10d
+	xorl	%ebx,%r11d
+	xorl	%edx,%r11d
+	addl	%r11d,%ecx
+	roll	$16,%ecx
+	movl	%edx,%r11d
+	addl	%edx,%ecx
+	leal	76029189(%rbx,%r10,1),%ebx
+	movl	36(%rsi),%r10d
+	xorl	%eax,%r11d
+	xorl	%ecx,%r11d
+	addl	%r11d,%ebx
+	roll	$23,%ebx
+	movl	%ecx,%r11d
+	addl	%ecx,%ebx
+	leal	-640364487(%rax,%r10,1),%eax
+	movl	48(%rsi),%r10d
+	xorl	%edx,%r11d
+	xorl	%ebx,%r11d
+	addl	%r11d,%eax
+	roll	$4,%eax
+	movl	%ebx,%r11d
+	addl	%ebx,%eax
+	leal	-421815835(%rdx,%r10,1),%edx
+	movl	60(%rsi),%r10d
+	xorl	%ecx,%r11d
+	xorl	%eax,%r11d
+	addl	%r11d,%edx
+	roll	$11,%edx
+	movl	%eax,%r11d
+	addl	%eax,%edx
+	leal	530742520(%rcx,%r10,1),%ecx
+	movl	8(%rsi),%r10d
+	xorl	%ebx,%r11d
+	xorl	%edx,%r11d
+	addl	%r11d,%ecx
+	roll	$16,%ecx
+	movl	%edx,%r11d
+	addl	%edx,%ecx
+	leal	-995338651(%rbx,%r10,1),%ebx
+	movl	0(%rsi),%r10d
+	xorl	%eax,%r11d
+	xorl	%ecx,%r11d
+	addl	%r11d,%ebx
+	roll	$23,%ebx
+	movl	%ecx,%r11d
+	addl	%ecx,%ebx
+	movl	0(%rsi),%r10d
+	movl	$4294967295,%r11d
+	xorl	%edx,%r11d
+	leal	-198630844(%rax,%r10,1),%eax
+	orl	%ebx,%r11d
+	xorl	%ecx,%r11d
+	addl	%r11d,%eax
+	movl	28(%rsi),%r10d
+	movl	$4294967295,%r11d
+	roll	$6,%eax
+	xorl	%ecx,%r11d
+	addl	%ebx,%eax
+	leal	1126891415(%rdx,%r10,1),%edx
+	orl	%eax,%r11d
+	xorl	%ebx,%r11d
+	addl	%r11d,%edx
+	movl	56(%rsi),%r10d
+	movl	$4294967295,%r11d
+	roll	$10,%edx
+	xorl	%ebx,%r11d
+	addl	%eax,%edx
+	leal	-1416354905(%rcx,%r10,1),%ecx
+	orl	%edx,%r11d
+	xorl	%eax,%r11d
+	addl	%r11d,%ecx
+	movl	20(%rsi),%r10d
+	movl	$4294967295,%r11d
+	roll	$15,%ecx
+	xorl	%eax,%r11d
+	addl	%edx,%ecx
+	leal	-57434055(%rbx,%r10,1),%ebx
+	orl	%ecx,%r11d
+	xorl	%edx,%r11d
+	addl	%r11d,%ebx
+	movl	48(%rsi),%r10d
+	movl	$4294967295,%r11d
+	roll	$21,%ebx
+	xorl	%edx,%r11d
+	addl	%ecx,%ebx
+	leal	1700485571(%rax,%r10,1),%eax
+	orl	%ebx,%r11d
+	xorl	%ecx,%r11d
+	addl	%r11d,%eax
+	movl	12(%rsi),%r10d
+	movl	$4294967295,%r11d
+	roll	$6,%eax
+	xorl	%ecx,%r11d
+	addl	%ebx,%eax
+	leal	-1894986606(%rdx,%r10,1),%edx
+	orl	%eax,%r11d
+	xorl	%ebx,%r11d
+	addl	%r11d,%edx
+	movl	40(%rsi),%r10d
+	movl	$4294967295,%r11d
+	roll	$10,%edx
+	xorl	%ebx,%r11d
+	addl	%eax,%edx
+	leal	-1051523(%rcx,%r10,1),%ecx
+	orl	%edx,%r11d
+	xorl	%eax,%r11d
+	addl	%r11d,%ecx
+	movl	4(%rsi),%r10d
+	movl	$4294967295,%r11d
+	roll	$15,%ecx
+	xorl	%eax,%r11d
+	addl	%edx,%ecx
+	leal	-2054922799(%rbx,%r10,1),%ebx
+	orl	%ecx,%r11d
+	xorl	%edx,%r11d
+	addl	%r11d,%ebx
+	movl	32(%rsi),%r10d
+	movl	$4294967295,%r11d
+	roll	$21,%ebx
+	xorl	%edx,%r11d
+	addl	%ecx,%ebx
+	leal	1873313359(%rax,%r10,1),%eax
+	orl	%ebx,%r11d
+	xorl	%ecx,%r11d
+	addl	%r11d,%eax
+	movl	60(%rsi),%r10d
+	movl	$4294967295,%r11d
+	roll	$6,%eax
+	xorl	%ecx,%r11d
+	addl	%ebx,%eax
+	leal	-30611744(%rdx,%r10,1),%edx
+	orl	%eax,%r11d
+	xorl	%ebx,%r11d
+	addl	%r11d,%edx
+	movl	24(%rsi),%r10d
+	movl	$4294967295,%r11d
+	roll	$10,%edx
+	xorl	%ebx,%r11d
+	addl	%eax,%edx
+	leal	-1560198380(%rcx,%r10,1),%ecx
+	orl	%edx,%r11d
+	xorl	%eax,%r11d
+	addl	%r11d,%ecx
+	movl	52(%rsi),%r10d
+	movl	$4294967295,%r11d
+	roll	$15,%ecx
+	xorl	%eax,%r11d
+	addl	%edx,%ecx
+	leal	1309151649(%rbx,%r10,1),%ebx
+	orl	%ecx,%r11d
+	xorl	%edx,%r11d
+	addl	%r11d,%ebx
+	movl	16(%rsi),%r10d
+	movl	$4294967295,%r11d
+	roll	$21,%ebx
+	xorl	%edx,%r11d
+	addl	%ecx,%ebx
+	leal	-145523070(%rax,%r10,1),%eax
+	orl	%ebx,%r11d
+	xorl	%ecx,%r11d
+	addl	%r11d,%eax
+	movl	44(%rsi),%r10d
+	movl	$4294967295,%r11d
+	roll	$6,%eax
+	xorl	%ecx,%r11d
+	addl	%ebx,%eax
+	leal	-1120210379(%rdx,%r10,1),%edx
+	orl	%eax,%r11d
+	xorl	%ebx,%r11d
+	addl	%r11d,%edx
+	movl	8(%rsi),%r10d
+	movl	$4294967295,%r11d
+	roll	$10,%edx
+	xorl	%ebx,%r11d
+	addl	%eax,%edx
+	leal	718787259(%rcx,%r10,1),%ecx
+	orl	%edx,%r11d
+	xorl	%eax,%r11d
+	addl	%r11d,%ecx
+	movl	36(%rsi),%r10d
+	movl	$4294967295,%r11d
+	roll	$15,%ecx
+	xorl	%eax,%r11d
+	addl	%edx,%ecx
+	leal	-343485551(%rbx,%r10,1),%ebx
+	orl	%ecx,%r11d
+	xorl	%edx,%r11d
+	addl	%r11d,%ebx
+	movl	0(%rsi),%r10d
+	movl	$4294967295,%r11d
+	roll	$21,%ebx
+	xorl	%edx,%r11d
+	addl	%ecx,%ebx
+
+	addl	%r8d,%eax
+	addl	%r9d,%ebx
+	addl	%r14d,%ecx
+	addl	%r15d,%edx
+
+
+	addq	$64,%rsi
+	cmpq	%rdi,%rsi
+	jb	.Lloop
+
+
+.Lend:
+	movl	%eax,0(%rbp)
+	movl	%ebx,4(%rbp)
+	movl	%ecx,8(%rbp)
+	movl	%edx,12(%rbp)
+
+	movq	(%rsp),%r15
+	movq	8(%rsp),%r14
+	movq	16(%rsp),%r12
+	movq	24(%rsp),%rbx
+	movq	32(%rsp),%rbp
+	addq	$40,%rsp
+.Lepilogue:
+	.byte	0xf3,0xc3
+.size	md5_block_asm_data_order,.-md5_block_asm_data_order
+#endif
diff --git a/third_party/boringssl/linux-x86_64/crypto/modes/aesni-gcm-x86_64.S b/third_party/boringssl/linux-x86_64/crypto/modes/aesni-gcm-x86_64.S
new file mode 100644
index 0000000..f01692e
--- /dev/null
+++ b/third_party/boringssl/linux-x86_64/crypto/modes/aesni-gcm-x86_64.S
@@ -0,0 +1,19 @@
+#if defined(__x86_64__)
+.text	
+
+.globl	aesni_gcm_encrypt
+.hidden aesni_gcm_encrypt
+.type	aesni_gcm_encrypt,@function
+aesni_gcm_encrypt:
+	xorl	%eax,%eax
+	.byte	0xf3,0xc3
+.size	aesni_gcm_encrypt,.-aesni_gcm_encrypt
+
+.globl	aesni_gcm_decrypt
+.hidden aesni_gcm_decrypt
+.type	aesni_gcm_decrypt,@function
+aesni_gcm_decrypt:
+	xorl	%eax,%eax
+	.byte	0xf3,0xc3
+.size	aesni_gcm_decrypt,.-aesni_gcm_decrypt
+#endif
diff --git a/third_party/boringssl/linux-x86_64/crypto/modes/ghash-x86_64.S b/third_party/boringssl/linux-x86_64/crypto/modes/ghash-x86_64.S
new file mode 100644
index 0000000..1db7d69
--- /dev/null
+++ b/third_party/boringssl/linux-x86_64/crypto/modes/ghash-x86_64.S
@@ -0,0 +1,1329 @@
+#if defined(__x86_64__)
+.text	
+.extern	OPENSSL_ia32cap_P
+.hidden OPENSSL_ia32cap_P
+
+.globl	gcm_gmult_4bit
+.hidden gcm_gmult_4bit
+.type	gcm_gmult_4bit,@function
+.align	16
+gcm_gmult_4bit:
+	pushq	%rbx
+	pushq	%rbp
+	pushq	%r12
+.Lgmult_prologue:
+
+	movzbq	15(%rdi),%r8
+	leaq	.Lrem_4bit(%rip),%r11
+	xorq	%rax,%rax
+	xorq	%rbx,%rbx
+	movb	%r8b,%al
+	movb	%r8b,%bl
+	shlb	$4,%al
+	movq	$14,%rcx
+	movq	8(%rsi,%rax,1),%r8
+	movq	(%rsi,%rax,1),%r9
+	andb	$240,%bl
+	movq	%r8,%rdx
+	jmp	.Loop1
+
+.align	16
+.Loop1:
+	shrq	$4,%r8
+	andq	$15,%rdx
+	movq	%r9,%r10
+	movb	(%rdi,%rcx,1),%al
+	shrq	$4,%r9
+	xorq	8(%rsi,%rbx,1),%r8
+	shlq	$60,%r10
+	xorq	(%rsi,%rbx,1),%r9
+	movb	%al,%bl
+	xorq	(%r11,%rdx,8),%r9
+	movq	%r8,%rdx
+	shlb	$4,%al
+	xorq	%r10,%r8
+	decq	%rcx
+	js	.Lbreak1
+
+	shrq	$4,%r8
+	andq	$15,%rdx
+	movq	%r9,%r10
+	shrq	$4,%r9
+	xorq	8(%rsi,%rax,1),%r8
+	shlq	$60,%r10
+	xorq	(%rsi,%rax,1),%r9
+	andb	$240,%bl
+	xorq	(%r11,%rdx,8),%r9
+	movq	%r8,%rdx
+	xorq	%r10,%r8
+	jmp	.Loop1
+
+.align	16
+.Lbreak1:
+	shrq	$4,%r8
+	andq	$15,%rdx
+	movq	%r9,%r10
+	shrq	$4,%r9
+	xorq	8(%rsi,%rax,1),%r8
+	shlq	$60,%r10
+	xorq	(%rsi,%rax,1),%r9
+	andb	$240,%bl
+	xorq	(%r11,%rdx,8),%r9
+	movq	%r8,%rdx
+	xorq	%r10,%r8
+
+	shrq	$4,%r8
+	andq	$15,%rdx
+	movq	%r9,%r10
+	shrq	$4,%r9
+	xorq	8(%rsi,%rbx,1),%r8
+	shlq	$60,%r10
+	xorq	(%rsi,%rbx,1),%r9
+	xorq	%r10,%r8
+	xorq	(%r11,%rdx,8),%r9
+
+	bswapq	%r8
+	bswapq	%r9
+	movq	%r8,8(%rdi)
+	movq	%r9,(%rdi)
+
+	movq	16(%rsp),%rbx
+	leaq	24(%rsp),%rsp
+.Lgmult_epilogue:
+	.byte	0xf3,0xc3
+.size	gcm_gmult_4bit,.-gcm_gmult_4bit
+.globl	gcm_ghash_4bit
+.hidden gcm_ghash_4bit
+.type	gcm_ghash_4bit,@function
+.align	16
+gcm_ghash_4bit:
+	pushq	%rbx
+	pushq	%rbp
+	pushq	%r12
+	pushq	%r13
+	pushq	%r14
+	pushq	%r15
+	subq	$280,%rsp
+.Lghash_prologue:
+	movq	%rdx,%r14
+	movq	%rcx,%r15
+	subq	$-128,%rsi
+	leaq	16+128(%rsp),%rbp
+	xorl	%edx,%edx
+	movq	0+0-128(%rsi),%r8
+	movq	0+8-128(%rsi),%rax
+	movb	%al,%dl
+	shrq	$4,%rax
+	movq	%r8,%r10
+	shrq	$4,%r8
+	movq	16+0-128(%rsi),%r9
+	shlb	$4,%dl
+	movq	16+8-128(%rsi),%rbx
+	shlq	$60,%r10
+	movb	%dl,0(%rsp)
+	orq	%r10,%rax
+	movb	%bl,%dl
+	shrq	$4,%rbx
+	movq	%r9,%r10
+	shrq	$4,%r9
+	movq	%r8,0(%rbp)
+	movq	32+0-128(%rsi),%r8
+	shlb	$4,%dl
+	movq	%rax,0-128(%rbp)
+	movq	32+8-128(%rsi),%rax
+	shlq	$60,%r10
+	movb	%dl,1(%rsp)
+	orq	%r10,%rbx
+	movb	%al,%dl
+	shrq	$4,%rax
+	movq	%r8,%r10
+	shrq	$4,%r8
+	movq	%r9,8(%rbp)
+	movq	48+0-128(%rsi),%r9
+	shlb	$4,%dl
+	movq	%rbx,8-128(%rbp)
+	movq	48+8-128(%rsi),%rbx
+	shlq	$60,%r10
+	movb	%dl,2(%rsp)
+	orq	%r10,%rax
+	movb	%bl,%dl
+	shrq	$4,%rbx
+	movq	%r9,%r10
+	shrq	$4,%r9
+	movq	%r8,16(%rbp)
+	movq	64+0-128(%rsi),%r8
+	shlb	$4,%dl
+	movq	%rax,16-128(%rbp)
+	movq	64+8-128(%rsi),%rax
+	shlq	$60,%r10
+	movb	%dl,3(%rsp)
+	orq	%r10,%rbx
+	movb	%al,%dl
+	shrq	$4,%rax
+	movq	%r8,%r10
+	shrq	$4,%r8
+	movq	%r9,24(%rbp)
+	movq	80+0-128(%rsi),%r9
+	shlb	$4,%dl
+	movq	%rbx,24-128(%rbp)
+	movq	80+8-128(%rsi),%rbx
+	shlq	$60,%r10
+	movb	%dl,4(%rsp)
+	orq	%r10,%rax
+	movb	%bl,%dl
+	shrq	$4,%rbx
+	movq	%r9,%r10
+	shrq	$4,%r9
+	movq	%r8,32(%rbp)
+	movq	96+0-128(%rsi),%r8
+	shlb	$4,%dl
+	movq	%rax,32-128(%rbp)
+	movq	96+8-128(%rsi),%rax
+	shlq	$60,%r10
+	movb	%dl,5(%rsp)
+	orq	%r10,%rbx
+	movb	%al,%dl
+	shrq	$4,%rax
+	movq	%r8,%r10
+	shrq	$4,%r8
+	movq	%r9,40(%rbp)
+	movq	112+0-128(%rsi),%r9
+	shlb	$4,%dl
+	movq	%rbx,40-128(%rbp)
+	movq	112+8-128(%rsi),%rbx
+	shlq	$60,%r10
+	movb	%dl,6(%rsp)
+	orq	%r10,%rax
+	movb	%bl,%dl
+	shrq	$4,%rbx
+	movq	%r9,%r10
+	shrq	$4,%r9
+	movq	%r8,48(%rbp)
+	movq	128+0-128(%rsi),%r8
+	shlb	$4,%dl
+	movq	%rax,48-128(%rbp)
+	movq	128+8-128(%rsi),%rax
+	shlq	$60,%r10
+	movb	%dl,7(%rsp)
+	orq	%r10,%rbx
+	movb	%al,%dl
+	shrq	$4,%rax
+	movq	%r8,%r10
+	shrq	$4,%r8
+	movq	%r9,56(%rbp)
+	movq	144+0-128(%rsi),%r9
+	shlb	$4,%dl
+	movq	%rbx,56-128(%rbp)
+	movq	144+8-128(%rsi),%rbx
+	shlq	$60,%r10
+	movb	%dl,8(%rsp)
+	orq	%r10,%rax
+	movb	%bl,%dl
+	shrq	$4,%rbx
+	movq	%r9,%r10
+	shrq	$4,%r9
+	movq	%r8,64(%rbp)
+	movq	160+0-128(%rsi),%r8
+	shlb	$4,%dl
+	movq	%rax,64-128(%rbp)
+	movq	160+8-128(%rsi),%rax
+	shlq	$60,%r10
+	movb	%dl,9(%rsp)
+	orq	%r10,%rbx
+	movb	%al,%dl
+	shrq	$4,%rax
+	movq	%r8,%r10
+	shrq	$4,%r8
+	movq	%r9,72(%rbp)
+	movq	176+0-128(%rsi),%r9
+	shlb	$4,%dl
+	movq	%rbx,72-128(%rbp)
+	movq	176+8-128(%rsi),%rbx
+	shlq	$60,%r10
+	movb	%dl,10(%rsp)
+	orq	%r10,%rax
+	movb	%bl,%dl
+	shrq	$4,%rbx
+	movq	%r9,%r10
+	shrq	$4,%r9
+	movq	%r8,80(%rbp)
+	movq	192+0-128(%rsi),%r8
+	shlb	$4,%dl
+	movq	%rax,80-128(%rbp)
+	movq	192+8-128(%rsi),%rax
+	shlq	$60,%r10
+	movb	%dl,11(%rsp)
+	orq	%r10,%rbx
+	movb	%al,%dl
+	shrq	$4,%rax
+	movq	%r8,%r10
+	shrq	$4,%r8
+	movq	%r9,88(%rbp)
+	movq	208+0-128(%rsi),%r9
+	shlb	$4,%dl
+	movq	%rbx,88-128(%rbp)
+	movq	208+8-128(%rsi),%rbx
+	shlq	$60,%r10
+	movb	%dl,12(%rsp)
+	orq	%r10,%rax
+	movb	%bl,%dl
+	shrq	$4,%rbx
+	movq	%r9,%r10
+	shrq	$4,%r9
+	movq	%r8,96(%rbp)
+	movq	224+0-128(%rsi),%r8
+	shlb	$4,%dl
+	movq	%rax,96-128(%rbp)
+	movq	224+8-128(%rsi),%rax
+	shlq	$60,%r10
+	movb	%dl,13(%rsp)
+	orq	%r10,%rbx
+	movb	%al,%dl
+	shrq	$4,%rax
+	movq	%r8,%r10
+	shrq	$4,%r8
+	movq	%r9,104(%rbp)
+	movq	240+0-128(%rsi),%r9
+	shlb	$4,%dl
+	movq	%rbx,104-128(%rbp)
+	movq	240+8-128(%rsi),%rbx
+	shlq	$60,%r10
+	movb	%dl,14(%rsp)
+	orq	%r10,%rax
+	movb	%bl,%dl
+	shrq	$4,%rbx
+	movq	%r9,%r10
+	shrq	$4,%r9
+	movq	%r8,112(%rbp)
+	shlb	$4,%dl
+	movq	%rax,112-128(%rbp)
+	shlq	$60,%r10
+	movb	%dl,15(%rsp)
+	orq	%r10,%rbx
+	movq	%r9,120(%rbp)
+	movq	%rbx,120-128(%rbp)
+	addq	$-128,%rsi
+	movq	8(%rdi),%r8
+	movq	0(%rdi),%r9
+	addq	%r14,%r15
+	leaq	.Lrem_8bit(%rip),%r11
+	jmp	.Louter_loop
+.align	16
+.Louter_loop:
+	xorq	(%r14),%r9
+	movq	8(%r14),%rdx
+	leaq	16(%r14),%r14
+	xorq	%r8,%rdx
+	movq	%r9,(%rdi)
+	movq	%rdx,8(%rdi)
+	shrq	$32,%rdx
+	xorq	%rax,%rax
+	roll	$8,%edx
+	movb	%dl,%al
+	movzbl	%dl,%ebx
+	shlb	$4,%al
+	shrl	$4,%ebx
+	roll	$8,%edx
+	movq	8(%rsi,%rax,1),%r8
+	movq	(%rsi,%rax,1),%r9
+	movb	%dl,%al
+	movzbl	%dl,%ecx
+	shlb	$4,%al
+	movzbq	(%rsp,%rbx,1),%r12
+	shrl	$4,%ecx
+	xorq	%r8,%r12
+	movq	%r9,%r10
+	shrq	$8,%r8
+	movzbq	%r12b,%r12
+	shrq	$8,%r9
+	xorq	-128(%rbp,%rbx,8),%r8
+	shlq	$56,%r10
+	xorq	(%rbp,%rbx,8),%r9
+	roll	$8,%edx
+	xorq	8(%rsi,%rax,1),%r8
+	xorq	(%rsi,%rax,1),%r9
+	movb	%dl,%al
+	xorq	%r10,%r8
+	movzwq	(%r11,%r12,2),%r12
+	movzbl	%dl,%ebx
+	shlb	$4,%al
+	movzbq	(%rsp,%rcx,1),%r13
+	shrl	$4,%ebx
+	shlq	$48,%r12
+	xorq	%r8,%r13
+	movq	%r9,%r10
+	xorq	%r12,%r9
+	shrq	$8,%r8
+	movzbq	%r13b,%r13
+	shrq	$8,%r9
+	xorq	-128(%rbp,%rcx,8),%r8
+	shlq	$56,%r10
+	xorq	(%rbp,%rcx,8),%r9
+	roll	$8,%edx
+	xorq	8(%rsi,%rax,1),%r8
+	xorq	(%rsi,%rax,1),%r9
+	movb	%dl,%al
+	xorq	%r10,%r8
+	movzwq	(%r11,%r13,2),%r13
+	movzbl	%dl,%ecx
+	shlb	$4,%al
+	movzbq	(%rsp,%rbx,1),%r12
+	shrl	$4,%ecx
+	shlq	$48,%r13
+	xorq	%r8,%r12
+	movq	%r9,%r10
+	xorq	%r13,%r9
+	shrq	$8,%r8
+	movzbq	%r12b,%r12
+	movl	8(%rdi),%edx
+	shrq	$8,%r9
+	xorq	-128(%rbp,%rbx,8),%r8
+	shlq	$56,%r10
+	xorq	(%rbp,%rbx,8),%r9
+	roll	$8,%edx
+	xorq	8(%rsi,%rax,1),%r8
+	xorq	(%rsi,%rax,1),%r9
+	movb	%dl,%al
+	xorq	%r10,%r8
+	movzwq	(%r11,%r12,2),%r12
+	movzbl	%dl,%ebx
+	shlb	$4,%al
+	movzbq	(%rsp,%rcx,1),%r13
+	shrl	$4,%ebx
+	shlq	$48,%r12
+	xorq	%r8,%r13
+	movq	%r9,%r10
+	xorq	%r12,%r9
+	shrq	$8,%r8
+	movzbq	%r13b,%r13
+	shrq	$8,%r9
+	xorq	-128(%rbp,%rcx,8),%r8
+	shlq	$56,%r10
+	xorq	(%rbp,%rcx,8),%r9
+	roll	$8,%edx
+	xorq	8(%rsi,%rax,1),%r8
+	xorq	(%rsi,%rax,1),%r9
+	movb	%dl,%al
+	xorq	%r10,%r8
+	movzwq	(%r11,%r13,2),%r13
+	movzbl	%dl,%ecx
+	shlb	$4,%al
+	movzbq	(%rsp,%rbx,1),%r12
+	shrl	$4,%ecx
+	shlq	$48,%r13
+	xorq	%r8,%r12
+	movq	%r9,%r10
+	xorq	%r13,%r9
+	shrq	$8,%r8
+	movzbq	%r12b,%r12
+	shrq	$8,%r9
+	xorq	-128(%rbp,%rbx,8),%r8
+	shlq	$56,%r10
+	xorq	(%rbp,%rbx,8),%r9
+	roll	$8,%edx
+	xorq	8(%rsi,%rax,1),%r8
+	xorq	(%rsi,%rax,1),%r9
+	movb	%dl,%al
+	xorq	%r10,%r8
+	movzwq	(%r11,%r12,2),%r12
+	movzbl	%dl,%ebx
+	shlb	$4,%al
+	movzbq	(%rsp,%rcx,1),%r13
+	shrl	$4,%ebx
+	shlq	$48,%r12
+	xorq	%r8,%r13
+	movq	%r9,%r10
+	xorq	%r12,%r9
+	shrq	$8,%r8
+	movzbq	%r13b,%r13
+	shrq	$8,%r9
+	xorq	-128(%rbp,%rcx,8),%r8
+	shlq	$56,%r10
+	xorq	(%rbp,%rcx,8),%r9
+	roll	$8,%edx
+	xorq	8(%rsi,%rax,1),%r8
+	xorq	(%rsi,%rax,1),%r9
+	movb	%dl,%al
+	xorq	%r10,%r8
+	movzwq	(%r11,%r13,2),%r13
+	movzbl	%dl,%ecx
+	shlb	$4,%al
+	movzbq	(%rsp,%rbx,1),%r12
+	shrl	$4,%ecx
+	shlq	$48,%r13
+	xorq	%r8,%r12
+	movq	%r9,%r10
+	xorq	%r13,%r9
+	shrq	$8,%r8
+	movzbq	%r12b,%r12
+	movl	4(%rdi),%edx
+	shrq	$8,%r9
+	xorq	-128(%rbp,%rbx,8),%r8
+	shlq	$56,%r10
+	xorq	(%rbp,%rbx,8),%r9
+	roll	$8,%edx
+	xorq	8(%rsi,%rax,1),%r8
+	xorq	(%rsi,%rax,1),%r9
+	movb	%dl,%al
+	xorq	%r10,%r8
+	movzwq	(%r11,%r12,2),%r12
+	movzbl	%dl,%ebx
+	shlb	$4,%al
+	movzbq	(%rsp,%rcx,1),%r13
+	shrl	$4,%ebx
+	shlq	$48,%r12
+	xorq	%r8,%r13
+	movq	%r9,%r10
+	xorq	%r12,%r9
+	shrq	$8,%r8
+	movzbq	%r13b,%r13
+	shrq	$8,%r9
+	xorq	-128(%rbp,%rcx,8),%r8
+	shlq	$56,%r10
+	xorq	(%rbp,%rcx,8),%r9
+	roll	$8,%edx
+	xorq	8(%rsi,%rax,1),%r8
+	xorq	(%rsi,%rax,1),%r9
+	movb	%dl,%al
+	xorq	%r10,%r8
+	movzwq	(%r11,%r13,2),%r13
+	movzbl	%dl,%ecx
+	shlb	$4,%al
+	movzbq	(%rsp,%rbx,1),%r12
+	shrl	$4,%ecx
+	shlq	$48,%r13
+	xorq	%r8,%r12
+	movq	%r9,%r10
+	xorq	%r13,%r9
+	shrq	$8,%r8
+	movzbq	%r12b,%r12
+	shrq	$8,%r9
+	xorq	-128(%rbp,%rbx,8),%r8
+	shlq	$56,%r10
+	xorq	(%rbp,%rbx,8),%r9
+	roll	$8,%edx
+	xorq	8(%rsi,%rax,1),%r8
+	xorq	(%rsi,%rax,1),%r9
+	movb	%dl,%al
+	xorq	%r10,%r8
+	movzwq	(%r11,%r12,2),%r12
+	movzbl	%dl,%ebx
+	shlb	$4,%al
+	movzbq	(%rsp,%rcx,1),%r13
+	shrl	$4,%ebx
+	shlq	$48,%r12
+	xorq	%r8,%r13
+	movq	%r9,%r10
+	xorq	%r12,%r9
+	shrq	$8,%r8
+	movzbq	%r13b,%r13
+	shrq	$8,%r9
+	xorq	-128(%rbp,%rcx,8),%r8
+	shlq	$56,%r10
+	xorq	(%rbp,%rcx,8),%r9
+	roll	$8,%edx
+	xorq	8(%rsi,%rax,1),%r8
+	xorq	(%rsi,%rax,1),%r9
+	movb	%dl,%al
+	xorq	%r10,%r8
+	movzwq	(%r11,%r13,2),%r13
+	movzbl	%dl,%ecx
+	shlb	$4,%al
+	movzbq	(%rsp,%rbx,1),%r12
+	shrl	$4,%ecx
+	shlq	$48,%r13
+	xorq	%r8,%r12
+	movq	%r9,%r10
+	xorq	%r13,%r9
+	shrq	$8,%r8
+	movzbq	%r12b,%r12
+	movl	0(%rdi),%edx
+	shrq	$8,%r9
+	xorq	-128(%rbp,%rbx,8),%r8
+	shlq	$56,%r10
+	xorq	(%rbp,%rbx,8),%r9
+	roll	$8,%edx
+	xorq	8(%rsi,%rax,1),%r8
+	xorq	(%rsi,%rax,1),%r9
+	movb	%dl,%al
+	xorq	%r10,%r8
+	movzwq	(%r11,%r12,2),%r12
+	movzbl	%dl,%ebx
+	shlb	$4,%al
+	movzbq	(%rsp,%rcx,1),%r13
+	shrl	$4,%ebx
+	shlq	$48,%r12
+	xorq	%r8,%r13
+	movq	%r9,%r10
+	xorq	%r12,%r9
+	shrq	$8,%r8
+	movzbq	%r13b,%r13
+	shrq	$8,%r9
+	xorq	-128(%rbp,%rcx,8),%r8
+	shlq	$56,%r10
+	xorq	(%rbp,%rcx,8),%r9
+	roll	$8,%edx
+	xorq	8(%rsi,%rax,1),%r8
+	xorq	(%rsi,%rax,1),%r9
+	movb	%dl,%al
+	xorq	%r10,%r8
+	movzwq	(%r11,%r13,2),%r13
+	movzbl	%dl,%ecx
+	shlb	$4,%al
+	movzbq	(%rsp,%rbx,1),%r12
+	shrl	$4,%ecx
+	shlq	$48,%r13
+	xorq	%r8,%r12
+	movq	%r9,%r10
+	xorq	%r13,%r9
+	shrq	$8,%r8
+	movzbq	%r12b,%r12
+	shrq	$8,%r9
+	xorq	-128(%rbp,%rbx,8),%r8
+	shlq	$56,%r10
+	xorq	(%rbp,%rbx,8),%r9
+	roll	$8,%edx
+	xorq	8(%rsi,%rax,1),%r8
+	xorq	(%rsi,%rax,1),%r9
+	movb	%dl,%al
+	xorq	%r10,%r8
+	movzwq	(%r11,%r12,2),%r12
+	movzbl	%dl,%ebx
+	shlb	$4,%al
+	movzbq	(%rsp,%rcx,1),%r13
+	shrl	$4,%ebx
+	shlq	$48,%r12
+	xorq	%r8,%r13
+	movq	%r9,%r10
+	xorq	%r12,%r9
+	shrq	$8,%r8
+	movzbq	%r13b,%r13
+	shrq	$8,%r9
+	xorq	-128(%rbp,%rcx,8),%r8
+	shlq	$56,%r10
+	xorq	(%rbp,%rcx,8),%r9
+	roll	$8,%edx
+	xorq	8(%rsi,%rax,1),%r8
+	xorq	(%rsi,%rax,1),%r9
+	movb	%dl,%al
+	xorq	%r10,%r8
+	movzwq	(%r11,%r13,2),%r13
+	movzbl	%dl,%ecx
+	shlb	$4,%al
+	movzbq	(%rsp,%rbx,1),%r12
+	andl	$240,%ecx
+	shlq	$48,%r13
+	xorq	%r8,%r12
+	movq	%r9,%r10
+	xorq	%r13,%r9
+	shrq	$8,%r8
+	movzbq	%r12b,%r12
+	movl	-4(%rdi),%edx
+	shrq	$8,%r9
+	xorq	-128(%rbp,%rbx,8),%r8
+	shlq	$56,%r10
+	xorq	(%rbp,%rbx,8),%r9
+	movzwq	(%r11,%r12,2),%r12
+	xorq	8(%rsi,%rax,1),%r8
+	xorq	(%rsi,%rax,1),%r9
+	shlq	$48,%r12
+	xorq	%r10,%r8
+	xorq	%r12,%r9
+	movzbq	%r8b,%r13
+	shrq	$4,%r8
+	movq	%r9,%r10
+	shlb	$4,%r13b
+	shrq	$4,%r9
+	xorq	8(%rsi,%rcx,1),%r8
+	movzwq	(%r11,%r13,2),%r13
+	shlq	$60,%r10
+	xorq	(%rsi,%rcx,1),%r9
+	xorq	%r10,%r8
+	shlq	$48,%r13
+	bswapq	%r8
+	xorq	%r13,%r9
+	bswapq	%r9
+	cmpq	%r15,%r14
+	jb	.Louter_loop
+	movq	%r8,8(%rdi)
+	movq	%r9,(%rdi)
+
+	leaq	280(%rsp),%rsi
+	movq	0(%rsi),%r15
+	movq	8(%rsi),%r14
+	movq	16(%rsi),%r13
+	movq	24(%rsi),%r12
+	movq	32(%rsi),%rbp
+	movq	40(%rsi),%rbx
+	leaq	48(%rsi),%rsp
+.Lghash_epilogue:
+	.byte	0xf3,0xc3
+.size	gcm_ghash_4bit,.-gcm_ghash_4bit
+.globl	gcm_init_clmul
+.hidden gcm_init_clmul
+.type	gcm_init_clmul,@function
+.align	16
+gcm_init_clmul:
+.L_init_clmul:
+	movdqu	(%rsi),%xmm2
+	pshufd	$78,%xmm2,%xmm2
+
+
+	pshufd	$255,%xmm2,%xmm4
+	movdqa	%xmm2,%xmm3
+	psllq	$1,%xmm2
+	pxor	%xmm5,%xmm5
+	psrlq	$63,%xmm3
+	pcmpgtd	%xmm4,%xmm5
+	pslldq	$8,%xmm3
+	por	%xmm3,%xmm2
+
+
+	pand	.L0x1c2_polynomial(%rip),%xmm5
+	pxor	%xmm5,%xmm2
+
+
+	pshufd	$78,%xmm2,%xmm6
+	movdqa	%xmm2,%xmm0
+	pxor	%xmm2,%xmm6
+	movdqa	%xmm0,%xmm1
+	pshufd	$78,%xmm0,%xmm3
+	pxor	%xmm0,%xmm3
+.byte	102,15,58,68,194,0
+.byte	102,15,58,68,202,17
+.byte	102,15,58,68,222,0
+	pxor	%xmm0,%xmm3
+	pxor	%xmm1,%xmm3
+
+	movdqa	%xmm3,%xmm4
+	psrldq	$8,%xmm3
+	pslldq	$8,%xmm4
+	pxor	%xmm3,%xmm1
+	pxor	%xmm4,%xmm0
+
+	movdqa	%xmm0,%xmm4
+	movdqa	%xmm0,%xmm3
+	psllq	$5,%xmm0
+	pxor	%xmm0,%xmm3
+	psllq	$1,%xmm0
+	pxor	%xmm3,%xmm0
+	psllq	$57,%xmm0
+	movdqa	%xmm0,%xmm3
+	pslldq	$8,%xmm0
+	psrldq	$8,%xmm3
+	pxor	%xmm4,%xmm0
+	pxor	%xmm3,%xmm1
+
+
+	movdqa	%xmm0,%xmm4
+	psrlq	$1,%xmm0
+	pxor	%xmm4,%xmm1
+	pxor	%xmm0,%xmm4
+	psrlq	$5,%xmm0
+	pxor	%xmm4,%xmm0
+	psrlq	$1,%xmm0
+	pxor	%xmm1,%xmm0
+	pshufd	$78,%xmm2,%xmm3
+	pshufd	$78,%xmm0,%xmm4
+	pxor	%xmm2,%xmm3
+	movdqu	%xmm2,0(%rdi)
+	pxor	%xmm0,%xmm4
+	movdqu	%xmm0,16(%rdi)
+.byte	102,15,58,15,227,8
+	movdqu	%xmm4,32(%rdi)
+	movdqa	%xmm0,%xmm1
+	pshufd	$78,%xmm0,%xmm3
+	pxor	%xmm0,%xmm3
+.byte	102,15,58,68,194,0
+.byte	102,15,58,68,202,17
+.byte	102,15,58,68,222,0
+	pxor	%xmm0,%xmm3
+	pxor	%xmm1,%xmm3
+
+	movdqa	%xmm3,%xmm4
+	psrldq	$8,%xmm3
+	pslldq	$8,%xmm4
+	pxor	%xmm3,%xmm1
+	pxor	%xmm4,%xmm0
+
+	movdqa	%xmm0,%xmm4
+	movdqa	%xmm0,%xmm3
+	psllq	$5,%xmm0
+	pxor	%xmm0,%xmm3
+	psllq	$1,%xmm0
+	pxor	%xmm3,%xmm0
+	psllq	$57,%xmm0
+	movdqa	%xmm0,%xmm3
+	pslldq	$8,%xmm0
+	psrldq	$8,%xmm3
+	pxor	%xmm4,%xmm0
+	pxor	%xmm3,%xmm1
+
+
+	movdqa	%xmm0,%xmm4
+	psrlq	$1,%xmm0
+	pxor	%xmm4,%xmm1
+	pxor	%xmm0,%xmm4
+	psrlq	$5,%xmm0
+	pxor	%xmm4,%xmm0
+	psrlq	$1,%xmm0
+	pxor	%xmm1,%xmm0
+	movdqa	%xmm0,%xmm5
+	movdqa	%xmm0,%xmm1
+	pshufd	$78,%xmm0,%xmm3
+	pxor	%xmm0,%xmm3
+.byte	102,15,58,68,194,0
+.byte	102,15,58,68,202,17
+.byte	102,15,58,68,222,0
+	pxor	%xmm0,%xmm3
+	pxor	%xmm1,%xmm3
+
+	movdqa	%xmm3,%xmm4
+	psrldq	$8,%xmm3
+	pslldq	$8,%xmm4
+	pxor	%xmm3,%xmm1
+	pxor	%xmm4,%xmm0
+
+	movdqa	%xmm0,%xmm4
+	movdqa	%xmm0,%xmm3
+	psllq	$5,%xmm0
+	pxor	%xmm0,%xmm3
+	psllq	$1,%xmm0
+	pxor	%xmm3,%xmm0
+	psllq	$57,%xmm0
+	movdqa	%xmm0,%xmm3
+	pslldq	$8,%xmm0
+	psrldq	$8,%xmm3
+	pxor	%xmm4,%xmm0
+	pxor	%xmm3,%xmm1
+
+
+	movdqa	%xmm0,%xmm4
+	psrlq	$1,%xmm0
+	pxor	%xmm4,%xmm1
+	pxor	%xmm0,%xmm4
+	psrlq	$5,%xmm0
+	pxor	%xmm4,%xmm0
+	psrlq	$1,%xmm0
+	pxor	%xmm1,%xmm0
+	pshufd	$78,%xmm5,%xmm3
+	pshufd	$78,%xmm0,%xmm4
+	pxor	%xmm5,%xmm3
+	movdqu	%xmm5,48(%rdi)
+	pxor	%xmm0,%xmm4
+	movdqu	%xmm0,64(%rdi)
+.byte	102,15,58,15,227,8
+	movdqu	%xmm4,80(%rdi)
+	.byte	0xf3,0xc3
+.size	gcm_init_clmul,.-gcm_init_clmul
+.globl	gcm_gmult_clmul
+.hidden gcm_gmult_clmul
+.type	gcm_gmult_clmul,@function
+.align	16
+gcm_gmult_clmul:
+.L_gmult_clmul:
+	movdqu	(%rdi),%xmm0
+	movdqa	.Lbswap_mask(%rip),%xmm5
+	movdqu	(%rsi),%xmm2
+	movdqu	32(%rsi),%xmm4
+.byte	102,15,56,0,197
+	movdqa	%xmm0,%xmm1
+	pshufd	$78,%xmm0,%xmm3
+	pxor	%xmm0,%xmm3
+.byte	102,15,58,68,194,0
+.byte	102,15,58,68,202,17
+.byte	102,15,58,68,220,0
+	pxor	%xmm0,%xmm3
+	pxor	%xmm1,%xmm3
+
+	movdqa	%xmm3,%xmm4
+	psrldq	$8,%xmm3
+	pslldq	$8,%xmm4
+	pxor	%xmm3,%xmm1
+	pxor	%xmm4,%xmm0
+
+	movdqa	%xmm0,%xmm4
+	movdqa	%xmm0,%xmm3
+	psllq	$5,%xmm0
+	pxor	%xmm0,%xmm3
+	psllq	$1,%xmm0
+	pxor	%xmm3,%xmm0
+	psllq	$57,%xmm0
+	movdqa	%xmm0,%xmm3
+	pslldq	$8,%xmm0
+	psrldq	$8,%xmm3
+	pxor	%xmm4,%xmm0
+	pxor	%xmm3,%xmm1
+
+
+	movdqa	%xmm0,%xmm4
+	psrlq	$1,%xmm0
+	pxor	%xmm4,%xmm1
+	pxor	%xmm0,%xmm4
+	psrlq	$5,%xmm0
+	pxor	%xmm4,%xmm0
+	psrlq	$1,%xmm0
+	pxor	%xmm1,%xmm0
+.byte	102,15,56,0,197
+	movdqu	%xmm0,(%rdi)
+	.byte	0xf3,0xc3
+.size	gcm_gmult_clmul,.-gcm_gmult_clmul
+.globl	gcm_ghash_clmul
+.hidden gcm_ghash_clmul
+.type	gcm_ghash_clmul,@function
+.align	32
+gcm_ghash_clmul:
+.L_ghash_clmul:
+	movdqa	.Lbswap_mask(%rip),%xmm10
+
+	movdqu	(%rdi),%xmm0
+	movdqu	(%rsi),%xmm2
+	movdqu	32(%rsi),%xmm7
+.byte	102,65,15,56,0,194
+
+	subq	$16,%rcx
+	jz	.Lodd_tail
+
+	movdqu	16(%rsi),%xmm6
+	movl	OPENSSL_ia32cap_P+4(%rip),%eax
+	cmpq	$48,%rcx
+	jb	.Lskip4x
+
+	andl	$71303168,%eax
+	cmpl	$4194304,%eax
+	je	.Lskip4x
+
+	subq	$48,%rcx
+	movq	$11547335547999543296,%rax
+	movdqu	48(%rsi),%xmm14
+	movdqu	64(%rsi),%xmm15
+
+
+
+
+	movdqu	48(%rdx),%xmm3
+	movdqu	32(%rdx),%xmm11
+.byte	102,65,15,56,0,218
+.byte	102,69,15,56,0,218
+	movdqa	%xmm3,%xmm5
+	pshufd	$78,%xmm3,%xmm4
+	pxor	%xmm3,%xmm4
+.byte	102,15,58,68,218,0
+.byte	102,15,58,68,234,17
+.byte	102,15,58,68,231,0
+
+	movdqa	%xmm11,%xmm13
+	pshufd	$78,%xmm11,%xmm12
+	pxor	%xmm11,%xmm12
+.byte	102,68,15,58,68,222,0
+.byte	102,68,15,58,68,238,17
+.byte	102,68,15,58,68,231,16
+	xorps	%xmm11,%xmm3
+	xorps	%xmm13,%xmm5
+	movups	80(%rsi),%xmm7
+	xorps	%xmm12,%xmm4
+
+	movdqu	16(%rdx),%xmm11
+	movdqu	0(%rdx),%xmm8
+.byte	102,69,15,56,0,218
+.byte	102,69,15,56,0,194
+	movdqa	%xmm11,%xmm13
+	pshufd	$78,%xmm11,%xmm12
+	pxor	%xmm8,%xmm0
+	pxor	%xmm11,%xmm12
+.byte	102,69,15,58,68,222,0
+	movdqa	%xmm0,%xmm1
+	pshufd	$78,%xmm0,%xmm8
+	pxor	%xmm0,%xmm8
+.byte	102,69,15,58,68,238,17
+.byte	102,68,15,58,68,231,0
+	xorps	%xmm11,%xmm3
+	xorps	%xmm13,%xmm5
+
+	leaq	64(%rdx),%rdx
+	subq	$64,%rcx
+	jc	.Ltail4x
+
+	jmp	.Lmod4_loop
+.align	32
+.Lmod4_loop:
+.byte	102,65,15,58,68,199,0
+	xorps	%xmm12,%xmm4
+	movdqu	48(%rdx),%xmm11
+.byte	102,69,15,56,0,218
+.byte	102,65,15,58,68,207,17
+	xorps	%xmm3,%xmm0
+	movdqu	32(%rdx),%xmm3
+	movdqa	%xmm11,%xmm13
+.byte	102,68,15,58,68,199,16
+	pshufd	$78,%xmm11,%xmm12
+	xorps	%xmm5,%xmm1
+	pxor	%xmm11,%xmm12
+.byte	102,65,15,56,0,218
+	movups	32(%rsi),%xmm7
+	xorps	%xmm4,%xmm8
+.byte	102,68,15,58,68,218,0
+	pshufd	$78,%xmm3,%xmm4
+
+	pxor	%xmm0,%xmm8
+	movdqa	%xmm3,%xmm5
+	pxor	%xmm1,%xmm8
+	pxor	%xmm3,%xmm4
+	movdqa	%xmm8,%xmm9
+.byte	102,68,15,58,68,234,17
+	pslldq	$8,%xmm8
+	psrldq	$8,%xmm9
+	pxor	%xmm8,%xmm0
+	movdqa	.L7_mask(%rip),%xmm8
+	pxor	%xmm9,%xmm1
+.byte	102,76,15,110,200
+
+	pand	%xmm0,%xmm8
+.byte	102,69,15,56,0,200
+	pxor	%xmm0,%xmm9
+.byte	102,68,15,58,68,231,0
+	psllq	$57,%xmm9
+	movdqa	%xmm9,%xmm8
+	pslldq	$8,%xmm9
+.byte	102,15,58,68,222,0
+	psrldq	$8,%xmm8
+	pxor	%xmm9,%xmm0
+	pxor	%xmm8,%xmm1
+	movdqu	0(%rdx),%xmm8
+
+	movdqa	%xmm0,%xmm9
+	psrlq	$1,%xmm0
+.byte	102,15,58,68,238,17
+	xorps	%xmm11,%xmm3
+	movdqu	16(%rdx),%xmm11
+.byte	102,69,15,56,0,218
+.byte	102,15,58,68,231,16
+	xorps	%xmm13,%xmm5
+	movups	80(%rsi),%xmm7
+.byte	102,69,15,56,0,194
+	pxor	%xmm9,%xmm1
+	pxor	%xmm0,%xmm9
+	psrlq	$5,%xmm0
+
+	movdqa	%xmm11,%xmm13
+	pxor	%xmm12,%xmm4
+	pshufd	$78,%xmm11,%xmm12
+	pxor	%xmm9,%xmm0
+	pxor	%xmm8,%xmm1
+	pxor	%xmm11,%xmm12
+.byte	102,69,15,58,68,222,0
+	psrlq	$1,%xmm0
+	pxor	%xmm1,%xmm0
+	movdqa	%xmm0,%xmm1
+.byte	102,69,15,58,68,238,17
+	xorps	%xmm11,%xmm3
+	pshufd	$78,%xmm0,%xmm8
+	pxor	%xmm0,%xmm8
+
+.byte	102,68,15,58,68,231,0
+	xorps	%xmm13,%xmm5
+
+	leaq	64(%rdx),%rdx
+	subq	$64,%rcx
+	jnc	.Lmod4_loop
+
+.Ltail4x:
+.byte	102,65,15,58,68,199,0
+.byte	102,65,15,58,68,207,17
+.byte	102,68,15,58,68,199,16
+	xorps	%xmm12,%xmm4
+	xorps	%xmm3,%xmm0
+	xorps	%xmm5,%xmm1
+	pxor	%xmm0,%xmm1
+	pxor	%xmm4,%xmm8
+
+	pxor	%xmm1,%xmm8
+	pxor	%xmm0,%xmm1
+
+	movdqa	%xmm8,%xmm9
+	psrldq	$8,%xmm8
+	pslldq	$8,%xmm9
+	pxor	%xmm8,%xmm1
+	pxor	%xmm9,%xmm0
+
+	movdqa	%xmm0,%xmm4
+	movdqa	%xmm0,%xmm3
+	psllq	$5,%xmm0
+	pxor	%xmm0,%xmm3
+	psllq	$1,%xmm0
+	pxor	%xmm3,%xmm0
+	psllq	$57,%xmm0
+	movdqa	%xmm0,%xmm3
+	pslldq	$8,%xmm0
+	psrldq	$8,%xmm3
+	pxor	%xmm4,%xmm0
+	pxor	%xmm3,%xmm1
+
+
+	movdqa	%xmm0,%xmm4
+	psrlq	$1,%xmm0
+	pxor	%xmm4,%xmm1
+	pxor	%xmm0,%xmm4
+	psrlq	$5,%xmm0
+	pxor	%xmm4,%xmm0
+	psrlq	$1,%xmm0
+	pxor	%xmm1,%xmm0
+	addq	$64,%rcx
+	jz	.Ldone
+	movdqu	32(%rsi),%xmm7
+	subq	$16,%rcx
+	jz	.Lodd_tail
+.Lskip4x:
+
+
+
+
+
+	movdqu	(%rdx),%xmm8
+	movdqu	16(%rdx),%xmm3
+.byte	102,69,15,56,0,194
+.byte	102,65,15,56,0,218
+	pxor	%xmm8,%xmm0
+
+	movdqa	%xmm3,%xmm5
+	pshufd	$78,%xmm3,%xmm4
+	pxor	%xmm3,%xmm4
+.byte	102,15,58,68,218,0
+.byte	102,15,58,68,234,17
+.byte	102,15,58,68,231,0
+
+	leaq	32(%rdx),%rdx
+	nop
+	subq	$32,%rcx
+	jbe	.Leven_tail
+	nop
+	jmp	.Lmod_loop
+
+.align	32
+.Lmod_loop:
+	movdqa	%xmm0,%xmm1
+	movdqa	%xmm4,%xmm8
+	pshufd	$78,%xmm0,%xmm4
+	pxor	%xmm0,%xmm4
+
+.byte	102,15,58,68,198,0
+.byte	102,15,58,68,206,17
+.byte	102,15,58,68,231,16
+
+	pxor	%xmm3,%xmm0
+	pxor	%xmm5,%xmm1
+	movdqu	(%rdx),%xmm9
+	pxor	%xmm0,%xmm8
+.byte	102,69,15,56,0,202
+	movdqu	16(%rdx),%xmm3
+
+	pxor	%xmm1,%xmm8
+	pxor	%xmm9,%xmm1
+	pxor	%xmm8,%xmm4
+.byte	102,65,15,56,0,218
+	movdqa	%xmm4,%xmm8
+	psrldq	$8,%xmm8
+	pslldq	$8,%xmm4
+	pxor	%xmm8,%xmm1
+	pxor	%xmm4,%xmm0
+
+	movdqa	%xmm3,%xmm5
+
+	movdqa	%xmm0,%xmm9
+	movdqa	%xmm0,%xmm8
+	psllq	$5,%xmm0
+	pxor	%xmm0,%xmm8
+.byte	102,15,58,68,218,0
+	psllq	$1,%xmm0
+	pxor	%xmm8,%xmm0
+	psllq	$57,%xmm0
+	movdqa	%xmm0,%xmm8
+	pslldq	$8,%xmm0
+	psrldq	$8,%xmm8
+	pxor	%xmm9,%xmm0
+	pshufd	$78,%xmm5,%xmm4
+	pxor	%xmm8,%xmm1
+	pxor	%xmm5,%xmm4
+
+	movdqa	%xmm0,%xmm9
+	psrlq	$1,%xmm0
+.byte	102,15,58,68,234,17
+	pxor	%xmm9,%xmm1
+	pxor	%xmm0,%xmm9
+	psrlq	$5,%xmm0
+	pxor	%xmm9,%xmm0
+	leaq	32(%rdx),%rdx
+	psrlq	$1,%xmm0
+.byte	102,15,58,68,231,0
+	pxor	%xmm1,%xmm0
+
+	subq	$32,%rcx
+	ja	.Lmod_loop
+
+.Leven_tail:
+	movdqa	%xmm0,%xmm1
+	movdqa	%xmm4,%xmm8
+	pshufd	$78,%xmm0,%xmm4
+	pxor	%xmm0,%xmm4
+
+.byte	102,15,58,68,198,0
+.byte	102,15,58,68,206,17
+.byte	102,15,58,68,231,16
+
+	pxor	%xmm3,%xmm0
+	pxor	%xmm5,%xmm1
+	pxor	%xmm0,%xmm8
+	pxor	%xmm1,%xmm8
+	pxor	%xmm8,%xmm4
+	movdqa	%xmm4,%xmm8
+	psrldq	$8,%xmm8
+	pslldq	$8,%xmm4
+	pxor	%xmm8,%xmm1
+	pxor	%xmm4,%xmm0
+
+	movdqa	%xmm0,%xmm4
+	movdqa	%xmm0,%xmm3
+	psllq	$5,%xmm0
+	pxor	%xmm0,%xmm3
+	psllq	$1,%xmm0
+	pxor	%xmm3,%xmm0
+	psllq	$57,%xmm0
+	movdqa	%xmm0,%xmm3
+	pslldq	$8,%xmm0
+	psrldq	$8,%xmm3
+	pxor	%xmm4,%xmm0
+	pxor	%xmm3,%xmm1
+
+
+	movdqa	%xmm0,%xmm4
+	psrlq	$1,%xmm0
+	pxor	%xmm4,%xmm1
+	pxor	%xmm0,%xmm4
+	psrlq	$5,%xmm0
+	pxor	%xmm4,%xmm0
+	psrlq	$1,%xmm0
+	pxor	%xmm1,%xmm0
+	testq	%rcx,%rcx
+	jnz	.Ldone
+
+.Lodd_tail:
+	movdqu	(%rdx),%xmm8
+.byte	102,69,15,56,0,194
+	pxor	%xmm8,%xmm0
+	movdqa	%xmm0,%xmm1
+	pshufd	$78,%xmm0,%xmm3
+	pxor	%xmm0,%xmm3
+.byte	102,15,58,68,194,0
+.byte	102,15,58,68,202,17
+.byte	102,15,58,68,223,0
+	pxor	%xmm0,%xmm3
+	pxor	%xmm1,%xmm3
+
+	movdqa	%xmm3,%xmm4
+	psrldq	$8,%xmm3
+	pslldq	$8,%xmm4
+	pxor	%xmm3,%xmm1
+	pxor	%xmm4,%xmm0
+
+	movdqa	%xmm0,%xmm4
+	movdqa	%xmm0,%xmm3
+	psllq	$5,%xmm0
+	pxor	%xmm0,%xmm3
+	psllq	$1,%xmm0
+	pxor	%xmm3,%xmm0
+	psllq	$57,%xmm0
+	movdqa	%xmm0,%xmm3
+	pslldq	$8,%xmm0
+	psrldq	$8,%xmm3
+	pxor	%xmm4,%xmm0
+	pxor	%xmm3,%xmm1
+
+
+	movdqa	%xmm0,%xmm4
+	psrlq	$1,%xmm0
+	pxor	%xmm4,%xmm1
+	pxor	%xmm0,%xmm4
+	psrlq	$5,%xmm0
+	pxor	%xmm4,%xmm0
+	psrlq	$1,%xmm0
+	pxor	%xmm1,%xmm0
+.Ldone:
+.byte	102,65,15,56,0,194
+	movdqu	%xmm0,(%rdi)
+	.byte	0xf3,0xc3
+.size	gcm_ghash_clmul,.-gcm_ghash_clmul
+.globl	gcm_init_avx
+.hidden gcm_init_avx
+.type	gcm_init_avx,@function
+.align	32
+gcm_init_avx:
+	jmp	.L_init_clmul
+.size	gcm_init_avx,.-gcm_init_avx
+.globl	gcm_gmult_avx
+.hidden gcm_gmult_avx
+.type	gcm_gmult_avx,@function
+.align	32
+gcm_gmult_avx:
+	jmp	.L_gmult_clmul
+.size	gcm_gmult_avx,.-gcm_gmult_avx
+.globl	gcm_ghash_avx
+.hidden gcm_ghash_avx
+.type	gcm_ghash_avx,@function
+.align	32
+gcm_ghash_avx:
+	jmp	.L_ghash_clmul
+.size	gcm_ghash_avx,.-gcm_ghash_avx
+.align	64
+.Lbswap_mask:
+.byte	15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0
+.L0x1c2_polynomial:
+.byte	1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0xc2
+.L7_mask:
+.long	7,0,7,0
+.L7_mask_poly:
+.long	7,0,450,0
+.align	64
+.type	.Lrem_4bit,@object
+.Lrem_4bit:
+.long	0,0,0,471859200,0,943718400,0,610271232
+.long	0,1887436800,0,1822425088,0,1220542464,0,1423966208
+.long	0,3774873600,0,4246732800,0,3644850176,0,3311403008
+.long	0,2441084928,0,2376073216,0,2847932416,0,3051356160
+.type	.Lrem_8bit,@object
+.Lrem_8bit:
+.value	0x0000,0x01C2,0x0384,0x0246,0x0708,0x06CA,0x048C,0x054E
+.value	0x0E10,0x0FD2,0x0D94,0x0C56,0x0918,0x08DA,0x0A9C,0x0B5E
+.value	0x1C20,0x1DE2,0x1FA4,0x1E66,0x1B28,0x1AEA,0x18AC,0x196E
+.value	0x1230,0x13F2,0x11B4,0x1076,0x1538,0x14FA,0x16BC,0x177E
+.value	0x3840,0x3982,0x3BC4,0x3A06,0x3F48,0x3E8A,0x3CCC,0x3D0E
+.value	0x3650,0x3792,0x35D4,0x3416,0x3158,0x309A,0x32DC,0x331E
+.value	0x2460,0x25A2,0x27E4,0x2626,0x2368,0x22AA,0x20EC,0x212E
+.value	0x2A70,0x2BB2,0x29F4,0x2836,0x2D78,0x2CBA,0x2EFC,0x2F3E
+.value	0x7080,0x7142,0x7304,0x72C6,0x7788,0x764A,0x740C,0x75CE
+.value	0x7E90,0x7F52,0x7D14,0x7CD6,0x7998,0x785A,0x7A1C,0x7BDE
+.value	0x6CA0,0x6D62,0x6F24,0x6EE6,0x6BA8,0x6A6A,0x682C,0x69EE
+.value	0x62B0,0x6372,0x6134,0x60F6,0x65B8,0x647A,0x663C,0x67FE
+.value	0x48C0,0x4902,0x4B44,0x4A86,0x4FC8,0x4E0A,0x4C4C,0x4D8E
+.value	0x46D0,0x4712,0x4554,0x4496,0x41D8,0x401A,0x425C,0x439E
+.value	0x54E0,0x5522,0x5764,0x56A6,0x53E8,0x522A,0x506C,0x51AE
+.value	0x5AF0,0x5B32,0x5974,0x58B6,0x5DF8,0x5C3A,0x5E7C,0x5FBE
+.value	0xE100,0xE0C2,0xE284,0xE346,0xE608,0xE7CA,0xE58C,0xE44E
+.value	0xEF10,0xEED2,0xEC94,0xED56,0xE818,0xE9DA,0xEB9C,0xEA5E
+.value	0xFD20,0xFCE2,0xFEA4,0xFF66,0xFA28,0xFBEA,0xF9AC,0xF86E
+.value	0xF330,0xF2F2,0xF0B4,0xF176,0xF438,0xF5FA,0xF7BC,0xF67E
+.value	0xD940,0xD882,0xDAC4,0xDB06,0xDE48,0xDF8A,0xDDCC,0xDC0E
+.value	0xD750,0xD692,0xD4D4,0xD516,0xD058,0xD19A,0xD3DC,0xD21E
+.value	0xC560,0xC4A2,0xC6E4,0xC726,0xC268,0xC3AA,0xC1EC,0xC02E
+.value	0xCB70,0xCAB2,0xC8F4,0xC936,0xCC78,0xCDBA,0xCFFC,0xCE3E
+.value	0x9180,0x9042,0x9204,0x93C6,0x9688,0x974A,0x950C,0x94CE
+.value	0x9F90,0x9E52,0x9C14,0x9DD6,0x9898,0x995A,0x9B1C,0x9ADE
+.value	0x8DA0,0x8C62,0x8E24,0x8FE6,0x8AA8,0x8B6A,0x892C,0x88EE
+.value	0x83B0,0x8272,0x8034,0x81F6,0x84B8,0x857A,0x873C,0x86FE
+.value	0xA9C0,0xA802,0xAA44,0xAB86,0xAEC8,0xAF0A,0xAD4C,0xAC8E
+.value	0xA7D0,0xA612,0xA454,0xA596,0xA0D8,0xA11A,0xA35C,0xA29E
+.value	0xB5E0,0xB422,0xB664,0xB7A6,0xB2E8,0xB32A,0xB16C,0xB0AE
+.value	0xBBF0,0xBA32,0xB874,0xB9B6,0xBCF8,0xBD3A,0xBF7C,0xBEBE
+
+.byte	71,72,65,83,72,32,102,111,114,32,120,56,54,95,54,52,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0
+.align	64
+#endif
diff --git a/third_party/boringssl/linux-x86_64/crypto/rand/rdrand-x86_64.S b/third_party/boringssl/linux-x86_64/crypto/rand/rdrand-x86_64.S
new file mode 100644
index 0000000..94aab9c
--- /dev/null
+++ b/third_party/boringssl/linux-x86_64/crypto/rand/rdrand-x86_64.S
@@ -0,0 +1,48 @@
+#if defined(__x86_64__)
+.text	
+
+
+
+
+.globl	CRYPTO_rdrand
+.hidden CRYPTO_rdrand
+.type	CRYPTO_rdrand,@function
+.align	16
+CRYPTO_rdrand:
+	xorq	%rax,%rax
+
+
+.byte	0x48, 0x0f, 0xc7, 0xf1
+
+	adcq	%rax,%rax
+	movq	%rcx,0(%rdi)
+	.byte	0xf3,0xc3
+
+
+
+
+
+.globl	CRYPTO_rdrand_multiple8_buf
+.hidden CRYPTO_rdrand_multiple8_buf
+.type	CRYPTO_rdrand_multiple8_buf,@function
+.align	16
+CRYPTO_rdrand_multiple8_buf:
+	testq	%rsi,%rsi
+	jz	.Lout
+	movq	$8,%rdx
+.Lloop:
+
+
+.byte	0x48, 0x0f, 0xc7, 0xf1
+	jnc	.Lerr
+	movq	%rcx,0(%rdi)
+	addq	%rdx,%rdi
+	subq	%rdx,%rsi
+	jnz	.Lloop
+.Lout:
+	movq	$1,%rax
+	.byte	0xf3,0xc3
+.Lerr:
+	xorq	%rax,%rax
+	.byte	0xf3,0xc3
+#endif
diff --git a/third_party/boringssl/linux-x86_64/crypto/rc4/rc4-md5-x86_64.S b/third_party/boringssl/linux-x86_64/crypto/rc4/rc4-md5-x86_64.S
new file mode 100644
index 0000000..06c8d67
--- /dev/null
+++ b/third_party/boringssl/linux-x86_64/crypto/rc4/rc4-md5-x86_64.S
@@ -0,0 +1,1262 @@
+#if defined(__x86_64__)
+.text	
+.align	16
+
+.globl	rc4_md5_enc
+.hidden rc4_md5_enc
+.type	rc4_md5_enc,@function
+rc4_md5_enc:
+	cmpq	$0,%r9
+	je	.Labort
+	pushq	%rbx
+	pushq	%rbp
+	pushq	%r12
+	pushq	%r13
+	pushq	%r14
+	pushq	%r15
+	subq	$40,%rsp
+.Lbody:
+	movq	%rcx,%r11
+	movq	%r9,%r12
+	movq	%rsi,%r13
+	movq	%rdx,%r14
+	movq	%r8,%r15
+	xorq	%rbp,%rbp
+	xorq	%rcx,%rcx
+
+	leaq	8(%rdi),%rdi
+	movb	-8(%rdi),%bpl
+	movb	-4(%rdi),%cl
+
+	incb	%bpl
+	subq	%r13,%r14
+	movl	(%rdi,%rbp,4),%eax
+	addb	%al,%cl
+	leaq	(%rdi,%rbp,4),%rsi
+	shlq	$6,%r12
+	addq	%r15,%r12
+	movq	%r12,16(%rsp)
+
+	movq	%r11,24(%rsp)
+	movl	0(%r11),%r8d
+	movl	4(%r11),%r9d
+	movl	8(%r11),%r10d
+	movl	12(%r11),%r11d
+	jmp	.Loop
+
+.align	16
+.Loop:
+	movl	%r8d,0(%rsp)
+	movl	%r9d,4(%rsp)
+	movl	%r10d,8(%rsp)
+	movl	%r11d,%r12d
+	movl	%r11d,12(%rsp)
+	pxor	%xmm0,%xmm0
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r10d,%r12d
+	movl	%eax,(%rdi,%rcx,4)
+	andl	%r9d,%r12d
+	addl	0(%r15),%r8d
+	addb	%dl,%al
+	movl	4(%rsi),%ebx
+	addl	$3614090360,%r8d
+	xorl	%r11d,%r12d
+	movzbl	%al,%eax
+	movl	%edx,0(%rsi)
+	addl	%r12d,%r8d
+	addb	%bl,%cl
+	roll	$7,%r8d
+	movl	%r10d,%r12d
+	movd	(%rdi,%rax,4),%xmm0
+
+	addl	%r9d,%r8d
+	pxor	%xmm1,%xmm1
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r9d,%r12d
+	movl	%ebx,(%rdi,%rcx,4)
+	andl	%r8d,%r12d
+	addl	4(%r15),%r11d
+	addb	%dl,%bl
+	movl	8(%rsi),%eax
+	addl	$3905402710,%r11d
+	xorl	%r10d,%r12d
+	movzbl	%bl,%ebx
+	movl	%edx,4(%rsi)
+	addl	%r12d,%r11d
+	addb	%al,%cl
+	roll	$12,%r11d
+	movl	%r9d,%r12d
+	movd	(%rdi,%rbx,4),%xmm1
+
+	addl	%r8d,%r11d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r8d,%r12d
+	movl	%eax,(%rdi,%rcx,4)
+	andl	%r11d,%r12d
+	addl	8(%r15),%r10d
+	addb	%dl,%al
+	movl	12(%rsi),%ebx
+	addl	$606105819,%r10d
+	xorl	%r9d,%r12d
+	movzbl	%al,%eax
+	movl	%edx,8(%rsi)
+	addl	%r12d,%r10d
+	addb	%bl,%cl
+	roll	$17,%r10d
+	movl	%r8d,%r12d
+	pinsrw	$1,(%rdi,%rax,4),%xmm0
+
+	addl	%r11d,%r10d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r11d,%r12d
+	movl	%ebx,(%rdi,%rcx,4)
+	andl	%r10d,%r12d
+	addl	12(%r15),%r9d
+	addb	%dl,%bl
+	movl	16(%rsi),%eax
+	addl	$3250441966,%r9d
+	xorl	%r8d,%r12d
+	movzbl	%bl,%ebx
+	movl	%edx,12(%rsi)
+	addl	%r12d,%r9d
+	addb	%al,%cl
+	roll	$22,%r9d
+	movl	%r11d,%r12d
+	pinsrw	$1,(%rdi,%rbx,4),%xmm1
+
+	addl	%r10d,%r9d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r10d,%r12d
+	movl	%eax,(%rdi,%rcx,4)
+	andl	%r9d,%r12d
+	addl	16(%r15),%r8d
+	addb	%dl,%al
+	movl	20(%rsi),%ebx
+	addl	$4118548399,%r8d
+	xorl	%r11d,%r12d
+	movzbl	%al,%eax
+	movl	%edx,16(%rsi)
+	addl	%r12d,%r8d
+	addb	%bl,%cl
+	roll	$7,%r8d
+	movl	%r10d,%r12d
+	pinsrw	$2,(%rdi,%rax,4),%xmm0
+
+	addl	%r9d,%r8d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r9d,%r12d
+	movl	%ebx,(%rdi,%rcx,4)
+	andl	%r8d,%r12d
+	addl	20(%r15),%r11d
+	addb	%dl,%bl
+	movl	24(%rsi),%eax
+	addl	$1200080426,%r11d
+	xorl	%r10d,%r12d
+	movzbl	%bl,%ebx
+	movl	%edx,20(%rsi)
+	addl	%r12d,%r11d
+	addb	%al,%cl
+	roll	$12,%r11d
+	movl	%r9d,%r12d
+	pinsrw	$2,(%rdi,%rbx,4),%xmm1
+
+	addl	%r8d,%r11d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r8d,%r12d
+	movl	%eax,(%rdi,%rcx,4)
+	andl	%r11d,%r12d
+	addl	24(%r15),%r10d
+	addb	%dl,%al
+	movl	28(%rsi),%ebx
+	addl	$2821735955,%r10d
+	xorl	%r9d,%r12d
+	movzbl	%al,%eax
+	movl	%edx,24(%rsi)
+	addl	%r12d,%r10d
+	addb	%bl,%cl
+	roll	$17,%r10d
+	movl	%r8d,%r12d
+	pinsrw	$3,(%rdi,%rax,4),%xmm0
+
+	addl	%r11d,%r10d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r11d,%r12d
+	movl	%ebx,(%rdi,%rcx,4)
+	andl	%r10d,%r12d
+	addl	28(%r15),%r9d
+	addb	%dl,%bl
+	movl	32(%rsi),%eax
+	addl	$4249261313,%r9d
+	xorl	%r8d,%r12d
+	movzbl	%bl,%ebx
+	movl	%edx,28(%rsi)
+	addl	%r12d,%r9d
+	addb	%al,%cl
+	roll	$22,%r9d
+	movl	%r11d,%r12d
+	pinsrw	$3,(%rdi,%rbx,4),%xmm1
+
+	addl	%r10d,%r9d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r10d,%r12d
+	movl	%eax,(%rdi,%rcx,4)
+	andl	%r9d,%r12d
+	addl	32(%r15),%r8d
+	addb	%dl,%al
+	movl	36(%rsi),%ebx
+	addl	$1770035416,%r8d
+	xorl	%r11d,%r12d
+	movzbl	%al,%eax
+	movl	%edx,32(%rsi)
+	addl	%r12d,%r8d
+	addb	%bl,%cl
+	roll	$7,%r8d
+	movl	%r10d,%r12d
+	pinsrw	$4,(%rdi,%rax,4),%xmm0
+
+	addl	%r9d,%r8d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r9d,%r12d
+	movl	%ebx,(%rdi,%rcx,4)
+	andl	%r8d,%r12d
+	addl	36(%r15),%r11d
+	addb	%dl,%bl
+	movl	40(%rsi),%eax
+	addl	$2336552879,%r11d
+	xorl	%r10d,%r12d
+	movzbl	%bl,%ebx
+	movl	%edx,36(%rsi)
+	addl	%r12d,%r11d
+	addb	%al,%cl
+	roll	$12,%r11d
+	movl	%r9d,%r12d
+	pinsrw	$4,(%rdi,%rbx,4),%xmm1
+
+	addl	%r8d,%r11d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r8d,%r12d
+	movl	%eax,(%rdi,%rcx,4)
+	andl	%r11d,%r12d
+	addl	40(%r15),%r10d
+	addb	%dl,%al
+	movl	44(%rsi),%ebx
+	addl	$4294925233,%r10d
+	xorl	%r9d,%r12d
+	movzbl	%al,%eax
+	movl	%edx,40(%rsi)
+	addl	%r12d,%r10d
+	addb	%bl,%cl
+	roll	$17,%r10d
+	movl	%r8d,%r12d
+	pinsrw	$5,(%rdi,%rax,4),%xmm0
+
+	addl	%r11d,%r10d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r11d,%r12d
+	movl	%ebx,(%rdi,%rcx,4)
+	andl	%r10d,%r12d
+	addl	44(%r15),%r9d
+	addb	%dl,%bl
+	movl	48(%rsi),%eax
+	addl	$2304563134,%r9d
+	xorl	%r8d,%r12d
+	movzbl	%bl,%ebx
+	movl	%edx,44(%rsi)
+	addl	%r12d,%r9d
+	addb	%al,%cl
+	roll	$22,%r9d
+	movl	%r11d,%r12d
+	pinsrw	$5,(%rdi,%rbx,4),%xmm1
+
+	addl	%r10d,%r9d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r10d,%r12d
+	movl	%eax,(%rdi,%rcx,4)
+	andl	%r9d,%r12d
+	addl	48(%r15),%r8d
+	addb	%dl,%al
+	movl	52(%rsi),%ebx
+	addl	$1804603682,%r8d
+	xorl	%r11d,%r12d
+	movzbl	%al,%eax
+	movl	%edx,48(%rsi)
+	addl	%r12d,%r8d
+	addb	%bl,%cl
+	roll	$7,%r8d
+	movl	%r10d,%r12d
+	pinsrw	$6,(%rdi,%rax,4),%xmm0
+
+	addl	%r9d,%r8d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r9d,%r12d
+	movl	%ebx,(%rdi,%rcx,4)
+	andl	%r8d,%r12d
+	addl	52(%r15),%r11d
+	addb	%dl,%bl
+	movl	56(%rsi),%eax
+	addl	$4254626195,%r11d
+	xorl	%r10d,%r12d
+	movzbl	%bl,%ebx
+	movl	%edx,52(%rsi)
+	addl	%r12d,%r11d
+	addb	%al,%cl
+	roll	$12,%r11d
+	movl	%r9d,%r12d
+	pinsrw	$6,(%rdi,%rbx,4),%xmm1
+
+	addl	%r8d,%r11d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r8d,%r12d
+	movl	%eax,(%rdi,%rcx,4)
+	andl	%r11d,%r12d
+	addl	56(%r15),%r10d
+	addb	%dl,%al
+	movl	60(%rsi),%ebx
+	addl	$2792965006,%r10d
+	xorl	%r9d,%r12d
+	movzbl	%al,%eax
+	movl	%edx,56(%rsi)
+	addl	%r12d,%r10d
+	addb	%bl,%cl
+	roll	$17,%r10d
+	movl	%r8d,%r12d
+	pinsrw	$7,(%rdi,%rax,4),%xmm0
+
+	addl	%r11d,%r10d
+	movdqu	(%r13),%xmm2
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r11d,%r12d
+	movl	%ebx,(%rdi,%rcx,4)
+	andl	%r10d,%r12d
+	addl	60(%r15),%r9d
+	addb	%dl,%bl
+	movl	64(%rsi),%eax
+	addl	$1236535329,%r9d
+	xorl	%r8d,%r12d
+	movzbl	%bl,%ebx
+	movl	%edx,60(%rsi)
+	addl	%r12d,%r9d
+	addb	%al,%cl
+	roll	$22,%r9d
+	movl	%r10d,%r12d
+	pinsrw	$7,(%rdi,%rbx,4),%xmm1
+
+	addl	%r10d,%r9d
+	psllq	$8,%xmm1
+	pxor	%xmm0,%xmm2
+	pxor	%xmm1,%xmm2
+	pxor	%xmm0,%xmm0
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r9d,%r12d
+	movl	%eax,(%rdi,%rcx,4)
+	andl	%r11d,%r12d
+	addl	4(%r15),%r8d
+	addb	%dl,%al
+	movl	68(%rsi),%ebx
+	addl	$4129170786,%r8d
+	xorl	%r10d,%r12d
+	movzbl	%al,%eax
+	movl	%edx,64(%rsi)
+	addl	%r12d,%r8d
+	addb	%bl,%cl
+	roll	$5,%r8d
+	movl	%r9d,%r12d
+	movd	(%rdi,%rax,4),%xmm0
+
+	addl	%r9d,%r8d
+	pxor	%xmm1,%xmm1
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r8d,%r12d
+	movl	%ebx,(%rdi,%rcx,4)
+	andl	%r10d,%r12d
+	addl	24(%r15),%r11d
+	addb	%dl,%bl
+	movl	72(%rsi),%eax
+	addl	$3225465664,%r11d
+	xorl	%r9d,%r12d
+	movzbl	%bl,%ebx
+	movl	%edx,68(%rsi)
+	addl	%r12d,%r11d
+	addb	%al,%cl
+	roll	$9,%r11d
+	movl	%r8d,%r12d
+	movd	(%rdi,%rbx,4),%xmm1
+
+	addl	%r8d,%r11d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r11d,%r12d
+	movl	%eax,(%rdi,%rcx,4)
+	andl	%r9d,%r12d
+	addl	44(%r15),%r10d
+	addb	%dl,%al
+	movl	76(%rsi),%ebx
+	addl	$643717713,%r10d
+	xorl	%r8d,%r12d
+	movzbl	%al,%eax
+	movl	%edx,72(%rsi)
+	addl	%r12d,%r10d
+	addb	%bl,%cl
+	roll	$14,%r10d
+	movl	%r11d,%r12d
+	pinsrw	$1,(%rdi,%rax,4),%xmm0
+
+	addl	%r11d,%r10d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r10d,%r12d
+	movl	%ebx,(%rdi,%rcx,4)
+	andl	%r8d,%r12d
+	addl	0(%r15),%r9d
+	addb	%dl,%bl
+	movl	80(%rsi),%eax
+	addl	$3921069994,%r9d
+	xorl	%r11d,%r12d
+	movzbl	%bl,%ebx
+	movl	%edx,76(%rsi)
+	addl	%r12d,%r9d
+	addb	%al,%cl
+	roll	$20,%r9d
+	movl	%r10d,%r12d
+	pinsrw	$1,(%rdi,%rbx,4),%xmm1
+
+	addl	%r10d,%r9d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r9d,%r12d
+	movl	%eax,(%rdi,%rcx,4)
+	andl	%r11d,%r12d
+	addl	20(%r15),%r8d
+	addb	%dl,%al
+	movl	84(%rsi),%ebx
+	addl	$3593408605,%r8d
+	xorl	%r10d,%r12d
+	movzbl	%al,%eax
+	movl	%edx,80(%rsi)
+	addl	%r12d,%r8d
+	addb	%bl,%cl
+	roll	$5,%r8d
+	movl	%r9d,%r12d
+	pinsrw	$2,(%rdi,%rax,4),%xmm0
+
+	addl	%r9d,%r8d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r8d,%r12d
+	movl	%ebx,(%rdi,%rcx,4)
+	andl	%r10d,%r12d
+	addl	40(%r15),%r11d
+	addb	%dl,%bl
+	movl	88(%rsi),%eax
+	addl	$38016083,%r11d
+	xorl	%r9d,%r12d
+	movzbl	%bl,%ebx
+	movl	%edx,84(%rsi)
+	addl	%r12d,%r11d
+	addb	%al,%cl
+	roll	$9,%r11d
+	movl	%r8d,%r12d
+	pinsrw	$2,(%rdi,%rbx,4),%xmm1
+
+	addl	%r8d,%r11d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r11d,%r12d
+	movl	%eax,(%rdi,%rcx,4)
+	andl	%r9d,%r12d
+	addl	60(%r15),%r10d
+	addb	%dl,%al
+	movl	92(%rsi),%ebx
+	addl	$3634488961,%r10d
+	xorl	%r8d,%r12d
+	movzbl	%al,%eax
+	movl	%edx,88(%rsi)
+	addl	%r12d,%r10d
+	addb	%bl,%cl
+	roll	$14,%r10d
+	movl	%r11d,%r12d
+	pinsrw	$3,(%rdi,%rax,4),%xmm0
+
+	addl	%r11d,%r10d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r10d,%r12d
+	movl	%ebx,(%rdi,%rcx,4)
+	andl	%r8d,%r12d
+	addl	16(%r15),%r9d
+	addb	%dl,%bl
+	movl	96(%rsi),%eax
+	addl	$3889429448,%r9d
+	xorl	%r11d,%r12d
+	movzbl	%bl,%ebx
+	movl	%edx,92(%rsi)
+	addl	%r12d,%r9d
+	addb	%al,%cl
+	roll	$20,%r9d
+	movl	%r10d,%r12d
+	pinsrw	$3,(%rdi,%rbx,4),%xmm1
+
+	addl	%r10d,%r9d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r9d,%r12d
+	movl	%eax,(%rdi,%rcx,4)
+	andl	%r11d,%r12d
+	addl	36(%r15),%r8d
+	addb	%dl,%al
+	movl	100(%rsi),%ebx
+	addl	$568446438,%r8d
+	xorl	%r10d,%r12d
+	movzbl	%al,%eax
+	movl	%edx,96(%rsi)
+	addl	%r12d,%r8d
+	addb	%bl,%cl
+	roll	$5,%r8d
+	movl	%r9d,%r12d
+	pinsrw	$4,(%rdi,%rax,4),%xmm0
+
+	addl	%r9d,%r8d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r8d,%r12d
+	movl	%ebx,(%rdi,%rcx,4)
+	andl	%r10d,%r12d
+	addl	56(%r15),%r11d
+	addb	%dl,%bl
+	movl	104(%rsi),%eax
+	addl	$3275163606,%r11d
+	xorl	%r9d,%r12d
+	movzbl	%bl,%ebx
+	movl	%edx,100(%rsi)
+	addl	%r12d,%r11d
+	addb	%al,%cl
+	roll	$9,%r11d
+	movl	%r8d,%r12d
+	pinsrw	$4,(%rdi,%rbx,4),%xmm1
+
+	addl	%r8d,%r11d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r11d,%r12d
+	movl	%eax,(%rdi,%rcx,4)
+	andl	%r9d,%r12d
+	addl	12(%r15),%r10d
+	addb	%dl,%al
+	movl	108(%rsi),%ebx
+	addl	$4107603335,%r10d
+	xorl	%r8d,%r12d
+	movzbl	%al,%eax
+	movl	%edx,104(%rsi)
+	addl	%r12d,%r10d
+	addb	%bl,%cl
+	roll	$14,%r10d
+	movl	%r11d,%r12d
+	pinsrw	$5,(%rdi,%rax,4),%xmm0
+
+	addl	%r11d,%r10d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r10d,%r12d
+	movl	%ebx,(%rdi,%rcx,4)
+	andl	%r8d,%r12d
+	addl	32(%r15),%r9d
+	addb	%dl,%bl
+	movl	112(%rsi),%eax
+	addl	$1163531501,%r9d
+	xorl	%r11d,%r12d
+	movzbl	%bl,%ebx
+	movl	%edx,108(%rsi)
+	addl	%r12d,%r9d
+	addb	%al,%cl
+	roll	$20,%r9d
+	movl	%r10d,%r12d
+	pinsrw	$5,(%rdi,%rbx,4),%xmm1
+
+	addl	%r10d,%r9d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r9d,%r12d
+	movl	%eax,(%rdi,%rcx,4)
+	andl	%r11d,%r12d
+	addl	52(%r15),%r8d
+	addb	%dl,%al
+	movl	116(%rsi),%ebx
+	addl	$2850285829,%r8d
+	xorl	%r10d,%r12d
+	movzbl	%al,%eax
+	movl	%edx,112(%rsi)
+	addl	%r12d,%r8d
+	addb	%bl,%cl
+	roll	$5,%r8d
+	movl	%r9d,%r12d
+	pinsrw	$6,(%rdi,%rax,4),%xmm0
+
+	addl	%r9d,%r8d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r8d,%r12d
+	movl	%ebx,(%rdi,%rcx,4)
+	andl	%r10d,%r12d
+	addl	8(%r15),%r11d
+	addb	%dl,%bl
+	movl	120(%rsi),%eax
+	addl	$4243563512,%r11d
+	xorl	%r9d,%r12d
+	movzbl	%bl,%ebx
+	movl	%edx,116(%rsi)
+	addl	%r12d,%r11d
+	addb	%al,%cl
+	roll	$9,%r11d
+	movl	%r8d,%r12d
+	pinsrw	$6,(%rdi,%rbx,4),%xmm1
+
+	addl	%r8d,%r11d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r11d,%r12d
+	movl	%eax,(%rdi,%rcx,4)
+	andl	%r9d,%r12d
+	addl	28(%r15),%r10d
+	addb	%dl,%al
+	movl	124(%rsi),%ebx
+	addl	$1735328473,%r10d
+	xorl	%r8d,%r12d
+	movzbl	%al,%eax
+	movl	%edx,120(%rsi)
+	addl	%r12d,%r10d
+	addb	%bl,%cl
+	roll	$14,%r10d
+	movl	%r11d,%r12d
+	pinsrw	$7,(%rdi,%rax,4),%xmm0
+
+	addl	%r11d,%r10d
+	movdqu	16(%r13),%xmm3
+	addb	$32,%bpl
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r10d,%r12d
+	movl	%ebx,(%rdi,%rcx,4)
+	andl	%r8d,%r12d
+	addl	48(%r15),%r9d
+	addb	%dl,%bl
+	movl	0(%rdi,%rbp,4),%eax
+	addl	$2368359562,%r9d
+	xorl	%r11d,%r12d
+	movzbl	%bl,%ebx
+	movl	%edx,124(%rsi)
+	addl	%r12d,%r9d
+	addb	%al,%cl
+	roll	$20,%r9d
+	movl	%r11d,%r12d
+	pinsrw	$7,(%rdi,%rbx,4),%xmm1
+
+	addl	%r10d,%r9d
+	movq	%rcx,%rsi
+	xorq	%rcx,%rcx
+	movb	%sil,%cl
+	leaq	(%rdi,%rbp,4),%rsi
+	psllq	$8,%xmm1
+	pxor	%xmm0,%xmm3
+	pxor	%xmm1,%xmm3
+	pxor	%xmm0,%xmm0
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r10d,%r12d
+	movl	%eax,(%rdi,%rcx,4)
+	xorl	%r9d,%r12d
+	addl	20(%r15),%r8d
+	addb	%dl,%al
+	movl	4(%rsi),%ebx
+	addl	$4294588738,%r8d
+	movzbl	%al,%eax
+	addl	%r12d,%r8d
+	movl	%edx,0(%rsi)
+	addb	%bl,%cl
+	roll	$4,%r8d
+	movl	%r10d,%r12d
+	movd	(%rdi,%rax,4),%xmm0
+
+	addl	%r9d,%r8d
+	pxor	%xmm1,%xmm1
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r9d,%r12d
+	movl	%ebx,(%rdi,%rcx,4)
+	xorl	%r8d,%r12d
+	addl	32(%r15),%r11d
+	addb	%dl,%bl
+	movl	8(%rsi),%eax
+	addl	$2272392833,%r11d
+	movzbl	%bl,%ebx
+	addl	%r12d,%r11d
+	movl	%edx,4(%rsi)
+	addb	%al,%cl
+	roll	$11,%r11d
+	movl	%r9d,%r12d
+	movd	(%rdi,%rbx,4),%xmm1
+
+	addl	%r8d,%r11d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r8d,%r12d
+	movl	%eax,(%rdi,%rcx,4)
+	xorl	%r11d,%r12d
+	addl	44(%r15),%r10d
+	addb	%dl,%al
+	movl	12(%rsi),%ebx
+	addl	$1839030562,%r10d
+	movzbl	%al,%eax
+	addl	%r12d,%r10d
+	movl	%edx,8(%rsi)
+	addb	%bl,%cl
+	roll	$16,%r10d
+	movl	%r8d,%r12d
+	pinsrw	$1,(%rdi,%rax,4),%xmm0
+
+	addl	%r11d,%r10d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r11d,%r12d
+	movl	%ebx,(%rdi,%rcx,4)
+	xorl	%r10d,%r12d
+	addl	56(%r15),%r9d
+	addb	%dl,%bl
+	movl	16(%rsi),%eax
+	addl	$4259657740,%r9d
+	movzbl	%bl,%ebx
+	addl	%r12d,%r9d
+	movl	%edx,12(%rsi)
+	addb	%al,%cl
+	roll	$23,%r9d
+	movl	%r11d,%r12d
+	pinsrw	$1,(%rdi,%rbx,4),%xmm1
+
+	addl	%r10d,%r9d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r10d,%r12d
+	movl	%eax,(%rdi,%rcx,4)
+	xorl	%r9d,%r12d
+	addl	4(%r15),%r8d
+	addb	%dl,%al
+	movl	20(%rsi),%ebx
+	addl	$2763975236,%r8d
+	movzbl	%al,%eax
+	addl	%r12d,%r8d
+	movl	%edx,16(%rsi)
+	addb	%bl,%cl
+	roll	$4,%r8d
+	movl	%r10d,%r12d
+	pinsrw	$2,(%rdi,%rax,4),%xmm0
+
+	addl	%r9d,%r8d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r9d,%r12d
+	movl	%ebx,(%rdi,%rcx,4)
+	xorl	%r8d,%r12d
+	addl	16(%r15),%r11d
+	addb	%dl,%bl
+	movl	24(%rsi),%eax
+	addl	$1272893353,%r11d
+	movzbl	%bl,%ebx
+	addl	%r12d,%r11d
+	movl	%edx,20(%rsi)
+	addb	%al,%cl
+	roll	$11,%r11d
+	movl	%r9d,%r12d
+	pinsrw	$2,(%rdi,%rbx,4),%xmm1
+
+	addl	%r8d,%r11d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r8d,%r12d
+	movl	%eax,(%rdi,%rcx,4)
+	xorl	%r11d,%r12d
+	addl	28(%r15),%r10d
+	addb	%dl,%al
+	movl	28(%rsi),%ebx
+	addl	$4139469664,%r10d
+	movzbl	%al,%eax
+	addl	%r12d,%r10d
+	movl	%edx,24(%rsi)
+	addb	%bl,%cl
+	roll	$16,%r10d
+	movl	%r8d,%r12d
+	pinsrw	$3,(%rdi,%rax,4),%xmm0
+
+	addl	%r11d,%r10d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r11d,%r12d
+	movl	%ebx,(%rdi,%rcx,4)
+	xorl	%r10d,%r12d
+	addl	40(%r15),%r9d
+	addb	%dl,%bl
+	movl	32(%rsi),%eax
+	addl	$3200236656,%r9d
+	movzbl	%bl,%ebx
+	addl	%r12d,%r9d
+	movl	%edx,28(%rsi)
+	addb	%al,%cl
+	roll	$23,%r9d
+	movl	%r11d,%r12d
+	pinsrw	$3,(%rdi,%rbx,4),%xmm1
+
+	addl	%r10d,%r9d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r10d,%r12d
+	movl	%eax,(%rdi,%rcx,4)
+	xorl	%r9d,%r12d
+	addl	52(%r15),%r8d
+	addb	%dl,%al
+	movl	36(%rsi),%ebx
+	addl	$681279174,%r8d
+	movzbl	%al,%eax
+	addl	%r12d,%r8d
+	movl	%edx,32(%rsi)
+	addb	%bl,%cl
+	roll	$4,%r8d
+	movl	%r10d,%r12d
+	pinsrw	$4,(%rdi,%rax,4),%xmm0
+
+	addl	%r9d,%r8d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r9d,%r12d
+	movl	%ebx,(%rdi,%rcx,4)
+	xorl	%r8d,%r12d
+	addl	0(%r15),%r11d
+	addb	%dl,%bl
+	movl	40(%rsi),%eax
+	addl	$3936430074,%r11d
+	movzbl	%bl,%ebx
+	addl	%r12d,%r11d
+	movl	%edx,36(%rsi)
+	addb	%al,%cl
+	roll	$11,%r11d
+	movl	%r9d,%r12d
+	pinsrw	$4,(%rdi,%rbx,4),%xmm1
+
+	addl	%r8d,%r11d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r8d,%r12d
+	movl	%eax,(%rdi,%rcx,4)
+	xorl	%r11d,%r12d
+	addl	12(%r15),%r10d
+	addb	%dl,%al
+	movl	44(%rsi),%ebx
+	addl	$3572445317,%r10d
+	movzbl	%al,%eax
+	addl	%r12d,%r10d
+	movl	%edx,40(%rsi)
+	addb	%bl,%cl
+	roll	$16,%r10d
+	movl	%r8d,%r12d
+	pinsrw	$5,(%rdi,%rax,4),%xmm0
+
+	addl	%r11d,%r10d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r11d,%r12d
+	movl	%ebx,(%rdi,%rcx,4)
+	xorl	%r10d,%r12d
+	addl	24(%r15),%r9d
+	addb	%dl,%bl
+	movl	48(%rsi),%eax
+	addl	$76029189,%r9d
+	movzbl	%bl,%ebx
+	addl	%r12d,%r9d
+	movl	%edx,44(%rsi)
+	addb	%al,%cl
+	roll	$23,%r9d
+	movl	%r11d,%r12d
+	pinsrw	$5,(%rdi,%rbx,4),%xmm1
+
+	addl	%r10d,%r9d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r10d,%r12d
+	movl	%eax,(%rdi,%rcx,4)
+	xorl	%r9d,%r12d
+	addl	36(%r15),%r8d
+	addb	%dl,%al
+	movl	52(%rsi),%ebx
+	addl	$3654602809,%r8d
+	movzbl	%al,%eax
+	addl	%r12d,%r8d
+	movl	%edx,48(%rsi)
+	addb	%bl,%cl
+	roll	$4,%r8d
+	movl	%r10d,%r12d
+	pinsrw	$6,(%rdi,%rax,4),%xmm0
+
+	addl	%r9d,%r8d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r9d,%r12d
+	movl	%ebx,(%rdi,%rcx,4)
+	xorl	%r8d,%r12d
+	addl	48(%r15),%r11d
+	addb	%dl,%bl
+	movl	56(%rsi),%eax
+	addl	$3873151461,%r11d
+	movzbl	%bl,%ebx
+	addl	%r12d,%r11d
+	movl	%edx,52(%rsi)
+	addb	%al,%cl
+	roll	$11,%r11d
+	movl	%r9d,%r12d
+	pinsrw	$6,(%rdi,%rbx,4),%xmm1
+
+	addl	%r8d,%r11d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r8d,%r12d
+	movl	%eax,(%rdi,%rcx,4)
+	xorl	%r11d,%r12d
+	addl	60(%r15),%r10d
+	addb	%dl,%al
+	movl	60(%rsi),%ebx
+	addl	$530742520,%r10d
+	movzbl	%al,%eax
+	addl	%r12d,%r10d
+	movl	%edx,56(%rsi)
+	addb	%bl,%cl
+	roll	$16,%r10d
+	movl	%r8d,%r12d
+	pinsrw	$7,(%rdi,%rax,4),%xmm0
+
+	addl	%r11d,%r10d
+	movdqu	32(%r13),%xmm4
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r11d,%r12d
+	movl	%ebx,(%rdi,%rcx,4)
+	xorl	%r10d,%r12d
+	addl	8(%r15),%r9d
+	addb	%dl,%bl
+	movl	64(%rsi),%eax
+	addl	$3299628645,%r9d
+	movzbl	%bl,%ebx
+	addl	%r12d,%r9d
+	movl	%edx,60(%rsi)
+	addb	%al,%cl
+	roll	$23,%r9d
+	movl	$-1,%r12d
+	pinsrw	$7,(%rdi,%rbx,4),%xmm1
+
+	addl	%r10d,%r9d
+	psllq	$8,%xmm1
+	pxor	%xmm0,%xmm4
+	pxor	%xmm1,%xmm4
+	pxor	%xmm0,%xmm0
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r11d,%r12d
+	movl	%eax,(%rdi,%rcx,4)
+	orl	%r9d,%r12d
+	addl	0(%r15),%r8d
+	addb	%dl,%al
+	movl	68(%rsi),%ebx
+	addl	$4096336452,%r8d
+	movzbl	%al,%eax
+	xorl	%r10d,%r12d
+	movl	%edx,64(%rsi)
+	addl	%r12d,%r8d
+	addb	%bl,%cl
+	roll	$6,%r8d
+	movl	$-1,%r12d
+	movd	(%rdi,%rax,4),%xmm0
+
+	addl	%r9d,%r8d
+	pxor	%xmm1,%xmm1
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r10d,%r12d
+	movl	%ebx,(%rdi,%rcx,4)
+	orl	%r8d,%r12d
+	addl	28(%r15),%r11d
+	addb	%dl,%bl
+	movl	72(%rsi),%eax
+	addl	$1126891415,%r11d
+	movzbl	%bl,%ebx
+	xorl	%r9d,%r12d
+	movl	%edx,68(%rsi)
+	addl	%r12d,%r11d
+	addb	%al,%cl
+	roll	$10,%r11d
+	movl	$-1,%r12d
+	movd	(%rdi,%rbx,4),%xmm1
+
+	addl	%r8d,%r11d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r9d,%r12d
+	movl	%eax,(%rdi,%rcx,4)
+	orl	%r11d,%r12d
+	addl	56(%r15),%r10d
+	addb	%dl,%al
+	movl	76(%rsi),%ebx
+	addl	$2878612391,%r10d
+	movzbl	%al,%eax
+	xorl	%r8d,%r12d
+	movl	%edx,72(%rsi)
+	addl	%r12d,%r10d
+	addb	%bl,%cl
+	roll	$15,%r10d
+	movl	$-1,%r12d
+	pinsrw	$1,(%rdi,%rax,4),%xmm0
+
+	addl	%r11d,%r10d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r8d,%r12d
+	movl	%ebx,(%rdi,%rcx,4)
+	orl	%r10d,%r12d
+	addl	20(%r15),%r9d
+	addb	%dl,%bl
+	movl	80(%rsi),%eax
+	addl	$4237533241,%r9d
+	movzbl	%bl,%ebx
+	xorl	%r11d,%r12d
+	movl	%edx,76(%rsi)
+	addl	%r12d,%r9d
+	addb	%al,%cl
+	roll	$21,%r9d
+	movl	$-1,%r12d
+	pinsrw	$1,(%rdi,%rbx,4),%xmm1
+
+	addl	%r10d,%r9d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r11d,%r12d
+	movl	%eax,(%rdi,%rcx,4)
+	orl	%r9d,%r12d
+	addl	48(%r15),%r8d
+	addb	%dl,%al
+	movl	84(%rsi),%ebx
+	addl	$1700485571,%r8d
+	movzbl	%al,%eax
+	xorl	%r10d,%r12d
+	movl	%edx,80(%rsi)
+	addl	%r12d,%r8d
+	addb	%bl,%cl
+	roll	$6,%r8d
+	movl	$-1,%r12d
+	pinsrw	$2,(%rdi,%rax,4),%xmm0
+
+	addl	%r9d,%r8d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r10d,%r12d
+	movl	%ebx,(%rdi,%rcx,4)
+	orl	%r8d,%r12d
+	addl	12(%r15),%r11d
+	addb	%dl,%bl
+	movl	88(%rsi),%eax
+	addl	$2399980690,%r11d
+	movzbl	%bl,%ebx
+	xorl	%r9d,%r12d
+	movl	%edx,84(%rsi)
+	addl	%r12d,%r11d
+	addb	%al,%cl
+	roll	$10,%r11d
+	movl	$-1,%r12d
+	pinsrw	$2,(%rdi,%rbx,4),%xmm1
+
+	addl	%r8d,%r11d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r9d,%r12d
+	movl	%eax,(%rdi,%rcx,4)
+	orl	%r11d,%r12d
+	addl	40(%r15),%r10d
+	addb	%dl,%al
+	movl	92(%rsi),%ebx
+	addl	$4293915773,%r10d
+	movzbl	%al,%eax
+	xorl	%r8d,%r12d
+	movl	%edx,88(%rsi)
+	addl	%r12d,%r10d
+	addb	%bl,%cl
+	roll	$15,%r10d
+	movl	$-1,%r12d
+	pinsrw	$3,(%rdi,%rax,4),%xmm0
+
+	addl	%r11d,%r10d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r8d,%r12d
+	movl	%ebx,(%rdi,%rcx,4)
+	orl	%r10d,%r12d
+	addl	4(%r15),%r9d
+	addb	%dl,%bl
+	movl	96(%rsi),%eax
+	addl	$2240044497,%r9d
+	movzbl	%bl,%ebx
+	xorl	%r11d,%r12d
+	movl	%edx,92(%rsi)
+	addl	%r12d,%r9d
+	addb	%al,%cl
+	roll	$21,%r9d
+	movl	$-1,%r12d
+	pinsrw	$3,(%rdi,%rbx,4),%xmm1
+
+	addl	%r10d,%r9d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r11d,%r12d
+	movl	%eax,(%rdi,%rcx,4)
+	orl	%r9d,%r12d
+	addl	32(%r15),%r8d
+	addb	%dl,%al
+	movl	100(%rsi),%ebx
+	addl	$1873313359,%r8d
+	movzbl	%al,%eax
+	xorl	%r10d,%r12d
+	movl	%edx,96(%rsi)
+	addl	%r12d,%r8d
+	addb	%bl,%cl
+	roll	$6,%r8d
+	movl	$-1,%r12d
+	pinsrw	$4,(%rdi,%rax,4),%xmm0
+
+	addl	%r9d,%r8d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r10d,%r12d
+	movl	%ebx,(%rdi,%rcx,4)
+	orl	%r8d,%r12d
+	addl	60(%r15),%r11d
+	addb	%dl,%bl
+	movl	104(%rsi),%eax
+	addl	$4264355552,%r11d
+	movzbl	%bl,%ebx
+	xorl	%r9d,%r12d
+	movl	%edx,100(%rsi)
+	addl	%r12d,%r11d
+	addb	%al,%cl
+	roll	$10,%r11d
+	movl	$-1,%r12d
+	pinsrw	$4,(%rdi,%rbx,4),%xmm1
+
+	addl	%r8d,%r11d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r9d,%r12d
+	movl	%eax,(%rdi,%rcx,4)
+	orl	%r11d,%r12d
+	addl	24(%r15),%r10d
+	addb	%dl,%al
+	movl	108(%rsi),%ebx
+	addl	$2734768916,%r10d
+	movzbl	%al,%eax
+	xorl	%r8d,%r12d
+	movl	%edx,104(%rsi)
+	addl	%r12d,%r10d
+	addb	%bl,%cl
+	roll	$15,%r10d
+	movl	$-1,%r12d
+	pinsrw	$5,(%rdi,%rax,4),%xmm0
+
+	addl	%r11d,%r10d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r8d,%r12d
+	movl	%ebx,(%rdi,%rcx,4)
+	orl	%r10d,%r12d
+	addl	52(%r15),%r9d
+	addb	%dl,%bl
+	movl	112(%rsi),%eax
+	addl	$1309151649,%r9d
+	movzbl	%bl,%ebx
+	xorl	%r11d,%r12d
+	movl	%edx,108(%rsi)
+	addl	%r12d,%r9d
+	addb	%al,%cl
+	roll	$21,%r9d
+	movl	$-1,%r12d
+	pinsrw	$5,(%rdi,%rbx,4),%xmm1
+
+	addl	%r10d,%r9d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r11d,%r12d
+	movl	%eax,(%rdi,%rcx,4)
+	orl	%r9d,%r12d
+	addl	16(%r15),%r8d
+	addb	%dl,%al
+	movl	116(%rsi),%ebx
+	addl	$4149444226,%r8d
+	movzbl	%al,%eax
+	xorl	%r10d,%r12d
+	movl	%edx,112(%rsi)
+	addl	%r12d,%r8d
+	addb	%bl,%cl
+	roll	$6,%r8d
+	movl	$-1,%r12d
+	pinsrw	$6,(%rdi,%rax,4),%xmm0
+
+	addl	%r9d,%r8d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r10d,%r12d
+	movl	%ebx,(%rdi,%rcx,4)
+	orl	%r8d,%r12d
+	addl	44(%r15),%r11d
+	addb	%dl,%bl
+	movl	120(%rsi),%eax
+	addl	$3174756917,%r11d
+	movzbl	%bl,%ebx
+	xorl	%r9d,%r12d
+	movl	%edx,116(%rsi)
+	addl	%r12d,%r11d
+	addb	%al,%cl
+	roll	$10,%r11d
+	movl	$-1,%r12d
+	pinsrw	$6,(%rdi,%rbx,4),%xmm1
+
+	addl	%r8d,%r11d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r9d,%r12d
+	movl	%eax,(%rdi,%rcx,4)
+	orl	%r11d,%r12d
+	addl	8(%r15),%r10d
+	addb	%dl,%al
+	movl	124(%rsi),%ebx
+	addl	$718787259,%r10d
+	movzbl	%al,%eax
+	xorl	%r8d,%r12d
+	movl	%edx,120(%rsi)
+	addl	%r12d,%r10d
+	addb	%bl,%cl
+	roll	$15,%r10d
+	movl	$-1,%r12d
+	pinsrw	$7,(%rdi,%rax,4),%xmm0
+
+	addl	%r11d,%r10d
+	movdqu	48(%r13),%xmm5
+	addb	$32,%bpl
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r8d,%r12d
+	movl	%ebx,(%rdi,%rcx,4)
+	orl	%r10d,%r12d
+	addl	36(%r15),%r9d
+	addb	%dl,%bl
+	movl	0(%rdi,%rbp,4),%eax
+	addl	$3951481745,%r9d
+	movzbl	%bl,%ebx
+	xorl	%r11d,%r12d
+	movl	%edx,124(%rsi)
+	addl	%r12d,%r9d
+	addb	%al,%cl
+	roll	$21,%r9d
+	movl	$-1,%r12d
+	pinsrw	$7,(%rdi,%rbx,4),%xmm1
+
+	addl	%r10d,%r9d
+	movq	%rbp,%rsi
+	xorq	%rbp,%rbp
+	movb	%sil,%bpl
+	movq	%rcx,%rsi
+	xorq	%rcx,%rcx
+	movb	%sil,%cl
+	leaq	(%rdi,%rbp,4),%rsi
+	psllq	$8,%xmm1
+	pxor	%xmm0,%xmm5
+	pxor	%xmm1,%xmm5
+	addl	0(%rsp),%r8d
+	addl	4(%rsp),%r9d
+	addl	8(%rsp),%r10d
+	addl	12(%rsp),%r11d
+
+	movdqu	%xmm2,(%r14,%r13,1)
+	movdqu	%xmm3,16(%r14,%r13,1)
+	movdqu	%xmm4,32(%r14,%r13,1)
+	movdqu	%xmm5,48(%r14,%r13,1)
+	leaq	64(%r15),%r15
+	leaq	64(%r13),%r13
+	cmpq	16(%rsp),%r15
+	jb	.Loop
+
+	movq	24(%rsp),%r12
+	subb	%al,%cl
+	movl	%r8d,0(%r12)
+	movl	%r9d,4(%r12)
+	movl	%r10d,8(%r12)
+	movl	%r11d,12(%r12)
+	subb	$1,%bpl
+	movl	%ebp,-8(%rdi)
+	movl	%ecx,-4(%rdi)
+
+	movq	40(%rsp),%r15
+	movq	48(%rsp),%r14
+	movq	56(%rsp),%r13
+	movq	64(%rsp),%r12
+	movq	72(%rsp),%rbp
+	movq	80(%rsp),%rbx
+	leaq	88(%rsp),%rsp
+.Lepilogue:
+.Labort:
+	.byte	0xf3,0xc3
+.size	rc4_md5_enc,.-rc4_md5_enc
+#endif
diff --git a/third_party/boringssl/linux-x86_64/crypto/rc4/rc4-x86_64.S b/third_party/boringssl/linux-x86_64/crypto/rc4/rc4-x86_64.S
new file mode 100644
index 0000000..c4d1002
--- /dev/null
+++ b/third_party/boringssl/linux-x86_64/crypto/rc4/rc4-x86_64.S
@@ -0,0 +1,596 @@
+#if defined(__x86_64__)
+.text	
+.extern	OPENSSL_ia32cap_P
+.hidden OPENSSL_ia32cap_P
+
+.globl	asm_RC4
+.hidden asm_RC4
+.type	asm_RC4,@function
+.align	16
+asm_RC4:
+	orq	%rsi,%rsi
+	jne	.Lentry
+	.byte	0xf3,0xc3
+.Lentry:
+	pushq	%rbx
+	pushq	%r12
+	pushq	%r13
+.Lprologue:
+	movq	%rsi,%r11
+	movq	%rdx,%r12
+	movq	%rcx,%r13
+	xorq	%r10,%r10
+	xorq	%rcx,%rcx
+
+	leaq	8(%rdi),%rdi
+	movb	-8(%rdi),%r10b
+	movb	-4(%rdi),%cl
+	cmpl	$-1,256(%rdi)
+	je	.LRC4_CHAR
+	movl	OPENSSL_ia32cap_P(%rip),%r8d
+	xorq	%rbx,%rbx
+	incb	%r10b
+	subq	%r10,%rbx
+	subq	%r12,%r13
+	movl	(%rdi,%r10,4),%eax
+	testq	$-16,%r11
+	jz	.Lloop1
+	btl	$30,%r8d
+	jc	.Lintel
+	andq	$7,%rbx
+	leaq	1(%r10),%rsi
+	jz	.Loop8
+	subq	%rbx,%r11
+.Loop8_warmup:
+	addb	%al,%cl
+	movl	(%rdi,%rcx,4),%edx
+	movl	%eax,(%rdi,%rcx,4)
+	movl	%edx,(%rdi,%r10,4)
+	addb	%dl,%al
+	incb	%r10b
+	movl	(%rdi,%rax,4),%edx
+	movl	(%rdi,%r10,4),%eax
+	xorb	(%r12),%dl
+	movb	%dl,(%r12,%r13,1)
+	leaq	1(%r12),%r12
+	decq	%rbx
+	jnz	.Loop8_warmup
+
+	leaq	1(%r10),%rsi
+	jmp	.Loop8
+.align	16
+.Loop8:
+	addb	%al,%cl
+	movl	(%rdi,%rcx,4),%edx
+	movl	%eax,(%rdi,%rcx,4)
+	movl	0(%rdi,%rsi,4),%ebx
+	rorq	$8,%r8
+	movl	%edx,0(%rdi,%r10,4)
+	addb	%al,%dl
+	movb	(%rdi,%rdx,4),%r8b
+	addb	%bl,%cl
+	movl	(%rdi,%rcx,4),%edx
+	movl	%ebx,(%rdi,%rcx,4)
+	movl	4(%rdi,%rsi,4),%eax
+	rorq	$8,%r8
+	movl	%edx,4(%rdi,%r10,4)
+	addb	%bl,%dl
+	movb	(%rdi,%rdx,4),%r8b
+	addb	%al,%cl
+	movl	(%rdi,%rcx,4),%edx
+	movl	%eax,(%rdi,%rcx,4)
+	movl	8(%rdi,%rsi,4),%ebx
+	rorq	$8,%r8
+	movl	%edx,8(%rdi,%r10,4)
+	addb	%al,%dl
+	movb	(%rdi,%rdx,4),%r8b
+	addb	%bl,%cl
+	movl	(%rdi,%rcx,4),%edx
+	movl	%ebx,(%rdi,%rcx,4)
+	movl	12(%rdi,%rsi,4),%eax
+	rorq	$8,%r8
+	movl	%edx,12(%rdi,%r10,4)
+	addb	%bl,%dl
+	movb	(%rdi,%rdx,4),%r8b
+	addb	%al,%cl
+	movl	(%rdi,%rcx,4),%edx
+	movl	%eax,(%rdi,%rcx,4)
+	movl	16(%rdi,%rsi,4),%ebx
+	rorq	$8,%r8
+	movl	%edx,16(%rdi,%r10,4)
+	addb	%al,%dl
+	movb	(%rdi,%rdx,4),%r8b
+	addb	%bl,%cl
+	movl	(%rdi,%rcx,4),%edx
+	movl	%ebx,(%rdi,%rcx,4)
+	movl	20(%rdi,%rsi,4),%eax
+	rorq	$8,%r8
+	movl	%edx,20(%rdi,%r10,4)
+	addb	%bl,%dl
+	movb	(%rdi,%rdx,4),%r8b
+	addb	%al,%cl
+	movl	(%rdi,%rcx,4),%edx
+	movl	%eax,(%rdi,%rcx,4)
+	movl	24(%rdi,%rsi,4),%ebx
+	rorq	$8,%r8
+	movl	%edx,24(%rdi,%r10,4)
+	addb	%al,%dl
+	movb	(%rdi,%rdx,4),%r8b
+	addb	$8,%sil
+	addb	%bl,%cl
+	movl	(%rdi,%rcx,4),%edx
+	movl	%ebx,(%rdi,%rcx,4)
+	movl	-4(%rdi,%rsi,4),%eax
+	rorq	$8,%r8
+	movl	%edx,28(%rdi,%r10,4)
+	addb	%bl,%dl
+	movb	(%rdi,%rdx,4),%r8b
+	addb	$8,%r10b
+	rorq	$8,%r8
+	subq	$8,%r11
+
+	xorq	(%r12),%r8
+	movq	%r8,(%r12,%r13,1)
+	leaq	8(%r12),%r12
+
+	testq	$-8,%r11
+	jnz	.Loop8
+	cmpq	$0,%r11
+	jne	.Lloop1
+	jmp	.Lexit
+
+.align	16
+.Lintel:
+	testq	$-32,%r11
+	jz	.Lloop1
+	andq	$15,%rbx
+	jz	.Loop16_is_hot
+	subq	%rbx,%r11
+.Loop16_warmup:
+	addb	%al,%cl
+	movl	(%rdi,%rcx,4),%edx
+	movl	%eax,(%rdi,%rcx,4)
+	movl	%edx,(%rdi,%r10,4)
+	addb	%dl,%al
+	incb	%r10b
+	movl	(%rdi,%rax,4),%edx
+	movl	(%rdi,%r10,4),%eax
+	xorb	(%r12),%dl
+	movb	%dl,(%r12,%r13,1)
+	leaq	1(%r12),%r12
+	decq	%rbx
+	jnz	.Loop16_warmup
+
+	movq	%rcx,%rbx
+	xorq	%rcx,%rcx
+	movb	%bl,%cl
+
+.Loop16_is_hot:
+	leaq	(%rdi,%r10,4),%rsi
+	addb	%al,%cl
+	movl	(%rdi,%rcx,4),%edx
+	pxor	%xmm0,%xmm0
+	movl	%eax,(%rdi,%rcx,4)
+	addb	%dl,%al
+	movl	4(%rsi),%ebx
+	movzbl	%al,%eax
+	movl	%edx,0(%rsi)
+	addb	%bl,%cl
+	pinsrw	$0,(%rdi,%rax,4),%xmm0
+	jmp	.Loop16_enter
+.align	16
+.Loop16:
+	addb	%al,%cl
+	movl	(%rdi,%rcx,4),%edx
+	pxor	%xmm0,%xmm2
+	psllq	$8,%xmm1
+	pxor	%xmm0,%xmm0
+	movl	%eax,(%rdi,%rcx,4)
+	addb	%dl,%al
+	movl	4(%rsi),%ebx
+	movzbl	%al,%eax
+	movl	%edx,0(%rsi)
+	pxor	%xmm1,%xmm2
+	addb	%bl,%cl
+	pinsrw	$0,(%rdi,%rax,4),%xmm0
+	movdqu	%xmm2,(%r12,%r13,1)
+	leaq	16(%r12),%r12
+.Loop16_enter:
+	movl	(%rdi,%rcx,4),%edx
+	pxor	%xmm1,%xmm1
+	movl	%ebx,(%rdi,%rcx,4)
+	addb	%dl,%bl
+	movl	8(%rsi),%eax
+	movzbl	%bl,%ebx
+	movl	%edx,4(%rsi)
+	addb	%al,%cl
+	pinsrw	$0,(%rdi,%rbx,4),%xmm1
+	movl	(%rdi,%rcx,4),%edx
+	movl	%eax,(%rdi,%rcx,4)
+	addb	%dl,%al
+	movl	12(%rsi),%ebx
+	movzbl	%al,%eax
+	movl	%edx,8(%rsi)
+	addb	%bl,%cl
+	pinsrw	$1,(%rdi,%rax,4),%xmm0
+	movl	(%rdi,%rcx,4),%edx
+	movl	%ebx,(%rdi,%rcx,4)
+	addb	%dl,%bl
+	movl	16(%rsi),%eax
+	movzbl	%bl,%ebx
+	movl	%edx,12(%rsi)
+	addb	%al,%cl
+	pinsrw	$1,(%rdi,%rbx,4),%xmm1
+	movl	(%rdi,%rcx,4),%edx
+	movl	%eax,(%rdi,%rcx,4)
+	addb	%dl,%al
+	movl	20(%rsi),%ebx
+	movzbl	%al,%eax
+	movl	%edx,16(%rsi)
+	addb	%bl,%cl
+	pinsrw	$2,(%rdi,%rax,4),%xmm0
+	movl	(%rdi,%rcx,4),%edx
+	movl	%ebx,(%rdi,%rcx,4)
+	addb	%dl,%bl
+	movl	24(%rsi),%eax
+	movzbl	%bl,%ebx
+	movl	%edx,20(%rsi)
+	addb	%al,%cl
+	pinsrw	$2,(%rdi,%rbx,4),%xmm1
+	movl	(%rdi,%rcx,4),%edx
+	movl	%eax,(%rdi,%rcx,4)
+	addb	%dl,%al
+	movl	28(%rsi),%ebx
+	movzbl	%al,%eax
+	movl	%edx,24(%rsi)
+	addb	%bl,%cl
+	pinsrw	$3,(%rdi,%rax,4),%xmm0
+	movl	(%rdi,%rcx,4),%edx
+	movl	%ebx,(%rdi,%rcx,4)
+	addb	%dl,%bl
+	movl	32(%rsi),%eax
+	movzbl	%bl,%ebx
+	movl	%edx,28(%rsi)
+	addb	%al,%cl
+	pinsrw	$3,(%rdi,%rbx,4),%xmm1
+	movl	(%rdi,%rcx,4),%edx
+	movl	%eax,(%rdi,%rcx,4)
+	addb	%dl,%al
+	movl	36(%rsi),%ebx
+	movzbl	%al,%eax
+	movl	%edx,32(%rsi)
+	addb	%bl,%cl
+	pinsrw	$4,(%rdi,%rax,4),%xmm0
+	movl	(%rdi,%rcx,4),%edx
+	movl	%ebx,(%rdi,%rcx,4)
+	addb	%dl,%bl
+	movl	40(%rsi),%eax
+	movzbl	%bl,%ebx
+	movl	%edx,36(%rsi)
+	addb	%al,%cl
+	pinsrw	$4,(%rdi,%rbx,4),%xmm1
+	movl	(%rdi,%rcx,4),%edx
+	movl	%eax,(%rdi,%rcx,4)
+	addb	%dl,%al
+	movl	44(%rsi),%ebx
+	movzbl	%al,%eax
+	movl	%edx,40(%rsi)
+	addb	%bl,%cl
+	pinsrw	$5,(%rdi,%rax,4),%xmm0
+	movl	(%rdi,%rcx,4),%edx
+	movl	%ebx,(%rdi,%rcx,4)
+	addb	%dl,%bl
+	movl	48(%rsi),%eax
+	movzbl	%bl,%ebx
+	movl	%edx,44(%rsi)
+	addb	%al,%cl
+	pinsrw	$5,(%rdi,%rbx,4),%xmm1
+	movl	(%rdi,%rcx,4),%edx
+	movl	%eax,(%rdi,%rcx,4)
+	addb	%dl,%al
+	movl	52(%rsi),%ebx
+	movzbl	%al,%eax
+	movl	%edx,48(%rsi)
+	addb	%bl,%cl
+	pinsrw	$6,(%rdi,%rax,4),%xmm0
+	movl	(%rdi,%rcx,4),%edx
+	movl	%ebx,(%rdi,%rcx,4)
+	addb	%dl,%bl
+	movl	56(%rsi),%eax
+	movzbl	%bl,%ebx
+	movl	%edx,52(%rsi)
+	addb	%al,%cl
+	pinsrw	$6,(%rdi,%rbx,4),%xmm1
+	movl	(%rdi,%rcx,4),%edx
+	movl	%eax,(%rdi,%rcx,4)
+	addb	%dl,%al
+	movl	60(%rsi),%ebx
+	movzbl	%al,%eax
+	movl	%edx,56(%rsi)
+	addb	%bl,%cl
+	pinsrw	$7,(%rdi,%rax,4),%xmm0
+	addb	$16,%r10b
+	movdqu	(%r12),%xmm2
+	movl	(%rdi,%rcx,4),%edx
+	movl	%ebx,(%rdi,%rcx,4)
+	addb	%dl,%bl
+	movzbl	%bl,%ebx
+	movl	%edx,60(%rsi)
+	leaq	(%rdi,%r10,4),%rsi
+	pinsrw	$7,(%rdi,%rbx,4),%xmm1
+	movl	(%rsi),%eax
+	movq	%rcx,%rbx
+	xorq	%rcx,%rcx
+	subq	$16,%r11
+	movb	%bl,%cl
+	testq	$-16,%r11
+	jnz	.Loop16
+
+	psllq	$8,%xmm1
+	pxor	%xmm0,%xmm2
+	pxor	%xmm1,%xmm2
+	movdqu	%xmm2,(%r12,%r13,1)
+	leaq	16(%r12),%r12
+
+	cmpq	$0,%r11
+	jne	.Lloop1
+	jmp	.Lexit
+
+.align	16
+.Lloop1:
+	addb	%al,%cl
+	movl	(%rdi,%rcx,4),%edx
+	movl	%eax,(%rdi,%rcx,4)
+	movl	%edx,(%rdi,%r10,4)
+	addb	%dl,%al
+	incb	%r10b
+	movl	(%rdi,%rax,4),%edx
+	movl	(%rdi,%r10,4),%eax
+	xorb	(%r12),%dl
+	movb	%dl,(%r12,%r13,1)
+	leaq	1(%r12),%r12
+	decq	%r11
+	jnz	.Lloop1
+	jmp	.Lexit
+
+.align	16
+.LRC4_CHAR:
+	addb	$1,%r10b
+	movzbl	(%rdi,%r10,1),%eax
+	testq	$-8,%r11
+	jz	.Lcloop1
+	jmp	.Lcloop8
+.align	16
+.Lcloop8:
+	movl	(%r12),%r8d
+	movl	4(%r12),%r9d
+	addb	%al,%cl
+	leaq	1(%r10),%rsi
+	movzbl	(%rdi,%rcx,1),%edx
+	movzbl	%sil,%esi
+	movzbl	(%rdi,%rsi,1),%ebx
+	movb	%al,(%rdi,%rcx,1)
+	cmpq	%rsi,%rcx
+	movb	%dl,(%rdi,%r10,1)
+	jne	.Lcmov0
+	movq	%rax,%rbx
+.Lcmov0:
+	addb	%al,%dl
+	xorb	(%rdi,%rdx,1),%r8b
+	rorl	$8,%r8d
+	addb	%bl,%cl
+	leaq	1(%rsi),%r10
+	movzbl	(%rdi,%rcx,1),%edx
+	movzbl	%r10b,%r10d
+	movzbl	(%rdi,%r10,1),%eax
+	movb	%bl,(%rdi,%rcx,1)
+	cmpq	%r10,%rcx
+	movb	%dl,(%rdi,%rsi,1)
+	jne	.Lcmov1
+	movq	%rbx,%rax
+.Lcmov1:
+	addb	%bl,%dl
+	xorb	(%rdi,%rdx,1),%r8b
+	rorl	$8,%r8d
+	addb	%al,%cl
+	leaq	1(%r10),%rsi
+	movzbl	(%rdi,%rcx,1),%edx
+	movzbl	%sil,%esi
+	movzbl	(%rdi,%rsi,1),%ebx
+	movb	%al,(%rdi,%rcx,1)
+	cmpq	%rsi,%rcx
+	movb	%dl,(%rdi,%r10,1)
+	jne	.Lcmov2
+	movq	%rax,%rbx
+.Lcmov2:
+	addb	%al,%dl
+	xorb	(%rdi,%rdx,1),%r8b
+	rorl	$8,%r8d
+	addb	%bl,%cl
+	leaq	1(%rsi),%r10
+	movzbl	(%rdi,%rcx,1),%edx
+	movzbl	%r10b,%r10d
+	movzbl	(%rdi,%r10,1),%eax
+	movb	%bl,(%rdi,%rcx,1)
+	cmpq	%r10,%rcx
+	movb	%dl,(%rdi,%rsi,1)
+	jne	.Lcmov3
+	movq	%rbx,%rax
+.Lcmov3:
+	addb	%bl,%dl
+	xorb	(%rdi,%rdx,1),%r8b
+	rorl	$8,%r8d
+	addb	%al,%cl
+	leaq	1(%r10),%rsi
+	movzbl	(%rdi,%rcx,1),%edx
+	movzbl	%sil,%esi
+	movzbl	(%rdi,%rsi,1),%ebx
+	movb	%al,(%rdi,%rcx,1)
+	cmpq	%rsi,%rcx
+	movb	%dl,(%rdi,%r10,1)
+	jne	.Lcmov4
+	movq	%rax,%rbx
+.Lcmov4:
+	addb	%al,%dl
+	xorb	(%rdi,%rdx,1),%r9b
+	rorl	$8,%r9d
+	addb	%bl,%cl
+	leaq	1(%rsi),%r10
+	movzbl	(%rdi,%rcx,1),%edx
+	movzbl	%r10b,%r10d
+	movzbl	(%rdi,%r10,1),%eax
+	movb	%bl,(%rdi,%rcx,1)
+	cmpq	%r10,%rcx
+	movb	%dl,(%rdi,%rsi,1)
+	jne	.Lcmov5
+	movq	%rbx,%rax
+.Lcmov5:
+	addb	%bl,%dl
+	xorb	(%rdi,%rdx,1),%r9b
+	rorl	$8,%r9d
+	addb	%al,%cl
+	leaq	1(%r10),%rsi
+	movzbl	(%rdi,%rcx,1),%edx
+	movzbl	%sil,%esi
+	movzbl	(%rdi,%rsi,1),%ebx
+	movb	%al,(%rdi,%rcx,1)
+	cmpq	%rsi,%rcx
+	movb	%dl,(%rdi,%r10,1)
+	jne	.Lcmov6
+	movq	%rax,%rbx
+.Lcmov6:
+	addb	%al,%dl
+	xorb	(%rdi,%rdx,1),%r9b
+	rorl	$8,%r9d
+	addb	%bl,%cl
+	leaq	1(%rsi),%r10
+	movzbl	(%rdi,%rcx,1),%edx
+	movzbl	%r10b,%r10d
+	movzbl	(%rdi,%r10,1),%eax
+	movb	%bl,(%rdi,%rcx,1)
+	cmpq	%r10,%rcx
+	movb	%dl,(%rdi,%rsi,1)
+	jne	.Lcmov7
+	movq	%rbx,%rax
+.Lcmov7:
+	addb	%bl,%dl
+	xorb	(%rdi,%rdx,1),%r9b
+	rorl	$8,%r9d
+	leaq	-8(%r11),%r11
+	movl	%r8d,(%r13)
+	leaq	8(%r12),%r12
+	movl	%r9d,4(%r13)
+	leaq	8(%r13),%r13
+
+	testq	$-8,%r11
+	jnz	.Lcloop8
+	cmpq	$0,%r11
+	jne	.Lcloop1
+	jmp	.Lexit
+.align	16
+.Lcloop1:
+	addb	%al,%cl
+	movzbl	%cl,%ecx
+	movzbl	(%rdi,%rcx,1),%edx
+	movb	%al,(%rdi,%rcx,1)
+	movb	%dl,(%rdi,%r10,1)
+	addb	%al,%dl
+	addb	$1,%r10b
+	movzbl	%dl,%edx
+	movzbl	%r10b,%r10d
+	movzbl	(%rdi,%rdx,1),%edx
+	movzbl	(%rdi,%r10,1),%eax
+	xorb	(%r12),%dl
+	leaq	1(%r12),%r12
+	movb	%dl,(%r13)
+	leaq	1(%r13),%r13
+	subq	$1,%r11
+	jnz	.Lcloop1
+	jmp	.Lexit
+
+.align	16
+.Lexit:
+	subb	$1,%r10b
+	movl	%r10d,-8(%rdi)
+	movl	%ecx,-4(%rdi)
+
+	movq	(%rsp),%r13
+	movq	8(%rsp),%r12
+	movq	16(%rsp),%rbx
+	addq	$24,%rsp
+.Lepilogue:
+	.byte	0xf3,0xc3
+.size	asm_RC4,.-asm_RC4
+.globl	asm_RC4_set_key
+.hidden asm_RC4_set_key
+.type	asm_RC4_set_key,@function
+.align	16
+asm_RC4_set_key:
+	leaq	8(%rdi),%rdi
+	leaq	(%rdx,%rsi,1),%rdx
+	negq	%rsi
+	movq	%rsi,%rcx
+	xorl	%eax,%eax
+	xorq	%r9,%r9
+	xorq	%r10,%r10
+	xorq	%r11,%r11
+
+	movl	OPENSSL_ia32cap_P(%rip),%r8d
+	btl	$20,%r8d
+	jc	.Lc1stloop
+	jmp	.Lw1stloop
+
+.align	16
+.Lw1stloop:
+	movl	%eax,(%rdi,%rax,4)
+	addb	$1,%al
+	jnc	.Lw1stloop
+
+	xorq	%r9,%r9
+	xorq	%r8,%r8
+.align	16
+.Lw2ndloop:
+	movl	(%rdi,%r9,4),%r10d
+	addb	(%rdx,%rsi,1),%r8b
+	addb	%r10b,%r8b
+	addq	$1,%rsi
+	movl	(%rdi,%r8,4),%r11d
+	cmovzq	%rcx,%rsi
+	movl	%r10d,(%rdi,%r8,4)
+	movl	%r11d,(%rdi,%r9,4)
+	addb	$1,%r9b
+	jnc	.Lw2ndloop
+	jmp	.Lexit_key
+
+.align	16
+.Lc1stloop:
+	movb	%al,(%rdi,%rax,1)
+	addb	$1,%al
+	jnc	.Lc1stloop
+
+	xorq	%r9,%r9
+	xorq	%r8,%r8
+.align	16
+.Lc2ndloop:
+	movb	(%rdi,%r9,1),%r10b
+	addb	(%rdx,%rsi,1),%r8b
+	addb	%r10b,%r8b
+	addq	$1,%rsi
+	movb	(%rdi,%r8,1),%r11b
+	jnz	.Lcnowrap
+	movq	%rcx,%rsi
+.Lcnowrap:
+	movb	%r10b,(%rdi,%r8,1)
+	movb	%r11b,(%rdi,%r9,1)
+	addb	$1,%r9b
+	jnc	.Lc2ndloop
+	movl	$-1,256(%rdi)
+
+.align	16
+.Lexit_key:
+	xorl	%eax,%eax
+	movl	%eax,-8(%rdi)
+	movl	%eax,-4(%rdi)
+	.byte	0xf3,0xc3
+.size	asm_RC4_set_key,.-asm_RC4_set_key
+#endif
diff --git a/third_party/boringssl/linux-x86_64/crypto/sha/sha1-x86_64.S b/third_party/boringssl/linux-x86_64/crypto/sha/sha1-x86_64.S
new file mode 100644
index 0000000..7668c2b
--- /dev/null
+++ b/third_party/boringssl/linux-x86_64/crypto/sha/sha1-x86_64.S
@@ -0,0 +1,2426 @@
+#if defined(__x86_64__)
+.text	
+.extern	OPENSSL_ia32cap_P
+.hidden OPENSSL_ia32cap_P
+
+.globl	sha1_block_data_order
+.hidden sha1_block_data_order
+.type	sha1_block_data_order,@function
+.align	16
+sha1_block_data_order:
+	movl	OPENSSL_ia32cap_P+0(%rip),%r9d
+	movl	OPENSSL_ia32cap_P+4(%rip),%r8d
+	movl	OPENSSL_ia32cap_P+8(%rip),%r10d
+	testl	$512,%r8d
+	jz	.Lialu
+	jmp	_ssse3_shortcut
+
+.align	16
+.Lialu:
+	movq	%rsp,%rax
+	pushq	%rbx
+	pushq	%rbp
+	pushq	%r12
+	pushq	%r13
+	pushq	%r14
+	movq	%rdi,%r8
+	subq	$72,%rsp
+	movq	%rsi,%r9
+	andq	$-64,%rsp
+	movq	%rdx,%r10
+	movq	%rax,64(%rsp)
+.Lprologue:
+
+	movl	0(%r8),%esi
+	movl	4(%r8),%edi
+	movl	8(%r8),%r11d
+	movl	12(%r8),%r12d
+	movl	16(%r8),%r13d
+	jmp	.Lloop
+
+.align	16
+.Lloop:
+	movl	0(%r9),%edx
+	bswapl	%edx
+	movl	4(%r9),%ebp
+	movl	%r12d,%eax
+	movl	%edx,0(%rsp)
+	movl	%esi,%ecx
+	bswapl	%ebp
+	xorl	%r11d,%eax
+	roll	$5,%ecx
+	andl	%edi,%eax
+	leal	1518500249(%rdx,%r13,1),%r13d
+	addl	%ecx,%r13d
+	xorl	%r12d,%eax
+	roll	$30,%edi
+	addl	%eax,%r13d
+	movl	8(%r9),%r14d
+	movl	%r11d,%eax
+	movl	%ebp,4(%rsp)
+	movl	%r13d,%ecx
+	bswapl	%r14d
+	xorl	%edi,%eax
+	roll	$5,%ecx
+	andl	%esi,%eax
+	leal	1518500249(%rbp,%r12,1),%r12d
+	addl	%ecx,%r12d
+	xorl	%r11d,%eax
+	roll	$30,%esi
+	addl	%eax,%r12d
+	movl	12(%r9),%edx
+	movl	%edi,%eax
+	movl	%r14d,8(%rsp)
+	movl	%r12d,%ecx
+	bswapl	%edx
+	xorl	%esi,%eax
+	roll	$5,%ecx
+	andl	%r13d,%eax
+	leal	1518500249(%r14,%r11,1),%r11d
+	addl	%ecx,%r11d
+	xorl	%edi,%eax
+	roll	$30,%r13d
+	addl	%eax,%r11d
+	movl	16(%r9),%ebp
+	movl	%esi,%eax
+	movl	%edx,12(%rsp)
+	movl	%r11d,%ecx
+	bswapl	%ebp
+	xorl	%r13d,%eax
+	roll	$5,%ecx
+	andl	%r12d,%eax
+	leal	1518500249(%rdx,%rdi,1),%edi
+	addl	%ecx,%edi
+	xorl	%esi,%eax
+	roll	$30,%r12d
+	addl	%eax,%edi
+	movl	20(%r9),%r14d
+	movl	%r13d,%eax
+	movl	%ebp,16(%rsp)
+	movl	%edi,%ecx
+	bswapl	%r14d
+	xorl	%r12d,%eax
+	roll	$5,%ecx
+	andl	%r11d,%eax
+	leal	1518500249(%rbp,%rsi,1),%esi
+	addl	%ecx,%esi
+	xorl	%r13d,%eax
+	roll	$30,%r11d
+	addl	%eax,%esi
+	movl	24(%r9),%edx
+	movl	%r12d,%eax
+	movl	%r14d,20(%rsp)
+	movl	%esi,%ecx
+	bswapl	%edx
+	xorl	%r11d,%eax
+	roll	$5,%ecx
+	andl	%edi,%eax
+	leal	1518500249(%r14,%r13,1),%r13d
+	addl	%ecx,%r13d
+	xorl	%r12d,%eax
+	roll	$30,%edi
+	addl	%eax,%r13d
+	movl	28(%r9),%ebp
+	movl	%r11d,%eax
+	movl	%edx,24(%rsp)
+	movl	%r13d,%ecx
+	bswapl	%ebp
+	xorl	%edi,%eax
+	roll	$5,%ecx
+	andl	%esi,%eax
+	leal	1518500249(%rdx,%r12,1),%r12d
+	addl	%ecx,%r12d
+	xorl	%r11d,%eax
+	roll	$30,%esi
+	addl	%eax,%r12d
+	movl	32(%r9),%r14d
+	movl	%edi,%eax
+	movl	%ebp,28(%rsp)
+	movl	%r12d,%ecx
+	bswapl	%r14d
+	xorl	%esi,%eax
+	roll	$5,%ecx
+	andl	%r13d,%eax
+	leal	1518500249(%rbp,%r11,1),%r11d
+	addl	%ecx,%r11d
+	xorl	%edi,%eax
+	roll	$30,%r13d
+	addl	%eax,%r11d
+	movl	36(%r9),%edx
+	movl	%esi,%eax
+	movl	%r14d,32(%rsp)
+	movl	%r11d,%ecx
+	bswapl	%edx
+	xorl	%r13d,%eax
+	roll	$5,%ecx
+	andl	%r12d,%eax
+	leal	1518500249(%r14,%rdi,1),%edi
+	addl	%ecx,%edi
+	xorl	%esi,%eax
+	roll	$30,%r12d
+	addl	%eax,%edi
+	movl	40(%r9),%ebp
+	movl	%r13d,%eax
+	movl	%edx,36(%rsp)
+	movl	%edi,%ecx
+	bswapl	%ebp
+	xorl	%r12d,%eax
+	roll	$5,%ecx
+	andl	%r11d,%eax
+	leal	1518500249(%rdx,%rsi,1),%esi
+	addl	%ecx,%esi
+	xorl	%r13d,%eax
+	roll	$30,%r11d
+	addl	%eax,%esi
+	movl	44(%r9),%r14d
+	movl	%r12d,%eax
+	movl	%ebp,40(%rsp)
+	movl	%esi,%ecx
+	bswapl	%r14d
+	xorl	%r11d,%eax
+	roll	$5,%ecx
+	andl	%edi,%eax
+	leal	1518500249(%rbp,%r13,1),%r13d
+	addl	%ecx,%r13d
+	xorl	%r12d,%eax
+	roll	$30,%edi
+	addl	%eax,%r13d
+	movl	48(%r9),%edx
+	movl	%r11d,%eax
+	movl	%r14d,44(%rsp)
+	movl	%r13d,%ecx
+	bswapl	%edx
+	xorl	%edi,%eax
+	roll	$5,%ecx
+	andl	%esi,%eax
+	leal	1518500249(%r14,%r12,1),%r12d
+	addl	%ecx,%r12d
+	xorl	%r11d,%eax
+	roll	$30,%esi
+	addl	%eax,%r12d
+	movl	52(%r9),%ebp
+	movl	%edi,%eax
+	movl	%edx,48(%rsp)
+	movl	%r12d,%ecx
+	bswapl	%ebp
+	xorl	%esi,%eax
+	roll	$5,%ecx
+	andl	%r13d,%eax
+	leal	1518500249(%rdx,%r11,1),%r11d
+	addl	%ecx,%r11d
+	xorl	%edi,%eax
+	roll	$30,%r13d
+	addl	%eax,%r11d
+	movl	56(%r9),%r14d
+	movl	%esi,%eax
+	movl	%ebp,52(%rsp)
+	movl	%r11d,%ecx
+	bswapl	%r14d
+	xorl	%r13d,%eax
+	roll	$5,%ecx
+	andl	%r12d,%eax
+	leal	1518500249(%rbp,%rdi,1),%edi
+	addl	%ecx,%edi
+	xorl	%esi,%eax
+	roll	$30,%r12d
+	addl	%eax,%edi
+	movl	60(%r9),%edx
+	movl	%r13d,%eax
+	movl	%r14d,56(%rsp)
+	movl	%edi,%ecx
+	bswapl	%edx
+	xorl	%r12d,%eax
+	roll	$5,%ecx
+	andl	%r11d,%eax
+	leal	1518500249(%r14,%rsi,1),%esi
+	addl	%ecx,%esi
+	xorl	%r13d,%eax
+	roll	$30,%r11d
+	addl	%eax,%esi
+	xorl	0(%rsp),%ebp
+	movl	%r12d,%eax
+	movl	%edx,60(%rsp)
+	movl	%esi,%ecx
+	xorl	8(%rsp),%ebp
+	xorl	%r11d,%eax
+	roll	$5,%ecx
+	xorl	32(%rsp),%ebp
+	andl	%edi,%eax
+	leal	1518500249(%rdx,%r13,1),%r13d
+	roll	$30,%edi
+	xorl	%r12d,%eax
+	addl	%ecx,%r13d
+	roll	$1,%ebp
+	addl	%eax,%r13d
+	xorl	4(%rsp),%r14d
+	movl	%r11d,%eax
+	movl	%ebp,0(%rsp)
+	movl	%r13d,%ecx
+	xorl	12(%rsp),%r14d
+	xorl	%edi,%eax
+	roll	$5,%ecx
+	xorl	36(%rsp),%r14d
+	andl	%esi,%eax
+	leal	1518500249(%rbp,%r12,1),%r12d
+	roll	$30,%esi
+	xorl	%r11d,%eax
+	addl	%ecx,%r12d
+	roll	$1,%r14d
+	addl	%eax,%r12d
+	xorl	8(%rsp),%edx
+	movl	%edi,%eax
+	movl	%r14d,4(%rsp)
+	movl	%r12d,%ecx
+	xorl	16(%rsp),%edx
+	xorl	%esi,%eax
+	roll	$5,%ecx
+	xorl	40(%rsp),%edx
+	andl	%r13d,%eax
+	leal	1518500249(%r14,%r11,1),%r11d
+	roll	$30,%r13d
+	xorl	%edi,%eax
+	addl	%ecx,%r11d
+	roll	$1,%edx
+	addl	%eax,%r11d
+	xorl	12(%rsp),%ebp
+	movl	%esi,%eax
+	movl	%edx,8(%rsp)
+	movl	%r11d,%ecx
+	xorl	20(%rsp),%ebp
+	xorl	%r13d,%eax
+	roll	$5,%ecx
+	xorl	44(%rsp),%ebp
+	andl	%r12d,%eax
+	leal	1518500249(%rdx,%rdi,1),%edi
+	roll	$30,%r12d
+	xorl	%esi,%eax
+	addl	%ecx,%edi
+	roll	$1,%ebp
+	addl	%eax,%edi
+	xorl	16(%rsp),%r14d
+	movl	%r13d,%eax
+	movl	%ebp,12(%rsp)
+	movl	%edi,%ecx
+	xorl	24(%rsp),%r14d
+	xorl	%r12d,%eax
+	roll	$5,%ecx
+	xorl	48(%rsp),%r14d
+	andl	%r11d,%eax
+	leal	1518500249(%rbp,%rsi,1),%esi
+	roll	$30,%r11d
+	xorl	%r13d,%eax
+	addl	%ecx,%esi
+	roll	$1,%r14d
+	addl	%eax,%esi
+	xorl	20(%rsp),%edx
+	movl	%edi,%eax
+	movl	%r14d,16(%rsp)
+	movl	%esi,%ecx
+	xorl	28(%rsp),%edx
+	xorl	%r12d,%eax
+	roll	$5,%ecx
+	xorl	52(%rsp),%edx
+	leal	1859775393(%r14,%r13,1),%r13d
+	xorl	%r11d,%eax
+	addl	%ecx,%r13d
+	roll	$30,%edi
+	addl	%eax,%r13d
+	roll	$1,%edx
+	xorl	24(%rsp),%ebp
+	movl	%esi,%eax
+	movl	%edx,20(%rsp)
+	movl	%r13d,%ecx
+	xorl	32(%rsp),%ebp
+	xorl	%r11d,%eax
+	roll	$5,%ecx
+	xorl	56(%rsp),%ebp
+	leal	1859775393(%rdx,%r12,1),%r12d
+	xorl	%edi,%eax
+	addl	%ecx,%r12d
+	roll	$30,%esi
+	addl	%eax,%r12d
+	roll	$1,%ebp
+	xorl	28(%rsp),%r14d
+	movl	%r13d,%eax
+	movl	%ebp,24(%rsp)
+	movl	%r12d,%ecx
+	xorl	36(%rsp),%r14d
+	xorl	%edi,%eax
+	roll	$5,%ecx
+	xorl	60(%rsp),%r14d
+	leal	1859775393(%rbp,%r11,1),%r11d
+	xorl	%esi,%eax
+	addl	%ecx,%r11d
+	roll	$30,%r13d
+	addl	%eax,%r11d
+	roll	$1,%r14d
+	xorl	32(%rsp),%edx
+	movl	%r12d,%eax
+	movl	%r14d,28(%rsp)
+	movl	%r11d,%ecx
+	xorl	40(%rsp),%edx
+	xorl	%esi,%eax
+	roll	$5,%ecx
+	xorl	0(%rsp),%edx
+	leal	1859775393(%r14,%rdi,1),%edi
+	xorl	%r13d,%eax
+	addl	%ecx,%edi
+	roll	$30,%r12d
+	addl	%eax,%edi
+	roll	$1,%edx
+	xorl	36(%rsp),%ebp
+	movl	%r11d,%eax
+	movl	%edx,32(%rsp)
+	movl	%edi,%ecx
+	xorl	44(%rsp),%ebp
+	xorl	%r13d,%eax
+	roll	$5,%ecx
+	xorl	4(%rsp),%ebp
+	leal	1859775393(%rdx,%rsi,1),%esi
+	xorl	%r12d,%eax
+	addl	%ecx,%esi
+	roll	$30,%r11d
+	addl	%eax,%esi
+	roll	$1,%ebp
+	xorl	40(%rsp),%r14d
+	movl	%edi,%eax
+	movl	%ebp,36(%rsp)
+	movl	%esi,%ecx
+	xorl	48(%rsp),%r14d
+	xorl	%r12d,%eax
+	roll	$5,%ecx
+	xorl	8(%rsp),%r14d
+	leal	1859775393(%rbp,%r13,1),%r13d
+	xorl	%r11d,%eax
+	addl	%ecx,%r13d
+	roll	$30,%edi
+	addl	%eax,%r13d
+	roll	$1,%r14d
+	xorl	44(%rsp),%edx
+	movl	%esi,%eax
+	movl	%r14d,40(%rsp)
+	movl	%r13d,%ecx
+	xorl	52(%rsp),%edx
+	xorl	%r11d,%eax
+	roll	$5,%ecx
+	xorl	12(%rsp),%edx
+	leal	1859775393(%r14,%r12,1),%r12d
+	xorl	%edi,%eax
+	addl	%ecx,%r12d
+	roll	$30,%esi
+	addl	%eax,%r12d
+	roll	$1,%edx
+	xorl	48(%rsp),%ebp
+	movl	%r13d,%eax
+	movl	%edx,44(%rsp)
+	movl	%r12d,%ecx
+	xorl	56(%rsp),%ebp
+	xorl	%edi,%eax
+	roll	$5,%ecx
+	xorl	16(%rsp),%ebp
+	leal	1859775393(%rdx,%r11,1),%r11d
+	xorl	%esi,%eax
+	addl	%ecx,%r11d
+	roll	$30,%r13d
+	addl	%eax,%r11d
+	roll	$1,%ebp
+	xorl	52(%rsp),%r14d
+	movl	%r12d,%eax
+	movl	%ebp,48(%rsp)
+	movl	%r11d,%ecx
+	xorl	60(%rsp),%r14d
+	xorl	%esi,%eax
+	roll	$5,%ecx
+	xorl	20(%rsp),%r14d
+	leal	1859775393(%rbp,%rdi,1),%edi
+	xorl	%r13d,%eax
+	addl	%ecx,%edi
+	roll	$30,%r12d
+	addl	%eax,%edi
+	roll	$1,%r14d
+	xorl	56(%rsp),%edx
+	movl	%r11d,%eax
+	movl	%r14d,52(%rsp)
+	movl	%edi,%ecx
+	xorl	0(%rsp),%edx
+	xorl	%r13d,%eax
+	roll	$5,%ecx
+	xorl	24(%rsp),%edx
+	leal	1859775393(%r14,%rsi,1),%esi
+	xorl	%r12d,%eax
+	addl	%ecx,%esi
+	roll	$30,%r11d
+	addl	%eax,%esi
+	roll	$1,%edx
+	xorl	60(%rsp),%ebp
+	movl	%edi,%eax
+	movl	%edx,56(%rsp)
+	movl	%esi,%ecx
+	xorl	4(%rsp),%ebp
+	xorl	%r12d,%eax
+	roll	$5,%ecx
+	xorl	28(%rsp),%ebp
+	leal	1859775393(%rdx,%r13,1),%r13d
+	xorl	%r11d,%eax
+	addl	%ecx,%r13d
+	roll	$30,%edi
+	addl	%eax,%r13d
+	roll	$1,%ebp
+	xorl	0(%rsp),%r14d
+	movl	%esi,%eax
+	movl	%ebp,60(%rsp)
+	movl	%r13d,%ecx
+	xorl	8(%rsp),%r14d
+	xorl	%r11d,%eax
+	roll	$5,%ecx
+	xorl	32(%rsp),%r14d
+	leal	1859775393(%rbp,%r12,1),%r12d
+	xorl	%edi,%eax
+	addl	%ecx,%r12d
+	roll	$30,%esi
+	addl	%eax,%r12d
+	roll	$1,%r14d
+	xorl	4(%rsp),%edx
+	movl	%r13d,%eax
+	movl	%r14d,0(%rsp)
+	movl	%r12d,%ecx
+	xorl	12(%rsp),%edx
+	xorl	%edi,%eax
+	roll	$5,%ecx
+	xorl	36(%rsp),%edx
+	leal	1859775393(%r14,%r11,1),%r11d
+	xorl	%esi,%eax
+	addl	%ecx,%r11d
+	roll	$30,%r13d
+	addl	%eax,%r11d
+	roll	$1,%edx
+	xorl	8(%rsp),%ebp
+	movl	%r12d,%eax
+	movl	%edx,4(%rsp)
+	movl	%r11d,%ecx
+	xorl	16(%rsp),%ebp
+	xorl	%esi,%eax
+	roll	$5,%ecx
+	xorl	40(%rsp),%ebp
+	leal	1859775393(%rdx,%rdi,1),%edi
+	xorl	%r13d,%eax
+	addl	%ecx,%edi
+	roll	$30,%r12d
+	addl	%eax,%edi
+	roll	$1,%ebp
+	xorl	12(%rsp),%r14d
+	movl	%r11d,%eax
+	movl	%ebp,8(%rsp)
+	movl	%edi,%ecx
+	xorl	20(%rsp),%r14d
+	xorl	%r13d,%eax
+	roll	$5,%ecx
+	xorl	44(%rsp),%r14d
+	leal	1859775393(%rbp,%rsi,1),%esi
+	xorl	%r12d,%eax
+	addl	%ecx,%esi
+	roll	$30,%r11d
+	addl	%eax,%esi
+	roll	$1,%r14d
+	xorl	16(%rsp),%edx
+	movl	%edi,%eax
+	movl	%r14d,12(%rsp)
+	movl	%esi,%ecx
+	xorl	24(%rsp),%edx
+	xorl	%r12d,%eax
+	roll	$5,%ecx
+	xorl	48(%rsp),%edx
+	leal	1859775393(%r14,%r13,1),%r13d
+	xorl	%r11d,%eax
+	addl	%ecx,%r13d
+	roll	$30,%edi
+	addl	%eax,%r13d
+	roll	$1,%edx
+	xorl	20(%rsp),%ebp
+	movl	%esi,%eax
+	movl	%edx,16(%rsp)
+	movl	%r13d,%ecx
+	xorl	28(%rsp),%ebp
+	xorl	%r11d,%eax
+	roll	$5,%ecx
+	xorl	52(%rsp),%ebp
+	leal	1859775393(%rdx,%r12,1),%r12d
+	xorl	%edi,%eax
+	addl	%ecx,%r12d
+	roll	$30,%esi
+	addl	%eax,%r12d
+	roll	$1,%ebp
+	xorl	24(%rsp),%r14d
+	movl	%r13d,%eax
+	movl	%ebp,20(%rsp)
+	movl	%r12d,%ecx
+	xorl	32(%rsp),%r14d
+	xorl	%edi,%eax
+	roll	$5,%ecx
+	xorl	56(%rsp),%r14d
+	leal	1859775393(%rbp,%r11,1),%r11d
+	xorl	%esi,%eax
+	addl	%ecx,%r11d
+	roll	$30,%r13d
+	addl	%eax,%r11d
+	roll	$1,%r14d
+	xorl	28(%rsp),%edx
+	movl	%r12d,%eax
+	movl	%r14d,24(%rsp)
+	movl	%r11d,%ecx
+	xorl	36(%rsp),%edx
+	xorl	%esi,%eax
+	roll	$5,%ecx
+	xorl	60(%rsp),%edx
+	leal	1859775393(%r14,%rdi,1),%edi
+	xorl	%r13d,%eax
+	addl	%ecx,%edi
+	roll	$30,%r12d
+	addl	%eax,%edi
+	roll	$1,%edx
+	xorl	32(%rsp),%ebp
+	movl	%r11d,%eax
+	movl	%edx,28(%rsp)
+	movl	%edi,%ecx
+	xorl	40(%rsp),%ebp
+	xorl	%r13d,%eax
+	roll	$5,%ecx
+	xorl	0(%rsp),%ebp
+	leal	1859775393(%rdx,%rsi,1),%esi
+	xorl	%r12d,%eax
+	addl	%ecx,%esi
+	roll	$30,%r11d
+	addl	%eax,%esi
+	roll	$1,%ebp
+	xorl	36(%rsp),%r14d
+	movl	%r12d,%eax
+	movl	%ebp,32(%rsp)
+	movl	%r12d,%ebx
+	xorl	44(%rsp),%r14d
+	andl	%r11d,%eax
+	movl	%esi,%ecx
+	xorl	4(%rsp),%r14d
+	leal	-1894007588(%rbp,%r13,1),%r13d
+	xorl	%r11d,%ebx
+	roll	$5,%ecx
+	addl	%eax,%r13d
+	roll	$1,%r14d
+	andl	%edi,%ebx
+	addl	%ecx,%r13d
+	roll	$30,%edi
+	addl	%ebx,%r13d
+	xorl	40(%rsp),%edx
+	movl	%r11d,%eax
+	movl	%r14d,36(%rsp)
+	movl	%r11d,%ebx
+	xorl	48(%rsp),%edx
+	andl	%edi,%eax
+	movl	%r13d,%ecx
+	xorl	8(%rsp),%edx
+	leal	-1894007588(%r14,%r12,1),%r12d
+	xorl	%edi,%ebx
+	roll	$5,%ecx
+	addl	%eax,%r12d
+	roll	$1,%edx
+	andl	%esi,%ebx
+	addl	%ecx,%r12d
+	roll	$30,%esi
+	addl	%ebx,%r12d
+	xorl	44(%rsp),%ebp
+	movl	%edi,%eax
+	movl	%edx,40(%rsp)
+	movl	%edi,%ebx
+	xorl	52(%rsp),%ebp
+	andl	%esi,%eax
+	movl	%r12d,%ecx
+	xorl	12(%rsp),%ebp
+	leal	-1894007588(%rdx,%r11,1),%r11d
+	xorl	%esi,%ebx
+	roll	$5,%ecx
+	addl	%eax,%r11d
+	roll	$1,%ebp
+	andl	%r13d,%ebx
+	addl	%ecx,%r11d
+	roll	$30,%r13d
+	addl	%ebx,%r11d
+	xorl	48(%rsp),%r14d
+	movl	%esi,%eax
+	movl	%ebp,44(%rsp)
+	movl	%esi,%ebx
+	xorl	56(%rsp),%r14d
+	andl	%r13d,%eax
+	movl	%r11d,%ecx
+	xorl	16(%rsp),%r14d
+	leal	-1894007588(%rbp,%rdi,1),%edi
+	xorl	%r13d,%ebx
+	roll	$5,%ecx
+	addl	%eax,%edi
+	roll	$1,%r14d
+	andl	%r12d,%ebx
+	addl	%ecx,%edi
+	roll	$30,%r12d
+	addl	%ebx,%edi
+	xorl	52(%rsp),%edx
+	movl	%r13d,%eax
+	movl	%r14d,48(%rsp)
+	movl	%r13d,%ebx
+	xorl	60(%rsp),%edx
+	andl	%r12d,%eax
+	movl	%edi,%ecx
+	xorl	20(%rsp),%edx
+	leal	-1894007588(%r14,%rsi,1),%esi
+	xorl	%r12d,%ebx
+	roll	$5,%ecx
+	addl	%eax,%esi
+	roll	$1,%edx
+	andl	%r11d,%ebx
+	addl	%ecx,%esi
+	roll	$30,%r11d
+	addl	%ebx,%esi
+	xorl	56(%rsp),%ebp
+	movl	%r12d,%eax
+	movl	%edx,52(%rsp)
+	movl	%r12d,%ebx
+	xorl	0(%rsp),%ebp
+	andl	%r11d,%eax
+	movl	%esi,%ecx
+	xorl	24(%rsp),%ebp
+	leal	-1894007588(%rdx,%r13,1),%r13d
+	xorl	%r11d,%ebx
+	roll	$5,%ecx
+	addl	%eax,%r13d
+	roll	$1,%ebp
+	andl	%edi,%ebx
+	addl	%ecx,%r13d
+	roll	$30,%edi
+	addl	%ebx,%r13d
+	xorl	60(%rsp),%r14d
+	movl	%r11d,%eax
+	movl	%ebp,56(%rsp)
+	movl	%r11d,%ebx
+	xorl	4(%rsp),%r14d
+	andl	%edi,%eax
+	movl	%r13d,%ecx
+	xorl	28(%rsp),%r14d
+	leal	-1894007588(%rbp,%r12,1),%r12d
+	xorl	%edi,%ebx
+	roll	$5,%ecx
+	addl	%eax,%r12d
+	roll	$1,%r14d
+	andl	%esi,%ebx
+	addl	%ecx,%r12d
+	roll	$30,%esi
+	addl	%ebx,%r12d
+	xorl	0(%rsp),%edx
+	movl	%edi,%eax
+	movl	%r14d,60(%rsp)
+	movl	%edi,%ebx
+	xorl	8(%rsp),%edx
+	andl	%esi,%eax
+	movl	%r12d,%ecx
+	xorl	32(%rsp),%edx
+	leal	-1894007588(%r14,%r11,1),%r11d
+	xorl	%esi,%ebx
+	roll	$5,%ecx
+	addl	%eax,%r11d
+	roll	$1,%edx
+	andl	%r13d,%ebx
+	addl	%ecx,%r11d
+	roll	$30,%r13d
+	addl	%ebx,%r11d
+	xorl	4(%rsp),%ebp
+	movl	%esi,%eax
+	movl	%edx,0(%rsp)
+	movl	%esi,%ebx
+	xorl	12(%rsp),%ebp
+	andl	%r13d,%eax
+	movl	%r11d,%ecx
+	xorl	36(%rsp),%ebp
+	leal	-1894007588(%rdx,%rdi,1),%edi
+	xorl	%r13d,%ebx
+	roll	$5,%ecx
+	addl	%eax,%edi
+	roll	$1,%ebp
+	andl	%r12d,%ebx
+	addl	%ecx,%edi
+	roll	$30,%r12d
+	addl	%ebx,%edi
+	xorl	8(%rsp),%r14d
+	movl	%r13d,%eax
+	movl	%ebp,4(%rsp)
+	movl	%r13d,%ebx
+	xorl	16(%rsp),%r14d
+	andl	%r12d,%eax
+	movl	%edi,%ecx
+	xorl	40(%rsp),%r14d
+	leal	-1894007588(%rbp,%rsi,1),%esi
+	xorl	%r12d,%ebx
+	roll	$5,%ecx
+	addl	%eax,%esi
+	roll	$1,%r14d
+	andl	%r11d,%ebx
+	addl	%ecx,%esi
+	roll	$30,%r11d
+	addl	%ebx,%esi
+	xorl	12(%rsp),%edx
+	movl	%r12d,%eax
+	movl	%r14d,8(%rsp)
+	movl	%r12d,%ebx
+	xorl	20(%rsp),%edx
+	andl	%r11d,%eax
+	movl	%esi,%ecx
+	xorl	44(%rsp),%edx
+	leal	-1894007588(%r14,%r13,1),%r13d
+	xorl	%r11d,%ebx
+	roll	$5,%ecx
+	addl	%eax,%r13d
+	roll	$1,%edx
+	andl	%edi,%ebx
+	addl	%ecx,%r13d
+	roll	$30,%edi
+	addl	%ebx,%r13d
+	xorl	16(%rsp),%ebp
+	movl	%r11d,%eax
+	movl	%edx,12(%rsp)
+	movl	%r11d,%ebx
+	xorl	24(%rsp),%ebp
+	andl	%edi,%eax
+	movl	%r13d,%ecx
+	xorl	48(%rsp),%ebp
+	leal	-1894007588(%rdx,%r12,1),%r12d
+	xorl	%edi,%ebx
+	roll	$5,%ecx
+	addl	%eax,%r12d
+	roll	$1,%ebp
+	andl	%esi,%ebx
+	addl	%ecx,%r12d
+	roll	$30,%esi
+	addl	%ebx,%r12d
+	xorl	20(%rsp),%r14d
+	movl	%edi,%eax
+	movl	%ebp,16(%rsp)
+	movl	%edi,%ebx
+	xorl	28(%rsp),%r14d
+	andl	%esi,%eax
+	movl	%r12d,%ecx
+	xorl	52(%rsp),%r14d
+	leal	-1894007588(%rbp,%r11,1),%r11d
+	xorl	%esi,%ebx
+	roll	$5,%ecx
+	addl	%eax,%r11d
+	roll	$1,%r14d
+	andl	%r13d,%ebx
+	addl	%ecx,%r11d
+	roll	$30,%r13d
+	addl	%ebx,%r11d
+	xorl	24(%rsp),%edx
+	movl	%esi,%eax
+	movl	%r14d,20(%rsp)
+	movl	%esi,%ebx
+	xorl	32(%rsp),%edx
+	andl	%r13d,%eax
+	movl	%r11d,%ecx
+	xorl	56(%rsp),%edx
+	leal	-1894007588(%r14,%rdi,1),%edi
+	xorl	%r13d,%ebx
+	roll	$5,%ecx
+	addl	%eax,%edi
+	roll	$1,%edx
+	andl	%r12d,%ebx
+	addl	%ecx,%edi
+	roll	$30,%r12d
+	addl	%ebx,%edi
+	xorl	28(%rsp),%ebp
+	movl	%r13d,%eax
+	movl	%edx,24(%rsp)
+	movl	%r13d,%ebx
+	xorl	36(%rsp),%ebp
+	andl	%r12d,%eax
+	movl	%edi,%ecx
+	xorl	60(%rsp),%ebp
+	leal	-1894007588(%rdx,%rsi,1),%esi
+	xorl	%r12d,%ebx
+	roll	$5,%ecx
+	addl	%eax,%esi
+	roll	$1,%ebp
+	andl	%r11d,%ebx
+	addl	%ecx,%esi
+	roll	$30,%r11d
+	addl	%ebx,%esi
+	xorl	32(%rsp),%r14d
+	movl	%r12d,%eax
+	movl	%ebp,28(%rsp)
+	movl	%r12d,%ebx
+	xorl	40(%rsp),%r14d
+	andl	%r11d,%eax
+	movl	%esi,%ecx
+	xorl	0(%rsp),%r14d
+	leal	-1894007588(%rbp,%r13,1),%r13d
+	xorl	%r11d,%ebx
+	roll	$5,%ecx
+	addl	%eax,%r13d
+	roll	$1,%r14d
+	andl	%edi,%ebx
+	addl	%ecx,%r13d
+	roll	$30,%edi
+	addl	%ebx,%r13d
+	xorl	36(%rsp),%edx
+	movl	%r11d,%eax
+	movl	%r14d,32(%rsp)
+	movl	%r11d,%ebx
+	xorl	44(%rsp),%edx
+	andl	%edi,%eax
+	movl	%r13d,%ecx
+	xorl	4(%rsp),%edx
+	leal	-1894007588(%r14,%r12,1),%r12d
+	xorl	%edi,%ebx
+	roll	$5,%ecx
+	addl	%eax,%r12d
+	roll	$1,%edx
+	andl	%esi,%ebx
+	addl	%ecx,%r12d
+	roll	$30,%esi
+	addl	%ebx,%r12d
+	xorl	40(%rsp),%ebp
+	movl	%edi,%eax
+	movl	%edx,36(%rsp)
+	movl	%edi,%ebx
+	xorl	48(%rsp),%ebp
+	andl	%esi,%eax
+	movl	%r12d,%ecx
+	xorl	8(%rsp),%ebp
+	leal	-1894007588(%rdx,%r11,1),%r11d
+	xorl	%esi,%ebx
+	roll	$5,%ecx
+	addl	%eax,%r11d
+	roll	$1,%ebp
+	andl	%r13d,%ebx
+	addl	%ecx,%r11d
+	roll	$30,%r13d
+	addl	%ebx,%r11d
+	xorl	44(%rsp),%r14d
+	movl	%esi,%eax
+	movl	%ebp,40(%rsp)
+	movl	%esi,%ebx
+	xorl	52(%rsp),%r14d
+	andl	%r13d,%eax
+	movl	%r11d,%ecx
+	xorl	12(%rsp),%r14d
+	leal	-1894007588(%rbp,%rdi,1),%edi
+	xorl	%r13d,%ebx
+	roll	$5,%ecx
+	addl	%eax,%edi
+	roll	$1,%r14d
+	andl	%r12d,%ebx
+	addl	%ecx,%edi
+	roll	$30,%r12d
+	addl	%ebx,%edi
+	xorl	48(%rsp),%edx
+	movl	%r13d,%eax
+	movl	%r14d,44(%rsp)
+	movl	%r13d,%ebx
+	xorl	56(%rsp),%edx
+	andl	%r12d,%eax
+	movl	%edi,%ecx
+	xorl	16(%rsp),%edx
+	leal	-1894007588(%r14,%rsi,1),%esi
+	xorl	%r12d,%ebx
+	roll	$5,%ecx
+	addl	%eax,%esi
+	roll	$1,%edx
+	andl	%r11d,%ebx
+	addl	%ecx,%esi
+	roll	$30,%r11d
+	addl	%ebx,%esi
+	xorl	52(%rsp),%ebp
+	movl	%edi,%eax
+	movl	%edx,48(%rsp)
+	movl	%esi,%ecx
+	xorl	60(%rsp),%ebp
+	xorl	%r12d,%eax
+	roll	$5,%ecx
+	xorl	20(%rsp),%ebp
+	leal	-899497514(%rdx,%r13,1),%r13d
+	xorl	%r11d,%eax
+	addl	%ecx,%r13d
+	roll	$30,%edi
+	addl	%eax,%r13d
+	roll	$1,%ebp
+	xorl	56(%rsp),%r14d
+	movl	%esi,%eax
+	movl	%ebp,52(%rsp)
+	movl	%r13d,%ecx
+	xorl	0(%rsp),%r14d
+	xorl	%r11d,%eax
+	roll	$5,%ecx
+	xorl	24(%rsp),%r14d
+	leal	-899497514(%rbp,%r12,1),%r12d
+	xorl	%edi,%eax
+	addl	%ecx,%r12d
+	roll	$30,%esi
+	addl	%eax,%r12d
+	roll	$1,%r14d
+	xorl	60(%rsp),%edx
+	movl	%r13d,%eax
+	movl	%r14d,56(%rsp)
+	movl	%r12d,%ecx
+	xorl	4(%rsp),%edx
+	xorl	%edi,%eax
+	roll	$5,%ecx
+	xorl	28(%rsp),%edx
+	leal	-899497514(%r14,%r11,1),%r11d
+	xorl	%esi,%eax
+	addl	%ecx,%r11d
+	roll	$30,%r13d
+	addl	%eax,%r11d
+	roll	$1,%edx
+	xorl	0(%rsp),%ebp
+	movl	%r12d,%eax
+	movl	%edx,60(%rsp)
+	movl	%r11d,%ecx
+	xorl	8(%rsp),%ebp
+	xorl	%esi,%eax
+	roll	$5,%ecx
+	xorl	32(%rsp),%ebp
+	leal	-899497514(%rdx,%rdi,1),%edi
+	xorl	%r13d,%eax
+	addl	%ecx,%edi
+	roll	$30,%r12d
+	addl	%eax,%edi
+	roll	$1,%ebp
+	xorl	4(%rsp),%r14d
+	movl	%r11d,%eax
+	movl	%ebp,0(%rsp)
+	movl	%edi,%ecx
+	xorl	12(%rsp),%r14d
+	xorl	%r13d,%eax
+	roll	$5,%ecx
+	xorl	36(%rsp),%r14d
+	leal	-899497514(%rbp,%rsi,1),%esi
+	xorl	%r12d,%eax
+	addl	%ecx,%esi
+	roll	$30,%r11d
+	addl	%eax,%esi
+	roll	$1,%r14d
+	xorl	8(%rsp),%edx
+	movl	%edi,%eax
+	movl	%r14d,4(%rsp)
+	movl	%esi,%ecx
+	xorl	16(%rsp),%edx
+	xorl	%r12d,%eax
+	roll	$5,%ecx
+	xorl	40(%rsp),%edx
+	leal	-899497514(%r14,%r13,1),%r13d
+	xorl	%r11d,%eax
+	addl	%ecx,%r13d
+	roll	$30,%edi
+	addl	%eax,%r13d
+	roll	$1,%edx
+	xorl	12(%rsp),%ebp
+	movl	%esi,%eax
+	movl	%edx,8(%rsp)
+	movl	%r13d,%ecx
+	xorl	20(%rsp),%ebp
+	xorl	%r11d,%eax
+	roll	$5,%ecx
+	xorl	44(%rsp),%ebp
+	leal	-899497514(%rdx,%r12,1),%r12d
+	xorl	%edi,%eax
+	addl	%ecx,%r12d
+	roll	$30,%esi
+	addl	%eax,%r12d
+	roll	$1,%ebp
+	xorl	16(%rsp),%r14d
+	movl	%r13d,%eax
+	movl	%ebp,12(%rsp)
+	movl	%r12d,%ecx
+	xorl	24(%rsp),%r14d
+	xorl	%edi,%eax
+	roll	$5,%ecx
+	xorl	48(%rsp),%r14d
+	leal	-899497514(%rbp,%r11,1),%r11d
+	xorl	%esi,%eax
+	addl	%ecx,%r11d
+	roll	$30,%r13d
+	addl	%eax,%r11d
+	roll	$1,%r14d
+	xorl	20(%rsp),%edx
+	movl	%r12d,%eax
+	movl	%r14d,16(%rsp)
+	movl	%r11d,%ecx
+	xorl	28(%rsp),%edx
+	xorl	%esi,%eax
+	roll	$5,%ecx
+	xorl	52(%rsp),%edx
+	leal	-899497514(%r14,%rdi,1),%edi
+	xorl	%r13d,%eax
+	addl	%ecx,%edi
+	roll	$30,%r12d
+	addl	%eax,%edi
+	roll	$1,%edx
+	xorl	24(%rsp),%ebp
+	movl	%r11d,%eax
+	movl	%edx,20(%rsp)
+	movl	%edi,%ecx
+	xorl	32(%rsp),%ebp
+	xorl	%r13d,%eax
+	roll	$5,%ecx
+	xorl	56(%rsp),%ebp
+	leal	-899497514(%rdx,%rsi,1),%esi
+	xorl	%r12d,%eax
+	addl	%ecx,%esi
+	roll	$30,%r11d
+	addl	%eax,%esi
+	roll	$1,%ebp
+	xorl	28(%rsp),%r14d
+	movl	%edi,%eax
+	movl	%ebp,24(%rsp)
+	movl	%esi,%ecx
+	xorl	36(%rsp),%r14d
+	xorl	%r12d,%eax
+	roll	$5,%ecx
+	xorl	60(%rsp),%r14d
+	leal	-899497514(%rbp,%r13,1),%r13d
+	xorl	%r11d,%eax
+	addl	%ecx,%r13d
+	roll	$30,%edi
+	addl	%eax,%r13d
+	roll	$1,%r14d
+	xorl	32(%rsp),%edx
+	movl	%esi,%eax
+	movl	%r14d,28(%rsp)
+	movl	%r13d,%ecx
+	xorl	40(%rsp),%edx
+	xorl	%r11d,%eax
+	roll	$5,%ecx
+	xorl	0(%rsp),%edx
+	leal	-899497514(%r14,%r12,1),%r12d
+	xorl	%edi,%eax
+	addl	%ecx,%r12d
+	roll	$30,%esi
+	addl	%eax,%r12d
+	roll	$1,%edx
+	xorl	36(%rsp),%ebp
+	movl	%r13d,%eax
+
+	movl	%r12d,%ecx
+	xorl	44(%rsp),%ebp
+	xorl	%edi,%eax
+	roll	$5,%ecx
+	xorl	4(%rsp),%ebp
+	leal	-899497514(%rdx,%r11,1),%r11d
+	xorl	%esi,%eax
+	addl	%ecx,%r11d
+	roll	$30,%r13d
+	addl	%eax,%r11d
+	roll	$1,%ebp
+	xorl	40(%rsp),%r14d
+	movl	%r12d,%eax
+
+	movl	%r11d,%ecx
+	xorl	48(%rsp),%r14d
+	xorl	%esi,%eax
+	roll	$5,%ecx
+	xorl	8(%rsp),%r14d
+	leal	-899497514(%rbp,%rdi,1),%edi
+	xorl	%r13d,%eax
+	addl	%ecx,%edi
+	roll	$30,%r12d
+	addl	%eax,%edi
+	roll	$1,%r14d
+	xorl	44(%rsp),%edx
+	movl	%r11d,%eax
+
+	movl	%edi,%ecx
+	xorl	52(%rsp),%edx
+	xorl	%r13d,%eax
+	roll	$5,%ecx
+	xorl	12(%rsp),%edx
+	leal	-899497514(%r14,%rsi,1),%esi
+	xorl	%r12d,%eax
+	addl	%ecx,%esi
+	roll	$30,%r11d
+	addl	%eax,%esi
+	roll	$1,%edx
+	xorl	48(%rsp),%ebp
+	movl	%edi,%eax
+
+	movl	%esi,%ecx
+	xorl	56(%rsp),%ebp
+	xorl	%r12d,%eax
+	roll	$5,%ecx
+	xorl	16(%rsp),%ebp
+	leal	-899497514(%rdx,%r13,1),%r13d
+	xorl	%r11d,%eax
+	addl	%ecx,%r13d
+	roll	$30,%edi
+	addl	%eax,%r13d
+	roll	$1,%ebp
+	xorl	52(%rsp),%r14d
+	movl	%esi,%eax
+
+	movl	%r13d,%ecx
+	xorl	60(%rsp),%r14d
+	xorl	%r11d,%eax
+	roll	$5,%ecx
+	xorl	20(%rsp),%r14d
+	leal	-899497514(%rbp,%r12,1),%r12d
+	xorl	%edi,%eax
+	addl	%ecx,%r12d
+	roll	$30,%esi
+	addl	%eax,%r12d
+	roll	$1,%r14d
+	xorl	56(%rsp),%edx
+	movl	%r13d,%eax
+
+	movl	%r12d,%ecx
+	xorl	0(%rsp),%edx
+	xorl	%edi,%eax
+	roll	$5,%ecx
+	xorl	24(%rsp),%edx
+	leal	-899497514(%r14,%r11,1),%r11d
+	xorl	%esi,%eax
+	addl	%ecx,%r11d
+	roll	$30,%r13d
+	addl	%eax,%r11d
+	roll	$1,%edx
+	xorl	60(%rsp),%ebp
+	movl	%r12d,%eax
+
+	movl	%r11d,%ecx
+	xorl	4(%rsp),%ebp
+	xorl	%esi,%eax
+	roll	$5,%ecx
+	xorl	28(%rsp),%ebp
+	leal	-899497514(%rdx,%rdi,1),%edi
+	xorl	%r13d,%eax
+	addl	%ecx,%edi
+	roll	$30,%r12d
+	addl	%eax,%edi
+	roll	$1,%ebp
+	movl	%r11d,%eax
+	movl	%edi,%ecx
+	xorl	%r13d,%eax
+	leal	-899497514(%rbp,%rsi,1),%esi
+	roll	$5,%ecx
+	xorl	%r12d,%eax
+	addl	%ecx,%esi
+	roll	$30,%r11d
+	addl	%eax,%esi
+	addl	0(%r8),%esi
+	addl	4(%r8),%edi
+	addl	8(%r8),%r11d
+	addl	12(%r8),%r12d
+	addl	16(%r8),%r13d
+	movl	%esi,0(%r8)
+	movl	%edi,4(%r8)
+	movl	%r11d,8(%r8)
+	movl	%r12d,12(%r8)
+	movl	%r13d,16(%r8)
+
+	subq	$1,%r10
+	leaq	64(%r9),%r9
+	jnz	.Lloop
+
+	movq	64(%rsp),%rsi
+	movq	-40(%rsi),%r14
+	movq	-32(%rsi),%r13
+	movq	-24(%rsi),%r12
+	movq	-16(%rsi),%rbp
+	movq	-8(%rsi),%rbx
+	leaq	(%rsi),%rsp
+.Lepilogue:
+	.byte	0xf3,0xc3
+.size	sha1_block_data_order,.-sha1_block_data_order
+.type	sha1_block_data_order_ssse3,@function
+.align	16
+sha1_block_data_order_ssse3:
+_ssse3_shortcut:
+	movq	%rsp,%rax
+	pushq	%rbx
+	pushq	%rbp
+	pushq	%r12
+	pushq	%r13
+	pushq	%r14
+	leaq	-64(%rsp),%rsp
+	movq	%rax,%r14
+	andq	$-64,%rsp
+	movq	%rdi,%r8
+	movq	%rsi,%r9
+	movq	%rdx,%r10
+
+	shlq	$6,%r10
+	addq	%r9,%r10
+	leaq	K_XX_XX+64(%rip),%r11
+
+	movl	0(%r8),%eax
+	movl	4(%r8),%ebx
+	movl	8(%r8),%ecx
+	movl	12(%r8),%edx
+	movl	%ebx,%esi
+	movl	16(%r8),%ebp
+	movl	%ecx,%edi
+	xorl	%edx,%edi
+	andl	%edi,%esi
+
+	movdqa	64(%r11),%xmm6
+	movdqa	-64(%r11),%xmm9
+	movdqu	0(%r9),%xmm0
+	movdqu	16(%r9),%xmm1
+	movdqu	32(%r9),%xmm2
+	movdqu	48(%r9),%xmm3
+.byte	102,15,56,0,198
+.byte	102,15,56,0,206
+.byte	102,15,56,0,214
+	addq	$64,%r9
+	paddd	%xmm9,%xmm0
+.byte	102,15,56,0,222
+	paddd	%xmm9,%xmm1
+	paddd	%xmm9,%xmm2
+	movdqa	%xmm0,0(%rsp)
+	psubd	%xmm9,%xmm0
+	movdqa	%xmm1,16(%rsp)
+	psubd	%xmm9,%xmm1
+	movdqa	%xmm2,32(%rsp)
+	psubd	%xmm9,%xmm2
+	jmp	.Loop_ssse3
+.align	16
+.Loop_ssse3:
+	rorl	$2,%ebx
+	pshufd	$238,%xmm0,%xmm4
+	xorl	%edx,%esi
+	movdqa	%xmm3,%xmm8
+	paddd	%xmm3,%xmm9
+	movl	%eax,%edi
+	addl	0(%rsp),%ebp
+	punpcklqdq	%xmm1,%xmm4
+	xorl	%ecx,%ebx
+	roll	$5,%eax
+	addl	%esi,%ebp
+	psrldq	$4,%xmm8
+	andl	%ebx,%edi
+	xorl	%ecx,%ebx
+	pxor	%xmm0,%xmm4
+	addl	%eax,%ebp
+	rorl	$7,%eax
+	pxor	%xmm2,%xmm8
+	xorl	%ecx,%edi
+	movl	%ebp,%esi
+	addl	4(%rsp),%edx
+	pxor	%xmm8,%xmm4
+	xorl	%ebx,%eax
+	roll	$5,%ebp
+	movdqa	%xmm9,48(%rsp)
+	addl	%edi,%edx
+	andl	%eax,%esi
+	movdqa	%xmm4,%xmm10
+	xorl	%ebx,%eax
+	addl	%ebp,%edx
+	rorl	$7,%ebp
+	movdqa	%xmm4,%xmm8
+	xorl	%ebx,%esi
+	pslldq	$12,%xmm10
+	paddd	%xmm4,%xmm4
+	movl	%edx,%edi
+	addl	8(%rsp),%ecx
+	psrld	$31,%xmm8
+	xorl	%eax,%ebp
+	roll	$5,%edx
+	addl	%esi,%ecx
+	movdqa	%xmm10,%xmm9
+	andl	%ebp,%edi
+	xorl	%eax,%ebp
+	psrld	$30,%xmm10
+	addl	%edx,%ecx
+	rorl	$7,%edx
+	por	%xmm8,%xmm4
+	xorl	%eax,%edi
+	movl	%ecx,%esi
+	addl	12(%rsp),%ebx
+	pslld	$2,%xmm9
+	pxor	%xmm10,%xmm4
+	xorl	%ebp,%edx
+	movdqa	-64(%r11),%xmm10
+	roll	$5,%ecx
+	addl	%edi,%ebx
+	andl	%edx,%esi
+	pxor	%xmm9,%xmm4
+	xorl	%ebp,%edx
+	addl	%ecx,%ebx
+	rorl	$7,%ecx
+	pshufd	$238,%xmm1,%xmm5
+	xorl	%ebp,%esi
+	movdqa	%xmm4,%xmm9
+	paddd	%xmm4,%xmm10
+	movl	%ebx,%edi
+	addl	16(%rsp),%eax
+	punpcklqdq	%xmm2,%xmm5
+	xorl	%edx,%ecx
+	roll	$5,%ebx
+	addl	%esi,%eax
+	psrldq	$4,%xmm9
+	andl	%ecx,%edi
+	xorl	%edx,%ecx
+	pxor	%xmm1,%xmm5
+	addl	%ebx,%eax
+	rorl	$7,%ebx
+	pxor	%xmm3,%xmm9
+	xorl	%edx,%edi
+	movl	%eax,%esi
+	addl	20(%rsp),%ebp
+	pxor	%xmm9,%xmm5
+	xorl	%ecx,%ebx
+	roll	$5,%eax
+	movdqa	%xmm10,0(%rsp)
+	addl	%edi,%ebp
+	andl	%ebx,%esi
+	movdqa	%xmm5,%xmm8
+	xorl	%ecx,%ebx
+	addl	%eax,%ebp
+	rorl	$7,%eax
+	movdqa	%xmm5,%xmm9
+	xorl	%ecx,%esi
+	pslldq	$12,%xmm8
+	paddd	%xmm5,%xmm5
+	movl	%ebp,%edi
+	addl	24(%rsp),%edx
+	psrld	$31,%xmm9
+	xorl	%ebx,%eax
+	roll	$5,%ebp
+	addl	%esi,%edx
+	movdqa	%xmm8,%xmm10
+	andl	%eax,%edi
+	xorl	%ebx,%eax
+	psrld	$30,%xmm8
+	addl	%ebp,%edx
+	rorl	$7,%ebp
+	por	%xmm9,%xmm5
+	xorl	%ebx,%edi
+	movl	%edx,%esi
+	addl	28(%rsp),%ecx
+	pslld	$2,%xmm10
+	pxor	%xmm8,%xmm5
+	xorl	%eax,%ebp
+	movdqa	-32(%r11),%xmm8
+	roll	$5,%edx
+	addl	%edi,%ecx
+	andl	%ebp,%esi
+	pxor	%xmm10,%xmm5
+	xorl	%eax,%ebp
+	addl	%edx,%ecx
+	rorl	$7,%edx
+	pshufd	$238,%xmm2,%xmm6
+	xorl	%eax,%esi
+	movdqa	%xmm5,%xmm10
+	paddd	%xmm5,%xmm8
+	movl	%ecx,%edi
+	addl	32(%rsp),%ebx
+	punpcklqdq	%xmm3,%xmm6
+	xorl	%ebp,%edx
+	roll	$5,%ecx
+	addl	%esi,%ebx
+	psrldq	$4,%xmm10
+	andl	%edx,%edi
+	xorl	%ebp,%edx
+	pxor	%xmm2,%xmm6
+	addl	%ecx,%ebx
+	rorl	$7,%ecx
+	pxor	%xmm4,%xmm10
+	xorl	%ebp,%edi
+	movl	%ebx,%esi
+	addl	36(%rsp),%eax
+	pxor	%xmm10,%xmm6
+	xorl	%edx,%ecx
+	roll	$5,%ebx
+	movdqa	%xmm8,16(%rsp)
+	addl	%edi,%eax
+	andl	%ecx,%esi
+	movdqa	%xmm6,%xmm9
+	xorl	%edx,%ecx
+	addl	%ebx,%eax
+	rorl	$7,%ebx
+	movdqa	%xmm6,%xmm10
+	xorl	%edx,%esi
+	pslldq	$12,%xmm9
+	paddd	%xmm6,%xmm6
+	movl	%eax,%edi
+	addl	40(%rsp),%ebp
+	psrld	$31,%xmm10
+	xorl	%ecx,%ebx
+	roll	$5,%eax
+	addl	%esi,%ebp
+	movdqa	%xmm9,%xmm8
+	andl	%ebx,%edi
+	xorl	%ecx,%ebx
+	psrld	$30,%xmm9
+	addl	%eax,%ebp
+	rorl	$7,%eax
+	por	%xmm10,%xmm6
+	xorl	%ecx,%edi
+	movl	%ebp,%esi
+	addl	44(%rsp),%edx
+	pslld	$2,%xmm8
+	pxor	%xmm9,%xmm6
+	xorl	%ebx,%eax
+	movdqa	-32(%r11),%xmm9
+	roll	$5,%ebp
+	addl	%edi,%edx
+	andl	%eax,%esi
+	pxor	%xmm8,%xmm6
+	xorl	%ebx,%eax
+	addl	%ebp,%edx
+	rorl	$7,%ebp
+	pshufd	$238,%xmm3,%xmm7
+	xorl	%ebx,%esi
+	movdqa	%xmm6,%xmm8
+	paddd	%xmm6,%xmm9
+	movl	%edx,%edi
+	addl	48(%rsp),%ecx
+	punpcklqdq	%xmm4,%xmm7
+	xorl	%eax,%ebp
+	roll	$5,%edx
+	addl	%esi,%ecx
+	psrldq	$4,%xmm8
+	andl	%ebp,%edi
+	xorl	%eax,%ebp
+	pxor	%xmm3,%xmm7
+	addl	%edx,%ecx
+	rorl	$7,%edx
+	pxor	%xmm5,%xmm8
+	xorl	%eax,%edi
+	movl	%ecx,%esi
+	addl	52(%rsp),%ebx
+	pxor	%xmm8,%xmm7
+	xorl	%ebp,%edx
+	roll	$5,%ecx
+	movdqa	%xmm9,32(%rsp)
+	addl	%edi,%ebx
+	andl	%edx,%esi
+	movdqa	%xmm7,%xmm10
+	xorl	%ebp,%edx
+	addl	%ecx,%ebx
+	rorl	$7,%ecx
+	movdqa	%xmm7,%xmm8
+	xorl	%ebp,%esi
+	pslldq	$12,%xmm10
+	paddd	%xmm7,%xmm7
+	movl	%ebx,%edi
+	addl	56(%rsp),%eax
+	psrld	$31,%xmm8
+	xorl	%edx,%ecx
+	roll	$5,%ebx
+	addl	%esi,%eax
+	movdqa	%xmm10,%xmm9
+	andl	%ecx,%edi
+	xorl	%edx,%ecx
+	psrld	$30,%xmm10
+	addl	%ebx,%eax
+	rorl	$7,%ebx
+	por	%xmm8,%xmm7
+	xorl	%edx,%edi
+	movl	%eax,%esi
+	addl	60(%rsp),%ebp
+	pslld	$2,%xmm9
+	pxor	%xmm10,%xmm7
+	xorl	%ecx,%ebx
+	movdqa	-32(%r11),%xmm10
+	roll	$5,%eax
+	addl	%edi,%ebp
+	andl	%ebx,%esi
+	pxor	%xmm9,%xmm7
+	pshufd	$238,%xmm6,%xmm9
+	xorl	%ecx,%ebx
+	addl	%eax,%ebp
+	rorl	$7,%eax
+	pxor	%xmm4,%xmm0
+	xorl	%ecx,%esi
+	movl	%ebp,%edi
+	addl	0(%rsp),%edx
+	punpcklqdq	%xmm7,%xmm9
+	xorl	%ebx,%eax
+	roll	$5,%ebp
+	pxor	%xmm1,%xmm0
+	addl	%esi,%edx
+	andl	%eax,%edi
+	movdqa	%xmm10,%xmm8
+	xorl	%ebx,%eax
+	paddd	%xmm7,%xmm10
+	addl	%ebp,%edx
+	pxor	%xmm9,%xmm0
+	rorl	$7,%ebp
+	xorl	%ebx,%edi
+	movl	%edx,%esi
+	addl	4(%rsp),%ecx
+	movdqa	%xmm0,%xmm9
+	xorl	%eax,%ebp
+	roll	$5,%edx
+	movdqa	%xmm10,48(%rsp)
+	addl	%edi,%ecx
+	andl	%ebp,%esi
+	xorl	%eax,%ebp
+	pslld	$2,%xmm0
+	addl	%edx,%ecx
+	rorl	$7,%edx
+	psrld	$30,%xmm9
+	xorl	%eax,%esi
+	movl	%ecx,%edi
+	addl	8(%rsp),%ebx
+	por	%xmm9,%xmm0
+	xorl	%ebp,%edx
+	roll	$5,%ecx
+	pshufd	$238,%xmm7,%xmm10
+	addl	%esi,%ebx
+	andl	%edx,%edi
+	xorl	%ebp,%edx
+	addl	%ecx,%ebx
+	addl	12(%rsp),%eax
+	xorl	%ebp,%edi
+	movl	%ebx,%esi
+	roll	$5,%ebx
+	addl	%edi,%eax
+	xorl	%edx,%esi
+	rorl	$7,%ecx
+	addl	%ebx,%eax
+	pxor	%xmm5,%xmm1
+	addl	16(%rsp),%ebp
+	xorl	%ecx,%esi
+	punpcklqdq	%xmm0,%xmm10
+	movl	%eax,%edi
+	roll	$5,%eax
+	pxor	%xmm2,%xmm1
+	addl	%esi,%ebp
+	xorl	%ecx,%edi
+	movdqa	%xmm8,%xmm9
+	rorl	$7,%ebx
+	paddd	%xmm0,%xmm8
+	addl	%eax,%ebp
+	pxor	%xmm10,%xmm1
+	addl	20(%rsp),%edx
+	xorl	%ebx,%edi
+	movl	%ebp,%esi
+	roll	$5,%ebp
+	movdqa	%xmm1,%xmm10
+	addl	%edi,%edx
+	xorl	%ebx,%esi
+	movdqa	%xmm8,0(%rsp)
+	rorl	$7,%eax
+	addl	%ebp,%edx
+	addl	24(%rsp),%ecx
+	pslld	$2,%xmm1
+	xorl	%eax,%esi
+	movl	%edx,%edi
+	psrld	$30,%xmm10
+	roll	$5,%edx
+	addl	%esi,%ecx
+	xorl	%eax,%edi
+	rorl	$7,%ebp
+	por	%xmm10,%xmm1
+	addl	%edx,%ecx
+	addl	28(%rsp),%ebx
+	pshufd	$238,%xmm0,%xmm8
+	xorl	%ebp,%edi
+	movl	%ecx,%esi
+	roll	$5,%ecx
+	addl	%edi,%ebx
+	xorl	%ebp,%esi
+	rorl	$7,%edx
+	addl	%ecx,%ebx
+	pxor	%xmm6,%xmm2
+	addl	32(%rsp),%eax
+	xorl	%edx,%esi
+	punpcklqdq	%xmm1,%xmm8
+	movl	%ebx,%edi
+	roll	$5,%ebx
+	pxor	%xmm3,%xmm2
+	addl	%esi,%eax
+	xorl	%edx,%edi
+	movdqa	0(%r11),%xmm10
+	rorl	$7,%ecx
+	paddd	%xmm1,%xmm9
+	addl	%ebx,%eax
+	pxor	%xmm8,%xmm2
+	addl	36(%rsp),%ebp
+	xorl	%ecx,%edi
+	movl	%eax,%esi
+	roll	$5,%eax
+	movdqa	%xmm2,%xmm8
+	addl	%edi,%ebp
+	xorl	%ecx,%esi
+	movdqa	%xmm9,16(%rsp)
+	rorl	$7,%ebx
+	addl	%eax,%ebp
+	addl	40(%rsp),%edx
+	pslld	$2,%xmm2
+	xorl	%ebx,%esi
+	movl	%ebp,%edi
+	psrld	$30,%xmm8
+	roll	$5,%ebp
+	addl	%esi,%edx
+	xorl	%ebx,%edi
+	rorl	$7,%eax
+	por	%xmm8,%xmm2
+	addl	%ebp,%edx
+	addl	44(%rsp),%ecx
+	pshufd	$238,%xmm1,%xmm9
+	xorl	%eax,%edi
+	movl	%edx,%esi
+	roll	$5,%edx
+	addl	%edi,%ecx
+	xorl	%eax,%esi
+	rorl	$7,%ebp
+	addl	%edx,%ecx
+	pxor	%xmm7,%xmm3
+	addl	48(%rsp),%ebx
+	xorl	%ebp,%esi
+	punpcklqdq	%xmm2,%xmm9
+	movl	%ecx,%edi
+	roll	$5,%ecx
+	pxor	%xmm4,%xmm3
+	addl	%esi,%ebx
+	xorl	%ebp,%edi
+	movdqa	%xmm10,%xmm8
+	rorl	$7,%edx
+	paddd	%xmm2,%xmm10
+	addl	%ecx,%ebx
+	pxor	%xmm9,%xmm3
+	addl	52(%rsp),%eax
+	xorl	%edx,%edi
+	movl	%ebx,%esi
+	roll	$5,%ebx
+	movdqa	%xmm3,%xmm9
+	addl	%edi,%eax
+	xorl	%edx,%esi
+	movdqa	%xmm10,32(%rsp)
+	rorl	$7,%ecx
+	addl	%ebx,%eax
+	addl	56(%rsp),%ebp
+	pslld	$2,%xmm3
+	xorl	%ecx,%esi
+	movl	%eax,%edi
+	psrld	$30,%xmm9
+	roll	$5,%eax
+	addl	%esi,%ebp
+	xorl	%ecx,%edi
+	rorl	$7,%ebx
+	por	%xmm9,%xmm3
+	addl	%eax,%ebp
+	addl	60(%rsp),%edx
+	pshufd	$238,%xmm2,%xmm10
+	xorl	%ebx,%edi
+	movl	%ebp,%esi
+	roll	$5,%ebp
+	addl	%edi,%edx
+	xorl	%ebx,%esi
+	rorl	$7,%eax
+	addl	%ebp,%edx
+	pxor	%xmm0,%xmm4
+	addl	0(%rsp),%ecx
+	xorl	%eax,%esi
+	punpcklqdq	%xmm3,%xmm10
+	movl	%edx,%edi
+	roll	$5,%edx
+	pxor	%xmm5,%xmm4
+	addl	%esi,%ecx
+	xorl	%eax,%edi
+	movdqa	%xmm8,%xmm9
+	rorl	$7,%ebp
+	paddd	%xmm3,%xmm8
+	addl	%edx,%ecx
+	pxor	%xmm10,%xmm4
+	addl	4(%rsp),%ebx
+	xorl	%ebp,%edi
+	movl	%ecx,%esi
+	roll	$5,%ecx
+	movdqa	%xmm4,%xmm10
+	addl	%edi,%ebx
+	xorl	%ebp,%esi
+	movdqa	%xmm8,48(%rsp)
+	rorl	$7,%edx
+	addl	%ecx,%ebx
+	addl	8(%rsp),%eax
+	pslld	$2,%xmm4
+	xorl	%edx,%esi
+	movl	%ebx,%edi
+	psrld	$30,%xmm10
+	roll	$5,%ebx
+	addl	%esi,%eax
+	xorl	%edx,%edi
+	rorl	$7,%ecx
+	por	%xmm10,%xmm4
+	addl	%ebx,%eax
+	addl	12(%rsp),%ebp
+	pshufd	$238,%xmm3,%xmm8
+	xorl	%ecx,%edi
+	movl	%eax,%esi
+	roll	$5,%eax
+	addl	%edi,%ebp
+	xorl	%ecx,%esi
+	rorl	$7,%ebx
+	addl	%eax,%ebp
+	pxor	%xmm1,%xmm5
+	addl	16(%rsp),%edx
+	xorl	%ebx,%esi
+	punpcklqdq	%xmm4,%xmm8
+	movl	%ebp,%edi
+	roll	$5,%ebp
+	pxor	%xmm6,%xmm5
+	addl	%esi,%edx
+	xorl	%ebx,%edi
+	movdqa	%xmm9,%xmm10
+	rorl	$7,%eax
+	paddd	%xmm4,%xmm9
+	addl	%ebp,%edx
+	pxor	%xmm8,%xmm5
+	addl	20(%rsp),%ecx
+	xorl	%eax,%edi
+	movl	%edx,%esi
+	roll	$5,%edx
+	movdqa	%xmm5,%xmm8
+	addl	%edi,%ecx
+	xorl	%eax,%esi
+	movdqa	%xmm9,0(%rsp)
+	rorl	$7,%ebp
+	addl	%edx,%ecx
+	addl	24(%rsp),%ebx
+	pslld	$2,%xmm5
+	xorl	%ebp,%esi
+	movl	%ecx,%edi
+	psrld	$30,%xmm8
+	roll	$5,%ecx
+	addl	%esi,%ebx
+	xorl	%ebp,%edi
+	rorl	$7,%edx
+	por	%xmm8,%xmm5
+	addl	%ecx,%ebx
+	addl	28(%rsp),%eax
+	pshufd	$238,%xmm4,%xmm9
+	rorl	$7,%ecx
+	movl	%ebx,%esi
+	xorl	%edx,%edi
+	roll	$5,%ebx
+	addl	%edi,%eax
+	xorl	%ecx,%esi
+	xorl	%edx,%ecx
+	addl	%ebx,%eax
+	pxor	%xmm2,%xmm6
+	addl	32(%rsp),%ebp
+	andl	%ecx,%esi
+	xorl	%edx,%ecx
+	rorl	$7,%ebx
+	punpcklqdq	%xmm5,%xmm9
+	movl	%eax,%edi
+	xorl	%ecx,%esi
+	pxor	%xmm7,%xmm6
+	roll	$5,%eax
+	addl	%esi,%ebp
+	movdqa	%xmm10,%xmm8
+	xorl	%ebx,%edi
+	paddd	%xmm5,%xmm10
+	xorl	%ecx,%ebx
+	pxor	%xmm9,%xmm6
+	addl	%eax,%ebp
+	addl	36(%rsp),%edx
+	andl	%ebx,%edi
+	xorl	%ecx,%ebx
+	rorl	$7,%eax
+	movdqa	%xmm6,%xmm9
+	movl	%ebp,%esi
+	xorl	%ebx,%edi
+	movdqa	%xmm10,16(%rsp)
+	roll	$5,%ebp
+	addl	%edi,%edx
+	xorl	%eax,%esi
+	pslld	$2,%xmm6
+	xorl	%ebx,%eax
+	addl	%ebp,%edx
+	psrld	$30,%xmm9
+	addl	40(%rsp),%ecx
+	andl	%eax,%esi
+	xorl	%ebx,%eax
+	por	%xmm9,%xmm6
+	rorl	$7,%ebp
+	movl	%edx,%edi
+	xorl	%eax,%esi
+	roll	$5,%edx
+	pshufd	$238,%xmm5,%xmm10
+	addl	%esi,%ecx
+	xorl	%ebp,%edi
+	xorl	%eax,%ebp
+	addl	%edx,%ecx
+	addl	44(%rsp),%ebx
+	andl	%ebp,%edi
+	xorl	%eax,%ebp
+	rorl	$7,%edx
+	movl	%ecx,%esi
+	xorl	%ebp,%edi
+	roll	$5,%ecx
+	addl	%edi,%ebx
+	xorl	%edx,%esi
+	xorl	%ebp,%edx
+	addl	%ecx,%ebx
+	pxor	%xmm3,%xmm7
+	addl	48(%rsp),%eax
+	andl	%edx,%esi
+	xorl	%ebp,%edx
+	rorl	$7,%ecx
+	punpcklqdq	%xmm6,%xmm10
+	movl	%ebx,%edi
+	xorl	%edx,%esi
+	pxor	%xmm0,%xmm7
+	roll	$5,%ebx
+	addl	%esi,%eax
+	movdqa	32(%r11),%xmm9
+	xorl	%ecx,%edi
+	paddd	%xmm6,%xmm8
+	xorl	%edx,%ecx
+	pxor	%xmm10,%xmm7
+	addl	%ebx,%eax
+	addl	52(%rsp),%ebp
+	andl	%ecx,%edi
+	xorl	%edx,%ecx
+	rorl	$7,%ebx
+	movdqa	%xmm7,%xmm10
+	movl	%eax,%esi
+	xorl	%ecx,%edi
+	movdqa	%xmm8,32(%rsp)
+	roll	$5,%eax
+	addl	%edi,%ebp
+	xorl	%ebx,%esi
+	pslld	$2,%xmm7
+	xorl	%ecx,%ebx
+	addl	%eax,%ebp
+	psrld	$30,%xmm10
+	addl	56(%rsp),%edx
+	andl	%ebx,%esi
+	xorl	%ecx,%ebx
+	por	%xmm10,%xmm7
+	rorl	$7,%eax
+	movl	%ebp,%edi
+	xorl	%ebx,%esi
+	roll	$5,%ebp
+	pshufd	$238,%xmm6,%xmm8
+	addl	%esi,%edx
+	xorl	%eax,%edi
+	xorl	%ebx,%eax
+	addl	%ebp,%edx
+	addl	60(%rsp),%ecx
+	andl	%eax,%edi
+	xorl	%ebx,%eax
+	rorl	$7,%ebp
+	movl	%edx,%esi
+	xorl	%eax,%edi
+	roll	$5,%edx
+	addl	%edi,%ecx
+	xorl	%ebp,%esi
+	xorl	%eax,%ebp
+	addl	%edx,%ecx
+	pxor	%xmm4,%xmm0
+	addl	0(%rsp),%ebx
+	andl	%ebp,%esi
+	xorl	%eax,%ebp
+	rorl	$7,%edx
+	punpcklqdq	%xmm7,%xmm8
+	movl	%ecx,%edi
+	xorl	%ebp,%esi
+	pxor	%xmm1,%xmm0
+	roll	$5,%ecx
+	addl	%esi,%ebx
+	movdqa	%xmm9,%xmm10
+	xorl	%edx,%edi
+	paddd	%xmm7,%xmm9
+	xorl	%ebp,%edx
+	pxor	%xmm8,%xmm0
+	addl	%ecx,%ebx
+	addl	4(%rsp),%eax
+	andl	%edx,%edi
+	xorl	%ebp,%edx
+	rorl	$7,%ecx
+	movdqa	%xmm0,%xmm8
+	movl	%ebx,%esi
+	xorl	%edx,%edi
+	movdqa	%xmm9,48(%rsp)
+	roll	$5,%ebx
+	addl	%edi,%eax
+	xorl	%ecx,%esi
+	pslld	$2,%xmm0
+	xorl	%edx,%ecx
+	addl	%ebx,%eax
+	psrld	$30,%xmm8
+	addl	8(%rsp),%ebp
+	andl	%ecx,%esi
+	xorl	%edx,%ecx
+	por	%xmm8,%xmm0
+	rorl	$7,%ebx
+	movl	%eax,%edi
+	xorl	%ecx,%esi
+	roll	$5,%eax
+	pshufd	$238,%xmm7,%xmm9
+	addl	%esi,%ebp
+	xorl	%ebx,%edi
+	xorl	%ecx,%ebx
+	addl	%eax,%ebp
+	addl	12(%rsp),%edx
+	andl	%ebx,%edi
+	xorl	%ecx,%ebx
+	rorl	$7,%eax
+	movl	%ebp,%esi
+	xorl	%ebx,%edi
+	roll	$5,%ebp
+	addl	%edi,%edx
+	xorl	%eax,%esi
+	xorl	%ebx,%eax
+	addl	%ebp,%edx
+	pxor	%xmm5,%xmm1
+	addl	16(%rsp),%ecx
+	andl	%eax,%esi
+	xorl	%ebx,%eax
+	rorl	$7,%ebp
+	punpcklqdq	%xmm0,%xmm9
+	movl	%edx,%edi
+	xorl	%eax,%esi
+	pxor	%xmm2,%xmm1
+	roll	$5,%edx
+	addl	%esi,%ecx
+	movdqa	%xmm10,%xmm8
+	xorl	%ebp,%edi
+	paddd	%xmm0,%xmm10
+	xorl	%eax,%ebp
+	pxor	%xmm9,%xmm1
+	addl	%edx,%ecx
+	addl	20(%rsp),%ebx
+	andl	%ebp,%edi
+	xorl	%eax,%ebp
+	rorl	$7,%edx
+	movdqa	%xmm1,%xmm9
+	movl	%ecx,%esi
+	xorl	%ebp,%edi
+	movdqa	%xmm10,0(%rsp)
+	roll	$5,%ecx
+	addl	%edi,%ebx
+	xorl	%edx,%esi
+	pslld	$2,%xmm1
+	xorl	%ebp,%edx
+	addl	%ecx,%ebx
+	psrld	$30,%xmm9
+	addl	24(%rsp),%eax
+	andl	%edx,%esi
+	xorl	%ebp,%edx
+	por	%xmm9,%xmm1
+	rorl	$7,%ecx
+	movl	%ebx,%edi
+	xorl	%edx,%esi
+	roll	$5,%ebx
+	pshufd	$238,%xmm0,%xmm10
+	addl	%esi,%eax
+	xorl	%ecx,%edi
+	xorl	%edx,%ecx
+	addl	%ebx,%eax
+	addl	28(%rsp),%ebp
+	andl	%ecx,%edi
+	xorl	%edx,%ecx
+	rorl	$7,%ebx
+	movl	%eax,%esi
+	xorl	%ecx,%edi
+	roll	$5,%eax
+	addl	%edi,%ebp
+	xorl	%ebx,%esi
+	xorl	%ecx,%ebx
+	addl	%eax,%ebp
+	pxor	%xmm6,%xmm2
+	addl	32(%rsp),%edx
+	andl	%ebx,%esi
+	xorl	%ecx,%ebx
+	rorl	$7,%eax
+	punpcklqdq	%xmm1,%xmm10
+	movl	%ebp,%edi
+	xorl	%ebx,%esi
+	pxor	%xmm3,%xmm2
+	roll	$5,%ebp
+	addl	%esi,%edx
+	movdqa	%xmm8,%xmm9
+	xorl	%eax,%edi
+	paddd	%xmm1,%xmm8
+	xorl	%ebx,%eax
+	pxor	%xmm10,%xmm2
+	addl	%ebp,%edx
+	addl	36(%rsp),%ecx
+	andl	%eax,%edi
+	xorl	%ebx,%eax
+	rorl	$7,%ebp
+	movdqa	%xmm2,%xmm10
+	movl	%edx,%esi
+	xorl	%eax,%edi
+	movdqa	%xmm8,16(%rsp)
+	roll	$5,%edx
+	addl	%edi,%ecx
+	xorl	%ebp,%esi
+	pslld	$2,%xmm2
+	xorl	%eax,%ebp
+	addl	%edx,%ecx
+	psrld	$30,%xmm10
+	addl	40(%rsp),%ebx
+	andl	%ebp,%esi
+	xorl	%eax,%ebp
+	por	%xmm10,%xmm2
+	rorl	$7,%edx
+	movl	%ecx,%edi
+	xorl	%ebp,%esi
+	roll	$5,%ecx
+	pshufd	$238,%xmm1,%xmm8
+	addl	%esi,%ebx
+	xorl	%edx,%edi
+	xorl	%ebp,%edx
+	addl	%ecx,%ebx
+	addl	44(%rsp),%eax
+	andl	%edx,%edi
+	xorl	%ebp,%edx
+	rorl	$7,%ecx
+	movl	%ebx,%esi
+	xorl	%edx,%edi
+	roll	$5,%ebx
+	addl	%edi,%eax
+	xorl	%edx,%esi
+	addl	%ebx,%eax
+	pxor	%xmm7,%xmm3
+	addl	48(%rsp),%ebp
+	xorl	%ecx,%esi
+	punpcklqdq	%xmm2,%xmm8
+	movl	%eax,%edi
+	roll	$5,%eax
+	pxor	%xmm4,%xmm3
+	addl	%esi,%ebp
+	xorl	%ecx,%edi
+	movdqa	%xmm9,%xmm10
+	rorl	$7,%ebx
+	paddd	%xmm2,%xmm9
+	addl	%eax,%ebp
+	pxor	%xmm8,%xmm3
+	addl	52(%rsp),%edx
+	xorl	%ebx,%edi
+	movl	%ebp,%esi
+	roll	$5,%ebp
+	movdqa	%xmm3,%xmm8
+	addl	%edi,%edx
+	xorl	%ebx,%esi
+	movdqa	%xmm9,32(%rsp)
+	rorl	$7,%eax
+	addl	%ebp,%edx
+	addl	56(%rsp),%ecx
+	pslld	$2,%xmm3
+	xorl	%eax,%esi
+	movl	%edx,%edi
+	psrld	$30,%xmm8
+	roll	$5,%edx
+	addl	%esi,%ecx
+	xorl	%eax,%edi
+	rorl	$7,%ebp
+	por	%xmm8,%xmm3
+	addl	%edx,%ecx
+	addl	60(%rsp),%ebx
+	xorl	%ebp,%edi
+	movl	%ecx,%esi
+	roll	$5,%ecx
+	addl	%edi,%ebx
+	xorl	%ebp,%esi
+	rorl	$7,%edx
+	addl	%ecx,%ebx
+	addl	0(%rsp),%eax
+	xorl	%edx,%esi
+	movl	%ebx,%edi
+	roll	$5,%ebx
+	paddd	%xmm3,%xmm10
+	addl	%esi,%eax
+	xorl	%edx,%edi
+	movdqa	%xmm10,48(%rsp)
+	rorl	$7,%ecx
+	addl	%ebx,%eax
+	addl	4(%rsp),%ebp
+	xorl	%ecx,%edi
+	movl	%eax,%esi
+	roll	$5,%eax
+	addl	%edi,%ebp
+	xorl	%ecx,%esi
+	rorl	$7,%ebx
+	addl	%eax,%ebp
+	addl	8(%rsp),%edx
+	xorl	%ebx,%esi
+	movl	%ebp,%edi
+	roll	$5,%ebp
+	addl	%esi,%edx
+	xorl	%ebx,%edi
+	rorl	$7,%eax
+	addl	%ebp,%edx
+	addl	12(%rsp),%ecx
+	xorl	%eax,%edi
+	movl	%edx,%esi
+	roll	$5,%edx
+	addl	%edi,%ecx
+	xorl	%eax,%esi
+	rorl	$7,%ebp
+	addl	%edx,%ecx
+	cmpq	%r10,%r9
+	je	.Ldone_ssse3
+	movdqa	64(%r11),%xmm6
+	movdqa	-64(%r11),%xmm9
+	movdqu	0(%r9),%xmm0
+	movdqu	16(%r9),%xmm1
+	movdqu	32(%r9),%xmm2
+	movdqu	48(%r9),%xmm3
+.byte	102,15,56,0,198
+	addq	$64,%r9
+	addl	16(%rsp),%ebx
+	xorl	%ebp,%esi
+	movl	%ecx,%edi
+.byte	102,15,56,0,206
+	roll	$5,%ecx
+	addl	%esi,%ebx
+	xorl	%ebp,%edi
+	rorl	$7,%edx
+	paddd	%xmm9,%xmm0
+	addl	%ecx,%ebx
+	addl	20(%rsp),%eax
+	xorl	%edx,%edi
+	movl	%ebx,%esi
+	movdqa	%xmm0,0(%rsp)
+	roll	$5,%ebx
+	addl	%edi,%eax
+	xorl	%edx,%esi
+	rorl	$7,%ecx
+	psubd	%xmm9,%xmm0
+	addl	%ebx,%eax
+	addl	24(%rsp),%ebp
+	xorl	%ecx,%esi
+	movl	%eax,%edi
+	roll	$5,%eax
+	addl	%esi,%ebp
+	xorl	%ecx,%edi
+	rorl	$7,%ebx
+	addl	%eax,%ebp
+	addl	28(%rsp),%edx
+	xorl	%ebx,%edi
+	movl	%ebp,%esi
+	roll	$5,%ebp
+	addl	%edi,%edx
+	xorl	%ebx,%esi
+	rorl	$7,%eax
+	addl	%ebp,%edx
+	addl	32(%rsp),%ecx
+	xorl	%eax,%esi
+	movl	%edx,%edi
+.byte	102,15,56,0,214
+	roll	$5,%edx
+	addl	%esi,%ecx
+	xorl	%eax,%edi
+	rorl	$7,%ebp
+	paddd	%xmm9,%xmm1
+	addl	%edx,%ecx
+	addl	36(%rsp),%ebx
+	xorl	%ebp,%edi
+	movl	%ecx,%esi
+	movdqa	%xmm1,16(%rsp)
+	roll	$5,%ecx
+	addl	%edi,%ebx
+	xorl	%ebp,%esi
+	rorl	$7,%edx
+	psubd	%xmm9,%xmm1
+	addl	%ecx,%ebx
+	addl	40(%rsp),%eax
+	xorl	%edx,%esi
+	movl	%ebx,%edi
+	roll	$5,%ebx
+	addl	%esi,%eax
+	xorl	%edx,%edi
+	rorl	$7,%ecx
+	addl	%ebx,%eax
+	addl	44(%rsp),%ebp
+	xorl	%ecx,%edi
+	movl	%eax,%esi
+	roll	$5,%eax
+	addl	%edi,%ebp
+	xorl	%ecx,%esi
+	rorl	$7,%ebx
+	addl	%eax,%ebp
+	addl	48(%rsp),%edx
+	xorl	%ebx,%esi
+	movl	%ebp,%edi
+.byte	102,15,56,0,222
+	roll	$5,%ebp
+	addl	%esi,%edx
+	xorl	%ebx,%edi
+	rorl	$7,%eax
+	paddd	%xmm9,%xmm2
+	addl	%ebp,%edx
+	addl	52(%rsp),%ecx
+	xorl	%eax,%edi
+	movl	%edx,%esi
+	movdqa	%xmm2,32(%rsp)
+	roll	$5,%edx
+	addl	%edi,%ecx
+	xorl	%eax,%esi
+	rorl	$7,%ebp
+	psubd	%xmm9,%xmm2
+	addl	%edx,%ecx
+	addl	56(%rsp),%ebx
+	xorl	%ebp,%esi
+	movl	%ecx,%edi
+	roll	$5,%ecx
+	addl	%esi,%ebx
+	xorl	%ebp,%edi
+	rorl	$7,%edx
+	addl	%ecx,%ebx
+	addl	60(%rsp),%eax
+	xorl	%edx,%edi
+	movl	%ebx,%esi
+	roll	$5,%ebx
+	addl	%edi,%eax
+	rorl	$7,%ecx
+	addl	%ebx,%eax
+	addl	0(%r8),%eax
+	addl	4(%r8),%esi
+	addl	8(%r8),%ecx
+	addl	12(%r8),%edx
+	movl	%eax,0(%r8)
+	addl	16(%r8),%ebp
+	movl	%esi,4(%r8)
+	movl	%esi,%ebx
+	movl	%ecx,8(%r8)
+	movl	%ecx,%edi
+	movl	%edx,12(%r8)
+	xorl	%edx,%edi
+	movl	%ebp,16(%r8)
+	andl	%edi,%esi
+	jmp	.Loop_ssse3
+
+.align	16
+.Ldone_ssse3:
+	addl	16(%rsp),%ebx
+	xorl	%ebp,%esi
+	movl	%ecx,%edi
+	roll	$5,%ecx
+	addl	%esi,%ebx
+	xorl	%ebp,%edi
+	rorl	$7,%edx
+	addl	%ecx,%ebx
+	addl	20(%rsp),%eax
+	xorl	%edx,%edi
+	movl	%ebx,%esi
+	roll	$5,%ebx
+	addl	%edi,%eax
+	xorl	%edx,%esi
+	rorl	$7,%ecx
+	addl	%ebx,%eax
+	addl	24(%rsp),%ebp
+	xorl	%ecx,%esi
+	movl	%eax,%edi
+	roll	$5,%eax
+	addl	%esi,%ebp
+	xorl	%ecx,%edi
+	rorl	$7,%ebx
+	addl	%eax,%ebp
+	addl	28(%rsp),%edx
+	xorl	%ebx,%edi
+	movl	%ebp,%esi
+	roll	$5,%ebp
+	addl	%edi,%edx
+	xorl	%ebx,%esi
+	rorl	$7,%eax
+	addl	%ebp,%edx
+	addl	32(%rsp),%ecx
+	xorl	%eax,%esi
+	movl	%edx,%edi
+	roll	$5,%edx
+	addl	%esi,%ecx
+	xorl	%eax,%edi
+	rorl	$7,%ebp
+	addl	%edx,%ecx
+	addl	36(%rsp),%ebx
+	xorl	%ebp,%edi
+	movl	%ecx,%esi
+	roll	$5,%ecx
+	addl	%edi,%ebx
+	xorl	%ebp,%esi
+	rorl	$7,%edx
+	addl	%ecx,%ebx
+	addl	40(%rsp),%eax
+	xorl	%edx,%esi
+	movl	%ebx,%edi
+	roll	$5,%ebx
+	addl	%esi,%eax
+	xorl	%edx,%edi
+	rorl	$7,%ecx
+	addl	%ebx,%eax
+	addl	44(%rsp),%ebp
+	xorl	%ecx,%edi
+	movl	%eax,%esi
+	roll	$5,%eax
+	addl	%edi,%ebp
+	xorl	%ecx,%esi
+	rorl	$7,%ebx
+	addl	%eax,%ebp
+	addl	48(%rsp),%edx
+	xorl	%ebx,%esi
+	movl	%ebp,%edi
+	roll	$5,%ebp
+	addl	%esi,%edx
+	xorl	%ebx,%edi
+	rorl	$7,%eax
+	addl	%ebp,%edx
+	addl	52(%rsp),%ecx
+	xorl	%eax,%edi
+	movl	%edx,%esi
+	roll	$5,%edx
+	addl	%edi,%ecx
+	xorl	%eax,%esi
+	rorl	$7,%ebp
+	addl	%edx,%ecx
+	addl	56(%rsp),%ebx
+	xorl	%ebp,%esi
+	movl	%ecx,%edi
+	roll	$5,%ecx
+	addl	%esi,%ebx
+	xorl	%ebp,%edi
+	rorl	$7,%edx
+	addl	%ecx,%ebx
+	addl	60(%rsp),%eax
+	xorl	%edx,%edi
+	movl	%ebx,%esi
+	roll	$5,%ebx
+	addl	%edi,%eax
+	rorl	$7,%ecx
+	addl	%ebx,%eax
+	addl	0(%r8),%eax
+	addl	4(%r8),%esi
+	addl	8(%r8),%ecx
+	movl	%eax,0(%r8)
+	addl	12(%r8),%edx
+	movl	%esi,4(%r8)
+	addl	16(%r8),%ebp
+	movl	%ecx,8(%r8)
+	movl	%edx,12(%r8)
+	movl	%ebp,16(%r8)
+	leaq	(%r14),%rsi
+	movq	-40(%rsi),%r14
+	movq	-32(%rsi),%r13
+	movq	-24(%rsi),%r12
+	movq	-16(%rsi),%rbp
+	movq	-8(%rsi),%rbx
+	leaq	(%rsi),%rsp
+.Lepilogue_ssse3:
+	.byte	0xf3,0xc3
+.size	sha1_block_data_order_ssse3,.-sha1_block_data_order_ssse3
+.align	64
+K_XX_XX:
+.long	0x5a827999,0x5a827999,0x5a827999,0x5a827999
+.long	0x5a827999,0x5a827999,0x5a827999,0x5a827999
+.long	0x6ed9eba1,0x6ed9eba1,0x6ed9eba1,0x6ed9eba1
+.long	0x6ed9eba1,0x6ed9eba1,0x6ed9eba1,0x6ed9eba1
+.long	0x8f1bbcdc,0x8f1bbcdc,0x8f1bbcdc,0x8f1bbcdc
+.long	0x8f1bbcdc,0x8f1bbcdc,0x8f1bbcdc,0x8f1bbcdc
+.long	0xca62c1d6,0xca62c1d6,0xca62c1d6,0xca62c1d6
+.long	0xca62c1d6,0xca62c1d6,0xca62c1d6,0xca62c1d6
+.long	0x00010203,0x04050607,0x08090a0b,0x0c0d0e0f
+.long	0x00010203,0x04050607,0x08090a0b,0x0c0d0e0f
+.byte	0xf,0xe,0xd,0xc,0xb,0xa,0x9,0x8,0x7,0x6,0x5,0x4,0x3,0x2,0x1,0x0
+.byte	83,72,65,49,32,98,108,111,99,107,32,116,114,97,110,115,102,111,114,109,32,102,111,114,32,120,56,54,95,54,52,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0
+.align	64
+#endif
diff --git a/third_party/boringssl/linux-x86_64/crypto/sha/sha256-x86_64.S b/third_party/boringssl/linux-x86_64/crypto/sha/sha256-x86_64.S
new file mode 100644
index 0000000..f526de5
--- /dev/null
+++ b/third_party/boringssl/linux-x86_64/crypto/sha/sha256-x86_64.S
@@ -0,0 +1,2844 @@
+#if defined(__x86_64__)
+.text	
+
+.extern	OPENSSL_ia32cap_P
+.hidden OPENSSL_ia32cap_P
+.globl	sha256_block_data_order
+.hidden sha256_block_data_order
+.type	sha256_block_data_order,@function
+.align	16
+sha256_block_data_order:
+	leaq	OPENSSL_ia32cap_P(%rip),%r11
+	movl	0(%r11),%r9d
+	movl	4(%r11),%r10d
+	movl	8(%r11),%r11d
+	testl	$512,%r10d
+	jnz	.Lssse3_shortcut
+	pushq	%rbx
+	pushq	%rbp
+	pushq	%r12
+	pushq	%r13
+	pushq	%r14
+	pushq	%r15
+	movq	%rsp,%r11
+	shlq	$4,%rdx
+	subq	$64+32,%rsp
+	leaq	(%rsi,%rdx,4),%rdx
+	andq	$-64,%rsp
+	movq	%rdi,64+0(%rsp)
+	movq	%rsi,64+8(%rsp)
+	movq	%rdx,64+16(%rsp)
+	movq	%r11,64+24(%rsp)
+.Lprologue:
+
+	movl	0(%rdi),%eax
+	movl	4(%rdi),%ebx
+	movl	8(%rdi),%ecx
+	movl	12(%rdi),%edx
+	movl	16(%rdi),%r8d
+	movl	20(%rdi),%r9d
+	movl	24(%rdi),%r10d
+	movl	28(%rdi),%r11d
+	jmp	.Lloop
+
+.align	16
+.Lloop:
+	movl	%ebx,%edi
+	leaq	K256(%rip),%rbp
+	xorl	%ecx,%edi
+	movl	0(%rsi),%r12d
+	movl	%r8d,%r13d
+	movl	%eax,%r14d
+	bswapl	%r12d
+	rorl	$14,%r13d
+	movl	%r9d,%r15d
+
+	xorl	%r8d,%r13d
+	rorl	$9,%r14d
+	xorl	%r10d,%r15d
+
+	movl	%r12d,0(%rsp)
+	xorl	%eax,%r14d
+	andl	%r8d,%r15d
+
+	rorl	$5,%r13d
+	addl	%r11d,%r12d
+	xorl	%r10d,%r15d
+
+	rorl	$11,%r14d
+	xorl	%r8d,%r13d
+	addl	%r15d,%r12d
+
+	movl	%eax,%r15d
+	addl	(%rbp),%r12d
+	xorl	%eax,%r14d
+
+	xorl	%ebx,%r15d
+	rorl	$6,%r13d
+	movl	%ebx,%r11d
+
+	andl	%r15d,%edi
+	rorl	$2,%r14d
+	addl	%r13d,%r12d
+
+	xorl	%edi,%r11d
+	addl	%r12d,%edx
+	addl	%r12d,%r11d
+
+	leaq	4(%rbp),%rbp
+	addl	%r14d,%r11d
+	movl	4(%rsi),%r12d
+	movl	%edx,%r13d
+	movl	%r11d,%r14d
+	bswapl	%r12d
+	rorl	$14,%r13d
+	movl	%r8d,%edi
+
+	xorl	%edx,%r13d
+	rorl	$9,%r14d
+	xorl	%r9d,%edi
+
+	movl	%r12d,4(%rsp)
+	xorl	%r11d,%r14d
+	andl	%edx,%edi
+
+	rorl	$5,%r13d
+	addl	%r10d,%r12d
+	xorl	%r9d,%edi
+
+	rorl	$11,%r14d
+	xorl	%edx,%r13d
+	addl	%edi,%r12d
+
+	movl	%r11d,%edi
+	addl	(%rbp),%r12d
+	xorl	%r11d,%r14d
+
+	xorl	%eax,%edi
+	rorl	$6,%r13d
+	movl	%eax,%r10d
+
+	andl	%edi,%r15d
+	rorl	$2,%r14d
+	addl	%r13d,%r12d
+
+	xorl	%r15d,%r10d
+	addl	%r12d,%ecx
+	addl	%r12d,%r10d
+
+	leaq	4(%rbp),%rbp
+	addl	%r14d,%r10d
+	movl	8(%rsi),%r12d
+	movl	%ecx,%r13d
+	movl	%r10d,%r14d
+	bswapl	%r12d
+	rorl	$14,%r13d
+	movl	%edx,%r15d
+
+	xorl	%ecx,%r13d
+	rorl	$9,%r14d
+	xorl	%r8d,%r15d
+
+	movl	%r12d,8(%rsp)
+	xorl	%r10d,%r14d
+	andl	%ecx,%r15d
+
+	rorl	$5,%r13d
+	addl	%r9d,%r12d
+	xorl	%r8d,%r15d
+
+	rorl	$11,%r14d
+	xorl	%ecx,%r13d
+	addl	%r15d,%r12d
+
+	movl	%r10d,%r15d
+	addl	(%rbp),%r12d
+	xorl	%r10d,%r14d
+
+	xorl	%r11d,%r15d
+	rorl	$6,%r13d
+	movl	%r11d,%r9d
+
+	andl	%r15d,%edi
+	rorl	$2,%r14d
+	addl	%r13d,%r12d
+
+	xorl	%edi,%r9d
+	addl	%r12d,%ebx
+	addl	%r12d,%r9d
+
+	leaq	4(%rbp),%rbp
+	addl	%r14d,%r9d
+	movl	12(%rsi),%r12d
+	movl	%ebx,%r13d
+	movl	%r9d,%r14d
+	bswapl	%r12d
+	rorl	$14,%r13d
+	movl	%ecx,%edi
+
+	xorl	%ebx,%r13d
+	rorl	$9,%r14d
+	xorl	%edx,%edi
+
+	movl	%r12d,12(%rsp)
+	xorl	%r9d,%r14d
+	andl	%ebx,%edi
+
+	rorl	$5,%r13d
+	addl	%r8d,%r12d
+	xorl	%edx,%edi
+
+	rorl	$11,%r14d
+	xorl	%ebx,%r13d
+	addl	%edi,%r12d
+
+	movl	%r9d,%edi
+	addl	(%rbp),%r12d
+	xorl	%r9d,%r14d
+
+	xorl	%r10d,%edi
+	rorl	$6,%r13d
+	movl	%r10d,%r8d
+
+	andl	%edi,%r15d
+	rorl	$2,%r14d
+	addl	%r13d,%r12d
+
+	xorl	%r15d,%r8d
+	addl	%r12d,%eax
+	addl	%r12d,%r8d
+
+	leaq	20(%rbp),%rbp
+	addl	%r14d,%r8d
+	movl	16(%rsi),%r12d
+	movl	%eax,%r13d
+	movl	%r8d,%r14d
+	bswapl	%r12d
+	rorl	$14,%r13d
+	movl	%ebx,%r15d
+
+	xorl	%eax,%r13d
+	rorl	$9,%r14d
+	xorl	%ecx,%r15d
+
+	movl	%r12d,16(%rsp)
+	xorl	%r8d,%r14d
+	andl	%eax,%r15d
+
+	rorl	$5,%r13d
+	addl	%edx,%r12d
+	xorl	%ecx,%r15d
+
+	rorl	$11,%r14d
+	xorl	%eax,%r13d
+	addl	%r15d,%r12d
+
+	movl	%r8d,%r15d
+	addl	(%rbp),%r12d
+	xorl	%r8d,%r14d
+
+	xorl	%r9d,%r15d
+	rorl	$6,%r13d
+	movl	%r9d,%edx
+
+	andl	%r15d,%edi
+	rorl	$2,%r14d
+	addl	%r13d,%r12d
+
+	xorl	%edi,%edx
+	addl	%r12d,%r11d
+	addl	%r12d,%edx
+
+	leaq	4(%rbp),%rbp
+	addl	%r14d,%edx
+	movl	20(%rsi),%r12d
+	movl	%r11d,%r13d
+	movl	%edx,%r14d
+	bswapl	%r12d
+	rorl	$14,%r13d
+	movl	%eax,%edi
+
+	xorl	%r11d,%r13d
+	rorl	$9,%r14d
+	xorl	%ebx,%edi
+
+	movl	%r12d,20(%rsp)
+	xorl	%edx,%r14d
+	andl	%r11d,%edi
+
+	rorl	$5,%r13d
+	addl	%ecx,%r12d
+	xorl	%ebx,%edi
+
+	rorl	$11,%r14d
+	xorl	%r11d,%r13d
+	addl	%edi,%r12d
+
+	movl	%edx,%edi
+	addl	(%rbp),%r12d
+	xorl	%edx,%r14d
+
+	xorl	%r8d,%edi
+	rorl	$6,%r13d
+	movl	%r8d,%ecx
+
+	andl	%edi,%r15d
+	rorl	$2,%r14d
+	addl	%r13d,%r12d
+
+	xorl	%r15d,%ecx
+	addl	%r12d,%r10d
+	addl	%r12d,%ecx
+
+	leaq	4(%rbp),%rbp
+	addl	%r14d,%ecx
+	movl	24(%rsi),%r12d
+	movl	%r10d,%r13d
+	movl	%ecx,%r14d
+	bswapl	%r12d
+	rorl	$14,%r13d
+	movl	%r11d,%r15d
+
+	xorl	%r10d,%r13d
+	rorl	$9,%r14d
+	xorl	%eax,%r15d
+
+	movl	%r12d,24(%rsp)
+	xorl	%ecx,%r14d
+	andl	%r10d,%r15d
+
+	rorl	$5,%r13d
+	addl	%ebx,%r12d
+	xorl	%eax,%r15d
+
+	rorl	$11,%r14d
+	xorl	%r10d,%r13d
+	addl	%r15d,%r12d
+
+	movl	%ecx,%r15d
+	addl	(%rbp),%r12d
+	xorl	%ecx,%r14d
+
+	xorl	%edx,%r15d
+	rorl	$6,%r13d
+	movl	%edx,%ebx
+
+	andl	%r15d,%edi
+	rorl	$2,%r14d
+	addl	%r13d,%r12d
+
+	xorl	%edi,%ebx
+	addl	%r12d,%r9d
+	addl	%r12d,%ebx
+
+	leaq	4(%rbp),%rbp
+	addl	%r14d,%ebx
+	movl	28(%rsi),%r12d
+	movl	%r9d,%r13d
+	movl	%ebx,%r14d
+	bswapl	%r12d
+	rorl	$14,%r13d
+	movl	%r10d,%edi
+
+	xorl	%r9d,%r13d
+	rorl	$9,%r14d
+	xorl	%r11d,%edi
+
+	movl	%r12d,28(%rsp)
+	xorl	%ebx,%r14d
+	andl	%r9d,%edi
+
+	rorl	$5,%r13d
+	addl	%eax,%r12d
+	xorl	%r11d,%edi
+
+	rorl	$11,%r14d
+	xorl	%r9d,%r13d
+	addl	%edi,%r12d
+
+	movl	%ebx,%edi
+	addl	(%rbp),%r12d
+	xorl	%ebx,%r14d
+
+	xorl	%ecx,%edi
+	rorl	$6,%r13d
+	movl	%ecx,%eax
+
+	andl	%edi,%r15d
+	rorl	$2,%r14d
+	addl	%r13d,%r12d
+
+	xorl	%r15d,%eax
+	addl	%r12d,%r8d
+	addl	%r12d,%eax
+
+	leaq	20(%rbp),%rbp
+	addl	%r14d,%eax
+	movl	32(%rsi),%r12d
+	movl	%r8d,%r13d
+	movl	%eax,%r14d
+	bswapl	%r12d
+	rorl	$14,%r13d
+	movl	%r9d,%r15d
+
+	xorl	%r8d,%r13d
+	rorl	$9,%r14d
+	xorl	%r10d,%r15d
+
+	movl	%r12d,32(%rsp)
+	xorl	%eax,%r14d
+	andl	%r8d,%r15d
+
+	rorl	$5,%r13d
+	addl	%r11d,%r12d
+	xorl	%r10d,%r15d
+
+	rorl	$11,%r14d
+	xorl	%r8d,%r13d
+	addl	%r15d,%r12d
+
+	movl	%eax,%r15d
+	addl	(%rbp),%r12d
+	xorl	%eax,%r14d
+
+	xorl	%ebx,%r15d
+	rorl	$6,%r13d
+	movl	%ebx,%r11d
+
+	andl	%r15d,%edi
+	rorl	$2,%r14d
+	addl	%r13d,%r12d
+
+	xorl	%edi,%r11d
+	addl	%r12d,%edx
+	addl	%r12d,%r11d
+
+	leaq	4(%rbp),%rbp
+	addl	%r14d,%r11d
+	movl	36(%rsi),%r12d
+	movl	%edx,%r13d
+	movl	%r11d,%r14d
+	bswapl	%r12d
+	rorl	$14,%r13d
+	movl	%r8d,%edi
+
+	xorl	%edx,%r13d
+	rorl	$9,%r14d
+	xorl	%r9d,%edi
+
+	movl	%r12d,36(%rsp)
+	xorl	%r11d,%r14d
+	andl	%edx,%edi
+
+	rorl	$5,%r13d
+	addl	%r10d,%r12d
+	xorl	%r9d,%edi
+
+	rorl	$11,%r14d
+	xorl	%edx,%r13d
+	addl	%edi,%r12d
+
+	movl	%r11d,%edi
+	addl	(%rbp),%r12d
+	xorl	%r11d,%r14d
+
+	xorl	%eax,%edi
+	rorl	$6,%r13d
+	movl	%eax,%r10d
+
+	andl	%edi,%r15d
+	rorl	$2,%r14d
+	addl	%r13d,%r12d
+
+	xorl	%r15d,%r10d
+	addl	%r12d,%ecx
+	addl	%r12d,%r10d
+
+	leaq	4(%rbp),%rbp
+	addl	%r14d,%r10d
+	movl	40(%rsi),%r12d
+	movl	%ecx,%r13d
+	movl	%r10d,%r14d
+	bswapl	%r12d
+	rorl	$14,%r13d
+	movl	%edx,%r15d
+
+	xorl	%ecx,%r13d
+	rorl	$9,%r14d
+	xorl	%r8d,%r15d
+
+	movl	%r12d,40(%rsp)
+	xorl	%r10d,%r14d
+	andl	%ecx,%r15d
+
+	rorl	$5,%r13d
+	addl	%r9d,%r12d
+	xorl	%r8d,%r15d
+
+	rorl	$11,%r14d
+	xorl	%ecx,%r13d
+	addl	%r15d,%r12d
+
+	movl	%r10d,%r15d
+	addl	(%rbp),%r12d
+	xorl	%r10d,%r14d
+
+	xorl	%r11d,%r15d
+	rorl	$6,%r13d
+	movl	%r11d,%r9d
+
+	andl	%r15d,%edi
+	rorl	$2,%r14d
+	addl	%r13d,%r12d
+
+	xorl	%edi,%r9d
+	addl	%r12d,%ebx
+	addl	%r12d,%r9d
+
+	leaq	4(%rbp),%rbp
+	addl	%r14d,%r9d
+	movl	44(%rsi),%r12d
+	movl	%ebx,%r13d
+	movl	%r9d,%r14d
+	bswapl	%r12d
+	rorl	$14,%r13d
+	movl	%ecx,%edi
+
+	xorl	%ebx,%r13d
+	rorl	$9,%r14d
+	xorl	%edx,%edi
+
+	movl	%r12d,44(%rsp)
+	xorl	%r9d,%r14d
+	andl	%ebx,%edi
+
+	rorl	$5,%r13d
+	addl	%r8d,%r12d
+	xorl	%edx,%edi
+
+	rorl	$11,%r14d
+	xorl	%ebx,%r13d
+	addl	%edi,%r12d
+
+	movl	%r9d,%edi
+	addl	(%rbp),%r12d
+	xorl	%r9d,%r14d
+
+	xorl	%r10d,%edi
+	rorl	$6,%r13d
+	movl	%r10d,%r8d
+
+	andl	%edi,%r15d
+	rorl	$2,%r14d
+	addl	%r13d,%r12d
+
+	xorl	%r15d,%r8d
+	addl	%r12d,%eax
+	addl	%r12d,%r8d
+
+	leaq	20(%rbp),%rbp
+	addl	%r14d,%r8d
+	movl	48(%rsi),%r12d
+	movl	%eax,%r13d
+	movl	%r8d,%r14d
+	bswapl	%r12d
+	rorl	$14,%r13d
+	movl	%ebx,%r15d
+
+	xorl	%eax,%r13d
+	rorl	$9,%r14d
+	xorl	%ecx,%r15d
+
+	movl	%r12d,48(%rsp)
+	xorl	%r8d,%r14d
+	andl	%eax,%r15d
+
+	rorl	$5,%r13d
+	addl	%edx,%r12d
+	xorl	%ecx,%r15d
+
+	rorl	$11,%r14d
+	xorl	%eax,%r13d
+	addl	%r15d,%r12d
+
+	movl	%r8d,%r15d
+	addl	(%rbp),%r12d
+	xorl	%r8d,%r14d
+
+	xorl	%r9d,%r15d
+	rorl	$6,%r13d
+	movl	%r9d,%edx
+
+	andl	%r15d,%edi
+	rorl	$2,%r14d
+	addl	%r13d,%r12d
+
+	xorl	%edi,%edx
+	addl	%r12d,%r11d
+	addl	%r12d,%edx
+
+	leaq	4(%rbp),%rbp
+	addl	%r14d,%edx
+	movl	52(%rsi),%r12d
+	movl	%r11d,%r13d
+	movl	%edx,%r14d
+	bswapl	%r12d
+	rorl	$14,%r13d
+	movl	%eax,%edi
+
+	xorl	%r11d,%r13d
+	rorl	$9,%r14d
+	xorl	%ebx,%edi
+
+	movl	%r12d,52(%rsp)
+	xorl	%edx,%r14d
+	andl	%r11d,%edi
+
+	rorl	$5,%r13d
+	addl	%ecx,%r12d
+	xorl	%ebx,%edi
+
+	rorl	$11,%r14d
+	xorl	%r11d,%r13d
+	addl	%edi,%r12d
+
+	movl	%edx,%edi
+	addl	(%rbp),%r12d
+	xorl	%edx,%r14d
+
+	xorl	%r8d,%edi
+	rorl	$6,%r13d
+	movl	%r8d,%ecx
+
+	andl	%edi,%r15d
+	rorl	$2,%r14d
+	addl	%r13d,%r12d
+
+	xorl	%r15d,%ecx
+	addl	%r12d,%r10d
+	addl	%r12d,%ecx
+
+	leaq	4(%rbp),%rbp
+	addl	%r14d,%ecx
+	movl	56(%rsi),%r12d
+	movl	%r10d,%r13d
+	movl	%ecx,%r14d
+	bswapl	%r12d
+	rorl	$14,%r13d
+	movl	%r11d,%r15d
+
+	xorl	%r10d,%r13d
+	rorl	$9,%r14d
+	xorl	%eax,%r15d
+
+	movl	%r12d,56(%rsp)
+	xorl	%ecx,%r14d
+	andl	%r10d,%r15d
+
+	rorl	$5,%r13d
+	addl	%ebx,%r12d
+	xorl	%eax,%r15d
+
+	rorl	$11,%r14d
+	xorl	%r10d,%r13d
+	addl	%r15d,%r12d
+
+	movl	%ecx,%r15d
+	addl	(%rbp),%r12d
+	xorl	%ecx,%r14d
+
+	xorl	%edx,%r15d
+	rorl	$6,%r13d
+	movl	%edx,%ebx
+
+	andl	%r15d,%edi
+	rorl	$2,%r14d
+	addl	%r13d,%r12d
+
+	xorl	%edi,%ebx
+	addl	%r12d,%r9d
+	addl	%r12d,%ebx
+
+	leaq	4(%rbp),%rbp
+	addl	%r14d,%ebx
+	movl	60(%rsi),%r12d
+	movl	%r9d,%r13d
+	movl	%ebx,%r14d
+	bswapl	%r12d
+	rorl	$14,%r13d
+	movl	%r10d,%edi
+
+	xorl	%r9d,%r13d
+	rorl	$9,%r14d
+	xorl	%r11d,%edi
+
+	movl	%r12d,60(%rsp)
+	xorl	%ebx,%r14d
+	andl	%r9d,%edi
+
+	rorl	$5,%r13d
+	addl	%eax,%r12d
+	xorl	%r11d,%edi
+
+	rorl	$11,%r14d
+	xorl	%r9d,%r13d
+	addl	%edi,%r12d
+
+	movl	%ebx,%edi
+	addl	(%rbp),%r12d
+	xorl	%ebx,%r14d
+
+	xorl	%ecx,%edi
+	rorl	$6,%r13d
+	movl	%ecx,%eax
+
+	andl	%edi,%r15d
+	rorl	$2,%r14d
+	addl	%r13d,%r12d
+
+	xorl	%r15d,%eax
+	addl	%r12d,%r8d
+	addl	%r12d,%eax
+
+	leaq	20(%rbp),%rbp
+	jmp	.Lrounds_16_xx
+.align	16
+.Lrounds_16_xx:
+	movl	4(%rsp),%r13d
+	movl	56(%rsp),%r15d
+
+	movl	%r13d,%r12d
+	rorl	$11,%r13d
+	addl	%r14d,%eax
+	movl	%r15d,%r14d
+	rorl	$2,%r15d
+
+	xorl	%r12d,%r13d
+	shrl	$3,%r12d
+	rorl	$7,%r13d
+	xorl	%r14d,%r15d
+	shrl	$10,%r14d
+
+	rorl	$17,%r15d
+	xorl	%r13d,%r12d
+	xorl	%r14d,%r15d
+	addl	36(%rsp),%r12d
+
+	addl	0(%rsp),%r12d
+	movl	%r8d,%r13d
+	addl	%r15d,%r12d
+	movl	%eax,%r14d
+	rorl	$14,%r13d
+	movl	%r9d,%r15d
+
+	xorl	%r8d,%r13d
+	rorl	$9,%r14d
+	xorl	%r10d,%r15d
+
+	movl	%r12d,0(%rsp)
+	xorl	%eax,%r14d
+	andl	%r8d,%r15d
+
+	rorl	$5,%r13d
+	addl	%r11d,%r12d
+	xorl	%r10d,%r15d
+
+	rorl	$11,%r14d
+	xorl	%r8d,%r13d
+	addl	%r15d,%r12d
+
+	movl	%eax,%r15d
+	addl	(%rbp),%r12d
+	xorl	%eax,%r14d
+
+	xorl	%ebx,%r15d
+	rorl	$6,%r13d
+	movl	%ebx,%r11d
+
+	andl	%r15d,%edi
+	rorl	$2,%r14d
+	addl	%r13d,%r12d
+
+	xorl	%edi,%r11d
+	addl	%r12d,%edx
+	addl	%r12d,%r11d
+
+	leaq	4(%rbp),%rbp
+	movl	8(%rsp),%r13d
+	movl	60(%rsp),%edi
+
+	movl	%r13d,%r12d
+	rorl	$11,%r13d
+	addl	%r14d,%r11d
+	movl	%edi,%r14d
+	rorl	$2,%edi
+
+	xorl	%r12d,%r13d
+	shrl	$3,%r12d
+	rorl	$7,%r13d
+	xorl	%r14d,%edi
+	shrl	$10,%r14d
+
+	rorl	$17,%edi
+	xorl	%r13d,%r12d
+	xorl	%r14d,%edi
+	addl	40(%rsp),%r12d
+
+	addl	4(%rsp),%r12d
+	movl	%edx,%r13d
+	addl	%edi,%r12d
+	movl	%r11d,%r14d
+	rorl	$14,%r13d
+	movl	%r8d,%edi
+
+	xorl	%edx,%r13d
+	rorl	$9,%r14d
+	xorl	%r9d,%edi
+
+	movl	%r12d,4(%rsp)
+	xorl	%r11d,%r14d
+	andl	%edx,%edi
+
+	rorl	$5,%r13d
+	addl	%r10d,%r12d
+	xorl	%r9d,%edi
+
+	rorl	$11,%r14d
+	xorl	%edx,%r13d
+	addl	%edi,%r12d
+
+	movl	%r11d,%edi
+	addl	(%rbp),%r12d
+	xorl	%r11d,%r14d
+
+	xorl	%eax,%edi
+	rorl	$6,%r13d
+	movl	%eax,%r10d
+
+	andl	%edi,%r15d
+	rorl	$2,%r14d
+	addl	%r13d,%r12d
+
+	xorl	%r15d,%r10d
+	addl	%r12d,%ecx
+	addl	%r12d,%r10d
+
+	leaq	4(%rbp),%rbp
+	movl	12(%rsp),%r13d
+	movl	0(%rsp),%r15d
+
+	movl	%r13d,%r12d
+	rorl	$11,%r13d
+	addl	%r14d,%r10d
+	movl	%r15d,%r14d
+	rorl	$2,%r15d
+
+	xorl	%r12d,%r13d
+	shrl	$3,%r12d
+	rorl	$7,%r13d
+	xorl	%r14d,%r15d
+	shrl	$10,%r14d
+
+	rorl	$17,%r15d
+	xorl	%r13d,%r12d
+	xorl	%r14d,%r15d
+	addl	44(%rsp),%r12d
+
+	addl	8(%rsp),%r12d
+	movl	%ecx,%r13d
+	addl	%r15d,%r12d
+	movl	%r10d,%r14d
+	rorl	$14,%r13d
+	movl	%edx,%r15d
+
+	xorl	%ecx,%r13d
+	rorl	$9,%r14d
+	xorl	%r8d,%r15d
+
+	movl	%r12d,8(%rsp)
+	xorl	%r10d,%r14d
+	andl	%ecx,%r15d
+
+	rorl	$5,%r13d
+	addl	%r9d,%r12d
+	xorl	%r8d,%r15d
+
+	rorl	$11,%r14d
+	xorl	%ecx,%r13d
+	addl	%r15d,%r12d
+
+	movl	%r10d,%r15d
+	addl	(%rbp),%r12d
+	xorl	%r10d,%r14d
+
+	xorl	%r11d,%r15d
+	rorl	$6,%r13d
+	movl	%r11d,%r9d
+
+	andl	%r15d,%edi
+	rorl	$2,%r14d
+	addl	%r13d,%r12d
+
+	xorl	%edi,%r9d
+	addl	%r12d,%ebx
+	addl	%r12d,%r9d
+
+	leaq	4(%rbp),%rbp
+	movl	16(%rsp),%r13d
+	movl	4(%rsp),%edi
+
+	movl	%r13d,%r12d
+	rorl	$11,%r13d
+	addl	%r14d,%r9d
+	movl	%edi,%r14d
+	rorl	$2,%edi
+
+	xorl	%r12d,%r13d
+	shrl	$3,%r12d
+	rorl	$7,%r13d
+	xorl	%r14d,%edi
+	shrl	$10,%r14d
+
+	rorl	$17,%edi
+	xorl	%r13d,%r12d
+	xorl	%r14d,%edi
+	addl	48(%rsp),%r12d
+
+	addl	12(%rsp),%r12d
+	movl	%ebx,%r13d
+	addl	%edi,%r12d
+	movl	%r9d,%r14d
+	rorl	$14,%r13d
+	movl	%ecx,%edi
+
+	xorl	%ebx,%r13d
+	rorl	$9,%r14d
+	xorl	%edx,%edi
+
+	movl	%r12d,12(%rsp)
+	xorl	%r9d,%r14d
+	andl	%ebx,%edi
+
+	rorl	$5,%r13d
+	addl	%r8d,%r12d
+	xorl	%edx,%edi
+
+	rorl	$11,%r14d
+	xorl	%ebx,%r13d
+	addl	%edi,%r12d
+
+	movl	%r9d,%edi
+	addl	(%rbp),%r12d
+	xorl	%r9d,%r14d
+
+	xorl	%r10d,%edi
+	rorl	$6,%r13d
+	movl	%r10d,%r8d
+
+	andl	%edi,%r15d
+	rorl	$2,%r14d
+	addl	%r13d,%r12d
+
+	xorl	%r15d,%r8d
+	addl	%r12d,%eax
+	addl	%r12d,%r8d
+
+	leaq	20(%rbp),%rbp
+	movl	20(%rsp),%r13d
+	movl	8(%rsp),%r15d
+
+	movl	%r13d,%r12d
+	rorl	$11,%r13d
+	addl	%r14d,%r8d
+	movl	%r15d,%r14d
+	rorl	$2,%r15d
+
+	xorl	%r12d,%r13d
+	shrl	$3,%r12d
+	rorl	$7,%r13d
+	xorl	%r14d,%r15d
+	shrl	$10,%r14d
+
+	rorl	$17,%r15d
+	xorl	%r13d,%r12d
+	xorl	%r14d,%r15d
+	addl	52(%rsp),%r12d
+
+	addl	16(%rsp),%r12d
+	movl	%eax,%r13d
+	addl	%r15d,%r12d
+	movl	%r8d,%r14d
+	rorl	$14,%r13d
+	movl	%ebx,%r15d
+
+	xorl	%eax,%r13d
+	rorl	$9,%r14d
+	xorl	%ecx,%r15d
+
+	movl	%r12d,16(%rsp)
+	xorl	%r8d,%r14d
+	andl	%eax,%r15d
+
+	rorl	$5,%r13d
+	addl	%edx,%r12d
+	xorl	%ecx,%r15d
+
+	rorl	$11,%r14d
+	xorl	%eax,%r13d
+	addl	%r15d,%r12d
+
+	movl	%r8d,%r15d
+	addl	(%rbp),%r12d
+	xorl	%r8d,%r14d
+
+	xorl	%r9d,%r15d
+	rorl	$6,%r13d
+	movl	%r9d,%edx
+
+	andl	%r15d,%edi
+	rorl	$2,%r14d
+	addl	%r13d,%r12d
+
+	xorl	%edi,%edx
+	addl	%r12d,%r11d
+	addl	%r12d,%edx
+
+	leaq	4(%rbp),%rbp
+	movl	24(%rsp),%r13d
+	movl	12(%rsp),%edi
+
+	movl	%r13d,%r12d
+	rorl	$11,%r13d
+	addl	%r14d,%edx
+	movl	%edi,%r14d
+	rorl	$2,%edi
+
+	xorl	%r12d,%r13d
+	shrl	$3,%r12d
+	rorl	$7,%r13d
+	xorl	%r14d,%edi
+	shrl	$10,%r14d
+
+	rorl	$17,%edi
+	xorl	%r13d,%r12d
+	xorl	%r14d,%edi
+	addl	56(%rsp),%r12d
+
+	addl	20(%rsp),%r12d
+	movl	%r11d,%r13d
+	addl	%edi,%r12d
+	movl	%edx,%r14d
+	rorl	$14,%r13d
+	movl	%eax,%edi
+
+	xorl	%r11d,%r13d
+	rorl	$9,%r14d
+	xorl	%ebx,%edi
+
+	movl	%r12d,20(%rsp)
+	xorl	%edx,%r14d
+	andl	%r11d,%edi
+
+	rorl	$5,%r13d
+	addl	%ecx,%r12d
+	xorl	%ebx,%edi
+
+	rorl	$11,%r14d
+	xorl	%r11d,%r13d
+	addl	%edi,%r12d
+
+	movl	%edx,%edi
+	addl	(%rbp),%r12d
+	xorl	%edx,%r14d
+
+	xorl	%r8d,%edi
+	rorl	$6,%r13d
+	movl	%r8d,%ecx
+
+	andl	%edi,%r15d
+	rorl	$2,%r14d
+	addl	%r13d,%r12d
+
+	xorl	%r15d,%ecx
+	addl	%r12d,%r10d
+	addl	%r12d,%ecx
+
+	leaq	4(%rbp),%rbp
+	movl	28(%rsp),%r13d
+	movl	16(%rsp),%r15d
+
+	movl	%r13d,%r12d
+	rorl	$11,%r13d
+	addl	%r14d,%ecx
+	movl	%r15d,%r14d
+	rorl	$2,%r15d
+
+	xorl	%r12d,%r13d
+	shrl	$3,%r12d
+	rorl	$7,%r13d
+	xorl	%r14d,%r15d
+	shrl	$10,%r14d
+
+	rorl	$17,%r15d
+	xorl	%r13d,%r12d
+	xorl	%r14d,%r15d
+	addl	60(%rsp),%r12d
+
+	addl	24(%rsp),%r12d
+	movl	%r10d,%r13d
+	addl	%r15d,%r12d
+	movl	%ecx,%r14d
+	rorl	$14,%r13d
+	movl	%r11d,%r15d
+
+	xorl	%r10d,%r13d
+	rorl	$9,%r14d
+	xorl	%eax,%r15d
+
+	movl	%r12d,24(%rsp)
+	xorl	%ecx,%r14d
+	andl	%r10d,%r15d
+
+	rorl	$5,%r13d
+	addl	%ebx,%r12d
+	xorl	%eax,%r15d
+
+	rorl	$11,%r14d
+	xorl	%r10d,%r13d
+	addl	%r15d,%r12d
+
+	movl	%ecx,%r15d
+	addl	(%rbp),%r12d
+	xorl	%ecx,%r14d
+
+	xorl	%edx,%r15d
+	rorl	$6,%r13d
+	movl	%edx,%ebx
+
+	andl	%r15d,%edi
+	rorl	$2,%r14d
+	addl	%r13d,%r12d
+
+	xorl	%edi,%ebx
+	addl	%r12d,%r9d
+	addl	%r12d,%ebx
+
+	leaq	4(%rbp),%rbp
+	movl	32(%rsp),%r13d
+	movl	20(%rsp),%edi
+
+	movl	%r13d,%r12d
+	rorl	$11,%r13d
+	addl	%r14d,%ebx
+	movl	%edi,%r14d
+	rorl	$2,%edi
+
+	xorl	%r12d,%r13d
+	shrl	$3,%r12d
+	rorl	$7,%r13d
+	xorl	%r14d,%edi
+	shrl	$10,%r14d
+
+	rorl	$17,%edi
+	xorl	%r13d,%r12d
+	xorl	%r14d,%edi
+	addl	0(%rsp),%r12d
+
+	addl	28(%rsp),%r12d
+	movl	%r9d,%r13d
+	addl	%edi,%r12d
+	movl	%ebx,%r14d
+	rorl	$14,%r13d
+	movl	%r10d,%edi
+
+	xorl	%r9d,%r13d
+	rorl	$9,%r14d
+	xorl	%r11d,%edi
+
+	movl	%r12d,28(%rsp)
+	xorl	%ebx,%r14d
+	andl	%r9d,%edi
+
+	rorl	$5,%r13d
+	addl	%eax,%r12d
+	xorl	%r11d,%edi
+
+	rorl	$11,%r14d
+	xorl	%r9d,%r13d
+	addl	%edi,%r12d
+
+	movl	%ebx,%edi
+	addl	(%rbp),%r12d
+	xorl	%ebx,%r14d
+
+	xorl	%ecx,%edi
+	rorl	$6,%r13d
+	movl	%ecx,%eax
+
+	andl	%edi,%r15d
+	rorl	$2,%r14d
+	addl	%r13d,%r12d
+
+	xorl	%r15d,%eax
+	addl	%r12d,%r8d
+	addl	%r12d,%eax
+
+	leaq	20(%rbp),%rbp
+	movl	36(%rsp),%r13d
+	movl	24(%rsp),%r15d
+
+	movl	%r13d,%r12d
+	rorl	$11,%r13d
+	addl	%r14d,%eax
+	movl	%r15d,%r14d
+	rorl	$2,%r15d
+
+	xorl	%r12d,%r13d
+	shrl	$3,%r12d
+	rorl	$7,%r13d
+	xorl	%r14d,%r15d
+	shrl	$10,%r14d
+
+	rorl	$17,%r15d
+	xorl	%r13d,%r12d
+	xorl	%r14d,%r15d
+	addl	4(%rsp),%r12d
+
+	addl	32(%rsp),%r12d
+	movl	%r8d,%r13d
+	addl	%r15d,%r12d
+	movl	%eax,%r14d
+	rorl	$14,%r13d
+	movl	%r9d,%r15d
+
+	xorl	%r8d,%r13d
+	rorl	$9,%r14d
+	xorl	%r10d,%r15d
+
+	movl	%r12d,32(%rsp)
+	xorl	%eax,%r14d
+	andl	%r8d,%r15d
+
+	rorl	$5,%r13d
+	addl	%r11d,%r12d
+	xorl	%r10d,%r15d
+
+	rorl	$11,%r14d
+	xorl	%r8d,%r13d
+	addl	%r15d,%r12d
+
+	movl	%eax,%r15d
+	addl	(%rbp),%r12d
+	xorl	%eax,%r14d
+
+	xorl	%ebx,%r15d
+	rorl	$6,%r13d
+	movl	%ebx,%r11d
+
+	andl	%r15d,%edi
+	rorl	$2,%r14d
+	addl	%r13d,%r12d
+
+	xorl	%edi,%r11d
+	addl	%r12d,%edx
+	addl	%r12d,%r11d
+
+	leaq	4(%rbp),%rbp
+	movl	40(%rsp),%r13d
+	movl	28(%rsp),%edi
+
+	movl	%r13d,%r12d
+	rorl	$11,%r13d
+	addl	%r14d,%r11d
+	movl	%edi,%r14d
+	rorl	$2,%edi
+
+	xorl	%r12d,%r13d
+	shrl	$3,%r12d
+	rorl	$7,%r13d
+	xorl	%r14d,%edi
+	shrl	$10,%r14d
+
+	rorl	$17,%edi
+	xorl	%r13d,%r12d
+	xorl	%r14d,%edi
+	addl	8(%rsp),%r12d
+
+	addl	36(%rsp),%r12d
+	movl	%edx,%r13d
+	addl	%edi,%r12d
+	movl	%r11d,%r14d
+	rorl	$14,%r13d
+	movl	%r8d,%edi
+
+	xorl	%edx,%r13d
+	rorl	$9,%r14d
+	xorl	%r9d,%edi
+
+	movl	%r12d,36(%rsp)
+	xorl	%r11d,%r14d
+	andl	%edx,%edi
+
+	rorl	$5,%r13d
+	addl	%r10d,%r12d
+	xorl	%r9d,%edi
+
+	rorl	$11,%r14d
+	xorl	%edx,%r13d
+	addl	%edi,%r12d
+
+	movl	%r11d,%edi
+	addl	(%rbp),%r12d
+	xorl	%r11d,%r14d
+
+	xorl	%eax,%edi
+	rorl	$6,%r13d
+	movl	%eax,%r10d
+
+	andl	%edi,%r15d
+	rorl	$2,%r14d
+	addl	%r13d,%r12d
+
+	xorl	%r15d,%r10d
+	addl	%r12d,%ecx
+	addl	%r12d,%r10d
+
+	leaq	4(%rbp),%rbp
+	movl	44(%rsp),%r13d
+	movl	32(%rsp),%r15d
+
+	movl	%r13d,%r12d
+	rorl	$11,%r13d
+	addl	%r14d,%r10d
+	movl	%r15d,%r14d
+	rorl	$2,%r15d
+
+	xorl	%r12d,%r13d
+	shrl	$3,%r12d
+	rorl	$7,%r13d
+	xorl	%r14d,%r15d
+	shrl	$10,%r14d
+
+	rorl	$17,%r15d
+	xorl	%r13d,%r12d
+	xorl	%r14d,%r15d
+	addl	12(%rsp),%r12d
+
+	addl	40(%rsp),%r12d
+	movl	%ecx,%r13d
+	addl	%r15d,%r12d
+	movl	%r10d,%r14d
+	rorl	$14,%r13d
+	movl	%edx,%r15d
+
+	xorl	%ecx,%r13d
+	rorl	$9,%r14d
+	xorl	%r8d,%r15d
+
+	movl	%r12d,40(%rsp)
+	xorl	%r10d,%r14d
+	andl	%ecx,%r15d
+
+	rorl	$5,%r13d
+	addl	%r9d,%r12d
+	xorl	%r8d,%r15d
+
+	rorl	$11,%r14d
+	xorl	%ecx,%r13d
+	addl	%r15d,%r12d
+
+	movl	%r10d,%r15d
+	addl	(%rbp),%r12d
+	xorl	%r10d,%r14d
+
+	xorl	%r11d,%r15d
+	rorl	$6,%r13d
+	movl	%r11d,%r9d
+
+	andl	%r15d,%edi
+	rorl	$2,%r14d
+	addl	%r13d,%r12d
+
+	xorl	%edi,%r9d
+	addl	%r12d,%ebx
+	addl	%r12d,%r9d
+
+	leaq	4(%rbp),%rbp
+	movl	48(%rsp),%r13d
+	movl	36(%rsp),%edi
+
+	movl	%r13d,%r12d
+	rorl	$11,%r13d
+	addl	%r14d,%r9d
+	movl	%edi,%r14d
+	rorl	$2,%edi
+
+	xorl	%r12d,%r13d
+	shrl	$3,%r12d
+	rorl	$7,%r13d
+	xorl	%r14d,%edi
+	shrl	$10,%r14d
+
+	rorl	$17,%edi
+	xorl	%r13d,%r12d
+	xorl	%r14d,%edi
+	addl	16(%rsp),%r12d
+
+	addl	44(%rsp),%r12d
+	movl	%ebx,%r13d
+	addl	%edi,%r12d
+	movl	%r9d,%r14d
+	rorl	$14,%r13d
+	movl	%ecx,%edi
+
+	xorl	%ebx,%r13d
+	rorl	$9,%r14d
+	xorl	%edx,%edi
+
+	movl	%r12d,44(%rsp)
+	xorl	%r9d,%r14d
+	andl	%ebx,%edi
+
+	rorl	$5,%r13d
+	addl	%r8d,%r12d
+	xorl	%edx,%edi
+
+	rorl	$11,%r14d
+	xorl	%ebx,%r13d
+	addl	%edi,%r12d
+
+	movl	%r9d,%edi
+	addl	(%rbp),%r12d
+	xorl	%r9d,%r14d
+
+	xorl	%r10d,%edi
+	rorl	$6,%r13d
+	movl	%r10d,%r8d
+
+	andl	%edi,%r15d
+	rorl	$2,%r14d
+	addl	%r13d,%r12d
+
+	xorl	%r15d,%r8d
+	addl	%r12d,%eax
+	addl	%r12d,%r8d
+
+	leaq	20(%rbp),%rbp
+	movl	52(%rsp),%r13d
+	movl	40(%rsp),%r15d
+
+	movl	%r13d,%r12d
+	rorl	$11,%r13d
+	addl	%r14d,%r8d
+	movl	%r15d,%r14d
+	rorl	$2,%r15d
+
+	xorl	%r12d,%r13d
+	shrl	$3,%r12d
+	rorl	$7,%r13d
+	xorl	%r14d,%r15d
+	shrl	$10,%r14d
+
+	rorl	$17,%r15d
+	xorl	%r13d,%r12d
+	xorl	%r14d,%r15d
+	addl	20(%rsp),%r12d
+
+	addl	48(%rsp),%r12d
+	movl	%eax,%r13d
+	addl	%r15d,%r12d
+	movl	%r8d,%r14d
+	rorl	$14,%r13d
+	movl	%ebx,%r15d
+
+	xorl	%eax,%r13d
+	rorl	$9,%r14d
+	xorl	%ecx,%r15d
+
+	movl	%r12d,48(%rsp)
+	xorl	%r8d,%r14d
+	andl	%eax,%r15d
+
+	rorl	$5,%r13d
+	addl	%edx,%r12d
+	xorl	%ecx,%r15d
+
+	rorl	$11,%r14d
+	xorl	%eax,%r13d
+	addl	%r15d,%r12d
+
+	movl	%r8d,%r15d
+	addl	(%rbp),%r12d
+	xorl	%r8d,%r14d
+
+	xorl	%r9d,%r15d
+	rorl	$6,%r13d
+	movl	%r9d,%edx
+
+	andl	%r15d,%edi
+	rorl	$2,%r14d
+	addl	%r13d,%r12d
+
+	xorl	%edi,%edx
+	addl	%r12d,%r11d
+	addl	%r12d,%edx
+
+	leaq	4(%rbp),%rbp
+	movl	56(%rsp),%r13d
+	movl	44(%rsp),%edi
+
+	movl	%r13d,%r12d
+	rorl	$11,%r13d
+	addl	%r14d,%edx
+	movl	%edi,%r14d
+	rorl	$2,%edi
+
+	xorl	%r12d,%r13d
+	shrl	$3,%r12d
+	rorl	$7,%r13d
+	xorl	%r14d,%edi
+	shrl	$10,%r14d
+
+	rorl	$17,%edi
+	xorl	%r13d,%r12d
+	xorl	%r14d,%edi
+	addl	24(%rsp),%r12d
+
+	addl	52(%rsp),%r12d
+	movl	%r11d,%r13d
+	addl	%edi,%r12d
+	movl	%edx,%r14d
+	rorl	$14,%r13d
+	movl	%eax,%edi
+
+	xorl	%r11d,%r13d
+	rorl	$9,%r14d
+	xorl	%ebx,%edi
+
+	movl	%r12d,52(%rsp)
+	xorl	%edx,%r14d
+	andl	%r11d,%edi
+
+	rorl	$5,%r13d
+	addl	%ecx,%r12d
+	xorl	%ebx,%edi
+
+	rorl	$11,%r14d
+	xorl	%r11d,%r13d
+	addl	%edi,%r12d
+
+	movl	%edx,%edi
+	addl	(%rbp),%r12d
+	xorl	%edx,%r14d
+
+	xorl	%r8d,%edi
+	rorl	$6,%r13d
+	movl	%r8d,%ecx
+
+	andl	%edi,%r15d
+	rorl	$2,%r14d
+	addl	%r13d,%r12d
+
+	xorl	%r15d,%ecx
+	addl	%r12d,%r10d
+	addl	%r12d,%ecx
+
+	leaq	4(%rbp),%rbp
+	movl	60(%rsp),%r13d
+	movl	48(%rsp),%r15d
+
+	movl	%r13d,%r12d
+	rorl	$11,%r13d
+	addl	%r14d,%ecx
+	movl	%r15d,%r14d
+	rorl	$2,%r15d
+
+	xorl	%r12d,%r13d
+	shrl	$3,%r12d
+	rorl	$7,%r13d
+	xorl	%r14d,%r15d
+	shrl	$10,%r14d
+
+	rorl	$17,%r15d
+	xorl	%r13d,%r12d
+	xorl	%r14d,%r15d
+	addl	28(%rsp),%r12d
+
+	addl	56(%rsp),%r12d
+	movl	%r10d,%r13d
+	addl	%r15d,%r12d
+	movl	%ecx,%r14d
+	rorl	$14,%r13d
+	movl	%r11d,%r15d
+
+	xorl	%r10d,%r13d
+	rorl	$9,%r14d
+	xorl	%eax,%r15d
+
+	movl	%r12d,56(%rsp)
+	xorl	%ecx,%r14d
+	andl	%r10d,%r15d
+
+	rorl	$5,%r13d
+	addl	%ebx,%r12d
+	xorl	%eax,%r15d
+
+	rorl	$11,%r14d
+	xorl	%r10d,%r13d
+	addl	%r15d,%r12d
+
+	movl	%ecx,%r15d
+	addl	(%rbp),%r12d
+	xorl	%ecx,%r14d
+
+	xorl	%edx,%r15d
+	rorl	$6,%r13d
+	movl	%edx,%ebx
+
+	andl	%r15d,%edi
+	rorl	$2,%r14d
+	addl	%r13d,%r12d
+
+	xorl	%edi,%ebx
+	addl	%r12d,%r9d
+	addl	%r12d,%ebx
+
+	leaq	4(%rbp),%rbp
+	movl	0(%rsp),%r13d
+	movl	52(%rsp),%edi
+
+	movl	%r13d,%r12d
+	rorl	$11,%r13d
+	addl	%r14d,%ebx
+	movl	%edi,%r14d
+	rorl	$2,%edi
+
+	xorl	%r12d,%r13d
+	shrl	$3,%r12d
+	rorl	$7,%r13d
+	xorl	%r14d,%edi
+	shrl	$10,%r14d
+
+	rorl	$17,%edi
+	xorl	%r13d,%r12d
+	xorl	%r14d,%edi
+	addl	32(%rsp),%r12d
+
+	addl	60(%rsp),%r12d
+	movl	%r9d,%r13d
+	addl	%edi,%r12d
+	movl	%ebx,%r14d
+	rorl	$14,%r13d
+	movl	%r10d,%edi
+
+	xorl	%r9d,%r13d
+	rorl	$9,%r14d
+	xorl	%r11d,%edi
+
+	movl	%r12d,60(%rsp)
+	xorl	%ebx,%r14d
+	andl	%r9d,%edi
+
+	rorl	$5,%r13d
+	addl	%eax,%r12d
+	xorl	%r11d,%edi
+
+	rorl	$11,%r14d
+	xorl	%r9d,%r13d
+	addl	%edi,%r12d
+
+	movl	%ebx,%edi
+	addl	(%rbp),%r12d
+	xorl	%ebx,%r14d
+
+	xorl	%ecx,%edi
+	rorl	$6,%r13d
+	movl	%ecx,%eax
+
+	andl	%edi,%r15d
+	rorl	$2,%r14d
+	addl	%r13d,%r12d
+
+	xorl	%r15d,%eax
+	addl	%r12d,%r8d
+	addl	%r12d,%eax
+
+	leaq	20(%rbp),%rbp
+	cmpb	$0,3(%rbp)
+	jnz	.Lrounds_16_xx
+
+	movq	64+0(%rsp),%rdi
+	addl	%r14d,%eax
+	leaq	64(%rsi),%rsi
+
+	addl	0(%rdi),%eax
+	addl	4(%rdi),%ebx
+	addl	8(%rdi),%ecx
+	addl	12(%rdi),%edx
+	addl	16(%rdi),%r8d
+	addl	20(%rdi),%r9d
+	addl	24(%rdi),%r10d
+	addl	28(%rdi),%r11d
+
+	cmpq	64+16(%rsp),%rsi
+
+	movl	%eax,0(%rdi)
+	movl	%ebx,4(%rdi)
+	movl	%ecx,8(%rdi)
+	movl	%edx,12(%rdi)
+	movl	%r8d,16(%rdi)
+	movl	%r9d,20(%rdi)
+	movl	%r10d,24(%rdi)
+	movl	%r11d,28(%rdi)
+	jb	.Lloop
+
+	movq	64+24(%rsp),%rsi
+	movq	(%rsi),%r15
+	movq	8(%rsi),%r14
+	movq	16(%rsi),%r13
+	movq	24(%rsi),%r12
+	movq	32(%rsi),%rbp
+	movq	40(%rsi),%rbx
+	leaq	48(%rsi),%rsp
+.Lepilogue:
+	.byte	0xf3,0xc3
+.size	sha256_block_data_order,.-sha256_block_data_order
+.align	64
+.type	K256,@object
+K256:
+.long	0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5
+.long	0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5
+.long	0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5
+.long	0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5
+.long	0xd807aa98,0x12835b01,0x243185be,0x550c7dc3
+.long	0xd807aa98,0x12835b01,0x243185be,0x550c7dc3
+.long	0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174
+.long	0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174
+.long	0xe49b69c1,0xefbe4786,0x0fc19dc6,0x240ca1cc
+.long	0xe49b69c1,0xefbe4786,0x0fc19dc6,0x240ca1cc
+.long	0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da
+.long	0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da
+.long	0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7
+.long	0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7
+.long	0xc6e00bf3,0xd5a79147,0x06ca6351,0x14292967
+.long	0xc6e00bf3,0xd5a79147,0x06ca6351,0x14292967
+.long	0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13
+.long	0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13
+.long	0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85
+.long	0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85
+.long	0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3
+.long	0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3
+.long	0xd192e819,0xd6990624,0xf40e3585,0x106aa070
+.long	0xd192e819,0xd6990624,0xf40e3585,0x106aa070
+.long	0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5
+.long	0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5
+.long	0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3
+.long	0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3
+.long	0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208
+.long	0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208
+.long	0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2
+.long	0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2
+
+.long	0x00010203,0x04050607,0x08090a0b,0x0c0d0e0f
+.long	0x00010203,0x04050607,0x08090a0b,0x0c0d0e0f
+.long	0x03020100,0x0b0a0908,0xffffffff,0xffffffff
+.long	0x03020100,0x0b0a0908,0xffffffff,0xffffffff
+.long	0xffffffff,0xffffffff,0x03020100,0x0b0a0908
+.long	0xffffffff,0xffffffff,0x03020100,0x0b0a0908
+.byte	83,72,65,50,53,54,32,98,108,111,99,107,32,116,114,97,110,115,102,111,114,109,32,102,111,114,32,120,56,54,95,54,52,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0
+.type	sha256_block_data_order_ssse3,@function
+.align	64
+sha256_block_data_order_ssse3:
+.Lssse3_shortcut:
+	pushq	%rbx
+	pushq	%rbp
+	pushq	%r12
+	pushq	%r13
+	pushq	%r14
+	pushq	%r15
+	movq	%rsp,%r11
+	shlq	$4,%rdx
+	subq	$96,%rsp
+	leaq	(%rsi,%rdx,4),%rdx
+	andq	$-64,%rsp
+	movq	%rdi,64+0(%rsp)
+	movq	%rsi,64+8(%rsp)
+	movq	%rdx,64+16(%rsp)
+	movq	%r11,64+24(%rsp)
+.Lprologue_ssse3:
+
+	movl	0(%rdi),%eax
+	movl	4(%rdi),%ebx
+	movl	8(%rdi),%ecx
+	movl	12(%rdi),%edx
+	movl	16(%rdi),%r8d
+	movl	20(%rdi),%r9d
+	movl	24(%rdi),%r10d
+	movl	28(%rdi),%r11d
+
+
+	jmp	.Lloop_ssse3
+.align	16
+.Lloop_ssse3:
+	movdqa	K256+512(%rip),%xmm7
+	movdqu	0(%rsi),%xmm0
+	movdqu	16(%rsi),%xmm1
+	movdqu	32(%rsi),%xmm2
+.byte	102,15,56,0,199
+	movdqu	48(%rsi),%xmm3
+	leaq	K256(%rip),%rbp
+.byte	102,15,56,0,207
+	movdqa	0(%rbp),%xmm4
+	movdqa	32(%rbp),%xmm5
+.byte	102,15,56,0,215
+	paddd	%xmm0,%xmm4
+	movdqa	64(%rbp),%xmm6
+.byte	102,15,56,0,223
+	movdqa	96(%rbp),%xmm7
+	paddd	%xmm1,%xmm5
+	paddd	%xmm2,%xmm6
+	paddd	%xmm3,%xmm7
+	movdqa	%xmm4,0(%rsp)
+	movl	%eax,%r14d
+	movdqa	%xmm5,16(%rsp)
+	movl	%ebx,%edi
+	movdqa	%xmm6,32(%rsp)
+	xorl	%ecx,%edi
+	movdqa	%xmm7,48(%rsp)
+	movl	%r8d,%r13d
+	jmp	.Lssse3_00_47
+
+.align	16
+.Lssse3_00_47:
+	subq	$-128,%rbp
+	rorl	$14,%r13d
+	movdqa	%xmm1,%xmm4
+	movl	%r14d,%eax
+	movl	%r9d,%r12d
+	movdqa	%xmm3,%xmm7
+	rorl	$9,%r14d
+	xorl	%r8d,%r13d
+	xorl	%r10d,%r12d
+	rorl	$5,%r13d
+	xorl	%eax,%r14d
+.byte	102,15,58,15,224,4
+	andl	%r8d,%r12d
+	xorl	%r8d,%r13d
+.byte	102,15,58,15,250,4
+	addl	0(%rsp),%r11d
+	movl	%eax,%r15d
+	xorl	%r10d,%r12d
+	rorl	$11,%r14d
+	movdqa	%xmm4,%xmm5
+	xorl	%ebx,%r15d
+	addl	%r12d,%r11d
+	movdqa	%xmm4,%xmm6
+	rorl	$6,%r13d
+	andl	%r15d,%edi
+	psrld	$3,%xmm4
+	xorl	%eax,%r14d
+	addl	%r13d,%r11d
+	xorl	%ebx,%edi
+	paddd	%xmm7,%xmm0
+	rorl	$2,%r14d
+	addl	%r11d,%edx
+	psrld	$7,%xmm6
+	addl	%edi,%r11d
+	movl	%edx,%r13d
+	pshufd	$250,%xmm3,%xmm7
+	addl	%r11d,%r14d
+	rorl	$14,%r13d
+	pslld	$14,%xmm5
+	movl	%r14d,%r11d
+	movl	%r8d,%r12d
+	pxor	%xmm6,%xmm4
+	rorl	$9,%r14d
+	xorl	%edx,%r13d
+	xorl	%r9d,%r12d
+	rorl	$5,%r13d
+	psrld	$11,%xmm6
+	xorl	%r11d,%r14d
+	pxor	%xmm5,%xmm4
+	andl	%edx,%r12d
+	xorl	%edx,%r13d
+	pslld	$11,%xmm5
+	addl	4(%rsp),%r10d
+	movl	%r11d,%edi
+	pxor	%xmm6,%xmm4
+	xorl	%r9d,%r12d
+	rorl	$11,%r14d
+	movdqa	%xmm7,%xmm6
+	xorl	%eax,%edi
+	addl	%r12d,%r10d
+	pxor	%xmm5,%xmm4
+	rorl	$6,%r13d
+	andl	%edi,%r15d
+	xorl	%r11d,%r14d
+	psrld	$10,%xmm7
+	addl	%r13d,%r10d
+	xorl	%eax,%r15d
+	paddd	%xmm4,%xmm0
+	rorl	$2,%r14d
+	addl	%r10d,%ecx
+	psrlq	$17,%xmm6
+	addl	%r15d,%r10d
+	movl	%ecx,%r13d
+	addl	%r10d,%r14d
+	pxor	%xmm6,%xmm7
+	rorl	$14,%r13d
+	movl	%r14d,%r10d
+	movl	%edx,%r12d
+	rorl	$9,%r14d
+	psrlq	$2,%xmm6
+	xorl	%ecx,%r13d
+	xorl	%r8d,%r12d
+	pxor	%xmm6,%xmm7
+	rorl	$5,%r13d
+	xorl	%r10d,%r14d
+	andl	%ecx,%r12d
+	pshufd	$128,%xmm7,%xmm7
+	xorl	%ecx,%r13d
+	addl	8(%rsp),%r9d
+	movl	%r10d,%r15d
+	psrldq	$8,%xmm7
+	xorl	%r8d,%r12d
+	rorl	$11,%r14d
+	xorl	%r11d,%r15d
+	addl	%r12d,%r9d
+	rorl	$6,%r13d
+	paddd	%xmm7,%xmm0
+	andl	%r15d,%edi
+	xorl	%r10d,%r14d
+	addl	%r13d,%r9d
+	pshufd	$80,%xmm0,%xmm7
+	xorl	%r11d,%edi
+	rorl	$2,%r14d
+	addl	%r9d,%ebx
+	movdqa	%xmm7,%xmm6
+	addl	%edi,%r9d
+	movl	%ebx,%r13d
+	psrld	$10,%xmm7
+	addl	%r9d,%r14d
+	rorl	$14,%r13d
+	psrlq	$17,%xmm6
+	movl	%r14d,%r9d
+	movl	%ecx,%r12d
+	pxor	%xmm6,%xmm7
+	rorl	$9,%r14d
+	xorl	%ebx,%r13d
+	xorl	%edx,%r12d
+	rorl	$5,%r13d
+	xorl	%r9d,%r14d
+	psrlq	$2,%xmm6
+	andl	%ebx,%r12d
+	xorl	%ebx,%r13d
+	addl	12(%rsp),%r8d
+	pxor	%xmm6,%xmm7
+	movl	%r9d,%edi
+	xorl	%edx,%r12d
+	rorl	$11,%r14d
+	pshufd	$8,%xmm7,%xmm7
+	xorl	%r10d,%edi
+	addl	%r12d,%r8d
+	movdqa	0(%rbp),%xmm6
+	rorl	$6,%r13d
+	andl	%edi,%r15d
+	pslldq	$8,%xmm7
+	xorl	%r9d,%r14d
+	addl	%r13d,%r8d
+	xorl	%r10d,%r15d
+	paddd	%xmm7,%xmm0
+	rorl	$2,%r14d
+	addl	%r8d,%eax
+	addl	%r15d,%r8d
+	paddd	%xmm0,%xmm6
+	movl	%eax,%r13d
+	addl	%r8d,%r14d
+	movdqa	%xmm6,0(%rsp)
+	rorl	$14,%r13d
+	movdqa	%xmm2,%xmm4
+	movl	%r14d,%r8d
+	movl	%ebx,%r12d
+	movdqa	%xmm0,%xmm7
+	rorl	$9,%r14d
+	xorl	%eax,%r13d
+	xorl	%ecx,%r12d
+	rorl	$5,%r13d
+	xorl	%r8d,%r14d
+.byte	102,15,58,15,225,4
+	andl	%eax,%r12d
+	xorl	%eax,%r13d
+.byte	102,15,58,15,251,4
+	addl	16(%rsp),%edx
+	movl	%r8d,%r15d
+	xorl	%ecx,%r12d
+	rorl	$11,%r14d
+	movdqa	%xmm4,%xmm5
+	xorl	%r9d,%r15d
+	addl	%r12d,%edx
+	movdqa	%xmm4,%xmm6
+	rorl	$6,%r13d
+	andl	%r15d,%edi
+	psrld	$3,%xmm4
+	xorl	%r8d,%r14d
+	addl	%r13d,%edx
+	xorl	%r9d,%edi
+	paddd	%xmm7,%xmm1
+	rorl	$2,%r14d
+	addl	%edx,%r11d
+	psrld	$7,%xmm6
+	addl	%edi,%edx
+	movl	%r11d,%r13d
+	pshufd	$250,%xmm0,%xmm7
+	addl	%edx,%r14d
+	rorl	$14,%r13d
+	pslld	$14,%xmm5
+	movl	%r14d,%edx
+	movl	%eax,%r12d
+	pxor	%xmm6,%xmm4
+	rorl	$9,%r14d
+	xorl	%r11d,%r13d
+	xorl	%ebx,%r12d
+	rorl	$5,%r13d
+	psrld	$11,%xmm6
+	xorl	%edx,%r14d
+	pxor	%xmm5,%xmm4
+	andl	%r11d,%r12d
+	xorl	%r11d,%r13d
+	pslld	$11,%xmm5
+	addl	20(%rsp),%ecx
+	movl	%edx,%edi
+	pxor	%xmm6,%xmm4
+	xorl	%ebx,%r12d
+	rorl	$11,%r14d
+	movdqa	%xmm7,%xmm6
+	xorl	%r8d,%edi
+	addl	%r12d,%ecx
+	pxor	%xmm5,%xmm4
+	rorl	$6,%r13d
+	andl	%edi,%r15d
+	xorl	%edx,%r14d
+	psrld	$10,%xmm7
+	addl	%r13d,%ecx
+	xorl	%r8d,%r15d
+	paddd	%xmm4,%xmm1
+	rorl	$2,%r14d
+	addl	%ecx,%r10d
+	psrlq	$17,%xmm6
+	addl	%r15d,%ecx
+	movl	%r10d,%r13d
+	addl	%ecx,%r14d
+	pxor	%xmm6,%xmm7
+	rorl	$14,%r13d
+	movl	%r14d,%ecx
+	movl	%r11d,%r12d
+	rorl	$9,%r14d
+	psrlq	$2,%xmm6
+	xorl	%r10d,%r13d
+	xorl	%eax,%r12d
+	pxor	%xmm6,%xmm7
+	rorl	$5,%r13d
+	xorl	%ecx,%r14d
+	andl	%r10d,%r12d
+	pshufd	$128,%xmm7,%xmm7
+	xorl	%r10d,%r13d
+	addl	24(%rsp),%ebx
+	movl	%ecx,%r15d
+	psrldq	$8,%xmm7
+	xorl	%eax,%r12d
+	rorl	$11,%r14d
+	xorl	%edx,%r15d
+	addl	%r12d,%ebx
+	rorl	$6,%r13d
+	paddd	%xmm7,%xmm1
+	andl	%r15d,%edi
+	xorl	%ecx,%r14d
+	addl	%r13d,%ebx
+	pshufd	$80,%xmm1,%xmm7
+	xorl	%edx,%edi
+	rorl	$2,%r14d
+	addl	%ebx,%r9d
+	movdqa	%xmm7,%xmm6
+	addl	%edi,%ebx
+	movl	%r9d,%r13d
+	psrld	$10,%xmm7
+	addl	%ebx,%r14d
+	rorl	$14,%r13d
+	psrlq	$17,%xmm6
+	movl	%r14d,%ebx
+	movl	%r10d,%r12d
+	pxor	%xmm6,%xmm7
+	rorl	$9,%r14d
+	xorl	%r9d,%r13d
+	xorl	%r11d,%r12d
+	rorl	$5,%r13d
+	xorl	%ebx,%r14d
+	psrlq	$2,%xmm6
+	andl	%r9d,%r12d
+	xorl	%r9d,%r13d
+	addl	28(%rsp),%eax
+	pxor	%xmm6,%xmm7
+	movl	%ebx,%edi
+	xorl	%r11d,%r12d
+	rorl	$11,%r14d
+	pshufd	$8,%xmm7,%xmm7
+	xorl	%ecx,%edi
+	addl	%r12d,%eax
+	movdqa	32(%rbp),%xmm6
+	rorl	$6,%r13d
+	andl	%edi,%r15d
+	pslldq	$8,%xmm7
+	xorl	%ebx,%r14d
+	addl	%r13d,%eax
+	xorl	%ecx,%r15d
+	paddd	%xmm7,%xmm1
+	rorl	$2,%r14d
+	addl	%eax,%r8d
+	addl	%r15d,%eax
+	paddd	%xmm1,%xmm6
+	movl	%r8d,%r13d
+	addl	%eax,%r14d
+	movdqa	%xmm6,16(%rsp)
+	rorl	$14,%r13d
+	movdqa	%xmm3,%xmm4
+	movl	%r14d,%eax
+	movl	%r9d,%r12d
+	movdqa	%xmm1,%xmm7
+	rorl	$9,%r14d
+	xorl	%r8d,%r13d
+	xorl	%r10d,%r12d
+	rorl	$5,%r13d
+	xorl	%eax,%r14d
+.byte	102,15,58,15,226,4
+	andl	%r8d,%r12d
+	xorl	%r8d,%r13d
+.byte	102,15,58,15,248,4
+	addl	32(%rsp),%r11d
+	movl	%eax,%r15d
+	xorl	%r10d,%r12d
+	rorl	$11,%r14d
+	movdqa	%xmm4,%xmm5
+	xorl	%ebx,%r15d
+	addl	%r12d,%r11d
+	movdqa	%xmm4,%xmm6
+	rorl	$6,%r13d
+	andl	%r15d,%edi
+	psrld	$3,%xmm4
+	xorl	%eax,%r14d
+	addl	%r13d,%r11d
+	xorl	%ebx,%edi
+	paddd	%xmm7,%xmm2
+	rorl	$2,%r14d
+	addl	%r11d,%edx
+	psrld	$7,%xmm6
+	addl	%edi,%r11d
+	movl	%edx,%r13d
+	pshufd	$250,%xmm1,%xmm7
+	addl	%r11d,%r14d
+	rorl	$14,%r13d
+	pslld	$14,%xmm5
+	movl	%r14d,%r11d
+	movl	%r8d,%r12d
+	pxor	%xmm6,%xmm4
+	rorl	$9,%r14d
+	xorl	%edx,%r13d
+	xorl	%r9d,%r12d
+	rorl	$5,%r13d
+	psrld	$11,%xmm6
+	xorl	%r11d,%r14d
+	pxor	%xmm5,%xmm4
+	andl	%edx,%r12d
+	xorl	%edx,%r13d
+	pslld	$11,%xmm5
+	addl	36(%rsp),%r10d
+	movl	%r11d,%edi
+	pxor	%xmm6,%xmm4
+	xorl	%r9d,%r12d
+	rorl	$11,%r14d
+	movdqa	%xmm7,%xmm6
+	xorl	%eax,%edi
+	addl	%r12d,%r10d
+	pxor	%xmm5,%xmm4
+	rorl	$6,%r13d
+	andl	%edi,%r15d
+	xorl	%r11d,%r14d
+	psrld	$10,%xmm7
+	addl	%r13d,%r10d
+	xorl	%eax,%r15d
+	paddd	%xmm4,%xmm2
+	rorl	$2,%r14d
+	addl	%r10d,%ecx
+	psrlq	$17,%xmm6
+	addl	%r15d,%r10d
+	movl	%ecx,%r13d
+	addl	%r10d,%r14d
+	pxor	%xmm6,%xmm7
+	rorl	$14,%r13d
+	movl	%r14d,%r10d
+	movl	%edx,%r12d
+	rorl	$9,%r14d
+	psrlq	$2,%xmm6
+	xorl	%ecx,%r13d
+	xorl	%r8d,%r12d
+	pxor	%xmm6,%xmm7
+	rorl	$5,%r13d
+	xorl	%r10d,%r14d
+	andl	%ecx,%r12d
+	pshufd	$128,%xmm7,%xmm7
+	xorl	%ecx,%r13d
+	addl	40(%rsp),%r9d
+	movl	%r10d,%r15d
+	psrldq	$8,%xmm7
+	xorl	%r8d,%r12d
+	rorl	$11,%r14d
+	xorl	%r11d,%r15d
+	addl	%r12d,%r9d
+	rorl	$6,%r13d
+	paddd	%xmm7,%xmm2
+	andl	%r15d,%edi
+	xorl	%r10d,%r14d
+	addl	%r13d,%r9d
+	pshufd	$80,%xmm2,%xmm7
+	xorl	%r11d,%edi
+	rorl	$2,%r14d
+	addl	%r9d,%ebx
+	movdqa	%xmm7,%xmm6
+	addl	%edi,%r9d
+	movl	%ebx,%r13d
+	psrld	$10,%xmm7
+	addl	%r9d,%r14d
+	rorl	$14,%r13d
+	psrlq	$17,%xmm6
+	movl	%r14d,%r9d
+	movl	%ecx,%r12d
+	pxor	%xmm6,%xmm7
+	rorl	$9,%r14d
+	xorl	%ebx,%r13d
+	xorl	%edx,%r12d
+	rorl	$5,%r13d
+	xorl	%r9d,%r14d
+	psrlq	$2,%xmm6
+	andl	%ebx,%r12d
+	xorl	%ebx,%r13d
+	addl	44(%rsp),%r8d
+	pxor	%xmm6,%xmm7
+	movl	%r9d,%edi
+	xorl	%edx,%r12d
+	rorl	$11,%r14d
+	pshufd	$8,%xmm7,%xmm7
+	xorl	%r10d,%edi
+	addl	%r12d,%r8d
+	movdqa	64(%rbp),%xmm6
+	rorl	$6,%r13d
+	andl	%edi,%r15d
+	pslldq	$8,%xmm7
+	xorl	%r9d,%r14d
+	addl	%r13d,%r8d
+	xorl	%r10d,%r15d
+	paddd	%xmm7,%xmm2
+	rorl	$2,%r14d
+	addl	%r8d,%eax
+	addl	%r15d,%r8d
+	paddd	%xmm2,%xmm6
+	movl	%eax,%r13d
+	addl	%r8d,%r14d
+	movdqa	%xmm6,32(%rsp)
+	rorl	$14,%r13d
+	movdqa	%xmm0,%xmm4
+	movl	%r14d,%r8d
+	movl	%ebx,%r12d
+	movdqa	%xmm2,%xmm7
+	rorl	$9,%r14d
+	xorl	%eax,%r13d
+	xorl	%ecx,%r12d
+	rorl	$5,%r13d
+	xorl	%r8d,%r14d
+.byte	102,15,58,15,227,4
+	andl	%eax,%r12d
+	xorl	%eax,%r13d
+.byte	102,15,58,15,249,4
+	addl	48(%rsp),%edx
+	movl	%r8d,%r15d
+	xorl	%ecx,%r12d
+	rorl	$11,%r14d
+	movdqa	%xmm4,%xmm5
+	xorl	%r9d,%r15d
+	addl	%r12d,%edx
+	movdqa	%xmm4,%xmm6
+	rorl	$6,%r13d
+	andl	%r15d,%edi
+	psrld	$3,%xmm4
+	xorl	%r8d,%r14d
+	addl	%r13d,%edx
+	xorl	%r9d,%edi
+	paddd	%xmm7,%xmm3
+	rorl	$2,%r14d
+	addl	%edx,%r11d
+	psrld	$7,%xmm6
+	addl	%edi,%edx
+	movl	%r11d,%r13d
+	pshufd	$250,%xmm2,%xmm7
+	addl	%edx,%r14d
+	rorl	$14,%r13d
+	pslld	$14,%xmm5
+	movl	%r14d,%edx
+	movl	%eax,%r12d
+	pxor	%xmm6,%xmm4
+	rorl	$9,%r14d
+	xorl	%r11d,%r13d
+	xorl	%ebx,%r12d
+	rorl	$5,%r13d
+	psrld	$11,%xmm6
+	xorl	%edx,%r14d
+	pxor	%xmm5,%xmm4
+	andl	%r11d,%r12d
+	xorl	%r11d,%r13d
+	pslld	$11,%xmm5
+	addl	52(%rsp),%ecx
+	movl	%edx,%edi
+	pxor	%xmm6,%xmm4
+	xorl	%ebx,%r12d
+	rorl	$11,%r14d
+	movdqa	%xmm7,%xmm6
+	xorl	%r8d,%edi
+	addl	%r12d,%ecx
+	pxor	%xmm5,%xmm4
+	rorl	$6,%r13d
+	andl	%edi,%r15d
+	xorl	%edx,%r14d
+	psrld	$10,%xmm7
+	addl	%r13d,%ecx
+	xorl	%r8d,%r15d
+	paddd	%xmm4,%xmm3
+	rorl	$2,%r14d
+	addl	%ecx,%r10d
+	psrlq	$17,%xmm6
+	addl	%r15d,%ecx
+	movl	%r10d,%r13d
+	addl	%ecx,%r14d
+	pxor	%xmm6,%xmm7
+	rorl	$14,%r13d
+	movl	%r14d,%ecx
+	movl	%r11d,%r12d
+	rorl	$9,%r14d
+	psrlq	$2,%xmm6
+	xorl	%r10d,%r13d
+	xorl	%eax,%r12d
+	pxor	%xmm6,%xmm7
+	rorl	$5,%r13d
+	xorl	%ecx,%r14d
+	andl	%r10d,%r12d
+	pshufd	$128,%xmm7,%xmm7
+	xorl	%r10d,%r13d
+	addl	56(%rsp),%ebx
+	movl	%ecx,%r15d
+	psrldq	$8,%xmm7
+	xorl	%eax,%r12d
+	rorl	$11,%r14d
+	xorl	%edx,%r15d
+	addl	%r12d,%ebx
+	rorl	$6,%r13d
+	paddd	%xmm7,%xmm3
+	andl	%r15d,%edi
+	xorl	%ecx,%r14d
+	addl	%r13d,%ebx
+	pshufd	$80,%xmm3,%xmm7
+	xorl	%edx,%edi
+	rorl	$2,%r14d
+	addl	%ebx,%r9d
+	movdqa	%xmm7,%xmm6
+	addl	%edi,%ebx
+	movl	%r9d,%r13d
+	psrld	$10,%xmm7
+	addl	%ebx,%r14d
+	rorl	$14,%r13d
+	psrlq	$17,%xmm6
+	movl	%r14d,%ebx
+	movl	%r10d,%r12d
+	pxor	%xmm6,%xmm7
+	rorl	$9,%r14d
+	xorl	%r9d,%r13d
+	xorl	%r11d,%r12d
+	rorl	$5,%r13d
+	xorl	%ebx,%r14d
+	psrlq	$2,%xmm6
+	andl	%r9d,%r12d
+	xorl	%r9d,%r13d
+	addl	60(%rsp),%eax
+	pxor	%xmm6,%xmm7
+	movl	%ebx,%edi
+	xorl	%r11d,%r12d
+	rorl	$11,%r14d
+	pshufd	$8,%xmm7,%xmm7
+	xorl	%ecx,%edi
+	addl	%r12d,%eax
+	movdqa	96(%rbp),%xmm6
+	rorl	$6,%r13d
+	andl	%edi,%r15d
+	pslldq	$8,%xmm7
+	xorl	%ebx,%r14d
+	addl	%r13d,%eax
+	xorl	%ecx,%r15d
+	paddd	%xmm7,%xmm3
+	rorl	$2,%r14d
+	addl	%eax,%r8d
+	addl	%r15d,%eax
+	paddd	%xmm3,%xmm6
+	movl	%r8d,%r13d
+	addl	%eax,%r14d
+	movdqa	%xmm6,48(%rsp)
+	cmpb	$0,131(%rbp)
+	jne	.Lssse3_00_47
+	rorl	$14,%r13d
+	movl	%r14d,%eax
+	movl	%r9d,%r12d
+	rorl	$9,%r14d
+	xorl	%r8d,%r13d
+	xorl	%r10d,%r12d
+	rorl	$5,%r13d
+	xorl	%eax,%r14d
+	andl	%r8d,%r12d
+	xorl	%r8d,%r13d
+	addl	0(%rsp),%r11d
+	movl	%eax,%r15d
+	xorl	%r10d,%r12d
+	rorl	$11,%r14d
+	xorl	%ebx,%r15d
+	addl	%r12d,%r11d
+	rorl	$6,%r13d
+	andl	%r15d,%edi
+	xorl	%eax,%r14d
+	addl	%r13d,%r11d
+	xorl	%ebx,%edi
+	rorl	$2,%r14d
+	addl	%r11d,%edx
+	addl	%edi,%r11d
+	movl	%edx,%r13d
+	addl	%r11d,%r14d
+	rorl	$14,%r13d
+	movl	%r14d,%r11d
+	movl	%r8d,%r12d
+	rorl	$9,%r14d
+	xorl	%edx,%r13d
+	xorl	%r9d,%r12d
+	rorl	$5,%r13d
+	xorl	%r11d,%r14d
+	andl	%edx,%r12d
+	xorl	%edx,%r13d
+	addl	4(%rsp),%r10d
+	movl	%r11d,%edi
+	xorl	%r9d,%r12d
+	rorl	$11,%r14d
+	xorl	%eax,%edi
+	addl	%r12d,%r10d
+	rorl	$6,%r13d
+	andl	%edi,%r15d
+	xorl	%r11d,%r14d
+	addl	%r13d,%r10d
+	xorl	%eax,%r15d
+	rorl	$2,%r14d
+	addl	%r10d,%ecx
+	addl	%r15d,%r10d
+	movl	%ecx,%r13d
+	addl	%r10d,%r14d
+	rorl	$14,%r13d
+	movl	%r14d,%r10d
+	movl	%edx,%r12d
+	rorl	$9,%r14d
+	xorl	%ecx,%r13d
+	xorl	%r8d,%r12d
+	rorl	$5,%r13d
+	xorl	%r10d,%r14d
+	andl	%ecx,%r12d
+	xorl	%ecx,%r13d
+	addl	8(%rsp),%r9d
+	movl	%r10d,%r15d
+	xorl	%r8d,%r12d
+	rorl	$11,%r14d
+	xorl	%r11d,%r15d
+	addl	%r12d,%r9d
+	rorl	$6,%r13d
+	andl	%r15d,%edi
+	xorl	%r10d,%r14d
+	addl	%r13d,%r9d
+	xorl	%r11d,%edi
+	rorl	$2,%r14d
+	addl	%r9d,%ebx
+	addl	%edi,%r9d
+	movl	%ebx,%r13d
+	addl	%r9d,%r14d
+	rorl	$14,%r13d
+	movl	%r14d,%r9d
+	movl	%ecx,%r12d
+	rorl	$9,%r14d
+	xorl	%ebx,%r13d
+	xorl	%edx,%r12d
+	rorl	$5,%r13d
+	xorl	%r9d,%r14d
+	andl	%ebx,%r12d
+	xorl	%ebx,%r13d
+	addl	12(%rsp),%r8d
+	movl	%r9d,%edi
+	xorl	%edx,%r12d
+	rorl	$11,%r14d
+	xorl	%r10d,%edi
+	addl	%r12d,%r8d
+	rorl	$6,%r13d
+	andl	%edi,%r15d
+	xorl	%r9d,%r14d
+	addl	%r13d,%r8d
+	xorl	%r10d,%r15d
+	rorl	$2,%r14d
+	addl	%r8d,%eax
+	addl	%r15d,%r8d
+	movl	%eax,%r13d
+	addl	%r8d,%r14d
+	rorl	$14,%r13d
+	movl	%r14d,%r8d
+	movl	%ebx,%r12d
+	rorl	$9,%r14d
+	xorl	%eax,%r13d
+	xorl	%ecx,%r12d
+	rorl	$5,%r13d
+	xorl	%r8d,%r14d
+	andl	%eax,%r12d
+	xorl	%eax,%r13d
+	addl	16(%rsp),%edx
+	movl	%r8d,%r15d
+	xorl	%ecx,%r12d
+	rorl	$11,%r14d
+	xorl	%r9d,%r15d
+	addl	%r12d,%edx
+	rorl	$6,%r13d
+	andl	%r15d,%edi
+	xorl	%r8d,%r14d
+	addl	%r13d,%edx
+	xorl	%r9d,%edi
+	rorl	$2,%r14d
+	addl	%edx,%r11d
+	addl	%edi,%edx
+	movl	%r11d,%r13d
+	addl	%edx,%r14d
+	rorl	$14,%r13d
+	movl	%r14d,%edx
+	movl	%eax,%r12d
+	rorl	$9,%r14d
+	xorl	%r11d,%r13d
+	xorl	%ebx,%r12d
+	rorl	$5,%r13d
+	xorl	%edx,%r14d
+	andl	%r11d,%r12d
+	xorl	%r11d,%r13d
+	addl	20(%rsp),%ecx
+	movl	%edx,%edi
+	xorl	%ebx,%r12d
+	rorl	$11,%r14d
+	xorl	%r8d,%edi
+	addl	%r12d,%ecx
+	rorl	$6,%r13d
+	andl	%edi,%r15d
+	xorl	%edx,%r14d
+	addl	%r13d,%ecx
+	xorl	%r8d,%r15d
+	rorl	$2,%r14d
+	addl	%ecx,%r10d
+	addl	%r15d,%ecx
+	movl	%r10d,%r13d
+	addl	%ecx,%r14d
+	rorl	$14,%r13d
+	movl	%r14d,%ecx
+	movl	%r11d,%r12d
+	rorl	$9,%r14d
+	xorl	%r10d,%r13d
+	xorl	%eax,%r12d
+	rorl	$5,%r13d
+	xorl	%ecx,%r14d
+	andl	%r10d,%r12d
+	xorl	%r10d,%r13d
+	addl	24(%rsp),%ebx
+	movl	%ecx,%r15d
+	xorl	%eax,%r12d
+	rorl	$11,%r14d
+	xorl	%edx,%r15d
+	addl	%r12d,%ebx
+	rorl	$6,%r13d
+	andl	%r15d,%edi
+	xorl	%ecx,%r14d
+	addl	%r13d,%ebx
+	xorl	%edx,%edi
+	rorl	$2,%r14d
+	addl	%ebx,%r9d
+	addl	%edi,%ebx
+	movl	%r9d,%r13d
+	addl	%ebx,%r14d
+	rorl	$14,%r13d
+	movl	%r14d,%ebx
+	movl	%r10d,%r12d
+	rorl	$9,%r14d
+	xorl	%r9d,%r13d
+	xorl	%r11d,%r12d
+	rorl	$5,%r13d
+	xorl	%ebx,%r14d
+	andl	%r9d,%r12d
+	xorl	%r9d,%r13d
+	addl	28(%rsp),%eax
+	movl	%ebx,%edi
+	xorl	%r11d,%r12d
+	rorl	$11,%r14d
+	xorl	%ecx,%edi
+	addl	%r12d,%eax
+	rorl	$6,%r13d
+	andl	%edi,%r15d
+	xorl	%ebx,%r14d
+	addl	%r13d,%eax
+	xorl	%ecx,%r15d
+	rorl	$2,%r14d
+	addl	%eax,%r8d
+	addl	%r15d,%eax
+	movl	%r8d,%r13d
+	addl	%eax,%r14d
+	rorl	$14,%r13d
+	movl	%r14d,%eax
+	movl	%r9d,%r12d
+	rorl	$9,%r14d
+	xorl	%r8d,%r13d
+	xorl	%r10d,%r12d
+	rorl	$5,%r13d
+	xorl	%eax,%r14d
+	andl	%r8d,%r12d
+	xorl	%r8d,%r13d
+	addl	32(%rsp),%r11d
+	movl	%eax,%r15d
+	xorl	%r10d,%r12d
+	rorl	$11,%r14d
+	xorl	%ebx,%r15d
+	addl	%r12d,%r11d
+	rorl	$6,%r13d
+	andl	%r15d,%edi
+	xorl	%eax,%r14d
+	addl	%r13d,%r11d
+	xorl	%ebx,%edi
+	rorl	$2,%r14d
+	addl	%r11d,%edx
+	addl	%edi,%r11d
+	movl	%edx,%r13d
+	addl	%r11d,%r14d
+	rorl	$14,%r13d
+	movl	%r14d,%r11d
+	movl	%r8d,%r12d
+	rorl	$9,%r14d
+	xorl	%edx,%r13d
+	xorl	%r9d,%r12d
+	rorl	$5,%r13d
+	xorl	%r11d,%r14d
+	andl	%edx,%r12d
+	xorl	%edx,%r13d
+	addl	36(%rsp),%r10d
+	movl	%r11d,%edi
+	xorl	%r9d,%r12d
+	rorl	$11,%r14d
+	xorl	%eax,%edi
+	addl	%r12d,%r10d
+	rorl	$6,%r13d
+	andl	%edi,%r15d
+	xorl	%r11d,%r14d
+	addl	%r13d,%r10d
+	xorl	%eax,%r15d
+	rorl	$2,%r14d
+	addl	%r10d,%ecx
+	addl	%r15d,%r10d
+	movl	%ecx,%r13d
+	addl	%r10d,%r14d
+	rorl	$14,%r13d
+	movl	%r14d,%r10d
+	movl	%edx,%r12d
+	rorl	$9,%r14d
+	xorl	%ecx,%r13d
+	xorl	%r8d,%r12d
+	rorl	$5,%r13d
+	xorl	%r10d,%r14d
+	andl	%ecx,%r12d
+	xorl	%ecx,%r13d
+	addl	40(%rsp),%r9d
+	movl	%r10d,%r15d
+	xorl	%r8d,%r12d
+	rorl	$11,%r14d
+	xorl	%r11d,%r15d
+	addl	%r12d,%r9d
+	rorl	$6,%r13d
+	andl	%r15d,%edi
+	xorl	%r10d,%r14d
+	addl	%r13d,%r9d
+	xorl	%r11d,%edi
+	rorl	$2,%r14d
+	addl	%r9d,%ebx
+	addl	%edi,%r9d
+	movl	%ebx,%r13d
+	addl	%r9d,%r14d
+	rorl	$14,%r13d
+	movl	%r14d,%r9d
+	movl	%ecx,%r12d
+	rorl	$9,%r14d
+	xorl	%ebx,%r13d
+	xorl	%edx,%r12d
+	rorl	$5,%r13d
+	xorl	%r9d,%r14d
+	andl	%ebx,%r12d
+	xorl	%ebx,%r13d
+	addl	44(%rsp),%r8d
+	movl	%r9d,%edi
+	xorl	%edx,%r12d
+	rorl	$11,%r14d
+	xorl	%r10d,%edi
+	addl	%r12d,%r8d
+	rorl	$6,%r13d
+	andl	%edi,%r15d
+	xorl	%r9d,%r14d
+	addl	%r13d,%r8d
+	xorl	%r10d,%r15d
+	rorl	$2,%r14d
+	addl	%r8d,%eax
+	addl	%r15d,%r8d
+	movl	%eax,%r13d
+	addl	%r8d,%r14d
+	rorl	$14,%r13d
+	movl	%r14d,%r8d
+	movl	%ebx,%r12d
+	rorl	$9,%r14d
+	xorl	%eax,%r13d
+	xorl	%ecx,%r12d
+	rorl	$5,%r13d
+	xorl	%r8d,%r14d
+	andl	%eax,%r12d
+	xorl	%eax,%r13d
+	addl	48(%rsp),%edx
+	movl	%r8d,%r15d
+	xorl	%ecx,%r12d
+	rorl	$11,%r14d
+	xorl	%r9d,%r15d
+	addl	%r12d,%edx
+	rorl	$6,%r13d
+	andl	%r15d,%edi
+	xorl	%r8d,%r14d
+	addl	%r13d,%edx
+	xorl	%r9d,%edi
+	rorl	$2,%r14d
+	addl	%edx,%r11d
+	addl	%edi,%edx
+	movl	%r11d,%r13d
+	addl	%edx,%r14d
+	rorl	$14,%r13d
+	movl	%r14d,%edx
+	movl	%eax,%r12d
+	rorl	$9,%r14d
+	xorl	%r11d,%r13d
+	xorl	%ebx,%r12d
+	rorl	$5,%r13d
+	xorl	%edx,%r14d
+	andl	%r11d,%r12d
+	xorl	%r11d,%r13d
+	addl	52(%rsp),%ecx
+	movl	%edx,%edi
+	xorl	%ebx,%r12d
+	rorl	$11,%r14d
+	xorl	%r8d,%edi
+	addl	%r12d,%ecx
+	rorl	$6,%r13d
+	andl	%edi,%r15d
+	xorl	%edx,%r14d
+	addl	%r13d,%ecx
+	xorl	%r8d,%r15d
+	rorl	$2,%r14d
+	addl	%ecx,%r10d
+	addl	%r15d,%ecx
+	movl	%r10d,%r13d
+	addl	%ecx,%r14d
+	rorl	$14,%r13d
+	movl	%r14d,%ecx
+	movl	%r11d,%r12d
+	rorl	$9,%r14d
+	xorl	%r10d,%r13d
+	xorl	%eax,%r12d
+	rorl	$5,%r13d
+	xorl	%ecx,%r14d
+	andl	%r10d,%r12d
+	xorl	%r10d,%r13d
+	addl	56(%rsp),%ebx
+	movl	%ecx,%r15d
+	xorl	%eax,%r12d
+	rorl	$11,%r14d
+	xorl	%edx,%r15d
+	addl	%r12d,%ebx
+	rorl	$6,%r13d
+	andl	%r15d,%edi
+	xorl	%ecx,%r14d
+	addl	%r13d,%ebx
+	xorl	%edx,%edi
+	rorl	$2,%r14d
+	addl	%ebx,%r9d
+	addl	%edi,%ebx
+	movl	%r9d,%r13d
+	addl	%ebx,%r14d
+	rorl	$14,%r13d
+	movl	%r14d,%ebx
+	movl	%r10d,%r12d
+	rorl	$9,%r14d
+	xorl	%r9d,%r13d
+	xorl	%r11d,%r12d
+	rorl	$5,%r13d
+	xorl	%ebx,%r14d
+	andl	%r9d,%r12d
+	xorl	%r9d,%r13d
+	addl	60(%rsp),%eax
+	movl	%ebx,%edi
+	xorl	%r11d,%r12d
+	rorl	$11,%r14d
+	xorl	%ecx,%edi
+	addl	%r12d,%eax
+	rorl	$6,%r13d
+	andl	%edi,%r15d
+	xorl	%ebx,%r14d
+	addl	%r13d,%eax
+	xorl	%ecx,%r15d
+	rorl	$2,%r14d
+	addl	%eax,%r8d
+	addl	%r15d,%eax
+	movl	%r8d,%r13d
+	addl	%eax,%r14d
+	movq	64+0(%rsp),%rdi
+	movl	%r14d,%eax
+
+	addl	0(%rdi),%eax
+	leaq	64(%rsi),%rsi
+	addl	4(%rdi),%ebx
+	addl	8(%rdi),%ecx
+	addl	12(%rdi),%edx
+	addl	16(%rdi),%r8d
+	addl	20(%rdi),%r9d
+	addl	24(%rdi),%r10d
+	addl	28(%rdi),%r11d
+
+	cmpq	64+16(%rsp),%rsi
+
+	movl	%eax,0(%rdi)
+	movl	%ebx,4(%rdi)
+	movl	%ecx,8(%rdi)
+	movl	%edx,12(%rdi)
+	movl	%r8d,16(%rdi)
+	movl	%r9d,20(%rdi)
+	movl	%r10d,24(%rdi)
+	movl	%r11d,28(%rdi)
+	jb	.Lloop_ssse3
+
+	movq	64+24(%rsp),%rsi
+	movq	(%rsi),%r15
+	movq	8(%rsi),%r14
+	movq	16(%rsi),%r13
+	movq	24(%rsi),%r12
+	movq	32(%rsi),%rbp
+	movq	40(%rsi),%rbx
+	leaq	48(%rsi),%rsp
+.Lepilogue_ssse3:
+	.byte	0xf3,0xc3
+.size	sha256_block_data_order_ssse3,.-sha256_block_data_order_ssse3
+#endif
diff --git a/third_party/boringssl/linux-x86_64/crypto/sha/sha512-x86_64.S b/third_party/boringssl/linux-x86_64/crypto/sha/sha512-x86_64.S
new file mode 100644
index 0000000..ca3a3a1
--- /dev/null
+++ b/third_party/boringssl/linux-x86_64/crypto/sha/sha512-x86_64.S
@@ -0,0 +1,1787 @@
+#if defined(__x86_64__)
+.text	
+
+.extern	OPENSSL_ia32cap_P
+.hidden OPENSSL_ia32cap_P
+.globl	sha512_block_data_order
+.hidden sha512_block_data_order
+.type	sha512_block_data_order,@function
+.align	16
+sha512_block_data_order:
+	pushq	%rbx
+	pushq	%rbp
+	pushq	%r12
+	pushq	%r13
+	pushq	%r14
+	pushq	%r15
+	movq	%rsp,%r11
+	shlq	$4,%rdx
+	subq	$128+32,%rsp
+	leaq	(%rsi,%rdx,8),%rdx
+	andq	$-64,%rsp
+	movq	%rdi,128+0(%rsp)
+	movq	%rsi,128+8(%rsp)
+	movq	%rdx,128+16(%rsp)
+	movq	%r11,128+24(%rsp)
+.Lprologue:
+
+	movq	0(%rdi),%rax
+	movq	8(%rdi),%rbx
+	movq	16(%rdi),%rcx
+	movq	24(%rdi),%rdx
+	movq	32(%rdi),%r8
+	movq	40(%rdi),%r9
+	movq	48(%rdi),%r10
+	movq	56(%rdi),%r11
+	jmp	.Lloop
+
+.align	16
+.Lloop:
+	movq	%rbx,%rdi
+	leaq	K512(%rip),%rbp
+	xorq	%rcx,%rdi
+	movq	0(%rsi),%r12
+	movq	%r8,%r13
+	movq	%rax,%r14
+	bswapq	%r12
+	rorq	$23,%r13
+	movq	%r9,%r15
+
+	xorq	%r8,%r13
+	rorq	$5,%r14
+	xorq	%r10,%r15
+
+	movq	%r12,0(%rsp)
+	xorq	%rax,%r14
+	andq	%r8,%r15
+
+	rorq	$4,%r13
+	addq	%r11,%r12
+	xorq	%r10,%r15
+
+	rorq	$6,%r14
+	xorq	%r8,%r13
+	addq	%r15,%r12
+
+	movq	%rax,%r15
+	addq	(%rbp),%r12
+	xorq	%rax,%r14
+
+	xorq	%rbx,%r15
+	rorq	$14,%r13
+	movq	%rbx,%r11
+
+	andq	%r15,%rdi
+	rorq	$28,%r14
+	addq	%r13,%r12
+
+	xorq	%rdi,%r11
+	addq	%r12,%rdx
+	addq	%r12,%r11
+
+	leaq	8(%rbp),%rbp
+	addq	%r14,%r11
+	movq	8(%rsi),%r12
+	movq	%rdx,%r13
+	movq	%r11,%r14
+	bswapq	%r12
+	rorq	$23,%r13
+	movq	%r8,%rdi
+
+	xorq	%rdx,%r13
+	rorq	$5,%r14
+	xorq	%r9,%rdi
+
+	movq	%r12,8(%rsp)
+	xorq	%r11,%r14
+	andq	%rdx,%rdi
+
+	rorq	$4,%r13
+	addq	%r10,%r12
+	xorq	%r9,%rdi
+
+	rorq	$6,%r14
+	xorq	%rdx,%r13
+	addq	%rdi,%r12
+
+	movq	%r11,%rdi
+	addq	(%rbp),%r12
+	xorq	%r11,%r14
+
+	xorq	%rax,%rdi
+	rorq	$14,%r13
+	movq	%rax,%r10
+
+	andq	%rdi,%r15
+	rorq	$28,%r14
+	addq	%r13,%r12
+
+	xorq	%r15,%r10
+	addq	%r12,%rcx
+	addq	%r12,%r10
+
+	leaq	24(%rbp),%rbp
+	addq	%r14,%r10
+	movq	16(%rsi),%r12
+	movq	%rcx,%r13
+	movq	%r10,%r14
+	bswapq	%r12
+	rorq	$23,%r13
+	movq	%rdx,%r15
+
+	xorq	%rcx,%r13
+	rorq	$5,%r14
+	xorq	%r8,%r15
+
+	movq	%r12,16(%rsp)
+	xorq	%r10,%r14
+	andq	%rcx,%r15
+
+	rorq	$4,%r13
+	addq	%r9,%r12
+	xorq	%r8,%r15
+
+	rorq	$6,%r14
+	xorq	%rcx,%r13
+	addq	%r15,%r12
+
+	movq	%r10,%r15
+	addq	(%rbp),%r12
+	xorq	%r10,%r14
+
+	xorq	%r11,%r15
+	rorq	$14,%r13
+	movq	%r11,%r9
+
+	andq	%r15,%rdi
+	rorq	$28,%r14
+	addq	%r13,%r12
+
+	xorq	%rdi,%r9
+	addq	%r12,%rbx
+	addq	%r12,%r9
+
+	leaq	8(%rbp),%rbp
+	addq	%r14,%r9
+	movq	24(%rsi),%r12
+	movq	%rbx,%r13
+	movq	%r9,%r14
+	bswapq	%r12
+	rorq	$23,%r13
+	movq	%rcx,%rdi
+
+	xorq	%rbx,%r13
+	rorq	$5,%r14
+	xorq	%rdx,%rdi
+
+	movq	%r12,24(%rsp)
+	xorq	%r9,%r14
+	andq	%rbx,%rdi
+
+	rorq	$4,%r13
+	addq	%r8,%r12
+	xorq	%rdx,%rdi
+
+	rorq	$6,%r14
+	xorq	%rbx,%r13
+	addq	%rdi,%r12
+
+	movq	%r9,%rdi
+	addq	(%rbp),%r12
+	xorq	%r9,%r14
+
+	xorq	%r10,%rdi
+	rorq	$14,%r13
+	movq	%r10,%r8
+
+	andq	%rdi,%r15
+	rorq	$28,%r14
+	addq	%r13,%r12
+
+	xorq	%r15,%r8
+	addq	%r12,%rax
+	addq	%r12,%r8
+
+	leaq	24(%rbp),%rbp
+	addq	%r14,%r8
+	movq	32(%rsi),%r12
+	movq	%rax,%r13
+	movq	%r8,%r14
+	bswapq	%r12
+	rorq	$23,%r13
+	movq	%rbx,%r15
+
+	xorq	%rax,%r13
+	rorq	$5,%r14
+	xorq	%rcx,%r15
+
+	movq	%r12,32(%rsp)
+	xorq	%r8,%r14
+	andq	%rax,%r15
+
+	rorq	$4,%r13
+	addq	%rdx,%r12
+	xorq	%rcx,%r15
+
+	rorq	$6,%r14
+	xorq	%rax,%r13
+	addq	%r15,%r12
+
+	movq	%r8,%r15
+	addq	(%rbp),%r12
+	xorq	%r8,%r14
+
+	xorq	%r9,%r15
+	rorq	$14,%r13
+	movq	%r9,%rdx
+
+	andq	%r15,%rdi
+	rorq	$28,%r14
+	addq	%r13,%r12
+
+	xorq	%rdi,%rdx
+	addq	%r12,%r11
+	addq	%r12,%rdx
+
+	leaq	8(%rbp),%rbp
+	addq	%r14,%rdx
+	movq	40(%rsi),%r12
+	movq	%r11,%r13
+	movq	%rdx,%r14
+	bswapq	%r12
+	rorq	$23,%r13
+	movq	%rax,%rdi
+
+	xorq	%r11,%r13
+	rorq	$5,%r14
+	xorq	%rbx,%rdi
+
+	movq	%r12,40(%rsp)
+	xorq	%rdx,%r14
+	andq	%r11,%rdi
+
+	rorq	$4,%r13
+	addq	%rcx,%r12
+	xorq	%rbx,%rdi
+
+	rorq	$6,%r14
+	xorq	%r11,%r13
+	addq	%rdi,%r12
+
+	movq	%rdx,%rdi
+	addq	(%rbp),%r12
+	xorq	%rdx,%r14
+
+	xorq	%r8,%rdi
+	rorq	$14,%r13
+	movq	%r8,%rcx
+
+	andq	%rdi,%r15
+	rorq	$28,%r14
+	addq	%r13,%r12
+
+	xorq	%r15,%rcx
+	addq	%r12,%r10
+	addq	%r12,%rcx
+
+	leaq	24(%rbp),%rbp
+	addq	%r14,%rcx
+	movq	48(%rsi),%r12
+	movq	%r10,%r13
+	movq	%rcx,%r14
+	bswapq	%r12
+	rorq	$23,%r13
+	movq	%r11,%r15
+
+	xorq	%r10,%r13
+	rorq	$5,%r14
+	xorq	%rax,%r15
+
+	movq	%r12,48(%rsp)
+	xorq	%rcx,%r14
+	andq	%r10,%r15
+
+	rorq	$4,%r13
+	addq	%rbx,%r12
+	xorq	%rax,%r15
+
+	rorq	$6,%r14
+	xorq	%r10,%r13
+	addq	%r15,%r12
+
+	movq	%rcx,%r15
+	addq	(%rbp),%r12
+	xorq	%rcx,%r14
+
+	xorq	%rdx,%r15
+	rorq	$14,%r13
+	movq	%rdx,%rbx
+
+	andq	%r15,%rdi
+	rorq	$28,%r14
+	addq	%r13,%r12
+
+	xorq	%rdi,%rbx
+	addq	%r12,%r9
+	addq	%r12,%rbx
+
+	leaq	8(%rbp),%rbp
+	addq	%r14,%rbx
+	movq	56(%rsi),%r12
+	movq	%r9,%r13
+	movq	%rbx,%r14
+	bswapq	%r12
+	rorq	$23,%r13
+	movq	%r10,%rdi
+
+	xorq	%r9,%r13
+	rorq	$5,%r14
+	xorq	%r11,%rdi
+
+	movq	%r12,56(%rsp)
+	xorq	%rbx,%r14
+	andq	%r9,%rdi
+
+	rorq	$4,%r13
+	addq	%rax,%r12
+	xorq	%r11,%rdi
+
+	rorq	$6,%r14
+	xorq	%r9,%r13
+	addq	%rdi,%r12
+
+	movq	%rbx,%rdi
+	addq	(%rbp),%r12
+	xorq	%rbx,%r14
+
+	xorq	%rcx,%rdi
+	rorq	$14,%r13
+	movq	%rcx,%rax
+
+	andq	%rdi,%r15
+	rorq	$28,%r14
+	addq	%r13,%r12
+
+	xorq	%r15,%rax
+	addq	%r12,%r8
+	addq	%r12,%rax
+
+	leaq	24(%rbp),%rbp
+	addq	%r14,%rax
+	movq	64(%rsi),%r12
+	movq	%r8,%r13
+	movq	%rax,%r14
+	bswapq	%r12
+	rorq	$23,%r13
+	movq	%r9,%r15
+
+	xorq	%r8,%r13
+	rorq	$5,%r14
+	xorq	%r10,%r15
+
+	movq	%r12,64(%rsp)
+	xorq	%rax,%r14
+	andq	%r8,%r15
+
+	rorq	$4,%r13
+	addq	%r11,%r12
+	xorq	%r10,%r15
+
+	rorq	$6,%r14
+	xorq	%r8,%r13
+	addq	%r15,%r12
+
+	movq	%rax,%r15
+	addq	(%rbp),%r12
+	xorq	%rax,%r14
+
+	xorq	%rbx,%r15
+	rorq	$14,%r13
+	movq	%rbx,%r11
+
+	andq	%r15,%rdi
+	rorq	$28,%r14
+	addq	%r13,%r12
+
+	xorq	%rdi,%r11
+	addq	%r12,%rdx
+	addq	%r12,%r11
+
+	leaq	8(%rbp),%rbp
+	addq	%r14,%r11
+	movq	72(%rsi),%r12
+	movq	%rdx,%r13
+	movq	%r11,%r14
+	bswapq	%r12
+	rorq	$23,%r13
+	movq	%r8,%rdi
+
+	xorq	%rdx,%r13
+	rorq	$5,%r14
+	xorq	%r9,%rdi
+
+	movq	%r12,72(%rsp)
+	xorq	%r11,%r14
+	andq	%rdx,%rdi
+
+	rorq	$4,%r13
+	addq	%r10,%r12
+	xorq	%r9,%rdi
+
+	rorq	$6,%r14
+	xorq	%rdx,%r13
+	addq	%rdi,%r12
+
+	movq	%r11,%rdi
+	addq	(%rbp),%r12
+	xorq	%r11,%r14
+
+	xorq	%rax,%rdi
+	rorq	$14,%r13
+	movq	%rax,%r10
+
+	andq	%rdi,%r15
+	rorq	$28,%r14
+	addq	%r13,%r12
+
+	xorq	%r15,%r10
+	addq	%r12,%rcx
+	addq	%r12,%r10
+
+	leaq	24(%rbp),%rbp
+	addq	%r14,%r10
+	movq	80(%rsi),%r12
+	movq	%rcx,%r13
+	movq	%r10,%r14
+	bswapq	%r12
+	rorq	$23,%r13
+	movq	%rdx,%r15
+
+	xorq	%rcx,%r13
+	rorq	$5,%r14
+	xorq	%r8,%r15
+
+	movq	%r12,80(%rsp)
+	xorq	%r10,%r14
+	andq	%rcx,%r15
+
+	rorq	$4,%r13
+	addq	%r9,%r12
+	xorq	%r8,%r15
+
+	rorq	$6,%r14
+	xorq	%rcx,%r13
+	addq	%r15,%r12
+
+	movq	%r10,%r15
+	addq	(%rbp),%r12
+	xorq	%r10,%r14
+
+	xorq	%r11,%r15
+	rorq	$14,%r13
+	movq	%r11,%r9
+
+	andq	%r15,%rdi
+	rorq	$28,%r14
+	addq	%r13,%r12
+
+	xorq	%rdi,%r9
+	addq	%r12,%rbx
+	addq	%r12,%r9
+
+	leaq	8(%rbp),%rbp
+	addq	%r14,%r9
+	movq	88(%rsi),%r12
+	movq	%rbx,%r13
+	movq	%r9,%r14
+	bswapq	%r12
+	rorq	$23,%r13
+	movq	%rcx,%rdi
+
+	xorq	%rbx,%r13
+	rorq	$5,%r14
+	xorq	%rdx,%rdi
+
+	movq	%r12,88(%rsp)
+	xorq	%r9,%r14
+	andq	%rbx,%rdi
+
+	rorq	$4,%r13
+	addq	%r8,%r12
+	xorq	%rdx,%rdi
+
+	rorq	$6,%r14
+	xorq	%rbx,%r13
+	addq	%rdi,%r12
+
+	movq	%r9,%rdi
+	addq	(%rbp),%r12
+	xorq	%r9,%r14
+
+	xorq	%r10,%rdi
+	rorq	$14,%r13
+	movq	%r10,%r8
+
+	andq	%rdi,%r15
+	rorq	$28,%r14
+	addq	%r13,%r12
+
+	xorq	%r15,%r8
+	addq	%r12,%rax
+	addq	%r12,%r8
+
+	leaq	24(%rbp),%rbp
+	addq	%r14,%r8
+	movq	96(%rsi),%r12
+	movq	%rax,%r13
+	movq	%r8,%r14
+	bswapq	%r12
+	rorq	$23,%r13
+	movq	%rbx,%r15
+
+	xorq	%rax,%r13
+	rorq	$5,%r14
+	xorq	%rcx,%r15
+
+	movq	%r12,96(%rsp)
+	xorq	%r8,%r14
+	andq	%rax,%r15
+
+	rorq	$4,%r13
+	addq	%rdx,%r12
+	xorq	%rcx,%r15
+
+	rorq	$6,%r14
+	xorq	%rax,%r13
+	addq	%r15,%r12
+
+	movq	%r8,%r15
+	addq	(%rbp),%r12
+	xorq	%r8,%r14
+
+	xorq	%r9,%r15
+	rorq	$14,%r13
+	movq	%r9,%rdx
+
+	andq	%r15,%rdi
+	rorq	$28,%r14
+	addq	%r13,%r12
+
+	xorq	%rdi,%rdx
+	addq	%r12,%r11
+	addq	%r12,%rdx
+
+	leaq	8(%rbp),%rbp
+	addq	%r14,%rdx
+	movq	104(%rsi),%r12
+	movq	%r11,%r13
+	movq	%rdx,%r14
+	bswapq	%r12
+	rorq	$23,%r13
+	movq	%rax,%rdi
+
+	xorq	%r11,%r13
+	rorq	$5,%r14
+	xorq	%rbx,%rdi
+
+	movq	%r12,104(%rsp)
+	xorq	%rdx,%r14
+	andq	%r11,%rdi
+
+	rorq	$4,%r13
+	addq	%rcx,%r12
+	xorq	%rbx,%rdi
+
+	rorq	$6,%r14
+	xorq	%r11,%r13
+	addq	%rdi,%r12
+
+	movq	%rdx,%rdi
+	addq	(%rbp),%r12
+	xorq	%rdx,%r14
+
+	xorq	%r8,%rdi
+	rorq	$14,%r13
+	movq	%r8,%rcx
+
+	andq	%rdi,%r15
+	rorq	$28,%r14
+	addq	%r13,%r12
+
+	xorq	%r15,%rcx
+	addq	%r12,%r10
+	addq	%r12,%rcx
+
+	leaq	24(%rbp),%rbp
+	addq	%r14,%rcx
+	movq	112(%rsi),%r12
+	movq	%r10,%r13
+	movq	%rcx,%r14
+	bswapq	%r12
+	rorq	$23,%r13
+	movq	%r11,%r15
+
+	xorq	%r10,%r13
+	rorq	$5,%r14
+	xorq	%rax,%r15
+
+	movq	%r12,112(%rsp)
+	xorq	%rcx,%r14
+	andq	%r10,%r15
+
+	rorq	$4,%r13
+	addq	%rbx,%r12
+	xorq	%rax,%r15
+
+	rorq	$6,%r14
+	xorq	%r10,%r13
+	addq	%r15,%r12
+
+	movq	%rcx,%r15
+	addq	(%rbp),%r12
+	xorq	%rcx,%r14
+
+	xorq	%rdx,%r15
+	rorq	$14,%r13
+	movq	%rdx,%rbx
+
+	andq	%r15,%rdi
+	rorq	$28,%r14
+	addq	%r13,%r12
+
+	xorq	%rdi,%rbx
+	addq	%r12,%r9
+	addq	%r12,%rbx
+
+	leaq	8(%rbp),%rbp
+	addq	%r14,%rbx
+	movq	120(%rsi),%r12
+	movq	%r9,%r13
+	movq	%rbx,%r14
+	bswapq	%r12
+	rorq	$23,%r13
+	movq	%r10,%rdi
+
+	xorq	%r9,%r13
+	rorq	$5,%r14
+	xorq	%r11,%rdi
+
+	movq	%r12,120(%rsp)
+	xorq	%rbx,%r14
+	andq	%r9,%rdi
+
+	rorq	$4,%r13
+	addq	%rax,%r12
+	xorq	%r11,%rdi
+
+	rorq	$6,%r14
+	xorq	%r9,%r13
+	addq	%rdi,%r12
+
+	movq	%rbx,%rdi
+	addq	(%rbp),%r12
+	xorq	%rbx,%r14
+
+	xorq	%rcx,%rdi
+	rorq	$14,%r13
+	movq	%rcx,%rax
+
+	andq	%rdi,%r15
+	rorq	$28,%r14
+	addq	%r13,%r12
+
+	xorq	%r15,%rax
+	addq	%r12,%r8
+	addq	%r12,%rax
+
+	leaq	24(%rbp),%rbp
+	jmp	.Lrounds_16_xx
+.align	16
+.Lrounds_16_xx:
+	movq	8(%rsp),%r13
+	movq	112(%rsp),%r15
+
+	movq	%r13,%r12
+	rorq	$7,%r13
+	addq	%r14,%rax
+	movq	%r15,%r14
+	rorq	$42,%r15
+
+	xorq	%r12,%r13
+	shrq	$7,%r12
+	rorq	$1,%r13
+	xorq	%r14,%r15
+	shrq	$6,%r14
+
+	rorq	$19,%r15
+	xorq	%r13,%r12
+	xorq	%r14,%r15
+	addq	72(%rsp),%r12
+
+	addq	0(%rsp),%r12
+	movq	%r8,%r13
+	addq	%r15,%r12
+	movq	%rax,%r14
+	rorq	$23,%r13
+	movq	%r9,%r15
+
+	xorq	%r8,%r13
+	rorq	$5,%r14
+	xorq	%r10,%r15
+
+	movq	%r12,0(%rsp)
+	xorq	%rax,%r14
+	andq	%r8,%r15
+
+	rorq	$4,%r13
+	addq	%r11,%r12
+	xorq	%r10,%r15
+
+	rorq	$6,%r14
+	xorq	%r8,%r13
+	addq	%r15,%r12
+
+	movq	%rax,%r15
+	addq	(%rbp),%r12
+	xorq	%rax,%r14
+
+	xorq	%rbx,%r15
+	rorq	$14,%r13
+	movq	%rbx,%r11
+
+	andq	%r15,%rdi
+	rorq	$28,%r14
+	addq	%r13,%r12
+
+	xorq	%rdi,%r11
+	addq	%r12,%rdx
+	addq	%r12,%r11
+
+	leaq	8(%rbp),%rbp
+	movq	16(%rsp),%r13
+	movq	120(%rsp),%rdi
+
+	movq	%r13,%r12
+	rorq	$7,%r13
+	addq	%r14,%r11
+	movq	%rdi,%r14
+	rorq	$42,%rdi
+
+	xorq	%r12,%r13
+	shrq	$7,%r12
+	rorq	$1,%r13
+	xorq	%r14,%rdi
+	shrq	$6,%r14
+
+	rorq	$19,%rdi
+	xorq	%r13,%r12
+	xorq	%r14,%rdi
+	addq	80(%rsp),%r12
+
+	addq	8(%rsp),%r12
+	movq	%rdx,%r13
+	addq	%rdi,%r12
+	movq	%r11,%r14
+	rorq	$23,%r13
+	movq	%r8,%rdi
+
+	xorq	%rdx,%r13
+	rorq	$5,%r14
+	xorq	%r9,%rdi
+
+	movq	%r12,8(%rsp)
+	xorq	%r11,%r14
+	andq	%rdx,%rdi
+
+	rorq	$4,%r13
+	addq	%r10,%r12
+	xorq	%r9,%rdi
+
+	rorq	$6,%r14
+	xorq	%rdx,%r13
+	addq	%rdi,%r12
+
+	movq	%r11,%rdi
+	addq	(%rbp),%r12
+	xorq	%r11,%r14
+
+	xorq	%rax,%rdi
+	rorq	$14,%r13
+	movq	%rax,%r10
+
+	andq	%rdi,%r15
+	rorq	$28,%r14
+	addq	%r13,%r12
+
+	xorq	%r15,%r10
+	addq	%r12,%rcx
+	addq	%r12,%r10
+
+	leaq	24(%rbp),%rbp
+	movq	24(%rsp),%r13
+	movq	0(%rsp),%r15
+
+	movq	%r13,%r12
+	rorq	$7,%r13
+	addq	%r14,%r10
+	movq	%r15,%r14
+	rorq	$42,%r15
+
+	xorq	%r12,%r13
+	shrq	$7,%r12
+	rorq	$1,%r13
+	xorq	%r14,%r15
+	shrq	$6,%r14
+
+	rorq	$19,%r15
+	xorq	%r13,%r12
+	xorq	%r14,%r15
+	addq	88(%rsp),%r12
+
+	addq	16(%rsp),%r12
+	movq	%rcx,%r13
+	addq	%r15,%r12
+	movq	%r10,%r14
+	rorq	$23,%r13
+	movq	%rdx,%r15
+
+	xorq	%rcx,%r13
+	rorq	$5,%r14
+	xorq	%r8,%r15
+
+	movq	%r12,16(%rsp)
+	xorq	%r10,%r14
+	andq	%rcx,%r15
+
+	rorq	$4,%r13
+	addq	%r9,%r12
+	xorq	%r8,%r15
+
+	rorq	$6,%r14
+	xorq	%rcx,%r13
+	addq	%r15,%r12
+
+	movq	%r10,%r15
+	addq	(%rbp),%r12
+	xorq	%r10,%r14
+
+	xorq	%r11,%r15
+	rorq	$14,%r13
+	movq	%r11,%r9
+
+	andq	%r15,%rdi
+	rorq	$28,%r14
+	addq	%r13,%r12
+
+	xorq	%rdi,%r9
+	addq	%r12,%rbx
+	addq	%r12,%r9
+
+	leaq	8(%rbp),%rbp
+	movq	32(%rsp),%r13
+	movq	8(%rsp),%rdi
+
+	movq	%r13,%r12
+	rorq	$7,%r13
+	addq	%r14,%r9
+	movq	%rdi,%r14
+	rorq	$42,%rdi
+
+	xorq	%r12,%r13
+	shrq	$7,%r12
+	rorq	$1,%r13
+	xorq	%r14,%rdi
+	shrq	$6,%r14
+
+	rorq	$19,%rdi
+	xorq	%r13,%r12
+	xorq	%r14,%rdi
+	addq	96(%rsp),%r12
+
+	addq	24(%rsp),%r12
+	movq	%rbx,%r13
+	addq	%rdi,%r12
+	movq	%r9,%r14
+	rorq	$23,%r13
+	movq	%rcx,%rdi
+
+	xorq	%rbx,%r13
+	rorq	$5,%r14
+	xorq	%rdx,%rdi
+
+	movq	%r12,24(%rsp)
+	xorq	%r9,%r14
+	andq	%rbx,%rdi
+
+	rorq	$4,%r13
+	addq	%r8,%r12
+	xorq	%rdx,%rdi
+
+	rorq	$6,%r14
+	xorq	%rbx,%r13
+	addq	%rdi,%r12
+
+	movq	%r9,%rdi
+	addq	(%rbp),%r12
+	xorq	%r9,%r14
+
+	xorq	%r10,%rdi
+	rorq	$14,%r13
+	movq	%r10,%r8
+
+	andq	%rdi,%r15
+	rorq	$28,%r14
+	addq	%r13,%r12
+
+	xorq	%r15,%r8
+	addq	%r12,%rax
+	addq	%r12,%r8
+
+	leaq	24(%rbp),%rbp
+	movq	40(%rsp),%r13
+	movq	16(%rsp),%r15
+
+	movq	%r13,%r12
+	rorq	$7,%r13
+	addq	%r14,%r8
+	movq	%r15,%r14
+	rorq	$42,%r15
+
+	xorq	%r12,%r13
+	shrq	$7,%r12
+	rorq	$1,%r13
+	xorq	%r14,%r15
+	shrq	$6,%r14
+
+	rorq	$19,%r15
+	xorq	%r13,%r12
+	xorq	%r14,%r15
+	addq	104(%rsp),%r12
+
+	addq	32(%rsp),%r12
+	movq	%rax,%r13
+	addq	%r15,%r12
+	movq	%r8,%r14
+	rorq	$23,%r13
+	movq	%rbx,%r15
+
+	xorq	%rax,%r13
+	rorq	$5,%r14
+	xorq	%rcx,%r15
+
+	movq	%r12,32(%rsp)
+	xorq	%r8,%r14
+	andq	%rax,%r15
+
+	rorq	$4,%r13
+	addq	%rdx,%r12
+	xorq	%rcx,%r15
+
+	rorq	$6,%r14
+	xorq	%rax,%r13
+	addq	%r15,%r12
+
+	movq	%r8,%r15
+	addq	(%rbp),%r12
+	xorq	%r8,%r14
+
+	xorq	%r9,%r15
+	rorq	$14,%r13
+	movq	%r9,%rdx
+
+	andq	%r15,%rdi
+	rorq	$28,%r14
+	addq	%r13,%r12
+
+	xorq	%rdi,%rdx
+	addq	%r12,%r11
+	addq	%r12,%rdx
+
+	leaq	8(%rbp),%rbp
+	movq	48(%rsp),%r13
+	movq	24(%rsp),%rdi
+
+	movq	%r13,%r12
+	rorq	$7,%r13
+	addq	%r14,%rdx
+	movq	%rdi,%r14
+	rorq	$42,%rdi
+
+	xorq	%r12,%r13
+	shrq	$7,%r12
+	rorq	$1,%r13
+	xorq	%r14,%rdi
+	shrq	$6,%r14
+
+	rorq	$19,%rdi
+	xorq	%r13,%r12
+	xorq	%r14,%rdi
+	addq	112(%rsp),%r12
+
+	addq	40(%rsp),%r12
+	movq	%r11,%r13
+	addq	%rdi,%r12
+	movq	%rdx,%r14
+	rorq	$23,%r13
+	movq	%rax,%rdi
+
+	xorq	%r11,%r13
+	rorq	$5,%r14
+	xorq	%rbx,%rdi
+
+	movq	%r12,40(%rsp)
+	xorq	%rdx,%r14
+	andq	%r11,%rdi
+
+	rorq	$4,%r13
+	addq	%rcx,%r12
+	xorq	%rbx,%rdi
+
+	rorq	$6,%r14
+	xorq	%r11,%r13
+	addq	%rdi,%r12
+
+	movq	%rdx,%rdi
+	addq	(%rbp),%r12
+	xorq	%rdx,%r14
+
+	xorq	%r8,%rdi
+	rorq	$14,%r13
+	movq	%r8,%rcx
+
+	andq	%rdi,%r15
+	rorq	$28,%r14
+	addq	%r13,%r12
+
+	xorq	%r15,%rcx
+	addq	%r12,%r10
+	addq	%r12,%rcx
+
+	leaq	24(%rbp),%rbp
+	movq	56(%rsp),%r13
+	movq	32(%rsp),%r15
+
+	movq	%r13,%r12
+	rorq	$7,%r13
+	addq	%r14,%rcx
+	movq	%r15,%r14
+	rorq	$42,%r15
+
+	xorq	%r12,%r13
+	shrq	$7,%r12
+	rorq	$1,%r13
+	xorq	%r14,%r15
+	shrq	$6,%r14
+
+	rorq	$19,%r15
+	xorq	%r13,%r12
+	xorq	%r14,%r15
+	addq	120(%rsp),%r12
+
+	addq	48(%rsp),%r12
+	movq	%r10,%r13
+	addq	%r15,%r12
+	movq	%rcx,%r14
+	rorq	$23,%r13
+	movq	%r11,%r15
+
+	xorq	%r10,%r13
+	rorq	$5,%r14
+	xorq	%rax,%r15
+
+	movq	%r12,48(%rsp)
+	xorq	%rcx,%r14
+	andq	%r10,%r15
+
+	rorq	$4,%r13
+	addq	%rbx,%r12
+	xorq	%rax,%r15
+
+	rorq	$6,%r14
+	xorq	%r10,%r13
+	addq	%r15,%r12
+
+	movq	%rcx,%r15
+	addq	(%rbp),%r12
+	xorq	%rcx,%r14
+
+	xorq	%rdx,%r15
+	rorq	$14,%r13
+	movq	%rdx,%rbx
+
+	andq	%r15,%rdi
+	rorq	$28,%r14
+	addq	%r13,%r12
+
+	xorq	%rdi,%rbx
+	addq	%r12,%r9
+	addq	%r12,%rbx
+
+	leaq	8(%rbp),%rbp
+	movq	64(%rsp),%r13
+	movq	40(%rsp),%rdi
+
+	movq	%r13,%r12
+	rorq	$7,%r13
+	addq	%r14,%rbx
+	movq	%rdi,%r14
+	rorq	$42,%rdi
+
+	xorq	%r12,%r13
+	shrq	$7,%r12
+	rorq	$1,%r13
+	xorq	%r14,%rdi
+	shrq	$6,%r14
+
+	rorq	$19,%rdi
+	xorq	%r13,%r12
+	xorq	%r14,%rdi
+	addq	0(%rsp),%r12
+
+	addq	56(%rsp),%r12
+	movq	%r9,%r13
+	addq	%rdi,%r12
+	movq	%rbx,%r14
+	rorq	$23,%r13
+	movq	%r10,%rdi
+
+	xorq	%r9,%r13
+	rorq	$5,%r14
+	xorq	%r11,%rdi
+
+	movq	%r12,56(%rsp)
+	xorq	%rbx,%r14
+	andq	%r9,%rdi
+
+	rorq	$4,%r13
+	addq	%rax,%r12
+	xorq	%r11,%rdi
+
+	rorq	$6,%r14
+	xorq	%r9,%r13
+	addq	%rdi,%r12
+
+	movq	%rbx,%rdi
+	addq	(%rbp),%r12
+	xorq	%rbx,%r14
+
+	xorq	%rcx,%rdi
+	rorq	$14,%r13
+	movq	%rcx,%rax
+
+	andq	%rdi,%r15
+	rorq	$28,%r14
+	addq	%r13,%r12
+
+	xorq	%r15,%rax
+	addq	%r12,%r8
+	addq	%r12,%rax
+
+	leaq	24(%rbp),%rbp
+	movq	72(%rsp),%r13
+	movq	48(%rsp),%r15
+
+	movq	%r13,%r12
+	rorq	$7,%r13
+	addq	%r14,%rax
+	movq	%r15,%r14
+	rorq	$42,%r15
+
+	xorq	%r12,%r13
+	shrq	$7,%r12
+	rorq	$1,%r13
+	xorq	%r14,%r15
+	shrq	$6,%r14
+
+	rorq	$19,%r15
+	xorq	%r13,%r12
+	xorq	%r14,%r15
+	addq	8(%rsp),%r12
+
+	addq	64(%rsp),%r12
+	movq	%r8,%r13
+	addq	%r15,%r12
+	movq	%rax,%r14
+	rorq	$23,%r13
+	movq	%r9,%r15
+
+	xorq	%r8,%r13
+	rorq	$5,%r14
+	xorq	%r10,%r15
+
+	movq	%r12,64(%rsp)
+	xorq	%rax,%r14
+	andq	%r8,%r15
+
+	rorq	$4,%r13
+	addq	%r11,%r12
+	xorq	%r10,%r15
+
+	rorq	$6,%r14
+	xorq	%r8,%r13
+	addq	%r15,%r12
+
+	movq	%rax,%r15
+	addq	(%rbp),%r12
+	xorq	%rax,%r14
+
+	xorq	%rbx,%r15
+	rorq	$14,%r13
+	movq	%rbx,%r11
+
+	andq	%r15,%rdi
+	rorq	$28,%r14
+	addq	%r13,%r12
+
+	xorq	%rdi,%r11
+	addq	%r12,%rdx
+	addq	%r12,%r11
+
+	leaq	8(%rbp),%rbp
+	movq	80(%rsp),%r13
+	movq	56(%rsp),%rdi
+
+	movq	%r13,%r12
+	rorq	$7,%r13
+	addq	%r14,%r11
+	movq	%rdi,%r14
+	rorq	$42,%rdi
+
+	xorq	%r12,%r13
+	shrq	$7,%r12
+	rorq	$1,%r13
+	xorq	%r14,%rdi
+	shrq	$6,%r14
+
+	rorq	$19,%rdi
+	xorq	%r13,%r12
+	xorq	%r14,%rdi
+	addq	16(%rsp),%r12
+
+	addq	72(%rsp),%r12
+	movq	%rdx,%r13
+	addq	%rdi,%r12
+	movq	%r11,%r14
+	rorq	$23,%r13
+	movq	%r8,%rdi
+
+	xorq	%rdx,%r13
+	rorq	$5,%r14
+	xorq	%r9,%rdi
+
+	movq	%r12,72(%rsp)
+	xorq	%r11,%r14
+	andq	%rdx,%rdi
+
+	rorq	$4,%r13
+	addq	%r10,%r12
+	xorq	%r9,%rdi
+
+	rorq	$6,%r14
+	xorq	%rdx,%r13
+	addq	%rdi,%r12
+
+	movq	%r11,%rdi
+	addq	(%rbp),%r12
+	xorq	%r11,%r14
+
+	xorq	%rax,%rdi
+	rorq	$14,%r13
+	movq	%rax,%r10
+
+	andq	%rdi,%r15
+	rorq	$28,%r14
+	addq	%r13,%r12
+
+	xorq	%r15,%r10
+	addq	%r12,%rcx
+	addq	%r12,%r10
+
+	leaq	24(%rbp),%rbp
+	movq	88(%rsp),%r13
+	movq	64(%rsp),%r15
+
+	movq	%r13,%r12
+	rorq	$7,%r13
+	addq	%r14,%r10
+	movq	%r15,%r14
+	rorq	$42,%r15
+
+	xorq	%r12,%r13
+	shrq	$7,%r12
+	rorq	$1,%r13
+	xorq	%r14,%r15
+	shrq	$6,%r14
+
+	rorq	$19,%r15
+	xorq	%r13,%r12
+	xorq	%r14,%r15
+	addq	24(%rsp),%r12
+
+	addq	80(%rsp),%r12
+	movq	%rcx,%r13
+	addq	%r15,%r12
+	movq	%r10,%r14
+	rorq	$23,%r13
+	movq	%rdx,%r15
+
+	xorq	%rcx,%r13
+	rorq	$5,%r14
+	xorq	%r8,%r15
+
+	movq	%r12,80(%rsp)
+	xorq	%r10,%r14
+	andq	%rcx,%r15
+
+	rorq	$4,%r13
+	addq	%r9,%r12
+	xorq	%r8,%r15
+
+	rorq	$6,%r14
+	xorq	%rcx,%r13
+	addq	%r15,%r12
+
+	movq	%r10,%r15
+	addq	(%rbp),%r12
+	xorq	%r10,%r14
+
+	xorq	%r11,%r15
+	rorq	$14,%r13
+	movq	%r11,%r9
+
+	andq	%r15,%rdi
+	rorq	$28,%r14
+	addq	%r13,%r12
+
+	xorq	%rdi,%r9
+	addq	%r12,%rbx
+	addq	%r12,%r9
+
+	leaq	8(%rbp),%rbp
+	movq	96(%rsp),%r13
+	movq	72(%rsp),%rdi
+
+	movq	%r13,%r12
+	rorq	$7,%r13
+	addq	%r14,%r9
+	movq	%rdi,%r14
+	rorq	$42,%rdi
+
+	xorq	%r12,%r13
+	shrq	$7,%r12
+	rorq	$1,%r13
+	xorq	%r14,%rdi
+	shrq	$6,%r14
+
+	rorq	$19,%rdi
+	xorq	%r13,%r12
+	xorq	%r14,%rdi
+	addq	32(%rsp),%r12
+
+	addq	88(%rsp),%r12
+	movq	%rbx,%r13
+	addq	%rdi,%r12
+	movq	%r9,%r14
+	rorq	$23,%r13
+	movq	%rcx,%rdi
+
+	xorq	%rbx,%r13
+	rorq	$5,%r14
+	xorq	%rdx,%rdi
+
+	movq	%r12,88(%rsp)
+	xorq	%r9,%r14
+	andq	%rbx,%rdi
+
+	rorq	$4,%r13
+	addq	%r8,%r12
+	xorq	%rdx,%rdi
+
+	rorq	$6,%r14
+	xorq	%rbx,%r13
+	addq	%rdi,%r12
+
+	movq	%r9,%rdi
+	addq	(%rbp),%r12
+	xorq	%r9,%r14
+
+	xorq	%r10,%rdi
+	rorq	$14,%r13
+	movq	%r10,%r8
+
+	andq	%rdi,%r15
+	rorq	$28,%r14
+	addq	%r13,%r12
+
+	xorq	%r15,%r8
+	addq	%r12,%rax
+	addq	%r12,%r8
+
+	leaq	24(%rbp),%rbp
+	movq	104(%rsp),%r13
+	movq	80(%rsp),%r15
+
+	movq	%r13,%r12
+	rorq	$7,%r13
+	addq	%r14,%r8
+	movq	%r15,%r14
+	rorq	$42,%r15
+
+	xorq	%r12,%r13
+	shrq	$7,%r12
+	rorq	$1,%r13
+	xorq	%r14,%r15
+	shrq	$6,%r14
+
+	rorq	$19,%r15
+	xorq	%r13,%r12
+	xorq	%r14,%r15
+	addq	40(%rsp),%r12
+
+	addq	96(%rsp),%r12
+	movq	%rax,%r13
+	addq	%r15,%r12
+	movq	%r8,%r14
+	rorq	$23,%r13
+	movq	%rbx,%r15
+
+	xorq	%rax,%r13
+	rorq	$5,%r14
+	xorq	%rcx,%r15
+
+	movq	%r12,96(%rsp)
+	xorq	%r8,%r14
+	andq	%rax,%r15
+
+	rorq	$4,%r13
+	addq	%rdx,%r12
+	xorq	%rcx,%r15
+
+	rorq	$6,%r14
+	xorq	%rax,%r13
+	addq	%r15,%r12
+
+	movq	%r8,%r15
+	addq	(%rbp),%r12
+	xorq	%r8,%r14
+
+	xorq	%r9,%r15
+	rorq	$14,%r13
+	movq	%r9,%rdx
+
+	andq	%r15,%rdi
+	rorq	$28,%r14
+	addq	%r13,%r12
+
+	xorq	%rdi,%rdx
+	addq	%r12,%r11
+	addq	%r12,%rdx
+
+	leaq	8(%rbp),%rbp
+	movq	112(%rsp),%r13
+	movq	88(%rsp),%rdi
+
+	movq	%r13,%r12
+	rorq	$7,%r13
+	addq	%r14,%rdx
+	movq	%rdi,%r14
+	rorq	$42,%rdi
+
+	xorq	%r12,%r13
+	shrq	$7,%r12
+	rorq	$1,%r13
+	xorq	%r14,%rdi
+	shrq	$6,%r14
+
+	rorq	$19,%rdi
+	xorq	%r13,%r12
+	xorq	%r14,%rdi
+	addq	48(%rsp),%r12
+
+	addq	104(%rsp),%r12
+	movq	%r11,%r13
+	addq	%rdi,%r12
+	movq	%rdx,%r14
+	rorq	$23,%r13
+	movq	%rax,%rdi
+
+	xorq	%r11,%r13
+	rorq	$5,%r14
+	xorq	%rbx,%rdi
+
+	movq	%r12,104(%rsp)
+	xorq	%rdx,%r14
+	andq	%r11,%rdi
+
+	rorq	$4,%r13
+	addq	%rcx,%r12
+	xorq	%rbx,%rdi
+
+	rorq	$6,%r14
+	xorq	%r11,%r13
+	addq	%rdi,%r12
+
+	movq	%rdx,%rdi
+	addq	(%rbp),%r12
+	xorq	%rdx,%r14
+
+	xorq	%r8,%rdi
+	rorq	$14,%r13
+	movq	%r8,%rcx
+
+	andq	%rdi,%r15
+	rorq	$28,%r14
+	addq	%r13,%r12
+
+	xorq	%r15,%rcx
+	addq	%r12,%r10
+	addq	%r12,%rcx
+
+	leaq	24(%rbp),%rbp
+	movq	120(%rsp),%r13
+	movq	96(%rsp),%r15
+
+	movq	%r13,%r12
+	rorq	$7,%r13
+	addq	%r14,%rcx
+	movq	%r15,%r14
+	rorq	$42,%r15
+
+	xorq	%r12,%r13
+	shrq	$7,%r12
+	rorq	$1,%r13
+	xorq	%r14,%r15
+	shrq	$6,%r14
+
+	rorq	$19,%r15
+	xorq	%r13,%r12
+	xorq	%r14,%r15
+	addq	56(%rsp),%r12
+
+	addq	112(%rsp),%r12
+	movq	%r10,%r13
+	addq	%r15,%r12
+	movq	%rcx,%r14
+	rorq	$23,%r13
+	movq	%r11,%r15
+
+	xorq	%r10,%r13
+	rorq	$5,%r14
+	xorq	%rax,%r15
+
+	movq	%r12,112(%rsp)
+	xorq	%rcx,%r14
+	andq	%r10,%r15
+
+	rorq	$4,%r13
+	addq	%rbx,%r12
+	xorq	%rax,%r15
+
+	rorq	$6,%r14
+	xorq	%r10,%r13
+	addq	%r15,%r12
+
+	movq	%rcx,%r15
+	addq	(%rbp),%r12
+	xorq	%rcx,%r14
+
+	xorq	%rdx,%r15
+	rorq	$14,%r13
+	movq	%rdx,%rbx
+
+	andq	%r15,%rdi
+	rorq	$28,%r14
+	addq	%r13,%r12
+
+	xorq	%rdi,%rbx
+	addq	%r12,%r9
+	addq	%r12,%rbx
+
+	leaq	8(%rbp),%rbp
+	movq	0(%rsp),%r13
+	movq	104(%rsp),%rdi
+
+	movq	%r13,%r12
+	rorq	$7,%r13
+	addq	%r14,%rbx
+	movq	%rdi,%r14
+	rorq	$42,%rdi
+
+	xorq	%r12,%r13
+	shrq	$7,%r12
+	rorq	$1,%r13
+	xorq	%r14,%rdi
+	shrq	$6,%r14
+
+	rorq	$19,%rdi
+	xorq	%r13,%r12
+	xorq	%r14,%rdi
+	addq	64(%rsp),%r12
+
+	addq	120(%rsp),%r12
+	movq	%r9,%r13
+	addq	%rdi,%r12
+	movq	%rbx,%r14
+	rorq	$23,%r13
+	movq	%r10,%rdi
+
+	xorq	%r9,%r13
+	rorq	$5,%r14
+	xorq	%r11,%rdi
+
+	movq	%r12,120(%rsp)
+	xorq	%rbx,%r14
+	andq	%r9,%rdi
+
+	rorq	$4,%r13
+	addq	%rax,%r12
+	xorq	%r11,%rdi
+
+	rorq	$6,%r14
+	xorq	%r9,%r13
+	addq	%rdi,%r12
+
+	movq	%rbx,%rdi
+	addq	(%rbp),%r12
+	xorq	%rbx,%r14
+
+	xorq	%rcx,%rdi
+	rorq	$14,%r13
+	movq	%rcx,%rax
+
+	andq	%rdi,%r15
+	rorq	$28,%r14
+	addq	%r13,%r12
+
+	xorq	%r15,%rax
+	addq	%r12,%r8
+	addq	%r12,%rax
+
+	leaq	24(%rbp),%rbp
+	cmpb	$0,7(%rbp)
+	jnz	.Lrounds_16_xx
+
+	movq	128+0(%rsp),%rdi
+	addq	%r14,%rax
+	leaq	128(%rsi),%rsi
+
+	addq	0(%rdi),%rax
+	addq	8(%rdi),%rbx
+	addq	16(%rdi),%rcx
+	addq	24(%rdi),%rdx
+	addq	32(%rdi),%r8
+	addq	40(%rdi),%r9
+	addq	48(%rdi),%r10
+	addq	56(%rdi),%r11
+
+	cmpq	128+16(%rsp),%rsi
+
+	movq	%rax,0(%rdi)
+	movq	%rbx,8(%rdi)
+	movq	%rcx,16(%rdi)
+	movq	%rdx,24(%rdi)
+	movq	%r8,32(%rdi)
+	movq	%r9,40(%rdi)
+	movq	%r10,48(%rdi)
+	movq	%r11,56(%rdi)
+	jb	.Lloop
+
+	movq	128+24(%rsp),%rsi
+	movq	(%rsi),%r15
+	movq	8(%rsi),%r14
+	movq	16(%rsi),%r13
+	movq	24(%rsi),%r12
+	movq	32(%rsi),%rbp
+	movq	40(%rsi),%rbx
+	leaq	48(%rsi),%rsp
+.Lepilogue:
+	.byte	0xf3,0xc3
+.size	sha512_block_data_order,.-sha512_block_data_order
+.align	64
+.type	K512,@object
+K512:
+.quad	0x428a2f98d728ae22,0x7137449123ef65cd
+.quad	0x428a2f98d728ae22,0x7137449123ef65cd
+.quad	0xb5c0fbcfec4d3b2f,0xe9b5dba58189dbbc
+.quad	0xb5c0fbcfec4d3b2f,0xe9b5dba58189dbbc
+.quad	0x3956c25bf348b538,0x59f111f1b605d019
+.quad	0x3956c25bf348b538,0x59f111f1b605d019
+.quad	0x923f82a4af194f9b,0xab1c5ed5da6d8118
+.quad	0x923f82a4af194f9b,0xab1c5ed5da6d8118
+.quad	0xd807aa98a3030242,0x12835b0145706fbe
+.quad	0xd807aa98a3030242,0x12835b0145706fbe
+.quad	0x243185be4ee4b28c,0x550c7dc3d5ffb4e2
+.quad	0x243185be4ee4b28c,0x550c7dc3d5ffb4e2
+.quad	0x72be5d74f27b896f,0x80deb1fe3b1696b1
+.quad	0x72be5d74f27b896f,0x80deb1fe3b1696b1
+.quad	0x9bdc06a725c71235,0xc19bf174cf692694
+.quad	0x9bdc06a725c71235,0xc19bf174cf692694
+.quad	0xe49b69c19ef14ad2,0xefbe4786384f25e3
+.quad	0xe49b69c19ef14ad2,0xefbe4786384f25e3
+.quad	0x0fc19dc68b8cd5b5,0x240ca1cc77ac9c65
+.quad	0x0fc19dc68b8cd5b5,0x240ca1cc77ac9c65
+.quad	0x2de92c6f592b0275,0x4a7484aa6ea6e483
+.quad	0x2de92c6f592b0275,0x4a7484aa6ea6e483
+.quad	0x5cb0a9dcbd41fbd4,0x76f988da831153b5
+.quad	0x5cb0a9dcbd41fbd4,0x76f988da831153b5
+.quad	0x983e5152ee66dfab,0xa831c66d2db43210
+.quad	0x983e5152ee66dfab,0xa831c66d2db43210
+.quad	0xb00327c898fb213f,0xbf597fc7beef0ee4
+.quad	0xb00327c898fb213f,0xbf597fc7beef0ee4
+.quad	0xc6e00bf33da88fc2,0xd5a79147930aa725
+.quad	0xc6e00bf33da88fc2,0xd5a79147930aa725
+.quad	0x06ca6351e003826f,0x142929670a0e6e70
+.quad	0x06ca6351e003826f,0x142929670a0e6e70
+.quad	0x27b70a8546d22ffc,0x2e1b21385c26c926
+.quad	0x27b70a8546d22ffc,0x2e1b21385c26c926
+.quad	0x4d2c6dfc5ac42aed,0x53380d139d95b3df
+.quad	0x4d2c6dfc5ac42aed,0x53380d139d95b3df
+.quad	0x650a73548baf63de,0x766a0abb3c77b2a8
+.quad	0x650a73548baf63de,0x766a0abb3c77b2a8
+.quad	0x81c2c92e47edaee6,0x92722c851482353b
+.quad	0x81c2c92e47edaee6,0x92722c851482353b
+.quad	0xa2bfe8a14cf10364,0xa81a664bbc423001
+.quad	0xa2bfe8a14cf10364,0xa81a664bbc423001
+.quad	0xc24b8b70d0f89791,0xc76c51a30654be30
+.quad	0xc24b8b70d0f89791,0xc76c51a30654be30
+.quad	0xd192e819d6ef5218,0xd69906245565a910
+.quad	0xd192e819d6ef5218,0xd69906245565a910
+.quad	0xf40e35855771202a,0x106aa07032bbd1b8
+.quad	0xf40e35855771202a,0x106aa07032bbd1b8
+.quad	0x19a4c116b8d2d0c8,0x1e376c085141ab53
+.quad	0x19a4c116b8d2d0c8,0x1e376c085141ab53
+.quad	0x2748774cdf8eeb99,0x34b0bcb5e19b48a8
+.quad	0x2748774cdf8eeb99,0x34b0bcb5e19b48a8
+.quad	0x391c0cb3c5c95a63,0x4ed8aa4ae3418acb
+.quad	0x391c0cb3c5c95a63,0x4ed8aa4ae3418acb
+.quad	0x5b9cca4f7763e373,0x682e6ff3d6b2b8a3
+.quad	0x5b9cca4f7763e373,0x682e6ff3d6b2b8a3
+.quad	0x748f82ee5defb2fc,0x78a5636f43172f60
+.quad	0x748f82ee5defb2fc,0x78a5636f43172f60
+.quad	0x84c87814a1f0ab72,0x8cc702081a6439ec
+.quad	0x84c87814a1f0ab72,0x8cc702081a6439ec
+.quad	0x90befffa23631e28,0xa4506cebde82bde9
+.quad	0x90befffa23631e28,0xa4506cebde82bde9
+.quad	0xbef9a3f7b2c67915,0xc67178f2e372532b
+.quad	0xbef9a3f7b2c67915,0xc67178f2e372532b
+.quad	0xca273eceea26619c,0xd186b8c721c0c207
+.quad	0xca273eceea26619c,0xd186b8c721c0c207
+.quad	0xeada7dd6cde0eb1e,0xf57d4f7fee6ed178
+.quad	0xeada7dd6cde0eb1e,0xf57d4f7fee6ed178
+.quad	0x06f067aa72176fba,0x0a637dc5a2c898a6
+.quad	0x06f067aa72176fba,0x0a637dc5a2c898a6
+.quad	0x113f9804bef90dae,0x1b710b35131c471b
+.quad	0x113f9804bef90dae,0x1b710b35131c471b
+.quad	0x28db77f523047d84,0x32caab7b40c72493
+.quad	0x28db77f523047d84,0x32caab7b40c72493
+.quad	0x3c9ebe0a15c9bebc,0x431d67c49c100d4c
+.quad	0x3c9ebe0a15c9bebc,0x431d67c49c100d4c
+.quad	0x4cc5d4becb3e42b6,0x597f299cfc657e2a
+.quad	0x4cc5d4becb3e42b6,0x597f299cfc657e2a
+.quad	0x5fcb6fab3ad6faec,0x6c44198c4a475817
+.quad	0x5fcb6fab3ad6faec,0x6c44198c4a475817
+
+.quad	0x0001020304050607,0x08090a0b0c0d0e0f
+.quad	0x0001020304050607,0x08090a0b0c0d0e0f
+.byte	83,72,65,53,49,50,32,98,108,111,99,107,32,116,114,97,110,115,102,111,114,109,32,102,111,114,32,120,56,54,95,54,52,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0
+#endif
diff --git a/third_party/boringssl/mac-x86/crypto/aes/aes-586.S b/third_party/boringssl/mac-x86/crypto/aes/aes-586.S
new file mode 100644
index 0000000..d3dc6be
--- /dev/null
+++ b/third_party/boringssl/mac-x86/crypto/aes/aes-586.S
@@ -0,0 +1,3221 @@
+#if defined(__i386__)
+.file	"aes-586.S"
+.text
+.private_extern	__x86_AES_encrypt_compact
+.align	4
+__x86_AES_encrypt_compact:
+	movl	%edi,20(%esp)
+	xorl	(%edi),%eax
+	xorl	4(%edi),%ebx
+	xorl	8(%edi),%ecx
+	xorl	12(%edi),%edx
+	movl	240(%edi),%esi
+	leal	-2(%esi,%esi,1),%esi
+	leal	(%edi,%esi,8),%esi
+	movl	%esi,24(%esp)
+	movl	-128(%ebp),%edi
+	movl	-96(%ebp),%esi
+	movl	-64(%ebp),%edi
+	movl	-32(%ebp),%esi
+	movl	(%ebp),%edi
+	movl	32(%ebp),%esi
+	movl	64(%ebp),%edi
+	movl	96(%ebp),%esi
+.align	4,0x90
+L000loop:
+	movl	%eax,%esi
+	andl	$255,%esi
+	movzbl	-128(%ebp,%esi,1),%esi
+	movzbl	%bh,%edi
+	movzbl	-128(%ebp,%edi,1),%edi
+	shll	$8,%edi
+	xorl	%edi,%esi
+	movl	%ecx,%edi
+	shrl	$16,%edi
+	andl	$255,%edi
+	movzbl	-128(%ebp,%edi,1),%edi
+	shll	$16,%edi
+	xorl	%edi,%esi
+	movl	%edx,%edi
+	shrl	$24,%edi
+	movzbl	-128(%ebp,%edi,1),%edi
+	shll	$24,%edi
+	xorl	%edi,%esi
+	movl	%esi,4(%esp)
+	movl	%ebx,%esi
+	andl	$255,%esi
+	shrl	$16,%ebx
+	movzbl	-128(%ebp,%esi,1),%esi
+	movzbl	%ch,%edi
+	movzbl	-128(%ebp,%edi,1),%edi
+	shll	$8,%edi
+	xorl	%edi,%esi
+	movl	%edx,%edi
+	shrl	$16,%edi
+	andl	$255,%edi
+	movzbl	-128(%ebp,%edi,1),%edi
+	shll	$16,%edi
+	xorl	%edi,%esi
+	movl	%eax,%edi
+	shrl	$24,%edi
+	movzbl	-128(%ebp,%edi,1),%edi
+	shll	$24,%edi
+	xorl	%edi,%esi
+	movl	%esi,8(%esp)
+	movl	%ecx,%esi
+	andl	$255,%esi
+	shrl	$24,%ecx
+	movzbl	-128(%ebp,%esi,1),%esi
+	movzbl	%dh,%edi
+	movzbl	-128(%ebp,%edi,1),%edi
+	shll	$8,%edi
+	xorl	%edi,%esi
+	movl	%eax,%edi
+	shrl	$16,%edi
+	andl	$255,%edx
+	andl	$255,%edi
+	movzbl	-128(%ebp,%edi,1),%edi
+	shll	$16,%edi
+	xorl	%edi,%esi
+	movzbl	%bh,%edi
+	movzbl	-128(%ebp,%edi,1),%edi
+	shll	$24,%edi
+	xorl	%edi,%esi
+	andl	$255,%edx
+	movzbl	-128(%ebp,%edx,1),%edx
+	movzbl	%ah,%eax
+	movzbl	-128(%ebp,%eax,1),%eax
+	shll	$8,%eax
+	xorl	%eax,%edx
+	movl	4(%esp),%eax
+	andl	$255,%ebx
+	movzbl	-128(%ebp,%ebx,1),%ebx
+	shll	$16,%ebx
+	xorl	%ebx,%edx
+	movl	8(%esp),%ebx
+	movzbl	-128(%ebp,%ecx,1),%ecx
+	shll	$24,%ecx
+	xorl	%ecx,%edx
+	movl	%esi,%ecx
+	movl	$2155905152,%ebp
+	andl	%ecx,%ebp
+	leal	(%ecx,%ecx,1),%edi
+	movl	%ebp,%esi
+	shrl	$7,%ebp
+	andl	$4278124286,%edi
+	subl	%ebp,%esi
+	movl	%ecx,%ebp
+	andl	$454761243,%esi
+	rorl	$16,%ebp
+	xorl	%edi,%esi
+	movl	%ecx,%edi
+	xorl	%esi,%ecx
+	rorl	$24,%edi
+	xorl	%ebp,%esi
+	roll	$24,%ecx
+	xorl	%edi,%esi
+	movl	$2155905152,%ebp
+	xorl	%esi,%ecx
+	andl	%edx,%ebp
+	leal	(%edx,%edx,1),%edi
+	movl	%ebp,%esi
+	shrl	$7,%ebp
+	andl	$4278124286,%edi
+	subl	%ebp,%esi
+	movl	%edx,%ebp
+	andl	$454761243,%esi
+	rorl	$16,%ebp
+	xorl	%edi,%esi
+	movl	%edx,%edi
+	xorl	%esi,%edx
+	rorl	$24,%edi
+	xorl	%ebp,%esi
+	roll	$24,%edx
+	xorl	%edi,%esi
+	movl	$2155905152,%ebp
+	xorl	%esi,%edx
+	andl	%eax,%ebp
+	leal	(%eax,%eax,1),%edi
+	movl	%ebp,%esi
+	shrl	$7,%ebp
+	andl	$4278124286,%edi
+	subl	%ebp,%esi
+	movl	%eax,%ebp
+	andl	$454761243,%esi
+	rorl	$16,%ebp
+	xorl	%edi,%esi
+	movl	%eax,%edi
+	xorl	%esi,%eax
+	rorl	$24,%edi
+	xorl	%ebp,%esi
+	roll	$24,%eax
+	xorl	%edi,%esi
+	movl	$2155905152,%ebp
+	xorl	%esi,%eax
+	andl	%ebx,%ebp
+	leal	(%ebx,%ebx,1),%edi
+	movl	%ebp,%esi
+	shrl	$7,%ebp
+	andl	$4278124286,%edi
+	subl	%ebp,%esi
+	movl	%ebx,%ebp
+	andl	$454761243,%esi
+	rorl	$16,%ebp
+	xorl	%edi,%esi
+	movl	%ebx,%edi
+	xorl	%esi,%ebx
+	rorl	$24,%edi
+	xorl	%ebp,%esi
+	roll	$24,%ebx
+	xorl	%edi,%esi
+	xorl	%esi,%ebx
+	movl	20(%esp),%edi
+	movl	28(%esp),%ebp
+	addl	$16,%edi
+	xorl	(%edi),%eax
+	xorl	4(%edi),%ebx
+	xorl	8(%edi),%ecx
+	xorl	12(%edi),%edx
+	cmpl	24(%esp),%edi
+	movl	%edi,20(%esp)
+	jb	L000loop
+	movl	%eax,%esi
+	andl	$255,%esi
+	movzbl	-128(%ebp,%esi,1),%esi
+	movzbl	%bh,%edi
+	movzbl	-128(%ebp,%edi,1),%edi
+	shll	$8,%edi
+	xorl	%edi,%esi
+	movl	%ecx,%edi
+	shrl	$16,%edi
+	andl	$255,%edi
+	movzbl	-128(%ebp,%edi,1),%edi
+	shll	$16,%edi
+	xorl	%edi,%esi
+	movl	%edx,%edi
+	shrl	$24,%edi
+	movzbl	-128(%ebp,%edi,1),%edi
+	shll	$24,%edi
+	xorl	%edi,%esi
+	movl	%esi,4(%esp)
+	movl	%ebx,%esi
+	andl	$255,%esi
+	shrl	$16,%ebx
+	movzbl	-128(%ebp,%esi,1),%esi
+	movzbl	%ch,%edi
+	movzbl	-128(%ebp,%edi,1),%edi
+	shll	$8,%edi
+	xorl	%edi,%esi
+	movl	%edx,%edi
+	shrl	$16,%edi
+	andl	$255,%edi
+	movzbl	-128(%ebp,%edi,1),%edi
+	shll	$16,%edi
+	xorl	%edi,%esi
+	movl	%eax,%edi
+	shrl	$24,%edi
+	movzbl	-128(%ebp,%edi,1),%edi
+	shll	$24,%edi
+	xorl	%edi,%esi
+	movl	%esi,8(%esp)
+	movl	%ecx,%esi
+	andl	$255,%esi
+	shrl	$24,%ecx
+	movzbl	-128(%ebp,%esi,1),%esi
+	movzbl	%dh,%edi
+	movzbl	-128(%ebp,%edi,1),%edi
+	shll	$8,%edi
+	xorl	%edi,%esi
+	movl	%eax,%edi
+	shrl	$16,%edi
+	andl	$255,%edx
+	andl	$255,%edi
+	movzbl	-128(%ebp,%edi,1),%edi
+	shll	$16,%edi
+	xorl	%edi,%esi
+	movzbl	%bh,%edi
+	movzbl	-128(%ebp,%edi,1),%edi
+	shll	$24,%edi
+	xorl	%edi,%esi
+	movl	20(%esp),%edi
+	andl	$255,%edx
+	movzbl	-128(%ebp,%edx,1),%edx
+	movzbl	%ah,%eax
+	movzbl	-128(%ebp,%eax,1),%eax
+	shll	$8,%eax
+	xorl	%eax,%edx
+	movl	4(%esp),%eax
+	andl	$255,%ebx
+	movzbl	-128(%ebp,%ebx,1),%ebx
+	shll	$16,%ebx
+	xorl	%ebx,%edx
+	movl	8(%esp),%ebx
+	movzbl	-128(%ebp,%ecx,1),%ecx
+	shll	$24,%ecx
+	xorl	%ecx,%edx
+	movl	%esi,%ecx
+	xorl	16(%edi),%eax
+	xorl	20(%edi),%ebx
+	xorl	24(%edi),%ecx
+	xorl	28(%edi),%edx
+	ret
+.private_extern	__sse_AES_encrypt_compact
+.align	4
+__sse_AES_encrypt_compact:
+	pxor	(%edi),%mm0
+	pxor	8(%edi),%mm4
+	movl	240(%edi),%esi
+	leal	-2(%esi,%esi,1),%esi
+	leal	(%edi,%esi,8),%esi
+	movl	%esi,24(%esp)
+	movl	$454761243,%eax
+	movl	%eax,8(%esp)
+	movl	%eax,12(%esp)
+	movl	-128(%ebp),%eax
+	movl	-96(%ebp),%ebx
+	movl	-64(%ebp),%ecx
+	movl	-32(%ebp),%edx
+	movl	(%ebp),%eax
+	movl	32(%ebp),%ebx
+	movl	64(%ebp),%ecx
+	movl	96(%ebp),%edx
+.align	4,0x90
+L001loop:
+	pshufw	$8,%mm0,%mm1
+	pshufw	$13,%mm4,%mm5
+	movd	%mm1,%eax
+	movd	%mm5,%ebx
+	movl	%edi,20(%esp)
+	movzbl	%al,%esi
+	movzbl	%ah,%edx
+	pshufw	$13,%mm0,%mm2
+	movzbl	-128(%ebp,%esi,1),%ecx
+	movzbl	%bl,%edi
+	movzbl	-128(%ebp,%edx,1),%edx
+	shrl	$16,%eax
+	shll	$8,%edx
+	movzbl	-128(%ebp,%edi,1),%esi
+	movzbl	%bh,%edi
+	shll	$16,%esi
+	pshufw	$8,%mm4,%mm6
+	orl	%esi,%ecx
+	movzbl	-128(%ebp,%edi,1),%esi
+	movzbl	%ah,%edi
+	shll	$24,%esi
+	shrl	$16,%ebx
+	orl	%esi,%edx
+	movzbl	-128(%ebp,%edi,1),%esi
+	movzbl	%bh,%edi
+	shll	$8,%esi
+	orl	%esi,%ecx
+	movzbl	-128(%ebp,%edi,1),%esi
+	movzbl	%al,%edi
+	shll	$24,%esi
+	orl	%esi,%ecx
+	movzbl	-128(%ebp,%edi,1),%esi
+	movzbl	%bl,%edi
+	movd	%mm2,%eax
+	movd	%ecx,%mm0
+	movzbl	-128(%ebp,%edi,1),%ecx
+	movzbl	%ah,%edi
+	shll	$16,%ecx
+	movd	%mm6,%ebx
+	orl	%esi,%ecx
+	movzbl	-128(%ebp,%edi,1),%esi
+	movzbl	%bh,%edi
+	shll	$24,%esi
+	orl	%esi,%ecx
+	movzbl	-128(%ebp,%edi,1),%esi
+	movzbl	%bl,%edi
+	shll	$8,%esi
+	shrl	$16,%ebx
+	orl	%esi,%ecx
+	movzbl	-128(%ebp,%edi,1),%esi
+	movzbl	%al,%edi
+	shrl	$16,%eax
+	movd	%ecx,%mm1
+	movzbl	-128(%ebp,%edi,1),%ecx
+	movzbl	%ah,%edi
+	shll	$16,%ecx
+	andl	$255,%eax
+	orl	%esi,%ecx
+	punpckldq	%mm1,%mm0
+	movzbl	-128(%ebp,%edi,1),%esi
+	movzbl	%bh,%edi
+	shll	$24,%esi
+	andl	$255,%ebx
+	movzbl	-128(%ebp,%eax,1),%eax
+	orl	%esi,%ecx
+	shll	$16,%eax
+	movzbl	-128(%ebp,%edi,1),%esi
+	orl	%eax,%edx
+	shll	$8,%esi
+	movzbl	-128(%ebp,%ebx,1),%ebx
+	orl	%esi,%ecx
+	orl	%ebx,%edx
+	movl	20(%esp),%edi
+	movd	%ecx,%mm4
+	movd	%edx,%mm5
+	punpckldq	%mm5,%mm4
+	addl	$16,%edi
+	cmpl	24(%esp),%edi
+	ja	L002out
+	movq	8(%esp),%mm2
+	pxor	%mm3,%mm3
+	pxor	%mm7,%mm7
+	movq	%mm0,%mm1
+	movq	%mm4,%mm5
+	pcmpgtb	%mm0,%mm3
+	pcmpgtb	%mm4,%mm7
+	pand	%mm2,%mm3
+	pand	%mm2,%mm7
+	pshufw	$177,%mm0,%mm2
+	pshufw	$177,%mm4,%mm6
+	paddb	%mm0,%mm0
+	paddb	%mm4,%mm4
+	pxor	%mm3,%mm0
+	pxor	%mm7,%mm4
+	pshufw	$177,%mm2,%mm3
+	pshufw	$177,%mm6,%mm7
+	pxor	%mm0,%mm1
+	pxor	%mm4,%mm5
+	pxor	%mm2,%mm0
+	pxor	%mm6,%mm4
+	movq	%mm3,%mm2
+	movq	%mm7,%mm6
+	pslld	$8,%mm3
+	pslld	$8,%mm7
+	psrld	$24,%mm2
+	psrld	$24,%mm6
+	pxor	%mm3,%mm0
+	pxor	%mm7,%mm4
+	pxor	%mm2,%mm0
+	pxor	%mm6,%mm4
+	movq	%mm1,%mm3
+	movq	%mm5,%mm7
+	movq	(%edi),%mm2
+	movq	8(%edi),%mm6
+	psrld	$8,%mm1
+	psrld	$8,%mm5
+	movl	-128(%ebp),%eax
+	pslld	$24,%mm3
+	pslld	$24,%mm7
+	movl	-64(%ebp),%ebx
+	pxor	%mm1,%mm0
+	pxor	%mm5,%mm4
+	movl	(%ebp),%ecx
+	pxor	%mm3,%mm0
+	pxor	%mm7,%mm4
+	movl	64(%ebp),%edx
+	pxor	%mm2,%mm0
+	pxor	%mm6,%mm4
+	jmp	L001loop
+.align	4,0x90
+L002out:
+	pxor	(%edi),%mm0
+	pxor	8(%edi),%mm4
+	ret
+.private_extern	__x86_AES_encrypt
+.align	4
+__x86_AES_encrypt:
+	movl	%edi,20(%esp)
+	xorl	(%edi),%eax
+	xorl	4(%edi),%ebx
+	xorl	8(%edi),%ecx
+	xorl	12(%edi),%edx
+	movl	240(%edi),%esi
+	leal	-2(%esi,%esi,1),%esi
+	leal	(%edi,%esi,8),%esi
+	movl	%esi,24(%esp)
+.align	4,0x90
+L003loop:
+	movl	%eax,%esi
+	andl	$255,%esi
+	movl	(%ebp,%esi,8),%esi
+	movzbl	%bh,%edi
+	xorl	3(%ebp,%edi,8),%esi
+	movl	%ecx,%edi
+	shrl	$16,%edi
+	andl	$255,%edi
+	xorl	2(%ebp,%edi,8),%esi
+	movl	%edx,%edi
+	shrl	$24,%edi
+	xorl	1(%ebp,%edi,8),%esi
+	movl	%esi,4(%esp)
+	movl	%ebx,%esi
+	andl	$255,%esi
+	shrl	$16,%ebx
+	movl	(%ebp,%esi,8),%esi
+	movzbl	%ch,%edi
+	xorl	3(%ebp,%edi,8),%esi
+	movl	%edx,%edi
+	shrl	$16,%edi
+	andl	$255,%edi
+	xorl	2(%ebp,%edi,8),%esi
+	movl	%eax,%edi
+	shrl	$24,%edi
+	xorl	1(%ebp,%edi,8),%esi
+	movl	%esi,8(%esp)
+	movl	%ecx,%esi
+	andl	$255,%esi
+	shrl	$24,%ecx
+	movl	(%ebp,%esi,8),%esi
+	movzbl	%dh,%edi
+	xorl	3(%ebp,%edi,8),%esi
+	movl	%eax,%edi
+	shrl	$16,%edi
+	andl	$255,%edx
+	andl	$255,%edi
+	xorl	2(%ebp,%edi,8),%esi
+	movzbl	%bh,%edi
+	xorl	1(%ebp,%edi,8),%esi
+	movl	20(%esp),%edi
+	movl	(%ebp,%edx,8),%edx
+	movzbl	%ah,%eax
+	xorl	3(%ebp,%eax,8),%edx
+	movl	4(%esp),%eax
+	andl	$255,%ebx
+	xorl	2(%ebp,%ebx,8),%edx
+	movl	8(%esp),%ebx
+	xorl	1(%ebp,%ecx,8),%edx
+	movl	%esi,%ecx
+	addl	$16,%edi
+	xorl	(%edi),%eax
+	xorl	4(%edi),%ebx
+	xorl	8(%edi),%ecx
+	xorl	12(%edi),%edx
+	cmpl	24(%esp),%edi
+	movl	%edi,20(%esp)
+	jb	L003loop
+	movl	%eax,%esi
+	andl	$255,%esi
+	movl	2(%ebp,%esi,8),%esi
+	andl	$255,%esi
+	movzbl	%bh,%edi
+	movl	(%ebp,%edi,8),%edi
+	andl	$65280,%edi
+	xorl	%edi,%esi
+	movl	%ecx,%edi
+	shrl	$16,%edi
+	andl	$255,%edi
+	movl	(%ebp,%edi,8),%edi
+	andl	$16711680,%edi
+	xorl	%edi,%esi
+	movl	%edx,%edi
+	shrl	$24,%edi
+	movl	2(%ebp,%edi,8),%edi
+	andl	$4278190080,%edi
+	xorl	%edi,%esi
+	movl	%esi,4(%esp)
+	movl	%ebx,%esi
+	andl	$255,%esi
+	shrl	$16,%ebx
+	movl	2(%ebp,%esi,8),%esi
+	andl	$255,%esi
+	movzbl	%ch,%edi
+	movl	(%ebp,%edi,8),%edi
+	andl	$65280,%edi
+	xorl	%edi,%esi
+	movl	%edx,%edi
+	shrl	$16,%edi
+	andl	$255,%edi
+	movl	(%ebp,%edi,8),%edi
+	andl	$16711680,%edi
+	xorl	%edi,%esi
+	movl	%eax,%edi
+	shrl	$24,%edi
+	movl	2(%ebp,%edi,8),%edi
+	andl	$4278190080,%edi
+	xorl	%edi,%esi
+	movl	%esi,8(%esp)
+	movl	%ecx,%esi
+	andl	$255,%esi
+	shrl	$24,%ecx
+	movl	2(%ebp,%esi,8),%esi
+	andl	$255,%esi
+	movzbl	%dh,%edi
+	movl	(%ebp,%edi,8),%edi
+	andl	$65280,%edi
+	xorl	%edi,%esi
+	movl	%eax,%edi
+	shrl	$16,%edi
+	andl	$255,%edx
+	andl	$255,%edi
+	movl	(%ebp,%edi,8),%edi
+	andl	$16711680,%edi
+	xorl	%edi,%esi
+	movzbl	%bh,%edi
+	movl	2(%ebp,%edi,8),%edi
+	andl	$4278190080,%edi
+	xorl	%edi,%esi
+	movl	20(%esp),%edi
+	andl	$255,%edx
+	movl	2(%ebp,%edx,8),%edx
+	andl	$255,%edx
+	movzbl	%ah,%eax
+	movl	(%ebp,%eax,8),%eax
+	andl	$65280,%eax
+	xorl	%eax,%edx
+	movl	4(%esp),%eax
+	andl	$255,%ebx
+	movl	(%ebp,%ebx,8),%ebx
+	andl	$16711680,%ebx
+	xorl	%ebx,%edx
+	movl	8(%esp),%ebx
+	movl	2(%ebp,%ecx,8),%ecx
+	andl	$4278190080,%ecx
+	xorl	%ecx,%edx
+	movl	%esi,%ecx
+	addl	$16,%edi
+	xorl	(%edi),%eax
+	xorl	4(%edi),%ebx
+	xorl	8(%edi),%ecx
+	xorl	12(%edi),%edx
+	ret
+.align	6,0x90
+LAES_Te:
+.long	2774754246,2774754246
+.long	2222750968,2222750968
+.long	2574743534,2574743534
+.long	2373680118,2373680118
+.long	234025727,234025727
+.long	3177933782,3177933782
+.long	2976870366,2976870366
+.long	1422247313,1422247313
+.long	1345335392,1345335392
+.long	50397442,50397442
+.long	2842126286,2842126286
+.long	2099981142,2099981142
+.long	436141799,436141799
+.long	1658312629,1658312629
+.long	3870010189,3870010189
+.long	2591454956,2591454956
+.long	1170918031,1170918031
+.long	2642575903,2642575903
+.long	1086966153,1086966153
+.long	2273148410,2273148410
+.long	368769775,368769775
+.long	3948501426,3948501426
+.long	3376891790,3376891790
+.long	200339707,200339707
+.long	3970805057,3970805057
+.long	1742001331,1742001331
+.long	4255294047,4255294047
+.long	3937382213,3937382213
+.long	3214711843,3214711843
+.long	4154762323,4154762323
+.long	2524082916,2524082916
+.long	1539358875,1539358875
+.long	3266819957,3266819957
+.long	486407649,486407649
+.long	2928907069,2928907069
+.long	1780885068,1780885068
+.long	1513502316,1513502316
+.long	1094664062,1094664062
+.long	49805301,49805301
+.long	1338821763,1338821763
+.long	1546925160,1546925160
+.long	4104496465,4104496465
+.long	887481809,887481809
+.long	150073849,150073849
+.long	2473685474,2473685474
+.long	1943591083,1943591083
+.long	1395732834,1395732834
+.long	1058346282,1058346282
+.long	201589768,201589768
+.long	1388824469,1388824469
+.long	1696801606,1696801606
+.long	1589887901,1589887901
+.long	672667696,672667696
+.long	2711000631,2711000631
+.long	251987210,251987210
+.long	3046808111,3046808111
+.long	151455502,151455502
+.long	907153956,907153956
+.long	2608889883,2608889883
+.long	1038279391,1038279391
+.long	652995533,652995533
+.long	1764173646,1764173646
+.long	3451040383,3451040383
+.long	2675275242,2675275242
+.long	453576978,453576978
+.long	2659418909,2659418909
+.long	1949051992,1949051992
+.long	773462580,773462580
+.long	756751158,756751158
+.long	2993581788,2993581788
+.long	3998898868,3998898868
+.long	4221608027,4221608027
+.long	4132590244,4132590244
+.long	1295727478,1295727478
+.long	1641469623,1641469623
+.long	3467883389,3467883389
+.long	2066295122,2066295122
+.long	1055122397,1055122397
+.long	1898917726,1898917726
+.long	2542044179,2542044179
+.long	4115878822,4115878822
+.long	1758581177,1758581177
+.long	0,0
+.long	753790401,753790401
+.long	1612718144,1612718144
+.long	536673507,536673507
+.long	3367088505,3367088505
+.long	3982187446,3982187446
+.long	3194645204,3194645204
+.long	1187761037,1187761037
+.long	3653156455,3653156455
+.long	1262041458,1262041458
+.long	3729410708,3729410708
+.long	3561770136,3561770136
+.long	3898103984,3898103984
+.long	1255133061,1255133061
+.long	1808847035,1808847035
+.long	720367557,720367557
+.long	3853167183,3853167183
+.long	385612781,385612781
+.long	3309519750,3309519750
+.long	3612167578,3612167578
+.long	1429418854,1429418854
+.long	2491778321,2491778321
+.long	3477423498,3477423498
+.long	284817897,284817897
+.long	100794884,100794884
+.long	2172616702,2172616702
+.long	4031795360,4031795360
+.long	1144798328,1144798328
+.long	3131023141,3131023141
+.long	3819481163,3819481163
+.long	4082192802,4082192802
+.long	4272137053,4272137053
+.long	3225436288,3225436288
+.long	2324664069,2324664069
+.long	2912064063,2912064063
+.long	3164445985,3164445985
+.long	1211644016,1211644016
+.long	83228145,83228145
+.long	3753688163,3753688163
+.long	3249976951,3249976951
+.long	1977277103,1977277103
+.long	1663115586,1663115586
+.long	806359072,806359072
+.long	452984805,452984805
+.long	250868733,250868733
+.long	1842533055,1842533055
+.long	1288555905,1288555905
+.long	336333848,336333848
+.long	890442534,890442534
+.long	804056259,804056259
+.long	3781124030,3781124030
+.long	2727843637,2727843637
+.long	3427026056,3427026056
+.long	957814574,957814574
+.long	1472513171,1472513171
+.long	4071073621,4071073621
+.long	2189328124,2189328124
+.long	1195195770,1195195770
+.long	2892260552,2892260552
+.long	3881655738,3881655738
+.long	723065138,723065138
+.long	2507371494,2507371494
+.long	2690670784,2690670784
+.long	2558624025,2558624025
+.long	3511635870,3511635870
+.long	2145180835,2145180835
+.long	1713513028,1713513028
+.long	2116692564,2116692564
+.long	2878378043,2878378043
+.long	2206763019,2206763019
+.long	3393603212,3393603212
+.long	703524551,703524551
+.long	3552098411,3552098411
+.long	1007948840,1007948840
+.long	2044649127,2044649127
+.long	3797835452,3797835452
+.long	487262998,487262998
+.long	1994120109,1994120109
+.long	1004593371,1004593371
+.long	1446130276,1446130276
+.long	1312438900,1312438900
+.long	503974420,503974420
+.long	3679013266,3679013266
+.long	168166924,168166924
+.long	1814307912,1814307912
+.long	3831258296,3831258296
+.long	1573044895,1573044895
+.long	1859376061,1859376061
+.long	4021070915,4021070915
+.long	2791465668,2791465668
+.long	2828112185,2828112185
+.long	2761266481,2761266481
+.long	937747667,937747667
+.long	2339994098,2339994098
+.long	854058965,854058965
+.long	1137232011,1137232011
+.long	1496790894,1496790894
+.long	3077402074,3077402074
+.long	2358086913,2358086913
+.long	1691735473,1691735473
+.long	3528347292,3528347292
+.long	3769215305,3769215305
+.long	3027004632,3027004632
+.long	4199962284,4199962284
+.long	133494003,133494003
+.long	636152527,636152527
+.long	2942657994,2942657994
+.long	2390391540,2390391540
+.long	3920539207,3920539207
+.long	403179536,403179536
+.long	3585784431,3585784431
+.long	2289596656,2289596656
+.long	1864705354,1864705354
+.long	1915629148,1915629148
+.long	605822008,605822008
+.long	4054230615,4054230615
+.long	3350508659,3350508659
+.long	1371981463,1371981463
+.long	602466507,602466507
+.long	2094914977,2094914977
+.long	2624877800,2624877800
+.long	555687742,555687742
+.long	3712699286,3712699286
+.long	3703422305,3703422305
+.long	2257292045,2257292045
+.long	2240449039,2240449039
+.long	2423288032,2423288032
+.long	1111375484,1111375484
+.long	3300242801,3300242801
+.long	2858837708,2858837708
+.long	3628615824,3628615824
+.long	84083462,84083462
+.long	32962295,32962295
+.long	302911004,302911004
+.long	2741068226,2741068226
+.long	1597322602,1597322602
+.long	4183250862,4183250862
+.long	3501832553,3501832553
+.long	2441512471,2441512471
+.long	1489093017,1489093017
+.long	656219450,656219450
+.long	3114180135,3114180135
+.long	954327513,954327513
+.long	335083755,335083755
+.long	3013122091,3013122091
+.long	856756514,856756514
+.long	3144247762,3144247762
+.long	1893325225,1893325225
+.long	2307821063,2307821063
+.long	2811532339,2811532339
+.long	3063651117,3063651117
+.long	572399164,572399164
+.long	2458355477,2458355477
+.long	552200649,552200649
+.long	1238290055,1238290055
+.long	4283782570,4283782570
+.long	2015897680,2015897680
+.long	2061492133,2061492133
+.long	2408352771,2408352771
+.long	4171342169,4171342169
+.long	2156497161,2156497161
+.long	386731290,386731290
+.long	3669999461,3669999461
+.long	837215959,837215959
+.long	3326231172,3326231172
+.long	3093850320,3093850320
+.long	3275833730,3275833730
+.long	2962856233,2962856233
+.long	1999449434,1999449434
+.long	286199582,286199582
+.long	3417354363,3417354363
+.long	4233385128,4233385128
+.long	3602627437,3602627437
+.long	974525996,974525996
+.byte	99,124,119,123,242,107,111,197
+.byte	48,1,103,43,254,215,171,118
+.byte	202,130,201,125,250,89,71,240
+.byte	173,212,162,175,156,164,114,192
+.byte	183,253,147,38,54,63,247,204
+.byte	52,165,229,241,113,216,49,21
+.byte	4,199,35,195,24,150,5,154
+.byte	7,18,128,226,235,39,178,117
+.byte	9,131,44,26,27,110,90,160
+.byte	82,59,214,179,41,227,47,132
+.byte	83,209,0,237,32,252,177,91
+.byte	106,203,190,57,74,76,88,207
+.byte	208,239,170,251,67,77,51,133
+.byte	69,249,2,127,80,60,159,168
+.byte	81,163,64,143,146,157,56,245
+.byte	188,182,218,33,16,255,243,210
+.byte	205,12,19,236,95,151,68,23
+.byte	196,167,126,61,100,93,25,115
+.byte	96,129,79,220,34,42,144,136
+.byte	70,238,184,20,222,94,11,219
+.byte	224,50,58,10,73,6,36,92
+.byte	194,211,172,98,145,149,228,121
+.byte	231,200,55,109,141,213,78,169
+.byte	108,86,244,234,101,122,174,8
+.byte	186,120,37,46,28,166,180,198
+.byte	232,221,116,31,75,189,139,138
+.byte	112,62,181,102,72,3,246,14
+.byte	97,53,87,185,134,193,29,158
+.byte	225,248,152,17,105,217,142,148
+.byte	155,30,135,233,206,85,40,223
+.byte	140,161,137,13,191,230,66,104
+.byte	65,153,45,15,176,84,187,22
+.byte	99,124,119,123,242,107,111,197
+.byte	48,1,103,43,254,215,171,118
+.byte	202,130,201,125,250,89,71,240
+.byte	173,212,162,175,156,164,114,192
+.byte	183,253,147,38,54,63,247,204
+.byte	52,165,229,241,113,216,49,21
+.byte	4,199,35,195,24,150,5,154
+.byte	7,18,128,226,235,39,178,117
+.byte	9,131,44,26,27,110,90,160
+.byte	82,59,214,179,41,227,47,132
+.byte	83,209,0,237,32,252,177,91
+.byte	106,203,190,57,74,76,88,207
+.byte	208,239,170,251,67,77,51,133
+.byte	69,249,2,127,80,60,159,168
+.byte	81,163,64,143,146,157,56,245
+.byte	188,182,218,33,16,255,243,210
+.byte	205,12,19,236,95,151,68,23
+.byte	196,167,126,61,100,93,25,115
+.byte	96,129,79,220,34,42,144,136
+.byte	70,238,184,20,222,94,11,219
+.byte	224,50,58,10,73,6,36,92
+.byte	194,211,172,98,145,149,228,121
+.byte	231,200,55,109,141,213,78,169
+.byte	108,86,244,234,101,122,174,8
+.byte	186,120,37,46,28,166,180,198
+.byte	232,221,116,31,75,189,139,138
+.byte	112,62,181,102,72,3,246,14
+.byte	97,53,87,185,134,193,29,158
+.byte	225,248,152,17,105,217,142,148
+.byte	155,30,135,233,206,85,40,223
+.byte	140,161,137,13,191,230,66,104
+.byte	65,153,45,15,176,84,187,22
+.byte	99,124,119,123,242,107,111,197
+.byte	48,1,103,43,254,215,171,118
+.byte	202,130,201,125,250,89,71,240
+.byte	173,212,162,175,156,164,114,192
+.byte	183,253,147,38,54,63,247,204
+.byte	52,165,229,241,113,216,49,21
+.byte	4,199,35,195,24,150,5,154
+.byte	7,18,128,226,235,39,178,117
+.byte	9,131,44,26,27,110,90,160
+.byte	82,59,214,179,41,227,47,132
+.byte	83,209,0,237,32,252,177,91
+.byte	106,203,190,57,74,76,88,207
+.byte	208,239,170,251,67,77,51,133
+.byte	69,249,2,127,80,60,159,168
+.byte	81,163,64,143,146,157,56,245
+.byte	188,182,218,33,16,255,243,210
+.byte	205,12,19,236,95,151,68,23
+.byte	196,167,126,61,100,93,25,115
+.byte	96,129,79,220,34,42,144,136
+.byte	70,238,184,20,222,94,11,219
+.byte	224,50,58,10,73,6,36,92
+.byte	194,211,172,98,145,149,228,121
+.byte	231,200,55,109,141,213,78,169
+.byte	108,86,244,234,101,122,174,8
+.byte	186,120,37,46,28,166,180,198
+.byte	232,221,116,31,75,189,139,138
+.byte	112,62,181,102,72,3,246,14
+.byte	97,53,87,185,134,193,29,158
+.byte	225,248,152,17,105,217,142,148
+.byte	155,30,135,233,206,85,40,223
+.byte	140,161,137,13,191,230,66,104
+.byte	65,153,45,15,176,84,187,22
+.byte	99,124,119,123,242,107,111,197
+.byte	48,1,103,43,254,215,171,118
+.byte	202,130,201,125,250,89,71,240
+.byte	173,212,162,175,156,164,114,192
+.byte	183,253,147,38,54,63,247,204
+.byte	52,165,229,241,113,216,49,21
+.byte	4,199,35,195,24,150,5,154
+.byte	7,18,128,226,235,39,178,117
+.byte	9,131,44,26,27,110,90,160
+.byte	82,59,214,179,41,227,47,132
+.byte	83,209,0,237,32,252,177,91
+.byte	106,203,190,57,74,76,88,207
+.byte	208,239,170,251,67,77,51,133
+.byte	69,249,2,127,80,60,159,168
+.byte	81,163,64,143,146,157,56,245
+.byte	188,182,218,33,16,255,243,210
+.byte	205,12,19,236,95,151,68,23
+.byte	196,167,126,61,100,93,25,115
+.byte	96,129,79,220,34,42,144,136
+.byte	70,238,184,20,222,94,11,219
+.byte	224,50,58,10,73,6,36,92
+.byte	194,211,172,98,145,149,228,121
+.byte	231,200,55,109,141,213,78,169
+.byte	108,86,244,234,101,122,174,8
+.byte	186,120,37,46,28,166,180,198
+.byte	232,221,116,31,75,189,139,138
+.byte	112,62,181,102,72,3,246,14
+.byte	97,53,87,185,134,193,29,158
+.byte	225,248,152,17,105,217,142,148
+.byte	155,30,135,233,206,85,40,223
+.byte	140,161,137,13,191,230,66,104
+.byte	65,153,45,15,176,84,187,22
+.long	1,2,4,8
+.long	16,32,64,128
+.long	27,54,0,0
+.long	0,0,0,0
+.globl	_asm_AES_encrypt
+.private_extern	_asm_AES_encrypt
+.align	4
+_asm_AES_encrypt:
+L_asm_AES_encrypt_begin:
+	pushl	%ebp
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+	movl	20(%esp),%esi
+	movl	28(%esp),%edi
+	movl	%esp,%eax
+	subl	$36,%esp
+	andl	$-64,%esp
+	leal	-127(%edi),%ebx
+	subl	%esp,%ebx
+	negl	%ebx
+	andl	$960,%ebx
+	subl	%ebx,%esp
+	addl	$4,%esp
+	movl	%eax,28(%esp)
+	call	L004pic_point
+L004pic_point:
+	popl	%ebp
+	movl	L_OPENSSL_ia32cap_P$non_lazy_ptr-L004pic_point(%ebp),%eax
+	leal	LAES_Te-L004pic_point(%ebp),%ebp
+	leal	764(%esp),%ebx
+	subl	%ebp,%ebx
+	andl	$768,%ebx
+	leal	2176(%ebp,%ebx,1),%ebp
+	btl	$25,(%eax)
+	jnc	L005x86
+	movq	(%esi),%mm0
+	movq	8(%esi),%mm4
+	call	__sse_AES_encrypt_compact
+	movl	28(%esp),%esp
+	movl	24(%esp),%esi
+	movq	%mm0,(%esi)
+	movq	%mm4,8(%esi)
+	emms
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.align	4,0x90
+L005x86:
+	movl	%ebp,24(%esp)
+	movl	(%esi),%eax
+	movl	4(%esi),%ebx
+	movl	8(%esi),%ecx
+	movl	12(%esi),%edx
+	call	__x86_AES_encrypt_compact
+	movl	28(%esp),%esp
+	movl	24(%esp),%esi
+	movl	%eax,(%esi)
+	movl	%ebx,4(%esi)
+	movl	%ecx,8(%esi)
+	movl	%edx,12(%esi)
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.private_extern	__x86_AES_decrypt_compact
+.align	4
+__x86_AES_decrypt_compact:
+	movl	%edi,20(%esp)
+	xorl	(%edi),%eax
+	xorl	4(%edi),%ebx
+	xorl	8(%edi),%ecx
+	xorl	12(%edi),%edx
+	movl	240(%edi),%esi
+	leal	-2(%esi,%esi,1),%esi
+	leal	(%edi,%esi,8),%esi
+	movl	%esi,24(%esp)
+	movl	-128(%ebp),%edi
+	movl	-96(%ebp),%esi
+	movl	-64(%ebp),%edi
+	movl	-32(%ebp),%esi
+	movl	(%ebp),%edi
+	movl	32(%ebp),%esi
+	movl	64(%ebp),%edi
+	movl	96(%ebp),%esi
+.align	4,0x90
+L006loop:
+	movl	%eax,%esi
+	andl	$255,%esi
+	movzbl	-128(%ebp,%esi,1),%esi
+	movzbl	%dh,%edi
+	movzbl	-128(%ebp,%edi,1),%edi
+	shll	$8,%edi
+	xorl	%edi,%esi
+	movl	%ecx,%edi
+	shrl	$16,%edi
+	andl	$255,%edi
+	movzbl	-128(%ebp,%edi,1),%edi
+	shll	$16,%edi
+	xorl	%edi,%esi
+	movl	%ebx,%edi
+	shrl	$24,%edi
+	movzbl	-128(%ebp,%edi,1),%edi
+	shll	$24,%edi
+	xorl	%edi,%esi
+	movl	%esi,4(%esp)
+	movl	%ebx,%esi
+	andl	$255,%esi
+	movzbl	-128(%ebp,%esi,1),%esi
+	movzbl	%ah,%edi
+	movzbl	-128(%ebp,%edi,1),%edi
+	shll	$8,%edi
+	xorl	%edi,%esi
+	movl	%edx,%edi
+	shrl	$16,%edi
+	andl	$255,%edi
+	movzbl	-128(%ebp,%edi,1),%edi
+	shll	$16,%edi
+	xorl	%edi,%esi
+	movl	%ecx,%edi
+	shrl	$24,%edi
+	movzbl	-128(%ebp,%edi,1),%edi
+	shll	$24,%edi
+	xorl	%edi,%esi
+	movl	%esi,8(%esp)
+	movl	%ecx,%esi
+	andl	$255,%esi
+	movzbl	-128(%ebp,%esi,1),%esi
+	movzbl	%bh,%edi
+	movzbl	-128(%ebp,%edi,1),%edi
+	shll	$8,%edi
+	xorl	%edi,%esi
+	movl	%eax,%edi
+	shrl	$16,%edi
+	andl	$255,%edi
+	movzbl	-128(%ebp,%edi,1),%edi
+	shll	$16,%edi
+	xorl	%edi,%esi
+	movl	%edx,%edi
+	shrl	$24,%edi
+	movzbl	-128(%ebp,%edi,1),%edi
+	shll	$24,%edi
+	xorl	%edi,%esi
+	andl	$255,%edx
+	movzbl	-128(%ebp,%edx,1),%edx
+	movzbl	%ch,%ecx
+	movzbl	-128(%ebp,%ecx,1),%ecx
+	shll	$8,%ecx
+	xorl	%ecx,%edx
+	movl	%esi,%ecx
+	shrl	$16,%ebx
+	andl	$255,%ebx
+	movzbl	-128(%ebp,%ebx,1),%ebx
+	shll	$16,%ebx
+	xorl	%ebx,%edx
+	shrl	$24,%eax
+	movzbl	-128(%ebp,%eax,1),%eax
+	shll	$24,%eax
+	xorl	%eax,%edx
+	movl	$2155905152,%edi
+	andl	%ecx,%edi
+	movl	%edi,%esi
+	shrl	$7,%edi
+	leal	(%ecx,%ecx,1),%eax
+	subl	%edi,%esi
+	andl	$4278124286,%eax
+	andl	$454761243,%esi
+	xorl	%esi,%eax
+	movl	$2155905152,%edi
+	andl	%eax,%edi
+	movl	%edi,%esi
+	shrl	$7,%edi
+	leal	(%eax,%eax,1),%ebx
+	subl	%edi,%esi
+	andl	$4278124286,%ebx
+	andl	$454761243,%esi
+	xorl	%ecx,%eax
+	xorl	%esi,%ebx
+	movl	$2155905152,%edi
+	andl	%ebx,%edi
+	movl	%edi,%esi
+	shrl	$7,%edi
+	leal	(%ebx,%ebx,1),%ebp
+	subl	%edi,%esi
+	andl	$4278124286,%ebp
+	andl	$454761243,%esi
+	xorl	%ecx,%ebx
+	roll	$8,%ecx
+	xorl	%esi,%ebp
+	xorl	%eax,%ecx
+	xorl	%ebp,%eax
+	xorl	%ebx,%ecx
+	xorl	%ebp,%ebx
+	roll	$24,%eax
+	xorl	%ebp,%ecx
+	roll	$16,%ebx
+	xorl	%eax,%ecx
+	roll	$8,%ebp
+	xorl	%ebx,%ecx
+	movl	4(%esp),%eax
+	xorl	%ebp,%ecx
+	movl	%ecx,12(%esp)
+	movl	$2155905152,%edi
+	andl	%edx,%edi
+	movl	%edi,%esi
+	shrl	$7,%edi
+	leal	(%edx,%edx,1),%ebx
+	subl	%edi,%esi
+	andl	$4278124286,%ebx
+	andl	$454761243,%esi
+	xorl	%esi,%ebx
+	movl	$2155905152,%edi
+	andl	%ebx,%edi
+	movl	%edi,%esi
+	shrl	$7,%edi
+	leal	(%ebx,%ebx,1),%ecx
+	subl	%edi,%esi
+	andl	$4278124286,%ecx
+	andl	$454761243,%esi
+	xorl	%edx,%ebx
+	xorl	%esi,%ecx
+	movl	$2155905152,%edi
+	andl	%ecx,%edi
+	movl	%edi,%esi
+	shrl	$7,%edi
+	leal	(%ecx,%ecx,1),%ebp
+	subl	%edi,%esi
+	andl	$4278124286,%ebp
+	andl	$454761243,%esi
+	xorl	%edx,%ecx
+	roll	$8,%edx
+	xorl	%esi,%ebp
+	xorl	%ebx,%edx
+	xorl	%ebp,%ebx
+	xorl	%ecx,%edx
+	xorl	%ebp,%ecx
+	roll	$24,%ebx
+	xorl	%ebp,%edx
+	roll	$16,%ecx
+	xorl	%ebx,%edx
+	roll	$8,%ebp
+	xorl	%ecx,%edx
+	movl	8(%esp),%ebx
+	xorl	%ebp,%edx
+	movl	%edx,16(%esp)
+	movl	$2155905152,%edi
+	andl	%eax,%edi
+	movl	%edi,%esi
+	shrl	$7,%edi
+	leal	(%eax,%eax,1),%ecx
+	subl	%edi,%esi
+	andl	$4278124286,%ecx
+	andl	$454761243,%esi
+	xorl	%esi,%ecx
+	movl	$2155905152,%edi
+	andl	%ecx,%edi
+	movl	%edi,%esi
+	shrl	$7,%edi
+	leal	(%ecx,%ecx,1),%edx
+	subl	%edi,%esi
+	andl	$4278124286,%edx
+	andl	$454761243,%esi
+	xorl	%eax,%ecx
+	xorl	%esi,%edx
+	movl	$2155905152,%edi
+	andl	%edx,%edi
+	movl	%edi,%esi
+	shrl	$7,%edi
+	leal	(%edx,%edx,1),%ebp
+	subl	%edi,%esi
+	andl	$4278124286,%ebp
+	andl	$454761243,%esi
+	xorl	%eax,%edx
+	roll	$8,%eax
+	xorl	%esi,%ebp
+	xorl	%ecx,%eax
+	xorl	%ebp,%ecx
+	xorl	%edx,%eax
+	xorl	%ebp,%edx
+	roll	$24,%ecx
+	xorl	%ebp,%eax
+	roll	$16,%edx
+	xorl	%ecx,%eax
+	roll	$8,%ebp
+	xorl	%edx,%eax
+	xorl	%ebp,%eax
+	movl	$2155905152,%edi
+	andl	%ebx,%edi
+	movl	%edi,%esi
+	shrl	$7,%edi
+	leal	(%ebx,%ebx,1),%ecx
+	subl	%edi,%esi
+	andl	$4278124286,%ecx
+	andl	$454761243,%esi
+	xorl	%esi,%ecx
+	movl	$2155905152,%edi
+	andl	%ecx,%edi
+	movl	%edi,%esi
+	shrl	$7,%edi
+	leal	(%ecx,%ecx,1),%edx
+	subl	%edi,%esi
+	andl	$4278124286,%edx
+	andl	$454761243,%esi
+	xorl	%ebx,%ecx
+	xorl	%esi,%edx
+	movl	$2155905152,%edi
+	andl	%edx,%edi
+	movl	%edi,%esi
+	shrl	$7,%edi
+	leal	(%edx,%edx,1),%ebp
+	subl	%edi,%esi
+	andl	$4278124286,%ebp
+	andl	$454761243,%esi
+	xorl	%ebx,%edx
+	roll	$8,%ebx
+	xorl	%esi,%ebp
+	xorl	%ecx,%ebx
+	xorl	%ebp,%ecx
+	xorl	%edx,%ebx
+	xorl	%ebp,%edx
+	roll	$24,%ecx
+	xorl	%ebp,%ebx
+	roll	$16,%edx
+	xorl	%ecx,%ebx
+	roll	$8,%ebp
+	xorl	%edx,%ebx
+	movl	12(%esp),%ecx
+	xorl	%ebp,%ebx
+	movl	16(%esp),%edx
+	movl	20(%esp),%edi
+	movl	28(%esp),%ebp
+	addl	$16,%edi
+	xorl	(%edi),%eax
+	xorl	4(%edi),%ebx
+	xorl	8(%edi),%ecx
+	xorl	12(%edi),%edx
+	cmpl	24(%esp),%edi
+	movl	%edi,20(%esp)
+	jb	L006loop
+	movl	%eax,%esi
+	andl	$255,%esi
+	movzbl	-128(%ebp,%esi,1),%esi
+	movzbl	%dh,%edi
+	movzbl	-128(%ebp,%edi,1),%edi
+	shll	$8,%edi
+	xorl	%edi,%esi
+	movl	%ecx,%edi
+	shrl	$16,%edi
+	andl	$255,%edi
+	movzbl	-128(%ebp,%edi,1),%edi
+	shll	$16,%edi
+	xorl	%edi,%esi
+	movl	%ebx,%edi
+	shrl	$24,%edi
+	movzbl	-128(%ebp,%edi,1),%edi
+	shll	$24,%edi
+	xorl	%edi,%esi
+	movl	%esi,4(%esp)
+	movl	%ebx,%esi
+	andl	$255,%esi
+	movzbl	-128(%ebp,%esi,1),%esi
+	movzbl	%ah,%edi
+	movzbl	-128(%ebp,%edi,1),%edi
+	shll	$8,%edi
+	xorl	%edi,%esi
+	movl	%edx,%edi
+	shrl	$16,%edi
+	andl	$255,%edi
+	movzbl	-128(%ebp,%edi,1),%edi
+	shll	$16,%edi
+	xorl	%edi,%esi
+	movl	%ecx,%edi
+	shrl	$24,%edi
+	movzbl	-128(%ebp,%edi,1),%edi
+	shll	$24,%edi
+	xorl	%edi,%esi
+	movl	%esi,8(%esp)
+	movl	%ecx,%esi
+	andl	$255,%esi
+	movzbl	-128(%ebp,%esi,1),%esi
+	movzbl	%bh,%edi
+	movzbl	-128(%ebp,%edi,1),%edi
+	shll	$8,%edi
+	xorl	%edi,%esi
+	movl	%eax,%edi
+	shrl	$16,%edi
+	andl	$255,%edi
+	movzbl	-128(%ebp,%edi,1),%edi
+	shll	$16,%edi
+	xorl	%edi,%esi
+	movl	%edx,%edi
+	shrl	$24,%edi
+	movzbl	-128(%ebp,%edi,1),%edi
+	shll	$24,%edi
+	xorl	%edi,%esi
+	movl	20(%esp),%edi
+	andl	$255,%edx
+	movzbl	-128(%ebp,%edx,1),%edx
+	movzbl	%ch,%ecx
+	movzbl	-128(%ebp,%ecx,1),%ecx
+	shll	$8,%ecx
+	xorl	%ecx,%edx
+	movl	%esi,%ecx
+	shrl	$16,%ebx
+	andl	$255,%ebx
+	movzbl	-128(%ebp,%ebx,1),%ebx
+	shll	$16,%ebx
+	xorl	%ebx,%edx
+	movl	8(%esp),%ebx
+	shrl	$24,%eax
+	movzbl	-128(%ebp,%eax,1),%eax
+	shll	$24,%eax
+	xorl	%eax,%edx
+	movl	4(%esp),%eax
+	xorl	16(%edi),%eax
+	xorl	20(%edi),%ebx
+	xorl	24(%edi),%ecx
+	xorl	28(%edi),%edx
+	ret
+.private_extern	__sse_AES_decrypt_compact
+.align	4
+__sse_AES_decrypt_compact:
+	pxor	(%edi),%mm0
+	pxor	8(%edi),%mm4
+	movl	240(%edi),%esi
+	leal	-2(%esi,%esi,1),%esi
+	leal	(%edi,%esi,8),%esi
+	movl	%esi,24(%esp)
+	movl	$454761243,%eax
+	movl	%eax,8(%esp)
+	movl	%eax,12(%esp)
+	movl	-128(%ebp),%eax
+	movl	-96(%ebp),%ebx
+	movl	-64(%ebp),%ecx
+	movl	-32(%ebp),%edx
+	movl	(%ebp),%eax
+	movl	32(%ebp),%ebx
+	movl	64(%ebp),%ecx
+	movl	96(%ebp),%edx
+.align	4,0x90
+L007loop:
+	pshufw	$12,%mm0,%mm1
+	pshufw	$9,%mm4,%mm5
+	movd	%mm1,%eax
+	movd	%mm5,%ebx
+	movl	%edi,20(%esp)
+	movzbl	%al,%esi
+	movzbl	%ah,%edx
+	pshufw	$6,%mm0,%mm2
+	movzbl	-128(%ebp,%esi,1),%ecx
+	movzbl	%bl,%edi
+	movzbl	-128(%ebp,%edx,1),%edx
+	shrl	$16,%eax
+	shll	$8,%edx
+	movzbl	-128(%ebp,%edi,1),%esi
+	movzbl	%bh,%edi
+	shll	$16,%esi
+	pshufw	$3,%mm4,%mm6
+	orl	%esi,%ecx
+	movzbl	-128(%ebp,%edi,1),%esi
+	movzbl	%ah,%edi
+	shll	$24,%esi
+	shrl	$16,%ebx
+	orl	%esi,%edx
+	movzbl	-128(%ebp,%edi,1),%esi
+	movzbl	%bh,%edi
+	shll	$24,%esi
+	orl	%esi,%ecx
+	movzbl	-128(%ebp,%edi,1),%esi
+	movzbl	%al,%edi
+	shll	$8,%esi
+	movd	%mm2,%eax
+	orl	%esi,%ecx
+	movzbl	-128(%ebp,%edi,1),%esi
+	movzbl	%bl,%edi
+	shll	$16,%esi
+	movd	%mm6,%ebx
+	movd	%ecx,%mm0
+	movzbl	-128(%ebp,%edi,1),%ecx
+	movzbl	%al,%edi
+	orl	%esi,%ecx
+	movzbl	-128(%ebp,%edi,1),%esi
+	movzbl	%bl,%edi
+	orl	%esi,%edx
+	movzbl	-128(%ebp,%edi,1),%esi
+	movzbl	%ah,%edi
+	shll	$16,%esi
+	shrl	$16,%eax
+	orl	%esi,%edx
+	movzbl	-128(%ebp,%edi,1),%esi
+	movzbl	%bh,%edi
+	shrl	$16,%ebx
+	shll	$8,%esi
+	movd	%edx,%mm1
+	movzbl	-128(%ebp,%edi,1),%edx
+	movzbl	%bh,%edi
+	shll	$24,%edx
+	andl	$255,%ebx
+	orl	%esi,%edx
+	punpckldq	%mm1,%mm0
+	movzbl	-128(%ebp,%edi,1),%esi
+	movzbl	%al,%edi
+	shll	$8,%esi
+	movzbl	%ah,%eax
+	movzbl	-128(%ebp,%ebx,1),%ebx
+	orl	%esi,%ecx
+	movzbl	-128(%ebp,%edi,1),%esi
+	orl	%ebx,%edx
+	shll	$16,%esi
+	movzbl	-128(%ebp,%eax,1),%eax
+	orl	%esi,%edx
+	shll	$24,%eax
+	orl	%eax,%ecx
+	movl	20(%esp),%edi
+	movd	%edx,%mm4
+	movd	%ecx,%mm5
+	punpckldq	%mm5,%mm4
+	addl	$16,%edi
+	cmpl	24(%esp),%edi
+	ja	L008out
+	movq	%mm0,%mm3
+	movq	%mm4,%mm7
+	pshufw	$228,%mm0,%mm2
+	pshufw	$228,%mm4,%mm6
+	movq	%mm0,%mm1
+	movq	%mm4,%mm5
+	pshufw	$177,%mm0,%mm0
+	pshufw	$177,%mm4,%mm4
+	pslld	$8,%mm2
+	pslld	$8,%mm6
+	psrld	$8,%mm3
+	psrld	$8,%mm7
+	pxor	%mm2,%mm0
+	pxor	%mm6,%mm4
+	pxor	%mm3,%mm0
+	pxor	%mm7,%mm4
+	pslld	$16,%mm2
+	pslld	$16,%mm6
+	psrld	$16,%mm3
+	psrld	$16,%mm7
+	pxor	%mm2,%mm0
+	pxor	%mm6,%mm4
+	pxor	%mm3,%mm0
+	pxor	%mm7,%mm4
+	movq	8(%esp),%mm3
+	pxor	%mm2,%mm2
+	pxor	%mm6,%mm6
+	pcmpgtb	%mm1,%mm2
+	pcmpgtb	%mm5,%mm6
+	pand	%mm3,%mm2
+	pand	%mm3,%mm6
+	paddb	%mm1,%mm1
+	paddb	%mm5,%mm5
+	pxor	%mm2,%mm1
+	pxor	%mm6,%mm5
+	movq	%mm1,%mm3
+	movq	%mm5,%mm7
+	movq	%mm1,%mm2
+	movq	%mm5,%mm6
+	pxor	%mm1,%mm0
+	pxor	%mm5,%mm4
+	pslld	$24,%mm3
+	pslld	$24,%mm7
+	psrld	$8,%mm2
+	psrld	$8,%mm6
+	pxor	%mm3,%mm0
+	pxor	%mm7,%mm4
+	pxor	%mm2,%mm0
+	pxor	%mm6,%mm4
+	movq	8(%esp),%mm2
+	pxor	%mm3,%mm3
+	pxor	%mm7,%mm7
+	pcmpgtb	%mm1,%mm3
+	pcmpgtb	%mm5,%mm7
+	pand	%mm2,%mm3
+	pand	%mm2,%mm7
+	paddb	%mm1,%mm1
+	paddb	%mm5,%mm5
+	pxor	%mm3,%mm1
+	pxor	%mm7,%mm5
+	pshufw	$177,%mm1,%mm3
+	pshufw	$177,%mm5,%mm7
+	pxor	%mm1,%mm0
+	pxor	%mm5,%mm4
+	pxor	%mm3,%mm0
+	pxor	%mm7,%mm4
+	pxor	%mm3,%mm3
+	pxor	%mm7,%mm7
+	pcmpgtb	%mm1,%mm3
+	pcmpgtb	%mm5,%mm7
+	pand	%mm2,%mm3
+	pand	%mm2,%mm7
+	paddb	%mm1,%mm1
+	paddb	%mm5,%mm5
+	pxor	%mm3,%mm1
+	pxor	%mm7,%mm5
+	pxor	%mm1,%mm0
+	pxor	%mm5,%mm4
+	movq	%mm1,%mm3
+	movq	%mm5,%mm7
+	pshufw	$177,%mm1,%mm2
+	pshufw	$177,%mm5,%mm6
+	pxor	%mm2,%mm0
+	pxor	%mm6,%mm4
+	pslld	$8,%mm1
+	pslld	$8,%mm5
+	psrld	$8,%mm3
+	psrld	$8,%mm7
+	movq	(%edi),%mm2
+	movq	8(%edi),%mm6
+	pxor	%mm1,%mm0
+	pxor	%mm5,%mm4
+	pxor	%mm3,%mm0
+	pxor	%mm7,%mm4
+	movl	-128(%ebp),%eax
+	pslld	$16,%mm1
+	pslld	$16,%mm5
+	movl	-64(%ebp),%ebx
+	psrld	$16,%mm3
+	psrld	$16,%mm7
+	movl	(%ebp),%ecx
+	pxor	%mm1,%mm0
+	pxor	%mm5,%mm4
+	movl	64(%ebp),%edx
+	pxor	%mm3,%mm0
+	pxor	%mm7,%mm4
+	pxor	%mm2,%mm0
+	pxor	%mm6,%mm4
+	jmp	L007loop
+.align	4,0x90
+L008out:
+	pxor	(%edi),%mm0
+	pxor	8(%edi),%mm4
+	ret
+.private_extern	__x86_AES_decrypt
+.align	4
+__x86_AES_decrypt:
+	movl	%edi,20(%esp)
+	xorl	(%edi),%eax
+	xorl	4(%edi),%ebx
+	xorl	8(%edi),%ecx
+	xorl	12(%edi),%edx
+	movl	240(%edi),%esi
+	leal	-2(%esi,%esi,1),%esi
+	leal	(%edi,%esi,8),%esi
+	movl	%esi,24(%esp)
+.align	4,0x90
+L009loop:
+	movl	%eax,%esi
+	andl	$255,%esi
+	movl	(%ebp,%esi,8),%esi
+	movzbl	%dh,%edi
+	xorl	3(%ebp,%edi,8),%esi
+	movl	%ecx,%edi
+	shrl	$16,%edi
+	andl	$255,%edi
+	xorl	2(%ebp,%edi,8),%esi
+	movl	%ebx,%edi
+	shrl	$24,%edi
+	xorl	1(%ebp,%edi,8),%esi
+	movl	%esi,4(%esp)
+	movl	%ebx,%esi
+	andl	$255,%esi
+	movl	(%ebp,%esi,8),%esi
+	movzbl	%ah,%edi
+	xorl	3(%ebp,%edi,8),%esi
+	movl	%edx,%edi
+	shrl	$16,%edi
+	andl	$255,%edi
+	xorl	2(%ebp,%edi,8),%esi
+	movl	%ecx,%edi
+	shrl	$24,%edi
+	xorl	1(%ebp,%edi,8),%esi
+	movl	%esi,8(%esp)
+	movl	%ecx,%esi
+	andl	$255,%esi
+	movl	(%ebp,%esi,8),%esi
+	movzbl	%bh,%edi
+	xorl	3(%ebp,%edi,8),%esi
+	movl	%eax,%edi
+	shrl	$16,%edi
+	andl	$255,%edi
+	xorl	2(%ebp,%edi,8),%esi
+	movl	%edx,%edi
+	shrl	$24,%edi
+	xorl	1(%ebp,%edi,8),%esi
+	movl	20(%esp),%edi
+	andl	$255,%edx
+	movl	(%ebp,%edx,8),%edx
+	movzbl	%ch,%ecx
+	xorl	3(%ebp,%ecx,8),%edx
+	movl	%esi,%ecx
+	shrl	$16,%ebx
+	andl	$255,%ebx
+	xorl	2(%ebp,%ebx,8),%edx
+	movl	8(%esp),%ebx
+	shrl	$24,%eax
+	xorl	1(%ebp,%eax,8),%edx
+	movl	4(%esp),%eax
+	addl	$16,%edi
+	xorl	(%edi),%eax
+	xorl	4(%edi),%ebx
+	xorl	8(%edi),%ecx
+	xorl	12(%edi),%edx
+	cmpl	24(%esp),%edi
+	movl	%edi,20(%esp)
+	jb	L009loop
+	leal	2176(%ebp),%ebp
+	movl	-128(%ebp),%edi
+	movl	-96(%ebp),%esi
+	movl	-64(%ebp),%edi
+	movl	-32(%ebp),%esi
+	movl	(%ebp),%edi
+	movl	32(%ebp),%esi
+	movl	64(%ebp),%edi
+	movl	96(%ebp),%esi
+	leal	-128(%ebp),%ebp
+	movl	%eax,%esi
+	andl	$255,%esi
+	movzbl	(%ebp,%esi,1),%esi
+	movzbl	%dh,%edi
+	movzbl	(%ebp,%edi,1),%edi
+	shll	$8,%edi
+	xorl	%edi,%esi
+	movl	%ecx,%edi
+	shrl	$16,%edi
+	andl	$255,%edi
+	movzbl	(%ebp,%edi,1),%edi
+	shll	$16,%edi
+	xorl	%edi,%esi
+	movl	%ebx,%edi
+	shrl	$24,%edi
+	movzbl	(%ebp,%edi,1),%edi
+	shll	$24,%edi
+	xorl	%edi,%esi
+	movl	%esi,4(%esp)
+	movl	%ebx,%esi
+	andl	$255,%esi
+	movzbl	(%ebp,%esi,1),%esi
+	movzbl	%ah,%edi
+	movzbl	(%ebp,%edi,1),%edi
+	shll	$8,%edi
+	xorl	%edi,%esi
+	movl	%edx,%edi
+	shrl	$16,%edi
+	andl	$255,%edi
+	movzbl	(%ebp,%edi,1),%edi
+	shll	$16,%edi
+	xorl	%edi,%esi
+	movl	%ecx,%edi
+	shrl	$24,%edi
+	movzbl	(%ebp,%edi,1),%edi
+	shll	$24,%edi
+	xorl	%edi,%esi
+	movl	%esi,8(%esp)
+	movl	%ecx,%esi
+	andl	$255,%esi
+	movzbl	(%ebp,%esi,1),%esi
+	movzbl	%bh,%edi
+	movzbl	(%ebp,%edi,1),%edi
+	shll	$8,%edi
+	xorl	%edi,%esi
+	movl	%eax,%edi
+	shrl	$16,%edi
+	andl	$255,%edi
+	movzbl	(%ebp,%edi,1),%edi
+	shll	$16,%edi
+	xorl	%edi,%esi
+	movl	%edx,%edi
+	shrl	$24,%edi
+	movzbl	(%ebp,%edi,1),%edi
+	shll	$24,%edi
+	xorl	%edi,%esi
+	movl	20(%esp),%edi
+	andl	$255,%edx
+	movzbl	(%ebp,%edx,1),%edx
+	movzbl	%ch,%ecx
+	movzbl	(%ebp,%ecx,1),%ecx
+	shll	$8,%ecx
+	xorl	%ecx,%edx
+	movl	%esi,%ecx
+	shrl	$16,%ebx
+	andl	$255,%ebx
+	movzbl	(%ebp,%ebx,1),%ebx
+	shll	$16,%ebx
+	xorl	%ebx,%edx
+	movl	8(%esp),%ebx
+	shrl	$24,%eax
+	movzbl	(%ebp,%eax,1),%eax
+	shll	$24,%eax
+	xorl	%eax,%edx
+	movl	4(%esp),%eax
+	leal	-2048(%ebp),%ebp
+	addl	$16,%edi
+	xorl	(%edi),%eax
+	xorl	4(%edi),%ebx
+	xorl	8(%edi),%ecx
+	xorl	12(%edi),%edx
+	ret
+.align	6,0x90
+LAES_Td:
+.long	1353184337,1353184337
+.long	1399144830,1399144830
+.long	3282310938,3282310938
+.long	2522752826,2522752826
+.long	3412831035,3412831035
+.long	4047871263,4047871263
+.long	2874735276,2874735276
+.long	2466505547,2466505547
+.long	1442459680,1442459680
+.long	4134368941,4134368941
+.long	2440481928,2440481928
+.long	625738485,625738485
+.long	4242007375,4242007375
+.long	3620416197,3620416197
+.long	2151953702,2151953702
+.long	2409849525,2409849525
+.long	1230680542,1230680542
+.long	1729870373,1729870373
+.long	2551114309,2551114309
+.long	3787521629,3787521629
+.long	41234371,41234371
+.long	317738113,317738113
+.long	2744600205,2744600205
+.long	3338261355,3338261355
+.long	3881799427,3881799427
+.long	2510066197,2510066197
+.long	3950669247,3950669247
+.long	3663286933,3663286933
+.long	763608788,763608788
+.long	3542185048,3542185048
+.long	694804553,694804553
+.long	1154009486,1154009486
+.long	1787413109,1787413109
+.long	2021232372,2021232372
+.long	1799248025,1799248025
+.long	3715217703,3715217703
+.long	3058688446,3058688446
+.long	397248752,397248752
+.long	1722556617,1722556617
+.long	3023752829,3023752829
+.long	407560035,407560035
+.long	2184256229,2184256229
+.long	1613975959,1613975959
+.long	1165972322,1165972322
+.long	3765920945,3765920945
+.long	2226023355,2226023355
+.long	480281086,480281086
+.long	2485848313,2485848313
+.long	1483229296,1483229296
+.long	436028815,436028815
+.long	2272059028,2272059028
+.long	3086515026,3086515026
+.long	601060267,601060267
+.long	3791801202,3791801202
+.long	1468997603,1468997603
+.long	715871590,715871590
+.long	120122290,120122290
+.long	63092015,63092015
+.long	2591802758,2591802758
+.long	2768779219,2768779219
+.long	4068943920,4068943920
+.long	2997206819,2997206819
+.long	3127509762,3127509762
+.long	1552029421,1552029421
+.long	723308426,723308426
+.long	2461301159,2461301159
+.long	4042393587,4042393587
+.long	2715969870,2715969870
+.long	3455375973,3455375973
+.long	3586000134,3586000134
+.long	526529745,526529745
+.long	2331944644,2331944644
+.long	2639474228,2639474228
+.long	2689987490,2689987490
+.long	853641733,853641733
+.long	1978398372,1978398372
+.long	971801355,971801355
+.long	2867814464,2867814464
+.long	111112542,111112542
+.long	1360031421,1360031421
+.long	4186579262,4186579262
+.long	1023860118,1023860118
+.long	2919579357,2919579357
+.long	1186850381,1186850381
+.long	3045938321,3045938321
+.long	90031217,90031217
+.long	1876166148,1876166148
+.long	4279586912,4279586912
+.long	620468249,620468249
+.long	2548678102,2548678102
+.long	3426959497,3426959497
+.long	2006899047,2006899047
+.long	3175278768,3175278768
+.long	2290845959,2290845959
+.long	945494503,945494503
+.long	3689859193,3689859193
+.long	1191869601,1191869601
+.long	3910091388,3910091388
+.long	3374220536,3374220536
+.long	0,0
+.long	2206629897,2206629897
+.long	1223502642,1223502642
+.long	2893025566,2893025566
+.long	1316117100,1316117100
+.long	4227796733,4227796733
+.long	1446544655,1446544655
+.long	517320253,517320253
+.long	658058550,658058550
+.long	1691946762,1691946762
+.long	564550760,564550760
+.long	3511966619,3511966619
+.long	976107044,976107044
+.long	2976320012,2976320012
+.long	266819475,266819475
+.long	3533106868,3533106868
+.long	2660342555,2660342555
+.long	1338359936,1338359936
+.long	2720062561,2720062561
+.long	1766553434,1766553434
+.long	370807324,370807324
+.long	179999714,179999714
+.long	3844776128,3844776128
+.long	1138762300,1138762300
+.long	488053522,488053522
+.long	185403662,185403662
+.long	2915535858,2915535858
+.long	3114841645,3114841645
+.long	3366526484,3366526484
+.long	2233069911,2233069911
+.long	1275557295,1275557295
+.long	3151862254,3151862254
+.long	4250959779,4250959779
+.long	2670068215,2670068215
+.long	3170202204,3170202204
+.long	3309004356,3309004356
+.long	880737115,880737115
+.long	1982415755,1982415755
+.long	3703972811,3703972811
+.long	1761406390,1761406390
+.long	1676797112,1676797112
+.long	3403428311,3403428311
+.long	277177154,277177154
+.long	1076008723,1076008723
+.long	538035844,538035844
+.long	2099530373,2099530373
+.long	4164795346,4164795346
+.long	288553390,288553390
+.long	1839278535,1839278535
+.long	1261411869,1261411869
+.long	4080055004,4080055004
+.long	3964831245,3964831245
+.long	3504587127,3504587127
+.long	1813426987,1813426987
+.long	2579067049,2579067049
+.long	4199060497,4199060497
+.long	577038663,577038663
+.long	3297574056,3297574056
+.long	440397984,440397984
+.long	3626794326,3626794326
+.long	4019204898,4019204898
+.long	3343796615,3343796615
+.long	3251714265,3251714265
+.long	4272081548,4272081548
+.long	906744984,906744984
+.long	3481400742,3481400742
+.long	685669029,685669029
+.long	646887386,646887386
+.long	2764025151,2764025151
+.long	3835509292,3835509292
+.long	227702864,227702864
+.long	2613862250,2613862250
+.long	1648787028,1648787028
+.long	3256061430,3256061430
+.long	3904428176,3904428176
+.long	1593260334,1593260334
+.long	4121936770,4121936770
+.long	3196083615,3196083615
+.long	2090061929,2090061929
+.long	2838353263,2838353263
+.long	3004310991,3004310991
+.long	999926984,999926984
+.long	2809993232,2809993232
+.long	1852021992,1852021992
+.long	2075868123,2075868123
+.long	158869197,158869197
+.long	4095236462,4095236462
+.long	28809964,28809964
+.long	2828685187,2828685187
+.long	1701746150,1701746150
+.long	2129067946,2129067946
+.long	147831841,147831841
+.long	3873969647,3873969647
+.long	3650873274,3650873274
+.long	3459673930,3459673930
+.long	3557400554,3557400554
+.long	3598495785,3598495785
+.long	2947720241,2947720241
+.long	824393514,824393514
+.long	815048134,815048134
+.long	3227951669,3227951669
+.long	935087732,935087732
+.long	2798289660,2798289660
+.long	2966458592,2966458592
+.long	366520115,366520115
+.long	1251476721,1251476721
+.long	4158319681,4158319681
+.long	240176511,240176511
+.long	804688151,804688151
+.long	2379631990,2379631990
+.long	1303441219,1303441219
+.long	1414376140,1414376140
+.long	3741619940,3741619940
+.long	3820343710,3820343710
+.long	461924940,461924940
+.long	3089050817,3089050817
+.long	2136040774,2136040774
+.long	82468509,82468509
+.long	1563790337,1563790337
+.long	1937016826,1937016826
+.long	776014843,776014843
+.long	1511876531,1511876531
+.long	1389550482,1389550482
+.long	861278441,861278441
+.long	323475053,323475053
+.long	2355222426,2355222426
+.long	2047648055,2047648055
+.long	2383738969,2383738969
+.long	2302415851,2302415851
+.long	3995576782,3995576782
+.long	902390199,902390199
+.long	3991215329,3991215329
+.long	1018251130,1018251130
+.long	1507840668,1507840668
+.long	1064563285,1064563285
+.long	2043548696,2043548696
+.long	3208103795,3208103795
+.long	3939366739,3939366739
+.long	1537932639,1537932639
+.long	342834655,342834655
+.long	2262516856,2262516856
+.long	2180231114,2180231114
+.long	1053059257,1053059257
+.long	741614648,741614648
+.long	1598071746,1598071746
+.long	1925389590,1925389590
+.long	203809468,203809468
+.long	2336832552,2336832552
+.long	1100287487,1100287487
+.long	1895934009,1895934009
+.long	3736275976,3736275976
+.long	2632234200,2632234200
+.long	2428589668,2428589668
+.long	1636092795,1636092795
+.long	1890988757,1890988757
+.long	1952214088,1952214088
+.long	1113045200,1113045200
+.byte	82,9,106,213,48,54,165,56
+.byte	191,64,163,158,129,243,215,251
+.byte	124,227,57,130,155,47,255,135
+.byte	52,142,67,68,196,222,233,203
+.byte	84,123,148,50,166,194,35,61
+.byte	238,76,149,11,66,250,195,78
+.byte	8,46,161,102,40,217,36,178
+.byte	118,91,162,73,109,139,209,37
+.byte	114,248,246,100,134,104,152,22
+.byte	212,164,92,204,93,101,182,146
+.byte	108,112,72,80,253,237,185,218
+.byte	94,21,70,87,167,141,157,132
+.byte	144,216,171,0,140,188,211,10
+.byte	247,228,88,5,184,179,69,6
+.byte	208,44,30,143,202,63,15,2
+.byte	193,175,189,3,1,19,138,107
+.byte	58,145,17,65,79,103,220,234
+.byte	151,242,207,206,240,180,230,115
+.byte	150,172,116,34,231,173,53,133
+.byte	226,249,55,232,28,117,223,110
+.byte	71,241,26,113,29,41,197,137
+.byte	111,183,98,14,170,24,190,27
+.byte	252,86,62,75,198,210,121,32
+.byte	154,219,192,254,120,205,90,244
+.byte	31,221,168,51,136,7,199,49
+.byte	177,18,16,89,39,128,236,95
+.byte	96,81,127,169,25,181,74,13
+.byte	45,229,122,159,147,201,156,239
+.byte	160,224,59,77,174,42,245,176
+.byte	200,235,187,60,131,83,153,97
+.byte	23,43,4,126,186,119,214,38
+.byte	225,105,20,99,85,33,12,125
+.byte	82,9,106,213,48,54,165,56
+.byte	191,64,163,158,129,243,215,251
+.byte	124,227,57,130,155,47,255,135
+.byte	52,142,67,68,196,222,233,203
+.byte	84,123,148,50,166,194,35,61
+.byte	238,76,149,11,66,250,195,78
+.byte	8,46,161,102,40,217,36,178
+.byte	118,91,162,73,109,139,209,37
+.byte	114,248,246,100,134,104,152,22
+.byte	212,164,92,204,93,101,182,146
+.byte	108,112,72,80,253,237,185,218
+.byte	94,21,70,87,167,141,157,132
+.byte	144,216,171,0,140,188,211,10
+.byte	247,228,88,5,184,179,69,6
+.byte	208,44,30,143,202,63,15,2
+.byte	193,175,189,3,1,19,138,107
+.byte	58,145,17,65,79,103,220,234
+.byte	151,242,207,206,240,180,230,115
+.byte	150,172,116,34,231,173,53,133
+.byte	226,249,55,232,28,117,223,110
+.byte	71,241,26,113,29,41,197,137
+.byte	111,183,98,14,170,24,190,27
+.byte	252,86,62,75,198,210,121,32
+.byte	154,219,192,254,120,205,90,244
+.byte	31,221,168,51,136,7,199,49
+.byte	177,18,16,89,39,128,236,95
+.byte	96,81,127,169,25,181,74,13
+.byte	45,229,122,159,147,201,156,239
+.byte	160,224,59,77,174,42,245,176
+.byte	200,235,187,60,131,83,153,97
+.byte	23,43,4,126,186,119,214,38
+.byte	225,105,20,99,85,33,12,125
+.byte	82,9,106,213,48,54,165,56
+.byte	191,64,163,158,129,243,215,251
+.byte	124,227,57,130,155,47,255,135
+.byte	52,142,67,68,196,222,233,203
+.byte	84,123,148,50,166,194,35,61
+.byte	238,76,149,11,66,250,195,78
+.byte	8,46,161,102,40,217,36,178
+.byte	118,91,162,73,109,139,209,37
+.byte	114,248,246,100,134,104,152,22
+.byte	212,164,92,204,93,101,182,146
+.byte	108,112,72,80,253,237,185,218
+.byte	94,21,70,87,167,141,157,132
+.byte	144,216,171,0,140,188,211,10
+.byte	247,228,88,5,184,179,69,6
+.byte	208,44,30,143,202,63,15,2
+.byte	193,175,189,3,1,19,138,107
+.byte	58,145,17,65,79,103,220,234
+.byte	151,242,207,206,240,180,230,115
+.byte	150,172,116,34,231,173,53,133
+.byte	226,249,55,232,28,117,223,110
+.byte	71,241,26,113,29,41,197,137
+.byte	111,183,98,14,170,24,190,27
+.byte	252,86,62,75,198,210,121,32
+.byte	154,219,192,254,120,205,90,244
+.byte	31,221,168,51,136,7,199,49
+.byte	177,18,16,89,39,128,236,95
+.byte	96,81,127,169,25,181,74,13
+.byte	45,229,122,159,147,201,156,239
+.byte	160,224,59,77,174,42,245,176
+.byte	200,235,187,60,131,83,153,97
+.byte	23,43,4,126,186,119,214,38
+.byte	225,105,20,99,85,33,12,125
+.byte	82,9,106,213,48,54,165,56
+.byte	191,64,163,158,129,243,215,251
+.byte	124,227,57,130,155,47,255,135
+.byte	52,142,67,68,196,222,233,203
+.byte	84,123,148,50,166,194,35,61
+.byte	238,76,149,11,66,250,195,78
+.byte	8,46,161,102,40,217,36,178
+.byte	118,91,162,73,109,139,209,37
+.byte	114,248,246,100,134,104,152,22
+.byte	212,164,92,204,93,101,182,146
+.byte	108,112,72,80,253,237,185,218
+.byte	94,21,70,87,167,141,157,132
+.byte	144,216,171,0,140,188,211,10
+.byte	247,228,88,5,184,179,69,6
+.byte	208,44,30,143,202,63,15,2
+.byte	193,175,189,3,1,19,138,107
+.byte	58,145,17,65,79,103,220,234
+.byte	151,242,207,206,240,180,230,115
+.byte	150,172,116,34,231,173,53,133
+.byte	226,249,55,232,28,117,223,110
+.byte	71,241,26,113,29,41,197,137
+.byte	111,183,98,14,170,24,190,27
+.byte	252,86,62,75,198,210,121,32
+.byte	154,219,192,254,120,205,90,244
+.byte	31,221,168,51,136,7,199,49
+.byte	177,18,16,89,39,128,236,95
+.byte	96,81,127,169,25,181,74,13
+.byte	45,229,122,159,147,201,156,239
+.byte	160,224,59,77,174,42,245,176
+.byte	200,235,187,60,131,83,153,97
+.byte	23,43,4,126,186,119,214,38
+.byte	225,105,20,99,85,33,12,125
+.globl	_asm_AES_decrypt
+.private_extern	_asm_AES_decrypt
+.align	4
+_asm_AES_decrypt:
+L_asm_AES_decrypt_begin:
+	pushl	%ebp
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+	movl	20(%esp),%esi
+	movl	28(%esp),%edi
+	movl	%esp,%eax
+	subl	$36,%esp
+	andl	$-64,%esp
+	leal	-127(%edi),%ebx
+	subl	%esp,%ebx
+	negl	%ebx
+	andl	$960,%ebx
+	subl	%ebx,%esp
+	addl	$4,%esp
+	movl	%eax,28(%esp)
+	call	L010pic_point
+L010pic_point:
+	popl	%ebp
+	movl	L_OPENSSL_ia32cap_P$non_lazy_ptr-L010pic_point(%ebp),%eax
+	leal	LAES_Td-L010pic_point(%ebp),%ebp
+	leal	764(%esp),%ebx
+	subl	%ebp,%ebx
+	andl	$768,%ebx
+	leal	2176(%ebp,%ebx,1),%ebp
+	btl	$25,(%eax)
+	jnc	L011x86
+	movq	(%esi),%mm0
+	movq	8(%esi),%mm4
+	call	__sse_AES_decrypt_compact
+	movl	28(%esp),%esp
+	movl	24(%esp),%esi
+	movq	%mm0,(%esi)
+	movq	%mm4,8(%esi)
+	emms
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.align	4,0x90
+L011x86:
+	movl	%ebp,24(%esp)
+	movl	(%esi),%eax
+	movl	4(%esi),%ebx
+	movl	8(%esi),%ecx
+	movl	12(%esi),%edx
+	call	__x86_AES_decrypt_compact
+	movl	28(%esp),%esp
+	movl	24(%esp),%esi
+	movl	%eax,(%esi)
+	movl	%ebx,4(%esi)
+	movl	%ecx,8(%esi)
+	movl	%edx,12(%esi)
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.globl	_asm_AES_cbc_encrypt
+.private_extern	_asm_AES_cbc_encrypt
+.align	4
+_asm_AES_cbc_encrypt:
+L_asm_AES_cbc_encrypt_begin:
+	pushl	%ebp
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+	movl	28(%esp),%ecx
+	cmpl	$0,%ecx
+	je	L012drop_out
+	call	L013pic_point
+L013pic_point:
+	popl	%ebp
+	movl	L_OPENSSL_ia32cap_P$non_lazy_ptr-L013pic_point(%ebp),%eax
+	cmpl	$0,40(%esp)
+	leal	LAES_Te-L013pic_point(%ebp),%ebp
+	jne	L014picked_te
+	leal	LAES_Td-LAES_Te(%ebp),%ebp
+L014picked_te:
+	pushfl
+	cld
+	cmpl	$512,%ecx
+	jb	L015slow_way
+	testl	$15,%ecx
+	jnz	L015slow_way
+	btl	$28,(%eax)
+	jc	L015slow_way
+	leal	-324(%esp),%esi
+	andl	$-64,%esi
+	movl	%ebp,%eax
+	leal	2304(%ebp),%ebx
+	movl	%esi,%edx
+	andl	$4095,%eax
+	andl	$4095,%ebx
+	andl	$4095,%edx
+	cmpl	%ebx,%edx
+	jb	L016tbl_break_out
+	subl	%ebx,%edx
+	subl	%edx,%esi
+	jmp	L017tbl_ok
+.align	2,0x90
+L016tbl_break_out:
+	subl	%eax,%edx
+	andl	$4095,%edx
+	addl	$384,%edx
+	subl	%edx,%esi
+.align	2,0x90
+L017tbl_ok:
+	leal	24(%esp),%edx
+	xchgl	%esi,%esp
+	addl	$4,%esp
+	movl	%ebp,24(%esp)
+	movl	%esi,28(%esp)
+	movl	(%edx),%eax
+	movl	4(%edx),%ebx
+	movl	12(%edx),%edi
+	movl	16(%edx),%esi
+	movl	20(%edx),%edx
+	movl	%eax,32(%esp)
+	movl	%ebx,36(%esp)
+	movl	%ecx,40(%esp)
+	movl	%edi,44(%esp)
+	movl	%esi,48(%esp)
+	movl	$0,316(%esp)
+	movl	%edi,%ebx
+	movl	$61,%ecx
+	subl	%ebp,%ebx
+	movl	%edi,%esi
+	andl	$4095,%ebx
+	leal	76(%esp),%edi
+	cmpl	$2304,%ebx
+	jb	L018do_copy
+	cmpl	$3852,%ebx
+	jb	L019skip_copy
+.align	2,0x90
+L018do_copy:
+	movl	%edi,44(%esp)
+.long	2784229001
+L019skip_copy:
+	movl	$16,%edi
+.align	2,0x90
+L020prefetch_tbl:
+	movl	(%ebp),%eax
+	movl	32(%ebp),%ebx
+	movl	64(%ebp),%ecx
+	movl	96(%ebp),%esi
+	leal	128(%ebp),%ebp
+	subl	$1,%edi
+	jnz	L020prefetch_tbl
+	subl	$2048,%ebp
+	movl	32(%esp),%esi
+	movl	48(%esp),%edi
+	cmpl	$0,%edx
+	je	L021fast_decrypt
+	movl	(%edi),%eax
+	movl	4(%edi),%ebx
+.align	4,0x90
+L022fast_enc_loop:
+	movl	8(%edi),%ecx
+	movl	12(%edi),%edx
+	xorl	(%esi),%eax
+	xorl	4(%esi),%ebx
+	xorl	8(%esi),%ecx
+	xorl	12(%esi),%edx
+	movl	44(%esp),%edi
+	call	__x86_AES_encrypt
+	movl	32(%esp),%esi
+	movl	36(%esp),%edi
+	movl	%eax,(%edi)
+	movl	%ebx,4(%edi)
+	movl	%ecx,8(%edi)
+	movl	%edx,12(%edi)
+	leal	16(%esi),%esi
+	movl	40(%esp),%ecx
+	movl	%esi,32(%esp)
+	leal	16(%edi),%edx
+	movl	%edx,36(%esp)
+	subl	$16,%ecx
+	movl	%ecx,40(%esp)
+	jnz	L022fast_enc_loop
+	movl	48(%esp),%esi
+	movl	8(%edi),%ecx
+	movl	12(%edi),%edx
+	movl	%eax,(%esi)
+	movl	%ebx,4(%esi)
+	movl	%ecx,8(%esi)
+	movl	%edx,12(%esi)
+	cmpl	$0,316(%esp)
+	movl	44(%esp),%edi
+	je	L023skip_ezero
+	movl	$60,%ecx
+	xorl	%eax,%eax
+.align	2,0x90
+.long	2884892297
+L023skip_ezero:
+	movl	28(%esp),%esp
+	popfl
+L012drop_out:
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+	pushfl
+.align	4,0x90
+L021fast_decrypt:
+	cmpl	36(%esp),%esi
+	je	L024fast_dec_in_place
+	movl	%edi,52(%esp)
+.align	2,0x90
+.align	4,0x90
+L025fast_dec_loop:
+	movl	(%esi),%eax
+	movl	4(%esi),%ebx
+	movl	8(%esi),%ecx
+	movl	12(%esi),%edx
+	movl	44(%esp),%edi
+	call	__x86_AES_decrypt
+	movl	52(%esp),%edi
+	movl	40(%esp),%esi
+	xorl	(%edi),%eax
+	xorl	4(%edi),%ebx
+	xorl	8(%edi),%ecx
+	xorl	12(%edi),%edx
+	movl	36(%esp),%edi
+	movl	32(%esp),%esi
+	movl	%eax,(%edi)
+	movl	%ebx,4(%edi)
+	movl	%ecx,8(%edi)
+	movl	%edx,12(%edi)
+	movl	40(%esp),%ecx
+	movl	%esi,52(%esp)
+	leal	16(%esi),%esi
+	movl	%esi,32(%esp)
+	leal	16(%edi),%edi
+	movl	%edi,36(%esp)
+	subl	$16,%ecx
+	movl	%ecx,40(%esp)
+	jnz	L025fast_dec_loop
+	movl	52(%esp),%edi
+	movl	48(%esp),%esi
+	movl	(%edi),%eax
+	movl	4(%edi),%ebx
+	movl	8(%edi),%ecx
+	movl	12(%edi),%edx
+	movl	%eax,(%esi)
+	movl	%ebx,4(%esi)
+	movl	%ecx,8(%esi)
+	movl	%edx,12(%esi)
+	jmp	L026fast_dec_out
+.align	4,0x90
+L024fast_dec_in_place:
+L027fast_dec_in_place_loop:
+	movl	(%esi),%eax
+	movl	4(%esi),%ebx
+	movl	8(%esi),%ecx
+	movl	12(%esi),%edx
+	leal	60(%esp),%edi
+	movl	%eax,(%edi)
+	movl	%ebx,4(%edi)
+	movl	%ecx,8(%edi)
+	movl	%edx,12(%edi)
+	movl	44(%esp),%edi
+	call	__x86_AES_decrypt
+	movl	48(%esp),%edi
+	movl	36(%esp),%esi
+	xorl	(%edi),%eax
+	xorl	4(%edi),%ebx
+	xorl	8(%edi),%ecx
+	xorl	12(%edi),%edx
+	movl	%eax,(%esi)
+	movl	%ebx,4(%esi)
+	movl	%ecx,8(%esi)
+	movl	%edx,12(%esi)
+	leal	16(%esi),%esi
+	movl	%esi,36(%esp)
+	leal	60(%esp),%esi
+	movl	(%esi),%eax
+	movl	4(%esi),%ebx
+	movl	8(%esi),%ecx
+	movl	12(%esi),%edx
+	movl	%eax,(%edi)
+	movl	%ebx,4(%edi)
+	movl	%ecx,8(%edi)
+	movl	%edx,12(%edi)
+	movl	32(%esp),%esi
+	movl	40(%esp),%ecx
+	leal	16(%esi),%esi
+	movl	%esi,32(%esp)
+	subl	$16,%ecx
+	movl	%ecx,40(%esp)
+	jnz	L027fast_dec_in_place_loop
+.align	2,0x90
+L026fast_dec_out:
+	cmpl	$0,316(%esp)
+	movl	44(%esp),%edi
+	je	L028skip_dzero
+	movl	$60,%ecx
+	xorl	%eax,%eax
+.align	2,0x90
+.long	2884892297
+L028skip_dzero:
+	movl	28(%esp),%esp
+	popfl
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+	pushfl
+.align	4,0x90
+L015slow_way:
+	movl	(%eax),%eax
+	movl	36(%esp),%edi
+	leal	-80(%esp),%esi
+	andl	$-64,%esi
+	leal	-143(%edi),%ebx
+	subl	%esi,%ebx
+	negl	%ebx
+	andl	$960,%ebx
+	subl	%ebx,%esi
+	leal	768(%esi),%ebx
+	subl	%ebp,%ebx
+	andl	$768,%ebx
+	leal	2176(%ebp,%ebx,1),%ebp
+	leal	24(%esp),%edx
+	xchgl	%esi,%esp
+	addl	$4,%esp
+	movl	%ebp,24(%esp)
+	movl	%esi,28(%esp)
+	movl	%eax,52(%esp)
+	movl	(%edx),%eax
+	movl	4(%edx),%ebx
+	movl	16(%edx),%esi
+	movl	20(%edx),%edx
+	movl	%eax,32(%esp)
+	movl	%ebx,36(%esp)
+	movl	%ecx,40(%esp)
+	movl	%edi,44(%esp)
+	movl	%esi,48(%esp)
+	movl	%esi,%edi
+	movl	%eax,%esi
+	cmpl	$0,%edx
+	je	L029slow_decrypt
+	cmpl	$16,%ecx
+	movl	%ebx,%edx
+	jb	L030slow_enc_tail
+	btl	$25,52(%esp)
+	jnc	L031slow_enc_x86
+	movq	(%edi),%mm0
+	movq	8(%edi),%mm4
+.align	4,0x90
+L032slow_enc_loop_sse:
+	pxor	(%esi),%mm0
+	pxor	8(%esi),%mm4
+	movl	44(%esp),%edi
+	call	__sse_AES_encrypt_compact
+	movl	32(%esp),%esi
+	movl	36(%esp),%edi
+	movl	40(%esp),%ecx
+	movq	%mm0,(%edi)
+	movq	%mm4,8(%edi)
+	leal	16(%esi),%esi
+	movl	%esi,32(%esp)
+	leal	16(%edi),%edx
+	movl	%edx,36(%esp)
+	subl	$16,%ecx
+	cmpl	$16,%ecx
+	movl	%ecx,40(%esp)
+	jae	L032slow_enc_loop_sse
+	testl	$15,%ecx
+	jnz	L030slow_enc_tail
+	movl	48(%esp),%esi
+	movq	%mm0,(%esi)
+	movq	%mm4,8(%esi)
+	emms
+	movl	28(%esp),%esp
+	popfl
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+	pushfl
+.align	4,0x90
+L031slow_enc_x86:
+	movl	(%edi),%eax
+	movl	4(%edi),%ebx
+.align	2,0x90
+L033slow_enc_loop_x86:
+	movl	8(%edi),%ecx
+	movl	12(%edi),%edx
+	xorl	(%esi),%eax
+	xorl	4(%esi),%ebx
+	xorl	8(%esi),%ecx
+	xorl	12(%esi),%edx
+	movl	44(%esp),%edi
+	call	__x86_AES_encrypt_compact
+	movl	32(%esp),%esi
+	movl	36(%esp),%edi
+	movl	%eax,(%edi)
+	movl	%ebx,4(%edi)
+	movl	%ecx,8(%edi)
+	movl	%edx,12(%edi)
+	movl	40(%esp),%ecx
+	leal	16(%esi),%esi
+	movl	%esi,32(%esp)
+	leal	16(%edi),%edx
+	movl	%edx,36(%esp)
+	subl	$16,%ecx
+	cmpl	$16,%ecx
+	movl	%ecx,40(%esp)
+	jae	L033slow_enc_loop_x86
+	testl	$15,%ecx
+	jnz	L030slow_enc_tail
+	movl	48(%esp),%esi
+	movl	8(%edi),%ecx
+	movl	12(%edi),%edx
+	movl	%eax,(%esi)
+	movl	%ebx,4(%esi)
+	movl	%ecx,8(%esi)
+	movl	%edx,12(%esi)
+	movl	28(%esp),%esp
+	popfl
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+	pushfl
+.align	4,0x90
+L030slow_enc_tail:
+	emms
+	movl	%edx,%edi
+	movl	$16,%ebx
+	subl	%ecx,%ebx
+	cmpl	%esi,%edi
+	je	L034enc_in_place
+.align	2,0x90
+.long	2767451785
+	jmp	L035enc_skip_in_place
+L034enc_in_place:
+	leal	(%edi,%ecx,1),%edi
+L035enc_skip_in_place:
+	movl	%ebx,%ecx
+	xorl	%eax,%eax
+.align	2,0x90
+.long	2868115081
+	movl	48(%esp),%edi
+	movl	%edx,%esi
+	movl	(%edi),%eax
+	movl	4(%edi),%ebx
+	movl	$16,40(%esp)
+	jmp	L033slow_enc_loop_x86
+.align	4,0x90
+L029slow_decrypt:
+	btl	$25,52(%esp)
+	jnc	L036slow_dec_loop_x86
+.align	2,0x90
+L037slow_dec_loop_sse:
+	movq	(%esi),%mm0
+	movq	8(%esi),%mm4
+	movl	44(%esp),%edi
+	call	__sse_AES_decrypt_compact
+	movl	32(%esp),%esi
+	leal	60(%esp),%eax
+	movl	36(%esp),%ebx
+	movl	40(%esp),%ecx
+	movl	48(%esp),%edi
+	movq	(%esi),%mm1
+	movq	8(%esi),%mm5
+	pxor	(%edi),%mm0
+	pxor	8(%edi),%mm4
+	movq	%mm1,(%edi)
+	movq	%mm5,8(%edi)
+	subl	$16,%ecx
+	jc	L038slow_dec_partial_sse
+	movq	%mm0,(%ebx)
+	movq	%mm4,8(%ebx)
+	leal	16(%ebx),%ebx
+	movl	%ebx,36(%esp)
+	leal	16(%esi),%esi
+	movl	%esi,32(%esp)
+	movl	%ecx,40(%esp)
+	jnz	L037slow_dec_loop_sse
+	emms
+	movl	28(%esp),%esp
+	popfl
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+	pushfl
+.align	4,0x90
+L038slow_dec_partial_sse:
+	movq	%mm0,(%eax)
+	movq	%mm4,8(%eax)
+	emms
+	addl	$16,%ecx
+	movl	%ebx,%edi
+	movl	%eax,%esi
+.align	2,0x90
+.long	2767451785
+	movl	28(%esp),%esp
+	popfl
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+	pushfl
+.align	4,0x90
+L036slow_dec_loop_x86:
+	movl	(%esi),%eax
+	movl	4(%esi),%ebx
+	movl	8(%esi),%ecx
+	movl	12(%esi),%edx
+	leal	60(%esp),%edi
+	movl	%eax,(%edi)
+	movl	%ebx,4(%edi)
+	movl	%ecx,8(%edi)
+	movl	%edx,12(%edi)
+	movl	44(%esp),%edi
+	call	__x86_AES_decrypt_compact
+	movl	48(%esp),%edi
+	movl	40(%esp),%esi
+	xorl	(%edi),%eax
+	xorl	4(%edi),%ebx
+	xorl	8(%edi),%ecx
+	xorl	12(%edi),%edx
+	subl	$16,%esi
+	jc	L039slow_dec_partial_x86
+	movl	%esi,40(%esp)
+	movl	36(%esp),%esi
+	movl	%eax,(%esi)
+	movl	%ebx,4(%esi)
+	movl	%ecx,8(%esi)
+	movl	%edx,12(%esi)
+	leal	16(%esi),%esi
+	movl	%esi,36(%esp)
+	leal	60(%esp),%esi
+	movl	(%esi),%eax
+	movl	4(%esi),%ebx
+	movl	8(%esi),%ecx
+	movl	12(%esi),%edx
+	movl	%eax,(%edi)
+	movl	%ebx,4(%edi)
+	movl	%ecx,8(%edi)
+	movl	%edx,12(%edi)
+	movl	32(%esp),%esi
+	leal	16(%esi),%esi
+	movl	%esi,32(%esp)
+	jnz	L036slow_dec_loop_x86
+	movl	28(%esp),%esp
+	popfl
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+	pushfl
+.align	4,0x90
+L039slow_dec_partial_x86:
+	leal	60(%esp),%esi
+	movl	%eax,(%esi)
+	movl	%ebx,4(%esi)
+	movl	%ecx,8(%esi)
+	movl	%edx,12(%esi)
+	movl	32(%esp),%esi
+	movl	(%esi),%eax
+	movl	4(%esi),%ebx
+	movl	8(%esi),%ecx
+	movl	12(%esi),%edx
+	movl	%eax,(%edi)
+	movl	%ebx,4(%edi)
+	movl	%ecx,8(%edi)
+	movl	%edx,12(%edi)
+	movl	40(%esp),%ecx
+	movl	36(%esp),%edi
+	leal	60(%esp),%esi
+.align	2,0x90
+.long	2767451785
+	movl	28(%esp),%esp
+	popfl
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.private_extern	__x86_AES_set_encrypt_key
+.align	4
+__x86_AES_set_encrypt_key:
+	pushl	%ebp
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+	movl	24(%esp),%esi
+	movl	32(%esp),%edi
+	testl	$-1,%esi
+	jz	L040badpointer
+	testl	$-1,%edi
+	jz	L040badpointer
+	call	L041pic_point
+L041pic_point:
+	popl	%ebp
+	leal	LAES_Te-L041pic_point(%ebp),%ebp
+	leal	2176(%ebp),%ebp
+	movl	-128(%ebp),%eax
+	movl	-96(%ebp),%ebx
+	movl	-64(%ebp),%ecx
+	movl	-32(%ebp),%edx
+	movl	(%ebp),%eax
+	movl	32(%ebp),%ebx
+	movl	64(%ebp),%ecx
+	movl	96(%ebp),%edx
+	movl	28(%esp),%ecx
+	cmpl	$128,%ecx
+	je	L04210rounds
+	cmpl	$192,%ecx
+	je	L04312rounds
+	cmpl	$256,%ecx
+	je	L04414rounds
+	movl	$-2,%eax
+	jmp	L045exit
+L04210rounds:
+	movl	(%esi),%eax
+	movl	4(%esi),%ebx
+	movl	8(%esi),%ecx
+	movl	12(%esi),%edx
+	movl	%eax,(%edi)
+	movl	%ebx,4(%edi)
+	movl	%ecx,8(%edi)
+	movl	%edx,12(%edi)
+	xorl	%ecx,%ecx
+	jmp	L04610shortcut
+.align	2,0x90
+L04710loop:
+	movl	(%edi),%eax
+	movl	12(%edi),%edx
+L04610shortcut:
+	movzbl	%dl,%esi
+	movzbl	-128(%ebp,%esi,1),%ebx
+	movzbl	%dh,%esi
+	shll	$24,%ebx
+	xorl	%ebx,%eax
+	movzbl	-128(%ebp,%esi,1),%ebx
+	shrl	$16,%edx
+	movzbl	%dl,%esi
+	xorl	%ebx,%eax
+	movzbl	-128(%ebp,%esi,1),%ebx
+	movzbl	%dh,%esi
+	shll	$8,%ebx
+	xorl	%ebx,%eax
+	movzbl	-128(%ebp,%esi,1),%ebx
+	shll	$16,%ebx
+	xorl	%ebx,%eax
+	xorl	896(%ebp,%ecx,4),%eax
+	movl	%eax,16(%edi)
+	xorl	4(%edi),%eax
+	movl	%eax,20(%edi)
+	xorl	8(%edi),%eax
+	movl	%eax,24(%edi)
+	xorl	12(%edi),%eax
+	movl	%eax,28(%edi)
+	incl	%ecx
+	addl	$16,%edi
+	cmpl	$10,%ecx
+	jl	L04710loop
+	movl	$10,80(%edi)
+	xorl	%eax,%eax
+	jmp	L045exit
+L04312rounds:
+	movl	(%esi),%eax
+	movl	4(%esi),%ebx
+	movl	8(%esi),%ecx
+	movl	12(%esi),%edx
+	movl	%eax,(%edi)
+	movl	%ebx,4(%edi)
+	movl	%ecx,8(%edi)
+	movl	%edx,12(%edi)
+	movl	16(%esi),%ecx
+	movl	20(%esi),%edx
+	movl	%ecx,16(%edi)
+	movl	%edx,20(%edi)
+	xorl	%ecx,%ecx
+	jmp	L04812shortcut
+.align	2,0x90
+L04912loop:
+	movl	(%edi),%eax
+	movl	20(%edi),%edx
+L04812shortcut:
+	movzbl	%dl,%esi
+	movzbl	-128(%ebp,%esi,1),%ebx
+	movzbl	%dh,%esi
+	shll	$24,%ebx
+	xorl	%ebx,%eax
+	movzbl	-128(%ebp,%esi,1),%ebx
+	shrl	$16,%edx
+	movzbl	%dl,%esi
+	xorl	%ebx,%eax
+	movzbl	-128(%ebp,%esi,1),%ebx
+	movzbl	%dh,%esi
+	shll	$8,%ebx
+	xorl	%ebx,%eax
+	movzbl	-128(%ebp,%esi,1),%ebx
+	shll	$16,%ebx
+	xorl	%ebx,%eax
+	xorl	896(%ebp,%ecx,4),%eax
+	movl	%eax,24(%edi)
+	xorl	4(%edi),%eax
+	movl	%eax,28(%edi)
+	xorl	8(%edi),%eax
+	movl	%eax,32(%edi)
+	xorl	12(%edi),%eax
+	movl	%eax,36(%edi)
+	cmpl	$7,%ecx
+	je	L05012break
+	incl	%ecx
+	xorl	16(%edi),%eax
+	movl	%eax,40(%edi)
+	xorl	20(%edi),%eax
+	movl	%eax,44(%edi)
+	addl	$24,%edi
+	jmp	L04912loop
+L05012break:
+	movl	$12,72(%edi)
+	xorl	%eax,%eax
+	jmp	L045exit
+L04414rounds:
+	movl	(%esi),%eax
+	movl	4(%esi),%ebx
+	movl	8(%esi),%ecx
+	movl	12(%esi),%edx
+	movl	%eax,(%edi)
+	movl	%ebx,4(%edi)
+	movl	%ecx,8(%edi)
+	movl	%edx,12(%edi)
+	movl	16(%esi),%eax
+	movl	20(%esi),%ebx
+	movl	24(%esi),%ecx
+	movl	28(%esi),%edx
+	movl	%eax,16(%edi)
+	movl	%ebx,20(%edi)
+	movl	%ecx,24(%edi)
+	movl	%edx,28(%edi)
+	xorl	%ecx,%ecx
+	jmp	L05114shortcut
+.align	2,0x90
+L05214loop:
+	movl	28(%edi),%edx
+L05114shortcut:
+	movl	(%edi),%eax
+	movzbl	%dl,%esi
+	movzbl	-128(%ebp,%esi,1),%ebx
+	movzbl	%dh,%esi
+	shll	$24,%ebx
+	xorl	%ebx,%eax
+	movzbl	-128(%ebp,%esi,1),%ebx
+	shrl	$16,%edx
+	movzbl	%dl,%esi
+	xorl	%ebx,%eax
+	movzbl	-128(%ebp,%esi,1),%ebx
+	movzbl	%dh,%esi
+	shll	$8,%ebx
+	xorl	%ebx,%eax
+	movzbl	-128(%ebp,%esi,1),%ebx
+	shll	$16,%ebx
+	xorl	%ebx,%eax
+	xorl	896(%ebp,%ecx,4),%eax
+	movl	%eax,32(%edi)
+	xorl	4(%edi),%eax
+	movl	%eax,36(%edi)
+	xorl	8(%edi),%eax
+	movl	%eax,40(%edi)
+	xorl	12(%edi),%eax
+	movl	%eax,44(%edi)
+	cmpl	$6,%ecx
+	je	L05314break
+	incl	%ecx
+	movl	%eax,%edx
+	movl	16(%edi),%eax
+	movzbl	%dl,%esi
+	movzbl	-128(%ebp,%esi,1),%ebx
+	movzbl	%dh,%esi
+	xorl	%ebx,%eax
+	movzbl	-128(%ebp,%esi,1),%ebx
+	shrl	$16,%edx
+	shll	$8,%ebx
+	movzbl	%dl,%esi
+	xorl	%ebx,%eax
+	movzbl	-128(%ebp,%esi,1),%ebx
+	movzbl	%dh,%esi
+	shll	$16,%ebx
+	xorl	%ebx,%eax
+	movzbl	-128(%ebp,%esi,1),%ebx
+	shll	$24,%ebx
+	xorl	%ebx,%eax
+	movl	%eax,48(%edi)
+	xorl	20(%edi),%eax
+	movl	%eax,52(%edi)
+	xorl	24(%edi),%eax
+	movl	%eax,56(%edi)
+	xorl	28(%edi),%eax
+	movl	%eax,60(%edi)
+	addl	$32,%edi
+	jmp	L05214loop
+L05314break:
+	movl	$14,48(%edi)
+	xorl	%eax,%eax
+	jmp	L045exit
+L040badpointer:
+	movl	$-1,%eax
+L045exit:
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.globl	_asm_AES_set_encrypt_key
+.private_extern	_asm_AES_set_encrypt_key
+.align	4
+_asm_AES_set_encrypt_key:
+L_asm_AES_set_encrypt_key_begin:
+	call	__x86_AES_set_encrypt_key
+	ret
+.globl	_asm_AES_set_decrypt_key
+.private_extern	_asm_AES_set_decrypt_key
+.align	4
+_asm_AES_set_decrypt_key:
+L_asm_AES_set_decrypt_key_begin:
+	call	__x86_AES_set_encrypt_key
+	cmpl	$0,%eax
+	je	L054proceed
+	ret
+L054proceed:
+	pushl	%ebp
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+	movl	28(%esp),%esi
+	movl	240(%esi),%ecx
+	leal	(,%ecx,4),%ecx
+	leal	(%esi,%ecx,4),%edi
+.align	2,0x90
+L055invert:
+	movl	(%esi),%eax
+	movl	4(%esi),%ebx
+	movl	(%edi),%ecx
+	movl	4(%edi),%edx
+	movl	%eax,(%edi)
+	movl	%ebx,4(%edi)
+	movl	%ecx,(%esi)
+	movl	%edx,4(%esi)
+	movl	8(%esi),%eax
+	movl	12(%esi),%ebx
+	movl	8(%edi),%ecx
+	movl	12(%edi),%edx
+	movl	%eax,8(%edi)
+	movl	%ebx,12(%edi)
+	movl	%ecx,8(%esi)
+	movl	%edx,12(%esi)
+	addl	$16,%esi
+	subl	$16,%edi
+	cmpl	%edi,%esi
+	jne	L055invert
+	movl	28(%esp),%edi
+	movl	240(%edi),%esi
+	leal	-2(%esi,%esi,1),%esi
+	leal	(%edi,%esi,8),%esi
+	movl	%esi,28(%esp)
+	movl	16(%edi),%eax
+.align	2,0x90
+L056permute:
+	addl	$16,%edi
+	movl	$2155905152,%ebp
+	andl	%eax,%ebp
+	leal	(%eax,%eax,1),%ebx
+	movl	%ebp,%esi
+	shrl	$7,%ebp
+	subl	%ebp,%esi
+	andl	$4278124286,%ebx
+	andl	$454761243,%esi
+	xorl	%esi,%ebx
+	movl	$2155905152,%ebp
+	andl	%ebx,%ebp
+	leal	(%ebx,%ebx,1),%ecx
+	movl	%ebp,%esi
+	shrl	$7,%ebp
+	subl	%ebp,%esi
+	andl	$4278124286,%ecx
+	andl	$454761243,%esi
+	xorl	%eax,%ebx
+	xorl	%esi,%ecx
+	movl	$2155905152,%ebp
+	andl	%ecx,%ebp
+	leal	(%ecx,%ecx,1),%edx
+	movl	%ebp,%esi
+	shrl	$7,%ebp
+	xorl	%eax,%ecx
+	subl	%ebp,%esi
+	andl	$4278124286,%edx
+	andl	$454761243,%esi
+	roll	$8,%eax
+	xorl	%esi,%edx
+	movl	4(%edi),%ebp
+	xorl	%ebx,%eax
+	xorl	%edx,%ebx
+	xorl	%ecx,%eax
+	roll	$24,%ebx
+	xorl	%edx,%ecx
+	xorl	%edx,%eax
+	roll	$16,%ecx
+	xorl	%ebx,%eax
+	roll	$8,%edx
+	xorl	%ecx,%eax
+	movl	%ebp,%ebx
+	xorl	%edx,%eax
+	movl	%eax,(%edi)
+	movl	$2155905152,%ebp
+	andl	%ebx,%ebp
+	leal	(%ebx,%ebx,1),%ecx
+	movl	%ebp,%esi
+	shrl	$7,%ebp
+	subl	%ebp,%esi
+	andl	$4278124286,%ecx
+	andl	$454761243,%esi
+	xorl	%esi,%ecx
+	movl	$2155905152,%ebp
+	andl	%ecx,%ebp
+	leal	(%ecx,%ecx,1),%edx
+	movl	%ebp,%esi
+	shrl	$7,%ebp
+	subl	%ebp,%esi
+	andl	$4278124286,%edx
+	andl	$454761243,%esi
+	xorl	%ebx,%ecx
+	xorl	%esi,%edx
+	movl	$2155905152,%ebp
+	andl	%edx,%ebp
+	leal	(%edx,%edx,1),%eax
+	movl	%ebp,%esi
+	shrl	$7,%ebp
+	xorl	%ebx,%edx
+	subl	%ebp,%esi
+	andl	$4278124286,%eax
+	andl	$454761243,%esi
+	roll	$8,%ebx
+	xorl	%esi,%eax
+	movl	8(%edi),%ebp
+	xorl	%ecx,%ebx
+	xorl	%eax,%ecx
+	xorl	%edx,%ebx
+	roll	$24,%ecx
+	xorl	%eax,%edx
+	xorl	%eax,%ebx
+	roll	$16,%edx
+	xorl	%ecx,%ebx
+	roll	$8,%eax
+	xorl	%edx,%ebx
+	movl	%ebp,%ecx
+	xorl	%eax,%ebx
+	movl	%ebx,4(%edi)
+	movl	$2155905152,%ebp
+	andl	%ecx,%ebp
+	leal	(%ecx,%ecx,1),%edx
+	movl	%ebp,%esi
+	shrl	$7,%ebp
+	subl	%ebp,%esi
+	andl	$4278124286,%edx
+	andl	$454761243,%esi
+	xorl	%esi,%edx
+	movl	$2155905152,%ebp
+	andl	%edx,%ebp
+	leal	(%edx,%edx,1),%eax
+	movl	%ebp,%esi
+	shrl	$7,%ebp
+	subl	%ebp,%esi
+	andl	$4278124286,%eax
+	andl	$454761243,%esi
+	xorl	%ecx,%edx
+	xorl	%esi,%eax
+	movl	$2155905152,%ebp
+	andl	%eax,%ebp
+	leal	(%eax,%eax,1),%ebx
+	movl	%ebp,%esi
+	shrl	$7,%ebp
+	xorl	%ecx,%eax
+	subl	%ebp,%esi
+	andl	$4278124286,%ebx
+	andl	$454761243,%esi
+	roll	$8,%ecx
+	xorl	%esi,%ebx
+	movl	12(%edi),%ebp
+	xorl	%edx,%ecx
+	xorl	%ebx,%edx
+	xorl	%eax,%ecx
+	roll	$24,%edx
+	xorl	%ebx,%eax
+	xorl	%ebx,%ecx
+	roll	$16,%eax
+	xorl	%edx,%ecx
+	roll	$8,%ebx
+	xorl	%eax,%ecx
+	movl	%ebp,%edx
+	xorl	%ebx,%ecx
+	movl	%ecx,8(%edi)
+	movl	$2155905152,%ebp
+	andl	%edx,%ebp
+	leal	(%edx,%edx,1),%eax
+	movl	%ebp,%esi
+	shrl	$7,%ebp
+	subl	%ebp,%esi
+	andl	$4278124286,%eax
+	andl	$454761243,%esi
+	xorl	%esi,%eax
+	movl	$2155905152,%ebp
+	andl	%eax,%ebp
+	leal	(%eax,%eax,1),%ebx
+	movl	%ebp,%esi
+	shrl	$7,%ebp
+	subl	%ebp,%esi
+	andl	$4278124286,%ebx
+	andl	$454761243,%esi
+	xorl	%edx,%eax
+	xorl	%esi,%ebx
+	movl	$2155905152,%ebp
+	andl	%ebx,%ebp
+	leal	(%ebx,%ebx,1),%ecx
+	movl	%ebp,%esi
+	shrl	$7,%ebp
+	xorl	%edx,%ebx
+	subl	%ebp,%esi
+	andl	$4278124286,%ecx
+	andl	$454761243,%esi
+	roll	$8,%edx
+	xorl	%esi,%ecx
+	movl	16(%edi),%ebp
+	xorl	%eax,%edx
+	xorl	%ecx,%eax
+	xorl	%ebx,%edx
+	roll	$24,%eax
+	xorl	%ecx,%ebx
+	xorl	%ecx,%edx
+	roll	$16,%ebx
+	xorl	%eax,%edx
+	roll	$8,%ecx
+	xorl	%ebx,%edx
+	movl	%ebp,%eax
+	xorl	%ecx,%edx
+	movl	%edx,12(%edi)
+	cmpl	28(%esp),%edi
+	jb	L056permute
+	xorl	%eax,%eax
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.byte	65,69,83,32,102,111,114,32,120,56,54,44,32,67,82,89
+.byte	80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114
+.byte	111,64,111,112,101,110,115,115,108,46,111,114,103,62,0
+.section __IMPORT,__pointers,non_lazy_symbol_pointers
+L_OPENSSL_ia32cap_P$non_lazy_ptr:
+.indirect_symbol	_OPENSSL_ia32cap_P
+.long	0
+#endif
diff --git a/third_party/boringssl/mac-x86/crypto/aes/aesni-x86.S b/third_party/boringssl/mac-x86/crypto/aes/aesni-x86.S
new file mode 100644
index 0000000..07719ba
--- /dev/null
+++ b/third_party/boringssl/mac-x86/crypto/aes/aesni-x86.S
@@ -0,0 +1,2433 @@
+#if defined(__i386__)
+.file	"src/crypto/aes/asm/aesni-x86.S"
+.text
+.globl	_aesni_encrypt
+.private_extern	_aesni_encrypt
+.align	4
+_aesni_encrypt:
+L_aesni_encrypt_begin:
+	movl	4(%esp),%eax
+	movl	12(%esp),%edx
+	movups	(%eax),%xmm2
+	movl	240(%edx),%ecx
+	movl	8(%esp),%eax
+	movups	(%edx),%xmm0
+	movups	16(%edx),%xmm1
+	leal	32(%edx),%edx
+	xorps	%xmm0,%xmm2
+L000enc1_loop_1:
+.byte	102,15,56,220,209
+	decl	%ecx
+	movups	(%edx),%xmm1
+	leal	16(%edx),%edx
+	jnz	L000enc1_loop_1
+.byte	102,15,56,221,209
+	pxor	%xmm0,%xmm0
+	pxor	%xmm1,%xmm1
+	movups	%xmm2,(%eax)
+	pxor	%xmm2,%xmm2
+	ret
+.globl	_aesni_decrypt
+.private_extern	_aesni_decrypt
+.align	4
+_aesni_decrypt:
+L_aesni_decrypt_begin:
+	movl	4(%esp),%eax
+	movl	12(%esp),%edx
+	movups	(%eax),%xmm2
+	movl	240(%edx),%ecx
+	movl	8(%esp),%eax
+	movups	(%edx),%xmm0
+	movups	16(%edx),%xmm1
+	leal	32(%edx),%edx
+	xorps	%xmm0,%xmm2
+L001dec1_loop_2:
+.byte	102,15,56,222,209
+	decl	%ecx
+	movups	(%edx),%xmm1
+	leal	16(%edx),%edx
+	jnz	L001dec1_loop_2
+.byte	102,15,56,223,209
+	pxor	%xmm0,%xmm0
+	pxor	%xmm1,%xmm1
+	movups	%xmm2,(%eax)
+	pxor	%xmm2,%xmm2
+	ret
+.private_extern	__aesni_encrypt2
+.align	4
+__aesni_encrypt2:
+	movups	(%edx),%xmm0
+	shll	$4,%ecx
+	movups	16(%edx),%xmm1
+	xorps	%xmm0,%xmm2
+	pxor	%xmm0,%xmm3
+	movups	32(%edx),%xmm0
+	leal	32(%edx,%ecx,1),%edx
+	negl	%ecx
+	addl	$16,%ecx
+L002enc2_loop:
+.byte	102,15,56,220,209
+.byte	102,15,56,220,217
+	movups	(%edx,%ecx,1),%xmm1
+	addl	$32,%ecx
+.byte	102,15,56,220,208
+.byte	102,15,56,220,216
+	movups	-16(%edx,%ecx,1),%xmm0
+	jnz	L002enc2_loop
+.byte	102,15,56,220,209
+.byte	102,15,56,220,217
+.byte	102,15,56,221,208
+.byte	102,15,56,221,216
+	ret
+.private_extern	__aesni_decrypt2
+.align	4
+__aesni_decrypt2:
+	movups	(%edx),%xmm0
+	shll	$4,%ecx
+	movups	16(%edx),%xmm1
+	xorps	%xmm0,%xmm2
+	pxor	%xmm0,%xmm3
+	movups	32(%edx),%xmm0
+	leal	32(%edx,%ecx,1),%edx
+	negl	%ecx
+	addl	$16,%ecx
+L003dec2_loop:
+.byte	102,15,56,222,209
+.byte	102,15,56,222,217
+	movups	(%edx,%ecx,1),%xmm1
+	addl	$32,%ecx
+.byte	102,15,56,222,208
+.byte	102,15,56,222,216
+	movups	-16(%edx,%ecx,1),%xmm0
+	jnz	L003dec2_loop
+.byte	102,15,56,222,209
+.byte	102,15,56,222,217
+.byte	102,15,56,223,208
+.byte	102,15,56,223,216
+	ret
+.private_extern	__aesni_encrypt3
+.align	4
+__aesni_encrypt3:
+	movups	(%edx),%xmm0
+	shll	$4,%ecx
+	movups	16(%edx),%xmm1
+	xorps	%xmm0,%xmm2
+	pxor	%xmm0,%xmm3
+	pxor	%xmm0,%xmm4
+	movups	32(%edx),%xmm0
+	leal	32(%edx,%ecx,1),%edx
+	negl	%ecx
+	addl	$16,%ecx
+L004enc3_loop:
+.byte	102,15,56,220,209
+.byte	102,15,56,220,217
+.byte	102,15,56,220,225
+	movups	(%edx,%ecx,1),%xmm1
+	addl	$32,%ecx
+.byte	102,15,56,220,208
+.byte	102,15,56,220,216
+.byte	102,15,56,220,224
+	movups	-16(%edx,%ecx,1),%xmm0
+	jnz	L004enc3_loop
+.byte	102,15,56,220,209
+.byte	102,15,56,220,217
+.byte	102,15,56,220,225
+.byte	102,15,56,221,208
+.byte	102,15,56,221,216
+.byte	102,15,56,221,224
+	ret
+.private_extern	__aesni_decrypt3
+.align	4
+__aesni_decrypt3:
+	movups	(%edx),%xmm0
+	shll	$4,%ecx
+	movups	16(%edx),%xmm1
+	xorps	%xmm0,%xmm2
+	pxor	%xmm0,%xmm3
+	pxor	%xmm0,%xmm4
+	movups	32(%edx),%xmm0
+	leal	32(%edx,%ecx,1),%edx
+	negl	%ecx
+	addl	$16,%ecx
+L005dec3_loop:
+.byte	102,15,56,222,209
+.byte	102,15,56,222,217
+.byte	102,15,56,222,225
+	movups	(%edx,%ecx,1),%xmm1
+	addl	$32,%ecx
+.byte	102,15,56,222,208
+.byte	102,15,56,222,216
+.byte	102,15,56,222,224
+	movups	-16(%edx,%ecx,1),%xmm0
+	jnz	L005dec3_loop
+.byte	102,15,56,222,209
+.byte	102,15,56,222,217
+.byte	102,15,56,222,225
+.byte	102,15,56,223,208
+.byte	102,15,56,223,216
+.byte	102,15,56,223,224
+	ret
+.private_extern	__aesni_encrypt4
+.align	4
+__aesni_encrypt4:
+	movups	(%edx),%xmm0
+	movups	16(%edx),%xmm1
+	shll	$4,%ecx
+	xorps	%xmm0,%xmm2
+	pxor	%xmm0,%xmm3
+	pxor	%xmm0,%xmm4
+	pxor	%xmm0,%xmm5
+	movups	32(%edx),%xmm0
+	leal	32(%edx,%ecx,1),%edx
+	negl	%ecx
+.byte	15,31,64,0
+	addl	$16,%ecx
+L006enc4_loop:
+.byte	102,15,56,220,209
+.byte	102,15,56,220,217
+.byte	102,15,56,220,225
+.byte	102,15,56,220,233
+	movups	(%edx,%ecx,1),%xmm1
+	addl	$32,%ecx
+.byte	102,15,56,220,208
+.byte	102,15,56,220,216
+.byte	102,15,56,220,224
+.byte	102,15,56,220,232
+	movups	-16(%edx,%ecx,1),%xmm0
+	jnz	L006enc4_loop
+.byte	102,15,56,220,209
+.byte	102,15,56,220,217
+.byte	102,15,56,220,225
+.byte	102,15,56,220,233
+.byte	102,15,56,221,208
+.byte	102,15,56,221,216
+.byte	102,15,56,221,224
+.byte	102,15,56,221,232
+	ret
+.private_extern	__aesni_decrypt4
+.align	4
+__aesni_decrypt4:
+	movups	(%edx),%xmm0
+	movups	16(%edx),%xmm1
+	shll	$4,%ecx
+	xorps	%xmm0,%xmm2
+	pxor	%xmm0,%xmm3
+	pxor	%xmm0,%xmm4
+	pxor	%xmm0,%xmm5
+	movups	32(%edx),%xmm0
+	leal	32(%edx,%ecx,1),%edx
+	negl	%ecx
+.byte	15,31,64,0
+	addl	$16,%ecx
+L007dec4_loop:
+.byte	102,15,56,222,209
+.byte	102,15,56,222,217
+.byte	102,15,56,222,225
+.byte	102,15,56,222,233
+	movups	(%edx,%ecx,1),%xmm1
+	addl	$32,%ecx
+.byte	102,15,56,222,208
+.byte	102,15,56,222,216
+.byte	102,15,56,222,224
+.byte	102,15,56,222,232
+	movups	-16(%edx,%ecx,1),%xmm0
+	jnz	L007dec4_loop
+.byte	102,15,56,222,209
+.byte	102,15,56,222,217
+.byte	102,15,56,222,225
+.byte	102,15,56,222,233
+.byte	102,15,56,223,208
+.byte	102,15,56,223,216
+.byte	102,15,56,223,224
+.byte	102,15,56,223,232
+	ret
+.private_extern	__aesni_encrypt6
+.align	4
+__aesni_encrypt6:
+	movups	(%edx),%xmm0
+	shll	$4,%ecx
+	movups	16(%edx),%xmm1
+	xorps	%xmm0,%xmm2
+	pxor	%xmm0,%xmm3
+	pxor	%xmm0,%xmm4
+.byte	102,15,56,220,209
+	pxor	%xmm0,%xmm5
+	pxor	%xmm0,%xmm6
+.byte	102,15,56,220,217
+	leal	32(%edx,%ecx,1),%edx
+	negl	%ecx
+.byte	102,15,56,220,225
+	pxor	%xmm0,%xmm7
+	movups	(%edx,%ecx,1),%xmm0
+	addl	$16,%ecx
+	jmp	L008_aesni_encrypt6_inner
+.align	4,0x90
+L009enc6_loop:
+.byte	102,15,56,220,209
+.byte	102,15,56,220,217
+.byte	102,15,56,220,225
+L008_aesni_encrypt6_inner:
+.byte	102,15,56,220,233
+.byte	102,15,56,220,241
+.byte	102,15,56,220,249
+L_aesni_encrypt6_enter:
+	movups	(%edx,%ecx,1),%xmm1
+	addl	$32,%ecx
+.byte	102,15,56,220,208
+.byte	102,15,56,220,216
+.byte	102,15,56,220,224
+.byte	102,15,56,220,232
+.byte	102,15,56,220,240
+.byte	102,15,56,220,248
+	movups	-16(%edx,%ecx,1),%xmm0
+	jnz	L009enc6_loop
+.byte	102,15,56,220,209
+.byte	102,15,56,220,217
+.byte	102,15,56,220,225
+.byte	102,15,56,220,233
+.byte	102,15,56,220,241
+.byte	102,15,56,220,249
+.byte	102,15,56,221,208
+.byte	102,15,56,221,216
+.byte	102,15,56,221,224
+.byte	102,15,56,221,232
+.byte	102,15,56,221,240
+.byte	102,15,56,221,248
+	ret
+.private_extern	__aesni_decrypt6
+.align	4
+__aesni_decrypt6:
+	movups	(%edx),%xmm0
+	shll	$4,%ecx
+	movups	16(%edx),%xmm1
+	xorps	%xmm0,%xmm2
+	pxor	%xmm0,%xmm3
+	pxor	%xmm0,%xmm4
+.byte	102,15,56,222,209
+	pxor	%xmm0,%xmm5
+	pxor	%xmm0,%xmm6
+.byte	102,15,56,222,217
+	leal	32(%edx,%ecx,1),%edx
+	negl	%ecx
+.byte	102,15,56,222,225
+	pxor	%xmm0,%xmm7
+	movups	(%edx,%ecx,1),%xmm0
+	addl	$16,%ecx
+	jmp	L010_aesni_decrypt6_inner
+.align	4,0x90
+L011dec6_loop:
+.byte	102,15,56,222,209
+.byte	102,15,56,222,217
+.byte	102,15,56,222,225
+L010_aesni_decrypt6_inner:
+.byte	102,15,56,222,233
+.byte	102,15,56,222,241
+.byte	102,15,56,222,249
+L_aesni_decrypt6_enter:
+	movups	(%edx,%ecx,1),%xmm1
+	addl	$32,%ecx
+.byte	102,15,56,222,208
+.byte	102,15,56,222,216
+.byte	102,15,56,222,224
+.byte	102,15,56,222,232
+.byte	102,15,56,222,240
+.byte	102,15,56,222,248
+	movups	-16(%edx,%ecx,1),%xmm0
+	jnz	L011dec6_loop
+.byte	102,15,56,222,209
+.byte	102,15,56,222,217
+.byte	102,15,56,222,225
+.byte	102,15,56,222,233
+.byte	102,15,56,222,241
+.byte	102,15,56,222,249
+.byte	102,15,56,223,208
+.byte	102,15,56,223,216
+.byte	102,15,56,223,224
+.byte	102,15,56,223,232
+.byte	102,15,56,223,240
+.byte	102,15,56,223,248
+	ret
+.globl	_aesni_ecb_encrypt
+.private_extern	_aesni_ecb_encrypt
+.align	4
+_aesni_ecb_encrypt:
+L_aesni_ecb_encrypt_begin:
+	pushl	%ebp
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+	movl	20(%esp),%esi
+	movl	24(%esp),%edi
+	movl	28(%esp),%eax
+	movl	32(%esp),%edx
+	movl	36(%esp),%ebx
+	andl	$-16,%eax
+	jz	L012ecb_ret
+	movl	240(%edx),%ecx
+	testl	%ebx,%ebx
+	jz	L013ecb_decrypt
+	movl	%edx,%ebp
+	movl	%ecx,%ebx
+	cmpl	$96,%eax
+	jb	L014ecb_enc_tail
+	movdqu	(%esi),%xmm2
+	movdqu	16(%esi),%xmm3
+	movdqu	32(%esi),%xmm4
+	movdqu	48(%esi),%xmm5
+	movdqu	64(%esi),%xmm6
+	movdqu	80(%esi),%xmm7
+	leal	96(%esi),%esi
+	subl	$96,%eax
+	jmp	L015ecb_enc_loop6_enter
+.align	4,0x90
+L016ecb_enc_loop6:
+	movups	%xmm2,(%edi)
+	movdqu	(%esi),%xmm2
+	movups	%xmm3,16(%edi)
+	movdqu	16(%esi),%xmm3
+	movups	%xmm4,32(%edi)
+	movdqu	32(%esi),%xmm4
+	movups	%xmm5,48(%edi)
+	movdqu	48(%esi),%xmm5
+	movups	%xmm6,64(%edi)
+	movdqu	64(%esi),%xmm6
+	movups	%xmm7,80(%edi)
+	leal	96(%edi),%edi
+	movdqu	80(%esi),%xmm7
+	leal	96(%esi),%esi
+L015ecb_enc_loop6_enter:
+	call	__aesni_encrypt6
+	movl	%ebp,%edx
+	movl	%ebx,%ecx
+	subl	$96,%eax
+	jnc	L016ecb_enc_loop6
+	movups	%xmm2,(%edi)
+	movups	%xmm3,16(%edi)
+	movups	%xmm4,32(%edi)
+	movups	%xmm5,48(%edi)
+	movups	%xmm6,64(%edi)
+	movups	%xmm7,80(%edi)
+	leal	96(%edi),%edi
+	addl	$96,%eax
+	jz	L012ecb_ret
+L014ecb_enc_tail:
+	movups	(%esi),%xmm2
+	cmpl	$32,%eax
+	jb	L017ecb_enc_one
+	movups	16(%esi),%xmm3
+	je	L018ecb_enc_two
+	movups	32(%esi),%xmm4
+	cmpl	$64,%eax
+	jb	L019ecb_enc_three
+	movups	48(%esi),%xmm5
+	je	L020ecb_enc_four
+	movups	64(%esi),%xmm6
+	xorps	%xmm7,%xmm7
+	call	__aesni_encrypt6
+	movups	%xmm2,(%edi)
+	movups	%xmm3,16(%edi)
+	movups	%xmm4,32(%edi)
+	movups	%xmm5,48(%edi)
+	movups	%xmm6,64(%edi)
+	jmp	L012ecb_ret
+.align	4,0x90
+L017ecb_enc_one:
+	movups	(%edx),%xmm0
+	movups	16(%edx),%xmm1
+	leal	32(%edx),%edx
+	xorps	%xmm0,%xmm2
+L021enc1_loop_3:
+.byte	102,15,56,220,209
+	decl	%ecx
+	movups	(%edx),%xmm1
+	leal	16(%edx),%edx
+	jnz	L021enc1_loop_3
+.byte	102,15,56,221,209
+	movups	%xmm2,(%edi)
+	jmp	L012ecb_ret
+.align	4,0x90
+L018ecb_enc_two:
+	call	__aesni_encrypt2
+	movups	%xmm2,(%edi)
+	movups	%xmm3,16(%edi)
+	jmp	L012ecb_ret
+.align	4,0x90
+L019ecb_enc_three:
+	call	__aesni_encrypt3
+	movups	%xmm2,(%edi)
+	movups	%xmm3,16(%edi)
+	movups	%xmm4,32(%edi)
+	jmp	L012ecb_ret
+.align	4,0x90
+L020ecb_enc_four:
+	call	__aesni_encrypt4
+	movups	%xmm2,(%edi)
+	movups	%xmm3,16(%edi)
+	movups	%xmm4,32(%edi)
+	movups	%xmm5,48(%edi)
+	jmp	L012ecb_ret
+.align	4,0x90
+L013ecb_decrypt:
+	movl	%edx,%ebp
+	movl	%ecx,%ebx
+	cmpl	$96,%eax
+	jb	L022ecb_dec_tail
+	movdqu	(%esi),%xmm2
+	movdqu	16(%esi),%xmm3
+	movdqu	32(%esi),%xmm4
+	movdqu	48(%esi),%xmm5
+	movdqu	64(%esi),%xmm6
+	movdqu	80(%esi),%xmm7
+	leal	96(%esi),%esi
+	subl	$96,%eax
+	jmp	L023ecb_dec_loop6_enter
+.align	4,0x90
+L024ecb_dec_loop6:
+	movups	%xmm2,(%edi)
+	movdqu	(%esi),%xmm2
+	movups	%xmm3,16(%edi)
+	movdqu	16(%esi),%xmm3
+	movups	%xmm4,32(%edi)
+	movdqu	32(%esi),%xmm4
+	movups	%xmm5,48(%edi)
+	movdqu	48(%esi),%xmm5
+	movups	%xmm6,64(%edi)
+	movdqu	64(%esi),%xmm6
+	movups	%xmm7,80(%edi)
+	leal	96(%edi),%edi
+	movdqu	80(%esi),%xmm7
+	leal	96(%esi),%esi
+L023ecb_dec_loop6_enter:
+	call	__aesni_decrypt6
+	movl	%ebp,%edx
+	movl	%ebx,%ecx
+	subl	$96,%eax
+	jnc	L024ecb_dec_loop6
+	movups	%xmm2,(%edi)
+	movups	%xmm3,16(%edi)
+	movups	%xmm4,32(%edi)
+	movups	%xmm5,48(%edi)
+	movups	%xmm6,64(%edi)
+	movups	%xmm7,80(%edi)
+	leal	96(%edi),%edi
+	addl	$96,%eax
+	jz	L012ecb_ret
+L022ecb_dec_tail:
+	movups	(%esi),%xmm2
+	cmpl	$32,%eax
+	jb	L025ecb_dec_one
+	movups	16(%esi),%xmm3
+	je	L026ecb_dec_two
+	movups	32(%esi),%xmm4
+	cmpl	$64,%eax
+	jb	L027ecb_dec_three
+	movups	48(%esi),%xmm5
+	je	L028ecb_dec_four
+	movups	64(%esi),%xmm6
+	xorps	%xmm7,%xmm7
+	call	__aesni_decrypt6
+	movups	%xmm2,(%edi)
+	movups	%xmm3,16(%edi)
+	movups	%xmm4,32(%edi)
+	movups	%xmm5,48(%edi)
+	movups	%xmm6,64(%edi)
+	jmp	L012ecb_ret
+.align	4,0x90
+L025ecb_dec_one:
+	movups	(%edx),%xmm0
+	movups	16(%edx),%xmm1
+	leal	32(%edx),%edx
+	xorps	%xmm0,%xmm2
+L029dec1_loop_4:
+.byte	102,15,56,222,209
+	decl	%ecx
+	movups	(%edx),%xmm1
+	leal	16(%edx),%edx
+	jnz	L029dec1_loop_4
+.byte	102,15,56,223,209
+	movups	%xmm2,(%edi)
+	jmp	L012ecb_ret
+.align	4,0x90
+L026ecb_dec_two:
+	call	__aesni_decrypt2
+	movups	%xmm2,(%edi)
+	movups	%xmm3,16(%edi)
+	jmp	L012ecb_ret
+.align	4,0x90
+L027ecb_dec_three:
+	call	__aesni_decrypt3
+	movups	%xmm2,(%edi)
+	movups	%xmm3,16(%edi)
+	movups	%xmm4,32(%edi)
+	jmp	L012ecb_ret
+.align	4,0x90
+L028ecb_dec_four:
+	call	__aesni_decrypt4
+	movups	%xmm2,(%edi)
+	movups	%xmm3,16(%edi)
+	movups	%xmm4,32(%edi)
+	movups	%xmm5,48(%edi)
+L012ecb_ret:
+	pxor	%xmm0,%xmm0
+	pxor	%xmm1,%xmm1
+	pxor	%xmm2,%xmm2
+	pxor	%xmm3,%xmm3
+	pxor	%xmm4,%xmm4
+	pxor	%xmm5,%xmm5
+	pxor	%xmm6,%xmm6
+	pxor	%xmm7,%xmm7
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.globl	_aesni_ccm64_encrypt_blocks
+.private_extern	_aesni_ccm64_encrypt_blocks
+.align	4
+_aesni_ccm64_encrypt_blocks:
+L_aesni_ccm64_encrypt_blocks_begin:
+	pushl	%ebp
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+	movl	20(%esp),%esi
+	movl	24(%esp),%edi
+	movl	28(%esp),%eax
+	movl	32(%esp),%edx
+	movl	36(%esp),%ebx
+	movl	40(%esp),%ecx
+	movl	%esp,%ebp
+	subl	$60,%esp
+	andl	$-16,%esp
+	movl	%ebp,48(%esp)
+	movdqu	(%ebx),%xmm7
+	movdqu	(%ecx),%xmm3
+	movl	240(%edx),%ecx
+	movl	$202182159,(%esp)
+	movl	$134810123,4(%esp)
+	movl	$67438087,8(%esp)
+	movl	$66051,12(%esp)
+	movl	$1,%ebx
+	xorl	%ebp,%ebp
+	movl	%ebx,16(%esp)
+	movl	%ebp,20(%esp)
+	movl	%ebp,24(%esp)
+	movl	%ebp,28(%esp)
+	shll	$4,%ecx
+	movl	$16,%ebx
+	leal	(%edx),%ebp
+	movdqa	(%esp),%xmm5
+	movdqa	%xmm7,%xmm2
+	leal	32(%edx,%ecx,1),%edx
+	subl	%ecx,%ebx
+.byte	102,15,56,0,253
+L030ccm64_enc_outer:
+	movups	(%ebp),%xmm0
+	movl	%ebx,%ecx
+	movups	(%esi),%xmm6
+	xorps	%xmm0,%xmm2
+	movups	16(%ebp),%xmm1
+	xorps	%xmm6,%xmm0
+	xorps	%xmm0,%xmm3
+	movups	32(%ebp),%xmm0
+L031ccm64_enc2_loop:
+.byte	102,15,56,220,209
+.byte	102,15,56,220,217
+	movups	(%edx,%ecx,1),%xmm1
+	addl	$32,%ecx
+.byte	102,15,56,220,208
+.byte	102,15,56,220,216
+	movups	-16(%edx,%ecx,1),%xmm0
+	jnz	L031ccm64_enc2_loop
+.byte	102,15,56,220,209
+.byte	102,15,56,220,217
+	paddq	16(%esp),%xmm7
+	decl	%eax
+.byte	102,15,56,221,208
+.byte	102,15,56,221,216
+	leal	16(%esi),%esi
+	xorps	%xmm2,%xmm6
+	movdqa	%xmm7,%xmm2
+	movups	%xmm6,(%edi)
+.byte	102,15,56,0,213
+	leal	16(%edi),%edi
+	jnz	L030ccm64_enc_outer
+	movl	48(%esp),%esp
+	movl	40(%esp),%edi
+	movups	%xmm3,(%edi)
+	pxor	%xmm0,%xmm0
+	pxor	%xmm1,%xmm1
+	pxor	%xmm2,%xmm2
+	pxor	%xmm3,%xmm3
+	pxor	%xmm4,%xmm4
+	pxor	%xmm5,%xmm5
+	pxor	%xmm6,%xmm6
+	pxor	%xmm7,%xmm7
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.globl	_aesni_ccm64_decrypt_blocks
+.private_extern	_aesni_ccm64_decrypt_blocks
+.align	4
+_aesni_ccm64_decrypt_blocks:
+L_aesni_ccm64_decrypt_blocks_begin:
+	pushl	%ebp
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+	movl	20(%esp),%esi
+	movl	24(%esp),%edi
+	movl	28(%esp),%eax
+	movl	32(%esp),%edx
+	movl	36(%esp),%ebx
+	movl	40(%esp),%ecx
+	movl	%esp,%ebp
+	subl	$60,%esp
+	andl	$-16,%esp
+	movl	%ebp,48(%esp)
+	movdqu	(%ebx),%xmm7
+	movdqu	(%ecx),%xmm3
+	movl	240(%edx),%ecx
+	movl	$202182159,(%esp)
+	movl	$134810123,4(%esp)
+	movl	$67438087,8(%esp)
+	movl	$66051,12(%esp)
+	movl	$1,%ebx
+	xorl	%ebp,%ebp
+	movl	%ebx,16(%esp)
+	movl	%ebp,20(%esp)
+	movl	%ebp,24(%esp)
+	movl	%ebp,28(%esp)
+	movdqa	(%esp),%xmm5
+	movdqa	%xmm7,%xmm2
+	movl	%edx,%ebp
+	movl	%ecx,%ebx
+.byte	102,15,56,0,253
+	movups	(%edx),%xmm0
+	movups	16(%edx),%xmm1
+	leal	32(%edx),%edx
+	xorps	%xmm0,%xmm2
+L032enc1_loop_5:
+.byte	102,15,56,220,209
+	decl	%ecx
+	movups	(%edx),%xmm1
+	leal	16(%edx),%edx
+	jnz	L032enc1_loop_5
+.byte	102,15,56,221,209
+	shll	$4,%ebx
+	movl	$16,%ecx
+	movups	(%esi),%xmm6
+	paddq	16(%esp),%xmm7
+	leal	16(%esi),%esi
+	subl	%ebx,%ecx
+	leal	32(%ebp,%ebx,1),%edx
+	movl	%ecx,%ebx
+	jmp	L033ccm64_dec_outer
+.align	4,0x90
+L033ccm64_dec_outer:
+	xorps	%xmm2,%xmm6
+	movdqa	%xmm7,%xmm2
+	movups	%xmm6,(%edi)
+	leal	16(%edi),%edi
+.byte	102,15,56,0,213
+	subl	$1,%eax
+	jz	L034ccm64_dec_break
+	movups	(%ebp),%xmm0
+	movl	%ebx,%ecx
+	movups	16(%ebp),%xmm1
+	xorps	%xmm0,%xmm6
+	xorps	%xmm0,%xmm2
+	xorps	%xmm6,%xmm3
+	movups	32(%ebp),%xmm0
+L035ccm64_dec2_loop:
+.byte	102,15,56,220,209
+.byte	102,15,56,220,217
+	movups	(%edx,%ecx,1),%xmm1
+	addl	$32,%ecx
+.byte	102,15,56,220,208
+.byte	102,15,56,220,216
+	movups	-16(%edx,%ecx,1),%xmm0
+	jnz	L035ccm64_dec2_loop
+	movups	(%esi),%xmm6
+	paddq	16(%esp),%xmm7
+.byte	102,15,56,220,209
+.byte	102,15,56,220,217
+.byte	102,15,56,221,208
+.byte	102,15,56,221,216
+	leal	16(%esi),%esi
+	jmp	L033ccm64_dec_outer
+.align	4,0x90
+L034ccm64_dec_break:
+	movl	240(%ebp),%ecx
+	movl	%ebp,%edx
+	movups	(%edx),%xmm0
+	movups	16(%edx),%xmm1
+	xorps	%xmm0,%xmm6
+	leal	32(%edx),%edx
+	xorps	%xmm6,%xmm3
+L036enc1_loop_6:
+.byte	102,15,56,220,217
+	decl	%ecx
+	movups	(%edx),%xmm1
+	leal	16(%edx),%edx
+	jnz	L036enc1_loop_6
+.byte	102,15,56,221,217
+	movl	48(%esp),%esp
+	movl	40(%esp),%edi
+	movups	%xmm3,(%edi)
+	pxor	%xmm0,%xmm0
+	pxor	%xmm1,%xmm1
+	pxor	%xmm2,%xmm2
+	pxor	%xmm3,%xmm3
+	pxor	%xmm4,%xmm4
+	pxor	%xmm5,%xmm5
+	pxor	%xmm6,%xmm6
+	pxor	%xmm7,%xmm7
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.globl	_aesni_ctr32_encrypt_blocks
+.private_extern	_aesni_ctr32_encrypt_blocks
+.align	4
+_aesni_ctr32_encrypt_blocks:
+L_aesni_ctr32_encrypt_blocks_begin:
+	pushl	%ebp
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+	movl	20(%esp),%esi
+	movl	24(%esp),%edi
+	movl	28(%esp),%eax
+	movl	32(%esp),%edx
+	movl	36(%esp),%ebx
+	movl	%esp,%ebp
+	subl	$88,%esp
+	andl	$-16,%esp
+	movl	%ebp,80(%esp)
+	cmpl	$1,%eax
+	je	L037ctr32_one_shortcut
+	movdqu	(%ebx),%xmm7
+	movl	$202182159,(%esp)
+	movl	$134810123,4(%esp)
+	movl	$67438087,8(%esp)
+	movl	$66051,12(%esp)
+	movl	$6,%ecx
+	xorl	%ebp,%ebp
+	movl	%ecx,16(%esp)
+	movl	%ecx,20(%esp)
+	movl	%ecx,24(%esp)
+	movl	%ebp,28(%esp)
+.byte	102,15,58,22,251,3
+.byte	102,15,58,34,253,3
+	movl	240(%edx),%ecx
+	bswap	%ebx
+	pxor	%xmm0,%xmm0
+	pxor	%xmm1,%xmm1
+	movdqa	(%esp),%xmm2
+.byte	102,15,58,34,195,0
+	leal	3(%ebx),%ebp
+.byte	102,15,58,34,205,0
+	incl	%ebx
+.byte	102,15,58,34,195,1
+	incl	%ebp
+.byte	102,15,58,34,205,1
+	incl	%ebx
+.byte	102,15,58,34,195,2
+	incl	%ebp
+.byte	102,15,58,34,205,2
+	movdqa	%xmm0,48(%esp)
+.byte	102,15,56,0,194
+	movdqu	(%edx),%xmm6
+	movdqa	%xmm1,64(%esp)
+.byte	102,15,56,0,202
+	pshufd	$192,%xmm0,%xmm2
+	pshufd	$128,%xmm0,%xmm3
+	cmpl	$6,%eax
+	jb	L038ctr32_tail
+	pxor	%xmm6,%xmm7
+	shll	$4,%ecx
+	movl	$16,%ebx
+	movdqa	%xmm7,32(%esp)
+	movl	%edx,%ebp
+	subl	%ecx,%ebx
+	leal	32(%edx,%ecx,1),%edx
+	subl	$6,%eax
+	jmp	L039ctr32_loop6
+.align	4,0x90
+L039ctr32_loop6:
+	pshufd	$64,%xmm0,%xmm4
+	movdqa	32(%esp),%xmm0
+	pshufd	$192,%xmm1,%xmm5
+	pxor	%xmm0,%xmm2
+	pshufd	$128,%xmm1,%xmm6
+	pxor	%xmm0,%xmm3
+	pshufd	$64,%xmm1,%xmm7
+	movups	16(%ebp),%xmm1
+	pxor	%xmm0,%xmm4
+	pxor	%xmm0,%xmm5
+.byte	102,15,56,220,209
+	pxor	%xmm0,%xmm6
+	pxor	%xmm0,%xmm7
+.byte	102,15,56,220,217
+	movups	32(%ebp),%xmm0
+	movl	%ebx,%ecx
+.byte	102,15,56,220,225
+.byte	102,15,56,220,233
+.byte	102,15,56,220,241
+.byte	102,15,56,220,249
+	call	L_aesni_encrypt6_enter
+	movups	(%esi),%xmm1
+	movups	16(%esi),%xmm0
+	xorps	%xmm1,%xmm2
+	movups	32(%esi),%xmm1
+	xorps	%xmm0,%xmm3
+	movups	%xmm2,(%edi)
+	movdqa	16(%esp),%xmm0
+	xorps	%xmm1,%xmm4
+	movdqa	64(%esp),%xmm1
+	movups	%xmm3,16(%edi)
+	movups	%xmm4,32(%edi)
+	paddd	%xmm0,%xmm1
+	paddd	48(%esp),%xmm0
+	movdqa	(%esp),%xmm2
+	movups	48(%esi),%xmm3
+	movups	64(%esi),%xmm4
+	xorps	%xmm3,%xmm5
+	movups	80(%esi),%xmm3
+	leal	96(%esi),%esi
+	movdqa	%xmm0,48(%esp)
+.byte	102,15,56,0,194
+	xorps	%xmm4,%xmm6
+	movups	%xmm5,48(%edi)
+	xorps	%xmm3,%xmm7
+	movdqa	%xmm1,64(%esp)
+.byte	102,15,56,0,202
+	movups	%xmm6,64(%edi)
+	pshufd	$192,%xmm0,%xmm2
+	movups	%xmm7,80(%edi)
+	leal	96(%edi),%edi
+	pshufd	$128,%xmm0,%xmm3
+	subl	$6,%eax
+	jnc	L039ctr32_loop6
+	addl	$6,%eax
+	jz	L040ctr32_ret
+	movdqu	(%ebp),%xmm7
+	movl	%ebp,%edx
+	pxor	32(%esp),%xmm7
+	movl	240(%ebp),%ecx
+L038ctr32_tail:
+	por	%xmm7,%xmm2
+	cmpl	$2,%eax
+	jb	L041ctr32_one
+	pshufd	$64,%xmm0,%xmm4
+	por	%xmm7,%xmm3
+	je	L042ctr32_two
+	pshufd	$192,%xmm1,%xmm5
+	por	%xmm7,%xmm4
+	cmpl	$4,%eax
+	jb	L043ctr32_three
+	pshufd	$128,%xmm1,%xmm6
+	por	%xmm7,%xmm5
+	je	L044ctr32_four
+	por	%xmm7,%xmm6
+	call	__aesni_encrypt6
+	movups	(%esi),%xmm1
+	movups	16(%esi),%xmm0
+	xorps	%xmm1,%xmm2
+	movups	32(%esi),%xmm1
+	xorps	%xmm0,%xmm3
+	movups	48(%esi),%xmm0
+	xorps	%xmm1,%xmm4
+	movups	64(%esi),%xmm1
+	xorps	%xmm0,%xmm5
+	movups	%xmm2,(%edi)
+	xorps	%xmm1,%xmm6
+	movups	%xmm3,16(%edi)
+	movups	%xmm4,32(%edi)
+	movups	%xmm5,48(%edi)
+	movups	%xmm6,64(%edi)
+	jmp	L040ctr32_ret
+.align	4,0x90
+L037ctr32_one_shortcut:
+	movups	(%ebx),%xmm2
+	movl	240(%edx),%ecx
+L041ctr32_one:
+	movups	(%edx),%xmm0
+	movups	16(%edx),%xmm1
+	leal	32(%edx),%edx
+	xorps	%xmm0,%xmm2
+L045enc1_loop_7:
+.byte	102,15,56,220,209
+	decl	%ecx
+	movups	(%edx),%xmm1
+	leal	16(%edx),%edx
+	jnz	L045enc1_loop_7
+.byte	102,15,56,221,209
+	movups	(%esi),%xmm6
+	xorps	%xmm2,%xmm6
+	movups	%xmm6,(%edi)
+	jmp	L040ctr32_ret
+.align	4,0x90
+L042ctr32_two:
+	call	__aesni_encrypt2
+	movups	(%esi),%xmm5
+	movups	16(%esi),%xmm6
+	xorps	%xmm5,%xmm2
+	xorps	%xmm6,%xmm3
+	movups	%xmm2,(%edi)
+	movups	%xmm3,16(%edi)
+	jmp	L040ctr32_ret
+.align	4,0x90
+L043ctr32_three:
+	call	__aesni_encrypt3
+	movups	(%esi),%xmm5
+	movups	16(%esi),%xmm6
+	xorps	%xmm5,%xmm2
+	movups	32(%esi),%xmm7
+	xorps	%xmm6,%xmm3
+	movups	%xmm2,(%edi)
+	xorps	%xmm7,%xmm4
+	movups	%xmm3,16(%edi)
+	movups	%xmm4,32(%edi)
+	jmp	L040ctr32_ret
+.align	4,0x90
+L044ctr32_four:
+	call	__aesni_encrypt4
+	movups	(%esi),%xmm6
+	movups	16(%esi),%xmm7
+	movups	32(%esi),%xmm1
+	xorps	%xmm6,%xmm2
+	movups	48(%esi),%xmm0
+	xorps	%xmm7,%xmm3
+	movups	%xmm2,(%edi)
+	xorps	%xmm1,%xmm4
+	movups	%xmm3,16(%edi)
+	xorps	%xmm0,%xmm5
+	movups	%xmm4,32(%edi)
+	movups	%xmm5,48(%edi)
+L040ctr32_ret:
+	pxor	%xmm0,%xmm0
+	pxor	%xmm1,%xmm1
+	pxor	%xmm2,%xmm2
+	pxor	%xmm3,%xmm3
+	pxor	%xmm4,%xmm4
+	movdqa	%xmm0,32(%esp)
+	pxor	%xmm5,%xmm5
+	movdqa	%xmm0,48(%esp)
+	pxor	%xmm6,%xmm6
+	movdqa	%xmm0,64(%esp)
+	pxor	%xmm7,%xmm7
+	movl	80(%esp),%esp
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.globl	_aesni_xts_encrypt
+.private_extern	_aesni_xts_encrypt
+.align	4
+_aesni_xts_encrypt:
+L_aesni_xts_encrypt_begin:
+	pushl	%ebp
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+	movl	36(%esp),%edx
+	movl	40(%esp),%esi
+	movl	240(%edx),%ecx
+	movups	(%esi),%xmm2
+	movups	(%edx),%xmm0
+	movups	16(%edx),%xmm1
+	leal	32(%edx),%edx
+	xorps	%xmm0,%xmm2
+L046enc1_loop_8:
+.byte	102,15,56,220,209
+	decl	%ecx
+	movups	(%edx),%xmm1
+	leal	16(%edx),%edx
+	jnz	L046enc1_loop_8
+.byte	102,15,56,221,209
+	movl	20(%esp),%esi
+	movl	24(%esp),%edi
+	movl	28(%esp),%eax
+	movl	32(%esp),%edx
+	movl	%esp,%ebp
+	subl	$120,%esp
+	movl	240(%edx),%ecx
+	andl	$-16,%esp
+	movl	$135,96(%esp)
+	movl	$0,100(%esp)
+	movl	$1,104(%esp)
+	movl	$0,108(%esp)
+	movl	%eax,112(%esp)
+	movl	%ebp,116(%esp)
+	movdqa	%xmm2,%xmm1
+	pxor	%xmm0,%xmm0
+	movdqa	96(%esp),%xmm3
+	pcmpgtd	%xmm1,%xmm0
+	andl	$-16,%eax
+	movl	%edx,%ebp
+	movl	%ecx,%ebx
+	subl	$96,%eax
+	jc	L047xts_enc_short
+	shll	$4,%ecx
+	movl	$16,%ebx
+	subl	%ecx,%ebx
+	leal	32(%edx,%ecx,1),%edx
+	jmp	L048xts_enc_loop6
+.align	4,0x90
+L048xts_enc_loop6:
+	pshufd	$19,%xmm0,%xmm2
+	pxor	%xmm0,%xmm0
+	movdqa	%xmm1,(%esp)
+	paddq	%xmm1,%xmm1
+	pand	%xmm3,%xmm2
+	pcmpgtd	%xmm1,%xmm0
+	pxor	%xmm2,%xmm1
+	pshufd	$19,%xmm0,%xmm2
+	pxor	%xmm0,%xmm0
+	movdqa	%xmm1,16(%esp)
+	paddq	%xmm1,%xmm1
+	pand	%xmm3,%xmm2
+	pcmpgtd	%xmm1,%xmm0
+	pxor	%xmm2,%xmm1
+	pshufd	$19,%xmm0,%xmm2
+	pxor	%xmm0,%xmm0
+	movdqa	%xmm1,32(%esp)
+	paddq	%xmm1,%xmm1
+	pand	%xmm3,%xmm2
+	pcmpgtd	%xmm1,%xmm0
+	pxor	%xmm2,%xmm1
+	pshufd	$19,%xmm0,%xmm2
+	pxor	%xmm0,%xmm0
+	movdqa	%xmm1,48(%esp)
+	paddq	%xmm1,%xmm1
+	pand	%xmm3,%xmm2
+	pcmpgtd	%xmm1,%xmm0
+	pxor	%xmm2,%xmm1
+	pshufd	$19,%xmm0,%xmm7
+	movdqa	%xmm1,64(%esp)
+	paddq	%xmm1,%xmm1
+	movups	(%ebp),%xmm0
+	pand	%xmm3,%xmm7
+	movups	(%esi),%xmm2
+	pxor	%xmm1,%xmm7
+	movl	%ebx,%ecx
+	movdqu	16(%esi),%xmm3
+	xorps	%xmm0,%xmm2
+	movdqu	32(%esi),%xmm4
+	pxor	%xmm0,%xmm3
+	movdqu	48(%esi),%xmm5
+	pxor	%xmm0,%xmm4
+	movdqu	64(%esi),%xmm6
+	pxor	%xmm0,%xmm5
+	movdqu	80(%esi),%xmm1
+	pxor	%xmm0,%xmm6
+	leal	96(%esi),%esi
+	pxor	(%esp),%xmm2
+	movdqa	%xmm7,80(%esp)
+	pxor	%xmm1,%xmm7
+	movups	16(%ebp),%xmm1
+	pxor	16(%esp),%xmm3
+	pxor	32(%esp),%xmm4
+.byte	102,15,56,220,209
+	pxor	48(%esp),%xmm5
+	pxor	64(%esp),%xmm6
+.byte	102,15,56,220,217
+	pxor	%xmm0,%xmm7
+	movups	32(%ebp),%xmm0
+.byte	102,15,56,220,225
+.byte	102,15,56,220,233
+.byte	102,15,56,220,241
+.byte	102,15,56,220,249
+	call	L_aesni_encrypt6_enter
+	movdqa	80(%esp),%xmm1
+	pxor	%xmm0,%xmm0
+	xorps	(%esp),%xmm2
+	pcmpgtd	%xmm1,%xmm0
+	xorps	16(%esp),%xmm3
+	movups	%xmm2,(%edi)
+	xorps	32(%esp),%xmm4
+	movups	%xmm3,16(%edi)
+	xorps	48(%esp),%xmm5
+	movups	%xmm4,32(%edi)
+	xorps	64(%esp),%xmm6
+	movups	%xmm5,48(%edi)
+	xorps	%xmm1,%xmm7
+	movups	%xmm6,64(%edi)
+	pshufd	$19,%xmm0,%xmm2
+	movups	%xmm7,80(%edi)
+	leal	96(%edi),%edi
+	movdqa	96(%esp),%xmm3
+	pxor	%xmm0,%xmm0
+	paddq	%xmm1,%xmm1
+	pand	%xmm3,%xmm2
+	pcmpgtd	%xmm1,%xmm0
+	pxor	%xmm2,%xmm1
+	subl	$96,%eax
+	jnc	L048xts_enc_loop6
+	movl	240(%ebp),%ecx
+	movl	%ebp,%edx
+	movl	%ecx,%ebx
+L047xts_enc_short:
+	addl	$96,%eax
+	jz	L049xts_enc_done6x
+	movdqa	%xmm1,%xmm5
+	cmpl	$32,%eax
+	jb	L050xts_enc_one
+	pshufd	$19,%xmm0,%xmm2
+	pxor	%xmm0,%xmm0
+	paddq	%xmm1,%xmm1
+	pand	%xmm3,%xmm2
+	pcmpgtd	%xmm1,%xmm0
+	pxor	%xmm2,%xmm1
+	je	L051xts_enc_two
+	pshufd	$19,%xmm0,%xmm2
+	pxor	%xmm0,%xmm0
+	movdqa	%xmm1,%xmm6
+	paddq	%xmm1,%xmm1
+	pand	%xmm3,%xmm2
+	pcmpgtd	%xmm1,%xmm0
+	pxor	%xmm2,%xmm1
+	cmpl	$64,%eax
+	jb	L052xts_enc_three
+	pshufd	$19,%xmm0,%xmm2
+	pxor	%xmm0,%xmm0
+	movdqa	%xmm1,%xmm7
+	paddq	%xmm1,%xmm1
+	pand	%xmm3,%xmm2
+	pcmpgtd	%xmm1,%xmm0
+	pxor	%xmm2,%xmm1
+	movdqa	%xmm5,(%esp)
+	movdqa	%xmm6,16(%esp)
+	je	L053xts_enc_four
+	movdqa	%xmm7,32(%esp)
+	pshufd	$19,%xmm0,%xmm7
+	movdqa	%xmm1,48(%esp)
+	paddq	%xmm1,%xmm1
+	pand	%xmm3,%xmm7
+	pxor	%xmm1,%xmm7
+	movdqu	(%esi),%xmm2
+	movdqu	16(%esi),%xmm3
+	movdqu	32(%esi),%xmm4
+	pxor	(%esp),%xmm2
+	movdqu	48(%esi),%xmm5
+	pxor	16(%esp),%xmm3
+	movdqu	64(%esi),%xmm6
+	pxor	32(%esp),%xmm4
+	leal	80(%esi),%esi
+	pxor	48(%esp),%xmm5
+	movdqa	%xmm7,64(%esp)
+	pxor	%xmm7,%xmm6
+	call	__aesni_encrypt6
+	movaps	64(%esp),%xmm1
+	xorps	(%esp),%xmm2
+	xorps	16(%esp),%xmm3
+	xorps	32(%esp),%xmm4
+	movups	%xmm2,(%edi)
+	xorps	48(%esp),%xmm5
+	movups	%xmm3,16(%edi)
+	xorps	%xmm1,%xmm6
+	movups	%xmm4,32(%edi)
+	movups	%xmm5,48(%edi)
+	movups	%xmm6,64(%edi)
+	leal	80(%edi),%edi
+	jmp	L054xts_enc_done
+.align	4,0x90
+L050xts_enc_one:
+	movups	(%esi),%xmm2
+	leal	16(%esi),%esi
+	xorps	%xmm5,%xmm2
+	movups	(%edx),%xmm0
+	movups	16(%edx),%xmm1
+	leal	32(%edx),%edx
+	xorps	%xmm0,%xmm2
+L055enc1_loop_9:
+.byte	102,15,56,220,209
+	decl	%ecx
+	movups	(%edx),%xmm1
+	leal	16(%edx),%edx
+	jnz	L055enc1_loop_9
+.byte	102,15,56,221,209
+	xorps	%xmm5,%xmm2
+	movups	%xmm2,(%edi)
+	leal	16(%edi),%edi
+	movdqa	%xmm5,%xmm1
+	jmp	L054xts_enc_done
+.align	4,0x90
+L051xts_enc_two:
+	movaps	%xmm1,%xmm6
+	movups	(%esi),%xmm2
+	movups	16(%esi),%xmm3
+	leal	32(%esi),%esi
+	xorps	%xmm5,%xmm2
+	xorps	%xmm6,%xmm3
+	call	__aesni_encrypt2
+	xorps	%xmm5,%xmm2
+	xorps	%xmm6,%xmm3
+	movups	%xmm2,(%edi)
+	movups	%xmm3,16(%edi)
+	leal	32(%edi),%edi
+	movdqa	%xmm6,%xmm1
+	jmp	L054xts_enc_done
+.align	4,0x90
+L052xts_enc_three:
+	movaps	%xmm1,%xmm7
+	movups	(%esi),%xmm2
+	movups	16(%esi),%xmm3
+	movups	32(%esi),%xmm4
+	leal	48(%esi),%esi
+	xorps	%xmm5,%xmm2
+	xorps	%xmm6,%xmm3
+	xorps	%xmm7,%xmm4
+	call	__aesni_encrypt3
+	xorps	%xmm5,%xmm2
+	xorps	%xmm6,%xmm3
+	xorps	%xmm7,%xmm4
+	movups	%xmm2,(%edi)
+	movups	%xmm3,16(%edi)
+	movups	%xmm4,32(%edi)
+	leal	48(%edi),%edi
+	movdqa	%xmm7,%xmm1
+	jmp	L054xts_enc_done
+.align	4,0x90
+L053xts_enc_four:
+	movaps	%xmm1,%xmm6
+	movups	(%esi),%xmm2
+	movups	16(%esi),%xmm3
+	movups	32(%esi),%xmm4
+	xorps	(%esp),%xmm2
+	movups	48(%esi),%xmm5
+	leal	64(%esi),%esi
+	xorps	16(%esp),%xmm3
+	xorps	%xmm7,%xmm4
+	xorps	%xmm6,%xmm5
+	call	__aesni_encrypt4
+	xorps	(%esp),%xmm2
+	xorps	16(%esp),%xmm3
+	xorps	%xmm7,%xmm4
+	movups	%xmm2,(%edi)
+	xorps	%xmm6,%xmm5
+	movups	%xmm3,16(%edi)
+	movups	%xmm4,32(%edi)
+	movups	%xmm5,48(%edi)
+	leal	64(%edi),%edi
+	movdqa	%xmm6,%xmm1
+	jmp	L054xts_enc_done
+.align	4,0x90
+L049xts_enc_done6x:
+	movl	112(%esp),%eax
+	andl	$15,%eax
+	jz	L056xts_enc_ret
+	movdqa	%xmm1,%xmm5
+	movl	%eax,112(%esp)
+	jmp	L057xts_enc_steal
+.align	4,0x90
+L054xts_enc_done:
+	movl	112(%esp),%eax
+	pxor	%xmm0,%xmm0
+	andl	$15,%eax
+	jz	L056xts_enc_ret
+	pcmpgtd	%xmm1,%xmm0
+	movl	%eax,112(%esp)
+	pshufd	$19,%xmm0,%xmm5
+	paddq	%xmm1,%xmm1
+	pand	96(%esp),%xmm5
+	pxor	%xmm1,%xmm5
+L057xts_enc_steal:
+	movzbl	(%esi),%ecx
+	movzbl	-16(%edi),%edx
+	leal	1(%esi),%esi
+	movb	%cl,-16(%edi)
+	movb	%dl,(%edi)
+	leal	1(%edi),%edi
+	subl	$1,%eax
+	jnz	L057xts_enc_steal
+	subl	112(%esp),%edi
+	movl	%ebp,%edx
+	movl	%ebx,%ecx
+	movups	-16(%edi),%xmm2
+	xorps	%xmm5,%xmm2
+	movups	(%edx),%xmm0
+	movups	16(%edx),%xmm1
+	leal	32(%edx),%edx
+	xorps	%xmm0,%xmm2
+L058enc1_loop_10:
+.byte	102,15,56,220,209
+	decl	%ecx
+	movups	(%edx),%xmm1
+	leal	16(%edx),%edx
+	jnz	L058enc1_loop_10
+.byte	102,15,56,221,209
+	xorps	%xmm5,%xmm2
+	movups	%xmm2,-16(%edi)
+L056xts_enc_ret:
+	pxor	%xmm0,%xmm0
+	pxor	%xmm1,%xmm1
+	pxor	%xmm2,%xmm2
+	movdqa	%xmm0,(%esp)
+	pxor	%xmm3,%xmm3
+	movdqa	%xmm0,16(%esp)
+	pxor	%xmm4,%xmm4
+	movdqa	%xmm0,32(%esp)
+	pxor	%xmm5,%xmm5
+	movdqa	%xmm0,48(%esp)
+	pxor	%xmm6,%xmm6
+	movdqa	%xmm0,64(%esp)
+	pxor	%xmm7,%xmm7
+	movdqa	%xmm0,80(%esp)
+	movl	116(%esp),%esp
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.globl	_aesni_xts_decrypt
+.private_extern	_aesni_xts_decrypt
+.align	4
+_aesni_xts_decrypt:
+L_aesni_xts_decrypt_begin:
+	pushl	%ebp
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+	movl	36(%esp),%edx
+	movl	40(%esp),%esi
+	movl	240(%edx),%ecx
+	movups	(%esi),%xmm2
+	movups	(%edx),%xmm0
+	movups	16(%edx),%xmm1
+	leal	32(%edx),%edx
+	xorps	%xmm0,%xmm2
+L059enc1_loop_11:
+.byte	102,15,56,220,209
+	decl	%ecx
+	movups	(%edx),%xmm1
+	leal	16(%edx),%edx
+	jnz	L059enc1_loop_11
+.byte	102,15,56,221,209
+	movl	20(%esp),%esi
+	movl	24(%esp),%edi
+	movl	28(%esp),%eax
+	movl	32(%esp),%edx
+	movl	%esp,%ebp
+	subl	$120,%esp
+	andl	$-16,%esp
+	xorl	%ebx,%ebx
+	testl	$15,%eax
+	setnz	%bl
+	shll	$4,%ebx
+	subl	%ebx,%eax
+	movl	$135,96(%esp)
+	movl	$0,100(%esp)
+	movl	$1,104(%esp)
+	movl	$0,108(%esp)
+	movl	%eax,112(%esp)
+	movl	%ebp,116(%esp)
+	movl	240(%edx),%ecx
+	movl	%edx,%ebp
+	movl	%ecx,%ebx
+	movdqa	%xmm2,%xmm1
+	pxor	%xmm0,%xmm0
+	movdqa	96(%esp),%xmm3
+	pcmpgtd	%xmm1,%xmm0
+	andl	$-16,%eax
+	subl	$96,%eax
+	jc	L060xts_dec_short
+	shll	$4,%ecx
+	movl	$16,%ebx
+	subl	%ecx,%ebx
+	leal	32(%edx,%ecx,1),%edx
+	jmp	L061xts_dec_loop6
+.align	4,0x90
+L061xts_dec_loop6:
+	pshufd	$19,%xmm0,%xmm2
+	pxor	%xmm0,%xmm0
+	movdqa	%xmm1,(%esp)
+	paddq	%xmm1,%xmm1
+	pand	%xmm3,%xmm2
+	pcmpgtd	%xmm1,%xmm0
+	pxor	%xmm2,%xmm1
+	pshufd	$19,%xmm0,%xmm2
+	pxor	%xmm0,%xmm0
+	movdqa	%xmm1,16(%esp)
+	paddq	%xmm1,%xmm1
+	pand	%xmm3,%xmm2
+	pcmpgtd	%xmm1,%xmm0
+	pxor	%xmm2,%xmm1
+	pshufd	$19,%xmm0,%xmm2
+	pxor	%xmm0,%xmm0
+	movdqa	%xmm1,32(%esp)
+	paddq	%xmm1,%xmm1
+	pand	%xmm3,%xmm2
+	pcmpgtd	%xmm1,%xmm0
+	pxor	%xmm2,%xmm1
+	pshufd	$19,%xmm0,%xmm2
+	pxor	%xmm0,%xmm0
+	movdqa	%xmm1,48(%esp)
+	paddq	%xmm1,%xmm1
+	pand	%xmm3,%xmm2
+	pcmpgtd	%xmm1,%xmm0
+	pxor	%xmm2,%xmm1
+	pshufd	$19,%xmm0,%xmm7
+	movdqa	%xmm1,64(%esp)
+	paddq	%xmm1,%xmm1
+	movups	(%ebp),%xmm0
+	pand	%xmm3,%xmm7
+	movups	(%esi),%xmm2
+	pxor	%xmm1,%xmm7
+	movl	%ebx,%ecx
+	movdqu	16(%esi),%xmm3
+	xorps	%xmm0,%xmm2
+	movdqu	32(%esi),%xmm4
+	pxor	%xmm0,%xmm3
+	movdqu	48(%esi),%xmm5
+	pxor	%xmm0,%xmm4
+	movdqu	64(%esi),%xmm6
+	pxor	%xmm0,%xmm5
+	movdqu	80(%esi),%xmm1
+	pxor	%xmm0,%xmm6
+	leal	96(%esi),%esi
+	pxor	(%esp),%xmm2
+	movdqa	%xmm7,80(%esp)
+	pxor	%xmm1,%xmm7
+	movups	16(%ebp),%xmm1
+	pxor	16(%esp),%xmm3
+	pxor	32(%esp),%xmm4
+.byte	102,15,56,222,209
+	pxor	48(%esp),%xmm5
+	pxor	64(%esp),%xmm6
+.byte	102,15,56,222,217
+	pxor	%xmm0,%xmm7
+	movups	32(%ebp),%xmm0
+.byte	102,15,56,222,225
+.byte	102,15,56,222,233
+.byte	102,15,56,222,241
+.byte	102,15,56,222,249
+	call	L_aesni_decrypt6_enter
+	movdqa	80(%esp),%xmm1
+	pxor	%xmm0,%xmm0
+	xorps	(%esp),%xmm2
+	pcmpgtd	%xmm1,%xmm0
+	xorps	16(%esp),%xmm3
+	movups	%xmm2,(%edi)
+	xorps	32(%esp),%xmm4
+	movups	%xmm3,16(%edi)
+	xorps	48(%esp),%xmm5
+	movups	%xmm4,32(%edi)
+	xorps	64(%esp),%xmm6
+	movups	%xmm5,48(%edi)
+	xorps	%xmm1,%xmm7
+	movups	%xmm6,64(%edi)
+	pshufd	$19,%xmm0,%xmm2
+	movups	%xmm7,80(%edi)
+	leal	96(%edi),%edi
+	movdqa	96(%esp),%xmm3
+	pxor	%xmm0,%xmm0
+	paddq	%xmm1,%xmm1
+	pand	%xmm3,%xmm2
+	pcmpgtd	%xmm1,%xmm0
+	pxor	%xmm2,%xmm1
+	subl	$96,%eax
+	jnc	L061xts_dec_loop6
+	movl	240(%ebp),%ecx
+	movl	%ebp,%edx
+	movl	%ecx,%ebx
+L060xts_dec_short:
+	addl	$96,%eax
+	jz	L062xts_dec_done6x
+	movdqa	%xmm1,%xmm5
+	cmpl	$32,%eax
+	jb	L063xts_dec_one
+	pshufd	$19,%xmm0,%xmm2
+	pxor	%xmm0,%xmm0
+	paddq	%xmm1,%xmm1
+	pand	%xmm3,%xmm2
+	pcmpgtd	%xmm1,%xmm0
+	pxor	%xmm2,%xmm1
+	je	L064xts_dec_two
+	pshufd	$19,%xmm0,%xmm2
+	pxor	%xmm0,%xmm0
+	movdqa	%xmm1,%xmm6
+	paddq	%xmm1,%xmm1
+	pand	%xmm3,%xmm2
+	pcmpgtd	%xmm1,%xmm0
+	pxor	%xmm2,%xmm1
+	cmpl	$64,%eax
+	jb	L065xts_dec_three
+	pshufd	$19,%xmm0,%xmm2
+	pxor	%xmm0,%xmm0
+	movdqa	%xmm1,%xmm7
+	paddq	%xmm1,%xmm1
+	pand	%xmm3,%xmm2
+	pcmpgtd	%xmm1,%xmm0
+	pxor	%xmm2,%xmm1
+	movdqa	%xmm5,(%esp)
+	movdqa	%xmm6,16(%esp)
+	je	L066xts_dec_four
+	movdqa	%xmm7,32(%esp)
+	pshufd	$19,%xmm0,%xmm7
+	movdqa	%xmm1,48(%esp)
+	paddq	%xmm1,%xmm1
+	pand	%xmm3,%xmm7
+	pxor	%xmm1,%xmm7
+	movdqu	(%esi),%xmm2
+	movdqu	16(%esi),%xmm3
+	movdqu	32(%esi),%xmm4
+	pxor	(%esp),%xmm2
+	movdqu	48(%esi),%xmm5
+	pxor	16(%esp),%xmm3
+	movdqu	64(%esi),%xmm6
+	pxor	32(%esp),%xmm4
+	leal	80(%esi),%esi
+	pxor	48(%esp),%xmm5
+	movdqa	%xmm7,64(%esp)
+	pxor	%xmm7,%xmm6
+	call	__aesni_decrypt6
+	movaps	64(%esp),%xmm1
+	xorps	(%esp),%xmm2
+	xorps	16(%esp),%xmm3
+	xorps	32(%esp),%xmm4
+	movups	%xmm2,(%edi)
+	xorps	48(%esp),%xmm5
+	movups	%xmm3,16(%edi)
+	xorps	%xmm1,%xmm6
+	movups	%xmm4,32(%edi)
+	movups	%xmm5,48(%edi)
+	movups	%xmm6,64(%edi)
+	leal	80(%edi),%edi
+	jmp	L067xts_dec_done
+.align	4,0x90
+L063xts_dec_one:
+	movups	(%esi),%xmm2
+	leal	16(%esi),%esi
+	xorps	%xmm5,%xmm2
+	movups	(%edx),%xmm0
+	movups	16(%edx),%xmm1
+	leal	32(%edx),%edx
+	xorps	%xmm0,%xmm2
+L068dec1_loop_12:
+.byte	102,15,56,222,209
+	decl	%ecx
+	movups	(%edx),%xmm1
+	leal	16(%edx),%edx
+	jnz	L068dec1_loop_12
+.byte	102,15,56,223,209
+	xorps	%xmm5,%xmm2
+	movups	%xmm2,(%edi)
+	leal	16(%edi),%edi
+	movdqa	%xmm5,%xmm1
+	jmp	L067xts_dec_done
+.align	4,0x90
+L064xts_dec_two:
+	movaps	%xmm1,%xmm6
+	movups	(%esi),%xmm2
+	movups	16(%esi),%xmm3
+	leal	32(%esi),%esi
+	xorps	%xmm5,%xmm2
+	xorps	%xmm6,%xmm3
+	call	__aesni_decrypt2
+	xorps	%xmm5,%xmm2
+	xorps	%xmm6,%xmm3
+	movups	%xmm2,(%edi)
+	movups	%xmm3,16(%edi)
+	leal	32(%edi),%edi
+	movdqa	%xmm6,%xmm1
+	jmp	L067xts_dec_done
+.align	4,0x90
+L065xts_dec_three:
+	movaps	%xmm1,%xmm7
+	movups	(%esi),%xmm2
+	movups	16(%esi),%xmm3
+	movups	32(%esi),%xmm4
+	leal	48(%esi),%esi
+	xorps	%xmm5,%xmm2
+	xorps	%xmm6,%xmm3
+	xorps	%xmm7,%xmm4
+	call	__aesni_decrypt3
+	xorps	%xmm5,%xmm2
+	xorps	%xmm6,%xmm3
+	xorps	%xmm7,%xmm4
+	movups	%xmm2,(%edi)
+	movups	%xmm3,16(%edi)
+	movups	%xmm4,32(%edi)
+	leal	48(%edi),%edi
+	movdqa	%xmm7,%xmm1
+	jmp	L067xts_dec_done
+.align	4,0x90
+L066xts_dec_four:
+	movaps	%xmm1,%xmm6
+	movups	(%esi),%xmm2
+	movups	16(%esi),%xmm3
+	movups	32(%esi),%xmm4
+	xorps	(%esp),%xmm2
+	movups	48(%esi),%xmm5
+	leal	64(%esi),%esi
+	xorps	16(%esp),%xmm3
+	xorps	%xmm7,%xmm4
+	xorps	%xmm6,%xmm5
+	call	__aesni_decrypt4
+	xorps	(%esp),%xmm2
+	xorps	16(%esp),%xmm3
+	xorps	%xmm7,%xmm4
+	movups	%xmm2,(%edi)
+	xorps	%xmm6,%xmm5
+	movups	%xmm3,16(%edi)
+	movups	%xmm4,32(%edi)
+	movups	%xmm5,48(%edi)
+	leal	64(%edi),%edi
+	movdqa	%xmm6,%xmm1
+	jmp	L067xts_dec_done
+.align	4,0x90
+L062xts_dec_done6x:
+	movl	112(%esp),%eax
+	andl	$15,%eax
+	jz	L069xts_dec_ret
+	movl	%eax,112(%esp)
+	jmp	L070xts_dec_only_one_more
+.align	4,0x90
+L067xts_dec_done:
+	movl	112(%esp),%eax
+	pxor	%xmm0,%xmm0
+	andl	$15,%eax
+	jz	L069xts_dec_ret
+	pcmpgtd	%xmm1,%xmm0
+	movl	%eax,112(%esp)
+	pshufd	$19,%xmm0,%xmm2
+	pxor	%xmm0,%xmm0
+	movdqa	96(%esp),%xmm3
+	paddq	%xmm1,%xmm1
+	pand	%xmm3,%xmm2
+	pcmpgtd	%xmm1,%xmm0
+	pxor	%xmm2,%xmm1
+L070xts_dec_only_one_more:
+	pshufd	$19,%xmm0,%xmm5
+	movdqa	%xmm1,%xmm6
+	paddq	%xmm1,%xmm1
+	pand	%xmm3,%xmm5
+	pxor	%xmm1,%xmm5
+	movl	%ebp,%edx
+	movl	%ebx,%ecx
+	movups	(%esi),%xmm2
+	xorps	%xmm5,%xmm2
+	movups	(%edx),%xmm0
+	movups	16(%edx),%xmm1
+	leal	32(%edx),%edx
+	xorps	%xmm0,%xmm2
+L071dec1_loop_13:
+.byte	102,15,56,222,209
+	decl	%ecx
+	movups	(%edx),%xmm1
+	leal	16(%edx),%edx
+	jnz	L071dec1_loop_13
+.byte	102,15,56,223,209
+	xorps	%xmm5,%xmm2
+	movups	%xmm2,(%edi)
+L072xts_dec_steal:
+	movzbl	16(%esi),%ecx
+	movzbl	(%edi),%edx
+	leal	1(%esi),%esi
+	movb	%cl,(%edi)
+	movb	%dl,16(%edi)
+	leal	1(%edi),%edi
+	subl	$1,%eax
+	jnz	L072xts_dec_steal
+	subl	112(%esp),%edi
+	movl	%ebp,%edx
+	movl	%ebx,%ecx
+	movups	(%edi),%xmm2
+	xorps	%xmm6,%xmm2
+	movups	(%edx),%xmm0
+	movups	16(%edx),%xmm1
+	leal	32(%edx),%edx
+	xorps	%xmm0,%xmm2
+L073dec1_loop_14:
+.byte	102,15,56,222,209
+	decl	%ecx
+	movups	(%edx),%xmm1
+	leal	16(%edx),%edx
+	jnz	L073dec1_loop_14
+.byte	102,15,56,223,209
+	xorps	%xmm6,%xmm2
+	movups	%xmm2,(%edi)
+L069xts_dec_ret:
+	pxor	%xmm0,%xmm0
+	pxor	%xmm1,%xmm1
+	pxor	%xmm2,%xmm2
+	movdqa	%xmm0,(%esp)
+	pxor	%xmm3,%xmm3
+	movdqa	%xmm0,16(%esp)
+	pxor	%xmm4,%xmm4
+	movdqa	%xmm0,32(%esp)
+	pxor	%xmm5,%xmm5
+	movdqa	%xmm0,48(%esp)
+	pxor	%xmm6,%xmm6
+	movdqa	%xmm0,64(%esp)
+	pxor	%xmm7,%xmm7
+	movdqa	%xmm0,80(%esp)
+	movl	116(%esp),%esp
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.globl	_aesni_cbc_encrypt
+.private_extern	_aesni_cbc_encrypt
+.align	4
+_aesni_cbc_encrypt:
+L_aesni_cbc_encrypt_begin:
+	pushl	%ebp
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+	movl	20(%esp),%esi
+	movl	%esp,%ebx
+	movl	24(%esp),%edi
+	subl	$24,%ebx
+	movl	28(%esp),%eax
+	andl	$-16,%ebx
+	movl	32(%esp),%edx
+	movl	36(%esp),%ebp
+	testl	%eax,%eax
+	jz	L074cbc_abort
+	cmpl	$0,40(%esp)
+	xchgl	%esp,%ebx
+	movups	(%ebp),%xmm7
+	movl	240(%edx),%ecx
+	movl	%edx,%ebp
+	movl	%ebx,16(%esp)
+	movl	%ecx,%ebx
+	je	L075cbc_decrypt
+	movaps	%xmm7,%xmm2
+	cmpl	$16,%eax
+	jb	L076cbc_enc_tail
+	subl	$16,%eax
+	jmp	L077cbc_enc_loop
+.align	4,0x90
+L077cbc_enc_loop:
+	movups	(%esi),%xmm7
+	leal	16(%esi),%esi
+	movups	(%edx),%xmm0
+	movups	16(%edx),%xmm1
+	xorps	%xmm0,%xmm7
+	leal	32(%edx),%edx
+	xorps	%xmm7,%xmm2
+L078enc1_loop_15:
+.byte	102,15,56,220,209
+	decl	%ecx
+	movups	(%edx),%xmm1
+	leal	16(%edx),%edx
+	jnz	L078enc1_loop_15
+.byte	102,15,56,221,209
+	movl	%ebx,%ecx
+	movl	%ebp,%edx
+	movups	%xmm2,(%edi)
+	leal	16(%edi),%edi
+	subl	$16,%eax
+	jnc	L077cbc_enc_loop
+	addl	$16,%eax
+	jnz	L076cbc_enc_tail
+	movaps	%xmm2,%xmm7
+	pxor	%xmm2,%xmm2
+	jmp	L079cbc_ret
+L076cbc_enc_tail:
+	movl	%eax,%ecx
+.long	2767451785
+	movl	$16,%ecx
+	subl	%eax,%ecx
+	xorl	%eax,%eax
+.long	2868115081
+	leal	-16(%edi),%edi
+	movl	%ebx,%ecx
+	movl	%edi,%esi
+	movl	%ebp,%edx
+	jmp	L077cbc_enc_loop
+.align	4,0x90
+L075cbc_decrypt:
+	cmpl	$80,%eax
+	jbe	L080cbc_dec_tail
+	movaps	%xmm7,(%esp)
+	subl	$80,%eax
+	jmp	L081cbc_dec_loop6_enter
+.align	4,0x90
+L082cbc_dec_loop6:
+	movaps	%xmm0,(%esp)
+	movups	%xmm7,(%edi)
+	leal	16(%edi),%edi
+L081cbc_dec_loop6_enter:
+	movdqu	(%esi),%xmm2
+	movdqu	16(%esi),%xmm3
+	movdqu	32(%esi),%xmm4
+	movdqu	48(%esi),%xmm5
+	movdqu	64(%esi),%xmm6
+	movdqu	80(%esi),%xmm7
+	call	__aesni_decrypt6
+	movups	(%esi),%xmm1
+	movups	16(%esi),%xmm0
+	xorps	(%esp),%xmm2
+	xorps	%xmm1,%xmm3
+	movups	32(%esi),%xmm1
+	xorps	%xmm0,%xmm4
+	movups	48(%esi),%xmm0
+	xorps	%xmm1,%xmm5
+	movups	64(%esi),%xmm1
+	xorps	%xmm0,%xmm6
+	movups	80(%esi),%xmm0
+	xorps	%xmm1,%xmm7
+	movups	%xmm2,(%edi)
+	movups	%xmm3,16(%edi)
+	leal	96(%esi),%esi
+	movups	%xmm4,32(%edi)
+	movl	%ebx,%ecx
+	movups	%xmm5,48(%edi)
+	movl	%ebp,%edx
+	movups	%xmm6,64(%edi)
+	leal	80(%edi),%edi
+	subl	$96,%eax
+	ja	L082cbc_dec_loop6
+	movaps	%xmm7,%xmm2
+	movaps	%xmm0,%xmm7
+	addl	$80,%eax
+	jle	L083cbc_dec_clear_tail_collected
+	movups	%xmm2,(%edi)
+	leal	16(%edi),%edi
+L080cbc_dec_tail:
+	movups	(%esi),%xmm2
+	movaps	%xmm2,%xmm6
+	cmpl	$16,%eax
+	jbe	L084cbc_dec_one
+	movups	16(%esi),%xmm3
+	movaps	%xmm3,%xmm5
+	cmpl	$32,%eax
+	jbe	L085cbc_dec_two
+	movups	32(%esi),%xmm4
+	cmpl	$48,%eax
+	jbe	L086cbc_dec_three
+	movups	48(%esi),%xmm5
+	cmpl	$64,%eax
+	jbe	L087cbc_dec_four
+	movups	64(%esi),%xmm6
+	movaps	%xmm7,(%esp)
+	movups	(%esi),%xmm2
+	xorps	%xmm7,%xmm7
+	call	__aesni_decrypt6
+	movups	(%esi),%xmm1
+	movups	16(%esi),%xmm0
+	xorps	(%esp),%xmm2
+	xorps	%xmm1,%xmm3
+	movups	32(%esi),%xmm1
+	xorps	%xmm0,%xmm4
+	movups	48(%esi),%xmm0
+	xorps	%xmm1,%xmm5
+	movups	64(%esi),%xmm7
+	xorps	%xmm0,%xmm6
+	movups	%xmm2,(%edi)
+	movups	%xmm3,16(%edi)
+	pxor	%xmm3,%xmm3
+	movups	%xmm4,32(%edi)
+	pxor	%xmm4,%xmm4
+	movups	%xmm5,48(%edi)
+	pxor	%xmm5,%xmm5
+	leal	64(%edi),%edi
+	movaps	%xmm6,%xmm2
+	pxor	%xmm6,%xmm6
+	subl	$80,%eax
+	jmp	L088cbc_dec_tail_collected
+.align	4,0x90
+L084cbc_dec_one:
+	movups	(%edx),%xmm0
+	movups	16(%edx),%xmm1
+	leal	32(%edx),%edx
+	xorps	%xmm0,%xmm2
+L089dec1_loop_16:
+.byte	102,15,56,222,209
+	decl	%ecx
+	movups	(%edx),%xmm1
+	leal	16(%edx),%edx
+	jnz	L089dec1_loop_16
+.byte	102,15,56,223,209
+	xorps	%xmm7,%xmm2
+	movaps	%xmm6,%xmm7
+	subl	$16,%eax
+	jmp	L088cbc_dec_tail_collected
+.align	4,0x90
+L085cbc_dec_two:
+	call	__aesni_decrypt2
+	xorps	%xmm7,%xmm2
+	xorps	%xmm6,%xmm3
+	movups	%xmm2,(%edi)
+	movaps	%xmm3,%xmm2
+	pxor	%xmm3,%xmm3
+	leal	16(%edi),%edi
+	movaps	%xmm5,%xmm7
+	subl	$32,%eax
+	jmp	L088cbc_dec_tail_collected
+.align	4,0x90
+L086cbc_dec_three:
+	call	__aesni_decrypt3
+	xorps	%xmm7,%xmm2
+	xorps	%xmm6,%xmm3
+	xorps	%xmm5,%xmm4
+	movups	%xmm2,(%edi)
+	movaps	%xmm4,%xmm2
+	pxor	%xmm4,%xmm4
+	movups	%xmm3,16(%edi)
+	pxor	%xmm3,%xmm3
+	leal	32(%edi),%edi
+	movups	32(%esi),%xmm7
+	subl	$48,%eax
+	jmp	L088cbc_dec_tail_collected
+.align	4,0x90
+L087cbc_dec_four:
+	call	__aesni_decrypt4
+	movups	16(%esi),%xmm1
+	movups	32(%esi),%xmm0
+	xorps	%xmm7,%xmm2
+	movups	48(%esi),%xmm7
+	xorps	%xmm6,%xmm3
+	movups	%xmm2,(%edi)
+	xorps	%xmm1,%xmm4
+	movups	%xmm3,16(%edi)
+	pxor	%xmm3,%xmm3
+	xorps	%xmm0,%xmm5
+	movups	%xmm4,32(%edi)
+	pxor	%xmm4,%xmm4
+	leal	48(%edi),%edi
+	movaps	%xmm5,%xmm2
+	pxor	%xmm5,%xmm5
+	subl	$64,%eax
+	jmp	L088cbc_dec_tail_collected
+.align	4,0x90
+L083cbc_dec_clear_tail_collected:
+	pxor	%xmm3,%xmm3
+	pxor	%xmm4,%xmm4
+	pxor	%xmm5,%xmm5
+	pxor	%xmm6,%xmm6
+L088cbc_dec_tail_collected:
+	andl	$15,%eax
+	jnz	L090cbc_dec_tail_partial
+	movups	%xmm2,(%edi)
+	pxor	%xmm0,%xmm0
+	jmp	L079cbc_ret
+.align	4,0x90
+L090cbc_dec_tail_partial:
+	movaps	%xmm2,(%esp)
+	pxor	%xmm0,%xmm0
+	movl	$16,%ecx
+	movl	%esp,%esi
+	subl	%eax,%ecx
+.long	2767451785
+	movdqa	%xmm2,(%esp)
+L079cbc_ret:
+	movl	16(%esp),%esp
+	movl	36(%esp),%ebp
+	pxor	%xmm2,%xmm2
+	pxor	%xmm1,%xmm1
+	movups	%xmm7,(%ebp)
+	pxor	%xmm7,%xmm7
+L074cbc_abort:
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.private_extern	__aesni_set_encrypt_key
+.align	4
+__aesni_set_encrypt_key:
+	pushl	%ebp
+	pushl	%ebx
+	testl	%eax,%eax
+	jz	L091bad_pointer
+	testl	%edx,%edx
+	jz	L091bad_pointer
+	call	L092pic
+L092pic:
+	popl	%ebx
+	leal	Lkey_const-L092pic(%ebx),%ebx
+	movl	L_OPENSSL_ia32cap_P$non_lazy_ptr-Lkey_const(%ebx),%ebp
+	movups	(%eax),%xmm0
+	xorps	%xmm4,%xmm4
+	movl	4(%ebp),%ebp
+	leal	16(%edx),%edx
+	andl	$268437504,%ebp
+	cmpl	$256,%ecx
+	je	L09314rounds
+	cmpl	$192,%ecx
+	je	L09412rounds
+	cmpl	$128,%ecx
+	jne	L095bad_keybits
+.align	4,0x90
+L09610rounds:
+	cmpl	$268435456,%ebp
+	je	L09710rounds_alt
+	movl	$9,%ecx
+	movups	%xmm0,-16(%edx)
+.byte	102,15,58,223,200,1
+	call	L098key_128_cold
+.byte	102,15,58,223,200,2
+	call	L099key_128
+.byte	102,15,58,223,200,4
+	call	L099key_128
+.byte	102,15,58,223,200,8
+	call	L099key_128
+.byte	102,15,58,223,200,16
+	call	L099key_128
+.byte	102,15,58,223,200,32
+	call	L099key_128
+.byte	102,15,58,223,200,64
+	call	L099key_128
+.byte	102,15,58,223,200,128
+	call	L099key_128
+.byte	102,15,58,223,200,27
+	call	L099key_128
+.byte	102,15,58,223,200,54
+	call	L099key_128
+	movups	%xmm0,(%edx)
+	movl	%ecx,80(%edx)
+	jmp	L100good_key
+.align	4,0x90
+L099key_128:
+	movups	%xmm0,(%edx)
+	leal	16(%edx),%edx
+L098key_128_cold:
+	shufps	$16,%xmm0,%xmm4
+	xorps	%xmm4,%xmm0
+	shufps	$140,%xmm0,%xmm4
+	xorps	%xmm4,%xmm0
+	shufps	$255,%xmm1,%xmm1
+	xorps	%xmm1,%xmm0
+	ret
+.align	4,0x90
+L09710rounds_alt:
+	movdqa	(%ebx),%xmm5
+	movl	$8,%ecx
+	movdqa	32(%ebx),%xmm4
+	movdqa	%xmm0,%xmm2
+	movdqu	%xmm0,-16(%edx)
+L101loop_key128:
+.byte	102,15,56,0,197
+.byte	102,15,56,221,196
+	pslld	$1,%xmm4
+	leal	16(%edx),%edx
+	movdqa	%xmm2,%xmm3
+	pslldq	$4,%xmm2
+	pxor	%xmm2,%xmm3
+	pslldq	$4,%xmm2
+	pxor	%xmm2,%xmm3
+	pslldq	$4,%xmm2
+	pxor	%xmm3,%xmm2
+	pxor	%xmm2,%xmm0
+	movdqu	%xmm0,-16(%edx)
+	movdqa	%xmm0,%xmm2
+	decl	%ecx
+	jnz	L101loop_key128
+	movdqa	48(%ebx),%xmm4
+.byte	102,15,56,0,197
+.byte	102,15,56,221,196
+	pslld	$1,%xmm4
+	movdqa	%xmm2,%xmm3
+	pslldq	$4,%xmm2
+	pxor	%xmm2,%xmm3
+	pslldq	$4,%xmm2
+	pxor	%xmm2,%xmm3
+	pslldq	$4,%xmm2
+	pxor	%xmm3,%xmm2
+	pxor	%xmm2,%xmm0
+	movdqu	%xmm0,(%edx)
+	movdqa	%xmm0,%xmm2
+.byte	102,15,56,0,197
+.byte	102,15,56,221,196
+	movdqa	%xmm2,%xmm3
+	pslldq	$4,%xmm2
+	pxor	%xmm2,%xmm3
+	pslldq	$4,%xmm2
+	pxor	%xmm2,%xmm3
+	pslldq	$4,%xmm2
+	pxor	%xmm3,%xmm2
+	pxor	%xmm2,%xmm0
+	movdqu	%xmm0,16(%edx)
+	movl	$9,%ecx
+	movl	%ecx,96(%edx)
+	jmp	L100good_key
+.align	4,0x90
+L09412rounds:
+	movq	16(%eax),%xmm2
+	cmpl	$268435456,%ebp
+	je	L10212rounds_alt
+	movl	$11,%ecx
+	movups	%xmm0,-16(%edx)
+.byte	102,15,58,223,202,1
+	call	L103key_192a_cold
+.byte	102,15,58,223,202,2
+	call	L104key_192b
+.byte	102,15,58,223,202,4
+	call	L105key_192a
+.byte	102,15,58,223,202,8
+	call	L104key_192b
+.byte	102,15,58,223,202,16
+	call	L105key_192a
+.byte	102,15,58,223,202,32
+	call	L104key_192b
+.byte	102,15,58,223,202,64
+	call	L105key_192a
+.byte	102,15,58,223,202,128
+	call	L104key_192b
+	movups	%xmm0,(%edx)
+	movl	%ecx,48(%edx)
+	jmp	L100good_key
+.align	4,0x90
+L105key_192a:
+	movups	%xmm0,(%edx)
+	leal	16(%edx),%edx
+.align	4,0x90
+L103key_192a_cold:
+	movaps	%xmm2,%xmm5
+L106key_192b_warm:
+	shufps	$16,%xmm0,%xmm4
+	movdqa	%xmm2,%xmm3
+	xorps	%xmm4,%xmm0
+	shufps	$140,%xmm0,%xmm4
+	pslldq	$4,%xmm3
+	xorps	%xmm4,%xmm0
+	pshufd	$85,%xmm1,%xmm1
+	pxor	%xmm3,%xmm2
+	pxor	%xmm1,%xmm0
+	pshufd	$255,%xmm0,%xmm3
+	pxor	%xmm3,%xmm2
+	ret
+.align	4,0x90
+L104key_192b:
+	movaps	%xmm0,%xmm3
+	shufps	$68,%xmm0,%xmm5
+	movups	%xmm5,(%edx)
+	shufps	$78,%xmm2,%xmm3
+	movups	%xmm3,16(%edx)
+	leal	32(%edx),%edx
+	jmp	L106key_192b_warm
+.align	4,0x90
+L10212rounds_alt:
+	movdqa	16(%ebx),%xmm5
+	movdqa	32(%ebx),%xmm4
+	movl	$8,%ecx
+	movdqu	%xmm0,-16(%edx)
+L107loop_key192:
+	movq	%xmm2,(%edx)
+	movdqa	%xmm2,%xmm1
+.byte	102,15,56,0,213
+.byte	102,15,56,221,212
+	pslld	$1,%xmm4
+	leal	24(%edx),%edx
+	movdqa	%xmm0,%xmm3
+	pslldq	$4,%xmm0
+	pxor	%xmm0,%xmm3
+	pslldq	$4,%xmm0
+	pxor	%xmm0,%xmm3
+	pslldq	$4,%xmm0
+	pxor	%xmm3,%xmm0
+	pshufd	$255,%xmm0,%xmm3
+	pxor	%xmm1,%xmm3
+	pslldq	$4,%xmm1
+	pxor	%xmm1,%xmm3
+	pxor	%xmm2,%xmm0
+	pxor	%xmm3,%xmm2
+	movdqu	%xmm0,-16(%edx)
+	decl	%ecx
+	jnz	L107loop_key192
+	movl	$11,%ecx
+	movl	%ecx,32(%edx)
+	jmp	L100good_key
+.align	4,0x90
+L09314rounds:
+	movups	16(%eax),%xmm2
+	leal	16(%edx),%edx
+	cmpl	$268435456,%ebp
+	je	L10814rounds_alt
+	movl	$13,%ecx
+	movups	%xmm0,-32(%edx)
+	movups	%xmm2,-16(%edx)
+.byte	102,15,58,223,202,1
+	call	L109key_256a_cold
+.byte	102,15,58,223,200,1
+	call	L110key_256b
+.byte	102,15,58,223,202,2
+	call	L111key_256a
+.byte	102,15,58,223,200,2
+	call	L110key_256b
+.byte	102,15,58,223,202,4
+	call	L111key_256a
+.byte	102,15,58,223,200,4
+	call	L110key_256b
+.byte	102,15,58,223,202,8
+	call	L111key_256a
+.byte	102,15,58,223,200,8
+	call	L110key_256b
+.byte	102,15,58,223,202,16
+	call	L111key_256a
+.byte	102,15,58,223,200,16
+	call	L110key_256b
+.byte	102,15,58,223,202,32
+	call	L111key_256a
+.byte	102,15,58,223,200,32
+	call	L110key_256b
+.byte	102,15,58,223,202,64
+	call	L111key_256a
+	movups	%xmm0,(%edx)
+	movl	%ecx,16(%edx)
+	xorl	%eax,%eax
+	jmp	L100good_key
+.align	4,0x90
+L111key_256a:
+	movups	%xmm2,(%edx)
+	leal	16(%edx),%edx
+L109key_256a_cold:
+	shufps	$16,%xmm0,%xmm4
+	xorps	%xmm4,%xmm0
+	shufps	$140,%xmm0,%xmm4
+	xorps	%xmm4,%xmm0
+	shufps	$255,%xmm1,%xmm1
+	xorps	%xmm1,%xmm0
+	ret
+.align	4,0x90
+L110key_256b:
+	movups	%xmm0,(%edx)
+	leal	16(%edx),%edx
+	shufps	$16,%xmm2,%xmm4
+	xorps	%xmm4,%xmm2
+	shufps	$140,%xmm2,%xmm4
+	xorps	%xmm4,%xmm2
+	shufps	$170,%xmm1,%xmm1
+	xorps	%xmm1,%xmm2
+	ret
+.align	4,0x90
+L10814rounds_alt:
+	movdqa	(%ebx),%xmm5
+	movdqa	32(%ebx),%xmm4
+	movl	$7,%ecx
+	movdqu	%xmm0,-32(%edx)
+	movdqa	%xmm2,%xmm1
+	movdqu	%xmm2,-16(%edx)
+L112loop_key256:
+.byte	102,15,56,0,213
+.byte	102,15,56,221,212
+	movdqa	%xmm0,%xmm3
+	pslldq	$4,%xmm0
+	pxor	%xmm0,%xmm3
+	pslldq	$4,%xmm0
+	pxor	%xmm0,%xmm3
+	pslldq	$4,%xmm0
+	pxor	%xmm3,%xmm0
+	pslld	$1,%xmm4
+	pxor	%xmm2,%xmm0
+	movdqu	%xmm0,(%edx)
+	decl	%ecx
+	jz	L113done_key256
+	pshufd	$255,%xmm0,%xmm2
+	pxor	%xmm3,%xmm3
+.byte	102,15,56,221,211
+	movdqa	%xmm1,%xmm3
+	pslldq	$4,%xmm1
+	pxor	%xmm1,%xmm3
+	pslldq	$4,%xmm1
+	pxor	%xmm1,%xmm3
+	pslldq	$4,%xmm1
+	pxor	%xmm3,%xmm1
+	pxor	%xmm1,%xmm2
+	movdqu	%xmm2,16(%edx)
+	leal	32(%edx),%edx
+	movdqa	%xmm2,%xmm1
+	jmp	L112loop_key256
+L113done_key256:
+	movl	$13,%ecx
+	movl	%ecx,16(%edx)
+L100good_key:
+	pxor	%xmm0,%xmm0
+	pxor	%xmm1,%xmm1
+	pxor	%xmm2,%xmm2
+	pxor	%xmm3,%xmm3
+	pxor	%xmm4,%xmm4
+	pxor	%xmm5,%xmm5
+	xorl	%eax,%eax
+	popl	%ebx
+	popl	%ebp
+	ret
+.align	2,0x90
+L091bad_pointer:
+	movl	$-1,%eax
+	popl	%ebx
+	popl	%ebp
+	ret
+.align	2,0x90
+L095bad_keybits:
+	pxor	%xmm0,%xmm0
+	movl	$-2,%eax
+	popl	%ebx
+	popl	%ebp
+	ret
+.globl	_aesni_set_encrypt_key
+.private_extern	_aesni_set_encrypt_key
+.align	4
+_aesni_set_encrypt_key:
+L_aesni_set_encrypt_key_begin:
+	movl	4(%esp),%eax
+	movl	8(%esp),%ecx
+	movl	12(%esp),%edx
+	call	__aesni_set_encrypt_key
+	ret
+.globl	_aesni_set_decrypt_key
+.private_extern	_aesni_set_decrypt_key
+.align	4
+_aesni_set_decrypt_key:
+L_aesni_set_decrypt_key_begin:
+	movl	4(%esp),%eax
+	movl	8(%esp),%ecx
+	movl	12(%esp),%edx
+	call	__aesni_set_encrypt_key
+	movl	12(%esp),%edx
+	shll	$4,%ecx
+	testl	%eax,%eax
+	jnz	L114dec_key_ret
+	leal	16(%edx,%ecx,1),%eax
+	movups	(%edx),%xmm0
+	movups	(%eax),%xmm1
+	movups	%xmm0,(%eax)
+	movups	%xmm1,(%edx)
+	leal	16(%edx),%edx
+	leal	-16(%eax),%eax
+L115dec_key_inverse:
+	movups	(%edx),%xmm0
+	movups	(%eax),%xmm1
+.byte	102,15,56,219,192
+.byte	102,15,56,219,201
+	leal	16(%edx),%edx
+	leal	-16(%eax),%eax
+	movups	%xmm0,16(%eax)
+	movups	%xmm1,-16(%edx)
+	cmpl	%edx,%eax
+	ja	L115dec_key_inverse
+	movups	(%edx),%xmm0
+.byte	102,15,56,219,192
+	movups	%xmm0,(%edx)
+	pxor	%xmm0,%xmm0
+	pxor	%xmm1,%xmm1
+	xorl	%eax,%eax
+L114dec_key_ret:
+	ret
+.align	6,0x90
+Lkey_const:
+.long	202313229,202313229,202313229,202313229
+.long	67569157,67569157,67569157,67569157
+.long	1,1,1,1
+.long	27,27,27,27
+.byte	65,69,83,32,102,111,114,32,73,110,116,101,108,32,65,69
+.byte	83,45,78,73,44,32,67,82,89,80,84,79,71,65,77,83
+.byte	32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115
+.byte	115,108,46,111,114,103,62,0
+.section __IMPORT,__pointers,non_lazy_symbol_pointers
+L_OPENSSL_ia32cap_P$non_lazy_ptr:
+.indirect_symbol	_OPENSSL_ia32cap_P
+.long	0
+#endif
diff --git a/third_party/boringssl/mac-x86/crypto/aes/vpaes-x86.S b/third_party/boringssl/mac-x86/crypto/aes/vpaes-x86.S
new file mode 100644
index 0000000..8b85709
--- /dev/null
+++ b/third_party/boringssl/mac-x86/crypto/aes/vpaes-x86.S
@@ -0,0 +1,650 @@
+#if defined(__i386__)
+.file	"vpaes-x86.S"
+.text
+.align	6,0x90
+L_vpaes_consts:
+.long	218628480,235210255,168496130,67568393
+.long	252381056,17041926,33884169,51187212
+.long	252645135,252645135,252645135,252645135
+.long	1512730624,3266504856,1377990664,3401244816
+.long	830229760,1275146365,2969422977,3447763452
+.long	3411033600,2979783055,338359620,2782886510
+.long	4209124096,907596821,221174255,1006095553
+.long	191964160,3799684038,3164090317,1589111125
+.long	182528256,1777043520,2877432650,3265356744
+.long	1874708224,3503451415,3305285752,363511674
+.long	1606117888,3487855781,1093350906,2384367825
+.long	197121,67569157,134941193,202313229
+.long	67569157,134941193,202313229,197121
+.long	134941193,202313229,197121,67569157
+.long	202313229,197121,67569157,134941193
+.long	33619971,100992007,168364043,235736079
+.long	235736079,33619971,100992007,168364043
+.long	168364043,235736079,33619971,100992007
+.long	100992007,168364043,235736079,33619971
+.long	50462976,117835012,185207048,252579084
+.long	252314880,51251460,117574920,184942860
+.long	184682752,252054788,50987272,118359308
+.long	118099200,185467140,251790600,50727180
+.long	2946363062,528716217,1300004225,1881839624
+.long	1532713819,1532713819,1532713819,1532713819
+.long	3602276352,4288629033,3737020424,4153884961
+.long	1354558464,32357713,2958822624,3775749553
+.long	1201988352,132424512,1572796698,503232858
+.long	2213177600,1597421020,4103937655,675398315
+.long	2749646592,4273543773,1511898873,121693092
+.long	3040248576,1103263732,2871565598,1608280554
+.long	2236667136,2588920351,482954393,64377734
+.long	3069987328,291237287,2117370568,3650299247
+.long	533321216,3573750986,2572112006,1401264716
+.long	1339849704,2721158661,548607111,3445553514
+.long	2128193280,3054596040,2183486460,1257083700
+.long	655635200,1165381986,3923443150,2344132524
+.long	190078720,256924420,290342170,357187870
+.long	1610966272,2263057382,4103205268,309794674
+.long	2592527872,2233205587,1335446729,3402964816
+.long	3973531904,3225098121,3002836325,1918774430
+.long	3870401024,2102906079,2284471353,4117666579
+.long	617007872,1021508343,366931923,691083277
+.long	2528395776,3491914898,2968704004,1613121270
+.long	3445188352,3247741094,844474987,4093578302
+.long	651481088,1190302358,1689581232,574775300
+.long	4289380608,206939853,2555985458,2489840491
+.long	2130264064,327674451,3566485037,3349835193
+.long	2470714624,316102159,3636825756,3393945945
+.byte	86,101,99,116,111,114,32,80,101,114,109,117,116,97,116,105
+.byte	111,110,32,65,69,83,32,102,111,114,32,120,56,54,47,83
+.byte	83,83,69,51,44,32,77,105,107,101,32,72,97,109,98,117
+.byte	114,103,32,40,83,116,97,110,102,111,114,100,32,85,110,105
+.byte	118,101,114,115,105,116,121,41,0
+.align	6,0x90
+.private_extern	__vpaes_preheat
+.align	4
+__vpaes_preheat:
+	addl	(%esp),%ebp
+	movdqa	-48(%ebp),%xmm7
+	movdqa	-16(%ebp),%xmm6
+	ret
+.private_extern	__vpaes_encrypt_core
+.align	4
+__vpaes_encrypt_core:
+	movl	$16,%ecx
+	movl	240(%edx),%eax
+	movdqa	%xmm6,%xmm1
+	movdqa	(%ebp),%xmm2
+	pandn	%xmm0,%xmm1
+	pand	%xmm6,%xmm0
+	movdqu	(%edx),%xmm5
+.byte	102,15,56,0,208
+	movdqa	16(%ebp),%xmm0
+	pxor	%xmm5,%xmm2
+	psrld	$4,%xmm1
+	addl	$16,%edx
+.byte	102,15,56,0,193
+	leal	192(%ebp),%ebx
+	pxor	%xmm2,%xmm0
+	jmp	L000enc_entry
+.align	4,0x90
+L001enc_loop:
+	movdqa	32(%ebp),%xmm4
+	movdqa	48(%ebp),%xmm0
+.byte	102,15,56,0,226
+.byte	102,15,56,0,195
+	pxor	%xmm5,%xmm4
+	movdqa	64(%ebp),%xmm5
+	pxor	%xmm4,%xmm0
+	movdqa	-64(%ebx,%ecx,1),%xmm1
+.byte	102,15,56,0,234
+	movdqa	80(%ebp),%xmm2
+	movdqa	(%ebx,%ecx,1),%xmm4
+.byte	102,15,56,0,211
+	movdqa	%xmm0,%xmm3
+	pxor	%xmm5,%xmm2
+.byte	102,15,56,0,193
+	addl	$16,%edx
+	pxor	%xmm2,%xmm0
+.byte	102,15,56,0,220
+	addl	$16,%ecx
+	pxor	%xmm0,%xmm3
+.byte	102,15,56,0,193
+	andl	$48,%ecx
+	subl	$1,%eax
+	pxor	%xmm3,%xmm0
+L000enc_entry:
+	movdqa	%xmm6,%xmm1
+	movdqa	-32(%ebp),%xmm5
+	pandn	%xmm0,%xmm1
+	psrld	$4,%xmm1
+	pand	%xmm6,%xmm0
+.byte	102,15,56,0,232
+	movdqa	%xmm7,%xmm3
+	pxor	%xmm1,%xmm0
+.byte	102,15,56,0,217
+	movdqa	%xmm7,%xmm4
+	pxor	%xmm5,%xmm3
+.byte	102,15,56,0,224
+	movdqa	%xmm7,%xmm2
+	pxor	%xmm5,%xmm4
+.byte	102,15,56,0,211
+	movdqa	%xmm7,%xmm3
+	pxor	%xmm0,%xmm2
+.byte	102,15,56,0,220
+	movdqu	(%edx),%xmm5
+	pxor	%xmm1,%xmm3
+	jnz	L001enc_loop
+	movdqa	96(%ebp),%xmm4
+	movdqa	112(%ebp),%xmm0
+.byte	102,15,56,0,226
+	pxor	%xmm5,%xmm4
+.byte	102,15,56,0,195
+	movdqa	64(%ebx,%ecx,1),%xmm1
+	pxor	%xmm4,%xmm0
+.byte	102,15,56,0,193
+	ret
+.private_extern	__vpaes_decrypt_core
+.align	4
+__vpaes_decrypt_core:
+	leal	608(%ebp),%ebx
+	movl	240(%edx),%eax
+	movdqa	%xmm6,%xmm1
+	movdqa	-64(%ebx),%xmm2
+	pandn	%xmm0,%xmm1
+	movl	%eax,%ecx
+	psrld	$4,%xmm1
+	movdqu	(%edx),%xmm5
+	shll	$4,%ecx
+	pand	%xmm6,%xmm0
+.byte	102,15,56,0,208
+	movdqa	-48(%ebx),%xmm0
+	xorl	$48,%ecx
+.byte	102,15,56,0,193
+	andl	$48,%ecx
+	pxor	%xmm5,%xmm2
+	movdqa	176(%ebp),%xmm5
+	pxor	%xmm2,%xmm0
+	addl	$16,%edx
+	leal	-352(%ebx,%ecx,1),%ecx
+	jmp	L002dec_entry
+.align	4,0x90
+L003dec_loop:
+	movdqa	-32(%ebx),%xmm4
+	movdqa	-16(%ebx),%xmm1
+.byte	102,15,56,0,226
+.byte	102,15,56,0,203
+	pxor	%xmm4,%xmm0
+	movdqa	(%ebx),%xmm4
+	pxor	%xmm1,%xmm0
+	movdqa	16(%ebx),%xmm1
+.byte	102,15,56,0,226
+.byte	102,15,56,0,197
+.byte	102,15,56,0,203
+	pxor	%xmm4,%xmm0
+	movdqa	32(%ebx),%xmm4
+	pxor	%xmm1,%xmm0
+	movdqa	48(%ebx),%xmm1
+.byte	102,15,56,0,226
+.byte	102,15,56,0,197
+.byte	102,15,56,0,203
+	pxor	%xmm4,%xmm0
+	movdqa	64(%ebx),%xmm4
+	pxor	%xmm1,%xmm0
+	movdqa	80(%ebx),%xmm1
+.byte	102,15,56,0,226
+.byte	102,15,56,0,197
+.byte	102,15,56,0,203
+	pxor	%xmm4,%xmm0
+	addl	$16,%edx
+.byte	102,15,58,15,237,12
+	pxor	%xmm1,%xmm0
+	subl	$1,%eax
+L002dec_entry:
+	movdqa	%xmm6,%xmm1
+	movdqa	-32(%ebp),%xmm2
+	pandn	%xmm0,%xmm1
+	pand	%xmm6,%xmm0
+	psrld	$4,%xmm1
+.byte	102,15,56,0,208
+	movdqa	%xmm7,%xmm3
+	pxor	%xmm1,%xmm0
+.byte	102,15,56,0,217
+	movdqa	%xmm7,%xmm4
+	pxor	%xmm2,%xmm3
+.byte	102,15,56,0,224
+	pxor	%xmm2,%xmm4
+	movdqa	%xmm7,%xmm2
+.byte	102,15,56,0,211
+	movdqa	%xmm7,%xmm3
+	pxor	%xmm0,%xmm2
+.byte	102,15,56,0,220
+	movdqu	(%edx),%xmm0
+	pxor	%xmm1,%xmm3
+	jnz	L003dec_loop
+	movdqa	96(%ebx),%xmm4
+.byte	102,15,56,0,226
+	pxor	%xmm0,%xmm4
+	movdqa	112(%ebx),%xmm0
+	movdqa	(%ecx),%xmm2
+.byte	102,15,56,0,195
+	pxor	%xmm4,%xmm0
+.byte	102,15,56,0,194
+	ret
+.private_extern	__vpaes_schedule_core
+.align	4
+__vpaes_schedule_core:
+	addl	(%esp),%ebp
+	movdqu	(%esi),%xmm0
+	movdqa	320(%ebp),%xmm2
+	movdqa	%xmm0,%xmm3
+	leal	(%ebp),%ebx
+	movdqa	%xmm2,4(%esp)
+	call	__vpaes_schedule_transform
+	movdqa	%xmm0,%xmm7
+	testl	%edi,%edi
+	jnz	L004schedule_am_decrypting
+	movdqu	%xmm0,(%edx)
+	jmp	L005schedule_go
+L004schedule_am_decrypting:
+	movdqa	256(%ebp,%ecx,1),%xmm1
+.byte	102,15,56,0,217
+	movdqu	%xmm3,(%edx)
+	xorl	$48,%ecx
+L005schedule_go:
+	cmpl	$192,%eax
+	ja	L006schedule_256
+	je	L007schedule_192
+L008schedule_128:
+	movl	$10,%eax
+L009loop_schedule_128:
+	call	__vpaes_schedule_round
+	decl	%eax
+	jz	L010schedule_mangle_last
+	call	__vpaes_schedule_mangle
+	jmp	L009loop_schedule_128
+.align	4,0x90
+L007schedule_192:
+	movdqu	8(%esi),%xmm0
+	call	__vpaes_schedule_transform
+	movdqa	%xmm0,%xmm6
+	pxor	%xmm4,%xmm4
+	movhlps	%xmm4,%xmm6
+	movl	$4,%eax
+L011loop_schedule_192:
+	call	__vpaes_schedule_round
+.byte	102,15,58,15,198,8
+	call	__vpaes_schedule_mangle
+	call	__vpaes_schedule_192_smear
+	call	__vpaes_schedule_mangle
+	call	__vpaes_schedule_round
+	decl	%eax
+	jz	L010schedule_mangle_last
+	call	__vpaes_schedule_mangle
+	call	__vpaes_schedule_192_smear
+	jmp	L011loop_schedule_192
+.align	4,0x90
+L006schedule_256:
+	movdqu	16(%esi),%xmm0
+	call	__vpaes_schedule_transform
+	movl	$7,%eax
+L012loop_schedule_256:
+	call	__vpaes_schedule_mangle
+	movdqa	%xmm0,%xmm6
+	call	__vpaes_schedule_round
+	decl	%eax
+	jz	L010schedule_mangle_last
+	call	__vpaes_schedule_mangle
+	pshufd	$255,%xmm0,%xmm0
+	movdqa	%xmm7,20(%esp)
+	movdqa	%xmm6,%xmm7
+	call	L_vpaes_schedule_low_round
+	movdqa	20(%esp),%xmm7
+	jmp	L012loop_schedule_256
+.align	4,0x90
+L010schedule_mangle_last:
+	leal	384(%ebp),%ebx
+	testl	%edi,%edi
+	jnz	L013schedule_mangle_last_dec
+	movdqa	256(%ebp,%ecx,1),%xmm1
+.byte	102,15,56,0,193
+	leal	352(%ebp),%ebx
+	addl	$32,%edx
+L013schedule_mangle_last_dec:
+	addl	$-16,%edx
+	pxor	336(%ebp),%xmm0
+	call	__vpaes_schedule_transform
+	movdqu	%xmm0,(%edx)
+	pxor	%xmm0,%xmm0
+	pxor	%xmm1,%xmm1
+	pxor	%xmm2,%xmm2
+	pxor	%xmm3,%xmm3
+	pxor	%xmm4,%xmm4
+	pxor	%xmm5,%xmm5
+	pxor	%xmm6,%xmm6
+	pxor	%xmm7,%xmm7
+	ret
+.private_extern	__vpaes_schedule_192_smear
+.align	4
+__vpaes_schedule_192_smear:
+	pshufd	$128,%xmm6,%xmm1
+	pshufd	$254,%xmm7,%xmm0
+	pxor	%xmm1,%xmm6
+	pxor	%xmm1,%xmm1
+	pxor	%xmm0,%xmm6
+	movdqa	%xmm6,%xmm0
+	movhlps	%xmm1,%xmm6
+	ret
+.private_extern	__vpaes_schedule_round
+.align	4
+__vpaes_schedule_round:
+	movdqa	8(%esp),%xmm2
+	pxor	%xmm1,%xmm1
+.byte	102,15,58,15,202,15
+.byte	102,15,58,15,210,15
+	pxor	%xmm1,%xmm7
+	pshufd	$255,%xmm0,%xmm0
+.byte	102,15,58,15,192,1
+	movdqa	%xmm2,8(%esp)
+L_vpaes_schedule_low_round:
+	movdqa	%xmm7,%xmm1
+	pslldq	$4,%xmm7
+	pxor	%xmm1,%xmm7
+	movdqa	%xmm7,%xmm1
+	pslldq	$8,%xmm7
+	pxor	%xmm1,%xmm7
+	pxor	336(%ebp),%xmm7
+	movdqa	-16(%ebp),%xmm4
+	movdqa	-48(%ebp),%xmm5
+	movdqa	%xmm4,%xmm1
+	pandn	%xmm0,%xmm1
+	psrld	$4,%xmm1
+	pand	%xmm4,%xmm0
+	movdqa	-32(%ebp),%xmm2
+.byte	102,15,56,0,208
+	pxor	%xmm1,%xmm0
+	movdqa	%xmm5,%xmm3
+.byte	102,15,56,0,217
+	pxor	%xmm2,%xmm3
+	movdqa	%xmm5,%xmm4
+.byte	102,15,56,0,224
+	pxor	%xmm2,%xmm4
+	movdqa	%xmm5,%xmm2
+.byte	102,15,56,0,211
+	pxor	%xmm0,%xmm2
+	movdqa	%xmm5,%xmm3
+.byte	102,15,56,0,220
+	pxor	%xmm1,%xmm3
+	movdqa	32(%ebp),%xmm4
+.byte	102,15,56,0,226
+	movdqa	48(%ebp),%xmm0
+.byte	102,15,56,0,195
+	pxor	%xmm4,%xmm0
+	pxor	%xmm7,%xmm0
+	movdqa	%xmm0,%xmm7
+	ret
+.private_extern	__vpaes_schedule_transform
+.align	4
+__vpaes_schedule_transform:
+	movdqa	-16(%ebp),%xmm2
+	movdqa	%xmm2,%xmm1
+	pandn	%xmm0,%xmm1
+	psrld	$4,%xmm1
+	pand	%xmm2,%xmm0
+	movdqa	(%ebx),%xmm2
+.byte	102,15,56,0,208
+	movdqa	16(%ebx),%xmm0
+.byte	102,15,56,0,193
+	pxor	%xmm2,%xmm0
+	ret
+.private_extern	__vpaes_schedule_mangle
+.align	4
+__vpaes_schedule_mangle:
+	movdqa	%xmm0,%xmm4
+	movdqa	128(%ebp),%xmm5
+	testl	%edi,%edi
+	jnz	L014schedule_mangle_dec
+	addl	$16,%edx
+	pxor	336(%ebp),%xmm4
+.byte	102,15,56,0,229
+	movdqa	%xmm4,%xmm3
+.byte	102,15,56,0,229
+	pxor	%xmm4,%xmm3
+.byte	102,15,56,0,229
+	pxor	%xmm4,%xmm3
+	jmp	L015schedule_mangle_both
+.align	4,0x90
+L014schedule_mangle_dec:
+	movdqa	-16(%ebp),%xmm2
+	leal	416(%ebp),%esi
+	movdqa	%xmm2,%xmm1
+	pandn	%xmm4,%xmm1
+	psrld	$4,%xmm1
+	pand	%xmm2,%xmm4
+	movdqa	(%esi),%xmm2
+.byte	102,15,56,0,212
+	movdqa	16(%esi),%xmm3
+.byte	102,15,56,0,217
+	pxor	%xmm2,%xmm3
+.byte	102,15,56,0,221
+	movdqa	32(%esi),%xmm2
+.byte	102,15,56,0,212
+	pxor	%xmm3,%xmm2
+	movdqa	48(%esi),%xmm3
+.byte	102,15,56,0,217
+	pxor	%xmm2,%xmm3
+.byte	102,15,56,0,221
+	movdqa	64(%esi),%xmm2
+.byte	102,15,56,0,212
+	pxor	%xmm3,%xmm2
+	movdqa	80(%esi),%xmm3
+.byte	102,15,56,0,217
+	pxor	%xmm2,%xmm3
+.byte	102,15,56,0,221
+	movdqa	96(%esi),%xmm2
+.byte	102,15,56,0,212
+	pxor	%xmm3,%xmm2
+	movdqa	112(%esi),%xmm3
+.byte	102,15,56,0,217
+	pxor	%xmm2,%xmm3
+	addl	$-16,%edx
+L015schedule_mangle_both:
+	movdqa	256(%ebp,%ecx,1),%xmm1
+.byte	102,15,56,0,217
+	addl	$-16,%ecx
+	andl	$48,%ecx
+	movdqu	%xmm3,(%edx)
+	ret
+.globl	_vpaes_set_encrypt_key
+.private_extern	_vpaes_set_encrypt_key
+.align	4
+_vpaes_set_encrypt_key:
+L_vpaes_set_encrypt_key_begin:
+	pushl	%ebp
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+	movl	20(%esp),%esi
+	leal	-56(%esp),%ebx
+	movl	24(%esp),%eax
+	andl	$-16,%ebx
+	movl	28(%esp),%edx
+	xchgl	%esp,%ebx
+	movl	%ebx,48(%esp)
+	movl	%eax,%ebx
+	shrl	$5,%ebx
+	addl	$5,%ebx
+	movl	%ebx,240(%edx)
+	movl	$48,%ecx
+	movl	$0,%edi
+	leal	L_vpaes_consts+0x30-L016pic_point,%ebp
+	call	__vpaes_schedule_core
+L016pic_point:
+	movl	48(%esp),%esp
+	xorl	%eax,%eax
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.globl	_vpaes_set_decrypt_key
+.private_extern	_vpaes_set_decrypt_key
+.align	4
+_vpaes_set_decrypt_key:
+L_vpaes_set_decrypt_key_begin:
+	pushl	%ebp
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+	movl	20(%esp),%esi
+	leal	-56(%esp),%ebx
+	movl	24(%esp),%eax
+	andl	$-16,%ebx
+	movl	28(%esp),%edx
+	xchgl	%esp,%ebx
+	movl	%ebx,48(%esp)
+	movl	%eax,%ebx
+	shrl	$5,%ebx
+	addl	$5,%ebx
+	movl	%ebx,240(%edx)
+	shll	$4,%ebx
+	leal	16(%edx,%ebx,1),%edx
+	movl	$1,%edi
+	movl	%eax,%ecx
+	shrl	$1,%ecx
+	andl	$32,%ecx
+	xorl	$32,%ecx
+	leal	L_vpaes_consts+0x30-L017pic_point,%ebp
+	call	__vpaes_schedule_core
+L017pic_point:
+	movl	48(%esp),%esp
+	xorl	%eax,%eax
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.globl	_vpaes_encrypt
+.private_extern	_vpaes_encrypt
+.align	4
+_vpaes_encrypt:
+L_vpaes_encrypt_begin:
+	pushl	%ebp
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+	leal	L_vpaes_consts+0x30-L018pic_point,%ebp
+	call	__vpaes_preheat
+L018pic_point:
+	movl	20(%esp),%esi
+	leal	-56(%esp),%ebx
+	movl	24(%esp),%edi
+	andl	$-16,%ebx
+	movl	28(%esp),%edx
+	xchgl	%esp,%ebx
+	movl	%ebx,48(%esp)
+	movdqu	(%esi),%xmm0
+	call	__vpaes_encrypt_core
+	movdqu	%xmm0,(%edi)
+	movl	48(%esp),%esp
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.globl	_vpaes_decrypt
+.private_extern	_vpaes_decrypt
+.align	4
+_vpaes_decrypt:
+L_vpaes_decrypt_begin:
+	pushl	%ebp
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+	leal	L_vpaes_consts+0x30-L019pic_point,%ebp
+	call	__vpaes_preheat
+L019pic_point:
+	movl	20(%esp),%esi
+	leal	-56(%esp),%ebx
+	movl	24(%esp),%edi
+	andl	$-16,%ebx
+	movl	28(%esp),%edx
+	xchgl	%esp,%ebx
+	movl	%ebx,48(%esp)
+	movdqu	(%esi),%xmm0
+	call	__vpaes_decrypt_core
+	movdqu	%xmm0,(%edi)
+	movl	48(%esp),%esp
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.globl	_vpaes_cbc_encrypt
+.private_extern	_vpaes_cbc_encrypt
+.align	4
+_vpaes_cbc_encrypt:
+L_vpaes_cbc_encrypt_begin:
+	pushl	%ebp
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+	movl	20(%esp),%esi
+	movl	24(%esp),%edi
+	movl	28(%esp),%eax
+	movl	32(%esp),%edx
+	subl	$16,%eax
+	jc	L020cbc_abort
+	leal	-56(%esp),%ebx
+	movl	36(%esp),%ebp
+	andl	$-16,%ebx
+	movl	40(%esp),%ecx
+	xchgl	%esp,%ebx
+	movdqu	(%ebp),%xmm1
+	subl	%esi,%edi
+	movl	%ebx,48(%esp)
+	movl	%edi,(%esp)
+	movl	%edx,4(%esp)
+	movl	%ebp,8(%esp)
+	movl	%eax,%edi
+	leal	L_vpaes_consts+0x30-L021pic_point,%ebp
+	call	__vpaes_preheat
+L021pic_point:
+	cmpl	$0,%ecx
+	je	L022cbc_dec_loop
+	jmp	L023cbc_enc_loop
+.align	4,0x90
+L023cbc_enc_loop:
+	movdqu	(%esi),%xmm0
+	pxor	%xmm1,%xmm0
+	call	__vpaes_encrypt_core
+	movl	(%esp),%ebx
+	movl	4(%esp),%edx
+	movdqa	%xmm0,%xmm1
+	movdqu	%xmm0,(%ebx,%esi,1)
+	leal	16(%esi),%esi
+	subl	$16,%edi
+	jnc	L023cbc_enc_loop
+	jmp	L024cbc_done
+.align	4,0x90
+L022cbc_dec_loop:
+	movdqu	(%esi),%xmm0
+	movdqa	%xmm1,16(%esp)
+	movdqa	%xmm0,32(%esp)
+	call	__vpaes_decrypt_core
+	movl	(%esp),%ebx
+	movl	4(%esp),%edx
+	pxor	16(%esp),%xmm0
+	movdqa	32(%esp),%xmm1
+	movdqu	%xmm0,(%ebx,%esi,1)
+	leal	16(%esi),%esi
+	subl	$16,%edi
+	jnc	L022cbc_dec_loop
+L024cbc_done:
+	movl	8(%esp),%ebx
+	movl	48(%esp),%esp
+	movdqu	%xmm1,(%ebx)
+L020cbc_abort:
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+#endif
diff --git a/third_party/boringssl/mac-x86/crypto/bn/bn-586.S b/third_party/boringssl/mac-x86/crypto/bn/bn-586.S
new file mode 100644
index 0000000..0f0a94e
--- /dev/null
+++ b/third_party/boringssl/mac-x86/crypto/bn/bn-586.S
@@ -0,0 +1,1528 @@
+#if defined(__i386__)
+.file	"src/crypto/bn/asm/bn-586.S"
+.text
+.globl	_bn_mul_add_words
+.private_extern	_bn_mul_add_words
+.align	4
+_bn_mul_add_words:
+L_bn_mul_add_words_begin:
+	call	L000PIC_me_up
+L000PIC_me_up:
+	popl	%eax
+	movl	L_OPENSSL_ia32cap_P$non_lazy_ptr-L000PIC_me_up(%eax),%eax
+	btl	$26,(%eax)
+	jnc	L001maw_non_sse2
+	movl	4(%esp),%eax
+	movl	8(%esp),%edx
+	movl	12(%esp),%ecx
+	movd	16(%esp),%mm0
+	pxor	%mm1,%mm1
+	jmp	L002maw_sse2_entry
+.align	4,0x90
+L003maw_sse2_unrolled:
+	movd	(%eax),%mm3
+	paddq	%mm3,%mm1
+	movd	(%edx),%mm2
+	pmuludq	%mm0,%mm2
+	movd	4(%edx),%mm4
+	pmuludq	%mm0,%mm4
+	movd	8(%edx),%mm6
+	pmuludq	%mm0,%mm6
+	movd	12(%edx),%mm7
+	pmuludq	%mm0,%mm7
+	paddq	%mm2,%mm1
+	movd	4(%eax),%mm3
+	paddq	%mm4,%mm3
+	movd	8(%eax),%mm5
+	paddq	%mm6,%mm5
+	movd	12(%eax),%mm4
+	paddq	%mm4,%mm7
+	movd	%mm1,(%eax)
+	movd	16(%edx),%mm2
+	pmuludq	%mm0,%mm2
+	psrlq	$32,%mm1
+	movd	20(%edx),%mm4
+	pmuludq	%mm0,%mm4
+	paddq	%mm3,%mm1
+	movd	24(%edx),%mm6
+	pmuludq	%mm0,%mm6
+	movd	%mm1,4(%eax)
+	psrlq	$32,%mm1
+	movd	28(%edx),%mm3
+	addl	$32,%edx
+	pmuludq	%mm0,%mm3
+	paddq	%mm5,%mm1
+	movd	16(%eax),%mm5
+	paddq	%mm5,%mm2
+	movd	%mm1,8(%eax)
+	psrlq	$32,%mm1
+	paddq	%mm7,%mm1
+	movd	20(%eax),%mm5
+	paddq	%mm5,%mm4
+	movd	%mm1,12(%eax)
+	psrlq	$32,%mm1
+	paddq	%mm2,%mm1
+	movd	24(%eax),%mm5
+	paddq	%mm5,%mm6
+	movd	%mm1,16(%eax)
+	psrlq	$32,%mm1
+	paddq	%mm4,%mm1
+	movd	28(%eax),%mm5
+	paddq	%mm5,%mm3
+	movd	%mm1,20(%eax)
+	psrlq	$32,%mm1
+	paddq	%mm6,%mm1
+	movd	%mm1,24(%eax)
+	psrlq	$32,%mm1
+	paddq	%mm3,%mm1
+	movd	%mm1,28(%eax)
+	leal	32(%eax),%eax
+	psrlq	$32,%mm1
+	subl	$8,%ecx
+	jz	L004maw_sse2_exit
+L002maw_sse2_entry:
+	testl	$4294967288,%ecx
+	jnz	L003maw_sse2_unrolled
+.align	2,0x90
+L005maw_sse2_loop:
+	movd	(%edx),%mm2
+	movd	(%eax),%mm3
+	pmuludq	%mm0,%mm2
+	leal	4(%edx),%edx
+	paddq	%mm3,%mm1
+	paddq	%mm2,%mm1
+	movd	%mm1,(%eax)
+	subl	$1,%ecx
+	psrlq	$32,%mm1
+	leal	4(%eax),%eax
+	jnz	L005maw_sse2_loop
+L004maw_sse2_exit:
+	movd	%mm1,%eax
+	emms
+	ret
+.align	4,0x90
+L001maw_non_sse2:
+	pushl	%ebp
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+
+	xorl	%esi,%esi
+	movl	20(%esp),%edi
+	movl	28(%esp),%ecx
+	movl	24(%esp),%ebx
+	andl	$4294967288,%ecx
+	movl	32(%esp),%ebp
+	pushl	%ecx
+	jz	L006maw_finish
+.align	4,0x90
+L007maw_loop:
+	# Round 0 
+	movl	(%ebx),%eax
+	mull	%ebp
+	addl	%esi,%eax
+	adcl	$0,%edx
+	addl	(%edi),%eax
+	adcl	$0,%edx
+	movl	%eax,(%edi)
+	movl	%edx,%esi
+	# Round 4 
+	movl	4(%ebx),%eax
+	mull	%ebp
+	addl	%esi,%eax
+	adcl	$0,%edx
+	addl	4(%edi),%eax
+	adcl	$0,%edx
+	movl	%eax,4(%edi)
+	movl	%edx,%esi
+	# Round 8 
+	movl	8(%ebx),%eax
+	mull	%ebp
+	addl	%esi,%eax
+	adcl	$0,%edx
+	addl	8(%edi),%eax
+	adcl	$0,%edx
+	movl	%eax,8(%edi)
+	movl	%edx,%esi
+	# Round 12 
+	movl	12(%ebx),%eax
+	mull	%ebp
+	addl	%esi,%eax
+	adcl	$0,%edx
+	addl	12(%edi),%eax
+	adcl	$0,%edx
+	movl	%eax,12(%edi)
+	movl	%edx,%esi
+	# Round 16 
+	movl	16(%ebx),%eax
+	mull	%ebp
+	addl	%esi,%eax
+	adcl	$0,%edx
+	addl	16(%edi),%eax
+	adcl	$0,%edx
+	movl	%eax,16(%edi)
+	movl	%edx,%esi
+	# Round 20 
+	movl	20(%ebx),%eax
+	mull	%ebp
+	addl	%esi,%eax
+	adcl	$0,%edx
+	addl	20(%edi),%eax
+	adcl	$0,%edx
+	movl	%eax,20(%edi)
+	movl	%edx,%esi
+	# Round 24 
+	movl	24(%ebx),%eax
+	mull	%ebp
+	addl	%esi,%eax
+	adcl	$0,%edx
+	addl	24(%edi),%eax
+	adcl	$0,%edx
+	movl	%eax,24(%edi)
+	movl	%edx,%esi
+	# Round 28 
+	movl	28(%ebx),%eax
+	mull	%ebp
+	addl	%esi,%eax
+	adcl	$0,%edx
+	addl	28(%edi),%eax
+	adcl	$0,%edx
+	movl	%eax,28(%edi)
+	movl	%edx,%esi
+
+	subl	$8,%ecx
+	leal	32(%ebx),%ebx
+	leal	32(%edi),%edi
+	jnz	L007maw_loop
+L006maw_finish:
+	movl	32(%esp),%ecx
+	andl	$7,%ecx
+	jnz	L008maw_finish2
+	jmp	L009maw_end
+L008maw_finish2:
+	# Tail Round 0 
+	movl	(%ebx),%eax
+	mull	%ebp
+	addl	%esi,%eax
+	adcl	$0,%edx
+	addl	(%edi),%eax
+	adcl	$0,%edx
+	decl	%ecx
+	movl	%eax,(%edi)
+	movl	%edx,%esi
+	jz	L009maw_end
+	# Tail Round 1 
+	movl	4(%ebx),%eax
+	mull	%ebp
+	addl	%esi,%eax
+	adcl	$0,%edx
+	addl	4(%edi),%eax
+	adcl	$0,%edx
+	decl	%ecx
+	movl	%eax,4(%edi)
+	movl	%edx,%esi
+	jz	L009maw_end
+	# Tail Round 2 
+	movl	8(%ebx),%eax
+	mull	%ebp
+	addl	%esi,%eax
+	adcl	$0,%edx
+	addl	8(%edi),%eax
+	adcl	$0,%edx
+	decl	%ecx
+	movl	%eax,8(%edi)
+	movl	%edx,%esi
+	jz	L009maw_end
+	# Tail Round 3 
+	movl	12(%ebx),%eax
+	mull	%ebp
+	addl	%esi,%eax
+	adcl	$0,%edx
+	addl	12(%edi),%eax
+	adcl	$0,%edx
+	decl	%ecx
+	movl	%eax,12(%edi)
+	movl	%edx,%esi
+	jz	L009maw_end
+	# Tail Round 4 
+	movl	16(%ebx),%eax
+	mull	%ebp
+	addl	%esi,%eax
+	adcl	$0,%edx
+	addl	16(%edi),%eax
+	adcl	$0,%edx
+	decl	%ecx
+	movl	%eax,16(%edi)
+	movl	%edx,%esi
+	jz	L009maw_end
+	# Tail Round 5 
+	movl	20(%ebx),%eax
+	mull	%ebp
+	addl	%esi,%eax
+	adcl	$0,%edx
+	addl	20(%edi),%eax
+	adcl	$0,%edx
+	decl	%ecx
+	movl	%eax,20(%edi)
+	movl	%edx,%esi
+	jz	L009maw_end
+	# Tail Round 6 
+	movl	24(%ebx),%eax
+	mull	%ebp
+	addl	%esi,%eax
+	adcl	$0,%edx
+	addl	24(%edi),%eax
+	adcl	$0,%edx
+	movl	%eax,24(%edi)
+	movl	%edx,%esi
+L009maw_end:
+	movl	%esi,%eax
+	popl	%ecx
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.globl	_bn_mul_words
+.private_extern	_bn_mul_words
+.align	4
+_bn_mul_words:
+L_bn_mul_words_begin:
+	call	L010PIC_me_up
+L010PIC_me_up:
+	popl	%eax
+	movl	L_OPENSSL_ia32cap_P$non_lazy_ptr-L010PIC_me_up(%eax),%eax
+	btl	$26,(%eax)
+	jnc	L011mw_non_sse2
+	movl	4(%esp),%eax
+	movl	8(%esp),%edx
+	movl	12(%esp),%ecx
+	movd	16(%esp),%mm0
+	pxor	%mm1,%mm1
+.align	4,0x90
+L012mw_sse2_loop:
+	movd	(%edx),%mm2
+	pmuludq	%mm0,%mm2
+	leal	4(%edx),%edx
+	paddq	%mm2,%mm1
+	movd	%mm1,(%eax)
+	subl	$1,%ecx
+	psrlq	$32,%mm1
+	leal	4(%eax),%eax
+	jnz	L012mw_sse2_loop
+	movd	%mm1,%eax
+	emms
+	ret
+.align	4,0x90
+L011mw_non_sse2:
+	pushl	%ebp
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+
+	xorl	%esi,%esi
+	movl	20(%esp),%edi
+	movl	24(%esp),%ebx
+	movl	28(%esp),%ebp
+	movl	32(%esp),%ecx
+	andl	$4294967288,%ebp
+	jz	L013mw_finish
+L014mw_loop:
+	# Round 0 
+	movl	(%ebx),%eax
+	mull	%ecx
+	addl	%esi,%eax
+	adcl	$0,%edx
+	movl	%eax,(%edi)
+	movl	%edx,%esi
+	# Round 4 
+	movl	4(%ebx),%eax
+	mull	%ecx
+	addl	%esi,%eax
+	adcl	$0,%edx
+	movl	%eax,4(%edi)
+	movl	%edx,%esi
+	# Round 8 
+	movl	8(%ebx),%eax
+	mull	%ecx
+	addl	%esi,%eax
+	adcl	$0,%edx
+	movl	%eax,8(%edi)
+	movl	%edx,%esi
+	# Round 12 
+	movl	12(%ebx),%eax
+	mull	%ecx
+	addl	%esi,%eax
+	adcl	$0,%edx
+	movl	%eax,12(%edi)
+	movl	%edx,%esi
+	# Round 16 
+	movl	16(%ebx),%eax
+	mull	%ecx
+	addl	%esi,%eax
+	adcl	$0,%edx
+	movl	%eax,16(%edi)
+	movl	%edx,%esi
+	# Round 20 
+	movl	20(%ebx),%eax
+	mull	%ecx
+	addl	%esi,%eax
+	adcl	$0,%edx
+	movl	%eax,20(%edi)
+	movl	%edx,%esi
+	# Round 24 
+	movl	24(%ebx),%eax
+	mull	%ecx
+	addl	%esi,%eax
+	adcl	$0,%edx
+	movl	%eax,24(%edi)
+	movl	%edx,%esi
+	# Round 28 
+	movl	28(%ebx),%eax
+	mull	%ecx
+	addl	%esi,%eax
+	adcl	$0,%edx
+	movl	%eax,28(%edi)
+	movl	%edx,%esi
+
+	addl	$32,%ebx
+	addl	$32,%edi
+	subl	$8,%ebp
+	jz	L013mw_finish
+	jmp	L014mw_loop
+L013mw_finish:
+	movl	28(%esp),%ebp
+	andl	$7,%ebp
+	jnz	L015mw_finish2
+	jmp	L016mw_end
+L015mw_finish2:
+	# Tail Round 0 
+	movl	(%ebx),%eax
+	mull	%ecx
+	addl	%esi,%eax
+	adcl	$0,%edx
+	movl	%eax,(%edi)
+	movl	%edx,%esi
+	decl	%ebp
+	jz	L016mw_end
+	# Tail Round 1 
+	movl	4(%ebx),%eax
+	mull	%ecx
+	addl	%esi,%eax
+	adcl	$0,%edx
+	movl	%eax,4(%edi)
+	movl	%edx,%esi
+	decl	%ebp
+	jz	L016mw_end
+	# Tail Round 2 
+	movl	8(%ebx),%eax
+	mull	%ecx
+	addl	%esi,%eax
+	adcl	$0,%edx
+	movl	%eax,8(%edi)
+	movl	%edx,%esi
+	decl	%ebp
+	jz	L016mw_end
+	# Tail Round 3 
+	movl	12(%ebx),%eax
+	mull	%ecx
+	addl	%esi,%eax
+	adcl	$0,%edx
+	movl	%eax,12(%edi)
+	movl	%edx,%esi
+	decl	%ebp
+	jz	L016mw_end
+	# Tail Round 4 
+	movl	16(%ebx),%eax
+	mull	%ecx
+	addl	%esi,%eax
+	adcl	$0,%edx
+	movl	%eax,16(%edi)
+	movl	%edx,%esi
+	decl	%ebp
+	jz	L016mw_end
+	# Tail Round 5 
+	movl	20(%ebx),%eax
+	mull	%ecx
+	addl	%esi,%eax
+	adcl	$0,%edx
+	movl	%eax,20(%edi)
+	movl	%edx,%esi
+	decl	%ebp
+	jz	L016mw_end
+	# Tail Round 6 
+	movl	24(%ebx),%eax
+	mull	%ecx
+	addl	%esi,%eax
+	adcl	$0,%edx
+	movl	%eax,24(%edi)
+	movl	%edx,%esi
+L016mw_end:
+	movl	%esi,%eax
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.globl	_bn_sqr_words
+.private_extern	_bn_sqr_words
+.align	4
+_bn_sqr_words:
+L_bn_sqr_words_begin:
+	call	L017PIC_me_up
+L017PIC_me_up:
+	popl	%eax
+	movl	L_OPENSSL_ia32cap_P$non_lazy_ptr-L017PIC_me_up(%eax),%eax
+	btl	$26,(%eax)
+	jnc	L018sqr_non_sse2
+	movl	4(%esp),%eax
+	movl	8(%esp),%edx
+	movl	12(%esp),%ecx
+.align	4,0x90
+L019sqr_sse2_loop:
+	movd	(%edx),%mm0
+	pmuludq	%mm0,%mm0
+	leal	4(%edx),%edx
+	movq	%mm0,(%eax)
+	subl	$1,%ecx
+	leal	8(%eax),%eax
+	jnz	L019sqr_sse2_loop
+	emms
+	ret
+.align	4,0x90
+L018sqr_non_sse2:
+	pushl	%ebp
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+
+	movl	20(%esp),%esi
+	movl	24(%esp),%edi
+	movl	28(%esp),%ebx
+	andl	$4294967288,%ebx
+	jz	L020sw_finish
+L021sw_loop:
+	# Round 0 
+	movl	(%edi),%eax
+	mull	%eax
+	movl	%eax,(%esi)
+	movl	%edx,4(%esi)
+	# Round 4 
+	movl	4(%edi),%eax
+	mull	%eax
+	movl	%eax,8(%esi)
+	movl	%edx,12(%esi)
+	# Round 8 
+	movl	8(%edi),%eax
+	mull	%eax
+	movl	%eax,16(%esi)
+	movl	%edx,20(%esi)
+	# Round 12 
+	movl	12(%edi),%eax
+	mull	%eax
+	movl	%eax,24(%esi)
+	movl	%edx,28(%esi)
+	# Round 16 
+	movl	16(%edi),%eax
+	mull	%eax
+	movl	%eax,32(%esi)
+	movl	%edx,36(%esi)
+	# Round 20 
+	movl	20(%edi),%eax
+	mull	%eax
+	movl	%eax,40(%esi)
+	movl	%edx,44(%esi)
+	# Round 24 
+	movl	24(%edi),%eax
+	mull	%eax
+	movl	%eax,48(%esi)
+	movl	%edx,52(%esi)
+	# Round 28 
+	movl	28(%edi),%eax
+	mull	%eax
+	movl	%eax,56(%esi)
+	movl	%edx,60(%esi)
+
+	addl	$32,%edi
+	addl	$64,%esi
+	subl	$8,%ebx
+	jnz	L021sw_loop
+L020sw_finish:
+	movl	28(%esp),%ebx
+	andl	$7,%ebx
+	jz	L022sw_end
+	# Tail Round 0 
+	movl	(%edi),%eax
+	mull	%eax
+	movl	%eax,(%esi)
+	decl	%ebx
+	movl	%edx,4(%esi)
+	jz	L022sw_end
+	# Tail Round 1 
+	movl	4(%edi),%eax
+	mull	%eax
+	movl	%eax,8(%esi)
+	decl	%ebx
+	movl	%edx,12(%esi)
+	jz	L022sw_end
+	# Tail Round 2 
+	movl	8(%edi),%eax
+	mull	%eax
+	movl	%eax,16(%esi)
+	decl	%ebx
+	movl	%edx,20(%esi)
+	jz	L022sw_end
+	# Tail Round 3 
+	movl	12(%edi),%eax
+	mull	%eax
+	movl	%eax,24(%esi)
+	decl	%ebx
+	movl	%edx,28(%esi)
+	jz	L022sw_end
+	# Tail Round 4 
+	movl	16(%edi),%eax
+	mull	%eax
+	movl	%eax,32(%esi)
+	decl	%ebx
+	movl	%edx,36(%esi)
+	jz	L022sw_end
+	# Tail Round 5 
+	movl	20(%edi),%eax
+	mull	%eax
+	movl	%eax,40(%esi)
+	decl	%ebx
+	movl	%edx,44(%esi)
+	jz	L022sw_end
+	# Tail Round 6 
+	movl	24(%edi),%eax
+	mull	%eax
+	movl	%eax,48(%esi)
+	movl	%edx,52(%esi)
+L022sw_end:
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.globl	_bn_div_words
+.private_extern	_bn_div_words
+.align	4
+_bn_div_words:
+L_bn_div_words_begin:
+	movl	4(%esp),%edx
+	movl	8(%esp),%eax
+	movl	12(%esp),%ecx
+	divl	%ecx
+	ret
+.globl	_bn_add_words
+.private_extern	_bn_add_words
+.align	4
+_bn_add_words:
+L_bn_add_words_begin:
+	pushl	%ebp
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+
+	movl	20(%esp),%ebx
+	movl	24(%esp),%esi
+	movl	28(%esp),%edi
+	movl	32(%esp),%ebp
+	xorl	%eax,%eax
+	andl	$4294967288,%ebp
+	jz	L023aw_finish
+L024aw_loop:
+	# Round 0 
+	movl	(%esi),%ecx
+	movl	(%edi),%edx
+	addl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	addl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,(%ebx)
+	# Round 1 
+	movl	4(%esi),%ecx
+	movl	4(%edi),%edx
+	addl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	addl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,4(%ebx)
+	# Round 2 
+	movl	8(%esi),%ecx
+	movl	8(%edi),%edx
+	addl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	addl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,8(%ebx)
+	# Round 3 
+	movl	12(%esi),%ecx
+	movl	12(%edi),%edx
+	addl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	addl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,12(%ebx)
+	# Round 4 
+	movl	16(%esi),%ecx
+	movl	16(%edi),%edx
+	addl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	addl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,16(%ebx)
+	# Round 5 
+	movl	20(%esi),%ecx
+	movl	20(%edi),%edx
+	addl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	addl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,20(%ebx)
+	# Round 6 
+	movl	24(%esi),%ecx
+	movl	24(%edi),%edx
+	addl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	addl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,24(%ebx)
+	# Round 7 
+	movl	28(%esi),%ecx
+	movl	28(%edi),%edx
+	addl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	addl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,28(%ebx)
+
+	addl	$32,%esi
+	addl	$32,%edi
+	addl	$32,%ebx
+	subl	$8,%ebp
+	jnz	L024aw_loop
+L023aw_finish:
+	movl	32(%esp),%ebp
+	andl	$7,%ebp
+	jz	L025aw_end
+	# Tail Round 0 
+	movl	(%esi),%ecx
+	movl	(%edi),%edx
+	addl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	addl	%edx,%ecx
+	adcl	$0,%eax
+	decl	%ebp
+	movl	%ecx,(%ebx)
+	jz	L025aw_end
+	# Tail Round 1 
+	movl	4(%esi),%ecx
+	movl	4(%edi),%edx
+	addl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	addl	%edx,%ecx
+	adcl	$0,%eax
+	decl	%ebp
+	movl	%ecx,4(%ebx)
+	jz	L025aw_end
+	# Tail Round 2 
+	movl	8(%esi),%ecx
+	movl	8(%edi),%edx
+	addl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	addl	%edx,%ecx
+	adcl	$0,%eax
+	decl	%ebp
+	movl	%ecx,8(%ebx)
+	jz	L025aw_end
+	# Tail Round 3 
+	movl	12(%esi),%ecx
+	movl	12(%edi),%edx
+	addl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	addl	%edx,%ecx
+	adcl	$0,%eax
+	decl	%ebp
+	movl	%ecx,12(%ebx)
+	jz	L025aw_end
+	# Tail Round 4 
+	movl	16(%esi),%ecx
+	movl	16(%edi),%edx
+	addl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	addl	%edx,%ecx
+	adcl	$0,%eax
+	decl	%ebp
+	movl	%ecx,16(%ebx)
+	jz	L025aw_end
+	# Tail Round 5 
+	movl	20(%esi),%ecx
+	movl	20(%edi),%edx
+	addl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	addl	%edx,%ecx
+	adcl	$0,%eax
+	decl	%ebp
+	movl	%ecx,20(%ebx)
+	jz	L025aw_end
+	# Tail Round 6 
+	movl	24(%esi),%ecx
+	movl	24(%edi),%edx
+	addl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	addl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,24(%ebx)
+L025aw_end:
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.globl	_bn_sub_words
+.private_extern	_bn_sub_words
+.align	4
+_bn_sub_words:
+L_bn_sub_words_begin:
+	pushl	%ebp
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+
+	movl	20(%esp),%ebx
+	movl	24(%esp),%esi
+	movl	28(%esp),%edi
+	movl	32(%esp),%ebp
+	xorl	%eax,%eax
+	andl	$4294967288,%ebp
+	jz	L026aw_finish
+L027aw_loop:
+	# Round 0 
+	movl	(%esi),%ecx
+	movl	(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,(%ebx)
+	# Round 1 
+	movl	4(%esi),%ecx
+	movl	4(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,4(%ebx)
+	# Round 2 
+	movl	8(%esi),%ecx
+	movl	8(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,8(%ebx)
+	# Round 3 
+	movl	12(%esi),%ecx
+	movl	12(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,12(%ebx)
+	# Round 4 
+	movl	16(%esi),%ecx
+	movl	16(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,16(%ebx)
+	# Round 5 
+	movl	20(%esi),%ecx
+	movl	20(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,20(%ebx)
+	# Round 6 
+	movl	24(%esi),%ecx
+	movl	24(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,24(%ebx)
+	# Round 7 
+	movl	28(%esi),%ecx
+	movl	28(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,28(%ebx)
+
+	addl	$32,%esi
+	addl	$32,%edi
+	addl	$32,%ebx
+	subl	$8,%ebp
+	jnz	L027aw_loop
+L026aw_finish:
+	movl	32(%esp),%ebp
+	andl	$7,%ebp
+	jz	L028aw_end
+	# Tail Round 0 
+	movl	(%esi),%ecx
+	movl	(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	decl	%ebp
+	movl	%ecx,(%ebx)
+	jz	L028aw_end
+	# Tail Round 1 
+	movl	4(%esi),%ecx
+	movl	4(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	decl	%ebp
+	movl	%ecx,4(%ebx)
+	jz	L028aw_end
+	# Tail Round 2 
+	movl	8(%esi),%ecx
+	movl	8(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	decl	%ebp
+	movl	%ecx,8(%ebx)
+	jz	L028aw_end
+	# Tail Round 3 
+	movl	12(%esi),%ecx
+	movl	12(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	decl	%ebp
+	movl	%ecx,12(%ebx)
+	jz	L028aw_end
+	# Tail Round 4 
+	movl	16(%esi),%ecx
+	movl	16(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	decl	%ebp
+	movl	%ecx,16(%ebx)
+	jz	L028aw_end
+	# Tail Round 5 
+	movl	20(%esi),%ecx
+	movl	20(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	decl	%ebp
+	movl	%ecx,20(%ebx)
+	jz	L028aw_end
+	# Tail Round 6 
+	movl	24(%esi),%ecx
+	movl	24(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,24(%ebx)
+L028aw_end:
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.globl	_bn_sub_part_words
+.private_extern	_bn_sub_part_words
+.align	4
+_bn_sub_part_words:
+L_bn_sub_part_words_begin:
+	pushl	%ebp
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+
+	movl	20(%esp),%ebx
+	movl	24(%esp),%esi
+	movl	28(%esp),%edi
+	movl	32(%esp),%ebp
+	xorl	%eax,%eax
+	andl	$4294967288,%ebp
+	jz	L029aw_finish
+L030aw_loop:
+	# Round 0 
+	movl	(%esi),%ecx
+	movl	(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,(%ebx)
+	# Round 1 
+	movl	4(%esi),%ecx
+	movl	4(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,4(%ebx)
+	# Round 2 
+	movl	8(%esi),%ecx
+	movl	8(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,8(%ebx)
+	# Round 3 
+	movl	12(%esi),%ecx
+	movl	12(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,12(%ebx)
+	# Round 4 
+	movl	16(%esi),%ecx
+	movl	16(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,16(%ebx)
+	# Round 5 
+	movl	20(%esi),%ecx
+	movl	20(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,20(%ebx)
+	# Round 6 
+	movl	24(%esi),%ecx
+	movl	24(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,24(%ebx)
+	# Round 7 
+	movl	28(%esi),%ecx
+	movl	28(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,28(%ebx)
+
+	addl	$32,%esi
+	addl	$32,%edi
+	addl	$32,%ebx
+	subl	$8,%ebp
+	jnz	L030aw_loop
+L029aw_finish:
+	movl	32(%esp),%ebp
+	andl	$7,%ebp
+	jz	L031aw_end
+	# Tail Round 0 
+	movl	(%esi),%ecx
+	movl	(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,(%ebx)
+	addl	$4,%esi
+	addl	$4,%edi
+	addl	$4,%ebx
+	decl	%ebp
+	jz	L031aw_end
+	# Tail Round 1 
+	movl	(%esi),%ecx
+	movl	(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,(%ebx)
+	addl	$4,%esi
+	addl	$4,%edi
+	addl	$4,%ebx
+	decl	%ebp
+	jz	L031aw_end
+	# Tail Round 2 
+	movl	(%esi),%ecx
+	movl	(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,(%ebx)
+	addl	$4,%esi
+	addl	$4,%edi
+	addl	$4,%ebx
+	decl	%ebp
+	jz	L031aw_end
+	# Tail Round 3 
+	movl	(%esi),%ecx
+	movl	(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,(%ebx)
+	addl	$4,%esi
+	addl	$4,%edi
+	addl	$4,%ebx
+	decl	%ebp
+	jz	L031aw_end
+	# Tail Round 4 
+	movl	(%esi),%ecx
+	movl	(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,(%ebx)
+	addl	$4,%esi
+	addl	$4,%edi
+	addl	$4,%ebx
+	decl	%ebp
+	jz	L031aw_end
+	# Tail Round 5 
+	movl	(%esi),%ecx
+	movl	(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,(%ebx)
+	addl	$4,%esi
+	addl	$4,%edi
+	addl	$4,%ebx
+	decl	%ebp
+	jz	L031aw_end
+	# Tail Round 6 
+	movl	(%esi),%ecx
+	movl	(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,(%ebx)
+	addl	$4,%esi
+	addl	$4,%edi
+	addl	$4,%ebx
+L031aw_end:
+	cmpl	$0,36(%esp)
+	je	L032pw_end
+	movl	36(%esp),%ebp
+	cmpl	$0,%ebp
+	je	L032pw_end
+	jge	L033pw_pos
+	# pw_neg 
+	movl	$0,%edx
+	subl	%ebp,%edx
+	movl	%edx,%ebp
+	andl	$4294967288,%ebp
+	jz	L034pw_neg_finish
+L035pw_neg_loop:
+	# dl<0 Round 0 
+	movl	$0,%ecx
+	movl	(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,(%ebx)
+	# dl<0 Round 1 
+	movl	$0,%ecx
+	movl	4(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,4(%ebx)
+	# dl<0 Round 2 
+	movl	$0,%ecx
+	movl	8(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,8(%ebx)
+	# dl<0 Round 3 
+	movl	$0,%ecx
+	movl	12(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,12(%ebx)
+	# dl<0 Round 4 
+	movl	$0,%ecx
+	movl	16(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,16(%ebx)
+	# dl<0 Round 5 
+	movl	$0,%ecx
+	movl	20(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,20(%ebx)
+	# dl<0 Round 6 
+	movl	$0,%ecx
+	movl	24(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,24(%ebx)
+	# dl<0 Round 7 
+	movl	$0,%ecx
+	movl	28(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,28(%ebx)
+
+	addl	$32,%edi
+	addl	$32,%ebx
+	subl	$8,%ebp
+	jnz	L035pw_neg_loop
+L034pw_neg_finish:
+	movl	36(%esp),%edx
+	movl	$0,%ebp
+	subl	%edx,%ebp
+	andl	$7,%ebp
+	jz	L032pw_end
+	# dl<0 Tail Round 0 
+	movl	$0,%ecx
+	movl	(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	decl	%ebp
+	movl	%ecx,(%ebx)
+	jz	L032pw_end
+	# dl<0 Tail Round 1 
+	movl	$0,%ecx
+	movl	4(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	decl	%ebp
+	movl	%ecx,4(%ebx)
+	jz	L032pw_end
+	# dl<0 Tail Round 2 
+	movl	$0,%ecx
+	movl	8(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	decl	%ebp
+	movl	%ecx,8(%ebx)
+	jz	L032pw_end
+	# dl<0 Tail Round 3 
+	movl	$0,%ecx
+	movl	12(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	decl	%ebp
+	movl	%ecx,12(%ebx)
+	jz	L032pw_end
+	# dl<0 Tail Round 4 
+	movl	$0,%ecx
+	movl	16(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	decl	%ebp
+	movl	%ecx,16(%ebx)
+	jz	L032pw_end
+	# dl<0 Tail Round 5 
+	movl	$0,%ecx
+	movl	20(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	decl	%ebp
+	movl	%ecx,20(%ebx)
+	jz	L032pw_end
+	# dl<0 Tail Round 6 
+	movl	$0,%ecx
+	movl	24(%edi),%edx
+	subl	%eax,%ecx
+	movl	$0,%eax
+	adcl	%eax,%eax
+	subl	%edx,%ecx
+	adcl	$0,%eax
+	movl	%ecx,24(%ebx)
+	jmp	L032pw_end
+L033pw_pos:
+	andl	$4294967288,%ebp
+	jz	L036pw_pos_finish
+L037pw_pos_loop:
+	# dl>0 Round 0 
+	movl	(%esi),%ecx
+	subl	%eax,%ecx
+	movl	%ecx,(%ebx)
+	jnc	L038pw_nc0
+	# dl>0 Round 1 
+	movl	4(%esi),%ecx
+	subl	%eax,%ecx
+	movl	%ecx,4(%ebx)
+	jnc	L039pw_nc1
+	# dl>0 Round 2 
+	movl	8(%esi),%ecx
+	subl	%eax,%ecx
+	movl	%ecx,8(%ebx)
+	jnc	L040pw_nc2
+	# dl>0 Round 3 
+	movl	12(%esi),%ecx
+	subl	%eax,%ecx
+	movl	%ecx,12(%ebx)
+	jnc	L041pw_nc3
+	# dl>0 Round 4 
+	movl	16(%esi),%ecx
+	subl	%eax,%ecx
+	movl	%ecx,16(%ebx)
+	jnc	L042pw_nc4
+	# dl>0 Round 5 
+	movl	20(%esi),%ecx
+	subl	%eax,%ecx
+	movl	%ecx,20(%ebx)
+	jnc	L043pw_nc5
+	# dl>0 Round 6 
+	movl	24(%esi),%ecx
+	subl	%eax,%ecx
+	movl	%ecx,24(%ebx)
+	jnc	L044pw_nc6
+	# dl>0 Round 7 
+	movl	28(%esi),%ecx
+	subl	%eax,%ecx
+	movl	%ecx,28(%ebx)
+	jnc	L045pw_nc7
+
+	addl	$32,%esi
+	addl	$32,%ebx
+	subl	$8,%ebp
+	jnz	L037pw_pos_loop
+L036pw_pos_finish:
+	movl	36(%esp),%ebp
+	andl	$7,%ebp
+	jz	L032pw_end
+	# dl>0 Tail Round 0 
+	movl	(%esi),%ecx
+	subl	%eax,%ecx
+	movl	%ecx,(%ebx)
+	jnc	L046pw_tail_nc0
+	decl	%ebp
+	jz	L032pw_end
+	# dl>0 Tail Round 1 
+	movl	4(%esi),%ecx
+	subl	%eax,%ecx
+	movl	%ecx,4(%ebx)
+	jnc	L047pw_tail_nc1
+	decl	%ebp
+	jz	L032pw_end
+	# dl>0 Tail Round 2 
+	movl	8(%esi),%ecx
+	subl	%eax,%ecx
+	movl	%ecx,8(%ebx)
+	jnc	L048pw_tail_nc2
+	decl	%ebp
+	jz	L032pw_end
+	# dl>0 Tail Round 3 
+	movl	12(%esi),%ecx
+	subl	%eax,%ecx
+	movl	%ecx,12(%ebx)
+	jnc	L049pw_tail_nc3
+	decl	%ebp
+	jz	L032pw_end
+	# dl>0 Tail Round 4 
+	movl	16(%esi),%ecx
+	subl	%eax,%ecx
+	movl	%ecx,16(%ebx)
+	jnc	L050pw_tail_nc4
+	decl	%ebp
+	jz	L032pw_end
+	# dl>0 Tail Round 5 
+	movl	20(%esi),%ecx
+	subl	%eax,%ecx
+	movl	%ecx,20(%ebx)
+	jnc	L051pw_tail_nc5
+	decl	%ebp
+	jz	L032pw_end
+	# dl>0 Tail Round 6 
+	movl	24(%esi),%ecx
+	subl	%eax,%ecx
+	movl	%ecx,24(%ebx)
+	jnc	L052pw_tail_nc6
+	movl	$1,%eax
+	jmp	L032pw_end
+L053pw_nc_loop:
+	movl	(%esi),%ecx
+	movl	%ecx,(%ebx)
+L038pw_nc0:
+	movl	4(%esi),%ecx
+	movl	%ecx,4(%ebx)
+L039pw_nc1:
+	movl	8(%esi),%ecx
+	movl	%ecx,8(%ebx)
+L040pw_nc2:
+	movl	12(%esi),%ecx
+	movl	%ecx,12(%ebx)
+L041pw_nc3:
+	movl	16(%esi),%ecx
+	movl	%ecx,16(%ebx)
+L042pw_nc4:
+	movl	20(%esi),%ecx
+	movl	%ecx,20(%ebx)
+L043pw_nc5:
+	movl	24(%esi),%ecx
+	movl	%ecx,24(%ebx)
+L044pw_nc6:
+	movl	28(%esi),%ecx
+	movl	%ecx,28(%ebx)
+L045pw_nc7:
+
+	addl	$32,%esi
+	addl	$32,%ebx
+	subl	$8,%ebp
+	jnz	L053pw_nc_loop
+	movl	36(%esp),%ebp
+	andl	$7,%ebp
+	jz	L054pw_nc_end
+	movl	(%esi),%ecx
+	movl	%ecx,(%ebx)
+L046pw_tail_nc0:
+	decl	%ebp
+	jz	L054pw_nc_end
+	movl	4(%esi),%ecx
+	movl	%ecx,4(%ebx)
+L047pw_tail_nc1:
+	decl	%ebp
+	jz	L054pw_nc_end
+	movl	8(%esi),%ecx
+	movl	%ecx,8(%ebx)
+L048pw_tail_nc2:
+	decl	%ebp
+	jz	L054pw_nc_end
+	movl	12(%esi),%ecx
+	movl	%ecx,12(%ebx)
+L049pw_tail_nc3:
+	decl	%ebp
+	jz	L054pw_nc_end
+	movl	16(%esi),%ecx
+	movl	%ecx,16(%ebx)
+L050pw_tail_nc4:
+	decl	%ebp
+	jz	L054pw_nc_end
+	movl	20(%esi),%ecx
+	movl	%ecx,20(%ebx)
+L051pw_tail_nc5:
+	decl	%ebp
+	jz	L054pw_nc_end
+	movl	24(%esi),%ecx
+	movl	%ecx,24(%ebx)
+L052pw_tail_nc6:
+L054pw_nc_end:
+	movl	$0,%eax
+L032pw_end:
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.section __IMPORT,__pointers,non_lazy_symbol_pointers
+L_OPENSSL_ia32cap_P$non_lazy_ptr:
+.indirect_symbol	_OPENSSL_ia32cap_P
+.long	0
+#endif
diff --git a/third_party/boringssl/mac-x86/crypto/bn/co-586.S b/third_party/boringssl/mac-x86/crypto/bn/co-586.S
new file mode 100644
index 0000000..7ce8e79
--- /dev/null
+++ b/third_party/boringssl/mac-x86/crypto/bn/co-586.S
@@ -0,0 +1,1252 @@
+#if defined(__i386__)
+.file	"src/crypto/bn/asm/co-586.S"
+.text
+.globl	_bn_mul_comba8
+.private_extern	_bn_mul_comba8
+.align	4
+_bn_mul_comba8:
+L_bn_mul_comba8_begin:
+	pushl	%esi
+	movl	12(%esp),%esi
+	pushl	%edi
+	movl	20(%esp),%edi
+	pushl	%ebp
+	pushl	%ebx
+	xorl	%ebx,%ebx
+	movl	(%esi),%eax
+	xorl	%ecx,%ecx
+	movl	(%edi),%edx
+	# ################## Calculate word 0 
+	xorl	%ebp,%ebp
+	# mul a[0]*b[0] 
+	mull	%edx
+	addl	%eax,%ebx
+	movl	20(%esp),%eax
+	adcl	%edx,%ecx
+	movl	(%edi),%edx
+	adcl	$0,%ebp
+	movl	%ebx,(%eax)
+	movl	4(%esi),%eax
+	# saved r[0] 
+	# ################## Calculate word 1 
+	xorl	%ebx,%ebx
+	# mul a[1]*b[0] 
+	mull	%edx
+	addl	%eax,%ecx
+	movl	(%esi),%eax
+	adcl	%edx,%ebp
+	movl	4(%edi),%edx
+	adcl	$0,%ebx
+	# mul a[0]*b[1] 
+	mull	%edx
+	addl	%eax,%ecx
+	movl	20(%esp),%eax
+	adcl	%edx,%ebp
+	movl	(%edi),%edx
+	adcl	$0,%ebx
+	movl	%ecx,4(%eax)
+	movl	8(%esi),%eax
+	# saved r[1] 
+	# ################## Calculate word 2 
+	xorl	%ecx,%ecx
+	# mul a[2]*b[0] 
+	mull	%edx
+	addl	%eax,%ebp
+	movl	4(%esi),%eax
+	adcl	%edx,%ebx
+	movl	4(%edi),%edx
+	adcl	$0,%ecx
+	# mul a[1]*b[1] 
+	mull	%edx
+	addl	%eax,%ebp
+	movl	(%esi),%eax
+	adcl	%edx,%ebx
+	movl	8(%edi),%edx
+	adcl	$0,%ecx
+	# mul a[0]*b[2] 
+	mull	%edx
+	addl	%eax,%ebp
+	movl	20(%esp),%eax
+	adcl	%edx,%ebx
+	movl	(%edi),%edx
+	adcl	$0,%ecx
+	movl	%ebp,8(%eax)
+	movl	12(%esi),%eax
+	# saved r[2] 
+	# ################## Calculate word 3 
+	xorl	%ebp,%ebp
+	# mul a[3]*b[0] 
+	mull	%edx
+	addl	%eax,%ebx
+	movl	8(%esi),%eax
+	adcl	%edx,%ecx
+	movl	4(%edi),%edx
+	adcl	$0,%ebp
+	# mul a[2]*b[1] 
+	mull	%edx
+	addl	%eax,%ebx
+	movl	4(%esi),%eax
+	adcl	%edx,%ecx
+	movl	8(%edi),%edx
+	adcl	$0,%ebp
+	# mul a[1]*b[2] 
+	mull	%edx
+	addl	%eax,%ebx
+	movl	(%esi),%eax
+	adcl	%edx,%ecx
+	movl	12(%edi),%edx
+	adcl	$0,%ebp
+	# mul a[0]*b[3] 
+	mull	%edx
+	addl	%eax,%ebx
+	movl	20(%esp),%eax
+	adcl	%edx,%ecx
+	movl	(%edi),%edx
+	adcl	$0,%ebp
+	movl	%ebx,12(%eax)
+	movl	16(%esi),%eax
+	# saved r[3] 
+	# ################## Calculate word 4 
+	xorl	%ebx,%ebx
+	# mul a[4]*b[0] 
+	mull	%edx
+	addl	%eax,%ecx
+	movl	12(%esi),%eax
+	adcl	%edx,%ebp
+	movl	4(%edi),%edx
+	adcl	$0,%ebx
+	# mul a[3]*b[1] 
+	mull	%edx
+	addl	%eax,%ecx
+	movl	8(%esi),%eax
+	adcl	%edx,%ebp
+	movl	8(%edi),%edx
+	adcl	$0,%ebx
+	# mul a[2]*b[2] 
+	mull	%edx
+	addl	%eax,%ecx
+	movl	4(%esi),%eax
+	adcl	%edx,%ebp
+	movl	12(%edi),%edx
+	adcl	$0,%ebx
+	# mul a[1]*b[3] 
+	mull	%edx
+	addl	%eax,%ecx
+	movl	(%esi),%eax
+	adcl	%edx,%ebp
+	movl	16(%edi),%edx
+	adcl	$0,%ebx
+	# mul a[0]*b[4] 
+	mull	%edx
+	addl	%eax,%ecx
+	movl	20(%esp),%eax
+	adcl	%edx,%ebp
+	movl	(%edi),%edx
+	adcl	$0,%ebx
+	movl	%ecx,16(%eax)
+	movl	20(%esi),%eax
+	# saved r[4] 
+	# ################## Calculate word 5 
+	xorl	%ecx,%ecx
+	# mul a[5]*b[0] 
+	mull	%edx
+	addl	%eax,%ebp
+	movl	16(%esi),%eax
+	adcl	%edx,%ebx
+	movl	4(%edi),%edx
+	adcl	$0,%ecx
+	# mul a[4]*b[1] 
+	mull	%edx
+	addl	%eax,%ebp
+	movl	12(%esi),%eax
+	adcl	%edx,%ebx
+	movl	8(%edi),%edx
+	adcl	$0,%ecx
+	# mul a[3]*b[2] 
+	mull	%edx
+	addl	%eax,%ebp
+	movl	8(%esi),%eax
+	adcl	%edx,%ebx
+	movl	12(%edi),%edx
+	adcl	$0,%ecx
+	# mul a[2]*b[3] 
+	mull	%edx
+	addl	%eax,%ebp
+	movl	4(%esi),%eax
+	adcl	%edx,%ebx
+	movl	16(%edi),%edx
+	adcl	$0,%ecx
+	# mul a[1]*b[4] 
+	mull	%edx
+	addl	%eax,%ebp
+	movl	(%esi),%eax
+	adcl	%edx,%ebx
+	movl	20(%edi),%edx
+	adcl	$0,%ecx
+	# mul a[0]*b[5] 
+	mull	%edx
+	addl	%eax,%ebp
+	movl	20(%esp),%eax
+	adcl	%edx,%ebx
+	movl	(%edi),%edx
+	adcl	$0,%ecx
+	movl	%ebp,20(%eax)
+	movl	24(%esi),%eax
+	# saved r[5] 
+	# ################## Calculate word 6 
+	xorl	%ebp,%ebp
+	# mul a[6]*b[0] 
+	mull	%edx
+	addl	%eax,%ebx
+	movl	20(%esi),%eax
+	adcl	%edx,%ecx
+	movl	4(%edi),%edx
+	adcl	$0,%ebp
+	# mul a[5]*b[1] 
+	mull	%edx
+	addl	%eax,%ebx
+	movl	16(%esi),%eax
+	adcl	%edx,%ecx
+	movl	8(%edi),%edx
+	adcl	$0,%ebp
+	# mul a[4]*b[2] 
+	mull	%edx
+	addl	%eax,%ebx
+	movl	12(%esi),%eax
+	adcl	%edx,%ecx
+	movl	12(%edi),%edx
+	adcl	$0,%ebp
+	# mul a[3]*b[3] 
+	mull	%edx
+	addl	%eax,%ebx
+	movl	8(%esi),%eax
+	adcl	%edx,%ecx
+	movl	16(%edi),%edx
+	adcl	$0,%ebp
+	# mul a[2]*b[4] 
+	mull	%edx
+	addl	%eax,%ebx
+	movl	4(%esi),%eax
+	adcl	%edx,%ecx
+	movl	20(%edi),%edx
+	adcl	$0,%ebp
+	# mul a[1]*b[5] 
+	mull	%edx
+	addl	%eax,%ebx
+	movl	(%esi),%eax
+	adcl	%edx,%ecx
+	movl	24(%edi),%edx
+	adcl	$0,%ebp
+	# mul a[0]*b[6] 
+	mull	%edx
+	addl	%eax,%ebx
+	movl	20(%esp),%eax
+	adcl	%edx,%ecx
+	movl	(%edi),%edx
+	adcl	$0,%ebp
+	movl	%ebx,24(%eax)
+	movl	28(%esi),%eax
+	# saved r[6] 
+	# ################## Calculate word 7 
+	xorl	%ebx,%ebx
+	# mul a[7]*b[0] 
+	mull	%edx
+	addl	%eax,%ecx
+	movl	24(%esi),%eax
+	adcl	%edx,%ebp
+	movl	4(%edi),%edx
+	adcl	$0,%ebx
+	# mul a[6]*b[1] 
+	mull	%edx
+	addl	%eax,%ecx
+	movl	20(%esi),%eax
+	adcl	%edx,%ebp
+	movl	8(%edi),%edx
+	adcl	$0,%ebx
+	# mul a[5]*b[2] 
+	mull	%edx
+	addl	%eax,%ecx
+	movl	16(%esi),%eax
+	adcl	%edx,%ebp
+	movl	12(%edi),%edx
+	adcl	$0,%ebx
+	# mul a[4]*b[3] 
+	mull	%edx
+	addl	%eax,%ecx
+	movl	12(%esi),%eax
+	adcl	%edx,%ebp
+	movl	16(%edi),%edx
+	adcl	$0,%ebx
+	# mul a[3]*b[4] 
+	mull	%edx
+	addl	%eax,%ecx
+	movl	8(%esi),%eax
+	adcl	%edx,%ebp
+	movl	20(%edi),%edx
+	adcl	$0,%ebx
+	# mul a[2]*b[5] 
+	mull	%edx
+	addl	%eax,%ecx
+	movl	4(%esi),%eax
+	adcl	%edx,%ebp
+	movl	24(%edi),%edx
+	adcl	$0,%ebx
+	# mul a[1]*b[6] 
+	mull	%edx
+	addl	%eax,%ecx
+	movl	(%esi),%eax
+	adcl	%edx,%ebp
+	movl	28(%edi),%edx
+	adcl	$0,%ebx
+	# mul a[0]*b[7] 
+	mull	%edx
+	addl	%eax,%ecx
+	movl	20(%esp),%eax
+	adcl	%edx,%ebp
+	movl	4(%edi),%edx
+	adcl	$0,%ebx
+	movl	%ecx,28(%eax)
+	movl	28(%esi),%eax
+	# saved r[7] 
+	# ################## Calculate word 8 
+	xorl	%ecx,%ecx
+	# mul a[7]*b[1] 
+	mull	%edx
+	addl	%eax,%ebp
+	movl	24(%esi),%eax
+	adcl	%edx,%ebx
+	movl	8(%edi),%edx
+	adcl	$0,%ecx
+	# mul a[6]*b[2] 
+	mull	%edx
+	addl	%eax,%ebp
+	movl	20(%esi),%eax
+	adcl	%edx,%ebx
+	movl	12(%edi),%edx
+	adcl	$0,%ecx
+	# mul a[5]*b[3] 
+	mull	%edx
+	addl	%eax,%ebp
+	movl	16(%esi),%eax
+	adcl	%edx,%ebx
+	movl	16(%edi),%edx
+	adcl	$0,%ecx
+	# mul a[4]*b[4] 
+	mull	%edx
+	addl	%eax,%ebp
+	movl	12(%esi),%eax
+	adcl	%edx,%ebx
+	movl	20(%edi),%edx
+	adcl	$0,%ecx
+	# mul a[3]*b[5] 
+	mull	%edx
+	addl	%eax,%ebp
+	movl	8(%esi),%eax
+	adcl	%edx,%ebx
+	movl	24(%edi),%edx
+	adcl	$0,%ecx
+	# mul a[2]*b[6] 
+	mull	%edx
+	addl	%eax,%ebp
+	movl	4(%esi),%eax
+	adcl	%edx,%ebx
+	movl	28(%edi),%edx
+	adcl	$0,%ecx
+	# mul a[1]*b[7] 
+	mull	%edx
+	addl	%eax,%ebp
+	movl	20(%esp),%eax
+	adcl	%edx,%ebx
+	movl	8(%edi),%edx
+	adcl	$0,%ecx
+	movl	%ebp,32(%eax)
+	movl	28(%esi),%eax
+	# saved r[8] 
+	# ################## Calculate word 9 
+	xorl	%ebp,%ebp
+	# mul a[7]*b[2] 
+	mull	%edx
+	addl	%eax,%ebx
+	movl	24(%esi),%eax
+	adcl	%edx,%ecx
+	movl	12(%edi),%edx
+	adcl	$0,%ebp
+	# mul a[6]*b[3] 
+	mull	%edx
+	addl	%eax,%ebx
+	movl	20(%esi),%eax
+	adcl	%edx,%ecx
+	movl	16(%edi),%edx
+	adcl	$0,%ebp
+	# mul a[5]*b[4] 
+	mull	%edx
+	addl	%eax,%ebx
+	movl	16(%esi),%eax
+	adcl	%edx,%ecx
+	movl	20(%edi),%edx
+	adcl	$0,%ebp
+	# mul a[4]*b[5] 
+	mull	%edx
+	addl	%eax,%ebx
+	movl	12(%esi),%eax
+	adcl	%edx,%ecx
+	movl	24(%edi),%edx
+	adcl	$0,%ebp
+	# mul a[3]*b[6] 
+	mull	%edx
+	addl	%eax,%ebx
+	movl	8(%esi),%eax
+	adcl	%edx,%ecx
+	movl	28(%edi),%edx
+	adcl	$0,%ebp
+	# mul a[2]*b[7] 
+	mull	%edx
+	addl	%eax,%ebx
+	movl	20(%esp),%eax
+	adcl	%edx,%ecx
+	movl	12(%edi),%edx
+	adcl	$0,%ebp
+	movl	%ebx,36(%eax)
+	movl	28(%esi),%eax
+	# saved r[9] 
+	# ################## Calculate word 10 
+	xorl	%ebx,%ebx
+	# mul a[7]*b[3] 
+	mull	%edx
+	addl	%eax,%ecx
+	movl	24(%esi),%eax
+	adcl	%edx,%ebp
+	movl	16(%edi),%edx
+	adcl	$0,%ebx
+	# mul a[6]*b[4] 
+	mull	%edx
+	addl	%eax,%ecx
+	movl	20(%esi),%eax
+	adcl	%edx,%ebp
+	movl	20(%edi),%edx
+	adcl	$0,%ebx
+	# mul a[5]*b[5] 
+	mull	%edx
+	addl	%eax,%ecx
+	movl	16(%esi),%eax
+	adcl	%edx,%ebp
+	movl	24(%edi),%edx
+	adcl	$0,%ebx
+	# mul a[4]*b[6] 
+	mull	%edx
+	addl	%eax,%ecx
+	movl	12(%esi),%eax
+	adcl	%edx,%ebp
+	movl	28(%edi),%edx
+	adcl	$0,%ebx
+	# mul a[3]*b[7] 
+	mull	%edx
+	addl	%eax,%ecx
+	movl	20(%esp),%eax
+	adcl	%edx,%ebp
+	movl	16(%edi),%edx
+	adcl	$0,%ebx
+	movl	%ecx,40(%eax)
+	movl	28(%esi),%eax
+	# saved r[10] 
+	# ################## Calculate word 11 
+	xorl	%ecx,%ecx
+	# mul a[7]*b[4] 
+	mull	%edx
+	addl	%eax,%ebp
+	movl	24(%esi),%eax
+	adcl	%edx,%ebx
+	movl	20(%edi),%edx
+	adcl	$0,%ecx
+	# mul a[6]*b[5] 
+	mull	%edx
+	addl	%eax,%ebp
+	movl	20(%esi),%eax
+	adcl	%edx,%ebx
+	movl	24(%edi),%edx
+	adcl	$0,%ecx
+	# mul a[5]*b[6] 
+	mull	%edx
+	addl	%eax,%ebp
+	movl	16(%esi),%eax
+	adcl	%edx,%ebx
+	movl	28(%edi),%edx
+	adcl	$0,%ecx
+	# mul a[4]*b[7] 
+	mull	%edx
+	addl	%eax,%ebp
+	movl	20(%esp),%eax
+	adcl	%edx,%ebx
+	movl	20(%edi),%edx
+	adcl	$0,%ecx
+	movl	%ebp,44(%eax)
+	movl	28(%esi),%eax
+	# saved r[11] 
+	# ################## Calculate word 12 
+	xorl	%ebp,%ebp
+	# mul a[7]*b[5] 
+	mull	%edx
+	addl	%eax,%ebx
+	movl	24(%esi),%eax
+	adcl	%edx,%ecx
+	movl	24(%edi),%edx
+	adcl	$0,%ebp
+	# mul a[6]*b[6] 
+	mull	%edx
+	addl	%eax,%ebx
+	movl	20(%esi),%eax
+	adcl	%edx,%ecx
+	movl	28(%edi),%edx
+	adcl	$0,%ebp
+	# mul a[5]*b[7] 
+	mull	%edx
+	addl	%eax,%ebx
+	movl	20(%esp),%eax
+	adcl	%edx,%ecx
+	movl	24(%edi),%edx
+	adcl	$0,%ebp
+	movl	%ebx,48(%eax)
+	movl	28(%esi),%eax
+	# saved r[12] 
+	# ################## Calculate word 13 
+	xorl	%ebx,%ebx
+	# mul a[7]*b[6] 
+	mull	%edx
+	addl	%eax,%ecx
+	movl	24(%esi),%eax
+	adcl	%edx,%ebp
+	movl	28(%edi),%edx
+	adcl	$0,%ebx
+	# mul a[6]*b[7] 
+	mull	%edx
+	addl	%eax,%ecx
+	movl	20(%esp),%eax
+	adcl	%edx,%ebp
+	movl	28(%edi),%edx
+	adcl	$0,%ebx
+	movl	%ecx,52(%eax)
+	movl	28(%esi),%eax
+	# saved r[13] 
+	# ################## Calculate word 14 
+	xorl	%ecx,%ecx
+	# mul a[7]*b[7] 
+	mull	%edx
+	addl	%eax,%ebp
+	movl	20(%esp),%eax
+	adcl	%edx,%ebx
+	adcl	$0,%ecx
+	movl	%ebp,56(%eax)
+	# saved r[14] 
+	# save r[15] 
+	movl	%ebx,60(%eax)
+	popl	%ebx
+	popl	%ebp
+	popl	%edi
+	popl	%esi
+	ret
+.globl	_bn_mul_comba4
+.private_extern	_bn_mul_comba4
+.align	4
+_bn_mul_comba4:
+L_bn_mul_comba4_begin:
+	pushl	%esi
+	movl	12(%esp),%esi
+	pushl	%edi
+	movl	20(%esp),%edi
+	pushl	%ebp
+	pushl	%ebx
+	xorl	%ebx,%ebx
+	movl	(%esi),%eax
+	xorl	%ecx,%ecx
+	movl	(%edi),%edx
+	# ################## Calculate word 0 
+	xorl	%ebp,%ebp
+	# mul a[0]*b[0] 
+	mull	%edx
+	addl	%eax,%ebx
+	movl	20(%esp),%eax
+	adcl	%edx,%ecx
+	movl	(%edi),%edx
+	adcl	$0,%ebp
+	movl	%ebx,(%eax)
+	movl	4(%esi),%eax
+	# saved r[0] 
+	# ################## Calculate word 1 
+	xorl	%ebx,%ebx
+	# mul a[1]*b[0] 
+	mull	%edx
+	addl	%eax,%ecx
+	movl	(%esi),%eax
+	adcl	%edx,%ebp
+	movl	4(%edi),%edx
+	adcl	$0,%ebx
+	# mul a[0]*b[1] 
+	mull	%edx
+	addl	%eax,%ecx
+	movl	20(%esp),%eax
+	adcl	%edx,%ebp
+	movl	(%edi),%edx
+	adcl	$0,%ebx
+	movl	%ecx,4(%eax)
+	movl	8(%esi),%eax
+	# saved r[1] 
+	# ################## Calculate word 2 
+	xorl	%ecx,%ecx
+	# mul a[2]*b[0] 
+	mull	%edx
+	addl	%eax,%ebp
+	movl	4(%esi),%eax
+	adcl	%edx,%ebx
+	movl	4(%edi),%edx
+	adcl	$0,%ecx
+	# mul a[1]*b[1] 
+	mull	%edx
+	addl	%eax,%ebp
+	movl	(%esi),%eax
+	adcl	%edx,%ebx
+	movl	8(%edi),%edx
+	adcl	$0,%ecx
+	# mul a[0]*b[2] 
+	mull	%edx
+	addl	%eax,%ebp
+	movl	20(%esp),%eax
+	adcl	%edx,%ebx
+	movl	(%edi),%edx
+	adcl	$0,%ecx
+	movl	%ebp,8(%eax)
+	movl	12(%esi),%eax
+	# saved r[2] 
+	# ################## Calculate word 3 
+	xorl	%ebp,%ebp
+	# mul a[3]*b[0] 
+	mull	%edx
+	addl	%eax,%ebx
+	movl	8(%esi),%eax
+	adcl	%edx,%ecx
+	movl	4(%edi),%edx
+	adcl	$0,%ebp
+	# mul a[2]*b[1] 
+	mull	%edx
+	addl	%eax,%ebx
+	movl	4(%esi),%eax
+	adcl	%edx,%ecx
+	movl	8(%edi),%edx
+	adcl	$0,%ebp
+	# mul a[1]*b[2] 
+	mull	%edx
+	addl	%eax,%ebx
+	movl	(%esi),%eax
+	adcl	%edx,%ecx
+	movl	12(%edi),%edx
+	adcl	$0,%ebp
+	# mul a[0]*b[3] 
+	mull	%edx
+	addl	%eax,%ebx
+	movl	20(%esp),%eax
+	adcl	%edx,%ecx
+	movl	4(%edi),%edx
+	adcl	$0,%ebp
+	movl	%ebx,12(%eax)
+	movl	12(%esi),%eax
+	# saved r[3] 
+	# ################## Calculate word 4 
+	xorl	%ebx,%ebx
+	# mul a[3]*b[1] 
+	mull	%edx
+	addl	%eax,%ecx
+	movl	8(%esi),%eax
+	adcl	%edx,%ebp
+	movl	8(%edi),%edx
+	adcl	$0,%ebx
+	# mul a[2]*b[2] 
+	mull	%edx
+	addl	%eax,%ecx
+	movl	4(%esi),%eax
+	adcl	%edx,%ebp
+	movl	12(%edi),%edx
+	adcl	$0,%ebx
+	# mul a[1]*b[3] 
+	mull	%edx
+	addl	%eax,%ecx
+	movl	20(%esp),%eax
+	adcl	%edx,%ebp
+	movl	8(%edi),%edx
+	adcl	$0,%ebx
+	movl	%ecx,16(%eax)
+	movl	12(%esi),%eax
+	# saved r[4] 
+	# ################## Calculate word 5 
+	xorl	%ecx,%ecx
+	# mul a[3]*b[2] 
+	mull	%edx
+	addl	%eax,%ebp
+	movl	8(%esi),%eax
+	adcl	%edx,%ebx
+	movl	12(%edi),%edx
+	adcl	$0,%ecx
+	# mul a[2]*b[3] 
+	mull	%edx
+	addl	%eax,%ebp
+	movl	20(%esp),%eax
+	adcl	%edx,%ebx
+	movl	12(%edi),%edx
+	adcl	$0,%ecx
+	movl	%ebp,20(%eax)
+	movl	12(%esi),%eax
+	# saved r[5] 
+	# ################## Calculate word 6 
+	xorl	%ebp,%ebp
+	# mul a[3]*b[3] 
+	mull	%edx
+	addl	%eax,%ebx
+	movl	20(%esp),%eax
+	adcl	%edx,%ecx
+	adcl	$0,%ebp
+	movl	%ebx,24(%eax)
+	# saved r[6] 
+	# save r[7] 
+	movl	%ecx,28(%eax)
+	popl	%ebx
+	popl	%ebp
+	popl	%edi
+	popl	%esi
+	ret
+.globl	_bn_sqr_comba8
+.private_extern	_bn_sqr_comba8
+.align	4
+_bn_sqr_comba8:
+L_bn_sqr_comba8_begin:
+	pushl	%esi
+	pushl	%edi
+	pushl	%ebp
+	pushl	%ebx
+	movl	20(%esp),%edi
+	movl	24(%esp),%esi
+	xorl	%ebx,%ebx
+	xorl	%ecx,%ecx
+	movl	(%esi),%eax
+	# ############### Calculate word 0 
+	xorl	%ebp,%ebp
+	# sqr a[0]*a[0] 
+	mull	%eax
+	addl	%eax,%ebx
+	adcl	%edx,%ecx
+	movl	(%esi),%edx
+	adcl	$0,%ebp
+	movl	%ebx,(%edi)
+	movl	4(%esi),%eax
+	# saved r[0] 
+	# ############### Calculate word 1 
+	xorl	%ebx,%ebx
+	# sqr a[1]*a[0] 
+	mull	%edx
+	addl	%eax,%eax
+	adcl	%edx,%edx
+	adcl	$0,%ebx
+	addl	%eax,%ecx
+	adcl	%edx,%ebp
+	movl	8(%esi),%eax
+	adcl	$0,%ebx
+	movl	%ecx,4(%edi)
+	movl	(%esi),%edx
+	# saved r[1] 
+	# ############### Calculate word 2 
+	xorl	%ecx,%ecx
+	# sqr a[2]*a[0] 
+	mull	%edx
+	addl	%eax,%eax
+	adcl	%edx,%edx
+	adcl	$0,%ecx
+	addl	%eax,%ebp
+	adcl	%edx,%ebx
+	movl	4(%esi),%eax
+	adcl	$0,%ecx
+	# sqr a[1]*a[1] 
+	mull	%eax
+	addl	%eax,%ebp
+	adcl	%edx,%ebx
+	movl	(%esi),%edx
+	adcl	$0,%ecx
+	movl	%ebp,8(%edi)
+	movl	12(%esi),%eax
+	# saved r[2] 
+	# ############### Calculate word 3 
+	xorl	%ebp,%ebp
+	# sqr a[3]*a[0] 
+	mull	%edx
+	addl	%eax,%eax
+	adcl	%edx,%edx
+	adcl	$0,%ebp
+	addl	%eax,%ebx
+	adcl	%edx,%ecx
+	movl	8(%esi),%eax
+	adcl	$0,%ebp
+	movl	4(%esi),%edx
+	# sqr a[2]*a[1] 
+	mull	%edx
+	addl	%eax,%eax
+	adcl	%edx,%edx
+	adcl	$0,%ebp
+	addl	%eax,%ebx
+	adcl	%edx,%ecx
+	movl	16(%esi),%eax
+	adcl	$0,%ebp
+	movl	%ebx,12(%edi)
+	movl	(%esi),%edx
+	# saved r[3] 
+	# ############### Calculate word 4 
+	xorl	%ebx,%ebx
+	# sqr a[4]*a[0] 
+	mull	%edx
+	addl	%eax,%eax
+	adcl	%edx,%edx
+	adcl	$0,%ebx
+	addl	%eax,%ecx
+	adcl	%edx,%ebp
+	movl	12(%esi),%eax
+	adcl	$0,%ebx
+	movl	4(%esi),%edx
+	# sqr a[3]*a[1] 
+	mull	%edx
+	addl	%eax,%eax
+	adcl	%edx,%edx
+	adcl	$0,%ebx
+	addl	%eax,%ecx
+	adcl	%edx,%ebp
+	movl	8(%esi),%eax
+	adcl	$0,%ebx
+	# sqr a[2]*a[2] 
+	mull	%eax
+	addl	%eax,%ecx
+	adcl	%edx,%ebp
+	movl	(%esi),%edx
+	adcl	$0,%ebx
+	movl	%ecx,16(%edi)
+	movl	20(%esi),%eax
+	# saved r[4] 
+	# ############### Calculate word 5 
+	xorl	%ecx,%ecx
+	# sqr a[5]*a[0] 
+	mull	%edx
+	addl	%eax,%eax
+	adcl	%edx,%edx
+	adcl	$0,%ecx
+	addl	%eax,%ebp
+	adcl	%edx,%ebx
+	movl	16(%esi),%eax
+	adcl	$0,%ecx
+	movl	4(%esi),%edx
+	# sqr a[4]*a[1] 
+	mull	%edx
+	addl	%eax,%eax
+	adcl	%edx,%edx
+	adcl	$0,%ecx
+	addl	%eax,%ebp
+	adcl	%edx,%ebx
+	movl	12(%esi),%eax
+	adcl	$0,%ecx
+	movl	8(%esi),%edx
+	# sqr a[3]*a[2] 
+	mull	%edx
+	addl	%eax,%eax
+	adcl	%edx,%edx
+	adcl	$0,%ecx
+	addl	%eax,%ebp
+	adcl	%edx,%ebx
+	movl	24(%esi),%eax
+	adcl	$0,%ecx
+	movl	%ebp,20(%edi)
+	movl	(%esi),%edx
+	# saved r[5] 
+	# ############### Calculate word 6 
+	xorl	%ebp,%ebp
+	# sqr a[6]*a[0] 
+	mull	%edx
+	addl	%eax,%eax
+	adcl	%edx,%edx
+	adcl	$0,%ebp
+	addl	%eax,%ebx
+	adcl	%edx,%ecx
+	movl	20(%esi),%eax
+	adcl	$0,%ebp
+	movl	4(%esi),%edx
+	# sqr a[5]*a[1] 
+	mull	%edx
+	addl	%eax,%eax
+	adcl	%edx,%edx
+	adcl	$0,%ebp
+	addl	%eax,%ebx
+	adcl	%edx,%ecx
+	movl	16(%esi),%eax
+	adcl	$0,%ebp
+	movl	8(%esi),%edx
+	# sqr a[4]*a[2] 
+	mull	%edx
+	addl	%eax,%eax
+	adcl	%edx,%edx
+	adcl	$0,%ebp
+	addl	%eax,%ebx
+	adcl	%edx,%ecx
+	movl	12(%esi),%eax
+	adcl	$0,%ebp
+	# sqr a[3]*a[3] 
+	mull	%eax
+	addl	%eax,%ebx
+	adcl	%edx,%ecx
+	movl	(%esi),%edx
+	adcl	$0,%ebp
+	movl	%ebx,24(%edi)
+	movl	28(%esi),%eax
+	# saved r[6] 
+	# ############### Calculate word 7 
+	xorl	%ebx,%ebx
+	# sqr a[7]*a[0] 
+	mull	%edx
+	addl	%eax,%eax
+	adcl	%edx,%edx
+	adcl	$0,%ebx
+	addl	%eax,%ecx
+	adcl	%edx,%ebp
+	movl	24(%esi),%eax
+	adcl	$0,%ebx
+	movl	4(%esi),%edx
+	# sqr a[6]*a[1] 
+	mull	%edx
+	addl	%eax,%eax
+	adcl	%edx,%edx
+	adcl	$0,%ebx
+	addl	%eax,%ecx
+	adcl	%edx,%ebp
+	movl	20(%esi),%eax
+	adcl	$0,%ebx
+	movl	8(%esi),%edx
+	# sqr a[5]*a[2] 
+	mull	%edx
+	addl	%eax,%eax
+	adcl	%edx,%edx
+	adcl	$0,%ebx
+	addl	%eax,%ecx
+	adcl	%edx,%ebp
+	movl	16(%esi),%eax
+	adcl	$0,%ebx
+	movl	12(%esi),%edx
+	# sqr a[4]*a[3] 
+	mull	%edx
+	addl	%eax,%eax
+	adcl	%edx,%edx
+	adcl	$0,%ebx
+	addl	%eax,%ecx
+	adcl	%edx,%ebp
+	movl	28(%esi),%eax
+	adcl	$0,%ebx
+	movl	%ecx,28(%edi)
+	movl	4(%esi),%edx
+	# saved r[7] 
+	# ############### Calculate word 8 
+	xorl	%ecx,%ecx
+	# sqr a[7]*a[1] 
+	mull	%edx
+	addl	%eax,%eax
+	adcl	%edx,%edx
+	adcl	$0,%ecx
+	addl	%eax,%ebp
+	adcl	%edx,%ebx
+	movl	24(%esi),%eax
+	adcl	$0,%ecx
+	movl	8(%esi),%edx
+	# sqr a[6]*a[2] 
+	mull	%edx
+	addl	%eax,%eax
+	adcl	%edx,%edx
+	adcl	$0,%ecx
+	addl	%eax,%ebp
+	adcl	%edx,%ebx
+	movl	20(%esi),%eax
+	adcl	$0,%ecx
+	movl	12(%esi),%edx
+	# sqr a[5]*a[3] 
+	mull	%edx
+	addl	%eax,%eax
+	adcl	%edx,%edx
+	adcl	$0,%ecx
+	addl	%eax,%ebp
+	adcl	%edx,%ebx
+	movl	16(%esi),%eax
+	adcl	$0,%ecx
+	# sqr a[4]*a[4] 
+	mull	%eax
+	addl	%eax,%ebp
+	adcl	%edx,%ebx
+	movl	8(%esi),%edx
+	adcl	$0,%ecx
+	movl	%ebp,32(%edi)
+	movl	28(%esi),%eax
+	# saved r[8] 
+	# ############### Calculate word 9 
+	xorl	%ebp,%ebp
+	# sqr a[7]*a[2] 
+	mull	%edx
+	addl	%eax,%eax
+	adcl	%edx,%edx
+	adcl	$0,%ebp
+	addl	%eax,%ebx
+	adcl	%edx,%ecx
+	movl	24(%esi),%eax
+	adcl	$0,%ebp
+	movl	12(%esi),%edx
+	# sqr a[6]*a[3] 
+	mull	%edx
+	addl	%eax,%eax
+	adcl	%edx,%edx
+	adcl	$0,%ebp
+	addl	%eax,%ebx
+	adcl	%edx,%ecx
+	movl	20(%esi),%eax
+	adcl	$0,%ebp
+	movl	16(%esi),%edx
+	# sqr a[5]*a[4] 
+	mull	%edx
+	addl	%eax,%eax
+	adcl	%edx,%edx
+	adcl	$0,%ebp
+	addl	%eax,%ebx
+	adcl	%edx,%ecx
+	movl	28(%esi),%eax
+	adcl	$0,%ebp
+	movl	%ebx,36(%edi)
+	movl	12(%esi),%edx
+	# saved r[9] 
+	# ############### Calculate word 10 
+	xorl	%ebx,%ebx
+	# sqr a[7]*a[3] 
+	mull	%edx
+	addl	%eax,%eax
+	adcl	%edx,%edx
+	adcl	$0,%ebx
+	addl	%eax,%ecx
+	adcl	%edx,%ebp
+	movl	24(%esi),%eax
+	adcl	$0,%ebx
+	movl	16(%esi),%edx
+	# sqr a[6]*a[4] 
+	mull	%edx
+	addl	%eax,%eax
+	adcl	%edx,%edx
+	adcl	$0,%ebx
+	addl	%eax,%ecx
+	adcl	%edx,%ebp
+	movl	20(%esi),%eax
+	adcl	$0,%ebx
+	# sqr a[5]*a[5] 
+	mull	%eax
+	addl	%eax,%ecx
+	adcl	%edx,%ebp
+	movl	16(%esi),%edx
+	adcl	$0,%ebx
+	movl	%ecx,40(%edi)
+	movl	28(%esi),%eax
+	# saved r[10] 
+	# ############### Calculate word 11 
+	xorl	%ecx,%ecx
+	# sqr a[7]*a[4] 
+	mull	%edx
+	addl	%eax,%eax
+	adcl	%edx,%edx
+	adcl	$0,%ecx
+	addl	%eax,%ebp
+	adcl	%edx,%ebx
+	movl	24(%esi),%eax
+	adcl	$0,%ecx
+	movl	20(%esi),%edx
+	# sqr a[6]*a[5] 
+	mull	%edx
+	addl	%eax,%eax
+	adcl	%edx,%edx
+	adcl	$0,%ecx
+	addl	%eax,%ebp
+	adcl	%edx,%ebx
+	movl	28(%esi),%eax
+	adcl	$0,%ecx
+	movl	%ebp,44(%edi)
+	movl	20(%esi),%edx
+	# saved r[11] 
+	# ############### Calculate word 12 
+	xorl	%ebp,%ebp
+	# sqr a[7]*a[5] 
+	mull	%edx
+	addl	%eax,%eax
+	adcl	%edx,%edx
+	adcl	$0,%ebp
+	addl	%eax,%ebx
+	adcl	%edx,%ecx
+	movl	24(%esi),%eax
+	adcl	$0,%ebp
+	# sqr a[6]*a[6] 
+	mull	%eax
+	addl	%eax,%ebx
+	adcl	%edx,%ecx
+	movl	24(%esi),%edx
+	adcl	$0,%ebp
+	movl	%ebx,48(%edi)
+	movl	28(%esi),%eax
+	# saved r[12] 
+	# ############### Calculate word 13 
+	xorl	%ebx,%ebx
+	# sqr a[7]*a[6] 
+	mull	%edx
+	addl	%eax,%eax
+	adcl	%edx,%edx
+	adcl	$0,%ebx
+	addl	%eax,%ecx
+	adcl	%edx,%ebp
+	movl	28(%esi),%eax
+	adcl	$0,%ebx
+	movl	%ecx,52(%edi)
+	# saved r[13] 
+	# ############### Calculate word 14 
+	xorl	%ecx,%ecx
+	# sqr a[7]*a[7] 
+	mull	%eax
+	addl	%eax,%ebp
+	adcl	%edx,%ebx
+	adcl	$0,%ecx
+	movl	%ebp,56(%edi)
+	# saved r[14] 
+	movl	%ebx,60(%edi)
+	popl	%ebx
+	popl	%ebp
+	popl	%edi
+	popl	%esi
+	ret
+.globl	_bn_sqr_comba4
+.private_extern	_bn_sqr_comba4
+.align	4
+_bn_sqr_comba4:
+L_bn_sqr_comba4_begin:
+	pushl	%esi
+	pushl	%edi
+	pushl	%ebp
+	pushl	%ebx
+	movl	20(%esp),%edi
+	movl	24(%esp),%esi
+	xorl	%ebx,%ebx
+	xorl	%ecx,%ecx
+	movl	(%esi),%eax
+	# ############### Calculate word 0 
+	xorl	%ebp,%ebp
+	# sqr a[0]*a[0] 
+	mull	%eax
+	addl	%eax,%ebx
+	adcl	%edx,%ecx
+	movl	(%esi),%edx
+	adcl	$0,%ebp
+	movl	%ebx,(%edi)
+	movl	4(%esi),%eax
+	# saved r[0] 
+	# ############### Calculate word 1 
+	xorl	%ebx,%ebx
+	# sqr a[1]*a[0] 
+	mull	%edx
+	addl	%eax,%eax
+	adcl	%edx,%edx
+	adcl	$0,%ebx
+	addl	%eax,%ecx
+	adcl	%edx,%ebp
+	movl	8(%esi),%eax
+	adcl	$0,%ebx
+	movl	%ecx,4(%edi)
+	movl	(%esi),%edx
+	# saved r[1] 
+	# ############### Calculate word 2 
+	xorl	%ecx,%ecx
+	# sqr a[2]*a[0] 
+	mull	%edx
+	addl	%eax,%eax
+	adcl	%edx,%edx
+	adcl	$0,%ecx
+	addl	%eax,%ebp
+	adcl	%edx,%ebx
+	movl	4(%esi),%eax
+	adcl	$0,%ecx
+	# sqr a[1]*a[1] 
+	mull	%eax
+	addl	%eax,%ebp
+	adcl	%edx,%ebx
+	movl	(%esi),%edx
+	adcl	$0,%ecx
+	movl	%ebp,8(%edi)
+	movl	12(%esi),%eax
+	# saved r[2] 
+	# ############### Calculate word 3 
+	xorl	%ebp,%ebp
+	# sqr a[3]*a[0] 
+	mull	%edx
+	addl	%eax,%eax
+	adcl	%edx,%edx
+	adcl	$0,%ebp
+	addl	%eax,%ebx
+	adcl	%edx,%ecx
+	movl	8(%esi),%eax
+	adcl	$0,%ebp
+	movl	4(%esi),%edx
+	# sqr a[2]*a[1] 
+	mull	%edx
+	addl	%eax,%eax
+	adcl	%edx,%edx
+	adcl	$0,%ebp
+	addl	%eax,%ebx
+	adcl	%edx,%ecx
+	movl	12(%esi),%eax
+	adcl	$0,%ebp
+	movl	%ebx,12(%edi)
+	movl	4(%esi),%edx
+	# saved r[3] 
+	# ############### Calculate word 4 
+	xorl	%ebx,%ebx
+	# sqr a[3]*a[1] 
+	mull	%edx
+	addl	%eax,%eax
+	adcl	%edx,%edx
+	adcl	$0,%ebx
+	addl	%eax,%ecx
+	adcl	%edx,%ebp
+	movl	8(%esi),%eax
+	adcl	$0,%ebx
+	# sqr a[2]*a[2] 
+	mull	%eax
+	addl	%eax,%ecx
+	adcl	%edx,%ebp
+	movl	8(%esi),%edx
+	adcl	$0,%ebx
+	movl	%ecx,16(%edi)
+	movl	12(%esi),%eax
+	# saved r[4] 
+	# ############### Calculate word 5 
+	xorl	%ecx,%ecx
+	# sqr a[3]*a[2] 
+	mull	%edx
+	addl	%eax,%eax
+	adcl	%edx,%edx
+	adcl	$0,%ecx
+	addl	%eax,%ebp
+	adcl	%edx,%ebx
+	movl	12(%esi),%eax
+	adcl	$0,%ecx
+	movl	%ebp,20(%edi)
+	# saved r[5] 
+	# ############### Calculate word 6 
+	xorl	%ebp,%ebp
+	# sqr a[3]*a[3] 
+	mull	%eax
+	addl	%eax,%ebx
+	adcl	%edx,%ecx
+	adcl	$0,%ebp
+	movl	%ebx,24(%edi)
+	# saved r[6] 
+	movl	%ecx,28(%edi)
+	popl	%ebx
+	popl	%ebp
+	popl	%edi
+	popl	%esi
+	ret
+#endif
diff --git a/third_party/boringssl/mac-x86/crypto/bn/x86-mont.S b/third_party/boringssl/mac-x86/crypto/bn/x86-mont.S
new file mode 100644
index 0000000..234034b
--- /dev/null
+++ b/third_party/boringssl/mac-x86/crypto/bn/x86-mont.S
@@ -0,0 +1,462 @@
+#if defined(__i386__)
+.file	"src/crypto/bn/asm/x86-mont.S"
+.text
+.globl	_bn_mul_mont
+.private_extern	_bn_mul_mont
+.align	4
+_bn_mul_mont:
+L_bn_mul_mont_begin:
+	pushl	%ebp
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+	xorl	%eax,%eax
+	movl	40(%esp),%edi
+	cmpl	$4,%edi
+	jl	L000just_leave
+	leal	20(%esp),%esi
+	leal	24(%esp),%edx
+	movl	%esp,%ebp
+	addl	$2,%edi
+	negl	%edi
+	leal	-32(%esp,%edi,4),%esp
+	negl	%edi
+	movl	%esp,%eax
+	subl	%edx,%eax
+	andl	$2047,%eax
+	subl	%eax,%esp
+	xorl	%esp,%edx
+	andl	$2048,%edx
+	xorl	$2048,%edx
+	subl	%edx,%esp
+	andl	$-64,%esp
+	movl	(%esi),%eax
+	movl	4(%esi),%ebx
+	movl	8(%esi),%ecx
+	movl	12(%esi),%edx
+	movl	16(%esi),%esi
+	movl	(%esi),%esi
+	movl	%eax,4(%esp)
+	movl	%ebx,8(%esp)
+	movl	%ecx,12(%esp)
+	movl	%edx,16(%esp)
+	movl	%esi,20(%esp)
+	leal	-3(%edi),%ebx
+	movl	%ebp,24(%esp)
+	call	L001PIC_me_up
+L001PIC_me_up:
+	popl	%eax
+	movl	L_OPENSSL_ia32cap_P$non_lazy_ptr-L001PIC_me_up(%eax),%eax
+	btl	$26,(%eax)
+	jnc	L002non_sse2
+	movl	$-1,%eax
+	movd	%eax,%mm7
+	movl	8(%esp),%esi
+	movl	12(%esp),%edi
+	movl	16(%esp),%ebp
+	xorl	%edx,%edx
+	xorl	%ecx,%ecx
+	movd	(%edi),%mm4
+	movd	(%esi),%mm5
+	movd	(%ebp),%mm3
+	pmuludq	%mm4,%mm5
+	movq	%mm5,%mm2
+	movq	%mm5,%mm0
+	pand	%mm7,%mm0
+	pmuludq	20(%esp),%mm5
+	pmuludq	%mm5,%mm3
+	paddq	%mm0,%mm3
+	movd	4(%ebp),%mm1
+	movd	4(%esi),%mm0
+	psrlq	$32,%mm2
+	psrlq	$32,%mm3
+	incl	%ecx
+.align	4,0x90
+L0031st:
+	pmuludq	%mm4,%mm0
+	pmuludq	%mm5,%mm1
+	paddq	%mm0,%mm2
+	paddq	%mm1,%mm3
+	movq	%mm2,%mm0
+	pand	%mm7,%mm0
+	movd	4(%ebp,%ecx,4),%mm1
+	paddq	%mm0,%mm3
+	movd	4(%esi,%ecx,4),%mm0
+	psrlq	$32,%mm2
+	movd	%mm3,28(%esp,%ecx,4)
+	psrlq	$32,%mm3
+	leal	1(%ecx),%ecx
+	cmpl	%ebx,%ecx
+	jl	L0031st
+	pmuludq	%mm4,%mm0
+	pmuludq	%mm5,%mm1
+	paddq	%mm0,%mm2
+	paddq	%mm1,%mm3
+	movq	%mm2,%mm0
+	pand	%mm7,%mm0
+	paddq	%mm0,%mm3
+	movd	%mm3,28(%esp,%ecx,4)
+	psrlq	$32,%mm2
+	psrlq	$32,%mm3
+	paddq	%mm2,%mm3
+	movq	%mm3,32(%esp,%ebx,4)
+	incl	%edx
+L004outer:
+	xorl	%ecx,%ecx
+	movd	(%edi,%edx,4),%mm4
+	movd	(%esi),%mm5
+	movd	32(%esp),%mm6
+	movd	(%ebp),%mm3
+	pmuludq	%mm4,%mm5
+	paddq	%mm6,%mm5
+	movq	%mm5,%mm0
+	movq	%mm5,%mm2
+	pand	%mm7,%mm0
+	pmuludq	20(%esp),%mm5
+	pmuludq	%mm5,%mm3
+	paddq	%mm0,%mm3
+	movd	36(%esp),%mm6
+	movd	4(%ebp),%mm1
+	movd	4(%esi),%mm0
+	psrlq	$32,%mm2
+	psrlq	$32,%mm3
+	paddq	%mm6,%mm2
+	incl	%ecx
+	decl	%ebx
+L005inner:
+	pmuludq	%mm4,%mm0
+	pmuludq	%mm5,%mm1
+	paddq	%mm0,%mm2
+	paddq	%mm1,%mm3
+	movq	%mm2,%mm0
+	movd	36(%esp,%ecx,4),%mm6
+	pand	%mm7,%mm0
+	movd	4(%ebp,%ecx,4),%mm1
+	paddq	%mm0,%mm3
+	movd	4(%esi,%ecx,4),%mm0
+	psrlq	$32,%mm2
+	movd	%mm3,28(%esp,%ecx,4)
+	psrlq	$32,%mm3
+	paddq	%mm6,%mm2
+	decl	%ebx
+	leal	1(%ecx),%ecx
+	jnz	L005inner
+	movl	%ecx,%ebx
+	pmuludq	%mm4,%mm0
+	pmuludq	%mm5,%mm1
+	paddq	%mm0,%mm2
+	paddq	%mm1,%mm3
+	movq	%mm2,%mm0
+	pand	%mm7,%mm0
+	paddq	%mm0,%mm3
+	movd	%mm3,28(%esp,%ecx,4)
+	psrlq	$32,%mm2
+	psrlq	$32,%mm3
+	movd	36(%esp,%ebx,4),%mm6
+	paddq	%mm2,%mm3
+	paddq	%mm6,%mm3
+	movq	%mm3,32(%esp,%ebx,4)
+	leal	1(%edx),%edx
+	cmpl	%ebx,%edx
+	jle	L004outer
+	emms
+	jmp	L006common_tail
+.align	4,0x90
+L002non_sse2:
+	movl	8(%esp),%esi
+	leal	1(%ebx),%ebp
+	movl	12(%esp),%edi
+	xorl	%ecx,%ecx
+	movl	%esi,%edx
+	andl	$1,%ebp
+	subl	%edi,%edx
+	leal	4(%edi,%ebx,4),%eax
+	orl	%edx,%ebp
+	movl	(%edi),%edi
+	jz	L007bn_sqr_mont
+	movl	%eax,28(%esp)
+	movl	(%esi),%eax
+	xorl	%edx,%edx
+.align	4,0x90
+L008mull:
+	movl	%edx,%ebp
+	mull	%edi
+	addl	%eax,%ebp
+	leal	1(%ecx),%ecx
+	adcl	$0,%edx
+	movl	(%esi,%ecx,4),%eax
+	cmpl	%ebx,%ecx
+	movl	%ebp,28(%esp,%ecx,4)
+	jl	L008mull
+	movl	%edx,%ebp
+	mull	%edi
+	movl	20(%esp),%edi
+	addl	%ebp,%eax
+	movl	16(%esp),%esi
+	adcl	$0,%edx
+	imull	32(%esp),%edi
+	movl	%eax,32(%esp,%ebx,4)
+	xorl	%ecx,%ecx
+	movl	%edx,36(%esp,%ebx,4)
+	movl	%ecx,40(%esp,%ebx,4)
+	movl	(%esi),%eax
+	mull	%edi
+	addl	32(%esp),%eax
+	movl	4(%esi),%eax
+	adcl	$0,%edx
+	incl	%ecx
+	jmp	L0092ndmadd
+.align	4,0x90
+L0101stmadd:
+	movl	%edx,%ebp
+	mull	%edi
+	addl	32(%esp,%ecx,4),%ebp
+	leal	1(%ecx),%ecx
+	adcl	$0,%edx
+	addl	%eax,%ebp
+	movl	(%esi,%ecx,4),%eax
+	adcl	$0,%edx
+	cmpl	%ebx,%ecx
+	movl	%ebp,28(%esp,%ecx,4)
+	jl	L0101stmadd
+	movl	%edx,%ebp
+	mull	%edi
+	addl	32(%esp,%ebx,4),%eax
+	movl	20(%esp),%edi
+	adcl	$0,%edx
+	movl	16(%esp),%esi
+	addl	%eax,%ebp
+	adcl	$0,%edx
+	imull	32(%esp),%edi
+	xorl	%ecx,%ecx
+	addl	36(%esp,%ebx,4),%edx
+	movl	%ebp,32(%esp,%ebx,4)
+	adcl	$0,%ecx
+	movl	(%esi),%eax
+	movl	%edx,36(%esp,%ebx,4)
+	movl	%ecx,40(%esp,%ebx,4)
+	mull	%edi
+	addl	32(%esp),%eax
+	movl	4(%esi),%eax
+	adcl	$0,%edx
+	movl	$1,%ecx
+.align	4,0x90
+L0092ndmadd:
+	movl	%edx,%ebp
+	mull	%edi
+	addl	32(%esp,%ecx,4),%ebp
+	leal	1(%ecx),%ecx
+	adcl	$0,%edx
+	addl	%eax,%ebp
+	movl	(%esi,%ecx,4),%eax
+	adcl	$0,%edx
+	cmpl	%ebx,%ecx
+	movl	%ebp,24(%esp,%ecx,4)
+	jl	L0092ndmadd
+	movl	%edx,%ebp
+	mull	%edi
+	addl	32(%esp,%ebx,4),%ebp
+	adcl	$0,%edx
+	addl	%eax,%ebp
+	adcl	$0,%edx
+	movl	%ebp,28(%esp,%ebx,4)
+	xorl	%eax,%eax
+	movl	12(%esp),%ecx
+	addl	36(%esp,%ebx,4),%edx
+	adcl	40(%esp,%ebx,4),%eax
+	leal	4(%ecx),%ecx
+	movl	%edx,32(%esp,%ebx,4)
+	cmpl	28(%esp),%ecx
+	movl	%eax,36(%esp,%ebx,4)
+	je	L006common_tail
+	movl	(%ecx),%edi
+	movl	8(%esp),%esi
+	movl	%ecx,12(%esp)
+	xorl	%ecx,%ecx
+	xorl	%edx,%edx
+	movl	(%esi),%eax
+	jmp	L0101stmadd
+.align	4,0x90
+L007bn_sqr_mont:
+	movl	%ebx,(%esp)
+	movl	%ecx,12(%esp)
+	movl	%edi,%eax
+	mull	%edi
+	movl	%eax,32(%esp)
+	movl	%edx,%ebx
+	shrl	$1,%edx
+	andl	$1,%ebx
+	incl	%ecx
+.align	4,0x90
+L011sqr:
+	movl	(%esi,%ecx,4),%eax
+	movl	%edx,%ebp
+	mull	%edi
+	addl	%ebp,%eax
+	leal	1(%ecx),%ecx
+	adcl	$0,%edx
+	leal	(%ebx,%eax,2),%ebp
+	shrl	$31,%eax
+	cmpl	(%esp),%ecx
+	movl	%eax,%ebx
+	movl	%ebp,28(%esp,%ecx,4)
+	jl	L011sqr
+	movl	(%esi,%ecx,4),%eax
+	movl	%edx,%ebp
+	mull	%edi
+	addl	%ebp,%eax
+	movl	20(%esp),%edi
+	adcl	$0,%edx
+	movl	16(%esp),%esi
+	leal	(%ebx,%eax,2),%ebp
+	imull	32(%esp),%edi
+	shrl	$31,%eax
+	movl	%ebp,32(%esp,%ecx,4)
+	leal	(%eax,%edx,2),%ebp
+	movl	(%esi),%eax
+	shrl	$31,%edx
+	movl	%ebp,36(%esp,%ecx,4)
+	movl	%edx,40(%esp,%ecx,4)
+	mull	%edi
+	addl	32(%esp),%eax
+	movl	%ecx,%ebx
+	adcl	$0,%edx
+	movl	4(%esi),%eax
+	movl	$1,%ecx
+.align	4,0x90
+L0123rdmadd:
+	movl	%edx,%ebp
+	mull	%edi
+	addl	32(%esp,%ecx,4),%ebp
+	adcl	$0,%edx
+	addl	%eax,%ebp
+	movl	4(%esi,%ecx,4),%eax
+	adcl	$0,%edx
+	movl	%ebp,28(%esp,%ecx,4)
+	movl	%edx,%ebp
+	mull	%edi
+	addl	36(%esp,%ecx,4),%ebp
+	leal	2(%ecx),%ecx
+	adcl	$0,%edx
+	addl	%eax,%ebp
+	movl	(%esi,%ecx,4),%eax
+	adcl	$0,%edx
+	cmpl	%ebx,%ecx
+	movl	%ebp,24(%esp,%ecx,4)
+	jl	L0123rdmadd
+	movl	%edx,%ebp
+	mull	%edi
+	addl	32(%esp,%ebx,4),%ebp
+	adcl	$0,%edx
+	addl	%eax,%ebp
+	adcl	$0,%edx
+	movl	%ebp,28(%esp,%ebx,4)
+	movl	12(%esp),%ecx
+	xorl	%eax,%eax
+	movl	8(%esp),%esi
+	addl	36(%esp,%ebx,4),%edx
+	adcl	40(%esp,%ebx,4),%eax
+	movl	%edx,32(%esp,%ebx,4)
+	cmpl	%ebx,%ecx
+	movl	%eax,36(%esp,%ebx,4)
+	je	L006common_tail
+	movl	4(%esi,%ecx,4),%edi
+	leal	1(%ecx),%ecx
+	movl	%edi,%eax
+	movl	%ecx,12(%esp)
+	mull	%edi
+	addl	32(%esp,%ecx,4),%eax
+	adcl	$0,%edx
+	movl	%eax,32(%esp,%ecx,4)
+	xorl	%ebp,%ebp
+	cmpl	%ebx,%ecx
+	leal	1(%ecx),%ecx
+	je	L013sqrlast
+	movl	%edx,%ebx
+	shrl	$1,%edx
+	andl	$1,%ebx
+.align	4,0x90
+L014sqradd:
+	movl	(%esi,%ecx,4),%eax
+	movl	%edx,%ebp
+	mull	%edi
+	addl	%ebp,%eax
+	leal	(%eax,%eax,1),%ebp
+	adcl	$0,%edx
+	shrl	$31,%eax
+	addl	32(%esp,%ecx,4),%ebp
+	leal	1(%ecx),%ecx
+	adcl	$0,%eax
+	addl	%ebx,%ebp
+	adcl	$0,%eax
+	cmpl	(%esp),%ecx
+	movl	%ebp,28(%esp,%ecx,4)
+	movl	%eax,%ebx
+	jle	L014sqradd
+	movl	%edx,%ebp
+	addl	%edx,%edx
+	shrl	$31,%ebp
+	addl	%ebx,%edx
+	adcl	$0,%ebp
+L013sqrlast:
+	movl	20(%esp),%edi
+	movl	16(%esp),%esi
+	imull	32(%esp),%edi
+	addl	32(%esp,%ecx,4),%edx
+	movl	(%esi),%eax
+	adcl	$0,%ebp
+	movl	%edx,32(%esp,%ecx,4)
+	movl	%ebp,36(%esp,%ecx,4)
+	mull	%edi
+	addl	32(%esp),%eax
+	leal	-1(%ecx),%ebx
+	adcl	$0,%edx
+	movl	$1,%ecx
+	movl	4(%esi),%eax
+	jmp	L0123rdmadd
+.align	4,0x90
+L006common_tail:
+	movl	16(%esp),%ebp
+	movl	4(%esp),%edi
+	leal	32(%esp),%esi
+	movl	(%esi),%eax
+	movl	%ebx,%ecx
+	xorl	%edx,%edx
+.align	4,0x90
+L015sub:
+	sbbl	(%ebp,%edx,4),%eax
+	movl	%eax,(%edi,%edx,4)
+	decl	%ecx
+	movl	4(%esi,%edx,4),%eax
+	leal	1(%edx),%edx
+	jge	L015sub
+	sbbl	$0,%eax
+.align	4,0x90
+L016copy:
+	movl	(%esi,%ebx,4),%edx
+	movl	(%edi,%ebx,4),%ebp
+	xorl	%ebp,%edx
+	andl	%eax,%edx
+	xorl	%ebp,%edx
+	movl	%ecx,(%esi,%ebx,4)
+	movl	%edx,(%edi,%ebx,4)
+	decl	%ebx
+	jge	L016copy
+	movl	24(%esp),%esp
+	movl	$1,%eax
+L000just_leave:
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.byte	77,111,110,116,103,111,109,101,114,121,32,77,117,108,116,105
+.byte	112,108,105,99,97,116,105,111,110,32,102,111,114,32,120,56
+.byte	54,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121
+.byte	32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46
+.byte	111,114,103,62,0
+.section __IMPORT,__pointers,non_lazy_symbol_pointers
+L_OPENSSL_ia32cap_P$non_lazy_ptr:
+.indirect_symbol	_OPENSSL_ia32cap_P
+.long	0
+#endif
diff --git a/third_party/boringssl/mac-x86/crypto/cpu-x86-asm.S b/third_party/boringssl/mac-x86/crypto/cpu-x86-asm.S
new file mode 100644
index 0000000..bfb292c
--- /dev/null
+++ b/third_party/boringssl/mac-x86/crypto/cpu-x86-asm.S
@@ -0,0 +1,309 @@
+#if defined(__i386__)
+.file	"crypto/cpu-x86-asm.S"
+.text
+.globl	_OPENSSL_ia32_cpuid
+.private_extern	_OPENSSL_ia32_cpuid
+.align	4
+_OPENSSL_ia32_cpuid:
+L_OPENSSL_ia32_cpuid_begin:
+	pushl	%ebp
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+	xorl	%edx,%edx
+	pushfl
+	popl	%eax
+	movl	%eax,%ecx
+	xorl	$2097152,%eax
+	pushl	%eax
+	popfl
+	pushfl
+	popl	%eax
+	xorl	%eax,%ecx
+	xorl	%eax,%eax
+	btl	$21,%ecx
+	jnc	L000nocpuid
+	movl	20(%esp),%esi
+	movl	%eax,8(%esi)
+	.byte	0x0f,0xa2
+	movl	%eax,%edi
+	xorl	%eax,%eax
+	cmpl	$1970169159,%ebx
+	setne	%al
+	movl	%eax,%ebp
+	cmpl	$1231384169,%edx
+	setne	%al
+	orl	%eax,%ebp
+	cmpl	$1818588270,%ecx
+	setne	%al
+	orl	%eax,%ebp
+	jz	L001intel
+	cmpl	$1752462657,%ebx
+	setne	%al
+	movl	%eax,%esi
+	cmpl	$1769238117,%edx
+	setne	%al
+	orl	%eax,%esi
+	cmpl	$1145913699,%ecx
+	setne	%al
+	orl	%eax,%esi
+	jnz	L001intel
+	movl	$2147483648,%eax
+	.byte	0x0f,0xa2
+	cmpl	$2147483649,%eax
+	jb	L001intel
+	movl	%eax,%esi
+	movl	$2147483649,%eax
+	.byte	0x0f,0xa2
+	orl	%ecx,%ebp
+	andl	$2049,%ebp
+	cmpl	$2147483656,%esi
+	jb	L001intel
+	movl	$2147483656,%eax
+	.byte	0x0f,0xa2
+	movzbl	%cl,%esi
+	incl	%esi
+	movl	$1,%eax
+	xorl	%ecx,%ecx
+	.byte	0x0f,0xa2
+	btl	$28,%edx
+	jnc	L002generic
+	shrl	$16,%ebx
+	andl	$255,%ebx
+	cmpl	%esi,%ebx
+	ja	L002generic
+	andl	$4026531839,%edx
+	jmp	L002generic
+L001intel:
+	cmpl	$7,%edi
+	jb	L003cacheinfo
+	movl	20(%esp),%esi
+	movl	$7,%eax
+	xorl	%ecx,%ecx
+	.byte	0x0f,0xa2
+	movl	%ebx,8(%esi)
+L003cacheinfo:
+	cmpl	$4,%edi
+	movl	$-1,%edi
+	jb	L004nocacheinfo
+	movl	$4,%eax
+	movl	$0,%ecx
+	.byte	0x0f,0xa2
+	movl	%eax,%edi
+	shrl	$14,%edi
+	andl	$4095,%edi
+L004nocacheinfo:
+	movl	$1,%eax
+	xorl	%ecx,%ecx
+	.byte	0x0f,0xa2
+	andl	$3220176895,%edx
+	cmpl	$0,%ebp
+	jne	L005notintel
+	orl	$1073741824,%edx
+L005notintel:
+	btl	$28,%edx
+	jnc	L002generic
+	andl	$4026531839,%edx
+	cmpl	$0,%edi
+	je	L002generic
+	orl	$268435456,%edx
+	shrl	$16,%ebx
+	cmpb	$1,%bl
+	ja	L002generic
+	andl	$4026531839,%edx
+L002generic:
+	andl	$2048,%ebp
+	andl	$4294965247,%ecx
+	movl	%edx,%esi
+	orl	%ecx,%ebp
+	btl	$27,%ecx
+	jnc	L006clear_avx
+	xorl	%ecx,%ecx
+.byte	15,1,208
+	andl	$6,%eax
+	cmpl	$6,%eax
+	je	L007done
+	cmpl	$2,%eax
+	je	L006clear_avx
+L008clear_xmm:
+	andl	$4261412861,%ebp
+	andl	$4278190079,%esi
+L006clear_avx:
+	andl	$4026525695,%ebp
+	movl	20(%esp),%edi
+	andl	$4294967263,8(%edi)
+L007done:
+	movl	%esi,%eax
+	movl	%ebp,%edx
+L000nocpuid:
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.globl	_OPENSSL_rdtsc
+.private_extern	_OPENSSL_rdtsc
+.align	4
+_OPENSSL_rdtsc:
+L_OPENSSL_rdtsc_begin:
+	xorl	%eax,%eax
+	xorl	%edx,%edx
+	call	L009PIC_me_up
+L009PIC_me_up:
+	popl	%ecx
+	movl	L_OPENSSL_ia32cap_P$non_lazy_ptr-L009PIC_me_up(%ecx),%ecx
+	btl	$4,(%ecx)
+	jnc	L010notsc
+	.byte	0x0f,0x31
+L010notsc:
+	ret
+.globl	_OPENSSL_instrument_halt
+.private_extern	_OPENSSL_instrument_halt
+.align	4
+_OPENSSL_instrument_halt:
+L_OPENSSL_instrument_halt_begin:
+	call	L011PIC_me_up
+L011PIC_me_up:
+	popl	%ecx
+	movl	L_OPENSSL_ia32cap_P$non_lazy_ptr-L011PIC_me_up(%ecx),%ecx
+	btl	$4,(%ecx)
+	jnc	L012nohalt
+.long	2421723150
+	andl	$3,%eax
+	jnz	L012nohalt
+	pushfl
+	popl	%eax
+	btl	$9,%eax
+	jnc	L012nohalt
+	.byte	0x0f,0x31
+	pushl	%edx
+	pushl	%eax
+	hlt
+	.byte	0x0f,0x31
+	subl	(%esp),%eax
+	sbbl	4(%esp),%edx
+	addl	$8,%esp
+	ret
+L012nohalt:
+	xorl	%eax,%eax
+	xorl	%edx,%edx
+	ret
+.globl	_OPENSSL_far_spin
+.private_extern	_OPENSSL_far_spin
+.align	4
+_OPENSSL_far_spin:
+L_OPENSSL_far_spin_begin:
+	pushfl
+	popl	%eax
+	btl	$9,%eax
+	jnc	L013nospin
+	movl	4(%esp),%eax
+	movl	8(%esp),%ecx
+.long	2430111262
+	xorl	%eax,%eax
+	movl	(%ecx),%edx
+	jmp	L014spin
+.align	4,0x90
+L014spin:
+	incl	%eax
+	cmpl	(%ecx),%edx
+	je	L014spin
+.long	529567888
+	ret
+L013nospin:
+	xorl	%eax,%eax
+	xorl	%edx,%edx
+	ret
+.globl	_OPENSSL_wipe_cpu
+.private_extern	_OPENSSL_wipe_cpu
+.align	4
+_OPENSSL_wipe_cpu:
+L_OPENSSL_wipe_cpu_begin:
+	xorl	%eax,%eax
+	xorl	%edx,%edx
+	call	L015PIC_me_up
+L015PIC_me_up:
+	popl	%ecx
+	movl	L_OPENSSL_ia32cap_P$non_lazy_ptr-L015PIC_me_up(%ecx),%ecx
+	movl	(%ecx),%ecx
+	btl	$1,(%ecx)
+	jnc	L016no_x87
+	andl	$83886080,%ecx
+	cmpl	$83886080,%ecx
+	jne	L017no_sse2
+	pxor	%xmm0,%xmm0
+	pxor	%xmm1,%xmm1
+	pxor	%xmm2,%xmm2
+	pxor	%xmm3,%xmm3
+	pxor	%xmm4,%xmm4
+	pxor	%xmm5,%xmm5
+	pxor	%xmm6,%xmm6
+	pxor	%xmm7,%xmm7
+L017no_sse2:
+.long	4007259865,4007259865,4007259865,4007259865,2430851995
+L016no_x87:
+	leal	4(%esp),%eax
+	ret
+.globl	_OPENSSL_atomic_add
+.private_extern	_OPENSSL_atomic_add
+.align	4
+_OPENSSL_atomic_add:
+L_OPENSSL_atomic_add_begin:
+	movl	4(%esp),%edx
+	movl	8(%esp),%ecx
+	pushl	%ebx
+	nop
+	movl	(%edx),%eax
+L018spin:
+	leal	(%eax,%ecx,1),%ebx
+	nop
+.long	447811568
+	jne	L018spin
+	movl	%ebx,%eax
+	popl	%ebx
+	ret
+.globl	_OPENSSL_indirect_call
+.private_extern	_OPENSSL_indirect_call
+.align	4
+_OPENSSL_indirect_call:
+L_OPENSSL_indirect_call_begin:
+	pushl	%ebp
+	movl	%esp,%ebp
+	subl	$28,%esp
+	movl	12(%ebp),%ecx
+	movl	%ecx,(%esp)
+	movl	16(%ebp),%edx
+	movl	%edx,4(%esp)
+	movl	20(%ebp),%eax
+	movl	%eax,8(%esp)
+	movl	24(%ebp),%eax
+	movl	%eax,12(%esp)
+	movl	28(%ebp),%eax
+	movl	%eax,16(%esp)
+	movl	32(%ebp),%eax
+	movl	%eax,20(%esp)
+	movl	36(%ebp),%eax
+	movl	%eax,24(%esp)
+	call	*8(%ebp)
+	movl	%ebp,%esp
+	popl	%ebp
+	ret
+.globl	_OPENSSL_ia32_rdrand
+.private_extern	_OPENSSL_ia32_rdrand
+.align	4
+_OPENSSL_ia32_rdrand:
+L_OPENSSL_ia32_rdrand_begin:
+	movl	$8,%ecx
+L019loop:
+.byte	15,199,240
+	jc	L020break
+	loop	L019loop
+L020break:
+	cmpl	$0,%eax
+	cmovel	%ecx,%eax
+	ret
+.section __IMPORT,__pointers,non_lazy_symbol_pointers
+L_OPENSSL_ia32cap_P$non_lazy_ptr:
+.indirect_symbol	_OPENSSL_ia32cap_P
+.long	0
+#endif
diff --git a/third_party/boringssl/mac-x86/crypto/md5/md5-586.S b/third_party/boringssl/mac-x86/crypto/md5/md5-586.S
new file mode 100644
index 0000000..6830b16
--- /dev/null
+++ b/third_party/boringssl/mac-x86/crypto/md5/md5-586.S
@@ -0,0 +1,680 @@
+#if defined(__i386__)
+.file	"src/crypto/md5/asm/md5-586.S"
+.text
+.globl	_md5_block_asm_data_order
+.private_extern	_md5_block_asm_data_order
+.align	4
+_md5_block_asm_data_order:
+L_md5_block_asm_data_order_begin:
+	pushl	%esi
+	pushl	%edi
+	movl	12(%esp),%edi
+	movl	16(%esp),%esi
+	movl	20(%esp),%ecx
+	pushl	%ebp
+	shll	$6,%ecx
+	pushl	%ebx
+	addl	%esi,%ecx
+	subl	$64,%ecx
+	movl	(%edi),%eax
+	pushl	%ecx
+	movl	4(%edi),%ebx
+	movl	8(%edi),%ecx
+	movl	12(%edi),%edx
+L000start:
+
+	# R0 section 
+	movl	%ecx,%edi
+	movl	(%esi),%ebp
+	# R0 0 
+	xorl	%edx,%edi
+	andl	%ebx,%edi
+	leal	3614090360(%eax,%ebp,1),%eax
+	xorl	%edx,%edi
+	addl	%edi,%eax
+	movl	%ebx,%edi
+	roll	$7,%eax
+	movl	4(%esi),%ebp
+	addl	%ebx,%eax
+	# R0 1 
+	xorl	%ecx,%edi
+	andl	%eax,%edi
+	leal	3905402710(%edx,%ebp,1),%edx
+	xorl	%ecx,%edi
+	addl	%edi,%edx
+	movl	%eax,%edi
+	roll	$12,%edx
+	movl	8(%esi),%ebp
+	addl	%eax,%edx
+	# R0 2 
+	xorl	%ebx,%edi
+	andl	%edx,%edi
+	leal	606105819(%ecx,%ebp,1),%ecx
+	xorl	%ebx,%edi
+	addl	%edi,%ecx
+	movl	%edx,%edi
+	roll	$17,%ecx
+	movl	12(%esi),%ebp
+	addl	%edx,%ecx
+	# R0 3 
+	xorl	%eax,%edi
+	andl	%ecx,%edi
+	leal	3250441966(%ebx,%ebp,1),%ebx
+	xorl	%eax,%edi
+	addl	%edi,%ebx
+	movl	%ecx,%edi
+	roll	$22,%ebx
+	movl	16(%esi),%ebp
+	addl	%ecx,%ebx
+	# R0 4 
+	xorl	%edx,%edi
+	andl	%ebx,%edi
+	leal	4118548399(%eax,%ebp,1),%eax
+	xorl	%edx,%edi
+	addl	%edi,%eax
+	movl	%ebx,%edi
+	roll	$7,%eax
+	movl	20(%esi),%ebp
+	addl	%ebx,%eax
+	# R0 5 
+	xorl	%ecx,%edi
+	andl	%eax,%edi
+	leal	1200080426(%edx,%ebp,1),%edx
+	xorl	%ecx,%edi
+	addl	%edi,%edx
+	movl	%eax,%edi
+	roll	$12,%edx
+	movl	24(%esi),%ebp
+	addl	%eax,%edx
+	# R0 6 
+	xorl	%ebx,%edi
+	andl	%edx,%edi
+	leal	2821735955(%ecx,%ebp,1),%ecx
+	xorl	%ebx,%edi
+	addl	%edi,%ecx
+	movl	%edx,%edi
+	roll	$17,%ecx
+	movl	28(%esi),%ebp
+	addl	%edx,%ecx
+	# R0 7 
+	xorl	%eax,%edi
+	andl	%ecx,%edi
+	leal	4249261313(%ebx,%ebp,1),%ebx
+	xorl	%eax,%edi
+	addl	%edi,%ebx
+	movl	%ecx,%edi
+	roll	$22,%ebx
+	movl	32(%esi),%ebp
+	addl	%ecx,%ebx
+	# R0 8 
+	xorl	%edx,%edi
+	andl	%ebx,%edi
+	leal	1770035416(%eax,%ebp,1),%eax
+	xorl	%edx,%edi
+	addl	%edi,%eax
+	movl	%ebx,%edi
+	roll	$7,%eax
+	movl	36(%esi),%ebp
+	addl	%ebx,%eax
+	# R0 9 
+	xorl	%ecx,%edi
+	andl	%eax,%edi
+	leal	2336552879(%edx,%ebp,1),%edx
+	xorl	%ecx,%edi
+	addl	%edi,%edx
+	movl	%eax,%edi
+	roll	$12,%edx
+	movl	40(%esi),%ebp
+	addl	%eax,%edx
+	# R0 10 
+	xorl	%ebx,%edi
+	andl	%edx,%edi
+	leal	4294925233(%ecx,%ebp,1),%ecx
+	xorl	%ebx,%edi
+	addl	%edi,%ecx
+	movl	%edx,%edi
+	roll	$17,%ecx
+	movl	44(%esi),%ebp
+	addl	%edx,%ecx
+	# R0 11 
+	xorl	%eax,%edi
+	andl	%ecx,%edi
+	leal	2304563134(%ebx,%ebp,1),%ebx
+	xorl	%eax,%edi
+	addl	%edi,%ebx
+	movl	%ecx,%edi
+	roll	$22,%ebx
+	movl	48(%esi),%ebp
+	addl	%ecx,%ebx
+	# R0 12 
+	xorl	%edx,%edi
+	andl	%ebx,%edi
+	leal	1804603682(%eax,%ebp,1),%eax
+	xorl	%edx,%edi
+	addl	%edi,%eax
+	movl	%ebx,%edi
+	roll	$7,%eax
+	movl	52(%esi),%ebp
+	addl	%ebx,%eax
+	# R0 13 
+	xorl	%ecx,%edi
+	andl	%eax,%edi
+	leal	4254626195(%edx,%ebp,1),%edx
+	xorl	%ecx,%edi
+	addl	%edi,%edx
+	movl	%eax,%edi
+	roll	$12,%edx
+	movl	56(%esi),%ebp
+	addl	%eax,%edx
+	# R0 14 
+	xorl	%ebx,%edi
+	andl	%edx,%edi
+	leal	2792965006(%ecx,%ebp,1),%ecx
+	xorl	%ebx,%edi
+	addl	%edi,%ecx
+	movl	%edx,%edi
+	roll	$17,%ecx
+	movl	60(%esi),%ebp
+	addl	%edx,%ecx
+	# R0 15 
+	xorl	%eax,%edi
+	andl	%ecx,%edi
+	leal	1236535329(%ebx,%ebp,1),%ebx
+	xorl	%eax,%edi
+	addl	%edi,%ebx
+	movl	%ecx,%edi
+	roll	$22,%ebx
+	movl	4(%esi),%ebp
+	addl	%ecx,%ebx
+
+	# R1 section 
+	# R1 16 
+	leal	4129170786(%eax,%ebp,1),%eax
+	xorl	%ebx,%edi
+	andl	%edx,%edi
+	movl	24(%esi),%ebp
+	xorl	%ecx,%edi
+	addl	%edi,%eax
+	movl	%ebx,%edi
+	roll	$5,%eax
+	addl	%ebx,%eax
+	# R1 17 
+	leal	3225465664(%edx,%ebp,1),%edx
+	xorl	%eax,%edi
+	andl	%ecx,%edi
+	movl	44(%esi),%ebp
+	xorl	%ebx,%edi
+	addl	%edi,%edx
+	movl	%eax,%edi
+	roll	$9,%edx
+	addl	%eax,%edx
+	# R1 18 
+	leal	643717713(%ecx,%ebp,1),%ecx
+	xorl	%edx,%edi
+	andl	%ebx,%edi
+	movl	(%esi),%ebp
+	xorl	%eax,%edi
+	addl	%edi,%ecx
+	movl	%edx,%edi
+	roll	$14,%ecx
+	addl	%edx,%ecx
+	# R1 19 
+	leal	3921069994(%ebx,%ebp,1),%ebx
+	xorl	%ecx,%edi
+	andl	%eax,%edi
+	movl	20(%esi),%ebp
+	xorl	%edx,%edi
+	addl	%edi,%ebx
+	movl	%ecx,%edi
+	roll	$20,%ebx
+	addl	%ecx,%ebx
+	# R1 20 
+	leal	3593408605(%eax,%ebp,1),%eax
+	xorl	%ebx,%edi
+	andl	%edx,%edi
+	movl	40(%esi),%ebp
+	xorl	%ecx,%edi
+	addl	%edi,%eax
+	movl	%ebx,%edi
+	roll	$5,%eax
+	addl	%ebx,%eax
+	# R1 21 
+	leal	38016083(%edx,%ebp,1),%edx
+	xorl	%eax,%edi
+	andl	%ecx,%edi
+	movl	60(%esi),%ebp
+	xorl	%ebx,%edi
+	addl	%edi,%edx
+	movl	%eax,%edi
+	roll	$9,%edx
+	addl	%eax,%edx
+	# R1 22 
+	leal	3634488961(%ecx,%ebp,1),%ecx
+	xorl	%edx,%edi
+	andl	%ebx,%edi
+	movl	16(%esi),%ebp
+	xorl	%eax,%edi
+	addl	%edi,%ecx
+	movl	%edx,%edi
+	roll	$14,%ecx
+	addl	%edx,%ecx
+	# R1 23 
+	leal	3889429448(%ebx,%ebp,1),%ebx
+	xorl	%ecx,%edi
+	andl	%eax,%edi
+	movl	36(%esi),%ebp
+	xorl	%edx,%edi
+	addl	%edi,%ebx
+	movl	%ecx,%edi
+	roll	$20,%ebx
+	addl	%ecx,%ebx
+	# R1 24 
+	leal	568446438(%eax,%ebp,1),%eax
+	xorl	%ebx,%edi
+	andl	%edx,%edi
+	movl	56(%esi),%ebp
+	xorl	%ecx,%edi
+	addl	%edi,%eax
+	movl	%ebx,%edi
+	roll	$5,%eax
+	addl	%ebx,%eax
+	# R1 25 
+	leal	3275163606(%edx,%ebp,1),%edx
+	xorl	%eax,%edi
+	andl	%ecx,%edi
+	movl	12(%esi),%ebp
+	xorl	%ebx,%edi
+	addl	%edi,%edx
+	movl	%eax,%edi
+	roll	$9,%edx
+	addl	%eax,%edx
+	# R1 26 
+	leal	4107603335(%ecx,%ebp,1),%ecx
+	xorl	%edx,%edi
+	andl	%ebx,%edi
+	movl	32(%esi),%ebp
+	xorl	%eax,%edi
+	addl	%edi,%ecx
+	movl	%edx,%edi
+	roll	$14,%ecx
+	addl	%edx,%ecx
+	# R1 27 
+	leal	1163531501(%ebx,%ebp,1),%ebx
+	xorl	%ecx,%edi
+	andl	%eax,%edi
+	movl	52(%esi),%ebp
+	xorl	%edx,%edi
+	addl	%edi,%ebx
+	movl	%ecx,%edi
+	roll	$20,%ebx
+	addl	%ecx,%ebx
+	# R1 28 
+	leal	2850285829(%eax,%ebp,1),%eax
+	xorl	%ebx,%edi
+	andl	%edx,%edi
+	movl	8(%esi),%ebp
+	xorl	%ecx,%edi
+	addl	%edi,%eax
+	movl	%ebx,%edi
+	roll	$5,%eax
+	addl	%ebx,%eax
+	# R1 29 
+	leal	4243563512(%edx,%ebp,1),%edx
+	xorl	%eax,%edi
+	andl	%ecx,%edi
+	movl	28(%esi),%ebp
+	xorl	%ebx,%edi
+	addl	%edi,%edx
+	movl	%eax,%edi
+	roll	$9,%edx
+	addl	%eax,%edx
+	# R1 30 
+	leal	1735328473(%ecx,%ebp,1),%ecx
+	xorl	%edx,%edi
+	andl	%ebx,%edi
+	movl	48(%esi),%ebp
+	xorl	%eax,%edi
+	addl	%edi,%ecx
+	movl	%edx,%edi
+	roll	$14,%ecx
+	addl	%edx,%ecx
+	# R1 31 
+	leal	2368359562(%ebx,%ebp,1),%ebx
+	xorl	%ecx,%edi
+	andl	%eax,%edi
+	movl	20(%esi),%ebp
+	xorl	%edx,%edi
+	addl	%edi,%ebx
+	movl	%ecx,%edi
+	roll	$20,%ebx
+	addl	%ecx,%ebx
+
+	# R2 section 
+	# R2 32 
+	xorl	%edx,%edi
+	xorl	%ebx,%edi
+	leal	4294588738(%eax,%ebp,1),%eax
+	addl	%edi,%eax
+	roll	$4,%eax
+	movl	32(%esi),%ebp
+	movl	%ebx,%edi
+	# R2 33 
+	leal	2272392833(%edx,%ebp,1),%edx
+	addl	%ebx,%eax
+	xorl	%ecx,%edi
+	xorl	%eax,%edi
+	movl	44(%esi),%ebp
+	addl	%edi,%edx
+	movl	%eax,%edi
+	roll	$11,%edx
+	addl	%eax,%edx
+	# R2 34 
+	xorl	%ebx,%edi
+	xorl	%edx,%edi
+	leal	1839030562(%ecx,%ebp,1),%ecx
+	addl	%edi,%ecx
+	roll	$16,%ecx
+	movl	56(%esi),%ebp
+	movl	%edx,%edi
+	# R2 35 
+	leal	4259657740(%ebx,%ebp,1),%ebx
+	addl	%edx,%ecx
+	xorl	%eax,%edi
+	xorl	%ecx,%edi
+	movl	4(%esi),%ebp
+	addl	%edi,%ebx
+	movl	%ecx,%edi
+	roll	$23,%ebx
+	addl	%ecx,%ebx
+	# R2 36 
+	xorl	%edx,%edi
+	xorl	%ebx,%edi
+	leal	2763975236(%eax,%ebp,1),%eax
+	addl	%edi,%eax
+	roll	$4,%eax
+	movl	16(%esi),%ebp
+	movl	%ebx,%edi
+	# R2 37 
+	leal	1272893353(%edx,%ebp,1),%edx
+	addl	%ebx,%eax
+	xorl	%ecx,%edi
+	xorl	%eax,%edi
+	movl	28(%esi),%ebp
+	addl	%edi,%edx
+	movl	%eax,%edi
+	roll	$11,%edx
+	addl	%eax,%edx
+	# R2 38 
+	xorl	%ebx,%edi
+	xorl	%edx,%edi
+	leal	4139469664(%ecx,%ebp,1),%ecx
+	addl	%edi,%ecx
+	roll	$16,%ecx
+	movl	40(%esi),%ebp
+	movl	%edx,%edi
+	# R2 39 
+	leal	3200236656(%ebx,%ebp,1),%ebx
+	addl	%edx,%ecx
+	xorl	%eax,%edi
+	xorl	%ecx,%edi
+	movl	52(%esi),%ebp
+	addl	%edi,%ebx
+	movl	%ecx,%edi
+	roll	$23,%ebx
+	addl	%ecx,%ebx
+	# R2 40 
+	xorl	%edx,%edi
+	xorl	%ebx,%edi
+	leal	681279174(%eax,%ebp,1),%eax
+	addl	%edi,%eax
+	roll	$4,%eax
+	movl	(%esi),%ebp
+	movl	%ebx,%edi
+	# R2 41 
+	leal	3936430074(%edx,%ebp,1),%edx
+	addl	%ebx,%eax
+	xorl	%ecx,%edi
+	xorl	%eax,%edi
+	movl	12(%esi),%ebp
+	addl	%edi,%edx
+	movl	%eax,%edi
+	roll	$11,%edx
+	addl	%eax,%edx
+	# R2 42 
+	xorl	%ebx,%edi
+	xorl	%edx,%edi
+	leal	3572445317(%ecx,%ebp,1),%ecx
+	addl	%edi,%ecx
+	roll	$16,%ecx
+	movl	24(%esi),%ebp
+	movl	%edx,%edi
+	# R2 43 
+	leal	76029189(%ebx,%ebp,1),%ebx
+	addl	%edx,%ecx
+	xorl	%eax,%edi
+	xorl	%ecx,%edi
+	movl	36(%esi),%ebp
+	addl	%edi,%ebx
+	movl	%ecx,%edi
+	roll	$23,%ebx
+	addl	%ecx,%ebx
+	# R2 44 
+	xorl	%edx,%edi
+	xorl	%ebx,%edi
+	leal	3654602809(%eax,%ebp,1),%eax
+	addl	%edi,%eax
+	roll	$4,%eax
+	movl	48(%esi),%ebp
+	movl	%ebx,%edi
+	# R2 45 
+	leal	3873151461(%edx,%ebp,1),%edx
+	addl	%ebx,%eax
+	xorl	%ecx,%edi
+	xorl	%eax,%edi
+	movl	60(%esi),%ebp
+	addl	%edi,%edx
+	movl	%eax,%edi
+	roll	$11,%edx
+	addl	%eax,%edx
+	# R2 46 
+	xorl	%ebx,%edi
+	xorl	%edx,%edi
+	leal	530742520(%ecx,%ebp,1),%ecx
+	addl	%edi,%ecx
+	roll	$16,%ecx
+	movl	8(%esi),%ebp
+	movl	%edx,%edi
+	# R2 47 
+	leal	3299628645(%ebx,%ebp,1),%ebx
+	addl	%edx,%ecx
+	xorl	%eax,%edi
+	xorl	%ecx,%edi
+	movl	(%esi),%ebp
+	addl	%edi,%ebx
+	movl	$-1,%edi
+	roll	$23,%ebx
+	addl	%ecx,%ebx
+
+	# R3 section 
+	# R3 48 
+	xorl	%edx,%edi
+	orl	%ebx,%edi
+	leal	4096336452(%eax,%ebp,1),%eax
+	xorl	%ecx,%edi
+	movl	28(%esi),%ebp
+	addl	%edi,%eax
+	movl	$-1,%edi
+	roll	$6,%eax
+	xorl	%ecx,%edi
+	addl	%ebx,%eax
+	# R3 49 
+	orl	%eax,%edi
+	leal	1126891415(%edx,%ebp,1),%edx
+	xorl	%ebx,%edi
+	movl	56(%esi),%ebp
+	addl	%edi,%edx
+	movl	$-1,%edi
+	roll	$10,%edx
+	xorl	%ebx,%edi
+	addl	%eax,%edx
+	# R3 50 
+	orl	%edx,%edi
+	leal	2878612391(%ecx,%ebp,1),%ecx
+	xorl	%eax,%edi
+	movl	20(%esi),%ebp
+	addl	%edi,%ecx
+	movl	$-1,%edi
+	roll	$15,%ecx
+	xorl	%eax,%edi
+	addl	%edx,%ecx
+	# R3 51 
+	orl	%ecx,%edi
+	leal	4237533241(%ebx,%ebp,1),%ebx
+	xorl	%edx,%edi
+	movl	48(%esi),%ebp
+	addl	%edi,%ebx
+	movl	$-1,%edi
+	roll	$21,%ebx
+	xorl	%edx,%edi
+	addl	%ecx,%ebx
+	# R3 52 
+	orl	%ebx,%edi
+	leal	1700485571(%eax,%ebp,1),%eax
+	xorl	%ecx,%edi
+	movl	12(%esi),%ebp
+	addl	%edi,%eax
+	movl	$-1,%edi
+	roll	$6,%eax
+	xorl	%ecx,%edi
+	addl	%ebx,%eax
+	# R3 53 
+	orl	%eax,%edi
+	leal	2399980690(%edx,%ebp,1),%edx
+	xorl	%ebx,%edi
+	movl	40(%esi),%ebp
+	addl	%edi,%edx
+	movl	$-1,%edi
+	roll	$10,%edx
+	xorl	%ebx,%edi
+	addl	%eax,%edx
+	# R3 54 
+	orl	%edx,%edi
+	leal	4293915773(%ecx,%ebp,1),%ecx
+	xorl	%eax,%edi
+	movl	4(%esi),%ebp
+	addl	%edi,%ecx
+	movl	$-1,%edi
+	roll	$15,%ecx
+	xorl	%eax,%edi
+	addl	%edx,%ecx
+	# R3 55 
+	orl	%ecx,%edi
+	leal	2240044497(%ebx,%ebp,1),%ebx
+	xorl	%edx,%edi
+	movl	32(%esi),%ebp
+	addl	%edi,%ebx
+	movl	$-1,%edi
+	roll	$21,%ebx
+	xorl	%edx,%edi
+	addl	%ecx,%ebx
+	# R3 56 
+	orl	%ebx,%edi
+	leal	1873313359(%eax,%ebp,1),%eax
+	xorl	%ecx,%edi
+	movl	60(%esi),%ebp
+	addl	%edi,%eax
+	movl	$-1,%edi
+	roll	$6,%eax
+	xorl	%ecx,%edi
+	addl	%ebx,%eax
+	# R3 57 
+	orl	%eax,%edi
+	leal	4264355552(%edx,%ebp,1),%edx
+	xorl	%ebx,%edi
+	movl	24(%esi),%ebp
+	addl	%edi,%edx
+	movl	$-1,%edi
+	roll	$10,%edx
+	xorl	%ebx,%edi
+	addl	%eax,%edx
+	# R3 58 
+	orl	%edx,%edi
+	leal	2734768916(%ecx,%ebp,1),%ecx
+	xorl	%eax,%edi
+	movl	52(%esi),%ebp
+	addl	%edi,%ecx
+	movl	$-1,%edi
+	roll	$15,%ecx
+	xorl	%eax,%edi
+	addl	%edx,%ecx
+	# R3 59 
+	orl	%ecx,%edi
+	leal	1309151649(%ebx,%ebp,1),%ebx
+	xorl	%edx,%edi
+	movl	16(%esi),%ebp
+	addl	%edi,%ebx
+	movl	$-1,%edi
+	roll	$21,%ebx
+	xorl	%edx,%edi
+	addl	%ecx,%ebx
+	# R3 60 
+	orl	%ebx,%edi
+	leal	4149444226(%eax,%ebp,1),%eax
+	xorl	%ecx,%edi
+	movl	44(%esi),%ebp
+	addl	%edi,%eax
+	movl	$-1,%edi
+	roll	$6,%eax
+	xorl	%ecx,%edi
+	addl	%ebx,%eax
+	# R3 61 
+	orl	%eax,%edi
+	leal	3174756917(%edx,%ebp,1),%edx
+	xorl	%ebx,%edi
+	movl	8(%esi),%ebp
+	addl	%edi,%edx
+	movl	$-1,%edi
+	roll	$10,%edx
+	xorl	%ebx,%edi
+	addl	%eax,%edx
+	# R3 62 
+	orl	%edx,%edi
+	leal	718787259(%ecx,%ebp,1),%ecx
+	xorl	%eax,%edi
+	movl	36(%esi),%ebp
+	addl	%edi,%ecx
+	movl	$-1,%edi
+	roll	$15,%ecx
+	xorl	%eax,%edi
+	addl	%edx,%ecx
+	# R3 63 
+	orl	%ecx,%edi
+	leal	3951481745(%ebx,%ebp,1),%ebx
+	xorl	%edx,%edi
+	movl	24(%esp),%ebp
+	addl	%edi,%ebx
+	addl	$64,%esi
+	roll	$21,%ebx
+	movl	(%ebp),%edi
+	addl	%ecx,%ebx
+	addl	%edi,%eax
+	movl	4(%ebp),%edi
+	addl	%edi,%ebx
+	movl	8(%ebp),%edi
+	addl	%edi,%ecx
+	movl	12(%ebp),%edi
+	addl	%edi,%edx
+	movl	%eax,(%ebp)
+	movl	%ebx,4(%ebp)
+	movl	(%esp),%edi
+	movl	%ecx,8(%ebp)
+	movl	%edx,12(%ebp)
+	cmpl	%esi,%edi
+	jae	L000start
+	popl	%eax
+	popl	%ebx
+	popl	%ebp
+	popl	%edi
+	popl	%esi
+	ret
+#endif
diff --git a/third_party/boringssl/mac-x86/crypto/modes/ghash-x86.S b/third_party/boringssl/mac-x86/crypto/modes/ghash-x86.S
new file mode 100644
index 0000000..8693b82
--- /dev/null
+++ b/third_party/boringssl/mac-x86/crypto/modes/ghash-x86.S
@@ -0,0 +1,1260 @@
+#if defined(__i386__)
+.file	"ghash-x86.S"
+.text
+.globl	_gcm_gmult_4bit_x86
+.private_extern	_gcm_gmult_4bit_x86
+.align	4
+_gcm_gmult_4bit_x86:
+L_gcm_gmult_4bit_x86_begin:
+	pushl	%ebp
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+	subl	$84,%esp
+	movl	104(%esp),%edi
+	movl	108(%esp),%esi
+	movl	(%edi),%ebp
+	movl	4(%edi),%edx
+	movl	8(%edi),%ecx
+	movl	12(%edi),%ebx
+	movl	$0,16(%esp)
+	movl	$471859200,20(%esp)
+	movl	$943718400,24(%esp)
+	movl	$610271232,28(%esp)
+	movl	$1887436800,32(%esp)
+	movl	$1822425088,36(%esp)
+	movl	$1220542464,40(%esp)
+	movl	$1423966208,44(%esp)
+	movl	$3774873600,48(%esp)
+	movl	$4246732800,52(%esp)
+	movl	$3644850176,56(%esp)
+	movl	$3311403008,60(%esp)
+	movl	$2441084928,64(%esp)
+	movl	$2376073216,68(%esp)
+	movl	$2847932416,72(%esp)
+	movl	$3051356160,76(%esp)
+	movl	%ebp,(%esp)
+	movl	%edx,4(%esp)
+	movl	%ecx,8(%esp)
+	movl	%ebx,12(%esp)
+	shrl	$20,%ebx
+	andl	$240,%ebx
+	movl	4(%esi,%ebx,1),%ebp
+	movl	(%esi,%ebx,1),%edx
+	movl	12(%esi,%ebx,1),%ecx
+	movl	8(%esi,%ebx,1),%ebx
+	xorl	%eax,%eax
+	movl	$15,%edi
+	jmp	L000x86_loop
+.align	4,0x90
+L000x86_loop:
+	movb	%bl,%al
+	shrdl	$4,%ecx,%ebx
+	andb	$15,%al
+	shrdl	$4,%edx,%ecx
+	shrdl	$4,%ebp,%edx
+	shrl	$4,%ebp
+	xorl	16(%esp,%eax,4),%ebp
+	movb	(%esp,%edi,1),%al
+	andb	$240,%al
+	xorl	8(%esi,%eax,1),%ebx
+	xorl	12(%esi,%eax,1),%ecx
+	xorl	(%esi,%eax,1),%edx
+	xorl	4(%esi,%eax,1),%ebp
+	decl	%edi
+	js	L001x86_break
+	movb	%bl,%al
+	shrdl	$4,%ecx,%ebx
+	andb	$15,%al
+	shrdl	$4,%edx,%ecx
+	shrdl	$4,%ebp,%edx
+	shrl	$4,%ebp
+	xorl	16(%esp,%eax,4),%ebp
+	movb	(%esp,%edi,1),%al
+	shlb	$4,%al
+	xorl	8(%esi,%eax,1),%ebx
+	xorl	12(%esi,%eax,1),%ecx
+	xorl	(%esi,%eax,1),%edx
+	xorl	4(%esi,%eax,1),%ebp
+	jmp	L000x86_loop
+.align	4,0x90
+L001x86_break:
+	bswap	%ebx
+	bswap	%ecx
+	bswap	%edx
+	bswap	%ebp
+	movl	104(%esp),%edi
+	movl	%ebx,12(%edi)
+	movl	%ecx,8(%edi)
+	movl	%edx,4(%edi)
+	movl	%ebp,(%edi)
+	addl	$84,%esp
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.globl	_gcm_ghash_4bit_x86
+.private_extern	_gcm_ghash_4bit_x86
+.align	4
+_gcm_ghash_4bit_x86:
+L_gcm_ghash_4bit_x86_begin:
+	pushl	%ebp
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+	subl	$84,%esp
+	movl	104(%esp),%ebx
+	movl	108(%esp),%esi
+	movl	112(%esp),%edi
+	movl	116(%esp),%ecx
+	addl	%edi,%ecx
+	movl	%ecx,116(%esp)
+	movl	(%ebx),%ebp
+	movl	4(%ebx),%edx
+	movl	8(%ebx),%ecx
+	movl	12(%ebx),%ebx
+	movl	$0,16(%esp)
+	movl	$471859200,20(%esp)
+	movl	$943718400,24(%esp)
+	movl	$610271232,28(%esp)
+	movl	$1887436800,32(%esp)
+	movl	$1822425088,36(%esp)
+	movl	$1220542464,40(%esp)
+	movl	$1423966208,44(%esp)
+	movl	$3774873600,48(%esp)
+	movl	$4246732800,52(%esp)
+	movl	$3644850176,56(%esp)
+	movl	$3311403008,60(%esp)
+	movl	$2441084928,64(%esp)
+	movl	$2376073216,68(%esp)
+	movl	$2847932416,72(%esp)
+	movl	$3051356160,76(%esp)
+.align	4,0x90
+L002x86_outer_loop:
+	xorl	12(%edi),%ebx
+	xorl	8(%edi),%ecx
+	xorl	4(%edi),%edx
+	xorl	(%edi),%ebp
+	movl	%ebx,12(%esp)
+	movl	%ecx,8(%esp)
+	movl	%edx,4(%esp)
+	movl	%ebp,(%esp)
+	shrl	$20,%ebx
+	andl	$240,%ebx
+	movl	4(%esi,%ebx,1),%ebp
+	movl	(%esi,%ebx,1),%edx
+	movl	12(%esi,%ebx,1),%ecx
+	movl	8(%esi,%ebx,1),%ebx
+	xorl	%eax,%eax
+	movl	$15,%edi
+	jmp	L003x86_loop
+.align	4,0x90
+L003x86_loop:
+	movb	%bl,%al
+	shrdl	$4,%ecx,%ebx
+	andb	$15,%al
+	shrdl	$4,%edx,%ecx
+	shrdl	$4,%ebp,%edx
+	shrl	$4,%ebp
+	xorl	16(%esp,%eax,4),%ebp
+	movb	(%esp,%edi,1),%al
+	andb	$240,%al
+	xorl	8(%esi,%eax,1),%ebx
+	xorl	12(%esi,%eax,1),%ecx
+	xorl	(%esi,%eax,1),%edx
+	xorl	4(%esi,%eax,1),%ebp
+	decl	%edi
+	js	L004x86_break
+	movb	%bl,%al
+	shrdl	$4,%ecx,%ebx
+	andb	$15,%al
+	shrdl	$4,%edx,%ecx
+	shrdl	$4,%ebp,%edx
+	shrl	$4,%ebp
+	xorl	16(%esp,%eax,4),%ebp
+	movb	(%esp,%edi,1),%al
+	shlb	$4,%al
+	xorl	8(%esi,%eax,1),%ebx
+	xorl	12(%esi,%eax,1),%ecx
+	xorl	(%esi,%eax,1),%edx
+	xorl	4(%esi,%eax,1),%ebp
+	jmp	L003x86_loop
+.align	4,0x90
+L004x86_break:
+	bswap	%ebx
+	bswap	%ecx
+	bswap	%edx
+	bswap	%ebp
+	movl	112(%esp),%edi
+	leal	16(%edi),%edi
+	cmpl	116(%esp),%edi
+	movl	%edi,112(%esp)
+	jb	L002x86_outer_loop
+	movl	104(%esp),%edi
+	movl	%ebx,12(%edi)
+	movl	%ecx,8(%edi)
+	movl	%edx,4(%edi)
+	movl	%ebp,(%edi)
+	addl	$84,%esp
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.globl	_gcm_gmult_4bit_mmx
+.private_extern	_gcm_gmult_4bit_mmx
+.align	4
+_gcm_gmult_4bit_mmx:
+L_gcm_gmult_4bit_mmx_begin:
+	pushl	%ebp
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+	movl	20(%esp),%edi
+	movl	24(%esp),%esi
+	call	L005pic_point
+L005pic_point:
+	popl	%eax
+	leal	Lrem_4bit-L005pic_point(%eax),%eax
+	movzbl	15(%edi),%ebx
+	xorl	%ecx,%ecx
+	movl	%ebx,%edx
+	movb	%dl,%cl
+	movl	$14,%ebp
+	shlb	$4,%cl
+	andl	$240,%edx
+	movq	8(%esi,%ecx,1),%mm0
+	movq	(%esi,%ecx,1),%mm1
+	movd	%mm0,%ebx
+	jmp	L006mmx_loop
+.align	4,0x90
+L006mmx_loop:
+	psrlq	$4,%mm0
+	andl	$15,%ebx
+	movq	%mm1,%mm2
+	psrlq	$4,%mm1
+	pxor	8(%esi,%edx,1),%mm0
+	movb	(%edi,%ebp,1),%cl
+	psllq	$60,%mm2
+	pxor	(%eax,%ebx,8),%mm1
+	decl	%ebp
+	movd	%mm0,%ebx
+	pxor	(%esi,%edx,1),%mm1
+	movl	%ecx,%edx
+	pxor	%mm2,%mm0
+	js	L007mmx_break
+	shlb	$4,%cl
+	andl	$15,%ebx
+	psrlq	$4,%mm0
+	andl	$240,%edx
+	movq	%mm1,%mm2
+	psrlq	$4,%mm1
+	pxor	8(%esi,%ecx,1),%mm0
+	psllq	$60,%mm2
+	pxor	(%eax,%ebx,8),%mm1
+	movd	%mm0,%ebx
+	pxor	(%esi,%ecx,1),%mm1
+	pxor	%mm2,%mm0
+	jmp	L006mmx_loop
+.align	4,0x90
+L007mmx_break:
+	shlb	$4,%cl
+	andl	$15,%ebx
+	psrlq	$4,%mm0
+	andl	$240,%edx
+	movq	%mm1,%mm2
+	psrlq	$4,%mm1
+	pxor	8(%esi,%ecx,1),%mm0
+	psllq	$60,%mm2
+	pxor	(%eax,%ebx,8),%mm1
+	movd	%mm0,%ebx
+	pxor	(%esi,%ecx,1),%mm1
+	pxor	%mm2,%mm0
+	psrlq	$4,%mm0
+	andl	$15,%ebx
+	movq	%mm1,%mm2
+	psrlq	$4,%mm1
+	pxor	8(%esi,%edx,1),%mm0
+	psllq	$60,%mm2
+	pxor	(%eax,%ebx,8),%mm1
+	movd	%mm0,%ebx
+	pxor	(%esi,%edx,1),%mm1
+	pxor	%mm2,%mm0
+	psrlq	$32,%mm0
+	movd	%mm1,%edx
+	psrlq	$32,%mm1
+	movd	%mm0,%ecx
+	movd	%mm1,%ebp
+	bswap	%ebx
+	bswap	%edx
+	bswap	%ecx
+	bswap	%ebp
+	emms
+	movl	%ebx,12(%edi)
+	movl	%edx,4(%edi)
+	movl	%ecx,8(%edi)
+	movl	%ebp,(%edi)
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.globl	_gcm_ghash_4bit_mmx
+.private_extern	_gcm_ghash_4bit_mmx
+.align	4
+_gcm_ghash_4bit_mmx:
+L_gcm_ghash_4bit_mmx_begin:
+	pushl	%ebp
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+	movl	20(%esp),%eax
+	movl	24(%esp),%ebx
+	movl	28(%esp),%ecx
+	movl	32(%esp),%edx
+	movl	%esp,%ebp
+	call	L008pic_point
+L008pic_point:
+	popl	%esi
+	leal	Lrem_8bit-L008pic_point(%esi),%esi
+	subl	$544,%esp
+	andl	$-64,%esp
+	subl	$16,%esp
+	addl	%ecx,%edx
+	movl	%eax,544(%esp)
+	movl	%edx,552(%esp)
+	movl	%ebp,556(%esp)
+	addl	$128,%ebx
+	leal	144(%esp),%edi
+	leal	400(%esp),%ebp
+	movl	-120(%ebx),%edx
+	movq	-120(%ebx),%mm0
+	movq	-128(%ebx),%mm3
+	shll	$4,%edx
+	movb	%dl,(%esp)
+	movl	-104(%ebx),%edx
+	movq	-104(%ebx),%mm2
+	movq	-112(%ebx),%mm5
+	movq	%mm0,-128(%edi)
+	psrlq	$4,%mm0
+	movq	%mm3,(%edi)
+	movq	%mm3,%mm7
+	psrlq	$4,%mm3
+	shll	$4,%edx
+	movb	%dl,1(%esp)
+	movl	-88(%ebx),%edx
+	movq	-88(%ebx),%mm1
+	psllq	$60,%mm7
+	movq	-96(%ebx),%mm4
+	por	%mm7,%mm0
+	movq	%mm2,-120(%edi)
+	psrlq	$4,%mm2
+	movq	%mm5,8(%edi)
+	movq	%mm5,%mm6
+	movq	%mm0,-128(%ebp)
+	psrlq	$4,%mm5
+	movq	%mm3,(%ebp)
+	shll	$4,%edx
+	movb	%dl,2(%esp)
+	movl	-72(%ebx),%edx
+	movq	-72(%ebx),%mm0
+	psllq	$60,%mm6
+	movq	-80(%ebx),%mm3
+	por	%mm6,%mm2
+	movq	%mm1,-112(%edi)
+	psrlq	$4,%mm1
+	movq	%mm4,16(%edi)
+	movq	%mm4,%mm7
+	movq	%mm2,-120(%ebp)
+	psrlq	$4,%mm4
+	movq	%mm5,8(%ebp)
+	shll	$4,%edx
+	movb	%dl,3(%esp)
+	movl	-56(%ebx),%edx
+	movq	-56(%ebx),%mm2
+	psllq	$60,%mm7
+	movq	-64(%ebx),%mm5
+	por	%mm7,%mm1
+	movq	%mm0,-104(%edi)
+	psrlq	$4,%mm0
+	movq	%mm3,24(%edi)
+	movq	%mm3,%mm6
+	movq	%mm1,-112(%ebp)
+	psrlq	$4,%mm3
+	movq	%mm4,16(%ebp)
+	shll	$4,%edx
+	movb	%dl,4(%esp)
+	movl	-40(%ebx),%edx
+	movq	-40(%ebx),%mm1
+	psllq	$60,%mm6
+	movq	-48(%ebx),%mm4
+	por	%mm6,%mm0
+	movq	%mm2,-96(%edi)
+	psrlq	$4,%mm2
+	movq	%mm5,32(%edi)
+	movq	%mm5,%mm7
+	movq	%mm0,-104(%ebp)
+	psrlq	$4,%mm5
+	movq	%mm3,24(%ebp)
+	shll	$4,%edx
+	movb	%dl,5(%esp)
+	movl	-24(%ebx),%edx
+	movq	-24(%ebx),%mm0
+	psllq	$60,%mm7
+	movq	-32(%ebx),%mm3
+	por	%mm7,%mm2
+	movq	%mm1,-88(%edi)
+	psrlq	$4,%mm1
+	movq	%mm4,40(%edi)
+	movq	%mm4,%mm6
+	movq	%mm2,-96(%ebp)
+	psrlq	$4,%mm4
+	movq	%mm5,32(%ebp)
+	shll	$4,%edx
+	movb	%dl,6(%esp)
+	movl	-8(%ebx),%edx
+	movq	-8(%ebx),%mm2
+	psllq	$60,%mm6
+	movq	-16(%ebx),%mm5
+	por	%mm6,%mm1
+	movq	%mm0,-80(%edi)
+	psrlq	$4,%mm0
+	movq	%mm3,48(%edi)
+	movq	%mm3,%mm7
+	movq	%mm1,-88(%ebp)
+	psrlq	$4,%mm3
+	movq	%mm4,40(%ebp)
+	shll	$4,%edx
+	movb	%dl,7(%esp)
+	movl	8(%ebx),%edx
+	movq	8(%ebx),%mm1
+	psllq	$60,%mm7
+	movq	(%ebx),%mm4
+	por	%mm7,%mm0
+	movq	%mm2,-72(%edi)
+	psrlq	$4,%mm2
+	movq	%mm5,56(%edi)
+	movq	%mm5,%mm6
+	movq	%mm0,-80(%ebp)
+	psrlq	$4,%mm5
+	movq	%mm3,48(%ebp)
+	shll	$4,%edx
+	movb	%dl,8(%esp)
+	movl	24(%ebx),%edx
+	movq	24(%ebx),%mm0
+	psllq	$60,%mm6
+	movq	16(%ebx),%mm3
+	por	%mm6,%mm2
+	movq	%mm1,-64(%edi)
+	psrlq	$4,%mm1
+	movq	%mm4,64(%edi)
+	movq	%mm4,%mm7
+	movq	%mm2,-72(%ebp)
+	psrlq	$4,%mm4
+	movq	%mm5,56(%ebp)
+	shll	$4,%edx
+	movb	%dl,9(%esp)
+	movl	40(%ebx),%edx
+	movq	40(%ebx),%mm2
+	psllq	$60,%mm7
+	movq	32(%ebx),%mm5
+	por	%mm7,%mm1
+	movq	%mm0,-56(%edi)
+	psrlq	$4,%mm0
+	movq	%mm3,72(%edi)
+	movq	%mm3,%mm6
+	movq	%mm1,-64(%ebp)
+	psrlq	$4,%mm3
+	movq	%mm4,64(%ebp)
+	shll	$4,%edx
+	movb	%dl,10(%esp)
+	movl	56(%ebx),%edx
+	movq	56(%ebx),%mm1
+	psllq	$60,%mm6
+	movq	48(%ebx),%mm4
+	por	%mm6,%mm0
+	movq	%mm2,-48(%edi)
+	psrlq	$4,%mm2
+	movq	%mm5,80(%edi)
+	movq	%mm5,%mm7
+	movq	%mm0,-56(%ebp)
+	psrlq	$4,%mm5
+	movq	%mm3,72(%ebp)
+	shll	$4,%edx
+	movb	%dl,11(%esp)
+	movl	72(%ebx),%edx
+	movq	72(%ebx),%mm0
+	psllq	$60,%mm7
+	movq	64(%ebx),%mm3
+	por	%mm7,%mm2
+	movq	%mm1,-40(%edi)
+	psrlq	$4,%mm1
+	movq	%mm4,88(%edi)
+	movq	%mm4,%mm6
+	movq	%mm2,-48(%ebp)
+	psrlq	$4,%mm4
+	movq	%mm5,80(%ebp)
+	shll	$4,%edx
+	movb	%dl,12(%esp)
+	movl	88(%ebx),%edx
+	movq	88(%ebx),%mm2
+	psllq	$60,%mm6
+	movq	80(%ebx),%mm5
+	por	%mm6,%mm1
+	movq	%mm0,-32(%edi)
+	psrlq	$4,%mm0
+	movq	%mm3,96(%edi)
+	movq	%mm3,%mm7
+	movq	%mm1,-40(%ebp)
+	psrlq	$4,%mm3
+	movq	%mm4,88(%ebp)
+	shll	$4,%edx
+	movb	%dl,13(%esp)
+	movl	104(%ebx),%edx
+	movq	104(%ebx),%mm1
+	psllq	$60,%mm7
+	movq	96(%ebx),%mm4
+	por	%mm7,%mm0
+	movq	%mm2,-24(%edi)
+	psrlq	$4,%mm2
+	movq	%mm5,104(%edi)
+	movq	%mm5,%mm6
+	movq	%mm0,-32(%ebp)
+	psrlq	$4,%mm5
+	movq	%mm3,96(%ebp)
+	shll	$4,%edx
+	movb	%dl,14(%esp)
+	movl	120(%ebx),%edx
+	movq	120(%ebx),%mm0
+	psllq	$60,%mm6
+	movq	112(%ebx),%mm3
+	por	%mm6,%mm2
+	movq	%mm1,-16(%edi)
+	psrlq	$4,%mm1
+	movq	%mm4,112(%edi)
+	movq	%mm4,%mm7
+	movq	%mm2,-24(%ebp)
+	psrlq	$4,%mm4
+	movq	%mm5,104(%ebp)
+	shll	$4,%edx
+	movb	%dl,15(%esp)
+	psllq	$60,%mm7
+	por	%mm7,%mm1
+	movq	%mm0,-8(%edi)
+	psrlq	$4,%mm0
+	movq	%mm3,120(%edi)
+	movq	%mm3,%mm6
+	movq	%mm1,-16(%ebp)
+	psrlq	$4,%mm3
+	movq	%mm4,112(%ebp)
+	psllq	$60,%mm6
+	por	%mm6,%mm0
+	movq	%mm0,-8(%ebp)
+	movq	%mm3,120(%ebp)
+	movq	(%eax),%mm6
+	movl	8(%eax),%ebx
+	movl	12(%eax),%edx
+.align	4,0x90
+L009outer:
+	xorl	12(%ecx),%edx
+	xorl	8(%ecx),%ebx
+	pxor	(%ecx),%mm6
+	leal	16(%ecx),%ecx
+	movl	%ebx,536(%esp)
+	movq	%mm6,528(%esp)
+	movl	%ecx,548(%esp)
+	xorl	%eax,%eax
+	roll	$8,%edx
+	movb	%dl,%al
+	movl	%eax,%ebp
+	andb	$15,%al
+	shrl	$4,%ebp
+	pxor	%mm0,%mm0
+	roll	$8,%edx
+	pxor	%mm1,%mm1
+	pxor	%mm2,%mm2
+	movq	16(%esp,%eax,8),%mm7
+	movq	144(%esp,%eax,8),%mm6
+	movb	%dl,%al
+	movd	%mm7,%ebx
+	psrlq	$8,%mm7
+	movq	%mm6,%mm3
+	movl	%eax,%edi
+	psrlq	$8,%mm6
+	pxor	272(%esp,%ebp,8),%mm7
+	andb	$15,%al
+	psllq	$56,%mm3
+	shrl	$4,%edi
+	pxor	16(%esp,%eax,8),%mm7
+	roll	$8,%edx
+	pxor	144(%esp,%eax,8),%mm6
+	pxor	%mm3,%mm7
+	pxor	400(%esp,%ebp,8),%mm6
+	xorb	(%esp,%ebp,1),%bl
+	movb	%dl,%al
+	movd	%mm7,%ecx
+	movzbl	%bl,%ebx
+	psrlq	$8,%mm7
+	movq	%mm6,%mm3
+	movl	%eax,%ebp
+	psrlq	$8,%mm6
+	pxor	272(%esp,%edi,8),%mm7
+	andb	$15,%al
+	psllq	$56,%mm3
+	shrl	$4,%ebp
+	pinsrw	$2,(%esi,%ebx,2),%mm2
+	pxor	16(%esp,%eax,8),%mm7
+	roll	$8,%edx
+	pxor	144(%esp,%eax,8),%mm6
+	pxor	%mm3,%mm7
+	pxor	400(%esp,%edi,8),%mm6
+	xorb	(%esp,%edi,1),%cl
+	movb	%dl,%al
+	movl	536(%esp),%edx
+	movd	%mm7,%ebx
+	movzbl	%cl,%ecx
+	psrlq	$8,%mm7
+	movq	%mm6,%mm3
+	movl	%eax,%edi
+	psrlq	$8,%mm6
+	pxor	272(%esp,%ebp,8),%mm7
+	andb	$15,%al
+	psllq	$56,%mm3
+	pxor	%mm2,%mm6
+	shrl	$4,%edi
+	pinsrw	$2,(%esi,%ecx,2),%mm1
+	pxor	16(%esp,%eax,8),%mm7
+	roll	$8,%edx
+	pxor	144(%esp,%eax,8),%mm6
+	pxor	%mm3,%mm7
+	pxor	400(%esp,%ebp,8),%mm6
+	xorb	(%esp,%ebp,1),%bl
+	movb	%dl,%al
+	movd	%mm7,%ecx
+	movzbl	%bl,%ebx
+	psrlq	$8,%mm7
+	movq	%mm6,%mm3
+	movl	%eax,%ebp
+	psrlq	$8,%mm6
+	pxor	272(%esp,%edi,8),%mm7
+	andb	$15,%al
+	psllq	$56,%mm3
+	pxor	%mm1,%mm6
+	shrl	$4,%ebp
+	pinsrw	$2,(%esi,%ebx,2),%mm0
+	pxor	16(%esp,%eax,8),%mm7
+	roll	$8,%edx
+	pxor	144(%esp,%eax,8),%mm6
+	pxor	%mm3,%mm7
+	pxor	400(%esp,%edi,8),%mm6
+	xorb	(%esp,%edi,1),%cl
+	movb	%dl,%al
+	movd	%mm7,%ebx
+	movzbl	%cl,%ecx
+	psrlq	$8,%mm7
+	movq	%mm6,%mm3
+	movl	%eax,%edi
+	psrlq	$8,%mm6
+	pxor	272(%esp,%ebp,8),%mm7
+	andb	$15,%al
+	psllq	$56,%mm3
+	pxor	%mm0,%mm6
+	shrl	$4,%edi
+	pinsrw	$2,(%esi,%ecx,2),%mm2
+	pxor	16(%esp,%eax,8),%mm7
+	roll	$8,%edx
+	pxor	144(%esp,%eax,8),%mm6
+	pxor	%mm3,%mm7
+	pxor	400(%esp,%ebp,8),%mm6
+	xorb	(%esp,%ebp,1),%bl
+	movb	%dl,%al
+	movd	%mm7,%ecx
+	movzbl	%bl,%ebx
+	psrlq	$8,%mm7
+	movq	%mm6,%mm3
+	movl	%eax,%ebp
+	psrlq	$8,%mm6
+	pxor	272(%esp,%edi,8),%mm7
+	andb	$15,%al
+	psllq	$56,%mm3
+	pxor	%mm2,%mm6
+	shrl	$4,%ebp
+	pinsrw	$2,(%esi,%ebx,2),%mm1
+	pxor	16(%esp,%eax,8),%mm7
+	roll	$8,%edx
+	pxor	144(%esp,%eax,8),%mm6
+	pxor	%mm3,%mm7
+	pxor	400(%esp,%edi,8),%mm6
+	xorb	(%esp,%edi,1),%cl
+	movb	%dl,%al
+	movl	532(%esp),%edx
+	movd	%mm7,%ebx
+	movzbl	%cl,%ecx
+	psrlq	$8,%mm7
+	movq	%mm6,%mm3
+	movl	%eax,%edi
+	psrlq	$8,%mm6
+	pxor	272(%esp,%ebp,8),%mm7
+	andb	$15,%al
+	psllq	$56,%mm3
+	pxor	%mm1,%mm6
+	shrl	$4,%edi
+	pinsrw	$2,(%esi,%ecx,2),%mm0
+	pxor	16(%esp,%eax,8),%mm7
+	roll	$8,%edx
+	pxor	144(%esp,%eax,8),%mm6
+	pxor	%mm3,%mm7
+	pxor	400(%esp,%ebp,8),%mm6
+	xorb	(%esp,%ebp,1),%bl
+	movb	%dl,%al
+	movd	%mm7,%ecx
+	movzbl	%bl,%ebx
+	psrlq	$8,%mm7
+	movq	%mm6,%mm3
+	movl	%eax,%ebp
+	psrlq	$8,%mm6
+	pxor	272(%esp,%edi,8),%mm7
+	andb	$15,%al
+	psllq	$56,%mm3
+	pxor	%mm0,%mm6
+	shrl	$4,%ebp
+	pinsrw	$2,(%esi,%ebx,2),%mm2
+	pxor	16(%esp,%eax,8),%mm7
+	roll	$8,%edx
+	pxor	144(%esp,%eax,8),%mm6
+	pxor	%mm3,%mm7
+	pxor	400(%esp,%edi,8),%mm6
+	xorb	(%esp,%edi,1),%cl
+	movb	%dl,%al
+	movd	%mm7,%ebx
+	movzbl	%cl,%ecx
+	psrlq	$8,%mm7
+	movq	%mm6,%mm3
+	movl	%eax,%edi
+	psrlq	$8,%mm6
+	pxor	272(%esp,%ebp,8),%mm7
+	andb	$15,%al
+	psllq	$56,%mm3
+	pxor	%mm2,%mm6
+	shrl	$4,%edi
+	pinsrw	$2,(%esi,%ecx,2),%mm1
+	pxor	16(%esp,%eax,8),%mm7
+	roll	$8,%edx
+	pxor	144(%esp,%eax,8),%mm6
+	pxor	%mm3,%mm7
+	pxor	400(%esp,%ebp,8),%mm6
+	xorb	(%esp,%ebp,1),%bl
+	movb	%dl,%al
+	movd	%mm7,%ecx
+	movzbl	%bl,%ebx
+	psrlq	$8,%mm7
+	movq	%mm6,%mm3
+	movl	%eax,%ebp
+	psrlq	$8,%mm6
+	pxor	272(%esp,%edi,8),%mm7
+	andb	$15,%al
+	psllq	$56,%mm3
+	pxor	%mm1,%mm6
+	shrl	$4,%ebp
+	pinsrw	$2,(%esi,%ebx,2),%mm0
+	pxor	16(%esp,%eax,8),%mm7
+	roll	$8,%edx
+	pxor	144(%esp,%eax,8),%mm6
+	pxor	%mm3,%mm7
+	pxor	400(%esp,%edi,8),%mm6
+	xorb	(%esp,%edi,1),%cl
+	movb	%dl,%al
+	movl	528(%esp),%edx
+	movd	%mm7,%ebx
+	movzbl	%cl,%ecx
+	psrlq	$8,%mm7
+	movq	%mm6,%mm3
+	movl	%eax,%edi
+	psrlq	$8,%mm6
+	pxor	272(%esp,%ebp,8),%mm7
+	andb	$15,%al
+	psllq	$56,%mm3
+	pxor	%mm0,%mm6
+	shrl	$4,%edi
+	pinsrw	$2,(%esi,%ecx,2),%mm2
+	pxor	16(%esp,%eax,8),%mm7
+	roll	$8,%edx
+	pxor	144(%esp,%eax,8),%mm6
+	pxor	%mm3,%mm7
+	pxor	400(%esp,%ebp,8),%mm6
+	xorb	(%esp,%ebp,1),%bl
+	movb	%dl,%al
+	movd	%mm7,%ecx
+	movzbl	%bl,%ebx
+	psrlq	$8,%mm7
+	movq	%mm6,%mm3
+	movl	%eax,%ebp
+	psrlq	$8,%mm6
+	pxor	272(%esp,%edi,8),%mm7
+	andb	$15,%al
+	psllq	$56,%mm3
+	pxor	%mm2,%mm6
+	shrl	$4,%ebp
+	pinsrw	$2,(%esi,%ebx,2),%mm1
+	pxor	16(%esp,%eax,8),%mm7
+	roll	$8,%edx
+	pxor	144(%esp,%eax,8),%mm6
+	pxor	%mm3,%mm7
+	pxor	400(%esp,%edi,8),%mm6
+	xorb	(%esp,%edi,1),%cl
+	movb	%dl,%al
+	movd	%mm7,%ebx
+	movzbl	%cl,%ecx
+	psrlq	$8,%mm7
+	movq	%mm6,%mm3
+	movl	%eax,%edi
+	psrlq	$8,%mm6
+	pxor	272(%esp,%ebp,8),%mm7
+	andb	$15,%al
+	psllq	$56,%mm3
+	pxor	%mm1,%mm6
+	shrl	$4,%edi
+	pinsrw	$2,(%esi,%ecx,2),%mm0
+	pxor	16(%esp,%eax,8),%mm7
+	roll	$8,%edx
+	pxor	144(%esp,%eax,8),%mm6
+	pxor	%mm3,%mm7
+	pxor	400(%esp,%ebp,8),%mm6
+	xorb	(%esp,%ebp,1),%bl
+	movb	%dl,%al
+	movd	%mm7,%ecx
+	movzbl	%bl,%ebx
+	psrlq	$8,%mm7
+	movq	%mm6,%mm3
+	movl	%eax,%ebp
+	psrlq	$8,%mm6
+	pxor	272(%esp,%edi,8),%mm7
+	andb	$15,%al
+	psllq	$56,%mm3
+	pxor	%mm0,%mm6
+	shrl	$4,%ebp
+	pinsrw	$2,(%esi,%ebx,2),%mm2
+	pxor	16(%esp,%eax,8),%mm7
+	roll	$8,%edx
+	pxor	144(%esp,%eax,8),%mm6
+	pxor	%mm3,%mm7
+	pxor	400(%esp,%edi,8),%mm6
+	xorb	(%esp,%edi,1),%cl
+	movb	%dl,%al
+	movl	524(%esp),%edx
+	movd	%mm7,%ebx
+	movzbl	%cl,%ecx
+	psrlq	$8,%mm7
+	movq	%mm6,%mm3
+	movl	%eax,%edi
+	psrlq	$8,%mm6
+	pxor	272(%esp,%ebp,8),%mm7
+	andb	$15,%al
+	psllq	$56,%mm3
+	pxor	%mm2,%mm6
+	shrl	$4,%edi
+	pinsrw	$2,(%esi,%ecx,2),%mm1
+	pxor	16(%esp,%eax,8),%mm7
+	pxor	144(%esp,%eax,8),%mm6
+	xorb	(%esp,%ebp,1),%bl
+	pxor	%mm3,%mm7
+	pxor	400(%esp,%ebp,8),%mm6
+	movzbl	%bl,%ebx
+	pxor	%mm2,%mm2
+	psllq	$4,%mm1
+	movd	%mm7,%ecx
+	psrlq	$4,%mm7
+	movq	%mm6,%mm3
+	psrlq	$4,%mm6
+	shll	$4,%ecx
+	pxor	16(%esp,%edi,8),%mm7
+	psllq	$60,%mm3
+	movzbl	%cl,%ecx
+	pxor	%mm3,%mm7
+	pxor	144(%esp,%edi,8),%mm6
+	pinsrw	$2,(%esi,%ebx,2),%mm0
+	pxor	%mm1,%mm6
+	movd	%mm7,%edx
+	pinsrw	$3,(%esi,%ecx,2),%mm2
+	psllq	$12,%mm0
+	pxor	%mm0,%mm6
+	psrlq	$32,%mm7
+	pxor	%mm2,%mm6
+	movl	548(%esp),%ecx
+	movd	%mm7,%ebx
+	movq	%mm6,%mm3
+	psllw	$8,%mm6
+	psrlw	$8,%mm3
+	por	%mm3,%mm6
+	bswap	%edx
+	pshufw	$27,%mm6,%mm6
+	bswap	%ebx
+	cmpl	552(%esp),%ecx
+	jne	L009outer
+	movl	544(%esp),%eax
+	movl	%edx,12(%eax)
+	movl	%ebx,8(%eax)
+	movq	%mm6,(%eax)
+	movl	556(%esp),%esp
+	emms
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.globl	_gcm_init_clmul
+.private_extern	_gcm_init_clmul
+.align	4
+_gcm_init_clmul:
+L_gcm_init_clmul_begin:
+	movl	4(%esp),%edx
+	movl	8(%esp),%eax
+	call	L010pic
+L010pic:
+	popl	%ecx
+	leal	Lbswap-L010pic(%ecx),%ecx
+	movdqu	(%eax),%xmm2
+	pshufd	$78,%xmm2,%xmm2
+	pshufd	$255,%xmm2,%xmm4
+	movdqa	%xmm2,%xmm3
+	psllq	$1,%xmm2
+	pxor	%xmm5,%xmm5
+	psrlq	$63,%xmm3
+	pcmpgtd	%xmm4,%xmm5
+	pslldq	$8,%xmm3
+	por	%xmm3,%xmm2
+	pand	16(%ecx),%xmm5
+	pxor	%xmm5,%xmm2
+	movdqa	%xmm2,%xmm0
+	movdqa	%xmm0,%xmm1
+	pshufd	$78,%xmm0,%xmm3
+	pshufd	$78,%xmm2,%xmm4
+	pxor	%xmm0,%xmm3
+	pxor	%xmm2,%xmm4
+.byte	102,15,58,68,194,0
+.byte	102,15,58,68,202,17
+.byte	102,15,58,68,220,0
+	xorps	%xmm0,%xmm3
+	xorps	%xmm1,%xmm3
+	movdqa	%xmm3,%xmm4
+	psrldq	$8,%xmm3
+	pslldq	$8,%xmm4
+	pxor	%xmm3,%xmm1
+	pxor	%xmm4,%xmm0
+	movdqa	%xmm0,%xmm4
+	movdqa	%xmm0,%xmm3
+	psllq	$5,%xmm0
+	pxor	%xmm0,%xmm3
+	psllq	$1,%xmm0
+	pxor	%xmm3,%xmm0
+	psllq	$57,%xmm0
+	movdqa	%xmm0,%xmm3
+	pslldq	$8,%xmm0
+	psrldq	$8,%xmm3
+	pxor	%xmm4,%xmm0
+	pxor	%xmm3,%xmm1
+	movdqa	%xmm0,%xmm4
+	psrlq	$1,%xmm0
+	pxor	%xmm4,%xmm1
+	pxor	%xmm0,%xmm4
+	psrlq	$5,%xmm0
+	pxor	%xmm4,%xmm0
+	psrlq	$1,%xmm0
+	pxor	%xmm1,%xmm0
+	pshufd	$78,%xmm2,%xmm3
+	pshufd	$78,%xmm0,%xmm4
+	pxor	%xmm2,%xmm3
+	movdqu	%xmm2,(%edx)
+	pxor	%xmm0,%xmm4
+	movdqu	%xmm0,16(%edx)
+.byte	102,15,58,15,227,8
+	movdqu	%xmm4,32(%edx)
+	ret
+.globl	_gcm_gmult_clmul
+.private_extern	_gcm_gmult_clmul
+.align	4
+_gcm_gmult_clmul:
+L_gcm_gmult_clmul_begin:
+	movl	4(%esp),%eax
+	movl	8(%esp),%edx
+	call	L011pic
+L011pic:
+	popl	%ecx
+	leal	Lbswap-L011pic(%ecx),%ecx
+	movdqu	(%eax),%xmm0
+	movdqa	(%ecx),%xmm5
+	movups	(%edx),%xmm2
+.byte	102,15,56,0,197
+	movups	32(%edx),%xmm4
+	movdqa	%xmm0,%xmm1
+	pshufd	$78,%xmm0,%xmm3
+	pxor	%xmm0,%xmm3
+.byte	102,15,58,68,194,0
+.byte	102,15,58,68,202,17
+.byte	102,15,58,68,220,0
+	xorps	%xmm0,%xmm3
+	xorps	%xmm1,%xmm3
+	movdqa	%xmm3,%xmm4
+	psrldq	$8,%xmm3
+	pslldq	$8,%xmm4
+	pxor	%xmm3,%xmm1
+	pxor	%xmm4,%xmm0
+	movdqa	%xmm0,%xmm4
+	movdqa	%xmm0,%xmm3
+	psllq	$5,%xmm0
+	pxor	%xmm0,%xmm3
+	psllq	$1,%xmm0
+	pxor	%xmm3,%xmm0
+	psllq	$57,%xmm0
+	movdqa	%xmm0,%xmm3
+	pslldq	$8,%xmm0
+	psrldq	$8,%xmm3
+	pxor	%xmm4,%xmm0
+	pxor	%xmm3,%xmm1
+	movdqa	%xmm0,%xmm4
+	psrlq	$1,%xmm0
+	pxor	%xmm4,%xmm1
+	pxor	%xmm0,%xmm4
+	psrlq	$5,%xmm0
+	pxor	%xmm4,%xmm0
+	psrlq	$1,%xmm0
+	pxor	%xmm1,%xmm0
+.byte	102,15,56,0,197
+	movdqu	%xmm0,(%eax)
+	ret
+.globl	_gcm_ghash_clmul
+.private_extern	_gcm_ghash_clmul
+.align	4
+_gcm_ghash_clmul:
+L_gcm_ghash_clmul_begin:
+	pushl	%ebp
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+	movl	20(%esp),%eax
+	movl	24(%esp),%edx
+	movl	28(%esp),%esi
+	movl	32(%esp),%ebx
+	call	L012pic
+L012pic:
+	popl	%ecx
+	leal	Lbswap-L012pic(%ecx),%ecx
+	movdqu	(%eax),%xmm0
+	movdqa	(%ecx),%xmm5
+	movdqu	(%edx),%xmm2
+.byte	102,15,56,0,197
+	subl	$16,%ebx
+	jz	L013odd_tail
+	movdqu	(%esi),%xmm3
+	movdqu	16(%esi),%xmm6
+.byte	102,15,56,0,221
+.byte	102,15,56,0,245
+	movdqu	32(%edx),%xmm5
+	pxor	%xmm3,%xmm0
+	pshufd	$78,%xmm6,%xmm3
+	movdqa	%xmm6,%xmm7
+	pxor	%xmm6,%xmm3
+	leal	32(%esi),%esi
+.byte	102,15,58,68,242,0
+.byte	102,15,58,68,250,17
+.byte	102,15,58,68,221,0
+	movups	16(%edx),%xmm2
+	nop
+	subl	$32,%ebx
+	jbe	L014even_tail
+	jmp	L015mod_loop
+.align	5,0x90
+L015mod_loop:
+	pshufd	$78,%xmm0,%xmm4
+	movdqa	%xmm0,%xmm1
+	pxor	%xmm0,%xmm4
+	nop
+.byte	102,15,58,68,194,0
+.byte	102,15,58,68,202,17
+.byte	102,15,58,68,229,16
+	movups	(%edx),%xmm2
+	xorps	%xmm6,%xmm0
+	movdqa	(%ecx),%xmm5
+	xorps	%xmm7,%xmm1
+	movdqu	(%esi),%xmm7
+	pxor	%xmm0,%xmm3
+	movdqu	16(%esi),%xmm6
+	pxor	%xmm1,%xmm3
+.byte	102,15,56,0,253
+	pxor	%xmm3,%xmm4
+	movdqa	%xmm4,%xmm3
+	psrldq	$8,%xmm4
+	pslldq	$8,%xmm3
+	pxor	%xmm4,%xmm1
+	pxor	%xmm3,%xmm0
+.byte	102,15,56,0,245
+	pxor	%xmm7,%xmm1
+	movdqa	%xmm6,%xmm7
+	movdqa	%xmm0,%xmm4
+	movdqa	%xmm0,%xmm3
+	psllq	$5,%xmm0
+	pxor	%xmm0,%xmm3
+	psllq	$1,%xmm0
+	pxor	%xmm3,%xmm0
+.byte	102,15,58,68,242,0
+	movups	32(%edx),%xmm5
+	psllq	$57,%xmm0
+	movdqa	%xmm0,%xmm3
+	pslldq	$8,%xmm0
+	psrldq	$8,%xmm3
+	pxor	%xmm4,%xmm0
+	pxor	%xmm3,%xmm1
+	pshufd	$78,%xmm7,%xmm3
+	movdqa	%xmm0,%xmm4
+	psrlq	$1,%xmm0
+	pxor	%xmm7,%xmm3
+	pxor	%xmm4,%xmm1
+.byte	102,15,58,68,250,17
+	movups	16(%edx),%xmm2
+	pxor	%xmm0,%xmm4
+	psrlq	$5,%xmm0
+	pxor	%xmm4,%xmm0
+	psrlq	$1,%xmm0
+	pxor	%xmm1,%xmm0
+.byte	102,15,58,68,221,0
+	leal	32(%esi),%esi
+	subl	$32,%ebx
+	ja	L015mod_loop
+L014even_tail:
+	pshufd	$78,%xmm0,%xmm4
+	movdqa	%xmm0,%xmm1
+	pxor	%xmm0,%xmm4
+.byte	102,15,58,68,194,0
+.byte	102,15,58,68,202,17
+.byte	102,15,58,68,229,16
+	movdqa	(%ecx),%xmm5
+	xorps	%xmm6,%xmm0
+	xorps	%xmm7,%xmm1
+	pxor	%xmm0,%xmm3
+	pxor	%xmm1,%xmm3
+	pxor	%xmm3,%xmm4
+	movdqa	%xmm4,%xmm3
+	psrldq	$8,%xmm4
+	pslldq	$8,%xmm3
+	pxor	%xmm4,%xmm1
+	pxor	%xmm3,%xmm0
+	movdqa	%xmm0,%xmm4
+	movdqa	%xmm0,%xmm3
+	psllq	$5,%xmm0
+	pxor	%xmm0,%xmm3
+	psllq	$1,%xmm0
+	pxor	%xmm3,%xmm0
+	psllq	$57,%xmm0
+	movdqa	%xmm0,%xmm3
+	pslldq	$8,%xmm0
+	psrldq	$8,%xmm3
+	pxor	%xmm4,%xmm0
+	pxor	%xmm3,%xmm1
+	movdqa	%xmm0,%xmm4
+	psrlq	$1,%xmm0
+	pxor	%xmm4,%xmm1
+	pxor	%xmm0,%xmm4
+	psrlq	$5,%xmm0
+	pxor	%xmm4,%xmm0
+	psrlq	$1,%xmm0
+	pxor	%xmm1,%xmm0
+	testl	%ebx,%ebx
+	jnz	L016done
+	movups	(%edx),%xmm2
+L013odd_tail:
+	movdqu	(%esi),%xmm3
+.byte	102,15,56,0,221
+	pxor	%xmm3,%xmm0
+	movdqa	%xmm0,%xmm1
+	pshufd	$78,%xmm0,%xmm3
+	pshufd	$78,%xmm2,%xmm4
+	pxor	%xmm0,%xmm3
+	pxor	%xmm2,%xmm4
+.byte	102,15,58,68,194,0
+.byte	102,15,58,68,202,17
+.byte	102,15,58,68,220,0
+	xorps	%xmm0,%xmm3
+	xorps	%xmm1,%xmm3
+	movdqa	%xmm3,%xmm4
+	psrldq	$8,%xmm3
+	pslldq	$8,%xmm4
+	pxor	%xmm3,%xmm1
+	pxor	%xmm4,%xmm0
+	movdqa	%xmm0,%xmm4
+	movdqa	%xmm0,%xmm3
+	psllq	$5,%xmm0
+	pxor	%xmm0,%xmm3
+	psllq	$1,%xmm0
+	pxor	%xmm3,%xmm0
+	psllq	$57,%xmm0
+	movdqa	%xmm0,%xmm3
+	pslldq	$8,%xmm0
+	psrldq	$8,%xmm3
+	pxor	%xmm4,%xmm0
+	pxor	%xmm3,%xmm1
+	movdqa	%xmm0,%xmm4
+	psrlq	$1,%xmm0
+	pxor	%xmm4,%xmm1
+	pxor	%xmm0,%xmm4
+	psrlq	$5,%xmm0
+	pxor	%xmm4,%xmm0
+	psrlq	$1,%xmm0
+	pxor	%xmm1,%xmm0
+L016done:
+.byte	102,15,56,0,197
+	movdqu	%xmm0,(%eax)
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.align	6,0x90
+Lbswap:
+.byte	15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0
+.byte	1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,194
+.align	6,0x90
+Lrem_8bit:
+.value	0,450,900,582,1800,1738,1164,1358
+.value	3600,4050,3476,3158,2328,2266,2716,2910
+.value	7200,7650,8100,7782,6952,6890,6316,6510
+.value	4656,5106,4532,4214,5432,5370,5820,6014
+.value	14400,14722,15300,14854,16200,16010,15564,15630
+.value	13904,14226,13780,13334,12632,12442,13020,13086
+.value	9312,9634,10212,9766,9064,8874,8428,8494
+.value	10864,11186,10740,10294,11640,11450,12028,12094
+.value	28800,28994,29444,29382,30600,30282,29708,30158
+.value	32400,32594,32020,31958,31128,30810,31260,31710
+.value	27808,28002,28452,28390,27560,27242,26668,27118
+.value	25264,25458,24884,24822,26040,25722,26172,26622
+.value	18624,18690,19268,19078,20424,19978,19532,19854
+.value	18128,18194,17748,17558,16856,16410,16988,17310
+.value	21728,21794,22372,22182,21480,21034,20588,20910
+.value	23280,23346,22900,22710,24056,23610,24188,24510
+.value	57600,57538,57988,58182,58888,59338,58764,58446
+.value	61200,61138,60564,60758,59416,59866,60316,59998
+.value	64800,64738,65188,65382,64040,64490,63916,63598
+.value	62256,62194,61620,61814,62520,62970,63420,63102
+.value	55616,55426,56004,56070,56904,57226,56780,56334
+.value	55120,54930,54484,54550,53336,53658,54236,53790
+.value	50528,50338,50916,50982,49768,50090,49644,49198
+.value	52080,51890,51444,51510,52344,52666,53244,52798
+.value	37248,36930,37380,37830,38536,38730,38156,38094
+.value	40848,40530,39956,40406,39064,39258,39708,39646
+.value	36256,35938,36388,36838,35496,35690,35116,35054
+.value	33712,33394,32820,33270,33976,34170,34620,34558
+.value	43456,43010,43588,43910,44744,44810,44364,44174
+.value	42960,42514,42068,42390,41176,41242,41820,41630
+.value	46560,46114,46692,47014,45800,45866,45420,45230
+.value	48112,47666,47220,47542,48376,48442,49020,48830
+.align	6,0x90
+Lrem_4bit:
+.long	0,0,0,471859200,0,943718400,0,610271232
+.long	0,1887436800,0,1822425088,0,1220542464,0,1423966208
+.long	0,3774873600,0,4246732800,0,3644850176,0,3311403008
+.long	0,2441084928,0,2376073216,0,2847932416,0,3051356160
+.byte	71,72,65,83,72,32,102,111,114,32,120,56,54,44,32,67
+.byte	82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112
+.byte	112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62
+.byte	0
+#endif
diff --git a/third_party/boringssl/mac-x86/crypto/rc4/rc4-586.S b/third_party/boringssl/mac-x86/crypto/rc4/rc4-586.S
new file mode 100644
index 0000000..faecdfa
--- /dev/null
+++ b/third_party/boringssl/mac-x86/crypto/rc4/rc4-586.S
@@ -0,0 +1,383 @@
+#if defined(__i386__)
+.file	"rc4-586.S"
+.text
+.globl	_asm_RC4
+.private_extern	_asm_RC4
+.align	4
+_asm_RC4:
+L_asm_RC4_begin:
+	pushl	%ebp
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+	movl	20(%esp),%edi
+	movl	24(%esp),%edx
+	movl	28(%esp),%esi
+	movl	32(%esp),%ebp
+	xorl	%eax,%eax
+	xorl	%ebx,%ebx
+	cmpl	$0,%edx
+	je	L000abort
+	movb	(%edi),%al
+	movb	4(%edi),%bl
+	addl	$8,%edi
+	leal	(%esi,%edx,1),%ecx
+	subl	%esi,%ebp
+	movl	%ecx,24(%esp)
+	incb	%al
+	cmpl	$-1,256(%edi)
+	je	L001RC4_CHAR
+	movl	(%edi,%eax,4),%ecx
+	andl	$-4,%edx
+	jz	L002loop1
+	movl	%ebp,32(%esp)
+	testl	$-8,%edx
+	jz	L003go4loop4
+	call	L004PIC_me_up
+L004PIC_me_up:
+	popl	%ebp
+	movl	L_OPENSSL_ia32cap_P$non_lazy_ptr-L004PIC_me_up(%ebp),%ebp
+	btl	$26,(%ebp)
+	jnc	L003go4loop4
+	movl	32(%esp),%ebp
+	andl	$-8,%edx
+	leal	-8(%esi,%edx,1),%edx
+	movl	%edx,-4(%edi)
+	addb	%cl,%bl
+	movl	(%edi,%ebx,4),%edx
+	movl	%ecx,(%edi,%ebx,4)
+	movl	%edx,(%edi,%eax,4)
+	incl	%eax
+	addl	%ecx,%edx
+	movzbl	%al,%eax
+	movzbl	%dl,%edx
+	movq	(%esi),%mm0
+	movl	(%edi,%eax,4),%ecx
+	movd	(%edi,%edx,4),%mm2
+	jmp	L005loop_mmx_enter
+.align	4,0x90
+L006loop_mmx:
+	addb	%cl,%bl
+	psllq	$56,%mm1
+	movl	(%edi,%ebx,4),%edx
+	movl	%ecx,(%edi,%ebx,4)
+	movl	%edx,(%edi,%eax,4)
+	incl	%eax
+	addl	%ecx,%edx
+	movzbl	%al,%eax
+	movzbl	%dl,%edx
+	pxor	%mm1,%mm2
+	movq	(%esi),%mm0
+	movq	%mm2,-8(%ebp,%esi,1)
+	movl	(%edi,%eax,4),%ecx
+	movd	(%edi,%edx,4),%mm2
+L005loop_mmx_enter:
+	addb	%cl,%bl
+	movl	(%edi,%ebx,4),%edx
+	movl	%ecx,(%edi,%ebx,4)
+	movl	%edx,(%edi,%eax,4)
+	incl	%eax
+	addl	%ecx,%edx
+	movzbl	%al,%eax
+	movzbl	%dl,%edx
+	pxor	%mm0,%mm2
+	movl	(%edi,%eax,4),%ecx
+	movd	(%edi,%edx,4),%mm1
+	addb	%cl,%bl
+	psllq	$8,%mm1
+	movl	(%edi,%ebx,4),%edx
+	movl	%ecx,(%edi,%ebx,4)
+	movl	%edx,(%edi,%eax,4)
+	incl	%eax
+	addl	%ecx,%edx
+	movzbl	%al,%eax
+	movzbl	%dl,%edx
+	pxor	%mm1,%mm2
+	movl	(%edi,%eax,4),%ecx
+	movd	(%edi,%edx,4),%mm1
+	addb	%cl,%bl
+	psllq	$16,%mm1
+	movl	(%edi,%ebx,4),%edx
+	movl	%ecx,(%edi,%ebx,4)
+	movl	%edx,(%edi,%eax,4)
+	incl	%eax
+	addl	%ecx,%edx
+	movzbl	%al,%eax
+	movzbl	%dl,%edx
+	pxor	%mm1,%mm2
+	movl	(%edi,%eax,4),%ecx
+	movd	(%edi,%edx,4),%mm1
+	addb	%cl,%bl
+	psllq	$24,%mm1
+	movl	(%edi,%ebx,4),%edx
+	movl	%ecx,(%edi,%ebx,4)
+	movl	%edx,(%edi,%eax,4)
+	incl	%eax
+	addl	%ecx,%edx
+	movzbl	%al,%eax
+	movzbl	%dl,%edx
+	pxor	%mm1,%mm2
+	movl	(%edi,%eax,4),%ecx
+	movd	(%edi,%edx,4),%mm1
+	addb	%cl,%bl
+	psllq	$32,%mm1
+	movl	(%edi,%ebx,4),%edx
+	movl	%ecx,(%edi,%ebx,4)
+	movl	%edx,(%edi,%eax,4)
+	incl	%eax
+	addl	%ecx,%edx
+	movzbl	%al,%eax
+	movzbl	%dl,%edx
+	pxor	%mm1,%mm2
+	movl	(%edi,%eax,4),%ecx
+	movd	(%edi,%edx,4),%mm1
+	addb	%cl,%bl
+	psllq	$40,%mm1
+	movl	(%edi,%ebx,4),%edx
+	movl	%ecx,(%edi,%ebx,4)
+	movl	%edx,(%edi,%eax,4)
+	incl	%eax
+	addl	%ecx,%edx
+	movzbl	%al,%eax
+	movzbl	%dl,%edx
+	pxor	%mm1,%mm2
+	movl	(%edi,%eax,4),%ecx
+	movd	(%edi,%edx,4),%mm1
+	addb	%cl,%bl
+	psllq	$48,%mm1
+	movl	(%edi,%ebx,4),%edx
+	movl	%ecx,(%edi,%ebx,4)
+	movl	%edx,(%edi,%eax,4)
+	incl	%eax
+	addl	%ecx,%edx
+	movzbl	%al,%eax
+	movzbl	%dl,%edx
+	pxor	%mm1,%mm2
+	movl	(%edi,%eax,4),%ecx
+	movd	(%edi,%edx,4),%mm1
+	movl	%ebx,%edx
+	xorl	%ebx,%ebx
+	movb	%dl,%bl
+	cmpl	-4(%edi),%esi
+	leal	8(%esi),%esi
+	jb	L006loop_mmx
+	psllq	$56,%mm1
+	pxor	%mm1,%mm2
+	movq	%mm2,-8(%ebp,%esi,1)
+	emms
+	cmpl	24(%esp),%esi
+	je	L007done
+	jmp	L002loop1
+.align	4,0x90
+L003go4loop4:
+	leal	-4(%esi,%edx,1),%edx
+	movl	%edx,28(%esp)
+L008loop4:
+	addb	%cl,%bl
+	movl	(%edi,%ebx,4),%edx
+	movl	%ecx,(%edi,%ebx,4)
+	movl	%edx,(%edi,%eax,4)
+	addl	%ecx,%edx
+	incb	%al
+	andl	$255,%edx
+	movl	(%edi,%eax,4),%ecx
+	movl	(%edi,%edx,4),%ebp
+	addb	%cl,%bl
+	movl	(%edi,%ebx,4),%edx
+	movl	%ecx,(%edi,%ebx,4)
+	movl	%edx,(%edi,%eax,4)
+	addl	%ecx,%edx
+	incb	%al
+	andl	$255,%edx
+	rorl	$8,%ebp
+	movl	(%edi,%eax,4),%ecx
+	orl	(%edi,%edx,4),%ebp
+	addb	%cl,%bl
+	movl	(%edi,%ebx,4),%edx
+	movl	%ecx,(%edi,%ebx,4)
+	movl	%edx,(%edi,%eax,4)
+	addl	%ecx,%edx
+	incb	%al
+	andl	$255,%edx
+	rorl	$8,%ebp
+	movl	(%edi,%eax,4),%ecx
+	orl	(%edi,%edx,4),%ebp
+	addb	%cl,%bl
+	movl	(%edi,%ebx,4),%edx
+	movl	%ecx,(%edi,%ebx,4)
+	movl	%edx,(%edi,%eax,4)
+	addl	%ecx,%edx
+	incb	%al
+	andl	$255,%edx
+	rorl	$8,%ebp
+	movl	32(%esp),%ecx
+	orl	(%edi,%edx,4),%ebp
+	rorl	$8,%ebp
+	xorl	(%esi),%ebp
+	cmpl	28(%esp),%esi
+	movl	%ebp,(%ecx,%esi,1)
+	leal	4(%esi),%esi
+	movl	(%edi,%eax,4),%ecx
+	jb	L008loop4
+	cmpl	24(%esp),%esi
+	je	L007done
+	movl	32(%esp),%ebp
+.align	4,0x90
+L002loop1:
+	addb	%cl,%bl
+	movl	(%edi,%ebx,4),%edx
+	movl	%ecx,(%edi,%ebx,4)
+	movl	%edx,(%edi,%eax,4)
+	addl	%ecx,%edx
+	incb	%al
+	andl	$255,%edx
+	movl	(%edi,%edx,4),%edx
+	xorb	(%esi),%dl
+	leal	1(%esi),%esi
+	movl	(%edi,%eax,4),%ecx
+	cmpl	24(%esp),%esi
+	movb	%dl,-1(%ebp,%esi,1)
+	jb	L002loop1
+	jmp	L007done
+.align	4,0x90
+L001RC4_CHAR:
+	movzbl	(%edi,%eax,1),%ecx
+L009cloop1:
+	addb	%cl,%bl
+	movzbl	(%edi,%ebx,1),%edx
+	movb	%cl,(%edi,%ebx,1)
+	movb	%dl,(%edi,%eax,1)
+	addb	%cl,%dl
+	movzbl	(%edi,%edx,1),%edx
+	addb	$1,%al
+	xorb	(%esi),%dl
+	leal	1(%esi),%esi
+	movzbl	(%edi,%eax,1),%ecx
+	cmpl	24(%esp),%esi
+	movb	%dl,-1(%ebp,%esi,1)
+	jb	L009cloop1
+L007done:
+	decb	%al
+	movl	%ebx,-4(%edi)
+	movb	%al,-8(%edi)
+L000abort:
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.globl	_asm_RC4_set_key
+.private_extern	_asm_RC4_set_key
+.align	4
+_asm_RC4_set_key:
+L_asm_RC4_set_key_begin:
+	pushl	%ebp
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+	movl	20(%esp),%edi
+	movl	24(%esp),%ebp
+	movl	28(%esp),%esi
+	call	L010PIC_me_up
+L010PIC_me_up:
+	popl	%edx
+	movl	L_OPENSSL_ia32cap_P$non_lazy_ptr-L010PIC_me_up(%edx),%edx
+	leal	8(%edi),%edi
+	leal	(%esi,%ebp,1),%esi
+	negl	%ebp
+	xorl	%eax,%eax
+	movl	%ebp,-4(%edi)
+	btl	$20,(%edx)
+	jc	L011c1stloop
+.align	4,0x90
+L012w1stloop:
+	movl	%eax,(%edi,%eax,4)
+	addb	$1,%al
+	jnc	L012w1stloop
+	xorl	%ecx,%ecx
+	xorl	%edx,%edx
+.align	4,0x90
+L013w2ndloop:
+	movl	(%edi,%ecx,4),%eax
+	addb	(%esi,%ebp,1),%dl
+	addb	%al,%dl
+	addl	$1,%ebp
+	movl	(%edi,%edx,4),%ebx
+	jnz	L014wnowrap
+	movl	-4(%edi),%ebp
+L014wnowrap:
+	movl	%eax,(%edi,%edx,4)
+	movl	%ebx,(%edi,%ecx,4)
+	addb	$1,%cl
+	jnc	L013w2ndloop
+	jmp	L015exit
+.align	4,0x90
+L011c1stloop:
+	movb	%al,(%edi,%eax,1)
+	addb	$1,%al
+	jnc	L011c1stloop
+	xorl	%ecx,%ecx
+	xorl	%edx,%edx
+	xorl	%ebx,%ebx
+.align	4,0x90
+L016c2ndloop:
+	movb	(%edi,%ecx,1),%al
+	addb	(%esi,%ebp,1),%dl
+	addb	%al,%dl
+	addl	$1,%ebp
+	movb	(%edi,%edx,1),%bl
+	jnz	L017cnowrap
+	movl	-4(%edi),%ebp
+L017cnowrap:
+	movb	%al,(%edi,%edx,1)
+	movb	%bl,(%edi,%ecx,1)
+	addb	$1,%cl
+	jnc	L016c2ndloop
+	movl	$-1,256(%edi)
+L015exit:
+	xorl	%eax,%eax
+	movl	%eax,-8(%edi)
+	movl	%eax,-4(%edi)
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.globl	_RC4_options
+.private_extern	_RC4_options
+.align	4
+_RC4_options:
+L_RC4_options_begin:
+	call	L018pic_point
+L018pic_point:
+	popl	%eax
+	leal	L019opts-L018pic_point(%eax),%eax
+	call	L020PIC_me_up
+L020PIC_me_up:
+	popl	%edx
+	movl	L_OPENSSL_ia32cap_P$non_lazy_ptr-L020PIC_me_up(%edx),%edx
+	movl	(%edx),%edx
+	btl	$20,%edx
+	jc	L0211xchar
+	btl	$26,%edx
+	jnc	L022ret
+	addl	$25,%eax
+	ret
+L0211xchar:
+	addl	$12,%eax
+L022ret:
+	ret
+.align	6,0x90
+L019opts:
+.byte	114,99,52,40,52,120,44,105,110,116,41,0
+.byte	114,99,52,40,49,120,44,99,104,97,114,41,0
+.byte	114,99,52,40,56,120,44,109,109,120,41,0
+.byte	82,67,52,32,102,111,114,32,120,56,54,44,32,67,82,89
+.byte	80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114
+.byte	111,64,111,112,101,110,115,115,108,46,111,114,103,62,0
+.align	6,0x90
+.section __IMPORT,__pointers,non_lazy_symbol_pointers
+L_OPENSSL_ia32cap_P$non_lazy_ptr:
+.indirect_symbol	_OPENSSL_ia32cap_P
+.long	0
+#endif
diff --git a/third_party/boringssl/mac-x86/crypto/sha/sha1-586.S b/third_party/boringssl/mac-x86/crypto/sha/sha1-586.S
new file mode 100644
index 0000000..97aafbf
--- /dev/null
+++ b/third_party/boringssl/mac-x86/crypto/sha/sha1-586.S
@@ -0,0 +1,2797 @@
+#if defined(__i386__)
+.file	"sha1-586.S"
+.text
+.globl	_sha1_block_data_order
+.private_extern	_sha1_block_data_order
+.align	4
+_sha1_block_data_order:
+L_sha1_block_data_order_begin:
+	pushl	%ebp
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+	call	L000pic_point
+L000pic_point:
+	popl	%ebp
+	movl	L_OPENSSL_ia32cap_P$non_lazy_ptr-L000pic_point(%ebp),%esi
+	leal	LK_XX_XX-L000pic_point(%ebp),%ebp
+	movl	(%esi),%eax
+	movl	4(%esi),%edx
+	testl	$512,%edx
+	jz	L001x86
+	movl	8(%esi),%ecx
+	testl	$16777216,%eax
+	jz	L001x86
+	testl	$536870912,%ecx
+	jnz	Lshaext_shortcut
+	jmp	Lssse3_shortcut
+.align	4,0x90
+L001x86:
+	movl	20(%esp),%ebp
+	movl	24(%esp),%esi
+	movl	28(%esp),%eax
+	subl	$76,%esp
+	shll	$6,%eax
+	addl	%esi,%eax
+	movl	%eax,104(%esp)
+	movl	16(%ebp),%edi
+	jmp	L002loop
+.align	4,0x90
+L002loop:
+	movl	(%esi),%eax
+	movl	4(%esi),%ebx
+	movl	8(%esi),%ecx
+	movl	12(%esi),%edx
+	bswap	%eax
+	bswap	%ebx
+	bswap	%ecx
+	bswap	%edx
+	movl	%eax,(%esp)
+	movl	%ebx,4(%esp)
+	movl	%ecx,8(%esp)
+	movl	%edx,12(%esp)
+	movl	16(%esi),%eax
+	movl	20(%esi),%ebx
+	movl	24(%esi),%ecx
+	movl	28(%esi),%edx
+	bswap	%eax
+	bswap	%ebx
+	bswap	%ecx
+	bswap	%edx
+	movl	%eax,16(%esp)
+	movl	%ebx,20(%esp)
+	movl	%ecx,24(%esp)
+	movl	%edx,28(%esp)
+	movl	32(%esi),%eax
+	movl	36(%esi),%ebx
+	movl	40(%esi),%ecx
+	movl	44(%esi),%edx
+	bswap	%eax
+	bswap	%ebx
+	bswap	%ecx
+	bswap	%edx
+	movl	%eax,32(%esp)
+	movl	%ebx,36(%esp)
+	movl	%ecx,40(%esp)
+	movl	%edx,44(%esp)
+	movl	48(%esi),%eax
+	movl	52(%esi),%ebx
+	movl	56(%esi),%ecx
+	movl	60(%esi),%edx
+	bswap	%eax
+	bswap	%ebx
+	bswap	%ecx
+	bswap	%edx
+	movl	%eax,48(%esp)
+	movl	%ebx,52(%esp)
+	movl	%ecx,56(%esp)
+	movl	%edx,60(%esp)
+	movl	%esi,100(%esp)
+	movl	(%ebp),%eax
+	movl	4(%ebp),%ebx
+	movl	8(%ebp),%ecx
+	movl	12(%ebp),%edx
+	# 00_15 0 
+	movl	%ecx,%esi
+	movl	%eax,%ebp
+	roll	$5,%ebp
+	xorl	%edx,%esi
+	addl	%edi,%ebp
+	movl	(%esp),%edi
+	andl	%ebx,%esi
+	rorl	$2,%ebx
+	xorl	%edx,%esi
+	leal	1518500249(%ebp,%edi,1),%ebp
+	addl	%esi,%ebp
+	# 00_15 1 
+	movl	%ebx,%edi
+	movl	%ebp,%esi
+	roll	$5,%ebp
+	xorl	%ecx,%edi
+	addl	%edx,%ebp
+	movl	4(%esp),%edx
+	andl	%eax,%edi
+	rorl	$2,%eax
+	xorl	%ecx,%edi
+	leal	1518500249(%ebp,%edx,1),%ebp
+	addl	%edi,%ebp
+	# 00_15 2 
+	movl	%eax,%edx
+	movl	%ebp,%edi
+	roll	$5,%ebp
+	xorl	%ebx,%edx
+	addl	%ecx,%ebp
+	movl	8(%esp),%ecx
+	andl	%esi,%edx
+	rorl	$2,%esi
+	xorl	%ebx,%edx
+	leal	1518500249(%ebp,%ecx,1),%ebp
+	addl	%edx,%ebp
+	# 00_15 3 
+	movl	%esi,%ecx
+	movl	%ebp,%edx
+	roll	$5,%ebp
+	xorl	%eax,%ecx
+	addl	%ebx,%ebp
+	movl	12(%esp),%ebx
+	andl	%edi,%ecx
+	rorl	$2,%edi
+	xorl	%eax,%ecx
+	leal	1518500249(%ebp,%ebx,1),%ebp
+	addl	%ecx,%ebp
+	# 00_15 4 
+	movl	%edi,%ebx
+	movl	%ebp,%ecx
+	roll	$5,%ebp
+	xorl	%esi,%ebx
+	addl	%eax,%ebp
+	movl	16(%esp),%eax
+	andl	%edx,%ebx
+	rorl	$2,%edx
+	xorl	%esi,%ebx
+	leal	1518500249(%ebp,%eax,1),%ebp
+	addl	%ebx,%ebp
+	# 00_15 5 
+	movl	%edx,%eax
+	movl	%ebp,%ebx
+	roll	$5,%ebp
+	xorl	%edi,%eax
+	addl	%esi,%ebp
+	movl	20(%esp),%esi
+	andl	%ecx,%eax
+	rorl	$2,%ecx
+	xorl	%edi,%eax
+	leal	1518500249(%ebp,%esi,1),%ebp
+	addl	%eax,%ebp
+	# 00_15 6 
+	movl	%ecx,%esi
+	movl	%ebp,%eax
+	roll	$5,%ebp
+	xorl	%edx,%esi
+	addl	%edi,%ebp
+	movl	24(%esp),%edi
+	andl	%ebx,%esi
+	rorl	$2,%ebx
+	xorl	%edx,%esi
+	leal	1518500249(%ebp,%edi,1),%ebp
+	addl	%esi,%ebp
+	# 00_15 7 
+	movl	%ebx,%edi
+	movl	%ebp,%esi
+	roll	$5,%ebp
+	xorl	%ecx,%edi
+	addl	%edx,%ebp
+	movl	28(%esp),%edx
+	andl	%eax,%edi
+	rorl	$2,%eax
+	xorl	%ecx,%edi
+	leal	1518500249(%ebp,%edx,1),%ebp
+	addl	%edi,%ebp
+	# 00_15 8 
+	movl	%eax,%edx
+	movl	%ebp,%edi
+	roll	$5,%ebp
+	xorl	%ebx,%edx
+	addl	%ecx,%ebp
+	movl	32(%esp),%ecx
+	andl	%esi,%edx
+	rorl	$2,%esi
+	xorl	%ebx,%edx
+	leal	1518500249(%ebp,%ecx,1),%ebp
+	addl	%edx,%ebp
+	# 00_15 9 
+	movl	%esi,%ecx
+	movl	%ebp,%edx
+	roll	$5,%ebp
+	xorl	%eax,%ecx
+	addl	%ebx,%ebp
+	movl	36(%esp),%ebx
+	andl	%edi,%ecx
+	rorl	$2,%edi
+	xorl	%eax,%ecx
+	leal	1518500249(%ebp,%ebx,1),%ebp
+	addl	%ecx,%ebp
+	# 00_15 10 
+	movl	%edi,%ebx
+	movl	%ebp,%ecx
+	roll	$5,%ebp
+	xorl	%esi,%ebx
+	addl	%eax,%ebp
+	movl	40(%esp),%eax
+	andl	%edx,%ebx
+	rorl	$2,%edx
+	xorl	%esi,%ebx
+	leal	1518500249(%ebp,%eax,1),%ebp
+	addl	%ebx,%ebp
+	# 00_15 11 
+	movl	%edx,%eax
+	movl	%ebp,%ebx
+	roll	$5,%ebp
+	xorl	%edi,%eax
+	addl	%esi,%ebp
+	movl	44(%esp),%esi
+	andl	%ecx,%eax
+	rorl	$2,%ecx
+	xorl	%edi,%eax
+	leal	1518500249(%ebp,%esi,1),%ebp
+	addl	%eax,%ebp
+	# 00_15 12 
+	movl	%ecx,%esi
+	movl	%ebp,%eax
+	roll	$5,%ebp
+	xorl	%edx,%esi
+	addl	%edi,%ebp
+	movl	48(%esp),%edi
+	andl	%ebx,%esi
+	rorl	$2,%ebx
+	xorl	%edx,%esi
+	leal	1518500249(%ebp,%edi,1),%ebp
+	addl	%esi,%ebp
+	# 00_15 13 
+	movl	%ebx,%edi
+	movl	%ebp,%esi
+	roll	$5,%ebp
+	xorl	%ecx,%edi
+	addl	%edx,%ebp
+	movl	52(%esp),%edx
+	andl	%eax,%edi
+	rorl	$2,%eax
+	xorl	%ecx,%edi
+	leal	1518500249(%ebp,%edx,1),%ebp
+	addl	%edi,%ebp
+	# 00_15 14 
+	movl	%eax,%edx
+	movl	%ebp,%edi
+	roll	$5,%ebp
+	xorl	%ebx,%edx
+	addl	%ecx,%ebp
+	movl	56(%esp),%ecx
+	andl	%esi,%edx
+	rorl	$2,%esi
+	xorl	%ebx,%edx
+	leal	1518500249(%ebp,%ecx,1),%ebp
+	addl	%edx,%ebp
+	# 00_15 15 
+	movl	%esi,%ecx
+	movl	%ebp,%edx
+	roll	$5,%ebp
+	xorl	%eax,%ecx
+	addl	%ebx,%ebp
+	movl	60(%esp),%ebx
+	andl	%edi,%ecx
+	rorl	$2,%edi
+	xorl	%eax,%ecx
+	leal	1518500249(%ebp,%ebx,1),%ebp
+	movl	(%esp),%ebx
+	addl	%ebp,%ecx
+	# 16_19 16 
+	movl	%edi,%ebp
+	xorl	8(%esp),%ebx
+	xorl	%esi,%ebp
+	xorl	32(%esp),%ebx
+	andl	%edx,%ebp
+	xorl	52(%esp),%ebx
+	roll	$1,%ebx
+	xorl	%esi,%ebp
+	addl	%ebp,%eax
+	movl	%ecx,%ebp
+	rorl	$2,%edx
+	movl	%ebx,(%esp)
+	roll	$5,%ebp
+	leal	1518500249(%ebx,%eax,1),%ebx
+	movl	4(%esp),%eax
+	addl	%ebp,%ebx
+	# 16_19 17 
+	movl	%edx,%ebp
+	xorl	12(%esp),%eax
+	xorl	%edi,%ebp
+	xorl	36(%esp),%eax
+	andl	%ecx,%ebp
+	xorl	56(%esp),%eax
+	roll	$1,%eax
+	xorl	%edi,%ebp
+	addl	%ebp,%esi
+	movl	%ebx,%ebp
+	rorl	$2,%ecx
+	movl	%eax,4(%esp)
+	roll	$5,%ebp
+	leal	1518500249(%eax,%esi,1),%eax
+	movl	8(%esp),%esi
+	addl	%ebp,%eax
+	# 16_19 18 
+	movl	%ecx,%ebp
+	xorl	16(%esp),%esi
+	xorl	%edx,%ebp
+	xorl	40(%esp),%esi
+	andl	%ebx,%ebp
+	xorl	60(%esp),%esi
+	roll	$1,%esi
+	xorl	%edx,%ebp
+	addl	%ebp,%edi
+	movl	%eax,%ebp
+	rorl	$2,%ebx
+	movl	%esi,8(%esp)
+	roll	$5,%ebp
+	leal	1518500249(%esi,%edi,1),%esi
+	movl	12(%esp),%edi
+	addl	%ebp,%esi
+	# 16_19 19 
+	movl	%ebx,%ebp
+	xorl	20(%esp),%edi
+	xorl	%ecx,%ebp
+	xorl	44(%esp),%edi
+	andl	%eax,%ebp
+	xorl	(%esp),%edi
+	roll	$1,%edi
+	xorl	%ecx,%ebp
+	addl	%ebp,%edx
+	movl	%esi,%ebp
+	rorl	$2,%eax
+	movl	%edi,12(%esp)
+	roll	$5,%ebp
+	leal	1518500249(%edi,%edx,1),%edi
+	movl	16(%esp),%edx
+	addl	%ebp,%edi
+	# 20_39 20 
+	movl	%esi,%ebp
+	xorl	24(%esp),%edx
+	xorl	%eax,%ebp
+	xorl	48(%esp),%edx
+	xorl	%ebx,%ebp
+	xorl	4(%esp),%edx
+	roll	$1,%edx
+	addl	%ebp,%ecx
+	rorl	$2,%esi
+	movl	%edi,%ebp
+	roll	$5,%ebp
+	movl	%edx,16(%esp)
+	leal	1859775393(%edx,%ecx,1),%edx
+	movl	20(%esp),%ecx
+	addl	%ebp,%edx
+	# 20_39 21 
+	movl	%edi,%ebp
+	xorl	28(%esp),%ecx
+	xorl	%esi,%ebp
+	xorl	52(%esp),%ecx
+	xorl	%eax,%ebp
+	xorl	8(%esp),%ecx
+	roll	$1,%ecx
+	addl	%ebp,%ebx
+	rorl	$2,%edi
+	movl	%edx,%ebp
+	roll	$5,%ebp
+	movl	%ecx,20(%esp)
+	leal	1859775393(%ecx,%ebx,1),%ecx
+	movl	24(%esp),%ebx
+	addl	%ebp,%ecx
+	# 20_39 22 
+	movl	%edx,%ebp
+	xorl	32(%esp),%ebx
+	xorl	%edi,%ebp
+	xorl	56(%esp),%ebx
+	xorl	%esi,%ebp
+	xorl	12(%esp),%ebx
+	roll	$1,%ebx
+	addl	%ebp,%eax
+	rorl	$2,%edx
+	movl	%ecx,%ebp
+	roll	$5,%ebp
+	movl	%ebx,24(%esp)
+	leal	1859775393(%ebx,%eax,1),%ebx
+	movl	28(%esp),%eax
+	addl	%ebp,%ebx
+	# 20_39 23 
+	movl	%ecx,%ebp
+	xorl	36(%esp),%eax
+	xorl	%edx,%ebp
+	xorl	60(%esp),%eax
+	xorl	%edi,%ebp
+	xorl	16(%esp),%eax
+	roll	$1,%eax
+	addl	%ebp,%esi
+	rorl	$2,%ecx
+	movl	%ebx,%ebp
+	roll	$5,%ebp
+	movl	%eax,28(%esp)
+	leal	1859775393(%eax,%esi,1),%eax
+	movl	32(%esp),%esi
+	addl	%ebp,%eax
+	# 20_39 24 
+	movl	%ebx,%ebp
+	xorl	40(%esp),%esi
+	xorl	%ecx,%ebp
+	xorl	(%esp),%esi
+	xorl	%edx,%ebp
+	xorl	20(%esp),%esi
+	roll	$1,%esi
+	addl	%ebp,%edi
+	rorl	$2,%ebx
+	movl	%eax,%ebp
+	roll	$5,%ebp
+	movl	%esi,32(%esp)
+	leal	1859775393(%esi,%edi,1),%esi
+	movl	36(%esp),%edi
+	addl	%ebp,%esi
+	# 20_39 25 
+	movl	%eax,%ebp
+	xorl	44(%esp),%edi
+	xorl	%ebx,%ebp
+	xorl	4(%esp),%edi
+	xorl	%ecx,%ebp
+	xorl	24(%esp),%edi
+	roll	$1,%edi
+	addl	%ebp,%edx
+	rorl	$2,%eax
+	movl	%esi,%ebp
+	roll	$5,%ebp
+	movl	%edi,36(%esp)
+	leal	1859775393(%edi,%edx,1),%edi
+	movl	40(%esp),%edx
+	addl	%ebp,%edi
+	# 20_39 26 
+	movl	%esi,%ebp
+	xorl	48(%esp),%edx
+	xorl	%eax,%ebp
+	xorl	8(%esp),%edx
+	xorl	%ebx,%ebp
+	xorl	28(%esp),%edx
+	roll	$1,%edx
+	addl	%ebp,%ecx
+	rorl	$2,%esi
+	movl	%edi,%ebp
+	roll	$5,%ebp
+	movl	%edx,40(%esp)
+	leal	1859775393(%edx,%ecx,1),%edx
+	movl	44(%esp),%ecx
+	addl	%ebp,%edx
+	# 20_39 27 
+	movl	%edi,%ebp
+	xorl	52(%esp),%ecx
+	xorl	%esi,%ebp
+	xorl	12(%esp),%ecx
+	xorl	%eax,%ebp
+	xorl	32(%esp),%ecx
+	roll	$1,%ecx
+	addl	%ebp,%ebx
+	rorl	$2,%edi
+	movl	%edx,%ebp
+	roll	$5,%ebp
+	movl	%ecx,44(%esp)
+	leal	1859775393(%ecx,%ebx,1),%ecx
+	movl	48(%esp),%ebx
+	addl	%ebp,%ecx
+	# 20_39 28 
+	movl	%edx,%ebp
+	xorl	56(%esp),%ebx
+	xorl	%edi,%ebp
+	xorl	16(%esp),%ebx
+	xorl	%esi,%ebp
+	xorl	36(%esp),%ebx
+	roll	$1,%ebx
+	addl	%ebp,%eax
+	rorl	$2,%edx
+	movl	%ecx,%ebp
+	roll	$5,%ebp
+	movl	%ebx,48(%esp)
+	leal	1859775393(%ebx,%eax,1),%ebx
+	movl	52(%esp),%eax
+	addl	%ebp,%ebx
+	# 20_39 29 
+	movl	%ecx,%ebp
+	xorl	60(%esp),%eax
+	xorl	%edx,%ebp
+	xorl	20(%esp),%eax
+	xorl	%edi,%ebp
+	xorl	40(%esp),%eax
+	roll	$1,%eax
+	addl	%ebp,%esi
+	rorl	$2,%ecx
+	movl	%ebx,%ebp
+	roll	$5,%ebp
+	movl	%eax,52(%esp)
+	leal	1859775393(%eax,%esi,1),%eax
+	movl	56(%esp),%esi
+	addl	%ebp,%eax
+	# 20_39 30 
+	movl	%ebx,%ebp
+	xorl	(%esp),%esi
+	xorl	%ecx,%ebp
+	xorl	24(%esp),%esi
+	xorl	%edx,%ebp
+	xorl	44(%esp),%esi
+	roll	$1,%esi
+	addl	%ebp,%edi
+	rorl	$2,%ebx
+	movl	%eax,%ebp
+	roll	$5,%ebp
+	movl	%esi,56(%esp)
+	leal	1859775393(%esi,%edi,1),%esi
+	movl	60(%esp),%edi
+	addl	%ebp,%esi
+	# 20_39 31 
+	movl	%eax,%ebp
+	xorl	4(%esp),%edi
+	xorl	%ebx,%ebp
+	xorl	28(%esp),%edi
+	xorl	%ecx,%ebp
+	xorl	48(%esp),%edi
+	roll	$1,%edi
+	addl	%ebp,%edx
+	rorl	$2,%eax
+	movl	%esi,%ebp
+	roll	$5,%ebp
+	movl	%edi,60(%esp)
+	leal	1859775393(%edi,%edx,1),%edi
+	movl	(%esp),%edx
+	addl	%ebp,%edi
+	# 20_39 32 
+	movl	%esi,%ebp
+	xorl	8(%esp),%edx
+	xorl	%eax,%ebp
+	xorl	32(%esp),%edx
+	xorl	%ebx,%ebp
+	xorl	52(%esp),%edx
+	roll	$1,%edx
+	addl	%ebp,%ecx
+	rorl	$2,%esi
+	movl	%edi,%ebp
+	roll	$5,%ebp
+	movl	%edx,(%esp)
+	leal	1859775393(%edx,%ecx,1),%edx
+	movl	4(%esp),%ecx
+	addl	%ebp,%edx
+	# 20_39 33 
+	movl	%edi,%ebp
+	xorl	12(%esp),%ecx
+	xorl	%esi,%ebp
+	xorl	36(%esp),%ecx
+	xorl	%eax,%ebp
+	xorl	56(%esp),%ecx
+	roll	$1,%ecx
+	addl	%ebp,%ebx
+	rorl	$2,%edi
+	movl	%edx,%ebp
+	roll	$5,%ebp
+	movl	%ecx,4(%esp)
+	leal	1859775393(%ecx,%ebx,1),%ecx
+	movl	8(%esp),%ebx
+	addl	%ebp,%ecx
+	# 20_39 34 
+	movl	%edx,%ebp
+	xorl	16(%esp),%ebx
+	xorl	%edi,%ebp
+	xorl	40(%esp),%ebx
+	xorl	%esi,%ebp
+	xorl	60(%esp),%ebx
+	roll	$1,%ebx
+	addl	%ebp,%eax
+	rorl	$2,%edx
+	movl	%ecx,%ebp
+	roll	$5,%ebp
+	movl	%ebx,8(%esp)
+	leal	1859775393(%ebx,%eax,1),%ebx
+	movl	12(%esp),%eax
+	addl	%ebp,%ebx
+	# 20_39 35 
+	movl	%ecx,%ebp
+	xorl	20(%esp),%eax
+	xorl	%edx,%ebp
+	xorl	44(%esp),%eax
+	xorl	%edi,%ebp
+	xorl	(%esp),%eax
+	roll	$1,%eax
+	addl	%ebp,%esi
+	rorl	$2,%ecx
+	movl	%ebx,%ebp
+	roll	$5,%ebp
+	movl	%eax,12(%esp)
+	leal	1859775393(%eax,%esi,1),%eax
+	movl	16(%esp),%esi
+	addl	%ebp,%eax
+	# 20_39 36 
+	movl	%ebx,%ebp
+	xorl	24(%esp),%esi
+	xorl	%ecx,%ebp
+	xorl	48(%esp),%esi
+	xorl	%edx,%ebp
+	xorl	4(%esp),%esi
+	roll	$1,%esi
+	addl	%ebp,%edi
+	rorl	$2,%ebx
+	movl	%eax,%ebp
+	roll	$5,%ebp
+	movl	%esi,16(%esp)
+	leal	1859775393(%esi,%edi,1),%esi
+	movl	20(%esp),%edi
+	addl	%ebp,%esi
+	# 20_39 37 
+	movl	%eax,%ebp
+	xorl	28(%esp),%edi
+	xorl	%ebx,%ebp
+	xorl	52(%esp),%edi
+	xorl	%ecx,%ebp
+	xorl	8(%esp),%edi
+	roll	$1,%edi
+	addl	%ebp,%edx
+	rorl	$2,%eax
+	movl	%esi,%ebp
+	roll	$5,%ebp
+	movl	%edi,20(%esp)
+	leal	1859775393(%edi,%edx,1),%edi
+	movl	24(%esp),%edx
+	addl	%ebp,%edi
+	# 20_39 38 
+	movl	%esi,%ebp
+	xorl	32(%esp),%edx
+	xorl	%eax,%ebp
+	xorl	56(%esp),%edx
+	xorl	%ebx,%ebp
+	xorl	12(%esp),%edx
+	roll	$1,%edx
+	addl	%ebp,%ecx
+	rorl	$2,%esi
+	movl	%edi,%ebp
+	roll	$5,%ebp
+	movl	%edx,24(%esp)
+	leal	1859775393(%edx,%ecx,1),%edx
+	movl	28(%esp),%ecx
+	addl	%ebp,%edx
+	# 20_39 39 
+	movl	%edi,%ebp
+	xorl	36(%esp),%ecx
+	xorl	%esi,%ebp
+	xorl	60(%esp),%ecx
+	xorl	%eax,%ebp
+	xorl	16(%esp),%ecx
+	roll	$1,%ecx
+	addl	%ebp,%ebx
+	rorl	$2,%edi
+	movl	%edx,%ebp
+	roll	$5,%ebp
+	movl	%ecx,28(%esp)
+	leal	1859775393(%ecx,%ebx,1),%ecx
+	movl	32(%esp),%ebx
+	addl	%ebp,%ecx
+	# 40_59 40 
+	movl	%edi,%ebp
+	xorl	40(%esp),%ebx
+	xorl	%esi,%ebp
+	xorl	(%esp),%ebx
+	andl	%edx,%ebp
+	xorl	20(%esp),%ebx
+	roll	$1,%ebx
+	addl	%eax,%ebp
+	rorl	$2,%edx
+	movl	%ecx,%eax
+	roll	$5,%eax
+	movl	%ebx,32(%esp)
+	leal	2400959708(%ebx,%ebp,1),%ebx
+	movl	%edi,%ebp
+	addl	%eax,%ebx
+	andl	%esi,%ebp
+	movl	36(%esp),%eax
+	addl	%ebp,%ebx
+	# 40_59 41 
+	movl	%edx,%ebp
+	xorl	44(%esp),%eax
+	xorl	%edi,%ebp
+	xorl	4(%esp),%eax
+	andl	%ecx,%ebp
+	xorl	24(%esp),%eax
+	roll	$1,%eax
+	addl	%esi,%ebp
+	rorl	$2,%ecx
+	movl	%ebx,%esi
+	roll	$5,%esi
+	movl	%eax,36(%esp)
+	leal	2400959708(%eax,%ebp,1),%eax
+	movl	%edx,%ebp
+	addl	%esi,%eax
+	andl	%edi,%ebp
+	movl	40(%esp),%esi
+	addl	%ebp,%eax
+	# 40_59 42 
+	movl	%ecx,%ebp
+	xorl	48(%esp),%esi
+	xorl	%edx,%ebp
+	xorl	8(%esp),%esi
+	andl	%ebx,%ebp
+	xorl	28(%esp),%esi
+	roll	$1,%esi
+	addl	%edi,%ebp
+	rorl	$2,%ebx
+	movl	%eax,%edi
+	roll	$5,%edi
+	movl	%esi,40(%esp)
+	leal	2400959708(%esi,%ebp,1),%esi
+	movl	%ecx,%ebp
+	addl	%edi,%esi
+	andl	%edx,%ebp
+	movl	44(%esp),%edi
+	addl	%ebp,%esi
+	# 40_59 43 
+	movl	%ebx,%ebp
+	xorl	52(%esp),%edi
+	xorl	%ecx,%ebp
+	xorl	12(%esp),%edi
+	andl	%eax,%ebp
+	xorl	32(%esp),%edi
+	roll	$1,%edi
+	addl	%edx,%ebp
+	rorl	$2,%eax
+	movl	%esi,%edx
+	roll	$5,%edx
+	movl	%edi,44(%esp)
+	leal	2400959708(%edi,%ebp,1),%edi
+	movl	%ebx,%ebp
+	addl	%edx,%edi
+	andl	%ecx,%ebp
+	movl	48(%esp),%edx
+	addl	%ebp,%edi
+	# 40_59 44 
+	movl	%eax,%ebp
+	xorl	56(%esp),%edx
+	xorl	%ebx,%ebp
+	xorl	16(%esp),%edx
+	andl	%esi,%ebp
+	xorl	36(%esp),%edx
+	roll	$1,%edx
+	addl	%ecx,%ebp
+	rorl	$2,%esi
+	movl	%edi,%ecx
+	roll	$5,%ecx
+	movl	%edx,48(%esp)
+	leal	2400959708(%edx,%ebp,1),%edx
+	movl	%eax,%ebp
+	addl	%ecx,%edx
+	andl	%ebx,%ebp
+	movl	52(%esp),%ecx
+	addl	%ebp,%edx
+	# 40_59 45 
+	movl	%esi,%ebp
+	xorl	60(%esp),%ecx
+	xorl	%eax,%ebp
+	xorl	20(%esp),%ecx
+	andl	%edi,%ebp
+	xorl	40(%esp),%ecx
+	roll	$1,%ecx
+	addl	%ebx,%ebp
+	rorl	$2,%edi
+	movl	%edx,%ebx
+	roll	$5,%ebx
+	movl	%ecx,52(%esp)
+	leal	2400959708(%ecx,%ebp,1),%ecx
+	movl	%esi,%ebp
+	addl	%ebx,%ecx
+	andl	%eax,%ebp
+	movl	56(%esp),%ebx
+	addl	%ebp,%ecx
+	# 40_59 46 
+	movl	%edi,%ebp
+	xorl	(%esp),%ebx
+	xorl	%esi,%ebp
+	xorl	24(%esp),%ebx
+	andl	%edx,%ebp
+	xorl	44(%esp),%ebx
+	roll	$1,%ebx
+	addl	%eax,%ebp
+	rorl	$2,%edx
+	movl	%ecx,%eax
+	roll	$5,%eax
+	movl	%ebx,56(%esp)
+	leal	2400959708(%ebx,%ebp,1),%ebx
+	movl	%edi,%ebp
+	addl	%eax,%ebx
+	andl	%esi,%ebp
+	movl	60(%esp),%eax
+	addl	%ebp,%ebx
+	# 40_59 47 
+	movl	%edx,%ebp
+	xorl	4(%esp),%eax
+	xorl	%edi,%ebp
+	xorl	28(%esp),%eax
+	andl	%ecx,%ebp
+	xorl	48(%esp),%eax
+	roll	$1,%eax
+	addl	%esi,%ebp
+	rorl	$2,%ecx
+	movl	%ebx,%esi
+	roll	$5,%esi
+	movl	%eax,60(%esp)
+	leal	2400959708(%eax,%ebp,1),%eax
+	movl	%edx,%ebp
+	addl	%esi,%eax
+	andl	%edi,%ebp
+	movl	(%esp),%esi
+	addl	%ebp,%eax
+	# 40_59 48 
+	movl	%ecx,%ebp
+	xorl	8(%esp),%esi
+	xorl	%edx,%ebp
+	xorl	32(%esp),%esi
+	andl	%ebx,%ebp
+	xorl	52(%esp),%esi
+	roll	$1,%esi
+	addl	%edi,%ebp
+	rorl	$2,%ebx
+	movl	%eax,%edi
+	roll	$5,%edi
+	movl	%esi,(%esp)
+	leal	2400959708(%esi,%ebp,1),%esi
+	movl	%ecx,%ebp
+	addl	%edi,%esi
+	andl	%edx,%ebp
+	movl	4(%esp),%edi
+	addl	%ebp,%esi
+	# 40_59 49 
+	movl	%ebx,%ebp
+	xorl	12(%esp),%edi
+	xorl	%ecx,%ebp
+	xorl	36(%esp),%edi
+	andl	%eax,%ebp
+	xorl	56(%esp),%edi
+	roll	$1,%edi
+	addl	%edx,%ebp
+	rorl	$2,%eax
+	movl	%esi,%edx
+	roll	$5,%edx
+	movl	%edi,4(%esp)
+	leal	2400959708(%edi,%ebp,1),%edi
+	movl	%ebx,%ebp
+	addl	%edx,%edi
+	andl	%ecx,%ebp
+	movl	8(%esp),%edx
+	addl	%ebp,%edi
+	# 40_59 50 
+	movl	%eax,%ebp
+	xorl	16(%esp),%edx
+	xorl	%ebx,%ebp
+	xorl	40(%esp),%edx
+	andl	%esi,%ebp
+	xorl	60(%esp),%edx
+	roll	$1,%edx
+	addl	%ecx,%ebp
+	rorl	$2,%esi
+	movl	%edi,%ecx
+	roll	$5,%ecx
+	movl	%edx,8(%esp)
+	leal	2400959708(%edx,%ebp,1),%edx
+	movl	%eax,%ebp
+	addl	%ecx,%edx
+	andl	%ebx,%ebp
+	movl	12(%esp),%ecx
+	addl	%ebp,%edx
+	# 40_59 51 
+	movl	%esi,%ebp
+	xorl	20(%esp),%ecx
+	xorl	%eax,%ebp
+	xorl	44(%esp),%ecx
+	andl	%edi,%ebp
+	xorl	(%esp),%ecx
+	roll	$1,%ecx
+	addl	%ebx,%ebp
+	rorl	$2,%edi
+	movl	%edx,%ebx
+	roll	$5,%ebx
+	movl	%ecx,12(%esp)
+	leal	2400959708(%ecx,%ebp,1),%ecx
+	movl	%esi,%ebp
+	addl	%ebx,%ecx
+	andl	%eax,%ebp
+	movl	16(%esp),%ebx
+	addl	%ebp,%ecx
+	# 40_59 52 
+	movl	%edi,%ebp
+	xorl	24(%esp),%ebx
+	xorl	%esi,%ebp
+	xorl	48(%esp),%ebx
+	andl	%edx,%ebp
+	xorl	4(%esp),%ebx
+	roll	$1,%ebx
+	addl	%eax,%ebp
+	rorl	$2,%edx
+	movl	%ecx,%eax
+	roll	$5,%eax
+	movl	%ebx,16(%esp)
+	leal	2400959708(%ebx,%ebp,1),%ebx
+	movl	%edi,%ebp
+	addl	%eax,%ebx
+	andl	%esi,%ebp
+	movl	20(%esp),%eax
+	addl	%ebp,%ebx
+	# 40_59 53 
+	movl	%edx,%ebp
+	xorl	28(%esp),%eax
+	xorl	%edi,%ebp
+	xorl	52(%esp),%eax
+	andl	%ecx,%ebp
+	xorl	8(%esp),%eax
+	roll	$1,%eax
+	addl	%esi,%ebp
+	rorl	$2,%ecx
+	movl	%ebx,%esi
+	roll	$5,%esi
+	movl	%eax,20(%esp)
+	leal	2400959708(%eax,%ebp,1),%eax
+	movl	%edx,%ebp
+	addl	%esi,%eax
+	andl	%edi,%ebp
+	movl	24(%esp),%esi
+	addl	%ebp,%eax
+	# 40_59 54 
+	movl	%ecx,%ebp
+	xorl	32(%esp),%esi
+	xorl	%edx,%ebp
+	xorl	56(%esp),%esi
+	andl	%ebx,%ebp
+	xorl	12(%esp),%esi
+	roll	$1,%esi
+	addl	%edi,%ebp
+	rorl	$2,%ebx
+	movl	%eax,%edi
+	roll	$5,%edi
+	movl	%esi,24(%esp)
+	leal	2400959708(%esi,%ebp,1),%esi
+	movl	%ecx,%ebp
+	addl	%edi,%esi
+	andl	%edx,%ebp
+	movl	28(%esp),%edi
+	addl	%ebp,%esi
+	# 40_59 55 
+	movl	%ebx,%ebp
+	xorl	36(%esp),%edi
+	xorl	%ecx,%ebp
+	xorl	60(%esp),%edi
+	andl	%eax,%ebp
+	xorl	16(%esp),%edi
+	roll	$1,%edi
+	addl	%edx,%ebp
+	rorl	$2,%eax
+	movl	%esi,%edx
+	roll	$5,%edx
+	movl	%edi,28(%esp)
+	leal	2400959708(%edi,%ebp,1),%edi
+	movl	%ebx,%ebp
+	addl	%edx,%edi
+	andl	%ecx,%ebp
+	movl	32(%esp),%edx
+	addl	%ebp,%edi
+	# 40_59 56 
+	movl	%eax,%ebp
+	xorl	40(%esp),%edx
+	xorl	%ebx,%ebp
+	xorl	(%esp),%edx
+	andl	%esi,%ebp
+	xorl	20(%esp),%edx
+	roll	$1,%edx
+	addl	%ecx,%ebp
+	rorl	$2,%esi
+	movl	%edi,%ecx
+	roll	$5,%ecx
+	movl	%edx,32(%esp)
+	leal	2400959708(%edx,%ebp,1),%edx
+	movl	%eax,%ebp
+	addl	%ecx,%edx
+	andl	%ebx,%ebp
+	movl	36(%esp),%ecx
+	addl	%ebp,%edx
+	# 40_59 57 
+	movl	%esi,%ebp
+	xorl	44(%esp),%ecx
+	xorl	%eax,%ebp
+	xorl	4(%esp),%ecx
+	andl	%edi,%ebp
+	xorl	24(%esp),%ecx
+	roll	$1,%ecx
+	addl	%ebx,%ebp
+	rorl	$2,%edi
+	movl	%edx,%ebx
+	roll	$5,%ebx
+	movl	%ecx,36(%esp)
+	leal	2400959708(%ecx,%ebp,1),%ecx
+	movl	%esi,%ebp
+	addl	%ebx,%ecx
+	andl	%eax,%ebp
+	movl	40(%esp),%ebx
+	addl	%ebp,%ecx
+	# 40_59 58 
+	movl	%edi,%ebp
+	xorl	48(%esp),%ebx
+	xorl	%esi,%ebp
+	xorl	8(%esp),%ebx
+	andl	%edx,%ebp
+	xorl	28(%esp),%ebx
+	roll	$1,%ebx
+	addl	%eax,%ebp
+	rorl	$2,%edx
+	movl	%ecx,%eax
+	roll	$5,%eax
+	movl	%ebx,40(%esp)
+	leal	2400959708(%ebx,%ebp,1),%ebx
+	movl	%edi,%ebp
+	addl	%eax,%ebx
+	andl	%esi,%ebp
+	movl	44(%esp),%eax
+	addl	%ebp,%ebx
+	# 40_59 59 
+	movl	%edx,%ebp
+	xorl	52(%esp),%eax
+	xorl	%edi,%ebp
+	xorl	12(%esp),%eax
+	andl	%ecx,%ebp
+	xorl	32(%esp),%eax
+	roll	$1,%eax
+	addl	%esi,%ebp
+	rorl	$2,%ecx
+	movl	%ebx,%esi
+	roll	$5,%esi
+	movl	%eax,44(%esp)
+	leal	2400959708(%eax,%ebp,1),%eax
+	movl	%edx,%ebp
+	addl	%esi,%eax
+	andl	%edi,%ebp
+	movl	48(%esp),%esi
+	addl	%ebp,%eax
+	# 20_39 60 
+	movl	%ebx,%ebp
+	xorl	56(%esp),%esi
+	xorl	%ecx,%ebp
+	xorl	16(%esp),%esi
+	xorl	%edx,%ebp
+	xorl	36(%esp),%esi
+	roll	$1,%esi
+	addl	%ebp,%edi
+	rorl	$2,%ebx
+	movl	%eax,%ebp
+	roll	$5,%ebp
+	movl	%esi,48(%esp)
+	leal	3395469782(%esi,%edi,1),%esi
+	movl	52(%esp),%edi
+	addl	%ebp,%esi
+	# 20_39 61 
+	movl	%eax,%ebp
+	xorl	60(%esp),%edi
+	xorl	%ebx,%ebp
+	xorl	20(%esp),%edi
+	xorl	%ecx,%ebp
+	xorl	40(%esp),%edi
+	roll	$1,%edi
+	addl	%ebp,%edx
+	rorl	$2,%eax
+	movl	%esi,%ebp
+	roll	$5,%ebp
+	movl	%edi,52(%esp)
+	leal	3395469782(%edi,%edx,1),%edi
+	movl	56(%esp),%edx
+	addl	%ebp,%edi
+	# 20_39 62 
+	movl	%esi,%ebp
+	xorl	(%esp),%edx
+	xorl	%eax,%ebp
+	xorl	24(%esp),%edx
+	xorl	%ebx,%ebp
+	xorl	44(%esp),%edx
+	roll	$1,%edx
+	addl	%ebp,%ecx
+	rorl	$2,%esi
+	movl	%edi,%ebp
+	roll	$5,%ebp
+	movl	%edx,56(%esp)
+	leal	3395469782(%edx,%ecx,1),%edx
+	movl	60(%esp),%ecx
+	addl	%ebp,%edx
+	# 20_39 63 
+	movl	%edi,%ebp
+	xorl	4(%esp),%ecx
+	xorl	%esi,%ebp
+	xorl	28(%esp),%ecx
+	xorl	%eax,%ebp
+	xorl	48(%esp),%ecx
+	roll	$1,%ecx
+	addl	%ebp,%ebx
+	rorl	$2,%edi
+	movl	%edx,%ebp
+	roll	$5,%ebp
+	movl	%ecx,60(%esp)
+	leal	3395469782(%ecx,%ebx,1),%ecx
+	movl	(%esp),%ebx
+	addl	%ebp,%ecx
+	# 20_39 64 
+	movl	%edx,%ebp
+	xorl	8(%esp),%ebx
+	xorl	%edi,%ebp
+	xorl	32(%esp),%ebx
+	xorl	%esi,%ebp
+	xorl	52(%esp),%ebx
+	roll	$1,%ebx
+	addl	%ebp,%eax
+	rorl	$2,%edx
+	movl	%ecx,%ebp
+	roll	$5,%ebp
+	movl	%ebx,(%esp)
+	leal	3395469782(%ebx,%eax,1),%ebx
+	movl	4(%esp),%eax
+	addl	%ebp,%ebx
+	# 20_39 65 
+	movl	%ecx,%ebp
+	xorl	12(%esp),%eax
+	xorl	%edx,%ebp
+	xorl	36(%esp),%eax
+	xorl	%edi,%ebp
+	xorl	56(%esp),%eax
+	roll	$1,%eax
+	addl	%ebp,%esi
+	rorl	$2,%ecx
+	movl	%ebx,%ebp
+	roll	$5,%ebp
+	movl	%eax,4(%esp)
+	leal	3395469782(%eax,%esi,1),%eax
+	movl	8(%esp),%esi
+	addl	%ebp,%eax
+	# 20_39 66 
+	movl	%ebx,%ebp
+	xorl	16(%esp),%esi
+	xorl	%ecx,%ebp
+	xorl	40(%esp),%esi
+	xorl	%edx,%ebp
+	xorl	60(%esp),%esi
+	roll	$1,%esi
+	addl	%ebp,%edi
+	rorl	$2,%ebx
+	movl	%eax,%ebp
+	roll	$5,%ebp
+	movl	%esi,8(%esp)
+	leal	3395469782(%esi,%edi,1),%esi
+	movl	12(%esp),%edi
+	addl	%ebp,%esi
+	# 20_39 67 
+	movl	%eax,%ebp
+	xorl	20(%esp),%edi
+	xorl	%ebx,%ebp
+	xorl	44(%esp),%edi
+	xorl	%ecx,%ebp
+	xorl	(%esp),%edi
+	roll	$1,%edi
+	addl	%ebp,%edx
+	rorl	$2,%eax
+	movl	%esi,%ebp
+	roll	$5,%ebp
+	movl	%edi,12(%esp)
+	leal	3395469782(%edi,%edx,1),%edi
+	movl	16(%esp),%edx
+	addl	%ebp,%edi
+	# 20_39 68 
+	movl	%esi,%ebp
+	xorl	24(%esp),%edx
+	xorl	%eax,%ebp
+	xorl	48(%esp),%edx
+	xorl	%ebx,%ebp
+	xorl	4(%esp),%edx
+	roll	$1,%edx
+	addl	%ebp,%ecx
+	rorl	$2,%esi
+	movl	%edi,%ebp
+	roll	$5,%ebp
+	movl	%edx,16(%esp)
+	leal	3395469782(%edx,%ecx,1),%edx
+	movl	20(%esp),%ecx
+	addl	%ebp,%edx
+	# 20_39 69 
+	movl	%edi,%ebp
+	xorl	28(%esp),%ecx
+	xorl	%esi,%ebp
+	xorl	52(%esp),%ecx
+	xorl	%eax,%ebp
+	xorl	8(%esp),%ecx
+	roll	$1,%ecx
+	addl	%ebp,%ebx
+	rorl	$2,%edi
+	movl	%edx,%ebp
+	roll	$5,%ebp
+	movl	%ecx,20(%esp)
+	leal	3395469782(%ecx,%ebx,1),%ecx
+	movl	24(%esp),%ebx
+	addl	%ebp,%ecx
+	# 20_39 70 
+	movl	%edx,%ebp
+	xorl	32(%esp),%ebx
+	xorl	%edi,%ebp
+	xorl	56(%esp),%ebx
+	xorl	%esi,%ebp
+	xorl	12(%esp),%ebx
+	roll	$1,%ebx
+	addl	%ebp,%eax
+	rorl	$2,%edx
+	movl	%ecx,%ebp
+	roll	$5,%ebp
+	movl	%ebx,24(%esp)
+	leal	3395469782(%ebx,%eax,1),%ebx
+	movl	28(%esp),%eax
+	addl	%ebp,%ebx
+	# 20_39 71 
+	movl	%ecx,%ebp
+	xorl	36(%esp),%eax
+	xorl	%edx,%ebp
+	xorl	60(%esp),%eax
+	xorl	%edi,%ebp
+	xorl	16(%esp),%eax
+	roll	$1,%eax
+	addl	%ebp,%esi
+	rorl	$2,%ecx
+	movl	%ebx,%ebp
+	roll	$5,%ebp
+	movl	%eax,28(%esp)
+	leal	3395469782(%eax,%esi,1),%eax
+	movl	32(%esp),%esi
+	addl	%ebp,%eax
+	# 20_39 72 
+	movl	%ebx,%ebp
+	xorl	40(%esp),%esi
+	xorl	%ecx,%ebp
+	xorl	(%esp),%esi
+	xorl	%edx,%ebp
+	xorl	20(%esp),%esi
+	roll	$1,%esi
+	addl	%ebp,%edi
+	rorl	$2,%ebx
+	movl	%eax,%ebp
+	roll	$5,%ebp
+	movl	%esi,32(%esp)
+	leal	3395469782(%esi,%edi,1),%esi
+	movl	36(%esp),%edi
+	addl	%ebp,%esi
+	# 20_39 73 
+	movl	%eax,%ebp
+	xorl	44(%esp),%edi
+	xorl	%ebx,%ebp
+	xorl	4(%esp),%edi
+	xorl	%ecx,%ebp
+	xorl	24(%esp),%edi
+	roll	$1,%edi
+	addl	%ebp,%edx
+	rorl	$2,%eax
+	movl	%esi,%ebp
+	roll	$5,%ebp
+	movl	%edi,36(%esp)
+	leal	3395469782(%edi,%edx,1),%edi
+	movl	40(%esp),%edx
+	addl	%ebp,%edi
+	# 20_39 74 
+	movl	%esi,%ebp
+	xorl	48(%esp),%edx
+	xorl	%eax,%ebp
+	xorl	8(%esp),%edx
+	xorl	%ebx,%ebp
+	xorl	28(%esp),%edx
+	roll	$1,%edx
+	addl	%ebp,%ecx
+	rorl	$2,%esi
+	movl	%edi,%ebp
+	roll	$5,%ebp
+	movl	%edx,40(%esp)
+	leal	3395469782(%edx,%ecx,1),%edx
+	movl	44(%esp),%ecx
+	addl	%ebp,%edx
+	# 20_39 75 
+	movl	%edi,%ebp
+	xorl	52(%esp),%ecx
+	xorl	%esi,%ebp
+	xorl	12(%esp),%ecx
+	xorl	%eax,%ebp
+	xorl	32(%esp),%ecx
+	roll	$1,%ecx
+	addl	%ebp,%ebx
+	rorl	$2,%edi
+	movl	%edx,%ebp
+	roll	$5,%ebp
+	movl	%ecx,44(%esp)
+	leal	3395469782(%ecx,%ebx,1),%ecx
+	movl	48(%esp),%ebx
+	addl	%ebp,%ecx
+	# 20_39 76 
+	movl	%edx,%ebp
+	xorl	56(%esp),%ebx
+	xorl	%edi,%ebp
+	xorl	16(%esp),%ebx
+	xorl	%esi,%ebp
+	xorl	36(%esp),%ebx
+	roll	$1,%ebx
+	addl	%ebp,%eax
+	rorl	$2,%edx
+	movl	%ecx,%ebp
+	roll	$5,%ebp
+	movl	%ebx,48(%esp)
+	leal	3395469782(%ebx,%eax,1),%ebx
+	movl	52(%esp),%eax
+	addl	%ebp,%ebx
+	# 20_39 77 
+	movl	%ecx,%ebp
+	xorl	60(%esp),%eax
+	xorl	%edx,%ebp
+	xorl	20(%esp),%eax
+	xorl	%edi,%ebp
+	xorl	40(%esp),%eax
+	roll	$1,%eax
+	addl	%ebp,%esi
+	rorl	$2,%ecx
+	movl	%ebx,%ebp
+	roll	$5,%ebp
+	leal	3395469782(%eax,%esi,1),%eax
+	movl	56(%esp),%esi
+	addl	%ebp,%eax
+	# 20_39 78 
+	movl	%ebx,%ebp
+	xorl	(%esp),%esi
+	xorl	%ecx,%ebp
+	xorl	24(%esp),%esi
+	xorl	%edx,%ebp
+	xorl	44(%esp),%esi
+	roll	$1,%esi
+	addl	%ebp,%edi
+	rorl	$2,%ebx
+	movl	%eax,%ebp
+	roll	$5,%ebp
+	leal	3395469782(%esi,%edi,1),%esi
+	movl	60(%esp),%edi
+	addl	%ebp,%esi
+	# 20_39 79 
+	movl	%eax,%ebp
+	xorl	4(%esp),%edi
+	xorl	%ebx,%ebp
+	xorl	28(%esp),%edi
+	xorl	%ecx,%ebp
+	xorl	48(%esp),%edi
+	roll	$1,%edi
+	addl	%ebp,%edx
+	rorl	$2,%eax
+	movl	%esi,%ebp
+	roll	$5,%ebp
+	leal	3395469782(%edi,%edx,1),%edi
+	addl	%ebp,%edi
+	movl	96(%esp),%ebp
+	movl	100(%esp),%edx
+	addl	(%ebp),%edi
+	addl	4(%ebp),%esi
+	addl	8(%ebp),%eax
+	addl	12(%ebp),%ebx
+	addl	16(%ebp),%ecx
+	movl	%edi,(%ebp)
+	addl	$64,%edx
+	movl	%esi,4(%ebp)
+	cmpl	104(%esp),%edx
+	movl	%eax,8(%ebp)
+	movl	%ecx,%edi
+	movl	%ebx,12(%ebp)
+	movl	%edx,%esi
+	movl	%ecx,16(%ebp)
+	jb	L002loop
+	addl	$76,%esp
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.private_extern	__sha1_block_data_order_shaext
+.align	4
+__sha1_block_data_order_shaext:
+	pushl	%ebp
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+	call	L003pic_point
+L003pic_point:
+	popl	%ebp
+	leal	LK_XX_XX-L003pic_point(%ebp),%ebp
+Lshaext_shortcut:
+	movl	20(%esp),%edi
+	movl	%esp,%ebx
+	movl	24(%esp),%esi
+	movl	28(%esp),%ecx
+	subl	$32,%esp
+	movdqu	(%edi),%xmm0
+	movd	16(%edi),%xmm1
+	andl	$-32,%esp
+	movdqa	80(%ebp),%xmm3
+	movdqu	(%esi),%xmm4
+	pshufd	$27,%xmm0,%xmm0
+	movdqu	16(%esi),%xmm5
+	pshufd	$27,%xmm1,%xmm1
+	movdqu	32(%esi),%xmm6
+.byte	102,15,56,0,227
+	movdqu	48(%esi),%xmm7
+.byte	102,15,56,0,235
+.byte	102,15,56,0,243
+.byte	102,15,56,0,251
+	jmp	L004loop_shaext
+.align	4,0x90
+L004loop_shaext:
+	decl	%ecx
+	leal	64(%esi),%eax
+	movdqa	%xmm1,(%esp)
+	paddd	%xmm4,%xmm1
+	cmovnel	%eax,%esi
+	movdqa	%xmm0,16(%esp)
+.byte	15,56,201,229
+	movdqa	%xmm0,%xmm2
+.byte	15,58,204,193,0
+.byte	15,56,200,213
+	pxor	%xmm6,%xmm4
+.byte	15,56,201,238
+.byte	15,56,202,231
+	movdqa	%xmm0,%xmm1
+.byte	15,58,204,194,0
+.byte	15,56,200,206
+	pxor	%xmm7,%xmm5
+.byte	15,56,202,236
+.byte	15,56,201,247
+	movdqa	%xmm0,%xmm2
+.byte	15,58,204,193,0
+.byte	15,56,200,215
+	pxor	%xmm4,%xmm6
+.byte	15,56,201,252
+.byte	15,56,202,245
+	movdqa	%xmm0,%xmm1
+.byte	15,58,204,194,0
+.byte	15,56,200,204
+	pxor	%xmm5,%xmm7
+.byte	15,56,202,254
+.byte	15,56,201,229
+	movdqa	%xmm0,%xmm2
+.byte	15,58,204,193,0
+.byte	15,56,200,213
+	pxor	%xmm6,%xmm4
+.byte	15,56,201,238
+.byte	15,56,202,231
+	movdqa	%xmm0,%xmm1
+.byte	15,58,204,194,1
+.byte	15,56,200,206
+	pxor	%xmm7,%xmm5
+.byte	15,56,202,236
+.byte	15,56,201,247
+	movdqa	%xmm0,%xmm2
+.byte	15,58,204,193,1
+.byte	15,56,200,215
+	pxor	%xmm4,%xmm6
+.byte	15,56,201,252
+.byte	15,56,202,245
+	movdqa	%xmm0,%xmm1
+.byte	15,58,204,194,1
+.byte	15,56,200,204
+	pxor	%xmm5,%xmm7
+.byte	15,56,202,254
+.byte	15,56,201,229
+	movdqa	%xmm0,%xmm2
+.byte	15,58,204,193,1
+.byte	15,56,200,213
+	pxor	%xmm6,%xmm4
+.byte	15,56,201,238
+.byte	15,56,202,231
+	movdqa	%xmm0,%xmm1
+.byte	15,58,204,194,1
+.byte	15,56,200,206
+	pxor	%xmm7,%xmm5
+.byte	15,56,202,236
+.byte	15,56,201,247
+	movdqa	%xmm0,%xmm2
+.byte	15,58,204,193,2
+.byte	15,56,200,215
+	pxor	%xmm4,%xmm6
+.byte	15,56,201,252
+.byte	15,56,202,245
+	movdqa	%xmm0,%xmm1
+.byte	15,58,204,194,2
+.byte	15,56,200,204
+	pxor	%xmm5,%xmm7
+.byte	15,56,202,254
+.byte	15,56,201,229
+	movdqa	%xmm0,%xmm2
+.byte	15,58,204,193,2
+.byte	15,56,200,213
+	pxor	%xmm6,%xmm4
+.byte	15,56,201,238
+.byte	15,56,202,231
+	movdqa	%xmm0,%xmm1
+.byte	15,58,204,194,2
+.byte	15,56,200,206
+	pxor	%xmm7,%xmm5
+.byte	15,56,202,236
+.byte	15,56,201,247
+	movdqa	%xmm0,%xmm2
+.byte	15,58,204,193,2
+.byte	15,56,200,215
+	pxor	%xmm4,%xmm6
+.byte	15,56,201,252
+.byte	15,56,202,245
+	movdqa	%xmm0,%xmm1
+.byte	15,58,204,194,3
+.byte	15,56,200,204
+	pxor	%xmm5,%xmm7
+.byte	15,56,202,254
+	movdqu	(%esi),%xmm4
+	movdqa	%xmm0,%xmm2
+.byte	15,58,204,193,3
+.byte	15,56,200,213
+	movdqu	16(%esi),%xmm5
+.byte	102,15,56,0,227
+	movdqa	%xmm0,%xmm1
+.byte	15,58,204,194,3
+.byte	15,56,200,206
+	movdqu	32(%esi),%xmm6
+.byte	102,15,56,0,235
+	movdqa	%xmm0,%xmm2
+.byte	15,58,204,193,3
+.byte	15,56,200,215
+	movdqu	48(%esi),%xmm7
+.byte	102,15,56,0,243
+	movdqa	%xmm0,%xmm1
+.byte	15,58,204,194,3
+	movdqa	(%esp),%xmm2
+.byte	102,15,56,0,251
+.byte	15,56,200,202
+	paddd	16(%esp),%xmm0
+	jnz	L004loop_shaext
+	pshufd	$27,%xmm0,%xmm0
+	pshufd	$27,%xmm1,%xmm1
+	movdqu	%xmm0,(%edi)
+	movd	%xmm1,16(%edi)
+	movl	%ebx,%esp
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.private_extern	__sha1_block_data_order_ssse3
+.align	4
+__sha1_block_data_order_ssse3:
+	pushl	%ebp
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+	call	L005pic_point
+L005pic_point:
+	popl	%ebp
+	leal	LK_XX_XX-L005pic_point(%ebp),%ebp
+Lssse3_shortcut:
+	movdqa	(%ebp),%xmm7
+	movdqa	16(%ebp),%xmm0
+	movdqa	32(%ebp),%xmm1
+	movdqa	48(%ebp),%xmm2
+	movdqa	64(%ebp),%xmm6
+	movl	20(%esp),%edi
+	movl	24(%esp),%ebp
+	movl	28(%esp),%edx
+	movl	%esp,%esi
+	subl	$208,%esp
+	andl	$-64,%esp
+	movdqa	%xmm0,112(%esp)
+	movdqa	%xmm1,128(%esp)
+	movdqa	%xmm2,144(%esp)
+	shll	$6,%edx
+	movdqa	%xmm7,160(%esp)
+	addl	%ebp,%edx
+	movdqa	%xmm6,176(%esp)
+	addl	$64,%ebp
+	movl	%edi,192(%esp)
+	movl	%ebp,196(%esp)
+	movl	%edx,200(%esp)
+	movl	%esi,204(%esp)
+	movl	(%edi),%eax
+	movl	4(%edi),%ebx
+	movl	8(%edi),%ecx
+	movl	12(%edi),%edx
+	movl	16(%edi),%edi
+	movl	%ebx,%esi
+	movdqu	-64(%ebp),%xmm0
+	movdqu	-48(%ebp),%xmm1
+	movdqu	-32(%ebp),%xmm2
+	movdqu	-16(%ebp),%xmm3
+.byte	102,15,56,0,198
+.byte	102,15,56,0,206
+.byte	102,15,56,0,214
+	movdqa	%xmm7,96(%esp)
+.byte	102,15,56,0,222
+	paddd	%xmm7,%xmm0
+	paddd	%xmm7,%xmm1
+	paddd	%xmm7,%xmm2
+	movdqa	%xmm0,(%esp)
+	psubd	%xmm7,%xmm0
+	movdqa	%xmm1,16(%esp)
+	psubd	%xmm7,%xmm1
+	movdqa	%xmm2,32(%esp)
+	movl	%ecx,%ebp
+	psubd	%xmm7,%xmm2
+	xorl	%edx,%ebp
+	pshufd	$238,%xmm0,%xmm4
+	andl	%ebp,%esi
+	jmp	L006loop
+.align	4,0x90
+L006loop:
+	rorl	$2,%ebx
+	xorl	%edx,%esi
+	movl	%eax,%ebp
+	punpcklqdq	%xmm1,%xmm4
+	movdqa	%xmm3,%xmm6
+	addl	(%esp),%edi
+	xorl	%ecx,%ebx
+	paddd	%xmm3,%xmm7
+	movdqa	%xmm0,64(%esp)
+	roll	$5,%eax
+	addl	%esi,%edi
+	psrldq	$4,%xmm6
+	andl	%ebx,%ebp
+	xorl	%ecx,%ebx
+	pxor	%xmm0,%xmm4
+	addl	%eax,%edi
+	rorl	$7,%eax
+	pxor	%xmm2,%xmm6
+	xorl	%ecx,%ebp
+	movl	%edi,%esi
+	addl	4(%esp),%edx
+	pxor	%xmm6,%xmm4
+	xorl	%ebx,%eax
+	roll	$5,%edi
+	movdqa	%xmm7,48(%esp)
+	addl	%ebp,%edx
+	andl	%eax,%esi
+	movdqa	%xmm4,%xmm0
+	xorl	%ebx,%eax
+	addl	%edi,%edx
+	rorl	$7,%edi
+	movdqa	%xmm4,%xmm6
+	xorl	%ebx,%esi
+	pslldq	$12,%xmm0
+	paddd	%xmm4,%xmm4
+	movl	%edx,%ebp
+	addl	8(%esp),%ecx
+	psrld	$31,%xmm6
+	xorl	%eax,%edi
+	roll	$5,%edx
+	movdqa	%xmm0,%xmm7
+	addl	%esi,%ecx
+	andl	%edi,%ebp
+	xorl	%eax,%edi
+	psrld	$30,%xmm0
+	addl	%edx,%ecx
+	rorl	$7,%edx
+	por	%xmm6,%xmm4
+	xorl	%eax,%ebp
+	movl	%ecx,%esi
+	addl	12(%esp),%ebx
+	pslld	$2,%xmm7
+	xorl	%edi,%edx
+	roll	$5,%ecx
+	pxor	%xmm0,%xmm4
+	movdqa	96(%esp),%xmm0
+	addl	%ebp,%ebx
+	andl	%edx,%esi
+	pxor	%xmm7,%xmm4
+	pshufd	$238,%xmm1,%xmm5
+	xorl	%edi,%edx
+	addl	%ecx,%ebx
+	rorl	$7,%ecx
+	xorl	%edi,%esi
+	movl	%ebx,%ebp
+	punpcklqdq	%xmm2,%xmm5
+	movdqa	%xmm4,%xmm7
+	addl	16(%esp),%eax
+	xorl	%edx,%ecx
+	paddd	%xmm4,%xmm0
+	movdqa	%xmm1,80(%esp)
+	roll	$5,%ebx
+	addl	%esi,%eax
+	psrldq	$4,%xmm7
+	andl	%ecx,%ebp
+	xorl	%edx,%ecx
+	pxor	%xmm1,%xmm5
+	addl	%ebx,%eax
+	rorl	$7,%ebx
+	pxor	%xmm3,%xmm7
+	xorl	%edx,%ebp
+	movl	%eax,%esi
+	addl	20(%esp),%edi
+	pxor	%xmm7,%xmm5
+	xorl	%ecx,%ebx
+	roll	$5,%eax
+	movdqa	%xmm0,(%esp)
+	addl	%ebp,%edi
+	andl	%ebx,%esi
+	movdqa	%xmm5,%xmm1
+	xorl	%ecx,%ebx
+	addl	%eax,%edi
+	rorl	$7,%eax
+	movdqa	%xmm5,%xmm7
+	xorl	%ecx,%esi
+	pslldq	$12,%xmm1
+	paddd	%xmm5,%xmm5
+	movl	%edi,%ebp
+	addl	24(%esp),%edx
+	psrld	$31,%xmm7
+	xorl	%ebx,%eax
+	roll	$5,%edi
+	movdqa	%xmm1,%xmm0
+	addl	%esi,%edx
+	andl	%eax,%ebp
+	xorl	%ebx,%eax
+	psrld	$30,%xmm1
+	addl	%edi,%edx
+	rorl	$7,%edi
+	por	%xmm7,%xmm5
+	xorl	%ebx,%ebp
+	movl	%edx,%esi
+	addl	28(%esp),%ecx
+	pslld	$2,%xmm0
+	xorl	%eax,%edi
+	roll	$5,%edx
+	pxor	%xmm1,%xmm5
+	movdqa	112(%esp),%xmm1
+	addl	%ebp,%ecx
+	andl	%edi,%esi
+	pxor	%xmm0,%xmm5
+	pshufd	$238,%xmm2,%xmm6
+	xorl	%eax,%edi
+	addl	%edx,%ecx
+	rorl	$7,%edx
+	xorl	%eax,%esi
+	movl	%ecx,%ebp
+	punpcklqdq	%xmm3,%xmm6
+	movdqa	%xmm5,%xmm0
+	addl	32(%esp),%ebx
+	xorl	%edi,%edx
+	paddd	%xmm5,%xmm1
+	movdqa	%xmm2,96(%esp)
+	roll	$5,%ecx
+	addl	%esi,%ebx
+	psrldq	$4,%xmm0
+	andl	%edx,%ebp
+	xorl	%edi,%edx
+	pxor	%xmm2,%xmm6
+	addl	%ecx,%ebx
+	rorl	$7,%ecx
+	pxor	%xmm4,%xmm0
+	xorl	%edi,%ebp
+	movl	%ebx,%esi
+	addl	36(%esp),%eax
+	pxor	%xmm0,%xmm6
+	xorl	%edx,%ecx
+	roll	$5,%ebx
+	movdqa	%xmm1,16(%esp)
+	addl	%ebp,%eax
+	andl	%ecx,%esi
+	movdqa	%xmm6,%xmm2
+	xorl	%edx,%ecx
+	addl	%ebx,%eax
+	rorl	$7,%ebx
+	movdqa	%xmm6,%xmm0
+	xorl	%edx,%esi
+	pslldq	$12,%xmm2
+	paddd	%xmm6,%xmm6
+	movl	%eax,%ebp
+	addl	40(%esp),%edi
+	psrld	$31,%xmm0
+	xorl	%ecx,%ebx
+	roll	$5,%eax
+	movdqa	%xmm2,%xmm1
+	addl	%esi,%edi
+	andl	%ebx,%ebp
+	xorl	%ecx,%ebx
+	psrld	$30,%xmm2
+	addl	%eax,%edi
+	rorl	$7,%eax
+	por	%xmm0,%xmm6
+	xorl	%ecx,%ebp
+	movdqa	64(%esp),%xmm0
+	movl	%edi,%esi
+	addl	44(%esp),%edx
+	pslld	$2,%xmm1
+	xorl	%ebx,%eax
+	roll	$5,%edi
+	pxor	%xmm2,%xmm6
+	movdqa	112(%esp),%xmm2
+	addl	%ebp,%edx
+	andl	%eax,%esi
+	pxor	%xmm1,%xmm6
+	pshufd	$238,%xmm3,%xmm7
+	xorl	%ebx,%eax
+	addl	%edi,%edx
+	rorl	$7,%edi
+	xorl	%ebx,%esi
+	movl	%edx,%ebp
+	punpcklqdq	%xmm4,%xmm7
+	movdqa	%xmm6,%xmm1
+	addl	48(%esp),%ecx
+	xorl	%eax,%edi
+	paddd	%xmm6,%xmm2
+	movdqa	%xmm3,64(%esp)
+	roll	$5,%edx
+	addl	%esi,%ecx
+	psrldq	$4,%xmm1
+	andl	%edi,%ebp
+	xorl	%eax,%edi
+	pxor	%xmm3,%xmm7
+	addl	%edx,%ecx
+	rorl	$7,%edx
+	pxor	%xmm5,%xmm1
+	xorl	%eax,%ebp
+	movl	%ecx,%esi
+	addl	52(%esp),%ebx
+	pxor	%xmm1,%xmm7
+	xorl	%edi,%edx
+	roll	$5,%ecx
+	movdqa	%xmm2,32(%esp)
+	addl	%ebp,%ebx
+	andl	%edx,%esi
+	movdqa	%xmm7,%xmm3
+	xorl	%edi,%edx
+	addl	%ecx,%ebx
+	rorl	$7,%ecx
+	movdqa	%xmm7,%xmm1
+	xorl	%edi,%esi
+	pslldq	$12,%xmm3
+	paddd	%xmm7,%xmm7
+	movl	%ebx,%ebp
+	addl	56(%esp),%eax
+	psrld	$31,%xmm1
+	xorl	%edx,%ecx
+	roll	$5,%ebx
+	movdqa	%xmm3,%xmm2
+	addl	%esi,%eax
+	andl	%ecx,%ebp
+	xorl	%edx,%ecx
+	psrld	$30,%xmm3
+	addl	%ebx,%eax
+	rorl	$7,%ebx
+	por	%xmm1,%xmm7
+	xorl	%edx,%ebp
+	movdqa	80(%esp),%xmm1
+	movl	%eax,%esi
+	addl	60(%esp),%edi
+	pslld	$2,%xmm2
+	xorl	%ecx,%ebx
+	roll	$5,%eax
+	pxor	%xmm3,%xmm7
+	movdqa	112(%esp),%xmm3
+	addl	%ebp,%edi
+	andl	%ebx,%esi
+	pxor	%xmm2,%xmm7
+	pshufd	$238,%xmm6,%xmm2
+	xorl	%ecx,%ebx
+	addl	%eax,%edi
+	rorl	$7,%eax
+	pxor	%xmm4,%xmm0
+	punpcklqdq	%xmm7,%xmm2
+	xorl	%ecx,%esi
+	movl	%edi,%ebp
+	addl	(%esp),%edx
+	pxor	%xmm1,%xmm0
+	movdqa	%xmm4,80(%esp)
+	xorl	%ebx,%eax
+	roll	$5,%edi
+	movdqa	%xmm3,%xmm4
+	addl	%esi,%edx
+	paddd	%xmm7,%xmm3
+	andl	%eax,%ebp
+	pxor	%xmm2,%xmm0
+	xorl	%ebx,%eax
+	addl	%edi,%edx
+	rorl	$7,%edi
+	xorl	%ebx,%ebp
+	movdqa	%xmm0,%xmm2
+	movdqa	%xmm3,48(%esp)
+	movl	%edx,%esi
+	addl	4(%esp),%ecx
+	xorl	%eax,%edi
+	roll	$5,%edx
+	pslld	$2,%xmm0
+	addl	%ebp,%ecx
+	andl	%edi,%esi
+	psrld	$30,%xmm2
+	xorl	%eax,%edi
+	addl	%edx,%ecx
+	rorl	$7,%edx
+	xorl	%eax,%esi
+	movl	%ecx,%ebp
+	addl	8(%esp),%ebx
+	xorl	%edi,%edx
+	roll	$5,%ecx
+	por	%xmm2,%xmm0
+	addl	%esi,%ebx
+	andl	%edx,%ebp
+	movdqa	96(%esp),%xmm2
+	xorl	%edi,%edx
+	addl	%ecx,%ebx
+	addl	12(%esp),%eax
+	xorl	%edi,%ebp
+	movl	%ebx,%esi
+	pshufd	$238,%xmm7,%xmm3
+	roll	$5,%ebx
+	addl	%ebp,%eax
+	xorl	%edx,%esi
+	rorl	$7,%ecx
+	addl	%ebx,%eax
+	addl	16(%esp),%edi
+	pxor	%xmm5,%xmm1
+	punpcklqdq	%xmm0,%xmm3
+	xorl	%ecx,%esi
+	movl	%eax,%ebp
+	roll	$5,%eax
+	pxor	%xmm2,%xmm1
+	movdqa	%xmm5,96(%esp)
+	addl	%esi,%edi
+	xorl	%ecx,%ebp
+	movdqa	%xmm4,%xmm5
+	rorl	$7,%ebx
+	paddd	%xmm0,%xmm4
+	addl	%eax,%edi
+	pxor	%xmm3,%xmm1
+	addl	20(%esp),%edx
+	xorl	%ebx,%ebp
+	movl	%edi,%esi
+	roll	$5,%edi
+	movdqa	%xmm1,%xmm3
+	movdqa	%xmm4,(%esp)
+	addl	%ebp,%edx
+	xorl	%ebx,%esi
+	rorl	$7,%eax
+	addl	%edi,%edx
+	pslld	$2,%xmm1
+	addl	24(%esp),%ecx
+	xorl	%eax,%esi
+	psrld	$30,%xmm3
+	movl	%edx,%ebp
+	roll	$5,%edx
+	addl	%esi,%ecx
+	xorl	%eax,%ebp
+	rorl	$7,%edi
+	addl	%edx,%ecx
+	por	%xmm3,%xmm1
+	addl	28(%esp),%ebx
+	xorl	%edi,%ebp
+	movdqa	64(%esp),%xmm3
+	movl	%ecx,%esi
+	roll	$5,%ecx
+	addl	%ebp,%ebx
+	xorl	%edi,%esi
+	rorl	$7,%edx
+	pshufd	$238,%xmm0,%xmm4
+	addl	%ecx,%ebx
+	addl	32(%esp),%eax
+	pxor	%xmm6,%xmm2
+	punpcklqdq	%xmm1,%xmm4
+	xorl	%edx,%esi
+	movl	%ebx,%ebp
+	roll	$5,%ebx
+	pxor	%xmm3,%xmm2
+	movdqa	%xmm6,64(%esp)
+	addl	%esi,%eax
+	xorl	%edx,%ebp
+	movdqa	128(%esp),%xmm6
+	rorl	$7,%ecx
+	paddd	%xmm1,%xmm5
+	addl	%ebx,%eax
+	pxor	%xmm4,%xmm2
+	addl	36(%esp),%edi
+	xorl	%ecx,%ebp
+	movl	%eax,%esi
+	roll	$5,%eax
+	movdqa	%xmm2,%xmm4
+	movdqa	%xmm5,16(%esp)
+	addl	%ebp,%edi
+	xorl	%ecx,%esi
+	rorl	$7,%ebx
+	addl	%eax,%edi
+	pslld	$2,%xmm2
+	addl	40(%esp),%edx
+	xorl	%ebx,%esi
+	psrld	$30,%xmm4
+	movl	%edi,%ebp
+	roll	$5,%edi
+	addl	%esi,%edx
+	xorl	%ebx,%ebp
+	rorl	$7,%eax
+	addl	%edi,%edx
+	por	%xmm4,%xmm2
+	addl	44(%esp),%ecx
+	xorl	%eax,%ebp
+	movdqa	80(%esp),%xmm4
+	movl	%edx,%esi
+	roll	$5,%edx
+	addl	%ebp,%ecx
+	xorl	%eax,%esi
+	rorl	$7,%edi
+	pshufd	$238,%xmm1,%xmm5
+	addl	%edx,%ecx
+	addl	48(%esp),%ebx
+	pxor	%xmm7,%xmm3
+	punpcklqdq	%xmm2,%xmm5
+	xorl	%edi,%esi
+	movl	%ecx,%ebp
+	roll	$5,%ecx
+	pxor	%xmm4,%xmm3
+	movdqa	%xmm7,80(%esp)
+	addl	%esi,%ebx
+	xorl	%edi,%ebp
+	movdqa	%xmm6,%xmm7
+	rorl	$7,%edx
+	paddd	%xmm2,%xmm6
+	addl	%ecx,%ebx
+	pxor	%xmm5,%xmm3
+	addl	52(%esp),%eax
+	xorl	%edx,%ebp
+	movl	%ebx,%esi
+	roll	$5,%ebx
+	movdqa	%xmm3,%xmm5
+	movdqa	%xmm6,32(%esp)
+	addl	%ebp,%eax
+	xorl	%edx,%esi
+	rorl	$7,%ecx
+	addl	%ebx,%eax
+	pslld	$2,%xmm3
+	addl	56(%esp),%edi
+	xorl	%ecx,%esi
+	psrld	$30,%xmm5
+	movl	%eax,%ebp
+	roll	$5,%eax
+	addl	%esi,%edi
+	xorl	%ecx,%ebp
+	rorl	$7,%ebx
+	addl	%eax,%edi
+	por	%xmm5,%xmm3
+	addl	60(%esp),%edx
+	xorl	%ebx,%ebp
+	movdqa	96(%esp),%xmm5
+	movl	%edi,%esi
+	roll	$5,%edi
+	addl	%ebp,%edx
+	xorl	%ebx,%esi
+	rorl	$7,%eax
+	pshufd	$238,%xmm2,%xmm6
+	addl	%edi,%edx
+	addl	(%esp),%ecx
+	pxor	%xmm0,%xmm4
+	punpcklqdq	%xmm3,%xmm6
+	xorl	%eax,%esi
+	movl	%edx,%ebp
+	roll	$5,%edx
+	pxor	%xmm5,%xmm4
+	movdqa	%xmm0,96(%esp)
+	addl	%esi,%ecx
+	xorl	%eax,%ebp
+	movdqa	%xmm7,%xmm0
+	rorl	$7,%edi
+	paddd	%xmm3,%xmm7
+	addl	%edx,%ecx
+	pxor	%xmm6,%xmm4
+	addl	4(%esp),%ebx
+	xorl	%edi,%ebp
+	movl	%ecx,%esi
+	roll	$5,%ecx
+	movdqa	%xmm4,%xmm6
+	movdqa	%xmm7,48(%esp)
+	addl	%ebp,%ebx
+	xorl	%edi,%esi
+	rorl	$7,%edx
+	addl	%ecx,%ebx
+	pslld	$2,%xmm4
+	addl	8(%esp),%eax
+	xorl	%edx,%esi
+	psrld	$30,%xmm6
+	movl	%ebx,%ebp
+	roll	$5,%ebx
+	addl	%esi,%eax
+	xorl	%edx,%ebp
+	rorl	$7,%ecx
+	addl	%ebx,%eax
+	por	%xmm6,%xmm4
+	addl	12(%esp),%edi
+	xorl	%ecx,%ebp
+	movdqa	64(%esp),%xmm6
+	movl	%eax,%esi
+	roll	$5,%eax
+	addl	%ebp,%edi
+	xorl	%ecx,%esi
+	rorl	$7,%ebx
+	pshufd	$238,%xmm3,%xmm7
+	addl	%eax,%edi
+	addl	16(%esp),%edx
+	pxor	%xmm1,%xmm5
+	punpcklqdq	%xmm4,%xmm7
+	xorl	%ebx,%esi
+	movl	%edi,%ebp
+	roll	$5,%edi
+	pxor	%xmm6,%xmm5
+	movdqa	%xmm1,64(%esp)
+	addl	%esi,%edx
+	xorl	%ebx,%ebp
+	movdqa	%xmm0,%xmm1
+	rorl	$7,%eax
+	paddd	%xmm4,%xmm0
+	addl	%edi,%edx
+	pxor	%xmm7,%xmm5
+	addl	20(%esp),%ecx
+	xorl	%eax,%ebp
+	movl	%edx,%esi
+	roll	$5,%edx
+	movdqa	%xmm5,%xmm7
+	movdqa	%xmm0,(%esp)
+	addl	%ebp,%ecx
+	xorl	%eax,%esi
+	rorl	$7,%edi
+	addl	%edx,%ecx
+	pslld	$2,%xmm5
+	addl	24(%esp),%ebx
+	xorl	%edi,%esi
+	psrld	$30,%xmm7
+	movl	%ecx,%ebp
+	roll	$5,%ecx
+	addl	%esi,%ebx
+	xorl	%edi,%ebp
+	rorl	$7,%edx
+	addl	%ecx,%ebx
+	por	%xmm7,%xmm5
+	addl	28(%esp),%eax
+	movdqa	80(%esp),%xmm7
+	rorl	$7,%ecx
+	movl	%ebx,%esi
+	xorl	%edx,%ebp
+	roll	$5,%ebx
+	pshufd	$238,%xmm4,%xmm0
+	addl	%ebp,%eax
+	xorl	%ecx,%esi
+	xorl	%edx,%ecx
+	addl	%ebx,%eax
+	addl	32(%esp),%edi
+	pxor	%xmm2,%xmm6
+	punpcklqdq	%xmm5,%xmm0
+	andl	%ecx,%esi
+	xorl	%edx,%ecx
+	rorl	$7,%ebx
+	pxor	%xmm7,%xmm6
+	movdqa	%xmm2,80(%esp)
+	movl	%eax,%ebp
+	xorl	%ecx,%esi
+	roll	$5,%eax
+	movdqa	%xmm1,%xmm2
+	addl	%esi,%edi
+	paddd	%xmm5,%xmm1
+	xorl	%ebx,%ebp
+	pxor	%xmm0,%xmm6
+	xorl	%ecx,%ebx
+	addl	%eax,%edi
+	addl	36(%esp),%edx
+	andl	%ebx,%ebp
+	movdqa	%xmm6,%xmm0
+	movdqa	%xmm1,16(%esp)
+	xorl	%ecx,%ebx
+	rorl	$7,%eax
+	movl	%edi,%esi
+	xorl	%ebx,%ebp
+	roll	$5,%edi
+	pslld	$2,%xmm6
+	addl	%ebp,%edx
+	xorl	%eax,%esi
+	psrld	$30,%xmm0
+	xorl	%ebx,%eax
+	addl	%edi,%edx
+	addl	40(%esp),%ecx
+	andl	%eax,%esi
+	xorl	%ebx,%eax
+	rorl	$7,%edi
+	por	%xmm0,%xmm6
+	movl	%edx,%ebp
+	xorl	%eax,%esi
+	movdqa	96(%esp),%xmm0
+	roll	$5,%edx
+	addl	%esi,%ecx
+	xorl	%edi,%ebp
+	xorl	%eax,%edi
+	addl	%edx,%ecx
+	pshufd	$238,%xmm5,%xmm1
+	addl	44(%esp),%ebx
+	andl	%edi,%ebp
+	xorl	%eax,%edi
+	rorl	$7,%edx
+	movl	%ecx,%esi
+	xorl	%edi,%ebp
+	roll	$5,%ecx
+	addl	%ebp,%ebx
+	xorl	%edx,%esi
+	xorl	%edi,%edx
+	addl	%ecx,%ebx
+	addl	48(%esp),%eax
+	pxor	%xmm3,%xmm7
+	punpcklqdq	%xmm6,%xmm1
+	andl	%edx,%esi
+	xorl	%edi,%edx
+	rorl	$7,%ecx
+	pxor	%xmm0,%xmm7
+	movdqa	%xmm3,96(%esp)
+	movl	%ebx,%ebp
+	xorl	%edx,%esi
+	roll	$5,%ebx
+	movdqa	144(%esp),%xmm3
+	addl	%esi,%eax
+	paddd	%xmm6,%xmm2
+	xorl	%ecx,%ebp
+	pxor	%xmm1,%xmm7
+	xorl	%edx,%ecx
+	addl	%ebx,%eax
+	addl	52(%esp),%edi
+	andl	%ecx,%ebp
+	movdqa	%xmm7,%xmm1
+	movdqa	%xmm2,32(%esp)
+	xorl	%edx,%ecx
+	rorl	$7,%ebx
+	movl	%eax,%esi
+	xorl	%ecx,%ebp
+	roll	$5,%eax
+	pslld	$2,%xmm7
+	addl	%ebp,%edi
+	xorl	%ebx,%esi
+	psrld	$30,%xmm1
+	xorl	%ecx,%ebx
+	addl	%eax,%edi
+	addl	56(%esp),%edx
+	andl	%ebx,%esi
+	xorl	%ecx,%ebx
+	rorl	$7,%eax
+	por	%xmm1,%xmm7
+	movl	%edi,%ebp
+	xorl	%ebx,%esi
+	movdqa	64(%esp),%xmm1
+	roll	$5,%edi
+	addl	%esi,%edx
+	xorl	%eax,%ebp
+	xorl	%ebx,%eax
+	addl	%edi,%edx
+	pshufd	$238,%xmm6,%xmm2
+	addl	60(%esp),%ecx
+	andl	%eax,%ebp
+	xorl	%ebx,%eax
+	rorl	$7,%edi
+	movl	%edx,%esi
+	xorl	%eax,%ebp
+	roll	$5,%edx
+	addl	%ebp,%ecx
+	xorl	%edi,%esi
+	xorl	%eax,%edi
+	addl	%edx,%ecx
+	addl	(%esp),%ebx
+	pxor	%xmm4,%xmm0
+	punpcklqdq	%xmm7,%xmm2
+	andl	%edi,%esi
+	xorl	%eax,%edi
+	rorl	$7,%edx
+	pxor	%xmm1,%xmm0
+	movdqa	%xmm4,64(%esp)
+	movl	%ecx,%ebp
+	xorl	%edi,%esi
+	roll	$5,%ecx
+	movdqa	%xmm3,%xmm4
+	addl	%esi,%ebx
+	paddd	%xmm7,%xmm3
+	xorl	%edx,%ebp
+	pxor	%xmm2,%xmm0
+	xorl	%edi,%edx
+	addl	%ecx,%ebx
+	addl	4(%esp),%eax
+	andl	%edx,%ebp
+	movdqa	%xmm0,%xmm2
+	movdqa	%xmm3,48(%esp)
+	xorl	%edi,%edx
+	rorl	$7,%ecx
+	movl	%ebx,%esi
+	xorl	%edx,%ebp
+	roll	$5,%ebx
+	pslld	$2,%xmm0
+	addl	%ebp,%eax
+	xorl	%ecx,%esi
+	psrld	$30,%xmm2
+	xorl	%edx,%ecx
+	addl	%ebx,%eax
+	addl	8(%esp),%edi
+	andl	%ecx,%esi
+	xorl	%edx,%ecx
+	rorl	$7,%ebx
+	por	%xmm2,%xmm0
+	movl	%eax,%ebp
+	xorl	%ecx,%esi
+	movdqa	80(%esp),%xmm2
+	roll	$5,%eax
+	addl	%esi,%edi
+	xorl	%ebx,%ebp
+	xorl	%ecx,%ebx
+	addl	%eax,%edi
+	pshufd	$238,%xmm7,%xmm3
+	addl	12(%esp),%edx
+	andl	%ebx,%ebp
+	xorl	%ecx,%ebx
+	rorl	$7,%eax
+	movl	%edi,%esi
+	xorl	%ebx,%ebp
+	roll	$5,%edi
+	addl	%ebp,%edx
+	xorl	%eax,%esi
+	xorl	%ebx,%eax
+	addl	%edi,%edx
+	addl	16(%esp),%ecx
+	pxor	%xmm5,%xmm1
+	punpcklqdq	%xmm0,%xmm3
+	andl	%eax,%esi
+	xorl	%ebx,%eax
+	rorl	$7,%edi
+	pxor	%xmm2,%xmm1
+	movdqa	%xmm5,80(%esp)
+	movl	%edx,%ebp
+	xorl	%eax,%esi
+	roll	$5,%edx
+	movdqa	%xmm4,%xmm5
+	addl	%esi,%ecx
+	paddd	%xmm0,%xmm4
+	xorl	%edi,%ebp
+	pxor	%xmm3,%xmm1
+	xorl	%eax,%edi
+	addl	%edx,%ecx
+	addl	20(%esp),%ebx
+	andl	%edi,%ebp
+	movdqa	%xmm1,%xmm3
+	movdqa	%xmm4,(%esp)
+	xorl	%eax,%edi
+	rorl	$7,%edx
+	movl	%ecx,%esi
+	xorl	%edi,%ebp
+	roll	$5,%ecx
+	pslld	$2,%xmm1
+	addl	%ebp,%ebx
+	xorl	%edx,%esi
+	psrld	$30,%xmm3
+	xorl	%edi,%edx
+	addl	%ecx,%ebx
+	addl	24(%esp),%eax
+	andl	%edx,%esi
+	xorl	%edi,%edx
+	rorl	$7,%ecx
+	por	%xmm3,%xmm1
+	movl	%ebx,%ebp
+	xorl	%edx,%esi
+	movdqa	96(%esp),%xmm3
+	roll	$5,%ebx
+	addl	%esi,%eax
+	xorl	%ecx,%ebp
+	xorl	%edx,%ecx
+	addl	%ebx,%eax
+	pshufd	$238,%xmm0,%xmm4
+	addl	28(%esp),%edi
+	andl	%ecx,%ebp
+	xorl	%edx,%ecx
+	rorl	$7,%ebx
+	movl	%eax,%esi
+	xorl	%ecx,%ebp
+	roll	$5,%eax
+	addl	%ebp,%edi
+	xorl	%ebx,%esi
+	xorl	%ecx,%ebx
+	addl	%eax,%edi
+	addl	32(%esp),%edx
+	pxor	%xmm6,%xmm2
+	punpcklqdq	%xmm1,%xmm4
+	andl	%ebx,%esi
+	xorl	%ecx,%ebx
+	rorl	$7,%eax
+	pxor	%xmm3,%xmm2
+	movdqa	%xmm6,96(%esp)
+	movl	%edi,%ebp
+	xorl	%ebx,%esi
+	roll	$5,%edi
+	movdqa	%xmm5,%xmm6
+	addl	%esi,%edx
+	paddd	%xmm1,%xmm5
+	xorl	%eax,%ebp
+	pxor	%xmm4,%xmm2
+	xorl	%ebx,%eax
+	addl	%edi,%edx
+	addl	36(%esp),%ecx
+	andl	%eax,%ebp
+	movdqa	%xmm2,%xmm4
+	movdqa	%xmm5,16(%esp)
+	xorl	%ebx,%eax
+	rorl	$7,%edi
+	movl	%edx,%esi
+	xorl	%eax,%ebp
+	roll	$5,%edx
+	pslld	$2,%xmm2
+	addl	%ebp,%ecx
+	xorl	%edi,%esi
+	psrld	$30,%xmm4
+	xorl	%eax,%edi
+	addl	%edx,%ecx
+	addl	40(%esp),%ebx
+	andl	%edi,%esi
+	xorl	%eax,%edi
+	rorl	$7,%edx
+	por	%xmm4,%xmm2
+	movl	%ecx,%ebp
+	xorl	%edi,%esi
+	movdqa	64(%esp),%xmm4
+	roll	$5,%ecx
+	addl	%esi,%ebx
+	xorl	%edx,%ebp
+	xorl	%edi,%edx
+	addl	%ecx,%ebx
+	pshufd	$238,%xmm1,%xmm5
+	addl	44(%esp),%eax
+	andl	%edx,%ebp
+	xorl	%edi,%edx
+	rorl	$7,%ecx
+	movl	%ebx,%esi
+	xorl	%edx,%ebp
+	roll	$5,%ebx
+	addl	%ebp,%eax
+	xorl	%edx,%esi
+	addl	%ebx,%eax
+	addl	48(%esp),%edi
+	pxor	%xmm7,%xmm3
+	punpcklqdq	%xmm2,%xmm5
+	xorl	%ecx,%esi
+	movl	%eax,%ebp
+	roll	$5,%eax
+	pxor	%xmm4,%xmm3
+	movdqa	%xmm7,64(%esp)
+	addl	%esi,%edi
+	xorl	%ecx,%ebp
+	movdqa	%xmm6,%xmm7
+	rorl	$7,%ebx
+	paddd	%xmm2,%xmm6
+	addl	%eax,%edi
+	pxor	%xmm5,%xmm3
+	addl	52(%esp),%edx
+	xorl	%ebx,%ebp
+	movl	%edi,%esi
+	roll	$5,%edi
+	movdqa	%xmm3,%xmm5
+	movdqa	%xmm6,32(%esp)
+	addl	%ebp,%edx
+	xorl	%ebx,%esi
+	rorl	$7,%eax
+	addl	%edi,%edx
+	pslld	$2,%xmm3
+	addl	56(%esp),%ecx
+	xorl	%eax,%esi
+	psrld	$30,%xmm5
+	movl	%edx,%ebp
+	roll	$5,%edx
+	addl	%esi,%ecx
+	xorl	%eax,%ebp
+	rorl	$7,%edi
+	addl	%edx,%ecx
+	por	%xmm5,%xmm3
+	addl	60(%esp),%ebx
+	xorl	%edi,%ebp
+	movl	%ecx,%esi
+	roll	$5,%ecx
+	addl	%ebp,%ebx
+	xorl	%edi,%esi
+	rorl	$7,%edx
+	addl	%ecx,%ebx
+	addl	(%esp),%eax
+	xorl	%edx,%esi
+	movl	%ebx,%ebp
+	roll	$5,%ebx
+	addl	%esi,%eax
+	xorl	%edx,%ebp
+	rorl	$7,%ecx
+	paddd	%xmm3,%xmm7
+	addl	%ebx,%eax
+	addl	4(%esp),%edi
+	xorl	%ecx,%ebp
+	movl	%eax,%esi
+	movdqa	%xmm7,48(%esp)
+	roll	$5,%eax
+	addl	%ebp,%edi
+	xorl	%ecx,%esi
+	rorl	$7,%ebx
+	addl	%eax,%edi
+	addl	8(%esp),%edx
+	xorl	%ebx,%esi
+	movl	%edi,%ebp
+	roll	$5,%edi
+	addl	%esi,%edx
+	xorl	%ebx,%ebp
+	rorl	$7,%eax
+	addl	%edi,%edx
+	addl	12(%esp),%ecx
+	xorl	%eax,%ebp
+	movl	%edx,%esi
+	roll	$5,%edx
+	addl	%ebp,%ecx
+	xorl	%eax,%esi
+	rorl	$7,%edi
+	addl	%edx,%ecx
+	movl	196(%esp),%ebp
+	cmpl	200(%esp),%ebp
+	je	L007done
+	movdqa	160(%esp),%xmm7
+	movdqa	176(%esp),%xmm6
+	movdqu	(%ebp),%xmm0
+	movdqu	16(%ebp),%xmm1
+	movdqu	32(%ebp),%xmm2
+	movdqu	48(%ebp),%xmm3
+	addl	$64,%ebp
+.byte	102,15,56,0,198
+	movl	%ebp,196(%esp)
+	movdqa	%xmm7,96(%esp)
+	addl	16(%esp),%ebx
+	xorl	%edi,%esi
+	movl	%ecx,%ebp
+	roll	$5,%ecx
+	addl	%esi,%ebx
+	xorl	%edi,%ebp
+	rorl	$7,%edx
+.byte	102,15,56,0,206
+	addl	%ecx,%ebx
+	addl	20(%esp),%eax
+	xorl	%edx,%ebp
+	movl	%ebx,%esi
+	paddd	%xmm7,%xmm0
+	roll	$5,%ebx
+	addl	%ebp,%eax
+	xorl	%edx,%esi
+	rorl	$7,%ecx
+	movdqa	%xmm0,(%esp)
+	addl	%ebx,%eax
+	addl	24(%esp),%edi
+	xorl	%ecx,%esi
+	movl	%eax,%ebp
+	psubd	%xmm7,%xmm0
+	roll	$5,%eax
+	addl	%esi,%edi
+	xorl	%ecx,%ebp
+	rorl	$7,%ebx
+	addl	%eax,%edi
+	addl	28(%esp),%edx
+	xorl	%ebx,%ebp
+	movl	%edi,%esi
+	roll	$5,%edi
+	addl	%ebp,%edx
+	xorl	%ebx,%esi
+	rorl	$7,%eax
+	addl	%edi,%edx
+	addl	32(%esp),%ecx
+	xorl	%eax,%esi
+	movl	%edx,%ebp
+	roll	$5,%edx
+	addl	%esi,%ecx
+	xorl	%eax,%ebp
+	rorl	$7,%edi
+.byte	102,15,56,0,214
+	addl	%edx,%ecx
+	addl	36(%esp),%ebx
+	xorl	%edi,%ebp
+	movl	%ecx,%esi
+	paddd	%xmm7,%xmm1
+	roll	$5,%ecx
+	addl	%ebp,%ebx
+	xorl	%edi,%esi
+	rorl	$7,%edx
+	movdqa	%xmm1,16(%esp)
+	addl	%ecx,%ebx
+	addl	40(%esp),%eax
+	xorl	%edx,%esi
+	movl	%ebx,%ebp
+	psubd	%xmm7,%xmm1
+	roll	$5,%ebx
+	addl	%esi,%eax
+	xorl	%edx,%ebp
+	rorl	$7,%ecx
+	addl	%ebx,%eax
+	addl	44(%esp),%edi
+	xorl	%ecx,%ebp
+	movl	%eax,%esi
+	roll	$5,%eax
+	addl	%ebp,%edi
+	xorl	%ecx,%esi
+	rorl	$7,%ebx
+	addl	%eax,%edi
+	addl	48(%esp),%edx
+	xorl	%ebx,%esi
+	movl	%edi,%ebp
+	roll	$5,%edi
+	addl	%esi,%edx
+	xorl	%ebx,%ebp
+	rorl	$7,%eax
+.byte	102,15,56,0,222
+	addl	%edi,%edx
+	addl	52(%esp),%ecx
+	xorl	%eax,%ebp
+	movl	%edx,%esi
+	paddd	%xmm7,%xmm2
+	roll	$5,%edx
+	addl	%ebp,%ecx
+	xorl	%eax,%esi
+	rorl	$7,%edi
+	movdqa	%xmm2,32(%esp)
+	addl	%edx,%ecx
+	addl	56(%esp),%ebx
+	xorl	%edi,%esi
+	movl	%ecx,%ebp
+	psubd	%xmm7,%xmm2
+	roll	$5,%ecx
+	addl	%esi,%ebx
+	xorl	%edi,%ebp
+	rorl	$7,%edx
+	addl	%ecx,%ebx
+	addl	60(%esp),%eax
+	xorl	%edx,%ebp
+	movl	%ebx,%esi
+	roll	$5,%ebx
+	addl	%ebp,%eax
+	rorl	$7,%ecx
+	addl	%ebx,%eax
+	movl	192(%esp),%ebp
+	addl	(%ebp),%eax
+	addl	4(%ebp),%esi
+	addl	8(%ebp),%ecx
+	movl	%eax,(%ebp)
+	addl	12(%ebp),%edx
+	movl	%esi,4(%ebp)
+	addl	16(%ebp),%edi
+	movl	%ecx,8(%ebp)
+	movl	%ecx,%ebx
+	movl	%edx,12(%ebp)
+	xorl	%edx,%ebx
+	movl	%edi,16(%ebp)
+	movl	%esi,%ebp
+	pshufd	$238,%xmm0,%xmm4
+	andl	%ebx,%esi
+	movl	%ebp,%ebx
+	jmp	L006loop
+.align	4,0x90
+L007done:
+	addl	16(%esp),%ebx
+	xorl	%edi,%esi
+	movl	%ecx,%ebp
+	roll	$5,%ecx
+	addl	%esi,%ebx
+	xorl	%edi,%ebp
+	rorl	$7,%edx
+	addl	%ecx,%ebx
+	addl	20(%esp),%eax
+	xorl	%edx,%ebp
+	movl	%ebx,%esi
+	roll	$5,%ebx
+	addl	%ebp,%eax
+	xorl	%edx,%esi
+	rorl	$7,%ecx
+	addl	%ebx,%eax
+	addl	24(%esp),%edi
+	xorl	%ecx,%esi
+	movl	%eax,%ebp
+	roll	$5,%eax
+	addl	%esi,%edi
+	xorl	%ecx,%ebp
+	rorl	$7,%ebx
+	addl	%eax,%edi
+	addl	28(%esp),%edx
+	xorl	%ebx,%ebp
+	movl	%edi,%esi
+	roll	$5,%edi
+	addl	%ebp,%edx
+	xorl	%ebx,%esi
+	rorl	$7,%eax
+	addl	%edi,%edx
+	addl	32(%esp),%ecx
+	xorl	%eax,%esi
+	movl	%edx,%ebp
+	roll	$5,%edx
+	addl	%esi,%ecx
+	xorl	%eax,%ebp
+	rorl	$7,%edi
+	addl	%edx,%ecx
+	addl	36(%esp),%ebx
+	xorl	%edi,%ebp
+	movl	%ecx,%esi
+	roll	$5,%ecx
+	addl	%ebp,%ebx
+	xorl	%edi,%esi
+	rorl	$7,%edx
+	addl	%ecx,%ebx
+	addl	40(%esp),%eax
+	xorl	%edx,%esi
+	movl	%ebx,%ebp
+	roll	$5,%ebx
+	addl	%esi,%eax
+	xorl	%edx,%ebp
+	rorl	$7,%ecx
+	addl	%ebx,%eax
+	addl	44(%esp),%edi
+	xorl	%ecx,%ebp
+	movl	%eax,%esi
+	roll	$5,%eax
+	addl	%ebp,%edi
+	xorl	%ecx,%esi
+	rorl	$7,%ebx
+	addl	%eax,%edi
+	addl	48(%esp),%edx
+	xorl	%ebx,%esi
+	movl	%edi,%ebp
+	roll	$5,%edi
+	addl	%esi,%edx
+	xorl	%ebx,%ebp
+	rorl	$7,%eax
+	addl	%edi,%edx
+	addl	52(%esp),%ecx
+	xorl	%eax,%ebp
+	movl	%edx,%esi
+	roll	$5,%edx
+	addl	%ebp,%ecx
+	xorl	%eax,%esi
+	rorl	$7,%edi
+	addl	%edx,%ecx
+	addl	56(%esp),%ebx
+	xorl	%edi,%esi
+	movl	%ecx,%ebp
+	roll	$5,%ecx
+	addl	%esi,%ebx
+	xorl	%edi,%ebp
+	rorl	$7,%edx
+	addl	%ecx,%ebx
+	addl	60(%esp),%eax
+	xorl	%edx,%ebp
+	movl	%ebx,%esi
+	roll	$5,%ebx
+	addl	%ebp,%eax
+	rorl	$7,%ecx
+	addl	%ebx,%eax
+	movl	192(%esp),%ebp
+	addl	(%ebp),%eax
+	movl	204(%esp),%esp
+	addl	4(%ebp),%esi
+	addl	8(%ebp),%ecx
+	movl	%eax,(%ebp)
+	addl	12(%ebp),%edx
+	movl	%esi,4(%ebp)
+	addl	16(%ebp),%edi
+	movl	%ecx,8(%ebp)
+	movl	%edx,12(%ebp)
+	movl	%edi,16(%ebp)
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.align	6,0x90
+LK_XX_XX:
+.long	1518500249,1518500249,1518500249,1518500249
+.long	1859775393,1859775393,1859775393,1859775393
+.long	2400959708,2400959708,2400959708,2400959708
+.long	3395469782,3395469782,3395469782,3395469782
+.long	66051,67438087,134810123,202182159
+.byte	15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0
+.byte	83,72,65,49,32,98,108,111,99,107,32,116,114,97,110,115
+.byte	102,111,114,109,32,102,111,114,32,120,56,54,44,32,67,82
+.byte	89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112
+.byte	114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0
+.section __IMPORT,__pointers,non_lazy_symbol_pointers
+L_OPENSSL_ia32cap_P$non_lazy_ptr:
+.indirect_symbol	_OPENSSL_ia32cap_P
+.long	0
+#endif
diff --git a/third_party/boringssl/mac-x86/crypto/sha/sha256-586.S b/third_party/boringssl/mac-x86/crypto/sha/sha256-586.S
new file mode 100644
index 0000000..f0ba612
--- /dev/null
+++ b/third_party/boringssl/mac-x86/crypto/sha/sha256-586.S
@@ -0,0 +1,4581 @@
+#if defined(__i386__)
+.file	"sha512-586.S"
+.text
+.globl	_sha256_block_data_order
+.private_extern	_sha256_block_data_order
+.align	4
+_sha256_block_data_order:
+L_sha256_block_data_order_begin:
+	pushl	%ebp
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+	movl	20(%esp),%esi
+	movl	24(%esp),%edi
+	movl	28(%esp),%eax
+	movl	%esp,%ebx
+	call	L000pic_point
+L000pic_point:
+	popl	%ebp
+	leal	L001K256-L000pic_point(%ebp),%ebp
+	subl	$16,%esp
+	andl	$-64,%esp
+	shll	$6,%eax
+	addl	%edi,%eax
+	movl	%esi,(%esp)
+	movl	%edi,4(%esp)
+	movl	%eax,8(%esp)
+	movl	%ebx,12(%esp)
+	movl	L_OPENSSL_ia32cap_P$non_lazy_ptr-L001K256(%ebp),%edx
+	movl	(%edx),%ecx
+	movl	4(%edx),%ebx
+	testl	$1048576,%ecx
+	jnz	L002loop
+	movl	8(%edx),%edx
+	testl	$16777216,%ecx
+	jz	L003no_xmm
+	andl	$1073741824,%ecx
+	andl	$268435968,%ebx
+	testl	$536870912,%edx
+	jnz	L004shaext
+	orl	%ebx,%ecx
+	andl	$1342177280,%ecx
+	cmpl	$1342177280,%ecx
+	testl	$512,%ebx
+	jnz	L005SSSE3
+L003no_xmm:
+	subl	%edi,%eax
+	cmpl	$256,%eax
+	jae	L006unrolled
+	jmp	L002loop
+.align	4,0x90
+L002loop:
+	movl	(%edi),%eax
+	movl	4(%edi),%ebx
+	movl	8(%edi),%ecx
+	bswap	%eax
+	movl	12(%edi),%edx
+	bswap	%ebx
+	pushl	%eax
+	bswap	%ecx
+	pushl	%ebx
+	bswap	%edx
+	pushl	%ecx
+	pushl	%edx
+	movl	16(%edi),%eax
+	movl	20(%edi),%ebx
+	movl	24(%edi),%ecx
+	bswap	%eax
+	movl	28(%edi),%edx
+	bswap	%ebx
+	pushl	%eax
+	bswap	%ecx
+	pushl	%ebx
+	bswap	%edx
+	pushl	%ecx
+	pushl	%edx
+	movl	32(%edi),%eax
+	movl	36(%edi),%ebx
+	movl	40(%edi),%ecx
+	bswap	%eax
+	movl	44(%edi),%edx
+	bswap	%ebx
+	pushl	%eax
+	bswap	%ecx
+	pushl	%ebx
+	bswap	%edx
+	pushl	%ecx
+	pushl	%edx
+	movl	48(%edi),%eax
+	movl	52(%edi),%ebx
+	movl	56(%edi),%ecx
+	bswap	%eax
+	movl	60(%edi),%edx
+	bswap	%ebx
+	pushl	%eax
+	bswap	%ecx
+	pushl	%ebx
+	bswap	%edx
+	pushl	%ecx
+	pushl	%edx
+	addl	$64,%edi
+	leal	-36(%esp),%esp
+	movl	%edi,104(%esp)
+	movl	(%esi),%eax
+	movl	4(%esi),%ebx
+	movl	8(%esi),%ecx
+	movl	12(%esi),%edi
+	movl	%ebx,8(%esp)
+	xorl	%ecx,%ebx
+	movl	%ecx,12(%esp)
+	movl	%edi,16(%esp)
+	movl	%ebx,(%esp)
+	movl	16(%esi),%edx
+	movl	20(%esi),%ebx
+	movl	24(%esi),%ecx
+	movl	28(%esi),%edi
+	movl	%ebx,24(%esp)
+	movl	%ecx,28(%esp)
+	movl	%edi,32(%esp)
+.align	4,0x90
+L00700_15:
+	movl	%edx,%ecx
+	movl	24(%esp),%esi
+	rorl	$14,%ecx
+	movl	28(%esp),%edi
+	xorl	%edx,%ecx
+	xorl	%edi,%esi
+	movl	96(%esp),%ebx
+	rorl	$5,%ecx
+	andl	%edx,%esi
+	movl	%edx,20(%esp)
+	xorl	%ecx,%edx
+	addl	32(%esp),%ebx
+	xorl	%edi,%esi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%esi,%ebx
+	rorl	$9,%ecx
+	addl	%edx,%ebx
+	movl	8(%esp),%edi
+	xorl	%eax,%ecx
+	movl	%eax,4(%esp)
+	leal	-4(%esp),%esp
+	rorl	$11,%ecx
+	movl	(%ebp),%esi
+	xorl	%eax,%ecx
+	movl	20(%esp),%edx
+	xorl	%edi,%eax
+	rorl	$2,%ecx
+	addl	%esi,%ebx
+	movl	%eax,(%esp)
+	addl	%ebx,%edx
+	andl	4(%esp),%eax
+	addl	%ecx,%ebx
+	xorl	%edi,%eax
+	addl	$4,%ebp
+	addl	%ebx,%eax
+	cmpl	$3248222580,%esi
+	jne	L00700_15
+	movl	156(%esp),%ecx
+	jmp	L00816_63
+.align	4,0x90
+L00816_63:
+	movl	%ecx,%ebx
+	movl	104(%esp),%esi
+	rorl	$11,%ecx
+	movl	%esi,%edi
+	rorl	$2,%esi
+	xorl	%ebx,%ecx
+	shrl	$3,%ebx
+	rorl	$7,%ecx
+	xorl	%edi,%esi
+	xorl	%ecx,%ebx
+	rorl	$17,%esi
+	addl	160(%esp),%ebx
+	shrl	$10,%edi
+	addl	124(%esp),%ebx
+	movl	%edx,%ecx
+	xorl	%esi,%edi
+	movl	24(%esp),%esi
+	rorl	$14,%ecx
+	addl	%edi,%ebx
+	movl	28(%esp),%edi
+	xorl	%edx,%ecx
+	xorl	%edi,%esi
+	movl	%ebx,96(%esp)
+	rorl	$5,%ecx
+	andl	%edx,%esi
+	movl	%edx,20(%esp)
+	xorl	%ecx,%edx
+	addl	32(%esp),%ebx
+	xorl	%edi,%esi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%esi,%ebx
+	rorl	$9,%ecx
+	addl	%edx,%ebx
+	movl	8(%esp),%edi
+	xorl	%eax,%ecx
+	movl	%eax,4(%esp)
+	leal	-4(%esp),%esp
+	rorl	$11,%ecx
+	movl	(%ebp),%esi
+	xorl	%eax,%ecx
+	movl	20(%esp),%edx
+	xorl	%edi,%eax
+	rorl	$2,%ecx
+	addl	%esi,%ebx
+	movl	%eax,(%esp)
+	addl	%ebx,%edx
+	andl	4(%esp),%eax
+	addl	%ecx,%ebx
+	xorl	%edi,%eax
+	movl	156(%esp),%ecx
+	addl	$4,%ebp
+	addl	%ebx,%eax
+	cmpl	$3329325298,%esi
+	jne	L00816_63
+	movl	356(%esp),%esi
+	movl	8(%esp),%ebx
+	movl	16(%esp),%ecx
+	addl	(%esi),%eax
+	addl	4(%esi),%ebx
+	addl	8(%esi),%edi
+	addl	12(%esi),%ecx
+	movl	%eax,(%esi)
+	movl	%ebx,4(%esi)
+	movl	%edi,8(%esi)
+	movl	%ecx,12(%esi)
+	movl	24(%esp),%eax
+	movl	28(%esp),%ebx
+	movl	32(%esp),%ecx
+	movl	360(%esp),%edi
+	addl	16(%esi),%edx
+	addl	20(%esi),%eax
+	addl	24(%esi),%ebx
+	addl	28(%esi),%ecx
+	movl	%edx,16(%esi)
+	movl	%eax,20(%esi)
+	movl	%ebx,24(%esi)
+	movl	%ecx,28(%esi)
+	leal	356(%esp),%esp
+	subl	$256,%ebp
+	cmpl	8(%esp),%edi
+	jb	L002loop
+	movl	12(%esp),%esp
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.align	6,0x90
+L001K256:
+.long	1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298
+.long	66051,67438087,134810123,202182159
+.byte	83,72,65,50,53,54,32,98,108,111,99,107,32,116,114,97
+.byte	110,115,102,111,114,109,32,102,111,114,32,120,56,54,44,32
+.byte	67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97
+.byte	112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103
+.byte	62,0
+.align	4,0x90
+L006unrolled:
+	leal	-96(%esp),%esp
+	movl	(%esi),%eax
+	movl	4(%esi),%ebp
+	movl	8(%esi),%ecx
+	movl	12(%esi),%ebx
+	movl	%ebp,4(%esp)
+	xorl	%ecx,%ebp
+	movl	%ecx,8(%esp)
+	movl	%ebx,12(%esp)
+	movl	16(%esi),%edx
+	movl	20(%esi),%ebx
+	movl	24(%esi),%ecx
+	movl	28(%esi),%esi
+	movl	%ebx,20(%esp)
+	movl	%ecx,24(%esp)
+	movl	%esi,28(%esp)
+	jmp	L009grand_loop
+.align	4,0x90
+L009grand_loop:
+	movl	(%edi),%ebx
+	movl	4(%edi),%ecx
+	bswap	%ebx
+	movl	8(%edi),%esi
+	bswap	%ecx
+	movl	%ebx,32(%esp)
+	bswap	%esi
+	movl	%ecx,36(%esp)
+	movl	%esi,40(%esp)
+	movl	12(%edi),%ebx
+	movl	16(%edi),%ecx
+	bswap	%ebx
+	movl	20(%edi),%esi
+	bswap	%ecx
+	movl	%ebx,44(%esp)
+	bswap	%esi
+	movl	%ecx,48(%esp)
+	movl	%esi,52(%esp)
+	movl	24(%edi),%ebx
+	movl	28(%edi),%ecx
+	bswap	%ebx
+	movl	32(%edi),%esi
+	bswap	%ecx
+	movl	%ebx,56(%esp)
+	bswap	%esi
+	movl	%ecx,60(%esp)
+	movl	%esi,64(%esp)
+	movl	36(%edi),%ebx
+	movl	40(%edi),%ecx
+	bswap	%ebx
+	movl	44(%edi),%esi
+	bswap	%ecx
+	movl	%ebx,68(%esp)
+	bswap	%esi
+	movl	%ecx,72(%esp)
+	movl	%esi,76(%esp)
+	movl	48(%edi),%ebx
+	movl	52(%edi),%ecx
+	bswap	%ebx
+	movl	56(%edi),%esi
+	bswap	%ecx
+	movl	%ebx,80(%esp)
+	bswap	%esi
+	movl	%ecx,84(%esp)
+	movl	%esi,88(%esp)
+	movl	60(%edi),%ebx
+	addl	$64,%edi
+	bswap	%ebx
+	movl	%edi,100(%esp)
+	movl	%ebx,92(%esp)
+	movl	%edx,%ecx
+	movl	20(%esp),%esi
+	rorl	$14,%edx
+	movl	24(%esp),%edi
+	xorl	%ecx,%edx
+	movl	32(%esp),%ebx
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,16(%esp)
+	xorl	%ecx,%edx
+	addl	28(%esp),%ebx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%ebx
+	rorl	$9,%ecx
+	movl	%eax,%esi
+	movl	4(%esp),%edi
+	xorl	%eax,%ecx
+	movl	%eax,(%esp)
+	xorl	%edi,%eax
+	rorl	$11,%ecx
+	andl	%eax,%ebp
+	leal	1116352408(%ebx,%edx,1),%edx
+	xorl	%esi,%ecx
+	xorl	%edi,%ebp
+	rorl	$2,%ecx
+	addl	%edx,%ebp
+	addl	12(%esp),%edx
+	addl	%ecx,%ebp
+	movl	%edx,%esi
+	movl	16(%esp),%ecx
+	rorl	$14,%edx
+	movl	20(%esp),%edi
+	xorl	%esi,%edx
+	movl	36(%esp),%ebx
+	xorl	%edi,%ecx
+	rorl	$5,%edx
+	andl	%esi,%ecx
+	movl	%esi,12(%esp)
+	xorl	%esi,%edx
+	addl	24(%esp),%ebx
+	xorl	%ecx,%edi
+	rorl	$6,%edx
+	movl	%ebp,%esi
+	addl	%edi,%ebx
+	rorl	$9,%esi
+	movl	%ebp,%ecx
+	movl	(%esp),%edi
+	xorl	%ebp,%esi
+	movl	%ebp,28(%esp)
+	xorl	%edi,%ebp
+	rorl	$11,%esi
+	andl	%ebp,%eax
+	leal	1899447441(%ebx,%edx,1),%edx
+	xorl	%ecx,%esi
+	xorl	%edi,%eax
+	rorl	$2,%esi
+	addl	%edx,%eax
+	addl	8(%esp),%edx
+	addl	%esi,%eax
+	movl	%edx,%ecx
+	movl	12(%esp),%esi
+	rorl	$14,%edx
+	movl	16(%esp),%edi
+	xorl	%ecx,%edx
+	movl	40(%esp),%ebx
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,8(%esp)
+	xorl	%ecx,%edx
+	addl	20(%esp),%ebx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%ebx
+	rorl	$9,%ecx
+	movl	%eax,%esi
+	movl	28(%esp),%edi
+	xorl	%eax,%ecx
+	movl	%eax,24(%esp)
+	xorl	%edi,%eax
+	rorl	$11,%ecx
+	andl	%eax,%ebp
+	leal	3049323471(%ebx,%edx,1),%edx
+	xorl	%esi,%ecx
+	xorl	%edi,%ebp
+	rorl	$2,%ecx
+	addl	%edx,%ebp
+	addl	4(%esp),%edx
+	addl	%ecx,%ebp
+	movl	%edx,%esi
+	movl	8(%esp),%ecx
+	rorl	$14,%edx
+	movl	12(%esp),%edi
+	xorl	%esi,%edx
+	movl	44(%esp),%ebx
+	xorl	%edi,%ecx
+	rorl	$5,%edx
+	andl	%esi,%ecx
+	movl	%esi,4(%esp)
+	xorl	%esi,%edx
+	addl	16(%esp),%ebx
+	xorl	%ecx,%edi
+	rorl	$6,%edx
+	movl	%ebp,%esi
+	addl	%edi,%ebx
+	rorl	$9,%esi
+	movl	%ebp,%ecx
+	movl	24(%esp),%edi
+	xorl	%ebp,%esi
+	movl	%ebp,20(%esp)
+	xorl	%edi,%ebp
+	rorl	$11,%esi
+	andl	%ebp,%eax
+	leal	3921009573(%ebx,%edx,1),%edx
+	xorl	%ecx,%esi
+	xorl	%edi,%eax
+	rorl	$2,%esi
+	addl	%edx,%eax
+	addl	(%esp),%edx
+	addl	%esi,%eax
+	movl	%edx,%ecx
+	movl	4(%esp),%esi
+	rorl	$14,%edx
+	movl	8(%esp),%edi
+	xorl	%ecx,%edx
+	movl	48(%esp),%ebx
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,(%esp)
+	xorl	%ecx,%edx
+	addl	12(%esp),%ebx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%ebx
+	rorl	$9,%ecx
+	movl	%eax,%esi
+	movl	20(%esp),%edi
+	xorl	%eax,%ecx
+	movl	%eax,16(%esp)
+	xorl	%edi,%eax
+	rorl	$11,%ecx
+	andl	%eax,%ebp
+	leal	961987163(%ebx,%edx,1),%edx
+	xorl	%esi,%ecx
+	xorl	%edi,%ebp
+	rorl	$2,%ecx
+	addl	%edx,%ebp
+	addl	28(%esp),%edx
+	addl	%ecx,%ebp
+	movl	%edx,%esi
+	movl	(%esp),%ecx
+	rorl	$14,%edx
+	movl	4(%esp),%edi
+	xorl	%esi,%edx
+	movl	52(%esp),%ebx
+	xorl	%edi,%ecx
+	rorl	$5,%edx
+	andl	%esi,%ecx
+	movl	%esi,28(%esp)
+	xorl	%esi,%edx
+	addl	8(%esp),%ebx
+	xorl	%ecx,%edi
+	rorl	$6,%edx
+	movl	%ebp,%esi
+	addl	%edi,%ebx
+	rorl	$9,%esi
+	movl	%ebp,%ecx
+	movl	16(%esp),%edi
+	xorl	%ebp,%esi
+	movl	%ebp,12(%esp)
+	xorl	%edi,%ebp
+	rorl	$11,%esi
+	andl	%ebp,%eax
+	leal	1508970993(%ebx,%edx,1),%edx
+	xorl	%ecx,%esi
+	xorl	%edi,%eax
+	rorl	$2,%esi
+	addl	%edx,%eax
+	addl	24(%esp),%edx
+	addl	%esi,%eax
+	movl	%edx,%ecx
+	movl	28(%esp),%esi
+	rorl	$14,%edx
+	movl	(%esp),%edi
+	xorl	%ecx,%edx
+	movl	56(%esp),%ebx
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,24(%esp)
+	xorl	%ecx,%edx
+	addl	4(%esp),%ebx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%ebx
+	rorl	$9,%ecx
+	movl	%eax,%esi
+	movl	12(%esp),%edi
+	xorl	%eax,%ecx
+	movl	%eax,8(%esp)
+	xorl	%edi,%eax
+	rorl	$11,%ecx
+	andl	%eax,%ebp
+	leal	2453635748(%ebx,%edx,1),%edx
+	xorl	%esi,%ecx
+	xorl	%edi,%ebp
+	rorl	$2,%ecx
+	addl	%edx,%ebp
+	addl	20(%esp),%edx
+	addl	%ecx,%ebp
+	movl	%edx,%esi
+	movl	24(%esp),%ecx
+	rorl	$14,%edx
+	movl	28(%esp),%edi
+	xorl	%esi,%edx
+	movl	60(%esp),%ebx
+	xorl	%edi,%ecx
+	rorl	$5,%edx
+	andl	%esi,%ecx
+	movl	%esi,20(%esp)
+	xorl	%esi,%edx
+	addl	(%esp),%ebx
+	xorl	%ecx,%edi
+	rorl	$6,%edx
+	movl	%ebp,%esi
+	addl	%edi,%ebx
+	rorl	$9,%esi
+	movl	%ebp,%ecx
+	movl	8(%esp),%edi
+	xorl	%ebp,%esi
+	movl	%ebp,4(%esp)
+	xorl	%edi,%ebp
+	rorl	$11,%esi
+	andl	%ebp,%eax
+	leal	2870763221(%ebx,%edx,1),%edx
+	xorl	%ecx,%esi
+	xorl	%edi,%eax
+	rorl	$2,%esi
+	addl	%edx,%eax
+	addl	16(%esp),%edx
+	addl	%esi,%eax
+	movl	%edx,%ecx
+	movl	20(%esp),%esi
+	rorl	$14,%edx
+	movl	24(%esp),%edi
+	xorl	%ecx,%edx
+	movl	64(%esp),%ebx
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,16(%esp)
+	xorl	%ecx,%edx
+	addl	28(%esp),%ebx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%ebx
+	rorl	$9,%ecx
+	movl	%eax,%esi
+	movl	4(%esp),%edi
+	xorl	%eax,%ecx
+	movl	%eax,(%esp)
+	xorl	%edi,%eax
+	rorl	$11,%ecx
+	andl	%eax,%ebp
+	leal	3624381080(%ebx,%edx,1),%edx
+	xorl	%esi,%ecx
+	xorl	%edi,%ebp
+	rorl	$2,%ecx
+	addl	%edx,%ebp
+	addl	12(%esp),%edx
+	addl	%ecx,%ebp
+	movl	%edx,%esi
+	movl	16(%esp),%ecx
+	rorl	$14,%edx
+	movl	20(%esp),%edi
+	xorl	%esi,%edx
+	movl	68(%esp),%ebx
+	xorl	%edi,%ecx
+	rorl	$5,%edx
+	andl	%esi,%ecx
+	movl	%esi,12(%esp)
+	xorl	%esi,%edx
+	addl	24(%esp),%ebx
+	xorl	%ecx,%edi
+	rorl	$6,%edx
+	movl	%ebp,%esi
+	addl	%edi,%ebx
+	rorl	$9,%esi
+	movl	%ebp,%ecx
+	movl	(%esp),%edi
+	xorl	%ebp,%esi
+	movl	%ebp,28(%esp)
+	xorl	%edi,%ebp
+	rorl	$11,%esi
+	andl	%ebp,%eax
+	leal	310598401(%ebx,%edx,1),%edx
+	xorl	%ecx,%esi
+	xorl	%edi,%eax
+	rorl	$2,%esi
+	addl	%edx,%eax
+	addl	8(%esp),%edx
+	addl	%esi,%eax
+	movl	%edx,%ecx
+	movl	12(%esp),%esi
+	rorl	$14,%edx
+	movl	16(%esp),%edi
+	xorl	%ecx,%edx
+	movl	72(%esp),%ebx
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,8(%esp)
+	xorl	%ecx,%edx
+	addl	20(%esp),%ebx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%ebx
+	rorl	$9,%ecx
+	movl	%eax,%esi
+	movl	28(%esp),%edi
+	xorl	%eax,%ecx
+	movl	%eax,24(%esp)
+	xorl	%edi,%eax
+	rorl	$11,%ecx
+	andl	%eax,%ebp
+	leal	607225278(%ebx,%edx,1),%edx
+	xorl	%esi,%ecx
+	xorl	%edi,%ebp
+	rorl	$2,%ecx
+	addl	%edx,%ebp
+	addl	4(%esp),%edx
+	addl	%ecx,%ebp
+	movl	%edx,%esi
+	movl	8(%esp),%ecx
+	rorl	$14,%edx
+	movl	12(%esp),%edi
+	xorl	%esi,%edx
+	movl	76(%esp),%ebx
+	xorl	%edi,%ecx
+	rorl	$5,%edx
+	andl	%esi,%ecx
+	movl	%esi,4(%esp)
+	xorl	%esi,%edx
+	addl	16(%esp),%ebx
+	xorl	%ecx,%edi
+	rorl	$6,%edx
+	movl	%ebp,%esi
+	addl	%edi,%ebx
+	rorl	$9,%esi
+	movl	%ebp,%ecx
+	movl	24(%esp),%edi
+	xorl	%ebp,%esi
+	movl	%ebp,20(%esp)
+	xorl	%edi,%ebp
+	rorl	$11,%esi
+	andl	%ebp,%eax
+	leal	1426881987(%ebx,%edx,1),%edx
+	xorl	%ecx,%esi
+	xorl	%edi,%eax
+	rorl	$2,%esi
+	addl	%edx,%eax
+	addl	(%esp),%edx
+	addl	%esi,%eax
+	movl	%edx,%ecx
+	movl	4(%esp),%esi
+	rorl	$14,%edx
+	movl	8(%esp),%edi
+	xorl	%ecx,%edx
+	movl	80(%esp),%ebx
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,(%esp)
+	xorl	%ecx,%edx
+	addl	12(%esp),%ebx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%ebx
+	rorl	$9,%ecx
+	movl	%eax,%esi
+	movl	20(%esp),%edi
+	xorl	%eax,%ecx
+	movl	%eax,16(%esp)
+	xorl	%edi,%eax
+	rorl	$11,%ecx
+	andl	%eax,%ebp
+	leal	1925078388(%ebx,%edx,1),%edx
+	xorl	%esi,%ecx
+	xorl	%edi,%ebp
+	rorl	$2,%ecx
+	addl	%edx,%ebp
+	addl	28(%esp),%edx
+	addl	%ecx,%ebp
+	movl	%edx,%esi
+	movl	(%esp),%ecx
+	rorl	$14,%edx
+	movl	4(%esp),%edi
+	xorl	%esi,%edx
+	movl	84(%esp),%ebx
+	xorl	%edi,%ecx
+	rorl	$5,%edx
+	andl	%esi,%ecx
+	movl	%esi,28(%esp)
+	xorl	%esi,%edx
+	addl	8(%esp),%ebx
+	xorl	%ecx,%edi
+	rorl	$6,%edx
+	movl	%ebp,%esi
+	addl	%edi,%ebx
+	rorl	$9,%esi
+	movl	%ebp,%ecx
+	movl	16(%esp),%edi
+	xorl	%ebp,%esi
+	movl	%ebp,12(%esp)
+	xorl	%edi,%ebp
+	rorl	$11,%esi
+	andl	%ebp,%eax
+	leal	2162078206(%ebx,%edx,1),%edx
+	xorl	%ecx,%esi
+	xorl	%edi,%eax
+	rorl	$2,%esi
+	addl	%edx,%eax
+	addl	24(%esp),%edx
+	addl	%esi,%eax
+	movl	%edx,%ecx
+	movl	28(%esp),%esi
+	rorl	$14,%edx
+	movl	(%esp),%edi
+	xorl	%ecx,%edx
+	movl	88(%esp),%ebx
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,24(%esp)
+	xorl	%ecx,%edx
+	addl	4(%esp),%ebx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%ebx
+	rorl	$9,%ecx
+	movl	%eax,%esi
+	movl	12(%esp),%edi
+	xorl	%eax,%ecx
+	movl	%eax,8(%esp)
+	xorl	%edi,%eax
+	rorl	$11,%ecx
+	andl	%eax,%ebp
+	leal	2614888103(%ebx,%edx,1),%edx
+	xorl	%esi,%ecx
+	xorl	%edi,%ebp
+	rorl	$2,%ecx
+	addl	%edx,%ebp
+	addl	20(%esp),%edx
+	addl	%ecx,%ebp
+	movl	%edx,%esi
+	movl	24(%esp),%ecx
+	rorl	$14,%edx
+	movl	28(%esp),%edi
+	xorl	%esi,%edx
+	movl	92(%esp),%ebx
+	xorl	%edi,%ecx
+	rorl	$5,%edx
+	andl	%esi,%ecx
+	movl	%esi,20(%esp)
+	xorl	%esi,%edx
+	addl	(%esp),%ebx
+	xorl	%ecx,%edi
+	rorl	$6,%edx
+	movl	%ebp,%esi
+	addl	%edi,%ebx
+	rorl	$9,%esi
+	movl	%ebp,%ecx
+	movl	8(%esp),%edi
+	xorl	%ebp,%esi
+	movl	%ebp,4(%esp)
+	xorl	%edi,%ebp
+	rorl	$11,%esi
+	andl	%ebp,%eax
+	leal	3248222580(%ebx,%edx,1),%edx
+	xorl	%ecx,%esi
+	xorl	%edi,%eax
+	movl	36(%esp),%ecx
+	rorl	$2,%esi
+	addl	%edx,%eax
+	addl	16(%esp),%edx
+	addl	%esi,%eax
+	movl	88(%esp),%esi
+	movl	%ecx,%ebx
+	rorl	$11,%ecx
+	movl	%esi,%edi
+	rorl	$2,%esi
+	xorl	%ebx,%ecx
+	shrl	$3,%ebx
+	rorl	$7,%ecx
+	xorl	%edi,%esi
+	xorl	%ecx,%ebx
+	rorl	$17,%esi
+	addl	32(%esp),%ebx
+	shrl	$10,%edi
+	addl	68(%esp),%ebx
+	movl	%edx,%ecx
+	xorl	%esi,%edi
+	movl	20(%esp),%esi
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	24(%esp),%edi
+	xorl	%ecx,%edx
+	movl	%ebx,32(%esp)
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,16(%esp)
+	xorl	%ecx,%edx
+	addl	28(%esp),%ebx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%ebx
+	rorl	$9,%ecx
+	movl	%eax,%esi
+	movl	4(%esp),%edi
+	xorl	%eax,%ecx
+	movl	%eax,(%esp)
+	xorl	%edi,%eax
+	rorl	$11,%ecx
+	andl	%eax,%ebp
+	leal	3835390401(%ebx,%edx,1),%edx
+	xorl	%esi,%ecx
+	xorl	%edi,%ebp
+	movl	40(%esp),%esi
+	rorl	$2,%ecx
+	addl	%edx,%ebp
+	addl	12(%esp),%edx
+	addl	%ecx,%ebp
+	movl	92(%esp),%ecx
+	movl	%esi,%ebx
+	rorl	$11,%esi
+	movl	%ecx,%edi
+	rorl	$2,%ecx
+	xorl	%ebx,%esi
+	shrl	$3,%ebx
+	rorl	$7,%esi
+	xorl	%edi,%ecx
+	xorl	%esi,%ebx
+	rorl	$17,%ecx
+	addl	36(%esp),%ebx
+	shrl	$10,%edi
+	addl	72(%esp),%ebx
+	movl	%edx,%esi
+	xorl	%ecx,%edi
+	movl	16(%esp),%ecx
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	20(%esp),%edi
+	xorl	%esi,%edx
+	movl	%ebx,36(%esp)
+	xorl	%edi,%ecx
+	rorl	$5,%edx
+	andl	%esi,%ecx
+	movl	%esi,12(%esp)
+	xorl	%esi,%edx
+	addl	24(%esp),%ebx
+	xorl	%ecx,%edi
+	rorl	$6,%edx
+	movl	%ebp,%esi
+	addl	%edi,%ebx
+	rorl	$9,%esi
+	movl	%ebp,%ecx
+	movl	(%esp),%edi
+	xorl	%ebp,%esi
+	movl	%ebp,28(%esp)
+	xorl	%edi,%ebp
+	rorl	$11,%esi
+	andl	%ebp,%eax
+	leal	4022224774(%ebx,%edx,1),%edx
+	xorl	%ecx,%esi
+	xorl	%edi,%eax
+	movl	44(%esp),%ecx
+	rorl	$2,%esi
+	addl	%edx,%eax
+	addl	8(%esp),%edx
+	addl	%esi,%eax
+	movl	32(%esp),%esi
+	movl	%ecx,%ebx
+	rorl	$11,%ecx
+	movl	%esi,%edi
+	rorl	$2,%esi
+	xorl	%ebx,%ecx
+	shrl	$3,%ebx
+	rorl	$7,%ecx
+	xorl	%edi,%esi
+	xorl	%ecx,%ebx
+	rorl	$17,%esi
+	addl	40(%esp),%ebx
+	shrl	$10,%edi
+	addl	76(%esp),%ebx
+	movl	%edx,%ecx
+	xorl	%esi,%edi
+	movl	12(%esp),%esi
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	16(%esp),%edi
+	xorl	%ecx,%edx
+	movl	%ebx,40(%esp)
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,8(%esp)
+	xorl	%ecx,%edx
+	addl	20(%esp),%ebx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%ebx
+	rorl	$9,%ecx
+	movl	%eax,%esi
+	movl	28(%esp),%edi
+	xorl	%eax,%ecx
+	movl	%eax,24(%esp)
+	xorl	%edi,%eax
+	rorl	$11,%ecx
+	andl	%eax,%ebp
+	leal	264347078(%ebx,%edx,1),%edx
+	xorl	%esi,%ecx
+	xorl	%edi,%ebp
+	movl	48(%esp),%esi
+	rorl	$2,%ecx
+	addl	%edx,%ebp
+	addl	4(%esp),%edx
+	addl	%ecx,%ebp
+	movl	36(%esp),%ecx
+	movl	%esi,%ebx
+	rorl	$11,%esi
+	movl	%ecx,%edi
+	rorl	$2,%ecx
+	xorl	%ebx,%esi
+	shrl	$3,%ebx
+	rorl	$7,%esi
+	xorl	%edi,%ecx
+	xorl	%esi,%ebx
+	rorl	$17,%ecx
+	addl	44(%esp),%ebx
+	shrl	$10,%edi
+	addl	80(%esp),%ebx
+	movl	%edx,%esi
+	xorl	%ecx,%edi
+	movl	8(%esp),%ecx
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	12(%esp),%edi
+	xorl	%esi,%edx
+	movl	%ebx,44(%esp)
+	xorl	%edi,%ecx
+	rorl	$5,%edx
+	andl	%esi,%ecx
+	movl	%esi,4(%esp)
+	xorl	%esi,%edx
+	addl	16(%esp),%ebx
+	xorl	%ecx,%edi
+	rorl	$6,%edx
+	movl	%ebp,%esi
+	addl	%edi,%ebx
+	rorl	$9,%esi
+	movl	%ebp,%ecx
+	movl	24(%esp),%edi
+	xorl	%ebp,%esi
+	movl	%ebp,20(%esp)
+	xorl	%edi,%ebp
+	rorl	$11,%esi
+	andl	%ebp,%eax
+	leal	604807628(%ebx,%edx,1),%edx
+	xorl	%ecx,%esi
+	xorl	%edi,%eax
+	movl	52(%esp),%ecx
+	rorl	$2,%esi
+	addl	%edx,%eax
+	addl	(%esp),%edx
+	addl	%esi,%eax
+	movl	40(%esp),%esi
+	movl	%ecx,%ebx
+	rorl	$11,%ecx
+	movl	%esi,%edi
+	rorl	$2,%esi
+	xorl	%ebx,%ecx
+	shrl	$3,%ebx
+	rorl	$7,%ecx
+	xorl	%edi,%esi
+	xorl	%ecx,%ebx
+	rorl	$17,%esi
+	addl	48(%esp),%ebx
+	shrl	$10,%edi
+	addl	84(%esp),%ebx
+	movl	%edx,%ecx
+	xorl	%esi,%edi
+	movl	4(%esp),%esi
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	8(%esp),%edi
+	xorl	%ecx,%edx
+	movl	%ebx,48(%esp)
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,(%esp)
+	xorl	%ecx,%edx
+	addl	12(%esp),%ebx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%ebx
+	rorl	$9,%ecx
+	movl	%eax,%esi
+	movl	20(%esp),%edi
+	xorl	%eax,%ecx
+	movl	%eax,16(%esp)
+	xorl	%edi,%eax
+	rorl	$11,%ecx
+	andl	%eax,%ebp
+	leal	770255983(%ebx,%edx,1),%edx
+	xorl	%esi,%ecx
+	xorl	%edi,%ebp
+	movl	56(%esp),%esi
+	rorl	$2,%ecx
+	addl	%edx,%ebp
+	addl	28(%esp),%edx
+	addl	%ecx,%ebp
+	movl	44(%esp),%ecx
+	movl	%esi,%ebx
+	rorl	$11,%esi
+	movl	%ecx,%edi
+	rorl	$2,%ecx
+	xorl	%ebx,%esi
+	shrl	$3,%ebx
+	rorl	$7,%esi
+	xorl	%edi,%ecx
+	xorl	%esi,%ebx
+	rorl	$17,%ecx
+	addl	52(%esp),%ebx
+	shrl	$10,%edi
+	addl	88(%esp),%ebx
+	movl	%edx,%esi
+	xorl	%ecx,%edi
+	movl	(%esp),%ecx
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	4(%esp),%edi
+	xorl	%esi,%edx
+	movl	%ebx,52(%esp)
+	xorl	%edi,%ecx
+	rorl	$5,%edx
+	andl	%esi,%ecx
+	movl	%esi,28(%esp)
+	xorl	%esi,%edx
+	addl	8(%esp),%ebx
+	xorl	%ecx,%edi
+	rorl	$6,%edx
+	movl	%ebp,%esi
+	addl	%edi,%ebx
+	rorl	$9,%esi
+	movl	%ebp,%ecx
+	movl	16(%esp),%edi
+	xorl	%ebp,%esi
+	movl	%ebp,12(%esp)
+	xorl	%edi,%ebp
+	rorl	$11,%esi
+	andl	%ebp,%eax
+	leal	1249150122(%ebx,%edx,1),%edx
+	xorl	%ecx,%esi
+	xorl	%edi,%eax
+	movl	60(%esp),%ecx
+	rorl	$2,%esi
+	addl	%edx,%eax
+	addl	24(%esp),%edx
+	addl	%esi,%eax
+	movl	48(%esp),%esi
+	movl	%ecx,%ebx
+	rorl	$11,%ecx
+	movl	%esi,%edi
+	rorl	$2,%esi
+	xorl	%ebx,%ecx
+	shrl	$3,%ebx
+	rorl	$7,%ecx
+	xorl	%edi,%esi
+	xorl	%ecx,%ebx
+	rorl	$17,%esi
+	addl	56(%esp),%ebx
+	shrl	$10,%edi
+	addl	92(%esp),%ebx
+	movl	%edx,%ecx
+	xorl	%esi,%edi
+	movl	28(%esp),%esi
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	(%esp),%edi
+	xorl	%ecx,%edx
+	movl	%ebx,56(%esp)
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,24(%esp)
+	xorl	%ecx,%edx
+	addl	4(%esp),%ebx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%ebx
+	rorl	$9,%ecx
+	movl	%eax,%esi
+	movl	12(%esp),%edi
+	xorl	%eax,%ecx
+	movl	%eax,8(%esp)
+	xorl	%edi,%eax
+	rorl	$11,%ecx
+	andl	%eax,%ebp
+	leal	1555081692(%ebx,%edx,1),%edx
+	xorl	%esi,%ecx
+	xorl	%edi,%ebp
+	movl	64(%esp),%esi
+	rorl	$2,%ecx
+	addl	%edx,%ebp
+	addl	20(%esp),%edx
+	addl	%ecx,%ebp
+	movl	52(%esp),%ecx
+	movl	%esi,%ebx
+	rorl	$11,%esi
+	movl	%ecx,%edi
+	rorl	$2,%ecx
+	xorl	%ebx,%esi
+	shrl	$3,%ebx
+	rorl	$7,%esi
+	xorl	%edi,%ecx
+	xorl	%esi,%ebx
+	rorl	$17,%ecx
+	addl	60(%esp),%ebx
+	shrl	$10,%edi
+	addl	32(%esp),%ebx
+	movl	%edx,%esi
+	xorl	%ecx,%edi
+	movl	24(%esp),%ecx
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	28(%esp),%edi
+	xorl	%esi,%edx
+	movl	%ebx,60(%esp)
+	xorl	%edi,%ecx
+	rorl	$5,%edx
+	andl	%esi,%ecx
+	movl	%esi,20(%esp)
+	xorl	%esi,%edx
+	addl	(%esp),%ebx
+	xorl	%ecx,%edi
+	rorl	$6,%edx
+	movl	%ebp,%esi
+	addl	%edi,%ebx
+	rorl	$9,%esi
+	movl	%ebp,%ecx
+	movl	8(%esp),%edi
+	xorl	%ebp,%esi
+	movl	%ebp,4(%esp)
+	xorl	%edi,%ebp
+	rorl	$11,%esi
+	andl	%ebp,%eax
+	leal	1996064986(%ebx,%edx,1),%edx
+	xorl	%ecx,%esi
+	xorl	%edi,%eax
+	movl	68(%esp),%ecx
+	rorl	$2,%esi
+	addl	%edx,%eax
+	addl	16(%esp),%edx
+	addl	%esi,%eax
+	movl	56(%esp),%esi
+	movl	%ecx,%ebx
+	rorl	$11,%ecx
+	movl	%esi,%edi
+	rorl	$2,%esi
+	xorl	%ebx,%ecx
+	shrl	$3,%ebx
+	rorl	$7,%ecx
+	xorl	%edi,%esi
+	xorl	%ecx,%ebx
+	rorl	$17,%esi
+	addl	64(%esp),%ebx
+	shrl	$10,%edi
+	addl	36(%esp),%ebx
+	movl	%edx,%ecx
+	xorl	%esi,%edi
+	movl	20(%esp),%esi
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	24(%esp),%edi
+	xorl	%ecx,%edx
+	movl	%ebx,64(%esp)
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,16(%esp)
+	xorl	%ecx,%edx
+	addl	28(%esp),%ebx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%ebx
+	rorl	$9,%ecx
+	movl	%eax,%esi
+	movl	4(%esp),%edi
+	xorl	%eax,%ecx
+	movl	%eax,(%esp)
+	xorl	%edi,%eax
+	rorl	$11,%ecx
+	andl	%eax,%ebp
+	leal	2554220882(%ebx,%edx,1),%edx
+	xorl	%esi,%ecx
+	xorl	%edi,%ebp
+	movl	72(%esp),%esi
+	rorl	$2,%ecx
+	addl	%edx,%ebp
+	addl	12(%esp),%edx
+	addl	%ecx,%ebp
+	movl	60(%esp),%ecx
+	movl	%esi,%ebx
+	rorl	$11,%esi
+	movl	%ecx,%edi
+	rorl	$2,%ecx
+	xorl	%ebx,%esi
+	shrl	$3,%ebx
+	rorl	$7,%esi
+	xorl	%edi,%ecx
+	xorl	%esi,%ebx
+	rorl	$17,%ecx
+	addl	68(%esp),%ebx
+	shrl	$10,%edi
+	addl	40(%esp),%ebx
+	movl	%edx,%esi
+	xorl	%ecx,%edi
+	movl	16(%esp),%ecx
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	20(%esp),%edi
+	xorl	%esi,%edx
+	movl	%ebx,68(%esp)
+	xorl	%edi,%ecx
+	rorl	$5,%edx
+	andl	%esi,%ecx
+	movl	%esi,12(%esp)
+	xorl	%esi,%edx
+	addl	24(%esp),%ebx
+	xorl	%ecx,%edi
+	rorl	$6,%edx
+	movl	%ebp,%esi
+	addl	%edi,%ebx
+	rorl	$9,%esi
+	movl	%ebp,%ecx
+	movl	(%esp),%edi
+	xorl	%ebp,%esi
+	movl	%ebp,28(%esp)
+	xorl	%edi,%ebp
+	rorl	$11,%esi
+	andl	%ebp,%eax
+	leal	2821834349(%ebx,%edx,1),%edx
+	xorl	%ecx,%esi
+	xorl	%edi,%eax
+	movl	76(%esp),%ecx
+	rorl	$2,%esi
+	addl	%edx,%eax
+	addl	8(%esp),%edx
+	addl	%esi,%eax
+	movl	64(%esp),%esi
+	movl	%ecx,%ebx
+	rorl	$11,%ecx
+	movl	%esi,%edi
+	rorl	$2,%esi
+	xorl	%ebx,%ecx
+	shrl	$3,%ebx
+	rorl	$7,%ecx
+	xorl	%edi,%esi
+	xorl	%ecx,%ebx
+	rorl	$17,%esi
+	addl	72(%esp),%ebx
+	shrl	$10,%edi
+	addl	44(%esp),%ebx
+	movl	%edx,%ecx
+	xorl	%esi,%edi
+	movl	12(%esp),%esi
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	16(%esp),%edi
+	xorl	%ecx,%edx
+	movl	%ebx,72(%esp)
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,8(%esp)
+	xorl	%ecx,%edx
+	addl	20(%esp),%ebx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%ebx
+	rorl	$9,%ecx
+	movl	%eax,%esi
+	movl	28(%esp),%edi
+	xorl	%eax,%ecx
+	movl	%eax,24(%esp)
+	xorl	%edi,%eax
+	rorl	$11,%ecx
+	andl	%eax,%ebp
+	leal	2952996808(%ebx,%edx,1),%edx
+	xorl	%esi,%ecx
+	xorl	%edi,%ebp
+	movl	80(%esp),%esi
+	rorl	$2,%ecx
+	addl	%edx,%ebp
+	addl	4(%esp),%edx
+	addl	%ecx,%ebp
+	movl	68(%esp),%ecx
+	movl	%esi,%ebx
+	rorl	$11,%esi
+	movl	%ecx,%edi
+	rorl	$2,%ecx
+	xorl	%ebx,%esi
+	shrl	$3,%ebx
+	rorl	$7,%esi
+	xorl	%edi,%ecx
+	xorl	%esi,%ebx
+	rorl	$17,%ecx
+	addl	76(%esp),%ebx
+	shrl	$10,%edi
+	addl	48(%esp),%ebx
+	movl	%edx,%esi
+	xorl	%ecx,%edi
+	movl	8(%esp),%ecx
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	12(%esp),%edi
+	xorl	%esi,%edx
+	movl	%ebx,76(%esp)
+	xorl	%edi,%ecx
+	rorl	$5,%edx
+	andl	%esi,%ecx
+	movl	%esi,4(%esp)
+	xorl	%esi,%edx
+	addl	16(%esp),%ebx
+	xorl	%ecx,%edi
+	rorl	$6,%edx
+	movl	%ebp,%esi
+	addl	%edi,%ebx
+	rorl	$9,%esi
+	movl	%ebp,%ecx
+	movl	24(%esp),%edi
+	xorl	%ebp,%esi
+	movl	%ebp,20(%esp)
+	xorl	%edi,%ebp
+	rorl	$11,%esi
+	andl	%ebp,%eax
+	leal	3210313671(%ebx,%edx,1),%edx
+	xorl	%ecx,%esi
+	xorl	%edi,%eax
+	movl	84(%esp),%ecx
+	rorl	$2,%esi
+	addl	%edx,%eax
+	addl	(%esp),%edx
+	addl	%esi,%eax
+	movl	72(%esp),%esi
+	movl	%ecx,%ebx
+	rorl	$11,%ecx
+	movl	%esi,%edi
+	rorl	$2,%esi
+	xorl	%ebx,%ecx
+	shrl	$3,%ebx
+	rorl	$7,%ecx
+	xorl	%edi,%esi
+	xorl	%ecx,%ebx
+	rorl	$17,%esi
+	addl	80(%esp),%ebx
+	shrl	$10,%edi
+	addl	52(%esp),%ebx
+	movl	%edx,%ecx
+	xorl	%esi,%edi
+	movl	4(%esp),%esi
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	8(%esp),%edi
+	xorl	%ecx,%edx
+	movl	%ebx,80(%esp)
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,(%esp)
+	xorl	%ecx,%edx
+	addl	12(%esp),%ebx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%ebx
+	rorl	$9,%ecx
+	movl	%eax,%esi
+	movl	20(%esp),%edi
+	xorl	%eax,%ecx
+	movl	%eax,16(%esp)
+	xorl	%edi,%eax
+	rorl	$11,%ecx
+	andl	%eax,%ebp
+	leal	3336571891(%ebx,%edx,1),%edx
+	xorl	%esi,%ecx
+	xorl	%edi,%ebp
+	movl	88(%esp),%esi
+	rorl	$2,%ecx
+	addl	%edx,%ebp
+	addl	28(%esp),%edx
+	addl	%ecx,%ebp
+	movl	76(%esp),%ecx
+	movl	%esi,%ebx
+	rorl	$11,%esi
+	movl	%ecx,%edi
+	rorl	$2,%ecx
+	xorl	%ebx,%esi
+	shrl	$3,%ebx
+	rorl	$7,%esi
+	xorl	%edi,%ecx
+	xorl	%esi,%ebx
+	rorl	$17,%ecx
+	addl	84(%esp),%ebx
+	shrl	$10,%edi
+	addl	56(%esp),%ebx
+	movl	%edx,%esi
+	xorl	%ecx,%edi
+	movl	(%esp),%ecx
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	4(%esp),%edi
+	xorl	%esi,%edx
+	movl	%ebx,84(%esp)
+	xorl	%edi,%ecx
+	rorl	$5,%edx
+	andl	%esi,%ecx
+	movl	%esi,28(%esp)
+	xorl	%esi,%edx
+	addl	8(%esp),%ebx
+	xorl	%ecx,%edi
+	rorl	$6,%edx
+	movl	%ebp,%esi
+	addl	%edi,%ebx
+	rorl	$9,%esi
+	movl	%ebp,%ecx
+	movl	16(%esp),%edi
+	xorl	%ebp,%esi
+	movl	%ebp,12(%esp)
+	xorl	%edi,%ebp
+	rorl	$11,%esi
+	andl	%ebp,%eax
+	leal	3584528711(%ebx,%edx,1),%edx
+	xorl	%ecx,%esi
+	xorl	%edi,%eax
+	movl	92(%esp),%ecx
+	rorl	$2,%esi
+	addl	%edx,%eax
+	addl	24(%esp),%edx
+	addl	%esi,%eax
+	movl	80(%esp),%esi
+	movl	%ecx,%ebx
+	rorl	$11,%ecx
+	movl	%esi,%edi
+	rorl	$2,%esi
+	xorl	%ebx,%ecx
+	shrl	$3,%ebx
+	rorl	$7,%ecx
+	xorl	%edi,%esi
+	xorl	%ecx,%ebx
+	rorl	$17,%esi
+	addl	88(%esp),%ebx
+	shrl	$10,%edi
+	addl	60(%esp),%ebx
+	movl	%edx,%ecx
+	xorl	%esi,%edi
+	movl	28(%esp),%esi
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	(%esp),%edi
+	xorl	%ecx,%edx
+	movl	%ebx,88(%esp)
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,24(%esp)
+	xorl	%ecx,%edx
+	addl	4(%esp),%ebx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%ebx
+	rorl	$9,%ecx
+	movl	%eax,%esi
+	movl	12(%esp),%edi
+	xorl	%eax,%ecx
+	movl	%eax,8(%esp)
+	xorl	%edi,%eax
+	rorl	$11,%ecx
+	andl	%eax,%ebp
+	leal	113926993(%ebx,%edx,1),%edx
+	xorl	%esi,%ecx
+	xorl	%edi,%ebp
+	movl	32(%esp),%esi
+	rorl	$2,%ecx
+	addl	%edx,%ebp
+	addl	20(%esp),%edx
+	addl	%ecx,%ebp
+	movl	84(%esp),%ecx
+	movl	%esi,%ebx
+	rorl	$11,%esi
+	movl	%ecx,%edi
+	rorl	$2,%ecx
+	xorl	%ebx,%esi
+	shrl	$3,%ebx
+	rorl	$7,%esi
+	xorl	%edi,%ecx
+	xorl	%esi,%ebx
+	rorl	$17,%ecx
+	addl	92(%esp),%ebx
+	shrl	$10,%edi
+	addl	64(%esp),%ebx
+	movl	%edx,%esi
+	xorl	%ecx,%edi
+	movl	24(%esp),%ecx
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	28(%esp),%edi
+	xorl	%esi,%edx
+	movl	%ebx,92(%esp)
+	xorl	%edi,%ecx
+	rorl	$5,%edx
+	andl	%esi,%ecx
+	movl	%esi,20(%esp)
+	xorl	%esi,%edx
+	addl	(%esp),%ebx
+	xorl	%ecx,%edi
+	rorl	$6,%edx
+	movl	%ebp,%esi
+	addl	%edi,%ebx
+	rorl	$9,%esi
+	movl	%ebp,%ecx
+	movl	8(%esp),%edi
+	xorl	%ebp,%esi
+	movl	%ebp,4(%esp)
+	xorl	%edi,%ebp
+	rorl	$11,%esi
+	andl	%ebp,%eax
+	leal	338241895(%ebx,%edx,1),%edx
+	xorl	%ecx,%esi
+	xorl	%edi,%eax
+	movl	36(%esp),%ecx
+	rorl	$2,%esi
+	addl	%edx,%eax
+	addl	16(%esp),%edx
+	addl	%esi,%eax
+	movl	88(%esp),%esi
+	movl	%ecx,%ebx
+	rorl	$11,%ecx
+	movl	%esi,%edi
+	rorl	$2,%esi
+	xorl	%ebx,%ecx
+	shrl	$3,%ebx
+	rorl	$7,%ecx
+	xorl	%edi,%esi
+	xorl	%ecx,%ebx
+	rorl	$17,%esi
+	addl	32(%esp),%ebx
+	shrl	$10,%edi
+	addl	68(%esp),%ebx
+	movl	%edx,%ecx
+	xorl	%esi,%edi
+	movl	20(%esp),%esi
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	24(%esp),%edi
+	xorl	%ecx,%edx
+	movl	%ebx,32(%esp)
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,16(%esp)
+	xorl	%ecx,%edx
+	addl	28(%esp),%ebx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%ebx
+	rorl	$9,%ecx
+	movl	%eax,%esi
+	movl	4(%esp),%edi
+	xorl	%eax,%ecx
+	movl	%eax,(%esp)
+	xorl	%edi,%eax
+	rorl	$11,%ecx
+	andl	%eax,%ebp
+	leal	666307205(%ebx,%edx,1),%edx
+	xorl	%esi,%ecx
+	xorl	%edi,%ebp
+	movl	40(%esp),%esi
+	rorl	$2,%ecx
+	addl	%edx,%ebp
+	addl	12(%esp),%edx
+	addl	%ecx,%ebp
+	movl	92(%esp),%ecx
+	movl	%esi,%ebx
+	rorl	$11,%esi
+	movl	%ecx,%edi
+	rorl	$2,%ecx
+	xorl	%ebx,%esi
+	shrl	$3,%ebx
+	rorl	$7,%esi
+	xorl	%edi,%ecx
+	xorl	%esi,%ebx
+	rorl	$17,%ecx
+	addl	36(%esp),%ebx
+	shrl	$10,%edi
+	addl	72(%esp),%ebx
+	movl	%edx,%esi
+	xorl	%ecx,%edi
+	movl	16(%esp),%ecx
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	20(%esp),%edi
+	xorl	%esi,%edx
+	movl	%ebx,36(%esp)
+	xorl	%edi,%ecx
+	rorl	$5,%edx
+	andl	%esi,%ecx
+	movl	%esi,12(%esp)
+	xorl	%esi,%edx
+	addl	24(%esp),%ebx
+	xorl	%ecx,%edi
+	rorl	$6,%edx
+	movl	%ebp,%esi
+	addl	%edi,%ebx
+	rorl	$9,%esi
+	movl	%ebp,%ecx
+	movl	(%esp),%edi
+	xorl	%ebp,%esi
+	movl	%ebp,28(%esp)
+	xorl	%edi,%ebp
+	rorl	$11,%esi
+	andl	%ebp,%eax
+	leal	773529912(%ebx,%edx,1),%edx
+	xorl	%ecx,%esi
+	xorl	%edi,%eax
+	movl	44(%esp),%ecx
+	rorl	$2,%esi
+	addl	%edx,%eax
+	addl	8(%esp),%edx
+	addl	%esi,%eax
+	movl	32(%esp),%esi
+	movl	%ecx,%ebx
+	rorl	$11,%ecx
+	movl	%esi,%edi
+	rorl	$2,%esi
+	xorl	%ebx,%ecx
+	shrl	$3,%ebx
+	rorl	$7,%ecx
+	xorl	%edi,%esi
+	xorl	%ecx,%ebx
+	rorl	$17,%esi
+	addl	40(%esp),%ebx
+	shrl	$10,%edi
+	addl	76(%esp),%ebx
+	movl	%edx,%ecx
+	xorl	%esi,%edi
+	movl	12(%esp),%esi
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	16(%esp),%edi
+	xorl	%ecx,%edx
+	movl	%ebx,40(%esp)
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,8(%esp)
+	xorl	%ecx,%edx
+	addl	20(%esp),%ebx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%ebx
+	rorl	$9,%ecx
+	movl	%eax,%esi
+	movl	28(%esp),%edi
+	xorl	%eax,%ecx
+	movl	%eax,24(%esp)
+	xorl	%edi,%eax
+	rorl	$11,%ecx
+	andl	%eax,%ebp
+	leal	1294757372(%ebx,%edx,1),%edx
+	xorl	%esi,%ecx
+	xorl	%edi,%ebp
+	movl	48(%esp),%esi
+	rorl	$2,%ecx
+	addl	%edx,%ebp
+	addl	4(%esp),%edx
+	addl	%ecx,%ebp
+	movl	36(%esp),%ecx
+	movl	%esi,%ebx
+	rorl	$11,%esi
+	movl	%ecx,%edi
+	rorl	$2,%ecx
+	xorl	%ebx,%esi
+	shrl	$3,%ebx
+	rorl	$7,%esi
+	xorl	%edi,%ecx
+	xorl	%esi,%ebx
+	rorl	$17,%ecx
+	addl	44(%esp),%ebx
+	shrl	$10,%edi
+	addl	80(%esp),%ebx
+	movl	%edx,%esi
+	xorl	%ecx,%edi
+	movl	8(%esp),%ecx
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	12(%esp),%edi
+	xorl	%esi,%edx
+	movl	%ebx,44(%esp)
+	xorl	%edi,%ecx
+	rorl	$5,%edx
+	andl	%esi,%ecx
+	movl	%esi,4(%esp)
+	xorl	%esi,%edx
+	addl	16(%esp),%ebx
+	xorl	%ecx,%edi
+	rorl	$6,%edx
+	movl	%ebp,%esi
+	addl	%edi,%ebx
+	rorl	$9,%esi
+	movl	%ebp,%ecx
+	movl	24(%esp),%edi
+	xorl	%ebp,%esi
+	movl	%ebp,20(%esp)
+	xorl	%edi,%ebp
+	rorl	$11,%esi
+	andl	%ebp,%eax
+	leal	1396182291(%ebx,%edx,1),%edx
+	xorl	%ecx,%esi
+	xorl	%edi,%eax
+	movl	52(%esp),%ecx
+	rorl	$2,%esi
+	addl	%edx,%eax
+	addl	(%esp),%edx
+	addl	%esi,%eax
+	movl	40(%esp),%esi
+	movl	%ecx,%ebx
+	rorl	$11,%ecx
+	movl	%esi,%edi
+	rorl	$2,%esi
+	xorl	%ebx,%ecx
+	shrl	$3,%ebx
+	rorl	$7,%ecx
+	xorl	%edi,%esi
+	xorl	%ecx,%ebx
+	rorl	$17,%esi
+	addl	48(%esp),%ebx
+	shrl	$10,%edi
+	addl	84(%esp),%ebx
+	movl	%edx,%ecx
+	xorl	%esi,%edi
+	movl	4(%esp),%esi
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	8(%esp),%edi
+	xorl	%ecx,%edx
+	movl	%ebx,48(%esp)
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,(%esp)
+	xorl	%ecx,%edx
+	addl	12(%esp),%ebx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%ebx
+	rorl	$9,%ecx
+	movl	%eax,%esi
+	movl	20(%esp),%edi
+	xorl	%eax,%ecx
+	movl	%eax,16(%esp)
+	xorl	%edi,%eax
+	rorl	$11,%ecx
+	andl	%eax,%ebp
+	leal	1695183700(%ebx,%edx,1),%edx
+	xorl	%esi,%ecx
+	xorl	%edi,%ebp
+	movl	56(%esp),%esi
+	rorl	$2,%ecx
+	addl	%edx,%ebp
+	addl	28(%esp),%edx
+	addl	%ecx,%ebp
+	movl	44(%esp),%ecx
+	movl	%esi,%ebx
+	rorl	$11,%esi
+	movl	%ecx,%edi
+	rorl	$2,%ecx
+	xorl	%ebx,%esi
+	shrl	$3,%ebx
+	rorl	$7,%esi
+	xorl	%edi,%ecx
+	xorl	%esi,%ebx
+	rorl	$17,%ecx
+	addl	52(%esp),%ebx
+	shrl	$10,%edi
+	addl	88(%esp),%ebx
+	movl	%edx,%esi
+	xorl	%ecx,%edi
+	movl	(%esp),%ecx
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	4(%esp),%edi
+	xorl	%esi,%edx
+	movl	%ebx,52(%esp)
+	xorl	%edi,%ecx
+	rorl	$5,%edx
+	andl	%esi,%ecx
+	movl	%esi,28(%esp)
+	xorl	%esi,%edx
+	addl	8(%esp),%ebx
+	xorl	%ecx,%edi
+	rorl	$6,%edx
+	movl	%ebp,%esi
+	addl	%edi,%ebx
+	rorl	$9,%esi
+	movl	%ebp,%ecx
+	movl	16(%esp),%edi
+	xorl	%ebp,%esi
+	movl	%ebp,12(%esp)
+	xorl	%edi,%ebp
+	rorl	$11,%esi
+	andl	%ebp,%eax
+	leal	1986661051(%ebx,%edx,1),%edx
+	xorl	%ecx,%esi
+	xorl	%edi,%eax
+	movl	60(%esp),%ecx
+	rorl	$2,%esi
+	addl	%edx,%eax
+	addl	24(%esp),%edx
+	addl	%esi,%eax
+	movl	48(%esp),%esi
+	movl	%ecx,%ebx
+	rorl	$11,%ecx
+	movl	%esi,%edi
+	rorl	$2,%esi
+	xorl	%ebx,%ecx
+	shrl	$3,%ebx
+	rorl	$7,%ecx
+	xorl	%edi,%esi
+	xorl	%ecx,%ebx
+	rorl	$17,%esi
+	addl	56(%esp),%ebx
+	shrl	$10,%edi
+	addl	92(%esp),%ebx
+	movl	%edx,%ecx
+	xorl	%esi,%edi
+	movl	28(%esp),%esi
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	(%esp),%edi
+	xorl	%ecx,%edx
+	movl	%ebx,56(%esp)
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,24(%esp)
+	xorl	%ecx,%edx
+	addl	4(%esp),%ebx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%ebx
+	rorl	$9,%ecx
+	movl	%eax,%esi
+	movl	12(%esp),%edi
+	xorl	%eax,%ecx
+	movl	%eax,8(%esp)
+	xorl	%edi,%eax
+	rorl	$11,%ecx
+	andl	%eax,%ebp
+	leal	2177026350(%ebx,%edx,1),%edx
+	xorl	%esi,%ecx
+	xorl	%edi,%ebp
+	movl	64(%esp),%esi
+	rorl	$2,%ecx
+	addl	%edx,%ebp
+	addl	20(%esp),%edx
+	addl	%ecx,%ebp
+	movl	52(%esp),%ecx
+	movl	%esi,%ebx
+	rorl	$11,%esi
+	movl	%ecx,%edi
+	rorl	$2,%ecx
+	xorl	%ebx,%esi
+	shrl	$3,%ebx
+	rorl	$7,%esi
+	xorl	%edi,%ecx
+	xorl	%esi,%ebx
+	rorl	$17,%ecx
+	addl	60(%esp),%ebx
+	shrl	$10,%edi
+	addl	32(%esp),%ebx
+	movl	%edx,%esi
+	xorl	%ecx,%edi
+	movl	24(%esp),%ecx
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	28(%esp),%edi
+	xorl	%esi,%edx
+	movl	%ebx,60(%esp)
+	xorl	%edi,%ecx
+	rorl	$5,%edx
+	andl	%esi,%ecx
+	movl	%esi,20(%esp)
+	xorl	%esi,%edx
+	addl	(%esp),%ebx
+	xorl	%ecx,%edi
+	rorl	$6,%edx
+	movl	%ebp,%esi
+	addl	%edi,%ebx
+	rorl	$9,%esi
+	movl	%ebp,%ecx
+	movl	8(%esp),%edi
+	xorl	%ebp,%esi
+	movl	%ebp,4(%esp)
+	xorl	%edi,%ebp
+	rorl	$11,%esi
+	andl	%ebp,%eax
+	leal	2456956037(%ebx,%edx,1),%edx
+	xorl	%ecx,%esi
+	xorl	%edi,%eax
+	movl	68(%esp),%ecx
+	rorl	$2,%esi
+	addl	%edx,%eax
+	addl	16(%esp),%edx
+	addl	%esi,%eax
+	movl	56(%esp),%esi
+	movl	%ecx,%ebx
+	rorl	$11,%ecx
+	movl	%esi,%edi
+	rorl	$2,%esi
+	xorl	%ebx,%ecx
+	shrl	$3,%ebx
+	rorl	$7,%ecx
+	xorl	%edi,%esi
+	xorl	%ecx,%ebx
+	rorl	$17,%esi
+	addl	64(%esp),%ebx
+	shrl	$10,%edi
+	addl	36(%esp),%ebx
+	movl	%edx,%ecx
+	xorl	%esi,%edi
+	movl	20(%esp),%esi
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	24(%esp),%edi
+	xorl	%ecx,%edx
+	movl	%ebx,64(%esp)
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,16(%esp)
+	xorl	%ecx,%edx
+	addl	28(%esp),%ebx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%ebx
+	rorl	$9,%ecx
+	movl	%eax,%esi
+	movl	4(%esp),%edi
+	xorl	%eax,%ecx
+	movl	%eax,(%esp)
+	xorl	%edi,%eax
+	rorl	$11,%ecx
+	andl	%eax,%ebp
+	leal	2730485921(%ebx,%edx,1),%edx
+	xorl	%esi,%ecx
+	xorl	%edi,%ebp
+	movl	72(%esp),%esi
+	rorl	$2,%ecx
+	addl	%edx,%ebp
+	addl	12(%esp),%edx
+	addl	%ecx,%ebp
+	movl	60(%esp),%ecx
+	movl	%esi,%ebx
+	rorl	$11,%esi
+	movl	%ecx,%edi
+	rorl	$2,%ecx
+	xorl	%ebx,%esi
+	shrl	$3,%ebx
+	rorl	$7,%esi
+	xorl	%edi,%ecx
+	xorl	%esi,%ebx
+	rorl	$17,%ecx
+	addl	68(%esp),%ebx
+	shrl	$10,%edi
+	addl	40(%esp),%ebx
+	movl	%edx,%esi
+	xorl	%ecx,%edi
+	movl	16(%esp),%ecx
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	20(%esp),%edi
+	xorl	%esi,%edx
+	movl	%ebx,68(%esp)
+	xorl	%edi,%ecx
+	rorl	$5,%edx
+	andl	%esi,%ecx
+	movl	%esi,12(%esp)
+	xorl	%esi,%edx
+	addl	24(%esp),%ebx
+	xorl	%ecx,%edi
+	rorl	$6,%edx
+	movl	%ebp,%esi
+	addl	%edi,%ebx
+	rorl	$9,%esi
+	movl	%ebp,%ecx
+	movl	(%esp),%edi
+	xorl	%ebp,%esi
+	movl	%ebp,28(%esp)
+	xorl	%edi,%ebp
+	rorl	$11,%esi
+	andl	%ebp,%eax
+	leal	2820302411(%ebx,%edx,1),%edx
+	xorl	%ecx,%esi
+	xorl	%edi,%eax
+	movl	76(%esp),%ecx
+	rorl	$2,%esi
+	addl	%edx,%eax
+	addl	8(%esp),%edx
+	addl	%esi,%eax
+	movl	64(%esp),%esi
+	movl	%ecx,%ebx
+	rorl	$11,%ecx
+	movl	%esi,%edi
+	rorl	$2,%esi
+	xorl	%ebx,%ecx
+	shrl	$3,%ebx
+	rorl	$7,%ecx
+	xorl	%edi,%esi
+	xorl	%ecx,%ebx
+	rorl	$17,%esi
+	addl	72(%esp),%ebx
+	shrl	$10,%edi
+	addl	44(%esp),%ebx
+	movl	%edx,%ecx
+	xorl	%esi,%edi
+	movl	12(%esp),%esi
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	16(%esp),%edi
+	xorl	%ecx,%edx
+	movl	%ebx,72(%esp)
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,8(%esp)
+	xorl	%ecx,%edx
+	addl	20(%esp),%ebx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%ebx
+	rorl	$9,%ecx
+	movl	%eax,%esi
+	movl	28(%esp),%edi
+	xorl	%eax,%ecx
+	movl	%eax,24(%esp)
+	xorl	%edi,%eax
+	rorl	$11,%ecx
+	andl	%eax,%ebp
+	leal	3259730800(%ebx,%edx,1),%edx
+	xorl	%esi,%ecx
+	xorl	%edi,%ebp
+	movl	80(%esp),%esi
+	rorl	$2,%ecx
+	addl	%edx,%ebp
+	addl	4(%esp),%edx
+	addl	%ecx,%ebp
+	movl	68(%esp),%ecx
+	movl	%esi,%ebx
+	rorl	$11,%esi
+	movl	%ecx,%edi
+	rorl	$2,%ecx
+	xorl	%ebx,%esi
+	shrl	$3,%ebx
+	rorl	$7,%esi
+	xorl	%edi,%ecx
+	xorl	%esi,%ebx
+	rorl	$17,%ecx
+	addl	76(%esp),%ebx
+	shrl	$10,%edi
+	addl	48(%esp),%ebx
+	movl	%edx,%esi
+	xorl	%ecx,%edi
+	movl	8(%esp),%ecx
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	12(%esp),%edi
+	xorl	%esi,%edx
+	movl	%ebx,76(%esp)
+	xorl	%edi,%ecx
+	rorl	$5,%edx
+	andl	%esi,%ecx
+	movl	%esi,4(%esp)
+	xorl	%esi,%edx
+	addl	16(%esp),%ebx
+	xorl	%ecx,%edi
+	rorl	$6,%edx
+	movl	%ebp,%esi
+	addl	%edi,%ebx
+	rorl	$9,%esi
+	movl	%ebp,%ecx
+	movl	24(%esp),%edi
+	xorl	%ebp,%esi
+	movl	%ebp,20(%esp)
+	xorl	%edi,%ebp
+	rorl	$11,%esi
+	andl	%ebp,%eax
+	leal	3345764771(%ebx,%edx,1),%edx
+	xorl	%ecx,%esi
+	xorl	%edi,%eax
+	movl	84(%esp),%ecx
+	rorl	$2,%esi
+	addl	%edx,%eax
+	addl	(%esp),%edx
+	addl	%esi,%eax
+	movl	72(%esp),%esi
+	movl	%ecx,%ebx
+	rorl	$11,%ecx
+	movl	%esi,%edi
+	rorl	$2,%esi
+	xorl	%ebx,%ecx
+	shrl	$3,%ebx
+	rorl	$7,%ecx
+	xorl	%edi,%esi
+	xorl	%ecx,%ebx
+	rorl	$17,%esi
+	addl	80(%esp),%ebx
+	shrl	$10,%edi
+	addl	52(%esp),%ebx
+	movl	%edx,%ecx
+	xorl	%esi,%edi
+	movl	4(%esp),%esi
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	8(%esp),%edi
+	xorl	%ecx,%edx
+	movl	%ebx,80(%esp)
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,(%esp)
+	xorl	%ecx,%edx
+	addl	12(%esp),%ebx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%ebx
+	rorl	$9,%ecx
+	movl	%eax,%esi
+	movl	20(%esp),%edi
+	xorl	%eax,%ecx
+	movl	%eax,16(%esp)
+	xorl	%edi,%eax
+	rorl	$11,%ecx
+	andl	%eax,%ebp
+	leal	3516065817(%ebx,%edx,1),%edx
+	xorl	%esi,%ecx
+	xorl	%edi,%ebp
+	movl	88(%esp),%esi
+	rorl	$2,%ecx
+	addl	%edx,%ebp
+	addl	28(%esp),%edx
+	addl	%ecx,%ebp
+	movl	76(%esp),%ecx
+	movl	%esi,%ebx
+	rorl	$11,%esi
+	movl	%ecx,%edi
+	rorl	$2,%ecx
+	xorl	%ebx,%esi
+	shrl	$3,%ebx
+	rorl	$7,%esi
+	xorl	%edi,%ecx
+	xorl	%esi,%ebx
+	rorl	$17,%ecx
+	addl	84(%esp),%ebx
+	shrl	$10,%edi
+	addl	56(%esp),%ebx
+	movl	%edx,%esi
+	xorl	%ecx,%edi
+	movl	(%esp),%ecx
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	4(%esp),%edi
+	xorl	%esi,%edx
+	movl	%ebx,84(%esp)
+	xorl	%edi,%ecx
+	rorl	$5,%edx
+	andl	%esi,%ecx
+	movl	%esi,28(%esp)
+	xorl	%esi,%edx
+	addl	8(%esp),%ebx
+	xorl	%ecx,%edi
+	rorl	$6,%edx
+	movl	%ebp,%esi
+	addl	%edi,%ebx
+	rorl	$9,%esi
+	movl	%ebp,%ecx
+	movl	16(%esp),%edi
+	xorl	%ebp,%esi
+	movl	%ebp,12(%esp)
+	xorl	%edi,%ebp
+	rorl	$11,%esi
+	andl	%ebp,%eax
+	leal	3600352804(%ebx,%edx,1),%edx
+	xorl	%ecx,%esi
+	xorl	%edi,%eax
+	movl	92(%esp),%ecx
+	rorl	$2,%esi
+	addl	%edx,%eax
+	addl	24(%esp),%edx
+	addl	%esi,%eax
+	movl	80(%esp),%esi
+	movl	%ecx,%ebx
+	rorl	$11,%ecx
+	movl	%esi,%edi
+	rorl	$2,%esi
+	xorl	%ebx,%ecx
+	shrl	$3,%ebx
+	rorl	$7,%ecx
+	xorl	%edi,%esi
+	xorl	%ecx,%ebx
+	rorl	$17,%esi
+	addl	88(%esp),%ebx
+	shrl	$10,%edi
+	addl	60(%esp),%ebx
+	movl	%edx,%ecx
+	xorl	%esi,%edi
+	movl	28(%esp),%esi
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	(%esp),%edi
+	xorl	%ecx,%edx
+	movl	%ebx,88(%esp)
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,24(%esp)
+	xorl	%ecx,%edx
+	addl	4(%esp),%ebx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%ebx
+	rorl	$9,%ecx
+	movl	%eax,%esi
+	movl	12(%esp),%edi
+	xorl	%eax,%ecx
+	movl	%eax,8(%esp)
+	xorl	%edi,%eax
+	rorl	$11,%ecx
+	andl	%eax,%ebp
+	leal	4094571909(%ebx,%edx,1),%edx
+	xorl	%esi,%ecx
+	xorl	%edi,%ebp
+	movl	32(%esp),%esi
+	rorl	$2,%ecx
+	addl	%edx,%ebp
+	addl	20(%esp),%edx
+	addl	%ecx,%ebp
+	movl	84(%esp),%ecx
+	movl	%esi,%ebx
+	rorl	$11,%esi
+	movl	%ecx,%edi
+	rorl	$2,%ecx
+	xorl	%ebx,%esi
+	shrl	$3,%ebx
+	rorl	$7,%esi
+	xorl	%edi,%ecx
+	xorl	%esi,%ebx
+	rorl	$17,%ecx
+	addl	92(%esp),%ebx
+	shrl	$10,%edi
+	addl	64(%esp),%ebx
+	movl	%edx,%esi
+	xorl	%ecx,%edi
+	movl	24(%esp),%ecx
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	28(%esp),%edi
+	xorl	%esi,%edx
+	movl	%ebx,92(%esp)
+	xorl	%edi,%ecx
+	rorl	$5,%edx
+	andl	%esi,%ecx
+	movl	%esi,20(%esp)
+	xorl	%esi,%edx
+	addl	(%esp),%ebx
+	xorl	%ecx,%edi
+	rorl	$6,%edx
+	movl	%ebp,%esi
+	addl	%edi,%ebx
+	rorl	$9,%esi
+	movl	%ebp,%ecx
+	movl	8(%esp),%edi
+	xorl	%ebp,%esi
+	movl	%ebp,4(%esp)
+	xorl	%edi,%ebp
+	rorl	$11,%esi
+	andl	%ebp,%eax
+	leal	275423344(%ebx,%edx,1),%edx
+	xorl	%ecx,%esi
+	xorl	%edi,%eax
+	movl	36(%esp),%ecx
+	rorl	$2,%esi
+	addl	%edx,%eax
+	addl	16(%esp),%edx
+	addl	%esi,%eax
+	movl	88(%esp),%esi
+	movl	%ecx,%ebx
+	rorl	$11,%ecx
+	movl	%esi,%edi
+	rorl	$2,%esi
+	xorl	%ebx,%ecx
+	shrl	$3,%ebx
+	rorl	$7,%ecx
+	xorl	%edi,%esi
+	xorl	%ecx,%ebx
+	rorl	$17,%esi
+	addl	32(%esp),%ebx
+	shrl	$10,%edi
+	addl	68(%esp),%ebx
+	movl	%edx,%ecx
+	xorl	%esi,%edi
+	movl	20(%esp),%esi
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	24(%esp),%edi
+	xorl	%ecx,%edx
+	movl	%ebx,32(%esp)
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,16(%esp)
+	xorl	%ecx,%edx
+	addl	28(%esp),%ebx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%ebx
+	rorl	$9,%ecx
+	movl	%eax,%esi
+	movl	4(%esp),%edi
+	xorl	%eax,%ecx
+	movl	%eax,(%esp)
+	xorl	%edi,%eax
+	rorl	$11,%ecx
+	andl	%eax,%ebp
+	leal	430227734(%ebx,%edx,1),%edx
+	xorl	%esi,%ecx
+	xorl	%edi,%ebp
+	movl	40(%esp),%esi
+	rorl	$2,%ecx
+	addl	%edx,%ebp
+	addl	12(%esp),%edx
+	addl	%ecx,%ebp
+	movl	92(%esp),%ecx
+	movl	%esi,%ebx
+	rorl	$11,%esi
+	movl	%ecx,%edi
+	rorl	$2,%ecx
+	xorl	%ebx,%esi
+	shrl	$3,%ebx
+	rorl	$7,%esi
+	xorl	%edi,%ecx
+	xorl	%esi,%ebx
+	rorl	$17,%ecx
+	addl	36(%esp),%ebx
+	shrl	$10,%edi
+	addl	72(%esp),%ebx
+	movl	%edx,%esi
+	xorl	%ecx,%edi
+	movl	16(%esp),%ecx
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	20(%esp),%edi
+	xorl	%esi,%edx
+	movl	%ebx,36(%esp)
+	xorl	%edi,%ecx
+	rorl	$5,%edx
+	andl	%esi,%ecx
+	movl	%esi,12(%esp)
+	xorl	%esi,%edx
+	addl	24(%esp),%ebx
+	xorl	%ecx,%edi
+	rorl	$6,%edx
+	movl	%ebp,%esi
+	addl	%edi,%ebx
+	rorl	$9,%esi
+	movl	%ebp,%ecx
+	movl	(%esp),%edi
+	xorl	%ebp,%esi
+	movl	%ebp,28(%esp)
+	xorl	%edi,%ebp
+	rorl	$11,%esi
+	andl	%ebp,%eax
+	leal	506948616(%ebx,%edx,1),%edx
+	xorl	%ecx,%esi
+	xorl	%edi,%eax
+	movl	44(%esp),%ecx
+	rorl	$2,%esi
+	addl	%edx,%eax
+	addl	8(%esp),%edx
+	addl	%esi,%eax
+	movl	32(%esp),%esi
+	movl	%ecx,%ebx
+	rorl	$11,%ecx
+	movl	%esi,%edi
+	rorl	$2,%esi
+	xorl	%ebx,%ecx
+	shrl	$3,%ebx
+	rorl	$7,%ecx
+	xorl	%edi,%esi
+	xorl	%ecx,%ebx
+	rorl	$17,%esi
+	addl	40(%esp),%ebx
+	shrl	$10,%edi
+	addl	76(%esp),%ebx
+	movl	%edx,%ecx
+	xorl	%esi,%edi
+	movl	12(%esp),%esi
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	16(%esp),%edi
+	xorl	%ecx,%edx
+	movl	%ebx,40(%esp)
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,8(%esp)
+	xorl	%ecx,%edx
+	addl	20(%esp),%ebx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%ebx
+	rorl	$9,%ecx
+	movl	%eax,%esi
+	movl	28(%esp),%edi
+	xorl	%eax,%ecx
+	movl	%eax,24(%esp)
+	xorl	%edi,%eax
+	rorl	$11,%ecx
+	andl	%eax,%ebp
+	leal	659060556(%ebx,%edx,1),%edx
+	xorl	%esi,%ecx
+	xorl	%edi,%ebp
+	movl	48(%esp),%esi
+	rorl	$2,%ecx
+	addl	%edx,%ebp
+	addl	4(%esp),%edx
+	addl	%ecx,%ebp
+	movl	36(%esp),%ecx
+	movl	%esi,%ebx
+	rorl	$11,%esi
+	movl	%ecx,%edi
+	rorl	$2,%ecx
+	xorl	%ebx,%esi
+	shrl	$3,%ebx
+	rorl	$7,%esi
+	xorl	%edi,%ecx
+	xorl	%esi,%ebx
+	rorl	$17,%ecx
+	addl	44(%esp),%ebx
+	shrl	$10,%edi
+	addl	80(%esp),%ebx
+	movl	%edx,%esi
+	xorl	%ecx,%edi
+	movl	8(%esp),%ecx
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	12(%esp),%edi
+	xorl	%esi,%edx
+	movl	%ebx,44(%esp)
+	xorl	%edi,%ecx
+	rorl	$5,%edx
+	andl	%esi,%ecx
+	movl	%esi,4(%esp)
+	xorl	%esi,%edx
+	addl	16(%esp),%ebx
+	xorl	%ecx,%edi
+	rorl	$6,%edx
+	movl	%ebp,%esi
+	addl	%edi,%ebx
+	rorl	$9,%esi
+	movl	%ebp,%ecx
+	movl	24(%esp),%edi
+	xorl	%ebp,%esi
+	movl	%ebp,20(%esp)
+	xorl	%edi,%ebp
+	rorl	$11,%esi
+	andl	%ebp,%eax
+	leal	883997877(%ebx,%edx,1),%edx
+	xorl	%ecx,%esi
+	xorl	%edi,%eax
+	movl	52(%esp),%ecx
+	rorl	$2,%esi
+	addl	%edx,%eax
+	addl	(%esp),%edx
+	addl	%esi,%eax
+	movl	40(%esp),%esi
+	movl	%ecx,%ebx
+	rorl	$11,%ecx
+	movl	%esi,%edi
+	rorl	$2,%esi
+	xorl	%ebx,%ecx
+	shrl	$3,%ebx
+	rorl	$7,%ecx
+	xorl	%edi,%esi
+	xorl	%ecx,%ebx
+	rorl	$17,%esi
+	addl	48(%esp),%ebx
+	shrl	$10,%edi
+	addl	84(%esp),%ebx
+	movl	%edx,%ecx
+	xorl	%esi,%edi
+	movl	4(%esp),%esi
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	8(%esp),%edi
+	xorl	%ecx,%edx
+	movl	%ebx,48(%esp)
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,(%esp)
+	xorl	%ecx,%edx
+	addl	12(%esp),%ebx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%ebx
+	rorl	$9,%ecx
+	movl	%eax,%esi
+	movl	20(%esp),%edi
+	xorl	%eax,%ecx
+	movl	%eax,16(%esp)
+	xorl	%edi,%eax
+	rorl	$11,%ecx
+	andl	%eax,%ebp
+	leal	958139571(%ebx,%edx,1),%edx
+	xorl	%esi,%ecx
+	xorl	%edi,%ebp
+	movl	56(%esp),%esi
+	rorl	$2,%ecx
+	addl	%edx,%ebp
+	addl	28(%esp),%edx
+	addl	%ecx,%ebp
+	movl	44(%esp),%ecx
+	movl	%esi,%ebx
+	rorl	$11,%esi
+	movl	%ecx,%edi
+	rorl	$2,%ecx
+	xorl	%ebx,%esi
+	shrl	$3,%ebx
+	rorl	$7,%esi
+	xorl	%edi,%ecx
+	xorl	%esi,%ebx
+	rorl	$17,%ecx
+	addl	52(%esp),%ebx
+	shrl	$10,%edi
+	addl	88(%esp),%ebx
+	movl	%edx,%esi
+	xorl	%ecx,%edi
+	movl	(%esp),%ecx
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	4(%esp),%edi
+	xorl	%esi,%edx
+	movl	%ebx,52(%esp)
+	xorl	%edi,%ecx
+	rorl	$5,%edx
+	andl	%esi,%ecx
+	movl	%esi,28(%esp)
+	xorl	%esi,%edx
+	addl	8(%esp),%ebx
+	xorl	%ecx,%edi
+	rorl	$6,%edx
+	movl	%ebp,%esi
+	addl	%edi,%ebx
+	rorl	$9,%esi
+	movl	%ebp,%ecx
+	movl	16(%esp),%edi
+	xorl	%ebp,%esi
+	movl	%ebp,12(%esp)
+	xorl	%edi,%ebp
+	rorl	$11,%esi
+	andl	%ebp,%eax
+	leal	1322822218(%ebx,%edx,1),%edx
+	xorl	%ecx,%esi
+	xorl	%edi,%eax
+	movl	60(%esp),%ecx
+	rorl	$2,%esi
+	addl	%edx,%eax
+	addl	24(%esp),%edx
+	addl	%esi,%eax
+	movl	48(%esp),%esi
+	movl	%ecx,%ebx
+	rorl	$11,%ecx
+	movl	%esi,%edi
+	rorl	$2,%esi
+	xorl	%ebx,%ecx
+	shrl	$3,%ebx
+	rorl	$7,%ecx
+	xorl	%edi,%esi
+	xorl	%ecx,%ebx
+	rorl	$17,%esi
+	addl	56(%esp),%ebx
+	shrl	$10,%edi
+	addl	92(%esp),%ebx
+	movl	%edx,%ecx
+	xorl	%esi,%edi
+	movl	28(%esp),%esi
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	(%esp),%edi
+	xorl	%ecx,%edx
+	movl	%ebx,56(%esp)
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,24(%esp)
+	xorl	%ecx,%edx
+	addl	4(%esp),%ebx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%ebx
+	rorl	$9,%ecx
+	movl	%eax,%esi
+	movl	12(%esp),%edi
+	xorl	%eax,%ecx
+	movl	%eax,8(%esp)
+	xorl	%edi,%eax
+	rorl	$11,%ecx
+	andl	%eax,%ebp
+	leal	1537002063(%ebx,%edx,1),%edx
+	xorl	%esi,%ecx
+	xorl	%edi,%ebp
+	movl	64(%esp),%esi
+	rorl	$2,%ecx
+	addl	%edx,%ebp
+	addl	20(%esp),%edx
+	addl	%ecx,%ebp
+	movl	52(%esp),%ecx
+	movl	%esi,%ebx
+	rorl	$11,%esi
+	movl	%ecx,%edi
+	rorl	$2,%ecx
+	xorl	%ebx,%esi
+	shrl	$3,%ebx
+	rorl	$7,%esi
+	xorl	%edi,%ecx
+	xorl	%esi,%ebx
+	rorl	$17,%ecx
+	addl	60(%esp),%ebx
+	shrl	$10,%edi
+	addl	32(%esp),%ebx
+	movl	%edx,%esi
+	xorl	%ecx,%edi
+	movl	24(%esp),%ecx
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	28(%esp),%edi
+	xorl	%esi,%edx
+	movl	%ebx,60(%esp)
+	xorl	%edi,%ecx
+	rorl	$5,%edx
+	andl	%esi,%ecx
+	movl	%esi,20(%esp)
+	xorl	%esi,%edx
+	addl	(%esp),%ebx
+	xorl	%ecx,%edi
+	rorl	$6,%edx
+	movl	%ebp,%esi
+	addl	%edi,%ebx
+	rorl	$9,%esi
+	movl	%ebp,%ecx
+	movl	8(%esp),%edi
+	xorl	%ebp,%esi
+	movl	%ebp,4(%esp)
+	xorl	%edi,%ebp
+	rorl	$11,%esi
+	andl	%ebp,%eax
+	leal	1747873779(%ebx,%edx,1),%edx
+	xorl	%ecx,%esi
+	xorl	%edi,%eax
+	movl	68(%esp),%ecx
+	rorl	$2,%esi
+	addl	%edx,%eax
+	addl	16(%esp),%edx
+	addl	%esi,%eax
+	movl	56(%esp),%esi
+	movl	%ecx,%ebx
+	rorl	$11,%ecx
+	movl	%esi,%edi
+	rorl	$2,%esi
+	xorl	%ebx,%ecx
+	shrl	$3,%ebx
+	rorl	$7,%ecx
+	xorl	%edi,%esi
+	xorl	%ecx,%ebx
+	rorl	$17,%esi
+	addl	64(%esp),%ebx
+	shrl	$10,%edi
+	addl	36(%esp),%ebx
+	movl	%edx,%ecx
+	xorl	%esi,%edi
+	movl	20(%esp),%esi
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	24(%esp),%edi
+	xorl	%ecx,%edx
+	movl	%ebx,64(%esp)
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,16(%esp)
+	xorl	%ecx,%edx
+	addl	28(%esp),%ebx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%ebx
+	rorl	$9,%ecx
+	movl	%eax,%esi
+	movl	4(%esp),%edi
+	xorl	%eax,%ecx
+	movl	%eax,(%esp)
+	xorl	%edi,%eax
+	rorl	$11,%ecx
+	andl	%eax,%ebp
+	leal	1955562222(%ebx,%edx,1),%edx
+	xorl	%esi,%ecx
+	xorl	%edi,%ebp
+	movl	72(%esp),%esi
+	rorl	$2,%ecx
+	addl	%edx,%ebp
+	addl	12(%esp),%edx
+	addl	%ecx,%ebp
+	movl	60(%esp),%ecx
+	movl	%esi,%ebx
+	rorl	$11,%esi
+	movl	%ecx,%edi
+	rorl	$2,%ecx
+	xorl	%ebx,%esi
+	shrl	$3,%ebx
+	rorl	$7,%esi
+	xorl	%edi,%ecx
+	xorl	%esi,%ebx
+	rorl	$17,%ecx
+	addl	68(%esp),%ebx
+	shrl	$10,%edi
+	addl	40(%esp),%ebx
+	movl	%edx,%esi
+	xorl	%ecx,%edi
+	movl	16(%esp),%ecx
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	20(%esp),%edi
+	xorl	%esi,%edx
+	movl	%ebx,68(%esp)
+	xorl	%edi,%ecx
+	rorl	$5,%edx
+	andl	%esi,%ecx
+	movl	%esi,12(%esp)
+	xorl	%esi,%edx
+	addl	24(%esp),%ebx
+	xorl	%ecx,%edi
+	rorl	$6,%edx
+	movl	%ebp,%esi
+	addl	%edi,%ebx
+	rorl	$9,%esi
+	movl	%ebp,%ecx
+	movl	(%esp),%edi
+	xorl	%ebp,%esi
+	movl	%ebp,28(%esp)
+	xorl	%edi,%ebp
+	rorl	$11,%esi
+	andl	%ebp,%eax
+	leal	2024104815(%ebx,%edx,1),%edx
+	xorl	%ecx,%esi
+	xorl	%edi,%eax
+	movl	76(%esp),%ecx
+	rorl	$2,%esi
+	addl	%edx,%eax
+	addl	8(%esp),%edx
+	addl	%esi,%eax
+	movl	64(%esp),%esi
+	movl	%ecx,%ebx
+	rorl	$11,%ecx
+	movl	%esi,%edi
+	rorl	$2,%esi
+	xorl	%ebx,%ecx
+	shrl	$3,%ebx
+	rorl	$7,%ecx
+	xorl	%edi,%esi
+	xorl	%ecx,%ebx
+	rorl	$17,%esi
+	addl	72(%esp),%ebx
+	shrl	$10,%edi
+	addl	44(%esp),%ebx
+	movl	%edx,%ecx
+	xorl	%esi,%edi
+	movl	12(%esp),%esi
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	16(%esp),%edi
+	xorl	%ecx,%edx
+	movl	%ebx,72(%esp)
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,8(%esp)
+	xorl	%ecx,%edx
+	addl	20(%esp),%ebx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%ebx
+	rorl	$9,%ecx
+	movl	%eax,%esi
+	movl	28(%esp),%edi
+	xorl	%eax,%ecx
+	movl	%eax,24(%esp)
+	xorl	%edi,%eax
+	rorl	$11,%ecx
+	andl	%eax,%ebp
+	leal	2227730452(%ebx,%edx,1),%edx
+	xorl	%esi,%ecx
+	xorl	%edi,%ebp
+	movl	80(%esp),%esi
+	rorl	$2,%ecx
+	addl	%edx,%ebp
+	addl	4(%esp),%edx
+	addl	%ecx,%ebp
+	movl	68(%esp),%ecx
+	movl	%esi,%ebx
+	rorl	$11,%esi
+	movl	%ecx,%edi
+	rorl	$2,%ecx
+	xorl	%ebx,%esi
+	shrl	$3,%ebx
+	rorl	$7,%esi
+	xorl	%edi,%ecx
+	xorl	%esi,%ebx
+	rorl	$17,%ecx
+	addl	76(%esp),%ebx
+	shrl	$10,%edi
+	addl	48(%esp),%ebx
+	movl	%edx,%esi
+	xorl	%ecx,%edi
+	movl	8(%esp),%ecx
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	12(%esp),%edi
+	xorl	%esi,%edx
+	movl	%ebx,76(%esp)
+	xorl	%edi,%ecx
+	rorl	$5,%edx
+	andl	%esi,%ecx
+	movl	%esi,4(%esp)
+	xorl	%esi,%edx
+	addl	16(%esp),%ebx
+	xorl	%ecx,%edi
+	rorl	$6,%edx
+	movl	%ebp,%esi
+	addl	%edi,%ebx
+	rorl	$9,%esi
+	movl	%ebp,%ecx
+	movl	24(%esp),%edi
+	xorl	%ebp,%esi
+	movl	%ebp,20(%esp)
+	xorl	%edi,%ebp
+	rorl	$11,%esi
+	andl	%ebp,%eax
+	leal	2361852424(%ebx,%edx,1),%edx
+	xorl	%ecx,%esi
+	xorl	%edi,%eax
+	movl	84(%esp),%ecx
+	rorl	$2,%esi
+	addl	%edx,%eax
+	addl	(%esp),%edx
+	addl	%esi,%eax
+	movl	72(%esp),%esi
+	movl	%ecx,%ebx
+	rorl	$11,%ecx
+	movl	%esi,%edi
+	rorl	$2,%esi
+	xorl	%ebx,%ecx
+	shrl	$3,%ebx
+	rorl	$7,%ecx
+	xorl	%edi,%esi
+	xorl	%ecx,%ebx
+	rorl	$17,%esi
+	addl	80(%esp),%ebx
+	shrl	$10,%edi
+	addl	52(%esp),%ebx
+	movl	%edx,%ecx
+	xorl	%esi,%edi
+	movl	4(%esp),%esi
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	8(%esp),%edi
+	xorl	%ecx,%edx
+	movl	%ebx,80(%esp)
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,(%esp)
+	xorl	%ecx,%edx
+	addl	12(%esp),%ebx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%ebx
+	rorl	$9,%ecx
+	movl	%eax,%esi
+	movl	20(%esp),%edi
+	xorl	%eax,%ecx
+	movl	%eax,16(%esp)
+	xorl	%edi,%eax
+	rorl	$11,%ecx
+	andl	%eax,%ebp
+	leal	2428436474(%ebx,%edx,1),%edx
+	xorl	%esi,%ecx
+	xorl	%edi,%ebp
+	movl	88(%esp),%esi
+	rorl	$2,%ecx
+	addl	%edx,%ebp
+	addl	28(%esp),%edx
+	addl	%ecx,%ebp
+	movl	76(%esp),%ecx
+	movl	%esi,%ebx
+	rorl	$11,%esi
+	movl	%ecx,%edi
+	rorl	$2,%ecx
+	xorl	%ebx,%esi
+	shrl	$3,%ebx
+	rorl	$7,%esi
+	xorl	%edi,%ecx
+	xorl	%esi,%ebx
+	rorl	$17,%ecx
+	addl	84(%esp),%ebx
+	shrl	$10,%edi
+	addl	56(%esp),%ebx
+	movl	%edx,%esi
+	xorl	%ecx,%edi
+	movl	(%esp),%ecx
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	4(%esp),%edi
+	xorl	%esi,%edx
+	movl	%ebx,84(%esp)
+	xorl	%edi,%ecx
+	rorl	$5,%edx
+	andl	%esi,%ecx
+	movl	%esi,28(%esp)
+	xorl	%esi,%edx
+	addl	8(%esp),%ebx
+	xorl	%ecx,%edi
+	rorl	$6,%edx
+	movl	%ebp,%esi
+	addl	%edi,%ebx
+	rorl	$9,%esi
+	movl	%ebp,%ecx
+	movl	16(%esp),%edi
+	xorl	%ebp,%esi
+	movl	%ebp,12(%esp)
+	xorl	%edi,%ebp
+	rorl	$11,%esi
+	andl	%ebp,%eax
+	leal	2756734187(%ebx,%edx,1),%edx
+	xorl	%ecx,%esi
+	xorl	%edi,%eax
+	movl	92(%esp),%ecx
+	rorl	$2,%esi
+	addl	%edx,%eax
+	addl	24(%esp),%edx
+	addl	%esi,%eax
+	movl	80(%esp),%esi
+	movl	%ecx,%ebx
+	rorl	$11,%ecx
+	movl	%esi,%edi
+	rorl	$2,%esi
+	xorl	%ebx,%ecx
+	shrl	$3,%ebx
+	rorl	$7,%ecx
+	xorl	%edi,%esi
+	xorl	%ecx,%ebx
+	rorl	$17,%esi
+	addl	88(%esp),%ebx
+	shrl	$10,%edi
+	addl	60(%esp),%ebx
+	movl	%edx,%ecx
+	xorl	%esi,%edi
+	movl	28(%esp),%esi
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	(%esp),%edi
+	xorl	%ecx,%edx
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,24(%esp)
+	xorl	%ecx,%edx
+	addl	4(%esp),%ebx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%ebx
+	rorl	$9,%ecx
+	movl	%eax,%esi
+	movl	12(%esp),%edi
+	xorl	%eax,%ecx
+	movl	%eax,8(%esp)
+	xorl	%edi,%eax
+	rorl	$11,%ecx
+	andl	%eax,%ebp
+	leal	3204031479(%ebx,%edx,1),%edx
+	xorl	%esi,%ecx
+	xorl	%edi,%ebp
+	movl	32(%esp),%esi
+	rorl	$2,%ecx
+	addl	%edx,%ebp
+	addl	20(%esp),%edx
+	addl	%ecx,%ebp
+	movl	84(%esp),%ecx
+	movl	%esi,%ebx
+	rorl	$11,%esi
+	movl	%ecx,%edi
+	rorl	$2,%ecx
+	xorl	%ebx,%esi
+	shrl	$3,%ebx
+	rorl	$7,%esi
+	xorl	%edi,%ecx
+	xorl	%esi,%ebx
+	rorl	$17,%ecx
+	addl	92(%esp),%ebx
+	shrl	$10,%edi
+	addl	64(%esp),%ebx
+	movl	%edx,%esi
+	xorl	%ecx,%edi
+	movl	24(%esp),%ecx
+	rorl	$14,%edx
+	addl	%edi,%ebx
+	movl	28(%esp),%edi
+	xorl	%esi,%edx
+	xorl	%edi,%ecx
+	rorl	$5,%edx
+	andl	%esi,%ecx
+	movl	%esi,20(%esp)
+	xorl	%esi,%edx
+	addl	(%esp),%ebx
+	xorl	%ecx,%edi
+	rorl	$6,%edx
+	movl	%ebp,%esi
+	addl	%edi,%ebx
+	rorl	$9,%esi
+	movl	%ebp,%ecx
+	movl	8(%esp),%edi
+	xorl	%ebp,%esi
+	movl	%ebp,4(%esp)
+	xorl	%edi,%ebp
+	rorl	$11,%esi
+	andl	%ebp,%eax
+	leal	3329325298(%ebx,%edx,1),%edx
+	xorl	%ecx,%esi
+	xorl	%edi,%eax
+	rorl	$2,%esi
+	addl	%edx,%eax
+	addl	16(%esp),%edx
+	addl	%esi,%eax
+	movl	96(%esp),%esi
+	xorl	%edi,%ebp
+	movl	12(%esp),%ecx
+	addl	(%esi),%eax
+	addl	4(%esi),%ebp
+	addl	8(%esi),%edi
+	addl	12(%esi),%ecx
+	movl	%eax,(%esi)
+	movl	%ebp,4(%esi)
+	movl	%edi,8(%esi)
+	movl	%ecx,12(%esi)
+	movl	%ebp,4(%esp)
+	xorl	%edi,%ebp
+	movl	%edi,8(%esp)
+	movl	%ecx,12(%esp)
+	movl	20(%esp),%edi
+	movl	24(%esp),%ebx
+	movl	28(%esp),%ecx
+	addl	16(%esi),%edx
+	addl	20(%esi),%edi
+	addl	24(%esi),%ebx
+	addl	28(%esi),%ecx
+	movl	%edx,16(%esi)
+	movl	%edi,20(%esi)
+	movl	%ebx,24(%esi)
+	movl	%ecx,28(%esi)
+	movl	%edi,20(%esp)
+	movl	100(%esp),%edi
+	movl	%ebx,24(%esp)
+	movl	%ecx,28(%esp)
+	cmpl	104(%esp),%edi
+	jb	L009grand_loop
+	movl	108(%esp),%esp
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.align	5,0x90
+L004shaext:
+	subl	$32,%esp
+	movdqu	(%esi),%xmm1
+	leal	128(%ebp),%ebp
+	movdqu	16(%esi),%xmm2
+	movdqa	128(%ebp),%xmm7
+	pshufd	$27,%xmm1,%xmm0
+	pshufd	$177,%xmm1,%xmm1
+	pshufd	$27,%xmm2,%xmm2
+.byte	102,15,58,15,202,8
+	punpcklqdq	%xmm0,%xmm2
+	jmp	L010loop_shaext
+.align	4,0x90
+L010loop_shaext:
+	movdqu	(%edi),%xmm3
+	movdqu	16(%edi),%xmm4
+	movdqu	32(%edi),%xmm5
+.byte	102,15,56,0,223
+	movdqu	48(%edi),%xmm6
+	movdqa	%xmm2,16(%esp)
+	movdqa	-128(%ebp),%xmm0
+	paddd	%xmm3,%xmm0
+.byte	102,15,56,0,231
+.byte	15,56,203,209
+	pshufd	$14,%xmm0,%xmm0
+	nop
+	movdqa	%xmm1,(%esp)
+.byte	15,56,203,202
+	movdqa	-112(%ebp),%xmm0
+	paddd	%xmm4,%xmm0
+.byte	102,15,56,0,239
+.byte	15,56,203,209
+	pshufd	$14,%xmm0,%xmm0
+	leal	64(%edi),%edi
+.byte	15,56,204,220
+.byte	15,56,203,202
+	movdqa	-96(%ebp),%xmm0
+	paddd	%xmm5,%xmm0
+.byte	102,15,56,0,247
+.byte	15,56,203,209
+	pshufd	$14,%xmm0,%xmm0
+	movdqa	%xmm6,%xmm7
+.byte	102,15,58,15,253,4
+	nop
+	paddd	%xmm7,%xmm3
+.byte	15,56,204,229
+.byte	15,56,203,202
+	movdqa	-80(%ebp),%xmm0
+	paddd	%xmm6,%xmm0
+.byte	15,56,205,222
+.byte	15,56,203,209
+	pshufd	$14,%xmm0,%xmm0
+	movdqa	%xmm3,%xmm7
+.byte	102,15,58,15,254,4
+	nop
+	paddd	%xmm7,%xmm4
+.byte	15,56,204,238
+.byte	15,56,203,202
+	movdqa	-64(%ebp),%xmm0
+	paddd	%xmm3,%xmm0
+.byte	15,56,205,227
+.byte	15,56,203,209
+	pshufd	$14,%xmm0,%xmm0
+	movdqa	%xmm4,%xmm7
+.byte	102,15,58,15,251,4
+	nop
+	paddd	%xmm7,%xmm5
+.byte	15,56,204,243
+.byte	15,56,203,202
+	movdqa	-48(%ebp),%xmm0
+	paddd	%xmm4,%xmm0
+.byte	15,56,205,236
+.byte	15,56,203,209
+	pshufd	$14,%xmm0,%xmm0
+	movdqa	%xmm5,%xmm7
+.byte	102,15,58,15,252,4
+	nop
+	paddd	%xmm7,%xmm6
+.byte	15,56,204,220
+.byte	15,56,203,202
+	movdqa	-32(%ebp),%xmm0
+	paddd	%xmm5,%xmm0
+.byte	15,56,205,245
+.byte	15,56,203,209
+	pshufd	$14,%xmm0,%xmm0
+	movdqa	%xmm6,%xmm7
+.byte	102,15,58,15,253,4
+	nop
+	paddd	%xmm7,%xmm3
+.byte	15,56,204,229
+.byte	15,56,203,202
+	movdqa	-16(%ebp),%xmm0
+	paddd	%xmm6,%xmm0
+.byte	15,56,205,222
+.byte	15,56,203,209
+	pshufd	$14,%xmm0,%xmm0
+	movdqa	%xmm3,%xmm7
+.byte	102,15,58,15,254,4
+	nop
+	paddd	%xmm7,%xmm4
+.byte	15,56,204,238
+.byte	15,56,203,202
+	movdqa	(%ebp),%xmm0
+	paddd	%xmm3,%xmm0
+.byte	15,56,205,227
+.byte	15,56,203,209
+	pshufd	$14,%xmm0,%xmm0
+	movdqa	%xmm4,%xmm7
+.byte	102,15,58,15,251,4
+	nop
+	paddd	%xmm7,%xmm5
+.byte	15,56,204,243
+.byte	15,56,203,202
+	movdqa	16(%ebp),%xmm0
+	paddd	%xmm4,%xmm0
+.byte	15,56,205,236
+.byte	15,56,203,209
+	pshufd	$14,%xmm0,%xmm0
+	movdqa	%xmm5,%xmm7
+.byte	102,15,58,15,252,4
+	nop
+	paddd	%xmm7,%xmm6
+.byte	15,56,204,220
+.byte	15,56,203,202
+	movdqa	32(%ebp),%xmm0
+	paddd	%xmm5,%xmm0
+.byte	15,56,205,245
+.byte	15,56,203,209
+	pshufd	$14,%xmm0,%xmm0
+	movdqa	%xmm6,%xmm7
+.byte	102,15,58,15,253,4
+	nop
+	paddd	%xmm7,%xmm3
+.byte	15,56,204,229
+.byte	15,56,203,202
+	movdqa	48(%ebp),%xmm0
+	paddd	%xmm6,%xmm0
+.byte	15,56,205,222
+.byte	15,56,203,209
+	pshufd	$14,%xmm0,%xmm0
+	movdqa	%xmm3,%xmm7
+.byte	102,15,58,15,254,4
+	nop
+	paddd	%xmm7,%xmm4
+.byte	15,56,204,238
+.byte	15,56,203,202
+	movdqa	64(%ebp),%xmm0
+	paddd	%xmm3,%xmm0
+.byte	15,56,205,227
+.byte	15,56,203,209
+	pshufd	$14,%xmm0,%xmm0
+	movdqa	%xmm4,%xmm7
+.byte	102,15,58,15,251,4
+	nop
+	paddd	%xmm7,%xmm5
+.byte	15,56,204,243
+.byte	15,56,203,202
+	movdqa	80(%ebp),%xmm0
+	paddd	%xmm4,%xmm0
+.byte	15,56,205,236
+.byte	15,56,203,209
+	pshufd	$14,%xmm0,%xmm0
+	movdqa	%xmm5,%xmm7
+.byte	102,15,58,15,252,4
+.byte	15,56,203,202
+	paddd	%xmm7,%xmm6
+	movdqa	96(%ebp),%xmm0
+	paddd	%xmm5,%xmm0
+.byte	15,56,203,209
+	pshufd	$14,%xmm0,%xmm0
+.byte	15,56,205,245
+	movdqa	128(%ebp),%xmm7
+.byte	15,56,203,202
+	movdqa	112(%ebp),%xmm0
+	paddd	%xmm6,%xmm0
+	nop
+.byte	15,56,203,209
+	pshufd	$14,%xmm0,%xmm0
+	cmpl	%edi,%eax
+	nop
+.byte	15,56,203,202
+	paddd	16(%esp),%xmm2
+	paddd	(%esp),%xmm1
+	jnz	L010loop_shaext
+	pshufd	$177,%xmm2,%xmm2
+	pshufd	$27,%xmm1,%xmm7
+	pshufd	$177,%xmm1,%xmm1
+	punpckhqdq	%xmm2,%xmm1
+.byte	102,15,58,15,215,8
+	movl	44(%esp),%esp
+	movdqu	%xmm1,(%esi)
+	movdqu	%xmm2,16(%esi)
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.align	5,0x90
+L005SSSE3:
+	leal	-96(%esp),%esp
+	movl	(%esi),%eax
+	movl	4(%esi),%ebx
+	movl	8(%esi),%ecx
+	movl	12(%esi),%edi
+	movl	%ebx,4(%esp)
+	xorl	%ecx,%ebx
+	movl	%ecx,8(%esp)
+	movl	%edi,12(%esp)
+	movl	16(%esi),%edx
+	movl	20(%esi),%edi
+	movl	24(%esi),%ecx
+	movl	28(%esi),%esi
+	movl	%edi,20(%esp)
+	movl	100(%esp),%edi
+	movl	%ecx,24(%esp)
+	movl	%esi,28(%esp)
+	movdqa	256(%ebp),%xmm7
+	jmp	L011grand_ssse3
+.align	4,0x90
+L011grand_ssse3:
+	movdqu	(%edi),%xmm0
+	movdqu	16(%edi),%xmm1
+	movdqu	32(%edi),%xmm2
+	movdqu	48(%edi),%xmm3
+	addl	$64,%edi
+.byte	102,15,56,0,199
+	movl	%edi,100(%esp)
+.byte	102,15,56,0,207
+	movdqa	(%ebp),%xmm4
+.byte	102,15,56,0,215
+	movdqa	16(%ebp),%xmm5
+	paddd	%xmm0,%xmm4
+.byte	102,15,56,0,223
+	movdqa	32(%ebp),%xmm6
+	paddd	%xmm1,%xmm5
+	movdqa	48(%ebp),%xmm7
+	movdqa	%xmm4,32(%esp)
+	paddd	%xmm2,%xmm6
+	movdqa	%xmm5,48(%esp)
+	paddd	%xmm3,%xmm7
+	movdqa	%xmm6,64(%esp)
+	movdqa	%xmm7,80(%esp)
+	jmp	L012ssse3_00_47
+.align	4,0x90
+L012ssse3_00_47:
+	addl	$64,%ebp
+	movl	%edx,%ecx
+	movdqa	%xmm1,%xmm4
+	rorl	$14,%edx
+	movl	20(%esp),%esi
+	movdqa	%xmm3,%xmm7
+	xorl	%ecx,%edx
+	movl	24(%esp),%edi
+.byte	102,15,58,15,224,4
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+.byte	102,15,58,15,250,4
+	movl	%ecx,16(%esp)
+	xorl	%ecx,%edx
+	xorl	%esi,%edi
+	movdqa	%xmm4,%xmm5
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	movdqa	%xmm4,%xmm6
+	addl	%edi,%edx
+	movl	4(%esp),%edi
+	psrld	$3,%xmm4
+	movl	%eax,%esi
+	rorl	$9,%ecx
+	paddd	%xmm7,%xmm0
+	movl	%eax,(%esp)
+	xorl	%eax,%ecx
+	psrld	$7,%xmm6
+	xorl	%edi,%eax
+	addl	28(%esp),%edx
+	rorl	$11,%ecx
+	andl	%eax,%ebx
+	pshufd	$250,%xmm3,%xmm7
+	xorl	%esi,%ecx
+	addl	32(%esp),%edx
+	pslld	$14,%xmm5
+	xorl	%edi,%ebx
+	rorl	$2,%ecx
+	pxor	%xmm6,%xmm4
+	addl	%edx,%ebx
+	addl	12(%esp),%edx
+	psrld	$11,%xmm6
+	addl	%ecx,%ebx
+	movl	%edx,%ecx
+	rorl	$14,%edx
+	pxor	%xmm5,%xmm4
+	movl	16(%esp),%esi
+	xorl	%ecx,%edx
+	pslld	$11,%xmm5
+	movl	20(%esp),%edi
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	pxor	%xmm6,%xmm4
+	andl	%ecx,%esi
+	movl	%ecx,12(%esp)
+	movdqa	%xmm7,%xmm6
+	xorl	%ecx,%edx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	pxor	%xmm5,%xmm4
+	movl	%ebx,%ecx
+	addl	%edi,%edx
+	psrld	$10,%xmm7
+	movl	(%esp),%edi
+	movl	%ebx,%esi
+	rorl	$9,%ecx
+	paddd	%xmm4,%xmm0
+	movl	%ebx,28(%esp)
+	xorl	%ebx,%ecx
+	psrlq	$17,%xmm6
+	xorl	%edi,%ebx
+	addl	24(%esp),%edx
+	rorl	$11,%ecx
+	pxor	%xmm6,%xmm7
+	andl	%ebx,%eax
+	xorl	%esi,%ecx
+	psrlq	$2,%xmm6
+	addl	36(%esp),%edx
+	xorl	%edi,%eax
+	rorl	$2,%ecx
+	pxor	%xmm6,%xmm7
+	addl	%edx,%eax
+	addl	8(%esp),%edx
+	pshufd	$128,%xmm7,%xmm7
+	addl	%ecx,%eax
+	movl	%edx,%ecx
+	rorl	$14,%edx
+	movl	12(%esp),%esi
+	xorl	%ecx,%edx
+	movl	16(%esp),%edi
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	psrldq	$8,%xmm7
+	movl	%ecx,8(%esp)
+	xorl	%ecx,%edx
+	xorl	%esi,%edi
+	paddd	%xmm7,%xmm0
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%edx
+	movl	28(%esp),%edi
+	movl	%eax,%esi
+	rorl	$9,%ecx
+	movl	%eax,24(%esp)
+	pshufd	$80,%xmm0,%xmm7
+	xorl	%eax,%ecx
+	xorl	%edi,%eax
+	addl	20(%esp),%edx
+	movdqa	%xmm7,%xmm6
+	rorl	$11,%ecx
+	psrld	$10,%xmm7
+	andl	%eax,%ebx
+	psrlq	$17,%xmm6
+	xorl	%esi,%ecx
+	addl	40(%esp),%edx
+	xorl	%edi,%ebx
+	rorl	$2,%ecx
+	pxor	%xmm6,%xmm7
+	addl	%edx,%ebx
+	addl	4(%esp),%edx
+	psrlq	$2,%xmm6
+	addl	%ecx,%ebx
+	movl	%edx,%ecx
+	rorl	$14,%edx
+	pxor	%xmm6,%xmm7
+	movl	8(%esp),%esi
+	xorl	%ecx,%edx
+	movl	12(%esp),%edi
+	pshufd	$8,%xmm7,%xmm7
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	movdqa	(%ebp),%xmm6
+	andl	%ecx,%esi
+	movl	%ecx,4(%esp)
+	pslldq	$8,%xmm7
+	xorl	%ecx,%edx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%ebx,%ecx
+	addl	%edi,%edx
+	movl	24(%esp),%edi
+	movl	%ebx,%esi
+	rorl	$9,%ecx
+	paddd	%xmm7,%xmm0
+	movl	%ebx,20(%esp)
+	xorl	%ebx,%ecx
+	xorl	%edi,%ebx
+	addl	16(%esp),%edx
+	paddd	%xmm0,%xmm6
+	rorl	$11,%ecx
+	andl	%ebx,%eax
+	xorl	%esi,%ecx
+	addl	44(%esp),%edx
+	xorl	%edi,%eax
+	rorl	$2,%ecx
+	addl	%edx,%eax
+	addl	(%esp),%edx
+	addl	%ecx,%eax
+	movdqa	%xmm6,32(%esp)
+	movl	%edx,%ecx
+	movdqa	%xmm2,%xmm4
+	rorl	$14,%edx
+	movl	4(%esp),%esi
+	movdqa	%xmm0,%xmm7
+	xorl	%ecx,%edx
+	movl	8(%esp),%edi
+.byte	102,15,58,15,225,4
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+.byte	102,15,58,15,251,4
+	movl	%ecx,(%esp)
+	xorl	%ecx,%edx
+	xorl	%esi,%edi
+	movdqa	%xmm4,%xmm5
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	movdqa	%xmm4,%xmm6
+	addl	%edi,%edx
+	movl	20(%esp),%edi
+	psrld	$3,%xmm4
+	movl	%eax,%esi
+	rorl	$9,%ecx
+	paddd	%xmm7,%xmm1
+	movl	%eax,16(%esp)
+	xorl	%eax,%ecx
+	psrld	$7,%xmm6
+	xorl	%edi,%eax
+	addl	12(%esp),%edx
+	rorl	$11,%ecx
+	andl	%eax,%ebx
+	pshufd	$250,%xmm0,%xmm7
+	xorl	%esi,%ecx
+	addl	48(%esp),%edx
+	pslld	$14,%xmm5
+	xorl	%edi,%ebx
+	rorl	$2,%ecx
+	pxor	%xmm6,%xmm4
+	addl	%edx,%ebx
+	addl	28(%esp),%edx
+	psrld	$11,%xmm6
+	addl	%ecx,%ebx
+	movl	%edx,%ecx
+	rorl	$14,%edx
+	pxor	%xmm5,%xmm4
+	movl	(%esp),%esi
+	xorl	%ecx,%edx
+	pslld	$11,%xmm5
+	movl	4(%esp),%edi
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	pxor	%xmm6,%xmm4
+	andl	%ecx,%esi
+	movl	%ecx,28(%esp)
+	movdqa	%xmm7,%xmm6
+	xorl	%ecx,%edx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	pxor	%xmm5,%xmm4
+	movl	%ebx,%ecx
+	addl	%edi,%edx
+	psrld	$10,%xmm7
+	movl	16(%esp),%edi
+	movl	%ebx,%esi
+	rorl	$9,%ecx
+	paddd	%xmm4,%xmm1
+	movl	%ebx,12(%esp)
+	xorl	%ebx,%ecx
+	psrlq	$17,%xmm6
+	xorl	%edi,%ebx
+	addl	8(%esp),%edx
+	rorl	$11,%ecx
+	pxor	%xmm6,%xmm7
+	andl	%ebx,%eax
+	xorl	%esi,%ecx
+	psrlq	$2,%xmm6
+	addl	52(%esp),%edx
+	xorl	%edi,%eax
+	rorl	$2,%ecx
+	pxor	%xmm6,%xmm7
+	addl	%edx,%eax
+	addl	24(%esp),%edx
+	pshufd	$128,%xmm7,%xmm7
+	addl	%ecx,%eax
+	movl	%edx,%ecx
+	rorl	$14,%edx
+	movl	28(%esp),%esi
+	xorl	%ecx,%edx
+	movl	(%esp),%edi
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	psrldq	$8,%xmm7
+	movl	%ecx,24(%esp)
+	xorl	%ecx,%edx
+	xorl	%esi,%edi
+	paddd	%xmm7,%xmm1
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%edx
+	movl	12(%esp),%edi
+	movl	%eax,%esi
+	rorl	$9,%ecx
+	movl	%eax,8(%esp)
+	pshufd	$80,%xmm1,%xmm7
+	xorl	%eax,%ecx
+	xorl	%edi,%eax
+	addl	4(%esp),%edx
+	movdqa	%xmm7,%xmm6
+	rorl	$11,%ecx
+	psrld	$10,%xmm7
+	andl	%eax,%ebx
+	psrlq	$17,%xmm6
+	xorl	%esi,%ecx
+	addl	56(%esp),%edx
+	xorl	%edi,%ebx
+	rorl	$2,%ecx
+	pxor	%xmm6,%xmm7
+	addl	%edx,%ebx
+	addl	20(%esp),%edx
+	psrlq	$2,%xmm6
+	addl	%ecx,%ebx
+	movl	%edx,%ecx
+	rorl	$14,%edx
+	pxor	%xmm6,%xmm7
+	movl	24(%esp),%esi
+	xorl	%ecx,%edx
+	movl	28(%esp),%edi
+	pshufd	$8,%xmm7,%xmm7
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	movdqa	16(%ebp),%xmm6
+	andl	%ecx,%esi
+	movl	%ecx,20(%esp)
+	pslldq	$8,%xmm7
+	xorl	%ecx,%edx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%ebx,%ecx
+	addl	%edi,%edx
+	movl	8(%esp),%edi
+	movl	%ebx,%esi
+	rorl	$9,%ecx
+	paddd	%xmm7,%xmm1
+	movl	%ebx,4(%esp)
+	xorl	%ebx,%ecx
+	xorl	%edi,%ebx
+	addl	(%esp),%edx
+	paddd	%xmm1,%xmm6
+	rorl	$11,%ecx
+	andl	%ebx,%eax
+	xorl	%esi,%ecx
+	addl	60(%esp),%edx
+	xorl	%edi,%eax
+	rorl	$2,%ecx
+	addl	%edx,%eax
+	addl	16(%esp),%edx
+	addl	%ecx,%eax
+	movdqa	%xmm6,48(%esp)
+	movl	%edx,%ecx
+	movdqa	%xmm3,%xmm4
+	rorl	$14,%edx
+	movl	20(%esp),%esi
+	movdqa	%xmm1,%xmm7
+	xorl	%ecx,%edx
+	movl	24(%esp),%edi
+.byte	102,15,58,15,226,4
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+.byte	102,15,58,15,248,4
+	movl	%ecx,16(%esp)
+	xorl	%ecx,%edx
+	xorl	%esi,%edi
+	movdqa	%xmm4,%xmm5
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	movdqa	%xmm4,%xmm6
+	addl	%edi,%edx
+	movl	4(%esp),%edi
+	psrld	$3,%xmm4
+	movl	%eax,%esi
+	rorl	$9,%ecx
+	paddd	%xmm7,%xmm2
+	movl	%eax,(%esp)
+	xorl	%eax,%ecx
+	psrld	$7,%xmm6
+	xorl	%edi,%eax
+	addl	28(%esp),%edx
+	rorl	$11,%ecx
+	andl	%eax,%ebx
+	pshufd	$250,%xmm1,%xmm7
+	xorl	%esi,%ecx
+	addl	64(%esp),%edx
+	pslld	$14,%xmm5
+	xorl	%edi,%ebx
+	rorl	$2,%ecx
+	pxor	%xmm6,%xmm4
+	addl	%edx,%ebx
+	addl	12(%esp),%edx
+	psrld	$11,%xmm6
+	addl	%ecx,%ebx
+	movl	%edx,%ecx
+	rorl	$14,%edx
+	pxor	%xmm5,%xmm4
+	movl	16(%esp),%esi
+	xorl	%ecx,%edx
+	pslld	$11,%xmm5
+	movl	20(%esp),%edi
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	pxor	%xmm6,%xmm4
+	andl	%ecx,%esi
+	movl	%ecx,12(%esp)
+	movdqa	%xmm7,%xmm6
+	xorl	%ecx,%edx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	pxor	%xmm5,%xmm4
+	movl	%ebx,%ecx
+	addl	%edi,%edx
+	psrld	$10,%xmm7
+	movl	(%esp),%edi
+	movl	%ebx,%esi
+	rorl	$9,%ecx
+	paddd	%xmm4,%xmm2
+	movl	%ebx,28(%esp)
+	xorl	%ebx,%ecx
+	psrlq	$17,%xmm6
+	xorl	%edi,%ebx
+	addl	24(%esp),%edx
+	rorl	$11,%ecx
+	pxor	%xmm6,%xmm7
+	andl	%ebx,%eax
+	xorl	%esi,%ecx
+	psrlq	$2,%xmm6
+	addl	68(%esp),%edx
+	xorl	%edi,%eax
+	rorl	$2,%ecx
+	pxor	%xmm6,%xmm7
+	addl	%edx,%eax
+	addl	8(%esp),%edx
+	pshufd	$128,%xmm7,%xmm7
+	addl	%ecx,%eax
+	movl	%edx,%ecx
+	rorl	$14,%edx
+	movl	12(%esp),%esi
+	xorl	%ecx,%edx
+	movl	16(%esp),%edi
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	psrldq	$8,%xmm7
+	movl	%ecx,8(%esp)
+	xorl	%ecx,%edx
+	xorl	%esi,%edi
+	paddd	%xmm7,%xmm2
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%edx
+	movl	28(%esp),%edi
+	movl	%eax,%esi
+	rorl	$9,%ecx
+	movl	%eax,24(%esp)
+	pshufd	$80,%xmm2,%xmm7
+	xorl	%eax,%ecx
+	xorl	%edi,%eax
+	addl	20(%esp),%edx
+	movdqa	%xmm7,%xmm6
+	rorl	$11,%ecx
+	psrld	$10,%xmm7
+	andl	%eax,%ebx
+	psrlq	$17,%xmm6
+	xorl	%esi,%ecx
+	addl	72(%esp),%edx
+	xorl	%edi,%ebx
+	rorl	$2,%ecx
+	pxor	%xmm6,%xmm7
+	addl	%edx,%ebx
+	addl	4(%esp),%edx
+	psrlq	$2,%xmm6
+	addl	%ecx,%ebx
+	movl	%edx,%ecx
+	rorl	$14,%edx
+	pxor	%xmm6,%xmm7
+	movl	8(%esp),%esi
+	xorl	%ecx,%edx
+	movl	12(%esp),%edi
+	pshufd	$8,%xmm7,%xmm7
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	movdqa	32(%ebp),%xmm6
+	andl	%ecx,%esi
+	movl	%ecx,4(%esp)
+	pslldq	$8,%xmm7
+	xorl	%ecx,%edx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%ebx,%ecx
+	addl	%edi,%edx
+	movl	24(%esp),%edi
+	movl	%ebx,%esi
+	rorl	$9,%ecx
+	paddd	%xmm7,%xmm2
+	movl	%ebx,20(%esp)
+	xorl	%ebx,%ecx
+	xorl	%edi,%ebx
+	addl	16(%esp),%edx
+	paddd	%xmm2,%xmm6
+	rorl	$11,%ecx
+	andl	%ebx,%eax
+	xorl	%esi,%ecx
+	addl	76(%esp),%edx
+	xorl	%edi,%eax
+	rorl	$2,%ecx
+	addl	%edx,%eax
+	addl	(%esp),%edx
+	addl	%ecx,%eax
+	movdqa	%xmm6,64(%esp)
+	movl	%edx,%ecx
+	movdqa	%xmm0,%xmm4
+	rorl	$14,%edx
+	movl	4(%esp),%esi
+	movdqa	%xmm2,%xmm7
+	xorl	%ecx,%edx
+	movl	8(%esp),%edi
+.byte	102,15,58,15,227,4
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+.byte	102,15,58,15,249,4
+	movl	%ecx,(%esp)
+	xorl	%ecx,%edx
+	xorl	%esi,%edi
+	movdqa	%xmm4,%xmm5
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	movdqa	%xmm4,%xmm6
+	addl	%edi,%edx
+	movl	20(%esp),%edi
+	psrld	$3,%xmm4
+	movl	%eax,%esi
+	rorl	$9,%ecx
+	paddd	%xmm7,%xmm3
+	movl	%eax,16(%esp)
+	xorl	%eax,%ecx
+	psrld	$7,%xmm6
+	xorl	%edi,%eax
+	addl	12(%esp),%edx
+	rorl	$11,%ecx
+	andl	%eax,%ebx
+	pshufd	$250,%xmm2,%xmm7
+	xorl	%esi,%ecx
+	addl	80(%esp),%edx
+	pslld	$14,%xmm5
+	xorl	%edi,%ebx
+	rorl	$2,%ecx
+	pxor	%xmm6,%xmm4
+	addl	%edx,%ebx
+	addl	28(%esp),%edx
+	psrld	$11,%xmm6
+	addl	%ecx,%ebx
+	movl	%edx,%ecx
+	rorl	$14,%edx
+	pxor	%xmm5,%xmm4
+	movl	(%esp),%esi
+	xorl	%ecx,%edx
+	pslld	$11,%xmm5
+	movl	4(%esp),%edi
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	pxor	%xmm6,%xmm4
+	andl	%ecx,%esi
+	movl	%ecx,28(%esp)
+	movdqa	%xmm7,%xmm6
+	xorl	%ecx,%edx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	pxor	%xmm5,%xmm4
+	movl	%ebx,%ecx
+	addl	%edi,%edx
+	psrld	$10,%xmm7
+	movl	16(%esp),%edi
+	movl	%ebx,%esi
+	rorl	$9,%ecx
+	paddd	%xmm4,%xmm3
+	movl	%ebx,12(%esp)
+	xorl	%ebx,%ecx
+	psrlq	$17,%xmm6
+	xorl	%edi,%ebx
+	addl	8(%esp),%edx
+	rorl	$11,%ecx
+	pxor	%xmm6,%xmm7
+	andl	%ebx,%eax
+	xorl	%esi,%ecx
+	psrlq	$2,%xmm6
+	addl	84(%esp),%edx
+	xorl	%edi,%eax
+	rorl	$2,%ecx
+	pxor	%xmm6,%xmm7
+	addl	%edx,%eax
+	addl	24(%esp),%edx
+	pshufd	$128,%xmm7,%xmm7
+	addl	%ecx,%eax
+	movl	%edx,%ecx
+	rorl	$14,%edx
+	movl	28(%esp),%esi
+	xorl	%ecx,%edx
+	movl	(%esp),%edi
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	psrldq	$8,%xmm7
+	movl	%ecx,24(%esp)
+	xorl	%ecx,%edx
+	xorl	%esi,%edi
+	paddd	%xmm7,%xmm3
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%edx
+	movl	12(%esp),%edi
+	movl	%eax,%esi
+	rorl	$9,%ecx
+	movl	%eax,8(%esp)
+	pshufd	$80,%xmm3,%xmm7
+	xorl	%eax,%ecx
+	xorl	%edi,%eax
+	addl	4(%esp),%edx
+	movdqa	%xmm7,%xmm6
+	rorl	$11,%ecx
+	psrld	$10,%xmm7
+	andl	%eax,%ebx
+	psrlq	$17,%xmm6
+	xorl	%esi,%ecx
+	addl	88(%esp),%edx
+	xorl	%edi,%ebx
+	rorl	$2,%ecx
+	pxor	%xmm6,%xmm7
+	addl	%edx,%ebx
+	addl	20(%esp),%edx
+	psrlq	$2,%xmm6
+	addl	%ecx,%ebx
+	movl	%edx,%ecx
+	rorl	$14,%edx
+	pxor	%xmm6,%xmm7
+	movl	24(%esp),%esi
+	xorl	%ecx,%edx
+	movl	28(%esp),%edi
+	pshufd	$8,%xmm7,%xmm7
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	movdqa	48(%ebp),%xmm6
+	andl	%ecx,%esi
+	movl	%ecx,20(%esp)
+	pslldq	$8,%xmm7
+	xorl	%ecx,%edx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%ebx,%ecx
+	addl	%edi,%edx
+	movl	8(%esp),%edi
+	movl	%ebx,%esi
+	rorl	$9,%ecx
+	paddd	%xmm7,%xmm3
+	movl	%ebx,4(%esp)
+	xorl	%ebx,%ecx
+	xorl	%edi,%ebx
+	addl	(%esp),%edx
+	paddd	%xmm3,%xmm6
+	rorl	$11,%ecx
+	andl	%ebx,%eax
+	xorl	%esi,%ecx
+	addl	92(%esp),%edx
+	xorl	%edi,%eax
+	rorl	$2,%ecx
+	addl	%edx,%eax
+	addl	16(%esp),%edx
+	addl	%ecx,%eax
+	movdqa	%xmm6,80(%esp)
+	cmpl	$66051,64(%ebp)
+	jne	L012ssse3_00_47
+	movl	%edx,%ecx
+	rorl	$14,%edx
+	movl	20(%esp),%esi
+	xorl	%ecx,%edx
+	movl	24(%esp),%edi
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,16(%esp)
+	xorl	%ecx,%edx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%edx
+	movl	4(%esp),%edi
+	movl	%eax,%esi
+	rorl	$9,%ecx
+	movl	%eax,(%esp)
+	xorl	%eax,%ecx
+	xorl	%edi,%eax
+	addl	28(%esp),%edx
+	rorl	$11,%ecx
+	andl	%eax,%ebx
+	xorl	%esi,%ecx
+	addl	32(%esp),%edx
+	xorl	%edi,%ebx
+	rorl	$2,%ecx
+	addl	%edx,%ebx
+	addl	12(%esp),%edx
+	addl	%ecx,%ebx
+	movl	%edx,%ecx
+	rorl	$14,%edx
+	movl	16(%esp),%esi
+	xorl	%ecx,%edx
+	movl	20(%esp),%edi
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,12(%esp)
+	xorl	%ecx,%edx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%ebx,%ecx
+	addl	%edi,%edx
+	movl	(%esp),%edi
+	movl	%ebx,%esi
+	rorl	$9,%ecx
+	movl	%ebx,28(%esp)
+	xorl	%ebx,%ecx
+	xorl	%edi,%ebx
+	addl	24(%esp),%edx
+	rorl	$11,%ecx
+	andl	%ebx,%eax
+	xorl	%esi,%ecx
+	addl	36(%esp),%edx
+	xorl	%edi,%eax
+	rorl	$2,%ecx
+	addl	%edx,%eax
+	addl	8(%esp),%edx
+	addl	%ecx,%eax
+	movl	%edx,%ecx
+	rorl	$14,%edx
+	movl	12(%esp),%esi
+	xorl	%ecx,%edx
+	movl	16(%esp),%edi
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,8(%esp)
+	xorl	%ecx,%edx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%edx
+	movl	28(%esp),%edi
+	movl	%eax,%esi
+	rorl	$9,%ecx
+	movl	%eax,24(%esp)
+	xorl	%eax,%ecx
+	xorl	%edi,%eax
+	addl	20(%esp),%edx
+	rorl	$11,%ecx
+	andl	%eax,%ebx
+	xorl	%esi,%ecx
+	addl	40(%esp),%edx
+	xorl	%edi,%ebx
+	rorl	$2,%ecx
+	addl	%edx,%ebx
+	addl	4(%esp),%edx
+	addl	%ecx,%ebx
+	movl	%edx,%ecx
+	rorl	$14,%edx
+	movl	8(%esp),%esi
+	xorl	%ecx,%edx
+	movl	12(%esp),%edi
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,4(%esp)
+	xorl	%ecx,%edx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%ebx,%ecx
+	addl	%edi,%edx
+	movl	24(%esp),%edi
+	movl	%ebx,%esi
+	rorl	$9,%ecx
+	movl	%ebx,20(%esp)
+	xorl	%ebx,%ecx
+	xorl	%edi,%ebx
+	addl	16(%esp),%edx
+	rorl	$11,%ecx
+	andl	%ebx,%eax
+	xorl	%esi,%ecx
+	addl	44(%esp),%edx
+	xorl	%edi,%eax
+	rorl	$2,%ecx
+	addl	%edx,%eax
+	addl	(%esp),%edx
+	addl	%ecx,%eax
+	movl	%edx,%ecx
+	rorl	$14,%edx
+	movl	4(%esp),%esi
+	xorl	%ecx,%edx
+	movl	8(%esp),%edi
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,(%esp)
+	xorl	%ecx,%edx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%edx
+	movl	20(%esp),%edi
+	movl	%eax,%esi
+	rorl	$9,%ecx
+	movl	%eax,16(%esp)
+	xorl	%eax,%ecx
+	xorl	%edi,%eax
+	addl	12(%esp),%edx
+	rorl	$11,%ecx
+	andl	%eax,%ebx
+	xorl	%esi,%ecx
+	addl	48(%esp),%edx
+	xorl	%edi,%ebx
+	rorl	$2,%ecx
+	addl	%edx,%ebx
+	addl	28(%esp),%edx
+	addl	%ecx,%ebx
+	movl	%edx,%ecx
+	rorl	$14,%edx
+	movl	(%esp),%esi
+	xorl	%ecx,%edx
+	movl	4(%esp),%edi
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,28(%esp)
+	xorl	%ecx,%edx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%ebx,%ecx
+	addl	%edi,%edx
+	movl	16(%esp),%edi
+	movl	%ebx,%esi
+	rorl	$9,%ecx
+	movl	%ebx,12(%esp)
+	xorl	%ebx,%ecx
+	xorl	%edi,%ebx
+	addl	8(%esp),%edx
+	rorl	$11,%ecx
+	andl	%ebx,%eax
+	xorl	%esi,%ecx
+	addl	52(%esp),%edx
+	xorl	%edi,%eax
+	rorl	$2,%ecx
+	addl	%edx,%eax
+	addl	24(%esp),%edx
+	addl	%ecx,%eax
+	movl	%edx,%ecx
+	rorl	$14,%edx
+	movl	28(%esp),%esi
+	xorl	%ecx,%edx
+	movl	(%esp),%edi
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,24(%esp)
+	xorl	%ecx,%edx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%edx
+	movl	12(%esp),%edi
+	movl	%eax,%esi
+	rorl	$9,%ecx
+	movl	%eax,8(%esp)
+	xorl	%eax,%ecx
+	xorl	%edi,%eax
+	addl	4(%esp),%edx
+	rorl	$11,%ecx
+	andl	%eax,%ebx
+	xorl	%esi,%ecx
+	addl	56(%esp),%edx
+	xorl	%edi,%ebx
+	rorl	$2,%ecx
+	addl	%edx,%ebx
+	addl	20(%esp),%edx
+	addl	%ecx,%ebx
+	movl	%edx,%ecx
+	rorl	$14,%edx
+	movl	24(%esp),%esi
+	xorl	%ecx,%edx
+	movl	28(%esp),%edi
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,20(%esp)
+	xorl	%ecx,%edx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%ebx,%ecx
+	addl	%edi,%edx
+	movl	8(%esp),%edi
+	movl	%ebx,%esi
+	rorl	$9,%ecx
+	movl	%ebx,4(%esp)
+	xorl	%ebx,%ecx
+	xorl	%edi,%ebx
+	addl	(%esp),%edx
+	rorl	$11,%ecx
+	andl	%ebx,%eax
+	xorl	%esi,%ecx
+	addl	60(%esp),%edx
+	xorl	%edi,%eax
+	rorl	$2,%ecx
+	addl	%edx,%eax
+	addl	16(%esp),%edx
+	addl	%ecx,%eax
+	movl	%edx,%ecx
+	rorl	$14,%edx
+	movl	20(%esp),%esi
+	xorl	%ecx,%edx
+	movl	24(%esp),%edi
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,16(%esp)
+	xorl	%ecx,%edx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%edx
+	movl	4(%esp),%edi
+	movl	%eax,%esi
+	rorl	$9,%ecx
+	movl	%eax,(%esp)
+	xorl	%eax,%ecx
+	xorl	%edi,%eax
+	addl	28(%esp),%edx
+	rorl	$11,%ecx
+	andl	%eax,%ebx
+	xorl	%esi,%ecx
+	addl	64(%esp),%edx
+	xorl	%edi,%ebx
+	rorl	$2,%ecx
+	addl	%edx,%ebx
+	addl	12(%esp),%edx
+	addl	%ecx,%ebx
+	movl	%edx,%ecx
+	rorl	$14,%edx
+	movl	16(%esp),%esi
+	xorl	%ecx,%edx
+	movl	20(%esp),%edi
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,12(%esp)
+	xorl	%ecx,%edx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%ebx,%ecx
+	addl	%edi,%edx
+	movl	(%esp),%edi
+	movl	%ebx,%esi
+	rorl	$9,%ecx
+	movl	%ebx,28(%esp)
+	xorl	%ebx,%ecx
+	xorl	%edi,%ebx
+	addl	24(%esp),%edx
+	rorl	$11,%ecx
+	andl	%ebx,%eax
+	xorl	%esi,%ecx
+	addl	68(%esp),%edx
+	xorl	%edi,%eax
+	rorl	$2,%ecx
+	addl	%edx,%eax
+	addl	8(%esp),%edx
+	addl	%ecx,%eax
+	movl	%edx,%ecx
+	rorl	$14,%edx
+	movl	12(%esp),%esi
+	xorl	%ecx,%edx
+	movl	16(%esp),%edi
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,8(%esp)
+	xorl	%ecx,%edx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%edx
+	movl	28(%esp),%edi
+	movl	%eax,%esi
+	rorl	$9,%ecx
+	movl	%eax,24(%esp)
+	xorl	%eax,%ecx
+	xorl	%edi,%eax
+	addl	20(%esp),%edx
+	rorl	$11,%ecx
+	andl	%eax,%ebx
+	xorl	%esi,%ecx
+	addl	72(%esp),%edx
+	xorl	%edi,%ebx
+	rorl	$2,%ecx
+	addl	%edx,%ebx
+	addl	4(%esp),%edx
+	addl	%ecx,%ebx
+	movl	%edx,%ecx
+	rorl	$14,%edx
+	movl	8(%esp),%esi
+	xorl	%ecx,%edx
+	movl	12(%esp),%edi
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,4(%esp)
+	xorl	%ecx,%edx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%ebx,%ecx
+	addl	%edi,%edx
+	movl	24(%esp),%edi
+	movl	%ebx,%esi
+	rorl	$9,%ecx
+	movl	%ebx,20(%esp)
+	xorl	%ebx,%ecx
+	xorl	%edi,%ebx
+	addl	16(%esp),%edx
+	rorl	$11,%ecx
+	andl	%ebx,%eax
+	xorl	%esi,%ecx
+	addl	76(%esp),%edx
+	xorl	%edi,%eax
+	rorl	$2,%ecx
+	addl	%edx,%eax
+	addl	(%esp),%edx
+	addl	%ecx,%eax
+	movl	%edx,%ecx
+	rorl	$14,%edx
+	movl	4(%esp),%esi
+	xorl	%ecx,%edx
+	movl	8(%esp),%edi
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,(%esp)
+	xorl	%ecx,%edx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%edx
+	movl	20(%esp),%edi
+	movl	%eax,%esi
+	rorl	$9,%ecx
+	movl	%eax,16(%esp)
+	xorl	%eax,%ecx
+	xorl	%edi,%eax
+	addl	12(%esp),%edx
+	rorl	$11,%ecx
+	andl	%eax,%ebx
+	xorl	%esi,%ecx
+	addl	80(%esp),%edx
+	xorl	%edi,%ebx
+	rorl	$2,%ecx
+	addl	%edx,%ebx
+	addl	28(%esp),%edx
+	addl	%ecx,%ebx
+	movl	%edx,%ecx
+	rorl	$14,%edx
+	movl	(%esp),%esi
+	xorl	%ecx,%edx
+	movl	4(%esp),%edi
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,28(%esp)
+	xorl	%ecx,%edx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%ebx,%ecx
+	addl	%edi,%edx
+	movl	16(%esp),%edi
+	movl	%ebx,%esi
+	rorl	$9,%ecx
+	movl	%ebx,12(%esp)
+	xorl	%ebx,%ecx
+	xorl	%edi,%ebx
+	addl	8(%esp),%edx
+	rorl	$11,%ecx
+	andl	%ebx,%eax
+	xorl	%esi,%ecx
+	addl	84(%esp),%edx
+	xorl	%edi,%eax
+	rorl	$2,%ecx
+	addl	%edx,%eax
+	addl	24(%esp),%edx
+	addl	%ecx,%eax
+	movl	%edx,%ecx
+	rorl	$14,%edx
+	movl	28(%esp),%esi
+	xorl	%ecx,%edx
+	movl	(%esp),%edi
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,24(%esp)
+	xorl	%ecx,%edx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%eax,%ecx
+	addl	%edi,%edx
+	movl	12(%esp),%edi
+	movl	%eax,%esi
+	rorl	$9,%ecx
+	movl	%eax,8(%esp)
+	xorl	%eax,%ecx
+	xorl	%edi,%eax
+	addl	4(%esp),%edx
+	rorl	$11,%ecx
+	andl	%eax,%ebx
+	xorl	%esi,%ecx
+	addl	88(%esp),%edx
+	xorl	%edi,%ebx
+	rorl	$2,%ecx
+	addl	%edx,%ebx
+	addl	20(%esp),%edx
+	addl	%ecx,%ebx
+	movl	%edx,%ecx
+	rorl	$14,%edx
+	movl	24(%esp),%esi
+	xorl	%ecx,%edx
+	movl	28(%esp),%edi
+	xorl	%edi,%esi
+	rorl	$5,%edx
+	andl	%ecx,%esi
+	movl	%ecx,20(%esp)
+	xorl	%ecx,%edx
+	xorl	%esi,%edi
+	rorl	$6,%edx
+	movl	%ebx,%ecx
+	addl	%edi,%edx
+	movl	8(%esp),%edi
+	movl	%ebx,%esi
+	rorl	$9,%ecx
+	movl	%ebx,4(%esp)
+	xorl	%ebx,%ecx
+	xorl	%edi,%ebx
+	addl	(%esp),%edx
+	rorl	$11,%ecx
+	andl	%ebx,%eax
+	xorl	%esi,%ecx
+	addl	92(%esp),%edx
+	xorl	%edi,%eax
+	rorl	$2,%ecx
+	addl	%edx,%eax
+	addl	16(%esp),%edx
+	addl	%ecx,%eax
+	movl	96(%esp),%esi
+	xorl	%edi,%ebx
+	movl	12(%esp),%ecx
+	addl	(%esi),%eax
+	addl	4(%esi),%ebx
+	addl	8(%esi),%edi
+	addl	12(%esi),%ecx
+	movl	%eax,(%esi)
+	movl	%ebx,4(%esi)
+	movl	%edi,8(%esi)
+	movl	%ecx,12(%esi)
+	movl	%ebx,4(%esp)
+	xorl	%edi,%ebx
+	movl	%edi,8(%esp)
+	movl	%ecx,12(%esp)
+	movl	20(%esp),%edi
+	movl	24(%esp),%ecx
+	addl	16(%esi),%edx
+	addl	20(%esi),%edi
+	addl	24(%esi),%ecx
+	movl	%edx,16(%esi)
+	movl	%edi,20(%esi)
+	movl	%edi,20(%esp)
+	movl	28(%esp),%edi
+	movl	%ecx,24(%esi)
+	addl	28(%esi),%edi
+	movl	%ecx,24(%esp)
+	movl	%edi,28(%esi)
+	movl	%edi,28(%esp)
+	movl	100(%esp),%edi
+	movdqa	64(%ebp),%xmm7
+	subl	$192,%ebp
+	cmpl	104(%esp),%edi
+	jb	L011grand_ssse3
+	movl	108(%esp),%esp
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.section __IMPORT,__pointers,non_lazy_symbol_pointers
+L_OPENSSL_ia32cap_P$non_lazy_ptr:
+.indirect_symbol	_OPENSSL_ia32cap_P
+.long	0
+#endif
diff --git a/third_party/boringssl/mac-x86/crypto/sha/sha512-586.S b/third_party/boringssl/mac-x86/crypto/sha/sha512-586.S
new file mode 100644
index 0000000..3066100
--- /dev/null
+++ b/third_party/boringssl/mac-x86/crypto/sha/sha512-586.S
@@ -0,0 +1,2833 @@
+#if defined(__i386__)
+.file	"sha512-586.S"
+.text
+.globl	_sha512_block_data_order
+.private_extern	_sha512_block_data_order
+.align	4
+_sha512_block_data_order:
+L_sha512_block_data_order_begin:
+	pushl	%ebp
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+	movl	20(%esp),%esi
+	movl	24(%esp),%edi
+	movl	28(%esp),%eax
+	movl	%esp,%ebx
+	call	L000pic_point
+L000pic_point:
+	popl	%ebp
+	leal	L001K512-L000pic_point(%ebp),%ebp
+	subl	$16,%esp
+	andl	$-64,%esp
+	shll	$7,%eax
+	addl	%edi,%eax
+	movl	%esi,(%esp)
+	movl	%edi,4(%esp)
+	movl	%eax,8(%esp)
+	movl	%ebx,12(%esp)
+	movl	L_OPENSSL_ia32cap_P$non_lazy_ptr-L001K512(%ebp),%edx
+	movl	(%edx),%ecx
+	testl	$67108864,%ecx
+	jz	L002loop_x86
+	movl	4(%edx),%edx
+	movq	(%esi),%mm0
+	andl	$16777216,%ecx
+	movq	8(%esi),%mm1
+	andl	$512,%edx
+	movq	16(%esi),%mm2
+	orl	%edx,%ecx
+	movq	24(%esi),%mm3
+	movq	32(%esi),%mm4
+	movq	40(%esi),%mm5
+	movq	48(%esi),%mm6
+	movq	56(%esi),%mm7
+	cmpl	$16777728,%ecx
+	je	L003SSSE3
+	subl	$80,%esp
+	jmp	L004loop_sse2
+.align	4,0x90
+L004loop_sse2:
+	movq	%mm1,8(%esp)
+	movq	%mm2,16(%esp)
+	movq	%mm3,24(%esp)
+	movq	%mm5,40(%esp)
+	movq	%mm6,48(%esp)
+	pxor	%mm1,%mm2
+	movq	%mm7,56(%esp)
+	movq	%mm0,%mm3
+	movl	(%edi),%eax
+	movl	4(%edi),%ebx
+	addl	$8,%edi
+	movl	$15,%edx
+	bswap	%eax
+	bswap	%ebx
+	jmp	L00500_14_sse2
+.align	4,0x90
+L00500_14_sse2:
+	movd	%eax,%mm1
+	movl	(%edi),%eax
+	movd	%ebx,%mm7
+	movl	4(%edi),%ebx
+	addl	$8,%edi
+	bswap	%eax
+	bswap	%ebx
+	punpckldq	%mm1,%mm7
+	movq	%mm4,%mm1
+	pxor	%mm6,%mm5
+	psrlq	$14,%mm1
+	movq	%mm4,32(%esp)
+	pand	%mm4,%mm5
+	psllq	$23,%mm4
+	movq	%mm3,%mm0
+	movq	%mm7,72(%esp)
+	movq	%mm1,%mm3
+	psrlq	$4,%mm1
+	pxor	%mm6,%mm5
+	pxor	%mm4,%mm3
+	psllq	$23,%mm4
+	pxor	%mm1,%mm3
+	movq	%mm0,(%esp)
+	paddq	%mm5,%mm7
+	pxor	%mm4,%mm3
+	psrlq	$23,%mm1
+	paddq	56(%esp),%mm7
+	pxor	%mm1,%mm3
+	psllq	$4,%mm4
+	paddq	(%ebp),%mm7
+	pxor	%mm4,%mm3
+	movq	24(%esp),%mm4
+	paddq	%mm7,%mm3
+	movq	%mm0,%mm5
+	psrlq	$28,%mm5
+	paddq	%mm3,%mm4
+	movq	%mm0,%mm6
+	movq	%mm5,%mm7
+	psllq	$25,%mm6
+	movq	8(%esp),%mm1
+	psrlq	$6,%mm5
+	pxor	%mm6,%mm7
+	subl	$8,%esp
+	psllq	$5,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm0
+	psrlq	$5,%mm5
+	pxor	%mm6,%mm7
+	pand	%mm0,%mm2
+	psllq	$6,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm2
+	pxor	%mm7,%mm6
+	movq	40(%esp),%mm5
+	paddq	%mm2,%mm3
+	movq	%mm0,%mm2
+	addl	$8,%ebp
+	paddq	%mm6,%mm3
+	movq	48(%esp),%mm6
+	decl	%edx
+	jnz	L00500_14_sse2
+	movd	%eax,%mm1
+	movd	%ebx,%mm7
+	punpckldq	%mm1,%mm7
+	movq	%mm4,%mm1
+	pxor	%mm6,%mm5
+	psrlq	$14,%mm1
+	movq	%mm4,32(%esp)
+	pand	%mm4,%mm5
+	psllq	$23,%mm4
+	movq	%mm3,%mm0
+	movq	%mm7,72(%esp)
+	movq	%mm1,%mm3
+	psrlq	$4,%mm1
+	pxor	%mm6,%mm5
+	pxor	%mm4,%mm3
+	psllq	$23,%mm4
+	pxor	%mm1,%mm3
+	movq	%mm0,(%esp)
+	paddq	%mm5,%mm7
+	pxor	%mm4,%mm3
+	psrlq	$23,%mm1
+	paddq	56(%esp),%mm7
+	pxor	%mm1,%mm3
+	psllq	$4,%mm4
+	paddq	(%ebp),%mm7
+	pxor	%mm4,%mm3
+	movq	24(%esp),%mm4
+	paddq	%mm7,%mm3
+	movq	%mm0,%mm5
+	psrlq	$28,%mm5
+	paddq	%mm3,%mm4
+	movq	%mm0,%mm6
+	movq	%mm5,%mm7
+	psllq	$25,%mm6
+	movq	8(%esp),%mm1
+	psrlq	$6,%mm5
+	pxor	%mm6,%mm7
+	subl	$8,%esp
+	psllq	$5,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm0
+	psrlq	$5,%mm5
+	pxor	%mm6,%mm7
+	pand	%mm0,%mm2
+	psllq	$6,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm2
+	pxor	%mm7,%mm6
+	movq	192(%esp),%mm7
+	paddq	%mm2,%mm3
+	movq	%mm0,%mm2
+	addl	$8,%ebp
+	paddq	%mm6,%mm3
+	pxor	%mm0,%mm0
+	movl	$32,%edx
+	jmp	L00616_79_sse2
+.align	4,0x90
+L00616_79_sse2:
+	movq	88(%esp),%mm5
+	movq	%mm7,%mm1
+	psrlq	$1,%mm7
+	movq	%mm5,%mm6
+	psrlq	$6,%mm5
+	psllq	$56,%mm1
+	paddq	%mm3,%mm0
+	movq	%mm7,%mm3
+	psrlq	$6,%mm7
+	pxor	%mm1,%mm3
+	psllq	$7,%mm1
+	pxor	%mm7,%mm3
+	psrlq	$1,%mm7
+	pxor	%mm1,%mm3
+	movq	%mm5,%mm1
+	psrlq	$13,%mm5
+	pxor	%mm3,%mm7
+	psllq	$3,%mm6
+	pxor	%mm5,%mm1
+	paddq	200(%esp),%mm7
+	pxor	%mm6,%mm1
+	psrlq	$42,%mm5
+	paddq	128(%esp),%mm7
+	pxor	%mm5,%mm1
+	psllq	$42,%mm6
+	movq	40(%esp),%mm5
+	pxor	%mm6,%mm1
+	movq	48(%esp),%mm6
+	paddq	%mm1,%mm7
+	movq	%mm4,%mm1
+	pxor	%mm6,%mm5
+	psrlq	$14,%mm1
+	movq	%mm4,32(%esp)
+	pand	%mm4,%mm5
+	psllq	$23,%mm4
+	movq	%mm7,72(%esp)
+	movq	%mm1,%mm3
+	psrlq	$4,%mm1
+	pxor	%mm6,%mm5
+	pxor	%mm4,%mm3
+	psllq	$23,%mm4
+	pxor	%mm1,%mm3
+	movq	%mm0,(%esp)
+	paddq	%mm5,%mm7
+	pxor	%mm4,%mm3
+	psrlq	$23,%mm1
+	paddq	56(%esp),%mm7
+	pxor	%mm1,%mm3
+	psllq	$4,%mm4
+	paddq	(%ebp),%mm7
+	pxor	%mm4,%mm3
+	movq	24(%esp),%mm4
+	paddq	%mm7,%mm3
+	movq	%mm0,%mm5
+	psrlq	$28,%mm5
+	paddq	%mm3,%mm4
+	movq	%mm0,%mm6
+	movq	%mm5,%mm7
+	psllq	$25,%mm6
+	movq	8(%esp),%mm1
+	psrlq	$6,%mm5
+	pxor	%mm6,%mm7
+	subl	$8,%esp
+	psllq	$5,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm0
+	psrlq	$5,%mm5
+	pxor	%mm6,%mm7
+	pand	%mm0,%mm2
+	psllq	$6,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm2
+	pxor	%mm7,%mm6
+	movq	192(%esp),%mm7
+	paddq	%mm6,%mm2
+	addl	$8,%ebp
+	movq	88(%esp),%mm5
+	movq	%mm7,%mm1
+	psrlq	$1,%mm7
+	movq	%mm5,%mm6
+	psrlq	$6,%mm5
+	psllq	$56,%mm1
+	paddq	%mm3,%mm2
+	movq	%mm7,%mm3
+	psrlq	$6,%mm7
+	pxor	%mm1,%mm3
+	psllq	$7,%mm1
+	pxor	%mm7,%mm3
+	psrlq	$1,%mm7
+	pxor	%mm1,%mm3
+	movq	%mm5,%mm1
+	psrlq	$13,%mm5
+	pxor	%mm3,%mm7
+	psllq	$3,%mm6
+	pxor	%mm5,%mm1
+	paddq	200(%esp),%mm7
+	pxor	%mm6,%mm1
+	psrlq	$42,%mm5
+	paddq	128(%esp),%mm7
+	pxor	%mm5,%mm1
+	psllq	$42,%mm6
+	movq	40(%esp),%mm5
+	pxor	%mm6,%mm1
+	movq	48(%esp),%mm6
+	paddq	%mm1,%mm7
+	movq	%mm4,%mm1
+	pxor	%mm6,%mm5
+	psrlq	$14,%mm1
+	movq	%mm4,32(%esp)
+	pand	%mm4,%mm5
+	psllq	$23,%mm4
+	movq	%mm7,72(%esp)
+	movq	%mm1,%mm3
+	psrlq	$4,%mm1
+	pxor	%mm6,%mm5
+	pxor	%mm4,%mm3
+	psllq	$23,%mm4
+	pxor	%mm1,%mm3
+	movq	%mm2,(%esp)
+	paddq	%mm5,%mm7
+	pxor	%mm4,%mm3
+	psrlq	$23,%mm1
+	paddq	56(%esp),%mm7
+	pxor	%mm1,%mm3
+	psllq	$4,%mm4
+	paddq	(%ebp),%mm7
+	pxor	%mm4,%mm3
+	movq	24(%esp),%mm4
+	paddq	%mm7,%mm3
+	movq	%mm2,%mm5
+	psrlq	$28,%mm5
+	paddq	%mm3,%mm4
+	movq	%mm2,%mm6
+	movq	%mm5,%mm7
+	psllq	$25,%mm6
+	movq	8(%esp),%mm1
+	psrlq	$6,%mm5
+	pxor	%mm6,%mm7
+	subl	$8,%esp
+	psllq	$5,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm2
+	psrlq	$5,%mm5
+	pxor	%mm6,%mm7
+	pand	%mm2,%mm0
+	psllq	$6,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm0
+	pxor	%mm7,%mm6
+	movq	192(%esp),%mm7
+	paddq	%mm6,%mm0
+	addl	$8,%ebp
+	decl	%edx
+	jnz	L00616_79_sse2
+	paddq	%mm3,%mm0
+	movq	8(%esp),%mm1
+	movq	24(%esp),%mm3
+	movq	40(%esp),%mm5
+	movq	48(%esp),%mm6
+	movq	56(%esp),%mm7
+	pxor	%mm1,%mm2
+	paddq	(%esi),%mm0
+	paddq	8(%esi),%mm1
+	paddq	16(%esi),%mm2
+	paddq	24(%esi),%mm3
+	paddq	32(%esi),%mm4
+	paddq	40(%esi),%mm5
+	paddq	48(%esi),%mm6
+	paddq	56(%esi),%mm7
+	movl	$640,%eax
+	movq	%mm0,(%esi)
+	movq	%mm1,8(%esi)
+	movq	%mm2,16(%esi)
+	movq	%mm3,24(%esi)
+	movq	%mm4,32(%esi)
+	movq	%mm5,40(%esi)
+	movq	%mm6,48(%esi)
+	movq	%mm7,56(%esi)
+	leal	(%esp,%eax,1),%esp
+	subl	%eax,%ebp
+	cmpl	88(%esp),%edi
+	jb	L004loop_sse2
+	movl	92(%esp),%esp
+	emms
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.align	5,0x90
+L003SSSE3:
+	leal	-64(%esp),%edx
+	subl	$256,%esp
+	movdqa	640(%ebp),%xmm1
+	movdqu	(%edi),%xmm0
+.byte	102,15,56,0,193
+	movdqa	(%ebp),%xmm3
+	movdqa	%xmm1,%xmm2
+	movdqu	16(%edi),%xmm1
+	paddq	%xmm0,%xmm3
+.byte	102,15,56,0,202
+	movdqa	%xmm3,-128(%edx)
+	movdqa	16(%ebp),%xmm4
+	movdqa	%xmm2,%xmm3
+	movdqu	32(%edi),%xmm2
+	paddq	%xmm1,%xmm4
+.byte	102,15,56,0,211
+	movdqa	%xmm4,-112(%edx)
+	movdqa	32(%ebp),%xmm5
+	movdqa	%xmm3,%xmm4
+	movdqu	48(%edi),%xmm3
+	paddq	%xmm2,%xmm5
+.byte	102,15,56,0,220
+	movdqa	%xmm5,-96(%edx)
+	movdqa	48(%ebp),%xmm6
+	movdqa	%xmm4,%xmm5
+	movdqu	64(%edi),%xmm4
+	paddq	%xmm3,%xmm6
+.byte	102,15,56,0,229
+	movdqa	%xmm6,-80(%edx)
+	movdqa	64(%ebp),%xmm7
+	movdqa	%xmm5,%xmm6
+	movdqu	80(%edi),%xmm5
+	paddq	%xmm4,%xmm7
+.byte	102,15,56,0,238
+	movdqa	%xmm7,-64(%edx)
+	movdqa	%xmm0,(%edx)
+	movdqa	80(%ebp),%xmm0
+	movdqa	%xmm6,%xmm7
+	movdqu	96(%edi),%xmm6
+	paddq	%xmm5,%xmm0
+.byte	102,15,56,0,247
+	movdqa	%xmm0,-48(%edx)
+	movdqa	%xmm1,16(%edx)
+	movdqa	96(%ebp),%xmm1
+	movdqa	%xmm7,%xmm0
+	movdqu	112(%edi),%xmm7
+	paddq	%xmm6,%xmm1
+.byte	102,15,56,0,248
+	movdqa	%xmm1,-32(%edx)
+	movdqa	%xmm2,32(%edx)
+	movdqa	112(%ebp),%xmm2
+	movdqa	(%edx),%xmm0
+	paddq	%xmm7,%xmm2
+	movdqa	%xmm2,-16(%edx)
+	nop
+.align	5,0x90
+L007loop_ssse3:
+	movdqa	16(%edx),%xmm2
+	movdqa	%xmm3,48(%edx)
+	leal	128(%ebp),%ebp
+	movq	%mm1,8(%esp)
+	movl	%edi,%ebx
+	movq	%mm2,16(%esp)
+	leal	128(%edi),%edi
+	movq	%mm3,24(%esp)
+	cmpl	%eax,%edi
+	movq	%mm5,40(%esp)
+	cmovbl	%edi,%ebx
+	movq	%mm6,48(%esp)
+	movl	$4,%ecx
+	pxor	%mm1,%mm2
+	movq	%mm7,56(%esp)
+	pxor	%mm3,%mm3
+	jmp	L00800_47_ssse3
+.align	5,0x90
+L00800_47_ssse3:
+	movdqa	%xmm5,%xmm3
+	movdqa	%xmm2,%xmm1
+.byte	102,15,58,15,208,8
+	movdqa	%xmm4,(%edx)
+.byte	102,15,58,15,220,8
+	movdqa	%xmm2,%xmm4
+	psrlq	$7,%xmm2
+	paddq	%xmm3,%xmm0
+	movdqa	%xmm4,%xmm3
+	psrlq	$1,%xmm4
+	psllq	$56,%xmm3
+	pxor	%xmm4,%xmm2
+	psrlq	$7,%xmm4
+	pxor	%xmm3,%xmm2
+	psllq	$7,%xmm3
+	pxor	%xmm4,%xmm2
+	movdqa	%xmm7,%xmm4
+	pxor	%xmm3,%xmm2
+	movdqa	%xmm7,%xmm3
+	psrlq	$6,%xmm4
+	paddq	%xmm2,%xmm0
+	movdqa	%xmm7,%xmm2
+	psrlq	$19,%xmm3
+	psllq	$3,%xmm2
+	pxor	%xmm3,%xmm4
+	psrlq	$42,%xmm3
+	pxor	%xmm2,%xmm4
+	psllq	$42,%xmm2
+	pxor	%xmm3,%xmm4
+	movdqa	32(%edx),%xmm3
+	pxor	%xmm2,%xmm4
+	movdqa	(%ebp),%xmm2
+	movq	%mm4,%mm1
+	paddq	%xmm4,%xmm0
+	movq	-128(%edx),%mm7
+	pxor	%mm6,%mm5
+	psrlq	$14,%mm1
+	movq	%mm4,32(%esp)
+	paddq	%xmm0,%xmm2
+	pand	%mm4,%mm5
+	psllq	$23,%mm4
+	paddq	%mm3,%mm0
+	movq	%mm1,%mm3
+	psrlq	$4,%mm1
+	pxor	%mm6,%mm5
+	pxor	%mm4,%mm3
+	psllq	$23,%mm4
+	pxor	%mm1,%mm3
+	movq	%mm0,(%esp)
+	paddq	%mm5,%mm7
+	pxor	%mm4,%mm3
+	psrlq	$23,%mm1
+	paddq	56(%esp),%mm7
+	pxor	%mm1,%mm3
+	psllq	$4,%mm4
+	pxor	%mm4,%mm3
+	movq	24(%esp),%mm4
+	paddq	%mm7,%mm3
+	movq	%mm0,%mm5
+	psrlq	$28,%mm5
+	paddq	%mm3,%mm4
+	movq	%mm0,%mm6
+	movq	%mm5,%mm7
+	psllq	$25,%mm6
+	movq	8(%esp),%mm1
+	psrlq	$6,%mm5
+	pxor	%mm6,%mm7
+	psllq	$5,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm0
+	psrlq	$5,%mm5
+	pxor	%mm6,%mm7
+	pand	%mm0,%mm2
+	psllq	$6,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm2
+	pxor	%mm7,%mm6
+	movq	32(%esp),%mm5
+	paddq	%mm6,%mm2
+	movq	40(%esp),%mm6
+	movq	%mm4,%mm1
+	movq	-120(%edx),%mm7
+	pxor	%mm6,%mm5
+	psrlq	$14,%mm1
+	movq	%mm4,24(%esp)
+	pand	%mm4,%mm5
+	psllq	$23,%mm4
+	paddq	%mm3,%mm2
+	movq	%mm1,%mm3
+	psrlq	$4,%mm1
+	pxor	%mm6,%mm5
+	pxor	%mm4,%mm3
+	psllq	$23,%mm4
+	pxor	%mm1,%mm3
+	movq	%mm2,56(%esp)
+	paddq	%mm5,%mm7
+	pxor	%mm4,%mm3
+	psrlq	$23,%mm1
+	paddq	48(%esp),%mm7
+	pxor	%mm1,%mm3
+	psllq	$4,%mm4
+	pxor	%mm4,%mm3
+	movq	16(%esp),%mm4
+	paddq	%mm7,%mm3
+	movq	%mm2,%mm5
+	psrlq	$28,%mm5
+	paddq	%mm3,%mm4
+	movq	%mm2,%mm6
+	movq	%mm5,%mm7
+	psllq	$25,%mm6
+	movq	(%esp),%mm1
+	psrlq	$6,%mm5
+	pxor	%mm6,%mm7
+	psllq	$5,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm2
+	psrlq	$5,%mm5
+	pxor	%mm6,%mm7
+	pand	%mm2,%mm0
+	psllq	$6,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm0
+	pxor	%mm7,%mm6
+	movq	24(%esp),%mm5
+	paddq	%mm6,%mm0
+	movq	32(%esp),%mm6
+	movdqa	%xmm2,-128(%edx)
+	movdqa	%xmm6,%xmm4
+	movdqa	%xmm3,%xmm2
+.byte	102,15,58,15,217,8
+	movdqa	%xmm5,16(%edx)
+.byte	102,15,58,15,229,8
+	movdqa	%xmm3,%xmm5
+	psrlq	$7,%xmm3
+	paddq	%xmm4,%xmm1
+	movdqa	%xmm5,%xmm4
+	psrlq	$1,%xmm5
+	psllq	$56,%xmm4
+	pxor	%xmm5,%xmm3
+	psrlq	$7,%xmm5
+	pxor	%xmm4,%xmm3
+	psllq	$7,%xmm4
+	pxor	%xmm5,%xmm3
+	movdqa	%xmm0,%xmm5
+	pxor	%xmm4,%xmm3
+	movdqa	%xmm0,%xmm4
+	psrlq	$6,%xmm5
+	paddq	%xmm3,%xmm1
+	movdqa	%xmm0,%xmm3
+	psrlq	$19,%xmm4
+	psllq	$3,%xmm3
+	pxor	%xmm4,%xmm5
+	psrlq	$42,%xmm4
+	pxor	%xmm3,%xmm5
+	psllq	$42,%xmm3
+	pxor	%xmm4,%xmm5
+	movdqa	48(%edx),%xmm4
+	pxor	%xmm3,%xmm5
+	movdqa	16(%ebp),%xmm3
+	movq	%mm4,%mm1
+	paddq	%xmm5,%xmm1
+	movq	-112(%edx),%mm7
+	pxor	%mm6,%mm5
+	psrlq	$14,%mm1
+	movq	%mm4,16(%esp)
+	paddq	%xmm1,%xmm3
+	pand	%mm4,%mm5
+	psllq	$23,%mm4
+	paddq	%mm3,%mm0
+	movq	%mm1,%mm3
+	psrlq	$4,%mm1
+	pxor	%mm6,%mm5
+	pxor	%mm4,%mm3
+	psllq	$23,%mm4
+	pxor	%mm1,%mm3
+	movq	%mm0,48(%esp)
+	paddq	%mm5,%mm7
+	pxor	%mm4,%mm3
+	psrlq	$23,%mm1
+	paddq	40(%esp),%mm7
+	pxor	%mm1,%mm3
+	psllq	$4,%mm4
+	pxor	%mm4,%mm3
+	movq	8(%esp),%mm4
+	paddq	%mm7,%mm3
+	movq	%mm0,%mm5
+	psrlq	$28,%mm5
+	paddq	%mm3,%mm4
+	movq	%mm0,%mm6
+	movq	%mm5,%mm7
+	psllq	$25,%mm6
+	movq	56(%esp),%mm1
+	psrlq	$6,%mm5
+	pxor	%mm6,%mm7
+	psllq	$5,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm0
+	psrlq	$5,%mm5
+	pxor	%mm6,%mm7
+	pand	%mm0,%mm2
+	psllq	$6,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm2
+	pxor	%mm7,%mm6
+	movq	16(%esp),%mm5
+	paddq	%mm6,%mm2
+	movq	24(%esp),%mm6
+	movq	%mm4,%mm1
+	movq	-104(%edx),%mm7
+	pxor	%mm6,%mm5
+	psrlq	$14,%mm1
+	movq	%mm4,8(%esp)
+	pand	%mm4,%mm5
+	psllq	$23,%mm4
+	paddq	%mm3,%mm2
+	movq	%mm1,%mm3
+	psrlq	$4,%mm1
+	pxor	%mm6,%mm5
+	pxor	%mm4,%mm3
+	psllq	$23,%mm4
+	pxor	%mm1,%mm3
+	movq	%mm2,40(%esp)
+	paddq	%mm5,%mm7
+	pxor	%mm4,%mm3
+	psrlq	$23,%mm1
+	paddq	32(%esp),%mm7
+	pxor	%mm1,%mm3
+	psllq	$4,%mm4
+	pxor	%mm4,%mm3
+	movq	(%esp),%mm4
+	paddq	%mm7,%mm3
+	movq	%mm2,%mm5
+	psrlq	$28,%mm5
+	paddq	%mm3,%mm4
+	movq	%mm2,%mm6
+	movq	%mm5,%mm7
+	psllq	$25,%mm6
+	movq	48(%esp),%mm1
+	psrlq	$6,%mm5
+	pxor	%mm6,%mm7
+	psllq	$5,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm2
+	psrlq	$5,%mm5
+	pxor	%mm6,%mm7
+	pand	%mm2,%mm0
+	psllq	$6,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm0
+	pxor	%mm7,%mm6
+	movq	8(%esp),%mm5
+	paddq	%mm6,%mm0
+	movq	16(%esp),%mm6
+	movdqa	%xmm3,-112(%edx)
+	movdqa	%xmm7,%xmm5
+	movdqa	%xmm4,%xmm3
+.byte	102,15,58,15,226,8
+	movdqa	%xmm6,32(%edx)
+.byte	102,15,58,15,238,8
+	movdqa	%xmm4,%xmm6
+	psrlq	$7,%xmm4
+	paddq	%xmm5,%xmm2
+	movdqa	%xmm6,%xmm5
+	psrlq	$1,%xmm6
+	psllq	$56,%xmm5
+	pxor	%xmm6,%xmm4
+	psrlq	$7,%xmm6
+	pxor	%xmm5,%xmm4
+	psllq	$7,%xmm5
+	pxor	%xmm6,%xmm4
+	movdqa	%xmm1,%xmm6
+	pxor	%xmm5,%xmm4
+	movdqa	%xmm1,%xmm5
+	psrlq	$6,%xmm6
+	paddq	%xmm4,%xmm2
+	movdqa	%xmm1,%xmm4
+	psrlq	$19,%xmm5
+	psllq	$3,%xmm4
+	pxor	%xmm5,%xmm6
+	psrlq	$42,%xmm5
+	pxor	%xmm4,%xmm6
+	psllq	$42,%xmm4
+	pxor	%xmm5,%xmm6
+	movdqa	(%edx),%xmm5
+	pxor	%xmm4,%xmm6
+	movdqa	32(%ebp),%xmm4
+	movq	%mm4,%mm1
+	paddq	%xmm6,%xmm2
+	movq	-96(%edx),%mm7
+	pxor	%mm6,%mm5
+	psrlq	$14,%mm1
+	movq	%mm4,(%esp)
+	paddq	%xmm2,%xmm4
+	pand	%mm4,%mm5
+	psllq	$23,%mm4
+	paddq	%mm3,%mm0
+	movq	%mm1,%mm3
+	psrlq	$4,%mm1
+	pxor	%mm6,%mm5
+	pxor	%mm4,%mm3
+	psllq	$23,%mm4
+	pxor	%mm1,%mm3
+	movq	%mm0,32(%esp)
+	paddq	%mm5,%mm7
+	pxor	%mm4,%mm3
+	psrlq	$23,%mm1
+	paddq	24(%esp),%mm7
+	pxor	%mm1,%mm3
+	psllq	$4,%mm4
+	pxor	%mm4,%mm3
+	movq	56(%esp),%mm4
+	paddq	%mm7,%mm3
+	movq	%mm0,%mm5
+	psrlq	$28,%mm5
+	paddq	%mm3,%mm4
+	movq	%mm0,%mm6
+	movq	%mm5,%mm7
+	psllq	$25,%mm6
+	movq	40(%esp),%mm1
+	psrlq	$6,%mm5
+	pxor	%mm6,%mm7
+	psllq	$5,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm0
+	psrlq	$5,%mm5
+	pxor	%mm6,%mm7
+	pand	%mm0,%mm2
+	psllq	$6,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm2
+	pxor	%mm7,%mm6
+	movq	(%esp),%mm5
+	paddq	%mm6,%mm2
+	movq	8(%esp),%mm6
+	movq	%mm4,%mm1
+	movq	-88(%edx),%mm7
+	pxor	%mm6,%mm5
+	psrlq	$14,%mm1
+	movq	%mm4,56(%esp)
+	pand	%mm4,%mm5
+	psllq	$23,%mm4
+	paddq	%mm3,%mm2
+	movq	%mm1,%mm3
+	psrlq	$4,%mm1
+	pxor	%mm6,%mm5
+	pxor	%mm4,%mm3
+	psllq	$23,%mm4
+	pxor	%mm1,%mm3
+	movq	%mm2,24(%esp)
+	paddq	%mm5,%mm7
+	pxor	%mm4,%mm3
+	psrlq	$23,%mm1
+	paddq	16(%esp),%mm7
+	pxor	%mm1,%mm3
+	psllq	$4,%mm4
+	pxor	%mm4,%mm3
+	movq	48(%esp),%mm4
+	paddq	%mm7,%mm3
+	movq	%mm2,%mm5
+	psrlq	$28,%mm5
+	paddq	%mm3,%mm4
+	movq	%mm2,%mm6
+	movq	%mm5,%mm7
+	psllq	$25,%mm6
+	movq	32(%esp),%mm1
+	psrlq	$6,%mm5
+	pxor	%mm6,%mm7
+	psllq	$5,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm2
+	psrlq	$5,%mm5
+	pxor	%mm6,%mm7
+	pand	%mm2,%mm0
+	psllq	$6,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm0
+	pxor	%mm7,%mm6
+	movq	56(%esp),%mm5
+	paddq	%mm6,%mm0
+	movq	(%esp),%mm6
+	movdqa	%xmm4,-96(%edx)
+	movdqa	%xmm0,%xmm6
+	movdqa	%xmm5,%xmm4
+.byte	102,15,58,15,235,8
+	movdqa	%xmm7,48(%edx)
+.byte	102,15,58,15,247,8
+	movdqa	%xmm5,%xmm7
+	psrlq	$7,%xmm5
+	paddq	%xmm6,%xmm3
+	movdqa	%xmm7,%xmm6
+	psrlq	$1,%xmm7
+	psllq	$56,%xmm6
+	pxor	%xmm7,%xmm5
+	psrlq	$7,%xmm7
+	pxor	%xmm6,%xmm5
+	psllq	$7,%xmm6
+	pxor	%xmm7,%xmm5
+	movdqa	%xmm2,%xmm7
+	pxor	%xmm6,%xmm5
+	movdqa	%xmm2,%xmm6
+	psrlq	$6,%xmm7
+	paddq	%xmm5,%xmm3
+	movdqa	%xmm2,%xmm5
+	psrlq	$19,%xmm6
+	psllq	$3,%xmm5
+	pxor	%xmm6,%xmm7
+	psrlq	$42,%xmm6
+	pxor	%xmm5,%xmm7
+	psllq	$42,%xmm5
+	pxor	%xmm6,%xmm7
+	movdqa	16(%edx),%xmm6
+	pxor	%xmm5,%xmm7
+	movdqa	48(%ebp),%xmm5
+	movq	%mm4,%mm1
+	paddq	%xmm7,%xmm3
+	movq	-80(%edx),%mm7
+	pxor	%mm6,%mm5
+	psrlq	$14,%mm1
+	movq	%mm4,48(%esp)
+	paddq	%xmm3,%xmm5
+	pand	%mm4,%mm5
+	psllq	$23,%mm4
+	paddq	%mm3,%mm0
+	movq	%mm1,%mm3
+	psrlq	$4,%mm1
+	pxor	%mm6,%mm5
+	pxor	%mm4,%mm3
+	psllq	$23,%mm4
+	pxor	%mm1,%mm3
+	movq	%mm0,16(%esp)
+	paddq	%mm5,%mm7
+	pxor	%mm4,%mm3
+	psrlq	$23,%mm1
+	paddq	8(%esp),%mm7
+	pxor	%mm1,%mm3
+	psllq	$4,%mm4
+	pxor	%mm4,%mm3
+	movq	40(%esp),%mm4
+	paddq	%mm7,%mm3
+	movq	%mm0,%mm5
+	psrlq	$28,%mm5
+	paddq	%mm3,%mm4
+	movq	%mm0,%mm6
+	movq	%mm5,%mm7
+	psllq	$25,%mm6
+	movq	24(%esp),%mm1
+	psrlq	$6,%mm5
+	pxor	%mm6,%mm7
+	psllq	$5,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm0
+	psrlq	$5,%mm5
+	pxor	%mm6,%mm7
+	pand	%mm0,%mm2
+	psllq	$6,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm2
+	pxor	%mm7,%mm6
+	movq	48(%esp),%mm5
+	paddq	%mm6,%mm2
+	movq	56(%esp),%mm6
+	movq	%mm4,%mm1
+	movq	-72(%edx),%mm7
+	pxor	%mm6,%mm5
+	psrlq	$14,%mm1
+	movq	%mm4,40(%esp)
+	pand	%mm4,%mm5
+	psllq	$23,%mm4
+	paddq	%mm3,%mm2
+	movq	%mm1,%mm3
+	psrlq	$4,%mm1
+	pxor	%mm6,%mm5
+	pxor	%mm4,%mm3
+	psllq	$23,%mm4
+	pxor	%mm1,%mm3
+	movq	%mm2,8(%esp)
+	paddq	%mm5,%mm7
+	pxor	%mm4,%mm3
+	psrlq	$23,%mm1
+	paddq	(%esp),%mm7
+	pxor	%mm1,%mm3
+	psllq	$4,%mm4
+	pxor	%mm4,%mm3
+	movq	32(%esp),%mm4
+	paddq	%mm7,%mm3
+	movq	%mm2,%mm5
+	psrlq	$28,%mm5
+	paddq	%mm3,%mm4
+	movq	%mm2,%mm6
+	movq	%mm5,%mm7
+	psllq	$25,%mm6
+	movq	16(%esp),%mm1
+	psrlq	$6,%mm5
+	pxor	%mm6,%mm7
+	psllq	$5,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm2
+	psrlq	$5,%mm5
+	pxor	%mm6,%mm7
+	pand	%mm2,%mm0
+	psllq	$6,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm0
+	pxor	%mm7,%mm6
+	movq	40(%esp),%mm5
+	paddq	%mm6,%mm0
+	movq	48(%esp),%mm6
+	movdqa	%xmm5,-80(%edx)
+	movdqa	%xmm1,%xmm7
+	movdqa	%xmm6,%xmm5
+.byte	102,15,58,15,244,8
+	movdqa	%xmm0,(%edx)
+.byte	102,15,58,15,248,8
+	movdqa	%xmm6,%xmm0
+	psrlq	$7,%xmm6
+	paddq	%xmm7,%xmm4
+	movdqa	%xmm0,%xmm7
+	psrlq	$1,%xmm0
+	psllq	$56,%xmm7
+	pxor	%xmm0,%xmm6
+	psrlq	$7,%xmm0
+	pxor	%xmm7,%xmm6
+	psllq	$7,%xmm7
+	pxor	%xmm0,%xmm6
+	movdqa	%xmm3,%xmm0
+	pxor	%xmm7,%xmm6
+	movdqa	%xmm3,%xmm7
+	psrlq	$6,%xmm0
+	paddq	%xmm6,%xmm4
+	movdqa	%xmm3,%xmm6
+	psrlq	$19,%xmm7
+	psllq	$3,%xmm6
+	pxor	%xmm7,%xmm0
+	psrlq	$42,%xmm7
+	pxor	%xmm6,%xmm0
+	psllq	$42,%xmm6
+	pxor	%xmm7,%xmm0
+	movdqa	32(%edx),%xmm7
+	pxor	%xmm6,%xmm0
+	movdqa	64(%ebp),%xmm6
+	movq	%mm4,%mm1
+	paddq	%xmm0,%xmm4
+	movq	-64(%edx),%mm7
+	pxor	%mm6,%mm5
+	psrlq	$14,%mm1
+	movq	%mm4,32(%esp)
+	paddq	%xmm4,%xmm6
+	pand	%mm4,%mm5
+	psllq	$23,%mm4
+	paddq	%mm3,%mm0
+	movq	%mm1,%mm3
+	psrlq	$4,%mm1
+	pxor	%mm6,%mm5
+	pxor	%mm4,%mm3
+	psllq	$23,%mm4
+	pxor	%mm1,%mm3
+	movq	%mm0,(%esp)
+	paddq	%mm5,%mm7
+	pxor	%mm4,%mm3
+	psrlq	$23,%mm1
+	paddq	56(%esp),%mm7
+	pxor	%mm1,%mm3
+	psllq	$4,%mm4
+	pxor	%mm4,%mm3
+	movq	24(%esp),%mm4
+	paddq	%mm7,%mm3
+	movq	%mm0,%mm5
+	psrlq	$28,%mm5
+	paddq	%mm3,%mm4
+	movq	%mm0,%mm6
+	movq	%mm5,%mm7
+	psllq	$25,%mm6
+	movq	8(%esp),%mm1
+	psrlq	$6,%mm5
+	pxor	%mm6,%mm7
+	psllq	$5,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm0
+	psrlq	$5,%mm5
+	pxor	%mm6,%mm7
+	pand	%mm0,%mm2
+	psllq	$6,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm2
+	pxor	%mm7,%mm6
+	movq	32(%esp),%mm5
+	paddq	%mm6,%mm2
+	movq	40(%esp),%mm6
+	movq	%mm4,%mm1
+	movq	-56(%edx),%mm7
+	pxor	%mm6,%mm5
+	psrlq	$14,%mm1
+	movq	%mm4,24(%esp)
+	pand	%mm4,%mm5
+	psllq	$23,%mm4
+	paddq	%mm3,%mm2
+	movq	%mm1,%mm3
+	psrlq	$4,%mm1
+	pxor	%mm6,%mm5
+	pxor	%mm4,%mm3
+	psllq	$23,%mm4
+	pxor	%mm1,%mm3
+	movq	%mm2,56(%esp)
+	paddq	%mm5,%mm7
+	pxor	%mm4,%mm3
+	psrlq	$23,%mm1
+	paddq	48(%esp),%mm7
+	pxor	%mm1,%mm3
+	psllq	$4,%mm4
+	pxor	%mm4,%mm3
+	movq	16(%esp),%mm4
+	paddq	%mm7,%mm3
+	movq	%mm2,%mm5
+	psrlq	$28,%mm5
+	paddq	%mm3,%mm4
+	movq	%mm2,%mm6
+	movq	%mm5,%mm7
+	psllq	$25,%mm6
+	movq	(%esp),%mm1
+	psrlq	$6,%mm5
+	pxor	%mm6,%mm7
+	psllq	$5,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm2
+	psrlq	$5,%mm5
+	pxor	%mm6,%mm7
+	pand	%mm2,%mm0
+	psllq	$6,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm0
+	pxor	%mm7,%mm6
+	movq	24(%esp),%mm5
+	paddq	%mm6,%mm0
+	movq	32(%esp),%mm6
+	movdqa	%xmm6,-64(%edx)
+	movdqa	%xmm2,%xmm0
+	movdqa	%xmm7,%xmm6
+.byte	102,15,58,15,253,8
+	movdqa	%xmm1,16(%edx)
+.byte	102,15,58,15,193,8
+	movdqa	%xmm7,%xmm1
+	psrlq	$7,%xmm7
+	paddq	%xmm0,%xmm5
+	movdqa	%xmm1,%xmm0
+	psrlq	$1,%xmm1
+	psllq	$56,%xmm0
+	pxor	%xmm1,%xmm7
+	psrlq	$7,%xmm1
+	pxor	%xmm0,%xmm7
+	psllq	$7,%xmm0
+	pxor	%xmm1,%xmm7
+	movdqa	%xmm4,%xmm1
+	pxor	%xmm0,%xmm7
+	movdqa	%xmm4,%xmm0
+	psrlq	$6,%xmm1
+	paddq	%xmm7,%xmm5
+	movdqa	%xmm4,%xmm7
+	psrlq	$19,%xmm0
+	psllq	$3,%xmm7
+	pxor	%xmm0,%xmm1
+	psrlq	$42,%xmm0
+	pxor	%xmm7,%xmm1
+	psllq	$42,%xmm7
+	pxor	%xmm0,%xmm1
+	movdqa	48(%edx),%xmm0
+	pxor	%xmm7,%xmm1
+	movdqa	80(%ebp),%xmm7
+	movq	%mm4,%mm1
+	paddq	%xmm1,%xmm5
+	movq	-48(%edx),%mm7
+	pxor	%mm6,%mm5
+	psrlq	$14,%mm1
+	movq	%mm4,16(%esp)
+	paddq	%xmm5,%xmm7
+	pand	%mm4,%mm5
+	psllq	$23,%mm4
+	paddq	%mm3,%mm0
+	movq	%mm1,%mm3
+	psrlq	$4,%mm1
+	pxor	%mm6,%mm5
+	pxor	%mm4,%mm3
+	psllq	$23,%mm4
+	pxor	%mm1,%mm3
+	movq	%mm0,48(%esp)
+	paddq	%mm5,%mm7
+	pxor	%mm4,%mm3
+	psrlq	$23,%mm1
+	paddq	40(%esp),%mm7
+	pxor	%mm1,%mm3
+	psllq	$4,%mm4
+	pxor	%mm4,%mm3
+	movq	8(%esp),%mm4
+	paddq	%mm7,%mm3
+	movq	%mm0,%mm5
+	psrlq	$28,%mm5
+	paddq	%mm3,%mm4
+	movq	%mm0,%mm6
+	movq	%mm5,%mm7
+	psllq	$25,%mm6
+	movq	56(%esp),%mm1
+	psrlq	$6,%mm5
+	pxor	%mm6,%mm7
+	psllq	$5,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm0
+	psrlq	$5,%mm5
+	pxor	%mm6,%mm7
+	pand	%mm0,%mm2
+	psllq	$6,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm2
+	pxor	%mm7,%mm6
+	movq	16(%esp),%mm5
+	paddq	%mm6,%mm2
+	movq	24(%esp),%mm6
+	movq	%mm4,%mm1
+	movq	-40(%edx),%mm7
+	pxor	%mm6,%mm5
+	psrlq	$14,%mm1
+	movq	%mm4,8(%esp)
+	pand	%mm4,%mm5
+	psllq	$23,%mm4
+	paddq	%mm3,%mm2
+	movq	%mm1,%mm3
+	psrlq	$4,%mm1
+	pxor	%mm6,%mm5
+	pxor	%mm4,%mm3
+	psllq	$23,%mm4
+	pxor	%mm1,%mm3
+	movq	%mm2,40(%esp)
+	paddq	%mm5,%mm7
+	pxor	%mm4,%mm3
+	psrlq	$23,%mm1
+	paddq	32(%esp),%mm7
+	pxor	%mm1,%mm3
+	psllq	$4,%mm4
+	pxor	%mm4,%mm3
+	movq	(%esp),%mm4
+	paddq	%mm7,%mm3
+	movq	%mm2,%mm5
+	psrlq	$28,%mm5
+	paddq	%mm3,%mm4
+	movq	%mm2,%mm6
+	movq	%mm5,%mm7
+	psllq	$25,%mm6
+	movq	48(%esp),%mm1
+	psrlq	$6,%mm5
+	pxor	%mm6,%mm7
+	psllq	$5,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm2
+	psrlq	$5,%mm5
+	pxor	%mm6,%mm7
+	pand	%mm2,%mm0
+	psllq	$6,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm0
+	pxor	%mm7,%mm6
+	movq	8(%esp),%mm5
+	paddq	%mm6,%mm0
+	movq	16(%esp),%mm6
+	movdqa	%xmm7,-48(%edx)
+	movdqa	%xmm3,%xmm1
+	movdqa	%xmm0,%xmm7
+.byte	102,15,58,15,198,8
+	movdqa	%xmm2,32(%edx)
+.byte	102,15,58,15,202,8
+	movdqa	%xmm0,%xmm2
+	psrlq	$7,%xmm0
+	paddq	%xmm1,%xmm6
+	movdqa	%xmm2,%xmm1
+	psrlq	$1,%xmm2
+	psllq	$56,%xmm1
+	pxor	%xmm2,%xmm0
+	psrlq	$7,%xmm2
+	pxor	%xmm1,%xmm0
+	psllq	$7,%xmm1
+	pxor	%xmm2,%xmm0
+	movdqa	%xmm5,%xmm2
+	pxor	%xmm1,%xmm0
+	movdqa	%xmm5,%xmm1
+	psrlq	$6,%xmm2
+	paddq	%xmm0,%xmm6
+	movdqa	%xmm5,%xmm0
+	psrlq	$19,%xmm1
+	psllq	$3,%xmm0
+	pxor	%xmm1,%xmm2
+	psrlq	$42,%xmm1
+	pxor	%xmm0,%xmm2
+	psllq	$42,%xmm0
+	pxor	%xmm1,%xmm2
+	movdqa	(%edx),%xmm1
+	pxor	%xmm0,%xmm2
+	movdqa	96(%ebp),%xmm0
+	movq	%mm4,%mm1
+	paddq	%xmm2,%xmm6
+	movq	-32(%edx),%mm7
+	pxor	%mm6,%mm5
+	psrlq	$14,%mm1
+	movq	%mm4,(%esp)
+	paddq	%xmm6,%xmm0
+	pand	%mm4,%mm5
+	psllq	$23,%mm4
+	paddq	%mm3,%mm0
+	movq	%mm1,%mm3
+	psrlq	$4,%mm1
+	pxor	%mm6,%mm5
+	pxor	%mm4,%mm3
+	psllq	$23,%mm4
+	pxor	%mm1,%mm3
+	movq	%mm0,32(%esp)
+	paddq	%mm5,%mm7
+	pxor	%mm4,%mm3
+	psrlq	$23,%mm1
+	paddq	24(%esp),%mm7
+	pxor	%mm1,%mm3
+	psllq	$4,%mm4
+	pxor	%mm4,%mm3
+	movq	56(%esp),%mm4
+	paddq	%mm7,%mm3
+	movq	%mm0,%mm5
+	psrlq	$28,%mm5
+	paddq	%mm3,%mm4
+	movq	%mm0,%mm6
+	movq	%mm5,%mm7
+	psllq	$25,%mm6
+	movq	40(%esp),%mm1
+	psrlq	$6,%mm5
+	pxor	%mm6,%mm7
+	psllq	$5,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm0
+	psrlq	$5,%mm5
+	pxor	%mm6,%mm7
+	pand	%mm0,%mm2
+	psllq	$6,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm2
+	pxor	%mm7,%mm6
+	movq	(%esp),%mm5
+	paddq	%mm6,%mm2
+	movq	8(%esp),%mm6
+	movq	%mm4,%mm1
+	movq	-24(%edx),%mm7
+	pxor	%mm6,%mm5
+	psrlq	$14,%mm1
+	movq	%mm4,56(%esp)
+	pand	%mm4,%mm5
+	psllq	$23,%mm4
+	paddq	%mm3,%mm2
+	movq	%mm1,%mm3
+	psrlq	$4,%mm1
+	pxor	%mm6,%mm5
+	pxor	%mm4,%mm3
+	psllq	$23,%mm4
+	pxor	%mm1,%mm3
+	movq	%mm2,24(%esp)
+	paddq	%mm5,%mm7
+	pxor	%mm4,%mm3
+	psrlq	$23,%mm1
+	paddq	16(%esp),%mm7
+	pxor	%mm1,%mm3
+	psllq	$4,%mm4
+	pxor	%mm4,%mm3
+	movq	48(%esp),%mm4
+	paddq	%mm7,%mm3
+	movq	%mm2,%mm5
+	psrlq	$28,%mm5
+	paddq	%mm3,%mm4
+	movq	%mm2,%mm6
+	movq	%mm5,%mm7
+	psllq	$25,%mm6
+	movq	32(%esp),%mm1
+	psrlq	$6,%mm5
+	pxor	%mm6,%mm7
+	psllq	$5,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm2
+	psrlq	$5,%mm5
+	pxor	%mm6,%mm7
+	pand	%mm2,%mm0
+	psllq	$6,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm0
+	pxor	%mm7,%mm6
+	movq	56(%esp),%mm5
+	paddq	%mm6,%mm0
+	movq	(%esp),%mm6
+	movdqa	%xmm0,-32(%edx)
+	movdqa	%xmm4,%xmm2
+	movdqa	%xmm1,%xmm0
+.byte	102,15,58,15,207,8
+	movdqa	%xmm3,48(%edx)
+.byte	102,15,58,15,211,8
+	movdqa	%xmm1,%xmm3
+	psrlq	$7,%xmm1
+	paddq	%xmm2,%xmm7
+	movdqa	%xmm3,%xmm2
+	psrlq	$1,%xmm3
+	psllq	$56,%xmm2
+	pxor	%xmm3,%xmm1
+	psrlq	$7,%xmm3
+	pxor	%xmm2,%xmm1
+	psllq	$7,%xmm2
+	pxor	%xmm3,%xmm1
+	movdqa	%xmm6,%xmm3
+	pxor	%xmm2,%xmm1
+	movdqa	%xmm6,%xmm2
+	psrlq	$6,%xmm3
+	paddq	%xmm1,%xmm7
+	movdqa	%xmm6,%xmm1
+	psrlq	$19,%xmm2
+	psllq	$3,%xmm1
+	pxor	%xmm2,%xmm3
+	psrlq	$42,%xmm2
+	pxor	%xmm1,%xmm3
+	psllq	$42,%xmm1
+	pxor	%xmm2,%xmm3
+	movdqa	16(%edx),%xmm2
+	pxor	%xmm1,%xmm3
+	movdqa	112(%ebp),%xmm1
+	movq	%mm4,%mm1
+	paddq	%xmm3,%xmm7
+	movq	-16(%edx),%mm7
+	pxor	%mm6,%mm5
+	psrlq	$14,%mm1
+	movq	%mm4,48(%esp)
+	paddq	%xmm7,%xmm1
+	pand	%mm4,%mm5
+	psllq	$23,%mm4
+	paddq	%mm3,%mm0
+	movq	%mm1,%mm3
+	psrlq	$4,%mm1
+	pxor	%mm6,%mm5
+	pxor	%mm4,%mm3
+	psllq	$23,%mm4
+	pxor	%mm1,%mm3
+	movq	%mm0,16(%esp)
+	paddq	%mm5,%mm7
+	pxor	%mm4,%mm3
+	psrlq	$23,%mm1
+	paddq	8(%esp),%mm7
+	pxor	%mm1,%mm3
+	psllq	$4,%mm4
+	pxor	%mm4,%mm3
+	movq	40(%esp),%mm4
+	paddq	%mm7,%mm3
+	movq	%mm0,%mm5
+	psrlq	$28,%mm5
+	paddq	%mm3,%mm4
+	movq	%mm0,%mm6
+	movq	%mm5,%mm7
+	psllq	$25,%mm6
+	movq	24(%esp),%mm1
+	psrlq	$6,%mm5
+	pxor	%mm6,%mm7
+	psllq	$5,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm0
+	psrlq	$5,%mm5
+	pxor	%mm6,%mm7
+	pand	%mm0,%mm2
+	psllq	$6,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm2
+	pxor	%mm7,%mm6
+	movq	48(%esp),%mm5
+	paddq	%mm6,%mm2
+	movq	56(%esp),%mm6
+	movq	%mm4,%mm1
+	movq	-8(%edx),%mm7
+	pxor	%mm6,%mm5
+	psrlq	$14,%mm1
+	movq	%mm4,40(%esp)
+	pand	%mm4,%mm5
+	psllq	$23,%mm4
+	paddq	%mm3,%mm2
+	movq	%mm1,%mm3
+	psrlq	$4,%mm1
+	pxor	%mm6,%mm5
+	pxor	%mm4,%mm3
+	psllq	$23,%mm4
+	pxor	%mm1,%mm3
+	movq	%mm2,8(%esp)
+	paddq	%mm5,%mm7
+	pxor	%mm4,%mm3
+	psrlq	$23,%mm1
+	paddq	(%esp),%mm7
+	pxor	%mm1,%mm3
+	psllq	$4,%mm4
+	pxor	%mm4,%mm3
+	movq	32(%esp),%mm4
+	paddq	%mm7,%mm3
+	movq	%mm2,%mm5
+	psrlq	$28,%mm5
+	paddq	%mm3,%mm4
+	movq	%mm2,%mm6
+	movq	%mm5,%mm7
+	psllq	$25,%mm6
+	movq	16(%esp),%mm1
+	psrlq	$6,%mm5
+	pxor	%mm6,%mm7
+	psllq	$5,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm2
+	psrlq	$5,%mm5
+	pxor	%mm6,%mm7
+	pand	%mm2,%mm0
+	psllq	$6,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm0
+	pxor	%mm7,%mm6
+	movq	40(%esp),%mm5
+	paddq	%mm6,%mm0
+	movq	48(%esp),%mm6
+	movdqa	%xmm1,-16(%edx)
+	leal	128(%ebp),%ebp
+	decl	%ecx
+	jnz	L00800_47_ssse3
+	movdqa	(%ebp),%xmm1
+	leal	-640(%ebp),%ebp
+	movdqu	(%ebx),%xmm0
+.byte	102,15,56,0,193
+	movdqa	(%ebp),%xmm3
+	movdqa	%xmm1,%xmm2
+	movdqu	16(%ebx),%xmm1
+	paddq	%xmm0,%xmm3
+.byte	102,15,56,0,202
+	movq	%mm4,%mm1
+	movq	-128(%edx),%mm7
+	pxor	%mm6,%mm5
+	psrlq	$14,%mm1
+	movq	%mm4,32(%esp)
+	pand	%mm4,%mm5
+	psllq	$23,%mm4
+	paddq	%mm3,%mm0
+	movq	%mm1,%mm3
+	psrlq	$4,%mm1
+	pxor	%mm6,%mm5
+	pxor	%mm4,%mm3
+	psllq	$23,%mm4
+	pxor	%mm1,%mm3
+	movq	%mm0,(%esp)
+	paddq	%mm5,%mm7
+	pxor	%mm4,%mm3
+	psrlq	$23,%mm1
+	paddq	56(%esp),%mm7
+	pxor	%mm1,%mm3
+	psllq	$4,%mm4
+	pxor	%mm4,%mm3
+	movq	24(%esp),%mm4
+	paddq	%mm7,%mm3
+	movq	%mm0,%mm5
+	psrlq	$28,%mm5
+	paddq	%mm3,%mm4
+	movq	%mm0,%mm6
+	movq	%mm5,%mm7
+	psllq	$25,%mm6
+	movq	8(%esp),%mm1
+	psrlq	$6,%mm5
+	pxor	%mm6,%mm7
+	psllq	$5,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm0
+	psrlq	$5,%mm5
+	pxor	%mm6,%mm7
+	pand	%mm0,%mm2
+	psllq	$6,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm2
+	pxor	%mm7,%mm6
+	movq	32(%esp),%mm5
+	paddq	%mm6,%mm2
+	movq	40(%esp),%mm6
+	movq	%mm4,%mm1
+	movq	-120(%edx),%mm7
+	pxor	%mm6,%mm5
+	psrlq	$14,%mm1
+	movq	%mm4,24(%esp)
+	pand	%mm4,%mm5
+	psllq	$23,%mm4
+	paddq	%mm3,%mm2
+	movq	%mm1,%mm3
+	psrlq	$4,%mm1
+	pxor	%mm6,%mm5
+	pxor	%mm4,%mm3
+	psllq	$23,%mm4
+	pxor	%mm1,%mm3
+	movq	%mm2,56(%esp)
+	paddq	%mm5,%mm7
+	pxor	%mm4,%mm3
+	psrlq	$23,%mm1
+	paddq	48(%esp),%mm7
+	pxor	%mm1,%mm3
+	psllq	$4,%mm4
+	pxor	%mm4,%mm3
+	movq	16(%esp),%mm4
+	paddq	%mm7,%mm3
+	movq	%mm2,%mm5
+	psrlq	$28,%mm5
+	paddq	%mm3,%mm4
+	movq	%mm2,%mm6
+	movq	%mm5,%mm7
+	psllq	$25,%mm6
+	movq	(%esp),%mm1
+	psrlq	$6,%mm5
+	pxor	%mm6,%mm7
+	psllq	$5,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm2
+	psrlq	$5,%mm5
+	pxor	%mm6,%mm7
+	pand	%mm2,%mm0
+	psllq	$6,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm0
+	pxor	%mm7,%mm6
+	movq	24(%esp),%mm5
+	paddq	%mm6,%mm0
+	movq	32(%esp),%mm6
+	movdqa	%xmm3,-128(%edx)
+	movdqa	16(%ebp),%xmm4
+	movdqa	%xmm2,%xmm3
+	movdqu	32(%ebx),%xmm2
+	paddq	%xmm1,%xmm4
+.byte	102,15,56,0,211
+	movq	%mm4,%mm1
+	movq	-112(%edx),%mm7
+	pxor	%mm6,%mm5
+	psrlq	$14,%mm1
+	movq	%mm4,16(%esp)
+	pand	%mm4,%mm5
+	psllq	$23,%mm4
+	paddq	%mm3,%mm0
+	movq	%mm1,%mm3
+	psrlq	$4,%mm1
+	pxor	%mm6,%mm5
+	pxor	%mm4,%mm3
+	psllq	$23,%mm4
+	pxor	%mm1,%mm3
+	movq	%mm0,48(%esp)
+	paddq	%mm5,%mm7
+	pxor	%mm4,%mm3
+	psrlq	$23,%mm1
+	paddq	40(%esp),%mm7
+	pxor	%mm1,%mm3
+	psllq	$4,%mm4
+	pxor	%mm4,%mm3
+	movq	8(%esp),%mm4
+	paddq	%mm7,%mm3
+	movq	%mm0,%mm5
+	psrlq	$28,%mm5
+	paddq	%mm3,%mm4
+	movq	%mm0,%mm6
+	movq	%mm5,%mm7
+	psllq	$25,%mm6
+	movq	56(%esp),%mm1
+	psrlq	$6,%mm5
+	pxor	%mm6,%mm7
+	psllq	$5,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm0
+	psrlq	$5,%mm5
+	pxor	%mm6,%mm7
+	pand	%mm0,%mm2
+	psllq	$6,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm2
+	pxor	%mm7,%mm6
+	movq	16(%esp),%mm5
+	paddq	%mm6,%mm2
+	movq	24(%esp),%mm6
+	movq	%mm4,%mm1
+	movq	-104(%edx),%mm7
+	pxor	%mm6,%mm5
+	psrlq	$14,%mm1
+	movq	%mm4,8(%esp)
+	pand	%mm4,%mm5
+	psllq	$23,%mm4
+	paddq	%mm3,%mm2
+	movq	%mm1,%mm3
+	psrlq	$4,%mm1
+	pxor	%mm6,%mm5
+	pxor	%mm4,%mm3
+	psllq	$23,%mm4
+	pxor	%mm1,%mm3
+	movq	%mm2,40(%esp)
+	paddq	%mm5,%mm7
+	pxor	%mm4,%mm3
+	psrlq	$23,%mm1
+	paddq	32(%esp),%mm7
+	pxor	%mm1,%mm3
+	psllq	$4,%mm4
+	pxor	%mm4,%mm3
+	movq	(%esp),%mm4
+	paddq	%mm7,%mm3
+	movq	%mm2,%mm5
+	psrlq	$28,%mm5
+	paddq	%mm3,%mm4
+	movq	%mm2,%mm6
+	movq	%mm5,%mm7
+	psllq	$25,%mm6
+	movq	48(%esp),%mm1
+	psrlq	$6,%mm5
+	pxor	%mm6,%mm7
+	psllq	$5,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm2
+	psrlq	$5,%mm5
+	pxor	%mm6,%mm7
+	pand	%mm2,%mm0
+	psllq	$6,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm0
+	pxor	%mm7,%mm6
+	movq	8(%esp),%mm5
+	paddq	%mm6,%mm0
+	movq	16(%esp),%mm6
+	movdqa	%xmm4,-112(%edx)
+	movdqa	32(%ebp),%xmm5
+	movdqa	%xmm3,%xmm4
+	movdqu	48(%ebx),%xmm3
+	paddq	%xmm2,%xmm5
+.byte	102,15,56,0,220
+	movq	%mm4,%mm1
+	movq	-96(%edx),%mm7
+	pxor	%mm6,%mm5
+	psrlq	$14,%mm1
+	movq	%mm4,(%esp)
+	pand	%mm4,%mm5
+	psllq	$23,%mm4
+	paddq	%mm3,%mm0
+	movq	%mm1,%mm3
+	psrlq	$4,%mm1
+	pxor	%mm6,%mm5
+	pxor	%mm4,%mm3
+	psllq	$23,%mm4
+	pxor	%mm1,%mm3
+	movq	%mm0,32(%esp)
+	paddq	%mm5,%mm7
+	pxor	%mm4,%mm3
+	psrlq	$23,%mm1
+	paddq	24(%esp),%mm7
+	pxor	%mm1,%mm3
+	psllq	$4,%mm4
+	pxor	%mm4,%mm3
+	movq	56(%esp),%mm4
+	paddq	%mm7,%mm3
+	movq	%mm0,%mm5
+	psrlq	$28,%mm5
+	paddq	%mm3,%mm4
+	movq	%mm0,%mm6
+	movq	%mm5,%mm7
+	psllq	$25,%mm6
+	movq	40(%esp),%mm1
+	psrlq	$6,%mm5
+	pxor	%mm6,%mm7
+	psllq	$5,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm0
+	psrlq	$5,%mm5
+	pxor	%mm6,%mm7
+	pand	%mm0,%mm2
+	psllq	$6,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm2
+	pxor	%mm7,%mm6
+	movq	(%esp),%mm5
+	paddq	%mm6,%mm2
+	movq	8(%esp),%mm6
+	movq	%mm4,%mm1
+	movq	-88(%edx),%mm7
+	pxor	%mm6,%mm5
+	psrlq	$14,%mm1
+	movq	%mm4,56(%esp)
+	pand	%mm4,%mm5
+	psllq	$23,%mm4
+	paddq	%mm3,%mm2
+	movq	%mm1,%mm3
+	psrlq	$4,%mm1
+	pxor	%mm6,%mm5
+	pxor	%mm4,%mm3
+	psllq	$23,%mm4
+	pxor	%mm1,%mm3
+	movq	%mm2,24(%esp)
+	paddq	%mm5,%mm7
+	pxor	%mm4,%mm3
+	psrlq	$23,%mm1
+	paddq	16(%esp),%mm7
+	pxor	%mm1,%mm3
+	psllq	$4,%mm4
+	pxor	%mm4,%mm3
+	movq	48(%esp),%mm4
+	paddq	%mm7,%mm3
+	movq	%mm2,%mm5
+	psrlq	$28,%mm5
+	paddq	%mm3,%mm4
+	movq	%mm2,%mm6
+	movq	%mm5,%mm7
+	psllq	$25,%mm6
+	movq	32(%esp),%mm1
+	psrlq	$6,%mm5
+	pxor	%mm6,%mm7
+	psllq	$5,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm2
+	psrlq	$5,%mm5
+	pxor	%mm6,%mm7
+	pand	%mm2,%mm0
+	psllq	$6,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm0
+	pxor	%mm7,%mm6
+	movq	56(%esp),%mm5
+	paddq	%mm6,%mm0
+	movq	(%esp),%mm6
+	movdqa	%xmm5,-96(%edx)
+	movdqa	48(%ebp),%xmm6
+	movdqa	%xmm4,%xmm5
+	movdqu	64(%ebx),%xmm4
+	paddq	%xmm3,%xmm6
+.byte	102,15,56,0,229
+	movq	%mm4,%mm1
+	movq	-80(%edx),%mm7
+	pxor	%mm6,%mm5
+	psrlq	$14,%mm1
+	movq	%mm4,48(%esp)
+	pand	%mm4,%mm5
+	psllq	$23,%mm4
+	paddq	%mm3,%mm0
+	movq	%mm1,%mm3
+	psrlq	$4,%mm1
+	pxor	%mm6,%mm5
+	pxor	%mm4,%mm3
+	psllq	$23,%mm4
+	pxor	%mm1,%mm3
+	movq	%mm0,16(%esp)
+	paddq	%mm5,%mm7
+	pxor	%mm4,%mm3
+	psrlq	$23,%mm1
+	paddq	8(%esp),%mm7
+	pxor	%mm1,%mm3
+	psllq	$4,%mm4
+	pxor	%mm4,%mm3
+	movq	40(%esp),%mm4
+	paddq	%mm7,%mm3
+	movq	%mm0,%mm5
+	psrlq	$28,%mm5
+	paddq	%mm3,%mm4
+	movq	%mm0,%mm6
+	movq	%mm5,%mm7
+	psllq	$25,%mm6
+	movq	24(%esp),%mm1
+	psrlq	$6,%mm5
+	pxor	%mm6,%mm7
+	psllq	$5,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm0
+	psrlq	$5,%mm5
+	pxor	%mm6,%mm7
+	pand	%mm0,%mm2
+	psllq	$6,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm2
+	pxor	%mm7,%mm6
+	movq	48(%esp),%mm5
+	paddq	%mm6,%mm2
+	movq	56(%esp),%mm6
+	movq	%mm4,%mm1
+	movq	-72(%edx),%mm7
+	pxor	%mm6,%mm5
+	psrlq	$14,%mm1
+	movq	%mm4,40(%esp)
+	pand	%mm4,%mm5
+	psllq	$23,%mm4
+	paddq	%mm3,%mm2
+	movq	%mm1,%mm3
+	psrlq	$4,%mm1
+	pxor	%mm6,%mm5
+	pxor	%mm4,%mm3
+	psllq	$23,%mm4
+	pxor	%mm1,%mm3
+	movq	%mm2,8(%esp)
+	paddq	%mm5,%mm7
+	pxor	%mm4,%mm3
+	psrlq	$23,%mm1
+	paddq	(%esp),%mm7
+	pxor	%mm1,%mm3
+	psllq	$4,%mm4
+	pxor	%mm4,%mm3
+	movq	32(%esp),%mm4
+	paddq	%mm7,%mm3
+	movq	%mm2,%mm5
+	psrlq	$28,%mm5
+	paddq	%mm3,%mm4
+	movq	%mm2,%mm6
+	movq	%mm5,%mm7
+	psllq	$25,%mm6
+	movq	16(%esp),%mm1
+	psrlq	$6,%mm5
+	pxor	%mm6,%mm7
+	psllq	$5,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm2
+	psrlq	$5,%mm5
+	pxor	%mm6,%mm7
+	pand	%mm2,%mm0
+	psllq	$6,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm0
+	pxor	%mm7,%mm6
+	movq	40(%esp),%mm5
+	paddq	%mm6,%mm0
+	movq	48(%esp),%mm6
+	movdqa	%xmm6,-80(%edx)
+	movdqa	64(%ebp),%xmm7
+	movdqa	%xmm5,%xmm6
+	movdqu	80(%ebx),%xmm5
+	paddq	%xmm4,%xmm7
+.byte	102,15,56,0,238
+	movq	%mm4,%mm1
+	movq	-64(%edx),%mm7
+	pxor	%mm6,%mm5
+	psrlq	$14,%mm1
+	movq	%mm4,32(%esp)
+	pand	%mm4,%mm5
+	psllq	$23,%mm4
+	paddq	%mm3,%mm0
+	movq	%mm1,%mm3
+	psrlq	$4,%mm1
+	pxor	%mm6,%mm5
+	pxor	%mm4,%mm3
+	psllq	$23,%mm4
+	pxor	%mm1,%mm3
+	movq	%mm0,(%esp)
+	paddq	%mm5,%mm7
+	pxor	%mm4,%mm3
+	psrlq	$23,%mm1
+	paddq	56(%esp),%mm7
+	pxor	%mm1,%mm3
+	psllq	$4,%mm4
+	pxor	%mm4,%mm3
+	movq	24(%esp),%mm4
+	paddq	%mm7,%mm3
+	movq	%mm0,%mm5
+	psrlq	$28,%mm5
+	paddq	%mm3,%mm4
+	movq	%mm0,%mm6
+	movq	%mm5,%mm7
+	psllq	$25,%mm6
+	movq	8(%esp),%mm1
+	psrlq	$6,%mm5
+	pxor	%mm6,%mm7
+	psllq	$5,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm0
+	psrlq	$5,%mm5
+	pxor	%mm6,%mm7
+	pand	%mm0,%mm2
+	psllq	$6,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm2
+	pxor	%mm7,%mm6
+	movq	32(%esp),%mm5
+	paddq	%mm6,%mm2
+	movq	40(%esp),%mm6
+	movq	%mm4,%mm1
+	movq	-56(%edx),%mm7
+	pxor	%mm6,%mm5
+	psrlq	$14,%mm1
+	movq	%mm4,24(%esp)
+	pand	%mm4,%mm5
+	psllq	$23,%mm4
+	paddq	%mm3,%mm2
+	movq	%mm1,%mm3
+	psrlq	$4,%mm1
+	pxor	%mm6,%mm5
+	pxor	%mm4,%mm3
+	psllq	$23,%mm4
+	pxor	%mm1,%mm3
+	movq	%mm2,56(%esp)
+	paddq	%mm5,%mm7
+	pxor	%mm4,%mm3
+	psrlq	$23,%mm1
+	paddq	48(%esp),%mm7
+	pxor	%mm1,%mm3
+	psllq	$4,%mm4
+	pxor	%mm4,%mm3
+	movq	16(%esp),%mm4
+	paddq	%mm7,%mm3
+	movq	%mm2,%mm5
+	psrlq	$28,%mm5
+	paddq	%mm3,%mm4
+	movq	%mm2,%mm6
+	movq	%mm5,%mm7
+	psllq	$25,%mm6
+	movq	(%esp),%mm1
+	psrlq	$6,%mm5
+	pxor	%mm6,%mm7
+	psllq	$5,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm2
+	psrlq	$5,%mm5
+	pxor	%mm6,%mm7
+	pand	%mm2,%mm0
+	psllq	$6,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm0
+	pxor	%mm7,%mm6
+	movq	24(%esp),%mm5
+	paddq	%mm6,%mm0
+	movq	32(%esp),%mm6
+	movdqa	%xmm7,-64(%edx)
+	movdqa	%xmm0,(%edx)
+	movdqa	80(%ebp),%xmm0
+	movdqa	%xmm6,%xmm7
+	movdqu	96(%ebx),%xmm6
+	paddq	%xmm5,%xmm0
+.byte	102,15,56,0,247
+	movq	%mm4,%mm1
+	movq	-48(%edx),%mm7
+	pxor	%mm6,%mm5
+	psrlq	$14,%mm1
+	movq	%mm4,16(%esp)
+	pand	%mm4,%mm5
+	psllq	$23,%mm4
+	paddq	%mm3,%mm0
+	movq	%mm1,%mm3
+	psrlq	$4,%mm1
+	pxor	%mm6,%mm5
+	pxor	%mm4,%mm3
+	psllq	$23,%mm4
+	pxor	%mm1,%mm3
+	movq	%mm0,48(%esp)
+	paddq	%mm5,%mm7
+	pxor	%mm4,%mm3
+	psrlq	$23,%mm1
+	paddq	40(%esp),%mm7
+	pxor	%mm1,%mm3
+	psllq	$4,%mm4
+	pxor	%mm4,%mm3
+	movq	8(%esp),%mm4
+	paddq	%mm7,%mm3
+	movq	%mm0,%mm5
+	psrlq	$28,%mm5
+	paddq	%mm3,%mm4
+	movq	%mm0,%mm6
+	movq	%mm5,%mm7
+	psllq	$25,%mm6
+	movq	56(%esp),%mm1
+	psrlq	$6,%mm5
+	pxor	%mm6,%mm7
+	psllq	$5,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm0
+	psrlq	$5,%mm5
+	pxor	%mm6,%mm7
+	pand	%mm0,%mm2
+	psllq	$6,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm2
+	pxor	%mm7,%mm6
+	movq	16(%esp),%mm5
+	paddq	%mm6,%mm2
+	movq	24(%esp),%mm6
+	movq	%mm4,%mm1
+	movq	-40(%edx),%mm7
+	pxor	%mm6,%mm5
+	psrlq	$14,%mm1
+	movq	%mm4,8(%esp)
+	pand	%mm4,%mm5
+	psllq	$23,%mm4
+	paddq	%mm3,%mm2
+	movq	%mm1,%mm3
+	psrlq	$4,%mm1
+	pxor	%mm6,%mm5
+	pxor	%mm4,%mm3
+	psllq	$23,%mm4
+	pxor	%mm1,%mm3
+	movq	%mm2,40(%esp)
+	paddq	%mm5,%mm7
+	pxor	%mm4,%mm3
+	psrlq	$23,%mm1
+	paddq	32(%esp),%mm7
+	pxor	%mm1,%mm3
+	psllq	$4,%mm4
+	pxor	%mm4,%mm3
+	movq	(%esp),%mm4
+	paddq	%mm7,%mm3
+	movq	%mm2,%mm5
+	psrlq	$28,%mm5
+	paddq	%mm3,%mm4
+	movq	%mm2,%mm6
+	movq	%mm5,%mm7
+	psllq	$25,%mm6
+	movq	48(%esp),%mm1
+	psrlq	$6,%mm5
+	pxor	%mm6,%mm7
+	psllq	$5,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm2
+	psrlq	$5,%mm5
+	pxor	%mm6,%mm7
+	pand	%mm2,%mm0
+	psllq	$6,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm0
+	pxor	%mm7,%mm6
+	movq	8(%esp),%mm5
+	paddq	%mm6,%mm0
+	movq	16(%esp),%mm6
+	movdqa	%xmm0,-48(%edx)
+	movdqa	%xmm1,16(%edx)
+	movdqa	96(%ebp),%xmm1
+	movdqa	%xmm7,%xmm0
+	movdqu	112(%ebx),%xmm7
+	paddq	%xmm6,%xmm1
+.byte	102,15,56,0,248
+	movq	%mm4,%mm1
+	movq	-32(%edx),%mm7
+	pxor	%mm6,%mm5
+	psrlq	$14,%mm1
+	movq	%mm4,(%esp)
+	pand	%mm4,%mm5
+	psllq	$23,%mm4
+	paddq	%mm3,%mm0
+	movq	%mm1,%mm3
+	psrlq	$4,%mm1
+	pxor	%mm6,%mm5
+	pxor	%mm4,%mm3
+	psllq	$23,%mm4
+	pxor	%mm1,%mm3
+	movq	%mm0,32(%esp)
+	paddq	%mm5,%mm7
+	pxor	%mm4,%mm3
+	psrlq	$23,%mm1
+	paddq	24(%esp),%mm7
+	pxor	%mm1,%mm3
+	psllq	$4,%mm4
+	pxor	%mm4,%mm3
+	movq	56(%esp),%mm4
+	paddq	%mm7,%mm3
+	movq	%mm0,%mm5
+	psrlq	$28,%mm5
+	paddq	%mm3,%mm4
+	movq	%mm0,%mm6
+	movq	%mm5,%mm7
+	psllq	$25,%mm6
+	movq	40(%esp),%mm1
+	psrlq	$6,%mm5
+	pxor	%mm6,%mm7
+	psllq	$5,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm0
+	psrlq	$5,%mm5
+	pxor	%mm6,%mm7
+	pand	%mm0,%mm2
+	psllq	$6,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm2
+	pxor	%mm7,%mm6
+	movq	(%esp),%mm5
+	paddq	%mm6,%mm2
+	movq	8(%esp),%mm6
+	movq	%mm4,%mm1
+	movq	-24(%edx),%mm7
+	pxor	%mm6,%mm5
+	psrlq	$14,%mm1
+	movq	%mm4,56(%esp)
+	pand	%mm4,%mm5
+	psllq	$23,%mm4
+	paddq	%mm3,%mm2
+	movq	%mm1,%mm3
+	psrlq	$4,%mm1
+	pxor	%mm6,%mm5
+	pxor	%mm4,%mm3
+	psllq	$23,%mm4
+	pxor	%mm1,%mm3
+	movq	%mm2,24(%esp)
+	paddq	%mm5,%mm7
+	pxor	%mm4,%mm3
+	psrlq	$23,%mm1
+	paddq	16(%esp),%mm7
+	pxor	%mm1,%mm3
+	psllq	$4,%mm4
+	pxor	%mm4,%mm3
+	movq	48(%esp),%mm4
+	paddq	%mm7,%mm3
+	movq	%mm2,%mm5
+	psrlq	$28,%mm5
+	paddq	%mm3,%mm4
+	movq	%mm2,%mm6
+	movq	%mm5,%mm7
+	psllq	$25,%mm6
+	movq	32(%esp),%mm1
+	psrlq	$6,%mm5
+	pxor	%mm6,%mm7
+	psllq	$5,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm2
+	psrlq	$5,%mm5
+	pxor	%mm6,%mm7
+	pand	%mm2,%mm0
+	psllq	$6,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm0
+	pxor	%mm7,%mm6
+	movq	56(%esp),%mm5
+	paddq	%mm6,%mm0
+	movq	(%esp),%mm6
+	movdqa	%xmm1,-32(%edx)
+	movdqa	%xmm2,32(%edx)
+	movdqa	112(%ebp),%xmm2
+	movdqa	(%edx),%xmm0
+	paddq	%xmm7,%xmm2
+	movq	%mm4,%mm1
+	movq	-16(%edx),%mm7
+	pxor	%mm6,%mm5
+	psrlq	$14,%mm1
+	movq	%mm4,48(%esp)
+	pand	%mm4,%mm5
+	psllq	$23,%mm4
+	paddq	%mm3,%mm0
+	movq	%mm1,%mm3
+	psrlq	$4,%mm1
+	pxor	%mm6,%mm5
+	pxor	%mm4,%mm3
+	psllq	$23,%mm4
+	pxor	%mm1,%mm3
+	movq	%mm0,16(%esp)
+	paddq	%mm5,%mm7
+	pxor	%mm4,%mm3
+	psrlq	$23,%mm1
+	paddq	8(%esp),%mm7
+	pxor	%mm1,%mm3
+	psllq	$4,%mm4
+	pxor	%mm4,%mm3
+	movq	40(%esp),%mm4
+	paddq	%mm7,%mm3
+	movq	%mm0,%mm5
+	psrlq	$28,%mm5
+	paddq	%mm3,%mm4
+	movq	%mm0,%mm6
+	movq	%mm5,%mm7
+	psllq	$25,%mm6
+	movq	24(%esp),%mm1
+	psrlq	$6,%mm5
+	pxor	%mm6,%mm7
+	psllq	$5,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm0
+	psrlq	$5,%mm5
+	pxor	%mm6,%mm7
+	pand	%mm0,%mm2
+	psllq	$6,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm2
+	pxor	%mm7,%mm6
+	movq	48(%esp),%mm5
+	paddq	%mm6,%mm2
+	movq	56(%esp),%mm6
+	movq	%mm4,%mm1
+	movq	-8(%edx),%mm7
+	pxor	%mm6,%mm5
+	psrlq	$14,%mm1
+	movq	%mm4,40(%esp)
+	pand	%mm4,%mm5
+	psllq	$23,%mm4
+	paddq	%mm3,%mm2
+	movq	%mm1,%mm3
+	psrlq	$4,%mm1
+	pxor	%mm6,%mm5
+	pxor	%mm4,%mm3
+	psllq	$23,%mm4
+	pxor	%mm1,%mm3
+	movq	%mm2,8(%esp)
+	paddq	%mm5,%mm7
+	pxor	%mm4,%mm3
+	psrlq	$23,%mm1
+	paddq	(%esp),%mm7
+	pxor	%mm1,%mm3
+	psllq	$4,%mm4
+	pxor	%mm4,%mm3
+	movq	32(%esp),%mm4
+	paddq	%mm7,%mm3
+	movq	%mm2,%mm5
+	psrlq	$28,%mm5
+	paddq	%mm3,%mm4
+	movq	%mm2,%mm6
+	movq	%mm5,%mm7
+	psllq	$25,%mm6
+	movq	16(%esp),%mm1
+	psrlq	$6,%mm5
+	pxor	%mm6,%mm7
+	psllq	$5,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm2
+	psrlq	$5,%mm5
+	pxor	%mm6,%mm7
+	pand	%mm2,%mm0
+	psllq	$6,%mm6
+	pxor	%mm5,%mm7
+	pxor	%mm1,%mm0
+	pxor	%mm7,%mm6
+	movq	40(%esp),%mm5
+	paddq	%mm6,%mm0
+	movq	48(%esp),%mm6
+	movdqa	%xmm2,-16(%edx)
+	movq	8(%esp),%mm1
+	paddq	%mm3,%mm0
+	movq	24(%esp),%mm3
+	movq	56(%esp),%mm7
+	pxor	%mm1,%mm2
+	paddq	(%esi),%mm0
+	paddq	8(%esi),%mm1
+	paddq	16(%esi),%mm2
+	paddq	24(%esi),%mm3
+	paddq	32(%esi),%mm4
+	paddq	40(%esi),%mm5
+	paddq	48(%esi),%mm6
+	paddq	56(%esi),%mm7
+	movq	%mm0,(%esi)
+	movq	%mm1,8(%esi)
+	movq	%mm2,16(%esi)
+	movq	%mm3,24(%esi)
+	movq	%mm4,32(%esi)
+	movq	%mm5,40(%esi)
+	movq	%mm6,48(%esi)
+	movq	%mm7,56(%esi)
+	cmpl	%eax,%edi
+	jb	L007loop_ssse3
+	movl	76(%edx),%esp
+	emms
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.align	4,0x90
+L002loop_x86:
+	movl	(%edi),%eax
+	movl	4(%edi),%ebx
+	movl	8(%edi),%ecx
+	movl	12(%edi),%edx
+	bswap	%eax
+	bswap	%ebx
+	bswap	%ecx
+	bswap	%edx
+	pushl	%eax
+	pushl	%ebx
+	pushl	%ecx
+	pushl	%edx
+	movl	16(%edi),%eax
+	movl	20(%edi),%ebx
+	movl	24(%edi),%ecx
+	movl	28(%edi),%edx
+	bswap	%eax
+	bswap	%ebx
+	bswap	%ecx
+	bswap	%edx
+	pushl	%eax
+	pushl	%ebx
+	pushl	%ecx
+	pushl	%edx
+	movl	32(%edi),%eax
+	movl	36(%edi),%ebx
+	movl	40(%edi),%ecx
+	movl	44(%edi),%edx
+	bswap	%eax
+	bswap	%ebx
+	bswap	%ecx
+	bswap	%edx
+	pushl	%eax
+	pushl	%ebx
+	pushl	%ecx
+	pushl	%edx
+	movl	48(%edi),%eax
+	movl	52(%edi),%ebx
+	movl	56(%edi),%ecx
+	movl	60(%edi),%edx
+	bswap	%eax
+	bswap	%ebx
+	bswap	%ecx
+	bswap	%edx
+	pushl	%eax
+	pushl	%ebx
+	pushl	%ecx
+	pushl	%edx
+	movl	64(%edi),%eax
+	movl	68(%edi),%ebx
+	movl	72(%edi),%ecx
+	movl	76(%edi),%edx
+	bswap	%eax
+	bswap	%ebx
+	bswap	%ecx
+	bswap	%edx
+	pushl	%eax
+	pushl	%ebx
+	pushl	%ecx
+	pushl	%edx
+	movl	80(%edi),%eax
+	movl	84(%edi),%ebx
+	movl	88(%edi),%ecx
+	movl	92(%edi),%edx
+	bswap	%eax
+	bswap	%ebx
+	bswap	%ecx
+	bswap	%edx
+	pushl	%eax
+	pushl	%ebx
+	pushl	%ecx
+	pushl	%edx
+	movl	96(%edi),%eax
+	movl	100(%edi),%ebx
+	movl	104(%edi),%ecx
+	movl	108(%edi),%edx
+	bswap	%eax
+	bswap	%ebx
+	bswap	%ecx
+	bswap	%edx
+	pushl	%eax
+	pushl	%ebx
+	pushl	%ecx
+	pushl	%edx
+	movl	112(%edi),%eax
+	movl	116(%edi),%ebx
+	movl	120(%edi),%ecx
+	movl	124(%edi),%edx
+	bswap	%eax
+	bswap	%ebx
+	bswap	%ecx
+	bswap	%edx
+	pushl	%eax
+	pushl	%ebx
+	pushl	%ecx
+	pushl	%edx
+	addl	$128,%edi
+	subl	$72,%esp
+	movl	%edi,204(%esp)
+	leal	8(%esp),%edi
+	movl	$16,%ecx
+.long	2784229001
+.align	4,0x90
+L00900_15_x86:
+	movl	40(%esp),%ecx
+	movl	44(%esp),%edx
+	movl	%ecx,%esi
+	shrl	$9,%ecx
+	movl	%edx,%edi
+	shrl	$9,%edx
+	movl	%ecx,%ebx
+	shll	$14,%esi
+	movl	%edx,%eax
+	shll	$14,%edi
+	xorl	%esi,%ebx
+	shrl	$5,%ecx
+	xorl	%edi,%eax
+	shrl	$5,%edx
+	xorl	%ecx,%eax
+	shll	$4,%esi
+	xorl	%edx,%ebx
+	shll	$4,%edi
+	xorl	%esi,%ebx
+	shrl	$4,%ecx
+	xorl	%edi,%eax
+	shrl	$4,%edx
+	xorl	%ecx,%eax
+	shll	$5,%esi
+	xorl	%edx,%ebx
+	shll	$5,%edi
+	xorl	%esi,%eax
+	xorl	%edi,%ebx
+	movl	48(%esp),%ecx
+	movl	52(%esp),%edx
+	movl	56(%esp),%esi
+	movl	60(%esp),%edi
+	addl	64(%esp),%eax
+	adcl	68(%esp),%ebx
+	xorl	%esi,%ecx
+	xorl	%edi,%edx
+	andl	40(%esp),%ecx
+	andl	44(%esp),%edx
+	addl	192(%esp),%eax
+	adcl	196(%esp),%ebx
+	xorl	%esi,%ecx
+	xorl	%edi,%edx
+	movl	(%ebp),%esi
+	movl	4(%ebp),%edi
+	addl	%ecx,%eax
+	adcl	%edx,%ebx
+	movl	32(%esp),%ecx
+	movl	36(%esp),%edx
+	addl	%esi,%eax
+	adcl	%edi,%ebx
+	movl	%eax,(%esp)
+	movl	%ebx,4(%esp)
+	addl	%ecx,%eax
+	adcl	%edx,%ebx
+	movl	8(%esp),%ecx
+	movl	12(%esp),%edx
+	movl	%eax,32(%esp)
+	movl	%ebx,36(%esp)
+	movl	%ecx,%esi
+	shrl	$2,%ecx
+	movl	%edx,%edi
+	shrl	$2,%edx
+	movl	%ecx,%ebx
+	shll	$4,%esi
+	movl	%edx,%eax
+	shll	$4,%edi
+	xorl	%esi,%ebx
+	shrl	$5,%ecx
+	xorl	%edi,%eax
+	shrl	$5,%edx
+	xorl	%ecx,%ebx
+	shll	$21,%esi
+	xorl	%edx,%eax
+	shll	$21,%edi
+	xorl	%esi,%eax
+	shrl	$21,%ecx
+	xorl	%edi,%ebx
+	shrl	$21,%edx
+	xorl	%ecx,%eax
+	shll	$5,%esi
+	xorl	%edx,%ebx
+	shll	$5,%edi
+	xorl	%esi,%eax
+	xorl	%edi,%ebx
+	movl	8(%esp),%ecx
+	movl	12(%esp),%edx
+	movl	16(%esp),%esi
+	movl	20(%esp),%edi
+	addl	(%esp),%eax
+	adcl	4(%esp),%ebx
+	orl	%esi,%ecx
+	orl	%edi,%edx
+	andl	24(%esp),%ecx
+	andl	28(%esp),%edx
+	andl	8(%esp),%esi
+	andl	12(%esp),%edi
+	orl	%esi,%ecx
+	orl	%edi,%edx
+	addl	%ecx,%eax
+	adcl	%edx,%ebx
+	movl	%eax,(%esp)
+	movl	%ebx,4(%esp)
+	movb	(%ebp),%dl
+	subl	$8,%esp
+	leal	8(%ebp),%ebp
+	cmpb	$148,%dl
+	jne	L00900_15_x86
+.align	4,0x90
+L01016_79_x86:
+	movl	312(%esp),%ecx
+	movl	316(%esp),%edx
+	movl	%ecx,%esi
+	shrl	$1,%ecx
+	movl	%edx,%edi
+	shrl	$1,%edx
+	movl	%ecx,%eax
+	shll	$24,%esi
+	movl	%edx,%ebx
+	shll	$24,%edi
+	xorl	%esi,%ebx
+	shrl	$6,%ecx
+	xorl	%edi,%eax
+	shrl	$6,%edx
+	xorl	%ecx,%eax
+	shll	$7,%esi
+	xorl	%edx,%ebx
+	shll	$1,%edi
+	xorl	%esi,%ebx
+	shrl	$1,%ecx
+	xorl	%edi,%eax
+	shrl	$1,%edx
+	xorl	%ecx,%eax
+	shll	$6,%edi
+	xorl	%edx,%ebx
+	xorl	%edi,%eax
+	movl	%eax,(%esp)
+	movl	%ebx,4(%esp)
+	movl	208(%esp),%ecx
+	movl	212(%esp),%edx
+	movl	%ecx,%esi
+	shrl	$6,%ecx
+	movl	%edx,%edi
+	shrl	$6,%edx
+	movl	%ecx,%eax
+	shll	$3,%esi
+	movl	%edx,%ebx
+	shll	$3,%edi
+	xorl	%esi,%eax
+	shrl	$13,%ecx
+	xorl	%edi,%ebx
+	shrl	$13,%edx
+	xorl	%ecx,%eax
+	shll	$10,%esi
+	xorl	%edx,%ebx
+	shll	$10,%edi
+	xorl	%esi,%ebx
+	shrl	$10,%ecx
+	xorl	%edi,%eax
+	shrl	$10,%edx
+	xorl	%ecx,%ebx
+	shll	$13,%edi
+	xorl	%edx,%eax
+	xorl	%edi,%eax
+	movl	320(%esp),%ecx
+	movl	324(%esp),%edx
+	addl	(%esp),%eax
+	adcl	4(%esp),%ebx
+	movl	248(%esp),%esi
+	movl	252(%esp),%edi
+	addl	%ecx,%eax
+	adcl	%edx,%ebx
+	addl	%esi,%eax
+	adcl	%edi,%ebx
+	movl	%eax,192(%esp)
+	movl	%ebx,196(%esp)
+	movl	40(%esp),%ecx
+	movl	44(%esp),%edx
+	movl	%ecx,%esi
+	shrl	$9,%ecx
+	movl	%edx,%edi
+	shrl	$9,%edx
+	movl	%ecx,%ebx
+	shll	$14,%esi
+	movl	%edx,%eax
+	shll	$14,%edi
+	xorl	%esi,%ebx
+	shrl	$5,%ecx
+	xorl	%edi,%eax
+	shrl	$5,%edx
+	xorl	%ecx,%eax
+	shll	$4,%esi
+	xorl	%edx,%ebx
+	shll	$4,%edi
+	xorl	%esi,%ebx
+	shrl	$4,%ecx
+	xorl	%edi,%eax
+	shrl	$4,%edx
+	xorl	%ecx,%eax
+	shll	$5,%esi
+	xorl	%edx,%ebx
+	shll	$5,%edi
+	xorl	%esi,%eax
+	xorl	%edi,%ebx
+	movl	48(%esp),%ecx
+	movl	52(%esp),%edx
+	movl	56(%esp),%esi
+	movl	60(%esp),%edi
+	addl	64(%esp),%eax
+	adcl	68(%esp),%ebx
+	xorl	%esi,%ecx
+	xorl	%edi,%edx
+	andl	40(%esp),%ecx
+	andl	44(%esp),%edx
+	addl	192(%esp),%eax
+	adcl	196(%esp),%ebx
+	xorl	%esi,%ecx
+	xorl	%edi,%edx
+	movl	(%ebp),%esi
+	movl	4(%ebp),%edi
+	addl	%ecx,%eax
+	adcl	%edx,%ebx
+	movl	32(%esp),%ecx
+	movl	36(%esp),%edx
+	addl	%esi,%eax
+	adcl	%edi,%ebx
+	movl	%eax,(%esp)
+	movl	%ebx,4(%esp)
+	addl	%ecx,%eax
+	adcl	%edx,%ebx
+	movl	8(%esp),%ecx
+	movl	12(%esp),%edx
+	movl	%eax,32(%esp)
+	movl	%ebx,36(%esp)
+	movl	%ecx,%esi
+	shrl	$2,%ecx
+	movl	%edx,%edi
+	shrl	$2,%edx
+	movl	%ecx,%ebx
+	shll	$4,%esi
+	movl	%edx,%eax
+	shll	$4,%edi
+	xorl	%esi,%ebx
+	shrl	$5,%ecx
+	xorl	%edi,%eax
+	shrl	$5,%edx
+	xorl	%ecx,%ebx
+	shll	$21,%esi
+	xorl	%edx,%eax
+	shll	$21,%edi
+	xorl	%esi,%eax
+	shrl	$21,%ecx
+	xorl	%edi,%ebx
+	shrl	$21,%edx
+	xorl	%ecx,%eax
+	shll	$5,%esi
+	xorl	%edx,%ebx
+	shll	$5,%edi
+	xorl	%esi,%eax
+	xorl	%edi,%ebx
+	movl	8(%esp),%ecx
+	movl	12(%esp),%edx
+	movl	16(%esp),%esi
+	movl	20(%esp),%edi
+	addl	(%esp),%eax
+	adcl	4(%esp),%ebx
+	orl	%esi,%ecx
+	orl	%edi,%edx
+	andl	24(%esp),%ecx
+	andl	28(%esp),%edx
+	andl	8(%esp),%esi
+	andl	12(%esp),%edi
+	orl	%esi,%ecx
+	orl	%edi,%edx
+	addl	%ecx,%eax
+	adcl	%edx,%ebx
+	movl	%eax,(%esp)
+	movl	%ebx,4(%esp)
+	movb	(%ebp),%dl
+	subl	$8,%esp
+	leal	8(%ebp),%ebp
+	cmpb	$23,%dl
+	jne	L01016_79_x86
+	movl	840(%esp),%esi
+	movl	844(%esp),%edi
+	movl	(%esi),%eax
+	movl	4(%esi),%ebx
+	movl	8(%esi),%ecx
+	movl	12(%esi),%edx
+	addl	8(%esp),%eax
+	adcl	12(%esp),%ebx
+	movl	%eax,(%esi)
+	movl	%ebx,4(%esi)
+	addl	16(%esp),%ecx
+	adcl	20(%esp),%edx
+	movl	%ecx,8(%esi)
+	movl	%edx,12(%esi)
+	movl	16(%esi),%eax
+	movl	20(%esi),%ebx
+	movl	24(%esi),%ecx
+	movl	28(%esi),%edx
+	addl	24(%esp),%eax
+	adcl	28(%esp),%ebx
+	movl	%eax,16(%esi)
+	movl	%ebx,20(%esi)
+	addl	32(%esp),%ecx
+	adcl	36(%esp),%edx
+	movl	%ecx,24(%esi)
+	movl	%edx,28(%esi)
+	movl	32(%esi),%eax
+	movl	36(%esi),%ebx
+	movl	40(%esi),%ecx
+	movl	44(%esi),%edx
+	addl	40(%esp),%eax
+	adcl	44(%esp),%ebx
+	movl	%eax,32(%esi)
+	movl	%ebx,36(%esi)
+	addl	48(%esp),%ecx
+	adcl	52(%esp),%edx
+	movl	%ecx,40(%esi)
+	movl	%edx,44(%esi)
+	movl	48(%esi),%eax
+	movl	52(%esi),%ebx
+	movl	56(%esi),%ecx
+	movl	60(%esi),%edx
+	addl	56(%esp),%eax
+	adcl	60(%esp),%ebx
+	movl	%eax,48(%esi)
+	movl	%ebx,52(%esi)
+	addl	64(%esp),%ecx
+	adcl	68(%esp),%edx
+	movl	%ecx,56(%esi)
+	movl	%edx,60(%esi)
+	addl	$840,%esp
+	subl	$640,%ebp
+	cmpl	8(%esp),%edi
+	jb	L002loop_x86
+	movl	12(%esp),%esp
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+.align	6,0x90
+L001K512:
+.long	3609767458,1116352408
+.long	602891725,1899447441
+.long	3964484399,3049323471
+.long	2173295548,3921009573
+.long	4081628472,961987163
+.long	3053834265,1508970993
+.long	2937671579,2453635748
+.long	3664609560,2870763221
+.long	2734883394,3624381080
+.long	1164996542,310598401
+.long	1323610764,607225278
+.long	3590304994,1426881987
+.long	4068182383,1925078388
+.long	991336113,2162078206
+.long	633803317,2614888103
+.long	3479774868,3248222580
+.long	2666613458,3835390401
+.long	944711139,4022224774
+.long	2341262773,264347078
+.long	2007800933,604807628
+.long	1495990901,770255983
+.long	1856431235,1249150122
+.long	3175218132,1555081692
+.long	2198950837,1996064986
+.long	3999719339,2554220882
+.long	766784016,2821834349
+.long	2566594879,2952996808
+.long	3203337956,3210313671
+.long	1034457026,3336571891
+.long	2466948901,3584528711
+.long	3758326383,113926993
+.long	168717936,338241895
+.long	1188179964,666307205
+.long	1546045734,773529912
+.long	1522805485,1294757372
+.long	2643833823,1396182291
+.long	2343527390,1695183700
+.long	1014477480,1986661051
+.long	1206759142,2177026350
+.long	344077627,2456956037
+.long	1290863460,2730485921
+.long	3158454273,2820302411
+.long	3505952657,3259730800
+.long	106217008,3345764771
+.long	3606008344,3516065817
+.long	1432725776,3600352804
+.long	1467031594,4094571909
+.long	851169720,275423344
+.long	3100823752,430227734
+.long	1363258195,506948616
+.long	3750685593,659060556
+.long	3785050280,883997877
+.long	3318307427,958139571
+.long	3812723403,1322822218
+.long	2003034995,1537002063
+.long	3602036899,1747873779
+.long	1575990012,1955562222
+.long	1125592928,2024104815
+.long	2716904306,2227730452
+.long	442776044,2361852424
+.long	593698344,2428436474
+.long	3733110249,2756734187
+.long	2999351573,3204031479
+.long	3815920427,3329325298
+.long	3928383900,3391569614
+.long	566280711,3515267271
+.long	3454069534,3940187606
+.long	4000239992,4118630271
+.long	1914138554,116418474
+.long	2731055270,174292421
+.long	3203993006,289380356
+.long	320620315,460393269
+.long	587496836,685471733
+.long	1086792851,852142971
+.long	365543100,1017036298
+.long	2618297676,1126000580
+.long	3409855158,1288033470
+.long	4234509866,1501505948
+.long	987167468,1607167915
+.long	1246189591,1816402316
+.long	67438087,66051
+.long	202182159,134810123
+.byte	83,72,65,53,49,50,32,98,108,111,99,107,32,116,114,97
+.byte	110,115,102,111,114,109,32,102,111,114,32,120,56,54,44,32
+.byte	67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97
+.byte	112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103
+.byte	62,0
+.section __IMPORT,__pointers,non_lazy_symbol_pointers
+L_OPENSSL_ia32cap_P$non_lazy_ptr:
+.indirect_symbol	_OPENSSL_ia32cap_P
+.long	0
+#endif
diff --git a/third_party/boringssl/mac-x86_64/crypto/aes/aes-x86_64.S b/third_party/boringssl/mac-x86_64/crypto/aes/aes-x86_64.S
new file mode 100644
index 0000000..02f378b
--- /dev/null
+++ b/third_party/boringssl/mac-x86_64/crypto/aes/aes-x86_64.S
@@ -0,0 +1,2535 @@
+#if defined(__x86_64__)
+.text	
+
+.p2align	4
+_x86_64_AES_encrypt:
+	xorl	0(%r15),%eax
+	xorl	4(%r15),%ebx
+	xorl	8(%r15),%ecx
+	xorl	12(%r15),%edx
+
+	movl	240(%r15),%r13d
+	subl	$1,%r13d
+	jmp	L$enc_loop
+.p2align	4
+L$enc_loop:
+
+	movzbl	%al,%esi
+	movzbl	%bl,%edi
+	movzbl	%cl,%ebp
+	movl	0(%r14,%rsi,8),%r10d
+	movl	0(%r14,%rdi,8),%r11d
+	movl	0(%r14,%rbp,8),%r12d
+
+	movzbl	%bh,%esi
+	movzbl	%ch,%edi
+	movzbl	%dl,%ebp
+	xorl	3(%r14,%rsi,8),%r10d
+	xorl	3(%r14,%rdi,8),%r11d
+	movl	0(%r14,%rbp,8),%r8d
+
+	movzbl	%dh,%esi
+	shrl	$16,%ecx
+	movzbl	%ah,%ebp
+	xorl	3(%r14,%rsi,8),%r12d
+	shrl	$16,%edx
+	xorl	3(%r14,%rbp,8),%r8d
+
+	shrl	$16,%ebx
+	leaq	16(%r15),%r15
+	shrl	$16,%eax
+
+	movzbl	%cl,%esi
+	movzbl	%dl,%edi
+	movzbl	%al,%ebp
+	xorl	2(%r14,%rsi,8),%r10d
+	xorl	2(%r14,%rdi,8),%r11d
+	xorl	2(%r14,%rbp,8),%r12d
+
+	movzbl	%dh,%esi
+	movzbl	%ah,%edi
+	movzbl	%bl,%ebp
+	xorl	1(%r14,%rsi,8),%r10d
+	xorl	1(%r14,%rdi,8),%r11d
+	xorl	2(%r14,%rbp,8),%r8d
+
+	movl	12(%r15),%edx
+	movzbl	%bh,%edi
+	movzbl	%ch,%ebp
+	movl	0(%r15),%eax
+	xorl	1(%r14,%rdi,8),%r12d
+	xorl	1(%r14,%rbp,8),%r8d
+
+	movl	4(%r15),%ebx
+	movl	8(%r15),%ecx
+	xorl	%r10d,%eax
+	xorl	%r11d,%ebx
+	xorl	%r12d,%ecx
+	xorl	%r8d,%edx
+	subl	$1,%r13d
+	jnz	L$enc_loop
+	movzbl	%al,%esi
+	movzbl	%bl,%edi
+	movzbl	%cl,%ebp
+	movzbl	2(%r14,%rsi,8),%r10d
+	movzbl	2(%r14,%rdi,8),%r11d
+	movzbl	2(%r14,%rbp,8),%r12d
+
+	movzbl	%dl,%esi
+	movzbl	%bh,%edi
+	movzbl	%ch,%ebp
+	movzbl	2(%r14,%rsi,8),%r8d
+	movl	0(%r14,%rdi,8),%edi
+	movl	0(%r14,%rbp,8),%ebp
+
+	andl	$65280,%edi
+	andl	$65280,%ebp
+
+	xorl	%edi,%r10d
+	xorl	%ebp,%r11d
+	shrl	$16,%ecx
+
+	movzbl	%dh,%esi
+	movzbl	%ah,%edi
+	shrl	$16,%edx
+	movl	0(%r14,%rsi,8),%esi
+	movl	0(%r14,%rdi,8),%edi
+
+	andl	$65280,%esi
+	andl	$65280,%edi
+	shrl	$16,%ebx
+	xorl	%esi,%r12d
+	xorl	%edi,%r8d
+	shrl	$16,%eax
+
+	movzbl	%cl,%esi
+	movzbl	%dl,%edi
+	movzbl	%al,%ebp
+	movl	0(%r14,%rsi,8),%esi
+	movl	0(%r14,%rdi,8),%edi
+	movl	0(%r14,%rbp,8),%ebp
+
+	andl	$16711680,%esi
+	andl	$16711680,%edi
+	andl	$16711680,%ebp
+
+	xorl	%esi,%r10d
+	xorl	%edi,%r11d
+	xorl	%ebp,%r12d
+
+	movzbl	%bl,%esi
+	movzbl	%dh,%edi
+	movzbl	%ah,%ebp
+	movl	0(%r14,%rsi,8),%esi
+	movl	2(%r14,%rdi,8),%edi
+	movl	2(%r14,%rbp,8),%ebp
+
+	andl	$16711680,%esi
+	andl	$4278190080,%edi
+	andl	$4278190080,%ebp
+
+	xorl	%esi,%r8d
+	xorl	%edi,%r10d
+	xorl	%ebp,%r11d
+
+	movzbl	%bh,%esi
+	movzbl	%ch,%edi
+	movl	16+12(%r15),%edx
+	movl	2(%r14,%rsi,8),%esi
+	movl	2(%r14,%rdi,8),%edi
+	movl	16+0(%r15),%eax
+
+	andl	$4278190080,%esi
+	andl	$4278190080,%edi
+
+	xorl	%esi,%r12d
+	xorl	%edi,%r8d
+
+	movl	16+4(%r15),%ebx
+	movl	16+8(%r15),%ecx
+	xorl	%r10d,%eax
+	xorl	%r11d,%ebx
+	xorl	%r12d,%ecx
+	xorl	%r8d,%edx
+.byte	0xf3,0xc3
+
+
+.p2align	4
+_x86_64_AES_encrypt_compact:
+	leaq	128(%r14),%r8
+	movl	0-128(%r8),%edi
+	movl	32-128(%r8),%ebp
+	movl	64-128(%r8),%r10d
+	movl	96-128(%r8),%r11d
+	movl	128-128(%r8),%edi
+	movl	160-128(%r8),%ebp
+	movl	192-128(%r8),%r10d
+	movl	224-128(%r8),%r11d
+	jmp	L$enc_loop_compact
+.p2align	4
+L$enc_loop_compact:
+	xorl	0(%r15),%eax
+	xorl	4(%r15),%ebx
+	xorl	8(%r15),%ecx
+	xorl	12(%r15),%edx
+	leaq	16(%r15),%r15
+	movzbl	%al,%r10d
+	movzbl	%bl,%r11d
+	movzbl	%cl,%r12d
+	movzbl	%dl,%r8d
+	movzbl	%bh,%esi
+	movzbl	%ch,%edi
+	shrl	$16,%ecx
+	movzbl	%dh,%ebp
+	movzbl	(%r14,%r10,1),%r10d
+	movzbl	(%r14,%r11,1),%r11d
+	movzbl	(%r14,%r12,1),%r12d
+	movzbl	(%r14,%r8,1),%r8d
+
+	movzbl	(%r14,%rsi,1),%r9d
+	movzbl	%ah,%esi
+	movzbl	(%r14,%rdi,1),%r13d
+	movzbl	%cl,%edi
+	movzbl	(%r14,%rbp,1),%ebp
+	movzbl	(%r14,%rsi,1),%esi
+
+	shll	$8,%r9d
+	shrl	$16,%edx
+	shll	$8,%r13d
+	xorl	%r9d,%r10d
+	shrl	$16,%eax
+	movzbl	%dl,%r9d
+	shrl	$16,%ebx
+	xorl	%r13d,%r11d
+	shll	$8,%ebp
+	movzbl	%al,%r13d
+	movzbl	(%r14,%rdi,1),%edi
+	xorl	%ebp,%r12d
+
+	shll	$8,%esi
+	movzbl	%bl,%ebp
+	shll	$16,%edi
+	xorl	%esi,%r8d
+	movzbl	(%r14,%r9,1),%r9d
+	movzbl	%dh,%esi
+	movzbl	(%r14,%r13,1),%r13d
+	xorl	%edi,%r10d
+
+	shrl	$8,%ecx
+	movzbl	%ah,%edi
+	shll	$16,%r9d
+	shrl	$8,%ebx
+	shll	$16,%r13d
+	xorl	%r9d,%r11d
+	movzbl	(%r14,%rbp,1),%ebp
+	movzbl	(%r14,%rsi,1),%esi
+	movzbl	(%r14,%rdi,1),%edi
+	movzbl	(%r14,%rcx,1),%edx
+	movzbl	(%r14,%rbx,1),%ecx
+
+	shll	$16,%ebp
+	xorl	%r13d,%r12d
+	shll	$24,%esi
+	xorl	%ebp,%r8d
+	shll	$24,%edi
+	xorl	%esi,%r10d
+	shll	$24,%edx
+	xorl	%edi,%r11d
+	shll	$24,%ecx
+	movl	%r10d,%eax
+	movl	%r11d,%ebx
+	xorl	%r12d,%ecx
+	xorl	%r8d,%edx
+	cmpq	16(%rsp),%r15
+	je	L$enc_compact_done
+	movl	$2155905152,%r10d
+	movl	$2155905152,%r11d
+	andl	%eax,%r10d
+	andl	%ebx,%r11d
+	movl	%r10d,%esi
+	movl	%r11d,%edi
+	shrl	$7,%r10d
+	leal	(%rax,%rax,1),%r8d
+	shrl	$7,%r11d
+	leal	(%rbx,%rbx,1),%r9d
+	subl	%r10d,%esi
+	subl	%r11d,%edi
+	andl	$4278124286,%r8d
+	andl	$4278124286,%r9d
+	andl	$454761243,%esi
+	andl	$454761243,%edi
+	movl	%eax,%r10d
+	movl	%ebx,%r11d
+	xorl	%esi,%r8d
+	xorl	%edi,%r9d
+
+	xorl	%r8d,%eax
+	xorl	%r9d,%ebx
+	movl	$2155905152,%r12d
+	roll	$24,%eax
+	movl	$2155905152,%ebp
+	roll	$24,%ebx
+	andl	%ecx,%r12d
+	andl	%edx,%ebp
+	xorl	%r8d,%eax
+	xorl	%r9d,%ebx
+	movl	%r12d,%esi
+	rorl	$16,%r10d
+	movl	%ebp,%edi
+	rorl	$16,%r11d
+	leal	(%rcx,%rcx,1),%r8d
+	shrl	$7,%r12d
+	xorl	%r10d,%eax
+	shrl	$7,%ebp
+	xorl	%r11d,%ebx
+	rorl	$8,%r10d
+	leal	(%rdx,%rdx,1),%r9d
+	rorl	$8,%r11d
+	subl	%r12d,%esi
+	subl	%ebp,%edi
+	xorl	%r10d,%eax
+	xorl	%r11d,%ebx
+
+	andl	$4278124286,%r8d
+	andl	$4278124286,%r9d
+	andl	$454761243,%esi
+	andl	$454761243,%edi
+	movl	%ecx,%r12d
+	movl	%edx,%ebp
+	xorl	%esi,%r8d
+	xorl	%edi,%r9d
+
+	rorl	$16,%r12d
+	xorl	%r8d,%ecx
+	rorl	$16,%ebp
+	xorl	%r9d,%edx
+	roll	$24,%ecx
+	movl	0(%r14),%esi
+	roll	$24,%edx
+	xorl	%r8d,%ecx
+	movl	64(%r14),%edi
+	xorl	%r9d,%edx
+	movl	128(%r14),%r8d
+	xorl	%r12d,%ecx
+	rorl	$8,%r12d
+	xorl	%ebp,%edx
+	rorl	$8,%ebp
+	xorl	%r12d,%ecx
+	movl	192(%r14),%r9d
+	xorl	%ebp,%edx
+	jmp	L$enc_loop_compact
+.p2align	4
+L$enc_compact_done:
+	xorl	0(%r15),%eax
+	xorl	4(%r15),%ebx
+	xorl	8(%r15),%ecx
+	xorl	12(%r15),%edx
+.byte	0xf3,0xc3
+
+.p2align	4
+.globl	_asm_AES_encrypt
+.private_extern _asm_AES_encrypt
+
+.private_extern	_asm_AES_encrypt
+_asm_AES_encrypt:
+	pushq	%rbx
+	pushq	%rbp
+	pushq	%r12
+	pushq	%r13
+	pushq	%r14
+	pushq	%r15
+
+
+	movq	%rsp,%r10
+	leaq	-63(%rdx),%rcx
+	andq	$-64,%rsp
+	subq	%rsp,%rcx
+	negq	%rcx
+	andq	$960,%rcx
+	subq	%rcx,%rsp
+	subq	$32,%rsp
+
+	movq	%rsi,16(%rsp)
+	movq	%r10,24(%rsp)
+L$enc_prologue:
+
+	movq	%rdx,%r15
+	movl	240(%r15),%r13d
+
+	movl	0(%rdi),%eax
+	movl	4(%rdi),%ebx
+	movl	8(%rdi),%ecx
+	movl	12(%rdi),%edx
+
+	shll	$4,%r13d
+	leaq	(%r15,%r13,1),%rbp
+	movq	%r15,(%rsp)
+	movq	%rbp,8(%rsp)
+
+
+	leaq	L$AES_Te+2048(%rip),%r14
+	leaq	768(%rsp),%rbp
+	subq	%r14,%rbp
+	andq	$768,%rbp
+	leaq	(%r14,%rbp,1),%r14
+
+	call	_x86_64_AES_encrypt_compact
+
+	movq	16(%rsp),%r9
+	movq	24(%rsp),%rsi
+	movl	%eax,0(%r9)
+	movl	%ebx,4(%r9)
+	movl	%ecx,8(%r9)
+	movl	%edx,12(%r9)
+
+	movq	(%rsi),%r15
+	movq	8(%rsi),%r14
+	movq	16(%rsi),%r13
+	movq	24(%rsi),%r12
+	movq	32(%rsi),%rbp
+	movq	40(%rsi),%rbx
+	leaq	48(%rsi),%rsp
+L$enc_epilogue:
+	.byte	0xf3,0xc3
+
+
+.p2align	4
+_x86_64_AES_decrypt:
+	xorl	0(%r15),%eax
+	xorl	4(%r15),%ebx
+	xorl	8(%r15),%ecx
+	xorl	12(%r15),%edx
+
+	movl	240(%r15),%r13d
+	subl	$1,%r13d
+	jmp	L$dec_loop
+.p2align	4
+L$dec_loop:
+
+	movzbl	%al,%esi
+	movzbl	%bl,%edi
+	movzbl	%cl,%ebp
+	movl	0(%r14,%rsi,8),%r10d
+	movl	0(%r14,%rdi,8),%r11d
+	movl	0(%r14,%rbp,8),%r12d
+
+	movzbl	%dh,%esi
+	movzbl	%ah,%edi
+	movzbl	%dl,%ebp
+	xorl	3(%r14,%rsi,8),%r10d
+	xorl	3(%r14,%rdi,8),%r11d
+	movl	0(%r14,%rbp,8),%r8d
+
+	movzbl	%bh,%esi
+	shrl	$16,%eax
+	movzbl	%ch,%ebp
+	xorl	3(%r14,%rsi,8),%r12d
+	shrl	$16,%edx
+	xorl	3(%r14,%rbp,8),%r8d
+
+	shrl	$16,%ebx
+	leaq	16(%r15),%r15
+	shrl	$16,%ecx
+
+	movzbl	%cl,%esi
+	movzbl	%dl,%edi
+	movzbl	%al,%ebp
+	xorl	2(%r14,%rsi,8),%r10d
+	xorl	2(%r14,%rdi,8),%r11d
+	xorl	2(%r14,%rbp,8),%r12d
+
+	movzbl	%bh,%esi
+	movzbl	%ch,%edi
+	movzbl	%bl,%ebp
+	xorl	1(%r14,%rsi,8),%r10d
+	xorl	1(%r14,%rdi,8),%r11d
+	xorl	2(%r14,%rbp,8),%r8d
+
+	movzbl	%dh,%esi
+	movl	12(%r15),%edx
+	movzbl	%ah,%ebp
+	xorl	1(%r14,%rsi,8),%r12d
+	movl	0(%r15),%eax
+	xorl	1(%r14,%rbp,8),%r8d
+
+	xorl	%r10d,%eax
+	movl	4(%r15),%ebx
+	movl	8(%r15),%ecx
+	xorl	%r12d,%ecx
+	xorl	%r11d,%ebx
+	xorl	%r8d,%edx
+	subl	$1,%r13d
+	jnz	L$dec_loop
+	leaq	2048(%r14),%r14
+	movzbl	%al,%esi
+	movzbl	%bl,%edi
+	movzbl	%cl,%ebp
+	movzbl	(%r14,%rsi,1),%r10d
+	movzbl	(%r14,%rdi,1),%r11d
+	movzbl	(%r14,%rbp,1),%r12d
+
+	movzbl	%dl,%esi
+	movzbl	%dh,%edi
+	movzbl	%ah,%ebp
+	movzbl	(%r14,%rsi,1),%r8d
+	movzbl	(%r14,%rdi,1),%edi
+	movzbl	(%r14,%rbp,1),%ebp
+
+	shll	$8,%edi
+	shll	$8,%ebp
+
+	xorl	%edi,%r10d
+	xorl	%ebp,%r11d
+	shrl	$16,%edx
+
+	movzbl	%bh,%esi
+	movzbl	%ch,%edi
+	shrl	$16,%eax
+	movzbl	(%r14,%rsi,1),%esi
+	movzbl	(%r14,%rdi,1),%edi
+
+	shll	$8,%esi
+	shll	$8,%edi
+	shrl	$16,%ebx
+	xorl	%esi,%r12d
+	xorl	%edi,%r8d
+	shrl	$16,%ecx
+
+	movzbl	%cl,%esi
+	movzbl	%dl,%edi
+	movzbl	%al,%ebp
+	movzbl	(%r14,%rsi,1),%esi
+	movzbl	(%r14,%rdi,1),%edi
+	movzbl	(%r14,%rbp,1),%ebp
+
+	shll	$16,%esi
+	shll	$16,%edi
+	shll	$16,%ebp
+
+	xorl	%esi,%r10d
+	xorl	%edi,%r11d
+	xorl	%ebp,%r12d
+
+	movzbl	%bl,%esi
+	movzbl	%bh,%edi
+	movzbl	%ch,%ebp
+	movzbl	(%r14,%rsi,1),%esi
+	movzbl	(%r14,%rdi,1),%edi
+	movzbl	(%r14,%rbp,1),%ebp
+
+	shll	$16,%esi
+	shll	$24,%edi
+	shll	$24,%ebp
+
+	xorl	%esi,%r8d
+	xorl	%edi,%r10d
+	xorl	%ebp,%r11d
+
+	movzbl	%dh,%esi
+	movzbl	%ah,%edi
+	movl	16+12(%r15),%edx
+	movzbl	(%r14,%rsi,1),%esi
+	movzbl	(%r14,%rdi,1),%edi
+	movl	16+0(%r15),%eax
+
+	shll	$24,%esi
+	shll	$24,%edi
+
+	xorl	%esi,%r12d
+	xorl	%edi,%r8d
+
+	movl	16+4(%r15),%ebx
+	movl	16+8(%r15),%ecx
+	leaq	-2048(%r14),%r14
+	xorl	%r10d,%eax
+	xorl	%r11d,%ebx
+	xorl	%r12d,%ecx
+	xorl	%r8d,%edx
+.byte	0xf3,0xc3
+
+
+.p2align	4
+_x86_64_AES_decrypt_compact:
+	leaq	128(%r14),%r8
+	movl	0-128(%r8),%edi
+	movl	32-128(%r8),%ebp
+	movl	64-128(%r8),%r10d
+	movl	96-128(%r8),%r11d
+	movl	128-128(%r8),%edi
+	movl	160-128(%r8),%ebp
+	movl	192-128(%r8),%r10d
+	movl	224-128(%r8),%r11d
+	jmp	L$dec_loop_compact
+
+.p2align	4
+L$dec_loop_compact:
+	xorl	0(%r15),%eax
+	xorl	4(%r15),%ebx
+	xorl	8(%r15),%ecx
+	xorl	12(%r15),%edx
+	leaq	16(%r15),%r15
+	movzbl	%al,%r10d
+	movzbl	%bl,%r11d
+	movzbl	%cl,%r12d
+	movzbl	%dl,%r8d
+	movzbl	%dh,%esi
+	movzbl	%ah,%edi
+	shrl	$16,%edx
+	movzbl	%bh,%ebp
+	movzbl	(%r14,%r10,1),%r10d
+	movzbl	(%r14,%r11,1),%r11d
+	movzbl	(%r14,%r12,1),%r12d
+	movzbl	(%r14,%r8,1),%r8d
+
+	movzbl	(%r14,%rsi,1),%r9d
+	movzbl	%ch,%esi
+	movzbl	(%r14,%rdi,1),%r13d
+	movzbl	(%r14,%rbp,1),%ebp
+	movzbl	(%r14,%rsi,1),%esi
+
+	shrl	$16,%ecx
+	shll	$8,%r13d
+	shll	$8,%r9d
+	movzbl	%cl,%edi
+	shrl	$16,%eax
+	xorl	%r9d,%r10d
+	shrl	$16,%ebx
+	movzbl	%dl,%r9d
+
+	shll	$8,%ebp
+	xorl	%r13d,%r11d
+	shll	$8,%esi
+	movzbl	%al,%r13d
+	movzbl	(%r14,%rdi,1),%edi
+	xorl	%ebp,%r12d
+	movzbl	%bl,%ebp
+
+	shll	$16,%edi
+	xorl	%esi,%r8d
+	movzbl	(%r14,%r9,1),%r9d
+	movzbl	%bh,%esi
+	movzbl	(%r14,%rbp,1),%ebp
+	xorl	%edi,%r10d
+	movzbl	(%r14,%r13,1),%r13d
+	movzbl	%ch,%edi
+
+	shll	$16,%ebp
+	shll	$16,%r9d
+	shll	$16,%r13d
+	xorl	%ebp,%r8d
+	movzbl	%dh,%ebp
+	xorl	%r9d,%r11d
+	shrl	$8,%eax
+	xorl	%r13d,%r12d
+
+	movzbl	(%r14,%rsi,1),%esi
+	movzbl	(%r14,%rdi,1),%ebx
+	movzbl	(%r14,%rbp,1),%ecx
+	movzbl	(%r14,%rax,1),%edx
+
+	movl	%r10d,%eax
+	shll	$24,%esi
+	shll	$24,%ebx
+	shll	$24,%ecx
+	xorl	%esi,%eax
+	shll	$24,%edx
+	xorl	%r11d,%ebx
+	xorl	%r12d,%ecx
+	xorl	%r8d,%edx
+	cmpq	16(%rsp),%r15
+	je	L$dec_compact_done
+
+	movq	256+0(%r14),%rsi
+	shlq	$32,%rbx
+	shlq	$32,%rdx
+	movq	256+8(%r14),%rdi
+	orq	%rbx,%rax
+	orq	%rdx,%rcx
+	movq	256+16(%r14),%rbp
+	movq	%rsi,%r9
+	movq	%rsi,%r12
+	andq	%rax,%r9
+	andq	%rcx,%r12
+	movq	%r9,%rbx
+	movq	%r12,%rdx
+	shrq	$7,%r9
+	leaq	(%rax,%rax,1),%r8
+	shrq	$7,%r12
+	leaq	(%rcx,%rcx,1),%r11
+	subq	%r9,%rbx
+	subq	%r12,%rdx
+	andq	%rdi,%r8
+	andq	%rdi,%r11
+	andq	%rbp,%rbx
+	andq	%rbp,%rdx
+	xorq	%rbx,%r8
+	xorq	%rdx,%r11
+	movq	%rsi,%r10
+	movq	%rsi,%r13
+
+	andq	%r8,%r10
+	andq	%r11,%r13
+	movq	%r10,%rbx
+	movq	%r13,%rdx
+	shrq	$7,%r10
+	leaq	(%r8,%r8,1),%r9
+	shrq	$7,%r13
+	leaq	(%r11,%r11,1),%r12
+	subq	%r10,%rbx
+	subq	%r13,%rdx
+	andq	%rdi,%r9
+	andq	%rdi,%r12
+	andq	%rbp,%rbx
+	andq	%rbp,%rdx
+	xorq	%rbx,%r9
+	xorq	%rdx,%r12
+	movq	%rsi,%r10
+	movq	%rsi,%r13
+
+	andq	%r9,%r10
+	andq	%r12,%r13
+	movq	%r10,%rbx
+	movq	%r13,%rdx
+	shrq	$7,%r10
+	xorq	%rax,%r8
+	shrq	$7,%r13
+	xorq	%rcx,%r11
+	subq	%r10,%rbx
+	subq	%r13,%rdx
+	leaq	(%r9,%r9,1),%r10
+	leaq	(%r12,%r12,1),%r13
+	xorq	%rax,%r9
+	xorq	%rcx,%r12
+	andq	%rdi,%r10
+	andq	%rdi,%r13
+	andq	%rbp,%rbx
+	andq	%rbp,%rdx
+	xorq	%rbx,%r10
+	xorq	%rdx,%r13
+
+	xorq	%r10,%rax
+	xorq	%r13,%rcx
+	xorq	%r10,%r8
+	xorq	%r13,%r11
+	movq	%rax,%rbx
+	movq	%rcx,%rdx
+	xorq	%r10,%r9
+	shrq	$32,%rbx
+	xorq	%r13,%r12
+	shrq	$32,%rdx
+	xorq	%r8,%r10
+	roll	$8,%eax
+	xorq	%r11,%r13
+	roll	$8,%ecx
+	xorq	%r9,%r10
+	roll	$8,%ebx
+	xorq	%r12,%r13
+
+	roll	$8,%edx
+	xorl	%r10d,%eax
+	shrq	$32,%r10
+	xorl	%r13d,%ecx
+	shrq	$32,%r13
+	xorl	%r10d,%ebx
+	xorl	%r13d,%edx
+
+	movq	%r8,%r10
+	roll	$24,%r8d
+	movq	%r11,%r13
+	roll	$24,%r11d
+	shrq	$32,%r10
+	xorl	%r8d,%eax
+	shrq	$32,%r13
+	xorl	%r11d,%ecx
+	roll	$24,%r10d
+	movq	%r9,%r8
+	roll	$24,%r13d
+	movq	%r12,%r11
+	shrq	$32,%r8
+	xorl	%r10d,%ebx
+	shrq	$32,%r11
+	xorl	%r13d,%edx
+
+	movq	0(%r14),%rsi
+	roll	$16,%r9d
+	movq	64(%r14),%rdi
+	roll	$16,%r12d
+	movq	128(%r14),%rbp
+	roll	$16,%r8d
+	movq	192(%r14),%r10
+	xorl	%r9d,%eax
+	roll	$16,%r11d
+	xorl	%r12d,%ecx
+	movq	256(%r14),%r13
+	xorl	%r8d,%ebx
+	xorl	%r11d,%edx
+	jmp	L$dec_loop_compact
+.p2align	4
+L$dec_compact_done:
+	xorl	0(%r15),%eax
+	xorl	4(%r15),%ebx
+	xorl	8(%r15),%ecx
+	xorl	12(%r15),%edx
+.byte	0xf3,0xc3
+
+.p2align	4
+.globl	_asm_AES_decrypt
+.private_extern _asm_AES_decrypt
+
+.private_extern	_asm_AES_decrypt
+_asm_AES_decrypt:
+	pushq	%rbx
+	pushq	%rbp
+	pushq	%r12
+	pushq	%r13
+	pushq	%r14
+	pushq	%r15
+
+
+	movq	%rsp,%r10
+	leaq	-63(%rdx),%rcx
+	andq	$-64,%rsp
+	subq	%rsp,%rcx
+	negq	%rcx
+	andq	$960,%rcx
+	subq	%rcx,%rsp
+	subq	$32,%rsp
+
+	movq	%rsi,16(%rsp)
+	movq	%r10,24(%rsp)
+L$dec_prologue:
+
+	movq	%rdx,%r15
+	movl	240(%r15),%r13d
+
+	movl	0(%rdi),%eax
+	movl	4(%rdi),%ebx
+	movl	8(%rdi),%ecx
+	movl	12(%rdi),%edx
+
+	shll	$4,%r13d
+	leaq	(%r15,%r13,1),%rbp
+	movq	%r15,(%rsp)
+	movq	%rbp,8(%rsp)
+
+
+	leaq	L$AES_Td+2048(%rip),%r14
+	leaq	768(%rsp),%rbp
+	subq	%r14,%rbp
+	andq	$768,%rbp
+	leaq	(%r14,%rbp,1),%r14
+	shrq	$3,%rbp
+	addq	%rbp,%r14
+
+	call	_x86_64_AES_decrypt_compact
+
+	movq	16(%rsp),%r9
+	movq	24(%rsp),%rsi
+	movl	%eax,0(%r9)
+	movl	%ebx,4(%r9)
+	movl	%ecx,8(%r9)
+	movl	%edx,12(%r9)
+
+	movq	(%rsi),%r15
+	movq	8(%rsi),%r14
+	movq	16(%rsi),%r13
+	movq	24(%rsi),%r12
+	movq	32(%rsi),%rbp
+	movq	40(%rsi),%rbx
+	leaq	48(%rsi),%rsp
+L$dec_epilogue:
+	.byte	0xf3,0xc3
+
+.p2align	4
+.globl	_asm_AES_set_encrypt_key
+.private_extern _asm_AES_set_encrypt_key
+
+_asm_AES_set_encrypt_key:
+	pushq	%rbx
+	pushq	%rbp
+	pushq	%r12
+	pushq	%r13
+	pushq	%r14
+	pushq	%r15
+	subq	$8,%rsp
+L$enc_key_prologue:
+
+	call	_x86_64_AES_set_encrypt_key
+
+	movq	40(%rsp),%rbp
+	movq	48(%rsp),%rbx
+	addq	$56,%rsp
+L$enc_key_epilogue:
+	.byte	0xf3,0xc3
+
+
+
+.p2align	4
+_x86_64_AES_set_encrypt_key:
+	movl	%esi,%ecx
+	movq	%rdi,%rsi
+	movq	%rdx,%rdi
+
+	testq	$-1,%rsi
+	jz	L$badpointer
+	testq	$-1,%rdi
+	jz	L$badpointer
+
+	leaq	L$AES_Te(%rip),%rbp
+	leaq	2048+128(%rbp),%rbp
+
+
+	movl	0-128(%rbp),%eax
+	movl	32-128(%rbp),%ebx
+	movl	64-128(%rbp),%r8d
+	movl	96-128(%rbp),%edx
+	movl	128-128(%rbp),%eax
+	movl	160-128(%rbp),%ebx
+	movl	192-128(%rbp),%r8d
+	movl	224-128(%rbp),%edx
+
+	cmpl	$128,%ecx
+	je	L$10rounds
+	cmpl	$192,%ecx
+	je	L$12rounds
+	cmpl	$256,%ecx
+	je	L$14rounds
+	movq	$-2,%rax
+	jmp	L$exit
+
+L$10rounds:
+	movq	0(%rsi),%rax
+	movq	8(%rsi),%rdx
+	movq	%rax,0(%rdi)
+	movq	%rdx,8(%rdi)
+
+	shrq	$32,%rdx
+	xorl	%ecx,%ecx
+	jmp	L$10shortcut
+.p2align	2
+L$10loop:
+	movl	0(%rdi),%eax
+	movl	12(%rdi),%edx
+L$10shortcut:
+	movzbl	%dl,%esi
+	movzbl	-128(%rbp,%rsi,1),%ebx
+	movzbl	%dh,%esi
+	shll	$24,%ebx
+	xorl	%ebx,%eax
+
+	movzbl	-128(%rbp,%rsi,1),%ebx
+	shrl	$16,%edx
+	movzbl	%dl,%esi
+	xorl	%ebx,%eax
+
+	movzbl	-128(%rbp,%rsi,1),%ebx
+	movzbl	%dh,%esi
+	shll	$8,%ebx
+	xorl	%ebx,%eax
+
+	movzbl	-128(%rbp,%rsi,1),%ebx
+	shll	$16,%ebx
+	xorl	%ebx,%eax
+
+	xorl	1024-128(%rbp,%rcx,4),%eax
+	movl	%eax,16(%rdi)
+	xorl	4(%rdi),%eax
+	movl	%eax,20(%rdi)
+	xorl	8(%rdi),%eax
+	movl	%eax,24(%rdi)
+	xorl	12(%rdi),%eax
+	movl	%eax,28(%rdi)
+	addl	$1,%ecx
+	leaq	16(%rdi),%rdi
+	cmpl	$10,%ecx
+	jl	L$10loop
+
+	movl	$10,80(%rdi)
+	xorq	%rax,%rax
+	jmp	L$exit
+
+L$12rounds:
+	movq	0(%rsi),%rax
+	movq	8(%rsi),%rbx
+	movq	16(%rsi),%rdx
+	movq	%rax,0(%rdi)
+	movq	%rbx,8(%rdi)
+	movq	%rdx,16(%rdi)
+
+	shrq	$32,%rdx
+	xorl	%ecx,%ecx
+	jmp	L$12shortcut
+.p2align	2
+L$12loop:
+	movl	0(%rdi),%eax
+	movl	20(%rdi),%edx
+L$12shortcut:
+	movzbl	%dl,%esi
+	movzbl	-128(%rbp,%rsi,1),%ebx
+	movzbl	%dh,%esi
+	shll	$24,%ebx
+	xorl	%ebx,%eax
+
+	movzbl	-128(%rbp,%rsi,1),%ebx
+	shrl	$16,%edx
+	movzbl	%dl,%esi
+	xorl	%ebx,%eax
+
+	movzbl	-128(%rbp,%rsi,1),%ebx
+	movzbl	%dh,%esi
+	shll	$8,%ebx
+	xorl	%ebx,%eax
+
+	movzbl	-128(%rbp,%rsi,1),%ebx
+	shll	$16,%ebx
+	xorl	%ebx,%eax
+
+	xorl	1024-128(%rbp,%rcx,4),%eax
+	movl	%eax,24(%rdi)
+	xorl	4(%rdi),%eax
+	movl	%eax,28(%rdi)
+	xorl	8(%rdi),%eax
+	movl	%eax,32(%rdi)
+	xorl	12(%rdi),%eax
+	movl	%eax,36(%rdi)
+
+	cmpl	$7,%ecx
+	je	L$12break
+	addl	$1,%ecx
+
+	xorl	16(%rdi),%eax
+	movl	%eax,40(%rdi)
+	xorl	20(%rdi),%eax
+	movl	%eax,44(%rdi)
+
+	leaq	24(%rdi),%rdi
+	jmp	L$12loop
+L$12break:
+	movl	$12,72(%rdi)
+	xorq	%rax,%rax
+	jmp	L$exit
+
+L$14rounds:
+	movq	0(%rsi),%rax
+	movq	8(%rsi),%rbx
+	movq	16(%rsi),%rcx
+	movq	24(%rsi),%rdx
+	movq	%rax,0(%rdi)
+	movq	%rbx,8(%rdi)
+	movq	%rcx,16(%rdi)
+	movq	%rdx,24(%rdi)
+
+	shrq	$32,%rdx
+	xorl	%ecx,%ecx
+	jmp	L$14shortcut
+.p2align	2
+L$14loop:
+	movl	0(%rdi),%eax
+	movl	28(%rdi),%edx
+L$14shortcut:
+	movzbl	%dl,%esi
+	movzbl	-128(%rbp,%rsi,1),%ebx
+	movzbl	%dh,%esi
+	shll	$24,%ebx
+	xorl	%ebx,%eax
+
+	movzbl	-128(%rbp,%rsi,1),%ebx
+	shrl	$16,%edx
+	movzbl	%dl,%esi
+	xorl	%ebx,%eax
+
+	movzbl	-128(%rbp,%rsi,1),%ebx
+	movzbl	%dh,%esi
+	shll	$8,%ebx
+	xorl	%ebx,%eax
+
+	movzbl	-128(%rbp,%rsi,1),%ebx
+	shll	$16,%ebx
+	xorl	%ebx,%eax
+
+	xorl	1024-128(%rbp,%rcx,4),%eax
+	movl	%eax,32(%rdi)
+	xorl	4(%rdi),%eax
+	movl	%eax,36(%rdi)
+	xorl	8(%rdi),%eax
+	movl	%eax,40(%rdi)
+	xorl	12(%rdi),%eax
+	movl	%eax,44(%rdi)
+
+	cmpl	$6,%ecx
+	je	L$14break
+	addl	$1,%ecx
+
+	movl	%eax,%edx
+	movl	16(%rdi),%eax
+	movzbl	%dl,%esi
+	movzbl	-128(%rbp,%rsi,1),%ebx
+	movzbl	%dh,%esi
+	xorl	%ebx,%eax
+
+	movzbl	-128(%rbp,%rsi,1),%ebx
+	shrl	$16,%edx
+	shll	$8,%ebx
+	movzbl	%dl,%esi
+	xorl	%ebx,%eax
+
+	movzbl	-128(%rbp,%rsi,1),%ebx
+	movzbl	%dh,%esi
+	shll	$16,%ebx
+	xorl	%ebx,%eax
+
+	movzbl	-128(%rbp,%rsi,1),%ebx
+	shll	$24,%ebx
+	xorl	%ebx,%eax
+
+	movl	%eax,48(%rdi)
+	xorl	20(%rdi),%eax
+	movl	%eax,52(%rdi)
+	xorl	24(%rdi),%eax
+	movl	%eax,56(%rdi)
+	xorl	28(%rdi),%eax
+	movl	%eax,60(%rdi)
+
+	leaq	32(%rdi),%rdi
+	jmp	L$14loop
+L$14break:
+	movl	$14,48(%rdi)
+	xorq	%rax,%rax
+	jmp	L$exit
+
+L$badpointer:
+	movq	$-1,%rax
+L$exit:
+.byte	0xf3,0xc3
+
+.p2align	4
+.globl	_asm_AES_set_decrypt_key
+.private_extern _asm_AES_set_decrypt_key
+
+_asm_AES_set_decrypt_key:
+	pushq	%rbx
+	pushq	%rbp
+	pushq	%r12
+	pushq	%r13
+	pushq	%r14
+	pushq	%r15
+	pushq	%rdx
+L$dec_key_prologue:
+
+	call	_x86_64_AES_set_encrypt_key
+	movq	(%rsp),%r8
+	cmpl	$0,%eax
+	jne	L$abort
+
+	movl	240(%r8),%r14d
+	xorq	%rdi,%rdi
+	leaq	(%rdi,%r14,4),%rcx
+	movq	%r8,%rsi
+	leaq	(%r8,%rcx,4),%rdi
+.p2align	2
+L$invert:
+	movq	0(%rsi),%rax
+	movq	8(%rsi),%rbx
+	movq	0(%rdi),%rcx
+	movq	8(%rdi),%rdx
+	movq	%rax,0(%rdi)
+	movq	%rbx,8(%rdi)
+	movq	%rcx,0(%rsi)
+	movq	%rdx,8(%rsi)
+	leaq	16(%rsi),%rsi
+	leaq	-16(%rdi),%rdi
+	cmpq	%rsi,%rdi
+	jne	L$invert
+
+	leaq	L$AES_Te+2048+1024(%rip),%rax
+
+	movq	40(%rax),%rsi
+	movq	48(%rax),%rdi
+	movq	56(%rax),%rbp
+
+	movq	%r8,%r15
+	subl	$1,%r14d
+.p2align	2
+L$permute:
+	leaq	16(%r15),%r15
+	movq	0(%r15),%rax
+	movq	8(%r15),%rcx
+	movq	%rsi,%r9
+	movq	%rsi,%r12
+	andq	%rax,%r9
+	andq	%rcx,%r12
+	movq	%r9,%rbx
+	movq	%r12,%rdx
+	shrq	$7,%r9
+	leaq	(%rax,%rax,1),%r8
+	shrq	$7,%r12
+	leaq	(%rcx,%rcx,1),%r11
+	subq	%r9,%rbx
+	subq	%r12,%rdx
+	andq	%rdi,%r8
+	andq	%rdi,%r11
+	andq	%rbp,%rbx
+	andq	%rbp,%rdx
+	xorq	%rbx,%r8
+	xorq	%rdx,%r11
+	movq	%rsi,%r10
+	movq	%rsi,%r13
+
+	andq	%r8,%r10
+	andq	%r11,%r13
+	movq	%r10,%rbx
+	movq	%r13,%rdx
+	shrq	$7,%r10
+	leaq	(%r8,%r8,1),%r9
+	shrq	$7,%r13
+	leaq	(%r11,%r11,1),%r12
+	subq	%r10,%rbx
+	subq	%r13,%rdx
+	andq	%rdi,%r9
+	andq	%rdi,%r12
+	andq	%rbp,%rbx
+	andq	%rbp,%rdx
+	xorq	%rbx,%r9
+	xorq	%rdx,%r12
+	movq	%rsi,%r10
+	movq	%rsi,%r13
+
+	andq	%r9,%r10
+	andq	%r12,%r13
+	movq	%r10,%rbx
+	movq	%r13,%rdx
+	shrq	$7,%r10
+	xorq	%rax,%r8
+	shrq	$7,%r13
+	xorq	%rcx,%r11
+	subq	%r10,%rbx
+	subq	%r13,%rdx
+	leaq	(%r9,%r9,1),%r10
+	leaq	(%r12,%r12,1),%r13
+	xorq	%rax,%r9
+	xorq	%rcx,%r12
+	andq	%rdi,%r10
+	andq	%rdi,%r13
+	andq	%rbp,%rbx
+	andq	%rbp,%rdx
+	xorq	%rbx,%r10
+	xorq	%rdx,%r13
+
+	xorq	%r10,%rax
+	xorq	%r13,%rcx
+	xorq	%r10,%r8
+	xorq	%r13,%r11
+	movq	%rax,%rbx
+	movq	%rcx,%rdx
+	xorq	%r10,%r9
+	shrq	$32,%rbx
+	xorq	%r13,%r12
+	shrq	$32,%rdx
+	xorq	%r8,%r10
+	roll	$8,%eax
+	xorq	%r11,%r13
+	roll	$8,%ecx
+	xorq	%r9,%r10
+	roll	$8,%ebx
+	xorq	%r12,%r13
+
+	roll	$8,%edx
+	xorl	%r10d,%eax
+	shrq	$32,%r10
+	xorl	%r13d,%ecx
+	shrq	$32,%r13
+	xorl	%r10d,%ebx
+	xorl	%r13d,%edx
+
+	movq	%r8,%r10
+	roll	$24,%r8d
+	movq	%r11,%r13
+	roll	$24,%r11d
+	shrq	$32,%r10
+	xorl	%r8d,%eax
+	shrq	$32,%r13
+	xorl	%r11d,%ecx
+	roll	$24,%r10d
+	movq	%r9,%r8
+	roll	$24,%r13d
+	movq	%r12,%r11
+	shrq	$32,%r8
+	xorl	%r10d,%ebx
+	shrq	$32,%r11
+	xorl	%r13d,%edx
+
+
+	roll	$16,%r9d
+
+	roll	$16,%r12d
+
+	roll	$16,%r8d
+
+	xorl	%r9d,%eax
+	roll	$16,%r11d
+	xorl	%r12d,%ecx
+
+	xorl	%r8d,%ebx
+	xorl	%r11d,%edx
+	movl	%eax,0(%r15)
+	movl	%ebx,4(%r15)
+	movl	%ecx,8(%r15)
+	movl	%edx,12(%r15)
+	subl	$1,%r14d
+	jnz	L$permute
+
+	xorq	%rax,%rax
+L$abort:
+	movq	8(%rsp),%r15
+	movq	16(%rsp),%r14
+	movq	24(%rsp),%r13
+	movq	32(%rsp),%r12
+	movq	40(%rsp),%rbp
+	movq	48(%rsp),%rbx
+	addq	$56,%rsp
+L$dec_key_epilogue:
+	.byte	0xf3,0xc3
+
+.p2align	4
+.globl	_asm_AES_cbc_encrypt
+.private_extern _asm_AES_cbc_encrypt
+
+
+.private_extern	_asm_AES_cbc_encrypt
+_asm_AES_cbc_encrypt:
+	cmpq	$0,%rdx
+	je	L$cbc_epilogue
+	pushfq
+	pushq	%rbx
+	pushq	%rbp
+	pushq	%r12
+	pushq	%r13
+	pushq	%r14
+	pushq	%r15
+L$cbc_prologue:
+
+	cld
+	movl	%r9d,%r9d
+
+	leaq	L$AES_Te(%rip),%r14
+	cmpq	$0,%r9
+	jne	L$cbc_picked_te
+	leaq	L$AES_Td(%rip),%r14
+L$cbc_picked_te:
+
+	movl	_OPENSSL_ia32cap_P(%rip),%r10d
+	cmpq	$512,%rdx
+	jb	L$cbc_slow_prologue
+	testq	$15,%rdx
+	jnz	L$cbc_slow_prologue
+	btl	$28,%r10d
+	jc	L$cbc_slow_prologue
+
+
+	leaq	-88-248(%rsp),%r15
+	andq	$-64,%r15
+
+
+	movq	%r14,%r10
+	leaq	2304(%r14),%r11
+	movq	%r15,%r12
+	andq	$4095,%r10
+	andq	$4095,%r11
+	andq	$4095,%r12
+
+	cmpq	%r11,%r12
+	jb	L$cbc_te_break_out
+	subq	%r11,%r12
+	subq	%r12,%r15
+	jmp	L$cbc_te_ok
+L$cbc_te_break_out:
+	subq	%r10,%r12
+	andq	$4095,%r12
+	addq	$320,%r12
+	subq	%r12,%r15
+.p2align	2
+L$cbc_te_ok:
+
+	xchgq	%rsp,%r15
+
+	movq	%r15,16(%rsp)
+L$cbc_fast_body:
+	movq	%rdi,24(%rsp)
+	movq	%rsi,32(%rsp)
+	movq	%rdx,40(%rsp)
+	movq	%rcx,48(%rsp)
+	movq	%r8,56(%rsp)
+	movl	$0,80+240(%rsp)
+	movq	%r8,%rbp
+	movq	%r9,%rbx
+	movq	%rsi,%r9
+	movq	%rdi,%r8
+	movq	%rcx,%r15
+
+	movl	240(%r15),%eax
+
+	movq	%r15,%r10
+	subq	%r14,%r10
+	andq	$4095,%r10
+	cmpq	$2304,%r10
+	jb	L$cbc_do_ecopy
+	cmpq	$4096-248,%r10
+	jb	L$cbc_skip_ecopy
+.p2align	2
+L$cbc_do_ecopy:
+	movq	%r15,%rsi
+	leaq	80(%rsp),%rdi
+	leaq	80(%rsp),%r15
+	movl	$30,%ecx
+.long	0x90A548F3
+	movl	%eax,(%rdi)
+L$cbc_skip_ecopy:
+	movq	%r15,0(%rsp)
+
+	movl	$18,%ecx
+.p2align	2
+L$cbc_prefetch_te:
+	movq	0(%r14),%r10
+	movq	32(%r14),%r11
+	movq	64(%r14),%r12
+	movq	96(%r14),%r13
+	leaq	128(%r14),%r14
+	subl	$1,%ecx
+	jnz	L$cbc_prefetch_te
+	leaq	-2304(%r14),%r14
+
+	cmpq	$0,%rbx
+	je	L$FAST_DECRYPT
+
+
+	movl	0(%rbp),%eax
+	movl	4(%rbp),%ebx
+	movl	8(%rbp),%ecx
+	movl	12(%rbp),%edx
+
+.p2align	2
+L$cbc_fast_enc_loop:
+	xorl	0(%r8),%eax
+	xorl	4(%r8),%ebx
+	xorl	8(%r8),%ecx
+	xorl	12(%r8),%edx
+	movq	0(%rsp),%r15
+	movq	%r8,24(%rsp)
+
+	call	_x86_64_AES_encrypt
+
+	movq	24(%rsp),%r8
+	movq	40(%rsp),%r10
+	movl	%eax,0(%r9)
+	movl	%ebx,4(%r9)
+	movl	%ecx,8(%r9)
+	movl	%edx,12(%r9)
+
+	leaq	16(%r8),%r8
+	leaq	16(%r9),%r9
+	subq	$16,%r10
+	testq	$-16,%r10
+	movq	%r10,40(%rsp)
+	jnz	L$cbc_fast_enc_loop
+	movq	56(%rsp),%rbp
+	movl	%eax,0(%rbp)
+	movl	%ebx,4(%rbp)
+	movl	%ecx,8(%rbp)
+	movl	%edx,12(%rbp)
+
+	jmp	L$cbc_fast_cleanup
+
+
+.p2align	4
+L$FAST_DECRYPT:
+	cmpq	%r8,%r9
+	je	L$cbc_fast_dec_in_place
+
+	movq	%rbp,64(%rsp)
+.p2align	2
+L$cbc_fast_dec_loop:
+	movl	0(%r8),%eax
+	movl	4(%r8),%ebx
+	movl	8(%r8),%ecx
+	movl	12(%r8),%edx
+	movq	0(%rsp),%r15
+	movq	%r8,24(%rsp)
+
+	call	_x86_64_AES_decrypt
+
+	movq	64(%rsp),%rbp
+	movq	24(%rsp),%r8
+	movq	40(%rsp),%r10
+	xorl	0(%rbp),%eax
+	xorl	4(%rbp),%ebx
+	xorl	8(%rbp),%ecx
+	xorl	12(%rbp),%edx
+	movq	%r8,%rbp
+
+	subq	$16,%r10
+	movq	%r10,40(%rsp)
+	movq	%rbp,64(%rsp)
+
+	movl	%eax,0(%r9)
+	movl	%ebx,4(%r9)
+	movl	%ecx,8(%r9)
+	movl	%edx,12(%r9)
+
+	leaq	16(%r8),%r8
+	leaq	16(%r9),%r9
+	jnz	L$cbc_fast_dec_loop
+	movq	56(%rsp),%r12
+	movq	0(%rbp),%r10
+	movq	8(%rbp),%r11
+	movq	%r10,0(%r12)
+	movq	%r11,8(%r12)
+	jmp	L$cbc_fast_cleanup
+
+.p2align	4
+L$cbc_fast_dec_in_place:
+	movq	0(%rbp),%r10
+	movq	8(%rbp),%r11
+	movq	%r10,0+64(%rsp)
+	movq	%r11,8+64(%rsp)
+.p2align	2
+L$cbc_fast_dec_in_place_loop:
+	movl	0(%r8),%eax
+	movl	4(%r8),%ebx
+	movl	8(%r8),%ecx
+	movl	12(%r8),%edx
+	movq	0(%rsp),%r15
+	movq	%r8,24(%rsp)
+
+	call	_x86_64_AES_decrypt
+
+	movq	24(%rsp),%r8
+	movq	40(%rsp),%r10
+	xorl	0+64(%rsp),%eax
+	xorl	4+64(%rsp),%ebx
+	xorl	8+64(%rsp),%ecx
+	xorl	12+64(%rsp),%edx
+
+	movq	0(%r8),%r11
+	movq	8(%r8),%r12
+	subq	$16,%r10
+	jz	L$cbc_fast_dec_in_place_done
+
+	movq	%r11,0+64(%rsp)
+	movq	%r12,8+64(%rsp)
+
+	movl	%eax,0(%r9)
+	movl	%ebx,4(%r9)
+	movl	%ecx,8(%r9)
+	movl	%edx,12(%r9)
+
+	leaq	16(%r8),%r8
+	leaq	16(%r9),%r9
+	movq	%r10,40(%rsp)
+	jmp	L$cbc_fast_dec_in_place_loop
+L$cbc_fast_dec_in_place_done:
+	movq	56(%rsp),%rdi
+	movq	%r11,0(%rdi)
+	movq	%r12,8(%rdi)
+
+	movl	%eax,0(%r9)
+	movl	%ebx,4(%r9)
+	movl	%ecx,8(%r9)
+	movl	%edx,12(%r9)
+
+.p2align	2
+L$cbc_fast_cleanup:
+	cmpl	$0,80+240(%rsp)
+	leaq	80(%rsp),%rdi
+	je	L$cbc_exit
+	movl	$30,%ecx
+	xorq	%rax,%rax
+.long	0x90AB48F3
+
+	jmp	L$cbc_exit
+
+
+.p2align	4
+L$cbc_slow_prologue:
+
+	leaq	-88(%rsp),%rbp
+	andq	$-64,%rbp
+
+	leaq	-88-63(%rcx),%r10
+	subq	%rbp,%r10
+	negq	%r10
+	andq	$960,%r10
+	subq	%r10,%rbp
+
+	xchgq	%rsp,%rbp
+
+	movq	%rbp,16(%rsp)
+L$cbc_slow_body:
+
+
+
+
+	movq	%r8,56(%rsp)
+	movq	%r8,%rbp
+	movq	%r9,%rbx
+	movq	%rsi,%r9
+	movq	%rdi,%r8
+	movq	%rcx,%r15
+	movq	%rdx,%r10
+
+	movl	240(%r15),%eax
+	movq	%r15,0(%rsp)
+	shll	$4,%eax
+	leaq	(%r15,%rax,1),%rax
+	movq	%rax,8(%rsp)
+
+
+	leaq	2048(%r14),%r14
+	leaq	768-8(%rsp),%rax
+	subq	%r14,%rax
+	andq	$768,%rax
+	leaq	(%r14,%rax,1),%r14
+
+	cmpq	$0,%rbx
+	je	L$SLOW_DECRYPT
+
+
+	testq	$-16,%r10
+	movl	0(%rbp),%eax
+	movl	4(%rbp),%ebx
+	movl	8(%rbp),%ecx
+	movl	12(%rbp),%edx
+	jz	L$cbc_slow_enc_tail
+
+.p2align	2
+L$cbc_slow_enc_loop:
+	xorl	0(%r8),%eax
+	xorl	4(%r8),%ebx
+	xorl	8(%r8),%ecx
+	xorl	12(%r8),%edx
+	movq	0(%rsp),%r15
+	movq	%r8,24(%rsp)
+	movq	%r9,32(%rsp)
+	movq	%r10,40(%rsp)
+
+	call	_x86_64_AES_encrypt_compact
+
+	movq	24(%rsp),%r8
+	movq	32(%rsp),%r9
+	movq	40(%rsp),%r10
+	movl	%eax,0(%r9)
+	movl	%ebx,4(%r9)
+	movl	%ecx,8(%r9)
+	movl	%edx,12(%r9)
+
+	leaq	16(%r8),%r8
+	leaq	16(%r9),%r9
+	subq	$16,%r10
+	testq	$-16,%r10
+	jnz	L$cbc_slow_enc_loop
+	testq	$15,%r10
+	jnz	L$cbc_slow_enc_tail
+	movq	56(%rsp),%rbp
+	movl	%eax,0(%rbp)
+	movl	%ebx,4(%rbp)
+	movl	%ecx,8(%rbp)
+	movl	%edx,12(%rbp)
+
+	jmp	L$cbc_exit
+
+.p2align	2
+L$cbc_slow_enc_tail:
+	movq	%rax,%r11
+	movq	%rcx,%r12
+	movq	%r10,%rcx
+	movq	%r8,%rsi
+	movq	%r9,%rdi
+.long	0x9066A4F3
+	movq	$16,%rcx
+	subq	%r10,%rcx
+	xorq	%rax,%rax
+.long	0x9066AAF3
+	movq	%r9,%r8
+	movq	$16,%r10
+	movq	%r11,%rax
+	movq	%r12,%rcx
+	jmp	L$cbc_slow_enc_loop
+
+.p2align	4
+L$SLOW_DECRYPT:
+	shrq	$3,%rax
+	addq	%rax,%r14
+
+	movq	0(%rbp),%r11
+	movq	8(%rbp),%r12
+	movq	%r11,0+64(%rsp)
+	movq	%r12,8+64(%rsp)
+
+.p2align	2
+L$cbc_slow_dec_loop:
+	movl	0(%r8),%eax
+	movl	4(%r8),%ebx
+	movl	8(%r8),%ecx
+	movl	12(%r8),%edx
+	movq	0(%rsp),%r15
+	movq	%r8,24(%rsp)
+	movq	%r9,32(%rsp)
+	movq	%r10,40(%rsp)
+
+	call	_x86_64_AES_decrypt_compact
+
+	movq	24(%rsp),%r8
+	movq	32(%rsp),%r9
+	movq	40(%rsp),%r10
+	xorl	0+64(%rsp),%eax
+	xorl	4+64(%rsp),%ebx
+	xorl	8+64(%rsp),%ecx
+	xorl	12+64(%rsp),%edx
+
+	movq	0(%r8),%r11
+	movq	8(%r8),%r12
+	subq	$16,%r10
+	jc	L$cbc_slow_dec_partial
+	jz	L$cbc_slow_dec_done
+
+	movq	%r11,0+64(%rsp)
+	movq	%r12,8+64(%rsp)
+
+	movl	%eax,0(%r9)
+	movl	%ebx,4(%r9)
+	movl	%ecx,8(%r9)
+	movl	%edx,12(%r9)
+
+	leaq	16(%r8),%r8
+	leaq	16(%r9),%r9
+	jmp	L$cbc_slow_dec_loop
+L$cbc_slow_dec_done:
+	movq	56(%rsp),%rdi
+	movq	%r11,0(%rdi)
+	movq	%r12,8(%rdi)
+
+	movl	%eax,0(%r9)
+	movl	%ebx,4(%r9)
+	movl	%ecx,8(%r9)
+	movl	%edx,12(%r9)
+
+	jmp	L$cbc_exit
+
+.p2align	2
+L$cbc_slow_dec_partial:
+	movq	56(%rsp),%rdi
+	movq	%r11,0(%rdi)
+	movq	%r12,8(%rdi)
+
+	movl	%eax,0+64(%rsp)
+	movl	%ebx,4+64(%rsp)
+	movl	%ecx,8+64(%rsp)
+	movl	%edx,12+64(%rsp)
+
+	movq	%r9,%rdi
+	leaq	64(%rsp),%rsi
+	leaq	16(%r10),%rcx
+.long	0x9066A4F3
+	jmp	L$cbc_exit
+
+.p2align	4
+L$cbc_exit:
+	movq	16(%rsp),%rsi
+	movq	(%rsi),%r15
+	movq	8(%rsi),%r14
+	movq	16(%rsi),%r13
+	movq	24(%rsi),%r12
+	movq	32(%rsi),%rbp
+	movq	40(%rsi),%rbx
+	leaq	48(%rsi),%rsp
+L$cbc_popfq:
+	popfq
+L$cbc_epilogue:
+	.byte	0xf3,0xc3
+
+.p2align	6
+L$AES_Te:
+.long	0xa56363c6,0xa56363c6
+.long	0x847c7cf8,0x847c7cf8
+.long	0x997777ee,0x997777ee
+.long	0x8d7b7bf6,0x8d7b7bf6
+.long	0x0df2f2ff,0x0df2f2ff
+.long	0xbd6b6bd6,0xbd6b6bd6
+.long	0xb16f6fde,0xb16f6fde
+.long	0x54c5c591,0x54c5c591
+.long	0x50303060,0x50303060
+.long	0x03010102,0x03010102
+.long	0xa96767ce,0xa96767ce
+.long	0x7d2b2b56,0x7d2b2b56
+.long	0x19fefee7,0x19fefee7
+.long	0x62d7d7b5,0x62d7d7b5
+.long	0xe6abab4d,0xe6abab4d
+.long	0x9a7676ec,0x9a7676ec
+.long	0x45caca8f,0x45caca8f
+.long	0x9d82821f,0x9d82821f
+.long	0x40c9c989,0x40c9c989
+.long	0x877d7dfa,0x877d7dfa
+.long	0x15fafaef,0x15fafaef
+.long	0xeb5959b2,0xeb5959b2
+.long	0xc947478e,0xc947478e
+.long	0x0bf0f0fb,0x0bf0f0fb
+.long	0xecadad41,0xecadad41
+.long	0x67d4d4b3,0x67d4d4b3
+.long	0xfda2a25f,0xfda2a25f
+.long	0xeaafaf45,0xeaafaf45
+.long	0xbf9c9c23,0xbf9c9c23
+.long	0xf7a4a453,0xf7a4a453
+.long	0x967272e4,0x967272e4
+.long	0x5bc0c09b,0x5bc0c09b
+.long	0xc2b7b775,0xc2b7b775
+.long	0x1cfdfde1,0x1cfdfde1
+.long	0xae93933d,0xae93933d
+.long	0x6a26264c,0x6a26264c
+.long	0x5a36366c,0x5a36366c
+.long	0x413f3f7e,0x413f3f7e
+.long	0x02f7f7f5,0x02f7f7f5
+.long	0x4fcccc83,0x4fcccc83
+.long	0x5c343468,0x5c343468
+.long	0xf4a5a551,0xf4a5a551
+.long	0x34e5e5d1,0x34e5e5d1
+.long	0x08f1f1f9,0x08f1f1f9
+.long	0x937171e2,0x937171e2
+.long	0x73d8d8ab,0x73d8d8ab
+.long	0x53313162,0x53313162
+.long	0x3f15152a,0x3f15152a
+.long	0x0c040408,0x0c040408
+.long	0x52c7c795,0x52c7c795
+.long	0x65232346,0x65232346
+.long	0x5ec3c39d,0x5ec3c39d
+.long	0x28181830,0x28181830
+.long	0xa1969637,0xa1969637
+.long	0x0f05050a,0x0f05050a
+.long	0xb59a9a2f,0xb59a9a2f
+.long	0x0907070e,0x0907070e
+.long	0x36121224,0x36121224
+.long	0x9b80801b,0x9b80801b
+.long	0x3de2e2df,0x3de2e2df
+.long	0x26ebebcd,0x26ebebcd
+.long	0x6927274e,0x6927274e
+.long	0xcdb2b27f,0xcdb2b27f
+.long	0x9f7575ea,0x9f7575ea
+.long	0x1b090912,0x1b090912
+.long	0x9e83831d,0x9e83831d
+.long	0x742c2c58,0x742c2c58
+.long	0x2e1a1a34,0x2e1a1a34
+.long	0x2d1b1b36,0x2d1b1b36
+.long	0xb26e6edc,0xb26e6edc
+.long	0xee5a5ab4,0xee5a5ab4
+.long	0xfba0a05b,0xfba0a05b
+.long	0xf65252a4,0xf65252a4
+.long	0x4d3b3b76,0x4d3b3b76
+.long	0x61d6d6b7,0x61d6d6b7
+.long	0xceb3b37d,0xceb3b37d
+.long	0x7b292952,0x7b292952
+.long	0x3ee3e3dd,0x3ee3e3dd
+.long	0x712f2f5e,0x712f2f5e
+.long	0x97848413,0x97848413
+.long	0xf55353a6,0xf55353a6
+.long	0x68d1d1b9,0x68d1d1b9
+.long	0x00000000,0x00000000
+.long	0x2cededc1,0x2cededc1
+.long	0x60202040,0x60202040
+.long	0x1ffcfce3,0x1ffcfce3
+.long	0xc8b1b179,0xc8b1b179
+.long	0xed5b5bb6,0xed5b5bb6
+.long	0xbe6a6ad4,0xbe6a6ad4
+.long	0x46cbcb8d,0x46cbcb8d
+.long	0xd9bebe67,0xd9bebe67
+.long	0x4b393972,0x4b393972
+.long	0xde4a4a94,0xde4a4a94
+.long	0xd44c4c98,0xd44c4c98
+.long	0xe85858b0,0xe85858b0
+.long	0x4acfcf85,0x4acfcf85
+.long	0x6bd0d0bb,0x6bd0d0bb
+.long	0x2aefefc5,0x2aefefc5
+.long	0xe5aaaa4f,0xe5aaaa4f
+.long	0x16fbfbed,0x16fbfbed
+.long	0xc5434386,0xc5434386
+.long	0xd74d4d9a,0xd74d4d9a
+.long	0x55333366,0x55333366
+.long	0x94858511,0x94858511
+.long	0xcf45458a,0xcf45458a
+.long	0x10f9f9e9,0x10f9f9e9
+.long	0x06020204,0x06020204
+.long	0x817f7ffe,0x817f7ffe
+.long	0xf05050a0,0xf05050a0
+.long	0x443c3c78,0x443c3c78
+.long	0xba9f9f25,0xba9f9f25
+.long	0xe3a8a84b,0xe3a8a84b
+.long	0xf35151a2,0xf35151a2
+.long	0xfea3a35d,0xfea3a35d
+.long	0xc0404080,0xc0404080
+.long	0x8a8f8f05,0x8a8f8f05
+.long	0xad92923f,0xad92923f
+.long	0xbc9d9d21,0xbc9d9d21
+.long	0x48383870,0x48383870
+.long	0x04f5f5f1,0x04f5f5f1
+.long	0xdfbcbc63,0xdfbcbc63
+.long	0xc1b6b677,0xc1b6b677
+.long	0x75dadaaf,0x75dadaaf
+.long	0x63212142,0x63212142
+.long	0x30101020,0x30101020
+.long	0x1affffe5,0x1affffe5
+.long	0x0ef3f3fd,0x0ef3f3fd
+.long	0x6dd2d2bf,0x6dd2d2bf
+.long	0x4ccdcd81,0x4ccdcd81
+.long	0x140c0c18,0x140c0c18
+.long	0x35131326,0x35131326
+.long	0x2fececc3,0x2fececc3
+.long	0xe15f5fbe,0xe15f5fbe
+.long	0xa2979735,0xa2979735
+.long	0xcc444488,0xcc444488
+.long	0x3917172e,0x3917172e
+.long	0x57c4c493,0x57c4c493
+.long	0xf2a7a755,0xf2a7a755
+.long	0x827e7efc,0x827e7efc
+.long	0x473d3d7a,0x473d3d7a
+.long	0xac6464c8,0xac6464c8
+.long	0xe75d5dba,0xe75d5dba
+.long	0x2b191932,0x2b191932
+.long	0x957373e6,0x957373e6
+.long	0xa06060c0,0xa06060c0
+.long	0x98818119,0x98818119
+.long	0xd14f4f9e,0xd14f4f9e
+.long	0x7fdcdca3,0x7fdcdca3
+.long	0x66222244,0x66222244
+.long	0x7e2a2a54,0x7e2a2a54
+.long	0xab90903b,0xab90903b
+.long	0x8388880b,0x8388880b
+.long	0xca46468c,0xca46468c
+.long	0x29eeeec7,0x29eeeec7
+.long	0xd3b8b86b,0xd3b8b86b
+.long	0x3c141428,0x3c141428
+.long	0x79dedea7,0x79dedea7
+.long	0xe25e5ebc,0xe25e5ebc
+.long	0x1d0b0b16,0x1d0b0b16
+.long	0x76dbdbad,0x76dbdbad
+.long	0x3be0e0db,0x3be0e0db
+.long	0x56323264,0x56323264
+.long	0x4e3a3a74,0x4e3a3a74
+.long	0x1e0a0a14,0x1e0a0a14
+.long	0xdb494992,0xdb494992
+.long	0x0a06060c,0x0a06060c
+.long	0x6c242448,0x6c242448
+.long	0xe45c5cb8,0xe45c5cb8
+.long	0x5dc2c29f,0x5dc2c29f
+.long	0x6ed3d3bd,0x6ed3d3bd
+.long	0xefacac43,0xefacac43
+.long	0xa66262c4,0xa66262c4
+.long	0xa8919139,0xa8919139
+.long	0xa4959531,0xa4959531
+.long	0x37e4e4d3,0x37e4e4d3
+.long	0x8b7979f2,0x8b7979f2
+.long	0x32e7e7d5,0x32e7e7d5
+.long	0x43c8c88b,0x43c8c88b
+.long	0x5937376e,0x5937376e
+.long	0xb76d6dda,0xb76d6dda
+.long	0x8c8d8d01,0x8c8d8d01
+.long	0x64d5d5b1,0x64d5d5b1
+.long	0xd24e4e9c,0xd24e4e9c
+.long	0xe0a9a949,0xe0a9a949
+.long	0xb46c6cd8,0xb46c6cd8
+.long	0xfa5656ac,0xfa5656ac
+.long	0x07f4f4f3,0x07f4f4f3
+.long	0x25eaeacf,0x25eaeacf
+.long	0xaf6565ca,0xaf6565ca
+.long	0x8e7a7af4,0x8e7a7af4
+.long	0xe9aeae47,0xe9aeae47
+.long	0x18080810,0x18080810
+.long	0xd5baba6f,0xd5baba6f
+.long	0x887878f0,0x887878f0
+.long	0x6f25254a,0x6f25254a
+.long	0x722e2e5c,0x722e2e5c
+.long	0x241c1c38,0x241c1c38
+.long	0xf1a6a657,0xf1a6a657
+.long	0xc7b4b473,0xc7b4b473
+.long	0x51c6c697,0x51c6c697
+.long	0x23e8e8cb,0x23e8e8cb
+.long	0x7cdddda1,0x7cdddda1
+.long	0x9c7474e8,0x9c7474e8
+.long	0x211f1f3e,0x211f1f3e
+.long	0xdd4b4b96,0xdd4b4b96
+.long	0xdcbdbd61,0xdcbdbd61
+.long	0x868b8b0d,0x868b8b0d
+.long	0x858a8a0f,0x858a8a0f
+.long	0x907070e0,0x907070e0
+.long	0x423e3e7c,0x423e3e7c
+.long	0xc4b5b571,0xc4b5b571
+.long	0xaa6666cc,0xaa6666cc
+.long	0xd8484890,0xd8484890
+.long	0x05030306,0x05030306
+.long	0x01f6f6f7,0x01f6f6f7
+.long	0x120e0e1c,0x120e0e1c
+.long	0xa36161c2,0xa36161c2
+.long	0x5f35356a,0x5f35356a
+.long	0xf95757ae,0xf95757ae
+.long	0xd0b9b969,0xd0b9b969
+.long	0x91868617,0x91868617
+.long	0x58c1c199,0x58c1c199
+.long	0x271d1d3a,0x271d1d3a
+.long	0xb99e9e27,0xb99e9e27
+.long	0x38e1e1d9,0x38e1e1d9
+.long	0x13f8f8eb,0x13f8f8eb
+.long	0xb398982b,0xb398982b
+.long	0x33111122,0x33111122
+.long	0xbb6969d2,0xbb6969d2
+.long	0x70d9d9a9,0x70d9d9a9
+.long	0x898e8e07,0x898e8e07
+.long	0xa7949433,0xa7949433
+.long	0xb69b9b2d,0xb69b9b2d
+.long	0x221e1e3c,0x221e1e3c
+.long	0x92878715,0x92878715
+.long	0x20e9e9c9,0x20e9e9c9
+.long	0x49cece87,0x49cece87
+.long	0xff5555aa,0xff5555aa
+.long	0x78282850,0x78282850
+.long	0x7adfdfa5,0x7adfdfa5
+.long	0x8f8c8c03,0x8f8c8c03
+.long	0xf8a1a159,0xf8a1a159
+.long	0x80898909,0x80898909
+.long	0x170d0d1a,0x170d0d1a
+.long	0xdabfbf65,0xdabfbf65
+.long	0x31e6e6d7,0x31e6e6d7
+.long	0xc6424284,0xc6424284
+.long	0xb86868d0,0xb86868d0
+.long	0xc3414182,0xc3414182
+.long	0xb0999929,0xb0999929
+.long	0x772d2d5a,0x772d2d5a
+.long	0x110f0f1e,0x110f0f1e
+.long	0xcbb0b07b,0xcbb0b07b
+.long	0xfc5454a8,0xfc5454a8
+.long	0xd6bbbb6d,0xd6bbbb6d
+.long	0x3a16162c,0x3a16162c
+.byte	0x63,0x7c,0x77,0x7b,0xf2,0x6b,0x6f,0xc5
+.byte	0x30,0x01,0x67,0x2b,0xfe,0xd7,0xab,0x76
+.byte	0xca,0x82,0xc9,0x7d,0xfa,0x59,0x47,0xf0
+.byte	0xad,0xd4,0xa2,0xaf,0x9c,0xa4,0x72,0xc0
+.byte	0xb7,0xfd,0x93,0x26,0x36,0x3f,0xf7,0xcc
+.byte	0x34,0xa5,0xe5,0xf1,0x71,0xd8,0x31,0x15
+.byte	0x04,0xc7,0x23,0xc3,0x18,0x96,0x05,0x9a
+.byte	0x07,0x12,0x80,0xe2,0xeb,0x27,0xb2,0x75
+.byte	0x09,0x83,0x2c,0x1a,0x1b,0x6e,0x5a,0xa0
+.byte	0x52,0x3b,0xd6,0xb3,0x29,0xe3,0x2f,0x84
+.byte	0x53,0xd1,0x00,0xed,0x20,0xfc,0xb1,0x5b
+.byte	0x6a,0xcb,0xbe,0x39,0x4a,0x4c,0x58,0xcf
+.byte	0xd0,0xef,0xaa,0xfb,0x43,0x4d,0x33,0x85
+.byte	0x45,0xf9,0x02,0x7f,0x50,0x3c,0x9f,0xa8
+.byte	0x51,0xa3,0x40,0x8f,0x92,0x9d,0x38,0xf5
+.byte	0xbc,0xb6,0xda,0x21,0x10,0xff,0xf3,0xd2
+.byte	0xcd,0x0c,0x13,0xec,0x5f,0x97,0x44,0x17
+.byte	0xc4,0xa7,0x7e,0x3d,0x64,0x5d,0x19,0x73
+.byte	0x60,0x81,0x4f,0xdc,0x22,0x2a,0x90,0x88
+.byte	0x46,0xee,0xb8,0x14,0xde,0x5e,0x0b,0xdb
+.byte	0xe0,0x32,0x3a,0x0a,0x49,0x06,0x24,0x5c
+.byte	0xc2,0xd3,0xac,0x62,0x91,0x95,0xe4,0x79
+.byte	0xe7,0xc8,0x37,0x6d,0x8d,0xd5,0x4e,0xa9
+.byte	0x6c,0x56,0xf4,0xea,0x65,0x7a,0xae,0x08
+.byte	0xba,0x78,0x25,0x2e,0x1c,0xa6,0xb4,0xc6
+.byte	0xe8,0xdd,0x74,0x1f,0x4b,0xbd,0x8b,0x8a
+.byte	0x70,0x3e,0xb5,0x66,0x48,0x03,0xf6,0x0e
+.byte	0x61,0x35,0x57,0xb9,0x86,0xc1,0x1d,0x9e
+.byte	0xe1,0xf8,0x98,0x11,0x69,0xd9,0x8e,0x94
+.byte	0x9b,0x1e,0x87,0xe9,0xce,0x55,0x28,0xdf
+.byte	0x8c,0xa1,0x89,0x0d,0xbf,0xe6,0x42,0x68
+.byte	0x41,0x99,0x2d,0x0f,0xb0,0x54,0xbb,0x16
+.byte	0x63,0x7c,0x77,0x7b,0xf2,0x6b,0x6f,0xc5
+.byte	0x30,0x01,0x67,0x2b,0xfe,0xd7,0xab,0x76
+.byte	0xca,0x82,0xc9,0x7d,0xfa,0x59,0x47,0xf0
+.byte	0xad,0xd4,0xa2,0xaf,0x9c,0xa4,0x72,0xc0
+.byte	0xb7,0xfd,0x93,0x26,0x36,0x3f,0xf7,0xcc
+.byte	0x34,0xa5,0xe5,0xf1,0x71,0xd8,0x31,0x15
+.byte	0x04,0xc7,0x23,0xc3,0x18,0x96,0x05,0x9a
+.byte	0x07,0x12,0x80,0xe2,0xeb,0x27,0xb2,0x75
+.byte	0x09,0x83,0x2c,0x1a,0x1b,0x6e,0x5a,0xa0
+.byte	0x52,0x3b,0xd6,0xb3,0x29,0xe3,0x2f,0x84
+.byte	0x53,0xd1,0x00,0xed,0x20,0xfc,0xb1,0x5b
+.byte	0x6a,0xcb,0xbe,0x39,0x4a,0x4c,0x58,0xcf
+.byte	0xd0,0xef,0xaa,0xfb,0x43,0x4d,0x33,0x85
+.byte	0x45,0xf9,0x02,0x7f,0x50,0x3c,0x9f,0xa8
+.byte	0x51,0xa3,0x40,0x8f,0x92,0x9d,0x38,0xf5
+.byte	0xbc,0xb6,0xda,0x21,0x10,0xff,0xf3,0xd2
+.byte	0xcd,0x0c,0x13,0xec,0x5f,0x97,0x44,0x17
+.byte	0xc4,0xa7,0x7e,0x3d,0x64,0x5d,0x19,0x73
+.byte	0x60,0x81,0x4f,0xdc,0x22,0x2a,0x90,0x88
+.byte	0x46,0xee,0xb8,0x14,0xde,0x5e,0x0b,0xdb
+.byte	0xe0,0x32,0x3a,0x0a,0x49,0x06,0x24,0x5c
+.byte	0xc2,0xd3,0xac,0x62,0x91,0x95,0xe4,0x79
+.byte	0xe7,0xc8,0x37,0x6d,0x8d,0xd5,0x4e,0xa9
+.byte	0x6c,0x56,0xf4,0xea,0x65,0x7a,0xae,0x08
+.byte	0xba,0x78,0x25,0x2e,0x1c,0xa6,0xb4,0xc6
+.byte	0xe8,0xdd,0x74,0x1f,0x4b,0xbd,0x8b,0x8a
+.byte	0x70,0x3e,0xb5,0x66,0x48,0x03,0xf6,0x0e
+.byte	0x61,0x35,0x57,0xb9,0x86,0xc1,0x1d,0x9e
+.byte	0xe1,0xf8,0x98,0x11,0x69,0xd9,0x8e,0x94
+.byte	0x9b,0x1e,0x87,0xe9,0xce,0x55,0x28,0xdf
+.byte	0x8c,0xa1,0x89,0x0d,0xbf,0xe6,0x42,0x68
+.byte	0x41,0x99,0x2d,0x0f,0xb0,0x54,0xbb,0x16
+.byte	0x63,0x7c,0x77,0x7b,0xf2,0x6b,0x6f,0xc5
+.byte	0x30,0x01,0x67,0x2b,0xfe,0xd7,0xab,0x76
+.byte	0xca,0x82,0xc9,0x7d,0xfa,0x59,0x47,0xf0
+.byte	0xad,0xd4,0xa2,0xaf,0x9c,0xa4,0x72,0xc0
+.byte	0xb7,0xfd,0x93,0x26,0x36,0x3f,0xf7,0xcc
+.byte	0x34,0xa5,0xe5,0xf1,0x71,0xd8,0x31,0x15
+.byte	0x04,0xc7,0x23,0xc3,0x18,0x96,0x05,0x9a
+.byte	0x07,0x12,0x80,0xe2,0xeb,0x27,0xb2,0x75
+.byte	0x09,0x83,0x2c,0x1a,0x1b,0x6e,0x5a,0xa0
+.byte	0x52,0x3b,0xd6,0xb3,0x29,0xe3,0x2f,0x84
+.byte	0x53,0xd1,0x00,0xed,0x20,0xfc,0xb1,0x5b
+.byte	0x6a,0xcb,0xbe,0x39,0x4a,0x4c,0x58,0xcf
+.byte	0xd0,0xef,0xaa,0xfb,0x43,0x4d,0x33,0x85
+.byte	0x45,0xf9,0x02,0x7f,0x50,0x3c,0x9f,0xa8
+.byte	0x51,0xa3,0x40,0x8f,0x92,0x9d,0x38,0xf5
+.byte	0xbc,0xb6,0xda,0x21,0x10,0xff,0xf3,0xd2
+.byte	0xcd,0x0c,0x13,0xec,0x5f,0x97,0x44,0x17
+.byte	0xc4,0xa7,0x7e,0x3d,0x64,0x5d,0x19,0x73
+.byte	0x60,0x81,0x4f,0xdc,0x22,0x2a,0x90,0x88
+.byte	0x46,0xee,0xb8,0x14,0xde,0x5e,0x0b,0xdb
+.byte	0xe0,0x32,0x3a,0x0a,0x49,0x06,0x24,0x5c
+.byte	0xc2,0xd3,0xac,0x62,0x91,0x95,0xe4,0x79
+.byte	0xe7,0xc8,0x37,0x6d,0x8d,0xd5,0x4e,0xa9
+.byte	0x6c,0x56,0xf4,0xea,0x65,0x7a,0xae,0x08
+.byte	0xba,0x78,0x25,0x2e,0x1c,0xa6,0xb4,0xc6
+.byte	0xe8,0xdd,0x74,0x1f,0x4b,0xbd,0x8b,0x8a
+.byte	0x70,0x3e,0xb5,0x66,0x48,0x03,0xf6,0x0e
+.byte	0x61,0x35,0x57,0xb9,0x86,0xc1,0x1d,0x9e
+.byte	0xe1,0xf8,0x98,0x11,0x69,0xd9,0x8e,0x94
+.byte	0x9b,0x1e,0x87,0xe9,0xce,0x55,0x28,0xdf
+.byte	0x8c,0xa1,0x89,0x0d,0xbf,0xe6,0x42,0x68
+.byte	0x41,0x99,0x2d,0x0f,0xb0,0x54,0xbb,0x16
+.byte	0x63,0x7c,0x77,0x7b,0xf2,0x6b,0x6f,0xc5
+.byte	0x30,0x01,0x67,0x2b,0xfe,0xd7,0xab,0x76
+.byte	0xca,0x82,0xc9,0x7d,0xfa,0x59,0x47,0xf0
+.byte	0xad,0xd4,0xa2,0xaf,0x9c,0xa4,0x72,0xc0
+.byte	0xb7,0xfd,0x93,0x26,0x36,0x3f,0xf7,0xcc
+.byte	0x34,0xa5,0xe5,0xf1,0x71,0xd8,0x31,0x15
+.byte	0x04,0xc7,0x23,0xc3,0x18,0x96,0x05,0x9a
+.byte	0x07,0x12,0x80,0xe2,0xeb,0x27,0xb2,0x75
+.byte	0x09,0x83,0x2c,0x1a,0x1b,0x6e,0x5a,0xa0
+.byte	0x52,0x3b,0xd6,0xb3,0x29,0xe3,0x2f,0x84
+.byte	0x53,0xd1,0x00,0xed,0x20,0xfc,0xb1,0x5b
+.byte	0x6a,0xcb,0xbe,0x39,0x4a,0x4c,0x58,0xcf
+.byte	0xd0,0xef,0xaa,0xfb,0x43,0x4d,0x33,0x85
+.byte	0x45,0xf9,0x02,0x7f,0x50,0x3c,0x9f,0xa8
+.byte	0x51,0xa3,0x40,0x8f,0x92,0x9d,0x38,0xf5
+.byte	0xbc,0xb6,0xda,0x21,0x10,0xff,0xf3,0xd2
+.byte	0xcd,0x0c,0x13,0xec,0x5f,0x97,0x44,0x17
+.byte	0xc4,0xa7,0x7e,0x3d,0x64,0x5d,0x19,0x73
+.byte	0x60,0x81,0x4f,0xdc,0x22,0x2a,0x90,0x88
+.byte	0x46,0xee,0xb8,0x14,0xde,0x5e,0x0b,0xdb
+.byte	0xe0,0x32,0x3a,0x0a,0x49,0x06,0x24,0x5c
+.byte	0xc2,0xd3,0xac,0x62,0x91,0x95,0xe4,0x79
+.byte	0xe7,0xc8,0x37,0x6d,0x8d,0xd5,0x4e,0xa9
+.byte	0x6c,0x56,0xf4,0xea,0x65,0x7a,0xae,0x08
+.byte	0xba,0x78,0x25,0x2e,0x1c,0xa6,0xb4,0xc6
+.byte	0xe8,0xdd,0x74,0x1f,0x4b,0xbd,0x8b,0x8a
+.byte	0x70,0x3e,0xb5,0x66,0x48,0x03,0xf6,0x0e
+.byte	0x61,0x35,0x57,0xb9,0x86,0xc1,0x1d,0x9e
+.byte	0xe1,0xf8,0x98,0x11,0x69,0xd9,0x8e,0x94
+.byte	0x9b,0x1e,0x87,0xe9,0xce,0x55,0x28,0xdf
+.byte	0x8c,0xa1,0x89,0x0d,0xbf,0xe6,0x42,0x68
+.byte	0x41,0x99,0x2d,0x0f,0xb0,0x54,0xbb,0x16
+.long	0x00000001, 0x00000002, 0x00000004, 0x00000008
+.long	0x00000010, 0x00000020, 0x00000040, 0x00000080
+.long	0x0000001b, 0x00000036, 0x80808080, 0x80808080
+.long	0xfefefefe, 0xfefefefe, 0x1b1b1b1b, 0x1b1b1b1b
+.p2align	6
+L$AES_Td:
+.long	0x50a7f451,0x50a7f451
+.long	0x5365417e,0x5365417e
+.long	0xc3a4171a,0xc3a4171a
+.long	0x965e273a,0x965e273a
+.long	0xcb6bab3b,0xcb6bab3b
+.long	0xf1459d1f,0xf1459d1f
+.long	0xab58faac,0xab58faac
+.long	0x9303e34b,0x9303e34b
+.long	0x55fa3020,0x55fa3020
+.long	0xf66d76ad,0xf66d76ad
+.long	0x9176cc88,0x9176cc88
+.long	0x254c02f5,0x254c02f5
+.long	0xfcd7e54f,0xfcd7e54f
+.long	0xd7cb2ac5,0xd7cb2ac5
+.long	0x80443526,0x80443526
+.long	0x8fa362b5,0x8fa362b5
+.long	0x495ab1de,0x495ab1de
+.long	0x671bba25,0x671bba25
+.long	0x980eea45,0x980eea45
+.long	0xe1c0fe5d,0xe1c0fe5d
+.long	0x02752fc3,0x02752fc3
+.long	0x12f04c81,0x12f04c81
+.long	0xa397468d,0xa397468d
+.long	0xc6f9d36b,0xc6f9d36b
+.long	0xe75f8f03,0xe75f8f03
+.long	0x959c9215,0x959c9215
+.long	0xeb7a6dbf,0xeb7a6dbf
+.long	0xda595295,0xda595295
+.long	0x2d83bed4,0x2d83bed4
+.long	0xd3217458,0xd3217458
+.long	0x2969e049,0x2969e049
+.long	0x44c8c98e,0x44c8c98e
+.long	0x6a89c275,0x6a89c275
+.long	0x78798ef4,0x78798ef4
+.long	0x6b3e5899,0x6b3e5899
+.long	0xdd71b927,0xdd71b927
+.long	0xb64fe1be,0xb64fe1be
+.long	0x17ad88f0,0x17ad88f0
+.long	0x66ac20c9,0x66ac20c9
+.long	0xb43ace7d,0xb43ace7d
+.long	0x184adf63,0x184adf63
+.long	0x82311ae5,0x82311ae5
+.long	0x60335197,0x60335197
+.long	0x457f5362,0x457f5362
+.long	0xe07764b1,0xe07764b1
+.long	0x84ae6bbb,0x84ae6bbb
+.long	0x1ca081fe,0x1ca081fe
+.long	0x942b08f9,0x942b08f9
+.long	0x58684870,0x58684870
+.long	0x19fd458f,0x19fd458f
+.long	0x876cde94,0x876cde94
+.long	0xb7f87b52,0xb7f87b52
+.long	0x23d373ab,0x23d373ab
+.long	0xe2024b72,0xe2024b72
+.long	0x578f1fe3,0x578f1fe3
+.long	0x2aab5566,0x2aab5566
+.long	0x0728ebb2,0x0728ebb2
+.long	0x03c2b52f,0x03c2b52f
+.long	0x9a7bc586,0x9a7bc586
+.long	0xa50837d3,0xa50837d3
+.long	0xf2872830,0xf2872830
+.long	0xb2a5bf23,0xb2a5bf23
+.long	0xba6a0302,0xba6a0302
+.long	0x5c8216ed,0x5c8216ed
+.long	0x2b1ccf8a,0x2b1ccf8a
+.long	0x92b479a7,0x92b479a7
+.long	0xf0f207f3,0xf0f207f3
+.long	0xa1e2694e,0xa1e2694e
+.long	0xcdf4da65,0xcdf4da65
+.long	0xd5be0506,0xd5be0506
+.long	0x1f6234d1,0x1f6234d1
+.long	0x8afea6c4,0x8afea6c4
+.long	0x9d532e34,0x9d532e34
+.long	0xa055f3a2,0xa055f3a2
+.long	0x32e18a05,0x32e18a05
+.long	0x75ebf6a4,0x75ebf6a4
+.long	0x39ec830b,0x39ec830b
+.long	0xaaef6040,0xaaef6040
+.long	0x069f715e,0x069f715e
+.long	0x51106ebd,0x51106ebd
+.long	0xf98a213e,0xf98a213e
+.long	0x3d06dd96,0x3d06dd96
+.long	0xae053edd,0xae053edd
+.long	0x46bde64d,0x46bde64d
+.long	0xb58d5491,0xb58d5491
+.long	0x055dc471,0x055dc471
+.long	0x6fd40604,0x6fd40604
+.long	0xff155060,0xff155060
+.long	0x24fb9819,0x24fb9819
+.long	0x97e9bdd6,0x97e9bdd6
+.long	0xcc434089,0xcc434089
+.long	0x779ed967,0x779ed967
+.long	0xbd42e8b0,0xbd42e8b0
+.long	0x888b8907,0x888b8907
+.long	0x385b19e7,0x385b19e7
+.long	0xdbeec879,0xdbeec879
+.long	0x470a7ca1,0x470a7ca1
+.long	0xe90f427c,0xe90f427c
+.long	0xc91e84f8,0xc91e84f8
+.long	0x00000000,0x00000000
+.long	0x83868009,0x83868009
+.long	0x48ed2b32,0x48ed2b32
+.long	0xac70111e,0xac70111e
+.long	0x4e725a6c,0x4e725a6c
+.long	0xfbff0efd,0xfbff0efd
+.long	0x5638850f,0x5638850f
+.long	0x1ed5ae3d,0x1ed5ae3d
+.long	0x27392d36,0x27392d36
+.long	0x64d90f0a,0x64d90f0a
+.long	0x21a65c68,0x21a65c68
+.long	0xd1545b9b,0xd1545b9b
+.long	0x3a2e3624,0x3a2e3624
+.long	0xb1670a0c,0xb1670a0c
+.long	0x0fe75793,0x0fe75793
+.long	0xd296eeb4,0xd296eeb4
+.long	0x9e919b1b,0x9e919b1b
+.long	0x4fc5c080,0x4fc5c080
+.long	0xa220dc61,0xa220dc61
+.long	0x694b775a,0x694b775a
+.long	0x161a121c,0x161a121c
+.long	0x0aba93e2,0x0aba93e2
+.long	0xe52aa0c0,0xe52aa0c0
+.long	0x43e0223c,0x43e0223c
+.long	0x1d171b12,0x1d171b12
+.long	0x0b0d090e,0x0b0d090e
+.long	0xadc78bf2,0xadc78bf2
+.long	0xb9a8b62d,0xb9a8b62d
+.long	0xc8a91e14,0xc8a91e14
+.long	0x8519f157,0x8519f157
+.long	0x4c0775af,0x4c0775af
+.long	0xbbdd99ee,0xbbdd99ee
+.long	0xfd607fa3,0xfd607fa3
+.long	0x9f2601f7,0x9f2601f7
+.long	0xbcf5725c,0xbcf5725c
+.long	0xc53b6644,0xc53b6644
+.long	0x347efb5b,0x347efb5b
+.long	0x7629438b,0x7629438b
+.long	0xdcc623cb,0xdcc623cb
+.long	0x68fcedb6,0x68fcedb6
+.long	0x63f1e4b8,0x63f1e4b8
+.long	0xcadc31d7,0xcadc31d7
+.long	0x10856342,0x10856342
+.long	0x40229713,0x40229713
+.long	0x2011c684,0x2011c684
+.long	0x7d244a85,0x7d244a85
+.long	0xf83dbbd2,0xf83dbbd2
+.long	0x1132f9ae,0x1132f9ae
+.long	0x6da129c7,0x6da129c7
+.long	0x4b2f9e1d,0x4b2f9e1d
+.long	0xf330b2dc,0xf330b2dc
+.long	0xec52860d,0xec52860d
+.long	0xd0e3c177,0xd0e3c177
+.long	0x6c16b32b,0x6c16b32b
+.long	0x99b970a9,0x99b970a9
+.long	0xfa489411,0xfa489411
+.long	0x2264e947,0x2264e947
+.long	0xc48cfca8,0xc48cfca8
+.long	0x1a3ff0a0,0x1a3ff0a0
+.long	0xd82c7d56,0xd82c7d56
+.long	0xef903322,0xef903322
+.long	0xc74e4987,0xc74e4987
+.long	0xc1d138d9,0xc1d138d9
+.long	0xfea2ca8c,0xfea2ca8c
+.long	0x360bd498,0x360bd498
+.long	0xcf81f5a6,0xcf81f5a6
+.long	0x28de7aa5,0x28de7aa5
+.long	0x268eb7da,0x268eb7da
+.long	0xa4bfad3f,0xa4bfad3f
+.long	0xe49d3a2c,0xe49d3a2c
+.long	0x0d927850,0x0d927850
+.long	0x9bcc5f6a,0x9bcc5f6a
+.long	0x62467e54,0x62467e54
+.long	0xc2138df6,0xc2138df6
+.long	0xe8b8d890,0xe8b8d890
+.long	0x5ef7392e,0x5ef7392e
+.long	0xf5afc382,0xf5afc382
+.long	0xbe805d9f,0xbe805d9f
+.long	0x7c93d069,0x7c93d069
+.long	0xa92dd56f,0xa92dd56f
+.long	0xb31225cf,0xb31225cf
+.long	0x3b99acc8,0x3b99acc8
+.long	0xa77d1810,0xa77d1810
+.long	0x6e639ce8,0x6e639ce8
+.long	0x7bbb3bdb,0x7bbb3bdb
+.long	0x097826cd,0x097826cd
+.long	0xf418596e,0xf418596e
+.long	0x01b79aec,0x01b79aec
+.long	0xa89a4f83,0xa89a4f83
+.long	0x656e95e6,0x656e95e6
+.long	0x7ee6ffaa,0x7ee6ffaa
+.long	0x08cfbc21,0x08cfbc21
+.long	0xe6e815ef,0xe6e815ef
+.long	0xd99be7ba,0xd99be7ba
+.long	0xce366f4a,0xce366f4a
+.long	0xd4099fea,0xd4099fea
+.long	0xd67cb029,0xd67cb029
+.long	0xafb2a431,0xafb2a431
+.long	0x31233f2a,0x31233f2a
+.long	0x3094a5c6,0x3094a5c6
+.long	0xc066a235,0xc066a235
+.long	0x37bc4e74,0x37bc4e74
+.long	0xa6ca82fc,0xa6ca82fc
+.long	0xb0d090e0,0xb0d090e0
+.long	0x15d8a733,0x15d8a733
+.long	0x4a9804f1,0x4a9804f1
+.long	0xf7daec41,0xf7daec41
+.long	0x0e50cd7f,0x0e50cd7f
+.long	0x2ff69117,0x2ff69117
+.long	0x8dd64d76,0x8dd64d76
+.long	0x4db0ef43,0x4db0ef43
+.long	0x544daacc,0x544daacc
+.long	0xdf0496e4,0xdf0496e4
+.long	0xe3b5d19e,0xe3b5d19e
+.long	0x1b886a4c,0x1b886a4c
+.long	0xb81f2cc1,0xb81f2cc1
+.long	0x7f516546,0x7f516546
+.long	0x04ea5e9d,0x04ea5e9d
+.long	0x5d358c01,0x5d358c01
+.long	0x737487fa,0x737487fa
+.long	0x2e410bfb,0x2e410bfb
+.long	0x5a1d67b3,0x5a1d67b3
+.long	0x52d2db92,0x52d2db92
+.long	0x335610e9,0x335610e9
+.long	0x1347d66d,0x1347d66d
+.long	0x8c61d79a,0x8c61d79a
+.long	0x7a0ca137,0x7a0ca137
+.long	0x8e14f859,0x8e14f859
+.long	0x893c13eb,0x893c13eb
+.long	0xee27a9ce,0xee27a9ce
+.long	0x35c961b7,0x35c961b7
+.long	0xede51ce1,0xede51ce1
+.long	0x3cb1477a,0x3cb1477a
+.long	0x59dfd29c,0x59dfd29c
+.long	0x3f73f255,0x3f73f255
+.long	0x79ce1418,0x79ce1418
+.long	0xbf37c773,0xbf37c773
+.long	0xeacdf753,0xeacdf753
+.long	0x5baafd5f,0x5baafd5f
+.long	0x146f3ddf,0x146f3ddf
+.long	0x86db4478,0x86db4478
+.long	0x81f3afca,0x81f3afca
+.long	0x3ec468b9,0x3ec468b9
+.long	0x2c342438,0x2c342438
+.long	0x5f40a3c2,0x5f40a3c2
+.long	0x72c31d16,0x72c31d16
+.long	0x0c25e2bc,0x0c25e2bc
+.long	0x8b493c28,0x8b493c28
+.long	0x41950dff,0x41950dff
+.long	0x7101a839,0x7101a839
+.long	0xdeb30c08,0xdeb30c08
+.long	0x9ce4b4d8,0x9ce4b4d8
+.long	0x90c15664,0x90c15664
+.long	0x6184cb7b,0x6184cb7b
+.long	0x70b632d5,0x70b632d5
+.long	0x745c6c48,0x745c6c48
+.long	0x4257b8d0,0x4257b8d0
+.byte	0x52,0x09,0x6a,0xd5,0x30,0x36,0xa5,0x38
+.byte	0xbf,0x40,0xa3,0x9e,0x81,0xf3,0xd7,0xfb
+.byte	0x7c,0xe3,0x39,0x82,0x9b,0x2f,0xff,0x87
+.byte	0x34,0x8e,0x43,0x44,0xc4,0xde,0xe9,0xcb
+.byte	0x54,0x7b,0x94,0x32,0xa6,0xc2,0x23,0x3d
+.byte	0xee,0x4c,0x95,0x0b,0x42,0xfa,0xc3,0x4e
+.byte	0x08,0x2e,0xa1,0x66,0x28,0xd9,0x24,0xb2
+.byte	0x76,0x5b,0xa2,0x49,0x6d,0x8b,0xd1,0x25
+.byte	0x72,0xf8,0xf6,0x64,0x86,0x68,0x98,0x16
+.byte	0xd4,0xa4,0x5c,0xcc,0x5d,0x65,0xb6,0x92
+.byte	0x6c,0x70,0x48,0x50,0xfd,0xed,0xb9,0xda
+.byte	0x5e,0x15,0x46,0x57,0xa7,0x8d,0x9d,0x84
+.byte	0x90,0xd8,0xab,0x00,0x8c,0xbc,0xd3,0x0a
+.byte	0xf7,0xe4,0x58,0x05,0xb8,0xb3,0x45,0x06
+.byte	0xd0,0x2c,0x1e,0x8f,0xca,0x3f,0x0f,0x02
+.byte	0xc1,0xaf,0xbd,0x03,0x01,0x13,0x8a,0x6b
+.byte	0x3a,0x91,0x11,0x41,0x4f,0x67,0xdc,0xea
+.byte	0x97,0xf2,0xcf,0xce,0xf0,0xb4,0xe6,0x73
+.byte	0x96,0xac,0x74,0x22,0xe7,0xad,0x35,0x85
+.byte	0xe2,0xf9,0x37,0xe8,0x1c,0x75,0xdf,0x6e
+.byte	0x47,0xf1,0x1a,0x71,0x1d,0x29,0xc5,0x89
+.byte	0x6f,0xb7,0x62,0x0e,0xaa,0x18,0xbe,0x1b
+.byte	0xfc,0x56,0x3e,0x4b,0xc6,0xd2,0x79,0x20
+.byte	0x9a,0xdb,0xc0,0xfe,0x78,0xcd,0x5a,0xf4
+.byte	0x1f,0xdd,0xa8,0x33,0x88,0x07,0xc7,0x31
+.byte	0xb1,0x12,0x10,0x59,0x27,0x80,0xec,0x5f
+.byte	0x60,0x51,0x7f,0xa9,0x19,0xb5,0x4a,0x0d
+.byte	0x2d,0xe5,0x7a,0x9f,0x93,0xc9,0x9c,0xef
+.byte	0xa0,0xe0,0x3b,0x4d,0xae,0x2a,0xf5,0xb0
+.byte	0xc8,0xeb,0xbb,0x3c,0x83,0x53,0x99,0x61
+.byte	0x17,0x2b,0x04,0x7e,0xba,0x77,0xd6,0x26
+.byte	0xe1,0x69,0x14,0x63,0x55,0x21,0x0c,0x7d
+.long	0x80808080, 0x80808080, 0xfefefefe, 0xfefefefe
+.long	0x1b1b1b1b, 0x1b1b1b1b, 0, 0
+.byte	0x52,0x09,0x6a,0xd5,0x30,0x36,0xa5,0x38
+.byte	0xbf,0x40,0xa3,0x9e,0x81,0xf3,0xd7,0xfb
+.byte	0x7c,0xe3,0x39,0x82,0x9b,0x2f,0xff,0x87
+.byte	0x34,0x8e,0x43,0x44,0xc4,0xde,0xe9,0xcb
+.byte	0x54,0x7b,0x94,0x32,0xa6,0xc2,0x23,0x3d
+.byte	0xee,0x4c,0x95,0x0b,0x42,0xfa,0xc3,0x4e
+.byte	0x08,0x2e,0xa1,0x66,0x28,0xd9,0x24,0xb2
+.byte	0x76,0x5b,0xa2,0x49,0x6d,0x8b,0xd1,0x25
+.byte	0x72,0xf8,0xf6,0x64,0x86,0x68,0x98,0x16
+.byte	0xd4,0xa4,0x5c,0xcc,0x5d,0x65,0xb6,0x92
+.byte	0x6c,0x70,0x48,0x50,0xfd,0xed,0xb9,0xda
+.byte	0x5e,0x15,0x46,0x57,0xa7,0x8d,0x9d,0x84
+.byte	0x90,0xd8,0xab,0x00,0x8c,0xbc,0xd3,0x0a
+.byte	0xf7,0xe4,0x58,0x05,0xb8,0xb3,0x45,0x06
+.byte	0xd0,0x2c,0x1e,0x8f,0xca,0x3f,0x0f,0x02
+.byte	0xc1,0xaf,0xbd,0x03,0x01,0x13,0x8a,0x6b
+.byte	0x3a,0x91,0x11,0x41,0x4f,0x67,0xdc,0xea
+.byte	0x97,0xf2,0xcf,0xce,0xf0,0xb4,0xe6,0x73
+.byte	0x96,0xac,0x74,0x22,0xe7,0xad,0x35,0x85
+.byte	0xe2,0xf9,0x37,0xe8,0x1c,0x75,0xdf,0x6e
+.byte	0x47,0xf1,0x1a,0x71,0x1d,0x29,0xc5,0x89
+.byte	0x6f,0xb7,0x62,0x0e,0xaa,0x18,0xbe,0x1b
+.byte	0xfc,0x56,0x3e,0x4b,0xc6,0xd2,0x79,0x20
+.byte	0x9a,0xdb,0xc0,0xfe,0x78,0xcd,0x5a,0xf4
+.byte	0x1f,0xdd,0xa8,0x33,0x88,0x07,0xc7,0x31
+.byte	0xb1,0x12,0x10,0x59,0x27,0x80,0xec,0x5f
+.byte	0x60,0x51,0x7f,0xa9,0x19,0xb5,0x4a,0x0d
+.byte	0x2d,0xe5,0x7a,0x9f,0x93,0xc9,0x9c,0xef
+.byte	0xa0,0xe0,0x3b,0x4d,0xae,0x2a,0xf5,0xb0
+.byte	0xc8,0xeb,0xbb,0x3c,0x83,0x53,0x99,0x61
+.byte	0x17,0x2b,0x04,0x7e,0xba,0x77,0xd6,0x26
+.byte	0xe1,0x69,0x14,0x63,0x55,0x21,0x0c,0x7d
+.long	0x80808080, 0x80808080, 0xfefefefe, 0xfefefefe
+.long	0x1b1b1b1b, 0x1b1b1b1b, 0, 0
+.byte	0x52,0x09,0x6a,0xd5,0x30,0x36,0xa5,0x38
+.byte	0xbf,0x40,0xa3,0x9e,0x81,0xf3,0xd7,0xfb
+.byte	0x7c,0xe3,0x39,0x82,0x9b,0x2f,0xff,0x87
+.byte	0x34,0x8e,0x43,0x44,0xc4,0xde,0xe9,0xcb
+.byte	0x54,0x7b,0x94,0x32,0xa6,0xc2,0x23,0x3d
+.byte	0xee,0x4c,0x95,0x0b,0x42,0xfa,0xc3,0x4e
+.byte	0x08,0x2e,0xa1,0x66,0x28,0xd9,0x24,0xb2
+.byte	0x76,0x5b,0xa2,0x49,0x6d,0x8b,0xd1,0x25
+.byte	0x72,0xf8,0xf6,0x64,0x86,0x68,0x98,0x16
+.byte	0xd4,0xa4,0x5c,0xcc,0x5d,0x65,0xb6,0x92
+.byte	0x6c,0x70,0x48,0x50,0xfd,0xed,0xb9,0xda
+.byte	0x5e,0x15,0x46,0x57,0xa7,0x8d,0x9d,0x84
+.byte	0x90,0xd8,0xab,0x00,0x8c,0xbc,0xd3,0x0a
+.byte	0xf7,0xe4,0x58,0x05,0xb8,0xb3,0x45,0x06
+.byte	0xd0,0x2c,0x1e,0x8f,0xca,0x3f,0x0f,0x02
+.byte	0xc1,0xaf,0xbd,0x03,0x01,0x13,0x8a,0x6b
+.byte	0x3a,0x91,0x11,0x41,0x4f,0x67,0xdc,0xea
+.byte	0x97,0xf2,0xcf,0xce,0xf0,0xb4,0xe6,0x73
+.byte	0x96,0xac,0x74,0x22,0xe7,0xad,0x35,0x85
+.byte	0xe2,0xf9,0x37,0xe8,0x1c,0x75,0xdf,0x6e
+.byte	0x47,0xf1,0x1a,0x71,0x1d,0x29,0xc5,0x89
+.byte	0x6f,0xb7,0x62,0x0e,0xaa,0x18,0xbe,0x1b
+.byte	0xfc,0x56,0x3e,0x4b,0xc6,0xd2,0x79,0x20
+.byte	0x9a,0xdb,0xc0,0xfe,0x78,0xcd,0x5a,0xf4
+.byte	0x1f,0xdd,0xa8,0x33,0x88,0x07,0xc7,0x31
+.byte	0xb1,0x12,0x10,0x59,0x27,0x80,0xec,0x5f
+.byte	0x60,0x51,0x7f,0xa9,0x19,0xb5,0x4a,0x0d
+.byte	0x2d,0xe5,0x7a,0x9f,0x93,0xc9,0x9c,0xef
+.byte	0xa0,0xe0,0x3b,0x4d,0xae,0x2a,0xf5,0xb0
+.byte	0xc8,0xeb,0xbb,0x3c,0x83,0x53,0x99,0x61
+.byte	0x17,0x2b,0x04,0x7e,0xba,0x77,0xd6,0x26
+.byte	0xe1,0x69,0x14,0x63,0x55,0x21,0x0c,0x7d
+.long	0x80808080, 0x80808080, 0xfefefefe, 0xfefefefe
+.long	0x1b1b1b1b, 0x1b1b1b1b, 0, 0
+.byte	0x52,0x09,0x6a,0xd5,0x30,0x36,0xa5,0x38
+.byte	0xbf,0x40,0xa3,0x9e,0x81,0xf3,0xd7,0xfb
+.byte	0x7c,0xe3,0x39,0x82,0x9b,0x2f,0xff,0x87
+.byte	0x34,0x8e,0x43,0x44,0xc4,0xde,0xe9,0xcb
+.byte	0x54,0x7b,0x94,0x32,0xa6,0xc2,0x23,0x3d
+.byte	0xee,0x4c,0x95,0x0b,0x42,0xfa,0xc3,0x4e
+.byte	0x08,0x2e,0xa1,0x66,0x28,0xd9,0x24,0xb2
+.byte	0x76,0x5b,0xa2,0x49,0x6d,0x8b,0xd1,0x25
+.byte	0x72,0xf8,0xf6,0x64,0x86,0x68,0x98,0x16
+.byte	0xd4,0xa4,0x5c,0xcc,0x5d,0x65,0xb6,0x92
+.byte	0x6c,0x70,0x48,0x50,0xfd,0xed,0xb9,0xda
+.byte	0x5e,0x15,0x46,0x57,0xa7,0x8d,0x9d,0x84
+.byte	0x90,0xd8,0xab,0x00,0x8c,0xbc,0xd3,0x0a
+.byte	0xf7,0xe4,0x58,0x05,0xb8,0xb3,0x45,0x06
+.byte	0xd0,0x2c,0x1e,0x8f,0xca,0x3f,0x0f,0x02
+.byte	0xc1,0xaf,0xbd,0x03,0x01,0x13,0x8a,0x6b
+.byte	0x3a,0x91,0x11,0x41,0x4f,0x67,0xdc,0xea
+.byte	0x97,0xf2,0xcf,0xce,0xf0,0xb4,0xe6,0x73
+.byte	0x96,0xac,0x74,0x22,0xe7,0xad,0x35,0x85
+.byte	0xe2,0xf9,0x37,0xe8,0x1c,0x75,0xdf,0x6e
+.byte	0x47,0xf1,0x1a,0x71,0x1d,0x29,0xc5,0x89
+.byte	0x6f,0xb7,0x62,0x0e,0xaa,0x18,0xbe,0x1b
+.byte	0xfc,0x56,0x3e,0x4b,0xc6,0xd2,0x79,0x20
+.byte	0x9a,0xdb,0xc0,0xfe,0x78,0xcd,0x5a,0xf4
+.byte	0x1f,0xdd,0xa8,0x33,0x88,0x07,0xc7,0x31
+.byte	0xb1,0x12,0x10,0x59,0x27,0x80,0xec,0x5f
+.byte	0x60,0x51,0x7f,0xa9,0x19,0xb5,0x4a,0x0d
+.byte	0x2d,0xe5,0x7a,0x9f,0x93,0xc9,0x9c,0xef
+.byte	0xa0,0xe0,0x3b,0x4d,0xae,0x2a,0xf5,0xb0
+.byte	0xc8,0xeb,0xbb,0x3c,0x83,0x53,0x99,0x61
+.byte	0x17,0x2b,0x04,0x7e,0xba,0x77,0xd6,0x26
+.byte	0xe1,0x69,0x14,0x63,0x55,0x21,0x0c,0x7d
+.long	0x80808080, 0x80808080, 0xfefefefe, 0xfefefefe
+.long	0x1b1b1b1b, 0x1b1b1b1b, 0, 0
+.byte	65,69,83,32,102,111,114,32,120,56,54,95,54,52,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0
+.p2align	6
+#endif
diff --git a/third_party/boringssl/mac-x86_64/crypto/aes/aesni-x86_64.S b/third_party/boringssl/mac-x86_64/crypto/aes/aesni-x86_64.S
new file mode 100644
index 0000000..69b22c2
--- /dev/null
+++ b/third_party/boringssl/mac-x86_64/crypto/aes/aesni-x86_64.S
@@ -0,0 +1,3564 @@
+#if defined(__x86_64__)
+.text	
+
+.globl	_aesni_encrypt
+.private_extern _aesni_encrypt
+
+.p2align	4
+_aesni_encrypt:
+	movups	(%rdi),%xmm2
+	movl	240(%rdx),%eax
+	movups	(%rdx),%xmm0
+	movups	16(%rdx),%xmm1
+	leaq	32(%rdx),%rdx
+	xorps	%xmm0,%xmm2
+L$oop_enc1_1:
+.byte	102,15,56,220,209
+	decl	%eax
+	movups	(%rdx),%xmm1
+	leaq	16(%rdx),%rdx
+	jnz	L$oop_enc1_1
+.byte	102,15,56,221,209
+	pxor	%xmm0,%xmm0
+	pxor	%xmm1,%xmm1
+	movups	%xmm2,(%rsi)
+	pxor	%xmm2,%xmm2
+	.byte	0xf3,0xc3
+
+
+.globl	_aesni_decrypt
+.private_extern _aesni_decrypt
+
+.p2align	4
+_aesni_decrypt:
+	movups	(%rdi),%xmm2
+	movl	240(%rdx),%eax
+	movups	(%rdx),%xmm0
+	movups	16(%rdx),%xmm1
+	leaq	32(%rdx),%rdx
+	xorps	%xmm0,%xmm2
+L$oop_dec1_2:
+.byte	102,15,56,222,209
+	decl	%eax
+	movups	(%rdx),%xmm1
+	leaq	16(%rdx),%rdx
+	jnz	L$oop_dec1_2
+.byte	102,15,56,223,209
+	pxor	%xmm0,%xmm0
+	pxor	%xmm1,%xmm1
+	movups	%xmm2,(%rsi)
+	pxor	%xmm2,%xmm2
+	.byte	0xf3,0xc3
+
+
+.p2align	4
+_aesni_encrypt2:
+	movups	(%rcx),%xmm0
+	shll	$4,%eax
+	movups	16(%rcx),%xmm1
+	xorps	%xmm0,%xmm2
+	xorps	%xmm0,%xmm3
+	movups	32(%rcx),%xmm0
+	leaq	32(%rcx,%rax,1),%rcx
+	negq	%rax
+	addq	$16,%rax
+
+L$enc_loop2:
+.byte	102,15,56,220,209
+.byte	102,15,56,220,217
+	movups	(%rcx,%rax,1),%xmm1
+	addq	$32,%rax
+.byte	102,15,56,220,208
+.byte	102,15,56,220,216
+	movups	-16(%rcx,%rax,1),%xmm0
+	jnz	L$enc_loop2
+
+.byte	102,15,56,220,209
+.byte	102,15,56,220,217
+.byte	102,15,56,221,208
+.byte	102,15,56,221,216
+	.byte	0xf3,0xc3
+
+
+.p2align	4
+_aesni_decrypt2:
+	movups	(%rcx),%xmm0
+	shll	$4,%eax
+	movups	16(%rcx),%xmm1
+	xorps	%xmm0,%xmm2
+	xorps	%xmm0,%xmm3
+	movups	32(%rcx),%xmm0
+	leaq	32(%rcx,%rax,1),%rcx
+	negq	%rax
+	addq	$16,%rax
+
+L$dec_loop2:
+.byte	102,15,56,222,209
+.byte	102,15,56,222,217
+	movups	(%rcx,%rax,1),%xmm1
+	addq	$32,%rax
+.byte	102,15,56,222,208
+.byte	102,15,56,222,216
+	movups	-16(%rcx,%rax,1),%xmm0
+	jnz	L$dec_loop2
+
+.byte	102,15,56,222,209
+.byte	102,15,56,222,217
+.byte	102,15,56,223,208
+.byte	102,15,56,223,216
+	.byte	0xf3,0xc3
+
+
+.p2align	4
+_aesni_encrypt3:
+	movups	(%rcx),%xmm0
+	shll	$4,%eax
+	movups	16(%rcx),%xmm1
+	xorps	%xmm0,%xmm2
+	xorps	%xmm0,%xmm3
+	xorps	%xmm0,%xmm4
+	movups	32(%rcx),%xmm0
+	leaq	32(%rcx,%rax,1),%rcx
+	negq	%rax
+	addq	$16,%rax
+
+L$enc_loop3:
+.byte	102,15,56,220,209
+.byte	102,15,56,220,217
+.byte	102,15,56,220,225
+	movups	(%rcx,%rax,1),%xmm1
+	addq	$32,%rax
+.byte	102,15,56,220,208
+.byte	102,15,56,220,216
+.byte	102,15,56,220,224
+	movups	-16(%rcx,%rax,1),%xmm0
+	jnz	L$enc_loop3
+
+.byte	102,15,56,220,209
+.byte	102,15,56,220,217
+.byte	102,15,56,220,225
+.byte	102,15,56,221,208
+.byte	102,15,56,221,216
+.byte	102,15,56,221,224
+	.byte	0xf3,0xc3
+
+
+.p2align	4
+_aesni_decrypt3:
+	movups	(%rcx),%xmm0
+	shll	$4,%eax
+	movups	16(%rcx),%xmm1
+	xorps	%xmm0,%xmm2
+	xorps	%xmm0,%xmm3
+	xorps	%xmm0,%xmm4
+	movups	32(%rcx),%xmm0
+	leaq	32(%rcx,%rax,1),%rcx
+	negq	%rax
+	addq	$16,%rax
+
+L$dec_loop3:
+.byte	102,15,56,222,209
+.byte	102,15,56,222,217
+.byte	102,15,56,222,225
+	movups	(%rcx,%rax,1),%xmm1
+	addq	$32,%rax
+.byte	102,15,56,222,208
+.byte	102,15,56,222,216
+.byte	102,15,56,222,224
+	movups	-16(%rcx,%rax,1),%xmm0
+	jnz	L$dec_loop3
+
+.byte	102,15,56,222,209
+.byte	102,15,56,222,217
+.byte	102,15,56,222,225
+.byte	102,15,56,223,208
+.byte	102,15,56,223,216
+.byte	102,15,56,223,224
+	.byte	0xf3,0xc3
+
+
+.p2align	4
+_aesni_encrypt4:
+	movups	(%rcx),%xmm0
+	shll	$4,%eax
+	movups	16(%rcx),%xmm1
+	xorps	%xmm0,%xmm2
+	xorps	%xmm0,%xmm3
+	xorps	%xmm0,%xmm4
+	xorps	%xmm0,%xmm5
+	movups	32(%rcx),%xmm0
+	leaq	32(%rcx,%rax,1),%rcx
+	negq	%rax
+.byte	0x0f,0x1f,0x00
+	addq	$16,%rax
+
+L$enc_loop4:
+.byte	102,15,56,220,209
+.byte	102,15,56,220,217
+.byte	102,15,56,220,225
+.byte	102,15,56,220,233
+	movups	(%rcx,%rax,1),%xmm1
+	addq	$32,%rax
+.byte	102,15,56,220,208
+.byte	102,15,56,220,216
+.byte	102,15,56,220,224
+.byte	102,15,56,220,232
+	movups	-16(%rcx,%rax,1),%xmm0
+	jnz	L$enc_loop4
+
+.byte	102,15,56,220,209
+.byte	102,15,56,220,217
+.byte	102,15,56,220,225
+.byte	102,15,56,220,233
+.byte	102,15,56,221,208
+.byte	102,15,56,221,216
+.byte	102,15,56,221,224
+.byte	102,15,56,221,232
+	.byte	0xf3,0xc3
+
+
+.p2align	4
+_aesni_decrypt4:
+	movups	(%rcx),%xmm0
+	shll	$4,%eax
+	movups	16(%rcx),%xmm1
+	xorps	%xmm0,%xmm2
+	xorps	%xmm0,%xmm3
+	xorps	%xmm0,%xmm4
+	xorps	%xmm0,%xmm5
+	movups	32(%rcx),%xmm0
+	leaq	32(%rcx,%rax,1),%rcx
+	negq	%rax
+.byte	0x0f,0x1f,0x00
+	addq	$16,%rax
+
+L$dec_loop4:
+.byte	102,15,56,222,209
+.byte	102,15,56,222,217
+.byte	102,15,56,222,225
+.byte	102,15,56,222,233
+	movups	(%rcx,%rax,1),%xmm1
+	addq	$32,%rax
+.byte	102,15,56,222,208
+.byte	102,15,56,222,216
+.byte	102,15,56,222,224
+.byte	102,15,56,222,232
+	movups	-16(%rcx,%rax,1),%xmm0
+	jnz	L$dec_loop4
+
+.byte	102,15,56,222,209
+.byte	102,15,56,222,217
+.byte	102,15,56,222,225
+.byte	102,15,56,222,233
+.byte	102,15,56,223,208
+.byte	102,15,56,223,216
+.byte	102,15,56,223,224
+.byte	102,15,56,223,232
+	.byte	0xf3,0xc3
+
+
+.p2align	4
+_aesni_encrypt6:
+	movups	(%rcx),%xmm0
+	shll	$4,%eax
+	movups	16(%rcx),%xmm1
+	xorps	%xmm0,%xmm2
+	pxor	%xmm0,%xmm3
+	pxor	%xmm0,%xmm4
+.byte	102,15,56,220,209
+	leaq	32(%rcx,%rax,1),%rcx
+	negq	%rax
+.byte	102,15,56,220,217
+	pxor	%xmm0,%xmm5
+	pxor	%xmm0,%xmm6
+.byte	102,15,56,220,225
+	pxor	%xmm0,%xmm7
+	movups	(%rcx,%rax,1),%xmm0
+	addq	$16,%rax
+	jmp	L$enc_loop6_enter
+.p2align	4
+L$enc_loop6:
+.byte	102,15,56,220,209
+.byte	102,15,56,220,217
+.byte	102,15,56,220,225
+L$enc_loop6_enter:
+.byte	102,15,56,220,233
+.byte	102,15,56,220,241
+.byte	102,15,56,220,249
+	movups	(%rcx,%rax,1),%xmm1
+	addq	$32,%rax
+.byte	102,15,56,220,208
+.byte	102,15,56,220,216
+.byte	102,15,56,220,224
+.byte	102,15,56,220,232
+.byte	102,15,56,220,240
+.byte	102,15,56,220,248
+	movups	-16(%rcx,%rax,1),%xmm0
+	jnz	L$enc_loop6
+
+.byte	102,15,56,220,209
+.byte	102,15,56,220,217
+.byte	102,15,56,220,225
+.byte	102,15,56,220,233
+.byte	102,15,56,220,241
+.byte	102,15,56,220,249
+.byte	102,15,56,221,208
+.byte	102,15,56,221,216
+.byte	102,15,56,221,224
+.byte	102,15,56,221,232
+.byte	102,15,56,221,240
+.byte	102,15,56,221,248
+	.byte	0xf3,0xc3
+
+
+.p2align	4
+_aesni_decrypt6:
+	movups	(%rcx),%xmm0
+	shll	$4,%eax
+	movups	16(%rcx),%xmm1
+	xorps	%xmm0,%xmm2
+	pxor	%xmm0,%xmm3
+	pxor	%xmm0,%xmm4
+.byte	102,15,56,222,209
+	leaq	32(%rcx,%rax,1),%rcx
+	negq	%rax
+.byte	102,15,56,222,217
+	pxor	%xmm0,%xmm5
+	pxor	%xmm0,%xmm6
+.byte	102,15,56,222,225
+	pxor	%xmm0,%xmm7
+	movups	(%rcx,%rax,1),%xmm0
+	addq	$16,%rax
+	jmp	L$dec_loop6_enter
+.p2align	4
+L$dec_loop6:
+.byte	102,15,56,222,209
+.byte	102,15,56,222,217
+.byte	102,15,56,222,225
+L$dec_loop6_enter:
+.byte	102,15,56,222,233
+.byte	102,15,56,222,241
+.byte	102,15,56,222,249
+	movups	(%rcx,%rax,1),%xmm1
+	addq	$32,%rax
+.byte	102,15,56,222,208
+.byte	102,15,56,222,216
+.byte	102,15,56,222,224
+.byte	102,15,56,222,232
+.byte	102,15,56,222,240
+.byte	102,15,56,222,248
+	movups	-16(%rcx,%rax,1),%xmm0
+	jnz	L$dec_loop6
+
+.byte	102,15,56,222,209
+.byte	102,15,56,222,217
+.byte	102,15,56,222,225
+.byte	102,15,56,222,233
+.byte	102,15,56,222,241
+.byte	102,15,56,222,249
+.byte	102,15,56,223,208
+.byte	102,15,56,223,216
+.byte	102,15,56,223,224
+.byte	102,15,56,223,232
+.byte	102,15,56,223,240
+.byte	102,15,56,223,248
+	.byte	0xf3,0xc3
+
+
+.p2align	4
+_aesni_encrypt8:
+	movups	(%rcx),%xmm0
+	shll	$4,%eax
+	movups	16(%rcx),%xmm1
+	xorps	%xmm0,%xmm2
+	xorps	%xmm0,%xmm3
+	pxor	%xmm0,%xmm4
+	pxor	%xmm0,%xmm5
+	pxor	%xmm0,%xmm6
+	leaq	32(%rcx,%rax,1),%rcx
+	negq	%rax
+.byte	102,15,56,220,209
+	pxor	%xmm0,%xmm7
+	pxor	%xmm0,%xmm8
+.byte	102,15,56,220,217
+	pxor	%xmm0,%xmm9
+	movups	(%rcx,%rax,1),%xmm0
+	addq	$16,%rax
+	jmp	L$enc_loop8_inner
+.p2align	4
+L$enc_loop8:
+.byte	102,15,56,220,209
+.byte	102,15,56,220,217
+L$enc_loop8_inner:
+.byte	102,15,56,220,225
+.byte	102,15,56,220,233
+.byte	102,15,56,220,241
+.byte	102,15,56,220,249
+.byte	102,68,15,56,220,193
+.byte	102,68,15,56,220,201
+L$enc_loop8_enter:
+	movups	(%rcx,%rax,1),%xmm1
+	addq	$32,%rax
+.byte	102,15,56,220,208
+.byte	102,15,56,220,216
+.byte	102,15,56,220,224
+.byte	102,15,56,220,232
+.byte	102,15,56,220,240
+.byte	102,15,56,220,248
+.byte	102,68,15,56,220,192
+.byte	102,68,15,56,220,200
+	movups	-16(%rcx,%rax,1),%xmm0
+	jnz	L$enc_loop8
+
+.byte	102,15,56,220,209
+.byte	102,15,56,220,217
+.byte	102,15,56,220,225
+.byte	102,15,56,220,233
+.byte	102,15,56,220,241
+.byte	102,15,56,220,249
+.byte	102,68,15,56,220,193
+.byte	102,68,15,56,220,201
+.byte	102,15,56,221,208
+.byte	102,15,56,221,216
+.byte	102,15,56,221,224
+.byte	102,15,56,221,232
+.byte	102,15,56,221,240
+.byte	102,15,56,221,248
+.byte	102,68,15,56,221,192
+.byte	102,68,15,56,221,200
+	.byte	0xf3,0xc3
+
+
+.p2align	4
+_aesni_decrypt8:
+	movups	(%rcx),%xmm0
+	shll	$4,%eax
+	movups	16(%rcx),%xmm1
+	xorps	%xmm0,%xmm2
+	xorps	%xmm0,%xmm3
+	pxor	%xmm0,%xmm4
+	pxor	%xmm0,%xmm5
+	pxor	%xmm0,%xmm6
+	leaq	32(%rcx,%rax,1),%rcx
+	negq	%rax
+.byte	102,15,56,222,209
+	pxor	%xmm0,%xmm7
+	pxor	%xmm0,%xmm8
+.byte	102,15,56,222,217
+	pxor	%xmm0,%xmm9
+	movups	(%rcx,%rax,1),%xmm0
+	addq	$16,%rax
+	jmp	L$dec_loop8_inner
+.p2align	4
+L$dec_loop8:
+.byte	102,15,56,222,209
+.byte	102,15,56,222,217
+L$dec_loop8_inner:
+.byte	102,15,56,222,225
+.byte	102,15,56,222,233
+.byte	102,15,56,222,241
+.byte	102,15,56,222,249
+.byte	102,68,15,56,222,193
+.byte	102,68,15,56,222,201
+L$dec_loop8_enter:
+	movups	(%rcx,%rax,1),%xmm1
+	addq	$32,%rax
+.byte	102,15,56,222,208
+.byte	102,15,56,222,216
+.byte	102,15,56,222,224
+.byte	102,15,56,222,232
+.byte	102,15,56,222,240
+.byte	102,15,56,222,248
+.byte	102,68,15,56,222,192
+.byte	102,68,15,56,222,200
+	movups	-16(%rcx,%rax,1),%xmm0
+	jnz	L$dec_loop8
+
+.byte	102,15,56,222,209
+.byte	102,15,56,222,217
+.byte	102,15,56,222,225
+.byte	102,15,56,222,233
+.byte	102,15,56,222,241
+.byte	102,15,56,222,249
+.byte	102,68,15,56,222,193
+.byte	102,68,15,56,222,201
+.byte	102,15,56,223,208
+.byte	102,15,56,223,216
+.byte	102,15,56,223,224
+.byte	102,15,56,223,232
+.byte	102,15,56,223,240
+.byte	102,15,56,223,248
+.byte	102,68,15,56,223,192
+.byte	102,68,15,56,223,200
+	.byte	0xf3,0xc3
+
+.globl	_aesni_ecb_encrypt
+.private_extern _aesni_ecb_encrypt
+
+.p2align	4
+_aesni_ecb_encrypt:
+	andq	$-16,%rdx
+	jz	L$ecb_ret
+
+	movl	240(%rcx),%eax
+	movups	(%rcx),%xmm0
+	movq	%rcx,%r11
+	movl	%eax,%r10d
+	testl	%r8d,%r8d
+	jz	L$ecb_decrypt
+
+	cmpq	$128,%rdx
+	jb	L$ecb_enc_tail
+
+	movdqu	(%rdi),%xmm2
+	movdqu	16(%rdi),%xmm3
+	movdqu	32(%rdi),%xmm4
+	movdqu	48(%rdi),%xmm5
+	movdqu	64(%rdi),%xmm6
+	movdqu	80(%rdi),%xmm7
+	movdqu	96(%rdi),%xmm8
+	movdqu	112(%rdi),%xmm9
+	leaq	128(%rdi),%rdi
+	subq	$128,%rdx
+	jmp	L$ecb_enc_loop8_enter
+.p2align	4
+L$ecb_enc_loop8:
+	movups	%xmm2,(%rsi)
+	movq	%r11,%rcx
+	movdqu	(%rdi),%xmm2
+	movl	%r10d,%eax
+	movups	%xmm3,16(%rsi)
+	movdqu	16(%rdi),%xmm3
+	movups	%xmm4,32(%rsi)
+	movdqu	32(%rdi),%xmm4
+	movups	%xmm5,48(%rsi)
+	movdqu	48(%rdi),%xmm5
+	movups	%xmm6,64(%rsi)
+	movdqu	64(%rdi),%xmm6
+	movups	%xmm7,80(%rsi)
+	movdqu	80(%rdi),%xmm7
+	movups	%xmm8,96(%rsi)
+	movdqu	96(%rdi),%xmm8
+	movups	%xmm9,112(%rsi)
+	leaq	128(%rsi),%rsi
+	movdqu	112(%rdi),%xmm9
+	leaq	128(%rdi),%rdi
+L$ecb_enc_loop8_enter:
+
+	call	_aesni_encrypt8
+
+	subq	$128,%rdx
+	jnc	L$ecb_enc_loop8
+
+	movups	%xmm2,(%rsi)
+	movq	%r11,%rcx
+	movups	%xmm3,16(%rsi)
+	movl	%r10d,%eax
+	movups	%xmm4,32(%rsi)
+	movups	%xmm5,48(%rsi)
+	movups	%xmm6,64(%rsi)
+	movups	%xmm7,80(%rsi)
+	movups	%xmm8,96(%rsi)
+	movups	%xmm9,112(%rsi)
+	leaq	128(%rsi),%rsi
+	addq	$128,%rdx
+	jz	L$ecb_ret
+
+L$ecb_enc_tail:
+	movups	(%rdi),%xmm2
+	cmpq	$32,%rdx
+	jb	L$ecb_enc_one
+	movups	16(%rdi),%xmm3
+	je	L$ecb_enc_two
+	movups	32(%rdi),%xmm4
+	cmpq	$64,%rdx
+	jb	L$ecb_enc_three
+	movups	48(%rdi),%xmm5
+	je	L$ecb_enc_four
+	movups	64(%rdi),%xmm6
+	cmpq	$96,%rdx
+	jb	L$ecb_enc_five
+	movups	80(%rdi),%xmm7
+	je	L$ecb_enc_six
+	movdqu	96(%rdi),%xmm8
+	xorps	%xmm9,%xmm9
+	call	_aesni_encrypt8
+	movups	%xmm2,(%rsi)
+	movups	%xmm3,16(%rsi)
+	movups	%xmm4,32(%rsi)
+	movups	%xmm5,48(%rsi)
+	movups	%xmm6,64(%rsi)
+	movups	%xmm7,80(%rsi)
+	movups	%xmm8,96(%rsi)
+	jmp	L$ecb_ret
+.p2align	4
+L$ecb_enc_one:
+	movups	(%rcx),%xmm0
+	movups	16(%rcx),%xmm1
+	leaq	32(%rcx),%rcx
+	xorps	%xmm0,%xmm2
+L$oop_enc1_3:
+.byte	102,15,56,220,209
+	decl	%eax
+	movups	(%rcx),%xmm1
+	leaq	16(%rcx),%rcx
+	jnz	L$oop_enc1_3
+.byte	102,15,56,221,209
+	movups	%xmm2,(%rsi)
+	jmp	L$ecb_ret
+.p2align	4
+L$ecb_enc_two:
+	call	_aesni_encrypt2
+	movups	%xmm2,(%rsi)
+	movups	%xmm3,16(%rsi)
+	jmp	L$ecb_ret
+.p2align	4
+L$ecb_enc_three:
+	call	_aesni_encrypt3
+	movups	%xmm2,(%rsi)
+	movups	%xmm3,16(%rsi)
+	movups	%xmm4,32(%rsi)
+	jmp	L$ecb_ret
+.p2align	4
+L$ecb_enc_four:
+	call	_aesni_encrypt4
+	movups	%xmm2,(%rsi)
+	movups	%xmm3,16(%rsi)
+	movups	%xmm4,32(%rsi)
+	movups	%xmm5,48(%rsi)
+	jmp	L$ecb_ret
+.p2align	4
+L$ecb_enc_five:
+	xorps	%xmm7,%xmm7
+	call	_aesni_encrypt6
+	movups	%xmm2,(%rsi)
+	movups	%xmm3,16(%rsi)
+	movups	%xmm4,32(%rsi)
+	movups	%xmm5,48(%rsi)
+	movups	%xmm6,64(%rsi)
+	jmp	L$ecb_ret
+.p2align	4
+L$ecb_enc_six:
+	call	_aesni_encrypt6
+	movups	%xmm2,(%rsi)
+	movups	%xmm3,16(%rsi)
+	movups	%xmm4,32(%rsi)
+	movups	%xmm5,48(%rsi)
+	movups	%xmm6,64(%rsi)
+	movups	%xmm7,80(%rsi)
+	jmp	L$ecb_ret
+
+.p2align	4
+L$ecb_decrypt:
+	cmpq	$128,%rdx
+	jb	L$ecb_dec_tail
+
+	movdqu	(%rdi),%xmm2
+	movdqu	16(%rdi),%xmm3
+	movdqu	32(%rdi),%xmm4
+	movdqu	48(%rdi),%xmm5
+	movdqu	64(%rdi),%xmm6
+	movdqu	80(%rdi),%xmm7
+	movdqu	96(%rdi),%xmm8
+	movdqu	112(%rdi),%xmm9
+	leaq	128(%rdi),%rdi
+	subq	$128,%rdx
+	jmp	L$ecb_dec_loop8_enter
+.p2align	4
+L$ecb_dec_loop8:
+	movups	%xmm2,(%rsi)
+	movq	%r11,%rcx
+	movdqu	(%rdi),%xmm2
+	movl	%r10d,%eax
+	movups	%xmm3,16(%rsi)
+	movdqu	16(%rdi),%xmm3
+	movups	%xmm4,32(%rsi)
+	movdqu	32(%rdi),%xmm4
+	movups	%xmm5,48(%rsi)
+	movdqu	48(%rdi),%xmm5
+	movups	%xmm6,64(%rsi)
+	movdqu	64(%rdi),%xmm6
+	movups	%xmm7,80(%rsi)
+	movdqu	80(%rdi),%xmm7
+	movups	%xmm8,96(%rsi)
+	movdqu	96(%rdi),%xmm8
+	movups	%xmm9,112(%rsi)
+	leaq	128(%rsi),%rsi
+	movdqu	112(%rdi),%xmm9
+	leaq	128(%rdi),%rdi
+L$ecb_dec_loop8_enter:
+
+	call	_aesni_decrypt8
+
+	movups	(%r11),%xmm0
+	subq	$128,%rdx
+	jnc	L$ecb_dec_loop8
+
+	movups	%xmm2,(%rsi)
+	pxor	%xmm2,%xmm2
+	movq	%r11,%rcx
+	movups	%xmm3,16(%rsi)
+	pxor	%xmm3,%xmm3
+	movl	%r10d,%eax
+	movups	%xmm4,32(%rsi)
+	pxor	%xmm4,%xmm4
+	movups	%xmm5,48(%rsi)
+	pxor	%xmm5,%xmm5
+	movups	%xmm6,64(%rsi)
+	pxor	%xmm6,%xmm6
+	movups	%xmm7,80(%rsi)
+	pxor	%xmm7,%xmm7
+	movups	%xmm8,96(%rsi)
+	pxor	%xmm8,%xmm8
+	movups	%xmm9,112(%rsi)
+	pxor	%xmm9,%xmm9
+	leaq	128(%rsi),%rsi
+	addq	$128,%rdx
+	jz	L$ecb_ret
+
+L$ecb_dec_tail:
+	movups	(%rdi),%xmm2
+	cmpq	$32,%rdx
+	jb	L$ecb_dec_one
+	movups	16(%rdi),%xmm3
+	je	L$ecb_dec_two
+	movups	32(%rdi),%xmm4
+	cmpq	$64,%rdx
+	jb	L$ecb_dec_three
+	movups	48(%rdi),%xmm5
+	je	L$ecb_dec_four
+	movups	64(%rdi),%xmm6
+	cmpq	$96,%rdx
+	jb	L$ecb_dec_five
+	movups	80(%rdi),%xmm7
+	je	L$ecb_dec_six
+	movups	96(%rdi),%xmm8
+	movups	(%rcx),%xmm0
+	xorps	%xmm9,%xmm9
+	call	_aesni_decrypt8
+	movups	%xmm2,(%rsi)
+	pxor	%xmm2,%xmm2
+	movups	%xmm3,16(%rsi)
+	pxor	%xmm3,%xmm3
+	movups	%xmm4,32(%rsi)
+	pxor	%xmm4,%xmm4
+	movups	%xmm5,48(%rsi)
+	pxor	%xmm5,%xmm5
+	movups	%xmm6,64(%rsi)
+	pxor	%xmm6,%xmm6
+	movups	%xmm7,80(%rsi)
+	pxor	%xmm7,%xmm7
+	movups	%xmm8,96(%rsi)
+	pxor	%xmm8,%xmm8
+	pxor	%xmm9,%xmm9
+	jmp	L$ecb_ret
+.p2align	4
+L$ecb_dec_one:
+	movups	(%rcx),%xmm0
+	movups	16(%rcx),%xmm1
+	leaq	32(%rcx),%rcx
+	xorps	%xmm0,%xmm2
+L$oop_dec1_4:
+.byte	102,15,56,222,209
+	decl	%eax
+	movups	(%rcx),%xmm1
+	leaq	16(%rcx),%rcx
+	jnz	L$oop_dec1_4
+.byte	102,15,56,223,209
+	movups	%xmm2,(%rsi)
+	pxor	%xmm2,%xmm2
+	jmp	L$ecb_ret
+.p2align	4
+L$ecb_dec_two:
+	call	_aesni_decrypt2
+	movups	%xmm2,(%rsi)
+	pxor	%xmm2,%xmm2
+	movups	%xmm3,16(%rsi)
+	pxor	%xmm3,%xmm3
+	jmp	L$ecb_ret
+.p2align	4
+L$ecb_dec_three:
+	call	_aesni_decrypt3
+	movups	%xmm2,(%rsi)
+	pxor	%xmm2,%xmm2
+	movups	%xmm3,16(%rsi)
+	pxor	%xmm3,%xmm3
+	movups	%xmm4,32(%rsi)
+	pxor	%xmm4,%xmm4
+	jmp	L$ecb_ret
+.p2align	4
+L$ecb_dec_four:
+	call	_aesni_decrypt4
+	movups	%xmm2,(%rsi)
+	pxor	%xmm2,%xmm2
+	movups	%xmm3,16(%rsi)
+	pxor	%xmm3,%xmm3
+	movups	%xmm4,32(%rsi)
+	pxor	%xmm4,%xmm4
+	movups	%xmm5,48(%rsi)
+	pxor	%xmm5,%xmm5
+	jmp	L$ecb_ret
+.p2align	4
+L$ecb_dec_five:
+	xorps	%xmm7,%xmm7
+	call	_aesni_decrypt6
+	movups	%xmm2,(%rsi)
+	pxor	%xmm2,%xmm2
+	movups	%xmm3,16(%rsi)
+	pxor	%xmm3,%xmm3
+	movups	%xmm4,32(%rsi)
+	pxor	%xmm4,%xmm4
+	movups	%xmm5,48(%rsi)
+	pxor	%xmm5,%xmm5
+	movups	%xmm6,64(%rsi)
+	pxor	%xmm6,%xmm6
+	pxor	%xmm7,%xmm7
+	jmp	L$ecb_ret
+.p2align	4
+L$ecb_dec_six:
+	call	_aesni_decrypt6
+	movups	%xmm2,(%rsi)
+	pxor	%xmm2,%xmm2
+	movups	%xmm3,16(%rsi)
+	pxor	%xmm3,%xmm3
+	movups	%xmm4,32(%rsi)
+	pxor	%xmm4,%xmm4
+	movups	%xmm5,48(%rsi)
+	pxor	%xmm5,%xmm5
+	movups	%xmm6,64(%rsi)
+	pxor	%xmm6,%xmm6
+	movups	%xmm7,80(%rsi)
+	pxor	%xmm7,%xmm7
+
+L$ecb_ret:
+	xorps	%xmm0,%xmm0
+	pxor	%xmm1,%xmm1
+	.byte	0xf3,0xc3
+
+.globl	_aesni_ccm64_encrypt_blocks
+.private_extern _aesni_ccm64_encrypt_blocks
+
+.p2align	4
+_aesni_ccm64_encrypt_blocks:
+	movl	240(%rcx),%eax
+	movdqu	(%r8),%xmm6
+	movdqa	L$increment64(%rip),%xmm9
+	movdqa	L$bswap_mask(%rip),%xmm7
+
+	shll	$4,%eax
+	movl	$16,%r10d
+	leaq	0(%rcx),%r11
+	movdqu	(%r9),%xmm3
+	movdqa	%xmm6,%xmm2
+	leaq	32(%rcx,%rax,1),%rcx
+.byte	102,15,56,0,247
+	subq	%rax,%r10
+	jmp	L$ccm64_enc_outer
+.p2align	4
+L$ccm64_enc_outer:
+	movups	(%r11),%xmm0
+	movq	%r10,%rax
+	movups	(%rdi),%xmm8
+
+	xorps	%xmm0,%xmm2
+	movups	16(%r11),%xmm1
+	xorps	%xmm8,%xmm0
+	xorps	%xmm0,%xmm3
+	movups	32(%r11),%xmm0
+
+L$ccm64_enc2_loop:
+.byte	102,15,56,220,209
+.byte	102,15,56,220,217
+	movups	(%rcx,%rax,1),%xmm1
+	addq	$32,%rax
+.byte	102,15,56,220,208
+.byte	102,15,56,220,216
+	movups	-16(%rcx,%rax,1),%xmm0
+	jnz	L$ccm64_enc2_loop
+.byte	102,15,56,220,209
+.byte	102,15,56,220,217
+	paddq	%xmm9,%xmm6
+	decq	%rdx
+.byte	102,15,56,221,208
+.byte	102,15,56,221,216
+
+	leaq	16(%rdi),%rdi
+	xorps	%xmm2,%xmm8
+	movdqa	%xmm6,%xmm2
+	movups	%xmm8,(%rsi)
+.byte	102,15,56,0,215
+	leaq	16(%rsi),%rsi
+	jnz	L$ccm64_enc_outer
+
+	pxor	%xmm0,%xmm0
+	pxor	%xmm1,%xmm1
+	pxor	%xmm2,%xmm2
+	movups	%xmm3,(%r9)
+	pxor	%xmm3,%xmm3
+	pxor	%xmm8,%xmm8
+	pxor	%xmm6,%xmm6
+	.byte	0xf3,0xc3
+
+.globl	_aesni_ccm64_decrypt_blocks
+.private_extern _aesni_ccm64_decrypt_blocks
+
+.p2align	4
+_aesni_ccm64_decrypt_blocks:
+	movl	240(%rcx),%eax
+	movups	(%r8),%xmm6
+	movdqu	(%r9),%xmm3
+	movdqa	L$increment64(%rip),%xmm9
+	movdqa	L$bswap_mask(%rip),%xmm7
+
+	movaps	%xmm6,%xmm2
+	movl	%eax,%r10d
+	movq	%rcx,%r11
+.byte	102,15,56,0,247
+	movups	(%rcx),%xmm0
+	movups	16(%rcx),%xmm1
+	leaq	32(%rcx),%rcx
+	xorps	%xmm0,%xmm2
+L$oop_enc1_5:
+.byte	102,15,56,220,209
+	decl	%eax
+	movups	(%rcx),%xmm1
+	leaq	16(%rcx),%rcx
+	jnz	L$oop_enc1_5
+.byte	102,15,56,221,209
+	shll	$4,%r10d
+	movl	$16,%eax
+	movups	(%rdi),%xmm8
+	paddq	%xmm9,%xmm6
+	leaq	16(%rdi),%rdi
+	subq	%r10,%rax
+	leaq	32(%r11,%r10,1),%rcx
+	movq	%rax,%r10
+	jmp	L$ccm64_dec_outer
+.p2align	4
+L$ccm64_dec_outer:
+	xorps	%xmm2,%xmm8
+	movdqa	%xmm6,%xmm2
+	movups	%xmm8,(%rsi)
+	leaq	16(%rsi),%rsi
+.byte	102,15,56,0,215
+
+	subq	$1,%rdx
+	jz	L$ccm64_dec_break
+
+	movups	(%r11),%xmm0
+	movq	%r10,%rax
+	movups	16(%r11),%xmm1
+	xorps	%xmm0,%xmm8
+	xorps	%xmm0,%xmm2
+	xorps	%xmm8,%xmm3
+	movups	32(%r11),%xmm0
+	jmp	L$ccm64_dec2_loop
+.p2align	4
+L$ccm64_dec2_loop:
+.byte	102,15,56,220,209
+.byte	102,15,56,220,217
+	movups	(%rcx,%rax,1),%xmm1
+	addq	$32,%rax
+.byte	102,15,56,220,208
+.byte	102,15,56,220,216
+	movups	-16(%rcx,%rax,1),%xmm0
+	jnz	L$ccm64_dec2_loop
+	movups	(%rdi),%xmm8
+	paddq	%xmm9,%xmm6
+.byte	102,15,56,220,209
+.byte	102,15,56,220,217
+.byte	102,15,56,221,208
+.byte	102,15,56,221,216
+	leaq	16(%rdi),%rdi
+	jmp	L$ccm64_dec_outer
+
+.p2align	4
+L$ccm64_dec_break:
+
+	movl	240(%r11),%eax
+	movups	(%r11),%xmm0
+	movups	16(%r11),%xmm1
+	xorps	%xmm0,%xmm8
+	leaq	32(%r11),%r11
+	xorps	%xmm8,%xmm3
+L$oop_enc1_6:
+.byte	102,15,56,220,217
+	decl	%eax
+	movups	(%r11),%xmm1
+	leaq	16(%r11),%r11
+	jnz	L$oop_enc1_6
+.byte	102,15,56,221,217
+	pxor	%xmm0,%xmm0
+	pxor	%xmm1,%xmm1
+	pxor	%xmm2,%xmm2
+	movups	%xmm3,(%r9)
+	pxor	%xmm3,%xmm3
+	pxor	%xmm8,%xmm8
+	pxor	%xmm6,%xmm6
+	.byte	0xf3,0xc3
+
+.globl	_aesni_ctr32_encrypt_blocks
+.private_extern _aesni_ctr32_encrypt_blocks
+
+.p2align	4
+_aesni_ctr32_encrypt_blocks:
+	cmpq	$1,%rdx
+	jne	L$ctr32_bulk
+
+
+
+	movups	(%r8),%xmm2
+	movups	(%rdi),%xmm3
+	movl	240(%rcx),%edx
+	movups	(%rcx),%xmm0
+	movups	16(%rcx),%xmm1
+	leaq	32(%rcx),%rcx
+	xorps	%xmm0,%xmm2
+L$oop_enc1_7:
+.byte	102,15,56,220,209
+	decl	%edx
+	movups	(%rcx),%xmm1
+	leaq	16(%rcx),%rcx
+	jnz	L$oop_enc1_7
+.byte	102,15,56,221,209
+	pxor	%xmm0,%xmm0
+	pxor	%xmm1,%xmm1
+	xorps	%xmm3,%xmm2
+	pxor	%xmm3,%xmm3
+	movups	%xmm2,(%rsi)
+	xorps	%xmm2,%xmm2
+	jmp	L$ctr32_epilogue
+
+.p2align	4
+L$ctr32_bulk:
+	leaq	(%rsp),%rax
+	pushq	%rbp
+	subq	$128,%rsp
+	andq	$-16,%rsp
+	leaq	-8(%rax),%rbp
+
+
+
+
+	movdqu	(%r8),%xmm2
+	movdqu	(%rcx),%xmm0
+	movl	12(%r8),%r8d
+	pxor	%xmm0,%xmm2
+	movl	12(%rcx),%r11d
+	movdqa	%xmm2,0(%rsp)
+	bswapl	%r8d
+	movdqa	%xmm2,%xmm3
+	movdqa	%xmm2,%xmm4
+	movdqa	%xmm2,%xmm5
+	movdqa	%xmm2,64(%rsp)
+	movdqa	%xmm2,80(%rsp)
+	movdqa	%xmm2,96(%rsp)
+	movq	%rdx,%r10
+	movdqa	%xmm2,112(%rsp)
+
+	leaq	1(%r8),%rax
+	leaq	2(%r8),%rdx
+	bswapl	%eax
+	bswapl	%edx
+	xorl	%r11d,%eax
+	xorl	%r11d,%edx
+.byte	102,15,58,34,216,3
+	leaq	3(%r8),%rax
+	movdqa	%xmm3,16(%rsp)
+.byte	102,15,58,34,226,3
+	bswapl	%eax
+	movq	%r10,%rdx
+	leaq	4(%r8),%r10
+	movdqa	%xmm4,32(%rsp)
+	xorl	%r11d,%eax
+	bswapl	%r10d
+.byte	102,15,58,34,232,3
+	xorl	%r11d,%r10d
+	movdqa	%xmm5,48(%rsp)
+	leaq	5(%r8),%r9
+	movl	%r10d,64+12(%rsp)
+	bswapl	%r9d
+	leaq	6(%r8),%r10
+	movl	240(%rcx),%eax
+	xorl	%r11d,%r9d
+	bswapl	%r10d
+	movl	%r9d,80+12(%rsp)
+	xorl	%r11d,%r10d
+	leaq	7(%r8),%r9
+	movl	%r10d,96+12(%rsp)
+	bswapl	%r9d
+	movl	_OPENSSL_ia32cap_P+4(%rip),%r10d
+	xorl	%r11d,%r9d
+	andl	$71303168,%r10d
+	movl	%r9d,112+12(%rsp)
+
+	movups	16(%rcx),%xmm1
+
+	movdqa	64(%rsp),%xmm6
+	movdqa	80(%rsp),%xmm7
+
+	cmpq	$8,%rdx
+	jb	L$ctr32_tail
+
+	subq	$6,%rdx
+	cmpl	$4194304,%r10d
+	je	L$ctr32_6x
+
+	leaq	128(%rcx),%rcx
+	subq	$2,%rdx
+	jmp	L$ctr32_loop8
+
+.p2align	4
+L$ctr32_6x:
+	shll	$4,%eax
+	movl	$48,%r10d
+	bswapl	%r11d
+	leaq	32(%rcx,%rax,1),%rcx
+	subq	%rax,%r10
+	jmp	L$ctr32_loop6
+
+.p2align	4
+L$ctr32_loop6:
+	addl	$6,%r8d
+	movups	-48(%rcx,%r10,1),%xmm0
+.byte	102,15,56,220,209
+	movl	%r8d,%eax
+	xorl	%r11d,%eax
+.byte	102,15,56,220,217
+.byte	0x0f,0x38,0xf1,0x44,0x24,12
+	leal	1(%r8),%eax
+.byte	102,15,56,220,225
+	xorl	%r11d,%eax
+.byte	0x0f,0x38,0xf1,0x44,0x24,28
+.byte	102,15,56,220,233
+	leal	2(%r8),%eax
+	xorl	%r11d,%eax
+.byte	102,15,56,220,241
+.byte	0x0f,0x38,0xf1,0x44,0x24,44
+	leal	3(%r8),%eax
+.byte	102,15,56,220,249
+	movups	-32(%rcx,%r10,1),%xmm1
+	xorl	%r11d,%eax
+
+.byte	102,15,56,220,208
+.byte	0x0f,0x38,0xf1,0x44,0x24,60
+	leal	4(%r8),%eax
+.byte	102,15,56,220,216
+	xorl	%r11d,%eax
+.byte	0x0f,0x38,0xf1,0x44,0x24,76
+.byte	102,15,56,220,224
+	leal	5(%r8),%eax
+	xorl	%r11d,%eax
+.byte	102,15,56,220,232
+.byte	0x0f,0x38,0xf1,0x44,0x24,92
+	movq	%r10,%rax
+.byte	102,15,56,220,240
+.byte	102,15,56,220,248
+	movups	-16(%rcx,%r10,1),%xmm0
+
+	call	L$enc_loop6
+
+	movdqu	(%rdi),%xmm8
+	movdqu	16(%rdi),%xmm9
+	movdqu	32(%rdi),%xmm10
+	movdqu	48(%rdi),%xmm11
+	movdqu	64(%rdi),%xmm12
+	movdqu	80(%rdi),%xmm13
+	leaq	96(%rdi),%rdi
+	movups	-64(%rcx,%r10,1),%xmm1
+	pxor	%xmm2,%xmm8
+	movaps	0(%rsp),%xmm2
+	pxor	%xmm3,%xmm9
+	movaps	16(%rsp),%xmm3
+	pxor	%xmm4,%xmm10
+	movaps	32(%rsp),%xmm4
+	pxor	%xmm5,%xmm11
+	movaps	48(%rsp),%xmm5
+	pxor	%xmm6,%xmm12
+	movaps	64(%rsp),%xmm6
+	pxor	%xmm7,%xmm13
+	movaps	80(%rsp),%xmm7
+	movdqu	%xmm8,(%rsi)
+	movdqu	%xmm9,16(%rsi)
+	movdqu	%xmm10,32(%rsi)
+	movdqu	%xmm11,48(%rsi)
+	movdqu	%xmm12,64(%rsi)
+	movdqu	%xmm13,80(%rsi)
+	leaq	96(%rsi),%rsi
+
+	subq	$6,%rdx
+	jnc	L$ctr32_loop6
+
+	addq	$6,%rdx
+	jz	L$ctr32_done
+
+	leal	-48(%r10),%eax
+	leaq	-80(%rcx,%r10,1),%rcx
+	negl	%eax
+	shrl	$4,%eax
+	jmp	L$ctr32_tail
+
+.p2align	5
+L$ctr32_loop8:
+	addl	$8,%r8d
+	movdqa	96(%rsp),%xmm8
+.byte	102,15,56,220,209
+	movl	%r8d,%r9d
+	movdqa	112(%rsp),%xmm9
+.byte	102,15,56,220,217
+	bswapl	%r9d
+	movups	32-128(%rcx),%xmm0
+.byte	102,15,56,220,225
+	xorl	%r11d,%r9d
+	nop
+.byte	102,15,56,220,233
+	movl	%r9d,0+12(%rsp)
+	leaq	1(%r8),%r9
+.byte	102,15,56,220,241
+.byte	102,15,56,220,249
+.byte	102,68,15,56,220,193
+.byte	102,68,15,56,220,201
+	movups	48-128(%rcx),%xmm1
+	bswapl	%r9d
+.byte	102,15,56,220,208
+.byte	102,15,56,220,216
+	xorl	%r11d,%r9d
+.byte	0x66,0x90
+.byte	102,15,56,220,224
+.byte	102,15,56,220,232
+	movl	%r9d,16+12(%rsp)
+	leaq	2(%r8),%r9
+.byte	102,15,56,220,240
+.byte	102,15,56,220,248
+.byte	102,68,15,56,220,192
+.byte	102,68,15,56,220,200
+	movups	64-128(%rcx),%xmm0
+	bswapl	%r9d
+.byte	102,15,56,220,209
+.byte	102,15,56,220,217
+	xorl	%r11d,%r9d
+.byte	0x66,0x90
+.byte	102,15,56,220,225
+.byte	102,15,56,220,233
+	movl	%r9d,32+12(%rsp)
+	leaq	3(%r8),%r9
+.byte	102,15,56,220,241
+.byte	102,15,56,220,249
+.byte	102,68,15,56,220,193
+.byte	102,68,15,56,220,201
+	movups	80-128(%rcx),%xmm1
+	bswapl	%r9d
+.byte	102,15,56,220,208
+.byte	102,15,56,220,216
+	xorl	%r11d,%r9d
+.byte	0x66,0x90
+.byte	102,15,56,220,224
+.byte	102,15,56,220,232
+	movl	%r9d,48+12(%rsp)
+	leaq	4(%r8),%r9
+.byte	102,15,56,220,240
+.byte	102,15,56,220,248
+.byte	102,68,15,56,220,192
+.byte	102,68,15,56,220,200
+	movups	96-128(%rcx),%xmm0
+	bswapl	%r9d
+.byte	102,15,56,220,209
+.byte	102,15,56,220,217
+	xorl	%r11d,%r9d
+.byte	0x66,0x90
+.byte	102,15,56,220,225
+.byte	102,15,56,220,233
+	movl	%r9d,64+12(%rsp)
+	leaq	5(%r8),%r9
+.byte	102,15,56,220,241
+.byte	102,15,56,220,249
+.byte	102,68,15,56,220,193
+.byte	102,68,15,56,220,201
+	movups	112-128(%rcx),%xmm1
+	bswapl	%r9d
+.byte	102,15,56,220,208
+.byte	102,15,56,220,216
+	xorl	%r11d,%r9d
+.byte	0x66,0x90
+.byte	102,15,56,220,224
+.byte	102,15,56,220,232
+	movl	%r9d,80+12(%rsp)
+	leaq	6(%r8),%r9
+.byte	102,15,56,220,240
+.byte	102,15,56,220,248
+.byte	102,68,15,56,220,192
+.byte	102,68,15,56,220,200
+	movups	128-128(%rcx),%xmm0
+	bswapl	%r9d
+.byte	102,15,56,220,209
+.byte	102,15,56,220,217
+	xorl	%r11d,%r9d
+.byte	0x66,0x90
+.byte	102,15,56,220,225
+.byte	102,15,56,220,233
+	movl	%r9d,96+12(%rsp)
+	leaq	7(%r8),%r9
+.byte	102,15,56,220,241
+.byte	102,15,56,220,249
+.byte	102,68,15,56,220,193
+.byte	102,68,15,56,220,201
+	movups	144-128(%rcx),%xmm1
+	bswapl	%r9d
+.byte	102,15,56,220,208
+.byte	102,15,56,220,216
+.byte	102,15,56,220,224
+	xorl	%r11d,%r9d
+	movdqu	0(%rdi),%xmm10
+.byte	102,15,56,220,232
+	movl	%r9d,112+12(%rsp)
+	cmpl	$11,%eax
+.byte	102,15,56,220,240
+.byte	102,15,56,220,248
+.byte	102,68,15,56,220,192
+.byte	102,68,15,56,220,200
+	movups	160-128(%rcx),%xmm0
+
+	jb	L$ctr32_enc_done
+
+.byte	102,15,56,220,209
+.byte	102,15,56,220,217
+.byte	102,15,56,220,225
+.byte	102,15,56,220,233
+.byte	102,15,56,220,241
+.byte	102,15,56,220,249
+.byte	102,68,15,56,220,193
+.byte	102,68,15,56,220,201
+	movups	176-128(%rcx),%xmm1
+
+.byte	102,15,56,220,208
+.byte	102,15,56,220,216
+.byte	102,15,56,220,224
+.byte	102,15,56,220,232
+.byte	102,15,56,220,240
+.byte	102,15,56,220,248
+.byte	102,68,15,56,220,192
+.byte	102,68,15,56,220,200
+	movups	192-128(%rcx),%xmm0
+	je	L$ctr32_enc_done
+
+.byte	102,15,56,220,209
+.byte	102,15,56,220,217
+.byte	102,15,56,220,225
+.byte	102,15,56,220,233
+.byte	102,15,56,220,241
+.byte	102,15,56,220,249
+.byte	102,68,15,56,220,193
+.byte	102,68,15,56,220,201
+	movups	208-128(%rcx),%xmm1
+
+.byte	102,15,56,220,208
+.byte	102,15,56,220,216
+.byte	102,15,56,220,224
+.byte	102,15,56,220,232
+.byte	102,15,56,220,240
+.byte	102,15,56,220,248
+.byte	102,68,15,56,220,192
+.byte	102,68,15,56,220,200
+	movups	224-128(%rcx),%xmm0
+	jmp	L$ctr32_enc_done
+
+.p2align	4
+L$ctr32_enc_done:
+	movdqu	16(%rdi),%xmm11
+	pxor	%xmm0,%xmm10
+	movdqu	32(%rdi),%xmm12
+	pxor	%xmm0,%xmm11
+	movdqu	48(%rdi),%xmm13
+	pxor	%xmm0,%xmm12
+	movdqu	64(%rdi),%xmm14
+	pxor	%xmm0,%xmm13
+	movdqu	80(%rdi),%xmm15
+	pxor	%xmm0,%xmm14
+	pxor	%xmm0,%xmm15
+.byte	102,15,56,220,209
+.byte	102,15,56,220,217
+.byte	102,15,56,220,225
+.byte	102,15,56,220,233
+.byte	102,15,56,220,241
+.byte	102,15,56,220,249
+.byte	102,68,15,56,220,193
+.byte	102,68,15,56,220,201
+	movdqu	96(%rdi),%xmm1
+	leaq	128(%rdi),%rdi
+
+.byte	102,65,15,56,221,210
+	pxor	%xmm0,%xmm1
+	movdqu	112-128(%rdi),%xmm10
+.byte	102,65,15,56,221,219
+	pxor	%xmm0,%xmm10
+	movdqa	0(%rsp),%xmm11
+.byte	102,65,15,56,221,228
+.byte	102,65,15,56,221,237
+	movdqa	16(%rsp),%xmm12
+	movdqa	32(%rsp),%xmm13
+.byte	102,65,15,56,221,246
+.byte	102,65,15,56,221,255
+	movdqa	48(%rsp),%xmm14
+	movdqa	64(%rsp),%xmm15
+.byte	102,68,15,56,221,193
+	movdqa	80(%rsp),%xmm0
+	movups	16-128(%rcx),%xmm1
+.byte	102,69,15,56,221,202
+
+	movups	%xmm2,(%rsi)
+	movdqa	%xmm11,%xmm2
+	movups	%xmm3,16(%rsi)
+	movdqa	%xmm12,%xmm3
+	movups	%xmm4,32(%rsi)
+	movdqa	%xmm13,%xmm4
+	movups	%xmm5,48(%rsi)
+	movdqa	%xmm14,%xmm5
+	movups	%xmm6,64(%rsi)
+	movdqa	%xmm15,%xmm6
+	movups	%xmm7,80(%rsi)
+	movdqa	%xmm0,%xmm7
+	movups	%xmm8,96(%rsi)
+	movups	%xmm9,112(%rsi)
+	leaq	128(%rsi),%rsi
+
+	subq	$8,%rdx
+	jnc	L$ctr32_loop8
+
+	addq	$8,%rdx
+	jz	L$ctr32_done
+	leaq	-128(%rcx),%rcx
+
+L$ctr32_tail:
+
+
+	leaq	16(%rcx),%rcx
+	cmpq	$4,%rdx
+	jb	L$ctr32_loop3
+	je	L$ctr32_loop4
+
+
+	shll	$4,%eax
+	movdqa	96(%rsp),%xmm8
+	pxor	%xmm9,%xmm9
+
+	movups	16(%rcx),%xmm0
+.byte	102,15,56,220,209
+.byte	102,15,56,220,217
+	leaq	32-16(%rcx,%rax,1),%rcx
+	negq	%rax
+.byte	102,15,56,220,225
+	addq	$16,%rax
+	movups	(%rdi),%xmm10
+.byte	102,15,56,220,233
+.byte	102,15,56,220,241
+	movups	16(%rdi),%xmm11
+	movups	32(%rdi),%xmm12
+.byte	102,15,56,220,249
+.byte	102,68,15,56,220,193
+
+	call	L$enc_loop8_enter
+
+	movdqu	48(%rdi),%xmm13
+	pxor	%xmm10,%xmm2
+	movdqu	64(%rdi),%xmm10
+	pxor	%xmm11,%xmm3
+	movdqu	%xmm2,(%rsi)
+	pxor	%xmm12,%xmm4
+	movdqu	%xmm3,16(%rsi)
+	pxor	%xmm13,%xmm5
+	movdqu	%xmm4,32(%rsi)
+	pxor	%xmm10,%xmm6
+	movdqu	%xmm5,48(%rsi)
+	movdqu	%xmm6,64(%rsi)
+	cmpq	$6,%rdx
+	jb	L$ctr32_done
+
+	movups	80(%rdi),%xmm11
+	xorps	%xmm11,%xmm7
+	movups	%xmm7,80(%rsi)
+	je	L$ctr32_done
+
+	movups	96(%rdi),%xmm12
+	xorps	%xmm12,%xmm8
+	movups	%xmm8,96(%rsi)
+	jmp	L$ctr32_done
+
+.p2align	5
+L$ctr32_loop4:
+.byte	102,15,56,220,209
+	leaq	16(%rcx),%rcx
+	decl	%eax
+.byte	102,15,56,220,217
+.byte	102,15,56,220,225
+.byte	102,15,56,220,233
+	movups	(%rcx),%xmm1
+	jnz	L$ctr32_loop4
+.byte	102,15,56,221,209
+.byte	102,15,56,221,217
+	movups	(%rdi),%xmm10
+	movups	16(%rdi),%xmm11
+.byte	102,15,56,221,225
+.byte	102,15,56,221,233
+	movups	32(%rdi),%xmm12
+	movups	48(%rdi),%xmm13
+
+	xorps	%xmm10,%xmm2
+	movups	%xmm2,(%rsi)
+	xorps	%xmm11,%xmm3
+	movups	%xmm3,16(%rsi)
+	pxor	%xmm12,%xmm4
+	movdqu	%xmm4,32(%rsi)
+	pxor	%xmm13,%xmm5
+	movdqu	%xmm5,48(%rsi)
+	jmp	L$ctr32_done
+
+.p2align	5
+L$ctr32_loop3:
+.byte	102,15,56,220,209
+	leaq	16(%rcx),%rcx
+	decl	%eax
+.byte	102,15,56,220,217
+.byte	102,15,56,220,225
+	movups	(%rcx),%xmm1
+	jnz	L$ctr32_loop3
+.byte	102,15,56,221,209
+.byte	102,15,56,221,217
+.byte	102,15,56,221,225
+
+	movups	(%rdi),%xmm10
+	xorps	%xmm10,%xmm2
+	movups	%xmm2,(%rsi)
+	cmpq	$2,%rdx
+	jb	L$ctr32_done
+
+	movups	16(%rdi),%xmm11
+	xorps	%xmm11,%xmm3
+	movups	%xmm3,16(%rsi)
+	je	L$ctr32_done
+
+	movups	32(%rdi),%xmm12
+	xorps	%xmm12,%xmm4
+	movups	%xmm4,32(%rsi)
+
+L$ctr32_done:
+	xorps	%xmm0,%xmm0
+	xorl	%r11d,%r11d
+	pxor	%xmm1,%xmm1
+	pxor	%xmm2,%xmm2
+	pxor	%xmm3,%xmm3
+	pxor	%xmm4,%xmm4
+	pxor	%xmm5,%xmm5
+	pxor	%xmm6,%xmm6
+	pxor	%xmm7,%xmm7
+	movaps	%xmm0,0(%rsp)
+	pxor	%xmm8,%xmm8
+	movaps	%xmm0,16(%rsp)
+	pxor	%xmm9,%xmm9
+	movaps	%xmm0,32(%rsp)
+	pxor	%xmm10,%xmm10
+	movaps	%xmm0,48(%rsp)
+	pxor	%xmm11,%xmm11
+	movaps	%xmm0,64(%rsp)
+	pxor	%xmm12,%xmm12
+	movaps	%xmm0,80(%rsp)
+	pxor	%xmm13,%xmm13
+	movaps	%xmm0,96(%rsp)
+	pxor	%xmm14,%xmm14
+	movaps	%xmm0,112(%rsp)
+	pxor	%xmm15,%xmm15
+	leaq	(%rbp),%rsp
+	popq	%rbp
+L$ctr32_epilogue:
+	.byte	0xf3,0xc3
+
+.globl	_aesni_xts_encrypt
+.private_extern _aesni_xts_encrypt
+
+.p2align	4
+_aesni_xts_encrypt:
+	leaq	(%rsp),%rax
+	pushq	%rbp
+	subq	$112,%rsp
+	andq	$-16,%rsp
+	leaq	-8(%rax),%rbp
+	movups	(%r9),%xmm2
+	movl	240(%r8),%eax
+	movl	240(%rcx),%r10d
+	movups	(%r8),%xmm0
+	movups	16(%r8),%xmm1
+	leaq	32(%r8),%r8
+	xorps	%xmm0,%xmm2
+L$oop_enc1_8:
+.byte	102,15,56,220,209
+	decl	%eax
+	movups	(%r8),%xmm1
+	leaq	16(%r8),%r8
+	jnz	L$oop_enc1_8
+.byte	102,15,56,221,209
+	movups	(%rcx),%xmm0
+	movq	%rcx,%r11
+	movl	%r10d,%eax
+	shll	$4,%r10d
+	movq	%rdx,%r9
+	andq	$-16,%rdx
+
+	movups	16(%rcx,%r10,1),%xmm1
+
+	movdqa	L$xts_magic(%rip),%xmm8
+	movdqa	%xmm2,%xmm15
+	pshufd	$95,%xmm2,%xmm9
+	pxor	%xmm0,%xmm1
+	movdqa	%xmm9,%xmm14
+	paddd	%xmm9,%xmm9
+	movdqa	%xmm15,%xmm10
+	psrad	$31,%xmm14
+	paddq	%xmm15,%xmm15
+	pand	%xmm8,%xmm14
+	pxor	%xmm0,%xmm10
+	pxor	%xmm14,%xmm15
+	movdqa	%xmm9,%xmm14
+	paddd	%xmm9,%xmm9
+	movdqa	%xmm15,%xmm11
+	psrad	$31,%xmm14
+	paddq	%xmm15,%xmm15
+	pand	%xmm8,%xmm14
+	pxor	%xmm0,%xmm11
+	pxor	%xmm14,%xmm15
+	movdqa	%xmm9,%xmm14
+	paddd	%xmm9,%xmm9
+	movdqa	%xmm15,%xmm12
+	psrad	$31,%xmm14
+	paddq	%xmm15,%xmm15
+	pand	%xmm8,%xmm14
+	pxor	%xmm0,%xmm12
+	pxor	%xmm14,%xmm15
+	movdqa	%xmm9,%xmm14
+	paddd	%xmm9,%xmm9
+	movdqa	%xmm15,%xmm13
+	psrad	$31,%xmm14
+	paddq	%xmm15,%xmm15
+	pand	%xmm8,%xmm14
+	pxor	%xmm0,%xmm13
+	pxor	%xmm14,%xmm15
+	movdqa	%xmm15,%xmm14
+	psrad	$31,%xmm9
+	paddq	%xmm15,%xmm15
+	pand	%xmm8,%xmm9
+	pxor	%xmm0,%xmm14
+	pxor	%xmm9,%xmm15
+	movaps	%xmm1,96(%rsp)
+
+	subq	$96,%rdx
+	jc	L$xts_enc_short
+
+	movl	$16+96,%eax
+	leaq	32(%r11,%r10,1),%rcx
+	subq	%r10,%rax
+	movups	16(%r11),%xmm1
+	movq	%rax,%r10
+	leaq	L$xts_magic(%rip),%r8
+	jmp	L$xts_enc_grandloop
+
+.p2align	5
+L$xts_enc_grandloop:
+	movdqu	0(%rdi),%xmm2
+	movdqa	%xmm0,%xmm8
+	movdqu	16(%rdi),%xmm3
+	pxor	%xmm10,%xmm2
+	movdqu	32(%rdi),%xmm4
+	pxor	%xmm11,%xmm3
+.byte	102,15,56,220,209
+	movdqu	48(%rdi),%xmm5
+	pxor	%xmm12,%xmm4
+.byte	102,15,56,220,217
+	movdqu	64(%rdi),%xmm6
+	pxor	%xmm13,%xmm5
+.byte	102,15,56,220,225
+	movdqu	80(%rdi),%xmm7
+	pxor	%xmm15,%xmm8
+	movdqa	96(%rsp),%xmm9
+	pxor	%xmm14,%xmm6
+.byte	102,15,56,220,233
+	movups	32(%r11),%xmm0
+	leaq	96(%rdi),%rdi
+	pxor	%xmm8,%xmm7
+
+	pxor	%xmm9,%xmm10
+.byte	102,15,56,220,241
+	pxor	%xmm9,%xmm11
+	movdqa	%xmm10,0(%rsp)
+.byte	102,15,56,220,249
+	movups	48(%r11),%xmm1
+	pxor	%xmm9,%xmm12
+
+.byte	102,15,56,220,208
+	pxor	%xmm9,%xmm13
+	movdqa	%xmm11,16(%rsp)
+.byte	102,15,56,220,216
+	pxor	%xmm9,%xmm14
+	movdqa	%xmm12,32(%rsp)
+.byte	102,15,56,220,224
+.byte	102,15,56,220,232
+	pxor	%xmm9,%xmm8
+	movdqa	%xmm14,64(%rsp)
+.byte	102,15,56,220,240
+.byte	102,15,56,220,248
+	movups	64(%r11),%xmm0
+	movdqa	%xmm8,80(%rsp)
+	pshufd	$95,%xmm15,%xmm9
+	jmp	L$xts_enc_loop6
+.p2align	5
+L$xts_enc_loop6:
+.byte	102,15,56,220,209
+.byte	102,15,56,220,217
+.byte	102,15,56,220,225
+.byte	102,15,56,220,233
+.byte	102,15,56,220,241
+.byte	102,15,56,220,249
+	movups	-64(%rcx,%rax,1),%xmm1
+	addq	$32,%rax
+
+.byte	102,15,56,220,208
+.byte	102,15,56,220,216
+.byte	102,15,56,220,224
+.byte	102,15,56,220,232
+.byte	102,15,56,220,240
+.byte	102,15,56,220,248
+	movups	-80(%rcx,%rax,1),%xmm0
+	jnz	L$xts_enc_loop6
+
+	movdqa	(%r8),%xmm8
+	movdqa	%xmm9,%xmm14
+	paddd	%xmm9,%xmm9
+.byte	102,15,56,220,209
+	paddq	%xmm15,%xmm15
+	psrad	$31,%xmm14
+.byte	102,15,56,220,217
+	pand	%xmm8,%xmm14
+	movups	(%r11),%xmm10
+.byte	102,15,56,220,225
+.byte	102,15,56,220,233
+.byte	102,15,56,220,241
+	pxor	%xmm14,%xmm15
+	movaps	%xmm10,%xmm11
+.byte	102,15,56,220,249
+	movups	-64(%rcx),%xmm1
+
+	movdqa	%xmm9,%xmm14
+.byte	102,15,56,220,208
+	paddd	%xmm9,%xmm9
+	pxor	%xmm15,%xmm10
+.byte	102,15,56,220,216
+	psrad	$31,%xmm14
+	paddq	%xmm15,%xmm15
+.byte	102,15,56,220,224
+.byte	102,15,56,220,232
+	pand	%xmm8,%xmm14
+	movaps	%xmm11,%xmm12
+.byte	102,15,56,220,240
+	pxor	%xmm14,%xmm15
+	movdqa	%xmm9,%xmm14
+.byte	102,15,56,220,248
+	movups	-48(%rcx),%xmm0
+
+	paddd	%xmm9,%xmm9
+.byte	102,15,56,220,209
+	pxor	%xmm15,%xmm11
+	psrad	$31,%xmm14
+.byte	102,15,56,220,217
+	paddq	%xmm15,%xmm15
+	pand	%xmm8,%xmm14
+.byte	102,15,56,220,225
+.byte	102,15,56,220,233
+	movdqa	%xmm13,48(%rsp)
+	pxor	%xmm14,%xmm15
+.byte	102,15,56,220,241
+	movaps	%xmm12,%xmm13
+	movdqa	%xmm9,%xmm14
+.byte	102,15,56,220,249
+	movups	-32(%rcx),%xmm1
+
+	paddd	%xmm9,%xmm9
+.byte	102,15,56,220,208
+	pxor	%xmm15,%xmm12
+	psrad	$31,%xmm14
+.byte	102,15,56,220,216
+	paddq	%xmm15,%xmm15
+	pand	%xmm8,%xmm14
+.byte	102,15,56,220,224
+.byte	102,15,56,220,232
+.byte	102,15,56,220,240
+	pxor	%xmm14,%xmm15
+	movaps	%xmm13,%xmm14
+.byte	102,15,56,220,248
+
+	movdqa	%xmm9,%xmm0
+	paddd	%xmm9,%xmm9
+.byte	102,15,56,220,209
+	pxor	%xmm15,%xmm13
+	psrad	$31,%xmm0
+.byte	102,15,56,220,217
+	paddq	%xmm15,%xmm15
+	pand	%xmm8,%xmm0
+.byte	102,15,56,220,225
+.byte	102,15,56,220,233
+	pxor	%xmm0,%xmm15
+	movups	(%r11),%xmm0
+.byte	102,15,56,220,241
+.byte	102,15,56,220,249
+	movups	16(%r11),%xmm1
+
+	pxor	%xmm15,%xmm14
+.byte	102,15,56,221,84,36,0
+	psrad	$31,%xmm9
+	paddq	%xmm15,%xmm15
+.byte	102,15,56,221,92,36,16
+.byte	102,15,56,221,100,36,32
+	pand	%xmm8,%xmm9
+	movq	%r10,%rax
+.byte	102,15,56,221,108,36,48
+.byte	102,15,56,221,116,36,64
+.byte	102,15,56,221,124,36,80
+	pxor	%xmm9,%xmm15
+
+	leaq	96(%rsi),%rsi
+	movups	%xmm2,-96(%rsi)
+	movups	%xmm3,-80(%rsi)
+	movups	%xmm4,-64(%rsi)
+	movups	%xmm5,-48(%rsi)
+	movups	%xmm6,-32(%rsi)
+	movups	%xmm7,-16(%rsi)
+	subq	$96,%rdx
+	jnc	L$xts_enc_grandloop
+
+	movl	$16+96,%eax
+	subl	%r10d,%eax
+	movq	%r11,%rcx
+	shrl	$4,%eax
+
+L$xts_enc_short:
+
+	movl	%eax,%r10d
+	pxor	%xmm0,%xmm10
+	addq	$96,%rdx
+	jz	L$xts_enc_done
+
+	pxor	%xmm0,%xmm11
+	cmpq	$32,%rdx
+	jb	L$xts_enc_one
+	pxor	%xmm0,%xmm12
+	je	L$xts_enc_two
+
+	pxor	%xmm0,%xmm13
+	cmpq	$64,%rdx
+	jb	L$xts_enc_three
+	pxor	%xmm0,%xmm14
+	je	L$xts_enc_four
+
+	movdqu	(%rdi),%xmm2
+	movdqu	16(%rdi),%xmm3
+	movdqu	32(%rdi),%xmm4
+	pxor	%xmm10,%xmm2
+	movdqu	48(%rdi),%xmm5
+	pxor	%xmm11,%xmm3
+	movdqu	64(%rdi),%xmm6
+	leaq	80(%rdi),%rdi
+	pxor	%xmm12,%xmm4
+	pxor	%xmm13,%xmm5
+	pxor	%xmm14,%xmm6
+	pxor	%xmm7,%xmm7
+
+	call	_aesni_encrypt6
+
+	xorps	%xmm10,%xmm2
+	movdqa	%xmm15,%xmm10
+	xorps	%xmm11,%xmm3
+	xorps	%xmm12,%xmm4
+	movdqu	%xmm2,(%rsi)
+	xorps	%xmm13,%xmm5
+	movdqu	%xmm3,16(%rsi)
+	xorps	%xmm14,%xmm6
+	movdqu	%xmm4,32(%rsi)
+	movdqu	%xmm5,48(%rsi)
+	movdqu	%xmm6,64(%rsi)
+	leaq	80(%rsi),%rsi
+	jmp	L$xts_enc_done
+
+.p2align	4
+L$xts_enc_one:
+	movups	(%rdi),%xmm2
+	leaq	16(%rdi),%rdi
+	xorps	%xmm10,%xmm2
+	movups	(%rcx),%xmm0
+	movups	16(%rcx),%xmm1
+	leaq	32(%rcx),%rcx
+	xorps	%xmm0,%xmm2
+L$oop_enc1_9:
+.byte	102,15,56,220,209
+	decl	%eax
+	movups	(%rcx),%xmm1
+	leaq	16(%rcx),%rcx
+	jnz	L$oop_enc1_9
+.byte	102,15,56,221,209
+	xorps	%xmm10,%xmm2
+	movdqa	%xmm11,%xmm10
+	movups	%xmm2,(%rsi)
+	leaq	16(%rsi),%rsi
+	jmp	L$xts_enc_done
+
+.p2align	4
+L$xts_enc_two:
+	movups	(%rdi),%xmm2
+	movups	16(%rdi),%xmm3
+	leaq	32(%rdi),%rdi
+	xorps	%xmm10,%xmm2
+	xorps	%xmm11,%xmm3
+
+	call	_aesni_encrypt2
+
+	xorps	%xmm10,%xmm2
+	movdqa	%xmm12,%xmm10
+	xorps	%xmm11,%xmm3
+	movups	%xmm2,(%rsi)
+	movups	%xmm3,16(%rsi)
+	leaq	32(%rsi),%rsi
+	jmp	L$xts_enc_done
+
+.p2align	4
+L$xts_enc_three:
+	movups	(%rdi),%xmm2
+	movups	16(%rdi),%xmm3
+	movups	32(%rdi),%xmm4
+	leaq	48(%rdi),%rdi
+	xorps	%xmm10,%xmm2
+	xorps	%xmm11,%xmm3
+	xorps	%xmm12,%xmm4
+
+	call	_aesni_encrypt3
+
+	xorps	%xmm10,%xmm2
+	movdqa	%xmm13,%xmm10
+	xorps	%xmm11,%xmm3
+	xorps	%xmm12,%xmm4
+	movups	%xmm2,(%rsi)
+	movups	%xmm3,16(%rsi)
+	movups	%xmm4,32(%rsi)
+	leaq	48(%rsi),%rsi
+	jmp	L$xts_enc_done
+
+.p2align	4
+L$xts_enc_four:
+	movups	(%rdi),%xmm2
+	movups	16(%rdi),%xmm3
+	movups	32(%rdi),%xmm4
+	xorps	%xmm10,%xmm2
+	movups	48(%rdi),%xmm5
+	leaq	64(%rdi),%rdi
+	xorps	%xmm11,%xmm3
+	xorps	%xmm12,%xmm4
+	xorps	%xmm13,%xmm5
+
+	call	_aesni_encrypt4
+
+	pxor	%xmm10,%xmm2
+	movdqa	%xmm14,%xmm10
+	pxor	%xmm11,%xmm3
+	pxor	%xmm12,%xmm4
+	movdqu	%xmm2,(%rsi)
+	pxor	%xmm13,%xmm5
+	movdqu	%xmm3,16(%rsi)
+	movdqu	%xmm4,32(%rsi)
+	movdqu	%xmm5,48(%rsi)
+	leaq	64(%rsi),%rsi
+	jmp	L$xts_enc_done
+
+.p2align	4
+L$xts_enc_done:
+	andq	$15,%r9
+	jz	L$xts_enc_ret
+	movq	%r9,%rdx
+
+L$xts_enc_steal:
+	movzbl	(%rdi),%eax
+	movzbl	-16(%rsi),%ecx
+	leaq	1(%rdi),%rdi
+	movb	%al,-16(%rsi)
+	movb	%cl,0(%rsi)
+	leaq	1(%rsi),%rsi
+	subq	$1,%rdx
+	jnz	L$xts_enc_steal
+
+	subq	%r9,%rsi
+	movq	%r11,%rcx
+	movl	%r10d,%eax
+
+	movups	-16(%rsi),%xmm2
+	xorps	%xmm10,%xmm2
+	movups	(%rcx),%xmm0
+	movups	16(%rcx),%xmm1
+	leaq	32(%rcx),%rcx
+	xorps	%xmm0,%xmm2
+L$oop_enc1_10:
+.byte	102,15,56,220,209
+	decl	%eax
+	movups	(%rcx),%xmm1
+	leaq	16(%rcx),%rcx
+	jnz	L$oop_enc1_10
+.byte	102,15,56,221,209
+	xorps	%xmm10,%xmm2
+	movups	%xmm2,-16(%rsi)
+
+L$xts_enc_ret:
+	xorps	%xmm0,%xmm0
+	pxor	%xmm1,%xmm1
+	pxor	%xmm2,%xmm2
+	pxor	%xmm3,%xmm3
+	pxor	%xmm4,%xmm4
+	pxor	%xmm5,%xmm5
+	pxor	%xmm6,%xmm6
+	pxor	%xmm7,%xmm7
+	movaps	%xmm0,0(%rsp)
+	pxor	%xmm8,%xmm8
+	movaps	%xmm0,16(%rsp)
+	pxor	%xmm9,%xmm9
+	movaps	%xmm0,32(%rsp)
+	pxor	%xmm10,%xmm10
+	movaps	%xmm0,48(%rsp)
+	pxor	%xmm11,%xmm11
+	movaps	%xmm0,64(%rsp)
+	pxor	%xmm12,%xmm12
+	movaps	%xmm0,80(%rsp)
+	pxor	%xmm13,%xmm13
+	movaps	%xmm0,96(%rsp)
+	pxor	%xmm14,%xmm14
+	pxor	%xmm15,%xmm15
+	leaq	(%rbp),%rsp
+	popq	%rbp
+L$xts_enc_epilogue:
+	.byte	0xf3,0xc3
+
+.globl	_aesni_xts_decrypt
+.private_extern _aesni_xts_decrypt
+
+.p2align	4
+_aesni_xts_decrypt:
+	leaq	(%rsp),%rax
+	pushq	%rbp
+	subq	$112,%rsp
+	andq	$-16,%rsp
+	leaq	-8(%rax),%rbp
+	movups	(%r9),%xmm2
+	movl	240(%r8),%eax
+	movl	240(%rcx),%r10d
+	movups	(%r8),%xmm0
+	movups	16(%r8),%xmm1
+	leaq	32(%r8),%r8
+	xorps	%xmm0,%xmm2
+L$oop_enc1_11:
+.byte	102,15,56,220,209
+	decl	%eax
+	movups	(%r8),%xmm1
+	leaq	16(%r8),%r8
+	jnz	L$oop_enc1_11
+.byte	102,15,56,221,209
+	xorl	%eax,%eax
+	testq	$15,%rdx
+	setnz	%al
+	shlq	$4,%rax
+	subq	%rax,%rdx
+
+	movups	(%rcx),%xmm0
+	movq	%rcx,%r11
+	movl	%r10d,%eax
+	shll	$4,%r10d
+	movq	%rdx,%r9
+	andq	$-16,%rdx
+
+	movups	16(%rcx,%r10,1),%xmm1
+
+	movdqa	L$xts_magic(%rip),%xmm8
+	movdqa	%xmm2,%xmm15
+	pshufd	$95,%xmm2,%xmm9
+	pxor	%xmm0,%xmm1
+	movdqa	%xmm9,%xmm14
+	paddd	%xmm9,%xmm9
+	movdqa	%xmm15,%xmm10
+	psrad	$31,%xmm14
+	paddq	%xmm15,%xmm15
+	pand	%xmm8,%xmm14
+	pxor	%xmm0,%xmm10
+	pxor	%xmm14,%xmm15
+	movdqa	%xmm9,%xmm14
+	paddd	%xmm9,%xmm9
+	movdqa	%xmm15,%xmm11
+	psrad	$31,%xmm14
+	paddq	%xmm15,%xmm15
+	pand	%xmm8,%xmm14
+	pxor	%xmm0,%xmm11
+	pxor	%xmm14,%xmm15
+	movdqa	%xmm9,%xmm14
+	paddd	%xmm9,%xmm9
+	movdqa	%xmm15,%xmm12
+	psrad	$31,%xmm14
+	paddq	%xmm15,%xmm15
+	pand	%xmm8,%xmm14
+	pxor	%xmm0,%xmm12
+	pxor	%xmm14,%xmm15
+	movdqa	%xmm9,%xmm14
+	paddd	%xmm9,%xmm9
+	movdqa	%xmm15,%xmm13
+	psrad	$31,%xmm14
+	paddq	%xmm15,%xmm15
+	pand	%xmm8,%xmm14
+	pxor	%xmm0,%xmm13
+	pxor	%xmm14,%xmm15
+	movdqa	%xmm15,%xmm14
+	psrad	$31,%xmm9
+	paddq	%xmm15,%xmm15
+	pand	%xmm8,%xmm9
+	pxor	%xmm0,%xmm14
+	pxor	%xmm9,%xmm15
+	movaps	%xmm1,96(%rsp)
+
+	subq	$96,%rdx
+	jc	L$xts_dec_short
+
+	movl	$16+96,%eax
+	leaq	32(%r11,%r10,1),%rcx
+	subq	%r10,%rax
+	movups	16(%r11),%xmm1
+	movq	%rax,%r10
+	leaq	L$xts_magic(%rip),%r8
+	jmp	L$xts_dec_grandloop
+
+.p2align	5
+L$xts_dec_grandloop:
+	movdqu	0(%rdi),%xmm2
+	movdqa	%xmm0,%xmm8
+	movdqu	16(%rdi),%xmm3
+	pxor	%xmm10,%xmm2
+	movdqu	32(%rdi),%xmm4
+	pxor	%xmm11,%xmm3
+.byte	102,15,56,222,209
+	movdqu	48(%rdi),%xmm5
+	pxor	%xmm12,%xmm4
+.byte	102,15,56,222,217
+	movdqu	64(%rdi),%xmm6
+	pxor	%xmm13,%xmm5
+.byte	102,15,56,222,225
+	movdqu	80(%rdi),%xmm7
+	pxor	%xmm15,%xmm8
+	movdqa	96(%rsp),%xmm9
+	pxor	%xmm14,%xmm6
+.byte	102,15,56,222,233
+	movups	32(%r11),%xmm0
+	leaq	96(%rdi),%rdi
+	pxor	%xmm8,%xmm7
+
+	pxor	%xmm9,%xmm10
+.byte	102,15,56,222,241
+	pxor	%xmm9,%xmm11
+	movdqa	%xmm10,0(%rsp)
+.byte	102,15,56,222,249
+	movups	48(%r11),%xmm1
+	pxor	%xmm9,%xmm12
+
+.byte	102,15,56,222,208
+	pxor	%xmm9,%xmm13
+	movdqa	%xmm11,16(%rsp)
+.byte	102,15,56,222,216
+	pxor	%xmm9,%xmm14
+	movdqa	%xmm12,32(%rsp)
+.byte	102,15,56,222,224
+.byte	102,15,56,222,232
+	pxor	%xmm9,%xmm8
+	movdqa	%xmm14,64(%rsp)
+.byte	102,15,56,222,240
+.byte	102,15,56,222,248
+	movups	64(%r11),%xmm0
+	movdqa	%xmm8,80(%rsp)
+	pshufd	$95,%xmm15,%xmm9
+	jmp	L$xts_dec_loop6
+.p2align	5
+L$xts_dec_loop6:
+.byte	102,15,56,222,209
+.byte	102,15,56,222,217
+.byte	102,15,56,222,225
+.byte	102,15,56,222,233
+.byte	102,15,56,222,241
+.byte	102,15,56,222,249
+	movups	-64(%rcx,%rax,1),%xmm1
+	addq	$32,%rax
+
+.byte	102,15,56,222,208
+.byte	102,15,56,222,216
+.byte	102,15,56,222,224
+.byte	102,15,56,222,232
+.byte	102,15,56,222,240
+.byte	102,15,56,222,248
+	movups	-80(%rcx,%rax,1),%xmm0
+	jnz	L$xts_dec_loop6
+
+	movdqa	(%r8),%xmm8
+	movdqa	%xmm9,%xmm14
+	paddd	%xmm9,%xmm9
+.byte	102,15,56,222,209
+	paddq	%xmm15,%xmm15
+	psrad	$31,%xmm14
+.byte	102,15,56,222,217
+	pand	%xmm8,%xmm14
+	movups	(%r11),%xmm10
+.byte	102,15,56,222,225
+.byte	102,15,56,222,233
+.byte	102,15,56,222,241
+	pxor	%xmm14,%xmm15
+	movaps	%xmm10,%xmm11
+.byte	102,15,56,222,249
+	movups	-64(%rcx),%xmm1
+
+	movdqa	%xmm9,%xmm14
+.byte	102,15,56,222,208
+	paddd	%xmm9,%xmm9
+	pxor	%xmm15,%xmm10
+.byte	102,15,56,222,216
+	psrad	$31,%xmm14
+	paddq	%xmm15,%xmm15
+.byte	102,15,56,222,224
+.byte	102,15,56,222,232
+	pand	%xmm8,%xmm14
+	movaps	%xmm11,%xmm12
+.byte	102,15,56,222,240
+	pxor	%xmm14,%xmm15
+	movdqa	%xmm9,%xmm14
+.byte	102,15,56,222,248
+	movups	-48(%rcx),%xmm0
+
+	paddd	%xmm9,%xmm9
+.byte	102,15,56,222,209
+	pxor	%xmm15,%xmm11
+	psrad	$31,%xmm14
+.byte	102,15,56,222,217
+	paddq	%xmm15,%xmm15
+	pand	%xmm8,%xmm14
+.byte	102,15,56,222,225
+.byte	102,15,56,222,233
+	movdqa	%xmm13,48(%rsp)
+	pxor	%xmm14,%xmm15
+.byte	102,15,56,222,241
+	movaps	%xmm12,%xmm13
+	movdqa	%xmm9,%xmm14
+.byte	102,15,56,222,249
+	movups	-32(%rcx),%xmm1
+
+	paddd	%xmm9,%xmm9
+.byte	102,15,56,222,208
+	pxor	%xmm15,%xmm12
+	psrad	$31,%xmm14
+.byte	102,15,56,222,216
+	paddq	%xmm15,%xmm15
+	pand	%xmm8,%xmm14
+.byte	102,15,56,222,224
+.byte	102,15,56,222,232
+.byte	102,15,56,222,240
+	pxor	%xmm14,%xmm15
+	movaps	%xmm13,%xmm14
+.byte	102,15,56,222,248
+
+	movdqa	%xmm9,%xmm0
+	paddd	%xmm9,%xmm9
+.byte	102,15,56,222,209
+	pxor	%xmm15,%xmm13
+	psrad	$31,%xmm0
+.byte	102,15,56,222,217
+	paddq	%xmm15,%xmm15
+	pand	%xmm8,%xmm0
+.byte	102,15,56,222,225
+.byte	102,15,56,222,233
+	pxor	%xmm0,%xmm15
+	movups	(%r11),%xmm0
+.byte	102,15,56,222,241
+.byte	102,15,56,222,249
+	movups	16(%r11),%xmm1
+
+	pxor	%xmm15,%xmm14
+.byte	102,15,56,223,84,36,0
+	psrad	$31,%xmm9
+	paddq	%xmm15,%xmm15
+.byte	102,15,56,223,92,36,16
+.byte	102,15,56,223,100,36,32
+	pand	%xmm8,%xmm9
+	movq	%r10,%rax
+.byte	102,15,56,223,108,36,48
+.byte	102,15,56,223,116,36,64
+.byte	102,15,56,223,124,36,80
+	pxor	%xmm9,%xmm15
+
+	leaq	96(%rsi),%rsi
+	movups	%xmm2,-96(%rsi)
+	movups	%xmm3,-80(%rsi)
+	movups	%xmm4,-64(%rsi)
+	movups	%xmm5,-48(%rsi)
+	movups	%xmm6,-32(%rsi)
+	movups	%xmm7,-16(%rsi)
+	subq	$96,%rdx
+	jnc	L$xts_dec_grandloop
+
+	movl	$16+96,%eax
+	subl	%r10d,%eax
+	movq	%r11,%rcx
+	shrl	$4,%eax
+
+L$xts_dec_short:
+
+	movl	%eax,%r10d
+	pxor	%xmm0,%xmm10
+	pxor	%xmm0,%xmm11
+	addq	$96,%rdx
+	jz	L$xts_dec_done
+
+	pxor	%xmm0,%xmm12
+	cmpq	$32,%rdx
+	jb	L$xts_dec_one
+	pxor	%xmm0,%xmm13
+	je	L$xts_dec_two
+
+	pxor	%xmm0,%xmm14
+	cmpq	$64,%rdx
+	jb	L$xts_dec_three
+	je	L$xts_dec_four
+
+	movdqu	(%rdi),%xmm2
+	movdqu	16(%rdi),%xmm3
+	movdqu	32(%rdi),%xmm4
+	pxor	%xmm10,%xmm2
+	movdqu	48(%rdi),%xmm5
+	pxor	%xmm11,%xmm3
+	movdqu	64(%rdi),%xmm6
+	leaq	80(%rdi),%rdi
+	pxor	%xmm12,%xmm4
+	pxor	%xmm13,%xmm5
+	pxor	%xmm14,%xmm6
+
+	call	_aesni_decrypt6
+
+	xorps	%xmm10,%xmm2
+	xorps	%xmm11,%xmm3
+	xorps	%xmm12,%xmm4
+	movdqu	%xmm2,(%rsi)
+	xorps	%xmm13,%xmm5
+	movdqu	%xmm3,16(%rsi)
+	xorps	%xmm14,%xmm6
+	movdqu	%xmm4,32(%rsi)
+	pxor	%xmm14,%xmm14
+	movdqu	%xmm5,48(%rsi)
+	pcmpgtd	%xmm15,%xmm14
+	movdqu	%xmm6,64(%rsi)
+	leaq	80(%rsi),%rsi
+	pshufd	$19,%xmm14,%xmm11
+	andq	$15,%r9
+	jz	L$xts_dec_ret
+
+	movdqa	%xmm15,%xmm10
+	paddq	%xmm15,%xmm15
+	pand	%xmm8,%xmm11
+	pxor	%xmm15,%xmm11
+	jmp	L$xts_dec_done2
+
+.p2align	4
+L$xts_dec_one:
+	movups	(%rdi),%xmm2
+	leaq	16(%rdi),%rdi
+	xorps	%xmm10,%xmm2
+	movups	(%rcx),%xmm0
+	movups	16(%rcx),%xmm1
+	leaq	32(%rcx),%rcx
+	xorps	%xmm0,%xmm2
+L$oop_dec1_12:
+.byte	102,15,56,222,209
+	decl	%eax
+	movups	(%rcx),%xmm1
+	leaq	16(%rcx),%rcx
+	jnz	L$oop_dec1_12
+.byte	102,15,56,223,209
+	xorps	%xmm10,%xmm2
+	movdqa	%xmm11,%xmm10
+	movups	%xmm2,(%rsi)
+	movdqa	%xmm12,%xmm11
+	leaq	16(%rsi),%rsi
+	jmp	L$xts_dec_done
+
+.p2align	4
+L$xts_dec_two:
+	movups	(%rdi),%xmm2
+	movups	16(%rdi),%xmm3
+	leaq	32(%rdi),%rdi
+	xorps	%xmm10,%xmm2
+	xorps	%xmm11,%xmm3
+
+	call	_aesni_decrypt2
+
+	xorps	%xmm10,%xmm2
+	movdqa	%xmm12,%xmm10
+	xorps	%xmm11,%xmm3
+	movdqa	%xmm13,%xmm11
+	movups	%xmm2,(%rsi)
+	movups	%xmm3,16(%rsi)
+	leaq	32(%rsi),%rsi
+	jmp	L$xts_dec_done
+
+.p2align	4
+L$xts_dec_three:
+	movups	(%rdi),%xmm2
+	movups	16(%rdi),%xmm3
+	movups	32(%rdi),%xmm4
+	leaq	48(%rdi),%rdi
+	xorps	%xmm10,%xmm2
+	xorps	%xmm11,%xmm3
+	xorps	%xmm12,%xmm4
+
+	call	_aesni_decrypt3
+
+	xorps	%xmm10,%xmm2
+	movdqa	%xmm13,%xmm10
+	xorps	%xmm11,%xmm3
+	movdqa	%xmm14,%xmm11
+	xorps	%xmm12,%xmm4
+	movups	%xmm2,(%rsi)
+	movups	%xmm3,16(%rsi)
+	movups	%xmm4,32(%rsi)
+	leaq	48(%rsi),%rsi
+	jmp	L$xts_dec_done
+
+.p2align	4
+L$xts_dec_four:
+	movups	(%rdi),%xmm2
+	movups	16(%rdi),%xmm3
+	movups	32(%rdi),%xmm4
+	xorps	%xmm10,%xmm2
+	movups	48(%rdi),%xmm5
+	leaq	64(%rdi),%rdi
+	xorps	%xmm11,%xmm3
+	xorps	%xmm12,%xmm4
+	xorps	%xmm13,%xmm5
+
+	call	_aesni_decrypt4
+
+	pxor	%xmm10,%xmm2
+	movdqa	%xmm14,%xmm10
+	pxor	%xmm11,%xmm3
+	movdqa	%xmm15,%xmm11
+	pxor	%xmm12,%xmm4
+	movdqu	%xmm2,(%rsi)
+	pxor	%xmm13,%xmm5
+	movdqu	%xmm3,16(%rsi)
+	movdqu	%xmm4,32(%rsi)
+	movdqu	%xmm5,48(%rsi)
+	leaq	64(%rsi),%rsi
+	jmp	L$xts_dec_done
+
+.p2align	4
+L$xts_dec_done:
+	andq	$15,%r9
+	jz	L$xts_dec_ret
+L$xts_dec_done2:
+	movq	%r9,%rdx
+	movq	%r11,%rcx
+	movl	%r10d,%eax
+
+	movups	(%rdi),%xmm2
+	xorps	%xmm11,%xmm2
+	movups	(%rcx),%xmm0
+	movups	16(%rcx),%xmm1
+	leaq	32(%rcx),%rcx
+	xorps	%xmm0,%xmm2
+L$oop_dec1_13:
+.byte	102,15,56,222,209
+	decl	%eax
+	movups	(%rcx),%xmm1
+	leaq	16(%rcx),%rcx
+	jnz	L$oop_dec1_13
+.byte	102,15,56,223,209
+	xorps	%xmm11,%xmm2
+	movups	%xmm2,(%rsi)
+
+L$xts_dec_steal:
+	movzbl	16(%rdi),%eax
+	movzbl	(%rsi),%ecx
+	leaq	1(%rdi),%rdi
+	movb	%al,(%rsi)
+	movb	%cl,16(%rsi)
+	leaq	1(%rsi),%rsi
+	subq	$1,%rdx
+	jnz	L$xts_dec_steal
+
+	subq	%r9,%rsi
+	movq	%r11,%rcx
+	movl	%r10d,%eax
+
+	movups	(%rsi),%xmm2
+	xorps	%xmm10,%xmm2
+	movups	(%rcx),%xmm0
+	movups	16(%rcx),%xmm1
+	leaq	32(%rcx),%rcx
+	xorps	%xmm0,%xmm2
+L$oop_dec1_14:
+.byte	102,15,56,222,209
+	decl	%eax
+	movups	(%rcx),%xmm1
+	leaq	16(%rcx),%rcx
+	jnz	L$oop_dec1_14
+.byte	102,15,56,223,209
+	xorps	%xmm10,%xmm2
+	movups	%xmm2,(%rsi)
+
+L$xts_dec_ret:
+	xorps	%xmm0,%xmm0
+	pxor	%xmm1,%xmm1
+	pxor	%xmm2,%xmm2
+	pxor	%xmm3,%xmm3
+	pxor	%xmm4,%xmm4
+	pxor	%xmm5,%xmm5
+	pxor	%xmm6,%xmm6
+	pxor	%xmm7,%xmm7
+	movaps	%xmm0,0(%rsp)
+	pxor	%xmm8,%xmm8
+	movaps	%xmm0,16(%rsp)
+	pxor	%xmm9,%xmm9
+	movaps	%xmm0,32(%rsp)
+	pxor	%xmm10,%xmm10
+	movaps	%xmm0,48(%rsp)
+	pxor	%xmm11,%xmm11
+	movaps	%xmm0,64(%rsp)
+	pxor	%xmm12,%xmm12
+	movaps	%xmm0,80(%rsp)
+	pxor	%xmm13,%xmm13
+	movaps	%xmm0,96(%rsp)
+	pxor	%xmm14,%xmm14
+	pxor	%xmm15,%xmm15
+	leaq	(%rbp),%rsp
+	popq	%rbp
+L$xts_dec_epilogue:
+	.byte	0xf3,0xc3
+
+.globl	_aesni_cbc_encrypt
+.private_extern _aesni_cbc_encrypt
+
+.p2align	4
+_aesni_cbc_encrypt:
+	testq	%rdx,%rdx
+	jz	L$cbc_ret
+
+	movl	240(%rcx),%r10d
+	movq	%rcx,%r11
+	testl	%r9d,%r9d
+	jz	L$cbc_decrypt
+
+	movups	(%r8),%xmm2
+	movl	%r10d,%eax
+	cmpq	$16,%rdx
+	jb	L$cbc_enc_tail
+	subq	$16,%rdx
+	jmp	L$cbc_enc_loop
+.p2align	4
+L$cbc_enc_loop:
+	movups	(%rdi),%xmm3
+	leaq	16(%rdi),%rdi
+
+	movups	(%rcx),%xmm0
+	movups	16(%rcx),%xmm1
+	xorps	%xmm0,%xmm3
+	leaq	32(%rcx),%rcx
+	xorps	%xmm3,%xmm2
+L$oop_enc1_15:
+.byte	102,15,56,220,209
+	decl	%eax
+	movups	(%rcx),%xmm1
+	leaq	16(%rcx),%rcx
+	jnz	L$oop_enc1_15
+.byte	102,15,56,221,209
+	movl	%r10d,%eax
+	movq	%r11,%rcx
+	movups	%xmm2,0(%rsi)
+	leaq	16(%rsi),%rsi
+	subq	$16,%rdx
+	jnc	L$cbc_enc_loop
+	addq	$16,%rdx
+	jnz	L$cbc_enc_tail
+	pxor	%xmm0,%xmm0
+	pxor	%xmm1,%xmm1
+	movups	%xmm2,(%r8)
+	pxor	%xmm2,%xmm2
+	pxor	%xmm3,%xmm3
+	jmp	L$cbc_ret
+
+L$cbc_enc_tail:
+	movq	%rdx,%rcx
+	xchgq	%rdi,%rsi
+.long	0x9066A4F3
+	movl	$16,%ecx
+	subq	%rdx,%rcx
+	xorl	%eax,%eax
+.long	0x9066AAF3
+	leaq	-16(%rdi),%rdi
+	movl	%r10d,%eax
+	movq	%rdi,%rsi
+	movq	%r11,%rcx
+	xorq	%rdx,%rdx
+	jmp	L$cbc_enc_loop
+
+.p2align	4
+L$cbc_decrypt:
+	cmpq	$16,%rdx
+	jne	L$cbc_decrypt_bulk
+
+
+
+	movdqu	(%rdi),%xmm2
+	movdqu	(%r8),%xmm3
+	movdqa	%xmm2,%xmm4
+	movups	(%rcx),%xmm0
+	movups	16(%rcx),%xmm1
+	leaq	32(%rcx),%rcx
+	xorps	%xmm0,%xmm2
+L$oop_dec1_16:
+.byte	102,15,56,222,209
+	decl	%r10d
+	movups	(%rcx),%xmm1
+	leaq	16(%rcx),%rcx
+	jnz	L$oop_dec1_16
+.byte	102,15,56,223,209
+	pxor	%xmm0,%xmm0
+	pxor	%xmm1,%xmm1
+	movdqu	%xmm4,(%r8)
+	xorps	%xmm3,%xmm2
+	pxor	%xmm3,%xmm3
+	movups	%xmm2,(%rsi)
+	pxor	%xmm2,%xmm2
+	jmp	L$cbc_ret
+.p2align	4
+L$cbc_decrypt_bulk:
+	leaq	(%rsp),%rax
+	pushq	%rbp
+	subq	$16,%rsp
+	andq	$-16,%rsp
+	leaq	-8(%rax),%rbp
+	movups	(%r8),%xmm10
+	movl	%r10d,%eax
+	cmpq	$80,%rdx
+	jbe	L$cbc_dec_tail
+
+	movups	(%rcx),%xmm0
+	movdqu	0(%rdi),%xmm2
+	movdqu	16(%rdi),%xmm3
+	movdqa	%xmm2,%xmm11
+	movdqu	32(%rdi),%xmm4
+	movdqa	%xmm3,%xmm12
+	movdqu	48(%rdi),%xmm5
+	movdqa	%xmm4,%xmm13
+	movdqu	64(%rdi),%xmm6
+	movdqa	%xmm5,%xmm14
+	movdqu	80(%rdi),%xmm7
+	movdqa	%xmm6,%xmm15
+	movl	_OPENSSL_ia32cap_P+4(%rip),%r9d
+	cmpq	$112,%rdx
+	jbe	L$cbc_dec_six_or_seven
+
+	andl	$71303168,%r9d
+	subq	$80,%rdx
+	cmpl	$4194304,%r9d
+	je	L$cbc_dec_loop6_enter
+	subq	$32,%rdx
+	leaq	112(%rcx),%rcx
+	jmp	L$cbc_dec_loop8_enter
+.p2align	4
+L$cbc_dec_loop8:
+	movups	%xmm9,(%rsi)
+	leaq	16(%rsi),%rsi
+L$cbc_dec_loop8_enter:
+	movdqu	96(%rdi),%xmm8
+	pxor	%xmm0,%xmm2
+	movdqu	112(%rdi),%xmm9
+	pxor	%xmm0,%xmm3
+	movups	16-112(%rcx),%xmm1
+	pxor	%xmm0,%xmm4
+	xorq	%r11,%r11
+	cmpq	$112,%rdx
+	pxor	%xmm0,%xmm5
+	pxor	%xmm0,%xmm6
+	pxor	%xmm0,%xmm7
+	pxor	%xmm0,%xmm8
+
+.byte	102,15,56,222,209
+	pxor	%xmm0,%xmm9
+	movups	32-112(%rcx),%xmm0
+.byte	102,15,56,222,217
+.byte	102,15,56,222,225
+.byte	102,15,56,222,233
+.byte	102,15,56,222,241
+.byte	102,15,56,222,249
+.byte	102,68,15,56,222,193
+	setnc	%r11b
+	shlq	$7,%r11
+.byte	102,68,15,56,222,201
+	addq	%rdi,%r11
+	movups	48-112(%rcx),%xmm1
+.byte	102,15,56,222,208
+.byte	102,15,56,222,216
+.byte	102,15,56,222,224
+.byte	102,15,56,222,232
+.byte	102,15,56,222,240
+.byte	102,15,56,222,248
+.byte	102,68,15,56,222,192
+.byte	102,68,15,56,222,200
+	movups	64-112(%rcx),%xmm0
+	nop
+.byte	102,15,56,222,209
+.byte	102,15,56,222,217
+.byte	102,15,56,222,225
+.byte	102,15,56,222,233
+.byte	102,15,56,222,241
+.byte	102,15,56,222,249
+.byte	102,68,15,56,222,193
+.byte	102,68,15,56,222,201
+	movups	80-112(%rcx),%xmm1
+	nop
+.byte	102,15,56,222,208
+.byte	102,15,56,222,216
+.byte	102,15,56,222,224
+.byte	102,15,56,222,232
+.byte	102,15,56,222,240
+.byte	102,15,56,222,248
+.byte	102,68,15,56,222,192
+.byte	102,68,15,56,222,200
+	movups	96-112(%rcx),%xmm0
+	nop
+.byte	102,15,56,222,209
+.byte	102,15,56,222,217
+.byte	102,15,56,222,225
+.byte	102,15,56,222,233
+.byte	102,15,56,222,241
+.byte	102,15,56,222,249
+.byte	102,68,15,56,222,193
+.byte	102,68,15,56,222,201
+	movups	112-112(%rcx),%xmm1
+	nop
+.byte	102,15,56,222,208
+.byte	102,15,56,222,216
+.byte	102,15,56,222,224
+.byte	102,15,56,222,232
+.byte	102,15,56,222,240
+.byte	102,15,56,222,248
+.byte	102,68,15,56,222,192
+.byte	102,68,15,56,222,200
+	movups	128-112(%rcx),%xmm0
+	nop
+.byte	102,15,56,222,209
+.byte	102,15,56,222,217
+.byte	102,15,56,222,225
+.byte	102,15,56,222,233
+.byte	102,15,56,222,241
+.byte	102,15,56,222,249
+.byte	102,68,15,56,222,193
+.byte	102,68,15,56,222,201
+	movups	144-112(%rcx),%xmm1
+	cmpl	$11,%eax
+.byte	102,15,56,222,208
+.byte	102,15,56,222,216
+.byte	102,15,56,222,224
+.byte	102,15,56,222,232
+.byte	102,15,56,222,240
+.byte	102,15,56,222,248
+.byte	102,68,15,56,222,192
+.byte	102,68,15,56,222,200
+	movups	160-112(%rcx),%xmm0
+	jb	L$cbc_dec_done
+.byte	102,15,56,222,209
+.byte	102,15,56,222,217
+.byte	102,15,56,222,225
+.byte	102,15,56,222,233
+.byte	102,15,56,222,241
+.byte	102,15,56,222,249
+.byte	102,68,15,56,222,193
+.byte	102,68,15,56,222,201
+	movups	176-112(%rcx),%xmm1
+	nop
+.byte	102,15,56,222,208
+.byte	102,15,56,222,216
+.byte	102,15,56,222,224
+.byte	102,15,56,222,232
+.byte	102,15,56,222,240
+.byte	102,15,56,222,248
+.byte	102,68,15,56,222,192
+.byte	102,68,15,56,222,200
+	movups	192-112(%rcx),%xmm0
+	je	L$cbc_dec_done
+.byte	102,15,56,222,209
+.byte	102,15,56,222,217
+.byte	102,15,56,222,225
+.byte	102,15,56,222,233
+.byte	102,15,56,222,241
+.byte	102,15,56,222,249
+.byte	102,68,15,56,222,193
+.byte	102,68,15,56,222,201
+	movups	208-112(%rcx),%xmm1
+	nop
+.byte	102,15,56,222,208
+.byte	102,15,56,222,216
+.byte	102,15,56,222,224
+.byte	102,15,56,222,232
+.byte	102,15,56,222,240
+.byte	102,15,56,222,248
+.byte	102,68,15,56,222,192
+.byte	102,68,15,56,222,200
+	movups	224-112(%rcx),%xmm0
+	jmp	L$cbc_dec_done
+.p2align	4
+L$cbc_dec_done:
+.byte	102,15,56,222,209
+.byte	102,15,56,222,217
+	pxor	%xmm0,%xmm10
+	pxor	%xmm0,%xmm11
+.byte	102,15,56,222,225
+.byte	102,15,56,222,233
+	pxor	%xmm0,%xmm12
+	pxor	%xmm0,%xmm13
+.byte	102,15,56,222,241
+.byte	102,15,56,222,249
+	pxor	%xmm0,%xmm14
+	pxor	%xmm0,%xmm15
+.byte	102,68,15,56,222,193
+.byte	102,68,15,56,222,201
+	movdqu	80(%rdi),%xmm1
+
+.byte	102,65,15,56,223,210
+	movdqu	96(%rdi),%xmm10
+	pxor	%xmm0,%xmm1
+.byte	102,65,15,56,223,219
+	pxor	%xmm0,%xmm10
+	movdqu	112(%rdi),%xmm0
+.byte	102,65,15,56,223,228
+	leaq	128(%rdi),%rdi
+	movdqu	0(%r11),%xmm11
+.byte	102,65,15,56,223,237
+.byte	102,65,15,56,223,246
+	movdqu	16(%r11),%xmm12
+	movdqu	32(%r11),%xmm13
+.byte	102,65,15,56,223,255
+.byte	102,68,15,56,223,193
+	movdqu	48(%r11),%xmm14
+	movdqu	64(%r11),%xmm15
+.byte	102,69,15,56,223,202
+	movdqa	%xmm0,%xmm10
+	movdqu	80(%r11),%xmm1
+	movups	-112(%rcx),%xmm0
+
+	movups	%xmm2,(%rsi)
+	movdqa	%xmm11,%xmm2
+	movups	%xmm3,16(%rsi)
+	movdqa	%xmm12,%xmm3
+	movups	%xmm4,32(%rsi)
+	movdqa	%xmm13,%xmm4
+	movups	%xmm5,48(%rsi)
+	movdqa	%xmm14,%xmm5
+	movups	%xmm6,64(%rsi)
+	movdqa	%xmm15,%xmm6
+	movups	%xmm7,80(%rsi)
+	movdqa	%xmm1,%xmm7
+	movups	%xmm8,96(%rsi)
+	leaq	112(%rsi),%rsi
+
+	subq	$128,%rdx
+	ja	L$cbc_dec_loop8
+
+	movaps	%xmm9,%xmm2
+	leaq	-112(%rcx),%rcx
+	addq	$112,%rdx
+	jle	L$cbc_dec_clear_tail_collected
+	movups	%xmm9,(%rsi)
+	leaq	16(%rsi),%rsi
+	cmpq	$80,%rdx
+	jbe	L$cbc_dec_tail
+
+	movaps	%xmm11,%xmm2
+L$cbc_dec_six_or_seven:
+	cmpq	$96,%rdx
+	ja	L$cbc_dec_seven
+
+	movaps	%xmm7,%xmm8
+	call	_aesni_decrypt6
+	pxor	%xmm10,%xmm2
+	movaps	%xmm8,%xmm10
+	pxor	%xmm11,%xmm3
+	movdqu	%xmm2,(%rsi)
+	pxor	%xmm12,%xmm4
+	movdqu	%xmm3,16(%rsi)
+	pxor	%xmm3,%xmm3
+	pxor	%xmm13,%xmm5
+	movdqu	%xmm4,32(%rsi)
+	pxor	%xmm4,%xmm4
+	pxor	%xmm14,%xmm6
+	movdqu	%xmm5,48(%rsi)
+	pxor	%xmm5,%xmm5
+	pxor	%xmm15,%xmm7
+	movdqu	%xmm6,64(%rsi)
+	pxor	%xmm6,%xmm6
+	leaq	80(%rsi),%rsi
+	movdqa	%xmm7,%xmm2
+	pxor	%xmm7,%xmm7
+	jmp	L$cbc_dec_tail_collected
+
+.p2align	4
+L$cbc_dec_seven:
+	movups	96(%rdi),%xmm8
+	xorps	%xmm9,%xmm9
+	call	_aesni_decrypt8
+	movups	80(%rdi),%xmm9
+	pxor	%xmm10,%xmm2
+	movups	96(%rdi),%xmm10
+	pxor	%xmm11,%xmm3
+	movdqu	%xmm2,(%rsi)
+	pxor	%xmm12,%xmm4
+	movdqu	%xmm3,16(%rsi)
+	pxor	%xmm3,%xmm3
+	pxor	%xmm13,%xmm5
+	movdqu	%xmm4,32(%rsi)
+	pxor	%xmm4,%xmm4
+	pxor	%xmm14,%xmm6
+	movdqu	%xmm5,48(%rsi)
+	pxor	%xmm5,%xmm5
+	pxor	%xmm15,%xmm7
+	movdqu	%xmm6,64(%rsi)
+	pxor	%xmm6,%xmm6
+	pxor	%xmm9,%xmm8
+	movdqu	%xmm7,80(%rsi)
+	pxor	%xmm7,%xmm7
+	leaq	96(%rsi),%rsi
+	movdqa	%xmm8,%xmm2
+	pxor	%xmm8,%xmm8
+	pxor	%xmm9,%xmm9
+	jmp	L$cbc_dec_tail_collected
+
+.p2align	4
+L$cbc_dec_loop6:
+	movups	%xmm7,(%rsi)
+	leaq	16(%rsi),%rsi
+	movdqu	0(%rdi),%xmm2
+	movdqu	16(%rdi),%xmm3
+	movdqa	%xmm2,%xmm11
+	movdqu	32(%rdi),%xmm4
+	movdqa	%xmm3,%xmm12
+	movdqu	48(%rdi),%xmm5
+	movdqa	%xmm4,%xmm13
+	movdqu	64(%rdi),%xmm6
+	movdqa	%xmm5,%xmm14
+	movdqu	80(%rdi),%xmm7
+	movdqa	%xmm6,%xmm15
+L$cbc_dec_loop6_enter:
+	leaq	96(%rdi),%rdi
+	movdqa	%xmm7,%xmm8
+
+	call	_aesni_decrypt6
+
+	pxor	%xmm10,%xmm2
+	movdqa	%xmm8,%xmm10
+	pxor	%xmm11,%xmm3
+	movdqu	%xmm2,(%rsi)
+	pxor	%xmm12,%xmm4
+	movdqu	%xmm3,16(%rsi)
+	pxor	%xmm13,%xmm5
+	movdqu	%xmm4,32(%rsi)
+	pxor	%xmm14,%xmm6
+	movq	%r11,%rcx
+	movdqu	%xmm5,48(%rsi)
+	pxor	%xmm15,%xmm7
+	movl	%r10d,%eax
+	movdqu	%xmm6,64(%rsi)
+	leaq	80(%rsi),%rsi
+	subq	$96,%rdx
+	ja	L$cbc_dec_loop6
+
+	movdqa	%xmm7,%xmm2
+	addq	$80,%rdx
+	jle	L$cbc_dec_clear_tail_collected
+	movups	%xmm7,(%rsi)
+	leaq	16(%rsi),%rsi
+
+L$cbc_dec_tail:
+	movups	(%rdi),%xmm2
+	subq	$16,%rdx
+	jbe	L$cbc_dec_one
+
+	movups	16(%rdi),%xmm3
+	movaps	%xmm2,%xmm11
+	subq	$16,%rdx
+	jbe	L$cbc_dec_two
+
+	movups	32(%rdi),%xmm4
+	movaps	%xmm3,%xmm12
+	subq	$16,%rdx
+	jbe	L$cbc_dec_three
+
+	movups	48(%rdi),%xmm5
+	movaps	%xmm4,%xmm13
+	subq	$16,%rdx
+	jbe	L$cbc_dec_four
+
+	movups	64(%rdi),%xmm6
+	movaps	%xmm5,%xmm14
+	movaps	%xmm6,%xmm15
+	xorps	%xmm7,%xmm7
+	call	_aesni_decrypt6
+	pxor	%xmm10,%xmm2
+	movaps	%xmm15,%xmm10
+	pxor	%xmm11,%xmm3
+	movdqu	%xmm2,(%rsi)
+	pxor	%xmm12,%xmm4
+	movdqu	%xmm3,16(%rsi)
+	pxor	%xmm3,%xmm3
+	pxor	%xmm13,%xmm5
+	movdqu	%xmm4,32(%rsi)
+	pxor	%xmm4,%xmm4
+	pxor	%xmm14,%xmm6
+	movdqu	%xmm5,48(%rsi)
+	pxor	%xmm5,%xmm5
+	leaq	64(%rsi),%rsi
+	movdqa	%xmm6,%xmm2
+	pxor	%xmm6,%xmm6
+	pxor	%xmm7,%xmm7
+	subq	$16,%rdx
+	jmp	L$cbc_dec_tail_collected
+
+.p2align	4
+L$cbc_dec_one:
+	movaps	%xmm2,%xmm11
+	movups	(%rcx),%xmm0
+	movups	16(%rcx),%xmm1
+	leaq	32(%rcx),%rcx
+	xorps	%xmm0,%xmm2
+L$oop_dec1_17:
+.byte	102,15,56,222,209
+	decl	%eax
+	movups	(%rcx),%xmm1
+	leaq	16(%rcx),%rcx
+	jnz	L$oop_dec1_17
+.byte	102,15,56,223,209
+	xorps	%xmm10,%xmm2
+	movaps	%xmm11,%xmm10
+	jmp	L$cbc_dec_tail_collected
+.p2align	4
+L$cbc_dec_two:
+	movaps	%xmm3,%xmm12
+	call	_aesni_decrypt2
+	pxor	%xmm10,%xmm2
+	movaps	%xmm12,%xmm10
+	pxor	%xmm11,%xmm3
+	movdqu	%xmm2,(%rsi)
+	movdqa	%xmm3,%xmm2
+	pxor	%xmm3,%xmm3
+	leaq	16(%rsi),%rsi
+	jmp	L$cbc_dec_tail_collected
+.p2align	4
+L$cbc_dec_three:
+	movaps	%xmm4,%xmm13
+	call	_aesni_decrypt3
+	pxor	%xmm10,%xmm2
+	movaps	%xmm13,%xmm10
+	pxor	%xmm11,%xmm3
+	movdqu	%xmm2,(%rsi)
+	pxor	%xmm12,%xmm4
+	movdqu	%xmm3,16(%rsi)
+	pxor	%xmm3,%xmm3
+	movdqa	%xmm4,%xmm2
+	pxor	%xmm4,%xmm4
+	leaq	32(%rsi),%rsi
+	jmp	L$cbc_dec_tail_collected
+.p2align	4
+L$cbc_dec_four:
+	movaps	%xmm5,%xmm14
+	call	_aesni_decrypt4
+	pxor	%xmm10,%xmm2
+	movaps	%xmm14,%xmm10
+	pxor	%xmm11,%xmm3
+	movdqu	%xmm2,(%rsi)
+	pxor	%xmm12,%xmm4
+	movdqu	%xmm3,16(%rsi)
+	pxor	%xmm3,%xmm3
+	pxor	%xmm13,%xmm5
+	movdqu	%xmm4,32(%rsi)
+	pxor	%xmm4,%xmm4
+	movdqa	%xmm5,%xmm2
+	pxor	%xmm5,%xmm5
+	leaq	48(%rsi),%rsi
+	jmp	L$cbc_dec_tail_collected
+
+.p2align	4
+L$cbc_dec_clear_tail_collected:
+	pxor	%xmm3,%xmm3
+	pxor	%xmm4,%xmm4
+	pxor	%xmm5,%xmm5
+	pxor	%xmm6,%xmm6
+	pxor	%xmm7,%xmm7
+	pxor	%xmm8,%xmm8
+	pxor	%xmm9,%xmm9
+L$cbc_dec_tail_collected:
+	movups	%xmm10,(%r8)
+	andq	$15,%rdx
+	jnz	L$cbc_dec_tail_partial
+	movups	%xmm2,(%rsi)
+	pxor	%xmm2,%xmm2
+	jmp	L$cbc_dec_ret
+.p2align	4
+L$cbc_dec_tail_partial:
+	movaps	%xmm2,(%rsp)
+	pxor	%xmm2,%xmm2
+	movq	$16,%rcx
+	movq	%rsi,%rdi
+	subq	%rdx,%rcx
+	leaq	(%rsp),%rsi
+.long	0x9066A4F3
+	movdqa	%xmm2,(%rsp)
+
+L$cbc_dec_ret:
+	xorps	%xmm0,%xmm0
+	pxor	%xmm1,%xmm1
+	leaq	(%rbp),%rsp
+	popq	%rbp
+L$cbc_ret:
+	.byte	0xf3,0xc3
+
+.globl	_aesni_set_decrypt_key
+.private_extern _aesni_set_decrypt_key
+
+.p2align	4
+_aesni_set_decrypt_key:
+.byte	0x48,0x83,0xEC,0x08
+	call	__aesni_set_encrypt_key
+	shll	$4,%esi
+	testl	%eax,%eax
+	jnz	L$dec_key_ret
+	leaq	16(%rdx,%rsi,1),%rdi
+
+	movups	(%rdx),%xmm0
+	movups	(%rdi),%xmm1
+	movups	%xmm0,(%rdi)
+	movups	%xmm1,(%rdx)
+	leaq	16(%rdx),%rdx
+	leaq	-16(%rdi),%rdi
+
+L$dec_key_inverse:
+	movups	(%rdx),%xmm0
+	movups	(%rdi),%xmm1
+.byte	102,15,56,219,192
+.byte	102,15,56,219,201
+	leaq	16(%rdx),%rdx
+	leaq	-16(%rdi),%rdi
+	movups	%xmm0,16(%rdi)
+	movups	%xmm1,-16(%rdx)
+	cmpq	%rdx,%rdi
+	ja	L$dec_key_inverse
+
+	movups	(%rdx),%xmm0
+.byte	102,15,56,219,192
+	pxor	%xmm1,%xmm1
+	movups	%xmm0,(%rdi)
+	pxor	%xmm0,%xmm0
+L$dec_key_ret:
+	addq	$8,%rsp
+	.byte	0xf3,0xc3
+L$SEH_end_set_decrypt_key:
+
+.globl	_aesni_set_encrypt_key
+.private_extern _aesni_set_encrypt_key
+
+.p2align	4
+_aesni_set_encrypt_key:
+__aesni_set_encrypt_key:
+.byte	0x48,0x83,0xEC,0x08
+	movq	$-1,%rax
+	testq	%rdi,%rdi
+	jz	L$enc_key_ret
+	testq	%rdx,%rdx
+	jz	L$enc_key_ret
+
+	movl	$268437504,%r10d
+	movups	(%rdi),%xmm0
+	xorps	%xmm4,%xmm4
+	andl	_OPENSSL_ia32cap_P+4(%rip),%r10d
+	leaq	16(%rdx),%rax
+	cmpl	$256,%esi
+	je	L$14rounds
+	cmpl	$192,%esi
+	je	L$12rounds
+	cmpl	$128,%esi
+	jne	L$bad_keybits
+
+L$10rounds:
+	movl	$9,%esi
+	cmpl	$268435456,%r10d
+	je	L$10rounds_alt
+
+	movups	%xmm0,(%rdx)
+.byte	102,15,58,223,200,1
+	call	L$key_expansion_128_cold
+.byte	102,15,58,223,200,2
+	call	L$key_expansion_128
+.byte	102,15,58,223,200,4
+	call	L$key_expansion_128
+.byte	102,15,58,223,200,8
+	call	L$key_expansion_128
+.byte	102,15,58,223,200,16
+	call	L$key_expansion_128
+.byte	102,15,58,223,200,32
+	call	L$key_expansion_128
+.byte	102,15,58,223,200,64
+	call	L$key_expansion_128
+.byte	102,15,58,223,200,128
+	call	L$key_expansion_128
+.byte	102,15,58,223,200,27
+	call	L$key_expansion_128
+.byte	102,15,58,223,200,54
+	call	L$key_expansion_128
+	movups	%xmm0,(%rax)
+	movl	%esi,80(%rax)
+	xorl	%eax,%eax
+	jmp	L$enc_key_ret
+
+.p2align	4
+L$10rounds_alt:
+	movdqa	L$key_rotate(%rip),%xmm5
+	movl	$8,%r10d
+	movdqa	L$key_rcon1(%rip),%xmm4
+	movdqa	%xmm0,%xmm2
+	movdqu	%xmm0,(%rdx)
+	jmp	L$oop_key128
+
+.p2align	4
+L$oop_key128:
+.byte	102,15,56,0,197
+.byte	102,15,56,221,196
+	pslld	$1,%xmm4
+	leaq	16(%rax),%rax
+
+	movdqa	%xmm2,%xmm3
+	pslldq	$4,%xmm2
+	pxor	%xmm2,%xmm3
+	pslldq	$4,%xmm2
+	pxor	%xmm2,%xmm3
+	pslldq	$4,%xmm2
+	pxor	%xmm3,%xmm2
+
+	pxor	%xmm2,%xmm0
+	movdqu	%xmm0,-16(%rax)
+	movdqa	%xmm0,%xmm2
+
+	decl	%r10d
+	jnz	L$oop_key128
+
+	movdqa	L$key_rcon1b(%rip),%xmm4
+
+.byte	102,15,56,0,197
+.byte	102,15,56,221,196
+	pslld	$1,%xmm4
+
+	movdqa	%xmm2,%xmm3
+	pslldq	$4,%xmm2
+	pxor	%xmm2,%xmm3
+	pslldq	$4,%xmm2
+	pxor	%xmm2,%xmm3
+	pslldq	$4,%xmm2
+	pxor	%xmm3,%xmm2
+
+	pxor	%xmm2,%xmm0
+	movdqu	%xmm0,(%rax)
+
+	movdqa	%xmm0,%xmm2
+.byte	102,15,56,0,197
+.byte	102,15,56,221,196
+
+	movdqa	%xmm2,%xmm3
+	pslldq	$4,%xmm2
+	pxor	%xmm2,%xmm3
+	pslldq	$4,%xmm2
+	pxor	%xmm2,%xmm3
+	pslldq	$4,%xmm2
+	pxor	%xmm3,%xmm2
+
+	pxor	%xmm2,%xmm0
+	movdqu	%xmm0,16(%rax)
+
+	movl	%esi,96(%rax)
+	xorl	%eax,%eax
+	jmp	L$enc_key_ret
+
+.p2align	4
+L$12rounds:
+	movq	16(%rdi),%xmm2
+	movl	$11,%esi
+	cmpl	$268435456,%r10d
+	je	L$12rounds_alt
+
+	movups	%xmm0,(%rdx)
+.byte	102,15,58,223,202,1
+	call	L$key_expansion_192a_cold
+.byte	102,15,58,223,202,2
+	call	L$key_expansion_192b
+.byte	102,15,58,223,202,4
+	call	L$key_expansion_192a
+.byte	102,15,58,223,202,8
+	call	L$key_expansion_192b
+.byte	102,15,58,223,202,16
+	call	L$key_expansion_192a
+.byte	102,15,58,223,202,32
+	call	L$key_expansion_192b
+.byte	102,15,58,223,202,64
+	call	L$key_expansion_192a
+.byte	102,15,58,223,202,128
+	call	L$key_expansion_192b
+	movups	%xmm0,(%rax)
+	movl	%esi,48(%rax)
+	xorq	%rax,%rax
+	jmp	L$enc_key_ret
+
+.p2align	4
+L$12rounds_alt:
+	movdqa	L$key_rotate192(%rip),%xmm5
+	movdqa	L$key_rcon1(%rip),%xmm4
+	movl	$8,%r10d
+	movdqu	%xmm0,(%rdx)
+	jmp	L$oop_key192
+
+.p2align	4
+L$oop_key192:
+	movq	%xmm2,0(%rax)
+	movdqa	%xmm2,%xmm1
+.byte	102,15,56,0,213
+.byte	102,15,56,221,212
+	pslld	$1,%xmm4
+	leaq	24(%rax),%rax
+
+	movdqa	%xmm0,%xmm3
+	pslldq	$4,%xmm0
+	pxor	%xmm0,%xmm3
+	pslldq	$4,%xmm0
+	pxor	%xmm0,%xmm3
+	pslldq	$4,%xmm0
+	pxor	%xmm3,%xmm0
+
+	pshufd	$255,%xmm0,%xmm3
+	pxor	%xmm1,%xmm3
+	pslldq	$4,%xmm1
+	pxor	%xmm1,%xmm3
+
+	pxor	%xmm2,%xmm0
+	pxor	%xmm3,%xmm2
+	movdqu	%xmm0,-16(%rax)
+
+	decl	%r10d
+	jnz	L$oop_key192
+
+	movl	%esi,32(%rax)
+	xorl	%eax,%eax
+	jmp	L$enc_key_ret
+
+.p2align	4
+L$14rounds:
+	movups	16(%rdi),%xmm2
+	movl	$13,%esi
+	leaq	16(%rax),%rax
+	cmpl	$268435456,%r10d
+	je	L$14rounds_alt
+
+	movups	%xmm0,(%rdx)
+	movups	%xmm2,16(%rdx)
+.byte	102,15,58,223,202,1
+	call	L$key_expansion_256a_cold
+.byte	102,15,58,223,200,1
+	call	L$key_expansion_256b
+.byte	102,15,58,223,202,2
+	call	L$key_expansion_256a
+.byte	102,15,58,223,200,2
+	call	L$key_expansion_256b
+.byte	102,15,58,223,202,4
+	call	L$key_expansion_256a
+.byte	102,15,58,223,200,4
+	call	L$key_expansion_256b
+.byte	102,15,58,223,202,8
+	call	L$key_expansion_256a
+.byte	102,15,58,223,200,8
+	call	L$key_expansion_256b
+.byte	102,15,58,223,202,16
+	call	L$key_expansion_256a
+.byte	102,15,58,223,200,16
+	call	L$key_expansion_256b
+.byte	102,15,58,223,202,32
+	call	L$key_expansion_256a
+.byte	102,15,58,223,200,32
+	call	L$key_expansion_256b
+.byte	102,15,58,223,202,64
+	call	L$key_expansion_256a
+	movups	%xmm0,(%rax)
+	movl	%esi,16(%rax)
+	xorq	%rax,%rax
+	jmp	L$enc_key_ret
+
+.p2align	4
+L$14rounds_alt:
+	movdqa	L$key_rotate(%rip),%xmm5
+	movdqa	L$key_rcon1(%rip),%xmm4
+	movl	$7,%r10d
+	movdqu	%xmm0,0(%rdx)
+	movdqa	%xmm2,%xmm1
+	movdqu	%xmm2,16(%rdx)
+	jmp	L$oop_key256
+
+.p2align	4
+L$oop_key256:
+.byte	102,15,56,0,213
+.byte	102,15,56,221,212
+
+	movdqa	%xmm0,%xmm3
+	pslldq	$4,%xmm0
+	pxor	%xmm0,%xmm3
+	pslldq	$4,%xmm0
+	pxor	%xmm0,%xmm3
+	pslldq	$4,%xmm0
+	pxor	%xmm3,%xmm0
+	pslld	$1,%xmm4
+
+	pxor	%xmm2,%xmm0
+	movdqu	%xmm0,(%rax)
+
+	decl	%r10d
+	jz	L$done_key256
+
+	pshufd	$255,%xmm0,%xmm2
+	pxor	%xmm3,%xmm3
+.byte	102,15,56,221,211
+
+	movdqa	%xmm1,%xmm3
+	pslldq	$4,%xmm1
+	pxor	%xmm1,%xmm3
+	pslldq	$4,%xmm1
+	pxor	%xmm1,%xmm3
+	pslldq	$4,%xmm1
+	pxor	%xmm3,%xmm1
+
+	pxor	%xmm1,%xmm2
+	movdqu	%xmm2,16(%rax)
+	leaq	32(%rax),%rax
+	movdqa	%xmm2,%xmm1
+
+	jmp	L$oop_key256
+
+L$done_key256:
+	movl	%esi,16(%rax)
+	xorl	%eax,%eax
+	jmp	L$enc_key_ret
+
+.p2align	4
+L$bad_keybits:
+	movq	$-2,%rax
+L$enc_key_ret:
+	pxor	%xmm0,%xmm0
+	pxor	%xmm1,%xmm1
+	pxor	%xmm2,%xmm2
+	pxor	%xmm3,%xmm3
+	pxor	%xmm4,%xmm4
+	pxor	%xmm5,%xmm5
+	addq	$8,%rsp
+	.byte	0xf3,0xc3
+L$SEH_end_set_encrypt_key:
+
+.p2align	4
+L$key_expansion_128:
+	movups	%xmm0,(%rax)
+	leaq	16(%rax),%rax
+L$key_expansion_128_cold:
+	shufps	$16,%xmm0,%xmm4
+	xorps	%xmm4,%xmm0
+	shufps	$140,%xmm0,%xmm4
+	xorps	%xmm4,%xmm0
+	shufps	$255,%xmm1,%xmm1
+	xorps	%xmm1,%xmm0
+	.byte	0xf3,0xc3
+
+.p2align	4
+L$key_expansion_192a:
+	movups	%xmm0,(%rax)
+	leaq	16(%rax),%rax
+L$key_expansion_192a_cold:
+	movaps	%xmm2,%xmm5
+L$key_expansion_192b_warm:
+	shufps	$16,%xmm0,%xmm4
+	movdqa	%xmm2,%xmm3
+	xorps	%xmm4,%xmm0
+	shufps	$140,%xmm0,%xmm4
+	pslldq	$4,%xmm3
+	xorps	%xmm4,%xmm0
+	pshufd	$85,%xmm1,%xmm1
+	pxor	%xmm3,%xmm2
+	pxor	%xmm1,%xmm0
+	pshufd	$255,%xmm0,%xmm3
+	pxor	%xmm3,%xmm2
+	.byte	0xf3,0xc3
+
+.p2align	4
+L$key_expansion_192b:
+	movaps	%xmm0,%xmm3
+	shufps	$68,%xmm0,%xmm5
+	movups	%xmm5,(%rax)
+	shufps	$78,%xmm2,%xmm3
+	movups	%xmm3,16(%rax)
+	leaq	32(%rax),%rax
+	jmp	L$key_expansion_192b_warm
+
+.p2align	4
+L$key_expansion_256a:
+	movups	%xmm2,(%rax)
+	leaq	16(%rax),%rax
+L$key_expansion_256a_cold:
+	shufps	$16,%xmm0,%xmm4
+	xorps	%xmm4,%xmm0
+	shufps	$140,%xmm0,%xmm4
+	xorps	%xmm4,%xmm0
+	shufps	$255,%xmm1,%xmm1
+	xorps	%xmm1,%xmm0
+	.byte	0xf3,0xc3
+
+.p2align	4
+L$key_expansion_256b:
+	movups	%xmm0,(%rax)
+	leaq	16(%rax),%rax
+
+	shufps	$16,%xmm2,%xmm4
+	xorps	%xmm4,%xmm2
+	shufps	$140,%xmm2,%xmm4
+	xorps	%xmm4,%xmm2
+	shufps	$170,%xmm1,%xmm1
+	xorps	%xmm1,%xmm2
+	.byte	0xf3,0xc3
+
+
+.p2align	6
+L$bswap_mask:
+.byte	15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0
+L$increment32:
+.long	6,6,6,0
+L$increment64:
+.long	1,0,0,0
+L$xts_magic:
+.long	0x87,0,1,0
+L$increment1:
+.byte	0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
+L$key_rotate:
+.long	0x0c0f0e0d,0x0c0f0e0d,0x0c0f0e0d,0x0c0f0e0d
+L$key_rotate192:
+.long	0x04070605,0x04070605,0x04070605,0x04070605
+L$key_rcon1:
+.long	1,1,1,1
+L$key_rcon1b:
+.long	0x1b,0x1b,0x1b,0x1b
+
+.byte	65,69,83,32,102,111,114,32,73,110,116,101,108,32,65,69,83,45,78,73,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0
+.p2align	6
+#endif
diff --git a/third_party/boringssl/mac-x86_64/crypto/aes/bsaes-x86_64.S b/third_party/boringssl/mac-x86_64/crypto/aes/bsaes-x86_64.S
new file mode 100644
index 0000000..c2d0477
--- /dev/null
+++ b/third_party/boringssl/mac-x86_64/crypto/aes/bsaes-x86_64.S
@@ -0,0 +1,2504 @@
+#if defined(__x86_64__)
+.text	
+
+
+
+
+
+.p2align	6
+_bsaes_encrypt8:
+	leaq	L$BS0(%rip),%r11
+
+	movdqa	(%rax),%xmm8
+	leaq	16(%rax),%rax
+	movdqa	80(%r11),%xmm7
+	pxor	%xmm8,%xmm15
+	pxor	%xmm8,%xmm0
+	pxor	%xmm8,%xmm1
+	pxor	%xmm8,%xmm2
+.byte	102,68,15,56,0,255
+.byte	102,15,56,0,199
+	pxor	%xmm8,%xmm3
+	pxor	%xmm8,%xmm4
+.byte	102,15,56,0,207
+.byte	102,15,56,0,215
+	pxor	%xmm8,%xmm5
+	pxor	%xmm8,%xmm6
+.byte	102,15,56,0,223
+.byte	102,15,56,0,231
+.byte	102,15,56,0,239
+.byte	102,15,56,0,247
+_bsaes_encrypt8_bitslice:
+	movdqa	0(%r11),%xmm7
+	movdqa	16(%r11),%xmm8
+	movdqa	%xmm5,%xmm9
+	psrlq	$1,%xmm5
+	movdqa	%xmm3,%xmm10
+	psrlq	$1,%xmm3
+	pxor	%xmm6,%xmm5
+	pxor	%xmm4,%xmm3
+	pand	%xmm7,%xmm5
+	pand	%xmm7,%xmm3
+	pxor	%xmm5,%xmm6
+	psllq	$1,%xmm5
+	pxor	%xmm3,%xmm4
+	psllq	$1,%xmm3
+	pxor	%xmm9,%xmm5
+	pxor	%xmm10,%xmm3
+	movdqa	%xmm1,%xmm9
+	psrlq	$1,%xmm1
+	movdqa	%xmm15,%xmm10
+	psrlq	$1,%xmm15
+	pxor	%xmm2,%xmm1
+	pxor	%xmm0,%xmm15
+	pand	%xmm7,%xmm1
+	pand	%xmm7,%xmm15
+	pxor	%xmm1,%xmm2
+	psllq	$1,%xmm1
+	pxor	%xmm15,%xmm0
+	psllq	$1,%xmm15
+	pxor	%xmm9,%xmm1
+	pxor	%xmm10,%xmm15
+	movdqa	32(%r11),%xmm7
+	movdqa	%xmm4,%xmm9
+	psrlq	$2,%xmm4
+	movdqa	%xmm3,%xmm10
+	psrlq	$2,%xmm3
+	pxor	%xmm6,%xmm4
+	pxor	%xmm5,%xmm3
+	pand	%xmm8,%xmm4
+	pand	%xmm8,%xmm3
+	pxor	%xmm4,%xmm6
+	psllq	$2,%xmm4
+	pxor	%xmm3,%xmm5
+	psllq	$2,%xmm3
+	pxor	%xmm9,%xmm4
+	pxor	%xmm10,%xmm3
+	movdqa	%xmm0,%xmm9
+	psrlq	$2,%xmm0
+	movdqa	%xmm15,%xmm10
+	psrlq	$2,%xmm15
+	pxor	%xmm2,%xmm0
+	pxor	%xmm1,%xmm15
+	pand	%xmm8,%xmm0
+	pand	%xmm8,%xmm15
+	pxor	%xmm0,%xmm2
+	psllq	$2,%xmm0
+	pxor	%xmm15,%xmm1
+	psllq	$2,%xmm15
+	pxor	%xmm9,%xmm0
+	pxor	%xmm10,%xmm15
+	movdqa	%xmm2,%xmm9
+	psrlq	$4,%xmm2
+	movdqa	%xmm1,%xmm10
+	psrlq	$4,%xmm1
+	pxor	%xmm6,%xmm2
+	pxor	%xmm5,%xmm1
+	pand	%xmm7,%xmm2
+	pand	%xmm7,%xmm1
+	pxor	%xmm2,%xmm6
+	psllq	$4,%xmm2
+	pxor	%xmm1,%xmm5
+	psllq	$4,%xmm1
+	pxor	%xmm9,%xmm2
+	pxor	%xmm10,%xmm1
+	movdqa	%xmm0,%xmm9
+	psrlq	$4,%xmm0
+	movdqa	%xmm15,%xmm10
+	psrlq	$4,%xmm15
+	pxor	%xmm4,%xmm0
+	pxor	%xmm3,%xmm15
+	pand	%xmm7,%xmm0
+	pand	%xmm7,%xmm15
+	pxor	%xmm0,%xmm4
+	psllq	$4,%xmm0
+	pxor	%xmm15,%xmm3
+	psllq	$4,%xmm15
+	pxor	%xmm9,%xmm0
+	pxor	%xmm10,%xmm15
+	decl	%r10d
+	jmp	L$enc_sbox
+.p2align	4
+L$enc_loop:
+	pxor	0(%rax),%xmm15
+	pxor	16(%rax),%xmm0
+	pxor	32(%rax),%xmm1
+	pxor	48(%rax),%xmm2
+.byte	102,68,15,56,0,255
+.byte	102,15,56,0,199
+	pxor	64(%rax),%xmm3
+	pxor	80(%rax),%xmm4
+.byte	102,15,56,0,207
+.byte	102,15,56,0,215
+	pxor	96(%rax),%xmm5
+	pxor	112(%rax),%xmm6
+.byte	102,15,56,0,223
+.byte	102,15,56,0,231
+.byte	102,15,56,0,239
+.byte	102,15,56,0,247
+	leaq	128(%rax),%rax
+L$enc_sbox:
+	pxor	%xmm5,%xmm4
+	pxor	%xmm0,%xmm1
+	pxor	%xmm15,%xmm2
+	pxor	%xmm1,%xmm5
+	pxor	%xmm15,%xmm4
+
+	pxor	%xmm2,%xmm5
+	pxor	%xmm6,%xmm2
+	pxor	%xmm4,%xmm6
+	pxor	%xmm3,%xmm2
+	pxor	%xmm4,%xmm3
+	pxor	%xmm0,%xmm2
+
+	pxor	%xmm6,%xmm1
+	pxor	%xmm4,%xmm0
+	movdqa	%xmm6,%xmm10
+	movdqa	%xmm0,%xmm9
+	movdqa	%xmm4,%xmm8
+	movdqa	%xmm1,%xmm12
+	movdqa	%xmm5,%xmm11
+
+	pxor	%xmm3,%xmm10
+	pxor	%xmm1,%xmm9
+	pxor	%xmm2,%xmm8
+	movdqa	%xmm10,%xmm13
+	pxor	%xmm3,%xmm12
+	movdqa	%xmm9,%xmm7
+	pxor	%xmm15,%xmm11
+	movdqa	%xmm10,%xmm14
+
+	por	%xmm8,%xmm9
+	por	%xmm11,%xmm10
+	pxor	%xmm7,%xmm14
+	pand	%xmm11,%xmm13
+	pxor	%xmm8,%xmm11
+	pand	%xmm8,%xmm7
+	pand	%xmm11,%xmm14
+	movdqa	%xmm2,%xmm11
+	pxor	%xmm15,%xmm11
+	pand	%xmm11,%xmm12
+	pxor	%xmm12,%xmm10
+	pxor	%xmm12,%xmm9
+	movdqa	%xmm6,%xmm12
+	movdqa	%xmm4,%xmm11
+	pxor	%xmm0,%xmm12
+	pxor	%xmm5,%xmm11
+	movdqa	%xmm12,%xmm8
+	pand	%xmm11,%xmm12
+	por	%xmm11,%xmm8
+	pxor	%xmm12,%xmm7
+	pxor	%xmm14,%xmm10
+	pxor	%xmm13,%xmm9
+	pxor	%xmm14,%xmm8
+	movdqa	%xmm1,%xmm11
+	pxor	%xmm13,%xmm7
+	movdqa	%xmm3,%xmm12
+	pxor	%xmm13,%xmm8
+	movdqa	%xmm0,%xmm13
+	pand	%xmm2,%xmm11
+	movdqa	%xmm6,%xmm14
+	pand	%xmm15,%xmm12
+	pand	%xmm4,%xmm13
+	por	%xmm5,%xmm14
+	pxor	%xmm11,%xmm10
+	pxor	%xmm12,%xmm9
+	pxor	%xmm13,%xmm8
+	pxor	%xmm14,%xmm7
+
+
+
+
+
+	movdqa	%xmm10,%xmm11
+	pand	%xmm8,%xmm10
+	pxor	%xmm9,%xmm11
+
+	movdqa	%xmm7,%xmm13
+	movdqa	%xmm11,%xmm14
+	pxor	%xmm10,%xmm13
+	pand	%xmm13,%xmm14
+
+	movdqa	%xmm8,%xmm12
+	pxor	%xmm9,%xmm14
+	pxor	%xmm7,%xmm12
+
+	pxor	%xmm9,%xmm10
+
+	pand	%xmm10,%xmm12
+
+	movdqa	%xmm13,%xmm9
+	pxor	%xmm7,%xmm12
+
+	pxor	%xmm12,%xmm9
+	pxor	%xmm12,%xmm8
+
+	pand	%xmm7,%xmm9
+
+	pxor	%xmm9,%xmm13
+	pxor	%xmm9,%xmm8
+
+	pand	%xmm14,%xmm13
+
+	pxor	%xmm11,%xmm13
+	movdqa	%xmm5,%xmm11
+	movdqa	%xmm4,%xmm7
+	movdqa	%xmm14,%xmm9
+	pxor	%xmm13,%xmm9
+	pand	%xmm5,%xmm9
+	pxor	%xmm4,%xmm5
+	pand	%xmm14,%xmm4
+	pand	%xmm13,%xmm5
+	pxor	%xmm4,%xmm5
+	pxor	%xmm9,%xmm4
+	pxor	%xmm15,%xmm11
+	pxor	%xmm2,%xmm7
+	pxor	%xmm12,%xmm14
+	pxor	%xmm8,%xmm13
+	movdqa	%xmm14,%xmm10
+	movdqa	%xmm12,%xmm9
+	pxor	%xmm13,%xmm10
+	pxor	%xmm8,%xmm9
+	pand	%xmm11,%xmm10
+	pand	%xmm15,%xmm9
+	pxor	%xmm7,%xmm11
+	pxor	%xmm2,%xmm15
+	pand	%xmm14,%xmm7
+	pand	%xmm12,%xmm2
+	pand	%xmm13,%xmm11
+	pand	%xmm8,%xmm15
+	pxor	%xmm11,%xmm7
+	pxor	%xmm2,%xmm15
+	pxor	%xmm10,%xmm11
+	pxor	%xmm9,%xmm2
+	pxor	%xmm11,%xmm5
+	pxor	%xmm11,%xmm15
+	pxor	%xmm7,%xmm4
+	pxor	%xmm7,%xmm2
+
+	movdqa	%xmm6,%xmm11
+	movdqa	%xmm0,%xmm7
+	pxor	%xmm3,%xmm11
+	pxor	%xmm1,%xmm7
+	movdqa	%xmm14,%xmm10
+	movdqa	%xmm12,%xmm9
+	pxor	%xmm13,%xmm10
+	pxor	%xmm8,%xmm9
+	pand	%xmm11,%xmm10
+	pand	%xmm3,%xmm9
+	pxor	%xmm7,%xmm11
+	pxor	%xmm1,%xmm3
+	pand	%xmm14,%xmm7
+	pand	%xmm12,%xmm1
+	pand	%xmm13,%xmm11
+	pand	%xmm8,%xmm3
+	pxor	%xmm11,%xmm7
+	pxor	%xmm1,%xmm3
+	pxor	%xmm10,%xmm11
+	pxor	%xmm9,%xmm1
+	pxor	%xmm12,%xmm14
+	pxor	%xmm8,%xmm13
+	movdqa	%xmm14,%xmm10
+	pxor	%xmm13,%xmm10
+	pand	%xmm6,%xmm10
+	pxor	%xmm0,%xmm6
+	pand	%xmm14,%xmm0
+	pand	%xmm13,%xmm6
+	pxor	%xmm0,%xmm6
+	pxor	%xmm10,%xmm0
+	pxor	%xmm11,%xmm6
+	pxor	%xmm11,%xmm3
+	pxor	%xmm7,%xmm0
+	pxor	%xmm7,%xmm1
+	pxor	%xmm15,%xmm6
+	pxor	%xmm5,%xmm0
+	pxor	%xmm6,%xmm3
+	pxor	%xmm15,%xmm5
+	pxor	%xmm0,%xmm15
+
+	pxor	%xmm4,%xmm0
+	pxor	%xmm1,%xmm4
+	pxor	%xmm2,%xmm1
+	pxor	%xmm4,%xmm2
+	pxor	%xmm4,%xmm3
+
+	pxor	%xmm2,%xmm5
+	decl	%r10d
+	jl	L$enc_done
+	pshufd	$147,%xmm15,%xmm7
+	pshufd	$147,%xmm0,%xmm8
+	pxor	%xmm7,%xmm15
+	pshufd	$147,%xmm3,%xmm9
+	pxor	%xmm8,%xmm0
+	pshufd	$147,%xmm5,%xmm10
+	pxor	%xmm9,%xmm3
+	pshufd	$147,%xmm2,%xmm11
+	pxor	%xmm10,%xmm5
+	pshufd	$147,%xmm6,%xmm12
+	pxor	%xmm11,%xmm2
+	pshufd	$147,%xmm1,%xmm13
+	pxor	%xmm12,%xmm6
+	pshufd	$147,%xmm4,%xmm14
+	pxor	%xmm13,%xmm1
+	pxor	%xmm14,%xmm4
+
+	pxor	%xmm15,%xmm8
+	pxor	%xmm4,%xmm7
+	pxor	%xmm4,%xmm8
+	pshufd	$78,%xmm15,%xmm15
+	pxor	%xmm0,%xmm9
+	pshufd	$78,%xmm0,%xmm0
+	pxor	%xmm2,%xmm12
+	pxor	%xmm7,%xmm15
+	pxor	%xmm6,%xmm13
+	pxor	%xmm8,%xmm0
+	pxor	%xmm5,%xmm11
+	pshufd	$78,%xmm2,%xmm7
+	pxor	%xmm1,%xmm14
+	pshufd	$78,%xmm6,%xmm8
+	pxor	%xmm3,%xmm10
+	pshufd	$78,%xmm5,%xmm2
+	pxor	%xmm4,%xmm10
+	pshufd	$78,%xmm4,%xmm6
+	pxor	%xmm4,%xmm11
+	pshufd	$78,%xmm1,%xmm5
+	pxor	%xmm11,%xmm7
+	pshufd	$78,%xmm3,%xmm1
+	pxor	%xmm12,%xmm8
+	pxor	%xmm10,%xmm2
+	pxor	%xmm14,%xmm6
+	pxor	%xmm13,%xmm5
+	movdqa	%xmm7,%xmm3
+	pxor	%xmm9,%xmm1
+	movdqa	%xmm8,%xmm4
+	movdqa	48(%r11),%xmm7
+	jnz	L$enc_loop
+	movdqa	64(%r11),%xmm7
+	jmp	L$enc_loop
+.p2align	4
+L$enc_done:
+	movdqa	0(%r11),%xmm7
+	movdqa	16(%r11),%xmm8
+	movdqa	%xmm1,%xmm9
+	psrlq	$1,%xmm1
+	movdqa	%xmm2,%xmm10
+	psrlq	$1,%xmm2
+	pxor	%xmm4,%xmm1
+	pxor	%xmm6,%xmm2
+	pand	%xmm7,%xmm1
+	pand	%xmm7,%xmm2
+	pxor	%xmm1,%xmm4
+	psllq	$1,%xmm1
+	pxor	%xmm2,%xmm6
+	psllq	$1,%xmm2
+	pxor	%xmm9,%xmm1
+	pxor	%xmm10,%xmm2
+	movdqa	%xmm3,%xmm9
+	psrlq	$1,%xmm3
+	movdqa	%xmm15,%xmm10
+	psrlq	$1,%xmm15
+	pxor	%xmm5,%xmm3
+	pxor	%xmm0,%xmm15
+	pand	%xmm7,%xmm3
+	pand	%xmm7,%xmm15
+	pxor	%xmm3,%xmm5
+	psllq	$1,%xmm3
+	pxor	%xmm15,%xmm0
+	psllq	$1,%xmm15
+	pxor	%xmm9,%xmm3
+	pxor	%xmm10,%xmm15
+	movdqa	32(%r11),%xmm7
+	movdqa	%xmm6,%xmm9
+	psrlq	$2,%xmm6
+	movdqa	%xmm2,%xmm10
+	psrlq	$2,%xmm2
+	pxor	%xmm4,%xmm6
+	pxor	%xmm1,%xmm2
+	pand	%xmm8,%xmm6
+	pand	%xmm8,%xmm2
+	pxor	%xmm6,%xmm4
+	psllq	$2,%xmm6
+	pxor	%xmm2,%xmm1
+	psllq	$2,%xmm2
+	pxor	%xmm9,%xmm6
+	pxor	%xmm10,%xmm2
+	movdqa	%xmm0,%xmm9
+	psrlq	$2,%xmm0
+	movdqa	%xmm15,%xmm10
+	psrlq	$2,%xmm15
+	pxor	%xmm5,%xmm0
+	pxor	%xmm3,%xmm15
+	pand	%xmm8,%xmm0
+	pand	%xmm8,%xmm15
+	pxor	%xmm0,%xmm5
+	psllq	$2,%xmm0
+	pxor	%xmm15,%xmm3
+	psllq	$2,%xmm15
+	pxor	%xmm9,%xmm0
+	pxor	%xmm10,%xmm15
+	movdqa	%xmm5,%xmm9
+	psrlq	$4,%xmm5
+	movdqa	%xmm3,%xmm10
+	psrlq	$4,%xmm3
+	pxor	%xmm4,%xmm5
+	pxor	%xmm1,%xmm3
+	pand	%xmm7,%xmm5
+	pand	%xmm7,%xmm3
+	pxor	%xmm5,%xmm4
+	psllq	$4,%xmm5
+	pxor	%xmm3,%xmm1
+	psllq	$4,%xmm3
+	pxor	%xmm9,%xmm5
+	pxor	%xmm10,%xmm3
+	movdqa	%xmm0,%xmm9
+	psrlq	$4,%xmm0
+	movdqa	%xmm15,%xmm10
+	psrlq	$4,%xmm15
+	pxor	%xmm6,%xmm0
+	pxor	%xmm2,%xmm15
+	pand	%xmm7,%xmm0
+	pand	%xmm7,%xmm15
+	pxor	%xmm0,%xmm6
+	psllq	$4,%xmm0
+	pxor	%xmm15,%xmm2
+	psllq	$4,%xmm15
+	pxor	%xmm9,%xmm0
+	pxor	%xmm10,%xmm15
+	movdqa	(%rax),%xmm7
+	pxor	%xmm7,%xmm3
+	pxor	%xmm7,%xmm5
+	pxor	%xmm7,%xmm2
+	pxor	%xmm7,%xmm6
+	pxor	%xmm7,%xmm1
+	pxor	%xmm7,%xmm4
+	pxor	%xmm7,%xmm15
+	pxor	%xmm7,%xmm0
+	.byte	0xf3,0xc3
+
+
+
+.p2align	6
+_bsaes_decrypt8:
+	leaq	L$BS0(%rip),%r11
+
+	movdqa	(%rax),%xmm8
+	leaq	16(%rax),%rax
+	movdqa	-48(%r11),%xmm7
+	pxor	%xmm8,%xmm15
+	pxor	%xmm8,%xmm0
+	pxor	%xmm8,%xmm1
+	pxor	%xmm8,%xmm2
+.byte	102,68,15,56,0,255
+.byte	102,15,56,0,199
+	pxor	%xmm8,%xmm3
+	pxor	%xmm8,%xmm4
+.byte	102,15,56,0,207
+.byte	102,15,56,0,215
+	pxor	%xmm8,%xmm5
+	pxor	%xmm8,%xmm6
+.byte	102,15,56,0,223
+.byte	102,15,56,0,231
+.byte	102,15,56,0,239
+.byte	102,15,56,0,247
+	movdqa	0(%r11),%xmm7
+	movdqa	16(%r11),%xmm8
+	movdqa	%xmm5,%xmm9
+	psrlq	$1,%xmm5
+	movdqa	%xmm3,%xmm10
+	psrlq	$1,%xmm3
+	pxor	%xmm6,%xmm5
+	pxor	%xmm4,%xmm3
+	pand	%xmm7,%xmm5
+	pand	%xmm7,%xmm3
+	pxor	%xmm5,%xmm6
+	psllq	$1,%xmm5
+	pxor	%xmm3,%xmm4
+	psllq	$1,%xmm3
+	pxor	%xmm9,%xmm5
+	pxor	%xmm10,%xmm3
+	movdqa	%xmm1,%xmm9
+	psrlq	$1,%xmm1
+	movdqa	%xmm15,%xmm10
+	psrlq	$1,%xmm15
+	pxor	%xmm2,%xmm1
+	pxor	%xmm0,%xmm15
+	pand	%xmm7,%xmm1
+	pand	%xmm7,%xmm15
+	pxor	%xmm1,%xmm2
+	psllq	$1,%xmm1
+	pxor	%xmm15,%xmm0
+	psllq	$1,%xmm15
+	pxor	%xmm9,%xmm1
+	pxor	%xmm10,%xmm15
+	movdqa	32(%r11),%xmm7
+	movdqa	%xmm4,%xmm9
+	psrlq	$2,%xmm4
+	movdqa	%xmm3,%xmm10
+	psrlq	$2,%xmm3
+	pxor	%xmm6,%xmm4
+	pxor	%xmm5,%xmm3
+	pand	%xmm8,%xmm4
+	pand	%xmm8,%xmm3
+	pxor	%xmm4,%xmm6
+	psllq	$2,%xmm4
+	pxor	%xmm3,%xmm5
+	psllq	$2,%xmm3
+	pxor	%xmm9,%xmm4
+	pxor	%xmm10,%xmm3
+	movdqa	%xmm0,%xmm9
+	psrlq	$2,%xmm0
+	movdqa	%xmm15,%xmm10
+	psrlq	$2,%xmm15
+	pxor	%xmm2,%xmm0
+	pxor	%xmm1,%xmm15
+	pand	%xmm8,%xmm0
+	pand	%xmm8,%xmm15
+	pxor	%xmm0,%xmm2
+	psllq	$2,%xmm0
+	pxor	%xmm15,%xmm1
+	psllq	$2,%xmm15
+	pxor	%xmm9,%xmm0
+	pxor	%xmm10,%xmm15
+	movdqa	%xmm2,%xmm9
+	psrlq	$4,%xmm2
+	movdqa	%xmm1,%xmm10
+	psrlq	$4,%xmm1
+	pxor	%xmm6,%xmm2
+	pxor	%xmm5,%xmm1
+	pand	%xmm7,%xmm2
+	pand	%xmm7,%xmm1
+	pxor	%xmm2,%xmm6
+	psllq	$4,%xmm2
+	pxor	%xmm1,%xmm5
+	psllq	$4,%xmm1
+	pxor	%xmm9,%xmm2
+	pxor	%xmm10,%xmm1
+	movdqa	%xmm0,%xmm9
+	psrlq	$4,%xmm0
+	movdqa	%xmm15,%xmm10
+	psrlq	$4,%xmm15
+	pxor	%xmm4,%xmm0
+	pxor	%xmm3,%xmm15
+	pand	%xmm7,%xmm0
+	pand	%xmm7,%xmm15
+	pxor	%xmm0,%xmm4
+	psllq	$4,%xmm0
+	pxor	%xmm15,%xmm3
+	psllq	$4,%xmm15
+	pxor	%xmm9,%xmm0
+	pxor	%xmm10,%xmm15
+	decl	%r10d
+	jmp	L$dec_sbox
+.p2align	4
+L$dec_loop:
+	pxor	0(%rax),%xmm15
+	pxor	16(%rax),%xmm0
+	pxor	32(%rax),%xmm1
+	pxor	48(%rax),%xmm2
+.byte	102,68,15,56,0,255
+.byte	102,15,56,0,199
+	pxor	64(%rax),%xmm3
+	pxor	80(%rax),%xmm4
+.byte	102,15,56,0,207
+.byte	102,15,56,0,215
+	pxor	96(%rax),%xmm5
+	pxor	112(%rax),%xmm6
+.byte	102,15,56,0,223
+.byte	102,15,56,0,231
+.byte	102,15,56,0,239
+.byte	102,15,56,0,247
+	leaq	128(%rax),%rax
+L$dec_sbox:
+	pxor	%xmm3,%xmm2
+
+	pxor	%xmm6,%xmm3
+	pxor	%xmm6,%xmm1
+	pxor	%xmm3,%xmm5
+	pxor	%xmm5,%xmm6
+	pxor	%xmm6,%xmm0
+
+	pxor	%xmm0,%xmm15
+	pxor	%xmm4,%xmm1
+	pxor	%xmm15,%xmm2
+	pxor	%xmm15,%xmm4
+	pxor	%xmm2,%xmm0
+	movdqa	%xmm2,%xmm10
+	movdqa	%xmm6,%xmm9
+	movdqa	%xmm0,%xmm8
+	movdqa	%xmm3,%xmm12
+	movdqa	%xmm4,%xmm11
+
+	pxor	%xmm15,%xmm10
+	pxor	%xmm3,%xmm9
+	pxor	%xmm5,%xmm8
+	movdqa	%xmm10,%xmm13
+	pxor	%xmm15,%xmm12
+	movdqa	%xmm9,%xmm7
+	pxor	%xmm1,%xmm11
+	movdqa	%xmm10,%xmm14
+
+	por	%xmm8,%xmm9
+	por	%xmm11,%xmm10
+	pxor	%xmm7,%xmm14
+	pand	%xmm11,%xmm13
+	pxor	%xmm8,%xmm11
+	pand	%xmm8,%xmm7
+	pand	%xmm11,%xmm14
+	movdqa	%xmm5,%xmm11
+	pxor	%xmm1,%xmm11
+	pand	%xmm11,%xmm12
+	pxor	%xmm12,%xmm10
+	pxor	%xmm12,%xmm9
+	movdqa	%xmm2,%xmm12
+	movdqa	%xmm0,%xmm11
+	pxor	%xmm6,%xmm12
+	pxor	%xmm4,%xmm11
+	movdqa	%xmm12,%xmm8
+	pand	%xmm11,%xmm12
+	por	%xmm11,%xmm8
+	pxor	%xmm12,%xmm7
+	pxor	%xmm14,%xmm10
+	pxor	%xmm13,%xmm9
+	pxor	%xmm14,%xmm8
+	movdqa	%xmm3,%xmm11
+	pxor	%xmm13,%xmm7
+	movdqa	%xmm15,%xmm12
+	pxor	%xmm13,%xmm8
+	movdqa	%xmm6,%xmm13
+	pand	%xmm5,%xmm11
+	movdqa	%xmm2,%xmm14
+	pand	%xmm1,%xmm12
+	pand	%xmm0,%xmm13
+	por	%xmm4,%xmm14
+	pxor	%xmm11,%xmm10
+	pxor	%xmm12,%xmm9
+	pxor	%xmm13,%xmm8
+	pxor	%xmm14,%xmm7
+
+
+
+
+
+	movdqa	%xmm10,%xmm11
+	pand	%xmm8,%xmm10
+	pxor	%xmm9,%xmm11
+
+	movdqa	%xmm7,%xmm13
+	movdqa	%xmm11,%xmm14
+	pxor	%xmm10,%xmm13
+	pand	%xmm13,%xmm14
+
+	movdqa	%xmm8,%xmm12
+	pxor	%xmm9,%xmm14
+	pxor	%xmm7,%xmm12
+
+	pxor	%xmm9,%xmm10
+
+	pand	%xmm10,%xmm12
+
+	movdqa	%xmm13,%xmm9
+	pxor	%xmm7,%xmm12
+
+	pxor	%xmm12,%xmm9
+	pxor	%xmm12,%xmm8
+
+	pand	%xmm7,%xmm9
+
+	pxor	%xmm9,%xmm13
+	pxor	%xmm9,%xmm8
+
+	pand	%xmm14,%xmm13
+
+	pxor	%xmm11,%xmm13
+	movdqa	%xmm4,%xmm11
+	movdqa	%xmm0,%xmm7
+	movdqa	%xmm14,%xmm9
+	pxor	%xmm13,%xmm9
+	pand	%xmm4,%xmm9
+	pxor	%xmm0,%xmm4
+	pand	%xmm14,%xmm0
+	pand	%xmm13,%xmm4
+	pxor	%xmm0,%xmm4
+	pxor	%xmm9,%xmm0
+	pxor	%xmm1,%xmm11
+	pxor	%xmm5,%xmm7
+	pxor	%xmm12,%xmm14
+	pxor	%xmm8,%xmm13
+	movdqa	%xmm14,%xmm10
+	movdqa	%xmm12,%xmm9
+	pxor	%xmm13,%xmm10
+	pxor	%xmm8,%xmm9
+	pand	%xmm11,%xmm10
+	pand	%xmm1,%xmm9
+	pxor	%xmm7,%xmm11
+	pxor	%xmm5,%xmm1
+	pand	%xmm14,%xmm7
+	pand	%xmm12,%xmm5
+	pand	%xmm13,%xmm11
+	pand	%xmm8,%xmm1
+	pxor	%xmm11,%xmm7
+	pxor	%xmm5,%xmm1
+	pxor	%xmm10,%xmm11
+	pxor	%xmm9,%xmm5
+	pxor	%xmm11,%xmm4
+	pxor	%xmm11,%xmm1
+	pxor	%xmm7,%xmm0
+	pxor	%xmm7,%xmm5
+
+	movdqa	%xmm2,%xmm11
+	movdqa	%xmm6,%xmm7
+	pxor	%xmm15,%xmm11
+	pxor	%xmm3,%xmm7
+	movdqa	%xmm14,%xmm10
+	movdqa	%xmm12,%xmm9
+	pxor	%xmm13,%xmm10
+	pxor	%xmm8,%xmm9
+	pand	%xmm11,%xmm10
+	pand	%xmm15,%xmm9
+	pxor	%xmm7,%xmm11
+	pxor	%xmm3,%xmm15
+	pand	%xmm14,%xmm7
+	pand	%xmm12,%xmm3
+	pand	%xmm13,%xmm11
+	pand	%xmm8,%xmm15
+	pxor	%xmm11,%xmm7
+	pxor	%xmm3,%xmm15
+	pxor	%xmm10,%xmm11
+	pxor	%xmm9,%xmm3
+	pxor	%xmm12,%xmm14
+	pxor	%xmm8,%xmm13
+	movdqa	%xmm14,%xmm10
+	pxor	%xmm13,%xmm10
+	pand	%xmm2,%xmm10
+	pxor	%xmm6,%xmm2
+	pand	%xmm14,%xmm6
+	pand	%xmm13,%xmm2
+	pxor	%xmm6,%xmm2
+	pxor	%xmm10,%xmm6
+	pxor	%xmm11,%xmm2
+	pxor	%xmm11,%xmm15
+	pxor	%xmm7,%xmm6
+	pxor	%xmm7,%xmm3
+	pxor	%xmm6,%xmm0
+	pxor	%xmm4,%xmm5
+
+	pxor	%xmm0,%xmm3
+	pxor	%xmm6,%xmm1
+	pxor	%xmm6,%xmm4
+	pxor	%xmm1,%xmm3
+	pxor	%xmm15,%xmm6
+	pxor	%xmm4,%xmm3
+	pxor	%xmm5,%xmm2
+	pxor	%xmm0,%xmm5
+	pxor	%xmm3,%xmm2
+
+	pxor	%xmm15,%xmm3
+	pxor	%xmm2,%xmm6
+	decl	%r10d
+	jl	L$dec_done
+
+	pshufd	$78,%xmm15,%xmm7
+	pshufd	$78,%xmm2,%xmm13
+	pxor	%xmm15,%xmm7
+	pshufd	$78,%xmm4,%xmm14
+	pxor	%xmm2,%xmm13
+	pshufd	$78,%xmm0,%xmm8
+	pxor	%xmm4,%xmm14
+	pshufd	$78,%xmm5,%xmm9
+	pxor	%xmm0,%xmm8
+	pshufd	$78,%xmm3,%xmm10
+	pxor	%xmm5,%xmm9
+	pxor	%xmm13,%xmm15
+	pxor	%xmm13,%xmm0
+	pshufd	$78,%xmm1,%xmm11
+	pxor	%xmm3,%xmm10
+	pxor	%xmm7,%xmm5
+	pxor	%xmm8,%xmm3
+	pshufd	$78,%xmm6,%xmm12
+	pxor	%xmm1,%xmm11
+	pxor	%xmm14,%xmm0
+	pxor	%xmm9,%xmm1
+	pxor	%xmm6,%xmm12
+
+	pxor	%xmm14,%xmm5
+	pxor	%xmm13,%xmm3
+	pxor	%xmm13,%xmm1
+	pxor	%xmm10,%xmm6
+	pxor	%xmm11,%xmm2
+	pxor	%xmm14,%xmm1
+	pxor	%xmm14,%xmm6
+	pxor	%xmm12,%xmm4
+	pshufd	$147,%xmm15,%xmm7
+	pshufd	$147,%xmm0,%xmm8
+	pxor	%xmm7,%xmm15
+	pshufd	$147,%xmm5,%xmm9
+	pxor	%xmm8,%xmm0
+	pshufd	$147,%xmm3,%xmm10
+	pxor	%xmm9,%xmm5
+	pshufd	$147,%xmm1,%xmm11
+	pxor	%xmm10,%xmm3
+	pshufd	$147,%xmm6,%xmm12
+	pxor	%xmm11,%xmm1
+	pshufd	$147,%xmm2,%xmm13
+	pxor	%xmm12,%xmm6
+	pshufd	$147,%xmm4,%xmm14
+	pxor	%xmm13,%xmm2
+	pxor	%xmm14,%xmm4
+
+	pxor	%xmm15,%xmm8
+	pxor	%xmm4,%xmm7
+	pxor	%xmm4,%xmm8
+	pshufd	$78,%xmm15,%xmm15
+	pxor	%xmm0,%xmm9
+	pshufd	$78,%xmm0,%xmm0
+	pxor	%xmm1,%xmm12
+	pxor	%xmm7,%xmm15
+	pxor	%xmm6,%xmm13
+	pxor	%xmm8,%xmm0
+	pxor	%xmm3,%xmm11
+	pshufd	$78,%xmm1,%xmm7
+	pxor	%xmm2,%xmm14
+	pshufd	$78,%xmm6,%xmm8
+	pxor	%xmm5,%xmm10
+	pshufd	$78,%xmm3,%xmm1
+	pxor	%xmm4,%xmm10
+	pshufd	$78,%xmm4,%xmm6
+	pxor	%xmm4,%xmm11
+	pshufd	$78,%xmm2,%xmm3
+	pxor	%xmm11,%xmm7
+	pshufd	$78,%xmm5,%xmm2
+	pxor	%xmm12,%xmm8
+	pxor	%xmm1,%xmm10
+	pxor	%xmm14,%xmm6
+	pxor	%xmm3,%xmm13
+	movdqa	%xmm7,%xmm3
+	pxor	%xmm9,%xmm2
+	movdqa	%xmm13,%xmm5
+	movdqa	%xmm8,%xmm4
+	movdqa	%xmm2,%xmm1
+	movdqa	%xmm10,%xmm2
+	movdqa	-16(%r11),%xmm7
+	jnz	L$dec_loop
+	movdqa	-32(%r11),%xmm7
+	jmp	L$dec_loop
+.p2align	4
+L$dec_done:
+	movdqa	0(%r11),%xmm7
+	movdqa	16(%r11),%xmm8
+	movdqa	%xmm2,%xmm9
+	psrlq	$1,%xmm2
+	movdqa	%xmm1,%xmm10
+	psrlq	$1,%xmm1
+	pxor	%xmm4,%xmm2
+	pxor	%xmm6,%xmm1
+	pand	%xmm7,%xmm2
+	pand	%xmm7,%xmm1
+	pxor	%xmm2,%xmm4
+	psllq	$1,%xmm2
+	pxor	%xmm1,%xmm6
+	psllq	$1,%xmm1
+	pxor	%xmm9,%xmm2
+	pxor	%xmm10,%xmm1
+	movdqa	%xmm5,%xmm9
+	psrlq	$1,%xmm5
+	movdqa	%xmm15,%xmm10
+	psrlq	$1,%xmm15
+	pxor	%xmm3,%xmm5
+	pxor	%xmm0,%xmm15
+	pand	%xmm7,%xmm5
+	pand	%xmm7,%xmm15
+	pxor	%xmm5,%xmm3
+	psllq	$1,%xmm5
+	pxor	%xmm15,%xmm0
+	psllq	$1,%xmm15
+	pxor	%xmm9,%xmm5
+	pxor	%xmm10,%xmm15
+	movdqa	32(%r11),%xmm7
+	movdqa	%xmm6,%xmm9
+	psrlq	$2,%xmm6
+	movdqa	%xmm1,%xmm10
+	psrlq	$2,%xmm1
+	pxor	%xmm4,%xmm6
+	pxor	%xmm2,%xmm1
+	pand	%xmm8,%xmm6
+	pand	%xmm8,%xmm1
+	pxor	%xmm6,%xmm4
+	psllq	$2,%xmm6
+	pxor	%xmm1,%xmm2
+	psllq	$2,%xmm1
+	pxor	%xmm9,%xmm6
+	pxor	%xmm10,%xmm1
+	movdqa	%xmm0,%xmm9
+	psrlq	$2,%xmm0
+	movdqa	%xmm15,%xmm10
+	psrlq	$2,%xmm15
+	pxor	%xmm3,%xmm0
+	pxor	%xmm5,%xmm15
+	pand	%xmm8,%xmm0
+	pand	%xmm8,%xmm15
+	pxor	%xmm0,%xmm3
+	psllq	$2,%xmm0
+	pxor	%xmm15,%xmm5
+	psllq	$2,%xmm15
+	pxor	%xmm9,%xmm0
+	pxor	%xmm10,%xmm15
+	movdqa	%xmm3,%xmm9
+	psrlq	$4,%xmm3
+	movdqa	%xmm5,%xmm10
+	psrlq	$4,%xmm5
+	pxor	%xmm4,%xmm3
+	pxor	%xmm2,%xmm5
+	pand	%xmm7,%xmm3
+	pand	%xmm7,%xmm5
+	pxor	%xmm3,%xmm4
+	psllq	$4,%xmm3
+	pxor	%xmm5,%xmm2
+	psllq	$4,%xmm5
+	pxor	%xmm9,%xmm3
+	pxor	%xmm10,%xmm5
+	movdqa	%xmm0,%xmm9
+	psrlq	$4,%xmm0
+	movdqa	%xmm15,%xmm10
+	psrlq	$4,%xmm15
+	pxor	%xmm6,%xmm0
+	pxor	%xmm1,%xmm15
+	pand	%xmm7,%xmm0
+	pand	%xmm7,%xmm15
+	pxor	%xmm0,%xmm6
+	psllq	$4,%xmm0
+	pxor	%xmm15,%xmm1
+	psllq	$4,%xmm15
+	pxor	%xmm9,%xmm0
+	pxor	%xmm10,%xmm15
+	movdqa	(%rax),%xmm7
+	pxor	%xmm7,%xmm5
+	pxor	%xmm7,%xmm3
+	pxor	%xmm7,%xmm1
+	pxor	%xmm7,%xmm6
+	pxor	%xmm7,%xmm2
+	pxor	%xmm7,%xmm4
+	pxor	%xmm7,%xmm15
+	pxor	%xmm7,%xmm0
+	.byte	0xf3,0xc3
+
+
+.p2align	4
+_bsaes_key_convert:
+	leaq	L$masks(%rip),%r11
+	movdqu	(%rcx),%xmm7
+	leaq	16(%rcx),%rcx
+	movdqa	0(%r11),%xmm0
+	movdqa	16(%r11),%xmm1
+	movdqa	32(%r11),%xmm2
+	movdqa	48(%r11),%xmm3
+	movdqa	64(%r11),%xmm4
+	pcmpeqd	%xmm5,%xmm5
+
+	movdqu	(%rcx),%xmm6
+	movdqa	%xmm7,(%rax)
+	leaq	16(%rax),%rax
+	decl	%r10d
+	jmp	L$key_loop
+.p2align	4
+L$key_loop:
+.byte	102,15,56,0,244
+
+	movdqa	%xmm0,%xmm8
+	movdqa	%xmm1,%xmm9
+
+	pand	%xmm6,%xmm8
+	pand	%xmm6,%xmm9
+	movdqa	%xmm2,%xmm10
+	pcmpeqb	%xmm0,%xmm8
+	psllq	$4,%xmm0
+	movdqa	%xmm3,%xmm11
+	pcmpeqb	%xmm1,%xmm9
+	psllq	$4,%xmm1
+
+	pand	%xmm6,%xmm10
+	pand	%xmm6,%xmm11
+	movdqa	%xmm0,%xmm12
+	pcmpeqb	%xmm2,%xmm10
+	psllq	$4,%xmm2
+	movdqa	%xmm1,%xmm13
+	pcmpeqb	%xmm3,%xmm11
+	psllq	$4,%xmm3
+
+	movdqa	%xmm2,%xmm14
+	movdqa	%xmm3,%xmm15
+	pxor	%xmm5,%xmm8
+	pxor	%xmm5,%xmm9
+
+	pand	%xmm6,%xmm12
+	pand	%xmm6,%xmm13
+	movdqa	%xmm8,0(%rax)
+	pcmpeqb	%xmm0,%xmm12
+	psrlq	$4,%xmm0
+	movdqa	%xmm9,16(%rax)
+	pcmpeqb	%xmm1,%xmm13
+	psrlq	$4,%xmm1
+	leaq	16(%rcx),%rcx
+
+	pand	%xmm6,%xmm14
+	pand	%xmm6,%xmm15
+	movdqa	%xmm10,32(%rax)
+	pcmpeqb	%xmm2,%xmm14
+	psrlq	$4,%xmm2
+	movdqa	%xmm11,48(%rax)
+	pcmpeqb	%xmm3,%xmm15
+	psrlq	$4,%xmm3
+	movdqu	(%rcx),%xmm6
+
+	pxor	%xmm5,%xmm13
+	pxor	%xmm5,%xmm14
+	movdqa	%xmm12,64(%rax)
+	movdqa	%xmm13,80(%rax)
+	movdqa	%xmm14,96(%rax)
+	movdqa	%xmm15,112(%rax)
+	leaq	128(%rax),%rax
+	decl	%r10d
+	jnz	L$key_loop
+
+	movdqa	80(%r11),%xmm7
+
+	.byte	0xf3,0xc3
+
+
+.globl	_bsaes_cbc_encrypt
+.private_extern _bsaes_cbc_encrypt
+
+.p2align	4
+_bsaes_cbc_encrypt:
+	cmpl	$0,%r9d
+	jne	_asm_AES_cbc_encrypt
+	cmpq	$128,%rdx
+	jb	_asm_AES_cbc_encrypt
+
+	movq	%rsp,%rax
+L$cbc_dec_prologue:
+	pushq	%rbp
+	pushq	%rbx
+	pushq	%r12
+	pushq	%r13
+	pushq	%r14
+	pushq	%r15
+	leaq	-72(%rsp),%rsp
+	movq	%rsp,%rbp
+	movl	240(%rcx),%eax
+	movq	%rdi,%r12
+	movq	%rsi,%r13
+	movq	%rdx,%r14
+	movq	%rcx,%r15
+	movq	%r8,%rbx
+	shrq	$4,%r14
+
+	movl	%eax,%edx
+	shlq	$7,%rax
+	subq	$96,%rax
+	subq	%rax,%rsp
+
+	movq	%rsp,%rax
+	movq	%r15,%rcx
+	movl	%edx,%r10d
+	call	_bsaes_key_convert
+	pxor	(%rsp),%xmm7
+	movdqa	%xmm6,(%rax)
+	movdqa	%xmm7,(%rsp)
+
+	movdqu	(%rbx),%xmm14
+	subq	$8,%r14
+L$cbc_dec_loop:
+	movdqu	0(%r12),%xmm15
+	movdqu	16(%r12),%xmm0
+	movdqu	32(%r12),%xmm1
+	movdqu	48(%r12),%xmm2
+	movdqu	64(%r12),%xmm3
+	movdqu	80(%r12),%xmm4
+	movq	%rsp,%rax
+	movdqu	96(%r12),%xmm5
+	movl	%edx,%r10d
+	movdqu	112(%r12),%xmm6
+	movdqa	%xmm14,32(%rbp)
+
+	call	_bsaes_decrypt8
+
+	pxor	32(%rbp),%xmm15
+	movdqu	0(%r12),%xmm7
+	movdqu	16(%r12),%xmm8
+	pxor	%xmm7,%xmm0
+	movdqu	32(%r12),%xmm9
+	pxor	%xmm8,%xmm5
+	movdqu	48(%r12),%xmm10
+	pxor	%xmm9,%xmm3
+	movdqu	64(%r12),%xmm11
+	pxor	%xmm10,%xmm1
+	movdqu	80(%r12),%xmm12
+	pxor	%xmm11,%xmm6
+	movdqu	96(%r12),%xmm13
+	pxor	%xmm12,%xmm2
+	movdqu	112(%r12),%xmm14
+	pxor	%xmm13,%xmm4
+	movdqu	%xmm15,0(%r13)
+	leaq	128(%r12),%r12
+	movdqu	%xmm0,16(%r13)
+	movdqu	%xmm5,32(%r13)
+	movdqu	%xmm3,48(%r13)
+	movdqu	%xmm1,64(%r13)
+	movdqu	%xmm6,80(%r13)
+	movdqu	%xmm2,96(%r13)
+	movdqu	%xmm4,112(%r13)
+	leaq	128(%r13),%r13
+	subq	$8,%r14
+	jnc	L$cbc_dec_loop
+
+	addq	$8,%r14
+	jz	L$cbc_dec_done
+
+	movdqu	0(%r12),%xmm15
+	movq	%rsp,%rax
+	movl	%edx,%r10d
+	cmpq	$2,%r14
+	jb	L$cbc_dec_one
+	movdqu	16(%r12),%xmm0
+	je	L$cbc_dec_two
+	movdqu	32(%r12),%xmm1
+	cmpq	$4,%r14
+	jb	L$cbc_dec_three
+	movdqu	48(%r12),%xmm2
+	je	L$cbc_dec_four
+	movdqu	64(%r12),%xmm3
+	cmpq	$6,%r14
+	jb	L$cbc_dec_five
+	movdqu	80(%r12),%xmm4
+	je	L$cbc_dec_six
+	movdqu	96(%r12),%xmm5
+	movdqa	%xmm14,32(%rbp)
+	call	_bsaes_decrypt8
+	pxor	32(%rbp),%xmm15
+	movdqu	0(%r12),%xmm7
+	movdqu	16(%r12),%xmm8
+	pxor	%xmm7,%xmm0
+	movdqu	32(%r12),%xmm9
+	pxor	%xmm8,%xmm5
+	movdqu	48(%r12),%xmm10
+	pxor	%xmm9,%xmm3
+	movdqu	64(%r12),%xmm11
+	pxor	%xmm10,%xmm1
+	movdqu	80(%r12),%xmm12
+	pxor	%xmm11,%xmm6
+	movdqu	96(%r12),%xmm14
+	pxor	%xmm12,%xmm2
+	movdqu	%xmm15,0(%r13)
+	movdqu	%xmm0,16(%r13)
+	movdqu	%xmm5,32(%r13)
+	movdqu	%xmm3,48(%r13)
+	movdqu	%xmm1,64(%r13)
+	movdqu	%xmm6,80(%r13)
+	movdqu	%xmm2,96(%r13)
+	jmp	L$cbc_dec_done
+.p2align	4
+L$cbc_dec_six:
+	movdqa	%xmm14,32(%rbp)
+	call	_bsaes_decrypt8
+	pxor	32(%rbp),%xmm15
+	movdqu	0(%r12),%xmm7
+	movdqu	16(%r12),%xmm8
+	pxor	%xmm7,%xmm0
+	movdqu	32(%r12),%xmm9
+	pxor	%xmm8,%xmm5
+	movdqu	48(%r12),%xmm10
+	pxor	%xmm9,%xmm3
+	movdqu	64(%r12),%xmm11
+	pxor	%xmm10,%xmm1
+	movdqu	80(%r12),%xmm14
+	pxor	%xmm11,%xmm6
+	movdqu	%xmm15,0(%r13)
+	movdqu	%xmm0,16(%r13)
+	movdqu	%xmm5,32(%r13)
+	movdqu	%xmm3,48(%r13)
+	movdqu	%xmm1,64(%r13)
+	movdqu	%xmm6,80(%r13)
+	jmp	L$cbc_dec_done
+.p2align	4
+L$cbc_dec_five:
+	movdqa	%xmm14,32(%rbp)
+	call	_bsaes_decrypt8
+	pxor	32(%rbp),%xmm15
+	movdqu	0(%r12),%xmm7
+	movdqu	16(%r12),%xmm8
+	pxor	%xmm7,%xmm0
+	movdqu	32(%r12),%xmm9
+	pxor	%xmm8,%xmm5
+	movdqu	48(%r12),%xmm10
+	pxor	%xmm9,%xmm3
+	movdqu	64(%r12),%xmm14
+	pxor	%xmm10,%xmm1
+	movdqu	%xmm15,0(%r13)
+	movdqu	%xmm0,16(%r13)
+	movdqu	%xmm5,32(%r13)
+	movdqu	%xmm3,48(%r13)
+	movdqu	%xmm1,64(%r13)
+	jmp	L$cbc_dec_done
+.p2align	4
+L$cbc_dec_four:
+	movdqa	%xmm14,32(%rbp)
+	call	_bsaes_decrypt8
+	pxor	32(%rbp),%xmm15
+	movdqu	0(%r12),%xmm7
+	movdqu	16(%r12),%xmm8
+	pxor	%xmm7,%xmm0
+	movdqu	32(%r12),%xmm9
+	pxor	%xmm8,%xmm5
+	movdqu	48(%r12),%xmm14
+	pxor	%xmm9,%xmm3
+	movdqu	%xmm15,0(%r13)
+	movdqu	%xmm0,16(%r13)
+	movdqu	%xmm5,32(%r13)
+	movdqu	%xmm3,48(%r13)
+	jmp	L$cbc_dec_done
+.p2align	4
+L$cbc_dec_three:
+	movdqa	%xmm14,32(%rbp)
+	call	_bsaes_decrypt8
+	pxor	32(%rbp),%xmm15
+	movdqu	0(%r12),%xmm7
+	movdqu	16(%r12),%xmm8
+	pxor	%xmm7,%xmm0
+	movdqu	32(%r12),%xmm14
+	pxor	%xmm8,%xmm5
+	movdqu	%xmm15,0(%r13)
+	movdqu	%xmm0,16(%r13)
+	movdqu	%xmm5,32(%r13)
+	jmp	L$cbc_dec_done
+.p2align	4
+L$cbc_dec_two:
+	movdqa	%xmm14,32(%rbp)
+	call	_bsaes_decrypt8
+	pxor	32(%rbp),%xmm15
+	movdqu	0(%r12),%xmm7
+	movdqu	16(%r12),%xmm14
+	pxor	%xmm7,%xmm0
+	movdqu	%xmm15,0(%r13)
+	movdqu	%xmm0,16(%r13)
+	jmp	L$cbc_dec_done
+.p2align	4
+L$cbc_dec_one:
+	leaq	(%r12),%rdi
+	leaq	32(%rbp),%rsi
+	leaq	(%r15),%rdx
+	call	_asm_AES_decrypt
+	pxor	32(%rbp),%xmm14
+	movdqu	%xmm14,(%r13)
+	movdqa	%xmm15,%xmm14
+
+L$cbc_dec_done:
+	movdqu	%xmm14,(%rbx)
+	leaq	(%rsp),%rax
+	pxor	%xmm0,%xmm0
+L$cbc_dec_bzero:
+	movdqa	%xmm0,0(%rax)
+	movdqa	%xmm0,16(%rax)
+	leaq	32(%rax),%rax
+	cmpq	%rax,%rbp
+	ja	L$cbc_dec_bzero
+
+	leaq	(%rbp),%rsp
+	movq	72(%rsp),%r15
+	movq	80(%rsp),%r14
+	movq	88(%rsp),%r13
+	movq	96(%rsp),%r12
+	movq	104(%rsp),%rbx
+	movq	112(%rsp),%rax
+	leaq	120(%rsp),%rsp
+	movq	%rax,%rbp
+L$cbc_dec_epilogue:
+	.byte	0xf3,0xc3
+
+
+.globl	_bsaes_ctr32_encrypt_blocks
+.private_extern _bsaes_ctr32_encrypt_blocks
+
+.p2align	4
+_bsaes_ctr32_encrypt_blocks:
+	movq	%rsp,%rax
+L$ctr_enc_prologue:
+	pushq	%rbp
+	pushq	%rbx
+	pushq	%r12
+	pushq	%r13
+	pushq	%r14
+	pushq	%r15
+	leaq	-72(%rsp),%rsp
+	movq	%rsp,%rbp
+	movdqu	(%r8),%xmm0
+	movl	240(%rcx),%eax
+	movq	%rdi,%r12
+	movq	%rsi,%r13
+	movq	%rdx,%r14
+	movq	%rcx,%r15
+	movdqa	%xmm0,32(%rbp)
+	cmpq	$8,%rdx
+	jb	L$ctr_enc_short
+
+	movl	%eax,%ebx
+	shlq	$7,%rax
+	subq	$96,%rax
+	subq	%rax,%rsp
+
+	movq	%rsp,%rax
+	movq	%r15,%rcx
+	movl	%ebx,%r10d
+	call	_bsaes_key_convert
+	pxor	%xmm6,%xmm7
+	movdqa	%xmm7,(%rax)
+
+	movdqa	(%rsp),%xmm8
+	leaq	L$ADD1(%rip),%r11
+	movdqa	32(%rbp),%xmm15
+	movdqa	-32(%r11),%xmm7
+.byte	102,68,15,56,0,199
+.byte	102,68,15,56,0,255
+	movdqa	%xmm8,(%rsp)
+	jmp	L$ctr_enc_loop
+.p2align	4
+L$ctr_enc_loop:
+	movdqa	%xmm15,32(%rbp)
+	movdqa	%xmm15,%xmm0
+	movdqa	%xmm15,%xmm1
+	paddd	0(%r11),%xmm0
+	movdqa	%xmm15,%xmm2
+	paddd	16(%r11),%xmm1
+	movdqa	%xmm15,%xmm3
+	paddd	32(%r11),%xmm2
+	movdqa	%xmm15,%xmm4
+	paddd	48(%r11),%xmm3
+	movdqa	%xmm15,%xmm5
+	paddd	64(%r11),%xmm4
+	movdqa	%xmm15,%xmm6
+	paddd	80(%r11),%xmm5
+	paddd	96(%r11),%xmm6
+
+
+
+	movdqa	(%rsp),%xmm8
+	leaq	16(%rsp),%rax
+	movdqa	-16(%r11),%xmm7
+	pxor	%xmm8,%xmm15
+	pxor	%xmm8,%xmm0
+	pxor	%xmm8,%xmm1
+	pxor	%xmm8,%xmm2
+.byte	102,68,15,56,0,255
+.byte	102,15,56,0,199
+	pxor	%xmm8,%xmm3
+	pxor	%xmm8,%xmm4
+.byte	102,15,56,0,207
+.byte	102,15,56,0,215
+	pxor	%xmm8,%xmm5
+	pxor	%xmm8,%xmm6
+.byte	102,15,56,0,223
+.byte	102,15,56,0,231
+.byte	102,15,56,0,239
+.byte	102,15,56,0,247
+	leaq	L$BS0(%rip),%r11
+	movl	%ebx,%r10d
+
+	call	_bsaes_encrypt8_bitslice
+
+	subq	$8,%r14
+	jc	L$ctr_enc_loop_done
+
+	movdqu	0(%r12),%xmm7
+	movdqu	16(%r12),%xmm8
+	movdqu	32(%r12),%xmm9
+	movdqu	48(%r12),%xmm10
+	movdqu	64(%r12),%xmm11
+	movdqu	80(%r12),%xmm12
+	movdqu	96(%r12),%xmm13
+	movdqu	112(%r12),%xmm14
+	leaq	128(%r12),%r12
+	pxor	%xmm15,%xmm7
+	movdqa	32(%rbp),%xmm15
+	pxor	%xmm8,%xmm0
+	movdqu	%xmm7,0(%r13)
+	pxor	%xmm9,%xmm3
+	movdqu	%xmm0,16(%r13)
+	pxor	%xmm10,%xmm5
+	movdqu	%xmm3,32(%r13)
+	pxor	%xmm11,%xmm2
+	movdqu	%xmm5,48(%r13)
+	pxor	%xmm12,%xmm6
+	movdqu	%xmm2,64(%r13)
+	pxor	%xmm13,%xmm1
+	movdqu	%xmm6,80(%r13)
+	pxor	%xmm14,%xmm4
+	movdqu	%xmm1,96(%r13)
+	leaq	L$ADD1(%rip),%r11
+	movdqu	%xmm4,112(%r13)
+	leaq	128(%r13),%r13
+	paddd	112(%r11),%xmm15
+	jnz	L$ctr_enc_loop
+
+	jmp	L$ctr_enc_done
+.p2align	4
+L$ctr_enc_loop_done:
+	addq	$8,%r14
+	movdqu	0(%r12),%xmm7
+	pxor	%xmm7,%xmm15
+	movdqu	%xmm15,0(%r13)
+	cmpq	$2,%r14
+	jb	L$ctr_enc_done
+	movdqu	16(%r12),%xmm8
+	pxor	%xmm8,%xmm0
+	movdqu	%xmm0,16(%r13)
+	je	L$ctr_enc_done
+	movdqu	32(%r12),%xmm9
+	pxor	%xmm9,%xmm3
+	movdqu	%xmm3,32(%r13)
+	cmpq	$4,%r14
+	jb	L$ctr_enc_done
+	movdqu	48(%r12),%xmm10
+	pxor	%xmm10,%xmm5
+	movdqu	%xmm5,48(%r13)
+	je	L$ctr_enc_done
+	movdqu	64(%r12),%xmm11
+	pxor	%xmm11,%xmm2
+	movdqu	%xmm2,64(%r13)
+	cmpq	$6,%r14
+	jb	L$ctr_enc_done
+	movdqu	80(%r12),%xmm12
+	pxor	%xmm12,%xmm6
+	movdqu	%xmm6,80(%r13)
+	je	L$ctr_enc_done
+	movdqu	96(%r12),%xmm13
+	pxor	%xmm13,%xmm1
+	movdqu	%xmm1,96(%r13)
+	jmp	L$ctr_enc_done
+
+.p2align	4
+L$ctr_enc_short:
+	leaq	32(%rbp),%rdi
+	leaq	48(%rbp),%rsi
+	leaq	(%r15),%rdx
+	call	_asm_AES_encrypt
+	movdqu	(%r12),%xmm0
+	leaq	16(%r12),%r12
+	movl	44(%rbp),%eax
+	bswapl	%eax
+	pxor	48(%rbp),%xmm0
+	incl	%eax
+	movdqu	%xmm0,(%r13)
+	bswapl	%eax
+	leaq	16(%r13),%r13
+	movl	%eax,44(%rsp)
+	decq	%r14
+	jnz	L$ctr_enc_short
+
+L$ctr_enc_done:
+	leaq	(%rsp),%rax
+	pxor	%xmm0,%xmm0
+L$ctr_enc_bzero:
+	movdqa	%xmm0,0(%rax)
+	movdqa	%xmm0,16(%rax)
+	leaq	32(%rax),%rax
+	cmpq	%rax,%rbp
+	ja	L$ctr_enc_bzero
+
+	leaq	(%rbp),%rsp
+	movq	72(%rsp),%r15
+	movq	80(%rsp),%r14
+	movq	88(%rsp),%r13
+	movq	96(%rsp),%r12
+	movq	104(%rsp),%rbx
+	movq	112(%rsp),%rax
+	leaq	120(%rsp),%rsp
+	movq	%rax,%rbp
+L$ctr_enc_epilogue:
+	.byte	0xf3,0xc3
+
+.globl	_bsaes_xts_encrypt
+.private_extern _bsaes_xts_encrypt
+
+.p2align	4
+_bsaes_xts_encrypt:
+	movq	%rsp,%rax
+L$xts_enc_prologue:
+	pushq	%rbp
+	pushq	%rbx
+	pushq	%r12
+	pushq	%r13
+	pushq	%r14
+	pushq	%r15
+	leaq	-72(%rsp),%rsp
+	movq	%rsp,%rbp
+	movq	%rdi,%r12
+	movq	%rsi,%r13
+	movq	%rdx,%r14
+	movq	%rcx,%r15
+
+	leaq	(%r9),%rdi
+	leaq	32(%rbp),%rsi
+	leaq	(%r8),%rdx
+	call	_asm_AES_encrypt
+
+	movl	240(%r15),%eax
+	movq	%r14,%rbx
+
+	movl	%eax,%edx
+	shlq	$7,%rax
+	subq	$96,%rax
+	subq	%rax,%rsp
+
+	movq	%rsp,%rax
+	movq	%r15,%rcx
+	movl	%edx,%r10d
+	call	_bsaes_key_convert
+	pxor	%xmm6,%xmm7
+	movdqa	%xmm7,(%rax)
+
+	andq	$-16,%r14
+	subq	$128,%rsp
+	movdqa	32(%rbp),%xmm6
+
+	pxor	%xmm14,%xmm14
+	movdqa	L$xts_magic(%rip),%xmm12
+	pcmpgtd	%xmm6,%xmm14
+
+	subq	$128,%r14
+	jc	L$xts_enc_short
+	jmp	L$xts_enc_loop
+
+.p2align	4
+L$xts_enc_loop:
+	pshufd	$19,%xmm14,%xmm13
+	pxor	%xmm14,%xmm14
+	movdqa	%xmm6,%xmm15
+	movdqa	%xmm6,0(%rsp)
+	paddq	%xmm6,%xmm6
+	pand	%xmm12,%xmm13
+	pcmpgtd	%xmm6,%xmm14
+	pxor	%xmm13,%xmm6
+	pshufd	$19,%xmm14,%xmm13
+	pxor	%xmm14,%xmm14
+	movdqa	%xmm6,%xmm0
+	movdqa	%xmm6,16(%rsp)
+	paddq	%xmm6,%xmm6
+	pand	%xmm12,%xmm13
+	pcmpgtd	%xmm6,%xmm14
+	pxor	%xmm13,%xmm6
+	movdqu	0(%r12),%xmm7
+	pshufd	$19,%xmm14,%xmm13
+	pxor	%xmm14,%xmm14
+	movdqa	%xmm6,%xmm1
+	movdqa	%xmm6,32(%rsp)
+	paddq	%xmm6,%xmm6
+	pand	%xmm12,%xmm13
+	pcmpgtd	%xmm6,%xmm14
+	pxor	%xmm13,%xmm6
+	movdqu	16(%r12),%xmm8
+	pxor	%xmm7,%xmm15
+	pshufd	$19,%xmm14,%xmm13
+	pxor	%xmm14,%xmm14
+	movdqa	%xmm6,%xmm2
+	movdqa	%xmm6,48(%rsp)
+	paddq	%xmm6,%xmm6
+	pand	%xmm12,%xmm13
+	pcmpgtd	%xmm6,%xmm14
+	pxor	%xmm13,%xmm6
+	movdqu	32(%r12),%xmm9
+	pxor	%xmm8,%xmm0
+	pshufd	$19,%xmm14,%xmm13
+	pxor	%xmm14,%xmm14
+	movdqa	%xmm6,%xmm3
+	movdqa	%xmm6,64(%rsp)
+	paddq	%xmm6,%xmm6
+	pand	%xmm12,%xmm13
+	pcmpgtd	%xmm6,%xmm14
+	pxor	%xmm13,%xmm6
+	movdqu	48(%r12),%xmm10
+	pxor	%xmm9,%xmm1
+	pshufd	$19,%xmm14,%xmm13
+	pxor	%xmm14,%xmm14
+	movdqa	%xmm6,%xmm4
+	movdqa	%xmm6,80(%rsp)
+	paddq	%xmm6,%xmm6
+	pand	%xmm12,%xmm13
+	pcmpgtd	%xmm6,%xmm14
+	pxor	%xmm13,%xmm6
+	movdqu	64(%r12),%xmm11
+	pxor	%xmm10,%xmm2
+	pshufd	$19,%xmm14,%xmm13
+	pxor	%xmm14,%xmm14
+	movdqa	%xmm6,%xmm5
+	movdqa	%xmm6,96(%rsp)
+	paddq	%xmm6,%xmm6
+	pand	%xmm12,%xmm13
+	pcmpgtd	%xmm6,%xmm14
+	pxor	%xmm13,%xmm6
+	movdqu	80(%r12),%xmm12
+	pxor	%xmm11,%xmm3
+	movdqu	96(%r12),%xmm13
+	pxor	%xmm12,%xmm4
+	movdqu	112(%r12),%xmm14
+	leaq	128(%r12),%r12
+	movdqa	%xmm6,112(%rsp)
+	pxor	%xmm13,%xmm5
+	leaq	128(%rsp),%rax
+	pxor	%xmm14,%xmm6
+	movl	%edx,%r10d
+
+	call	_bsaes_encrypt8
+
+	pxor	0(%rsp),%xmm15
+	pxor	16(%rsp),%xmm0
+	movdqu	%xmm15,0(%r13)
+	pxor	32(%rsp),%xmm3
+	movdqu	%xmm0,16(%r13)
+	pxor	48(%rsp),%xmm5
+	movdqu	%xmm3,32(%r13)
+	pxor	64(%rsp),%xmm2
+	movdqu	%xmm5,48(%r13)
+	pxor	80(%rsp),%xmm6
+	movdqu	%xmm2,64(%r13)
+	pxor	96(%rsp),%xmm1
+	movdqu	%xmm6,80(%r13)
+	pxor	112(%rsp),%xmm4
+	movdqu	%xmm1,96(%r13)
+	movdqu	%xmm4,112(%r13)
+	leaq	128(%r13),%r13
+
+	movdqa	112(%rsp),%xmm6
+	pxor	%xmm14,%xmm14
+	movdqa	L$xts_magic(%rip),%xmm12
+	pcmpgtd	%xmm6,%xmm14
+	pshufd	$19,%xmm14,%xmm13
+	pxor	%xmm14,%xmm14
+	paddq	%xmm6,%xmm6
+	pand	%xmm12,%xmm13
+	pcmpgtd	%xmm6,%xmm14
+	pxor	%xmm13,%xmm6
+
+	subq	$128,%r14
+	jnc	L$xts_enc_loop
+
+L$xts_enc_short:
+	addq	$128,%r14
+	jz	L$xts_enc_done
+	pshufd	$19,%xmm14,%xmm13
+	pxor	%xmm14,%xmm14
+	movdqa	%xmm6,%xmm15
+	movdqa	%xmm6,0(%rsp)
+	paddq	%xmm6,%xmm6
+	pand	%xmm12,%xmm13
+	pcmpgtd	%xmm6,%xmm14
+	pxor	%xmm13,%xmm6
+	pshufd	$19,%xmm14,%xmm13
+	pxor	%xmm14,%xmm14
+	movdqa	%xmm6,%xmm0
+	movdqa	%xmm6,16(%rsp)
+	paddq	%xmm6,%xmm6
+	pand	%xmm12,%xmm13
+	pcmpgtd	%xmm6,%xmm14
+	pxor	%xmm13,%xmm6
+	movdqu	0(%r12),%xmm7
+	cmpq	$16,%r14
+	je	L$xts_enc_1
+	pshufd	$19,%xmm14,%xmm13
+	pxor	%xmm14,%xmm14
+	movdqa	%xmm6,%xmm1
+	movdqa	%xmm6,32(%rsp)
+	paddq	%xmm6,%xmm6
+	pand	%xmm12,%xmm13
+	pcmpgtd	%xmm6,%xmm14
+	pxor	%xmm13,%xmm6
+	movdqu	16(%r12),%xmm8
+	cmpq	$32,%r14
+	je	L$xts_enc_2
+	pxor	%xmm7,%xmm15
+	pshufd	$19,%xmm14,%xmm13
+	pxor	%xmm14,%xmm14
+	movdqa	%xmm6,%xmm2
+	movdqa	%xmm6,48(%rsp)
+	paddq	%xmm6,%xmm6
+	pand	%xmm12,%xmm13
+	pcmpgtd	%xmm6,%xmm14
+	pxor	%xmm13,%xmm6
+	movdqu	32(%r12),%xmm9
+	cmpq	$48,%r14
+	je	L$xts_enc_3
+	pxor	%xmm8,%xmm0
+	pshufd	$19,%xmm14,%xmm13
+	pxor	%xmm14,%xmm14
+	movdqa	%xmm6,%xmm3
+	movdqa	%xmm6,64(%rsp)
+	paddq	%xmm6,%xmm6
+	pand	%xmm12,%xmm13
+	pcmpgtd	%xmm6,%xmm14
+	pxor	%xmm13,%xmm6
+	movdqu	48(%r12),%xmm10
+	cmpq	$64,%r14
+	je	L$xts_enc_4
+	pxor	%xmm9,%xmm1
+	pshufd	$19,%xmm14,%xmm13
+	pxor	%xmm14,%xmm14
+	movdqa	%xmm6,%xmm4
+	movdqa	%xmm6,80(%rsp)
+	paddq	%xmm6,%xmm6
+	pand	%xmm12,%xmm13
+	pcmpgtd	%xmm6,%xmm14
+	pxor	%xmm13,%xmm6
+	movdqu	64(%r12),%xmm11
+	cmpq	$80,%r14
+	je	L$xts_enc_5
+	pxor	%xmm10,%xmm2
+	pshufd	$19,%xmm14,%xmm13
+	pxor	%xmm14,%xmm14
+	movdqa	%xmm6,%xmm5
+	movdqa	%xmm6,96(%rsp)
+	paddq	%xmm6,%xmm6
+	pand	%xmm12,%xmm13
+	pcmpgtd	%xmm6,%xmm14
+	pxor	%xmm13,%xmm6
+	movdqu	80(%r12),%xmm12
+	cmpq	$96,%r14
+	je	L$xts_enc_6
+	pxor	%xmm11,%xmm3
+	movdqu	96(%r12),%xmm13
+	pxor	%xmm12,%xmm4
+	movdqa	%xmm6,112(%rsp)
+	leaq	112(%r12),%r12
+	pxor	%xmm13,%xmm5
+	leaq	128(%rsp),%rax
+	movl	%edx,%r10d
+
+	call	_bsaes_encrypt8
+
+	pxor	0(%rsp),%xmm15
+	pxor	16(%rsp),%xmm0
+	movdqu	%xmm15,0(%r13)
+	pxor	32(%rsp),%xmm3
+	movdqu	%xmm0,16(%r13)
+	pxor	48(%rsp),%xmm5
+	movdqu	%xmm3,32(%r13)
+	pxor	64(%rsp),%xmm2
+	movdqu	%xmm5,48(%r13)
+	pxor	80(%rsp),%xmm6
+	movdqu	%xmm2,64(%r13)
+	pxor	96(%rsp),%xmm1
+	movdqu	%xmm6,80(%r13)
+	movdqu	%xmm1,96(%r13)
+	leaq	112(%r13),%r13
+
+	movdqa	112(%rsp),%xmm6
+	jmp	L$xts_enc_done
+.p2align	4
+L$xts_enc_6:
+	pxor	%xmm11,%xmm3
+	leaq	96(%r12),%r12
+	pxor	%xmm12,%xmm4
+	leaq	128(%rsp),%rax
+	movl	%edx,%r10d
+
+	call	_bsaes_encrypt8
+
+	pxor	0(%rsp),%xmm15
+	pxor	16(%rsp),%xmm0
+	movdqu	%xmm15,0(%r13)
+	pxor	32(%rsp),%xmm3
+	movdqu	%xmm0,16(%r13)
+	pxor	48(%rsp),%xmm5
+	movdqu	%xmm3,32(%r13)
+	pxor	64(%rsp),%xmm2
+	movdqu	%xmm5,48(%r13)
+	pxor	80(%rsp),%xmm6
+	movdqu	%xmm2,64(%r13)
+	movdqu	%xmm6,80(%r13)
+	leaq	96(%r13),%r13
+
+	movdqa	96(%rsp),%xmm6
+	jmp	L$xts_enc_done
+.p2align	4
+L$xts_enc_5:
+	pxor	%xmm10,%xmm2
+	leaq	80(%r12),%r12
+	pxor	%xmm11,%xmm3
+	leaq	128(%rsp),%rax
+	movl	%edx,%r10d
+
+	call	_bsaes_encrypt8
+
+	pxor	0(%rsp),%xmm15
+	pxor	16(%rsp),%xmm0
+	movdqu	%xmm15,0(%r13)
+	pxor	32(%rsp),%xmm3
+	movdqu	%xmm0,16(%r13)
+	pxor	48(%rsp),%xmm5
+	movdqu	%xmm3,32(%r13)
+	pxor	64(%rsp),%xmm2
+	movdqu	%xmm5,48(%r13)
+	movdqu	%xmm2,64(%r13)
+	leaq	80(%r13),%r13
+
+	movdqa	80(%rsp),%xmm6
+	jmp	L$xts_enc_done
+.p2align	4
+L$xts_enc_4:
+	pxor	%xmm9,%xmm1
+	leaq	64(%r12),%r12
+	pxor	%xmm10,%xmm2
+	leaq	128(%rsp),%rax
+	movl	%edx,%r10d
+
+	call	_bsaes_encrypt8
+
+	pxor	0(%rsp),%xmm15
+	pxor	16(%rsp),%xmm0
+	movdqu	%xmm15,0(%r13)
+	pxor	32(%rsp),%xmm3
+	movdqu	%xmm0,16(%r13)
+	pxor	48(%rsp),%xmm5
+	movdqu	%xmm3,32(%r13)
+	movdqu	%xmm5,48(%r13)
+	leaq	64(%r13),%r13
+
+	movdqa	64(%rsp),%xmm6
+	jmp	L$xts_enc_done
+.p2align	4
+L$xts_enc_3:
+	pxor	%xmm8,%xmm0
+	leaq	48(%r12),%r12
+	pxor	%xmm9,%xmm1
+	leaq	128(%rsp),%rax
+	movl	%edx,%r10d
+
+	call	_bsaes_encrypt8
+
+	pxor	0(%rsp),%xmm15
+	pxor	16(%rsp),%xmm0
+	movdqu	%xmm15,0(%r13)
+	pxor	32(%rsp),%xmm3
+	movdqu	%xmm0,16(%r13)
+	movdqu	%xmm3,32(%r13)
+	leaq	48(%r13),%r13
+
+	movdqa	48(%rsp),%xmm6
+	jmp	L$xts_enc_done
+.p2align	4
+L$xts_enc_2:
+	pxor	%xmm7,%xmm15
+	leaq	32(%r12),%r12
+	pxor	%xmm8,%xmm0
+	leaq	128(%rsp),%rax
+	movl	%edx,%r10d
+
+	call	_bsaes_encrypt8
+
+	pxor	0(%rsp),%xmm15
+	pxor	16(%rsp),%xmm0
+	movdqu	%xmm15,0(%r13)
+	movdqu	%xmm0,16(%r13)
+	leaq	32(%r13),%r13
+
+	movdqa	32(%rsp),%xmm6
+	jmp	L$xts_enc_done
+.p2align	4
+L$xts_enc_1:
+	pxor	%xmm15,%xmm7
+	leaq	16(%r12),%r12
+	movdqa	%xmm7,32(%rbp)
+	leaq	32(%rbp),%rdi
+	leaq	32(%rbp),%rsi
+	leaq	(%r15),%rdx
+	call	_asm_AES_encrypt
+	pxor	32(%rbp),%xmm15
+
+
+
+
+
+	movdqu	%xmm15,0(%r13)
+	leaq	16(%r13),%r13
+
+	movdqa	16(%rsp),%xmm6
+
+L$xts_enc_done:
+	andl	$15,%ebx
+	jz	L$xts_enc_ret
+	movq	%r13,%rdx
+
+L$xts_enc_steal:
+	movzbl	(%r12),%eax
+	movzbl	-16(%rdx),%ecx
+	leaq	1(%r12),%r12
+	movb	%al,-16(%rdx)
+	movb	%cl,0(%rdx)
+	leaq	1(%rdx),%rdx
+	subl	$1,%ebx
+	jnz	L$xts_enc_steal
+
+	movdqu	-16(%r13),%xmm15
+	leaq	32(%rbp),%rdi
+	pxor	%xmm6,%xmm15
+	leaq	32(%rbp),%rsi
+	movdqa	%xmm15,32(%rbp)
+	leaq	(%r15),%rdx
+	call	_asm_AES_encrypt
+	pxor	32(%rbp),%xmm6
+	movdqu	%xmm6,-16(%r13)
+
+L$xts_enc_ret:
+	leaq	(%rsp),%rax
+	pxor	%xmm0,%xmm0
+L$xts_enc_bzero:
+	movdqa	%xmm0,0(%rax)
+	movdqa	%xmm0,16(%rax)
+	leaq	32(%rax),%rax
+	cmpq	%rax,%rbp
+	ja	L$xts_enc_bzero
+
+	leaq	(%rbp),%rsp
+	movq	72(%rsp),%r15
+	movq	80(%rsp),%r14
+	movq	88(%rsp),%r13
+	movq	96(%rsp),%r12
+	movq	104(%rsp),%rbx
+	movq	112(%rsp),%rax
+	leaq	120(%rsp),%rsp
+	movq	%rax,%rbp
+L$xts_enc_epilogue:
+	.byte	0xf3,0xc3
+
+
+.globl	_bsaes_xts_decrypt
+.private_extern _bsaes_xts_decrypt
+
+.p2align	4
+_bsaes_xts_decrypt:
+	movq	%rsp,%rax
+L$xts_dec_prologue:
+	pushq	%rbp
+	pushq	%rbx
+	pushq	%r12
+	pushq	%r13
+	pushq	%r14
+	pushq	%r15
+	leaq	-72(%rsp),%rsp
+	movq	%rsp,%rbp
+	movq	%rdi,%r12
+	movq	%rsi,%r13
+	movq	%rdx,%r14
+	movq	%rcx,%r15
+
+	leaq	(%r9),%rdi
+	leaq	32(%rbp),%rsi
+	leaq	(%r8),%rdx
+	call	_asm_AES_encrypt
+
+	movl	240(%r15),%eax
+	movq	%r14,%rbx
+
+	movl	%eax,%edx
+	shlq	$7,%rax
+	subq	$96,%rax
+	subq	%rax,%rsp
+
+	movq	%rsp,%rax
+	movq	%r15,%rcx
+	movl	%edx,%r10d
+	call	_bsaes_key_convert
+	pxor	(%rsp),%xmm7
+	movdqa	%xmm6,(%rax)
+	movdqa	%xmm7,(%rsp)
+
+	xorl	%eax,%eax
+	andq	$-16,%r14
+	testl	$15,%ebx
+	setnz	%al
+	shlq	$4,%rax
+	subq	%rax,%r14
+
+	subq	$128,%rsp
+	movdqa	32(%rbp),%xmm6
+
+	pxor	%xmm14,%xmm14
+	movdqa	L$xts_magic(%rip),%xmm12
+	pcmpgtd	%xmm6,%xmm14
+
+	subq	$128,%r14
+	jc	L$xts_dec_short
+	jmp	L$xts_dec_loop
+
+.p2align	4
+L$xts_dec_loop:
+	pshufd	$19,%xmm14,%xmm13
+	pxor	%xmm14,%xmm14
+	movdqa	%xmm6,%xmm15
+	movdqa	%xmm6,0(%rsp)
+	paddq	%xmm6,%xmm6
+	pand	%xmm12,%xmm13
+	pcmpgtd	%xmm6,%xmm14
+	pxor	%xmm13,%xmm6
+	pshufd	$19,%xmm14,%xmm13
+	pxor	%xmm14,%xmm14
+	movdqa	%xmm6,%xmm0
+	movdqa	%xmm6,16(%rsp)
+	paddq	%xmm6,%xmm6
+	pand	%xmm12,%xmm13
+	pcmpgtd	%xmm6,%xmm14
+	pxor	%xmm13,%xmm6
+	movdqu	0(%r12),%xmm7
+	pshufd	$19,%xmm14,%xmm13
+	pxor	%xmm14,%xmm14
+	movdqa	%xmm6,%xmm1
+	movdqa	%xmm6,32(%rsp)
+	paddq	%xmm6,%xmm6
+	pand	%xmm12,%xmm13
+	pcmpgtd	%xmm6,%xmm14
+	pxor	%xmm13,%xmm6
+	movdqu	16(%r12),%xmm8
+	pxor	%xmm7,%xmm15
+	pshufd	$19,%xmm14,%xmm13
+	pxor	%xmm14,%xmm14
+	movdqa	%xmm6,%xmm2
+	movdqa	%xmm6,48(%rsp)
+	paddq	%xmm6,%xmm6
+	pand	%xmm12,%xmm13
+	pcmpgtd	%xmm6,%xmm14
+	pxor	%xmm13,%xmm6
+	movdqu	32(%r12),%xmm9
+	pxor	%xmm8,%xmm0
+	pshufd	$19,%xmm14,%xmm13
+	pxor	%xmm14,%xmm14
+	movdqa	%xmm6,%xmm3
+	movdqa	%xmm6,64(%rsp)
+	paddq	%xmm6,%xmm6
+	pand	%xmm12,%xmm13
+	pcmpgtd	%xmm6,%xmm14
+	pxor	%xmm13,%xmm6
+	movdqu	48(%r12),%xmm10
+	pxor	%xmm9,%xmm1
+	pshufd	$19,%xmm14,%xmm13
+	pxor	%xmm14,%xmm14
+	movdqa	%xmm6,%xmm4
+	movdqa	%xmm6,80(%rsp)
+	paddq	%xmm6,%xmm6
+	pand	%xmm12,%xmm13
+	pcmpgtd	%xmm6,%xmm14
+	pxor	%xmm13,%xmm6
+	movdqu	64(%r12),%xmm11
+	pxor	%xmm10,%xmm2
+	pshufd	$19,%xmm14,%xmm13
+	pxor	%xmm14,%xmm14
+	movdqa	%xmm6,%xmm5
+	movdqa	%xmm6,96(%rsp)
+	paddq	%xmm6,%xmm6
+	pand	%xmm12,%xmm13
+	pcmpgtd	%xmm6,%xmm14
+	pxor	%xmm13,%xmm6
+	movdqu	80(%r12),%xmm12
+	pxor	%xmm11,%xmm3
+	movdqu	96(%r12),%xmm13
+	pxor	%xmm12,%xmm4
+	movdqu	112(%r12),%xmm14
+	leaq	128(%r12),%r12
+	movdqa	%xmm6,112(%rsp)
+	pxor	%xmm13,%xmm5
+	leaq	128(%rsp),%rax
+	pxor	%xmm14,%xmm6
+	movl	%edx,%r10d
+
+	call	_bsaes_decrypt8
+
+	pxor	0(%rsp),%xmm15
+	pxor	16(%rsp),%xmm0
+	movdqu	%xmm15,0(%r13)
+	pxor	32(%rsp),%xmm5
+	movdqu	%xmm0,16(%r13)
+	pxor	48(%rsp),%xmm3
+	movdqu	%xmm5,32(%r13)
+	pxor	64(%rsp),%xmm1
+	movdqu	%xmm3,48(%r13)
+	pxor	80(%rsp),%xmm6
+	movdqu	%xmm1,64(%r13)
+	pxor	96(%rsp),%xmm2
+	movdqu	%xmm6,80(%r13)
+	pxor	112(%rsp),%xmm4
+	movdqu	%xmm2,96(%r13)
+	movdqu	%xmm4,112(%r13)
+	leaq	128(%r13),%r13
+
+	movdqa	112(%rsp),%xmm6
+	pxor	%xmm14,%xmm14
+	movdqa	L$xts_magic(%rip),%xmm12
+	pcmpgtd	%xmm6,%xmm14
+	pshufd	$19,%xmm14,%xmm13
+	pxor	%xmm14,%xmm14
+	paddq	%xmm6,%xmm6
+	pand	%xmm12,%xmm13
+	pcmpgtd	%xmm6,%xmm14
+	pxor	%xmm13,%xmm6
+
+	subq	$128,%r14
+	jnc	L$xts_dec_loop
+
+L$xts_dec_short:
+	addq	$128,%r14
+	jz	L$xts_dec_done
+	pshufd	$19,%xmm14,%xmm13
+	pxor	%xmm14,%xmm14
+	movdqa	%xmm6,%xmm15
+	movdqa	%xmm6,0(%rsp)
+	paddq	%xmm6,%xmm6
+	pand	%xmm12,%xmm13
+	pcmpgtd	%xmm6,%xmm14
+	pxor	%xmm13,%xmm6
+	pshufd	$19,%xmm14,%xmm13
+	pxor	%xmm14,%xmm14
+	movdqa	%xmm6,%xmm0
+	movdqa	%xmm6,16(%rsp)
+	paddq	%xmm6,%xmm6
+	pand	%xmm12,%xmm13
+	pcmpgtd	%xmm6,%xmm14
+	pxor	%xmm13,%xmm6
+	movdqu	0(%r12),%xmm7
+	cmpq	$16,%r14
+	je	L$xts_dec_1
+	pshufd	$19,%xmm14,%xmm13
+	pxor	%xmm14,%xmm14
+	movdqa	%xmm6,%xmm1
+	movdqa	%xmm6,32(%rsp)
+	paddq	%xmm6,%xmm6
+	pand	%xmm12,%xmm13
+	pcmpgtd	%xmm6,%xmm14
+	pxor	%xmm13,%xmm6
+	movdqu	16(%r12),%xmm8
+	cmpq	$32,%r14
+	je	L$xts_dec_2
+	pxor	%xmm7,%xmm15
+	pshufd	$19,%xmm14,%xmm13
+	pxor	%xmm14,%xmm14
+	movdqa	%xmm6,%xmm2
+	movdqa	%xmm6,48(%rsp)
+	paddq	%xmm6,%xmm6
+	pand	%xmm12,%xmm13
+	pcmpgtd	%xmm6,%xmm14
+	pxor	%xmm13,%xmm6
+	movdqu	32(%r12),%xmm9
+	cmpq	$48,%r14
+	je	L$xts_dec_3
+	pxor	%xmm8,%xmm0
+	pshufd	$19,%xmm14,%xmm13
+	pxor	%xmm14,%xmm14
+	movdqa	%xmm6,%xmm3
+	movdqa	%xmm6,64(%rsp)
+	paddq	%xmm6,%xmm6
+	pand	%xmm12,%xmm13
+	pcmpgtd	%xmm6,%xmm14
+	pxor	%xmm13,%xmm6
+	movdqu	48(%r12),%xmm10
+	cmpq	$64,%r14
+	je	L$xts_dec_4
+	pxor	%xmm9,%xmm1
+	pshufd	$19,%xmm14,%xmm13
+	pxor	%xmm14,%xmm14
+	movdqa	%xmm6,%xmm4
+	movdqa	%xmm6,80(%rsp)
+	paddq	%xmm6,%xmm6
+	pand	%xmm12,%xmm13
+	pcmpgtd	%xmm6,%xmm14
+	pxor	%xmm13,%xmm6
+	movdqu	64(%r12),%xmm11
+	cmpq	$80,%r14
+	je	L$xts_dec_5
+	pxor	%xmm10,%xmm2
+	pshufd	$19,%xmm14,%xmm13
+	pxor	%xmm14,%xmm14
+	movdqa	%xmm6,%xmm5
+	movdqa	%xmm6,96(%rsp)
+	paddq	%xmm6,%xmm6
+	pand	%xmm12,%xmm13
+	pcmpgtd	%xmm6,%xmm14
+	pxor	%xmm13,%xmm6
+	movdqu	80(%r12),%xmm12
+	cmpq	$96,%r14
+	je	L$xts_dec_6
+	pxor	%xmm11,%xmm3
+	movdqu	96(%r12),%xmm13
+	pxor	%xmm12,%xmm4
+	movdqa	%xmm6,112(%rsp)
+	leaq	112(%r12),%r12
+	pxor	%xmm13,%xmm5
+	leaq	128(%rsp),%rax
+	movl	%edx,%r10d
+
+	call	_bsaes_decrypt8
+
+	pxor	0(%rsp),%xmm15
+	pxor	16(%rsp),%xmm0
+	movdqu	%xmm15,0(%r13)
+	pxor	32(%rsp),%xmm5
+	movdqu	%xmm0,16(%r13)
+	pxor	48(%rsp),%xmm3
+	movdqu	%xmm5,32(%r13)
+	pxor	64(%rsp),%xmm1
+	movdqu	%xmm3,48(%r13)
+	pxor	80(%rsp),%xmm6
+	movdqu	%xmm1,64(%r13)
+	pxor	96(%rsp),%xmm2
+	movdqu	%xmm6,80(%r13)
+	movdqu	%xmm2,96(%r13)
+	leaq	112(%r13),%r13
+
+	movdqa	112(%rsp),%xmm6
+	jmp	L$xts_dec_done
+.p2align	4
+L$xts_dec_6:
+	pxor	%xmm11,%xmm3
+	leaq	96(%r12),%r12
+	pxor	%xmm12,%xmm4
+	leaq	128(%rsp),%rax
+	movl	%edx,%r10d
+
+	call	_bsaes_decrypt8
+
+	pxor	0(%rsp),%xmm15
+	pxor	16(%rsp),%xmm0
+	movdqu	%xmm15,0(%r13)
+	pxor	32(%rsp),%xmm5
+	movdqu	%xmm0,16(%r13)
+	pxor	48(%rsp),%xmm3
+	movdqu	%xmm5,32(%r13)
+	pxor	64(%rsp),%xmm1
+	movdqu	%xmm3,48(%r13)
+	pxor	80(%rsp),%xmm6
+	movdqu	%xmm1,64(%r13)
+	movdqu	%xmm6,80(%r13)
+	leaq	96(%r13),%r13
+
+	movdqa	96(%rsp),%xmm6
+	jmp	L$xts_dec_done
+.p2align	4
+L$xts_dec_5:
+	pxor	%xmm10,%xmm2
+	leaq	80(%r12),%r12
+	pxor	%xmm11,%xmm3
+	leaq	128(%rsp),%rax
+	movl	%edx,%r10d
+
+	call	_bsaes_decrypt8
+
+	pxor	0(%rsp),%xmm15
+	pxor	16(%rsp),%xmm0
+	movdqu	%xmm15,0(%r13)
+	pxor	32(%rsp),%xmm5
+	movdqu	%xmm0,16(%r13)
+	pxor	48(%rsp),%xmm3
+	movdqu	%xmm5,32(%r13)
+	pxor	64(%rsp),%xmm1
+	movdqu	%xmm3,48(%r13)
+	movdqu	%xmm1,64(%r13)
+	leaq	80(%r13),%r13
+
+	movdqa	80(%rsp),%xmm6
+	jmp	L$xts_dec_done
+.p2align	4
+L$xts_dec_4:
+	pxor	%xmm9,%xmm1
+	leaq	64(%r12),%r12
+	pxor	%xmm10,%xmm2
+	leaq	128(%rsp),%rax
+	movl	%edx,%r10d
+
+	call	_bsaes_decrypt8
+
+	pxor	0(%rsp),%xmm15
+	pxor	16(%rsp),%xmm0
+	movdqu	%xmm15,0(%r13)
+	pxor	32(%rsp),%xmm5
+	movdqu	%xmm0,16(%r13)
+	pxor	48(%rsp),%xmm3
+	movdqu	%xmm5,32(%r13)
+	movdqu	%xmm3,48(%r13)
+	leaq	64(%r13),%r13
+
+	movdqa	64(%rsp),%xmm6
+	jmp	L$xts_dec_done
+.p2align	4
+L$xts_dec_3:
+	pxor	%xmm8,%xmm0
+	leaq	48(%r12),%r12
+	pxor	%xmm9,%xmm1
+	leaq	128(%rsp),%rax
+	movl	%edx,%r10d
+
+	call	_bsaes_decrypt8
+
+	pxor	0(%rsp),%xmm15
+	pxor	16(%rsp),%xmm0
+	movdqu	%xmm15,0(%r13)
+	pxor	32(%rsp),%xmm5
+	movdqu	%xmm0,16(%r13)
+	movdqu	%xmm5,32(%r13)
+	leaq	48(%r13),%r13
+
+	movdqa	48(%rsp),%xmm6
+	jmp	L$xts_dec_done
+.p2align	4
+L$xts_dec_2:
+	pxor	%xmm7,%xmm15
+	leaq	32(%r12),%r12
+	pxor	%xmm8,%xmm0
+	leaq	128(%rsp),%rax
+	movl	%edx,%r10d
+
+	call	_bsaes_decrypt8
+
+	pxor	0(%rsp),%xmm15
+	pxor	16(%rsp),%xmm0
+	movdqu	%xmm15,0(%r13)
+	movdqu	%xmm0,16(%r13)
+	leaq	32(%r13),%r13
+
+	movdqa	32(%rsp),%xmm6
+	jmp	L$xts_dec_done
+.p2align	4
+L$xts_dec_1:
+	pxor	%xmm15,%xmm7
+	leaq	16(%r12),%r12
+	movdqa	%xmm7,32(%rbp)
+	leaq	32(%rbp),%rdi
+	leaq	32(%rbp),%rsi
+	leaq	(%r15),%rdx
+	call	_asm_AES_decrypt
+	pxor	32(%rbp),%xmm15
+
+
+
+
+
+	movdqu	%xmm15,0(%r13)
+	leaq	16(%r13),%r13
+
+	movdqa	16(%rsp),%xmm6
+
+L$xts_dec_done:
+	andl	$15,%ebx
+	jz	L$xts_dec_ret
+
+	pxor	%xmm14,%xmm14
+	movdqa	L$xts_magic(%rip),%xmm12
+	pcmpgtd	%xmm6,%xmm14
+	pshufd	$19,%xmm14,%xmm13
+	movdqa	%xmm6,%xmm5
+	paddq	%xmm6,%xmm6
+	pand	%xmm12,%xmm13
+	movdqu	(%r12),%xmm15
+	pxor	%xmm13,%xmm6
+
+	leaq	32(%rbp),%rdi
+	pxor	%xmm6,%xmm15
+	leaq	32(%rbp),%rsi
+	movdqa	%xmm15,32(%rbp)
+	leaq	(%r15),%rdx
+	call	_asm_AES_decrypt
+	pxor	32(%rbp),%xmm6
+	movq	%r13,%rdx
+	movdqu	%xmm6,(%r13)
+
+L$xts_dec_steal:
+	movzbl	16(%r12),%eax
+	movzbl	(%rdx),%ecx
+	leaq	1(%r12),%r12
+	movb	%al,(%rdx)
+	movb	%cl,16(%rdx)
+	leaq	1(%rdx),%rdx
+	subl	$1,%ebx
+	jnz	L$xts_dec_steal
+
+	movdqu	(%r13),%xmm15
+	leaq	32(%rbp),%rdi
+	pxor	%xmm5,%xmm15
+	leaq	32(%rbp),%rsi
+	movdqa	%xmm15,32(%rbp)
+	leaq	(%r15),%rdx
+	call	_asm_AES_decrypt
+	pxor	32(%rbp),%xmm5
+	movdqu	%xmm5,(%r13)
+
+L$xts_dec_ret:
+	leaq	(%rsp),%rax
+	pxor	%xmm0,%xmm0
+L$xts_dec_bzero:
+	movdqa	%xmm0,0(%rax)
+	movdqa	%xmm0,16(%rax)
+	leaq	32(%rax),%rax
+	cmpq	%rax,%rbp
+	ja	L$xts_dec_bzero
+
+	leaq	(%rbp),%rsp
+	movq	72(%rsp),%r15
+	movq	80(%rsp),%r14
+	movq	88(%rsp),%r13
+	movq	96(%rsp),%r12
+	movq	104(%rsp),%rbx
+	movq	112(%rsp),%rax
+	leaq	120(%rsp),%rsp
+	movq	%rax,%rbp
+L$xts_dec_epilogue:
+	.byte	0xf3,0xc3
+
+
+.p2align	6
+_bsaes_const:
+L$M0ISR:
+.quad	0x0a0e0206070b0f03, 0x0004080c0d010509
+L$ISRM0:
+.quad	0x01040b0e0205080f, 0x0306090c00070a0d
+L$ISR:
+.quad	0x0504070602010003, 0x0f0e0d0c080b0a09
+L$BS0:
+.quad	0x5555555555555555, 0x5555555555555555
+L$BS1:
+.quad	0x3333333333333333, 0x3333333333333333
+L$BS2:
+.quad	0x0f0f0f0f0f0f0f0f, 0x0f0f0f0f0f0f0f0f
+L$SR:
+.quad	0x0504070600030201, 0x0f0e0d0c0a09080b
+L$SRM0:
+.quad	0x0304090e00050a0f, 0x01060b0c0207080d
+L$M0SR:
+.quad	0x0a0e02060f03070b, 0x0004080c05090d01
+L$SWPUP:
+.quad	0x0706050403020100, 0x0c0d0e0f0b0a0908
+L$SWPUPM0SR:
+.quad	0x0a0d02060c03070b, 0x0004080f05090e01
+L$ADD1:
+.quad	0x0000000000000000, 0x0000000100000000
+L$ADD2:
+.quad	0x0000000000000000, 0x0000000200000000
+L$ADD3:
+.quad	0x0000000000000000, 0x0000000300000000
+L$ADD4:
+.quad	0x0000000000000000, 0x0000000400000000
+L$ADD5:
+.quad	0x0000000000000000, 0x0000000500000000
+L$ADD6:
+.quad	0x0000000000000000, 0x0000000600000000
+L$ADD7:
+.quad	0x0000000000000000, 0x0000000700000000
+L$ADD8:
+.quad	0x0000000000000000, 0x0000000800000000
+L$xts_magic:
+.long	0x87,0,1,0
+L$masks:
+.quad	0x0101010101010101, 0x0101010101010101
+.quad	0x0202020202020202, 0x0202020202020202
+.quad	0x0404040404040404, 0x0404040404040404
+.quad	0x0808080808080808, 0x0808080808080808
+L$M0:
+.quad	0x02060a0e03070b0f, 0x0004080c0105090d
+L$63:
+.quad	0x6363636363636363, 0x6363636363636363
+.byte	66,105,116,45,115,108,105,99,101,100,32,65,69,83,32,102,111,114,32,120,56,54,95,54,52,47,83,83,83,69,51,44,32,69,109,105,108,105,97,32,75,195,164,115,112,101,114,44,32,80,101,116,101,114,32,83,99,104,119,97,98,101,44,32,65,110,100,121,32,80,111,108,121,97,107,111,118,0
+.p2align	6
+
+#endif
diff --git a/third_party/boringssl/mac-x86_64/crypto/aes/vpaes-x86_64.S b/third_party/boringssl/mac-x86_64/crypto/aes/vpaes-x86_64.S
new file mode 100644
index 0000000..711ea43
--- /dev/null
+++ b/third_party/boringssl/mac-x86_64/crypto/aes/vpaes-x86_64.S
@@ -0,0 +1,834 @@
+#if defined(__x86_64__)
+.text	
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+.p2align	4
+_vpaes_encrypt_core:
+	movq	%rdx,%r9
+	movq	$16,%r11
+	movl	240(%rdx),%eax
+	movdqa	%xmm9,%xmm1
+	movdqa	L$k_ipt(%rip),%xmm2
+	pandn	%xmm0,%xmm1
+	movdqu	(%r9),%xmm5
+	psrld	$4,%xmm1
+	pand	%xmm9,%xmm0
+.byte	102,15,56,0,208
+	movdqa	L$k_ipt+16(%rip),%xmm0
+.byte	102,15,56,0,193
+	pxor	%xmm5,%xmm2
+	addq	$16,%r9
+	pxor	%xmm2,%xmm0
+	leaq	L$k_mc_backward(%rip),%r10
+	jmp	L$enc_entry
+
+.p2align	4
+L$enc_loop:
+
+	movdqa	%xmm13,%xmm4
+	movdqa	%xmm12,%xmm0
+.byte	102,15,56,0,226
+.byte	102,15,56,0,195
+	pxor	%xmm5,%xmm4
+	movdqa	%xmm15,%xmm5
+	pxor	%xmm4,%xmm0
+	movdqa	-64(%r11,%r10,1),%xmm1
+.byte	102,15,56,0,234
+	movdqa	(%r11,%r10,1),%xmm4
+	movdqa	%xmm14,%xmm2
+.byte	102,15,56,0,211
+	movdqa	%xmm0,%xmm3
+	pxor	%xmm5,%xmm2
+.byte	102,15,56,0,193
+	addq	$16,%r9
+	pxor	%xmm2,%xmm0
+.byte	102,15,56,0,220
+	addq	$16,%r11
+	pxor	%xmm0,%xmm3
+.byte	102,15,56,0,193
+	andq	$48,%r11
+	subq	$1,%rax
+	pxor	%xmm3,%xmm0
+
+L$enc_entry:
+
+	movdqa	%xmm9,%xmm1
+	movdqa	%xmm11,%xmm5
+	pandn	%xmm0,%xmm1
+	psrld	$4,%xmm1
+	pand	%xmm9,%xmm0
+.byte	102,15,56,0,232
+	movdqa	%xmm10,%xmm3
+	pxor	%xmm1,%xmm0
+.byte	102,15,56,0,217
+	movdqa	%xmm10,%xmm4
+	pxor	%xmm5,%xmm3
+.byte	102,15,56,0,224
+	movdqa	%xmm10,%xmm2
+	pxor	%xmm5,%xmm4
+.byte	102,15,56,0,211
+	movdqa	%xmm10,%xmm3
+	pxor	%xmm0,%xmm2
+.byte	102,15,56,0,220
+	movdqu	(%r9),%xmm5
+	pxor	%xmm1,%xmm3
+	jnz	L$enc_loop
+
+
+	movdqa	-96(%r10),%xmm4
+	movdqa	-80(%r10),%xmm0
+.byte	102,15,56,0,226
+	pxor	%xmm5,%xmm4
+.byte	102,15,56,0,195
+	movdqa	64(%r11,%r10,1),%xmm1
+	pxor	%xmm4,%xmm0
+.byte	102,15,56,0,193
+	.byte	0xf3,0xc3
+
+
+
+
+
+
+
+
+.p2align	4
+_vpaes_decrypt_core:
+	movq	%rdx,%r9
+	movl	240(%rdx),%eax
+	movdqa	%xmm9,%xmm1
+	movdqa	L$k_dipt(%rip),%xmm2
+	pandn	%xmm0,%xmm1
+	movq	%rax,%r11
+	psrld	$4,%xmm1
+	movdqu	(%r9),%xmm5
+	shlq	$4,%r11
+	pand	%xmm9,%xmm0
+.byte	102,15,56,0,208
+	movdqa	L$k_dipt+16(%rip),%xmm0
+	xorq	$48,%r11
+	leaq	L$k_dsbd(%rip),%r10
+.byte	102,15,56,0,193
+	andq	$48,%r11
+	pxor	%xmm5,%xmm2
+	movdqa	L$k_mc_forward+48(%rip),%xmm5
+	pxor	%xmm2,%xmm0
+	addq	$16,%r9
+	addq	%r10,%r11
+	jmp	L$dec_entry
+
+.p2align	4
+L$dec_loop:
+
+
+
+	movdqa	-32(%r10),%xmm4
+	movdqa	-16(%r10),%xmm1
+.byte	102,15,56,0,226
+.byte	102,15,56,0,203
+	pxor	%xmm4,%xmm0
+	movdqa	0(%r10),%xmm4
+	pxor	%xmm1,%xmm0
+	movdqa	16(%r10),%xmm1
+
+.byte	102,15,56,0,226
+.byte	102,15,56,0,197
+.byte	102,15,56,0,203
+	pxor	%xmm4,%xmm0
+	movdqa	32(%r10),%xmm4
+	pxor	%xmm1,%xmm0
+	movdqa	48(%r10),%xmm1
+
+.byte	102,15,56,0,226
+.byte	102,15,56,0,197
+.byte	102,15,56,0,203
+	pxor	%xmm4,%xmm0
+	movdqa	64(%r10),%xmm4
+	pxor	%xmm1,%xmm0
+	movdqa	80(%r10),%xmm1
+
+.byte	102,15,56,0,226
+.byte	102,15,56,0,197
+.byte	102,15,56,0,203
+	pxor	%xmm4,%xmm0
+	addq	$16,%r9
+.byte	102,15,58,15,237,12
+	pxor	%xmm1,%xmm0
+	subq	$1,%rax
+
+L$dec_entry:
+
+	movdqa	%xmm9,%xmm1
+	pandn	%xmm0,%xmm1
+	movdqa	%xmm11,%xmm2
+	psrld	$4,%xmm1
+	pand	%xmm9,%xmm0
+.byte	102,15,56,0,208
+	movdqa	%xmm10,%xmm3
+	pxor	%xmm1,%xmm0
+.byte	102,15,56,0,217
+	movdqa	%xmm10,%xmm4
+	pxor	%xmm2,%xmm3
+.byte	102,15,56,0,224
+	pxor	%xmm2,%xmm4
+	movdqa	%xmm10,%xmm2
+.byte	102,15,56,0,211
+	movdqa	%xmm10,%xmm3
+	pxor	%xmm0,%xmm2
+.byte	102,15,56,0,220
+	movdqu	(%r9),%xmm0
+	pxor	%xmm1,%xmm3
+	jnz	L$dec_loop
+
+
+	movdqa	96(%r10),%xmm4
+.byte	102,15,56,0,226
+	pxor	%xmm0,%xmm4
+	movdqa	112(%r10),%xmm0
+	movdqa	-352(%r11),%xmm2
+.byte	102,15,56,0,195
+	pxor	%xmm4,%xmm0
+.byte	102,15,56,0,194
+	.byte	0xf3,0xc3
+
+
+
+
+
+
+
+
+.p2align	4
+_vpaes_schedule_core:
+
+
+
+
+
+	call	_vpaes_preheat
+	movdqa	L$k_rcon(%rip),%xmm8
+	movdqu	(%rdi),%xmm0
+
+
+	movdqa	%xmm0,%xmm3
+	leaq	L$k_ipt(%rip),%r11
+	call	_vpaes_schedule_transform
+	movdqa	%xmm0,%xmm7
+
+	leaq	L$k_sr(%rip),%r10
+	testq	%rcx,%rcx
+	jnz	L$schedule_am_decrypting
+
+
+	movdqu	%xmm0,(%rdx)
+	jmp	L$schedule_go
+
+L$schedule_am_decrypting:
+
+	movdqa	(%r8,%r10,1),%xmm1
+.byte	102,15,56,0,217
+	movdqu	%xmm3,(%rdx)
+	xorq	$48,%r8
+
+L$schedule_go:
+	cmpl	$192,%esi
+	ja	L$schedule_256
+	je	L$schedule_192
+
+
+
+
+
+
+
+
+
+
+L$schedule_128:
+	movl	$10,%esi
+
+L$oop_schedule_128:
+	call	_vpaes_schedule_round
+	decq	%rsi
+	jz	L$schedule_mangle_last
+	call	_vpaes_schedule_mangle
+	jmp	L$oop_schedule_128
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+.p2align	4
+L$schedule_192:
+	movdqu	8(%rdi),%xmm0
+	call	_vpaes_schedule_transform
+	movdqa	%xmm0,%xmm6
+	pxor	%xmm4,%xmm4
+	movhlps	%xmm4,%xmm6
+	movl	$4,%esi
+
+L$oop_schedule_192:
+	call	_vpaes_schedule_round
+.byte	102,15,58,15,198,8
+	call	_vpaes_schedule_mangle
+	call	_vpaes_schedule_192_smear
+	call	_vpaes_schedule_mangle
+	call	_vpaes_schedule_round
+	decq	%rsi
+	jz	L$schedule_mangle_last
+	call	_vpaes_schedule_mangle
+	call	_vpaes_schedule_192_smear
+	jmp	L$oop_schedule_192
+
+
+
+
+
+
+
+
+
+
+
+.p2align	4
+L$schedule_256:
+	movdqu	16(%rdi),%xmm0
+	call	_vpaes_schedule_transform
+	movl	$7,%esi
+
+L$oop_schedule_256:
+	call	_vpaes_schedule_mangle
+	movdqa	%xmm0,%xmm6
+
+
+	call	_vpaes_schedule_round
+	decq	%rsi
+	jz	L$schedule_mangle_last
+	call	_vpaes_schedule_mangle
+
+
+	pshufd	$255,%xmm0,%xmm0
+	movdqa	%xmm7,%xmm5
+	movdqa	%xmm6,%xmm7
+	call	_vpaes_schedule_low_round
+	movdqa	%xmm5,%xmm7
+
+	jmp	L$oop_schedule_256
+
+
+
+
+
+
+
+
+
+
+
+
+.p2align	4
+L$schedule_mangle_last:
+
+	leaq	L$k_deskew(%rip),%r11
+	testq	%rcx,%rcx
+	jnz	L$schedule_mangle_last_dec
+
+
+	movdqa	(%r8,%r10,1),%xmm1
+.byte	102,15,56,0,193
+	leaq	L$k_opt(%rip),%r11
+	addq	$32,%rdx
+
+L$schedule_mangle_last_dec:
+	addq	$-16,%rdx
+	pxor	L$k_s63(%rip),%xmm0
+	call	_vpaes_schedule_transform
+	movdqu	%xmm0,(%rdx)
+
+
+	pxor	%xmm0,%xmm0
+	pxor	%xmm1,%xmm1
+	pxor	%xmm2,%xmm2
+	pxor	%xmm3,%xmm3
+	pxor	%xmm4,%xmm4
+	pxor	%xmm5,%xmm5
+	pxor	%xmm6,%xmm6
+	pxor	%xmm7,%xmm7
+	.byte	0xf3,0xc3
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+.p2align	4
+_vpaes_schedule_192_smear:
+	pshufd	$128,%xmm6,%xmm1
+	pshufd	$254,%xmm7,%xmm0
+	pxor	%xmm1,%xmm6
+	pxor	%xmm1,%xmm1
+	pxor	%xmm0,%xmm6
+	movdqa	%xmm6,%xmm0
+	movhlps	%xmm1,%xmm6
+	.byte	0xf3,0xc3
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+.p2align	4
+_vpaes_schedule_round:
+
+	pxor	%xmm1,%xmm1
+.byte	102,65,15,58,15,200,15
+.byte	102,69,15,58,15,192,15
+	pxor	%xmm1,%xmm7
+
+
+	pshufd	$255,%xmm0,%xmm0
+.byte	102,15,58,15,192,1
+
+
+
+
+_vpaes_schedule_low_round:
+
+	movdqa	%xmm7,%xmm1
+	pslldq	$4,%xmm7
+	pxor	%xmm1,%xmm7
+	movdqa	%xmm7,%xmm1
+	pslldq	$8,%xmm7
+	pxor	%xmm1,%xmm7
+	pxor	L$k_s63(%rip),%xmm7
+
+
+	movdqa	%xmm9,%xmm1
+	pandn	%xmm0,%xmm1
+	psrld	$4,%xmm1
+	pand	%xmm9,%xmm0
+	movdqa	%xmm11,%xmm2
+.byte	102,15,56,0,208
+	pxor	%xmm1,%xmm0
+	movdqa	%xmm10,%xmm3
+.byte	102,15,56,0,217
+	pxor	%xmm2,%xmm3
+	movdqa	%xmm10,%xmm4
+.byte	102,15,56,0,224
+	pxor	%xmm2,%xmm4
+	movdqa	%xmm10,%xmm2
+.byte	102,15,56,0,211
+	pxor	%xmm0,%xmm2
+	movdqa	%xmm10,%xmm3
+.byte	102,15,56,0,220
+	pxor	%xmm1,%xmm3
+	movdqa	%xmm13,%xmm4
+.byte	102,15,56,0,226
+	movdqa	%xmm12,%xmm0
+.byte	102,15,56,0,195
+	pxor	%xmm4,%xmm0
+
+
+	pxor	%xmm7,%xmm0
+	movdqa	%xmm0,%xmm7
+	.byte	0xf3,0xc3
+
+
+
+
+
+
+
+
+
+
+
+
+.p2align	4
+_vpaes_schedule_transform:
+	movdqa	%xmm9,%xmm1
+	pandn	%xmm0,%xmm1
+	psrld	$4,%xmm1
+	pand	%xmm9,%xmm0
+	movdqa	(%r11),%xmm2
+.byte	102,15,56,0,208
+	movdqa	16(%r11),%xmm0
+.byte	102,15,56,0,193
+	pxor	%xmm2,%xmm0
+	.byte	0xf3,0xc3
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+.p2align	4
+_vpaes_schedule_mangle:
+	movdqa	%xmm0,%xmm4
+	movdqa	L$k_mc_forward(%rip),%xmm5
+	testq	%rcx,%rcx
+	jnz	L$schedule_mangle_dec
+
+
+	addq	$16,%rdx
+	pxor	L$k_s63(%rip),%xmm4
+.byte	102,15,56,0,229
+	movdqa	%xmm4,%xmm3
+.byte	102,15,56,0,229
+	pxor	%xmm4,%xmm3
+.byte	102,15,56,0,229
+	pxor	%xmm4,%xmm3
+
+	jmp	L$schedule_mangle_both
+.p2align	4
+L$schedule_mangle_dec:
+
+	leaq	L$k_dksd(%rip),%r11
+	movdqa	%xmm9,%xmm1
+	pandn	%xmm4,%xmm1
+	psrld	$4,%xmm1
+	pand	%xmm9,%xmm4
+
+	movdqa	0(%r11),%xmm2
+.byte	102,15,56,0,212
+	movdqa	16(%r11),%xmm3
+.byte	102,15,56,0,217
+	pxor	%xmm2,%xmm3
+.byte	102,15,56,0,221
+
+	movdqa	32(%r11),%xmm2
+.byte	102,15,56,0,212
+	pxor	%xmm3,%xmm2
+	movdqa	48(%r11),%xmm3
+.byte	102,15,56,0,217
+	pxor	%xmm2,%xmm3
+.byte	102,15,56,0,221
+
+	movdqa	64(%r11),%xmm2
+.byte	102,15,56,0,212
+	pxor	%xmm3,%xmm2
+	movdqa	80(%r11),%xmm3
+.byte	102,15,56,0,217
+	pxor	%xmm2,%xmm3
+.byte	102,15,56,0,221
+
+	movdqa	96(%r11),%xmm2
+.byte	102,15,56,0,212
+	pxor	%xmm3,%xmm2
+	movdqa	112(%r11),%xmm3
+.byte	102,15,56,0,217
+	pxor	%xmm2,%xmm3
+
+	addq	$-16,%rdx
+
+L$schedule_mangle_both:
+	movdqa	(%r8,%r10,1),%xmm1
+.byte	102,15,56,0,217
+	addq	$-16,%r8
+	andq	$48,%r8
+	movdqu	%xmm3,(%rdx)
+	.byte	0xf3,0xc3
+
+
+
+
+
+.globl	_vpaes_set_encrypt_key
+.private_extern _vpaes_set_encrypt_key
+
+.p2align	4
+_vpaes_set_encrypt_key:
+	movl	%esi,%eax
+	shrl	$5,%eax
+	addl	$5,%eax
+	movl	%eax,240(%rdx)
+
+	movl	$0,%ecx
+	movl	$48,%r8d
+	call	_vpaes_schedule_core
+	xorl	%eax,%eax
+	.byte	0xf3,0xc3
+
+
+.globl	_vpaes_set_decrypt_key
+.private_extern _vpaes_set_decrypt_key
+
+.p2align	4
+_vpaes_set_decrypt_key:
+	movl	%esi,%eax
+	shrl	$5,%eax
+	addl	$5,%eax
+	movl	%eax,240(%rdx)
+	shll	$4,%eax
+	leaq	16(%rdx,%rax,1),%rdx
+
+	movl	$1,%ecx
+	movl	%esi,%r8d
+	shrl	$1,%r8d
+	andl	$32,%r8d
+	xorl	$32,%r8d
+	call	_vpaes_schedule_core
+	xorl	%eax,%eax
+	.byte	0xf3,0xc3
+
+
+.globl	_vpaes_encrypt
+.private_extern _vpaes_encrypt
+
+.p2align	4
+_vpaes_encrypt:
+	movdqu	(%rdi),%xmm0
+	call	_vpaes_preheat
+	call	_vpaes_encrypt_core
+	movdqu	%xmm0,(%rsi)
+	.byte	0xf3,0xc3
+
+
+.globl	_vpaes_decrypt
+.private_extern _vpaes_decrypt
+
+.p2align	4
+_vpaes_decrypt:
+	movdqu	(%rdi),%xmm0
+	call	_vpaes_preheat
+	call	_vpaes_decrypt_core
+	movdqu	%xmm0,(%rsi)
+	.byte	0xf3,0xc3
+
+.globl	_vpaes_cbc_encrypt
+.private_extern _vpaes_cbc_encrypt
+
+.p2align	4
+_vpaes_cbc_encrypt:
+	xchgq	%rcx,%rdx
+	subq	$16,%rcx
+	jc	L$cbc_abort
+	movdqu	(%r8),%xmm6
+	subq	%rdi,%rsi
+	call	_vpaes_preheat
+	cmpl	$0,%r9d
+	je	L$cbc_dec_loop
+	jmp	L$cbc_enc_loop
+.p2align	4
+L$cbc_enc_loop:
+	movdqu	(%rdi),%xmm0
+	pxor	%xmm6,%xmm0
+	call	_vpaes_encrypt_core
+	movdqa	%xmm0,%xmm6
+	movdqu	%xmm0,(%rsi,%rdi,1)
+	leaq	16(%rdi),%rdi
+	subq	$16,%rcx
+	jnc	L$cbc_enc_loop
+	jmp	L$cbc_done
+.p2align	4
+L$cbc_dec_loop:
+	movdqu	(%rdi),%xmm0
+	movdqa	%xmm0,%xmm7
+	call	_vpaes_decrypt_core
+	pxor	%xmm6,%xmm0
+	movdqa	%xmm7,%xmm6
+	movdqu	%xmm0,(%rsi,%rdi,1)
+	leaq	16(%rdi),%rdi
+	subq	$16,%rcx
+	jnc	L$cbc_dec_loop
+L$cbc_done:
+	movdqu	%xmm6,(%r8)
+L$cbc_abort:
+	.byte	0xf3,0xc3
+
+
+
+
+
+
+
+
+.p2align	4
+_vpaes_preheat:
+	leaq	L$k_s0F(%rip),%r10
+	movdqa	-32(%r10),%xmm10
+	movdqa	-16(%r10),%xmm11
+	movdqa	0(%r10),%xmm9
+	movdqa	48(%r10),%xmm13
+	movdqa	64(%r10),%xmm12
+	movdqa	80(%r10),%xmm15
+	movdqa	96(%r10),%xmm14
+	.byte	0xf3,0xc3
+
+
+
+
+
+
+
+.p2align	6
+_vpaes_consts:
+L$k_inv:
+.quad	0x0E05060F0D080180, 0x040703090A0B0C02
+.quad	0x01040A060F0B0780, 0x030D0E0C02050809
+
+L$k_s0F:
+.quad	0x0F0F0F0F0F0F0F0F, 0x0F0F0F0F0F0F0F0F
+
+L$k_ipt:
+.quad	0xC2B2E8985A2A7000, 0xCABAE09052227808
+.quad	0x4C01307D317C4D00, 0xCD80B1FCB0FDCC81
+
+L$k_sb1:
+.quad	0xB19BE18FCB503E00, 0xA5DF7A6E142AF544
+.quad	0x3618D415FAE22300, 0x3BF7CCC10D2ED9EF
+L$k_sb2:
+.quad	0xE27A93C60B712400, 0x5EB7E955BC982FCD
+.quad	0x69EB88400AE12900, 0xC2A163C8AB82234A
+L$k_sbo:
+.quad	0xD0D26D176FBDC700, 0x15AABF7AC502A878
+.quad	0xCFE474A55FBB6A00, 0x8E1E90D1412B35FA
+
+L$k_mc_forward:
+.quad	0x0407060500030201, 0x0C0F0E0D080B0A09
+.quad	0x080B0A0904070605, 0x000302010C0F0E0D
+.quad	0x0C0F0E0D080B0A09, 0x0407060500030201
+.quad	0x000302010C0F0E0D, 0x080B0A0904070605
+
+L$k_mc_backward:
+.quad	0x0605040702010003, 0x0E0D0C0F0A09080B
+.quad	0x020100030E0D0C0F, 0x0A09080B06050407
+.quad	0x0E0D0C0F0A09080B, 0x0605040702010003
+.quad	0x0A09080B06050407, 0x020100030E0D0C0F
+
+L$k_sr:
+.quad	0x0706050403020100, 0x0F0E0D0C0B0A0908
+.quad	0x030E09040F0A0500, 0x0B06010C07020D08
+.quad	0x0F060D040B020900, 0x070E050C030A0108
+.quad	0x0B0E0104070A0D00, 0x0306090C0F020508
+
+L$k_rcon:
+.quad	0x1F8391B9AF9DEEB6, 0x702A98084D7C7D81
+
+L$k_s63:
+.quad	0x5B5B5B5B5B5B5B5B, 0x5B5B5B5B5B5B5B5B
+
+L$k_opt:
+.quad	0xFF9F4929D6B66000, 0xF7974121DEBE6808
+.quad	0x01EDBD5150BCEC00, 0xE10D5DB1B05C0CE0
+
+L$k_deskew:
+.quad	0x07E4A34047A4E300, 0x1DFEB95A5DBEF91A
+.quad	0x5F36B5DC83EA6900, 0x2841C2ABF49D1E77
+
+
+
+
+
+L$k_dksd:
+.quad	0xFEB91A5DA3E44700, 0x0740E3A45A1DBEF9
+.quad	0x41C277F4B5368300, 0x5FDC69EAAB289D1E
+L$k_dksb:
+.quad	0x9A4FCA1F8550D500, 0x03D653861CC94C99
+.quad	0x115BEDA7B6FC4A00, 0xD993256F7E3482C8
+L$k_dkse:
+.quad	0xD5031CCA1FC9D600, 0x53859A4C994F5086
+.quad	0xA23196054FDC7BE8, 0xCD5EF96A20B31487
+L$k_dks9:
+.quad	0xB6116FC87ED9A700, 0x4AED933482255BFC
+.quad	0x4576516227143300, 0x8BB89FACE9DAFDCE
+
+
+
+
+
+L$k_dipt:
+.quad	0x0F505B040B545F00, 0x154A411E114E451A
+.quad	0x86E383E660056500, 0x12771772F491F194
+
+L$k_dsb9:
+.quad	0x851C03539A86D600, 0xCAD51F504F994CC9
+.quad	0xC03B1789ECD74900, 0x725E2C9EB2FBA565
+L$k_dsbd:
+.quad	0x7D57CCDFE6B1A200, 0xF56E9B13882A4439
+.quad	0x3CE2FAF724C6CB00, 0x2931180D15DEEFD3
+L$k_dsbb:
+.quad	0xD022649296B44200, 0x602646F6B0F2D404
+.quad	0xC19498A6CD596700, 0xF3FF0C3E3255AA6B
+L$k_dsbe:
+.quad	0x46F2929626D4D000, 0x2242600464B4F6B0
+.quad	0x0C55A6CDFFAAC100, 0x9467F36B98593E32
+L$k_dsbo:
+.quad	0x1387EA537EF94000, 0xC7AA6DB9D4943E2D
+.quad	0x12D7560F93441D00, 0xCA4B8159D8C58E9C
+.byte	86,101,99,116,111,114,32,80,101,114,109,117,116,97,116,105,111,110,32,65,69,83,32,102,111,114,32,120,56,54,95,54,52,47,83,83,83,69,51,44,32,77,105,107,101,32,72,97,109,98,117,114,103,32,40,83,116,97,110,102,111,114,100,32,85,110,105,118,101,114,115,105,116,121,41,0
+.p2align	6
+
+#endif
diff --git a/third_party/boringssl/mac-x86_64/crypto/bn/rsaz-avx2.S b/third_party/boringssl/mac-x86_64/crypto/bn/rsaz-avx2.S
new file mode 100644
index 0000000..8ba2019
--- /dev/null
+++ b/third_party/boringssl/mac-x86_64/crypto/bn/rsaz-avx2.S
@@ -0,0 +1,34 @@
+#if defined(__x86_64__)
+.text	
+
+.globl	_rsaz_avx2_eligible
+.private_extern _rsaz_avx2_eligible
+
+_rsaz_avx2_eligible:
+	xorl	%eax,%eax
+	.byte	0xf3,0xc3
+
+
+.globl	_rsaz_1024_sqr_avx2
+.private_extern _rsaz_1024_sqr_avx2
+.globl	_rsaz_1024_mul_avx2
+.private_extern _rsaz_1024_mul_avx2
+.globl	_rsaz_1024_norm2red_avx2
+.private_extern _rsaz_1024_norm2red_avx2
+.globl	_rsaz_1024_red2norm_avx2
+.private_extern _rsaz_1024_red2norm_avx2
+.globl	_rsaz_1024_scatter5_avx2
+.private_extern _rsaz_1024_scatter5_avx2
+.globl	_rsaz_1024_gather5_avx2
+.private_extern _rsaz_1024_gather5_avx2
+
+_rsaz_1024_sqr_avx2:
+_rsaz_1024_mul_avx2:
+_rsaz_1024_norm2red_avx2:
+_rsaz_1024_red2norm_avx2:
+_rsaz_1024_scatter5_avx2:
+_rsaz_1024_gather5_avx2:
+.byte	0x0f,0x0b
+	.byte	0xf3,0xc3
+
+#endif
diff --git a/third_party/boringssl/mac-x86_64/crypto/bn/rsaz-x86_64.S b/third_party/boringssl/mac-x86_64/crypto/bn/rsaz-x86_64.S
new file mode 100644
index 0000000..5e9e82f
--- /dev/null
+++ b/third_party/boringssl/mac-x86_64/crypto/bn/rsaz-x86_64.S
@@ -0,0 +1,1126 @@
+#if defined(__x86_64__)
+.text	
+
+
+
+.globl	_rsaz_512_sqr
+.private_extern _rsaz_512_sqr
+
+.p2align	5
+_rsaz_512_sqr:
+	pushq	%rbx
+	pushq	%rbp
+	pushq	%r12
+	pushq	%r13
+	pushq	%r14
+	pushq	%r15
+
+	subq	$128+24,%rsp
+L$sqr_body:
+	movq	%rdx,%rbp
+	movq	(%rsi),%rdx
+	movq	8(%rsi),%rax
+	movq	%rcx,128(%rsp)
+	jmp	L$oop_sqr
+
+.p2align	5
+L$oop_sqr:
+	movl	%r8d,128+8(%rsp)
+
+	movq	%rdx,%rbx
+	mulq	%rdx
+	movq	%rax,%r8
+	movq	16(%rsi),%rax
+	movq	%rdx,%r9
+
+	mulq	%rbx
+	addq	%rax,%r9
+	movq	24(%rsi),%rax
+	movq	%rdx,%r10
+	adcq	$0,%r10
+
+	mulq	%rbx
+	addq	%rax,%r10
+	movq	32(%rsi),%rax
+	movq	%rdx,%r11
+	adcq	$0,%r11
+
+	mulq	%rbx
+	addq	%rax,%r11
+	movq	40(%rsi),%rax
+	movq	%rdx,%r12
+	adcq	$0,%r12
+
+	mulq	%rbx
+	addq	%rax,%r12
+	movq	48(%rsi),%rax
+	movq	%rdx,%r13
+	adcq	$0,%r13
+
+	mulq	%rbx
+	addq	%rax,%r13
+	movq	56(%rsi),%rax
+	movq	%rdx,%r14
+	adcq	$0,%r14
+
+	mulq	%rbx
+	addq	%rax,%r14
+	movq	%rbx,%rax
+	movq	%rdx,%r15
+	adcq	$0,%r15
+
+	addq	%r8,%r8
+	movq	%r9,%rcx
+	adcq	%r9,%r9
+
+	mulq	%rax
+	movq	%rax,(%rsp)
+	addq	%rdx,%r8
+	adcq	$0,%r9
+
+	movq	%r8,8(%rsp)
+	shrq	$63,%rcx
+
+
+	movq	8(%rsi),%r8
+	movq	16(%rsi),%rax
+	mulq	%r8
+	addq	%rax,%r10
+	movq	24(%rsi),%rax
+	movq	%rdx,%rbx
+	adcq	$0,%rbx
+
+	mulq	%r8
+	addq	%rax,%r11
+	movq	32(%rsi),%rax
+	adcq	$0,%rdx
+	addq	%rbx,%r11
+	movq	%rdx,%rbx
+	adcq	$0,%rbx
+
+	mulq	%r8
+	addq	%rax,%r12
+	movq	40(%rsi),%rax
+	adcq	$0,%rdx
+	addq	%rbx,%r12
+	movq	%rdx,%rbx
+	adcq	$0,%rbx
+
+	mulq	%r8
+	addq	%rax,%r13
+	movq	48(%rsi),%rax
+	adcq	$0,%rdx
+	addq	%rbx,%r13
+	movq	%rdx,%rbx
+	adcq	$0,%rbx
+
+	mulq	%r8
+	addq	%rax,%r14
+	movq	56(%rsi),%rax
+	adcq	$0,%rdx
+	addq	%rbx,%r14
+	movq	%rdx,%rbx
+	adcq	$0,%rbx
+
+	mulq	%r8
+	addq	%rax,%r15
+	movq	%r8,%rax
+	adcq	$0,%rdx
+	addq	%rbx,%r15
+	movq	%rdx,%r8
+	movq	%r10,%rdx
+	adcq	$0,%r8
+
+	addq	%rdx,%rdx
+	leaq	(%rcx,%r10,2),%r10
+	movq	%r11,%rbx
+	adcq	%r11,%r11
+
+	mulq	%rax
+	addq	%rax,%r9
+	adcq	%rdx,%r10
+	adcq	$0,%r11
+
+	movq	%r9,16(%rsp)
+	movq	%r10,24(%rsp)
+	shrq	$63,%rbx
+
+
+	movq	16(%rsi),%r9
+	movq	24(%rsi),%rax
+	mulq	%r9
+	addq	%rax,%r12
+	movq	32(%rsi),%rax
+	movq	%rdx,%rcx
+	adcq	$0,%rcx
+
+	mulq	%r9
+	addq	%rax,%r13
+	movq	40(%rsi),%rax
+	adcq	$0,%rdx
+	addq	%rcx,%r13
+	movq	%rdx,%rcx
+	adcq	$0,%rcx
+
+	mulq	%r9
+	addq	%rax,%r14
+	movq	48(%rsi),%rax
+	adcq	$0,%rdx
+	addq	%rcx,%r14
+	movq	%rdx,%rcx
+	adcq	$0,%rcx
+
+	mulq	%r9
+	movq	%r12,%r10
+	leaq	(%rbx,%r12,2),%r12
+	addq	%rax,%r15
+	movq	56(%rsi),%rax
+	adcq	$0,%rdx
+	addq	%rcx,%r15
+	movq	%rdx,%rcx
+	adcq	$0,%rcx
+
+	mulq	%r9
+	shrq	$63,%r10
+	addq	%rax,%r8
+	movq	%r9,%rax
+	adcq	$0,%rdx
+	addq	%rcx,%r8
+	movq	%rdx,%r9
+	adcq	$0,%r9
+
+	movq	%r13,%rcx
+	leaq	(%r10,%r13,2),%r13
+
+	mulq	%rax
+	addq	%rax,%r11
+	adcq	%rdx,%r12
+	adcq	$0,%r13
+
+	movq	%r11,32(%rsp)
+	movq	%r12,40(%rsp)
+	shrq	$63,%rcx
+
+
+	movq	24(%rsi),%r10
+	movq	32(%rsi),%rax
+	mulq	%r10
+	addq	%rax,%r14
+	movq	40(%rsi),%rax
+	movq	%rdx,%rbx
+	adcq	$0,%rbx
+
+	mulq	%r10
+	addq	%rax,%r15
+	movq	48(%rsi),%rax
+	adcq	$0,%rdx
+	addq	%rbx,%r15
+	movq	%rdx,%rbx
+	adcq	$0,%rbx
+
+	mulq	%r10
+	movq	%r14,%r12
+	leaq	(%rcx,%r14,2),%r14
+	addq	%rax,%r8
+	movq	56(%rsi),%rax
+	adcq	$0,%rdx
+	addq	%rbx,%r8
+	movq	%rdx,%rbx
+	adcq	$0,%rbx
+
+	mulq	%r10
+	shrq	$63,%r12
+	addq	%rax,%r9
+	movq	%r10,%rax
+	adcq	$0,%rdx
+	addq	%rbx,%r9
+	movq	%rdx,%r10
+	adcq	$0,%r10
+
+	movq	%r15,%rbx
+	leaq	(%r12,%r15,2),%r15
+
+	mulq	%rax
+	addq	%rax,%r13
+	adcq	%rdx,%r14
+	adcq	$0,%r15
+
+	movq	%r13,48(%rsp)
+	movq	%r14,56(%rsp)
+	shrq	$63,%rbx
+
+
+	movq	32(%rsi),%r11
+	movq	40(%rsi),%rax
+	mulq	%r11
+	addq	%rax,%r8
+	movq	48(%rsi),%rax
+	movq	%rdx,%rcx
+	adcq	$0,%rcx
+
+	mulq	%r11
+	addq	%rax,%r9
+	movq	56(%rsi),%rax
+	adcq	$0,%rdx
+	movq	%r8,%r12
+	leaq	(%rbx,%r8,2),%r8
+	addq	%rcx,%r9
+	movq	%rdx,%rcx
+	adcq	$0,%rcx
+
+	mulq	%r11
+	shrq	$63,%r12
+	addq	%rax,%r10
+	movq	%r11,%rax
+	adcq	$0,%rdx
+	addq	%rcx,%r10
+	movq	%rdx,%r11
+	adcq	$0,%r11
+
+	movq	%r9,%rcx
+	leaq	(%r12,%r9,2),%r9
+
+	mulq	%rax
+	addq	%rax,%r15
+	adcq	%rdx,%r8
+	adcq	$0,%r9
+
+	movq	%r15,64(%rsp)
+	movq	%r8,72(%rsp)
+	shrq	$63,%rcx
+
+
+	movq	40(%rsi),%r12
+	movq	48(%rsi),%rax
+	mulq	%r12
+	addq	%rax,%r10
+	movq	56(%rsi),%rax
+	movq	%rdx,%rbx
+	adcq	$0,%rbx
+
+	mulq	%r12
+	addq	%rax,%r11
+	movq	%r12,%rax
+	movq	%r10,%r15
+	leaq	(%rcx,%r10,2),%r10
+	adcq	$0,%rdx
+	shrq	$63,%r15
+	addq	%rbx,%r11
+	movq	%rdx,%r12
+	adcq	$0,%r12
+
+	movq	%r11,%rbx
+	leaq	(%r15,%r11,2),%r11
+
+	mulq	%rax
+	addq	%rax,%r9
+	adcq	%rdx,%r10
+	adcq	$0,%r11
+
+	movq	%r9,80(%rsp)
+	movq	%r10,88(%rsp)
+
+
+	movq	48(%rsi),%r13
+	movq	56(%rsi),%rax
+	mulq	%r13
+	addq	%rax,%r12
+	movq	%r13,%rax
+	movq	%rdx,%r13
+	adcq	$0,%r13
+
+	xorq	%r14,%r14
+	shlq	$1,%rbx
+	adcq	%r12,%r12
+	adcq	%r13,%r13
+	adcq	%r14,%r14
+
+	mulq	%rax
+	addq	%rax,%r11
+	adcq	%rdx,%r12
+	adcq	$0,%r13
+
+	movq	%r11,96(%rsp)
+	movq	%r12,104(%rsp)
+
+
+	movq	56(%rsi),%rax
+	mulq	%rax
+	addq	%rax,%r13
+	adcq	$0,%rdx
+
+	addq	%rdx,%r14
+
+	movq	%r13,112(%rsp)
+	movq	%r14,120(%rsp)
+
+	movq	(%rsp),%r8
+	movq	8(%rsp),%r9
+	movq	16(%rsp),%r10
+	movq	24(%rsp),%r11
+	movq	32(%rsp),%r12
+	movq	40(%rsp),%r13
+	movq	48(%rsp),%r14
+	movq	56(%rsp),%r15
+
+	call	__rsaz_512_reduce
+
+	addq	64(%rsp),%r8
+	adcq	72(%rsp),%r9
+	adcq	80(%rsp),%r10
+	adcq	88(%rsp),%r11
+	adcq	96(%rsp),%r12
+	adcq	104(%rsp),%r13
+	adcq	112(%rsp),%r14
+	adcq	120(%rsp),%r15
+	sbbq	%rcx,%rcx
+
+	call	__rsaz_512_subtract
+
+	movq	%r8,%rdx
+	movq	%r9,%rax
+	movl	128+8(%rsp),%r8d
+	movq	%rdi,%rsi
+
+	decl	%r8d
+	jnz	L$oop_sqr
+
+	leaq	128+24+48(%rsp),%rax
+	movq	-48(%rax),%r15
+	movq	-40(%rax),%r14
+	movq	-32(%rax),%r13
+	movq	-24(%rax),%r12
+	movq	-16(%rax),%rbp
+	movq	-8(%rax),%rbx
+	leaq	(%rax),%rsp
+L$sqr_epilogue:
+	.byte	0xf3,0xc3
+
+.globl	_rsaz_512_mul
+.private_extern _rsaz_512_mul
+
+.p2align	5
+_rsaz_512_mul:
+	pushq	%rbx
+	pushq	%rbp
+	pushq	%r12
+	pushq	%r13
+	pushq	%r14
+	pushq	%r15
+
+	subq	$128+24,%rsp
+L$mul_body:
+.byte	102,72,15,110,199
+.byte	102,72,15,110,201
+	movq	%r8,128(%rsp)
+	movq	(%rdx),%rbx
+	movq	%rdx,%rbp
+	call	__rsaz_512_mul
+
+.byte	102,72,15,126,199
+.byte	102,72,15,126,205
+
+	movq	(%rsp),%r8
+	movq	8(%rsp),%r9
+	movq	16(%rsp),%r10
+	movq	24(%rsp),%r11
+	movq	32(%rsp),%r12
+	movq	40(%rsp),%r13
+	movq	48(%rsp),%r14
+	movq	56(%rsp),%r15
+
+	call	__rsaz_512_reduce
+	addq	64(%rsp),%r8
+	adcq	72(%rsp),%r9
+	adcq	80(%rsp),%r10
+	adcq	88(%rsp),%r11
+	adcq	96(%rsp),%r12
+	adcq	104(%rsp),%r13
+	adcq	112(%rsp),%r14
+	adcq	120(%rsp),%r15
+	sbbq	%rcx,%rcx
+
+	call	__rsaz_512_subtract
+
+	leaq	128+24+48(%rsp),%rax
+	movq	-48(%rax),%r15
+	movq	-40(%rax),%r14
+	movq	-32(%rax),%r13
+	movq	-24(%rax),%r12
+	movq	-16(%rax),%rbp
+	movq	-8(%rax),%rbx
+	leaq	(%rax),%rsp
+L$mul_epilogue:
+	.byte	0xf3,0xc3
+
+.globl	_rsaz_512_mul_gather4
+.private_extern _rsaz_512_mul_gather4
+
+.p2align	5
+_rsaz_512_mul_gather4:
+	pushq	%rbx
+	pushq	%rbp
+	pushq	%r12
+	pushq	%r13
+	pushq	%r14
+	pushq	%r15
+
+	movl	%r9d,%r9d
+	subq	$128+24,%rsp
+L$mul_gather4_body:
+	movl	64(%rdx,%r9,4),%eax
+.byte	102,72,15,110,199
+	movl	(%rdx,%r9,4),%ebx
+.byte	102,72,15,110,201
+	movq	%r8,128(%rsp)
+
+	shlq	$32,%rax
+	orq	%rax,%rbx
+	movq	(%rsi),%rax
+	movq	8(%rsi),%rcx
+	leaq	128(%rdx,%r9,4),%rbp
+	mulq	%rbx
+	movq	%rax,(%rsp)
+	movq	%rcx,%rax
+	movq	%rdx,%r8
+
+	mulq	%rbx
+	movd	(%rbp),%xmm4
+	addq	%rax,%r8
+	movq	16(%rsi),%rax
+	movq	%rdx,%r9
+	adcq	$0,%r9
+
+	mulq	%rbx
+	movd	64(%rbp),%xmm5
+	addq	%rax,%r9
+	movq	24(%rsi),%rax
+	movq	%rdx,%r10
+	adcq	$0,%r10
+
+	mulq	%rbx
+	pslldq	$4,%xmm5
+	addq	%rax,%r10
+	movq	32(%rsi),%rax
+	movq	%rdx,%r11
+	adcq	$0,%r11
+
+	mulq	%rbx
+	por	%xmm5,%xmm4
+	addq	%rax,%r11
+	movq	40(%rsi),%rax
+	movq	%rdx,%r12
+	adcq	$0,%r12
+
+	mulq	%rbx
+	addq	%rax,%r12
+	movq	48(%rsi),%rax
+	movq	%rdx,%r13
+	adcq	$0,%r13
+
+	mulq	%rbx
+	leaq	128(%rbp),%rbp
+	addq	%rax,%r13
+	movq	56(%rsi),%rax
+	movq	%rdx,%r14
+	adcq	$0,%r14
+
+	mulq	%rbx
+.byte	102,72,15,126,227
+	addq	%rax,%r14
+	movq	(%rsi),%rax
+	movq	%rdx,%r15
+	adcq	$0,%r15
+
+	leaq	8(%rsp),%rdi
+	movl	$7,%ecx
+	jmp	L$oop_mul_gather
+
+.p2align	5
+L$oop_mul_gather:
+	mulq	%rbx
+	addq	%rax,%r8
+	movq	8(%rsi),%rax
+	movq	%r8,(%rdi)
+	movq	%rdx,%r8
+	adcq	$0,%r8
+
+	mulq	%rbx
+	movd	(%rbp),%xmm4
+	addq	%rax,%r9
+	movq	16(%rsi),%rax
+	adcq	$0,%rdx
+	addq	%r9,%r8
+	movq	%rdx,%r9
+	adcq	$0,%r9
+
+	mulq	%rbx
+	movd	64(%rbp),%xmm5
+	addq	%rax,%r10
+	movq	24(%rsi),%rax
+	adcq	$0,%rdx
+	addq	%r10,%r9
+	movq	%rdx,%r10
+	adcq	$0,%r10
+
+	mulq	%rbx
+	pslldq	$4,%xmm5
+	addq	%rax,%r11
+	movq	32(%rsi),%rax
+	adcq	$0,%rdx
+	addq	%r11,%r10
+	movq	%rdx,%r11
+	adcq	$0,%r11
+
+	mulq	%rbx
+	por	%xmm5,%xmm4
+	addq	%rax,%r12
+	movq	40(%rsi),%rax
+	adcq	$0,%rdx
+	addq	%r12,%r11
+	movq	%rdx,%r12
+	adcq	$0,%r12
+
+	mulq	%rbx
+	addq	%rax,%r13
+	movq	48(%rsi),%rax
+	adcq	$0,%rdx
+	addq	%r13,%r12
+	movq	%rdx,%r13
+	adcq	$0,%r13
+
+	mulq	%rbx
+	addq	%rax,%r14
+	movq	56(%rsi),%rax
+	adcq	$0,%rdx
+	addq	%r14,%r13
+	movq	%rdx,%r14
+	adcq	$0,%r14
+
+	mulq	%rbx
+.byte	102,72,15,126,227
+	addq	%rax,%r15
+	movq	(%rsi),%rax
+	adcq	$0,%rdx
+	addq	%r15,%r14
+	movq	%rdx,%r15
+	adcq	$0,%r15
+
+	leaq	128(%rbp),%rbp
+	leaq	8(%rdi),%rdi
+
+	decl	%ecx
+	jnz	L$oop_mul_gather
+
+	movq	%r8,(%rdi)
+	movq	%r9,8(%rdi)
+	movq	%r10,16(%rdi)
+	movq	%r11,24(%rdi)
+	movq	%r12,32(%rdi)
+	movq	%r13,40(%rdi)
+	movq	%r14,48(%rdi)
+	movq	%r15,56(%rdi)
+
+.byte	102,72,15,126,199
+.byte	102,72,15,126,205
+
+	movq	(%rsp),%r8
+	movq	8(%rsp),%r9
+	movq	16(%rsp),%r10
+	movq	24(%rsp),%r11
+	movq	32(%rsp),%r12
+	movq	40(%rsp),%r13
+	movq	48(%rsp),%r14
+	movq	56(%rsp),%r15
+
+	call	__rsaz_512_reduce
+	addq	64(%rsp),%r8
+	adcq	72(%rsp),%r9
+	adcq	80(%rsp),%r10
+	adcq	88(%rsp),%r11
+	adcq	96(%rsp),%r12
+	adcq	104(%rsp),%r13
+	adcq	112(%rsp),%r14
+	adcq	120(%rsp),%r15
+	sbbq	%rcx,%rcx
+
+	call	__rsaz_512_subtract
+
+	leaq	128+24+48(%rsp),%rax
+	movq	-48(%rax),%r15
+	movq	-40(%rax),%r14
+	movq	-32(%rax),%r13
+	movq	-24(%rax),%r12
+	movq	-16(%rax),%rbp
+	movq	-8(%rax),%rbx
+	leaq	(%rax),%rsp
+L$mul_gather4_epilogue:
+	.byte	0xf3,0xc3
+
+.globl	_rsaz_512_mul_scatter4
+.private_extern _rsaz_512_mul_scatter4
+
+.p2align	5
+_rsaz_512_mul_scatter4:
+	pushq	%rbx
+	pushq	%rbp
+	pushq	%r12
+	pushq	%r13
+	pushq	%r14
+	pushq	%r15
+
+	movl	%r9d,%r9d
+	subq	$128+24,%rsp
+L$mul_scatter4_body:
+	leaq	(%r8,%r9,4),%r8
+.byte	102,72,15,110,199
+.byte	102,72,15,110,202
+.byte	102,73,15,110,208
+	movq	%rcx,128(%rsp)
+
+	movq	%rdi,%rbp
+	movq	(%rdi),%rbx
+	call	__rsaz_512_mul
+
+.byte	102,72,15,126,199
+.byte	102,72,15,126,205
+
+	movq	(%rsp),%r8
+	movq	8(%rsp),%r9
+	movq	16(%rsp),%r10
+	movq	24(%rsp),%r11
+	movq	32(%rsp),%r12
+	movq	40(%rsp),%r13
+	movq	48(%rsp),%r14
+	movq	56(%rsp),%r15
+
+	call	__rsaz_512_reduce
+	addq	64(%rsp),%r8
+	adcq	72(%rsp),%r9
+	adcq	80(%rsp),%r10
+	adcq	88(%rsp),%r11
+	adcq	96(%rsp),%r12
+	adcq	104(%rsp),%r13
+	adcq	112(%rsp),%r14
+	adcq	120(%rsp),%r15
+.byte	102,72,15,126,214
+	sbbq	%rcx,%rcx
+
+	call	__rsaz_512_subtract
+
+	movl	%r8d,0(%rsi)
+	shrq	$32,%r8
+	movl	%r9d,128(%rsi)
+	shrq	$32,%r9
+	movl	%r10d,256(%rsi)
+	shrq	$32,%r10
+	movl	%r11d,384(%rsi)
+	shrq	$32,%r11
+	movl	%r12d,512(%rsi)
+	shrq	$32,%r12
+	movl	%r13d,640(%rsi)
+	shrq	$32,%r13
+	movl	%r14d,768(%rsi)
+	shrq	$32,%r14
+	movl	%r15d,896(%rsi)
+	shrq	$32,%r15
+	movl	%r8d,64(%rsi)
+	movl	%r9d,192(%rsi)
+	movl	%r10d,320(%rsi)
+	movl	%r11d,448(%rsi)
+	movl	%r12d,576(%rsi)
+	movl	%r13d,704(%rsi)
+	movl	%r14d,832(%rsi)
+	movl	%r15d,960(%rsi)
+
+	leaq	128+24+48(%rsp),%rax
+	movq	-48(%rax),%r15
+	movq	-40(%rax),%r14
+	movq	-32(%rax),%r13
+	movq	-24(%rax),%r12
+	movq	-16(%rax),%rbp
+	movq	-8(%rax),%rbx
+	leaq	(%rax),%rsp
+L$mul_scatter4_epilogue:
+	.byte	0xf3,0xc3
+
+.globl	_rsaz_512_mul_by_one
+.private_extern _rsaz_512_mul_by_one
+
+.p2align	5
+_rsaz_512_mul_by_one:
+	pushq	%rbx
+	pushq	%rbp
+	pushq	%r12
+	pushq	%r13
+	pushq	%r14
+	pushq	%r15
+
+	subq	$128+24,%rsp
+L$mul_by_one_body:
+	movq	%rdx,%rbp
+	movq	%rcx,128(%rsp)
+
+	movq	(%rsi),%r8
+	pxor	%xmm0,%xmm0
+	movq	8(%rsi),%r9
+	movq	16(%rsi),%r10
+	movq	24(%rsi),%r11
+	movq	32(%rsi),%r12
+	movq	40(%rsi),%r13
+	movq	48(%rsi),%r14
+	movq	56(%rsi),%r15
+
+	movdqa	%xmm0,(%rsp)
+	movdqa	%xmm0,16(%rsp)
+	movdqa	%xmm0,32(%rsp)
+	movdqa	%xmm0,48(%rsp)
+	movdqa	%xmm0,64(%rsp)
+	movdqa	%xmm0,80(%rsp)
+	movdqa	%xmm0,96(%rsp)
+	call	__rsaz_512_reduce
+	movq	%r8,(%rdi)
+	movq	%r9,8(%rdi)
+	movq	%r10,16(%rdi)
+	movq	%r11,24(%rdi)
+	movq	%r12,32(%rdi)
+	movq	%r13,40(%rdi)
+	movq	%r14,48(%rdi)
+	movq	%r15,56(%rdi)
+
+	leaq	128+24+48(%rsp),%rax
+	movq	-48(%rax),%r15
+	movq	-40(%rax),%r14
+	movq	-32(%rax),%r13
+	movq	-24(%rax),%r12
+	movq	-16(%rax),%rbp
+	movq	-8(%rax),%rbx
+	leaq	(%rax),%rsp
+L$mul_by_one_epilogue:
+	.byte	0xf3,0xc3
+
+
+.p2align	5
+__rsaz_512_reduce:
+	movq	%r8,%rbx
+	imulq	128+8(%rsp),%rbx
+	movq	0(%rbp),%rax
+	movl	$8,%ecx
+	jmp	L$reduction_loop
+
+.p2align	5
+L$reduction_loop:
+	mulq	%rbx
+	movq	8(%rbp),%rax
+	negq	%r8
+	movq	%rdx,%r8
+	adcq	$0,%r8
+
+	mulq	%rbx
+	addq	%rax,%r9
+	movq	16(%rbp),%rax
+	adcq	$0,%rdx
+	addq	%r9,%r8
+	movq	%rdx,%r9
+	adcq	$0,%r9
+
+	mulq	%rbx
+	addq	%rax,%r10
+	movq	24(%rbp),%rax
+	adcq	$0,%rdx
+	addq	%r10,%r9
+	movq	%rdx,%r10
+	adcq	$0,%r10
+
+	mulq	%rbx
+	addq	%rax,%r11
+	movq	32(%rbp),%rax
+	adcq	$0,%rdx
+	addq	%r11,%r10
+	movq	128+8(%rsp),%rsi
+
+
+	adcq	$0,%rdx
+	movq	%rdx,%r11
+
+	mulq	%rbx
+	addq	%rax,%r12
+	movq	40(%rbp),%rax
+	adcq	$0,%rdx
+	imulq	%r8,%rsi
+	addq	%r12,%r11
+	movq	%rdx,%r12
+	adcq	$0,%r12
+
+	mulq	%rbx
+	addq	%rax,%r13
+	movq	48(%rbp),%rax
+	adcq	$0,%rdx
+	addq	%r13,%r12
+	movq	%rdx,%r13
+	adcq	$0,%r13
+
+	mulq	%rbx
+	addq	%rax,%r14
+	movq	56(%rbp),%rax
+	adcq	$0,%rdx
+	addq	%r14,%r13
+	movq	%rdx,%r14
+	adcq	$0,%r14
+
+	mulq	%rbx
+	movq	%rsi,%rbx
+	addq	%rax,%r15
+	movq	0(%rbp),%rax
+	adcq	$0,%rdx
+	addq	%r15,%r14
+	movq	%rdx,%r15
+	adcq	$0,%r15
+
+	decl	%ecx
+	jne	L$reduction_loop
+
+	.byte	0xf3,0xc3
+
+
+.p2align	5
+__rsaz_512_subtract:
+	movq	%r8,(%rdi)
+	movq	%r9,8(%rdi)
+	movq	%r10,16(%rdi)
+	movq	%r11,24(%rdi)
+	movq	%r12,32(%rdi)
+	movq	%r13,40(%rdi)
+	movq	%r14,48(%rdi)
+	movq	%r15,56(%rdi)
+
+	movq	0(%rbp),%r8
+	movq	8(%rbp),%r9
+	negq	%r8
+	notq	%r9
+	andq	%rcx,%r8
+	movq	16(%rbp),%r10
+	andq	%rcx,%r9
+	notq	%r10
+	movq	24(%rbp),%r11
+	andq	%rcx,%r10
+	notq	%r11
+	movq	32(%rbp),%r12
+	andq	%rcx,%r11
+	notq	%r12
+	movq	40(%rbp),%r13
+	andq	%rcx,%r12
+	notq	%r13
+	movq	48(%rbp),%r14
+	andq	%rcx,%r13
+	notq	%r14
+	movq	56(%rbp),%r15
+	andq	%rcx,%r14
+	notq	%r15
+	andq	%rcx,%r15
+
+	addq	(%rdi),%r8
+	adcq	8(%rdi),%r9
+	adcq	16(%rdi),%r10
+	adcq	24(%rdi),%r11
+	adcq	32(%rdi),%r12
+	adcq	40(%rdi),%r13
+	adcq	48(%rdi),%r14
+	adcq	56(%rdi),%r15
+
+	movq	%r8,(%rdi)
+	movq	%r9,8(%rdi)
+	movq	%r10,16(%rdi)
+	movq	%r11,24(%rdi)
+	movq	%r12,32(%rdi)
+	movq	%r13,40(%rdi)
+	movq	%r14,48(%rdi)
+	movq	%r15,56(%rdi)
+
+	.byte	0xf3,0xc3
+
+
+.p2align	5
+__rsaz_512_mul:
+	leaq	8(%rsp),%rdi
+
+	movq	(%rsi),%rax
+	mulq	%rbx
+	movq	%rax,(%rdi)
+	movq	8(%rsi),%rax
+	movq	%rdx,%r8
+
+	mulq	%rbx
+	addq	%rax,%r8
+	movq	16(%rsi),%rax
+	movq	%rdx,%r9
+	adcq	$0,%r9
+
+	mulq	%rbx
+	addq	%rax,%r9
+	movq	24(%rsi),%rax
+	movq	%rdx,%r10
+	adcq	$0,%r10
+
+	mulq	%rbx
+	addq	%rax,%r10
+	movq	32(%rsi),%rax
+	movq	%rdx,%r11
+	adcq	$0,%r11
+
+	mulq	%rbx
+	addq	%rax,%r11
+	movq	40(%rsi),%rax
+	movq	%rdx,%r12
+	adcq	$0,%r12
+
+	mulq	%rbx
+	addq	%rax,%r12
+	movq	48(%rsi),%rax
+	movq	%rdx,%r13
+	adcq	$0,%r13
+
+	mulq	%rbx
+	addq	%rax,%r13
+	movq	56(%rsi),%rax
+	movq	%rdx,%r14
+	adcq	$0,%r14
+
+	mulq	%rbx
+	addq	%rax,%r14
+	movq	(%rsi),%rax
+	movq	%rdx,%r15
+	adcq	$0,%r15
+
+	leaq	8(%rbp),%rbp
+	leaq	8(%rdi),%rdi
+
+	movl	$7,%ecx
+	jmp	L$oop_mul
+
+.p2align	5
+L$oop_mul:
+	movq	(%rbp),%rbx
+	mulq	%rbx
+	addq	%rax,%r8
+	movq	8(%rsi),%rax
+	movq	%r8,(%rdi)
+	movq	%rdx,%r8
+	adcq	$0,%r8
+
+	mulq	%rbx
+	addq	%rax,%r9
+	movq	16(%rsi),%rax
+	adcq	$0,%rdx
+	addq	%r9,%r8
+	movq	%rdx,%r9
+	adcq	$0,%r9
+
+	mulq	%rbx
+	addq	%rax,%r10
+	movq	24(%rsi),%rax
+	adcq	$0,%rdx
+	addq	%r10,%r9
+	movq	%rdx,%r10
+	adcq	$0,%r10
+
+	mulq	%rbx
+	addq	%rax,%r11
+	movq	32(%rsi),%rax
+	adcq	$0,%rdx
+	addq	%r11,%r10
+	movq	%rdx,%r11
+	adcq	$0,%r11
+
+	mulq	%rbx
+	addq	%rax,%r12
+	movq	40(%rsi),%rax
+	adcq	$0,%rdx
+	addq	%r12,%r11
+	movq	%rdx,%r12
+	adcq	$0,%r12
+
+	mulq	%rbx
+	addq	%rax,%r13
+	movq	48(%rsi),%rax
+	adcq	$0,%rdx
+	addq	%r13,%r12
+	movq	%rdx,%r13
+	adcq	$0,%r13
+
+	mulq	%rbx
+	addq	%rax,%r14
+	movq	56(%rsi),%rax
+	adcq	$0,%rdx
+	addq	%r14,%r13
+	movq	%rdx,%r14
+	leaq	8(%rbp),%rbp
+	adcq	$0,%r14
+
+	mulq	%rbx
+	addq	%rax,%r15
+	movq	(%rsi),%rax
+	adcq	$0,%rdx
+	addq	%r15,%r14
+	movq	%rdx,%r15
+	adcq	$0,%r15
+
+	leaq	8(%rdi),%rdi
+
+	decl	%ecx
+	jnz	L$oop_mul
+
+	movq	%r8,(%rdi)
+	movq	%r9,8(%rdi)
+	movq	%r10,16(%rdi)
+	movq	%r11,24(%rdi)
+	movq	%r12,32(%rdi)
+	movq	%r13,40(%rdi)
+	movq	%r14,48(%rdi)
+	movq	%r15,56(%rdi)
+
+	.byte	0xf3,0xc3
+
+.globl	_rsaz_512_scatter4
+.private_extern _rsaz_512_scatter4
+
+.p2align	4
+_rsaz_512_scatter4:
+	leaq	(%rdi,%rdx,4),%rdi
+	movl	$8,%r9d
+	jmp	L$oop_scatter
+.p2align	4
+L$oop_scatter:
+	movq	(%rsi),%rax
+	leaq	8(%rsi),%rsi
+	movl	%eax,(%rdi)
+	shrq	$32,%rax
+	movl	%eax,64(%rdi)
+	leaq	128(%rdi),%rdi
+	decl	%r9d
+	jnz	L$oop_scatter
+	.byte	0xf3,0xc3
+
+
+.globl	_rsaz_512_gather4
+.private_extern _rsaz_512_gather4
+
+.p2align	4
+_rsaz_512_gather4:
+	leaq	(%rsi,%rdx,4),%rsi
+	movl	$8,%r9d
+	jmp	L$oop_gather
+.p2align	4
+L$oop_gather:
+	movl	(%rsi),%eax
+	movl	64(%rsi),%r8d
+	leaq	128(%rsi),%rsi
+	shlq	$32,%r8
+	orq	%r8,%rax
+	movq	%rax,(%rdi)
+	leaq	8(%rdi),%rdi
+	decl	%r9d
+	jnz	L$oop_gather
+	.byte	0xf3,0xc3
+
+#endif
diff --git a/third_party/boringssl/mac-x86_64/crypto/bn/x86_64-mont.S b/third_party/boringssl/mac-x86_64/crypto/bn/x86_64-mont.S
new file mode 100644
index 0000000..6b9bc05
--- /dev/null
+++ b/third_party/boringssl/mac-x86_64/crypto/bn/x86_64-mont.S
@@ -0,0 +1,726 @@
+#if defined(__x86_64__)
+.text	
+
+
+
+.globl	_bn_mul_mont
+.private_extern _bn_mul_mont
+
+.p2align	4
+_bn_mul_mont:
+	testl	$3,%r9d
+	jnz	L$mul_enter
+	cmpl	$8,%r9d
+	jb	L$mul_enter
+	cmpq	%rsi,%rdx
+	jne	L$mul4x_enter
+	testl	$7,%r9d
+	jz	L$sqr8x_enter
+	jmp	L$mul4x_enter
+
+.p2align	4
+L$mul_enter:
+	pushq	%rbx
+	pushq	%rbp
+	pushq	%r12
+	pushq	%r13
+	pushq	%r14
+	pushq	%r15
+
+	movl	%r9d,%r9d
+	leaq	2(%r9),%r10
+	movq	%rsp,%r11
+	negq	%r10
+	leaq	(%rsp,%r10,8),%rsp
+	andq	$-1024,%rsp
+
+	movq	%r11,8(%rsp,%r9,8)
+L$mul_body:
+	movq	%rdx,%r12
+	movq	(%r8),%r8
+	movq	(%r12),%rbx
+	movq	(%rsi),%rax
+
+	xorq	%r14,%r14
+	xorq	%r15,%r15
+
+	movq	%r8,%rbp
+	mulq	%rbx
+	movq	%rax,%r10
+	movq	(%rcx),%rax
+
+	imulq	%r10,%rbp
+	movq	%rdx,%r11
+
+	mulq	%rbp
+	addq	%rax,%r10
+	movq	8(%rsi),%rax
+	adcq	$0,%rdx
+	movq	%rdx,%r13
+
+	leaq	1(%r15),%r15
+	jmp	L$1st_enter
+
+.p2align	4
+L$1st:
+	addq	%rax,%r13
+	movq	(%rsi,%r15,8),%rax
+	adcq	$0,%rdx
+	addq	%r11,%r13
+	movq	%r10,%r11
+	adcq	$0,%rdx
+	movq	%r13,-16(%rsp,%r15,8)
+	movq	%rdx,%r13
+
+L$1st_enter:
+	mulq	%rbx
+	addq	%rax,%r11
+	movq	(%rcx,%r15,8),%rax
+	adcq	$0,%rdx
+	leaq	1(%r15),%r15
+	movq	%rdx,%r10
+
+	mulq	%rbp
+	cmpq	%r9,%r15
+	jne	L$1st
+
+	addq	%rax,%r13
+	movq	(%rsi),%rax
+	adcq	$0,%rdx
+	addq	%r11,%r13
+	adcq	$0,%rdx
+	movq	%r13,-16(%rsp,%r15,8)
+	movq	%rdx,%r13
+	movq	%r10,%r11
+
+	xorq	%rdx,%rdx
+	addq	%r11,%r13
+	adcq	$0,%rdx
+	movq	%r13,-8(%rsp,%r9,8)
+	movq	%rdx,(%rsp,%r9,8)
+
+	leaq	1(%r14),%r14
+	jmp	L$outer
+.p2align	4
+L$outer:
+	movq	(%r12,%r14,8),%rbx
+	xorq	%r15,%r15
+	movq	%r8,%rbp
+	movq	(%rsp),%r10
+	mulq	%rbx
+	addq	%rax,%r10
+	movq	(%rcx),%rax
+	adcq	$0,%rdx
+
+	imulq	%r10,%rbp
+	movq	%rdx,%r11
+
+	mulq	%rbp
+	addq	%rax,%r10
+	movq	8(%rsi),%rax
+	adcq	$0,%rdx
+	movq	8(%rsp),%r10
+	movq	%rdx,%r13
+
+	leaq	1(%r15),%r15
+	jmp	L$inner_enter
+
+.p2align	4
+L$inner:
+	addq	%rax,%r13
+	movq	(%rsi,%r15,8),%rax
+	adcq	$0,%rdx
+	addq	%r10,%r13
+	movq	(%rsp,%r15,8),%r10
+	adcq	$0,%rdx
+	movq	%r13,-16(%rsp,%r15,8)
+	movq	%rdx,%r13
+
+L$inner_enter:
+	mulq	%rbx
+	addq	%rax,%r11
+	movq	(%rcx,%r15,8),%rax
+	adcq	$0,%rdx
+	addq	%r11,%r10
+	movq	%rdx,%r11
+	adcq	$0,%r11
+	leaq	1(%r15),%r15
+
+	mulq	%rbp
+	cmpq	%r9,%r15
+	jne	L$inner
+
+	addq	%rax,%r13
+	movq	(%rsi),%rax
+	adcq	$0,%rdx
+	addq	%r10,%r13
+	movq	(%rsp,%r15,8),%r10
+	adcq	$0,%rdx
+	movq	%r13,-16(%rsp,%r15,8)
+	movq	%rdx,%r13
+
+	xorq	%rdx,%rdx
+	addq	%r11,%r13
+	adcq	$0,%rdx
+	addq	%r10,%r13
+	adcq	$0,%rdx
+	movq	%r13,-8(%rsp,%r9,8)
+	movq	%rdx,(%rsp,%r9,8)
+
+	leaq	1(%r14),%r14
+	cmpq	%r9,%r14
+	jb	L$outer
+
+	xorq	%r14,%r14
+	movq	(%rsp),%rax
+	leaq	(%rsp),%rsi
+	movq	%r9,%r15
+	jmp	L$sub
+.p2align	4
+L$sub:	sbbq	(%rcx,%r14,8),%rax
+	movq	%rax,(%rdi,%r14,8)
+	movq	8(%rsi,%r14,8),%rax
+	leaq	1(%r14),%r14
+	decq	%r15
+	jnz	L$sub
+
+	sbbq	$0,%rax
+	xorq	%r14,%r14
+	movq	%r9,%r15
+.p2align	4
+L$copy:
+	movq	(%rsp,%r14,8),%rsi
+	movq	(%rdi,%r14,8),%rcx
+	xorq	%rcx,%rsi
+	andq	%rax,%rsi
+	xorq	%rcx,%rsi
+	movq	%r14,(%rsp,%r14,8)
+	movq	%rsi,(%rdi,%r14,8)
+	leaq	1(%r14),%r14
+	subq	$1,%r15
+	jnz	L$copy
+
+	movq	8(%rsp,%r9,8),%rsi
+	movq	$1,%rax
+	movq	(%rsi),%r15
+	movq	8(%rsi),%r14
+	movq	16(%rsi),%r13
+	movq	24(%rsi),%r12
+	movq	32(%rsi),%rbp
+	movq	40(%rsi),%rbx
+	leaq	48(%rsi),%rsp
+L$mul_epilogue:
+	.byte	0xf3,0xc3
+
+
+.p2align	4
+bn_mul4x_mont:
+L$mul4x_enter:
+	pushq	%rbx
+	pushq	%rbp
+	pushq	%r12
+	pushq	%r13
+	pushq	%r14
+	pushq	%r15
+
+	movl	%r9d,%r9d
+	leaq	4(%r9),%r10
+	movq	%rsp,%r11
+	negq	%r10
+	leaq	(%rsp,%r10,8),%rsp
+	andq	$-1024,%rsp
+
+	movq	%r11,8(%rsp,%r9,8)
+L$mul4x_body:
+	movq	%rdi,16(%rsp,%r9,8)
+	movq	%rdx,%r12
+	movq	(%r8),%r8
+	movq	(%r12),%rbx
+	movq	(%rsi),%rax
+
+	xorq	%r14,%r14
+	xorq	%r15,%r15
+
+	movq	%r8,%rbp
+	mulq	%rbx
+	movq	%rax,%r10
+	movq	(%rcx),%rax
+
+	imulq	%r10,%rbp
+	movq	%rdx,%r11
+
+	mulq	%rbp
+	addq	%rax,%r10
+	movq	8(%rsi),%rax
+	adcq	$0,%rdx
+	movq	%rdx,%rdi
+
+	mulq	%rbx
+	addq	%rax,%r11
+	movq	8(%rcx),%rax
+	adcq	$0,%rdx
+	movq	%rdx,%r10
+
+	mulq	%rbp
+	addq	%rax,%rdi
+	movq	16(%rsi),%rax
+	adcq	$0,%rdx
+	addq	%r11,%rdi
+	leaq	4(%r15),%r15
+	adcq	$0,%rdx
+	movq	%rdi,(%rsp)
+	movq	%rdx,%r13
+	jmp	L$1st4x
+.p2align	4
+L$1st4x:
+	mulq	%rbx
+	addq	%rax,%r10
+	movq	-16(%rcx,%r15,8),%rax
+	adcq	$0,%rdx
+	movq	%rdx,%r11
+
+	mulq	%rbp
+	addq	%rax,%r13
+	movq	-8(%rsi,%r15,8),%rax
+	adcq	$0,%rdx
+	addq	%r10,%r13
+	adcq	$0,%rdx
+	movq	%r13,-24(%rsp,%r15,8)
+	movq	%rdx,%rdi
+
+	mulq	%rbx
+	addq	%rax,%r11
+	movq	-8(%rcx,%r15,8),%rax
+	adcq	$0,%rdx
+	movq	%rdx,%r10
+
+	mulq	%rbp
+	addq	%rax,%rdi
+	movq	(%rsi,%r15,8),%rax
+	adcq	$0,%rdx
+	addq	%r11,%rdi
+	adcq	$0,%rdx
+	movq	%rdi,-16(%rsp,%r15,8)
+	movq	%rdx,%r13
+
+	mulq	%rbx
+	addq	%rax,%r10
+	movq	(%rcx,%r15,8),%rax
+	adcq	$0,%rdx
+	movq	%rdx,%r11
+
+	mulq	%rbp
+	addq	%rax,%r13
+	movq	8(%rsi,%r15,8),%rax
+	adcq	$0,%rdx
+	addq	%r10,%r13
+	adcq	$0,%rdx
+	movq	%r13,-8(%rsp,%r15,8)
+	movq	%rdx,%rdi
+
+	mulq	%rbx
+	addq	%rax,%r11
+	movq	8(%rcx,%r15,8),%rax
+	adcq	$0,%rdx
+	leaq	4(%r15),%r15
+	movq	%rdx,%r10
+
+	mulq	%rbp
+	addq	%rax,%rdi
+	movq	-16(%rsi,%r15,8),%rax
+	adcq	$0,%rdx
+	addq	%r11,%rdi
+	adcq	$0,%rdx
+	movq	%rdi,-32(%rsp,%r15,8)
+	movq	%rdx,%r13
+	cmpq	%r9,%r15
+	jb	L$1st4x
+
+	mulq	%rbx
+	addq	%rax,%r10
+	movq	-16(%rcx,%r15,8),%rax
+	adcq	$0,%rdx
+	movq	%rdx,%r11
+
+	mulq	%rbp
+	addq	%rax,%r13
+	movq	-8(%rsi,%r15,8),%rax
+	adcq	$0,%rdx
+	addq	%r10,%r13
+	adcq	$0,%rdx
+	movq	%r13,-24(%rsp,%r15,8)
+	movq	%rdx,%rdi
+
+	mulq	%rbx
+	addq	%rax,%r11
+	movq	-8(%rcx,%r15,8),%rax
+	adcq	$0,%rdx
+	movq	%rdx,%r10
+
+	mulq	%rbp
+	addq	%rax,%rdi
+	movq	(%rsi),%rax
+	adcq	$0,%rdx
+	addq	%r11,%rdi
+	adcq	$0,%rdx
+	movq	%rdi,-16(%rsp,%r15,8)
+	movq	%rdx,%r13
+
+	xorq	%rdi,%rdi
+	addq	%r10,%r13
+	adcq	$0,%rdi
+	movq	%r13,-8(%rsp,%r15,8)
+	movq	%rdi,(%rsp,%r15,8)
+
+	leaq	1(%r14),%r14
+.p2align	2
+L$outer4x:
+	movq	(%r12,%r14,8),%rbx
+	xorq	%r15,%r15
+	movq	(%rsp),%r10
+	movq	%r8,%rbp
+	mulq	%rbx
+	addq	%rax,%r10
+	movq	(%rcx),%rax
+	adcq	$0,%rdx
+
+	imulq	%r10,%rbp
+	movq	%rdx,%r11
+
+	mulq	%rbp
+	addq	%rax,%r10
+	movq	8(%rsi),%rax
+	adcq	$0,%rdx
+	movq	%rdx,%rdi
+
+	mulq	%rbx
+	addq	%rax,%r11
+	movq	8(%rcx),%rax
+	adcq	$0,%rdx
+	addq	8(%rsp),%r11
+	adcq	$0,%rdx
+	movq	%rdx,%r10
+
+	mulq	%rbp
+	addq	%rax,%rdi
+	movq	16(%rsi),%rax
+	adcq	$0,%rdx
+	addq	%r11,%rdi
+	leaq	4(%r15),%r15
+	adcq	$0,%rdx
+	movq	%rdi,(%rsp)
+	movq	%rdx,%r13
+	jmp	L$inner4x
+.p2align	4
+L$inner4x:
+	mulq	%rbx
+	addq	%rax,%r10
+	movq	-16(%rcx,%r15,8),%rax
+	adcq	$0,%rdx
+	addq	-16(%rsp,%r15,8),%r10
+	adcq	$0,%rdx
+	movq	%rdx,%r11
+
+	mulq	%rbp
+	addq	%rax,%r13
+	movq	-8(%rsi,%r15,8),%rax
+	adcq	$0,%rdx
+	addq	%r10,%r13
+	adcq	$0,%rdx
+	movq	%r13,-24(%rsp,%r15,8)
+	movq	%rdx,%rdi
+
+	mulq	%rbx
+	addq	%rax,%r11
+	movq	-8(%rcx,%r15,8),%rax
+	adcq	$0,%rdx
+	addq	-8(%rsp,%r15,8),%r11
+	adcq	$0,%rdx
+	movq	%rdx,%r10
+
+	mulq	%rbp
+	addq	%rax,%rdi
+	movq	(%rsi,%r15,8),%rax
+	adcq	$0,%rdx
+	addq	%r11,%rdi
+	adcq	$0,%rdx
+	movq	%rdi,-16(%rsp,%r15,8)
+	movq	%rdx,%r13
+
+	mulq	%rbx
+	addq	%rax,%r10
+	movq	(%rcx,%r15,8),%rax
+	adcq	$0,%rdx
+	addq	(%rsp,%r15,8),%r10
+	adcq	$0,%rdx
+	movq	%rdx,%r11
+
+	mulq	%rbp
+	addq	%rax,%r13
+	movq	8(%rsi,%r15,8),%rax
+	adcq	$0,%rdx
+	addq	%r10,%r13
+	adcq	$0,%rdx
+	movq	%r13,-8(%rsp,%r15,8)
+	movq	%rdx,%rdi
+
+	mulq	%rbx
+	addq	%rax,%r11
+	movq	8(%rcx,%r15,8),%rax
+	adcq	$0,%rdx
+	addq	8(%rsp,%r15,8),%r11
+	adcq	$0,%rdx
+	leaq	4(%r15),%r15
+	movq	%rdx,%r10
+
+	mulq	%rbp
+	addq	%rax,%rdi
+	movq	-16(%rsi,%r15,8),%rax
+	adcq	$0,%rdx
+	addq	%r11,%rdi
+	adcq	$0,%rdx
+	movq	%rdi,-32(%rsp,%r15,8)
+	movq	%rdx,%r13
+	cmpq	%r9,%r15
+	jb	L$inner4x
+
+	mulq	%rbx
+	addq	%rax,%r10
+	movq	-16(%rcx,%r15,8),%rax
+	adcq	$0,%rdx
+	addq	-16(%rsp,%r15,8),%r10
+	adcq	$0,%rdx
+	movq	%rdx,%r11
+
+	mulq	%rbp
+	addq	%rax,%r13
+	movq	-8(%rsi,%r15,8),%rax
+	adcq	$0,%rdx
+	addq	%r10,%r13
+	adcq	$0,%rdx
+	movq	%r13,-24(%rsp,%r15,8)
+	movq	%rdx,%rdi
+
+	mulq	%rbx
+	addq	%rax,%r11
+	movq	-8(%rcx,%r15,8),%rax
+	adcq	$0,%rdx
+	addq	-8(%rsp,%r15,8),%r11
+	adcq	$0,%rdx
+	leaq	1(%r14),%r14
+	movq	%rdx,%r10
+
+	mulq	%rbp
+	addq	%rax,%rdi
+	movq	(%rsi),%rax
+	adcq	$0,%rdx
+	addq	%r11,%rdi
+	adcq	$0,%rdx
+	movq	%rdi,-16(%rsp,%r15,8)
+	movq	%rdx,%r13
+
+	xorq	%rdi,%rdi
+	addq	%r10,%r13
+	adcq	$0,%rdi
+	addq	(%rsp,%r9,8),%r13
+	adcq	$0,%rdi
+	movq	%r13,-8(%rsp,%r15,8)
+	movq	%rdi,(%rsp,%r15,8)
+
+	cmpq	%r9,%r14
+	jb	L$outer4x
+	movq	16(%rsp,%r9,8),%rdi
+	movq	0(%rsp),%rax
+	movq	8(%rsp),%rdx
+	shrq	$2,%r9
+	leaq	(%rsp),%rsi
+	xorq	%r14,%r14
+
+	subq	0(%rcx),%rax
+	movq	16(%rsi),%rbx
+	movq	24(%rsi),%rbp
+	sbbq	8(%rcx),%rdx
+	leaq	-1(%r9),%r15
+	jmp	L$sub4x
+.p2align	4
+L$sub4x:
+	movq	%rax,0(%rdi,%r14,8)
+	movq	%rdx,8(%rdi,%r14,8)
+	sbbq	16(%rcx,%r14,8),%rbx
+	movq	32(%rsi,%r14,8),%rax
+	movq	40(%rsi,%r14,8),%rdx
+	sbbq	24(%rcx,%r14,8),%rbp
+	movq	%rbx,16(%rdi,%r14,8)
+	movq	%rbp,24(%rdi,%r14,8)
+	sbbq	32(%rcx,%r14,8),%rax
+	movq	48(%rsi,%r14,8),%rbx
+	movq	56(%rsi,%r14,8),%rbp
+	sbbq	40(%rcx,%r14,8),%rdx
+	leaq	4(%r14),%r14
+	decq	%r15
+	jnz	L$sub4x
+
+	movq	%rax,0(%rdi,%r14,8)
+	movq	32(%rsi,%r14,8),%rax
+	sbbq	16(%rcx,%r14,8),%rbx
+	movq	%rdx,8(%rdi,%r14,8)
+	sbbq	24(%rcx,%r14,8),%rbp
+	movq	%rbx,16(%rdi,%r14,8)
+
+	sbbq	$0,%rax
+	movq	%rax,%xmm0
+	punpcklqdq	%xmm0,%xmm0
+	movq	%rbp,24(%rdi,%r14,8)
+	xorq	%r14,%r14
+
+	movq	%r9,%r15
+	pxor	%xmm5,%xmm5
+	jmp	L$copy4x
+.p2align	4
+L$copy4x:
+	movdqu	(%rsp,%r14,1),%xmm2
+	movdqu	16(%rsp,%r14,1),%xmm4
+	movdqu	(%rdi,%r14,1),%xmm1
+	movdqu	16(%rdi,%r14,1),%xmm3
+	pxor	%xmm1,%xmm2
+	pxor	%xmm3,%xmm4
+	pand	%xmm0,%xmm2
+	pand	%xmm0,%xmm4
+	pxor	%xmm1,%xmm2
+	pxor	%xmm3,%xmm4
+	movdqu	%xmm2,(%rdi,%r14,1)
+	movdqu	%xmm4,16(%rdi,%r14,1)
+	movdqa	%xmm5,(%rsp,%r14,1)
+	movdqa	%xmm5,16(%rsp,%r14,1)
+
+	leaq	32(%r14),%r14
+	decq	%r15
+	jnz	L$copy4x
+
+	shlq	$2,%r9
+	movq	8(%rsp,%r9,8),%rsi
+	movq	$1,%rax
+	movq	(%rsi),%r15
+	movq	8(%rsi),%r14
+	movq	16(%rsi),%r13
+	movq	24(%rsi),%r12
+	movq	32(%rsi),%rbp
+	movq	40(%rsi),%rbx
+	leaq	48(%rsi),%rsp
+L$mul4x_epilogue:
+	.byte	0xf3,0xc3
+
+
+
+
+.p2align	5
+bn_sqr8x_mont:
+L$sqr8x_enter:
+	movq	%rsp,%rax
+	pushq	%rbx
+	pushq	%rbp
+	pushq	%r12
+	pushq	%r13
+	pushq	%r14
+	pushq	%r15
+
+	movl	%r9d,%r10d
+	shll	$3,%r9d
+	shlq	$3+2,%r10
+	negq	%r9
+
+
+
+
+
+
+	leaq	-64(%rsp,%r9,4),%r11
+	movq	(%r8),%r8
+	subq	%rsi,%r11
+	andq	$4095,%r11
+	cmpq	%r11,%r10
+	jb	L$sqr8x_sp_alt
+	subq	%r11,%rsp
+	leaq	-64(%rsp,%r9,4),%rsp
+	jmp	L$sqr8x_sp_done
+
+.p2align	5
+L$sqr8x_sp_alt:
+	leaq	4096-64(,%r9,4),%r10
+	leaq	-64(%rsp,%r9,4),%rsp
+	subq	%r10,%r11
+	movq	$0,%r10
+	cmovcq	%r10,%r11
+	subq	%r11,%rsp
+L$sqr8x_sp_done:
+	andq	$-64,%rsp
+	movq	%r9,%r10
+	negq	%r9
+
+	leaq	64(%rsp,%r9,2),%r11
+	movq	%r8,32(%rsp)
+	movq	%rax,40(%rsp)
+L$sqr8x_body:
+
+	movq	%r9,%rbp
+.byte	102,73,15,110,211
+	shrq	$3+2,%rbp
+	movl	_OPENSSL_ia32cap_P+8(%rip),%eax
+	jmp	L$sqr8x_copy_n
+
+.p2align	5
+L$sqr8x_copy_n:
+	movq	0(%rcx),%xmm0
+	movq	8(%rcx),%xmm1
+	movq	16(%rcx),%xmm3
+	movq	24(%rcx),%xmm4
+	leaq	32(%rcx),%rcx
+	movdqa	%xmm0,0(%r11)
+	movdqa	%xmm1,16(%r11)
+	movdqa	%xmm3,32(%r11)
+	movdqa	%xmm4,48(%r11)
+	leaq	64(%r11),%r11
+	decq	%rbp
+	jnz	L$sqr8x_copy_n
+
+	pxor	%xmm0,%xmm0
+.byte	102,72,15,110,207
+.byte	102,73,15,110,218
+	call	_bn_sqr8x_internal
+
+	pxor	%xmm0,%xmm0
+	leaq	48(%rsp),%rax
+	leaq	64(%rsp,%r9,2),%rdx
+	shrq	$3+2,%r9
+	movq	40(%rsp),%rsi
+	jmp	L$sqr8x_zero
+
+.p2align	5
+L$sqr8x_zero:
+	movdqa	%xmm0,0(%rax)
+	movdqa	%xmm0,16(%rax)
+	movdqa	%xmm0,32(%rax)
+	movdqa	%xmm0,48(%rax)
+	leaq	64(%rax),%rax
+	movdqa	%xmm0,0(%rdx)
+	movdqa	%xmm0,16(%rdx)
+	movdqa	%xmm0,32(%rdx)
+	movdqa	%xmm0,48(%rdx)
+	leaq	64(%rdx),%rdx
+	decq	%r9
+	jnz	L$sqr8x_zero
+
+	movq	$1,%rax
+	movq	-48(%rsi),%r15
+	movq	-40(%rsi),%r14
+	movq	-32(%rsi),%r13
+	movq	-24(%rsi),%r12
+	movq	-16(%rsi),%rbp
+	movq	-8(%rsi),%rbx
+	leaq	(%rsi),%rsp
+L$sqr8x_epilogue:
+	.byte	0xf3,0xc3
+
+.byte	77,111,110,116,103,111,109,101,114,121,32,77,117,108,116,105,112,108,105,99,97,116,105,111,110,32,102,111,114,32,120,56,54,95,54,52,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0
+.p2align	4
+#endif
diff --git a/third_party/boringssl/mac-x86_64/crypto/bn/x86_64-mont5.S b/third_party/boringssl/mac-x86_64/crypto/bn/x86_64-mont5.S
new file mode 100644
index 0000000..2e8f469
--- /dev/null
+++ b/third_party/boringssl/mac-x86_64/crypto/bn/x86_64-mont5.S
@@ -0,0 +1,1822 @@
+#if defined(__x86_64__)
+.text	
+
+
+
+.globl	_bn_mul_mont_gather5
+.private_extern _bn_mul_mont_gather5
+
+.p2align	6
+_bn_mul_mont_gather5:
+	testl	$7,%r9d
+	jnz	L$mul_enter
+	jmp	L$mul4x_enter
+
+.p2align	4
+L$mul_enter:
+	movl	%r9d,%r9d
+	movq	%rsp,%rax
+	movl	8(%rsp),%r10d
+	pushq	%rbx
+	pushq	%rbp
+	pushq	%r12
+	pushq	%r13
+	pushq	%r14
+	pushq	%r15
+	leaq	2(%r9),%r11
+	negq	%r11
+	leaq	(%rsp,%r11,8),%rsp
+	andq	$-1024,%rsp
+
+	movq	%rax,8(%rsp,%r9,8)
+L$mul_body:
+	movq	%rdx,%r12
+	movq	%r10,%r11
+	shrq	$3,%r10
+	andq	$7,%r11
+	notq	%r10
+	leaq	L$magic_masks(%rip),%rax
+	andq	$3,%r10
+	leaq	96(%r12,%r11,8),%r12
+	movq	0(%rax,%r10,8),%xmm4
+	movq	8(%rax,%r10,8),%xmm5
+	movq	16(%rax,%r10,8),%xmm6
+	movq	24(%rax,%r10,8),%xmm7
+
+	movq	-96(%r12),%xmm0
+	movq	-32(%r12),%xmm1
+	pand	%xmm4,%xmm0
+	movq	32(%r12),%xmm2
+	pand	%xmm5,%xmm1
+	movq	96(%r12),%xmm3
+	pand	%xmm6,%xmm2
+	por	%xmm1,%xmm0
+	pand	%xmm7,%xmm3
+	por	%xmm2,%xmm0
+	leaq	256(%r12),%r12
+	por	%xmm3,%xmm0
+
+.byte	102,72,15,126,195
+
+	movq	(%r8),%r8
+	movq	(%rsi),%rax
+
+	xorq	%r14,%r14
+	xorq	%r15,%r15
+
+	movq	-96(%r12),%xmm0
+	movq	-32(%r12),%xmm1
+	pand	%xmm4,%xmm0
+	movq	32(%r12),%xmm2
+	pand	%xmm5,%xmm1
+
+	movq	%r8,%rbp
+	mulq	%rbx
+	movq	%rax,%r10
+	movq	(%rcx),%rax
+
+	movq	96(%r12),%xmm3
+	pand	%xmm6,%xmm2
+	por	%xmm1,%xmm0
+	pand	%xmm7,%xmm3
+
+	imulq	%r10,%rbp
+	movq	%rdx,%r11
+
+	por	%xmm2,%xmm0
+	leaq	256(%r12),%r12
+	por	%xmm3,%xmm0
+
+	mulq	%rbp
+	addq	%rax,%r10
+	movq	8(%rsi),%rax
+	adcq	$0,%rdx
+	movq	%rdx,%r13
+
+	leaq	1(%r15),%r15
+	jmp	L$1st_enter
+
+.p2align	4
+L$1st:
+	addq	%rax,%r13
+	movq	(%rsi,%r15,8),%rax
+	adcq	$0,%rdx
+	addq	%r11,%r13
+	movq	%r10,%r11
+	adcq	$0,%rdx
+	movq	%r13,-16(%rsp,%r15,8)
+	movq	%rdx,%r13
+
+L$1st_enter:
+	mulq	%rbx
+	addq	%rax,%r11
+	movq	(%rcx,%r15,8),%rax
+	adcq	$0,%rdx
+	leaq	1(%r15),%r15
+	movq	%rdx,%r10
+
+	mulq	%rbp
+	cmpq	%r9,%r15
+	jne	L$1st
+
+.byte	102,72,15,126,195
+
+	addq	%rax,%r13
+	movq	(%rsi),%rax
+	adcq	$0,%rdx
+	addq	%r11,%r13
+	adcq	$0,%rdx
+	movq	%r13,-16(%rsp,%r15,8)
+	movq	%rdx,%r13
+	movq	%r10,%r11
+
+	xorq	%rdx,%rdx
+	addq	%r11,%r13
+	adcq	$0,%rdx
+	movq	%r13,-8(%rsp,%r9,8)
+	movq	%rdx,(%rsp,%r9,8)
+
+	leaq	1(%r14),%r14
+	jmp	L$outer
+.p2align	4
+L$outer:
+	xorq	%r15,%r15
+	movq	%r8,%rbp
+	movq	(%rsp),%r10
+
+	movq	-96(%r12),%xmm0
+	movq	-32(%r12),%xmm1
+	pand	%xmm4,%xmm0
+	movq	32(%r12),%xmm2
+	pand	%xmm5,%xmm1
+
+	mulq	%rbx
+	addq	%rax,%r10
+	movq	(%rcx),%rax
+	adcq	$0,%rdx
+
+	movq	96(%r12),%xmm3
+	pand	%xmm6,%xmm2
+	por	%xmm1,%xmm0
+	pand	%xmm7,%xmm3
+
+	imulq	%r10,%rbp
+	movq	%rdx,%r11
+
+	por	%xmm2,%xmm0
+	leaq	256(%r12),%r12
+	por	%xmm3,%xmm0
+
+	mulq	%rbp
+	addq	%rax,%r10
+	movq	8(%rsi),%rax
+	adcq	$0,%rdx
+	movq	8(%rsp),%r10
+	movq	%rdx,%r13
+
+	leaq	1(%r15),%r15
+	jmp	L$inner_enter
+
+.p2align	4
+L$inner:
+	addq	%rax,%r13
+	movq	(%rsi,%r15,8),%rax
+	adcq	$0,%rdx
+	addq	%r10,%r13
+	movq	(%rsp,%r15,8),%r10
+	adcq	$0,%rdx
+	movq	%r13,-16(%rsp,%r15,8)
+	movq	%rdx,%r13
+
+L$inner_enter:
+	mulq	%rbx
+	addq	%rax,%r11
+	movq	(%rcx,%r15,8),%rax
+	adcq	$0,%rdx
+	addq	%r11,%r10
+	movq	%rdx,%r11
+	adcq	$0,%r11
+	leaq	1(%r15),%r15
+
+	mulq	%rbp
+	cmpq	%r9,%r15
+	jne	L$inner
+
+.byte	102,72,15,126,195
+
+	addq	%rax,%r13
+	movq	(%rsi),%rax
+	adcq	$0,%rdx
+	addq	%r10,%r13
+	movq	(%rsp,%r15,8),%r10
+	adcq	$0,%rdx
+	movq	%r13,-16(%rsp,%r15,8)
+	movq	%rdx,%r13
+
+	xorq	%rdx,%rdx
+	addq	%r11,%r13
+	adcq	$0,%rdx
+	addq	%r10,%r13
+	adcq	$0,%rdx
+	movq	%r13,-8(%rsp,%r9,8)
+	movq	%rdx,(%rsp,%r9,8)
+
+	leaq	1(%r14),%r14
+	cmpq	%r9,%r14
+	jb	L$outer
+
+	xorq	%r14,%r14
+	movq	(%rsp),%rax
+	leaq	(%rsp),%rsi
+	movq	%r9,%r15
+	jmp	L$sub
+.p2align	4
+L$sub:	sbbq	(%rcx,%r14,8),%rax
+	movq	%rax,(%rdi,%r14,8)
+	movq	8(%rsi,%r14,8),%rax
+	leaq	1(%r14),%r14
+	decq	%r15
+	jnz	L$sub
+
+	sbbq	$0,%rax
+	xorq	%r14,%r14
+	movq	%r9,%r15
+.p2align	4
+L$copy:
+	movq	(%rsp,%r14,8),%rsi
+	movq	(%rdi,%r14,8),%rcx
+	xorq	%rcx,%rsi
+	andq	%rax,%rsi
+	xorq	%rcx,%rsi
+	movq	%r14,(%rsp,%r14,8)
+	movq	%rsi,(%rdi,%r14,8)
+	leaq	1(%r14),%r14
+	subq	$1,%r15
+	jnz	L$copy
+
+	movq	8(%rsp,%r9,8),%rsi
+	movq	$1,%rax
+	movq	-48(%rsi),%r15
+	movq	-40(%rsi),%r14
+	movq	-32(%rsi),%r13
+	movq	-24(%rsi),%r12
+	movq	-16(%rsi),%rbp
+	movq	-8(%rsi),%rbx
+	leaq	(%rsi),%rsp
+L$mul_epilogue:
+	.byte	0xf3,0xc3
+
+
+.p2align	5
+bn_mul4x_mont_gather5:
+L$mul4x_enter:
+.byte	0x67
+	movq	%rsp,%rax
+	pushq	%rbx
+	pushq	%rbp
+	pushq	%r12
+	pushq	%r13
+	pushq	%r14
+	pushq	%r15
+.byte	0x67
+	movl	%r9d,%r10d
+	shll	$3,%r9d
+	shll	$3+2,%r10d
+	negq	%r9
+
+
+
+
+
+
+
+
+	leaq	-64(%rsp,%r9,2),%r11
+	subq	%rsi,%r11
+	andq	$4095,%r11
+	cmpq	%r11,%r10
+	jb	L$mul4xsp_alt
+	subq	%r11,%rsp
+	leaq	-64(%rsp,%r9,2),%rsp
+	jmp	L$mul4xsp_done
+
+.p2align	5
+L$mul4xsp_alt:
+	leaq	4096-64(,%r9,2),%r10
+	leaq	-64(%rsp,%r9,2),%rsp
+	subq	%r10,%r11
+	movq	$0,%r10
+	cmovcq	%r10,%r11
+	subq	%r11,%rsp
+L$mul4xsp_done:
+	andq	$-64,%rsp
+	negq	%r9
+
+	movq	%rax,40(%rsp)
+L$mul4x_body:
+
+	call	mul4x_internal
+
+	movq	40(%rsp),%rsi
+	movq	$1,%rax
+	movq	-48(%rsi),%r15
+	movq	-40(%rsi),%r14
+	movq	-32(%rsi),%r13
+	movq	-24(%rsi),%r12
+	movq	-16(%rsi),%rbp
+	movq	-8(%rsi),%rbx
+	leaq	(%rsi),%rsp
+L$mul4x_epilogue:
+	.byte	0xf3,0xc3
+
+
+
+.p2align	5
+mul4x_internal:
+	shlq	$5,%r9
+	movl	8(%rax),%r10d
+	leaq	256(%rdx,%r9,1),%r13
+	shrq	$5,%r9
+	movq	%r10,%r11
+	shrq	$3,%r10
+	andq	$7,%r11
+	notq	%r10
+	leaq	L$magic_masks(%rip),%rax
+	andq	$3,%r10
+	leaq	96(%rdx,%r11,8),%r12
+	movq	0(%rax,%r10,8),%xmm4
+	movq	8(%rax,%r10,8),%xmm5
+	addq	$7,%r11
+	movq	16(%rax,%r10,8),%xmm6
+	movq	24(%rax,%r10,8),%xmm7
+	andq	$7,%r11
+
+	movq	-96(%r12),%xmm0
+	leaq	256(%r12),%r14
+	movq	-32(%r12),%xmm1
+	pand	%xmm4,%xmm0
+	movq	32(%r12),%xmm2
+	pand	%xmm5,%xmm1
+	movq	96(%r12),%xmm3
+	pand	%xmm6,%xmm2
+.byte	0x67
+	por	%xmm1,%xmm0
+	movq	-96(%r14),%xmm1
+.byte	0x67
+	pand	%xmm7,%xmm3
+.byte	0x67
+	por	%xmm2,%xmm0
+	movq	-32(%r14),%xmm2
+.byte	0x67
+	pand	%xmm4,%xmm1
+.byte	0x67
+	por	%xmm3,%xmm0
+	movq	32(%r14),%xmm3
+
+.byte	102,72,15,126,195
+	movq	96(%r14),%xmm0
+	movq	%r13,16+8(%rsp)
+	movq	%rdi,56+8(%rsp)
+
+	movq	(%r8),%r8
+	movq	(%rsi),%rax
+	leaq	(%rsi,%r9,1),%rsi
+	negq	%r9
+
+	movq	%r8,%rbp
+	mulq	%rbx
+	movq	%rax,%r10
+	movq	(%rcx),%rax
+
+	pand	%xmm5,%xmm2
+	pand	%xmm6,%xmm3
+	por	%xmm2,%xmm1
+
+	imulq	%r10,%rbp
+
+
+
+
+
+
+
+	leaq	64+8(%rsp,%r11,8),%r14
+	movq	%rdx,%r11
+
+	pand	%xmm7,%xmm0
+	por	%xmm3,%xmm1
+	leaq	512(%r12),%r12
+	por	%xmm1,%xmm0
+
+	mulq	%rbp
+	addq	%rax,%r10
+	movq	8(%rsi,%r9,1),%rax
+	adcq	$0,%rdx
+	movq	%rdx,%rdi
+
+	mulq	%rbx
+	addq	%rax,%r11
+	movq	16(%rcx),%rax
+	adcq	$0,%rdx
+	movq	%rdx,%r10
+
+	mulq	%rbp
+	addq	%rax,%rdi
+	movq	16(%rsi,%r9,1),%rax
+	adcq	$0,%rdx
+	addq	%r11,%rdi
+	leaq	32(%r9),%r15
+	leaq	64(%rcx),%rcx
+	adcq	$0,%rdx
+	movq	%rdi,(%r14)
+	movq	%rdx,%r13
+	jmp	L$1st4x
+
+.p2align	5
+L$1st4x:
+	mulq	%rbx
+	addq	%rax,%r10
+	movq	-32(%rcx),%rax
+	leaq	32(%r14),%r14
+	adcq	$0,%rdx
+	movq	%rdx,%r11
+
+	mulq	%rbp
+	addq	%rax,%r13
+	movq	-8(%rsi,%r15,1),%rax
+	adcq	$0,%rdx
+	addq	%r10,%r13
+	adcq	$0,%rdx
+	movq	%r13,-24(%r14)
+	movq	%rdx,%rdi
+
+	mulq	%rbx
+	addq	%rax,%r11
+	movq	-16(%rcx),%rax
+	adcq	$0,%rdx
+	movq	%rdx,%r10
+
+	mulq	%rbp
+	addq	%rax,%rdi
+	movq	(%rsi,%r15,1),%rax
+	adcq	$0,%rdx
+	addq	%r11,%rdi
+	adcq	$0,%rdx
+	movq	%rdi,-16(%r14)
+	movq	%rdx,%r13
+
+	mulq	%rbx
+	addq	%rax,%r10
+	movq	0(%rcx),%rax
+	adcq	$0,%rdx
+	movq	%rdx,%r11
+
+	mulq	%rbp
+	addq	%rax,%r13
+	movq	8(%rsi,%r15,1),%rax
+	adcq	$0,%rdx
+	addq	%r10,%r13
+	adcq	$0,%rdx
+	movq	%r13,-8(%r14)
+	movq	%rdx,%rdi
+
+	mulq	%rbx
+	addq	%rax,%r11
+	movq	16(%rcx),%rax
+	adcq	$0,%rdx
+	movq	%rdx,%r10
+
+	mulq	%rbp
+	addq	%rax,%rdi
+	movq	16(%rsi,%r15,1),%rax
+	adcq	$0,%rdx
+	addq	%r11,%rdi
+	leaq	64(%rcx),%rcx
+	adcq	$0,%rdx
+	movq	%rdi,(%r14)
+	movq	%rdx,%r13
+
+	addq	$32,%r15
+	jnz	L$1st4x
+
+	mulq	%rbx
+	addq	%rax,%r10
+	movq	-32(%rcx),%rax
+	leaq	32(%r14),%r14
+	adcq	$0,%rdx
+	movq	%rdx,%r11
+
+	mulq	%rbp
+	addq	%rax,%r13
+	movq	-8(%rsi),%rax
+	adcq	$0,%rdx
+	addq	%r10,%r13
+	adcq	$0,%rdx
+	movq	%r13,-24(%r14)
+	movq	%rdx,%rdi
+
+	mulq	%rbx
+	addq	%rax,%r11
+	movq	-16(%rcx),%rax
+	adcq	$0,%rdx
+	movq	%rdx,%r10
+
+	mulq	%rbp
+	addq	%rax,%rdi
+	movq	(%rsi,%r9,1),%rax
+	adcq	$0,%rdx
+	addq	%r11,%rdi
+	adcq	$0,%rdx
+	movq	%rdi,-16(%r14)
+	movq	%rdx,%r13
+
+.byte	102,72,15,126,195
+	leaq	(%rcx,%r9,2),%rcx
+
+	xorq	%rdi,%rdi
+	addq	%r10,%r13
+	adcq	$0,%rdi
+	movq	%r13,-8(%r14)
+
+	jmp	L$outer4x
+
+.p2align	5
+L$outer4x:
+	movq	(%r14,%r9,1),%r10
+	movq	%r8,%rbp
+	mulq	%rbx
+	addq	%rax,%r10
+	movq	(%rcx),%rax
+	adcq	$0,%rdx
+
+	movq	-96(%r12),%xmm0
+	movq	-32(%r12),%xmm1
+	pand	%xmm4,%xmm0
+	movq	32(%r12),%xmm2
+	pand	%xmm5,%xmm1
+	movq	96(%r12),%xmm3
+
+	imulq	%r10,%rbp
+.byte	0x67
+	movq	%rdx,%r11
+	movq	%rdi,(%r14)
+
+	pand	%xmm6,%xmm2
+	por	%xmm1,%xmm0
+	pand	%xmm7,%xmm3
+	por	%xmm2,%xmm0
+	leaq	(%r14,%r9,1),%r14
+	leaq	256(%r12),%r12
+	por	%xmm3,%xmm0
+
+	mulq	%rbp
+	addq	%rax,%r10
+	movq	8(%rsi,%r9,1),%rax
+	adcq	$0,%rdx
+	movq	%rdx,%rdi
+
+	mulq	%rbx
+	addq	%rax,%r11
+	movq	16(%rcx),%rax
+	adcq	$0,%rdx
+	addq	8(%r14),%r11
+	adcq	$0,%rdx
+	movq	%rdx,%r10
+
+	mulq	%rbp
+	addq	%rax,%rdi
+	movq	16(%rsi,%r9,1),%rax
+	adcq	$0,%rdx
+	addq	%r11,%rdi
+	leaq	32(%r9),%r15
+	leaq	64(%rcx),%rcx
+	adcq	$0,%rdx
+	movq	%rdx,%r13
+	jmp	L$inner4x
+
+.p2align	5
+L$inner4x:
+	mulq	%rbx
+	addq	%rax,%r10
+	movq	-32(%rcx),%rax
+	adcq	$0,%rdx
+	addq	16(%r14),%r10
+	leaq	32(%r14),%r14
+	adcq	$0,%rdx
+	movq	%rdx,%r11
+
+	mulq	%rbp
+	addq	%rax,%r13
+	movq	-8(%rsi,%r15,1),%rax
+	adcq	$0,%rdx
+	addq	%r10,%r13
+	adcq	$0,%rdx
+	movq	%rdi,-32(%r14)
+	movq	%rdx,%rdi
+
+	mulq	%rbx
+	addq	%rax,%r11
+	movq	-16(%rcx),%rax
+	adcq	$0,%rdx
+	addq	-8(%r14),%r11
+	adcq	$0,%rdx
+	movq	%rdx,%r10
+
+	mulq	%rbp
+	addq	%rax,%rdi
+	movq	(%rsi,%r15,1),%rax
+	adcq	$0,%rdx
+	addq	%r11,%rdi
+	adcq	$0,%rdx
+	movq	%r13,-24(%r14)
+	movq	%rdx,%r13
+
+	mulq	%rbx
+	addq	%rax,%r10
+	movq	0(%rcx),%rax
+	adcq	$0,%rdx
+	addq	(%r14),%r10
+	adcq	$0,%rdx
+	movq	%rdx,%r11
+
+	mulq	%rbp
+	addq	%rax,%r13
+	movq	8(%rsi,%r15,1),%rax
+	adcq	$0,%rdx
+	addq	%r10,%r13
+	adcq	$0,%rdx
+	movq	%rdi,-16(%r14)
+	movq	%rdx,%rdi
+
+	mulq	%rbx
+	addq	%rax,%r11
+	movq	16(%rcx),%rax
+	adcq	$0,%rdx
+	addq	8(%r14),%r11
+	adcq	$0,%rdx
+	movq	%rdx,%r10
+
+	mulq	%rbp
+	addq	%rax,%rdi
+	movq	16(%rsi,%r15,1),%rax
+	adcq	$0,%rdx
+	addq	%r11,%rdi
+	leaq	64(%rcx),%rcx
+	adcq	$0,%rdx
+	movq	%r13,-8(%r14)
+	movq	%rdx,%r13
+
+	addq	$32,%r15
+	jnz	L$inner4x
+
+	mulq	%rbx
+	addq	%rax,%r10
+	movq	-32(%rcx),%rax
+	adcq	$0,%rdx
+	addq	16(%r14),%r10
+	leaq	32(%r14),%r14
+	adcq	$0,%rdx
+	movq	%rdx,%r11
+
+	mulq	%rbp
+	addq	%rax,%r13
+	movq	-8(%rsi),%rax
+	adcq	$0,%rdx
+	addq	%r10,%r13
+	adcq	$0,%rdx
+	movq	%rdi,-32(%r14)
+	movq	%rdx,%rdi
+
+	mulq	%rbx
+	addq	%rax,%r11
+	movq	%rbp,%rax
+	movq	-16(%rcx),%rbp
+	adcq	$0,%rdx
+	addq	-8(%r14),%r11
+	adcq	$0,%rdx
+	movq	%rdx,%r10
+
+	mulq	%rbp
+	addq	%rax,%rdi
+	movq	(%rsi,%r9,1),%rax
+	adcq	$0,%rdx
+	addq	%r11,%rdi
+	adcq	$0,%rdx
+	movq	%r13,-24(%r14)
+	movq	%rdx,%r13
+
+.byte	102,72,15,126,195
+	movq	%rdi,-16(%r14)
+	leaq	(%rcx,%r9,2),%rcx
+
+	xorq	%rdi,%rdi
+	addq	%r10,%r13
+	adcq	$0,%rdi
+	addq	(%r14),%r13
+	adcq	$0,%rdi
+	movq	%r13,-8(%r14)
+
+	cmpq	16+8(%rsp),%r12
+	jb	L$outer4x
+	subq	%r13,%rbp
+	adcq	%r15,%r15
+	orq	%r15,%rdi
+	xorq	$1,%rdi
+	leaq	(%r14,%r9,1),%rbx
+	leaq	(%rcx,%rdi,8),%rbp
+	movq	%r9,%rcx
+	sarq	$3+2,%rcx
+	movq	56+8(%rsp),%rdi
+	jmp	L$sqr4x_sub
+
+.globl	_bn_power5
+.private_extern _bn_power5
+
+.p2align	5
+_bn_power5:
+	movq	%rsp,%rax
+	pushq	%rbx
+	pushq	%rbp
+	pushq	%r12
+	pushq	%r13
+	pushq	%r14
+	pushq	%r15
+	movl	%r9d,%r10d
+	shll	$3,%r9d
+	shll	$3+2,%r10d
+	negq	%r9
+	movq	(%r8),%r8
+
+
+
+
+
+
+
+	leaq	-64(%rsp,%r9,2),%r11
+	subq	%rsi,%r11
+	andq	$4095,%r11
+	cmpq	%r11,%r10
+	jb	L$pwr_sp_alt
+	subq	%r11,%rsp
+	leaq	-64(%rsp,%r9,2),%rsp
+	jmp	L$pwr_sp_done
+
+.p2align	5
+L$pwr_sp_alt:
+	leaq	4096-64(,%r9,2),%r10
+	leaq	-64(%rsp,%r9,2),%rsp
+	subq	%r10,%r11
+	movq	$0,%r10
+	cmovcq	%r10,%r11
+	subq	%r11,%rsp
+L$pwr_sp_done:
+	andq	$-64,%rsp
+	movq	%r9,%r10
+	negq	%r9
+
+
+
+
+
+
+
+
+
+
+	movq	%r8,32(%rsp)
+	movq	%rax,40(%rsp)
+L$power5_body:
+.byte	102,72,15,110,207
+.byte	102,72,15,110,209
+.byte	102,73,15,110,218
+.byte	102,72,15,110,226
+
+	call	__bn_sqr8x_internal
+	call	__bn_sqr8x_internal
+	call	__bn_sqr8x_internal
+	call	__bn_sqr8x_internal
+	call	__bn_sqr8x_internal
+
+.byte	102,72,15,126,209
+.byte	102,72,15,126,226
+	movq	%rsi,%rdi
+	movq	40(%rsp),%rax
+	leaq	32(%rsp),%r8
+
+	call	mul4x_internal
+
+	movq	40(%rsp),%rsi
+	movq	$1,%rax
+	movq	-48(%rsi),%r15
+	movq	-40(%rsi),%r14
+	movq	-32(%rsi),%r13
+	movq	-24(%rsi),%r12
+	movq	-16(%rsi),%rbp
+	movq	-8(%rsi),%rbx
+	leaq	(%rsi),%rsp
+L$power5_epilogue:
+	.byte	0xf3,0xc3
+
+
+.globl	_bn_sqr8x_internal
+.private_extern _bn_sqr8x_internal
+.private_extern	_bn_sqr8x_internal
+
+.p2align	5
+_bn_sqr8x_internal:
+__bn_sqr8x_internal:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+	leaq	32(%r10),%rbp
+	leaq	(%rsi,%r9,1),%rsi
+
+	movq	%r9,%rcx
+
+
+	movq	-32(%rsi,%rbp,1),%r14
+	leaq	48+8(%rsp,%r9,2),%rdi
+	movq	-24(%rsi,%rbp,1),%rax
+	leaq	-32(%rdi,%rbp,1),%rdi
+	movq	-16(%rsi,%rbp,1),%rbx
+	movq	%rax,%r15
+
+	mulq	%r14
+	movq	%rax,%r10
+	movq	%rbx,%rax
+	movq	%rdx,%r11
+	movq	%r10,-24(%rdi,%rbp,1)
+
+	mulq	%r14
+	addq	%rax,%r11
+	movq	%rbx,%rax
+	adcq	$0,%rdx
+	movq	%r11,-16(%rdi,%rbp,1)
+	movq	%rdx,%r10
+
+
+	movq	-8(%rsi,%rbp,1),%rbx
+	mulq	%r15
+	movq	%rax,%r12
+	movq	%rbx,%rax
+	movq	%rdx,%r13
+
+	leaq	(%rbp),%rcx
+	mulq	%r14
+	addq	%rax,%r10
+	movq	%rbx,%rax
+	movq	%rdx,%r11
+	adcq	$0,%r11
+	addq	%r12,%r10
+	adcq	$0,%r11
+	movq	%r10,-8(%rdi,%rcx,1)
+	jmp	L$sqr4x_1st
+
+.p2align	5
+L$sqr4x_1st:
+	movq	(%rsi,%rcx,1),%rbx
+	mulq	%r15
+	addq	%rax,%r13
+	movq	%rbx,%rax
+	movq	%rdx,%r12
+	adcq	$0,%r12
+
+	mulq	%r14
+	addq	%rax,%r11
+	movq	%rbx,%rax
+	movq	8(%rsi,%rcx,1),%rbx
+	movq	%rdx,%r10
+	adcq	$0,%r10
+	addq	%r13,%r11
+	adcq	$0,%r10
+
+
+	mulq	%r15
+	addq	%rax,%r12
+	movq	%rbx,%rax
+	movq	%r11,(%rdi,%rcx,1)
+	movq	%rdx,%r13
+	adcq	$0,%r13
+
+	mulq	%r14
+	addq	%rax,%r10
+	movq	%rbx,%rax
+	movq	16(%rsi,%rcx,1),%rbx
+	movq	%rdx,%r11
+	adcq	$0,%r11
+	addq	%r12,%r10
+	adcq	$0,%r11
+
+	mulq	%r15
+	addq	%rax,%r13
+	movq	%rbx,%rax
+	movq	%r10,8(%rdi,%rcx,1)
+	movq	%rdx,%r12
+	adcq	$0,%r12
+
+	mulq	%r14
+	addq	%rax,%r11
+	movq	%rbx,%rax
+	movq	24(%rsi,%rcx,1),%rbx
+	movq	%rdx,%r10
+	adcq	$0,%r10
+	addq	%r13,%r11
+	adcq	$0,%r10
+
+
+	mulq	%r15
+	addq	%rax,%r12
+	movq	%rbx,%rax
+	movq	%r11,16(%rdi,%rcx,1)
+	movq	%rdx,%r13
+	adcq	$0,%r13
+	leaq	32(%rcx),%rcx
+
+	mulq	%r14
+	addq	%rax,%r10
+	movq	%rbx,%rax
+	movq	%rdx,%r11
+	adcq	$0,%r11
+	addq	%r12,%r10
+	adcq	$0,%r11
+	movq	%r10,-8(%rdi,%rcx,1)
+
+	cmpq	$0,%rcx
+	jne	L$sqr4x_1st
+
+	mulq	%r15
+	addq	%rax,%r13
+	leaq	16(%rbp),%rbp
+	adcq	$0,%rdx
+	addq	%r11,%r13
+	adcq	$0,%rdx
+
+	movq	%r13,(%rdi)
+	movq	%rdx,%r12
+	movq	%rdx,8(%rdi)
+	jmp	L$sqr4x_outer
+
+.p2align	5
+L$sqr4x_outer:
+	movq	-32(%rsi,%rbp,1),%r14
+	leaq	48+8(%rsp,%r9,2),%rdi
+	movq	-24(%rsi,%rbp,1),%rax
+	leaq	-32(%rdi,%rbp,1),%rdi
+	movq	-16(%rsi,%rbp,1),%rbx
+	movq	%rax,%r15
+
+	mulq	%r14
+	movq	-24(%rdi,%rbp,1),%r10
+	addq	%rax,%r10
+	movq	%rbx,%rax
+	adcq	$0,%rdx
+	movq	%r10,-24(%rdi,%rbp,1)
+	movq	%rdx,%r11
+
+	mulq	%r14
+	addq	%rax,%r11
+	movq	%rbx,%rax
+	adcq	$0,%rdx
+	addq	-16(%rdi,%rbp,1),%r11
+	movq	%rdx,%r10
+	adcq	$0,%r10
+	movq	%r11,-16(%rdi,%rbp,1)
+
+	xorq	%r12,%r12
+
+	movq	-8(%rsi,%rbp,1),%rbx
+	mulq	%r15
+	addq	%rax,%r12
+	movq	%rbx,%rax
+	adcq	$0,%rdx
+	addq	-8(%rdi,%rbp,1),%r12
+	movq	%rdx,%r13
+	adcq	$0,%r13
+
+	mulq	%r14
+	addq	%rax,%r10
+	movq	%rbx,%rax
+	adcq	$0,%rdx
+	addq	%r12,%r10
+	movq	%rdx,%r11
+	adcq	$0,%r11
+	movq	%r10,-8(%rdi,%rbp,1)
+
+	leaq	(%rbp),%rcx
+	jmp	L$sqr4x_inner
+
+.p2align	5
+L$sqr4x_inner:
+	movq	(%rsi,%rcx,1),%rbx
+	mulq	%r15
+	addq	%rax,%r13
+	movq	%rbx,%rax
+	movq	%rdx,%r12
+	adcq	$0,%r12
+	addq	(%rdi,%rcx,1),%r13
+	adcq	$0,%r12
+
+.byte	0x67
+	mulq	%r14
+	addq	%rax,%r11
+	movq	%rbx,%rax
+	movq	8(%rsi,%rcx,1),%rbx
+	movq	%rdx,%r10
+	adcq	$0,%r10
+	addq	%r13,%r11
+	adcq	$0,%r10
+
+	mulq	%r15
+	addq	%rax,%r12
+	movq	%r11,(%rdi,%rcx,1)
+	movq	%rbx,%rax
+	movq	%rdx,%r13
+	adcq	$0,%r13
+	addq	8(%rdi,%rcx,1),%r12
+	leaq	16(%rcx),%rcx
+	adcq	$0,%r13
+
+	mulq	%r14
+	addq	%rax,%r10
+	movq	%rbx,%rax
+	adcq	$0,%rdx
+	addq	%r12,%r10
+	movq	%rdx,%r11
+	adcq	$0,%r11
+	movq	%r10,-8(%rdi,%rcx,1)
+
+	cmpq	$0,%rcx
+	jne	L$sqr4x_inner
+
+.byte	0x67
+	mulq	%r15
+	addq	%rax,%r13
+	adcq	$0,%rdx
+	addq	%r11,%r13
+	adcq	$0,%rdx
+
+	movq	%r13,(%rdi)
+	movq	%rdx,%r12
+	movq	%rdx,8(%rdi)
+
+	addq	$16,%rbp
+	jnz	L$sqr4x_outer
+
+
+	movq	-32(%rsi),%r14
+	leaq	48+8(%rsp,%r9,2),%rdi
+	movq	-24(%rsi),%rax
+	leaq	-32(%rdi,%rbp,1),%rdi
+	movq	-16(%rsi),%rbx
+	movq	%rax,%r15
+
+	mulq	%r14
+	addq	%rax,%r10
+	movq	%rbx,%rax
+	movq	%rdx,%r11
+	adcq	$0,%r11
+
+	mulq	%r14
+	addq	%rax,%r11
+	movq	%rbx,%rax
+	movq	%r10,-24(%rdi)
+	movq	%rdx,%r10
+	adcq	$0,%r10
+	addq	%r13,%r11
+	movq	-8(%rsi),%rbx
+	adcq	$0,%r10
+
+	mulq	%r15
+	addq	%rax,%r12
+	movq	%rbx,%rax
+	movq	%r11,-16(%rdi)
+	movq	%rdx,%r13
+	adcq	$0,%r13
+
+	mulq	%r14
+	addq	%rax,%r10
+	movq	%rbx,%rax
+	movq	%rdx,%r11
+	adcq	$0,%r11
+	addq	%r12,%r10
+	adcq	$0,%r11
+	movq	%r10,-8(%rdi)
+
+	mulq	%r15
+	addq	%rax,%r13
+	movq	-16(%rsi),%rax
+	adcq	$0,%rdx
+	addq	%r11,%r13
+	adcq	$0,%rdx
+
+	movq	%r13,(%rdi)
+	movq	%rdx,%r12
+	movq	%rdx,8(%rdi)
+
+	mulq	%rbx
+	addq	$16,%rbp
+	xorq	%r14,%r14
+	subq	%r9,%rbp
+	xorq	%r15,%r15
+
+	addq	%r12,%rax
+	adcq	$0,%rdx
+	movq	%rax,8(%rdi)
+	movq	%rdx,16(%rdi)
+	movq	%r15,24(%rdi)
+
+	movq	-16(%rsi,%rbp,1),%rax
+	leaq	48+8(%rsp),%rdi
+	xorq	%r10,%r10
+	movq	8(%rdi),%r11
+
+	leaq	(%r14,%r10,2),%r12
+	shrq	$63,%r10
+	leaq	(%rcx,%r11,2),%r13
+	shrq	$63,%r11
+	orq	%r10,%r13
+	movq	16(%rdi),%r10
+	movq	%r11,%r14
+	mulq	%rax
+	negq	%r15
+	movq	24(%rdi),%r11
+	adcq	%rax,%r12
+	movq	-8(%rsi,%rbp,1),%rax
+	movq	%r12,(%rdi)
+	adcq	%rdx,%r13
+
+	leaq	(%r14,%r10,2),%rbx
+	movq	%r13,8(%rdi)
+	sbbq	%r15,%r15
+	shrq	$63,%r10
+	leaq	(%rcx,%r11,2),%r8
+	shrq	$63,%r11
+	orq	%r10,%r8
+	movq	32(%rdi),%r10
+	movq	%r11,%r14
+	mulq	%rax
+	negq	%r15
+	movq	40(%rdi),%r11
+	adcq	%rax,%rbx
+	movq	0(%rsi,%rbp,1),%rax
+	movq	%rbx,16(%rdi)
+	adcq	%rdx,%r8
+	leaq	16(%rbp),%rbp
+	movq	%r8,24(%rdi)
+	sbbq	%r15,%r15
+	leaq	64(%rdi),%rdi
+	jmp	L$sqr4x_shift_n_add
+
+.p2align	5
+L$sqr4x_shift_n_add:
+	leaq	(%r14,%r10,2),%r12
+	shrq	$63,%r10
+	leaq	(%rcx,%r11,2),%r13
+	shrq	$63,%r11
+	orq	%r10,%r13
+	movq	-16(%rdi),%r10
+	movq	%r11,%r14
+	mulq	%rax
+	negq	%r15
+	movq	-8(%rdi),%r11
+	adcq	%rax,%r12
+	movq	-8(%rsi,%rbp,1),%rax
+	movq	%r12,-32(%rdi)
+	adcq	%rdx,%r13
+
+	leaq	(%r14,%r10,2),%rbx
+	movq	%r13,-24(%rdi)
+	sbbq	%r15,%r15
+	shrq	$63,%r10
+	leaq	(%rcx,%r11,2),%r8
+	shrq	$63,%r11
+	orq	%r10,%r8
+	movq	0(%rdi),%r10
+	movq	%r11,%r14
+	mulq	%rax
+	negq	%r15
+	movq	8(%rdi),%r11
+	adcq	%rax,%rbx
+	movq	0(%rsi,%rbp,1),%rax
+	movq	%rbx,-16(%rdi)
+	adcq	%rdx,%r8
+
+	leaq	(%r14,%r10,2),%r12
+	movq	%r8,-8(%rdi)
+	sbbq	%r15,%r15
+	shrq	$63,%r10
+	leaq	(%rcx,%r11,2),%r13
+	shrq	$63,%r11
+	orq	%r10,%r13
+	movq	16(%rdi),%r10
+	movq	%r11,%r14
+	mulq	%rax
+	negq	%r15
+	movq	24(%rdi),%r11
+	adcq	%rax,%r12
+	movq	8(%rsi,%rbp,1),%rax
+	movq	%r12,0(%rdi)
+	adcq	%rdx,%r13
+
+	leaq	(%r14,%r10,2),%rbx
+	movq	%r13,8(%rdi)
+	sbbq	%r15,%r15
+	shrq	$63,%r10
+	leaq	(%rcx,%r11,2),%r8
+	shrq	$63,%r11
+	orq	%r10,%r8
+	movq	32(%rdi),%r10
+	movq	%r11,%r14
+	mulq	%rax
+	negq	%r15
+	movq	40(%rdi),%r11
+	adcq	%rax,%rbx
+	movq	16(%rsi,%rbp,1),%rax
+	movq	%rbx,16(%rdi)
+	adcq	%rdx,%r8
+	movq	%r8,24(%rdi)
+	sbbq	%r15,%r15
+	leaq	64(%rdi),%rdi
+	addq	$32,%rbp
+	jnz	L$sqr4x_shift_n_add
+
+	leaq	(%r14,%r10,2),%r12
+.byte	0x67
+	shrq	$63,%r10
+	leaq	(%rcx,%r11,2),%r13
+	shrq	$63,%r11
+	orq	%r10,%r13
+	movq	-16(%rdi),%r10
+	movq	%r11,%r14
+	mulq	%rax
+	negq	%r15
+	movq	-8(%rdi),%r11
+	adcq	%rax,%r12
+	movq	-8(%rsi),%rax
+	movq	%r12,-32(%rdi)
+	adcq	%rdx,%r13
+
+	leaq	(%r14,%r10,2),%rbx
+	movq	%r13,-24(%rdi)
+	sbbq	%r15,%r15
+	shrq	$63,%r10
+	leaq	(%rcx,%r11,2),%r8
+	shrq	$63,%r11
+	orq	%r10,%r8
+	mulq	%rax
+	negq	%r15
+	adcq	%rax,%rbx
+	adcq	%rdx,%r8
+	movq	%rbx,-16(%rdi)
+	movq	%r8,-8(%rdi)
+.byte	102,72,15,126,213
+sqr8x_reduction:
+	xorq	%rax,%rax
+	leaq	(%rbp,%r9,2),%rcx
+	leaq	48+8(%rsp,%r9,2),%rdx
+	movq	%rcx,0+8(%rsp)
+	leaq	48+8(%rsp,%r9,1),%rdi
+	movq	%rdx,8+8(%rsp)
+	negq	%r9
+	jmp	L$8x_reduction_loop
+
+.p2align	5
+L$8x_reduction_loop:
+	leaq	(%rdi,%r9,1),%rdi
+.byte	0x66
+	movq	0(%rdi),%rbx
+	movq	8(%rdi),%r9
+	movq	16(%rdi),%r10
+	movq	24(%rdi),%r11
+	movq	32(%rdi),%r12
+	movq	40(%rdi),%r13
+	movq	48(%rdi),%r14
+	movq	56(%rdi),%r15
+	movq	%rax,(%rdx)
+	leaq	64(%rdi),%rdi
+
+.byte	0x67
+	movq	%rbx,%r8
+	imulq	32+8(%rsp),%rbx
+	movq	0(%rbp),%rax
+	movl	$8,%ecx
+	jmp	L$8x_reduce
+
+.p2align	5
+L$8x_reduce:
+	mulq	%rbx
+	movq	16(%rbp),%rax
+	negq	%r8
+	movq	%rdx,%r8
+	adcq	$0,%r8
+
+	mulq	%rbx
+	addq	%rax,%r9
+	movq	32(%rbp),%rax
+	adcq	$0,%rdx
+	addq	%r9,%r8
+	movq	%rbx,48-8+8(%rsp,%rcx,8)
+	movq	%rdx,%r9
+	adcq	$0,%r9
+
+	mulq	%rbx
+	addq	%rax,%r10
+	movq	48(%rbp),%rax
+	adcq	$0,%rdx
+	addq	%r10,%r9
+	movq	32+8(%rsp),%rsi
+	movq	%rdx,%r10
+	adcq	$0,%r10
+
+	mulq	%rbx
+	addq	%rax,%r11
+	movq	64(%rbp),%rax
+	adcq	$0,%rdx
+	imulq	%r8,%rsi
+	addq	%r11,%r10
+	movq	%rdx,%r11
+	adcq	$0,%r11
+
+	mulq	%rbx
+	addq	%rax,%r12
+	movq	80(%rbp),%rax
+	adcq	$0,%rdx
+	addq	%r12,%r11
+	movq	%rdx,%r12
+	adcq	$0,%r12
+
+	mulq	%rbx
+	addq	%rax,%r13
+	movq	96(%rbp),%rax
+	adcq	$0,%rdx
+	addq	%r13,%r12
+	movq	%rdx,%r13
+	adcq	$0,%r13
+
+	mulq	%rbx
+	addq	%rax,%r14
+	movq	112(%rbp),%rax
+	adcq	$0,%rdx
+	addq	%r14,%r13
+	movq	%rdx,%r14
+	adcq	$0,%r14
+
+	mulq	%rbx
+	movq	%rsi,%rbx
+	addq	%rax,%r15
+	movq	0(%rbp),%rax
+	adcq	$0,%rdx
+	addq	%r15,%r14
+	movq	%rdx,%r15
+	adcq	$0,%r15
+
+	decl	%ecx
+	jnz	L$8x_reduce
+
+	leaq	128(%rbp),%rbp
+	xorq	%rax,%rax
+	movq	8+8(%rsp),%rdx
+	cmpq	0+8(%rsp),%rbp
+	jae	L$8x_no_tail
+
+.byte	0x66
+	addq	0(%rdi),%r8
+	adcq	8(%rdi),%r9
+	adcq	16(%rdi),%r10
+	adcq	24(%rdi),%r11
+	adcq	32(%rdi),%r12
+	adcq	40(%rdi),%r13
+	adcq	48(%rdi),%r14
+	adcq	56(%rdi),%r15
+	sbbq	%rsi,%rsi
+
+	movq	48+56+8(%rsp),%rbx
+	movl	$8,%ecx
+	movq	0(%rbp),%rax
+	jmp	L$8x_tail
+
+.p2align	5
+L$8x_tail:
+	mulq	%rbx
+	addq	%rax,%r8
+	movq	16(%rbp),%rax
+	movq	%r8,(%rdi)
+	movq	%rdx,%r8
+	adcq	$0,%r8
+
+	mulq	%rbx
+	addq	%rax,%r9
+	movq	32(%rbp),%rax
+	adcq	$0,%rdx
+	addq	%r9,%r8
+	leaq	8(%rdi),%rdi
+	movq	%rdx,%r9
+	adcq	$0,%r9
+
+	mulq	%rbx
+	addq	%rax,%r10
+	movq	48(%rbp),%rax
+	adcq	$0,%rdx
+	addq	%r10,%r9
+	movq	%rdx,%r10
+	adcq	$0,%r10
+
+	mulq	%rbx
+	addq	%rax,%r11
+	movq	64(%rbp),%rax
+	adcq	$0,%rdx
+	addq	%r11,%r10
+	movq	%rdx,%r11
+	adcq	$0,%r11
+
+	mulq	%rbx
+	addq	%rax,%r12
+	movq	80(%rbp),%rax
+	adcq	$0,%rdx
+	addq	%r12,%r11
+	movq	%rdx,%r12
+	adcq	$0,%r12
+
+	mulq	%rbx
+	addq	%rax,%r13
+	movq	96(%rbp),%rax
+	adcq	$0,%rdx
+	addq	%r13,%r12
+	movq	%rdx,%r13
+	adcq	$0,%r13
+
+	mulq	%rbx
+	addq	%rax,%r14
+	movq	112(%rbp),%rax
+	adcq	$0,%rdx
+	addq	%r14,%r13
+	movq	%rdx,%r14
+	adcq	$0,%r14
+
+	mulq	%rbx
+	movq	48-16+8(%rsp,%rcx,8),%rbx
+	addq	%rax,%r15
+	adcq	$0,%rdx
+	addq	%r15,%r14
+	movq	0(%rbp),%rax
+	movq	%rdx,%r15
+	adcq	$0,%r15
+
+	decl	%ecx
+	jnz	L$8x_tail
+
+	leaq	128(%rbp),%rbp
+	movq	8+8(%rsp),%rdx
+	cmpq	0+8(%rsp),%rbp
+	jae	L$8x_tail_done
+
+	movq	48+56+8(%rsp),%rbx
+	negq	%rsi
+	movq	0(%rbp),%rax
+	adcq	0(%rdi),%r8
+	adcq	8(%rdi),%r9
+	adcq	16(%rdi),%r10
+	adcq	24(%rdi),%r11
+	adcq	32(%rdi),%r12
+	adcq	40(%rdi),%r13
+	adcq	48(%rdi),%r14
+	adcq	56(%rdi),%r15
+	sbbq	%rsi,%rsi
+
+	movl	$8,%ecx
+	jmp	L$8x_tail
+
+.p2align	5
+L$8x_tail_done:
+	addq	(%rdx),%r8
+	xorq	%rax,%rax
+
+	negq	%rsi
+L$8x_no_tail:
+	adcq	0(%rdi),%r8
+	adcq	8(%rdi),%r9
+	adcq	16(%rdi),%r10
+	adcq	24(%rdi),%r11
+	adcq	32(%rdi),%r12
+	adcq	40(%rdi),%r13
+	adcq	48(%rdi),%r14
+	adcq	56(%rdi),%r15
+	adcq	$0,%rax
+	movq	-16(%rbp),%rcx
+	xorq	%rsi,%rsi
+
+.byte	102,72,15,126,213
+
+	movq	%r8,0(%rdi)
+	movq	%r9,8(%rdi)
+.byte	102,73,15,126,217
+	movq	%r10,16(%rdi)
+	movq	%r11,24(%rdi)
+	movq	%r12,32(%rdi)
+	movq	%r13,40(%rdi)
+	movq	%r14,48(%rdi)
+	movq	%r15,56(%rdi)
+	leaq	64(%rdi),%rdi
+
+	cmpq	%rdx,%rdi
+	jb	L$8x_reduction_loop
+
+	subq	%r15,%rcx
+	leaq	(%rdi,%r9,1),%rbx
+	adcq	%rsi,%rsi
+	movq	%r9,%rcx
+	orq	%rsi,%rax
+.byte	102,72,15,126,207
+	xorq	$1,%rax
+.byte	102,72,15,126,206
+	leaq	(%rbp,%rax,8),%rbp
+	sarq	$3+2,%rcx
+	jmp	L$sqr4x_sub
+
+.p2align	5
+L$sqr4x_sub:
+.byte	0x66
+	movq	0(%rbx),%r12
+	movq	8(%rbx),%r13
+	sbbq	0(%rbp),%r12
+	movq	16(%rbx),%r14
+	sbbq	16(%rbp),%r13
+	movq	24(%rbx),%r15
+	leaq	32(%rbx),%rbx
+	sbbq	32(%rbp),%r14
+	movq	%r12,0(%rdi)
+	sbbq	48(%rbp),%r15
+	leaq	64(%rbp),%rbp
+	movq	%r13,8(%rdi)
+	movq	%r14,16(%rdi)
+	movq	%r15,24(%rdi)
+	leaq	32(%rdi),%rdi
+
+	incq	%rcx
+	jnz	L$sqr4x_sub
+	movq	%r9,%r10
+	negq	%r9
+	.byte	0xf3,0xc3
+
+.globl	_bn_from_montgomery
+.private_extern _bn_from_montgomery
+
+.p2align	5
+_bn_from_montgomery:
+	testl	$7,%r9d
+	jz	bn_from_mont8x
+	xorl	%eax,%eax
+	.byte	0xf3,0xc3
+
+
+
+.p2align	5
+bn_from_mont8x:
+.byte	0x67
+	movq	%rsp,%rax
+	pushq	%rbx
+	pushq	%rbp
+	pushq	%r12
+	pushq	%r13
+	pushq	%r14
+	pushq	%r15
+.byte	0x67
+	movl	%r9d,%r10d
+	shll	$3,%r9d
+	shll	$3+2,%r10d
+	negq	%r9
+	movq	(%r8),%r8
+
+
+
+
+
+
+
+	leaq	-64(%rsp,%r9,2),%r11
+	subq	%rsi,%r11
+	andq	$4095,%r11
+	cmpq	%r11,%r10
+	jb	L$from_sp_alt
+	subq	%r11,%rsp
+	leaq	-64(%rsp,%r9,2),%rsp
+	jmp	L$from_sp_done
+
+.p2align	5
+L$from_sp_alt:
+	leaq	4096-64(,%r9,2),%r10
+	leaq	-64(%rsp,%r9,2),%rsp
+	subq	%r10,%r11
+	movq	$0,%r10
+	cmovcq	%r10,%r11
+	subq	%r11,%rsp
+L$from_sp_done:
+	andq	$-64,%rsp
+	movq	%r9,%r10
+	negq	%r9
+
+
+
+
+
+
+
+
+
+
+	movq	%r8,32(%rsp)
+	movq	%rax,40(%rsp)
+L$from_body:
+	movq	%r9,%r11
+	leaq	48(%rsp),%rax
+	pxor	%xmm0,%xmm0
+	jmp	L$mul_by_1
+
+.p2align	5
+L$mul_by_1:
+	movdqu	(%rsi),%xmm1
+	movdqu	16(%rsi),%xmm2
+	movdqu	32(%rsi),%xmm3
+	movdqa	%xmm0,(%rax,%r9,1)
+	movdqu	48(%rsi),%xmm4
+	movdqa	%xmm0,16(%rax,%r9,1)
+.byte	0x48,0x8d,0xb6,0x40,0x00,0x00,0x00
+	movdqa	%xmm1,(%rax)
+	movdqa	%xmm0,32(%rax,%r9,1)
+	movdqa	%xmm2,16(%rax)
+	movdqa	%xmm0,48(%rax,%r9,1)
+	movdqa	%xmm3,32(%rax)
+	movdqa	%xmm4,48(%rax)
+	leaq	64(%rax),%rax
+	subq	$64,%r11
+	jnz	L$mul_by_1
+
+.byte	102,72,15,110,207
+.byte	102,72,15,110,209
+.byte	0x67
+	movq	%rcx,%rbp
+.byte	102,73,15,110,218
+	call	sqr8x_reduction
+
+	pxor	%xmm0,%xmm0
+	leaq	48(%rsp),%rax
+	movq	40(%rsp),%rsi
+	jmp	L$from_mont_zero
+
+.p2align	5
+L$from_mont_zero:
+	movdqa	%xmm0,0(%rax)
+	movdqa	%xmm0,16(%rax)
+	movdqa	%xmm0,32(%rax)
+	movdqa	%xmm0,48(%rax)
+	leaq	64(%rax),%rax
+	subq	$32,%r9
+	jnz	L$from_mont_zero
+
+	movq	$1,%rax
+	movq	-48(%rsi),%r15
+	movq	-40(%rsi),%r14
+	movq	-32(%rsi),%r13
+	movq	-24(%rsi),%r12
+	movq	-16(%rsi),%rbp
+	movq	-8(%rsi),%rbx
+	leaq	(%rsi),%rsp
+L$from_epilogue:
+	.byte	0xf3,0xc3
+
+.globl	_bn_scatter5
+.private_extern _bn_scatter5
+
+.p2align	4
+_bn_scatter5:
+	cmpl	$0,%esi
+	jz	L$scatter_epilogue
+	leaq	(%rdx,%rcx,8),%rdx
+L$scatter:
+	movq	(%rdi),%rax
+	leaq	8(%rdi),%rdi
+	movq	%rax,(%rdx)
+	leaq	256(%rdx),%rdx
+	subl	$1,%esi
+	jnz	L$scatter
+L$scatter_epilogue:
+	.byte	0xf3,0xc3
+
+
+.globl	_bn_gather5
+.private_extern _bn_gather5
+
+.p2align	4
+_bn_gather5:
+	movl	%ecx,%r11d
+	shrl	$3,%ecx
+	andq	$7,%r11
+	notl	%ecx
+	leaq	L$magic_masks(%rip),%rax
+	andl	$3,%ecx
+	leaq	128(%rdx,%r11,8),%rdx
+	movq	0(%rax,%rcx,8),%xmm4
+	movq	8(%rax,%rcx,8),%xmm5
+	movq	16(%rax,%rcx,8),%xmm6
+	movq	24(%rax,%rcx,8),%xmm7
+	jmp	L$gather
+.p2align	4
+L$gather:
+	movq	-128(%rdx),%xmm0
+	movq	-64(%rdx),%xmm1
+	pand	%xmm4,%xmm0
+	movq	0(%rdx),%xmm2
+	pand	%xmm5,%xmm1
+	movq	64(%rdx),%xmm3
+	pand	%xmm6,%xmm2
+	por	%xmm1,%xmm0
+	pand	%xmm7,%xmm3
+.byte	0x67,0x67
+	por	%xmm2,%xmm0
+	leaq	256(%rdx),%rdx
+	por	%xmm3,%xmm0
+
+	movq	%xmm0,(%rdi)
+	leaq	8(%rdi),%rdi
+	subl	$1,%esi
+	jnz	L$gather
+	.byte	0xf3,0xc3
+L$SEH_end_bn_gather5:
+
+.p2align	6
+L$magic_masks:
+.long	0,0, 0,0, 0,0, -1,-1
+.long	0,0, 0,0, 0,0,  0,0
+.byte	77,111,110,116,103,111,109,101,114,121,32,77,117,108,116,105,112,108,105,99,97,116,105,111,110,32,119,105,116,104,32,115,99,97,116,116,101,114,47,103,97,116,104,101,114,32,102,111,114,32,120,56,54,95,54,52,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0
+#endif
diff --git a/third_party/boringssl/mac-x86_64/crypto/cpu-x86_64-asm.S b/third_party/boringssl/mac-x86_64/crypto/cpu-x86_64-asm.S
new file mode 100644
index 0000000..0dde04d
--- /dev/null
+++ b/third_party/boringssl/mac-x86_64/crypto/cpu-x86_64-asm.S
@@ -0,0 +1,143 @@
+#if defined(__x86_64__)
+.text	
+
+.globl	_OPENSSL_ia32_cpuid
+.private_extern _OPENSSL_ia32_cpuid
+
+.p2align	4
+_OPENSSL_ia32_cpuid:
+
+
+	movq	%rdi,%rdi
+	movq	%rbx,%r8
+
+	xorl	%eax,%eax
+	movl	%eax,8(%rdi)
+	cpuid
+	movl	%eax,%r11d
+
+	xorl	%eax,%eax
+	cmpl	$1970169159,%ebx
+	setne	%al
+	movl	%eax,%r9d
+	cmpl	$1231384169,%edx
+	setne	%al
+	orl	%eax,%r9d
+	cmpl	$1818588270,%ecx
+	setne	%al
+	orl	%eax,%r9d
+	jz	L$intel
+
+	cmpl	$1752462657,%ebx
+	setne	%al
+	movl	%eax,%r10d
+	cmpl	$1769238117,%edx
+	setne	%al
+	orl	%eax,%r10d
+	cmpl	$1145913699,%ecx
+	setne	%al
+	orl	%eax,%r10d
+	jnz	L$intel
+
+
+
+
+	movl	$2147483648,%eax
+	cpuid
+
+
+	cmpl	$2147483649,%eax
+	jb	L$intel
+	movl	%eax,%r10d
+	movl	$2147483649,%eax
+	cpuid
+
+
+	orl	%ecx,%r9d
+	andl	$2049,%r9d
+
+	cmpl	$2147483656,%r10d
+	jb	L$intel
+
+	movl	$2147483656,%eax
+	cpuid
+
+	movzbq	%cl,%r10
+	incq	%r10
+
+	movl	$1,%eax
+	cpuid
+
+	btl	$28,%edx
+	jnc	L$generic
+	shrl	$16,%ebx
+	cmpb	%r10b,%bl
+	ja	L$generic
+	andl	$4026531839,%edx
+	jmp	L$generic
+
+L$intel:
+	cmpl	$4,%r11d
+	movl	$-1,%r10d
+	jb	L$nocacheinfo
+
+	movl	$4,%eax
+	movl	$0,%ecx
+	cpuid
+	movl	%eax,%r10d
+	shrl	$14,%r10d
+	andl	$4095,%r10d
+
+	cmpl	$7,%r11d
+	jb	L$nocacheinfo
+
+	movl	$7,%eax
+	xorl	%ecx,%ecx
+	cpuid
+	movl	%ebx,8(%rdi)
+
+L$nocacheinfo:
+	movl	$1,%eax
+	cpuid
+
+	andl	$3220176895,%edx
+	cmpl	$0,%r9d
+	jne	L$notintel
+	orl	$1073741824,%edx
+L$notintel:
+	btl	$28,%edx
+	jnc	L$generic
+	andl	$4026531839,%edx
+	cmpl	$0,%r10d
+	je	L$generic
+
+	orl	$268435456,%edx
+	shrl	$16,%ebx
+	cmpb	$1,%bl
+	ja	L$generic
+	andl	$4026531839,%edx
+L$generic:
+	andl	$2048,%r9d
+	andl	$4294965247,%ecx
+	orl	%ecx,%r9d
+
+	movl	%edx,%r10d
+	btl	$27,%r9d
+	jnc	L$clear_avx
+	xorl	%ecx,%ecx
+.byte	0x0f,0x01,0xd0
+	andl	$6,%eax
+	cmpl	$6,%eax
+	je	L$done
+L$clear_avx:
+	movl	$4026525695,%eax
+	andl	%eax,%r9d
+	andl	$4294967263,8(%rdi)
+L$done:
+	movl	%r9d,4(%rdi)
+	movl	%r10d,0(%rdi)
+	movq	%r8,%rbx
+	.byte	0xf3,0xc3
+
+
+#endif
diff --git a/third_party/boringssl/mac-x86_64/crypto/md5/md5-x86_64.S b/third_party/boringssl/mac-x86_64/crypto/md5/md5-x86_64.S
new file mode 100644
index 0000000..1e61479
--- /dev/null
+++ b/third_party/boringssl/mac-x86_64/crypto/md5/md5-x86_64.S
@@ -0,0 +1,671 @@
+#if defined(__x86_64__)
+.text	
+.p2align	4
+
+.globl	_md5_block_asm_data_order
+.private_extern _md5_block_asm_data_order
+
+_md5_block_asm_data_order:
+	pushq	%rbp
+	pushq	%rbx
+	pushq	%r12
+	pushq	%r14
+	pushq	%r15
+L$prologue:
+
+
+
+
+	movq	%rdi,%rbp
+	shlq	$6,%rdx
+	leaq	(%rsi,%rdx,1),%rdi
+	movl	0(%rbp),%eax
+	movl	4(%rbp),%ebx
+	movl	8(%rbp),%ecx
+	movl	12(%rbp),%edx
+
+
+
+
+
+
+
+	cmpq	%rdi,%rsi
+	je	L$end
+
+
+L$loop:
+	movl	%eax,%r8d
+	movl	%ebx,%r9d
+	movl	%ecx,%r14d
+	movl	%edx,%r15d
+	movl	0(%rsi),%r10d
+	movl	%edx,%r11d
+	xorl	%ecx,%r11d
+	leal	-680876936(%rax,%r10,1),%eax
+	andl	%ebx,%r11d
+	xorl	%edx,%r11d
+	movl	4(%rsi),%r10d
+	addl	%r11d,%eax
+	roll	$7,%eax
+	movl	%ecx,%r11d
+	addl	%ebx,%eax
+	xorl	%ebx,%r11d
+	leal	-389564586(%rdx,%r10,1),%edx
+	andl	%eax,%r11d
+	xorl	%ecx,%r11d
+	movl	8(%rsi),%r10d
+	addl	%r11d,%edx
+	roll	$12,%edx
+	movl	%ebx,%r11d
+	addl	%eax,%edx
+	xorl	%eax,%r11d
+	leal	606105819(%rcx,%r10,1),%ecx
+	andl	%edx,%r11d
+	xorl	%ebx,%r11d
+	movl	12(%rsi),%r10d
+	addl	%r11d,%ecx
+	roll	$17,%ecx
+	movl	%eax,%r11d
+	addl	%edx,%ecx
+	xorl	%edx,%r11d
+	leal	-1044525330(%rbx,%r10,1),%ebx
+	andl	%ecx,%r11d
+	xorl	%eax,%r11d
+	movl	16(%rsi),%r10d
+	addl	%r11d,%ebx
+	roll	$22,%ebx
+	movl	%edx,%r11d
+	addl	%ecx,%ebx
+	xorl	%ecx,%r11d
+	leal	-176418897(%rax,%r10,1),%eax
+	andl	%ebx,%r11d
+	xorl	%edx,%r11d
+	movl	20(%rsi),%r10d
+	addl	%r11d,%eax
+	roll	$7,%eax
+	movl	%ecx,%r11d
+	addl	%ebx,%eax
+	xorl	%ebx,%r11d
+	leal	1200080426(%rdx,%r10,1),%edx
+	andl	%eax,%r11d
+	xorl	%ecx,%r11d
+	movl	24(%rsi),%r10d
+	addl	%r11d,%edx
+	roll	$12,%edx
+	movl	%ebx,%r11d
+	addl	%eax,%edx
+	xorl	%eax,%r11d
+	leal	-1473231341(%rcx,%r10,1),%ecx
+	andl	%edx,%r11d
+	xorl	%ebx,%r11d
+	movl	28(%rsi),%r10d
+	addl	%r11d,%ecx
+	roll	$17,%ecx
+	movl	%eax,%r11d
+	addl	%edx,%ecx
+	xorl	%edx,%r11d
+	leal	-45705983(%rbx,%r10,1),%ebx
+	andl	%ecx,%r11d
+	xorl	%eax,%r11d
+	movl	32(%rsi),%r10d
+	addl	%r11d,%ebx
+	roll	$22,%ebx
+	movl	%edx,%r11d
+	addl	%ecx,%ebx
+	xorl	%ecx,%r11d
+	leal	1770035416(%rax,%r10,1),%eax
+	andl	%ebx,%r11d
+	xorl	%edx,%r11d
+	movl	36(%rsi),%r10d
+	addl	%r11d,%eax
+	roll	$7,%eax
+	movl	%ecx,%r11d
+	addl	%ebx,%eax
+	xorl	%ebx,%r11d
+	leal	-1958414417(%rdx,%r10,1),%edx
+	andl	%eax,%r11d
+	xorl	%ecx,%r11d
+	movl	40(%rsi),%r10d
+	addl	%r11d,%edx
+	roll	$12,%edx
+	movl	%ebx,%r11d
+	addl	%eax,%edx
+	xorl	%eax,%r11d
+	leal	-42063(%rcx,%r10,1),%ecx
+	andl	%edx,%r11d
+	xorl	%ebx,%r11d
+	movl	44(%rsi),%r10d
+	addl	%r11d,%ecx
+	roll	$17,%ecx
+	movl	%eax,%r11d
+	addl	%edx,%ecx
+	xorl	%edx,%r11d
+	leal	-1990404162(%rbx,%r10,1),%ebx
+	andl	%ecx,%r11d
+	xorl	%eax,%r11d
+	movl	48(%rsi),%r10d
+	addl	%r11d,%ebx
+	roll	$22,%ebx
+	movl	%edx,%r11d
+	addl	%ecx,%ebx
+	xorl	%ecx,%r11d
+	leal	1804603682(%rax,%r10,1),%eax
+	andl	%ebx,%r11d
+	xorl	%edx,%r11d
+	movl	52(%rsi),%r10d
+	addl	%r11d,%eax
+	roll	$7,%eax
+	movl	%ecx,%r11d
+	addl	%ebx,%eax
+	xorl	%ebx,%r11d
+	leal	-40341101(%rdx,%r10,1),%edx
+	andl	%eax,%r11d
+	xorl	%ecx,%r11d
+	movl	56(%rsi),%r10d
+	addl	%r11d,%edx
+	roll	$12,%edx
+	movl	%ebx,%r11d
+	addl	%eax,%edx
+	xorl	%eax,%r11d
+	leal	-1502002290(%rcx,%r10,1),%ecx
+	andl	%edx,%r11d
+	xorl	%ebx,%r11d
+	movl	60(%rsi),%r10d
+	addl	%r11d,%ecx
+	roll	$17,%ecx
+	movl	%eax,%r11d
+	addl	%edx,%ecx
+	xorl	%edx,%r11d
+	leal	1236535329(%rbx,%r10,1),%ebx
+	andl	%ecx,%r11d
+	xorl	%eax,%r11d
+	movl	0(%rsi),%r10d
+	addl	%r11d,%ebx
+	roll	$22,%ebx
+	movl	%edx,%r11d
+	addl	%ecx,%ebx
+	movl	4(%rsi),%r10d
+	movl	%edx,%r11d
+	movl	%edx,%r12d
+	notl	%r11d
+	leal	-165796510(%rax,%r10,1),%eax
+	andl	%ebx,%r12d
+	andl	%ecx,%r11d
+	movl	24(%rsi),%r10d
+	orl	%r11d,%r12d
+	movl	%ecx,%r11d
+	addl	%r12d,%eax
+	movl	%ecx,%r12d
+	roll	$5,%eax
+	addl	%ebx,%eax
+	notl	%r11d
+	leal	-1069501632(%rdx,%r10,1),%edx
+	andl	%eax,%r12d
+	andl	%ebx,%r11d
+	movl	44(%rsi),%r10d
+	orl	%r11d,%r12d
+	movl	%ebx,%r11d
+	addl	%r12d,%edx
+	movl	%ebx,%r12d
+	roll	$9,%edx
+	addl	%eax,%edx
+	notl	%r11d
+	leal	643717713(%rcx,%r10,1),%ecx
+	andl	%edx,%r12d
+	andl	%eax,%r11d
+	movl	0(%rsi),%r10d
+	orl	%r11d,%r12d
+	movl	%eax,%r11d
+	addl	%r12d,%ecx
+	movl	%eax,%r12d
+	roll	$14,%ecx
+	addl	%edx,%ecx
+	notl	%r11d
+	leal	-373897302(%rbx,%r10,1),%ebx
+	andl	%ecx,%r12d
+	andl	%edx,%r11d
+	movl	20(%rsi),%r10d
+	orl	%r11d,%r12d
+	movl	%edx,%r11d
+	addl	%r12d,%ebx
+	movl	%edx,%r12d
+	roll	$20,%ebx
+	addl	%ecx,%ebx
+	notl	%r11d
+	leal	-701558691(%rax,%r10,1),%eax
+	andl	%ebx,%r12d
+	andl	%ecx,%r11d
+	movl	40(%rsi),%r10d
+	orl	%r11d,%r12d
+	movl	%ecx,%r11d
+	addl	%r12d,%eax
+	movl	%ecx,%r12d
+	roll	$5,%eax
+	addl	%ebx,%eax
+	notl	%r11d
+	leal	38016083(%rdx,%r10,1),%edx
+	andl	%eax,%r12d
+	andl	%ebx,%r11d
+	movl	60(%rsi),%r10d
+	orl	%r11d,%r12d
+	movl	%ebx,%r11d
+	addl	%r12d,%edx
+	movl	%ebx,%r12d
+	roll	$9,%edx
+	addl	%eax,%edx
+	notl	%r11d
+	leal	-660478335(%rcx,%r10,1),%ecx
+	andl	%edx,%r12d
+	andl	%eax,%r11d
+	movl	16(%rsi),%r10d
+	orl	%r11d,%r12d
+	movl	%eax,%r11d
+	addl	%r12d,%ecx
+	movl	%eax,%r12d
+	roll	$14,%ecx
+	addl	%edx,%ecx
+	notl	%r11d
+	leal	-405537848(%rbx,%r10,1),%ebx
+	andl	%ecx,%r12d
+	andl	%edx,%r11d
+	movl	36(%rsi),%r10d
+	orl	%r11d,%r12d
+	movl	%edx,%r11d
+	addl	%r12d,%ebx
+	movl	%edx,%r12d
+	roll	$20,%ebx
+	addl	%ecx,%ebx
+	notl	%r11d
+	leal	568446438(%rax,%r10,1),%eax
+	andl	%ebx,%r12d
+	andl	%ecx,%r11d
+	movl	56(%rsi),%r10d
+	orl	%r11d,%r12d
+	movl	%ecx,%r11d
+	addl	%r12d,%eax
+	movl	%ecx,%r12d
+	roll	$5,%eax
+	addl	%ebx,%eax
+	notl	%r11d
+	leal	-1019803690(%rdx,%r10,1),%edx
+	andl	%eax,%r12d
+	andl	%ebx,%r11d
+	movl	12(%rsi),%r10d
+	orl	%r11d,%r12d
+	movl	%ebx,%r11d
+	addl	%r12d,%edx
+	movl	%ebx,%r12d
+	roll	$9,%edx
+	addl	%eax,%edx
+	notl	%r11d
+	leal	-187363961(%rcx,%r10,1),%ecx
+	andl	%edx,%r12d
+	andl	%eax,%r11d
+	movl	32(%rsi),%r10d
+	orl	%r11d,%r12d
+	movl	%eax,%r11d
+	addl	%r12d,%ecx
+	movl	%eax,%r12d
+	roll	$14,%ecx
+	addl	%edx,%ecx
+	notl	%r11d
+	leal	1163531501(%rbx,%r10,1),%ebx
+	andl	%ecx,%r12d
+	andl	%edx,%r11d
+	movl	52(%rsi),%r10d
+	orl	%r11d,%r12d
+	movl	%edx,%r11d
+	addl	%r12d,%ebx
+	movl	%edx,%r12d
+	roll	$20,%ebx
+	addl	%ecx,%ebx
+	notl	%r11d
+	leal	-1444681467(%rax,%r10,1),%eax
+	andl	%ebx,%r12d
+	andl	%ecx,%r11d
+	movl	8(%rsi),%r10d
+	orl	%r11d,%r12d
+	movl	%ecx,%r11d
+	addl	%r12d,%eax
+	movl	%ecx,%r12d
+	roll	$5,%eax
+	addl	%ebx,%eax
+	notl	%r11d
+	leal	-51403784(%rdx,%r10,1),%edx
+	andl	%eax,%r12d
+	andl	%ebx,%r11d
+	movl	28(%rsi),%r10d
+	orl	%r11d,%r12d
+	movl	%ebx,%r11d
+	addl	%r12d,%edx
+	movl	%ebx,%r12d
+	roll	$9,%edx
+	addl	%eax,%edx
+	notl	%r11d
+	leal	1735328473(%rcx,%r10,1),%ecx
+	andl	%edx,%r12d
+	andl	%eax,%r11d
+	movl	48(%rsi),%r10d
+	orl	%r11d,%r12d
+	movl	%eax,%r11d
+	addl	%r12d,%ecx
+	movl	%eax,%r12d
+	roll	$14,%ecx
+	addl	%edx,%ecx
+	notl	%r11d
+	leal	-1926607734(%rbx,%r10,1),%ebx
+	andl	%ecx,%r12d
+	andl	%edx,%r11d
+	movl	0(%rsi),%r10d
+	orl	%r11d,%r12d
+	movl	%edx,%r11d
+	addl	%r12d,%ebx
+	movl	%edx,%r12d
+	roll	$20,%ebx
+	addl	%ecx,%ebx
+	movl	20(%rsi),%r10d
+	movl	%ecx,%r11d
+	leal	-378558(%rax,%r10,1),%eax
+	movl	32(%rsi),%r10d
+	xorl	%edx,%r11d
+	xorl	%ebx,%r11d
+	addl	%r11d,%eax
+	roll	$4,%eax
+	movl	%ebx,%r11d
+	addl	%ebx,%eax
+	leal	-2022574463(%rdx,%r10,1),%edx
+	movl	44(%rsi),%r10d
+	xorl	%ecx,%r11d
+	xorl	%eax,%r11d
+	addl	%r11d,%edx
+	roll	$11,%edx
+	movl	%eax,%r11d
+	addl	%eax,%edx
+	leal	1839030562(%rcx,%r10,1),%ecx
+	movl	56(%rsi),%r10d
+	xorl	%ebx,%r11d
+	xorl	%edx,%r11d
+	addl	%r11d,%ecx
+	roll	$16,%ecx
+	movl	%edx,%r11d
+	addl	%edx,%ecx
+	leal	-35309556(%rbx,%r10,1),%ebx
+	movl	4(%rsi),%r10d
+	xorl	%eax,%r11d
+	xorl	%ecx,%r11d
+	addl	%r11d,%ebx
+	roll	$23,%ebx
+	movl	%ecx,%r11d
+	addl	%ecx,%ebx
+	leal	-1530992060(%rax,%r10,1),%eax
+	movl	16(%rsi),%r10d
+	xorl	%edx,%r11d
+	xorl	%ebx,%r11d
+	addl	%r11d,%eax
+	roll	$4,%eax
+	movl	%ebx,%r11d
+	addl	%ebx,%eax
+	leal	1272893353(%rdx,%r10,1),%edx
+	movl	28(%rsi),%r10d
+	xorl	%ecx,%r11d
+	xorl	%eax,%r11d
+	addl	%r11d,%edx
+	roll	$11,%edx
+	movl	%eax,%r11d
+	addl	%eax,%edx
+	leal	-155497632(%rcx,%r10,1),%ecx
+	movl	40(%rsi),%r10d
+	xorl	%ebx,%r11d
+	xorl	%edx,%r11d
+	addl	%r11d,%ecx
+	roll	$16,%ecx
+	movl	%edx,%r11d
+	addl	%edx,%ecx
+	leal	-1094730640(%rbx,%r10,1),%ebx
+	movl	52(%rsi),%r10d
+	xorl	%eax,%r11d
+	xorl	%ecx,%r11d
+	addl	%r11d,%ebx
+	roll	$23,%ebx
+	movl	%ecx,%r11d
+	addl	%ecx,%ebx
+	leal	681279174(%rax,%r10,1),%eax
+	movl	0(%rsi),%r10d
+	xorl	%edx,%r11d
+	xorl	%ebx,%r11d
+	addl	%r11d,%eax
+	roll	$4,%eax
+	movl	%ebx,%r11d
+	addl	%ebx,%eax
+	leal	-358537222(%rdx,%r10,1),%edx
+	movl	12(%rsi),%r10d
+	xorl	%ecx,%r11d
+	xorl	%eax,%r11d
+	addl	%r11d,%edx
+	roll	$11,%edx
+	movl	%eax,%r11d
+	addl	%eax,%edx
+	leal	-722521979(%rcx,%r10,1),%ecx
+	movl	24(%rsi),%r10d
+	xorl	%ebx,%r11d
+	xorl	%edx,%r11d
+	addl	%r11d,%ecx
+	roll	$16,%ecx
+	movl	%edx,%r11d
+	addl	%edx,%ecx
+	leal	76029189(%rbx,%r10,1),%ebx
+	movl	36(%rsi),%r10d
+	xorl	%eax,%r11d
+	xorl	%ecx,%r11d
+	addl	%r11d,%ebx
+	roll	$23,%ebx
+	movl	%ecx,%r11d
+	addl	%ecx,%ebx
+	leal	-640364487(%rax,%r10,1),%eax
+	movl	48(%rsi),%r10d
+	xorl	%edx,%r11d
+	xorl	%ebx,%r11d
+	addl	%r11d,%eax
+	roll	$4,%eax
+	movl	%ebx,%r11d
+	addl	%ebx,%eax
+	leal	-421815835(%rdx,%r10,1),%edx
+	movl	60(%rsi),%r10d
+	xorl	%ecx,%r11d
+	xorl	%eax,%r11d
+	addl	%r11d,%edx
+	roll	$11,%edx
+	movl	%eax,%r11d
+	addl	%eax,%edx
+	leal	530742520(%rcx,%r10,1),%ecx
+	movl	8(%rsi),%r10d
+	xorl	%ebx,%r11d
+	xorl	%edx,%r11d
+	addl	%r11d,%ecx
+	roll	$16,%ecx
+	movl	%edx,%r11d
+	addl	%edx,%ecx
+	leal	-995338651(%rbx,%r10,1),%ebx
+	movl	0(%rsi),%r10d
+	xorl	%eax,%r11d
+	xorl	%ecx,%r11d
+	addl	%r11d,%ebx
+	roll	$23,%ebx
+	movl	%ecx,%r11d
+	addl	%ecx,%ebx
+	movl	0(%rsi),%r10d
+	movl	$4294967295,%r11d
+	xorl	%edx,%r11d
+	leal	-198630844(%rax,%r10,1),%eax
+	orl	%ebx,%r11d
+	xorl	%ecx,%r11d
+	addl	%r11d,%eax
+	movl	28(%rsi),%r10d
+	movl	$4294967295,%r11d
+	roll	$6,%eax
+	xorl	%ecx,%r11d
+	addl	%ebx,%eax
+	leal	1126891415(%rdx,%r10,1),%edx
+	orl	%eax,%r11d
+	xorl	%ebx,%r11d
+	addl	%r11d,%edx
+	movl	56(%rsi),%r10d
+	movl	$4294967295,%r11d
+	roll	$10,%edx
+	xorl	%ebx,%r11d
+	addl	%eax,%edx
+	leal	-1416354905(%rcx,%r10,1),%ecx
+	orl	%edx,%r11d
+	xorl	%eax,%r11d
+	addl	%r11d,%ecx
+	movl	20(%rsi),%r10d
+	movl	$4294967295,%r11d
+	roll	$15,%ecx
+	xorl	%eax,%r11d
+	addl	%edx,%ecx
+	leal	-57434055(%rbx,%r10,1),%ebx
+	orl	%ecx,%r11d
+	xorl	%edx,%r11d
+	addl	%r11d,%ebx
+	movl	48(%rsi),%r10d
+	movl	$4294967295,%r11d
+	roll	$21,%ebx
+	xorl	%edx,%r11d
+	addl	%ecx,%ebx
+	leal	1700485571(%rax,%r10,1),%eax
+	orl	%ebx,%r11d
+	xorl	%ecx,%r11d
+	addl	%r11d,%eax
+	movl	12(%rsi),%r10d
+	movl	$4294967295,%r11d
+	roll	$6,%eax
+	xorl	%ecx,%r11d
+	addl	%ebx,%eax
+	leal	-1894986606(%rdx,%r10,1),%edx
+	orl	%eax,%r11d
+	xorl	%ebx,%r11d
+	addl	%r11d,%edx
+	movl	40(%rsi),%r10d
+	movl	$4294967295,%r11d
+	roll	$10,%edx
+	xorl	%ebx,%r11d
+	addl	%eax,%edx
+	leal	-1051523(%rcx,%r10,1),%ecx
+	orl	%edx,%r11d
+	xorl	%eax,%r11d
+	addl	%r11d,%ecx
+	movl	4(%rsi),%r10d
+	movl	$4294967295,%r11d
+	roll	$15,%ecx
+	xorl	%eax,%r11d
+	addl	%edx,%ecx
+	leal	-2054922799(%rbx,%r10,1),%ebx
+	orl	%ecx,%r11d
+	xorl	%edx,%r11d
+	addl	%r11d,%ebx
+	movl	32(%rsi),%r10d
+	movl	$4294967295,%r11d
+	roll	$21,%ebx
+	xorl	%edx,%r11d
+	addl	%ecx,%ebx
+	leal	1873313359(%rax,%r10,1),%eax
+	orl	%ebx,%r11d
+	xorl	%ecx,%r11d
+	addl	%r11d,%eax
+	movl	60(%rsi),%r10d
+	movl	$4294967295,%r11d
+	roll	$6,%eax
+	xorl	%ecx,%r11d
+	addl	%ebx,%eax
+	leal	-30611744(%rdx,%r10,1),%edx
+	orl	%eax,%r11d
+	xorl	%ebx,%r11d
+	addl	%r11d,%edx
+	movl	24(%rsi),%r10d
+	movl	$4294967295,%r11d
+	roll	$10,%edx
+	xorl	%ebx,%r11d
+	addl	%eax,%edx
+	leal	-1560198380(%rcx,%r10,1),%ecx
+	orl	%edx,%r11d
+	xorl	%eax,%r11d
+	addl	%r11d,%ecx
+	movl	52(%rsi),%r10d
+	movl	$4294967295,%r11d
+	roll	$15,%ecx
+	xorl	%eax,%r11d
+	addl	%edx,%ecx
+	leal	1309151649(%rbx,%r10,1),%ebx
+	orl	%ecx,%r11d
+	xorl	%edx,%r11d
+	addl	%r11d,%ebx
+	movl	16(%rsi),%r10d
+	movl	$4294967295,%r11d
+	roll	$21,%ebx
+	xorl	%edx,%r11d
+	addl	%ecx,%ebx
+	leal	-145523070(%rax,%r10,1),%eax
+	orl	%ebx,%r11d
+	xorl	%ecx,%r11d
+	addl	%r11d,%eax
+	movl	44(%rsi),%r10d
+	movl	$4294967295,%r11d
+	roll	$6,%eax
+	xorl	%ecx,%r11d
+	addl	%ebx,%eax
+	leal	-1120210379(%rdx,%r10,1),%edx
+	orl	%eax,%r11d
+	xorl	%ebx,%r11d
+	addl	%r11d,%edx
+	movl	8(%rsi),%r10d
+	movl	$4294967295,%r11d
+	roll	$10,%edx
+	xorl	%ebx,%r11d
+	addl	%eax,%edx
+	leal	718787259(%rcx,%r10,1),%ecx
+	orl	%edx,%r11d
+	xorl	%eax,%r11d
+	addl	%r11d,%ecx
+	movl	36(%rsi),%r10d
+	movl	$4294967295,%r11d
+	roll	$15,%ecx
+	xorl	%eax,%r11d
+	addl	%edx,%ecx
+	leal	-343485551(%rbx,%r10,1),%ebx
+	orl	%ecx,%r11d
+	xorl	%edx,%r11d
+	addl	%r11d,%ebx
+	movl	0(%rsi),%r10d
+	movl	$4294967295,%r11d
+	roll	$21,%ebx
+	xorl	%edx,%r11d
+	addl	%ecx,%ebx
+
+	addl	%r8d,%eax
+	addl	%r9d,%ebx
+	addl	%r14d,%ecx
+	addl	%r15d,%edx
+
+
+	addq	$64,%rsi
+	cmpq	%rdi,%rsi
+	jb	L$loop
+
+
+L$end:
+	movl	%eax,0(%rbp)
+	movl	%ebx,4(%rbp)
+	movl	%ecx,8(%rbp)
+	movl	%edx,12(%rbp)
+
+	movq	(%rsp),%r15
+	movq	8(%rsp),%r14
+	movq	16(%rsp),%r12
+	movq	24(%rsp),%rbx
+	movq	32(%rsp),%rbp
+	addq	$40,%rsp
+L$epilogue:
+	.byte	0xf3,0xc3
+
+#endif
diff --git a/third_party/boringssl/mac-x86_64/crypto/modes/aesni-gcm-x86_64.S b/third_party/boringssl/mac-x86_64/crypto/modes/aesni-gcm-x86_64.S
new file mode 100644
index 0000000..21d5ad6
--- /dev/null
+++ b/third_party/boringssl/mac-x86_64/crypto/modes/aesni-gcm-x86_64.S
@@ -0,0 +1,19 @@
+#if defined(__x86_64__)
+.text	
+
+.globl	_aesni_gcm_encrypt
+.private_extern _aesni_gcm_encrypt
+
+_aesni_gcm_encrypt:
+	xorl	%eax,%eax
+	.byte	0xf3,0xc3
+
+
+.globl	_aesni_gcm_decrypt
+.private_extern _aesni_gcm_decrypt
+
+_aesni_gcm_decrypt:
+	xorl	%eax,%eax
+	.byte	0xf3,0xc3
+
+#endif
diff --git a/third_party/boringssl/mac-x86_64/crypto/modes/ghash-x86_64.S b/third_party/boringssl/mac-x86_64/crypto/modes/ghash-x86_64.S
new file mode 100644
index 0000000..305a91c
--- /dev/null
+++ b/third_party/boringssl/mac-x86_64/crypto/modes/ghash-x86_64.S
@@ -0,0 +1,1328 @@
+#if defined(__x86_64__)
+.text	
+
+
+.globl	_gcm_gmult_4bit
+.private_extern _gcm_gmult_4bit
+
+.p2align	4
+_gcm_gmult_4bit:
+	pushq	%rbx
+	pushq	%rbp
+	pushq	%r12
+L$gmult_prologue:
+
+	movzbq	15(%rdi),%r8
+	leaq	L$rem_4bit(%rip),%r11
+	xorq	%rax,%rax
+	xorq	%rbx,%rbx
+	movb	%r8b,%al
+	movb	%r8b,%bl
+	shlb	$4,%al
+	movq	$14,%rcx
+	movq	8(%rsi,%rax,1),%r8
+	movq	(%rsi,%rax,1),%r9
+	andb	$240,%bl
+	movq	%r8,%rdx
+	jmp	L$oop1
+
+.p2align	4
+L$oop1:
+	shrq	$4,%r8
+	andq	$15,%rdx
+	movq	%r9,%r10
+	movb	(%rdi,%rcx,1),%al
+	shrq	$4,%r9
+	xorq	8(%rsi,%rbx,1),%r8
+	shlq	$60,%r10
+	xorq	(%rsi,%rbx,1),%r9
+	movb	%al,%bl
+	xorq	(%r11,%rdx,8),%r9
+	movq	%r8,%rdx
+	shlb	$4,%al
+	xorq	%r10,%r8
+	decq	%rcx
+	js	L$break1
+
+	shrq	$4,%r8
+	andq	$15,%rdx
+	movq	%r9,%r10
+	shrq	$4,%r9
+	xorq	8(%rsi,%rax,1),%r8
+	shlq	$60,%r10
+	xorq	(%rsi,%rax,1),%r9
+	andb	$240,%bl
+	xorq	(%r11,%rdx,8),%r9
+	movq	%r8,%rdx
+	xorq	%r10,%r8
+	jmp	L$oop1
+
+.p2align	4
+L$break1:
+	shrq	$4,%r8
+	andq	$15,%rdx
+	movq	%r9,%r10
+	shrq	$4,%r9
+	xorq	8(%rsi,%rax,1),%r8
+	shlq	$60,%r10
+	xorq	(%rsi,%rax,1),%r9
+	andb	$240,%bl
+	xorq	(%r11,%rdx,8),%r9
+	movq	%r8,%rdx
+	xorq	%r10,%r8
+
+	shrq	$4,%r8
+	andq	$15,%rdx
+	movq	%r9,%r10
+	shrq	$4,%r9
+	xorq	8(%rsi,%rbx,1),%r8
+	shlq	$60,%r10
+	xorq	(%rsi,%rbx,1),%r9
+	xorq	%r10,%r8
+	xorq	(%r11,%rdx,8),%r9
+
+	bswapq	%r8
+	bswapq	%r9
+	movq	%r8,8(%rdi)
+	movq	%r9,(%rdi)
+
+	movq	16(%rsp),%rbx
+	leaq	24(%rsp),%rsp
+L$gmult_epilogue:
+	.byte	0xf3,0xc3
+
+.globl	_gcm_ghash_4bit
+.private_extern _gcm_ghash_4bit
+
+.p2align	4
+_gcm_ghash_4bit:
+	pushq	%rbx
+	pushq	%rbp
+	pushq	%r12
+	pushq	%r13
+	pushq	%r14
+	pushq	%r15
+	subq	$280,%rsp
+L$ghash_prologue:
+	movq	%rdx,%r14
+	movq	%rcx,%r15
+	subq	$-128,%rsi
+	leaq	16+128(%rsp),%rbp
+	xorl	%edx,%edx
+	movq	0+0-128(%rsi),%r8
+	movq	0+8-128(%rsi),%rax
+	movb	%al,%dl
+	shrq	$4,%rax
+	movq	%r8,%r10
+	shrq	$4,%r8
+	movq	16+0-128(%rsi),%r9
+	shlb	$4,%dl
+	movq	16+8-128(%rsi),%rbx
+	shlq	$60,%r10
+	movb	%dl,0(%rsp)
+	orq	%r10,%rax
+	movb	%bl,%dl
+	shrq	$4,%rbx
+	movq	%r9,%r10
+	shrq	$4,%r9
+	movq	%r8,0(%rbp)
+	movq	32+0-128(%rsi),%r8
+	shlb	$4,%dl
+	movq	%rax,0-128(%rbp)
+	movq	32+8-128(%rsi),%rax
+	shlq	$60,%r10
+	movb	%dl,1(%rsp)
+	orq	%r10,%rbx
+	movb	%al,%dl
+	shrq	$4,%rax
+	movq	%r8,%r10
+	shrq	$4,%r8
+	movq	%r9,8(%rbp)
+	movq	48+0-128(%rsi),%r9
+	shlb	$4,%dl
+	movq	%rbx,8-128(%rbp)
+	movq	48+8-128(%rsi),%rbx
+	shlq	$60,%r10
+	movb	%dl,2(%rsp)
+	orq	%r10,%rax
+	movb	%bl,%dl
+	shrq	$4,%rbx
+	movq	%r9,%r10
+	shrq	$4,%r9
+	movq	%r8,16(%rbp)
+	movq	64+0-128(%rsi),%r8
+	shlb	$4,%dl
+	movq	%rax,16-128(%rbp)
+	movq	64+8-128(%rsi),%rax
+	shlq	$60,%r10
+	movb	%dl,3(%rsp)
+	orq	%r10,%rbx
+	movb	%al,%dl
+	shrq	$4,%rax
+	movq	%r8,%r10
+	shrq	$4,%r8
+	movq	%r9,24(%rbp)
+	movq	80+0-128(%rsi),%r9
+	shlb	$4,%dl
+	movq	%rbx,24-128(%rbp)
+	movq	80+8-128(%rsi),%rbx
+	shlq	$60,%r10
+	movb	%dl,4(%rsp)
+	orq	%r10,%rax
+	movb	%bl,%dl
+	shrq	$4,%rbx
+	movq	%r9,%r10
+	shrq	$4,%r9
+	movq	%r8,32(%rbp)
+	movq	96+0-128(%rsi),%r8
+	shlb	$4,%dl
+	movq	%rax,32-128(%rbp)
+	movq	96+8-128(%rsi),%rax
+	shlq	$60,%r10
+	movb	%dl,5(%rsp)
+	orq	%r10,%rbx
+	movb	%al,%dl
+	shrq	$4,%rax
+	movq	%r8,%r10
+	shrq	$4,%r8
+	movq	%r9,40(%rbp)
+	movq	112+0-128(%rsi),%r9
+	shlb	$4,%dl
+	movq	%rbx,40-128(%rbp)
+	movq	112+8-128(%rsi),%rbx
+	shlq	$60,%r10
+	movb	%dl,6(%rsp)
+	orq	%r10,%rax
+	movb	%bl,%dl
+	shrq	$4,%rbx
+	movq	%r9,%r10
+	shrq	$4,%r9
+	movq	%r8,48(%rbp)
+	movq	128+0-128(%rsi),%r8
+	shlb	$4,%dl
+	movq	%rax,48-128(%rbp)
+	movq	128+8-128(%rsi),%rax
+	shlq	$60,%r10
+	movb	%dl,7(%rsp)
+	orq	%r10,%rbx
+	movb	%al,%dl
+	shrq	$4,%rax
+	movq	%r8,%r10
+	shrq	$4,%r8
+	movq	%r9,56(%rbp)
+	movq	144+0-128(%rsi),%r9
+	shlb	$4,%dl
+	movq	%rbx,56-128(%rbp)
+	movq	144+8-128(%rsi),%rbx
+	shlq	$60,%r10
+	movb	%dl,8(%rsp)
+	orq	%r10,%rax
+	movb	%bl,%dl
+	shrq	$4,%rbx
+	movq	%r9,%r10
+	shrq	$4,%r9
+	movq	%r8,64(%rbp)
+	movq	160+0-128(%rsi),%r8
+	shlb	$4,%dl
+	movq	%rax,64-128(%rbp)
+	movq	160+8-128(%rsi),%rax
+	shlq	$60,%r10
+	movb	%dl,9(%rsp)
+	orq	%r10,%rbx
+	movb	%al,%dl
+	shrq	$4,%rax
+	movq	%r8,%r10
+	shrq	$4,%r8
+	movq	%r9,72(%rbp)
+	movq	176+0-128(%rsi),%r9
+	shlb	$4,%dl
+	movq	%rbx,72-128(%rbp)
+	movq	176+8-128(%rsi),%rbx
+	shlq	$60,%r10
+	movb	%dl,10(%rsp)
+	orq	%r10,%rax
+	movb	%bl,%dl
+	shrq	$4,%rbx
+	movq	%r9,%r10
+	shrq	$4,%r9
+	movq	%r8,80(%rbp)
+	movq	192+0-128(%rsi),%r8
+	shlb	$4,%dl
+	movq	%rax,80-128(%rbp)
+	movq	192+8-128(%rsi),%rax
+	shlq	$60,%r10
+	movb	%dl,11(%rsp)
+	orq	%r10,%rbx
+	movb	%al,%dl
+	shrq	$4,%rax
+	movq	%r8,%r10
+	shrq	$4,%r8
+	movq	%r9,88(%rbp)
+	movq	208+0-128(%rsi),%r9
+	shlb	$4,%dl
+	movq	%rbx,88-128(%rbp)
+	movq	208+8-128(%rsi),%rbx
+	shlq	$60,%r10
+	movb	%dl,12(%rsp)
+	orq	%r10,%rax
+	movb	%bl,%dl
+	shrq	$4,%rbx
+	movq	%r9,%r10
+	shrq	$4,%r9
+	movq	%r8,96(%rbp)
+	movq	224+0-128(%rsi),%r8
+	shlb	$4,%dl
+	movq	%rax,96-128(%rbp)
+	movq	224+8-128(%rsi),%rax
+	shlq	$60,%r10
+	movb	%dl,13(%rsp)
+	orq	%r10,%rbx
+	movb	%al,%dl
+	shrq	$4,%rax
+	movq	%r8,%r10
+	shrq	$4,%r8
+	movq	%r9,104(%rbp)
+	movq	240+0-128(%rsi),%r9
+	shlb	$4,%dl
+	movq	%rbx,104-128(%rbp)
+	movq	240+8-128(%rsi),%rbx
+	shlq	$60,%r10
+	movb	%dl,14(%rsp)
+	orq	%r10,%rax
+	movb	%bl,%dl
+	shrq	$4,%rbx
+	movq	%r9,%r10
+	shrq	$4,%r9
+	movq	%r8,112(%rbp)
+	shlb	$4,%dl
+	movq	%rax,112-128(%rbp)
+	shlq	$60,%r10
+	movb	%dl,15(%rsp)
+	orq	%r10,%rbx
+	movq	%r9,120(%rbp)
+	movq	%rbx,120-128(%rbp)
+	addq	$-128,%rsi
+	movq	8(%rdi),%r8
+	movq	0(%rdi),%r9
+	addq	%r14,%r15
+	leaq	L$rem_8bit(%rip),%r11
+	jmp	L$outer_loop
+.p2align	4
+L$outer_loop:
+	xorq	(%r14),%r9
+	movq	8(%r14),%rdx
+	leaq	16(%r14),%r14
+	xorq	%r8,%rdx
+	movq	%r9,(%rdi)
+	movq	%rdx,8(%rdi)
+	shrq	$32,%rdx
+	xorq	%rax,%rax
+	roll	$8,%edx
+	movb	%dl,%al
+	movzbl	%dl,%ebx
+	shlb	$4,%al
+	shrl	$4,%ebx
+	roll	$8,%edx
+	movq	8(%rsi,%rax,1),%r8
+	movq	(%rsi,%rax,1),%r9
+	movb	%dl,%al
+	movzbl	%dl,%ecx
+	shlb	$4,%al
+	movzbq	(%rsp,%rbx,1),%r12
+	shrl	$4,%ecx
+	xorq	%r8,%r12
+	movq	%r9,%r10
+	shrq	$8,%r8
+	movzbq	%r12b,%r12
+	shrq	$8,%r9
+	xorq	-128(%rbp,%rbx,8),%r8
+	shlq	$56,%r10
+	xorq	(%rbp,%rbx,8),%r9
+	roll	$8,%edx
+	xorq	8(%rsi,%rax,1),%r8
+	xorq	(%rsi,%rax,1),%r9
+	movb	%dl,%al
+	xorq	%r10,%r8
+	movzwq	(%r11,%r12,2),%r12
+	movzbl	%dl,%ebx
+	shlb	$4,%al
+	movzbq	(%rsp,%rcx,1),%r13
+	shrl	$4,%ebx
+	shlq	$48,%r12
+	xorq	%r8,%r13
+	movq	%r9,%r10
+	xorq	%r12,%r9
+	shrq	$8,%r8
+	movzbq	%r13b,%r13
+	shrq	$8,%r9
+	xorq	-128(%rbp,%rcx,8),%r8
+	shlq	$56,%r10
+	xorq	(%rbp,%rcx,8),%r9
+	roll	$8,%edx
+	xorq	8(%rsi,%rax,1),%r8
+	xorq	(%rsi,%rax,1),%r9
+	movb	%dl,%al
+	xorq	%r10,%r8
+	movzwq	(%r11,%r13,2),%r13
+	movzbl	%dl,%ecx
+	shlb	$4,%al
+	movzbq	(%rsp,%rbx,1),%r12
+	shrl	$4,%ecx
+	shlq	$48,%r13
+	xorq	%r8,%r12
+	movq	%r9,%r10
+	xorq	%r13,%r9
+	shrq	$8,%r8
+	movzbq	%r12b,%r12
+	movl	8(%rdi),%edx
+	shrq	$8,%r9
+	xorq	-128(%rbp,%rbx,8),%r8
+	shlq	$56,%r10
+	xorq	(%rbp,%rbx,8),%r9
+	roll	$8,%edx
+	xorq	8(%rsi,%rax,1),%r8
+	xorq	(%rsi,%rax,1),%r9
+	movb	%dl,%al
+	xorq	%r10,%r8
+	movzwq	(%r11,%r12,2),%r12
+	movzbl	%dl,%ebx
+	shlb	$4,%al
+	movzbq	(%rsp,%rcx,1),%r13
+	shrl	$4,%ebx
+	shlq	$48,%r12
+	xorq	%r8,%r13
+	movq	%r9,%r10
+	xorq	%r12,%r9
+	shrq	$8,%r8
+	movzbq	%r13b,%r13
+	shrq	$8,%r9
+	xorq	-128(%rbp,%rcx,8),%r8
+	shlq	$56,%r10
+	xorq	(%rbp,%rcx,8),%r9
+	roll	$8,%edx
+	xorq	8(%rsi,%rax,1),%r8
+	xorq	(%rsi,%rax,1),%r9
+	movb	%dl,%al
+	xorq	%r10,%r8
+	movzwq	(%r11,%r13,2),%r13
+	movzbl	%dl,%ecx
+	shlb	$4,%al
+	movzbq	(%rsp,%rbx,1),%r12
+	shrl	$4,%ecx
+	shlq	$48,%r13
+	xorq	%r8,%r12
+	movq	%r9,%r10
+	xorq	%r13,%r9
+	shrq	$8,%r8
+	movzbq	%r12b,%r12
+	shrq	$8,%r9
+	xorq	-128(%rbp,%rbx,8),%r8
+	shlq	$56,%r10
+	xorq	(%rbp,%rbx,8),%r9
+	roll	$8,%edx
+	xorq	8(%rsi,%rax,1),%r8
+	xorq	(%rsi,%rax,1),%r9
+	movb	%dl,%al
+	xorq	%r10,%r8
+	movzwq	(%r11,%r12,2),%r12
+	movzbl	%dl,%ebx
+	shlb	$4,%al
+	movzbq	(%rsp,%rcx,1),%r13
+	shrl	$4,%ebx
+	shlq	$48,%r12
+	xorq	%r8,%r13
+	movq	%r9,%r10
+	xorq	%r12,%r9
+	shrq	$8,%r8
+	movzbq	%r13b,%r13
+	shrq	$8,%r9
+	xorq	-128(%rbp,%rcx,8),%r8
+	shlq	$56,%r10
+	xorq	(%rbp,%rcx,8),%r9
+	roll	$8,%edx
+	xorq	8(%rsi,%rax,1),%r8
+	xorq	(%rsi,%rax,1),%r9
+	movb	%dl,%al
+	xorq	%r10,%r8
+	movzwq	(%r11,%r13,2),%r13
+	movzbl	%dl,%ecx
+	shlb	$4,%al
+	movzbq	(%rsp,%rbx,1),%r12
+	shrl	$4,%ecx
+	shlq	$48,%r13
+	xorq	%r8,%r12
+	movq	%r9,%r10
+	xorq	%r13,%r9
+	shrq	$8,%r8
+	movzbq	%r12b,%r12
+	movl	4(%rdi),%edx
+	shrq	$8,%r9
+	xorq	-128(%rbp,%rbx,8),%r8
+	shlq	$56,%r10
+	xorq	(%rbp,%rbx,8),%r9
+	roll	$8,%edx
+	xorq	8(%rsi,%rax,1),%r8
+	xorq	(%rsi,%rax,1),%r9
+	movb	%dl,%al
+	xorq	%r10,%r8
+	movzwq	(%r11,%r12,2),%r12
+	movzbl	%dl,%ebx
+	shlb	$4,%al
+	movzbq	(%rsp,%rcx,1),%r13
+	shrl	$4,%ebx
+	shlq	$48,%r12
+	xorq	%r8,%r13
+	movq	%r9,%r10
+	xorq	%r12,%r9
+	shrq	$8,%r8
+	movzbq	%r13b,%r13
+	shrq	$8,%r9
+	xorq	-128(%rbp,%rcx,8),%r8
+	shlq	$56,%r10
+	xorq	(%rbp,%rcx,8),%r9
+	roll	$8,%edx
+	xorq	8(%rsi,%rax,1),%r8
+	xorq	(%rsi,%rax,1),%r9
+	movb	%dl,%al
+	xorq	%r10,%r8
+	movzwq	(%r11,%r13,2),%r13
+	movzbl	%dl,%ecx
+	shlb	$4,%al
+	movzbq	(%rsp,%rbx,1),%r12
+	shrl	$4,%ecx
+	shlq	$48,%r13
+	xorq	%r8,%r12
+	movq	%r9,%r10
+	xorq	%r13,%r9
+	shrq	$8,%r8
+	movzbq	%r12b,%r12
+	shrq	$8,%r9
+	xorq	-128(%rbp,%rbx,8),%r8
+	shlq	$56,%r10
+	xorq	(%rbp,%rbx,8),%r9
+	roll	$8,%edx
+	xorq	8(%rsi,%rax,1),%r8
+	xorq	(%rsi,%rax,1),%r9
+	movb	%dl,%al
+	xorq	%r10,%r8
+	movzwq	(%r11,%r12,2),%r12
+	movzbl	%dl,%ebx
+	shlb	$4,%al
+	movzbq	(%rsp,%rcx,1),%r13
+	shrl	$4,%ebx
+	shlq	$48,%r12
+	xorq	%r8,%r13
+	movq	%r9,%r10
+	xorq	%r12,%r9
+	shrq	$8,%r8
+	movzbq	%r13b,%r13
+	shrq	$8,%r9
+	xorq	-128(%rbp,%rcx,8),%r8
+	shlq	$56,%r10
+	xorq	(%rbp,%rcx,8),%r9
+	roll	$8,%edx
+	xorq	8(%rsi,%rax,1),%r8
+	xorq	(%rsi,%rax,1),%r9
+	movb	%dl,%al
+	xorq	%r10,%r8
+	movzwq	(%r11,%r13,2),%r13
+	movzbl	%dl,%ecx
+	shlb	$4,%al
+	movzbq	(%rsp,%rbx,1),%r12
+	shrl	$4,%ecx
+	shlq	$48,%r13
+	xorq	%r8,%r12
+	movq	%r9,%r10
+	xorq	%r13,%r9
+	shrq	$8,%r8
+	movzbq	%r12b,%r12
+	movl	0(%rdi),%edx
+	shrq	$8,%r9
+	xorq	-128(%rbp,%rbx,8),%r8
+	shlq	$56,%r10
+	xorq	(%rbp,%rbx,8),%r9
+	roll	$8,%edx
+	xorq	8(%rsi,%rax,1),%r8
+	xorq	(%rsi,%rax,1),%r9
+	movb	%dl,%al
+	xorq	%r10,%r8
+	movzwq	(%r11,%r12,2),%r12
+	movzbl	%dl,%ebx
+	shlb	$4,%al
+	movzbq	(%rsp,%rcx,1),%r13
+	shrl	$4,%ebx
+	shlq	$48,%r12
+	xorq	%r8,%r13
+	movq	%r9,%r10
+	xorq	%r12,%r9
+	shrq	$8,%r8
+	movzbq	%r13b,%r13
+	shrq	$8,%r9
+	xorq	-128(%rbp,%rcx,8),%r8
+	shlq	$56,%r10
+	xorq	(%rbp,%rcx,8),%r9
+	roll	$8,%edx
+	xorq	8(%rsi,%rax,1),%r8
+	xorq	(%rsi,%rax,1),%r9
+	movb	%dl,%al
+	xorq	%r10,%r8
+	movzwq	(%r11,%r13,2),%r13
+	movzbl	%dl,%ecx
+	shlb	$4,%al
+	movzbq	(%rsp,%rbx,1),%r12
+	shrl	$4,%ecx
+	shlq	$48,%r13
+	xorq	%r8,%r12
+	movq	%r9,%r10
+	xorq	%r13,%r9
+	shrq	$8,%r8
+	movzbq	%r12b,%r12
+	shrq	$8,%r9
+	xorq	-128(%rbp,%rbx,8),%r8
+	shlq	$56,%r10
+	xorq	(%rbp,%rbx,8),%r9
+	roll	$8,%edx
+	xorq	8(%rsi,%rax,1),%r8
+	xorq	(%rsi,%rax,1),%r9
+	movb	%dl,%al
+	xorq	%r10,%r8
+	movzwq	(%r11,%r12,2),%r12
+	movzbl	%dl,%ebx
+	shlb	$4,%al
+	movzbq	(%rsp,%rcx,1),%r13
+	shrl	$4,%ebx
+	shlq	$48,%r12
+	xorq	%r8,%r13
+	movq	%r9,%r10
+	xorq	%r12,%r9
+	shrq	$8,%r8
+	movzbq	%r13b,%r13
+	shrq	$8,%r9
+	xorq	-128(%rbp,%rcx,8),%r8
+	shlq	$56,%r10
+	xorq	(%rbp,%rcx,8),%r9
+	roll	$8,%edx
+	xorq	8(%rsi,%rax,1),%r8
+	xorq	(%rsi,%rax,1),%r9
+	movb	%dl,%al
+	xorq	%r10,%r8
+	movzwq	(%r11,%r13,2),%r13
+	movzbl	%dl,%ecx
+	shlb	$4,%al
+	movzbq	(%rsp,%rbx,1),%r12
+	andl	$240,%ecx
+	shlq	$48,%r13
+	xorq	%r8,%r12
+	movq	%r9,%r10
+	xorq	%r13,%r9
+	shrq	$8,%r8
+	movzbq	%r12b,%r12
+	movl	-4(%rdi),%edx
+	shrq	$8,%r9
+	xorq	-128(%rbp,%rbx,8),%r8
+	shlq	$56,%r10
+	xorq	(%rbp,%rbx,8),%r9
+	movzwq	(%r11,%r12,2),%r12
+	xorq	8(%rsi,%rax,1),%r8
+	xorq	(%rsi,%rax,1),%r9
+	shlq	$48,%r12
+	xorq	%r10,%r8
+	xorq	%r12,%r9
+	movzbq	%r8b,%r13
+	shrq	$4,%r8
+	movq	%r9,%r10
+	shlb	$4,%r13b
+	shrq	$4,%r9
+	xorq	8(%rsi,%rcx,1),%r8
+	movzwq	(%r11,%r13,2),%r13
+	shlq	$60,%r10
+	xorq	(%rsi,%rcx,1),%r9
+	xorq	%r10,%r8
+	shlq	$48,%r13
+	bswapq	%r8
+	xorq	%r13,%r9
+	bswapq	%r9
+	cmpq	%r15,%r14
+	jb	L$outer_loop
+	movq	%r8,8(%rdi)
+	movq	%r9,(%rdi)
+
+	leaq	280(%rsp),%rsi
+	movq	0(%rsi),%r15
+	movq	8(%rsi),%r14
+	movq	16(%rsi),%r13
+	movq	24(%rsi),%r12
+	movq	32(%rsi),%rbp
+	movq	40(%rsi),%rbx
+	leaq	48(%rsi),%rsp
+L$ghash_epilogue:
+	.byte	0xf3,0xc3
+
+.globl	_gcm_init_clmul
+.private_extern _gcm_init_clmul
+
+.p2align	4
+_gcm_init_clmul:
+L$_init_clmul:
+	movdqu	(%rsi),%xmm2
+	pshufd	$78,%xmm2,%xmm2
+
+
+	pshufd	$255,%xmm2,%xmm4
+	movdqa	%xmm2,%xmm3
+	psllq	$1,%xmm2
+	pxor	%xmm5,%xmm5
+	psrlq	$63,%xmm3
+	pcmpgtd	%xmm4,%xmm5
+	pslldq	$8,%xmm3
+	por	%xmm3,%xmm2
+
+
+	pand	L$0x1c2_polynomial(%rip),%xmm5
+	pxor	%xmm5,%xmm2
+
+
+	pshufd	$78,%xmm2,%xmm6
+	movdqa	%xmm2,%xmm0
+	pxor	%xmm2,%xmm6
+	movdqa	%xmm0,%xmm1
+	pshufd	$78,%xmm0,%xmm3
+	pxor	%xmm0,%xmm3
+.byte	102,15,58,68,194,0
+.byte	102,15,58,68,202,17
+.byte	102,15,58,68,222,0
+	pxor	%xmm0,%xmm3
+	pxor	%xmm1,%xmm3
+
+	movdqa	%xmm3,%xmm4
+	psrldq	$8,%xmm3
+	pslldq	$8,%xmm4
+	pxor	%xmm3,%xmm1
+	pxor	%xmm4,%xmm0
+
+	movdqa	%xmm0,%xmm4
+	movdqa	%xmm0,%xmm3
+	psllq	$5,%xmm0
+	pxor	%xmm0,%xmm3
+	psllq	$1,%xmm0
+	pxor	%xmm3,%xmm0
+	psllq	$57,%xmm0
+	movdqa	%xmm0,%xmm3
+	pslldq	$8,%xmm0
+	psrldq	$8,%xmm3
+	pxor	%xmm4,%xmm0
+	pxor	%xmm3,%xmm1
+
+
+	movdqa	%xmm0,%xmm4
+	psrlq	$1,%xmm0
+	pxor	%xmm4,%xmm1
+	pxor	%xmm0,%xmm4
+	psrlq	$5,%xmm0
+	pxor	%xmm4,%xmm0
+	psrlq	$1,%xmm0
+	pxor	%xmm1,%xmm0
+	pshufd	$78,%xmm2,%xmm3
+	pshufd	$78,%xmm0,%xmm4
+	pxor	%xmm2,%xmm3
+	movdqu	%xmm2,0(%rdi)
+	pxor	%xmm0,%xmm4
+	movdqu	%xmm0,16(%rdi)
+.byte	102,15,58,15,227,8
+	movdqu	%xmm4,32(%rdi)
+	movdqa	%xmm0,%xmm1
+	pshufd	$78,%xmm0,%xmm3
+	pxor	%xmm0,%xmm3
+.byte	102,15,58,68,194,0
+.byte	102,15,58,68,202,17
+.byte	102,15,58,68,222,0
+	pxor	%xmm0,%xmm3
+	pxor	%xmm1,%xmm3
+
+	movdqa	%xmm3,%xmm4
+	psrldq	$8,%xmm3
+	pslldq	$8,%xmm4
+	pxor	%xmm3,%xmm1
+	pxor	%xmm4,%xmm0
+
+	movdqa	%xmm0,%xmm4
+	movdqa	%xmm0,%xmm3
+	psllq	$5,%xmm0
+	pxor	%xmm0,%xmm3
+	psllq	$1,%xmm0
+	pxor	%xmm3,%xmm0
+	psllq	$57,%xmm0
+	movdqa	%xmm0,%xmm3
+	pslldq	$8,%xmm0
+	psrldq	$8,%xmm3
+	pxor	%xmm4,%xmm0
+	pxor	%xmm3,%xmm1
+
+
+	movdqa	%xmm0,%xmm4
+	psrlq	$1,%xmm0
+	pxor	%xmm4,%xmm1
+	pxor	%xmm0,%xmm4
+	psrlq	$5,%xmm0
+	pxor	%xmm4,%xmm0
+	psrlq	$1,%xmm0
+	pxor	%xmm1,%xmm0
+	movdqa	%xmm0,%xmm5
+	movdqa	%xmm0,%xmm1
+	pshufd	$78,%xmm0,%xmm3
+	pxor	%xmm0,%xmm3
+.byte	102,15,58,68,194,0
+.byte	102,15,58,68,202,17
+.byte	102,15,58,68,222,0
+	pxor	%xmm0,%xmm3
+	pxor	%xmm1,%xmm3
+
+	movdqa	%xmm3,%xmm4
+	psrldq	$8,%xmm3
+	pslldq	$8,%xmm4
+	pxor	%xmm3,%xmm1
+	pxor	%xmm4,%xmm0
+
+	movdqa	%xmm0,%xmm4
+	movdqa	%xmm0,%xmm3
+	psllq	$5,%xmm0
+	pxor	%xmm0,%xmm3
+	psllq	$1,%xmm0
+	pxor	%xmm3,%xmm0
+	psllq	$57,%xmm0
+	movdqa	%xmm0,%xmm3
+	pslldq	$8,%xmm0
+	psrldq	$8,%xmm3
+	pxor	%xmm4,%xmm0
+	pxor	%xmm3,%xmm1
+
+
+	movdqa	%xmm0,%xmm4
+	psrlq	$1,%xmm0
+	pxor	%xmm4,%xmm1
+	pxor	%xmm0,%xmm4
+	psrlq	$5,%xmm0
+	pxor	%xmm4,%xmm0
+	psrlq	$1,%xmm0
+	pxor	%xmm1,%xmm0
+	pshufd	$78,%xmm5,%xmm3
+	pshufd	$78,%xmm0,%xmm4
+	pxor	%xmm5,%xmm3
+	movdqu	%xmm5,48(%rdi)
+	pxor	%xmm0,%xmm4
+	movdqu	%xmm0,64(%rdi)
+.byte	102,15,58,15,227,8
+	movdqu	%xmm4,80(%rdi)
+	.byte	0xf3,0xc3
+
+.globl	_gcm_gmult_clmul
+.private_extern _gcm_gmult_clmul
+
+.p2align	4
+_gcm_gmult_clmul:
+L$_gmult_clmul:
+	movdqu	(%rdi),%xmm0
+	movdqa	L$bswap_mask(%rip),%xmm5
+	movdqu	(%rsi),%xmm2
+	movdqu	32(%rsi),%xmm4
+.byte	102,15,56,0,197
+	movdqa	%xmm0,%xmm1
+	pshufd	$78,%xmm0,%xmm3
+	pxor	%xmm0,%xmm3
+.byte	102,15,58,68,194,0
+.byte	102,15,58,68,202,17
+.byte	102,15,58,68,220,0
+	pxor	%xmm0,%xmm3
+	pxor	%xmm1,%xmm3
+
+	movdqa	%xmm3,%xmm4
+	psrldq	$8,%xmm3
+	pslldq	$8,%xmm4
+	pxor	%xmm3,%xmm1
+	pxor	%xmm4,%xmm0
+
+	movdqa	%xmm0,%xmm4
+	movdqa	%xmm0,%xmm3
+	psllq	$5,%xmm0
+	pxor	%xmm0,%xmm3
+	psllq	$1,%xmm0
+	pxor	%xmm3,%xmm0
+	psllq	$57,%xmm0
+	movdqa	%xmm0,%xmm3
+	pslldq	$8,%xmm0
+	psrldq	$8,%xmm3
+	pxor	%xmm4,%xmm0
+	pxor	%xmm3,%xmm1
+
+
+	movdqa	%xmm0,%xmm4
+	psrlq	$1,%xmm0
+	pxor	%xmm4,%xmm1
+	pxor	%xmm0,%xmm4
+	psrlq	$5,%xmm0
+	pxor	%xmm4,%xmm0
+	psrlq	$1,%xmm0
+	pxor	%xmm1,%xmm0
+.byte	102,15,56,0,197
+	movdqu	%xmm0,(%rdi)
+	.byte	0xf3,0xc3
+
+.globl	_gcm_ghash_clmul
+.private_extern _gcm_ghash_clmul
+
+.p2align	5
+_gcm_ghash_clmul:
+L$_ghash_clmul:
+	movdqa	L$bswap_mask(%rip),%xmm10
+
+	movdqu	(%rdi),%xmm0
+	movdqu	(%rsi),%xmm2
+	movdqu	32(%rsi),%xmm7
+.byte	102,65,15,56,0,194
+
+	subq	$16,%rcx
+	jz	L$odd_tail
+
+	movdqu	16(%rsi),%xmm6
+	movl	_OPENSSL_ia32cap_P+4(%rip),%eax
+	cmpq	$48,%rcx
+	jb	L$skip4x
+
+	andl	$71303168,%eax
+	cmpl	$4194304,%eax
+	je	L$skip4x
+
+	subq	$48,%rcx
+	movq	$11547335547999543296,%rax
+	movdqu	48(%rsi),%xmm14
+	movdqu	64(%rsi),%xmm15
+
+
+
+
+	movdqu	48(%rdx),%xmm3
+	movdqu	32(%rdx),%xmm11
+.byte	102,65,15,56,0,218
+.byte	102,69,15,56,0,218
+	movdqa	%xmm3,%xmm5
+	pshufd	$78,%xmm3,%xmm4
+	pxor	%xmm3,%xmm4
+.byte	102,15,58,68,218,0
+.byte	102,15,58,68,234,17
+.byte	102,15,58,68,231,0
+
+	movdqa	%xmm11,%xmm13
+	pshufd	$78,%xmm11,%xmm12
+	pxor	%xmm11,%xmm12
+.byte	102,68,15,58,68,222,0
+.byte	102,68,15,58,68,238,17
+.byte	102,68,15,58,68,231,16
+	xorps	%xmm11,%xmm3
+	xorps	%xmm13,%xmm5
+	movups	80(%rsi),%xmm7
+	xorps	%xmm12,%xmm4
+
+	movdqu	16(%rdx),%xmm11
+	movdqu	0(%rdx),%xmm8
+.byte	102,69,15,56,0,218
+.byte	102,69,15,56,0,194
+	movdqa	%xmm11,%xmm13
+	pshufd	$78,%xmm11,%xmm12
+	pxor	%xmm8,%xmm0
+	pxor	%xmm11,%xmm12
+.byte	102,69,15,58,68,222,0
+	movdqa	%xmm0,%xmm1
+	pshufd	$78,%xmm0,%xmm8
+	pxor	%xmm0,%xmm8
+.byte	102,69,15,58,68,238,17
+.byte	102,68,15,58,68,231,0
+	xorps	%xmm11,%xmm3
+	xorps	%xmm13,%xmm5
+
+	leaq	64(%rdx),%rdx
+	subq	$64,%rcx
+	jc	L$tail4x
+
+	jmp	L$mod4_loop
+.p2align	5
+L$mod4_loop:
+.byte	102,65,15,58,68,199,0
+	xorps	%xmm12,%xmm4
+	movdqu	48(%rdx),%xmm11
+.byte	102,69,15,56,0,218
+.byte	102,65,15,58,68,207,17
+	xorps	%xmm3,%xmm0
+	movdqu	32(%rdx),%xmm3
+	movdqa	%xmm11,%xmm13
+.byte	102,68,15,58,68,199,16
+	pshufd	$78,%xmm11,%xmm12
+	xorps	%xmm5,%xmm1
+	pxor	%xmm11,%xmm12
+.byte	102,65,15,56,0,218
+	movups	32(%rsi),%xmm7
+	xorps	%xmm4,%xmm8
+.byte	102,68,15,58,68,218,0
+	pshufd	$78,%xmm3,%xmm4
+
+	pxor	%xmm0,%xmm8
+	movdqa	%xmm3,%xmm5
+	pxor	%xmm1,%xmm8
+	pxor	%xmm3,%xmm4
+	movdqa	%xmm8,%xmm9
+.byte	102,68,15,58,68,234,17
+	pslldq	$8,%xmm8
+	psrldq	$8,%xmm9
+	pxor	%xmm8,%xmm0
+	movdqa	L$7_mask(%rip),%xmm8
+	pxor	%xmm9,%xmm1
+.byte	102,76,15,110,200
+
+	pand	%xmm0,%xmm8
+.byte	102,69,15,56,0,200
+	pxor	%xmm0,%xmm9
+.byte	102,68,15,58,68,231,0
+	psllq	$57,%xmm9
+	movdqa	%xmm9,%xmm8
+	pslldq	$8,%xmm9
+.byte	102,15,58,68,222,0
+	psrldq	$8,%xmm8
+	pxor	%xmm9,%xmm0
+	pxor	%xmm8,%xmm1
+	movdqu	0(%rdx),%xmm8
+
+	movdqa	%xmm0,%xmm9
+	psrlq	$1,%xmm0
+.byte	102,15,58,68,238,17
+	xorps	%xmm11,%xmm3
+	movdqu	16(%rdx),%xmm11
+.byte	102,69,15,56,0,218
+.byte	102,15,58,68,231,16
+	xorps	%xmm13,%xmm5
+	movups	80(%rsi),%xmm7
+.byte	102,69,15,56,0,194
+	pxor	%xmm9,%xmm1
+	pxor	%xmm0,%xmm9
+	psrlq	$5,%xmm0
+
+	movdqa	%xmm11,%xmm13
+	pxor	%xmm12,%xmm4
+	pshufd	$78,%xmm11,%xmm12
+	pxor	%xmm9,%xmm0
+	pxor	%xmm8,%xmm1
+	pxor	%xmm11,%xmm12
+.byte	102,69,15,58,68,222,0
+	psrlq	$1,%xmm0
+	pxor	%xmm1,%xmm0
+	movdqa	%xmm0,%xmm1
+.byte	102,69,15,58,68,238,17
+	xorps	%xmm11,%xmm3
+	pshufd	$78,%xmm0,%xmm8
+	pxor	%xmm0,%xmm8
+
+.byte	102,68,15,58,68,231,0
+	xorps	%xmm13,%xmm5
+
+	leaq	64(%rdx),%rdx
+	subq	$64,%rcx
+	jnc	L$mod4_loop
+
+L$tail4x:
+.byte	102,65,15,58,68,199,0
+.byte	102,65,15,58,68,207,17
+.byte	102,68,15,58,68,199,16
+	xorps	%xmm12,%xmm4
+	xorps	%xmm3,%xmm0
+	xorps	%xmm5,%xmm1
+	pxor	%xmm0,%xmm1
+	pxor	%xmm4,%xmm8
+
+	pxor	%xmm1,%xmm8
+	pxor	%xmm0,%xmm1
+
+	movdqa	%xmm8,%xmm9
+	psrldq	$8,%xmm8
+	pslldq	$8,%xmm9
+	pxor	%xmm8,%xmm1
+	pxor	%xmm9,%xmm0
+
+	movdqa	%xmm0,%xmm4
+	movdqa	%xmm0,%xmm3
+	psllq	$5,%xmm0
+	pxor	%xmm0,%xmm3
+	psllq	$1,%xmm0
+	pxor	%xmm3,%xmm0
+	psllq	$57,%xmm0
+	movdqa	%xmm0,%xmm3
+	pslldq	$8,%xmm0
+	psrldq	$8,%xmm3
+	pxor	%xmm4,%xmm0
+	pxor	%xmm3,%xmm1
+
+
+	movdqa	%xmm0,%xmm4
+	psrlq	$1,%xmm0
+	pxor	%xmm4,%xmm1
+	pxor	%xmm0,%xmm4
+	psrlq	$5,%xmm0
+	pxor	%xmm4,%xmm0
+	psrlq	$1,%xmm0
+	pxor	%xmm1,%xmm0
+	addq	$64,%rcx
+	jz	L$done
+	movdqu	32(%rsi),%xmm7
+	subq	$16,%rcx
+	jz	L$odd_tail
+L$skip4x:
+
+
+
+
+
+	movdqu	(%rdx),%xmm8
+	movdqu	16(%rdx),%xmm3
+.byte	102,69,15,56,0,194
+.byte	102,65,15,56,0,218
+	pxor	%xmm8,%xmm0
+
+	movdqa	%xmm3,%xmm5
+	pshufd	$78,%xmm3,%xmm4
+	pxor	%xmm3,%xmm4
+.byte	102,15,58,68,218,0
+.byte	102,15,58,68,234,17
+.byte	102,15,58,68,231,0
+
+	leaq	32(%rdx),%rdx
+	nop
+	subq	$32,%rcx
+	jbe	L$even_tail
+	nop
+	jmp	L$mod_loop
+
+.p2align	5
+L$mod_loop:
+	movdqa	%xmm0,%xmm1
+	movdqa	%xmm4,%xmm8
+	pshufd	$78,%xmm0,%xmm4
+	pxor	%xmm0,%xmm4
+
+.byte	102,15,58,68,198,0
+.byte	102,15,58,68,206,17
+.byte	102,15,58,68,231,16
+
+	pxor	%xmm3,%xmm0
+	pxor	%xmm5,%xmm1
+	movdqu	(%rdx),%xmm9
+	pxor	%xmm0,%xmm8
+.byte	102,69,15,56,0,202
+	movdqu	16(%rdx),%xmm3
+
+	pxor	%xmm1,%xmm8
+	pxor	%xmm9,%xmm1
+	pxor	%xmm8,%xmm4
+.byte	102,65,15,56,0,218
+	movdqa	%xmm4,%xmm8
+	psrldq	$8,%xmm8
+	pslldq	$8,%xmm4
+	pxor	%xmm8,%xmm1
+	pxor	%xmm4,%xmm0
+
+	movdqa	%xmm3,%xmm5
+
+	movdqa	%xmm0,%xmm9
+	movdqa	%xmm0,%xmm8
+	psllq	$5,%xmm0
+	pxor	%xmm0,%xmm8
+.byte	102,15,58,68,218,0
+	psllq	$1,%xmm0
+	pxor	%xmm8,%xmm0
+	psllq	$57,%xmm0
+	movdqa	%xmm0,%xmm8
+	pslldq	$8,%xmm0
+	psrldq	$8,%xmm8
+	pxor	%xmm9,%xmm0
+	pshufd	$78,%xmm5,%xmm4
+	pxor	%xmm8,%xmm1
+	pxor	%xmm5,%xmm4
+
+	movdqa	%xmm0,%xmm9
+	psrlq	$1,%xmm0
+.byte	102,15,58,68,234,17
+	pxor	%xmm9,%xmm1
+	pxor	%xmm0,%xmm9
+	psrlq	$5,%xmm0
+	pxor	%xmm9,%xmm0
+	leaq	32(%rdx),%rdx
+	psrlq	$1,%xmm0
+.byte	102,15,58,68,231,0
+	pxor	%xmm1,%xmm0
+
+	subq	$32,%rcx
+	ja	L$mod_loop
+
+L$even_tail:
+	movdqa	%xmm0,%xmm1
+	movdqa	%xmm4,%xmm8
+	pshufd	$78,%xmm0,%xmm4
+	pxor	%xmm0,%xmm4
+
+.byte	102,15,58,68,198,0
+.byte	102,15,58,68,206,17
+.byte	102,15,58,68,231,16
+
+	pxor	%xmm3,%xmm0
+	pxor	%xmm5,%xmm1
+	pxor	%xmm0,%xmm8
+	pxor	%xmm1,%xmm8
+	pxor	%xmm8,%xmm4
+	movdqa	%xmm4,%xmm8
+	psrldq	$8,%xmm8
+	pslldq	$8,%xmm4
+	pxor	%xmm8,%xmm1
+	pxor	%xmm4,%xmm0
+
+	movdqa	%xmm0,%xmm4
+	movdqa	%xmm0,%xmm3
+	psllq	$5,%xmm0
+	pxor	%xmm0,%xmm3
+	psllq	$1,%xmm0
+	pxor	%xmm3,%xmm0
+	psllq	$57,%xmm0
+	movdqa	%xmm0,%xmm3
+	pslldq	$8,%xmm0
+	psrldq	$8,%xmm3
+	pxor	%xmm4,%xmm0
+	pxor	%xmm3,%xmm1
+
+
+	movdqa	%xmm0,%xmm4
+	psrlq	$1,%xmm0
+	pxor	%xmm4,%xmm1
+	pxor	%xmm0,%xmm4
+	psrlq	$5,%xmm0
+	pxor	%xmm4,%xmm0
+	psrlq	$1,%xmm0
+	pxor	%xmm1,%xmm0
+	testq	%rcx,%rcx
+	jnz	L$done
+
+L$odd_tail:
+	movdqu	(%rdx),%xmm8
+.byte	102,69,15,56,0,194
+	pxor	%xmm8,%xmm0
+	movdqa	%xmm0,%xmm1
+	pshufd	$78,%xmm0,%xmm3
+	pxor	%xmm0,%xmm3
+.byte	102,15,58,68,194,0
+.byte	102,15,58,68,202,17
+.byte	102,15,58,68,223,0
+	pxor	%xmm0,%xmm3
+	pxor	%xmm1,%xmm3
+
+	movdqa	%xmm3,%xmm4
+	psrldq	$8,%xmm3
+	pslldq	$8,%xmm4
+	pxor	%xmm3,%xmm1
+	pxor	%xmm4,%xmm0
+
+	movdqa	%xmm0,%xmm4
+	movdqa	%xmm0,%xmm3
+	psllq	$5,%xmm0
+	pxor	%xmm0,%xmm3
+	psllq	$1,%xmm0
+	pxor	%xmm3,%xmm0
+	psllq	$57,%xmm0
+	movdqa	%xmm0,%xmm3
+	pslldq	$8,%xmm0
+	psrldq	$8,%xmm3
+	pxor	%xmm4,%xmm0
+	pxor	%xmm3,%xmm1
+
+
+	movdqa	%xmm0,%xmm4
+	psrlq	$1,%xmm0
+	pxor	%xmm4,%xmm1
+	pxor	%xmm0,%xmm4
+	psrlq	$5,%xmm0
+	pxor	%xmm4,%xmm0
+	psrlq	$1,%xmm0
+	pxor	%xmm1,%xmm0
+L$done:
+.byte	102,65,15,56,0,194
+	movdqu	%xmm0,(%rdi)
+	.byte	0xf3,0xc3
+
+.globl	_gcm_init_avx
+.private_extern _gcm_init_avx
+
+.p2align	5
+_gcm_init_avx:
+	jmp	L$_init_clmul
+
+.globl	_gcm_gmult_avx
+.private_extern _gcm_gmult_avx
+
+.p2align	5
+_gcm_gmult_avx:
+	jmp	L$_gmult_clmul
+
+.globl	_gcm_ghash_avx
+.private_extern _gcm_ghash_avx
+
+.p2align	5
+_gcm_ghash_avx:
+	jmp	L$_ghash_clmul
+
+.p2align	6
+L$bswap_mask:
+.byte	15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0
+L$0x1c2_polynomial:
+.byte	1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0xc2
+L$7_mask:
+.long	7,0,7,0
+L$7_mask_poly:
+.long	7,0,450,0
+.p2align	6
+
+L$rem_4bit:
+.long	0,0,0,471859200,0,943718400,0,610271232
+.long	0,1887436800,0,1822425088,0,1220542464,0,1423966208
+.long	0,3774873600,0,4246732800,0,3644850176,0,3311403008
+.long	0,2441084928,0,2376073216,0,2847932416,0,3051356160
+
+L$rem_8bit:
+.value	0x0000,0x01C2,0x0384,0x0246,0x0708,0x06CA,0x048C,0x054E
+.value	0x0E10,0x0FD2,0x0D94,0x0C56,0x0918,0x08DA,0x0A9C,0x0B5E
+.value	0x1C20,0x1DE2,0x1FA4,0x1E66,0x1B28,0x1AEA,0x18AC,0x196E
+.value	0x1230,0x13F2,0x11B4,0x1076,0x1538,0x14FA,0x16BC,0x177E
+.value	0x3840,0x3982,0x3BC4,0x3A06,0x3F48,0x3E8A,0x3CCC,0x3D0E
+.value	0x3650,0x3792,0x35D4,0x3416,0x3158,0x309A,0x32DC,0x331E
+.value	0x2460,0x25A2,0x27E4,0x2626,0x2368,0x22AA,0x20EC,0x212E
+.value	0x2A70,0x2BB2,0x29F4,0x2836,0x2D78,0x2CBA,0x2EFC,0x2F3E
+.value	0x7080,0x7142,0x7304,0x72C6,0x7788,0x764A,0x740C,0x75CE
+.value	0x7E90,0x7F52,0x7D14,0x7CD6,0x7998,0x785A,0x7A1C,0x7BDE
+.value	0x6CA0,0x6D62,0x6F24,0x6EE6,0x6BA8,0x6A6A,0x682C,0x69EE
+.value	0x62B0,0x6372,0x6134,0x60F6,0x65B8,0x647A,0x663C,0x67FE
+.value	0x48C0,0x4902,0x4B44,0x4A86,0x4FC8,0x4E0A,0x4C4C,0x4D8E
+.value	0x46D0,0x4712,0x4554,0x4496,0x41D8,0x401A,0x425C,0x439E
+.value	0x54E0,0x5522,0x5764,0x56A6,0x53E8,0x522A,0x506C,0x51AE
+.value	0x5AF0,0x5B32,0x5974,0x58B6,0x5DF8,0x5C3A,0x5E7C,0x5FBE
+.value	0xE100,0xE0C2,0xE284,0xE346,0xE608,0xE7CA,0xE58C,0xE44E
+.value	0xEF10,0xEED2,0xEC94,0xED56,0xE818,0xE9DA,0xEB9C,0xEA5E
+.value	0xFD20,0xFCE2,0xFEA4,0xFF66,0xFA28,0xFBEA,0xF9AC,0xF86E
+.value	0xF330,0xF2F2,0xF0B4,0xF176,0xF438,0xF5FA,0xF7BC,0xF67E
+.value	0xD940,0xD882,0xDAC4,0xDB06,0xDE48,0xDF8A,0xDDCC,0xDC0E
+.value	0xD750,0xD692,0xD4D4,0xD516,0xD058,0xD19A,0xD3DC,0xD21E
+.value	0xC560,0xC4A2,0xC6E4,0xC726,0xC268,0xC3AA,0xC1EC,0xC02E
+.value	0xCB70,0xCAB2,0xC8F4,0xC936,0xCC78,0xCDBA,0xCFFC,0xCE3E
+.value	0x9180,0x9042,0x9204,0x93C6,0x9688,0x974A,0x950C,0x94CE
+.value	0x9F90,0x9E52,0x9C14,0x9DD6,0x9898,0x995A,0x9B1C,0x9ADE
+.value	0x8DA0,0x8C62,0x8E24,0x8FE6,0x8AA8,0x8B6A,0x892C,0x88EE
+.value	0x83B0,0x8272,0x8034,0x81F6,0x84B8,0x857A,0x873C,0x86FE
+.value	0xA9C0,0xA802,0xAA44,0xAB86,0xAEC8,0xAF0A,0xAD4C,0xAC8E
+.value	0xA7D0,0xA612,0xA454,0xA596,0xA0D8,0xA11A,0xA35C,0xA29E
+.value	0xB5E0,0xB422,0xB664,0xB7A6,0xB2E8,0xB32A,0xB16C,0xB0AE
+.value	0xBBF0,0xBA32,0xB874,0xB9B6,0xBCF8,0xBD3A,0xBF7C,0xBEBE
+
+.byte	71,72,65,83,72,32,102,111,114,32,120,56,54,95,54,52,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0
+.p2align	6
+#endif
diff --git a/third_party/boringssl/mac-x86_64/crypto/rand/rdrand-x86_64.S b/third_party/boringssl/mac-x86_64/crypto/rand/rdrand-x86_64.S
new file mode 100644
index 0000000..f0df296
--- /dev/null
+++ b/third_party/boringssl/mac-x86_64/crypto/rand/rdrand-x86_64.S
@@ -0,0 +1,48 @@
+#if defined(__x86_64__)
+.text	
+
+
+
+
+.globl	_CRYPTO_rdrand
+.private_extern _CRYPTO_rdrand
+
+.p2align	4
+_CRYPTO_rdrand:
+	xorq	%rax,%rax
+
+
+.byte	0x48, 0x0f, 0xc7, 0xf1
+
+	adcq	%rax,%rax
+	movq	%rcx,0(%rdi)
+	.byte	0xf3,0xc3
+
+
+
+
+
+.globl	_CRYPTO_rdrand_multiple8_buf
+.private_extern _CRYPTO_rdrand_multiple8_buf
+
+.p2align	4
+_CRYPTO_rdrand_multiple8_buf:
+	testq	%rsi,%rsi
+	jz	L$out
+	movq	$8,%rdx
+L$loop:
+
+
+.byte	0x48, 0x0f, 0xc7, 0xf1
+	jnc	L$err
+	movq	%rcx,0(%rdi)
+	addq	%rdx,%rdi
+	subq	%rdx,%rsi
+	jnz	L$loop
+L$out:
+	movq	$1,%rax
+	.byte	0xf3,0xc3
+L$err:
+	xorq	%rax,%rax
+	.byte	0xf3,0xc3
+#endif
diff --git a/third_party/boringssl/mac-x86_64/crypto/rc4/rc4-md5-x86_64.S b/third_party/boringssl/mac-x86_64/crypto/rc4/rc4-md5-x86_64.S
new file mode 100644
index 0000000..31ee7d2
--- /dev/null
+++ b/third_party/boringssl/mac-x86_64/crypto/rc4/rc4-md5-x86_64.S
@@ -0,0 +1,1262 @@
+#if defined(__x86_64__)
+.text	
+.p2align	4
+
+.globl	_rc4_md5_enc
+.private_extern _rc4_md5_enc
+
+_rc4_md5_enc:
+	cmpq	$0,%r9
+	je	L$abort
+	pushq	%rbx
+	pushq	%rbp
+	pushq	%r12
+	pushq	%r13
+	pushq	%r14
+	pushq	%r15
+	subq	$40,%rsp
+L$body:
+	movq	%rcx,%r11
+	movq	%r9,%r12
+	movq	%rsi,%r13
+	movq	%rdx,%r14
+	movq	%r8,%r15
+	xorq	%rbp,%rbp
+	xorq	%rcx,%rcx
+
+	leaq	8(%rdi),%rdi
+	movb	-8(%rdi),%bpl
+	movb	-4(%rdi),%cl
+
+	incb	%bpl
+	subq	%r13,%r14
+	movl	(%rdi,%rbp,4),%eax
+	addb	%al,%cl
+	leaq	(%rdi,%rbp,4),%rsi
+	shlq	$6,%r12
+	addq	%r15,%r12
+	movq	%r12,16(%rsp)
+
+	movq	%r11,24(%rsp)
+	movl	0(%r11),%r8d
+	movl	4(%r11),%r9d
+	movl	8(%r11),%r10d
+	movl	12(%r11),%r11d
+	jmp	L$oop
+
+.p2align	4
+L$oop:
+	movl	%r8d,0(%rsp)
+	movl	%r9d,4(%rsp)
+	movl	%r10d,8(%rsp)
+	movl	%r11d,%r12d
+	movl	%r11d,12(%rsp)
+	pxor	%xmm0,%xmm0
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r10d,%r12d
+	movl	%eax,(%rdi,%rcx,4)
+	andl	%r9d,%r12d
+	addl	0(%r15),%r8d
+	addb	%dl,%al
+	movl	4(%rsi),%ebx
+	addl	$3614090360,%r8d
+	xorl	%r11d,%r12d
+	movzbl	%al,%eax
+	movl	%edx,0(%rsi)
+	addl	%r12d,%r8d
+	addb	%bl,%cl
+	roll	$7,%r8d
+	movl	%r10d,%r12d
+	movd	(%rdi,%rax,4),%xmm0
+
+	addl	%r9d,%r8d
+	pxor	%xmm1,%xmm1
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r9d,%r12d
+	movl	%ebx,(%rdi,%rcx,4)
+	andl	%r8d,%r12d
+	addl	4(%r15),%r11d
+	addb	%dl,%bl
+	movl	8(%rsi),%eax
+	addl	$3905402710,%r11d
+	xorl	%r10d,%r12d
+	movzbl	%bl,%ebx
+	movl	%edx,4(%rsi)
+	addl	%r12d,%r11d
+	addb	%al,%cl
+	roll	$12,%r11d
+	movl	%r9d,%r12d
+	movd	(%rdi,%rbx,4),%xmm1
+
+	addl	%r8d,%r11d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r8d,%r12d
+	movl	%eax,(%rdi,%rcx,4)
+	andl	%r11d,%r12d
+	addl	8(%r15),%r10d
+	addb	%dl,%al
+	movl	12(%rsi),%ebx
+	addl	$606105819,%r10d
+	xorl	%r9d,%r12d
+	movzbl	%al,%eax
+	movl	%edx,8(%rsi)
+	addl	%r12d,%r10d
+	addb	%bl,%cl
+	roll	$17,%r10d
+	movl	%r8d,%r12d
+	pinsrw	$1,(%rdi,%rax,4),%xmm0
+
+	addl	%r11d,%r10d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r11d,%r12d
+	movl	%ebx,(%rdi,%rcx,4)
+	andl	%r10d,%r12d
+	addl	12(%r15),%r9d
+	addb	%dl,%bl
+	movl	16(%rsi),%eax
+	addl	$3250441966,%r9d
+	xorl	%r8d,%r12d
+	movzbl	%bl,%ebx
+	movl	%edx,12(%rsi)
+	addl	%r12d,%r9d
+	addb	%al,%cl
+	roll	$22,%r9d
+	movl	%r11d,%r12d
+	pinsrw	$1,(%rdi,%rbx,4),%xmm1
+
+	addl	%r10d,%r9d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r10d,%r12d
+	movl	%eax,(%rdi,%rcx,4)
+	andl	%r9d,%r12d
+	addl	16(%r15),%r8d
+	addb	%dl,%al
+	movl	20(%rsi),%ebx
+	addl	$4118548399,%r8d
+	xorl	%r11d,%r12d
+	movzbl	%al,%eax
+	movl	%edx,16(%rsi)
+	addl	%r12d,%r8d
+	addb	%bl,%cl
+	roll	$7,%r8d
+	movl	%r10d,%r12d
+	pinsrw	$2,(%rdi,%rax,4),%xmm0
+
+	addl	%r9d,%r8d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r9d,%r12d
+	movl	%ebx,(%rdi,%rcx,4)
+	andl	%r8d,%r12d
+	addl	20(%r15),%r11d
+	addb	%dl,%bl
+	movl	24(%rsi),%eax
+	addl	$1200080426,%r11d
+	xorl	%r10d,%r12d
+	movzbl	%bl,%ebx
+	movl	%edx,20(%rsi)
+	addl	%r12d,%r11d
+	addb	%al,%cl
+	roll	$12,%r11d
+	movl	%r9d,%r12d
+	pinsrw	$2,(%rdi,%rbx,4),%xmm1
+
+	addl	%r8d,%r11d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r8d,%r12d
+	movl	%eax,(%rdi,%rcx,4)
+	andl	%r11d,%r12d
+	addl	24(%r15),%r10d
+	addb	%dl,%al
+	movl	28(%rsi),%ebx
+	addl	$2821735955,%r10d
+	xorl	%r9d,%r12d
+	movzbl	%al,%eax
+	movl	%edx,24(%rsi)
+	addl	%r12d,%r10d
+	addb	%bl,%cl
+	roll	$17,%r10d
+	movl	%r8d,%r12d
+	pinsrw	$3,(%rdi,%rax,4),%xmm0
+
+	addl	%r11d,%r10d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r11d,%r12d
+	movl	%ebx,(%rdi,%rcx,4)
+	andl	%r10d,%r12d
+	addl	28(%r15),%r9d
+	addb	%dl,%bl
+	movl	32(%rsi),%eax
+	addl	$4249261313,%r9d
+	xorl	%r8d,%r12d
+	movzbl	%bl,%ebx
+	movl	%edx,28(%rsi)
+	addl	%r12d,%r9d
+	addb	%al,%cl
+	roll	$22,%r9d
+	movl	%r11d,%r12d
+	pinsrw	$3,(%rdi,%rbx,4),%xmm1
+
+	addl	%r10d,%r9d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r10d,%r12d
+	movl	%eax,(%rdi,%rcx,4)
+	andl	%r9d,%r12d
+	addl	32(%r15),%r8d
+	addb	%dl,%al
+	movl	36(%rsi),%ebx
+	addl	$1770035416,%r8d
+	xorl	%r11d,%r12d
+	movzbl	%al,%eax
+	movl	%edx,32(%rsi)
+	addl	%r12d,%r8d
+	addb	%bl,%cl
+	roll	$7,%r8d
+	movl	%r10d,%r12d
+	pinsrw	$4,(%rdi,%rax,4),%xmm0
+
+	addl	%r9d,%r8d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r9d,%r12d
+	movl	%ebx,(%rdi,%rcx,4)
+	andl	%r8d,%r12d
+	addl	36(%r15),%r11d
+	addb	%dl,%bl
+	movl	40(%rsi),%eax
+	addl	$2336552879,%r11d
+	xorl	%r10d,%r12d
+	movzbl	%bl,%ebx
+	movl	%edx,36(%rsi)
+	addl	%r12d,%r11d
+	addb	%al,%cl
+	roll	$12,%r11d
+	movl	%r9d,%r12d
+	pinsrw	$4,(%rdi,%rbx,4),%xmm1
+
+	addl	%r8d,%r11d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r8d,%r12d
+	movl	%eax,(%rdi,%rcx,4)
+	andl	%r11d,%r12d
+	addl	40(%r15),%r10d
+	addb	%dl,%al
+	movl	44(%rsi),%ebx
+	addl	$4294925233,%r10d
+	xorl	%r9d,%r12d
+	movzbl	%al,%eax
+	movl	%edx,40(%rsi)
+	addl	%r12d,%r10d
+	addb	%bl,%cl
+	roll	$17,%r10d
+	movl	%r8d,%r12d
+	pinsrw	$5,(%rdi,%rax,4),%xmm0
+
+	addl	%r11d,%r10d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r11d,%r12d
+	movl	%ebx,(%rdi,%rcx,4)
+	andl	%r10d,%r12d
+	addl	44(%r15),%r9d
+	addb	%dl,%bl
+	movl	48(%rsi),%eax
+	addl	$2304563134,%r9d
+	xorl	%r8d,%r12d
+	movzbl	%bl,%ebx
+	movl	%edx,44(%rsi)
+	addl	%r12d,%r9d
+	addb	%al,%cl
+	roll	$22,%r9d
+	movl	%r11d,%r12d
+	pinsrw	$5,(%rdi,%rbx,4),%xmm1
+
+	addl	%r10d,%r9d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r10d,%r12d
+	movl	%eax,(%rdi,%rcx,4)
+	andl	%r9d,%r12d
+	addl	48(%r15),%r8d
+	addb	%dl,%al
+	movl	52(%rsi),%ebx
+	addl	$1804603682,%r8d
+	xorl	%r11d,%r12d
+	movzbl	%al,%eax
+	movl	%edx,48(%rsi)
+	addl	%r12d,%r8d
+	addb	%bl,%cl
+	roll	$7,%r8d
+	movl	%r10d,%r12d
+	pinsrw	$6,(%rdi,%rax,4),%xmm0
+
+	addl	%r9d,%r8d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r9d,%r12d
+	movl	%ebx,(%rdi,%rcx,4)
+	andl	%r8d,%r12d
+	addl	52(%r15),%r11d
+	addb	%dl,%bl
+	movl	56(%rsi),%eax
+	addl	$4254626195,%r11d
+	xorl	%r10d,%r12d
+	movzbl	%bl,%ebx
+	movl	%edx,52(%rsi)
+	addl	%r12d,%r11d
+	addb	%al,%cl
+	roll	$12,%r11d
+	movl	%r9d,%r12d
+	pinsrw	$6,(%rdi,%rbx,4),%xmm1
+
+	addl	%r8d,%r11d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r8d,%r12d
+	movl	%eax,(%rdi,%rcx,4)
+	andl	%r11d,%r12d
+	addl	56(%r15),%r10d
+	addb	%dl,%al
+	movl	60(%rsi),%ebx
+	addl	$2792965006,%r10d
+	xorl	%r9d,%r12d
+	movzbl	%al,%eax
+	movl	%edx,56(%rsi)
+	addl	%r12d,%r10d
+	addb	%bl,%cl
+	roll	$17,%r10d
+	movl	%r8d,%r12d
+	pinsrw	$7,(%rdi,%rax,4),%xmm0
+
+	addl	%r11d,%r10d
+	movdqu	(%r13),%xmm2
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r11d,%r12d
+	movl	%ebx,(%rdi,%rcx,4)
+	andl	%r10d,%r12d
+	addl	60(%r15),%r9d
+	addb	%dl,%bl
+	movl	64(%rsi),%eax
+	addl	$1236535329,%r9d
+	xorl	%r8d,%r12d
+	movzbl	%bl,%ebx
+	movl	%edx,60(%rsi)
+	addl	%r12d,%r9d
+	addb	%al,%cl
+	roll	$22,%r9d
+	movl	%r10d,%r12d
+	pinsrw	$7,(%rdi,%rbx,4),%xmm1
+
+	addl	%r10d,%r9d
+	psllq	$8,%xmm1
+	pxor	%xmm0,%xmm2
+	pxor	%xmm1,%xmm2
+	pxor	%xmm0,%xmm0
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r9d,%r12d
+	movl	%eax,(%rdi,%rcx,4)
+	andl	%r11d,%r12d
+	addl	4(%r15),%r8d
+	addb	%dl,%al
+	movl	68(%rsi),%ebx
+	addl	$4129170786,%r8d
+	xorl	%r10d,%r12d
+	movzbl	%al,%eax
+	movl	%edx,64(%rsi)
+	addl	%r12d,%r8d
+	addb	%bl,%cl
+	roll	$5,%r8d
+	movl	%r9d,%r12d
+	movd	(%rdi,%rax,4),%xmm0
+
+	addl	%r9d,%r8d
+	pxor	%xmm1,%xmm1
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r8d,%r12d
+	movl	%ebx,(%rdi,%rcx,4)
+	andl	%r10d,%r12d
+	addl	24(%r15),%r11d
+	addb	%dl,%bl
+	movl	72(%rsi),%eax
+	addl	$3225465664,%r11d
+	xorl	%r9d,%r12d
+	movzbl	%bl,%ebx
+	movl	%edx,68(%rsi)
+	addl	%r12d,%r11d
+	addb	%al,%cl
+	roll	$9,%r11d
+	movl	%r8d,%r12d
+	movd	(%rdi,%rbx,4),%xmm1
+
+	addl	%r8d,%r11d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r11d,%r12d
+	movl	%eax,(%rdi,%rcx,4)
+	andl	%r9d,%r12d
+	addl	44(%r15),%r10d
+	addb	%dl,%al
+	movl	76(%rsi),%ebx
+	addl	$643717713,%r10d
+	xorl	%r8d,%r12d
+	movzbl	%al,%eax
+	movl	%edx,72(%rsi)
+	addl	%r12d,%r10d
+	addb	%bl,%cl
+	roll	$14,%r10d
+	movl	%r11d,%r12d
+	pinsrw	$1,(%rdi,%rax,4),%xmm0
+
+	addl	%r11d,%r10d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r10d,%r12d
+	movl	%ebx,(%rdi,%rcx,4)
+	andl	%r8d,%r12d
+	addl	0(%r15),%r9d
+	addb	%dl,%bl
+	movl	80(%rsi),%eax
+	addl	$3921069994,%r9d
+	xorl	%r11d,%r12d
+	movzbl	%bl,%ebx
+	movl	%edx,76(%rsi)
+	addl	%r12d,%r9d
+	addb	%al,%cl
+	roll	$20,%r9d
+	movl	%r10d,%r12d
+	pinsrw	$1,(%rdi,%rbx,4),%xmm1
+
+	addl	%r10d,%r9d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r9d,%r12d
+	movl	%eax,(%rdi,%rcx,4)
+	andl	%r11d,%r12d
+	addl	20(%r15),%r8d
+	addb	%dl,%al
+	movl	84(%rsi),%ebx
+	addl	$3593408605,%r8d
+	xorl	%r10d,%r12d
+	movzbl	%al,%eax
+	movl	%edx,80(%rsi)
+	addl	%r12d,%r8d
+	addb	%bl,%cl
+	roll	$5,%r8d
+	movl	%r9d,%r12d
+	pinsrw	$2,(%rdi,%rax,4),%xmm0
+
+	addl	%r9d,%r8d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r8d,%r12d
+	movl	%ebx,(%rdi,%rcx,4)
+	andl	%r10d,%r12d
+	addl	40(%r15),%r11d
+	addb	%dl,%bl
+	movl	88(%rsi),%eax
+	addl	$38016083,%r11d
+	xorl	%r9d,%r12d
+	movzbl	%bl,%ebx
+	movl	%edx,84(%rsi)
+	addl	%r12d,%r11d
+	addb	%al,%cl
+	roll	$9,%r11d
+	movl	%r8d,%r12d
+	pinsrw	$2,(%rdi,%rbx,4),%xmm1
+
+	addl	%r8d,%r11d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r11d,%r12d
+	movl	%eax,(%rdi,%rcx,4)
+	andl	%r9d,%r12d
+	addl	60(%r15),%r10d
+	addb	%dl,%al
+	movl	92(%rsi),%ebx
+	addl	$3634488961,%r10d
+	xorl	%r8d,%r12d
+	movzbl	%al,%eax
+	movl	%edx,88(%rsi)
+	addl	%r12d,%r10d
+	addb	%bl,%cl
+	roll	$14,%r10d
+	movl	%r11d,%r12d
+	pinsrw	$3,(%rdi,%rax,4),%xmm0
+
+	addl	%r11d,%r10d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r10d,%r12d
+	movl	%ebx,(%rdi,%rcx,4)
+	andl	%r8d,%r12d
+	addl	16(%r15),%r9d
+	addb	%dl,%bl
+	movl	96(%rsi),%eax
+	addl	$3889429448,%r9d
+	xorl	%r11d,%r12d
+	movzbl	%bl,%ebx
+	movl	%edx,92(%rsi)
+	addl	%r12d,%r9d
+	addb	%al,%cl
+	roll	$20,%r9d
+	movl	%r10d,%r12d
+	pinsrw	$3,(%rdi,%rbx,4),%xmm1
+
+	addl	%r10d,%r9d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r9d,%r12d
+	movl	%eax,(%rdi,%rcx,4)
+	andl	%r11d,%r12d
+	addl	36(%r15),%r8d
+	addb	%dl,%al
+	movl	100(%rsi),%ebx
+	addl	$568446438,%r8d
+	xorl	%r10d,%r12d
+	movzbl	%al,%eax
+	movl	%edx,96(%rsi)
+	addl	%r12d,%r8d
+	addb	%bl,%cl
+	roll	$5,%r8d
+	movl	%r9d,%r12d
+	pinsrw	$4,(%rdi,%rax,4),%xmm0
+
+	addl	%r9d,%r8d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r8d,%r12d
+	movl	%ebx,(%rdi,%rcx,4)
+	andl	%r10d,%r12d
+	addl	56(%r15),%r11d
+	addb	%dl,%bl
+	movl	104(%rsi),%eax
+	addl	$3275163606,%r11d
+	xorl	%r9d,%r12d
+	movzbl	%bl,%ebx
+	movl	%edx,100(%rsi)
+	addl	%r12d,%r11d
+	addb	%al,%cl
+	roll	$9,%r11d
+	movl	%r8d,%r12d
+	pinsrw	$4,(%rdi,%rbx,4),%xmm1
+
+	addl	%r8d,%r11d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r11d,%r12d
+	movl	%eax,(%rdi,%rcx,4)
+	andl	%r9d,%r12d
+	addl	12(%r15),%r10d
+	addb	%dl,%al
+	movl	108(%rsi),%ebx
+	addl	$4107603335,%r10d
+	xorl	%r8d,%r12d
+	movzbl	%al,%eax
+	movl	%edx,104(%rsi)
+	addl	%r12d,%r10d
+	addb	%bl,%cl
+	roll	$14,%r10d
+	movl	%r11d,%r12d
+	pinsrw	$5,(%rdi,%rax,4),%xmm0
+
+	addl	%r11d,%r10d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r10d,%r12d
+	movl	%ebx,(%rdi,%rcx,4)
+	andl	%r8d,%r12d
+	addl	32(%r15),%r9d
+	addb	%dl,%bl
+	movl	112(%rsi),%eax
+	addl	$1163531501,%r9d
+	xorl	%r11d,%r12d
+	movzbl	%bl,%ebx
+	movl	%edx,108(%rsi)
+	addl	%r12d,%r9d
+	addb	%al,%cl
+	roll	$20,%r9d
+	movl	%r10d,%r12d
+	pinsrw	$5,(%rdi,%rbx,4),%xmm1
+
+	addl	%r10d,%r9d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r9d,%r12d
+	movl	%eax,(%rdi,%rcx,4)
+	andl	%r11d,%r12d
+	addl	52(%r15),%r8d
+	addb	%dl,%al
+	movl	116(%rsi),%ebx
+	addl	$2850285829,%r8d
+	xorl	%r10d,%r12d
+	movzbl	%al,%eax
+	movl	%edx,112(%rsi)
+	addl	%r12d,%r8d
+	addb	%bl,%cl
+	roll	$5,%r8d
+	movl	%r9d,%r12d
+	pinsrw	$6,(%rdi,%rax,4),%xmm0
+
+	addl	%r9d,%r8d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r8d,%r12d
+	movl	%ebx,(%rdi,%rcx,4)
+	andl	%r10d,%r12d
+	addl	8(%r15),%r11d
+	addb	%dl,%bl
+	movl	120(%rsi),%eax
+	addl	$4243563512,%r11d
+	xorl	%r9d,%r12d
+	movzbl	%bl,%ebx
+	movl	%edx,116(%rsi)
+	addl	%r12d,%r11d
+	addb	%al,%cl
+	roll	$9,%r11d
+	movl	%r8d,%r12d
+	pinsrw	$6,(%rdi,%rbx,4),%xmm1
+
+	addl	%r8d,%r11d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r11d,%r12d
+	movl	%eax,(%rdi,%rcx,4)
+	andl	%r9d,%r12d
+	addl	28(%r15),%r10d
+	addb	%dl,%al
+	movl	124(%rsi),%ebx
+	addl	$1735328473,%r10d
+	xorl	%r8d,%r12d
+	movzbl	%al,%eax
+	movl	%edx,120(%rsi)
+	addl	%r12d,%r10d
+	addb	%bl,%cl
+	roll	$14,%r10d
+	movl	%r11d,%r12d
+	pinsrw	$7,(%rdi,%rax,4),%xmm0
+
+	addl	%r11d,%r10d
+	movdqu	16(%r13),%xmm3
+	addb	$32,%bpl
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r10d,%r12d
+	movl	%ebx,(%rdi,%rcx,4)
+	andl	%r8d,%r12d
+	addl	48(%r15),%r9d
+	addb	%dl,%bl
+	movl	0(%rdi,%rbp,4),%eax
+	addl	$2368359562,%r9d
+	xorl	%r11d,%r12d
+	movzbl	%bl,%ebx
+	movl	%edx,124(%rsi)
+	addl	%r12d,%r9d
+	addb	%al,%cl
+	roll	$20,%r9d
+	movl	%r11d,%r12d
+	pinsrw	$7,(%rdi,%rbx,4),%xmm1
+
+	addl	%r10d,%r9d
+	movq	%rcx,%rsi
+	xorq	%rcx,%rcx
+	movb	%sil,%cl
+	leaq	(%rdi,%rbp,4),%rsi
+	psllq	$8,%xmm1
+	pxor	%xmm0,%xmm3
+	pxor	%xmm1,%xmm3
+	pxor	%xmm0,%xmm0
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r10d,%r12d
+	movl	%eax,(%rdi,%rcx,4)
+	xorl	%r9d,%r12d
+	addl	20(%r15),%r8d
+	addb	%dl,%al
+	movl	4(%rsi),%ebx
+	addl	$4294588738,%r8d
+	movzbl	%al,%eax
+	addl	%r12d,%r8d
+	movl	%edx,0(%rsi)
+	addb	%bl,%cl
+	roll	$4,%r8d
+	movl	%r10d,%r12d
+	movd	(%rdi,%rax,4),%xmm0
+
+	addl	%r9d,%r8d
+	pxor	%xmm1,%xmm1
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r9d,%r12d
+	movl	%ebx,(%rdi,%rcx,4)
+	xorl	%r8d,%r12d
+	addl	32(%r15),%r11d
+	addb	%dl,%bl
+	movl	8(%rsi),%eax
+	addl	$2272392833,%r11d
+	movzbl	%bl,%ebx
+	addl	%r12d,%r11d
+	movl	%edx,4(%rsi)
+	addb	%al,%cl
+	roll	$11,%r11d
+	movl	%r9d,%r12d
+	movd	(%rdi,%rbx,4),%xmm1
+
+	addl	%r8d,%r11d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r8d,%r12d
+	movl	%eax,(%rdi,%rcx,4)
+	xorl	%r11d,%r12d
+	addl	44(%r15),%r10d
+	addb	%dl,%al
+	movl	12(%rsi),%ebx
+	addl	$1839030562,%r10d
+	movzbl	%al,%eax
+	addl	%r12d,%r10d
+	movl	%edx,8(%rsi)
+	addb	%bl,%cl
+	roll	$16,%r10d
+	movl	%r8d,%r12d
+	pinsrw	$1,(%rdi,%rax,4),%xmm0
+
+	addl	%r11d,%r10d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r11d,%r12d
+	movl	%ebx,(%rdi,%rcx,4)
+	xorl	%r10d,%r12d
+	addl	56(%r15),%r9d
+	addb	%dl,%bl
+	movl	16(%rsi),%eax
+	addl	$4259657740,%r9d
+	movzbl	%bl,%ebx
+	addl	%r12d,%r9d
+	movl	%edx,12(%rsi)
+	addb	%al,%cl
+	roll	$23,%r9d
+	movl	%r11d,%r12d
+	pinsrw	$1,(%rdi,%rbx,4),%xmm1
+
+	addl	%r10d,%r9d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r10d,%r12d
+	movl	%eax,(%rdi,%rcx,4)
+	xorl	%r9d,%r12d
+	addl	4(%r15),%r8d
+	addb	%dl,%al
+	movl	20(%rsi),%ebx
+	addl	$2763975236,%r8d
+	movzbl	%al,%eax
+	addl	%r12d,%r8d
+	movl	%edx,16(%rsi)
+	addb	%bl,%cl
+	roll	$4,%r8d
+	movl	%r10d,%r12d
+	pinsrw	$2,(%rdi,%rax,4),%xmm0
+
+	addl	%r9d,%r8d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r9d,%r12d
+	movl	%ebx,(%rdi,%rcx,4)
+	xorl	%r8d,%r12d
+	addl	16(%r15),%r11d
+	addb	%dl,%bl
+	movl	24(%rsi),%eax
+	addl	$1272893353,%r11d
+	movzbl	%bl,%ebx
+	addl	%r12d,%r11d
+	movl	%edx,20(%rsi)
+	addb	%al,%cl
+	roll	$11,%r11d
+	movl	%r9d,%r12d
+	pinsrw	$2,(%rdi,%rbx,4),%xmm1
+
+	addl	%r8d,%r11d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r8d,%r12d
+	movl	%eax,(%rdi,%rcx,4)
+	xorl	%r11d,%r12d
+	addl	28(%r15),%r10d
+	addb	%dl,%al
+	movl	28(%rsi),%ebx
+	addl	$4139469664,%r10d
+	movzbl	%al,%eax
+	addl	%r12d,%r10d
+	movl	%edx,24(%rsi)
+	addb	%bl,%cl
+	roll	$16,%r10d
+	movl	%r8d,%r12d
+	pinsrw	$3,(%rdi,%rax,4),%xmm0
+
+	addl	%r11d,%r10d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r11d,%r12d
+	movl	%ebx,(%rdi,%rcx,4)
+	xorl	%r10d,%r12d
+	addl	40(%r15),%r9d
+	addb	%dl,%bl
+	movl	32(%rsi),%eax
+	addl	$3200236656,%r9d
+	movzbl	%bl,%ebx
+	addl	%r12d,%r9d
+	movl	%edx,28(%rsi)
+	addb	%al,%cl
+	roll	$23,%r9d
+	movl	%r11d,%r12d
+	pinsrw	$3,(%rdi,%rbx,4),%xmm1
+
+	addl	%r10d,%r9d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r10d,%r12d
+	movl	%eax,(%rdi,%rcx,4)
+	xorl	%r9d,%r12d
+	addl	52(%r15),%r8d
+	addb	%dl,%al
+	movl	36(%rsi),%ebx
+	addl	$681279174,%r8d
+	movzbl	%al,%eax
+	addl	%r12d,%r8d
+	movl	%edx,32(%rsi)
+	addb	%bl,%cl
+	roll	$4,%r8d
+	movl	%r10d,%r12d
+	pinsrw	$4,(%rdi,%rax,4),%xmm0
+
+	addl	%r9d,%r8d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r9d,%r12d
+	movl	%ebx,(%rdi,%rcx,4)
+	xorl	%r8d,%r12d
+	addl	0(%r15),%r11d
+	addb	%dl,%bl
+	movl	40(%rsi),%eax
+	addl	$3936430074,%r11d
+	movzbl	%bl,%ebx
+	addl	%r12d,%r11d
+	movl	%edx,36(%rsi)
+	addb	%al,%cl
+	roll	$11,%r11d
+	movl	%r9d,%r12d
+	pinsrw	$4,(%rdi,%rbx,4),%xmm1
+
+	addl	%r8d,%r11d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r8d,%r12d
+	movl	%eax,(%rdi,%rcx,4)
+	xorl	%r11d,%r12d
+	addl	12(%r15),%r10d
+	addb	%dl,%al
+	movl	44(%rsi),%ebx
+	addl	$3572445317,%r10d
+	movzbl	%al,%eax
+	addl	%r12d,%r10d
+	movl	%edx,40(%rsi)
+	addb	%bl,%cl
+	roll	$16,%r10d
+	movl	%r8d,%r12d
+	pinsrw	$5,(%rdi,%rax,4),%xmm0
+
+	addl	%r11d,%r10d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r11d,%r12d
+	movl	%ebx,(%rdi,%rcx,4)
+	xorl	%r10d,%r12d
+	addl	24(%r15),%r9d
+	addb	%dl,%bl
+	movl	48(%rsi),%eax
+	addl	$76029189,%r9d
+	movzbl	%bl,%ebx
+	addl	%r12d,%r9d
+	movl	%edx,44(%rsi)
+	addb	%al,%cl
+	roll	$23,%r9d
+	movl	%r11d,%r12d
+	pinsrw	$5,(%rdi,%rbx,4),%xmm1
+
+	addl	%r10d,%r9d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r10d,%r12d
+	movl	%eax,(%rdi,%rcx,4)
+	xorl	%r9d,%r12d
+	addl	36(%r15),%r8d
+	addb	%dl,%al
+	movl	52(%rsi),%ebx
+	addl	$3654602809,%r8d
+	movzbl	%al,%eax
+	addl	%r12d,%r8d
+	movl	%edx,48(%rsi)
+	addb	%bl,%cl
+	roll	$4,%r8d
+	movl	%r10d,%r12d
+	pinsrw	$6,(%rdi,%rax,4),%xmm0
+
+	addl	%r9d,%r8d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r9d,%r12d
+	movl	%ebx,(%rdi,%rcx,4)
+	xorl	%r8d,%r12d
+	addl	48(%r15),%r11d
+	addb	%dl,%bl
+	movl	56(%rsi),%eax
+	addl	$3873151461,%r11d
+	movzbl	%bl,%ebx
+	addl	%r12d,%r11d
+	movl	%edx,52(%rsi)
+	addb	%al,%cl
+	roll	$11,%r11d
+	movl	%r9d,%r12d
+	pinsrw	$6,(%rdi,%rbx,4),%xmm1
+
+	addl	%r8d,%r11d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r8d,%r12d
+	movl	%eax,(%rdi,%rcx,4)
+	xorl	%r11d,%r12d
+	addl	60(%r15),%r10d
+	addb	%dl,%al
+	movl	60(%rsi),%ebx
+	addl	$530742520,%r10d
+	movzbl	%al,%eax
+	addl	%r12d,%r10d
+	movl	%edx,56(%rsi)
+	addb	%bl,%cl
+	roll	$16,%r10d
+	movl	%r8d,%r12d
+	pinsrw	$7,(%rdi,%rax,4),%xmm0
+
+	addl	%r11d,%r10d
+	movdqu	32(%r13),%xmm4
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r11d,%r12d
+	movl	%ebx,(%rdi,%rcx,4)
+	xorl	%r10d,%r12d
+	addl	8(%r15),%r9d
+	addb	%dl,%bl
+	movl	64(%rsi),%eax
+	addl	$3299628645,%r9d
+	movzbl	%bl,%ebx
+	addl	%r12d,%r9d
+	movl	%edx,60(%rsi)
+	addb	%al,%cl
+	roll	$23,%r9d
+	movl	$-1,%r12d
+	pinsrw	$7,(%rdi,%rbx,4),%xmm1
+
+	addl	%r10d,%r9d
+	psllq	$8,%xmm1
+	pxor	%xmm0,%xmm4
+	pxor	%xmm1,%xmm4
+	pxor	%xmm0,%xmm0
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r11d,%r12d
+	movl	%eax,(%rdi,%rcx,4)
+	orl	%r9d,%r12d
+	addl	0(%r15),%r8d
+	addb	%dl,%al
+	movl	68(%rsi),%ebx
+	addl	$4096336452,%r8d
+	movzbl	%al,%eax
+	xorl	%r10d,%r12d
+	movl	%edx,64(%rsi)
+	addl	%r12d,%r8d
+	addb	%bl,%cl
+	roll	$6,%r8d
+	movl	$-1,%r12d
+	movd	(%rdi,%rax,4),%xmm0
+
+	addl	%r9d,%r8d
+	pxor	%xmm1,%xmm1
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r10d,%r12d
+	movl	%ebx,(%rdi,%rcx,4)
+	orl	%r8d,%r12d
+	addl	28(%r15),%r11d
+	addb	%dl,%bl
+	movl	72(%rsi),%eax
+	addl	$1126891415,%r11d
+	movzbl	%bl,%ebx
+	xorl	%r9d,%r12d
+	movl	%edx,68(%rsi)
+	addl	%r12d,%r11d
+	addb	%al,%cl
+	roll	$10,%r11d
+	movl	$-1,%r12d
+	movd	(%rdi,%rbx,4),%xmm1
+
+	addl	%r8d,%r11d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r9d,%r12d
+	movl	%eax,(%rdi,%rcx,4)
+	orl	%r11d,%r12d
+	addl	56(%r15),%r10d
+	addb	%dl,%al
+	movl	76(%rsi),%ebx
+	addl	$2878612391,%r10d
+	movzbl	%al,%eax
+	xorl	%r8d,%r12d
+	movl	%edx,72(%rsi)
+	addl	%r12d,%r10d
+	addb	%bl,%cl
+	roll	$15,%r10d
+	movl	$-1,%r12d
+	pinsrw	$1,(%rdi,%rax,4),%xmm0
+
+	addl	%r11d,%r10d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r8d,%r12d
+	movl	%ebx,(%rdi,%rcx,4)
+	orl	%r10d,%r12d
+	addl	20(%r15),%r9d
+	addb	%dl,%bl
+	movl	80(%rsi),%eax
+	addl	$4237533241,%r9d
+	movzbl	%bl,%ebx
+	xorl	%r11d,%r12d
+	movl	%edx,76(%rsi)
+	addl	%r12d,%r9d
+	addb	%al,%cl
+	roll	$21,%r9d
+	movl	$-1,%r12d
+	pinsrw	$1,(%rdi,%rbx,4),%xmm1
+
+	addl	%r10d,%r9d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r11d,%r12d
+	movl	%eax,(%rdi,%rcx,4)
+	orl	%r9d,%r12d
+	addl	48(%r15),%r8d
+	addb	%dl,%al
+	movl	84(%rsi),%ebx
+	addl	$1700485571,%r8d
+	movzbl	%al,%eax
+	xorl	%r10d,%r12d
+	movl	%edx,80(%rsi)
+	addl	%r12d,%r8d
+	addb	%bl,%cl
+	roll	$6,%r8d
+	movl	$-1,%r12d
+	pinsrw	$2,(%rdi,%rax,4),%xmm0
+
+	addl	%r9d,%r8d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r10d,%r12d
+	movl	%ebx,(%rdi,%rcx,4)
+	orl	%r8d,%r12d
+	addl	12(%r15),%r11d
+	addb	%dl,%bl
+	movl	88(%rsi),%eax
+	addl	$2399980690,%r11d
+	movzbl	%bl,%ebx
+	xorl	%r9d,%r12d
+	movl	%edx,84(%rsi)
+	addl	%r12d,%r11d
+	addb	%al,%cl
+	roll	$10,%r11d
+	movl	$-1,%r12d
+	pinsrw	$2,(%rdi,%rbx,4),%xmm1
+
+	addl	%r8d,%r11d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r9d,%r12d
+	movl	%eax,(%rdi,%rcx,4)
+	orl	%r11d,%r12d
+	addl	40(%r15),%r10d
+	addb	%dl,%al
+	movl	92(%rsi),%ebx
+	addl	$4293915773,%r10d
+	movzbl	%al,%eax
+	xorl	%r8d,%r12d
+	movl	%edx,88(%rsi)
+	addl	%r12d,%r10d
+	addb	%bl,%cl
+	roll	$15,%r10d
+	movl	$-1,%r12d
+	pinsrw	$3,(%rdi,%rax,4),%xmm0
+
+	addl	%r11d,%r10d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r8d,%r12d
+	movl	%ebx,(%rdi,%rcx,4)
+	orl	%r10d,%r12d
+	addl	4(%r15),%r9d
+	addb	%dl,%bl
+	movl	96(%rsi),%eax
+	addl	$2240044497,%r9d
+	movzbl	%bl,%ebx
+	xorl	%r11d,%r12d
+	movl	%edx,92(%rsi)
+	addl	%r12d,%r9d
+	addb	%al,%cl
+	roll	$21,%r9d
+	movl	$-1,%r12d
+	pinsrw	$3,(%rdi,%rbx,4),%xmm1
+
+	addl	%r10d,%r9d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r11d,%r12d
+	movl	%eax,(%rdi,%rcx,4)
+	orl	%r9d,%r12d
+	addl	32(%r15),%r8d
+	addb	%dl,%al
+	movl	100(%rsi),%ebx
+	addl	$1873313359,%r8d
+	movzbl	%al,%eax
+	xorl	%r10d,%r12d
+	movl	%edx,96(%rsi)
+	addl	%r12d,%r8d
+	addb	%bl,%cl
+	roll	$6,%r8d
+	movl	$-1,%r12d
+	pinsrw	$4,(%rdi,%rax,4),%xmm0
+
+	addl	%r9d,%r8d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r10d,%r12d
+	movl	%ebx,(%rdi,%rcx,4)
+	orl	%r8d,%r12d
+	addl	60(%r15),%r11d
+	addb	%dl,%bl
+	movl	104(%rsi),%eax
+	addl	$4264355552,%r11d
+	movzbl	%bl,%ebx
+	xorl	%r9d,%r12d
+	movl	%edx,100(%rsi)
+	addl	%r12d,%r11d
+	addb	%al,%cl
+	roll	$10,%r11d
+	movl	$-1,%r12d
+	pinsrw	$4,(%rdi,%rbx,4),%xmm1
+
+	addl	%r8d,%r11d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r9d,%r12d
+	movl	%eax,(%rdi,%rcx,4)
+	orl	%r11d,%r12d
+	addl	24(%r15),%r10d
+	addb	%dl,%al
+	movl	108(%rsi),%ebx
+	addl	$2734768916,%r10d
+	movzbl	%al,%eax
+	xorl	%r8d,%r12d
+	movl	%edx,104(%rsi)
+	addl	%r12d,%r10d
+	addb	%bl,%cl
+	roll	$15,%r10d
+	movl	$-1,%r12d
+	pinsrw	$5,(%rdi,%rax,4),%xmm0
+
+	addl	%r11d,%r10d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r8d,%r12d
+	movl	%ebx,(%rdi,%rcx,4)
+	orl	%r10d,%r12d
+	addl	52(%r15),%r9d
+	addb	%dl,%bl
+	movl	112(%rsi),%eax
+	addl	$1309151649,%r9d
+	movzbl	%bl,%ebx
+	xorl	%r11d,%r12d
+	movl	%edx,108(%rsi)
+	addl	%r12d,%r9d
+	addb	%al,%cl
+	roll	$21,%r9d
+	movl	$-1,%r12d
+	pinsrw	$5,(%rdi,%rbx,4),%xmm1
+
+	addl	%r10d,%r9d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r11d,%r12d
+	movl	%eax,(%rdi,%rcx,4)
+	orl	%r9d,%r12d
+	addl	16(%r15),%r8d
+	addb	%dl,%al
+	movl	116(%rsi),%ebx
+	addl	$4149444226,%r8d
+	movzbl	%al,%eax
+	xorl	%r10d,%r12d
+	movl	%edx,112(%rsi)
+	addl	%r12d,%r8d
+	addb	%bl,%cl
+	roll	$6,%r8d
+	movl	$-1,%r12d
+	pinsrw	$6,(%rdi,%rax,4),%xmm0
+
+	addl	%r9d,%r8d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r10d,%r12d
+	movl	%ebx,(%rdi,%rcx,4)
+	orl	%r8d,%r12d
+	addl	44(%r15),%r11d
+	addb	%dl,%bl
+	movl	120(%rsi),%eax
+	addl	$3174756917,%r11d
+	movzbl	%bl,%ebx
+	xorl	%r9d,%r12d
+	movl	%edx,116(%rsi)
+	addl	%r12d,%r11d
+	addb	%al,%cl
+	roll	$10,%r11d
+	movl	$-1,%r12d
+	pinsrw	$6,(%rdi,%rbx,4),%xmm1
+
+	addl	%r8d,%r11d
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r9d,%r12d
+	movl	%eax,(%rdi,%rcx,4)
+	orl	%r11d,%r12d
+	addl	8(%r15),%r10d
+	addb	%dl,%al
+	movl	124(%rsi),%ebx
+	addl	$718787259,%r10d
+	movzbl	%al,%eax
+	xorl	%r8d,%r12d
+	movl	%edx,120(%rsi)
+	addl	%r12d,%r10d
+	addb	%bl,%cl
+	roll	$15,%r10d
+	movl	$-1,%r12d
+	pinsrw	$7,(%rdi,%rax,4),%xmm0
+
+	addl	%r11d,%r10d
+	movdqu	48(%r13),%xmm5
+	addb	$32,%bpl
+	movl	(%rdi,%rcx,4),%edx
+	xorl	%r8d,%r12d
+	movl	%ebx,(%rdi,%rcx,4)
+	orl	%r10d,%r12d
+	addl	36(%r15),%r9d
+	addb	%dl,%bl
+	movl	0(%rdi,%rbp,4),%eax
+	addl	$3951481745,%r9d
+	movzbl	%bl,%ebx
+	xorl	%r11d,%r12d
+	movl	%edx,124(%rsi)
+	addl	%r12d,%r9d
+	addb	%al,%cl
+	roll	$21,%r9d
+	movl	$-1,%r12d
+	pinsrw	$7,(%rdi,%rbx,4),%xmm1
+
+	addl	%r10d,%r9d
+	movq	%rbp,%rsi
+	xorq	%rbp,%rbp
+	movb	%sil,%bpl
+	movq	%rcx,%rsi
+	xorq	%rcx,%rcx
+	movb	%sil,%cl
+	leaq	(%rdi,%rbp,4),%rsi
+	psllq	$8,%xmm1
+	pxor	%xmm0,%xmm5
+	pxor	%xmm1,%xmm5
+	addl	0(%rsp),%r8d
+	addl	4(%rsp),%r9d
+	addl	8(%rsp),%r10d
+	addl	12(%rsp),%r11d
+
+	movdqu	%xmm2,(%r14,%r13,1)
+	movdqu	%xmm3,16(%r14,%r13,1)
+	movdqu	%xmm4,32(%r14,%r13,1)
+	movdqu	%xmm5,48(%r14,%r13,1)
+	leaq	64(%r15),%r15
+	leaq	64(%r13),%r13
+	cmpq	16(%rsp),%r15
+	jb	L$oop
+
+	movq	24(%rsp),%r12
+	subb	%al,%cl
+	movl	%r8d,0(%r12)
+	movl	%r9d,4(%r12)
+	movl	%r10d,8(%r12)
+	movl	%r11d,12(%r12)
+	subb	$1,%bpl
+	movl	%ebp,-8(%rdi)
+	movl	%ecx,-4(%rdi)
+
+	movq	40(%rsp),%r15
+	movq	48(%rsp),%r14
+	movq	56(%rsp),%r13
+	movq	64(%rsp),%r12
+	movq	72(%rsp),%rbp
+	movq	80(%rsp),%rbx
+	leaq	88(%rsp),%rsp
+L$epilogue:
+L$abort:
+	.byte	0xf3,0xc3
+
+#endif
diff --git a/third_party/boringssl/mac-x86_64/crypto/rc4/rc4-x86_64.S b/third_party/boringssl/mac-x86_64/crypto/rc4/rc4-x86_64.S
new file mode 100644
index 0000000..7808184
--- /dev/null
+++ b/third_party/boringssl/mac-x86_64/crypto/rc4/rc4-x86_64.S
@@ -0,0 +1,595 @@
+#if defined(__x86_64__)
+.text	
+
+
+.globl	_asm_RC4
+.private_extern _asm_RC4
+
+.p2align	4
+_asm_RC4:
+	orq	%rsi,%rsi
+	jne	L$entry
+	.byte	0xf3,0xc3
+L$entry:
+	pushq	%rbx
+	pushq	%r12
+	pushq	%r13
+L$prologue:
+	movq	%rsi,%r11
+	movq	%rdx,%r12
+	movq	%rcx,%r13
+	xorq	%r10,%r10
+	xorq	%rcx,%rcx
+
+	leaq	8(%rdi),%rdi
+	movb	-8(%rdi),%r10b
+	movb	-4(%rdi),%cl
+	cmpl	$-1,256(%rdi)
+	je	L$RC4_CHAR
+	movl	_OPENSSL_ia32cap_P(%rip),%r8d
+	xorq	%rbx,%rbx
+	incb	%r10b
+	subq	%r10,%rbx
+	subq	%r12,%r13
+	movl	(%rdi,%r10,4),%eax
+	testq	$-16,%r11
+	jz	L$loop1
+	btl	$30,%r8d
+	jc	L$intel
+	andq	$7,%rbx
+	leaq	1(%r10),%rsi
+	jz	L$oop8
+	subq	%rbx,%r11
+L$oop8_warmup:
+	addb	%al,%cl
+	movl	(%rdi,%rcx,4),%edx
+	movl	%eax,(%rdi,%rcx,4)
+	movl	%edx,(%rdi,%r10,4)
+	addb	%dl,%al
+	incb	%r10b
+	movl	(%rdi,%rax,4),%edx
+	movl	(%rdi,%r10,4),%eax
+	xorb	(%r12),%dl
+	movb	%dl,(%r12,%r13,1)
+	leaq	1(%r12),%r12
+	decq	%rbx
+	jnz	L$oop8_warmup
+
+	leaq	1(%r10),%rsi
+	jmp	L$oop8
+.p2align	4
+L$oop8:
+	addb	%al,%cl
+	movl	(%rdi,%rcx,4),%edx
+	movl	%eax,(%rdi,%rcx,4)
+	movl	0(%rdi,%rsi,4),%ebx
+	rorq	$8,%r8
+	movl	%edx,0(%rdi,%r10,4)
+	addb	%al,%dl
+	movb	(%rdi,%rdx,4),%r8b
+	addb	%bl,%cl
+	movl	(%rdi,%rcx,4),%edx
+	movl	%ebx,(%rdi,%rcx,4)
+	movl	4(%rdi,%rsi,4),%eax
+	rorq	$8,%r8
+	movl	%edx,4(%rdi,%r10,4)
+	addb	%bl,%dl
+	movb	(%rdi,%rdx,4),%r8b
+	addb	%al,%cl
+	movl	(%rdi,%rcx,4),%edx
+	movl	%eax,(%rdi,%rcx,4)
+	movl	8(%rdi,%rsi,4),%ebx
+	rorq	$8,%r8
+	movl	%edx,8(%rdi,%r10,4)
+	addb	%al,%dl
+	movb	(%rdi,%rdx,4),%r8b
+	addb	%bl,%cl
+	movl	(%rdi,%rcx,4),%edx
+	movl	%ebx,(%rdi,%rcx,4)
+	movl	12(%rdi,%rsi,4),%eax
+	rorq	$8,%r8
+	movl	%edx,12(%rdi,%r10,4)
+	addb	%bl,%dl
+	movb	(%rdi,%rdx,4),%r8b
+	addb	%al,%cl
+	movl	(%rdi,%rcx,4),%edx
+	movl	%eax,(%rdi,%rcx,4)
+	movl	16(%rdi,%rsi,4),%ebx
+	rorq	$8,%r8
+	movl	%edx,16(%rdi,%r10,4)
+	addb	%al,%dl
+	movb	(%rdi,%rdx,4),%r8b
+	addb	%bl,%cl
+	movl	(%rdi,%rcx,4),%edx
+	movl	%ebx,(%rdi,%rcx,4)
+	movl	20(%rdi,%rsi,4),%eax
+	rorq	$8,%r8
+	movl	%edx,20(%rdi,%r10,4)
+	addb	%bl,%dl
+	movb	(%rdi,%rdx,4),%r8b
+	addb	%al,%cl
+	movl	(%rdi,%rcx,4),%edx
+	movl	%eax,(%rdi,%rcx,4)
+	movl	24(%rdi,%rsi,4),%ebx
+	rorq	$8,%r8
+	movl	%edx,24(%rdi,%r10,4)
+	addb	%al,%dl
+	movb	(%rdi,%rdx,4),%r8b
+	addb	$8,%sil
+	addb	%bl,%cl
+	movl	(%rdi,%rcx,4),%edx
+	movl	%ebx,(%rdi,%rcx,4)
+	movl	-4(%rdi,%rsi,4),%eax
+	rorq	$8,%r8
+	movl	%edx,28(%rdi,%r10,4)
+	addb	%bl,%dl
+	movb	(%rdi,%rdx,4),%r8b
+	addb	$8,%r10b
+	rorq	$8,%r8
+	subq	$8,%r11
+
+	xorq	(%r12),%r8
+	movq	%r8,(%r12,%r13,1)
+	leaq	8(%r12),%r12
+
+	testq	$-8,%r11
+	jnz	L$oop8
+	cmpq	$0,%r11
+	jne	L$loop1
+	jmp	L$exit
+
+.p2align	4
+L$intel:
+	testq	$-32,%r11
+	jz	L$loop1
+	andq	$15,%rbx
+	jz	L$oop16_is_hot
+	subq	%rbx,%r11
+L$oop16_warmup:
+	addb	%al,%cl
+	movl	(%rdi,%rcx,4),%edx
+	movl	%eax,(%rdi,%rcx,4)
+	movl	%edx,(%rdi,%r10,4)
+	addb	%dl,%al
+	incb	%r10b
+	movl	(%rdi,%rax,4),%edx
+	movl	(%rdi,%r10,4),%eax
+	xorb	(%r12),%dl
+	movb	%dl,(%r12,%r13,1)
+	leaq	1(%r12),%r12
+	decq	%rbx
+	jnz	L$oop16_warmup
+
+	movq	%rcx,%rbx
+	xorq	%rcx,%rcx
+	movb	%bl,%cl
+
+L$oop16_is_hot:
+	leaq	(%rdi,%r10,4),%rsi
+	addb	%al,%cl
+	movl	(%rdi,%rcx,4),%edx
+	pxor	%xmm0,%xmm0
+	movl	%eax,(%rdi,%rcx,4)
+	addb	%dl,%al
+	movl	4(%rsi),%ebx
+	movzbl	%al,%eax
+	movl	%edx,0(%rsi)
+	addb	%bl,%cl
+	pinsrw	$0,(%rdi,%rax,4),%xmm0
+	jmp	L$oop16_enter
+.p2align	4
+L$oop16:
+	addb	%al,%cl
+	movl	(%rdi,%rcx,4),%edx
+	pxor	%xmm0,%xmm2
+	psllq	$8,%xmm1
+	pxor	%xmm0,%xmm0
+	movl	%eax,(%rdi,%rcx,4)
+	addb	%dl,%al
+	movl	4(%rsi),%ebx
+	movzbl	%al,%eax
+	movl	%edx,0(%rsi)
+	pxor	%xmm1,%xmm2
+	addb	%bl,%cl
+	pinsrw	$0,(%rdi,%rax,4),%xmm0
+	movdqu	%xmm2,(%r12,%r13,1)
+	leaq	16(%r12),%r12
+L$oop16_enter:
+	movl	(%rdi,%rcx,4),%edx
+	pxor	%xmm1,%xmm1
+	movl	%ebx,(%rdi,%rcx,4)
+	addb	%dl,%bl
+	movl	8(%rsi),%eax
+	movzbl	%bl,%ebx
+	movl	%edx,4(%rsi)
+	addb	%al,%cl
+	pinsrw	$0,(%rdi,%rbx,4),%xmm1
+	movl	(%rdi,%rcx,4),%edx
+	movl	%eax,(%rdi,%rcx,4)
+	addb	%dl,%al
+	movl	12(%rsi),%ebx
+	movzbl	%al,%eax
+	movl	%edx,8(%rsi)
+	addb	%bl,%cl
+	pinsrw	$1,(%rdi,%rax,4),%xmm0
+	movl	(%rdi,%rcx,4),%edx
+	movl	%ebx,(%rdi,%rcx,4)
+	addb	%dl,%bl
+	movl	16(%rsi),%eax
+	movzbl	%bl,%ebx
+	movl	%edx,12(%rsi)
+	addb	%al,%cl
+	pinsrw	$1,(%rdi,%rbx,4),%xmm1
+	movl	(%rdi,%rcx,4),%edx
+	movl	%eax,(%rdi,%rcx,4)
+	addb	%dl,%al
+	movl	20(%rsi),%ebx
+	movzbl	%al,%eax
+	movl	%edx,16(%rsi)
+	addb	%bl,%cl
+	pinsrw	$2,(%rdi,%rax,4),%xmm0
+	movl	(%rdi,%rcx,4),%edx
+	movl	%ebx,(%rdi,%rcx,4)
+	addb	%dl,%bl
+	movl	24(%rsi),%eax
+	movzbl	%bl,%ebx
+	movl	%edx,20(%rsi)
+	addb	%al,%cl
+	pinsrw	$2,(%rdi,%rbx,4),%xmm1
+	movl	(%rdi,%rcx,4),%edx
+	movl	%eax,(%rdi,%rcx,4)
+	addb	%dl,%al
+	movl	28(%rsi),%ebx
+	movzbl	%al,%eax
+	movl	%edx,24(%rsi)
+	addb	%bl,%cl
+	pinsrw	$3,(%rdi,%rax,4),%xmm0
+	movl	(%rdi,%rcx,4),%edx
+	movl	%ebx,(%rdi,%rcx,4)
+	addb	%dl,%bl
+	movl	32(%rsi),%eax
+	movzbl	%bl,%ebx
+	movl	%edx,28(%rsi)
+	addb	%al,%cl
+	pinsrw	$3,(%rdi,%rbx,4),%xmm1
+	movl	(%rdi,%rcx,4),%edx
+	movl	%eax,(%rdi,%rcx,4)
+	addb	%dl,%al
+	movl	36(%rsi),%ebx
+	movzbl	%al,%eax
+	movl	%edx,32(%rsi)
+	addb	%bl,%cl
+	pinsrw	$4,(%rdi,%rax,4),%xmm0
+	movl	(%rdi,%rcx,4),%edx
+	movl	%ebx,(%rdi,%rcx,4)
+	addb	%dl,%bl
+	movl	40(%rsi),%eax
+	movzbl	%bl,%ebx
+	movl	%edx,36(%rsi)
+	addb	%al,%cl
+	pinsrw	$4,(%rdi,%rbx,4),%xmm1
+	movl	(%rdi,%rcx,4),%edx
+	movl	%eax,(%rdi,%rcx,4)
+	addb	%dl,%al
+	movl	44(%rsi),%ebx
+	movzbl	%al,%eax
+	movl	%edx,40(%rsi)
+	addb	%bl,%cl
+	pinsrw	$5,(%rdi,%rax,4),%xmm0
+	movl	(%rdi,%rcx,4),%edx
+	movl	%ebx,(%rdi,%rcx,4)
+	addb	%dl,%bl
+	movl	48(%rsi),%eax
+	movzbl	%bl,%ebx
+	movl	%edx,44(%rsi)
+	addb	%al,%cl
+	pinsrw	$5,(%rdi,%rbx,4),%xmm1
+	movl	(%rdi,%rcx,4),%edx
+	movl	%eax,(%rdi,%rcx,4)
+	addb	%dl,%al
+	movl	52(%rsi),%ebx
+	movzbl	%al,%eax
+	movl	%edx,48(%rsi)
+	addb	%bl,%cl
+	pinsrw	$6,(%rdi,%rax,4),%xmm0
+	movl	(%rdi,%rcx,4),%edx
+	movl	%ebx,(%rdi,%rcx,4)
+	addb	%dl,%bl
+	movl	56(%rsi),%eax
+	movzbl	%bl,%ebx
+	movl	%edx,52(%rsi)
+	addb	%al,%cl
+	pinsrw	$6,(%rdi,%rbx,4),%xmm1
+	movl	(%rdi,%rcx,4),%edx
+	movl	%eax,(%rdi,%rcx,4)
+	addb	%dl,%al
+	movl	60(%rsi),%ebx
+	movzbl	%al,%eax
+	movl	%edx,56(%rsi)
+	addb	%bl,%cl
+	pinsrw	$7,(%rdi,%rax,4),%xmm0
+	addb	$16,%r10b
+	movdqu	(%r12),%xmm2
+	movl	(%rdi,%rcx,4),%edx
+	movl	%ebx,(%rdi,%rcx,4)
+	addb	%dl,%bl
+	movzbl	%bl,%ebx
+	movl	%edx,60(%rsi)
+	leaq	(%rdi,%r10,4),%rsi
+	pinsrw	$7,(%rdi,%rbx,4),%xmm1
+	movl	(%rsi),%eax
+	movq	%rcx,%rbx
+	xorq	%rcx,%rcx
+	subq	$16,%r11
+	movb	%bl,%cl
+	testq	$-16,%r11
+	jnz	L$oop16
+
+	psllq	$8,%xmm1
+	pxor	%xmm0,%xmm2
+	pxor	%xmm1,%xmm2
+	movdqu	%xmm2,(%r12,%r13,1)
+	leaq	16(%r12),%r12
+
+	cmpq	$0,%r11
+	jne	L$loop1
+	jmp	L$exit
+
+.p2align	4
+L$loop1:
+	addb	%al,%cl
+	movl	(%rdi,%rcx,4),%edx
+	movl	%eax,(%rdi,%rcx,4)
+	movl	%edx,(%rdi,%r10,4)
+	addb	%dl,%al
+	incb	%r10b
+	movl	(%rdi,%rax,4),%edx
+	movl	(%rdi,%r10,4),%eax
+	xorb	(%r12),%dl
+	movb	%dl,(%r12,%r13,1)
+	leaq	1(%r12),%r12
+	decq	%r11
+	jnz	L$loop1
+	jmp	L$exit
+
+.p2align	4
+L$RC4_CHAR:
+	addb	$1,%r10b
+	movzbl	(%rdi,%r10,1),%eax
+	testq	$-8,%r11
+	jz	L$cloop1
+	jmp	L$cloop8
+.p2align	4
+L$cloop8:
+	movl	(%r12),%r8d
+	movl	4(%r12),%r9d
+	addb	%al,%cl
+	leaq	1(%r10),%rsi
+	movzbl	(%rdi,%rcx,1),%edx
+	movzbl	%sil,%esi
+	movzbl	(%rdi,%rsi,1),%ebx
+	movb	%al,(%rdi,%rcx,1)
+	cmpq	%rsi,%rcx
+	movb	%dl,(%rdi,%r10,1)
+	jne	L$cmov0
+	movq	%rax,%rbx
+L$cmov0:
+	addb	%al,%dl
+	xorb	(%rdi,%rdx,1),%r8b
+	rorl	$8,%r8d
+	addb	%bl,%cl
+	leaq	1(%rsi),%r10
+	movzbl	(%rdi,%rcx,1),%edx
+	movzbl	%r10b,%r10d
+	movzbl	(%rdi,%r10,1),%eax
+	movb	%bl,(%rdi,%rcx,1)
+	cmpq	%r10,%rcx
+	movb	%dl,(%rdi,%rsi,1)
+	jne	L$cmov1
+	movq	%rbx,%rax
+L$cmov1:
+	addb	%bl,%dl
+	xorb	(%rdi,%rdx,1),%r8b
+	rorl	$8,%r8d
+	addb	%al,%cl
+	leaq	1(%r10),%rsi
+	movzbl	(%rdi,%rcx,1),%edx
+	movzbl	%sil,%esi
+	movzbl	(%rdi,%rsi,1),%ebx
+	movb	%al,(%rdi,%rcx,1)
+	cmpq	%rsi,%rcx
+	movb	%dl,(%rdi,%r10,1)
+	jne	L$cmov2
+	movq	%rax,%rbx
+L$cmov2:
+	addb	%al,%dl
+	xorb	(%rdi,%rdx,1),%r8b
+	rorl	$8,%r8d
+	addb	%bl,%cl
+	leaq	1(%rsi),%r10
+	movzbl	(%rdi,%rcx,1),%edx
+	movzbl	%r10b,%r10d
+	movzbl	(%rdi,%r10,1),%eax
+	movb	%bl,(%rdi,%rcx,1)
+	cmpq	%r10,%rcx
+	movb	%dl,(%rdi,%rsi,1)
+	jne	L$cmov3
+	movq	%rbx,%rax
+L$cmov3:
+	addb	%bl,%dl
+	xorb	(%rdi,%rdx,1),%r8b
+	rorl	$8,%r8d
+	addb	%al,%cl
+	leaq	1(%r10),%rsi
+	movzbl	(%rdi,%rcx,1),%edx
+	movzbl	%sil,%esi
+	movzbl	(%rdi,%rsi,1),%ebx
+	movb	%al,(%rdi,%rcx,1)
+	cmpq	%rsi,%rcx
+	movb	%dl,(%rdi,%r10,1)
+	jne	L$cmov4
+	movq	%rax,%rbx
+L$cmov4:
+	addb	%al,%dl
+	xorb	(%rdi,%rdx,1),%r9b
+	rorl	$8,%r9d
+	addb	%bl,%cl
+	leaq	1(%rsi),%r10
+	movzbl	(%rdi,%rcx,1),%edx
+	movzbl	%r10b,%r10d
+	movzbl	(%rdi,%r10,1),%eax
+	movb	%bl,(%rdi,%rcx,1)
+	cmpq	%r10,%rcx
+	movb	%dl,(%rdi,%rsi,1)
+	jne	L$cmov5
+	movq	%rbx,%rax
+L$cmov5:
+	addb	%bl,%dl
+	xorb	(%rdi,%rdx,1),%r9b
+	rorl	$8,%r9d
+	addb	%al,%cl
+	leaq	1(%r10),%rsi
+	movzbl	(%rdi,%rcx,1),%edx
+	movzbl	%sil,%esi
+	movzbl	(%rdi,%rsi,1),%ebx
+	movb	%al,(%rdi,%rcx,1)
+	cmpq	%rsi,%rcx
+	movb	%dl,(%rdi,%r10,1)
+	jne	L$cmov6
+	movq	%rax,%rbx
+L$cmov6:
+	addb	%al,%dl
+	xorb	(%rdi,%rdx,1),%r9b
+	rorl	$8,%r9d
+	addb	%bl,%cl
+	leaq	1(%rsi),%r10
+	movzbl	(%rdi,%rcx,1),%edx
+	movzbl	%r10b,%r10d
+	movzbl	(%rdi,%r10,1),%eax
+	movb	%bl,(%rdi,%rcx,1)
+	cmpq	%r10,%rcx
+	movb	%dl,(%rdi,%rsi,1)
+	jne	L$cmov7
+	movq	%rbx,%rax
+L$cmov7:
+	addb	%bl,%dl
+	xorb	(%rdi,%rdx,1),%r9b
+	rorl	$8,%r9d
+	leaq	-8(%r11),%r11
+	movl	%r8d,(%r13)
+	leaq	8(%r12),%r12
+	movl	%r9d,4(%r13)
+	leaq	8(%r13),%r13
+
+	testq	$-8,%r11
+	jnz	L$cloop8
+	cmpq	$0,%r11
+	jne	L$cloop1
+	jmp	L$exit
+.p2align	4
+L$cloop1:
+	addb	%al,%cl
+	movzbl	%cl,%ecx
+	movzbl	(%rdi,%rcx,1),%edx
+	movb	%al,(%rdi,%rcx,1)
+	movb	%dl,(%rdi,%r10,1)
+	addb	%al,%dl
+	addb	$1,%r10b
+	movzbl	%dl,%edx
+	movzbl	%r10b,%r10d
+	movzbl	(%rdi,%rdx,1),%edx
+	movzbl	(%rdi,%r10,1),%eax
+	xorb	(%r12),%dl
+	leaq	1(%r12),%r12
+	movb	%dl,(%r13)
+	leaq	1(%r13),%r13
+	subq	$1,%r11
+	jnz	L$cloop1
+	jmp	L$exit
+
+.p2align	4
+L$exit:
+	subb	$1,%r10b
+	movl	%r10d,-8(%rdi)
+	movl	%ecx,-4(%rdi)
+
+	movq	(%rsp),%r13
+	movq	8(%rsp),%r12
+	movq	16(%rsp),%rbx
+	addq	$24,%rsp
+L$epilogue:
+	.byte	0xf3,0xc3
+
+.globl	_asm_RC4_set_key
+.private_extern _asm_RC4_set_key
+
+.p2align	4
+_asm_RC4_set_key:
+	leaq	8(%rdi),%rdi
+	leaq	(%rdx,%rsi,1),%rdx
+	negq	%rsi
+	movq	%rsi,%rcx
+	xorl	%eax,%eax
+	xorq	%r9,%r9
+	xorq	%r10,%r10
+	xorq	%r11,%r11
+
+	movl	_OPENSSL_ia32cap_P(%rip),%r8d
+	btl	$20,%r8d
+	jc	L$c1stloop
+	jmp	L$w1stloop
+
+.p2align	4
+L$w1stloop:
+	movl	%eax,(%rdi,%rax,4)
+	addb	$1,%al
+	jnc	L$w1stloop
+
+	xorq	%r9,%r9
+	xorq	%r8,%r8
+.p2align	4
+L$w2ndloop:
+	movl	(%rdi,%r9,4),%r10d
+	addb	(%rdx,%rsi,1),%r8b
+	addb	%r10b,%r8b
+	addq	$1,%rsi
+	movl	(%rdi,%r8,4),%r11d
+	cmovzq	%rcx,%rsi
+	movl	%r10d,(%rdi,%r8,4)
+	movl	%r11d,(%rdi,%r9,4)
+	addb	$1,%r9b
+	jnc	L$w2ndloop
+	jmp	L$exit_key
+
+.p2align	4
+L$c1stloop:
+	movb	%al,(%rdi,%rax,1)
+	addb	$1,%al
+	jnc	L$c1stloop
+
+	xorq	%r9,%r9
+	xorq	%r8,%r8
+.p2align	4
+L$c2ndloop:
+	movb	(%rdi,%r9,1),%r10b
+	addb	(%rdx,%rsi,1),%r8b
+	addb	%r10b,%r8b
+	addq	$1,%rsi
+	movb	(%rdi,%r8,1),%r11b
+	jnz	L$cnowrap
+	movq	%rcx,%rsi
+L$cnowrap:
+	movb	%r10b,(%rdi,%r8,1)
+	movb	%r11b,(%rdi,%r9,1)
+	addb	$1,%r9b
+	jnc	L$c2ndloop
+	movl	$-1,256(%rdi)
+
+.p2align	4
+L$exit_key:
+	xorl	%eax,%eax
+	movl	%eax,-8(%rdi)
+	movl	%eax,-4(%rdi)
+	.byte	0xf3,0xc3
+
+#endif
diff --git a/third_party/boringssl/mac-x86_64/crypto/sha/sha1-x86_64.S b/third_party/boringssl/mac-x86_64/crypto/sha/sha1-x86_64.S
new file mode 100644
index 0000000..044dc5b
--- /dev/null
+++ b/third_party/boringssl/mac-x86_64/crypto/sha/sha1-x86_64.S
@@ -0,0 +1,2425 @@
+#if defined(__x86_64__)
+.text	
+
+
+.globl	_sha1_block_data_order
+.private_extern _sha1_block_data_order
+
+.p2align	4
+_sha1_block_data_order:
+	movl	_OPENSSL_ia32cap_P+0(%rip),%r9d
+	movl	_OPENSSL_ia32cap_P+4(%rip),%r8d
+	movl	_OPENSSL_ia32cap_P+8(%rip),%r10d
+	testl	$512,%r8d
+	jz	L$ialu
+	jmp	_ssse3_shortcut
+
+.p2align	4
+L$ialu:
+	movq	%rsp,%rax
+	pushq	%rbx
+	pushq	%rbp
+	pushq	%r12
+	pushq	%r13
+	pushq	%r14
+	movq	%rdi,%r8
+	subq	$72,%rsp
+	movq	%rsi,%r9
+	andq	$-64,%rsp
+	movq	%rdx,%r10
+	movq	%rax,64(%rsp)
+L$prologue:
+
+	movl	0(%r8),%esi
+	movl	4(%r8),%edi
+	movl	8(%r8),%r11d
+	movl	12(%r8),%r12d
+	movl	16(%r8),%r13d
+	jmp	L$loop
+
+.p2align	4
+L$loop:
+	movl	0(%r9),%edx
+	bswapl	%edx
+	movl	4(%r9),%ebp
+	movl	%r12d,%eax
+	movl	%edx,0(%rsp)
+	movl	%esi,%ecx
+	bswapl	%ebp
+	xorl	%r11d,%eax
+	roll	$5,%ecx
+	andl	%edi,%eax
+	leal	1518500249(%rdx,%r13,1),%r13d
+	addl	%ecx,%r13d
+	xorl	%r12d,%eax
+	roll	$30,%edi
+	addl	%eax,%r13d
+	movl	8(%r9),%r14d
+	movl	%r11d,%eax
+	movl	%ebp,4(%rsp)
+	movl	%r13d,%ecx
+	bswapl	%r14d
+	xorl	%edi,%eax
+	roll	$5,%ecx
+	andl	%esi,%eax
+	leal	1518500249(%rbp,%r12,1),%r12d
+	addl	%ecx,%r12d
+	xorl	%r11d,%eax
+	roll	$30,%esi
+	addl	%eax,%r12d
+	movl	12(%r9),%edx
+	movl	%edi,%eax
+	movl	%r14d,8(%rsp)
+	movl	%r12d,%ecx
+	bswapl	%edx
+	xorl	%esi,%eax
+	roll	$5,%ecx
+	andl	%r13d,%eax
+	leal	1518500249(%r14,%r11,1),%r11d
+	addl	%ecx,%r11d
+	xorl	%edi,%eax
+	roll	$30,%r13d
+	addl	%eax,%r11d
+	movl	16(%r9),%ebp
+	movl	%esi,%eax
+	movl	%edx,12(%rsp)
+	movl	%r11d,%ecx
+	bswapl	%ebp
+	xorl	%r13d,%eax
+	roll	$5,%ecx
+	andl	%r12d,%eax
+	leal	1518500249(%rdx,%rdi,1),%edi
+	addl	%ecx,%edi
+	xorl	%esi,%eax
+	roll	$30,%r12d
+	addl	%eax,%edi
+	movl	20(%r9),%r14d
+	movl	%r13d,%eax
+	movl	%ebp,16(%rsp)
+	movl	%edi,%ecx
+	bswapl	%r14d
+	xorl	%r12d,%eax
+	roll	$5,%ecx
+	andl	%r11d,%eax
+	leal	1518500249(%rbp,%rsi,1),%esi
+	addl	%ecx,%esi
+	xorl	%r13d,%eax
+	roll	$30,%r11d
+	addl	%eax,%esi
+	movl	24(%r9),%edx
+	movl	%r12d,%eax
+	movl	%r14d,20(%rsp)
+	movl	%esi,%ecx
+	bswapl	%edx
+	xorl	%r11d,%eax
+	roll	$5,%ecx
+	andl	%edi,%eax
+	leal	1518500249(%r14,%r13,1),%r13d
+	addl	%ecx,%r13d
+	xorl	%r12d,%eax
+	roll	$30,%edi
+	addl	%eax,%r13d
+	movl	28(%r9),%ebp
+	movl	%r11d,%eax
+	movl	%edx,24(%rsp)
+	movl	%r13d,%ecx
+	bswapl	%ebp
+	xorl	%edi,%eax
+	roll	$5,%ecx
+	andl	%esi,%eax
+	leal	1518500249(%rdx,%r12,1),%r12d
+	addl	%ecx,%r12d
+	xorl	%r11d,%eax
+	roll	$30,%esi
+	addl	%eax,%r12d
+	movl	32(%r9),%r14d
+	movl	%edi,%eax
+	movl	%ebp,28(%rsp)
+	movl	%r12d,%ecx
+	bswapl	%r14d
+	xorl	%esi,%eax
+	roll	$5,%ecx
+	andl	%r13d,%eax
+	leal	1518500249(%rbp,%r11,1),%r11d
+	addl	%ecx,%r11d
+	xorl	%edi,%eax
+	roll	$30,%r13d
+	addl	%eax,%r11d
+	movl	36(%r9),%edx
+	movl	%esi,%eax
+	movl	%r14d,32(%rsp)
+	movl	%r11d,%ecx
+	bswapl	%edx
+	xorl	%r13d,%eax
+	roll	$5,%ecx
+	andl	%r12d,%eax
+	leal	1518500249(%r14,%rdi,1),%edi
+	addl	%ecx,%edi
+	xorl	%esi,%eax
+	roll	$30,%r12d
+	addl	%eax,%edi
+	movl	40(%r9),%ebp
+	movl	%r13d,%eax
+	movl	%edx,36(%rsp)
+	movl	%edi,%ecx
+	bswapl	%ebp
+	xorl	%r12d,%eax
+	roll	$5,%ecx
+	andl	%r11d,%eax
+	leal	1518500249(%rdx,%rsi,1),%esi
+	addl	%ecx,%esi
+	xorl	%r13d,%eax
+	roll	$30,%r11d
+	addl	%eax,%esi
+	movl	44(%r9),%r14d
+	movl	%r12d,%eax
+	movl	%ebp,40(%rsp)
+	movl	%esi,%ecx
+	bswapl	%r14d
+	xorl	%r11d,%eax
+	roll	$5,%ecx
+	andl	%edi,%eax
+	leal	1518500249(%rbp,%r13,1),%r13d
+	addl	%ecx,%r13d
+	xorl	%r12d,%eax
+	roll	$30,%edi
+	addl	%eax,%r13d
+	movl	48(%r9),%edx
+	movl	%r11d,%eax
+	movl	%r14d,44(%rsp)
+	movl	%r13d,%ecx
+	bswapl	%edx
+	xorl	%edi,%eax
+	roll	$5,%ecx
+	andl	%esi,%eax
+	leal	1518500249(%r14,%r12,1),%r12d
+	addl	%ecx,%r12d
+	xorl	%r11d,%eax
+	roll	$30,%esi
+	addl	%eax,%r12d
+	movl	52(%r9),%ebp
+	movl	%edi,%eax
+	movl	%edx,48(%rsp)
+	movl	%r12d,%ecx
+	bswapl	%ebp
+	xorl	%esi,%eax
+	roll	$5,%ecx
+	andl	%r13d,%eax
+	leal	1518500249(%rdx,%r11,1),%r11d
+	addl	%ecx,%r11d
+	xorl	%edi,%eax
+	roll	$30,%r13d
+	addl	%eax,%r11d
+	movl	56(%r9),%r14d
+	movl	%esi,%eax
+	movl	%ebp,52(%rsp)
+	movl	%r11d,%ecx
+	bswapl	%r14d
+	xorl	%r13d,%eax
+	roll	$5,%ecx
+	andl	%r12d,%eax
+	leal	1518500249(%rbp,%rdi,1),%edi
+	addl	%ecx,%edi
+	xorl	%esi,%eax
+	roll	$30,%r12d
+	addl	%eax,%edi
+	movl	60(%r9),%edx
+	movl	%r13d,%eax
+	movl	%r14d,56(%rsp)
+	movl	%edi,%ecx
+	bswapl	%edx
+	xorl	%r12d,%eax
+	roll	$5,%ecx
+	andl	%r11d,%eax
+	leal	1518500249(%r14,%rsi,1),%esi
+	addl	%ecx,%esi
+	xorl	%r13d,%eax
+	roll	$30,%r11d
+	addl	%eax,%esi
+	xorl	0(%rsp),%ebp
+	movl	%r12d,%eax
+	movl	%edx,60(%rsp)
+	movl	%esi,%ecx
+	xorl	8(%rsp),%ebp
+	xorl	%r11d,%eax
+	roll	$5,%ecx
+	xorl	32(%rsp),%ebp
+	andl	%edi,%eax
+	leal	1518500249(%rdx,%r13,1),%r13d
+	roll	$30,%edi
+	xorl	%r12d,%eax
+	addl	%ecx,%r13d
+	roll	$1,%ebp
+	addl	%eax,%r13d
+	xorl	4(%rsp),%r14d
+	movl	%r11d,%eax
+	movl	%ebp,0(%rsp)
+	movl	%r13d,%ecx
+	xorl	12(%rsp),%r14d
+	xorl	%edi,%eax
+	roll	$5,%ecx
+	xorl	36(%rsp),%r14d
+	andl	%esi,%eax
+	leal	1518500249(%rbp,%r12,1),%r12d
+	roll	$30,%esi
+	xorl	%r11d,%eax
+	addl	%ecx,%r12d
+	roll	$1,%r14d
+	addl	%eax,%r12d
+	xorl	8(%rsp),%edx
+	movl	%edi,%eax
+	movl	%r14d,4(%rsp)
+	movl	%r12d,%ecx
+	xorl	16(%rsp),%edx
+	xorl	%esi,%eax
+	roll	$5,%ecx
+	xorl	40(%rsp),%edx
+	andl	%r13d,%eax
+	leal	1518500249(%r14,%r11,1),%r11d
+	roll	$30,%r13d
+	xorl	%edi,%eax
+	addl	%ecx,%r11d
+	roll	$1,%edx
+	addl	%eax,%r11d
+	xorl	12(%rsp),%ebp
+	movl	%esi,%eax
+	movl	%edx,8(%rsp)
+	movl	%r11d,%ecx
+	xorl	20(%rsp),%ebp
+	xorl	%r13d,%eax
+	roll	$5,%ecx
+	xorl	44(%rsp),%ebp
+	andl	%r12d,%eax
+	leal	1518500249(%rdx,%rdi,1),%edi
+	roll	$30,%r12d
+	xorl	%esi,%eax
+	addl	%ecx,%edi
+	roll	$1,%ebp
+	addl	%eax,%edi
+	xorl	16(%rsp),%r14d
+	movl	%r13d,%eax
+	movl	%ebp,12(%rsp)
+	movl	%edi,%ecx
+	xorl	24(%rsp),%r14d
+	xorl	%r12d,%eax
+	roll	$5,%ecx
+	xorl	48(%rsp),%r14d
+	andl	%r11d,%eax
+	leal	1518500249(%rbp,%rsi,1),%esi
+	roll	$30,%r11d
+	xorl	%r13d,%eax
+	addl	%ecx,%esi
+	roll	$1,%r14d
+	addl	%eax,%esi
+	xorl	20(%rsp),%edx
+	movl	%edi,%eax
+	movl	%r14d,16(%rsp)
+	movl	%esi,%ecx
+	xorl	28(%rsp),%edx
+	xorl	%r12d,%eax
+	roll	$5,%ecx
+	xorl	52(%rsp),%edx
+	leal	1859775393(%r14,%r13,1),%r13d
+	xorl	%r11d,%eax
+	addl	%ecx,%r13d
+	roll	$30,%edi
+	addl	%eax,%r13d
+	roll	$1,%edx
+	xorl	24(%rsp),%ebp
+	movl	%esi,%eax
+	movl	%edx,20(%rsp)
+	movl	%r13d,%ecx
+	xorl	32(%rsp),%ebp
+	xorl	%r11d,%eax
+	roll	$5,%ecx
+	xorl	56(%rsp),%ebp
+	leal	1859775393(%rdx,%r12,1),%r12d
+	xorl	%edi,%eax
+	addl	%ecx,%r12d
+	roll	$30,%esi
+	addl	%eax,%r12d
+	roll	$1,%ebp
+	xorl	28(%rsp),%r14d
+	movl	%r13d,%eax
+	movl	%ebp,24(%rsp)
+	movl	%r12d,%ecx
+	xorl	36(%rsp),%r14d
+	xorl	%edi,%eax
+	roll	$5,%ecx
+	xorl	60(%rsp),%r14d
+	leal	1859775393(%rbp,%r11,1),%r11d
+	xorl	%esi,%eax
+	addl	%ecx,%r11d
+	roll	$30,%r13d
+	addl	%eax,%r11d
+	roll	$1,%r14d
+	xorl	32(%rsp),%edx
+	movl	%r12d,%eax
+	movl	%r14d,28(%rsp)
+	movl	%r11d,%ecx
+	xorl	40(%rsp),%edx
+	xorl	%esi,%eax
+	roll	$5,%ecx
+	xorl	0(%rsp),%edx
+	leal	1859775393(%r14,%rdi,1),%edi
+	xorl	%r13d,%eax
+	addl	%ecx,%edi
+	roll	$30,%r12d
+	addl	%eax,%edi
+	roll	$1,%edx
+	xorl	36(%rsp),%ebp
+	movl	%r11d,%eax
+	movl	%edx,32(%rsp)
+	movl	%edi,%ecx
+	xorl	44(%rsp),%ebp
+	xorl	%r13d,%eax
+	roll	$5,%ecx
+	xorl	4(%rsp),%ebp
+	leal	1859775393(%rdx,%rsi,1),%esi
+	xorl	%r12d,%eax
+	addl	%ecx,%esi
+	roll	$30,%r11d
+	addl	%eax,%esi
+	roll	$1,%ebp
+	xorl	40(%rsp),%r14d
+	movl	%edi,%eax
+	movl	%ebp,36(%rsp)
+	movl	%esi,%ecx
+	xorl	48(%rsp),%r14d
+	xorl	%r12d,%eax
+	roll	$5,%ecx
+	xorl	8(%rsp),%r14d
+	leal	1859775393(%rbp,%r13,1),%r13d
+	xorl	%r11d,%eax
+	addl	%ecx,%r13d
+	roll	$30,%edi
+	addl	%eax,%r13d
+	roll	$1,%r14d
+	xorl	44(%rsp),%edx
+	movl	%esi,%eax
+	movl	%r14d,40(%rsp)
+	movl	%r13d,%ecx
+	xorl	52(%rsp),%edx
+	xorl	%r11d,%eax
+	roll	$5,%ecx
+	xorl	12(%rsp),%edx
+	leal	1859775393(%r14,%r12,1),%r12d
+	xorl	%edi,%eax
+	addl	%ecx,%r12d
+	roll	$30,%esi
+	addl	%eax,%r12d
+	roll	$1,%edx
+	xorl	48(%rsp),%ebp
+	movl	%r13d,%eax
+	movl	%edx,44(%rsp)
+	movl	%r12d,%ecx
+	xorl	56(%rsp),%ebp
+	xorl	%edi,%eax
+	roll	$5,%ecx
+	xorl	16(%rsp),%ebp
+	leal	1859775393(%rdx,%r11,1),%r11d
+	xorl	%esi,%eax
+	addl	%ecx,%r11d
+	roll	$30,%r13d
+	addl	%eax,%r11d
+	roll	$1,%ebp
+	xorl	52(%rsp),%r14d
+	movl	%r12d,%eax
+	movl	%ebp,48(%rsp)
+	movl	%r11d,%ecx
+	xorl	60(%rsp),%r14d
+	xorl	%esi,%eax
+	roll	$5,%ecx
+	xorl	20(%rsp),%r14d
+	leal	1859775393(%rbp,%rdi,1),%edi
+	xorl	%r13d,%eax
+	addl	%ecx,%edi
+	roll	$30,%r12d
+	addl	%eax,%edi
+	roll	$1,%r14d
+	xorl	56(%rsp),%edx
+	movl	%r11d,%eax
+	movl	%r14d,52(%rsp)
+	movl	%edi,%ecx
+	xorl	0(%rsp),%edx
+	xorl	%r13d,%eax
+	roll	$5,%ecx
+	xorl	24(%rsp),%edx
+	leal	1859775393(%r14,%rsi,1),%esi
+	xorl	%r12d,%eax
+	addl	%ecx,%esi
+	roll	$30,%r11d
+	addl	%eax,%esi
+	roll	$1,%edx
+	xorl	60(%rsp),%ebp
+	movl	%edi,%eax
+	movl	%edx,56(%rsp)
+	movl	%esi,%ecx
+	xorl	4(%rsp),%ebp
+	xorl	%r12d,%eax
+	roll	$5,%ecx
+	xorl	28(%rsp),%ebp
+	leal	1859775393(%rdx,%r13,1),%r13d
+	xorl	%r11d,%eax
+	addl	%ecx,%r13d
+	roll	$30,%edi
+	addl	%eax,%r13d
+	roll	$1,%ebp
+	xorl	0(%rsp),%r14d
+	movl	%esi,%eax
+	movl	%ebp,60(%rsp)
+	movl	%r13d,%ecx
+	xorl	8(%rsp),%r14d
+	xorl	%r11d,%eax
+	roll	$5,%ecx
+	xorl	32(%rsp),%r14d
+	leal	1859775393(%rbp,%r12,1),%r12d
+	xorl	%edi,%eax
+	addl	%ecx,%r12d
+	roll	$30,%esi
+	addl	%eax,%r12d
+	roll	$1,%r14d
+	xorl	4(%rsp),%edx
+	movl	%r13d,%eax
+	movl	%r14d,0(%rsp)
+	movl	%r12d,%ecx
+	xorl	12(%rsp),%edx
+	xorl	%edi,%eax
+	roll	$5,%ecx
+	xorl	36(%rsp),%edx
+	leal	1859775393(%r14,%r11,1),%r11d
+	xorl	%esi,%eax
+	addl	%ecx,%r11d
+	roll	$30,%r13d
+	addl	%eax,%r11d
+	roll	$1,%edx
+	xorl	8(%rsp),%ebp
+	movl	%r12d,%eax
+	movl	%edx,4(%rsp)
+	movl	%r11d,%ecx
+	xorl	16(%rsp),%ebp
+	xorl	%esi,%eax
+	roll	$5,%ecx
+	xorl	40(%rsp),%ebp
+	leal	1859775393(%rdx,%rdi,1),%edi
+	xorl	%r13d,%eax
+	addl	%ecx,%edi
+	roll	$30,%r12d
+	addl	%eax,%edi
+	roll	$1,%ebp
+	xorl	12(%rsp),%r14d
+	movl	%r11d,%eax
+	movl	%ebp,8(%rsp)
+	movl	%edi,%ecx
+	xorl	20(%rsp),%r14d
+	xorl	%r13d,%eax
+	roll	$5,%ecx
+	xorl	44(%rsp),%r14d
+	leal	1859775393(%rbp,%rsi,1),%esi
+	xorl	%r12d,%eax
+	addl	%ecx,%esi
+	roll	$30,%r11d
+	addl	%eax,%esi
+	roll	$1,%r14d
+	xorl	16(%rsp),%edx
+	movl	%edi,%eax
+	movl	%r14d,12(%rsp)
+	movl	%esi,%ecx
+	xorl	24(%rsp),%edx
+	xorl	%r12d,%eax
+	roll	$5,%ecx
+	xorl	48(%rsp),%edx
+	leal	1859775393(%r14,%r13,1),%r13d
+	xorl	%r11d,%eax
+	addl	%ecx,%r13d
+	roll	$30,%edi
+	addl	%eax,%r13d
+	roll	$1,%edx
+	xorl	20(%rsp),%ebp
+	movl	%esi,%eax
+	movl	%edx,16(%rsp)
+	movl	%r13d,%ecx
+	xorl	28(%rsp),%ebp
+	xorl	%r11d,%eax
+	roll	$5,%ecx
+	xorl	52(%rsp),%ebp
+	leal	1859775393(%rdx,%r12,1),%r12d
+	xorl	%edi,%eax
+	addl	%ecx,%r12d
+	roll	$30,%esi
+	addl	%eax,%r12d
+	roll	$1,%ebp
+	xorl	24(%rsp),%r14d
+	movl	%r13d,%eax
+	movl	%ebp,20(%rsp)
+	movl	%r12d,%ecx
+	xorl	32(%rsp),%r14d
+	xorl	%edi,%eax
+	roll	$5,%ecx
+	xorl	56(%rsp),%r14d
+	leal	1859775393(%rbp,%r11,1),%r11d
+	xorl	%esi,%eax
+	addl	%ecx,%r11d
+	roll	$30,%r13d
+	addl	%eax,%r11d
+	roll	$1,%r14d
+	xorl	28(%rsp),%edx
+	movl	%r12d,%eax
+	movl	%r14d,24(%rsp)
+	movl	%r11d,%ecx
+	xorl	36(%rsp),%edx
+	xorl	%esi,%eax
+	roll	$5,%ecx
+	xorl	60(%rsp),%edx
+	leal	1859775393(%r14,%rdi,1),%edi
+	xorl	%r13d,%eax
+	addl	%ecx,%edi
+	roll	$30,%r12d
+	addl	%eax,%edi
+	roll	$1,%edx
+	xorl	32(%rsp),%ebp
+	movl	%r11d,%eax
+	movl	%edx,28(%rsp)
+	movl	%edi,%ecx
+	xorl	40(%rsp),%ebp
+	xorl	%r13d,%eax
+	roll	$5,%ecx
+	xorl	0(%rsp),%ebp
+	leal	1859775393(%rdx,%rsi,1),%esi
+	xorl	%r12d,%eax
+	addl	%ecx,%esi
+	roll	$30,%r11d
+	addl	%eax,%esi
+	roll	$1,%ebp
+	xorl	36(%rsp),%r14d
+	movl	%r12d,%eax
+	movl	%ebp,32(%rsp)
+	movl	%r12d,%ebx
+	xorl	44(%rsp),%r14d
+	andl	%r11d,%eax
+	movl	%esi,%ecx
+	xorl	4(%rsp),%r14d
+	leal	-1894007588(%rbp,%r13,1),%r13d
+	xorl	%r11d,%ebx
+	roll	$5,%ecx
+	addl	%eax,%r13d
+	roll	$1,%r14d
+	andl	%edi,%ebx
+	addl	%ecx,%r13d
+	roll	$30,%edi
+	addl	%ebx,%r13d
+	xorl	40(%rsp),%edx
+	movl	%r11d,%eax
+	movl	%r14d,36(%rsp)
+	movl	%r11d,%ebx
+	xorl	48(%rsp),%edx
+	andl	%edi,%eax
+	movl	%r13d,%ecx
+	xorl	8(%rsp),%edx
+	leal	-1894007588(%r14,%r12,1),%r12d
+	xorl	%edi,%ebx
+	roll	$5,%ecx
+	addl	%eax,%r12d
+	roll	$1,%edx
+	andl	%esi,%ebx
+	addl	%ecx,%r12d
+	roll	$30,%esi
+	addl	%ebx,%r12d
+	xorl	44(%rsp),%ebp
+	movl	%edi,%eax
+	movl	%edx,40(%rsp)
+	movl	%edi,%ebx
+	xorl	52(%rsp),%ebp
+	andl	%esi,%eax
+	movl	%r12d,%ecx
+	xorl	12(%rsp),%ebp
+	leal	-1894007588(%rdx,%r11,1),%r11d
+	xorl	%esi,%ebx
+	roll	$5,%ecx
+	addl	%eax,%r11d
+	roll	$1,%ebp
+	andl	%r13d,%ebx
+	addl	%ecx,%r11d
+	roll	$30,%r13d
+	addl	%ebx,%r11d
+	xorl	48(%rsp),%r14d
+	movl	%esi,%eax
+	movl	%ebp,44(%rsp)
+	movl	%esi,%ebx
+	xorl	56(%rsp),%r14d
+	andl	%r13d,%eax
+	movl	%r11d,%ecx
+	xorl	16(%rsp),%r14d
+	leal	-1894007588(%rbp,%rdi,1),%edi
+	xorl	%r13d,%ebx
+	roll	$5,%ecx
+	addl	%eax,%edi
+	roll	$1,%r14d
+	andl	%r12d,%ebx
+	addl	%ecx,%edi
+	roll	$30,%r12d
+	addl	%ebx,%edi
+	xorl	52(%rsp),%edx
+	movl	%r13d,%eax
+	movl	%r14d,48(%rsp)
+	movl	%r13d,%ebx
+	xorl	60(%rsp),%edx
+	andl	%r12d,%eax
+	movl	%edi,%ecx
+	xorl	20(%rsp),%edx
+	leal	-1894007588(%r14,%rsi,1),%esi
+	xorl	%r12d,%ebx
+	roll	$5,%ecx
+	addl	%eax,%esi
+	roll	$1,%edx
+	andl	%r11d,%ebx
+	addl	%ecx,%esi
+	roll	$30,%r11d
+	addl	%ebx,%esi
+	xorl	56(%rsp),%ebp
+	movl	%r12d,%eax
+	movl	%edx,52(%rsp)
+	movl	%r12d,%ebx
+	xorl	0(%rsp),%ebp
+	andl	%r11d,%eax
+	movl	%esi,%ecx
+	xorl	24(%rsp),%ebp
+	leal	-1894007588(%rdx,%r13,1),%r13d
+	xorl	%r11d,%ebx
+	roll	$5,%ecx
+	addl	%eax,%r13d
+	roll	$1,%ebp
+	andl	%edi,%ebx
+	addl	%ecx,%r13d
+	roll	$30,%edi
+	addl	%ebx,%r13d
+	xorl	60(%rsp),%r14d
+	movl	%r11d,%eax
+	movl	%ebp,56(%rsp)
+	movl	%r11d,%ebx
+	xorl	4(%rsp),%r14d
+	andl	%edi,%eax
+	movl	%r13d,%ecx
+	xorl	28(%rsp),%r14d
+	leal	-1894007588(%rbp,%r12,1),%r12d
+	xorl	%edi,%ebx
+	roll	$5,%ecx
+	addl	%eax,%r12d
+	roll	$1,%r14d
+	andl	%esi,%ebx
+	addl	%ecx,%r12d
+	roll	$30,%esi
+	addl	%ebx,%r12d
+	xorl	0(%rsp),%edx
+	movl	%edi,%eax
+	movl	%r14d,60(%rsp)
+	movl	%edi,%ebx
+	xorl	8(%rsp),%edx
+	andl	%esi,%eax
+	movl	%r12d,%ecx
+	xorl	32(%rsp),%edx
+	leal	-1894007588(%r14,%r11,1),%r11d
+	xorl	%esi,%ebx
+	roll	$5,%ecx
+	addl	%eax,%r11d
+	roll	$1,%edx
+	andl	%r13d,%ebx
+	addl	%ecx,%r11d
+	roll	$30,%r13d
+	addl	%ebx,%r11d
+	xorl	4(%rsp),%ebp
+	movl	%esi,%eax
+	movl	%edx,0(%rsp)
+	movl	%esi,%ebx
+	xorl	12(%rsp),%ebp
+	andl	%r13d,%eax
+	movl	%r11d,%ecx
+	xorl	36(%rsp),%ebp
+	leal	-1894007588(%rdx,%rdi,1),%edi
+	xorl	%r13d,%ebx
+	roll	$5,%ecx
+	addl	%eax,%edi
+	roll	$1,%ebp
+	andl	%r12d,%ebx
+	addl	%ecx,%edi
+	roll	$30,%r12d
+	addl	%ebx,%edi
+	xorl	8(%rsp),%r14d
+	movl	%r13d,%eax
+	movl	%ebp,4(%rsp)
+	movl	%r13d,%ebx
+	xorl	16(%rsp),%r14d
+	andl	%r12d,%eax
+	movl	%edi,%ecx
+	xorl	40(%rsp),%r14d
+	leal	-1894007588(%rbp,%rsi,1),%esi
+	xorl	%r12d,%ebx
+	roll	$5,%ecx
+	addl	%eax,%esi
+	roll	$1,%r14d
+	andl	%r11d,%ebx
+	addl	%ecx,%esi
+	roll	$30,%r11d
+	addl	%ebx,%esi
+	xorl	12(%rsp),%edx
+	movl	%r12d,%eax
+	movl	%r14d,8(%rsp)
+	movl	%r12d,%ebx
+	xorl	20(%rsp),%edx
+	andl	%r11d,%eax
+	movl	%esi,%ecx
+	xorl	44(%rsp),%edx
+	leal	-1894007588(%r14,%r13,1),%r13d
+	xorl	%r11d,%ebx
+	roll	$5,%ecx
+	addl	%eax,%r13d
+	roll	$1,%edx
+	andl	%edi,%ebx
+	addl	%ecx,%r13d
+	roll	$30,%edi
+	addl	%ebx,%r13d
+	xorl	16(%rsp),%ebp
+	movl	%r11d,%eax
+	movl	%edx,12(%rsp)
+	movl	%r11d,%ebx
+	xorl	24(%rsp),%ebp
+	andl	%edi,%eax
+	movl	%r13d,%ecx
+	xorl	48(%rsp),%ebp
+	leal	-1894007588(%rdx,%r12,1),%r12d
+	xorl	%edi,%ebx
+	roll	$5,%ecx
+	addl	%eax,%r12d
+	roll	$1,%ebp
+	andl	%esi,%ebx
+	addl	%ecx,%r12d
+	roll	$30,%esi
+	addl	%ebx,%r12d
+	xorl	20(%rsp),%r14d
+	movl	%edi,%eax
+	movl	%ebp,16(%rsp)
+	movl	%edi,%ebx
+	xorl	28(%rsp),%r14d
+	andl	%esi,%eax
+	movl	%r12d,%ecx
+	xorl	52(%rsp),%r14d
+	leal	-1894007588(%rbp,%r11,1),%r11d
+	xorl	%esi,%ebx
+	roll	$5,%ecx
+	addl	%eax,%r11d
+	roll	$1,%r14d
+	andl	%r13d,%ebx
+	addl	%ecx,%r11d
+	roll	$30,%r13d
+	addl	%ebx,%r11d
+	xorl	24(%rsp),%edx
+	movl	%esi,%eax
+	movl	%r14d,20(%rsp)
+	movl	%esi,%ebx
+	xorl	32(%rsp),%edx
+	andl	%r13d,%eax
+	movl	%r11d,%ecx
+	xorl	56(%rsp),%edx
+	leal	-1894007588(%r14,%rdi,1),%edi
+	xorl	%r13d,%ebx
+	roll	$5,%ecx
+	addl	%eax,%edi
+	roll	$1,%edx
+	andl	%r12d,%ebx
+	addl	%ecx,%edi
+	roll	$30,%r12d
+	addl	%ebx,%edi
+	xorl	28(%rsp),%ebp
+	movl	%r13d,%eax
+	movl	%edx,24(%rsp)
+	movl	%r13d,%ebx
+	xorl	36(%rsp),%ebp
+	andl	%r12d,%eax
+	movl	%edi,%ecx
+	xorl	60(%rsp),%ebp
+	leal	-1894007588(%rdx,%rsi,1),%esi
+	xorl	%r12d,%ebx
+	roll	$5,%ecx
+	addl	%eax,%esi
+	roll	$1,%ebp
+	andl	%r11d,%ebx
+	addl	%ecx,%esi
+	roll	$30,%r11d
+	addl	%ebx,%esi
+	xorl	32(%rsp),%r14d
+	movl	%r12d,%eax
+	movl	%ebp,28(%rsp)
+	movl	%r12d,%ebx
+	xorl	40(%rsp),%r14d
+	andl	%r11d,%eax
+	movl	%esi,%ecx
+	xorl	0(%rsp),%r14d
+	leal	-1894007588(%rbp,%r13,1),%r13d
+	xorl	%r11d,%ebx
+	roll	$5,%ecx
+	addl	%eax,%r13d
+	roll	$1,%r14d
+	andl	%edi,%ebx
+	addl	%ecx,%r13d
+	roll	$30,%edi
+	addl	%ebx,%r13d
+	xorl	36(%rsp),%edx
+	movl	%r11d,%eax
+	movl	%r14d,32(%rsp)
+	movl	%r11d,%ebx
+	xorl	44(%rsp),%edx
+	andl	%edi,%eax
+	movl	%r13d,%ecx
+	xorl	4(%rsp),%edx
+	leal	-1894007588(%r14,%r12,1),%r12d
+	xorl	%edi,%ebx
+	roll	$5,%ecx
+	addl	%eax,%r12d
+	roll	$1,%edx
+	andl	%esi,%ebx
+	addl	%ecx,%r12d
+	roll	$30,%esi
+	addl	%ebx,%r12d
+	xorl	40(%rsp),%ebp
+	movl	%edi,%eax
+	movl	%edx,36(%rsp)
+	movl	%edi,%ebx
+	xorl	48(%rsp),%ebp
+	andl	%esi,%eax
+	movl	%r12d,%ecx
+	xorl	8(%rsp),%ebp
+	leal	-1894007588(%rdx,%r11,1),%r11d
+	xorl	%esi,%ebx
+	roll	$5,%ecx
+	addl	%eax,%r11d
+	roll	$1,%ebp
+	andl	%r13d,%ebx
+	addl	%ecx,%r11d
+	roll	$30,%r13d
+	addl	%ebx,%r11d
+	xorl	44(%rsp),%r14d
+	movl	%esi,%eax
+	movl	%ebp,40(%rsp)
+	movl	%esi,%ebx
+	xorl	52(%rsp),%r14d
+	andl	%r13d,%eax
+	movl	%r11d,%ecx
+	xorl	12(%rsp),%r14d
+	leal	-1894007588(%rbp,%rdi,1),%edi
+	xorl	%r13d,%ebx
+	roll	$5,%ecx
+	addl	%eax,%edi
+	roll	$1,%r14d
+	andl	%r12d,%ebx
+	addl	%ecx,%edi
+	roll	$30,%r12d
+	addl	%ebx,%edi
+	xorl	48(%rsp),%edx
+	movl	%r13d,%eax
+	movl	%r14d,44(%rsp)
+	movl	%r13d,%ebx
+	xorl	56(%rsp),%edx
+	andl	%r12d,%eax
+	movl	%edi,%ecx
+	xorl	16(%rsp),%edx
+	leal	-1894007588(%r14,%rsi,1),%esi
+	xorl	%r12d,%ebx
+	roll	$5,%ecx
+	addl	%eax,%esi
+	roll	$1,%edx
+	andl	%r11d,%ebx
+	addl	%ecx,%esi
+	roll	$30,%r11d
+	addl	%ebx,%esi
+	xorl	52(%rsp),%ebp
+	movl	%edi,%eax
+	movl	%edx,48(%rsp)
+	movl	%esi,%ecx
+	xorl	60(%rsp),%ebp
+	xorl	%r12d,%eax
+	roll	$5,%ecx
+	xorl	20(%rsp),%ebp
+	leal	-899497514(%rdx,%r13,1),%r13d
+	xorl	%r11d,%eax
+	addl	%ecx,%r13d
+	roll	$30,%edi
+	addl	%eax,%r13d
+	roll	$1,%ebp
+	xorl	56(%rsp),%r14d
+	movl	%esi,%eax
+	movl	%ebp,52(%rsp)
+	movl	%r13d,%ecx
+	xorl	0(%rsp),%r14d
+	xorl	%r11d,%eax
+	roll	$5,%ecx
+	xorl	24(%rsp),%r14d
+	leal	-899497514(%rbp,%r12,1),%r12d
+	xorl	%edi,%eax
+	addl	%ecx,%r12d
+	roll	$30,%esi
+	addl	%eax,%r12d
+	roll	$1,%r14d
+	xorl	60(%rsp),%edx
+	movl	%r13d,%eax
+	movl	%r14d,56(%rsp)
+	movl	%r12d,%ecx
+	xorl	4(%rsp),%edx
+	xorl	%edi,%eax
+	roll	$5,%ecx
+	xorl	28(%rsp),%edx
+	leal	-899497514(%r14,%r11,1),%r11d
+	xorl	%esi,%eax
+	addl	%ecx,%r11d
+	roll	$30,%r13d
+	addl	%eax,%r11d
+	roll	$1,%edx
+	xorl	0(%rsp),%ebp
+	movl	%r12d,%eax
+	movl	%edx,60(%rsp)
+	movl	%r11d,%ecx
+	xorl	8(%rsp),%ebp
+	xorl	%esi,%eax
+	roll	$5,%ecx
+	xorl	32(%rsp),%ebp
+	leal	-899497514(%rdx,%rdi,1),%edi
+	xorl	%r13d,%eax
+	addl	%ecx,%edi
+	roll	$30,%r12d
+	addl	%eax,%edi
+	roll	$1,%ebp
+	xorl	4(%rsp),%r14d
+	movl	%r11d,%eax
+	movl	%ebp,0(%rsp)
+	movl	%edi,%ecx
+	xorl	12(%rsp),%r14d
+	xorl	%r13d,%eax
+	roll	$5,%ecx
+	xorl	36(%rsp),%r14d
+	leal	-899497514(%rbp,%rsi,1),%esi
+	xorl	%r12d,%eax
+	addl	%ecx,%esi
+	roll	$30,%r11d
+	addl	%eax,%esi
+	roll	$1,%r14d
+	xorl	8(%rsp),%edx
+	movl	%edi,%eax
+	movl	%r14d,4(%rsp)
+	movl	%esi,%ecx
+	xorl	16(%rsp),%edx
+	xorl	%r12d,%eax
+	roll	$5,%ecx
+	xorl	40(%rsp),%edx
+	leal	-899497514(%r14,%r13,1),%r13d
+	xorl	%r11d,%eax
+	addl	%ecx,%r13d
+	roll	$30,%edi
+	addl	%eax,%r13d
+	roll	$1,%edx
+	xorl	12(%rsp),%ebp
+	movl	%esi,%eax
+	movl	%edx,8(%rsp)
+	movl	%r13d,%ecx
+	xorl	20(%rsp),%ebp
+	xorl	%r11d,%eax
+	roll	$5,%ecx
+	xorl	44(%rsp),%ebp
+	leal	-899497514(%rdx,%r12,1),%r12d
+	xorl	%edi,%eax
+	addl	%ecx,%r12d
+	roll	$30,%esi
+	addl	%eax,%r12d
+	roll	$1,%ebp
+	xorl	16(%rsp),%r14d
+	movl	%r13d,%eax
+	movl	%ebp,12(%rsp)
+	movl	%r12d,%ecx
+	xorl	24(%rsp),%r14d
+	xorl	%edi,%eax
+	roll	$5,%ecx
+	xorl	48(%rsp),%r14d
+	leal	-899497514(%rbp,%r11,1),%r11d
+	xorl	%esi,%eax
+	addl	%ecx,%r11d
+	roll	$30,%r13d
+	addl	%eax,%r11d
+	roll	$1,%r14d
+	xorl	20(%rsp),%edx
+	movl	%r12d,%eax
+	movl	%r14d,16(%rsp)
+	movl	%r11d,%ecx
+	xorl	28(%rsp),%edx
+	xorl	%esi,%eax
+	roll	$5,%ecx
+	xorl	52(%rsp),%edx
+	leal	-899497514(%r14,%rdi,1),%edi
+	xorl	%r13d,%eax
+	addl	%ecx,%edi
+	roll	$30,%r12d
+	addl	%eax,%edi
+	roll	$1,%edx
+	xorl	24(%rsp),%ebp
+	movl	%r11d,%eax
+	movl	%edx,20(%rsp)
+	movl	%edi,%ecx
+	xorl	32(%rsp),%ebp
+	xorl	%r13d,%eax
+	roll	$5,%ecx
+	xorl	56(%rsp),%ebp
+	leal	-899497514(%rdx,%rsi,1),%esi
+	xorl	%r12d,%eax
+	addl	%ecx,%esi
+	roll	$30,%r11d
+	addl	%eax,%esi
+	roll	$1,%ebp
+	xorl	28(%rsp),%r14d
+	movl	%edi,%eax
+	movl	%ebp,24(%rsp)
+	movl	%esi,%ecx
+	xorl	36(%rsp),%r14d
+	xorl	%r12d,%eax
+	roll	$5,%ecx
+	xorl	60(%rsp),%r14d
+	leal	-899497514(%rbp,%r13,1),%r13d
+	xorl	%r11d,%eax
+	addl	%ecx,%r13d
+	roll	$30,%edi
+	addl	%eax,%r13d
+	roll	$1,%r14d
+	xorl	32(%rsp),%edx
+	movl	%esi,%eax
+	movl	%r14d,28(%rsp)
+	movl	%r13d,%ecx
+	xorl	40(%rsp),%edx
+	xorl	%r11d,%eax
+	roll	$5,%ecx
+	xorl	0(%rsp),%edx
+	leal	-899497514(%r14,%r12,1),%r12d
+	xorl	%edi,%eax
+	addl	%ecx,%r12d
+	roll	$30,%esi
+	addl	%eax,%r12d
+	roll	$1,%edx
+	xorl	36(%rsp),%ebp
+	movl	%r13d,%eax
+
+	movl	%r12d,%ecx
+	xorl	44(%rsp),%ebp
+	xorl	%edi,%eax
+	roll	$5,%ecx
+	xorl	4(%rsp),%ebp
+	leal	-899497514(%rdx,%r11,1),%r11d
+	xorl	%esi,%eax
+	addl	%ecx,%r11d
+	roll	$30,%r13d
+	addl	%eax,%r11d
+	roll	$1,%ebp
+	xorl	40(%rsp),%r14d
+	movl	%r12d,%eax
+
+	movl	%r11d,%ecx
+	xorl	48(%rsp),%r14d
+	xorl	%esi,%eax
+	roll	$5,%ecx
+	xorl	8(%rsp),%r14d
+	leal	-899497514(%rbp,%rdi,1),%edi
+	xorl	%r13d,%eax
+	addl	%ecx,%edi
+	roll	$30,%r12d
+	addl	%eax,%edi
+	roll	$1,%r14d
+	xorl	44(%rsp),%edx
+	movl	%r11d,%eax
+
+	movl	%edi,%ecx
+	xorl	52(%rsp),%edx
+	xorl	%r13d,%eax
+	roll	$5,%ecx
+	xorl	12(%rsp),%edx
+	leal	-899497514(%r14,%rsi,1),%esi
+	xorl	%r12d,%eax
+	addl	%ecx,%esi
+	roll	$30,%r11d
+	addl	%eax,%esi
+	roll	$1,%edx
+	xorl	48(%rsp),%ebp
+	movl	%edi,%eax
+
+	movl	%esi,%ecx
+	xorl	56(%rsp),%ebp
+	xorl	%r12d,%eax
+	roll	$5,%ecx
+	xorl	16(%rsp),%ebp
+	leal	-899497514(%rdx,%r13,1),%r13d
+	xorl	%r11d,%eax
+	addl	%ecx,%r13d
+	roll	$30,%edi
+	addl	%eax,%r13d
+	roll	$1,%ebp
+	xorl	52(%rsp),%r14d
+	movl	%esi,%eax
+
+	movl	%r13d,%ecx
+	xorl	60(%rsp),%r14d
+	xorl	%r11d,%eax
+	roll	$5,%ecx
+	xorl	20(%rsp),%r14d
+	leal	-899497514(%rbp,%r12,1),%r12d
+	xorl	%edi,%eax
+	addl	%ecx,%r12d
+	roll	$30,%esi
+	addl	%eax,%r12d
+	roll	$1,%r14d
+	xorl	56(%rsp),%edx
+	movl	%r13d,%eax
+
+	movl	%r12d,%ecx
+	xorl	0(%rsp),%edx
+	xorl	%edi,%eax
+	roll	$5,%ecx
+	xorl	24(%rsp),%edx
+	leal	-899497514(%r14,%r11,1),%r11d
+	xorl	%esi,%eax
+	addl	%ecx,%r11d
+	roll	$30,%r13d
+	addl	%eax,%r11d
+	roll	$1,%edx
+	xorl	60(%rsp),%ebp
+	movl	%r12d,%eax
+
+	movl	%r11d,%ecx
+	xorl	4(%rsp),%ebp
+	xorl	%esi,%eax
+	roll	$5,%ecx
+	xorl	28(%rsp),%ebp
+	leal	-899497514(%rdx,%rdi,1),%edi
+	xorl	%r13d,%eax
+	addl	%ecx,%edi
+	roll	$30,%r12d
+	addl	%eax,%edi
+	roll	$1,%ebp
+	movl	%r11d,%eax
+	movl	%edi,%ecx
+	xorl	%r13d,%eax
+	leal	-899497514(%rbp,%rsi,1),%esi
+	roll	$5,%ecx
+	xorl	%r12d,%eax
+	addl	%ecx,%esi
+	roll	$30,%r11d
+	addl	%eax,%esi
+	addl	0(%r8),%esi
+	addl	4(%r8),%edi
+	addl	8(%r8),%r11d
+	addl	12(%r8),%r12d
+	addl	16(%r8),%r13d
+	movl	%esi,0(%r8)
+	movl	%edi,4(%r8)
+	movl	%r11d,8(%r8)
+	movl	%r12d,12(%r8)
+	movl	%r13d,16(%r8)
+
+	subq	$1,%r10
+	leaq	64(%r9),%r9
+	jnz	L$loop
+
+	movq	64(%rsp),%rsi
+	movq	-40(%rsi),%r14
+	movq	-32(%rsi),%r13
+	movq	-24(%rsi),%r12
+	movq	-16(%rsi),%rbp
+	movq	-8(%rsi),%rbx
+	leaq	(%rsi),%rsp
+L$epilogue:
+	.byte	0xf3,0xc3
+
+
+.p2align	4
+sha1_block_data_order_ssse3:
+_ssse3_shortcut:
+	movq	%rsp,%rax
+	pushq	%rbx
+	pushq	%rbp
+	pushq	%r12
+	pushq	%r13
+	pushq	%r14
+	leaq	-64(%rsp),%rsp
+	movq	%rax,%r14
+	andq	$-64,%rsp
+	movq	%rdi,%r8
+	movq	%rsi,%r9
+	movq	%rdx,%r10
+
+	shlq	$6,%r10
+	addq	%r9,%r10
+	leaq	K_XX_XX+64(%rip),%r11
+
+	movl	0(%r8),%eax
+	movl	4(%r8),%ebx
+	movl	8(%r8),%ecx
+	movl	12(%r8),%edx
+	movl	%ebx,%esi
+	movl	16(%r8),%ebp
+	movl	%ecx,%edi
+	xorl	%edx,%edi
+	andl	%edi,%esi
+
+	movdqa	64(%r11),%xmm6
+	movdqa	-64(%r11),%xmm9
+	movdqu	0(%r9),%xmm0
+	movdqu	16(%r9),%xmm1
+	movdqu	32(%r9),%xmm2
+	movdqu	48(%r9),%xmm3
+.byte	102,15,56,0,198
+.byte	102,15,56,0,206
+.byte	102,15,56,0,214
+	addq	$64,%r9
+	paddd	%xmm9,%xmm0
+.byte	102,15,56,0,222
+	paddd	%xmm9,%xmm1
+	paddd	%xmm9,%xmm2
+	movdqa	%xmm0,0(%rsp)
+	psubd	%xmm9,%xmm0
+	movdqa	%xmm1,16(%rsp)
+	psubd	%xmm9,%xmm1
+	movdqa	%xmm2,32(%rsp)
+	psubd	%xmm9,%xmm2
+	jmp	L$oop_ssse3
+.p2align	4
+L$oop_ssse3:
+	rorl	$2,%ebx
+	pshufd	$238,%xmm0,%xmm4
+	xorl	%edx,%esi
+	movdqa	%xmm3,%xmm8
+	paddd	%xmm3,%xmm9
+	movl	%eax,%edi
+	addl	0(%rsp),%ebp
+	punpcklqdq	%xmm1,%xmm4
+	xorl	%ecx,%ebx
+	roll	$5,%eax
+	addl	%esi,%ebp
+	psrldq	$4,%xmm8
+	andl	%ebx,%edi
+	xorl	%ecx,%ebx
+	pxor	%xmm0,%xmm4
+	addl	%eax,%ebp
+	rorl	$7,%eax
+	pxor	%xmm2,%xmm8
+	xorl	%ecx,%edi
+	movl	%ebp,%esi
+	addl	4(%rsp),%edx
+	pxor	%xmm8,%xmm4
+	xorl	%ebx,%eax
+	roll	$5,%ebp
+	movdqa	%xmm9,48(%rsp)
+	addl	%edi,%edx
+	andl	%eax,%esi
+	movdqa	%xmm4,%xmm10
+	xorl	%ebx,%eax
+	addl	%ebp,%edx
+	rorl	$7,%ebp
+	movdqa	%xmm4,%xmm8
+	xorl	%ebx,%esi
+	pslldq	$12,%xmm10
+	paddd	%xmm4,%xmm4
+	movl	%edx,%edi
+	addl	8(%rsp),%ecx
+	psrld	$31,%xmm8
+	xorl	%eax,%ebp
+	roll	$5,%edx
+	addl	%esi,%ecx
+	movdqa	%xmm10,%xmm9
+	andl	%ebp,%edi
+	xorl	%eax,%ebp
+	psrld	$30,%xmm10
+	addl	%edx,%ecx
+	rorl	$7,%edx
+	por	%xmm8,%xmm4
+	xorl	%eax,%edi
+	movl	%ecx,%esi
+	addl	12(%rsp),%ebx
+	pslld	$2,%xmm9
+	pxor	%xmm10,%xmm4
+	xorl	%ebp,%edx
+	movdqa	-64(%r11),%xmm10
+	roll	$5,%ecx
+	addl	%edi,%ebx
+	andl	%edx,%esi
+	pxor	%xmm9,%xmm4
+	xorl	%ebp,%edx
+	addl	%ecx,%ebx
+	rorl	$7,%ecx
+	pshufd	$238,%xmm1,%xmm5
+	xorl	%ebp,%esi
+	movdqa	%xmm4,%xmm9
+	paddd	%xmm4,%xmm10
+	movl	%ebx,%edi
+	addl	16(%rsp),%eax
+	punpcklqdq	%xmm2,%xmm5
+	xorl	%edx,%ecx
+	roll	$5,%ebx
+	addl	%esi,%eax
+	psrldq	$4,%xmm9
+	andl	%ecx,%edi
+	xorl	%edx,%ecx
+	pxor	%xmm1,%xmm5
+	addl	%ebx,%eax
+	rorl	$7,%ebx
+	pxor	%xmm3,%xmm9
+	xorl	%edx,%edi
+	movl	%eax,%esi
+	addl	20(%rsp),%ebp
+	pxor	%xmm9,%xmm5
+	xorl	%ecx,%ebx
+	roll	$5,%eax
+	movdqa	%xmm10,0(%rsp)
+	addl	%edi,%ebp
+	andl	%ebx,%esi
+	movdqa	%xmm5,%xmm8
+	xorl	%ecx,%ebx
+	addl	%eax,%ebp
+	rorl	$7,%eax
+	movdqa	%xmm5,%xmm9
+	xorl	%ecx,%esi
+	pslldq	$12,%xmm8
+	paddd	%xmm5,%xmm5
+	movl	%ebp,%edi
+	addl	24(%rsp),%edx
+	psrld	$31,%xmm9
+	xorl	%ebx,%eax
+	roll	$5,%ebp
+	addl	%esi,%edx
+	movdqa	%xmm8,%xmm10
+	andl	%eax,%edi
+	xorl	%ebx,%eax
+	psrld	$30,%xmm8
+	addl	%ebp,%edx
+	rorl	$7,%ebp
+	por	%xmm9,%xmm5
+	xorl	%ebx,%edi
+	movl	%edx,%esi
+	addl	28(%rsp),%ecx
+	pslld	$2,%xmm10
+	pxor	%xmm8,%xmm5
+	xorl	%eax,%ebp
+	movdqa	-32(%r11),%xmm8
+	roll	$5,%edx
+	addl	%edi,%ecx
+	andl	%ebp,%esi
+	pxor	%xmm10,%xmm5
+	xorl	%eax,%ebp
+	addl	%edx,%ecx
+	rorl	$7,%edx
+	pshufd	$238,%xmm2,%xmm6
+	xorl	%eax,%esi
+	movdqa	%xmm5,%xmm10
+	paddd	%xmm5,%xmm8
+	movl	%ecx,%edi
+	addl	32(%rsp),%ebx
+	punpcklqdq	%xmm3,%xmm6
+	xorl	%ebp,%edx
+	roll	$5,%ecx
+	addl	%esi,%ebx
+	psrldq	$4,%xmm10
+	andl	%edx,%edi
+	xorl	%ebp,%edx
+	pxor	%xmm2,%xmm6
+	addl	%ecx,%ebx
+	rorl	$7,%ecx
+	pxor	%xmm4,%xmm10
+	xorl	%ebp,%edi
+	movl	%ebx,%esi
+	addl	36(%rsp),%eax
+	pxor	%xmm10,%xmm6
+	xorl	%edx,%ecx
+	roll	$5,%ebx
+	movdqa	%xmm8,16(%rsp)
+	addl	%edi,%eax
+	andl	%ecx,%esi
+	movdqa	%xmm6,%xmm9
+	xorl	%edx,%ecx
+	addl	%ebx,%eax
+	rorl	$7,%ebx
+	movdqa	%xmm6,%xmm10
+	xorl	%edx,%esi
+	pslldq	$12,%xmm9
+	paddd	%xmm6,%xmm6
+	movl	%eax,%edi
+	addl	40(%rsp),%ebp
+	psrld	$31,%xmm10
+	xorl	%ecx,%ebx
+	roll	$5,%eax
+	addl	%esi,%ebp
+	movdqa	%xmm9,%xmm8
+	andl	%ebx,%edi
+	xorl	%ecx,%ebx
+	psrld	$30,%xmm9
+	addl	%eax,%ebp
+	rorl	$7,%eax
+	por	%xmm10,%xmm6
+	xorl	%ecx,%edi
+	movl	%ebp,%esi
+	addl	44(%rsp),%edx
+	pslld	$2,%xmm8
+	pxor	%xmm9,%xmm6
+	xorl	%ebx,%eax
+	movdqa	-32(%r11),%xmm9
+	roll	$5,%ebp
+	addl	%edi,%edx
+	andl	%eax,%esi
+	pxor	%xmm8,%xmm6
+	xorl	%ebx,%eax
+	addl	%ebp,%edx
+	rorl	$7,%ebp
+	pshufd	$238,%xmm3,%xmm7
+	xorl	%ebx,%esi
+	movdqa	%xmm6,%xmm8
+	paddd	%xmm6,%xmm9
+	movl	%edx,%edi
+	addl	48(%rsp),%ecx
+	punpcklqdq	%xmm4,%xmm7
+	xorl	%eax,%ebp
+	roll	$5,%edx
+	addl	%esi,%ecx
+	psrldq	$4,%xmm8
+	andl	%ebp,%edi
+	xorl	%eax,%ebp
+	pxor	%xmm3,%xmm7
+	addl	%edx,%ecx
+	rorl	$7,%edx
+	pxor	%xmm5,%xmm8
+	xorl	%eax,%edi
+	movl	%ecx,%esi
+	addl	52(%rsp),%ebx
+	pxor	%xmm8,%xmm7
+	xorl	%ebp,%edx
+	roll	$5,%ecx
+	movdqa	%xmm9,32(%rsp)
+	addl	%edi,%ebx
+	andl	%edx,%esi
+	movdqa	%xmm7,%xmm10
+	xorl	%ebp,%edx
+	addl	%ecx,%ebx
+	rorl	$7,%ecx
+	movdqa	%xmm7,%xmm8
+	xorl	%ebp,%esi
+	pslldq	$12,%xmm10
+	paddd	%xmm7,%xmm7
+	movl	%ebx,%edi
+	addl	56(%rsp),%eax
+	psrld	$31,%xmm8
+	xorl	%edx,%ecx
+	roll	$5,%ebx
+	addl	%esi,%eax
+	movdqa	%xmm10,%xmm9
+	andl	%ecx,%edi
+	xorl	%edx,%ecx
+	psrld	$30,%xmm10
+	addl	%ebx,%eax
+	rorl	$7,%ebx
+	por	%xmm8,%xmm7
+	xorl	%edx,%edi
+	movl	%eax,%esi
+	addl	60(%rsp),%ebp
+	pslld	$2,%xmm9
+	pxor	%xmm10,%xmm7
+	xorl	%ecx,%ebx
+	movdqa	-32(%r11),%xmm10
+	roll	$5,%eax
+	addl	%edi,%ebp
+	andl	%ebx,%esi
+	pxor	%xmm9,%xmm7
+	pshufd	$238,%xmm6,%xmm9
+	xorl	%ecx,%ebx
+	addl	%eax,%ebp
+	rorl	$7,%eax
+	pxor	%xmm4,%xmm0
+	xorl	%ecx,%esi
+	movl	%ebp,%edi
+	addl	0(%rsp),%edx
+	punpcklqdq	%xmm7,%xmm9
+	xorl	%ebx,%eax
+	roll	$5,%ebp
+	pxor	%xmm1,%xmm0
+	addl	%esi,%edx
+	andl	%eax,%edi
+	movdqa	%xmm10,%xmm8
+	xorl	%ebx,%eax
+	paddd	%xmm7,%xmm10
+	addl	%ebp,%edx
+	pxor	%xmm9,%xmm0
+	rorl	$7,%ebp
+	xorl	%ebx,%edi
+	movl	%edx,%esi
+	addl	4(%rsp),%ecx
+	movdqa	%xmm0,%xmm9
+	xorl	%eax,%ebp
+	roll	$5,%edx
+	movdqa	%xmm10,48(%rsp)
+	addl	%edi,%ecx
+	andl	%ebp,%esi
+	xorl	%eax,%ebp
+	pslld	$2,%xmm0
+	addl	%edx,%ecx
+	rorl	$7,%edx
+	psrld	$30,%xmm9
+	xorl	%eax,%esi
+	movl	%ecx,%edi
+	addl	8(%rsp),%ebx
+	por	%xmm9,%xmm0
+	xorl	%ebp,%edx
+	roll	$5,%ecx
+	pshufd	$238,%xmm7,%xmm10
+	addl	%esi,%ebx
+	andl	%edx,%edi
+	xorl	%ebp,%edx
+	addl	%ecx,%ebx
+	addl	12(%rsp),%eax
+	xorl	%ebp,%edi
+	movl	%ebx,%esi
+	roll	$5,%ebx
+	addl	%edi,%eax
+	xorl	%edx,%esi
+	rorl	$7,%ecx
+	addl	%ebx,%eax
+	pxor	%xmm5,%xmm1
+	addl	16(%rsp),%ebp
+	xorl	%ecx,%esi
+	punpcklqdq	%xmm0,%xmm10
+	movl	%eax,%edi
+	roll	$5,%eax
+	pxor	%xmm2,%xmm1
+	addl	%esi,%ebp
+	xorl	%ecx,%edi
+	movdqa	%xmm8,%xmm9
+	rorl	$7,%ebx
+	paddd	%xmm0,%xmm8
+	addl	%eax,%ebp
+	pxor	%xmm10,%xmm1
+	addl	20(%rsp),%edx
+	xorl	%ebx,%edi
+	movl	%ebp,%esi
+	roll	$5,%ebp
+	movdqa	%xmm1,%xmm10
+	addl	%edi,%edx
+	xorl	%ebx,%esi
+	movdqa	%xmm8,0(%rsp)
+	rorl	$7,%eax
+	addl	%ebp,%edx
+	addl	24(%rsp),%ecx
+	pslld	$2,%xmm1
+	xorl	%eax,%esi
+	movl	%edx,%edi
+	psrld	$30,%xmm10
+	roll	$5,%edx
+	addl	%esi,%ecx
+	xorl	%eax,%edi
+	rorl	$7,%ebp
+	por	%xmm10,%xmm1
+	addl	%edx,%ecx
+	addl	28(%rsp),%ebx
+	pshufd	$238,%xmm0,%xmm8
+	xorl	%ebp,%edi
+	movl	%ecx,%esi
+	roll	$5,%ecx
+	addl	%edi,%ebx
+	xorl	%ebp,%esi
+	rorl	$7,%edx
+	addl	%ecx,%ebx
+	pxor	%xmm6,%xmm2
+	addl	32(%rsp),%eax
+	xorl	%edx,%esi
+	punpcklqdq	%xmm1,%xmm8
+	movl	%ebx,%edi
+	roll	$5,%ebx
+	pxor	%xmm3,%xmm2
+	addl	%esi,%eax
+	xorl	%edx,%edi
+	movdqa	0(%r11),%xmm10
+	rorl	$7,%ecx
+	paddd	%xmm1,%xmm9
+	addl	%ebx,%eax
+	pxor	%xmm8,%xmm2
+	addl	36(%rsp),%ebp
+	xorl	%ecx,%edi
+	movl	%eax,%esi
+	roll	$5,%eax
+	movdqa	%xmm2,%xmm8
+	addl	%edi,%ebp
+	xorl	%ecx,%esi
+	movdqa	%xmm9,16(%rsp)
+	rorl	$7,%ebx
+	addl	%eax,%ebp
+	addl	40(%rsp),%edx
+	pslld	$2,%xmm2
+	xorl	%ebx,%esi
+	movl	%ebp,%edi
+	psrld	$30,%xmm8
+	roll	$5,%ebp
+	addl	%esi,%edx
+	xorl	%ebx,%edi
+	rorl	$7,%eax
+	por	%xmm8,%xmm2
+	addl	%ebp,%edx
+	addl	44(%rsp),%ecx
+	pshufd	$238,%xmm1,%xmm9
+	xorl	%eax,%edi
+	movl	%edx,%esi
+	roll	$5,%edx
+	addl	%edi,%ecx
+	xorl	%eax,%esi
+	rorl	$7,%ebp
+	addl	%edx,%ecx
+	pxor	%xmm7,%xmm3
+	addl	48(%rsp),%ebx
+	xorl	%ebp,%esi
+	punpcklqdq	%xmm2,%xmm9
+	movl	%ecx,%edi
+	roll	$5,%ecx
+	pxor	%xmm4,%xmm3
+	addl	%esi,%ebx
+	xorl	%ebp,%edi
+	movdqa	%xmm10,%xmm8
+	rorl	$7,%edx
+	paddd	%xmm2,%xmm10
+	addl	%ecx,%ebx
+	pxor	%xmm9,%xmm3
+	addl	52(%rsp),%eax
+	xorl	%edx,%edi
+	movl	%ebx,%esi
+	roll	$5,%ebx
+	movdqa	%xmm3,%xmm9
+	addl	%edi,%eax
+	xorl	%edx,%esi
+	movdqa	%xmm10,32(%rsp)
+	rorl	$7,%ecx
+	addl	%ebx,%eax
+	addl	56(%rsp),%ebp
+	pslld	$2,%xmm3
+	xorl	%ecx,%esi
+	movl	%eax,%edi
+	psrld	$30,%xmm9
+	roll	$5,%eax
+	addl	%esi,%ebp
+	xorl	%ecx,%edi
+	rorl	$7,%ebx
+	por	%xmm9,%xmm3
+	addl	%eax,%ebp
+	addl	60(%rsp),%edx
+	pshufd	$238,%xmm2,%xmm10
+	xorl	%ebx,%edi
+	movl	%ebp,%esi
+	roll	$5,%ebp
+	addl	%edi,%edx
+	xorl	%ebx,%esi
+	rorl	$7,%eax
+	addl	%ebp,%edx
+	pxor	%xmm0,%xmm4
+	addl	0(%rsp),%ecx
+	xorl	%eax,%esi
+	punpcklqdq	%xmm3,%xmm10
+	movl	%edx,%edi
+	roll	$5,%edx
+	pxor	%xmm5,%xmm4
+	addl	%esi,%ecx
+	xorl	%eax,%edi
+	movdqa	%xmm8,%xmm9
+	rorl	$7,%ebp
+	paddd	%xmm3,%xmm8
+	addl	%edx,%ecx
+	pxor	%xmm10,%xmm4
+	addl	4(%rsp),%ebx
+	xorl	%ebp,%edi
+	movl	%ecx,%esi
+	roll	$5,%ecx
+	movdqa	%xmm4,%xmm10
+	addl	%edi,%ebx
+	xorl	%ebp,%esi
+	movdqa	%xmm8,48(%rsp)
+	rorl	$7,%edx
+	addl	%ecx,%ebx
+	addl	8(%rsp),%eax
+	pslld	$2,%xmm4
+	xorl	%edx,%esi
+	movl	%ebx,%edi
+	psrld	$30,%xmm10
+	roll	$5,%ebx
+	addl	%esi,%eax
+	xorl	%edx,%edi
+	rorl	$7,%ecx
+	por	%xmm10,%xmm4
+	addl	%ebx,%eax
+	addl	12(%rsp),%ebp
+	pshufd	$238,%xmm3,%xmm8
+	xorl	%ecx,%edi
+	movl	%eax,%esi
+	roll	$5,%eax
+	addl	%edi,%ebp
+	xorl	%ecx,%esi
+	rorl	$7,%ebx
+	addl	%eax,%ebp
+	pxor	%xmm1,%xmm5
+	addl	16(%rsp),%edx
+	xorl	%ebx,%esi
+	punpcklqdq	%xmm4,%xmm8
+	movl	%ebp,%edi
+	roll	$5,%ebp
+	pxor	%xmm6,%xmm5
+	addl	%esi,%edx
+	xorl	%ebx,%edi
+	movdqa	%xmm9,%xmm10
+	rorl	$7,%eax
+	paddd	%xmm4,%xmm9
+	addl	%ebp,%edx
+	pxor	%xmm8,%xmm5
+	addl	20(%rsp),%ecx
+	xorl	%eax,%edi
+	movl	%edx,%esi
+	roll	$5,%edx
+	movdqa	%xmm5,%xmm8
+	addl	%edi,%ecx
+	xorl	%eax,%esi
+	movdqa	%xmm9,0(%rsp)
+	rorl	$7,%ebp
+	addl	%edx,%ecx
+	addl	24(%rsp),%ebx
+	pslld	$2,%xmm5
+	xorl	%ebp,%esi
+	movl	%ecx,%edi
+	psrld	$30,%xmm8
+	roll	$5,%ecx
+	addl	%esi,%ebx
+	xorl	%ebp,%edi
+	rorl	$7,%edx
+	por	%xmm8,%xmm5
+	addl	%ecx,%ebx
+	addl	28(%rsp),%eax
+	pshufd	$238,%xmm4,%xmm9
+	rorl	$7,%ecx
+	movl	%ebx,%esi
+	xorl	%edx,%edi
+	roll	$5,%ebx
+	addl	%edi,%eax
+	xorl	%ecx,%esi
+	xorl	%edx,%ecx
+	addl	%ebx,%eax
+	pxor	%xmm2,%xmm6
+	addl	32(%rsp),%ebp
+	andl	%ecx,%esi
+	xorl	%edx,%ecx
+	rorl	$7,%ebx
+	punpcklqdq	%xmm5,%xmm9
+	movl	%eax,%edi
+	xorl	%ecx,%esi
+	pxor	%xmm7,%xmm6
+	roll	$5,%eax
+	addl	%esi,%ebp
+	movdqa	%xmm10,%xmm8
+	xorl	%ebx,%edi
+	paddd	%xmm5,%xmm10
+	xorl	%ecx,%ebx
+	pxor	%xmm9,%xmm6
+	addl	%eax,%ebp
+	addl	36(%rsp),%edx
+	andl	%ebx,%edi
+	xorl	%ecx,%ebx
+	rorl	$7,%eax
+	movdqa	%xmm6,%xmm9
+	movl	%ebp,%esi
+	xorl	%ebx,%edi
+	movdqa	%xmm10,16(%rsp)
+	roll	$5,%ebp
+	addl	%edi,%edx
+	xorl	%eax,%esi
+	pslld	$2,%xmm6
+	xorl	%ebx,%eax
+	addl	%ebp,%edx
+	psrld	$30,%xmm9
+	addl	40(%rsp),%ecx
+	andl	%eax,%esi
+	xorl	%ebx,%eax
+	por	%xmm9,%xmm6
+	rorl	$7,%ebp
+	movl	%edx,%edi
+	xorl	%eax,%esi
+	roll	$5,%edx
+	pshufd	$238,%xmm5,%xmm10
+	addl	%esi,%ecx
+	xorl	%ebp,%edi
+	xorl	%eax,%ebp
+	addl	%edx,%ecx
+	addl	44(%rsp),%ebx
+	andl	%ebp,%edi
+	xorl	%eax,%ebp
+	rorl	$7,%edx
+	movl	%ecx,%esi
+	xorl	%ebp,%edi
+	roll	$5,%ecx
+	addl	%edi,%ebx
+	xorl	%edx,%esi
+	xorl	%ebp,%edx
+	addl	%ecx,%ebx
+	pxor	%xmm3,%xmm7
+	addl	48(%rsp),%eax
+	andl	%edx,%esi
+	xorl	%ebp,%edx
+	rorl	$7,%ecx
+	punpcklqdq	%xmm6,%xmm10
+	movl	%ebx,%edi
+	xorl	%edx,%esi
+	pxor	%xmm0,%xmm7
+	roll	$5,%ebx
+	addl	%esi,%eax
+	movdqa	32(%r11),%xmm9
+	xorl	%ecx,%edi
+	paddd	%xmm6,%xmm8
+	xorl	%edx,%ecx
+	pxor	%xmm10,%xmm7
+	addl	%ebx,%eax
+	addl	52(%rsp),%ebp
+	andl	%ecx,%edi
+	xorl	%edx,%ecx
+	rorl	$7,%ebx
+	movdqa	%xmm7,%xmm10
+	movl	%eax,%esi
+	xorl	%ecx,%edi
+	movdqa	%xmm8,32(%rsp)
+	roll	$5,%eax
+	addl	%edi,%ebp
+	xorl	%ebx,%esi
+	pslld	$2,%xmm7
+	xorl	%ecx,%ebx
+	addl	%eax,%ebp
+	psrld	$30,%xmm10
+	addl	56(%rsp),%edx
+	andl	%ebx,%esi
+	xorl	%ecx,%ebx
+	por	%xmm10,%xmm7
+	rorl	$7,%eax
+	movl	%ebp,%edi
+	xorl	%ebx,%esi
+	roll	$5,%ebp
+	pshufd	$238,%xmm6,%xmm8
+	addl	%esi,%edx
+	xorl	%eax,%edi
+	xorl	%ebx,%eax
+	addl	%ebp,%edx
+	addl	60(%rsp),%ecx
+	andl	%eax,%edi
+	xorl	%ebx,%eax
+	rorl	$7,%ebp
+	movl	%edx,%esi
+	xorl	%eax,%edi
+	roll	$5,%edx
+	addl	%edi,%ecx
+	xorl	%ebp,%esi
+	xorl	%eax,%ebp
+	addl	%edx,%ecx
+	pxor	%xmm4,%xmm0
+	addl	0(%rsp),%ebx
+	andl	%ebp,%esi
+	xorl	%eax,%ebp
+	rorl	$7,%edx
+	punpcklqdq	%xmm7,%xmm8
+	movl	%ecx,%edi
+	xorl	%ebp,%esi
+	pxor	%xmm1,%xmm0
+	roll	$5,%ecx
+	addl	%esi,%ebx
+	movdqa	%xmm9,%xmm10
+	xorl	%edx,%edi
+	paddd	%xmm7,%xmm9
+	xorl	%ebp,%edx
+	pxor	%xmm8,%xmm0
+	addl	%ecx,%ebx
+	addl	4(%rsp),%eax
+	andl	%edx,%edi
+	xorl	%ebp,%edx
+	rorl	$7,%ecx
+	movdqa	%xmm0,%xmm8
+	movl	%ebx,%esi
+	xorl	%edx,%edi
+	movdqa	%xmm9,48(%rsp)
+	roll	$5,%ebx
+	addl	%edi,%eax
+	xorl	%ecx,%esi
+	pslld	$2,%xmm0
+	xorl	%edx,%ecx
+	addl	%ebx,%eax
+	psrld	$30,%xmm8
+	addl	8(%rsp),%ebp
+	andl	%ecx,%esi
+	xorl	%edx,%ecx
+	por	%xmm8,%xmm0
+	rorl	$7,%ebx
+	movl	%eax,%edi
+	xorl	%ecx,%esi
+	roll	$5,%eax
+	pshufd	$238,%xmm7,%xmm9
+	addl	%esi,%ebp
+	xorl	%ebx,%edi
+	xorl	%ecx,%ebx
+	addl	%eax,%ebp
+	addl	12(%rsp),%edx
+	andl	%ebx,%edi
+	xorl	%ecx,%ebx
+	rorl	$7,%eax
+	movl	%ebp,%esi
+	xorl	%ebx,%edi
+	roll	$5,%ebp
+	addl	%edi,%edx
+	xorl	%eax,%esi
+	xorl	%ebx,%eax
+	addl	%ebp,%edx
+	pxor	%xmm5,%xmm1
+	addl	16(%rsp),%ecx
+	andl	%eax,%esi
+	xorl	%ebx,%eax
+	rorl	$7,%ebp
+	punpcklqdq	%xmm0,%xmm9
+	movl	%edx,%edi
+	xorl	%eax,%esi
+	pxor	%xmm2,%xmm1
+	roll	$5,%edx
+	addl	%esi,%ecx
+	movdqa	%xmm10,%xmm8
+	xorl	%ebp,%edi
+	paddd	%xmm0,%xmm10
+	xorl	%eax,%ebp
+	pxor	%xmm9,%xmm1
+	addl	%edx,%ecx
+	addl	20(%rsp),%ebx
+	andl	%ebp,%edi
+	xorl	%eax,%ebp
+	rorl	$7,%edx
+	movdqa	%xmm1,%xmm9
+	movl	%ecx,%esi
+	xorl	%ebp,%edi
+	movdqa	%xmm10,0(%rsp)
+	roll	$5,%ecx
+	addl	%edi,%ebx
+	xorl	%edx,%esi
+	pslld	$2,%xmm1
+	xorl	%ebp,%edx
+	addl	%ecx,%ebx
+	psrld	$30,%xmm9
+	addl	24(%rsp),%eax
+	andl	%edx,%esi
+	xorl	%ebp,%edx
+	por	%xmm9,%xmm1
+	rorl	$7,%ecx
+	movl	%ebx,%edi
+	xorl	%edx,%esi
+	roll	$5,%ebx
+	pshufd	$238,%xmm0,%xmm10
+	addl	%esi,%eax
+	xorl	%ecx,%edi
+	xorl	%edx,%ecx
+	addl	%ebx,%eax
+	addl	28(%rsp),%ebp
+	andl	%ecx,%edi
+	xorl	%edx,%ecx
+	rorl	$7,%ebx
+	movl	%eax,%esi
+	xorl	%ecx,%edi
+	roll	$5,%eax
+	addl	%edi,%ebp
+	xorl	%ebx,%esi
+	xorl	%ecx,%ebx
+	addl	%eax,%ebp
+	pxor	%xmm6,%xmm2
+	addl	32(%rsp),%edx
+	andl	%ebx,%esi
+	xorl	%ecx,%ebx
+	rorl	$7,%eax
+	punpcklqdq	%xmm1,%xmm10
+	movl	%ebp,%edi
+	xorl	%ebx,%esi
+	pxor	%xmm3,%xmm2
+	roll	$5,%ebp
+	addl	%esi,%edx
+	movdqa	%xmm8,%xmm9
+	xorl	%eax,%edi
+	paddd	%xmm1,%xmm8
+	xorl	%ebx,%eax
+	pxor	%xmm10,%xmm2
+	addl	%ebp,%edx
+	addl	36(%rsp),%ecx
+	andl	%eax,%edi
+	xorl	%ebx,%eax
+	rorl	$7,%ebp
+	movdqa	%xmm2,%xmm10
+	movl	%edx,%esi
+	xorl	%eax,%edi
+	movdqa	%xmm8,16(%rsp)
+	roll	$5,%edx
+	addl	%edi,%ecx
+	xorl	%ebp,%esi
+	pslld	$2,%xmm2
+	xorl	%eax,%ebp
+	addl	%edx,%ecx
+	psrld	$30,%xmm10
+	addl	40(%rsp),%ebx
+	andl	%ebp,%esi
+	xorl	%eax,%ebp
+	por	%xmm10,%xmm2
+	rorl	$7,%edx
+	movl	%ecx,%edi
+	xorl	%ebp,%esi
+	roll	$5,%ecx
+	pshufd	$238,%xmm1,%xmm8
+	addl	%esi,%ebx
+	xorl	%edx,%edi
+	xorl	%ebp,%edx
+	addl	%ecx,%ebx
+	addl	44(%rsp),%eax
+	andl	%edx,%edi
+	xorl	%ebp,%edx
+	rorl	$7,%ecx
+	movl	%ebx,%esi
+	xorl	%edx,%edi
+	roll	$5,%ebx
+	addl	%edi,%eax
+	xorl	%edx,%esi
+	addl	%ebx,%eax
+	pxor	%xmm7,%xmm3
+	addl	48(%rsp),%ebp
+	xorl	%ecx,%esi
+	punpcklqdq	%xmm2,%xmm8
+	movl	%eax,%edi
+	roll	$5,%eax
+	pxor	%xmm4,%xmm3
+	addl	%esi,%ebp
+	xorl	%ecx,%edi
+	movdqa	%xmm9,%xmm10
+	rorl	$7,%ebx
+	paddd	%xmm2,%xmm9
+	addl	%eax,%ebp
+	pxor	%xmm8,%xmm3
+	addl	52(%rsp),%edx
+	xorl	%ebx,%edi
+	movl	%ebp,%esi
+	roll	$5,%ebp
+	movdqa	%xmm3,%xmm8
+	addl	%edi,%edx
+	xorl	%ebx,%esi
+	movdqa	%xmm9,32(%rsp)
+	rorl	$7,%eax
+	addl	%ebp,%edx
+	addl	56(%rsp),%ecx
+	pslld	$2,%xmm3
+	xorl	%eax,%esi
+	movl	%edx,%edi
+	psrld	$30,%xmm8
+	roll	$5,%edx
+	addl	%esi,%ecx
+	xorl	%eax,%edi
+	rorl	$7,%ebp
+	por	%xmm8,%xmm3
+	addl	%edx,%ecx
+	addl	60(%rsp),%ebx
+	xorl	%ebp,%edi
+	movl	%ecx,%esi
+	roll	$5,%ecx
+	addl	%edi,%ebx
+	xorl	%ebp,%esi
+	rorl	$7,%edx
+	addl	%ecx,%ebx
+	addl	0(%rsp),%eax
+	xorl	%edx,%esi
+	movl	%ebx,%edi
+	roll	$5,%ebx
+	paddd	%xmm3,%xmm10
+	addl	%esi,%eax
+	xorl	%edx,%edi
+	movdqa	%xmm10,48(%rsp)
+	rorl	$7,%ecx
+	addl	%ebx,%eax
+	addl	4(%rsp),%ebp
+	xorl	%ecx,%edi
+	movl	%eax,%esi
+	roll	$5,%eax
+	addl	%edi,%ebp
+	xorl	%ecx,%esi
+	rorl	$7,%ebx
+	addl	%eax,%ebp
+	addl	8(%rsp),%edx
+	xorl	%ebx,%esi
+	movl	%ebp,%edi
+	roll	$5,%ebp
+	addl	%esi,%edx
+	xorl	%ebx,%edi
+	rorl	$7,%eax
+	addl	%ebp,%edx
+	addl	12(%rsp),%ecx
+	xorl	%eax,%edi
+	movl	%edx,%esi
+	roll	$5,%edx
+	addl	%edi,%ecx
+	xorl	%eax,%esi
+	rorl	$7,%ebp
+	addl	%edx,%ecx
+	cmpq	%r10,%r9
+	je	L$done_ssse3
+	movdqa	64(%r11),%xmm6
+	movdqa	-64(%r11),%xmm9
+	movdqu	0(%r9),%xmm0
+	movdqu	16(%r9),%xmm1
+	movdqu	32(%r9),%xmm2
+	movdqu	48(%r9),%xmm3
+.byte	102,15,56,0,198
+	addq	$64,%r9
+	addl	16(%rsp),%ebx
+	xorl	%ebp,%esi
+	movl	%ecx,%edi
+.byte	102,15,56,0,206
+	roll	$5,%ecx
+	addl	%esi,%ebx
+	xorl	%ebp,%edi
+	rorl	$7,%edx
+	paddd	%xmm9,%xmm0
+	addl	%ecx,%ebx
+	addl	20(%rsp),%eax
+	xorl	%edx,%edi
+	movl	%ebx,%esi
+	movdqa	%xmm0,0(%rsp)
+	roll	$5,%ebx
+	addl	%edi,%eax
+	xorl	%edx,%esi
+	rorl	$7,%ecx
+	psubd	%xmm9,%xmm0
+	addl	%ebx,%eax
+	addl	24(%rsp),%ebp
+	xorl	%ecx,%esi
+	movl	%eax,%edi
+	roll	$5,%eax
+	addl	%esi,%ebp
+	xorl	%ecx,%edi
+	rorl	$7,%ebx
+	addl	%eax,%ebp
+	addl	28(%rsp),%edx
+	xorl	%ebx,%edi
+	movl	%ebp,%esi
+	roll	$5,%ebp
+	addl	%edi,%edx
+	xorl	%ebx,%esi
+	rorl	$7,%eax
+	addl	%ebp,%edx
+	addl	32(%rsp),%ecx
+	xorl	%eax,%esi
+	movl	%edx,%edi
+.byte	102,15,56,0,214
+	roll	$5,%edx
+	addl	%esi,%ecx
+	xorl	%eax,%edi
+	rorl	$7,%ebp
+	paddd	%xmm9,%xmm1
+	addl	%edx,%ecx
+	addl	36(%rsp),%ebx
+	xorl	%ebp,%edi
+	movl	%ecx,%esi
+	movdqa	%xmm1,16(%rsp)
+	roll	$5,%ecx
+	addl	%edi,%ebx
+	xorl	%ebp,%esi
+	rorl	$7,%edx
+	psubd	%xmm9,%xmm1
+	addl	%ecx,%ebx
+	addl	40(%rsp),%eax
+	xorl	%edx,%esi
+	movl	%ebx,%edi
+	roll	$5,%ebx
+	addl	%esi,%eax
+	xorl	%edx,%edi
+	rorl	$7,%ecx
+	addl	%ebx,%eax
+	addl	44(%rsp),%ebp
+	xorl	%ecx,%edi
+	movl	%eax,%esi
+	roll	$5,%eax
+	addl	%edi,%ebp
+	xorl	%ecx,%esi
+	rorl	$7,%ebx
+	addl	%eax,%ebp
+	addl	48(%rsp),%edx
+	xorl	%ebx,%esi
+	movl	%ebp,%edi
+.byte	102,15,56,0,222
+	roll	$5,%ebp
+	addl	%esi,%edx
+	xorl	%ebx,%edi
+	rorl	$7,%eax
+	paddd	%xmm9,%xmm2
+	addl	%ebp,%edx
+	addl	52(%rsp),%ecx
+	xorl	%eax,%edi
+	movl	%edx,%esi
+	movdqa	%xmm2,32(%rsp)
+	roll	$5,%edx
+	addl	%edi,%ecx
+	xorl	%eax,%esi
+	rorl	$7,%ebp
+	psubd	%xmm9,%xmm2
+	addl	%edx,%ecx
+	addl	56(%rsp),%ebx
+	xorl	%ebp,%esi
+	movl	%ecx,%edi
+	roll	$5,%ecx
+	addl	%esi,%ebx
+	xorl	%ebp,%edi
+	rorl	$7,%edx
+	addl	%ecx,%ebx
+	addl	60(%rsp),%eax
+	xorl	%edx,%edi
+	movl	%ebx,%esi
+	roll	$5,%ebx
+	addl	%edi,%eax
+	rorl	$7,%ecx
+	addl	%ebx,%eax
+	addl	0(%r8),%eax
+	addl	4(%r8),%esi
+	addl	8(%r8),%ecx
+	addl	12(%r8),%edx
+	movl	%eax,0(%r8)
+	addl	16(%r8),%ebp
+	movl	%esi,4(%r8)
+	movl	%esi,%ebx
+	movl	%ecx,8(%r8)
+	movl	%ecx,%edi
+	movl	%edx,12(%r8)
+	xorl	%edx,%edi
+	movl	%ebp,16(%r8)
+	andl	%edi,%esi
+	jmp	L$oop_ssse3
+
+.p2align	4
+L$done_ssse3:
+	addl	16(%rsp),%ebx
+	xorl	%ebp,%esi
+	movl	%ecx,%edi
+	roll	$5,%ecx
+	addl	%esi,%ebx
+	xorl	%ebp,%edi
+	rorl	$7,%edx
+	addl	%ecx,%ebx
+	addl	20(%rsp),%eax
+	xorl	%edx,%edi
+	movl	%ebx,%esi
+	roll	$5,%ebx
+	addl	%edi,%eax
+	xorl	%edx,%esi
+	rorl	$7,%ecx
+	addl	%ebx,%eax
+	addl	24(%rsp),%ebp
+	xorl	%ecx,%esi
+	movl	%eax,%edi
+	roll	$5,%eax
+	addl	%esi,%ebp
+	xorl	%ecx,%edi
+	rorl	$7,%ebx
+	addl	%eax,%ebp
+	addl	28(%rsp),%edx
+	xorl	%ebx,%edi
+	movl	%ebp,%esi
+	roll	$5,%ebp
+	addl	%edi,%edx
+	xorl	%ebx,%esi
+	rorl	$7,%eax
+	addl	%ebp,%edx
+	addl	32(%rsp),%ecx
+	xorl	%eax,%esi
+	movl	%edx,%edi
+	roll	$5,%edx
+	addl	%esi,%ecx
+	xorl	%eax,%edi
+	rorl	$7,%ebp
+	addl	%edx,%ecx
+	addl	36(%rsp),%ebx
+	xorl	%ebp,%edi
+	movl	%ecx,%esi
+	roll	$5,%ecx
+	addl	%edi,%ebx
+	xorl	%ebp,%esi
+	rorl	$7,%edx
+	addl	%ecx,%ebx
+	addl	40(%rsp),%eax
+	xorl	%edx,%esi
+	movl	%ebx,%edi
+	roll	$5,%ebx
+	addl	%esi,%eax
+	xorl	%edx,%edi
+	rorl	$7,%ecx
+	addl	%ebx,%eax
+	addl	44(%rsp),%ebp
+	xorl	%ecx,%edi
+	movl	%eax,%esi
+	roll	$5,%eax
+	addl	%edi,%ebp
+	xorl	%ecx,%esi
+	rorl	$7,%ebx
+	addl	%eax,%ebp
+	addl	48(%rsp),%edx
+	xorl	%ebx,%esi
+	movl	%ebp,%edi
+	roll	$5,%ebp
+	addl	%esi,%edx
+	xorl	%ebx,%edi
+	rorl	$7,%eax
+	addl	%ebp,%edx
+	addl	52(%rsp),%ecx
+	xorl	%eax,%edi
+	movl	%edx,%esi
+	roll	$5,%edx
+	addl	%edi,%ecx
+	xorl	%eax,%esi
+	rorl	$7,%ebp
+	addl	%edx,%ecx
+	addl	56(%rsp),%ebx
+	xorl	%ebp,%esi
+	movl	%ecx,%edi
+	roll	$5,%ecx
+	addl	%esi,%ebx
+	xorl	%ebp,%edi
+	rorl	$7,%edx
+	addl	%ecx,%ebx
+	addl	60(%rsp),%eax
+	xorl	%edx,%edi
+	movl	%ebx,%esi
+	roll	$5,%ebx
+	addl	%edi,%eax
+	rorl	$7,%ecx
+	addl	%ebx,%eax
+	addl	0(%r8),%eax
+	addl	4(%r8),%esi
+	addl	8(%r8),%ecx
+	movl	%eax,0(%r8)
+	addl	12(%r8),%edx
+	movl	%esi,4(%r8)
+	addl	16(%r8),%ebp
+	movl	%ecx,8(%r8)
+	movl	%edx,12(%r8)
+	movl	%ebp,16(%r8)
+	leaq	(%r14),%rsi
+	movq	-40(%rsi),%r14
+	movq	-32(%rsi),%r13
+	movq	-24(%rsi),%r12
+	movq	-16(%rsi),%rbp
+	movq	-8(%rsi),%rbx
+	leaq	(%rsi),%rsp
+L$epilogue_ssse3:
+	.byte	0xf3,0xc3
+
+.p2align	6
+K_XX_XX:
+.long	0x5a827999,0x5a827999,0x5a827999,0x5a827999
+.long	0x5a827999,0x5a827999,0x5a827999,0x5a827999
+.long	0x6ed9eba1,0x6ed9eba1,0x6ed9eba1,0x6ed9eba1
+.long	0x6ed9eba1,0x6ed9eba1,0x6ed9eba1,0x6ed9eba1
+.long	0x8f1bbcdc,0x8f1bbcdc,0x8f1bbcdc,0x8f1bbcdc
+.long	0x8f1bbcdc,0x8f1bbcdc,0x8f1bbcdc,0x8f1bbcdc
+.long	0xca62c1d6,0xca62c1d6,0xca62c1d6,0xca62c1d6
+.long	0xca62c1d6,0xca62c1d6,0xca62c1d6,0xca62c1d6
+.long	0x00010203,0x04050607,0x08090a0b,0x0c0d0e0f
+.long	0x00010203,0x04050607,0x08090a0b,0x0c0d0e0f
+.byte	0xf,0xe,0xd,0xc,0xb,0xa,0x9,0x8,0x7,0x6,0x5,0x4,0x3,0x2,0x1,0x0
+.byte	83,72,65,49,32,98,108,111,99,107,32,116,114,97,110,115,102,111,114,109,32,102,111,114,32,120,56,54,95,54,52,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0
+.p2align	6
+#endif
diff --git a/third_party/boringssl/mac-x86_64/crypto/sha/sha256-x86_64.S b/third_party/boringssl/mac-x86_64/crypto/sha/sha256-x86_64.S
new file mode 100644
index 0000000..da02d4c
--- /dev/null
+++ b/third_party/boringssl/mac-x86_64/crypto/sha/sha256-x86_64.S
@@ -0,0 +1,2843 @@
+#if defined(__x86_64__)
+.text	
+
+
+.globl	_sha256_block_data_order
+.private_extern _sha256_block_data_order
+
+.p2align	4
+_sha256_block_data_order:
+	leaq	_OPENSSL_ia32cap_P(%rip),%r11
+	movl	0(%r11),%r9d
+	movl	4(%r11),%r10d
+	movl	8(%r11),%r11d
+	testl	$512,%r10d
+	jnz	L$ssse3_shortcut
+	pushq	%rbx
+	pushq	%rbp
+	pushq	%r12
+	pushq	%r13
+	pushq	%r14
+	pushq	%r15
+	movq	%rsp,%r11
+	shlq	$4,%rdx
+	subq	$64+32,%rsp
+	leaq	(%rsi,%rdx,4),%rdx
+	andq	$-64,%rsp
+	movq	%rdi,64+0(%rsp)
+	movq	%rsi,64+8(%rsp)
+	movq	%rdx,64+16(%rsp)
+	movq	%r11,64+24(%rsp)
+L$prologue:
+
+	movl	0(%rdi),%eax
+	movl	4(%rdi),%ebx
+	movl	8(%rdi),%ecx
+	movl	12(%rdi),%edx
+	movl	16(%rdi),%r8d
+	movl	20(%rdi),%r9d
+	movl	24(%rdi),%r10d
+	movl	28(%rdi),%r11d
+	jmp	L$loop
+
+.p2align	4
+L$loop:
+	movl	%ebx,%edi
+	leaq	K256(%rip),%rbp
+	xorl	%ecx,%edi
+	movl	0(%rsi),%r12d
+	movl	%r8d,%r13d
+	movl	%eax,%r14d
+	bswapl	%r12d
+	rorl	$14,%r13d
+	movl	%r9d,%r15d
+
+	xorl	%r8d,%r13d
+	rorl	$9,%r14d
+	xorl	%r10d,%r15d
+
+	movl	%r12d,0(%rsp)
+	xorl	%eax,%r14d
+	andl	%r8d,%r15d
+
+	rorl	$5,%r13d
+	addl	%r11d,%r12d
+	xorl	%r10d,%r15d
+
+	rorl	$11,%r14d
+	xorl	%r8d,%r13d
+	addl	%r15d,%r12d
+
+	movl	%eax,%r15d
+	addl	(%rbp),%r12d
+	xorl	%eax,%r14d
+
+	xorl	%ebx,%r15d
+	rorl	$6,%r13d
+	movl	%ebx,%r11d
+
+	andl	%r15d,%edi
+	rorl	$2,%r14d
+	addl	%r13d,%r12d
+
+	xorl	%edi,%r11d
+	addl	%r12d,%edx
+	addl	%r12d,%r11d
+
+	leaq	4(%rbp),%rbp
+	addl	%r14d,%r11d
+	movl	4(%rsi),%r12d
+	movl	%edx,%r13d
+	movl	%r11d,%r14d
+	bswapl	%r12d
+	rorl	$14,%r13d
+	movl	%r8d,%edi
+
+	xorl	%edx,%r13d
+	rorl	$9,%r14d
+	xorl	%r9d,%edi
+
+	movl	%r12d,4(%rsp)
+	xorl	%r11d,%r14d
+	andl	%edx,%edi
+
+	rorl	$5,%r13d
+	addl	%r10d,%r12d
+	xorl	%r9d,%edi
+
+	rorl	$11,%r14d
+	xorl	%edx,%r13d
+	addl	%edi,%r12d
+
+	movl	%r11d,%edi
+	addl	(%rbp),%r12d
+	xorl	%r11d,%r14d
+
+	xorl	%eax,%edi
+	rorl	$6,%r13d
+	movl	%eax,%r10d
+
+	andl	%edi,%r15d
+	rorl	$2,%r14d
+	addl	%r13d,%r12d
+
+	xorl	%r15d,%r10d
+	addl	%r12d,%ecx
+	addl	%r12d,%r10d
+
+	leaq	4(%rbp),%rbp
+	addl	%r14d,%r10d
+	movl	8(%rsi),%r12d
+	movl	%ecx,%r13d
+	movl	%r10d,%r14d
+	bswapl	%r12d
+	rorl	$14,%r13d
+	movl	%edx,%r15d
+
+	xorl	%ecx,%r13d
+	rorl	$9,%r14d
+	xorl	%r8d,%r15d
+
+	movl	%r12d,8(%rsp)
+	xorl	%r10d,%r14d
+	andl	%ecx,%r15d
+
+	rorl	$5,%r13d
+	addl	%r9d,%r12d
+	xorl	%r8d,%r15d
+
+	rorl	$11,%r14d
+	xorl	%ecx,%r13d
+	addl	%r15d,%r12d
+
+	movl	%r10d,%r15d
+	addl	(%rbp),%r12d
+	xorl	%r10d,%r14d
+
+	xorl	%r11d,%r15d
+	rorl	$6,%r13d
+	movl	%r11d,%r9d
+
+	andl	%r15d,%edi
+	rorl	$2,%r14d
+	addl	%r13d,%r12d
+
+	xorl	%edi,%r9d
+	addl	%r12d,%ebx
+	addl	%r12d,%r9d
+
+	leaq	4(%rbp),%rbp
+	addl	%r14d,%r9d
+	movl	12(%rsi),%r12d
+	movl	%ebx,%r13d
+	movl	%r9d,%r14d
+	bswapl	%r12d
+	rorl	$14,%r13d
+	movl	%ecx,%edi
+
+	xorl	%ebx,%r13d
+	rorl	$9,%r14d
+	xorl	%edx,%edi
+
+	movl	%r12d,12(%rsp)
+	xorl	%r9d,%r14d
+	andl	%ebx,%edi
+
+	rorl	$5,%r13d
+	addl	%r8d,%r12d
+	xorl	%edx,%edi
+
+	rorl	$11,%r14d
+	xorl	%ebx,%r13d
+	addl	%edi,%r12d
+
+	movl	%r9d,%edi
+	addl	(%rbp),%r12d
+	xorl	%r9d,%r14d
+
+	xorl	%r10d,%edi
+	rorl	$6,%r13d
+	movl	%r10d,%r8d
+
+	andl	%edi,%r15d
+	rorl	$2,%r14d
+	addl	%r13d,%r12d
+
+	xorl	%r15d,%r8d
+	addl	%r12d,%eax
+	addl	%r12d,%r8d
+
+	leaq	20(%rbp),%rbp
+	addl	%r14d,%r8d
+	movl	16(%rsi),%r12d
+	movl	%eax,%r13d
+	movl	%r8d,%r14d
+	bswapl	%r12d
+	rorl	$14,%r13d
+	movl	%ebx,%r15d
+
+	xorl	%eax,%r13d
+	rorl	$9,%r14d
+	xorl	%ecx,%r15d
+
+	movl	%r12d,16(%rsp)
+	xorl	%r8d,%r14d
+	andl	%eax,%r15d
+
+	rorl	$5,%r13d
+	addl	%edx,%r12d
+	xorl	%ecx,%r15d
+
+	rorl	$11,%r14d
+	xorl	%eax,%r13d
+	addl	%r15d,%r12d
+
+	movl	%r8d,%r15d
+	addl	(%rbp),%r12d
+	xorl	%r8d,%r14d
+
+	xorl	%r9d,%r15d
+	rorl	$6,%r13d
+	movl	%r9d,%edx
+
+	andl	%r15d,%edi
+	rorl	$2,%r14d
+	addl	%r13d,%r12d
+
+	xorl	%edi,%edx
+	addl	%r12d,%r11d
+	addl	%r12d,%edx
+
+	leaq	4(%rbp),%rbp
+	addl	%r14d,%edx
+	movl	20(%rsi),%r12d
+	movl	%r11d,%r13d
+	movl	%edx,%r14d
+	bswapl	%r12d
+	rorl	$14,%r13d
+	movl	%eax,%edi
+
+	xorl	%r11d,%r13d
+	rorl	$9,%r14d
+	xorl	%ebx,%edi
+
+	movl	%r12d,20(%rsp)
+	xorl	%edx,%r14d
+	andl	%r11d,%edi
+
+	rorl	$5,%r13d
+	addl	%ecx,%r12d
+	xorl	%ebx,%edi
+
+	rorl	$11,%r14d
+	xorl	%r11d,%r13d
+	addl	%edi,%r12d
+
+	movl	%edx,%edi
+	addl	(%rbp),%r12d
+	xorl	%edx,%r14d
+
+	xorl	%r8d,%edi
+	rorl	$6,%r13d
+	movl	%r8d,%ecx
+
+	andl	%edi,%r15d
+	rorl	$2,%r14d
+	addl	%r13d,%r12d
+
+	xorl	%r15d,%ecx
+	addl	%r12d,%r10d
+	addl	%r12d,%ecx
+
+	leaq	4(%rbp),%rbp
+	addl	%r14d,%ecx
+	movl	24(%rsi),%r12d
+	movl	%r10d,%r13d
+	movl	%ecx,%r14d
+	bswapl	%r12d
+	rorl	$14,%r13d
+	movl	%r11d,%r15d
+
+	xorl	%r10d,%r13d
+	rorl	$9,%r14d
+	xorl	%eax,%r15d
+
+	movl	%r12d,24(%rsp)
+	xorl	%ecx,%r14d
+	andl	%r10d,%r15d
+
+	rorl	$5,%r13d
+	addl	%ebx,%r12d
+	xorl	%eax,%r15d
+
+	rorl	$11,%r14d
+	xorl	%r10d,%r13d
+	addl	%r15d,%r12d
+
+	movl	%ecx,%r15d
+	addl	(%rbp),%r12d
+	xorl	%ecx,%r14d
+
+	xorl	%edx,%r15d
+	rorl	$6,%r13d
+	movl	%edx,%ebx
+
+	andl	%r15d,%edi
+	rorl	$2,%r14d
+	addl	%r13d,%r12d
+
+	xorl	%edi,%ebx
+	addl	%r12d,%r9d
+	addl	%r12d,%ebx
+
+	leaq	4(%rbp),%rbp
+	addl	%r14d,%ebx
+	movl	28(%rsi),%r12d
+	movl	%r9d,%r13d
+	movl	%ebx,%r14d
+	bswapl	%r12d
+	rorl	$14,%r13d
+	movl	%r10d,%edi
+
+	xorl	%r9d,%r13d
+	rorl	$9,%r14d
+	xorl	%r11d,%edi
+
+	movl	%r12d,28(%rsp)
+	xorl	%ebx,%r14d
+	andl	%r9d,%edi
+
+	rorl	$5,%r13d
+	addl	%eax,%r12d
+	xorl	%r11d,%edi
+
+	rorl	$11,%r14d
+	xorl	%r9d,%r13d
+	addl	%edi,%r12d
+
+	movl	%ebx,%edi
+	addl	(%rbp),%r12d
+	xorl	%ebx,%r14d
+
+	xorl	%ecx,%edi
+	rorl	$6,%r13d
+	movl	%ecx,%eax
+
+	andl	%edi,%r15d
+	rorl	$2,%r14d
+	addl	%r13d,%r12d
+
+	xorl	%r15d,%eax
+	addl	%r12d,%r8d
+	addl	%r12d,%eax
+
+	leaq	20(%rbp),%rbp
+	addl	%r14d,%eax
+	movl	32(%rsi),%r12d
+	movl	%r8d,%r13d
+	movl	%eax,%r14d
+	bswapl	%r12d
+	rorl	$14,%r13d
+	movl	%r9d,%r15d
+
+	xorl	%r8d,%r13d
+	rorl	$9,%r14d
+	xorl	%r10d,%r15d
+
+	movl	%r12d,32(%rsp)
+	xorl	%eax,%r14d
+	andl	%r8d,%r15d
+
+	rorl	$5,%r13d
+	addl	%r11d,%r12d
+	xorl	%r10d,%r15d
+
+	rorl	$11,%r14d
+	xorl	%r8d,%r13d
+	addl	%r15d,%r12d
+
+	movl	%eax,%r15d
+	addl	(%rbp),%r12d
+	xorl	%eax,%r14d
+
+	xorl	%ebx,%r15d
+	rorl	$6,%r13d
+	movl	%ebx,%r11d
+
+	andl	%r15d,%edi
+	rorl	$2,%r14d
+	addl	%r13d,%r12d
+
+	xorl	%edi,%r11d
+	addl	%r12d,%edx
+	addl	%r12d,%r11d
+
+	leaq	4(%rbp),%rbp
+	addl	%r14d,%r11d
+	movl	36(%rsi),%r12d
+	movl	%edx,%r13d
+	movl	%r11d,%r14d
+	bswapl	%r12d
+	rorl	$14,%r13d
+	movl	%r8d,%edi
+
+	xorl	%edx,%r13d
+	rorl	$9,%r14d
+	xorl	%r9d,%edi
+
+	movl	%r12d,36(%rsp)
+	xorl	%r11d,%r14d
+	andl	%edx,%edi
+
+	rorl	$5,%r13d
+	addl	%r10d,%r12d
+	xorl	%r9d,%edi
+
+	rorl	$11,%r14d
+	xorl	%edx,%r13d
+	addl	%edi,%r12d
+
+	movl	%r11d,%edi
+	addl	(%rbp),%r12d
+	xorl	%r11d,%r14d
+
+	xorl	%eax,%edi
+	rorl	$6,%r13d
+	movl	%eax,%r10d
+
+	andl	%edi,%r15d
+	rorl	$2,%r14d
+	addl	%r13d,%r12d
+
+	xorl	%r15d,%r10d
+	addl	%r12d,%ecx
+	addl	%r12d,%r10d
+
+	leaq	4(%rbp),%rbp
+	addl	%r14d,%r10d
+	movl	40(%rsi),%r12d
+	movl	%ecx,%r13d
+	movl	%r10d,%r14d
+	bswapl	%r12d
+	rorl	$14,%r13d
+	movl	%edx,%r15d
+
+	xorl	%ecx,%r13d
+	rorl	$9,%r14d
+	xorl	%r8d,%r15d
+
+	movl	%r12d,40(%rsp)
+	xorl	%r10d,%r14d
+	andl	%ecx,%r15d
+
+	rorl	$5,%r13d
+	addl	%r9d,%r12d
+	xorl	%r8d,%r15d
+
+	rorl	$11,%r14d
+	xorl	%ecx,%r13d
+	addl	%r15d,%r12d
+
+	movl	%r10d,%r15d
+	addl	(%rbp),%r12d
+	xorl	%r10d,%r14d
+
+	xorl	%r11d,%r15d
+	rorl	$6,%r13d
+	movl	%r11d,%r9d
+
+	andl	%r15d,%edi
+	rorl	$2,%r14d
+	addl	%r13d,%r12d
+
+	xorl	%edi,%r9d
+	addl	%r12d,%ebx
+	addl	%r12d,%r9d
+
+	leaq	4(%rbp),%rbp
+	addl	%r14d,%r9d
+	movl	44(%rsi),%r12d
+	movl	%ebx,%r13d
+	movl	%r9d,%r14d
+	bswapl	%r12d
+	rorl	$14,%r13d
+	movl	%ecx,%edi
+
+	xorl	%ebx,%r13d
+	rorl	$9,%r14d
+	xorl	%edx,%edi
+
+	movl	%r12d,44(%rsp)
+	xorl	%r9d,%r14d
+	andl	%ebx,%edi
+
+	rorl	$5,%r13d
+	addl	%r8d,%r12d
+	xorl	%edx,%edi
+
+	rorl	$11,%r14d
+	xorl	%ebx,%r13d
+	addl	%edi,%r12d
+
+	movl	%r9d,%edi
+	addl	(%rbp),%r12d
+	xorl	%r9d,%r14d
+
+	xorl	%r10d,%edi
+	rorl	$6,%r13d
+	movl	%r10d,%r8d
+
+	andl	%edi,%r15d
+	rorl	$2,%r14d
+	addl	%r13d,%r12d
+
+	xorl	%r15d,%r8d
+	addl	%r12d,%eax
+	addl	%r12d,%r8d
+
+	leaq	20(%rbp),%rbp
+	addl	%r14d,%r8d
+	movl	48(%rsi),%r12d
+	movl	%eax,%r13d
+	movl	%r8d,%r14d
+	bswapl	%r12d
+	rorl	$14,%r13d
+	movl	%ebx,%r15d
+
+	xorl	%eax,%r13d
+	rorl	$9,%r14d
+	xorl	%ecx,%r15d
+
+	movl	%r12d,48(%rsp)
+	xorl	%r8d,%r14d
+	andl	%eax,%r15d
+
+	rorl	$5,%r13d
+	addl	%edx,%r12d
+	xorl	%ecx,%r15d
+
+	rorl	$11,%r14d
+	xorl	%eax,%r13d
+	addl	%r15d,%r12d
+
+	movl	%r8d,%r15d
+	addl	(%rbp),%r12d
+	xorl	%r8d,%r14d
+
+	xorl	%r9d,%r15d
+	rorl	$6,%r13d
+	movl	%r9d,%edx
+
+	andl	%r15d,%edi
+	rorl	$2,%r14d
+	addl	%r13d,%r12d
+
+	xorl	%edi,%edx
+	addl	%r12d,%r11d
+	addl	%r12d,%edx
+
+	leaq	4(%rbp),%rbp
+	addl	%r14d,%edx
+	movl	52(%rsi),%r12d
+	movl	%r11d,%r13d
+	movl	%edx,%r14d
+	bswapl	%r12d
+	rorl	$14,%r13d
+	movl	%eax,%edi
+
+	xorl	%r11d,%r13d
+	rorl	$9,%r14d
+	xorl	%ebx,%edi
+
+	movl	%r12d,52(%rsp)
+	xorl	%edx,%r14d
+	andl	%r11d,%edi
+
+	rorl	$5,%r13d
+	addl	%ecx,%r12d
+	xorl	%ebx,%edi
+
+	rorl	$11,%r14d
+	xorl	%r11d,%r13d
+	addl	%edi,%r12d
+
+	movl	%edx,%edi
+	addl	(%rbp),%r12d
+	xorl	%edx,%r14d
+
+	xorl	%r8d,%edi
+	rorl	$6,%r13d
+	movl	%r8d,%ecx
+
+	andl	%edi,%r15d
+	rorl	$2,%r14d
+	addl	%r13d,%r12d
+
+	xorl	%r15d,%ecx
+	addl	%r12d,%r10d
+	addl	%r12d,%ecx
+
+	leaq	4(%rbp),%rbp
+	addl	%r14d,%ecx
+	movl	56(%rsi),%r12d
+	movl	%r10d,%r13d
+	movl	%ecx,%r14d
+	bswapl	%r12d
+	rorl	$14,%r13d
+	movl	%r11d,%r15d
+
+	xorl	%r10d,%r13d
+	rorl	$9,%r14d
+	xorl	%eax,%r15d
+
+	movl	%r12d,56(%rsp)
+	xorl	%ecx,%r14d
+	andl	%r10d,%r15d
+
+	rorl	$5,%r13d
+	addl	%ebx,%r12d
+	xorl	%eax,%r15d
+
+	rorl	$11,%r14d
+	xorl	%r10d,%r13d
+	addl	%r15d,%r12d
+
+	movl	%ecx,%r15d
+	addl	(%rbp),%r12d
+	xorl	%ecx,%r14d
+
+	xorl	%edx,%r15d
+	rorl	$6,%r13d
+	movl	%edx,%ebx
+
+	andl	%r15d,%edi
+	rorl	$2,%r14d
+	addl	%r13d,%r12d
+
+	xorl	%edi,%ebx
+	addl	%r12d,%r9d
+	addl	%r12d,%ebx
+
+	leaq	4(%rbp),%rbp
+	addl	%r14d,%ebx
+	movl	60(%rsi),%r12d
+	movl	%r9d,%r13d
+	movl	%ebx,%r14d
+	bswapl	%r12d
+	rorl	$14,%r13d
+	movl	%r10d,%edi
+
+	xorl	%r9d,%r13d
+	rorl	$9,%r14d
+	xorl	%r11d,%edi
+
+	movl	%r12d,60(%rsp)
+	xorl	%ebx,%r14d
+	andl	%r9d,%edi
+
+	rorl	$5,%r13d
+	addl	%eax,%r12d
+	xorl	%r11d,%edi
+
+	rorl	$11,%r14d
+	xorl	%r9d,%r13d
+	addl	%edi,%r12d
+
+	movl	%ebx,%edi
+	addl	(%rbp),%r12d
+	xorl	%ebx,%r14d
+
+	xorl	%ecx,%edi
+	rorl	$6,%r13d
+	movl	%ecx,%eax
+
+	andl	%edi,%r15d
+	rorl	$2,%r14d
+	addl	%r13d,%r12d
+
+	xorl	%r15d,%eax
+	addl	%r12d,%r8d
+	addl	%r12d,%eax
+
+	leaq	20(%rbp),%rbp
+	jmp	L$rounds_16_xx
+.p2align	4
+L$rounds_16_xx:
+	movl	4(%rsp),%r13d
+	movl	56(%rsp),%r15d
+
+	movl	%r13d,%r12d
+	rorl	$11,%r13d
+	addl	%r14d,%eax
+	movl	%r15d,%r14d
+	rorl	$2,%r15d
+
+	xorl	%r12d,%r13d
+	shrl	$3,%r12d
+	rorl	$7,%r13d
+	xorl	%r14d,%r15d
+	shrl	$10,%r14d
+
+	rorl	$17,%r15d
+	xorl	%r13d,%r12d
+	xorl	%r14d,%r15d
+	addl	36(%rsp),%r12d
+
+	addl	0(%rsp),%r12d
+	movl	%r8d,%r13d
+	addl	%r15d,%r12d
+	movl	%eax,%r14d
+	rorl	$14,%r13d
+	movl	%r9d,%r15d
+
+	xorl	%r8d,%r13d
+	rorl	$9,%r14d
+	xorl	%r10d,%r15d
+
+	movl	%r12d,0(%rsp)
+	xorl	%eax,%r14d
+	andl	%r8d,%r15d
+
+	rorl	$5,%r13d
+	addl	%r11d,%r12d
+	xorl	%r10d,%r15d
+
+	rorl	$11,%r14d
+	xorl	%r8d,%r13d
+	addl	%r15d,%r12d
+
+	movl	%eax,%r15d
+	addl	(%rbp),%r12d
+	xorl	%eax,%r14d
+
+	xorl	%ebx,%r15d
+	rorl	$6,%r13d
+	movl	%ebx,%r11d
+
+	andl	%r15d,%edi
+	rorl	$2,%r14d
+	addl	%r13d,%r12d
+
+	xorl	%edi,%r11d
+	addl	%r12d,%edx
+	addl	%r12d,%r11d
+
+	leaq	4(%rbp),%rbp
+	movl	8(%rsp),%r13d
+	movl	60(%rsp),%edi
+
+	movl	%r13d,%r12d
+	rorl	$11,%r13d
+	addl	%r14d,%r11d
+	movl	%edi,%r14d
+	rorl	$2,%edi
+
+	xorl	%r12d,%r13d
+	shrl	$3,%r12d
+	rorl	$7,%r13d
+	xorl	%r14d,%edi
+	shrl	$10,%r14d
+
+	rorl	$17,%edi
+	xorl	%r13d,%r12d
+	xorl	%r14d,%edi
+	addl	40(%rsp),%r12d
+
+	addl	4(%rsp),%r12d
+	movl	%edx,%r13d
+	addl	%edi,%r12d
+	movl	%r11d,%r14d
+	rorl	$14,%r13d
+	movl	%r8d,%edi
+
+	xorl	%edx,%r13d
+	rorl	$9,%r14d
+	xorl	%r9d,%edi
+
+	movl	%r12d,4(%rsp)
+	xorl	%r11d,%r14d
+	andl	%edx,%edi
+
+	rorl	$5,%r13d
+	addl	%r10d,%r12d
+	xorl	%r9d,%edi
+
+	rorl	$11,%r14d
+	xorl	%edx,%r13d
+	addl	%edi,%r12d
+
+	movl	%r11d,%edi
+	addl	(%rbp),%r12d
+	xorl	%r11d,%r14d
+
+	xorl	%eax,%edi
+	rorl	$6,%r13d
+	movl	%eax,%r10d
+
+	andl	%edi,%r15d
+	rorl	$2,%r14d
+	addl	%r13d,%r12d
+
+	xorl	%r15d,%r10d
+	addl	%r12d,%ecx
+	addl	%r12d,%r10d
+
+	leaq	4(%rbp),%rbp
+	movl	12(%rsp),%r13d
+	movl	0(%rsp),%r15d
+
+	movl	%r13d,%r12d
+	rorl	$11,%r13d
+	addl	%r14d,%r10d
+	movl	%r15d,%r14d
+	rorl	$2,%r15d
+
+	xorl	%r12d,%r13d
+	shrl	$3,%r12d
+	rorl	$7,%r13d
+	xorl	%r14d,%r15d
+	shrl	$10,%r14d
+
+	rorl	$17,%r15d
+	xorl	%r13d,%r12d
+	xorl	%r14d,%r15d
+	addl	44(%rsp),%r12d
+
+	addl	8(%rsp),%r12d
+	movl	%ecx,%r13d
+	addl	%r15d,%r12d
+	movl	%r10d,%r14d
+	rorl	$14,%r13d
+	movl	%edx,%r15d
+
+	xorl	%ecx,%r13d
+	rorl	$9,%r14d
+	xorl	%r8d,%r15d
+
+	movl	%r12d,8(%rsp)
+	xorl	%r10d,%r14d
+	andl	%ecx,%r15d
+
+	rorl	$5,%r13d
+	addl	%r9d,%r12d
+	xorl	%r8d,%r15d
+
+	rorl	$11,%r14d
+	xorl	%ecx,%r13d
+	addl	%r15d,%r12d
+
+	movl	%r10d,%r15d
+	addl	(%rbp),%r12d
+	xorl	%r10d,%r14d
+
+	xorl	%r11d,%r15d
+	rorl	$6,%r13d
+	movl	%r11d,%r9d
+
+	andl	%r15d,%edi
+	rorl	$2,%r14d
+	addl	%r13d,%r12d
+
+	xorl	%edi,%r9d
+	addl	%r12d,%ebx
+	addl	%r12d,%r9d
+
+	leaq	4(%rbp),%rbp
+	movl	16(%rsp),%r13d
+	movl	4(%rsp),%edi
+
+	movl	%r13d,%r12d
+	rorl	$11,%r13d
+	addl	%r14d,%r9d
+	movl	%edi,%r14d
+	rorl	$2,%edi
+
+	xorl	%r12d,%r13d
+	shrl	$3,%r12d
+	rorl	$7,%r13d
+	xorl	%r14d,%edi
+	shrl	$10,%r14d
+
+	rorl	$17,%edi
+	xorl	%r13d,%r12d
+	xorl	%r14d,%edi
+	addl	48(%rsp),%r12d
+
+	addl	12(%rsp),%r12d
+	movl	%ebx,%r13d
+	addl	%edi,%r12d
+	movl	%r9d,%r14d
+	rorl	$14,%r13d
+	movl	%ecx,%edi
+
+	xorl	%ebx,%r13d
+	rorl	$9,%r14d
+	xorl	%edx,%edi
+
+	movl	%r12d,12(%rsp)
+	xorl	%r9d,%r14d
+	andl	%ebx,%edi
+
+	rorl	$5,%r13d
+	addl	%r8d,%r12d
+	xorl	%edx,%edi
+
+	rorl	$11,%r14d
+	xorl	%ebx,%r13d
+	addl	%edi,%r12d
+
+	movl	%r9d,%edi
+	addl	(%rbp),%r12d
+	xorl	%r9d,%r14d
+
+	xorl	%r10d,%edi
+	rorl	$6,%r13d
+	movl	%r10d,%r8d
+
+	andl	%edi,%r15d
+	rorl	$2,%r14d
+	addl	%r13d,%r12d
+
+	xorl	%r15d,%r8d
+	addl	%r12d,%eax
+	addl	%r12d,%r8d
+
+	leaq	20(%rbp),%rbp
+	movl	20(%rsp),%r13d
+	movl	8(%rsp),%r15d
+
+	movl	%r13d,%r12d
+	rorl	$11,%r13d
+	addl	%r14d,%r8d
+	movl	%r15d,%r14d
+	rorl	$2,%r15d
+
+	xorl	%r12d,%r13d
+	shrl	$3,%r12d
+	rorl	$7,%r13d
+	xorl	%r14d,%r15d
+	shrl	$10,%r14d
+
+	rorl	$17,%r15d
+	xorl	%r13d,%r12d
+	xorl	%r14d,%r15d
+	addl	52(%rsp),%r12d
+
+	addl	16(%rsp),%r12d
+	movl	%eax,%r13d
+	addl	%r15d,%r12d
+	movl	%r8d,%r14d
+	rorl	$14,%r13d
+	movl	%ebx,%r15d
+
+	xorl	%eax,%r13d
+	rorl	$9,%r14d
+	xorl	%ecx,%r15d
+
+	movl	%r12d,16(%rsp)
+	xorl	%r8d,%r14d
+	andl	%eax,%r15d
+
+	rorl	$5,%r13d
+	addl	%edx,%r12d
+	xorl	%ecx,%r15d
+
+	rorl	$11,%r14d
+	xorl	%eax,%r13d
+	addl	%r15d,%r12d
+
+	movl	%r8d,%r15d
+	addl	(%rbp),%r12d
+	xorl	%r8d,%r14d
+
+	xorl	%r9d,%r15d
+	rorl	$6,%r13d
+	movl	%r9d,%edx
+
+	andl	%r15d,%edi
+	rorl	$2,%r14d
+	addl	%r13d,%r12d
+
+	xorl	%edi,%edx
+	addl	%r12d,%r11d
+	addl	%r12d,%edx
+
+	leaq	4(%rbp),%rbp
+	movl	24(%rsp),%r13d
+	movl	12(%rsp),%edi
+
+	movl	%r13d,%r12d
+	rorl	$11,%r13d
+	addl	%r14d,%edx
+	movl	%edi,%r14d
+	rorl	$2,%edi
+
+	xorl	%r12d,%r13d
+	shrl	$3,%r12d
+	rorl	$7,%r13d
+	xorl	%r14d,%edi
+	shrl	$10,%r14d
+
+	rorl	$17,%edi
+	xorl	%r13d,%r12d
+	xorl	%r14d,%edi
+	addl	56(%rsp),%r12d
+
+	addl	20(%rsp),%r12d
+	movl	%r11d,%r13d
+	addl	%edi,%r12d
+	movl	%edx,%r14d
+	rorl	$14,%r13d
+	movl	%eax,%edi
+
+	xorl	%r11d,%r13d
+	rorl	$9,%r14d
+	xorl	%ebx,%edi
+
+	movl	%r12d,20(%rsp)
+	xorl	%edx,%r14d
+	andl	%r11d,%edi
+
+	rorl	$5,%r13d
+	addl	%ecx,%r12d
+	xorl	%ebx,%edi
+
+	rorl	$11,%r14d
+	xorl	%r11d,%r13d
+	addl	%edi,%r12d
+
+	movl	%edx,%edi
+	addl	(%rbp),%r12d
+	xorl	%edx,%r14d
+
+	xorl	%r8d,%edi
+	rorl	$6,%r13d
+	movl	%r8d,%ecx
+
+	andl	%edi,%r15d
+	rorl	$2,%r14d
+	addl	%r13d,%r12d
+
+	xorl	%r15d,%ecx
+	addl	%r12d,%r10d
+	addl	%r12d,%ecx
+
+	leaq	4(%rbp),%rbp
+	movl	28(%rsp),%r13d
+	movl	16(%rsp),%r15d
+
+	movl	%r13d,%r12d
+	rorl	$11,%r13d
+	addl	%r14d,%ecx
+	movl	%r15d,%r14d
+	rorl	$2,%r15d
+
+	xorl	%r12d,%r13d
+	shrl	$3,%r12d
+	rorl	$7,%r13d
+	xorl	%r14d,%r15d
+	shrl	$10,%r14d
+
+	rorl	$17,%r15d
+	xorl	%r13d,%r12d
+	xorl	%r14d,%r15d
+	addl	60(%rsp),%r12d
+
+	addl	24(%rsp),%r12d
+	movl	%r10d,%r13d
+	addl	%r15d,%r12d
+	movl	%ecx,%r14d
+	rorl	$14,%r13d
+	movl	%r11d,%r15d
+
+	xorl	%r10d,%r13d
+	rorl	$9,%r14d
+	xorl	%eax,%r15d
+
+	movl	%r12d,24(%rsp)
+	xorl	%ecx,%r14d
+	andl	%r10d,%r15d
+
+	rorl	$5,%r13d
+	addl	%ebx,%r12d
+	xorl	%eax,%r15d
+
+	rorl	$11,%r14d
+	xorl	%r10d,%r13d
+	addl	%r15d,%r12d
+
+	movl	%ecx,%r15d
+	addl	(%rbp),%r12d
+	xorl	%ecx,%r14d
+
+	xorl	%edx,%r15d
+	rorl	$6,%r13d
+	movl	%edx,%ebx
+
+	andl	%r15d,%edi
+	rorl	$2,%r14d
+	addl	%r13d,%r12d
+
+	xorl	%edi,%ebx
+	addl	%r12d,%r9d
+	addl	%r12d,%ebx
+
+	leaq	4(%rbp),%rbp
+	movl	32(%rsp),%r13d
+	movl	20(%rsp),%edi
+
+	movl	%r13d,%r12d
+	rorl	$11,%r13d
+	addl	%r14d,%ebx
+	movl	%edi,%r14d
+	rorl	$2,%edi
+
+	xorl	%r12d,%r13d
+	shrl	$3,%r12d
+	rorl	$7,%r13d
+	xorl	%r14d,%edi
+	shrl	$10,%r14d
+
+	rorl	$17,%edi
+	xorl	%r13d,%r12d
+	xorl	%r14d,%edi
+	addl	0(%rsp),%r12d
+
+	addl	28(%rsp),%r12d
+	movl	%r9d,%r13d
+	addl	%edi,%r12d
+	movl	%ebx,%r14d
+	rorl	$14,%r13d
+	movl	%r10d,%edi
+
+	xorl	%r9d,%r13d
+	rorl	$9,%r14d
+	xorl	%r11d,%edi
+
+	movl	%r12d,28(%rsp)
+	xorl	%ebx,%r14d
+	andl	%r9d,%edi
+
+	rorl	$5,%r13d
+	addl	%eax,%r12d
+	xorl	%r11d,%edi
+
+	rorl	$11,%r14d
+	xorl	%r9d,%r13d
+	addl	%edi,%r12d
+
+	movl	%ebx,%edi
+	addl	(%rbp),%r12d
+	xorl	%ebx,%r14d
+
+	xorl	%ecx,%edi
+	rorl	$6,%r13d
+	movl	%ecx,%eax
+
+	andl	%edi,%r15d
+	rorl	$2,%r14d
+	addl	%r13d,%r12d
+
+	xorl	%r15d,%eax
+	addl	%r12d,%r8d
+	addl	%r12d,%eax
+
+	leaq	20(%rbp),%rbp
+	movl	36(%rsp),%r13d
+	movl	24(%rsp),%r15d
+
+	movl	%r13d,%r12d
+	rorl	$11,%r13d
+	addl	%r14d,%eax
+	movl	%r15d,%r14d
+	rorl	$2,%r15d
+
+	xorl	%r12d,%r13d
+	shrl	$3,%r12d
+	rorl	$7,%r13d
+	xorl	%r14d,%r15d
+	shrl	$10,%r14d
+
+	rorl	$17,%r15d
+	xorl	%r13d,%r12d
+	xorl	%r14d,%r15d
+	addl	4(%rsp),%r12d
+
+	addl	32(%rsp),%r12d
+	movl	%r8d,%r13d
+	addl	%r15d,%r12d
+	movl	%eax,%r14d
+	rorl	$14,%r13d
+	movl	%r9d,%r15d
+
+	xorl	%r8d,%r13d
+	rorl	$9,%r14d
+	xorl	%r10d,%r15d
+
+	movl	%r12d,32(%rsp)
+	xorl	%eax,%r14d
+	andl	%r8d,%r15d
+
+	rorl	$5,%r13d
+	addl	%r11d,%r12d
+	xorl	%r10d,%r15d
+
+	rorl	$11,%r14d
+	xorl	%r8d,%r13d
+	addl	%r15d,%r12d
+
+	movl	%eax,%r15d
+	addl	(%rbp),%r12d
+	xorl	%eax,%r14d
+
+	xorl	%ebx,%r15d
+	rorl	$6,%r13d
+	movl	%ebx,%r11d
+
+	andl	%r15d,%edi
+	rorl	$2,%r14d
+	addl	%r13d,%r12d
+
+	xorl	%edi,%r11d
+	addl	%r12d,%edx
+	addl	%r12d,%r11d
+
+	leaq	4(%rbp),%rbp
+	movl	40(%rsp),%r13d
+	movl	28(%rsp),%edi
+
+	movl	%r13d,%r12d
+	rorl	$11,%r13d
+	addl	%r14d,%r11d
+	movl	%edi,%r14d
+	rorl	$2,%edi
+
+	xorl	%r12d,%r13d
+	shrl	$3,%r12d
+	rorl	$7,%r13d
+	xorl	%r14d,%edi
+	shrl	$10,%r14d
+
+	rorl	$17,%edi
+	xorl	%r13d,%r12d
+	xorl	%r14d,%edi
+	addl	8(%rsp),%r12d
+
+	addl	36(%rsp),%r12d
+	movl	%edx,%r13d
+	addl	%edi,%r12d
+	movl	%r11d,%r14d
+	rorl	$14,%r13d
+	movl	%r8d,%edi
+
+	xorl	%edx,%r13d
+	rorl	$9,%r14d
+	xorl	%r9d,%edi
+
+	movl	%r12d,36(%rsp)
+	xorl	%r11d,%r14d
+	andl	%edx,%edi
+
+	rorl	$5,%r13d
+	addl	%r10d,%r12d
+	xorl	%r9d,%edi
+
+	rorl	$11,%r14d
+	xorl	%edx,%r13d
+	addl	%edi,%r12d
+
+	movl	%r11d,%edi
+	addl	(%rbp),%r12d
+	xorl	%r11d,%r14d
+
+	xorl	%eax,%edi
+	rorl	$6,%r13d
+	movl	%eax,%r10d
+
+	andl	%edi,%r15d
+	rorl	$2,%r14d
+	addl	%r13d,%r12d
+
+	xorl	%r15d,%r10d
+	addl	%r12d,%ecx
+	addl	%r12d,%r10d
+
+	leaq	4(%rbp),%rbp
+	movl	44(%rsp),%r13d
+	movl	32(%rsp),%r15d
+
+	movl	%r13d,%r12d
+	rorl	$11,%r13d
+	addl	%r14d,%r10d
+	movl	%r15d,%r14d
+	rorl	$2,%r15d
+
+	xorl	%r12d,%r13d
+	shrl	$3,%r12d
+	rorl	$7,%r13d
+	xorl	%r14d,%r15d
+	shrl	$10,%r14d
+
+	rorl	$17,%r15d
+	xorl	%r13d,%r12d
+	xorl	%r14d,%r15d
+	addl	12(%rsp),%r12d
+
+	addl	40(%rsp),%r12d
+	movl	%ecx,%r13d
+	addl	%r15d,%r12d
+	movl	%r10d,%r14d
+	rorl	$14,%r13d
+	movl	%edx,%r15d
+
+	xorl	%ecx,%r13d
+	rorl	$9,%r14d
+	xorl	%r8d,%r15d
+
+	movl	%r12d,40(%rsp)
+	xorl	%r10d,%r14d
+	andl	%ecx,%r15d
+
+	rorl	$5,%r13d
+	addl	%r9d,%r12d
+	xorl	%r8d,%r15d
+
+	rorl	$11,%r14d
+	xorl	%ecx,%r13d
+	addl	%r15d,%r12d
+
+	movl	%r10d,%r15d
+	addl	(%rbp),%r12d
+	xorl	%r10d,%r14d
+
+	xorl	%r11d,%r15d
+	rorl	$6,%r13d
+	movl	%r11d,%r9d
+
+	andl	%r15d,%edi
+	rorl	$2,%r14d
+	addl	%r13d,%r12d
+
+	xorl	%edi,%r9d
+	addl	%r12d,%ebx
+	addl	%r12d,%r9d
+
+	leaq	4(%rbp),%rbp
+	movl	48(%rsp),%r13d
+	movl	36(%rsp),%edi
+
+	movl	%r13d,%r12d
+	rorl	$11,%r13d
+	addl	%r14d,%r9d
+	movl	%edi,%r14d
+	rorl	$2,%edi
+
+	xorl	%r12d,%r13d
+	shrl	$3,%r12d
+	rorl	$7,%r13d
+	xorl	%r14d,%edi
+	shrl	$10,%r14d
+
+	rorl	$17,%edi
+	xorl	%r13d,%r12d
+	xorl	%r14d,%edi
+	addl	16(%rsp),%r12d
+
+	addl	44(%rsp),%r12d
+	movl	%ebx,%r13d
+	addl	%edi,%r12d
+	movl	%r9d,%r14d
+	rorl	$14,%r13d
+	movl	%ecx,%edi
+
+	xorl	%ebx,%r13d
+	rorl	$9,%r14d
+	xorl	%edx,%edi
+
+	movl	%r12d,44(%rsp)
+	xorl	%r9d,%r14d
+	andl	%ebx,%edi
+
+	rorl	$5,%r13d
+	addl	%r8d,%r12d
+	xorl	%edx,%edi
+
+	rorl	$11,%r14d
+	xorl	%ebx,%r13d
+	addl	%edi,%r12d
+
+	movl	%r9d,%edi
+	addl	(%rbp),%r12d
+	xorl	%r9d,%r14d
+
+	xorl	%r10d,%edi
+	rorl	$6,%r13d
+	movl	%r10d,%r8d
+
+	andl	%edi,%r15d
+	rorl	$2,%r14d
+	addl	%r13d,%r12d
+
+	xorl	%r15d,%r8d
+	addl	%r12d,%eax
+	addl	%r12d,%r8d
+
+	leaq	20(%rbp),%rbp
+	movl	52(%rsp),%r13d
+	movl	40(%rsp),%r15d
+
+	movl	%r13d,%r12d
+	rorl	$11,%r13d
+	addl	%r14d,%r8d
+	movl	%r15d,%r14d
+	rorl	$2,%r15d
+
+	xorl	%r12d,%r13d
+	shrl	$3,%r12d
+	rorl	$7,%r13d
+	xorl	%r14d,%r15d
+	shrl	$10,%r14d
+
+	rorl	$17,%r15d
+	xorl	%r13d,%r12d
+	xorl	%r14d,%r15d
+	addl	20(%rsp),%r12d
+
+	addl	48(%rsp),%r12d
+	movl	%eax,%r13d
+	addl	%r15d,%r12d
+	movl	%r8d,%r14d
+	rorl	$14,%r13d
+	movl	%ebx,%r15d
+
+	xorl	%eax,%r13d
+	rorl	$9,%r14d
+	xorl	%ecx,%r15d
+
+	movl	%r12d,48(%rsp)
+	xorl	%r8d,%r14d
+	andl	%eax,%r15d
+
+	rorl	$5,%r13d
+	addl	%edx,%r12d
+	xorl	%ecx,%r15d
+
+	rorl	$11,%r14d
+	xorl	%eax,%r13d
+	addl	%r15d,%r12d
+
+	movl	%r8d,%r15d
+	addl	(%rbp),%r12d
+	xorl	%r8d,%r14d
+
+	xorl	%r9d,%r15d
+	rorl	$6,%r13d
+	movl	%r9d,%edx
+
+	andl	%r15d,%edi
+	rorl	$2,%r14d
+	addl	%r13d,%r12d
+
+	xorl	%edi,%edx
+	addl	%r12d,%r11d
+	addl	%r12d,%edx
+
+	leaq	4(%rbp),%rbp
+	movl	56(%rsp),%r13d
+	movl	44(%rsp),%edi
+
+	movl	%r13d,%r12d
+	rorl	$11,%r13d
+	addl	%r14d,%edx
+	movl	%edi,%r14d
+	rorl	$2,%edi
+
+	xorl	%r12d,%r13d
+	shrl	$3,%r12d
+	rorl	$7,%r13d
+	xorl	%r14d,%edi
+	shrl	$10,%r14d
+
+	rorl	$17,%edi
+	xorl	%r13d,%r12d
+	xorl	%r14d,%edi
+	addl	24(%rsp),%r12d
+
+	addl	52(%rsp),%r12d
+	movl	%r11d,%r13d
+	addl	%edi,%r12d
+	movl	%edx,%r14d
+	rorl	$14,%r13d
+	movl	%eax,%edi
+
+	xorl	%r11d,%r13d
+	rorl	$9,%r14d
+	xorl	%ebx,%edi
+
+	movl	%r12d,52(%rsp)
+	xorl	%edx,%r14d
+	andl	%r11d,%edi
+
+	rorl	$5,%r13d
+	addl	%ecx,%r12d
+	xorl	%ebx,%edi
+
+	rorl	$11,%r14d
+	xorl	%r11d,%r13d
+	addl	%edi,%r12d
+
+	movl	%edx,%edi
+	addl	(%rbp),%r12d
+	xorl	%edx,%r14d
+
+	xorl	%r8d,%edi
+	rorl	$6,%r13d
+	movl	%r8d,%ecx
+
+	andl	%edi,%r15d
+	rorl	$2,%r14d
+	addl	%r13d,%r12d
+
+	xorl	%r15d,%ecx
+	addl	%r12d,%r10d
+	addl	%r12d,%ecx
+
+	leaq	4(%rbp),%rbp
+	movl	60(%rsp),%r13d
+	movl	48(%rsp),%r15d
+
+	movl	%r13d,%r12d
+	rorl	$11,%r13d
+	addl	%r14d,%ecx
+	movl	%r15d,%r14d
+	rorl	$2,%r15d
+
+	xorl	%r12d,%r13d
+	shrl	$3,%r12d
+	rorl	$7,%r13d
+	xorl	%r14d,%r15d
+	shrl	$10,%r14d
+
+	rorl	$17,%r15d
+	xorl	%r13d,%r12d
+	xorl	%r14d,%r15d
+	addl	28(%rsp),%r12d
+
+	addl	56(%rsp),%r12d
+	movl	%r10d,%r13d
+	addl	%r15d,%r12d
+	movl	%ecx,%r14d
+	rorl	$14,%r13d
+	movl	%r11d,%r15d
+
+	xorl	%r10d,%r13d
+	rorl	$9,%r14d
+	xorl	%eax,%r15d
+
+	movl	%r12d,56(%rsp)
+	xorl	%ecx,%r14d
+	andl	%r10d,%r15d
+
+	rorl	$5,%r13d
+	addl	%ebx,%r12d
+	xorl	%eax,%r15d
+
+	rorl	$11,%r14d
+	xorl	%r10d,%r13d
+	addl	%r15d,%r12d
+
+	movl	%ecx,%r15d
+	addl	(%rbp),%r12d
+	xorl	%ecx,%r14d
+
+	xorl	%edx,%r15d
+	rorl	$6,%r13d
+	movl	%edx,%ebx
+
+	andl	%r15d,%edi
+	rorl	$2,%r14d
+	addl	%r13d,%r12d
+
+	xorl	%edi,%ebx
+	addl	%r12d,%r9d
+	addl	%r12d,%ebx
+
+	leaq	4(%rbp),%rbp
+	movl	0(%rsp),%r13d
+	movl	52(%rsp),%edi
+
+	movl	%r13d,%r12d
+	rorl	$11,%r13d
+	addl	%r14d,%ebx
+	movl	%edi,%r14d
+	rorl	$2,%edi
+
+	xorl	%r12d,%r13d
+	shrl	$3,%r12d
+	rorl	$7,%r13d
+	xorl	%r14d,%edi
+	shrl	$10,%r14d
+
+	rorl	$17,%edi
+	xorl	%r13d,%r12d
+	xorl	%r14d,%edi
+	addl	32(%rsp),%r12d
+
+	addl	60(%rsp),%r12d
+	movl	%r9d,%r13d
+	addl	%edi,%r12d
+	movl	%ebx,%r14d
+	rorl	$14,%r13d
+	movl	%r10d,%edi
+
+	xorl	%r9d,%r13d
+	rorl	$9,%r14d
+	xorl	%r11d,%edi
+
+	movl	%r12d,60(%rsp)
+	xorl	%ebx,%r14d
+	andl	%r9d,%edi
+
+	rorl	$5,%r13d
+	addl	%eax,%r12d
+	xorl	%r11d,%edi
+
+	rorl	$11,%r14d
+	xorl	%r9d,%r13d
+	addl	%edi,%r12d
+
+	movl	%ebx,%edi
+	addl	(%rbp),%r12d
+	xorl	%ebx,%r14d
+
+	xorl	%ecx,%edi
+	rorl	$6,%r13d
+	movl	%ecx,%eax
+
+	andl	%edi,%r15d
+	rorl	$2,%r14d
+	addl	%r13d,%r12d
+
+	xorl	%r15d,%eax
+	addl	%r12d,%r8d
+	addl	%r12d,%eax
+
+	leaq	20(%rbp),%rbp
+	cmpb	$0,3(%rbp)
+	jnz	L$rounds_16_xx
+
+	movq	64+0(%rsp),%rdi
+	addl	%r14d,%eax
+	leaq	64(%rsi),%rsi
+
+	addl	0(%rdi),%eax
+	addl	4(%rdi),%ebx
+	addl	8(%rdi),%ecx
+	addl	12(%rdi),%edx
+	addl	16(%rdi),%r8d
+	addl	20(%rdi),%r9d
+	addl	24(%rdi),%r10d
+	addl	28(%rdi),%r11d
+
+	cmpq	64+16(%rsp),%rsi
+
+	movl	%eax,0(%rdi)
+	movl	%ebx,4(%rdi)
+	movl	%ecx,8(%rdi)
+	movl	%edx,12(%rdi)
+	movl	%r8d,16(%rdi)
+	movl	%r9d,20(%rdi)
+	movl	%r10d,24(%rdi)
+	movl	%r11d,28(%rdi)
+	jb	L$loop
+
+	movq	64+24(%rsp),%rsi
+	movq	(%rsi),%r15
+	movq	8(%rsi),%r14
+	movq	16(%rsi),%r13
+	movq	24(%rsi),%r12
+	movq	32(%rsi),%rbp
+	movq	40(%rsi),%rbx
+	leaq	48(%rsi),%rsp
+L$epilogue:
+	.byte	0xf3,0xc3
+
+.p2align	6
+
+K256:
+.long	0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5
+.long	0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5
+.long	0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5
+.long	0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5
+.long	0xd807aa98,0x12835b01,0x243185be,0x550c7dc3
+.long	0xd807aa98,0x12835b01,0x243185be,0x550c7dc3
+.long	0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174
+.long	0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174
+.long	0xe49b69c1,0xefbe4786,0x0fc19dc6,0x240ca1cc
+.long	0xe49b69c1,0xefbe4786,0x0fc19dc6,0x240ca1cc
+.long	0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da
+.long	0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da
+.long	0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7
+.long	0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7
+.long	0xc6e00bf3,0xd5a79147,0x06ca6351,0x14292967
+.long	0xc6e00bf3,0xd5a79147,0x06ca6351,0x14292967
+.long	0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13
+.long	0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13
+.long	0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85
+.long	0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85
+.long	0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3
+.long	0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3
+.long	0xd192e819,0xd6990624,0xf40e3585,0x106aa070
+.long	0xd192e819,0xd6990624,0xf40e3585,0x106aa070
+.long	0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5
+.long	0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5
+.long	0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3
+.long	0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3
+.long	0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208
+.long	0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208
+.long	0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2
+.long	0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2
+
+.long	0x00010203,0x04050607,0x08090a0b,0x0c0d0e0f
+.long	0x00010203,0x04050607,0x08090a0b,0x0c0d0e0f
+.long	0x03020100,0x0b0a0908,0xffffffff,0xffffffff
+.long	0x03020100,0x0b0a0908,0xffffffff,0xffffffff
+.long	0xffffffff,0xffffffff,0x03020100,0x0b0a0908
+.long	0xffffffff,0xffffffff,0x03020100,0x0b0a0908
+.byte	83,72,65,50,53,54,32,98,108,111,99,107,32,116,114,97,110,115,102,111,114,109,32,102,111,114,32,120,56,54,95,54,52,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0
+
+.p2align	6
+sha256_block_data_order_ssse3:
+L$ssse3_shortcut:
+	pushq	%rbx
+	pushq	%rbp
+	pushq	%r12
+	pushq	%r13
+	pushq	%r14
+	pushq	%r15
+	movq	%rsp,%r11
+	shlq	$4,%rdx
+	subq	$96,%rsp
+	leaq	(%rsi,%rdx,4),%rdx
+	andq	$-64,%rsp
+	movq	%rdi,64+0(%rsp)
+	movq	%rsi,64+8(%rsp)
+	movq	%rdx,64+16(%rsp)
+	movq	%r11,64+24(%rsp)
+L$prologue_ssse3:
+
+	movl	0(%rdi),%eax
+	movl	4(%rdi),%ebx
+	movl	8(%rdi),%ecx
+	movl	12(%rdi),%edx
+	movl	16(%rdi),%r8d
+	movl	20(%rdi),%r9d
+	movl	24(%rdi),%r10d
+	movl	28(%rdi),%r11d
+
+
+	jmp	L$loop_ssse3
+.p2align	4
+L$loop_ssse3:
+	movdqa	K256+512(%rip),%xmm7
+	movdqu	0(%rsi),%xmm0
+	movdqu	16(%rsi),%xmm1
+	movdqu	32(%rsi),%xmm2
+.byte	102,15,56,0,199
+	movdqu	48(%rsi),%xmm3
+	leaq	K256(%rip),%rbp
+.byte	102,15,56,0,207
+	movdqa	0(%rbp),%xmm4
+	movdqa	32(%rbp),%xmm5
+.byte	102,15,56,0,215
+	paddd	%xmm0,%xmm4
+	movdqa	64(%rbp),%xmm6
+.byte	102,15,56,0,223
+	movdqa	96(%rbp),%xmm7
+	paddd	%xmm1,%xmm5
+	paddd	%xmm2,%xmm6
+	paddd	%xmm3,%xmm7
+	movdqa	%xmm4,0(%rsp)
+	movl	%eax,%r14d
+	movdqa	%xmm5,16(%rsp)
+	movl	%ebx,%edi
+	movdqa	%xmm6,32(%rsp)
+	xorl	%ecx,%edi
+	movdqa	%xmm7,48(%rsp)
+	movl	%r8d,%r13d
+	jmp	L$ssse3_00_47
+
+.p2align	4
+L$ssse3_00_47:
+	subq	$-128,%rbp
+	rorl	$14,%r13d
+	movdqa	%xmm1,%xmm4
+	movl	%r14d,%eax
+	movl	%r9d,%r12d
+	movdqa	%xmm3,%xmm7
+	rorl	$9,%r14d
+	xorl	%r8d,%r13d
+	xorl	%r10d,%r12d
+	rorl	$5,%r13d
+	xorl	%eax,%r14d
+.byte	102,15,58,15,224,4
+	andl	%r8d,%r12d
+	xorl	%r8d,%r13d
+.byte	102,15,58,15,250,4
+	addl	0(%rsp),%r11d
+	movl	%eax,%r15d
+	xorl	%r10d,%r12d
+	rorl	$11,%r14d
+	movdqa	%xmm4,%xmm5
+	xorl	%ebx,%r15d
+	addl	%r12d,%r11d
+	movdqa	%xmm4,%xmm6
+	rorl	$6,%r13d
+	andl	%r15d,%edi
+	psrld	$3,%xmm4
+	xorl	%eax,%r14d
+	addl	%r13d,%r11d
+	xorl	%ebx,%edi
+	paddd	%xmm7,%xmm0
+	rorl	$2,%r14d
+	addl	%r11d,%edx
+	psrld	$7,%xmm6
+	addl	%edi,%r11d
+	movl	%edx,%r13d
+	pshufd	$250,%xmm3,%xmm7
+	addl	%r11d,%r14d
+	rorl	$14,%r13d
+	pslld	$14,%xmm5
+	movl	%r14d,%r11d
+	movl	%r8d,%r12d
+	pxor	%xmm6,%xmm4
+	rorl	$9,%r14d
+	xorl	%edx,%r13d
+	xorl	%r9d,%r12d
+	rorl	$5,%r13d
+	psrld	$11,%xmm6
+	xorl	%r11d,%r14d
+	pxor	%xmm5,%xmm4
+	andl	%edx,%r12d
+	xorl	%edx,%r13d
+	pslld	$11,%xmm5
+	addl	4(%rsp),%r10d
+	movl	%r11d,%edi
+	pxor	%xmm6,%xmm4
+	xorl	%r9d,%r12d
+	rorl	$11,%r14d
+	movdqa	%xmm7,%xmm6
+	xorl	%eax,%edi
+	addl	%r12d,%r10d
+	pxor	%xmm5,%xmm4
+	rorl	$6,%r13d
+	andl	%edi,%r15d
+	xorl	%r11d,%r14d
+	psrld	$10,%xmm7
+	addl	%r13d,%r10d
+	xorl	%eax,%r15d
+	paddd	%xmm4,%xmm0
+	rorl	$2,%r14d
+	addl	%r10d,%ecx
+	psrlq	$17,%xmm6
+	addl	%r15d,%r10d
+	movl	%ecx,%r13d
+	addl	%r10d,%r14d
+	pxor	%xmm6,%xmm7
+	rorl	$14,%r13d
+	movl	%r14d,%r10d
+	movl	%edx,%r12d
+	rorl	$9,%r14d
+	psrlq	$2,%xmm6
+	xorl	%ecx,%r13d
+	xorl	%r8d,%r12d
+	pxor	%xmm6,%xmm7
+	rorl	$5,%r13d
+	xorl	%r10d,%r14d
+	andl	%ecx,%r12d
+	pshufd	$128,%xmm7,%xmm7
+	xorl	%ecx,%r13d
+	addl	8(%rsp),%r9d
+	movl	%r10d,%r15d
+	psrldq	$8,%xmm7
+	xorl	%r8d,%r12d
+	rorl	$11,%r14d
+	xorl	%r11d,%r15d
+	addl	%r12d,%r9d
+	rorl	$6,%r13d
+	paddd	%xmm7,%xmm0
+	andl	%r15d,%edi
+	xorl	%r10d,%r14d
+	addl	%r13d,%r9d
+	pshufd	$80,%xmm0,%xmm7
+	xorl	%r11d,%edi
+	rorl	$2,%r14d
+	addl	%r9d,%ebx
+	movdqa	%xmm7,%xmm6
+	addl	%edi,%r9d
+	movl	%ebx,%r13d
+	psrld	$10,%xmm7
+	addl	%r9d,%r14d
+	rorl	$14,%r13d
+	psrlq	$17,%xmm6
+	movl	%r14d,%r9d
+	movl	%ecx,%r12d
+	pxor	%xmm6,%xmm7
+	rorl	$9,%r14d
+	xorl	%ebx,%r13d
+	xorl	%edx,%r12d
+	rorl	$5,%r13d
+	xorl	%r9d,%r14d
+	psrlq	$2,%xmm6
+	andl	%ebx,%r12d
+	xorl	%ebx,%r13d
+	addl	12(%rsp),%r8d
+	pxor	%xmm6,%xmm7
+	movl	%r9d,%edi
+	xorl	%edx,%r12d
+	rorl	$11,%r14d
+	pshufd	$8,%xmm7,%xmm7
+	xorl	%r10d,%edi
+	addl	%r12d,%r8d
+	movdqa	0(%rbp),%xmm6
+	rorl	$6,%r13d
+	andl	%edi,%r15d
+	pslldq	$8,%xmm7
+	xorl	%r9d,%r14d
+	addl	%r13d,%r8d
+	xorl	%r10d,%r15d
+	paddd	%xmm7,%xmm0
+	rorl	$2,%r14d
+	addl	%r8d,%eax
+	addl	%r15d,%r8d
+	paddd	%xmm0,%xmm6
+	movl	%eax,%r13d
+	addl	%r8d,%r14d
+	movdqa	%xmm6,0(%rsp)
+	rorl	$14,%r13d
+	movdqa	%xmm2,%xmm4
+	movl	%r14d,%r8d
+	movl	%ebx,%r12d
+	movdqa	%xmm0,%xmm7
+	rorl	$9,%r14d
+	xorl	%eax,%r13d
+	xorl	%ecx,%r12d
+	rorl	$5,%r13d
+	xorl	%r8d,%r14d
+.byte	102,15,58,15,225,4
+	andl	%eax,%r12d
+	xorl	%eax,%r13d
+.byte	102,15,58,15,251,4
+	addl	16(%rsp),%edx
+	movl	%r8d,%r15d
+	xorl	%ecx,%r12d
+	rorl	$11,%r14d
+	movdqa	%xmm4,%xmm5
+	xorl	%r9d,%r15d
+	addl	%r12d,%edx
+	movdqa	%xmm4,%xmm6
+	rorl	$6,%r13d
+	andl	%r15d,%edi
+	psrld	$3,%xmm4
+	xorl	%r8d,%r14d
+	addl	%r13d,%edx
+	xorl	%r9d,%edi
+	paddd	%xmm7,%xmm1
+	rorl	$2,%r14d
+	addl	%edx,%r11d
+	psrld	$7,%xmm6
+	addl	%edi,%edx
+	movl	%r11d,%r13d
+	pshufd	$250,%xmm0,%xmm7
+	addl	%edx,%r14d
+	rorl	$14,%r13d
+	pslld	$14,%xmm5
+	movl	%r14d,%edx
+	movl	%eax,%r12d
+	pxor	%xmm6,%xmm4
+	rorl	$9,%r14d
+	xorl	%r11d,%r13d
+	xorl	%ebx,%r12d
+	rorl	$5,%r13d
+	psrld	$11,%xmm6
+	xorl	%edx,%r14d
+	pxor	%xmm5,%xmm4
+	andl	%r11d,%r12d
+	xorl	%r11d,%r13d
+	pslld	$11,%xmm5
+	addl	20(%rsp),%ecx
+	movl	%edx,%edi
+	pxor	%xmm6,%xmm4
+	xorl	%ebx,%r12d
+	rorl	$11,%r14d
+	movdqa	%xmm7,%xmm6
+	xorl	%r8d,%edi
+	addl	%r12d,%ecx
+	pxor	%xmm5,%xmm4
+	rorl	$6,%r13d
+	andl	%edi,%r15d
+	xorl	%edx,%r14d
+	psrld	$10,%xmm7
+	addl	%r13d,%ecx
+	xorl	%r8d,%r15d
+	paddd	%xmm4,%xmm1
+	rorl	$2,%r14d
+	addl	%ecx,%r10d
+	psrlq	$17,%xmm6
+	addl	%r15d,%ecx
+	movl	%r10d,%r13d
+	addl	%ecx,%r14d
+	pxor	%xmm6,%xmm7
+	rorl	$14,%r13d
+	movl	%r14d,%ecx
+	movl	%r11d,%r12d
+	rorl	$9,%r14d
+	psrlq	$2,%xmm6
+	xorl	%r10d,%r13d
+	xorl	%eax,%r12d
+	pxor	%xmm6,%xmm7
+	rorl	$5,%r13d
+	xorl	%ecx,%r14d
+	andl	%r10d,%r12d
+	pshufd	$128,%xmm7,%xmm7
+	xorl	%r10d,%r13d
+	addl	24(%rsp),%ebx
+	movl	%ecx,%r15d
+	psrldq	$8,%xmm7
+	xorl	%eax,%r12d
+	rorl	$11,%r14d
+	xorl	%edx,%r15d
+	addl	%r12d,%ebx
+	rorl	$6,%r13d
+	paddd	%xmm7,%xmm1
+	andl	%r15d,%edi
+	xorl	%ecx,%r14d
+	addl	%r13d,%ebx
+	pshufd	$80,%xmm1,%xmm7
+	xorl	%edx,%edi
+	rorl	$2,%r14d
+	addl	%ebx,%r9d
+	movdqa	%xmm7,%xmm6
+	addl	%edi,%ebx
+	movl	%r9d,%r13d
+	psrld	$10,%xmm7
+	addl	%ebx,%r14d
+	rorl	$14,%r13d
+	psrlq	$17,%xmm6
+	movl	%r14d,%ebx
+	movl	%r10d,%r12d
+	pxor	%xmm6,%xmm7
+	rorl	$9,%r14d
+	xorl	%r9d,%r13d
+	xorl	%r11d,%r12d
+	rorl	$5,%r13d
+	xorl	%ebx,%r14d
+	psrlq	$2,%xmm6
+	andl	%r9d,%r12d
+	xorl	%r9d,%r13d
+	addl	28(%rsp),%eax
+	pxor	%xmm6,%xmm7
+	movl	%ebx,%edi
+	xorl	%r11d,%r12d
+	rorl	$11,%r14d
+	pshufd	$8,%xmm7,%xmm7
+	xorl	%ecx,%edi
+	addl	%r12d,%eax
+	movdqa	32(%rbp),%xmm6
+	rorl	$6,%r13d
+	andl	%edi,%r15d
+	pslldq	$8,%xmm7
+	xorl	%ebx,%r14d
+	addl	%r13d,%eax
+	xorl	%ecx,%r15d
+	paddd	%xmm7,%xmm1
+	rorl	$2,%r14d
+	addl	%eax,%r8d
+	addl	%r15d,%eax
+	paddd	%xmm1,%xmm6
+	movl	%r8d,%r13d
+	addl	%eax,%r14d
+	movdqa	%xmm6,16(%rsp)
+	rorl	$14,%r13d
+	movdqa	%xmm3,%xmm4
+	movl	%r14d,%eax
+	movl	%r9d,%r12d
+	movdqa	%xmm1,%xmm7
+	rorl	$9,%r14d
+	xorl	%r8d,%r13d
+	xorl	%r10d,%r12d
+	rorl	$5,%r13d
+	xorl	%eax,%r14d
+.byte	102,15,58,15,226,4
+	andl	%r8d,%r12d
+	xorl	%r8d,%r13d
+.byte	102,15,58,15,248,4
+	addl	32(%rsp),%r11d
+	movl	%eax,%r15d
+	xorl	%r10d,%r12d
+	rorl	$11,%r14d
+	movdqa	%xmm4,%xmm5
+	xorl	%ebx,%r15d
+	addl	%r12d,%r11d
+	movdqa	%xmm4,%xmm6
+	rorl	$6,%r13d
+	andl	%r15d,%edi
+	psrld	$3,%xmm4
+	xorl	%eax,%r14d
+	addl	%r13d,%r11d
+	xorl	%ebx,%edi
+	paddd	%xmm7,%xmm2
+	rorl	$2,%r14d
+	addl	%r11d,%edx
+	psrld	$7,%xmm6
+	addl	%edi,%r11d
+	movl	%edx,%r13d
+	pshufd	$250,%xmm1,%xmm7
+	addl	%r11d,%r14d
+	rorl	$14,%r13d
+	pslld	$14,%xmm5
+	movl	%r14d,%r11d
+	movl	%r8d,%r12d
+	pxor	%xmm6,%xmm4
+	rorl	$9,%r14d
+	xorl	%edx,%r13d
+	xorl	%r9d,%r12d
+	rorl	$5,%r13d
+	psrld	$11,%xmm6
+	xorl	%r11d,%r14d
+	pxor	%xmm5,%xmm4
+	andl	%edx,%r12d
+	xorl	%edx,%r13d
+	pslld	$11,%xmm5
+	addl	36(%rsp),%r10d
+	movl	%r11d,%edi
+	pxor	%xmm6,%xmm4
+	xorl	%r9d,%r12d
+	rorl	$11,%r14d
+	movdqa	%xmm7,%xmm6
+	xorl	%eax,%edi
+	addl	%r12d,%r10d
+	pxor	%xmm5,%xmm4
+	rorl	$6,%r13d
+	andl	%edi,%r15d
+	xorl	%r11d,%r14d
+	psrld	$10,%xmm7
+	addl	%r13d,%r10d
+	xorl	%eax,%r15d
+	paddd	%xmm4,%xmm2
+	rorl	$2,%r14d
+	addl	%r10d,%ecx
+	psrlq	$17,%xmm6
+	addl	%r15d,%r10d
+	movl	%ecx,%r13d
+	addl	%r10d,%r14d
+	pxor	%xmm6,%xmm7
+	rorl	$14,%r13d
+	movl	%r14d,%r10d
+	movl	%edx,%r12d
+	rorl	$9,%r14d
+	psrlq	$2,%xmm6
+	xorl	%ecx,%r13d
+	xorl	%r8d,%r12d
+	pxor	%xmm6,%xmm7
+	rorl	$5,%r13d
+	xorl	%r10d,%r14d
+	andl	%ecx,%r12d
+	pshufd	$128,%xmm7,%xmm7
+	xorl	%ecx,%r13d
+	addl	40(%rsp),%r9d
+	movl	%r10d,%r15d
+	psrldq	$8,%xmm7
+	xorl	%r8d,%r12d
+	rorl	$11,%r14d
+	xorl	%r11d,%r15d
+	addl	%r12d,%r9d
+	rorl	$6,%r13d
+	paddd	%xmm7,%xmm2
+	andl	%r15d,%edi
+	xorl	%r10d,%r14d
+	addl	%r13d,%r9d
+	pshufd	$80,%xmm2,%xmm7
+	xorl	%r11d,%edi
+	rorl	$2,%r14d
+	addl	%r9d,%ebx
+	movdqa	%xmm7,%xmm6
+	addl	%edi,%r9d
+	movl	%ebx,%r13d
+	psrld	$10,%xmm7
+	addl	%r9d,%r14d
+	rorl	$14,%r13d
+	psrlq	$17,%xmm6
+	movl	%r14d,%r9d
+	movl	%ecx,%r12d
+	pxor	%xmm6,%xmm7
+	rorl	$9,%r14d
+	xorl	%ebx,%r13d
+	xorl	%edx,%r12d
+	rorl	$5,%r13d
+	xorl	%r9d,%r14d
+	psrlq	$2,%xmm6
+	andl	%ebx,%r12d
+	xorl	%ebx,%r13d
+	addl	44(%rsp),%r8d
+	pxor	%xmm6,%xmm7
+	movl	%r9d,%edi
+	xorl	%edx,%r12d
+	rorl	$11,%r14d
+	pshufd	$8,%xmm7,%xmm7
+	xorl	%r10d,%edi
+	addl	%r12d,%r8d
+	movdqa	64(%rbp),%xmm6
+	rorl	$6,%r13d
+	andl	%edi,%r15d
+	pslldq	$8,%xmm7
+	xorl	%r9d,%r14d
+	addl	%r13d,%r8d
+	xorl	%r10d,%r15d
+	paddd	%xmm7,%xmm2
+	rorl	$2,%r14d
+	addl	%r8d,%eax
+	addl	%r15d,%r8d
+	paddd	%xmm2,%xmm6
+	movl	%eax,%r13d
+	addl	%r8d,%r14d
+	movdqa	%xmm6,32(%rsp)
+	rorl	$14,%r13d
+	movdqa	%xmm0,%xmm4
+	movl	%r14d,%r8d
+	movl	%ebx,%r12d
+	movdqa	%xmm2,%xmm7
+	rorl	$9,%r14d
+	xorl	%eax,%r13d
+	xorl	%ecx,%r12d
+	rorl	$5,%r13d
+	xorl	%r8d,%r14d
+.byte	102,15,58,15,227,4
+	andl	%eax,%r12d
+	xorl	%eax,%r13d
+.byte	102,15,58,15,249,4
+	addl	48(%rsp),%edx
+	movl	%r8d,%r15d
+	xorl	%ecx,%r12d
+	rorl	$11,%r14d
+	movdqa	%xmm4,%xmm5
+	xorl	%r9d,%r15d
+	addl	%r12d,%edx
+	movdqa	%xmm4,%xmm6
+	rorl	$6,%r13d
+	andl	%r15d,%edi
+	psrld	$3,%xmm4
+	xorl	%r8d,%r14d
+	addl	%r13d,%edx
+	xorl	%r9d,%edi
+	paddd	%xmm7,%xmm3
+	rorl	$2,%r14d
+	addl	%edx,%r11d
+	psrld	$7,%xmm6
+	addl	%edi,%edx
+	movl	%r11d,%r13d
+	pshufd	$250,%xmm2,%xmm7
+	addl	%edx,%r14d
+	rorl	$14,%r13d
+	pslld	$14,%xmm5
+	movl	%r14d,%edx
+	movl	%eax,%r12d
+	pxor	%xmm6,%xmm4
+	rorl	$9,%r14d
+	xorl	%r11d,%r13d
+	xorl	%ebx,%r12d
+	rorl	$5,%r13d
+	psrld	$11,%xmm6
+	xorl	%edx,%r14d
+	pxor	%xmm5,%xmm4
+	andl	%r11d,%r12d
+	xorl	%r11d,%r13d
+	pslld	$11,%xmm5
+	addl	52(%rsp),%ecx
+	movl	%edx,%edi
+	pxor	%xmm6,%xmm4
+	xorl	%ebx,%r12d
+	rorl	$11,%r14d
+	movdqa	%xmm7,%xmm6
+	xorl	%r8d,%edi
+	addl	%r12d,%ecx
+	pxor	%xmm5,%xmm4
+	rorl	$6,%r13d
+	andl	%edi,%r15d
+	xorl	%edx,%r14d
+	psrld	$10,%xmm7
+	addl	%r13d,%ecx
+	xorl	%r8d,%r15d
+	paddd	%xmm4,%xmm3
+	rorl	$2,%r14d
+	addl	%ecx,%r10d
+	psrlq	$17,%xmm6
+	addl	%r15d,%ecx
+	movl	%r10d,%r13d
+	addl	%ecx,%r14d
+	pxor	%xmm6,%xmm7
+	rorl	$14,%r13d
+	movl	%r14d,%ecx
+	movl	%r11d,%r12d
+	rorl	$9,%r14d
+	psrlq	$2,%xmm6
+	xorl	%r10d,%r13d
+	xorl	%eax,%r12d
+	pxor	%xmm6,%xmm7
+	rorl	$5,%r13d
+	xorl	%ecx,%r14d
+	andl	%r10d,%r12d
+	pshufd	$128,%xmm7,%xmm7
+	xorl	%r10d,%r13d
+	addl	56(%rsp),%ebx
+	movl	%ecx,%r15d
+	psrldq	$8,%xmm7
+	xorl	%eax,%r12d
+	rorl	$11,%r14d
+	xorl	%edx,%r15d
+	addl	%r12d,%ebx
+	rorl	$6,%r13d
+	paddd	%xmm7,%xmm3
+	andl	%r15d,%edi
+	xorl	%ecx,%r14d
+	addl	%r13d,%ebx
+	pshufd	$80,%xmm3,%xmm7
+	xorl	%edx,%edi
+	rorl	$2,%r14d
+	addl	%ebx,%r9d
+	movdqa	%xmm7,%xmm6
+	addl	%edi,%ebx
+	movl	%r9d,%r13d
+	psrld	$10,%xmm7
+	addl	%ebx,%r14d
+	rorl	$14,%r13d
+	psrlq	$17,%xmm6
+	movl	%r14d,%ebx
+	movl	%r10d,%r12d
+	pxor	%xmm6,%xmm7
+	rorl	$9,%r14d
+	xorl	%r9d,%r13d
+	xorl	%r11d,%r12d
+	rorl	$5,%r13d
+	xorl	%ebx,%r14d
+	psrlq	$2,%xmm6
+	andl	%r9d,%r12d
+	xorl	%r9d,%r13d
+	addl	60(%rsp),%eax
+	pxor	%xmm6,%xmm7
+	movl	%ebx,%edi
+	xorl	%r11d,%r12d
+	rorl	$11,%r14d
+	pshufd	$8,%xmm7,%xmm7
+	xorl	%ecx,%edi
+	addl	%r12d,%eax
+	movdqa	96(%rbp),%xmm6
+	rorl	$6,%r13d
+	andl	%edi,%r15d
+	pslldq	$8,%xmm7
+	xorl	%ebx,%r14d
+	addl	%r13d,%eax
+	xorl	%ecx,%r15d
+	paddd	%xmm7,%xmm3
+	rorl	$2,%r14d
+	addl	%eax,%r8d
+	addl	%r15d,%eax
+	paddd	%xmm3,%xmm6
+	movl	%r8d,%r13d
+	addl	%eax,%r14d
+	movdqa	%xmm6,48(%rsp)
+	cmpb	$0,131(%rbp)
+	jne	L$ssse3_00_47
+	rorl	$14,%r13d
+	movl	%r14d,%eax
+	movl	%r9d,%r12d
+	rorl	$9,%r14d
+	xorl	%r8d,%r13d
+	xorl	%r10d,%r12d
+	rorl	$5,%r13d
+	xorl	%eax,%r14d
+	andl	%r8d,%r12d
+	xorl	%r8d,%r13d
+	addl	0(%rsp),%r11d
+	movl	%eax,%r15d
+	xorl	%r10d,%r12d
+	rorl	$11,%r14d
+	xorl	%ebx,%r15d
+	addl	%r12d,%r11d
+	rorl	$6,%r13d
+	andl	%r15d,%edi
+	xorl	%eax,%r14d
+	addl	%r13d,%r11d
+	xorl	%ebx,%edi
+	rorl	$2,%r14d
+	addl	%r11d,%edx
+	addl	%edi,%r11d
+	movl	%edx,%r13d
+	addl	%r11d,%r14d
+	rorl	$14,%r13d
+	movl	%r14d,%r11d
+	movl	%r8d,%r12d
+	rorl	$9,%r14d
+	xorl	%edx,%r13d
+	xorl	%r9d,%r12d
+	rorl	$5,%r13d
+	xorl	%r11d,%r14d
+	andl	%edx,%r12d
+	xorl	%edx,%r13d
+	addl	4(%rsp),%r10d
+	movl	%r11d,%edi
+	xorl	%r9d,%r12d
+	rorl	$11,%r14d
+	xorl	%eax,%edi
+	addl	%r12d,%r10d
+	rorl	$6,%r13d
+	andl	%edi,%r15d
+	xorl	%r11d,%r14d
+	addl	%r13d,%r10d
+	xorl	%eax,%r15d
+	rorl	$2,%r14d
+	addl	%r10d,%ecx
+	addl	%r15d,%r10d
+	movl	%ecx,%r13d
+	addl	%r10d,%r14d
+	rorl	$14,%r13d
+	movl	%r14d,%r10d
+	movl	%edx,%r12d
+	rorl	$9,%r14d
+	xorl	%ecx,%r13d
+	xorl	%r8d,%r12d
+	rorl	$5,%r13d
+	xorl	%r10d,%r14d
+	andl	%ecx,%r12d
+	xorl	%ecx,%r13d
+	addl	8(%rsp),%r9d
+	movl	%r10d,%r15d
+	xorl	%r8d,%r12d
+	rorl	$11,%r14d
+	xorl	%r11d,%r15d
+	addl	%r12d,%r9d
+	rorl	$6,%r13d
+	andl	%r15d,%edi
+	xorl	%r10d,%r14d
+	addl	%r13d,%r9d
+	xorl	%r11d,%edi
+	rorl	$2,%r14d
+	addl	%r9d,%ebx
+	addl	%edi,%r9d
+	movl	%ebx,%r13d
+	addl	%r9d,%r14d
+	rorl	$14,%r13d
+	movl	%r14d,%r9d
+	movl	%ecx,%r12d
+	rorl	$9,%r14d
+	xorl	%ebx,%r13d
+	xorl	%edx,%r12d
+	rorl	$5,%r13d
+	xorl	%r9d,%r14d
+	andl	%ebx,%r12d
+	xorl	%ebx,%r13d
+	addl	12(%rsp),%r8d
+	movl	%r9d,%edi
+	xorl	%edx,%r12d
+	rorl	$11,%r14d
+	xorl	%r10d,%edi
+	addl	%r12d,%r8d
+	rorl	$6,%r13d
+	andl	%edi,%r15d
+	xorl	%r9d,%r14d
+	addl	%r13d,%r8d
+	xorl	%r10d,%r15d
+	rorl	$2,%r14d
+	addl	%r8d,%eax
+	addl	%r15d,%r8d
+	movl	%eax,%r13d
+	addl	%r8d,%r14d
+	rorl	$14,%r13d
+	movl	%r14d,%r8d
+	movl	%ebx,%r12d
+	rorl	$9,%r14d
+	xorl	%eax,%r13d
+	xorl	%ecx,%r12d
+	rorl	$5,%r13d
+	xorl	%r8d,%r14d
+	andl	%eax,%r12d
+	xorl	%eax,%r13d
+	addl	16(%rsp),%edx
+	movl	%r8d,%r15d
+	xorl	%ecx,%r12d
+	rorl	$11,%r14d
+	xorl	%r9d,%r15d
+	addl	%r12d,%edx
+	rorl	$6,%r13d
+	andl	%r15d,%edi
+	xorl	%r8d,%r14d
+	addl	%r13d,%edx
+	xorl	%r9d,%edi
+	rorl	$2,%r14d
+	addl	%edx,%r11d
+	addl	%edi,%edx
+	movl	%r11d,%r13d
+	addl	%edx,%r14d
+	rorl	$14,%r13d
+	movl	%r14d,%edx
+	movl	%eax,%r12d
+	rorl	$9,%r14d
+	xorl	%r11d,%r13d
+	xorl	%ebx,%r12d
+	rorl	$5,%r13d
+	xorl	%edx,%r14d
+	andl	%r11d,%r12d
+	xorl	%r11d,%r13d
+	addl	20(%rsp),%ecx
+	movl	%edx,%edi
+	xorl	%ebx,%r12d
+	rorl	$11,%r14d
+	xorl	%r8d,%edi
+	addl	%r12d,%ecx
+	rorl	$6,%r13d
+	andl	%edi,%r15d
+	xorl	%edx,%r14d
+	addl	%r13d,%ecx
+	xorl	%r8d,%r15d
+	rorl	$2,%r14d
+	addl	%ecx,%r10d
+	addl	%r15d,%ecx
+	movl	%r10d,%r13d
+	addl	%ecx,%r14d
+	rorl	$14,%r13d
+	movl	%r14d,%ecx
+	movl	%r11d,%r12d
+	rorl	$9,%r14d
+	xorl	%r10d,%r13d
+	xorl	%eax,%r12d
+	rorl	$5,%r13d
+	xorl	%ecx,%r14d
+	andl	%r10d,%r12d
+	xorl	%r10d,%r13d
+	addl	24(%rsp),%ebx
+	movl	%ecx,%r15d
+	xorl	%eax,%r12d
+	rorl	$11,%r14d
+	xorl	%edx,%r15d
+	addl	%r12d,%ebx
+	rorl	$6,%r13d
+	andl	%r15d,%edi
+	xorl	%ecx,%r14d
+	addl	%r13d,%ebx
+	xorl	%edx,%edi
+	rorl	$2,%r14d
+	addl	%ebx,%r9d
+	addl	%edi,%ebx
+	movl	%r9d,%r13d
+	addl	%ebx,%r14d
+	rorl	$14,%r13d
+	movl	%r14d,%ebx
+	movl	%r10d,%r12d
+	rorl	$9,%r14d
+	xorl	%r9d,%r13d
+	xorl	%r11d,%r12d
+	rorl	$5,%r13d
+	xorl	%ebx,%r14d
+	andl	%r9d,%r12d
+	xorl	%r9d,%r13d
+	addl	28(%rsp),%eax
+	movl	%ebx,%edi
+	xorl	%r11d,%r12d
+	rorl	$11,%r14d
+	xorl	%ecx,%edi
+	addl	%r12d,%eax
+	rorl	$6,%r13d
+	andl	%edi,%r15d
+	xorl	%ebx,%r14d
+	addl	%r13d,%eax
+	xorl	%ecx,%r15d
+	rorl	$2,%r14d
+	addl	%eax,%r8d
+	addl	%r15d,%eax
+	movl	%r8d,%r13d
+	addl	%eax,%r14d
+	rorl	$14,%r13d
+	movl	%r14d,%eax
+	movl	%r9d,%r12d
+	rorl	$9,%r14d
+	xorl	%r8d,%r13d
+	xorl	%r10d,%r12d
+	rorl	$5,%r13d
+	xorl	%eax,%r14d
+	andl	%r8d,%r12d
+	xorl	%r8d,%r13d
+	addl	32(%rsp),%r11d
+	movl	%eax,%r15d
+	xorl	%r10d,%r12d
+	rorl	$11,%r14d
+	xorl	%ebx,%r15d
+	addl	%r12d,%r11d
+	rorl	$6,%r13d
+	andl	%r15d,%edi
+	xorl	%eax,%r14d
+	addl	%r13d,%r11d
+	xorl	%ebx,%edi
+	rorl	$2,%r14d
+	addl	%r11d,%edx
+	addl	%edi,%r11d
+	movl	%edx,%r13d
+	addl	%r11d,%r14d
+	rorl	$14,%r13d
+	movl	%r14d,%r11d
+	movl	%r8d,%r12d
+	rorl	$9,%r14d
+	xorl	%edx,%r13d
+	xorl	%r9d,%r12d
+	rorl	$5,%r13d
+	xorl	%r11d,%r14d
+	andl	%edx,%r12d
+	xorl	%edx,%r13d
+	addl	36(%rsp),%r10d
+	movl	%r11d,%edi
+	xorl	%r9d,%r12d
+	rorl	$11,%r14d
+	xorl	%eax,%edi
+	addl	%r12d,%r10d
+	rorl	$6,%r13d
+	andl	%edi,%r15d
+	xorl	%r11d,%r14d
+	addl	%r13d,%r10d
+	xorl	%eax,%r15d
+	rorl	$2,%r14d
+	addl	%r10d,%ecx
+	addl	%r15d,%r10d
+	movl	%ecx,%r13d
+	addl	%r10d,%r14d
+	rorl	$14,%r13d
+	movl	%r14d,%r10d
+	movl	%edx,%r12d
+	rorl	$9,%r14d
+	xorl	%ecx,%r13d
+	xorl	%r8d,%r12d
+	rorl	$5,%r13d
+	xorl	%r10d,%r14d
+	andl	%ecx,%r12d
+	xorl	%ecx,%r13d
+	addl	40(%rsp),%r9d
+	movl	%r10d,%r15d
+	xorl	%r8d,%r12d
+	rorl	$11,%r14d
+	xorl	%r11d,%r15d
+	addl	%r12d,%r9d
+	rorl	$6,%r13d
+	andl	%r15d,%edi
+	xorl	%r10d,%r14d
+	addl	%r13d,%r9d
+	xorl	%r11d,%edi
+	rorl	$2,%r14d
+	addl	%r9d,%ebx
+	addl	%edi,%r9d
+	movl	%ebx,%r13d
+	addl	%r9d,%r14d
+	rorl	$14,%r13d
+	movl	%r14d,%r9d
+	movl	%ecx,%r12d
+	rorl	$9,%r14d
+	xorl	%ebx,%r13d
+	xorl	%edx,%r12d
+	rorl	$5,%r13d
+	xorl	%r9d,%r14d
+	andl	%ebx,%r12d
+	xorl	%ebx,%r13d
+	addl	44(%rsp),%r8d
+	movl	%r9d,%edi
+	xorl	%edx,%r12d
+	rorl	$11,%r14d
+	xorl	%r10d,%edi
+	addl	%r12d,%r8d
+	rorl	$6,%r13d
+	andl	%edi,%r15d
+	xorl	%r9d,%r14d
+	addl	%r13d,%r8d
+	xorl	%r10d,%r15d
+	rorl	$2,%r14d
+	addl	%r8d,%eax
+	addl	%r15d,%r8d
+	movl	%eax,%r13d
+	addl	%r8d,%r14d
+	rorl	$14,%r13d
+	movl	%r14d,%r8d
+	movl	%ebx,%r12d
+	rorl	$9,%r14d
+	xorl	%eax,%r13d
+	xorl	%ecx,%r12d
+	rorl	$5,%r13d
+	xorl	%r8d,%r14d
+	andl	%eax,%r12d
+	xorl	%eax,%r13d
+	addl	48(%rsp),%edx
+	movl	%r8d,%r15d
+	xorl	%ecx,%r12d
+	rorl	$11,%r14d
+	xorl	%r9d,%r15d
+	addl	%r12d,%edx
+	rorl	$6,%r13d
+	andl	%r15d,%edi
+	xorl	%r8d,%r14d
+	addl	%r13d,%edx
+	xorl	%r9d,%edi
+	rorl	$2,%r14d
+	addl	%edx,%r11d
+	addl	%edi,%edx
+	movl	%r11d,%r13d
+	addl	%edx,%r14d
+	rorl	$14,%r13d
+	movl	%r14d,%edx
+	movl	%eax,%r12d
+	rorl	$9,%r14d
+	xorl	%r11d,%r13d
+	xorl	%ebx,%r12d
+	rorl	$5,%r13d
+	xorl	%edx,%r14d
+	andl	%r11d,%r12d
+	xorl	%r11d,%r13d
+	addl	52(%rsp),%ecx
+	movl	%edx,%edi
+	xorl	%ebx,%r12d
+	rorl	$11,%r14d
+	xorl	%r8d,%edi
+	addl	%r12d,%ecx
+	rorl	$6,%r13d
+	andl	%edi,%r15d
+	xorl	%edx,%r14d
+	addl	%r13d,%ecx
+	xorl	%r8d,%r15d
+	rorl	$2,%r14d
+	addl	%ecx,%r10d
+	addl	%r15d,%ecx
+	movl	%r10d,%r13d
+	addl	%ecx,%r14d
+	rorl	$14,%r13d
+	movl	%r14d,%ecx
+	movl	%r11d,%r12d
+	rorl	$9,%r14d
+	xorl	%r10d,%r13d
+	xorl	%eax,%r12d
+	rorl	$5,%r13d
+	xorl	%ecx,%r14d
+	andl	%r10d,%r12d
+	xorl	%r10d,%r13d
+	addl	56(%rsp),%ebx
+	movl	%ecx,%r15d
+	xorl	%eax,%r12d
+	rorl	$11,%r14d
+	xorl	%edx,%r15d
+	addl	%r12d,%ebx
+	rorl	$6,%r13d
+	andl	%r15d,%edi
+	xorl	%ecx,%r14d
+	addl	%r13d,%ebx
+	xorl	%edx,%edi
+	rorl	$2,%r14d
+	addl	%ebx,%r9d
+	addl	%edi,%ebx
+	movl	%r9d,%r13d
+	addl	%ebx,%r14d
+	rorl	$14,%r13d
+	movl	%r14d,%ebx
+	movl	%r10d,%r12d
+	rorl	$9,%r14d
+	xorl	%r9d,%r13d
+	xorl	%r11d,%r12d
+	rorl	$5,%r13d
+	xorl	%ebx,%r14d
+	andl	%r9d,%r12d
+	xorl	%r9d,%r13d
+	addl	60(%rsp),%eax
+	movl	%ebx,%edi
+	xorl	%r11d,%r12d
+	rorl	$11,%r14d
+	xorl	%ecx,%edi
+	addl	%r12d,%eax
+	rorl	$6,%r13d
+	andl	%edi,%r15d
+	xorl	%ebx,%r14d
+	addl	%r13d,%eax
+	xorl	%ecx,%r15d
+	rorl	$2,%r14d
+	addl	%eax,%r8d
+	addl	%r15d,%eax
+	movl	%r8d,%r13d
+	addl	%eax,%r14d
+	movq	64+0(%rsp),%rdi
+	movl	%r14d,%eax
+
+	addl	0(%rdi),%eax
+	leaq	64(%rsi),%rsi
+	addl	4(%rdi),%ebx
+	addl	8(%rdi),%ecx
+	addl	12(%rdi),%edx
+	addl	16(%rdi),%r8d
+	addl	20(%rdi),%r9d
+	addl	24(%rdi),%r10d
+	addl	28(%rdi),%r11d
+
+	cmpq	64+16(%rsp),%rsi
+
+	movl	%eax,0(%rdi)
+	movl	%ebx,4(%rdi)
+	movl	%ecx,8(%rdi)
+	movl	%edx,12(%rdi)
+	movl	%r8d,16(%rdi)
+	movl	%r9d,20(%rdi)
+	movl	%r10d,24(%rdi)
+	movl	%r11d,28(%rdi)
+	jb	L$loop_ssse3
+
+	movq	64+24(%rsp),%rsi
+	movq	(%rsi),%r15
+	movq	8(%rsi),%r14
+	movq	16(%rsi),%r13
+	movq	24(%rsi),%r12
+	movq	32(%rsi),%rbp
+	movq	40(%rsi),%rbx
+	leaq	48(%rsi),%rsp
+L$epilogue_ssse3:
+	.byte	0xf3,0xc3
+
+#endif
diff --git a/third_party/boringssl/mac-x86_64/crypto/sha/sha512-x86_64.S b/third_party/boringssl/mac-x86_64/crypto/sha/sha512-x86_64.S
new file mode 100644
index 0000000..2f5d912
--- /dev/null
+++ b/third_party/boringssl/mac-x86_64/crypto/sha/sha512-x86_64.S
@@ -0,0 +1,1786 @@
+#if defined(__x86_64__)
+.text	
+
+
+.globl	_sha512_block_data_order
+.private_extern _sha512_block_data_order
+
+.p2align	4
+_sha512_block_data_order:
+	pushq	%rbx
+	pushq	%rbp
+	pushq	%r12
+	pushq	%r13
+	pushq	%r14
+	pushq	%r15
+	movq	%rsp,%r11
+	shlq	$4,%rdx
+	subq	$128+32,%rsp
+	leaq	(%rsi,%rdx,8),%rdx
+	andq	$-64,%rsp
+	movq	%rdi,128+0(%rsp)
+	movq	%rsi,128+8(%rsp)
+	movq	%rdx,128+16(%rsp)
+	movq	%r11,128+24(%rsp)
+L$prologue:
+
+	movq	0(%rdi),%rax
+	movq	8(%rdi),%rbx
+	movq	16(%rdi),%rcx
+	movq	24(%rdi),%rdx
+	movq	32(%rdi),%r8
+	movq	40(%rdi),%r9
+	movq	48(%rdi),%r10
+	movq	56(%rdi),%r11
+	jmp	L$loop
+
+.p2align	4
+L$loop:
+	movq	%rbx,%rdi
+	leaq	K512(%rip),%rbp
+	xorq	%rcx,%rdi
+	movq	0(%rsi),%r12
+	movq	%r8,%r13
+	movq	%rax,%r14
+	bswapq	%r12
+	rorq	$23,%r13
+	movq	%r9,%r15
+
+	xorq	%r8,%r13
+	rorq	$5,%r14
+	xorq	%r10,%r15
+
+	movq	%r12,0(%rsp)
+	xorq	%rax,%r14
+	andq	%r8,%r15
+
+	rorq	$4,%r13
+	addq	%r11,%r12
+	xorq	%r10,%r15
+
+	rorq	$6,%r14
+	xorq	%r8,%r13
+	addq	%r15,%r12
+
+	movq	%rax,%r15
+	addq	(%rbp),%r12
+	xorq	%rax,%r14
+
+	xorq	%rbx,%r15
+	rorq	$14,%r13
+	movq	%rbx,%r11
+
+	andq	%r15,%rdi
+	rorq	$28,%r14
+	addq	%r13,%r12
+
+	xorq	%rdi,%r11
+	addq	%r12,%rdx
+	addq	%r12,%r11
+
+	leaq	8(%rbp),%rbp
+	addq	%r14,%r11
+	movq	8(%rsi),%r12
+	movq	%rdx,%r13
+	movq	%r11,%r14
+	bswapq	%r12
+	rorq	$23,%r13
+	movq	%r8,%rdi
+
+	xorq	%rdx,%r13
+	rorq	$5,%r14
+	xorq	%r9,%rdi
+
+	movq	%r12,8(%rsp)
+	xorq	%r11,%r14
+	andq	%rdx,%rdi
+
+	rorq	$4,%r13
+	addq	%r10,%r12
+	xorq	%r9,%rdi
+
+	rorq	$6,%r14
+	xorq	%rdx,%r13
+	addq	%rdi,%r12
+
+	movq	%r11,%rdi
+	addq	(%rbp),%r12
+	xorq	%r11,%r14
+
+	xorq	%rax,%rdi
+	rorq	$14,%r13
+	movq	%rax,%r10
+
+	andq	%rdi,%r15
+	rorq	$28,%r14
+	addq	%r13,%r12
+
+	xorq	%r15,%r10
+	addq	%r12,%rcx
+	addq	%r12,%r10
+
+	leaq	24(%rbp),%rbp
+	addq	%r14,%r10
+	movq	16(%rsi),%r12
+	movq	%rcx,%r13
+	movq	%r10,%r14
+	bswapq	%r12
+	rorq	$23,%r13
+	movq	%rdx,%r15
+
+	xorq	%rcx,%r13
+	rorq	$5,%r14
+	xorq	%r8,%r15
+
+	movq	%r12,16(%rsp)
+	xorq	%r10,%r14
+	andq	%rcx,%r15
+
+	rorq	$4,%r13
+	addq	%r9,%r12
+	xorq	%r8,%r15
+
+	rorq	$6,%r14
+	xorq	%rcx,%r13
+	addq	%r15,%r12
+
+	movq	%r10,%r15
+	addq	(%rbp),%r12
+	xorq	%r10,%r14
+
+	xorq	%r11,%r15
+	rorq	$14,%r13
+	movq	%r11,%r9
+
+	andq	%r15,%rdi
+	rorq	$28,%r14
+	addq	%r13,%r12
+
+	xorq	%rdi,%r9
+	addq	%r12,%rbx
+	addq	%r12,%r9
+
+	leaq	8(%rbp),%rbp
+	addq	%r14,%r9
+	movq	24(%rsi),%r12
+	movq	%rbx,%r13
+	movq	%r9,%r14
+	bswapq	%r12
+	rorq	$23,%r13
+	movq	%rcx,%rdi
+
+	xorq	%rbx,%r13
+	rorq	$5,%r14
+	xorq	%rdx,%rdi
+
+	movq	%r12,24(%rsp)
+	xorq	%r9,%r14
+	andq	%rbx,%rdi
+
+	rorq	$4,%r13
+	addq	%r8,%r12
+	xorq	%rdx,%rdi
+
+	rorq	$6,%r14
+	xorq	%rbx,%r13
+	addq	%rdi,%r12
+
+	movq	%r9,%rdi
+	addq	(%rbp),%r12
+	xorq	%r9,%r14
+
+	xorq	%r10,%rdi
+	rorq	$14,%r13
+	movq	%r10,%r8
+
+	andq	%rdi,%r15
+	rorq	$28,%r14
+	addq	%r13,%r12
+
+	xorq	%r15,%r8
+	addq	%r12,%rax
+	addq	%r12,%r8
+
+	leaq	24(%rbp),%rbp
+	addq	%r14,%r8
+	movq	32(%rsi),%r12
+	movq	%rax,%r13
+	movq	%r8,%r14
+	bswapq	%r12
+	rorq	$23,%r13
+	movq	%rbx,%r15
+
+	xorq	%rax,%r13
+	rorq	$5,%r14
+	xorq	%rcx,%r15
+
+	movq	%r12,32(%rsp)
+	xorq	%r8,%r14
+	andq	%rax,%r15
+
+	rorq	$4,%r13
+	addq	%rdx,%r12
+	xorq	%rcx,%r15
+
+	rorq	$6,%r14
+	xorq	%rax,%r13
+	addq	%r15,%r12
+
+	movq	%r8,%r15
+	addq	(%rbp),%r12
+	xorq	%r8,%r14
+
+	xorq	%r9,%r15
+	rorq	$14,%r13
+	movq	%r9,%rdx
+
+	andq	%r15,%rdi
+	rorq	$28,%r14
+	addq	%r13,%r12
+
+	xorq	%rdi,%rdx
+	addq	%r12,%r11
+	addq	%r12,%rdx
+
+	leaq	8(%rbp),%rbp
+	addq	%r14,%rdx
+	movq	40(%rsi),%r12
+	movq	%r11,%r13
+	movq	%rdx,%r14
+	bswapq	%r12
+	rorq	$23,%r13
+	movq	%rax,%rdi
+
+	xorq	%r11,%r13
+	rorq	$5,%r14
+	xorq	%rbx,%rdi
+
+	movq	%r12,40(%rsp)
+	xorq	%rdx,%r14
+	andq	%r11,%rdi
+
+	rorq	$4,%r13
+	addq	%rcx,%r12
+	xorq	%rbx,%rdi
+
+	rorq	$6,%r14
+	xorq	%r11,%r13
+	addq	%rdi,%r12
+
+	movq	%rdx,%rdi
+	addq	(%rbp),%r12
+	xorq	%rdx,%r14
+
+	xorq	%r8,%rdi
+	rorq	$14,%r13
+	movq	%r8,%rcx
+
+	andq	%rdi,%r15
+	rorq	$28,%r14
+	addq	%r13,%r12
+
+	xorq	%r15,%rcx
+	addq	%r12,%r10
+	addq	%r12,%rcx
+
+	leaq	24(%rbp),%rbp
+	addq	%r14,%rcx
+	movq	48(%rsi),%r12
+	movq	%r10,%r13
+	movq	%rcx,%r14
+	bswapq	%r12
+	rorq	$23,%r13
+	movq	%r11,%r15
+
+	xorq	%r10,%r13
+	rorq	$5,%r14
+	xorq	%rax,%r15
+
+	movq	%r12,48(%rsp)
+	xorq	%rcx,%r14
+	andq	%r10,%r15
+
+	rorq	$4,%r13
+	addq	%rbx,%r12
+	xorq	%rax,%r15
+
+	rorq	$6,%r14
+	xorq	%r10,%r13
+	addq	%r15,%r12
+
+	movq	%rcx,%r15
+	addq	(%rbp),%r12
+	xorq	%rcx,%r14
+
+	xorq	%rdx,%r15
+	rorq	$14,%r13
+	movq	%rdx,%rbx
+
+	andq	%r15,%rdi
+	rorq	$28,%r14
+	addq	%r13,%r12
+
+	xorq	%rdi,%rbx
+	addq	%r12,%r9
+	addq	%r12,%rbx
+
+	leaq	8(%rbp),%rbp
+	addq	%r14,%rbx
+	movq	56(%rsi),%r12
+	movq	%r9,%r13
+	movq	%rbx,%r14
+	bswapq	%r12
+	rorq	$23,%r13
+	movq	%r10,%rdi
+
+	xorq	%r9,%r13
+	rorq	$5,%r14
+	xorq	%r11,%rdi
+
+	movq	%r12,56(%rsp)
+	xorq	%rbx,%r14
+	andq	%r9,%rdi
+
+	rorq	$4,%r13
+	addq	%rax,%r12
+	xorq	%r11,%rdi
+
+	rorq	$6,%r14
+	xorq	%r9,%r13
+	addq	%rdi,%r12
+
+	movq	%rbx,%rdi
+	addq	(%rbp),%r12
+	xorq	%rbx,%r14
+
+	xorq	%rcx,%rdi
+	rorq	$14,%r13
+	movq	%rcx,%rax
+
+	andq	%rdi,%r15
+	rorq	$28,%r14
+	addq	%r13,%r12
+
+	xorq	%r15,%rax
+	addq	%r12,%r8
+	addq	%r12,%rax
+
+	leaq	24(%rbp),%rbp
+	addq	%r14,%rax
+	movq	64(%rsi),%r12
+	movq	%r8,%r13
+	movq	%rax,%r14
+	bswapq	%r12
+	rorq	$23,%r13
+	movq	%r9,%r15
+
+	xorq	%r8,%r13
+	rorq	$5,%r14
+	xorq	%r10,%r15
+
+	movq	%r12,64(%rsp)
+	xorq	%rax,%r14
+	andq	%r8,%r15
+
+	rorq	$4,%r13
+	addq	%r11,%r12
+	xorq	%r10,%r15
+
+	rorq	$6,%r14
+	xorq	%r8,%r13
+	addq	%r15,%r12
+
+	movq	%rax,%r15
+	addq	(%rbp),%r12
+	xorq	%rax,%r14
+
+	xorq	%rbx,%r15
+	rorq	$14,%r13
+	movq	%rbx,%r11
+
+	andq	%r15,%rdi
+	rorq	$28,%r14
+	addq	%r13,%r12
+
+	xorq	%rdi,%r11
+	addq	%r12,%rdx
+	addq	%r12,%r11
+
+	leaq	8(%rbp),%rbp
+	addq	%r14,%r11
+	movq	72(%rsi),%r12
+	movq	%rdx,%r13
+	movq	%r11,%r14
+	bswapq	%r12
+	rorq	$23,%r13
+	movq	%r8,%rdi
+
+	xorq	%rdx,%r13
+	rorq	$5,%r14
+	xorq	%r9,%rdi
+
+	movq	%r12,72(%rsp)
+	xorq	%r11,%r14
+	andq	%rdx,%rdi
+
+	rorq	$4,%r13
+	addq	%r10,%r12
+	xorq	%r9,%rdi
+
+	rorq	$6,%r14
+	xorq	%rdx,%r13
+	addq	%rdi,%r12
+
+	movq	%r11,%rdi
+	addq	(%rbp),%r12
+	xorq	%r11,%r14
+
+	xorq	%rax,%rdi
+	rorq	$14,%r13
+	movq	%rax,%r10
+
+	andq	%rdi,%r15
+	rorq	$28,%r14
+	addq	%r13,%r12
+
+	xorq	%r15,%r10
+	addq	%r12,%rcx
+	addq	%r12,%r10
+
+	leaq	24(%rbp),%rbp
+	addq	%r14,%r10
+	movq	80(%rsi),%r12
+	movq	%rcx,%r13
+	movq	%r10,%r14
+	bswapq	%r12
+	rorq	$23,%r13
+	movq	%rdx,%r15
+
+	xorq	%rcx,%r13
+	rorq	$5,%r14
+	xorq	%r8,%r15
+
+	movq	%r12,80(%rsp)
+	xorq	%r10,%r14
+	andq	%rcx,%r15
+
+	rorq	$4,%r13
+	addq	%r9,%r12
+	xorq	%r8,%r15
+
+	rorq	$6,%r14
+	xorq	%rcx,%r13
+	addq	%r15,%r12
+
+	movq	%r10,%r15
+	addq	(%rbp),%r12
+	xorq	%r10,%r14
+
+	xorq	%r11,%r15
+	rorq	$14,%r13
+	movq	%r11,%r9
+
+	andq	%r15,%rdi
+	rorq	$28,%r14
+	addq	%r13,%r12
+
+	xorq	%rdi,%r9
+	addq	%r12,%rbx
+	addq	%r12,%r9
+
+	leaq	8(%rbp),%rbp
+	addq	%r14,%r9
+	movq	88(%rsi),%r12
+	movq	%rbx,%r13
+	movq	%r9,%r14
+	bswapq	%r12
+	rorq	$23,%r13
+	movq	%rcx,%rdi
+
+	xorq	%rbx,%r13
+	rorq	$5,%r14
+	xorq	%rdx,%rdi
+
+	movq	%r12,88(%rsp)
+	xorq	%r9,%r14
+	andq	%rbx,%rdi
+
+	rorq	$4,%r13
+	addq	%r8,%r12
+	xorq	%rdx,%rdi
+
+	rorq	$6,%r14
+	xorq	%rbx,%r13
+	addq	%rdi,%r12
+
+	movq	%r9,%rdi
+	addq	(%rbp),%r12
+	xorq	%r9,%r14
+
+	xorq	%r10,%rdi
+	rorq	$14,%r13
+	movq	%r10,%r8
+
+	andq	%rdi,%r15
+	rorq	$28,%r14
+	addq	%r13,%r12
+
+	xorq	%r15,%r8
+	addq	%r12,%rax
+	addq	%r12,%r8
+
+	leaq	24(%rbp),%rbp
+	addq	%r14,%r8
+	movq	96(%rsi),%r12
+	movq	%rax,%r13
+	movq	%r8,%r14
+	bswapq	%r12
+	rorq	$23,%r13
+	movq	%rbx,%r15
+
+	xorq	%rax,%r13
+	rorq	$5,%r14
+	xorq	%rcx,%r15
+
+	movq	%r12,96(%rsp)
+	xorq	%r8,%r14
+	andq	%rax,%r15
+
+	rorq	$4,%r13
+	addq	%rdx,%r12
+	xorq	%rcx,%r15
+
+	rorq	$6,%r14
+	xorq	%rax,%r13
+	addq	%r15,%r12
+
+	movq	%r8,%r15
+	addq	(%rbp),%r12
+	xorq	%r8,%r14
+
+	xorq	%r9,%r15
+	rorq	$14,%r13
+	movq	%r9,%rdx
+
+	andq	%r15,%rdi
+	rorq	$28,%r14
+	addq	%r13,%r12
+
+	xorq	%rdi,%rdx
+	addq	%r12,%r11
+	addq	%r12,%rdx
+
+	leaq	8(%rbp),%rbp
+	addq	%r14,%rdx
+	movq	104(%rsi),%r12
+	movq	%r11,%r13
+	movq	%rdx,%r14
+	bswapq	%r12
+	rorq	$23,%r13
+	movq	%rax,%rdi
+
+	xorq	%r11,%r13
+	rorq	$5,%r14
+	xorq	%rbx,%rdi
+
+	movq	%r12,104(%rsp)
+	xorq	%rdx,%r14
+	andq	%r11,%rdi
+
+	rorq	$4,%r13
+	addq	%rcx,%r12
+	xorq	%rbx,%rdi
+
+	rorq	$6,%r14
+	xorq	%r11,%r13
+	addq	%rdi,%r12
+
+	movq	%rdx,%rdi
+	addq	(%rbp),%r12
+	xorq	%rdx,%r14
+
+	xorq	%r8,%rdi
+	rorq	$14,%r13
+	movq	%r8,%rcx
+
+	andq	%rdi,%r15
+	rorq	$28,%r14
+	addq	%r13,%r12
+
+	xorq	%r15,%rcx
+	addq	%r12,%r10
+	addq	%r12,%rcx
+
+	leaq	24(%rbp),%rbp
+	addq	%r14,%rcx
+	movq	112(%rsi),%r12
+	movq	%r10,%r13
+	movq	%rcx,%r14
+	bswapq	%r12
+	rorq	$23,%r13
+	movq	%r11,%r15
+
+	xorq	%r10,%r13
+	rorq	$5,%r14
+	xorq	%rax,%r15
+
+	movq	%r12,112(%rsp)
+	xorq	%rcx,%r14
+	andq	%r10,%r15
+
+	rorq	$4,%r13
+	addq	%rbx,%r12
+	xorq	%rax,%r15
+
+	rorq	$6,%r14
+	xorq	%r10,%r13
+	addq	%r15,%r12
+
+	movq	%rcx,%r15
+	addq	(%rbp),%r12
+	xorq	%rcx,%r14
+
+	xorq	%rdx,%r15
+	rorq	$14,%r13
+	movq	%rdx,%rbx
+
+	andq	%r15,%rdi
+	rorq	$28,%r14
+	addq	%r13,%r12
+
+	xorq	%rdi,%rbx
+	addq	%r12,%r9
+	addq	%r12,%rbx
+
+	leaq	8(%rbp),%rbp
+	addq	%r14,%rbx
+	movq	120(%rsi),%r12
+	movq	%r9,%r13
+	movq	%rbx,%r14
+	bswapq	%r12
+	rorq	$23,%r13
+	movq	%r10,%rdi
+
+	xorq	%r9,%r13
+	rorq	$5,%r14
+	xorq	%r11,%rdi
+
+	movq	%r12,120(%rsp)
+	xorq	%rbx,%r14
+	andq	%r9,%rdi
+
+	rorq	$4,%r13
+	addq	%rax,%r12
+	xorq	%r11,%rdi
+
+	rorq	$6,%r14
+	xorq	%r9,%r13
+	addq	%rdi,%r12
+
+	movq	%rbx,%rdi
+	addq	(%rbp),%r12
+	xorq	%rbx,%r14
+
+	xorq	%rcx,%rdi
+	rorq	$14,%r13
+	movq	%rcx,%rax
+
+	andq	%rdi,%r15
+	rorq	$28,%r14
+	addq	%r13,%r12
+
+	xorq	%r15,%rax
+	addq	%r12,%r8
+	addq	%r12,%rax
+
+	leaq	24(%rbp),%rbp
+	jmp	L$rounds_16_xx
+.p2align	4
+L$rounds_16_xx:
+	movq	8(%rsp),%r13
+	movq	112(%rsp),%r15
+
+	movq	%r13,%r12
+	rorq	$7,%r13
+	addq	%r14,%rax
+	movq	%r15,%r14
+	rorq	$42,%r15
+
+	xorq	%r12,%r13
+	shrq	$7,%r12
+	rorq	$1,%r13
+	xorq	%r14,%r15
+	shrq	$6,%r14
+
+	rorq	$19,%r15
+	xorq	%r13,%r12
+	xorq	%r14,%r15
+	addq	72(%rsp),%r12
+
+	addq	0(%rsp),%r12
+	movq	%r8,%r13
+	addq	%r15,%r12
+	movq	%rax,%r14
+	rorq	$23,%r13
+	movq	%r9,%r15
+
+	xorq	%r8,%r13
+	rorq	$5,%r14
+	xorq	%r10,%r15
+
+	movq	%r12,0(%rsp)
+	xorq	%rax,%r14
+	andq	%r8,%r15
+
+	rorq	$4,%r13
+	addq	%r11,%r12
+	xorq	%r10,%r15
+
+	rorq	$6,%r14
+	xorq	%r8,%r13
+	addq	%r15,%r12
+
+	movq	%rax,%r15
+	addq	(%rbp),%r12
+	xorq	%rax,%r14
+
+	xorq	%rbx,%r15
+	rorq	$14,%r13
+	movq	%rbx,%r11
+
+	andq	%r15,%rdi
+	rorq	$28,%r14
+	addq	%r13,%r12
+
+	xorq	%rdi,%r11
+	addq	%r12,%rdx
+	addq	%r12,%r11
+
+	leaq	8(%rbp),%rbp
+	movq	16(%rsp),%r13
+	movq	120(%rsp),%rdi
+
+	movq	%r13,%r12
+	rorq	$7,%r13
+	addq	%r14,%r11
+	movq	%rdi,%r14
+	rorq	$42,%rdi
+
+	xorq	%r12,%r13
+	shrq	$7,%r12
+	rorq	$1,%r13
+	xorq	%r14,%rdi
+	shrq	$6,%r14
+
+	rorq	$19,%rdi
+	xorq	%r13,%r12
+	xorq	%r14,%rdi
+	addq	80(%rsp),%r12
+
+	addq	8(%rsp),%r12
+	movq	%rdx,%r13
+	addq	%rdi,%r12
+	movq	%r11,%r14
+	rorq	$23,%r13
+	movq	%r8,%rdi
+
+	xorq	%rdx,%r13
+	rorq	$5,%r14
+	xorq	%r9,%rdi
+
+	movq	%r12,8(%rsp)
+	xorq	%r11,%r14
+	andq	%rdx,%rdi
+
+	rorq	$4,%r13
+	addq	%r10,%r12
+	xorq	%r9,%rdi
+
+	rorq	$6,%r14
+	xorq	%rdx,%r13
+	addq	%rdi,%r12
+
+	movq	%r11,%rdi
+	addq	(%rbp),%r12
+	xorq	%r11,%r14
+
+	xorq	%rax,%rdi
+	rorq	$14,%r13
+	movq	%rax,%r10
+
+	andq	%rdi,%r15
+	rorq	$28,%r14
+	addq	%r13,%r12
+
+	xorq	%r15,%r10
+	addq	%r12,%rcx
+	addq	%r12,%r10
+
+	leaq	24(%rbp),%rbp
+	movq	24(%rsp),%r13
+	movq	0(%rsp),%r15
+
+	movq	%r13,%r12
+	rorq	$7,%r13
+	addq	%r14,%r10
+	movq	%r15,%r14
+	rorq	$42,%r15
+
+	xorq	%r12,%r13
+	shrq	$7,%r12
+	rorq	$1,%r13
+	xorq	%r14,%r15
+	shrq	$6,%r14
+
+	rorq	$19,%r15
+	xorq	%r13,%r12
+	xorq	%r14,%r15
+	addq	88(%rsp),%r12
+
+	addq	16(%rsp),%r12
+	movq	%rcx,%r13
+	addq	%r15,%r12
+	movq	%r10,%r14
+	rorq	$23,%r13
+	movq	%rdx,%r15
+
+	xorq	%rcx,%r13
+	rorq	$5,%r14
+	xorq	%r8,%r15
+
+	movq	%r12,16(%rsp)
+	xorq	%r10,%r14
+	andq	%rcx,%r15
+
+	rorq	$4,%r13
+	addq	%r9,%r12
+	xorq	%r8,%r15
+
+	rorq	$6,%r14
+	xorq	%rcx,%r13
+	addq	%r15,%r12
+
+	movq	%r10,%r15
+	addq	(%rbp),%r12
+	xorq	%r10,%r14
+
+	xorq	%r11,%r15
+	rorq	$14,%r13
+	movq	%r11,%r9
+
+	andq	%r15,%rdi
+	rorq	$28,%r14
+	addq	%r13,%r12
+
+	xorq	%rdi,%r9
+	addq	%r12,%rbx
+	addq	%r12,%r9
+
+	leaq	8(%rbp),%rbp
+	movq	32(%rsp),%r13
+	movq	8(%rsp),%rdi
+
+	movq	%r13,%r12
+	rorq	$7,%r13
+	addq	%r14,%r9
+	movq	%rdi,%r14
+	rorq	$42,%rdi
+
+	xorq	%r12,%r13
+	shrq	$7,%r12
+	rorq	$1,%r13
+	xorq	%r14,%rdi
+	shrq	$6,%r14
+
+	rorq	$19,%rdi
+	xorq	%r13,%r12
+	xorq	%r14,%rdi
+	addq	96(%rsp),%r12
+
+	addq	24(%rsp),%r12
+	movq	%rbx,%r13
+	addq	%rdi,%r12
+	movq	%r9,%r14
+	rorq	$23,%r13
+	movq	%rcx,%rdi
+
+	xorq	%rbx,%r13
+	rorq	$5,%r14
+	xorq	%rdx,%rdi
+
+	movq	%r12,24(%rsp)
+	xorq	%r9,%r14
+	andq	%rbx,%rdi
+
+	rorq	$4,%r13
+	addq	%r8,%r12
+	xorq	%rdx,%rdi
+
+	rorq	$6,%r14
+	xorq	%rbx,%r13
+	addq	%rdi,%r12
+
+	movq	%r9,%rdi
+	addq	(%rbp),%r12
+	xorq	%r9,%r14
+
+	xorq	%r10,%rdi
+	rorq	$14,%r13
+	movq	%r10,%r8
+
+	andq	%rdi,%r15
+	rorq	$28,%r14
+	addq	%r13,%r12
+
+	xorq	%r15,%r8
+	addq	%r12,%rax
+	addq	%r12,%r8
+
+	leaq	24(%rbp),%rbp
+	movq	40(%rsp),%r13
+	movq	16(%rsp),%r15
+
+	movq	%r13,%r12
+	rorq	$7,%r13
+	addq	%r14,%r8
+	movq	%r15,%r14
+	rorq	$42,%r15
+
+	xorq	%r12,%r13
+	shrq	$7,%r12
+	rorq	$1,%r13
+	xorq	%r14,%r15
+	shrq	$6,%r14
+
+	rorq	$19,%r15
+	xorq	%r13,%r12
+	xorq	%r14,%r15
+	addq	104(%rsp),%r12
+
+	addq	32(%rsp),%r12
+	movq	%rax,%r13
+	addq	%r15,%r12
+	movq	%r8,%r14
+	rorq	$23,%r13
+	movq	%rbx,%r15
+
+	xorq	%rax,%r13
+	rorq	$5,%r14
+	xorq	%rcx,%r15
+
+	movq	%r12,32(%rsp)
+	xorq	%r8,%r14
+	andq	%rax,%r15
+
+	rorq	$4,%r13
+	addq	%rdx,%r12
+	xorq	%rcx,%r15
+
+	rorq	$6,%r14
+	xorq	%rax,%r13
+	addq	%r15,%r12
+
+	movq	%r8,%r15
+	addq	(%rbp),%r12
+	xorq	%r8,%r14
+
+	xorq	%r9,%r15
+	rorq	$14,%r13
+	movq	%r9,%rdx
+
+	andq	%r15,%rdi
+	rorq	$28,%r14
+	addq	%r13,%r12
+
+	xorq	%rdi,%rdx
+	addq	%r12,%r11
+	addq	%r12,%rdx
+
+	leaq	8(%rbp),%rbp
+	movq	48(%rsp),%r13
+	movq	24(%rsp),%rdi
+
+	movq	%r13,%r12
+	rorq	$7,%r13
+	addq	%r14,%rdx
+	movq	%rdi,%r14
+	rorq	$42,%rdi
+
+	xorq	%r12,%r13
+	shrq	$7,%r12
+	rorq	$1,%r13
+	xorq	%r14,%rdi
+	shrq	$6,%r14
+
+	rorq	$19,%rdi
+	xorq	%r13,%r12
+	xorq	%r14,%rdi
+	addq	112(%rsp),%r12
+
+	addq	40(%rsp),%r12
+	movq	%r11,%r13
+	addq	%rdi,%r12
+	movq	%rdx,%r14
+	rorq	$23,%r13
+	movq	%rax,%rdi
+
+	xorq	%r11,%r13
+	rorq	$5,%r14
+	xorq	%rbx,%rdi
+
+	movq	%r12,40(%rsp)
+	xorq	%rdx,%r14
+	andq	%r11,%rdi
+
+	rorq	$4,%r13
+	addq	%rcx,%r12
+	xorq	%rbx,%rdi
+
+	rorq	$6,%r14
+	xorq	%r11,%r13
+	addq	%rdi,%r12
+
+	movq	%rdx,%rdi
+	addq	(%rbp),%r12
+	xorq	%rdx,%r14
+
+	xorq	%r8,%rdi
+	rorq	$14,%r13
+	movq	%r8,%rcx
+
+	andq	%rdi,%r15
+	rorq	$28,%r14
+	addq	%r13,%r12
+
+	xorq	%r15,%rcx
+	addq	%r12,%r10
+	addq	%r12,%rcx
+
+	leaq	24(%rbp),%rbp
+	movq	56(%rsp),%r13
+	movq	32(%rsp),%r15
+
+	movq	%r13,%r12
+	rorq	$7,%r13
+	addq	%r14,%rcx
+	movq	%r15,%r14
+	rorq	$42,%r15
+
+	xorq	%r12,%r13
+	shrq	$7,%r12
+	rorq	$1,%r13
+	xorq	%r14,%r15
+	shrq	$6,%r14
+
+	rorq	$19,%r15
+	xorq	%r13,%r12
+	xorq	%r14,%r15
+	addq	120(%rsp),%r12
+
+	addq	48(%rsp),%r12
+	movq	%r10,%r13
+	addq	%r15,%r12
+	movq	%rcx,%r14
+	rorq	$23,%r13
+	movq	%r11,%r15
+
+	xorq	%r10,%r13
+	rorq	$5,%r14
+	xorq	%rax,%r15
+
+	movq	%r12,48(%rsp)
+	xorq	%rcx,%r14
+	andq	%r10,%r15
+
+	rorq	$4,%r13
+	addq	%rbx,%r12
+	xorq	%rax,%r15
+
+	rorq	$6,%r14
+	xorq	%r10,%r13
+	addq	%r15,%r12
+
+	movq	%rcx,%r15
+	addq	(%rbp),%r12
+	xorq	%rcx,%r14
+
+	xorq	%rdx,%r15
+	rorq	$14,%r13
+	movq	%rdx,%rbx
+
+	andq	%r15,%rdi
+	rorq	$28,%r14
+	addq	%r13,%r12
+
+	xorq	%rdi,%rbx
+	addq	%r12,%r9
+	addq	%r12,%rbx
+
+	leaq	8(%rbp),%rbp
+	movq	64(%rsp),%r13
+	movq	40(%rsp),%rdi
+
+	movq	%r13,%r12
+	rorq	$7,%r13
+	addq	%r14,%rbx
+	movq	%rdi,%r14
+	rorq	$42,%rdi
+
+	xorq	%r12,%r13
+	shrq	$7,%r12
+	rorq	$1,%r13
+	xorq	%r14,%rdi
+	shrq	$6,%r14
+
+	rorq	$19,%rdi
+	xorq	%r13,%r12
+	xorq	%r14,%rdi
+	addq	0(%rsp),%r12
+
+	addq	56(%rsp),%r12
+	movq	%r9,%r13
+	addq	%rdi,%r12
+	movq	%rbx,%r14
+	rorq	$23,%r13
+	movq	%r10,%rdi
+
+	xorq	%r9,%r13
+	rorq	$5,%r14
+	xorq	%r11,%rdi
+
+	movq	%r12,56(%rsp)
+	xorq	%rbx,%r14
+	andq	%r9,%rdi
+
+	rorq	$4,%r13
+	addq	%rax,%r12
+	xorq	%r11,%rdi
+
+	rorq	$6,%r14
+	xorq	%r9,%r13
+	addq	%rdi,%r12
+
+	movq	%rbx,%rdi
+	addq	(%rbp),%r12
+	xorq	%rbx,%r14
+
+	xorq	%rcx,%rdi
+	rorq	$14,%r13
+	movq	%rcx,%rax
+
+	andq	%rdi,%r15
+	rorq	$28,%r14
+	addq	%r13,%r12
+
+	xorq	%r15,%rax
+	addq	%r12,%r8
+	addq	%r12,%rax
+
+	leaq	24(%rbp),%rbp
+	movq	72(%rsp),%r13
+	movq	48(%rsp),%r15
+
+	movq	%r13,%r12
+	rorq	$7,%r13
+	addq	%r14,%rax
+	movq	%r15,%r14
+	rorq	$42,%r15
+
+	xorq	%r12,%r13
+	shrq	$7,%r12
+	rorq	$1,%r13
+	xorq	%r14,%r15
+	shrq	$6,%r14
+
+	rorq	$19,%r15
+	xorq	%r13,%r12
+	xorq	%r14,%r15
+	addq	8(%rsp),%r12
+
+	addq	64(%rsp),%r12
+	movq	%r8,%r13
+	addq	%r15,%r12
+	movq	%rax,%r14
+	rorq	$23,%r13
+	movq	%r9,%r15
+
+	xorq	%r8,%r13
+	rorq	$5,%r14
+	xorq	%r10,%r15
+
+	movq	%r12,64(%rsp)
+	xorq	%rax,%r14
+	andq	%r8,%r15
+
+	rorq	$4,%r13
+	addq	%r11,%r12
+	xorq	%r10,%r15
+
+	rorq	$6,%r14
+	xorq	%r8,%r13
+	addq	%r15,%r12
+
+	movq	%rax,%r15
+	addq	(%rbp),%r12
+	xorq	%rax,%r14
+
+	xorq	%rbx,%r15
+	rorq	$14,%r13
+	movq	%rbx,%r11
+
+	andq	%r15,%rdi
+	rorq	$28,%r14
+	addq	%r13,%r12
+
+	xorq	%rdi,%r11
+	addq	%r12,%rdx
+	addq	%r12,%r11
+
+	leaq	8(%rbp),%rbp
+	movq	80(%rsp),%r13
+	movq	56(%rsp),%rdi
+
+	movq	%r13,%r12
+	rorq	$7,%r13
+	addq	%r14,%r11
+	movq	%rdi,%r14
+	rorq	$42,%rdi
+
+	xorq	%r12,%r13
+	shrq	$7,%r12
+	rorq	$1,%r13
+	xorq	%r14,%rdi
+	shrq	$6,%r14
+
+	rorq	$19,%rdi
+	xorq	%r13,%r12
+	xorq	%r14,%rdi
+	addq	16(%rsp),%r12
+
+	addq	72(%rsp),%r12
+	movq	%rdx,%r13
+	addq	%rdi,%r12
+	movq	%r11,%r14
+	rorq	$23,%r13
+	movq	%r8,%rdi
+
+	xorq	%rdx,%r13
+	rorq	$5,%r14
+	xorq	%r9,%rdi
+
+	movq	%r12,72(%rsp)
+	xorq	%r11,%r14
+	andq	%rdx,%rdi
+
+	rorq	$4,%r13
+	addq	%r10,%r12
+	xorq	%r9,%rdi
+
+	rorq	$6,%r14
+	xorq	%rdx,%r13
+	addq	%rdi,%r12
+
+	movq	%r11,%rdi
+	addq	(%rbp),%r12
+	xorq	%r11,%r14
+
+	xorq	%rax,%rdi
+	rorq	$14,%r13
+	movq	%rax,%r10
+
+	andq	%rdi,%r15
+	rorq	$28,%r14
+	addq	%r13,%r12
+
+	xorq	%r15,%r10
+	addq	%r12,%rcx
+	addq	%r12,%r10
+
+	leaq	24(%rbp),%rbp
+	movq	88(%rsp),%r13
+	movq	64(%rsp),%r15
+
+	movq	%r13,%r12
+	rorq	$7,%r13
+	addq	%r14,%r10
+	movq	%r15,%r14
+	rorq	$42,%r15
+
+	xorq	%r12,%r13
+	shrq	$7,%r12
+	rorq	$1,%r13
+	xorq	%r14,%r15
+	shrq	$6,%r14
+
+	rorq	$19,%r15
+	xorq	%r13,%r12
+	xorq	%r14,%r15
+	addq	24(%rsp),%r12
+
+	addq	80(%rsp),%r12
+	movq	%rcx,%r13
+	addq	%r15,%r12
+	movq	%r10,%r14
+	rorq	$23,%r13
+	movq	%rdx,%r15
+
+	xorq	%rcx,%r13
+	rorq	$5,%r14
+	xorq	%r8,%r15
+
+	movq	%r12,80(%rsp)
+	xorq	%r10,%r14
+	andq	%rcx,%r15
+
+	rorq	$4,%r13
+	addq	%r9,%r12
+	xorq	%r8,%r15
+
+	rorq	$6,%r14
+	xorq	%rcx,%r13
+	addq	%r15,%r12
+
+	movq	%r10,%r15
+	addq	(%rbp),%r12
+	xorq	%r10,%r14
+
+	xorq	%r11,%r15
+	rorq	$14,%r13
+	movq	%r11,%r9
+
+	andq	%r15,%rdi
+	rorq	$28,%r14
+	addq	%r13,%r12
+
+	xorq	%rdi,%r9
+	addq	%r12,%rbx
+	addq	%r12,%r9
+
+	leaq	8(%rbp),%rbp
+	movq	96(%rsp),%r13
+	movq	72(%rsp),%rdi
+
+	movq	%r13,%r12
+	rorq	$7,%r13
+	addq	%r14,%r9
+	movq	%rdi,%r14
+	rorq	$42,%rdi
+
+	xorq	%r12,%r13
+	shrq	$7,%r12
+	rorq	$1,%r13
+	xorq	%r14,%rdi
+	shrq	$6,%r14
+
+	rorq	$19,%rdi
+	xorq	%r13,%r12
+	xorq	%r14,%rdi
+	addq	32(%rsp),%r12
+
+	addq	88(%rsp),%r12
+	movq	%rbx,%r13
+	addq	%rdi,%r12
+	movq	%r9,%r14
+	rorq	$23,%r13
+	movq	%rcx,%rdi
+
+	xorq	%rbx,%r13
+	rorq	$5,%r14
+	xorq	%rdx,%rdi
+
+	movq	%r12,88(%rsp)
+	xorq	%r9,%r14
+	andq	%rbx,%rdi
+
+	rorq	$4,%r13
+	addq	%r8,%r12
+	xorq	%rdx,%rdi
+
+	rorq	$6,%r14
+	xorq	%rbx,%r13
+	addq	%rdi,%r12
+
+	movq	%r9,%rdi
+	addq	(%rbp),%r12
+	xorq	%r9,%r14
+
+	xorq	%r10,%rdi
+	rorq	$14,%r13
+	movq	%r10,%r8
+
+	andq	%rdi,%r15
+	rorq	$28,%r14
+	addq	%r13,%r12
+
+	xorq	%r15,%r8
+	addq	%r12,%rax
+	addq	%r12,%r8
+
+	leaq	24(%rbp),%rbp
+	movq	104(%rsp),%r13
+	movq	80(%rsp),%r15
+
+	movq	%r13,%r12
+	rorq	$7,%r13
+	addq	%r14,%r8
+	movq	%r15,%r14
+	rorq	$42,%r15
+
+	xorq	%r12,%r13
+	shrq	$7,%r12
+	rorq	$1,%r13
+	xorq	%r14,%r15
+	shrq	$6,%r14
+
+	rorq	$19,%r15
+	xorq	%r13,%r12
+	xorq	%r14,%r15
+	addq	40(%rsp),%r12
+
+	addq	96(%rsp),%r12
+	movq	%rax,%r13
+	addq	%r15,%r12
+	movq	%r8,%r14
+	rorq	$23,%r13
+	movq	%rbx,%r15
+
+	xorq	%rax,%r13
+	rorq	$5,%r14
+	xorq	%rcx,%r15
+
+	movq	%r12,96(%rsp)
+	xorq	%r8,%r14
+	andq	%rax,%r15
+
+	rorq	$4,%r13
+	addq	%rdx,%r12
+	xorq	%rcx,%r15
+
+	rorq	$6,%r14
+	xorq	%rax,%r13
+	addq	%r15,%r12
+
+	movq	%r8,%r15
+	addq	(%rbp),%r12
+	xorq	%r8,%r14
+
+	xorq	%r9,%r15
+	rorq	$14,%r13
+	movq	%r9,%rdx
+
+	andq	%r15,%rdi
+	rorq	$28,%r14
+	addq	%r13,%r12
+
+	xorq	%rdi,%rdx
+	addq	%r12,%r11
+	addq	%r12,%rdx
+
+	leaq	8(%rbp),%rbp
+	movq	112(%rsp),%r13
+	movq	88(%rsp),%rdi
+
+	movq	%r13,%r12
+	rorq	$7,%r13
+	addq	%r14,%rdx
+	movq	%rdi,%r14
+	rorq	$42,%rdi
+
+	xorq	%r12,%r13
+	shrq	$7,%r12
+	rorq	$1,%r13
+	xorq	%r14,%rdi
+	shrq	$6,%r14
+
+	rorq	$19,%rdi
+	xorq	%r13,%r12
+	xorq	%r14,%rdi
+	addq	48(%rsp),%r12
+
+	addq	104(%rsp),%r12
+	movq	%r11,%r13
+	addq	%rdi,%r12
+	movq	%rdx,%r14
+	rorq	$23,%r13
+	movq	%rax,%rdi
+
+	xorq	%r11,%r13
+	rorq	$5,%r14
+	xorq	%rbx,%rdi
+
+	movq	%r12,104(%rsp)
+	xorq	%rdx,%r14
+	andq	%r11,%rdi
+
+	rorq	$4,%r13
+	addq	%rcx,%r12
+	xorq	%rbx,%rdi
+
+	rorq	$6,%r14
+	xorq	%r11,%r13
+	addq	%rdi,%r12
+
+	movq	%rdx,%rdi
+	addq	(%rbp),%r12
+	xorq	%rdx,%r14
+
+	xorq	%r8,%rdi
+	rorq	$14,%r13
+	movq	%r8,%rcx
+
+	andq	%rdi,%r15
+	rorq	$28,%r14
+	addq	%r13,%r12
+
+	xorq	%r15,%rcx
+	addq	%r12,%r10
+	addq	%r12,%rcx
+
+	leaq	24(%rbp),%rbp
+	movq	120(%rsp),%r13
+	movq	96(%rsp),%r15
+
+	movq	%r13,%r12
+	rorq	$7,%r13
+	addq	%r14,%rcx
+	movq	%r15,%r14
+	rorq	$42,%r15
+
+	xorq	%r12,%r13
+	shrq	$7,%r12
+	rorq	$1,%r13
+	xorq	%r14,%r15
+	shrq	$6,%r14
+
+	rorq	$19,%r15
+	xorq	%r13,%r12
+	xorq	%r14,%r15
+	addq	56(%rsp),%r12
+
+	addq	112(%rsp),%r12
+	movq	%r10,%r13
+	addq	%r15,%r12
+	movq	%rcx,%r14
+	rorq	$23,%r13
+	movq	%r11,%r15
+
+	xorq	%r10,%r13
+	rorq	$5,%r14
+	xorq	%rax,%r15
+
+	movq	%r12,112(%rsp)
+	xorq	%rcx,%r14
+	andq	%r10,%r15
+
+	rorq	$4,%r13
+	addq	%rbx,%r12
+	xorq	%rax,%r15
+
+	rorq	$6,%r14
+	xorq	%r10,%r13
+	addq	%r15,%r12
+
+	movq	%rcx,%r15
+	addq	(%rbp),%r12
+	xorq	%rcx,%r14
+
+	xorq	%rdx,%r15
+	rorq	$14,%r13
+	movq	%rdx,%rbx
+
+	andq	%r15,%rdi
+	rorq	$28,%r14
+	addq	%r13,%r12
+
+	xorq	%rdi,%rbx
+	addq	%r12,%r9
+	addq	%r12,%rbx
+
+	leaq	8(%rbp),%rbp
+	movq	0(%rsp),%r13
+	movq	104(%rsp),%rdi
+
+	movq	%r13,%r12
+	rorq	$7,%r13
+	addq	%r14,%rbx
+	movq	%rdi,%r14
+	rorq	$42,%rdi
+
+	xorq	%r12,%r13
+	shrq	$7,%r12
+	rorq	$1,%r13
+	xorq	%r14,%rdi
+	shrq	$6,%r14
+
+	rorq	$19,%rdi
+	xorq	%r13,%r12
+	xorq	%r14,%rdi
+	addq	64(%rsp),%r12
+
+	addq	120(%rsp),%r12
+	movq	%r9,%r13
+	addq	%rdi,%r12
+	movq	%rbx,%r14
+	rorq	$23,%r13
+	movq	%r10,%rdi
+
+	xorq	%r9,%r13
+	rorq	$5,%r14
+	xorq	%r11,%rdi
+
+	movq	%r12,120(%rsp)
+	xorq	%rbx,%r14
+	andq	%r9,%rdi
+
+	rorq	$4,%r13
+	addq	%rax,%r12
+	xorq	%r11,%rdi
+
+	rorq	$6,%r14
+	xorq	%r9,%r13
+	addq	%rdi,%r12
+
+	movq	%rbx,%rdi
+	addq	(%rbp),%r12
+	xorq	%rbx,%r14
+
+	xorq	%rcx,%rdi
+	rorq	$14,%r13
+	movq	%rcx,%rax
+
+	andq	%rdi,%r15
+	rorq	$28,%r14
+	addq	%r13,%r12
+
+	xorq	%r15,%rax
+	addq	%r12,%r8
+	addq	%r12,%rax
+
+	leaq	24(%rbp),%rbp
+	cmpb	$0,7(%rbp)
+	jnz	L$rounds_16_xx
+
+	movq	128+0(%rsp),%rdi
+	addq	%r14,%rax
+	leaq	128(%rsi),%rsi
+
+	addq	0(%rdi),%rax
+	addq	8(%rdi),%rbx
+	addq	16(%rdi),%rcx
+	addq	24(%rdi),%rdx
+	addq	32(%rdi),%r8
+	addq	40(%rdi),%r9
+	addq	48(%rdi),%r10
+	addq	56(%rdi),%r11
+
+	cmpq	128+16(%rsp),%rsi
+
+	movq	%rax,0(%rdi)
+	movq	%rbx,8(%rdi)
+	movq	%rcx,16(%rdi)
+	movq	%rdx,24(%rdi)
+	movq	%r8,32(%rdi)
+	movq	%r9,40(%rdi)
+	movq	%r10,48(%rdi)
+	movq	%r11,56(%rdi)
+	jb	L$loop
+
+	movq	128+24(%rsp),%rsi
+	movq	(%rsi),%r15
+	movq	8(%rsi),%r14
+	movq	16(%rsi),%r13
+	movq	24(%rsi),%r12
+	movq	32(%rsi),%rbp
+	movq	40(%rsi),%rbx
+	leaq	48(%rsi),%rsp
+L$epilogue:
+	.byte	0xf3,0xc3
+
+.p2align	6
+
+K512:
+.quad	0x428a2f98d728ae22,0x7137449123ef65cd
+.quad	0x428a2f98d728ae22,0x7137449123ef65cd
+.quad	0xb5c0fbcfec4d3b2f,0xe9b5dba58189dbbc
+.quad	0xb5c0fbcfec4d3b2f,0xe9b5dba58189dbbc
+.quad	0x3956c25bf348b538,0x59f111f1b605d019
+.quad	0x3956c25bf348b538,0x59f111f1b605d019
+.quad	0x923f82a4af194f9b,0xab1c5ed5da6d8118
+.quad	0x923f82a4af194f9b,0xab1c5ed5da6d8118
+.quad	0xd807aa98a3030242,0x12835b0145706fbe
+.quad	0xd807aa98a3030242,0x12835b0145706fbe
+.quad	0x243185be4ee4b28c,0x550c7dc3d5ffb4e2
+.quad	0x243185be4ee4b28c,0x550c7dc3d5ffb4e2
+.quad	0x72be5d74f27b896f,0x80deb1fe3b1696b1
+.quad	0x72be5d74f27b896f,0x80deb1fe3b1696b1
+.quad	0x9bdc06a725c71235,0xc19bf174cf692694
+.quad	0x9bdc06a725c71235,0xc19bf174cf692694
+.quad	0xe49b69c19ef14ad2,0xefbe4786384f25e3
+.quad	0xe49b69c19ef14ad2,0xefbe4786384f25e3
+.quad	0x0fc19dc68b8cd5b5,0x240ca1cc77ac9c65
+.quad	0x0fc19dc68b8cd5b5,0x240ca1cc77ac9c65
+.quad	0x2de92c6f592b0275,0x4a7484aa6ea6e483
+.quad	0x2de92c6f592b0275,0x4a7484aa6ea6e483
+.quad	0x5cb0a9dcbd41fbd4,0x76f988da831153b5
+.quad	0x5cb0a9dcbd41fbd4,0x76f988da831153b5
+.quad	0x983e5152ee66dfab,0xa831c66d2db43210
+.quad	0x983e5152ee66dfab,0xa831c66d2db43210
+.quad	0xb00327c898fb213f,0xbf597fc7beef0ee4
+.quad	0xb00327c898fb213f,0xbf597fc7beef0ee4
+.quad	0xc6e00bf33da88fc2,0xd5a79147930aa725
+.quad	0xc6e00bf33da88fc2,0xd5a79147930aa725
+.quad	0x06ca6351e003826f,0x142929670a0e6e70
+.quad	0x06ca6351e003826f,0x142929670a0e6e70
+.quad	0x27b70a8546d22ffc,0x2e1b21385c26c926
+.quad	0x27b70a8546d22ffc,0x2e1b21385c26c926
+.quad	0x4d2c6dfc5ac42aed,0x53380d139d95b3df
+.quad	0x4d2c6dfc5ac42aed,0x53380d139d95b3df
+.quad	0x650a73548baf63de,0x766a0abb3c77b2a8
+.quad	0x650a73548baf63de,0x766a0abb3c77b2a8
+.quad	0x81c2c92e47edaee6,0x92722c851482353b
+.quad	0x81c2c92e47edaee6,0x92722c851482353b
+.quad	0xa2bfe8a14cf10364,0xa81a664bbc423001
+.quad	0xa2bfe8a14cf10364,0xa81a664bbc423001
+.quad	0xc24b8b70d0f89791,0xc76c51a30654be30
+.quad	0xc24b8b70d0f89791,0xc76c51a30654be30
+.quad	0xd192e819d6ef5218,0xd69906245565a910
+.quad	0xd192e819d6ef5218,0xd69906245565a910
+.quad	0xf40e35855771202a,0x106aa07032bbd1b8
+.quad	0xf40e35855771202a,0x106aa07032bbd1b8
+.quad	0x19a4c116b8d2d0c8,0x1e376c085141ab53
+.quad	0x19a4c116b8d2d0c8,0x1e376c085141ab53
+.quad	0x2748774cdf8eeb99,0x34b0bcb5e19b48a8
+.quad	0x2748774cdf8eeb99,0x34b0bcb5e19b48a8
+.quad	0x391c0cb3c5c95a63,0x4ed8aa4ae3418acb
+.quad	0x391c0cb3c5c95a63,0x4ed8aa4ae3418acb
+.quad	0x5b9cca4f7763e373,0x682e6ff3d6b2b8a3
+.quad	0x5b9cca4f7763e373,0x682e6ff3d6b2b8a3
+.quad	0x748f82ee5defb2fc,0x78a5636f43172f60
+.quad	0x748f82ee5defb2fc,0x78a5636f43172f60
+.quad	0x84c87814a1f0ab72,0x8cc702081a6439ec
+.quad	0x84c87814a1f0ab72,0x8cc702081a6439ec
+.quad	0x90befffa23631e28,0xa4506cebde82bde9
+.quad	0x90befffa23631e28,0xa4506cebde82bde9
+.quad	0xbef9a3f7b2c67915,0xc67178f2e372532b
+.quad	0xbef9a3f7b2c67915,0xc67178f2e372532b
+.quad	0xca273eceea26619c,0xd186b8c721c0c207
+.quad	0xca273eceea26619c,0xd186b8c721c0c207
+.quad	0xeada7dd6cde0eb1e,0xf57d4f7fee6ed178
+.quad	0xeada7dd6cde0eb1e,0xf57d4f7fee6ed178
+.quad	0x06f067aa72176fba,0x0a637dc5a2c898a6
+.quad	0x06f067aa72176fba,0x0a637dc5a2c898a6
+.quad	0x113f9804bef90dae,0x1b710b35131c471b
+.quad	0x113f9804bef90dae,0x1b710b35131c471b
+.quad	0x28db77f523047d84,0x32caab7b40c72493
+.quad	0x28db77f523047d84,0x32caab7b40c72493
+.quad	0x3c9ebe0a15c9bebc,0x431d67c49c100d4c
+.quad	0x3c9ebe0a15c9bebc,0x431d67c49c100d4c
+.quad	0x4cc5d4becb3e42b6,0x597f299cfc657e2a
+.quad	0x4cc5d4becb3e42b6,0x597f299cfc657e2a
+.quad	0x5fcb6fab3ad6faec,0x6c44198c4a475817
+.quad	0x5fcb6fab3ad6faec,0x6c44198c4a475817
+
+.quad	0x0001020304050607,0x08090a0b0c0d0e0f
+.quad	0x0001020304050607,0x08090a0b0c0d0e0f
+.byte	83,72,65,53,49,50,32,98,108,111,99,107,32,116,114,97,110,115,102,111,114,109,32,102,111,114,32,120,56,54,95,54,52,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0
+#endif
diff --git a/third_party/boringssl/win-x86/crypto/aes/aes-586.asm b/third_party/boringssl/win-x86/crypto/aes/aes-586.asm
new file mode 100644
index 0000000..42ca026
--- /dev/null
+++ b/third_party/boringssl/win-x86/crypto/aes/aes-586.asm
@@ -0,0 +1,3219 @@
+%ifidn __OUTPUT_FORMAT__,obj
+section	code	use32 class=code align=64
+%elifidn __OUTPUT_FORMAT__,win32
+%ifdef __YASM_VERSION_ID__
+%if __YASM_VERSION_ID__ < 01010000h
+%error yasm version 1.1.0 or later needed.
+%endif
+; Yasm automatically includes .00 and complains about redefining it.
+; https://www.tortall.net/projects/yasm/manual/html/objfmt-win32-safeseh.html
+%else
+$@feat.00 equ 1
+%endif
+section	.text	code align=64
+%else
+section	.text	code
+%endif
+align	16
+__x86_AES_encrypt_compact:
+	mov	DWORD [20+esp],edi
+	xor	eax,DWORD [edi]
+	xor	ebx,DWORD [4+edi]
+	xor	ecx,DWORD [8+edi]
+	xor	edx,DWORD [12+edi]
+	mov	esi,DWORD [240+edi]
+	lea	esi,[esi*1+esi-2]
+	lea	esi,[esi*8+edi]
+	mov	DWORD [24+esp],esi
+	mov	edi,DWORD [ebp-128]
+	mov	esi,DWORD [ebp-96]
+	mov	edi,DWORD [ebp-64]
+	mov	esi,DWORD [ebp-32]
+	mov	edi,DWORD [ebp]
+	mov	esi,DWORD [32+ebp]
+	mov	edi,DWORD [64+ebp]
+	mov	esi,DWORD [96+ebp]
+align	16
+L$000loop:
+	mov	esi,eax
+	and	esi,255
+	movzx	esi,BYTE [esi*1+ebp-128]
+	movzx	edi,bh
+	movzx	edi,BYTE [edi*1+ebp-128]
+	shl	edi,8
+	xor	esi,edi
+	mov	edi,ecx
+	shr	edi,16
+	and	edi,255
+	movzx	edi,BYTE [edi*1+ebp-128]
+	shl	edi,16
+	xor	esi,edi
+	mov	edi,edx
+	shr	edi,24
+	movzx	edi,BYTE [edi*1+ebp-128]
+	shl	edi,24
+	xor	esi,edi
+	mov	DWORD [4+esp],esi
+	mov	esi,ebx
+	and	esi,255
+	shr	ebx,16
+	movzx	esi,BYTE [esi*1+ebp-128]
+	movzx	edi,ch
+	movzx	edi,BYTE [edi*1+ebp-128]
+	shl	edi,8
+	xor	esi,edi
+	mov	edi,edx
+	shr	edi,16
+	and	edi,255
+	movzx	edi,BYTE [edi*1+ebp-128]
+	shl	edi,16
+	xor	esi,edi
+	mov	edi,eax
+	shr	edi,24
+	movzx	edi,BYTE [edi*1+ebp-128]
+	shl	edi,24
+	xor	esi,edi
+	mov	DWORD [8+esp],esi
+	mov	esi,ecx
+	and	esi,255
+	shr	ecx,24
+	movzx	esi,BYTE [esi*1+ebp-128]
+	movzx	edi,dh
+	movzx	edi,BYTE [edi*1+ebp-128]
+	shl	edi,8
+	xor	esi,edi
+	mov	edi,eax
+	shr	edi,16
+	and	edx,255
+	and	edi,255
+	movzx	edi,BYTE [edi*1+ebp-128]
+	shl	edi,16
+	xor	esi,edi
+	movzx	edi,bh
+	movzx	edi,BYTE [edi*1+ebp-128]
+	shl	edi,24
+	xor	esi,edi
+	and	edx,255
+	movzx	edx,BYTE [edx*1+ebp-128]
+	movzx	eax,ah
+	movzx	eax,BYTE [eax*1+ebp-128]
+	shl	eax,8
+	xor	edx,eax
+	mov	eax,DWORD [4+esp]
+	and	ebx,255
+	movzx	ebx,BYTE [ebx*1+ebp-128]
+	shl	ebx,16
+	xor	edx,ebx
+	mov	ebx,DWORD [8+esp]
+	movzx	ecx,BYTE [ecx*1+ebp-128]
+	shl	ecx,24
+	xor	edx,ecx
+	mov	ecx,esi
+	mov	ebp,2155905152
+	and	ebp,ecx
+	lea	edi,[ecx*1+ecx]
+	mov	esi,ebp
+	shr	ebp,7
+	and	edi,4278124286
+	sub	esi,ebp
+	mov	ebp,ecx
+	and	esi,454761243
+	ror	ebp,16
+	xor	esi,edi
+	mov	edi,ecx
+	xor	ecx,esi
+	ror	edi,24
+	xor	esi,ebp
+	rol	ecx,24
+	xor	esi,edi
+	mov	ebp,2155905152
+	xor	ecx,esi
+	and	ebp,edx
+	lea	edi,[edx*1+edx]
+	mov	esi,ebp
+	shr	ebp,7
+	and	edi,4278124286
+	sub	esi,ebp
+	mov	ebp,edx
+	and	esi,454761243
+	ror	ebp,16
+	xor	esi,edi
+	mov	edi,edx
+	xor	edx,esi
+	ror	edi,24
+	xor	esi,ebp
+	rol	edx,24
+	xor	esi,edi
+	mov	ebp,2155905152
+	xor	edx,esi
+	and	ebp,eax
+	lea	edi,[eax*1+eax]
+	mov	esi,ebp
+	shr	ebp,7
+	and	edi,4278124286
+	sub	esi,ebp
+	mov	ebp,eax
+	and	esi,454761243
+	ror	ebp,16
+	xor	esi,edi
+	mov	edi,eax
+	xor	eax,esi
+	ror	edi,24
+	xor	esi,ebp
+	rol	eax,24
+	xor	esi,edi
+	mov	ebp,2155905152
+	xor	eax,esi
+	and	ebp,ebx
+	lea	edi,[ebx*1+ebx]
+	mov	esi,ebp
+	shr	ebp,7
+	and	edi,4278124286
+	sub	esi,ebp
+	mov	ebp,ebx
+	and	esi,454761243
+	ror	ebp,16
+	xor	esi,edi
+	mov	edi,ebx
+	xor	ebx,esi
+	ror	edi,24
+	xor	esi,ebp
+	rol	ebx,24
+	xor	esi,edi
+	xor	ebx,esi
+	mov	edi,DWORD [20+esp]
+	mov	ebp,DWORD [28+esp]
+	add	edi,16
+	xor	eax,DWORD [edi]
+	xor	ebx,DWORD [4+edi]
+	xor	ecx,DWORD [8+edi]
+	xor	edx,DWORD [12+edi]
+	cmp	edi,DWORD [24+esp]
+	mov	DWORD [20+esp],edi
+	jb	NEAR L$000loop
+	mov	esi,eax
+	and	esi,255
+	movzx	esi,BYTE [esi*1+ebp-128]
+	movzx	edi,bh
+	movzx	edi,BYTE [edi*1+ebp-128]
+	shl	edi,8
+	xor	esi,edi
+	mov	edi,ecx
+	shr	edi,16
+	and	edi,255
+	movzx	edi,BYTE [edi*1+ebp-128]
+	shl	edi,16
+	xor	esi,edi
+	mov	edi,edx
+	shr	edi,24
+	movzx	edi,BYTE [edi*1+ebp-128]
+	shl	edi,24
+	xor	esi,edi
+	mov	DWORD [4+esp],esi
+	mov	esi,ebx
+	and	esi,255
+	shr	ebx,16
+	movzx	esi,BYTE [esi*1+ebp-128]
+	movzx	edi,ch
+	movzx	edi,BYTE [edi*1+ebp-128]
+	shl	edi,8
+	xor	esi,edi
+	mov	edi,edx
+	shr	edi,16
+	and	edi,255
+	movzx	edi,BYTE [edi*1+ebp-128]
+	shl	edi,16
+	xor	esi,edi
+	mov	edi,eax
+	shr	edi,24
+	movzx	edi,BYTE [edi*1+ebp-128]
+	shl	edi,24
+	xor	esi,edi
+	mov	DWORD [8+esp],esi
+	mov	esi,ecx
+	and	esi,255
+	shr	ecx,24
+	movzx	esi,BYTE [esi*1+ebp-128]
+	movzx	edi,dh
+	movzx	edi,BYTE [edi*1+ebp-128]
+	shl	edi,8
+	xor	esi,edi
+	mov	edi,eax
+	shr	edi,16
+	and	edx,255
+	and	edi,255
+	movzx	edi,BYTE [edi*1+ebp-128]
+	shl	edi,16
+	xor	esi,edi
+	movzx	edi,bh
+	movzx	edi,BYTE [edi*1+ebp-128]
+	shl	edi,24
+	xor	esi,edi
+	mov	edi,DWORD [20+esp]
+	and	edx,255
+	movzx	edx,BYTE [edx*1+ebp-128]
+	movzx	eax,ah
+	movzx	eax,BYTE [eax*1+ebp-128]
+	shl	eax,8
+	xor	edx,eax
+	mov	eax,DWORD [4+esp]
+	and	ebx,255
+	movzx	ebx,BYTE [ebx*1+ebp-128]
+	shl	ebx,16
+	xor	edx,ebx
+	mov	ebx,DWORD [8+esp]
+	movzx	ecx,BYTE [ecx*1+ebp-128]
+	shl	ecx,24
+	xor	edx,ecx
+	mov	ecx,esi
+	xor	eax,DWORD [16+edi]
+	xor	ebx,DWORD [20+edi]
+	xor	ecx,DWORD [24+edi]
+	xor	edx,DWORD [28+edi]
+	ret
+align	16
+__sse_AES_encrypt_compact:
+	pxor	mm0,[edi]
+	pxor	mm4,[8+edi]
+	mov	esi,DWORD [240+edi]
+	lea	esi,[esi*1+esi-2]
+	lea	esi,[esi*8+edi]
+	mov	DWORD [24+esp],esi
+	mov	eax,454761243
+	mov	DWORD [8+esp],eax
+	mov	DWORD [12+esp],eax
+	mov	eax,DWORD [ebp-128]
+	mov	ebx,DWORD [ebp-96]
+	mov	ecx,DWORD [ebp-64]
+	mov	edx,DWORD [ebp-32]
+	mov	eax,DWORD [ebp]
+	mov	ebx,DWORD [32+ebp]
+	mov	ecx,DWORD [64+ebp]
+	mov	edx,DWORD [96+ebp]
+align	16
+L$001loop:
+	pshufw	mm1,mm0,8
+	pshufw	mm5,mm4,13
+	movd	eax,mm1
+	movd	ebx,mm5
+	mov	DWORD [20+esp],edi
+	movzx	esi,al
+	movzx	edx,ah
+	pshufw	mm2,mm0,13
+	movzx	ecx,BYTE [esi*1+ebp-128]
+	movzx	edi,bl
+	movzx	edx,BYTE [edx*1+ebp-128]
+	shr	eax,16
+	shl	edx,8
+	movzx	esi,BYTE [edi*1+ebp-128]
+	movzx	edi,bh
+	shl	esi,16
+	pshufw	mm6,mm4,8
+	or	ecx,esi
+	movzx	esi,BYTE [edi*1+ebp-128]
+	movzx	edi,ah
+	shl	esi,24
+	shr	ebx,16
+	or	edx,esi
+	movzx	esi,BYTE [edi*1+ebp-128]
+	movzx	edi,bh
+	shl	esi,8
+	or	ecx,esi
+	movzx	esi,BYTE [edi*1+ebp-128]
+	movzx	edi,al
+	shl	esi,24
+	or	ecx,esi
+	movzx	esi,BYTE [edi*1+ebp-128]
+	movzx	edi,bl
+	movd	eax,mm2
+	movd	mm0,ecx
+	movzx	ecx,BYTE [edi*1+ebp-128]
+	movzx	edi,ah
+	shl	ecx,16
+	movd	ebx,mm6
+	or	ecx,esi
+	movzx	esi,BYTE [edi*1+ebp-128]
+	movzx	edi,bh
+	shl	esi,24
+	or	ecx,esi
+	movzx	esi,BYTE [edi*1+ebp-128]
+	movzx	edi,bl
+	shl	esi,8
+	shr	ebx,16
+	or	ecx,esi
+	movzx	esi,BYTE [edi*1+ebp-128]
+	movzx	edi,al
+	shr	eax,16
+	movd	mm1,ecx
+	movzx	ecx,BYTE [edi*1+ebp-128]
+	movzx	edi,ah
+	shl	ecx,16
+	and	eax,255
+	or	ecx,esi
+	punpckldq	mm0,mm1
+	movzx	esi,BYTE [edi*1+ebp-128]
+	movzx	edi,bh
+	shl	esi,24
+	and	ebx,255
+	movzx	eax,BYTE [eax*1+ebp-128]
+	or	ecx,esi
+	shl	eax,16
+	movzx	esi,BYTE [edi*1+ebp-128]
+	or	edx,eax
+	shl	esi,8
+	movzx	ebx,BYTE [ebx*1+ebp-128]
+	or	ecx,esi
+	or	edx,ebx
+	mov	edi,DWORD [20+esp]
+	movd	mm4,ecx
+	movd	mm5,edx
+	punpckldq	mm4,mm5
+	add	edi,16
+	cmp	edi,DWORD [24+esp]
+	ja	NEAR L$002out
+	movq	mm2,[8+esp]
+	pxor	mm3,mm3
+	pxor	mm7,mm7
+	movq	mm1,mm0
+	movq	mm5,mm4
+	pcmpgtb	mm3,mm0
+	pcmpgtb	mm7,mm4
+	pand	mm3,mm2
+	pand	mm7,mm2
+	pshufw	mm2,mm0,177
+	pshufw	mm6,mm4,177
+	paddb	mm0,mm0
+	paddb	mm4,mm4
+	pxor	mm0,mm3
+	pxor	mm4,mm7
+	pshufw	mm3,mm2,177
+	pshufw	mm7,mm6,177
+	pxor	mm1,mm0
+	pxor	mm5,mm4
+	pxor	mm0,mm2
+	pxor	mm4,mm6
+	movq	mm2,mm3
+	movq	mm6,mm7
+	pslld	mm3,8
+	pslld	mm7,8
+	psrld	mm2,24
+	psrld	mm6,24
+	pxor	mm0,mm3
+	pxor	mm4,mm7
+	pxor	mm0,mm2
+	pxor	mm4,mm6
+	movq	mm3,mm1
+	movq	mm7,mm5
+	movq	mm2,[edi]
+	movq	mm6,[8+edi]
+	psrld	mm1,8
+	psrld	mm5,8
+	mov	eax,DWORD [ebp-128]
+	pslld	mm3,24
+	pslld	mm7,24
+	mov	ebx,DWORD [ebp-64]
+	pxor	mm0,mm1
+	pxor	mm4,mm5
+	mov	ecx,DWORD [ebp]
+	pxor	mm0,mm3
+	pxor	mm4,mm7
+	mov	edx,DWORD [64+ebp]
+	pxor	mm0,mm2
+	pxor	mm4,mm6
+	jmp	NEAR L$001loop
+align	16
+L$002out:
+	pxor	mm0,[edi]
+	pxor	mm4,[8+edi]
+	ret
+align	16
+__x86_AES_encrypt:
+	mov	DWORD [20+esp],edi
+	xor	eax,DWORD [edi]
+	xor	ebx,DWORD [4+edi]
+	xor	ecx,DWORD [8+edi]
+	xor	edx,DWORD [12+edi]
+	mov	esi,DWORD [240+edi]
+	lea	esi,[esi*1+esi-2]
+	lea	esi,[esi*8+edi]
+	mov	DWORD [24+esp],esi
+align	16
+L$003loop:
+	mov	esi,eax
+	and	esi,255
+	mov	esi,DWORD [esi*8+ebp]
+	movzx	edi,bh
+	xor	esi,DWORD [3+edi*8+ebp]
+	mov	edi,ecx
+	shr	edi,16
+	and	edi,255
+	xor	esi,DWORD [2+edi*8+ebp]
+	mov	edi,edx
+	shr	edi,24
+	xor	esi,DWORD [1+edi*8+ebp]
+	mov	DWORD [4+esp],esi
+	mov	esi,ebx
+	and	esi,255
+	shr	ebx,16
+	mov	esi,DWORD [esi*8+ebp]
+	movzx	edi,ch
+	xor	esi,DWORD [3+edi*8+ebp]
+	mov	edi,edx
+	shr	edi,16
+	and	edi,255
+	xor	esi,DWORD [2+edi*8+ebp]
+	mov	edi,eax
+	shr	edi,24
+	xor	esi,DWORD [1+edi*8+ebp]
+	mov	DWORD [8+esp],esi
+	mov	esi,ecx
+	and	esi,255
+	shr	ecx,24
+	mov	esi,DWORD [esi*8+ebp]
+	movzx	edi,dh
+	xor	esi,DWORD [3+edi*8+ebp]
+	mov	edi,eax
+	shr	edi,16
+	and	edx,255
+	and	edi,255
+	xor	esi,DWORD [2+edi*8+ebp]
+	movzx	edi,bh
+	xor	esi,DWORD [1+edi*8+ebp]
+	mov	edi,DWORD [20+esp]
+	mov	edx,DWORD [edx*8+ebp]
+	movzx	eax,ah
+	xor	edx,DWORD [3+eax*8+ebp]
+	mov	eax,DWORD [4+esp]
+	and	ebx,255
+	xor	edx,DWORD [2+ebx*8+ebp]
+	mov	ebx,DWORD [8+esp]
+	xor	edx,DWORD [1+ecx*8+ebp]
+	mov	ecx,esi
+	add	edi,16
+	xor	eax,DWORD [edi]
+	xor	ebx,DWORD [4+edi]
+	xor	ecx,DWORD [8+edi]
+	xor	edx,DWORD [12+edi]
+	cmp	edi,DWORD [24+esp]
+	mov	DWORD [20+esp],edi
+	jb	NEAR L$003loop
+	mov	esi,eax
+	and	esi,255
+	mov	esi,DWORD [2+esi*8+ebp]
+	and	esi,255
+	movzx	edi,bh
+	mov	edi,DWORD [edi*8+ebp]
+	and	edi,65280
+	xor	esi,edi
+	mov	edi,ecx
+	shr	edi,16
+	and	edi,255
+	mov	edi,DWORD [edi*8+ebp]
+	and	edi,16711680
+	xor	esi,edi
+	mov	edi,edx
+	shr	edi,24
+	mov	edi,DWORD [2+edi*8+ebp]
+	and	edi,4278190080
+	xor	esi,edi
+	mov	DWORD [4+esp],esi
+	mov	esi,ebx
+	and	esi,255
+	shr	ebx,16
+	mov	esi,DWORD [2+esi*8+ebp]
+	and	esi,255
+	movzx	edi,ch
+	mov	edi,DWORD [edi*8+ebp]
+	and	edi,65280
+	xor	esi,edi
+	mov	edi,edx
+	shr	edi,16
+	and	edi,255
+	mov	edi,DWORD [edi*8+ebp]
+	and	edi,16711680
+	xor	esi,edi
+	mov	edi,eax
+	shr	edi,24
+	mov	edi,DWORD [2+edi*8+ebp]
+	and	edi,4278190080
+	xor	esi,edi
+	mov	DWORD [8+esp],esi
+	mov	esi,ecx
+	and	esi,255
+	shr	ecx,24
+	mov	esi,DWORD [2+esi*8+ebp]
+	and	esi,255
+	movzx	edi,dh
+	mov	edi,DWORD [edi*8+ebp]
+	and	edi,65280
+	xor	esi,edi
+	mov	edi,eax
+	shr	edi,16
+	and	edx,255
+	and	edi,255
+	mov	edi,DWORD [edi*8+ebp]
+	and	edi,16711680
+	xor	esi,edi
+	movzx	edi,bh
+	mov	edi,DWORD [2+edi*8+ebp]
+	and	edi,4278190080
+	xor	esi,edi
+	mov	edi,DWORD [20+esp]
+	and	edx,255
+	mov	edx,DWORD [2+edx*8+ebp]
+	and	edx,255
+	movzx	eax,ah
+	mov	eax,DWORD [eax*8+ebp]
+	and	eax,65280
+	xor	edx,eax
+	mov	eax,DWORD [4+esp]
+	and	ebx,255
+	mov	ebx,DWORD [ebx*8+ebp]
+	and	ebx,16711680
+	xor	edx,ebx
+	mov	ebx,DWORD [8+esp]
+	mov	ecx,DWORD [2+ecx*8+ebp]
+	and	ecx,4278190080
+	xor	edx,ecx
+	mov	ecx,esi
+	add	edi,16
+	xor	eax,DWORD [edi]
+	xor	ebx,DWORD [4+edi]
+	xor	ecx,DWORD [8+edi]
+	xor	edx,DWORD [12+edi]
+	ret
+align	64
+L$AES_Te:
+dd	2774754246,2774754246
+dd	2222750968,2222750968
+dd	2574743534,2574743534
+dd	2373680118,2373680118
+dd	234025727,234025727
+dd	3177933782,3177933782
+dd	2976870366,2976870366
+dd	1422247313,1422247313
+dd	1345335392,1345335392
+dd	50397442,50397442
+dd	2842126286,2842126286
+dd	2099981142,2099981142
+dd	436141799,436141799
+dd	1658312629,1658312629
+dd	3870010189,3870010189
+dd	2591454956,2591454956
+dd	1170918031,1170918031
+dd	2642575903,2642575903
+dd	1086966153,1086966153
+dd	2273148410,2273148410
+dd	368769775,368769775
+dd	3948501426,3948501426
+dd	3376891790,3376891790
+dd	200339707,200339707
+dd	3970805057,3970805057
+dd	1742001331,1742001331
+dd	4255294047,4255294047
+dd	3937382213,3937382213
+dd	3214711843,3214711843
+dd	4154762323,4154762323
+dd	2524082916,2524082916
+dd	1539358875,1539358875
+dd	3266819957,3266819957
+dd	486407649,486407649
+dd	2928907069,2928907069
+dd	1780885068,1780885068
+dd	1513502316,1513502316
+dd	1094664062,1094664062
+dd	49805301,49805301
+dd	1338821763,1338821763
+dd	1546925160,1546925160
+dd	4104496465,4104496465
+dd	887481809,887481809
+dd	150073849,150073849
+dd	2473685474,2473685474
+dd	1943591083,1943591083
+dd	1395732834,1395732834
+dd	1058346282,1058346282
+dd	201589768,201589768
+dd	1388824469,1388824469
+dd	1696801606,1696801606
+dd	1589887901,1589887901
+dd	672667696,672667696
+dd	2711000631,2711000631
+dd	251987210,251987210
+dd	3046808111,3046808111
+dd	151455502,151455502
+dd	907153956,907153956
+dd	2608889883,2608889883
+dd	1038279391,1038279391
+dd	652995533,652995533
+dd	1764173646,1764173646
+dd	3451040383,3451040383
+dd	2675275242,2675275242
+dd	453576978,453576978
+dd	2659418909,2659418909
+dd	1949051992,1949051992
+dd	773462580,773462580
+dd	756751158,756751158
+dd	2993581788,2993581788
+dd	3998898868,3998898868
+dd	4221608027,4221608027
+dd	4132590244,4132590244
+dd	1295727478,1295727478
+dd	1641469623,1641469623
+dd	3467883389,3467883389
+dd	2066295122,2066295122
+dd	1055122397,1055122397
+dd	1898917726,1898917726
+dd	2542044179,2542044179
+dd	4115878822,4115878822
+dd	1758581177,1758581177
+dd	0,0
+dd	753790401,753790401
+dd	1612718144,1612718144
+dd	536673507,536673507
+dd	3367088505,3367088505
+dd	3982187446,3982187446
+dd	3194645204,3194645204
+dd	1187761037,1187761037
+dd	3653156455,3653156455
+dd	1262041458,1262041458
+dd	3729410708,3729410708
+dd	3561770136,3561770136
+dd	3898103984,3898103984
+dd	1255133061,1255133061
+dd	1808847035,1808847035
+dd	720367557,720367557
+dd	3853167183,3853167183
+dd	385612781,385612781
+dd	3309519750,3309519750
+dd	3612167578,3612167578
+dd	1429418854,1429418854
+dd	2491778321,2491778321
+dd	3477423498,3477423498
+dd	284817897,284817897
+dd	100794884,100794884
+dd	2172616702,2172616702
+dd	4031795360,4031795360
+dd	1144798328,1144798328
+dd	3131023141,3131023141
+dd	3819481163,3819481163
+dd	4082192802,4082192802
+dd	4272137053,4272137053
+dd	3225436288,3225436288
+dd	2324664069,2324664069
+dd	2912064063,2912064063
+dd	3164445985,3164445985
+dd	1211644016,1211644016
+dd	83228145,83228145
+dd	3753688163,3753688163
+dd	3249976951,3249976951
+dd	1977277103,1977277103
+dd	1663115586,1663115586
+dd	806359072,806359072
+dd	452984805,452984805
+dd	250868733,250868733
+dd	1842533055,1842533055
+dd	1288555905,1288555905
+dd	336333848,336333848
+dd	890442534,890442534
+dd	804056259,804056259
+dd	3781124030,3781124030
+dd	2727843637,2727843637
+dd	3427026056,3427026056
+dd	957814574,957814574
+dd	1472513171,1472513171
+dd	4071073621,4071073621
+dd	2189328124,2189328124
+dd	1195195770,1195195770
+dd	2892260552,2892260552
+dd	3881655738,3881655738
+dd	723065138,723065138
+dd	2507371494,2507371494
+dd	2690670784,2690670784
+dd	2558624025,2558624025
+dd	3511635870,3511635870
+dd	2145180835,2145180835
+dd	1713513028,1713513028
+dd	2116692564,2116692564
+dd	2878378043,2878378043
+dd	2206763019,2206763019
+dd	3393603212,3393603212
+dd	703524551,703524551
+dd	3552098411,3552098411
+dd	1007948840,1007948840
+dd	2044649127,2044649127
+dd	3797835452,3797835452
+dd	487262998,487262998
+dd	1994120109,1994120109
+dd	1004593371,1004593371
+dd	1446130276,1446130276
+dd	1312438900,1312438900
+dd	503974420,503974420
+dd	3679013266,3679013266
+dd	168166924,168166924
+dd	1814307912,1814307912
+dd	3831258296,3831258296
+dd	1573044895,1573044895
+dd	1859376061,1859376061
+dd	4021070915,4021070915
+dd	2791465668,2791465668
+dd	2828112185,2828112185
+dd	2761266481,2761266481
+dd	937747667,937747667
+dd	2339994098,2339994098
+dd	854058965,854058965
+dd	1137232011,1137232011
+dd	1496790894,1496790894
+dd	3077402074,3077402074
+dd	2358086913,2358086913
+dd	1691735473,1691735473
+dd	3528347292,3528347292
+dd	3769215305,3769215305
+dd	3027004632,3027004632
+dd	4199962284,4199962284
+dd	133494003,133494003
+dd	636152527,636152527
+dd	2942657994,2942657994
+dd	2390391540,2390391540
+dd	3920539207,3920539207
+dd	403179536,403179536
+dd	3585784431,3585784431
+dd	2289596656,2289596656
+dd	1864705354,1864705354
+dd	1915629148,1915629148
+dd	605822008,605822008
+dd	4054230615,4054230615
+dd	3350508659,3350508659
+dd	1371981463,1371981463
+dd	602466507,602466507
+dd	2094914977,2094914977
+dd	2624877800,2624877800
+dd	555687742,555687742
+dd	3712699286,3712699286
+dd	3703422305,3703422305
+dd	2257292045,2257292045
+dd	2240449039,2240449039
+dd	2423288032,2423288032
+dd	1111375484,1111375484
+dd	3300242801,3300242801
+dd	2858837708,2858837708
+dd	3628615824,3628615824
+dd	84083462,84083462
+dd	32962295,32962295
+dd	302911004,302911004
+dd	2741068226,2741068226
+dd	1597322602,1597322602
+dd	4183250862,4183250862
+dd	3501832553,3501832553
+dd	2441512471,2441512471
+dd	1489093017,1489093017
+dd	656219450,656219450
+dd	3114180135,3114180135
+dd	954327513,954327513
+dd	335083755,335083755
+dd	3013122091,3013122091
+dd	856756514,856756514
+dd	3144247762,3144247762
+dd	1893325225,1893325225
+dd	2307821063,2307821063
+dd	2811532339,2811532339
+dd	3063651117,3063651117
+dd	572399164,572399164
+dd	2458355477,2458355477
+dd	552200649,552200649
+dd	1238290055,1238290055
+dd	4283782570,4283782570
+dd	2015897680,2015897680
+dd	2061492133,2061492133
+dd	2408352771,2408352771
+dd	4171342169,4171342169
+dd	2156497161,2156497161
+dd	386731290,386731290
+dd	3669999461,3669999461
+dd	837215959,837215959
+dd	3326231172,3326231172
+dd	3093850320,3093850320
+dd	3275833730,3275833730
+dd	2962856233,2962856233
+dd	1999449434,1999449434
+dd	286199582,286199582
+dd	3417354363,3417354363
+dd	4233385128,4233385128
+dd	3602627437,3602627437
+dd	974525996,974525996
+db	99,124,119,123,242,107,111,197
+db	48,1,103,43,254,215,171,118
+db	202,130,201,125,250,89,71,240
+db	173,212,162,175,156,164,114,192
+db	183,253,147,38,54,63,247,204
+db	52,165,229,241,113,216,49,21
+db	4,199,35,195,24,150,5,154
+db	7,18,128,226,235,39,178,117
+db	9,131,44,26,27,110,90,160
+db	82,59,214,179,41,227,47,132
+db	83,209,0,237,32,252,177,91
+db	106,203,190,57,74,76,88,207
+db	208,239,170,251,67,77,51,133
+db	69,249,2,127,80,60,159,168
+db	81,163,64,143,146,157,56,245
+db	188,182,218,33,16,255,243,210
+db	205,12,19,236,95,151,68,23
+db	196,167,126,61,100,93,25,115
+db	96,129,79,220,34,42,144,136
+db	70,238,184,20,222,94,11,219
+db	224,50,58,10,73,6,36,92
+db	194,211,172,98,145,149,228,121
+db	231,200,55,109,141,213,78,169
+db	108,86,244,234,101,122,174,8
+db	186,120,37,46,28,166,180,198
+db	232,221,116,31,75,189,139,138
+db	112,62,181,102,72,3,246,14
+db	97,53,87,185,134,193,29,158
+db	225,248,152,17,105,217,142,148
+db	155,30,135,233,206,85,40,223
+db	140,161,137,13,191,230,66,104
+db	65,153,45,15,176,84,187,22
+db	99,124,119,123,242,107,111,197
+db	48,1,103,43,254,215,171,118
+db	202,130,201,125,250,89,71,240
+db	173,212,162,175,156,164,114,192
+db	183,253,147,38,54,63,247,204
+db	52,165,229,241,113,216,49,21
+db	4,199,35,195,24,150,5,154
+db	7,18,128,226,235,39,178,117
+db	9,131,44,26,27,110,90,160
+db	82,59,214,179,41,227,47,132
+db	83,209,0,237,32,252,177,91
+db	106,203,190,57,74,76,88,207
+db	208,239,170,251,67,77,51,133
+db	69,249,2,127,80,60,159,168
+db	81,163,64,143,146,157,56,245
+db	188,182,218,33,16,255,243,210
+db	205,12,19,236,95,151,68,23
+db	196,167,126,61,100,93,25,115
+db	96,129,79,220,34,42,144,136
+db	70,238,184,20,222,94,11,219
+db	224,50,58,10,73,6,36,92
+db	194,211,172,98,145,149,228,121
+db	231,200,55,109,141,213,78,169
+db	108,86,244,234,101,122,174,8
+db	186,120,37,46,28,166,180,198
+db	232,221,116,31,75,189,139,138
+db	112,62,181,102,72,3,246,14
+db	97,53,87,185,134,193,29,158
+db	225,248,152,17,105,217,142,148
+db	155,30,135,233,206,85,40,223
+db	140,161,137,13,191,230,66,104
+db	65,153,45,15,176,84,187,22
+db	99,124,119,123,242,107,111,197
+db	48,1,103,43,254,215,171,118
+db	202,130,201,125,250,89,71,240
+db	173,212,162,175,156,164,114,192
+db	183,253,147,38,54,63,247,204
+db	52,165,229,241,113,216,49,21
+db	4,199,35,195,24,150,5,154
+db	7,18,128,226,235,39,178,117
+db	9,131,44,26,27,110,90,160
+db	82,59,214,179,41,227,47,132
+db	83,209,0,237,32,252,177,91
+db	106,203,190,57,74,76,88,207
+db	208,239,170,251,67,77,51,133
+db	69,249,2,127,80,60,159,168
+db	81,163,64,143,146,157,56,245
+db	188,182,218,33,16,255,243,210
+db	205,12,19,236,95,151,68,23
+db	196,167,126,61,100,93,25,115
+db	96,129,79,220,34,42,144,136
+db	70,238,184,20,222,94,11,219
+db	224,50,58,10,73,6,36,92
+db	194,211,172,98,145,149,228,121
+db	231,200,55,109,141,213,78,169
+db	108,86,244,234,101,122,174,8
+db	186,120,37,46,28,166,180,198
+db	232,221,116,31,75,189,139,138
+db	112,62,181,102,72,3,246,14
+db	97,53,87,185,134,193,29,158
+db	225,248,152,17,105,217,142,148
+db	155,30,135,233,206,85,40,223
+db	140,161,137,13,191,230,66,104
+db	65,153,45,15,176,84,187,22
+db	99,124,119,123,242,107,111,197
+db	48,1,103,43,254,215,171,118
+db	202,130,201,125,250,89,71,240
+db	173,212,162,175,156,164,114,192
+db	183,253,147,38,54,63,247,204
+db	52,165,229,241,113,216,49,21
+db	4,199,35,195,24,150,5,154
+db	7,18,128,226,235,39,178,117
+db	9,131,44,26,27,110,90,160
+db	82,59,214,179,41,227,47,132
+db	83,209,0,237,32,252,177,91
+db	106,203,190,57,74,76,88,207
+db	208,239,170,251,67,77,51,133
+db	69,249,2,127,80,60,159,168
+db	81,163,64,143,146,157,56,245
+db	188,182,218,33,16,255,243,210
+db	205,12,19,236,95,151,68,23
+db	196,167,126,61,100,93,25,115
+db	96,129,79,220,34,42,144,136
+db	70,238,184,20,222,94,11,219
+db	224,50,58,10,73,6,36,92
+db	194,211,172,98,145,149,228,121
+db	231,200,55,109,141,213,78,169
+db	108,86,244,234,101,122,174,8
+db	186,120,37,46,28,166,180,198
+db	232,221,116,31,75,189,139,138
+db	112,62,181,102,72,3,246,14
+db	97,53,87,185,134,193,29,158
+db	225,248,152,17,105,217,142,148
+db	155,30,135,233,206,85,40,223
+db	140,161,137,13,191,230,66,104
+db	65,153,45,15,176,84,187,22
+dd	1,2,4,8
+dd	16,32,64,128
+dd	27,54,0,0
+dd	0,0,0,0
+global	_asm_AES_encrypt
+align	16
+_asm_AES_encrypt:
+L$_asm_AES_encrypt_begin:
+	push	ebp
+	push	ebx
+	push	esi
+	push	edi
+	mov	esi,DWORD [20+esp]
+	mov	edi,DWORD [28+esp]
+	mov	eax,esp
+	sub	esp,36
+	and	esp,-64
+	lea	ebx,[edi-127]
+	sub	ebx,esp
+	neg	ebx
+	and	ebx,960
+	sub	esp,ebx
+	add	esp,4
+	mov	DWORD [28+esp],eax
+	call	L$004pic_point
+L$004pic_point:
+	pop	ebp
+	lea	eax,[_OPENSSL_ia32cap_P]
+	lea	ebp,[(L$AES_Te-L$004pic_point)+ebp]
+	lea	ebx,[764+esp]
+	sub	ebx,ebp
+	and	ebx,768
+	lea	ebp,[2176+ebx*1+ebp]
+	bt	DWORD [eax],25
+	jnc	NEAR L$005x86
+	movq	mm0,[esi]
+	movq	mm4,[8+esi]
+	call	__sse_AES_encrypt_compact
+	mov	esp,DWORD [28+esp]
+	mov	esi,DWORD [24+esp]
+	movq	[esi],mm0
+	movq	[8+esi],mm4
+	emms
+	pop	edi
+	pop	esi
+	pop	ebx
+	pop	ebp
+	ret
+align	16
+L$005x86:
+	mov	DWORD [24+esp],ebp
+	mov	eax,DWORD [esi]
+	mov	ebx,DWORD [4+esi]
+	mov	ecx,DWORD [8+esi]
+	mov	edx,DWORD [12+esi]
+	call	__x86_AES_encrypt_compact
+	mov	esp,DWORD [28+esp]
+	mov	esi,DWORD [24+esp]
+	mov	DWORD [esi],eax
+	mov	DWORD [4+esi],ebx
+	mov	DWORD [8+esi],ecx
+	mov	DWORD [12+esi],edx
+	pop	edi
+	pop	esi
+	pop	ebx
+	pop	ebp
+	ret
+align	16
+__x86_AES_decrypt_compact:
+	mov	DWORD [20+esp],edi
+	xor	eax,DWORD [edi]
+	xor	ebx,DWORD [4+edi]
+	xor	ecx,DWORD [8+edi]
+	xor	edx,DWORD [12+edi]
+	mov	esi,DWORD [240+edi]
+	lea	esi,[esi*1+esi-2]
+	lea	esi,[esi*8+edi]
+	mov	DWORD [24+esp],esi
+	mov	edi,DWORD [ebp-128]
+	mov	esi,DWORD [ebp-96]
+	mov	edi,DWORD [ebp-64]
+	mov	esi,DWORD [ebp-32]
+	mov	edi,DWORD [ebp]
+	mov	esi,DWORD [32+ebp]
+	mov	edi,DWORD [64+ebp]
+	mov	esi,DWORD [96+ebp]
+align	16
+L$006loop:
+	mov	esi,eax
+	and	esi,255
+	movzx	esi,BYTE [esi*1+ebp-128]
+	movzx	edi,dh
+	movzx	edi,BYTE [edi*1+ebp-128]
+	shl	edi,8
+	xor	esi,edi
+	mov	edi,ecx
+	shr	edi,16
+	and	edi,255
+	movzx	edi,BYTE [edi*1+ebp-128]
+	shl	edi,16
+	xor	esi,edi
+	mov	edi,ebx
+	shr	edi,24
+	movzx	edi,BYTE [edi*1+ebp-128]
+	shl	edi,24
+	xor	esi,edi
+	mov	DWORD [4+esp],esi
+	mov	esi,ebx
+	and	esi,255
+	movzx	esi,BYTE [esi*1+ebp-128]
+	movzx	edi,ah
+	movzx	edi,BYTE [edi*1+ebp-128]
+	shl	edi,8
+	xor	esi,edi
+	mov	edi,edx
+	shr	edi,16
+	and	edi,255
+	movzx	edi,BYTE [edi*1+ebp-128]
+	shl	edi,16
+	xor	esi,edi
+	mov	edi,ecx
+	shr	edi,24
+	movzx	edi,BYTE [edi*1+ebp-128]
+	shl	edi,24
+	xor	esi,edi
+	mov	DWORD [8+esp],esi
+	mov	esi,ecx
+	and	esi,255
+	movzx	esi,BYTE [esi*1+ebp-128]
+	movzx	edi,bh
+	movzx	edi,BYTE [edi*1+ebp-128]
+	shl	edi,8
+	xor	esi,edi
+	mov	edi,eax
+	shr	edi,16
+	and	edi,255
+	movzx	edi,BYTE [edi*1+ebp-128]
+	shl	edi,16
+	xor	esi,edi
+	mov	edi,edx
+	shr	edi,24
+	movzx	edi,BYTE [edi*1+ebp-128]
+	shl	edi,24
+	xor	esi,edi
+	and	edx,255
+	movzx	edx,BYTE [edx*1+ebp-128]
+	movzx	ecx,ch
+	movzx	ecx,BYTE [ecx*1+ebp-128]
+	shl	ecx,8
+	xor	edx,ecx
+	mov	ecx,esi
+	shr	ebx,16
+	and	ebx,255
+	movzx	ebx,BYTE [ebx*1+ebp-128]
+	shl	ebx,16
+	xor	edx,ebx
+	shr	eax,24
+	movzx	eax,BYTE [eax*1+ebp-128]
+	shl	eax,24
+	xor	edx,eax
+	mov	edi,2155905152
+	and	edi,ecx
+	mov	esi,edi
+	shr	edi,7
+	lea	eax,[ecx*1+ecx]
+	sub	esi,edi
+	and	eax,4278124286
+	and	esi,454761243
+	xor	eax,esi
+	mov	edi,2155905152
+	and	edi,eax
+	mov	esi,edi
+	shr	edi,7
+	lea	ebx,[eax*1+eax]
+	sub	esi,edi
+	and	ebx,4278124286
+	and	esi,454761243
+	xor	eax,ecx
+	xor	ebx,esi
+	mov	edi,2155905152
+	and	edi,ebx
+	mov	esi,edi
+	shr	edi,7
+	lea	ebp,[ebx*1+ebx]
+	sub	esi,edi
+	and	ebp,4278124286
+	and	esi,454761243
+	xor	ebx,ecx
+	rol	ecx,8
+	xor	ebp,esi
+	xor	ecx,eax
+	xor	eax,ebp
+	xor	ecx,ebx
+	xor	ebx,ebp
+	rol	eax,24
+	xor	ecx,ebp
+	rol	ebx,16
+	xor	ecx,eax
+	rol	ebp,8
+	xor	ecx,ebx
+	mov	eax,DWORD [4+esp]
+	xor	ecx,ebp
+	mov	DWORD [12+esp],ecx
+	mov	edi,2155905152
+	and	edi,edx
+	mov	esi,edi
+	shr	edi,7
+	lea	ebx,[edx*1+edx]
+	sub	esi,edi
+	and	ebx,4278124286
+	and	esi,454761243
+	xor	ebx,esi
+	mov	edi,2155905152
+	and	edi,ebx
+	mov	esi,edi
+	shr	edi,7
+	lea	ecx,[ebx*1+ebx]
+	sub	esi,edi
+	and	ecx,4278124286
+	and	esi,454761243
+	xor	ebx,edx
+	xor	ecx,esi
+	mov	edi,2155905152
+	and	edi,ecx
+	mov	esi,edi
+	shr	edi,7
+	lea	ebp,[ecx*1+ecx]
+	sub	esi,edi
+	and	ebp,4278124286
+	and	esi,454761243
+	xor	ecx,edx
+	rol	edx,8
+	xor	ebp,esi
+	xor	edx,ebx
+	xor	ebx,ebp
+	xor	edx,ecx
+	xor	ecx,ebp
+	rol	ebx,24
+	xor	edx,ebp
+	rol	ecx,16
+	xor	edx,ebx
+	rol	ebp,8
+	xor	edx,ecx
+	mov	ebx,DWORD [8+esp]
+	xor	edx,ebp
+	mov	DWORD [16+esp],edx
+	mov	edi,2155905152
+	and	edi,eax
+	mov	esi,edi
+	shr	edi,7
+	lea	ecx,[eax*1+eax]
+	sub	esi,edi
+	and	ecx,4278124286
+	and	esi,454761243
+	xor	ecx,esi
+	mov	edi,2155905152
+	and	edi,ecx
+	mov	esi,edi
+	shr	edi,7
+	lea	edx,[ecx*1+ecx]
+	sub	esi,edi
+	and	edx,4278124286
+	and	esi,454761243
+	xor	ecx,eax
+	xor	edx,esi
+	mov	edi,2155905152
+	and	edi,edx
+	mov	esi,edi
+	shr	edi,7
+	lea	ebp,[edx*1+edx]
+	sub	esi,edi
+	and	ebp,4278124286
+	and	esi,454761243
+	xor	edx,eax
+	rol	eax,8
+	xor	ebp,esi
+	xor	eax,ecx
+	xor	ecx,ebp
+	xor	eax,edx
+	xor	edx,ebp
+	rol	ecx,24
+	xor	eax,ebp
+	rol	edx,16
+	xor	eax,ecx
+	rol	ebp,8
+	xor	eax,edx
+	xor	eax,ebp
+	mov	edi,2155905152
+	and	edi,ebx
+	mov	esi,edi
+	shr	edi,7
+	lea	ecx,[ebx*1+ebx]
+	sub	esi,edi
+	and	ecx,4278124286
+	and	esi,454761243
+	xor	ecx,esi
+	mov	edi,2155905152
+	and	edi,ecx
+	mov	esi,edi
+	shr	edi,7
+	lea	edx,[ecx*1+ecx]
+	sub	esi,edi
+	and	edx,4278124286
+	and	esi,454761243
+	xor	ecx,ebx
+	xor	edx,esi
+	mov	edi,2155905152
+	and	edi,edx
+	mov	esi,edi
+	shr	edi,7
+	lea	ebp,[edx*1+edx]
+	sub	esi,edi
+	and	ebp,4278124286
+	and	esi,454761243
+	xor	edx,ebx
+	rol	ebx,8
+	xor	ebp,esi
+	xor	ebx,ecx
+	xor	ecx,ebp
+	xor	ebx,edx
+	xor	edx,ebp
+	rol	ecx,24
+	xor	ebx,ebp
+	rol	edx,16
+	xor	ebx,ecx
+	rol	ebp,8
+	xor	ebx,edx
+	mov	ecx,DWORD [12+esp]
+	xor	ebx,ebp
+	mov	edx,DWORD [16+esp]
+	mov	edi,DWORD [20+esp]
+	mov	ebp,DWORD [28+esp]
+	add	edi,16
+	xor	eax,DWORD [edi]
+	xor	ebx,DWORD [4+edi]
+	xor	ecx,DWORD [8+edi]
+	xor	edx,DWORD [12+edi]
+	cmp	edi,DWORD [24+esp]
+	mov	DWORD [20+esp],edi
+	jb	NEAR L$006loop
+	mov	esi,eax
+	and	esi,255
+	movzx	esi,BYTE [esi*1+ebp-128]
+	movzx	edi,dh
+	movzx	edi,BYTE [edi*1+ebp-128]
+	shl	edi,8
+	xor	esi,edi
+	mov	edi,ecx
+	shr	edi,16
+	and	edi,255
+	movzx	edi,BYTE [edi*1+ebp-128]
+	shl	edi,16
+	xor	esi,edi
+	mov	edi,ebx
+	shr	edi,24
+	movzx	edi,BYTE [edi*1+ebp-128]
+	shl	edi,24
+	xor	esi,edi
+	mov	DWORD [4+esp],esi
+	mov	esi,ebx
+	and	esi,255
+	movzx	esi,BYTE [esi*1+ebp-128]
+	movzx	edi,ah
+	movzx	edi,BYTE [edi*1+ebp-128]
+	shl	edi,8
+	xor	esi,edi
+	mov	edi,edx
+	shr	edi,16
+	and	edi,255
+	movzx	edi,BYTE [edi*1+ebp-128]
+	shl	edi,16
+	xor	esi,edi
+	mov	edi,ecx
+	shr	edi,24
+	movzx	edi,BYTE [edi*1+ebp-128]
+	shl	edi,24
+	xor	esi,edi
+	mov	DWORD [8+esp],esi
+	mov	esi,ecx
+	and	esi,255
+	movzx	esi,BYTE [esi*1+ebp-128]
+	movzx	edi,bh
+	movzx	edi,BYTE [edi*1+ebp-128]
+	shl	edi,8
+	xor	esi,edi
+	mov	edi,eax
+	shr	edi,16
+	and	edi,255
+	movzx	edi,BYTE [edi*1+ebp-128]
+	shl	edi,16
+	xor	esi,edi
+	mov	edi,edx
+	shr	edi,24
+	movzx	edi,BYTE [edi*1+ebp-128]
+	shl	edi,24
+	xor	esi,edi
+	mov	edi,DWORD [20+esp]
+	and	edx,255
+	movzx	edx,BYTE [edx*1+ebp-128]
+	movzx	ecx,ch
+	movzx	ecx,BYTE [ecx*1+ebp-128]
+	shl	ecx,8
+	xor	edx,ecx
+	mov	ecx,esi
+	shr	ebx,16
+	and	ebx,255
+	movzx	ebx,BYTE [ebx*1+ebp-128]
+	shl	ebx,16
+	xor	edx,ebx
+	mov	ebx,DWORD [8+esp]
+	shr	eax,24
+	movzx	eax,BYTE [eax*1+ebp-128]
+	shl	eax,24
+	xor	edx,eax
+	mov	eax,DWORD [4+esp]
+	xor	eax,DWORD [16+edi]
+	xor	ebx,DWORD [20+edi]
+	xor	ecx,DWORD [24+edi]
+	xor	edx,DWORD [28+edi]
+	ret
+align	16
+__sse_AES_decrypt_compact:
+	pxor	mm0,[edi]
+	pxor	mm4,[8+edi]
+	mov	esi,DWORD [240+edi]
+	lea	esi,[esi*1+esi-2]
+	lea	esi,[esi*8+edi]
+	mov	DWORD [24+esp],esi
+	mov	eax,454761243
+	mov	DWORD [8+esp],eax
+	mov	DWORD [12+esp],eax
+	mov	eax,DWORD [ebp-128]
+	mov	ebx,DWORD [ebp-96]
+	mov	ecx,DWORD [ebp-64]
+	mov	edx,DWORD [ebp-32]
+	mov	eax,DWORD [ebp]
+	mov	ebx,DWORD [32+ebp]
+	mov	ecx,DWORD [64+ebp]
+	mov	edx,DWORD [96+ebp]
+align	16
+L$007loop:
+	pshufw	mm1,mm0,12
+	pshufw	mm5,mm4,9
+	movd	eax,mm1
+	movd	ebx,mm5
+	mov	DWORD [20+esp],edi
+	movzx	esi,al
+	movzx	edx,ah
+	pshufw	mm2,mm0,6
+	movzx	ecx,BYTE [esi*1+ebp-128]
+	movzx	edi,bl
+	movzx	edx,BYTE [edx*1+ebp-128]
+	shr	eax,16
+	shl	edx,8
+	movzx	esi,BYTE [edi*1+ebp-128]
+	movzx	edi,bh
+	shl	esi,16
+	pshufw	mm6,mm4,3
+	or	ecx,esi
+	movzx	esi,BYTE [edi*1+ebp-128]
+	movzx	edi,ah
+	shl	esi,24
+	shr	ebx,16
+	or	edx,esi
+	movzx	esi,BYTE [edi*1+ebp-128]
+	movzx	edi,bh
+	shl	esi,24
+	or	ecx,esi
+	movzx	esi,BYTE [edi*1+ebp-128]
+	movzx	edi,al
+	shl	esi,8
+	movd	eax,mm2
+	or	ecx,esi
+	movzx	esi,BYTE [edi*1+ebp-128]
+	movzx	edi,bl
+	shl	esi,16
+	movd	ebx,mm6
+	movd	mm0,ecx
+	movzx	ecx,BYTE [edi*1+ebp-128]
+	movzx	edi,al
+	or	ecx,esi
+	movzx	esi,BYTE [edi*1+ebp-128]
+	movzx	edi,bl
+	or	edx,esi
+	movzx	esi,BYTE [edi*1+ebp-128]
+	movzx	edi,ah
+	shl	esi,16
+	shr	eax,16
+	or	edx,esi
+	movzx	esi,BYTE [edi*1+ebp-128]
+	movzx	edi,bh
+	shr	ebx,16
+	shl	esi,8
+	movd	mm1,edx
+	movzx	edx,BYTE [edi*1+ebp-128]
+	movzx	edi,bh
+	shl	edx,24
+	and	ebx,255
+	or	edx,esi
+	punpckldq	mm0,mm1
+	movzx	esi,BYTE [edi*1+ebp-128]
+	movzx	edi,al
+	shl	esi,8
+	movzx	eax,ah
+	movzx	ebx,BYTE [ebx*1+ebp-128]
+	or	ecx,esi
+	movzx	esi,BYTE [edi*1+ebp-128]
+	or	edx,ebx
+	shl	esi,16
+	movzx	eax,BYTE [eax*1+ebp-128]
+	or	edx,esi
+	shl	eax,24
+	or	ecx,eax
+	mov	edi,DWORD [20+esp]
+	movd	mm4,edx
+	movd	mm5,ecx
+	punpckldq	mm4,mm5
+	add	edi,16
+	cmp	edi,DWORD [24+esp]
+	ja	NEAR L$008out
+	movq	mm3,mm0
+	movq	mm7,mm4
+	pshufw	mm2,mm0,228
+	pshufw	mm6,mm4,228
+	movq	mm1,mm0
+	movq	mm5,mm4
+	pshufw	mm0,mm0,177
+	pshufw	mm4,mm4,177
+	pslld	mm2,8
+	pslld	mm6,8
+	psrld	mm3,8
+	psrld	mm7,8
+	pxor	mm0,mm2
+	pxor	mm4,mm6
+	pxor	mm0,mm3
+	pxor	mm4,mm7
+	pslld	mm2,16
+	pslld	mm6,16
+	psrld	mm3,16
+	psrld	mm7,16
+	pxor	mm0,mm2
+	pxor	mm4,mm6
+	pxor	mm0,mm3
+	pxor	mm4,mm7
+	movq	mm3,[8+esp]
+	pxor	mm2,mm2
+	pxor	mm6,mm6
+	pcmpgtb	mm2,mm1
+	pcmpgtb	mm6,mm5
+	pand	mm2,mm3
+	pand	mm6,mm3
+	paddb	mm1,mm1
+	paddb	mm5,mm5
+	pxor	mm1,mm2
+	pxor	mm5,mm6
+	movq	mm3,mm1
+	movq	mm7,mm5
+	movq	mm2,mm1
+	movq	mm6,mm5
+	pxor	mm0,mm1
+	pxor	mm4,mm5
+	pslld	mm3,24
+	pslld	mm7,24
+	psrld	mm2,8
+	psrld	mm6,8
+	pxor	mm0,mm3
+	pxor	mm4,mm7
+	pxor	mm0,mm2
+	pxor	mm4,mm6
+	movq	mm2,[8+esp]
+	pxor	mm3,mm3
+	pxor	mm7,mm7
+	pcmpgtb	mm3,mm1
+	pcmpgtb	mm7,mm5
+	pand	mm3,mm2
+	pand	mm7,mm2
+	paddb	mm1,mm1
+	paddb	mm5,mm5
+	pxor	mm1,mm3
+	pxor	mm5,mm7
+	pshufw	mm3,mm1,177
+	pshufw	mm7,mm5,177
+	pxor	mm0,mm1
+	pxor	mm4,mm5
+	pxor	mm0,mm3
+	pxor	mm4,mm7
+	pxor	mm3,mm3
+	pxor	mm7,mm7
+	pcmpgtb	mm3,mm1
+	pcmpgtb	mm7,mm5
+	pand	mm3,mm2
+	pand	mm7,mm2
+	paddb	mm1,mm1
+	paddb	mm5,mm5
+	pxor	mm1,mm3
+	pxor	mm5,mm7
+	pxor	mm0,mm1
+	pxor	mm4,mm5
+	movq	mm3,mm1
+	movq	mm7,mm5
+	pshufw	mm2,mm1,177
+	pshufw	mm6,mm5,177
+	pxor	mm0,mm2
+	pxor	mm4,mm6
+	pslld	mm1,8
+	pslld	mm5,8
+	psrld	mm3,8
+	psrld	mm7,8
+	movq	mm2,[edi]
+	movq	mm6,[8+edi]
+	pxor	mm0,mm1
+	pxor	mm4,mm5
+	pxor	mm0,mm3
+	pxor	mm4,mm7
+	mov	eax,DWORD [ebp-128]
+	pslld	mm1,16
+	pslld	mm5,16
+	mov	ebx,DWORD [ebp-64]
+	psrld	mm3,16
+	psrld	mm7,16
+	mov	ecx,DWORD [ebp]
+	pxor	mm0,mm1
+	pxor	mm4,mm5
+	mov	edx,DWORD [64+ebp]
+	pxor	mm0,mm3
+	pxor	mm4,mm7
+	pxor	mm0,mm2
+	pxor	mm4,mm6
+	jmp	NEAR L$007loop
+align	16
+L$008out:
+	pxor	mm0,[edi]
+	pxor	mm4,[8+edi]
+	ret
+align	16
+__x86_AES_decrypt:
+	mov	DWORD [20+esp],edi
+	xor	eax,DWORD [edi]
+	xor	ebx,DWORD [4+edi]
+	xor	ecx,DWORD [8+edi]
+	xor	edx,DWORD [12+edi]
+	mov	esi,DWORD [240+edi]
+	lea	esi,[esi*1+esi-2]
+	lea	esi,[esi*8+edi]
+	mov	DWORD [24+esp],esi
+align	16
+L$009loop:
+	mov	esi,eax
+	and	esi,255
+	mov	esi,DWORD [esi*8+ebp]
+	movzx	edi,dh
+	xor	esi,DWORD [3+edi*8+ebp]
+	mov	edi,ecx
+	shr	edi,16
+	and	edi,255
+	xor	esi,DWORD [2+edi*8+ebp]
+	mov	edi,ebx
+	shr	edi,24
+	xor	esi,DWORD [1+edi*8+ebp]
+	mov	DWORD [4+esp],esi
+	mov	esi,ebx
+	and	esi,255
+	mov	esi,DWORD [esi*8+ebp]
+	movzx	edi,ah
+	xor	esi,DWORD [3+edi*8+ebp]
+	mov	edi,edx
+	shr	edi,16
+	and	edi,255
+	xor	esi,DWORD [2+edi*8+ebp]
+	mov	edi,ecx
+	shr	edi,24
+	xor	esi,DWORD [1+edi*8+ebp]
+	mov	DWORD [8+esp],esi
+	mov	esi,ecx
+	and	esi,255
+	mov	esi,DWORD [esi*8+ebp]
+	movzx	edi,bh
+	xor	esi,DWORD [3+edi*8+ebp]
+	mov	edi,eax
+	shr	edi,16
+	and	edi,255
+	xor	esi,DWORD [2+edi*8+ebp]
+	mov	edi,edx
+	shr	edi,24
+	xor	esi,DWORD [1+edi*8+ebp]
+	mov	edi,DWORD [20+esp]
+	and	edx,255
+	mov	edx,DWORD [edx*8+ebp]
+	movzx	ecx,ch
+	xor	edx,DWORD [3+ecx*8+ebp]
+	mov	ecx,esi
+	shr	ebx,16
+	and	ebx,255
+	xor	edx,DWORD [2+ebx*8+ebp]
+	mov	ebx,DWORD [8+esp]
+	shr	eax,24
+	xor	edx,DWORD [1+eax*8+ebp]
+	mov	eax,DWORD [4+esp]
+	add	edi,16
+	xor	eax,DWORD [edi]
+	xor	ebx,DWORD [4+edi]
+	xor	ecx,DWORD [8+edi]
+	xor	edx,DWORD [12+edi]
+	cmp	edi,DWORD [24+esp]
+	mov	DWORD [20+esp],edi
+	jb	NEAR L$009loop
+	lea	ebp,[2176+ebp]
+	mov	edi,DWORD [ebp-128]
+	mov	esi,DWORD [ebp-96]
+	mov	edi,DWORD [ebp-64]
+	mov	esi,DWORD [ebp-32]
+	mov	edi,DWORD [ebp]
+	mov	esi,DWORD [32+ebp]
+	mov	edi,DWORD [64+ebp]
+	mov	esi,DWORD [96+ebp]
+	lea	ebp,[ebp-128]
+	mov	esi,eax
+	and	esi,255
+	movzx	esi,BYTE [esi*1+ebp]
+	movzx	edi,dh
+	movzx	edi,BYTE [edi*1+ebp]
+	shl	edi,8
+	xor	esi,edi
+	mov	edi,ecx
+	shr	edi,16
+	and	edi,255
+	movzx	edi,BYTE [edi*1+ebp]
+	shl	edi,16
+	xor	esi,edi
+	mov	edi,ebx
+	shr	edi,24
+	movzx	edi,BYTE [edi*1+ebp]
+	shl	edi,24
+	xor	esi,edi
+	mov	DWORD [4+esp],esi
+	mov	esi,ebx
+	and	esi,255
+	movzx	esi,BYTE [esi*1+ebp]
+	movzx	edi,ah
+	movzx	edi,BYTE [edi*1+ebp]
+	shl	edi,8
+	xor	esi,edi
+	mov	edi,edx
+	shr	edi,16
+	and	edi,255
+	movzx	edi,BYTE [edi*1+ebp]
+	shl	edi,16
+	xor	esi,edi
+	mov	edi,ecx
+	shr	edi,24
+	movzx	edi,BYTE [edi*1+ebp]
+	shl	edi,24
+	xor	esi,edi
+	mov	DWORD [8+esp],esi
+	mov	esi,ecx
+	and	esi,255
+	movzx	esi,BYTE [esi*1+ebp]
+	movzx	edi,bh
+	movzx	edi,BYTE [edi*1+ebp]
+	shl	edi,8
+	xor	esi,edi
+	mov	edi,eax
+	shr	edi,16
+	and	edi,255
+	movzx	edi,BYTE [edi*1+ebp]
+	shl	edi,16
+	xor	esi,edi
+	mov	edi,edx
+	shr	edi,24
+	movzx	edi,BYTE [edi*1+ebp]
+	shl	edi,24
+	xor	esi,edi
+	mov	edi,DWORD [20+esp]
+	and	edx,255
+	movzx	edx,BYTE [edx*1+ebp]
+	movzx	ecx,ch
+	movzx	ecx,BYTE [ecx*1+ebp]
+	shl	ecx,8
+	xor	edx,ecx
+	mov	ecx,esi
+	shr	ebx,16
+	and	ebx,255
+	movzx	ebx,BYTE [ebx*1+ebp]
+	shl	ebx,16
+	xor	edx,ebx
+	mov	ebx,DWORD [8+esp]
+	shr	eax,24
+	movzx	eax,BYTE [eax*1+ebp]
+	shl	eax,24
+	xor	edx,eax
+	mov	eax,DWORD [4+esp]
+	lea	ebp,[ebp-2048]
+	add	edi,16
+	xor	eax,DWORD [edi]
+	xor	ebx,DWORD [4+edi]
+	xor	ecx,DWORD [8+edi]
+	xor	edx,DWORD [12+edi]
+	ret
+align	64
+L$AES_Td:
+dd	1353184337,1353184337
+dd	1399144830,1399144830
+dd	3282310938,3282310938
+dd	2522752826,2522752826
+dd	3412831035,3412831035
+dd	4047871263,4047871263
+dd	2874735276,2874735276
+dd	2466505547,2466505547
+dd	1442459680,1442459680
+dd	4134368941,4134368941
+dd	2440481928,2440481928
+dd	625738485,625738485
+dd	4242007375,4242007375
+dd	3620416197,3620416197
+dd	2151953702,2151953702
+dd	2409849525,2409849525
+dd	1230680542,1230680542
+dd	1729870373,1729870373
+dd	2551114309,2551114309
+dd	3787521629,3787521629
+dd	41234371,41234371
+dd	317738113,317738113
+dd	2744600205,2744600205
+dd	3338261355,3338261355
+dd	3881799427,3881799427
+dd	2510066197,2510066197
+dd	3950669247,3950669247
+dd	3663286933,3663286933
+dd	763608788,763608788
+dd	3542185048,3542185048
+dd	694804553,694804553
+dd	1154009486,1154009486
+dd	1787413109,1787413109
+dd	2021232372,2021232372
+dd	1799248025,1799248025
+dd	3715217703,3715217703
+dd	3058688446,3058688446
+dd	397248752,397248752
+dd	1722556617,1722556617
+dd	3023752829,3023752829
+dd	407560035,407560035
+dd	2184256229,2184256229
+dd	1613975959,1613975959
+dd	1165972322,1165972322
+dd	3765920945,3765920945
+dd	2226023355,2226023355
+dd	480281086,480281086
+dd	2485848313,2485848313
+dd	1483229296,1483229296
+dd	436028815,436028815
+dd	2272059028,2272059028
+dd	3086515026,3086515026
+dd	601060267,601060267
+dd	3791801202,3791801202
+dd	1468997603,1468997603
+dd	715871590,715871590
+dd	120122290,120122290
+dd	63092015,63092015
+dd	2591802758,2591802758
+dd	2768779219,2768779219
+dd	4068943920,4068943920
+dd	2997206819,2997206819
+dd	3127509762,3127509762
+dd	1552029421,1552029421
+dd	723308426,723308426
+dd	2461301159,2461301159
+dd	4042393587,4042393587
+dd	2715969870,2715969870
+dd	3455375973,3455375973
+dd	3586000134,3586000134
+dd	526529745,526529745
+dd	2331944644,2331944644
+dd	2639474228,2639474228
+dd	2689987490,2689987490
+dd	853641733,853641733
+dd	1978398372,1978398372
+dd	971801355,971801355
+dd	2867814464,2867814464
+dd	111112542,111112542
+dd	1360031421,1360031421
+dd	4186579262,4186579262
+dd	1023860118,1023860118
+dd	2919579357,2919579357
+dd	1186850381,1186850381
+dd	3045938321,3045938321
+dd	90031217,90031217
+dd	1876166148,1876166148
+dd	4279586912,4279586912
+dd	620468249,620468249
+dd	2548678102,2548678102
+dd	3426959497,3426959497
+dd	2006899047,2006899047
+dd	3175278768,3175278768
+dd	2290845959,2290845959
+dd	945494503,945494503
+dd	3689859193,3689859193
+dd	1191869601,1191869601
+dd	3910091388,3910091388
+dd	3374220536,3374220536
+dd	0,0
+dd	2206629897,2206629897
+dd	1223502642,1223502642
+dd	2893025566,2893025566
+dd	1316117100,1316117100
+dd	4227796733,4227796733
+dd	1446544655,1446544655
+dd	517320253,517320253
+dd	658058550,658058550
+dd	1691946762,1691946762
+dd	564550760,564550760
+dd	3511966619,3511966619
+dd	976107044,976107044
+dd	2976320012,2976320012
+dd	266819475,266819475
+dd	3533106868,3533106868
+dd	2660342555,2660342555
+dd	1338359936,1338359936
+dd	2720062561,2720062561
+dd	1766553434,1766553434
+dd	370807324,370807324
+dd	179999714,179999714
+dd	3844776128,3844776128
+dd	1138762300,1138762300
+dd	488053522,488053522
+dd	185403662,185403662
+dd	2915535858,2915535858
+dd	3114841645,3114841645
+dd	3366526484,3366526484
+dd	2233069911,2233069911
+dd	1275557295,1275557295
+dd	3151862254,3151862254
+dd	4250959779,4250959779
+dd	2670068215,2670068215
+dd	3170202204,3170202204
+dd	3309004356,3309004356
+dd	880737115,880737115
+dd	1982415755,1982415755
+dd	3703972811,3703972811
+dd	1761406390,1761406390
+dd	1676797112,1676797112
+dd	3403428311,3403428311
+dd	277177154,277177154
+dd	1076008723,1076008723
+dd	538035844,538035844
+dd	2099530373,2099530373
+dd	4164795346,4164795346
+dd	288553390,288553390
+dd	1839278535,1839278535
+dd	1261411869,1261411869
+dd	4080055004,4080055004
+dd	3964831245,3964831245
+dd	3504587127,3504587127
+dd	1813426987,1813426987
+dd	2579067049,2579067049
+dd	4199060497,4199060497
+dd	577038663,577038663
+dd	3297574056,3297574056
+dd	440397984,440397984
+dd	3626794326,3626794326
+dd	4019204898,4019204898
+dd	3343796615,3343796615
+dd	3251714265,3251714265
+dd	4272081548,4272081548
+dd	906744984,906744984
+dd	3481400742,3481400742
+dd	685669029,685669029
+dd	646887386,646887386
+dd	2764025151,2764025151
+dd	3835509292,3835509292
+dd	227702864,227702864
+dd	2613862250,2613862250
+dd	1648787028,1648787028
+dd	3256061430,3256061430
+dd	3904428176,3904428176
+dd	1593260334,1593260334
+dd	4121936770,4121936770
+dd	3196083615,3196083615
+dd	2090061929,2090061929
+dd	2838353263,2838353263
+dd	3004310991,3004310991
+dd	999926984,999926984
+dd	2809993232,2809993232
+dd	1852021992,1852021992
+dd	2075868123,2075868123
+dd	158869197,158869197
+dd	4095236462,4095236462
+dd	28809964,28809964
+dd	2828685187,2828685187
+dd	1701746150,1701746150
+dd	2129067946,2129067946
+dd	147831841,147831841
+dd	3873969647,3873969647
+dd	3650873274,3650873274
+dd	3459673930,3459673930
+dd	3557400554,3557400554
+dd	3598495785,3598495785
+dd	2947720241,2947720241
+dd	824393514,824393514
+dd	815048134,815048134
+dd	3227951669,3227951669
+dd	935087732,935087732
+dd	2798289660,2798289660
+dd	2966458592,2966458592
+dd	366520115,366520115
+dd	1251476721,1251476721
+dd	4158319681,4158319681
+dd	240176511,240176511
+dd	804688151,804688151
+dd	2379631990,2379631990
+dd	1303441219,1303441219
+dd	1414376140,1414376140
+dd	3741619940,3741619940
+dd	3820343710,3820343710
+dd	461924940,461924940
+dd	3089050817,3089050817
+dd	2136040774,2136040774
+dd	82468509,82468509
+dd	1563790337,1563790337
+dd	1937016826,1937016826
+dd	776014843,776014843
+dd	1511876531,1511876531
+dd	1389550482,1389550482
+dd	861278441,861278441
+dd	323475053,323475053
+dd	2355222426,2355222426
+dd	2047648055,2047648055
+dd	2383738969,2383738969
+dd	2302415851,2302415851
+dd	3995576782,3995576782
+dd	902390199,902390199
+dd	3991215329,3991215329
+dd	1018251130,1018251130
+dd	1507840668,1507840668
+dd	1064563285,1064563285
+dd	2043548696,2043548696
+dd	3208103795,3208103795
+dd	3939366739,3939366739
+dd	1537932639,1537932639
+dd	342834655,342834655
+dd	2262516856,2262516856
+dd	2180231114,2180231114
+dd	1053059257,1053059257
+dd	741614648,741614648
+dd	1598071746,1598071746
+dd	1925389590,1925389590
+dd	203809468,203809468
+dd	2336832552,2336832552
+dd	1100287487,1100287487
+dd	1895934009,1895934009
+dd	3736275976,3736275976
+dd	2632234200,2632234200
+dd	2428589668,2428589668
+dd	1636092795,1636092795
+dd	1890988757,1890988757
+dd	1952214088,1952214088
+dd	1113045200,1113045200
+db	82,9,106,213,48,54,165,56
+db	191,64,163,158,129,243,215,251
+db	124,227,57,130,155,47,255,135
+db	52,142,67,68,196,222,233,203
+db	84,123,148,50,166,194,35,61
+db	238,76,149,11,66,250,195,78
+db	8,46,161,102,40,217,36,178
+db	118,91,162,73,109,139,209,37
+db	114,248,246,100,134,104,152,22
+db	212,164,92,204,93,101,182,146
+db	108,112,72,80,253,237,185,218
+db	94,21,70,87,167,141,157,132
+db	144,216,171,0,140,188,211,10
+db	247,228,88,5,184,179,69,6
+db	208,44,30,143,202,63,15,2
+db	193,175,189,3,1,19,138,107
+db	58,145,17,65,79,103,220,234
+db	151,242,207,206,240,180,230,115
+db	150,172,116,34,231,173,53,133
+db	226,249,55,232,28,117,223,110
+db	71,241,26,113,29,41,197,137
+db	111,183,98,14,170,24,190,27
+db	252,86,62,75,198,210,121,32
+db	154,219,192,254,120,205,90,244
+db	31,221,168,51,136,7,199,49
+db	177,18,16,89,39,128,236,95
+db	96,81,127,169,25,181,74,13
+db	45,229,122,159,147,201,156,239
+db	160,224,59,77,174,42,245,176
+db	200,235,187,60,131,83,153,97
+db	23,43,4,126,186,119,214,38
+db	225,105,20,99,85,33,12,125
+db	82,9,106,213,48,54,165,56
+db	191,64,163,158,129,243,215,251
+db	124,227,57,130,155,47,255,135
+db	52,142,67,68,196,222,233,203
+db	84,123,148,50,166,194,35,61
+db	238,76,149,11,66,250,195,78
+db	8,46,161,102,40,217,36,178
+db	118,91,162,73,109,139,209,37
+db	114,248,246,100,134,104,152,22
+db	212,164,92,204,93,101,182,146
+db	108,112,72,80,253,237,185,218
+db	94,21,70,87,167,141,157,132
+db	144,216,171,0,140,188,211,10
+db	247,228,88,5,184,179,69,6
+db	208,44,30,143,202,63,15,2
+db	193,175,189,3,1,19,138,107
+db	58,145,17,65,79,103,220,234
+db	151,242,207,206,240,180,230,115
+db	150,172,116,34,231,173,53,133
+db	226,249,55,232,28,117,223,110
+db	71,241,26,113,29,41,197,137
+db	111,183,98,14,170,24,190,27
+db	252,86,62,75,198,210,121,32
+db	154,219,192,254,120,205,90,244
+db	31,221,168,51,136,7,199,49
+db	177,18,16,89,39,128,236,95
+db	96,81,127,169,25,181,74,13
+db	45,229,122,159,147,201,156,239
+db	160,224,59,77,174,42,245,176
+db	200,235,187,60,131,83,153,97
+db	23,43,4,126,186,119,214,38
+db	225,105,20,99,85,33,12,125
+db	82,9,106,213,48,54,165,56
+db	191,64,163,158,129,243,215,251
+db	124,227,57,130,155,47,255,135
+db	52,142,67,68,196,222,233,203
+db	84,123,148,50,166,194,35,61
+db	238,76,149,11,66,250,195,78
+db	8,46,161,102,40,217,36,178
+db	118,91,162,73,109,139,209,37
+db	114,248,246,100,134,104,152,22
+db	212,164,92,204,93,101,182,146
+db	108,112,72,80,253,237,185,218
+db	94,21,70,87,167,141,157,132
+db	144,216,171,0,140,188,211,10
+db	247,228,88,5,184,179,69,6
+db	208,44,30,143,202,63,15,2
+db	193,175,189,3,1,19,138,107
+db	58,145,17,65,79,103,220,234
+db	151,242,207,206,240,180,230,115
+db	150,172,116,34,231,173,53,133
+db	226,249,55,232,28,117,223,110
+db	71,241,26,113,29,41,197,137
+db	111,183,98,14,170,24,190,27
+db	252,86,62,75,198,210,121,32
+db	154,219,192,254,120,205,90,244
+db	31,221,168,51,136,7,199,49
+db	177,18,16,89,39,128,236,95
+db	96,81,127,169,25,181,74,13
+db	45,229,122,159,147,201,156,239
+db	160,224,59,77,174,42,245,176
+db	200,235,187,60,131,83,153,97
+db	23,43,4,126,186,119,214,38
+db	225,105,20,99,85,33,12,125
+db	82,9,106,213,48,54,165,56
+db	191,64,163,158,129,243,215,251
+db	124,227,57,130,155,47,255,135
+db	52,142,67,68,196,222,233,203
+db	84,123,148,50,166,194,35,61
+db	238,76,149,11,66,250,195,78
+db	8,46,161,102,40,217,36,178
+db	118,91,162,73,109,139,209,37
+db	114,248,246,100,134,104,152,22
+db	212,164,92,204,93,101,182,146
+db	108,112,72,80,253,237,185,218
+db	94,21,70,87,167,141,157,132
+db	144,216,171,0,140,188,211,10
+db	247,228,88,5,184,179,69,6
+db	208,44,30,143,202,63,15,2
+db	193,175,189,3,1,19,138,107
+db	58,145,17,65,79,103,220,234
+db	151,242,207,206,240,180,230,115
+db	150,172,116,34,231,173,53,133
+db	226,249,55,232,28,117,223,110
+db	71,241,26,113,29,41,197,137
+db	111,183,98,14,170,24,190,27
+db	252,86,62,75,198,210,121,32
+db	154,219,192,254,120,205,90,244
+db	31,221,168,51,136,7,199,49
+db	177,18,16,89,39,128,236,95
+db	96,81,127,169,25,181,74,13
+db	45,229,122,159,147,201,156,239
+db	160,224,59,77,174,42,245,176
+db	200,235,187,60,131,83,153,97
+db	23,43,4,126,186,119,214,38
+db	225,105,20,99,85,33,12,125
+global	_asm_AES_decrypt
+align	16
+_asm_AES_decrypt:
+L$_asm_AES_decrypt_begin:
+	push	ebp
+	push	ebx
+	push	esi
+	push	edi
+	mov	esi,DWORD [20+esp]
+	mov	edi,DWORD [28+esp]
+	mov	eax,esp
+	sub	esp,36
+	and	esp,-64
+	lea	ebx,[edi-127]
+	sub	ebx,esp
+	neg	ebx
+	and	ebx,960
+	sub	esp,ebx
+	add	esp,4
+	mov	DWORD [28+esp],eax
+	call	L$010pic_point
+L$010pic_point:
+	pop	ebp
+	lea	eax,[_OPENSSL_ia32cap_P]
+	lea	ebp,[(L$AES_Td-L$010pic_point)+ebp]
+	lea	ebx,[764+esp]
+	sub	ebx,ebp
+	and	ebx,768
+	lea	ebp,[2176+ebx*1+ebp]
+	bt	DWORD [eax],25
+	jnc	NEAR L$011x86
+	movq	mm0,[esi]
+	movq	mm4,[8+esi]
+	call	__sse_AES_decrypt_compact
+	mov	esp,DWORD [28+esp]
+	mov	esi,DWORD [24+esp]
+	movq	[esi],mm0
+	movq	[8+esi],mm4
+	emms
+	pop	edi
+	pop	esi
+	pop	ebx
+	pop	ebp
+	ret
+align	16
+L$011x86:
+	mov	DWORD [24+esp],ebp
+	mov	eax,DWORD [esi]
+	mov	ebx,DWORD [4+esi]
+	mov	ecx,DWORD [8+esi]
+	mov	edx,DWORD [12+esi]
+	call	__x86_AES_decrypt_compact
+	mov	esp,DWORD [28+esp]
+	mov	esi,DWORD [24+esp]
+	mov	DWORD [esi],eax
+	mov	DWORD [4+esi],ebx
+	mov	DWORD [8+esi],ecx
+	mov	DWORD [12+esi],edx
+	pop	edi
+	pop	esi
+	pop	ebx
+	pop	ebp
+	ret
+global	_asm_AES_cbc_encrypt
+align	16
+_asm_AES_cbc_encrypt:
+L$_asm_AES_cbc_encrypt_begin:
+	push	ebp
+	push	ebx
+	push	esi
+	push	edi
+	mov	ecx,DWORD [28+esp]
+	cmp	ecx,0
+	je	NEAR L$012drop_out
+	call	L$013pic_point
+L$013pic_point:
+	pop	ebp
+	lea	eax,[_OPENSSL_ia32cap_P]
+	cmp	DWORD [40+esp],0
+	lea	ebp,[(L$AES_Te-L$013pic_point)+ebp]
+	jne	NEAR L$014picked_te
+	lea	ebp,[(L$AES_Td-L$AES_Te)+ebp]
+L$014picked_te:
+	pushfd
+	cld
+	cmp	ecx,512
+	jb	NEAR L$015slow_way
+	test	ecx,15
+	jnz	NEAR L$015slow_way
+	bt	DWORD [eax],28
+	jc	NEAR L$015slow_way
+	lea	esi,[esp-324]
+	and	esi,-64
+	mov	eax,ebp
+	lea	ebx,[2304+ebp]
+	mov	edx,esi
+	and	eax,4095
+	and	ebx,4095
+	and	edx,4095
+	cmp	edx,ebx
+	jb	NEAR L$016tbl_break_out
+	sub	edx,ebx
+	sub	esi,edx
+	jmp	NEAR L$017tbl_ok
+align	4
+L$016tbl_break_out:
+	sub	edx,eax
+	and	edx,4095
+	add	edx,384
+	sub	esi,edx
+align	4
+L$017tbl_ok:
+	lea	edx,[24+esp]
+	xchg	esp,esi
+	add	esp,4
+	mov	DWORD [24+esp],ebp
+	mov	DWORD [28+esp],esi
+	mov	eax,DWORD [edx]
+	mov	ebx,DWORD [4+edx]
+	mov	edi,DWORD [12+edx]
+	mov	esi,DWORD [16+edx]
+	mov	edx,DWORD [20+edx]
+	mov	DWORD [32+esp],eax
+	mov	DWORD [36+esp],ebx
+	mov	DWORD [40+esp],ecx
+	mov	DWORD [44+esp],edi
+	mov	DWORD [48+esp],esi
+	mov	DWORD [316+esp],0
+	mov	ebx,edi
+	mov	ecx,61
+	sub	ebx,ebp
+	mov	esi,edi
+	and	ebx,4095
+	lea	edi,[76+esp]
+	cmp	ebx,2304
+	jb	NEAR L$018do_copy
+	cmp	ebx,3852
+	jb	NEAR L$019skip_copy
+align	4
+L$018do_copy:
+	mov	DWORD [44+esp],edi
+dd	2784229001
+L$019skip_copy:
+	mov	edi,16
+align	4
+L$020prefetch_tbl:
+	mov	eax,DWORD [ebp]
+	mov	ebx,DWORD [32+ebp]
+	mov	ecx,DWORD [64+ebp]
+	mov	esi,DWORD [96+ebp]
+	lea	ebp,[128+ebp]
+	sub	edi,1
+	jnz	NEAR L$020prefetch_tbl
+	sub	ebp,2048
+	mov	esi,DWORD [32+esp]
+	mov	edi,DWORD [48+esp]
+	cmp	edx,0
+	je	NEAR L$021fast_decrypt
+	mov	eax,DWORD [edi]
+	mov	ebx,DWORD [4+edi]
+align	16
+L$022fast_enc_loop:
+	mov	ecx,DWORD [8+edi]
+	mov	edx,DWORD [12+edi]
+	xor	eax,DWORD [esi]
+	xor	ebx,DWORD [4+esi]
+	xor	ecx,DWORD [8+esi]
+	xor	edx,DWORD [12+esi]
+	mov	edi,DWORD [44+esp]
+	call	__x86_AES_encrypt
+	mov	esi,DWORD [32+esp]
+	mov	edi,DWORD [36+esp]
+	mov	DWORD [edi],eax
+	mov	DWORD [4+edi],ebx
+	mov	DWORD [8+edi],ecx
+	mov	DWORD [12+edi],edx
+	lea	esi,[16+esi]
+	mov	ecx,DWORD [40+esp]
+	mov	DWORD [32+esp],esi
+	lea	edx,[16+edi]
+	mov	DWORD [36+esp],edx
+	sub	ecx,16
+	mov	DWORD [40+esp],ecx
+	jnz	NEAR L$022fast_enc_loop
+	mov	esi,DWORD [48+esp]
+	mov	ecx,DWORD [8+edi]
+	mov	edx,DWORD [12+edi]
+	mov	DWORD [esi],eax
+	mov	DWORD [4+esi],ebx
+	mov	DWORD [8+esi],ecx
+	mov	DWORD [12+esi],edx
+	cmp	DWORD [316+esp],0
+	mov	edi,DWORD [44+esp]
+	je	NEAR L$023skip_ezero
+	mov	ecx,60
+	xor	eax,eax
+align	4
+dd	2884892297
+L$023skip_ezero:
+	mov	esp,DWORD [28+esp]
+	popfd
+L$012drop_out:
+	pop	edi
+	pop	esi
+	pop	ebx
+	pop	ebp
+	ret
+	pushfd
+align	16
+L$021fast_decrypt:
+	cmp	esi,DWORD [36+esp]
+	je	NEAR L$024fast_dec_in_place
+	mov	DWORD [52+esp],edi
+align	4
+align	16
+L$025fast_dec_loop:
+	mov	eax,DWORD [esi]
+	mov	ebx,DWORD [4+esi]
+	mov	ecx,DWORD [8+esi]
+	mov	edx,DWORD [12+esi]
+	mov	edi,DWORD [44+esp]
+	call	__x86_AES_decrypt
+	mov	edi,DWORD [52+esp]
+	mov	esi,DWORD [40+esp]
+	xor	eax,DWORD [edi]
+	xor	ebx,DWORD [4+edi]
+	xor	ecx,DWORD [8+edi]
+	xor	edx,DWORD [12+edi]
+	mov	edi,DWORD [36+esp]
+	mov	esi,DWORD [32+esp]
+	mov	DWORD [edi],eax
+	mov	DWORD [4+edi],ebx
+	mov	DWORD [8+edi],ecx
+	mov	DWORD [12+edi],edx
+	mov	ecx,DWORD [40+esp]
+	mov	DWORD [52+esp],esi
+	lea	esi,[16+esi]
+	mov	DWORD [32+esp],esi
+	lea	edi,[16+edi]
+	mov	DWORD [36+esp],edi
+	sub	ecx,16
+	mov	DWORD [40+esp],ecx
+	jnz	NEAR L$025fast_dec_loop
+	mov	edi,DWORD [52+esp]
+	mov	esi,DWORD [48+esp]
+	mov	eax,DWORD [edi]
+	mov	ebx,DWORD [4+edi]
+	mov	ecx,DWORD [8+edi]
+	mov	edx,DWORD [12+edi]
+	mov	DWORD [esi],eax
+	mov	DWORD [4+esi],ebx
+	mov	DWORD [8+esi],ecx
+	mov	DWORD [12+esi],edx
+	jmp	NEAR L$026fast_dec_out
+align	16
+L$024fast_dec_in_place:
+L$027fast_dec_in_place_loop:
+	mov	eax,DWORD [esi]
+	mov	ebx,DWORD [4+esi]
+	mov	ecx,DWORD [8+esi]
+	mov	edx,DWORD [12+esi]
+	lea	edi,[60+esp]
+	mov	DWORD [edi],eax
+	mov	DWORD [4+edi],ebx
+	mov	DWORD [8+edi],ecx
+	mov	DWORD [12+edi],edx
+	mov	edi,DWORD [44+esp]
+	call	__x86_AES_decrypt
+	mov	edi,DWORD [48+esp]
+	mov	esi,DWORD [36+esp]
+	xor	eax,DWORD [edi]
+	xor	ebx,DWORD [4+edi]
+	xor	ecx,DWORD [8+edi]
+	xor	edx,DWORD [12+edi]
+	mov	DWORD [esi],eax
+	mov	DWORD [4+esi],ebx
+	mov	DWORD [8+esi],ecx
+	mov	DWORD [12+esi],edx
+	lea	esi,[16+esi]
+	mov	DWORD [36+esp],esi
+	lea	esi,[60+esp]
+	mov	eax,DWORD [esi]
+	mov	ebx,DWORD [4+esi]
+	mov	ecx,DWORD [8+esi]
+	mov	edx,DWORD [12+esi]
+	mov	DWORD [edi],eax
+	mov	DWORD [4+edi],ebx
+	mov	DWORD [8+edi],ecx
+	mov	DWORD [12+edi],edx
+	mov	esi,DWORD [32+esp]
+	mov	ecx,DWORD [40+esp]
+	lea	esi,[16+esi]
+	mov	DWORD [32+esp],esi
+	sub	ecx,16
+	mov	DWORD [40+esp],ecx
+	jnz	NEAR L$027fast_dec_in_place_loop
+align	4
+L$026fast_dec_out:
+	cmp	DWORD [316+esp],0
+	mov	edi,DWORD [44+esp]
+	je	NEAR L$028skip_dzero
+	mov	ecx,60
+	xor	eax,eax
+align	4
+dd	2884892297
+L$028skip_dzero:
+	mov	esp,DWORD [28+esp]
+	popfd
+	pop	edi
+	pop	esi
+	pop	ebx
+	pop	ebp
+	ret
+	pushfd
+align	16
+L$015slow_way:
+	mov	eax,DWORD [eax]
+	mov	edi,DWORD [36+esp]
+	lea	esi,[esp-80]
+	and	esi,-64
+	lea	ebx,[edi-143]
+	sub	ebx,esi
+	neg	ebx
+	and	ebx,960
+	sub	esi,ebx
+	lea	ebx,[768+esi]
+	sub	ebx,ebp
+	and	ebx,768
+	lea	ebp,[2176+ebx*1+ebp]
+	lea	edx,[24+esp]
+	xchg	esp,esi
+	add	esp,4
+	mov	DWORD [24+esp],ebp
+	mov	DWORD [28+esp],esi
+	mov	DWORD [52+esp],eax
+	mov	eax,DWORD [edx]
+	mov	ebx,DWORD [4+edx]
+	mov	esi,DWORD [16+edx]
+	mov	edx,DWORD [20+edx]
+	mov	DWORD [32+esp],eax
+	mov	DWORD [36+esp],ebx
+	mov	DWORD [40+esp],ecx
+	mov	DWORD [44+esp],edi
+	mov	DWORD [48+esp],esi
+	mov	edi,esi
+	mov	esi,eax
+	cmp	edx,0
+	je	NEAR L$029slow_decrypt
+	cmp	ecx,16
+	mov	edx,ebx
+	jb	NEAR L$030slow_enc_tail
+	bt	DWORD [52+esp],25
+	jnc	NEAR L$031slow_enc_x86
+	movq	mm0,[edi]
+	movq	mm4,[8+edi]
+align	16
+L$032slow_enc_loop_sse:
+	pxor	mm0,[esi]
+	pxor	mm4,[8+esi]
+	mov	edi,DWORD [44+esp]
+	call	__sse_AES_encrypt_compact
+	mov	esi,DWORD [32+esp]
+	mov	edi,DWORD [36+esp]
+	mov	ecx,DWORD [40+esp]
+	movq	[edi],mm0
+	movq	[8+edi],mm4
+	lea	esi,[16+esi]
+	mov	DWORD [32+esp],esi
+	lea	edx,[16+edi]
+	mov	DWORD [36+esp],edx
+	sub	ecx,16
+	cmp	ecx,16
+	mov	DWORD [40+esp],ecx
+	jae	NEAR L$032slow_enc_loop_sse
+	test	ecx,15
+	jnz	NEAR L$030slow_enc_tail
+	mov	esi,DWORD [48+esp]
+	movq	[esi],mm0
+	movq	[8+esi],mm4
+	emms
+	mov	esp,DWORD [28+esp]
+	popfd
+	pop	edi
+	pop	esi
+	pop	ebx
+	pop	ebp
+	ret
+	pushfd
+align	16
+L$031slow_enc_x86:
+	mov	eax,DWORD [edi]
+	mov	ebx,DWORD [4+edi]
+align	4
+L$033slow_enc_loop_x86:
+	mov	ecx,DWORD [8+edi]
+	mov	edx,DWORD [12+edi]
+	xor	eax,DWORD [esi]
+	xor	ebx,DWORD [4+esi]
+	xor	ecx,DWORD [8+esi]
+	xor	edx,DWORD [12+esi]
+	mov	edi,DWORD [44+esp]
+	call	__x86_AES_encrypt_compact
+	mov	esi,DWORD [32+esp]
+	mov	edi,DWORD [36+esp]
+	mov	DWORD [edi],eax
+	mov	DWORD [4+edi],ebx
+	mov	DWORD [8+edi],ecx
+	mov	DWORD [12+edi],edx
+	mov	ecx,DWORD [40+esp]
+	lea	esi,[16+esi]
+	mov	DWORD [32+esp],esi
+	lea	edx,[16+edi]
+	mov	DWORD [36+esp],edx
+	sub	ecx,16
+	cmp	ecx,16
+	mov	DWORD [40+esp],ecx
+	jae	NEAR L$033slow_enc_loop_x86
+	test	ecx,15
+	jnz	NEAR L$030slow_enc_tail
+	mov	esi,DWORD [48+esp]
+	mov	ecx,DWORD [8+edi]
+	mov	edx,DWORD [12+edi]
+	mov	DWORD [esi],eax
+	mov	DWORD [4+esi],ebx
+	mov	DWORD [8+esi],ecx
+	mov	DWORD [12+esi],edx
+	mov	esp,DWORD [28+esp]
+	popfd
+	pop	edi
+	pop	esi
+	pop	ebx
+	pop	ebp
+	ret
+	pushfd
+align	16
+L$030slow_enc_tail:
+	emms
+	mov	edi,edx
+	mov	ebx,16
+	sub	ebx,ecx
+	cmp	edi,esi
+	je	NEAR L$034enc_in_place
+align	4
+dd	2767451785
+	jmp	NEAR L$035enc_skip_in_place
+L$034enc_in_place:
+	lea	edi,[ecx*1+edi]
+L$035enc_skip_in_place:
+	mov	ecx,ebx
+	xor	eax,eax
+align	4
+dd	2868115081
+	mov	edi,DWORD [48+esp]
+	mov	esi,edx
+	mov	eax,DWORD [edi]
+	mov	ebx,DWORD [4+edi]
+	mov	DWORD [40+esp],16
+	jmp	NEAR L$033slow_enc_loop_x86
+align	16
+L$029slow_decrypt:
+	bt	DWORD [52+esp],25
+	jnc	NEAR L$036slow_dec_loop_x86
+align	4
+L$037slow_dec_loop_sse:
+	movq	mm0,[esi]
+	movq	mm4,[8+esi]
+	mov	edi,DWORD [44+esp]
+	call	__sse_AES_decrypt_compact
+	mov	esi,DWORD [32+esp]
+	lea	eax,[60+esp]
+	mov	ebx,DWORD [36+esp]
+	mov	ecx,DWORD [40+esp]
+	mov	edi,DWORD [48+esp]
+	movq	mm1,[esi]
+	movq	mm5,[8+esi]
+	pxor	mm0,[edi]
+	pxor	mm4,[8+edi]
+	movq	[edi],mm1
+	movq	[8+edi],mm5
+	sub	ecx,16
+	jc	NEAR L$038slow_dec_partial_sse
+	movq	[ebx],mm0
+	movq	[8+ebx],mm4
+	lea	ebx,[16+ebx]
+	mov	DWORD [36+esp],ebx
+	lea	esi,[16+esi]
+	mov	DWORD [32+esp],esi
+	mov	DWORD [40+esp],ecx
+	jnz	NEAR L$037slow_dec_loop_sse
+	emms
+	mov	esp,DWORD [28+esp]
+	popfd
+	pop	edi
+	pop	esi
+	pop	ebx
+	pop	ebp
+	ret
+	pushfd
+align	16
+L$038slow_dec_partial_sse:
+	movq	[eax],mm0
+	movq	[8+eax],mm4
+	emms
+	add	ecx,16
+	mov	edi,ebx
+	mov	esi,eax
+align	4
+dd	2767451785
+	mov	esp,DWORD [28+esp]
+	popfd
+	pop	edi
+	pop	esi
+	pop	ebx
+	pop	ebp
+	ret
+	pushfd
+align	16
+L$036slow_dec_loop_x86:
+	mov	eax,DWORD [esi]
+	mov	ebx,DWORD [4+esi]
+	mov	ecx,DWORD [8+esi]
+	mov	edx,DWORD [12+esi]
+	lea	edi,[60+esp]
+	mov	DWORD [edi],eax
+	mov	DWORD [4+edi],ebx
+	mov	DWORD [8+edi],ecx
+	mov	DWORD [12+edi],edx
+	mov	edi,DWORD [44+esp]
+	call	__x86_AES_decrypt_compact
+	mov	edi,DWORD [48+esp]
+	mov	esi,DWORD [40+esp]
+	xor	eax,DWORD [edi]
+	xor	ebx,DWORD [4+edi]
+	xor	ecx,DWORD [8+edi]
+	xor	edx,DWORD [12+edi]
+	sub	esi,16
+	jc	NEAR L$039slow_dec_partial_x86
+	mov	DWORD [40+esp],esi
+	mov	esi,DWORD [36+esp]
+	mov	DWORD [esi],eax
+	mov	DWORD [4+esi],ebx
+	mov	DWORD [8+esi],ecx
+	mov	DWORD [12+esi],edx
+	lea	esi,[16+esi]
+	mov	DWORD [36+esp],esi
+	lea	esi,[60+esp]
+	mov	eax,DWORD [esi]
+	mov	ebx,DWORD [4+esi]
+	mov	ecx,DWORD [8+esi]
+	mov	edx,DWORD [12+esi]
+	mov	DWORD [edi],eax
+	mov	DWORD [4+edi],ebx
+	mov	DWORD [8+edi],ecx
+	mov	DWORD [12+edi],edx
+	mov	esi,DWORD [32+esp]
+	lea	esi,[16+esi]
+	mov	DWORD [32+esp],esi
+	jnz	NEAR L$036slow_dec_loop_x86
+	mov	esp,DWORD [28+esp]
+	popfd
+	pop	edi
+	pop	esi
+	pop	ebx
+	pop	ebp
+	ret
+	pushfd
+align	16
+L$039slow_dec_partial_x86:
+	lea	esi,[60+esp]
+	mov	DWORD [esi],eax
+	mov	DWORD [4+esi],ebx
+	mov	DWORD [8+esi],ecx
+	mov	DWORD [12+esi],edx
+	mov	esi,DWORD [32+esp]
+	mov	eax,DWORD [esi]
+	mov	ebx,DWORD [4+esi]
+	mov	ecx,DWORD [8+esi]
+	mov	edx,DWORD [12+esi]
+	mov	DWORD [edi],eax
+	mov	DWORD [4+edi],ebx
+	mov	DWORD [8+edi],ecx
+	mov	DWORD [12+edi],edx
+	mov	ecx,DWORD [40+esp]
+	mov	edi,DWORD [36+esp]
+	lea	esi,[60+esp]
+align	4
+dd	2767451785
+	mov	esp,DWORD [28+esp]
+	popfd
+	pop	edi
+	pop	esi
+	pop	ebx
+	pop	ebp
+	ret
+align	16
+__x86_AES_set_encrypt_key:
+	push	ebp
+	push	ebx
+	push	esi
+	push	edi
+	mov	esi,DWORD [24+esp]
+	mov	edi,DWORD [32+esp]
+	test	esi,-1
+	jz	NEAR L$040badpointer
+	test	edi,-1
+	jz	NEAR L$040badpointer
+	call	L$041pic_point
+L$041pic_point:
+	pop	ebp
+	lea	ebp,[(L$AES_Te-L$041pic_point)+ebp]
+	lea	ebp,[2176+ebp]
+	mov	eax,DWORD [ebp-128]
+	mov	ebx,DWORD [ebp-96]
+	mov	ecx,DWORD [ebp-64]
+	mov	edx,DWORD [ebp-32]
+	mov	eax,DWORD [ebp]
+	mov	ebx,DWORD [32+ebp]
+	mov	ecx,DWORD [64+ebp]
+	mov	edx,DWORD [96+ebp]
+	mov	ecx,DWORD [28+esp]
+	cmp	ecx,128
+	je	NEAR L$04210rounds
+	cmp	ecx,192
+	je	NEAR L$04312rounds
+	cmp	ecx,256
+	je	NEAR L$04414rounds
+	mov	eax,-2
+	jmp	NEAR L$045exit
+L$04210rounds:
+	mov	eax,DWORD [esi]
+	mov	ebx,DWORD [4+esi]
+	mov	ecx,DWORD [8+esi]
+	mov	edx,DWORD [12+esi]
+	mov	DWORD [edi],eax
+	mov	DWORD [4+edi],ebx
+	mov	DWORD [8+edi],ecx
+	mov	DWORD [12+edi],edx
+	xor	ecx,ecx
+	jmp	NEAR L$04610shortcut
+align	4
+L$04710loop:
+	mov	eax,DWORD [edi]
+	mov	edx,DWORD [12+edi]
+L$04610shortcut:
+	movzx	esi,dl
+	movzx	ebx,BYTE [esi*1+ebp-128]
+	movzx	esi,dh
+	shl	ebx,24
+	xor	eax,ebx
+	movzx	ebx,BYTE [esi*1+ebp-128]
+	shr	edx,16
+	movzx	esi,dl
+	xor	eax,ebx
+	movzx	ebx,BYTE [esi*1+ebp-128]
+	movzx	esi,dh
+	shl	ebx,8
+	xor	eax,ebx
+	movzx	ebx,BYTE [esi*1+ebp-128]
+	shl	ebx,16
+	xor	eax,ebx
+	xor	eax,DWORD [896+ecx*4+ebp]
+	mov	DWORD [16+edi],eax
+	xor	eax,DWORD [4+edi]
+	mov	DWORD [20+edi],eax
+	xor	eax,DWORD [8+edi]
+	mov	DWORD [24+edi],eax
+	xor	eax,DWORD [12+edi]
+	mov	DWORD [28+edi],eax
+	inc	ecx
+	add	edi,16
+	cmp	ecx,10
+	jl	NEAR L$04710loop
+	mov	DWORD [80+edi],10
+	xor	eax,eax
+	jmp	NEAR L$045exit
+L$04312rounds:
+	mov	eax,DWORD [esi]
+	mov	ebx,DWORD [4+esi]
+	mov	ecx,DWORD [8+esi]
+	mov	edx,DWORD [12+esi]
+	mov	DWORD [edi],eax
+	mov	DWORD [4+edi],ebx
+	mov	DWORD [8+edi],ecx
+	mov	DWORD [12+edi],edx
+	mov	ecx,DWORD [16+esi]
+	mov	edx,DWORD [20+esi]
+	mov	DWORD [16+edi],ecx
+	mov	DWORD [20+edi],edx
+	xor	ecx,ecx
+	jmp	NEAR L$04812shortcut
+align	4
+L$04912loop:
+	mov	eax,DWORD [edi]
+	mov	edx,DWORD [20+edi]
+L$04812shortcut:
+	movzx	esi,dl
+	movzx	ebx,BYTE [esi*1+ebp-128]
+	movzx	esi,dh
+	shl	ebx,24
+	xor	eax,ebx
+	movzx	ebx,BYTE [esi*1+ebp-128]
+	shr	edx,16
+	movzx	esi,dl
+	xor	eax,ebx
+	movzx	ebx,BYTE [esi*1+ebp-128]
+	movzx	esi,dh
+	shl	ebx,8
+	xor	eax,ebx
+	movzx	ebx,BYTE [esi*1+ebp-128]
+	shl	ebx,16
+	xor	eax,ebx
+	xor	eax,DWORD [896+ecx*4+ebp]
+	mov	DWORD [24+edi],eax
+	xor	eax,DWORD [4+edi]
+	mov	DWORD [28+edi],eax
+	xor	eax,DWORD [8+edi]
+	mov	DWORD [32+edi],eax
+	xor	eax,DWORD [12+edi]
+	mov	DWORD [36+edi],eax
+	cmp	ecx,7
+	je	NEAR L$05012break
+	inc	ecx
+	xor	eax,DWORD [16+edi]
+	mov	DWORD [40+edi],eax
+	xor	eax,DWORD [20+edi]
+	mov	DWORD [44+edi],eax
+	add	edi,24
+	jmp	NEAR L$04912loop
+L$05012break:
+	mov	DWORD [72+edi],12
+	xor	eax,eax
+	jmp	NEAR L$045exit
+L$04414rounds:
+	mov	eax,DWORD [esi]
+	mov	ebx,DWORD [4+esi]
+	mov	ecx,DWORD [8+esi]
+	mov	edx,DWORD [12+esi]
+	mov	DWORD [edi],eax
+	mov	DWORD [4+edi],ebx
+	mov	DWORD [8+edi],ecx
+	mov	DWORD [12+edi],edx
+	mov	eax,DWORD [16+esi]
+	mov	ebx,DWORD [20+esi]
+	mov	ecx,DWORD [24+esi]
+	mov	edx,DWORD [28+esi]
+	mov	DWORD [16+edi],eax
+	mov	DWORD [20+edi],ebx
+	mov	DWORD [24+edi],ecx
+	mov	DWORD [28+edi],edx
+	xor	ecx,ecx
+	jmp	NEAR L$05114shortcut
+align	4
+L$05214loop:
+	mov	edx,DWORD [28+edi]
+L$05114shortcut:
+	mov	eax,DWORD [edi]
+	movzx	esi,dl
+	movzx	ebx,BYTE [esi*1+ebp-128]
+	movzx	esi,dh
+	shl	ebx,24
+	xor	eax,ebx
+	movzx	ebx,BYTE [esi*1+ebp-128]
+	shr	edx,16
+	movzx	esi,dl
+	xor	eax,ebx
+	movzx	ebx,BYTE [esi*1+ebp-128]
+	movzx	esi,dh
+	shl	ebx,8
+	xor	eax,ebx
+	movzx	ebx,BYTE [esi*1+ebp-128]
+	shl	ebx,16
+	xor	eax,ebx
+	xor	eax,DWORD [896+ecx*4+ebp]
+	mov	DWORD [32+edi],eax
+	xor	eax,DWORD [4+edi]
+	mov	DWORD [36+edi],eax
+	xor	eax,DWORD [8+edi]
+	mov	DWORD [40+edi],eax
+	xor	eax,DWORD [12+edi]
+	mov	DWORD [44+edi],eax
+	cmp	ecx,6
+	je	NEAR L$05314break
+	inc	ecx
+	mov	edx,eax
+	mov	eax,DWORD [16+edi]
+	movzx	esi,dl
+	movzx	ebx,BYTE [esi*1+ebp-128]
+	movzx	esi,dh
+	xor	eax,ebx
+	movzx	ebx,BYTE [esi*1+ebp-128]
+	shr	edx,16
+	shl	ebx,8
+	movzx	esi,dl
+	xor	eax,ebx
+	movzx	ebx,BYTE [esi*1+ebp-128]
+	movzx	esi,dh
+	shl	ebx,16
+	xor	eax,ebx
+	movzx	ebx,BYTE [esi*1+ebp-128]
+	shl	ebx,24
+	xor	eax,ebx
+	mov	DWORD [48+edi],eax
+	xor	eax,DWORD [20+edi]
+	mov	DWORD [52+edi],eax
+	xor	eax,DWORD [24+edi]
+	mov	DWORD [56+edi],eax
+	xor	eax,DWORD [28+edi]
+	mov	DWORD [60+edi],eax
+	add	edi,32
+	jmp	NEAR L$05214loop
+L$05314break:
+	mov	DWORD [48+edi],14
+	xor	eax,eax
+	jmp	NEAR L$045exit
+L$040badpointer:
+	mov	eax,-1
+L$045exit:
+	pop	edi
+	pop	esi
+	pop	ebx
+	pop	ebp
+	ret
+global	_asm_AES_set_encrypt_key
+align	16
+_asm_AES_set_encrypt_key:
+L$_asm_AES_set_encrypt_key_begin:
+	call	__x86_AES_set_encrypt_key
+	ret
+global	_asm_AES_set_decrypt_key
+align	16
+_asm_AES_set_decrypt_key:
+L$_asm_AES_set_decrypt_key_begin:
+	call	__x86_AES_set_encrypt_key
+	cmp	eax,0
+	je	NEAR L$054proceed
+	ret
+L$054proceed:
+	push	ebp
+	push	ebx
+	push	esi
+	push	edi
+	mov	esi,DWORD [28+esp]
+	mov	ecx,DWORD [240+esi]
+	lea	ecx,[ecx*4]
+	lea	edi,[ecx*4+esi]
+align	4
+L$055invert:
+	mov	eax,DWORD [esi]
+	mov	ebx,DWORD [4+esi]
+	mov	ecx,DWORD [edi]
+	mov	edx,DWORD [4+edi]
+	mov	DWORD [edi],eax
+	mov	DWORD [4+edi],ebx
+	mov	DWORD [esi],ecx
+	mov	DWORD [4+esi],edx
+	mov	eax,DWORD [8+esi]
+	mov	ebx,DWORD [12+esi]
+	mov	ecx,DWORD [8+edi]
+	mov	edx,DWORD [12+edi]
+	mov	DWORD [8+edi],eax
+	mov	DWORD [12+edi],ebx
+	mov	DWORD [8+esi],ecx
+	mov	DWORD [12+esi],edx
+	add	esi,16
+	sub	edi,16
+	cmp	esi,edi
+	jne	NEAR L$055invert
+	mov	edi,DWORD [28+esp]
+	mov	esi,DWORD [240+edi]
+	lea	esi,[esi*1+esi-2]
+	lea	esi,[esi*8+edi]
+	mov	DWORD [28+esp],esi
+	mov	eax,DWORD [16+edi]
+align	4
+L$056permute:
+	add	edi,16
+	mov	ebp,2155905152
+	and	ebp,eax
+	lea	ebx,[eax*1+eax]
+	mov	esi,ebp
+	shr	ebp,7
+	sub	esi,ebp
+	and	ebx,4278124286
+	and	esi,454761243
+	xor	ebx,esi
+	mov	ebp,2155905152
+	and	ebp,ebx
+	lea	ecx,[ebx*1+ebx]
+	mov	esi,ebp
+	shr	ebp,7
+	sub	esi,ebp
+	and	ecx,4278124286
+	and	esi,454761243
+	xor	ebx,eax
+	xor	ecx,esi
+	mov	ebp,2155905152
+	and	ebp,ecx
+	lea	edx,[ecx*1+ecx]
+	mov	esi,ebp
+	shr	ebp,7
+	xor	ecx,eax
+	sub	esi,ebp
+	and	edx,4278124286
+	and	esi,454761243
+	rol	eax,8
+	xor	edx,esi
+	mov	ebp,DWORD [4+edi]
+	xor	eax,ebx
+	xor	ebx,edx
+	xor	eax,ecx
+	rol	ebx,24
+	xor	ecx,edx
+	xor	eax,edx
+	rol	ecx,16
+	xor	eax,ebx
+	rol	edx,8
+	xor	eax,ecx
+	mov	ebx,ebp
+	xor	eax,edx
+	mov	DWORD [edi],eax
+	mov	ebp,2155905152
+	and	ebp,ebx
+	lea	ecx,[ebx*1+ebx]
+	mov	esi,ebp
+	shr	ebp,7
+	sub	esi,ebp
+	and	ecx,4278124286
+	and	esi,454761243
+	xor	ecx,esi
+	mov	ebp,2155905152
+	and	ebp,ecx
+	lea	edx,[ecx*1+ecx]
+	mov	esi,ebp
+	shr	ebp,7
+	sub	esi,ebp
+	and	edx,4278124286
+	and	esi,454761243
+	xor	ecx,ebx
+	xor	edx,esi
+	mov	ebp,2155905152
+	and	ebp,edx
+	lea	eax,[edx*1+edx]
+	mov	esi,ebp
+	shr	ebp,7
+	xor	edx,ebx
+	sub	esi,ebp
+	and	eax,4278124286
+	and	esi,454761243
+	rol	ebx,8
+	xor	eax,esi
+	mov	ebp,DWORD [8+edi]
+	xor	ebx,ecx
+	xor	ecx,eax
+	xor	ebx,edx
+	rol	ecx,24
+	xor	edx,eax
+	xor	ebx,eax
+	rol	edx,16
+	xor	ebx,ecx
+	rol	eax,8
+	xor	ebx,edx
+	mov	ecx,ebp
+	xor	ebx,eax
+	mov	DWORD [4+edi],ebx
+	mov	ebp,2155905152
+	and	ebp,ecx
+	lea	edx,[ecx*1+ecx]
+	mov	esi,ebp
+	shr	ebp,7
+	sub	esi,ebp
+	and	edx,4278124286
+	and	esi,454761243
+	xor	edx,esi
+	mov	ebp,2155905152
+	and	ebp,edx
+	lea	eax,[edx*1+edx]
+	mov	esi,ebp
+	shr	ebp,7
+	sub	esi,ebp
+	and	eax,4278124286
+	and	esi,454761243
+	xor	edx,ecx
+	xor	eax,esi
+	mov	ebp,2155905152
+	and	ebp,eax
+	lea	ebx,[eax*1+eax]
+	mov	esi,ebp
+	shr	ebp,7
+	xor	eax,ecx
+	sub	esi,ebp
+	and	ebx,4278124286
+	and	esi,454761243
+	rol	ecx,8
+	xor	ebx,esi
+	mov	ebp,DWORD [12+edi]
+	xor	ecx,edx
+	xor	edx,ebx
+	xor	ecx,eax
+	rol	edx,24
+	xor	eax,ebx
+	xor	ecx,ebx
+	rol	eax,16
+	xor	ecx,edx
+	rol	ebx,8
+	xor	ecx,eax
+	mov	edx,ebp
+	xor	ecx,ebx
+	mov	DWORD [8+edi],ecx
+	mov	ebp,2155905152
+	and	ebp,edx
+	lea	eax,[edx*1+edx]
+	mov	esi,ebp
+	shr	ebp,7
+	sub	esi,ebp
+	and	eax,4278124286
+	and	esi,454761243
+	xor	eax,esi
+	mov	ebp,2155905152
+	and	ebp,eax
+	lea	ebx,[eax*1+eax]
+	mov	esi,ebp
+	shr	ebp,7
+	sub	esi,ebp
+	and	ebx,4278124286
+	and	esi,454761243
+	xor	eax,edx
+	xor	ebx,esi
+	mov	ebp,2155905152
+	and	ebp,ebx
+	lea	ecx,[ebx*1+ebx]
+	mov	esi,ebp
+	shr	ebp,7
+	xor	ebx,edx
+	sub	esi,ebp
+	and	ecx,4278124286
+	and	esi,454761243
+	rol	edx,8
+	xor	ecx,esi
+	mov	ebp,DWORD [16+edi]
+	xor	edx,eax
+	xor	eax,ecx
+	xor	edx,ebx
+	rol	eax,24
+	xor	ebx,ecx
+	xor	edx,ecx
+	rol	ebx,16
+	xor	edx,eax
+	rol	ecx,8
+	xor	edx,ebx
+	mov	eax,ebp
+	xor	edx,ecx
+	mov	DWORD [12+edi],edx
+	cmp	edi,DWORD [28+esp]
+	jb	NEAR L$056permute
+	xor	eax,eax
+	pop	edi
+	pop	esi
+	pop	ebx
+	pop	ebp
+	ret
+db	65,69,83,32,102,111,114,32,120,56,54,44,32,67,82,89
+db	80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114
+db	111,64,111,112,101,110,115,115,108,46,111,114,103,62,0
+segment	.bss
+common	_OPENSSL_ia32cap_P 16
diff --git a/third_party/boringssl/win-x86/crypto/aes/aesni-x86.asm b/third_party/boringssl/win-x86/crypto/aes/aesni-x86.asm
new file mode 100644
index 0000000..a9a5956
--- /dev/null
+++ b/third_party/boringssl/win-x86/crypto/aes/aesni-x86.asm
@@ -0,0 +1,2424 @@
+%ifidn __OUTPUT_FORMAT__,obj
+section	code	use32 class=code align=64
+%elifidn __OUTPUT_FORMAT__,win32
+%ifdef __YASM_VERSION_ID__
+%if __YASM_VERSION_ID__ < 01010000h
+%error yasm version 1.1.0 or later needed.
+%endif
+; Yasm automatically includes .00 and complains about redefining it.
+; https://www.tortall.net/projects/yasm/manual/html/objfmt-win32-safeseh.html
+%else
+$@feat.00 equ 1
+%endif
+section	.text	code align=64
+%else
+section	.text	code
+%endif
+;extern	_OPENSSL_ia32cap_P
+global	_aesni_encrypt
+align	16
+_aesni_encrypt:
+L$_aesni_encrypt_begin:
+	mov	eax,DWORD [4+esp]
+	mov	edx,DWORD [12+esp]
+	movups	xmm2,[eax]
+	mov	ecx,DWORD [240+edx]
+	mov	eax,DWORD [8+esp]
+	movups	xmm0,[edx]
+	movups	xmm1,[16+edx]
+	lea	edx,[32+edx]
+	xorps	xmm2,xmm0
+L$000enc1_loop_1:
+db	102,15,56,220,209
+	dec	ecx
+	movups	xmm1,[edx]
+	lea	edx,[16+edx]
+	jnz	NEAR L$000enc1_loop_1
+db	102,15,56,221,209
+	pxor	xmm0,xmm0
+	pxor	xmm1,xmm1
+	movups	[eax],xmm2
+	pxor	xmm2,xmm2
+	ret
+global	_aesni_decrypt
+align	16
+_aesni_decrypt:
+L$_aesni_decrypt_begin:
+	mov	eax,DWORD [4+esp]
+	mov	edx,DWORD [12+esp]
+	movups	xmm2,[eax]
+	mov	ecx,DWORD [240+edx]
+	mov	eax,DWORD [8+esp]
+	movups	xmm0,[edx]
+	movups	xmm1,[16+edx]
+	lea	edx,[32+edx]
+	xorps	xmm2,xmm0
+L$001dec1_loop_2:
+db	102,15,56,222,209
+	dec	ecx
+	movups	xmm1,[edx]
+	lea	edx,[16+edx]
+	jnz	NEAR L$001dec1_loop_2
+db	102,15,56,223,209
+	pxor	xmm0,xmm0
+	pxor	xmm1,xmm1
+	movups	[eax],xmm2
+	pxor	xmm2,xmm2
+	ret
+align	16
+__aesni_encrypt2:
+	movups	xmm0,[edx]
+	shl	ecx,4
+	movups	xmm1,[16+edx]
+	xorps	xmm2,xmm0
+	pxor	xmm3,xmm0
+	movups	xmm0,[32+edx]
+	lea	edx,[32+ecx*1+edx]
+	neg	ecx
+	add	ecx,16
+L$002enc2_loop:
+db	102,15,56,220,209
+db	102,15,56,220,217
+	movups	xmm1,[ecx*1+edx]
+	add	ecx,32
+db	102,15,56,220,208
+db	102,15,56,220,216
+	movups	xmm0,[ecx*1+edx-16]
+	jnz	NEAR L$002enc2_loop
+db	102,15,56,220,209
+db	102,15,56,220,217
+db	102,15,56,221,208
+db	102,15,56,221,216
+	ret
+align	16
+__aesni_decrypt2:
+	movups	xmm0,[edx]
+	shl	ecx,4
+	movups	xmm1,[16+edx]
+	xorps	xmm2,xmm0
+	pxor	xmm3,xmm0
+	movups	xmm0,[32+edx]
+	lea	edx,[32+ecx*1+edx]
+	neg	ecx
+	add	ecx,16
+L$003dec2_loop:
+db	102,15,56,222,209
+db	102,15,56,222,217
+	movups	xmm1,[ecx*1+edx]
+	add	ecx,32
+db	102,15,56,222,208
+db	102,15,56,222,216
+	movups	xmm0,[ecx*1+edx-16]
+	jnz	NEAR L$003dec2_loop
+db	102,15,56,222,209
+db	102,15,56,222,217
+db	102,15,56,223,208
+db	102,15,56,223,216
+	ret
+align	16
+__aesni_encrypt3:
+	movups	xmm0,[edx]
+	shl	ecx,4
+	movups	xmm1,[16+edx]
+	xorps	xmm2,xmm0
+	pxor	xmm3,xmm0
+	pxor	xmm4,xmm0
+	movups	xmm0,[32+edx]
+	lea	edx,[32+ecx*1+edx]
+	neg	ecx
+	add	ecx,16
+L$004enc3_loop:
+db	102,15,56,220,209
+db	102,15,56,220,217
+db	102,15,56,220,225
+	movups	xmm1,[ecx*1+edx]
+	add	ecx,32
+db	102,15,56,220,208
+db	102,15,56,220,216
+db	102,15,56,220,224
+	movups	xmm0,[ecx*1+edx-16]
+	jnz	NEAR L$004enc3_loop
+db	102,15,56,220,209
+db	102,15,56,220,217
+db	102,15,56,220,225
+db	102,15,56,221,208
+db	102,15,56,221,216
+db	102,15,56,221,224
+	ret
+align	16
+__aesni_decrypt3:
+	movups	xmm0,[edx]
+	shl	ecx,4
+	movups	xmm1,[16+edx]
+	xorps	xmm2,xmm0
+	pxor	xmm3,xmm0
+	pxor	xmm4,xmm0
+	movups	xmm0,[32+edx]
+	lea	edx,[32+ecx*1+edx]
+	neg	ecx
+	add	ecx,16
+L$005dec3_loop:
+db	102,15,56,222,209
+db	102,15,56,222,217
+db	102,15,56,222,225
+	movups	xmm1,[ecx*1+edx]
+	add	ecx,32
+db	102,15,56,222,208
+db	102,15,56,222,216
+db	102,15,56,222,224
+	movups	xmm0,[ecx*1+edx-16]
+	jnz	NEAR L$005dec3_loop
+db	102,15,56,222,209
+db	102,15,56,222,217
+db	102,15,56,222,225
+db	102,15,56,223,208
+db	102,15,56,223,216
+db	102,15,56,223,224
+	ret
+align	16
+__aesni_encrypt4:
+	movups	xmm0,[edx]
+	movups	xmm1,[16+edx]
+	shl	ecx,4
+	xorps	xmm2,xmm0
+	pxor	xmm3,xmm0
+	pxor	xmm4,xmm0
+	pxor	xmm5,xmm0
+	movups	xmm0,[32+edx]
+	lea	edx,[32+ecx*1+edx]
+	neg	ecx
+db	15,31,64,0
+	add	ecx,16
+L$006enc4_loop:
+db	102,15,56,220,209
+db	102,15,56,220,217
+db	102,15,56,220,225
+db	102,15,56,220,233
+	movups	xmm1,[ecx*1+edx]
+	add	ecx,32
+db	102,15,56,220,208
+db	102,15,56,220,216
+db	102,15,56,220,224
+db	102,15,56,220,232
+	movups	xmm0,[ecx*1+edx-16]
+	jnz	NEAR L$006enc4_loop
+db	102,15,56,220,209
+db	102,15,56,220,217
+db	102,15,56,220,225
+db	102,15,56,220,233
+db	102,15,56,221,208
+db	102,15,56,221,216
+db	102,15,56,221,224
+db	102,15,56,221,232
+	ret
+align	16
+__aesni_decrypt4:
+	movups	xmm0,[edx]
+	movups	xmm1,[16+edx]
+	shl	ecx,4
+	xorps	xmm2,xmm0
+	pxor	xmm3,xmm0
+	pxor	xmm4,xmm0
+	pxor	xmm5,xmm0
+	movups	xmm0,[32+edx]
+	lea	edx,[32+ecx*1+edx]
+	neg	ecx
+db	15,31,64,0
+	add	ecx,16
+L$007dec4_loop:
+db	102,15,56,222,209
+db	102,15,56,222,217
+db	102,15,56,222,225
+db	102,15,56,222,233
+	movups	xmm1,[ecx*1+edx]
+	add	ecx,32
+db	102,15,56,222,208
+db	102,15,56,222,216
+db	102,15,56,222,224
+db	102,15,56,222,232
+	movups	xmm0,[ecx*1+edx-16]
+	jnz	NEAR L$007dec4_loop
+db	102,15,56,222,209
+db	102,15,56,222,217
+db	102,15,56,222,225
+db	102,15,56,222,233
+db	102,15,56,223,208
+db	102,15,56,223,216
+db	102,15,56,223,224
+db	102,15,56,223,232
+	ret
+align	16
+__aesni_encrypt6:
+	movups	xmm0,[edx]
+	shl	ecx,4
+	movups	xmm1,[16+edx]
+	xorps	xmm2,xmm0
+	pxor	xmm3,xmm0
+	pxor	xmm4,xmm0
+db	102,15,56,220,209
+	pxor	xmm5,xmm0
+	pxor	xmm6,xmm0
+db	102,15,56,220,217
+	lea	edx,[32+ecx*1+edx]
+	neg	ecx
+db	102,15,56,220,225
+	pxor	xmm7,xmm0
+	movups	xmm0,[ecx*1+edx]
+	add	ecx,16
+	jmp	NEAR L$008_aesni_encrypt6_inner
+align	16
+L$009enc6_loop:
+db	102,15,56,220,209
+db	102,15,56,220,217
+db	102,15,56,220,225
+L$008_aesni_encrypt6_inner:
+db	102,15,56,220,233
+db	102,15,56,220,241
+db	102,15,56,220,249
+L$_aesni_encrypt6_enter:
+	movups	xmm1,[ecx*1+edx]
+	add	ecx,32
+db	102,15,56,220,208
+db	102,15,56,220,216
+db	102,15,56,220,224
+db	102,15,56,220,232
+db	102,15,56,220,240
+db	102,15,56,220,248
+	movups	xmm0,[ecx*1+edx-16]
+	jnz	NEAR L$009enc6_loop
+db	102,15,56,220,209
+db	102,15,56,220,217
+db	102,15,56,220,225
+db	102,15,56,220,233
+db	102,15,56,220,241
+db	102,15,56,220,249
+db	102,15,56,221,208
+db	102,15,56,221,216
+db	102,15,56,221,224
+db	102,15,56,221,232
+db	102,15,56,221,240
+db	102,15,56,221,248
+	ret
+align	16
+__aesni_decrypt6:
+	movups	xmm0,[edx]
+	shl	ecx,4
+	movups	xmm1,[16+edx]
+	xorps	xmm2,xmm0
+	pxor	xmm3,xmm0
+	pxor	xmm4,xmm0
+db	102,15,56,222,209
+	pxor	xmm5,xmm0
+	pxor	xmm6,xmm0
+db	102,15,56,222,217
+	lea	edx,[32+ecx*1+edx]
+	neg	ecx
+db	102,15,56,222,225
+	pxor	xmm7,xmm0
+	movups	xmm0,[ecx*1+edx]
+	add	ecx,16
+	jmp	NEAR L$010_aesni_decrypt6_inner
+align	16
+L$011dec6_loop:
+db	102,15,56,222,209
+db	102,15,56,222,217
+db	102,15,56,222,225
+L$010_aesni_decrypt6_inner:
+db	102,15,56,222,233
+db	102,15,56,222,241
+db	102,15,56,222,249
+L$_aesni_decrypt6_enter:
+	movups	xmm1,[ecx*1+edx]
+	add	ecx,32
+db	102,15,56,222,208
+db	102,15,56,222,216
+db	102,15,56,222,224
+db	102,15,56,222,232
+db	102,15,56,222,240
+db	102,15,56,222,248
+	movups	xmm0,[ecx*1+edx-16]
+	jnz	NEAR L$011dec6_loop
+db	102,15,56,222,209
+db	102,15,56,222,217
+db	102,15,56,222,225
+db	102,15,56,222,233
+db	102,15,56,222,241
+db	102,15,56,222,249
+db	102,15,56,223,208
+db	102,15,56,223,216
+db	102,15,56,223,224
+db	102,15,56,223,232
+db	102,15,56,223,240
+db	102,15,56,223,248
+	ret
+global	_aesni_ecb_encrypt
+align	16
+_aesni_ecb_encrypt:
+L$_aesni_ecb_encrypt_begin:
+	push	ebp
+	push	ebx
+	push	esi
+	push	edi
+	mov	esi,DWORD [20+esp]
+	mov	edi,DWORD [24+esp]
+	mov	eax,DWORD [28+esp]
+	mov	edx,DWORD [32+esp]
+	mov	ebx,DWORD [36+esp]
+	and	eax,-16
+	jz	NEAR L$012ecb_ret
+	mov	ecx,DWORD [240+edx]
+	test	ebx,ebx
+	jz	NEAR L$013ecb_decrypt
+	mov	ebp,edx
+	mov	ebx,ecx
+	cmp	eax,96
+	jb	NEAR L$014ecb_enc_tail
+	movdqu	xmm2,[esi]
+	movdqu	xmm3,[16+esi]
+	movdqu	xmm4,[32+esi]
+	movdqu	xmm5,[48+esi]
+	movdqu	xmm6,[64+esi]
+	movdqu	xmm7,[80+esi]
+	lea	esi,[96+esi]
+	sub	eax,96
+	jmp	NEAR L$015ecb_enc_loop6_enter
+align	16
+L$016ecb_enc_loop6:
+	movups	[edi],xmm2
+	movdqu	xmm2,[esi]
+	movups	[16+edi],xmm3
+	movdqu	xmm3,[16+esi]
+	movups	[32+edi],xmm4
+	movdqu	xmm4,[32+esi]
+	movups	[48+edi],xmm5
+	movdqu	xmm5,[48+esi]
+	movups	[64+edi],xmm6
+	movdqu	xmm6,[64+esi]
+	movups	[80+edi],xmm7
+	lea	edi,[96+edi]
+	movdqu	xmm7,[80+esi]
+	lea	esi,[96+esi]
+L$015ecb_enc_loop6_enter:
+	call	__aesni_encrypt6
+	mov	edx,ebp
+	mov	ecx,ebx
+	sub	eax,96
+	jnc	NEAR L$016ecb_enc_loop6
+	movups	[edi],xmm2
+	movups	[16+edi],xmm3
+	movups	[32+edi],xmm4
+	movups	[48+edi],xmm5
+	movups	[64+edi],xmm6
+	movups	[80+edi],xmm7
+	lea	edi,[96+edi]
+	add	eax,96
+	jz	NEAR L$012ecb_ret
+L$014ecb_enc_tail:
+	movups	xmm2,[esi]
+	cmp	eax,32
+	jb	NEAR L$017ecb_enc_one
+	movups	xmm3,[16+esi]
+	je	NEAR L$018ecb_enc_two
+	movups	xmm4,[32+esi]
+	cmp	eax,64
+	jb	NEAR L$019ecb_enc_three
+	movups	xmm5,[48+esi]
+	je	NEAR L$020ecb_enc_four
+	movups	xmm6,[64+esi]
+	xorps	xmm7,xmm7
+	call	__aesni_encrypt6
+	movups	[edi],xmm2
+	movups	[16+edi],xmm3
+	movups	[32+edi],xmm4
+	movups	[48+edi],xmm5
+	movups	[64+edi],xmm6
+	jmp	NEAR L$012ecb_ret
+align	16
+L$017ecb_enc_one:
+	movups	xmm0,[edx]
+	movups	xmm1,[16+edx]
+	lea	edx,[32+edx]
+	xorps	xmm2,xmm0
+L$021enc1_loop_3:
+db	102,15,56,220,209
+	dec	ecx
+	movups	xmm1,[edx]
+	lea	edx,[16+edx]
+	jnz	NEAR L$021enc1_loop_3
+db	102,15,56,221,209
+	movups	[edi],xmm2
+	jmp	NEAR L$012ecb_ret
+align	16
+L$018ecb_enc_two:
+	call	__aesni_encrypt2
+	movups	[edi],xmm2
+	movups	[16+edi],xmm3
+	jmp	NEAR L$012ecb_ret
+align	16
+L$019ecb_enc_three:
+	call	__aesni_encrypt3
+	movups	[edi],xmm2
+	movups	[16+edi],xmm3
+	movups	[32+edi],xmm4
+	jmp	NEAR L$012ecb_ret
+align	16
+L$020ecb_enc_four:
+	call	__aesni_encrypt4
+	movups	[edi],xmm2
+	movups	[16+edi],xmm3
+	movups	[32+edi],xmm4
+	movups	[48+edi],xmm5
+	jmp	NEAR L$012ecb_ret
+align	16
+L$013ecb_decrypt:
+	mov	ebp,edx
+	mov	ebx,ecx
+	cmp	eax,96
+	jb	NEAR L$022ecb_dec_tail
+	movdqu	xmm2,[esi]
+	movdqu	xmm3,[16+esi]
+	movdqu	xmm4,[32+esi]
+	movdqu	xmm5,[48+esi]
+	movdqu	xmm6,[64+esi]
+	movdqu	xmm7,[80+esi]
+	lea	esi,[96+esi]
+	sub	eax,96
+	jmp	NEAR L$023ecb_dec_loop6_enter
+align	16
+L$024ecb_dec_loop6:
+	movups	[edi],xmm2
+	movdqu	xmm2,[esi]
+	movups	[16+edi],xmm3
+	movdqu	xmm3,[16+esi]
+	movups	[32+edi],xmm4
+	movdqu	xmm4,[32+esi]
+	movups	[48+edi],xmm5
+	movdqu	xmm5,[48+esi]
+	movups	[64+edi],xmm6
+	movdqu	xmm6,[64+esi]
+	movups	[80+edi],xmm7
+	lea	edi,[96+edi]
+	movdqu	xmm7,[80+esi]
+	lea	esi,[96+esi]
+L$023ecb_dec_loop6_enter:
+	call	__aesni_decrypt6
+	mov	edx,ebp
+	mov	ecx,ebx
+	sub	eax,96
+	jnc	NEAR L$024ecb_dec_loop6
+	movups	[edi],xmm2
+	movups	[16+edi],xmm3
+	movups	[32+edi],xmm4
+	movups	[48+edi],xmm5
+	movups	[64+edi],xmm6
+	movups	[80+edi],xmm7
+	lea	edi,[96+edi]
+	add	eax,96
+	jz	NEAR L$012ecb_ret
+L$022ecb_dec_tail:
+	movups	xmm2,[esi]
+	cmp	eax,32
+	jb	NEAR L$025ecb_dec_one
+	movups	xmm3,[16+esi]
+	je	NEAR L$026ecb_dec_two
+	movups	xmm4,[32+esi]
+	cmp	eax,64
+	jb	NEAR L$027ecb_dec_three
+	movups	xmm5,[48+esi]
+	je	NEAR L$028ecb_dec_four
+	movups	xmm6,[64+esi]
+	xorps	xmm7,xmm7
+	call	__aesni_decrypt6
+	movups	[edi],xmm2
+	movups	[16+edi],xmm3
+	movups	[32+edi],xmm4
+	movups	[48+edi],xmm5
+	movups	[64+edi],xmm6
+	jmp	NEAR L$012ecb_ret
+align	16
+L$025ecb_dec_one:
+	movups	xmm0,[edx]
+	movups	xmm1,[16+edx]
+	lea	edx,[32+edx]
+	xorps	xmm2,xmm0
+L$029dec1_loop_4:
+db	102,15,56,222,209
+	dec	ecx
+	movups	xmm1,[edx]
+	lea	edx,[16+edx]
+	jnz	NEAR L$029dec1_loop_4
+db	102,15,56,223,209
+	movups	[edi],xmm2
+	jmp	NEAR L$012ecb_ret
+align	16
+L$026ecb_dec_two:
+	call	__aesni_decrypt2
+	movups	[edi],xmm2
+	movups	[16+edi],xmm3
+	jmp	NEAR L$012ecb_ret
+align	16
+L$027ecb_dec_three:
+	call	__aesni_decrypt3
+	movups	[edi],xmm2
+	movups	[16+edi],xmm3
+	movups	[32+edi],xmm4
+	jmp	NEAR L$012ecb_ret
+align	16
+L$028ecb_dec_four:
+	call	__aesni_decrypt4
+	movups	[edi],xmm2
+	movups	[16+edi],xmm3
+	movups	[32+edi],xmm4
+	movups	[48+edi],xmm5
+L$012ecb_ret:
+	pxor	xmm0,xmm0
+	pxor	xmm1,xmm1
+	pxor	xmm2,xmm2
+	pxor	xmm3,xmm3
+	pxor	xmm4,xmm4
+	pxor	xmm5,xmm5
+	pxor	xmm6,xmm6
+	pxor	xmm7,xmm7
+	pop	edi
+	pop	esi
+	pop	ebx
+	pop	ebp
+	ret
+global	_aesni_ccm64_encrypt_blocks
+align	16
+_aesni_ccm64_encrypt_blocks:
+L$_aesni_ccm64_encrypt_blocks_begin:
+	push	ebp
+	push	ebx
+	push	esi
+	push	edi
+	mov	esi,DWORD [20+esp]
+	mov	edi,DWORD [24+esp]
+	mov	eax,DWORD [28+esp]
+	mov	edx,DWORD [32+esp]
+	mov	ebx,DWORD [36+esp]
+	mov	ecx,DWORD [40+esp]
+	mov	ebp,esp
+	sub	esp,60
+	and	esp,-16
+	mov	DWORD [48+esp],ebp
+	movdqu	xmm7,[ebx]
+	movdqu	xmm3,[ecx]
+	mov	ecx,DWORD [240+edx]
+	mov	DWORD [esp],202182159
+	mov	DWORD [4+esp],134810123
+	mov	DWORD [8+esp],67438087
+	mov	DWORD [12+esp],66051
+	mov	ebx,1
+	xor	ebp,ebp
+	mov	DWORD [16+esp],ebx
+	mov	DWORD [20+esp],ebp
+	mov	DWORD [24+esp],ebp
+	mov	DWORD [28+esp],ebp
+	shl	ecx,4
+	mov	ebx,16
+	lea	ebp,[edx]
+	movdqa	xmm5,[esp]
+	movdqa	xmm2,xmm7
+	lea	edx,[32+ecx*1+edx]
+	sub	ebx,ecx
+db	102,15,56,0,253
+L$030ccm64_enc_outer:
+	movups	xmm0,[ebp]
+	mov	ecx,ebx
+	movups	xmm6,[esi]
+	xorps	xmm2,xmm0
+	movups	xmm1,[16+ebp]
+	xorps	xmm0,xmm6
+	xorps	xmm3,xmm0
+	movups	xmm0,[32+ebp]
+L$031ccm64_enc2_loop:
+db	102,15,56,220,209
+db	102,15,56,220,217
+	movups	xmm1,[ecx*1+edx]
+	add	ecx,32
+db	102,15,56,220,208
+db	102,15,56,220,216
+	movups	xmm0,[ecx*1+edx-16]
+	jnz	NEAR L$031ccm64_enc2_loop
+db	102,15,56,220,209
+db	102,15,56,220,217
+	paddq	xmm7,[16+esp]
+	dec	eax
+db	102,15,56,221,208
+db	102,15,56,221,216
+	lea	esi,[16+esi]
+	xorps	xmm6,xmm2
+	movdqa	xmm2,xmm7
+	movups	[edi],xmm6
+db	102,15,56,0,213
+	lea	edi,[16+edi]
+	jnz	NEAR L$030ccm64_enc_outer
+	mov	esp,DWORD [48+esp]
+	mov	edi,DWORD [40+esp]
+	movups	[edi],xmm3
+	pxor	xmm0,xmm0
+	pxor	xmm1,xmm1
+	pxor	xmm2,xmm2
+	pxor	xmm3,xmm3
+	pxor	xmm4,xmm4
+	pxor	xmm5,xmm5
+	pxor	xmm6,xmm6
+	pxor	xmm7,xmm7
+	pop	edi
+	pop	esi
+	pop	ebx
+	pop	ebp
+	ret
+global	_aesni_ccm64_decrypt_blocks
+align	16
+_aesni_ccm64_decrypt_blocks:
+L$_aesni_ccm64_decrypt_blocks_begin:
+	push	ebp
+	push	ebx
+	push	esi
+	push	edi
+	mov	esi,DWORD [20+esp]
+	mov	edi,DWORD [24+esp]
+	mov	eax,DWORD [28+esp]
+	mov	edx,DWORD [32+esp]
+	mov	ebx,DWORD [36+esp]
+	mov	ecx,DWORD [40+esp]
+	mov	ebp,esp
+	sub	esp,60
+	and	esp,-16
+	mov	DWORD [48+esp],ebp
+	movdqu	xmm7,[ebx]
+	movdqu	xmm3,[ecx]
+	mov	ecx,DWORD [240+edx]
+	mov	DWORD [esp],202182159
+	mov	DWORD [4+esp],134810123
+	mov	DWORD [8+esp],67438087
+	mov	DWORD [12+esp],66051
+	mov	ebx,1
+	xor	ebp,ebp
+	mov	DWORD [16+esp],ebx
+	mov	DWORD [20+esp],ebp
+	mov	DWORD [24+esp],ebp
+	mov	DWORD [28+esp],ebp
+	movdqa	xmm5,[esp]
+	movdqa	xmm2,xmm7
+	mov	ebp,edx
+	mov	ebx,ecx
+db	102,15,56,0,253
+	movups	xmm0,[edx]
+	movups	xmm1,[16+edx]
+	lea	edx,[32+edx]
+	xorps	xmm2,xmm0
+L$032enc1_loop_5:
+db	102,15,56,220,209
+	dec	ecx
+	movups	xmm1,[edx]
+	lea	edx,[16+edx]
+	jnz	NEAR L$032enc1_loop_5
+db	102,15,56,221,209
+	shl	ebx,4
+	mov	ecx,16
+	movups	xmm6,[esi]
+	paddq	xmm7,[16+esp]
+	lea	esi,[16+esi]
+	sub	ecx,ebx
+	lea	edx,[32+ebx*1+ebp]
+	mov	ebx,ecx
+	jmp	NEAR L$033ccm64_dec_outer
+align	16
+L$033ccm64_dec_outer:
+	xorps	xmm6,xmm2
+	movdqa	xmm2,xmm7
+	movups	[edi],xmm6
+	lea	edi,[16+edi]
+db	102,15,56,0,213
+	sub	eax,1
+	jz	NEAR L$034ccm64_dec_break
+	movups	xmm0,[ebp]
+	mov	ecx,ebx
+	movups	xmm1,[16+ebp]
+	xorps	xmm6,xmm0
+	xorps	xmm2,xmm0
+	xorps	xmm3,xmm6
+	movups	xmm0,[32+ebp]
+L$035ccm64_dec2_loop:
+db	102,15,56,220,209
+db	102,15,56,220,217
+	movups	xmm1,[ecx*1+edx]
+	add	ecx,32
+db	102,15,56,220,208
+db	102,15,56,220,216
+	movups	xmm0,[ecx*1+edx-16]
+	jnz	NEAR L$035ccm64_dec2_loop
+	movups	xmm6,[esi]
+	paddq	xmm7,[16+esp]
+db	102,15,56,220,209
+db	102,15,56,220,217
+db	102,15,56,221,208
+db	102,15,56,221,216
+	lea	esi,[16+esi]
+	jmp	NEAR L$033ccm64_dec_outer
+align	16
+L$034ccm64_dec_break:
+	mov	ecx,DWORD [240+ebp]
+	mov	edx,ebp
+	movups	xmm0,[edx]
+	movups	xmm1,[16+edx]
+	xorps	xmm6,xmm0
+	lea	edx,[32+edx]
+	xorps	xmm3,xmm6
+L$036enc1_loop_6:
+db	102,15,56,220,217
+	dec	ecx
+	movups	xmm1,[edx]
+	lea	edx,[16+edx]
+	jnz	NEAR L$036enc1_loop_6
+db	102,15,56,221,217
+	mov	esp,DWORD [48+esp]
+	mov	edi,DWORD [40+esp]
+	movups	[edi],xmm3
+	pxor	xmm0,xmm0
+	pxor	xmm1,xmm1
+	pxor	xmm2,xmm2
+	pxor	xmm3,xmm3
+	pxor	xmm4,xmm4
+	pxor	xmm5,xmm5
+	pxor	xmm6,xmm6
+	pxor	xmm7,xmm7
+	pop	edi
+	pop	esi
+	pop	ebx
+	pop	ebp
+	ret
+global	_aesni_ctr32_encrypt_blocks
+align	16
+_aesni_ctr32_encrypt_blocks:
+L$_aesni_ctr32_encrypt_blocks_begin:
+	push	ebp
+	push	ebx
+	push	esi
+	push	edi
+	mov	esi,DWORD [20+esp]
+	mov	edi,DWORD [24+esp]
+	mov	eax,DWORD [28+esp]
+	mov	edx,DWORD [32+esp]
+	mov	ebx,DWORD [36+esp]
+	mov	ebp,esp
+	sub	esp,88
+	and	esp,-16
+	mov	DWORD [80+esp],ebp
+	cmp	eax,1
+	je	NEAR L$037ctr32_one_shortcut
+	movdqu	xmm7,[ebx]
+	mov	DWORD [esp],202182159
+	mov	DWORD [4+esp],134810123
+	mov	DWORD [8+esp],67438087
+	mov	DWORD [12+esp],66051
+	mov	ecx,6
+	xor	ebp,ebp
+	mov	DWORD [16+esp],ecx
+	mov	DWORD [20+esp],ecx
+	mov	DWORD [24+esp],ecx
+	mov	DWORD [28+esp],ebp
+db	102,15,58,22,251,3
+db	102,15,58,34,253,3
+	mov	ecx,DWORD [240+edx]
+	bswap	ebx
+	pxor	xmm0,xmm0
+	pxor	xmm1,xmm1
+	movdqa	xmm2,[esp]
+db	102,15,58,34,195,0
+	lea	ebp,[3+ebx]
+db	102,15,58,34,205,0
+	inc	ebx
+db	102,15,58,34,195,1
+	inc	ebp
+db	102,15,58,34,205,1
+	inc	ebx
+db	102,15,58,34,195,2
+	inc	ebp
+db	102,15,58,34,205,2
+	movdqa	[48+esp],xmm0
+db	102,15,56,0,194
+	movdqu	xmm6,[edx]
+	movdqa	[64+esp],xmm1
+db	102,15,56,0,202
+	pshufd	xmm2,xmm0,192
+	pshufd	xmm3,xmm0,128
+	cmp	eax,6
+	jb	NEAR L$038ctr32_tail
+	pxor	xmm7,xmm6
+	shl	ecx,4
+	mov	ebx,16
+	movdqa	[32+esp],xmm7
+	mov	ebp,edx
+	sub	ebx,ecx
+	lea	edx,[32+ecx*1+edx]
+	sub	eax,6
+	jmp	NEAR L$039ctr32_loop6
+align	16
+L$039ctr32_loop6:
+	pshufd	xmm4,xmm0,64
+	movdqa	xmm0,[32+esp]
+	pshufd	xmm5,xmm1,192
+	pxor	xmm2,xmm0
+	pshufd	xmm6,xmm1,128
+	pxor	xmm3,xmm0
+	pshufd	xmm7,xmm1,64
+	movups	xmm1,[16+ebp]
+	pxor	xmm4,xmm0
+	pxor	xmm5,xmm0
+db	102,15,56,220,209
+	pxor	xmm6,xmm0
+	pxor	xmm7,xmm0
+db	102,15,56,220,217
+	movups	xmm0,[32+ebp]
+	mov	ecx,ebx
+db	102,15,56,220,225
+db	102,15,56,220,233
+db	102,15,56,220,241
+db	102,15,56,220,249
+	call	L$_aesni_encrypt6_enter
+	movups	xmm1,[esi]
+	movups	xmm0,[16+esi]
+	xorps	xmm2,xmm1
+	movups	xmm1,[32+esi]
+	xorps	xmm3,xmm0
+	movups	[edi],xmm2
+	movdqa	xmm0,[16+esp]
+	xorps	xmm4,xmm1
+	movdqa	xmm1,[64+esp]
+	movups	[16+edi],xmm3
+	movups	[32+edi],xmm4
+	paddd	xmm1,xmm0
+	paddd	xmm0,[48+esp]
+	movdqa	xmm2,[esp]
+	movups	xmm3,[48+esi]
+	movups	xmm4,[64+esi]
+	xorps	xmm5,xmm3
+	movups	xmm3,[80+esi]
+	lea	esi,[96+esi]
+	movdqa	[48+esp],xmm0
+db	102,15,56,0,194
+	xorps	xmm6,xmm4
+	movups	[48+edi],xmm5
+	xorps	xmm7,xmm3
+	movdqa	[64+esp],xmm1
+db	102,15,56,0,202
+	movups	[64+edi],xmm6
+	pshufd	xmm2,xmm0,192
+	movups	[80+edi],xmm7
+	lea	edi,[96+edi]
+	pshufd	xmm3,xmm0,128
+	sub	eax,6
+	jnc	NEAR L$039ctr32_loop6
+	add	eax,6
+	jz	NEAR L$040ctr32_ret
+	movdqu	xmm7,[ebp]
+	mov	edx,ebp
+	pxor	xmm7,[32+esp]
+	mov	ecx,DWORD [240+ebp]
+L$038ctr32_tail:
+	por	xmm2,xmm7
+	cmp	eax,2
+	jb	NEAR L$041ctr32_one
+	pshufd	xmm4,xmm0,64
+	por	xmm3,xmm7
+	je	NEAR L$042ctr32_two
+	pshufd	xmm5,xmm1,192
+	por	xmm4,xmm7
+	cmp	eax,4
+	jb	NEAR L$043ctr32_three
+	pshufd	xmm6,xmm1,128
+	por	xmm5,xmm7
+	je	NEAR L$044ctr32_four
+	por	xmm6,xmm7
+	call	__aesni_encrypt6
+	movups	xmm1,[esi]
+	movups	xmm0,[16+esi]
+	xorps	xmm2,xmm1
+	movups	xmm1,[32+esi]
+	xorps	xmm3,xmm0
+	movups	xmm0,[48+esi]
+	xorps	xmm4,xmm1
+	movups	xmm1,[64+esi]
+	xorps	xmm5,xmm0
+	movups	[edi],xmm2
+	xorps	xmm6,xmm1
+	movups	[16+edi],xmm3
+	movups	[32+edi],xmm4
+	movups	[48+edi],xmm5
+	movups	[64+edi],xmm6
+	jmp	NEAR L$040ctr32_ret
+align	16
+L$037ctr32_one_shortcut:
+	movups	xmm2,[ebx]
+	mov	ecx,DWORD [240+edx]
+L$041ctr32_one:
+	movups	xmm0,[edx]
+	movups	xmm1,[16+edx]
+	lea	edx,[32+edx]
+	xorps	xmm2,xmm0
+L$045enc1_loop_7:
+db	102,15,56,220,209
+	dec	ecx
+	movups	xmm1,[edx]
+	lea	edx,[16+edx]
+	jnz	NEAR L$045enc1_loop_7
+db	102,15,56,221,209
+	movups	xmm6,[esi]
+	xorps	xmm6,xmm2
+	movups	[edi],xmm6
+	jmp	NEAR L$040ctr32_ret
+align	16
+L$042ctr32_two:
+	call	__aesni_encrypt2
+	movups	xmm5,[esi]
+	movups	xmm6,[16+esi]
+	xorps	xmm2,xmm5
+	xorps	xmm3,xmm6
+	movups	[edi],xmm2
+	movups	[16+edi],xmm3
+	jmp	NEAR L$040ctr32_ret
+align	16
+L$043ctr32_three:
+	call	__aesni_encrypt3
+	movups	xmm5,[esi]
+	movups	xmm6,[16+esi]
+	xorps	xmm2,xmm5
+	movups	xmm7,[32+esi]
+	xorps	xmm3,xmm6
+	movups	[edi],xmm2
+	xorps	xmm4,xmm7
+	movups	[16+edi],xmm3
+	movups	[32+edi],xmm4
+	jmp	NEAR L$040ctr32_ret
+align	16
+L$044ctr32_four:
+	call	__aesni_encrypt4
+	movups	xmm6,[esi]
+	movups	xmm7,[16+esi]
+	movups	xmm1,[32+esi]
+	xorps	xmm2,xmm6
+	movups	xmm0,[48+esi]
+	xorps	xmm3,xmm7
+	movups	[edi],xmm2
+	xorps	xmm4,xmm1
+	movups	[16+edi],xmm3
+	xorps	xmm5,xmm0
+	movups	[32+edi],xmm4
+	movups	[48+edi],xmm5
+L$040ctr32_ret:
+	pxor	xmm0,xmm0
+	pxor	xmm1,xmm1
+	pxor	xmm2,xmm2
+	pxor	xmm3,xmm3
+	pxor	xmm4,xmm4
+	movdqa	[32+esp],xmm0
+	pxor	xmm5,xmm5
+	movdqa	[48+esp],xmm0
+	pxor	xmm6,xmm6
+	movdqa	[64+esp],xmm0
+	pxor	xmm7,xmm7
+	mov	esp,DWORD [80+esp]
+	pop	edi
+	pop	esi
+	pop	ebx
+	pop	ebp
+	ret
+global	_aesni_xts_encrypt
+align	16
+_aesni_xts_encrypt:
+L$_aesni_xts_encrypt_begin:
+	push	ebp
+	push	ebx
+	push	esi
+	push	edi
+	mov	edx,DWORD [36+esp]
+	mov	esi,DWORD [40+esp]
+	mov	ecx,DWORD [240+edx]
+	movups	xmm2,[esi]
+	movups	xmm0,[edx]
+	movups	xmm1,[16+edx]
+	lea	edx,[32+edx]
+	xorps	xmm2,xmm0
+L$046enc1_loop_8:
+db	102,15,56,220,209
+	dec	ecx
+	movups	xmm1,[edx]
+	lea	edx,[16+edx]
+	jnz	NEAR L$046enc1_loop_8
+db	102,15,56,221,209
+	mov	esi,DWORD [20+esp]
+	mov	edi,DWORD [24+esp]
+	mov	eax,DWORD [28+esp]
+	mov	edx,DWORD [32+esp]
+	mov	ebp,esp
+	sub	esp,120
+	mov	ecx,DWORD [240+edx]
+	and	esp,-16
+	mov	DWORD [96+esp],135
+	mov	DWORD [100+esp],0
+	mov	DWORD [104+esp],1
+	mov	DWORD [108+esp],0
+	mov	DWORD [112+esp],eax
+	mov	DWORD [116+esp],ebp
+	movdqa	xmm1,xmm2
+	pxor	xmm0,xmm0
+	movdqa	xmm3,[96+esp]
+	pcmpgtd	xmm0,xmm1
+	and	eax,-16
+	mov	ebp,edx
+	mov	ebx,ecx
+	sub	eax,96
+	jc	NEAR L$047xts_enc_short
+	shl	ecx,4
+	mov	ebx,16
+	sub	ebx,ecx
+	lea	edx,[32+ecx*1+edx]
+	jmp	NEAR L$048xts_enc_loop6
+align	16
+L$048xts_enc_loop6:
+	pshufd	xmm2,xmm0,19
+	pxor	xmm0,xmm0
+	movdqa	[esp],xmm1
+	paddq	xmm1,xmm1
+	pand	xmm2,xmm3
+	pcmpgtd	xmm0,xmm1
+	pxor	xmm1,xmm2
+	pshufd	xmm2,xmm0,19
+	pxor	xmm0,xmm0
+	movdqa	[16+esp],xmm1
+	paddq	xmm1,xmm1
+	pand	xmm2,xmm3
+	pcmpgtd	xmm0,xmm1
+	pxor	xmm1,xmm2
+	pshufd	xmm2,xmm0,19
+	pxor	xmm0,xmm0
+	movdqa	[32+esp],xmm1
+	paddq	xmm1,xmm1
+	pand	xmm2,xmm3
+	pcmpgtd	xmm0,xmm1
+	pxor	xmm1,xmm2
+	pshufd	xmm2,xmm0,19
+	pxor	xmm0,xmm0
+	movdqa	[48+esp],xmm1
+	paddq	xmm1,xmm1
+	pand	xmm2,xmm3
+	pcmpgtd	xmm0,xmm1
+	pxor	xmm1,xmm2
+	pshufd	xmm7,xmm0,19
+	movdqa	[64+esp],xmm1
+	paddq	xmm1,xmm1
+	movups	xmm0,[ebp]
+	pand	xmm7,xmm3
+	movups	xmm2,[esi]
+	pxor	xmm7,xmm1
+	mov	ecx,ebx
+	movdqu	xmm3,[16+esi]
+	xorps	xmm2,xmm0
+	movdqu	xmm4,[32+esi]
+	pxor	xmm3,xmm0
+	movdqu	xmm5,[48+esi]
+	pxor	xmm4,xmm0
+	movdqu	xmm6,[64+esi]
+	pxor	xmm5,xmm0
+	movdqu	xmm1,[80+esi]
+	pxor	xmm6,xmm0
+	lea	esi,[96+esi]
+	pxor	xmm2,[esp]
+	movdqa	[80+esp],xmm7
+	pxor	xmm7,xmm1
+	movups	xmm1,[16+ebp]
+	pxor	xmm3,[16+esp]
+	pxor	xmm4,[32+esp]
+db	102,15,56,220,209
+	pxor	xmm5,[48+esp]
+	pxor	xmm6,[64+esp]
+db	102,15,56,220,217
+	pxor	xmm7,xmm0
+	movups	xmm0,[32+ebp]
+db	102,15,56,220,225
+db	102,15,56,220,233
+db	102,15,56,220,241
+db	102,15,56,220,249
+	call	L$_aesni_encrypt6_enter
+	movdqa	xmm1,[80+esp]
+	pxor	xmm0,xmm0
+	xorps	xmm2,[esp]
+	pcmpgtd	xmm0,xmm1
+	xorps	xmm3,[16+esp]
+	movups	[edi],xmm2
+	xorps	xmm4,[32+esp]
+	movups	[16+edi],xmm3
+	xorps	xmm5,[48+esp]
+	movups	[32+edi],xmm4
+	xorps	xmm6,[64+esp]
+	movups	[48+edi],xmm5
+	xorps	xmm7,xmm1
+	movups	[64+edi],xmm6
+	pshufd	xmm2,xmm0,19
+	movups	[80+edi],xmm7
+	lea	edi,[96+edi]
+	movdqa	xmm3,[96+esp]
+	pxor	xmm0,xmm0
+	paddq	xmm1,xmm1
+	pand	xmm2,xmm3
+	pcmpgtd	xmm0,xmm1
+	pxor	xmm1,xmm2
+	sub	eax,96
+	jnc	NEAR L$048xts_enc_loop6
+	mov	ecx,DWORD [240+ebp]
+	mov	edx,ebp
+	mov	ebx,ecx
+L$047xts_enc_short:
+	add	eax,96
+	jz	NEAR L$049xts_enc_done6x
+	movdqa	xmm5,xmm1
+	cmp	eax,32
+	jb	NEAR L$050xts_enc_one
+	pshufd	xmm2,xmm0,19
+	pxor	xmm0,xmm0
+	paddq	xmm1,xmm1
+	pand	xmm2,xmm3
+	pcmpgtd	xmm0,xmm1
+	pxor	xmm1,xmm2
+	je	NEAR L$051xts_enc_two
+	pshufd	xmm2,xmm0,19
+	pxor	xmm0,xmm0
+	movdqa	xmm6,xmm1
+	paddq	xmm1,xmm1
+	pand	xmm2,xmm3
+	pcmpgtd	xmm0,xmm1
+	pxor	xmm1,xmm2
+	cmp	eax,64
+	jb	NEAR L$052xts_enc_three
+	pshufd	xmm2,xmm0,19
+	pxor	xmm0,xmm0
+	movdqa	xmm7,xmm1
+	paddq	xmm1,xmm1
+	pand	xmm2,xmm3
+	pcmpgtd	xmm0,xmm1
+	pxor	xmm1,xmm2
+	movdqa	[esp],xmm5
+	movdqa	[16+esp],xmm6
+	je	NEAR L$053xts_enc_four
+	movdqa	[32+esp],xmm7
+	pshufd	xmm7,xmm0,19
+	movdqa	[48+esp],xmm1
+	paddq	xmm1,xmm1
+	pand	xmm7,xmm3
+	pxor	xmm7,xmm1
+	movdqu	xmm2,[esi]
+	movdqu	xmm3,[16+esi]
+	movdqu	xmm4,[32+esi]
+	pxor	xmm2,[esp]
+	movdqu	xmm5,[48+esi]
+	pxor	xmm3,[16+esp]
+	movdqu	xmm6,[64+esi]
+	pxor	xmm4,[32+esp]
+	lea	esi,[80+esi]
+	pxor	xmm5,[48+esp]
+	movdqa	[64+esp],xmm7
+	pxor	xmm6,xmm7
+	call	__aesni_encrypt6
+	movaps	xmm1,[64+esp]
+	xorps	xmm2,[esp]
+	xorps	xmm3,[16+esp]
+	xorps	xmm4,[32+esp]
+	movups	[edi],xmm2
+	xorps	xmm5,[48+esp]
+	movups	[16+edi],xmm3
+	xorps	xmm6,xmm1
+	movups	[32+edi],xmm4
+	movups	[48+edi],xmm5
+	movups	[64+edi],xmm6
+	lea	edi,[80+edi]
+	jmp	NEAR L$054xts_enc_done
+align	16
+L$050xts_enc_one:
+	movups	xmm2,[esi]
+	lea	esi,[16+esi]
+	xorps	xmm2,xmm5
+	movups	xmm0,[edx]
+	movups	xmm1,[16+edx]
+	lea	edx,[32+edx]
+	xorps	xmm2,xmm0
+L$055enc1_loop_9:
+db	102,15,56,220,209
+	dec	ecx
+	movups	xmm1,[edx]
+	lea	edx,[16+edx]
+	jnz	NEAR L$055enc1_loop_9
+db	102,15,56,221,209
+	xorps	xmm2,xmm5
+	movups	[edi],xmm2
+	lea	edi,[16+edi]
+	movdqa	xmm1,xmm5
+	jmp	NEAR L$054xts_enc_done
+align	16
+L$051xts_enc_two:
+	movaps	xmm6,xmm1
+	movups	xmm2,[esi]
+	movups	xmm3,[16+esi]
+	lea	esi,[32+esi]
+	xorps	xmm2,xmm5
+	xorps	xmm3,xmm6
+	call	__aesni_encrypt2
+	xorps	xmm2,xmm5
+	xorps	xmm3,xmm6
+	movups	[edi],xmm2
+	movups	[16+edi],xmm3
+	lea	edi,[32+edi]
+	movdqa	xmm1,xmm6
+	jmp	NEAR L$054xts_enc_done
+align	16
+L$052xts_enc_three:
+	movaps	xmm7,xmm1
+	movups	xmm2,[esi]
+	movups	xmm3,[16+esi]
+	movups	xmm4,[32+esi]
+	lea	esi,[48+esi]
+	xorps	xmm2,xmm5
+	xorps	xmm3,xmm6
+	xorps	xmm4,xmm7
+	call	__aesni_encrypt3
+	xorps	xmm2,xmm5
+	xorps	xmm3,xmm6
+	xorps	xmm4,xmm7
+	movups	[edi],xmm2
+	movups	[16+edi],xmm3
+	movups	[32+edi],xmm4
+	lea	edi,[48+edi]
+	movdqa	xmm1,xmm7
+	jmp	NEAR L$054xts_enc_done
+align	16
+L$053xts_enc_four:
+	movaps	xmm6,xmm1
+	movups	xmm2,[esi]
+	movups	xmm3,[16+esi]
+	movups	xmm4,[32+esi]
+	xorps	xmm2,[esp]
+	movups	xmm5,[48+esi]
+	lea	esi,[64+esi]
+	xorps	xmm3,[16+esp]
+	xorps	xmm4,xmm7
+	xorps	xmm5,xmm6
+	call	__aesni_encrypt4
+	xorps	xmm2,[esp]
+	xorps	xmm3,[16+esp]
+	xorps	xmm4,xmm7
+	movups	[edi],xmm2
+	xorps	xmm5,xmm6
+	movups	[16+edi],xmm3
+	movups	[32+edi],xmm4
+	movups	[48+edi],xmm5
+	lea	edi,[64+edi]
+	movdqa	xmm1,xmm6
+	jmp	NEAR L$054xts_enc_done
+align	16
+L$049xts_enc_done6x:
+	mov	eax,DWORD [112+esp]
+	and	eax,15
+	jz	NEAR L$056xts_enc_ret
+	movdqa	xmm5,xmm1
+	mov	DWORD [112+esp],eax
+	jmp	NEAR L$057xts_enc_steal
+align	16
+L$054xts_enc_done:
+	mov	eax,DWORD [112+esp]
+	pxor	xmm0,xmm0
+	and	eax,15
+	jz	NEAR L$056xts_enc_ret
+	pcmpgtd	xmm0,xmm1
+	mov	DWORD [112+esp],eax
+	pshufd	xmm5,xmm0,19
+	paddq	xmm1,xmm1
+	pand	xmm5,[96+esp]
+	pxor	xmm5,xmm1
+L$057xts_enc_steal:
+	movzx	ecx,BYTE [esi]
+	movzx	edx,BYTE [edi-16]
+	lea	esi,[1+esi]
+	mov	BYTE [edi-16],cl
+	mov	BYTE [edi],dl
+	lea	edi,[1+edi]
+	sub	eax,1
+	jnz	NEAR L$057xts_enc_steal
+	sub	edi,DWORD [112+esp]
+	mov	edx,ebp
+	mov	ecx,ebx
+	movups	xmm2,[edi-16]
+	xorps	xmm2,xmm5
+	movups	xmm0,[edx]
+	movups	xmm1,[16+edx]
+	lea	edx,[32+edx]
+	xorps	xmm2,xmm0
+L$058enc1_loop_10:
+db	102,15,56,220,209
+	dec	ecx
+	movups	xmm1,[edx]
+	lea	edx,[16+edx]
+	jnz	NEAR L$058enc1_loop_10
+db	102,15,56,221,209
+	xorps	xmm2,xmm5
+	movups	[edi-16],xmm2
+L$056xts_enc_ret:
+	pxor	xmm0,xmm0
+	pxor	xmm1,xmm1
+	pxor	xmm2,xmm2
+	movdqa	[esp],xmm0
+	pxor	xmm3,xmm3
+	movdqa	[16+esp],xmm0
+	pxor	xmm4,xmm4
+	movdqa	[32+esp],xmm0
+	pxor	xmm5,xmm5
+	movdqa	[48+esp],xmm0
+	pxor	xmm6,xmm6
+	movdqa	[64+esp],xmm0
+	pxor	xmm7,xmm7
+	movdqa	[80+esp],xmm0
+	mov	esp,DWORD [116+esp]
+	pop	edi
+	pop	esi
+	pop	ebx
+	pop	ebp
+	ret
+global	_aesni_xts_decrypt
+align	16
+_aesni_xts_decrypt:
+L$_aesni_xts_decrypt_begin:
+	push	ebp
+	push	ebx
+	push	esi
+	push	edi
+	mov	edx,DWORD [36+esp]
+	mov	esi,DWORD [40+esp]
+	mov	ecx,DWORD [240+edx]
+	movups	xmm2,[esi]
+	movups	xmm0,[edx]
+	movups	xmm1,[16+edx]
+	lea	edx,[32+edx]
+	xorps	xmm2,xmm0
+L$059enc1_loop_11:
+db	102,15,56,220,209
+	dec	ecx
+	movups	xmm1,[edx]
+	lea	edx,[16+edx]
+	jnz	NEAR L$059enc1_loop_11
+db	102,15,56,221,209
+	mov	esi,DWORD [20+esp]
+	mov	edi,DWORD [24+esp]
+	mov	eax,DWORD [28+esp]
+	mov	edx,DWORD [32+esp]
+	mov	ebp,esp
+	sub	esp,120
+	and	esp,-16
+	xor	ebx,ebx
+	test	eax,15
+	setnz	bl
+	shl	ebx,4
+	sub	eax,ebx
+	mov	DWORD [96+esp],135
+	mov	DWORD [100+esp],0
+	mov	DWORD [104+esp],1
+	mov	DWORD [108+esp],0
+	mov	DWORD [112+esp],eax
+	mov	DWORD [116+esp],ebp
+	mov	ecx,DWORD [240+edx]
+	mov	ebp,edx
+	mov	ebx,ecx
+	movdqa	xmm1,xmm2
+	pxor	xmm0,xmm0
+	movdqa	xmm3,[96+esp]
+	pcmpgtd	xmm0,xmm1
+	and	eax,-16
+	sub	eax,96
+	jc	NEAR L$060xts_dec_short
+	shl	ecx,4
+	mov	ebx,16
+	sub	ebx,ecx
+	lea	edx,[32+ecx*1+edx]
+	jmp	NEAR L$061xts_dec_loop6
+align	16
+L$061xts_dec_loop6:
+	pshufd	xmm2,xmm0,19
+	pxor	xmm0,xmm0
+	movdqa	[esp],xmm1
+	paddq	xmm1,xmm1
+	pand	xmm2,xmm3
+	pcmpgtd	xmm0,xmm1
+	pxor	xmm1,xmm2
+	pshufd	xmm2,xmm0,19
+	pxor	xmm0,xmm0
+	movdqa	[16+esp],xmm1
+	paddq	xmm1,xmm1
+	pand	xmm2,xmm3
+	pcmpgtd	xmm0,xmm1
+	pxor	xmm1,xmm2
+	pshufd	xmm2,xmm0,19
+	pxor	xmm0,xmm0
+	movdqa	[32+esp],xmm1
+	paddq	xmm1,xmm1
+	pand	xmm2,xmm3
+	pcmpgtd	xmm0,xmm1
+	pxor	xmm1,xmm2
+	pshufd	xmm2,xmm0,19
+	pxor	xmm0,xmm0
+	movdqa	[48+esp],xmm1
+	paddq	xmm1,xmm1
+	pand	xmm2,xmm3
+	pcmpgtd	xmm0,xmm1
+	pxor	xmm1,xmm2
+	pshufd	xmm7,xmm0,19
+	movdqa	[64+esp],xmm1
+	paddq	xmm1,xmm1
+	movups	xmm0,[ebp]
+	pand	xmm7,xmm3
+	movups	xmm2,[esi]
+	pxor	xmm7,xmm1
+	mov	ecx,ebx
+	movdqu	xmm3,[16+esi]
+	xorps	xmm2,xmm0
+	movdqu	xmm4,[32+esi]
+	pxor	xmm3,xmm0
+	movdqu	xmm5,[48+esi]
+	pxor	xmm4,xmm0
+	movdqu	xmm6,[64+esi]
+	pxor	xmm5,xmm0
+	movdqu	xmm1,[80+esi]
+	pxor	xmm6,xmm0
+	lea	esi,[96+esi]
+	pxor	xmm2,[esp]
+	movdqa	[80+esp],xmm7
+	pxor	xmm7,xmm1
+	movups	xmm1,[16+ebp]
+	pxor	xmm3,[16+esp]
+	pxor	xmm4,[32+esp]
+db	102,15,56,222,209
+	pxor	xmm5,[48+esp]
+	pxor	xmm6,[64+esp]
+db	102,15,56,222,217
+	pxor	xmm7,xmm0
+	movups	xmm0,[32+ebp]
+db	102,15,56,222,225
+db	102,15,56,222,233
+db	102,15,56,222,241
+db	102,15,56,222,249
+	call	L$_aesni_decrypt6_enter
+	movdqa	xmm1,[80+esp]
+	pxor	xmm0,xmm0
+	xorps	xmm2,[esp]
+	pcmpgtd	xmm0,xmm1
+	xorps	xmm3,[16+esp]
+	movups	[edi],xmm2
+	xorps	xmm4,[32+esp]
+	movups	[16+edi],xmm3
+	xorps	xmm5,[48+esp]
+	movups	[32+edi],xmm4
+	xorps	xmm6,[64+esp]
+	movups	[48+edi],xmm5
+	xorps	xmm7,xmm1
+	movups	[64+edi],xmm6
+	pshufd	xmm2,xmm0,19
+	movups	[80+edi],xmm7
+	lea	edi,[96+edi]
+	movdqa	xmm3,[96+esp]
+	pxor	xmm0,xmm0
+	paddq	xmm1,xmm1
+	pand	xmm2,xmm3
+	pcmpgtd	xmm0,xmm1
+	pxor	xmm1,xmm2
+	sub	eax,96
+	jnc	NEAR L$061xts_dec_loop6
+	mov	ecx,DWORD [240+ebp]
+	mov	edx,ebp
+	mov	ebx,ecx
+L$060xts_dec_short:
+	add	eax,96
+	jz	NEAR L$062xts_dec_done6x
+	movdqa	xmm5,xmm1
+	cmp	eax,32
+	jb	NEAR L$063xts_dec_one
+	pshufd	xmm2,xmm0,19
+	pxor	xmm0,xmm0
+	paddq	xmm1,xmm1
+	pand	xmm2,xmm3
+	pcmpgtd	xmm0,xmm1
+	pxor	xmm1,xmm2
+	je	NEAR L$064xts_dec_two
+	pshufd	xmm2,xmm0,19
+	pxor	xmm0,xmm0
+	movdqa	xmm6,xmm1
+	paddq	xmm1,xmm1
+	pand	xmm2,xmm3
+	pcmpgtd	xmm0,xmm1
+	pxor	xmm1,xmm2
+	cmp	eax,64
+	jb	NEAR L$065xts_dec_three
+	pshufd	xmm2,xmm0,19
+	pxor	xmm0,xmm0
+	movdqa	xmm7,xmm1
+	paddq	xmm1,xmm1
+	pand	xmm2,xmm3
+	pcmpgtd	xmm0,xmm1
+	pxor	xmm1,xmm2
+	movdqa	[esp],xmm5
+	movdqa	[16+esp],xmm6
+	je	NEAR L$066xts_dec_four
+	movdqa	[32+esp],xmm7
+	pshufd	xmm7,xmm0,19
+	movdqa	[48+esp],xmm1
+	paddq	xmm1,xmm1
+	pand	xmm7,xmm3
+	pxor	xmm7,xmm1
+	movdqu	xmm2,[esi]
+	movdqu	xmm3,[16+esi]
+	movdqu	xmm4,[32+esi]
+	pxor	xmm2,[esp]
+	movdqu	xmm5,[48+esi]
+	pxor	xmm3,[16+esp]
+	movdqu	xmm6,[64+esi]
+	pxor	xmm4,[32+esp]
+	lea	esi,[80+esi]
+	pxor	xmm5,[48+esp]
+	movdqa	[64+esp],xmm7
+	pxor	xmm6,xmm7
+	call	__aesni_decrypt6
+	movaps	xmm1,[64+esp]
+	xorps	xmm2,[esp]
+	xorps	xmm3,[16+esp]
+	xorps	xmm4,[32+esp]
+	movups	[edi],xmm2
+	xorps	xmm5,[48+esp]
+	movups	[16+edi],xmm3
+	xorps	xmm6,xmm1
+	movups	[32+edi],xmm4
+	movups	[48+edi],xmm5
+	movups	[64+edi],xmm6
+	lea	edi,[80+edi]
+	jmp	NEAR L$067xts_dec_done
+align	16
+L$063xts_dec_one:
+	movups	xmm2,[esi]
+	lea	esi,[16+esi]
+	xorps	xmm2,xmm5
+	movups	xmm0,[edx]
+	movups	xmm1,[16+edx]
+	lea	edx,[32+edx]
+	xorps	xmm2,xmm0
+L$068dec1_loop_12:
+db	102,15,56,222,209
+	dec	ecx
+	movups	xmm1,[edx]
+	lea	edx,[16+edx]
+	jnz	NEAR L$068dec1_loop_12
+db	102,15,56,223,209
+	xorps	xmm2,xmm5
+	movups	[edi],xmm2
+	lea	edi,[16+edi]
+	movdqa	xmm1,xmm5
+	jmp	NEAR L$067xts_dec_done
+align	16
+L$064xts_dec_two:
+	movaps	xmm6,xmm1
+	movups	xmm2,[esi]
+	movups	xmm3,[16+esi]
+	lea	esi,[32+esi]
+	xorps	xmm2,xmm5
+	xorps	xmm3,xmm6
+	call	__aesni_decrypt2
+	xorps	xmm2,xmm5
+	xorps	xmm3,xmm6
+	movups	[edi],xmm2
+	movups	[16+edi],xmm3
+	lea	edi,[32+edi]
+	movdqa	xmm1,xmm6
+	jmp	NEAR L$067xts_dec_done
+align	16
+L$065xts_dec_three:
+	movaps	xmm7,xmm1
+	movups	xmm2,[esi]
+	movups	xmm3,[16+esi]
+	movups	xmm4,[32+esi]
+	lea	esi,[48+esi]
+	xorps	xmm2,xmm5
+	xorps	xmm3,xmm6
+	xorps	xmm4,xmm7
+	call	__aesni_decrypt3
+	xorps	xmm2,xmm5
+	xorps	xmm3,xmm6
+	xorps	xmm4,xmm7
+	movups	[edi],xmm2
+	movups	[16+edi],xmm3
+	movups	[32+edi],xmm4
+	lea	edi,[48+edi]
+	movdqa	xmm1,xmm7
+	jmp	NEAR L$067xts_dec_done
+align	16
+L$066xts_dec_four:
+	movaps	xmm6,xmm1
+	movups	xmm2,[esi]
+	movups	xmm3,[16+esi]
+	movups	xmm4,[32+esi]
+	xorps	xmm2,[esp]
+	movups	xmm5,[48+esi]
+	lea	esi,[64+esi]
+	xorps	xmm3,[16+esp]
+	xorps	xmm4,xmm7
+	xorps	xmm5,xmm6
+	call	__aesni_decrypt4
+	xorps	xmm2,[esp]
+	xorps	xmm3,[16+esp]
+	xorps	xmm4,xmm7
+	movups	[edi],xmm2
+	xorps	xmm5,xmm6
+	movups	[16+edi],xmm3
+	movups	[32+edi],xmm4
+	movups	[48+edi],xmm5
+	lea	edi,[64+edi]
+	movdqa	xmm1,xmm6
+	jmp	NEAR L$067xts_dec_done
+align	16
+L$062xts_dec_done6x:
+	mov	eax,DWORD [112+esp]
+	and	eax,15
+	jz	NEAR L$069xts_dec_ret
+	mov	DWORD [112+esp],eax
+	jmp	NEAR L$070xts_dec_only_one_more
+align	16
+L$067xts_dec_done:
+	mov	eax,DWORD [112+esp]
+	pxor	xmm0,xmm0
+	and	eax,15
+	jz	NEAR L$069xts_dec_ret
+	pcmpgtd	xmm0,xmm1
+	mov	DWORD [112+esp],eax
+	pshufd	xmm2,xmm0,19
+	pxor	xmm0,xmm0
+	movdqa	xmm3,[96+esp]
+	paddq	xmm1,xmm1
+	pand	xmm2,xmm3
+	pcmpgtd	xmm0,xmm1
+	pxor	xmm1,xmm2
+L$070xts_dec_only_one_more:
+	pshufd	xmm5,xmm0,19
+	movdqa	xmm6,xmm1
+	paddq	xmm1,xmm1
+	pand	xmm5,xmm3
+	pxor	xmm5,xmm1
+	mov	edx,ebp
+	mov	ecx,ebx
+	movups	xmm2,[esi]
+	xorps	xmm2,xmm5
+	movups	xmm0,[edx]
+	movups	xmm1,[16+edx]
+	lea	edx,[32+edx]
+	xorps	xmm2,xmm0
+L$071dec1_loop_13:
+db	102,15,56,222,209
+	dec	ecx
+	movups	xmm1,[edx]
+	lea	edx,[16+edx]
+	jnz	NEAR L$071dec1_loop_13
+db	102,15,56,223,209
+	xorps	xmm2,xmm5
+	movups	[edi],xmm2
+L$072xts_dec_steal:
+	movzx	ecx,BYTE [16+esi]
+	movzx	edx,BYTE [edi]
+	lea	esi,[1+esi]
+	mov	BYTE [edi],cl
+	mov	BYTE [16+edi],dl
+	lea	edi,[1+edi]
+	sub	eax,1
+	jnz	NEAR L$072xts_dec_steal
+	sub	edi,DWORD [112+esp]
+	mov	edx,ebp
+	mov	ecx,ebx
+	movups	xmm2,[edi]
+	xorps	xmm2,xmm6
+	movups	xmm0,[edx]
+	movups	xmm1,[16+edx]
+	lea	edx,[32+edx]
+	xorps	xmm2,xmm0
+L$073dec1_loop_14:
+db	102,15,56,222,209
+	dec	ecx
+	movups	xmm1,[edx]
+	lea	edx,[16+edx]
+	jnz	NEAR L$073dec1_loop_14
+db	102,15,56,223,209
+	xorps	xmm2,xmm6
+	movups	[edi],xmm2
+L$069xts_dec_ret:
+	pxor	xmm0,xmm0
+	pxor	xmm1,xmm1
+	pxor	xmm2,xmm2
+	movdqa	[esp],xmm0
+	pxor	xmm3,xmm3
+	movdqa	[16+esp],xmm0
+	pxor	xmm4,xmm4
+	movdqa	[32+esp],xmm0
+	pxor	xmm5,xmm5
+	movdqa	[48+esp],xmm0
+	pxor	xmm6,xmm6
+	movdqa	[64+esp],xmm0
+	pxor	xmm7,xmm7
+	movdqa	[80+esp],xmm0
+	mov	esp,DWORD [116+esp]
+	pop	edi
+	pop	esi
+	pop	ebx
+	pop	ebp
+	ret
+global	_aesni_cbc_encrypt
+align	16
+_aesni_cbc_encrypt:
+L$_aesni_cbc_encrypt_begin:
+	push	ebp
+	push	ebx
+	push	esi
+	push	edi
+	mov	esi,DWORD [20+esp]
+	mov	ebx,esp
+	mov	edi,DWORD [24+esp]
+	sub	ebx,24
+	mov	eax,DWORD [28+esp]
+	and	ebx,-16
+	mov	edx,DWORD [32+esp]
+	mov	ebp,DWORD [36+esp]
+	test	eax,eax
+	jz	NEAR L$074cbc_abort
+	cmp	DWORD [40+esp],0
+	xchg	ebx,esp
+	movups	xmm7,[ebp]
+	mov	ecx,DWORD [240+edx]
+	mov	ebp,edx
+	mov	DWORD [16+esp],ebx
+	mov	ebx,ecx
+	je	NEAR L$075cbc_decrypt
+	movaps	xmm2,xmm7
+	cmp	eax,16
+	jb	NEAR L$076cbc_enc_tail
+	sub	eax,16
+	jmp	NEAR L$077cbc_enc_loop
+align	16
+L$077cbc_enc_loop:
+	movups	xmm7,[esi]
+	lea	esi,[16+esi]
+	movups	xmm0,[edx]
+	movups	xmm1,[16+edx]
+	xorps	xmm7,xmm0
+	lea	edx,[32+edx]
+	xorps	xmm2,xmm7
+L$078enc1_loop_15:
+db	102,15,56,220,209
+	dec	ecx
+	movups	xmm1,[edx]
+	lea	edx,[16+edx]
+	jnz	NEAR L$078enc1_loop_15
+db	102,15,56,221,209
+	mov	ecx,ebx
+	mov	edx,ebp
+	movups	[edi],xmm2
+	lea	edi,[16+edi]
+	sub	eax,16
+	jnc	NEAR L$077cbc_enc_loop
+	add	eax,16
+	jnz	NEAR L$076cbc_enc_tail
+	movaps	xmm7,xmm2
+	pxor	xmm2,xmm2
+	jmp	NEAR L$079cbc_ret
+L$076cbc_enc_tail:
+	mov	ecx,eax
+dd	2767451785
+	mov	ecx,16
+	sub	ecx,eax
+	xor	eax,eax
+dd	2868115081
+	lea	edi,[edi-16]
+	mov	ecx,ebx
+	mov	esi,edi
+	mov	edx,ebp
+	jmp	NEAR L$077cbc_enc_loop
+align	16
+L$075cbc_decrypt:
+	cmp	eax,80
+	jbe	NEAR L$080cbc_dec_tail
+	movaps	[esp],xmm7
+	sub	eax,80
+	jmp	NEAR L$081cbc_dec_loop6_enter
+align	16
+L$082cbc_dec_loop6:
+	movaps	[esp],xmm0
+	movups	[edi],xmm7
+	lea	edi,[16+edi]
+L$081cbc_dec_loop6_enter:
+	movdqu	xmm2,[esi]
+	movdqu	xmm3,[16+esi]
+	movdqu	xmm4,[32+esi]
+	movdqu	xmm5,[48+esi]
+	movdqu	xmm6,[64+esi]
+	movdqu	xmm7,[80+esi]
+	call	__aesni_decrypt6
+	movups	xmm1,[esi]
+	movups	xmm0,[16+esi]
+	xorps	xmm2,[esp]
+	xorps	xmm3,xmm1
+	movups	xmm1,[32+esi]
+	xorps	xmm4,xmm0
+	movups	xmm0,[48+esi]
+	xorps	xmm5,xmm1
+	movups	xmm1,[64+esi]
+	xorps	xmm6,xmm0
+	movups	xmm0,[80+esi]
+	xorps	xmm7,xmm1
+	movups	[edi],xmm2
+	movups	[16+edi],xmm3
+	lea	esi,[96+esi]
+	movups	[32+edi],xmm4
+	mov	ecx,ebx
+	movups	[48+edi],xmm5
+	mov	edx,ebp
+	movups	[64+edi],xmm6
+	lea	edi,[80+edi]
+	sub	eax,96
+	ja	NEAR L$082cbc_dec_loop6
+	movaps	xmm2,xmm7
+	movaps	xmm7,xmm0
+	add	eax,80
+	jle	NEAR L$083cbc_dec_clear_tail_collected
+	movups	[edi],xmm2
+	lea	edi,[16+edi]
+L$080cbc_dec_tail:
+	movups	xmm2,[esi]
+	movaps	xmm6,xmm2
+	cmp	eax,16
+	jbe	NEAR L$084cbc_dec_one
+	movups	xmm3,[16+esi]
+	movaps	xmm5,xmm3
+	cmp	eax,32
+	jbe	NEAR L$085cbc_dec_two
+	movups	xmm4,[32+esi]
+	cmp	eax,48
+	jbe	NEAR L$086cbc_dec_three
+	movups	xmm5,[48+esi]
+	cmp	eax,64
+	jbe	NEAR L$087cbc_dec_four
+	movups	xmm6,[64+esi]
+	movaps	[esp],xmm7
+	movups	xmm2,[esi]
+	xorps	xmm7,xmm7
+	call	__aesni_decrypt6
+	movups	xmm1,[esi]
+	movups	xmm0,[16+esi]
+	xorps	xmm2,[esp]
+	xorps	xmm3,xmm1
+	movups	xmm1,[32+esi]
+	xorps	xmm4,xmm0
+	movups	xmm0,[48+esi]
+	xorps	xmm5,xmm1
+	movups	xmm7,[64+esi]
+	xorps	xmm6,xmm0
+	movups	[edi],xmm2
+	movups	[16+edi],xmm3
+	pxor	xmm3,xmm3
+	movups	[32+edi],xmm4
+	pxor	xmm4,xmm4
+	movups	[48+edi],xmm5
+	pxor	xmm5,xmm5
+	lea	edi,[64+edi]
+	movaps	xmm2,xmm6
+	pxor	xmm6,xmm6
+	sub	eax,80
+	jmp	NEAR L$088cbc_dec_tail_collected
+align	16
+L$084cbc_dec_one:
+	movups	xmm0,[edx]
+	movups	xmm1,[16+edx]
+	lea	edx,[32+edx]
+	xorps	xmm2,xmm0
+L$089dec1_loop_16:
+db	102,15,56,222,209
+	dec	ecx
+	movups	xmm1,[edx]
+	lea	edx,[16+edx]
+	jnz	NEAR L$089dec1_loop_16
+db	102,15,56,223,209
+	xorps	xmm2,xmm7
+	movaps	xmm7,xmm6
+	sub	eax,16
+	jmp	NEAR L$088cbc_dec_tail_collected
+align	16
+L$085cbc_dec_two:
+	call	__aesni_decrypt2
+	xorps	xmm2,xmm7
+	xorps	xmm3,xmm6
+	movups	[edi],xmm2
+	movaps	xmm2,xmm3
+	pxor	xmm3,xmm3
+	lea	edi,[16+edi]
+	movaps	xmm7,xmm5
+	sub	eax,32
+	jmp	NEAR L$088cbc_dec_tail_collected
+align	16
+L$086cbc_dec_three:
+	call	__aesni_decrypt3
+	xorps	xmm2,xmm7
+	xorps	xmm3,xmm6
+	xorps	xmm4,xmm5
+	movups	[edi],xmm2
+	movaps	xmm2,xmm4
+	pxor	xmm4,xmm4
+	movups	[16+edi],xmm3
+	pxor	xmm3,xmm3
+	lea	edi,[32+edi]
+	movups	xmm7,[32+esi]
+	sub	eax,48
+	jmp	NEAR L$088cbc_dec_tail_collected
+align	16
+L$087cbc_dec_four:
+	call	__aesni_decrypt4
+	movups	xmm1,[16+esi]
+	movups	xmm0,[32+esi]
+	xorps	xmm2,xmm7
+	movups	xmm7,[48+esi]
+	xorps	xmm3,xmm6
+	movups	[edi],xmm2
+	xorps	xmm4,xmm1
+	movups	[16+edi],xmm3
+	pxor	xmm3,xmm3
+	xorps	xmm5,xmm0
+	movups	[32+edi],xmm4
+	pxor	xmm4,xmm4
+	lea	edi,[48+edi]
+	movaps	xmm2,xmm5
+	pxor	xmm5,xmm5
+	sub	eax,64
+	jmp	NEAR L$088cbc_dec_tail_collected
+align	16
+L$083cbc_dec_clear_tail_collected:
+	pxor	xmm3,xmm3
+	pxor	xmm4,xmm4
+	pxor	xmm5,xmm5
+	pxor	xmm6,xmm6
+L$088cbc_dec_tail_collected:
+	and	eax,15
+	jnz	NEAR L$090cbc_dec_tail_partial
+	movups	[edi],xmm2
+	pxor	xmm0,xmm0
+	jmp	NEAR L$079cbc_ret
+align	16
+L$090cbc_dec_tail_partial:
+	movaps	[esp],xmm2
+	pxor	xmm0,xmm0
+	mov	ecx,16
+	mov	esi,esp
+	sub	ecx,eax
+dd	2767451785
+	movdqa	[esp],xmm2
+L$079cbc_ret:
+	mov	esp,DWORD [16+esp]
+	mov	ebp,DWORD [36+esp]
+	pxor	xmm2,xmm2
+	pxor	xmm1,xmm1
+	movups	[ebp],xmm7
+	pxor	xmm7,xmm7
+L$074cbc_abort:
+	pop	edi
+	pop	esi
+	pop	ebx
+	pop	ebp
+	ret
+align	16
+__aesni_set_encrypt_key:
+	push	ebp
+	push	ebx
+	test	eax,eax
+	jz	NEAR L$091bad_pointer
+	test	edx,edx
+	jz	NEAR L$091bad_pointer
+	call	L$092pic
+L$092pic:
+	pop	ebx
+	lea	ebx,[(L$key_const-L$092pic)+ebx]
+	lea	ebp,[_OPENSSL_ia32cap_P]
+	movups	xmm0,[eax]
+	xorps	xmm4,xmm4
+	mov	ebp,DWORD [4+ebp]
+	lea	edx,[16+edx]
+	and	ebp,268437504
+	cmp	ecx,256
+	je	NEAR L$09314rounds
+	cmp	ecx,192
+	je	NEAR L$09412rounds
+	cmp	ecx,128
+	jne	NEAR L$095bad_keybits
+align	16
+L$09610rounds:
+	cmp	ebp,268435456
+	je	NEAR L$09710rounds_alt
+	mov	ecx,9
+	movups	[edx-16],xmm0
+db	102,15,58,223,200,1
+	call	L$098key_128_cold
+db	102,15,58,223,200,2
+	call	L$099key_128
+db	102,15,58,223,200,4
+	call	L$099key_128
+db	102,15,58,223,200,8
+	call	L$099key_128
+db	102,15,58,223,200,16
+	call	L$099key_128
+db	102,15,58,223,200,32
+	call	L$099key_128
+db	102,15,58,223,200,64
+	call	L$099key_128
+db	102,15,58,223,200,128
+	call	L$099key_128
+db	102,15,58,223,200,27
+	call	L$099key_128
+db	102,15,58,223,200,54
+	call	L$099key_128
+	movups	[edx],xmm0
+	mov	DWORD [80+edx],ecx
+	jmp	NEAR L$100good_key
+align	16
+L$099key_128:
+	movups	[edx],xmm0
+	lea	edx,[16+edx]
+L$098key_128_cold:
+	shufps	xmm4,xmm0,16
+	xorps	xmm0,xmm4
+	shufps	xmm4,xmm0,140
+	xorps	xmm0,xmm4
+	shufps	xmm1,xmm1,255
+	xorps	xmm0,xmm1
+	ret
+align	16
+L$09710rounds_alt:
+	movdqa	xmm5,[ebx]
+	mov	ecx,8
+	movdqa	xmm4,[32+ebx]
+	movdqa	xmm2,xmm0
+	movdqu	[edx-16],xmm0
+L$101loop_key128:
+db	102,15,56,0,197
+db	102,15,56,221,196
+	pslld	xmm4,1
+	lea	edx,[16+edx]
+	movdqa	xmm3,xmm2
+	pslldq	xmm2,4
+	pxor	xmm3,xmm2
+	pslldq	xmm2,4
+	pxor	xmm3,xmm2
+	pslldq	xmm2,4
+	pxor	xmm2,xmm3
+	pxor	xmm0,xmm2
+	movdqu	[edx-16],xmm0
+	movdqa	xmm2,xmm0
+	dec	ecx
+	jnz	NEAR L$101loop_key128
+	movdqa	xmm4,[48+ebx]
+db	102,15,56,0,197
+db	102,15,56,221,196
+	pslld	xmm4,1
+	movdqa	xmm3,xmm2
+	pslldq	xmm2,4
+	pxor	xmm3,xmm2
+	pslldq	xmm2,4
+	pxor	xmm3,xmm2
+	pslldq	xmm2,4
+	pxor	xmm2,xmm3
+	pxor	xmm0,xmm2
+	movdqu	[edx],xmm0
+	movdqa	xmm2,xmm0
+db	102,15,56,0,197
+db	102,15,56,221,196
+	movdqa	xmm3,xmm2
+	pslldq	xmm2,4
+	pxor	xmm3,xmm2
+	pslldq	xmm2,4
+	pxor	xmm3,xmm2
+	pslldq	xmm2,4
+	pxor	xmm2,xmm3
+	pxor	xmm0,xmm2
+	movdqu	[16+edx],xmm0
+	mov	ecx,9
+	mov	DWORD [96+edx],ecx
+	jmp	NEAR L$100good_key
+align	16
+L$09412rounds:
+	movq	xmm2,[16+eax]
+	cmp	ebp,268435456
+	je	NEAR L$10212rounds_alt
+	mov	ecx,11
+	movups	[edx-16],xmm0
+db	102,15,58,223,202,1
+	call	L$103key_192a_cold
+db	102,15,58,223,202,2
+	call	L$104key_192b
+db	102,15,58,223,202,4
+	call	L$105key_192a
+db	102,15,58,223,202,8
+	call	L$104key_192b
+db	102,15,58,223,202,16
+	call	L$105key_192a
+db	102,15,58,223,202,32
+	call	L$104key_192b
+db	102,15,58,223,202,64
+	call	L$105key_192a
+db	102,15,58,223,202,128
+	call	L$104key_192b
+	movups	[edx],xmm0
+	mov	DWORD [48+edx],ecx
+	jmp	NEAR L$100good_key
+align	16
+L$105key_192a:
+	movups	[edx],xmm0
+	lea	edx,[16+edx]
+align	16
+L$103key_192a_cold:
+	movaps	xmm5,xmm2
+L$106key_192b_warm:
+	shufps	xmm4,xmm0,16
+	movdqa	xmm3,xmm2
+	xorps	xmm0,xmm4
+	shufps	xmm4,xmm0,140
+	pslldq	xmm3,4
+	xorps	xmm0,xmm4
+	pshufd	xmm1,xmm1,85
+	pxor	xmm2,xmm3
+	pxor	xmm0,xmm1
+	pshufd	xmm3,xmm0,255
+	pxor	xmm2,xmm3
+	ret
+align	16
+L$104key_192b:
+	movaps	xmm3,xmm0
+	shufps	xmm5,xmm0,68
+	movups	[edx],xmm5
+	shufps	xmm3,xmm2,78
+	movups	[16+edx],xmm3
+	lea	edx,[32+edx]
+	jmp	NEAR L$106key_192b_warm
+align	16
+L$10212rounds_alt:
+	movdqa	xmm5,[16+ebx]
+	movdqa	xmm4,[32+ebx]
+	mov	ecx,8
+	movdqu	[edx-16],xmm0
+L$107loop_key192:
+	movq	[edx],xmm2
+	movdqa	xmm1,xmm2
+db	102,15,56,0,213
+db	102,15,56,221,212
+	pslld	xmm4,1
+	lea	edx,[24+edx]
+	movdqa	xmm3,xmm0
+	pslldq	xmm0,4
+	pxor	xmm3,xmm0
+	pslldq	xmm0,4
+	pxor	xmm3,xmm0
+	pslldq	xmm0,4
+	pxor	xmm0,xmm3
+	pshufd	xmm3,xmm0,255
+	pxor	xmm3,xmm1
+	pslldq	xmm1,4
+	pxor	xmm3,xmm1
+	pxor	xmm0,xmm2
+	pxor	xmm2,xmm3
+	movdqu	[edx-16],xmm0
+	dec	ecx
+	jnz	NEAR L$107loop_key192
+	mov	ecx,11
+	mov	DWORD [32+edx],ecx
+	jmp	NEAR L$100good_key
+align	16
+L$09314rounds:
+	movups	xmm2,[16+eax]
+	lea	edx,[16+edx]
+	cmp	ebp,268435456
+	je	NEAR L$10814rounds_alt
+	mov	ecx,13
+	movups	[edx-32],xmm0
+	movups	[edx-16],xmm2
+db	102,15,58,223,202,1
+	call	L$109key_256a_cold
+db	102,15,58,223,200,1
+	call	L$110key_256b
+db	102,15,58,223,202,2
+	call	L$111key_256a
+db	102,15,58,223,200,2
+	call	L$110key_256b
+db	102,15,58,223,202,4
+	call	L$111key_256a
+db	102,15,58,223,200,4
+	call	L$110key_256b
+db	102,15,58,223,202,8
+	call	L$111key_256a
+db	102,15,58,223,200,8
+	call	L$110key_256b
+db	102,15,58,223,202,16
+	call	L$111key_256a
+db	102,15,58,223,200,16
+	call	L$110key_256b
+db	102,15,58,223,202,32
+	call	L$111key_256a
+db	102,15,58,223,200,32
+	call	L$110key_256b
+db	102,15,58,223,202,64
+	call	L$111key_256a
+	movups	[edx],xmm0
+	mov	DWORD [16+edx],ecx
+	xor	eax,eax
+	jmp	NEAR L$100good_key
+align	16
+L$111key_256a:
+	movups	[edx],xmm2
+	lea	edx,[16+edx]
+L$109key_256a_cold:
+	shufps	xmm4,xmm0,16
+	xorps	xmm0,xmm4
+	shufps	xmm4,xmm0,140
+	xorps	xmm0,xmm4
+	shufps	xmm1,xmm1,255
+	xorps	xmm0,xmm1
+	ret
+align	16
+L$110key_256b:
+	movups	[edx],xmm0
+	lea	edx,[16+edx]
+	shufps	xmm4,xmm2,16
+	xorps	xmm2,xmm4
+	shufps	xmm4,xmm2,140
+	xorps	xmm2,xmm4
+	shufps	xmm1,xmm1,170
+	xorps	xmm2,xmm1
+	ret
+align	16
+L$10814rounds_alt:
+	movdqa	xmm5,[ebx]
+	movdqa	xmm4,[32+ebx]
+	mov	ecx,7
+	movdqu	[edx-32],xmm0
+	movdqa	xmm1,xmm2
+	movdqu	[edx-16],xmm2
+L$112loop_key256:
+db	102,15,56,0,213
+db	102,15,56,221,212
+	movdqa	xmm3,xmm0
+	pslldq	xmm0,4
+	pxor	xmm3,xmm0
+	pslldq	xmm0,4
+	pxor	xmm3,xmm0
+	pslldq	xmm0,4
+	pxor	xmm0,xmm3
+	pslld	xmm4,1
+	pxor	xmm0,xmm2
+	movdqu	[edx],xmm0
+	dec	ecx
+	jz	NEAR L$113done_key256
+	pshufd	xmm2,xmm0,255
+	pxor	xmm3,xmm3
+db	102,15,56,221,211
+	movdqa	xmm3,xmm1
+	pslldq	xmm1,4
+	pxor	xmm3,xmm1
+	pslldq	xmm1,4
+	pxor	xmm3,xmm1
+	pslldq	xmm1,4
+	pxor	xmm1,xmm3
+	pxor	xmm2,xmm1
+	movdqu	[16+edx],xmm2
+	lea	edx,[32+edx]
+	movdqa	xmm1,xmm2
+	jmp	NEAR L$112loop_key256
+L$113done_key256:
+	mov	ecx,13
+	mov	DWORD [16+edx],ecx
+L$100good_key:
+	pxor	xmm0,xmm0
+	pxor	xmm1,xmm1
+	pxor	xmm2,xmm2
+	pxor	xmm3,xmm3
+	pxor	xmm4,xmm4
+	pxor	xmm5,xmm5
+	xor	eax,eax
+	pop	ebx
+	pop	ebp
+	ret
+align	4
+L$091bad_pointer:
+	mov	eax,-1
+	pop	ebx
+	pop	ebp
+	ret
+align	4
+L$095bad_keybits:
+	pxor	xmm0,xmm0
+	mov	eax,-2
+	pop	ebx
+	pop	ebp
+	ret
+global	_aesni_set_encrypt_key
+align	16
+_aesni_set_encrypt_key:
+L$_aesni_set_encrypt_key_begin:
+	mov	eax,DWORD [4+esp]
+	mov	ecx,DWORD [8+esp]
+	mov	edx,DWORD [12+esp]
+	call	__aesni_set_encrypt_key
+	ret
+global	_aesni_set_decrypt_key
+align	16
+_aesni_set_decrypt_key:
+L$_aesni_set_decrypt_key_begin:
+	mov	eax,DWORD [4+esp]
+	mov	ecx,DWORD [8+esp]
+	mov	edx,DWORD [12+esp]
+	call	__aesni_set_encrypt_key
+	mov	edx,DWORD [12+esp]
+	shl	ecx,4
+	test	eax,eax
+	jnz	NEAR L$114dec_key_ret
+	lea	eax,[16+ecx*1+edx]
+	movups	xmm0,[edx]
+	movups	xmm1,[eax]
+	movups	[eax],xmm0
+	movups	[edx],xmm1
+	lea	edx,[16+edx]
+	lea	eax,[eax-16]
+L$115dec_key_inverse:
+	movups	xmm0,[edx]
+	movups	xmm1,[eax]
+db	102,15,56,219,192
+db	102,15,56,219,201
+	lea	edx,[16+edx]
+	lea	eax,[eax-16]
+	movups	[16+eax],xmm0
+	movups	[edx-16],xmm1
+	cmp	eax,edx
+	ja	NEAR L$115dec_key_inverse
+	movups	xmm0,[edx]
+db	102,15,56,219,192
+	movups	[edx],xmm0
+	pxor	xmm0,xmm0
+	pxor	xmm1,xmm1
+	xor	eax,eax
+L$114dec_key_ret:
+	ret
+align	64
+L$key_const:
+dd	202313229,202313229,202313229,202313229
+dd	67569157,67569157,67569157,67569157
+dd	1,1,1,1
+dd	27,27,27,27
+db	65,69,83,32,102,111,114,32,73,110,116,101,108,32,65,69
+db	83,45,78,73,44,32,67,82,89,80,84,79,71,65,77,83
+db	32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115
+db	115,108,46,111,114,103,62,0
+segment	.bss
+common	_OPENSSL_ia32cap_P 16
diff --git a/third_party/boringssl/win-x86/crypto/aes/vpaes-x86.asm b/third_party/boringssl/win-x86/crypto/aes/vpaes-x86.asm
new file mode 100644
index 0000000..b08b056
--- /dev/null
+++ b/third_party/boringssl/win-x86/crypto/aes/vpaes-x86.asm
@@ -0,0 +1,649 @@
+%ifidn __OUTPUT_FORMAT__,obj
+section	code	use32 class=code align=64
+%elifidn __OUTPUT_FORMAT__,win32
+%ifdef __YASM_VERSION_ID__
+%if __YASM_VERSION_ID__ < 01010000h
+%error yasm version 1.1.0 or later needed.
+%endif
+; Yasm automatically includes .00 and complains about redefining it.
+; https://www.tortall.net/projects/yasm/manual/html/objfmt-win32-safeseh.html
+%else
+$@feat.00 equ 1
+%endif
+section	.text	code align=64
+%else
+section	.text	code
+%endif
+align	64
+L$_vpaes_consts:
+dd	218628480,235210255,168496130,67568393
+dd	252381056,17041926,33884169,51187212
+dd	252645135,252645135,252645135,252645135
+dd	1512730624,3266504856,1377990664,3401244816
+dd	830229760,1275146365,2969422977,3447763452
+dd	3411033600,2979783055,338359620,2782886510
+dd	4209124096,907596821,221174255,1006095553
+dd	191964160,3799684038,3164090317,1589111125
+dd	182528256,1777043520,2877432650,3265356744
+dd	1874708224,3503451415,3305285752,363511674
+dd	1606117888,3487855781,1093350906,2384367825
+dd	197121,67569157,134941193,202313229
+dd	67569157,134941193,202313229,197121
+dd	134941193,202313229,197121,67569157
+dd	202313229,197121,67569157,134941193
+dd	33619971,100992007,168364043,235736079
+dd	235736079,33619971,100992007,168364043
+dd	168364043,235736079,33619971,100992007
+dd	100992007,168364043,235736079,33619971
+dd	50462976,117835012,185207048,252579084
+dd	252314880,51251460,117574920,184942860
+dd	184682752,252054788,50987272,118359308
+dd	118099200,185467140,251790600,50727180
+dd	2946363062,528716217,1300004225,1881839624
+dd	1532713819,1532713819,1532713819,1532713819
+dd	3602276352,4288629033,3737020424,4153884961
+dd	1354558464,32357713,2958822624,3775749553
+dd	1201988352,132424512,1572796698,503232858
+dd	2213177600,1597421020,4103937655,675398315
+dd	2749646592,4273543773,1511898873,121693092
+dd	3040248576,1103263732,2871565598,1608280554
+dd	2236667136,2588920351,482954393,64377734
+dd	3069987328,291237287,2117370568,3650299247
+dd	533321216,3573750986,2572112006,1401264716
+dd	1339849704,2721158661,548607111,3445553514
+dd	2128193280,3054596040,2183486460,1257083700
+dd	655635200,1165381986,3923443150,2344132524
+dd	190078720,256924420,290342170,357187870
+dd	1610966272,2263057382,4103205268,309794674
+dd	2592527872,2233205587,1335446729,3402964816
+dd	3973531904,3225098121,3002836325,1918774430
+dd	3870401024,2102906079,2284471353,4117666579
+dd	617007872,1021508343,366931923,691083277
+dd	2528395776,3491914898,2968704004,1613121270
+dd	3445188352,3247741094,844474987,4093578302
+dd	651481088,1190302358,1689581232,574775300
+dd	4289380608,206939853,2555985458,2489840491
+dd	2130264064,327674451,3566485037,3349835193
+dd	2470714624,316102159,3636825756,3393945945
+db	86,101,99,116,111,114,32,80,101,114,109,117,116,97,116,105
+db	111,110,32,65,69,83,32,102,111,114,32,120,56,54,47,83
+db	83,83,69,51,44,32,77,105,107,101,32,72,97,109,98,117
+db	114,103,32,40,83,116,97,110,102,111,114,100,32,85,110,105
+db	118,101,114,115,105,116,121,41,0
+align	64
+align	16
+__vpaes_preheat:
+	add	ebp,DWORD [esp]
+	movdqa	xmm7,[ebp-48]
+	movdqa	xmm6,[ebp-16]
+	ret
+align	16
+__vpaes_encrypt_core:
+	mov	ecx,16
+	mov	eax,DWORD [240+edx]
+	movdqa	xmm1,xmm6
+	movdqa	xmm2,[ebp]
+	pandn	xmm1,xmm0
+	pand	xmm0,xmm6
+	movdqu	xmm5,[edx]
+db	102,15,56,0,208
+	movdqa	xmm0,[16+ebp]
+	pxor	xmm2,xmm5
+	psrld	xmm1,4
+	add	edx,16
+db	102,15,56,0,193
+	lea	ebx,[192+ebp]
+	pxor	xmm0,xmm2
+	jmp	NEAR L$000enc_entry
+align	16
+L$001enc_loop:
+	movdqa	xmm4,[32+ebp]
+	movdqa	xmm0,[48+ebp]
+db	102,15,56,0,226
+db	102,15,56,0,195
+	pxor	xmm4,xmm5
+	movdqa	xmm5,[64+ebp]
+	pxor	xmm0,xmm4
+	movdqa	xmm1,[ecx*1+ebx-64]
+db	102,15,56,0,234
+	movdqa	xmm2,[80+ebp]
+	movdqa	xmm4,[ecx*1+ebx]
+db	102,15,56,0,211
+	movdqa	xmm3,xmm0
+	pxor	xmm2,xmm5
+db	102,15,56,0,193
+	add	edx,16
+	pxor	xmm0,xmm2
+db	102,15,56,0,220
+	add	ecx,16
+	pxor	xmm3,xmm0
+db	102,15,56,0,193
+	and	ecx,48
+	sub	eax,1
+	pxor	xmm0,xmm3
+L$000enc_entry:
+	movdqa	xmm1,xmm6
+	movdqa	xmm5,[ebp-32]
+	pandn	xmm1,xmm0
+	psrld	xmm1,4
+	pand	xmm0,xmm6
+db	102,15,56,0,232
+	movdqa	xmm3,xmm7
+	pxor	xmm0,xmm1
+db	102,15,56,0,217
+	movdqa	xmm4,xmm7
+	pxor	xmm3,xmm5
+db	102,15,56,0,224
+	movdqa	xmm2,xmm7
+	pxor	xmm4,xmm5
+db	102,15,56,0,211
+	movdqa	xmm3,xmm7
+	pxor	xmm2,xmm0
+db	102,15,56,0,220
+	movdqu	xmm5,[edx]
+	pxor	xmm3,xmm1
+	jnz	NEAR L$001enc_loop
+	movdqa	xmm4,[96+ebp]
+	movdqa	xmm0,[112+ebp]
+db	102,15,56,0,226
+	pxor	xmm4,xmm5
+db	102,15,56,0,195
+	movdqa	xmm1,[64+ecx*1+ebx]
+	pxor	xmm0,xmm4
+db	102,15,56,0,193
+	ret
+align	16
+__vpaes_decrypt_core:
+	lea	ebx,[608+ebp]
+	mov	eax,DWORD [240+edx]
+	movdqa	xmm1,xmm6
+	movdqa	xmm2,[ebx-64]
+	pandn	xmm1,xmm0
+	mov	ecx,eax
+	psrld	xmm1,4
+	movdqu	xmm5,[edx]
+	shl	ecx,4
+	pand	xmm0,xmm6
+db	102,15,56,0,208
+	movdqa	xmm0,[ebx-48]
+	xor	ecx,48
+db	102,15,56,0,193
+	and	ecx,48
+	pxor	xmm2,xmm5
+	movdqa	xmm5,[176+ebp]
+	pxor	xmm0,xmm2
+	add	edx,16
+	lea	ecx,[ecx*1+ebx-352]
+	jmp	NEAR L$002dec_entry
+align	16
+L$003dec_loop:
+	movdqa	xmm4,[ebx-32]
+	movdqa	xmm1,[ebx-16]
+db	102,15,56,0,226
+db	102,15,56,0,203
+	pxor	xmm0,xmm4
+	movdqa	xmm4,[ebx]
+	pxor	xmm0,xmm1
+	movdqa	xmm1,[16+ebx]
+db	102,15,56,0,226
+db	102,15,56,0,197
+db	102,15,56,0,203
+	pxor	xmm0,xmm4
+	movdqa	xmm4,[32+ebx]
+	pxor	xmm0,xmm1
+	movdqa	xmm1,[48+ebx]
+db	102,15,56,0,226
+db	102,15,56,0,197
+db	102,15,56,0,203
+	pxor	xmm0,xmm4
+	movdqa	xmm4,[64+ebx]
+	pxor	xmm0,xmm1
+	movdqa	xmm1,[80+ebx]
+db	102,15,56,0,226
+db	102,15,56,0,197
+db	102,15,56,0,203
+	pxor	xmm0,xmm4
+	add	edx,16
+db	102,15,58,15,237,12
+	pxor	xmm0,xmm1
+	sub	eax,1
+L$002dec_entry:
+	movdqa	xmm1,xmm6
+	movdqa	xmm2,[ebp-32]
+	pandn	xmm1,xmm0
+	pand	xmm0,xmm6
+	psrld	xmm1,4
+db	102,15,56,0,208
+	movdqa	xmm3,xmm7
+	pxor	xmm0,xmm1
+db	102,15,56,0,217
+	movdqa	xmm4,xmm7
+	pxor	xmm3,xmm2
+db	102,15,56,0,224
+	pxor	xmm4,xmm2
+	movdqa	xmm2,xmm7
+db	102,15,56,0,211
+	movdqa	xmm3,xmm7
+	pxor	xmm2,xmm0
+db	102,15,56,0,220
+	movdqu	xmm0,[edx]
+	pxor	xmm3,xmm1
+	jnz	NEAR L$003dec_loop
+	movdqa	xmm4,[96+ebx]
+db	102,15,56,0,226
+	pxor	xmm4,xmm0
+	movdqa	xmm0,[112+ebx]
+	movdqa	xmm2,[ecx]
+db	102,15,56,0,195
+	pxor	xmm0,xmm4
+db	102,15,56,0,194
+	ret
+align	16
+__vpaes_schedule_core:
+	add	ebp,DWORD [esp]
+	movdqu	xmm0,[esi]
+	movdqa	xmm2,[320+ebp]
+	movdqa	xmm3,xmm0
+	lea	ebx,[ebp]
+	movdqa	[4+esp],xmm2
+	call	__vpaes_schedule_transform
+	movdqa	xmm7,xmm0
+	test	edi,edi
+	jnz	NEAR L$004schedule_am_decrypting
+	movdqu	[edx],xmm0
+	jmp	NEAR L$005schedule_go
+L$004schedule_am_decrypting:
+	movdqa	xmm1,[256+ecx*1+ebp]
+db	102,15,56,0,217
+	movdqu	[edx],xmm3
+	xor	ecx,48
+L$005schedule_go:
+	cmp	eax,192
+	ja	NEAR L$006schedule_256
+	je	NEAR L$007schedule_192
+L$008schedule_128:
+	mov	eax,10
+L$009loop_schedule_128:
+	call	__vpaes_schedule_round
+	dec	eax
+	jz	NEAR L$010schedule_mangle_last
+	call	__vpaes_schedule_mangle
+	jmp	NEAR L$009loop_schedule_128
+align	16
+L$007schedule_192:
+	movdqu	xmm0,[8+esi]
+	call	__vpaes_schedule_transform
+	movdqa	xmm6,xmm0
+	pxor	xmm4,xmm4
+	movhlps	xmm6,xmm4
+	mov	eax,4
+L$011loop_schedule_192:
+	call	__vpaes_schedule_round
+db	102,15,58,15,198,8
+	call	__vpaes_schedule_mangle
+	call	__vpaes_schedule_192_smear
+	call	__vpaes_schedule_mangle
+	call	__vpaes_schedule_round
+	dec	eax
+	jz	NEAR L$010schedule_mangle_last
+	call	__vpaes_schedule_mangle
+	call	__vpaes_schedule_192_smear
+	jmp	NEAR L$011loop_schedule_192
+align	16
+L$006schedule_256:
+	movdqu	xmm0,[16+esi]
+	call	__vpaes_schedule_transform
+	mov	eax,7
+L$012loop_schedule_256:
+	call	__vpaes_schedule_mangle
+	movdqa	xmm6,xmm0
+	call	__vpaes_schedule_round
+	dec	eax
+	jz	NEAR L$010schedule_mangle_last
+	call	__vpaes_schedule_mangle
+	pshufd	xmm0,xmm0,255
+	movdqa	[20+esp],xmm7
+	movdqa	xmm7,xmm6
+	call	L$_vpaes_schedule_low_round
+	movdqa	xmm7,[20+esp]
+	jmp	NEAR L$012loop_schedule_256
+align	16
+L$010schedule_mangle_last:
+	lea	ebx,[384+ebp]
+	test	edi,edi
+	jnz	NEAR L$013schedule_mangle_last_dec
+	movdqa	xmm1,[256+ecx*1+ebp]
+db	102,15,56,0,193
+	lea	ebx,[352+ebp]
+	add	edx,32
+L$013schedule_mangle_last_dec:
+	add	edx,-16
+	pxor	xmm0,[336+ebp]
+	call	__vpaes_schedule_transform
+	movdqu	[edx],xmm0
+	pxor	xmm0,xmm0
+	pxor	xmm1,xmm1
+	pxor	xmm2,xmm2
+	pxor	xmm3,xmm3
+	pxor	xmm4,xmm4
+	pxor	xmm5,xmm5
+	pxor	xmm6,xmm6
+	pxor	xmm7,xmm7
+	ret
+align	16
+__vpaes_schedule_192_smear:
+	pshufd	xmm1,xmm6,128
+	pshufd	xmm0,xmm7,254
+	pxor	xmm6,xmm1
+	pxor	xmm1,xmm1
+	pxor	xmm6,xmm0
+	movdqa	xmm0,xmm6
+	movhlps	xmm6,xmm1
+	ret
+align	16
+__vpaes_schedule_round:
+	movdqa	xmm2,[8+esp]
+	pxor	xmm1,xmm1
+db	102,15,58,15,202,15
+db	102,15,58,15,210,15
+	pxor	xmm7,xmm1
+	pshufd	xmm0,xmm0,255
+db	102,15,58,15,192,1
+	movdqa	[8+esp],xmm2
+L$_vpaes_schedule_low_round:
+	movdqa	xmm1,xmm7
+	pslldq	xmm7,4
+	pxor	xmm7,xmm1
+	movdqa	xmm1,xmm7
+	pslldq	xmm7,8
+	pxor	xmm7,xmm1
+	pxor	xmm7,[336+ebp]
+	movdqa	xmm4,[ebp-16]
+	movdqa	xmm5,[ebp-48]
+	movdqa	xmm1,xmm4
+	pandn	xmm1,xmm0
+	psrld	xmm1,4
+	pand	xmm0,xmm4
+	movdqa	xmm2,[ebp-32]
+db	102,15,56,0,208
+	pxor	xmm0,xmm1
+	movdqa	xmm3,xmm5
+db	102,15,56,0,217
+	pxor	xmm3,xmm2
+	movdqa	xmm4,xmm5
+db	102,15,56,0,224
+	pxor	xmm4,xmm2
+	movdqa	xmm2,xmm5
+db	102,15,56,0,211
+	pxor	xmm2,xmm0
+	movdqa	xmm3,xmm5
+db	102,15,56,0,220
+	pxor	xmm3,xmm1
+	movdqa	xmm4,[32+ebp]
+db	102,15,56,0,226
+	movdqa	xmm0,[48+ebp]
+db	102,15,56,0,195
+	pxor	xmm0,xmm4
+	pxor	xmm0,xmm7
+	movdqa	xmm7,xmm0
+	ret
+align	16
+__vpaes_schedule_transform:
+	movdqa	xmm2,[ebp-16]
+	movdqa	xmm1,xmm2
+	pandn	xmm1,xmm0
+	psrld	xmm1,4
+	pand	xmm0,xmm2
+	movdqa	xmm2,[ebx]
+db	102,15,56,0,208
+	movdqa	xmm0,[16+ebx]
+db	102,15,56,0,193
+	pxor	xmm0,xmm2
+	ret
+align	16
+__vpaes_schedule_mangle:
+	movdqa	xmm4,xmm0
+	movdqa	xmm5,[128+ebp]
+	test	edi,edi
+	jnz	NEAR L$014schedule_mangle_dec
+	add	edx,16
+	pxor	xmm4,[336+ebp]
+db	102,15,56,0,229
+	movdqa	xmm3,xmm4
+db	102,15,56,0,229
+	pxor	xmm3,xmm4
+db	102,15,56,0,229
+	pxor	xmm3,xmm4
+	jmp	NEAR L$015schedule_mangle_both
+align	16
+L$014schedule_mangle_dec:
+	movdqa	xmm2,[ebp-16]
+	lea	esi,[416+ebp]
+	movdqa	xmm1,xmm2
+	pandn	xmm1,xmm4
+	psrld	xmm1,4
+	pand	xmm4,xmm2
+	movdqa	xmm2,[esi]
+db	102,15,56,0,212
+	movdqa	xmm3,[16+esi]
+db	102,15,56,0,217
+	pxor	xmm3,xmm2
+db	102,15,56,0,221
+	movdqa	xmm2,[32+esi]
+db	102,15,56,0,212
+	pxor	xmm2,xmm3
+	movdqa	xmm3,[48+esi]
+db	102,15,56,0,217
+	pxor	xmm3,xmm2
+db	102,15,56,0,221
+	movdqa	xmm2,[64+esi]
+db	102,15,56,0,212
+	pxor	xmm2,xmm3
+	movdqa	xmm3,[80+esi]
+db	102,15,56,0,217
+	pxor	xmm3,xmm2
+db	102,15,56,0,221
+	movdqa	xmm2,[96+esi]
+db	102,15,56,0,212
+	pxor	xmm2,xmm3
+	movdqa	xmm3,[112+esi]
+db	102,15,56,0,217
+	pxor	xmm3,xmm2
+	add	edx,-16
+L$015schedule_mangle_both:
+	movdqa	xmm1,[256+ecx*1+ebp]
+db	102,15,56,0,217
+	add	ecx,-16
+	and	ecx,48
+	movdqu	[edx],xmm3
+	ret
+global	_vpaes_set_encrypt_key
+align	16
+_vpaes_set_encrypt_key:
+L$_vpaes_set_encrypt_key_begin:
+	push	ebp
+	push	ebx
+	push	esi
+	push	edi
+	mov	esi,DWORD [20+esp]
+	lea	ebx,[esp-56]
+	mov	eax,DWORD [24+esp]
+	and	ebx,-16
+	mov	edx,DWORD [28+esp]
+	xchg	ebx,esp
+	mov	DWORD [48+esp],ebx
+	mov	ebx,eax
+	shr	ebx,5
+	add	ebx,5
+	mov	DWORD [240+edx],ebx
+	mov	ecx,48
+	mov	edi,0
+	lea	ebp,[(L$_vpaes_consts+0x30-L$016pic_point)]
+	call	__vpaes_schedule_core
+L$016pic_point:
+	mov	esp,DWORD [48+esp]
+	xor	eax,eax
+	pop	edi
+	pop	esi
+	pop	ebx
+	pop	ebp
+	ret
+global	_vpaes_set_decrypt_key
+align	16
+_vpaes_set_decrypt_key:
+L$_vpaes_set_decrypt_key_begin:
+	push	ebp
+	push	ebx
+	push	esi
+	push	edi
+	mov	esi,DWORD [20+esp]
+	lea	ebx,[esp-56]
+	mov	eax,DWORD [24+esp]
+	and	ebx,-16
+	mov	edx,DWORD [28+esp]
+	xchg	ebx,esp
+	mov	DWORD [48+esp],ebx
+	mov	ebx,eax
+	shr	ebx,5
+	add	ebx,5
+	mov	DWORD [240+edx],ebx
+	shl	ebx,4
+	lea	edx,[16+ebx*1+edx]
+	mov	edi,1
+	mov	ecx,eax
+	shr	ecx,1
+	and	ecx,32
+	xor	ecx,32
+	lea	ebp,[(L$_vpaes_consts+0x30-L$017pic_point)]
+	call	__vpaes_schedule_core
+L$017pic_point:
+	mov	esp,DWORD [48+esp]
+	xor	eax,eax
+	pop	edi
+	pop	esi
+	pop	ebx
+	pop	ebp
+	ret
+global	_vpaes_encrypt
+align	16
+_vpaes_encrypt:
+L$_vpaes_encrypt_begin:
+	push	ebp
+	push	ebx
+	push	esi
+	push	edi
+	lea	ebp,[(L$_vpaes_consts+0x30-L$018pic_point)]
+	call	__vpaes_preheat
+L$018pic_point:
+	mov	esi,DWORD [20+esp]
+	lea	ebx,[esp-56]
+	mov	edi,DWORD [24+esp]
+	and	ebx,-16
+	mov	edx,DWORD [28+esp]
+	xchg	ebx,esp
+	mov	DWORD [48+esp],ebx
+	movdqu	xmm0,[esi]
+	call	__vpaes_encrypt_core
+	movdqu	[edi],xmm0
+	mov	esp,DWORD [48+esp]
+	pop	edi
+	pop	esi
+	pop	ebx
+	pop	ebp
+	ret
+global	_vpaes_decrypt
+align	16
+_vpaes_decrypt:
+L$_vpaes_decrypt_begin:
+	push	ebp
+	push	ebx
+	push	esi
+	push	edi
+	lea	ebp,[(L$_vpaes_consts+0x30-L$019pic_point)]
+	call	__vpaes_preheat
+L$019pic_point:
+	mov	esi,DWORD [20+esp]
+	lea	ebx,[esp-56]
+	mov	edi,DWORD [24+esp]
+	and	ebx,-16
+	mov	edx,DWORD [28+esp]
+	xchg	ebx,esp
+	mov	DWORD [48+esp],ebx
+	movdqu	xmm0,[esi]
+	call	__vpaes_decrypt_core
+	movdqu	[edi],xmm0
+	mov	esp,DWORD [48+esp]
+	pop	edi
+	pop	esi
+	pop	ebx
+	pop	ebp
+	ret
+global	_vpaes_cbc_encrypt
+align	16
+_vpaes_cbc_encrypt:
+L$_vpaes_cbc_encrypt_begin:
+	push	ebp
+	push	ebx
+	push	esi
+	push	edi
+	mov	esi,DWORD [20+esp]
+	mov	edi,DWORD [24+esp]
+	mov	eax,DWORD [28+esp]
+	mov	edx,DWORD [32+esp]
+	sub	eax,16
+	jc	NEAR L$020cbc_abort
+	lea	ebx,[esp-56]
+	mov	ebp,DWORD [36+esp]
+	and	ebx,-16
+	mov	ecx,DWORD [40+esp]
+	xchg	ebx,esp
+	movdqu	xmm1,[ebp]
+	sub	edi,esi
+	mov	DWORD [48+esp],ebx
+	mov	DWORD [esp],edi
+	mov	DWORD [4+esp],edx
+	mov	DWORD [8+esp],ebp
+	mov	edi,eax
+	lea	ebp,[(L$_vpaes_consts+0x30-L$021pic_point)]
+	call	__vpaes_preheat
+L$021pic_point:
+	cmp	ecx,0
+	je	NEAR L$022cbc_dec_loop
+	jmp	NEAR L$023cbc_enc_loop
+align	16
+L$023cbc_enc_loop:
+	movdqu	xmm0,[esi]
+	pxor	xmm0,xmm1
+	call	__vpaes_encrypt_core
+	mov	ebx,DWORD [esp]
+	mov	edx,DWORD [4+esp]
+	movdqa	xmm1,xmm0
+	movdqu	[esi*1+ebx],xmm0
+	lea	esi,[16+esi]
+	sub	edi,16
+	jnc	NEAR L$023cbc_enc_loop
+	jmp	NEAR L$024cbc_done
+align	16
+L$022cbc_dec_loop:
+	movdqu	xmm0,[esi]
+	movdqa	[16+esp],xmm1
+	movdqa	[32+esp],xmm0
+	call	__vpaes_decrypt_core
+	mov	ebx,DWORD [esp]
+	mov	edx,DWORD [4+esp]
+	pxor	xmm0,[16+esp]
+	movdqa	xmm1,[32+esp]
+	movdqu	[esi*1+ebx],xmm0
+	lea	esi,[16+esi]
+	sub	edi,16
+	jnc	NEAR L$022cbc_dec_loop
+L$024cbc_done:
+	mov	ebx,DWORD [8+esp]
+	mov	esp,DWORD [48+esp]
+	movdqu	[ebx],xmm1
+L$020cbc_abort:
+	pop	edi
+	pop	esi
+	pop	ebx
+	pop	ebp
+	ret
diff --git a/third_party/boringssl/win-x86/crypto/bn/bn-586.asm b/third_party/boringssl/win-x86/crypto/bn/bn-586.asm
new file mode 100644
index 0000000..b222040a
--- /dev/null
+++ b/third_party/boringssl/win-x86/crypto/bn/bn-586.asm
@@ -0,0 +1,1523 @@
+%ifidn __OUTPUT_FORMAT__,obj
+section	code	use32 class=code align=64
+%elifidn __OUTPUT_FORMAT__,win32
+%ifdef __YASM_VERSION_ID__
+%if __YASM_VERSION_ID__ < 01010000h
+%error yasm version 1.1.0 or later needed.
+%endif
+; Yasm automatically includes .00 and complains about redefining it.
+; https://www.tortall.net/projects/yasm/manual/html/objfmt-win32-safeseh.html
+%else
+$@feat.00 equ 1
+%endif
+section	.text	code align=64
+%else
+section	.text	code
+%endif
+;extern	_OPENSSL_ia32cap_P
+global	_bn_mul_add_words
+align	16
+_bn_mul_add_words:
+L$_bn_mul_add_words_begin:
+	lea	eax,[_OPENSSL_ia32cap_P]
+	bt	DWORD [eax],26
+	jnc	NEAR L$000maw_non_sse2
+	mov	eax,DWORD [4+esp]
+	mov	edx,DWORD [8+esp]
+	mov	ecx,DWORD [12+esp]
+	movd	mm0,DWORD [16+esp]
+	pxor	mm1,mm1
+	jmp	NEAR L$001maw_sse2_entry
+align	16
+L$002maw_sse2_unrolled:
+	movd	mm3,DWORD [eax]
+	paddq	mm1,mm3
+	movd	mm2,DWORD [edx]
+	pmuludq	mm2,mm0
+	movd	mm4,DWORD [4+edx]
+	pmuludq	mm4,mm0
+	movd	mm6,DWORD [8+edx]
+	pmuludq	mm6,mm0
+	movd	mm7,DWORD [12+edx]
+	pmuludq	mm7,mm0
+	paddq	mm1,mm2
+	movd	mm3,DWORD [4+eax]
+	paddq	mm3,mm4
+	movd	mm5,DWORD [8+eax]
+	paddq	mm5,mm6
+	movd	mm4,DWORD [12+eax]
+	paddq	mm7,mm4
+	movd	DWORD [eax],mm1
+	movd	mm2,DWORD [16+edx]
+	pmuludq	mm2,mm0
+	psrlq	mm1,32
+	movd	mm4,DWORD [20+edx]
+	pmuludq	mm4,mm0
+	paddq	mm1,mm3
+	movd	mm6,DWORD [24+edx]
+	pmuludq	mm6,mm0
+	movd	DWORD [4+eax],mm1
+	psrlq	mm1,32
+	movd	mm3,DWORD [28+edx]
+	add	edx,32
+	pmuludq	mm3,mm0
+	paddq	mm1,mm5
+	movd	mm5,DWORD [16+eax]
+	paddq	mm2,mm5
+	movd	DWORD [8+eax],mm1
+	psrlq	mm1,32
+	paddq	mm1,mm7
+	movd	mm5,DWORD [20+eax]
+	paddq	mm4,mm5
+	movd	DWORD [12+eax],mm1
+	psrlq	mm1,32
+	paddq	mm1,mm2
+	movd	mm5,DWORD [24+eax]
+	paddq	mm6,mm5
+	movd	DWORD [16+eax],mm1
+	psrlq	mm1,32
+	paddq	mm1,mm4
+	movd	mm5,DWORD [28+eax]
+	paddq	mm3,mm5
+	movd	DWORD [20+eax],mm1
+	psrlq	mm1,32
+	paddq	mm1,mm6
+	movd	DWORD [24+eax],mm1
+	psrlq	mm1,32
+	paddq	mm1,mm3
+	movd	DWORD [28+eax],mm1
+	lea	eax,[32+eax]
+	psrlq	mm1,32
+	sub	ecx,8
+	jz	NEAR L$003maw_sse2_exit
+L$001maw_sse2_entry:
+	test	ecx,4294967288
+	jnz	NEAR L$002maw_sse2_unrolled
+align	4
+L$004maw_sse2_loop:
+	movd	mm2,DWORD [edx]
+	movd	mm3,DWORD [eax]
+	pmuludq	mm2,mm0
+	lea	edx,[4+edx]
+	paddq	mm1,mm3
+	paddq	mm1,mm2
+	movd	DWORD [eax],mm1
+	sub	ecx,1
+	psrlq	mm1,32
+	lea	eax,[4+eax]
+	jnz	NEAR L$004maw_sse2_loop
+L$003maw_sse2_exit:
+	movd	eax,mm1
+	emms
+	ret
+align	16
+L$000maw_non_sse2:
+	push	ebp
+	push	ebx
+	push	esi
+	push	edi
+	; 
+	xor	esi,esi
+	mov	edi,DWORD [20+esp]
+	mov	ecx,DWORD [28+esp]
+	mov	ebx,DWORD [24+esp]
+	and	ecx,4294967288
+	mov	ebp,DWORD [32+esp]
+	push	ecx
+	jz	NEAR L$005maw_finish
+align	16
+L$006maw_loop:
+	; Round 0
+	mov	eax,DWORD [ebx]
+	mul	ebp
+	add	eax,esi
+	adc	edx,0
+	add	eax,DWORD [edi]
+	adc	edx,0
+	mov	DWORD [edi],eax
+	mov	esi,edx
+	; Round 4
+	mov	eax,DWORD [4+ebx]
+	mul	ebp
+	add	eax,esi
+	adc	edx,0
+	add	eax,DWORD [4+edi]
+	adc	edx,0
+	mov	DWORD [4+edi],eax
+	mov	esi,edx
+	; Round 8
+	mov	eax,DWORD [8+ebx]
+	mul	ebp
+	add	eax,esi
+	adc	edx,0
+	add	eax,DWORD [8+edi]
+	adc	edx,0
+	mov	DWORD [8+edi],eax
+	mov	esi,edx
+	; Round 12
+	mov	eax,DWORD [12+ebx]
+	mul	ebp
+	add	eax,esi
+	adc	edx,0
+	add	eax,DWORD [12+edi]
+	adc	edx,0
+	mov	DWORD [12+edi],eax
+	mov	esi,edx
+	; Round 16
+	mov	eax,DWORD [16+ebx]
+	mul	ebp
+	add	eax,esi
+	adc	edx,0
+	add	eax,DWORD [16+edi]
+	adc	edx,0
+	mov	DWORD [16+edi],eax
+	mov	esi,edx
+	; Round 20
+	mov	eax,DWORD [20+ebx]
+	mul	ebp
+	add	eax,esi
+	adc	edx,0
+	add	eax,DWORD [20+edi]
+	adc	edx,0
+	mov	DWORD [20+edi],eax
+	mov	esi,edx
+	; Round 24
+	mov	eax,DWORD [24+ebx]
+	mul	ebp
+	add	eax,esi
+	adc	edx,0
+	add	eax,DWORD [24+edi]
+	adc	edx,0
+	mov	DWORD [24+edi],eax
+	mov	esi,edx
+	; Round 28
+	mov	eax,DWORD [28+ebx]
+	mul	ebp
+	add	eax,esi
+	adc	edx,0
+	add	eax,DWORD [28+edi]
+	adc	edx,0
+	mov	DWORD [28+edi],eax
+	mov	esi,edx
+	; 
+	sub	ecx,8
+	lea	ebx,[32+ebx]
+	lea	edi,[32+edi]
+	jnz	NEAR L$006maw_loop
+L$005maw_finish:
+	mov	ecx,DWORD [32+esp]
+	and	ecx,7
+	jnz	NEAR L$007maw_finish2
+	jmp	NEAR L$008maw_end
+L$007maw_finish2:
+	; Tail Round 0
+	mov	eax,DWORD [ebx]
+	mul	ebp
+	add	eax,esi
+	adc	edx,0
+	add	eax,DWORD [edi]
+	adc	edx,0
+	dec	ecx
+	mov	DWORD [edi],eax
+	mov	esi,edx
+	jz	NEAR L$008maw_end
+	; Tail Round 1
+	mov	eax,DWORD [4+ebx]
+	mul	ebp
+	add	eax,esi
+	adc	edx,0
+	add	eax,DWORD [4+edi]
+	adc	edx,0
+	dec	ecx
+	mov	DWORD [4+edi],eax
+	mov	esi,edx
+	jz	NEAR L$008maw_end
+	; Tail Round 2
+	mov	eax,DWORD [8+ebx]
+	mul	ebp
+	add	eax,esi
+	adc	edx,0
+	add	eax,DWORD [8+edi]
+	adc	edx,0
+	dec	ecx
+	mov	DWORD [8+edi],eax
+	mov	esi,edx
+	jz	NEAR L$008maw_end
+	; Tail Round 3
+	mov	eax,DWORD [12+ebx]
+	mul	ebp
+	add	eax,esi
+	adc	edx,0
+	add	eax,DWORD [12+edi]
+	adc	edx,0
+	dec	ecx
+	mov	DWORD [12+edi],eax
+	mov	esi,edx
+	jz	NEAR L$008maw_end
+	; Tail Round 4
+	mov	eax,DWORD [16+ebx]
+	mul	ebp
+	add	eax,esi
+	adc	edx,0
+	add	eax,DWORD [16+edi]
+	adc	edx,0
+	dec	ecx
+	mov	DWORD [16+edi],eax
+	mov	esi,edx
+	jz	NEAR L$008maw_end
+	; Tail Round 5
+	mov	eax,DWORD [20+ebx]
+	mul	ebp
+	add	eax,esi
+	adc	edx,0
+	add	eax,DWORD [20+edi]
+	adc	edx,0
+	dec	ecx
+	mov	DWORD [20+edi],eax
+	mov	esi,edx
+	jz	NEAR L$008maw_end
+	; Tail Round 6
+	mov	eax,DWORD [24+ebx]
+	mul	ebp
+	add	eax,esi
+	adc	edx,0
+	add	eax,DWORD [24+edi]
+	adc	edx,0
+	mov	DWORD [24+edi],eax
+	mov	esi,edx
+L$008maw_end:
+	mov	eax,esi
+	pop	ecx
+	pop	edi
+	pop	esi
+	pop	ebx
+	pop	ebp
+	ret
+global	_bn_mul_words
+align	16
+_bn_mul_words:
+L$_bn_mul_words_begin:
+	lea	eax,[_OPENSSL_ia32cap_P]
+	bt	DWORD [eax],26
+	jnc	NEAR L$009mw_non_sse2
+	mov	eax,DWORD [4+esp]
+	mov	edx,DWORD [8+esp]
+	mov	ecx,DWORD [12+esp]
+	movd	mm0,DWORD [16+esp]
+	pxor	mm1,mm1
+align	16
+L$010mw_sse2_loop:
+	movd	mm2,DWORD [edx]
+	pmuludq	mm2,mm0
+	lea	edx,[4+edx]
+	paddq	mm1,mm2
+	movd	DWORD [eax],mm1
+	sub	ecx,1
+	psrlq	mm1,32
+	lea	eax,[4+eax]
+	jnz	NEAR L$010mw_sse2_loop
+	movd	eax,mm1
+	emms
+	ret
+align	16
+L$009mw_non_sse2:
+	push	ebp
+	push	ebx
+	push	esi
+	push	edi
+	; 
+	xor	esi,esi
+	mov	edi,DWORD [20+esp]
+	mov	ebx,DWORD [24+esp]
+	mov	ebp,DWORD [28+esp]
+	mov	ecx,DWORD [32+esp]
+	and	ebp,4294967288
+	jz	NEAR L$011mw_finish
+L$012mw_loop:
+	; Round 0
+	mov	eax,DWORD [ebx]
+	mul	ecx
+	add	eax,esi
+	adc	edx,0
+	mov	DWORD [edi],eax
+	mov	esi,edx
+	; Round 4
+	mov	eax,DWORD [4+ebx]
+	mul	ecx
+	add	eax,esi
+	adc	edx,0
+	mov	DWORD [4+edi],eax
+	mov	esi,edx
+	; Round 8
+	mov	eax,DWORD [8+ebx]
+	mul	ecx
+	add	eax,esi
+	adc	edx,0
+	mov	DWORD [8+edi],eax
+	mov	esi,edx
+	; Round 12
+	mov	eax,DWORD [12+ebx]
+	mul	ecx
+	add	eax,esi
+	adc	edx,0
+	mov	DWORD [12+edi],eax
+	mov	esi,edx
+	; Round 16
+	mov	eax,DWORD [16+ebx]
+	mul	ecx
+	add	eax,esi
+	adc	edx,0
+	mov	DWORD [16+edi],eax
+	mov	esi,edx
+	; Round 20
+	mov	eax,DWORD [20+ebx]
+	mul	ecx
+	add	eax,esi
+	adc	edx,0
+	mov	DWORD [20+edi],eax
+	mov	esi,edx
+	; Round 24
+	mov	eax,DWORD [24+ebx]
+	mul	ecx
+	add	eax,esi
+	adc	edx,0
+	mov	DWORD [24+edi],eax
+	mov	esi,edx
+	; Round 28
+	mov	eax,DWORD [28+ebx]
+	mul	ecx
+	add	eax,esi
+	adc	edx,0
+	mov	DWORD [28+edi],eax
+	mov	esi,edx
+	; 
+	add	ebx,32
+	add	edi,32
+	sub	ebp,8
+	jz	NEAR L$011mw_finish
+	jmp	NEAR L$012mw_loop
+L$011mw_finish:
+	mov	ebp,DWORD [28+esp]
+	and	ebp,7
+	jnz	NEAR L$013mw_finish2
+	jmp	NEAR L$014mw_end
+L$013mw_finish2:
+	; Tail Round 0
+	mov	eax,DWORD [ebx]
+	mul	ecx
+	add	eax,esi
+	adc	edx,0
+	mov	DWORD [edi],eax
+	mov	esi,edx
+	dec	ebp
+	jz	NEAR L$014mw_end
+	; Tail Round 1
+	mov	eax,DWORD [4+ebx]
+	mul	ecx
+	add	eax,esi
+	adc	edx,0
+	mov	DWORD [4+edi],eax
+	mov	esi,edx
+	dec	ebp
+	jz	NEAR L$014mw_end
+	; Tail Round 2
+	mov	eax,DWORD [8+ebx]
+	mul	ecx
+	add	eax,esi
+	adc	edx,0
+	mov	DWORD [8+edi],eax
+	mov	esi,edx
+	dec	ebp
+	jz	NEAR L$014mw_end
+	; Tail Round 3
+	mov	eax,DWORD [12+ebx]
+	mul	ecx
+	add	eax,esi
+	adc	edx,0
+	mov	DWORD [12+edi],eax
+	mov	esi,edx
+	dec	ebp
+	jz	NEAR L$014mw_end
+	; Tail Round 4
+	mov	eax,DWORD [16+ebx]
+	mul	ecx
+	add	eax,esi
+	adc	edx,0
+	mov	DWORD [16+edi],eax
+	mov	esi,edx
+	dec	ebp
+	jz	NEAR L$014mw_end
+	; Tail Round 5
+	mov	eax,DWORD [20+ebx]
+	mul	ecx
+	add	eax,esi
+	adc	edx,0
+	mov	DWORD [20+edi],eax
+	mov	esi,edx
+	dec	ebp
+	jz	NEAR L$014mw_end
+	; Tail Round 6
+	mov	eax,DWORD [24+ebx]
+	mul	ecx
+	add	eax,esi
+	adc	edx,0
+	mov	DWORD [24+edi],eax
+	mov	esi,edx
+L$014mw_end:
+	mov	eax,esi
+	pop	edi
+	pop	esi
+	pop	ebx
+	pop	ebp
+	ret
+global	_bn_sqr_words
+align	16
+_bn_sqr_words:
+L$_bn_sqr_words_begin:
+	lea	eax,[_OPENSSL_ia32cap_P]
+	bt	DWORD [eax],26
+	jnc	NEAR L$015sqr_non_sse2
+	mov	eax,DWORD [4+esp]
+	mov	edx,DWORD [8+esp]
+	mov	ecx,DWORD [12+esp]
+align	16
+L$016sqr_sse2_loop:
+	movd	mm0,DWORD [edx]
+	pmuludq	mm0,mm0
+	lea	edx,[4+edx]
+	movq	[eax],mm0
+	sub	ecx,1
+	lea	eax,[8+eax]
+	jnz	NEAR L$016sqr_sse2_loop
+	emms
+	ret
+align	16
+L$015sqr_non_sse2:
+	push	ebp
+	push	ebx
+	push	esi
+	push	edi
+	; 
+	mov	esi,DWORD [20+esp]
+	mov	edi,DWORD [24+esp]
+	mov	ebx,DWORD [28+esp]
+	and	ebx,4294967288
+	jz	NEAR L$017sw_finish
+L$018sw_loop:
+	; Round 0
+	mov	eax,DWORD [edi]
+	mul	eax
+	mov	DWORD [esi],eax
+	mov	DWORD [4+esi],edx
+	; Round 4
+	mov	eax,DWORD [4+edi]
+	mul	eax
+	mov	DWORD [8+esi],eax
+	mov	DWORD [12+esi],edx
+	; Round 8
+	mov	eax,DWORD [8+edi]
+	mul	eax
+	mov	DWORD [16+esi],eax
+	mov	DWORD [20+esi],edx
+	; Round 12
+	mov	eax,DWORD [12+edi]
+	mul	eax
+	mov	DWORD [24+esi],eax
+	mov	DWORD [28+esi],edx
+	; Round 16
+	mov	eax,DWORD [16+edi]
+	mul	eax
+	mov	DWORD [32+esi],eax
+	mov	DWORD [36+esi],edx
+	; Round 20
+	mov	eax,DWORD [20+edi]
+	mul	eax
+	mov	DWORD [40+esi],eax
+	mov	DWORD [44+esi],edx
+	; Round 24
+	mov	eax,DWORD [24+edi]
+	mul	eax
+	mov	DWORD [48+esi],eax
+	mov	DWORD [52+esi],edx
+	; Round 28
+	mov	eax,DWORD [28+edi]
+	mul	eax
+	mov	DWORD [56+esi],eax
+	mov	DWORD [60+esi],edx
+	; 
+	add	edi,32
+	add	esi,64
+	sub	ebx,8
+	jnz	NEAR L$018sw_loop
+L$017sw_finish:
+	mov	ebx,DWORD [28+esp]
+	and	ebx,7
+	jz	NEAR L$019sw_end
+	; Tail Round 0
+	mov	eax,DWORD [edi]
+	mul	eax
+	mov	DWORD [esi],eax
+	dec	ebx
+	mov	DWORD [4+esi],edx
+	jz	NEAR L$019sw_end
+	; Tail Round 1
+	mov	eax,DWORD [4+edi]
+	mul	eax
+	mov	DWORD [8+esi],eax
+	dec	ebx
+	mov	DWORD [12+esi],edx
+	jz	NEAR L$019sw_end
+	; Tail Round 2
+	mov	eax,DWORD [8+edi]
+	mul	eax
+	mov	DWORD [16+esi],eax
+	dec	ebx
+	mov	DWORD [20+esi],edx
+	jz	NEAR L$019sw_end
+	; Tail Round 3
+	mov	eax,DWORD [12+edi]
+	mul	eax
+	mov	DWORD [24+esi],eax
+	dec	ebx
+	mov	DWORD [28+esi],edx
+	jz	NEAR L$019sw_end
+	; Tail Round 4
+	mov	eax,DWORD [16+edi]
+	mul	eax
+	mov	DWORD [32+esi],eax
+	dec	ebx
+	mov	DWORD [36+esi],edx
+	jz	NEAR L$019sw_end
+	; Tail Round 5
+	mov	eax,DWORD [20+edi]
+	mul	eax
+	mov	DWORD [40+esi],eax
+	dec	ebx
+	mov	DWORD [44+esi],edx
+	jz	NEAR L$019sw_end
+	; Tail Round 6
+	mov	eax,DWORD [24+edi]
+	mul	eax
+	mov	DWORD [48+esi],eax
+	mov	DWORD [52+esi],edx
+L$019sw_end:
+	pop	edi
+	pop	esi
+	pop	ebx
+	pop	ebp
+	ret
+global	_bn_div_words
+align	16
+_bn_div_words:
+L$_bn_div_words_begin:
+	mov	edx,DWORD [4+esp]
+	mov	eax,DWORD [8+esp]
+	mov	ecx,DWORD [12+esp]
+	div	ecx
+	ret
+global	_bn_add_words
+align	16
+_bn_add_words:
+L$_bn_add_words_begin:
+	push	ebp
+	push	ebx
+	push	esi
+	push	edi
+	; 
+	mov	ebx,DWORD [20+esp]
+	mov	esi,DWORD [24+esp]
+	mov	edi,DWORD [28+esp]
+	mov	ebp,DWORD [32+esp]
+	xor	eax,eax
+	and	ebp,4294967288
+	jz	NEAR L$020aw_finish
+L$021aw_loop:
+	; Round 0
+	mov	ecx,DWORD [esi]
+	mov	edx,DWORD [edi]
+	add	ecx,eax
+	mov	eax,0
+	adc	eax,eax
+	add	ecx,edx
+	adc	eax,0
+	mov	DWORD [ebx],ecx
+	; Round 1
+	mov	ecx,DWORD [4+esi]
+	mov	edx,DWORD [4+edi]
+	add	ecx,eax
+	mov	eax,0
+	adc	eax,eax
+	add	ecx,edx
+	adc	eax,0
+	mov	DWORD [4+ebx],ecx
+	; Round 2
+	mov	ecx,DWORD [8+esi]
+	mov	edx,DWORD [8+edi]
+	add	ecx,eax
+	mov	eax,0
+	adc	eax,eax
+	add	ecx,edx
+	adc	eax,0
+	mov	DWORD [8+ebx],ecx
+	; Round 3
+	mov	ecx,DWORD [12+esi]
+	mov	edx,DWORD [12+edi]
+	add	ecx,eax
+	mov	eax,0
+	adc	eax,eax
+	add	ecx,edx
+	adc	eax,0
+	mov	DWORD [12+ebx],ecx
+	; Round 4
+	mov	ecx,DWORD [16+esi]
+	mov	edx,DWORD [16+edi]
+	add	ecx,eax
+	mov	eax,0
+	adc	eax,eax
+	add	ecx,edx
+	adc	eax,0
+	mov	DWORD [16+ebx],ecx
+	; Round 5
+	mov	ecx,DWORD [20+esi]
+	mov	edx,DWORD [20+edi]
+	add	ecx,eax
+	mov	eax,0
+	adc	eax,eax
+	add	ecx,edx
+	adc	eax,0
+	mov	DWORD [20+ebx],ecx
+	; Round 6
+	mov	ecx,DWORD [24+esi]
+	mov	edx,DWORD [24+edi]
+	add	ecx,eax
+	mov	eax,0
+	adc	eax,eax
+	add	ecx,edx
+	adc	eax,0
+	mov	DWORD [24+ebx],ecx
+	; Round 7
+	mov	ecx,DWORD [28+esi]
+	mov	edx,DWORD [28+edi]
+	add	ecx,eax
+	mov	eax,0
+	adc	eax,eax
+	add	ecx,edx
+	adc	eax,0
+	mov	DWORD [28+ebx],ecx
+	; 
+	add	esi,32
+	add	edi,32
+	add	ebx,32
+	sub	ebp,8
+	jnz	NEAR L$021aw_loop
+L$020aw_finish:
+	mov	ebp,DWORD [32+esp]
+	and	ebp,7
+	jz	NEAR L$022aw_end
+	; Tail Round 0
+	mov	ecx,DWORD [esi]
+	mov	edx,DWORD [edi]
+	add	ecx,eax
+	mov	eax,0
+	adc	eax,eax
+	add	ecx,edx
+	adc	eax,0
+	dec	ebp
+	mov	DWORD [ebx],ecx
+	jz	NEAR L$022aw_end
+	; Tail Round 1
+	mov	ecx,DWORD [4+esi]
+	mov	edx,DWORD [4+edi]
+	add	ecx,eax
+	mov	eax,0
+	adc	eax,eax
+	add	ecx,edx
+	adc	eax,0
+	dec	ebp
+	mov	DWORD [4+ebx],ecx
+	jz	NEAR L$022aw_end
+	; Tail Round 2
+	mov	ecx,DWORD [8+esi]
+	mov	edx,DWORD [8+edi]
+	add	ecx,eax
+	mov	eax,0
+	adc	eax,eax
+	add	ecx,edx
+	adc	eax,0
+	dec	ebp
+	mov	DWORD [8+ebx],ecx
+	jz	NEAR L$022aw_end
+	; Tail Round 3
+	mov	ecx,DWORD [12+esi]
+	mov	edx,DWORD [12+edi]
+	add	ecx,eax
+	mov	eax,0
+	adc	eax,eax
+	add	ecx,edx
+	adc	eax,0
+	dec	ebp
+	mov	DWORD [12+ebx],ecx
+	jz	NEAR L$022aw_end
+	; Tail Round 4
+	mov	ecx,DWORD [16+esi]
+	mov	edx,DWORD [16+edi]
+	add	ecx,eax
+	mov	eax,0
+	adc	eax,eax
+	add	ecx,edx
+	adc	eax,0
+	dec	ebp
+	mov	DWORD [16+ebx],ecx
+	jz	NEAR L$022aw_end
+	; Tail Round 5
+	mov	ecx,DWORD [20+esi]
+	mov	edx,DWORD [20+edi]
+	add	ecx,eax
+	mov	eax,0
+	adc	eax,eax
+	add	ecx,edx
+	adc	eax,0
+	dec	ebp
+	mov	DWORD [20+ebx],ecx
+	jz	NEAR L$022aw_end
+	; Tail Round 6
+	mov	ecx,DWORD [24+esi]
+	mov	edx,DWORD [24+edi]
+	add	ecx,eax
+	mov	eax,0
+	adc	eax,eax
+	add	ecx,edx
+	adc	eax,0
+	mov	DWORD [24+ebx],ecx
+L$022aw_end:
+	pop	edi
+	pop	esi
+	pop	ebx
+	pop	ebp
+	ret
+global	_bn_sub_words
+align	16
+_bn_sub_words:
+L$_bn_sub_words_begin:
+	push	ebp
+	push	ebx
+	push	esi
+	push	edi
+	; 
+	mov	ebx,DWORD [20+esp]
+	mov	esi,DWORD [24+esp]
+	mov	edi,DWORD [28+esp]
+	mov	ebp,DWORD [32+esp]
+	xor	eax,eax
+	and	ebp,4294967288
+	jz	NEAR L$023aw_finish
+L$024aw_loop:
+	; Round 0
+	mov	ecx,DWORD [esi]
+	mov	edx,DWORD [edi]
+	sub	ecx,eax
+	mov	eax,0
+	adc	eax,eax
+	sub	ecx,edx
+	adc	eax,0
+	mov	DWORD [ebx],ecx
+	; Round 1
+	mov	ecx,DWORD [4+esi]
+	mov	edx,DWORD [4+edi]
+	sub	ecx,eax
+	mov	eax,0
+	adc	eax,eax
+	sub	ecx,edx
+	adc	eax,0
+	mov	DWORD [4+ebx],ecx
+	; Round 2
+	mov	ecx,DWORD [8+esi]
+	mov	edx,DWORD [8+edi]
+	sub	ecx,eax
+	mov	eax,0
+	adc	eax,eax
+	sub	ecx,edx
+	adc	eax,0
+	mov	DWORD [8+ebx],ecx
+	; Round 3
+	mov	ecx,DWORD [12+esi]
+	mov	edx,DWORD [12+edi]
+	sub	ecx,eax
+	mov	eax,0
+	adc	eax,eax
+	sub	ecx,edx
+	adc	eax,0
+	mov	DWORD [12+ebx],ecx
+	; Round 4
+	mov	ecx,DWORD [16+esi]
+	mov	edx,DWORD [16+edi]
+	sub	ecx,eax
+	mov	eax,0
+	adc	eax,eax
+	sub	ecx,edx
+	adc	eax,0
+	mov	DWORD [16+ebx],ecx
+	; Round 5
+	mov	ecx,DWORD [20+esi]
+	mov	edx,DWORD [20+edi]
+	sub	ecx,eax
+	mov	eax,0
+	adc	eax,eax
+	sub	ecx,edx
+	adc	eax,0
+	mov	DWORD [20+ebx],ecx
+	; Round 6
+	mov	ecx,DWORD [24+esi]
+	mov	edx,DWORD [24+edi]
+	sub	ecx,eax
+	mov	eax,0
+	adc	eax,eax
+	sub	ecx,edx
+	adc	eax,0
+	mov	DWORD [24+ebx],ecx
+	; Round 7
+	mov	ecx,DWORD [28+esi]
+	mov	edx,DWORD [28+edi]
+	sub	ecx,eax
+	mov	eax,0
+	adc	eax,eax
+	sub	ecx,edx
+	adc	eax,0
+	mov	DWORD [28+ebx],ecx
+	; 
+	add	esi,32
+	add	edi,32
+	add	ebx,32
+	sub	ebp,8
+	jnz	NEAR L$024aw_loop
+L$023aw_finish:
+	mov	ebp,DWORD [32+esp]
+	and	ebp,7
+	jz	NEAR L$025aw_end
+	; Tail Round 0
+	mov	ecx,DWORD [esi]
+	mov	edx,DWORD [edi]
+	sub	ecx,eax
+	mov	eax,0
+	adc	eax,eax
+	sub	ecx,edx
+	adc	eax,0
+	dec	ebp
+	mov	DWORD [ebx],ecx
+	jz	NEAR L$025aw_end
+	; Tail Round 1
+	mov	ecx,DWORD [4+esi]
+	mov	edx,DWORD [4+edi]
+	sub	ecx,eax
+	mov	eax,0
+	adc	eax,eax
+	sub	ecx,edx
+	adc	eax,0
+	dec	ebp
+	mov	DWORD [4+ebx],ecx
+	jz	NEAR L$025aw_end
+	; Tail Round 2
+	mov	ecx,DWORD [8+esi]
+	mov	edx,DWORD [8+edi]
+	sub	ecx,eax
+	mov	eax,0
+	adc	eax,eax
+	sub	ecx,edx
+	adc	eax,0
+	dec	ebp
+	mov	DWORD [8+ebx],ecx
+	jz	NEAR L$025aw_end
+	; Tail Round 3
+	mov	ecx,DWORD [12+esi]
+	mov	edx,DWORD [12+edi]
+	sub	ecx,eax
+	mov	eax,0
+	adc	eax,eax
+	sub	ecx,edx
+	adc	eax,0
+	dec	ebp
+	mov	DWORD [12+ebx],ecx
+	jz	NEAR L$025aw_end
+	; Tail Round 4
+	mov	ecx,DWORD [16+esi]
+	mov	edx,DWORD [16+edi]
+	sub	ecx,eax
+	mov	eax,0
+	adc	eax,eax
+	sub	ecx,edx
+	adc	eax,0
+	dec	ebp
+	mov	DWORD [16+ebx],ecx
+	jz	NEAR L$025aw_end
+	; Tail Round 5
+	mov	ecx,DWORD [20+esi]
+	mov	edx,DWORD [20+edi]
+	sub	ecx,eax
+	mov	eax,0
+	adc	eax,eax
+	sub	ecx,edx
+	adc	eax,0
+	dec	ebp
+	mov	DWORD [20+ebx],ecx
+	jz	NEAR L$025aw_end
+	; Tail Round 6
+	mov	ecx,DWORD [24+esi]
+	mov	edx,DWORD [24+edi]
+	sub	ecx,eax
+	mov	eax,0
+	adc	eax,eax
+	sub	ecx,edx
+	adc	eax,0
+	mov	DWORD [24+ebx],ecx
+L$025aw_end:
+	pop	edi
+	pop	esi
+	pop	ebx
+	pop	ebp
+	ret
+global	_bn_sub_part_words
+align	16
+_bn_sub_part_words:
+L$_bn_sub_part_words_begin:
+	push	ebp
+	push	ebx
+	push	esi
+	push	edi
+	; 
+	mov	ebx,DWORD [20+esp]
+	mov	esi,DWORD [24+esp]
+	mov	edi,DWORD [28+esp]
+	mov	ebp,DWORD [32+esp]
+	xor	eax,eax
+	and	ebp,4294967288
+	jz	NEAR L$026aw_finish
+L$027aw_loop:
+	; Round 0
+	mov	ecx,DWORD [esi]
+	mov	edx,DWORD [edi]
+	sub	ecx,eax
+	mov	eax,0
+	adc	eax,eax
+	sub	ecx,edx
+	adc	eax,0
+	mov	DWORD [ebx],ecx
+	; Round 1
+	mov	ecx,DWORD [4+esi]
+	mov	edx,DWORD [4+edi]
+	sub	ecx,eax
+	mov	eax,0
+	adc	eax,eax
+	sub	ecx,edx
+	adc	eax,0
+	mov	DWORD [4+ebx],ecx
+	; Round 2
+	mov	ecx,DWORD [8+esi]
+	mov	edx,DWORD [8+edi]
+	sub	ecx,eax
+	mov	eax,0
+	adc	eax,eax
+	sub	ecx,edx
+	adc	eax,0
+	mov	DWORD [8+ebx],ecx
+	; Round 3
+	mov	ecx,DWORD [12+esi]
+	mov	edx,DWORD [12+edi]
+	sub	ecx,eax
+	mov	eax,0
+	adc	eax,eax
+	sub	ecx,edx
+	adc	eax,0
+	mov	DWORD [12+ebx],ecx
+	; Round 4
+	mov	ecx,DWORD [16+esi]
+	mov	edx,DWORD [16+edi]
+	sub	ecx,eax
+	mov	eax,0
+	adc	eax,eax
+	sub	ecx,edx
+	adc	eax,0
+	mov	DWORD [16+ebx],ecx
+	; Round 5
+	mov	ecx,DWORD [20+esi]
+	mov	edx,DWORD [20+edi]
+	sub	ecx,eax
+	mov	eax,0
+	adc	eax,eax
+	sub	ecx,edx
+	adc	eax,0
+	mov	DWORD [20+ebx],ecx
+	; Round 6
+	mov	ecx,DWORD [24+esi]
+	mov	edx,DWORD [24+edi]
+	sub	ecx,eax
+	mov	eax,0
+	adc	eax,eax
+	sub	ecx,edx
+	adc	eax,0
+	mov	DWORD [24+ebx],ecx
+	; Round 7
+	mov	ecx,DWORD [28+esi]
+	mov	edx,DWORD [28+edi]
+	sub	ecx,eax
+	mov	eax,0
+	adc	eax,eax
+	sub	ecx,edx
+	adc	eax,0
+	mov	DWORD [28+ebx],ecx
+	; 
+	add	esi,32
+	add	edi,32
+	add	ebx,32
+	sub	ebp,8
+	jnz	NEAR L$027aw_loop
+L$026aw_finish:
+	mov	ebp,DWORD [32+esp]
+	and	ebp,7
+	jz	NEAR L$028aw_end
+	; Tail Round 0
+	mov	ecx,DWORD [esi]
+	mov	edx,DWORD [edi]
+	sub	ecx,eax
+	mov	eax,0
+	adc	eax,eax
+	sub	ecx,edx
+	adc	eax,0
+	mov	DWORD [ebx],ecx
+	add	esi,4
+	add	edi,4
+	add	ebx,4
+	dec	ebp
+	jz	NEAR L$028aw_end
+	; Tail Round 1
+	mov	ecx,DWORD [esi]
+	mov	edx,DWORD [edi]
+	sub	ecx,eax
+	mov	eax,0
+	adc	eax,eax
+	sub	ecx,edx
+	adc	eax,0
+	mov	DWORD [ebx],ecx
+	add	esi,4
+	add	edi,4
+	add	ebx,4
+	dec	ebp
+	jz	NEAR L$028aw_end
+	; Tail Round 2
+	mov	ecx,DWORD [esi]
+	mov	edx,DWORD [edi]
+	sub	ecx,eax
+	mov	eax,0
+	adc	eax,eax
+	sub	ecx,edx
+	adc	eax,0
+	mov	DWORD [ebx],ecx
+	add	esi,4
+	add	edi,4
+	add	ebx,4
+	dec	ebp
+	jz	NEAR L$028aw_end
+	; Tail Round 3
+	mov	ecx,DWORD [esi]
+	mov	edx,DWORD [edi]
+	sub	ecx,eax
+	mov	eax,0
+	adc	eax,eax
+	sub	ecx,edx
+	adc	eax,0
+	mov	DWORD [ebx],ecx
+	add	esi,4
+	add	edi,4
+	add	ebx,4
+	dec	ebp
+	jz	NEAR L$028aw_end
+	; Tail Round 4
+	mov	ecx,DWORD [esi]
+	mov	edx,DWORD [edi]
+	sub	ecx,eax
+	mov	eax,0
+	adc	eax,eax
+	sub	ecx,edx
+	adc	eax,0
+	mov	DWORD [ebx],ecx
+	add	esi,4
+	add	edi,4
+	add	ebx,4
+	dec	ebp
+	jz	NEAR L$028aw_end
+	; Tail Round 5
+	mov	ecx,DWORD [esi]
+	mov	edx,DWORD [edi]
+	sub	ecx,eax
+	mov	eax,0
+	adc	eax,eax
+	sub	ecx,edx
+	adc	eax,0
+	mov	DWORD [ebx],ecx
+	add	esi,4
+	add	edi,4
+	add	ebx,4
+	dec	ebp
+	jz	NEAR L$028aw_end
+	; Tail Round 6
+	mov	ecx,DWORD [esi]
+	mov	edx,DWORD [edi]
+	sub	ecx,eax
+	mov	eax,0
+	adc	eax,eax
+	sub	ecx,edx
+	adc	eax,0
+	mov	DWORD [ebx],ecx
+	add	esi,4
+	add	edi,4
+	add	ebx,4
+L$028aw_end:
+	cmp	DWORD [36+esp],0
+	je	NEAR L$029pw_end
+	mov	ebp,DWORD [36+esp]
+	cmp	ebp,0
+	je	NEAR L$029pw_end
+	jge	NEAR L$030pw_pos
+	; pw_neg
+	mov	edx,0
+	sub	edx,ebp
+	mov	ebp,edx
+	and	ebp,4294967288
+	jz	NEAR L$031pw_neg_finish
+L$032pw_neg_loop:
+	; dl<0 Round 0
+	mov	ecx,0
+	mov	edx,DWORD [edi]
+	sub	ecx,eax
+	mov	eax,0
+	adc	eax,eax
+	sub	ecx,edx
+	adc	eax,0
+	mov	DWORD [ebx],ecx
+	; dl<0 Round 1
+	mov	ecx,0
+	mov	edx,DWORD [4+edi]
+	sub	ecx,eax
+	mov	eax,0
+	adc	eax,eax
+	sub	ecx,edx
+	adc	eax,0
+	mov	DWORD [4+ebx],ecx
+	; dl<0 Round 2
+	mov	ecx,0
+	mov	edx,DWORD [8+edi]
+	sub	ecx,eax
+	mov	eax,0
+	adc	eax,eax
+	sub	ecx,edx
+	adc	eax,0
+	mov	DWORD [8+ebx],ecx
+	; dl<0 Round 3
+	mov	ecx,0
+	mov	edx,DWORD [12+edi]
+	sub	ecx,eax
+	mov	eax,0
+	adc	eax,eax
+	sub	ecx,edx
+	adc	eax,0
+	mov	DWORD [12+ebx],ecx
+	; dl<0 Round 4
+	mov	ecx,0
+	mov	edx,DWORD [16+edi]
+	sub	ecx,eax
+	mov	eax,0
+	adc	eax,eax
+	sub	ecx,edx
+	adc	eax,0
+	mov	DWORD [16+ebx],ecx
+	; dl<0 Round 5
+	mov	ecx,0
+	mov	edx,DWORD [20+edi]
+	sub	ecx,eax
+	mov	eax,0
+	adc	eax,eax
+	sub	ecx,edx
+	adc	eax,0
+	mov	DWORD [20+ebx],ecx
+	; dl<0 Round 6
+	mov	ecx,0
+	mov	edx,DWORD [24+edi]
+	sub	ecx,eax
+	mov	eax,0
+	adc	eax,eax
+	sub	ecx,edx
+	adc	eax,0
+	mov	DWORD [24+ebx],ecx
+	; dl<0 Round 7
+	mov	ecx,0
+	mov	edx,DWORD [28+edi]
+	sub	ecx,eax
+	mov	eax,0
+	adc	eax,eax
+	sub	ecx,edx
+	adc	eax,0
+	mov	DWORD [28+ebx],ecx
+	; 
+	add	edi,32
+	add	ebx,32
+	sub	ebp,8
+	jnz	NEAR L$032pw_neg_loop
+L$031pw_neg_finish:
+	mov	edx,DWORD [36+esp]
+	mov	ebp,0
+	sub	ebp,edx
+	and	ebp,7
+	jz	NEAR L$029pw_end
+	; dl<0 Tail Round 0
+	mov	ecx,0
+	mov	edx,DWORD [edi]
+	sub	ecx,eax
+	mov	eax,0
+	adc	eax,eax
+	sub	ecx,edx
+	adc	eax,0
+	dec	ebp
+	mov	DWORD [ebx],ecx
+	jz	NEAR L$029pw_end
+	; dl<0 Tail Round 1
+	mov	ecx,0
+	mov	edx,DWORD [4+edi]
+	sub	ecx,eax
+	mov	eax,0
+	adc	eax,eax
+	sub	ecx,edx
+	adc	eax,0
+	dec	ebp
+	mov	DWORD [4+ebx],ecx
+	jz	NEAR L$029pw_end
+	; dl<0 Tail Round 2
+	mov	ecx,0
+	mov	edx,DWORD [8+edi]
+	sub	ecx,eax
+	mov	eax,0
+	adc	eax,eax
+	sub	ecx,edx
+	adc	eax,0
+	dec	ebp
+	mov	DWORD [8+ebx],ecx
+	jz	NEAR L$029pw_end
+	; dl<0 Tail Round 3
+	mov	ecx,0
+	mov	edx,DWORD [12+edi]
+	sub	ecx,eax
+	mov	eax,0
+	adc	eax,eax
+	sub	ecx,edx
+	adc	eax,0
+	dec	ebp
+	mov	DWORD [12+ebx],ecx
+	jz	NEAR L$029pw_end
+	; dl<0 Tail Round 4
+	mov	ecx,0
+	mov	edx,DWORD [16+edi]
+	sub	ecx,eax
+	mov	eax,0
+	adc	eax,eax
+	sub	ecx,edx
+	adc	eax,0
+	dec	ebp
+	mov	DWORD [16+ebx],ecx
+	jz	NEAR L$029pw_end
+	; dl<0 Tail Round 5
+	mov	ecx,0
+	mov	edx,DWORD [20+edi]
+	sub	ecx,eax
+	mov	eax,0
+	adc	eax,eax
+	sub	ecx,edx
+	adc	eax,0
+	dec	ebp
+	mov	DWORD [20+ebx],ecx
+	jz	NEAR L$029pw_end
+	; dl<0 Tail Round 6
+	mov	ecx,0
+	mov	edx,DWORD [24+edi]
+	sub	ecx,eax
+	mov	eax,0
+	adc	eax,eax
+	sub	ecx,edx
+	adc	eax,0
+	mov	DWORD [24+ebx],ecx
+	jmp	NEAR L$029pw_end
+L$030pw_pos:
+	and	ebp,4294967288
+	jz	NEAR L$033pw_pos_finish
+L$034pw_pos_loop:
+	; dl>0 Round 0
+	mov	ecx,DWORD [esi]
+	sub	ecx,eax
+	mov	DWORD [ebx],ecx
+	jnc	NEAR L$035pw_nc0
+	; dl>0 Round 1
+	mov	ecx,DWORD [4+esi]
+	sub	ecx,eax
+	mov	DWORD [4+ebx],ecx
+	jnc	NEAR L$036pw_nc1
+	; dl>0 Round 2
+	mov	ecx,DWORD [8+esi]
+	sub	ecx,eax
+	mov	DWORD [8+ebx],ecx
+	jnc	NEAR L$037pw_nc2
+	; dl>0 Round 3
+	mov	ecx,DWORD [12+esi]
+	sub	ecx,eax
+	mov	DWORD [12+ebx],ecx
+	jnc	NEAR L$038pw_nc3
+	; dl>0 Round 4
+	mov	ecx,DWORD [16+esi]
+	sub	ecx,eax
+	mov	DWORD [16+ebx],ecx
+	jnc	NEAR L$039pw_nc4
+	; dl>0 Round 5
+	mov	ecx,DWORD [20+esi]
+	sub	ecx,eax
+	mov	DWORD [20+ebx],ecx
+	jnc	NEAR L$040pw_nc5
+	; dl>0 Round 6
+	mov	ecx,DWORD [24+esi]
+	sub	ecx,eax
+	mov	DWORD [24+ebx],ecx
+	jnc	NEAR L$041pw_nc6
+	; dl>0 Round 7
+	mov	ecx,DWORD [28+esi]
+	sub	ecx,eax
+	mov	DWORD [28+ebx],ecx
+	jnc	NEAR L$042pw_nc7
+	; 
+	add	esi,32
+	add	ebx,32
+	sub	ebp,8
+	jnz	NEAR L$034pw_pos_loop
+L$033pw_pos_finish:
+	mov	ebp,DWORD [36+esp]
+	and	ebp,7
+	jz	NEAR L$029pw_end
+	; dl>0 Tail Round 0
+	mov	ecx,DWORD [esi]
+	sub	ecx,eax
+	mov	DWORD [ebx],ecx
+	jnc	NEAR L$043pw_tail_nc0
+	dec	ebp
+	jz	NEAR L$029pw_end
+	; dl>0 Tail Round 1
+	mov	ecx,DWORD [4+esi]
+	sub	ecx,eax
+	mov	DWORD [4+ebx],ecx
+	jnc	NEAR L$044pw_tail_nc1
+	dec	ebp
+	jz	NEAR L$029pw_end
+	; dl>0 Tail Round 2
+	mov	ecx,DWORD [8+esi]
+	sub	ecx,eax
+	mov	DWORD [8+ebx],ecx
+	jnc	NEAR L$045pw_tail_nc2
+	dec	ebp
+	jz	NEAR L$029pw_end
+	; dl>0 Tail Round 3
+	mov	ecx,DWORD [12+esi]
+	sub	ecx,eax
+	mov	DWORD [12+ebx],ecx
+	jnc	NEAR L$046pw_tail_nc3
+	dec	ebp
+	jz	NEAR L$029pw_end
+	; dl>0 Tail Round 4
+	mov	ecx,DWORD [16+esi]
+	sub	ecx,eax
+	mov	DWORD [16+ebx],ecx
+	jnc	NEAR L$047pw_tail_nc4
+	dec	ebp
+	jz	NEAR L$029pw_end
+	; dl>0 Tail Round 5
+	mov	ecx,DWORD [20+esi]
+	sub	ecx,eax
+	mov	DWORD [20+ebx],ecx
+	jnc	NEAR L$048pw_tail_nc5
+	dec	ebp
+	jz	NEAR L$029pw_end
+	; dl>0 Tail Round 6
+	mov	ecx,DWORD [24+esi]
+	sub	ecx,eax
+	mov	DWORD [24+ebx],ecx
+	jnc	NEAR L$049pw_tail_nc6
+	mov	eax,1
+	jmp	NEAR L$029pw_end
+L$050pw_nc_loop:
+	mov	ecx,DWORD [esi]
+	mov	DWORD [ebx],ecx
+L$035pw_nc0:
+	mov	ecx,DWORD [4+esi]
+	mov	DWORD [4+ebx],ecx
+L$036pw_nc1:
+	mov	ecx,DWORD [8+esi]
+	mov	DWORD [8+ebx],ecx
+L$037pw_nc2:
+	mov	ecx,DWORD [12+esi]
+	mov	DWORD [12+ebx],ecx
+L$038pw_nc3:
+	mov	ecx,DWORD [16+esi]
+	mov	DWORD [16+ebx],ecx
+L$039pw_nc4:
+	mov	ecx,DWORD [20+esi]
+	mov	DWORD [20+ebx],ecx
+L$040pw_nc5:
+	mov	ecx,DWORD [24+esi]
+	mov	DWORD [24+ebx],ecx
+L$041pw_nc6:
+	mov	ecx,DWORD [28+esi]
+	mov	DWORD [28+ebx],ecx
+L$042pw_nc7:
+	; 
+	add	esi,32
+	add	ebx,32
+	sub	ebp,8
+	jnz	NEAR L$050pw_nc_loop
+	mov	ebp,DWORD [36+esp]
+	and	ebp,7
+	jz	NEAR L$051pw_nc_end
+	mov	ecx,DWORD [esi]
+	mov	DWORD [ebx],ecx
+L$043pw_tail_nc0:
+	dec	ebp
+	jz	NEAR L$051pw_nc_end
+	mov	ecx,DWORD [4+esi]
+	mov	DWORD [4+ebx],ecx
+L$044pw_tail_nc1:
+	dec	ebp
+	jz	NEAR L$051pw_nc_end
+	mov	ecx,DWORD [8+esi]
+	mov	DWORD [8+ebx],ecx
+L$045pw_tail_nc2:
+	dec	ebp
+	jz	NEAR L$051pw_nc_end
+	mov	ecx,DWORD [12+esi]
+	mov	DWORD [12+ebx],ecx
+L$046pw_tail_nc3:
+	dec	ebp
+	jz	NEAR L$051pw_nc_end
+	mov	ecx,DWORD [16+esi]
+	mov	DWORD [16+ebx],ecx
+L$047pw_tail_nc4:
+	dec	ebp
+	jz	NEAR L$051pw_nc_end
+	mov	ecx,DWORD [20+esi]
+	mov	DWORD [20+ebx],ecx
+L$048pw_tail_nc5:
+	dec	ebp
+	jz	NEAR L$051pw_nc_end
+	mov	ecx,DWORD [24+esi]
+	mov	DWORD [24+ebx],ecx
+L$049pw_tail_nc6:
+L$051pw_nc_end:
+	mov	eax,0
+L$029pw_end:
+	pop	edi
+	pop	esi
+	pop	ebx
+	pop	ebp
+	ret
+segment	.bss
+common	_OPENSSL_ia32cap_P 16
diff --git a/third_party/boringssl/win-x86/crypto/bn/co-586.asm b/third_party/boringssl/win-x86/crypto/bn/co-586.asm
new file mode 100644
index 0000000..5780dc8
--- /dev/null
+++ b/third_party/boringssl/win-x86/crypto/bn/co-586.asm
@@ -0,0 +1,1260 @@
+%ifidn __OUTPUT_FORMAT__,obj
+section	code	use32 class=code align=64
+%elifidn __OUTPUT_FORMAT__,win32
+%ifdef __YASM_VERSION_ID__
+%if __YASM_VERSION_ID__ < 01010000h
+%error yasm version 1.1.0 or later needed.
+%endif
+; Yasm automatically includes .00 and complains about redefining it.
+; https://www.tortall.net/projects/yasm/manual/html/objfmt-win32-safeseh.html
+%else
+$@feat.00 equ 1
+%endif
+section	.text	code align=64
+%else
+section	.text	code
+%endif
+global	_bn_mul_comba8
+align	16
+_bn_mul_comba8:
+L$_bn_mul_comba8_begin:
+	push	esi
+	mov	esi,DWORD [12+esp]
+	push	edi
+	mov	edi,DWORD [20+esp]
+	push	ebp
+	push	ebx
+	xor	ebx,ebx
+	mov	eax,DWORD [esi]
+	xor	ecx,ecx
+	mov	edx,DWORD [edi]
+	; ################## Calculate word 0
+	xor	ebp,ebp
+	; mul a[0]*b[0]
+	mul	edx
+	add	ebx,eax
+	mov	eax,DWORD [20+esp]
+	adc	ecx,edx
+	mov	edx,DWORD [edi]
+	adc	ebp,0
+	mov	DWORD [eax],ebx
+	mov	eax,DWORD [4+esi]
+	; saved r[0]
+	; ################## Calculate word 1
+	xor	ebx,ebx
+	; mul a[1]*b[0]
+	mul	edx
+	add	ecx,eax
+	mov	eax,DWORD [esi]
+	adc	ebp,edx
+	mov	edx,DWORD [4+edi]
+	adc	ebx,0
+	; mul a[0]*b[1]
+	mul	edx
+	add	ecx,eax
+	mov	eax,DWORD [20+esp]
+	adc	ebp,edx
+	mov	edx,DWORD [edi]
+	adc	ebx,0
+	mov	DWORD [4+eax],ecx
+	mov	eax,DWORD [8+esi]
+	; saved r[1]
+	; ################## Calculate word 2
+	xor	ecx,ecx
+	; mul a[2]*b[0]
+	mul	edx
+	add	ebp,eax
+	mov	eax,DWORD [4+esi]
+	adc	ebx,edx
+	mov	edx,DWORD [4+edi]
+	adc	ecx,0
+	; mul a[1]*b[1]
+	mul	edx
+	add	ebp,eax
+	mov	eax,DWORD [esi]
+	adc	ebx,edx
+	mov	edx,DWORD [8+edi]
+	adc	ecx,0
+	; mul a[0]*b[2]
+	mul	edx
+	add	ebp,eax
+	mov	eax,DWORD [20+esp]
+	adc	ebx,edx
+	mov	edx,DWORD [edi]
+	adc	ecx,0
+	mov	DWORD [8+eax],ebp
+	mov	eax,DWORD [12+esi]
+	; saved r[2]
+	; ################## Calculate word 3
+	xor	ebp,ebp
+	; mul a[3]*b[0]
+	mul	edx
+	add	ebx,eax
+	mov	eax,DWORD [8+esi]
+	adc	ecx,edx
+	mov	edx,DWORD [4+edi]
+	adc	ebp,0
+	; mul a[2]*b[1]
+	mul	edx
+	add	ebx,eax
+	mov	eax,DWORD [4+esi]
+	adc	ecx,edx
+	mov	edx,DWORD [8+edi]
+	adc	ebp,0
+	; mul a[1]*b[2]
+	mul	edx
+	add	ebx,eax
+	mov	eax,DWORD [esi]
+	adc	ecx,edx
+	mov	edx,DWORD [12+edi]
+	adc	ebp,0
+	; mul a[0]*b[3]
+	mul	edx
+	add	ebx,eax
+	mov	eax,DWORD [20+esp]
+	adc	ecx,edx
+	mov	edx,DWORD [edi]
+	adc	ebp,0
+	mov	DWORD [12+eax],ebx
+	mov	eax,DWORD [16+esi]
+	; saved r[3]
+	; ################## Calculate word 4
+	xor	ebx,ebx
+	; mul a[4]*b[0]
+	mul	edx
+	add	ecx,eax
+	mov	eax,DWORD [12+esi]
+	adc	ebp,edx
+	mov	edx,DWORD [4+edi]
+	adc	ebx,0
+	; mul a[3]*b[1]
+	mul	edx
+	add	ecx,eax
+	mov	eax,DWORD [8+esi]
+	adc	ebp,edx
+	mov	edx,DWORD [8+edi]
+	adc	ebx,0
+	; mul a[2]*b[2]
+	mul	edx
+	add	ecx,eax
+	mov	eax,DWORD [4+esi]
+	adc	ebp,edx
+	mov	edx,DWORD [12+edi]
+	adc	ebx,0
+	; mul a[1]*b[3]
+	mul	edx
+	add	ecx,eax
+	mov	eax,DWORD [esi]
+	adc	ebp,edx
+	mov	edx,DWORD [16+edi]
+	adc	ebx,0
+	; mul a[0]*b[4]
+	mul	edx
+	add	ecx,eax
+	mov	eax,DWORD [20+esp]
+	adc	ebp,edx
+	mov	edx,DWORD [edi]
+	adc	ebx,0
+	mov	DWORD [16+eax],ecx
+	mov	eax,DWORD [20+esi]
+	; saved r[4]
+	; ################## Calculate word 5
+	xor	ecx,ecx
+	; mul a[5]*b[0]
+	mul	edx
+	add	ebp,eax
+	mov	eax,DWORD [16+esi]
+	adc	ebx,edx
+	mov	edx,DWORD [4+edi]
+	adc	ecx,0
+	; mul a[4]*b[1]
+	mul	edx
+	add	ebp,eax
+	mov	eax,DWORD [12+esi]
+	adc	ebx,edx
+	mov	edx,DWORD [8+edi]
+	adc	ecx,0
+	; mul a[3]*b[2]
+	mul	edx
+	add	ebp,eax
+	mov	eax,DWORD [8+esi]
+	adc	ebx,edx
+	mov	edx,DWORD [12+edi]
+	adc	ecx,0
+	; mul a[2]*b[3]
+	mul	edx
+	add	ebp,eax
+	mov	eax,DWORD [4+esi]
+	adc	ebx,edx
+	mov	edx,DWORD [16+edi]
+	adc	ecx,0
+	; mul a[1]*b[4]
+	mul	edx
+	add	ebp,eax
+	mov	eax,DWORD [esi]
+	adc	ebx,edx
+	mov	edx,DWORD [20+edi]
+	adc	ecx,0
+	; mul a[0]*b[5]
+	mul	edx
+	add	ebp,eax
+	mov	eax,DWORD [20+esp]
+	adc	ebx,edx
+	mov	edx,DWORD [edi]
+	adc	ecx,0
+	mov	DWORD [20+eax],ebp
+	mov	eax,DWORD [24+esi]
+	; saved r[5]
+	; ################## Calculate word 6
+	xor	ebp,ebp
+	; mul a[6]*b[0]
+	mul	edx
+	add	ebx,eax
+	mov	eax,DWORD [20+esi]
+	adc	ecx,edx
+	mov	edx,DWORD [4+edi]
+	adc	ebp,0
+	; mul a[5]*b[1]
+	mul	edx
+	add	ebx,eax
+	mov	eax,DWORD [16+esi]
+	adc	ecx,edx
+	mov	edx,DWORD [8+edi]
+	adc	ebp,0
+	; mul a[4]*b[2]
+	mul	edx
+	add	ebx,eax
+	mov	eax,DWORD [12+esi]
+	adc	ecx,edx
+	mov	edx,DWORD [12+edi]
+	adc	ebp,0
+	; mul a[3]*b[3]
+	mul	edx
+	add	ebx,eax
+	mov	eax,DWORD [8+esi]
+	adc	ecx,edx
+	mov	edx,DWORD [16+edi]
+	adc	ebp,0
+	; mul a[2]*b[4]
+	mul	edx
+	add	ebx,eax
+	mov	eax,DWORD [4+esi]
+	adc	ecx,edx
+	mov	edx,DWORD [20+edi]
+	adc	ebp,0
+	; mul a[1]*b[5]
+	mul	edx
+	add	ebx,eax
+	mov	eax,DWORD [esi]
+	adc	ecx,edx
+	mov	edx,DWORD [24+edi]
+	adc	ebp,0
+	; mul a[0]*b[6]
+	mul	edx
+	add	ebx,eax
+	mov	eax,DWORD [20+esp]
+	adc	ecx,edx
+	mov	edx,DWORD [edi]
+	adc	ebp,0
+	mov	DWORD [24+eax],ebx
+	mov	eax,DWORD [28+esi]
+	; saved r[6]
+	; ################## Calculate word 7
+	xor	ebx,ebx
+	; mul a[7]*b[0]
+	mul	edx
+	add	ecx,eax
+	mov	eax,DWORD [24+esi]
+	adc	ebp,edx
+	mov	edx,DWORD [4+edi]
+	adc	ebx,0
+	; mul a[6]*b[1]
+	mul	edx
+	add	ecx,eax
+	mov	eax,DWORD [20+esi]
+	adc	ebp,edx
+	mov	edx,DWORD [8+edi]
+	adc	ebx,0
+	; mul a[5]*b[2]
+	mul	edx
+	add	ecx,eax
+	mov	eax,DWORD [16+esi]
+	adc	ebp,edx
+	mov	edx,DWORD [12+edi]
+	adc	ebx,0
+	; mul a[4]*b[3]
+	mul	edx
+	add	ecx,eax
+	mov	eax,DWORD [12+esi]
+	adc	ebp,edx
+	mov	edx,DWORD [16+edi]
+	adc	ebx,0
+	; mul a[3]*b[4]
+	mul	edx
+	add	ecx,eax
+	mov	eax,DWORD [8+esi]
+	adc	ebp,edx
+	mov	edx,DWORD [20+edi]
+	adc	ebx,0
+	; mul a[2]*b[5]
+	mul	edx
+	add	ecx,eax
+	mov	eax,DWORD [4+esi]
+	adc	ebp,edx
+	mov	edx,DWORD [24+edi]
+	adc	ebx,0
+	; mul a[1]*b[6]
+	mul	edx
+	add	ecx,eax
+	mov	eax,DWORD [esi]
+	adc	ebp,edx
+	mov	edx,DWORD [28+edi]
+	adc	ebx,0
+	; mul a[0]*b[7]
+	mul	edx
+	add	ecx,eax
+	mov	eax,DWORD [20+esp]
+	adc	ebp,edx
+	mov	edx,DWORD [4+edi]
+	adc	ebx,0
+	mov	DWORD [28+eax],ecx
+	mov	eax,DWORD [28+esi]
+	; saved r[7]
+	; ################## Calculate word 8
+	xor	ecx,ecx
+	; mul a[7]*b[1]
+	mul	edx
+	add	ebp,eax
+	mov	eax,DWORD [24+esi]
+	adc	ebx,edx
+	mov	edx,DWORD [8+edi]
+	adc	ecx,0
+	; mul a[6]*b[2]
+	mul	edx
+	add	ebp,eax
+	mov	eax,DWORD [20+esi]
+	adc	ebx,edx
+	mov	edx,DWORD [12+edi]
+	adc	ecx,0
+	; mul a[5]*b[3]
+	mul	edx
+	add	ebp,eax
+	mov	eax,DWORD [16+esi]
+	adc	ebx,edx
+	mov	edx,DWORD [16+edi]
+	adc	ecx,0
+	; mul a[4]*b[4]
+	mul	edx
+	add	ebp,eax
+	mov	eax,DWORD [12+esi]
+	adc	ebx,edx
+	mov	edx,DWORD [20+edi]
+	adc	ecx,0
+	; mul a[3]*b[5]
+	mul	edx
+	add	ebp,eax
+	mov	eax,DWORD [8+esi]
+	adc	ebx,edx
+	mov	edx,DWORD [24+edi]
+	adc	ecx,0
+	; mul a[2]*b[6]
+	mul	edx
+	add	ebp,eax
+	mov	eax,DWORD [4+esi]
+	adc	ebx,edx
+	mov	edx,DWORD [28+edi]
+	adc	ecx,0
+	; mul a[1]*b[7]
+	mul	edx
+	add	ebp,eax
+	mov	eax,DWORD [20+esp]
+	adc	ebx,edx
+	mov	edx,DWORD [8+edi]
+	adc	ecx,0
+	mov	DWORD [32+eax],ebp
+	mov	eax,DWORD [28+esi]
+	; saved r[8]
+	; ################## Calculate word 9
+	xor	ebp,ebp
+	; mul a[7]*b[2]
+	mul	edx
+	add	ebx,eax
+	mov	eax,DWORD [24+esi]
+	adc	ecx,edx
+	mov	edx,DWORD [12+edi]
+	adc	ebp,0
+	; mul a[6]*b[3]
+	mul	edx
+	add	ebx,eax
+	mov	eax,DWORD [20+esi]
+	adc	ecx,edx
+	mov	edx,DWORD [16+edi]
+	adc	ebp,0
+	; mul a[5]*b[4]
+	mul	edx
+	add	ebx,eax
+	mov	eax,DWORD [16+esi]
+	adc	ecx,edx
+	mov	edx,DWORD [20+edi]
+	adc	ebp,0
+	; mul a[4]*b[5]
+	mul	edx
+	add	ebx,eax
+	mov	eax,DWORD [12+esi]
+	adc	ecx,edx
+	mov	edx,DWORD [24+edi]
+	adc	ebp,0
+	; mul a[3]*b[6]
+	mul	edx
+	add	ebx,eax
+	mov	eax,DWORD [8+esi]
+	adc	ecx,edx
+	mov	edx,DWORD [28+edi]
+	adc	ebp,0
+	; mul a[2]*b[7]
+	mul	edx
+	add	ebx,eax
+	mov	eax,DWORD [20+esp]
+	adc	ecx,edx
+	mov	edx,DWORD [12+edi]
+	adc	ebp,0
+	mov	DWORD [36+eax],ebx
+	mov	eax,DWORD [28+esi]
+	; saved r[9]
+	; ################## Calculate word 10
+	xor	ebx,ebx
+	; mul a[7]*b[3]
+	mul	edx
+	add	ecx,eax
+	mov	eax,DWORD [24+esi]
+	adc	ebp,edx
+	mov	edx,DWORD [16+edi]
+	adc	ebx,0
+	; mul a[6]*b[4]
+	mul	edx
+	add	ecx,eax
+	mov	eax,DWORD [20+esi]
+	adc	ebp,edx
+	mov	edx,DWORD [20+edi]
+	adc	ebx,0
+	; mul a[5]*b[5]
+	mul	edx
+	add	ecx,eax
+	mov	eax,DWORD [16+esi]
+	adc	ebp,edx
+	mov	edx,DWORD [24+edi]
+	adc	ebx,0
+	; mul a[4]*b[6]
+	mul	edx
+	add	ecx,eax
+	mov	eax,DWORD [12+esi]
+	adc	ebp,edx
+	mov	edx,DWORD [28+edi]
+	adc	ebx,0
+	; mul a[3]*b[7]
+	mul	edx
+	add	ecx,eax
+	mov	eax,DWORD [20+esp]
+	adc	ebp,edx
+	mov	edx,DWORD [16+edi]
+	adc	ebx,0
+	mov	DWORD [40+eax],ecx
+	mov	eax,DWORD [28+esi]
+	; saved r[10]
+	; ################## Calculate word 11
+	xor	ecx,ecx
+	; mul a[7]*b[4]
+	mul	edx
+	add	ebp,eax
+	mov	eax,DWORD [24+esi]
+	adc	ebx,edx
+	mov	edx,DWORD [20+edi]
+	adc	ecx,0
+	; mul a[6]*b[5]
+	mul	edx
+	add	ebp,eax
+	mov	eax,DWORD [20+esi]
+	adc	ebx,edx
+	mov	edx,DWORD [24+edi]
+	adc	ecx,0
+	; mul a[5]*b[6]
+	mul	edx
+	add	ebp,eax
+	mov	eax,DWORD [16+esi]
+	adc	ebx,edx
+	mov	edx,DWORD [28+edi]
+	adc	ecx,0
+	; mul a[4]*b[7]
+	mul	edx
+	add	ebp,eax
+	mov	eax,DWORD [20+esp]
+	adc	ebx,edx
+	mov	edx,DWORD [20+edi]
+	adc	ecx,0
+	mov	DWORD [44+eax],ebp
+	mov	eax,DWORD [28+esi]
+	; saved r[11]
+	; ################## Calculate word 12
+	xor	ebp,ebp
+	; mul a[7]*b[5]
+	mul	edx
+	add	ebx,eax
+	mov	eax,DWORD [24+esi]
+	adc	ecx,edx
+	mov	edx,DWORD [24+edi]
+	adc	ebp,0
+	; mul a[6]*b[6]
+	mul	edx
+	add	ebx,eax
+	mov	eax,DWORD [20+esi]
+	adc	ecx,edx
+	mov	edx,DWORD [28+edi]
+	adc	ebp,0
+	; mul a[5]*b[7]
+	mul	edx
+	add	ebx,eax
+	mov	eax,DWORD [20+esp]
+	adc	ecx,edx
+	mov	edx,DWORD [24+edi]
+	adc	ebp,0
+	mov	DWORD [48+eax],ebx
+	mov	eax,DWORD [28+esi]
+	; saved r[12]
+	; ################## Calculate word 13
+	xor	ebx,ebx
+	; mul a[7]*b[6]
+	mul	edx
+	add	ecx,eax
+	mov	eax,DWORD [24+esi]
+	adc	ebp,edx
+	mov	edx,DWORD [28+edi]
+	adc	ebx,0
+	; mul a[6]*b[7]
+	mul	edx
+	add	ecx,eax
+	mov	eax,DWORD [20+esp]
+	adc	ebp,edx
+	mov	edx,DWORD [28+edi]
+	adc	ebx,0
+	mov	DWORD [52+eax],ecx
+	mov	eax,DWORD [28+esi]
+	; saved r[13]
+	; ################## Calculate word 14
+	xor	ecx,ecx
+	; mul a[7]*b[7]
+	mul	edx
+	add	ebp,eax
+	mov	eax,DWORD [20+esp]
+	adc	ebx,edx
+	adc	ecx,0
+	mov	DWORD [56+eax],ebp
+	; saved r[14]
+	; save r[15]
+	mov	DWORD [60+eax],ebx
+	pop	ebx
+	pop	ebp
+	pop	edi
+	pop	esi
+	ret
+global	_bn_mul_comba4
+align	16
+_bn_mul_comba4:
+L$_bn_mul_comba4_begin:
+	push	esi
+	mov	esi,DWORD [12+esp]
+	push	edi
+	mov	edi,DWORD [20+esp]
+	push	ebp
+	push	ebx
+	xor	ebx,ebx
+	mov	eax,DWORD [esi]
+	xor	ecx,ecx
+	mov	edx,DWORD [edi]
+	; ################## Calculate word 0
+	xor	ebp,ebp
+	; mul a[0]*b[0]
+	mul	edx
+	add	ebx,eax
+	mov	eax,DWORD [20+esp]
+	adc	ecx,edx
+	mov	edx,DWORD [edi]
+	adc	ebp,0
+	mov	DWORD [eax],ebx
+	mov	eax,DWORD [4+esi]
+	; saved r[0]
+	; ################## Calculate word 1
+	xor	ebx,ebx
+	; mul a[1]*b[0]
+	mul	edx
+	add	ecx,eax
+	mov	eax,DWORD [esi]
+	adc	ebp,edx
+	mov	edx,DWORD [4+edi]
+	adc	ebx,0
+	; mul a[0]*b[1]
+	mul	edx
+	add	ecx,eax
+	mov	eax,DWORD [20+esp]
+	adc	ebp,edx
+	mov	edx,DWORD [edi]
+	adc	ebx,0
+	mov	DWORD [4+eax],ecx
+	mov	eax,DWORD [8+esi]
+	; saved r[1]
+	; ################## Calculate word 2
+	xor	ecx,ecx
+	; mul a[2]*b[0]
+	mul	edx
+	add	ebp,eax
+	mov	eax,DWORD [4+esi]
+	adc	ebx,edx
+	mov	edx,DWORD [4+edi]
+	adc	ecx,0
+	; mul a[1]*b[1]
+	mul	edx
+	add	ebp,eax
+	mov	eax,DWORD [esi]
+	adc	ebx,edx
+	mov	edx,DWORD [8+edi]
+	adc	ecx,0
+	; mul a[0]*b[2]
+	mul	edx
+	add	ebp,eax
+	mov	eax,DWORD [20+esp]
+	adc	ebx,edx
+	mov	edx,DWORD [edi]
+	adc	ecx,0
+	mov	DWORD [8+eax],ebp
+	mov	eax,DWORD [12+esi]
+	; saved r[2]
+	; ################## Calculate word 3
+	xor	ebp,ebp
+	; mul a[3]*b[0]
+	mul	edx
+	add	ebx,eax
+	mov	eax,DWORD [8+esi]
+	adc	ecx,edx
+	mov	edx,DWORD [4+edi]
+	adc	ebp,0
+	; mul a[2]*b[1]
+	mul	edx
+	add	ebx,eax
+	mov	eax,DWORD [4+esi]
+	adc	ecx,edx
+	mov	edx,DWORD [8+edi]
+	adc	ebp,0
+	; mul a[1]*b[2]
+	mul	edx
+	add	ebx,eax
+	mov	eax,DWORD [esi]
+	adc	ecx,edx
+	mov	edx,DWORD [12+edi]
+	adc	ebp,0
+	; mul a[0]*b[3]
+	mul	edx
+	add	ebx,eax
+	mov	eax,DWORD [20+esp]
+	adc	ecx,edx
+	mov	edx,DWORD [4+edi]
+	adc	ebp,0
+	mov	DWORD [12+eax],ebx
+	mov	eax,DWORD [12+esi]
+	; saved r[3]
+	; ################## Calculate word 4
+	xor	ebx,ebx
+	; mul a[3]*b[1]
+	mul	edx
+	add	ecx,eax
+	mov	eax,DWORD [8+esi]
+	adc	ebp,edx
+	mov	edx,DWORD [8+edi]
+	adc	ebx,0
+	; mul a[2]*b[2]
+	mul	edx
+	add	ecx,eax
+	mov	eax,DWORD [4+esi]
+	adc	ebp,edx
+	mov	edx,DWORD [12+edi]
+	adc	ebx,0
+	; mul a[1]*b[3]
+	mul	edx
+	add	ecx,eax
+	mov	eax,DWORD [20+esp]
+	adc	ebp,edx
+	mov	edx,DWORD [8+edi]
+	adc	ebx,0
+	mov	DWORD [16+eax],ecx
+	mov	eax,DWORD [12+esi]
+	; saved r[4]
+	; ################## Calculate word 5
+	xor	ecx,ecx
+	; mul a[3]*b[2]
+	mul	edx
+	add	ebp,eax
+	mov	eax,DWORD [8+esi]
+	adc	ebx,edx
+	mov	edx,DWORD [12+edi]
+	adc	ecx,0
+	; mul a[2]*b[3]
+	mul	edx
+	add	ebp,eax
+	mov	eax,DWORD [20+esp]
+	adc	ebx,edx
+	mov	edx,DWORD [12+edi]
+	adc	ecx,0
+	mov	DWORD [20+eax],ebp
+	mov	eax,DWORD [12+esi]
+	; saved r[5]
+	; ################## Calculate word 6
+	xor	ebp,ebp
+	; mul a[3]*b[3]
+	mul	edx
+	add	ebx,eax
+	mov	eax,DWORD [20+esp]
+	adc	ecx,edx
+	adc	ebp,0
+	mov	DWORD [24+eax],ebx
+	; saved r[6]
+	; save r[7]
+	mov	DWORD [28+eax],ecx
+	pop	ebx
+	pop	ebp
+	pop	edi
+	pop	esi
+	ret
+global	_bn_sqr_comba8
+align	16
+_bn_sqr_comba8:
+L$_bn_sqr_comba8_begin:
+	push	esi
+	push	edi
+	push	ebp
+	push	ebx
+	mov	edi,DWORD [20+esp]
+	mov	esi,DWORD [24+esp]
+	xor	ebx,ebx
+	xor	ecx,ecx
+	mov	eax,DWORD [esi]
+	; ############### Calculate word 0
+	xor	ebp,ebp
+	; sqr a[0]*a[0]
+	mul	eax
+	add	ebx,eax
+	adc	ecx,edx
+	mov	edx,DWORD [esi]
+	adc	ebp,0
+	mov	DWORD [edi],ebx
+	mov	eax,DWORD [4+esi]
+	; saved r[0]
+	; ############### Calculate word 1
+	xor	ebx,ebx
+	; sqr a[1]*a[0]
+	mul	edx
+	add	eax,eax
+	adc	edx,edx
+	adc	ebx,0
+	add	ecx,eax
+	adc	ebp,edx
+	mov	eax,DWORD [8+esi]
+	adc	ebx,0
+	mov	DWORD [4+edi],ecx
+	mov	edx,DWORD [esi]
+	; saved r[1]
+	; ############### Calculate word 2
+	xor	ecx,ecx
+	; sqr a[2]*a[0]
+	mul	edx
+	add	eax,eax
+	adc	edx,edx
+	adc	ecx,0
+	add	ebp,eax
+	adc	ebx,edx
+	mov	eax,DWORD [4+esi]
+	adc	ecx,0
+	; sqr a[1]*a[1]
+	mul	eax
+	add	ebp,eax
+	adc	ebx,edx
+	mov	edx,DWORD [esi]
+	adc	ecx,0
+	mov	DWORD [8+edi],ebp
+	mov	eax,DWORD [12+esi]
+	; saved r[2]
+	; ############### Calculate word 3
+	xor	ebp,ebp
+	; sqr a[3]*a[0]
+	mul	edx
+	add	eax,eax
+	adc	edx,edx
+	adc	ebp,0
+	add	ebx,eax
+	adc	ecx,edx
+	mov	eax,DWORD [8+esi]
+	adc	ebp,0
+	mov	edx,DWORD [4+esi]
+	; sqr a[2]*a[1]
+	mul	edx
+	add	eax,eax
+	adc	edx,edx
+	adc	ebp,0
+	add	ebx,eax
+	adc	ecx,edx
+	mov	eax,DWORD [16+esi]
+	adc	ebp,0
+	mov	DWORD [12+edi],ebx
+	mov	edx,DWORD [esi]
+	; saved r[3]
+	; ############### Calculate word 4
+	xor	ebx,ebx
+	; sqr a[4]*a[0]
+	mul	edx
+	add	eax,eax
+	adc	edx,edx
+	adc	ebx,0
+	add	ecx,eax
+	adc	ebp,edx
+	mov	eax,DWORD [12+esi]
+	adc	ebx,0
+	mov	edx,DWORD [4+esi]
+	; sqr a[3]*a[1]
+	mul	edx
+	add	eax,eax
+	adc	edx,edx
+	adc	ebx,0
+	add	ecx,eax
+	adc	ebp,edx
+	mov	eax,DWORD [8+esi]
+	adc	ebx,0
+	; sqr a[2]*a[2]
+	mul	eax
+	add	ecx,eax
+	adc	ebp,edx
+	mov	edx,DWORD [esi]
+	adc	ebx,0
+	mov	DWORD [16+edi],ecx
+	mov	eax,DWORD [20+esi]
+	; saved r[4]
+	; ############### Calculate word 5
+	xor	ecx,ecx
+	; sqr a[5]*a[0]
+	mul	edx
+	add	eax,eax
+	adc	edx,edx
+	adc	ecx,0
+	add	ebp,eax
+	adc	ebx,edx
+	mov	eax,DWORD [16+esi]
+	adc	ecx,0
+	mov	edx,DWORD [4+esi]
+	; sqr a[4]*a[1]
+	mul	edx
+	add	eax,eax
+	adc	edx,edx
+	adc	ecx,0
+	add	ebp,eax
+	adc	ebx,edx
+	mov	eax,DWORD [12+esi]
+	adc	ecx,0
+	mov	edx,DWORD [8+esi]
+	; sqr a[3]*a[2]
+	mul	edx
+	add	eax,eax
+	adc	edx,edx
+	adc	ecx,0
+	add	ebp,eax
+	adc	ebx,edx
+	mov	eax,DWORD [24+esi]
+	adc	ecx,0
+	mov	DWORD [20+edi],ebp
+	mov	edx,DWORD [esi]
+	; saved r[5]
+	; ############### Calculate word 6
+	xor	ebp,ebp
+	; sqr a[6]*a[0]
+	mul	edx
+	add	eax,eax
+	adc	edx,edx
+	adc	ebp,0
+	add	ebx,eax
+	adc	ecx,edx
+	mov	eax,DWORD [20+esi]
+	adc	ebp,0
+	mov	edx,DWORD [4+esi]
+	; sqr a[5]*a[1]
+	mul	edx
+	add	eax,eax
+	adc	edx,edx
+	adc	ebp,0
+	add	ebx,eax
+	adc	ecx,edx
+	mov	eax,DWORD [16+esi]
+	adc	ebp,0
+	mov	edx,DWORD [8+esi]
+	; sqr a[4]*a[2]
+	mul	edx
+	add	eax,eax
+	adc	edx,edx
+	adc	ebp,0
+	add	ebx,eax
+	adc	ecx,edx
+	mov	eax,DWORD [12+esi]
+	adc	ebp,0
+	; sqr a[3]*a[3]
+	mul	eax
+	add	ebx,eax
+	adc	ecx,edx
+	mov	edx,DWORD [esi]
+	adc	ebp,0
+	mov	DWORD [24+edi],ebx
+	mov	eax,DWORD [28+esi]
+	; saved r[6]
+	; ############### Calculate word 7
+	xor	ebx,ebx
+	; sqr a[7]*a[0]
+	mul	edx
+	add	eax,eax
+	adc	edx,edx
+	adc	ebx,0
+	add	ecx,eax
+	adc	ebp,edx
+	mov	eax,DWORD [24+esi]
+	adc	ebx,0
+	mov	edx,DWORD [4+esi]
+	; sqr a[6]*a[1]
+	mul	edx
+	add	eax,eax
+	adc	edx,edx
+	adc	ebx,0
+	add	ecx,eax
+	adc	ebp,edx
+	mov	eax,DWORD [20+esi]
+	adc	ebx,0
+	mov	edx,DWORD [8+esi]
+	; sqr a[5]*a[2]
+	mul	edx
+	add	eax,eax
+	adc	edx,edx
+	adc	ebx,0
+	add	ecx,eax
+	adc	ebp,edx
+	mov	eax,DWORD [16+esi]
+	adc	ebx,0
+	mov	edx,DWORD [12+esi]
+	; sqr a[4]*a[3]
+	mul	edx
+	add	eax,eax
+	adc	edx,edx
+	adc	ebx,0
+	add	ecx,eax
+	adc	ebp,edx
+	mov	eax,DWORD [28+esi]
+	adc	ebx,0
+	mov	DWORD [28+edi],ecx
+	mov	edx,DWORD [4+esi]
+	; saved r[7]
+	; ############### Calculate word 8
+	xor	ecx,ecx
+	; sqr a[7]*a[1]
+	mul	edx
+	add	eax,eax
+	adc	edx,edx
+	adc	ecx,0
+	add	ebp,eax
+	adc	ebx,edx
+	mov	eax,DWORD [24+esi]
+	adc	ecx,0
+	mov	edx,DWORD [8+esi]
+	; sqr a[6]*a[2]
+	mul	edx
+	add	eax,eax
+	adc	edx,edx
+	adc	ecx,0
+	add	ebp,eax
+	adc	ebx,edx
+	mov	eax,DWORD [20+esi]
+	adc	ecx,0
+	mov	edx,DWORD [12+esi]
+	; sqr a[5]*a[3]
+	mul	edx
+	add	eax,eax
+	adc	edx,edx
+	adc	ecx,0
+	add	ebp,eax
+	adc	ebx,edx
+	mov	eax,DWORD [16+esi]
+	adc	ecx,0
+	; sqr a[4]*a[4]
+	mul	eax
+	add	ebp,eax
+	adc	ebx,edx
+	mov	edx,DWORD [8+esi]
+	adc	ecx,0
+	mov	DWORD [32+edi],ebp
+	mov	eax,DWORD [28+esi]
+	; saved r[8]
+	; ############### Calculate word 9
+	xor	ebp,ebp
+	; sqr a[7]*a[2]
+	mul	edx
+	add	eax,eax
+	adc	edx,edx
+	adc	ebp,0
+	add	ebx,eax
+	adc	ecx,edx
+	mov	eax,DWORD [24+esi]
+	adc	ebp,0
+	mov	edx,DWORD [12+esi]
+	; sqr a[6]*a[3]
+	mul	edx
+	add	eax,eax
+	adc	edx,edx
+	adc	ebp,0
+	add	ebx,eax
+	adc	ecx,edx
+	mov	eax,DWORD [20+esi]
+	adc	ebp,0
+	mov	edx,DWORD [16+esi]
+	; sqr a[5]*a[4]
+	mul	edx
+	add	eax,eax
+	adc	edx,edx
+	adc	ebp,0
+	add	ebx,eax
+	adc	ecx,edx
+	mov	eax,DWORD [28+esi]
+	adc	ebp,0
+	mov	DWORD [36+edi],ebx
+	mov	edx,DWORD [12+esi]
+	; saved r[9]
+	; ############### Calculate word 10
+	xor	ebx,ebx
+	; sqr a[7]*a[3]
+	mul	edx
+	add	eax,eax
+	adc	edx,edx
+	adc	ebx,0
+	add	ecx,eax
+	adc	ebp,edx
+	mov	eax,DWORD [24+esi]
+	adc	ebx,0
+	mov	edx,DWORD [16+esi]
+	; sqr a[6]*a[4]
+	mul	edx
+	add	eax,eax
+	adc	edx,edx
+	adc	ebx,0
+	add	ecx,eax
+	adc	ebp,edx
+	mov	eax,DWORD [20+esi]
+	adc	ebx,0
+	; sqr a[5]*a[5]
+	mul	eax
+	add	ecx,eax
+	adc	ebp,edx
+	mov	edx,DWORD [16+esi]
+	adc	ebx,0
+	mov	DWORD [40+edi],ecx
+	mov	eax,DWORD [28+esi]
+	; saved r[10]
+	; ############### Calculate word 11
+	xor	ecx,ecx
+	; sqr a[7]*a[4]
+	mul	edx
+	add	eax,eax
+	adc	edx,edx
+	adc	ecx,0
+	add	ebp,eax
+	adc	ebx,edx
+	mov	eax,DWORD [24+esi]
+	adc	ecx,0
+	mov	edx,DWORD [20+esi]
+	; sqr a[6]*a[5]
+	mul	edx
+	add	eax,eax
+	adc	edx,edx
+	adc	ecx,0
+	add	ebp,eax
+	adc	ebx,edx
+	mov	eax,DWORD [28+esi]
+	adc	ecx,0
+	mov	DWORD [44+edi],ebp
+	mov	edx,DWORD [20+esi]
+	; saved r[11]
+	; ############### Calculate word 12
+	xor	ebp,ebp
+	; sqr a[7]*a[5]
+	mul	edx
+	add	eax,eax
+	adc	edx,edx
+	adc	ebp,0
+	add	ebx,eax
+	adc	ecx,edx
+	mov	eax,DWORD [24+esi]
+	adc	ebp,0
+	; sqr a[6]*a[6]
+	mul	eax
+	add	ebx,eax
+	adc	ecx,edx
+	mov	edx,DWORD [24+esi]
+	adc	ebp,0
+	mov	DWORD [48+edi],ebx
+	mov	eax,DWORD [28+esi]
+	; saved r[12]
+	; ############### Calculate word 13
+	xor	ebx,ebx
+	; sqr a[7]*a[6]
+	mul	edx
+	add	eax,eax
+	adc	edx,edx
+	adc	ebx,0
+	add	ecx,eax
+	adc	ebp,edx
+	mov	eax,DWORD [28+esi]
+	adc	ebx,0
+	mov	DWORD [52+edi],ecx
+	; saved r[13]
+	; ############### Calculate word 14
+	xor	ecx,ecx
+	; sqr a[7]*a[7]
+	mul	eax
+	add	ebp,eax
+	adc	ebx,edx
+	adc	ecx,0
+	mov	DWORD [56+edi],ebp
+	; saved r[14]
+	mov	DWORD [60+edi],ebx
+	pop	ebx
+	pop	ebp
+	pop	edi
+	pop	esi
+	ret
+global	_bn_sqr_comba4
+align	16
+_bn_sqr_comba4:
+L$_bn_sqr_comba4_begin:
+	push	esi
+	push	edi
+	push	ebp
+	push	ebx
+	mov	edi,DWORD [20+esp]
+	mov	esi,DWORD [24+esp]
+	xor	ebx,ebx
+	xor	ecx,ecx
+	mov	eax,DWORD [esi]
+	; ############### Calculate word 0
+	xor	ebp,ebp
+	; sqr a[0]*a[0]
+	mul	eax
+	add	ebx,eax
+	adc	ecx,edx
+	mov	edx,DWORD [esi]
+	adc	ebp,0
+	mov	DWORD [edi],ebx
+	mov	eax,DWORD [4+esi]
+	; saved r[0]
+	; ############### Calculate word 1
+	xor	ebx,ebx
+	; sqr a[1]*a[0]
+	mul	edx
+	add	eax,eax
+	adc	edx,edx
+	adc	ebx,0
+	add	ecx,eax
+	adc	ebp,edx
+	mov	eax,DWORD [8+esi]
+	adc	ebx,0
+	mov	DWORD [4+edi],ecx
+	mov	edx,DWORD [esi]
+	; saved r[1]
+	; ############### Calculate word 2
+	xor	ecx,ecx
+	; sqr a[2]*a[0]
+	mul	edx
+	add	eax,eax
+	adc	edx,edx
+	adc	ecx,0
+	add	ebp,eax
+	adc	ebx,edx
+	mov	eax,DWORD [4+esi]
+	adc	ecx,0
+	; sqr a[1]*a[1]
+	mul	eax
+	add	ebp,eax
+	adc	ebx,edx
+	mov	edx,DWORD [esi]
+	adc	ecx,0
+	mov	DWORD [8+edi],ebp
+	mov	eax,DWORD [12+esi]
+	; saved r[2]
+	; ############### Calculate word 3
+	xor	ebp,ebp
+	; sqr a[3]*a[0]
+	mul	edx
+	add	eax,eax
+	adc	edx,edx
+	adc	ebp,0
+	add	ebx,eax
+	adc	ecx,edx
+	mov	eax,DWORD [8+esi]
+	adc	ebp,0
+	mov	edx,DWORD [4+esi]
+	; sqr a[2]*a[1]
+	mul	edx
+	add	eax,eax
+	adc	edx,edx
+	adc	ebp,0
+	add	ebx,eax
+	adc	ecx,edx
+	mov	eax,DWORD [12+esi]
+	adc	ebp,0
+	mov	DWORD [12+edi],ebx
+	mov	edx,DWORD [4+esi]
+	; saved r[3]
+	; ############### Calculate word 4
+	xor	ebx,ebx
+	; sqr a[3]*a[1]
+	mul	edx
+	add	eax,eax
+	adc	edx,edx
+	adc	ebx,0
+	add	ecx,eax
+	adc	ebp,edx
+	mov	eax,DWORD [8+esi]
+	adc	ebx,0
+	; sqr a[2]*a[2]
+	mul	eax
+	add	ecx,eax
+	adc	ebp,edx
+	mov	edx,DWORD [8+esi]
+	adc	ebx,0
+	mov	DWORD [16+edi],ecx
+	mov	eax,DWORD [12+esi]
+	; saved r[4]
+	; ############### Calculate word 5
+	xor	ecx,ecx
+	; sqr a[3]*a[2]
+	mul	edx
+	add	eax,eax
+	adc	edx,edx
+	adc	ecx,0
+	add	ebp,eax
+	adc	ebx,edx
+	mov	eax,DWORD [12+esi]
+	adc	ecx,0
+	mov	DWORD [20+edi],ebp
+	; saved r[5]
+	; ############### Calculate word 6
+	xor	ebp,ebp
+	; sqr a[3]*a[3]
+	mul	eax
+	add	ebx,eax
+	adc	ecx,edx
+	adc	ebp,0
+	mov	DWORD [24+edi],ebx
+	; saved r[6]
+	mov	DWORD [28+edi],ecx
+	pop	ebx
+	pop	ebp
+	pop	edi
+	pop	esi
+	ret
diff --git a/third_party/boringssl/win-x86/crypto/bn/x86-mont.asm b/third_party/boringssl/win-x86/crypto/bn/x86-mont.asm
new file mode 100644
index 0000000..de7b949
--- /dev/null
+++ b/third_party/boringssl/win-x86/crypto/bn/x86-mont.asm
@@ -0,0 +1,469 @@
+%ifidn __OUTPUT_FORMAT__,obj
+section	code	use32 class=code align=64
+%elifidn __OUTPUT_FORMAT__,win32
+%ifdef __YASM_VERSION_ID__
+%if __YASM_VERSION_ID__ < 01010000h
+%error yasm version 1.1.0 or later needed.
+%endif
+; Yasm automatically includes .00 and complains about redefining it.
+; https://www.tortall.net/projects/yasm/manual/html/objfmt-win32-safeseh.html
+%else
+$@feat.00 equ 1
+%endif
+section	.text	code align=64
+%else
+section	.text	code
+%endif
+;extern	_OPENSSL_ia32cap_P
+global	_bn_mul_mont
+align	16
+_bn_mul_mont:
+L$_bn_mul_mont_begin:
+	push	ebp
+	push	ebx
+	push	esi
+	push	edi
+	xor	eax,eax
+	mov	edi,DWORD [40+esp]
+	cmp	edi,4
+	jl	NEAR L$000just_leave
+	lea	esi,[20+esp]
+	lea	edx,[24+esp]
+	mov	ebp,esp
+	add	edi,2
+	neg	edi
+	lea	esp,[edi*4+esp-32]
+	neg	edi
+	mov	eax,esp
+	sub	eax,edx
+	and	eax,2047
+	sub	esp,eax
+	xor	edx,esp
+	and	edx,2048
+	xor	edx,2048
+	sub	esp,edx
+	and	esp,-64
+	mov	eax,DWORD [esi]
+	mov	ebx,DWORD [4+esi]
+	mov	ecx,DWORD [8+esi]
+	mov	edx,DWORD [12+esi]
+	mov	esi,DWORD [16+esi]
+	mov	esi,DWORD [esi]
+	mov	DWORD [4+esp],eax
+	mov	DWORD [8+esp],ebx
+	mov	DWORD [12+esp],ecx
+	mov	DWORD [16+esp],edx
+	mov	DWORD [20+esp],esi
+	lea	ebx,[edi-3]
+	mov	DWORD [24+esp],ebp
+	lea	eax,[_OPENSSL_ia32cap_P]
+	bt	DWORD [eax],26
+	jnc	NEAR L$001non_sse2
+	mov	eax,-1
+	movd	mm7,eax
+	mov	esi,DWORD [8+esp]
+	mov	edi,DWORD [12+esp]
+	mov	ebp,DWORD [16+esp]
+	xor	edx,edx
+	xor	ecx,ecx
+	movd	mm4,DWORD [edi]
+	movd	mm5,DWORD [esi]
+	movd	mm3,DWORD [ebp]
+	pmuludq	mm5,mm4
+	movq	mm2,mm5
+	movq	mm0,mm5
+	pand	mm0,mm7
+	pmuludq	mm5,[20+esp]
+	pmuludq	mm3,mm5
+	paddq	mm3,mm0
+	movd	mm1,DWORD [4+ebp]
+	movd	mm0,DWORD [4+esi]
+	psrlq	mm2,32
+	psrlq	mm3,32
+	inc	ecx
+align	16
+L$0021st:
+	pmuludq	mm0,mm4
+	pmuludq	mm1,mm5
+	paddq	mm2,mm0
+	paddq	mm3,mm1
+	movq	mm0,mm2
+	pand	mm0,mm7
+	movd	mm1,DWORD [4+ecx*4+ebp]
+	paddq	mm3,mm0
+	movd	mm0,DWORD [4+ecx*4+esi]
+	psrlq	mm2,32
+	movd	DWORD [28+ecx*4+esp],mm3
+	psrlq	mm3,32
+	lea	ecx,[1+ecx]
+	cmp	ecx,ebx
+	jl	NEAR L$0021st
+	pmuludq	mm0,mm4
+	pmuludq	mm1,mm5
+	paddq	mm2,mm0
+	paddq	mm3,mm1
+	movq	mm0,mm2
+	pand	mm0,mm7
+	paddq	mm3,mm0
+	movd	DWORD [28+ecx*4+esp],mm3
+	psrlq	mm2,32
+	psrlq	mm3,32
+	paddq	mm3,mm2
+	movq	[32+ebx*4+esp],mm3
+	inc	edx
+L$003outer:
+	xor	ecx,ecx
+	movd	mm4,DWORD [edx*4+edi]
+	movd	mm5,DWORD [esi]
+	movd	mm6,DWORD [32+esp]
+	movd	mm3,DWORD [ebp]
+	pmuludq	mm5,mm4
+	paddq	mm5,mm6
+	movq	mm0,mm5
+	movq	mm2,mm5
+	pand	mm0,mm7
+	pmuludq	mm5,[20+esp]
+	pmuludq	mm3,mm5
+	paddq	mm3,mm0
+	movd	mm6,DWORD [36+esp]
+	movd	mm1,DWORD [4+ebp]
+	movd	mm0,DWORD [4+esi]
+	psrlq	mm2,32
+	psrlq	mm3,32
+	paddq	mm2,mm6
+	inc	ecx
+	dec	ebx
+L$004inner:
+	pmuludq	mm0,mm4
+	pmuludq	mm1,mm5
+	paddq	mm2,mm0
+	paddq	mm3,mm1
+	movq	mm0,mm2
+	movd	mm6,DWORD [36+ecx*4+esp]
+	pand	mm0,mm7
+	movd	mm1,DWORD [4+ecx*4+ebp]
+	paddq	mm3,mm0
+	movd	mm0,DWORD [4+ecx*4+esi]
+	psrlq	mm2,32
+	movd	DWORD [28+ecx*4+esp],mm3
+	psrlq	mm3,32
+	paddq	mm2,mm6
+	dec	ebx
+	lea	ecx,[1+ecx]
+	jnz	NEAR L$004inner
+	mov	ebx,ecx
+	pmuludq	mm0,mm4
+	pmuludq	mm1,mm5
+	paddq	mm2,mm0
+	paddq	mm3,mm1
+	movq	mm0,mm2
+	pand	mm0,mm7
+	paddq	mm3,mm0
+	movd	DWORD [28+ecx*4+esp],mm3
+	psrlq	mm2,32
+	psrlq	mm3,32
+	movd	mm6,DWORD [36+ebx*4+esp]
+	paddq	mm3,mm2
+	paddq	mm3,mm6
+	movq	[32+ebx*4+esp],mm3
+	lea	edx,[1+edx]
+	cmp	edx,ebx
+	jle	NEAR L$003outer
+	emms
+	jmp	NEAR L$005common_tail
+align	16
+L$001non_sse2:
+	mov	esi,DWORD [8+esp]
+	lea	ebp,[1+ebx]
+	mov	edi,DWORD [12+esp]
+	xor	ecx,ecx
+	mov	edx,esi
+	and	ebp,1
+	sub	edx,edi
+	lea	eax,[4+ebx*4+edi]
+	or	ebp,edx
+	mov	edi,DWORD [edi]
+	jz	NEAR L$006bn_sqr_mont
+	mov	DWORD [28+esp],eax
+	mov	eax,DWORD [esi]
+	xor	edx,edx
+align	16
+L$007mull:
+	mov	ebp,edx
+	mul	edi
+	add	ebp,eax
+	lea	ecx,[1+ecx]
+	adc	edx,0
+	mov	eax,DWORD [ecx*4+esi]
+	cmp	ecx,ebx
+	mov	DWORD [28+ecx*4+esp],ebp
+	jl	NEAR L$007mull
+	mov	ebp,edx
+	mul	edi
+	mov	edi,DWORD [20+esp]
+	add	eax,ebp
+	mov	esi,DWORD [16+esp]
+	adc	edx,0
+	imul	edi,DWORD [32+esp]
+	mov	DWORD [32+ebx*4+esp],eax
+	xor	ecx,ecx
+	mov	DWORD [36+ebx*4+esp],edx
+	mov	DWORD [40+ebx*4+esp],ecx
+	mov	eax,DWORD [esi]
+	mul	edi
+	add	eax,DWORD [32+esp]
+	mov	eax,DWORD [4+esi]
+	adc	edx,0
+	inc	ecx
+	jmp	NEAR L$0082ndmadd
+align	16
+L$0091stmadd:
+	mov	ebp,edx
+	mul	edi
+	add	ebp,DWORD [32+ecx*4+esp]
+	lea	ecx,[1+ecx]
+	adc	edx,0
+	add	ebp,eax
+	mov	eax,DWORD [ecx*4+esi]
+	adc	edx,0
+	cmp	ecx,ebx
+	mov	DWORD [28+ecx*4+esp],ebp
+	jl	NEAR L$0091stmadd
+	mov	ebp,edx
+	mul	edi
+	add	eax,DWORD [32+ebx*4+esp]
+	mov	edi,DWORD [20+esp]
+	adc	edx,0
+	mov	esi,DWORD [16+esp]
+	add	ebp,eax
+	adc	edx,0
+	imul	edi,DWORD [32+esp]
+	xor	ecx,ecx
+	add	edx,DWORD [36+ebx*4+esp]
+	mov	DWORD [32+ebx*4+esp],ebp
+	adc	ecx,0
+	mov	eax,DWORD [esi]
+	mov	DWORD [36+ebx*4+esp],edx
+	mov	DWORD [40+ebx*4+esp],ecx
+	mul	edi
+	add	eax,DWORD [32+esp]
+	mov	eax,DWORD [4+esi]
+	adc	edx,0
+	mov	ecx,1
+align	16
+L$0082ndmadd:
+	mov	ebp,edx
+	mul	edi
+	add	ebp,DWORD [32+ecx*4+esp]
+	lea	ecx,[1+ecx]
+	adc	edx,0
+	add	ebp,eax
+	mov	eax,DWORD [ecx*4+esi]
+	adc	edx,0
+	cmp	ecx,ebx
+	mov	DWORD [24+ecx*4+esp],ebp
+	jl	NEAR L$0082ndmadd
+	mov	ebp,edx
+	mul	edi
+	add	ebp,DWORD [32+ebx*4+esp]
+	adc	edx,0
+	add	ebp,eax
+	adc	edx,0
+	mov	DWORD [28+ebx*4+esp],ebp
+	xor	eax,eax
+	mov	ecx,DWORD [12+esp]
+	add	edx,DWORD [36+ebx*4+esp]
+	adc	eax,DWORD [40+ebx*4+esp]
+	lea	ecx,[4+ecx]
+	mov	DWORD [32+ebx*4+esp],edx
+	cmp	ecx,DWORD [28+esp]
+	mov	DWORD [36+ebx*4+esp],eax
+	je	NEAR L$005common_tail
+	mov	edi,DWORD [ecx]
+	mov	esi,DWORD [8+esp]
+	mov	DWORD [12+esp],ecx
+	xor	ecx,ecx
+	xor	edx,edx
+	mov	eax,DWORD [esi]
+	jmp	NEAR L$0091stmadd
+align	16
+L$006bn_sqr_mont:
+	mov	DWORD [esp],ebx
+	mov	DWORD [12+esp],ecx
+	mov	eax,edi
+	mul	edi
+	mov	DWORD [32+esp],eax
+	mov	ebx,edx
+	shr	edx,1
+	and	ebx,1
+	inc	ecx
+align	16
+L$010sqr:
+	mov	eax,DWORD [ecx*4+esi]
+	mov	ebp,edx
+	mul	edi
+	add	eax,ebp
+	lea	ecx,[1+ecx]
+	adc	edx,0
+	lea	ebp,[eax*2+ebx]
+	shr	eax,31
+	cmp	ecx,DWORD [esp]
+	mov	ebx,eax
+	mov	DWORD [28+ecx*4+esp],ebp
+	jl	NEAR L$010sqr
+	mov	eax,DWORD [ecx*4+esi]
+	mov	ebp,edx
+	mul	edi
+	add	eax,ebp
+	mov	edi,DWORD [20+esp]
+	adc	edx,0
+	mov	esi,DWORD [16+esp]
+	lea	ebp,[eax*2+ebx]
+	imul	edi,DWORD [32+esp]
+	shr	eax,31
+	mov	DWORD [32+ecx*4+esp],ebp
+	lea	ebp,[edx*2+eax]
+	mov	eax,DWORD [esi]
+	shr	edx,31
+	mov	DWORD [36+ecx*4+esp],ebp
+	mov	DWORD [40+ecx*4+esp],edx
+	mul	edi
+	add	eax,DWORD [32+esp]
+	mov	ebx,ecx
+	adc	edx,0
+	mov	eax,DWORD [4+esi]
+	mov	ecx,1
+align	16
+L$0113rdmadd:
+	mov	ebp,edx
+	mul	edi
+	add	ebp,DWORD [32+ecx*4+esp]
+	adc	edx,0
+	add	ebp,eax
+	mov	eax,DWORD [4+ecx*4+esi]
+	adc	edx,0
+	mov	DWORD [28+ecx*4+esp],ebp
+	mov	ebp,edx
+	mul	edi
+	add	ebp,DWORD [36+ecx*4+esp]
+	lea	ecx,[2+ecx]
+	adc	edx,0
+	add	ebp,eax
+	mov	eax,DWORD [ecx*4+esi]
+	adc	edx,0
+	cmp	ecx,ebx
+	mov	DWORD [24+ecx*4+esp],ebp
+	jl	NEAR L$0113rdmadd
+	mov	ebp,edx
+	mul	edi
+	add	ebp,DWORD [32+ebx*4+esp]
+	adc	edx,0
+	add	ebp,eax
+	adc	edx,0
+	mov	DWORD [28+ebx*4+esp],ebp
+	mov	ecx,DWORD [12+esp]
+	xor	eax,eax
+	mov	esi,DWORD [8+esp]
+	add	edx,DWORD [36+ebx*4+esp]
+	adc	eax,DWORD [40+ebx*4+esp]
+	mov	DWORD [32+ebx*4+esp],edx
+	cmp	ecx,ebx
+	mov	DWORD [36+ebx*4+esp],eax
+	je	NEAR L$005common_tail
+	mov	edi,DWORD [4+ecx*4+esi]
+	lea	ecx,[1+ecx]
+	mov	eax,edi
+	mov	DWORD [12+esp],ecx
+	mul	edi
+	add	eax,DWORD [32+ecx*4+esp]
+	adc	edx,0
+	mov	DWORD [32+ecx*4+esp],eax
+	xor	ebp,ebp
+	cmp	ecx,ebx
+	lea	ecx,[1+ecx]
+	je	NEAR L$012sqrlast
+	mov	ebx,edx
+	shr	edx,1
+	and	ebx,1
+align	16
+L$013sqradd:
+	mov	eax,DWORD [ecx*4+esi]
+	mov	ebp,edx
+	mul	edi
+	add	eax,ebp
+	lea	ebp,[eax*1+eax]
+	adc	edx,0
+	shr	eax,31
+	add	ebp,DWORD [32+ecx*4+esp]
+	lea	ecx,[1+ecx]
+	adc	eax,0
+	add	ebp,ebx
+	adc	eax,0
+	cmp	ecx,DWORD [esp]
+	mov	DWORD [28+ecx*4+esp],ebp
+	mov	ebx,eax
+	jle	NEAR L$013sqradd
+	mov	ebp,edx
+	add	edx,edx
+	shr	ebp,31
+	add	edx,ebx
+	adc	ebp,0
+L$012sqrlast:
+	mov	edi,DWORD [20+esp]
+	mov	esi,DWORD [16+esp]
+	imul	edi,DWORD [32+esp]
+	add	edx,DWORD [32+ecx*4+esp]
+	mov	eax,DWORD [esi]
+	adc	ebp,0
+	mov	DWORD [32+ecx*4+esp],edx
+	mov	DWORD [36+ecx*4+esp],ebp
+	mul	edi
+	add	eax,DWORD [32+esp]
+	lea	ebx,[ecx-1]
+	adc	edx,0
+	mov	ecx,1
+	mov	eax,DWORD [4+esi]
+	jmp	NEAR L$0113rdmadd
+align	16
+L$005common_tail:
+	mov	ebp,DWORD [16+esp]
+	mov	edi,DWORD [4+esp]
+	lea	esi,[32+esp]
+	mov	eax,DWORD [esi]
+	mov	ecx,ebx
+	xor	edx,edx
+align	16
+L$014sub:
+	sbb	eax,DWORD [edx*4+ebp]
+	mov	DWORD [edx*4+edi],eax
+	dec	ecx
+	mov	eax,DWORD [4+edx*4+esi]
+	lea	edx,[1+edx]
+	jge	NEAR L$014sub
+	sbb	eax,0
+align	16
+L$015copy:
+	mov	edx,DWORD [ebx*4+esi]
+	mov	ebp,DWORD [ebx*4+edi]
+	xor	edx,ebp
+	and	edx,eax
+	xor	edx,ebp
+	mov	DWORD [ebx*4+esi],ecx
+	mov	DWORD [ebx*4+edi],edx
+	dec	ebx
+	jge	NEAR L$015copy
+	mov	esp,DWORD [24+esp]
+	mov	eax,1
+L$000just_leave:
+	pop	edi
+	pop	esi
+	pop	ebx
+	pop	ebp
+	ret
+db	77,111,110,116,103,111,109,101,114,121,32,77,117,108,116,105
+db	112,108,105,99,97,116,105,111,110,32,102,111,114,32,120,56
+db	54,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121
+db	32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46
+db	111,114,103,62,0
+segment	.bss
+common	_OPENSSL_ia32cap_P 16
diff --git a/third_party/boringssl/win-x86/crypto/cpu-x86-asm.asm b/third_party/boringssl/win-x86/crypto/cpu-x86-asm.asm
new file mode 100644
index 0000000..4317a73
--- /dev/null
+++ b/third_party/boringssl/win-x86/crypto/cpu-x86-asm.asm
@@ -0,0 +1,303 @@
+%ifidn __OUTPUT_FORMAT__,obj
+section	code	use32 class=code align=64
+%elifidn __OUTPUT_FORMAT__,win32
+%ifdef __YASM_VERSION_ID__
+%if __YASM_VERSION_ID__ < 01010000h
+%error yasm version 1.1.0 or later needed.
+%endif
+; Yasm automatically includes .00 and complains about redefining it.
+; https://www.tortall.net/projects/yasm/manual/html/objfmt-win32-safeseh.html
+%else
+$@feat.00 equ 1
+%endif
+section	.text	code align=64
+%else
+section	.text	code
+%endif
+global	_OPENSSL_ia32_cpuid
+align	16
+_OPENSSL_ia32_cpuid:
+L$_OPENSSL_ia32_cpuid_begin:
+	push	ebp
+	push	ebx
+	push	esi
+	push	edi
+	xor	edx,edx
+	pushfd
+	pop	eax
+	mov	ecx,eax
+	xor	eax,2097152
+	push	eax
+	popfd
+	pushfd
+	pop	eax
+	xor	ecx,eax
+	xor	eax,eax
+	bt	ecx,21
+	jnc	NEAR L$000nocpuid
+	mov	esi,DWORD [20+esp]
+	mov	DWORD [8+esi],eax
+	cpuid
+	mov	edi,eax
+	xor	eax,eax
+	cmp	ebx,1970169159
+	setne	al
+	mov	ebp,eax
+	cmp	edx,1231384169
+	setne	al
+	or	ebp,eax
+	cmp	ecx,1818588270
+	setne	al
+	or	ebp,eax
+	jz	NEAR L$001intel
+	cmp	ebx,1752462657
+	setne	al
+	mov	esi,eax
+	cmp	edx,1769238117
+	setne	al
+	or	esi,eax
+	cmp	ecx,1145913699
+	setne	al
+	or	esi,eax
+	jnz	NEAR L$001intel
+	mov	eax,2147483648
+	cpuid
+	cmp	eax,2147483649
+	jb	NEAR L$001intel
+	mov	esi,eax
+	mov	eax,2147483649
+	cpuid
+	or	ebp,ecx
+	and	ebp,2049
+	cmp	esi,2147483656
+	jb	NEAR L$001intel
+	mov	eax,2147483656
+	cpuid
+	movzx	esi,cl
+	inc	esi
+	mov	eax,1
+	xor	ecx,ecx
+	cpuid
+	bt	edx,28
+	jnc	NEAR L$002generic
+	shr	ebx,16
+	and	ebx,255
+	cmp	ebx,esi
+	ja	NEAR L$002generic
+	and	edx,4026531839
+	jmp	NEAR L$002generic
+L$001intel:
+	cmp	edi,7
+	jb	NEAR L$003cacheinfo
+	mov	esi,DWORD [20+esp]
+	mov	eax,7
+	xor	ecx,ecx
+	cpuid
+	mov	DWORD [8+esi],ebx
+L$003cacheinfo:
+	cmp	edi,4
+	mov	edi,-1
+	jb	NEAR L$004nocacheinfo
+	mov	eax,4
+	mov	ecx,0
+	cpuid
+	mov	edi,eax
+	shr	edi,14
+	and	edi,4095
+L$004nocacheinfo:
+	mov	eax,1
+	xor	ecx,ecx
+	cpuid
+	and	edx,3220176895
+	cmp	ebp,0
+	jne	NEAR L$005notintel
+	or	edx,1073741824
+L$005notintel:
+	bt	edx,28
+	jnc	NEAR L$002generic
+	and	edx,4026531839
+	cmp	edi,0
+	je	NEAR L$002generic
+	or	edx,268435456
+	shr	ebx,16
+	cmp	bl,1
+	ja	NEAR L$002generic
+	and	edx,4026531839
+L$002generic:
+	and	ebp,2048
+	and	ecx,4294965247
+	mov	esi,edx
+	or	ebp,ecx
+	bt	ecx,27
+	jnc	NEAR L$006clear_avx
+	xor	ecx,ecx
+db	15,1,208
+	and	eax,6
+	cmp	eax,6
+	je	NEAR L$007done
+	cmp	eax,2
+	je	NEAR L$006clear_avx
+L$008clear_xmm:
+	and	ebp,4261412861
+	and	esi,4278190079
+L$006clear_avx:
+	and	ebp,4026525695
+	mov	edi,DWORD [20+esp]
+	and	DWORD [8+edi],4294967263
+L$007done:
+	mov	eax,esi
+	mov	edx,ebp
+L$000nocpuid:
+	pop	edi
+	pop	esi
+	pop	ebx
+	pop	ebp
+	ret
+;extern	_OPENSSL_ia32cap_P
+global	_OPENSSL_rdtsc
+align	16
+_OPENSSL_rdtsc:
+L$_OPENSSL_rdtsc_begin:
+	xor	eax,eax
+	xor	edx,edx
+	lea	ecx,[_OPENSSL_ia32cap_P]
+	bt	DWORD [ecx],4
+	jnc	NEAR L$009notsc
+	rdtsc
+L$009notsc:
+	ret
+global	_OPENSSL_instrument_halt
+align	16
+_OPENSSL_instrument_halt:
+L$_OPENSSL_instrument_halt_begin:
+	lea	ecx,[_OPENSSL_ia32cap_P]
+	bt	DWORD [ecx],4
+	jnc	NEAR L$010nohalt
+dd	2421723150
+	and	eax,3
+	jnz	NEAR L$010nohalt
+	pushfd
+	pop	eax
+	bt	eax,9
+	jnc	NEAR L$010nohalt
+	rdtsc
+	push	edx
+	push	eax
+	hlt
+	rdtsc
+	sub	eax,DWORD [esp]
+	sbb	edx,DWORD [4+esp]
+	add	esp,8
+	ret
+L$010nohalt:
+	xor	eax,eax
+	xor	edx,edx
+	ret
+global	_OPENSSL_far_spin
+align	16
+_OPENSSL_far_spin:
+L$_OPENSSL_far_spin_begin:
+	pushfd
+	pop	eax
+	bt	eax,9
+	jnc	NEAR L$011nospin
+	mov	eax,DWORD [4+esp]
+	mov	ecx,DWORD [8+esp]
+dd	2430111262
+	xor	eax,eax
+	mov	edx,DWORD [ecx]
+	jmp	NEAR L$012spin
+align	16
+L$012spin:
+	inc	eax
+	cmp	edx,DWORD [ecx]
+	je	NEAR L$012spin
+dd	529567888
+	ret
+L$011nospin:
+	xor	eax,eax
+	xor	edx,edx
+	ret
+global	_OPENSSL_wipe_cpu
+align	16
+_OPENSSL_wipe_cpu:
+L$_OPENSSL_wipe_cpu_begin:
+	xor	eax,eax
+	xor	edx,edx
+	lea	ecx,[_OPENSSL_ia32cap_P]
+	mov	ecx,DWORD [ecx]
+	bt	DWORD [ecx],1
+	jnc	NEAR L$013no_x87
+	and	ecx,83886080
+	cmp	ecx,83886080
+	jne	NEAR L$014no_sse2
+	pxor	xmm0,xmm0
+	pxor	xmm1,xmm1
+	pxor	xmm2,xmm2
+	pxor	xmm3,xmm3
+	pxor	xmm4,xmm4
+	pxor	xmm5,xmm5
+	pxor	xmm6,xmm6
+	pxor	xmm7,xmm7
+L$014no_sse2:
+dd	4007259865,4007259865,4007259865,4007259865,2430851995
+L$013no_x87:
+	lea	eax,[4+esp]
+	ret
+global	_OPENSSL_atomic_add
+align	16
+_OPENSSL_atomic_add:
+L$_OPENSSL_atomic_add_begin:
+	mov	edx,DWORD [4+esp]
+	mov	ecx,DWORD [8+esp]
+	push	ebx
+	nop
+	mov	eax,DWORD [edx]
+L$015spin:
+	lea	ebx,[ecx*1+eax]
+	nop
+dd	447811568
+	jne	NEAR L$015spin
+	mov	eax,ebx
+	pop	ebx
+	ret
+global	_OPENSSL_indirect_call
+align	16
+_OPENSSL_indirect_call:
+L$_OPENSSL_indirect_call_begin:
+	push	ebp
+	mov	ebp,esp
+	sub	esp,28
+	mov	ecx,DWORD [12+ebp]
+	mov	DWORD [esp],ecx
+	mov	edx,DWORD [16+ebp]
+	mov	DWORD [4+esp],edx
+	mov	eax,DWORD [20+ebp]
+	mov	DWORD [8+esp],eax
+	mov	eax,DWORD [24+ebp]
+	mov	DWORD [12+esp],eax
+	mov	eax,DWORD [28+ebp]
+	mov	DWORD [16+esp],eax
+	mov	eax,DWORD [32+ebp]
+	mov	DWORD [20+esp],eax
+	mov	eax,DWORD [36+ebp]
+	mov	DWORD [24+esp],eax
+	call	DWORD [8+ebp]
+	mov	esp,ebp
+	pop	ebp
+	ret
+global	_OPENSSL_ia32_rdrand
+align	16
+_OPENSSL_ia32_rdrand:
+L$_OPENSSL_ia32_rdrand_begin:
+	mov	ecx,8
+L$016loop:
+db	15,199,240
+	jc	NEAR L$017break
+	loop	L$016loop
+L$017break:
+	cmp	eax,0
+	cmove	eax,ecx
+	ret
+segment	.bss
+common	_OPENSSL_ia32cap_P 16
diff --git a/third_party/boringssl/win-x86/crypto/md5/md5-586.asm b/third_party/boringssl/win-x86/crypto/md5/md5-586.asm
new file mode 100644
index 0000000..67ee216
--- /dev/null
+++ b/third_party/boringssl/win-x86/crypto/md5/md5-586.asm
@@ -0,0 +1,691 @@
+%ifidn __OUTPUT_FORMAT__,obj
+section	code	use32 class=code align=64
+%elifidn __OUTPUT_FORMAT__,win32
+%ifdef __YASM_VERSION_ID__
+%if __YASM_VERSION_ID__ < 01010000h
+%error yasm version 1.1.0 or later needed.
+%endif
+; Yasm automatically includes .00 and complains about redefining it.
+; https://www.tortall.net/projects/yasm/manual/html/objfmt-win32-safeseh.html
+%else
+$@feat.00 equ 1
+%endif
+section	.text	code align=64
+%else
+section	.text	code
+%endif
+global	_md5_block_asm_data_order
+align	16
+_md5_block_asm_data_order:
+L$_md5_block_asm_data_order_begin:
+	push	esi
+	push	edi
+	mov	edi,DWORD [12+esp]
+	mov	esi,DWORD [16+esp]
+	mov	ecx,DWORD [20+esp]
+	push	ebp
+	shl	ecx,6
+	push	ebx
+	add	ecx,esi
+	sub	ecx,64
+	mov	eax,DWORD [edi]
+	push	ecx
+	mov	ebx,DWORD [4+edi]
+	mov	ecx,DWORD [8+edi]
+	mov	edx,DWORD [12+edi]
+L$000start:
+	; 
+	; R0 section
+	mov	edi,ecx
+	mov	ebp,DWORD [esi]
+	; R0 0
+	xor	edi,edx
+	and	edi,ebx
+	lea	eax,[3614090360+ebp*1+eax]
+	xor	edi,edx
+	add	eax,edi
+	mov	edi,ebx
+	rol	eax,7
+	mov	ebp,DWORD [4+esi]
+	add	eax,ebx
+	; R0 1
+	xor	edi,ecx
+	and	edi,eax
+	lea	edx,[3905402710+ebp*1+edx]
+	xor	edi,ecx
+	add	edx,edi
+	mov	edi,eax
+	rol	edx,12
+	mov	ebp,DWORD [8+esi]
+	add	edx,eax
+	; R0 2
+	xor	edi,ebx
+	and	edi,edx
+	lea	ecx,[606105819+ebp*1+ecx]
+	xor	edi,ebx
+	add	ecx,edi
+	mov	edi,edx
+	rol	ecx,17
+	mov	ebp,DWORD [12+esi]
+	add	ecx,edx
+	; R0 3
+	xor	edi,eax
+	and	edi,ecx
+	lea	ebx,[3250441966+ebp*1+ebx]
+	xor	edi,eax
+	add	ebx,edi
+	mov	edi,ecx
+	rol	ebx,22
+	mov	ebp,DWORD [16+esi]
+	add	ebx,ecx
+	; R0 4
+	xor	edi,edx
+	and	edi,ebx
+	lea	eax,[4118548399+ebp*1+eax]
+	xor	edi,edx
+	add	eax,edi
+	mov	edi,ebx
+	rol	eax,7
+	mov	ebp,DWORD [20+esi]
+	add	eax,ebx
+	; R0 5
+	xor	edi,ecx
+	and	edi,eax
+	lea	edx,[1200080426+ebp*1+edx]
+	xor	edi,ecx
+	add	edx,edi
+	mov	edi,eax
+	rol	edx,12
+	mov	ebp,DWORD [24+esi]
+	add	edx,eax
+	; R0 6
+	xor	edi,ebx
+	and	edi,edx
+	lea	ecx,[2821735955+ebp*1+ecx]
+	xor	edi,ebx
+	add	ecx,edi
+	mov	edi,edx
+	rol	ecx,17
+	mov	ebp,DWORD [28+esi]
+	add	ecx,edx
+	; R0 7
+	xor	edi,eax
+	and	edi,ecx
+	lea	ebx,[4249261313+ebp*1+ebx]
+	xor	edi,eax
+	add	ebx,edi
+	mov	edi,ecx
+	rol	ebx,22
+	mov	ebp,DWORD [32+esi]
+	add	ebx,ecx
+	; R0 8
+	xor	edi,edx
+	and	edi,ebx
+	lea	eax,[1770035416+ebp*1+eax]
+	xor	edi,edx
+	add	eax,edi
+	mov	edi,ebx
+	rol	eax,7
+	mov	ebp,DWORD [36+esi]
+	add	eax,ebx
+	; R0 9
+	xor	edi,ecx
+	and	edi,eax
+	lea	edx,[2336552879+ebp*1+edx]
+	xor	edi,ecx
+	add	edx,edi
+	mov	edi,eax
+	rol	edx,12
+	mov	ebp,DWORD [40+esi]
+	add	edx,eax
+	; R0 10
+	xor	edi,ebx
+	and	edi,edx
+	lea	ecx,[4294925233+ebp*1+ecx]
+	xor	edi,ebx
+	add	ecx,edi
+	mov	edi,edx
+	rol	ecx,17
+	mov	ebp,DWORD [44+esi]
+	add	ecx,edx
+	; R0 11
+	xor	edi,eax
+	and	edi,ecx
+	lea	ebx,[2304563134+ebp*1+ebx]
+	xor	edi,eax
+	add	ebx,edi
+	mov	edi,ecx
+	rol	ebx,22
+	mov	ebp,DWORD [48+esi]
+	add	ebx,ecx
+	; R0 12
+	xor	edi,edx
+	and	edi,ebx
+	lea	eax,[1804603682+ebp*1+eax]
+	xor	edi,edx
+	add	eax,edi
+	mov	edi,ebx
+	rol	eax,7
+	mov	ebp,DWORD [52+esi]
+	add	eax,ebx
+	; R0 13
+	xor	edi,ecx
+	and	edi,eax
+	lea	edx,[4254626195+ebp*1+edx]
+	xor	edi,ecx
+	add	edx,edi
+	mov	edi,eax
+	rol	edx,12
+	mov	ebp,DWORD [56+esi]
+	add	edx,eax
+	; R0 14
+	xor	edi,ebx
+	and	edi,edx
+	lea	ecx,[2792965006+ebp*1+ecx]
+	xor	edi,ebx
+	add	ecx,edi
+	mov	edi,edx
+	rol	ecx,17
+	mov	ebp,DWORD [60+esi]
+	add	ecx,edx
+	; R0 15
+	xor	edi,eax
+	and	edi,ecx
+	lea	ebx,[1236535329+ebp*1+ebx]
+	xor	edi,eax
+	add	ebx,edi
+	mov	edi,ecx
+	rol	ebx,22
+	mov	ebp,DWORD [4+esi]
+	add	ebx,ecx
+	; 
+	; R1 section
+	; R1 16
+	lea	eax,[4129170786+ebp*1+eax]
+	xor	edi,ebx
+	and	edi,edx
+	mov	ebp,DWORD [24+esi]
+	xor	edi,ecx
+	add	eax,edi
+	mov	edi,ebx
+	rol	eax,5
+	add	eax,ebx
+	; R1 17
+	lea	edx,[3225465664+ebp*1+edx]
+	xor	edi,eax
+	and	edi,ecx
+	mov	ebp,DWORD [44+esi]
+	xor	edi,ebx
+	add	edx,edi
+	mov	edi,eax
+	rol	edx,9
+	add	edx,eax
+	; R1 18
+	lea	ecx,[643717713+ebp*1+ecx]
+	xor	edi,edx
+	and	edi,ebx
+	mov	ebp,DWORD [esi]
+	xor	edi,eax
+	add	ecx,edi
+	mov	edi,edx
+	rol	ecx,14
+	add	ecx,edx
+	; R1 19
+	lea	ebx,[3921069994+ebp*1+ebx]
+	xor	edi,ecx
+	and	edi,eax
+	mov	ebp,DWORD [20+esi]
+	xor	edi,edx
+	add	ebx,edi
+	mov	edi,ecx
+	rol	ebx,20
+	add	ebx,ecx
+	; R1 20
+	lea	eax,[3593408605+ebp*1+eax]
+	xor	edi,ebx
+	and	edi,edx
+	mov	ebp,DWORD [40+esi]
+	xor	edi,ecx
+	add	eax,edi
+	mov	edi,ebx
+	rol	eax,5
+	add	eax,ebx
+	; R1 21
+	lea	edx,[38016083+ebp*1+edx]
+	xor	edi,eax
+	and	edi,ecx
+	mov	ebp,DWORD [60+esi]
+	xor	edi,ebx
+	add	edx,edi
+	mov	edi,eax
+	rol	edx,9
+	add	edx,eax
+	; R1 22
+	lea	ecx,[3634488961+ebp*1+ecx]
+	xor	edi,edx
+	and	edi,ebx
+	mov	ebp,DWORD [16+esi]
+	xor	edi,eax
+	add	ecx,edi
+	mov	edi,edx
+	rol	ecx,14
+	add	ecx,edx
+	; R1 23
+	lea	ebx,[3889429448+ebp*1+ebx]
+	xor	edi,ecx
+	and	edi,eax
+	mov	ebp,DWORD [36+esi]
+	xor	edi,edx
+	add	ebx,edi
+	mov	edi,ecx
+	rol	ebx,20
+	add	ebx,ecx
+	; R1 24
+	lea	eax,[568446438+ebp*1+eax]
+	xor	edi,ebx
+	and	edi,edx
+	mov	ebp,DWORD [56+esi]
+	xor	edi,ecx
+	add	eax,edi
+	mov	edi,ebx
+	rol	eax,5
+	add	eax,ebx
+	; R1 25
+	lea	edx,[3275163606+ebp*1+edx]
+	xor	edi,eax
+	and	edi,ecx
+	mov	ebp,DWORD [12+esi]
+	xor	edi,ebx
+	add	edx,edi
+	mov	edi,eax
+	rol	edx,9
+	add	edx,eax
+	; R1 26
+	lea	ecx,[4107603335+ebp*1+ecx]
+	xor	edi,edx
+	and	edi,ebx
+	mov	ebp,DWORD [32+esi]
+	xor	edi,eax
+	add	ecx,edi
+	mov	edi,edx
+	rol	ecx,14
+	add	ecx,edx
+	; R1 27
+	lea	ebx,[1163531501+ebp*1+ebx]
+	xor	edi,ecx
+	and	edi,eax
+	mov	ebp,DWORD [52+esi]
+	xor	edi,edx
+	add	ebx,edi
+	mov	edi,ecx
+	rol	ebx,20
+	add	ebx,ecx
+	; R1 28
+	lea	eax,[2850285829+ebp*1+eax]
+	xor	edi,ebx
+	and	edi,edx
+	mov	ebp,DWORD [8+esi]
+	xor	edi,ecx
+	add	eax,edi
+	mov	edi,ebx
+	rol	eax,5
+	add	eax,ebx
+	; R1 29
+	lea	edx,[4243563512+ebp*1+edx]
+	xor	edi,eax
+	and	edi,ecx
+	mov	ebp,DWORD [28+esi]
+	xor	edi,ebx
+	add	edx,edi
+	mov	edi,eax
+	rol	edx,9
+	add	edx,eax
+	; R1 30
+	lea	ecx,[1735328473+ebp*1+ecx]
+	xor	edi,edx
+	and	edi,ebx
+	mov	ebp,DWORD [48+esi]
+	xor	edi,eax
+	add	ecx,edi
+	mov	edi,edx
+	rol	ecx,14
+	add	ecx,edx
+	; R1 31
+	lea	ebx,[2368359562+ebp*1+ebx]
+	xor	edi,ecx
+	and	edi,eax
+	mov	ebp,DWORD [20+esi]
+	xor	edi,edx
+	add	ebx,edi
+	mov	edi,ecx
+	rol	ebx,20
+	add	ebx,ecx
+	; 
+	; R2 section
+	; R2 32
+	xor	edi,edx
+	xor	edi,ebx
+	lea	eax,[4294588738+ebp*1+eax]
+	add	eax,edi
+	rol	eax,4
+	mov	ebp,DWORD [32+esi]
+	mov	edi,ebx
+	; R2 33
+	lea	edx,[2272392833+ebp*1+edx]
+	add	eax,ebx
+	xor	edi,ecx
+	xor	edi,eax
+	mov	ebp,DWORD [44+esi]
+	add	edx,edi
+	mov	edi,eax
+	rol	edx,11
+	add	edx,eax
+	; R2 34
+	xor	edi,ebx
+	xor	edi,edx
+	lea	ecx,[1839030562+ebp*1+ecx]
+	add	ecx,edi
+	rol	ecx,16
+	mov	ebp,DWORD [56+esi]
+	mov	edi,edx
+	; R2 35
+	lea	ebx,[4259657740+ebp*1+ebx]
+	add	ecx,edx
+	xor	edi,eax
+	xor	edi,ecx
+	mov	ebp,DWORD [4+esi]
+	add	ebx,edi
+	mov	edi,ecx
+	rol	ebx,23
+	add	ebx,ecx
+	; R2 36
+	xor	edi,edx
+	xor	edi,ebx
+	lea	eax,[2763975236+ebp*1+eax]
+	add	eax,edi
+	rol	eax,4
+	mov	ebp,DWORD [16+esi]
+	mov	edi,ebx
+	; R2 37
+	lea	edx,[1272893353+ebp*1+edx]
+	add	eax,ebx
+	xor	edi,ecx
+	xor	edi,eax
+	mov	ebp,DWORD [28+esi]
+	add	edx,edi
+	mov	edi,eax
+	rol	edx,11
+	add	edx,eax
+	; R2 38
+	xor	edi,ebx
+	xor	edi,edx
+	lea	ecx,[4139469664+ebp*1+ecx]
+	add	ecx,edi
+	rol	ecx,16
+	mov	ebp,DWORD [40+esi]
+	mov	edi,edx
+	; R2 39
+	lea	ebx,[3200236656+ebp*1+ebx]
+	add	ecx,edx
+	xor	edi,eax
+	xor	edi,ecx
+	mov	ebp,DWORD [52+esi]
+	add	ebx,edi
+	mov	edi,ecx
+	rol	ebx,23
+	add	ebx,ecx
+	; R2 40
+	xor	edi,edx
+	xor	edi,ebx
+	lea	eax,[681279174+ebp*1+eax]
+	add	eax,edi
+	rol	eax,4
+	mov	ebp,DWORD [esi]
+	mov	edi,ebx
+	; R2 41
+	lea	edx,[3936430074+ebp*1+edx]
+	add	eax,ebx
+	xor	edi,ecx
+	xor	edi,eax
+	mov	ebp,DWORD [12+esi]
+	add	edx,edi
+	mov	edi,eax
+	rol	edx,11
+	add	edx,eax
+	; R2 42
+	xor	edi,ebx
+	xor	edi,edx
+	lea	ecx,[3572445317+ebp*1+ecx]
+	add	ecx,edi
+	rol	ecx,16
+	mov	ebp,DWORD [24+esi]
+	mov	edi,edx
+	; R2 43
+	lea	ebx,[76029189+ebp*1+ebx]
+	add	ecx,edx
+	xor	edi,eax
+	xor	edi,ecx
+	mov	ebp,DWORD [36+esi]
+	add	ebx,edi
+	mov	edi,ecx
+	rol	ebx,23
+	add	ebx,ecx
+	; R2 44
+	xor	edi,edx
+	xor	edi,ebx
+	lea	eax,[3654602809+ebp*1+eax]
+	add	eax,edi
+	rol	eax,4
+	mov	ebp,DWORD [48+esi]
+	mov	edi,ebx
+	; R2 45
+	lea	edx,[3873151461+ebp*1+edx]
+	add	eax,ebx
+	xor	edi,ecx
+	xor	edi,eax
+	mov	ebp,DWORD [60+esi]
+	add	edx,edi
+	mov	edi,eax
+	rol	edx,11
+	add	edx,eax
+	; R2 46
+	xor	edi,ebx
+	xor	edi,edx
+	lea	ecx,[530742520+ebp*1+ecx]
+	add	ecx,edi
+	rol	ecx,16
+	mov	ebp,DWORD [8+esi]
+	mov	edi,edx
+	; R2 47
+	lea	ebx,[3299628645+ebp*1+ebx]
+	add	ecx,edx
+	xor	edi,eax
+	xor	edi,ecx
+	mov	ebp,DWORD [esi]
+	add	ebx,edi
+	mov	edi,-1
+	rol	ebx,23
+	add	ebx,ecx
+	; 
+	; R3 section
+	; R3 48
+	xor	edi,edx
+	or	edi,ebx
+	lea	eax,[4096336452+ebp*1+eax]
+	xor	edi,ecx
+	mov	ebp,DWORD [28+esi]
+	add	eax,edi
+	mov	edi,-1
+	rol	eax,6
+	xor	edi,ecx
+	add	eax,ebx
+	; R3 49
+	or	edi,eax
+	lea	edx,[1126891415+ebp*1+edx]
+	xor	edi,ebx
+	mov	ebp,DWORD [56+esi]
+	add	edx,edi
+	mov	edi,-1
+	rol	edx,10
+	xor	edi,ebx
+	add	edx,eax
+	; R3 50
+	or	edi,edx
+	lea	ecx,[2878612391+ebp*1+ecx]
+	xor	edi,eax
+	mov	ebp,DWORD [20+esi]
+	add	ecx,edi
+	mov	edi,-1
+	rol	ecx,15
+	xor	edi,eax
+	add	ecx,edx
+	; R3 51
+	or	edi,ecx
+	lea	ebx,[4237533241+ebp*1+ebx]
+	xor	edi,edx
+	mov	ebp,DWORD [48+esi]
+	add	ebx,edi
+	mov	edi,-1
+	rol	ebx,21
+	xor	edi,edx
+	add	ebx,ecx
+	; R3 52
+	or	edi,ebx
+	lea	eax,[1700485571+ebp*1+eax]
+	xor	edi,ecx
+	mov	ebp,DWORD [12+esi]
+	add	eax,edi
+	mov	edi,-1
+	rol	eax,6
+	xor	edi,ecx
+	add	eax,ebx
+	; R3 53
+	or	edi,eax
+	lea	edx,[2399980690+ebp*1+edx]
+	xor	edi,ebx
+	mov	ebp,DWORD [40+esi]
+	add	edx,edi
+	mov	edi,-1
+	rol	edx,10
+	xor	edi,ebx
+	add	edx,eax
+	; R3 54
+	or	edi,edx
+	lea	ecx,[4293915773+ebp*1+ecx]
+	xor	edi,eax
+	mov	ebp,DWORD [4+esi]
+	add	ecx,edi
+	mov	edi,-1
+	rol	ecx,15
+	xor	edi,eax
+	add	ecx,edx
+	; R3 55
+	or	edi,ecx
+	lea	ebx,[2240044497+ebp*1+ebx]
+	xor	edi,edx
+	mov	ebp,DWORD [32+esi]
+	add	ebx,edi
+	mov	edi,-1
+	rol	ebx,21
+	xor	edi,edx
+	add	ebx,ecx
+	; R3 56
+	or	edi,ebx
+	lea	eax,[1873313359+ebp*1+eax]
+	xor	edi,ecx
+	mov	ebp,DWORD [60+esi]
+	add	eax,edi
+	mov	edi,-1
+	rol	eax,6
+	xor	edi,ecx
+	add	eax,ebx
+	; R3 57
+	or	edi,eax
+	lea	edx,[4264355552+ebp*1+edx]
+	xor	edi,ebx
+	mov	ebp,DWORD [24+esi]
+	add	edx,edi
+	mov	edi,-1
+	rol	edx,10
+	xor	edi,ebx
+	add	edx,eax
+	; R3 58
+	or	edi,edx
+	lea	ecx,[2734768916+ebp*1+ecx]
+	xor	edi,eax
+	mov	ebp,DWORD [52+esi]
+	add	ecx,edi
+	mov	edi,-1
+	rol	ecx,15
+	xor	edi,eax
+	add	ecx,edx
+	; R3 59
+	or	edi,ecx
+	lea	ebx,[1309151649+ebp*1+ebx]
+	xor	edi,edx
+	mov	ebp,DWORD [16+esi]
+	add	ebx,edi
+	mov	edi,-1
+	rol	ebx,21
+	xor	edi,edx
+	add	ebx,ecx
+	; R3 60
+	or	edi,ebx
+	lea	eax,[4149444226+ebp*1+eax]
+	xor	edi,ecx
+	mov	ebp,DWORD [44+esi]
+	add	eax,edi
+	mov	edi,-1
+	rol	eax,6
+	xor	edi,ecx
+	add	eax,ebx
+	; R3 61
+	or	edi,eax
+	lea	edx,[3174756917+ebp*1+edx]
+	xor	edi,ebx
+	mov	ebp,DWORD [8+esi]
+	add	edx,edi
+	mov	edi,-1
+	rol	edx,10
+	xor	edi,ebx
+	add	edx,eax
+	; R3 62
+	or	edi,edx
+	lea	ecx,[718787259+ebp*1+ecx]
+	xor	edi,eax
+	mov	ebp,DWORD [36+esi]
+	add	ecx,edi
+	mov	edi,-1
+	rol	ecx,15
+	xor	edi,eax
+	add	ecx,edx
+	; R3 63
+	or	edi,ecx
+	lea	ebx,[3951481745+ebp*1+ebx]
+	xor	edi,edx
+	mov	ebp,DWORD [24+esp]
+	add	ebx,edi
+	add	esi,64
+	rol	ebx,21
+	mov	edi,DWORD [ebp]
+	add	ebx,ecx
+	add	eax,edi
+	mov	edi,DWORD [4+ebp]
+	add	ebx,edi
+	mov	edi,DWORD [8+ebp]
+	add	ecx,edi
+	mov	edi,DWORD [12+ebp]
+	add	edx,edi
+	mov	DWORD [ebp],eax
+	mov	DWORD [4+ebp],ebx
+	mov	edi,DWORD [esp]
+	mov	DWORD [8+ebp],ecx
+	mov	DWORD [12+ebp],edx
+	cmp	edi,esi
+	jae	NEAR L$000start
+	pop	eax
+	pop	ebx
+	pop	ebp
+	pop	edi
+	pop	esi
+	ret
diff --git a/third_party/boringssl/win-x86/crypto/modes/ghash-x86.asm b/third_party/boringssl/win-x86/crypto/modes/ghash-x86.asm
new file mode 100644
index 0000000..eb493ac
--- /dev/null
+++ b/third_party/boringssl/win-x86/crypto/modes/ghash-x86.asm
@@ -0,0 +1,1265 @@
+%ifidn __OUTPUT_FORMAT__,obj
+section	code	use32 class=code align=64
+%elifidn __OUTPUT_FORMAT__,win32
+%ifdef __YASM_VERSION_ID__
+%if __YASM_VERSION_ID__ < 01010000h
+%error yasm version 1.1.0 or later needed.
+%endif
+; Yasm automatically includes .00 and complains about redefining it.
+; https://www.tortall.net/projects/yasm/manual/html/objfmt-win32-safeseh.html
+%else
+$@feat.00 equ 1
+%endif
+section	.text	code align=64
+%else
+section	.text	code
+%endif
+global	_gcm_gmult_4bit_x86
+align	16
+_gcm_gmult_4bit_x86:
+L$_gcm_gmult_4bit_x86_begin:
+	push	ebp
+	push	ebx
+	push	esi
+	push	edi
+	sub	esp,84
+	mov	edi,DWORD [104+esp]
+	mov	esi,DWORD [108+esp]
+	mov	ebp,DWORD [edi]
+	mov	edx,DWORD [4+edi]
+	mov	ecx,DWORD [8+edi]
+	mov	ebx,DWORD [12+edi]
+	mov	DWORD [16+esp],0
+	mov	DWORD [20+esp],471859200
+	mov	DWORD [24+esp],943718400
+	mov	DWORD [28+esp],610271232
+	mov	DWORD [32+esp],1887436800
+	mov	DWORD [36+esp],1822425088
+	mov	DWORD [40+esp],1220542464
+	mov	DWORD [44+esp],1423966208
+	mov	DWORD [48+esp],3774873600
+	mov	DWORD [52+esp],4246732800
+	mov	DWORD [56+esp],3644850176
+	mov	DWORD [60+esp],3311403008
+	mov	DWORD [64+esp],2441084928
+	mov	DWORD [68+esp],2376073216
+	mov	DWORD [72+esp],2847932416
+	mov	DWORD [76+esp],3051356160
+	mov	DWORD [esp],ebp
+	mov	DWORD [4+esp],edx
+	mov	DWORD [8+esp],ecx
+	mov	DWORD [12+esp],ebx
+	shr	ebx,20
+	and	ebx,240
+	mov	ebp,DWORD [4+ebx*1+esi]
+	mov	edx,DWORD [ebx*1+esi]
+	mov	ecx,DWORD [12+ebx*1+esi]
+	mov	ebx,DWORD [8+ebx*1+esi]
+	xor	eax,eax
+	mov	edi,15
+	jmp	NEAR L$000x86_loop
+align	16
+L$000x86_loop:
+	mov	al,bl
+	shrd	ebx,ecx,4
+	and	al,15
+	shrd	ecx,edx,4
+	shrd	edx,ebp,4
+	shr	ebp,4
+	xor	ebp,DWORD [16+eax*4+esp]
+	mov	al,BYTE [edi*1+esp]
+	and	al,240
+	xor	ebx,DWORD [8+eax*1+esi]
+	xor	ecx,DWORD [12+eax*1+esi]
+	xor	edx,DWORD [eax*1+esi]
+	xor	ebp,DWORD [4+eax*1+esi]
+	dec	edi
+	js	NEAR L$001x86_break
+	mov	al,bl
+	shrd	ebx,ecx,4
+	and	al,15
+	shrd	ecx,edx,4
+	shrd	edx,ebp,4
+	shr	ebp,4
+	xor	ebp,DWORD [16+eax*4+esp]
+	mov	al,BYTE [edi*1+esp]
+	shl	al,4
+	xor	ebx,DWORD [8+eax*1+esi]
+	xor	ecx,DWORD [12+eax*1+esi]
+	xor	edx,DWORD [eax*1+esi]
+	xor	ebp,DWORD [4+eax*1+esi]
+	jmp	NEAR L$000x86_loop
+align	16
+L$001x86_break:
+	bswap	ebx
+	bswap	ecx
+	bswap	edx
+	bswap	ebp
+	mov	edi,DWORD [104+esp]
+	mov	DWORD [12+edi],ebx
+	mov	DWORD [8+edi],ecx
+	mov	DWORD [4+edi],edx
+	mov	DWORD [edi],ebp
+	add	esp,84
+	pop	edi
+	pop	esi
+	pop	ebx
+	pop	ebp
+	ret
+global	_gcm_ghash_4bit_x86
+align	16
+_gcm_ghash_4bit_x86:
+L$_gcm_ghash_4bit_x86_begin:
+	push	ebp
+	push	ebx
+	push	esi
+	push	edi
+	sub	esp,84
+	mov	ebx,DWORD [104+esp]
+	mov	esi,DWORD [108+esp]
+	mov	edi,DWORD [112+esp]
+	mov	ecx,DWORD [116+esp]
+	add	ecx,edi
+	mov	DWORD [116+esp],ecx
+	mov	ebp,DWORD [ebx]
+	mov	edx,DWORD [4+ebx]
+	mov	ecx,DWORD [8+ebx]
+	mov	ebx,DWORD [12+ebx]
+	mov	DWORD [16+esp],0
+	mov	DWORD [20+esp],471859200
+	mov	DWORD [24+esp],943718400
+	mov	DWORD [28+esp],610271232
+	mov	DWORD [32+esp],1887436800
+	mov	DWORD [36+esp],1822425088
+	mov	DWORD [40+esp],1220542464
+	mov	DWORD [44+esp],1423966208
+	mov	DWORD [48+esp],3774873600
+	mov	DWORD [52+esp],4246732800
+	mov	DWORD [56+esp],3644850176
+	mov	DWORD [60+esp],3311403008
+	mov	DWORD [64+esp],2441084928
+	mov	DWORD [68+esp],2376073216
+	mov	DWORD [72+esp],2847932416
+	mov	DWORD [76+esp],3051356160
+align	16
+L$002x86_outer_loop:
+	xor	ebx,DWORD [12+edi]
+	xor	ecx,DWORD [8+edi]
+	xor	edx,DWORD [4+edi]
+	xor	ebp,DWORD [edi]
+	mov	DWORD [12+esp],ebx
+	mov	DWORD [8+esp],ecx
+	mov	DWORD [4+esp],edx
+	mov	DWORD [esp],ebp
+	shr	ebx,20
+	and	ebx,240
+	mov	ebp,DWORD [4+ebx*1+esi]
+	mov	edx,DWORD [ebx*1+esi]
+	mov	ecx,DWORD [12+ebx*1+esi]
+	mov	ebx,DWORD [8+ebx*1+esi]
+	xor	eax,eax
+	mov	edi,15
+	jmp	NEAR L$003x86_loop
+align	16
+L$003x86_loop:
+	mov	al,bl
+	shrd	ebx,ecx,4
+	and	al,15
+	shrd	ecx,edx,4
+	shrd	edx,ebp,4
+	shr	ebp,4
+	xor	ebp,DWORD [16+eax*4+esp]
+	mov	al,BYTE [edi*1+esp]
+	and	al,240
+	xor	ebx,DWORD [8+eax*1+esi]
+	xor	ecx,DWORD [12+eax*1+esi]
+	xor	edx,DWORD [eax*1+esi]
+	xor	ebp,DWORD [4+eax*1+esi]
+	dec	edi
+	js	NEAR L$004x86_break
+	mov	al,bl
+	shrd	ebx,ecx,4
+	and	al,15
+	shrd	ecx,edx,4
+	shrd	edx,ebp,4
+	shr	ebp,4
+	xor	ebp,DWORD [16+eax*4+esp]
+	mov	al,BYTE [edi*1+esp]
+	shl	al,4
+	xor	ebx,DWORD [8+eax*1+esi]
+	xor	ecx,DWORD [12+eax*1+esi]
+	xor	edx,DWORD [eax*1+esi]
+	xor	ebp,DWORD [4+eax*1+esi]
+	jmp	NEAR L$003x86_loop
+align	16
+L$004x86_break:
+	bswap	ebx
+	bswap	ecx
+	bswap	edx
+	bswap	ebp
+	mov	edi,DWORD [112+esp]
+	lea	edi,[16+edi]
+	cmp	edi,DWORD [116+esp]
+	mov	DWORD [112+esp],edi
+	jb	NEAR L$002x86_outer_loop
+	mov	edi,DWORD [104+esp]
+	mov	DWORD [12+edi],ebx
+	mov	DWORD [8+edi],ecx
+	mov	DWORD [4+edi],edx
+	mov	DWORD [edi],ebp
+	add	esp,84
+	pop	edi
+	pop	esi
+	pop	ebx
+	pop	ebp
+	ret
+global	_gcm_gmult_4bit_mmx
+align	16
+_gcm_gmult_4bit_mmx:
+L$_gcm_gmult_4bit_mmx_begin:
+	push	ebp
+	push	ebx
+	push	esi
+	push	edi
+	mov	edi,DWORD [20+esp]
+	mov	esi,DWORD [24+esp]
+	call	L$005pic_point
+L$005pic_point:
+	pop	eax
+	lea	eax,[(L$rem_4bit-L$005pic_point)+eax]
+	movzx	ebx,BYTE [15+edi]
+	xor	ecx,ecx
+	mov	edx,ebx
+	mov	cl,dl
+	mov	ebp,14
+	shl	cl,4
+	and	edx,240
+	movq	mm0,[8+ecx*1+esi]
+	movq	mm1,[ecx*1+esi]
+	movd	ebx,mm0
+	jmp	NEAR L$006mmx_loop
+align	16
+L$006mmx_loop:
+	psrlq	mm0,4
+	and	ebx,15
+	movq	mm2,mm1
+	psrlq	mm1,4
+	pxor	mm0,[8+edx*1+esi]
+	mov	cl,BYTE [ebp*1+edi]
+	psllq	mm2,60
+	pxor	mm1,[ebx*8+eax]
+	dec	ebp
+	movd	ebx,mm0
+	pxor	mm1,[edx*1+esi]
+	mov	edx,ecx
+	pxor	mm0,mm2
+	js	NEAR L$007mmx_break
+	shl	cl,4
+	and	ebx,15
+	psrlq	mm0,4
+	and	edx,240
+	movq	mm2,mm1
+	psrlq	mm1,4
+	pxor	mm0,[8+ecx*1+esi]
+	psllq	mm2,60
+	pxor	mm1,[ebx*8+eax]
+	movd	ebx,mm0
+	pxor	mm1,[ecx*1+esi]
+	pxor	mm0,mm2
+	jmp	NEAR L$006mmx_loop
+align	16
+L$007mmx_break:
+	shl	cl,4
+	and	ebx,15
+	psrlq	mm0,4
+	and	edx,240
+	movq	mm2,mm1
+	psrlq	mm1,4
+	pxor	mm0,[8+ecx*1+esi]
+	psllq	mm2,60
+	pxor	mm1,[ebx*8+eax]
+	movd	ebx,mm0
+	pxor	mm1,[ecx*1+esi]
+	pxor	mm0,mm2
+	psrlq	mm0,4
+	and	ebx,15
+	movq	mm2,mm1
+	psrlq	mm1,4
+	pxor	mm0,[8+edx*1+esi]
+	psllq	mm2,60
+	pxor	mm1,[ebx*8+eax]
+	movd	ebx,mm0
+	pxor	mm1,[edx*1+esi]
+	pxor	mm0,mm2
+	psrlq	mm0,32
+	movd	edx,mm1
+	psrlq	mm1,32
+	movd	ecx,mm0
+	movd	ebp,mm1
+	bswap	ebx
+	bswap	edx
+	bswap	ecx
+	bswap	ebp
+	emms
+	mov	DWORD [12+edi],ebx
+	mov	DWORD [4+edi],edx
+	mov	DWORD [8+edi],ecx
+	mov	DWORD [edi],ebp
+	pop	edi
+	pop	esi
+	pop	ebx
+	pop	ebp
+	ret
+global	_gcm_ghash_4bit_mmx
+align	16
+_gcm_ghash_4bit_mmx:
+L$_gcm_ghash_4bit_mmx_begin:
+	push	ebp
+	push	ebx
+	push	esi
+	push	edi
+	mov	eax,DWORD [20+esp]
+	mov	ebx,DWORD [24+esp]
+	mov	ecx,DWORD [28+esp]
+	mov	edx,DWORD [32+esp]
+	mov	ebp,esp
+	call	L$008pic_point
+L$008pic_point:
+	pop	esi
+	lea	esi,[(L$rem_8bit-L$008pic_point)+esi]
+	sub	esp,544
+	and	esp,-64
+	sub	esp,16
+	add	edx,ecx
+	mov	DWORD [544+esp],eax
+	mov	DWORD [552+esp],edx
+	mov	DWORD [556+esp],ebp
+	add	ebx,128
+	lea	edi,[144+esp]
+	lea	ebp,[400+esp]
+	mov	edx,DWORD [ebx-120]
+	movq	mm0,[ebx-120]
+	movq	mm3,[ebx-128]
+	shl	edx,4
+	mov	BYTE [esp],dl
+	mov	edx,DWORD [ebx-104]
+	movq	mm2,[ebx-104]
+	movq	mm5,[ebx-112]
+	movq	[edi-128],mm0
+	psrlq	mm0,4
+	movq	[edi],mm3
+	movq	mm7,mm3
+	psrlq	mm3,4
+	shl	edx,4
+	mov	BYTE [1+esp],dl
+	mov	edx,DWORD [ebx-88]
+	movq	mm1,[ebx-88]
+	psllq	mm7,60
+	movq	mm4,[ebx-96]
+	por	mm0,mm7
+	movq	[edi-120],mm2
+	psrlq	mm2,4
+	movq	[8+edi],mm5
+	movq	mm6,mm5
+	movq	[ebp-128],mm0
+	psrlq	mm5,4
+	movq	[ebp],mm3
+	shl	edx,4
+	mov	BYTE [2+esp],dl
+	mov	edx,DWORD [ebx-72]
+	movq	mm0,[ebx-72]
+	psllq	mm6,60
+	movq	mm3,[ebx-80]
+	por	mm2,mm6
+	movq	[edi-112],mm1
+	psrlq	mm1,4
+	movq	[16+edi],mm4
+	movq	mm7,mm4
+	movq	[ebp-120],mm2
+	psrlq	mm4,4
+	movq	[8+ebp],mm5
+	shl	edx,4
+	mov	BYTE [3+esp],dl
+	mov	edx,DWORD [ebx-56]
+	movq	mm2,[ebx-56]
+	psllq	mm7,60
+	movq	mm5,[ebx-64]
+	por	mm1,mm7
+	movq	[edi-104],mm0
+	psrlq	mm0,4
+	movq	[24+edi],mm3
+	movq	mm6,mm3
+	movq	[ebp-112],mm1
+	psrlq	mm3,4
+	movq	[16+ebp],mm4
+	shl	edx,4
+	mov	BYTE [4+esp],dl
+	mov	edx,DWORD [ebx-40]
+	movq	mm1,[ebx-40]
+	psllq	mm6,60
+	movq	mm4,[ebx-48]
+	por	mm0,mm6
+	movq	[edi-96],mm2
+	psrlq	mm2,4
+	movq	[32+edi],mm5
+	movq	mm7,mm5
+	movq	[ebp-104],mm0
+	psrlq	mm5,4
+	movq	[24+ebp],mm3
+	shl	edx,4
+	mov	BYTE [5+esp],dl
+	mov	edx,DWORD [ebx-24]
+	movq	mm0,[ebx-24]
+	psllq	mm7,60
+	movq	mm3,[ebx-32]
+	por	mm2,mm7
+	movq	[edi-88],mm1
+	psrlq	mm1,4
+	movq	[40+edi],mm4
+	movq	mm6,mm4
+	movq	[ebp-96],mm2
+	psrlq	mm4,4
+	movq	[32+ebp],mm5
+	shl	edx,4
+	mov	BYTE [6+esp],dl
+	mov	edx,DWORD [ebx-8]
+	movq	mm2,[ebx-8]
+	psllq	mm6,60
+	movq	mm5,[ebx-16]
+	por	mm1,mm6
+	movq	[edi-80],mm0
+	psrlq	mm0,4
+	movq	[48+edi],mm3
+	movq	mm7,mm3
+	movq	[ebp-88],mm1
+	psrlq	mm3,4
+	movq	[40+ebp],mm4
+	shl	edx,4
+	mov	BYTE [7+esp],dl
+	mov	edx,DWORD [8+ebx]
+	movq	mm1,[8+ebx]
+	psllq	mm7,60
+	movq	mm4,[ebx]
+	por	mm0,mm7
+	movq	[edi-72],mm2
+	psrlq	mm2,4
+	movq	[56+edi],mm5
+	movq	mm6,mm5
+	movq	[ebp-80],mm0
+	psrlq	mm5,4
+	movq	[48+ebp],mm3
+	shl	edx,4
+	mov	BYTE [8+esp],dl
+	mov	edx,DWORD [24+ebx]
+	movq	mm0,[24+ebx]
+	psllq	mm6,60
+	movq	mm3,[16+ebx]
+	por	mm2,mm6
+	movq	[edi-64],mm1
+	psrlq	mm1,4
+	movq	[64+edi],mm4
+	movq	mm7,mm4
+	movq	[ebp-72],mm2
+	psrlq	mm4,4
+	movq	[56+ebp],mm5
+	shl	edx,4
+	mov	BYTE [9+esp],dl
+	mov	edx,DWORD [40+ebx]
+	movq	mm2,[40+ebx]
+	psllq	mm7,60
+	movq	mm5,[32+ebx]
+	por	mm1,mm7
+	movq	[edi-56],mm0
+	psrlq	mm0,4
+	movq	[72+edi],mm3
+	movq	mm6,mm3
+	movq	[ebp-64],mm1
+	psrlq	mm3,4
+	movq	[64+ebp],mm4
+	shl	edx,4
+	mov	BYTE [10+esp],dl
+	mov	edx,DWORD [56+ebx]
+	movq	mm1,[56+ebx]
+	psllq	mm6,60
+	movq	mm4,[48+ebx]
+	por	mm0,mm6
+	movq	[edi-48],mm2
+	psrlq	mm2,4
+	movq	[80+edi],mm5
+	movq	mm7,mm5
+	movq	[ebp-56],mm0
+	psrlq	mm5,4
+	movq	[72+ebp],mm3
+	shl	edx,4
+	mov	BYTE [11+esp],dl
+	mov	edx,DWORD [72+ebx]
+	movq	mm0,[72+ebx]
+	psllq	mm7,60
+	movq	mm3,[64+ebx]
+	por	mm2,mm7
+	movq	[edi-40],mm1
+	psrlq	mm1,4
+	movq	[88+edi],mm4
+	movq	mm6,mm4
+	movq	[ebp-48],mm2
+	psrlq	mm4,4
+	movq	[80+ebp],mm5
+	shl	edx,4
+	mov	BYTE [12+esp],dl
+	mov	edx,DWORD [88+ebx]
+	movq	mm2,[88+ebx]
+	psllq	mm6,60
+	movq	mm5,[80+ebx]
+	por	mm1,mm6
+	movq	[edi-32],mm0
+	psrlq	mm0,4
+	movq	[96+edi],mm3
+	movq	mm7,mm3
+	movq	[ebp-40],mm1
+	psrlq	mm3,4
+	movq	[88+ebp],mm4
+	shl	edx,4
+	mov	BYTE [13+esp],dl
+	mov	edx,DWORD [104+ebx]
+	movq	mm1,[104+ebx]
+	psllq	mm7,60
+	movq	mm4,[96+ebx]
+	por	mm0,mm7
+	movq	[edi-24],mm2
+	psrlq	mm2,4
+	movq	[104+edi],mm5
+	movq	mm6,mm5
+	movq	[ebp-32],mm0
+	psrlq	mm5,4
+	movq	[96+ebp],mm3
+	shl	edx,4
+	mov	BYTE [14+esp],dl
+	mov	edx,DWORD [120+ebx]
+	movq	mm0,[120+ebx]
+	psllq	mm6,60
+	movq	mm3,[112+ebx]
+	por	mm2,mm6
+	movq	[edi-16],mm1
+	psrlq	mm1,4
+	movq	[112+edi],mm4
+	movq	mm7,mm4
+	movq	[ebp-24],mm2
+	psrlq	mm4,4
+	movq	[104+ebp],mm5
+	shl	edx,4
+	mov	BYTE [15+esp],dl
+	psllq	mm7,60
+	por	mm1,mm7
+	movq	[edi-8],mm0
+	psrlq	mm0,4
+	movq	[120+edi],mm3
+	movq	mm6,mm3
+	movq	[ebp-16],mm1
+	psrlq	mm3,4
+	movq	[112+ebp],mm4
+	psllq	mm6,60
+	por	mm0,mm6
+	movq	[ebp-8],mm0
+	movq	[120+ebp],mm3
+	movq	mm6,[eax]
+	mov	ebx,DWORD [8+eax]
+	mov	edx,DWORD [12+eax]
+align	16
+L$009outer:
+	xor	edx,DWORD [12+ecx]
+	xor	ebx,DWORD [8+ecx]
+	pxor	mm6,[ecx]
+	lea	ecx,[16+ecx]
+	mov	DWORD [536+esp],ebx
+	movq	[528+esp],mm6
+	mov	DWORD [548+esp],ecx
+	xor	eax,eax
+	rol	edx,8
+	mov	al,dl
+	mov	ebp,eax
+	and	al,15
+	shr	ebp,4
+	pxor	mm0,mm0
+	rol	edx,8
+	pxor	mm1,mm1
+	pxor	mm2,mm2
+	movq	mm7,[16+eax*8+esp]
+	movq	mm6,[144+eax*8+esp]
+	mov	al,dl
+	movd	ebx,mm7
+	psrlq	mm7,8
+	movq	mm3,mm6
+	mov	edi,eax
+	psrlq	mm6,8
+	pxor	mm7,[272+ebp*8+esp]
+	and	al,15
+	psllq	mm3,56
+	shr	edi,4
+	pxor	mm7,[16+eax*8+esp]
+	rol	edx,8
+	pxor	mm6,[144+eax*8+esp]
+	pxor	mm7,mm3
+	pxor	mm6,[400+ebp*8+esp]
+	xor	bl,BYTE [ebp*1+esp]
+	mov	al,dl
+	movd	ecx,mm7
+	movzx	ebx,bl
+	psrlq	mm7,8
+	movq	mm3,mm6
+	mov	ebp,eax
+	psrlq	mm6,8
+	pxor	mm7,[272+edi*8+esp]
+	and	al,15
+	psllq	mm3,56
+	shr	ebp,4
+	pinsrw	mm2,WORD [ebx*2+esi],2
+	pxor	mm7,[16+eax*8+esp]
+	rol	edx,8
+	pxor	mm6,[144+eax*8+esp]
+	pxor	mm7,mm3
+	pxor	mm6,[400+edi*8+esp]
+	xor	cl,BYTE [edi*1+esp]
+	mov	al,dl
+	mov	edx,DWORD [536+esp]
+	movd	ebx,mm7
+	movzx	ecx,cl
+	psrlq	mm7,8
+	movq	mm3,mm6
+	mov	edi,eax
+	psrlq	mm6,8
+	pxor	mm7,[272+ebp*8+esp]
+	and	al,15
+	psllq	mm3,56
+	pxor	mm6,mm2
+	shr	edi,4
+	pinsrw	mm1,WORD [ecx*2+esi],2
+	pxor	mm7,[16+eax*8+esp]
+	rol	edx,8
+	pxor	mm6,[144+eax*8+esp]
+	pxor	mm7,mm3
+	pxor	mm6,[400+ebp*8+esp]
+	xor	bl,BYTE [ebp*1+esp]
+	mov	al,dl
+	movd	ecx,mm7
+	movzx	ebx,bl
+	psrlq	mm7,8
+	movq	mm3,mm6
+	mov	ebp,eax
+	psrlq	mm6,8
+	pxor	mm7,[272+edi*8+esp]
+	and	al,15
+	psllq	mm3,56
+	pxor	mm6,mm1
+	shr	ebp,4
+	pinsrw	mm0,WORD [ebx*2+esi],2
+	pxor	mm7,[16+eax*8+esp]
+	rol	edx,8
+	pxor	mm6,[144+eax*8+esp]
+	pxor	mm7,mm3
+	pxor	mm6,[400+edi*8+esp]
+	xor	cl,BYTE [edi*1+esp]
+	mov	al,dl
+	movd	ebx,mm7
+	movzx	ecx,cl
+	psrlq	mm7,8
+	movq	mm3,mm6
+	mov	edi,eax
+	psrlq	mm6,8
+	pxor	mm7,[272+ebp*8+esp]
+	and	al,15
+	psllq	mm3,56
+	pxor	mm6,mm0
+	shr	edi,4
+	pinsrw	mm2,WORD [ecx*2+esi],2
+	pxor	mm7,[16+eax*8+esp]
+	rol	edx,8
+	pxor	mm6,[144+eax*8+esp]
+	pxor	mm7,mm3
+	pxor	mm6,[400+ebp*8+esp]
+	xor	bl,BYTE [ebp*1+esp]
+	mov	al,dl
+	movd	ecx,mm7
+	movzx	ebx,bl
+	psrlq	mm7,8
+	movq	mm3,mm6
+	mov	ebp,eax
+	psrlq	mm6,8
+	pxor	mm7,[272+edi*8+esp]
+	and	al,15
+	psllq	mm3,56
+	pxor	mm6,mm2
+	shr	ebp,4
+	pinsrw	mm1,WORD [ebx*2+esi],2
+	pxor	mm7,[16+eax*8+esp]
+	rol	edx,8
+	pxor	mm6,[144+eax*8+esp]
+	pxor	mm7,mm3
+	pxor	mm6,[400+edi*8+esp]
+	xor	cl,BYTE [edi*1+esp]
+	mov	al,dl
+	mov	edx,DWORD [532+esp]
+	movd	ebx,mm7
+	movzx	ecx,cl
+	psrlq	mm7,8
+	movq	mm3,mm6
+	mov	edi,eax
+	psrlq	mm6,8
+	pxor	mm7,[272+ebp*8+esp]
+	and	al,15
+	psllq	mm3,56
+	pxor	mm6,mm1
+	shr	edi,4
+	pinsrw	mm0,WORD [ecx*2+esi],2
+	pxor	mm7,[16+eax*8+esp]
+	rol	edx,8
+	pxor	mm6,[144+eax*8+esp]
+	pxor	mm7,mm3
+	pxor	mm6,[400+ebp*8+esp]
+	xor	bl,BYTE [ebp*1+esp]
+	mov	al,dl
+	movd	ecx,mm7
+	movzx	ebx,bl
+	psrlq	mm7,8
+	movq	mm3,mm6
+	mov	ebp,eax
+	psrlq	mm6,8
+	pxor	mm7,[272+edi*8+esp]
+	and	al,15
+	psllq	mm3,56
+	pxor	mm6,mm0
+	shr	ebp,4
+	pinsrw	mm2,WORD [ebx*2+esi],2
+	pxor	mm7,[16+eax*8+esp]
+	rol	edx,8
+	pxor	mm6,[144+eax*8+esp]
+	pxor	mm7,mm3
+	pxor	mm6,[400+edi*8+esp]
+	xor	cl,BYTE [edi*1+esp]
+	mov	al,dl
+	movd	ebx,mm7
+	movzx	ecx,cl
+	psrlq	mm7,8
+	movq	mm3,mm6
+	mov	edi,eax
+	psrlq	mm6,8
+	pxor	mm7,[272+ebp*8+esp]
+	and	al,15
+	psllq	mm3,56
+	pxor	mm6,mm2
+	shr	edi,4
+	pinsrw	mm1,WORD [ecx*2+esi],2
+	pxor	mm7,[16+eax*8+esp]
+	rol	edx,8
+	pxor	mm6,[144+eax*8+esp]
+	pxor	mm7,mm3
+	pxor	mm6,[400+ebp*8+esp]
+	xor	bl,BYTE [ebp*1+esp]
+	mov	al,dl
+	movd	ecx,mm7
+	movzx	ebx,bl
+	psrlq	mm7,8
+	movq	mm3,mm6
+	mov	ebp,eax
+	psrlq	mm6,8
+	pxor	mm7,[272+edi*8+esp]
+	and	al,15
+	psllq	mm3,56
+	pxor	mm6,mm1
+	shr	ebp,4
+	pinsrw	mm0,WORD [ebx*2+esi],2
+	pxor	mm7,[16+eax*8+esp]
+	rol	edx,8
+	pxor	mm6,[144+eax*8+esp]
+	pxor	mm7,mm3
+	pxor	mm6,[400+edi*8+esp]
+	xor	cl,BYTE [edi*1+esp]
+	mov	al,dl
+	mov	edx,DWORD [528+esp]
+	movd	ebx,mm7
+	movzx	ecx,cl
+	psrlq	mm7,8
+	movq	mm3,mm6
+	mov	edi,eax
+	psrlq	mm6,8
+	pxor	mm7,[272+ebp*8+esp]
+	and	al,15
+	psllq	mm3,56
+	pxor	mm6,mm0
+	shr	edi,4
+	pinsrw	mm2,WORD [ecx*2+esi],2
+	pxor	mm7,[16+eax*8+esp]
+	rol	edx,8
+	pxor	mm6,[144+eax*8+esp]
+	pxor	mm7,mm3
+	pxor	mm6,[400+ebp*8+esp]
+	xor	bl,BYTE [ebp*1+esp]
+	mov	al,dl
+	movd	ecx,mm7
+	movzx	ebx,bl
+	psrlq	mm7,8
+	movq	mm3,mm6
+	mov	ebp,eax
+	psrlq	mm6,8
+	pxor	mm7,[272+edi*8+esp]
+	and	al,15
+	psllq	mm3,56
+	pxor	mm6,mm2
+	shr	ebp,4
+	pinsrw	mm1,WORD [ebx*2+esi],2
+	pxor	mm7,[16+eax*8+esp]
+	rol	edx,8
+	pxor	mm6,[144+eax*8+esp]
+	pxor	mm7,mm3
+	pxor	mm6,[400+edi*8+esp]
+	xor	cl,BYTE [edi*1+esp]
+	mov	al,dl
+	movd	ebx,mm7
+	movzx	ecx,cl
+	psrlq	mm7,8
+	movq	mm3,mm6
+	mov	edi,eax
+	psrlq	mm6,8
+	pxor	mm7,[272+ebp*8+esp]
+	and	al,15
+	psllq	mm3,56
+	pxor	mm6,mm1
+	shr	edi,4
+	pinsrw	mm0,WORD [ecx*2+esi],2
+	pxor	mm7,[16+eax*8+esp]
+	rol	edx,8
+	pxor	mm6,[144+eax*8+esp]
+	pxor	mm7,mm3
+	pxor	mm6,[400+ebp*8+esp]
+	xor	bl,BYTE [ebp*1+esp]
+	mov	al,dl
+	movd	ecx,mm7
+	movzx	ebx,bl
+	psrlq	mm7,8
+	movq	mm3,mm6
+	mov	ebp,eax
+	psrlq	mm6,8
+	pxor	mm7,[272+edi*8+esp]
+	and	al,15
+	psllq	mm3,56
+	pxor	mm6,mm0
+	shr	ebp,4
+	pinsrw	mm2,WORD [ebx*2+esi],2
+	pxor	mm7,[16+eax*8+esp]
+	rol	edx,8
+	pxor	mm6,[144+eax*8+esp]
+	pxor	mm7,mm3
+	pxor	mm6,[400+edi*8+esp]
+	xor	cl,BYTE [edi*1+esp]
+	mov	al,dl
+	mov	edx,DWORD [524+esp]
+	movd	ebx,mm7
+	movzx	ecx,cl
+	psrlq	mm7,8
+	movq	mm3,mm6
+	mov	edi,eax
+	psrlq	mm6,8
+	pxor	mm7,[272+ebp*8+esp]
+	and	al,15
+	psllq	mm3,56
+	pxor	mm6,mm2
+	shr	edi,4
+	pinsrw	mm1,WORD [ecx*2+esi],2
+	pxor	mm7,[16+eax*8+esp]
+	pxor	mm6,[144+eax*8+esp]
+	xor	bl,BYTE [ebp*1+esp]
+	pxor	mm7,mm3
+	pxor	mm6,[400+ebp*8+esp]
+	movzx	ebx,bl
+	pxor	mm2,mm2
+	psllq	mm1,4
+	movd	ecx,mm7
+	psrlq	mm7,4
+	movq	mm3,mm6
+	psrlq	mm6,4
+	shl	ecx,4
+	pxor	mm7,[16+edi*8+esp]
+	psllq	mm3,60
+	movzx	ecx,cl
+	pxor	mm7,mm3
+	pxor	mm6,[144+edi*8+esp]
+	pinsrw	mm0,WORD [ebx*2+esi],2
+	pxor	mm6,mm1
+	movd	edx,mm7
+	pinsrw	mm2,WORD [ecx*2+esi],3
+	psllq	mm0,12
+	pxor	mm6,mm0
+	psrlq	mm7,32
+	pxor	mm6,mm2
+	mov	ecx,DWORD [548+esp]
+	movd	ebx,mm7
+	movq	mm3,mm6
+	psllw	mm6,8
+	psrlw	mm3,8
+	por	mm6,mm3
+	bswap	edx
+	pshufw	mm6,mm6,27
+	bswap	ebx
+	cmp	ecx,DWORD [552+esp]
+	jne	NEAR L$009outer
+	mov	eax,DWORD [544+esp]
+	mov	DWORD [12+eax],edx
+	mov	DWORD [8+eax],ebx
+	movq	[eax],mm6
+	mov	esp,DWORD [556+esp]
+	emms
+	pop	edi
+	pop	esi
+	pop	ebx
+	pop	ebp
+	ret
+global	_gcm_init_clmul
+align	16
+_gcm_init_clmul:
+L$_gcm_init_clmul_begin:
+	mov	edx,DWORD [4+esp]
+	mov	eax,DWORD [8+esp]
+	call	L$010pic
+L$010pic:
+	pop	ecx
+	lea	ecx,[(L$bswap-L$010pic)+ecx]
+	movdqu	xmm2,[eax]
+	pshufd	xmm2,xmm2,78
+	pshufd	xmm4,xmm2,255
+	movdqa	xmm3,xmm2
+	psllq	xmm2,1
+	pxor	xmm5,xmm5
+	psrlq	xmm3,63
+	pcmpgtd	xmm5,xmm4
+	pslldq	xmm3,8
+	por	xmm2,xmm3
+	pand	xmm5,[16+ecx]
+	pxor	xmm2,xmm5
+	movdqa	xmm0,xmm2
+	movdqa	xmm1,xmm0
+	pshufd	xmm3,xmm0,78
+	pshufd	xmm4,xmm2,78
+	pxor	xmm3,xmm0
+	pxor	xmm4,xmm2
+db	102,15,58,68,194,0
+db	102,15,58,68,202,17
+db	102,15,58,68,220,0
+	xorps	xmm3,xmm0
+	xorps	xmm3,xmm1
+	movdqa	xmm4,xmm3
+	psrldq	xmm3,8
+	pslldq	xmm4,8
+	pxor	xmm1,xmm3
+	pxor	xmm0,xmm4
+	movdqa	xmm4,xmm0
+	movdqa	xmm3,xmm0
+	psllq	xmm0,5
+	pxor	xmm3,xmm0
+	psllq	xmm0,1
+	pxor	xmm0,xmm3
+	psllq	xmm0,57
+	movdqa	xmm3,xmm0
+	pslldq	xmm0,8
+	psrldq	xmm3,8
+	pxor	xmm0,xmm4
+	pxor	xmm1,xmm3
+	movdqa	xmm4,xmm0
+	psrlq	xmm0,1
+	pxor	xmm1,xmm4
+	pxor	xmm4,xmm0
+	psrlq	xmm0,5
+	pxor	xmm0,xmm4
+	psrlq	xmm0,1
+	pxor	xmm0,xmm1
+	pshufd	xmm3,xmm2,78
+	pshufd	xmm4,xmm0,78
+	pxor	xmm3,xmm2
+	movdqu	[edx],xmm2
+	pxor	xmm4,xmm0
+	movdqu	[16+edx],xmm0
+db	102,15,58,15,227,8
+	movdqu	[32+edx],xmm4
+	ret
+global	_gcm_gmult_clmul
+align	16
+_gcm_gmult_clmul:
+L$_gcm_gmult_clmul_begin:
+	mov	eax,DWORD [4+esp]
+	mov	edx,DWORD [8+esp]
+	call	L$011pic
+L$011pic:
+	pop	ecx
+	lea	ecx,[(L$bswap-L$011pic)+ecx]
+	movdqu	xmm0,[eax]
+	movdqa	xmm5,[ecx]
+	movups	xmm2,[edx]
+db	102,15,56,0,197
+	movups	xmm4,[32+edx]
+	movdqa	xmm1,xmm0
+	pshufd	xmm3,xmm0,78
+	pxor	xmm3,xmm0
+db	102,15,58,68,194,0
+db	102,15,58,68,202,17
+db	102,15,58,68,220,0
+	xorps	xmm3,xmm0
+	xorps	xmm3,xmm1
+	movdqa	xmm4,xmm3
+	psrldq	xmm3,8
+	pslldq	xmm4,8
+	pxor	xmm1,xmm3
+	pxor	xmm0,xmm4
+	movdqa	xmm4,xmm0
+	movdqa	xmm3,xmm0
+	psllq	xmm0,5
+	pxor	xmm3,xmm0
+	psllq	xmm0,1
+	pxor	xmm0,xmm3
+	psllq	xmm0,57
+	movdqa	xmm3,xmm0
+	pslldq	xmm0,8
+	psrldq	xmm3,8
+	pxor	xmm0,xmm4
+	pxor	xmm1,xmm3
+	movdqa	xmm4,xmm0
+	psrlq	xmm0,1
+	pxor	xmm1,xmm4
+	pxor	xmm4,xmm0
+	psrlq	xmm0,5
+	pxor	xmm0,xmm4
+	psrlq	xmm0,1
+	pxor	xmm0,xmm1
+db	102,15,56,0,197
+	movdqu	[eax],xmm0
+	ret
+global	_gcm_ghash_clmul
+align	16
+_gcm_ghash_clmul:
+L$_gcm_ghash_clmul_begin:
+	push	ebp
+	push	ebx
+	push	esi
+	push	edi
+	mov	eax,DWORD [20+esp]
+	mov	edx,DWORD [24+esp]
+	mov	esi,DWORD [28+esp]
+	mov	ebx,DWORD [32+esp]
+	call	L$012pic
+L$012pic:
+	pop	ecx
+	lea	ecx,[(L$bswap-L$012pic)+ecx]
+	movdqu	xmm0,[eax]
+	movdqa	xmm5,[ecx]
+	movdqu	xmm2,[edx]
+db	102,15,56,0,197
+	sub	ebx,16
+	jz	NEAR L$013odd_tail
+	movdqu	xmm3,[esi]
+	movdqu	xmm6,[16+esi]
+db	102,15,56,0,221
+db	102,15,56,0,245
+	movdqu	xmm5,[32+edx]
+	pxor	xmm0,xmm3
+	pshufd	xmm3,xmm6,78
+	movdqa	xmm7,xmm6
+	pxor	xmm3,xmm6
+	lea	esi,[32+esi]
+db	102,15,58,68,242,0
+db	102,15,58,68,250,17
+db	102,15,58,68,221,0
+	movups	xmm2,[16+edx]
+	nop
+	sub	ebx,32
+	jbe	NEAR L$014even_tail
+	jmp	NEAR L$015mod_loop
+align	32
+L$015mod_loop:
+	pshufd	xmm4,xmm0,78
+	movdqa	xmm1,xmm0
+	pxor	xmm4,xmm0
+	nop
+db	102,15,58,68,194,0
+db	102,15,58,68,202,17
+db	102,15,58,68,229,16
+	movups	xmm2,[edx]
+	xorps	xmm0,xmm6
+	movdqa	xmm5,[ecx]
+	xorps	xmm1,xmm7
+	movdqu	xmm7,[esi]
+	pxor	xmm3,xmm0
+	movdqu	xmm6,[16+esi]
+	pxor	xmm3,xmm1
+db	102,15,56,0,253
+	pxor	xmm4,xmm3
+	movdqa	xmm3,xmm4
+	psrldq	xmm4,8
+	pslldq	xmm3,8
+	pxor	xmm1,xmm4
+	pxor	xmm0,xmm3
+db	102,15,56,0,245
+	pxor	xmm1,xmm7
+	movdqa	xmm7,xmm6
+	movdqa	xmm4,xmm0
+	movdqa	xmm3,xmm0
+	psllq	xmm0,5
+	pxor	xmm3,xmm0
+	psllq	xmm0,1
+	pxor	xmm0,xmm3
+db	102,15,58,68,242,0
+	movups	xmm5,[32+edx]
+	psllq	xmm0,57
+	movdqa	xmm3,xmm0
+	pslldq	xmm0,8
+	psrldq	xmm3,8
+	pxor	xmm0,xmm4
+	pxor	xmm1,xmm3
+	pshufd	xmm3,xmm7,78
+	movdqa	xmm4,xmm0
+	psrlq	xmm0,1
+	pxor	xmm3,xmm7
+	pxor	xmm1,xmm4
+db	102,15,58,68,250,17
+	movups	xmm2,[16+edx]
+	pxor	xmm4,xmm0
+	psrlq	xmm0,5
+	pxor	xmm0,xmm4
+	psrlq	xmm0,1
+	pxor	xmm0,xmm1
+db	102,15,58,68,221,0
+	lea	esi,[32+esi]
+	sub	ebx,32
+	ja	NEAR L$015mod_loop
+L$014even_tail:
+	pshufd	xmm4,xmm0,78
+	movdqa	xmm1,xmm0
+	pxor	xmm4,xmm0
+db	102,15,58,68,194,0
+db	102,15,58,68,202,17
+db	102,15,58,68,229,16
+	movdqa	xmm5,[ecx]
+	xorps	xmm0,xmm6
+	xorps	xmm1,xmm7
+	pxor	xmm3,xmm0
+	pxor	xmm3,xmm1
+	pxor	xmm4,xmm3
+	movdqa	xmm3,xmm4
+	psrldq	xmm4,8
+	pslldq	xmm3,8
+	pxor	xmm1,xmm4
+	pxor	xmm0,xmm3
+	movdqa	xmm4,xmm0
+	movdqa	xmm3,xmm0
+	psllq	xmm0,5
+	pxor	xmm3,xmm0
+	psllq	xmm0,1
+	pxor	xmm0,xmm3
+	psllq	xmm0,57
+	movdqa	xmm3,xmm0
+	pslldq	xmm0,8
+	psrldq	xmm3,8
+	pxor	xmm0,xmm4
+	pxor	xmm1,xmm3
+	movdqa	xmm4,xmm0
+	psrlq	xmm0,1
+	pxor	xmm1,xmm4
+	pxor	xmm4,xmm0
+	psrlq	xmm0,5
+	pxor	xmm0,xmm4
+	psrlq	xmm0,1
+	pxor	xmm0,xmm1
+	test	ebx,ebx
+	jnz	NEAR L$016done
+	movups	xmm2,[edx]
+L$013odd_tail:
+	movdqu	xmm3,[esi]
+db	102,15,56,0,221
+	pxor	xmm0,xmm3
+	movdqa	xmm1,xmm0
+	pshufd	xmm3,xmm0,78
+	pshufd	xmm4,xmm2,78
+	pxor	xmm3,xmm0
+	pxor	xmm4,xmm2
+db	102,15,58,68,194,0
+db	102,15,58,68,202,17
+db	102,15,58,68,220,0
+	xorps	xmm3,xmm0
+	xorps	xmm3,xmm1
+	movdqa	xmm4,xmm3
+	psrldq	xmm3,8
+	pslldq	xmm4,8
+	pxor	xmm1,xmm3
+	pxor	xmm0,xmm4
+	movdqa	xmm4,xmm0
+	movdqa	xmm3,xmm0
+	psllq	xmm0,5
+	pxor	xmm3,xmm0
+	psllq	xmm0,1
+	pxor	xmm0,xmm3
+	psllq	xmm0,57
+	movdqa	xmm3,xmm0
+	pslldq	xmm0,8
+	psrldq	xmm3,8
+	pxor	xmm0,xmm4
+	pxor	xmm1,xmm3
+	movdqa	xmm4,xmm0
+	psrlq	xmm0,1
+	pxor	xmm1,xmm4
+	pxor	xmm4,xmm0
+	psrlq	xmm0,5
+	pxor	xmm0,xmm4
+	psrlq	xmm0,1
+	pxor	xmm0,xmm1
+L$016done:
+db	102,15,56,0,197
+	movdqu	[eax],xmm0
+	pop	edi
+	pop	esi
+	pop	ebx
+	pop	ebp
+	ret
+align	64
+L$bswap:
+db	15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0
+db	1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,194
+align	64
+L$rem_8bit:
+dw	0,450,900,582,1800,1738,1164,1358
+dw	3600,4050,3476,3158,2328,2266,2716,2910
+dw	7200,7650,8100,7782,6952,6890,6316,6510
+dw	4656,5106,4532,4214,5432,5370,5820,6014
+dw	14400,14722,15300,14854,16200,16010,15564,15630
+dw	13904,14226,13780,13334,12632,12442,13020,13086
+dw	9312,9634,10212,9766,9064,8874,8428,8494
+dw	10864,11186,10740,10294,11640,11450,12028,12094
+dw	28800,28994,29444,29382,30600,30282,29708,30158
+dw	32400,32594,32020,31958,31128,30810,31260,31710
+dw	27808,28002,28452,28390,27560,27242,26668,27118
+dw	25264,25458,24884,24822,26040,25722,26172,26622
+dw	18624,18690,19268,19078,20424,19978,19532,19854
+dw	18128,18194,17748,17558,16856,16410,16988,17310
+dw	21728,21794,22372,22182,21480,21034,20588,20910
+dw	23280,23346,22900,22710,24056,23610,24188,24510
+dw	57600,57538,57988,58182,58888,59338,58764,58446
+dw	61200,61138,60564,60758,59416,59866,60316,59998
+dw	64800,64738,65188,65382,64040,64490,63916,63598
+dw	62256,62194,61620,61814,62520,62970,63420,63102
+dw	55616,55426,56004,56070,56904,57226,56780,56334
+dw	55120,54930,54484,54550,53336,53658,54236,53790
+dw	50528,50338,50916,50982,49768,50090,49644,49198
+dw	52080,51890,51444,51510,52344,52666,53244,52798
+dw	37248,36930,37380,37830,38536,38730,38156,38094
+dw	40848,40530,39956,40406,39064,39258,39708,39646
+dw	36256,35938,36388,36838,35496,35690,35116,35054
+dw	33712,33394,32820,33270,33976,34170,34620,34558
+dw	43456,43010,43588,43910,44744,44810,44364,44174
+dw	42960,42514,42068,42390,41176,41242,41820,41630
+dw	46560,46114,46692,47014,45800,45866,45420,45230
+dw	48112,47666,47220,47542,48376,48442,49020,48830
+align	64
+L$rem_4bit:
+dd	0,0,0,471859200,0,943718400,0,610271232
+dd	0,1887436800,0,1822425088,0,1220542464,0,1423966208
+dd	0,3774873600,0,4246732800,0,3644850176,0,3311403008
+dd	0,2441084928,0,2376073216,0,2847932416,0,3051356160
+db	71,72,65,83,72,32,102,111,114,32,120,56,54,44,32,67
+db	82,89,80,84,79,71,65,77,83,32,98,121,32,60,97,112
+db	112,114,111,64,111,112,101,110,115,115,108,46,111,114,103,62
+db	0
diff --git a/third_party/boringssl/win-x86/crypto/rc4/rc4-586.asm b/third_party/boringssl/win-x86/crypto/rc4/rc4-586.asm
new file mode 100644
index 0000000..08cd9f6
--- /dev/null
+++ b/third_party/boringssl/win-x86/crypto/rc4/rc4-586.asm
@@ -0,0 +1,382 @@
+%ifidn __OUTPUT_FORMAT__,obj
+section	code	use32 class=code align=64
+%elifidn __OUTPUT_FORMAT__,win32
+%ifdef __YASM_VERSION_ID__
+%if __YASM_VERSION_ID__ < 01010000h
+%error yasm version 1.1.0 or later needed.
+%endif
+; Yasm automatically includes .00 and complains about redefining it.
+; https://www.tortall.net/projects/yasm/manual/html/objfmt-win32-safeseh.html
+%else
+$@feat.00 equ 1
+%endif
+section	.text	code align=64
+%else
+section	.text	code
+%endif
+;extern	_OPENSSL_ia32cap_P
+global	_asm_RC4
+align	16
+_asm_RC4:
+L$_asm_RC4_begin:
+	push	ebp
+	push	ebx
+	push	esi
+	push	edi
+	mov	edi,DWORD [20+esp]
+	mov	edx,DWORD [24+esp]
+	mov	esi,DWORD [28+esp]
+	mov	ebp,DWORD [32+esp]
+	xor	eax,eax
+	xor	ebx,ebx
+	cmp	edx,0
+	je	NEAR L$000abort
+	mov	al,BYTE [edi]
+	mov	bl,BYTE [4+edi]
+	add	edi,8
+	lea	ecx,[edx*1+esi]
+	sub	ebp,esi
+	mov	DWORD [24+esp],ecx
+	inc	al
+	cmp	DWORD [256+edi],-1
+	je	NEAR L$001RC4_CHAR
+	mov	ecx,DWORD [eax*4+edi]
+	and	edx,-4
+	jz	NEAR L$002loop1
+	mov	DWORD [32+esp],ebp
+	test	edx,-8
+	jz	NEAR L$003go4loop4
+	lea	ebp,[_OPENSSL_ia32cap_P]
+	bt	DWORD [ebp],26
+	jnc	NEAR L$003go4loop4
+	mov	ebp,DWORD [32+esp]
+	and	edx,-8
+	lea	edx,[edx*1+esi-8]
+	mov	DWORD [edi-4],edx
+	add	bl,cl
+	mov	edx,DWORD [ebx*4+edi]
+	mov	DWORD [ebx*4+edi],ecx
+	mov	DWORD [eax*4+edi],edx
+	inc	eax
+	add	edx,ecx
+	movzx	eax,al
+	movzx	edx,dl
+	movq	mm0,[esi]
+	mov	ecx,DWORD [eax*4+edi]
+	movd	mm2,DWORD [edx*4+edi]
+	jmp	NEAR L$004loop_mmx_enter
+align	16
+L$005loop_mmx:
+	add	bl,cl
+	psllq	mm1,56
+	mov	edx,DWORD [ebx*4+edi]
+	mov	DWORD [ebx*4+edi],ecx
+	mov	DWORD [eax*4+edi],edx
+	inc	eax
+	add	edx,ecx
+	movzx	eax,al
+	movzx	edx,dl
+	pxor	mm2,mm1
+	movq	mm0,[esi]
+	movq	[esi*1+ebp-8],mm2
+	mov	ecx,DWORD [eax*4+edi]
+	movd	mm2,DWORD [edx*4+edi]
+L$004loop_mmx_enter:
+	add	bl,cl
+	mov	edx,DWORD [ebx*4+edi]
+	mov	DWORD [ebx*4+edi],ecx
+	mov	DWORD [eax*4+edi],edx
+	inc	eax
+	add	edx,ecx
+	movzx	eax,al
+	movzx	edx,dl
+	pxor	mm2,mm0
+	mov	ecx,DWORD [eax*4+edi]
+	movd	mm1,DWORD [edx*4+edi]
+	add	bl,cl
+	psllq	mm1,8
+	mov	edx,DWORD [ebx*4+edi]
+	mov	DWORD [ebx*4+edi],ecx
+	mov	DWORD [eax*4+edi],edx
+	inc	eax
+	add	edx,ecx
+	movzx	eax,al
+	movzx	edx,dl
+	pxor	mm2,mm1
+	mov	ecx,DWORD [eax*4+edi]
+	movd	mm1,DWORD [edx*4+edi]
+	add	bl,cl
+	psllq	mm1,16
+	mov	edx,DWORD [ebx*4+edi]
+	mov	DWORD [ebx*4+edi],ecx
+	mov	DWORD [eax*4+edi],edx
+	inc	eax
+	add	edx,ecx
+	movzx	eax,al
+	movzx	edx,dl
+	pxor	mm2,mm1
+	mov	ecx,DWORD [eax*4+edi]
+	movd	mm1,DWORD [edx*4+edi]
+	add	bl,cl
+	psllq	mm1,24
+	mov	edx,DWORD [ebx*4+edi]
+	mov	DWORD [ebx*4+edi],ecx
+	mov	DWORD [eax*4+edi],edx
+	inc	eax
+	add	edx,ecx
+	movzx	eax,al
+	movzx	edx,dl
+	pxor	mm2,mm1
+	mov	ecx,DWORD [eax*4+edi]
+	movd	mm1,DWORD [edx*4+edi]
+	add	bl,cl
+	psllq	mm1,32
+	mov	edx,DWORD [ebx*4+edi]
+	mov	DWORD [ebx*4+edi],ecx
+	mov	DWORD [eax*4+edi],edx
+	inc	eax
+	add	edx,ecx
+	movzx	eax,al
+	movzx	edx,dl
+	pxor	mm2,mm1
+	mov	ecx,DWORD [eax*4+edi]
+	movd	mm1,DWORD [edx*4+edi]
+	add	bl,cl
+	psllq	mm1,40
+	mov	edx,DWORD [ebx*4+edi]
+	mov	DWORD [ebx*4+edi],ecx
+	mov	DWORD [eax*4+edi],edx
+	inc	eax
+	add	edx,ecx
+	movzx	eax,al
+	movzx	edx,dl
+	pxor	mm2,mm1
+	mov	ecx,DWORD [eax*4+edi]
+	movd	mm1,DWORD [edx*4+edi]
+	add	bl,cl
+	psllq	mm1,48
+	mov	edx,DWORD [ebx*4+edi]
+	mov	DWORD [ebx*4+edi],ecx
+	mov	DWORD [eax*4+edi],edx
+	inc	eax
+	add	edx,ecx
+	movzx	eax,al
+	movzx	edx,dl
+	pxor	mm2,mm1
+	mov	ecx,DWORD [eax*4+edi]
+	movd	mm1,DWORD [edx*4+edi]
+	mov	edx,ebx
+	xor	ebx,ebx
+	mov	bl,dl
+	cmp	esi,DWORD [edi-4]
+	lea	esi,[8+esi]
+	jb	NEAR L$005loop_mmx
+	psllq	mm1,56
+	pxor	mm2,mm1
+	movq	[esi*1+ebp-8],mm2
+	emms
+	cmp	esi,DWORD [24+esp]
+	je	NEAR L$006done
+	jmp	NEAR L$002loop1
+align	16
+L$003go4loop4:
+	lea	edx,[edx*1+esi-4]
+	mov	DWORD [28+esp],edx
+L$007loop4:
+	add	bl,cl
+	mov	edx,DWORD [ebx*4+edi]
+	mov	DWORD [ebx*4+edi],ecx
+	mov	DWORD [eax*4+edi],edx
+	add	edx,ecx
+	inc	al
+	and	edx,255
+	mov	ecx,DWORD [eax*4+edi]
+	mov	ebp,DWORD [edx*4+edi]
+	add	bl,cl
+	mov	edx,DWORD [ebx*4+edi]
+	mov	DWORD [ebx*4+edi],ecx
+	mov	DWORD [eax*4+edi],edx
+	add	edx,ecx
+	inc	al
+	and	edx,255
+	ror	ebp,8
+	mov	ecx,DWORD [eax*4+edi]
+	or	ebp,DWORD [edx*4+edi]
+	add	bl,cl
+	mov	edx,DWORD [ebx*4+edi]
+	mov	DWORD [ebx*4+edi],ecx
+	mov	DWORD [eax*4+edi],edx
+	add	edx,ecx
+	inc	al
+	and	edx,255
+	ror	ebp,8
+	mov	ecx,DWORD [eax*4+edi]
+	or	ebp,DWORD [edx*4+edi]
+	add	bl,cl
+	mov	edx,DWORD [ebx*4+edi]
+	mov	DWORD [ebx*4+edi],ecx
+	mov	DWORD [eax*4+edi],edx
+	add	edx,ecx
+	inc	al
+	and	edx,255
+	ror	ebp,8
+	mov	ecx,DWORD [32+esp]
+	or	ebp,DWORD [edx*4+edi]
+	ror	ebp,8
+	xor	ebp,DWORD [esi]
+	cmp	esi,DWORD [28+esp]
+	mov	DWORD [esi*1+ecx],ebp
+	lea	esi,[4+esi]
+	mov	ecx,DWORD [eax*4+edi]
+	jb	NEAR L$007loop4
+	cmp	esi,DWORD [24+esp]
+	je	NEAR L$006done
+	mov	ebp,DWORD [32+esp]
+align	16
+L$002loop1:
+	add	bl,cl
+	mov	edx,DWORD [ebx*4+edi]
+	mov	DWORD [ebx*4+edi],ecx
+	mov	DWORD [eax*4+edi],edx
+	add	edx,ecx
+	inc	al
+	and	edx,255
+	mov	edx,DWORD [edx*4+edi]
+	xor	dl,BYTE [esi]
+	lea	esi,[1+esi]
+	mov	ecx,DWORD [eax*4+edi]
+	cmp	esi,DWORD [24+esp]
+	mov	BYTE [esi*1+ebp-1],dl
+	jb	NEAR L$002loop1
+	jmp	NEAR L$006done
+align	16
+L$001RC4_CHAR:
+	movzx	ecx,BYTE [eax*1+edi]
+L$008cloop1:
+	add	bl,cl
+	movzx	edx,BYTE [ebx*1+edi]
+	mov	BYTE [ebx*1+edi],cl
+	mov	BYTE [eax*1+edi],dl
+	add	dl,cl
+	movzx	edx,BYTE [edx*1+edi]
+	add	al,1
+	xor	dl,BYTE [esi]
+	lea	esi,[1+esi]
+	movzx	ecx,BYTE [eax*1+edi]
+	cmp	esi,DWORD [24+esp]
+	mov	BYTE [esi*1+ebp-1],dl
+	jb	NEAR L$008cloop1
+L$006done:
+	dec	al
+	mov	DWORD [edi-4],ebx
+	mov	BYTE [edi-8],al
+L$000abort:
+	pop	edi
+	pop	esi
+	pop	ebx
+	pop	ebp
+	ret
+global	_asm_RC4_set_key
+align	16
+_asm_RC4_set_key:
+L$_asm_RC4_set_key_begin:
+	push	ebp
+	push	ebx
+	push	esi
+	push	edi
+	mov	edi,DWORD [20+esp]
+	mov	ebp,DWORD [24+esp]
+	mov	esi,DWORD [28+esp]
+	lea	edx,[_OPENSSL_ia32cap_P]
+	lea	edi,[8+edi]
+	lea	esi,[ebp*1+esi]
+	neg	ebp
+	xor	eax,eax
+	mov	DWORD [edi-4],ebp
+	bt	DWORD [edx],20
+	jc	NEAR L$009c1stloop
+align	16
+L$010w1stloop:
+	mov	DWORD [eax*4+edi],eax
+	add	al,1
+	jnc	NEAR L$010w1stloop
+	xor	ecx,ecx
+	xor	edx,edx
+align	16
+L$011w2ndloop:
+	mov	eax,DWORD [ecx*4+edi]
+	add	dl,BYTE [ebp*1+esi]
+	add	dl,al
+	add	ebp,1
+	mov	ebx,DWORD [edx*4+edi]
+	jnz	NEAR L$012wnowrap
+	mov	ebp,DWORD [edi-4]
+L$012wnowrap:
+	mov	DWORD [edx*4+edi],eax
+	mov	DWORD [ecx*4+edi],ebx
+	add	cl,1
+	jnc	NEAR L$011w2ndloop
+	jmp	NEAR L$013exit
+align	16
+L$009c1stloop:
+	mov	BYTE [eax*1+edi],al
+	add	al,1
+	jnc	NEAR L$009c1stloop
+	xor	ecx,ecx
+	xor	edx,edx
+	xor	ebx,ebx
+align	16
+L$014c2ndloop:
+	mov	al,BYTE [ecx*1+edi]
+	add	dl,BYTE [ebp*1+esi]
+	add	dl,al
+	add	ebp,1
+	mov	bl,BYTE [edx*1+edi]
+	jnz	NEAR L$015cnowrap
+	mov	ebp,DWORD [edi-4]
+L$015cnowrap:
+	mov	BYTE [edx*1+edi],al
+	mov	BYTE [ecx*1+edi],bl
+	add	cl,1
+	jnc	NEAR L$014c2ndloop
+	mov	DWORD [256+edi],-1
+L$013exit:
+	xor	eax,eax
+	mov	DWORD [edi-8],eax
+	mov	DWORD [edi-4],eax
+	pop	edi
+	pop	esi
+	pop	ebx
+	pop	ebp
+	ret
+global	_RC4_options
+align	16
+_RC4_options:
+L$_RC4_options_begin:
+	call	L$016pic_point
+L$016pic_point:
+	pop	eax
+	lea	eax,[(L$017opts-L$016pic_point)+eax]
+	lea	edx,[_OPENSSL_ia32cap_P]
+	mov	edx,DWORD [edx]
+	bt	edx,20
+	jc	NEAR L$0181xchar
+	bt	edx,26
+	jnc	NEAR L$019ret
+	add	eax,25
+	ret
+L$0181xchar:
+	add	eax,12
+L$019ret:
+	ret
+align	64
+L$017opts:
+db	114,99,52,40,52,120,44,105,110,116,41,0
+db	114,99,52,40,49,120,44,99,104,97,114,41,0
+db	114,99,52,40,56,120,44,109,109,120,41,0
+db	82,67,52,32,102,111,114,32,120,56,54,44,32,67,82,89
+db	80,84,79,71,65,77,83,32,98,121,32,60,97,112,112,114
+db	111,64,111,112,101,110,115,115,108,46,111,114,103,62,0
+align	64
+segment	.bss
+common	_OPENSSL_ia32cap_P 16
diff --git a/third_party/boringssl/win-x86/crypto/sha/sha1-586.asm b/third_party/boringssl/win-x86/crypto/sha/sha1-586.asm
new file mode 100644
index 0000000..e24449d
--- /dev/null
+++ b/third_party/boringssl/win-x86/crypto/sha/sha1-586.asm
@@ -0,0 +1,2805 @@
+%ifidn __OUTPUT_FORMAT__,obj
+section	code	use32 class=code align=64
+%elifidn __OUTPUT_FORMAT__,win32
+%ifdef __YASM_VERSION_ID__
+%if __YASM_VERSION_ID__ < 01010000h
+%error yasm version 1.1.0 or later needed.
+%endif
+; Yasm automatically includes .00 and complains about redefining it.
+; https://www.tortall.net/projects/yasm/manual/html/objfmt-win32-safeseh.html
+%else
+$@feat.00 equ 1
+%endif
+section	.text	code align=64
+%else
+section	.text	code
+%endif
+;extern	_OPENSSL_ia32cap_P
+global	_sha1_block_data_order
+align	16
+_sha1_block_data_order:
+L$_sha1_block_data_order_begin:
+	push	ebp
+	push	ebx
+	push	esi
+	push	edi
+	call	L$000pic_point
+L$000pic_point:
+	pop	ebp
+	lea	esi,[_OPENSSL_ia32cap_P]
+	lea	ebp,[(L$K_XX_XX-L$000pic_point)+ebp]
+	mov	eax,DWORD [esi]
+	mov	edx,DWORD [4+esi]
+	test	edx,512
+	jz	NEAR L$001x86
+	mov	ecx,DWORD [8+esi]
+	test	eax,16777216
+	jz	NEAR L$001x86
+	test	ecx,536870912
+	jnz	NEAR L$shaext_shortcut
+	jmp	NEAR L$ssse3_shortcut
+align	16
+L$001x86:
+	mov	ebp,DWORD [20+esp]
+	mov	esi,DWORD [24+esp]
+	mov	eax,DWORD [28+esp]
+	sub	esp,76
+	shl	eax,6
+	add	eax,esi
+	mov	DWORD [104+esp],eax
+	mov	edi,DWORD [16+ebp]
+	jmp	NEAR L$002loop
+align	16
+L$002loop:
+	mov	eax,DWORD [esi]
+	mov	ebx,DWORD [4+esi]
+	mov	ecx,DWORD [8+esi]
+	mov	edx,DWORD [12+esi]
+	bswap	eax
+	bswap	ebx
+	bswap	ecx
+	bswap	edx
+	mov	DWORD [esp],eax
+	mov	DWORD [4+esp],ebx
+	mov	DWORD [8+esp],ecx
+	mov	DWORD [12+esp],edx
+	mov	eax,DWORD [16+esi]
+	mov	ebx,DWORD [20+esi]
+	mov	ecx,DWORD [24+esi]
+	mov	edx,DWORD [28+esi]
+	bswap	eax
+	bswap	ebx
+	bswap	ecx
+	bswap	edx
+	mov	DWORD [16+esp],eax
+	mov	DWORD [20+esp],ebx
+	mov	DWORD [24+esp],ecx
+	mov	DWORD [28+esp],edx
+	mov	eax,DWORD [32+esi]
+	mov	ebx,DWORD [36+esi]
+	mov	ecx,DWORD [40+esi]
+	mov	edx,DWORD [44+esi]
+	bswap	eax
+	bswap	ebx
+	bswap	ecx
+	bswap	edx
+	mov	DWORD [32+esp],eax
+	mov	DWORD [36+esp],ebx
+	mov	DWORD [40+esp],ecx
+	mov	DWORD [44+esp],edx
+	mov	eax,DWORD [48+esi]
+	mov	ebx,DWORD [52+esi]
+	mov	ecx,DWORD [56+esi]
+	mov	edx,DWORD [60+esi]
+	bswap	eax
+	bswap	ebx
+	bswap	ecx
+	bswap	edx
+	mov	DWORD [48+esp],eax
+	mov	DWORD [52+esp],ebx
+	mov	DWORD [56+esp],ecx
+	mov	DWORD [60+esp],edx
+	mov	DWORD [100+esp],esi
+	mov	eax,DWORD [ebp]
+	mov	ebx,DWORD [4+ebp]
+	mov	ecx,DWORD [8+ebp]
+	mov	edx,DWORD [12+ebp]
+	; 00_15 0
+	mov	esi,ecx
+	mov	ebp,eax
+	rol	ebp,5
+	xor	esi,edx
+	add	ebp,edi
+	mov	edi,DWORD [esp]
+	and	esi,ebx
+	ror	ebx,2
+	xor	esi,edx
+	lea	ebp,[1518500249+edi*1+ebp]
+	add	ebp,esi
+	; 00_15 1
+	mov	edi,ebx
+	mov	esi,ebp
+	rol	ebp,5
+	xor	edi,ecx
+	add	ebp,edx
+	mov	edx,DWORD [4+esp]
+	and	edi,eax
+	ror	eax,2
+	xor	edi,ecx
+	lea	ebp,[1518500249+edx*1+ebp]
+	add	ebp,edi
+	; 00_15 2
+	mov	edx,eax
+	mov	edi,ebp
+	rol	ebp,5
+	xor	edx,ebx
+	add	ebp,ecx
+	mov	ecx,DWORD [8+esp]
+	and	edx,esi
+	ror	esi,2
+	xor	edx,ebx
+	lea	ebp,[1518500249+ecx*1+ebp]
+	add	ebp,edx
+	; 00_15 3
+	mov	ecx,esi
+	mov	edx,ebp
+	rol	ebp,5
+	xor	ecx,eax
+	add	ebp,ebx
+	mov	ebx,DWORD [12+esp]
+	and	ecx,edi
+	ror	edi,2
+	xor	ecx,eax
+	lea	ebp,[1518500249+ebx*1+ebp]
+	add	ebp,ecx
+	; 00_15 4
+	mov	ebx,edi
+	mov	ecx,ebp
+	rol	ebp,5
+	xor	ebx,esi
+	add	ebp,eax
+	mov	eax,DWORD [16+esp]
+	and	ebx,edx
+	ror	edx,2
+	xor	ebx,esi
+	lea	ebp,[1518500249+eax*1+ebp]
+	add	ebp,ebx
+	; 00_15 5
+	mov	eax,edx
+	mov	ebx,ebp
+	rol	ebp,5
+	xor	eax,edi
+	add	ebp,esi
+	mov	esi,DWORD [20+esp]
+	and	eax,ecx
+	ror	ecx,2
+	xor	eax,edi
+	lea	ebp,[1518500249+esi*1+ebp]
+	add	ebp,eax
+	; 00_15 6
+	mov	esi,ecx
+	mov	eax,ebp
+	rol	ebp,5
+	xor	esi,edx
+	add	ebp,edi
+	mov	edi,DWORD [24+esp]
+	and	esi,ebx
+	ror	ebx,2
+	xor	esi,edx
+	lea	ebp,[1518500249+edi*1+ebp]
+	add	ebp,esi
+	; 00_15 7
+	mov	edi,ebx
+	mov	esi,ebp
+	rol	ebp,5
+	xor	edi,ecx
+	add	ebp,edx
+	mov	edx,DWORD [28+esp]
+	and	edi,eax
+	ror	eax,2
+	xor	edi,ecx
+	lea	ebp,[1518500249+edx*1+ebp]
+	add	ebp,edi
+	; 00_15 8
+	mov	edx,eax
+	mov	edi,ebp
+	rol	ebp,5
+	xor	edx,ebx
+	add	ebp,ecx
+	mov	ecx,DWORD [32+esp]
+	and	edx,esi
+	ror	esi,2
+	xor	edx,ebx
+	lea	ebp,[1518500249+ecx*1+ebp]
+	add	ebp,edx
+	; 00_15 9
+	mov	ecx,esi
+	mov	edx,ebp
+	rol	ebp,5
+	xor	ecx,eax
+	add	ebp,ebx
+	mov	ebx,DWORD [36+esp]
+	and	ecx,edi
+	ror	edi,2
+	xor	ecx,eax
+	lea	ebp,[1518500249+ebx*1+ebp]
+	add	ebp,ecx
+	; 00_15 10
+	mov	ebx,edi
+	mov	ecx,ebp
+	rol	ebp,5
+	xor	ebx,esi
+	add	ebp,eax
+	mov	eax,DWORD [40+esp]
+	and	ebx,edx
+	ror	edx,2
+	xor	ebx,esi
+	lea	ebp,[1518500249+eax*1+ebp]
+	add	ebp,ebx
+	; 00_15 11
+	mov	eax,edx
+	mov	ebx,ebp
+	rol	ebp,5
+	xor	eax,edi
+	add	ebp,esi
+	mov	esi,DWORD [44+esp]
+	and	eax,ecx
+	ror	ecx,2
+	xor	eax,edi
+	lea	ebp,[1518500249+esi*1+ebp]
+	add	ebp,eax
+	; 00_15 12
+	mov	esi,ecx
+	mov	eax,ebp
+	rol	ebp,5
+	xor	esi,edx
+	add	ebp,edi
+	mov	edi,DWORD [48+esp]
+	and	esi,ebx
+	ror	ebx,2
+	xor	esi,edx
+	lea	ebp,[1518500249+edi*1+ebp]
+	add	ebp,esi
+	; 00_15 13
+	mov	edi,ebx
+	mov	esi,ebp
+	rol	ebp,5
+	xor	edi,ecx
+	add	ebp,edx
+	mov	edx,DWORD [52+esp]
+	and	edi,eax
+	ror	eax,2
+	xor	edi,ecx
+	lea	ebp,[1518500249+edx*1+ebp]
+	add	ebp,edi
+	; 00_15 14
+	mov	edx,eax
+	mov	edi,ebp
+	rol	ebp,5
+	xor	edx,ebx
+	add	ebp,ecx
+	mov	ecx,DWORD [56+esp]
+	and	edx,esi
+	ror	esi,2
+	xor	edx,ebx
+	lea	ebp,[1518500249+ecx*1+ebp]
+	add	ebp,edx
+	; 00_15 15
+	mov	ecx,esi
+	mov	edx,ebp
+	rol	ebp,5
+	xor	ecx,eax
+	add	ebp,ebx
+	mov	ebx,DWORD [60+esp]
+	and	ecx,edi
+	ror	edi,2
+	xor	ecx,eax
+	lea	ebp,[1518500249+ebx*1+ebp]
+	mov	ebx,DWORD [esp]
+	add	ecx,ebp
+	; 16_19 16
+	mov	ebp,edi
+	xor	ebx,DWORD [8+esp]
+	xor	ebp,esi
+	xor	ebx,DWORD [32+esp]
+	and	ebp,edx
+	xor	ebx,DWORD [52+esp]
+	rol	ebx,1
+	xor	ebp,esi
+	add	eax,ebp
+	mov	ebp,ecx
+	ror	edx,2
+	mov	DWORD [esp],ebx
+	rol	ebp,5
+	lea	ebx,[1518500249+eax*1+ebx]
+	mov	eax,DWORD [4+esp]
+	add	ebx,ebp
+	; 16_19 17
+	mov	ebp,edx
+	xor	eax,DWORD [12+esp]
+	xor	ebp,edi
+	xor	eax,DWORD [36+esp]
+	and	ebp,ecx
+	xor	eax,DWORD [56+esp]
+	rol	eax,1
+	xor	ebp,edi
+	add	esi,ebp
+	mov	ebp,ebx
+	ror	ecx,2
+	mov	DWORD [4+esp],eax
+	rol	ebp,5
+	lea	eax,[1518500249+esi*1+eax]
+	mov	esi,DWORD [8+esp]
+	add	eax,ebp
+	; 16_19 18
+	mov	ebp,ecx
+	xor	esi,DWORD [16+esp]
+	xor	ebp,edx
+	xor	esi,DWORD [40+esp]
+	and	ebp,ebx
+	xor	esi,DWORD [60+esp]
+	rol	esi,1
+	xor	ebp,edx
+	add	edi,ebp
+	mov	ebp,eax
+	ror	ebx,2
+	mov	DWORD [8+esp],esi
+	rol	ebp,5
+	lea	esi,[1518500249+edi*1+esi]
+	mov	edi,DWORD [12+esp]
+	add	esi,ebp
+	; 16_19 19
+	mov	ebp,ebx
+	xor	edi,DWORD [20+esp]
+	xor	ebp,ecx
+	xor	edi,DWORD [44+esp]
+	and	ebp,eax
+	xor	edi,DWORD [esp]
+	rol	edi,1
+	xor	ebp,ecx
+	add	edx,ebp
+	mov	ebp,esi
+	ror	eax,2
+	mov	DWORD [12+esp],edi
+	rol	ebp,5
+	lea	edi,[1518500249+edx*1+edi]
+	mov	edx,DWORD [16+esp]
+	add	edi,ebp
+	; 20_39 20
+	mov	ebp,esi
+	xor	edx,DWORD [24+esp]
+	xor	ebp,eax
+	xor	edx,DWORD [48+esp]
+	xor	ebp,ebx
+	xor	edx,DWORD [4+esp]
+	rol	edx,1
+	add	ecx,ebp
+	ror	esi,2
+	mov	ebp,edi
+	rol	ebp,5
+	mov	DWORD [16+esp],edx
+	lea	edx,[1859775393+ecx*1+edx]
+	mov	ecx,DWORD [20+esp]
+	add	edx,ebp
+	; 20_39 21
+	mov	ebp,edi
+	xor	ecx,DWORD [28+esp]
+	xor	ebp,esi
+	xor	ecx,DWORD [52+esp]
+	xor	ebp,eax
+	xor	ecx,DWORD [8+esp]
+	rol	ecx,1
+	add	ebx,ebp
+	ror	edi,2
+	mov	ebp,edx
+	rol	ebp,5
+	mov	DWORD [20+esp],ecx
+	lea	ecx,[1859775393+ebx*1+ecx]
+	mov	ebx,DWORD [24+esp]
+	add	ecx,ebp
+	; 20_39 22
+	mov	ebp,edx
+	xor	ebx,DWORD [32+esp]
+	xor	ebp,edi
+	xor	ebx,DWORD [56+esp]
+	xor	ebp,esi
+	xor	ebx,DWORD [12+esp]
+	rol	ebx,1
+	add	eax,ebp
+	ror	edx,2
+	mov	ebp,ecx
+	rol	ebp,5
+	mov	DWORD [24+esp],ebx
+	lea	ebx,[1859775393+eax*1+ebx]
+	mov	eax,DWORD [28+esp]
+	add	ebx,ebp
+	; 20_39 23
+	mov	ebp,ecx
+	xor	eax,DWORD [36+esp]
+	xor	ebp,edx
+	xor	eax,DWORD [60+esp]
+	xor	ebp,edi
+	xor	eax,DWORD [16+esp]
+	rol	eax,1
+	add	esi,ebp
+	ror	ecx,2
+	mov	ebp,ebx
+	rol	ebp,5
+	mov	DWORD [28+esp],eax
+	lea	eax,[1859775393+esi*1+eax]
+	mov	esi,DWORD [32+esp]
+	add	eax,ebp
+	; 20_39 24
+	mov	ebp,ebx
+	xor	esi,DWORD [40+esp]
+	xor	ebp,ecx
+	xor	esi,DWORD [esp]
+	xor	ebp,edx
+	xor	esi,DWORD [20+esp]
+	rol	esi,1
+	add	edi,ebp
+	ror	ebx,2
+	mov	ebp,eax
+	rol	ebp,5
+	mov	DWORD [32+esp],esi
+	lea	esi,[1859775393+edi*1+esi]
+	mov	edi,DWORD [36+esp]
+	add	esi,ebp
+	; 20_39 25
+	mov	ebp,eax
+	xor	edi,DWORD [44+esp]
+	xor	ebp,ebx
+	xor	edi,DWORD [4+esp]
+	xor	ebp,ecx
+	xor	edi,DWORD [24+esp]
+	rol	edi,1
+	add	edx,ebp
+	ror	eax,2
+	mov	ebp,esi
+	rol	ebp,5
+	mov	DWORD [36+esp],edi
+	lea	edi,[1859775393+edx*1+edi]
+	mov	edx,DWORD [40+esp]
+	add	edi,ebp
+	; 20_39 26
+	mov	ebp,esi
+	xor	edx,DWORD [48+esp]
+	xor	ebp,eax
+	xor	edx,DWORD [8+esp]
+	xor	ebp,ebx
+	xor	edx,DWORD [28+esp]
+	rol	edx,1
+	add	ecx,ebp
+	ror	esi,2
+	mov	ebp,edi
+	rol	ebp,5
+	mov	DWORD [40+esp],edx
+	lea	edx,[1859775393+ecx*1+edx]
+	mov	ecx,DWORD [44+esp]
+	add	edx,ebp
+	; 20_39 27
+	mov	ebp,edi
+	xor	ecx,DWORD [52+esp]
+	xor	ebp,esi
+	xor	ecx,DWORD [12+esp]
+	xor	ebp,eax
+	xor	ecx,DWORD [32+esp]
+	rol	ecx,1
+	add	ebx,ebp
+	ror	edi,2
+	mov	ebp,edx
+	rol	ebp,5
+	mov	DWORD [44+esp],ecx
+	lea	ecx,[1859775393+ebx*1+ecx]
+	mov	ebx,DWORD [48+esp]
+	add	ecx,ebp
+	; 20_39 28
+	mov	ebp,edx
+	xor	ebx,DWORD [56+esp]
+	xor	ebp,edi
+	xor	ebx,DWORD [16+esp]
+	xor	ebp,esi
+	xor	ebx,DWORD [36+esp]
+	rol	ebx,1
+	add	eax,ebp
+	ror	edx,2
+	mov	ebp,ecx
+	rol	ebp,5
+	mov	DWORD [48+esp],ebx
+	lea	ebx,[1859775393+eax*1+ebx]
+	mov	eax,DWORD [52+esp]
+	add	ebx,ebp
+	; 20_39 29
+	mov	ebp,ecx
+	xor	eax,DWORD [60+esp]
+	xor	ebp,edx
+	xor	eax,DWORD [20+esp]
+	xor	ebp,edi
+	xor	eax,DWORD [40+esp]
+	rol	eax,1
+	add	esi,ebp
+	ror	ecx,2
+	mov	ebp,ebx
+	rol	ebp,5
+	mov	DWORD [52+esp],eax
+	lea	eax,[1859775393+esi*1+eax]
+	mov	esi,DWORD [56+esp]
+	add	eax,ebp
+	; 20_39 30
+	mov	ebp,ebx
+	xor	esi,DWORD [esp]
+	xor	ebp,ecx
+	xor	esi,DWORD [24+esp]
+	xor	ebp,edx
+	xor	esi,DWORD [44+esp]
+	rol	esi,1
+	add	edi,ebp
+	ror	ebx,2
+	mov	ebp,eax
+	rol	ebp,5
+	mov	DWORD [56+esp],esi
+	lea	esi,[1859775393+edi*1+esi]
+	mov	edi,DWORD [60+esp]
+	add	esi,ebp
+	; 20_39 31
+	mov	ebp,eax
+	xor	edi,DWORD [4+esp]
+	xor	ebp,ebx
+	xor	edi,DWORD [28+esp]
+	xor	ebp,ecx
+	xor	edi,DWORD [48+esp]
+	rol	edi,1
+	add	edx,ebp
+	ror	eax,2
+	mov	ebp,esi
+	rol	ebp,5
+	mov	DWORD [60+esp],edi
+	lea	edi,[1859775393+edx*1+edi]
+	mov	edx,DWORD [esp]
+	add	edi,ebp
+	; 20_39 32
+	mov	ebp,esi
+	xor	edx,DWORD [8+esp]
+	xor	ebp,eax
+	xor	edx,DWORD [32+esp]
+	xor	ebp,ebx
+	xor	edx,DWORD [52+esp]
+	rol	edx,1
+	add	ecx,ebp
+	ror	esi,2
+	mov	ebp,edi
+	rol	ebp,5
+	mov	DWORD [esp],edx
+	lea	edx,[1859775393+ecx*1+edx]
+	mov	ecx,DWORD [4+esp]
+	add	edx,ebp
+	; 20_39 33
+	mov	ebp,edi
+	xor	ecx,DWORD [12+esp]
+	xor	ebp,esi
+	xor	ecx,DWORD [36+esp]
+	xor	ebp,eax
+	xor	ecx,DWORD [56+esp]
+	rol	ecx,1
+	add	ebx,ebp
+	ror	edi,2
+	mov	ebp,edx
+	rol	ebp,5
+	mov	DWORD [4+esp],ecx
+	lea	ecx,[1859775393+ebx*1+ecx]
+	mov	ebx,DWORD [8+esp]
+	add	ecx,ebp
+	; 20_39 34
+	mov	ebp,edx
+	xor	ebx,DWORD [16+esp]
+	xor	ebp,edi
+	xor	ebx,DWORD [40+esp]
+	xor	ebp,esi
+	xor	ebx,DWORD [60+esp]
+	rol	ebx,1
+	add	eax,ebp
+	ror	edx,2
+	mov	ebp,ecx
+	rol	ebp,5
+	mov	DWORD [8+esp],ebx
+	lea	ebx,[1859775393+eax*1+ebx]
+	mov	eax,DWORD [12+esp]
+	add	ebx,ebp
+	; 20_39 35
+	mov	ebp,ecx
+	xor	eax,DWORD [20+esp]
+	xor	ebp,edx
+	xor	eax,DWORD [44+esp]
+	xor	ebp,edi
+	xor	eax,DWORD [esp]
+	rol	eax,1
+	add	esi,ebp
+	ror	ecx,2
+	mov	ebp,ebx
+	rol	ebp,5
+	mov	DWORD [12+esp],eax
+	lea	eax,[1859775393+esi*1+eax]
+	mov	esi,DWORD [16+esp]
+	add	eax,ebp
+	; 20_39 36
+	mov	ebp,ebx
+	xor	esi,DWORD [24+esp]
+	xor	ebp,ecx
+	xor	esi,DWORD [48+esp]
+	xor	ebp,edx
+	xor	esi,DWORD [4+esp]
+	rol	esi,1
+	add	edi,ebp
+	ror	ebx,2
+	mov	ebp,eax
+	rol	ebp,5
+	mov	DWORD [16+esp],esi
+	lea	esi,[1859775393+edi*1+esi]
+	mov	edi,DWORD [20+esp]
+	add	esi,ebp
+	; 20_39 37
+	mov	ebp,eax
+	xor	edi,DWORD [28+esp]
+	xor	ebp,ebx
+	xor	edi,DWORD [52+esp]
+	xor	ebp,ecx
+	xor	edi,DWORD [8+esp]
+	rol	edi,1
+	add	edx,ebp
+	ror	eax,2
+	mov	ebp,esi
+	rol	ebp,5
+	mov	DWORD [20+esp],edi
+	lea	edi,[1859775393+edx*1+edi]
+	mov	edx,DWORD [24+esp]
+	add	edi,ebp
+	; 20_39 38
+	mov	ebp,esi
+	xor	edx,DWORD [32+esp]
+	xor	ebp,eax
+	xor	edx,DWORD [56+esp]
+	xor	ebp,ebx
+	xor	edx,DWORD [12+esp]
+	rol	edx,1
+	add	ecx,ebp
+	ror	esi,2
+	mov	ebp,edi
+	rol	ebp,5
+	mov	DWORD [24+esp],edx
+	lea	edx,[1859775393+ecx*1+edx]
+	mov	ecx,DWORD [28+esp]
+	add	edx,ebp
+	; 20_39 39
+	mov	ebp,edi
+	xor	ecx,DWORD [36+esp]
+	xor	ebp,esi
+	xor	ecx,DWORD [60+esp]
+	xor	ebp,eax
+	xor	ecx,DWORD [16+esp]
+	rol	ecx,1
+	add	ebx,ebp
+	ror	edi,2
+	mov	ebp,edx
+	rol	ebp,5
+	mov	DWORD [28+esp],ecx
+	lea	ecx,[1859775393+ebx*1+ecx]
+	mov	ebx,DWORD [32+esp]
+	add	ecx,ebp
+	; 40_59 40
+	mov	ebp,edi
+	xor	ebx,DWORD [40+esp]
+	xor	ebp,esi
+	xor	ebx,DWORD [esp]
+	and	ebp,edx
+	xor	ebx,DWORD [20+esp]
+	rol	ebx,1
+	add	ebp,eax
+	ror	edx,2
+	mov	eax,ecx
+	rol	eax,5
+	mov	DWORD [32+esp],ebx
+	lea	ebx,[2400959708+ebp*1+ebx]
+	mov	ebp,edi
+	add	ebx,eax
+	and	ebp,esi
+	mov	eax,DWORD [36+esp]
+	add	ebx,ebp
+	; 40_59 41
+	mov	ebp,edx
+	xor	eax,DWORD [44+esp]
+	xor	ebp,edi
+	xor	eax,DWORD [4+esp]
+	and	ebp,ecx
+	xor	eax,DWORD [24+esp]
+	rol	eax,1
+	add	ebp,esi
+	ror	ecx,2
+	mov	esi,ebx
+	rol	esi,5
+	mov	DWORD [36+esp],eax
+	lea	eax,[2400959708+ebp*1+eax]
+	mov	ebp,edx
+	add	eax,esi
+	and	ebp,edi
+	mov	esi,DWORD [40+esp]
+	add	eax,ebp
+	; 40_59 42
+	mov	ebp,ecx
+	xor	esi,DWORD [48+esp]
+	xor	ebp,edx
+	xor	esi,DWORD [8+esp]
+	and	ebp,ebx
+	xor	esi,DWORD [28+esp]
+	rol	esi,1
+	add	ebp,edi
+	ror	ebx,2
+	mov	edi,eax
+	rol	edi,5
+	mov	DWORD [40+esp],esi
+	lea	esi,[2400959708+ebp*1+esi]
+	mov	ebp,ecx
+	add	esi,edi
+	and	ebp,edx
+	mov	edi,DWORD [44+esp]
+	add	esi,ebp
+	; 40_59 43
+	mov	ebp,ebx
+	xor	edi,DWORD [52+esp]
+	xor	ebp,ecx
+	xor	edi,DWORD [12+esp]
+	and	ebp,eax
+	xor	edi,DWORD [32+esp]
+	rol	edi,1
+	add	ebp,edx
+	ror	eax,2
+	mov	edx,esi
+	rol	edx,5
+	mov	DWORD [44+esp],edi
+	lea	edi,[2400959708+ebp*1+edi]
+	mov	ebp,ebx
+	add	edi,edx
+	and	ebp,ecx
+	mov	edx,DWORD [48+esp]
+	add	edi,ebp
+	; 40_59 44
+	mov	ebp,eax
+	xor	edx,DWORD [56+esp]
+	xor	ebp,ebx
+	xor	edx,DWORD [16+esp]
+	and	ebp,esi
+	xor	edx,DWORD [36+esp]
+	rol	edx,1
+	add	ebp,ecx
+	ror	esi,2
+	mov	ecx,edi
+	rol	ecx,5
+	mov	DWORD [48+esp],edx
+	lea	edx,[2400959708+ebp*1+edx]
+	mov	ebp,eax
+	add	edx,ecx
+	and	ebp,ebx
+	mov	ecx,DWORD [52+esp]
+	add	edx,ebp
+	; 40_59 45
+	mov	ebp,esi
+	xor	ecx,DWORD [60+esp]
+	xor	ebp,eax
+	xor	ecx,DWORD [20+esp]
+	and	ebp,edi
+	xor	ecx,DWORD [40+esp]
+	rol	ecx,1
+	add	ebp,ebx
+	ror	edi,2
+	mov	ebx,edx
+	rol	ebx,5
+	mov	DWORD [52+esp],ecx
+	lea	ecx,[2400959708+ebp*1+ecx]
+	mov	ebp,esi
+	add	ecx,ebx
+	and	ebp,eax
+	mov	ebx,DWORD [56+esp]
+	add	ecx,ebp
+	; 40_59 46
+	mov	ebp,edi
+	xor	ebx,DWORD [esp]
+	xor	ebp,esi
+	xor	ebx,DWORD [24+esp]
+	and	ebp,edx
+	xor	ebx,DWORD [44+esp]
+	rol	ebx,1
+	add	ebp,eax
+	ror	edx,2
+	mov	eax,ecx
+	rol	eax,5
+	mov	DWORD [56+esp],ebx
+	lea	ebx,[2400959708+ebp*1+ebx]
+	mov	ebp,edi
+	add	ebx,eax
+	and	ebp,esi
+	mov	eax,DWORD [60+esp]
+	add	ebx,ebp
+	; 40_59 47
+	mov	ebp,edx
+	xor	eax,DWORD [4+esp]
+	xor	ebp,edi
+	xor	eax,DWORD [28+esp]
+	and	ebp,ecx
+	xor	eax,DWORD [48+esp]
+	rol	eax,1
+	add	ebp,esi
+	ror	ecx,2
+	mov	esi,ebx
+	rol	esi,5
+	mov	DWORD [60+esp],eax
+	lea	eax,[2400959708+ebp*1+eax]
+	mov	ebp,edx
+	add	eax,esi
+	and	ebp,edi
+	mov	esi,DWORD [esp]
+	add	eax,ebp
+	; 40_59 48
+	mov	ebp,ecx
+	xor	esi,DWORD [8+esp]
+	xor	ebp,edx
+	xor	esi,DWORD [32+esp]
+	and	ebp,ebx
+	xor	esi,DWORD [52+esp]
+	rol	esi,1
+	add	ebp,edi
+	ror	ebx,2
+	mov	edi,eax
+	rol	edi,5
+	mov	DWORD [esp],esi
+	lea	esi,[2400959708+ebp*1+esi]
+	mov	ebp,ecx
+	add	esi,edi
+	and	ebp,edx
+	mov	edi,DWORD [4+esp]
+	add	esi,ebp
+	; 40_59 49
+	mov	ebp,ebx
+	xor	edi,DWORD [12+esp]
+	xor	ebp,ecx
+	xor	edi,DWORD [36+esp]
+	and	ebp,eax
+	xor	edi,DWORD [56+esp]
+	rol	edi,1
+	add	ebp,edx
+	ror	eax,2
+	mov	edx,esi
+	rol	edx,5
+	mov	DWORD [4+esp],edi
+	lea	edi,[2400959708+ebp*1+edi]
+	mov	ebp,ebx
+	add	edi,edx
+	and	ebp,ecx
+	mov	edx,DWORD [8+esp]
+	add	edi,ebp
+	; 40_59 50
+	mov	ebp,eax
+	xor	edx,DWORD [16+esp]
+	xor	ebp,ebx
+	xor	edx,DWORD [40+esp]
+	and	ebp,esi
+	xor	edx,DWORD [60+esp]
+	rol	edx,1
+	add	ebp,ecx
+	ror	esi,2
+	mov	ecx,edi
+	rol	ecx,5
+	mov	DWORD [8+esp],edx
+	lea	edx,[2400959708+ebp*1+edx]
+	mov	ebp,eax
+	add	edx,ecx
+	and	ebp,ebx
+	mov	ecx,DWORD [12+esp]
+	add	edx,ebp
+	; 40_59 51
+	mov	ebp,esi
+	xor	ecx,DWORD [20+esp]
+	xor	ebp,eax
+	xor	ecx,DWORD [44+esp]
+	and	ebp,edi
+	xor	ecx,DWORD [esp]
+	rol	ecx,1
+	add	ebp,ebx
+	ror	edi,2
+	mov	ebx,edx
+	rol	ebx,5
+	mov	DWORD [12+esp],ecx
+	lea	ecx,[2400959708+ebp*1+ecx]
+	mov	ebp,esi
+	add	ecx,ebx
+	and	ebp,eax
+	mov	ebx,DWORD [16+esp]
+	add	ecx,ebp
+	; 40_59 52
+	mov	ebp,edi
+	xor	ebx,DWORD [24+esp]
+	xor	ebp,esi
+	xor	ebx,DWORD [48+esp]
+	and	ebp,edx
+	xor	ebx,DWORD [4+esp]
+	rol	ebx,1
+	add	ebp,eax
+	ror	edx,2
+	mov	eax,ecx
+	rol	eax,5
+	mov	DWORD [16+esp],ebx
+	lea	ebx,[2400959708+ebp*1+ebx]
+	mov	ebp,edi
+	add	ebx,eax
+	and	ebp,esi
+	mov	eax,DWORD [20+esp]
+	add	ebx,ebp
+	; 40_59 53
+	mov	ebp,edx
+	xor	eax,DWORD [28+esp]
+	xor	ebp,edi
+	xor	eax,DWORD [52+esp]
+	and	ebp,ecx
+	xor	eax,DWORD [8+esp]
+	rol	eax,1
+	add	ebp,esi
+	ror	ecx,2
+	mov	esi,ebx
+	rol	esi,5
+	mov	DWORD [20+esp],eax
+	lea	eax,[2400959708+ebp*1+eax]
+	mov	ebp,edx
+	add	eax,esi
+	and	ebp,edi
+	mov	esi,DWORD [24+esp]
+	add	eax,ebp
+	; 40_59 54
+	mov	ebp,ecx
+	xor	esi,DWORD [32+esp]
+	xor	ebp,edx
+	xor	esi,DWORD [56+esp]
+	and	ebp,ebx
+	xor	esi,DWORD [12+esp]
+	rol	esi,1
+	add	ebp,edi
+	ror	ebx,2
+	mov	edi,eax
+	rol	edi,5
+	mov	DWORD [24+esp],esi
+	lea	esi,[2400959708+ebp*1+esi]
+	mov	ebp,ecx
+	add	esi,edi
+	and	ebp,edx
+	mov	edi,DWORD [28+esp]
+	add	esi,ebp
+	; 40_59 55
+	mov	ebp,ebx
+	xor	edi,DWORD [36+esp]
+	xor	ebp,ecx
+	xor	edi,DWORD [60+esp]
+	and	ebp,eax
+	xor	edi,DWORD [16+esp]
+	rol	edi,1
+	add	ebp,edx
+	ror	eax,2
+	mov	edx,esi
+	rol	edx,5
+	mov	DWORD [28+esp],edi
+	lea	edi,[2400959708+ebp*1+edi]
+	mov	ebp,ebx
+	add	edi,edx
+	and	ebp,ecx
+	mov	edx,DWORD [32+esp]
+	add	edi,ebp
+	; 40_59 56
+	mov	ebp,eax
+	xor	edx,DWORD [40+esp]
+	xor	ebp,ebx
+	xor	edx,DWORD [esp]
+	and	ebp,esi
+	xor	edx,DWORD [20+esp]
+	rol	edx,1
+	add	ebp,ecx
+	ror	esi,2
+	mov	ecx,edi
+	rol	ecx,5
+	mov	DWORD [32+esp],edx
+	lea	edx,[2400959708+ebp*1+edx]
+	mov	ebp,eax
+	add	edx,ecx
+	and	ebp,ebx
+	mov	ecx,DWORD [36+esp]
+	add	edx,ebp
+	; 40_59 57
+	mov	ebp,esi
+	xor	ecx,DWORD [44+esp]
+	xor	ebp,eax
+	xor	ecx,DWORD [4+esp]
+	and	ebp,edi
+	xor	ecx,DWORD [24+esp]
+	rol	ecx,1
+	add	ebp,ebx
+	ror	edi,2
+	mov	ebx,edx
+	rol	ebx,5
+	mov	DWORD [36+esp],ecx
+	lea	ecx,[2400959708+ebp*1+ecx]
+	mov	ebp,esi
+	add	ecx,ebx
+	and	ebp,eax
+	mov	ebx,DWORD [40+esp]
+	add	ecx,ebp
+	; 40_59 58
+	mov	ebp,edi
+	xor	ebx,DWORD [48+esp]
+	xor	ebp,esi
+	xor	ebx,DWORD [8+esp]
+	and	ebp,edx
+	xor	ebx,DWORD [28+esp]
+	rol	ebx,1
+	add	ebp,eax
+	ror	edx,2
+	mov	eax,ecx
+	rol	eax,5
+	mov	DWORD [40+esp],ebx
+	lea	ebx,[2400959708+ebp*1+ebx]
+	mov	ebp,edi
+	add	ebx,eax
+	and	ebp,esi
+	mov	eax,DWORD [44+esp]
+	add	ebx,ebp
+	; 40_59 59
+	mov	ebp,edx
+	xor	eax,DWORD [52+esp]
+	xor	ebp,edi
+	xor	eax,DWORD [12+esp]
+	and	ebp,ecx
+	xor	eax,DWORD [32+esp]
+	rol	eax,1
+	add	ebp,esi
+	ror	ecx,2
+	mov	esi,ebx
+	rol	esi,5
+	mov	DWORD [44+esp],eax
+	lea	eax,[2400959708+ebp*1+eax]
+	mov	ebp,edx
+	add	eax,esi
+	and	ebp,edi
+	mov	esi,DWORD [48+esp]
+	add	eax,ebp
+	; 20_39 60
+	mov	ebp,ebx
+	xor	esi,DWORD [56+esp]
+	xor	ebp,ecx
+	xor	esi,DWORD [16+esp]
+	xor	ebp,edx
+	xor	esi,DWORD [36+esp]
+	rol	esi,1
+	add	edi,ebp
+	ror	ebx,2
+	mov	ebp,eax
+	rol	ebp,5
+	mov	DWORD [48+esp],esi
+	lea	esi,[3395469782+edi*1+esi]
+	mov	edi,DWORD [52+esp]
+	add	esi,ebp
+	; 20_39 61
+	mov	ebp,eax
+	xor	edi,DWORD [60+esp]
+	xor	ebp,ebx
+	xor	edi,DWORD [20+esp]
+	xor	ebp,ecx
+	xor	edi,DWORD [40+esp]
+	rol	edi,1
+	add	edx,ebp
+	ror	eax,2
+	mov	ebp,esi
+	rol	ebp,5
+	mov	DWORD [52+esp],edi
+	lea	edi,[3395469782+edx*1+edi]
+	mov	edx,DWORD [56+esp]
+	add	edi,ebp
+	; 20_39 62
+	mov	ebp,esi
+	xor	edx,DWORD [esp]
+	xor	ebp,eax
+	xor	edx,DWORD [24+esp]
+	xor	ebp,ebx
+	xor	edx,DWORD [44+esp]
+	rol	edx,1
+	add	ecx,ebp
+	ror	esi,2
+	mov	ebp,edi
+	rol	ebp,5
+	mov	DWORD [56+esp],edx
+	lea	edx,[3395469782+ecx*1+edx]
+	mov	ecx,DWORD [60+esp]
+	add	edx,ebp
+	; 20_39 63
+	mov	ebp,edi
+	xor	ecx,DWORD [4+esp]
+	xor	ebp,esi
+	xor	ecx,DWORD [28+esp]
+	xor	ebp,eax
+	xor	ecx,DWORD [48+esp]
+	rol	ecx,1
+	add	ebx,ebp
+	ror	edi,2
+	mov	ebp,edx
+	rol	ebp,5
+	mov	DWORD [60+esp],ecx
+	lea	ecx,[3395469782+ebx*1+ecx]
+	mov	ebx,DWORD [esp]
+	add	ecx,ebp
+	; 20_39 64
+	mov	ebp,edx
+	xor	ebx,DWORD [8+esp]
+	xor	ebp,edi
+	xor	ebx,DWORD [32+esp]
+	xor	ebp,esi
+	xor	ebx,DWORD [52+esp]
+	rol	ebx,1
+	add	eax,ebp
+	ror	edx,2
+	mov	ebp,ecx
+	rol	ebp,5
+	mov	DWORD [esp],ebx
+	lea	ebx,[3395469782+eax*1+ebx]
+	mov	eax,DWORD [4+esp]
+	add	ebx,ebp
+	; 20_39 65
+	mov	ebp,ecx
+	xor	eax,DWORD [12+esp]
+	xor	ebp,edx
+	xor	eax,DWORD [36+esp]
+	xor	ebp,edi
+	xor	eax,DWORD [56+esp]
+	rol	eax,1
+	add	esi,ebp
+	ror	ecx,2
+	mov	ebp,ebx
+	rol	ebp,5
+	mov	DWORD [4+esp],eax
+	lea	eax,[3395469782+esi*1+eax]
+	mov	esi,DWORD [8+esp]
+	add	eax,ebp
+	; 20_39 66
+	mov	ebp,ebx
+	xor	esi,DWORD [16+esp]
+	xor	ebp,ecx
+	xor	esi,DWORD [40+esp]
+	xor	ebp,edx
+	xor	esi,DWORD [60+esp]
+	rol	esi,1
+	add	edi,ebp
+	ror	ebx,2
+	mov	ebp,eax
+	rol	ebp,5
+	mov	DWORD [8+esp],esi
+	lea	esi,[3395469782+edi*1+esi]
+	mov	edi,DWORD [12+esp]
+	add	esi,ebp
+	; 20_39 67
+	mov	ebp,eax
+	xor	edi,DWORD [20+esp]
+	xor	ebp,ebx
+	xor	edi,DWORD [44+esp]
+	xor	ebp,ecx
+	xor	edi,DWORD [esp]
+	rol	edi,1
+	add	edx,ebp
+	ror	eax,2
+	mov	ebp,esi
+	rol	ebp,5
+	mov	DWORD [12+esp],edi
+	lea	edi,[3395469782+edx*1+edi]
+	mov	edx,DWORD [16+esp]
+	add	edi,ebp
+	; 20_39 68
+	mov	ebp,esi
+	xor	edx,DWORD [24+esp]
+	xor	ebp,eax
+	xor	edx,DWORD [48+esp]
+	xor	ebp,ebx
+	xor	edx,DWORD [4+esp]
+	rol	edx,1
+	add	ecx,ebp
+	ror	esi,2
+	mov	ebp,edi
+	rol	ebp,5
+	mov	DWORD [16+esp],edx
+	lea	edx,[3395469782+ecx*1+edx]
+	mov	ecx,DWORD [20+esp]
+	add	edx,ebp
+	; 20_39 69
+	mov	ebp,edi
+	xor	ecx,DWORD [28+esp]
+	xor	ebp,esi
+	xor	ecx,DWORD [52+esp]
+	xor	ebp,eax
+	xor	ecx,DWORD [8+esp]
+	rol	ecx,1
+	add	ebx,ebp
+	ror	edi,2
+	mov	ebp,edx
+	rol	ebp,5
+	mov	DWORD [20+esp],ecx
+	lea	ecx,[3395469782+ebx*1+ecx]
+	mov	ebx,DWORD [24+esp]
+	add	ecx,ebp
+	; 20_39 70
+	mov	ebp,edx
+	xor	ebx,DWORD [32+esp]
+	xor	ebp,edi
+	xor	ebx,DWORD [56+esp]
+	xor	ebp,esi
+	xor	ebx,DWORD [12+esp]
+	rol	ebx,1
+	add	eax,ebp
+	ror	edx,2
+	mov	ebp,ecx
+	rol	ebp,5
+	mov	DWORD [24+esp],ebx
+	lea	ebx,[3395469782+eax*1+ebx]
+	mov	eax,DWORD [28+esp]
+	add	ebx,ebp
+	; 20_39 71
+	mov	ebp,ecx
+	xor	eax,DWORD [36+esp]
+	xor	ebp,edx
+	xor	eax,DWORD [60+esp]
+	xor	ebp,edi
+	xor	eax,DWORD [16+esp]
+	rol	eax,1
+	add	esi,ebp
+	ror	ecx,2
+	mov	ebp,ebx
+	rol	ebp,5
+	mov	DWORD [28+esp],eax
+	lea	eax,[3395469782+esi*1+eax]
+	mov	esi,DWORD [32+esp]
+	add	eax,ebp
+	; 20_39 72
+	mov	ebp,ebx
+	xor	esi,DWORD [40+esp]
+	xor	ebp,ecx
+	xor	esi,DWORD [esp]
+	xor	ebp,edx
+	xor	esi,DWORD [20+esp]
+	rol	esi,1
+	add	edi,ebp
+	ror	ebx,2
+	mov	ebp,eax
+	rol	ebp,5
+	mov	DWORD [32+esp],esi
+	lea	esi,[3395469782+edi*1+esi]
+	mov	edi,DWORD [36+esp]
+	add	esi,ebp
+	; 20_39 73
+	mov	ebp,eax
+	xor	edi,DWORD [44+esp]
+	xor	ebp,ebx
+	xor	edi,DWORD [4+esp]
+	xor	ebp,ecx
+	xor	edi,DWORD [24+esp]
+	rol	edi,1
+	add	edx,ebp
+	ror	eax,2
+	mov	ebp,esi
+	rol	ebp,5
+	mov	DWORD [36+esp],edi
+	lea	edi,[3395469782+edx*1+edi]
+	mov	edx,DWORD [40+esp]
+	add	edi,ebp
+	; 20_39 74
+	mov	ebp,esi
+	xor	edx,DWORD [48+esp]
+	xor	ebp,eax
+	xor	edx,DWORD [8+esp]
+	xor	ebp,ebx
+	xor	edx,DWORD [28+esp]
+	rol	edx,1
+	add	ecx,ebp
+	ror	esi,2
+	mov	ebp,edi
+	rol	ebp,5
+	mov	DWORD [40+esp],edx
+	lea	edx,[3395469782+ecx*1+edx]
+	mov	ecx,DWORD [44+esp]
+	add	edx,ebp
+	; 20_39 75
+	mov	ebp,edi
+	xor	ecx,DWORD [52+esp]
+	xor	ebp,esi
+	xor	ecx,DWORD [12+esp]
+	xor	ebp,eax
+	xor	ecx,DWORD [32+esp]
+	rol	ecx,1
+	add	ebx,ebp
+	ror	edi,2
+	mov	ebp,edx
+	rol	ebp,5
+	mov	DWORD [44+esp],ecx
+	lea	ecx,[3395469782+ebx*1+ecx]
+	mov	ebx,DWORD [48+esp]
+	add	ecx,ebp
+	; 20_39 76
+	mov	ebp,edx
+	xor	ebx,DWORD [56+esp]
+	xor	ebp,edi
+	xor	ebx,DWORD [16+esp]
+	xor	ebp,esi
+	xor	ebx,DWORD [36+esp]
+	rol	ebx,1
+	add	eax,ebp
+	ror	edx,2
+	mov	ebp,ecx
+	rol	ebp,5
+	mov	DWORD [48+esp],ebx
+	lea	ebx,[3395469782+eax*1+ebx]
+	mov	eax,DWORD [52+esp]
+	add	ebx,ebp
+	; 20_39 77
+	mov	ebp,ecx
+	xor	eax,DWORD [60+esp]
+	xor	ebp,edx
+	xor	eax,DWORD [20+esp]
+	xor	ebp,edi
+	xor	eax,DWORD [40+esp]
+	rol	eax,1
+	add	esi,ebp
+	ror	ecx,2
+	mov	ebp,ebx
+	rol	ebp,5
+	lea	eax,[3395469782+esi*1+eax]
+	mov	esi,DWORD [56+esp]
+	add	eax,ebp
+	; 20_39 78
+	mov	ebp,ebx
+	xor	esi,DWORD [esp]
+	xor	ebp,ecx
+	xor	esi,DWORD [24+esp]
+	xor	ebp,edx
+	xor	esi,DWORD [44+esp]
+	rol	esi,1
+	add	edi,ebp
+	ror	ebx,2
+	mov	ebp,eax
+	rol	ebp,5
+	lea	esi,[3395469782+edi*1+esi]
+	mov	edi,DWORD [60+esp]
+	add	esi,ebp
+	; 20_39 79
+	mov	ebp,eax
+	xor	edi,DWORD [4+esp]
+	xor	ebp,ebx
+	xor	edi,DWORD [28+esp]
+	xor	ebp,ecx
+	xor	edi,DWORD [48+esp]
+	rol	edi,1
+	add	edx,ebp
+	ror	eax,2
+	mov	ebp,esi
+	rol	ebp,5
+	lea	edi,[3395469782+edx*1+edi]
+	add	edi,ebp
+	mov	ebp,DWORD [96+esp]
+	mov	edx,DWORD [100+esp]
+	add	edi,DWORD [ebp]
+	add	esi,DWORD [4+ebp]
+	add	eax,DWORD [8+ebp]
+	add	ebx,DWORD [12+ebp]
+	add	ecx,DWORD [16+ebp]
+	mov	DWORD [ebp],edi
+	add	edx,64
+	mov	DWORD [4+ebp],esi
+	cmp	edx,DWORD [104+esp]
+	mov	DWORD [8+ebp],eax
+	mov	edi,ecx
+	mov	DWORD [12+ebp],ebx
+	mov	esi,edx
+	mov	DWORD [16+ebp],ecx
+	jb	NEAR L$002loop
+	add	esp,76
+	pop	edi
+	pop	esi
+	pop	ebx
+	pop	ebp
+	ret
+align	16
+__sha1_block_data_order_shaext:
+	push	ebp
+	push	ebx
+	push	esi
+	push	edi
+	call	L$003pic_point
+L$003pic_point:
+	pop	ebp
+	lea	ebp,[(L$K_XX_XX-L$003pic_point)+ebp]
+L$shaext_shortcut:
+	mov	edi,DWORD [20+esp]
+	mov	ebx,esp
+	mov	esi,DWORD [24+esp]
+	mov	ecx,DWORD [28+esp]
+	sub	esp,32
+	movdqu	xmm0,[edi]
+	movd	xmm1,DWORD [16+edi]
+	and	esp,-32
+	movdqa	xmm3,[80+ebp]
+	movdqu	xmm4,[esi]
+	pshufd	xmm0,xmm0,27
+	movdqu	xmm5,[16+esi]
+	pshufd	xmm1,xmm1,27
+	movdqu	xmm6,[32+esi]
+db	102,15,56,0,227
+	movdqu	xmm7,[48+esi]
+db	102,15,56,0,235
+db	102,15,56,0,243
+db	102,15,56,0,251
+	jmp	NEAR L$004loop_shaext
+align	16
+L$004loop_shaext:
+	dec	ecx
+	lea	eax,[64+esi]
+	movdqa	[esp],xmm1
+	paddd	xmm1,xmm4
+	cmovne	esi,eax
+	movdqa	[16+esp],xmm0
+db	15,56,201,229
+	movdqa	xmm2,xmm0
+db	15,58,204,193,0
+db	15,56,200,213
+	pxor	xmm4,xmm6
+db	15,56,201,238
+db	15,56,202,231
+	movdqa	xmm1,xmm0
+db	15,58,204,194,0
+db	15,56,200,206
+	pxor	xmm5,xmm7
+db	15,56,202,236
+db	15,56,201,247
+	movdqa	xmm2,xmm0
+db	15,58,204,193,0
+db	15,56,200,215
+	pxor	xmm6,xmm4
+db	15,56,201,252
+db	15,56,202,245
+	movdqa	xmm1,xmm0
+db	15,58,204,194,0
+db	15,56,200,204
+	pxor	xmm7,xmm5
+db	15,56,202,254
+db	15,56,201,229
+	movdqa	xmm2,xmm0
+db	15,58,204,193,0
+db	15,56,200,213
+	pxor	xmm4,xmm6
+db	15,56,201,238
+db	15,56,202,231
+	movdqa	xmm1,xmm0
+db	15,58,204,194,1
+db	15,56,200,206
+	pxor	xmm5,xmm7
+db	15,56,202,236
+db	15,56,201,247
+	movdqa	xmm2,xmm0
+db	15,58,204,193,1
+db	15,56,200,215
+	pxor	xmm6,xmm4
+db	15,56,201,252
+db	15,56,202,245
+	movdqa	xmm1,xmm0
+db	15,58,204,194,1
+db	15,56,200,204
+	pxor	xmm7,xmm5
+db	15,56,202,254
+db	15,56,201,229
+	movdqa	xmm2,xmm0
+db	15,58,204,193,1
+db	15,56,200,213
+	pxor	xmm4,xmm6
+db	15,56,201,238
+db	15,56,202,231
+	movdqa	xmm1,xmm0
+db	15,58,204,194,1
+db	15,56,200,206
+	pxor	xmm5,xmm7
+db	15,56,202,236
+db	15,56,201,247
+	movdqa	xmm2,xmm0
+db	15,58,204,193,2
+db	15,56,200,215
+	pxor	xmm6,xmm4
+db	15,56,201,252
+db	15,56,202,245
+	movdqa	xmm1,xmm0
+db	15,58,204,194,2
+db	15,56,200,204
+	pxor	xmm7,xmm5
+db	15,56,202,254
+db	15,56,201,229
+	movdqa	xmm2,xmm0
+db	15,58,204,193,2
+db	15,56,200,213
+	pxor	xmm4,xmm6
+db	15,56,201,238
+db	15,56,202,231
+	movdqa	xmm1,xmm0
+db	15,58,204,194,2
+db	15,56,200,206
+	pxor	xmm5,xmm7
+db	15,56,202,236
+db	15,56,201,247
+	movdqa	xmm2,xmm0
+db	15,58,204,193,2
+db	15,56,200,215
+	pxor	xmm6,xmm4
+db	15,56,201,252
+db	15,56,202,245
+	movdqa	xmm1,xmm0
+db	15,58,204,194,3
+db	15,56,200,204
+	pxor	xmm7,xmm5
+db	15,56,202,254
+	movdqu	xmm4,[esi]
+	movdqa	xmm2,xmm0
+db	15,58,204,193,3
+db	15,56,200,213
+	movdqu	xmm5,[16+esi]
+db	102,15,56,0,227
+	movdqa	xmm1,xmm0
+db	15,58,204,194,3
+db	15,56,200,206
+	movdqu	xmm6,[32+esi]
+db	102,15,56,0,235
+	movdqa	xmm2,xmm0
+db	15,58,204,193,3
+db	15,56,200,215
+	movdqu	xmm7,[48+esi]
+db	102,15,56,0,243
+	movdqa	xmm1,xmm0
+db	15,58,204,194,3
+	movdqa	xmm2,[esp]
+db	102,15,56,0,251
+db	15,56,200,202
+	paddd	xmm0,[16+esp]
+	jnz	NEAR L$004loop_shaext
+	pshufd	xmm0,xmm0,27
+	pshufd	xmm1,xmm1,27
+	movdqu	[edi],xmm0
+	movd	DWORD [16+edi],xmm1
+	mov	esp,ebx
+	pop	edi
+	pop	esi
+	pop	ebx
+	pop	ebp
+	ret
+align	16
+__sha1_block_data_order_ssse3:
+	push	ebp
+	push	ebx
+	push	esi
+	push	edi
+	call	L$005pic_point
+L$005pic_point:
+	pop	ebp
+	lea	ebp,[(L$K_XX_XX-L$005pic_point)+ebp]
+L$ssse3_shortcut:
+	movdqa	xmm7,[ebp]
+	movdqa	xmm0,[16+ebp]
+	movdqa	xmm1,[32+ebp]
+	movdqa	xmm2,[48+ebp]
+	movdqa	xmm6,[64+ebp]
+	mov	edi,DWORD [20+esp]
+	mov	ebp,DWORD [24+esp]
+	mov	edx,DWORD [28+esp]
+	mov	esi,esp
+	sub	esp,208
+	and	esp,-64
+	movdqa	[112+esp],xmm0
+	movdqa	[128+esp],xmm1
+	movdqa	[144+esp],xmm2
+	shl	edx,6
+	movdqa	[160+esp],xmm7
+	add	edx,ebp
+	movdqa	[176+esp],xmm6
+	add	ebp,64
+	mov	DWORD [192+esp],edi
+	mov	DWORD [196+esp],ebp
+	mov	DWORD [200+esp],edx
+	mov	DWORD [204+esp],esi
+	mov	eax,DWORD [edi]
+	mov	ebx,DWORD [4+edi]
+	mov	ecx,DWORD [8+edi]
+	mov	edx,DWORD [12+edi]
+	mov	edi,DWORD [16+edi]
+	mov	esi,ebx
+	movdqu	xmm0,[ebp-64]
+	movdqu	xmm1,[ebp-48]
+	movdqu	xmm2,[ebp-32]
+	movdqu	xmm3,[ebp-16]
+db	102,15,56,0,198
+db	102,15,56,0,206
+db	102,15,56,0,214
+	movdqa	[96+esp],xmm7
+db	102,15,56,0,222
+	paddd	xmm0,xmm7
+	paddd	xmm1,xmm7
+	paddd	xmm2,xmm7
+	movdqa	[esp],xmm0
+	psubd	xmm0,xmm7
+	movdqa	[16+esp],xmm1
+	psubd	xmm1,xmm7
+	movdqa	[32+esp],xmm2
+	mov	ebp,ecx
+	psubd	xmm2,xmm7
+	xor	ebp,edx
+	pshufd	xmm4,xmm0,238
+	and	esi,ebp
+	jmp	NEAR L$006loop
+align	16
+L$006loop:
+	ror	ebx,2
+	xor	esi,edx
+	mov	ebp,eax
+	punpcklqdq	xmm4,xmm1
+	movdqa	xmm6,xmm3
+	add	edi,DWORD [esp]
+	xor	ebx,ecx
+	paddd	xmm7,xmm3
+	movdqa	[64+esp],xmm0
+	rol	eax,5
+	add	edi,esi
+	psrldq	xmm6,4
+	and	ebp,ebx
+	xor	ebx,ecx
+	pxor	xmm4,xmm0
+	add	edi,eax
+	ror	eax,7
+	pxor	xmm6,xmm2
+	xor	ebp,ecx
+	mov	esi,edi
+	add	edx,DWORD [4+esp]
+	pxor	xmm4,xmm6
+	xor	eax,ebx
+	rol	edi,5
+	movdqa	[48+esp],xmm7
+	add	edx,ebp
+	and	esi,eax
+	movdqa	xmm0,xmm4
+	xor	eax,ebx
+	add	edx,edi
+	ror	edi,7
+	movdqa	xmm6,xmm4
+	xor	esi,ebx
+	pslldq	xmm0,12
+	paddd	xmm4,xmm4
+	mov	ebp,edx
+	add	ecx,DWORD [8+esp]
+	psrld	xmm6,31
+	xor	edi,eax
+	rol	edx,5
+	movdqa	xmm7,xmm0
+	add	ecx,esi
+	and	ebp,edi
+	xor	edi,eax
+	psrld	xmm0,30
+	add	ecx,edx
+	ror	edx,7
+	por	xmm4,xmm6
+	xor	ebp,eax
+	mov	esi,ecx
+	add	ebx,DWORD [12+esp]
+	pslld	xmm7,2
+	xor	edx,edi
+	rol	ecx,5
+	pxor	xmm4,xmm0
+	movdqa	xmm0,[96+esp]
+	add	ebx,ebp
+	and	esi,edx
+	pxor	xmm4,xmm7
+	pshufd	xmm5,xmm1,238
+	xor	edx,edi
+	add	ebx,ecx
+	ror	ecx,7
+	xor	esi,edi
+	mov	ebp,ebx
+	punpcklqdq	xmm5,xmm2
+	movdqa	xmm7,xmm4
+	add	eax,DWORD [16+esp]
+	xor	ecx,edx
+	paddd	xmm0,xmm4
+	movdqa	[80+esp],xmm1
+	rol	ebx,5
+	add	eax,esi
+	psrldq	xmm7,4
+	and	ebp,ecx
+	xor	ecx,edx
+	pxor	xmm5,xmm1
+	add	eax,ebx
+	ror	ebx,7
+	pxor	xmm7,xmm3
+	xor	ebp,edx
+	mov	esi,eax
+	add	edi,DWORD [20+esp]
+	pxor	xmm5,xmm7
+	xor	ebx,ecx
+	rol	eax,5
+	movdqa	[esp],xmm0
+	add	edi,ebp
+	and	esi,ebx
+	movdqa	xmm1,xmm5
+	xor	ebx,ecx
+	add	edi,eax
+	ror	eax,7
+	movdqa	xmm7,xmm5
+	xor	esi,ecx
+	pslldq	xmm1,12
+	paddd	xmm5,xmm5
+	mov	ebp,edi
+	add	edx,DWORD [24+esp]
+	psrld	xmm7,31
+	xor	eax,ebx
+	rol	edi,5
+	movdqa	xmm0,xmm1
+	add	edx,esi
+	and	ebp,eax
+	xor	eax,ebx
+	psrld	xmm1,30
+	add	edx,edi
+	ror	edi,7
+	por	xmm5,xmm7
+	xor	ebp,ebx
+	mov	esi,edx
+	add	ecx,DWORD [28+esp]
+	pslld	xmm0,2
+	xor	edi,eax
+	rol	edx,5
+	pxor	xmm5,xmm1
+	movdqa	xmm1,[112+esp]
+	add	ecx,ebp
+	and	esi,edi
+	pxor	xmm5,xmm0
+	pshufd	xmm6,xmm2,238
+	xor	edi,eax
+	add	ecx,edx
+	ror	edx,7
+	xor	esi,eax
+	mov	ebp,ecx
+	punpcklqdq	xmm6,xmm3
+	movdqa	xmm0,xmm5
+	add	ebx,DWORD [32+esp]
+	xor	edx,edi
+	paddd	xmm1,xmm5
+	movdqa	[96+esp],xmm2
+	rol	ecx,5
+	add	ebx,esi
+	psrldq	xmm0,4
+	and	ebp,edx
+	xor	edx,edi
+	pxor	xmm6,xmm2
+	add	ebx,ecx
+	ror	ecx,7
+	pxor	xmm0,xmm4
+	xor	ebp,edi
+	mov	esi,ebx
+	add	eax,DWORD [36+esp]
+	pxor	xmm6,xmm0
+	xor	ecx,edx
+	rol	ebx,5
+	movdqa	[16+esp],xmm1
+	add	eax,ebp
+	and	esi,ecx
+	movdqa	xmm2,xmm6
+	xor	ecx,edx
+	add	eax,ebx
+	ror	ebx,7
+	movdqa	xmm0,xmm6
+	xor	esi,edx
+	pslldq	xmm2,12
+	paddd	xmm6,xmm6
+	mov	ebp,eax
+	add	edi,DWORD [40+esp]
+	psrld	xmm0,31
+	xor	ebx,ecx
+	rol	eax,5
+	movdqa	xmm1,xmm2
+	add	edi,esi
+	and	ebp,ebx
+	xor	ebx,ecx
+	psrld	xmm2,30
+	add	edi,eax
+	ror	eax,7
+	por	xmm6,xmm0
+	xor	ebp,ecx
+	movdqa	xmm0,[64+esp]
+	mov	esi,edi
+	add	edx,DWORD [44+esp]
+	pslld	xmm1,2
+	xor	eax,ebx
+	rol	edi,5
+	pxor	xmm6,xmm2
+	movdqa	xmm2,[112+esp]
+	add	edx,ebp
+	and	esi,eax
+	pxor	xmm6,xmm1
+	pshufd	xmm7,xmm3,238
+	xor	eax,ebx
+	add	edx,edi
+	ror	edi,7
+	xor	esi,ebx
+	mov	ebp,edx
+	punpcklqdq	xmm7,xmm4
+	movdqa	xmm1,xmm6
+	add	ecx,DWORD [48+esp]
+	xor	edi,eax
+	paddd	xmm2,xmm6
+	movdqa	[64+esp],xmm3
+	rol	edx,5
+	add	ecx,esi
+	psrldq	xmm1,4
+	and	ebp,edi
+	xor	edi,eax
+	pxor	xmm7,xmm3
+	add	ecx,edx
+	ror	edx,7
+	pxor	xmm1,xmm5
+	xor	ebp,eax
+	mov	esi,ecx
+	add	ebx,DWORD [52+esp]
+	pxor	xmm7,xmm1
+	xor	edx,edi
+	rol	ecx,5
+	movdqa	[32+esp],xmm2
+	add	ebx,ebp
+	and	esi,edx
+	movdqa	xmm3,xmm7
+	xor	edx,edi
+	add	ebx,ecx
+	ror	ecx,7
+	movdqa	xmm1,xmm7
+	xor	esi,edi
+	pslldq	xmm3,12
+	paddd	xmm7,xmm7
+	mov	ebp,ebx
+	add	eax,DWORD [56+esp]
+	psrld	xmm1,31
+	xor	ecx,edx
+	rol	ebx,5
+	movdqa	xmm2,xmm3
+	add	eax,esi
+	and	ebp,ecx
+	xor	ecx,edx
+	psrld	xmm3,30
+	add	eax,ebx
+	ror	ebx,7
+	por	xmm7,xmm1
+	xor	ebp,edx
+	movdqa	xmm1,[80+esp]
+	mov	esi,eax
+	add	edi,DWORD [60+esp]
+	pslld	xmm2,2
+	xor	ebx,ecx
+	rol	eax,5
+	pxor	xmm7,xmm3
+	movdqa	xmm3,[112+esp]
+	add	edi,ebp
+	and	esi,ebx
+	pxor	xmm7,xmm2
+	pshufd	xmm2,xmm6,238
+	xor	ebx,ecx
+	add	edi,eax
+	ror	eax,7
+	pxor	xmm0,xmm4
+	punpcklqdq	xmm2,xmm7
+	xor	esi,ecx
+	mov	ebp,edi
+	add	edx,DWORD [esp]
+	pxor	xmm0,xmm1
+	movdqa	[80+esp],xmm4
+	xor	eax,ebx
+	rol	edi,5
+	movdqa	xmm4,xmm3
+	add	edx,esi
+	paddd	xmm3,xmm7
+	and	ebp,eax
+	pxor	xmm0,xmm2
+	xor	eax,ebx
+	add	edx,edi
+	ror	edi,7
+	xor	ebp,ebx
+	movdqa	xmm2,xmm0
+	movdqa	[48+esp],xmm3
+	mov	esi,edx
+	add	ecx,DWORD [4+esp]
+	xor	edi,eax
+	rol	edx,5
+	pslld	xmm0,2
+	add	ecx,ebp
+	and	esi,edi
+	psrld	xmm2,30
+	xor	edi,eax
+	add	ecx,edx
+	ror	edx,7
+	xor	esi,eax
+	mov	ebp,ecx
+	add	ebx,DWORD [8+esp]
+	xor	edx,edi
+	rol	ecx,5
+	por	xmm0,xmm2
+	add	ebx,esi
+	and	ebp,edx
+	movdqa	xmm2,[96+esp]
+	xor	edx,edi
+	add	ebx,ecx
+	add	eax,DWORD [12+esp]
+	xor	ebp,edi
+	mov	esi,ebx
+	pshufd	xmm3,xmm7,238
+	rol	ebx,5
+	add	eax,ebp
+	xor	esi,edx
+	ror	ecx,7
+	add	eax,ebx
+	add	edi,DWORD [16+esp]
+	pxor	xmm1,xmm5
+	punpcklqdq	xmm3,xmm0
+	xor	esi,ecx
+	mov	ebp,eax
+	rol	eax,5
+	pxor	xmm1,xmm2
+	movdqa	[96+esp],xmm5
+	add	edi,esi
+	xor	ebp,ecx
+	movdqa	xmm5,xmm4
+	ror	ebx,7
+	paddd	xmm4,xmm0
+	add	edi,eax
+	pxor	xmm1,xmm3
+	add	edx,DWORD [20+esp]
+	xor	ebp,ebx
+	mov	esi,edi
+	rol	edi,5
+	movdqa	xmm3,xmm1
+	movdqa	[esp],xmm4
+	add	edx,ebp
+	xor	esi,ebx
+	ror	eax,7
+	add	edx,edi
+	pslld	xmm1,2
+	add	ecx,DWORD [24+esp]
+	xor	esi,eax
+	psrld	xmm3,30
+	mov	ebp,edx
+	rol	edx,5
+	add	ecx,esi
+	xor	ebp,eax
+	ror	edi,7
+	add	ecx,edx
+	por	xmm1,xmm3
+	add	ebx,DWORD [28+esp]
+	xor	ebp,edi
+	movdqa	xmm3,[64+esp]
+	mov	esi,ecx
+	rol	ecx,5
+	add	ebx,ebp
+	xor	esi,edi
+	ror	edx,7
+	pshufd	xmm4,xmm0,238
+	add	ebx,ecx
+	add	eax,DWORD [32+esp]
+	pxor	xmm2,xmm6
+	punpcklqdq	xmm4,xmm1
+	xor	esi,edx
+	mov	ebp,ebx
+	rol	ebx,5
+	pxor	xmm2,xmm3
+	movdqa	[64+esp],xmm6
+	add	eax,esi
+	xor	ebp,edx
+	movdqa	xmm6,[128+esp]
+	ror	ecx,7
+	paddd	xmm5,xmm1
+	add	eax,ebx
+	pxor	xmm2,xmm4
+	add	edi,DWORD [36+esp]
+	xor	ebp,ecx
+	mov	esi,eax
+	rol	eax,5
+	movdqa	xmm4,xmm2
+	movdqa	[16+esp],xmm5
+	add	edi,ebp
+	xor	esi,ecx
+	ror	ebx,7
+	add	edi,eax
+	pslld	xmm2,2
+	add	edx,DWORD [40+esp]
+	xor	esi,ebx
+	psrld	xmm4,30
+	mov	ebp,edi
+	rol	edi,5
+	add	edx,esi
+	xor	ebp,ebx
+	ror	eax,7
+	add	edx,edi
+	por	xmm2,xmm4
+	add	ecx,DWORD [44+esp]
+	xor	ebp,eax
+	movdqa	xmm4,[80+esp]
+	mov	esi,edx
+	rol	edx,5
+	add	ecx,ebp
+	xor	esi,eax
+	ror	edi,7
+	pshufd	xmm5,xmm1,238
+	add	ecx,edx
+	add	ebx,DWORD [48+esp]
+	pxor	xmm3,xmm7
+	punpcklqdq	xmm5,xmm2
+	xor	esi,edi
+	mov	ebp,ecx
+	rol	ecx,5
+	pxor	xmm3,xmm4
+	movdqa	[80+esp],xmm7
+	add	ebx,esi
+	xor	ebp,edi
+	movdqa	xmm7,xmm6
+	ror	edx,7
+	paddd	xmm6,xmm2
+	add	ebx,ecx
+	pxor	xmm3,xmm5
+	add	eax,DWORD [52+esp]
+	xor	ebp,edx
+	mov	esi,ebx
+	rol	ebx,5
+	movdqa	xmm5,xmm3
+	movdqa	[32+esp],xmm6
+	add	eax,ebp
+	xor	esi,edx
+	ror	ecx,7
+	add	eax,ebx
+	pslld	xmm3,2
+	add	edi,DWORD [56+esp]
+	xor	esi,ecx
+	psrld	xmm5,30
+	mov	ebp,eax
+	rol	eax,5
+	add	edi,esi
+	xor	ebp,ecx
+	ror	ebx,7
+	add	edi,eax
+	por	xmm3,xmm5
+	add	edx,DWORD [60+esp]
+	xor	ebp,ebx
+	movdqa	xmm5,[96+esp]
+	mov	esi,edi
+	rol	edi,5
+	add	edx,ebp
+	xor	esi,ebx
+	ror	eax,7
+	pshufd	xmm6,xmm2,238
+	add	edx,edi
+	add	ecx,DWORD [esp]
+	pxor	xmm4,xmm0
+	punpcklqdq	xmm6,xmm3
+	xor	esi,eax
+	mov	ebp,edx
+	rol	edx,5
+	pxor	xmm4,xmm5
+	movdqa	[96+esp],xmm0
+	add	ecx,esi
+	xor	ebp,eax
+	movdqa	xmm0,xmm7
+	ror	edi,7
+	paddd	xmm7,xmm3
+	add	ecx,edx
+	pxor	xmm4,xmm6
+	add	ebx,DWORD [4+esp]
+	xor	ebp,edi
+	mov	esi,ecx
+	rol	ecx,5
+	movdqa	xmm6,xmm4
+	movdqa	[48+esp],xmm7
+	add	ebx,ebp
+	xor	esi,edi
+	ror	edx,7
+	add	ebx,ecx
+	pslld	xmm4,2
+	add	eax,DWORD [8+esp]
+	xor	esi,edx
+	psrld	xmm6,30
+	mov	ebp,ebx
+	rol	ebx,5
+	add	eax,esi
+	xor	ebp,edx
+	ror	ecx,7
+	add	eax,ebx
+	por	xmm4,xmm6
+	add	edi,DWORD [12+esp]
+	xor	ebp,ecx
+	movdqa	xmm6,[64+esp]
+	mov	esi,eax
+	rol	eax,5
+	add	edi,ebp
+	xor	esi,ecx
+	ror	ebx,7
+	pshufd	xmm7,xmm3,238
+	add	edi,eax
+	add	edx,DWORD [16+esp]
+	pxor	xmm5,xmm1
+	punpcklqdq	xmm7,xmm4
+	xor	esi,ebx
+	mov	ebp,edi
+	rol	edi,5
+	pxor	xmm5,xmm6
+	movdqa	[64+esp],xmm1
+	add	edx,esi
+	xor	ebp,ebx
+	movdqa	xmm1,xmm0
+	ror	eax,7
+	paddd	xmm0,xmm4
+	add	edx,edi
+	pxor	xmm5,xmm7
+	add	ecx,DWORD [20+esp]
+	xor	ebp,eax
+	mov	esi,edx
+	rol	edx,5
+	movdqa	xmm7,xmm5
+	movdqa	[esp],xmm0
+	add	ecx,ebp
+	xor	esi,eax
+	ror	edi,7
+	add	ecx,edx
+	pslld	xmm5,2
+	add	ebx,DWORD [24+esp]
+	xor	esi,edi
+	psrld	xmm7,30
+	mov	ebp,ecx
+	rol	ecx,5
+	add	ebx,esi
+	xor	ebp,edi
+	ror	edx,7
+	add	ebx,ecx
+	por	xmm5,xmm7
+	add	eax,DWORD [28+esp]
+	movdqa	xmm7,[80+esp]
+	ror	ecx,7
+	mov	esi,ebx
+	xor	ebp,edx
+	rol	ebx,5
+	pshufd	xmm0,xmm4,238
+	add	eax,ebp
+	xor	esi,ecx
+	xor	ecx,edx
+	add	eax,ebx
+	add	edi,DWORD [32+esp]
+	pxor	xmm6,xmm2
+	punpcklqdq	xmm0,xmm5
+	and	esi,ecx
+	xor	ecx,edx
+	ror	ebx,7
+	pxor	xmm6,xmm7
+	movdqa	[80+esp],xmm2
+	mov	ebp,eax
+	xor	esi,ecx
+	rol	eax,5
+	movdqa	xmm2,xmm1
+	add	edi,esi
+	paddd	xmm1,xmm5
+	xor	ebp,ebx
+	pxor	xmm6,xmm0
+	xor	ebx,ecx
+	add	edi,eax
+	add	edx,DWORD [36+esp]
+	and	ebp,ebx
+	movdqa	xmm0,xmm6
+	movdqa	[16+esp],xmm1
+	xor	ebx,ecx
+	ror	eax,7
+	mov	esi,edi
+	xor	ebp,ebx
+	rol	edi,5
+	pslld	xmm6,2
+	add	edx,ebp
+	xor	esi,eax
+	psrld	xmm0,30
+	xor	eax,ebx
+	add	edx,edi
+	add	ecx,DWORD [40+esp]
+	and	esi,eax
+	xor	eax,ebx
+	ror	edi,7
+	por	xmm6,xmm0
+	mov	ebp,edx
+	xor	esi,eax
+	movdqa	xmm0,[96+esp]
+	rol	edx,5
+	add	ecx,esi
+	xor	ebp,edi
+	xor	edi,eax
+	add	ecx,edx
+	pshufd	xmm1,xmm5,238
+	add	ebx,DWORD [44+esp]
+	and	ebp,edi
+	xor	edi,eax
+	ror	edx,7
+	mov	esi,ecx
+	xor	ebp,edi
+	rol	ecx,5
+	add	ebx,ebp
+	xor	esi,edx
+	xor	edx,edi
+	add	ebx,ecx
+	add	eax,DWORD [48+esp]
+	pxor	xmm7,xmm3
+	punpcklqdq	xmm1,xmm6
+	and	esi,edx
+	xor	edx,edi
+	ror	ecx,7
+	pxor	xmm7,xmm0
+	movdqa	[96+esp],xmm3
+	mov	ebp,ebx
+	xor	esi,edx
+	rol	ebx,5
+	movdqa	xmm3,[144+esp]
+	add	eax,esi
+	paddd	xmm2,xmm6
+	xor	ebp,ecx
+	pxor	xmm7,xmm1
+	xor	ecx,edx
+	add	eax,ebx
+	add	edi,DWORD [52+esp]
+	and	ebp,ecx
+	movdqa	xmm1,xmm7
+	movdqa	[32+esp],xmm2
+	xor	ecx,edx
+	ror	ebx,7
+	mov	esi,eax
+	xor	ebp,ecx
+	rol	eax,5
+	pslld	xmm7,2
+	add	edi,ebp
+	xor	esi,ebx
+	psrld	xmm1,30
+	xor	ebx,ecx
+	add	edi,eax
+	add	edx,DWORD [56+esp]
+	and	esi,ebx
+	xor	ebx,ecx
+	ror	eax,7
+	por	xmm7,xmm1
+	mov	ebp,edi
+	xor	esi,ebx
+	movdqa	xmm1,[64+esp]
+	rol	edi,5
+	add	edx,esi
+	xor	ebp,eax
+	xor	eax,ebx
+	add	edx,edi
+	pshufd	xmm2,xmm6,238
+	add	ecx,DWORD [60+esp]
+	and	ebp,eax
+	xor	eax,ebx
+	ror	edi,7
+	mov	esi,edx
+	xor	ebp,eax
+	rol	edx,5
+	add	ecx,ebp
+	xor	esi,edi
+	xor	edi,eax
+	add	ecx,edx
+	add	ebx,DWORD [esp]
+	pxor	xmm0,xmm4
+	punpcklqdq	xmm2,xmm7
+	and	esi,edi
+	xor	edi,eax
+	ror	edx,7
+	pxor	xmm0,xmm1
+	movdqa	[64+esp],xmm4
+	mov	ebp,ecx
+	xor	esi,edi
+	rol	ecx,5
+	movdqa	xmm4,xmm3
+	add	ebx,esi
+	paddd	xmm3,xmm7
+	xor	ebp,edx
+	pxor	xmm0,xmm2
+	xor	edx,edi
+	add	ebx,ecx
+	add	eax,DWORD [4+esp]
+	and	ebp,edx
+	movdqa	xmm2,xmm0
+	movdqa	[48+esp],xmm3
+	xor	edx,edi
+	ror	ecx,7
+	mov	esi,ebx
+	xor	ebp,edx
+	rol	ebx,5
+	pslld	xmm0,2
+	add	eax,ebp
+	xor	esi,ecx
+	psrld	xmm2,30
+	xor	ecx,edx
+	add	eax,ebx
+	add	edi,DWORD [8+esp]
+	and	esi,ecx
+	xor	ecx,edx
+	ror	ebx,7
+	por	xmm0,xmm2
+	mov	ebp,eax
+	xor	esi,ecx
+	movdqa	xmm2,[80+esp]
+	rol	eax,5
+	add	edi,esi
+	xor	ebp,ebx
+	xor	ebx,ecx
+	add	edi,eax
+	pshufd	xmm3,xmm7,238
+	add	edx,DWORD [12+esp]
+	and	ebp,ebx
+	xor	ebx,ecx
+	ror	eax,7
+	mov	esi,edi
+	xor	ebp,ebx
+	rol	edi,5
+	add	edx,ebp
+	xor	esi,eax
+	xor	eax,ebx
+	add	edx,edi
+	add	ecx,DWORD [16+esp]
+	pxor	xmm1,xmm5
+	punpcklqdq	xmm3,xmm0
+	and	esi,eax
+	xor	eax,ebx
+	ror	edi,7
+	pxor	xmm1,xmm2
+	movdqa	[80+esp],xmm5
+	mov	ebp,edx
+	xor	esi,eax
+	rol	edx,5
+	movdqa	xmm5,xmm4
+	add	ecx,esi
+	paddd	xmm4,xmm0
+	xor	ebp,edi
+	pxor	xmm1,xmm3
+	xor	edi,eax
+	add	ecx,edx
+	add	ebx,DWORD [20+esp]
+	and	ebp,edi
+	movdqa	xmm3,xmm1
+	movdqa	[esp],xmm4
+	xor	edi,eax
+	ror	edx,7
+	mov	esi,ecx
+	xor	ebp,edi
+	rol	ecx,5
+	pslld	xmm1,2
+	add	ebx,ebp
+	xor	esi,edx
+	psrld	xmm3,30
+	xor	edx,edi
+	add	ebx,ecx
+	add	eax,DWORD [24+esp]
+	and	esi,edx
+	xor	edx,edi
+	ror	ecx,7
+	por	xmm1,xmm3
+	mov	ebp,ebx
+	xor	esi,edx
+	movdqa	xmm3,[96+esp]
+	rol	ebx,5
+	add	eax,esi
+	xor	ebp,ecx
+	xor	ecx,edx
+	add	eax,ebx
+	pshufd	xmm4,xmm0,238
+	add	edi,DWORD [28+esp]
+	and	ebp,ecx
+	xor	ecx,edx
+	ror	ebx,7
+	mov	esi,eax
+	xor	ebp,ecx
+	rol	eax,5
+	add	edi,ebp
+	xor	esi,ebx
+	xor	ebx,ecx
+	add	edi,eax
+	add	edx,DWORD [32+esp]
+	pxor	xmm2,xmm6
+	punpcklqdq	xmm4,xmm1
+	and	esi,ebx
+	xor	ebx,ecx
+	ror	eax,7
+	pxor	xmm2,xmm3
+	movdqa	[96+esp],xmm6
+	mov	ebp,edi
+	xor	esi,ebx
+	rol	edi,5
+	movdqa	xmm6,xmm5
+	add	edx,esi
+	paddd	xmm5,xmm1
+	xor	ebp,eax
+	pxor	xmm2,xmm4
+	xor	eax,ebx
+	add	edx,edi
+	add	ecx,DWORD [36+esp]
+	and	ebp,eax
+	movdqa	xmm4,xmm2
+	movdqa	[16+esp],xmm5
+	xor	eax,ebx
+	ror	edi,7
+	mov	esi,edx
+	xor	ebp,eax
+	rol	edx,5
+	pslld	xmm2,2
+	add	ecx,ebp
+	xor	esi,edi
+	psrld	xmm4,30
+	xor	edi,eax
+	add	ecx,edx
+	add	ebx,DWORD [40+esp]
+	and	esi,edi
+	xor	edi,eax
+	ror	edx,7
+	por	xmm2,xmm4
+	mov	ebp,ecx
+	xor	esi,edi
+	movdqa	xmm4,[64+esp]
+	rol	ecx,5
+	add	ebx,esi
+	xor	ebp,edx
+	xor	edx,edi
+	add	ebx,ecx
+	pshufd	xmm5,xmm1,238
+	add	eax,DWORD [44+esp]
+	and	ebp,edx
+	xor	edx,edi
+	ror	ecx,7
+	mov	esi,ebx
+	xor	ebp,edx
+	rol	ebx,5
+	add	eax,ebp
+	xor	esi,edx
+	add	eax,ebx
+	add	edi,DWORD [48+esp]
+	pxor	xmm3,xmm7
+	punpcklqdq	xmm5,xmm2
+	xor	esi,ecx
+	mov	ebp,eax
+	rol	eax,5
+	pxor	xmm3,xmm4
+	movdqa	[64+esp],xmm7
+	add	edi,esi
+	xor	ebp,ecx
+	movdqa	xmm7,xmm6
+	ror	ebx,7
+	paddd	xmm6,xmm2
+	add	edi,eax
+	pxor	xmm3,xmm5
+	add	edx,DWORD [52+esp]
+	xor	ebp,ebx
+	mov	esi,edi
+	rol	edi,5
+	movdqa	xmm5,xmm3
+	movdqa	[32+esp],xmm6
+	add	edx,ebp
+	xor	esi,ebx
+	ror	eax,7
+	add	edx,edi
+	pslld	xmm3,2
+	add	ecx,DWORD [56+esp]
+	xor	esi,eax
+	psrld	xmm5,30
+	mov	ebp,edx
+	rol	edx,5
+	add	ecx,esi
+	xor	ebp,eax
+	ror	edi,7
+	add	ecx,edx
+	por	xmm3,xmm5
+	add	ebx,DWORD [60+esp]
+	xor	ebp,edi
+	mov	esi,ecx
+	rol	ecx,5
+	add	ebx,ebp
+	xor	esi,edi
+	ror	edx,7
+	add	ebx,ecx
+	add	eax,DWORD [esp]
+	xor	esi,edx
+	mov	ebp,ebx
+	rol	ebx,5
+	add	eax,esi
+	xor	ebp,edx
+	ror	ecx,7
+	paddd	xmm7,xmm3
+	add	eax,ebx
+	add	edi,DWORD [4+esp]
+	xor	ebp,ecx
+	mov	esi,eax
+	movdqa	[48+esp],xmm7
+	rol	eax,5
+	add	edi,ebp
+	xor	esi,ecx
+	ror	ebx,7
+	add	edi,eax
+	add	edx,DWORD [8+esp]
+	xor	esi,ebx
+	mov	ebp,edi
+	rol	edi,5
+	add	edx,esi
+	xor	ebp,ebx
+	ror	eax,7
+	add	edx,edi
+	add	ecx,DWORD [12+esp]
+	xor	ebp,eax
+	mov	esi,edx
+	rol	edx,5
+	add	ecx,ebp
+	xor	esi,eax
+	ror	edi,7
+	add	ecx,edx
+	mov	ebp,DWORD [196+esp]
+	cmp	ebp,DWORD [200+esp]
+	je	NEAR L$007done
+	movdqa	xmm7,[160+esp]
+	movdqa	xmm6,[176+esp]
+	movdqu	xmm0,[ebp]
+	movdqu	xmm1,[16+ebp]
+	movdqu	xmm2,[32+ebp]
+	movdqu	xmm3,[48+ebp]
+	add	ebp,64
+db	102,15,56,0,198
+	mov	DWORD [196+esp],ebp
+	movdqa	[96+esp],xmm7
+	add	ebx,DWORD [16+esp]
+	xor	esi,edi
+	mov	ebp,ecx
+	rol	ecx,5
+	add	ebx,esi
+	xor	ebp,edi
+	ror	edx,7
+db	102,15,56,0,206
+	add	ebx,ecx
+	add	eax,DWORD [20+esp]
+	xor	ebp,edx
+	mov	esi,ebx
+	paddd	xmm0,xmm7
+	rol	ebx,5
+	add	eax,ebp
+	xor	esi,edx
+	ror	ecx,7
+	movdqa	[esp],xmm0
+	add	eax,ebx
+	add	edi,DWORD [24+esp]
+	xor	esi,ecx
+	mov	ebp,eax
+	psubd	xmm0,xmm7
+	rol	eax,5
+	add	edi,esi
+	xor	ebp,ecx
+	ror	ebx,7
+	add	edi,eax
+	add	edx,DWORD [28+esp]
+	xor	ebp,ebx
+	mov	esi,edi
+	rol	edi,5
+	add	edx,ebp
+	xor	esi,ebx
+	ror	eax,7
+	add	edx,edi
+	add	ecx,DWORD [32+esp]
+	xor	esi,eax
+	mov	ebp,edx
+	rol	edx,5
+	add	ecx,esi
+	xor	ebp,eax
+	ror	edi,7
+db	102,15,56,0,214
+	add	ecx,edx
+	add	ebx,DWORD [36+esp]
+	xor	ebp,edi
+	mov	esi,ecx
+	paddd	xmm1,xmm7
+	rol	ecx,5
+	add	ebx,ebp
+	xor	esi,edi
+	ror	edx,7
+	movdqa	[16+esp],xmm1
+	add	ebx,ecx
+	add	eax,DWORD [40+esp]
+	xor	esi,edx
+	mov	ebp,ebx
+	psubd	xmm1,xmm7
+	rol	ebx,5
+	add	eax,esi
+	xor	ebp,edx
+	ror	ecx,7
+	add	eax,ebx
+	add	edi,DWORD [44+esp]
+	xor	ebp,ecx
+	mov	esi,eax
+	rol	eax,5
+	add	edi,ebp
+	xor	esi,ecx
+	ror	ebx,7
+	add	edi,eax
+	add	edx,DWORD [48+esp]
+	xor	esi,ebx
+	mov	ebp,edi
+	rol	edi,5
+	add	edx,esi
+	xor	ebp,ebx
+	ror	eax,7
+db	102,15,56,0,222
+	add	edx,edi
+	add	ecx,DWORD [52+esp]
+	xor	ebp,eax
+	mov	esi,edx
+	paddd	xmm2,xmm7
+	rol	edx,5
+	add	ecx,ebp
+	xor	esi,eax
+	ror	edi,7
+	movdqa	[32+esp],xmm2
+	add	ecx,edx
+	add	ebx,DWORD [56+esp]
+	xor	esi,edi
+	mov	ebp,ecx
+	psubd	xmm2,xmm7
+	rol	ecx,5
+	add	ebx,esi
+	xor	ebp,edi
+	ror	edx,7
+	add	ebx,ecx
+	add	eax,DWORD [60+esp]
+	xor	ebp,edx
+	mov	esi,ebx
+	rol	ebx,5
+	add	eax,ebp
+	ror	ecx,7
+	add	eax,ebx
+	mov	ebp,DWORD [192+esp]
+	add	eax,DWORD [ebp]
+	add	esi,DWORD [4+ebp]
+	add	ecx,DWORD [8+ebp]
+	mov	DWORD [ebp],eax
+	add	edx,DWORD [12+ebp]
+	mov	DWORD [4+ebp],esi
+	add	edi,DWORD [16+ebp]
+	mov	DWORD [8+ebp],ecx
+	mov	ebx,ecx
+	mov	DWORD [12+ebp],edx
+	xor	ebx,edx
+	mov	DWORD [16+ebp],edi
+	mov	ebp,esi
+	pshufd	xmm4,xmm0,238
+	and	esi,ebx
+	mov	ebx,ebp
+	jmp	NEAR L$006loop
+align	16
+L$007done:
+	add	ebx,DWORD [16+esp]
+	xor	esi,edi
+	mov	ebp,ecx
+	rol	ecx,5
+	add	ebx,esi
+	xor	ebp,edi
+	ror	edx,7
+	add	ebx,ecx
+	add	eax,DWORD [20+esp]
+	xor	ebp,edx
+	mov	esi,ebx
+	rol	ebx,5
+	add	eax,ebp
+	xor	esi,edx
+	ror	ecx,7
+	add	eax,ebx
+	add	edi,DWORD [24+esp]
+	xor	esi,ecx
+	mov	ebp,eax
+	rol	eax,5
+	add	edi,esi
+	xor	ebp,ecx
+	ror	ebx,7
+	add	edi,eax
+	add	edx,DWORD [28+esp]
+	xor	ebp,ebx
+	mov	esi,edi
+	rol	edi,5
+	add	edx,ebp
+	xor	esi,ebx
+	ror	eax,7
+	add	edx,edi
+	add	ecx,DWORD [32+esp]
+	xor	esi,eax
+	mov	ebp,edx
+	rol	edx,5
+	add	ecx,esi
+	xor	ebp,eax
+	ror	edi,7
+	add	ecx,edx
+	add	ebx,DWORD [36+esp]
+	xor	ebp,edi
+	mov	esi,ecx
+	rol	ecx,5
+	add	ebx,ebp
+	xor	esi,edi
+	ror	edx,7
+	add	ebx,ecx
+	add	eax,DWORD [40+esp]
+	xor	esi,edx
+	mov	ebp,ebx
+	rol	ebx,5
+	add	eax,esi
+	xor	ebp,edx
+	ror	ecx,7
+	add	eax,ebx
+	add	edi,DWORD [44+esp]
+	xor	ebp,ecx
+	mov	esi,eax
+	rol	eax,5
+	add	edi,ebp
+	xor	esi,ecx
+	ror	ebx,7
+	add	edi,eax
+	add	edx,DWORD [48+esp]
+	xor	esi,ebx
+	mov	ebp,edi
+	rol	edi,5
+	add	edx,esi
+	xor	ebp,ebx
+	ror	eax,7
+	add	edx,edi
+	add	ecx,DWORD [52+esp]
+	xor	ebp,eax
+	mov	esi,edx
+	rol	edx,5
+	add	ecx,ebp
+	xor	esi,eax
+	ror	edi,7
+	add	ecx,edx
+	add	ebx,DWORD [56+esp]
+	xor	esi,edi
+	mov	ebp,ecx
+	rol	ecx,5
+	add	ebx,esi
+	xor	ebp,edi
+	ror	edx,7
+	add	ebx,ecx
+	add	eax,DWORD [60+esp]
+	xor	ebp,edx
+	mov	esi,ebx
+	rol	ebx,5
+	add	eax,ebp
+	ror	ecx,7
+	add	eax,ebx
+	mov	ebp,DWORD [192+esp]
+	add	eax,DWORD [ebp]
+	mov	esp,DWORD [204+esp]
+	add	esi,DWORD [4+ebp]
+	add	ecx,DWORD [8+ebp]
+	mov	DWORD [ebp],eax
+	add	edx,DWORD [12+ebp]
+	mov	DWORD [4+ebp],esi
+	add	edi,DWORD [16+ebp]
+	mov	DWORD [8+ebp],ecx
+	mov	DWORD [12+ebp],edx
+	mov	DWORD [16+ebp],edi
+	pop	edi
+	pop	esi
+	pop	ebx
+	pop	ebp
+	ret
+align	64
+L$K_XX_XX:
+dd	1518500249,1518500249,1518500249,1518500249
+dd	1859775393,1859775393,1859775393,1859775393
+dd	2400959708,2400959708,2400959708,2400959708
+dd	3395469782,3395469782,3395469782,3395469782
+dd	66051,67438087,134810123,202182159
+db	15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0
+db	83,72,65,49,32,98,108,111,99,107,32,116,114,97,110,115
+db	102,111,114,109,32,102,111,114,32,120,56,54,44,32,67,82
+db	89,80,84,79,71,65,77,83,32,98,121,32,60,97,112,112
+db	114,111,64,111,112,101,110,115,115,108,46,111,114,103,62,0
+segment	.bss
+common	_OPENSSL_ia32cap_P 16
diff --git a/third_party/boringssl/win-x86/crypto/sha/sha256-586.asm b/third_party/boringssl/win-x86/crypto/sha/sha256-586.asm
new file mode 100644
index 0000000..fe36bc5
--- /dev/null
+++ b/third_party/boringssl/win-x86/crypto/sha/sha256-586.asm
@@ -0,0 +1,4591 @@
+%ifidn __OUTPUT_FORMAT__,obj
+section	code	use32 class=code align=64
+%elifidn __OUTPUT_FORMAT__,win32
+%ifdef __YASM_VERSION_ID__
+%if __YASM_VERSION_ID__ < 01010000h
+%error yasm version 1.1.0 or later needed.
+%endif
+; Yasm automatically includes .00 and complains about redefining it.
+; https://www.tortall.net/projects/yasm/manual/html/objfmt-win32-safeseh.html
+%else
+$@feat.00 equ 1
+%endif
+section	.text	code align=64
+%else
+section	.text	code
+%endif
+;extern	_OPENSSL_ia32cap_P
+global	_sha256_block_data_order
+align	16
+_sha256_block_data_order:
+L$_sha256_block_data_order_begin:
+	push	ebp
+	push	ebx
+	push	esi
+	push	edi
+	mov	esi,DWORD [20+esp]
+	mov	edi,DWORD [24+esp]
+	mov	eax,DWORD [28+esp]
+	mov	ebx,esp
+	call	L$000pic_point
+L$000pic_point:
+	pop	ebp
+	lea	ebp,[(L$001K256-L$000pic_point)+ebp]
+	sub	esp,16
+	and	esp,-64
+	shl	eax,6
+	add	eax,edi
+	mov	DWORD [esp],esi
+	mov	DWORD [4+esp],edi
+	mov	DWORD [8+esp],eax
+	mov	DWORD [12+esp],ebx
+	lea	edx,[_OPENSSL_ia32cap_P]
+	mov	ecx,DWORD [edx]
+	mov	ebx,DWORD [4+edx]
+	test	ecx,1048576
+	jnz	NEAR L$002loop
+	mov	edx,DWORD [8+edx]
+	test	ecx,16777216
+	jz	NEAR L$003no_xmm
+	and	ecx,1073741824
+	and	ebx,268435968
+	test	edx,536870912
+	jnz	NEAR L$004shaext
+	or	ecx,ebx
+	and	ecx,1342177280
+	cmp	ecx,1342177280
+	test	ebx,512
+	jnz	NEAR L$005SSSE3
+L$003no_xmm:
+	sub	eax,edi
+	cmp	eax,256
+	jae	NEAR L$006unrolled
+	jmp	NEAR L$002loop
+align	16
+L$002loop:
+	mov	eax,DWORD [edi]
+	mov	ebx,DWORD [4+edi]
+	mov	ecx,DWORD [8+edi]
+	bswap	eax
+	mov	edx,DWORD [12+edi]
+	bswap	ebx
+	push	eax
+	bswap	ecx
+	push	ebx
+	bswap	edx
+	push	ecx
+	push	edx
+	mov	eax,DWORD [16+edi]
+	mov	ebx,DWORD [20+edi]
+	mov	ecx,DWORD [24+edi]
+	bswap	eax
+	mov	edx,DWORD [28+edi]
+	bswap	ebx
+	push	eax
+	bswap	ecx
+	push	ebx
+	bswap	edx
+	push	ecx
+	push	edx
+	mov	eax,DWORD [32+edi]
+	mov	ebx,DWORD [36+edi]
+	mov	ecx,DWORD [40+edi]
+	bswap	eax
+	mov	edx,DWORD [44+edi]
+	bswap	ebx
+	push	eax
+	bswap	ecx
+	push	ebx
+	bswap	edx
+	push	ecx
+	push	edx
+	mov	eax,DWORD [48+edi]
+	mov	ebx,DWORD [52+edi]
+	mov	ecx,DWORD [56+edi]
+	bswap	eax
+	mov	edx,DWORD [60+edi]
+	bswap	ebx
+	push	eax
+	bswap	ecx
+	push	ebx
+	bswap	edx
+	push	ecx
+	push	edx
+	add	edi,64
+	lea	esp,[esp-36]
+	mov	DWORD [104+esp],edi
+	mov	eax,DWORD [esi]
+	mov	ebx,DWORD [4+esi]
+	mov	ecx,DWORD [8+esi]
+	mov	edi,DWORD [12+esi]
+	mov	DWORD [8+esp],ebx
+	xor	ebx,ecx
+	mov	DWORD [12+esp],ecx
+	mov	DWORD [16+esp],edi
+	mov	DWORD [esp],ebx
+	mov	edx,DWORD [16+esi]
+	mov	ebx,DWORD [20+esi]
+	mov	ecx,DWORD [24+esi]
+	mov	edi,DWORD [28+esi]
+	mov	DWORD [24+esp],ebx
+	mov	DWORD [28+esp],ecx
+	mov	DWORD [32+esp],edi
+align	16
+L$00700_15:
+	mov	ecx,edx
+	mov	esi,DWORD [24+esp]
+	ror	ecx,14
+	mov	edi,DWORD [28+esp]
+	xor	ecx,edx
+	xor	esi,edi
+	mov	ebx,DWORD [96+esp]
+	ror	ecx,5
+	and	esi,edx
+	mov	DWORD [20+esp],edx
+	xor	edx,ecx
+	add	ebx,DWORD [32+esp]
+	xor	esi,edi
+	ror	edx,6
+	mov	ecx,eax
+	add	ebx,esi
+	ror	ecx,9
+	add	ebx,edx
+	mov	edi,DWORD [8+esp]
+	xor	ecx,eax
+	mov	DWORD [4+esp],eax
+	lea	esp,[esp-4]
+	ror	ecx,11
+	mov	esi,DWORD [ebp]
+	xor	ecx,eax
+	mov	edx,DWORD [20+esp]
+	xor	eax,edi
+	ror	ecx,2
+	add	ebx,esi
+	mov	DWORD [esp],eax
+	add	edx,ebx
+	and	eax,DWORD [4+esp]
+	add	ebx,ecx
+	xor	eax,edi
+	add	ebp,4
+	add	eax,ebx
+	cmp	esi,3248222580
+	jne	NEAR L$00700_15
+	mov	ecx,DWORD [156+esp]
+	jmp	NEAR L$00816_63
+align	16
+L$00816_63:
+	mov	ebx,ecx
+	mov	esi,DWORD [104+esp]
+	ror	ecx,11
+	mov	edi,esi
+	ror	esi,2
+	xor	ecx,ebx
+	shr	ebx,3
+	ror	ecx,7
+	xor	esi,edi
+	xor	ebx,ecx
+	ror	esi,17
+	add	ebx,DWORD [160+esp]
+	shr	edi,10
+	add	ebx,DWORD [124+esp]
+	mov	ecx,edx
+	xor	edi,esi
+	mov	esi,DWORD [24+esp]
+	ror	ecx,14
+	add	ebx,edi
+	mov	edi,DWORD [28+esp]
+	xor	ecx,edx
+	xor	esi,edi
+	mov	DWORD [96+esp],ebx
+	ror	ecx,5
+	and	esi,edx
+	mov	DWORD [20+esp],edx
+	xor	edx,ecx
+	add	ebx,DWORD [32+esp]
+	xor	esi,edi
+	ror	edx,6
+	mov	ecx,eax
+	add	ebx,esi
+	ror	ecx,9
+	add	ebx,edx
+	mov	edi,DWORD [8+esp]
+	xor	ecx,eax
+	mov	DWORD [4+esp],eax
+	lea	esp,[esp-4]
+	ror	ecx,11
+	mov	esi,DWORD [ebp]
+	xor	ecx,eax
+	mov	edx,DWORD [20+esp]
+	xor	eax,edi
+	ror	ecx,2
+	add	ebx,esi
+	mov	DWORD [esp],eax
+	add	edx,ebx
+	and	eax,DWORD [4+esp]
+	add	ebx,ecx
+	xor	eax,edi
+	mov	ecx,DWORD [156+esp]
+	add	ebp,4
+	add	eax,ebx
+	cmp	esi,3329325298
+	jne	NEAR L$00816_63
+	mov	esi,DWORD [356+esp]
+	mov	ebx,DWORD [8+esp]
+	mov	ecx,DWORD [16+esp]
+	add	eax,DWORD [esi]
+	add	ebx,DWORD [4+esi]
+	add	edi,DWORD [8+esi]
+	add	ecx,DWORD [12+esi]
+	mov	DWORD [esi],eax
+	mov	DWORD [4+esi],ebx
+	mov	DWORD [8+esi],edi
+	mov	DWORD [12+esi],ecx
+	mov	eax,DWORD [24+esp]
+	mov	ebx,DWORD [28+esp]
+	mov	ecx,DWORD [32+esp]
+	mov	edi,DWORD [360+esp]
+	add	edx,DWORD [16+esi]
+	add	eax,DWORD [20+esi]
+	add	ebx,DWORD [24+esi]
+	add	ecx,DWORD [28+esi]
+	mov	DWORD [16+esi],edx
+	mov	DWORD [20+esi],eax
+	mov	DWORD [24+esi],ebx
+	mov	DWORD [28+esi],ecx
+	lea	esp,[356+esp]
+	sub	ebp,256
+	cmp	edi,DWORD [8+esp]
+	jb	NEAR L$002loop
+	mov	esp,DWORD [12+esp]
+	pop	edi
+	pop	esi
+	pop	ebx
+	pop	ebp
+	ret
+align	64
+L$001K256:
+dd	1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298
+dd	66051,67438087,134810123,202182159
+db	83,72,65,50,53,54,32,98,108,111,99,107,32,116,114,97
+db	110,115,102,111,114,109,32,102,111,114,32,120,56,54,44,32
+db	67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97
+db	112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103
+db	62,0
+align	16
+L$006unrolled:
+	lea	esp,[esp-96]
+	mov	eax,DWORD [esi]
+	mov	ebp,DWORD [4+esi]
+	mov	ecx,DWORD [8+esi]
+	mov	ebx,DWORD [12+esi]
+	mov	DWORD [4+esp],ebp
+	xor	ebp,ecx
+	mov	DWORD [8+esp],ecx
+	mov	DWORD [12+esp],ebx
+	mov	edx,DWORD [16+esi]
+	mov	ebx,DWORD [20+esi]
+	mov	ecx,DWORD [24+esi]
+	mov	esi,DWORD [28+esi]
+	mov	DWORD [20+esp],ebx
+	mov	DWORD [24+esp],ecx
+	mov	DWORD [28+esp],esi
+	jmp	NEAR L$009grand_loop
+align	16
+L$009grand_loop:
+	mov	ebx,DWORD [edi]
+	mov	ecx,DWORD [4+edi]
+	bswap	ebx
+	mov	esi,DWORD [8+edi]
+	bswap	ecx
+	mov	DWORD [32+esp],ebx
+	bswap	esi
+	mov	DWORD [36+esp],ecx
+	mov	DWORD [40+esp],esi
+	mov	ebx,DWORD [12+edi]
+	mov	ecx,DWORD [16+edi]
+	bswap	ebx
+	mov	esi,DWORD [20+edi]
+	bswap	ecx
+	mov	DWORD [44+esp],ebx
+	bswap	esi
+	mov	DWORD [48+esp],ecx
+	mov	DWORD [52+esp],esi
+	mov	ebx,DWORD [24+edi]
+	mov	ecx,DWORD [28+edi]
+	bswap	ebx
+	mov	esi,DWORD [32+edi]
+	bswap	ecx
+	mov	DWORD [56+esp],ebx
+	bswap	esi
+	mov	DWORD [60+esp],ecx
+	mov	DWORD [64+esp],esi
+	mov	ebx,DWORD [36+edi]
+	mov	ecx,DWORD [40+edi]
+	bswap	ebx
+	mov	esi,DWORD [44+edi]
+	bswap	ecx
+	mov	DWORD [68+esp],ebx
+	bswap	esi
+	mov	DWORD [72+esp],ecx
+	mov	DWORD [76+esp],esi
+	mov	ebx,DWORD [48+edi]
+	mov	ecx,DWORD [52+edi]
+	bswap	ebx
+	mov	esi,DWORD [56+edi]
+	bswap	ecx
+	mov	DWORD [80+esp],ebx
+	bswap	esi
+	mov	DWORD [84+esp],ecx
+	mov	DWORD [88+esp],esi
+	mov	ebx,DWORD [60+edi]
+	add	edi,64
+	bswap	ebx
+	mov	DWORD [100+esp],edi
+	mov	DWORD [92+esp],ebx
+	mov	ecx,edx
+	mov	esi,DWORD [20+esp]
+	ror	edx,14
+	mov	edi,DWORD [24+esp]
+	xor	edx,ecx
+	mov	ebx,DWORD [32+esp]
+	xor	esi,edi
+	ror	edx,5
+	and	esi,ecx
+	mov	DWORD [16+esp],ecx
+	xor	edx,ecx
+	add	ebx,DWORD [28+esp]
+	xor	edi,esi
+	ror	edx,6
+	mov	ecx,eax
+	add	ebx,edi
+	ror	ecx,9
+	mov	esi,eax
+	mov	edi,DWORD [4+esp]
+	xor	ecx,eax
+	mov	DWORD [esp],eax
+	xor	eax,edi
+	ror	ecx,11
+	and	ebp,eax
+	lea	edx,[1116352408+edx*1+ebx]
+	xor	ecx,esi
+	xor	ebp,edi
+	ror	ecx,2
+	add	ebp,edx
+	add	edx,DWORD [12+esp]
+	add	ebp,ecx
+	mov	esi,edx
+	mov	ecx,DWORD [16+esp]
+	ror	edx,14
+	mov	edi,DWORD [20+esp]
+	xor	edx,esi
+	mov	ebx,DWORD [36+esp]
+	xor	ecx,edi
+	ror	edx,5
+	and	ecx,esi
+	mov	DWORD [12+esp],esi
+	xor	edx,esi
+	add	ebx,DWORD [24+esp]
+	xor	edi,ecx
+	ror	edx,6
+	mov	esi,ebp
+	add	ebx,edi
+	ror	esi,9
+	mov	ecx,ebp
+	mov	edi,DWORD [esp]
+	xor	esi,ebp
+	mov	DWORD [28+esp],ebp
+	xor	ebp,edi
+	ror	esi,11
+	and	eax,ebp
+	lea	edx,[1899447441+edx*1+ebx]
+	xor	esi,ecx
+	xor	eax,edi
+	ror	esi,2
+	add	eax,edx
+	add	edx,DWORD [8+esp]
+	add	eax,esi
+	mov	ecx,edx
+	mov	esi,DWORD [12+esp]
+	ror	edx,14
+	mov	edi,DWORD [16+esp]
+	xor	edx,ecx
+	mov	ebx,DWORD [40+esp]
+	xor	esi,edi
+	ror	edx,5
+	and	esi,ecx
+	mov	DWORD [8+esp],ecx
+	xor	edx,ecx
+	add	ebx,DWORD [20+esp]
+	xor	edi,esi
+	ror	edx,6
+	mov	ecx,eax
+	add	ebx,edi
+	ror	ecx,9
+	mov	esi,eax
+	mov	edi,DWORD [28+esp]
+	xor	ecx,eax
+	mov	DWORD [24+esp],eax
+	xor	eax,edi
+	ror	ecx,11
+	and	ebp,eax
+	lea	edx,[3049323471+edx*1+ebx]
+	xor	ecx,esi
+	xor	ebp,edi
+	ror	ecx,2
+	add	ebp,edx
+	add	edx,DWORD [4+esp]
+	add	ebp,ecx
+	mov	esi,edx
+	mov	ecx,DWORD [8+esp]
+	ror	edx,14
+	mov	edi,DWORD [12+esp]
+	xor	edx,esi
+	mov	ebx,DWORD [44+esp]
+	xor	ecx,edi
+	ror	edx,5
+	and	ecx,esi
+	mov	DWORD [4+esp],esi
+	xor	edx,esi
+	add	ebx,DWORD [16+esp]
+	xor	edi,ecx
+	ror	edx,6
+	mov	esi,ebp
+	add	ebx,edi
+	ror	esi,9
+	mov	ecx,ebp
+	mov	edi,DWORD [24+esp]
+	xor	esi,ebp
+	mov	DWORD [20+esp],ebp
+	xor	ebp,edi
+	ror	esi,11
+	and	eax,ebp
+	lea	edx,[3921009573+edx*1+ebx]
+	xor	esi,ecx
+	xor	eax,edi
+	ror	esi,2
+	add	eax,edx
+	add	edx,DWORD [esp]
+	add	eax,esi
+	mov	ecx,edx
+	mov	esi,DWORD [4+esp]
+	ror	edx,14
+	mov	edi,DWORD [8+esp]
+	xor	edx,ecx
+	mov	ebx,DWORD [48+esp]
+	xor	esi,edi
+	ror	edx,5
+	and	esi,ecx
+	mov	DWORD [esp],ecx
+	xor	edx,ecx
+	add	ebx,DWORD [12+esp]
+	xor	edi,esi
+	ror	edx,6
+	mov	ecx,eax
+	add	ebx,edi
+	ror	ecx,9
+	mov	esi,eax
+	mov	edi,DWORD [20+esp]
+	xor	ecx,eax
+	mov	DWORD [16+esp],eax
+	xor	eax,edi
+	ror	ecx,11
+	and	ebp,eax
+	lea	edx,[961987163+edx*1+ebx]
+	xor	ecx,esi
+	xor	ebp,edi
+	ror	ecx,2
+	add	ebp,edx
+	add	edx,DWORD [28+esp]
+	add	ebp,ecx
+	mov	esi,edx
+	mov	ecx,DWORD [esp]
+	ror	edx,14
+	mov	edi,DWORD [4+esp]
+	xor	edx,esi
+	mov	ebx,DWORD [52+esp]
+	xor	ecx,edi
+	ror	edx,5
+	and	ecx,esi
+	mov	DWORD [28+esp],esi
+	xor	edx,esi
+	add	ebx,DWORD [8+esp]
+	xor	edi,ecx
+	ror	edx,6
+	mov	esi,ebp
+	add	ebx,edi
+	ror	esi,9
+	mov	ecx,ebp
+	mov	edi,DWORD [16+esp]
+	xor	esi,ebp
+	mov	DWORD [12+esp],ebp
+	xor	ebp,edi
+	ror	esi,11
+	and	eax,ebp
+	lea	edx,[1508970993+edx*1+ebx]
+	xor	esi,ecx
+	xor	eax,edi
+	ror	esi,2
+	add	eax,edx
+	add	edx,DWORD [24+esp]
+	add	eax,esi
+	mov	ecx,edx
+	mov	esi,DWORD [28+esp]
+	ror	edx,14
+	mov	edi,DWORD [esp]
+	xor	edx,ecx
+	mov	ebx,DWORD [56+esp]
+	xor	esi,edi
+	ror	edx,5
+	and	esi,ecx
+	mov	DWORD [24+esp],ecx
+	xor	edx,ecx
+	add	ebx,DWORD [4+esp]
+	xor	edi,esi
+	ror	edx,6
+	mov	ecx,eax
+	add	ebx,edi
+	ror	ecx,9
+	mov	esi,eax
+	mov	edi,DWORD [12+esp]
+	xor	ecx,eax
+	mov	DWORD [8+esp],eax
+	xor	eax,edi
+	ror	ecx,11
+	and	ebp,eax
+	lea	edx,[2453635748+edx*1+ebx]
+	xor	ecx,esi
+	xor	ebp,edi
+	ror	ecx,2
+	add	ebp,edx
+	add	edx,DWORD [20+esp]
+	add	ebp,ecx
+	mov	esi,edx
+	mov	ecx,DWORD [24+esp]
+	ror	edx,14
+	mov	edi,DWORD [28+esp]
+	xor	edx,esi
+	mov	ebx,DWORD [60+esp]
+	xor	ecx,edi
+	ror	edx,5
+	and	ecx,esi
+	mov	DWORD [20+esp],esi
+	xor	edx,esi
+	add	ebx,DWORD [esp]
+	xor	edi,ecx
+	ror	edx,6
+	mov	esi,ebp
+	add	ebx,edi
+	ror	esi,9
+	mov	ecx,ebp
+	mov	edi,DWORD [8+esp]
+	xor	esi,ebp
+	mov	DWORD [4+esp],ebp
+	xor	ebp,edi
+	ror	esi,11
+	and	eax,ebp
+	lea	edx,[2870763221+edx*1+ebx]
+	xor	esi,ecx
+	xor	eax,edi
+	ror	esi,2
+	add	eax,edx
+	add	edx,DWORD [16+esp]
+	add	eax,esi
+	mov	ecx,edx
+	mov	esi,DWORD [20+esp]
+	ror	edx,14
+	mov	edi,DWORD [24+esp]
+	xor	edx,ecx
+	mov	ebx,DWORD [64+esp]
+	xor	esi,edi
+	ror	edx,5
+	and	esi,ecx
+	mov	DWORD [16+esp],ecx
+	xor	edx,ecx
+	add	ebx,DWORD [28+esp]
+	xor	edi,esi
+	ror	edx,6
+	mov	ecx,eax
+	add	ebx,edi
+	ror	ecx,9
+	mov	esi,eax
+	mov	edi,DWORD [4+esp]
+	xor	ecx,eax
+	mov	DWORD [esp],eax
+	xor	eax,edi
+	ror	ecx,11
+	and	ebp,eax
+	lea	edx,[3624381080+edx*1+ebx]
+	xor	ecx,esi
+	xor	ebp,edi
+	ror	ecx,2
+	add	ebp,edx
+	add	edx,DWORD [12+esp]
+	add	ebp,ecx
+	mov	esi,edx
+	mov	ecx,DWORD [16+esp]
+	ror	edx,14
+	mov	edi,DWORD [20+esp]
+	xor	edx,esi
+	mov	ebx,DWORD [68+esp]
+	xor	ecx,edi
+	ror	edx,5
+	and	ecx,esi
+	mov	DWORD [12+esp],esi
+	xor	edx,esi
+	add	ebx,DWORD [24+esp]
+	xor	edi,ecx
+	ror	edx,6
+	mov	esi,ebp
+	add	ebx,edi
+	ror	esi,9
+	mov	ecx,ebp
+	mov	edi,DWORD [esp]
+	xor	esi,ebp
+	mov	DWORD [28+esp],ebp
+	xor	ebp,edi
+	ror	esi,11
+	and	eax,ebp
+	lea	edx,[310598401+edx*1+ebx]
+	xor	esi,ecx
+	xor	eax,edi
+	ror	esi,2
+	add	eax,edx
+	add	edx,DWORD [8+esp]
+	add	eax,esi
+	mov	ecx,edx
+	mov	esi,DWORD [12+esp]
+	ror	edx,14
+	mov	edi,DWORD [16+esp]
+	xor	edx,ecx
+	mov	ebx,DWORD [72+esp]
+	xor	esi,edi
+	ror	edx,5
+	and	esi,ecx
+	mov	DWORD [8+esp],ecx
+	xor	edx,ecx
+	add	ebx,DWORD [20+esp]
+	xor	edi,esi
+	ror	edx,6
+	mov	ecx,eax
+	add	ebx,edi
+	ror	ecx,9
+	mov	esi,eax
+	mov	edi,DWORD [28+esp]
+	xor	ecx,eax
+	mov	DWORD [24+esp],eax
+	xor	eax,edi
+	ror	ecx,11
+	and	ebp,eax
+	lea	edx,[607225278+edx*1+ebx]
+	xor	ecx,esi
+	xor	ebp,edi
+	ror	ecx,2
+	add	ebp,edx
+	add	edx,DWORD [4+esp]
+	add	ebp,ecx
+	mov	esi,edx
+	mov	ecx,DWORD [8+esp]
+	ror	edx,14
+	mov	edi,DWORD [12+esp]
+	xor	edx,esi
+	mov	ebx,DWORD [76+esp]
+	xor	ecx,edi
+	ror	edx,5
+	and	ecx,esi
+	mov	DWORD [4+esp],esi
+	xor	edx,esi
+	add	ebx,DWORD [16+esp]
+	xor	edi,ecx
+	ror	edx,6
+	mov	esi,ebp
+	add	ebx,edi
+	ror	esi,9
+	mov	ecx,ebp
+	mov	edi,DWORD [24+esp]
+	xor	esi,ebp
+	mov	DWORD [20+esp],ebp
+	xor	ebp,edi
+	ror	esi,11
+	and	eax,ebp
+	lea	edx,[1426881987+edx*1+ebx]
+	xor	esi,ecx
+	xor	eax,edi
+	ror	esi,2
+	add	eax,edx
+	add	edx,DWORD [esp]
+	add	eax,esi
+	mov	ecx,edx
+	mov	esi,DWORD [4+esp]
+	ror	edx,14
+	mov	edi,DWORD [8+esp]
+	xor	edx,ecx
+	mov	ebx,DWORD [80+esp]
+	xor	esi,edi
+	ror	edx,5
+	and	esi,ecx
+	mov	DWORD [esp],ecx
+	xor	edx,ecx
+	add	ebx,DWORD [12+esp]
+	xor	edi,esi
+	ror	edx,6
+	mov	ecx,eax
+	add	ebx,edi
+	ror	ecx,9
+	mov	esi,eax
+	mov	edi,DWORD [20+esp]
+	xor	ecx,eax
+	mov	DWORD [16+esp],eax
+	xor	eax,edi
+	ror	ecx,11
+	and	ebp,eax
+	lea	edx,[1925078388+edx*1+ebx]
+	xor	ecx,esi
+	xor	ebp,edi
+	ror	ecx,2
+	add	ebp,edx
+	add	edx,DWORD [28+esp]
+	add	ebp,ecx
+	mov	esi,edx
+	mov	ecx,DWORD [esp]
+	ror	edx,14
+	mov	edi,DWORD [4+esp]
+	xor	edx,esi
+	mov	ebx,DWORD [84+esp]
+	xor	ecx,edi
+	ror	edx,5
+	and	ecx,esi
+	mov	DWORD [28+esp],esi
+	xor	edx,esi
+	add	ebx,DWORD [8+esp]
+	xor	edi,ecx
+	ror	edx,6
+	mov	esi,ebp
+	add	ebx,edi
+	ror	esi,9
+	mov	ecx,ebp
+	mov	edi,DWORD [16+esp]
+	xor	esi,ebp
+	mov	DWORD [12+esp],ebp
+	xor	ebp,edi
+	ror	esi,11
+	and	eax,ebp
+	lea	edx,[2162078206+edx*1+ebx]
+	xor	esi,ecx
+	xor	eax,edi
+	ror	esi,2
+	add	eax,edx
+	add	edx,DWORD [24+esp]
+	add	eax,esi
+	mov	ecx,edx
+	mov	esi,DWORD [28+esp]
+	ror	edx,14
+	mov	edi,DWORD [esp]
+	xor	edx,ecx
+	mov	ebx,DWORD [88+esp]
+	xor	esi,edi
+	ror	edx,5
+	and	esi,ecx
+	mov	DWORD [24+esp],ecx
+	xor	edx,ecx
+	add	ebx,DWORD [4+esp]
+	xor	edi,esi
+	ror	edx,6
+	mov	ecx,eax
+	add	ebx,edi
+	ror	ecx,9
+	mov	esi,eax
+	mov	edi,DWORD [12+esp]
+	xor	ecx,eax
+	mov	DWORD [8+esp],eax
+	xor	eax,edi
+	ror	ecx,11
+	and	ebp,eax
+	lea	edx,[2614888103+edx*1+ebx]
+	xor	ecx,esi
+	xor	ebp,edi
+	ror	ecx,2
+	add	ebp,edx
+	add	edx,DWORD [20+esp]
+	add	ebp,ecx
+	mov	esi,edx
+	mov	ecx,DWORD [24+esp]
+	ror	edx,14
+	mov	edi,DWORD [28+esp]
+	xor	edx,esi
+	mov	ebx,DWORD [92+esp]
+	xor	ecx,edi
+	ror	edx,5
+	and	ecx,esi
+	mov	DWORD [20+esp],esi
+	xor	edx,esi
+	add	ebx,DWORD [esp]
+	xor	edi,ecx
+	ror	edx,6
+	mov	esi,ebp
+	add	ebx,edi
+	ror	esi,9
+	mov	ecx,ebp
+	mov	edi,DWORD [8+esp]
+	xor	esi,ebp
+	mov	DWORD [4+esp],ebp
+	xor	ebp,edi
+	ror	esi,11
+	and	eax,ebp
+	lea	edx,[3248222580+edx*1+ebx]
+	xor	esi,ecx
+	xor	eax,edi
+	mov	ecx,DWORD [36+esp]
+	ror	esi,2
+	add	eax,edx
+	add	edx,DWORD [16+esp]
+	add	eax,esi
+	mov	esi,DWORD [88+esp]
+	mov	ebx,ecx
+	ror	ecx,11
+	mov	edi,esi
+	ror	esi,2
+	xor	ecx,ebx
+	shr	ebx,3
+	ror	ecx,7
+	xor	esi,edi
+	xor	ebx,ecx
+	ror	esi,17
+	add	ebx,DWORD [32+esp]
+	shr	edi,10
+	add	ebx,DWORD [68+esp]
+	mov	ecx,edx
+	xor	edi,esi
+	mov	esi,DWORD [20+esp]
+	ror	edx,14
+	add	ebx,edi
+	mov	edi,DWORD [24+esp]
+	xor	edx,ecx
+	mov	DWORD [32+esp],ebx
+	xor	esi,edi
+	ror	edx,5
+	and	esi,ecx
+	mov	DWORD [16+esp],ecx
+	xor	edx,ecx
+	add	ebx,DWORD [28+esp]
+	xor	edi,esi
+	ror	edx,6
+	mov	ecx,eax
+	add	ebx,edi
+	ror	ecx,9
+	mov	esi,eax
+	mov	edi,DWORD [4+esp]
+	xor	ecx,eax
+	mov	DWORD [esp],eax
+	xor	eax,edi
+	ror	ecx,11
+	and	ebp,eax
+	lea	edx,[3835390401+edx*1+ebx]
+	xor	ecx,esi
+	xor	ebp,edi
+	mov	esi,DWORD [40+esp]
+	ror	ecx,2
+	add	ebp,edx
+	add	edx,DWORD [12+esp]
+	add	ebp,ecx
+	mov	ecx,DWORD [92+esp]
+	mov	ebx,esi
+	ror	esi,11
+	mov	edi,ecx
+	ror	ecx,2
+	xor	esi,ebx
+	shr	ebx,3
+	ror	esi,7
+	xor	ecx,edi
+	xor	ebx,esi
+	ror	ecx,17
+	add	ebx,DWORD [36+esp]
+	shr	edi,10
+	add	ebx,DWORD [72+esp]
+	mov	esi,edx
+	xor	edi,ecx
+	mov	ecx,DWORD [16+esp]
+	ror	edx,14
+	add	ebx,edi
+	mov	edi,DWORD [20+esp]
+	xor	edx,esi
+	mov	DWORD [36+esp],ebx
+	xor	ecx,edi
+	ror	edx,5
+	and	ecx,esi
+	mov	DWORD [12+esp],esi
+	xor	edx,esi
+	add	ebx,DWORD [24+esp]
+	xor	edi,ecx
+	ror	edx,6
+	mov	esi,ebp
+	add	ebx,edi
+	ror	esi,9
+	mov	ecx,ebp
+	mov	edi,DWORD [esp]
+	xor	esi,ebp
+	mov	DWORD [28+esp],ebp
+	xor	ebp,edi
+	ror	esi,11
+	and	eax,ebp
+	lea	edx,[4022224774+edx*1+ebx]
+	xor	esi,ecx
+	xor	eax,edi
+	mov	ecx,DWORD [44+esp]
+	ror	esi,2
+	add	eax,edx
+	add	edx,DWORD [8+esp]
+	add	eax,esi
+	mov	esi,DWORD [32+esp]
+	mov	ebx,ecx
+	ror	ecx,11
+	mov	edi,esi
+	ror	esi,2
+	xor	ecx,ebx
+	shr	ebx,3
+	ror	ecx,7
+	xor	esi,edi
+	xor	ebx,ecx
+	ror	esi,17
+	add	ebx,DWORD [40+esp]
+	shr	edi,10
+	add	ebx,DWORD [76+esp]
+	mov	ecx,edx
+	xor	edi,esi
+	mov	esi,DWORD [12+esp]
+	ror	edx,14
+	add	ebx,edi
+	mov	edi,DWORD [16+esp]
+	xor	edx,ecx
+	mov	DWORD [40+esp],ebx
+	xor	esi,edi
+	ror	edx,5
+	and	esi,ecx
+	mov	DWORD [8+esp],ecx
+	xor	edx,ecx
+	add	ebx,DWORD [20+esp]
+	xor	edi,esi
+	ror	edx,6
+	mov	ecx,eax
+	add	ebx,edi
+	ror	ecx,9
+	mov	esi,eax
+	mov	edi,DWORD [28+esp]
+	xor	ecx,eax
+	mov	DWORD [24+esp],eax
+	xor	eax,edi
+	ror	ecx,11
+	and	ebp,eax
+	lea	edx,[264347078+edx*1+ebx]
+	xor	ecx,esi
+	xor	ebp,edi
+	mov	esi,DWORD [48+esp]
+	ror	ecx,2
+	add	ebp,edx
+	add	edx,DWORD [4+esp]
+	add	ebp,ecx
+	mov	ecx,DWORD [36+esp]
+	mov	ebx,esi
+	ror	esi,11
+	mov	edi,ecx
+	ror	ecx,2
+	xor	esi,ebx
+	shr	ebx,3
+	ror	esi,7
+	xor	ecx,edi
+	xor	ebx,esi
+	ror	ecx,17
+	add	ebx,DWORD [44+esp]
+	shr	edi,10
+	add	ebx,DWORD [80+esp]
+	mov	esi,edx
+	xor	edi,ecx
+	mov	ecx,DWORD [8+esp]
+	ror	edx,14
+	add	ebx,edi
+	mov	edi,DWORD [12+esp]
+	xor	edx,esi
+	mov	DWORD [44+esp],ebx
+	xor	ecx,edi
+	ror	edx,5
+	and	ecx,esi
+	mov	DWORD [4+esp],esi
+	xor	edx,esi
+	add	ebx,DWORD [16+esp]
+	xor	edi,ecx
+	ror	edx,6
+	mov	esi,ebp
+	add	ebx,edi
+	ror	esi,9
+	mov	ecx,ebp
+	mov	edi,DWORD [24+esp]
+	xor	esi,ebp
+	mov	DWORD [20+esp],ebp
+	xor	ebp,edi
+	ror	esi,11
+	and	eax,ebp
+	lea	edx,[604807628+edx*1+ebx]
+	xor	esi,ecx
+	xor	eax,edi
+	mov	ecx,DWORD [52+esp]
+	ror	esi,2
+	add	eax,edx
+	add	edx,DWORD [esp]
+	add	eax,esi
+	mov	esi,DWORD [40+esp]
+	mov	ebx,ecx
+	ror	ecx,11
+	mov	edi,esi
+	ror	esi,2
+	xor	ecx,ebx
+	shr	ebx,3
+	ror	ecx,7
+	xor	esi,edi
+	xor	ebx,ecx
+	ror	esi,17
+	add	ebx,DWORD [48+esp]
+	shr	edi,10
+	add	ebx,DWORD [84+esp]
+	mov	ecx,edx
+	xor	edi,esi
+	mov	esi,DWORD [4+esp]
+	ror	edx,14
+	add	ebx,edi
+	mov	edi,DWORD [8+esp]
+	xor	edx,ecx
+	mov	DWORD [48+esp],ebx
+	xor	esi,edi
+	ror	edx,5
+	and	esi,ecx
+	mov	DWORD [esp],ecx
+	xor	edx,ecx
+	add	ebx,DWORD [12+esp]
+	xor	edi,esi
+	ror	edx,6
+	mov	ecx,eax
+	add	ebx,edi
+	ror	ecx,9
+	mov	esi,eax
+	mov	edi,DWORD [20+esp]
+	xor	ecx,eax
+	mov	DWORD [16+esp],eax
+	xor	eax,edi
+	ror	ecx,11
+	and	ebp,eax
+	lea	edx,[770255983+edx*1+ebx]
+	xor	ecx,esi
+	xor	ebp,edi
+	mov	esi,DWORD [56+esp]
+	ror	ecx,2
+	add	ebp,edx
+	add	edx,DWORD [28+esp]
+	add	ebp,ecx
+	mov	ecx,DWORD [44+esp]
+	mov	ebx,esi
+	ror	esi,11
+	mov	edi,ecx
+	ror	ecx,2
+	xor	esi,ebx
+	shr	ebx,3
+	ror	esi,7
+	xor	ecx,edi
+	xor	ebx,esi
+	ror	ecx,17
+	add	ebx,DWORD [52+esp]
+	shr	edi,10
+	add	ebx,DWORD [88+esp]
+	mov	esi,edx
+	xor	edi,ecx
+	mov	ecx,DWORD [esp]
+	ror	edx,14
+	add	ebx,edi
+	mov	edi,DWORD [4+esp]
+	xor	edx,esi
+	mov	DWORD [52+esp],ebx
+	xor	ecx,edi
+	ror	edx,5
+	and	ecx,esi
+	mov	DWORD [28+esp],esi
+	xor	edx,esi
+	add	ebx,DWORD [8+esp]
+	xor	edi,ecx
+	ror	edx,6
+	mov	esi,ebp
+	add	ebx,edi
+	ror	esi,9
+	mov	ecx,ebp
+	mov	edi,DWORD [16+esp]
+	xor	esi,ebp
+	mov	DWORD [12+esp],ebp
+	xor	ebp,edi
+	ror	esi,11
+	and	eax,ebp
+	lea	edx,[1249150122+edx*1+ebx]
+	xor	esi,ecx
+	xor	eax,edi
+	mov	ecx,DWORD [60+esp]
+	ror	esi,2
+	add	eax,edx
+	add	edx,DWORD [24+esp]
+	add	eax,esi
+	mov	esi,DWORD [48+esp]
+	mov	ebx,ecx
+	ror	ecx,11
+	mov	edi,esi
+	ror	esi,2
+	xor	ecx,ebx
+	shr	ebx,3
+	ror	ecx,7
+	xor	esi,edi
+	xor	ebx,ecx
+	ror	esi,17
+	add	ebx,DWORD [56+esp]
+	shr	edi,10
+	add	ebx,DWORD [92+esp]
+	mov	ecx,edx
+	xor	edi,esi
+	mov	esi,DWORD [28+esp]
+	ror	edx,14
+	add	ebx,edi
+	mov	edi,DWORD [esp]
+	xor	edx,ecx
+	mov	DWORD [56+esp],ebx
+	xor	esi,edi
+	ror	edx,5
+	and	esi,ecx
+	mov	DWORD [24+esp],ecx
+	xor	edx,ecx
+	add	ebx,DWORD [4+esp]
+	xor	edi,esi
+	ror	edx,6
+	mov	ecx,eax
+	add	ebx,edi
+	ror	ecx,9
+	mov	esi,eax
+	mov	edi,DWORD [12+esp]
+	xor	ecx,eax
+	mov	DWORD [8+esp],eax
+	xor	eax,edi
+	ror	ecx,11
+	and	ebp,eax
+	lea	edx,[1555081692+edx*1+ebx]
+	xor	ecx,esi
+	xor	ebp,edi
+	mov	esi,DWORD [64+esp]
+	ror	ecx,2
+	add	ebp,edx
+	add	edx,DWORD [20+esp]
+	add	ebp,ecx
+	mov	ecx,DWORD [52+esp]
+	mov	ebx,esi
+	ror	esi,11
+	mov	edi,ecx
+	ror	ecx,2
+	xor	esi,ebx
+	shr	ebx,3
+	ror	esi,7
+	xor	ecx,edi
+	xor	ebx,esi
+	ror	ecx,17
+	add	ebx,DWORD [60+esp]
+	shr	edi,10
+	add	ebx,DWORD [32+esp]
+	mov	esi,edx
+	xor	edi,ecx
+	mov	ecx,DWORD [24+esp]
+	ror	edx,14
+	add	ebx,edi
+	mov	edi,DWORD [28+esp]
+	xor	edx,esi
+	mov	DWORD [60+esp],ebx
+	xor	ecx,edi
+	ror	edx,5
+	and	ecx,esi
+	mov	DWORD [20+esp],esi
+	xor	edx,esi
+	add	ebx,DWORD [esp]
+	xor	edi,ecx
+	ror	edx,6
+	mov	esi,ebp
+	add	ebx,edi
+	ror	esi,9
+	mov	ecx,ebp
+	mov	edi,DWORD [8+esp]
+	xor	esi,ebp
+	mov	DWORD [4+esp],ebp
+	xor	ebp,edi
+	ror	esi,11
+	and	eax,ebp
+	lea	edx,[1996064986+edx*1+ebx]
+	xor	esi,ecx
+	xor	eax,edi
+	mov	ecx,DWORD [68+esp]
+	ror	esi,2
+	add	eax,edx
+	add	edx,DWORD [16+esp]
+	add	eax,esi
+	mov	esi,DWORD [56+esp]
+	mov	ebx,ecx
+	ror	ecx,11
+	mov	edi,esi
+	ror	esi,2
+	xor	ecx,ebx
+	shr	ebx,3
+	ror	ecx,7
+	xor	esi,edi
+	xor	ebx,ecx
+	ror	esi,17
+	add	ebx,DWORD [64+esp]
+	shr	edi,10
+	add	ebx,DWORD [36+esp]
+	mov	ecx,edx
+	xor	edi,esi
+	mov	esi,DWORD [20+esp]
+	ror	edx,14
+	add	ebx,edi
+	mov	edi,DWORD [24+esp]
+	xor	edx,ecx
+	mov	DWORD [64+esp],ebx
+	xor	esi,edi
+	ror	edx,5
+	and	esi,ecx
+	mov	DWORD [16+esp],ecx
+	xor	edx,ecx
+	add	ebx,DWORD [28+esp]
+	xor	edi,esi
+	ror	edx,6
+	mov	ecx,eax
+	add	ebx,edi
+	ror	ecx,9
+	mov	esi,eax
+	mov	edi,DWORD [4+esp]
+	xor	ecx,eax
+	mov	DWORD [esp],eax
+	xor	eax,edi
+	ror	ecx,11
+	and	ebp,eax
+	lea	edx,[2554220882+edx*1+ebx]
+	xor	ecx,esi
+	xor	ebp,edi
+	mov	esi,DWORD [72+esp]
+	ror	ecx,2
+	add	ebp,edx
+	add	edx,DWORD [12+esp]
+	add	ebp,ecx
+	mov	ecx,DWORD [60+esp]
+	mov	ebx,esi
+	ror	esi,11
+	mov	edi,ecx
+	ror	ecx,2
+	xor	esi,ebx
+	shr	ebx,3
+	ror	esi,7
+	xor	ecx,edi
+	xor	ebx,esi
+	ror	ecx,17
+	add	ebx,DWORD [68+esp]
+	shr	edi,10
+	add	ebx,DWORD [40+esp]
+	mov	esi,edx
+	xor	edi,ecx
+	mov	ecx,DWORD [16+esp]
+	ror	edx,14
+	add	ebx,edi
+	mov	edi,DWORD [20+esp]
+	xor	edx,esi
+	mov	DWORD [68+esp],ebx
+	xor	ecx,edi
+	ror	edx,5
+	and	ecx,esi
+	mov	DWORD [12+esp],esi
+	xor	edx,esi
+	add	ebx,DWORD [24+esp]
+	xor	edi,ecx
+	ror	edx,6
+	mov	esi,ebp
+	add	ebx,edi
+	ror	esi,9
+	mov	ecx,ebp
+	mov	edi,DWORD [esp]
+	xor	esi,ebp
+	mov	DWORD [28+esp],ebp
+	xor	ebp,edi
+	ror	esi,11
+	and	eax,ebp
+	lea	edx,[2821834349+edx*1+ebx]
+	xor	esi,ecx
+	xor	eax,edi
+	mov	ecx,DWORD [76+esp]
+	ror	esi,2
+	add	eax,edx
+	add	edx,DWORD [8+esp]
+	add	eax,esi
+	mov	esi,DWORD [64+esp]
+	mov	ebx,ecx
+	ror	ecx,11
+	mov	edi,esi
+	ror	esi,2
+	xor	ecx,ebx
+	shr	ebx,3
+	ror	ecx,7
+	xor	esi,edi
+	xor	ebx,ecx
+	ror	esi,17
+	add	ebx,DWORD [72+esp]
+	shr	edi,10
+	add	ebx,DWORD [44+esp]
+	mov	ecx,edx
+	xor	edi,esi
+	mov	esi,DWORD [12+esp]
+	ror	edx,14
+	add	ebx,edi
+	mov	edi,DWORD [16+esp]
+	xor	edx,ecx
+	mov	DWORD [72+esp],ebx
+	xor	esi,edi
+	ror	edx,5
+	and	esi,ecx
+	mov	DWORD [8+esp],ecx
+	xor	edx,ecx
+	add	ebx,DWORD [20+esp]
+	xor	edi,esi
+	ror	edx,6
+	mov	ecx,eax
+	add	ebx,edi
+	ror	ecx,9
+	mov	esi,eax
+	mov	edi,DWORD [28+esp]
+	xor	ecx,eax
+	mov	DWORD [24+esp],eax
+	xor	eax,edi
+	ror	ecx,11
+	and	ebp,eax
+	lea	edx,[2952996808+edx*1+ebx]
+	xor	ecx,esi
+	xor	ebp,edi
+	mov	esi,DWORD [80+esp]
+	ror	ecx,2
+	add	ebp,edx
+	add	edx,DWORD [4+esp]
+	add	ebp,ecx
+	mov	ecx,DWORD [68+esp]
+	mov	ebx,esi
+	ror	esi,11
+	mov	edi,ecx
+	ror	ecx,2
+	xor	esi,ebx
+	shr	ebx,3
+	ror	esi,7
+	xor	ecx,edi
+	xor	ebx,esi
+	ror	ecx,17
+	add	ebx,DWORD [76+esp]
+	shr	edi,10
+	add	ebx,DWORD [48+esp]
+	mov	esi,edx
+	xor	edi,ecx
+	mov	ecx,DWORD [8+esp]
+	ror	edx,14
+	add	ebx,edi
+	mov	edi,DWORD [12+esp]
+	xor	edx,esi
+	mov	DWORD [76+esp],ebx
+	xor	ecx,edi
+	ror	edx,5
+	and	ecx,esi
+	mov	DWORD [4+esp],esi
+	xor	edx,esi
+	add	ebx,DWORD [16+esp]
+	xor	edi,ecx
+	ror	edx,6
+	mov	esi,ebp
+	add	ebx,edi
+	ror	esi,9
+	mov	ecx,ebp
+	mov	edi,DWORD [24+esp]
+	xor	esi,ebp
+	mov	DWORD [20+esp],ebp
+	xor	ebp,edi
+	ror	esi,11
+	and	eax,ebp
+	lea	edx,[3210313671+edx*1+ebx]
+	xor	esi,ecx
+	xor	eax,edi
+	mov	ecx,DWORD [84+esp]
+	ror	esi,2
+	add	eax,edx
+	add	edx,DWORD [esp]
+	add	eax,esi
+	mov	esi,DWORD [72+esp]
+	mov	ebx,ecx
+	ror	ecx,11
+	mov	edi,esi
+	ror	esi,2
+	xor	ecx,ebx
+	shr	ebx,3
+	ror	ecx,7
+	xor	esi,edi
+	xor	ebx,ecx
+	ror	esi,17
+	add	ebx,DWORD [80+esp]
+	shr	edi,10
+	add	ebx,DWORD [52+esp]
+	mov	ecx,edx
+	xor	edi,esi
+	mov	esi,DWORD [4+esp]
+	ror	edx,14
+	add	ebx,edi
+	mov	edi,DWORD [8+esp]
+	xor	edx,ecx
+	mov	DWORD [80+esp],ebx
+	xor	esi,edi
+	ror	edx,5
+	and	esi,ecx
+	mov	DWORD [esp],ecx
+	xor	edx,ecx
+	add	ebx,DWORD [12+esp]
+	xor	edi,esi
+	ror	edx,6
+	mov	ecx,eax
+	add	ebx,edi
+	ror	ecx,9
+	mov	esi,eax
+	mov	edi,DWORD [20+esp]
+	xor	ecx,eax
+	mov	DWORD [16+esp],eax
+	xor	eax,edi
+	ror	ecx,11
+	and	ebp,eax
+	lea	edx,[3336571891+edx*1+ebx]
+	xor	ecx,esi
+	xor	ebp,edi
+	mov	esi,DWORD [88+esp]
+	ror	ecx,2
+	add	ebp,edx
+	add	edx,DWORD [28+esp]
+	add	ebp,ecx
+	mov	ecx,DWORD [76+esp]
+	mov	ebx,esi
+	ror	esi,11
+	mov	edi,ecx
+	ror	ecx,2
+	xor	esi,ebx
+	shr	ebx,3
+	ror	esi,7
+	xor	ecx,edi
+	xor	ebx,esi
+	ror	ecx,17
+	add	ebx,DWORD [84+esp]
+	shr	edi,10
+	add	ebx,DWORD [56+esp]
+	mov	esi,edx
+	xor	edi,ecx
+	mov	ecx,DWORD [esp]
+	ror	edx,14
+	add	ebx,edi
+	mov	edi,DWORD [4+esp]
+	xor	edx,esi
+	mov	DWORD [84+esp],ebx
+	xor	ecx,edi
+	ror	edx,5
+	and	ecx,esi
+	mov	DWORD [28+esp],esi
+	xor	edx,esi
+	add	ebx,DWORD [8+esp]
+	xor	edi,ecx
+	ror	edx,6
+	mov	esi,ebp
+	add	ebx,edi
+	ror	esi,9
+	mov	ecx,ebp
+	mov	edi,DWORD [16+esp]
+	xor	esi,ebp
+	mov	DWORD [12+esp],ebp
+	xor	ebp,edi
+	ror	esi,11
+	and	eax,ebp
+	lea	edx,[3584528711+edx*1+ebx]
+	xor	esi,ecx
+	xor	eax,edi
+	mov	ecx,DWORD [92+esp]
+	ror	esi,2
+	add	eax,edx
+	add	edx,DWORD [24+esp]
+	add	eax,esi
+	mov	esi,DWORD [80+esp]
+	mov	ebx,ecx
+	ror	ecx,11
+	mov	edi,esi
+	ror	esi,2
+	xor	ecx,ebx
+	shr	ebx,3
+	ror	ecx,7
+	xor	esi,edi
+	xor	ebx,ecx
+	ror	esi,17
+	add	ebx,DWORD [88+esp]
+	shr	edi,10
+	add	ebx,DWORD [60+esp]
+	mov	ecx,edx
+	xor	edi,esi
+	mov	esi,DWORD [28+esp]
+	ror	edx,14
+	add	ebx,edi
+	mov	edi,DWORD [esp]
+	xor	edx,ecx
+	mov	DWORD [88+esp],ebx
+	xor	esi,edi
+	ror	edx,5
+	and	esi,ecx
+	mov	DWORD [24+esp],ecx
+	xor	edx,ecx
+	add	ebx,DWORD [4+esp]
+	xor	edi,esi
+	ror	edx,6
+	mov	ecx,eax
+	add	ebx,edi
+	ror	ecx,9
+	mov	esi,eax
+	mov	edi,DWORD [12+esp]
+	xor	ecx,eax
+	mov	DWORD [8+esp],eax
+	xor	eax,edi
+	ror	ecx,11
+	and	ebp,eax
+	lea	edx,[113926993+edx*1+ebx]
+	xor	ecx,esi
+	xor	ebp,edi
+	mov	esi,DWORD [32+esp]
+	ror	ecx,2
+	add	ebp,edx
+	add	edx,DWORD [20+esp]
+	add	ebp,ecx
+	mov	ecx,DWORD [84+esp]
+	mov	ebx,esi
+	ror	esi,11
+	mov	edi,ecx
+	ror	ecx,2
+	xor	esi,ebx
+	shr	ebx,3
+	ror	esi,7
+	xor	ecx,edi
+	xor	ebx,esi
+	ror	ecx,17
+	add	ebx,DWORD [92+esp]
+	shr	edi,10
+	add	ebx,DWORD [64+esp]
+	mov	esi,edx
+	xor	edi,ecx
+	mov	ecx,DWORD [24+esp]
+	ror	edx,14
+	add	ebx,edi
+	mov	edi,DWORD [28+esp]
+	xor	edx,esi
+	mov	DWORD [92+esp],ebx
+	xor	ecx,edi
+	ror	edx,5
+	and	ecx,esi
+	mov	DWORD [20+esp],esi
+	xor	edx,esi
+	add	ebx,DWORD [esp]
+	xor	edi,ecx
+	ror	edx,6
+	mov	esi,ebp
+	add	ebx,edi
+	ror	esi,9
+	mov	ecx,ebp
+	mov	edi,DWORD [8+esp]
+	xor	esi,ebp
+	mov	DWORD [4+esp],ebp
+	xor	ebp,edi
+	ror	esi,11
+	and	eax,ebp
+	lea	edx,[338241895+edx*1+ebx]
+	xor	esi,ecx
+	xor	eax,edi
+	mov	ecx,DWORD [36+esp]
+	ror	esi,2
+	add	eax,edx
+	add	edx,DWORD [16+esp]
+	add	eax,esi
+	mov	esi,DWORD [88+esp]
+	mov	ebx,ecx
+	ror	ecx,11
+	mov	edi,esi
+	ror	esi,2
+	xor	ecx,ebx
+	shr	ebx,3
+	ror	ecx,7
+	xor	esi,edi
+	xor	ebx,ecx
+	ror	esi,17
+	add	ebx,DWORD [32+esp]
+	shr	edi,10
+	add	ebx,DWORD [68+esp]
+	mov	ecx,edx
+	xor	edi,esi
+	mov	esi,DWORD [20+esp]
+	ror	edx,14
+	add	ebx,edi
+	mov	edi,DWORD [24+esp]
+	xor	edx,ecx
+	mov	DWORD [32+esp],ebx
+	xor	esi,edi
+	ror	edx,5
+	and	esi,ecx
+	mov	DWORD [16+esp],ecx
+	xor	edx,ecx
+	add	ebx,DWORD [28+esp]
+	xor	edi,esi
+	ror	edx,6
+	mov	ecx,eax
+	add	ebx,edi
+	ror	ecx,9
+	mov	esi,eax
+	mov	edi,DWORD [4+esp]
+	xor	ecx,eax
+	mov	DWORD [esp],eax
+	xor	eax,edi
+	ror	ecx,11
+	and	ebp,eax
+	lea	edx,[666307205+edx*1+ebx]
+	xor	ecx,esi
+	xor	ebp,edi
+	mov	esi,DWORD [40+esp]
+	ror	ecx,2
+	add	ebp,edx
+	add	edx,DWORD [12+esp]
+	add	ebp,ecx
+	mov	ecx,DWORD [92+esp]
+	mov	ebx,esi
+	ror	esi,11
+	mov	edi,ecx
+	ror	ecx,2
+	xor	esi,ebx
+	shr	ebx,3
+	ror	esi,7
+	xor	ecx,edi
+	xor	ebx,esi
+	ror	ecx,17
+	add	ebx,DWORD [36+esp]
+	shr	edi,10
+	add	ebx,DWORD [72+esp]
+	mov	esi,edx
+	xor	edi,ecx
+	mov	ecx,DWORD [16+esp]
+	ror	edx,14
+	add	ebx,edi
+	mov	edi,DWORD [20+esp]
+	xor	edx,esi
+	mov	DWORD [36+esp],ebx
+	xor	ecx,edi
+	ror	edx,5
+	and	ecx,esi
+	mov	DWORD [12+esp],esi
+	xor	edx,esi
+	add	ebx,DWORD [24+esp]
+	xor	edi,ecx
+	ror	edx,6
+	mov	esi,ebp
+	add	ebx,edi
+	ror	esi,9
+	mov	ecx,ebp
+	mov	edi,DWORD [esp]
+	xor	esi,ebp
+	mov	DWORD [28+esp],ebp
+	xor	ebp,edi
+	ror	esi,11
+	and	eax,ebp
+	lea	edx,[773529912+edx*1+ebx]
+	xor	esi,ecx
+	xor	eax,edi
+	mov	ecx,DWORD [44+esp]
+	ror	esi,2
+	add	eax,edx
+	add	edx,DWORD [8+esp]
+	add	eax,esi
+	mov	esi,DWORD [32+esp]
+	mov	ebx,ecx
+	ror	ecx,11
+	mov	edi,esi
+	ror	esi,2
+	xor	ecx,ebx
+	shr	ebx,3
+	ror	ecx,7
+	xor	esi,edi
+	xor	ebx,ecx
+	ror	esi,17
+	add	ebx,DWORD [40+esp]
+	shr	edi,10
+	add	ebx,DWORD [76+esp]
+	mov	ecx,edx
+	xor	edi,esi
+	mov	esi,DWORD [12+esp]
+	ror	edx,14
+	add	ebx,edi
+	mov	edi,DWORD [16+esp]
+	xor	edx,ecx
+	mov	DWORD [40+esp],ebx
+	xor	esi,edi
+	ror	edx,5
+	and	esi,ecx
+	mov	DWORD [8+esp],ecx
+	xor	edx,ecx
+	add	ebx,DWORD [20+esp]
+	xor	edi,esi
+	ror	edx,6
+	mov	ecx,eax
+	add	ebx,edi
+	ror	ecx,9
+	mov	esi,eax
+	mov	edi,DWORD [28+esp]
+	xor	ecx,eax
+	mov	DWORD [24+esp],eax
+	xor	eax,edi
+	ror	ecx,11
+	and	ebp,eax
+	lea	edx,[1294757372+edx*1+ebx]
+	xor	ecx,esi
+	xor	ebp,edi
+	mov	esi,DWORD [48+esp]
+	ror	ecx,2
+	add	ebp,edx
+	add	edx,DWORD [4+esp]
+	add	ebp,ecx
+	mov	ecx,DWORD [36+esp]
+	mov	ebx,esi
+	ror	esi,11
+	mov	edi,ecx
+	ror	ecx,2
+	xor	esi,ebx
+	shr	ebx,3
+	ror	esi,7
+	xor	ecx,edi
+	xor	ebx,esi
+	ror	ecx,17
+	add	ebx,DWORD [44+esp]
+	shr	edi,10
+	add	ebx,DWORD [80+esp]
+	mov	esi,edx
+	xor	edi,ecx
+	mov	ecx,DWORD [8+esp]
+	ror	edx,14
+	add	ebx,edi
+	mov	edi,DWORD [12+esp]
+	xor	edx,esi
+	mov	DWORD [44+esp],ebx
+	xor	ecx,edi
+	ror	edx,5
+	and	ecx,esi
+	mov	DWORD [4+esp],esi
+	xor	edx,esi
+	add	ebx,DWORD [16+esp]
+	xor	edi,ecx
+	ror	edx,6
+	mov	esi,ebp
+	add	ebx,edi
+	ror	esi,9
+	mov	ecx,ebp
+	mov	edi,DWORD [24+esp]
+	xor	esi,ebp
+	mov	DWORD [20+esp],ebp
+	xor	ebp,edi
+	ror	esi,11
+	and	eax,ebp
+	lea	edx,[1396182291+edx*1+ebx]
+	xor	esi,ecx
+	xor	eax,edi
+	mov	ecx,DWORD [52+esp]
+	ror	esi,2
+	add	eax,edx
+	add	edx,DWORD [esp]
+	add	eax,esi
+	mov	esi,DWORD [40+esp]
+	mov	ebx,ecx
+	ror	ecx,11
+	mov	edi,esi
+	ror	esi,2
+	xor	ecx,ebx
+	shr	ebx,3
+	ror	ecx,7
+	xor	esi,edi
+	xor	ebx,ecx
+	ror	esi,17
+	add	ebx,DWORD [48+esp]
+	shr	edi,10
+	add	ebx,DWORD [84+esp]
+	mov	ecx,edx
+	xor	edi,esi
+	mov	esi,DWORD [4+esp]
+	ror	edx,14
+	add	ebx,edi
+	mov	edi,DWORD [8+esp]
+	xor	edx,ecx
+	mov	DWORD [48+esp],ebx
+	xor	esi,edi
+	ror	edx,5
+	and	esi,ecx
+	mov	DWORD [esp],ecx
+	xor	edx,ecx
+	add	ebx,DWORD [12+esp]
+	xor	edi,esi
+	ror	edx,6
+	mov	ecx,eax
+	add	ebx,edi
+	ror	ecx,9
+	mov	esi,eax
+	mov	edi,DWORD [20+esp]
+	xor	ecx,eax
+	mov	DWORD [16+esp],eax
+	xor	eax,edi
+	ror	ecx,11
+	and	ebp,eax
+	lea	edx,[1695183700+edx*1+ebx]
+	xor	ecx,esi
+	xor	ebp,edi
+	mov	esi,DWORD [56+esp]
+	ror	ecx,2
+	add	ebp,edx
+	add	edx,DWORD [28+esp]
+	add	ebp,ecx
+	mov	ecx,DWORD [44+esp]
+	mov	ebx,esi
+	ror	esi,11
+	mov	edi,ecx
+	ror	ecx,2
+	xor	esi,ebx
+	shr	ebx,3
+	ror	esi,7
+	xor	ecx,edi
+	xor	ebx,esi
+	ror	ecx,17
+	add	ebx,DWORD [52+esp]
+	shr	edi,10
+	add	ebx,DWORD [88+esp]
+	mov	esi,edx
+	xor	edi,ecx
+	mov	ecx,DWORD [esp]
+	ror	edx,14
+	add	ebx,edi
+	mov	edi,DWORD [4+esp]
+	xor	edx,esi
+	mov	DWORD [52+esp],ebx
+	xor	ecx,edi
+	ror	edx,5
+	and	ecx,esi
+	mov	DWORD [28+esp],esi
+	xor	edx,esi
+	add	ebx,DWORD [8+esp]
+	xor	edi,ecx
+	ror	edx,6
+	mov	esi,ebp
+	add	ebx,edi
+	ror	esi,9
+	mov	ecx,ebp
+	mov	edi,DWORD [16+esp]
+	xor	esi,ebp
+	mov	DWORD [12+esp],ebp
+	xor	ebp,edi
+	ror	esi,11
+	and	eax,ebp
+	lea	edx,[1986661051+edx*1+ebx]
+	xor	esi,ecx
+	xor	eax,edi
+	mov	ecx,DWORD [60+esp]
+	ror	esi,2
+	add	eax,edx
+	add	edx,DWORD [24+esp]
+	add	eax,esi
+	mov	esi,DWORD [48+esp]
+	mov	ebx,ecx
+	ror	ecx,11
+	mov	edi,esi
+	ror	esi,2
+	xor	ecx,ebx
+	shr	ebx,3
+	ror	ecx,7
+	xor	esi,edi
+	xor	ebx,ecx
+	ror	esi,17
+	add	ebx,DWORD [56+esp]
+	shr	edi,10
+	add	ebx,DWORD [92+esp]
+	mov	ecx,edx
+	xor	edi,esi
+	mov	esi,DWORD [28+esp]
+	ror	edx,14
+	add	ebx,edi
+	mov	edi,DWORD [esp]
+	xor	edx,ecx
+	mov	DWORD [56+esp],ebx
+	xor	esi,edi
+	ror	edx,5
+	and	esi,ecx
+	mov	DWORD [24+esp],ecx
+	xor	edx,ecx
+	add	ebx,DWORD [4+esp]
+	xor	edi,esi
+	ror	edx,6
+	mov	ecx,eax
+	add	ebx,edi
+	ror	ecx,9
+	mov	esi,eax
+	mov	edi,DWORD [12+esp]
+	xor	ecx,eax
+	mov	DWORD [8+esp],eax
+	xor	eax,edi
+	ror	ecx,11
+	and	ebp,eax
+	lea	edx,[2177026350+edx*1+ebx]
+	xor	ecx,esi
+	xor	ebp,edi
+	mov	esi,DWORD [64+esp]
+	ror	ecx,2
+	add	ebp,edx
+	add	edx,DWORD [20+esp]
+	add	ebp,ecx
+	mov	ecx,DWORD [52+esp]
+	mov	ebx,esi
+	ror	esi,11
+	mov	edi,ecx
+	ror	ecx,2
+	xor	esi,ebx
+	shr	ebx,3
+	ror	esi,7
+	xor	ecx,edi
+	xor	ebx,esi
+	ror	ecx,17
+	add	ebx,DWORD [60+esp]
+	shr	edi,10
+	add	ebx,DWORD [32+esp]
+	mov	esi,edx
+	xor	edi,ecx
+	mov	ecx,DWORD [24+esp]
+	ror	edx,14
+	add	ebx,edi
+	mov	edi,DWORD [28+esp]
+	xor	edx,esi
+	mov	DWORD [60+esp],ebx
+	xor	ecx,edi
+	ror	edx,5
+	and	ecx,esi
+	mov	DWORD [20+esp],esi
+	xor	edx,esi
+	add	ebx,DWORD [esp]
+	xor	edi,ecx
+	ror	edx,6
+	mov	esi,ebp
+	add	ebx,edi
+	ror	esi,9
+	mov	ecx,ebp
+	mov	edi,DWORD [8+esp]
+	xor	esi,ebp
+	mov	DWORD [4+esp],ebp
+	xor	ebp,edi
+	ror	esi,11
+	and	eax,ebp
+	lea	edx,[2456956037+edx*1+ebx]
+	xor	esi,ecx
+	xor	eax,edi
+	mov	ecx,DWORD [68+esp]
+	ror	esi,2
+	add	eax,edx
+	add	edx,DWORD [16+esp]
+	add	eax,esi
+	mov	esi,DWORD [56+esp]
+	mov	ebx,ecx
+	ror	ecx,11
+	mov	edi,esi
+	ror	esi,2
+	xor	ecx,ebx
+	shr	ebx,3
+	ror	ecx,7
+	xor	esi,edi
+	xor	ebx,ecx
+	ror	esi,17
+	add	ebx,DWORD [64+esp]
+	shr	edi,10
+	add	ebx,DWORD [36+esp]
+	mov	ecx,edx
+	xor	edi,esi
+	mov	esi,DWORD [20+esp]
+	ror	edx,14
+	add	ebx,edi
+	mov	edi,DWORD [24+esp]
+	xor	edx,ecx
+	mov	DWORD [64+esp],ebx
+	xor	esi,edi
+	ror	edx,5
+	and	esi,ecx
+	mov	DWORD [16+esp],ecx
+	xor	edx,ecx
+	add	ebx,DWORD [28+esp]
+	xor	edi,esi
+	ror	edx,6
+	mov	ecx,eax
+	add	ebx,edi
+	ror	ecx,9
+	mov	esi,eax
+	mov	edi,DWORD [4+esp]
+	xor	ecx,eax
+	mov	DWORD [esp],eax
+	xor	eax,edi
+	ror	ecx,11
+	and	ebp,eax
+	lea	edx,[2730485921+edx*1+ebx]
+	xor	ecx,esi
+	xor	ebp,edi
+	mov	esi,DWORD [72+esp]
+	ror	ecx,2
+	add	ebp,edx
+	add	edx,DWORD [12+esp]
+	add	ebp,ecx
+	mov	ecx,DWORD [60+esp]
+	mov	ebx,esi
+	ror	esi,11
+	mov	edi,ecx
+	ror	ecx,2
+	xor	esi,ebx
+	shr	ebx,3
+	ror	esi,7
+	xor	ecx,edi
+	xor	ebx,esi
+	ror	ecx,17
+	add	ebx,DWORD [68+esp]
+	shr	edi,10
+	add	ebx,DWORD [40+esp]
+	mov	esi,edx
+	xor	edi,ecx
+	mov	ecx,DWORD [16+esp]
+	ror	edx,14
+	add	ebx,edi
+	mov	edi,DWORD [20+esp]
+	xor	edx,esi
+	mov	DWORD [68+esp],ebx
+	xor	ecx,edi
+	ror	edx,5
+	and	ecx,esi
+	mov	DWORD [12+esp],esi
+	xor	edx,esi
+	add	ebx,DWORD [24+esp]
+	xor	edi,ecx
+	ror	edx,6
+	mov	esi,ebp
+	add	ebx,edi
+	ror	esi,9
+	mov	ecx,ebp
+	mov	edi,DWORD [esp]
+	xor	esi,ebp
+	mov	DWORD [28+esp],ebp
+	xor	ebp,edi
+	ror	esi,11
+	and	eax,ebp
+	lea	edx,[2820302411+edx*1+ebx]
+	xor	esi,ecx
+	xor	eax,edi
+	mov	ecx,DWORD [76+esp]
+	ror	esi,2
+	add	eax,edx
+	add	edx,DWORD [8+esp]
+	add	eax,esi
+	mov	esi,DWORD [64+esp]
+	mov	ebx,ecx
+	ror	ecx,11
+	mov	edi,esi
+	ror	esi,2
+	xor	ecx,ebx
+	shr	ebx,3
+	ror	ecx,7
+	xor	esi,edi
+	xor	ebx,ecx
+	ror	esi,17
+	add	ebx,DWORD [72+esp]
+	shr	edi,10
+	add	ebx,DWORD [44+esp]
+	mov	ecx,edx
+	xor	edi,esi
+	mov	esi,DWORD [12+esp]
+	ror	edx,14
+	add	ebx,edi
+	mov	edi,DWORD [16+esp]
+	xor	edx,ecx
+	mov	DWORD [72+esp],ebx
+	xor	esi,edi
+	ror	edx,5
+	and	esi,ecx
+	mov	DWORD [8+esp],ecx
+	xor	edx,ecx
+	add	ebx,DWORD [20+esp]
+	xor	edi,esi
+	ror	edx,6
+	mov	ecx,eax
+	add	ebx,edi
+	ror	ecx,9
+	mov	esi,eax
+	mov	edi,DWORD [28+esp]
+	xor	ecx,eax
+	mov	DWORD [24+esp],eax
+	xor	eax,edi
+	ror	ecx,11
+	and	ebp,eax
+	lea	edx,[3259730800+edx*1+ebx]
+	xor	ecx,esi
+	xor	ebp,edi
+	mov	esi,DWORD [80+esp]
+	ror	ecx,2
+	add	ebp,edx
+	add	edx,DWORD [4+esp]
+	add	ebp,ecx
+	mov	ecx,DWORD [68+esp]
+	mov	ebx,esi
+	ror	esi,11
+	mov	edi,ecx
+	ror	ecx,2
+	xor	esi,ebx
+	shr	ebx,3
+	ror	esi,7
+	xor	ecx,edi
+	xor	ebx,esi
+	ror	ecx,17
+	add	ebx,DWORD [76+esp]
+	shr	edi,10
+	add	ebx,DWORD [48+esp]
+	mov	esi,edx
+	xor	edi,ecx
+	mov	ecx,DWORD [8+esp]
+	ror	edx,14
+	add	ebx,edi
+	mov	edi,DWORD [12+esp]
+	xor	edx,esi
+	mov	DWORD [76+esp],ebx
+	xor	ecx,edi
+	ror	edx,5
+	and	ecx,esi
+	mov	DWORD [4+esp],esi
+	xor	edx,esi
+	add	ebx,DWORD [16+esp]
+	xor	edi,ecx
+	ror	edx,6
+	mov	esi,ebp
+	add	ebx,edi
+	ror	esi,9
+	mov	ecx,ebp
+	mov	edi,DWORD [24+esp]
+	xor	esi,ebp
+	mov	DWORD [20+esp],ebp
+	xor	ebp,edi
+	ror	esi,11
+	and	eax,ebp
+	lea	edx,[3345764771+edx*1+ebx]
+	xor	esi,ecx
+	xor	eax,edi
+	mov	ecx,DWORD [84+esp]
+	ror	esi,2
+	add	eax,edx
+	add	edx,DWORD [esp]
+	add	eax,esi
+	mov	esi,DWORD [72+esp]
+	mov	ebx,ecx
+	ror	ecx,11
+	mov	edi,esi
+	ror	esi,2
+	xor	ecx,ebx
+	shr	ebx,3
+	ror	ecx,7
+	xor	esi,edi
+	xor	ebx,ecx
+	ror	esi,17
+	add	ebx,DWORD [80+esp]
+	shr	edi,10
+	add	ebx,DWORD [52+esp]
+	mov	ecx,edx
+	xor	edi,esi
+	mov	esi,DWORD [4+esp]
+	ror	edx,14
+	add	ebx,edi
+	mov	edi,DWORD [8+esp]
+	xor	edx,ecx
+	mov	DWORD [80+esp],ebx
+	xor	esi,edi
+	ror	edx,5
+	and	esi,ecx
+	mov	DWORD [esp],ecx
+	xor	edx,ecx
+	add	ebx,DWORD [12+esp]
+	xor	edi,esi
+	ror	edx,6
+	mov	ecx,eax
+	add	ebx,edi
+	ror	ecx,9
+	mov	esi,eax
+	mov	edi,DWORD [20+esp]
+	xor	ecx,eax
+	mov	DWORD [16+esp],eax
+	xor	eax,edi
+	ror	ecx,11
+	and	ebp,eax
+	lea	edx,[3516065817+edx*1+ebx]
+	xor	ecx,esi
+	xor	ebp,edi
+	mov	esi,DWORD [88+esp]
+	ror	ecx,2
+	add	ebp,edx
+	add	edx,DWORD [28+esp]
+	add	ebp,ecx
+	mov	ecx,DWORD [76+esp]
+	mov	ebx,esi
+	ror	esi,11
+	mov	edi,ecx
+	ror	ecx,2
+	xor	esi,ebx
+	shr	ebx,3
+	ror	esi,7
+	xor	ecx,edi
+	xor	ebx,esi
+	ror	ecx,17
+	add	ebx,DWORD [84+esp]
+	shr	edi,10
+	add	ebx,DWORD [56+esp]
+	mov	esi,edx
+	xor	edi,ecx
+	mov	ecx,DWORD [esp]
+	ror	edx,14
+	add	ebx,edi
+	mov	edi,DWORD [4+esp]
+	xor	edx,esi
+	mov	DWORD [84+esp],ebx
+	xor	ecx,edi
+	ror	edx,5
+	and	ecx,esi
+	mov	DWORD [28+esp],esi
+	xor	edx,esi
+	add	ebx,DWORD [8+esp]
+	xor	edi,ecx
+	ror	edx,6
+	mov	esi,ebp
+	add	ebx,edi
+	ror	esi,9
+	mov	ecx,ebp
+	mov	edi,DWORD [16+esp]
+	xor	esi,ebp
+	mov	DWORD [12+esp],ebp
+	xor	ebp,edi
+	ror	esi,11
+	and	eax,ebp
+	lea	edx,[3600352804+edx*1+ebx]
+	xor	esi,ecx
+	xor	eax,edi
+	mov	ecx,DWORD [92+esp]
+	ror	esi,2
+	add	eax,edx
+	add	edx,DWORD [24+esp]
+	add	eax,esi
+	mov	esi,DWORD [80+esp]
+	mov	ebx,ecx
+	ror	ecx,11
+	mov	edi,esi
+	ror	esi,2
+	xor	ecx,ebx
+	shr	ebx,3
+	ror	ecx,7
+	xor	esi,edi
+	xor	ebx,ecx
+	ror	esi,17
+	add	ebx,DWORD [88+esp]
+	shr	edi,10
+	add	ebx,DWORD [60+esp]
+	mov	ecx,edx
+	xor	edi,esi
+	mov	esi,DWORD [28+esp]
+	ror	edx,14
+	add	ebx,edi
+	mov	edi,DWORD [esp]
+	xor	edx,ecx
+	mov	DWORD [88+esp],ebx
+	xor	esi,edi
+	ror	edx,5
+	and	esi,ecx
+	mov	DWORD [24+esp],ecx
+	xor	edx,ecx
+	add	ebx,DWORD [4+esp]
+	xor	edi,esi
+	ror	edx,6
+	mov	ecx,eax
+	add	ebx,edi
+	ror	ecx,9
+	mov	esi,eax
+	mov	edi,DWORD [12+esp]
+	xor	ecx,eax
+	mov	DWORD [8+esp],eax
+	xor	eax,edi
+	ror	ecx,11
+	and	ebp,eax
+	lea	edx,[4094571909+edx*1+ebx]
+	xor	ecx,esi
+	xor	ebp,edi
+	mov	esi,DWORD [32+esp]
+	ror	ecx,2
+	add	ebp,edx
+	add	edx,DWORD [20+esp]
+	add	ebp,ecx
+	mov	ecx,DWORD [84+esp]
+	mov	ebx,esi
+	ror	esi,11
+	mov	edi,ecx
+	ror	ecx,2
+	xor	esi,ebx
+	shr	ebx,3
+	ror	esi,7
+	xor	ecx,edi
+	xor	ebx,esi
+	ror	ecx,17
+	add	ebx,DWORD [92+esp]
+	shr	edi,10
+	add	ebx,DWORD [64+esp]
+	mov	esi,edx
+	xor	edi,ecx
+	mov	ecx,DWORD [24+esp]
+	ror	edx,14
+	add	ebx,edi
+	mov	edi,DWORD [28+esp]
+	xor	edx,esi
+	mov	DWORD [92+esp],ebx
+	xor	ecx,edi
+	ror	edx,5
+	and	ecx,esi
+	mov	DWORD [20+esp],esi
+	xor	edx,esi
+	add	ebx,DWORD [esp]
+	xor	edi,ecx
+	ror	edx,6
+	mov	esi,ebp
+	add	ebx,edi
+	ror	esi,9
+	mov	ecx,ebp
+	mov	edi,DWORD [8+esp]
+	xor	esi,ebp
+	mov	DWORD [4+esp],ebp
+	xor	ebp,edi
+	ror	esi,11
+	and	eax,ebp
+	lea	edx,[275423344+edx*1+ebx]
+	xor	esi,ecx
+	xor	eax,edi
+	mov	ecx,DWORD [36+esp]
+	ror	esi,2
+	add	eax,edx
+	add	edx,DWORD [16+esp]
+	add	eax,esi
+	mov	esi,DWORD [88+esp]
+	mov	ebx,ecx
+	ror	ecx,11
+	mov	edi,esi
+	ror	esi,2
+	xor	ecx,ebx
+	shr	ebx,3
+	ror	ecx,7
+	xor	esi,edi
+	xor	ebx,ecx
+	ror	esi,17
+	add	ebx,DWORD [32+esp]
+	shr	edi,10
+	add	ebx,DWORD [68+esp]
+	mov	ecx,edx
+	xor	edi,esi
+	mov	esi,DWORD [20+esp]
+	ror	edx,14
+	add	ebx,edi
+	mov	edi,DWORD [24+esp]
+	xor	edx,ecx
+	mov	DWORD [32+esp],ebx
+	xor	esi,edi
+	ror	edx,5
+	and	esi,ecx
+	mov	DWORD [16+esp],ecx
+	xor	edx,ecx
+	add	ebx,DWORD [28+esp]
+	xor	edi,esi
+	ror	edx,6
+	mov	ecx,eax
+	add	ebx,edi
+	ror	ecx,9
+	mov	esi,eax
+	mov	edi,DWORD [4+esp]
+	xor	ecx,eax
+	mov	DWORD [esp],eax
+	xor	eax,edi
+	ror	ecx,11
+	and	ebp,eax
+	lea	edx,[430227734+edx*1+ebx]
+	xor	ecx,esi
+	xor	ebp,edi
+	mov	esi,DWORD [40+esp]
+	ror	ecx,2
+	add	ebp,edx
+	add	edx,DWORD [12+esp]
+	add	ebp,ecx
+	mov	ecx,DWORD [92+esp]
+	mov	ebx,esi
+	ror	esi,11
+	mov	edi,ecx
+	ror	ecx,2
+	xor	esi,ebx
+	shr	ebx,3
+	ror	esi,7
+	xor	ecx,edi
+	xor	ebx,esi
+	ror	ecx,17
+	add	ebx,DWORD [36+esp]
+	shr	edi,10
+	add	ebx,DWORD [72+esp]
+	mov	esi,edx
+	xor	edi,ecx
+	mov	ecx,DWORD [16+esp]
+	ror	edx,14
+	add	ebx,edi
+	mov	edi,DWORD [20+esp]
+	xor	edx,esi
+	mov	DWORD [36+esp],ebx
+	xor	ecx,edi
+	ror	edx,5
+	and	ecx,esi
+	mov	DWORD [12+esp],esi
+	xor	edx,esi
+	add	ebx,DWORD [24+esp]
+	xor	edi,ecx
+	ror	edx,6
+	mov	esi,ebp
+	add	ebx,edi
+	ror	esi,9
+	mov	ecx,ebp
+	mov	edi,DWORD [esp]
+	xor	esi,ebp
+	mov	DWORD [28+esp],ebp
+	xor	ebp,edi
+	ror	esi,11
+	and	eax,ebp
+	lea	edx,[506948616+edx*1+ebx]
+	xor	esi,ecx
+	xor	eax,edi
+	mov	ecx,DWORD [44+esp]
+	ror	esi,2
+	add	eax,edx
+	add	edx,DWORD [8+esp]
+	add	eax,esi
+	mov	esi,DWORD [32+esp]
+	mov	ebx,ecx
+	ror	ecx,11
+	mov	edi,esi
+	ror	esi,2
+	xor	ecx,ebx
+	shr	ebx,3
+	ror	ecx,7
+	xor	esi,edi
+	xor	ebx,ecx
+	ror	esi,17
+	add	ebx,DWORD [40+esp]
+	shr	edi,10
+	add	ebx,DWORD [76+esp]
+	mov	ecx,edx
+	xor	edi,esi
+	mov	esi,DWORD [12+esp]
+	ror	edx,14
+	add	ebx,edi
+	mov	edi,DWORD [16+esp]
+	xor	edx,ecx
+	mov	DWORD [40+esp],ebx
+	xor	esi,edi
+	ror	edx,5
+	and	esi,ecx
+	mov	DWORD [8+esp],ecx
+	xor	edx,ecx
+	add	ebx,DWORD [20+esp]
+	xor	edi,esi
+	ror	edx,6
+	mov	ecx,eax
+	add	ebx,edi
+	ror	ecx,9
+	mov	esi,eax
+	mov	edi,DWORD [28+esp]
+	xor	ecx,eax
+	mov	DWORD [24+esp],eax
+	xor	eax,edi
+	ror	ecx,11
+	and	ebp,eax
+	lea	edx,[659060556+edx*1+ebx]
+	xor	ecx,esi
+	xor	ebp,edi
+	mov	esi,DWORD [48+esp]
+	ror	ecx,2
+	add	ebp,edx
+	add	edx,DWORD [4+esp]
+	add	ebp,ecx
+	mov	ecx,DWORD [36+esp]
+	mov	ebx,esi
+	ror	esi,11
+	mov	edi,ecx
+	ror	ecx,2
+	xor	esi,ebx
+	shr	ebx,3
+	ror	esi,7
+	xor	ecx,edi
+	xor	ebx,esi
+	ror	ecx,17
+	add	ebx,DWORD [44+esp]
+	shr	edi,10
+	add	ebx,DWORD [80+esp]
+	mov	esi,edx
+	xor	edi,ecx
+	mov	ecx,DWORD [8+esp]
+	ror	edx,14
+	add	ebx,edi
+	mov	edi,DWORD [12+esp]
+	xor	edx,esi
+	mov	DWORD [44+esp],ebx
+	xor	ecx,edi
+	ror	edx,5
+	and	ecx,esi
+	mov	DWORD [4+esp],esi
+	xor	edx,esi
+	add	ebx,DWORD [16+esp]
+	xor	edi,ecx
+	ror	edx,6
+	mov	esi,ebp
+	add	ebx,edi
+	ror	esi,9
+	mov	ecx,ebp
+	mov	edi,DWORD [24+esp]
+	xor	esi,ebp
+	mov	DWORD [20+esp],ebp
+	xor	ebp,edi
+	ror	esi,11
+	and	eax,ebp
+	lea	edx,[883997877+edx*1+ebx]
+	xor	esi,ecx
+	xor	eax,edi
+	mov	ecx,DWORD [52+esp]
+	ror	esi,2
+	add	eax,edx
+	add	edx,DWORD [esp]
+	add	eax,esi
+	mov	esi,DWORD [40+esp]
+	mov	ebx,ecx
+	ror	ecx,11
+	mov	edi,esi
+	ror	esi,2
+	xor	ecx,ebx
+	shr	ebx,3
+	ror	ecx,7
+	xor	esi,edi
+	xor	ebx,ecx
+	ror	esi,17
+	add	ebx,DWORD [48+esp]
+	shr	edi,10
+	add	ebx,DWORD [84+esp]
+	mov	ecx,edx
+	xor	edi,esi
+	mov	esi,DWORD [4+esp]
+	ror	edx,14
+	add	ebx,edi
+	mov	edi,DWORD [8+esp]
+	xor	edx,ecx
+	mov	DWORD [48+esp],ebx
+	xor	esi,edi
+	ror	edx,5
+	and	esi,ecx
+	mov	DWORD [esp],ecx
+	xor	edx,ecx
+	add	ebx,DWORD [12+esp]
+	xor	edi,esi
+	ror	edx,6
+	mov	ecx,eax
+	add	ebx,edi
+	ror	ecx,9
+	mov	esi,eax
+	mov	edi,DWORD [20+esp]
+	xor	ecx,eax
+	mov	DWORD [16+esp],eax
+	xor	eax,edi
+	ror	ecx,11
+	and	ebp,eax
+	lea	edx,[958139571+edx*1+ebx]
+	xor	ecx,esi
+	xor	ebp,edi
+	mov	esi,DWORD [56+esp]
+	ror	ecx,2
+	add	ebp,edx
+	add	edx,DWORD [28+esp]
+	add	ebp,ecx
+	mov	ecx,DWORD [44+esp]
+	mov	ebx,esi
+	ror	esi,11
+	mov	edi,ecx
+	ror	ecx,2
+	xor	esi,ebx
+	shr	ebx,3
+	ror	esi,7
+	xor	ecx,edi
+	xor	ebx,esi
+	ror	ecx,17
+	add	ebx,DWORD [52+esp]
+	shr	edi,10
+	add	ebx,DWORD [88+esp]
+	mov	esi,edx
+	xor	edi,ecx
+	mov	ecx,DWORD [esp]
+	ror	edx,14
+	add	ebx,edi
+	mov	edi,DWORD [4+esp]
+	xor	edx,esi
+	mov	DWORD [52+esp],ebx
+	xor	ecx,edi
+	ror	edx,5
+	and	ecx,esi
+	mov	DWORD [28+esp],esi
+	xor	edx,esi
+	add	ebx,DWORD [8+esp]
+	xor	edi,ecx
+	ror	edx,6
+	mov	esi,ebp
+	add	ebx,edi
+	ror	esi,9
+	mov	ecx,ebp
+	mov	edi,DWORD [16+esp]
+	xor	esi,ebp
+	mov	DWORD [12+esp],ebp
+	xor	ebp,edi
+	ror	esi,11
+	and	eax,ebp
+	lea	edx,[1322822218+edx*1+ebx]
+	xor	esi,ecx
+	xor	eax,edi
+	mov	ecx,DWORD [60+esp]
+	ror	esi,2
+	add	eax,edx
+	add	edx,DWORD [24+esp]
+	add	eax,esi
+	mov	esi,DWORD [48+esp]
+	mov	ebx,ecx
+	ror	ecx,11
+	mov	edi,esi
+	ror	esi,2
+	xor	ecx,ebx
+	shr	ebx,3
+	ror	ecx,7
+	xor	esi,edi
+	xor	ebx,ecx
+	ror	esi,17
+	add	ebx,DWORD [56+esp]
+	shr	edi,10
+	add	ebx,DWORD [92+esp]
+	mov	ecx,edx
+	xor	edi,esi
+	mov	esi,DWORD [28+esp]
+	ror	edx,14
+	add	ebx,edi
+	mov	edi,DWORD [esp]
+	xor	edx,ecx
+	mov	DWORD [56+esp],ebx
+	xor	esi,edi
+	ror	edx,5
+	and	esi,ecx
+	mov	DWORD [24+esp],ecx
+	xor	edx,ecx
+	add	ebx,DWORD [4+esp]
+	xor	edi,esi
+	ror	edx,6
+	mov	ecx,eax
+	add	ebx,edi
+	ror	ecx,9
+	mov	esi,eax
+	mov	edi,DWORD [12+esp]
+	xor	ecx,eax
+	mov	DWORD [8+esp],eax
+	xor	eax,edi
+	ror	ecx,11
+	and	ebp,eax
+	lea	edx,[1537002063+edx*1+ebx]
+	xor	ecx,esi
+	xor	ebp,edi
+	mov	esi,DWORD [64+esp]
+	ror	ecx,2
+	add	ebp,edx
+	add	edx,DWORD [20+esp]
+	add	ebp,ecx
+	mov	ecx,DWORD [52+esp]
+	mov	ebx,esi
+	ror	esi,11
+	mov	edi,ecx
+	ror	ecx,2
+	xor	esi,ebx
+	shr	ebx,3
+	ror	esi,7
+	xor	ecx,edi
+	xor	ebx,esi
+	ror	ecx,17
+	add	ebx,DWORD [60+esp]
+	shr	edi,10
+	add	ebx,DWORD [32+esp]
+	mov	esi,edx
+	xor	edi,ecx
+	mov	ecx,DWORD [24+esp]
+	ror	edx,14
+	add	ebx,edi
+	mov	edi,DWORD [28+esp]
+	xor	edx,esi
+	mov	DWORD [60+esp],ebx
+	xor	ecx,edi
+	ror	edx,5
+	and	ecx,esi
+	mov	DWORD [20+esp],esi
+	xor	edx,esi
+	add	ebx,DWORD [esp]
+	xor	edi,ecx
+	ror	edx,6
+	mov	esi,ebp
+	add	ebx,edi
+	ror	esi,9
+	mov	ecx,ebp
+	mov	edi,DWORD [8+esp]
+	xor	esi,ebp
+	mov	DWORD [4+esp],ebp
+	xor	ebp,edi
+	ror	esi,11
+	and	eax,ebp
+	lea	edx,[1747873779+edx*1+ebx]
+	xor	esi,ecx
+	xor	eax,edi
+	mov	ecx,DWORD [68+esp]
+	ror	esi,2
+	add	eax,edx
+	add	edx,DWORD [16+esp]
+	add	eax,esi
+	mov	esi,DWORD [56+esp]
+	mov	ebx,ecx
+	ror	ecx,11
+	mov	edi,esi
+	ror	esi,2
+	xor	ecx,ebx
+	shr	ebx,3
+	ror	ecx,7
+	xor	esi,edi
+	xor	ebx,ecx
+	ror	esi,17
+	add	ebx,DWORD [64+esp]
+	shr	edi,10
+	add	ebx,DWORD [36+esp]
+	mov	ecx,edx
+	xor	edi,esi
+	mov	esi,DWORD [20+esp]
+	ror	edx,14
+	add	ebx,edi
+	mov	edi,DWORD [24+esp]
+	xor	edx,ecx
+	mov	DWORD [64+esp],ebx
+	xor	esi,edi
+	ror	edx,5
+	and	esi,ecx
+	mov	DWORD [16+esp],ecx
+	xor	edx,ecx
+	add	ebx,DWORD [28+esp]
+	xor	edi,esi
+	ror	edx,6
+	mov	ecx,eax
+	add	ebx,edi
+	ror	ecx,9
+	mov	esi,eax
+	mov	edi,DWORD [4+esp]
+	xor	ecx,eax
+	mov	DWORD [esp],eax
+	xor	eax,edi
+	ror	ecx,11
+	and	ebp,eax
+	lea	edx,[1955562222+edx*1+ebx]
+	xor	ecx,esi
+	xor	ebp,edi
+	mov	esi,DWORD [72+esp]
+	ror	ecx,2
+	add	ebp,edx
+	add	edx,DWORD [12+esp]
+	add	ebp,ecx
+	mov	ecx,DWORD [60+esp]
+	mov	ebx,esi
+	ror	esi,11
+	mov	edi,ecx
+	ror	ecx,2
+	xor	esi,ebx
+	shr	ebx,3
+	ror	esi,7
+	xor	ecx,edi
+	xor	ebx,esi
+	ror	ecx,17
+	add	ebx,DWORD [68+esp]
+	shr	edi,10
+	add	ebx,DWORD [40+esp]
+	mov	esi,edx
+	xor	edi,ecx
+	mov	ecx,DWORD [16+esp]
+	ror	edx,14
+	add	ebx,edi
+	mov	edi,DWORD [20+esp]
+	xor	edx,esi
+	mov	DWORD [68+esp],ebx
+	xor	ecx,edi
+	ror	edx,5
+	and	ecx,esi
+	mov	DWORD [12+esp],esi
+	xor	edx,esi
+	add	ebx,DWORD [24+esp]
+	xor	edi,ecx
+	ror	edx,6
+	mov	esi,ebp
+	add	ebx,edi
+	ror	esi,9
+	mov	ecx,ebp
+	mov	edi,DWORD [esp]
+	xor	esi,ebp
+	mov	DWORD [28+esp],ebp
+	xor	ebp,edi
+	ror	esi,11
+	and	eax,ebp
+	lea	edx,[2024104815+edx*1+ebx]
+	xor	esi,ecx
+	xor	eax,edi
+	mov	ecx,DWORD [76+esp]
+	ror	esi,2
+	add	eax,edx
+	add	edx,DWORD [8+esp]
+	add	eax,esi
+	mov	esi,DWORD [64+esp]
+	mov	ebx,ecx
+	ror	ecx,11
+	mov	edi,esi
+	ror	esi,2
+	xor	ecx,ebx
+	shr	ebx,3
+	ror	ecx,7
+	xor	esi,edi
+	xor	ebx,ecx
+	ror	esi,17
+	add	ebx,DWORD [72+esp]
+	shr	edi,10
+	add	ebx,DWORD [44+esp]
+	mov	ecx,edx
+	xor	edi,esi
+	mov	esi,DWORD [12+esp]
+	ror	edx,14
+	add	ebx,edi
+	mov	edi,DWORD [16+esp]
+	xor	edx,ecx
+	mov	DWORD [72+esp],ebx
+	xor	esi,edi
+	ror	edx,5
+	and	esi,ecx
+	mov	DWORD [8+esp],ecx
+	xor	edx,ecx
+	add	ebx,DWORD [20+esp]
+	xor	edi,esi
+	ror	edx,6
+	mov	ecx,eax
+	add	ebx,edi
+	ror	ecx,9
+	mov	esi,eax
+	mov	edi,DWORD [28+esp]
+	xor	ecx,eax
+	mov	DWORD [24+esp],eax
+	xor	eax,edi
+	ror	ecx,11
+	and	ebp,eax
+	lea	edx,[2227730452+edx*1+ebx]
+	xor	ecx,esi
+	xor	ebp,edi
+	mov	esi,DWORD [80+esp]
+	ror	ecx,2
+	add	ebp,edx
+	add	edx,DWORD [4+esp]
+	add	ebp,ecx
+	mov	ecx,DWORD [68+esp]
+	mov	ebx,esi
+	ror	esi,11
+	mov	edi,ecx
+	ror	ecx,2
+	xor	esi,ebx
+	shr	ebx,3
+	ror	esi,7
+	xor	ecx,edi
+	xor	ebx,esi
+	ror	ecx,17
+	add	ebx,DWORD [76+esp]
+	shr	edi,10
+	add	ebx,DWORD [48+esp]
+	mov	esi,edx
+	xor	edi,ecx
+	mov	ecx,DWORD [8+esp]
+	ror	edx,14
+	add	ebx,edi
+	mov	edi,DWORD [12+esp]
+	xor	edx,esi
+	mov	DWORD [76+esp],ebx
+	xor	ecx,edi
+	ror	edx,5
+	and	ecx,esi
+	mov	DWORD [4+esp],esi
+	xor	edx,esi
+	add	ebx,DWORD [16+esp]
+	xor	edi,ecx
+	ror	edx,6
+	mov	esi,ebp
+	add	ebx,edi
+	ror	esi,9
+	mov	ecx,ebp
+	mov	edi,DWORD [24+esp]
+	xor	esi,ebp
+	mov	DWORD [20+esp],ebp
+	xor	ebp,edi
+	ror	esi,11
+	and	eax,ebp
+	lea	edx,[2361852424+edx*1+ebx]
+	xor	esi,ecx
+	xor	eax,edi
+	mov	ecx,DWORD [84+esp]
+	ror	esi,2
+	add	eax,edx
+	add	edx,DWORD [esp]
+	add	eax,esi
+	mov	esi,DWORD [72+esp]
+	mov	ebx,ecx
+	ror	ecx,11
+	mov	edi,esi
+	ror	esi,2
+	xor	ecx,ebx
+	shr	ebx,3
+	ror	ecx,7
+	xor	esi,edi
+	xor	ebx,ecx
+	ror	esi,17
+	add	ebx,DWORD [80+esp]
+	shr	edi,10
+	add	ebx,DWORD [52+esp]
+	mov	ecx,edx
+	xor	edi,esi
+	mov	esi,DWORD [4+esp]
+	ror	edx,14
+	add	ebx,edi
+	mov	edi,DWORD [8+esp]
+	xor	edx,ecx
+	mov	DWORD [80+esp],ebx
+	xor	esi,edi
+	ror	edx,5
+	and	esi,ecx
+	mov	DWORD [esp],ecx
+	xor	edx,ecx
+	add	ebx,DWORD [12+esp]
+	xor	edi,esi
+	ror	edx,6
+	mov	ecx,eax
+	add	ebx,edi
+	ror	ecx,9
+	mov	esi,eax
+	mov	edi,DWORD [20+esp]
+	xor	ecx,eax
+	mov	DWORD [16+esp],eax
+	xor	eax,edi
+	ror	ecx,11
+	and	ebp,eax
+	lea	edx,[2428436474+edx*1+ebx]
+	xor	ecx,esi
+	xor	ebp,edi
+	mov	esi,DWORD [88+esp]
+	ror	ecx,2
+	add	ebp,edx
+	add	edx,DWORD [28+esp]
+	add	ebp,ecx
+	mov	ecx,DWORD [76+esp]
+	mov	ebx,esi
+	ror	esi,11
+	mov	edi,ecx
+	ror	ecx,2
+	xor	esi,ebx
+	shr	ebx,3
+	ror	esi,7
+	xor	ecx,edi
+	xor	ebx,esi
+	ror	ecx,17
+	add	ebx,DWORD [84+esp]
+	shr	edi,10
+	add	ebx,DWORD [56+esp]
+	mov	esi,edx
+	xor	edi,ecx
+	mov	ecx,DWORD [esp]
+	ror	edx,14
+	add	ebx,edi
+	mov	edi,DWORD [4+esp]
+	xor	edx,esi
+	mov	DWORD [84+esp],ebx
+	xor	ecx,edi
+	ror	edx,5
+	and	ecx,esi
+	mov	DWORD [28+esp],esi
+	xor	edx,esi
+	add	ebx,DWORD [8+esp]
+	xor	edi,ecx
+	ror	edx,6
+	mov	esi,ebp
+	add	ebx,edi
+	ror	esi,9
+	mov	ecx,ebp
+	mov	edi,DWORD [16+esp]
+	xor	esi,ebp
+	mov	DWORD [12+esp],ebp
+	xor	ebp,edi
+	ror	esi,11
+	and	eax,ebp
+	lea	edx,[2756734187+edx*1+ebx]
+	xor	esi,ecx
+	xor	eax,edi
+	mov	ecx,DWORD [92+esp]
+	ror	esi,2
+	add	eax,edx
+	add	edx,DWORD [24+esp]
+	add	eax,esi
+	mov	esi,DWORD [80+esp]
+	mov	ebx,ecx
+	ror	ecx,11
+	mov	edi,esi
+	ror	esi,2
+	xor	ecx,ebx
+	shr	ebx,3
+	ror	ecx,7
+	xor	esi,edi
+	xor	ebx,ecx
+	ror	esi,17
+	add	ebx,DWORD [88+esp]
+	shr	edi,10
+	add	ebx,DWORD [60+esp]
+	mov	ecx,edx
+	xor	edi,esi
+	mov	esi,DWORD [28+esp]
+	ror	edx,14
+	add	ebx,edi
+	mov	edi,DWORD [esp]
+	xor	edx,ecx
+	xor	esi,edi
+	ror	edx,5
+	and	esi,ecx
+	mov	DWORD [24+esp],ecx
+	xor	edx,ecx
+	add	ebx,DWORD [4+esp]
+	xor	edi,esi
+	ror	edx,6
+	mov	ecx,eax
+	add	ebx,edi
+	ror	ecx,9
+	mov	esi,eax
+	mov	edi,DWORD [12+esp]
+	xor	ecx,eax
+	mov	DWORD [8+esp],eax
+	xor	eax,edi
+	ror	ecx,11
+	and	ebp,eax
+	lea	edx,[3204031479+edx*1+ebx]
+	xor	ecx,esi
+	xor	ebp,edi
+	mov	esi,DWORD [32+esp]
+	ror	ecx,2
+	add	ebp,edx
+	add	edx,DWORD [20+esp]
+	add	ebp,ecx
+	mov	ecx,DWORD [84+esp]
+	mov	ebx,esi
+	ror	esi,11
+	mov	edi,ecx
+	ror	ecx,2
+	xor	esi,ebx
+	shr	ebx,3
+	ror	esi,7
+	xor	ecx,edi
+	xor	ebx,esi
+	ror	ecx,17
+	add	ebx,DWORD [92+esp]
+	shr	edi,10
+	add	ebx,DWORD [64+esp]
+	mov	esi,edx
+	xor	edi,ecx
+	mov	ecx,DWORD [24+esp]
+	ror	edx,14
+	add	ebx,edi
+	mov	edi,DWORD [28+esp]
+	xor	edx,esi
+	xor	ecx,edi
+	ror	edx,5
+	and	ecx,esi
+	mov	DWORD [20+esp],esi
+	xor	edx,esi
+	add	ebx,DWORD [esp]
+	xor	edi,ecx
+	ror	edx,6
+	mov	esi,ebp
+	add	ebx,edi
+	ror	esi,9
+	mov	ecx,ebp
+	mov	edi,DWORD [8+esp]
+	xor	esi,ebp
+	mov	DWORD [4+esp],ebp
+	xor	ebp,edi
+	ror	esi,11
+	and	eax,ebp
+	lea	edx,[3329325298+edx*1+ebx]
+	xor	esi,ecx
+	xor	eax,edi
+	ror	esi,2
+	add	eax,edx
+	add	edx,DWORD [16+esp]
+	add	eax,esi
+	mov	esi,DWORD [96+esp]
+	xor	ebp,edi
+	mov	ecx,DWORD [12+esp]
+	add	eax,DWORD [esi]
+	add	ebp,DWORD [4+esi]
+	add	edi,DWORD [8+esi]
+	add	ecx,DWORD [12+esi]
+	mov	DWORD [esi],eax
+	mov	DWORD [4+esi],ebp
+	mov	DWORD [8+esi],edi
+	mov	DWORD [12+esi],ecx
+	mov	DWORD [4+esp],ebp
+	xor	ebp,edi
+	mov	DWORD [8+esp],edi
+	mov	DWORD [12+esp],ecx
+	mov	edi,DWORD [20+esp]
+	mov	ebx,DWORD [24+esp]
+	mov	ecx,DWORD [28+esp]
+	add	edx,DWORD [16+esi]
+	add	edi,DWORD [20+esi]
+	add	ebx,DWORD [24+esi]
+	add	ecx,DWORD [28+esi]
+	mov	DWORD [16+esi],edx
+	mov	DWORD [20+esi],edi
+	mov	DWORD [24+esi],ebx
+	mov	DWORD [28+esi],ecx
+	mov	DWORD [20+esp],edi
+	mov	edi,DWORD [100+esp]
+	mov	DWORD [24+esp],ebx
+	mov	DWORD [28+esp],ecx
+	cmp	edi,DWORD [104+esp]
+	jb	NEAR L$009grand_loop
+	mov	esp,DWORD [108+esp]
+	pop	edi
+	pop	esi
+	pop	ebx
+	pop	ebp
+	ret
+align	32
+L$004shaext:
+	sub	esp,32
+	movdqu	xmm1,[esi]
+	lea	ebp,[128+ebp]
+	movdqu	xmm2,[16+esi]
+	movdqa	xmm7,[128+ebp]
+	pshufd	xmm0,xmm1,27
+	pshufd	xmm1,xmm1,177
+	pshufd	xmm2,xmm2,27
+db	102,15,58,15,202,8
+	punpcklqdq	xmm2,xmm0
+	jmp	NEAR L$010loop_shaext
+align	16
+L$010loop_shaext:
+	movdqu	xmm3,[edi]
+	movdqu	xmm4,[16+edi]
+	movdqu	xmm5,[32+edi]
+db	102,15,56,0,223
+	movdqu	xmm6,[48+edi]
+	movdqa	[16+esp],xmm2
+	movdqa	xmm0,[ebp-128]
+	paddd	xmm0,xmm3
+db	102,15,56,0,231
+db	15,56,203,209
+	pshufd	xmm0,xmm0,14
+	nop
+	movdqa	[esp],xmm1
+db	15,56,203,202
+	movdqa	xmm0,[ebp-112]
+	paddd	xmm0,xmm4
+db	102,15,56,0,239
+db	15,56,203,209
+	pshufd	xmm0,xmm0,14
+	lea	edi,[64+edi]
+db	15,56,204,220
+db	15,56,203,202
+	movdqa	xmm0,[ebp-96]
+	paddd	xmm0,xmm5
+db	102,15,56,0,247
+db	15,56,203,209
+	pshufd	xmm0,xmm0,14
+	movdqa	xmm7,xmm6
+db	102,15,58,15,253,4
+	nop
+	paddd	xmm3,xmm7
+db	15,56,204,229
+db	15,56,203,202
+	movdqa	xmm0,[ebp-80]
+	paddd	xmm0,xmm6
+db	15,56,205,222
+db	15,56,203,209
+	pshufd	xmm0,xmm0,14
+	movdqa	xmm7,xmm3
+db	102,15,58,15,254,4
+	nop
+	paddd	xmm4,xmm7
+db	15,56,204,238
+db	15,56,203,202
+	movdqa	xmm0,[ebp-64]
+	paddd	xmm0,xmm3
+db	15,56,205,227
+db	15,56,203,209
+	pshufd	xmm0,xmm0,14
+	movdqa	xmm7,xmm4
+db	102,15,58,15,251,4
+	nop
+	paddd	xmm5,xmm7
+db	15,56,204,243
+db	15,56,203,202
+	movdqa	xmm0,[ebp-48]
+	paddd	xmm0,xmm4
+db	15,56,205,236
+db	15,56,203,209
+	pshufd	xmm0,xmm0,14
+	movdqa	xmm7,xmm5
+db	102,15,58,15,252,4
+	nop
+	paddd	xmm6,xmm7
+db	15,56,204,220
+db	15,56,203,202
+	movdqa	xmm0,[ebp-32]
+	paddd	xmm0,xmm5
+db	15,56,205,245
+db	15,56,203,209
+	pshufd	xmm0,xmm0,14
+	movdqa	xmm7,xmm6
+db	102,15,58,15,253,4
+	nop
+	paddd	xmm3,xmm7
+db	15,56,204,229
+db	15,56,203,202
+	movdqa	xmm0,[ebp-16]
+	paddd	xmm0,xmm6
+db	15,56,205,222
+db	15,56,203,209
+	pshufd	xmm0,xmm0,14
+	movdqa	xmm7,xmm3
+db	102,15,58,15,254,4
+	nop
+	paddd	xmm4,xmm7
+db	15,56,204,238
+db	15,56,203,202
+	movdqa	xmm0,[ebp]
+	paddd	xmm0,xmm3
+db	15,56,205,227
+db	15,56,203,209
+	pshufd	xmm0,xmm0,14
+	movdqa	xmm7,xmm4
+db	102,15,58,15,251,4
+	nop
+	paddd	xmm5,xmm7
+db	15,56,204,243
+db	15,56,203,202
+	movdqa	xmm0,[16+ebp]
+	paddd	xmm0,xmm4
+db	15,56,205,236
+db	15,56,203,209
+	pshufd	xmm0,xmm0,14
+	movdqa	xmm7,xmm5
+db	102,15,58,15,252,4
+	nop
+	paddd	xmm6,xmm7
+db	15,56,204,220
+db	15,56,203,202
+	movdqa	xmm0,[32+ebp]
+	paddd	xmm0,xmm5
+db	15,56,205,245
+db	15,56,203,209
+	pshufd	xmm0,xmm0,14
+	movdqa	xmm7,xmm6
+db	102,15,58,15,253,4
+	nop
+	paddd	xmm3,xmm7
+db	15,56,204,229
+db	15,56,203,202
+	movdqa	xmm0,[48+ebp]
+	paddd	xmm0,xmm6
+db	15,56,205,222
+db	15,56,203,209
+	pshufd	xmm0,xmm0,14
+	movdqa	xmm7,xmm3
+db	102,15,58,15,254,4
+	nop
+	paddd	xmm4,xmm7
+db	15,56,204,238
+db	15,56,203,202
+	movdqa	xmm0,[64+ebp]
+	paddd	xmm0,xmm3
+db	15,56,205,227
+db	15,56,203,209
+	pshufd	xmm0,xmm0,14
+	movdqa	xmm7,xmm4
+db	102,15,58,15,251,4
+	nop
+	paddd	xmm5,xmm7
+db	15,56,204,243
+db	15,56,203,202
+	movdqa	xmm0,[80+ebp]
+	paddd	xmm0,xmm4
+db	15,56,205,236
+db	15,56,203,209
+	pshufd	xmm0,xmm0,14
+	movdqa	xmm7,xmm5
+db	102,15,58,15,252,4
+db	15,56,203,202
+	paddd	xmm6,xmm7
+	movdqa	xmm0,[96+ebp]
+	paddd	xmm0,xmm5
+db	15,56,203,209
+	pshufd	xmm0,xmm0,14
+db	15,56,205,245
+	movdqa	xmm7,[128+ebp]
+db	15,56,203,202
+	movdqa	xmm0,[112+ebp]
+	paddd	xmm0,xmm6
+	nop
+db	15,56,203,209
+	pshufd	xmm0,xmm0,14
+	cmp	eax,edi
+	nop
+db	15,56,203,202
+	paddd	xmm2,[16+esp]
+	paddd	xmm1,[esp]
+	jnz	NEAR L$010loop_shaext
+	pshufd	xmm2,xmm2,177
+	pshufd	xmm7,xmm1,27
+	pshufd	xmm1,xmm1,177
+	punpckhqdq	xmm1,xmm2
+db	102,15,58,15,215,8
+	mov	esp,DWORD [44+esp]
+	movdqu	[esi],xmm1
+	movdqu	[16+esi],xmm2
+	pop	edi
+	pop	esi
+	pop	ebx
+	pop	ebp
+	ret
+align	32
+L$005SSSE3:
+	lea	esp,[esp-96]
+	mov	eax,DWORD [esi]
+	mov	ebx,DWORD [4+esi]
+	mov	ecx,DWORD [8+esi]
+	mov	edi,DWORD [12+esi]
+	mov	DWORD [4+esp],ebx
+	xor	ebx,ecx
+	mov	DWORD [8+esp],ecx
+	mov	DWORD [12+esp],edi
+	mov	edx,DWORD [16+esi]
+	mov	edi,DWORD [20+esi]
+	mov	ecx,DWORD [24+esi]
+	mov	esi,DWORD [28+esi]
+	mov	DWORD [20+esp],edi
+	mov	edi,DWORD [100+esp]
+	mov	DWORD [24+esp],ecx
+	mov	DWORD [28+esp],esi
+	movdqa	xmm7,[256+ebp]
+	jmp	NEAR L$011grand_ssse3
+align	16
+L$011grand_ssse3:
+	movdqu	xmm0,[edi]
+	movdqu	xmm1,[16+edi]
+	movdqu	xmm2,[32+edi]
+	movdqu	xmm3,[48+edi]
+	add	edi,64
+db	102,15,56,0,199
+	mov	DWORD [100+esp],edi
+db	102,15,56,0,207
+	movdqa	xmm4,[ebp]
+db	102,15,56,0,215
+	movdqa	xmm5,[16+ebp]
+	paddd	xmm4,xmm0
+db	102,15,56,0,223
+	movdqa	xmm6,[32+ebp]
+	paddd	xmm5,xmm1
+	movdqa	xmm7,[48+ebp]
+	movdqa	[32+esp],xmm4
+	paddd	xmm6,xmm2
+	movdqa	[48+esp],xmm5
+	paddd	xmm7,xmm3
+	movdqa	[64+esp],xmm6
+	movdqa	[80+esp],xmm7
+	jmp	NEAR L$012ssse3_00_47
+align	16
+L$012ssse3_00_47:
+	add	ebp,64
+	mov	ecx,edx
+	movdqa	xmm4,xmm1
+	ror	edx,14
+	mov	esi,DWORD [20+esp]
+	movdqa	xmm7,xmm3
+	xor	edx,ecx
+	mov	edi,DWORD [24+esp]
+db	102,15,58,15,224,4
+	xor	esi,edi
+	ror	edx,5
+	and	esi,ecx
+db	102,15,58,15,250,4
+	mov	DWORD [16+esp],ecx
+	xor	edx,ecx
+	xor	edi,esi
+	movdqa	xmm5,xmm4
+	ror	edx,6
+	mov	ecx,eax
+	movdqa	xmm6,xmm4
+	add	edx,edi
+	mov	edi,DWORD [4+esp]
+	psrld	xmm4,3
+	mov	esi,eax
+	ror	ecx,9
+	paddd	xmm0,xmm7
+	mov	DWORD [esp],eax
+	xor	ecx,eax
+	psrld	xmm6,7
+	xor	eax,edi
+	add	edx,DWORD [28+esp]
+	ror	ecx,11
+	and	ebx,eax
+	pshufd	xmm7,xmm3,250
+	xor	ecx,esi
+	add	edx,DWORD [32+esp]
+	pslld	xmm5,14
+	xor	ebx,edi
+	ror	ecx,2
+	pxor	xmm4,xmm6
+	add	ebx,edx
+	add	edx,DWORD [12+esp]
+	psrld	xmm6,11
+	add	ebx,ecx
+	mov	ecx,edx
+	ror	edx,14
+	pxor	xmm4,xmm5
+	mov	esi,DWORD [16+esp]
+	xor	edx,ecx
+	pslld	xmm5,11
+	mov	edi,DWORD [20+esp]
+	xor	esi,edi
+	ror	edx,5
+	pxor	xmm4,xmm6
+	and	esi,ecx
+	mov	DWORD [12+esp],ecx
+	movdqa	xmm6,xmm7
+	xor	edx,ecx
+	xor	edi,esi
+	ror	edx,6
+	pxor	xmm4,xmm5
+	mov	ecx,ebx
+	add	edx,edi
+	psrld	xmm7,10
+	mov	edi,DWORD [esp]
+	mov	esi,ebx
+	ror	ecx,9
+	paddd	xmm0,xmm4
+	mov	DWORD [28+esp],ebx
+	xor	ecx,ebx
+	psrlq	xmm6,17
+	xor	ebx,edi
+	add	edx,DWORD [24+esp]
+	ror	ecx,11
+	pxor	xmm7,xmm6
+	and	eax,ebx
+	xor	ecx,esi
+	psrlq	xmm6,2
+	add	edx,DWORD [36+esp]
+	xor	eax,edi
+	ror	ecx,2
+	pxor	xmm7,xmm6
+	add	eax,edx
+	add	edx,DWORD [8+esp]
+	pshufd	xmm7,xmm7,128
+	add	eax,ecx
+	mov	ecx,edx
+	ror	edx,14
+	mov	esi,DWORD [12+esp]
+	xor	edx,ecx
+	mov	edi,DWORD [16+esp]
+	xor	esi,edi
+	ror	edx,5
+	and	esi,ecx
+	psrldq	xmm7,8
+	mov	DWORD [8+esp],ecx
+	xor	edx,ecx
+	xor	edi,esi
+	paddd	xmm0,xmm7
+	ror	edx,6
+	mov	ecx,eax
+	add	edx,edi
+	mov	edi,DWORD [28+esp]
+	mov	esi,eax
+	ror	ecx,9
+	mov	DWORD [24+esp],eax
+	pshufd	xmm7,xmm0,80
+	xor	ecx,eax
+	xor	eax,edi
+	add	edx,DWORD [20+esp]
+	movdqa	xmm6,xmm7
+	ror	ecx,11
+	psrld	xmm7,10
+	and	ebx,eax
+	psrlq	xmm6,17
+	xor	ecx,esi
+	add	edx,DWORD [40+esp]
+	xor	ebx,edi
+	ror	ecx,2
+	pxor	xmm7,xmm6
+	add	ebx,edx
+	add	edx,DWORD [4+esp]
+	psrlq	xmm6,2
+	add	ebx,ecx
+	mov	ecx,edx
+	ror	edx,14
+	pxor	xmm7,xmm6
+	mov	esi,DWORD [8+esp]
+	xor	edx,ecx
+	mov	edi,DWORD [12+esp]
+	pshufd	xmm7,xmm7,8
+	xor	esi,edi
+	ror	edx,5
+	movdqa	xmm6,[ebp]
+	and	esi,ecx
+	mov	DWORD [4+esp],ecx
+	pslldq	xmm7,8
+	xor	edx,ecx
+	xor	edi,esi
+	ror	edx,6
+	mov	ecx,ebx
+	add	edx,edi
+	mov	edi,DWORD [24+esp]
+	mov	esi,ebx
+	ror	ecx,9
+	paddd	xmm0,xmm7
+	mov	DWORD [20+esp],ebx
+	xor	ecx,ebx
+	xor	ebx,edi
+	add	edx,DWORD [16+esp]
+	paddd	xmm6,xmm0
+	ror	ecx,11
+	and	eax,ebx
+	xor	ecx,esi
+	add	edx,DWORD [44+esp]
+	xor	eax,edi
+	ror	ecx,2
+	add	eax,edx
+	add	edx,DWORD [esp]
+	add	eax,ecx
+	movdqa	[32+esp],xmm6
+	mov	ecx,edx
+	movdqa	xmm4,xmm2
+	ror	edx,14
+	mov	esi,DWORD [4+esp]
+	movdqa	xmm7,xmm0
+	xor	edx,ecx
+	mov	edi,DWORD [8+esp]
+db	102,15,58,15,225,4
+	xor	esi,edi
+	ror	edx,5
+	and	esi,ecx
+db	102,15,58,15,251,4
+	mov	DWORD [esp],ecx
+	xor	edx,ecx
+	xor	edi,esi
+	movdqa	xmm5,xmm4
+	ror	edx,6
+	mov	ecx,eax
+	movdqa	xmm6,xmm4
+	add	edx,edi
+	mov	edi,DWORD [20+esp]
+	psrld	xmm4,3
+	mov	esi,eax
+	ror	ecx,9
+	paddd	xmm1,xmm7
+	mov	DWORD [16+esp],eax
+	xor	ecx,eax
+	psrld	xmm6,7
+	xor	eax,edi
+	add	edx,DWORD [12+esp]
+	ror	ecx,11
+	and	ebx,eax
+	pshufd	xmm7,xmm0,250
+	xor	ecx,esi
+	add	edx,DWORD [48+esp]
+	pslld	xmm5,14
+	xor	ebx,edi
+	ror	ecx,2
+	pxor	xmm4,xmm6
+	add	ebx,edx
+	add	edx,DWORD [28+esp]
+	psrld	xmm6,11
+	add	ebx,ecx
+	mov	ecx,edx
+	ror	edx,14
+	pxor	xmm4,xmm5
+	mov	esi,DWORD [esp]
+	xor	edx,ecx
+	pslld	xmm5,11
+	mov	edi,DWORD [4+esp]
+	xor	esi,edi
+	ror	edx,5
+	pxor	xmm4,xmm6
+	and	esi,ecx
+	mov	DWORD [28+esp],ecx
+	movdqa	xmm6,xmm7
+	xor	edx,ecx
+	xor	edi,esi
+	ror	edx,6
+	pxor	xmm4,xmm5
+	mov	ecx,ebx
+	add	edx,edi
+	psrld	xmm7,10
+	mov	edi,DWORD [16+esp]
+	mov	esi,ebx
+	ror	ecx,9
+	paddd	xmm1,xmm4
+	mov	DWORD [12+esp],ebx
+	xor	ecx,ebx
+	psrlq	xmm6,17
+	xor	ebx,edi
+	add	edx,DWORD [8+esp]
+	ror	ecx,11
+	pxor	xmm7,xmm6
+	and	eax,ebx
+	xor	ecx,esi
+	psrlq	xmm6,2
+	add	edx,DWORD [52+esp]
+	xor	eax,edi
+	ror	ecx,2
+	pxor	xmm7,xmm6
+	add	eax,edx
+	add	edx,DWORD [24+esp]
+	pshufd	xmm7,xmm7,128
+	add	eax,ecx
+	mov	ecx,edx
+	ror	edx,14
+	mov	esi,DWORD [28+esp]
+	xor	edx,ecx
+	mov	edi,DWORD [esp]
+	xor	esi,edi
+	ror	edx,5
+	and	esi,ecx
+	psrldq	xmm7,8
+	mov	DWORD [24+esp],ecx
+	xor	edx,ecx
+	xor	edi,esi
+	paddd	xmm1,xmm7
+	ror	edx,6
+	mov	ecx,eax
+	add	edx,edi
+	mov	edi,DWORD [12+esp]
+	mov	esi,eax
+	ror	ecx,9
+	mov	DWORD [8+esp],eax
+	pshufd	xmm7,xmm1,80
+	xor	ecx,eax
+	xor	eax,edi
+	add	edx,DWORD [4+esp]
+	movdqa	xmm6,xmm7
+	ror	ecx,11
+	psrld	xmm7,10
+	and	ebx,eax
+	psrlq	xmm6,17
+	xor	ecx,esi
+	add	edx,DWORD [56+esp]
+	xor	ebx,edi
+	ror	ecx,2
+	pxor	xmm7,xmm6
+	add	ebx,edx
+	add	edx,DWORD [20+esp]
+	psrlq	xmm6,2
+	add	ebx,ecx
+	mov	ecx,edx
+	ror	edx,14
+	pxor	xmm7,xmm6
+	mov	esi,DWORD [24+esp]
+	xor	edx,ecx
+	mov	edi,DWORD [28+esp]
+	pshufd	xmm7,xmm7,8
+	xor	esi,edi
+	ror	edx,5
+	movdqa	xmm6,[16+ebp]
+	and	esi,ecx
+	mov	DWORD [20+esp],ecx
+	pslldq	xmm7,8
+	xor	edx,ecx
+	xor	edi,esi
+	ror	edx,6
+	mov	ecx,ebx
+	add	edx,edi
+	mov	edi,DWORD [8+esp]
+	mov	esi,ebx
+	ror	ecx,9
+	paddd	xmm1,xmm7
+	mov	DWORD [4+esp],ebx
+	xor	ecx,ebx
+	xor	ebx,edi
+	add	edx,DWORD [esp]
+	paddd	xmm6,xmm1
+	ror	ecx,11
+	and	eax,ebx
+	xor	ecx,esi
+	add	edx,DWORD [60+esp]
+	xor	eax,edi
+	ror	ecx,2
+	add	eax,edx
+	add	edx,DWORD [16+esp]
+	add	eax,ecx
+	movdqa	[48+esp],xmm6
+	mov	ecx,edx
+	movdqa	xmm4,xmm3
+	ror	edx,14
+	mov	esi,DWORD [20+esp]
+	movdqa	xmm7,xmm1
+	xor	edx,ecx
+	mov	edi,DWORD [24+esp]
+db	102,15,58,15,226,4
+	xor	esi,edi
+	ror	edx,5
+	and	esi,ecx
+db	102,15,58,15,248,4
+	mov	DWORD [16+esp],ecx
+	xor	edx,ecx
+	xor	edi,esi
+	movdqa	xmm5,xmm4
+	ror	edx,6
+	mov	ecx,eax
+	movdqa	xmm6,xmm4
+	add	edx,edi
+	mov	edi,DWORD [4+esp]
+	psrld	xmm4,3
+	mov	esi,eax
+	ror	ecx,9
+	paddd	xmm2,xmm7
+	mov	DWORD [esp],eax
+	xor	ecx,eax
+	psrld	xmm6,7
+	xor	eax,edi
+	add	edx,DWORD [28+esp]
+	ror	ecx,11
+	and	ebx,eax
+	pshufd	xmm7,xmm1,250
+	xor	ecx,esi
+	add	edx,DWORD [64+esp]
+	pslld	xmm5,14
+	xor	ebx,edi
+	ror	ecx,2
+	pxor	xmm4,xmm6
+	add	ebx,edx
+	add	edx,DWORD [12+esp]
+	psrld	xmm6,11
+	add	ebx,ecx
+	mov	ecx,edx
+	ror	edx,14
+	pxor	xmm4,xmm5
+	mov	esi,DWORD [16+esp]
+	xor	edx,ecx
+	pslld	xmm5,11
+	mov	edi,DWORD [20+esp]
+	xor	esi,edi
+	ror	edx,5
+	pxor	xmm4,xmm6
+	and	esi,ecx
+	mov	DWORD [12+esp],ecx
+	movdqa	xmm6,xmm7
+	xor	edx,ecx
+	xor	edi,esi
+	ror	edx,6
+	pxor	xmm4,xmm5
+	mov	ecx,ebx
+	add	edx,edi
+	psrld	xmm7,10
+	mov	edi,DWORD [esp]
+	mov	esi,ebx
+	ror	ecx,9
+	paddd	xmm2,xmm4
+	mov	DWORD [28+esp],ebx
+	xor	ecx,ebx
+	psrlq	xmm6,17
+	xor	ebx,edi
+	add	edx,DWORD [24+esp]
+	ror	ecx,11
+	pxor	xmm7,xmm6
+	and	eax,ebx
+	xor	ecx,esi
+	psrlq	xmm6,2
+	add	edx,DWORD [68+esp]
+	xor	eax,edi
+	ror	ecx,2
+	pxor	xmm7,xmm6
+	add	eax,edx
+	add	edx,DWORD [8+esp]
+	pshufd	xmm7,xmm7,128
+	add	eax,ecx
+	mov	ecx,edx
+	ror	edx,14
+	mov	esi,DWORD [12+esp]
+	xor	edx,ecx
+	mov	edi,DWORD [16+esp]
+	xor	esi,edi
+	ror	edx,5
+	and	esi,ecx
+	psrldq	xmm7,8
+	mov	DWORD [8+esp],ecx
+	xor	edx,ecx
+	xor	edi,esi
+	paddd	xmm2,xmm7
+	ror	edx,6
+	mov	ecx,eax
+	add	edx,edi
+	mov	edi,DWORD [28+esp]
+	mov	esi,eax
+	ror	ecx,9
+	mov	DWORD [24+esp],eax
+	pshufd	xmm7,xmm2,80
+	xor	ecx,eax
+	xor	eax,edi
+	add	edx,DWORD [20+esp]
+	movdqa	xmm6,xmm7
+	ror	ecx,11
+	psrld	xmm7,10
+	and	ebx,eax
+	psrlq	xmm6,17
+	xor	ecx,esi
+	add	edx,DWORD [72+esp]
+	xor	ebx,edi
+	ror	ecx,2
+	pxor	xmm7,xmm6
+	add	ebx,edx
+	add	edx,DWORD [4+esp]
+	psrlq	xmm6,2
+	add	ebx,ecx
+	mov	ecx,edx
+	ror	edx,14
+	pxor	xmm7,xmm6
+	mov	esi,DWORD [8+esp]
+	xor	edx,ecx
+	mov	edi,DWORD [12+esp]
+	pshufd	xmm7,xmm7,8
+	xor	esi,edi
+	ror	edx,5
+	movdqa	xmm6,[32+ebp]
+	and	esi,ecx
+	mov	DWORD [4+esp],ecx
+	pslldq	xmm7,8
+	xor	edx,ecx
+	xor	edi,esi
+	ror	edx,6
+	mov	ecx,ebx
+	add	edx,edi
+	mov	edi,DWORD [24+esp]
+	mov	esi,ebx
+	ror	ecx,9
+	paddd	xmm2,xmm7
+	mov	DWORD [20+esp],ebx
+	xor	ecx,ebx
+	xor	ebx,edi
+	add	edx,DWORD [16+esp]
+	paddd	xmm6,xmm2
+	ror	ecx,11
+	and	eax,ebx
+	xor	ecx,esi
+	add	edx,DWORD [76+esp]
+	xor	eax,edi
+	ror	ecx,2
+	add	eax,edx
+	add	edx,DWORD [esp]
+	add	eax,ecx
+	movdqa	[64+esp],xmm6
+	mov	ecx,edx
+	movdqa	xmm4,xmm0
+	ror	edx,14
+	mov	esi,DWORD [4+esp]
+	movdqa	xmm7,xmm2
+	xor	edx,ecx
+	mov	edi,DWORD [8+esp]
+db	102,15,58,15,227,4
+	xor	esi,edi
+	ror	edx,5
+	and	esi,ecx
+db	102,15,58,15,249,4
+	mov	DWORD [esp],ecx
+	xor	edx,ecx
+	xor	edi,esi
+	movdqa	xmm5,xmm4
+	ror	edx,6
+	mov	ecx,eax
+	movdqa	xmm6,xmm4
+	add	edx,edi
+	mov	edi,DWORD [20+esp]
+	psrld	xmm4,3
+	mov	esi,eax
+	ror	ecx,9
+	paddd	xmm3,xmm7
+	mov	DWORD [16+esp],eax
+	xor	ecx,eax
+	psrld	xmm6,7
+	xor	eax,edi
+	add	edx,DWORD [12+esp]
+	ror	ecx,11
+	and	ebx,eax
+	pshufd	xmm7,xmm2,250
+	xor	ecx,esi
+	add	edx,DWORD [80+esp]
+	pslld	xmm5,14
+	xor	ebx,edi
+	ror	ecx,2
+	pxor	xmm4,xmm6
+	add	ebx,edx
+	add	edx,DWORD [28+esp]
+	psrld	xmm6,11
+	add	ebx,ecx
+	mov	ecx,edx
+	ror	edx,14
+	pxor	xmm4,xmm5
+	mov	esi,DWORD [esp]
+	xor	edx,ecx
+	pslld	xmm5,11
+	mov	edi,DWORD [4+esp]
+	xor	esi,edi
+	ror	edx,5
+	pxor	xmm4,xmm6
+	and	esi,ecx
+	mov	DWORD [28+esp],ecx
+	movdqa	xmm6,xmm7
+	xor	edx,ecx
+	xor	edi,esi
+	ror	edx,6
+	pxor	xmm4,xmm5
+	mov	ecx,ebx
+	add	edx,edi
+	psrld	xmm7,10
+	mov	edi,DWORD [16+esp]
+	mov	esi,ebx
+	ror	ecx,9
+	paddd	xmm3,xmm4
+	mov	DWORD [12+esp],ebx
+	xor	ecx,ebx
+	psrlq	xmm6,17
+	xor	ebx,edi
+	add	edx,DWORD [8+esp]
+	ror	ecx,11
+	pxor	xmm7,xmm6
+	and	eax,ebx
+	xor	ecx,esi
+	psrlq	xmm6,2
+	add	edx,DWORD [84+esp]
+	xor	eax,edi
+	ror	ecx,2
+	pxor	xmm7,xmm6
+	add	eax,edx
+	add	edx,DWORD [24+esp]
+	pshufd	xmm7,xmm7,128
+	add	eax,ecx
+	mov	ecx,edx
+	ror	edx,14
+	mov	esi,DWORD [28+esp]
+	xor	edx,ecx
+	mov	edi,DWORD [esp]
+	xor	esi,edi
+	ror	edx,5
+	and	esi,ecx
+	psrldq	xmm7,8
+	mov	DWORD [24+esp],ecx
+	xor	edx,ecx
+	xor	edi,esi
+	paddd	xmm3,xmm7
+	ror	edx,6
+	mov	ecx,eax
+	add	edx,edi
+	mov	edi,DWORD [12+esp]
+	mov	esi,eax
+	ror	ecx,9
+	mov	DWORD [8+esp],eax
+	pshufd	xmm7,xmm3,80
+	xor	ecx,eax
+	xor	eax,edi
+	add	edx,DWORD [4+esp]
+	movdqa	xmm6,xmm7
+	ror	ecx,11
+	psrld	xmm7,10
+	and	ebx,eax
+	psrlq	xmm6,17
+	xor	ecx,esi
+	add	edx,DWORD [88+esp]
+	xor	ebx,edi
+	ror	ecx,2
+	pxor	xmm7,xmm6
+	add	ebx,edx
+	add	edx,DWORD [20+esp]
+	psrlq	xmm6,2
+	add	ebx,ecx
+	mov	ecx,edx
+	ror	edx,14
+	pxor	xmm7,xmm6
+	mov	esi,DWORD [24+esp]
+	xor	edx,ecx
+	mov	edi,DWORD [28+esp]
+	pshufd	xmm7,xmm7,8
+	xor	esi,edi
+	ror	edx,5
+	movdqa	xmm6,[48+ebp]
+	and	esi,ecx
+	mov	DWORD [20+esp],ecx
+	pslldq	xmm7,8
+	xor	edx,ecx
+	xor	edi,esi
+	ror	edx,6
+	mov	ecx,ebx
+	add	edx,edi
+	mov	edi,DWORD [8+esp]
+	mov	esi,ebx
+	ror	ecx,9
+	paddd	xmm3,xmm7
+	mov	DWORD [4+esp],ebx
+	xor	ecx,ebx
+	xor	ebx,edi
+	add	edx,DWORD [esp]
+	paddd	xmm6,xmm3
+	ror	ecx,11
+	and	eax,ebx
+	xor	ecx,esi
+	add	edx,DWORD [92+esp]
+	xor	eax,edi
+	ror	ecx,2
+	add	eax,edx
+	add	edx,DWORD [16+esp]
+	add	eax,ecx
+	movdqa	[80+esp],xmm6
+	cmp	DWORD [64+ebp],66051
+	jne	NEAR L$012ssse3_00_47
+	mov	ecx,edx
+	ror	edx,14
+	mov	esi,DWORD [20+esp]
+	xor	edx,ecx
+	mov	edi,DWORD [24+esp]
+	xor	esi,edi
+	ror	edx,5
+	and	esi,ecx
+	mov	DWORD [16+esp],ecx
+	xor	edx,ecx
+	xor	edi,esi
+	ror	edx,6
+	mov	ecx,eax
+	add	edx,edi
+	mov	edi,DWORD [4+esp]
+	mov	esi,eax
+	ror	ecx,9
+	mov	DWORD [esp],eax
+	xor	ecx,eax
+	xor	eax,edi
+	add	edx,DWORD [28+esp]
+	ror	ecx,11
+	and	ebx,eax
+	xor	ecx,esi
+	add	edx,DWORD [32+esp]
+	xor	ebx,edi
+	ror	ecx,2
+	add	ebx,edx
+	add	edx,DWORD [12+esp]
+	add	ebx,ecx
+	mov	ecx,edx
+	ror	edx,14
+	mov	esi,DWORD [16+esp]
+	xor	edx,ecx
+	mov	edi,DWORD [20+esp]
+	xor	esi,edi
+	ror	edx,5
+	and	esi,ecx
+	mov	DWORD [12+esp],ecx
+	xor	edx,ecx
+	xor	edi,esi
+	ror	edx,6
+	mov	ecx,ebx
+	add	edx,edi
+	mov	edi,DWORD [esp]
+	mov	esi,ebx
+	ror	ecx,9
+	mov	DWORD [28+esp],ebx
+	xor	ecx,ebx
+	xor	ebx,edi
+	add	edx,DWORD [24+esp]
+	ror	ecx,11
+	and	eax,ebx
+	xor	ecx,esi
+	add	edx,DWORD [36+esp]
+	xor	eax,edi
+	ror	ecx,2
+	add	eax,edx
+	add	edx,DWORD [8+esp]
+	add	eax,ecx
+	mov	ecx,edx
+	ror	edx,14
+	mov	esi,DWORD [12+esp]
+	xor	edx,ecx
+	mov	edi,DWORD [16+esp]
+	xor	esi,edi
+	ror	edx,5
+	and	esi,ecx
+	mov	DWORD [8+esp],ecx
+	xor	edx,ecx
+	xor	edi,esi
+	ror	edx,6
+	mov	ecx,eax
+	add	edx,edi
+	mov	edi,DWORD [28+esp]
+	mov	esi,eax
+	ror	ecx,9
+	mov	DWORD [24+esp],eax
+	xor	ecx,eax
+	xor	eax,edi
+	add	edx,DWORD [20+esp]
+	ror	ecx,11
+	and	ebx,eax
+	xor	ecx,esi
+	add	edx,DWORD [40+esp]
+	xor	ebx,edi
+	ror	ecx,2
+	add	ebx,edx
+	add	edx,DWORD [4+esp]
+	add	ebx,ecx
+	mov	ecx,edx
+	ror	edx,14
+	mov	esi,DWORD [8+esp]
+	xor	edx,ecx
+	mov	edi,DWORD [12+esp]
+	xor	esi,edi
+	ror	edx,5
+	and	esi,ecx
+	mov	DWORD [4+esp],ecx
+	xor	edx,ecx
+	xor	edi,esi
+	ror	edx,6
+	mov	ecx,ebx
+	add	edx,edi
+	mov	edi,DWORD [24+esp]
+	mov	esi,ebx
+	ror	ecx,9
+	mov	DWORD [20+esp],ebx
+	xor	ecx,ebx
+	xor	ebx,edi
+	add	edx,DWORD [16+esp]
+	ror	ecx,11
+	and	eax,ebx
+	xor	ecx,esi
+	add	edx,DWORD [44+esp]
+	xor	eax,edi
+	ror	ecx,2
+	add	eax,edx
+	add	edx,DWORD [esp]
+	add	eax,ecx
+	mov	ecx,edx
+	ror	edx,14
+	mov	esi,DWORD [4+esp]
+	xor	edx,ecx
+	mov	edi,DWORD [8+esp]
+	xor	esi,edi
+	ror	edx,5
+	and	esi,ecx
+	mov	DWORD [esp],ecx
+	xor	edx,ecx
+	xor	edi,esi
+	ror	edx,6
+	mov	ecx,eax
+	add	edx,edi
+	mov	edi,DWORD [20+esp]
+	mov	esi,eax
+	ror	ecx,9
+	mov	DWORD [16+esp],eax
+	xor	ecx,eax
+	xor	eax,edi
+	add	edx,DWORD [12+esp]
+	ror	ecx,11
+	and	ebx,eax
+	xor	ecx,esi
+	add	edx,DWORD [48+esp]
+	xor	ebx,edi
+	ror	ecx,2
+	add	ebx,edx
+	add	edx,DWORD [28+esp]
+	add	ebx,ecx
+	mov	ecx,edx
+	ror	edx,14
+	mov	esi,DWORD [esp]
+	xor	edx,ecx
+	mov	edi,DWORD [4+esp]
+	xor	esi,edi
+	ror	edx,5
+	and	esi,ecx
+	mov	DWORD [28+esp],ecx
+	xor	edx,ecx
+	xor	edi,esi
+	ror	edx,6
+	mov	ecx,ebx
+	add	edx,edi
+	mov	edi,DWORD [16+esp]
+	mov	esi,ebx
+	ror	ecx,9
+	mov	DWORD [12+esp],ebx
+	xor	ecx,ebx
+	xor	ebx,edi
+	add	edx,DWORD [8+esp]
+	ror	ecx,11
+	and	eax,ebx
+	xor	ecx,esi
+	add	edx,DWORD [52+esp]
+	xor	eax,edi
+	ror	ecx,2
+	add	eax,edx
+	add	edx,DWORD [24+esp]
+	add	eax,ecx
+	mov	ecx,edx
+	ror	edx,14
+	mov	esi,DWORD [28+esp]
+	xor	edx,ecx
+	mov	edi,DWORD [esp]
+	xor	esi,edi
+	ror	edx,5
+	and	esi,ecx
+	mov	DWORD [24+esp],ecx
+	xor	edx,ecx
+	xor	edi,esi
+	ror	edx,6
+	mov	ecx,eax
+	add	edx,edi
+	mov	edi,DWORD [12+esp]
+	mov	esi,eax
+	ror	ecx,9
+	mov	DWORD [8+esp],eax
+	xor	ecx,eax
+	xor	eax,edi
+	add	edx,DWORD [4+esp]
+	ror	ecx,11
+	and	ebx,eax
+	xor	ecx,esi
+	add	edx,DWORD [56+esp]
+	xor	ebx,edi
+	ror	ecx,2
+	add	ebx,edx
+	add	edx,DWORD [20+esp]
+	add	ebx,ecx
+	mov	ecx,edx
+	ror	edx,14
+	mov	esi,DWORD [24+esp]
+	xor	edx,ecx
+	mov	edi,DWORD [28+esp]
+	xor	esi,edi
+	ror	edx,5
+	and	esi,ecx
+	mov	DWORD [20+esp],ecx
+	xor	edx,ecx
+	xor	edi,esi
+	ror	edx,6
+	mov	ecx,ebx
+	add	edx,edi
+	mov	edi,DWORD [8+esp]
+	mov	esi,ebx
+	ror	ecx,9
+	mov	DWORD [4+esp],ebx
+	xor	ecx,ebx
+	xor	ebx,edi
+	add	edx,DWORD [esp]
+	ror	ecx,11
+	and	eax,ebx
+	xor	ecx,esi
+	add	edx,DWORD [60+esp]
+	xor	eax,edi
+	ror	ecx,2
+	add	eax,edx
+	add	edx,DWORD [16+esp]
+	add	eax,ecx
+	mov	ecx,edx
+	ror	edx,14
+	mov	esi,DWORD [20+esp]
+	xor	edx,ecx
+	mov	edi,DWORD [24+esp]
+	xor	esi,edi
+	ror	edx,5
+	and	esi,ecx
+	mov	DWORD [16+esp],ecx
+	xor	edx,ecx
+	xor	edi,esi
+	ror	edx,6
+	mov	ecx,eax
+	add	edx,edi
+	mov	edi,DWORD [4+esp]
+	mov	esi,eax
+	ror	ecx,9
+	mov	DWORD [esp],eax
+	xor	ecx,eax
+	xor	eax,edi
+	add	edx,DWORD [28+esp]
+	ror	ecx,11
+	and	ebx,eax
+	xor	ecx,esi
+	add	edx,DWORD [64+esp]
+	xor	ebx,edi
+	ror	ecx,2
+	add	ebx,edx
+	add	edx,DWORD [12+esp]
+	add	ebx,ecx
+	mov	ecx,edx
+	ror	edx,14
+	mov	esi,DWORD [16+esp]
+	xor	edx,ecx
+	mov	edi,DWORD [20+esp]
+	xor	esi,edi
+	ror	edx,5
+	and	esi,ecx
+	mov	DWORD [12+esp],ecx
+	xor	edx,ecx
+	xor	edi,esi
+	ror	edx,6
+	mov	ecx,ebx
+	add	edx,edi
+	mov	edi,DWORD [esp]
+	mov	esi,ebx
+	ror	ecx,9
+	mov	DWORD [28+esp],ebx
+	xor	ecx,ebx
+	xor	ebx,edi
+	add	edx,DWORD [24+esp]
+	ror	ecx,11
+	and	eax,ebx
+	xor	ecx,esi
+	add	edx,DWORD [68+esp]
+	xor	eax,edi
+	ror	ecx,2
+	add	eax,edx
+	add	edx,DWORD [8+esp]
+	add	eax,ecx
+	mov	ecx,edx
+	ror	edx,14
+	mov	esi,DWORD [12+esp]
+	xor	edx,ecx
+	mov	edi,DWORD [16+esp]
+	xor	esi,edi
+	ror	edx,5
+	and	esi,ecx
+	mov	DWORD [8+esp],ecx
+	xor	edx,ecx
+	xor	edi,esi
+	ror	edx,6
+	mov	ecx,eax
+	add	edx,edi
+	mov	edi,DWORD [28+esp]
+	mov	esi,eax
+	ror	ecx,9
+	mov	DWORD [24+esp],eax
+	xor	ecx,eax
+	xor	eax,edi
+	add	edx,DWORD [20+esp]
+	ror	ecx,11
+	and	ebx,eax
+	xor	ecx,esi
+	add	edx,DWORD [72+esp]
+	xor	ebx,edi
+	ror	ecx,2
+	add	ebx,edx
+	add	edx,DWORD [4+esp]
+	add	ebx,ecx
+	mov	ecx,edx
+	ror	edx,14
+	mov	esi,DWORD [8+esp]
+	xor	edx,ecx
+	mov	edi,DWORD [12+esp]
+	xor	esi,edi
+	ror	edx,5
+	and	esi,ecx
+	mov	DWORD [4+esp],ecx
+	xor	edx,ecx
+	xor	edi,esi
+	ror	edx,6
+	mov	ecx,ebx
+	add	edx,edi
+	mov	edi,DWORD [24+esp]
+	mov	esi,ebx
+	ror	ecx,9
+	mov	DWORD [20+esp],ebx
+	xor	ecx,ebx
+	xor	ebx,edi
+	add	edx,DWORD [16+esp]
+	ror	ecx,11
+	and	eax,ebx
+	xor	ecx,esi
+	add	edx,DWORD [76+esp]
+	xor	eax,edi
+	ror	ecx,2
+	add	eax,edx
+	add	edx,DWORD [esp]
+	add	eax,ecx
+	mov	ecx,edx
+	ror	edx,14
+	mov	esi,DWORD [4+esp]
+	xor	edx,ecx
+	mov	edi,DWORD [8+esp]
+	xor	esi,edi
+	ror	edx,5
+	and	esi,ecx
+	mov	DWORD [esp],ecx
+	xor	edx,ecx
+	xor	edi,esi
+	ror	edx,6
+	mov	ecx,eax
+	add	edx,edi
+	mov	edi,DWORD [20+esp]
+	mov	esi,eax
+	ror	ecx,9
+	mov	DWORD [16+esp],eax
+	xor	ecx,eax
+	xor	eax,edi
+	add	edx,DWORD [12+esp]
+	ror	ecx,11
+	and	ebx,eax
+	xor	ecx,esi
+	add	edx,DWORD [80+esp]
+	xor	ebx,edi
+	ror	ecx,2
+	add	ebx,edx
+	add	edx,DWORD [28+esp]
+	add	ebx,ecx
+	mov	ecx,edx
+	ror	edx,14
+	mov	esi,DWORD [esp]
+	xor	edx,ecx
+	mov	edi,DWORD [4+esp]
+	xor	esi,edi
+	ror	edx,5
+	and	esi,ecx
+	mov	DWORD [28+esp],ecx
+	xor	edx,ecx
+	xor	edi,esi
+	ror	edx,6
+	mov	ecx,ebx
+	add	edx,edi
+	mov	edi,DWORD [16+esp]
+	mov	esi,ebx
+	ror	ecx,9
+	mov	DWORD [12+esp],ebx
+	xor	ecx,ebx
+	xor	ebx,edi
+	add	edx,DWORD [8+esp]
+	ror	ecx,11
+	and	eax,ebx
+	xor	ecx,esi
+	add	edx,DWORD [84+esp]
+	xor	eax,edi
+	ror	ecx,2
+	add	eax,edx
+	add	edx,DWORD [24+esp]
+	add	eax,ecx
+	mov	ecx,edx
+	ror	edx,14
+	mov	esi,DWORD [28+esp]
+	xor	edx,ecx
+	mov	edi,DWORD [esp]
+	xor	esi,edi
+	ror	edx,5
+	and	esi,ecx
+	mov	DWORD [24+esp],ecx
+	xor	edx,ecx
+	xor	edi,esi
+	ror	edx,6
+	mov	ecx,eax
+	add	edx,edi
+	mov	edi,DWORD [12+esp]
+	mov	esi,eax
+	ror	ecx,9
+	mov	DWORD [8+esp],eax
+	xor	ecx,eax
+	xor	eax,edi
+	add	edx,DWORD [4+esp]
+	ror	ecx,11
+	and	ebx,eax
+	xor	ecx,esi
+	add	edx,DWORD [88+esp]
+	xor	ebx,edi
+	ror	ecx,2
+	add	ebx,edx
+	add	edx,DWORD [20+esp]
+	add	ebx,ecx
+	mov	ecx,edx
+	ror	edx,14
+	mov	esi,DWORD [24+esp]
+	xor	edx,ecx
+	mov	edi,DWORD [28+esp]
+	xor	esi,edi
+	ror	edx,5
+	and	esi,ecx
+	mov	DWORD [20+esp],ecx
+	xor	edx,ecx
+	xor	edi,esi
+	ror	edx,6
+	mov	ecx,ebx
+	add	edx,edi
+	mov	edi,DWORD [8+esp]
+	mov	esi,ebx
+	ror	ecx,9
+	mov	DWORD [4+esp],ebx
+	xor	ecx,ebx
+	xor	ebx,edi
+	add	edx,DWORD [esp]
+	ror	ecx,11
+	and	eax,ebx
+	xor	ecx,esi
+	add	edx,DWORD [92+esp]
+	xor	eax,edi
+	ror	ecx,2
+	add	eax,edx
+	add	edx,DWORD [16+esp]
+	add	eax,ecx
+	mov	esi,DWORD [96+esp]
+	xor	ebx,edi
+	mov	ecx,DWORD [12+esp]
+	add	eax,DWORD [esi]
+	add	ebx,DWORD [4+esi]
+	add	edi,DWORD [8+esi]
+	add	ecx,DWORD [12+esi]
+	mov	DWORD [esi],eax
+	mov	DWORD [4+esi],ebx
+	mov	DWORD [8+esi],edi
+	mov	DWORD [12+esi],ecx
+	mov	DWORD [4+esp],ebx
+	xor	ebx,edi
+	mov	DWORD [8+esp],edi
+	mov	DWORD [12+esp],ecx
+	mov	edi,DWORD [20+esp]
+	mov	ecx,DWORD [24+esp]
+	add	edx,DWORD [16+esi]
+	add	edi,DWORD [20+esi]
+	add	ecx,DWORD [24+esi]
+	mov	DWORD [16+esi],edx
+	mov	DWORD [20+esi],edi
+	mov	DWORD [20+esp],edi
+	mov	edi,DWORD [28+esp]
+	mov	DWORD [24+esi],ecx
+	add	edi,DWORD [28+esi]
+	mov	DWORD [24+esp],ecx
+	mov	DWORD [28+esi],edi
+	mov	DWORD [28+esp],edi
+	mov	edi,DWORD [100+esp]
+	movdqa	xmm7,[64+ebp]
+	sub	ebp,192
+	cmp	edi,DWORD [104+esp]
+	jb	NEAR L$011grand_ssse3
+	mov	esp,DWORD [108+esp]
+	pop	edi
+	pop	esi
+	pop	ebx
+	pop	ebp
+	ret
+segment	.bss
+common	_OPENSSL_ia32cap_P 16
diff --git a/third_party/boringssl/win-x86/crypto/sha/sha512-586.asm b/third_party/boringssl/win-x86/crypto/sha/sha512-586.asm
new file mode 100644
index 0000000..88ed0b3
--- /dev/null
+++ b/third_party/boringssl/win-x86/crypto/sha/sha512-586.asm
@@ -0,0 +1,2843 @@
+%ifidn __OUTPUT_FORMAT__,obj
+section	code	use32 class=code align=64
+%elifidn __OUTPUT_FORMAT__,win32
+%ifdef __YASM_VERSION_ID__
+%if __YASM_VERSION_ID__ < 01010000h
+%error yasm version 1.1.0 or later needed.
+%endif
+; Yasm automatically includes .00 and complains about redefining it.
+; https://www.tortall.net/projects/yasm/manual/html/objfmt-win32-safeseh.html
+%else
+$@feat.00 equ 1
+%endif
+section	.text	code align=64
+%else
+section	.text	code
+%endif
+;extern	_OPENSSL_ia32cap_P
+global	_sha512_block_data_order
+align	16
+_sha512_block_data_order:
+L$_sha512_block_data_order_begin:
+	push	ebp
+	push	ebx
+	push	esi
+	push	edi
+	mov	esi,DWORD [20+esp]
+	mov	edi,DWORD [24+esp]
+	mov	eax,DWORD [28+esp]
+	mov	ebx,esp
+	call	L$000pic_point
+L$000pic_point:
+	pop	ebp
+	lea	ebp,[(L$001K512-L$000pic_point)+ebp]
+	sub	esp,16
+	and	esp,-64
+	shl	eax,7
+	add	eax,edi
+	mov	DWORD [esp],esi
+	mov	DWORD [4+esp],edi
+	mov	DWORD [8+esp],eax
+	mov	DWORD [12+esp],ebx
+	lea	edx,[_OPENSSL_ia32cap_P]
+	mov	ecx,DWORD [edx]
+	test	ecx,67108864
+	jz	NEAR L$002loop_x86
+	mov	edx,DWORD [4+edx]
+	movq	mm0,[esi]
+	and	ecx,16777216
+	movq	mm1,[8+esi]
+	and	edx,512
+	movq	mm2,[16+esi]
+	or	ecx,edx
+	movq	mm3,[24+esi]
+	movq	mm4,[32+esi]
+	movq	mm5,[40+esi]
+	movq	mm6,[48+esi]
+	movq	mm7,[56+esi]
+	cmp	ecx,16777728
+	je	NEAR L$003SSSE3
+	sub	esp,80
+	jmp	NEAR L$004loop_sse2
+align	16
+L$004loop_sse2:
+	movq	[8+esp],mm1
+	movq	[16+esp],mm2
+	movq	[24+esp],mm3
+	movq	[40+esp],mm5
+	movq	[48+esp],mm6
+	pxor	mm2,mm1
+	movq	[56+esp],mm7
+	movq	mm3,mm0
+	mov	eax,DWORD [edi]
+	mov	ebx,DWORD [4+edi]
+	add	edi,8
+	mov	edx,15
+	bswap	eax
+	bswap	ebx
+	jmp	NEAR L$00500_14_sse2
+align	16
+L$00500_14_sse2:
+	movd	mm1,eax
+	mov	eax,DWORD [edi]
+	movd	mm7,ebx
+	mov	ebx,DWORD [4+edi]
+	add	edi,8
+	bswap	eax
+	bswap	ebx
+	punpckldq	mm7,mm1
+	movq	mm1,mm4
+	pxor	mm5,mm6
+	psrlq	mm1,14
+	movq	[32+esp],mm4
+	pand	mm5,mm4
+	psllq	mm4,23
+	movq	mm0,mm3
+	movq	[72+esp],mm7
+	movq	mm3,mm1
+	psrlq	mm1,4
+	pxor	mm5,mm6
+	pxor	mm3,mm4
+	psllq	mm4,23
+	pxor	mm3,mm1
+	movq	[esp],mm0
+	paddq	mm7,mm5
+	pxor	mm3,mm4
+	psrlq	mm1,23
+	paddq	mm7,[56+esp]
+	pxor	mm3,mm1
+	psllq	mm4,4
+	paddq	mm7,[ebp]
+	pxor	mm3,mm4
+	movq	mm4,[24+esp]
+	paddq	mm3,mm7
+	movq	mm5,mm0
+	psrlq	mm5,28
+	paddq	mm4,mm3
+	movq	mm6,mm0
+	movq	mm7,mm5
+	psllq	mm6,25
+	movq	mm1,[8+esp]
+	psrlq	mm5,6
+	pxor	mm7,mm6
+	sub	esp,8
+	psllq	mm6,5
+	pxor	mm7,mm5
+	pxor	mm0,mm1
+	psrlq	mm5,5
+	pxor	mm7,mm6
+	pand	mm2,mm0
+	psllq	mm6,6
+	pxor	mm7,mm5
+	pxor	mm2,mm1
+	pxor	mm6,mm7
+	movq	mm5,[40+esp]
+	paddq	mm3,mm2
+	movq	mm2,mm0
+	add	ebp,8
+	paddq	mm3,mm6
+	movq	mm6,[48+esp]
+	dec	edx
+	jnz	NEAR L$00500_14_sse2
+	movd	mm1,eax
+	movd	mm7,ebx
+	punpckldq	mm7,mm1
+	movq	mm1,mm4
+	pxor	mm5,mm6
+	psrlq	mm1,14
+	movq	[32+esp],mm4
+	pand	mm5,mm4
+	psllq	mm4,23
+	movq	mm0,mm3
+	movq	[72+esp],mm7
+	movq	mm3,mm1
+	psrlq	mm1,4
+	pxor	mm5,mm6
+	pxor	mm3,mm4
+	psllq	mm4,23
+	pxor	mm3,mm1
+	movq	[esp],mm0
+	paddq	mm7,mm5
+	pxor	mm3,mm4
+	psrlq	mm1,23
+	paddq	mm7,[56+esp]
+	pxor	mm3,mm1
+	psllq	mm4,4
+	paddq	mm7,[ebp]
+	pxor	mm3,mm4
+	movq	mm4,[24+esp]
+	paddq	mm3,mm7
+	movq	mm5,mm0
+	psrlq	mm5,28
+	paddq	mm4,mm3
+	movq	mm6,mm0
+	movq	mm7,mm5
+	psllq	mm6,25
+	movq	mm1,[8+esp]
+	psrlq	mm5,6
+	pxor	mm7,mm6
+	sub	esp,8
+	psllq	mm6,5
+	pxor	mm7,mm5
+	pxor	mm0,mm1
+	psrlq	mm5,5
+	pxor	mm7,mm6
+	pand	mm2,mm0
+	psllq	mm6,6
+	pxor	mm7,mm5
+	pxor	mm2,mm1
+	pxor	mm6,mm7
+	movq	mm7,[192+esp]
+	paddq	mm3,mm2
+	movq	mm2,mm0
+	add	ebp,8
+	paddq	mm3,mm6
+	pxor	mm0,mm0
+	mov	edx,32
+	jmp	NEAR L$00616_79_sse2
+align	16
+L$00616_79_sse2:
+	movq	mm5,[88+esp]
+	movq	mm1,mm7
+	psrlq	mm7,1
+	movq	mm6,mm5
+	psrlq	mm5,6
+	psllq	mm1,56
+	paddq	mm0,mm3
+	movq	mm3,mm7
+	psrlq	mm7,6
+	pxor	mm3,mm1
+	psllq	mm1,7
+	pxor	mm3,mm7
+	psrlq	mm7,1
+	pxor	mm3,mm1
+	movq	mm1,mm5
+	psrlq	mm5,13
+	pxor	mm7,mm3
+	psllq	mm6,3
+	pxor	mm1,mm5
+	paddq	mm7,[200+esp]
+	pxor	mm1,mm6
+	psrlq	mm5,42
+	paddq	mm7,[128+esp]
+	pxor	mm1,mm5
+	psllq	mm6,42
+	movq	mm5,[40+esp]
+	pxor	mm1,mm6
+	movq	mm6,[48+esp]
+	paddq	mm7,mm1
+	movq	mm1,mm4
+	pxor	mm5,mm6
+	psrlq	mm1,14
+	movq	[32+esp],mm4
+	pand	mm5,mm4
+	psllq	mm4,23
+	movq	[72+esp],mm7
+	movq	mm3,mm1
+	psrlq	mm1,4
+	pxor	mm5,mm6
+	pxor	mm3,mm4
+	psllq	mm4,23
+	pxor	mm3,mm1
+	movq	[esp],mm0
+	paddq	mm7,mm5
+	pxor	mm3,mm4
+	psrlq	mm1,23
+	paddq	mm7,[56+esp]
+	pxor	mm3,mm1
+	psllq	mm4,4
+	paddq	mm7,[ebp]
+	pxor	mm3,mm4
+	movq	mm4,[24+esp]
+	paddq	mm3,mm7
+	movq	mm5,mm0
+	psrlq	mm5,28
+	paddq	mm4,mm3
+	movq	mm6,mm0
+	movq	mm7,mm5
+	psllq	mm6,25
+	movq	mm1,[8+esp]
+	psrlq	mm5,6
+	pxor	mm7,mm6
+	sub	esp,8
+	psllq	mm6,5
+	pxor	mm7,mm5
+	pxor	mm0,mm1
+	psrlq	mm5,5
+	pxor	mm7,mm6
+	pand	mm2,mm0
+	psllq	mm6,6
+	pxor	mm7,mm5
+	pxor	mm2,mm1
+	pxor	mm6,mm7
+	movq	mm7,[192+esp]
+	paddq	mm2,mm6
+	add	ebp,8
+	movq	mm5,[88+esp]
+	movq	mm1,mm7
+	psrlq	mm7,1
+	movq	mm6,mm5
+	psrlq	mm5,6
+	psllq	mm1,56
+	paddq	mm2,mm3
+	movq	mm3,mm7
+	psrlq	mm7,6
+	pxor	mm3,mm1
+	psllq	mm1,7
+	pxor	mm3,mm7
+	psrlq	mm7,1
+	pxor	mm3,mm1
+	movq	mm1,mm5
+	psrlq	mm5,13
+	pxor	mm7,mm3
+	psllq	mm6,3
+	pxor	mm1,mm5
+	paddq	mm7,[200+esp]
+	pxor	mm1,mm6
+	psrlq	mm5,42
+	paddq	mm7,[128+esp]
+	pxor	mm1,mm5
+	psllq	mm6,42
+	movq	mm5,[40+esp]
+	pxor	mm1,mm6
+	movq	mm6,[48+esp]
+	paddq	mm7,mm1
+	movq	mm1,mm4
+	pxor	mm5,mm6
+	psrlq	mm1,14
+	movq	[32+esp],mm4
+	pand	mm5,mm4
+	psllq	mm4,23
+	movq	[72+esp],mm7
+	movq	mm3,mm1
+	psrlq	mm1,4
+	pxor	mm5,mm6
+	pxor	mm3,mm4
+	psllq	mm4,23
+	pxor	mm3,mm1
+	movq	[esp],mm2
+	paddq	mm7,mm5
+	pxor	mm3,mm4
+	psrlq	mm1,23
+	paddq	mm7,[56+esp]
+	pxor	mm3,mm1
+	psllq	mm4,4
+	paddq	mm7,[ebp]
+	pxor	mm3,mm4
+	movq	mm4,[24+esp]
+	paddq	mm3,mm7
+	movq	mm5,mm2
+	psrlq	mm5,28
+	paddq	mm4,mm3
+	movq	mm6,mm2
+	movq	mm7,mm5
+	psllq	mm6,25
+	movq	mm1,[8+esp]
+	psrlq	mm5,6
+	pxor	mm7,mm6
+	sub	esp,8
+	psllq	mm6,5
+	pxor	mm7,mm5
+	pxor	mm2,mm1
+	psrlq	mm5,5
+	pxor	mm7,mm6
+	pand	mm0,mm2
+	psllq	mm6,6
+	pxor	mm7,mm5
+	pxor	mm0,mm1
+	pxor	mm6,mm7
+	movq	mm7,[192+esp]
+	paddq	mm0,mm6
+	add	ebp,8
+	dec	edx
+	jnz	NEAR L$00616_79_sse2
+	paddq	mm0,mm3
+	movq	mm1,[8+esp]
+	movq	mm3,[24+esp]
+	movq	mm5,[40+esp]
+	movq	mm6,[48+esp]
+	movq	mm7,[56+esp]
+	pxor	mm2,mm1
+	paddq	mm0,[esi]
+	paddq	mm1,[8+esi]
+	paddq	mm2,[16+esi]
+	paddq	mm3,[24+esi]
+	paddq	mm4,[32+esi]
+	paddq	mm5,[40+esi]
+	paddq	mm6,[48+esi]
+	paddq	mm7,[56+esi]
+	mov	eax,640
+	movq	[esi],mm0
+	movq	[8+esi],mm1
+	movq	[16+esi],mm2
+	movq	[24+esi],mm3
+	movq	[32+esi],mm4
+	movq	[40+esi],mm5
+	movq	[48+esi],mm6
+	movq	[56+esi],mm7
+	lea	esp,[eax*1+esp]
+	sub	ebp,eax
+	cmp	edi,DWORD [88+esp]
+	jb	NEAR L$004loop_sse2
+	mov	esp,DWORD [92+esp]
+	emms
+	pop	edi
+	pop	esi
+	pop	ebx
+	pop	ebp
+	ret
+align	32
+L$003SSSE3:
+	lea	edx,[esp-64]
+	sub	esp,256
+	movdqa	xmm1,[640+ebp]
+	movdqu	xmm0,[edi]
+db	102,15,56,0,193
+	movdqa	xmm3,[ebp]
+	movdqa	xmm2,xmm1
+	movdqu	xmm1,[16+edi]
+	paddq	xmm3,xmm0
+db	102,15,56,0,202
+	movdqa	[edx-128],xmm3
+	movdqa	xmm4,[16+ebp]
+	movdqa	xmm3,xmm2
+	movdqu	xmm2,[32+edi]
+	paddq	xmm4,xmm1
+db	102,15,56,0,211
+	movdqa	[edx-112],xmm4
+	movdqa	xmm5,[32+ebp]
+	movdqa	xmm4,xmm3
+	movdqu	xmm3,[48+edi]
+	paddq	xmm5,xmm2
+db	102,15,56,0,220
+	movdqa	[edx-96],xmm5
+	movdqa	xmm6,[48+ebp]
+	movdqa	xmm5,xmm4
+	movdqu	xmm4,[64+edi]
+	paddq	xmm6,xmm3
+db	102,15,56,0,229
+	movdqa	[edx-80],xmm6
+	movdqa	xmm7,[64+ebp]
+	movdqa	xmm6,xmm5
+	movdqu	xmm5,[80+edi]
+	paddq	xmm7,xmm4
+db	102,15,56,0,238
+	movdqa	[edx-64],xmm7
+	movdqa	[edx],xmm0
+	movdqa	xmm0,[80+ebp]
+	movdqa	xmm7,xmm6
+	movdqu	xmm6,[96+edi]
+	paddq	xmm0,xmm5
+db	102,15,56,0,247
+	movdqa	[edx-48],xmm0
+	movdqa	[16+edx],xmm1
+	movdqa	xmm1,[96+ebp]
+	movdqa	xmm0,xmm7
+	movdqu	xmm7,[112+edi]
+	paddq	xmm1,xmm6
+db	102,15,56,0,248
+	movdqa	[edx-32],xmm1
+	movdqa	[32+edx],xmm2
+	movdqa	xmm2,[112+ebp]
+	movdqa	xmm0,[edx]
+	paddq	xmm2,xmm7
+	movdqa	[edx-16],xmm2
+	nop
+align	32
+L$007loop_ssse3:
+	movdqa	xmm2,[16+edx]
+	movdqa	[48+edx],xmm3
+	lea	ebp,[128+ebp]
+	movq	[8+esp],mm1
+	mov	ebx,edi
+	movq	[16+esp],mm2
+	lea	edi,[128+edi]
+	movq	[24+esp],mm3
+	cmp	edi,eax
+	movq	[40+esp],mm5
+	cmovb	ebx,edi
+	movq	[48+esp],mm6
+	mov	ecx,4
+	pxor	mm2,mm1
+	movq	[56+esp],mm7
+	pxor	mm3,mm3
+	jmp	NEAR L$00800_47_ssse3
+align	32
+L$00800_47_ssse3:
+	movdqa	xmm3,xmm5
+	movdqa	xmm1,xmm2
+db	102,15,58,15,208,8
+	movdqa	[edx],xmm4
+db	102,15,58,15,220,8
+	movdqa	xmm4,xmm2
+	psrlq	xmm2,7
+	paddq	xmm0,xmm3
+	movdqa	xmm3,xmm4
+	psrlq	xmm4,1
+	psllq	xmm3,56
+	pxor	xmm2,xmm4
+	psrlq	xmm4,7
+	pxor	xmm2,xmm3
+	psllq	xmm3,7
+	pxor	xmm2,xmm4
+	movdqa	xmm4,xmm7
+	pxor	xmm2,xmm3
+	movdqa	xmm3,xmm7
+	psrlq	xmm4,6
+	paddq	xmm0,xmm2
+	movdqa	xmm2,xmm7
+	psrlq	xmm3,19
+	psllq	xmm2,3
+	pxor	xmm4,xmm3
+	psrlq	xmm3,42
+	pxor	xmm4,xmm2
+	psllq	xmm2,42
+	pxor	xmm4,xmm3
+	movdqa	xmm3,[32+edx]
+	pxor	xmm4,xmm2
+	movdqa	xmm2,[ebp]
+	movq	mm1,mm4
+	paddq	xmm0,xmm4
+	movq	mm7,[edx-128]
+	pxor	mm5,mm6
+	psrlq	mm1,14
+	movq	[32+esp],mm4
+	paddq	xmm2,xmm0
+	pand	mm5,mm4
+	psllq	mm4,23
+	paddq	mm0,mm3
+	movq	mm3,mm1
+	psrlq	mm1,4
+	pxor	mm5,mm6
+	pxor	mm3,mm4
+	psllq	mm4,23
+	pxor	mm3,mm1
+	movq	[esp],mm0
+	paddq	mm7,mm5
+	pxor	mm3,mm4
+	psrlq	mm1,23
+	paddq	mm7,[56+esp]
+	pxor	mm3,mm1
+	psllq	mm4,4
+	pxor	mm3,mm4
+	movq	mm4,[24+esp]
+	paddq	mm3,mm7
+	movq	mm5,mm0
+	psrlq	mm5,28
+	paddq	mm4,mm3
+	movq	mm6,mm0
+	movq	mm7,mm5
+	psllq	mm6,25
+	movq	mm1,[8+esp]
+	psrlq	mm5,6
+	pxor	mm7,mm6
+	psllq	mm6,5
+	pxor	mm7,mm5
+	pxor	mm0,mm1
+	psrlq	mm5,5
+	pxor	mm7,mm6
+	pand	mm2,mm0
+	psllq	mm6,6
+	pxor	mm7,mm5
+	pxor	mm2,mm1
+	pxor	mm6,mm7
+	movq	mm5,[32+esp]
+	paddq	mm2,mm6
+	movq	mm6,[40+esp]
+	movq	mm1,mm4
+	movq	mm7,[edx-120]
+	pxor	mm5,mm6
+	psrlq	mm1,14
+	movq	[24+esp],mm4
+	pand	mm5,mm4
+	psllq	mm4,23
+	paddq	mm2,mm3
+	movq	mm3,mm1
+	psrlq	mm1,4
+	pxor	mm5,mm6
+	pxor	mm3,mm4
+	psllq	mm4,23
+	pxor	mm3,mm1
+	movq	[56+esp],mm2
+	paddq	mm7,mm5
+	pxor	mm3,mm4
+	psrlq	mm1,23
+	paddq	mm7,[48+esp]
+	pxor	mm3,mm1
+	psllq	mm4,4
+	pxor	mm3,mm4
+	movq	mm4,[16+esp]
+	paddq	mm3,mm7
+	movq	mm5,mm2
+	psrlq	mm5,28
+	paddq	mm4,mm3
+	movq	mm6,mm2
+	movq	mm7,mm5
+	psllq	mm6,25
+	movq	mm1,[esp]
+	psrlq	mm5,6
+	pxor	mm7,mm6
+	psllq	mm6,5
+	pxor	mm7,mm5
+	pxor	mm2,mm1
+	psrlq	mm5,5
+	pxor	mm7,mm6
+	pand	mm0,mm2
+	psllq	mm6,6
+	pxor	mm7,mm5
+	pxor	mm0,mm1
+	pxor	mm6,mm7
+	movq	mm5,[24+esp]
+	paddq	mm0,mm6
+	movq	mm6,[32+esp]
+	movdqa	[edx-128],xmm2
+	movdqa	xmm4,xmm6
+	movdqa	xmm2,xmm3
+db	102,15,58,15,217,8
+	movdqa	[16+edx],xmm5
+db	102,15,58,15,229,8
+	movdqa	xmm5,xmm3
+	psrlq	xmm3,7
+	paddq	xmm1,xmm4
+	movdqa	xmm4,xmm5
+	psrlq	xmm5,1
+	psllq	xmm4,56
+	pxor	xmm3,xmm5
+	psrlq	xmm5,7
+	pxor	xmm3,xmm4
+	psllq	xmm4,7
+	pxor	xmm3,xmm5
+	movdqa	xmm5,xmm0
+	pxor	xmm3,xmm4
+	movdqa	xmm4,xmm0
+	psrlq	xmm5,6
+	paddq	xmm1,xmm3
+	movdqa	xmm3,xmm0
+	psrlq	xmm4,19
+	psllq	xmm3,3
+	pxor	xmm5,xmm4
+	psrlq	xmm4,42
+	pxor	xmm5,xmm3
+	psllq	xmm3,42
+	pxor	xmm5,xmm4
+	movdqa	xmm4,[48+edx]
+	pxor	xmm5,xmm3
+	movdqa	xmm3,[16+ebp]
+	movq	mm1,mm4
+	paddq	xmm1,xmm5
+	movq	mm7,[edx-112]
+	pxor	mm5,mm6
+	psrlq	mm1,14
+	movq	[16+esp],mm4
+	paddq	xmm3,xmm1
+	pand	mm5,mm4
+	psllq	mm4,23
+	paddq	mm0,mm3
+	movq	mm3,mm1
+	psrlq	mm1,4
+	pxor	mm5,mm6
+	pxor	mm3,mm4
+	psllq	mm4,23
+	pxor	mm3,mm1
+	movq	[48+esp],mm0
+	paddq	mm7,mm5
+	pxor	mm3,mm4
+	psrlq	mm1,23
+	paddq	mm7,[40+esp]
+	pxor	mm3,mm1
+	psllq	mm4,4
+	pxor	mm3,mm4
+	movq	mm4,[8+esp]
+	paddq	mm3,mm7
+	movq	mm5,mm0
+	psrlq	mm5,28
+	paddq	mm4,mm3
+	movq	mm6,mm0
+	movq	mm7,mm5
+	psllq	mm6,25
+	movq	mm1,[56+esp]
+	psrlq	mm5,6
+	pxor	mm7,mm6
+	psllq	mm6,5
+	pxor	mm7,mm5
+	pxor	mm0,mm1
+	psrlq	mm5,5
+	pxor	mm7,mm6
+	pand	mm2,mm0
+	psllq	mm6,6
+	pxor	mm7,mm5
+	pxor	mm2,mm1
+	pxor	mm6,mm7
+	movq	mm5,[16+esp]
+	paddq	mm2,mm6
+	movq	mm6,[24+esp]
+	movq	mm1,mm4
+	movq	mm7,[edx-104]
+	pxor	mm5,mm6
+	psrlq	mm1,14
+	movq	[8+esp],mm4
+	pand	mm5,mm4
+	psllq	mm4,23
+	paddq	mm2,mm3
+	movq	mm3,mm1
+	psrlq	mm1,4
+	pxor	mm5,mm6
+	pxor	mm3,mm4
+	psllq	mm4,23
+	pxor	mm3,mm1
+	movq	[40+esp],mm2
+	paddq	mm7,mm5
+	pxor	mm3,mm4
+	psrlq	mm1,23
+	paddq	mm7,[32+esp]
+	pxor	mm3,mm1
+	psllq	mm4,4
+	pxor	mm3,mm4
+	movq	mm4,[esp]
+	paddq	mm3,mm7
+	movq	mm5,mm2
+	psrlq	mm5,28
+	paddq	mm4,mm3
+	movq	mm6,mm2
+	movq	mm7,mm5
+	psllq	mm6,25
+	movq	mm1,[48+esp]
+	psrlq	mm5,6
+	pxor	mm7,mm6
+	psllq	mm6,5
+	pxor	mm7,mm5
+	pxor	mm2,mm1
+	psrlq	mm5,5
+	pxor	mm7,mm6
+	pand	mm0,mm2
+	psllq	mm6,6
+	pxor	mm7,mm5
+	pxor	mm0,mm1
+	pxor	mm6,mm7
+	movq	mm5,[8+esp]
+	paddq	mm0,mm6
+	movq	mm6,[16+esp]
+	movdqa	[edx-112],xmm3
+	movdqa	xmm5,xmm7
+	movdqa	xmm3,xmm4
+db	102,15,58,15,226,8
+	movdqa	[32+edx],xmm6
+db	102,15,58,15,238,8
+	movdqa	xmm6,xmm4
+	psrlq	xmm4,7
+	paddq	xmm2,xmm5
+	movdqa	xmm5,xmm6
+	psrlq	xmm6,1
+	psllq	xmm5,56
+	pxor	xmm4,xmm6
+	psrlq	xmm6,7
+	pxor	xmm4,xmm5
+	psllq	xmm5,7
+	pxor	xmm4,xmm6
+	movdqa	xmm6,xmm1
+	pxor	xmm4,xmm5
+	movdqa	xmm5,xmm1
+	psrlq	xmm6,6
+	paddq	xmm2,xmm4
+	movdqa	xmm4,xmm1
+	psrlq	xmm5,19
+	psllq	xmm4,3
+	pxor	xmm6,xmm5
+	psrlq	xmm5,42
+	pxor	xmm6,xmm4
+	psllq	xmm4,42
+	pxor	xmm6,xmm5
+	movdqa	xmm5,[edx]
+	pxor	xmm6,xmm4
+	movdqa	xmm4,[32+ebp]
+	movq	mm1,mm4
+	paddq	xmm2,xmm6
+	movq	mm7,[edx-96]
+	pxor	mm5,mm6
+	psrlq	mm1,14
+	movq	[esp],mm4
+	paddq	xmm4,xmm2
+	pand	mm5,mm4
+	psllq	mm4,23
+	paddq	mm0,mm3
+	movq	mm3,mm1
+	psrlq	mm1,4
+	pxor	mm5,mm6
+	pxor	mm3,mm4
+	psllq	mm4,23
+	pxor	mm3,mm1
+	movq	[32+esp],mm0
+	paddq	mm7,mm5
+	pxor	mm3,mm4
+	psrlq	mm1,23
+	paddq	mm7,[24+esp]
+	pxor	mm3,mm1
+	psllq	mm4,4
+	pxor	mm3,mm4
+	movq	mm4,[56+esp]
+	paddq	mm3,mm7
+	movq	mm5,mm0
+	psrlq	mm5,28
+	paddq	mm4,mm3
+	movq	mm6,mm0
+	movq	mm7,mm5
+	psllq	mm6,25
+	movq	mm1,[40+esp]
+	psrlq	mm5,6
+	pxor	mm7,mm6
+	psllq	mm6,5
+	pxor	mm7,mm5
+	pxor	mm0,mm1
+	psrlq	mm5,5
+	pxor	mm7,mm6
+	pand	mm2,mm0
+	psllq	mm6,6
+	pxor	mm7,mm5
+	pxor	mm2,mm1
+	pxor	mm6,mm7
+	movq	mm5,[esp]
+	paddq	mm2,mm6
+	movq	mm6,[8+esp]
+	movq	mm1,mm4
+	movq	mm7,[edx-88]
+	pxor	mm5,mm6
+	psrlq	mm1,14
+	movq	[56+esp],mm4
+	pand	mm5,mm4
+	psllq	mm4,23
+	paddq	mm2,mm3
+	movq	mm3,mm1
+	psrlq	mm1,4
+	pxor	mm5,mm6
+	pxor	mm3,mm4
+	psllq	mm4,23
+	pxor	mm3,mm1
+	movq	[24+esp],mm2
+	paddq	mm7,mm5
+	pxor	mm3,mm4
+	psrlq	mm1,23
+	paddq	mm7,[16+esp]
+	pxor	mm3,mm1
+	psllq	mm4,4
+	pxor	mm3,mm4
+	movq	mm4,[48+esp]
+	paddq	mm3,mm7
+	movq	mm5,mm2
+	psrlq	mm5,28
+	paddq	mm4,mm3
+	movq	mm6,mm2
+	movq	mm7,mm5
+	psllq	mm6,25
+	movq	mm1,[32+esp]
+	psrlq	mm5,6
+	pxor	mm7,mm6
+	psllq	mm6,5
+	pxor	mm7,mm5
+	pxor	mm2,mm1
+	psrlq	mm5,5
+	pxor	mm7,mm6
+	pand	mm0,mm2
+	psllq	mm6,6
+	pxor	mm7,mm5
+	pxor	mm0,mm1
+	pxor	mm6,mm7
+	movq	mm5,[56+esp]
+	paddq	mm0,mm6
+	movq	mm6,[esp]
+	movdqa	[edx-96],xmm4
+	movdqa	xmm6,xmm0
+	movdqa	xmm4,xmm5
+db	102,15,58,15,235,8
+	movdqa	[48+edx],xmm7
+db	102,15,58,15,247,8
+	movdqa	xmm7,xmm5
+	psrlq	xmm5,7
+	paddq	xmm3,xmm6
+	movdqa	xmm6,xmm7
+	psrlq	xmm7,1
+	psllq	xmm6,56
+	pxor	xmm5,xmm7
+	psrlq	xmm7,7
+	pxor	xmm5,xmm6
+	psllq	xmm6,7
+	pxor	xmm5,xmm7
+	movdqa	xmm7,xmm2
+	pxor	xmm5,xmm6
+	movdqa	xmm6,xmm2
+	psrlq	xmm7,6
+	paddq	xmm3,xmm5
+	movdqa	xmm5,xmm2
+	psrlq	xmm6,19
+	psllq	xmm5,3
+	pxor	xmm7,xmm6
+	psrlq	xmm6,42
+	pxor	xmm7,xmm5
+	psllq	xmm5,42
+	pxor	xmm7,xmm6
+	movdqa	xmm6,[16+edx]
+	pxor	xmm7,xmm5
+	movdqa	xmm5,[48+ebp]
+	movq	mm1,mm4
+	paddq	xmm3,xmm7
+	movq	mm7,[edx-80]
+	pxor	mm5,mm6
+	psrlq	mm1,14
+	movq	[48+esp],mm4
+	paddq	xmm5,xmm3
+	pand	mm5,mm4
+	psllq	mm4,23
+	paddq	mm0,mm3
+	movq	mm3,mm1
+	psrlq	mm1,4
+	pxor	mm5,mm6
+	pxor	mm3,mm4
+	psllq	mm4,23
+	pxor	mm3,mm1
+	movq	[16+esp],mm0
+	paddq	mm7,mm5
+	pxor	mm3,mm4
+	psrlq	mm1,23
+	paddq	mm7,[8+esp]
+	pxor	mm3,mm1
+	psllq	mm4,4
+	pxor	mm3,mm4
+	movq	mm4,[40+esp]
+	paddq	mm3,mm7
+	movq	mm5,mm0
+	psrlq	mm5,28
+	paddq	mm4,mm3
+	movq	mm6,mm0
+	movq	mm7,mm5
+	psllq	mm6,25
+	movq	mm1,[24+esp]
+	psrlq	mm5,6
+	pxor	mm7,mm6
+	psllq	mm6,5
+	pxor	mm7,mm5
+	pxor	mm0,mm1
+	psrlq	mm5,5
+	pxor	mm7,mm6
+	pand	mm2,mm0
+	psllq	mm6,6
+	pxor	mm7,mm5
+	pxor	mm2,mm1
+	pxor	mm6,mm7
+	movq	mm5,[48+esp]
+	paddq	mm2,mm6
+	movq	mm6,[56+esp]
+	movq	mm1,mm4
+	movq	mm7,[edx-72]
+	pxor	mm5,mm6
+	psrlq	mm1,14
+	movq	[40+esp],mm4
+	pand	mm5,mm4
+	psllq	mm4,23
+	paddq	mm2,mm3
+	movq	mm3,mm1
+	psrlq	mm1,4
+	pxor	mm5,mm6
+	pxor	mm3,mm4
+	psllq	mm4,23
+	pxor	mm3,mm1
+	movq	[8+esp],mm2
+	paddq	mm7,mm5
+	pxor	mm3,mm4
+	psrlq	mm1,23
+	paddq	mm7,[esp]
+	pxor	mm3,mm1
+	psllq	mm4,4
+	pxor	mm3,mm4
+	movq	mm4,[32+esp]
+	paddq	mm3,mm7
+	movq	mm5,mm2
+	psrlq	mm5,28
+	paddq	mm4,mm3
+	movq	mm6,mm2
+	movq	mm7,mm5
+	psllq	mm6,25
+	movq	mm1,[16+esp]
+	psrlq	mm5,6
+	pxor	mm7,mm6
+	psllq	mm6,5
+	pxor	mm7,mm5
+	pxor	mm2,mm1
+	psrlq	mm5,5
+	pxor	mm7,mm6
+	pand	mm0,mm2
+	psllq	mm6,6
+	pxor	mm7,mm5
+	pxor	mm0,mm1
+	pxor	mm6,mm7
+	movq	mm5,[40+esp]
+	paddq	mm0,mm6
+	movq	mm6,[48+esp]
+	movdqa	[edx-80],xmm5
+	movdqa	xmm7,xmm1
+	movdqa	xmm5,xmm6
+db	102,15,58,15,244,8
+	movdqa	[edx],xmm0
+db	102,15,58,15,248,8
+	movdqa	xmm0,xmm6
+	psrlq	xmm6,7
+	paddq	xmm4,xmm7
+	movdqa	xmm7,xmm0
+	psrlq	xmm0,1
+	psllq	xmm7,56
+	pxor	xmm6,xmm0
+	psrlq	xmm0,7
+	pxor	xmm6,xmm7
+	psllq	xmm7,7
+	pxor	xmm6,xmm0
+	movdqa	xmm0,xmm3
+	pxor	xmm6,xmm7
+	movdqa	xmm7,xmm3
+	psrlq	xmm0,6
+	paddq	xmm4,xmm6
+	movdqa	xmm6,xmm3
+	psrlq	xmm7,19
+	psllq	xmm6,3
+	pxor	xmm0,xmm7
+	psrlq	xmm7,42
+	pxor	xmm0,xmm6
+	psllq	xmm6,42
+	pxor	xmm0,xmm7
+	movdqa	xmm7,[32+edx]
+	pxor	xmm0,xmm6
+	movdqa	xmm6,[64+ebp]
+	movq	mm1,mm4
+	paddq	xmm4,xmm0
+	movq	mm7,[edx-64]
+	pxor	mm5,mm6
+	psrlq	mm1,14
+	movq	[32+esp],mm4
+	paddq	xmm6,xmm4
+	pand	mm5,mm4
+	psllq	mm4,23
+	paddq	mm0,mm3
+	movq	mm3,mm1
+	psrlq	mm1,4
+	pxor	mm5,mm6
+	pxor	mm3,mm4
+	psllq	mm4,23
+	pxor	mm3,mm1
+	movq	[esp],mm0
+	paddq	mm7,mm5
+	pxor	mm3,mm4
+	psrlq	mm1,23
+	paddq	mm7,[56+esp]
+	pxor	mm3,mm1
+	psllq	mm4,4
+	pxor	mm3,mm4
+	movq	mm4,[24+esp]
+	paddq	mm3,mm7
+	movq	mm5,mm0
+	psrlq	mm5,28
+	paddq	mm4,mm3
+	movq	mm6,mm0
+	movq	mm7,mm5
+	psllq	mm6,25
+	movq	mm1,[8+esp]
+	psrlq	mm5,6
+	pxor	mm7,mm6
+	psllq	mm6,5
+	pxor	mm7,mm5
+	pxor	mm0,mm1
+	psrlq	mm5,5
+	pxor	mm7,mm6
+	pand	mm2,mm0
+	psllq	mm6,6
+	pxor	mm7,mm5
+	pxor	mm2,mm1
+	pxor	mm6,mm7
+	movq	mm5,[32+esp]
+	paddq	mm2,mm6
+	movq	mm6,[40+esp]
+	movq	mm1,mm4
+	movq	mm7,[edx-56]
+	pxor	mm5,mm6
+	psrlq	mm1,14
+	movq	[24+esp],mm4
+	pand	mm5,mm4
+	psllq	mm4,23
+	paddq	mm2,mm3
+	movq	mm3,mm1
+	psrlq	mm1,4
+	pxor	mm5,mm6
+	pxor	mm3,mm4
+	psllq	mm4,23
+	pxor	mm3,mm1
+	movq	[56+esp],mm2
+	paddq	mm7,mm5
+	pxor	mm3,mm4
+	psrlq	mm1,23
+	paddq	mm7,[48+esp]
+	pxor	mm3,mm1
+	psllq	mm4,4
+	pxor	mm3,mm4
+	movq	mm4,[16+esp]
+	paddq	mm3,mm7
+	movq	mm5,mm2
+	psrlq	mm5,28
+	paddq	mm4,mm3
+	movq	mm6,mm2
+	movq	mm7,mm5
+	psllq	mm6,25
+	movq	mm1,[esp]
+	psrlq	mm5,6
+	pxor	mm7,mm6
+	psllq	mm6,5
+	pxor	mm7,mm5
+	pxor	mm2,mm1
+	psrlq	mm5,5
+	pxor	mm7,mm6
+	pand	mm0,mm2
+	psllq	mm6,6
+	pxor	mm7,mm5
+	pxor	mm0,mm1
+	pxor	mm6,mm7
+	movq	mm5,[24+esp]
+	paddq	mm0,mm6
+	movq	mm6,[32+esp]
+	movdqa	[edx-64],xmm6
+	movdqa	xmm0,xmm2
+	movdqa	xmm6,xmm7
+db	102,15,58,15,253,8
+	movdqa	[16+edx],xmm1
+db	102,15,58,15,193,8
+	movdqa	xmm1,xmm7
+	psrlq	xmm7,7
+	paddq	xmm5,xmm0
+	movdqa	xmm0,xmm1
+	psrlq	xmm1,1
+	psllq	xmm0,56
+	pxor	xmm7,xmm1
+	psrlq	xmm1,7
+	pxor	xmm7,xmm0
+	psllq	xmm0,7
+	pxor	xmm7,xmm1
+	movdqa	xmm1,xmm4
+	pxor	xmm7,xmm0
+	movdqa	xmm0,xmm4
+	psrlq	xmm1,6
+	paddq	xmm5,xmm7
+	movdqa	xmm7,xmm4
+	psrlq	xmm0,19
+	psllq	xmm7,3
+	pxor	xmm1,xmm0
+	psrlq	xmm0,42
+	pxor	xmm1,xmm7
+	psllq	xmm7,42
+	pxor	xmm1,xmm0
+	movdqa	xmm0,[48+edx]
+	pxor	xmm1,xmm7
+	movdqa	xmm7,[80+ebp]
+	movq	mm1,mm4
+	paddq	xmm5,xmm1
+	movq	mm7,[edx-48]
+	pxor	mm5,mm6
+	psrlq	mm1,14
+	movq	[16+esp],mm4
+	paddq	xmm7,xmm5
+	pand	mm5,mm4
+	psllq	mm4,23
+	paddq	mm0,mm3
+	movq	mm3,mm1
+	psrlq	mm1,4
+	pxor	mm5,mm6
+	pxor	mm3,mm4
+	psllq	mm4,23
+	pxor	mm3,mm1
+	movq	[48+esp],mm0
+	paddq	mm7,mm5
+	pxor	mm3,mm4
+	psrlq	mm1,23
+	paddq	mm7,[40+esp]
+	pxor	mm3,mm1
+	psllq	mm4,4
+	pxor	mm3,mm4
+	movq	mm4,[8+esp]
+	paddq	mm3,mm7
+	movq	mm5,mm0
+	psrlq	mm5,28
+	paddq	mm4,mm3
+	movq	mm6,mm0
+	movq	mm7,mm5
+	psllq	mm6,25
+	movq	mm1,[56+esp]
+	psrlq	mm5,6
+	pxor	mm7,mm6
+	psllq	mm6,5
+	pxor	mm7,mm5
+	pxor	mm0,mm1
+	psrlq	mm5,5
+	pxor	mm7,mm6
+	pand	mm2,mm0
+	psllq	mm6,6
+	pxor	mm7,mm5
+	pxor	mm2,mm1
+	pxor	mm6,mm7
+	movq	mm5,[16+esp]
+	paddq	mm2,mm6
+	movq	mm6,[24+esp]
+	movq	mm1,mm4
+	movq	mm7,[edx-40]
+	pxor	mm5,mm6
+	psrlq	mm1,14
+	movq	[8+esp],mm4
+	pand	mm5,mm4
+	psllq	mm4,23
+	paddq	mm2,mm3
+	movq	mm3,mm1
+	psrlq	mm1,4
+	pxor	mm5,mm6
+	pxor	mm3,mm4
+	psllq	mm4,23
+	pxor	mm3,mm1
+	movq	[40+esp],mm2
+	paddq	mm7,mm5
+	pxor	mm3,mm4
+	psrlq	mm1,23
+	paddq	mm7,[32+esp]
+	pxor	mm3,mm1
+	psllq	mm4,4
+	pxor	mm3,mm4
+	movq	mm4,[esp]
+	paddq	mm3,mm7
+	movq	mm5,mm2
+	psrlq	mm5,28
+	paddq	mm4,mm3
+	movq	mm6,mm2
+	movq	mm7,mm5
+	psllq	mm6,25
+	movq	mm1,[48+esp]
+	psrlq	mm5,6
+	pxor	mm7,mm6
+	psllq	mm6,5
+	pxor	mm7,mm5
+	pxor	mm2,mm1
+	psrlq	mm5,5
+	pxor	mm7,mm6
+	pand	mm0,mm2
+	psllq	mm6,6
+	pxor	mm7,mm5
+	pxor	mm0,mm1
+	pxor	mm6,mm7
+	movq	mm5,[8+esp]
+	paddq	mm0,mm6
+	movq	mm6,[16+esp]
+	movdqa	[edx-48],xmm7
+	movdqa	xmm1,xmm3
+	movdqa	xmm7,xmm0
+db	102,15,58,15,198,8
+	movdqa	[32+edx],xmm2
+db	102,15,58,15,202,8
+	movdqa	xmm2,xmm0
+	psrlq	xmm0,7
+	paddq	xmm6,xmm1
+	movdqa	xmm1,xmm2
+	psrlq	xmm2,1
+	psllq	xmm1,56
+	pxor	xmm0,xmm2
+	psrlq	xmm2,7
+	pxor	xmm0,xmm1
+	psllq	xmm1,7
+	pxor	xmm0,xmm2
+	movdqa	xmm2,xmm5
+	pxor	xmm0,xmm1
+	movdqa	xmm1,xmm5
+	psrlq	xmm2,6
+	paddq	xmm6,xmm0
+	movdqa	xmm0,xmm5
+	psrlq	xmm1,19
+	psllq	xmm0,3
+	pxor	xmm2,xmm1
+	psrlq	xmm1,42
+	pxor	xmm2,xmm0
+	psllq	xmm0,42
+	pxor	xmm2,xmm1
+	movdqa	xmm1,[edx]
+	pxor	xmm2,xmm0
+	movdqa	xmm0,[96+ebp]
+	movq	mm1,mm4
+	paddq	xmm6,xmm2
+	movq	mm7,[edx-32]
+	pxor	mm5,mm6
+	psrlq	mm1,14
+	movq	[esp],mm4
+	paddq	xmm0,xmm6
+	pand	mm5,mm4
+	psllq	mm4,23
+	paddq	mm0,mm3
+	movq	mm3,mm1
+	psrlq	mm1,4
+	pxor	mm5,mm6
+	pxor	mm3,mm4
+	psllq	mm4,23
+	pxor	mm3,mm1
+	movq	[32+esp],mm0
+	paddq	mm7,mm5
+	pxor	mm3,mm4
+	psrlq	mm1,23
+	paddq	mm7,[24+esp]
+	pxor	mm3,mm1
+	psllq	mm4,4
+	pxor	mm3,mm4
+	movq	mm4,[56+esp]
+	paddq	mm3,mm7
+	movq	mm5,mm0
+	psrlq	mm5,28
+	paddq	mm4,mm3
+	movq	mm6,mm0
+	movq	mm7,mm5
+	psllq	mm6,25
+	movq	mm1,[40+esp]
+	psrlq	mm5,6
+	pxor	mm7,mm6
+	psllq	mm6,5
+	pxor	mm7,mm5
+	pxor	mm0,mm1
+	psrlq	mm5,5
+	pxor	mm7,mm6
+	pand	mm2,mm0
+	psllq	mm6,6
+	pxor	mm7,mm5
+	pxor	mm2,mm1
+	pxor	mm6,mm7
+	movq	mm5,[esp]
+	paddq	mm2,mm6
+	movq	mm6,[8+esp]
+	movq	mm1,mm4
+	movq	mm7,[edx-24]
+	pxor	mm5,mm6
+	psrlq	mm1,14
+	movq	[56+esp],mm4
+	pand	mm5,mm4
+	psllq	mm4,23
+	paddq	mm2,mm3
+	movq	mm3,mm1
+	psrlq	mm1,4
+	pxor	mm5,mm6
+	pxor	mm3,mm4
+	psllq	mm4,23
+	pxor	mm3,mm1
+	movq	[24+esp],mm2
+	paddq	mm7,mm5
+	pxor	mm3,mm4
+	psrlq	mm1,23
+	paddq	mm7,[16+esp]
+	pxor	mm3,mm1
+	psllq	mm4,4
+	pxor	mm3,mm4
+	movq	mm4,[48+esp]
+	paddq	mm3,mm7
+	movq	mm5,mm2
+	psrlq	mm5,28
+	paddq	mm4,mm3
+	movq	mm6,mm2
+	movq	mm7,mm5
+	psllq	mm6,25
+	movq	mm1,[32+esp]
+	psrlq	mm5,6
+	pxor	mm7,mm6
+	psllq	mm6,5
+	pxor	mm7,mm5
+	pxor	mm2,mm1
+	psrlq	mm5,5
+	pxor	mm7,mm6
+	pand	mm0,mm2
+	psllq	mm6,6
+	pxor	mm7,mm5
+	pxor	mm0,mm1
+	pxor	mm6,mm7
+	movq	mm5,[56+esp]
+	paddq	mm0,mm6
+	movq	mm6,[esp]
+	movdqa	[edx-32],xmm0
+	movdqa	xmm2,xmm4
+	movdqa	xmm0,xmm1
+db	102,15,58,15,207,8
+	movdqa	[48+edx],xmm3
+db	102,15,58,15,211,8
+	movdqa	xmm3,xmm1
+	psrlq	xmm1,7
+	paddq	xmm7,xmm2
+	movdqa	xmm2,xmm3
+	psrlq	xmm3,1
+	psllq	xmm2,56
+	pxor	xmm1,xmm3
+	psrlq	xmm3,7
+	pxor	xmm1,xmm2
+	psllq	xmm2,7
+	pxor	xmm1,xmm3
+	movdqa	xmm3,xmm6
+	pxor	xmm1,xmm2
+	movdqa	xmm2,xmm6
+	psrlq	xmm3,6
+	paddq	xmm7,xmm1
+	movdqa	xmm1,xmm6
+	psrlq	xmm2,19
+	psllq	xmm1,3
+	pxor	xmm3,xmm2
+	psrlq	xmm2,42
+	pxor	xmm3,xmm1
+	psllq	xmm1,42
+	pxor	xmm3,xmm2
+	movdqa	xmm2,[16+edx]
+	pxor	xmm3,xmm1
+	movdqa	xmm1,[112+ebp]
+	movq	mm1,mm4
+	paddq	xmm7,xmm3
+	movq	mm7,[edx-16]
+	pxor	mm5,mm6
+	psrlq	mm1,14
+	movq	[48+esp],mm4
+	paddq	xmm1,xmm7
+	pand	mm5,mm4
+	psllq	mm4,23
+	paddq	mm0,mm3
+	movq	mm3,mm1
+	psrlq	mm1,4
+	pxor	mm5,mm6
+	pxor	mm3,mm4
+	psllq	mm4,23
+	pxor	mm3,mm1
+	movq	[16+esp],mm0
+	paddq	mm7,mm5
+	pxor	mm3,mm4
+	psrlq	mm1,23
+	paddq	mm7,[8+esp]
+	pxor	mm3,mm1
+	psllq	mm4,4
+	pxor	mm3,mm4
+	movq	mm4,[40+esp]
+	paddq	mm3,mm7
+	movq	mm5,mm0
+	psrlq	mm5,28
+	paddq	mm4,mm3
+	movq	mm6,mm0
+	movq	mm7,mm5
+	psllq	mm6,25
+	movq	mm1,[24+esp]
+	psrlq	mm5,6
+	pxor	mm7,mm6
+	psllq	mm6,5
+	pxor	mm7,mm5
+	pxor	mm0,mm1
+	psrlq	mm5,5
+	pxor	mm7,mm6
+	pand	mm2,mm0
+	psllq	mm6,6
+	pxor	mm7,mm5
+	pxor	mm2,mm1
+	pxor	mm6,mm7
+	movq	mm5,[48+esp]
+	paddq	mm2,mm6
+	movq	mm6,[56+esp]
+	movq	mm1,mm4
+	movq	mm7,[edx-8]
+	pxor	mm5,mm6
+	psrlq	mm1,14
+	movq	[40+esp],mm4
+	pand	mm5,mm4
+	psllq	mm4,23
+	paddq	mm2,mm3
+	movq	mm3,mm1
+	psrlq	mm1,4
+	pxor	mm5,mm6
+	pxor	mm3,mm4
+	psllq	mm4,23
+	pxor	mm3,mm1
+	movq	[8+esp],mm2
+	paddq	mm7,mm5
+	pxor	mm3,mm4
+	psrlq	mm1,23
+	paddq	mm7,[esp]
+	pxor	mm3,mm1
+	psllq	mm4,4
+	pxor	mm3,mm4
+	movq	mm4,[32+esp]
+	paddq	mm3,mm7
+	movq	mm5,mm2
+	psrlq	mm5,28
+	paddq	mm4,mm3
+	movq	mm6,mm2
+	movq	mm7,mm5
+	psllq	mm6,25
+	movq	mm1,[16+esp]
+	psrlq	mm5,6
+	pxor	mm7,mm6
+	psllq	mm6,5
+	pxor	mm7,mm5
+	pxor	mm2,mm1
+	psrlq	mm5,5
+	pxor	mm7,mm6
+	pand	mm0,mm2
+	psllq	mm6,6
+	pxor	mm7,mm5
+	pxor	mm0,mm1
+	pxor	mm6,mm7
+	movq	mm5,[40+esp]
+	paddq	mm0,mm6
+	movq	mm6,[48+esp]
+	movdqa	[edx-16],xmm1
+	lea	ebp,[128+ebp]
+	dec	ecx
+	jnz	NEAR L$00800_47_ssse3
+	movdqa	xmm1,[ebp]
+	lea	ebp,[ebp-640]
+	movdqu	xmm0,[ebx]
+db	102,15,56,0,193
+	movdqa	xmm3,[ebp]
+	movdqa	xmm2,xmm1
+	movdqu	xmm1,[16+ebx]
+	paddq	xmm3,xmm0
+db	102,15,56,0,202
+	movq	mm1,mm4
+	movq	mm7,[edx-128]
+	pxor	mm5,mm6
+	psrlq	mm1,14
+	movq	[32+esp],mm4
+	pand	mm5,mm4
+	psllq	mm4,23
+	paddq	mm0,mm3
+	movq	mm3,mm1
+	psrlq	mm1,4
+	pxor	mm5,mm6
+	pxor	mm3,mm4
+	psllq	mm4,23
+	pxor	mm3,mm1
+	movq	[esp],mm0
+	paddq	mm7,mm5
+	pxor	mm3,mm4
+	psrlq	mm1,23
+	paddq	mm7,[56+esp]
+	pxor	mm3,mm1
+	psllq	mm4,4
+	pxor	mm3,mm4
+	movq	mm4,[24+esp]
+	paddq	mm3,mm7
+	movq	mm5,mm0
+	psrlq	mm5,28
+	paddq	mm4,mm3
+	movq	mm6,mm0
+	movq	mm7,mm5
+	psllq	mm6,25
+	movq	mm1,[8+esp]
+	psrlq	mm5,6
+	pxor	mm7,mm6
+	psllq	mm6,5
+	pxor	mm7,mm5
+	pxor	mm0,mm1
+	psrlq	mm5,5
+	pxor	mm7,mm6
+	pand	mm2,mm0
+	psllq	mm6,6
+	pxor	mm7,mm5
+	pxor	mm2,mm1
+	pxor	mm6,mm7
+	movq	mm5,[32+esp]
+	paddq	mm2,mm6
+	movq	mm6,[40+esp]
+	movq	mm1,mm4
+	movq	mm7,[edx-120]
+	pxor	mm5,mm6
+	psrlq	mm1,14
+	movq	[24+esp],mm4
+	pand	mm5,mm4
+	psllq	mm4,23
+	paddq	mm2,mm3
+	movq	mm3,mm1
+	psrlq	mm1,4
+	pxor	mm5,mm6
+	pxor	mm3,mm4
+	psllq	mm4,23
+	pxor	mm3,mm1
+	movq	[56+esp],mm2
+	paddq	mm7,mm5
+	pxor	mm3,mm4
+	psrlq	mm1,23
+	paddq	mm7,[48+esp]
+	pxor	mm3,mm1
+	psllq	mm4,4
+	pxor	mm3,mm4
+	movq	mm4,[16+esp]
+	paddq	mm3,mm7
+	movq	mm5,mm2
+	psrlq	mm5,28
+	paddq	mm4,mm3
+	movq	mm6,mm2
+	movq	mm7,mm5
+	psllq	mm6,25
+	movq	mm1,[esp]
+	psrlq	mm5,6
+	pxor	mm7,mm6
+	psllq	mm6,5
+	pxor	mm7,mm5
+	pxor	mm2,mm1
+	psrlq	mm5,5
+	pxor	mm7,mm6
+	pand	mm0,mm2
+	psllq	mm6,6
+	pxor	mm7,mm5
+	pxor	mm0,mm1
+	pxor	mm6,mm7
+	movq	mm5,[24+esp]
+	paddq	mm0,mm6
+	movq	mm6,[32+esp]
+	movdqa	[edx-128],xmm3
+	movdqa	xmm4,[16+ebp]
+	movdqa	xmm3,xmm2
+	movdqu	xmm2,[32+ebx]
+	paddq	xmm4,xmm1
+db	102,15,56,0,211
+	movq	mm1,mm4
+	movq	mm7,[edx-112]
+	pxor	mm5,mm6
+	psrlq	mm1,14
+	movq	[16+esp],mm4
+	pand	mm5,mm4
+	psllq	mm4,23
+	paddq	mm0,mm3
+	movq	mm3,mm1
+	psrlq	mm1,4
+	pxor	mm5,mm6
+	pxor	mm3,mm4
+	psllq	mm4,23
+	pxor	mm3,mm1
+	movq	[48+esp],mm0
+	paddq	mm7,mm5
+	pxor	mm3,mm4
+	psrlq	mm1,23
+	paddq	mm7,[40+esp]
+	pxor	mm3,mm1
+	psllq	mm4,4
+	pxor	mm3,mm4
+	movq	mm4,[8+esp]
+	paddq	mm3,mm7
+	movq	mm5,mm0
+	psrlq	mm5,28
+	paddq	mm4,mm3
+	movq	mm6,mm0
+	movq	mm7,mm5
+	psllq	mm6,25
+	movq	mm1,[56+esp]
+	psrlq	mm5,6
+	pxor	mm7,mm6
+	psllq	mm6,5
+	pxor	mm7,mm5
+	pxor	mm0,mm1
+	psrlq	mm5,5
+	pxor	mm7,mm6
+	pand	mm2,mm0
+	psllq	mm6,6
+	pxor	mm7,mm5
+	pxor	mm2,mm1
+	pxor	mm6,mm7
+	movq	mm5,[16+esp]
+	paddq	mm2,mm6
+	movq	mm6,[24+esp]
+	movq	mm1,mm4
+	movq	mm7,[edx-104]
+	pxor	mm5,mm6
+	psrlq	mm1,14
+	movq	[8+esp],mm4
+	pand	mm5,mm4
+	psllq	mm4,23
+	paddq	mm2,mm3
+	movq	mm3,mm1
+	psrlq	mm1,4
+	pxor	mm5,mm6
+	pxor	mm3,mm4
+	psllq	mm4,23
+	pxor	mm3,mm1
+	movq	[40+esp],mm2
+	paddq	mm7,mm5
+	pxor	mm3,mm4
+	psrlq	mm1,23
+	paddq	mm7,[32+esp]
+	pxor	mm3,mm1
+	psllq	mm4,4
+	pxor	mm3,mm4
+	movq	mm4,[esp]
+	paddq	mm3,mm7
+	movq	mm5,mm2
+	psrlq	mm5,28
+	paddq	mm4,mm3
+	movq	mm6,mm2
+	movq	mm7,mm5
+	psllq	mm6,25
+	movq	mm1,[48+esp]
+	psrlq	mm5,6
+	pxor	mm7,mm6
+	psllq	mm6,5
+	pxor	mm7,mm5
+	pxor	mm2,mm1
+	psrlq	mm5,5
+	pxor	mm7,mm6
+	pand	mm0,mm2
+	psllq	mm6,6
+	pxor	mm7,mm5
+	pxor	mm0,mm1
+	pxor	mm6,mm7
+	movq	mm5,[8+esp]
+	paddq	mm0,mm6
+	movq	mm6,[16+esp]
+	movdqa	[edx-112],xmm4
+	movdqa	xmm5,[32+ebp]
+	movdqa	xmm4,xmm3
+	movdqu	xmm3,[48+ebx]
+	paddq	xmm5,xmm2
+db	102,15,56,0,220
+	movq	mm1,mm4
+	movq	mm7,[edx-96]
+	pxor	mm5,mm6
+	psrlq	mm1,14
+	movq	[esp],mm4
+	pand	mm5,mm4
+	psllq	mm4,23
+	paddq	mm0,mm3
+	movq	mm3,mm1
+	psrlq	mm1,4
+	pxor	mm5,mm6
+	pxor	mm3,mm4
+	psllq	mm4,23
+	pxor	mm3,mm1
+	movq	[32+esp],mm0
+	paddq	mm7,mm5
+	pxor	mm3,mm4
+	psrlq	mm1,23
+	paddq	mm7,[24+esp]
+	pxor	mm3,mm1
+	psllq	mm4,4
+	pxor	mm3,mm4
+	movq	mm4,[56+esp]
+	paddq	mm3,mm7
+	movq	mm5,mm0
+	psrlq	mm5,28
+	paddq	mm4,mm3
+	movq	mm6,mm0
+	movq	mm7,mm5
+	psllq	mm6,25
+	movq	mm1,[40+esp]
+	psrlq	mm5,6
+	pxor	mm7,mm6
+	psllq	mm6,5
+	pxor	mm7,mm5
+	pxor	mm0,mm1
+	psrlq	mm5,5
+	pxor	mm7,mm6
+	pand	mm2,mm0
+	psllq	mm6,6
+	pxor	mm7,mm5
+	pxor	mm2,mm1
+	pxor	mm6,mm7
+	movq	mm5,[esp]
+	paddq	mm2,mm6
+	movq	mm6,[8+esp]
+	movq	mm1,mm4
+	movq	mm7,[edx-88]
+	pxor	mm5,mm6
+	psrlq	mm1,14
+	movq	[56+esp],mm4
+	pand	mm5,mm4
+	psllq	mm4,23
+	paddq	mm2,mm3
+	movq	mm3,mm1
+	psrlq	mm1,4
+	pxor	mm5,mm6
+	pxor	mm3,mm4
+	psllq	mm4,23
+	pxor	mm3,mm1
+	movq	[24+esp],mm2
+	paddq	mm7,mm5
+	pxor	mm3,mm4
+	psrlq	mm1,23
+	paddq	mm7,[16+esp]
+	pxor	mm3,mm1
+	psllq	mm4,4
+	pxor	mm3,mm4
+	movq	mm4,[48+esp]
+	paddq	mm3,mm7
+	movq	mm5,mm2
+	psrlq	mm5,28
+	paddq	mm4,mm3
+	movq	mm6,mm2
+	movq	mm7,mm5
+	psllq	mm6,25
+	movq	mm1,[32+esp]
+	psrlq	mm5,6
+	pxor	mm7,mm6
+	psllq	mm6,5
+	pxor	mm7,mm5
+	pxor	mm2,mm1
+	psrlq	mm5,5
+	pxor	mm7,mm6
+	pand	mm0,mm2
+	psllq	mm6,6
+	pxor	mm7,mm5
+	pxor	mm0,mm1
+	pxor	mm6,mm7
+	movq	mm5,[56+esp]
+	paddq	mm0,mm6
+	movq	mm6,[esp]
+	movdqa	[edx-96],xmm5
+	movdqa	xmm6,[48+ebp]
+	movdqa	xmm5,xmm4
+	movdqu	xmm4,[64+ebx]
+	paddq	xmm6,xmm3
+db	102,15,56,0,229
+	movq	mm1,mm4
+	movq	mm7,[edx-80]
+	pxor	mm5,mm6
+	psrlq	mm1,14
+	movq	[48+esp],mm4
+	pand	mm5,mm4
+	psllq	mm4,23
+	paddq	mm0,mm3
+	movq	mm3,mm1
+	psrlq	mm1,4
+	pxor	mm5,mm6
+	pxor	mm3,mm4
+	psllq	mm4,23
+	pxor	mm3,mm1
+	movq	[16+esp],mm0
+	paddq	mm7,mm5
+	pxor	mm3,mm4
+	psrlq	mm1,23
+	paddq	mm7,[8+esp]
+	pxor	mm3,mm1
+	psllq	mm4,4
+	pxor	mm3,mm4
+	movq	mm4,[40+esp]
+	paddq	mm3,mm7
+	movq	mm5,mm0
+	psrlq	mm5,28
+	paddq	mm4,mm3
+	movq	mm6,mm0
+	movq	mm7,mm5
+	psllq	mm6,25
+	movq	mm1,[24+esp]
+	psrlq	mm5,6
+	pxor	mm7,mm6
+	psllq	mm6,5
+	pxor	mm7,mm5
+	pxor	mm0,mm1
+	psrlq	mm5,5
+	pxor	mm7,mm6
+	pand	mm2,mm0
+	psllq	mm6,6
+	pxor	mm7,mm5
+	pxor	mm2,mm1
+	pxor	mm6,mm7
+	movq	mm5,[48+esp]
+	paddq	mm2,mm6
+	movq	mm6,[56+esp]
+	movq	mm1,mm4
+	movq	mm7,[edx-72]
+	pxor	mm5,mm6
+	psrlq	mm1,14
+	movq	[40+esp],mm4
+	pand	mm5,mm4
+	psllq	mm4,23
+	paddq	mm2,mm3
+	movq	mm3,mm1
+	psrlq	mm1,4
+	pxor	mm5,mm6
+	pxor	mm3,mm4
+	psllq	mm4,23
+	pxor	mm3,mm1
+	movq	[8+esp],mm2
+	paddq	mm7,mm5
+	pxor	mm3,mm4
+	psrlq	mm1,23
+	paddq	mm7,[esp]
+	pxor	mm3,mm1
+	psllq	mm4,4
+	pxor	mm3,mm4
+	movq	mm4,[32+esp]
+	paddq	mm3,mm7
+	movq	mm5,mm2
+	psrlq	mm5,28
+	paddq	mm4,mm3
+	movq	mm6,mm2
+	movq	mm7,mm5
+	psllq	mm6,25
+	movq	mm1,[16+esp]
+	psrlq	mm5,6
+	pxor	mm7,mm6
+	psllq	mm6,5
+	pxor	mm7,mm5
+	pxor	mm2,mm1
+	psrlq	mm5,5
+	pxor	mm7,mm6
+	pand	mm0,mm2
+	psllq	mm6,6
+	pxor	mm7,mm5
+	pxor	mm0,mm1
+	pxor	mm6,mm7
+	movq	mm5,[40+esp]
+	paddq	mm0,mm6
+	movq	mm6,[48+esp]
+	movdqa	[edx-80],xmm6
+	movdqa	xmm7,[64+ebp]
+	movdqa	xmm6,xmm5
+	movdqu	xmm5,[80+ebx]
+	paddq	xmm7,xmm4
+db	102,15,56,0,238
+	movq	mm1,mm4
+	movq	mm7,[edx-64]
+	pxor	mm5,mm6
+	psrlq	mm1,14
+	movq	[32+esp],mm4
+	pand	mm5,mm4
+	psllq	mm4,23
+	paddq	mm0,mm3
+	movq	mm3,mm1
+	psrlq	mm1,4
+	pxor	mm5,mm6
+	pxor	mm3,mm4
+	psllq	mm4,23
+	pxor	mm3,mm1
+	movq	[esp],mm0
+	paddq	mm7,mm5
+	pxor	mm3,mm4
+	psrlq	mm1,23
+	paddq	mm7,[56+esp]
+	pxor	mm3,mm1
+	psllq	mm4,4
+	pxor	mm3,mm4
+	movq	mm4,[24+esp]
+	paddq	mm3,mm7
+	movq	mm5,mm0
+	psrlq	mm5,28
+	paddq	mm4,mm3
+	movq	mm6,mm0
+	movq	mm7,mm5
+	psllq	mm6,25
+	movq	mm1,[8+esp]
+	psrlq	mm5,6
+	pxor	mm7,mm6
+	psllq	mm6,5
+	pxor	mm7,mm5
+	pxor	mm0,mm1
+	psrlq	mm5,5
+	pxor	mm7,mm6
+	pand	mm2,mm0
+	psllq	mm6,6
+	pxor	mm7,mm5
+	pxor	mm2,mm1
+	pxor	mm6,mm7
+	movq	mm5,[32+esp]
+	paddq	mm2,mm6
+	movq	mm6,[40+esp]
+	movq	mm1,mm4
+	movq	mm7,[edx-56]
+	pxor	mm5,mm6
+	psrlq	mm1,14
+	movq	[24+esp],mm4
+	pand	mm5,mm4
+	psllq	mm4,23
+	paddq	mm2,mm3
+	movq	mm3,mm1
+	psrlq	mm1,4
+	pxor	mm5,mm6
+	pxor	mm3,mm4
+	psllq	mm4,23
+	pxor	mm3,mm1
+	movq	[56+esp],mm2
+	paddq	mm7,mm5
+	pxor	mm3,mm4
+	psrlq	mm1,23
+	paddq	mm7,[48+esp]
+	pxor	mm3,mm1
+	psllq	mm4,4
+	pxor	mm3,mm4
+	movq	mm4,[16+esp]
+	paddq	mm3,mm7
+	movq	mm5,mm2
+	psrlq	mm5,28
+	paddq	mm4,mm3
+	movq	mm6,mm2
+	movq	mm7,mm5
+	psllq	mm6,25
+	movq	mm1,[esp]
+	psrlq	mm5,6
+	pxor	mm7,mm6
+	psllq	mm6,5
+	pxor	mm7,mm5
+	pxor	mm2,mm1
+	psrlq	mm5,5
+	pxor	mm7,mm6
+	pand	mm0,mm2
+	psllq	mm6,6
+	pxor	mm7,mm5
+	pxor	mm0,mm1
+	pxor	mm6,mm7
+	movq	mm5,[24+esp]
+	paddq	mm0,mm6
+	movq	mm6,[32+esp]
+	movdqa	[edx-64],xmm7
+	movdqa	[edx],xmm0
+	movdqa	xmm0,[80+ebp]
+	movdqa	xmm7,xmm6
+	movdqu	xmm6,[96+ebx]
+	paddq	xmm0,xmm5
+db	102,15,56,0,247
+	movq	mm1,mm4
+	movq	mm7,[edx-48]
+	pxor	mm5,mm6
+	psrlq	mm1,14
+	movq	[16+esp],mm4
+	pand	mm5,mm4
+	psllq	mm4,23
+	paddq	mm0,mm3
+	movq	mm3,mm1
+	psrlq	mm1,4
+	pxor	mm5,mm6
+	pxor	mm3,mm4
+	psllq	mm4,23
+	pxor	mm3,mm1
+	movq	[48+esp],mm0
+	paddq	mm7,mm5
+	pxor	mm3,mm4
+	psrlq	mm1,23
+	paddq	mm7,[40+esp]
+	pxor	mm3,mm1
+	psllq	mm4,4
+	pxor	mm3,mm4
+	movq	mm4,[8+esp]
+	paddq	mm3,mm7
+	movq	mm5,mm0
+	psrlq	mm5,28
+	paddq	mm4,mm3
+	movq	mm6,mm0
+	movq	mm7,mm5
+	psllq	mm6,25
+	movq	mm1,[56+esp]
+	psrlq	mm5,6
+	pxor	mm7,mm6
+	psllq	mm6,5
+	pxor	mm7,mm5
+	pxor	mm0,mm1
+	psrlq	mm5,5
+	pxor	mm7,mm6
+	pand	mm2,mm0
+	psllq	mm6,6
+	pxor	mm7,mm5
+	pxor	mm2,mm1
+	pxor	mm6,mm7
+	movq	mm5,[16+esp]
+	paddq	mm2,mm6
+	movq	mm6,[24+esp]
+	movq	mm1,mm4
+	movq	mm7,[edx-40]
+	pxor	mm5,mm6
+	psrlq	mm1,14
+	movq	[8+esp],mm4
+	pand	mm5,mm4
+	psllq	mm4,23
+	paddq	mm2,mm3
+	movq	mm3,mm1
+	psrlq	mm1,4
+	pxor	mm5,mm6
+	pxor	mm3,mm4
+	psllq	mm4,23
+	pxor	mm3,mm1
+	movq	[40+esp],mm2
+	paddq	mm7,mm5
+	pxor	mm3,mm4
+	psrlq	mm1,23
+	paddq	mm7,[32+esp]
+	pxor	mm3,mm1
+	psllq	mm4,4
+	pxor	mm3,mm4
+	movq	mm4,[esp]
+	paddq	mm3,mm7
+	movq	mm5,mm2
+	psrlq	mm5,28
+	paddq	mm4,mm3
+	movq	mm6,mm2
+	movq	mm7,mm5
+	psllq	mm6,25
+	movq	mm1,[48+esp]
+	psrlq	mm5,6
+	pxor	mm7,mm6
+	psllq	mm6,5
+	pxor	mm7,mm5
+	pxor	mm2,mm1
+	psrlq	mm5,5
+	pxor	mm7,mm6
+	pand	mm0,mm2
+	psllq	mm6,6
+	pxor	mm7,mm5
+	pxor	mm0,mm1
+	pxor	mm6,mm7
+	movq	mm5,[8+esp]
+	paddq	mm0,mm6
+	movq	mm6,[16+esp]
+	movdqa	[edx-48],xmm0
+	movdqa	[16+edx],xmm1
+	movdqa	xmm1,[96+ebp]
+	movdqa	xmm0,xmm7
+	movdqu	xmm7,[112+ebx]
+	paddq	xmm1,xmm6
+db	102,15,56,0,248
+	movq	mm1,mm4
+	movq	mm7,[edx-32]
+	pxor	mm5,mm6
+	psrlq	mm1,14
+	movq	[esp],mm4
+	pand	mm5,mm4
+	psllq	mm4,23
+	paddq	mm0,mm3
+	movq	mm3,mm1
+	psrlq	mm1,4
+	pxor	mm5,mm6
+	pxor	mm3,mm4
+	psllq	mm4,23
+	pxor	mm3,mm1
+	movq	[32+esp],mm0
+	paddq	mm7,mm5
+	pxor	mm3,mm4
+	psrlq	mm1,23
+	paddq	mm7,[24+esp]
+	pxor	mm3,mm1
+	psllq	mm4,4
+	pxor	mm3,mm4
+	movq	mm4,[56+esp]
+	paddq	mm3,mm7
+	movq	mm5,mm0
+	psrlq	mm5,28
+	paddq	mm4,mm3
+	movq	mm6,mm0
+	movq	mm7,mm5
+	psllq	mm6,25
+	movq	mm1,[40+esp]
+	psrlq	mm5,6
+	pxor	mm7,mm6
+	psllq	mm6,5
+	pxor	mm7,mm5
+	pxor	mm0,mm1
+	psrlq	mm5,5
+	pxor	mm7,mm6
+	pand	mm2,mm0
+	psllq	mm6,6
+	pxor	mm7,mm5
+	pxor	mm2,mm1
+	pxor	mm6,mm7
+	movq	mm5,[esp]
+	paddq	mm2,mm6
+	movq	mm6,[8+esp]
+	movq	mm1,mm4
+	movq	mm7,[edx-24]
+	pxor	mm5,mm6
+	psrlq	mm1,14
+	movq	[56+esp],mm4
+	pand	mm5,mm4
+	psllq	mm4,23
+	paddq	mm2,mm3
+	movq	mm3,mm1
+	psrlq	mm1,4
+	pxor	mm5,mm6
+	pxor	mm3,mm4
+	psllq	mm4,23
+	pxor	mm3,mm1
+	movq	[24+esp],mm2
+	paddq	mm7,mm5
+	pxor	mm3,mm4
+	psrlq	mm1,23
+	paddq	mm7,[16+esp]
+	pxor	mm3,mm1
+	psllq	mm4,4
+	pxor	mm3,mm4
+	movq	mm4,[48+esp]
+	paddq	mm3,mm7
+	movq	mm5,mm2
+	psrlq	mm5,28
+	paddq	mm4,mm3
+	movq	mm6,mm2
+	movq	mm7,mm5
+	psllq	mm6,25
+	movq	mm1,[32+esp]
+	psrlq	mm5,6
+	pxor	mm7,mm6
+	psllq	mm6,5
+	pxor	mm7,mm5
+	pxor	mm2,mm1
+	psrlq	mm5,5
+	pxor	mm7,mm6
+	pand	mm0,mm2
+	psllq	mm6,6
+	pxor	mm7,mm5
+	pxor	mm0,mm1
+	pxor	mm6,mm7
+	movq	mm5,[56+esp]
+	paddq	mm0,mm6
+	movq	mm6,[esp]
+	movdqa	[edx-32],xmm1
+	movdqa	[32+edx],xmm2
+	movdqa	xmm2,[112+ebp]
+	movdqa	xmm0,[edx]
+	paddq	xmm2,xmm7
+	movq	mm1,mm4
+	movq	mm7,[edx-16]
+	pxor	mm5,mm6
+	psrlq	mm1,14
+	movq	[48+esp],mm4
+	pand	mm5,mm4
+	psllq	mm4,23
+	paddq	mm0,mm3
+	movq	mm3,mm1
+	psrlq	mm1,4
+	pxor	mm5,mm6
+	pxor	mm3,mm4
+	psllq	mm4,23
+	pxor	mm3,mm1
+	movq	[16+esp],mm0
+	paddq	mm7,mm5
+	pxor	mm3,mm4
+	psrlq	mm1,23
+	paddq	mm7,[8+esp]
+	pxor	mm3,mm1
+	psllq	mm4,4
+	pxor	mm3,mm4
+	movq	mm4,[40+esp]
+	paddq	mm3,mm7
+	movq	mm5,mm0
+	psrlq	mm5,28
+	paddq	mm4,mm3
+	movq	mm6,mm0
+	movq	mm7,mm5
+	psllq	mm6,25
+	movq	mm1,[24+esp]
+	psrlq	mm5,6
+	pxor	mm7,mm6
+	psllq	mm6,5
+	pxor	mm7,mm5
+	pxor	mm0,mm1
+	psrlq	mm5,5
+	pxor	mm7,mm6
+	pand	mm2,mm0
+	psllq	mm6,6
+	pxor	mm7,mm5
+	pxor	mm2,mm1
+	pxor	mm6,mm7
+	movq	mm5,[48+esp]
+	paddq	mm2,mm6
+	movq	mm6,[56+esp]
+	movq	mm1,mm4
+	movq	mm7,[edx-8]
+	pxor	mm5,mm6
+	psrlq	mm1,14
+	movq	[40+esp],mm4
+	pand	mm5,mm4
+	psllq	mm4,23
+	paddq	mm2,mm3
+	movq	mm3,mm1
+	psrlq	mm1,4
+	pxor	mm5,mm6
+	pxor	mm3,mm4
+	psllq	mm4,23
+	pxor	mm3,mm1
+	movq	[8+esp],mm2
+	paddq	mm7,mm5
+	pxor	mm3,mm4
+	psrlq	mm1,23
+	paddq	mm7,[esp]
+	pxor	mm3,mm1
+	psllq	mm4,4
+	pxor	mm3,mm4
+	movq	mm4,[32+esp]
+	paddq	mm3,mm7
+	movq	mm5,mm2
+	psrlq	mm5,28
+	paddq	mm4,mm3
+	movq	mm6,mm2
+	movq	mm7,mm5
+	psllq	mm6,25
+	movq	mm1,[16+esp]
+	psrlq	mm5,6
+	pxor	mm7,mm6
+	psllq	mm6,5
+	pxor	mm7,mm5
+	pxor	mm2,mm1
+	psrlq	mm5,5
+	pxor	mm7,mm6
+	pand	mm0,mm2
+	psllq	mm6,6
+	pxor	mm7,mm5
+	pxor	mm0,mm1
+	pxor	mm6,mm7
+	movq	mm5,[40+esp]
+	paddq	mm0,mm6
+	movq	mm6,[48+esp]
+	movdqa	[edx-16],xmm2
+	movq	mm1,[8+esp]
+	paddq	mm0,mm3
+	movq	mm3,[24+esp]
+	movq	mm7,[56+esp]
+	pxor	mm2,mm1
+	paddq	mm0,[esi]
+	paddq	mm1,[8+esi]
+	paddq	mm2,[16+esi]
+	paddq	mm3,[24+esi]
+	paddq	mm4,[32+esi]
+	paddq	mm5,[40+esi]
+	paddq	mm6,[48+esi]
+	paddq	mm7,[56+esi]
+	movq	[esi],mm0
+	movq	[8+esi],mm1
+	movq	[16+esi],mm2
+	movq	[24+esi],mm3
+	movq	[32+esi],mm4
+	movq	[40+esi],mm5
+	movq	[48+esi],mm6
+	movq	[56+esi],mm7
+	cmp	edi,eax
+	jb	NEAR L$007loop_ssse3
+	mov	esp,DWORD [76+edx]
+	emms
+	pop	edi
+	pop	esi
+	pop	ebx
+	pop	ebp
+	ret
+align	16
+L$002loop_x86:
+	mov	eax,DWORD [edi]
+	mov	ebx,DWORD [4+edi]
+	mov	ecx,DWORD [8+edi]
+	mov	edx,DWORD [12+edi]
+	bswap	eax
+	bswap	ebx
+	bswap	ecx
+	bswap	edx
+	push	eax
+	push	ebx
+	push	ecx
+	push	edx
+	mov	eax,DWORD [16+edi]
+	mov	ebx,DWORD [20+edi]
+	mov	ecx,DWORD [24+edi]
+	mov	edx,DWORD [28+edi]
+	bswap	eax
+	bswap	ebx
+	bswap	ecx
+	bswap	edx
+	push	eax
+	push	ebx
+	push	ecx
+	push	edx
+	mov	eax,DWORD [32+edi]
+	mov	ebx,DWORD [36+edi]
+	mov	ecx,DWORD [40+edi]
+	mov	edx,DWORD [44+edi]
+	bswap	eax
+	bswap	ebx
+	bswap	ecx
+	bswap	edx
+	push	eax
+	push	ebx
+	push	ecx
+	push	edx
+	mov	eax,DWORD [48+edi]
+	mov	ebx,DWORD [52+edi]
+	mov	ecx,DWORD [56+edi]
+	mov	edx,DWORD [60+edi]
+	bswap	eax
+	bswap	ebx
+	bswap	ecx
+	bswap	edx
+	push	eax
+	push	ebx
+	push	ecx
+	push	edx
+	mov	eax,DWORD [64+edi]
+	mov	ebx,DWORD [68+edi]
+	mov	ecx,DWORD [72+edi]
+	mov	edx,DWORD [76+edi]
+	bswap	eax
+	bswap	ebx
+	bswap	ecx
+	bswap	edx
+	push	eax
+	push	ebx
+	push	ecx
+	push	edx
+	mov	eax,DWORD [80+edi]
+	mov	ebx,DWORD [84+edi]
+	mov	ecx,DWORD [88+edi]
+	mov	edx,DWORD [92+edi]
+	bswap	eax
+	bswap	ebx
+	bswap	ecx
+	bswap	edx
+	push	eax
+	push	ebx
+	push	ecx
+	push	edx
+	mov	eax,DWORD [96+edi]
+	mov	ebx,DWORD [100+edi]
+	mov	ecx,DWORD [104+edi]
+	mov	edx,DWORD [108+edi]
+	bswap	eax
+	bswap	ebx
+	bswap	ecx
+	bswap	edx
+	push	eax
+	push	ebx
+	push	ecx
+	push	edx
+	mov	eax,DWORD [112+edi]
+	mov	ebx,DWORD [116+edi]
+	mov	ecx,DWORD [120+edi]
+	mov	edx,DWORD [124+edi]
+	bswap	eax
+	bswap	ebx
+	bswap	ecx
+	bswap	edx
+	push	eax
+	push	ebx
+	push	ecx
+	push	edx
+	add	edi,128
+	sub	esp,72
+	mov	DWORD [204+esp],edi
+	lea	edi,[8+esp]
+	mov	ecx,16
+dd	2784229001
+align	16
+L$00900_15_x86:
+	mov	ecx,DWORD [40+esp]
+	mov	edx,DWORD [44+esp]
+	mov	esi,ecx
+	shr	ecx,9
+	mov	edi,edx
+	shr	edx,9
+	mov	ebx,ecx
+	shl	esi,14
+	mov	eax,edx
+	shl	edi,14
+	xor	ebx,esi
+	shr	ecx,5
+	xor	eax,edi
+	shr	edx,5
+	xor	eax,ecx
+	shl	esi,4
+	xor	ebx,edx
+	shl	edi,4
+	xor	ebx,esi
+	shr	ecx,4
+	xor	eax,edi
+	shr	edx,4
+	xor	eax,ecx
+	shl	esi,5
+	xor	ebx,edx
+	shl	edi,5
+	xor	eax,esi
+	xor	ebx,edi
+	mov	ecx,DWORD [48+esp]
+	mov	edx,DWORD [52+esp]
+	mov	esi,DWORD [56+esp]
+	mov	edi,DWORD [60+esp]
+	add	eax,DWORD [64+esp]
+	adc	ebx,DWORD [68+esp]
+	xor	ecx,esi
+	xor	edx,edi
+	and	ecx,DWORD [40+esp]
+	and	edx,DWORD [44+esp]
+	add	eax,DWORD [192+esp]
+	adc	ebx,DWORD [196+esp]
+	xor	ecx,esi
+	xor	edx,edi
+	mov	esi,DWORD [ebp]
+	mov	edi,DWORD [4+ebp]
+	add	eax,ecx
+	adc	ebx,edx
+	mov	ecx,DWORD [32+esp]
+	mov	edx,DWORD [36+esp]
+	add	eax,esi
+	adc	ebx,edi
+	mov	DWORD [esp],eax
+	mov	DWORD [4+esp],ebx
+	add	eax,ecx
+	adc	ebx,edx
+	mov	ecx,DWORD [8+esp]
+	mov	edx,DWORD [12+esp]
+	mov	DWORD [32+esp],eax
+	mov	DWORD [36+esp],ebx
+	mov	esi,ecx
+	shr	ecx,2
+	mov	edi,edx
+	shr	edx,2
+	mov	ebx,ecx
+	shl	esi,4
+	mov	eax,edx
+	shl	edi,4
+	xor	ebx,esi
+	shr	ecx,5
+	xor	eax,edi
+	shr	edx,5
+	xor	ebx,ecx
+	shl	esi,21
+	xor	eax,edx
+	shl	edi,21
+	xor	eax,esi
+	shr	ecx,21
+	xor	ebx,edi
+	shr	edx,21
+	xor	eax,ecx
+	shl	esi,5
+	xor	ebx,edx
+	shl	edi,5
+	xor	eax,esi
+	xor	ebx,edi
+	mov	ecx,DWORD [8+esp]
+	mov	edx,DWORD [12+esp]
+	mov	esi,DWORD [16+esp]
+	mov	edi,DWORD [20+esp]
+	add	eax,DWORD [esp]
+	adc	ebx,DWORD [4+esp]
+	or	ecx,esi
+	or	edx,edi
+	and	ecx,DWORD [24+esp]
+	and	edx,DWORD [28+esp]
+	and	esi,DWORD [8+esp]
+	and	edi,DWORD [12+esp]
+	or	ecx,esi
+	or	edx,edi
+	add	eax,ecx
+	adc	ebx,edx
+	mov	DWORD [esp],eax
+	mov	DWORD [4+esp],ebx
+	mov	dl,BYTE [ebp]
+	sub	esp,8
+	lea	ebp,[8+ebp]
+	cmp	dl,148
+	jne	NEAR L$00900_15_x86
+align	16
+L$01016_79_x86:
+	mov	ecx,DWORD [312+esp]
+	mov	edx,DWORD [316+esp]
+	mov	esi,ecx
+	shr	ecx,1
+	mov	edi,edx
+	shr	edx,1
+	mov	eax,ecx
+	shl	esi,24
+	mov	ebx,edx
+	shl	edi,24
+	xor	ebx,esi
+	shr	ecx,6
+	xor	eax,edi
+	shr	edx,6
+	xor	eax,ecx
+	shl	esi,7
+	xor	ebx,edx
+	shl	edi,1
+	xor	ebx,esi
+	shr	ecx,1
+	xor	eax,edi
+	shr	edx,1
+	xor	eax,ecx
+	shl	edi,6
+	xor	ebx,edx
+	xor	eax,edi
+	mov	DWORD [esp],eax
+	mov	DWORD [4+esp],ebx
+	mov	ecx,DWORD [208+esp]
+	mov	edx,DWORD [212+esp]
+	mov	esi,ecx
+	shr	ecx,6
+	mov	edi,edx
+	shr	edx,6
+	mov	eax,ecx
+	shl	esi,3
+	mov	ebx,edx
+	shl	edi,3
+	xor	eax,esi
+	shr	ecx,13
+	xor	ebx,edi
+	shr	edx,13
+	xor	eax,ecx
+	shl	esi,10
+	xor	ebx,edx
+	shl	edi,10
+	xor	ebx,esi
+	shr	ecx,10
+	xor	eax,edi
+	shr	edx,10
+	xor	ebx,ecx
+	shl	edi,13
+	xor	eax,edx
+	xor	eax,edi
+	mov	ecx,DWORD [320+esp]
+	mov	edx,DWORD [324+esp]
+	add	eax,DWORD [esp]
+	adc	ebx,DWORD [4+esp]
+	mov	esi,DWORD [248+esp]
+	mov	edi,DWORD [252+esp]
+	add	eax,ecx
+	adc	ebx,edx
+	add	eax,esi
+	adc	ebx,edi
+	mov	DWORD [192+esp],eax
+	mov	DWORD [196+esp],ebx
+	mov	ecx,DWORD [40+esp]
+	mov	edx,DWORD [44+esp]
+	mov	esi,ecx
+	shr	ecx,9
+	mov	edi,edx
+	shr	edx,9
+	mov	ebx,ecx
+	shl	esi,14
+	mov	eax,edx
+	shl	edi,14
+	xor	ebx,esi
+	shr	ecx,5
+	xor	eax,edi
+	shr	edx,5
+	xor	eax,ecx
+	shl	esi,4
+	xor	ebx,edx
+	shl	edi,4
+	xor	ebx,esi
+	shr	ecx,4
+	xor	eax,edi
+	shr	edx,4
+	xor	eax,ecx
+	shl	esi,5
+	xor	ebx,edx
+	shl	edi,5
+	xor	eax,esi
+	xor	ebx,edi
+	mov	ecx,DWORD [48+esp]
+	mov	edx,DWORD [52+esp]
+	mov	esi,DWORD [56+esp]
+	mov	edi,DWORD [60+esp]
+	add	eax,DWORD [64+esp]
+	adc	ebx,DWORD [68+esp]
+	xor	ecx,esi
+	xor	edx,edi
+	and	ecx,DWORD [40+esp]
+	and	edx,DWORD [44+esp]
+	add	eax,DWORD [192+esp]
+	adc	ebx,DWORD [196+esp]
+	xor	ecx,esi
+	xor	edx,edi
+	mov	esi,DWORD [ebp]
+	mov	edi,DWORD [4+ebp]
+	add	eax,ecx
+	adc	ebx,edx
+	mov	ecx,DWORD [32+esp]
+	mov	edx,DWORD [36+esp]
+	add	eax,esi
+	adc	ebx,edi
+	mov	DWORD [esp],eax
+	mov	DWORD [4+esp],ebx
+	add	eax,ecx
+	adc	ebx,edx
+	mov	ecx,DWORD [8+esp]
+	mov	edx,DWORD [12+esp]
+	mov	DWORD [32+esp],eax
+	mov	DWORD [36+esp],ebx
+	mov	esi,ecx
+	shr	ecx,2
+	mov	edi,edx
+	shr	edx,2
+	mov	ebx,ecx
+	shl	esi,4
+	mov	eax,edx
+	shl	edi,4
+	xor	ebx,esi
+	shr	ecx,5
+	xor	eax,edi
+	shr	edx,5
+	xor	ebx,ecx
+	shl	esi,21
+	xor	eax,edx
+	shl	edi,21
+	xor	eax,esi
+	shr	ecx,21
+	xor	ebx,edi
+	shr	edx,21
+	xor	eax,ecx
+	shl	esi,5
+	xor	ebx,edx
+	shl	edi,5
+	xor	eax,esi
+	xor	ebx,edi
+	mov	ecx,DWORD [8+esp]
+	mov	edx,DWORD [12+esp]
+	mov	esi,DWORD [16+esp]
+	mov	edi,DWORD [20+esp]
+	add	eax,DWORD [esp]
+	adc	ebx,DWORD [4+esp]
+	or	ecx,esi
+	or	edx,edi
+	and	ecx,DWORD [24+esp]
+	and	edx,DWORD [28+esp]
+	and	esi,DWORD [8+esp]
+	and	edi,DWORD [12+esp]
+	or	ecx,esi
+	or	edx,edi
+	add	eax,ecx
+	adc	ebx,edx
+	mov	DWORD [esp],eax
+	mov	DWORD [4+esp],ebx
+	mov	dl,BYTE [ebp]
+	sub	esp,8
+	lea	ebp,[8+ebp]
+	cmp	dl,23
+	jne	NEAR L$01016_79_x86
+	mov	esi,DWORD [840+esp]
+	mov	edi,DWORD [844+esp]
+	mov	eax,DWORD [esi]
+	mov	ebx,DWORD [4+esi]
+	mov	ecx,DWORD [8+esi]
+	mov	edx,DWORD [12+esi]
+	add	eax,DWORD [8+esp]
+	adc	ebx,DWORD [12+esp]
+	mov	DWORD [esi],eax
+	mov	DWORD [4+esi],ebx
+	add	ecx,DWORD [16+esp]
+	adc	edx,DWORD [20+esp]
+	mov	DWORD [8+esi],ecx
+	mov	DWORD [12+esi],edx
+	mov	eax,DWORD [16+esi]
+	mov	ebx,DWORD [20+esi]
+	mov	ecx,DWORD [24+esi]
+	mov	edx,DWORD [28+esi]
+	add	eax,DWORD [24+esp]
+	adc	ebx,DWORD [28+esp]
+	mov	DWORD [16+esi],eax
+	mov	DWORD [20+esi],ebx
+	add	ecx,DWORD [32+esp]
+	adc	edx,DWORD [36+esp]
+	mov	DWORD [24+esi],ecx
+	mov	DWORD [28+esi],edx
+	mov	eax,DWORD [32+esi]
+	mov	ebx,DWORD [36+esi]
+	mov	ecx,DWORD [40+esi]
+	mov	edx,DWORD [44+esi]
+	add	eax,DWORD [40+esp]
+	adc	ebx,DWORD [44+esp]
+	mov	DWORD [32+esi],eax
+	mov	DWORD [36+esi],ebx
+	add	ecx,DWORD [48+esp]
+	adc	edx,DWORD [52+esp]
+	mov	DWORD [40+esi],ecx
+	mov	DWORD [44+esi],edx
+	mov	eax,DWORD [48+esi]
+	mov	ebx,DWORD [52+esi]
+	mov	ecx,DWORD [56+esi]
+	mov	edx,DWORD [60+esi]
+	add	eax,DWORD [56+esp]
+	adc	ebx,DWORD [60+esp]
+	mov	DWORD [48+esi],eax
+	mov	DWORD [52+esi],ebx
+	add	ecx,DWORD [64+esp]
+	adc	edx,DWORD [68+esp]
+	mov	DWORD [56+esi],ecx
+	mov	DWORD [60+esi],edx
+	add	esp,840
+	sub	ebp,640
+	cmp	edi,DWORD [8+esp]
+	jb	NEAR L$002loop_x86
+	mov	esp,DWORD [12+esp]
+	pop	edi
+	pop	esi
+	pop	ebx
+	pop	ebp
+	ret
+align	64
+L$001K512:
+dd	3609767458,1116352408
+dd	602891725,1899447441
+dd	3964484399,3049323471
+dd	2173295548,3921009573
+dd	4081628472,961987163
+dd	3053834265,1508970993
+dd	2937671579,2453635748
+dd	3664609560,2870763221
+dd	2734883394,3624381080
+dd	1164996542,310598401
+dd	1323610764,607225278
+dd	3590304994,1426881987
+dd	4068182383,1925078388
+dd	991336113,2162078206
+dd	633803317,2614888103
+dd	3479774868,3248222580
+dd	2666613458,3835390401
+dd	944711139,4022224774
+dd	2341262773,264347078
+dd	2007800933,604807628
+dd	1495990901,770255983
+dd	1856431235,1249150122
+dd	3175218132,1555081692
+dd	2198950837,1996064986
+dd	3999719339,2554220882
+dd	766784016,2821834349
+dd	2566594879,2952996808
+dd	3203337956,3210313671
+dd	1034457026,3336571891
+dd	2466948901,3584528711
+dd	3758326383,113926993
+dd	168717936,338241895
+dd	1188179964,666307205
+dd	1546045734,773529912
+dd	1522805485,1294757372
+dd	2643833823,1396182291
+dd	2343527390,1695183700
+dd	1014477480,1986661051
+dd	1206759142,2177026350
+dd	344077627,2456956037
+dd	1290863460,2730485921
+dd	3158454273,2820302411
+dd	3505952657,3259730800
+dd	106217008,3345764771
+dd	3606008344,3516065817
+dd	1432725776,3600352804
+dd	1467031594,4094571909
+dd	851169720,275423344
+dd	3100823752,430227734
+dd	1363258195,506948616
+dd	3750685593,659060556
+dd	3785050280,883997877
+dd	3318307427,958139571
+dd	3812723403,1322822218
+dd	2003034995,1537002063
+dd	3602036899,1747873779
+dd	1575990012,1955562222
+dd	1125592928,2024104815
+dd	2716904306,2227730452
+dd	442776044,2361852424
+dd	593698344,2428436474
+dd	3733110249,2756734187
+dd	2999351573,3204031479
+dd	3815920427,3329325298
+dd	3928383900,3391569614
+dd	566280711,3515267271
+dd	3454069534,3940187606
+dd	4000239992,4118630271
+dd	1914138554,116418474
+dd	2731055270,174292421
+dd	3203993006,289380356
+dd	320620315,460393269
+dd	587496836,685471733
+dd	1086792851,852142971
+dd	365543100,1017036298
+dd	2618297676,1126000580
+dd	3409855158,1288033470
+dd	4234509866,1501505948
+dd	987167468,1607167915
+dd	1246189591,1816402316
+dd	67438087,66051
+dd	202182159,134810123
+db	83,72,65,53,49,50,32,98,108,111,99,107,32,116,114,97
+db	110,115,102,111,114,109,32,102,111,114,32,120,56,54,44,32
+db	67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97
+db	112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103
+db	62,0
+segment	.bss
+common	_OPENSSL_ia32cap_P 16
diff --git a/third_party/boringssl/win-x86_64/crypto/aes/aes-x86_64.asm b/third_party/boringssl/win-x86_64/crypto/aes/aes-x86_64.asm
new file mode 100644
index 0000000..53394f0
--- /dev/null
+++ b/third_party/boringssl/win-x86_64/crypto/aes/aes-x86_64.asm
@@ -0,0 +1,2858 @@
+default	rel
+%define XMMWORD
+%define YMMWORD
+%define ZMMWORD
+section	.text code align=64
+
+
+ALIGN	16
+_x86_64_AES_encrypt:
+	xor	eax,DWORD[r15]
+	xor	ebx,DWORD[4+r15]
+	xor	ecx,DWORD[8+r15]
+	xor	edx,DWORD[12+r15]
+
+	mov	r13d,DWORD[240+r15]
+	sub	r13d,1
+	jmp	NEAR $L$enc_loop
+ALIGN	16
+$L$enc_loop:
+
+	movzx	esi,al
+	movzx	edi,bl
+	movzx	ebp,cl
+	mov	r10d,DWORD[rsi*8+r14]
+	mov	r11d,DWORD[rdi*8+r14]
+	mov	r12d,DWORD[rbp*8+r14]
+
+	movzx	esi,bh
+	movzx	edi,ch
+	movzx	ebp,dl
+	xor	r10d,DWORD[3+rsi*8+r14]
+	xor	r11d,DWORD[3+rdi*8+r14]
+	mov	r8d,DWORD[rbp*8+r14]
+
+	movzx	esi,dh
+	shr	ecx,16
+	movzx	ebp,ah
+	xor	r12d,DWORD[3+rsi*8+r14]
+	shr	edx,16
+	xor	r8d,DWORD[3+rbp*8+r14]
+
+	shr	ebx,16
+	lea	r15,[16+r15]
+	shr	eax,16
+
+	movzx	esi,cl
+	movzx	edi,dl
+	movzx	ebp,al
+	xor	r10d,DWORD[2+rsi*8+r14]
+	xor	r11d,DWORD[2+rdi*8+r14]
+	xor	r12d,DWORD[2+rbp*8+r14]
+
+	movzx	esi,dh
+	movzx	edi,ah
+	movzx	ebp,bl
+	xor	r10d,DWORD[1+rsi*8+r14]
+	xor	r11d,DWORD[1+rdi*8+r14]
+	xor	r8d,DWORD[2+rbp*8+r14]
+
+	mov	edx,DWORD[12+r15]
+	movzx	edi,bh
+	movzx	ebp,ch
+	mov	eax,DWORD[r15]
+	xor	r12d,DWORD[1+rdi*8+r14]
+	xor	r8d,DWORD[1+rbp*8+r14]
+
+	mov	ebx,DWORD[4+r15]
+	mov	ecx,DWORD[8+r15]
+	xor	eax,r10d
+	xor	ebx,r11d
+	xor	ecx,r12d
+	xor	edx,r8d
+	sub	r13d,1
+	jnz	NEAR $L$enc_loop
+	movzx	esi,al
+	movzx	edi,bl
+	movzx	ebp,cl
+	movzx	r10d,BYTE[2+rsi*8+r14]
+	movzx	r11d,BYTE[2+rdi*8+r14]
+	movzx	r12d,BYTE[2+rbp*8+r14]
+
+	movzx	esi,dl
+	movzx	edi,bh
+	movzx	ebp,ch
+	movzx	r8d,BYTE[2+rsi*8+r14]
+	mov	edi,DWORD[rdi*8+r14]
+	mov	ebp,DWORD[rbp*8+r14]
+
+	and	edi,0x0000ff00
+	and	ebp,0x0000ff00
+
+	xor	r10d,edi
+	xor	r11d,ebp
+	shr	ecx,16
+
+	movzx	esi,dh
+	movzx	edi,ah
+	shr	edx,16
+	mov	esi,DWORD[rsi*8+r14]
+	mov	edi,DWORD[rdi*8+r14]
+
+	and	esi,0x0000ff00
+	and	edi,0x0000ff00
+	shr	ebx,16
+	xor	r12d,esi
+	xor	r8d,edi
+	shr	eax,16
+
+	movzx	esi,cl
+	movzx	edi,dl
+	movzx	ebp,al
+	mov	esi,DWORD[rsi*8+r14]
+	mov	edi,DWORD[rdi*8+r14]
+	mov	ebp,DWORD[rbp*8+r14]
+
+	and	esi,0x00ff0000
+	and	edi,0x00ff0000
+	and	ebp,0x00ff0000
+
+	xor	r10d,esi
+	xor	r11d,edi
+	xor	r12d,ebp
+
+	movzx	esi,bl
+	movzx	edi,dh
+	movzx	ebp,ah
+	mov	esi,DWORD[rsi*8+r14]
+	mov	edi,DWORD[2+rdi*8+r14]
+	mov	ebp,DWORD[2+rbp*8+r14]
+
+	and	esi,0x00ff0000
+	and	edi,0xff000000
+	and	ebp,0xff000000
+
+	xor	r8d,esi
+	xor	r10d,edi
+	xor	r11d,ebp
+
+	movzx	esi,bh
+	movzx	edi,ch
+	mov	edx,DWORD[((16+12))+r15]
+	mov	esi,DWORD[2+rsi*8+r14]
+	mov	edi,DWORD[2+rdi*8+r14]
+	mov	eax,DWORD[((16+0))+r15]
+
+	and	esi,0xff000000
+	and	edi,0xff000000
+
+	xor	r12d,esi
+	xor	r8d,edi
+
+	mov	ebx,DWORD[((16+4))+r15]
+	mov	ecx,DWORD[((16+8))+r15]
+	xor	eax,r10d
+	xor	ebx,r11d
+	xor	ecx,r12d
+	xor	edx,r8d
+DB	0xf3,0xc3
+
+
+ALIGN	16
+_x86_64_AES_encrypt_compact:
+	lea	r8,[128+r14]
+	mov	edi,DWORD[((0-128))+r8]
+	mov	ebp,DWORD[((32-128))+r8]
+	mov	r10d,DWORD[((64-128))+r8]
+	mov	r11d,DWORD[((96-128))+r8]
+	mov	edi,DWORD[((128-128))+r8]
+	mov	ebp,DWORD[((160-128))+r8]
+	mov	r10d,DWORD[((192-128))+r8]
+	mov	r11d,DWORD[((224-128))+r8]
+	jmp	NEAR $L$enc_loop_compact
+ALIGN	16
+$L$enc_loop_compact:
+	xor	eax,DWORD[r15]
+	xor	ebx,DWORD[4+r15]
+	xor	ecx,DWORD[8+r15]
+	xor	edx,DWORD[12+r15]
+	lea	r15,[16+r15]
+	movzx	r10d,al
+	movzx	r11d,bl
+	movzx	r12d,cl
+	movzx	r8d,dl
+	movzx	esi,bh
+	movzx	edi,ch
+	shr	ecx,16
+	movzx	ebp,dh
+	movzx	r10d,BYTE[r10*1+r14]
+	movzx	r11d,BYTE[r11*1+r14]
+	movzx	r12d,BYTE[r12*1+r14]
+	movzx	r8d,BYTE[r8*1+r14]
+
+	movzx	r9d,BYTE[rsi*1+r14]
+	movzx	esi,ah
+	movzx	r13d,BYTE[rdi*1+r14]
+	movzx	edi,cl
+	movzx	ebp,BYTE[rbp*1+r14]
+	movzx	esi,BYTE[rsi*1+r14]
+
+	shl	r9d,8
+	shr	edx,16
+	shl	r13d,8
+	xor	r10d,r9d
+	shr	eax,16
+	movzx	r9d,dl
+	shr	ebx,16
+	xor	r11d,r13d
+	shl	ebp,8
+	movzx	r13d,al
+	movzx	edi,BYTE[rdi*1+r14]
+	xor	r12d,ebp
+
+	shl	esi,8
+	movzx	ebp,bl
+	shl	edi,16
+	xor	r8d,esi
+	movzx	r9d,BYTE[r9*1+r14]
+	movzx	esi,dh
+	movzx	r13d,BYTE[r13*1+r14]
+	xor	r10d,edi
+
+	shr	ecx,8
+	movzx	edi,ah
+	shl	r9d,16
+	shr	ebx,8
+	shl	r13d,16
+	xor	r11d,r9d
+	movzx	ebp,BYTE[rbp*1+r14]
+	movzx	esi,BYTE[rsi*1+r14]
+	movzx	edi,BYTE[rdi*1+r14]
+	movzx	edx,BYTE[rcx*1+r14]
+	movzx	ecx,BYTE[rbx*1+r14]
+
+	shl	ebp,16
+	xor	r12d,r13d
+	shl	esi,24
+	xor	r8d,ebp
+	shl	edi,24
+	xor	r10d,esi
+	shl	edx,24
+	xor	r11d,edi
+	shl	ecx,24
+	mov	eax,r10d
+	mov	ebx,r11d
+	xor	ecx,r12d
+	xor	edx,r8d
+	cmp	r15,QWORD[16+rsp]
+	je	NEAR $L$enc_compact_done
+	mov	r10d,0x80808080
+	mov	r11d,0x80808080
+	and	r10d,eax
+	and	r11d,ebx
+	mov	esi,r10d
+	mov	edi,r11d
+	shr	r10d,7
+	lea	r8d,[rax*1+rax]
+	shr	r11d,7
+	lea	r9d,[rbx*1+rbx]
+	sub	esi,r10d
+	sub	edi,r11d
+	and	r8d,0xfefefefe
+	and	r9d,0xfefefefe
+	and	esi,0x1b1b1b1b
+	and	edi,0x1b1b1b1b
+	mov	r10d,eax
+	mov	r11d,ebx
+	xor	r8d,esi
+	xor	r9d,edi
+
+	xor	eax,r8d
+	xor	ebx,r9d
+	mov	r12d,0x80808080
+	rol	eax,24
+	mov	ebp,0x80808080
+	rol	ebx,24
+	and	r12d,ecx
+	and	ebp,edx
+	xor	eax,r8d
+	xor	ebx,r9d
+	mov	esi,r12d
+	ror	r10d,16
+	mov	edi,ebp
+	ror	r11d,16
+	lea	r8d,[rcx*1+rcx]
+	shr	r12d,7
+	xor	eax,r10d
+	shr	ebp,7
+	xor	ebx,r11d
+	ror	r10d,8
+	lea	r9d,[rdx*1+rdx]
+	ror	r11d,8
+	sub	esi,r12d
+	sub	edi,ebp
+	xor	eax,r10d
+	xor	ebx,r11d
+
+	and	r8d,0xfefefefe
+	and	r9d,0xfefefefe
+	and	esi,0x1b1b1b1b
+	and	edi,0x1b1b1b1b
+	mov	r12d,ecx
+	mov	ebp,edx
+	xor	r8d,esi
+	xor	r9d,edi
+
+	ror	r12d,16
+	xor	ecx,r8d
+	ror	ebp,16
+	xor	edx,r9d
+	rol	ecx,24
+	mov	esi,DWORD[r14]
+	rol	edx,24
+	xor	ecx,r8d
+	mov	edi,DWORD[64+r14]
+	xor	edx,r9d
+	mov	r8d,DWORD[128+r14]
+	xor	ecx,r12d
+	ror	r12d,8
+	xor	edx,ebp
+	ror	ebp,8
+	xor	ecx,r12d
+	mov	r9d,DWORD[192+r14]
+	xor	edx,ebp
+	jmp	NEAR $L$enc_loop_compact
+ALIGN	16
+$L$enc_compact_done:
+	xor	eax,DWORD[r15]
+	xor	ebx,DWORD[4+r15]
+	xor	ecx,DWORD[8+r15]
+	xor	edx,DWORD[12+r15]
+DB	0xf3,0xc3
+
+ALIGN	16
+global	asm_AES_encrypt
+
+
+asm_AES_encrypt:
+	mov	QWORD[8+rsp],rdi	;WIN64 prologue
+	mov	QWORD[16+rsp],rsi
+	mov	rax,rsp
+$L$SEH_begin_asm_AES_encrypt:
+	mov	rdi,rcx
+	mov	rsi,rdx
+	mov	rdx,r8
+
+
+	push	rbx
+	push	rbp
+	push	r12
+	push	r13
+	push	r14
+	push	r15
+
+
+	mov	r10,rsp
+	lea	rcx,[((-63))+rdx]
+	and	rsp,-64
+	sub	rcx,rsp
+	neg	rcx
+	and	rcx,0x3c0
+	sub	rsp,rcx
+	sub	rsp,32
+
+	mov	QWORD[16+rsp],rsi
+	mov	QWORD[24+rsp],r10
+$L$enc_prologue:
+
+	mov	r15,rdx
+	mov	r13d,DWORD[240+r15]
+
+	mov	eax,DWORD[rdi]
+	mov	ebx,DWORD[4+rdi]
+	mov	ecx,DWORD[8+rdi]
+	mov	edx,DWORD[12+rdi]
+
+	shl	r13d,4
+	lea	rbp,[r13*1+r15]
+	mov	QWORD[rsp],r15
+	mov	QWORD[8+rsp],rbp
+
+
+	lea	r14,[(($L$AES_Te+2048))]
+	lea	rbp,[768+rsp]
+	sub	rbp,r14
+	and	rbp,0x300
+	lea	r14,[rbp*1+r14]
+
+	call	_x86_64_AES_encrypt_compact
+
+	mov	r9,QWORD[16+rsp]
+	mov	rsi,QWORD[24+rsp]
+	mov	DWORD[r9],eax
+	mov	DWORD[4+r9],ebx
+	mov	DWORD[8+r9],ecx
+	mov	DWORD[12+r9],edx
+
+	mov	r15,QWORD[rsi]
+	mov	r14,QWORD[8+rsi]
+	mov	r13,QWORD[16+rsi]
+	mov	r12,QWORD[24+rsi]
+	mov	rbp,QWORD[32+rsi]
+	mov	rbx,QWORD[40+rsi]
+	lea	rsp,[48+rsi]
+$L$enc_epilogue:
+	mov	rdi,QWORD[8+rsp]	;WIN64 epilogue
+	mov	rsi,QWORD[16+rsp]
+	DB	0F3h,0C3h		;repret
+$L$SEH_end_asm_AES_encrypt:
+
+ALIGN	16
+_x86_64_AES_decrypt:
+	xor	eax,DWORD[r15]
+	xor	ebx,DWORD[4+r15]
+	xor	ecx,DWORD[8+r15]
+	xor	edx,DWORD[12+r15]
+
+	mov	r13d,DWORD[240+r15]
+	sub	r13d,1
+	jmp	NEAR $L$dec_loop
+ALIGN	16
+$L$dec_loop:
+
+	movzx	esi,al
+	movzx	edi,bl
+	movzx	ebp,cl
+	mov	r10d,DWORD[rsi*8+r14]
+	mov	r11d,DWORD[rdi*8+r14]
+	mov	r12d,DWORD[rbp*8+r14]
+
+	movzx	esi,dh
+	movzx	edi,ah
+	movzx	ebp,dl
+	xor	r10d,DWORD[3+rsi*8+r14]
+	xor	r11d,DWORD[3+rdi*8+r14]
+	mov	r8d,DWORD[rbp*8+r14]
+
+	movzx	esi,bh
+	shr	eax,16
+	movzx	ebp,ch
+	xor	r12d,DWORD[3+rsi*8+r14]
+	shr	edx,16
+	xor	r8d,DWORD[3+rbp*8+r14]
+
+	shr	ebx,16
+	lea	r15,[16+r15]
+	shr	ecx,16
+
+	movzx	esi,cl
+	movzx	edi,dl
+	movzx	ebp,al
+	xor	r10d,DWORD[2+rsi*8+r14]
+	xor	r11d,DWORD[2+rdi*8+r14]
+	xor	r12d,DWORD[2+rbp*8+r14]
+
+	movzx	esi,bh
+	movzx	edi,ch
+	movzx	ebp,bl
+	xor	r10d,DWORD[1+rsi*8+r14]
+	xor	r11d,DWORD[1+rdi*8+r14]
+	xor	r8d,DWORD[2+rbp*8+r14]
+
+	movzx	esi,dh
+	mov	edx,DWORD[12+r15]
+	movzx	ebp,ah
+	xor	r12d,DWORD[1+rsi*8+r14]
+	mov	eax,DWORD[r15]
+	xor	r8d,DWORD[1+rbp*8+r14]
+
+	xor	eax,r10d
+	mov	ebx,DWORD[4+r15]
+	mov	ecx,DWORD[8+r15]
+	xor	ecx,r12d
+	xor	ebx,r11d
+	xor	edx,r8d
+	sub	r13d,1
+	jnz	NEAR $L$dec_loop
+	lea	r14,[2048+r14]
+	movzx	esi,al
+	movzx	edi,bl
+	movzx	ebp,cl
+	movzx	r10d,BYTE[rsi*1+r14]
+	movzx	r11d,BYTE[rdi*1+r14]
+	movzx	r12d,BYTE[rbp*1+r14]
+
+	movzx	esi,dl
+	movzx	edi,dh
+	movzx	ebp,ah
+	movzx	r8d,BYTE[rsi*1+r14]
+	movzx	edi,BYTE[rdi*1+r14]
+	movzx	ebp,BYTE[rbp*1+r14]
+
+	shl	edi,8
+	shl	ebp,8
+
+	xor	r10d,edi
+	xor	r11d,ebp
+	shr	edx,16
+
+	movzx	esi,bh
+	movzx	edi,ch
+	shr	eax,16
+	movzx	esi,BYTE[rsi*1+r14]
+	movzx	edi,BYTE[rdi*1+r14]
+
+	shl	esi,8
+	shl	edi,8
+	shr	ebx,16
+	xor	r12d,esi
+	xor	r8d,edi
+	shr	ecx,16
+
+	movzx	esi,cl
+	movzx	edi,dl
+	movzx	ebp,al
+	movzx	esi,BYTE[rsi*1+r14]
+	movzx	edi,BYTE[rdi*1+r14]
+	movzx	ebp,BYTE[rbp*1+r14]
+
+	shl	esi,16
+	shl	edi,16
+	shl	ebp,16
+
+	xor	r10d,esi
+	xor	r11d,edi
+	xor	r12d,ebp
+
+	movzx	esi,bl
+	movzx	edi,bh
+	movzx	ebp,ch
+	movzx	esi,BYTE[rsi*1+r14]
+	movzx	edi,BYTE[rdi*1+r14]
+	movzx	ebp,BYTE[rbp*1+r14]
+
+	shl	esi,16
+	shl	edi,24
+	shl	ebp,24
+
+	xor	r8d,esi
+	xor	r10d,edi
+	xor	r11d,ebp
+
+	movzx	esi,dh
+	movzx	edi,ah
+	mov	edx,DWORD[((16+12))+r15]
+	movzx	esi,BYTE[rsi*1+r14]
+	movzx	edi,BYTE[rdi*1+r14]
+	mov	eax,DWORD[((16+0))+r15]
+
+	shl	esi,24
+	shl	edi,24
+
+	xor	r12d,esi
+	xor	r8d,edi
+
+	mov	ebx,DWORD[((16+4))+r15]
+	mov	ecx,DWORD[((16+8))+r15]
+	lea	r14,[((-2048))+r14]
+	xor	eax,r10d
+	xor	ebx,r11d
+	xor	ecx,r12d
+	xor	edx,r8d
+DB	0xf3,0xc3
+
+
+ALIGN	16
+_x86_64_AES_decrypt_compact:
+	lea	r8,[128+r14]
+	mov	edi,DWORD[((0-128))+r8]
+	mov	ebp,DWORD[((32-128))+r8]
+	mov	r10d,DWORD[((64-128))+r8]
+	mov	r11d,DWORD[((96-128))+r8]
+	mov	edi,DWORD[((128-128))+r8]
+	mov	ebp,DWORD[((160-128))+r8]
+	mov	r10d,DWORD[((192-128))+r8]
+	mov	r11d,DWORD[((224-128))+r8]
+	jmp	NEAR $L$dec_loop_compact
+
+ALIGN	16
+$L$dec_loop_compact:
+	xor	eax,DWORD[r15]
+	xor	ebx,DWORD[4+r15]
+	xor	ecx,DWORD[8+r15]
+	xor	edx,DWORD[12+r15]
+	lea	r15,[16+r15]
+	movzx	r10d,al
+	movzx	r11d,bl
+	movzx	r12d,cl
+	movzx	r8d,dl
+	movzx	esi,dh
+	movzx	edi,ah
+	shr	edx,16
+	movzx	ebp,bh
+	movzx	r10d,BYTE[r10*1+r14]
+	movzx	r11d,BYTE[r11*1+r14]
+	movzx	r12d,BYTE[r12*1+r14]
+	movzx	r8d,BYTE[r8*1+r14]
+
+	movzx	r9d,BYTE[rsi*1+r14]
+	movzx	esi,ch
+	movzx	r13d,BYTE[rdi*1+r14]
+	movzx	ebp,BYTE[rbp*1+r14]
+	movzx	esi,BYTE[rsi*1+r14]
+
+	shr	ecx,16
+	shl	r13d,8
+	shl	r9d,8
+	movzx	edi,cl
+	shr	eax,16
+	xor	r10d,r9d
+	shr	ebx,16
+	movzx	r9d,dl
+
+	shl	ebp,8
+	xor	r11d,r13d
+	shl	esi,8
+	movzx	r13d,al
+	movzx	edi,BYTE[rdi*1+r14]
+	xor	r12d,ebp
+	movzx	ebp,bl
+
+	shl	edi,16
+	xor	r8d,esi
+	movzx	r9d,BYTE[r9*1+r14]
+	movzx	esi,bh
+	movzx	ebp,BYTE[rbp*1+r14]
+	xor	r10d,edi
+	movzx	r13d,BYTE[r13*1+r14]
+	movzx	edi,ch
+
+	shl	ebp,16
+	shl	r9d,16
+	shl	r13d,16
+	xor	r8d,ebp
+	movzx	ebp,dh
+	xor	r11d,r9d
+	shr	eax,8
+	xor	r12d,r13d
+
+	movzx	esi,BYTE[rsi*1+r14]
+	movzx	ebx,BYTE[rdi*1+r14]
+	movzx	ecx,BYTE[rbp*1+r14]
+	movzx	edx,BYTE[rax*1+r14]
+
+	mov	eax,r10d
+	shl	esi,24
+	shl	ebx,24
+	shl	ecx,24
+	xor	eax,esi
+	shl	edx,24
+	xor	ebx,r11d
+	xor	ecx,r12d
+	xor	edx,r8d
+	cmp	r15,QWORD[16+rsp]
+	je	NEAR $L$dec_compact_done
+
+	mov	rsi,QWORD[((256+0))+r14]
+	shl	rbx,32
+	shl	rdx,32
+	mov	rdi,QWORD[((256+8))+r14]
+	or	rax,rbx
+	or	rcx,rdx
+	mov	rbp,QWORD[((256+16))+r14]
+	mov	r9,rsi
+	mov	r12,rsi
+	and	r9,rax
+	and	r12,rcx
+	mov	rbx,r9
+	mov	rdx,r12
+	shr	r9,7
+	lea	r8,[rax*1+rax]
+	shr	r12,7
+	lea	r11,[rcx*1+rcx]
+	sub	rbx,r9
+	sub	rdx,r12
+	and	r8,rdi
+	and	r11,rdi
+	and	rbx,rbp
+	and	rdx,rbp
+	xor	r8,rbx
+	xor	r11,rdx
+	mov	r10,rsi
+	mov	r13,rsi
+
+	and	r10,r8
+	and	r13,r11
+	mov	rbx,r10
+	mov	rdx,r13
+	shr	r10,7
+	lea	r9,[r8*1+r8]
+	shr	r13,7
+	lea	r12,[r11*1+r11]
+	sub	rbx,r10
+	sub	rdx,r13
+	and	r9,rdi
+	and	r12,rdi
+	and	rbx,rbp
+	and	rdx,rbp
+	xor	r9,rbx
+	xor	r12,rdx
+	mov	r10,rsi
+	mov	r13,rsi
+
+	and	r10,r9
+	and	r13,r12
+	mov	rbx,r10
+	mov	rdx,r13
+	shr	r10,7
+	xor	r8,rax
+	shr	r13,7
+	xor	r11,rcx
+	sub	rbx,r10
+	sub	rdx,r13
+	lea	r10,[r9*1+r9]
+	lea	r13,[r12*1+r12]
+	xor	r9,rax
+	xor	r12,rcx
+	and	r10,rdi
+	and	r13,rdi
+	and	rbx,rbp
+	and	rdx,rbp
+	xor	r10,rbx
+	xor	r13,rdx
+
+	xor	rax,r10
+	xor	rcx,r13
+	xor	r8,r10
+	xor	r11,r13
+	mov	rbx,rax
+	mov	rdx,rcx
+	xor	r9,r10
+	shr	rbx,32
+	xor	r12,r13
+	shr	rdx,32
+	xor	r10,r8
+	rol	eax,8
+	xor	r13,r11
+	rol	ecx,8
+	xor	r10,r9
+	rol	ebx,8
+	xor	r13,r12
+
+	rol	edx,8
+	xor	eax,r10d
+	shr	r10,32
+	xor	ecx,r13d
+	shr	r13,32
+	xor	ebx,r10d
+	xor	edx,r13d
+
+	mov	r10,r8
+	rol	r8d,24
+	mov	r13,r11
+	rol	r11d,24
+	shr	r10,32
+	xor	eax,r8d
+	shr	r13,32
+	xor	ecx,r11d
+	rol	r10d,24
+	mov	r8,r9
+	rol	r13d,24
+	mov	r11,r12
+	shr	r8,32
+	xor	ebx,r10d
+	shr	r11,32
+	xor	edx,r13d
+
+	mov	rsi,QWORD[r14]
+	rol	r9d,16
+	mov	rdi,QWORD[64+r14]
+	rol	r12d,16
+	mov	rbp,QWORD[128+r14]
+	rol	r8d,16
+	mov	r10,QWORD[192+r14]
+	xor	eax,r9d
+	rol	r11d,16
+	xor	ecx,r12d
+	mov	r13,QWORD[256+r14]
+	xor	ebx,r8d
+	xor	edx,r11d
+	jmp	NEAR $L$dec_loop_compact
+ALIGN	16
+$L$dec_compact_done:
+	xor	eax,DWORD[r15]
+	xor	ebx,DWORD[4+r15]
+	xor	ecx,DWORD[8+r15]
+	xor	edx,DWORD[12+r15]
+DB	0xf3,0xc3
+
+ALIGN	16
+global	asm_AES_decrypt
+
+
+asm_AES_decrypt:
+	mov	QWORD[8+rsp],rdi	;WIN64 prologue
+	mov	QWORD[16+rsp],rsi
+	mov	rax,rsp
+$L$SEH_begin_asm_AES_decrypt:
+	mov	rdi,rcx
+	mov	rsi,rdx
+	mov	rdx,r8
+
+
+	push	rbx
+	push	rbp
+	push	r12
+	push	r13
+	push	r14
+	push	r15
+
+
+	mov	r10,rsp
+	lea	rcx,[((-63))+rdx]
+	and	rsp,-64
+	sub	rcx,rsp
+	neg	rcx
+	and	rcx,0x3c0
+	sub	rsp,rcx
+	sub	rsp,32
+
+	mov	QWORD[16+rsp],rsi
+	mov	QWORD[24+rsp],r10
+$L$dec_prologue:
+
+	mov	r15,rdx
+	mov	r13d,DWORD[240+r15]
+
+	mov	eax,DWORD[rdi]
+	mov	ebx,DWORD[4+rdi]
+	mov	ecx,DWORD[8+rdi]
+	mov	edx,DWORD[12+rdi]
+
+	shl	r13d,4
+	lea	rbp,[r13*1+r15]
+	mov	QWORD[rsp],r15
+	mov	QWORD[8+rsp],rbp
+
+
+	lea	r14,[(($L$AES_Td+2048))]
+	lea	rbp,[768+rsp]
+	sub	rbp,r14
+	and	rbp,0x300
+	lea	r14,[rbp*1+r14]
+	shr	rbp,3
+	add	r14,rbp
+
+	call	_x86_64_AES_decrypt_compact
+
+	mov	r9,QWORD[16+rsp]
+	mov	rsi,QWORD[24+rsp]
+	mov	DWORD[r9],eax
+	mov	DWORD[4+r9],ebx
+	mov	DWORD[8+r9],ecx
+	mov	DWORD[12+r9],edx
+
+	mov	r15,QWORD[rsi]
+	mov	r14,QWORD[8+rsi]
+	mov	r13,QWORD[16+rsi]
+	mov	r12,QWORD[24+rsi]
+	mov	rbp,QWORD[32+rsi]
+	mov	rbx,QWORD[40+rsi]
+	lea	rsp,[48+rsi]
+$L$dec_epilogue:
+	mov	rdi,QWORD[8+rsp]	;WIN64 epilogue
+	mov	rsi,QWORD[16+rsp]
+	DB	0F3h,0C3h		;repret
+$L$SEH_end_asm_AES_decrypt:
+ALIGN	16
+global	asm_AES_set_encrypt_key
+
+asm_AES_set_encrypt_key:
+	mov	QWORD[8+rsp],rdi	;WIN64 prologue
+	mov	QWORD[16+rsp],rsi
+	mov	rax,rsp
+$L$SEH_begin_asm_AES_set_encrypt_key:
+	mov	rdi,rcx
+	mov	rsi,rdx
+	mov	rdx,r8
+
+
+	push	rbx
+	push	rbp
+	push	r12
+	push	r13
+	push	r14
+	push	r15
+	sub	rsp,8
+$L$enc_key_prologue:
+
+	call	_x86_64_AES_set_encrypt_key
+
+	mov	rbp,QWORD[40+rsp]
+	mov	rbx,QWORD[48+rsp]
+	add	rsp,56
+$L$enc_key_epilogue:
+	mov	rdi,QWORD[8+rsp]	;WIN64 epilogue
+	mov	rsi,QWORD[16+rsp]
+	DB	0F3h,0C3h		;repret
+$L$SEH_end_asm_AES_set_encrypt_key:
+
+
+ALIGN	16
+_x86_64_AES_set_encrypt_key:
+	mov	ecx,esi
+	mov	rsi,rdi
+	mov	rdi,rdx
+
+	test	rsi,-1
+	jz	NEAR $L$badpointer
+	test	rdi,-1
+	jz	NEAR $L$badpointer
+
+	lea	rbp,[$L$AES_Te]
+	lea	rbp,[((2048+128))+rbp]
+
+
+	mov	eax,DWORD[((0-128))+rbp]
+	mov	ebx,DWORD[((32-128))+rbp]
+	mov	r8d,DWORD[((64-128))+rbp]
+	mov	edx,DWORD[((96-128))+rbp]
+	mov	eax,DWORD[((128-128))+rbp]
+	mov	ebx,DWORD[((160-128))+rbp]
+	mov	r8d,DWORD[((192-128))+rbp]
+	mov	edx,DWORD[((224-128))+rbp]
+
+	cmp	ecx,128
+	je	NEAR $L$10rounds
+	cmp	ecx,192
+	je	NEAR $L$12rounds
+	cmp	ecx,256
+	je	NEAR $L$14rounds
+	mov	rax,-2
+	jmp	NEAR $L$exit
+
+$L$10rounds:
+	mov	rax,QWORD[rsi]
+	mov	rdx,QWORD[8+rsi]
+	mov	QWORD[rdi],rax
+	mov	QWORD[8+rdi],rdx
+
+	shr	rdx,32
+	xor	ecx,ecx
+	jmp	NEAR $L$10shortcut
+ALIGN	4
+$L$10loop:
+	mov	eax,DWORD[rdi]
+	mov	edx,DWORD[12+rdi]
+$L$10shortcut:
+	movzx	esi,dl
+	movzx	ebx,BYTE[((-128))+rsi*1+rbp]
+	movzx	esi,dh
+	shl	ebx,24
+	xor	eax,ebx
+
+	movzx	ebx,BYTE[((-128))+rsi*1+rbp]
+	shr	edx,16
+	movzx	esi,dl
+	xor	eax,ebx
+
+	movzx	ebx,BYTE[((-128))+rsi*1+rbp]
+	movzx	esi,dh
+	shl	ebx,8
+	xor	eax,ebx
+
+	movzx	ebx,BYTE[((-128))+rsi*1+rbp]
+	shl	ebx,16
+	xor	eax,ebx
+
+	xor	eax,DWORD[((1024-128))+rcx*4+rbp]
+	mov	DWORD[16+rdi],eax
+	xor	eax,DWORD[4+rdi]
+	mov	DWORD[20+rdi],eax
+	xor	eax,DWORD[8+rdi]
+	mov	DWORD[24+rdi],eax
+	xor	eax,DWORD[12+rdi]
+	mov	DWORD[28+rdi],eax
+	add	ecx,1
+	lea	rdi,[16+rdi]
+	cmp	ecx,10
+	jl	NEAR $L$10loop
+
+	mov	DWORD[80+rdi],10
+	xor	rax,rax
+	jmp	NEAR $L$exit
+
+$L$12rounds:
+	mov	rax,QWORD[rsi]
+	mov	rbx,QWORD[8+rsi]
+	mov	rdx,QWORD[16+rsi]
+	mov	QWORD[rdi],rax
+	mov	QWORD[8+rdi],rbx
+	mov	QWORD[16+rdi],rdx
+
+	shr	rdx,32
+	xor	ecx,ecx
+	jmp	NEAR $L$12shortcut
+ALIGN	4
+$L$12loop:
+	mov	eax,DWORD[rdi]
+	mov	edx,DWORD[20+rdi]
+$L$12shortcut:
+	movzx	esi,dl
+	movzx	ebx,BYTE[((-128))+rsi*1+rbp]
+	movzx	esi,dh
+	shl	ebx,24
+	xor	eax,ebx
+
+	movzx	ebx,BYTE[((-128))+rsi*1+rbp]
+	shr	edx,16
+	movzx	esi,dl
+	xor	eax,ebx
+
+	movzx	ebx,BYTE[((-128))+rsi*1+rbp]
+	movzx	esi,dh
+	shl	ebx,8
+	xor	eax,ebx
+
+	movzx	ebx,BYTE[((-128))+rsi*1+rbp]
+	shl	ebx,16
+	xor	eax,ebx
+
+	xor	eax,DWORD[((1024-128))+rcx*4+rbp]
+	mov	DWORD[24+rdi],eax
+	xor	eax,DWORD[4+rdi]
+	mov	DWORD[28+rdi],eax
+	xor	eax,DWORD[8+rdi]
+	mov	DWORD[32+rdi],eax
+	xor	eax,DWORD[12+rdi]
+	mov	DWORD[36+rdi],eax
+
+	cmp	ecx,7
+	je	NEAR $L$12break
+	add	ecx,1
+
+	xor	eax,DWORD[16+rdi]
+	mov	DWORD[40+rdi],eax
+	xor	eax,DWORD[20+rdi]
+	mov	DWORD[44+rdi],eax
+
+	lea	rdi,[24+rdi]
+	jmp	NEAR $L$12loop
+$L$12break:
+	mov	DWORD[72+rdi],12
+	xor	rax,rax
+	jmp	NEAR $L$exit
+
+$L$14rounds:
+	mov	rax,QWORD[rsi]
+	mov	rbx,QWORD[8+rsi]
+	mov	rcx,QWORD[16+rsi]
+	mov	rdx,QWORD[24+rsi]
+	mov	QWORD[rdi],rax
+	mov	QWORD[8+rdi],rbx
+	mov	QWORD[16+rdi],rcx
+	mov	QWORD[24+rdi],rdx
+
+	shr	rdx,32
+	xor	ecx,ecx
+	jmp	NEAR $L$14shortcut
+ALIGN	4
+$L$14loop:
+	mov	eax,DWORD[rdi]
+	mov	edx,DWORD[28+rdi]
+$L$14shortcut:
+	movzx	esi,dl
+	movzx	ebx,BYTE[((-128))+rsi*1+rbp]
+	movzx	esi,dh
+	shl	ebx,24
+	xor	eax,ebx
+
+	movzx	ebx,BYTE[((-128))+rsi*1+rbp]
+	shr	edx,16
+	movzx	esi,dl
+	xor	eax,ebx
+
+	movzx	ebx,BYTE[((-128))+rsi*1+rbp]
+	movzx	esi,dh
+	shl	ebx,8
+	xor	eax,ebx
+
+	movzx	ebx,BYTE[((-128))+rsi*1+rbp]
+	shl	ebx,16
+	xor	eax,ebx
+
+	xor	eax,DWORD[((1024-128))+rcx*4+rbp]
+	mov	DWORD[32+rdi],eax
+	xor	eax,DWORD[4+rdi]
+	mov	DWORD[36+rdi],eax
+	xor	eax,DWORD[8+rdi]
+	mov	DWORD[40+rdi],eax
+	xor	eax,DWORD[12+rdi]
+	mov	DWORD[44+rdi],eax
+
+	cmp	ecx,6
+	je	NEAR $L$14break
+	add	ecx,1
+
+	mov	edx,eax
+	mov	eax,DWORD[16+rdi]
+	movzx	esi,dl
+	movzx	ebx,BYTE[((-128))+rsi*1+rbp]
+	movzx	esi,dh
+	xor	eax,ebx
+
+	movzx	ebx,BYTE[((-128))+rsi*1+rbp]
+	shr	edx,16
+	shl	ebx,8
+	movzx	esi,dl
+	xor	eax,ebx
+
+	movzx	ebx,BYTE[((-128))+rsi*1+rbp]
+	movzx	esi,dh
+	shl	ebx,16
+	xor	eax,ebx
+
+	movzx	ebx,BYTE[((-128))+rsi*1+rbp]
+	shl	ebx,24
+	xor	eax,ebx
+
+	mov	DWORD[48+rdi],eax
+	xor	eax,DWORD[20+rdi]
+	mov	DWORD[52+rdi],eax
+	xor	eax,DWORD[24+rdi]
+	mov	DWORD[56+rdi],eax
+	xor	eax,DWORD[28+rdi]
+	mov	DWORD[60+rdi],eax
+
+	lea	rdi,[32+rdi]
+	jmp	NEAR $L$14loop
+$L$14break:
+	mov	DWORD[48+rdi],14
+	xor	rax,rax
+	jmp	NEAR $L$exit
+
+$L$badpointer:
+	mov	rax,-1
+$L$exit:
+DB	0xf3,0xc3
+
+ALIGN	16
+global	asm_AES_set_decrypt_key
+
+asm_AES_set_decrypt_key:
+	mov	QWORD[8+rsp],rdi	;WIN64 prologue
+	mov	QWORD[16+rsp],rsi
+	mov	rax,rsp
+$L$SEH_begin_asm_AES_set_decrypt_key:
+	mov	rdi,rcx
+	mov	rsi,rdx
+	mov	rdx,r8
+
+
+	push	rbx
+	push	rbp
+	push	r12
+	push	r13
+	push	r14
+	push	r15
+	push	rdx
+$L$dec_key_prologue:
+
+	call	_x86_64_AES_set_encrypt_key
+	mov	r8,QWORD[rsp]
+	cmp	eax,0
+	jne	NEAR $L$abort
+
+	mov	r14d,DWORD[240+r8]
+	xor	rdi,rdi
+	lea	rcx,[r14*4+rdi]
+	mov	rsi,r8
+	lea	rdi,[rcx*4+r8]
+ALIGN	4
+$L$invert:
+	mov	rax,QWORD[rsi]
+	mov	rbx,QWORD[8+rsi]
+	mov	rcx,QWORD[rdi]
+	mov	rdx,QWORD[8+rdi]
+	mov	QWORD[rdi],rax
+	mov	QWORD[8+rdi],rbx
+	mov	QWORD[rsi],rcx
+	mov	QWORD[8+rsi],rdx
+	lea	rsi,[16+rsi]
+	lea	rdi,[((-16))+rdi]
+	cmp	rdi,rsi
+	jne	NEAR $L$invert
+
+	lea	rax,[(($L$AES_Te+2048+1024))]
+
+	mov	rsi,QWORD[40+rax]
+	mov	rdi,QWORD[48+rax]
+	mov	rbp,QWORD[56+rax]
+
+	mov	r15,r8
+	sub	r14d,1
+ALIGN	4
+$L$permute:
+	lea	r15,[16+r15]
+	mov	rax,QWORD[r15]
+	mov	rcx,QWORD[8+r15]
+	mov	r9,rsi
+	mov	r12,rsi
+	and	r9,rax
+	and	r12,rcx
+	mov	rbx,r9
+	mov	rdx,r12
+	shr	r9,7
+	lea	r8,[rax*1+rax]
+	shr	r12,7
+	lea	r11,[rcx*1+rcx]
+	sub	rbx,r9
+	sub	rdx,r12
+	and	r8,rdi
+	and	r11,rdi
+	and	rbx,rbp
+	and	rdx,rbp
+	xor	r8,rbx
+	xor	r11,rdx
+	mov	r10,rsi
+	mov	r13,rsi
+
+	and	r10,r8
+	and	r13,r11
+	mov	rbx,r10
+	mov	rdx,r13
+	shr	r10,7
+	lea	r9,[r8*1+r8]
+	shr	r13,7
+	lea	r12,[r11*1+r11]
+	sub	rbx,r10
+	sub	rdx,r13
+	and	r9,rdi
+	and	r12,rdi
+	and	rbx,rbp
+	and	rdx,rbp
+	xor	r9,rbx
+	xor	r12,rdx
+	mov	r10,rsi
+	mov	r13,rsi
+
+	and	r10,r9
+	and	r13,r12
+	mov	rbx,r10
+	mov	rdx,r13
+	shr	r10,7
+	xor	r8,rax
+	shr	r13,7
+	xor	r11,rcx
+	sub	rbx,r10
+	sub	rdx,r13
+	lea	r10,[r9*1+r9]
+	lea	r13,[r12*1+r12]
+	xor	r9,rax
+	xor	r12,rcx
+	and	r10,rdi
+	and	r13,rdi
+	and	rbx,rbp
+	and	rdx,rbp
+	xor	r10,rbx
+	xor	r13,rdx
+
+	xor	rax,r10
+	xor	rcx,r13
+	xor	r8,r10
+	xor	r11,r13
+	mov	rbx,rax
+	mov	rdx,rcx
+	xor	r9,r10
+	shr	rbx,32
+	xor	r12,r13
+	shr	rdx,32
+	xor	r10,r8
+	rol	eax,8
+	xor	r13,r11
+	rol	ecx,8
+	xor	r10,r9
+	rol	ebx,8
+	xor	r13,r12
+
+	rol	edx,8
+	xor	eax,r10d
+	shr	r10,32
+	xor	ecx,r13d
+	shr	r13,32
+	xor	ebx,r10d
+	xor	edx,r13d
+
+	mov	r10,r8
+	rol	r8d,24
+	mov	r13,r11
+	rol	r11d,24
+	shr	r10,32
+	xor	eax,r8d
+	shr	r13,32
+	xor	ecx,r11d
+	rol	r10d,24
+	mov	r8,r9
+	rol	r13d,24
+	mov	r11,r12
+	shr	r8,32
+	xor	ebx,r10d
+	shr	r11,32
+	xor	edx,r13d
+
+
+	rol	r9d,16
+
+	rol	r12d,16
+
+	rol	r8d,16
+
+	xor	eax,r9d
+	rol	r11d,16
+	xor	ecx,r12d
+
+	xor	ebx,r8d
+	xor	edx,r11d
+	mov	DWORD[r15],eax
+	mov	DWORD[4+r15],ebx
+	mov	DWORD[8+r15],ecx
+	mov	DWORD[12+r15],edx
+	sub	r14d,1
+	jnz	NEAR $L$permute
+
+	xor	rax,rax
+$L$abort:
+	mov	r15,QWORD[8+rsp]
+	mov	r14,QWORD[16+rsp]
+	mov	r13,QWORD[24+rsp]
+	mov	r12,QWORD[32+rsp]
+	mov	rbp,QWORD[40+rsp]
+	mov	rbx,QWORD[48+rsp]
+	add	rsp,56
+$L$dec_key_epilogue:
+	mov	rdi,QWORD[8+rsp]	;WIN64 epilogue
+	mov	rsi,QWORD[16+rsp]
+	DB	0F3h,0C3h		;repret
+$L$SEH_end_asm_AES_set_decrypt_key:
+ALIGN	16
+global	asm_AES_cbc_encrypt
+
+EXTERN	OPENSSL_ia32cap_P
+
+asm_AES_cbc_encrypt:
+	mov	QWORD[8+rsp],rdi	;WIN64 prologue
+	mov	QWORD[16+rsp],rsi
+	mov	rax,rsp
+$L$SEH_begin_asm_AES_cbc_encrypt:
+	mov	rdi,rcx
+	mov	rsi,rdx
+	mov	rdx,r8
+	mov	rcx,r9
+	mov	r8,QWORD[40+rsp]
+	mov	r9,QWORD[48+rsp]
+
+
+	cmp	rdx,0
+	je	NEAR $L$cbc_epilogue
+	pushfq
+	push	rbx
+	push	rbp
+	push	r12
+	push	r13
+	push	r14
+	push	r15
+$L$cbc_prologue:
+
+	cld
+	mov	r9d,r9d
+
+	lea	r14,[$L$AES_Te]
+	cmp	r9,0
+	jne	NEAR $L$cbc_picked_te
+	lea	r14,[$L$AES_Td]
+$L$cbc_picked_te:
+
+	mov	r10d,DWORD[OPENSSL_ia32cap_P]
+	cmp	rdx,512
+	jb	NEAR $L$cbc_slow_prologue
+	test	rdx,15
+	jnz	NEAR $L$cbc_slow_prologue
+	bt	r10d,28
+	jc	NEAR $L$cbc_slow_prologue
+
+
+	lea	r15,[((-88-248))+rsp]
+	and	r15,-64
+
+
+	mov	r10,r14
+	lea	r11,[2304+r14]
+	mov	r12,r15
+	and	r10,0xFFF
+	and	r11,0xFFF
+	and	r12,0xFFF
+
+	cmp	r12,r11
+	jb	NEAR $L$cbc_te_break_out
+	sub	r12,r11
+	sub	r15,r12
+	jmp	NEAR $L$cbc_te_ok
+$L$cbc_te_break_out:
+	sub	r12,r10
+	and	r12,0xFFF
+	add	r12,320
+	sub	r15,r12
+ALIGN	4
+$L$cbc_te_ok:
+
+	xchg	r15,rsp
+
+	mov	QWORD[16+rsp],r15
+$L$cbc_fast_body:
+	mov	QWORD[24+rsp],rdi
+	mov	QWORD[32+rsp],rsi
+	mov	QWORD[40+rsp],rdx
+	mov	QWORD[48+rsp],rcx
+	mov	QWORD[56+rsp],r8
+	mov	DWORD[((80+240))+rsp],0
+	mov	rbp,r8
+	mov	rbx,r9
+	mov	r9,rsi
+	mov	r8,rdi
+	mov	r15,rcx
+
+	mov	eax,DWORD[240+r15]
+
+	mov	r10,r15
+	sub	r10,r14
+	and	r10,0xfff
+	cmp	r10,2304
+	jb	NEAR $L$cbc_do_ecopy
+	cmp	r10,4096-248
+	jb	NEAR $L$cbc_skip_ecopy
+ALIGN	4
+$L$cbc_do_ecopy:
+	mov	rsi,r15
+	lea	rdi,[80+rsp]
+	lea	r15,[80+rsp]
+	mov	ecx,240/8
+	DD	0x90A548F3
+	mov	DWORD[rdi],eax
+$L$cbc_skip_ecopy:
+	mov	QWORD[rsp],r15
+
+	mov	ecx,18
+ALIGN	4
+$L$cbc_prefetch_te:
+	mov	r10,QWORD[r14]
+	mov	r11,QWORD[32+r14]
+	mov	r12,QWORD[64+r14]
+	mov	r13,QWORD[96+r14]
+	lea	r14,[128+r14]
+	sub	ecx,1
+	jnz	NEAR $L$cbc_prefetch_te
+	lea	r14,[((-2304))+r14]
+
+	cmp	rbx,0
+	je	NEAR $L$FAST_DECRYPT
+
+
+	mov	eax,DWORD[rbp]
+	mov	ebx,DWORD[4+rbp]
+	mov	ecx,DWORD[8+rbp]
+	mov	edx,DWORD[12+rbp]
+
+ALIGN	4
+$L$cbc_fast_enc_loop:
+	xor	eax,DWORD[r8]
+	xor	ebx,DWORD[4+r8]
+	xor	ecx,DWORD[8+r8]
+	xor	edx,DWORD[12+r8]
+	mov	r15,QWORD[rsp]
+	mov	QWORD[24+rsp],r8
+
+	call	_x86_64_AES_encrypt
+
+	mov	r8,QWORD[24+rsp]
+	mov	r10,QWORD[40+rsp]
+	mov	DWORD[r9],eax
+	mov	DWORD[4+r9],ebx
+	mov	DWORD[8+r9],ecx
+	mov	DWORD[12+r9],edx
+
+	lea	r8,[16+r8]
+	lea	r9,[16+r9]
+	sub	r10,16
+	test	r10,-16
+	mov	QWORD[40+rsp],r10
+	jnz	NEAR $L$cbc_fast_enc_loop
+	mov	rbp,QWORD[56+rsp]
+	mov	DWORD[rbp],eax
+	mov	DWORD[4+rbp],ebx
+	mov	DWORD[8+rbp],ecx
+	mov	DWORD[12+rbp],edx
+
+	jmp	NEAR $L$cbc_fast_cleanup
+
+
+ALIGN	16
+$L$FAST_DECRYPT:
+	cmp	r9,r8
+	je	NEAR $L$cbc_fast_dec_in_place
+
+	mov	QWORD[64+rsp],rbp
+ALIGN	4
+$L$cbc_fast_dec_loop:
+	mov	eax,DWORD[r8]
+	mov	ebx,DWORD[4+r8]
+	mov	ecx,DWORD[8+r8]
+	mov	edx,DWORD[12+r8]
+	mov	r15,QWORD[rsp]
+	mov	QWORD[24+rsp],r8
+
+	call	_x86_64_AES_decrypt
+
+	mov	rbp,QWORD[64+rsp]
+	mov	r8,QWORD[24+rsp]
+	mov	r10,QWORD[40+rsp]
+	xor	eax,DWORD[rbp]
+	xor	ebx,DWORD[4+rbp]
+	xor	ecx,DWORD[8+rbp]
+	xor	edx,DWORD[12+rbp]
+	mov	rbp,r8
+
+	sub	r10,16
+	mov	QWORD[40+rsp],r10
+	mov	QWORD[64+rsp],rbp
+
+	mov	DWORD[r9],eax
+	mov	DWORD[4+r9],ebx
+	mov	DWORD[8+r9],ecx
+	mov	DWORD[12+r9],edx
+
+	lea	r8,[16+r8]
+	lea	r9,[16+r9]
+	jnz	NEAR $L$cbc_fast_dec_loop
+	mov	r12,QWORD[56+rsp]
+	mov	r10,QWORD[rbp]
+	mov	r11,QWORD[8+rbp]
+	mov	QWORD[r12],r10
+	mov	QWORD[8+r12],r11
+	jmp	NEAR $L$cbc_fast_cleanup
+
+ALIGN	16
+$L$cbc_fast_dec_in_place:
+	mov	r10,QWORD[rbp]
+	mov	r11,QWORD[8+rbp]
+	mov	QWORD[((0+64))+rsp],r10
+	mov	QWORD[((8+64))+rsp],r11
+ALIGN	4
+$L$cbc_fast_dec_in_place_loop:
+	mov	eax,DWORD[r8]
+	mov	ebx,DWORD[4+r8]
+	mov	ecx,DWORD[8+r8]
+	mov	edx,DWORD[12+r8]
+	mov	r15,QWORD[rsp]
+	mov	QWORD[24+rsp],r8
+
+	call	_x86_64_AES_decrypt
+
+	mov	r8,QWORD[24+rsp]
+	mov	r10,QWORD[40+rsp]
+	xor	eax,DWORD[((0+64))+rsp]
+	xor	ebx,DWORD[((4+64))+rsp]
+	xor	ecx,DWORD[((8+64))+rsp]
+	xor	edx,DWORD[((12+64))+rsp]
+
+	mov	r11,QWORD[r8]
+	mov	r12,QWORD[8+r8]
+	sub	r10,16
+	jz	NEAR $L$cbc_fast_dec_in_place_done
+
+	mov	QWORD[((0+64))+rsp],r11
+	mov	QWORD[((8+64))+rsp],r12
+
+	mov	DWORD[r9],eax
+	mov	DWORD[4+r9],ebx
+	mov	DWORD[8+r9],ecx
+	mov	DWORD[12+r9],edx
+
+	lea	r8,[16+r8]
+	lea	r9,[16+r9]
+	mov	QWORD[40+rsp],r10
+	jmp	NEAR $L$cbc_fast_dec_in_place_loop
+$L$cbc_fast_dec_in_place_done:
+	mov	rdi,QWORD[56+rsp]
+	mov	QWORD[rdi],r11
+	mov	QWORD[8+rdi],r12
+
+	mov	DWORD[r9],eax
+	mov	DWORD[4+r9],ebx
+	mov	DWORD[8+r9],ecx
+	mov	DWORD[12+r9],edx
+
+ALIGN	4
+$L$cbc_fast_cleanup:
+	cmp	DWORD[((80+240))+rsp],0
+	lea	rdi,[80+rsp]
+	je	NEAR $L$cbc_exit
+	mov	ecx,240/8
+	xor	rax,rax
+	DD	0x90AB48F3
+
+	jmp	NEAR $L$cbc_exit
+
+
+ALIGN	16
+$L$cbc_slow_prologue:
+
+	lea	rbp,[((-88))+rsp]
+	and	rbp,-64
+
+	lea	r10,[((-88-63))+rcx]
+	sub	r10,rbp
+	neg	r10
+	and	r10,0x3c0
+	sub	rbp,r10
+
+	xchg	rbp,rsp
+
+	mov	QWORD[16+rsp],rbp
+$L$cbc_slow_body:
+
+
+
+
+	mov	QWORD[56+rsp],r8
+	mov	rbp,r8
+	mov	rbx,r9
+	mov	r9,rsi
+	mov	r8,rdi
+	mov	r15,rcx
+	mov	r10,rdx
+
+	mov	eax,DWORD[240+r15]
+	mov	QWORD[rsp],r15
+	shl	eax,4
+	lea	rax,[rax*1+r15]
+	mov	QWORD[8+rsp],rax
+
+
+	lea	r14,[2048+r14]
+	lea	rax,[((768-8))+rsp]
+	sub	rax,r14
+	and	rax,0x300
+	lea	r14,[rax*1+r14]
+
+	cmp	rbx,0
+	je	NEAR $L$SLOW_DECRYPT
+
+
+	test	r10,-16
+	mov	eax,DWORD[rbp]
+	mov	ebx,DWORD[4+rbp]
+	mov	ecx,DWORD[8+rbp]
+	mov	edx,DWORD[12+rbp]
+	jz	NEAR $L$cbc_slow_enc_tail
+
+ALIGN	4
+$L$cbc_slow_enc_loop:
+	xor	eax,DWORD[r8]
+	xor	ebx,DWORD[4+r8]
+	xor	ecx,DWORD[8+r8]
+	xor	edx,DWORD[12+r8]
+	mov	r15,QWORD[rsp]
+	mov	QWORD[24+rsp],r8
+	mov	QWORD[32+rsp],r9
+	mov	QWORD[40+rsp],r10
+
+	call	_x86_64_AES_encrypt_compact
+
+	mov	r8,QWORD[24+rsp]
+	mov	r9,QWORD[32+rsp]
+	mov	r10,QWORD[40+rsp]
+	mov	DWORD[r9],eax
+	mov	DWORD[4+r9],ebx
+	mov	DWORD[8+r9],ecx
+	mov	DWORD[12+r9],edx
+
+	lea	r8,[16+r8]
+	lea	r9,[16+r9]
+	sub	r10,16
+	test	r10,-16
+	jnz	NEAR $L$cbc_slow_enc_loop
+	test	r10,15
+	jnz	NEAR $L$cbc_slow_enc_tail
+	mov	rbp,QWORD[56+rsp]
+	mov	DWORD[rbp],eax
+	mov	DWORD[4+rbp],ebx
+	mov	DWORD[8+rbp],ecx
+	mov	DWORD[12+rbp],edx
+
+	jmp	NEAR $L$cbc_exit
+
+ALIGN	4
+$L$cbc_slow_enc_tail:
+	mov	r11,rax
+	mov	r12,rcx
+	mov	rcx,r10
+	mov	rsi,r8
+	mov	rdi,r9
+	DD	0x9066A4F3
+	mov	rcx,16
+	sub	rcx,r10
+	xor	rax,rax
+	DD	0x9066AAF3
+	mov	r8,r9
+	mov	r10,16
+	mov	rax,r11
+	mov	rcx,r12
+	jmp	NEAR $L$cbc_slow_enc_loop
+
+ALIGN	16
+$L$SLOW_DECRYPT:
+	shr	rax,3
+	add	r14,rax
+
+	mov	r11,QWORD[rbp]
+	mov	r12,QWORD[8+rbp]
+	mov	QWORD[((0+64))+rsp],r11
+	mov	QWORD[((8+64))+rsp],r12
+
+ALIGN	4
+$L$cbc_slow_dec_loop:
+	mov	eax,DWORD[r8]
+	mov	ebx,DWORD[4+r8]
+	mov	ecx,DWORD[8+r8]
+	mov	edx,DWORD[12+r8]
+	mov	r15,QWORD[rsp]
+	mov	QWORD[24+rsp],r8
+	mov	QWORD[32+rsp],r9
+	mov	QWORD[40+rsp],r10
+
+	call	_x86_64_AES_decrypt_compact
+
+	mov	r8,QWORD[24+rsp]
+	mov	r9,QWORD[32+rsp]
+	mov	r10,QWORD[40+rsp]
+	xor	eax,DWORD[((0+64))+rsp]
+	xor	ebx,DWORD[((4+64))+rsp]
+	xor	ecx,DWORD[((8+64))+rsp]
+	xor	edx,DWORD[((12+64))+rsp]
+
+	mov	r11,QWORD[r8]
+	mov	r12,QWORD[8+r8]
+	sub	r10,16
+	jc	NEAR $L$cbc_slow_dec_partial
+	jz	NEAR $L$cbc_slow_dec_done
+
+	mov	QWORD[((0+64))+rsp],r11
+	mov	QWORD[((8+64))+rsp],r12
+
+	mov	DWORD[r9],eax
+	mov	DWORD[4+r9],ebx
+	mov	DWORD[8+r9],ecx
+	mov	DWORD[12+r9],edx
+
+	lea	r8,[16+r8]
+	lea	r9,[16+r9]
+	jmp	NEAR $L$cbc_slow_dec_loop
+$L$cbc_slow_dec_done:
+	mov	rdi,QWORD[56+rsp]
+	mov	QWORD[rdi],r11
+	mov	QWORD[8+rdi],r12
+
+	mov	DWORD[r9],eax
+	mov	DWORD[4+r9],ebx
+	mov	DWORD[8+r9],ecx
+	mov	DWORD[12+r9],edx
+
+	jmp	NEAR $L$cbc_exit
+
+ALIGN	4
+$L$cbc_slow_dec_partial:
+	mov	rdi,QWORD[56+rsp]
+	mov	QWORD[rdi],r11
+	mov	QWORD[8+rdi],r12
+
+	mov	DWORD[((0+64))+rsp],eax
+	mov	DWORD[((4+64))+rsp],ebx
+	mov	DWORD[((8+64))+rsp],ecx
+	mov	DWORD[((12+64))+rsp],edx
+
+	mov	rdi,r9
+	lea	rsi,[64+rsp]
+	lea	rcx,[16+r10]
+	DD	0x9066A4F3
+	jmp	NEAR $L$cbc_exit
+
+ALIGN	16
+$L$cbc_exit:
+	mov	rsi,QWORD[16+rsp]
+	mov	r15,QWORD[rsi]
+	mov	r14,QWORD[8+rsi]
+	mov	r13,QWORD[16+rsi]
+	mov	r12,QWORD[24+rsi]
+	mov	rbp,QWORD[32+rsi]
+	mov	rbx,QWORD[40+rsi]
+	lea	rsp,[48+rsi]
+$L$cbc_popfq:
+	popfq
+$L$cbc_epilogue:
+	mov	rdi,QWORD[8+rsp]	;WIN64 epilogue
+	mov	rsi,QWORD[16+rsp]
+	DB	0F3h,0C3h		;repret
+$L$SEH_end_asm_AES_cbc_encrypt:
+ALIGN	64
+$L$AES_Te:
+	DD	0xa56363c6,0xa56363c6
+	DD	0x847c7cf8,0x847c7cf8
+	DD	0x997777ee,0x997777ee
+	DD	0x8d7b7bf6,0x8d7b7bf6
+	DD	0x0df2f2ff,0x0df2f2ff
+	DD	0xbd6b6bd6,0xbd6b6bd6
+	DD	0xb16f6fde,0xb16f6fde
+	DD	0x54c5c591,0x54c5c591
+	DD	0x50303060,0x50303060
+	DD	0x03010102,0x03010102
+	DD	0xa96767ce,0xa96767ce
+	DD	0x7d2b2b56,0x7d2b2b56
+	DD	0x19fefee7,0x19fefee7
+	DD	0x62d7d7b5,0x62d7d7b5
+	DD	0xe6abab4d,0xe6abab4d
+	DD	0x9a7676ec,0x9a7676ec
+	DD	0x45caca8f,0x45caca8f
+	DD	0x9d82821f,0x9d82821f
+	DD	0x40c9c989,0x40c9c989
+	DD	0x877d7dfa,0x877d7dfa
+	DD	0x15fafaef,0x15fafaef
+	DD	0xeb5959b2,0xeb5959b2
+	DD	0xc947478e,0xc947478e
+	DD	0x0bf0f0fb,0x0bf0f0fb
+	DD	0xecadad41,0xecadad41
+	DD	0x67d4d4b3,0x67d4d4b3
+	DD	0xfda2a25f,0xfda2a25f
+	DD	0xeaafaf45,0xeaafaf45
+	DD	0xbf9c9c23,0xbf9c9c23
+	DD	0xf7a4a453,0xf7a4a453
+	DD	0x967272e4,0x967272e4
+	DD	0x5bc0c09b,0x5bc0c09b
+	DD	0xc2b7b775,0xc2b7b775
+	DD	0x1cfdfde1,0x1cfdfde1
+	DD	0xae93933d,0xae93933d
+	DD	0x6a26264c,0x6a26264c
+	DD	0x5a36366c,0x5a36366c
+	DD	0x413f3f7e,0x413f3f7e
+	DD	0x02f7f7f5,0x02f7f7f5
+	DD	0x4fcccc83,0x4fcccc83
+	DD	0x5c343468,0x5c343468
+	DD	0xf4a5a551,0xf4a5a551
+	DD	0x34e5e5d1,0x34e5e5d1
+	DD	0x08f1f1f9,0x08f1f1f9
+	DD	0x937171e2,0x937171e2
+	DD	0x73d8d8ab,0x73d8d8ab
+	DD	0x53313162,0x53313162
+	DD	0x3f15152a,0x3f15152a
+	DD	0x0c040408,0x0c040408
+	DD	0x52c7c795,0x52c7c795
+	DD	0x65232346,0x65232346
+	DD	0x5ec3c39d,0x5ec3c39d
+	DD	0x28181830,0x28181830
+	DD	0xa1969637,0xa1969637
+	DD	0x0f05050a,0x0f05050a
+	DD	0xb59a9a2f,0xb59a9a2f
+	DD	0x0907070e,0x0907070e
+	DD	0x36121224,0x36121224
+	DD	0x9b80801b,0x9b80801b
+	DD	0x3de2e2df,0x3de2e2df
+	DD	0x26ebebcd,0x26ebebcd
+	DD	0x6927274e,0x6927274e
+	DD	0xcdb2b27f,0xcdb2b27f
+	DD	0x9f7575ea,0x9f7575ea
+	DD	0x1b090912,0x1b090912
+	DD	0x9e83831d,0x9e83831d
+	DD	0x742c2c58,0x742c2c58
+	DD	0x2e1a1a34,0x2e1a1a34
+	DD	0x2d1b1b36,0x2d1b1b36
+	DD	0xb26e6edc,0xb26e6edc
+	DD	0xee5a5ab4,0xee5a5ab4
+	DD	0xfba0a05b,0xfba0a05b
+	DD	0xf65252a4,0xf65252a4
+	DD	0x4d3b3b76,0x4d3b3b76
+	DD	0x61d6d6b7,0x61d6d6b7
+	DD	0xceb3b37d,0xceb3b37d
+	DD	0x7b292952,0x7b292952
+	DD	0x3ee3e3dd,0x3ee3e3dd
+	DD	0x712f2f5e,0x712f2f5e
+	DD	0x97848413,0x97848413
+	DD	0xf55353a6,0xf55353a6
+	DD	0x68d1d1b9,0x68d1d1b9
+	DD	0x00000000,0x00000000
+	DD	0x2cededc1,0x2cededc1
+	DD	0x60202040,0x60202040
+	DD	0x1ffcfce3,0x1ffcfce3
+	DD	0xc8b1b179,0xc8b1b179
+	DD	0xed5b5bb6,0xed5b5bb6
+	DD	0xbe6a6ad4,0xbe6a6ad4
+	DD	0x46cbcb8d,0x46cbcb8d
+	DD	0xd9bebe67,0xd9bebe67
+	DD	0x4b393972,0x4b393972
+	DD	0xde4a4a94,0xde4a4a94
+	DD	0xd44c4c98,0xd44c4c98
+	DD	0xe85858b0,0xe85858b0
+	DD	0x4acfcf85,0x4acfcf85
+	DD	0x6bd0d0bb,0x6bd0d0bb
+	DD	0x2aefefc5,0x2aefefc5
+	DD	0xe5aaaa4f,0xe5aaaa4f
+	DD	0x16fbfbed,0x16fbfbed
+	DD	0xc5434386,0xc5434386
+	DD	0xd74d4d9a,0xd74d4d9a
+	DD	0x55333366,0x55333366
+	DD	0x94858511,0x94858511
+	DD	0xcf45458a,0xcf45458a
+	DD	0x10f9f9e9,0x10f9f9e9
+	DD	0x06020204,0x06020204
+	DD	0x817f7ffe,0x817f7ffe
+	DD	0xf05050a0,0xf05050a0
+	DD	0x443c3c78,0x443c3c78
+	DD	0xba9f9f25,0xba9f9f25
+	DD	0xe3a8a84b,0xe3a8a84b
+	DD	0xf35151a2,0xf35151a2
+	DD	0xfea3a35d,0xfea3a35d
+	DD	0xc0404080,0xc0404080
+	DD	0x8a8f8f05,0x8a8f8f05
+	DD	0xad92923f,0xad92923f
+	DD	0xbc9d9d21,0xbc9d9d21
+	DD	0x48383870,0x48383870
+	DD	0x04f5f5f1,0x04f5f5f1
+	DD	0xdfbcbc63,0xdfbcbc63
+	DD	0xc1b6b677,0xc1b6b677
+	DD	0x75dadaaf,0x75dadaaf
+	DD	0x63212142,0x63212142
+	DD	0x30101020,0x30101020
+	DD	0x1affffe5,0x1affffe5
+	DD	0x0ef3f3fd,0x0ef3f3fd
+	DD	0x6dd2d2bf,0x6dd2d2bf
+	DD	0x4ccdcd81,0x4ccdcd81
+	DD	0x140c0c18,0x140c0c18
+	DD	0x35131326,0x35131326
+	DD	0x2fececc3,0x2fececc3
+	DD	0xe15f5fbe,0xe15f5fbe
+	DD	0xa2979735,0xa2979735
+	DD	0xcc444488,0xcc444488
+	DD	0x3917172e,0x3917172e
+	DD	0x57c4c493,0x57c4c493
+	DD	0xf2a7a755,0xf2a7a755
+	DD	0x827e7efc,0x827e7efc
+	DD	0x473d3d7a,0x473d3d7a
+	DD	0xac6464c8,0xac6464c8
+	DD	0xe75d5dba,0xe75d5dba
+	DD	0x2b191932,0x2b191932
+	DD	0x957373e6,0x957373e6
+	DD	0xa06060c0,0xa06060c0
+	DD	0x98818119,0x98818119
+	DD	0xd14f4f9e,0xd14f4f9e
+	DD	0x7fdcdca3,0x7fdcdca3
+	DD	0x66222244,0x66222244
+	DD	0x7e2a2a54,0x7e2a2a54
+	DD	0xab90903b,0xab90903b
+	DD	0x8388880b,0x8388880b
+	DD	0xca46468c,0xca46468c
+	DD	0x29eeeec7,0x29eeeec7
+	DD	0xd3b8b86b,0xd3b8b86b
+	DD	0x3c141428,0x3c141428
+	DD	0x79dedea7,0x79dedea7
+	DD	0xe25e5ebc,0xe25e5ebc
+	DD	0x1d0b0b16,0x1d0b0b16
+	DD	0x76dbdbad,0x76dbdbad
+	DD	0x3be0e0db,0x3be0e0db
+	DD	0x56323264,0x56323264
+	DD	0x4e3a3a74,0x4e3a3a74
+	DD	0x1e0a0a14,0x1e0a0a14
+	DD	0xdb494992,0xdb494992
+	DD	0x0a06060c,0x0a06060c
+	DD	0x6c242448,0x6c242448
+	DD	0xe45c5cb8,0xe45c5cb8
+	DD	0x5dc2c29f,0x5dc2c29f
+	DD	0x6ed3d3bd,0x6ed3d3bd
+	DD	0xefacac43,0xefacac43
+	DD	0xa66262c4,0xa66262c4
+	DD	0xa8919139,0xa8919139
+	DD	0xa4959531,0xa4959531
+	DD	0x37e4e4d3,0x37e4e4d3
+	DD	0x8b7979f2,0x8b7979f2
+	DD	0x32e7e7d5,0x32e7e7d5
+	DD	0x43c8c88b,0x43c8c88b
+	DD	0x5937376e,0x5937376e
+	DD	0xb76d6dda,0xb76d6dda
+	DD	0x8c8d8d01,0x8c8d8d01
+	DD	0x64d5d5b1,0x64d5d5b1
+	DD	0xd24e4e9c,0xd24e4e9c
+	DD	0xe0a9a949,0xe0a9a949
+	DD	0xb46c6cd8,0xb46c6cd8
+	DD	0xfa5656ac,0xfa5656ac
+	DD	0x07f4f4f3,0x07f4f4f3
+	DD	0x25eaeacf,0x25eaeacf
+	DD	0xaf6565ca,0xaf6565ca
+	DD	0x8e7a7af4,0x8e7a7af4
+	DD	0xe9aeae47,0xe9aeae47
+	DD	0x18080810,0x18080810
+	DD	0xd5baba6f,0xd5baba6f
+	DD	0x887878f0,0x887878f0
+	DD	0x6f25254a,0x6f25254a
+	DD	0x722e2e5c,0x722e2e5c
+	DD	0x241c1c38,0x241c1c38
+	DD	0xf1a6a657,0xf1a6a657
+	DD	0xc7b4b473,0xc7b4b473
+	DD	0x51c6c697,0x51c6c697
+	DD	0x23e8e8cb,0x23e8e8cb
+	DD	0x7cdddda1,0x7cdddda1
+	DD	0x9c7474e8,0x9c7474e8
+	DD	0x211f1f3e,0x211f1f3e
+	DD	0xdd4b4b96,0xdd4b4b96
+	DD	0xdcbdbd61,0xdcbdbd61
+	DD	0x868b8b0d,0x868b8b0d
+	DD	0x858a8a0f,0x858a8a0f
+	DD	0x907070e0,0x907070e0
+	DD	0x423e3e7c,0x423e3e7c
+	DD	0xc4b5b571,0xc4b5b571
+	DD	0xaa6666cc,0xaa6666cc
+	DD	0xd8484890,0xd8484890
+	DD	0x05030306,0x05030306
+	DD	0x01f6f6f7,0x01f6f6f7
+	DD	0x120e0e1c,0x120e0e1c
+	DD	0xa36161c2,0xa36161c2
+	DD	0x5f35356a,0x5f35356a
+	DD	0xf95757ae,0xf95757ae
+	DD	0xd0b9b969,0xd0b9b969
+	DD	0x91868617,0x91868617
+	DD	0x58c1c199,0x58c1c199
+	DD	0x271d1d3a,0x271d1d3a
+	DD	0xb99e9e27,0xb99e9e27
+	DD	0x38e1e1d9,0x38e1e1d9
+	DD	0x13f8f8eb,0x13f8f8eb
+	DD	0xb398982b,0xb398982b
+	DD	0x33111122,0x33111122
+	DD	0xbb6969d2,0xbb6969d2
+	DD	0x70d9d9a9,0x70d9d9a9
+	DD	0x898e8e07,0x898e8e07
+	DD	0xa7949433,0xa7949433
+	DD	0xb69b9b2d,0xb69b9b2d
+	DD	0x221e1e3c,0x221e1e3c
+	DD	0x92878715,0x92878715
+	DD	0x20e9e9c9,0x20e9e9c9
+	DD	0x49cece87,0x49cece87
+	DD	0xff5555aa,0xff5555aa
+	DD	0x78282850,0x78282850
+	DD	0x7adfdfa5,0x7adfdfa5
+	DD	0x8f8c8c03,0x8f8c8c03
+	DD	0xf8a1a159,0xf8a1a159
+	DD	0x80898909,0x80898909
+	DD	0x170d0d1a,0x170d0d1a
+	DD	0xdabfbf65,0xdabfbf65
+	DD	0x31e6e6d7,0x31e6e6d7
+	DD	0xc6424284,0xc6424284
+	DD	0xb86868d0,0xb86868d0
+	DD	0xc3414182,0xc3414182
+	DD	0xb0999929,0xb0999929
+	DD	0x772d2d5a,0x772d2d5a
+	DD	0x110f0f1e,0x110f0f1e
+	DD	0xcbb0b07b,0xcbb0b07b
+	DD	0xfc5454a8,0xfc5454a8
+	DD	0xd6bbbb6d,0xd6bbbb6d
+	DD	0x3a16162c,0x3a16162c
+DB	0x63,0x7c,0x77,0x7b,0xf2,0x6b,0x6f,0xc5
+DB	0x30,0x01,0x67,0x2b,0xfe,0xd7,0xab,0x76
+DB	0xca,0x82,0xc9,0x7d,0xfa,0x59,0x47,0xf0
+DB	0xad,0xd4,0xa2,0xaf,0x9c,0xa4,0x72,0xc0
+DB	0xb7,0xfd,0x93,0x26,0x36,0x3f,0xf7,0xcc
+DB	0x34,0xa5,0xe5,0xf1,0x71,0xd8,0x31,0x15
+DB	0x04,0xc7,0x23,0xc3,0x18,0x96,0x05,0x9a
+DB	0x07,0x12,0x80,0xe2,0xeb,0x27,0xb2,0x75
+DB	0x09,0x83,0x2c,0x1a,0x1b,0x6e,0x5a,0xa0
+DB	0x52,0x3b,0xd6,0xb3,0x29,0xe3,0x2f,0x84
+DB	0x53,0xd1,0x00,0xed,0x20,0xfc,0xb1,0x5b
+DB	0x6a,0xcb,0xbe,0x39,0x4a,0x4c,0x58,0xcf
+DB	0xd0,0xef,0xaa,0xfb,0x43,0x4d,0x33,0x85
+DB	0x45,0xf9,0x02,0x7f,0x50,0x3c,0x9f,0xa8
+DB	0x51,0xa3,0x40,0x8f,0x92,0x9d,0x38,0xf5
+DB	0xbc,0xb6,0xda,0x21,0x10,0xff,0xf3,0xd2
+DB	0xcd,0x0c,0x13,0xec,0x5f,0x97,0x44,0x17
+DB	0xc4,0xa7,0x7e,0x3d,0x64,0x5d,0x19,0x73
+DB	0x60,0x81,0x4f,0xdc,0x22,0x2a,0x90,0x88
+DB	0x46,0xee,0xb8,0x14,0xde,0x5e,0x0b,0xdb
+DB	0xe0,0x32,0x3a,0x0a,0x49,0x06,0x24,0x5c
+DB	0xc2,0xd3,0xac,0x62,0x91,0x95,0xe4,0x79
+DB	0xe7,0xc8,0x37,0x6d,0x8d,0xd5,0x4e,0xa9
+DB	0x6c,0x56,0xf4,0xea,0x65,0x7a,0xae,0x08
+DB	0xba,0x78,0x25,0x2e,0x1c,0xa6,0xb4,0xc6
+DB	0xe8,0xdd,0x74,0x1f,0x4b,0xbd,0x8b,0x8a
+DB	0x70,0x3e,0xb5,0x66,0x48,0x03,0xf6,0x0e
+DB	0x61,0x35,0x57,0xb9,0x86,0xc1,0x1d,0x9e
+DB	0xe1,0xf8,0x98,0x11,0x69,0xd9,0x8e,0x94
+DB	0x9b,0x1e,0x87,0xe9,0xce,0x55,0x28,0xdf
+DB	0x8c,0xa1,0x89,0x0d,0xbf,0xe6,0x42,0x68
+DB	0x41,0x99,0x2d,0x0f,0xb0,0x54,0xbb,0x16
+DB	0x63,0x7c,0x77,0x7b,0xf2,0x6b,0x6f,0xc5
+DB	0x30,0x01,0x67,0x2b,0xfe,0xd7,0xab,0x76
+DB	0xca,0x82,0xc9,0x7d,0xfa,0x59,0x47,0xf0
+DB	0xad,0xd4,0xa2,0xaf,0x9c,0xa4,0x72,0xc0
+DB	0xb7,0xfd,0x93,0x26,0x36,0x3f,0xf7,0xcc
+DB	0x34,0xa5,0xe5,0xf1,0x71,0xd8,0x31,0x15
+DB	0x04,0xc7,0x23,0xc3,0x18,0x96,0x05,0x9a
+DB	0x07,0x12,0x80,0xe2,0xeb,0x27,0xb2,0x75
+DB	0x09,0x83,0x2c,0x1a,0x1b,0x6e,0x5a,0xa0
+DB	0x52,0x3b,0xd6,0xb3,0x29,0xe3,0x2f,0x84
+DB	0x53,0xd1,0x00,0xed,0x20,0xfc,0xb1,0x5b
+DB	0x6a,0xcb,0xbe,0x39,0x4a,0x4c,0x58,0xcf
+DB	0xd0,0xef,0xaa,0xfb,0x43,0x4d,0x33,0x85
+DB	0x45,0xf9,0x02,0x7f,0x50,0x3c,0x9f,0xa8
+DB	0x51,0xa3,0x40,0x8f,0x92,0x9d,0x38,0xf5
+DB	0xbc,0xb6,0xda,0x21,0x10,0xff,0xf3,0xd2
+DB	0xcd,0x0c,0x13,0xec,0x5f,0x97,0x44,0x17
+DB	0xc4,0xa7,0x7e,0x3d,0x64,0x5d,0x19,0x73
+DB	0x60,0x81,0x4f,0xdc,0x22,0x2a,0x90,0x88
+DB	0x46,0xee,0xb8,0x14,0xde,0x5e,0x0b,0xdb
+DB	0xe0,0x32,0x3a,0x0a,0x49,0x06,0x24,0x5c
+DB	0xc2,0xd3,0xac,0x62,0x91,0x95,0xe4,0x79
+DB	0xe7,0xc8,0x37,0x6d,0x8d,0xd5,0x4e,0xa9
+DB	0x6c,0x56,0xf4,0xea,0x65,0x7a,0xae,0x08
+DB	0xba,0x78,0x25,0x2e,0x1c,0xa6,0xb4,0xc6
+DB	0xe8,0xdd,0x74,0x1f,0x4b,0xbd,0x8b,0x8a
+DB	0x70,0x3e,0xb5,0x66,0x48,0x03,0xf6,0x0e
+DB	0x61,0x35,0x57,0xb9,0x86,0xc1,0x1d,0x9e
+DB	0xe1,0xf8,0x98,0x11,0x69,0xd9,0x8e,0x94
+DB	0x9b,0x1e,0x87,0xe9,0xce,0x55,0x28,0xdf
+DB	0x8c,0xa1,0x89,0x0d,0xbf,0xe6,0x42,0x68
+DB	0x41,0x99,0x2d,0x0f,0xb0,0x54,0xbb,0x16
+DB	0x63,0x7c,0x77,0x7b,0xf2,0x6b,0x6f,0xc5
+DB	0x30,0x01,0x67,0x2b,0xfe,0xd7,0xab,0x76
+DB	0xca,0x82,0xc9,0x7d,0xfa,0x59,0x47,0xf0
+DB	0xad,0xd4,0xa2,0xaf,0x9c,0xa4,0x72,0xc0
+DB	0xb7,0xfd,0x93,0x26,0x36,0x3f,0xf7,0xcc
+DB	0x34,0xa5,0xe5,0xf1,0x71,0xd8,0x31,0x15
+DB	0x04,0xc7,0x23,0xc3,0x18,0x96,0x05,0x9a
+DB	0x07,0x12,0x80,0xe2,0xeb,0x27,0xb2,0x75
+DB	0x09,0x83,0x2c,0x1a,0x1b,0x6e,0x5a,0xa0
+DB	0x52,0x3b,0xd6,0xb3,0x29,0xe3,0x2f,0x84
+DB	0x53,0xd1,0x00,0xed,0x20,0xfc,0xb1,0x5b
+DB	0x6a,0xcb,0xbe,0x39,0x4a,0x4c,0x58,0xcf
+DB	0xd0,0xef,0xaa,0xfb,0x43,0x4d,0x33,0x85
+DB	0x45,0xf9,0x02,0x7f,0x50,0x3c,0x9f,0xa8
+DB	0x51,0xa3,0x40,0x8f,0x92,0x9d,0x38,0xf5
+DB	0xbc,0xb6,0xda,0x21,0x10,0xff,0xf3,0xd2
+DB	0xcd,0x0c,0x13,0xec,0x5f,0x97,0x44,0x17
+DB	0xc4,0xa7,0x7e,0x3d,0x64,0x5d,0x19,0x73
+DB	0x60,0x81,0x4f,0xdc,0x22,0x2a,0x90,0x88
+DB	0x46,0xee,0xb8,0x14,0xde,0x5e,0x0b,0xdb
+DB	0xe0,0x32,0x3a,0x0a,0x49,0x06,0x24,0x5c
+DB	0xc2,0xd3,0xac,0x62,0x91,0x95,0xe4,0x79
+DB	0xe7,0xc8,0x37,0x6d,0x8d,0xd5,0x4e,0xa9
+DB	0x6c,0x56,0xf4,0xea,0x65,0x7a,0xae,0x08
+DB	0xba,0x78,0x25,0x2e,0x1c,0xa6,0xb4,0xc6
+DB	0xe8,0xdd,0x74,0x1f,0x4b,0xbd,0x8b,0x8a
+DB	0x70,0x3e,0xb5,0x66,0x48,0x03,0xf6,0x0e
+DB	0x61,0x35,0x57,0xb9,0x86,0xc1,0x1d,0x9e
+DB	0xe1,0xf8,0x98,0x11,0x69,0xd9,0x8e,0x94
+DB	0x9b,0x1e,0x87,0xe9,0xce,0x55,0x28,0xdf
+DB	0x8c,0xa1,0x89,0x0d,0xbf,0xe6,0x42,0x68
+DB	0x41,0x99,0x2d,0x0f,0xb0,0x54,0xbb,0x16
+DB	0x63,0x7c,0x77,0x7b,0xf2,0x6b,0x6f,0xc5
+DB	0x30,0x01,0x67,0x2b,0xfe,0xd7,0xab,0x76
+DB	0xca,0x82,0xc9,0x7d,0xfa,0x59,0x47,0xf0
+DB	0xad,0xd4,0xa2,0xaf,0x9c,0xa4,0x72,0xc0
+DB	0xb7,0xfd,0x93,0x26,0x36,0x3f,0xf7,0xcc
+DB	0x34,0xa5,0xe5,0xf1,0x71,0xd8,0x31,0x15
+DB	0x04,0xc7,0x23,0xc3,0x18,0x96,0x05,0x9a
+DB	0x07,0x12,0x80,0xe2,0xeb,0x27,0xb2,0x75
+DB	0x09,0x83,0x2c,0x1a,0x1b,0x6e,0x5a,0xa0
+DB	0x52,0x3b,0xd6,0xb3,0x29,0xe3,0x2f,0x84
+DB	0x53,0xd1,0x00,0xed,0x20,0xfc,0xb1,0x5b
+DB	0x6a,0xcb,0xbe,0x39,0x4a,0x4c,0x58,0xcf
+DB	0xd0,0xef,0xaa,0xfb,0x43,0x4d,0x33,0x85
+DB	0x45,0xf9,0x02,0x7f,0x50,0x3c,0x9f,0xa8
+DB	0x51,0xa3,0x40,0x8f,0x92,0x9d,0x38,0xf5
+DB	0xbc,0xb6,0xda,0x21,0x10,0xff,0xf3,0xd2
+DB	0xcd,0x0c,0x13,0xec,0x5f,0x97,0x44,0x17
+DB	0xc4,0xa7,0x7e,0x3d,0x64,0x5d,0x19,0x73
+DB	0x60,0x81,0x4f,0xdc,0x22,0x2a,0x90,0x88
+DB	0x46,0xee,0xb8,0x14,0xde,0x5e,0x0b,0xdb
+DB	0xe0,0x32,0x3a,0x0a,0x49,0x06,0x24,0x5c
+DB	0xc2,0xd3,0xac,0x62,0x91,0x95,0xe4,0x79
+DB	0xe7,0xc8,0x37,0x6d,0x8d,0xd5,0x4e,0xa9
+DB	0x6c,0x56,0xf4,0xea,0x65,0x7a,0xae,0x08
+DB	0xba,0x78,0x25,0x2e,0x1c,0xa6,0xb4,0xc6
+DB	0xe8,0xdd,0x74,0x1f,0x4b,0xbd,0x8b,0x8a
+DB	0x70,0x3e,0xb5,0x66,0x48,0x03,0xf6,0x0e
+DB	0x61,0x35,0x57,0xb9,0x86,0xc1,0x1d,0x9e
+DB	0xe1,0xf8,0x98,0x11,0x69,0xd9,0x8e,0x94
+DB	0x9b,0x1e,0x87,0xe9,0xce,0x55,0x28,0xdf
+DB	0x8c,0xa1,0x89,0x0d,0xbf,0xe6,0x42,0x68
+DB	0x41,0x99,0x2d,0x0f,0xb0,0x54,0xbb,0x16
+	DD	0x00000001,0x00000002,0x00000004,0x00000008
+	DD	0x00000010,0x00000020,0x00000040,0x00000080
+	DD	0x0000001b,0x00000036,0x80808080,0x80808080
+	DD	0xfefefefe,0xfefefefe,0x1b1b1b1b,0x1b1b1b1b
+ALIGN	64
+$L$AES_Td:
+	DD	0x50a7f451,0x50a7f451
+	DD	0x5365417e,0x5365417e
+	DD	0xc3a4171a,0xc3a4171a
+	DD	0x965e273a,0x965e273a
+	DD	0xcb6bab3b,0xcb6bab3b
+	DD	0xf1459d1f,0xf1459d1f
+	DD	0xab58faac,0xab58faac
+	DD	0x9303e34b,0x9303e34b
+	DD	0x55fa3020,0x55fa3020
+	DD	0xf66d76ad,0xf66d76ad
+	DD	0x9176cc88,0x9176cc88
+	DD	0x254c02f5,0x254c02f5
+	DD	0xfcd7e54f,0xfcd7e54f
+	DD	0xd7cb2ac5,0xd7cb2ac5
+	DD	0x80443526,0x80443526
+	DD	0x8fa362b5,0x8fa362b5
+	DD	0x495ab1de,0x495ab1de
+	DD	0x671bba25,0x671bba25
+	DD	0x980eea45,0x980eea45
+	DD	0xe1c0fe5d,0xe1c0fe5d
+	DD	0x02752fc3,0x02752fc3
+	DD	0x12f04c81,0x12f04c81
+	DD	0xa397468d,0xa397468d
+	DD	0xc6f9d36b,0xc6f9d36b
+	DD	0xe75f8f03,0xe75f8f03
+	DD	0x959c9215,0x959c9215
+	DD	0xeb7a6dbf,0xeb7a6dbf
+	DD	0xda595295,0xda595295
+	DD	0x2d83bed4,0x2d83bed4
+	DD	0xd3217458,0xd3217458
+	DD	0x2969e049,0x2969e049
+	DD	0x44c8c98e,0x44c8c98e
+	DD	0x6a89c275,0x6a89c275
+	DD	0x78798ef4,0x78798ef4
+	DD	0x6b3e5899,0x6b3e5899
+	DD	0xdd71b927,0xdd71b927
+	DD	0xb64fe1be,0xb64fe1be
+	DD	0x17ad88f0,0x17ad88f0
+	DD	0x66ac20c9,0x66ac20c9
+	DD	0xb43ace7d,0xb43ace7d
+	DD	0x184adf63,0x184adf63
+	DD	0x82311ae5,0x82311ae5
+	DD	0x60335197,0x60335197
+	DD	0x457f5362,0x457f5362
+	DD	0xe07764b1,0xe07764b1
+	DD	0x84ae6bbb,0x84ae6bbb
+	DD	0x1ca081fe,0x1ca081fe
+	DD	0x942b08f9,0x942b08f9
+	DD	0x58684870,0x58684870
+	DD	0x19fd458f,0x19fd458f
+	DD	0x876cde94,0x876cde94
+	DD	0xb7f87b52,0xb7f87b52
+	DD	0x23d373ab,0x23d373ab
+	DD	0xe2024b72,0xe2024b72
+	DD	0x578f1fe3,0x578f1fe3
+	DD	0x2aab5566,0x2aab5566
+	DD	0x0728ebb2,0x0728ebb2
+	DD	0x03c2b52f,0x03c2b52f
+	DD	0x9a7bc586,0x9a7bc586
+	DD	0xa50837d3,0xa50837d3
+	DD	0xf2872830,0xf2872830
+	DD	0xb2a5bf23,0xb2a5bf23
+	DD	0xba6a0302,0xba6a0302
+	DD	0x5c8216ed,0x5c8216ed
+	DD	0x2b1ccf8a,0x2b1ccf8a
+	DD	0x92b479a7,0x92b479a7
+	DD	0xf0f207f3,0xf0f207f3
+	DD	0xa1e2694e,0xa1e2694e
+	DD	0xcdf4da65,0xcdf4da65
+	DD	0xd5be0506,0xd5be0506
+	DD	0x1f6234d1,0x1f6234d1
+	DD	0x8afea6c4,0x8afea6c4
+	DD	0x9d532e34,0x9d532e34
+	DD	0xa055f3a2,0xa055f3a2
+	DD	0x32e18a05,0x32e18a05
+	DD	0x75ebf6a4,0x75ebf6a4
+	DD	0x39ec830b,0x39ec830b
+	DD	0xaaef6040,0xaaef6040
+	DD	0x069f715e,0x069f715e
+	DD	0x51106ebd,0x51106ebd
+	DD	0xf98a213e,0xf98a213e
+	DD	0x3d06dd96,0x3d06dd96
+	DD	0xae053edd,0xae053edd
+	DD	0x46bde64d,0x46bde64d
+	DD	0xb58d5491,0xb58d5491
+	DD	0x055dc471,0x055dc471
+	DD	0x6fd40604,0x6fd40604
+	DD	0xff155060,0xff155060
+	DD	0x24fb9819,0x24fb9819
+	DD	0x97e9bdd6,0x97e9bdd6
+	DD	0xcc434089,0xcc434089
+	DD	0x779ed967,0x779ed967
+	DD	0xbd42e8b0,0xbd42e8b0
+	DD	0x888b8907,0x888b8907
+	DD	0x385b19e7,0x385b19e7
+	DD	0xdbeec879,0xdbeec879
+	DD	0x470a7ca1,0x470a7ca1
+	DD	0xe90f427c,0xe90f427c
+	DD	0xc91e84f8,0xc91e84f8
+	DD	0x00000000,0x00000000
+	DD	0x83868009,0x83868009
+	DD	0x48ed2b32,0x48ed2b32
+	DD	0xac70111e,0xac70111e
+	DD	0x4e725a6c,0x4e725a6c
+	DD	0xfbff0efd,0xfbff0efd
+	DD	0x5638850f,0x5638850f
+	DD	0x1ed5ae3d,0x1ed5ae3d
+	DD	0x27392d36,0x27392d36
+	DD	0x64d90f0a,0x64d90f0a
+	DD	0x21a65c68,0x21a65c68
+	DD	0xd1545b9b,0xd1545b9b
+	DD	0x3a2e3624,0x3a2e3624
+	DD	0xb1670a0c,0xb1670a0c
+	DD	0x0fe75793,0x0fe75793
+	DD	0xd296eeb4,0xd296eeb4
+	DD	0x9e919b1b,0x9e919b1b
+	DD	0x4fc5c080,0x4fc5c080
+	DD	0xa220dc61,0xa220dc61
+	DD	0x694b775a,0x694b775a
+	DD	0x161a121c,0x161a121c
+	DD	0x0aba93e2,0x0aba93e2
+	DD	0xe52aa0c0,0xe52aa0c0
+	DD	0x43e0223c,0x43e0223c
+	DD	0x1d171b12,0x1d171b12
+	DD	0x0b0d090e,0x0b0d090e
+	DD	0xadc78bf2,0xadc78bf2
+	DD	0xb9a8b62d,0xb9a8b62d
+	DD	0xc8a91e14,0xc8a91e14
+	DD	0x8519f157,0x8519f157
+	DD	0x4c0775af,0x4c0775af
+	DD	0xbbdd99ee,0xbbdd99ee
+	DD	0xfd607fa3,0xfd607fa3
+	DD	0x9f2601f7,0x9f2601f7
+	DD	0xbcf5725c,0xbcf5725c
+	DD	0xc53b6644,0xc53b6644
+	DD	0x347efb5b,0x347efb5b
+	DD	0x7629438b,0x7629438b
+	DD	0xdcc623cb,0xdcc623cb
+	DD	0x68fcedb6,0x68fcedb6
+	DD	0x63f1e4b8,0x63f1e4b8
+	DD	0xcadc31d7,0xcadc31d7
+	DD	0x10856342,0x10856342
+	DD	0x40229713,0x40229713
+	DD	0x2011c684,0x2011c684
+	DD	0x7d244a85,0x7d244a85
+	DD	0xf83dbbd2,0xf83dbbd2
+	DD	0x1132f9ae,0x1132f9ae
+	DD	0x6da129c7,0x6da129c7
+	DD	0x4b2f9e1d,0x4b2f9e1d
+	DD	0xf330b2dc,0xf330b2dc
+	DD	0xec52860d,0xec52860d
+	DD	0xd0e3c177,0xd0e3c177
+	DD	0x6c16b32b,0x6c16b32b
+	DD	0x99b970a9,0x99b970a9
+	DD	0xfa489411,0xfa489411
+	DD	0x2264e947,0x2264e947
+	DD	0xc48cfca8,0xc48cfca8
+	DD	0x1a3ff0a0,0x1a3ff0a0
+	DD	0xd82c7d56,0xd82c7d56
+	DD	0xef903322,0xef903322
+	DD	0xc74e4987,0xc74e4987
+	DD	0xc1d138d9,0xc1d138d9
+	DD	0xfea2ca8c,0xfea2ca8c
+	DD	0x360bd498,0x360bd498
+	DD	0xcf81f5a6,0xcf81f5a6
+	DD	0x28de7aa5,0x28de7aa5
+	DD	0x268eb7da,0x268eb7da
+	DD	0xa4bfad3f,0xa4bfad3f
+	DD	0xe49d3a2c,0xe49d3a2c
+	DD	0x0d927850,0x0d927850
+	DD	0x9bcc5f6a,0x9bcc5f6a
+	DD	0x62467e54,0x62467e54
+	DD	0xc2138df6,0xc2138df6
+	DD	0xe8b8d890,0xe8b8d890
+	DD	0x5ef7392e,0x5ef7392e
+	DD	0xf5afc382,0xf5afc382
+	DD	0xbe805d9f,0xbe805d9f
+	DD	0x7c93d069,0x7c93d069
+	DD	0xa92dd56f,0xa92dd56f
+	DD	0xb31225cf,0xb31225cf
+	DD	0x3b99acc8,0x3b99acc8
+	DD	0xa77d1810,0xa77d1810
+	DD	0x6e639ce8,0x6e639ce8
+	DD	0x7bbb3bdb,0x7bbb3bdb
+	DD	0x097826cd,0x097826cd
+	DD	0xf418596e,0xf418596e
+	DD	0x01b79aec,0x01b79aec
+	DD	0xa89a4f83,0xa89a4f83
+	DD	0x656e95e6,0x656e95e6
+	DD	0x7ee6ffaa,0x7ee6ffaa
+	DD	0x08cfbc21,0x08cfbc21
+	DD	0xe6e815ef,0xe6e815ef
+	DD	0xd99be7ba,0xd99be7ba
+	DD	0xce366f4a,0xce366f4a
+	DD	0xd4099fea,0xd4099fea
+	DD	0xd67cb029,0xd67cb029
+	DD	0xafb2a431,0xafb2a431
+	DD	0x31233f2a,0x31233f2a
+	DD	0x3094a5c6,0x3094a5c6
+	DD	0xc066a235,0xc066a235
+	DD	0x37bc4e74,0x37bc4e74
+	DD	0xa6ca82fc,0xa6ca82fc
+	DD	0xb0d090e0,0xb0d090e0
+	DD	0x15d8a733,0x15d8a733
+	DD	0x4a9804f1,0x4a9804f1
+	DD	0xf7daec41,0xf7daec41
+	DD	0x0e50cd7f,0x0e50cd7f
+	DD	0x2ff69117,0x2ff69117
+	DD	0x8dd64d76,0x8dd64d76
+	DD	0x4db0ef43,0x4db0ef43
+	DD	0x544daacc,0x544daacc
+	DD	0xdf0496e4,0xdf0496e4
+	DD	0xe3b5d19e,0xe3b5d19e
+	DD	0x1b886a4c,0x1b886a4c
+	DD	0xb81f2cc1,0xb81f2cc1
+	DD	0x7f516546,0x7f516546
+	DD	0x04ea5e9d,0x04ea5e9d
+	DD	0x5d358c01,0x5d358c01
+	DD	0x737487fa,0x737487fa
+	DD	0x2e410bfb,0x2e410bfb
+	DD	0x5a1d67b3,0x5a1d67b3
+	DD	0x52d2db92,0x52d2db92
+	DD	0x335610e9,0x335610e9
+	DD	0x1347d66d,0x1347d66d
+	DD	0x8c61d79a,0x8c61d79a
+	DD	0x7a0ca137,0x7a0ca137
+	DD	0x8e14f859,0x8e14f859
+	DD	0x893c13eb,0x893c13eb
+	DD	0xee27a9ce,0xee27a9ce
+	DD	0x35c961b7,0x35c961b7
+	DD	0xede51ce1,0xede51ce1
+	DD	0x3cb1477a,0x3cb1477a
+	DD	0x59dfd29c,0x59dfd29c
+	DD	0x3f73f255,0x3f73f255
+	DD	0x79ce1418,0x79ce1418
+	DD	0xbf37c773,0xbf37c773
+	DD	0xeacdf753,0xeacdf753
+	DD	0x5baafd5f,0x5baafd5f
+	DD	0x146f3ddf,0x146f3ddf
+	DD	0x86db4478,0x86db4478
+	DD	0x81f3afca,0x81f3afca
+	DD	0x3ec468b9,0x3ec468b9
+	DD	0x2c342438,0x2c342438
+	DD	0x5f40a3c2,0x5f40a3c2
+	DD	0x72c31d16,0x72c31d16
+	DD	0x0c25e2bc,0x0c25e2bc
+	DD	0x8b493c28,0x8b493c28
+	DD	0x41950dff,0x41950dff
+	DD	0x7101a839,0x7101a839
+	DD	0xdeb30c08,0xdeb30c08
+	DD	0x9ce4b4d8,0x9ce4b4d8
+	DD	0x90c15664,0x90c15664
+	DD	0x6184cb7b,0x6184cb7b
+	DD	0x70b632d5,0x70b632d5
+	DD	0x745c6c48,0x745c6c48
+	DD	0x4257b8d0,0x4257b8d0
+DB	0x52,0x09,0x6a,0xd5,0x30,0x36,0xa5,0x38
+DB	0xbf,0x40,0xa3,0x9e,0x81,0xf3,0xd7,0xfb
+DB	0x7c,0xe3,0x39,0x82,0x9b,0x2f,0xff,0x87
+DB	0x34,0x8e,0x43,0x44,0xc4,0xde,0xe9,0xcb
+DB	0x54,0x7b,0x94,0x32,0xa6,0xc2,0x23,0x3d
+DB	0xee,0x4c,0x95,0x0b,0x42,0xfa,0xc3,0x4e
+DB	0x08,0x2e,0xa1,0x66,0x28,0xd9,0x24,0xb2
+DB	0x76,0x5b,0xa2,0x49,0x6d,0x8b,0xd1,0x25
+DB	0x72,0xf8,0xf6,0x64,0x86,0x68,0x98,0x16
+DB	0xd4,0xa4,0x5c,0xcc,0x5d,0x65,0xb6,0x92
+DB	0x6c,0x70,0x48,0x50,0xfd,0xed,0xb9,0xda
+DB	0x5e,0x15,0x46,0x57,0xa7,0x8d,0x9d,0x84
+DB	0x90,0xd8,0xab,0x00,0x8c,0xbc,0xd3,0x0a
+DB	0xf7,0xe4,0x58,0x05,0xb8,0xb3,0x45,0x06
+DB	0xd0,0x2c,0x1e,0x8f,0xca,0x3f,0x0f,0x02
+DB	0xc1,0xaf,0xbd,0x03,0x01,0x13,0x8a,0x6b
+DB	0x3a,0x91,0x11,0x41,0x4f,0x67,0xdc,0xea
+DB	0x97,0xf2,0xcf,0xce,0xf0,0xb4,0xe6,0x73
+DB	0x96,0xac,0x74,0x22,0xe7,0xad,0x35,0x85
+DB	0xe2,0xf9,0x37,0xe8,0x1c,0x75,0xdf,0x6e
+DB	0x47,0xf1,0x1a,0x71,0x1d,0x29,0xc5,0x89
+DB	0x6f,0xb7,0x62,0x0e,0xaa,0x18,0xbe,0x1b
+DB	0xfc,0x56,0x3e,0x4b,0xc6,0xd2,0x79,0x20
+DB	0x9a,0xdb,0xc0,0xfe,0x78,0xcd,0x5a,0xf4
+DB	0x1f,0xdd,0xa8,0x33,0x88,0x07,0xc7,0x31
+DB	0xb1,0x12,0x10,0x59,0x27,0x80,0xec,0x5f
+DB	0x60,0x51,0x7f,0xa9,0x19,0xb5,0x4a,0x0d
+DB	0x2d,0xe5,0x7a,0x9f,0x93,0xc9,0x9c,0xef
+DB	0xa0,0xe0,0x3b,0x4d,0xae,0x2a,0xf5,0xb0
+DB	0xc8,0xeb,0xbb,0x3c,0x83,0x53,0x99,0x61
+DB	0x17,0x2b,0x04,0x7e,0xba,0x77,0xd6,0x26
+DB	0xe1,0x69,0x14,0x63,0x55,0x21,0x0c,0x7d
+	DD	0x80808080,0x80808080,0xfefefefe,0xfefefefe
+	DD	0x1b1b1b1b,0x1b1b1b1b,0,0
+DB	0x52,0x09,0x6a,0xd5,0x30,0x36,0xa5,0x38
+DB	0xbf,0x40,0xa3,0x9e,0x81,0xf3,0xd7,0xfb
+DB	0x7c,0xe3,0x39,0x82,0x9b,0x2f,0xff,0x87
+DB	0x34,0x8e,0x43,0x44,0xc4,0xde,0xe9,0xcb
+DB	0x54,0x7b,0x94,0x32,0xa6,0xc2,0x23,0x3d
+DB	0xee,0x4c,0x95,0x0b,0x42,0xfa,0xc3,0x4e
+DB	0x08,0x2e,0xa1,0x66,0x28,0xd9,0x24,0xb2
+DB	0x76,0x5b,0xa2,0x49,0x6d,0x8b,0xd1,0x25
+DB	0x72,0xf8,0xf6,0x64,0x86,0x68,0x98,0x16
+DB	0xd4,0xa4,0x5c,0xcc,0x5d,0x65,0xb6,0x92
+DB	0x6c,0x70,0x48,0x50,0xfd,0xed,0xb9,0xda
+DB	0x5e,0x15,0x46,0x57,0xa7,0x8d,0x9d,0x84
+DB	0x90,0xd8,0xab,0x00,0x8c,0xbc,0xd3,0x0a
+DB	0xf7,0xe4,0x58,0x05,0xb8,0xb3,0x45,0x06
+DB	0xd0,0x2c,0x1e,0x8f,0xca,0x3f,0x0f,0x02
+DB	0xc1,0xaf,0xbd,0x03,0x01,0x13,0x8a,0x6b
+DB	0x3a,0x91,0x11,0x41,0x4f,0x67,0xdc,0xea
+DB	0x97,0xf2,0xcf,0xce,0xf0,0xb4,0xe6,0x73
+DB	0x96,0xac,0x74,0x22,0xe7,0xad,0x35,0x85
+DB	0xe2,0xf9,0x37,0xe8,0x1c,0x75,0xdf,0x6e
+DB	0x47,0xf1,0x1a,0x71,0x1d,0x29,0xc5,0x89
+DB	0x6f,0xb7,0x62,0x0e,0xaa,0x18,0xbe,0x1b
+DB	0xfc,0x56,0x3e,0x4b,0xc6,0xd2,0x79,0x20
+DB	0x9a,0xdb,0xc0,0xfe,0x78,0xcd,0x5a,0xf4
+DB	0x1f,0xdd,0xa8,0x33,0x88,0x07,0xc7,0x31
+DB	0xb1,0x12,0x10,0x59,0x27,0x80,0xec,0x5f
+DB	0x60,0x51,0x7f,0xa9,0x19,0xb5,0x4a,0x0d
+DB	0x2d,0xe5,0x7a,0x9f,0x93,0xc9,0x9c,0xef
+DB	0xa0,0xe0,0x3b,0x4d,0xae,0x2a,0xf5,0xb0
+DB	0xc8,0xeb,0xbb,0x3c,0x83,0x53,0x99,0x61
+DB	0x17,0x2b,0x04,0x7e,0xba,0x77,0xd6,0x26
+DB	0xe1,0x69,0x14,0x63,0x55,0x21,0x0c,0x7d
+	DD	0x80808080,0x80808080,0xfefefefe,0xfefefefe
+	DD	0x1b1b1b1b,0x1b1b1b1b,0,0
+DB	0x52,0x09,0x6a,0xd5,0x30,0x36,0xa5,0x38
+DB	0xbf,0x40,0xa3,0x9e,0x81,0xf3,0xd7,0xfb
+DB	0x7c,0xe3,0x39,0x82,0x9b,0x2f,0xff,0x87
+DB	0x34,0x8e,0x43,0x44,0xc4,0xde,0xe9,0xcb
+DB	0x54,0x7b,0x94,0x32,0xa6,0xc2,0x23,0x3d
+DB	0xee,0x4c,0x95,0x0b,0x42,0xfa,0xc3,0x4e
+DB	0x08,0x2e,0xa1,0x66,0x28,0xd9,0x24,0xb2
+DB	0x76,0x5b,0xa2,0x49,0x6d,0x8b,0xd1,0x25
+DB	0x72,0xf8,0xf6,0x64,0x86,0x68,0x98,0x16
+DB	0xd4,0xa4,0x5c,0xcc,0x5d,0x65,0xb6,0x92
+DB	0x6c,0x70,0x48,0x50,0xfd,0xed,0xb9,0xda
+DB	0x5e,0x15,0x46,0x57,0xa7,0x8d,0x9d,0x84
+DB	0x90,0xd8,0xab,0x00,0x8c,0xbc,0xd3,0x0a
+DB	0xf7,0xe4,0x58,0x05,0xb8,0xb3,0x45,0x06
+DB	0xd0,0x2c,0x1e,0x8f,0xca,0x3f,0x0f,0x02
+DB	0xc1,0xaf,0xbd,0x03,0x01,0x13,0x8a,0x6b
+DB	0x3a,0x91,0x11,0x41,0x4f,0x67,0xdc,0xea
+DB	0x97,0xf2,0xcf,0xce,0xf0,0xb4,0xe6,0x73
+DB	0x96,0xac,0x74,0x22,0xe7,0xad,0x35,0x85
+DB	0xe2,0xf9,0x37,0xe8,0x1c,0x75,0xdf,0x6e
+DB	0x47,0xf1,0x1a,0x71,0x1d,0x29,0xc5,0x89
+DB	0x6f,0xb7,0x62,0x0e,0xaa,0x18,0xbe,0x1b
+DB	0xfc,0x56,0x3e,0x4b,0xc6,0xd2,0x79,0x20
+DB	0x9a,0xdb,0xc0,0xfe,0x78,0xcd,0x5a,0xf4
+DB	0x1f,0xdd,0xa8,0x33,0x88,0x07,0xc7,0x31
+DB	0xb1,0x12,0x10,0x59,0x27,0x80,0xec,0x5f
+DB	0x60,0x51,0x7f,0xa9,0x19,0xb5,0x4a,0x0d
+DB	0x2d,0xe5,0x7a,0x9f,0x93,0xc9,0x9c,0xef
+DB	0xa0,0xe0,0x3b,0x4d,0xae,0x2a,0xf5,0xb0
+DB	0xc8,0xeb,0xbb,0x3c,0x83,0x53,0x99,0x61
+DB	0x17,0x2b,0x04,0x7e,0xba,0x77,0xd6,0x26
+DB	0xe1,0x69,0x14,0x63,0x55,0x21,0x0c,0x7d
+	DD	0x80808080,0x80808080,0xfefefefe,0xfefefefe
+	DD	0x1b1b1b1b,0x1b1b1b1b,0,0
+DB	0x52,0x09,0x6a,0xd5,0x30,0x36,0xa5,0x38
+DB	0xbf,0x40,0xa3,0x9e,0x81,0xf3,0xd7,0xfb
+DB	0x7c,0xe3,0x39,0x82,0x9b,0x2f,0xff,0x87
+DB	0x34,0x8e,0x43,0x44,0xc4,0xde,0xe9,0xcb
+DB	0x54,0x7b,0x94,0x32,0xa6,0xc2,0x23,0x3d
+DB	0xee,0x4c,0x95,0x0b,0x42,0xfa,0xc3,0x4e
+DB	0x08,0x2e,0xa1,0x66,0x28,0xd9,0x24,0xb2
+DB	0x76,0x5b,0xa2,0x49,0x6d,0x8b,0xd1,0x25
+DB	0x72,0xf8,0xf6,0x64,0x86,0x68,0x98,0x16
+DB	0xd4,0xa4,0x5c,0xcc,0x5d,0x65,0xb6,0x92
+DB	0x6c,0x70,0x48,0x50,0xfd,0xed,0xb9,0xda
+DB	0x5e,0x15,0x46,0x57,0xa7,0x8d,0x9d,0x84
+DB	0x90,0xd8,0xab,0x00,0x8c,0xbc,0xd3,0x0a
+DB	0xf7,0xe4,0x58,0x05,0xb8,0xb3,0x45,0x06
+DB	0xd0,0x2c,0x1e,0x8f,0xca,0x3f,0x0f,0x02
+DB	0xc1,0xaf,0xbd,0x03,0x01,0x13,0x8a,0x6b
+DB	0x3a,0x91,0x11,0x41,0x4f,0x67,0xdc,0xea
+DB	0x97,0xf2,0xcf,0xce,0xf0,0xb4,0xe6,0x73
+DB	0x96,0xac,0x74,0x22,0xe7,0xad,0x35,0x85
+DB	0xe2,0xf9,0x37,0xe8,0x1c,0x75,0xdf,0x6e
+DB	0x47,0xf1,0x1a,0x71,0x1d,0x29,0xc5,0x89
+DB	0x6f,0xb7,0x62,0x0e,0xaa,0x18,0xbe,0x1b
+DB	0xfc,0x56,0x3e,0x4b,0xc6,0xd2,0x79,0x20
+DB	0x9a,0xdb,0xc0,0xfe,0x78,0xcd,0x5a,0xf4
+DB	0x1f,0xdd,0xa8,0x33,0x88,0x07,0xc7,0x31
+DB	0xb1,0x12,0x10,0x59,0x27,0x80,0xec,0x5f
+DB	0x60,0x51,0x7f,0xa9,0x19,0xb5,0x4a,0x0d
+DB	0x2d,0xe5,0x7a,0x9f,0x93,0xc9,0x9c,0xef
+DB	0xa0,0xe0,0x3b,0x4d,0xae,0x2a,0xf5,0xb0
+DB	0xc8,0xeb,0xbb,0x3c,0x83,0x53,0x99,0x61
+DB	0x17,0x2b,0x04,0x7e,0xba,0x77,0xd6,0x26
+DB	0xe1,0x69,0x14,0x63,0x55,0x21,0x0c,0x7d
+	DD	0x80808080,0x80808080,0xfefefefe,0xfefefefe
+	DD	0x1b1b1b1b,0x1b1b1b1b,0,0
+DB	65,69,83,32,102,111,114,32,120,56,54,95,54,52,44,32
+DB	67,82,89,80,84,79,71,65,77,83,32,98,121,32,60,97
+DB	112,112,114,111,64,111,112,101,110,115,115,108,46,111,114,103
+DB	62,0
+ALIGN	64
+EXTERN	__imp_RtlVirtualUnwind
+
+ALIGN	16
+block_se_handler:
+	push	rsi
+	push	rdi
+	push	rbx
+	push	rbp
+	push	r12
+	push	r13
+	push	r14
+	push	r15
+	pushfq
+	sub	rsp,64
+
+	mov	rax,QWORD[120+r8]
+	mov	rbx,QWORD[248+r8]
+
+	mov	rsi,QWORD[8+r9]
+	mov	r11,QWORD[56+r9]
+
+	mov	r10d,DWORD[r11]
+	lea	r10,[r10*1+rsi]
+	cmp	rbx,r10
+	jb	NEAR $L$in_block_prologue
+
+	mov	rax,QWORD[152+r8]
+
+	mov	r10d,DWORD[4+r11]
+	lea	r10,[r10*1+rsi]
+	cmp	rbx,r10
+	jae	NEAR $L$in_block_prologue
+
+	mov	rax,QWORD[24+rax]
+	lea	rax,[48+rax]
+
+	mov	rbx,QWORD[((-8))+rax]
+	mov	rbp,QWORD[((-16))+rax]
+	mov	r12,QWORD[((-24))+rax]
+	mov	r13,QWORD[((-32))+rax]
+	mov	r14,QWORD[((-40))+rax]
+	mov	r15,QWORD[((-48))+rax]
+	mov	QWORD[144+r8],rbx
+	mov	QWORD[160+r8],rbp
+	mov	QWORD[216+r8],r12
+	mov	QWORD[224+r8],r13
+	mov	QWORD[232+r8],r14
+	mov	QWORD[240+r8],r15
+
+$L$in_block_prologue:
+	mov	rdi,QWORD[8+rax]
+	mov	rsi,QWORD[16+rax]
+	mov	QWORD[152+r8],rax
+	mov	QWORD[168+r8],rsi
+	mov	QWORD[176+r8],rdi
+
+	jmp	NEAR $L$common_seh_exit
+
+
+
+ALIGN	16
+key_se_handler:
+	push	rsi
+	push	rdi
+	push	rbx
+	push	rbp
+	push	r12
+	push	r13
+	push	r14
+	push	r15
+	pushfq
+	sub	rsp,64
+
+	mov	rax,QWORD[120+r8]
+	mov	rbx,QWORD[248+r8]
+
+	mov	rsi,QWORD[8+r9]
+	mov	r11,QWORD[56+r9]
+
+	mov	r10d,DWORD[r11]
+	lea	r10,[r10*1+rsi]
+	cmp	rbx,r10
+	jb	NEAR $L$in_key_prologue
+
+	mov	rax,QWORD[152+r8]
+
+	mov	r10d,DWORD[4+r11]
+	lea	r10,[r10*1+rsi]
+	cmp	rbx,r10
+	jae	NEAR $L$in_key_prologue
+
+	lea	rax,[56+rax]
+
+	mov	rbx,QWORD[((-8))+rax]
+	mov	rbp,QWORD[((-16))+rax]
+	mov	r12,QWORD[((-24))+rax]
+	mov	r13,QWORD[((-32))+rax]
+	mov	r14,QWORD[((-40))+rax]
+	mov	r15,QWORD[((-48))+rax]
+	mov	QWORD[144+r8],rbx
+	mov	QWORD[160+r8],rbp
+	mov	QWORD[216+r8],r12
+	mov	QWORD[224+r8],r13
+	mov	QWORD[232+r8],r14
+	mov	QWORD[240+r8],r15
+
+$L$in_key_prologue:
+	mov	rdi,QWORD[8+rax]
+	mov	rsi,QWORD[16+rax]
+	mov	QWORD[152+r8],rax
+	mov	QWORD[168+r8],rsi
+	mov	QWORD[176+r8],rdi
+
+	jmp	NEAR $L$common_seh_exit
+
+
+
+ALIGN	16
+cbc_se_handler:
+	push	rsi
+	push	rdi
+	push	rbx
+	push	rbp
+	push	r12
+	push	r13
+	push	r14
+	push	r15
+	pushfq
+	sub	rsp,64
+
+	mov	rax,QWORD[120+r8]
+	mov	rbx,QWORD[248+r8]
+
+	lea	r10,[$L$cbc_prologue]
+	cmp	rbx,r10
+	jb	NEAR $L$in_cbc_prologue
+
+	lea	r10,[$L$cbc_fast_body]
+	cmp	rbx,r10
+	jb	NEAR $L$in_cbc_frame_setup
+
+	lea	r10,[$L$cbc_slow_prologue]
+	cmp	rbx,r10
+	jb	NEAR $L$in_cbc_body
+
+	lea	r10,[$L$cbc_slow_body]
+	cmp	rbx,r10
+	jb	NEAR $L$in_cbc_frame_setup
+
+$L$in_cbc_body:
+	mov	rax,QWORD[152+r8]
+
+	lea	r10,[$L$cbc_epilogue]
+	cmp	rbx,r10
+	jae	NEAR $L$in_cbc_prologue
+
+	lea	rax,[8+rax]
+
+	lea	r10,[$L$cbc_popfq]
+	cmp	rbx,r10
+	jae	NEAR $L$in_cbc_prologue
+
+	mov	rax,QWORD[8+rax]
+	lea	rax,[56+rax]
+
+$L$in_cbc_frame_setup:
+	mov	rbx,QWORD[((-16))+rax]
+	mov	rbp,QWORD[((-24))+rax]
+	mov	r12,QWORD[((-32))+rax]
+	mov	r13,QWORD[((-40))+rax]
+	mov	r14,QWORD[((-48))+rax]
+	mov	r15,QWORD[((-56))+rax]
+	mov	QWORD[144+r8],rbx
+	mov	QWORD[160+r8],rbp
+	mov	QWORD[216+r8],r12
+	mov	QWORD[224+r8],r13
+	mov	QWORD[232+r8],r14
+	mov	QWORD[240+r8],r15
+
+$L$in_cbc_prologue:
+	mov	rdi,QWORD[8+rax]
+	mov	rsi,QWORD[16+rax]
+	mov	QWORD[152+r8],rax
+	mov	QWORD[168+r8],rsi
+	mov	QWORD[176+r8],rdi
+
+$L$common_seh_exit:
+
+	mov	rdi,QWORD[40+r9]
+	mov	rsi,r8
+	mov	ecx,154
+	DD	0xa548f3fc
+
+	mov	rsi,r9
+	xor	rcx,rcx
+	mov	rdx,QWORD[8+rsi]
+	mov	r8,QWORD[rsi]
+	mov	r9,QWORD[16+rsi]
+	mov	r10,QWORD[40+rsi]
+	lea	r11,[56+rsi]
+	lea	r12,[24+rsi]
+	mov	QWORD[32+rsp],r10
+	mov	QWORD[40+rsp],r11
+	mov	QWORD[48+rsp],r12
+	mov	QWORD[56+rsp],rcx
+	call	QWORD[__imp_RtlVirtualUnwind]
+
+	mov	eax,1
+	add	rsp,64
+	popfq
+	pop	r15
+	pop	r14
+	pop	r13
+	pop	r12
+	pop	rbp
+	pop	rbx
+	pop	rdi
+	pop	rsi
+	DB	0F3h,0C3h		;repret
+
+
+section	.pdata rdata align=4
+ALIGN	4
+	DD	$L$SEH_begin_asm_AES_encrypt wrt ..imagebase
+	DD	$L$SEH_end_asm_AES_encrypt wrt ..imagebase
+	DD	$L$SEH_info_asm_AES_encrypt wrt ..imagebase
+
+	DD	$L$SEH_begin_asm_AES_decrypt wrt ..imagebase
+	DD	$L$SEH_end_asm_AES_decrypt wrt ..imagebase
+	DD	$L$SEH_info_asm_AES_decrypt wrt ..imagebase
+
+	DD	$L$SEH_begin_asm_AES_set_encrypt_key wrt ..imagebase
+	DD	$L$SEH_end_asm_AES_set_encrypt_key wrt ..imagebase
+	DD	$L$SEH_info_asm_AES_set_encrypt_key wrt ..imagebase
+
+	DD	$L$SEH_begin_asm_AES_set_decrypt_key wrt ..imagebase
+	DD	$L$SEH_end_asm_AES_set_decrypt_key wrt ..imagebase
+	DD	$L$SEH_info_asm_AES_set_decrypt_key wrt ..imagebase
+
+	DD	$L$SEH_begin_asm_AES_cbc_encrypt wrt ..imagebase
+	DD	$L$SEH_end_asm_AES_cbc_encrypt wrt ..imagebase
+	DD	$L$SEH_info_asm_AES_cbc_encrypt wrt ..imagebase
+
+section	.xdata rdata align=8
+ALIGN	8
+$L$SEH_info_asm_AES_encrypt:
+DB	9,0,0,0
+	DD	block_se_handler wrt ..imagebase
+	DD	$L$enc_prologue wrt ..imagebase,$L$enc_epilogue wrt ..imagebase
+$L$SEH_info_asm_AES_decrypt:
+DB	9,0,0,0
+	DD	block_se_handler wrt ..imagebase
+	DD	$L$dec_prologue wrt ..imagebase,$L$dec_epilogue wrt ..imagebase
+$L$SEH_info_asm_AES_set_encrypt_key:
+DB	9,0,0,0
+	DD	key_se_handler wrt ..imagebase
+	DD	$L$enc_key_prologue wrt ..imagebase,$L$enc_key_epilogue wrt ..imagebase
+$L$SEH_info_asm_AES_set_decrypt_key:
+DB	9,0,0,0
+	DD	key_se_handler wrt ..imagebase
+	DD	$L$dec_key_prologue wrt ..imagebase,$L$dec_key_epilogue wrt ..imagebase
+$L$SEH_info_asm_AES_cbc_encrypt:
+DB	9,0,0,0
+	DD	cbc_se_handler wrt ..imagebase
diff --git a/third_party/boringssl/win-x86_64/crypto/aes/aesni-x86_64.asm b/third_party/boringssl/win-x86_64/crypto/aes/aesni-x86_64.asm
new file mode 100644
index 0000000..cf313d1
--- /dev/null
+++ b/third_party/boringssl/win-x86_64/crypto/aes/aesni-x86_64.asm
@@ -0,0 +1,4027 @@
+default	rel
+%define XMMWORD
+%define YMMWORD
+%define ZMMWORD
+section	.text code align=64
+
+EXTERN	OPENSSL_ia32cap_P
+global	aesni_encrypt
+
+ALIGN	16
+aesni_encrypt:
+	movups	xmm2,XMMWORD[rcx]
+	mov	eax,DWORD[240+r8]
+	movups	xmm0,XMMWORD[r8]
+	movups	xmm1,XMMWORD[16+r8]
+	lea	r8,[32+r8]
+	xorps	xmm2,xmm0
+$L$oop_enc1_1:
+DB	102,15,56,220,209
+	dec	eax
+	movups	xmm1,XMMWORD[r8]
+	lea	r8,[16+r8]
+	jnz	NEAR $L$oop_enc1_1
+DB	102,15,56,221,209
+	pxor	xmm0,xmm0
+	pxor	xmm1,xmm1
+	movups	XMMWORD[rdx],xmm2
+	pxor	xmm2,xmm2
+	DB	0F3h,0C3h		;repret
+
+
+global	aesni_decrypt
+
+ALIGN	16
+aesni_decrypt:
+	movups	xmm2,XMMWORD[rcx]
+	mov	eax,DWORD[240+r8]
+	movups	xmm0,XMMWORD[r8]
+	movups	xmm1,XMMWORD[16+r8]
+	lea	r8,[32+r8]
+	xorps	xmm2,xmm0
+$L$oop_dec1_2:
+DB	102,15,56,222,209
+	dec	eax
+	movups	xmm1,XMMWORD[r8]
+	lea	r8,[16+r8]
+	jnz	NEAR $L$oop_dec1_2
+DB	102,15,56,223,209
+	pxor	xmm0,xmm0
+	pxor	xmm1,xmm1
+	movups	XMMWORD[rdx],xmm2
+	pxor	xmm2,xmm2
+	DB	0F3h,0C3h		;repret
+
+
+ALIGN	16
+_aesni_encrypt2:
+	movups	xmm0,XMMWORD[rcx]
+	shl	eax,4
+	movups	xmm1,XMMWORD[16+rcx]
+	xorps	xmm2,xmm0
+	xorps	xmm3,xmm0
+	movups	xmm0,XMMWORD[32+rcx]
+	lea	rcx,[32+rax*1+rcx]
+	neg	rax
+	add	rax,16
+
+$L$enc_loop2:
+DB	102,15,56,220,209
+DB	102,15,56,220,217
+	movups	xmm1,XMMWORD[rax*1+rcx]
+	add	rax,32
+DB	102,15,56,220,208
+DB	102,15,56,220,216
+	movups	xmm0,XMMWORD[((-16))+rax*1+rcx]
+	jnz	NEAR $L$enc_loop2
+
+DB	102,15,56,220,209
+DB	102,15,56,220,217
+DB	102,15,56,221,208
+DB	102,15,56,221,216
+	DB	0F3h,0C3h		;repret
+
+
+ALIGN	16
+_aesni_decrypt2:
+	movups	xmm0,XMMWORD[rcx]
+	shl	eax,4
+	movups	xmm1,XMMWORD[16+rcx]
+	xorps	xmm2,xmm0
+	xorps	xmm3,xmm0
+	movups	xmm0,XMMWORD[32+rcx]
+	lea	rcx,[32+rax*1+rcx]
+	neg	rax
+	add	rax,16
+
+$L$dec_loop2:
+DB	102,15,56,222,209
+DB	102,15,56,222,217
+	movups	xmm1,XMMWORD[rax*1+rcx]
+	add	rax,32
+DB	102,15,56,222,208
+DB	102,15,56,222,216
+	movups	xmm0,XMMWORD[((-16))+rax*1+rcx]
+	jnz	NEAR $L$dec_loop2
+
+DB	102,15,56,222,209
+DB	102,15,56,222,217
+DB	102,15,56,223,208
+DB	102,15,56,223,216
+	DB	0F3h,0C3h		;repret
+
+
+ALIGN	16
+_aesni_encrypt3:
+	movups	xmm0,XMMWORD[rcx]
+	shl	eax,4
+	movups	xmm1,XMMWORD[16+rcx]
+	xorps	xmm2,xmm0
+	xorps	xmm3,xmm0
+	xorps	xmm4,xmm0
+	movups	xmm0,XMMWORD[32+rcx]
+	lea	rcx,[32+rax*1+rcx]
+	neg	rax
+	add	rax,16
+
+$L$enc_loop3:
+DB	102,15,56,220,209
+DB	102,15,56,220,217
+DB	102,15,56,220,225
+	movups	xmm1,XMMWORD[rax*1+rcx]
+	add	rax,32
+DB	102,15,56,220,208
+DB	102,15,56,220,216
+DB	102,15,56,220,224
+	movups	xmm0,XMMWORD[((-16))+rax*1+rcx]
+	jnz	NEAR $L$enc_loop3
+
+DB	102,15,56,220,209
+DB	102,15,56,220,217
+DB	102,15,56,220,225
+DB	102,15,56,221,208
+DB	102,15,56,221,216
+DB	102,15,56,221,224
+	DB	0F3h,0C3h		;repret
+
+
+ALIGN	16
+_aesni_decrypt3:
+	movups	xmm0,XMMWORD[rcx]
+	shl	eax,4
+	movups	xmm1,XMMWORD[16+rcx]
+	xorps	xmm2,xmm0
+	xorps	xmm3,xmm0
+	xorps	xmm4,xmm0
+	movups	xmm0,XMMWORD[32+rcx]
+	lea	rcx,[32+rax*1+rcx]
+	neg	rax
+	add	rax,16
+
+$L$dec_loop3:
+DB	102,15,56,222,209
+DB	102,15,56,222,217
+DB	102,15,56,222,225
+	movups	xmm1,XMMWORD[rax*1+rcx]
+	add	rax,32
+DB	102,15,56,222,208
+DB	102,15,56,222,216
+DB	102,15,56,222,224
+	movups	xmm0,XMMWORD[((-16))+rax*1+rcx]
+	jnz	NEAR $L$dec_loop3
+
+DB	102,15,56,222,209
+DB	102,15,56,222,217
+DB	102,15,56,222,225
+DB	102,15,56,223,208
+DB	102,15,56,223,216
+DB	102,15,56,223,224
+	DB	0F3h,0C3h		;repret
+
+
+ALIGN	16
+_aesni_encrypt4:
+	movups	xmm0,XMMWORD[rcx]
+	shl	eax,4
+	movups	xmm1,XMMWORD[16+rcx]
+	xorps	xmm2,xmm0
+	xorps	xmm3,xmm0
+	xorps	xmm4,xmm0
+	xorps	xmm5,xmm0
+	movups	xmm0,XMMWORD[32+rcx]
+	lea	rcx,[32+rax*1+rcx]
+	neg	rax
+DB	0x0f,0x1f,0x00
+	add	rax,16
+
+$L$enc_loop4:
+DB	102,15,56,220,209
+DB	102,15,56,220,217
+DB	102,15,56,220,225
+DB	102,15,56,220,233
+	movups	xmm1,XMMWORD[rax*1+rcx]
+	add	rax,32
+DB	102,15,56,220,208
+DB	102,15,56,220,216
+DB	102,15,56,220,224
+DB	102,15,56,220,232
+	movups	xmm0,XMMWORD[((-16))+rax*1+rcx]
+	jnz	NEAR $L$enc_loop4
+
+DB	102,15,56,220,209
+DB	102,15,56,220,217
+DB	102,15,56,220,225
+DB	102,15,56,220,233
+DB	102,15,56,221,208
+DB	102,15,56,221,216
+DB	102,15,56,221,224
+DB	102,15,56,221,232
+	DB	0F3h,0C3h		;repret
+
+
+ALIGN	16
+_aesni_decrypt4:
+	movups	xmm0,XMMWORD[rcx]
+	shl	eax,4
+	movups	xmm1,XMMWORD[16+rcx]
+	xorps	xmm2,xmm0
+	xorps	xmm3,xmm0
+	xorps	xmm4,xmm0
+	xorps	xmm5,xmm0
+	movups	xmm0,XMMWORD[32+rcx]
+	lea	rcx,[32+rax*1+rcx]
+	neg	rax
+DB	0x0f,0x1f,0x00
+	add	rax,16
+
+$L$dec_loop4:
+DB	102,15,56,222,209
+DB	102,15,56,222,217
+DB	102,15,56,222,225
+DB	102,15,56,222,233
+	movups	xmm1,XMMWORD[rax*1+rcx]
+	add	rax,32
+DB	102,15,56,222,208
+DB	102,15,56,222,216
+DB	102,15,56,222,224
+DB	102,15,56,222,232
+	movups	xmm0,XMMWORD[((-16))+rax*1+rcx]
+	jnz	NEAR $L$dec_loop4
+
+DB	102,15,56,222,209
+DB	102,15,56,222,217
+DB	102,15,56,222,225
+DB	102,15,56,222,233
+DB	102,15,56,223,208
+DB	102,15,56,223,216
+DB	102,15,56,223,224
+DB	102,15,56,223,232
+	DB	0F3h,0C3h		;repret
+
+
+ALIGN	16
+_aesni_encrypt6:
+	movups	xmm0,XMMWORD[rcx]
+	shl	eax,4
+	movups	xmm1,XMMWORD[16+rcx]
+	xorps	xmm2,xmm0
+	pxor	xmm3,xmm0
+	pxor	xmm4,xmm0
+DB	102,15,56,220,209
+	lea	rcx,[32+rax*1+rcx]
+	neg	rax
+DB	102,15,56,220,217
+	pxor	xmm5,xmm0
+	pxor	xmm6,xmm0
+DB	102,15,56,220,225
+	pxor	xmm7,xmm0
+	movups	xmm0,XMMWORD[rax*1+rcx]
+	add	rax,16
+	jmp	NEAR $L$enc_loop6_enter
+ALIGN	16
+$L$enc_loop6:
+DB	102,15,56,220,209
+DB	102,15,56,220,217
+DB	102,15,56,220,225
+$L$enc_loop6_enter:
+DB	102,15,56,220,233
+DB	102,15,56,220,241
+DB	102,15,56,220,249
+	movups	xmm1,XMMWORD[rax*1+rcx]
+	add	rax,32
+DB	102,15,56,220,208
+DB	102,15,56,220,216
+DB	102,15,56,220,224
+DB	102,15,56,220,232
+DB	102,15,56,220,240
+DB	102,15,56,220,248
+	movups	xmm0,XMMWORD[((-16))+rax*1+rcx]
+	jnz	NEAR $L$enc_loop6
+
+DB	102,15,56,220,209
+DB	102,15,56,220,217
+DB	102,15,56,220,225
+DB	102,15,56,220,233
+DB	102,15,56,220,241
+DB	102,15,56,220,249
+DB	102,15,56,221,208
+DB	102,15,56,221,216
+DB	102,15,56,221,224
+DB	102,15,56,221,232
+DB	102,15,56,221,240
+DB	102,15,56,221,248
+	DB	0F3h,0C3h		;repret
+
+
+ALIGN	16
+_aesni_decrypt6:
+	movups	xmm0,XMMWORD[rcx]
+	shl	eax,4
+	movups	xmm1,XMMWORD[16+rcx]
+	xorps	xmm2,xmm0
+	pxor	xmm3,xmm0
+	pxor	xmm4,xmm0
+DB	102,15,56,222,209
+	lea	rcx,[32+rax*1+rcx]
+	neg	rax
+DB	102,15,56,222,217
+	pxor	xmm5,xmm0
+	pxor	xmm6,xmm0
+DB	102,15,56,222,225
+	pxor	xmm7,xmm0
+	movups	xmm0,XMMWORD[rax*1+rcx]
+	add	rax,16
+	jmp	NEAR $L$dec_loop6_enter
+ALIGN	16
+$L$dec_loop6:
+DB	102,15,56,222,209
+DB	102,15,56,222,217
+DB	102,15,56,222,225
+$L$dec_loop6_enter:
+DB	102,15,56,222,233
+DB	102,15,56,222,241
+DB	102,15,56,222,249
+	movups	xmm1,XMMWORD[rax*1+rcx]
+	add	rax,32
+DB	102,15,56,222,208
+DB	102,15,56,222,216
+DB	102,15,56,222,224
+DB	102,15,56,222,232
+DB	102,15,56,222,240
+DB	102,15,56,222,248
+	movups	xmm0,XMMWORD[((-16))+rax*1+rcx]
+	jnz	NEAR $L$dec_loop6
+
+DB	102,15,56,222,209
+DB	102,15,56,222,217
+DB	102,15,56,222,225
+DB	102,15,56,222,233
+DB	102,15,56,222,241
+DB	102,15,56,222,249
+DB	102,15,56,223,208
+DB	102,15,56,223,216
+DB	102,15,56,223,224
+DB	102,15,56,223,232
+DB	102,15,56,223,240
+DB	102,15,56,223,248
+	DB	0F3h,0C3h		;repret
+
+
+ALIGN	16
+_aesni_encrypt8:
+	movups	xmm0,XMMWORD[rcx]
+	shl	eax,4
+	movups	xmm1,XMMWORD[16+rcx]
+	xorps	xmm2,xmm0
+	xorps	xmm3,xmm0
+	pxor	xmm4,xmm0
+	pxor	xmm5,xmm0
+	pxor	xmm6,xmm0
+	lea	rcx,[32+rax*1+rcx]
+	neg	rax
+DB	102,15,56,220,209
+	pxor	xmm7,xmm0
+	pxor	xmm8,xmm0
+DB	102,15,56,220,217
+	pxor	xmm9,xmm0
+	movups	xmm0,XMMWORD[rax*1+rcx]
+	add	rax,16
+	jmp	NEAR $L$enc_loop8_inner
+ALIGN	16
+$L$enc_loop8:
+DB	102,15,56,220,209
+DB	102,15,56,220,217
+$L$enc_loop8_inner:
+DB	102,15,56,220,225
+DB	102,15,56,220,233
+DB	102,15,56,220,241
+DB	102,15,56,220,249
+DB	102,68,15,56,220,193
+DB	102,68,15,56,220,201
+$L$enc_loop8_enter:
+	movups	xmm1,XMMWORD[rax*1+rcx]
+	add	rax,32
+DB	102,15,56,220,208
+DB	102,15,56,220,216
+DB	102,15,56,220,224
+DB	102,15,56,220,232
+DB	102,15,56,220,240
+DB	102,15,56,220,248
+DB	102,68,15,56,220,192
+DB	102,68,15,56,220,200
+	movups	xmm0,XMMWORD[((-16))+rax*1+rcx]
+	jnz	NEAR $L$enc_loop8
+
+DB	102,15,56,220,209
+DB	102,15,56,220,217
+DB	102,15,56,220,225
+DB	102,15,56,220,233
+DB	102,15,56,220,241
+DB	102,15,56,220,249
+DB	102,68,15,56,220,193
+DB	102,68,15,56,220,201
+DB	102,15,56,221,208
+DB	102,15,56,221,216
+DB	102,15,56,221,224
+DB	102,15,56,221,232
+DB	102,15,56,221,240
+DB	102,15,56,221,248
+DB	102,68,15,56,221,192
+DB	102,68,15,56,221,200
+	DB	0F3h,0C3h		;repret
+
+
+ALIGN	16
+_aesni_decrypt8:
+	movups	xmm0,XMMWORD[rcx]
+	shl	eax,4
+	movups	xmm1,XMMWORD[16+rcx]
+	xorps	xmm2,xmm0
+	xorps	xmm3,xmm0
+	pxor	xmm4,xmm0
+	pxor	xmm5,xmm0
+	pxor	xmm6,xmm0
+	lea	rcx,[32+rax*1+rcx]
+	neg	rax
+DB	102,15,56,222,209
+	pxor	xmm7,xmm0
+	pxor	xmm8,xmm0
+DB	102,15,56,222,217
+	pxor	xmm9,xmm0
+	movups	xmm0,XMMWORD[rax*1+rcx]
+	add	rax,16
+	jmp	NEAR $L$dec_loop8_inner
+ALIGN	16
+$L$dec_loop8:
+DB	102,15,56,222,209
+DB	102,15,56,222,217
+$L$dec_loop8_inner:
+DB	102,15,56,222,225
+DB	102,15,56,222,233
+DB	102,15,56,222,241
+DB	102,15,56,222,249
+DB	102,68,15,56,222,193
+DB	102,68,15,56,222,201
+$L$dec_loop8_enter:
+	movups	xmm1,XMMWORD[rax*1+rcx]
+	add	rax,32
+DB	102,15,56,222,208
+DB	102,15,56,222,216
+DB	102,15,56,222,224
+DB	102,15,56,222,232
+DB	102,15,56,222,240
+DB	102,15,56,222,248
+DB	102,68,15,56,222,192
+DB	102,68,15,56,222,200
+	movups	xmm0,XMMWORD[((-16))+rax*1+rcx]
+	jnz	NEAR $L$dec_loop8
+
+DB	102,15,56,222,209
+DB	102,15,56,222,217
+DB	102,15,56,222,225
+DB	102,15,56,222,233
+DB	102,15,56,222,241
+DB	102,15,56,222,249
+DB	102,68,15,56,222,193
+DB	102,68,15,56,222,201
+DB	102,15,56,223,208
+DB	102,15,56,223,216
+DB	102,15,56,223,224
+DB	102,15,56,223,232
+DB	102,15,56,223,240
+DB	102,15,56,223,248
+DB	102,68,15,56,223,192
+DB	102,68,15,56,223,200
+	DB	0F3h,0C3h		;repret
+
+global	aesni_ecb_encrypt
+
+ALIGN	16
+aesni_ecb_encrypt:
+	mov	QWORD[8+rsp],rdi	;WIN64 prologue
+	mov	QWORD[16+rsp],rsi
+	mov	rax,rsp
+$L$SEH_begin_aesni_ecb_encrypt:
+	mov	rdi,rcx
+	mov	rsi,rdx
+	mov	rdx,r8
+	mov	rcx,r9
+	mov	r8,QWORD[40+rsp]
+
+
+	lea	rsp,[((-88))+rsp]
+	movaps	XMMWORD[rsp],xmm6
+	movaps	XMMWORD[16+rsp],xmm7
+	movaps	XMMWORD[32+rsp],xmm8
+	movaps	XMMWORD[48+rsp],xmm9
+$L$ecb_enc_body:
+	and	rdx,-16
+	jz	NEAR $L$ecb_ret
+
+	mov	eax,DWORD[240+rcx]
+	movups	xmm0,XMMWORD[rcx]
+	mov	r11,rcx
+	mov	r10d,eax
+	test	r8d,r8d
+	jz	NEAR $L$ecb_decrypt
+
+	cmp	rdx,0x80
+	jb	NEAR $L$ecb_enc_tail
+
+	movdqu	xmm2,XMMWORD[rdi]
+	movdqu	xmm3,XMMWORD[16+rdi]
+	movdqu	xmm4,XMMWORD[32+rdi]
+	movdqu	xmm5,XMMWORD[48+rdi]
+	movdqu	xmm6,XMMWORD[64+rdi]
+	movdqu	xmm7,XMMWORD[80+rdi]
+	movdqu	xmm8,XMMWORD[96+rdi]
+	movdqu	xmm9,XMMWORD[112+rdi]
+	lea	rdi,[128+rdi]
+	sub	rdx,0x80
+	jmp	NEAR $L$ecb_enc_loop8_enter
+ALIGN	16
+$L$ecb_enc_loop8:
+	movups	XMMWORD[rsi],xmm2
+	mov	rcx,r11
+	movdqu	xmm2,XMMWORD[rdi]
+	mov	eax,r10d
+	movups	XMMWORD[16+rsi],xmm3
+	movdqu	xmm3,XMMWORD[16+rdi]
+	movups	XMMWORD[32+rsi],xmm4
+	movdqu	xmm4,XMMWORD[32+rdi]
+	movups	XMMWORD[48+rsi],xmm5
+	movdqu	xmm5,XMMWORD[48+rdi]
+	movups	XMMWORD[64+rsi],xmm6
+	movdqu	xmm6,XMMWORD[64+rdi]
+	movups	XMMWORD[80+rsi],xmm7
+	movdqu	xmm7,XMMWORD[80+rdi]
+	movups	XMMWORD[96+rsi],xmm8
+	movdqu	xmm8,XMMWORD[96+rdi]
+	movups	XMMWORD[112+rsi],xmm9
+	lea	rsi,[128+rsi]
+	movdqu	xmm9,XMMWORD[112+rdi]
+	lea	rdi,[128+rdi]
+$L$ecb_enc_loop8_enter:
+
+	call	_aesni_encrypt8
+
+	sub	rdx,0x80
+	jnc	NEAR $L$ecb_enc_loop8
+
+	movups	XMMWORD[rsi],xmm2
+	mov	rcx,r11
+	movups	XMMWORD[16+rsi],xmm3
+	mov	eax,r10d
+	movups	XMMWORD[32+rsi],xmm4
+	movups	XMMWORD[48+rsi],xmm5
+	movups	XMMWORD[64+rsi],xmm6
+	movups	XMMWORD[80+rsi],xmm7
+	movups	XMMWORD[96+rsi],xmm8
+	movups	XMMWORD[112+rsi],xmm9
+	lea	rsi,[128+rsi]
+	add	rdx,0x80
+	jz	NEAR $L$ecb_ret
+
+$L$ecb_enc_tail:
+	movups	xmm2,XMMWORD[rdi]
+	cmp	rdx,0x20
+	jb	NEAR $L$ecb_enc_one
+	movups	xmm3,XMMWORD[16+rdi]
+	je	NEAR $L$ecb_enc_two
+	movups	xmm4,XMMWORD[32+rdi]
+	cmp	rdx,0x40
+	jb	NEAR $L$ecb_enc_three
+	movups	xmm5,XMMWORD[48+rdi]
+	je	NEAR $L$ecb_enc_four
+	movups	xmm6,XMMWORD[64+rdi]
+	cmp	rdx,0x60
+	jb	NEAR $L$ecb_enc_five
+	movups	xmm7,XMMWORD[80+rdi]
+	je	NEAR $L$ecb_enc_six
+	movdqu	xmm8,XMMWORD[96+rdi]
+	xorps	xmm9,xmm9
+	call	_aesni_encrypt8
+	movups	XMMWORD[rsi],xmm2
+	movups	XMMWORD[16+rsi],xmm3
+	movups	XMMWORD[32+rsi],xmm4
+	movups	XMMWORD[48+rsi],xmm5
+	movups	XMMWORD[64+rsi],xmm6
+	movups	XMMWORD[80+rsi],xmm7
+	movups	XMMWORD[96+rsi],xmm8
+	jmp	NEAR $L$ecb_ret
+ALIGN	16
+$L$ecb_enc_one:
+	movups	xmm0,XMMWORD[rcx]
+	movups	xmm1,XMMWORD[16+rcx]
+	lea	rcx,[32+rcx]
+	xorps	xmm2,xmm0
+$L$oop_enc1_3:
+DB	102,15,56,220,209
+	dec	eax
+	movups	xmm1,XMMWORD[rcx]
+	lea	rcx,[16+rcx]
+	jnz	NEAR $L$oop_enc1_3
+DB	102,15,56,221,209
+	movups	XMMWORD[rsi],xmm2
+	jmp	NEAR $L$ecb_ret
+ALIGN	16
+$L$ecb_enc_two:
+	call	_aesni_encrypt2
+	movups	XMMWORD[rsi],xmm2
+	movups	XMMWORD[16+rsi],xmm3
+	jmp	NEAR $L$ecb_ret
+ALIGN	16
+$L$ecb_enc_three:
+	call	_aesni_encrypt3
+	movups	XMMWORD[rsi],xmm2
+	movups	XMMWORD[16+rsi],xmm3
+	movups	XMMWORD[32+rsi],xmm4
+	jmp	NEAR $L$ecb_ret
+ALIGN	16
+$L$ecb_enc_four:
+	call	_aesni_encrypt4
+	movups	XMMWORD[rsi],xmm2
+	movups	XMMWORD[16+rsi],xmm3
+	movups	XMMWORD[32+rsi],xmm4
+	movups	XMMWORD[48+rsi],xmm5
+	jmp	NEAR $L$ecb_ret
+ALIGN	16
+$L$ecb_enc_five:
+	xorps	xmm7,xmm7
+	call	_aesni_encrypt6
+	movups	XMMWORD[rsi],xmm2
+	movups	XMMWORD[16+rsi],xmm3
+	movups	XMMWORD[32+rsi],xmm4
+	movups	XMMWORD[48+rsi],xmm5
+	movups	XMMWORD[64+rsi],xmm6
+	jmp	NEAR $L$ecb_ret
+ALIGN	16
+$L$ecb_enc_six:
+	call	_aesni_encrypt6
+	movups	XMMWORD[rsi],xmm2
+	movups	XMMWORD[16+rsi],xmm3
+	movups	XMMWORD[32+rsi],xmm4
+	movups	XMMWORD[48+rsi],xmm5
+	movups	XMMWORD[64+rsi],xmm6
+	movups	XMMWORD[80+rsi],xmm7
+	jmp	NEAR $L$ecb_ret
+
+ALIGN	16
+$L$ecb_decrypt:
+	cmp	rdx,0x80
+	jb	NEAR $L$ecb_dec_tail
+
+	movdqu	xmm2,XMMWORD[rdi]
+	movdqu	xmm3,XMMWORD[16+rdi]
+	movdqu	xmm4,XMMWORD[32+rdi]
+	movdqu	xmm5,XMMWORD[48+rdi]
+	movdqu	xmm6,XMMWORD[64+rdi]
+	movdqu	xmm7,XMMWORD[80+rdi]
+	movdqu	xmm8,XMMWORD[96+rdi]
+	movdqu	xmm9,XMMWORD[112+rdi]
+	lea	rdi,[128+rdi]
+	sub	rdx,0x80
+	jmp	NEAR $L$ecb_dec_loop8_enter
+ALIGN	16
+$L$ecb_dec_loop8:
+	movups	XMMWORD[rsi],xmm2
+	mov	rcx,r11
+	movdqu	xmm2,XMMWORD[rdi]
+	mov	eax,r10d
+	movups	XMMWORD[16+rsi],xmm3
+	movdqu	xmm3,XMMWORD[16+rdi]
+	movups	XMMWORD[32+rsi],xmm4
+	movdqu	xmm4,XMMWORD[32+rdi]
+	movups	XMMWORD[48+rsi],xmm5
+	movdqu	xmm5,XMMWORD[48+rdi]
+	movups	XMMWORD[64+rsi],xmm6
+	movdqu	xmm6,XMMWORD[64+rdi]
+	movups	XMMWORD[80+rsi],xmm7
+	movdqu	xmm7,XMMWORD[80+rdi]
+	movups	XMMWORD[96+rsi],xmm8
+	movdqu	xmm8,XMMWORD[96+rdi]
+	movups	XMMWORD[112+rsi],xmm9
+	lea	rsi,[128+rsi]
+	movdqu	xmm9,XMMWORD[112+rdi]
+	lea	rdi,[128+rdi]
+$L$ecb_dec_loop8_enter:
+
+	call	_aesni_decrypt8
+
+	movups	xmm0,XMMWORD[r11]
+	sub	rdx,0x80
+	jnc	NEAR $L$ecb_dec_loop8
+
+	movups	XMMWORD[rsi],xmm2
+	pxor	xmm2,xmm2
+	mov	rcx,r11
+	movups	XMMWORD[16+rsi],xmm3
+	pxor	xmm3,xmm3
+	mov	eax,r10d
+	movups	XMMWORD[32+rsi],xmm4
+	pxor	xmm4,xmm4
+	movups	XMMWORD[48+rsi],xmm5
+	pxor	xmm5,xmm5
+	movups	XMMWORD[64+rsi],xmm6
+	pxor	xmm6,xmm6
+	movups	XMMWORD[80+rsi],xmm7
+	pxor	xmm7,xmm7
+	movups	XMMWORD[96+rsi],xmm8
+	pxor	xmm8,xmm8
+	movups	XMMWORD[112+rsi],xmm9
+	pxor	xmm9,xmm9
+	lea	rsi,[128+rsi]
+	add	rdx,0x80
+	jz	NEAR $L$ecb_ret
+
+$L$ecb_dec_tail:
+	movups	xmm2,XMMWORD[rdi]
+	cmp	rdx,0x20
+	jb	NEAR $L$ecb_dec_one
+	movups	xmm3,XMMWORD[16+rdi]
+	je	NEAR $L$ecb_dec_two
+	movups	xmm4,XMMWORD[32+rdi]
+	cmp	rdx,0x40
+	jb	NEAR $L$ecb_dec_three
+	movups	xmm5,XMMWORD[48+rdi]
+	je	NEAR $L$ecb_dec_four
+	movups	xmm6,XMMWORD[64+rdi]
+	cmp	rdx,0x60
+	jb	NEAR $L$ecb_dec_five
+	movups	xmm7,XMMWORD[80+rdi]
+	je	NEAR $L$ecb_dec_six
+	movups	xmm8,XMMWORD[96+rdi]
+	movups	xmm0,XMMWORD[rcx]
+	xorps	xmm9,xmm9
+	call	_aesni_decrypt8
+	movups	XMMWORD[rsi],xmm2
+	pxor	xmm2,xmm2
+	movups	XMMWORD[16+rsi],xmm3
+	pxor	xmm3,xmm3
+	movups	XMMWORD[32+rsi],xmm4
+	pxor	xmm4,xmm4
+	movups	XMMWORD[48+rsi],xmm5
+	pxor	xmm5,xmm5
+	movups	XMMWORD[64+rsi],xmm6
+	pxor	xmm6,xmm6
+	movups	XMMWORD[80+rsi],xmm7
+	pxor	xmm7,xmm7
+	movups	XMMWORD[96+rsi],xmm8
+	pxor	xmm8,xmm8
+	pxor	xmm9,xmm9
+	jmp	NEAR $L$ecb_ret
+ALIGN	16
+$L$ecb_dec_one:
+	movups	xmm0,XMMWORD[rcx]
+	movups	xmm1,XMMWORD[16+rcx]
+	lea	rcx,[32+rcx]
+	xorps	xmm2,xmm0
+$L$oop_dec1_4:
+DB	102,15,56,222,209
+	dec	eax
+	movups	xmm1,XMMWORD[rcx]
+	lea	rcx,[16+rcx]
+	jnz	NEAR $L$oop_dec1_4
+DB	102,15,56,223,209
+	movups	XMMWORD[rsi],xmm2
+	pxor	xmm2,xmm2
+	jmp	NEAR $L$ecb_ret
+ALIGN	16
+$L$ecb_dec_two:
+	call	_aesni_decrypt2
+	movups	XMMWORD[rsi],xmm2
+	pxor	xmm2,xmm2
+	movups	XMMWORD[16+rsi],xmm3
+	pxor	xmm3,xmm3
+	jmp	NEAR $L$ecb_ret
+ALIGN	16
+$L$ecb_dec_three:
+	call	_aesni_decrypt3
+	movups	XMMWORD[rsi],xmm2
+	pxor	xmm2,xmm2
+	movups	XMMWORD[16+rsi],xmm3
+	pxor	xmm3,xmm3
+	movups	XMMWORD[32+rsi],xmm4
+	pxor	xmm4,xmm4
+	jmp	NEAR $L$ecb_ret
+ALIGN	16
+$L$ecb_dec_four:
+	call	_aesni_decrypt4
+	movups	XMMWORD[rsi],xmm2
+	pxor	xmm2,xmm2
+	movups	XMMWORD[16+rsi],xmm3
+	pxor	xmm3,xmm3
+	movups	XMMWORD[32+rsi],xmm4
+	pxor	xmm4,xmm4
+	movups	XMMWORD[48+rsi],xmm5
+	pxor	xmm5,xmm5
+	jmp	NEAR $L$ecb_ret
+ALIGN	16
+$L$ecb_dec_five:
+	xorps	xmm7,xmm7
+	call	_aesni_decrypt6
+	movups	XMMWORD[rsi],xmm2
+	pxor	xmm2,xmm2
+	movups	XMMWORD[16+rsi],xmm3
+	pxor	xmm3,xmm3
+	movups	XMMWORD[32+rsi],xmm4
+	pxor	xmm4,xmm4
+	movups	XMMWORD[48+rsi],xmm5
+	pxor	xmm5,xmm5
+	movups	XMMWORD[64+rsi],xmm6
+	pxor	xmm6,xmm6
+	pxor	xmm7,xmm7
+	jmp	NEAR $L$ecb_ret
+ALIGN	16
+$L$ecb_dec_six:
+	call	_aesni_decrypt6
+	movups	XMMWORD[rsi],xmm2
+	pxor	xmm2,xmm2
+	movups	XMMWORD[16+rsi],xmm3
+	pxor	xmm3,xmm3
+	movups	XMMWORD[32+rsi],xmm4
+	pxor	xmm4,xmm4
+	movups	XMMWORD[48+rsi],xmm5
+	pxor	xmm5,xmm5
+	movups	XMMWORD[64+rsi],xmm6
+	pxor	xmm6,xmm6
+	movups	XMMWORD[80+rsi],xmm7
+	pxor	xmm7,xmm7
+
+$L$ecb_ret:
+	xorps	xmm0,xmm0
+	pxor	xmm1,xmm1
+	movaps	xmm6,XMMWORD[rsp]
+	movaps	XMMWORD[rsp],xmm0
+	movaps	xmm7,XMMWORD[16+rsp]
+	movaps	XMMWORD[16+rsp],xmm0
+	movaps	xmm8,XMMWORD[32+rsp]
+	movaps	XMMWORD[32+rsp],xmm0
+	movaps	xmm9,XMMWORD[48+rsp]
+	movaps	XMMWORD[48+rsp],xmm0
+	lea	rsp,[88+rsp]
+$L$ecb_enc_ret:
+	mov	rdi,QWORD[8+rsp]	;WIN64 epilogue
+	mov	rsi,QWORD[16+rsp]
+	DB	0F3h,0C3h		;repret
+$L$SEH_end_aesni_ecb_encrypt:
+global	aesni_ccm64_encrypt_blocks
+
+ALIGN	16
+aesni_ccm64_encrypt_blocks:
+	mov	QWORD[8+rsp],rdi	;WIN64 prologue
+	mov	QWORD[16+rsp],rsi
+	mov	rax,rsp
+$L$SEH_begin_aesni_ccm64_encrypt_blocks:
+	mov	rdi,rcx
+	mov	rsi,rdx
+	mov	rdx,r8
+	mov	rcx,r9
+	mov	r8,QWORD[40+rsp]
+	mov	r9,QWORD[48+rsp]
+
+
+	lea	rsp,[((-88))+rsp]
+	movaps	XMMWORD[rsp],xmm6
+	movaps	XMMWORD[16+rsp],xmm7
+	movaps	XMMWORD[32+rsp],xmm8
+	movaps	XMMWORD[48+rsp],xmm9
+$L$ccm64_enc_body:
+	mov	eax,DWORD[240+rcx]
+	movdqu	xmm6,XMMWORD[r8]
+	movdqa	xmm9,XMMWORD[$L$increment64]
+	movdqa	xmm7,XMMWORD[$L$bswap_mask]
+
+	shl	eax,4
+	mov	r10d,16
+	lea	r11,[rcx]
+	movdqu	xmm3,XMMWORD[r9]
+	movdqa	xmm2,xmm6
+	lea	rcx,[32+rax*1+rcx]
+DB	102,15,56,0,247
+	sub	r10,rax
+	jmp	NEAR $L$ccm64_enc_outer
+ALIGN	16
+$L$ccm64_enc_outer:
+	movups	xmm0,XMMWORD[r11]
+	mov	rax,r10
+	movups	xmm8,XMMWORD[rdi]
+
+	xorps	xmm2,xmm0
+	movups	xmm1,XMMWORD[16+r11]
+	xorps	xmm0,xmm8
+	xorps	xmm3,xmm0
+	movups	xmm0,XMMWORD[32+r11]
+
+$L$ccm64_enc2_loop:
+DB	102,15,56,220,209
+DB	102,15,56,220,217
+	movups	xmm1,XMMWORD[rax*1+rcx]
+	add	rax,32
+DB	102,15,56,220,208
+DB	102,15,56,220,216
+	movups	xmm0,XMMWORD[((-16))+rax*1+rcx]
+	jnz	NEAR $L$ccm64_enc2_loop
+DB	102,15,56,220,209
+DB	102,15,56,220,217
+	paddq	xmm6,xmm9
+	dec	rdx
+DB	102,15,56,221,208
+DB	102,15,56,221,216
+
+	lea	rdi,[16+rdi]
+	xorps	xmm8,xmm2
+	movdqa	xmm2,xmm6
+	movups	XMMWORD[rsi],xmm8
+DB	102,15,56,0,215
+	lea	rsi,[16+rsi]
+	jnz	NEAR $L$ccm64_enc_outer
+
+	pxor	xmm0,xmm0
+	pxor	xmm1,xmm1
+	pxor	xmm2,xmm2
+	movups	XMMWORD[r9],xmm3
+	pxor	xmm3,xmm3
+	pxor	xmm8,xmm8
+	pxor	xmm6,xmm6
+	movaps	xmm6,XMMWORD[rsp]
+	movaps	XMMWORD[rsp],xmm0
+	movaps	xmm7,XMMWORD[16+rsp]
+	movaps	XMMWORD[16+rsp],xmm0
+	movaps	xmm8,XMMWORD[32+rsp]
+	movaps	XMMWORD[32+rsp],xmm0
+	movaps	xmm9,XMMWORD[48+rsp]
+	movaps	XMMWORD[48+rsp],xmm0
+	lea	rsp,[88+rsp]
+$L$ccm64_enc_ret:
+	mov	rdi,QWORD[8+rsp]	;WIN64 epilogue
+	mov	rsi,QWORD[16+rsp]
+	DB	0F3h,0C3h		;repret
+$L$SEH_end_aesni_ccm64_encrypt_blocks:
+global	aesni_ccm64_decrypt_blocks
+
+ALIGN	16
+aesni_ccm64_decrypt_blocks:
+	mov	QWORD[8+rsp],rdi	;WIN64 prologue
+	mov	QWORD[16+rsp],rsi
+	mov	rax,rsp
+$L$SEH_begin_aesni_ccm64_decrypt_blocks:
+	mov	rdi,rcx
+	mov	rsi,rdx
+	mov	rdx,r8
+	mov	rcx,r9
+	mov	r8,QWORD[40+rsp]
+	mov	r9,QWORD[48+rsp]
+
+
+	lea	rsp,[((-88))+rsp]
+	movaps	XMMWORD[rsp],xmm6
+	movaps	XMMWORD[16+rsp],xmm7
+	movaps	XMMWORD[32+rsp],xmm8
+	movaps	XMMWORD[48+rsp],xmm9
+$L$ccm64_dec_body:
+	mov	eax,DWORD[240+rcx]
+	movups	xmm6,XMMWORD[r8]
+	movdqu	xmm3,XMMWORD[r9]
+	movdqa	xmm9,XMMWORD[$L$increment64]
+	movdqa	xmm7,XMMWORD[$L$bswap_mask]
+
+	movaps	xmm2,xmm6
+	mov	r10d,eax
+	mov	r11,rcx
+DB	102,15,56,0,247
+	movups	xmm0,XMMWORD[rcx]
+	movups	xmm1,XMMWORD[16+rcx]
+	lea	rcx,[32+rcx]
+	xorps	xmm2,xmm0
+$L$oop_enc1_5:
+DB	102,15,56,220,209
+	dec	eax
+	movups	xmm1,XMMWORD[rcx]
+	lea	rcx,[16+rcx]
+	jnz	NEAR $L$oop_enc1_5
+DB	102,15,56,221,209
+	shl	r10d,4
+	mov	eax,16
+	movups	xmm8,XMMWORD[rdi]
+	paddq	xmm6,xmm9
+	lea	rdi,[16+rdi]
+	sub	rax,r10
+	lea	rcx,[32+r10*1+r11]
+	mov	r10,rax
+	jmp	NEAR $L$ccm64_dec_outer
+ALIGN	16
+$L$ccm64_dec_outer:
+	xorps	xmm8,xmm2
+	movdqa	xmm2,xmm6
+	movups	XMMWORD[rsi],xmm8
+	lea	rsi,[16+rsi]
+DB	102,15,56,0,215
+
+	sub	rdx,1
+	jz	NEAR $L$ccm64_dec_break
+
+	movups	xmm0,XMMWORD[r11]
+	mov	rax,r10
+	movups	xmm1,XMMWORD[16+r11]
+	xorps	xmm8,xmm0
+	xorps	xmm2,xmm0
+	xorps	xmm3,xmm8
+	movups	xmm0,XMMWORD[32+r11]
+	jmp	NEAR $L$ccm64_dec2_loop
+ALIGN	16
+$L$ccm64_dec2_loop:
+DB	102,15,56,220,209
+DB	102,15,56,220,217
+	movups	xmm1,XMMWORD[rax*1+rcx]
+	add	rax,32
+DB	102,15,56,220,208
+DB	102,15,56,220,216
+	movups	xmm0,XMMWORD[((-16))+rax*1+rcx]
+	jnz	NEAR $L$ccm64_dec2_loop
+	movups	xmm8,XMMWORD[rdi]
+	paddq	xmm6,xmm9
+DB	102,15,56,220,209
+DB	102,15,56,220,217
+DB	102,15,56,221,208
+DB	102,15,56,221,216
+	lea	rdi,[16+rdi]
+	jmp	NEAR $L$ccm64_dec_outer
+
+ALIGN	16
+$L$ccm64_dec_break:
+
+	mov	eax,DWORD[240+r11]
+	movups	xmm0,XMMWORD[r11]
+	movups	xmm1,XMMWORD[16+r11]
+	xorps	xmm8,xmm0
+	lea	r11,[32+r11]
+	xorps	xmm3,xmm8
+$L$oop_enc1_6:
+DB	102,15,56,220,217
+	dec	eax
+	movups	xmm1,XMMWORD[r11]
+	lea	r11,[16+r11]
+	jnz	NEAR $L$oop_enc1_6
+DB	102,15,56,221,217
+	pxor	xmm0,xmm0
+	pxor	xmm1,xmm1
+	pxor	xmm2,xmm2
+	movups	XMMWORD[r9],xmm3
+	pxor	xmm3,xmm3
+	pxor	xmm8,xmm8
+	pxor	xmm6,xmm6
+	movaps	xmm6,XMMWORD[rsp]
+	movaps	XMMWORD[rsp],xmm0
+	movaps	xmm7,XMMWORD[16+rsp]
+	movaps	XMMWORD[16+rsp],xmm0
+	movaps	xmm8,XMMWORD[32+rsp]
+	movaps	XMMWORD[32+rsp],xmm0
+	movaps	xmm9,XMMWORD[48+rsp]
+	movaps	XMMWORD[48+rsp],xmm0
+	lea	rsp,[88+rsp]
+$L$ccm64_dec_ret:
+	mov	rdi,QWORD[8+rsp]	;WIN64 epilogue
+	mov	rsi,QWORD[16+rsp]
+	DB	0F3h,0C3h		;repret
+$L$SEH_end_aesni_ccm64_decrypt_blocks:
+global	aesni_ctr32_encrypt_blocks
+
+ALIGN	16
+aesni_ctr32_encrypt_blocks:
+	mov	QWORD[8+rsp],rdi	;WIN64 prologue
+	mov	QWORD[16+rsp],rsi
+	mov	rax,rsp
+$L$SEH_begin_aesni_ctr32_encrypt_blocks:
+	mov	rdi,rcx
+	mov	rsi,rdx
+	mov	rdx,r8
+	mov	rcx,r9
+	mov	r8,QWORD[40+rsp]
+
+
+	cmp	rdx,1
+	jne	NEAR $L$ctr32_bulk
+
+
+
+	movups	xmm2,XMMWORD[r8]
+	movups	xmm3,XMMWORD[rdi]
+	mov	edx,DWORD[240+rcx]
+	movups	xmm0,XMMWORD[rcx]
+	movups	xmm1,XMMWORD[16+rcx]
+	lea	rcx,[32+rcx]
+	xorps	xmm2,xmm0
+$L$oop_enc1_7:
+DB	102,15,56,220,209
+	dec	edx
+	movups	xmm1,XMMWORD[rcx]
+	lea	rcx,[16+rcx]
+	jnz	NEAR $L$oop_enc1_7
+DB	102,15,56,221,209
+	pxor	xmm0,xmm0
+	pxor	xmm1,xmm1
+	xorps	xmm2,xmm3
+	pxor	xmm3,xmm3
+	movups	XMMWORD[rsi],xmm2
+	xorps	xmm2,xmm2
+	jmp	NEAR $L$ctr32_epilogue
+
+ALIGN	16
+$L$ctr32_bulk:
+	lea	rax,[rsp]
+	push	rbp
+	sub	rsp,288
+	and	rsp,-16
+	movaps	XMMWORD[(-168)+rax],xmm6
+	movaps	XMMWORD[(-152)+rax],xmm7
+	movaps	XMMWORD[(-136)+rax],xmm8
+	movaps	XMMWORD[(-120)+rax],xmm9
+	movaps	XMMWORD[(-104)+rax],xmm10
+	movaps	XMMWORD[(-88)+rax],xmm11
+	movaps	XMMWORD[(-72)+rax],xmm12
+	movaps	XMMWORD[(-56)+rax],xmm13
+	movaps	XMMWORD[(-40)+rax],xmm14
+	movaps	XMMWORD[(-24)+rax],xmm15
+$L$ctr32_body:
+	lea	rbp,[((-8))+rax]
+
+
+
+
+	movdqu	xmm2,XMMWORD[r8]
+	movdqu	xmm0,XMMWORD[rcx]
+	mov	r8d,DWORD[12+r8]
+	pxor	xmm2,xmm0
+	mov	r11d,DWORD[12+rcx]
+	movdqa	XMMWORD[rsp],xmm2
+	bswap	r8d
+	movdqa	xmm3,xmm2
+	movdqa	xmm4,xmm2
+	movdqa	xmm5,xmm2
+	movdqa	XMMWORD[64+rsp],xmm2
+	movdqa	XMMWORD[80+rsp],xmm2
+	movdqa	XMMWORD[96+rsp],xmm2
+	mov	r10,rdx
+	movdqa	XMMWORD[112+rsp],xmm2
+
+	lea	rax,[1+r8]
+	lea	rdx,[2+r8]
+	bswap	eax
+	bswap	edx
+	xor	eax,r11d
+	xor	edx,r11d
+DB	102,15,58,34,216,3
+	lea	rax,[3+r8]
+	movdqa	XMMWORD[16+rsp],xmm3
+DB	102,15,58,34,226,3
+	bswap	eax
+	mov	rdx,r10
+	lea	r10,[4+r8]
+	movdqa	XMMWORD[32+rsp],xmm4
+	xor	eax,r11d
+	bswap	r10d
+DB	102,15,58,34,232,3
+	xor	r10d,r11d
+	movdqa	XMMWORD[48+rsp],xmm5
+	lea	r9,[5+r8]
+	mov	DWORD[((64+12))+rsp],r10d
+	bswap	r9d
+	lea	r10,[6+r8]
+	mov	eax,DWORD[240+rcx]
+	xor	r9d,r11d
+	bswap	r10d
+	mov	DWORD[((80+12))+rsp],r9d
+	xor	r10d,r11d
+	lea	r9,[7+r8]
+	mov	DWORD[((96+12))+rsp],r10d
+	bswap	r9d
+	mov	r10d,DWORD[((OPENSSL_ia32cap_P+4))]
+	xor	r9d,r11d
+	and	r10d,71303168
+	mov	DWORD[((112+12))+rsp],r9d
+
+	movups	xmm1,XMMWORD[16+rcx]
+
+	movdqa	xmm6,XMMWORD[64+rsp]
+	movdqa	xmm7,XMMWORD[80+rsp]
+
+	cmp	rdx,8
+	jb	NEAR $L$ctr32_tail
+
+	sub	rdx,6
+	cmp	r10d,4194304
+	je	NEAR $L$ctr32_6x
+
+	lea	rcx,[128+rcx]
+	sub	rdx,2
+	jmp	NEAR $L$ctr32_loop8
+
+ALIGN	16
+$L$ctr32_6x:
+	shl	eax,4
+	mov	r10d,48
+	bswap	r11d
+	lea	rcx,[32+rax*1+rcx]
+	sub	r10,rax
+	jmp	NEAR $L$ctr32_loop6
+
+ALIGN	16
+$L$ctr32_loop6:
+	add	r8d,6
+	movups	xmm0,XMMWORD[((-48))+r10*1+rcx]
+DB	102,15,56,220,209
+	mov	eax,r8d
+	xor	eax,r11d
+DB	102,15,56,220,217
+DB	0x0f,0x38,0xf1,0x44,0x24,12
+	lea	eax,[1+r8]
+DB	102,15,56,220,225
+	xor	eax,r11d
+DB	0x0f,0x38,0xf1,0x44,0x24,28
+DB	102,15,56,220,233
+	lea	eax,[2+r8]
+	xor	eax,r11d
+DB	102,15,56,220,241
+DB	0x0f,0x38,0xf1,0x44,0x24,44
+	lea	eax,[3+r8]
+DB	102,15,56,220,249
+	movups	xmm1,XMMWORD[((-32))+r10*1+rcx]
+	xor	eax,r11d
+
+DB	102,15,56,220,208
+DB	0x0f,0x38,0xf1,0x44,0x24,60
+	lea	eax,[4+r8]
+DB	102,15,56,220,216
+	xor	eax,r11d
+DB	0x0f,0x38,0xf1,0x44,0x24,76
+DB	102,15,56,220,224
+	lea	eax,[5+r8]
+	xor	eax,r11d
+DB	102,15,56,220,232
+DB	0x0f,0x38,0xf1,0x44,0x24,92
+	mov	rax,r10
+DB	102,15,56,220,240
+DB	102,15,56,220,248
+	movups	xmm0,XMMWORD[((-16))+r10*1+rcx]
+
+	call	$L$enc_loop6
+
+	movdqu	xmm8,XMMWORD[rdi]
+	movdqu	xmm9,XMMWORD[16+rdi]
+	movdqu	xmm10,XMMWORD[32+rdi]
+	movdqu	xmm11,XMMWORD[48+rdi]
+	movdqu	xmm12,XMMWORD[64+rdi]
+	movdqu	xmm13,XMMWORD[80+rdi]
+	lea	rdi,[96+rdi]
+	movups	xmm1,XMMWORD[((-64))+r10*1+rcx]
+	pxor	xmm8,xmm2
+	movaps	xmm2,XMMWORD[rsp]
+	pxor	xmm9,xmm3
+	movaps	xmm3,XMMWORD[16+rsp]
+	pxor	xmm10,xmm4
+	movaps	xmm4,XMMWORD[32+rsp]
+	pxor	xmm11,xmm5
+	movaps	xmm5,XMMWORD[48+rsp]
+	pxor	xmm12,xmm6
+	movaps	xmm6,XMMWORD[64+rsp]
+	pxor	xmm13,xmm7
+	movaps	xmm7,XMMWORD[80+rsp]
+	movdqu	XMMWORD[rsi],xmm8
+	movdqu	XMMWORD[16+rsi],xmm9
+	movdqu	XMMWORD[32+rsi],xmm10
+	movdqu	XMMWORD[48+rsi],xmm11
+	movdqu	XMMWORD[64+rsi],xmm12
+	movdqu	XMMWORD[80+rsi],xmm13
+	lea	rsi,[96+rsi]
+
+	sub	rdx,6
+	jnc	NEAR $L$ctr32_loop6
+
+	add	rdx,6
+	jz	NEAR $L$ctr32_done
+
+	lea	eax,[((-48))+r10]
+	lea	rcx,[((-80))+r10*1+rcx]
+	neg	eax
+	shr	eax,4
+	jmp	NEAR $L$ctr32_tail
+
+ALIGN	32
+$L$ctr32_loop8:
+	add	r8d,8
+	movdqa	xmm8,XMMWORD[96+rsp]
+DB	102,15,56,220,209
+	mov	r9d,r8d
+	movdqa	xmm9,XMMWORD[112+rsp]
+DB	102,15,56,220,217
+	bswap	r9d
+	movups	xmm0,XMMWORD[((32-128))+rcx]
+DB	102,15,56,220,225
+	xor	r9d,r11d
+	nop
+DB	102,15,56,220,233
+	mov	DWORD[((0+12))+rsp],r9d
+	lea	r9,[1+r8]
+DB	102,15,56,220,241
+DB	102,15,56,220,249
+DB	102,68,15,56,220,193
+DB	102,68,15,56,220,201
+	movups	xmm1,XMMWORD[((48-128))+rcx]
+	bswap	r9d
+DB	102,15,56,220,208
+DB	102,15,56,220,216
+	xor	r9d,r11d
+DB	0x66,0x90
+DB	102,15,56,220,224
+DB	102,15,56,220,232
+	mov	DWORD[((16+12))+rsp],r9d
+	lea	r9,[2+r8]
+DB	102,15,56,220,240
+DB	102,15,56,220,248
+DB	102,68,15,56,220,192
+DB	102,68,15,56,220,200
+	movups	xmm0,XMMWORD[((64-128))+rcx]
+	bswap	r9d
+DB	102,15,56,220,209
+DB	102,15,56,220,217
+	xor	r9d,r11d
+DB	0x66,0x90
+DB	102,15,56,220,225
+DB	102,15,56,220,233
+	mov	DWORD[((32+12))+rsp],r9d
+	lea	r9,[3+r8]
+DB	102,15,56,220,241
+DB	102,15,56,220,249
+DB	102,68,15,56,220,193
+DB	102,68,15,56,220,201
+	movups	xmm1,XMMWORD[((80-128))+rcx]
+	bswap	r9d
+DB	102,15,56,220,208
+DB	102,15,56,220,216
+	xor	r9d,r11d
+DB	0x66,0x90
+DB	102,15,56,220,224
+DB	102,15,56,220,232
+	mov	DWORD[((48+12))+rsp],r9d
+	lea	r9,[4+r8]
+DB	102,15,56,220,240
+DB	102,15,56,220,248
+DB	102,68,15,56,220,192
+DB	102,68,15,56,220,200
+	movups	xmm0,XMMWORD[((96-128))+rcx]
+	bswap	r9d
+DB	102,15,56,220,209
+DB	102,15,56,220,217
+	xor	r9d,r11d
+DB	0x66,0x90
+DB	102,15,56,220,225
+DB	102,15,56,220,233
+	mov	DWORD[((64+12))+rsp],r9d
+	lea	r9,[5+r8]
+DB	102,15,56,220,241
+DB	102,15,56,220,249
+DB	102,68,15,56,220,193
+DB	102,68,15,56,220,201
+	movups	xmm1,XMMWORD[((112-128))+rcx]
+	bswap	r9d
+DB	102,15,56,220,208
+DB	102,15,56,220,216
+	xor	r9d,r11d
+DB	0x66,0x90
+DB	102,15,56,220,224
+DB	102,15,56,220,232
+	mov	DWORD[((80+12))+rsp],r9d
+	lea	r9,[6+r8]
+DB	102,15,56,220,240
+DB	102,15,56,220,248
+DB	102,68,15,56,220,192
+DB	102,68,15,56,220,200
+	movups	xmm0,XMMWORD[((128-128))+rcx]
+	bswap	r9d
+DB	102,15,56,220,209
+DB	102,15,56,220,217
+	xor	r9d,r11d
+DB	0x66,0x90
+DB	102,15,56,220,225
+DB	102,15,56,220,233
+	mov	DWORD[((96+12))+rsp],r9d
+	lea	r9,[7+r8]
+DB	102,15,56,220,241
+DB	102,15,56,220,249
+DB	102,68,15,56,220,193
+DB	102,68,15,56,220,201
+	movups	xmm1,XMMWORD[((144-128))+rcx]
+	bswap	r9d
+DB	102,15,56,220,208
+DB	102,15,56,220,216
+DB	102,15,56,220,224
+	xor	r9d,r11d
+	movdqu	xmm10,XMMWORD[rdi]
+DB	102,15,56,220,232
+	mov	DWORD[((112+12))+rsp],r9d
+	cmp	eax,11
+DB	102,15,56,220,240
+DB	102,15,56,220,248
+DB	102,68,15,56,220,192
+DB	102,68,15,56,220,200
+	movups	xmm0,XMMWORD[((160-128))+rcx]
+
+	jb	NEAR $L$ctr32_enc_done
+
+DB	102,15,56,220,209
+DB	102,15,56,220,217
+DB	102,15,56,220,225
+DB	102,15,56,220,233
+DB	102,15,56,220,241
+DB	102,15,56,220,249
+DB	102,68,15,56,220,193
+DB	102,68,15,56,220,201
+	movups	xmm1,XMMWORD[((176-128))+rcx]
+
+DB	102,15,56,220,208
+DB	102,15,56,220,216
+DB	102,15,56,220,224
+DB	102,15,56,220,232
+DB	102,15,56,220,240
+DB	102,15,56,220,248
+DB	102,68,15,56,220,192
+DB	102,68,15,56,220,200
+	movups	xmm0,XMMWORD[((192-128))+rcx]
+	je	NEAR $L$ctr32_enc_done
+
+DB	102,15,56,220,209
+DB	102,15,56,220,217
+DB	102,15,56,220,225
+DB	102,15,56,220,233
+DB	102,15,56,220,241
+DB	102,15,56,220,249
+DB	102,68,15,56,220,193
+DB	102,68,15,56,220,201
+	movups	xmm1,XMMWORD[((208-128))+rcx]
+
+DB	102,15,56,220,208
+DB	102,15,56,220,216
+DB	102,15,56,220,224
+DB	102,15,56,220,232
+DB	102,15,56,220,240
+DB	102,15,56,220,248
+DB	102,68,15,56,220,192
+DB	102,68,15,56,220,200
+	movups	xmm0,XMMWORD[((224-128))+rcx]
+	jmp	NEAR $L$ctr32_enc_done
+
+ALIGN	16
+$L$ctr32_enc_done:
+	movdqu	xmm11,XMMWORD[16+rdi]
+	pxor	xmm10,xmm0
+	movdqu	xmm12,XMMWORD[32+rdi]
+	pxor	xmm11,xmm0
+	movdqu	xmm13,XMMWORD[48+rdi]
+	pxor	xmm12,xmm0
+	movdqu	xmm14,XMMWORD[64+rdi]
+	pxor	xmm13,xmm0
+	movdqu	xmm15,XMMWORD[80+rdi]
+	pxor	xmm14,xmm0
+	pxor	xmm15,xmm0
+DB	102,15,56,220,209
+DB	102,15,56,220,217
+DB	102,15,56,220,225
+DB	102,15,56,220,233
+DB	102,15,56,220,241
+DB	102,15,56,220,249
+DB	102,68,15,56,220,193
+DB	102,68,15,56,220,201
+	movdqu	xmm1,XMMWORD[96+rdi]
+	lea	rdi,[128+rdi]
+
+DB	102,65,15,56,221,210
+	pxor	xmm1,xmm0
+	movdqu	xmm10,XMMWORD[((112-128))+rdi]
+DB	102,65,15,56,221,219
+	pxor	xmm10,xmm0
+	movdqa	xmm11,XMMWORD[rsp]
+DB	102,65,15,56,221,228
+DB	102,65,15,56,221,237
+	movdqa	xmm12,XMMWORD[16+rsp]
+	movdqa	xmm13,XMMWORD[32+rsp]
+DB	102,65,15,56,221,246
+DB	102,65,15,56,221,255
+	movdqa	xmm14,XMMWORD[48+rsp]
+	movdqa	xmm15,XMMWORD[64+rsp]
+DB	102,68,15,56,221,193
+	movdqa	xmm0,XMMWORD[80+rsp]
+	movups	xmm1,XMMWORD[((16-128))+rcx]
+DB	102,69,15,56,221,202
+
+	movups	XMMWORD[rsi],xmm2
+	movdqa	xmm2,xmm11
+	movups	XMMWORD[16+rsi],xmm3
+	movdqa	xmm3,xmm12
+	movups	XMMWORD[32+rsi],xmm4
+	movdqa	xmm4,xmm13
+	movups	XMMWORD[48+rsi],xmm5
+	movdqa	xmm5,xmm14
+	movups	XMMWORD[64+rsi],xmm6
+	movdqa	xmm6,xmm15
+	movups	XMMWORD[80+rsi],xmm7
+	movdqa	xmm7,xmm0
+	movups	XMMWORD[96+rsi],xmm8
+	movups	XMMWORD[112+rsi],xmm9
+	lea	rsi,[128+rsi]
+
+	sub	rdx,8
+	jnc	NEAR $L$ctr32_loop8
+
+	add	rdx,8
+	jz	NEAR $L$ctr32_done
+	lea	rcx,[((-128))+rcx]
+
+$L$ctr32_tail:
+
+
+	lea	rcx,[16+rcx]
+	cmp	rdx,4
+	jb	NEAR $L$ctr32_loop3
+	je	NEAR $L$ctr32_loop4
+
+
+	shl	eax,4
+	movdqa	xmm8,XMMWORD[96+rsp]
+	pxor	xmm9,xmm9
+
+	movups	xmm0,XMMWORD[16+rcx]
+DB	102,15,56,220,209
+DB	102,15,56,220,217
+	lea	rcx,[((32-16))+rax*1+rcx]
+	neg	rax
+DB	102,15,56,220,225
+	add	rax,16
+	movups	xmm10,XMMWORD[rdi]
+DB	102,15,56,220,233
+DB	102,15,56,220,241
+	movups	xmm11,XMMWORD[16+rdi]
+	movups	xmm12,XMMWORD[32+rdi]
+DB	102,15,56,220,249
+DB	102,68,15,56,220,193
+
+	call	$L$enc_loop8_enter
+
+	movdqu	xmm13,XMMWORD[48+rdi]
+	pxor	xmm2,xmm10
+	movdqu	xmm10,XMMWORD[64+rdi]
+	pxor	xmm3,xmm11
+	movdqu	XMMWORD[rsi],xmm2
+	pxor	xmm4,xmm12
+	movdqu	XMMWORD[16+rsi],xmm3
+	pxor	xmm5,xmm13
+	movdqu	XMMWORD[32+rsi],xmm4
+	pxor	xmm6,xmm10
+	movdqu	XMMWORD[48+rsi],xmm5
+	movdqu	XMMWORD[64+rsi],xmm6
+	cmp	rdx,6
+	jb	NEAR $L$ctr32_done
+
+	movups	xmm11,XMMWORD[80+rdi]
+	xorps	xmm7,xmm11
+	movups	XMMWORD[80+rsi],xmm7
+	je	NEAR $L$ctr32_done
+
+	movups	xmm12,XMMWORD[96+rdi]
+	xorps	xmm8,xmm12
+	movups	XMMWORD[96+rsi],xmm8
+	jmp	NEAR $L$ctr32_done
+
+ALIGN	32
+$L$ctr32_loop4:
+DB	102,15,56,220,209
+	lea	rcx,[16+rcx]
+	dec	eax
+DB	102,15,56,220,217
+DB	102,15,56,220,225
+DB	102,15,56,220,233
+	movups	xmm1,XMMWORD[rcx]
+	jnz	NEAR $L$ctr32_loop4
+DB	102,15,56,221,209
+DB	102,15,56,221,217
+	movups	xmm10,XMMWORD[rdi]
+	movups	xmm11,XMMWORD[16+rdi]
+DB	102,15,56,221,225
+DB	102,15,56,221,233
+	movups	xmm12,XMMWORD[32+rdi]
+	movups	xmm13,XMMWORD[48+rdi]
+
+	xorps	xmm2,xmm10
+	movups	XMMWORD[rsi],xmm2
+	xorps	xmm3,xmm11
+	movups	XMMWORD[16+rsi],xmm3
+	pxor	xmm4,xmm12
+	movdqu	XMMWORD[32+rsi],xmm4
+	pxor	xmm5,xmm13
+	movdqu	XMMWORD[48+rsi],xmm5
+	jmp	NEAR $L$ctr32_done
+
+ALIGN	32
+$L$ctr32_loop3:
+DB	102,15,56,220,209
+	lea	rcx,[16+rcx]
+	dec	eax
+DB	102,15,56,220,217
+DB	102,15,56,220,225
+	movups	xmm1,XMMWORD[rcx]
+	jnz	NEAR $L$ctr32_loop3
+DB	102,15,56,221,209
+DB	102,15,56,221,217
+DB	102,15,56,221,225
+
+	movups	xmm10,XMMWORD[rdi]
+	xorps	xmm2,xmm10
+	movups	XMMWORD[rsi],xmm2
+	cmp	rdx,2
+	jb	NEAR $L$ctr32_done
+
+	movups	xmm11,XMMWORD[16+rdi]
+	xorps	xmm3,xmm11
+	movups	XMMWORD[16+rsi],xmm3
+	je	NEAR $L$ctr32_done
+
+	movups	xmm12,XMMWORD[32+rdi]
+	xorps	xmm4,xmm12
+	movups	XMMWORD[32+rsi],xmm4
+
+$L$ctr32_done:
+	xorps	xmm0,xmm0
+	xor	r11d,r11d
+	pxor	xmm1,xmm1
+	pxor	xmm2,xmm2
+	pxor	xmm3,xmm3
+	pxor	xmm4,xmm4
+	pxor	xmm5,xmm5
+	movaps	xmm6,XMMWORD[((-160))+rbp]
+	movaps	XMMWORD[(-160)+rbp],xmm0
+	movaps	xmm7,XMMWORD[((-144))+rbp]
+	movaps	XMMWORD[(-144)+rbp],xmm0
+	movaps	xmm8,XMMWORD[((-128))+rbp]
+	movaps	XMMWORD[(-128)+rbp],xmm0
+	movaps	xmm9,XMMWORD[((-112))+rbp]
+	movaps	XMMWORD[(-112)+rbp],xmm0
+	movaps	xmm10,XMMWORD[((-96))+rbp]
+	movaps	XMMWORD[(-96)+rbp],xmm0
+	movaps	xmm11,XMMWORD[((-80))+rbp]
+	movaps	XMMWORD[(-80)+rbp],xmm0
+	movaps	xmm12,XMMWORD[((-64))+rbp]
+	movaps	XMMWORD[(-64)+rbp],xmm0
+	movaps	xmm13,XMMWORD[((-48))+rbp]
+	movaps	XMMWORD[(-48)+rbp],xmm0
+	movaps	xmm14,XMMWORD[((-32))+rbp]
+	movaps	XMMWORD[(-32)+rbp],xmm0
+	movaps	xmm15,XMMWORD[((-16))+rbp]
+	movaps	XMMWORD[(-16)+rbp],xmm0
+	movaps	XMMWORD[rsp],xmm0
+	movaps	XMMWORD[16+rsp],xmm0
+	movaps	XMMWORD[32+rsp],xmm0
+	movaps	XMMWORD[48+rsp],xmm0
+	movaps	XMMWORD[64+rsp],xmm0
+	movaps	XMMWORD[80+rsp],xmm0
+	movaps	XMMWORD[96+rsp],xmm0
+	movaps	XMMWORD[112+rsp],xmm0
+	lea	rsp,[rbp]
+	pop	rbp
+$L$ctr32_epilogue:
+	mov	rdi,QWORD[8+rsp]	;WIN64 epilogue
+	mov	rsi,QWORD[16+rsp]
+	DB	0F3h,0C3h		;repret
+$L$SEH_end_aesni_ctr32_encrypt_blocks:
+global	aesni_xts_encrypt
+
+ALIGN	16
+aesni_xts_encrypt:
+	mov	QWORD[8+rsp],rdi	;WIN64 prologue
+	mov	QWORD[16+rsp],rsi
+	mov	rax,rsp
+$L$SEH_begin_aesni_xts_encrypt:
+	mov	rdi,rcx
+	mov	rsi,rdx
+	mov	rdx,r8
+	mov	rcx,r9
+	mov	r8,QWORD[40+rsp]
+	mov	r9,QWORD[48+rsp]
+
+
+	lea	rax,[rsp]
+	push	rbp
+	sub	rsp,272
+	and	rsp,-16
+	movaps	XMMWORD[(-168)+rax],xmm6
+	movaps	XMMWORD[(-152)+rax],xmm7
+	movaps	XMMWORD[(-136)+rax],xmm8
+	movaps	XMMWORD[(-120)+rax],xmm9
+	movaps	XMMWORD[(-104)+rax],xmm10
+	movaps	XMMWORD[(-88)+rax],xmm11
+	movaps	XMMWORD[(-72)+rax],xmm12
+	movaps	XMMWORD[(-56)+rax],xmm13
+	movaps	XMMWORD[(-40)+rax],xmm14
+	movaps	XMMWORD[(-24)+rax],xmm15
+$L$xts_enc_body:
+	lea	rbp,[((-8))+rax]
+	movups	xmm2,XMMWORD[r9]
+	mov	eax,DWORD[240+r8]
+	mov	r10d,DWORD[240+rcx]
+	movups	xmm0,XMMWORD[r8]
+	movups	xmm1,XMMWORD[16+r8]
+	lea	r8,[32+r8]
+	xorps	xmm2,xmm0
+$L$oop_enc1_8:
+DB	102,15,56,220,209
+	dec	eax
+	movups	xmm1,XMMWORD[r8]
+	lea	r8,[16+r8]
+	jnz	NEAR $L$oop_enc1_8
+DB	102,15,56,221,209
+	movups	xmm0,XMMWORD[rcx]
+	mov	r11,rcx
+	mov	eax,r10d
+	shl	r10d,4
+	mov	r9,rdx
+	and	rdx,-16
+
+	movups	xmm1,XMMWORD[16+r10*1+rcx]
+
+	movdqa	xmm8,XMMWORD[$L$xts_magic]
+	movdqa	xmm15,xmm2
+	pshufd	xmm9,xmm2,0x5f
+	pxor	xmm1,xmm0
+	movdqa	xmm14,xmm9
+	paddd	xmm9,xmm9
+	movdqa	xmm10,xmm15
+	psrad	xmm14,31
+	paddq	xmm15,xmm15
+	pand	xmm14,xmm8
+	pxor	xmm10,xmm0
+	pxor	xmm15,xmm14
+	movdqa	xmm14,xmm9
+	paddd	xmm9,xmm9
+	movdqa	xmm11,xmm15
+	psrad	xmm14,31
+	paddq	xmm15,xmm15
+	pand	xmm14,xmm8
+	pxor	xmm11,xmm0
+	pxor	xmm15,xmm14
+	movdqa	xmm14,xmm9
+	paddd	xmm9,xmm9
+	movdqa	xmm12,xmm15
+	psrad	xmm14,31
+	paddq	xmm15,xmm15
+	pand	xmm14,xmm8
+	pxor	xmm12,xmm0
+	pxor	xmm15,xmm14
+	movdqa	xmm14,xmm9
+	paddd	xmm9,xmm9
+	movdqa	xmm13,xmm15
+	psrad	xmm14,31
+	paddq	xmm15,xmm15
+	pand	xmm14,xmm8
+	pxor	xmm13,xmm0
+	pxor	xmm15,xmm14
+	movdqa	xmm14,xmm15
+	psrad	xmm9,31
+	paddq	xmm15,xmm15
+	pand	xmm9,xmm8
+	pxor	xmm14,xmm0
+	pxor	xmm15,xmm9
+	movaps	XMMWORD[96+rsp],xmm1
+
+	sub	rdx,16*6
+	jc	NEAR $L$xts_enc_short
+
+	mov	eax,16+96
+	lea	rcx,[32+r10*1+r11]
+	sub	rax,r10
+	movups	xmm1,XMMWORD[16+r11]
+	mov	r10,rax
+	lea	r8,[$L$xts_magic]
+	jmp	NEAR $L$xts_enc_grandloop
+
+ALIGN	32
+$L$xts_enc_grandloop:
+	movdqu	xmm2,XMMWORD[rdi]
+	movdqa	xmm8,xmm0
+	movdqu	xmm3,XMMWORD[16+rdi]
+	pxor	xmm2,xmm10
+	movdqu	xmm4,XMMWORD[32+rdi]
+	pxor	xmm3,xmm11
+DB	102,15,56,220,209
+	movdqu	xmm5,XMMWORD[48+rdi]
+	pxor	xmm4,xmm12
+DB	102,15,56,220,217
+	movdqu	xmm6,XMMWORD[64+rdi]
+	pxor	xmm5,xmm13
+DB	102,15,56,220,225
+	movdqu	xmm7,XMMWORD[80+rdi]
+	pxor	xmm8,xmm15
+	movdqa	xmm9,XMMWORD[96+rsp]
+	pxor	xmm6,xmm14
+DB	102,15,56,220,233
+	movups	xmm0,XMMWORD[32+r11]
+	lea	rdi,[96+rdi]
+	pxor	xmm7,xmm8
+
+	pxor	xmm10,xmm9
+DB	102,15,56,220,241
+	pxor	xmm11,xmm9
+	movdqa	XMMWORD[rsp],xmm10
+DB	102,15,56,220,249
+	movups	xmm1,XMMWORD[48+r11]
+	pxor	xmm12,xmm9
+
+DB	102,15,56,220,208
+	pxor	xmm13,xmm9
+	movdqa	XMMWORD[16+rsp],xmm11
+DB	102,15,56,220,216
+	pxor	xmm14,xmm9
+	movdqa	XMMWORD[32+rsp],xmm12
+DB	102,15,56,220,224
+DB	102,15,56,220,232
+	pxor	xmm8,xmm9
+	movdqa	XMMWORD[64+rsp],xmm14
+DB	102,15,56,220,240
+DB	102,15,56,220,248
+	movups	xmm0,XMMWORD[64+r11]
+	movdqa	XMMWORD[80+rsp],xmm8
+	pshufd	xmm9,xmm15,0x5f
+	jmp	NEAR $L$xts_enc_loop6
+ALIGN	32
+$L$xts_enc_loop6:
+DB	102,15,56,220,209
+DB	102,15,56,220,217
+DB	102,15,56,220,225
+DB	102,15,56,220,233
+DB	102,15,56,220,241
+DB	102,15,56,220,249
+	movups	xmm1,XMMWORD[((-64))+rax*1+rcx]
+	add	rax,32
+
+DB	102,15,56,220,208
+DB	102,15,56,220,216
+DB	102,15,56,220,224
+DB	102,15,56,220,232
+DB	102,15,56,220,240
+DB	102,15,56,220,248
+	movups	xmm0,XMMWORD[((-80))+rax*1+rcx]
+	jnz	NEAR $L$xts_enc_loop6
+
+	movdqa	xmm8,XMMWORD[r8]
+	movdqa	xmm14,xmm9
+	paddd	xmm9,xmm9
+DB	102,15,56,220,209
+	paddq	xmm15,xmm15
+	psrad	xmm14,31
+DB	102,15,56,220,217
+	pand	xmm14,xmm8
+	movups	xmm10,XMMWORD[r11]
+DB	102,15,56,220,225
+DB	102,15,56,220,233
+DB	102,15,56,220,241
+	pxor	xmm15,xmm14
+	movaps	xmm11,xmm10
+DB	102,15,56,220,249
+	movups	xmm1,XMMWORD[((-64))+rcx]
+
+	movdqa	xmm14,xmm9
+DB	102,15,56,220,208
+	paddd	xmm9,xmm9
+	pxor	xmm10,xmm15
+DB	102,15,56,220,216
+	psrad	xmm14,31
+	paddq	xmm15,xmm15
+DB	102,15,56,220,224
+DB	102,15,56,220,232
+	pand	xmm14,xmm8
+	movaps	xmm12,xmm11
+DB	102,15,56,220,240
+	pxor	xmm15,xmm14
+	movdqa	xmm14,xmm9
+DB	102,15,56,220,248
+	movups	xmm0,XMMWORD[((-48))+rcx]
+
+	paddd	xmm9,xmm9
+DB	102,15,56,220,209
+	pxor	xmm11,xmm15
+	psrad	xmm14,31
+DB	102,15,56,220,217
+	paddq	xmm15,xmm15
+	pand	xmm14,xmm8
+DB	102,15,56,220,225
+DB	102,15,56,220,233
+	movdqa	XMMWORD[48+rsp],xmm13
+	pxor	xmm15,xmm14
+DB	102,15,56,220,241
+	movaps	xmm13,xmm12
+	movdqa	xmm14,xmm9
+DB	102,15,56,220,249
+	movups	xmm1,XMMWORD[((-32))+rcx]
+
+	paddd	xmm9,xmm9
+DB	102,15,56,220,208
+	pxor	xmm12,xmm15
+	psrad	xmm14,31
+DB	102,15,56,220,216
+	paddq	xmm15,xmm15
+	pand	xmm14,xmm8
+DB	102,15,56,220,224
+DB	102,15,56,220,232
+DB	102,15,56,220,240
+	pxor	xmm15,xmm14
+	movaps	xmm14,xmm13
+DB	102,15,56,220,248
+
+	movdqa	xmm0,xmm9
+	paddd	xmm9,xmm9
+DB	102,15,56,220,209
+	pxor	xmm13,xmm15
+	psrad	xmm0,31
+DB	102,15,56,220,217
+	paddq	xmm15,xmm15
+	pand	xmm0,xmm8
+DB	102,15,56,220,225
+DB	102,15,56,220,233
+	pxor	xmm15,xmm0
+	movups	xmm0,XMMWORD[r11]
+DB	102,15,56,220,241
+DB	102,15,56,220,249
+	movups	xmm1,XMMWORD[16+r11]
+
+	pxor	xmm14,xmm15
+DB	102,15,56,221,84,36,0
+	psrad	xmm9,31
+	paddq	xmm15,xmm15
+DB	102,15,56,221,92,36,16
+DB	102,15,56,221,100,36,32
+	pand	xmm9,xmm8
+	mov	rax,r10
+DB	102,15,56,221,108,36,48
+DB	102,15,56,221,116,36,64
+DB	102,15,56,221,124,36,80
+	pxor	xmm15,xmm9
+
+	lea	rsi,[96+rsi]
+	movups	XMMWORD[(-96)+rsi],xmm2
+	movups	XMMWORD[(-80)+rsi],xmm3
+	movups	XMMWORD[(-64)+rsi],xmm4
+	movups	XMMWORD[(-48)+rsi],xmm5
+	movups	XMMWORD[(-32)+rsi],xmm6
+	movups	XMMWORD[(-16)+rsi],xmm7
+	sub	rdx,16*6
+	jnc	NEAR $L$xts_enc_grandloop
+
+	mov	eax,16+96
+	sub	eax,r10d
+	mov	rcx,r11
+	shr	eax,4
+
+$L$xts_enc_short:
+
+	mov	r10d,eax
+	pxor	xmm10,xmm0
+	add	rdx,16*6
+	jz	NEAR $L$xts_enc_done
+
+	pxor	xmm11,xmm0
+	cmp	rdx,0x20
+	jb	NEAR $L$xts_enc_one
+	pxor	xmm12,xmm0
+	je	NEAR $L$xts_enc_two
+
+	pxor	xmm13,xmm0
+	cmp	rdx,0x40
+	jb	NEAR $L$xts_enc_three
+	pxor	xmm14,xmm0
+	je	NEAR $L$xts_enc_four
+
+	movdqu	xmm2,XMMWORD[rdi]
+	movdqu	xmm3,XMMWORD[16+rdi]
+	movdqu	xmm4,XMMWORD[32+rdi]
+	pxor	xmm2,xmm10
+	movdqu	xmm5,XMMWORD[48+rdi]
+	pxor	xmm3,xmm11
+	movdqu	xmm6,XMMWORD[64+rdi]
+	lea	rdi,[80+rdi]
+	pxor	xmm4,xmm12
+	pxor	xmm5,xmm13
+	pxor	xmm6,xmm14
+	pxor	xmm7,xmm7
+
+	call	_aesni_encrypt6
+
+	xorps	xmm2,xmm10
+	movdqa	xmm10,xmm15
+	xorps	xmm3,xmm11
+	xorps	xmm4,xmm12
+	movdqu	XMMWORD[rsi],xmm2
+	xorps	xmm5,xmm13
+	movdqu	XMMWORD[16+rsi],xmm3
+	xorps	xmm6,xmm14
+	movdqu	XMMWORD[32+rsi],xmm4
+	movdqu	XMMWORD[48+rsi],xmm5
+	movdqu	XMMWORD[64+rsi],xmm6
+	lea	rsi,[80+rsi]
+	jmp	NEAR $L$xts_enc_done
+
+ALIGN	16
+$L$xts_enc_one:
+	movups	xmm2,XMMWORD[rdi]
+	lea	rdi,[16+rdi]
+	xorps	xmm2,xmm10
+	movups	xmm0,XMMWORD[rcx]
+	movups	xmm1,XMMWORD[16+rcx]
+	lea	rcx,[32+rcx]
+	xorps	xmm2,xmm0
+$L$oop_enc1_9:
+DB	102,15,56,220,209
+	dec	eax
+	movups	xmm1,XMMWORD[rcx]
+	lea	rcx,[16+rcx]
+	jnz	NEAR $L$oop_enc1_9
+DB	102,15,56,221,209
+	xorps	xmm2,xmm10
+	movdqa	xmm10,xmm11
+	movups	XMMWORD[rsi],xmm2
+	lea	rsi,[16+rsi]
+	jmp	NEAR $L$xts_enc_done
+
+ALIGN	16
+$L$xts_enc_two:
+	movups	xmm2,XMMWORD[rdi]
+	movups	xmm3,XMMWORD[16+rdi]
+	lea	rdi,[32+rdi]
+	xorps	xmm2,xmm10
+	xorps	xmm3,xmm11
+
+	call	_aesni_encrypt2
+
+	xorps	xmm2,xmm10
+	movdqa	xmm10,xmm12
+	xorps	xmm3,xmm11
+	movups	XMMWORD[rsi],xmm2
+	movups	XMMWORD[16+rsi],xmm3
+	lea	rsi,[32+rsi]
+	jmp	NEAR $L$xts_enc_done
+
+ALIGN	16
+$L$xts_enc_three:
+	movups	xmm2,XMMWORD[rdi]
+	movups	xmm3,XMMWORD[16+rdi]
+	movups	xmm4,XMMWORD[32+rdi]
+	lea	rdi,[48+rdi]
+	xorps	xmm2,xmm10
+	xorps	xmm3,xmm11
+	xorps	xmm4,xmm12
+
+	call	_aesni_encrypt3
+
+	xorps	xmm2,xmm10
+	movdqa	xmm10,xmm13
+	xorps	xmm3,xmm11
+	xorps	xmm4,xmm12
+	movups	XMMWORD[rsi],xmm2
+	movups	XMMWORD[16+rsi],xmm3
+	movups	XMMWORD[32+rsi],xmm4
+	lea	rsi,[48+rsi]
+	jmp	NEAR $L$xts_enc_done
+
+ALIGN	16
+$L$xts_enc_four:
+	movups	xmm2,XMMWORD[rdi]
+	movups	xmm3,XMMWORD[16+rdi]
+	movups	xmm4,XMMWORD[32+rdi]
+	xorps	xmm2,xmm10
+	movups	xmm5,XMMWORD[48+rdi]
+	lea	rdi,[64+rdi]
+	xorps	xmm3,xmm11
+	xorps	xmm4,xmm12
+	xorps	xmm5,xmm13
+
+	call	_aesni_encrypt4
+
+	pxor	xmm2,xmm10
+	movdqa	xmm10,xmm14
+	pxor	xmm3,xmm11
+	pxor	xmm4,xmm12
+	movdqu	XMMWORD[rsi],xmm2
+	pxor	xmm5,xmm13
+	movdqu	XMMWORD[16+rsi],xmm3
+	movdqu	XMMWORD[32+rsi],xmm4
+	movdqu	XMMWORD[48+rsi],xmm5
+	lea	rsi,[64+rsi]
+	jmp	NEAR $L$xts_enc_done
+
+ALIGN	16
+$L$xts_enc_done:
+	and	r9,15
+	jz	NEAR $L$xts_enc_ret
+	mov	rdx,r9
+
+$L$xts_enc_steal:
+	movzx	eax,BYTE[rdi]
+	movzx	ecx,BYTE[((-16))+rsi]
+	lea	rdi,[1+rdi]
+	mov	BYTE[((-16))+rsi],al
+	mov	BYTE[rsi],cl
+	lea	rsi,[1+rsi]
+	sub	rdx,1
+	jnz	NEAR $L$xts_enc_steal
+
+	sub	rsi,r9
+	mov	rcx,r11
+	mov	eax,r10d
+
+	movups	xmm2,XMMWORD[((-16))+rsi]
+	xorps	xmm2,xmm10
+	movups	xmm0,XMMWORD[rcx]
+	movups	xmm1,XMMWORD[16+rcx]
+	lea	rcx,[32+rcx]
+	xorps	xmm2,xmm0
+$L$oop_enc1_10:
+DB	102,15,56,220,209
+	dec	eax
+	movups	xmm1,XMMWORD[rcx]
+	lea	rcx,[16+rcx]
+	jnz	NEAR $L$oop_enc1_10
+DB	102,15,56,221,209
+	xorps	xmm2,xmm10
+	movups	XMMWORD[(-16)+rsi],xmm2
+
+$L$xts_enc_ret:
+	xorps	xmm0,xmm0
+	pxor	xmm1,xmm1
+	pxor	xmm2,xmm2
+	pxor	xmm3,xmm3
+	pxor	xmm4,xmm4
+	pxor	xmm5,xmm5
+	movaps	xmm6,XMMWORD[((-160))+rbp]
+	movaps	XMMWORD[(-160)+rbp],xmm0
+	movaps	xmm7,XMMWORD[((-144))+rbp]
+	movaps	XMMWORD[(-144)+rbp],xmm0
+	movaps	xmm8,XMMWORD[((-128))+rbp]
+	movaps	XMMWORD[(-128)+rbp],xmm0
+	movaps	xmm9,XMMWORD[((-112))+rbp]
+	movaps	XMMWORD[(-112)+rbp],xmm0
+	movaps	xmm10,XMMWORD[((-96))+rbp]
+	movaps	XMMWORD[(-96)+rbp],xmm0
+	movaps	xmm11,XMMWORD[((-80))+rbp]
+	movaps	XMMWORD[(-80)+rbp],xmm0
+	movaps	xmm12,XMMWORD[((-64))+rbp]
+	movaps	XMMWORD[(-64)+rbp],xmm0
+	movaps	xmm13,XMMWORD[((-48))+rbp]
+	movaps	XMMWORD[(-48)+rbp],xmm0
+	movaps	xmm14,XMMWORD[((-32))+rbp]
+	movaps	XMMWORD[(-32)+rbp],xmm0
+	movaps	xmm15,XMMWORD[((-16))+rbp]
+	movaps	XMMWORD[(-16)+rbp],xmm0
+	movaps	XMMWORD[rsp],xmm0
+	movaps	XMMWORD[16+rsp],xmm0
+	movaps	XMMWORD[32+rsp],xmm0
+	movaps	XMMWORD[48+rsp],xmm0
+	movaps	XMMWORD[64+rsp],xmm0
+	movaps	XMMWORD[80+rsp],xmm0
+	movaps	XMMWORD[96+rsp],xmm0
+	lea	rsp,[rbp]
+	pop	rbp
+$L$xts_enc_epilogue:
+	mov	rdi,QWORD[8+rsp]	;WIN64 epilogue
+	mov	rsi,QWORD[16+rsp]
+	DB	0F3h,0C3h		;repret
+$L$SEH_end_aesni_xts_encrypt:
+global	aesni_xts_decrypt
+
+ALIGN	16
+aesni_xts_decrypt:
+	mov	QWORD[8+rsp],rdi	;WIN64 prologue
+	mov	QWORD[16+rsp],rsi
+	mov	rax,rsp
+$L$SEH_begin_aesni_xts_decrypt:
+	mov	rdi,rcx
+	mov	rsi,rdx
+	mov	rdx,r8
+	mov	rcx,r9
+	mov	r8,QWORD[40+rsp]
+	mov	r9,QWORD[48+rsp]
+
+
+	lea	rax,[rsp]
+	push	rbp
+	sub	rsp,272
+	and	rsp,-16
+	movaps	XMMWORD[(-168)+rax],xmm6
+	movaps	XMMWORD[(-152)+rax],xmm7
+	movaps	XMMWORD[(-136)+rax],xmm8
+	movaps	XMMWORD[(-120)+rax],xmm9
+	movaps	XMMWORD[(-104)+rax],xmm10
+	movaps	XMMWORD[(-88)+rax],xmm11
+	movaps	XMMWORD[(-72)+rax],xmm12
+	movaps	XMMWORD[(-56)+rax],xmm13
+	movaps	XMMWORD[(-40)+rax],xmm14
+	movaps	XMMWORD[(-24)+rax],xmm15
+$L$xts_dec_body:
+	lea	rbp,[((-8))+rax]
+	movups	xmm2,XMMWORD[r9]
+	mov	eax,DWORD[240+r8]
+	mov	r10d,DWORD[240+rcx]
+	movups	xmm0,XMMWORD[r8]
+	movups	xmm1,XMMWORD[16+r8]
+	lea	r8,[32+r8]
+	xorps	xmm2,xmm0
+$L$oop_enc1_11:
+DB	102,15,56,220,209
+	dec	eax
+	movups	xmm1,XMMWORD[r8]
+	lea	r8,[16+r8]
+	jnz	NEAR $L$oop_enc1_11
+DB	102,15,56,221,209
+	xor	eax,eax
+	test	rdx,15
+	setnz	al
+	shl	rax,4
+	sub	rdx,rax
+
+	movups	xmm0,XMMWORD[rcx]
+	mov	r11,rcx
+	mov	eax,r10d
+	shl	r10d,4
+	mov	r9,rdx
+	and	rdx,-16
+
+	movups	xmm1,XMMWORD[16+r10*1+rcx]
+
+	movdqa	xmm8,XMMWORD[$L$xts_magic]
+	movdqa	xmm15,xmm2
+	pshufd	xmm9,xmm2,0x5f
+	pxor	xmm1,xmm0
+	movdqa	xmm14,xmm9
+	paddd	xmm9,xmm9
+	movdqa	xmm10,xmm15
+	psrad	xmm14,31
+	paddq	xmm15,xmm15
+	pand	xmm14,xmm8
+	pxor	xmm10,xmm0
+	pxor	xmm15,xmm14
+	movdqa	xmm14,xmm9
+	paddd	xmm9,xmm9
+	movdqa	xmm11,xmm15
+	psrad	xmm14,31
+	paddq	xmm15,xmm15
+	pand	xmm14,xmm8
+	pxor	xmm11,xmm0
+	pxor	xmm15,xmm14
+	movdqa	xmm14,xmm9
+	paddd	xmm9,xmm9
+	movdqa	xmm12,xmm15
+	psrad	xmm14,31
+	paddq	xmm15,xmm15
+	pand	xmm14,xmm8
+	pxor	xmm12,xmm0
+	pxor	xmm15,xmm14
+	movdqa	xmm14,xmm9
+	paddd	xmm9,xmm9
+	movdqa	xmm13,xmm15
+	psrad	xmm14,31
+	paddq	xmm15,xmm15
+	pand	xmm14,xmm8
+	pxor	xmm13,xmm0
+	pxor	xmm15,xmm14
+	movdqa	xmm14,xmm15
+	psrad	xmm9,31
+	paddq	xmm15,xmm15
+	pand	xmm9,xmm8
+	pxor	xmm14,xmm0
+	pxor	xmm15,xmm9
+	movaps	XMMWORD[96+rsp],xmm1
+
+	sub	rdx,16*6
+	jc	NEAR $L$xts_dec_short
+
+	mov	eax,16+96
+	lea	rcx,[32+r10*1+r11]
+	sub	rax,r10
+	movups	xmm1,XMMWORD[16+r11]
+	mov	r10,rax
+	lea	r8,[$L$xts_magic]
+	jmp	NEAR $L$xts_dec_grandloop
+
+ALIGN	32
+$L$xts_dec_grandloop:
+	movdqu	xmm2,XMMWORD[rdi]
+	movdqa	xmm8,xmm0
+	movdqu	xmm3,XMMWORD[16+rdi]
+	pxor	xmm2,xmm10
+	movdqu	xmm4,XMMWORD[32+rdi]
+	pxor	xmm3,xmm11
+DB	102,15,56,222,209
+	movdqu	xmm5,XMMWORD[48+rdi]
+	pxor	xmm4,xmm12
+DB	102,15,56,222,217
+	movdqu	xmm6,XMMWORD[64+rdi]
+	pxor	xmm5,xmm13
+DB	102,15,56,222,225
+	movdqu	xmm7,XMMWORD[80+rdi]
+	pxor	xmm8,xmm15
+	movdqa	xmm9,XMMWORD[96+rsp]
+	pxor	xmm6,xmm14
+DB	102,15,56,222,233
+	movups	xmm0,XMMWORD[32+r11]
+	lea	rdi,[96+rdi]
+	pxor	xmm7,xmm8
+
+	pxor	xmm10,xmm9
+DB	102,15,56,222,241
+	pxor	xmm11,xmm9
+	movdqa	XMMWORD[rsp],xmm10
+DB	102,15,56,222,249
+	movups	xmm1,XMMWORD[48+r11]
+	pxor	xmm12,xmm9
+
+DB	102,15,56,222,208
+	pxor	xmm13,xmm9
+	movdqa	XMMWORD[16+rsp],xmm11
+DB	102,15,56,222,216
+	pxor	xmm14,xmm9
+	movdqa	XMMWORD[32+rsp],xmm12
+DB	102,15,56,222,224
+DB	102,15,56,222,232
+	pxor	xmm8,xmm9
+	movdqa	XMMWORD[64+rsp],xmm14
+DB	102,15,56,222,240
+DB	102,15,56,222,248
+	movups	xmm0,XMMWORD[64+r11]
+	movdqa	XMMWORD[80+rsp],xmm8
+	pshufd	xmm9,xmm15,0x5f
+	jmp	NEAR $L$xts_dec_loop6
+ALIGN	32
+$L$xts_dec_loop6:
+DB	102,15,56,222,209
+DB	102,15,56,222,217
+DB	102,15,56,222,225
+DB	102,15,56,222,233
+DB	102,15,56,222,241
+DB	102,15,56,222,249
+	movups	xmm1,XMMWORD[((-64))+rax*1+rcx]
+	add	rax,32
+
+DB	102,15,56,222,208
+DB	102,15,56,222,216
+DB	102,15,56,222,224
+DB	102,15,56,222,232
+DB	102,15,56,222,240
+DB	102,15,56,222,248
+	movups	xmm0,XMMWORD[((-80))+rax*1+rcx]
+	jnz	NEAR $L$xts_dec_loop6
+
+	movdqa	xmm8,XMMWORD[r8]
+	movdqa	xmm14,xmm9
+	paddd	xmm9,xmm9
+DB	102,15,56,222,209
+	paddq	xmm15,xmm15
+	psrad	xmm14,31
+DB	102,15,56,222,217
+	pand	xmm14,xmm8
+	movups	xmm10,XMMWORD[r11]
+DB	102,15,56,222,225
+DB	102,15,56,222,233
+DB	102,15,56,222,241
+	pxor	xmm15,xmm14
+	movaps	xmm11,xmm10
+DB	102,15,56,222,249
+	movups	xmm1,XMMWORD[((-64))+rcx]
+
+	movdqa	xmm14,xmm9
+DB	102,15,56,222,208
+	paddd	xmm9,xmm9
+	pxor	xmm10,xmm15
+DB	102,15,56,222,216
+	psrad	xmm14,31
+	paddq	xmm15,xmm15
+DB	102,15,56,222,224
+DB	102,15,56,222,232
+	pand	xmm14,xmm8
+	movaps	xmm12,xmm11
+DB	102,15,56,222,240
+	pxor	xmm15,xmm14
+	movdqa	xmm14,xmm9
+DB	102,15,56,222,248
+	movups	xmm0,XMMWORD[((-48))+rcx]
+
+	paddd	xmm9,xmm9
+DB	102,15,56,222,209
+	pxor	xmm11,xmm15
+	psrad	xmm14,31
+DB	102,15,56,222,217
+	paddq	xmm15,xmm15
+	pand	xmm14,xmm8
+DB	102,15,56,222,225
+DB	102,15,56,222,233
+	movdqa	XMMWORD[48+rsp],xmm13
+	pxor	xmm15,xmm14
+DB	102,15,56,222,241
+	movaps	xmm13,xmm12
+	movdqa	xmm14,xmm9
+DB	102,15,56,222,249
+	movups	xmm1,XMMWORD[((-32))+rcx]
+
+	paddd	xmm9,xmm9
+DB	102,15,56,222,208
+	pxor	xmm12,xmm15
+	psrad	xmm14,31
+DB	102,15,56,222,216
+	paddq	xmm15,xmm15
+	pand	xmm14,xmm8
+DB	102,15,56,222,224
+DB	102,15,56,222,232
+DB	102,15,56,222,240
+	pxor	xmm15,xmm14
+	movaps	xmm14,xmm13
+DB	102,15,56,222,248
+
+	movdqa	xmm0,xmm9
+	paddd	xmm9,xmm9
+DB	102,15,56,222,209
+	pxor	xmm13,xmm15
+	psrad	xmm0,31
+DB	102,15,56,222,217
+	paddq	xmm15,xmm15
+	pand	xmm0,xmm8
+DB	102,15,56,222,225
+DB	102,15,56,222,233
+	pxor	xmm15,xmm0
+	movups	xmm0,XMMWORD[r11]
+DB	102,15,56,222,241
+DB	102,15,56,222,249
+	movups	xmm1,XMMWORD[16+r11]
+
+	pxor	xmm14,xmm15
+DB	102,15,56,223,84,36,0
+	psrad	xmm9,31
+	paddq	xmm15,xmm15
+DB	102,15,56,223,92,36,16
+DB	102,15,56,223,100,36,32
+	pand	xmm9,xmm8
+	mov	rax,r10
+DB	102,15,56,223,108,36,48
+DB	102,15,56,223,116,36,64
+DB	102,15,56,223,124,36,80
+	pxor	xmm15,xmm9
+
+	lea	rsi,[96+rsi]
+	movups	XMMWORD[(-96)+rsi],xmm2
+	movups	XMMWORD[(-80)+rsi],xmm3
+	movups	XMMWORD[(-64)+rsi],xmm4
+	movups	XMMWORD[(-48)+rsi],xmm5
+	movups	XMMWORD[(-32)+rsi],xmm6
+	movups	XMMWORD[(-16)+rsi],xmm7
+	sub	rdx,16*6
+	jnc	NEAR $L$xts_dec_grandloop
+
+	mov	eax,16+96
+	sub	eax,r10d
+	mov	rcx,r11
+	shr	eax,4
+
+$L$xts_dec_short:
+
+	mov	r10d,eax
+	pxor	xmm10,xmm0
+	pxor	xmm11,xmm0
+	add	rdx,16*6
+	jz	NEAR $L$xts_dec_done
+
+	pxor	xmm12,xmm0
+	cmp	rdx,0x20
+	jb	NEAR $L$xts_dec_one
+	pxor	xmm13,xmm0
+	je	NEAR $L$xts_dec_two
+
+	pxor	xmm14,xmm0
+	cmp	rdx,0x40
+	jb	NEAR $L$xts_dec_three
+	je	NEAR $L$xts_dec_four
+
+	movdqu	xmm2,XMMWORD[rdi]
+	movdqu	xmm3,XMMWORD[16+rdi]
+	movdqu	xmm4,XMMWORD[32+rdi]
+	pxor	xmm2,xmm10
+	movdqu	xmm5,XMMWORD[48+rdi]
+	pxor	xmm3,xmm11
+	movdqu	xmm6,XMMWORD[64+rdi]
+	lea	rdi,[80+rdi]
+	pxor	xmm4,xmm12
+	pxor	xmm5,xmm13
+	pxor	xmm6,xmm14
+
+	call	_aesni_decrypt6
+
+	xorps	xmm2,xmm10
+	xorps	xmm3,xmm11
+	xorps	xmm4,xmm12
+	movdqu	XMMWORD[rsi],xmm2
+	xorps	xmm5,xmm13
+	movdqu	XMMWORD[16+rsi],xmm3
+	xorps	xmm6,xmm14
+	movdqu	XMMWORD[32+rsi],xmm4
+	pxor	xmm14,xmm14
+	movdqu	XMMWORD[48+rsi],xmm5
+	pcmpgtd	xmm14,xmm15
+	movdqu	XMMWORD[64+rsi],xmm6
+	lea	rsi,[80+rsi]
+	pshufd	xmm11,xmm14,0x13
+	and	r9,15
+	jz	NEAR $L$xts_dec_ret
+
+	movdqa	xmm10,xmm15
+	paddq	xmm15,xmm15
+	pand	xmm11,xmm8
+	pxor	xmm11,xmm15
+	jmp	NEAR $L$xts_dec_done2
+
+ALIGN	16
+$L$xts_dec_one:
+	movups	xmm2,XMMWORD[rdi]
+	lea	rdi,[16+rdi]
+	xorps	xmm2,xmm10
+	movups	xmm0,XMMWORD[rcx]
+	movups	xmm1,XMMWORD[16+rcx]
+	lea	rcx,[32+rcx]
+	xorps	xmm2,xmm0
+$L$oop_dec1_12:
+DB	102,15,56,222,209
+	dec	eax
+	movups	xmm1,XMMWORD[rcx]
+	lea	rcx,[16+rcx]
+	jnz	NEAR $L$oop_dec1_12
+DB	102,15,56,223,209
+	xorps	xmm2,xmm10
+	movdqa	xmm10,xmm11
+	movups	XMMWORD[rsi],xmm2
+	movdqa	xmm11,xmm12
+	lea	rsi,[16+rsi]
+	jmp	NEAR $L$xts_dec_done
+
+ALIGN	16
+$L$xts_dec_two:
+	movups	xmm2,XMMWORD[rdi]
+	movups	xmm3,XMMWORD[16+rdi]
+	lea	rdi,[32+rdi]
+	xorps	xmm2,xmm10
+	xorps	xmm3,xmm11
+
+	call	_aesni_decrypt2
+
+	xorps	xmm2,xmm10
+	movdqa	xmm10,xmm12
+	xorps	xmm3,xmm11
+	movdqa	xmm11,xmm13
+	movups	XMMWORD[rsi],xmm2
+	movups	XMMWORD[16+rsi],xmm3
+	lea	rsi,[32+rsi]
+	jmp	NEAR $L$xts_dec_done
+
+ALIGN	16
+$L$xts_dec_three:
+	movups	xmm2,XMMWORD[rdi]
+	movups	xmm3,XMMWORD[16+rdi]
+	movups	xmm4,XMMWORD[32+rdi]
+	lea	rdi,[48+rdi]
+	xorps	xmm2,xmm10
+	xorps	xmm3,xmm11
+	xorps	xmm4,xmm12
+
+	call	_aesni_decrypt3
+
+	xorps	xmm2,xmm10
+	movdqa	xmm10,xmm13
+	xorps	xmm3,xmm11
+	movdqa	xmm11,xmm14
+	xorps	xmm4,xmm12
+	movups	XMMWORD[rsi],xmm2
+	movups	XMMWORD[16+rsi],xmm3
+	movups	XMMWORD[32+rsi],xmm4
+	lea	rsi,[48+rsi]
+	jmp	NEAR $L$xts_dec_done
+
+ALIGN	16
+$L$xts_dec_four:
+	movups	xmm2,XMMWORD[rdi]
+	movups	xmm3,XMMWORD[16+rdi]
+	movups	xmm4,XMMWORD[32+rdi]
+	xorps	xmm2,xmm10
+	movups	xmm5,XMMWORD[48+rdi]
+	lea	rdi,[64+rdi]
+	xorps	xmm3,xmm11
+	xorps	xmm4,xmm12
+	xorps	xmm5,xmm13
+
+	call	_aesni_decrypt4
+
+	pxor	xmm2,xmm10
+	movdqa	xmm10,xmm14
+	pxor	xmm3,xmm11
+	movdqa	xmm11,xmm15
+	pxor	xmm4,xmm12
+	movdqu	XMMWORD[rsi],xmm2
+	pxor	xmm5,xmm13
+	movdqu	XMMWORD[16+rsi],xmm3
+	movdqu	XMMWORD[32+rsi],xmm4
+	movdqu	XMMWORD[48+rsi],xmm5
+	lea	rsi,[64+rsi]
+	jmp	NEAR $L$xts_dec_done
+
+ALIGN	16
+$L$xts_dec_done:
+	and	r9,15
+	jz	NEAR $L$xts_dec_ret
+$L$xts_dec_done2:
+	mov	rdx,r9
+	mov	rcx,r11
+	mov	eax,r10d
+
+	movups	xmm2,XMMWORD[rdi]
+	xorps	xmm2,xmm11
+	movups	xmm0,XMMWORD[rcx]
+	movups	xmm1,XMMWORD[16+rcx]
+	lea	rcx,[32+rcx]
+	xorps	xmm2,xmm0
+$L$oop_dec1_13:
+DB	102,15,56,222,209
+	dec	eax
+	movups	xmm1,XMMWORD[rcx]
+	lea	rcx,[16+rcx]
+	jnz	NEAR $L$oop_dec1_13
+DB	102,15,56,223,209
+	xorps	xmm2,xmm11
+	movups	XMMWORD[rsi],xmm2
+
+$L$xts_dec_steal:
+	movzx	eax,BYTE[16+rdi]
+	movzx	ecx,BYTE[rsi]
+	lea	rdi,[1+rdi]
+	mov	BYTE[rsi],al
+	mov	BYTE[16+rsi],cl
+	lea	rsi,[1+rsi]
+	sub	rdx,1
+	jnz	NEAR $L$xts_dec_steal
+
+	sub	rsi,r9
+	mov	rcx,r11
+	mov	eax,r10d
+
+	movups	xmm2,XMMWORD[rsi]
+	xorps	xmm2,xmm10
+	movups	xmm0,XMMWORD[rcx]
+	movups	xmm1,XMMWORD[16+rcx]
+	lea	rcx,[32+rcx]
+	xorps	xmm2,xmm0
+$L$oop_dec1_14:
+DB	102,15,56,222,209
+	dec	eax
+	movups	xmm1,XMMWORD[rcx]
+	lea	rcx,[16+rcx]
+	jnz	NEAR $L$oop_dec1_14
+DB	102,15,56,223,209
+	xorps	xmm2,xmm10
+	movups	XMMWORD[rsi],xmm2
+
+$L$xts_dec_ret:
+	xorps	xmm0,xmm0
+	pxor	xmm1,xmm1
+	pxor	xmm2,xmm2
+	pxor	xmm3,xmm3
+	pxor	xmm4,xmm4
+	pxor	xmm5,xmm5
+	movaps	xmm6,XMMWORD[((-160))+rbp]
+	movaps	XMMWORD[(-160)+rbp],xmm0
+	movaps	xmm7,XMMWORD[((-144))+rbp]
+	movaps	XMMWORD[(-144)+rbp],xmm0
+	movaps	xmm8,XMMWORD[((-128))+rbp]
+	movaps	XMMWORD[(-128)+rbp],xmm0
+	movaps	xmm9,XMMWORD[((-112))+rbp]
+	movaps	XMMWORD[(-112)+rbp],xmm0
+	movaps	xmm10,XMMWORD[((-96))+rbp]
+	movaps	XMMWORD[(-96)+rbp],xmm0
+	movaps	xmm11,XMMWORD[((-80))+rbp]
+	movaps	XMMWORD[(-80)+rbp],xmm0
+	movaps	xmm12,XMMWORD[((-64))+rbp]
+	movaps	XMMWORD[(-64)+rbp],xmm0
+	movaps	xmm13,XMMWORD[((-48))+rbp]
+	movaps	XMMWORD[(-48)+rbp],xmm0
+	movaps	xmm14,XMMWORD[((-32))+rbp]
+	movaps	XMMWORD[(-32)+rbp],xmm0
+	movaps	xmm15,XMMWORD[((-16))+rbp]
+	movaps	XMMWORD[(-16)+rbp],xmm0
+	movaps	XMMWORD[rsp],xmm0
+	movaps	XMMWORD[16+rsp],xmm0
+	movaps	XMMWORD[32+rsp],xmm0
+	movaps	XMMWORD[48+rsp],xmm0
+	movaps	XMMWORD[64+rsp],xmm0
+	movaps	XMMWORD[80+rsp],xmm0
+	movaps	XMMWORD[96+rsp],xmm0
+	lea	rsp,[rbp]
+	pop	rbp
+$L$xts_dec_epilogue:
+	mov	rdi,QWORD[8+rsp]	;WIN64 epilogue
+	mov	rsi,QWORD[16+rsp]
+	DB	0F3h,0C3h		;repret
+$L$SEH_end_aesni_xts_decrypt:
+global	aesni_cbc_encrypt
+
+ALIGN	16
+aesni_cbc_encrypt:
+	mov	QWORD[8+rsp],rdi	;WIN64 prologue
+	mov	QWORD[16+rsp],rsi
+	mov	rax,rsp
+$L$SEH_begin_aesni_cbc_encrypt:
+	mov	rdi,rcx
+	mov	rsi,rdx
+	mov	rdx,r8
+	mov	rcx,r9
+	mov	r8,QWORD[40+rsp]
+	mov	r9,QWORD[48+rsp]
+
+
+	test	rdx,rdx
+	jz	NEAR $L$cbc_ret
+
+	mov	r10d,DWORD[240+rcx]
+	mov	r11,rcx
+	test	r9d,r9d
+	jz	NEAR $L$cbc_decrypt
+
+	movups	xmm2,XMMWORD[r8]
+	mov	eax,r10d
+	cmp	rdx,16
+	jb	NEAR $L$cbc_enc_tail
+	sub	rdx,16
+	jmp	NEAR $L$cbc_enc_loop
+ALIGN	16
+$L$cbc_enc_loop:
+	movups	xmm3,XMMWORD[rdi]
+	lea	rdi,[16+rdi]
+
+	movups	xmm0,XMMWORD[rcx]
+	movups	xmm1,XMMWORD[16+rcx]
+	xorps	xmm3,xmm0
+	lea	rcx,[32+rcx]
+	xorps	xmm2,xmm3
+$L$oop_enc1_15:
+DB	102,15,56,220,209
+	dec	eax
+	movups	xmm1,XMMWORD[rcx]
+	lea	rcx,[16+rcx]
+	jnz	NEAR $L$oop_enc1_15
+DB	102,15,56,221,209
+	mov	eax,r10d
+	mov	rcx,r11
+	movups	XMMWORD[rsi],xmm2
+	lea	rsi,[16+rsi]
+	sub	rdx,16
+	jnc	NEAR $L$cbc_enc_loop
+	add	rdx,16
+	jnz	NEAR $L$cbc_enc_tail
+	pxor	xmm0,xmm0
+	pxor	xmm1,xmm1
+	movups	XMMWORD[r8],xmm2
+	pxor	xmm2,xmm2
+	pxor	xmm3,xmm3
+	jmp	NEAR $L$cbc_ret
+
+$L$cbc_enc_tail:
+	mov	rcx,rdx
+	xchg	rsi,rdi
+	DD	0x9066A4F3
+	mov	ecx,16
+	sub	rcx,rdx
+	xor	eax,eax
+	DD	0x9066AAF3
+	lea	rdi,[((-16))+rdi]
+	mov	eax,r10d
+	mov	rsi,rdi
+	mov	rcx,r11
+	xor	rdx,rdx
+	jmp	NEAR $L$cbc_enc_loop
+
+ALIGN	16
+$L$cbc_decrypt:
+	cmp	rdx,16
+	jne	NEAR $L$cbc_decrypt_bulk
+
+
+
+	movdqu	xmm2,XMMWORD[rdi]
+	movdqu	xmm3,XMMWORD[r8]
+	movdqa	xmm4,xmm2
+	movups	xmm0,XMMWORD[rcx]
+	movups	xmm1,XMMWORD[16+rcx]
+	lea	rcx,[32+rcx]
+	xorps	xmm2,xmm0
+$L$oop_dec1_16:
+DB	102,15,56,222,209
+	dec	r10d
+	movups	xmm1,XMMWORD[rcx]
+	lea	rcx,[16+rcx]
+	jnz	NEAR $L$oop_dec1_16
+DB	102,15,56,223,209
+	pxor	xmm0,xmm0
+	pxor	xmm1,xmm1
+	movdqu	XMMWORD[r8],xmm4
+	xorps	xmm2,xmm3
+	pxor	xmm3,xmm3
+	movups	XMMWORD[rsi],xmm2
+	pxor	xmm2,xmm2
+	jmp	NEAR $L$cbc_ret
+ALIGN	16
+$L$cbc_decrypt_bulk:
+	lea	rax,[rsp]
+	push	rbp
+	sub	rsp,176
+	and	rsp,-16
+	movaps	XMMWORD[16+rsp],xmm6
+	movaps	XMMWORD[32+rsp],xmm7
+	movaps	XMMWORD[48+rsp],xmm8
+	movaps	XMMWORD[64+rsp],xmm9
+	movaps	XMMWORD[80+rsp],xmm10
+	movaps	XMMWORD[96+rsp],xmm11
+	movaps	XMMWORD[112+rsp],xmm12
+	movaps	XMMWORD[128+rsp],xmm13
+	movaps	XMMWORD[144+rsp],xmm14
+	movaps	XMMWORD[160+rsp],xmm15
+$L$cbc_decrypt_body:
+	lea	rbp,[((-8))+rax]
+	movups	xmm10,XMMWORD[r8]
+	mov	eax,r10d
+	cmp	rdx,0x50
+	jbe	NEAR $L$cbc_dec_tail
+
+	movups	xmm0,XMMWORD[rcx]
+	movdqu	xmm2,XMMWORD[rdi]
+	movdqu	xmm3,XMMWORD[16+rdi]
+	movdqa	xmm11,xmm2
+	movdqu	xmm4,XMMWORD[32+rdi]
+	movdqa	xmm12,xmm3
+	movdqu	xmm5,XMMWORD[48+rdi]
+	movdqa	xmm13,xmm4
+	movdqu	xmm6,XMMWORD[64+rdi]
+	movdqa	xmm14,xmm5
+	movdqu	xmm7,XMMWORD[80+rdi]
+	movdqa	xmm15,xmm6
+	mov	r9d,DWORD[((OPENSSL_ia32cap_P+4))]
+	cmp	rdx,0x70
+	jbe	NEAR $L$cbc_dec_six_or_seven
+
+	and	r9d,71303168
+	sub	rdx,0x50
+	cmp	r9d,4194304
+	je	NEAR $L$cbc_dec_loop6_enter
+	sub	rdx,0x20
+	lea	rcx,[112+rcx]
+	jmp	NEAR $L$cbc_dec_loop8_enter
+ALIGN	16
+$L$cbc_dec_loop8:
+	movups	XMMWORD[rsi],xmm9
+	lea	rsi,[16+rsi]
+$L$cbc_dec_loop8_enter:
+	movdqu	xmm8,XMMWORD[96+rdi]
+	pxor	xmm2,xmm0
+	movdqu	xmm9,XMMWORD[112+rdi]
+	pxor	xmm3,xmm0
+	movups	xmm1,XMMWORD[((16-112))+rcx]
+	pxor	xmm4,xmm0
+	xor	r11,r11
+	cmp	rdx,0x70
+	pxor	xmm5,xmm0
+	pxor	xmm6,xmm0
+	pxor	xmm7,xmm0
+	pxor	xmm8,xmm0
+
+DB	102,15,56,222,209
+	pxor	xmm9,xmm0
+	movups	xmm0,XMMWORD[((32-112))+rcx]
+DB	102,15,56,222,217
+DB	102,15,56,222,225
+DB	102,15,56,222,233
+DB	102,15,56,222,241
+DB	102,15,56,222,249
+DB	102,68,15,56,222,193
+	setnc	r11b
+	shl	r11,7
+DB	102,68,15,56,222,201
+	add	r11,rdi
+	movups	xmm1,XMMWORD[((48-112))+rcx]
+DB	102,15,56,222,208
+DB	102,15,56,222,216
+DB	102,15,56,222,224
+DB	102,15,56,222,232
+DB	102,15,56,222,240
+DB	102,15,56,222,248
+DB	102,68,15,56,222,192
+DB	102,68,15,56,222,200
+	movups	xmm0,XMMWORD[((64-112))+rcx]
+	nop
+DB	102,15,56,222,209
+DB	102,15,56,222,217
+DB	102,15,56,222,225
+DB	102,15,56,222,233
+DB	102,15,56,222,241
+DB	102,15,56,222,249
+DB	102,68,15,56,222,193
+DB	102,68,15,56,222,201
+	movups	xmm1,XMMWORD[((80-112))+rcx]
+	nop
+DB	102,15,56,222,208
+DB	102,15,56,222,216
+DB	102,15,56,222,224
+DB	102,15,56,222,232
+DB	102,15,56,222,240
+DB	102,15,56,222,248
+DB	102,68,15,56,222,192
+DB	102,68,15,56,222,200
+	movups	xmm0,XMMWORD[((96-112))+rcx]
+	nop
+DB	102,15,56,222,209
+DB	102,15,56,222,217
+DB	102,15,56,222,225
+DB	102,15,56,222,233
+DB	102,15,56,222,241
+DB	102,15,56,222,249
+DB	102,68,15,56,222,193
+DB	102,68,15,56,222,201
+	movups	xmm1,XMMWORD[((112-112))+rcx]
+	nop
+DB	102,15,56,222,208
+DB	102,15,56,222,216
+DB	102,15,56,222,224
+DB	102,15,56,222,232
+DB	102,15,56,222,240
+DB	102,15,56,222,248
+DB	102,68,15,56,222,192
+DB	102,68,15,56,222,200
+	movups	xmm0,XMMWORD[((128-112))+rcx]
+	nop
+DB	102,15,56,222,209
+DB	102,15,56,222,217
+DB	102,15,56,222,225
+DB	102,15,56,222,233
+DB	102,15,56,222,241
+DB	102,15,56,222,249
+DB	102,68,15,56,222,193
+DB	102,68,15,56,222,201
+	movups	xmm1,XMMWORD[((144-112))+rcx]
+	cmp	eax,11
+DB	102,15,56,222,208
+DB	102,15,56,222,216
+DB	102,15,56,222,224
+DB	102,15,56,222,232
+DB	102,15,56,222,240
+DB	102,15,56,222,248
+DB	102,68,15,56,222,192
+DB	102,68,15,56,222,200
+	movups	xmm0,XMMWORD[((160-112))+rcx]
+	jb	NEAR $L$cbc_dec_done
+DB	102,15,56,222,209
+DB	102,15,56,222,217
+DB	102,15,56,222,225
+DB	102,15,56,222,233
+DB	102,15,56,222,241
+DB	102,15,56,222,249
+DB	102,68,15,56,222,193
+DB	102,68,15,56,222,201
+	movups	xmm1,XMMWORD[((176-112))+rcx]
+	nop
+DB	102,15,56,222,208
+DB	102,15,56,222,216
+DB	102,15,56,222,224
+DB	102,15,56,222,232
+DB	102,15,56,222,240
+DB	102,15,56,222,248
+DB	102,68,15,56,222,192
+DB	102,68,15,56,222,200
+	movups	xmm0,XMMWORD[((192-112))+rcx]
+	je	NEAR $L$cbc_dec_done
+DB	102,15,56,222,209
+DB	102,15,56,222,217
+DB	102,15,56,222,225
+DB	102,15,56,222,233
+DB	102,15,56,222,241
+DB	102,15,56,222,249
+DB	102,68,15,56,222,193
+DB	102,68,15,56,222,201
+	movups	xmm1,XMMWORD[((208-112))+rcx]
+	nop
+DB	102,15,56,222,208
+DB	102,15,56,222,216
+DB	102,15,56,222,224
+DB	102,15,56,222,232
+DB	102,15,56,222,240
+DB	102,15,56,222,248
+DB	102,68,15,56,222,192
+DB	102,68,15,56,222,200
+	movups	xmm0,XMMWORD[((224-112))+rcx]
+	jmp	NEAR $L$cbc_dec_done
+ALIGN	16
+$L$cbc_dec_done:
+DB	102,15,56,222,209
+DB	102,15,56,222,217
+	pxor	xmm10,xmm0
+	pxor	xmm11,xmm0
+DB	102,15,56,222,225
+DB	102,15,56,222,233
+	pxor	xmm12,xmm0
+	pxor	xmm13,xmm0
+DB	102,15,56,222,241
+DB	102,15,56,222,249
+	pxor	xmm14,xmm0
+	pxor	xmm15,xmm0
+DB	102,68,15,56,222,193
+DB	102,68,15,56,222,201
+	movdqu	xmm1,XMMWORD[80+rdi]
+
+DB	102,65,15,56,223,210
+	movdqu	xmm10,XMMWORD[96+rdi]
+	pxor	xmm1,xmm0
+DB	102,65,15,56,223,219
+	pxor	xmm10,xmm0
+	movdqu	xmm0,XMMWORD[112+rdi]
+DB	102,65,15,56,223,228
+	lea	rdi,[128+rdi]
+	movdqu	xmm11,XMMWORD[r11]
+DB	102,65,15,56,223,237
+DB	102,65,15,56,223,246
+	movdqu	xmm12,XMMWORD[16+r11]
+	movdqu	xmm13,XMMWORD[32+r11]
+DB	102,65,15,56,223,255
+DB	102,68,15,56,223,193
+	movdqu	xmm14,XMMWORD[48+r11]
+	movdqu	xmm15,XMMWORD[64+r11]
+DB	102,69,15,56,223,202
+	movdqa	xmm10,xmm0
+	movdqu	xmm1,XMMWORD[80+r11]
+	movups	xmm0,XMMWORD[((-112))+rcx]
+
+	movups	XMMWORD[rsi],xmm2
+	movdqa	xmm2,xmm11
+	movups	XMMWORD[16+rsi],xmm3
+	movdqa	xmm3,xmm12
+	movups	XMMWORD[32+rsi],xmm4
+	movdqa	xmm4,xmm13
+	movups	XMMWORD[48+rsi],xmm5
+	movdqa	xmm5,xmm14
+	movups	XMMWORD[64+rsi],xmm6
+	movdqa	xmm6,xmm15
+	movups	XMMWORD[80+rsi],xmm7
+	movdqa	xmm7,xmm1
+	movups	XMMWORD[96+rsi],xmm8
+	lea	rsi,[112+rsi]
+
+	sub	rdx,0x80
+	ja	NEAR $L$cbc_dec_loop8
+
+	movaps	xmm2,xmm9
+	lea	rcx,[((-112))+rcx]
+	add	rdx,0x70
+	jle	NEAR $L$cbc_dec_clear_tail_collected
+	movups	XMMWORD[rsi],xmm9
+	lea	rsi,[16+rsi]
+	cmp	rdx,0x50
+	jbe	NEAR $L$cbc_dec_tail
+
+	movaps	xmm2,xmm11
+$L$cbc_dec_six_or_seven:
+	cmp	rdx,0x60
+	ja	NEAR $L$cbc_dec_seven
+
+	movaps	xmm8,xmm7
+	call	_aesni_decrypt6
+	pxor	xmm2,xmm10
+	movaps	xmm10,xmm8
+	pxor	xmm3,xmm11
+	movdqu	XMMWORD[rsi],xmm2
+	pxor	xmm4,xmm12
+	movdqu	XMMWORD[16+rsi],xmm3
+	pxor	xmm3,xmm3
+	pxor	xmm5,xmm13
+	movdqu	XMMWORD[32+rsi],xmm4
+	pxor	xmm4,xmm4
+	pxor	xmm6,xmm14
+	movdqu	XMMWORD[48+rsi],xmm5
+	pxor	xmm5,xmm5
+	pxor	xmm7,xmm15
+	movdqu	XMMWORD[64+rsi],xmm6
+	pxor	xmm6,xmm6
+	lea	rsi,[80+rsi]
+	movdqa	xmm2,xmm7
+	pxor	xmm7,xmm7
+	jmp	NEAR $L$cbc_dec_tail_collected
+
+ALIGN	16
+$L$cbc_dec_seven:
+	movups	xmm8,XMMWORD[96+rdi]
+	xorps	xmm9,xmm9
+	call	_aesni_decrypt8
+	movups	xmm9,XMMWORD[80+rdi]
+	pxor	xmm2,xmm10
+	movups	xmm10,XMMWORD[96+rdi]
+	pxor	xmm3,xmm11
+	movdqu	XMMWORD[rsi],xmm2
+	pxor	xmm4,xmm12
+	movdqu	XMMWORD[16+rsi],xmm3
+	pxor	xmm3,xmm3
+	pxor	xmm5,xmm13
+	movdqu	XMMWORD[32+rsi],xmm4
+	pxor	xmm4,xmm4
+	pxor	xmm6,xmm14
+	movdqu	XMMWORD[48+rsi],xmm5
+	pxor	xmm5,xmm5
+	pxor	xmm7,xmm15
+	movdqu	XMMWORD[64+rsi],xmm6
+	pxor	xmm6,xmm6
+	pxor	xmm8,xmm9
+	movdqu	XMMWORD[80+rsi],xmm7
+	pxor	xmm7,xmm7
+	lea	rsi,[96+rsi]
+	movdqa	xmm2,xmm8
+	pxor	xmm8,xmm8
+	pxor	xmm9,xmm9
+	jmp	NEAR $L$cbc_dec_tail_collected
+
+ALIGN	16
+$L$cbc_dec_loop6:
+	movups	XMMWORD[rsi],xmm7
+	lea	rsi,[16+rsi]
+	movdqu	xmm2,XMMWORD[rdi]
+	movdqu	xmm3,XMMWORD[16+rdi]
+	movdqa	xmm11,xmm2
+	movdqu	xmm4,XMMWORD[32+rdi]
+	movdqa	xmm12,xmm3
+	movdqu	xmm5,XMMWORD[48+rdi]
+	movdqa	xmm13,xmm4
+	movdqu	xmm6,XMMWORD[64+rdi]
+	movdqa	xmm14,xmm5
+	movdqu	xmm7,XMMWORD[80+rdi]
+	movdqa	xmm15,xmm6
+$L$cbc_dec_loop6_enter:
+	lea	rdi,[96+rdi]
+	movdqa	xmm8,xmm7
+
+	call	_aesni_decrypt6
+
+	pxor	xmm2,xmm10
+	movdqa	xmm10,xmm8
+	pxor	xmm3,xmm11
+	movdqu	XMMWORD[rsi],xmm2
+	pxor	xmm4,xmm12
+	movdqu	XMMWORD[16+rsi],xmm3
+	pxor	xmm5,xmm13
+	movdqu	XMMWORD[32+rsi],xmm4
+	pxor	xmm6,xmm14
+	mov	rcx,r11
+	movdqu	XMMWORD[48+rsi],xmm5
+	pxor	xmm7,xmm15
+	mov	eax,r10d
+	movdqu	XMMWORD[64+rsi],xmm6
+	lea	rsi,[80+rsi]
+	sub	rdx,0x60
+	ja	NEAR $L$cbc_dec_loop6
+
+	movdqa	xmm2,xmm7
+	add	rdx,0x50
+	jle	NEAR $L$cbc_dec_clear_tail_collected
+	movups	XMMWORD[rsi],xmm7
+	lea	rsi,[16+rsi]
+
+$L$cbc_dec_tail:
+	movups	xmm2,XMMWORD[rdi]
+	sub	rdx,0x10
+	jbe	NEAR $L$cbc_dec_one
+
+	movups	xmm3,XMMWORD[16+rdi]
+	movaps	xmm11,xmm2
+	sub	rdx,0x10
+	jbe	NEAR $L$cbc_dec_two
+
+	movups	xmm4,XMMWORD[32+rdi]
+	movaps	xmm12,xmm3
+	sub	rdx,0x10
+	jbe	NEAR $L$cbc_dec_three
+
+	movups	xmm5,XMMWORD[48+rdi]
+	movaps	xmm13,xmm4
+	sub	rdx,0x10
+	jbe	NEAR $L$cbc_dec_four
+
+	movups	xmm6,XMMWORD[64+rdi]
+	movaps	xmm14,xmm5
+	movaps	xmm15,xmm6
+	xorps	xmm7,xmm7
+	call	_aesni_decrypt6
+	pxor	xmm2,xmm10
+	movaps	xmm10,xmm15
+	pxor	xmm3,xmm11
+	movdqu	XMMWORD[rsi],xmm2
+	pxor	xmm4,xmm12
+	movdqu	XMMWORD[16+rsi],xmm3
+	pxor	xmm3,xmm3
+	pxor	xmm5,xmm13
+	movdqu	XMMWORD[32+rsi],xmm4
+	pxor	xmm4,xmm4
+	pxor	xmm6,xmm14
+	movdqu	XMMWORD[48+rsi],xmm5
+	pxor	xmm5,xmm5
+	lea	rsi,[64+rsi]
+	movdqa	xmm2,xmm6
+	pxor	xmm6,xmm6
+	pxor	xmm7,xmm7
+	sub	rdx,0x10
+	jmp	NEAR $L$cbc_dec_tail_collected
+
+ALIGN	16
+$L$cbc_dec_one:
+	movaps	xmm11,xmm2
+	movups	xmm0,XMMWORD[rcx]
+	movups	xmm1,XMMWORD[16+rcx]
+	lea	rcx,[32+rcx]
+	xorps	xmm2,xmm0
+$L$oop_dec1_17:
+DB	102,15,56,222,209
+	dec	eax
+	movups	xmm1,XMMWORD[rcx]
+	lea	rcx,[16+rcx]
+	jnz	NEAR $L$oop_dec1_17
+DB	102,15,56,223,209
+	xorps	xmm2,xmm10
+	movaps	xmm10,xmm11
+	jmp	NEAR $L$cbc_dec_tail_collected
+ALIGN	16
+$L$cbc_dec_two:
+	movaps	xmm12,xmm3
+	call	_aesni_decrypt2
+	pxor	xmm2,xmm10
+	movaps	xmm10,xmm12
+	pxor	xmm3,xmm11
+	movdqu	XMMWORD[rsi],xmm2
+	movdqa	xmm2,xmm3
+	pxor	xmm3,xmm3
+	lea	rsi,[16+rsi]
+	jmp	NEAR $L$cbc_dec_tail_collected
+ALIGN	16
+$L$cbc_dec_three:
+	movaps	xmm13,xmm4
+	call	_aesni_decrypt3
+	pxor	xmm2,xmm10
+	movaps	xmm10,xmm13
+	pxor	xmm3,xmm11
+	movdqu	XMMWORD[rsi],xmm2
+	pxor	xmm4,xmm12
+	movdqu	XMMWORD[16+rsi],xmm3
+	pxor	xmm3,xmm3
+	movdqa	xmm2,xmm4
+	pxor	xmm4,xmm4
+	lea	rsi,[32+rsi]
+	jmp	NEAR $L$cbc_dec_tail_collected
+ALIGN	16
+$L$cbc_dec_four:
+	movaps	xmm14,xmm5
+	call	_aesni_decrypt4
+	pxor	xmm2,xmm10
+	movaps	xmm10,xmm14
+	pxor	xmm3,xmm11
+	movdqu	XMMWORD[rsi],xmm2
+	pxor	xmm4,xmm12
+	movdqu	XMMWORD[16+rsi],xmm3
+	pxor	xmm3,xmm3
+	pxor	xmm5,xmm13
+	movdqu	XMMWORD[32+rsi],xmm4
+	pxor	xmm4,xmm4
+	movdqa	xmm2,xmm5
+	pxor	xmm5,xmm5
+	lea	rsi,[48+rsi]
+	jmp	NEAR $L$cbc_dec_tail_collected
+
+ALIGN	16
+$L$cbc_dec_clear_tail_collected:
+	pxor	xmm3,xmm3
+	pxor	xmm4,xmm4
+	pxor	xmm5,xmm5
+$L$cbc_dec_tail_collected:
+	movups	XMMWORD[r8],xmm10
+	and	rdx,15
+	jnz	NEAR $L$cbc_dec_tail_partial
+	movups	XMMWORD[rsi],xmm2
+	pxor	xmm2,xmm2
+	jmp	NEAR $L$cbc_dec_ret
+ALIGN	16
+$L$cbc_dec_tail_partial:
+	movaps	XMMWORD[rsp],xmm2
+	pxor	xmm2,xmm2
+	mov	rcx,16
+	mov	rdi,rsi
+	sub	rcx,rdx
+	lea	rsi,[rsp]
+	DD	0x9066A4F3
+	movdqa	XMMWORD[rsp],xmm2
+
+$L$cbc_dec_ret:
+	xorps	xmm0,xmm0
+	pxor	xmm1,xmm1
+	movaps	xmm6,XMMWORD[16+rsp]
+	movaps	XMMWORD[16+rsp],xmm0
+	movaps	xmm7,XMMWORD[32+rsp]
+	movaps	XMMWORD[32+rsp],xmm0
+	movaps	xmm8,XMMWORD[48+rsp]
+	movaps	XMMWORD[48+rsp],xmm0
+	movaps	xmm9,XMMWORD[64+rsp]
+	movaps	XMMWORD[64+rsp],xmm0
+	movaps	xmm10,XMMWORD[80+rsp]
+	movaps	XMMWORD[80+rsp],xmm0
+	movaps	xmm11,XMMWORD[96+rsp]
+	movaps	XMMWORD[96+rsp],xmm0
+	movaps	xmm12,XMMWORD[112+rsp]
+	movaps	XMMWORD[112+rsp],xmm0
+	movaps	xmm13,XMMWORD[128+rsp]
+	movaps	XMMWORD[128+rsp],xmm0
+	movaps	xmm14,XMMWORD[144+rsp]
+	movaps	XMMWORD[144+rsp],xmm0
+	movaps	xmm15,XMMWORD[160+rsp]
+	movaps	XMMWORD[160+rsp],xmm0
+	lea	rsp,[rbp]
+	pop	rbp
+$L$cbc_ret:
+	mov	rdi,QWORD[8+rsp]	;WIN64 epilogue
+	mov	rsi,QWORD[16+rsp]
+	DB	0F3h,0C3h		;repret
+$L$SEH_end_aesni_cbc_encrypt:
+global	aesni_set_decrypt_key
+
+ALIGN	16
+aesni_set_decrypt_key:
+DB	0x48,0x83,0xEC,0x08
+	call	__aesni_set_encrypt_key
+	shl	edx,4
+	test	eax,eax
+	jnz	NEAR $L$dec_key_ret
+	lea	rcx,[16+rdx*1+r8]
+
+	movups	xmm0,XMMWORD[r8]
+	movups	xmm1,XMMWORD[rcx]
+	movups	XMMWORD[rcx],xmm0
+	movups	XMMWORD[r8],xmm1
+	lea	r8,[16+r8]
+	lea	rcx,[((-16))+rcx]
+
+$L$dec_key_inverse:
+	movups	xmm0,XMMWORD[r8]
+	movups	xmm1,XMMWORD[rcx]
+DB	102,15,56,219,192
+DB	102,15,56,219,201
+	lea	r8,[16+r8]
+	lea	rcx,[((-16))+rcx]
+	movups	XMMWORD[16+rcx],xmm0
+	movups	XMMWORD[(-16)+r8],xmm1
+	cmp	rcx,r8
+	ja	NEAR $L$dec_key_inverse
+
+	movups	xmm0,XMMWORD[r8]
+DB	102,15,56,219,192
+	pxor	xmm1,xmm1
+	movups	XMMWORD[rcx],xmm0
+	pxor	xmm0,xmm0
+$L$dec_key_ret:
+	add	rsp,8
+	DB	0F3h,0C3h		;repret
+$L$SEH_end_set_decrypt_key:
+
+global	aesni_set_encrypt_key
+
+ALIGN	16
+aesni_set_encrypt_key:
+__aesni_set_encrypt_key:
+DB	0x48,0x83,0xEC,0x08
+	mov	rax,-1
+	test	rcx,rcx
+	jz	NEAR $L$enc_key_ret
+	test	r8,r8
+	jz	NEAR $L$enc_key_ret
+
+	mov	r10d,268437504
+	movups	xmm0,XMMWORD[rcx]
+	xorps	xmm4,xmm4
+	and	r10d,DWORD[((OPENSSL_ia32cap_P+4))]
+	lea	rax,[16+r8]
+	cmp	edx,256
+	je	NEAR $L$14rounds
+	cmp	edx,192
+	je	NEAR $L$12rounds
+	cmp	edx,128
+	jne	NEAR $L$bad_keybits
+
+$L$10rounds:
+	mov	edx,9
+	cmp	r10d,268435456
+	je	NEAR $L$10rounds_alt
+
+	movups	XMMWORD[r8],xmm0
+DB	102,15,58,223,200,1
+	call	$L$key_expansion_128_cold
+DB	102,15,58,223,200,2
+	call	$L$key_expansion_128
+DB	102,15,58,223,200,4
+	call	$L$key_expansion_128
+DB	102,15,58,223,200,8
+	call	$L$key_expansion_128
+DB	102,15,58,223,200,16
+	call	$L$key_expansion_128
+DB	102,15,58,223,200,32
+	call	$L$key_expansion_128
+DB	102,15,58,223,200,64
+	call	$L$key_expansion_128
+DB	102,15,58,223,200,128
+	call	$L$key_expansion_128
+DB	102,15,58,223,200,27
+	call	$L$key_expansion_128
+DB	102,15,58,223,200,54
+	call	$L$key_expansion_128
+	movups	XMMWORD[rax],xmm0
+	mov	DWORD[80+rax],edx
+	xor	eax,eax
+	jmp	NEAR $L$enc_key_ret
+
+ALIGN	16
+$L$10rounds_alt:
+	movdqa	xmm5,XMMWORD[$L$key_rotate]
+	mov	r10d,8
+	movdqa	xmm4,XMMWORD[$L$key_rcon1]
+	movdqa	xmm2,xmm0
+	movdqu	XMMWORD[r8],xmm0
+	jmp	NEAR $L$oop_key128
+
+ALIGN	16
+$L$oop_key128:
+DB	102,15,56,0,197
+DB	102,15,56,221,196
+	pslld	xmm4,1
+	lea	rax,[16+rax]
+
+	movdqa	xmm3,xmm2
+	pslldq	xmm2,4
+	pxor	xmm3,xmm2
+	pslldq	xmm2,4
+	pxor	xmm3,xmm2
+	pslldq	xmm2,4
+	pxor	xmm2,xmm3
+
+	pxor	xmm0,xmm2
+	movdqu	XMMWORD[(-16)+rax],xmm0
+	movdqa	xmm2,xmm0
+
+	dec	r10d
+	jnz	NEAR $L$oop_key128
+
+	movdqa	xmm4,XMMWORD[$L$key_rcon1b]
+
+DB	102,15,56,0,197
+DB	102,15,56,221,196
+	pslld	xmm4,1
+
+	movdqa	xmm3,xmm2
+	pslldq	xmm2,4
+	pxor	xmm3,xmm2
+	pslldq	xmm2,4
+	pxor	xmm3,xmm2
+	pslldq	xmm2,4
+	pxor	xmm2,xmm3
+
+	pxor	xmm0,xmm2
+	movdqu	XMMWORD[rax],xmm0
+
+	movdqa	xmm2,xmm0
+DB	102,15,56,0,197
+DB	102,15,56,221,196
+
+	movdqa	xmm3,xmm2
+	pslldq	xmm2,4
+	pxor	xmm3,xmm2
+	pslldq	xmm2,4
+	pxor	xmm3,xmm2
+	pslldq	xmm2,4
+	pxor	xmm2,xmm3
+
+	pxor	xmm0,xmm2
+	movdqu	XMMWORD[16+rax],xmm0
+
+	mov	DWORD[96+rax],edx
+	xor	eax,eax
+	jmp	NEAR $L$enc_key_ret
+
+ALIGN	16
+$L$12rounds:
+	movq	xmm2,QWORD[16+rcx]
+	mov	edx,11
+	cmp	r10d,268435456
+	je	NEAR $L$12rounds_alt
+
+	movups	XMMWORD[r8],xmm0
+DB	102,15,58,223,202,1
+	call	$L$key_expansion_192a_cold
+DB	102,15,58,223,202,2
+	call	$L$key_expansion_192b
+DB	102,15,58,223,202,4
+	call	$L$key_expansion_192a
+DB	102,15,58,223,202,8
+	call	$L$key_expansion_192b
+DB	102,15,58,223,202,16
+	call	$L$key_expansion_192a
+DB	102,15,58,223,202,32
+	call	$L$key_expansion_192b
+DB	102,15,58,223,202,64
+	call	$L$key_expansion_192a
+DB	102,15,58,223,202,128
+	call	$L$key_expansion_192b
+	movups	XMMWORD[rax],xmm0
+	mov	DWORD[48+rax],edx
+	xor	rax,rax
+	jmp	NEAR $L$enc_key_ret
+
+ALIGN	16
+$L$12rounds_alt:
+	movdqa	xmm5,XMMWORD[$L$key_rotate192]
+	movdqa	xmm4,XMMWORD[$L$key_rcon1]
+	mov	r10d,8
+	movdqu	XMMWORD[r8],xmm0
+	jmp	NEAR $L$oop_key192
+
+ALIGN	16
+$L$oop_key192:
+	movq	QWORD[rax],xmm2
+	movdqa	xmm1,xmm2
+DB	102,15,56,0,213
+DB	102,15,56,221,212
+	pslld	xmm4,1
+	lea	rax,[24+rax]
+
+	movdqa	xmm3,xmm0
+	pslldq	xmm0,4
+	pxor	xmm3,xmm0
+	pslldq	xmm0,4
+	pxor	xmm3,xmm0
+	pslldq	xmm0,4
+	pxor	xmm0,xmm3
+
+	pshufd	xmm3,xmm0,0xff
+	pxor	xmm3,xmm1
+	pslldq	xmm1,4
+	pxor	xmm3,xmm1
+
+	pxor	xmm0,xmm2
+	pxor	xmm2,xmm3
+	movdqu	XMMWORD[(-16)+rax],xmm0
+
+	dec	r10d
+	jnz	NEAR $L$oop_key192
+
+	mov	DWORD[32+rax],edx
+	xor	eax,eax
+	jmp	NEAR $L$enc_key_ret
+
+ALIGN	16
+$L$14rounds:
+	movups	xmm2,XMMWORD[16+rcx]
+	mov	edx,13
+	lea	rax,[16+rax]
+	cmp	r10d,268435456
+	je	NEAR $L$14rounds_alt
+
+	movups	XMMWORD[r8],xmm0
+	movups	XMMWORD[16+r8],xmm2
+DB	102,15,58,223,202,1
+	call	$L$key_expansion_256a_cold
+DB	102,15,58,223,200,1
+	call	$L$key_expansion_256b
+DB	102,15,58,223,202,2
+	call	$L$key_expansion_256a
+DB	102,15,58,223,200,2
+	call	$L$key_expansion_256b
+DB	102,15,58,223,202,4
+	call	$L$key_expansion_256a
+DB	102,15,58,223,200,4
+	call	$L$key_expansion_256b
+DB	102,15,58,223,202,8
+	call	$L$key_expansion_256a
+DB	102,15,58,223,200,8
+	call	$L$key_expansion_256b
+DB	102,15,58,223,202,16
+	call	$L$key_expansion_256a
+DB	102,15,58,223,200,16
+	call	$L$key_expansion_256b
+DB	102,15,58,223,202,32
+	call	$L$key_expansion_256a
+DB	102,15,58,223,200,32
+	call	$L$key_expansion_256b
+DB	102,15,58,223,202,64
+	call	$L$key_expansion_256a
+	movups	XMMWORD[rax],xmm0
+	mov	DWORD[16+rax],edx
+	xor	rax,rax
+	jmp	NEAR $L$enc_key_ret
+
+ALIGN	16
+$L$14rounds_alt:
+	movdqa	xmm5,XMMWORD[$L$key_rotate]
+	movdqa	xmm4,XMMWORD[$L$key_rcon1]
+	mov	r10d,7
+	movdqu	XMMWORD[r8],xmm0
+	movdqa	xmm1,xmm2
+	movdqu	XMMWORD[16+r8],xmm2
+	jmp	NEAR $L$oop_key256
+
+ALIGN	16
+$L$oop_key256:
+DB	102,15,56,0,213
+DB	102,15,56,221,212
+
+	movdqa	xmm3,xmm0
+	pslldq	xmm0,4
+	pxor	xmm3,xmm0
+	pslldq	xmm0,4
+	pxor	xmm3,xmm0
+	pslldq	xmm0,4
+	pxor	xmm0,xmm3
+	pslld	xmm4,1
+
+	pxor	xmm0,xmm2
+	movdqu	XMMWORD[rax],xmm0
+
+	dec	r10d
+	jz	NEAR $L$done_key256
+
+	pshufd	xmm2,xmm0,0xff
+	pxor	xmm3,xmm3
+DB	102,15,56,221,211
+
+	movdqa	xmm3,xmm1
+	pslldq	xmm1,4
+	pxor	xmm3,xmm1
+	pslldq	xmm1,4
+	pxor	xmm3,xmm1
+	pslldq	xmm1,4
+	pxor	xmm1,xmm3
+
+	pxor	xmm2,xmm1
+	movdqu	XMMWORD[16+rax],xmm2
+	lea	rax,[32+rax]
+	movdqa	xmm1,xmm2
+
+	jmp	NEAR $L$oop_key256
+
+$L$done_key256:
+	mov	DWORD[16+rax],edx
+	xor	eax,eax
+	jmp	NEAR $L$enc_key_ret
+
+ALIGN	16
+$L$bad_keybits:
+	mov	rax,-2
+$L$enc_key_ret:
+	pxor	xmm0,xmm0
+	pxor	xmm1,xmm1
+	pxor	xmm2,xmm2
+	pxor	xmm3,xmm3
+	pxor	xmm4,xmm4
+	pxor	xmm5,xmm5
+	add	rsp,8
+	DB	0F3h,0C3h		;repret
+$L$SEH_end_set_encrypt_key:
+
+ALIGN	16
+$L$key_expansion_128:
+	movups	XMMWORD[rax],xmm0
+	lea	rax,[16+rax]
+$L$key_expansion_128_cold:
+	shufps	xmm4,xmm0,16
+	xorps	xmm0,xmm4
+	shufps	xmm4,xmm0,140
+	xorps	xmm0,xmm4
+	shufps	xmm1,xmm1,255
+	xorps	xmm0,xmm1
+	DB	0F3h,0C3h		;repret
+
+ALIGN	16
+$L$key_expansion_192a:
+	movups	XMMWORD[rax],xmm0
+	lea	rax,[16+rax]
+$L$key_expansion_192a_cold:
+	movaps	xmm5,xmm2
+$L$key_expansion_192b_warm:
+	shufps	xmm4,xmm0,16
+	movdqa	xmm3,xmm2
+	xorps	xmm0,xmm4
+	shufps	xmm4,xmm0,140
+	pslldq	xmm3,4
+	xorps	xmm0,xmm4
+	pshufd	xmm1,xmm1,85
+	pxor	xmm2,xmm3
+	pxor	xmm0,xmm1
+	pshufd	xmm3,xmm0,255
+	pxor	xmm2,xmm3
+	DB	0F3h,0C3h		;repret
+
+ALIGN	16
+$L$key_expansion_192b:
+	movaps	xmm3,xmm0
+	shufps	xmm5,xmm0,68
+	movups	XMMWORD[rax],xmm5
+	shufps	xmm3,xmm2,78
+	movups	XMMWORD[16+rax],xmm3
+	lea	rax,[32+rax]
+	jmp	NEAR $L$key_expansion_192b_warm
+
+ALIGN	16
+$L$key_expansion_256a:
+	movups	XMMWORD[rax],xmm2
+	lea	rax,[16+rax]
+$L$key_expansion_256a_cold:
+	shufps	xmm4,xmm0,16
+	xorps	xmm0,xmm4
+	shufps	xmm4,xmm0,140
+	xorps	xmm0,xmm4
+	shufps	xmm1,xmm1,255
+	xorps	xmm0,xmm1
+	DB	0F3h,0C3h		;repret
+
+ALIGN	16
+$L$key_expansion_256b:
+	movups	XMMWORD[rax],xmm0
+	lea	rax,[16+rax]
+
+	shufps	xmm4,xmm2,16
+	xorps	xmm2,xmm4
+	shufps	xmm4,xmm2,140
+	xorps	xmm2,xmm4
+	shufps	xmm1,xmm1,170
+	xorps	xmm2,xmm1
+	DB	0F3h,0C3h		;repret
+
+
+ALIGN	64
+$L$bswap_mask:
+DB	15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0
+$L$increment32:
+	DD	6,6,6,0
+$L$increment64:
+	DD	1,0,0,0
+$L$xts_magic:
+	DD	0x87,0,1,0
+$L$increment1:
+DB	0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
+$L$key_rotate:
+	DD	0x0c0f0e0d,0x0c0f0e0d,0x0c0f0e0d,0x0c0f0e0d
+$L$key_rotate192:
+	DD	0x04070605,0x04070605,0x04070605,0x04070605
+$L$key_rcon1:
+	DD	1,1,1,1
+$L$key_rcon1b:
+	DD	0x1b,0x1b,0x1b,0x1b
+
+DB	65,69,83,32,102,111,114,32,73,110,116,101,108,32,65,69
+DB	83,45,78,73,44,32,67,82,89,80,84,79,71,65,77,83
+DB	32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115
+DB	115,108,46,111,114,103,62,0
+ALIGN	64
+EXTERN	__imp_RtlVirtualUnwind
+
+ALIGN	16
+ecb_ccm64_se_handler:
+	push	rsi
+	push	rdi
+	push	rbx
+	push	rbp
+	push	r12
+	push	r13
+	push	r14
+	push	r15
+	pushfq
+	sub	rsp,64
+
+	mov	rax,QWORD[120+r8]
+	mov	rbx,QWORD[248+r8]
+
+	mov	rsi,QWORD[8+r9]
+	mov	r11,QWORD[56+r9]
+
+	mov	r10d,DWORD[r11]
+	lea	r10,[r10*1+rsi]
+	cmp	rbx,r10
+	jb	NEAR $L$common_seh_tail
+
+	mov	rax,QWORD[152+r8]
+
+	mov	r10d,DWORD[4+r11]
+	lea	r10,[r10*1+rsi]
+	cmp	rbx,r10
+	jae	NEAR $L$common_seh_tail
+
+	lea	rsi,[rax]
+	lea	rdi,[512+r8]
+	mov	ecx,8
+	DD	0xa548f3fc
+	lea	rax,[88+rax]
+
+	jmp	NEAR $L$common_seh_tail
+
+
+
+ALIGN	16
+ctr_xts_se_handler:
+	push	rsi
+	push	rdi
+	push	rbx
+	push	rbp
+	push	r12
+	push	r13
+	push	r14
+	push	r15
+	pushfq
+	sub	rsp,64
+
+	mov	rax,QWORD[120+r8]
+	mov	rbx,QWORD[248+r8]
+
+	mov	rsi,QWORD[8+r9]
+	mov	r11,QWORD[56+r9]
+
+	mov	r10d,DWORD[r11]
+	lea	r10,[r10*1+rsi]
+	cmp	rbx,r10
+	jb	NEAR $L$common_seh_tail
+
+	mov	rax,QWORD[152+r8]
+
+	mov	r10d,DWORD[4+r11]
+	lea	r10,[r10*1+rsi]
+	cmp	rbx,r10
+	jae	NEAR $L$common_seh_tail
+
+	mov	rax,QWORD[160+r8]
+	lea	rsi,[((-160))+rax]
+	lea	rdi,[512+r8]
+	mov	ecx,20
+	DD	0xa548f3fc
+
+	jmp	NEAR $L$common_rbp_tail
+
+
+ALIGN	16
+cbc_se_handler:
+	push	rsi
+	push	rdi
+	push	rbx
+	push	rbp
+	push	r12
+	push	r13
+	push	r14
+	push	r15
+	pushfq
+	sub	rsp,64
+
+	mov	rax,QWORD[152+r8]
+	mov	rbx,QWORD[248+r8]
+
+	lea	r10,[$L$cbc_decrypt_bulk]
+	cmp	rbx,r10
+	jb	NEAR $L$common_seh_tail
+
+	lea	r10,[$L$cbc_decrypt_body]
+	cmp	rbx,r10
+	jb	NEAR $L$restore_cbc_rax
+
+	lea	r10,[$L$cbc_ret]
+	cmp	rbx,r10
+	jae	NEAR $L$common_seh_tail
+
+	lea	rsi,[16+rax]
+	lea	rdi,[512+r8]
+	mov	ecx,20
+	DD	0xa548f3fc
+
+$L$common_rbp_tail:
+	mov	rax,QWORD[160+r8]
+	mov	rbp,QWORD[rax]
+	lea	rax,[8+rax]
+	mov	QWORD[160+r8],rbp
+	jmp	NEAR $L$common_seh_tail
+
+$L$restore_cbc_rax:
+	mov	rax,QWORD[120+r8]
+
+$L$common_seh_tail:
+	mov	rdi,QWORD[8+rax]
+	mov	rsi,QWORD[16+rax]
+	mov	QWORD[152+r8],rax
+	mov	QWORD[168+r8],rsi
+	mov	QWORD[176+r8],rdi
+
+	mov	rdi,QWORD[40+r9]
+	mov	rsi,r8
+	mov	ecx,154
+	DD	0xa548f3fc
+
+	mov	rsi,r9
+	xor	rcx,rcx
+	mov	rdx,QWORD[8+rsi]
+	mov	r8,QWORD[rsi]
+	mov	r9,QWORD[16+rsi]
+	mov	r10,QWORD[40+rsi]
+	lea	r11,[56+rsi]
+	lea	r12,[24+rsi]
+	mov	QWORD[32+rsp],r10
+	mov	QWORD[40+rsp],r11
+	mov	QWORD[48+rsp],r12
+	mov	QWORD[56+rsp],rcx
+	call	QWORD[__imp_RtlVirtualUnwind]
+
+	mov	eax,1
+	add	rsp,64
+	popfq
+	pop	r15
+	pop	r14
+	pop	r13
+	pop	r12
+	pop	rbp
+	pop	rbx
+	pop	rdi
+	pop	rsi
+	DB	0F3h,0C3h		;repret
+
+
+section	.pdata rdata align=4
+ALIGN	4
+	DD	$L$SEH_begin_aesni_ecb_encrypt wrt ..imagebase
+	DD	$L$SEH_end_aesni_ecb_encrypt wrt ..imagebase
+	DD	$L$SEH_info_ecb wrt ..imagebase
+
+	DD	$L$SEH_begin_aesni_ccm64_encrypt_blocks wrt ..imagebase
+	DD	$L$SEH_end_aesni_ccm64_encrypt_blocks wrt ..imagebase
+	DD	$L$SEH_info_ccm64_enc wrt ..imagebase
+
+	DD	$L$SEH_begin_aesni_ccm64_decrypt_blocks wrt ..imagebase
+	DD	$L$SEH_end_aesni_ccm64_decrypt_blocks wrt ..imagebase
+	DD	$L$SEH_info_ccm64_dec wrt ..imagebase
+
+	DD	$L$SEH_begin_aesni_ctr32_encrypt_blocks wrt ..imagebase
+	DD	$L$SEH_end_aesni_ctr32_encrypt_blocks wrt ..imagebase
+	DD	$L$SEH_info_ctr32 wrt ..imagebase
+
+	DD	$L$SEH_begin_aesni_xts_encrypt wrt ..imagebase
+	DD	$L$SEH_end_aesni_xts_encrypt wrt ..imagebase
+	DD	$L$SEH_info_xts_enc wrt ..imagebase
+
+	DD	$L$SEH_begin_aesni_xts_decrypt wrt ..imagebase
+	DD	$L$SEH_end_aesni_xts_decrypt wrt ..imagebase
+	DD	$L$SEH_info_xts_dec wrt ..imagebase
+	DD	$L$SEH_begin_aesni_cbc_encrypt wrt ..imagebase
+	DD	$L$SEH_end_aesni_cbc_encrypt wrt ..imagebase
+	DD	$L$SEH_info_cbc wrt ..imagebase
+
+	DD	aesni_set_decrypt_key wrt ..imagebase
+	DD	$L$SEH_end_set_decrypt_key wrt ..imagebase
+	DD	$L$SEH_info_key wrt ..imagebase
+
+	DD	aesni_set_encrypt_key wrt ..imagebase
+	DD	$L$SEH_end_set_encrypt_key wrt ..imagebase
+	DD	$L$SEH_info_key wrt ..imagebase
+section	.xdata rdata align=8
+ALIGN	8
+$L$SEH_info_ecb:
+DB	9,0,0,0
+	DD	ecb_ccm64_se_handler wrt ..imagebase
+	DD	$L$ecb_enc_body wrt ..imagebase,$L$ecb_enc_ret wrt ..imagebase
+$L$SEH_info_ccm64_enc:
+DB	9,0,0,0
+	DD	ecb_ccm64_se_handler wrt ..imagebase
+	DD	$L$ccm64_enc_body wrt ..imagebase,$L$ccm64_enc_ret wrt ..imagebase
+$L$SEH_info_ccm64_dec:
+DB	9,0,0,0
+	DD	ecb_ccm64_se_handler wrt ..imagebase
+	DD	$L$ccm64_dec_body wrt ..imagebase,$L$ccm64_dec_ret wrt ..imagebase
+$L$SEH_info_ctr32:
+DB	9,0,0,0
+	DD	ctr_xts_se_handler wrt ..imagebase
+	DD	$L$ctr32_body wrt ..imagebase,$L$ctr32_epilogue wrt ..imagebase
+$L$SEH_info_xts_enc:
+DB	9,0,0,0
+	DD	ctr_xts_se_handler wrt ..imagebase
+	DD	$L$xts_enc_body wrt ..imagebase,$L$xts_enc_epilogue wrt ..imagebase
+$L$SEH_info_xts_dec:
+DB	9,0,0,0
+	DD	ctr_xts_se_handler wrt ..imagebase
+	DD	$L$xts_dec_body wrt ..imagebase,$L$xts_dec_epilogue wrt ..imagebase
+$L$SEH_info_cbc:
+DB	9,0,0,0
+	DD	cbc_se_handler wrt ..imagebase
+$L$SEH_info_key:
+DB	0x01,0x04,0x01,0x00
+DB	0x04,0x02,0x00,0x00
diff --git a/third_party/boringssl/win-x86_64/crypto/aes/bsaes-x86_64.asm b/third_party/boringssl/win-x86_64/crypto/aes/bsaes-x86_64.asm
new file mode 100644
index 0000000..6d75248
--- /dev/null
+++ b/third_party/boringssl/win-x86_64/crypto/aes/bsaes-x86_64.asm
@@ -0,0 +1,2733 @@
+default	rel
+%define XMMWORD
+%define YMMWORD
+%define ZMMWORD
+section	.text code align=64
+
+
+EXTERN	asm_AES_encrypt
+EXTERN	asm_AES_decrypt
+
+
+ALIGN	64
+_bsaes_encrypt8:
+	lea	r11,[$L$BS0]
+
+	movdqa	xmm8,XMMWORD[rax]
+	lea	rax,[16+rax]
+	movdqa	xmm7,XMMWORD[80+r11]
+	pxor	xmm15,xmm8
+	pxor	xmm0,xmm8
+	pxor	xmm1,xmm8
+	pxor	xmm2,xmm8
+DB	102,68,15,56,0,255
+DB	102,15,56,0,199
+	pxor	xmm3,xmm8
+	pxor	xmm4,xmm8
+DB	102,15,56,0,207
+DB	102,15,56,0,215
+	pxor	xmm5,xmm8
+	pxor	xmm6,xmm8
+DB	102,15,56,0,223
+DB	102,15,56,0,231
+DB	102,15,56,0,239
+DB	102,15,56,0,247
+_bsaes_encrypt8_bitslice:
+	movdqa	xmm7,XMMWORD[r11]
+	movdqa	xmm8,XMMWORD[16+r11]
+	movdqa	xmm9,xmm5
+	psrlq	xmm5,1
+	movdqa	xmm10,xmm3
+	psrlq	xmm3,1
+	pxor	xmm5,xmm6
+	pxor	xmm3,xmm4
+	pand	xmm5,xmm7
+	pand	xmm3,xmm7
+	pxor	xmm6,xmm5
+	psllq	xmm5,1
+	pxor	xmm4,xmm3
+	psllq	xmm3,1
+	pxor	xmm5,xmm9
+	pxor	xmm3,xmm10
+	movdqa	xmm9,xmm1
+	psrlq	xmm1,1
+	movdqa	xmm10,xmm15
+	psrlq	xmm15,1
+	pxor	xmm1,xmm2
+	pxor	xmm15,xmm0
+	pand	xmm1,xmm7
+	pand	xmm15,xmm7
+	pxor	xmm2,xmm1
+	psllq	xmm1,1
+	pxor	xmm0,xmm15
+	psllq	xmm15,1
+	pxor	xmm1,xmm9
+	pxor	xmm15,xmm10
+	movdqa	xmm7,XMMWORD[32+r11]
+	movdqa	xmm9,xmm4
+	psrlq	xmm4,2
+	movdqa	xmm10,xmm3
+	psrlq	xmm3,2
+	pxor	xmm4,xmm6
+	pxor	xmm3,xmm5
+	pand	xmm4,xmm8
+	pand	xmm3,xmm8
+	pxor	xmm6,xmm4
+	psllq	xmm4,2
+	pxor	xmm5,xmm3
+	psllq	xmm3,2
+	pxor	xmm4,xmm9
+	pxor	xmm3,xmm10
+	movdqa	xmm9,xmm0
+	psrlq	xmm0,2
+	movdqa	xmm10,xmm15
+	psrlq	xmm15,2
+	pxor	xmm0,xmm2
+	pxor	xmm15,xmm1
+	pand	xmm0,xmm8
+	pand	xmm15,xmm8
+	pxor	xmm2,xmm0
+	psllq	xmm0,2
+	pxor	xmm1,xmm15
+	psllq	xmm15,2
+	pxor	xmm0,xmm9
+	pxor	xmm15,xmm10
+	movdqa	xmm9,xmm2
+	psrlq	xmm2,4
+	movdqa	xmm10,xmm1
+	psrlq	xmm1,4
+	pxor	xmm2,xmm6
+	pxor	xmm1,xmm5
+	pand	xmm2,xmm7
+	pand	xmm1,xmm7
+	pxor	xmm6,xmm2
+	psllq	xmm2,4
+	pxor	xmm5,xmm1
+	psllq	xmm1,4
+	pxor	xmm2,xmm9
+	pxor	xmm1,xmm10
+	movdqa	xmm9,xmm0
+	psrlq	xmm0,4
+	movdqa	xmm10,xmm15
+	psrlq	xmm15,4
+	pxor	xmm0,xmm4
+	pxor	xmm15,xmm3
+	pand	xmm0,xmm7
+	pand	xmm15,xmm7
+	pxor	xmm4,xmm0
+	psllq	xmm0,4
+	pxor	xmm3,xmm15
+	psllq	xmm15,4
+	pxor	xmm0,xmm9
+	pxor	xmm15,xmm10
+	dec	r10d
+	jmp	NEAR $L$enc_sbox
+ALIGN	16
+$L$enc_loop:
+	pxor	xmm15,XMMWORD[rax]
+	pxor	xmm0,XMMWORD[16+rax]
+	pxor	xmm1,XMMWORD[32+rax]
+	pxor	xmm2,XMMWORD[48+rax]
+DB	102,68,15,56,0,255
+DB	102,15,56,0,199
+	pxor	xmm3,XMMWORD[64+rax]
+	pxor	xmm4,XMMWORD[80+rax]
+DB	102,15,56,0,207
+DB	102,15,56,0,215
+	pxor	xmm5,XMMWORD[96+rax]
+	pxor	xmm6,XMMWORD[112+rax]
+DB	102,15,56,0,223
+DB	102,15,56,0,231
+DB	102,15,56,0,239
+DB	102,15,56,0,247
+	lea	rax,[128+rax]
+$L$enc_sbox:
+	pxor	xmm4,xmm5
+	pxor	xmm1,xmm0
+	pxor	xmm2,xmm15
+	pxor	xmm5,xmm1
+	pxor	xmm4,xmm15
+
+	pxor	xmm5,xmm2
+	pxor	xmm2,xmm6
+	pxor	xmm6,xmm4
+	pxor	xmm2,xmm3
+	pxor	xmm3,xmm4
+	pxor	xmm2,xmm0
+
+	pxor	xmm1,xmm6
+	pxor	xmm0,xmm4
+	movdqa	xmm10,xmm6
+	movdqa	xmm9,xmm0
+	movdqa	xmm8,xmm4
+	movdqa	xmm12,xmm1
+	movdqa	xmm11,xmm5
+
+	pxor	xmm10,xmm3
+	pxor	xmm9,xmm1
+	pxor	xmm8,xmm2
+	movdqa	xmm13,xmm10
+	pxor	xmm12,xmm3
+	movdqa	xmm7,xmm9
+	pxor	xmm11,xmm15
+	movdqa	xmm14,xmm10
+
+	por	xmm9,xmm8
+	por	xmm10,xmm11
+	pxor	xmm14,xmm7
+	pand	xmm13,xmm11
+	pxor	xmm11,xmm8
+	pand	xmm7,xmm8
+	pand	xmm14,xmm11
+	movdqa	xmm11,xmm2
+	pxor	xmm11,xmm15
+	pand	xmm12,xmm11
+	pxor	xmm10,xmm12
+	pxor	xmm9,xmm12
+	movdqa	xmm12,xmm6
+	movdqa	xmm11,xmm4
+	pxor	xmm12,xmm0
+	pxor	xmm11,xmm5
+	movdqa	xmm8,xmm12
+	pand	xmm12,xmm11
+	por	xmm8,xmm11
+	pxor	xmm7,xmm12
+	pxor	xmm10,xmm14
+	pxor	xmm9,xmm13
+	pxor	xmm8,xmm14
+	movdqa	xmm11,xmm1
+	pxor	xmm7,xmm13
+	movdqa	xmm12,xmm3
+	pxor	xmm8,xmm13
+	movdqa	xmm13,xmm0
+	pand	xmm11,xmm2
+	movdqa	xmm14,xmm6
+	pand	xmm12,xmm15
+	pand	xmm13,xmm4
+	por	xmm14,xmm5
+	pxor	xmm10,xmm11
+	pxor	xmm9,xmm12
+	pxor	xmm8,xmm13
+	pxor	xmm7,xmm14
+
+
+
+
+
+	movdqa	xmm11,xmm10
+	pand	xmm10,xmm8
+	pxor	xmm11,xmm9
+
+	movdqa	xmm13,xmm7
+	movdqa	xmm14,xmm11
+	pxor	xmm13,xmm10
+	pand	xmm14,xmm13
+
+	movdqa	xmm12,xmm8
+	pxor	xmm14,xmm9
+	pxor	xmm12,xmm7
+
+	pxor	xmm10,xmm9
+
+	pand	xmm12,xmm10
+
+	movdqa	xmm9,xmm13
+	pxor	xmm12,xmm7
+
+	pxor	xmm9,xmm12
+	pxor	xmm8,xmm12
+
+	pand	xmm9,xmm7
+
+	pxor	xmm13,xmm9
+	pxor	xmm8,xmm9
+
+	pand	xmm13,xmm14
+
+	pxor	xmm13,xmm11
+	movdqa	xmm11,xmm5
+	movdqa	xmm7,xmm4
+	movdqa	xmm9,xmm14
+	pxor	xmm9,xmm13
+	pand	xmm9,xmm5
+	pxor	xmm5,xmm4
+	pand	xmm4,xmm14
+	pand	xmm5,xmm13
+	pxor	xmm5,xmm4
+	pxor	xmm4,xmm9
+	pxor	xmm11,xmm15
+	pxor	xmm7,xmm2
+	pxor	xmm14,xmm12
+	pxor	xmm13,xmm8
+	movdqa	xmm10,xmm14
+	movdqa	xmm9,xmm12
+	pxor	xmm10,xmm13
+	pxor	xmm9,xmm8
+	pand	xmm10,xmm11
+	pand	xmm9,xmm15
+	pxor	xmm11,xmm7
+	pxor	xmm15,xmm2
+	pand	xmm7,xmm14
+	pand	xmm2,xmm12
+	pand	xmm11,xmm13
+	pand	xmm15,xmm8
+	pxor	xmm7,xmm11
+	pxor	xmm15,xmm2
+	pxor	xmm11,xmm10
+	pxor	xmm2,xmm9
+	pxor	xmm5,xmm11
+	pxor	xmm15,xmm11
+	pxor	xmm4,xmm7
+	pxor	xmm2,xmm7
+
+	movdqa	xmm11,xmm6
+	movdqa	xmm7,xmm0
+	pxor	xmm11,xmm3
+	pxor	xmm7,xmm1
+	movdqa	xmm10,xmm14
+	movdqa	xmm9,xmm12
+	pxor	xmm10,xmm13
+	pxor	xmm9,xmm8
+	pand	xmm10,xmm11
+	pand	xmm9,xmm3
+	pxor	xmm11,xmm7
+	pxor	xmm3,xmm1
+	pand	xmm7,xmm14
+	pand	xmm1,xmm12
+	pand	xmm11,xmm13
+	pand	xmm3,xmm8
+	pxor	xmm7,xmm11
+	pxor	xmm3,xmm1
+	pxor	xmm11,xmm10
+	pxor	xmm1,xmm9
+	pxor	xmm14,xmm12
+	pxor	xmm13,xmm8
+	movdqa	xmm10,xmm14
+	pxor	xmm10,xmm13
+	pand	xmm10,xmm6
+	pxor	xmm6,xmm0
+	pand	xmm0,xmm14
+	pand	xmm6,xmm13
+	pxor	xmm6,xmm0
+	pxor	xmm0,xmm10
+	pxor	xmm6,xmm11
+	pxor	xmm3,xmm11
+	pxor	xmm0,xmm7
+	pxor	xmm1,xmm7
+	pxor	xmm6,xmm15
+	pxor	xmm0,xmm5
+	pxor	xmm3,xmm6
+	pxor	xmm5,xmm15
+	pxor	xmm15,xmm0
+
+	pxor	xmm0,xmm4
+	pxor	xmm4,xmm1
+	pxor	xmm1,xmm2
+	pxor	xmm2,xmm4
+	pxor	xmm3,xmm4
+
+	pxor	xmm5,xmm2
+	dec	r10d
+	jl	NEAR $L$enc_done
+	pshufd	xmm7,xmm15,0x93
+	pshufd	xmm8,xmm0,0x93
+	pxor	xmm15,xmm7
+	pshufd	xmm9,xmm3,0x93
+	pxor	xmm0,xmm8
+	pshufd	xmm10,xmm5,0x93
+	pxor	xmm3,xmm9
+	pshufd	xmm11,xmm2,0x93
+	pxor	xmm5,xmm10
+	pshufd	xmm12,xmm6,0x93
+	pxor	xmm2,xmm11
+	pshufd	xmm13,xmm1,0x93
+	pxor	xmm6,xmm12
+	pshufd	xmm14,xmm4,0x93
+	pxor	xmm1,xmm13
+	pxor	xmm4,xmm14
+
+	pxor	xmm8,xmm15
+	pxor	xmm7,xmm4
+	pxor	xmm8,xmm4
+	pshufd	xmm15,xmm15,0x4E
+	pxor	xmm9,xmm0
+	pshufd	xmm0,xmm0,0x4E
+	pxor	xmm12,xmm2
+	pxor	xmm15,xmm7
+	pxor	xmm13,xmm6
+	pxor	xmm0,xmm8
+	pxor	xmm11,xmm5
+	pshufd	xmm7,xmm2,0x4E
+	pxor	xmm14,xmm1
+	pshufd	xmm8,xmm6,0x4E
+	pxor	xmm10,xmm3
+	pshufd	xmm2,xmm5,0x4E
+	pxor	xmm10,xmm4
+	pshufd	xmm6,xmm4,0x4E
+	pxor	xmm11,xmm4
+	pshufd	xmm5,xmm1,0x4E
+	pxor	xmm7,xmm11
+	pshufd	xmm1,xmm3,0x4E
+	pxor	xmm8,xmm12
+	pxor	xmm2,xmm10
+	pxor	xmm6,xmm14
+	pxor	xmm5,xmm13
+	movdqa	xmm3,xmm7
+	pxor	xmm1,xmm9
+	movdqa	xmm4,xmm8
+	movdqa	xmm7,XMMWORD[48+r11]
+	jnz	NEAR $L$enc_loop
+	movdqa	xmm7,XMMWORD[64+r11]
+	jmp	NEAR $L$enc_loop
+ALIGN	16
+$L$enc_done:
+	movdqa	xmm7,XMMWORD[r11]
+	movdqa	xmm8,XMMWORD[16+r11]
+	movdqa	xmm9,xmm1
+	psrlq	xmm1,1
+	movdqa	xmm10,xmm2
+	psrlq	xmm2,1
+	pxor	xmm1,xmm4
+	pxor	xmm2,xmm6
+	pand	xmm1,xmm7
+	pand	xmm2,xmm7
+	pxor	xmm4,xmm1
+	psllq	xmm1,1
+	pxor	xmm6,xmm2
+	psllq	xmm2,1
+	pxor	xmm1,xmm9
+	pxor	xmm2,xmm10
+	movdqa	xmm9,xmm3
+	psrlq	xmm3,1
+	movdqa	xmm10,xmm15
+	psrlq	xmm15,1
+	pxor	xmm3,xmm5
+	pxor	xmm15,xmm0
+	pand	xmm3,xmm7
+	pand	xmm15,xmm7
+	pxor	xmm5,xmm3
+	psllq	xmm3,1
+	pxor	xmm0,xmm15
+	psllq	xmm15,1
+	pxor	xmm3,xmm9
+	pxor	xmm15,xmm10
+	movdqa	xmm7,XMMWORD[32+r11]
+	movdqa	xmm9,xmm6
+	psrlq	xmm6,2
+	movdqa	xmm10,xmm2
+	psrlq	xmm2,2
+	pxor	xmm6,xmm4
+	pxor	xmm2,xmm1
+	pand	xmm6,xmm8
+	pand	xmm2,xmm8
+	pxor	xmm4,xmm6
+	psllq	xmm6,2
+	pxor	xmm1,xmm2
+	psllq	xmm2,2
+	pxor	xmm6,xmm9
+	pxor	xmm2,xmm10
+	movdqa	xmm9,xmm0
+	psrlq	xmm0,2
+	movdqa	xmm10,xmm15
+	psrlq	xmm15,2
+	pxor	xmm0,xmm5
+	pxor	xmm15,xmm3
+	pand	xmm0,xmm8
+	pand	xmm15,xmm8
+	pxor	xmm5,xmm0
+	psllq	xmm0,2
+	pxor	xmm3,xmm15
+	psllq	xmm15,2
+	pxor	xmm0,xmm9
+	pxor	xmm15,xmm10
+	movdqa	xmm9,xmm5
+	psrlq	xmm5,4
+	movdqa	xmm10,xmm3
+	psrlq	xmm3,4
+	pxor	xmm5,xmm4
+	pxor	xmm3,xmm1
+	pand	xmm5,xmm7
+	pand	xmm3,xmm7
+	pxor	xmm4,xmm5
+	psllq	xmm5,4
+	pxor	xmm1,xmm3
+	psllq	xmm3,4
+	pxor	xmm5,xmm9
+	pxor	xmm3,xmm10
+	movdqa	xmm9,xmm0
+	psrlq	xmm0,4
+	movdqa	xmm10,xmm15
+	psrlq	xmm15,4
+	pxor	xmm0,xmm6
+	pxor	xmm15,xmm2
+	pand	xmm0,xmm7
+	pand	xmm15,xmm7
+	pxor	xmm6,xmm0
+	psllq	xmm0,4
+	pxor	xmm2,xmm15
+	psllq	xmm15,4
+	pxor	xmm0,xmm9
+	pxor	xmm15,xmm10
+	movdqa	xmm7,XMMWORD[rax]
+	pxor	xmm3,xmm7
+	pxor	xmm5,xmm7
+	pxor	xmm2,xmm7
+	pxor	xmm6,xmm7
+	pxor	xmm1,xmm7
+	pxor	xmm4,xmm7
+	pxor	xmm15,xmm7
+	pxor	xmm0,xmm7
+	DB	0F3h,0C3h		;repret
+
+
+
+ALIGN	64
+_bsaes_decrypt8:
+	lea	r11,[$L$BS0]
+
+	movdqa	xmm8,XMMWORD[rax]
+	lea	rax,[16+rax]
+	movdqa	xmm7,XMMWORD[((-48))+r11]
+	pxor	xmm15,xmm8
+	pxor	xmm0,xmm8
+	pxor	xmm1,xmm8
+	pxor	xmm2,xmm8
+DB	102,68,15,56,0,255
+DB	102,15,56,0,199
+	pxor	xmm3,xmm8
+	pxor	xmm4,xmm8
+DB	102,15,56,0,207
+DB	102,15,56,0,215
+	pxor	xmm5,xmm8
+	pxor	xmm6,xmm8
+DB	102,15,56,0,223
+DB	102,15,56,0,231
+DB	102,15,56,0,239
+DB	102,15,56,0,247
+	movdqa	xmm7,XMMWORD[r11]
+	movdqa	xmm8,XMMWORD[16+r11]
+	movdqa	xmm9,xmm5
+	psrlq	xmm5,1
+	movdqa	xmm10,xmm3
+	psrlq	xmm3,1
+	pxor	xmm5,xmm6
+	pxor	xmm3,xmm4
+	pand	xmm5,xmm7
+	pand	xmm3,xmm7
+	pxor	xmm6,xmm5
+	psllq	xmm5,1
+	pxor	xmm4,xmm3
+	psllq	xmm3,1
+	pxor	xmm5,xmm9
+	pxor	xmm3,xmm10
+	movdqa	xmm9,xmm1
+	psrlq	xmm1,1
+	movdqa	xmm10,xmm15
+	psrlq	xmm15,1
+	pxor	xmm1,xmm2
+	pxor	xmm15,xmm0
+	pand	xmm1,xmm7
+	pand	xmm15,xmm7
+	pxor	xmm2,xmm1
+	psllq	xmm1,1
+	pxor	xmm0,xmm15
+	psllq	xmm15,1
+	pxor	xmm1,xmm9
+	pxor	xmm15,xmm10
+	movdqa	xmm7,XMMWORD[32+r11]
+	movdqa	xmm9,xmm4
+	psrlq	xmm4,2
+	movdqa	xmm10,xmm3
+	psrlq	xmm3,2
+	pxor	xmm4,xmm6
+	pxor	xmm3,xmm5
+	pand	xmm4,xmm8
+	pand	xmm3,xmm8
+	pxor	xmm6,xmm4
+	psllq	xmm4,2
+	pxor	xmm5,xmm3
+	psllq	xmm3,2
+	pxor	xmm4,xmm9
+	pxor	xmm3,xmm10
+	movdqa	xmm9,xmm0
+	psrlq	xmm0,2
+	movdqa	xmm10,xmm15
+	psrlq	xmm15,2
+	pxor	xmm0,xmm2
+	pxor	xmm15,xmm1
+	pand	xmm0,xmm8
+	pand	xmm15,xmm8
+	pxor	xmm2,xmm0
+	psllq	xmm0,2
+	pxor	xmm1,xmm15
+	psllq	xmm15,2
+	pxor	xmm0,xmm9
+	pxor	xmm15,xmm10
+	movdqa	xmm9,xmm2
+	psrlq	xmm2,4
+	movdqa	xmm10,xmm1
+	psrlq	xmm1,4
+	pxor	xmm2,xmm6
+	pxor	xmm1,xmm5
+	pand	xmm2,xmm7
+	pand	xmm1,xmm7
+	pxor	xmm6,xmm2
+	psllq	xmm2,4
+	pxor	xmm5,xmm1
+	psllq	xmm1,4
+	pxor	xmm2,xmm9
+	pxor	xmm1,xmm10
+	movdqa	xmm9,xmm0
+	psrlq	xmm0,4
+	movdqa	xmm10,xmm15
+	psrlq	xmm15,4
+	pxor	xmm0,xmm4
+	pxor	xmm15,xmm3
+	pand	xmm0,xmm7
+	pand	xmm15,xmm7
+	pxor	xmm4,xmm0
+	psllq	xmm0,4
+	pxor	xmm3,xmm15
+	psllq	xmm15,4
+	pxor	xmm0,xmm9
+	pxor	xmm15,xmm10
+	dec	r10d
+	jmp	NEAR $L$dec_sbox
+ALIGN	16
+$L$dec_loop:
+	pxor	xmm15,XMMWORD[rax]
+	pxor	xmm0,XMMWORD[16+rax]
+	pxor	xmm1,XMMWORD[32+rax]
+	pxor	xmm2,XMMWORD[48+rax]
+DB	102,68,15,56,0,255
+DB	102,15,56,0,199
+	pxor	xmm3,XMMWORD[64+rax]
+	pxor	xmm4,XMMWORD[80+rax]
+DB	102,15,56,0,207
+DB	102,15,56,0,215
+	pxor	xmm5,XMMWORD[96+rax]
+	pxor	xmm6,XMMWORD[112+rax]
+DB	102,15,56,0,223
+DB	102,15,56,0,231
+DB	102,15,56,0,239
+DB	102,15,56,0,247
+	lea	rax,[128+rax]
+$L$dec_sbox:
+	pxor	xmm2,xmm3
+
+	pxor	xmm3,xmm6
+	pxor	xmm1,xmm6
+	pxor	xmm5,xmm3
+	pxor	xmm6,xmm5
+	pxor	xmm0,xmm6
+
+	pxor	xmm15,xmm0
+	pxor	xmm1,xmm4
+	pxor	xmm2,xmm15
+	pxor	xmm4,xmm15
+	pxor	xmm0,xmm2
+	movdqa	xmm10,xmm2
+	movdqa	xmm9,xmm6
+	movdqa	xmm8,xmm0
+	movdqa	xmm12,xmm3
+	movdqa	xmm11,xmm4
+
+	pxor	xmm10,xmm15
+	pxor	xmm9,xmm3
+	pxor	xmm8,xmm5
+	movdqa	xmm13,xmm10
+	pxor	xmm12,xmm15
+	movdqa	xmm7,xmm9
+	pxor	xmm11,xmm1
+	movdqa	xmm14,xmm10
+
+	por	xmm9,xmm8
+	por	xmm10,xmm11
+	pxor	xmm14,xmm7
+	pand	xmm13,xmm11
+	pxor	xmm11,xmm8
+	pand	xmm7,xmm8
+	pand	xmm14,xmm11
+	movdqa	xmm11,xmm5
+	pxor	xmm11,xmm1
+	pand	xmm12,xmm11
+	pxor	xmm10,xmm12
+	pxor	xmm9,xmm12
+	movdqa	xmm12,xmm2
+	movdqa	xmm11,xmm0
+	pxor	xmm12,xmm6
+	pxor	xmm11,xmm4
+	movdqa	xmm8,xmm12
+	pand	xmm12,xmm11
+	por	xmm8,xmm11
+	pxor	xmm7,xmm12
+	pxor	xmm10,xmm14
+	pxor	xmm9,xmm13
+	pxor	xmm8,xmm14
+	movdqa	xmm11,xmm3
+	pxor	xmm7,xmm13
+	movdqa	xmm12,xmm15
+	pxor	xmm8,xmm13
+	movdqa	xmm13,xmm6
+	pand	xmm11,xmm5
+	movdqa	xmm14,xmm2
+	pand	xmm12,xmm1
+	pand	xmm13,xmm0
+	por	xmm14,xmm4
+	pxor	xmm10,xmm11
+	pxor	xmm9,xmm12
+	pxor	xmm8,xmm13
+	pxor	xmm7,xmm14
+
+
+
+
+
+	movdqa	xmm11,xmm10
+	pand	xmm10,xmm8
+	pxor	xmm11,xmm9
+
+	movdqa	xmm13,xmm7
+	movdqa	xmm14,xmm11
+	pxor	xmm13,xmm10
+	pand	xmm14,xmm13
+
+	movdqa	xmm12,xmm8
+	pxor	xmm14,xmm9
+	pxor	xmm12,xmm7
+
+	pxor	xmm10,xmm9
+
+	pand	xmm12,xmm10
+
+	movdqa	xmm9,xmm13
+	pxor	xmm12,xmm7
+
+	pxor	xmm9,xmm12
+	pxor	xmm8,xmm12
+
+	pand	xmm9,xmm7
+
+	pxor	xmm13,xmm9
+	pxor	xmm8,xmm9
+
+	pand	xmm13,xmm14
+
+	pxor	xmm13,xmm11
+	movdqa	xmm11,xmm4
+	movdqa	xmm7,xmm0
+	movdqa	xmm9,xmm14
+	pxor	xmm9,xmm13
+	pand	xmm9,xmm4
+	pxor	xmm4,xmm0
+	pand	xmm0,xmm14
+	pand	xmm4,xmm13
+	pxor	xmm4,xmm0
+	pxor	xmm0,xmm9
+	pxor	xmm11,xmm1
+	pxor	xmm7,xmm5
+	pxor	xmm14,xmm12
+	pxor	xmm13,xmm8
+	movdqa	xmm10,xmm14
+	movdqa	xmm9,xmm12
+	pxor	xmm10,xmm13
+	pxor	xmm9,xmm8
+	pand	xmm10,xmm11
+	pand	xmm9,xmm1
+	pxor	xmm11,xmm7
+	pxor	xmm1,xmm5
+	pand	xmm7,xmm14
+	pand	xmm5,xmm12
+	pand	xmm11,xmm13
+	pand	xmm1,xmm8
+	pxor	xmm7,xmm11
+	pxor	xmm1,xmm5
+	pxor	xmm11,xmm10
+	pxor	xmm5,xmm9
+	pxor	xmm4,xmm11
+	pxor	xmm1,xmm11
+	pxor	xmm0,xmm7
+	pxor	xmm5,xmm7
+
+	movdqa	xmm11,xmm2
+	movdqa	xmm7,xmm6
+	pxor	xmm11,xmm15
+	pxor	xmm7,xmm3
+	movdqa	xmm10,xmm14
+	movdqa	xmm9,xmm12
+	pxor	xmm10,xmm13
+	pxor	xmm9,xmm8
+	pand	xmm10,xmm11
+	pand	xmm9,xmm15
+	pxor	xmm11,xmm7
+	pxor	xmm15,xmm3
+	pand	xmm7,xmm14
+	pand	xmm3,xmm12
+	pand	xmm11,xmm13
+	pand	xmm15,xmm8
+	pxor	xmm7,xmm11
+	pxor	xmm15,xmm3
+	pxor	xmm11,xmm10
+	pxor	xmm3,xmm9
+	pxor	xmm14,xmm12
+	pxor	xmm13,xmm8
+	movdqa	xmm10,xmm14
+	pxor	xmm10,xmm13
+	pand	xmm10,xmm2
+	pxor	xmm2,xmm6
+	pand	xmm6,xmm14
+	pand	xmm2,xmm13
+	pxor	xmm2,xmm6
+	pxor	xmm6,xmm10
+	pxor	xmm2,xmm11
+	pxor	xmm15,xmm11
+	pxor	xmm6,xmm7
+	pxor	xmm3,xmm7
+	pxor	xmm0,xmm6
+	pxor	xmm5,xmm4
+
+	pxor	xmm3,xmm0
+	pxor	xmm1,xmm6
+	pxor	xmm4,xmm6
+	pxor	xmm3,xmm1
+	pxor	xmm6,xmm15
+	pxor	xmm3,xmm4
+	pxor	xmm2,xmm5
+	pxor	xmm5,xmm0
+	pxor	xmm2,xmm3
+
+	pxor	xmm3,xmm15
+	pxor	xmm6,xmm2
+	dec	r10d
+	jl	NEAR $L$dec_done
+
+	pshufd	xmm7,xmm15,0x4E
+	pshufd	xmm13,xmm2,0x4E
+	pxor	xmm7,xmm15
+	pshufd	xmm14,xmm4,0x4E
+	pxor	xmm13,xmm2
+	pshufd	xmm8,xmm0,0x4E
+	pxor	xmm14,xmm4
+	pshufd	xmm9,xmm5,0x4E
+	pxor	xmm8,xmm0
+	pshufd	xmm10,xmm3,0x4E
+	pxor	xmm9,xmm5
+	pxor	xmm15,xmm13
+	pxor	xmm0,xmm13
+	pshufd	xmm11,xmm1,0x4E
+	pxor	xmm10,xmm3
+	pxor	xmm5,xmm7
+	pxor	xmm3,xmm8
+	pshufd	xmm12,xmm6,0x4E
+	pxor	xmm11,xmm1
+	pxor	xmm0,xmm14
+	pxor	xmm1,xmm9
+	pxor	xmm12,xmm6
+
+	pxor	xmm5,xmm14
+	pxor	xmm3,xmm13
+	pxor	xmm1,xmm13
+	pxor	xmm6,xmm10
+	pxor	xmm2,xmm11
+	pxor	xmm1,xmm14
+	pxor	xmm6,xmm14
+	pxor	xmm4,xmm12
+	pshufd	xmm7,xmm15,0x93
+	pshufd	xmm8,xmm0,0x93
+	pxor	xmm15,xmm7
+	pshufd	xmm9,xmm5,0x93
+	pxor	xmm0,xmm8
+	pshufd	xmm10,xmm3,0x93
+	pxor	xmm5,xmm9
+	pshufd	xmm11,xmm1,0x93
+	pxor	xmm3,xmm10
+	pshufd	xmm12,xmm6,0x93
+	pxor	xmm1,xmm11
+	pshufd	xmm13,xmm2,0x93
+	pxor	xmm6,xmm12
+	pshufd	xmm14,xmm4,0x93
+	pxor	xmm2,xmm13
+	pxor	xmm4,xmm14
+
+	pxor	xmm8,xmm15
+	pxor	xmm7,xmm4
+	pxor	xmm8,xmm4
+	pshufd	xmm15,xmm15,0x4E
+	pxor	xmm9,xmm0
+	pshufd	xmm0,xmm0,0x4E
+	pxor	xmm12,xmm1
+	pxor	xmm15,xmm7
+	pxor	xmm13,xmm6
+	pxor	xmm0,xmm8
+	pxor	xmm11,xmm3
+	pshufd	xmm7,xmm1,0x4E
+	pxor	xmm14,xmm2
+	pshufd	xmm8,xmm6,0x4E
+	pxor	xmm10,xmm5
+	pshufd	xmm1,xmm3,0x4E
+	pxor	xmm10,xmm4
+	pshufd	xmm6,xmm4,0x4E
+	pxor	xmm11,xmm4
+	pshufd	xmm3,xmm2,0x4E
+	pxor	xmm7,xmm11
+	pshufd	xmm2,xmm5,0x4E
+	pxor	xmm8,xmm12
+	pxor	xmm10,xmm1
+	pxor	xmm6,xmm14
+	pxor	xmm13,xmm3
+	movdqa	xmm3,xmm7
+	pxor	xmm2,xmm9
+	movdqa	xmm5,xmm13
+	movdqa	xmm4,xmm8
+	movdqa	xmm1,xmm2
+	movdqa	xmm2,xmm10
+	movdqa	xmm7,XMMWORD[((-16))+r11]
+	jnz	NEAR $L$dec_loop
+	movdqa	xmm7,XMMWORD[((-32))+r11]
+	jmp	NEAR $L$dec_loop
+ALIGN	16
+$L$dec_done:
+	movdqa	xmm7,XMMWORD[r11]
+	movdqa	xmm8,XMMWORD[16+r11]
+	movdqa	xmm9,xmm2
+	psrlq	xmm2,1
+	movdqa	xmm10,xmm1
+	psrlq	xmm1,1
+	pxor	xmm2,xmm4
+	pxor	xmm1,xmm6
+	pand	xmm2,xmm7
+	pand	xmm1,xmm7
+	pxor	xmm4,xmm2
+	psllq	xmm2,1
+	pxor	xmm6,xmm1
+	psllq	xmm1,1
+	pxor	xmm2,xmm9
+	pxor	xmm1,xmm10
+	movdqa	xmm9,xmm5
+	psrlq	xmm5,1
+	movdqa	xmm10,xmm15
+	psrlq	xmm15,1
+	pxor	xmm5,xmm3
+	pxor	xmm15,xmm0
+	pand	xmm5,xmm7
+	pand	xmm15,xmm7
+	pxor	xmm3,xmm5
+	psllq	xmm5,1
+	pxor	xmm0,xmm15
+	psllq	xmm15,1
+	pxor	xmm5,xmm9
+	pxor	xmm15,xmm10
+	movdqa	xmm7,XMMWORD[32+r11]
+	movdqa	xmm9,xmm6
+	psrlq	xmm6,2
+	movdqa	xmm10,xmm1
+	psrlq	xmm1,2
+	pxor	xmm6,xmm4
+	pxor	xmm1,xmm2
+	pand	xmm6,xmm8
+	pand	xmm1,xmm8
+	pxor	xmm4,xmm6
+	psllq	xmm6,2
+	pxor	xmm2,xmm1
+	psllq	xmm1,2
+	pxor	xmm6,xmm9
+	pxor	xmm1,xmm10
+	movdqa	xmm9,xmm0
+	psrlq	xmm0,2
+	movdqa	xmm10,xmm15
+	psrlq	xmm15,2
+	pxor	xmm0,xmm3
+	pxor	xmm15,xmm5
+	pand	xmm0,xmm8
+	pand	xmm15,xmm8
+	pxor	xmm3,xmm0
+	psllq	xmm0,2
+	pxor	xmm5,xmm15
+	psllq	xmm15,2
+	pxor	xmm0,xmm9
+	pxor	xmm15,xmm10
+	movdqa	xmm9,xmm3
+	psrlq	xmm3,4
+	movdqa	xmm10,xmm5
+	psrlq	xmm5,4
+	pxor	xmm3,xmm4
+	pxor	xmm5,xmm2
+	pand	xmm3,xmm7
+	pand	xmm5,xmm7
+	pxor	xmm4,xmm3
+	psllq	xmm3,4
+	pxor	xmm2,xmm5
+	psllq	xmm5,4
+	pxor	xmm3,xmm9
+	pxor	xmm5,xmm10
+	movdqa	xmm9,xmm0
+	psrlq	xmm0,4
+	movdqa	xmm10,xmm15
+	psrlq	xmm15,4
+	pxor	xmm0,xmm6
+	pxor	xmm15,xmm1
+	pand	xmm0,xmm7
+	pand	xmm15,xmm7
+	pxor	xmm6,xmm0
+	psllq	xmm0,4
+	pxor	xmm1,xmm15
+	psllq	xmm15,4
+	pxor	xmm0,xmm9
+	pxor	xmm15,xmm10
+	movdqa	xmm7,XMMWORD[rax]
+	pxor	xmm5,xmm7
+	pxor	xmm3,xmm7
+	pxor	xmm1,xmm7
+	pxor	xmm6,xmm7
+	pxor	xmm2,xmm7
+	pxor	xmm4,xmm7
+	pxor	xmm15,xmm7
+	pxor	xmm0,xmm7
+	DB	0F3h,0C3h		;repret
+
+
+ALIGN	16
+_bsaes_key_convert:
+	lea	r11,[$L$masks]
+	movdqu	xmm7,XMMWORD[rcx]
+	lea	rcx,[16+rcx]
+	movdqa	xmm0,XMMWORD[r11]
+	movdqa	xmm1,XMMWORD[16+r11]
+	movdqa	xmm2,XMMWORD[32+r11]
+	movdqa	xmm3,XMMWORD[48+r11]
+	movdqa	xmm4,XMMWORD[64+r11]
+	pcmpeqd	xmm5,xmm5
+
+	movdqu	xmm6,XMMWORD[rcx]
+	movdqa	XMMWORD[rax],xmm7
+	lea	rax,[16+rax]
+	dec	r10d
+	jmp	NEAR $L$key_loop
+ALIGN	16
+$L$key_loop:
+DB	102,15,56,0,244
+
+	movdqa	xmm8,xmm0
+	movdqa	xmm9,xmm1
+
+	pand	xmm8,xmm6
+	pand	xmm9,xmm6
+	movdqa	xmm10,xmm2
+	pcmpeqb	xmm8,xmm0
+	psllq	xmm0,4
+	movdqa	xmm11,xmm3
+	pcmpeqb	xmm9,xmm1
+	psllq	xmm1,4
+
+	pand	xmm10,xmm6
+	pand	xmm11,xmm6
+	movdqa	xmm12,xmm0
+	pcmpeqb	xmm10,xmm2
+	psllq	xmm2,4
+	movdqa	xmm13,xmm1
+	pcmpeqb	xmm11,xmm3
+	psllq	xmm3,4
+
+	movdqa	xmm14,xmm2
+	movdqa	xmm15,xmm3
+	pxor	xmm8,xmm5
+	pxor	xmm9,xmm5
+
+	pand	xmm12,xmm6
+	pand	xmm13,xmm6
+	movdqa	XMMWORD[rax],xmm8
+	pcmpeqb	xmm12,xmm0
+	psrlq	xmm0,4
+	movdqa	XMMWORD[16+rax],xmm9
+	pcmpeqb	xmm13,xmm1
+	psrlq	xmm1,4
+	lea	rcx,[16+rcx]
+
+	pand	xmm14,xmm6
+	pand	xmm15,xmm6
+	movdqa	XMMWORD[32+rax],xmm10
+	pcmpeqb	xmm14,xmm2
+	psrlq	xmm2,4
+	movdqa	XMMWORD[48+rax],xmm11
+	pcmpeqb	xmm15,xmm3
+	psrlq	xmm3,4
+	movdqu	xmm6,XMMWORD[rcx]
+
+	pxor	xmm13,xmm5
+	pxor	xmm14,xmm5
+	movdqa	XMMWORD[64+rax],xmm12
+	movdqa	XMMWORD[80+rax],xmm13
+	movdqa	XMMWORD[96+rax],xmm14
+	movdqa	XMMWORD[112+rax],xmm15
+	lea	rax,[128+rax]
+	dec	r10d
+	jnz	NEAR $L$key_loop
+
+	movdqa	xmm7,XMMWORD[80+r11]
+
+	DB	0F3h,0C3h		;repret
+
+EXTERN	asm_AES_cbc_encrypt
+global	bsaes_cbc_encrypt
+
+ALIGN	16
+bsaes_cbc_encrypt:
+	mov	r11d,DWORD[48+rsp]
+	cmp	r11d,0
+	jne	NEAR asm_AES_cbc_encrypt
+	cmp	r8,128
+	jb	NEAR asm_AES_cbc_encrypt
+
+	mov	rax,rsp
+$L$cbc_dec_prologue:
+	push	rbp
+	push	rbx
+	push	r12
+	push	r13
+	push	r14
+	push	r15
+	lea	rsp,[((-72))+rsp]
+	mov	r10,QWORD[160+rsp]
+	lea	rsp,[((-160))+rsp]
+	movaps	XMMWORD[64+rsp],xmm6
+	movaps	XMMWORD[80+rsp],xmm7
+	movaps	XMMWORD[96+rsp],xmm8
+	movaps	XMMWORD[112+rsp],xmm9
+	movaps	XMMWORD[128+rsp],xmm10
+	movaps	XMMWORD[144+rsp],xmm11
+	movaps	XMMWORD[160+rsp],xmm12
+	movaps	XMMWORD[176+rsp],xmm13
+	movaps	XMMWORD[192+rsp],xmm14
+	movaps	XMMWORD[208+rsp],xmm15
+$L$cbc_dec_body:
+	mov	rbp,rsp
+	mov	eax,DWORD[240+r9]
+	mov	r12,rcx
+	mov	r13,rdx
+	mov	r14,r8
+	mov	r15,r9
+	mov	rbx,r10
+	shr	r14,4
+
+	mov	edx,eax
+	shl	rax,7
+	sub	rax,96
+	sub	rsp,rax
+
+	mov	rax,rsp
+	mov	rcx,r15
+	mov	r10d,edx
+	call	_bsaes_key_convert
+	pxor	xmm7,XMMWORD[rsp]
+	movdqa	XMMWORD[rax],xmm6
+	movdqa	XMMWORD[rsp],xmm7
+
+	movdqu	xmm14,XMMWORD[rbx]
+	sub	r14,8
+$L$cbc_dec_loop:
+	movdqu	xmm15,XMMWORD[r12]
+	movdqu	xmm0,XMMWORD[16+r12]
+	movdqu	xmm1,XMMWORD[32+r12]
+	movdqu	xmm2,XMMWORD[48+r12]
+	movdqu	xmm3,XMMWORD[64+r12]
+	movdqu	xmm4,XMMWORD[80+r12]
+	mov	rax,rsp
+	movdqu	xmm5,XMMWORD[96+r12]
+	mov	r10d,edx
+	movdqu	xmm6,XMMWORD[112+r12]
+	movdqa	XMMWORD[32+rbp],xmm14
+
+	call	_bsaes_decrypt8
+
+	pxor	xmm15,XMMWORD[32+rbp]
+	movdqu	xmm7,XMMWORD[r12]
+	movdqu	xmm8,XMMWORD[16+r12]
+	pxor	xmm0,xmm7
+	movdqu	xmm9,XMMWORD[32+r12]
+	pxor	xmm5,xmm8
+	movdqu	xmm10,XMMWORD[48+r12]
+	pxor	xmm3,xmm9
+	movdqu	xmm11,XMMWORD[64+r12]
+	pxor	xmm1,xmm10
+	movdqu	xmm12,XMMWORD[80+r12]
+	pxor	xmm6,xmm11
+	movdqu	xmm13,XMMWORD[96+r12]
+	pxor	xmm2,xmm12
+	movdqu	xmm14,XMMWORD[112+r12]
+	pxor	xmm4,xmm13
+	movdqu	XMMWORD[r13],xmm15
+	lea	r12,[128+r12]
+	movdqu	XMMWORD[16+r13],xmm0
+	movdqu	XMMWORD[32+r13],xmm5
+	movdqu	XMMWORD[48+r13],xmm3
+	movdqu	XMMWORD[64+r13],xmm1
+	movdqu	XMMWORD[80+r13],xmm6
+	movdqu	XMMWORD[96+r13],xmm2
+	movdqu	XMMWORD[112+r13],xmm4
+	lea	r13,[128+r13]
+	sub	r14,8
+	jnc	NEAR $L$cbc_dec_loop
+
+	add	r14,8
+	jz	NEAR $L$cbc_dec_done
+
+	movdqu	xmm15,XMMWORD[r12]
+	mov	rax,rsp
+	mov	r10d,edx
+	cmp	r14,2
+	jb	NEAR $L$cbc_dec_one
+	movdqu	xmm0,XMMWORD[16+r12]
+	je	NEAR $L$cbc_dec_two
+	movdqu	xmm1,XMMWORD[32+r12]
+	cmp	r14,4
+	jb	NEAR $L$cbc_dec_three
+	movdqu	xmm2,XMMWORD[48+r12]
+	je	NEAR $L$cbc_dec_four
+	movdqu	xmm3,XMMWORD[64+r12]
+	cmp	r14,6
+	jb	NEAR $L$cbc_dec_five
+	movdqu	xmm4,XMMWORD[80+r12]
+	je	NEAR $L$cbc_dec_six
+	movdqu	xmm5,XMMWORD[96+r12]
+	movdqa	XMMWORD[32+rbp],xmm14
+	call	_bsaes_decrypt8
+	pxor	xmm15,XMMWORD[32+rbp]
+	movdqu	xmm7,XMMWORD[r12]
+	movdqu	xmm8,XMMWORD[16+r12]
+	pxor	xmm0,xmm7
+	movdqu	xmm9,XMMWORD[32+r12]
+	pxor	xmm5,xmm8
+	movdqu	xmm10,XMMWORD[48+r12]
+	pxor	xmm3,xmm9
+	movdqu	xmm11,XMMWORD[64+r12]
+	pxor	xmm1,xmm10
+	movdqu	xmm12,XMMWORD[80+r12]
+	pxor	xmm6,xmm11
+	movdqu	xmm14,XMMWORD[96+r12]
+	pxor	xmm2,xmm12
+	movdqu	XMMWORD[r13],xmm15
+	movdqu	XMMWORD[16+r13],xmm0
+	movdqu	XMMWORD[32+r13],xmm5
+	movdqu	XMMWORD[48+r13],xmm3
+	movdqu	XMMWORD[64+r13],xmm1
+	movdqu	XMMWORD[80+r13],xmm6
+	movdqu	XMMWORD[96+r13],xmm2
+	jmp	NEAR $L$cbc_dec_done
+ALIGN	16
+$L$cbc_dec_six:
+	movdqa	XMMWORD[32+rbp],xmm14
+	call	_bsaes_decrypt8
+	pxor	xmm15,XMMWORD[32+rbp]
+	movdqu	xmm7,XMMWORD[r12]
+	movdqu	xmm8,XMMWORD[16+r12]
+	pxor	xmm0,xmm7
+	movdqu	xmm9,XMMWORD[32+r12]
+	pxor	xmm5,xmm8
+	movdqu	xmm10,XMMWORD[48+r12]
+	pxor	xmm3,xmm9
+	movdqu	xmm11,XMMWORD[64+r12]
+	pxor	xmm1,xmm10
+	movdqu	xmm14,XMMWORD[80+r12]
+	pxor	xmm6,xmm11
+	movdqu	XMMWORD[r13],xmm15
+	movdqu	XMMWORD[16+r13],xmm0
+	movdqu	XMMWORD[32+r13],xmm5
+	movdqu	XMMWORD[48+r13],xmm3
+	movdqu	XMMWORD[64+r13],xmm1
+	movdqu	XMMWORD[80+r13],xmm6
+	jmp	NEAR $L$cbc_dec_done
+ALIGN	16
+$L$cbc_dec_five:
+	movdqa	XMMWORD[32+rbp],xmm14
+	call	_bsaes_decrypt8
+	pxor	xmm15,XMMWORD[32+rbp]
+	movdqu	xmm7,XMMWORD[r12]
+	movdqu	xmm8,XMMWORD[16+r12]
+	pxor	xmm0,xmm7
+	movdqu	xmm9,XMMWORD[32+r12]
+	pxor	xmm5,xmm8
+	movdqu	xmm10,XMMWORD[48+r12]
+	pxor	xmm3,xmm9
+	movdqu	xmm14,XMMWORD[64+r12]
+	pxor	xmm1,xmm10
+	movdqu	XMMWORD[r13],xmm15
+	movdqu	XMMWORD[16+r13],xmm0
+	movdqu	XMMWORD[32+r13],xmm5
+	movdqu	XMMWORD[48+r13],xmm3
+	movdqu	XMMWORD[64+r13],xmm1
+	jmp	NEAR $L$cbc_dec_done
+ALIGN	16
+$L$cbc_dec_four:
+	movdqa	XMMWORD[32+rbp],xmm14
+	call	_bsaes_decrypt8
+	pxor	xmm15,XMMWORD[32+rbp]
+	movdqu	xmm7,XMMWORD[r12]
+	movdqu	xmm8,XMMWORD[16+r12]
+	pxor	xmm0,xmm7
+	movdqu	xmm9,XMMWORD[32+r12]
+	pxor	xmm5,xmm8
+	movdqu	xmm14,XMMWORD[48+r12]
+	pxor	xmm3,xmm9
+	movdqu	XMMWORD[r13],xmm15
+	movdqu	XMMWORD[16+r13],xmm0
+	movdqu	XMMWORD[32+r13],xmm5
+	movdqu	XMMWORD[48+r13],xmm3
+	jmp	NEAR $L$cbc_dec_done
+ALIGN	16
+$L$cbc_dec_three:
+	movdqa	XMMWORD[32+rbp],xmm14
+	call	_bsaes_decrypt8
+	pxor	xmm15,XMMWORD[32+rbp]
+	movdqu	xmm7,XMMWORD[r12]
+	movdqu	xmm8,XMMWORD[16+r12]
+	pxor	xmm0,xmm7
+	movdqu	xmm14,XMMWORD[32+r12]
+	pxor	xmm5,xmm8
+	movdqu	XMMWORD[r13],xmm15
+	movdqu	XMMWORD[16+r13],xmm0
+	movdqu	XMMWORD[32+r13],xmm5
+	jmp	NEAR $L$cbc_dec_done
+ALIGN	16
+$L$cbc_dec_two:
+	movdqa	XMMWORD[32+rbp],xmm14
+	call	_bsaes_decrypt8
+	pxor	xmm15,XMMWORD[32+rbp]
+	movdqu	xmm7,XMMWORD[r12]
+	movdqu	xmm14,XMMWORD[16+r12]
+	pxor	xmm0,xmm7
+	movdqu	XMMWORD[r13],xmm15
+	movdqu	XMMWORD[16+r13],xmm0
+	jmp	NEAR $L$cbc_dec_done
+ALIGN	16
+$L$cbc_dec_one:
+	lea	rcx,[r12]
+	lea	rdx,[32+rbp]
+	lea	r8,[r15]
+	call	asm_AES_decrypt
+	pxor	xmm14,XMMWORD[32+rbp]
+	movdqu	XMMWORD[r13],xmm14
+	movdqa	xmm14,xmm15
+
+$L$cbc_dec_done:
+	movdqu	XMMWORD[rbx],xmm14
+	lea	rax,[rsp]
+	pxor	xmm0,xmm0
+$L$cbc_dec_bzero:
+	movdqa	XMMWORD[rax],xmm0
+	movdqa	XMMWORD[16+rax],xmm0
+	lea	rax,[32+rax]
+	cmp	rbp,rax
+	ja	NEAR $L$cbc_dec_bzero
+
+	lea	rsp,[rbp]
+	movaps	xmm6,XMMWORD[64+rbp]
+	movaps	xmm7,XMMWORD[80+rbp]
+	movaps	xmm8,XMMWORD[96+rbp]
+	movaps	xmm9,XMMWORD[112+rbp]
+	movaps	xmm10,XMMWORD[128+rbp]
+	movaps	xmm11,XMMWORD[144+rbp]
+	movaps	xmm12,XMMWORD[160+rbp]
+	movaps	xmm13,XMMWORD[176+rbp]
+	movaps	xmm14,XMMWORD[192+rbp]
+	movaps	xmm15,XMMWORD[208+rbp]
+	lea	rsp,[160+rbp]
+	mov	r15,QWORD[72+rsp]
+	mov	r14,QWORD[80+rsp]
+	mov	r13,QWORD[88+rsp]
+	mov	r12,QWORD[96+rsp]
+	mov	rbx,QWORD[104+rsp]
+	mov	rax,QWORD[112+rsp]
+	lea	rsp,[120+rsp]
+	mov	rbp,rax
+$L$cbc_dec_epilogue:
+	DB	0F3h,0C3h		;repret
+
+
+global	bsaes_ctr32_encrypt_blocks
+
+ALIGN	16
+bsaes_ctr32_encrypt_blocks:
+	mov	rax,rsp
+$L$ctr_enc_prologue:
+	push	rbp
+	push	rbx
+	push	r12
+	push	r13
+	push	r14
+	push	r15
+	lea	rsp,[((-72))+rsp]
+	mov	r10,QWORD[160+rsp]
+	lea	rsp,[((-160))+rsp]
+	movaps	XMMWORD[64+rsp],xmm6
+	movaps	XMMWORD[80+rsp],xmm7
+	movaps	XMMWORD[96+rsp],xmm8
+	movaps	XMMWORD[112+rsp],xmm9
+	movaps	XMMWORD[128+rsp],xmm10
+	movaps	XMMWORD[144+rsp],xmm11
+	movaps	XMMWORD[160+rsp],xmm12
+	movaps	XMMWORD[176+rsp],xmm13
+	movaps	XMMWORD[192+rsp],xmm14
+	movaps	XMMWORD[208+rsp],xmm15
+$L$ctr_enc_body:
+	mov	rbp,rsp
+	movdqu	xmm0,XMMWORD[r10]
+	mov	eax,DWORD[240+r9]
+	mov	r12,rcx
+	mov	r13,rdx
+	mov	r14,r8
+	mov	r15,r9
+	movdqa	XMMWORD[32+rbp],xmm0
+	cmp	r8,8
+	jb	NEAR $L$ctr_enc_short
+
+	mov	ebx,eax
+	shl	rax,7
+	sub	rax,96
+	sub	rsp,rax
+
+	mov	rax,rsp
+	mov	rcx,r15
+	mov	r10d,ebx
+	call	_bsaes_key_convert
+	pxor	xmm7,xmm6
+	movdqa	XMMWORD[rax],xmm7
+
+	movdqa	xmm8,XMMWORD[rsp]
+	lea	r11,[$L$ADD1]
+	movdqa	xmm15,XMMWORD[32+rbp]
+	movdqa	xmm7,XMMWORD[((-32))+r11]
+DB	102,68,15,56,0,199
+DB	102,68,15,56,0,255
+	movdqa	XMMWORD[rsp],xmm8
+	jmp	NEAR $L$ctr_enc_loop
+ALIGN	16
+$L$ctr_enc_loop:
+	movdqa	XMMWORD[32+rbp],xmm15
+	movdqa	xmm0,xmm15
+	movdqa	xmm1,xmm15
+	paddd	xmm0,XMMWORD[r11]
+	movdqa	xmm2,xmm15
+	paddd	xmm1,XMMWORD[16+r11]
+	movdqa	xmm3,xmm15
+	paddd	xmm2,XMMWORD[32+r11]
+	movdqa	xmm4,xmm15
+	paddd	xmm3,XMMWORD[48+r11]
+	movdqa	xmm5,xmm15
+	paddd	xmm4,XMMWORD[64+r11]
+	movdqa	xmm6,xmm15
+	paddd	xmm5,XMMWORD[80+r11]
+	paddd	xmm6,XMMWORD[96+r11]
+
+
+
+	movdqa	xmm8,XMMWORD[rsp]
+	lea	rax,[16+rsp]
+	movdqa	xmm7,XMMWORD[((-16))+r11]
+	pxor	xmm15,xmm8
+	pxor	xmm0,xmm8
+	pxor	xmm1,xmm8
+	pxor	xmm2,xmm8
+DB	102,68,15,56,0,255
+DB	102,15,56,0,199
+	pxor	xmm3,xmm8
+	pxor	xmm4,xmm8
+DB	102,15,56,0,207
+DB	102,15,56,0,215
+	pxor	xmm5,xmm8
+	pxor	xmm6,xmm8
+DB	102,15,56,0,223
+DB	102,15,56,0,231
+DB	102,15,56,0,239
+DB	102,15,56,0,247
+	lea	r11,[$L$BS0]
+	mov	r10d,ebx
+
+	call	_bsaes_encrypt8_bitslice
+
+	sub	r14,8
+	jc	NEAR $L$ctr_enc_loop_done
+
+	movdqu	xmm7,XMMWORD[r12]
+	movdqu	xmm8,XMMWORD[16+r12]
+	movdqu	xmm9,XMMWORD[32+r12]
+	movdqu	xmm10,XMMWORD[48+r12]
+	movdqu	xmm11,XMMWORD[64+r12]
+	movdqu	xmm12,XMMWORD[80+r12]
+	movdqu	xmm13,XMMWORD[96+r12]
+	movdqu	xmm14,XMMWORD[112+r12]
+	lea	r12,[128+r12]
+	pxor	xmm7,xmm15
+	movdqa	xmm15,XMMWORD[32+rbp]
+	pxor	xmm0,xmm8
+	movdqu	XMMWORD[r13],xmm7
+	pxor	xmm3,xmm9
+	movdqu	XMMWORD[16+r13],xmm0
+	pxor	xmm5,xmm10
+	movdqu	XMMWORD[32+r13],xmm3
+	pxor	xmm2,xmm11
+	movdqu	XMMWORD[48+r13],xmm5
+	pxor	xmm6,xmm12
+	movdqu	XMMWORD[64+r13],xmm2
+	pxor	xmm1,xmm13
+	movdqu	XMMWORD[80+r13],xmm6
+	pxor	xmm4,xmm14
+	movdqu	XMMWORD[96+r13],xmm1
+	lea	r11,[$L$ADD1]
+	movdqu	XMMWORD[112+r13],xmm4
+	lea	r13,[128+r13]
+	paddd	xmm15,XMMWORD[112+r11]
+	jnz	NEAR $L$ctr_enc_loop
+
+	jmp	NEAR $L$ctr_enc_done
+ALIGN	16
+$L$ctr_enc_loop_done:
+	add	r14,8
+	movdqu	xmm7,XMMWORD[r12]
+	pxor	xmm15,xmm7
+	movdqu	XMMWORD[r13],xmm15
+	cmp	r14,2
+	jb	NEAR $L$ctr_enc_done
+	movdqu	xmm8,XMMWORD[16+r12]
+	pxor	xmm0,xmm8
+	movdqu	XMMWORD[16+r13],xmm0
+	je	NEAR $L$ctr_enc_done
+	movdqu	xmm9,XMMWORD[32+r12]
+	pxor	xmm3,xmm9
+	movdqu	XMMWORD[32+r13],xmm3
+	cmp	r14,4
+	jb	NEAR $L$ctr_enc_done
+	movdqu	xmm10,XMMWORD[48+r12]
+	pxor	xmm5,xmm10
+	movdqu	XMMWORD[48+r13],xmm5
+	je	NEAR $L$ctr_enc_done
+	movdqu	xmm11,XMMWORD[64+r12]
+	pxor	xmm2,xmm11
+	movdqu	XMMWORD[64+r13],xmm2
+	cmp	r14,6
+	jb	NEAR $L$ctr_enc_done
+	movdqu	xmm12,XMMWORD[80+r12]
+	pxor	xmm6,xmm12
+	movdqu	XMMWORD[80+r13],xmm6
+	je	NEAR $L$ctr_enc_done
+	movdqu	xmm13,XMMWORD[96+r12]
+	pxor	xmm1,xmm13
+	movdqu	XMMWORD[96+r13],xmm1
+	jmp	NEAR $L$ctr_enc_done
+
+ALIGN	16
+$L$ctr_enc_short:
+	lea	rcx,[32+rbp]
+	lea	rdx,[48+rbp]
+	lea	r8,[r15]
+	call	asm_AES_encrypt
+	movdqu	xmm0,XMMWORD[r12]
+	lea	r12,[16+r12]
+	mov	eax,DWORD[44+rbp]
+	bswap	eax
+	pxor	xmm0,XMMWORD[48+rbp]
+	inc	eax
+	movdqu	XMMWORD[r13],xmm0
+	bswap	eax
+	lea	r13,[16+r13]
+	mov	DWORD[44+rsp],eax
+	dec	r14
+	jnz	NEAR $L$ctr_enc_short
+
+$L$ctr_enc_done:
+	lea	rax,[rsp]
+	pxor	xmm0,xmm0
+$L$ctr_enc_bzero:
+	movdqa	XMMWORD[rax],xmm0
+	movdqa	XMMWORD[16+rax],xmm0
+	lea	rax,[32+rax]
+	cmp	rbp,rax
+	ja	NEAR $L$ctr_enc_bzero
+
+	lea	rsp,[rbp]
+	movaps	xmm6,XMMWORD[64+rbp]
+	movaps	xmm7,XMMWORD[80+rbp]
+	movaps	xmm8,XMMWORD[96+rbp]
+	movaps	xmm9,XMMWORD[112+rbp]
+	movaps	xmm10,XMMWORD[128+rbp]
+	movaps	xmm11,XMMWORD[144+rbp]
+	movaps	xmm12,XMMWORD[160+rbp]
+	movaps	xmm13,XMMWORD[176+rbp]
+	movaps	xmm14,XMMWORD[192+rbp]
+	movaps	xmm15,XMMWORD[208+rbp]
+	lea	rsp,[160+rbp]
+	mov	r15,QWORD[72+rsp]
+	mov	r14,QWORD[80+rsp]
+	mov	r13,QWORD[88+rsp]
+	mov	r12,QWORD[96+rsp]
+	mov	rbx,QWORD[104+rsp]
+	mov	rax,QWORD[112+rsp]
+	lea	rsp,[120+rsp]
+	mov	rbp,rax
+$L$ctr_enc_epilogue:
+	DB	0F3h,0C3h		;repret
+
+global	bsaes_xts_encrypt
+
+ALIGN	16
+bsaes_xts_encrypt:
+	mov	rax,rsp
+$L$xts_enc_prologue:
+	push	rbp
+	push	rbx
+	push	r12
+	push	r13
+	push	r14
+	push	r15
+	lea	rsp,[((-72))+rsp]
+	mov	r10,QWORD[160+rsp]
+	mov	r11,QWORD[168+rsp]
+	lea	rsp,[((-160))+rsp]
+	movaps	XMMWORD[64+rsp],xmm6
+	movaps	XMMWORD[80+rsp],xmm7
+	movaps	XMMWORD[96+rsp],xmm8
+	movaps	XMMWORD[112+rsp],xmm9
+	movaps	XMMWORD[128+rsp],xmm10
+	movaps	XMMWORD[144+rsp],xmm11
+	movaps	XMMWORD[160+rsp],xmm12
+	movaps	XMMWORD[176+rsp],xmm13
+	movaps	XMMWORD[192+rsp],xmm14
+	movaps	XMMWORD[208+rsp],xmm15
+$L$xts_enc_body:
+	mov	rbp,rsp
+	mov	r12,rcx
+	mov	r13,rdx
+	mov	r14,r8
+	mov	r15,r9
+
+	lea	rcx,[r11]
+	lea	rdx,[32+rbp]
+	lea	r8,[r10]
+	call	asm_AES_encrypt
+
+	mov	eax,DWORD[240+r15]
+	mov	rbx,r14
+
+	mov	edx,eax
+	shl	rax,7
+	sub	rax,96
+	sub	rsp,rax
+
+	mov	rax,rsp
+	mov	rcx,r15
+	mov	r10d,edx
+	call	_bsaes_key_convert
+	pxor	xmm7,xmm6
+	movdqa	XMMWORD[rax],xmm7
+
+	and	r14,-16
+	sub	rsp,0x80
+	movdqa	xmm6,XMMWORD[32+rbp]
+
+	pxor	xmm14,xmm14
+	movdqa	xmm12,XMMWORD[$L$xts_magic]
+	pcmpgtd	xmm14,xmm6
+
+	sub	r14,0x80
+	jc	NEAR $L$xts_enc_short
+	jmp	NEAR $L$xts_enc_loop
+
+ALIGN	16
+$L$xts_enc_loop:
+	pshufd	xmm13,xmm14,0x13
+	pxor	xmm14,xmm14
+	movdqa	xmm15,xmm6
+	movdqa	XMMWORD[rsp],xmm6
+	paddq	xmm6,xmm6
+	pand	xmm13,xmm12
+	pcmpgtd	xmm14,xmm6
+	pxor	xmm6,xmm13
+	pshufd	xmm13,xmm14,0x13
+	pxor	xmm14,xmm14
+	movdqa	xmm0,xmm6
+	movdqa	XMMWORD[16+rsp],xmm6
+	paddq	xmm6,xmm6
+	pand	xmm13,xmm12
+	pcmpgtd	xmm14,xmm6
+	pxor	xmm6,xmm13
+	movdqu	xmm7,XMMWORD[r12]
+	pshufd	xmm13,xmm14,0x13
+	pxor	xmm14,xmm14
+	movdqa	xmm1,xmm6
+	movdqa	XMMWORD[32+rsp],xmm6
+	paddq	xmm6,xmm6
+	pand	xmm13,xmm12
+	pcmpgtd	xmm14,xmm6
+	pxor	xmm6,xmm13
+	movdqu	xmm8,XMMWORD[16+r12]
+	pxor	xmm15,xmm7
+	pshufd	xmm13,xmm14,0x13
+	pxor	xmm14,xmm14
+	movdqa	xmm2,xmm6
+	movdqa	XMMWORD[48+rsp],xmm6
+	paddq	xmm6,xmm6
+	pand	xmm13,xmm12
+	pcmpgtd	xmm14,xmm6
+	pxor	xmm6,xmm13
+	movdqu	xmm9,XMMWORD[32+r12]
+	pxor	xmm0,xmm8
+	pshufd	xmm13,xmm14,0x13
+	pxor	xmm14,xmm14
+	movdqa	xmm3,xmm6
+	movdqa	XMMWORD[64+rsp],xmm6
+	paddq	xmm6,xmm6
+	pand	xmm13,xmm12
+	pcmpgtd	xmm14,xmm6
+	pxor	xmm6,xmm13
+	movdqu	xmm10,XMMWORD[48+r12]
+	pxor	xmm1,xmm9
+	pshufd	xmm13,xmm14,0x13
+	pxor	xmm14,xmm14
+	movdqa	xmm4,xmm6
+	movdqa	XMMWORD[80+rsp],xmm6
+	paddq	xmm6,xmm6
+	pand	xmm13,xmm12
+	pcmpgtd	xmm14,xmm6
+	pxor	xmm6,xmm13
+	movdqu	xmm11,XMMWORD[64+r12]
+	pxor	xmm2,xmm10
+	pshufd	xmm13,xmm14,0x13
+	pxor	xmm14,xmm14
+	movdqa	xmm5,xmm6
+	movdqa	XMMWORD[96+rsp],xmm6
+	paddq	xmm6,xmm6
+	pand	xmm13,xmm12
+	pcmpgtd	xmm14,xmm6
+	pxor	xmm6,xmm13
+	movdqu	xmm12,XMMWORD[80+r12]
+	pxor	xmm3,xmm11
+	movdqu	xmm13,XMMWORD[96+r12]
+	pxor	xmm4,xmm12
+	movdqu	xmm14,XMMWORD[112+r12]
+	lea	r12,[128+r12]
+	movdqa	XMMWORD[112+rsp],xmm6
+	pxor	xmm5,xmm13
+	lea	rax,[128+rsp]
+	pxor	xmm6,xmm14
+	mov	r10d,edx
+
+	call	_bsaes_encrypt8
+
+	pxor	xmm15,XMMWORD[rsp]
+	pxor	xmm0,XMMWORD[16+rsp]
+	movdqu	XMMWORD[r13],xmm15
+	pxor	xmm3,XMMWORD[32+rsp]
+	movdqu	XMMWORD[16+r13],xmm0
+	pxor	xmm5,XMMWORD[48+rsp]
+	movdqu	XMMWORD[32+r13],xmm3
+	pxor	xmm2,XMMWORD[64+rsp]
+	movdqu	XMMWORD[48+r13],xmm5
+	pxor	xmm6,XMMWORD[80+rsp]
+	movdqu	XMMWORD[64+r13],xmm2
+	pxor	xmm1,XMMWORD[96+rsp]
+	movdqu	XMMWORD[80+r13],xmm6
+	pxor	xmm4,XMMWORD[112+rsp]
+	movdqu	XMMWORD[96+r13],xmm1
+	movdqu	XMMWORD[112+r13],xmm4
+	lea	r13,[128+r13]
+
+	movdqa	xmm6,XMMWORD[112+rsp]
+	pxor	xmm14,xmm14
+	movdqa	xmm12,XMMWORD[$L$xts_magic]
+	pcmpgtd	xmm14,xmm6
+	pshufd	xmm13,xmm14,0x13
+	pxor	xmm14,xmm14
+	paddq	xmm6,xmm6
+	pand	xmm13,xmm12
+	pcmpgtd	xmm14,xmm6
+	pxor	xmm6,xmm13
+
+	sub	r14,0x80
+	jnc	NEAR $L$xts_enc_loop
+
+$L$xts_enc_short:
+	add	r14,0x80
+	jz	NEAR $L$xts_enc_done
+	pshufd	xmm13,xmm14,0x13
+	pxor	xmm14,xmm14
+	movdqa	xmm15,xmm6
+	movdqa	XMMWORD[rsp],xmm6
+	paddq	xmm6,xmm6
+	pand	xmm13,xmm12
+	pcmpgtd	xmm14,xmm6
+	pxor	xmm6,xmm13
+	pshufd	xmm13,xmm14,0x13
+	pxor	xmm14,xmm14
+	movdqa	xmm0,xmm6
+	movdqa	XMMWORD[16+rsp],xmm6
+	paddq	xmm6,xmm6
+	pand	xmm13,xmm12
+	pcmpgtd	xmm14,xmm6
+	pxor	xmm6,xmm13
+	movdqu	xmm7,XMMWORD[r12]
+	cmp	r14,16
+	je	NEAR $L$xts_enc_1
+	pshufd	xmm13,xmm14,0x13
+	pxor	xmm14,xmm14
+	movdqa	xmm1,xmm6
+	movdqa	XMMWORD[32+rsp],xmm6
+	paddq	xmm6,xmm6
+	pand	xmm13,xmm12
+	pcmpgtd	xmm14,xmm6
+	pxor	xmm6,xmm13
+	movdqu	xmm8,XMMWORD[16+r12]
+	cmp	r14,32
+	je	NEAR $L$xts_enc_2
+	pxor	xmm15,xmm7
+	pshufd	xmm13,xmm14,0x13
+	pxor	xmm14,xmm14
+	movdqa	xmm2,xmm6
+	movdqa	XMMWORD[48+rsp],xmm6
+	paddq	xmm6,xmm6
+	pand	xmm13,xmm12
+	pcmpgtd	xmm14,xmm6
+	pxor	xmm6,xmm13
+	movdqu	xmm9,XMMWORD[32+r12]
+	cmp	r14,48
+	je	NEAR $L$xts_enc_3
+	pxor	xmm0,xmm8
+	pshufd	xmm13,xmm14,0x13
+	pxor	xmm14,xmm14
+	movdqa	xmm3,xmm6
+	movdqa	XMMWORD[64+rsp],xmm6
+	paddq	xmm6,xmm6
+	pand	xmm13,xmm12
+	pcmpgtd	xmm14,xmm6
+	pxor	xmm6,xmm13
+	movdqu	xmm10,XMMWORD[48+r12]
+	cmp	r14,64
+	je	NEAR $L$xts_enc_4
+	pxor	xmm1,xmm9
+	pshufd	xmm13,xmm14,0x13
+	pxor	xmm14,xmm14
+	movdqa	xmm4,xmm6
+	movdqa	XMMWORD[80+rsp],xmm6
+	paddq	xmm6,xmm6
+	pand	xmm13,xmm12
+	pcmpgtd	xmm14,xmm6
+	pxor	xmm6,xmm13
+	movdqu	xmm11,XMMWORD[64+r12]
+	cmp	r14,80
+	je	NEAR $L$xts_enc_5
+	pxor	xmm2,xmm10
+	pshufd	xmm13,xmm14,0x13
+	pxor	xmm14,xmm14
+	movdqa	xmm5,xmm6
+	movdqa	XMMWORD[96+rsp],xmm6
+	paddq	xmm6,xmm6
+	pand	xmm13,xmm12
+	pcmpgtd	xmm14,xmm6
+	pxor	xmm6,xmm13
+	movdqu	xmm12,XMMWORD[80+r12]
+	cmp	r14,96
+	je	NEAR $L$xts_enc_6
+	pxor	xmm3,xmm11
+	movdqu	xmm13,XMMWORD[96+r12]
+	pxor	xmm4,xmm12
+	movdqa	XMMWORD[112+rsp],xmm6
+	lea	r12,[112+r12]
+	pxor	xmm5,xmm13
+	lea	rax,[128+rsp]
+	mov	r10d,edx
+
+	call	_bsaes_encrypt8
+
+	pxor	xmm15,XMMWORD[rsp]
+	pxor	xmm0,XMMWORD[16+rsp]
+	movdqu	XMMWORD[r13],xmm15
+	pxor	xmm3,XMMWORD[32+rsp]
+	movdqu	XMMWORD[16+r13],xmm0
+	pxor	xmm5,XMMWORD[48+rsp]
+	movdqu	XMMWORD[32+r13],xmm3
+	pxor	xmm2,XMMWORD[64+rsp]
+	movdqu	XMMWORD[48+r13],xmm5
+	pxor	xmm6,XMMWORD[80+rsp]
+	movdqu	XMMWORD[64+r13],xmm2
+	pxor	xmm1,XMMWORD[96+rsp]
+	movdqu	XMMWORD[80+r13],xmm6
+	movdqu	XMMWORD[96+r13],xmm1
+	lea	r13,[112+r13]
+
+	movdqa	xmm6,XMMWORD[112+rsp]
+	jmp	NEAR $L$xts_enc_done
+ALIGN	16
+$L$xts_enc_6:
+	pxor	xmm3,xmm11
+	lea	r12,[96+r12]
+	pxor	xmm4,xmm12
+	lea	rax,[128+rsp]
+	mov	r10d,edx
+
+	call	_bsaes_encrypt8
+
+	pxor	xmm15,XMMWORD[rsp]
+	pxor	xmm0,XMMWORD[16+rsp]
+	movdqu	XMMWORD[r13],xmm15
+	pxor	xmm3,XMMWORD[32+rsp]
+	movdqu	XMMWORD[16+r13],xmm0
+	pxor	xmm5,XMMWORD[48+rsp]
+	movdqu	XMMWORD[32+r13],xmm3
+	pxor	xmm2,XMMWORD[64+rsp]
+	movdqu	XMMWORD[48+r13],xmm5
+	pxor	xmm6,XMMWORD[80+rsp]
+	movdqu	XMMWORD[64+r13],xmm2
+	movdqu	XMMWORD[80+r13],xmm6
+	lea	r13,[96+r13]
+
+	movdqa	xmm6,XMMWORD[96+rsp]
+	jmp	NEAR $L$xts_enc_done
+ALIGN	16
+$L$xts_enc_5:
+	pxor	xmm2,xmm10
+	lea	r12,[80+r12]
+	pxor	xmm3,xmm11
+	lea	rax,[128+rsp]
+	mov	r10d,edx
+
+	call	_bsaes_encrypt8
+
+	pxor	xmm15,XMMWORD[rsp]
+	pxor	xmm0,XMMWORD[16+rsp]
+	movdqu	XMMWORD[r13],xmm15
+	pxor	xmm3,XMMWORD[32+rsp]
+	movdqu	XMMWORD[16+r13],xmm0
+	pxor	xmm5,XMMWORD[48+rsp]
+	movdqu	XMMWORD[32+r13],xmm3
+	pxor	xmm2,XMMWORD[64+rsp]
+	movdqu	XMMWORD[48+r13],xmm5
+	movdqu	XMMWORD[64+r13],xmm2
+	lea	r13,[80+r13]
+
+	movdqa	xmm6,XMMWORD[80+rsp]
+	jmp	NEAR $L$xts_enc_done
+ALIGN	16
+$L$xts_enc_4:
+	pxor	xmm1,xmm9
+	lea	r12,[64+r12]
+	pxor	xmm2,xmm10
+	lea	rax,[128+rsp]
+	mov	r10d,edx
+
+	call	_bsaes_encrypt8
+
+	pxor	xmm15,XMMWORD[rsp]
+	pxor	xmm0,XMMWORD[16+rsp]
+	movdqu	XMMWORD[r13],xmm15
+	pxor	xmm3,XMMWORD[32+rsp]
+	movdqu	XMMWORD[16+r13],xmm0
+	pxor	xmm5,XMMWORD[48+rsp]
+	movdqu	XMMWORD[32+r13],xmm3
+	movdqu	XMMWORD[48+r13],xmm5
+	lea	r13,[64+r13]
+
+	movdqa	xmm6,XMMWORD[64+rsp]
+	jmp	NEAR $L$xts_enc_done
+ALIGN	16
+$L$xts_enc_3:
+	pxor	xmm0,xmm8
+	lea	r12,[48+r12]
+	pxor	xmm1,xmm9
+	lea	rax,[128+rsp]
+	mov	r10d,edx
+
+	call	_bsaes_encrypt8
+
+	pxor	xmm15,XMMWORD[rsp]
+	pxor	xmm0,XMMWORD[16+rsp]
+	movdqu	XMMWORD[r13],xmm15
+	pxor	xmm3,XMMWORD[32+rsp]
+	movdqu	XMMWORD[16+r13],xmm0
+	movdqu	XMMWORD[32+r13],xmm3
+	lea	r13,[48+r13]
+
+	movdqa	xmm6,XMMWORD[48+rsp]
+	jmp	NEAR $L$xts_enc_done
+ALIGN	16
+$L$xts_enc_2:
+	pxor	xmm15,xmm7
+	lea	r12,[32+r12]
+	pxor	xmm0,xmm8
+	lea	rax,[128+rsp]
+	mov	r10d,edx
+
+	call	_bsaes_encrypt8
+
+	pxor	xmm15,XMMWORD[rsp]
+	pxor	xmm0,XMMWORD[16+rsp]
+	movdqu	XMMWORD[r13],xmm15
+	movdqu	XMMWORD[16+r13],xmm0
+	lea	r13,[32+r13]
+
+	movdqa	xmm6,XMMWORD[32+rsp]
+	jmp	NEAR $L$xts_enc_done
+ALIGN	16
+$L$xts_enc_1:
+	pxor	xmm7,xmm15
+	lea	r12,[16+r12]
+	movdqa	XMMWORD[32+rbp],xmm7
+	lea	rcx,[32+rbp]
+	lea	rdx,[32+rbp]
+	lea	r8,[r15]
+	call	asm_AES_encrypt
+	pxor	xmm15,XMMWORD[32+rbp]
+
+
+
+
+
+	movdqu	XMMWORD[r13],xmm15
+	lea	r13,[16+r13]
+
+	movdqa	xmm6,XMMWORD[16+rsp]
+
+$L$xts_enc_done:
+	and	ebx,15
+	jz	NEAR $L$xts_enc_ret
+	mov	rdx,r13
+
+$L$xts_enc_steal:
+	movzx	eax,BYTE[r12]
+	movzx	ecx,BYTE[((-16))+rdx]
+	lea	r12,[1+r12]
+	mov	BYTE[((-16))+rdx],al
+	mov	BYTE[rdx],cl
+	lea	rdx,[1+rdx]
+	sub	ebx,1
+	jnz	NEAR $L$xts_enc_steal
+
+	movdqu	xmm15,XMMWORD[((-16))+r13]
+	lea	rcx,[32+rbp]
+	pxor	xmm15,xmm6
+	lea	rdx,[32+rbp]
+	movdqa	XMMWORD[32+rbp],xmm15
+	lea	r8,[r15]
+	call	asm_AES_encrypt
+	pxor	xmm6,XMMWORD[32+rbp]
+	movdqu	XMMWORD[(-16)+r13],xmm6
+
+$L$xts_enc_ret:
+	lea	rax,[rsp]
+	pxor	xmm0,xmm0
+$L$xts_enc_bzero:
+	movdqa	XMMWORD[rax],xmm0
+	movdqa	XMMWORD[16+rax],xmm0
+	lea	rax,[32+rax]
+	cmp	rbp,rax
+	ja	NEAR $L$xts_enc_bzero
+
+	lea	rsp,[rbp]
+	movaps	xmm6,XMMWORD[64+rbp]
+	movaps	xmm7,XMMWORD[80+rbp]
+	movaps	xmm8,XMMWORD[96+rbp]
+	movaps	xmm9,XMMWORD[112+rbp]
+	movaps	xmm10,XMMWORD[128+rbp]
+	movaps	xmm11,XMMWORD[144+rbp]
+	movaps	xmm12,XMMWORD[160+rbp]
+	movaps	xmm13,XMMWORD[176+rbp]
+	movaps	xmm14,XMMWORD[192+rbp]
+	movaps	xmm15,XMMWORD[208+rbp]
+	lea	rsp,[160+rbp]
+	mov	r15,QWORD[72+rsp]
+	mov	r14,QWORD[80+rsp]
+	mov	r13,QWORD[88+rsp]
+	mov	r12,QWORD[96+rsp]
+	mov	rbx,QWORD[104+rsp]
+	mov	rax,QWORD[112+rsp]
+	lea	rsp,[120+rsp]
+	mov	rbp,rax
+$L$xts_enc_epilogue:
+	DB	0F3h,0C3h		;repret
+
+
+global	bsaes_xts_decrypt
+
+ALIGN	16
+bsaes_xts_decrypt:
+	mov	rax,rsp
+$L$xts_dec_prologue:
+	push	rbp
+	push	rbx
+	push	r12
+	push	r13
+	push	r14
+	push	r15
+	lea	rsp,[((-72))+rsp]
+	mov	r10,QWORD[160+rsp]
+	mov	r11,QWORD[168+rsp]
+	lea	rsp,[((-160))+rsp]
+	movaps	XMMWORD[64+rsp],xmm6
+	movaps	XMMWORD[80+rsp],xmm7
+	movaps	XMMWORD[96+rsp],xmm8
+	movaps	XMMWORD[112+rsp],xmm9
+	movaps	XMMWORD[128+rsp],xmm10
+	movaps	XMMWORD[144+rsp],xmm11
+	movaps	XMMWORD[160+rsp],xmm12
+	movaps	XMMWORD[176+rsp],xmm13
+	movaps	XMMWORD[192+rsp],xmm14
+	movaps	XMMWORD[208+rsp],xmm15
+$L$xts_dec_body:
+	mov	rbp,rsp
+	mov	r12,rcx
+	mov	r13,rdx
+	mov	r14,r8
+	mov	r15,r9
+
+	lea	rcx,[r11]
+	lea	rdx,[32+rbp]
+	lea	r8,[r10]
+	call	asm_AES_encrypt
+
+	mov	eax,DWORD[240+r15]
+	mov	rbx,r14
+
+	mov	edx,eax
+	shl	rax,7
+	sub	rax,96
+	sub	rsp,rax
+
+	mov	rax,rsp
+	mov	rcx,r15
+	mov	r10d,edx
+	call	_bsaes_key_convert
+	pxor	xmm7,XMMWORD[rsp]
+	movdqa	XMMWORD[rax],xmm6
+	movdqa	XMMWORD[rsp],xmm7
+
+	xor	eax,eax
+	and	r14,-16
+	test	ebx,15
+	setnz	al
+	shl	rax,4
+	sub	r14,rax
+
+	sub	rsp,0x80
+	movdqa	xmm6,XMMWORD[32+rbp]
+
+	pxor	xmm14,xmm14
+	movdqa	xmm12,XMMWORD[$L$xts_magic]
+	pcmpgtd	xmm14,xmm6
+
+	sub	r14,0x80
+	jc	NEAR $L$xts_dec_short
+	jmp	NEAR $L$xts_dec_loop
+
+ALIGN	16
+$L$xts_dec_loop:
+	pshufd	xmm13,xmm14,0x13
+	pxor	xmm14,xmm14
+	movdqa	xmm15,xmm6
+	movdqa	XMMWORD[rsp],xmm6
+	paddq	xmm6,xmm6
+	pand	xmm13,xmm12
+	pcmpgtd	xmm14,xmm6
+	pxor	xmm6,xmm13
+	pshufd	xmm13,xmm14,0x13
+	pxor	xmm14,xmm14
+	movdqa	xmm0,xmm6
+	movdqa	XMMWORD[16+rsp],xmm6
+	paddq	xmm6,xmm6
+	pand	xmm13,xmm12
+	pcmpgtd	xmm14,xmm6
+	pxor	xmm6,xmm13
+	movdqu	xmm7,XMMWORD[r12]
+	pshufd	xmm13,xmm14,0x13
+	pxor	xmm14,xmm14
+	movdqa	xmm1,xmm6
+	movdqa	XMMWORD[32+rsp],xmm6
+	paddq	xmm6,xmm6
+	pand	xmm13,xmm12
+	pcmpgtd	xmm14,xmm6
+	pxor	xmm6,xmm13
+	movdqu	xmm8,XMMWORD[16+r12]
+	pxor	xmm15,xmm7
+	pshufd	xmm13,xmm14,0x13
+	pxor	xmm14,xmm14
+	movdqa	xmm2,xmm6
+	movdqa	XMMWORD[48+rsp],xmm6
+	paddq	xmm6,xmm6
+	pand	xmm13,xmm12
+	pcmpgtd	xmm14,xmm6
+	pxor	xmm6,xmm13
+	movdqu	xmm9,XMMWORD[32+r12]
+	pxor	xmm0,xmm8
+	pshufd	xmm13,xmm14,0x13
+	pxor	xmm14,xmm14
+	movdqa	xmm3,xmm6
+	movdqa	XMMWORD[64+rsp],xmm6
+	paddq	xmm6,xmm6
+	pand	xmm13,xmm12
+	pcmpgtd	xmm14,xmm6
+	pxor	xmm6,xmm13
+	movdqu	xmm10,XMMWORD[48+r12]
+	pxor	xmm1,xmm9
+	pshufd	xmm13,xmm14,0x13
+	pxor	xmm14,xmm14
+	movdqa	xmm4,xmm6
+	movdqa	XMMWORD[80+rsp],xmm6
+	paddq	xmm6,xmm6
+	pand	xmm13,xmm12
+	pcmpgtd	xmm14,xmm6
+	pxor	xmm6,xmm13
+	movdqu	xmm11,XMMWORD[64+r12]
+	pxor	xmm2,xmm10
+	pshufd	xmm13,xmm14,0x13
+	pxor	xmm14,xmm14
+	movdqa	xmm5,xmm6
+	movdqa	XMMWORD[96+rsp],xmm6
+	paddq	xmm6,xmm6
+	pand	xmm13,xmm12
+	pcmpgtd	xmm14,xmm6
+	pxor	xmm6,xmm13
+	movdqu	xmm12,XMMWORD[80+r12]
+	pxor	xmm3,xmm11
+	movdqu	xmm13,XMMWORD[96+r12]
+	pxor	xmm4,xmm12
+	movdqu	xmm14,XMMWORD[112+r12]
+	lea	r12,[128+r12]
+	movdqa	XMMWORD[112+rsp],xmm6
+	pxor	xmm5,xmm13
+	lea	rax,[128+rsp]
+	pxor	xmm6,xmm14
+	mov	r10d,edx
+
+	call	_bsaes_decrypt8
+
+	pxor	xmm15,XMMWORD[rsp]
+	pxor	xmm0,XMMWORD[16+rsp]
+	movdqu	XMMWORD[r13],xmm15
+	pxor	xmm5,XMMWORD[32+rsp]
+	movdqu	XMMWORD[16+r13],xmm0
+	pxor	xmm3,XMMWORD[48+rsp]
+	movdqu	XMMWORD[32+r13],xmm5
+	pxor	xmm1,XMMWORD[64+rsp]
+	movdqu	XMMWORD[48+r13],xmm3
+	pxor	xmm6,XMMWORD[80+rsp]
+	movdqu	XMMWORD[64+r13],xmm1
+	pxor	xmm2,XMMWORD[96+rsp]
+	movdqu	XMMWORD[80+r13],xmm6
+	pxor	xmm4,XMMWORD[112+rsp]
+	movdqu	XMMWORD[96+r13],xmm2
+	movdqu	XMMWORD[112+r13],xmm4
+	lea	r13,[128+r13]
+
+	movdqa	xmm6,XMMWORD[112+rsp]
+	pxor	xmm14,xmm14
+	movdqa	xmm12,XMMWORD[$L$xts_magic]
+	pcmpgtd	xmm14,xmm6
+	pshufd	xmm13,xmm14,0x13
+	pxor	xmm14,xmm14
+	paddq	xmm6,xmm6
+	pand	xmm13,xmm12
+	pcmpgtd	xmm14,xmm6
+	pxor	xmm6,xmm13
+
+	sub	r14,0x80
+	jnc	NEAR $L$xts_dec_loop
+
+$L$xts_dec_short:
+	add	r14,0x80
+	jz	NEAR $L$xts_dec_done
+	pshufd	xmm13,xmm14,0x13
+	pxor	xmm14,xmm14
+	movdqa	xmm15,xmm6
+	movdqa	XMMWORD[rsp],xmm6
+	paddq	xmm6,xmm6
+	pand	xmm13,xmm12
+	pcmpgtd	xmm14,xmm6
+	pxor	xmm6,xmm13
+	pshufd	xmm13,xmm14,0x13
+	pxor	xmm14,xmm14
+	movdqa	xmm0,xmm6
+	movdqa	XMMWORD[16+rsp],xmm6
+	paddq	xmm6,xmm6
+	pand	xmm13,xmm12
+	pcmpgtd	xmm14,xmm6
+	pxor	xmm6,xmm13
+	movdqu	xmm7,XMMWORD[r12]
+	cmp	r14,16
+	je	NEAR $L$xts_dec_1
+	pshufd	xmm13,xmm14,0x13
+	pxor	xmm14,xmm14
+	movdqa	xmm1,xmm6
+	movdqa	XMMWORD[32+rsp],xmm6
+	paddq	xmm6,xmm6
+	pand	xmm13,xmm12
+	pcmpgtd	xmm14,xmm6
+	pxor	xmm6,xmm13
+	movdqu	xmm8,XMMWORD[16+r12]
+	cmp	r14,32
+	je	NEAR $L$xts_dec_2
+	pxor	xmm15,xmm7
+	pshufd	xmm13,xmm14,0x13
+	pxor	xmm14,xmm14
+	movdqa	xmm2,xmm6
+	movdqa	XMMWORD[48+rsp],xmm6
+	paddq	xmm6,xmm6
+	pand	xmm13,xmm12
+	pcmpgtd	xmm14,xmm6
+	pxor	xmm6,xmm13
+	movdqu	xmm9,XMMWORD[32+r12]
+	cmp	r14,48
+	je	NEAR $L$xts_dec_3
+	pxor	xmm0,xmm8
+	pshufd	xmm13,xmm14,0x13
+	pxor	xmm14,xmm14
+	movdqa	xmm3,xmm6
+	movdqa	XMMWORD[64+rsp],xmm6
+	paddq	xmm6,xmm6
+	pand	xmm13,xmm12
+	pcmpgtd	xmm14,xmm6
+	pxor	xmm6,xmm13
+	movdqu	xmm10,XMMWORD[48+r12]
+	cmp	r14,64
+	je	NEAR $L$xts_dec_4
+	pxor	xmm1,xmm9
+	pshufd	xmm13,xmm14,0x13
+	pxor	xmm14,xmm14
+	movdqa	xmm4,xmm6
+	movdqa	XMMWORD[80+rsp],xmm6
+	paddq	xmm6,xmm6
+	pand	xmm13,xmm12
+	pcmpgtd	xmm14,xmm6
+	pxor	xmm6,xmm13
+	movdqu	xmm11,XMMWORD[64+r12]
+	cmp	r14,80
+	je	NEAR $L$xts_dec_5
+	pxor	xmm2,xmm10
+	pshufd	xmm13,xmm14,0x13
+	pxor	xmm14,xmm14
+	movdqa	xmm5,xmm6
+	movdqa	XMMWORD[96+rsp],xmm6
+	paddq	xmm6,xmm6
+	pand	xmm13,xmm12
+	pcmpgtd	xmm14,xmm6
+	pxor	xmm6,xmm13
+	movdqu	xmm12,XMMWORD[80+r12]
+	cmp	r14,96
+	je	NEAR $L$xts_dec_6
+	pxor	xmm3,xmm11
+	movdqu	xmm13,XMMWORD[96+r12]
+	pxor	xmm4,xmm12
+	movdqa	XMMWORD[112+rsp],xmm6
+	lea	r12,[112+r12]
+	pxor	xmm5,xmm13
+	lea	rax,[128+rsp]
+	mov	r10d,edx
+
+	call	_bsaes_decrypt8
+
+	pxor	xmm15,XMMWORD[rsp]
+	pxor	xmm0,XMMWORD[16+rsp]
+	movdqu	XMMWORD[r13],xmm15
+	pxor	xmm5,XMMWORD[32+rsp]
+	movdqu	XMMWORD[16+r13],xmm0
+	pxor	xmm3,XMMWORD[48+rsp]
+	movdqu	XMMWORD[32+r13],xmm5
+	pxor	xmm1,XMMWORD[64+rsp]
+	movdqu	XMMWORD[48+r13],xmm3
+	pxor	xmm6,XMMWORD[80+rsp]
+	movdqu	XMMWORD[64+r13],xmm1
+	pxor	xmm2,XMMWORD[96+rsp]
+	movdqu	XMMWORD[80+r13],xmm6
+	movdqu	XMMWORD[96+r13],xmm2
+	lea	r13,[112+r13]
+
+	movdqa	xmm6,XMMWORD[112+rsp]
+	jmp	NEAR $L$xts_dec_done
+ALIGN	16
+$L$xts_dec_6:
+	pxor	xmm3,xmm11
+	lea	r12,[96+r12]
+	pxor	xmm4,xmm12
+	lea	rax,[128+rsp]
+	mov	r10d,edx
+
+	call	_bsaes_decrypt8
+
+	pxor	xmm15,XMMWORD[rsp]
+	pxor	xmm0,XMMWORD[16+rsp]
+	movdqu	XMMWORD[r13],xmm15
+	pxor	xmm5,XMMWORD[32+rsp]
+	movdqu	XMMWORD[16+r13],xmm0
+	pxor	xmm3,XMMWORD[48+rsp]
+	movdqu	XMMWORD[32+r13],xmm5
+	pxor	xmm1,XMMWORD[64+rsp]
+	movdqu	XMMWORD[48+r13],xmm3
+	pxor	xmm6,XMMWORD[80+rsp]
+	movdqu	XMMWORD[64+r13],xmm1
+	movdqu	XMMWORD[80+r13],xmm6
+	lea	r13,[96+r13]
+
+	movdqa	xmm6,XMMWORD[96+rsp]
+	jmp	NEAR $L$xts_dec_done
+ALIGN	16
+$L$xts_dec_5:
+	pxor	xmm2,xmm10
+	lea	r12,[80+r12]
+	pxor	xmm3,xmm11
+	lea	rax,[128+rsp]
+	mov	r10d,edx
+
+	call	_bsaes_decrypt8
+
+	pxor	xmm15,XMMWORD[rsp]
+	pxor	xmm0,XMMWORD[16+rsp]
+	movdqu	XMMWORD[r13],xmm15
+	pxor	xmm5,XMMWORD[32+rsp]
+	movdqu	XMMWORD[16+r13],xmm0
+	pxor	xmm3,XMMWORD[48+rsp]
+	movdqu	XMMWORD[32+r13],xmm5
+	pxor	xmm1,XMMWORD[64+rsp]
+	movdqu	XMMWORD[48+r13],xmm3
+	movdqu	XMMWORD[64+r13],xmm1
+	lea	r13,[80+r13]
+
+	movdqa	xmm6,XMMWORD[80+rsp]
+	jmp	NEAR $L$xts_dec_done
+ALIGN	16
+$L$xts_dec_4:
+	pxor	xmm1,xmm9
+	lea	r12,[64+r12]
+	pxor	xmm2,xmm10
+	lea	rax,[128+rsp]
+	mov	r10d,edx
+
+	call	_bsaes_decrypt8
+
+	pxor	xmm15,XMMWORD[rsp]
+	pxor	xmm0,XMMWORD[16+rsp]
+	movdqu	XMMWORD[r13],xmm15
+	pxor	xmm5,XMMWORD[32+rsp]
+	movdqu	XMMWORD[16+r13],xmm0
+	pxor	xmm3,XMMWORD[48+rsp]
+	movdqu	XMMWORD[32+r13],xmm5
+	movdqu	XMMWORD[48+r13],xmm3
+	lea	r13,[64+r13]
+
+	movdqa	xmm6,XMMWORD[64+rsp]
+	jmp	NEAR $L$xts_dec_done
+ALIGN	16
+$L$xts_dec_3:
+	pxor	xmm0,xmm8
+	lea	r12,[48+r12]
+	pxor	xmm1,xmm9
+	lea	rax,[128+rsp]
+	mov	r10d,edx
+
+	call	_bsaes_decrypt8
+
+	pxor	xmm15,XMMWORD[rsp]
+	pxor	xmm0,XMMWORD[16+rsp]
+	movdqu	XMMWORD[r13],xmm15
+	pxor	xmm5,XMMWORD[32+rsp]
+	movdqu	XMMWORD[16+r13],xmm0
+	movdqu	XMMWORD[32+r13],xmm5
+	lea	r13,[48+r13]
+
+	movdqa	xmm6,XMMWORD[48+rsp]
+	jmp	NEAR $L$xts_dec_done
+ALIGN	16
+$L$xts_dec_2:
+	pxor	xmm15,xmm7
+	lea	r12,[32+r12]
+	pxor	xmm0,xmm8
+	lea	rax,[128+rsp]
+	mov	r10d,edx
+
+	call	_bsaes_decrypt8
+
+	pxor	xmm15,XMMWORD[rsp]
+	pxor	xmm0,XMMWORD[16+rsp]
+	movdqu	XMMWORD[r13],xmm15
+	movdqu	XMMWORD[16+r13],xmm0
+	lea	r13,[32+r13]
+
+	movdqa	xmm6,XMMWORD[32+rsp]
+	jmp	NEAR $L$xts_dec_done
+ALIGN	16
+$L$xts_dec_1:
+	pxor	xmm7,xmm15
+	lea	r12,[16+r12]
+	movdqa	XMMWORD[32+rbp],xmm7
+	lea	rcx,[32+rbp]
+	lea	rdx,[32+rbp]
+	lea	r8,[r15]
+	call	asm_AES_decrypt
+	pxor	xmm15,XMMWORD[32+rbp]
+
+
+
+
+
+	movdqu	XMMWORD[r13],xmm15
+	lea	r13,[16+r13]
+
+	movdqa	xmm6,XMMWORD[16+rsp]
+
+$L$xts_dec_done:
+	and	ebx,15
+	jz	NEAR $L$xts_dec_ret
+
+	pxor	xmm14,xmm14
+	movdqa	xmm12,XMMWORD[$L$xts_magic]
+	pcmpgtd	xmm14,xmm6
+	pshufd	xmm13,xmm14,0x13
+	movdqa	xmm5,xmm6
+	paddq	xmm6,xmm6
+	pand	xmm13,xmm12
+	movdqu	xmm15,XMMWORD[r12]
+	pxor	xmm6,xmm13
+
+	lea	rcx,[32+rbp]
+	pxor	xmm15,xmm6
+	lea	rdx,[32+rbp]
+	movdqa	XMMWORD[32+rbp],xmm15
+	lea	r8,[r15]
+	call	asm_AES_decrypt
+	pxor	xmm6,XMMWORD[32+rbp]
+	mov	rdx,r13
+	movdqu	XMMWORD[r13],xmm6
+
+$L$xts_dec_steal:
+	movzx	eax,BYTE[16+r12]
+	movzx	ecx,BYTE[rdx]
+	lea	r12,[1+r12]
+	mov	BYTE[rdx],al
+	mov	BYTE[16+rdx],cl
+	lea	rdx,[1+rdx]
+	sub	ebx,1
+	jnz	NEAR $L$xts_dec_steal
+
+	movdqu	xmm15,XMMWORD[r13]
+	lea	rcx,[32+rbp]
+	pxor	xmm15,xmm5
+	lea	rdx,[32+rbp]
+	movdqa	XMMWORD[32+rbp],xmm15
+	lea	r8,[r15]
+	call	asm_AES_decrypt
+	pxor	xmm5,XMMWORD[32+rbp]
+	movdqu	XMMWORD[r13],xmm5
+
+$L$xts_dec_ret:
+	lea	rax,[rsp]
+	pxor	xmm0,xmm0
+$L$xts_dec_bzero:
+	movdqa	XMMWORD[rax],xmm0
+	movdqa	XMMWORD[16+rax],xmm0
+	lea	rax,[32+rax]
+	cmp	rbp,rax
+	ja	NEAR $L$xts_dec_bzero
+
+	lea	rsp,[rbp]
+	movaps	xmm6,XMMWORD[64+rbp]
+	movaps	xmm7,XMMWORD[80+rbp]
+	movaps	xmm8,XMMWORD[96+rbp]
+	movaps	xmm9,XMMWORD[112+rbp]
+	movaps	xmm10,XMMWORD[128+rbp]
+	movaps	xmm11,XMMWORD[144+rbp]
+	movaps	xmm12,XMMWORD[160+rbp]
+	movaps	xmm13,XMMWORD[176+rbp]
+	movaps	xmm14,XMMWORD[192+rbp]
+	movaps	xmm15,XMMWORD[208+rbp]
+	lea	rsp,[160+rbp]
+	mov	r15,QWORD[72+rsp]
+	mov	r14,QWORD[80+rsp]
+	mov	r13,QWORD[88+rsp]
+	mov	r12,QWORD[96+rsp]
+	mov	rbx,QWORD[104+rsp]
+	mov	rax,QWORD[112+rsp]
+	lea	rsp,[120+rsp]
+	mov	rbp,rax
+$L$xts_dec_epilogue:
+	DB	0F3h,0C3h		;repret
+
+
+ALIGN	64
+_bsaes_const:
+$L$M0ISR:
+	DQ	0x0a0e0206070b0f03,0x0004080c0d010509
+$L$ISRM0:
+	DQ	0x01040b0e0205080f,0x0306090c00070a0d
+$L$ISR:
+	DQ	0x0504070602010003,0x0f0e0d0c080b0a09
+$L$BS0:
+	DQ	0x5555555555555555,0x5555555555555555
+$L$BS1:
+	DQ	0x3333333333333333,0x3333333333333333
+$L$BS2:
+	DQ	0x0f0f0f0f0f0f0f0f,0x0f0f0f0f0f0f0f0f
+$L$SR:
+	DQ	0x0504070600030201,0x0f0e0d0c0a09080b
+$L$SRM0:
+	DQ	0x0304090e00050a0f,0x01060b0c0207080d
+$L$M0SR:
+	DQ	0x0a0e02060f03070b,0x0004080c05090d01
+$L$SWPUP:
+	DQ	0x0706050403020100,0x0c0d0e0f0b0a0908
+$L$SWPUPM0SR:
+	DQ	0x0a0d02060c03070b,0x0004080f05090e01
+$L$ADD1:
+	DQ	0x0000000000000000,0x0000000100000000
+$L$ADD2:
+	DQ	0x0000000000000000,0x0000000200000000
+$L$ADD3:
+	DQ	0x0000000000000000,0x0000000300000000
+$L$ADD4:
+	DQ	0x0000000000000000,0x0000000400000000
+$L$ADD5:
+	DQ	0x0000000000000000,0x0000000500000000
+$L$ADD6:
+	DQ	0x0000000000000000,0x0000000600000000
+$L$ADD7:
+	DQ	0x0000000000000000,0x0000000700000000
+$L$ADD8:
+	DQ	0x0000000000000000,0x0000000800000000
+$L$xts_magic:
+	DD	0x87,0,1,0
+$L$masks:
+	DQ	0x0101010101010101,0x0101010101010101
+	DQ	0x0202020202020202,0x0202020202020202
+	DQ	0x0404040404040404,0x0404040404040404
+	DQ	0x0808080808080808,0x0808080808080808
+$L$M0:
+	DQ	0x02060a0e03070b0f,0x0004080c0105090d
+$L$63:
+	DQ	0x6363636363636363,0x6363636363636363
+DB	66,105,116,45,115,108,105,99,101,100,32,65,69,83,32,102
+DB	111,114,32,120,56,54,95,54,52,47,83,83,83,69,51,44
+DB	32,69,109,105,108,105,97,32,75,195,164,115,112,101,114,44
+DB	32,80,101,116,101,114,32,83,99,104,119,97,98,101,44,32
+DB	65,110,100,121,32,80,111,108,121,97,107,111,118,0
+ALIGN	64
+
+EXTERN	__imp_RtlVirtualUnwind
+
+ALIGN	16
+se_handler:
+	push	rsi
+	push	rdi
+	push	rbx
+	push	rbp
+	push	r12
+	push	r13
+	push	r14
+	push	r15
+	pushfq
+	sub	rsp,64
+
+	mov	rax,QWORD[120+r8]
+	mov	rbx,QWORD[248+r8]
+
+	mov	rsi,QWORD[8+r9]
+	mov	r11,QWORD[56+r9]
+
+	mov	r10d,DWORD[r11]
+	lea	r10,[r10*1+rsi]
+	cmp	rbx,r10
+	jb	NEAR $L$in_prologue
+
+	mov	rax,QWORD[152+r8]
+
+	mov	r10d,DWORD[4+r11]
+	lea	r10,[r10*1+rsi]
+	cmp	rbx,r10
+	jae	NEAR $L$in_prologue
+
+	mov	rax,QWORD[160+r8]
+
+	lea	rsi,[64+rax]
+	lea	rdi,[512+r8]
+	mov	ecx,20
+	DD	0xa548f3fc
+	lea	rax,[160+rax]
+
+	mov	rbp,QWORD[112+rax]
+	mov	rbx,QWORD[104+rax]
+	mov	r12,QWORD[96+rax]
+	mov	r13,QWORD[88+rax]
+	mov	r14,QWORD[80+rax]
+	mov	r15,QWORD[72+rax]
+	lea	rax,[120+rax]
+	mov	QWORD[144+r8],rbx
+	mov	QWORD[160+r8],rbp
+	mov	QWORD[216+r8],r12
+	mov	QWORD[224+r8],r13
+	mov	QWORD[232+r8],r14
+	mov	QWORD[240+r8],r15
+
+$L$in_prologue:
+	mov	QWORD[152+r8],rax
+
+	mov	rdi,QWORD[40+r9]
+	mov	rsi,r8
+	mov	ecx,154
+	DD	0xa548f3fc
+
+	mov	rsi,r9
+	xor	rcx,rcx
+	mov	rdx,QWORD[8+rsi]
+	mov	r8,QWORD[rsi]
+	mov	r9,QWORD[16+rsi]
+	mov	r10,QWORD[40+rsi]
+	lea	r11,[56+rsi]
+	lea	r12,[24+rsi]
+	mov	QWORD[32+rsp],r10
+	mov	QWORD[40+rsp],r11
+	mov	QWORD[48+rsp],r12
+	mov	QWORD[56+rsp],rcx
+	call	QWORD[__imp_RtlVirtualUnwind]
+
+	mov	eax,1
+	add	rsp,64
+	popfq
+	pop	r15
+	pop	r14
+	pop	r13
+	pop	r12
+	pop	rbp
+	pop	rbx
+	pop	rdi
+	pop	rsi
+	DB	0F3h,0C3h		;repret
+
+
+section	.pdata rdata align=4
+ALIGN	4
+	DD	$L$cbc_dec_prologue wrt ..imagebase
+	DD	$L$cbc_dec_epilogue wrt ..imagebase
+	DD	$L$cbc_dec_info wrt ..imagebase
+
+	DD	$L$ctr_enc_prologue wrt ..imagebase
+	DD	$L$ctr_enc_epilogue wrt ..imagebase
+	DD	$L$ctr_enc_info wrt ..imagebase
+
+	DD	$L$xts_enc_prologue wrt ..imagebase
+	DD	$L$xts_enc_epilogue wrt ..imagebase
+	DD	$L$xts_enc_info wrt ..imagebase
+
+	DD	$L$xts_dec_prologue wrt ..imagebase
+	DD	$L$xts_dec_epilogue wrt ..imagebase
+	DD	$L$xts_dec_info wrt ..imagebase
+
+section	.xdata rdata align=8
+ALIGN	8
+$L$cbc_dec_info:
+DB	9,0,0,0
+	DD	se_handler wrt ..imagebase
+	DD	$L$cbc_dec_body wrt ..imagebase,$L$cbc_dec_epilogue wrt ..imagebase
+$L$ctr_enc_info:
+DB	9,0,0,0
+	DD	se_handler wrt ..imagebase
+	DD	$L$ctr_enc_body wrt ..imagebase,$L$ctr_enc_epilogue wrt ..imagebase
+$L$xts_enc_info:
+DB	9,0,0,0
+	DD	se_handler wrt ..imagebase
+	DD	$L$xts_enc_body wrt ..imagebase,$L$xts_enc_epilogue wrt ..imagebase
+$L$xts_dec_info:
+DB	9,0,0,0
+	DD	se_handler wrt ..imagebase
+	DD	$L$xts_dec_body wrt ..imagebase,$L$xts_dec_epilogue wrt ..imagebase
diff --git a/third_party/boringssl/win-x86_64/crypto/aes/vpaes-x86_64.asm b/third_party/boringssl/win-x86_64/crypto/aes/vpaes-x86_64.asm
new file mode 100644
index 0000000..3edde9f
--- /dev/null
+++ b/third_party/boringssl/win-x86_64/crypto/aes/vpaes-x86_64.asm
@@ -0,0 +1,1137 @@
+default	rel
+%define XMMWORD
+%define YMMWORD
+%define ZMMWORD
+section	.text code align=64
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ALIGN	16
+_vpaes_encrypt_core:
+	mov	r9,rdx
+	mov	r11,16
+	mov	eax,DWORD[240+rdx]
+	movdqa	xmm1,xmm9
+	movdqa	xmm2,XMMWORD[$L$k_ipt]
+	pandn	xmm1,xmm0
+	movdqu	xmm5,XMMWORD[r9]
+	psrld	xmm1,4
+	pand	xmm0,xmm9
+DB	102,15,56,0,208
+	movdqa	xmm0,XMMWORD[(($L$k_ipt+16))]
+DB	102,15,56,0,193
+	pxor	xmm2,xmm5
+	add	r9,16
+	pxor	xmm0,xmm2
+	lea	r10,[$L$k_mc_backward]
+	jmp	NEAR $L$enc_entry
+
+ALIGN	16
+$L$enc_loop:
+
+	movdqa	xmm4,xmm13
+	movdqa	xmm0,xmm12
+DB	102,15,56,0,226
+DB	102,15,56,0,195
+	pxor	xmm4,xmm5
+	movdqa	xmm5,xmm15
+	pxor	xmm0,xmm4
+	movdqa	xmm1,XMMWORD[((-64))+r10*1+r11]
+DB	102,15,56,0,234
+	movdqa	xmm4,XMMWORD[r10*1+r11]
+	movdqa	xmm2,xmm14
+DB	102,15,56,0,211
+	movdqa	xmm3,xmm0
+	pxor	xmm2,xmm5
+DB	102,15,56,0,193
+	add	r9,16
+	pxor	xmm0,xmm2
+DB	102,15,56,0,220
+	add	r11,16
+	pxor	xmm3,xmm0
+DB	102,15,56,0,193
+	and	r11,0x30
+	sub	rax,1
+	pxor	xmm0,xmm3
+
+$L$enc_entry:
+
+	movdqa	xmm1,xmm9
+	movdqa	xmm5,xmm11
+	pandn	xmm1,xmm0
+	psrld	xmm1,4
+	pand	xmm0,xmm9
+DB	102,15,56,0,232
+	movdqa	xmm3,xmm10
+	pxor	xmm0,xmm1
+DB	102,15,56,0,217
+	movdqa	xmm4,xmm10
+	pxor	xmm3,xmm5
+DB	102,15,56,0,224
+	movdqa	xmm2,xmm10
+	pxor	xmm4,xmm5
+DB	102,15,56,0,211
+	movdqa	xmm3,xmm10
+	pxor	xmm2,xmm0
+DB	102,15,56,0,220
+	movdqu	xmm5,XMMWORD[r9]
+	pxor	xmm3,xmm1
+	jnz	NEAR $L$enc_loop
+
+
+	movdqa	xmm4,XMMWORD[((-96))+r10]
+	movdqa	xmm0,XMMWORD[((-80))+r10]
+DB	102,15,56,0,226
+	pxor	xmm4,xmm5
+DB	102,15,56,0,195
+	movdqa	xmm1,XMMWORD[64+r10*1+r11]
+	pxor	xmm0,xmm4
+DB	102,15,56,0,193
+	DB	0F3h,0C3h		;repret
+
+
+
+
+
+
+
+
+ALIGN	16
+_vpaes_decrypt_core:
+	mov	r9,rdx
+	mov	eax,DWORD[240+rdx]
+	movdqa	xmm1,xmm9
+	movdqa	xmm2,XMMWORD[$L$k_dipt]
+	pandn	xmm1,xmm0
+	mov	r11,rax
+	psrld	xmm1,4
+	movdqu	xmm5,XMMWORD[r9]
+	shl	r11,4
+	pand	xmm0,xmm9
+DB	102,15,56,0,208
+	movdqa	xmm0,XMMWORD[(($L$k_dipt+16))]
+	xor	r11,0x30
+	lea	r10,[$L$k_dsbd]
+DB	102,15,56,0,193
+	and	r11,0x30
+	pxor	xmm2,xmm5
+	movdqa	xmm5,XMMWORD[(($L$k_mc_forward+48))]
+	pxor	xmm0,xmm2
+	add	r9,16
+	add	r11,r10
+	jmp	NEAR $L$dec_entry
+
+ALIGN	16
+$L$dec_loop:
+
+
+
+	movdqa	xmm4,XMMWORD[((-32))+r10]
+	movdqa	xmm1,XMMWORD[((-16))+r10]
+DB	102,15,56,0,226
+DB	102,15,56,0,203
+	pxor	xmm0,xmm4
+	movdqa	xmm4,XMMWORD[r10]
+	pxor	xmm0,xmm1
+	movdqa	xmm1,XMMWORD[16+r10]
+
+DB	102,15,56,0,226
+DB	102,15,56,0,197
+DB	102,15,56,0,203
+	pxor	xmm0,xmm4
+	movdqa	xmm4,XMMWORD[32+r10]
+	pxor	xmm0,xmm1
+	movdqa	xmm1,XMMWORD[48+r10]
+
+DB	102,15,56,0,226
+DB	102,15,56,0,197
+DB	102,15,56,0,203
+	pxor	xmm0,xmm4
+	movdqa	xmm4,XMMWORD[64+r10]
+	pxor	xmm0,xmm1
+	movdqa	xmm1,XMMWORD[80+r10]
+
+DB	102,15,56,0,226
+DB	102,15,56,0,197
+DB	102,15,56,0,203
+	pxor	xmm0,xmm4
+	add	r9,16
+DB	102,15,58,15,237,12
+	pxor	xmm0,xmm1
+	sub	rax,1
+
+$L$dec_entry:
+
+	movdqa	xmm1,xmm9
+	pandn	xmm1,xmm0
+	movdqa	xmm2,xmm11
+	psrld	xmm1,4
+	pand	xmm0,xmm9
+DB	102,15,56,0,208
+	movdqa	xmm3,xmm10
+	pxor	xmm0,xmm1
+DB	102,15,56,0,217
+	movdqa	xmm4,xmm10
+	pxor	xmm3,xmm2
+DB	102,15,56,0,224
+	pxor	xmm4,xmm2
+	movdqa	xmm2,xmm10
+DB	102,15,56,0,211
+	movdqa	xmm3,xmm10
+	pxor	xmm2,xmm0
+DB	102,15,56,0,220
+	movdqu	xmm0,XMMWORD[r9]
+	pxor	xmm3,xmm1
+	jnz	NEAR $L$dec_loop
+
+
+	movdqa	xmm4,XMMWORD[96+r10]
+DB	102,15,56,0,226
+	pxor	xmm4,xmm0
+	movdqa	xmm0,XMMWORD[112+r10]
+	movdqa	xmm2,XMMWORD[((-352))+r11]
+DB	102,15,56,0,195
+	pxor	xmm0,xmm4
+DB	102,15,56,0,194
+	DB	0F3h,0C3h		;repret
+
+
+
+
+
+
+
+
+ALIGN	16
+_vpaes_schedule_core:
+
+
+
+
+
+	call	_vpaes_preheat
+	movdqa	xmm8,XMMWORD[$L$k_rcon]
+	movdqu	xmm0,XMMWORD[rdi]
+
+
+	movdqa	xmm3,xmm0
+	lea	r11,[$L$k_ipt]
+	call	_vpaes_schedule_transform
+	movdqa	xmm7,xmm0
+
+	lea	r10,[$L$k_sr]
+	test	rcx,rcx
+	jnz	NEAR $L$schedule_am_decrypting
+
+
+	movdqu	XMMWORD[rdx],xmm0
+	jmp	NEAR $L$schedule_go
+
+$L$schedule_am_decrypting:
+
+	movdqa	xmm1,XMMWORD[r10*1+r8]
+DB	102,15,56,0,217
+	movdqu	XMMWORD[rdx],xmm3
+	xor	r8,0x30
+
+$L$schedule_go:
+	cmp	esi,192
+	ja	NEAR $L$schedule_256
+	je	NEAR $L$schedule_192
+
+
+
+
+
+
+
+
+
+
+$L$schedule_128:
+	mov	esi,10
+
+$L$oop_schedule_128:
+	call	_vpaes_schedule_round
+	dec	rsi
+	jz	NEAR $L$schedule_mangle_last
+	call	_vpaes_schedule_mangle
+	jmp	NEAR $L$oop_schedule_128
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ALIGN	16
+$L$schedule_192:
+	movdqu	xmm0,XMMWORD[8+rdi]
+	call	_vpaes_schedule_transform
+	movdqa	xmm6,xmm0
+	pxor	xmm4,xmm4
+	movhlps	xmm6,xmm4
+	mov	esi,4
+
+$L$oop_schedule_192:
+	call	_vpaes_schedule_round
+DB	102,15,58,15,198,8
+	call	_vpaes_schedule_mangle
+	call	_vpaes_schedule_192_smear
+	call	_vpaes_schedule_mangle
+	call	_vpaes_schedule_round
+	dec	rsi
+	jz	NEAR $L$schedule_mangle_last
+	call	_vpaes_schedule_mangle
+	call	_vpaes_schedule_192_smear
+	jmp	NEAR $L$oop_schedule_192
+
+
+
+
+
+
+
+
+
+
+
+ALIGN	16
+$L$schedule_256:
+	movdqu	xmm0,XMMWORD[16+rdi]
+	call	_vpaes_schedule_transform
+	mov	esi,7
+
+$L$oop_schedule_256:
+	call	_vpaes_schedule_mangle
+	movdqa	xmm6,xmm0
+
+
+	call	_vpaes_schedule_round
+	dec	rsi
+	jz	NEAR $L$schedule_mangle_last
+	call	_vpaes_schedule_mangle
+
+
+	pshufd	xmm0,xmm0,0xFF
+	movdqa	xmm5,xmm7
+	movdqa	xmm7,xmm6
+	call	_vpaes_schedule_low_round
+	movdqa	xmm7,xmm5
+
+	jmp	NEAR $L$oop_schedule_256
+
+
+
+
+
+
+
+
+
+
+
+
+ALIGN	16
+$L$schedule_mangle_last:
+
+	lea	r11,[$L$k_deskew]
+	test	rcx,rcx
+	jnz	NEAR $L$schedule_mangle_last_dec
+
+
+	movdqa	xmm1,XMMWORD[r10*1+r8]
+DB	102,15,56,0,193
+	lea	r11,[$L$k_opt]
+	add	rdx,32
+
+$L$schedule_mangle_last_dec:
+	add	rdx,-16
+	pxor	xmm0,XMMWORD[$L$k_s63]
+	call	_vpaes_schedule_transform
+	movdqu	XMMWORD[rdx],xmm0
+
+
+	pxor	xmm0,xmm0
+	pxor	xmm1,xmm1
+	pxor	xmm2,xmm2
+	pxor	xmm3,xmm3
+	pxor	xmm4,xmm4
+	pxor	xmm5,xmm5
+	pxor	xmm6,xmm6
+	pxor	xmm7,xmm7
+	DB	0F3h,0C3h		;repret
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ALIGN	16
+_vpaes_schedule_192_smear:
+	pshufd	xmm1,xmm6,0x80
+	pshufd	xmm0,xmm7,0xFE
+	pxor	xmm6,xmm1
+	pxor	xmm1,xmm1
+	pxor	xmm6,xmm0
+	movdqa	xmm0,xmm6
+	movhlps	xmm6,xmm1
+	DB	0F3h,0C3h		;repret
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ALIGN	16
+_vpaes_schedule_round:
+
+	pxor	xmm1,xmm1
+DB	102,65,15,58,15,200,15
+DB	102,69,15,58,15,192,15
+	pxor	xmm7,xmm1
+
+
+	pshufd	xmm0,xmm0,0xFF
+DB	102,15,58,15,192,1
+
+
+
+
+_vpaes_schedule_low_round:
+
+	movdqa	xmm1,xmm7
+	pslldq	xmm7,4
+	pxor	xmm7,xmm1
+	movdqa	xmm1,xmm7
+	pslldq	xmm7,8
+	pxor	xmm7,xmm1
+	pxor	xmm7,XMMWORD[$L$k_s63]
+
+
+	movdqa	xmm1,xmm9
+	pandn	xmm1,xmm0
+	psrld	xmm1,4
+	pand	xmm0,xmm9
+	movdqa	xmm2,xmm11
+DB	102,15,56,0,208
+	pxor	xmm0,xmm1
+	movdqa	xmm3,xmm10
+DB	102,15,56,0,217
+	pxor	xmm3,xmm2
+	movdqa	xmm4,xmm10
+DB	102,15,56,0,224
+	pxor	xmm4,xmm2
+	movdqa	xmm2,xmm10
+DB	102,15,56,0,211
+	pxor	xmm2,xmm0
+	movdqa	xmm3,xmm10
+DB	102,15,56,0,220
+	pxor	xmm3,xmm1
+	movdqa	xmm4,xmm13
+DB	102,15,56,0,226
+	movdqa	xmm0,xmm12
+DB	102,15,56,0,195
+	pxor	xmm0,xmm4
+
+
+	pxor	xmm0,xmm7
+	movdqa	xmm7,xmm0
+	DB	0F3h,0C3h		;repret
+
+
+
+
+
+
+
+
+
+
+
+
+ALIGN	16
+_vpaes_schedule_transform:
+	movdqa	xmm1,xmm9
+	pandn	xmm1,xmm0
+	psrld	xmm1,4
+	pand	xmm0,xmm9
+	movdqa	xmm2,XMMWORD[r11]
+DB	102,15,56,0,208
+	movdqa	xmm0,XMMWORD[16+r11]
+DB	102,15,56,0,193
+	pxor	xmm0,xmm2
+	DB	0F3h,0C3h		;repret
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ALIGN	16
+_vpaes_schedule_mangle:
+	movdqa	xmm4,xmm0
+	movdqa	xmm5,XMMWORD[$L$k_mc_forward]
+	test	rcx,rcx
+	jnz	NEAR $L$schedule_mangle_dec
+
+
+	add	rdx,16
+	pxor	xmm4,XMMWORD[$L$k_s63]
+DB	102,15,56,0,229
+	movdqa	xmm3,xmm4
+DB	102,15,56,0,229
+	pxor	xmm3,xmm4
+DB	102,15,56,0,229
+	pxor	xmm3,xmm4
+
+	jmp	NEAR $L$schedule_mangle_both
+ALIGN	16
+$L$schedule_mangle_dec:
+
+	lea	r11,[$L$k_dksd]
+	movdqa	xmm1,xmm9
+	pandn	xmm1,xmm4
+	psrld	xmm1,4
+	pand	xmm4,xmm9
+
+	movdqa	xmm2,XMMWORD[r11]
+DB	102,15,56,0,212
+	movdqa	xmm3,XMMWORD[16+r11]
+DB	102,15,56,0,217
+	pxor	xmm3,xmm2
+DB	102,15,56,0,221
+
+	movdqa	xmm2,XMMWORD[32+r11]
+DB	102,15,56,0,212
+	pxor	xmm2,xmm3
+	movdqa	xmm3,XMMWORD[48+r11]
+DB	102,15,56,0,217
+	pxor	xmm3,xmm2
+DB	102,15,56,0,221
+
+	movdqa	xmm2,XMMWORD[64+r11]
+DB	102,15,56,0,212
+	pxor	xmm2,xmm3
+	movdqa	xmm3,XMMWORD[80+r11]
+DB	102,15,56,0,217
+	pxor	xmm3,xmm2
+DB	102,15,56,0,221
+
+	movdqa	xmm2,XMMWORD[96+r11]
+DB	102,15,56,0,212
+	pxor	xmm2,xmm3
+	movdqa	xmm3,XMMWORD[112+r11]
+DB	102,15,56,0,217
+	pxor	xmm3,xmm2
+
+	add	rdx,-16
+
+$L$schedule_mangle_both:
+	movdqa	xmm1,XMMWORD[r10*1+r8]
+DB	102,15,56,0,217
+	add	r8,-16
+	and	r8,0x30
+	movdqu	XMMWORD[rdx],xmm3
+	DB	0F3h,0C3h		;repret
+
+
+
+
+
+global	vpaes_set_encrypt_key
+
+ALIGN	16
+vpaes_set_encrypt_key:
+	mov	QWORD[8+rsp],rdi	;WIN64 prologue
+	mov	QWORD[16+rsp],rsi
+	mov	rax,rsp
+$L$SEH_begin_vpaes_set_encrypt_key:
+	mov	rdi,rcx
+	mov	rsi,rdx
+	mov	rdx,r8
+
+
+	lea	rsp,[((-184))+rsp]
+	movaps	XMMWORD[16+rsp],xmm6
+	movaps	XMMWORD[32+rsp],xmm7
+	movaps	XMMWORD[48+rsp],xmm8
+	movaps	XMMWORD[64+rsp],xmm9
+	movaps	XMMWORD[80+rsp],xmm10
+	movaps	XMMWORD[96+rsp],xmm11
+	movaps	XMMWORD[112+rsp],xmm12
+	movaps	XMMWORD[128+rsp],xmm13
+	movaps	XMMWORD[144+rsp],xmm14
+	movaps	XMMWORD[160+rsp],xmm15
+$L$enc_key_body:
+	mov	eax,esi
+	shr	eax,5
+	add	eax,5
+	mov	DWORD[240+rdx],eax
+
+	mov	ecx,0
+	mov	r8d,0x30
+	call	_vpaes_schedule_core
+	movaps	xmm6,XMMWORD[16+rsp]
+	movaps	xmm7,XMMWORD[32+rsp]
+	movaps	xmm8,XMMWORD[48+rsp]
+	movaps	xmm9,XMMWORD[64+rsp]
+	movaps	xmm10,XMMWORD[80+rsp]
+	movaps	xmm11,XMMWORD[96+rsp]
+	movaps	xmm12,XMMWORD[112+rsp]
+	movaps	xmm13,XMMWORD[128+rsp]
+	movaps	xmm14,XMMWORD[144+rsp]
+	movaps	xmm15,XMMWORD[160+rsp]
+	lea	rsp,[184+rsp]
+$L$enc_key_epilogue:
+	xor	eax,eax
+	mov	rdi,QWORD[8+rsp]	;WIN64 epilogue
+	mov	rsi,QWORD[16+rsp]
+	DB	0F3h,0C3h		;repret
+$L$SEH_end_vpaes_set_encrypt_key:
+
+global	vpaes_set_decrypt_key
+
+ALIGN	16
+vpaes_set_decrypt_key:
+	mov	QWORD[8+rsp],rdi	;WIN64 prologue
+	mov	QWORD[16+rsp],rsi
+	mov	rax,rsp
+$L$SEH_begin_vpaes_set_decrypt_key:
+	mov	rdi,rcx
+	mov	rsi,rdx
+	mov	rdx,r8
+
+
+	lea	rsp,[((-184))+rsp]
+	movaps	XMMWORD[16+rsp],xmm6
+	movaps	XMMWORD[32+rsp],xmm7
+	movaps	XMMWORD[48+rsp],xmm8
+	movaps	XMMWORD[64+rsp],xmm9
+	movaps	XMMWORD[80+rsp],xmm10
+	movaps	XMMWORD[96+rsp],xmm11
+	movaps	XMMWORD[112+rsp],xmm12
+	movaps	XMMWORD[128+rsp],xmm13
+	movaps	XMMWORD[144+rsp],xmm14
+	movaps	XMMWORD[160+rsp],xmm15
+$L$dec_key_body:
+	mov	eax,esi
+	shr	eax,5
+	add	eax,5
+	mov	DWORD[240+rdx],eax
+	shl	eax,4
+	lea	rdx,[16+rax*1+rdx]
+
+	mov	ecx,1
+	mov	r8d,esi
+	shr	r8d,1
+	and	r8d,32
+	xor	r8d,32
+	call	_vpaes_schedule_core
+	movaps	xmm6,XMMWORD[16+rsp]
+	movaps	xmm7,XMMWORD[32+rsp]
+	movaps	xmm8,XMMWORD[48+rsp]
+	movaps	xmm9,XMMWORD[64+rsp]
+	movaps	xmm10,XMMWORD[80+rsp]
+	movaps	xmm11,XMMWORD[96+rsp]
+	movaps	xmm12,XMMWORD[112+rsp]
+	movaps	xmm13,XMMWORD[128+rsp]
+	movaps	xmm14,XMMWORD[144+rsp]
+	movaps	xmm15,XMMWORD[160+rsp]
+	lea	rsp,[184+rsp]
+$L$dec_key_epilogue:
+	xor	eax,eax
+	mov	rdi,QWORD[8+rsp]	;WIN64 epilogue
+	mov	rsi,QWORD[16+rsp]
+	DB	0F3h,0C3h		;repret
+$L$SEH_end_vpaes_set_decrypt_key:
+
+global	vpaes_encrypt
+
+ALIGN	16
+vpaes_encrypt:
+	mov	QWORD[8+rsp],rdi	;WIN64 prologue
+	mov	QWORD[16+rsp],rsi
+	mov	rax,rsp
+$L$SEH_begin_vpaes_encrypt:
+	mov	rdi,rcx
+	mov	rsi,rdx
+	mov	rdx,r8
+
+
+	lea	rsp,[((-184))+rsp]
+	movaps	XMMWORD[16+rsp],xmm6
+	movaps	XMMWORD[32+rsp],xmm7
+	movaps	XMMWORD[48+rsp],xmm8
+	movaps	XMMWORD[64+rsp],xmm9
+	movaps	XMMWORD[80+rsp],xmm10
+	movaps	XMMWORD[96+rsp],xmm11
+	movaps	XMMWORD[112+rsp],xmm12
+	movaps	XMMWORD[128+rsp],xmm13
+	movaps	XMMWORD[144+rsp],xmm14
+	movaps	XMMWORD[160+rsp],xmm15
+$L$enc_body:
+	movdqu	xmm0,XMMWORD[rdi]
+	call	_vpaes_preheat
+	call	_vpaes_encrypt_core
+	movdqu	XMMWORD[rsi],xmm0
+	movaps	xmm6,XMMWORD[16+rsp]
+	movaps	xmm7,XMMWORD[32+rsp]
+	movaps	xmm8,XMMWORD[48+rsp]
+	movaps	xmm9,XMMWORD[64+rsp]
+	movaps	xmm10,XMMWORD[80+rsp]
+	movaps	xmm11,XMMWORD[96+rsp]
+	movaps	xmm12,XMMWORD[112+rsp]
+	movaps	xmm13,XMMWORD[128+rsp]
+	movaps	xmm14,XMMWORD[144+rsp]
+	movaps	xmm15,XMMWORD[160+rsp]
+	lea	rsp,[184+rsp]
+$L$enc_epilogue:
+	mov	rdi,QWORD[8+rsp]	;WIN64 epilogue
+	mov	rsi,QWORD[16+rsp]
+	DB	0F3h,0C3h		;repret
+$L$SEH_end_vpaes_encrypt:
+
+global	vpaes_decrypt
+
+ALIGN	16
+vpaes_decrypt:
+	mov	QWORD[8+rsp],rdi	;WIN64 prologue
+	mov	QWORD[16+rsp],rsi
+	mov	rax,rsp
+$L$SEH_begin_vpaes_decrypt:
+	mov	rdi,rcx
+	mov	rsi,rdx
+	mov	rdx,r8
+
+
+	lea	rsp,[((-184))+rsp]
+	movaps	XMMWORD[16+rsp],xmm6
+	movaps	XMMWORD[32+rsp],xmm7
+	movaps	XMMWORD[48+rsp],xmm8
+	movaps	XMMWORD[64+rsp],xmm9
+	movaps	XMMWORD[80+rsp],xmm10
+	movaps	XMMWORD[96+rsp],xmm11
+	movaps	XMMWORD[112+rsp],xmm12
+	movaps	XMMWORD[128+rsp],xmm13
+	movaps	XMMWORD[144+rsp],xmm14
+	movaps	XMMWORD[160+rsp],xmm15
+$L$dec_body:
+	movdqu	xmm0,XMMWORD[rdi]
+	call	_vpaes_preheat
+	call	_vpaes_decrypt_core
+	movdqu	XMMWORD[rsi],xmm0
+	movaps	xmm6,XMMWORD[16+rsp]
+	movaps	xmm7,XMMWORD[32+rsp]
+	movaps	xmm8,XMMWORD[48+rsp]
+	movaps	xmm9,XMMWORD[64+rsp]
+	movaps	xmm10,XMMWORD[80+rsp]
+	movaps	xmm11,XMMWORD[96+rsp]
+	movaps	xmm12,XMMWORD[112+rsp]
+	movaps	xmm13,XMMWORD[128+rsp]
+	movaps	xmm14,XMMWORD[144+rsp]
+	movaps	xmm15,XMMWORD[160+rsp]
+	lea	rsp,[184+rsp]
+$L$dec_epilogue:
+	mov	rdi,QWORD[8+rsp]	;WIN64 epilogue
+	mov	rsi,QWORD[16+rsp]
+	DB	0F3h,0C3h		;repret
+$L$SEH_end_vpaes_decrypt:
+global	vpaes_cbc_encrypt
+
+ALIGN	16
+vpaes_cbc_encrypt:
+	mov	QWORD[8+rsp],rdi	;WIN64 prologue
+	mov	QWORD[16+rsp],rsi
+	mov	rax,rsp
+$L$SEH_begin_vpaes_cbc_encrypt:
+	mov	rdi,rcx
+	mov	rsi,rdx
+	mov	rdx,r8
+	mov	rcx,r9
+	mov	r8,QWORD[40+rsp]
+	mov	r9,QWORD[48+rsp]
+
+
+	xchg	rdx,rcx
+	sub	rcx,16
+	jc	NEAR $L$cbc_abort
+	lea	rsp,[((-184))+rsp]
+	movaps	XMMWORD[16+rsp],xmm6
+	movaps	XMMWORD[32+rsp],xmm7
+	movaps	XMMWORD[48+rsp],xmm8
+	movaps	XMMWORD[64+rsp],xmm9
+	movaps	XMMWORD[80+rsp],xmm10
+	movaps	XMMWORD[96+rsp],xmm11
+	movaps	XMMWORD[112+rsp],xmm12
+	movaps	XMMWORD[128+rsp],xmm13
+	movaps	XMMWORD[144+rsp],xmm14
+	movaps	XMMWORD[160+rsp],xmm15
+$L$cbc_body:
+	movdqu	xmm6,XMMWORD[r8]
+	sub	rsi,rdi
+	call	_vpaes_preheat
+	cmp	r9d,0
+	je	NEAR $L$cbc_dec_loop
+	jmp	NEAR $L$cbc_enc_loop
+ALIGN	16
+$L$cbc_enc_loop:
+	movdqu	xmm0,XMMWORD[rdi]
+	pxor	xmm0,xmm6
+	call	_vpaes_encrypt_core
+	movdqa	xmm6,xmm0
+	movdqu	XMMWORD[rdi*1+rsi],xmm0
+	lea	rdi,[16+rdi]
+	sub	rcx,16
+	jnc	NEAR $L$cbc_enc_loop
+	jmp	NEAR $L$cbc_done
+ALIGN	16
+$L$cbc_dec_loop:
+	movdqu	xmm0,XMMWORD[rdi]
+	movdqa	xmm7,xmm0
+	call	_vpaes_decrypt_core
+	pxor	xmm0,xmm6
+	movdqa	xmm6,xmm7
+	movdqu	XMMWORD[rdi*1+rsi],xmm0
+	lea	rdi,[16+rdi]
+	sub	rcx,16
+	jnc	NEAR $L$cbc_dec_loop
+$L$cbc_done:
+	movdqu	XMMWORD[r8],xmm6
+	movaps	xmm6,XMMWORD[16+rsp]
+	movaps	xmm7,XMMWORD[32+rsp]
+	movaps	xmm8,XMMWORD[48+rsp]
+	movaps	xmm9,XMMWORD[64+rsp]
+	movaps	xmm10,XMMWORD[80+rsp]
+	movaps	xmm11,XMMWORD[96+rsp]
+	movaps	xmm12,XMMWORD[112+rsp]
+	movaps	xmm13,XMMWORD[128+rsp]
+	movaps	xmm14,XMMWORD[144+rsp]
+	movaps	xmm15,XMMWORD[160+rsp]
+	lea	rsp,[184+rsp]
+$L$cbc_epilogue:
+$L$cbc_abort:
+	mov	rdi,QWORD[8+rsp]	;WIN64 epilogue
+	mov	rsi,QWORD[16+rsp]
+	DB	0F3h,0C3h		;repret
+$L$SEH_end_vpaes_cbc_encrypt:
+
+
+
+
+
+
+
+ALIGN	16
+_vpaes_preheat:
+	lea	r10,[$L$k_s0F]
+	movdqa	xmm10,XMMWORD[((-32))+r10]
+	movdqa	xmm11,XMMWORD[((-16))+r10]
+	movdqa	xmm9,XMMWORD[r10]
+	movdqa	xmm13,XMMWORD[48+r10]
+	movdqa	xmm12,XMMWORD[64+r10]
+	movdqa	xmm15,XMMWORD[80+r10]
+	movdqa	xmm14,XMMWORD[96+r10]
+	DB	0F3h,0C3h		;repret
+
+
+
+
+
+
+
+ALIGN	64
+_vpaes_consts:
+$L$k_inv:
+	DQ	0x0E05060F0D080180,0x040703090A0B0C02
+	DQ	0x01040A060F0B0780,0x030D0E0C02050809
+
+$L$k_s0F:
+	DQ	0x0F0F0F0F0F0F0F0F,0x0F0F0F0F0F0F0F0F
+
+$L$k_ipt:
+	DQ	0xC2B2E8985A2A7000,0xCABAE09052227808
+	DQ	0x4C01307D317C4D00,0xCD80B1FCB0FDCC81
+
+$L$k_sb1:
+	DQ	0xB19BE18FCB503E00,0xA5DF7A6E142AF544
+	DQ	0x3618D415FAE22300,0x3BF7CCC10D2ED9EF
+$L$k_sb2:
+	DQ	0xE27A93C60B712400,0x5EB7E955BC982FCD
+	DQ	0x69EB88400AE12900,0xC2A163C8AB82234A
+$L$k_sbo:
+	DQ	0xD0D26D176FBDC700,0x15AABF7AC502A878
+	DQ	0xCFE474A55FBB6A00,0x8E1E90D1412B35FA
+
+$L$k_mc_forward:
+	DQ	0x0407060500030201,0x0C0F0E0D080B0A09
+	DQ	0x080B0A0904070605,0x000302010C0F0E0D
+	DQ	0x0C0F0E0D080B0A09,0x0407060500030201
+	DQ	0x000302010C0F0E0D,0x080B0A0904070605
+
+$L$k_mc_backward:
+	DQ	0x0605040702010003,0x0E0D0C0F0A09080B
+	DQ	0x020100030E0D0C0F,0x0A09080B06050407
+	DQ	0x0E0D0C0F0A09080B,0x0605040702010003
+	DQ	0x0A09080B06050407,0x020100030E0D0C0F
+
+$L$k_sr:
+	DQ	0x0706050403020100,0x0F0E0D0C0B0A0908
+	DQ	0x030E09040F0A0500,0x0B06010C07020D08
+	DQ	0x0F060D040B020900,0x070E050C030A0108
+	DQ	0x0B0E0104070A0D00,0x0306090C0F020508
+
+$L$k_rcon:
+	DQ	0x1F8391B9AF9DEEB6,0x702A98084D7C7D81
+
+$L$k_s63:
+	DQ	0x5B5B5B5B5B5B5B5B,0x5B5B5B5B5B5B5B5B
+
+$L$k_opt:
+	DQ	0xFF9F4929D6B66000,0xF7974121DEBE6808
+	DQ	0x01EDBD5150BCEC00,0xE10D5DB1B05C0CE0
+
+$L$k_deskew:
+	DQ	0x07E4A34047A4E300,0x1DFEB95A5DBEF91A
+	DQ	0x5F36B5DC83EA6900,0x2841C2ABF49D1E77
+
+
+
+
+
+$L$k_dksd:
+	DQ	0xFEB91A5DA3E44700,0x0740E3A45A1DBEF9
+	DQ	0x41C277F4B5368300,0x5FDC69EAAB289D1E
+$L$k_dksb:
+	DQ	0x9A4FCA1F8550D500,0x03D653861CC94C99
+	DQ	0x115BEDA7B6FC4A00,0xD993256F7E3482C8
+$L$k_dkse:
+	DQ	0xD5031CCA1FC9D600,0x53859A4C994F5086
+	DQ	0xA23196054FDC7BE8,0xCD5EF96A20B31487
+$L$k_dks9:
+	DQ	0xB6116FC87ED9A700,0x4AED933482255BFC
+	DQ	0x4576516227143300,0x8BB89FACE9DAFDCE
+
+
+
+
+
+$L$k_dipt:
+	DQ	0x0F505B040B545F00,0x154A411E114E451A
+	DQ	0x86E383E660056500,0x12771772F491F194
+
+$L$k_dsb9:
+	DQ	0x851C03539A86D600,0xCAD51F504F994CC9
+	DQ	0xC03B1789ECD74900,0x725E2C9EB2FBA565
+$L$k_dsbd:
+	DQ	0x7D57CCDFE6B1A200,0xF56E9B13882A4439
+	DQ	0x3CE2FAF724C6CB00,0x2931180D15DEEFD3
+$L$k_dsbb:
+	DQ	0xD022649296B44200,0x602646F6B0F2D404
+	DQ	0xC19498A6CD596700,0xF3FF0C3E3255AA6B
+$L$k_dsbe:
+	DQ	0x46F2929626D4D000,0x2242600464B4F6B0
+	DQ	0x0C55A6CDFFAAC100,0x9467F36B98593E32
+$L$k_dsbo:
+	DQ	0x1387EA537EF94000,0xC7AA6DB9D4943E2D
+	DQ	0x12D7560F93441D00,0xCA4B8159D8C58E9C
+DB	86,101,99,116,111,114,32,80,101,114,109,117,116,97,116,105
+DB	111,110,32,65,69,83,32,102,111,114,32,120,56,54,95,54
+DB	52,47,83,83,83,69,51,44,32,77,105,107,101,32,72,97
+DB	109,98,117,114,103,32,40,83,116,97,110,102,111,114,100,32
+DB	85,110,105,118,101,114,115,105,116,121,41,0
+ALIGN	64
+
+EXTERN	__imp_RtlVirtualUnwind
+
+ALIGN	16
+se_handler:
+	push	rsi
+	push	rdi
+	push	rbx
+	push	rbp
+	push	r12
+	push	r13
+	push	r14
+	push	r15
+	pushfq
+	sub	rsp,64
+
+	mov	rax,QWORD[120+r8]
+	mov	rbx,QWORD[248+r8]
+
+	mov	rsi,QWORD[8+r9]
+	mov	r11,QWORD[56+r9]
+
+	mov	r10d,DWORD[r11]
+	lea	r10,[r10*1+rsi]
+	cmp	rbx,r10
+	jb	NEAR $L$in_prologue
+
+	mov	rax,QWORD[152+r8]
+
+	mov	r10d,DWORD[4+r11]
+	lea	r10,[r10*1+rsi]
+	cmp	rbx,r10
+	jae	NEAR $L$in_prologue
+
+	lea	rsi,[16+rax]
+	lea	rdi,[512+r8]
+	mov	ecx,20
+	DD	0xa548f3fc
+	lea	rax,[184+rax]
+
+$L$in_prologue:
+	mov	rdi,QWORD[8+rax]
+	mov	rsi,QWORD[16+rax]
+	mov	QWORD[152+r8],rax
+	mov	QWORD[168+r8],rsi
+	mov	QWORD[176+r8],rdi
+
+	mov	rdi,QWORD[40+r9]
+	mov	rsi,r8
+	mov	ecx,154
+	DD	0xa548f3fc
+
+	mov	rsi,r9
+	xor	rcx,rcx
+	mov	rdx,QWORD[8+rsi]
+	mov	r8,QWORD[rsi]
+	mov	r9,QWORD[16+rsi]
+	mov	r10,QWORD[40+rsi]
+	lea	r11,[56+rsi]
+	lea	r12,[24+rsi]
+	mov	QWORD[32+rsp],r10
+	mov	QWORD[40+rsp],r11
+	mov	QWORD[48+rsp],r12
+	mov	QWORD[56+rsp],rcx
+	call	QWORD[__imp_RtlVirtualUnwind]
+
+	mov	eax,1
+	add	rsp,64
+	popfq
+	pop	r15
+	pop	r14
+	pop	r13
+	pop	r12
+	pop	rbp
+	pop	rbx
+	pop	rdi
+	pop	rsi
+	DB	0F3h,0C3h		;repret
+
+
+section	.pdata rdata align=4
+ALIGN	4
+	DD	$L$SEH_begin_vpaes_set_encrypt_key wrt ..imagebase
+	DD	$L$SEH_end_vpaes_set_encrypt_key wrt ..imagebase
+	DD	$L$SEH_info_vpaes_set_encrypt_key wrt ..imagebase
+
+	DD	$L$SEH_begin_vpaes_set_decrypt_key wrt ..imagebase
+	DD	$L$SEH_end_vpaes_set_decrypt_key wrt ..imagebase
+	DD	$L$SEH_info_vpaes_set_decrypt_key wrt ..imagebase
+
+	DD	$L$SEH_begin_vpaes_encrypt wrt ..imagebase
+	DD	$L$SEH_end_vpaes_encrypt wrt ..imagebase
+	DD	$L$SEH_info_vpaes_encrypt wrt ..imagebase
+
+	DD	$L$SEH_begin_vpaes_decrypt wrt ..imagebase
+	DD	$L$SEH_end_vpaes_decrypt wrt ..imagebase
+	DD	$L$SEH_info_vpaes_decrypt wrt ..imagebase
+
+	DD	$L$SEH_begin_vpaes_cbc_encrypt wrt ..imagebase
+	DD	$L$SEH_end_vpaes_cbc_encrypt wrt ..imagebase
+	DD	$L$SEH_info_vpaes_cbc_encrypt wrt ..imagebase
+
+section	.xdata rdata align=8
+ALIGN	8
+$L$SEH_info_vpaes_set_encrypt_key:
+DB	9,0,0,0
+	DD	se_handler wrt ..imagebase
+	DD	$L$enc_key_body wrt ..imagebase,$L$enc_key_epilogue wrt ..imagebase
+$L$SEH_info_vpaes_set_decrypt_key:
+DB	9,0,0,0
+	DD	se_handler wrt ..imagebase
+	DD	$L$dec_key_body wrt ..imagebase,$L$dec_key_epilogue wrt ..imagebase
+$L$SEH_info_vpaes_encrypt:
+DB	9,0,0,0
+	DD	se_handler wrt ..imagebase
+	DD	$L$enc_body wrt ..imagebase,$L$enc_epilogue wrt ..imagebase
+$L$SEH_info_vpaes_decrypt:
+DB	9,0,0,0
+	DD	se_handler wrt ..imagebase
+	DD	$L$dec_body wrt ..imagebase,$L$dec_epilogue wrt ..imagebase
+$L$SEH_info_vpaes_cbc_encrypt:
+DB	9,0,0,0
+	DD	se_handler wrt ..imagebase
+	DD	$L$cbc_body wrt ..imagebase,$L$cbc_epilogue wrt ..imagebase
diff --git a/third_party/boringssl/win-x86_64/crypto/bn/rsaz-avx2.asm b/third_party/boringssl/win-x86_64/crypto/bn/rsaz-avx2.asm
new file mode 100644
index 0000000..45d0fd4
--- /dev/null
+++ b/third_party/boringssl/win-x86_64/crypto/bn/rsaz-avx2.asm
@@ -0,0 +1,30 @@
+default	rel
+%define XMMWORD
+%define YMMWORD
+%define ZMMWORD
+section	.text code align=64
+
+
+global	rsaz_avx2_eligible
+
+rsaz_avx2_eligible:
+	xor	eax,eax
+	DB	0F3h,0C3h		;repret
+
+
+global	rsaz_1024_sqr_avx2
+global	rsaz_1024_mul_avx2
+global	rsaz_1024_norm2red_avx2
+global	rsaz_1024_red2norm_avx2
+global	rsaz_1024_scatter5_avx2
+global	rsaz_1024_gather5_avx2
+
+rsaz_1024_sqr_avx2:
+rsaz_1024_mul_avx2:
+rsaz_1024_norm2red_avx2:
+rsaz_1024_red2norm_avx2:
+rsaz_1024_scatter5_avx2:
+rsaz_1024_gather5_avx2:
+DB	0x0f,0x0b
+	DB	0F3h,0C3h		;repret
+
diff --git a/third_party/boringssl/win-x86_64/crypto/bn/rsaz-x86_64.asm b/third_party/boringssl/win-x86_64/crypto/bn/rsaz-x86_64.asm
new file mode 100644
index 0000000..04d5e39
--- /dev/null
+++ b/third_party/boringssl/win-x86_64/crypto/bn/rsaz-x86_64.asm
@@ -0,0 +1,1320 @@
+default	rel
+%define XMMWORD
+%define YMMWORD
+%define ZMMWORD
+section	.text code align=64
+
+
+EXTERN	OPENSSL_ia32cap_P
+
+global	rsaz_512_sqr
+
+ALIGN	32
+rsaz_512_sqr:
+	mov	QWORD[8+rsp],rdi	;WIN64 prologue
+	mov	QWORD[16+rsp],rsi
+	mov	rax,rsp
+$L$SEH_begin_rsaz_512_sqr:
+	mov	rdi,rcx
+	mov	rsi,rdx
+	mov	rdx,r8
+	mov	rcx,r9
+	mov	r8,QWORD[40+rsp]
+
+
+	push	rbx
+	push	rbp
+	push	r12
+	push	r13
+	push	r14
+	push	r15
+
+	sub	rsp,128+24
+$L$sqr_body:
+	mov	rbp,rdx
+	mov	rdx,QWORD[rsi]
+	mov	rax,QWORD[8+rsi]
+	mov	QWORD[128+rsp],rcx
+	jmp	NEAR $L$oop_sqr
+
+ALIGN	32
+$L$oop_sqr:
+	mov	DWORD[((128+8))+rsp],r8d
+
+	mov	rbx,rdx
+	mul	rdx
+	mov	r8,rax
+	mov	rax,QWORD[16+rsi]
+	mov	r9,rdx
+
+	mul	rbx
+	add	r9,rax
+	mov	rax,QWORD[24+rsi]
+	mov	r10,rdx
+	adc	r10,0
+
+	mul	rbx
+	add	r10,rax
+	mov	rax,QWORD[32+rsi]
+	mov	r11,rdx
+	adc	r11,0
+
+	mul	rbx
+	add	r11,rax
+	mov	rax,QWORD[40+rsi]
+	mov	r12,rdx
+	adc	r12,0
+
+	mul	rbx
+	add	r12,rax
+	mov	rax,QWORD[48+rsi]
+	mov	r13,rdx
+	adc	r13,0
+
+	mul	rbx
+	add	r13,rax
+	mov	rax,QWORD[56+rsi]
+	mov	r14,rdx
+	adc	r14,0
+
+	mul	rbx
+	add	r14,rax
+	mov	rax,rbx
+	mov	r15,rdx
+	adc	r15,0
+
+	add	r8,r8
+	mov	rcx,r9
+	adc	r9,r9
+
+	mul	rax
+	mov	QWORD[rsp],rax
+	add	r8,rdx
+	adc	r9,0
+
+	mov	QWORD[8+rsp],r8
+	shr	rcx,63
+
+
+	mov	r8,QWORD[8+rsi]
+	mov	rax,QWORD[16+rsi]
+	mul	r8
+	add	r10,rax
+	mov	rax,QWORD[24+rsi]
+	mov	rbx,rdx
+	adc	rbx,0
+
+	mul	r8
+	add	r11,rax
+	mov	rax,QWORD[32+rsi]
+	adc	rdx,0
+	add	r11,rbx
+	mov	rbx,rdx
+	adc	rbx,0
+
+	mul	r8
+	add	r12,rax
+	mov	rax,QWORD[40+rsi]
+	adc	rdx,0
+	add	r12,rbx
+	mov	rbx,rdx
+	adc	rbx,0
+
+	mul	r8
+	add	r13,rax
+	mov	rax,QWORD[48+rsi]
+	adc	rdx,0
+	add	r13,rbx
+	mov	rbx,rdx
+	adc	rbx,0
+
+	mul	r8
+	add	r14,rax
+	mov	rax,QWORD[56+rsi]
+	adc	rdx,0
+	add	r14,rbx
+	mov	rbx,rdx
+	adc	rbx,0
+
+	mul	r8
+	add	r15,rax
+	mov	rax,r8
+	adc	rdx,0
+	add	r15,rbx
+	mov	r8,rdx
+	mov	rdx,r10
+	adc	r8,0
+
+	add	rdx,rdx
+	lea	r10,[r10*2+rcx]
+	mov	rbx,r11
+	adc	r11,r11
+
+	mul	rax
+	add	r9,rax
+	adc	r10,rdx
+	adc	r11,0
+
+	mov	QWORD[16+rsp],r9
+	mov	QWORD[24+rsp],r10
+	shr	rbx,63
+
+
+	mov	r9,QWORD[16+rsi]
+	mov	rax,QWORD[24+rsi]
+	mul	r9
+	add	r12,rax
+	mov	rax,QWORD[32+rsi]
+	mov	rcx,rdx
+	adc	rcx,0
+
+	mul	r9
+	add	r13,rax
+	mov	rax,QWORD[40+rsi]
+	adc	rdx,0
+	add	r13,rcx
+	mov	rcx,rdx
+	adc	rcx,0
+
+	mul	r9
+	add	r14,rax
+	mov	rax,QWORD[48+rsi]
+	adc	rdx,0
+	add	r14,rcx
+	mov	rcx,rdx
+	adc	rcx,0
+
+	mul	r9
+	mov	r10,r12
+	lea	r12,[r12*2+rbx]
+	add	r15,rax
+	mov	rax,QWORD[56+rsi]
+	adc	rdx,0
+	add	r15,rcx
+	mov	rcx,rdx
+	adc	rcx,0
+
+	mul	r9
+	shr	r10,63
+	add	r8,rax
+	mov	rax,r9
+	adc	rdx,0
+	add	r8,rcx
+	mov	r9,rdx
+	adc	r9,0
+
+	mov	rcx,r13
+	lea	r13,[r13*2+r10]
+
+	mul	rax
+	add	r11,rax
+	adc	r12,rdx
+	adc	r13,0
+
+	mov	QWORD[32+rsp],r11
+	mov	QWORD[40+rsp],r12
+	shr	rcx,63
+
+
+	mov	r10,QWORD[24+rsi]
+	mov	rax,QWORD[32+rsi]
+	mul	r10
+	add	r14,rax
+	mov	rax,QWORD[40+rsi]
+	mov	rbx,rdx
+	adc	rbx,0
+
+	mul	r10
+	add	r15,rax
+	mov	rax,QWORD[48+rsi]
+	adc	rdx,0
+	add	r15,rbx
+	mov	rbx,rdx
+	adc	rbx,0
+
+	mul	r10
+	mov	r12,r14
+	lea	r14,[r14*2+rcx]
+	add	r8,rax
+	mov	rax,QWORD[56+rsi]
+	adc	rdx,0
+	add	r8,rbx
+	mov	rbx,rdx
+	adc	rbx,0
+
+	mul	r10
+	shr	r12,63
+	add	r9,rax
+	mov	rax,r10
+	adc	rdx,0
+	add	r9,rbx
+	mov	r10,rdx
+	adc	r10,0
+
+	mov	rbx,r15
+	lea	r15,[r15*2+r12]
+
+	mul	rax
+	add	r13,rax
+	adc	r14,rdx
+	adc	r15,0
+
+	mov	QWORD[48+rsp],r13
+	mov	QWORD[56+rsp],r14
+	shr	rbx,63
+
+
+	mov	r11,QWORD[32+rsi]
+	mov	rax,QWORD[40+rsi]
+	mul	r11
+	add	r8,rax
+	mov	rax,QWORD[48+rsi]
+	mov	rcx,rdx
+	adc	rcx,0
+
+	mul	r11
+	add	r9,rax
+	mov	rax,QWORD[56+rsi]
+	adc	rdx,0
+	mov	r12,r8
+	lea	r8,[r8*2+rbx]
+	add	r9,rcx
+	mov	rcx,rdx
+	adc	rcx,0
+
+	mul	r11
+	shr	r12,63
+	add	r10,rax
+	mov	rax,r11
+	adc	rdx,0
+	add	r10,rcx
+	mov	r11,rdx
+	adc	r11,0
+
+	mov	rcx,r9
+	lea	r9,[r9*2+r12]
+
+	mul	rax
+	add	r15,rax
+	adc	r8,rdx
+	adc	r9,0
+
+	mov	QWORD[64+rsp],r15
+	mov	QWORD[72+rsp],r8
+	shr	rcx,63
+
+
+	mov	r12,QWORD[40+rsi]
+	mov	rax,QWORD[48+rsi]
+	mul	r12
+	add	r10,rax
+	mov	rax,QWORD[56+rsi]
+	mov	rbx,rdx
+	adc	rbx,0
+
+	mul	r12
+	add	r11,rax
+	mov	rax,r12
+	mov	r15,r10
+	lea	r10,[r10*2+rcx]
+	adc	rdx,0
+	shr	r15,63
+	add	r11,rbx
+	mov	r12,rdx
+	adc	r12,0
+
+	mov	rbx,r11
+	lea	r11,[r11*2+r15]
+
+	mul	rax
+	add	r9,rax
+	adc	r10,rdx
+	adc	r11,0
+
+	mov	QWORD[80+rsp],r9
+	mov	QWORD[88+rsp],r10
+
+
+	mov	r13,QWORD[48+rsi]
+	mov	rax,QWORD[56+rsi]
+	mul	r13
+	add	r12,rax
+	mov	rax,r13
+	mov	r13,rdx
+	adc	r13,0
+
+	xor	r14,r14
+	shl	rbx,1
+	adc	r12,r12
+	adc	r13,r13
+	adc	r14,r14
+
+	mul	rax
+	add	r11,rax
+	adc	r12,rdx
+	adc	r13,0
+
+	mov	QWORD[96+rsp],r11
+	mov	QWORD[104+rsp],r12
+
+
+	mov	rax,QWORD[56+rsi]
+	mul	rax
+	add	r13,rax
+	adc	rdx,0
+
+	add	r14,rdx
+
+	mov	QWORD[112+rsp],r13
+	mov	QWORD[120+rsp],r14
+
+	mov	r8,QWORD[rsp]
+	mov	r9,QWORD[8+rsp]
+	mov	r10,QWORD[16+rsp]
+	mov	r11,QWORD[24+rsp]
+	mov	r12,QWORD[32+rsp]
+	mov	r13,QWORD[40+rsp]
+	mov	r14,QWORD[48+rsp]
+	mov	r15,QWORD[56+rsp]
+
+	call	__rsaz_512_reduce
+
+	add	r8,QWORD[64+rsp]
+	adc	r9,QWORD[72+rsp]
+	adc	r10,QWORD[80+rsp]
+	adc	r11,QWORD[88+rsp]
+	adc	r12,QWORD[96+rsp]
+	adc	r13,QWORD[104+rsp]
+	adc	r14,QWORD[112+rsp]
+	adc	r15,QWORD[120+rsp]
+	sbb	rcx,rcx
+
+	call	__rsaz_512_subtract
+
+	mov	rdx,r8
+	mov	rax,r9
+	mov	r8d,DWORD[((128+8))+rsp]
+	mov	rsi,rdi
+
+	dec	r8d
+	jnz	NEAR $L$oop_sqr
+
+	lea	rax,[((128+24+48))+rsp]
+	mov	r15,QWORD[((-48))+rax]
+	mov	r14,QWORD[((-40))+rax]
+	mov	r13,QWORD[((-32))+rax]
+	mov	r12,QWORD[((-24))+rax]
+	mov	rbp,QWORD[((-16))+rax]
+	mov	rbx,QWORD[((-8))+rax]
+	lea	rsp,[rax]
+$L$sqr_epilogue:
+	mov	rdi,QWORD[8+rsp]	;WIN64 epilogue
+	mov	rsi,QWORD[16+rsp]
+	DB	0F3h,0C3h		;repret
+$L$SEH_end_rsaz_512_sqr:
+global	rsaz_512_mul
+
+ALIGN	32
+rsaz_512_mul:
+	mov	QWORD[8+rsp],rdi	;WIN64 prologue
+	mov	QWORD[16+rsp],rsi
+	mov	rax,rsp
+$L$SEH_begin_rsaz_512_mul:
+	mov	rdi,rcx
+	mov	rsi,rdx
+	mov	rdx,r8
+	mov	rcx,r9
+	mov	r8,QWORD[40+rsp]
+
+
+	push	rbx
+	push	rbp
+	push	r12
+	push	r13
+	push	r14
+	push	r15
+
+	sub	rsp,128+24
+$L$mul_body:
+DB	102,72,15,110,199
+DB	102,72,15,110,201
+	mov	QWORD[128+rsp],r8
+	mov	rbx,QWORD[rdx]
+	mov	rbp,rdx
+	call	__rsaz_512_mul
+
+DB	102,72,15,126,199
+DB	102,72,15,126,205
+
+	mov	r8,QWORD[rsp]
+	mov	r9,QWORD[8+rsp]
+	mov	r10,QWORD[16+rsp]
+	mov	r11,QWORD[24+rsp]
+	mov	r12,QWORD[32+rsp]
+	mov	r13,QWORD[40+rsp]
+	mov	r14,QWORD[48+rsp]
+	mov	r15,QWORD[56+rsp]
+
+	call	__rsaz_512_reduce
+	add	r8,QWORD[64+rsp]
+	adc	r9,QWORD[72+rsp]
+	adc	r10,QWORD[80+rsp]
+	adc	r11,QWORD[88+rsp]
+	adc	r12,QWORD[96+rsp]
+	adc	r13,QWORD[104+rsp]
+	adc	r14,QWORD[112+rsp]
+	adc	r15,QWORD[120+rsp]
+	sbb	rcx,rcx
+
+	call	__rsaz_512_subtract
+
+	lea	rax,[((128+24+48))+rsp]
+	mov	r15,QWORD[((-48))+rax]
+	mov	r14,QWORD[((-40))+rax]
+	mov	r13,QWORD[((-32))+rax]
+	mov	r12,QWORD[((-24))+rax]
+	mov	rbp,QWORD[((-16))+rax]
+	mov	rbx,QWORD[((-8))+rax]
+	lea	rsp,[rax]
+$L$mul_epilogue:
+	mov	rdi,QWORD[8+rsp]	;WIN64 epilogue
+	mov	rsi,QWORD[16+rsp]
+	DB	0F3h,0C3h		;repret
+$L$SEH_end_rsaz_512_mul:
+global	rsaz_512_mul_gather4
+
+ALIGN	32
+rsaz_512_mul_gather4:
+	mov	QWORD[8+rsp],rdi	;WIN64 prologue
+	mov	QWORD[16+rsp],rsi
+	mov	rax,rsp
+$L$SEH_begin_rsaz_512_mul_gather4:
+	mov	rdi,rcx
+	mov	rsi,rdx
+	mov	rdx,r8
+	mov	rcx,r9
+	mov	r8,QWORD[40+rsp]
+	mov	r9,QWORD[48+rsp]
+
+
+	push	rbx
+	push	rbp
+	push	r12
+	push	r13
+	push	r14
+	push	r15
+
+	mov	r9d,r9d
+	sub	rsp,128+24
+$L$mul_gather4_body:
+	mov	eax,DWORD[64+r9*4+rdx]
+DB	102,72,15,110,199
+	mov	ebx,DWORD[r9*4+rdx]
+DB	102,72,15,110,201
+	mov	QWORD[128+rsp],r8
+
+	shl	rax,32
+	or	rbx,rax
+	mov	rax,QWORD[rsi]
+	mov	rcx,QWORD[8+rsi]
+	lea	rbp,[128+r9*4+rdx]
+	mul	rbx
+	mov	QWORD[rsp],rax
+	mov	rax,rcx
+	mov	r8,rdx
+
+	mul	rbx
+	movd	xmm4,DWORD[rbp]
+	add	r8,rax
+	mov	rax,QWORD[16+rsi]
+	mov	r9,rdx
+	adc	r9,0
+
+	mul	rbx
+	movd	xmm5,DWORD[64+rbp]
+	add	r9,rax
+	mov	rax,QWORD[24+rsi]
+	mov	r10,rdx
+	adc	r10,0
+
+	mul	rbx
+	pslldq	xmm5,4
+	add	r10,rax
+	mov	rax,QWORD[32+rsi]
+	mov	r11,rdx
+	adc	r11,0
+
+	mul	rbx
+	por	xmm4,xmm5
+	add	r11,rax
+	mov	rax,QWORD[40+rsi]
+	mov	r12,rdx
+	adc	r12,0
+
+	mul	rbx
+	add	r12,rax
+	mov	rax,QWORD[48+rsi]
+	mov	r13,rdx
+	adc	r13,0
+
+	mul	rbx
+	lea	rbp,[128+rbp]
+	add	r13,rax
+	mov	rax,QWORD[56+rsi]
+	mov	r14,rdx
+	adc	r14,0
+
+	mul	rbx
+DB	102,72,15,126,227
+	add	r14,rax
+	mov	rax,QWORD[rsi]
+	mov	r15,rdx
+	adc	r15,0
+
+	lea	rdi,[8+rsp]
+	mov	ecx,7
+	jmp	NEAR $L$oop_mul_gather
+
+ALIGN	32
+$L$oop_mul_gather:
+	mul	rbx
+	add	r8,rax
+	mov	rax,QWORD[8+rsi]
+	mov	QWORD[rdi],r8
+	mov	r8,rdx
+	adc	r8,0
+
+	mul	rbx
+	movd	xmm4,DWORD[rbp]
+	add	r9,rax
+	mov	rax,QWORD[16+rsi]
+	adc	rdx,0
+	add	r8,r9
+	mov	r9,rdx
+	adc	r9,0
+
+	mul	rbx
+	movd	xmm5,DWORD[64+rbp]
+	add	r10,rax
+	mov	rax,QWORD[24+rsi]
+	adc	rdx,0
+	add	r9,r10
+	mov	r10,rdx
+	adc	r10,0
+
+	mul	rbx
+	pslldq	xmm5,4
+	add	r11,rax
+	mov	rax,QWORD[32+rsi]
+	adc	rdx,0
+	add	r10,r11
+	mov	r11,rdx
+	adc	r11,0
+
+	mul	rbx
+	por	xmm4,xmm5
+	add	r12,rax
+	mov	rax,QWORD[40+rsi]
+	adc	rdx,0
+	add	r11,r12
+	mov	r12,rdx
+	adc	r12,0
+
+	mul	rbx
+	add	r13,rax
+	mov	rax,QWORD[48+rsi]
+	adc	rdx,0
+	add	r12,r13
+	mov	r13,rdx
+	adc	r13,0
+
+	mul	rbx
+	add	r14,rax
+	mov	rax,QWORD[56+rsi]
+	adc	rdx,0
+	add	r13,r14
+	mov	r14,rdx
+	adc	r14,0
+
+	mul	rbx
+DB	102,72,15,126,227
+	add	r15,rax
+	mov	rax,QWORD[rsi]
+	adc	rdx,0
+	add	r14,r15
+	mov	r15,rdx
+	adc	r15,0
+
+	lea	rbp,[128+rbp]
+	lea	rdi,[8+rdi]
+
+	dec	ecx
+	jnz	NEAR $L$oop_mul_gather
+
+	mov	QWORD[rdi],r8
+	mov	QWORD[8+rdi],r9
+	mov	QWORD[16+rdi],r10
+	mov	QWORD[24+rdi],r11
+	mov	QWORD[32+rdi],r12
+	mov	QWORD[40+rdi],r13
+	mov	QWORD[48+rdi],r14
+	mov	QWORD[56+rdi],r15
+
+DB	102,72,15,126,199
+DB	102,72,15,126,205
+
+	mov	r8,QWORD[rsp]
+	mov	r9,QWORD[8+rsp]
+	mov	r10,QWORD[16+rsp]
+	mov	r11,QWORD[24+rsp]
+	mov	r12,QWORD[32+rsp]
+	mov	r13,QWORD[40+rsp]
+	mov	r14,QWORD[48+rsp]
+	mov	r15,QWORD[56+rsp]
+
+	call	__rsaz_512_reduce
+	add	r8,QWORD[64+rsp]
+	adc	r9,QWORD[72+rsp]
+	adc	r10,QWORD[80+rsp]
+	adc	r11,QWORD[88+rsp]
+	adc	r12,QWORD[96+rsp]
+	adc	r13,QWORD[104+rsp]
+	adc	r14,QWORD[112+rsp]
+	adc	r15,QWORD[120+rsp]
+	sbb	rcx,rcx
+
+	call	__rsaz_512_subtract
+
+	lea	rax,[((128+24+48))+rsp]
+	mov	r15,QWORD[((-48))+rax]
+	mov	r14,QWORD[((-40))+rax]
+	mov	r13,QWORD[((-32))+rax]
+	mov	r12,QWORD[((-24))+rax]
+	mov	rbp,QWORD[((-16))+rax]
+	mov	rbx,QWORD[((-8))+rax]
+	lea	rsp,[rax]
+$L$mul_gather4_epilogue:
+	mov	rdi,QWORD[8+rsp]	;WIN64 epilogue
+	mov	rsi,QWORD[16+rsp]
+	DB	0F3h,0C3h		;repret
+$L$SEH_end_rsaz_512_mul_gather4:
+global	rsaz_512_mul_scatter4
+
+ALIGN	32
+rsaz_512_mul_scatter4:
+	mov	QWORD[8+rsp],rdi	;WIN64 prologue
+	mov	QWORD[16+rsp],rsi
+	mov	rax,rsp
+$L$SEH_begin_rsaz_512_mul_scatter4:
+	mov	rdi,rcx
+	mov	rsi,rdx
+	mov	rdx,r8
+	mov	rcx,r9
+	mov	r8,QWORD[40+rsp]
+	mov	r9,QWORD[48+rsp]
+
+
+	push	rbx
+	push	rbp
+	push	r12
+	push	r13
+	push	r14
+	push	r15
+
+	mov	r9d,r9d
+	sub	rsp,128+24
+$L$mul_scatter4_body:
+	lea	r8,[r9*4+r8]
+DB	102,72,15,110,199
+DB	102,72,15,110,202
+DB	102,73,15,110,208
+	mov	QWORD[128+rsp],rcx
+
+	mov	rbp,rdi
+	mov	rbx,QWORD[rdi]
+	call	__rsaz_512_mul
+
+DB	102,72,15,126,199
+DB	102,72,15,126,205
+
+	mov	r8,QWORD[rsp]
+	mov	r9,QWORD[8+rsp]
+	mov	r10,QWORD[16+rsp]
+	mov	r11,QWORD[24+rsp]
+	mov	r12,QWORD[32+rsp]
+	mov	r13,QWORD[40+rsp]
+	mov	r14,QWORD[48+rsp]
+	mov	r15,QWORD[56+rsp]
+
+	call	__rsaz_512_reduce
+	add	r8,QWORD[64+rsp]
+	adc	r9,QWORD[72+rsp]
+	adc	r10,QWORD[80+rsp]
+	adc	r11,QWORD[88+rsp]
+	adc	r12,QWORD[96+rsp]
+	adc	r13,QWORD[104+rsp]
+	adc	r14,QWORD[112+rsp]
+	adc	r15,QWORD[120+rsp]
+DB	102,72,15,126,214
+	sbb	rcx,rcx
+
+	call	__rsaz_512_subtract
+
+	mov	DWORD[rsi],r8d
+	shr	r8,32
+	mov	DWORD[128+rsi],r9d
+	shr	r9,32
+	mov	DWORD[256+rsi],r10d
+	shr	r10,32
+	mov	DWORD[384+rsi],r11d
+	shr	r11,32
+	mov	DWORD[512+rsi],r12d
+	shr	r12,32
+	mov	DWORD[640+rsi],r13d
+	shr	r13,32
+	mov	DWORD[768+rsi],r14d
+	shr	r14,32
+	mov	DWORD[896+rsi],r15d
+	shr	r15,32
+	mov	DWORD[64+rsi],r8d
+	mov	DWORD[192+rsi],r9d
+	mov	DWORD[320+rsi],r10d
+	mov	DWORD[448+rsi],r11d
+	mov	DWORD[576+rsi],r12d
+	mov	DWORD[704+rsi],r13d
+	mov	DWORD[832+rsi],r14d
+	mov	DWORD[960+rsi],r15d
+
+	lea	rax,[((128+24+48))+rsp]
+	mov	r15,QWORD[((-48))+rax]
+	mov	r14,QWORD[((-40))+rax]
+	mov	r13,QWORD[((-32))+rax]
+	mov	r12,QWORD[((-24))+rax]
+	mov	rbp,QWORD[((-16))+rax]
+	mov	rbx,QWORD[((-8))+rax]
+	lea	rsp,[rax]
+$L$mul_scatter4_epilogue:
+	mov	rdi,QWORD[8+rsp]	;WIN64 epilogue
+	mov	rsi,QWORD[16+rsp]
+	DB	0F3h,0C3h		;repret
+$L$SEH_end_rsaz_512_mul_scatter4:
+global	rsaz_512_mul_by_one
+
+ALIGN	32
+rsaz_512_mul_by_one:
+	mov	QWORD[8+rsp],rdi	;WIN64 prologue
+	mov	QWORD[16+rsp],rsi
+	mov	rax,rsp
+$L$SEH_begin_rsaz_512_mul_by_one:
+	mov	rdi,rcx
+	mov	rsi,rdx
+	mov	rdx,r8
+	mov	rcx,r9
+
+
+	push	rbx
+	push	rbp
+	push	r12
+	push	r13
+	push	r14
+	push	r15
+
+	sub	rsp,128+24
+$L$mul_by_one_body:
+	mov	rbp,rdx
+	mov	QWORD[128+rsp],rcx
+
+	mov	r8,QWORD[rsi]
+	pxor	xmm0,xmm0
+	mov	r9,QWORD[8+rsi]
+	mov	r10,QWORD[16+rsi]
+	mov	r11,QWORD[24+rsi]
+	mov	r12,QWORD[32+rsi]
+	mov	r13,QWORD[40+rsi]
+	mov	r14,QWORD[48+rsi]
+	mov	r15,QWORD[56+rsi]
+
+	movdqa	XMMWORD[rsp],xmm0
+	movdqa	XMMWORD[16+rsp],xmm0
+	movdqa	XMMWORD[32+rsp],xmm0
+	movdqa	XMMWORD[48+rsp],xmm0
+	movdqa	XMMWORD[64+rsp],xmm0
+	movdqa	XMMWORD[80+rsp],xmm0
+	movdqa	XMMWORD[96+rsp],xmm0
+	call	__rsaz_512_reduce
+	mov	QWORD[rdi],r8
+	mov	QWORD[8+rdi],r9
+	mov	QWORD[16+rdi],r10
+	mov	QWORD[24+rdi],r11
+	mov	QWORD[32+rdi],r12
+	mov	QWORD[40+rdi],r13
+	mov	QWORD[48+rdi],r14
+	mov	QWORD[56+rdi],r15
+
+	lea	rax,[((128+24+48))+rsp]
+	mov	r15,QWORD[((-48))+rax]
+	mov	r14,QWORD[((-40))+rax]
+	mov	r13,QWORD[((-32))+rax]
+	mov	r12,QWORD[((-24))+rax]
+	mov	rbp,QWORD[((-16))+rax]
+	mov	rbx,QWORD[((-8))+rax]
+	lea	rsp,[rax]
+$L$mul_by_one_epilogue:
+	mov	rdi,QWORD[8+rsp]	;WIN64 epilogue
+	mov	rsi,QWORD[16+rsp]
+	DB	0F3h,0C3h		;repret
+$L$SEH_end_rsaz_512_mul_by_one:
+
+ALIGN	32
+__rsaz_512_reduce:
+	mov	rbx,r8
+	imul	rbx,QWORD[((128+8))+rsp]
+	mov	rax,QWORD[rbp]
+	mov	ecx,8
+	jmp	NEAR $L$reduction_loop
+
+ALIGN	32
+$L$reduction_loop:
+	mul	rbx
+	mov	rax,QWORD[8+rbp]
+	neg	r8
+	mov	r8,rdx
+	adc	r8,0
+
+	mul	rbx
+	add	r9,rax
+	mov	rax,QWORD[16+rbp]
+	adc	rdx,0
+	add	r8,r9
+	mov	r9,rdx
+	adc	r9,0
+
+	mul	rbx
+	add	r10,rax
+	mov	rax,QWORD[24+rbp]
+	adc	rdx,0
+	add	r9,r10
+	mov	r10,rdx
+	adc	r10,0
+
+	mul	rbx
+	add	r11,rax
+	mov	rax,QWORD[32+rbp]
+	adc	rdx,0
+	add	r10,r11
+	mov	rsi,QWORD[((128+8))+rsp]
+
+
+	adc	rdx,0
+	mov	r11,rdx
+
+	mul	rbx
+	add	r12,rax
+	mov	rax,QWORD[40+rbp]
+	adc	rdx,0
+	imul	rsi,r8
+	add	r11,r12
+	mov	r12,rdx
+	adc	r12,0
+
+	mul	rbx
+	add	r13,rax
+	mov	rax,QWORD[48+rbp]
+	adc	rdx,0
+	add	r12,r13
+	mov	r13,rdx
+	adc	r13,0
+
+	mul	rbx
+	add	r14,rax
+	mov	rax,QWORD[56+rbp]
+	adc	rdx,0
+	add	r13,r14
+	mov	r14,rdx
+	adc	r14,0
+
+	mul	rbx
+	mov	rbx,rsi
+	add	r15,rax
+	mov	rax,QWORD[rbp]
+	adc	rdx,0
+	add	r14,r15
+	mov	r15,rdx
+	adc	r15,0
+
+	dec	ecx
+	jne	NEAR $L$reduction_loop
+
+	DB	0F3h,0C3h		;repret
+
+
+ALIGN	32
+__rsaz_512_subtract:
+	mov	QWORD[rdi],r8
+	mov	QWORD[8+rdi],r9
+	mov	QWORD[16+rdi],r10
+	mov	QWORD[24+rdi],r11
+	mov	QWORD[32+rdi],r12
+	mov	QWORD[40+rdi],r13
+	mov	QWORD[48+rdi],r14
+	mov	QWORD[56+rdi],r15
+
+	mov	r8,QWORD[rbp]
+	mov	r9,QWORD[8+rbp]
+	neg	r8
+	not	r9
+	and	r8,rcx
+	mov	r10,QWORD[16+rbp]
+	and	r9,rcx
+	not	r10
+	mov	r11,QWORD[24+rbp]
+	and	r10,rcx
+	not	r11
+	mov	r12,QWORD[32+rbp]
+	and	r11,rcx
+	not	r12
+	mov	r13,QWORD[40+rbp]
+	and	r12,rcx
+	not	r13
+	mov	r14,QWORD[48+rbp]
+	and	r13,rcx
+	not	r14
+	mov	r15,QWORD[56+rbp]
+	and	r14,rcx
+	not	r15
+	and	r15,rcx
+
+	add	r8,QWORD[rdi]
+	adc	r9,QWORD[8+rdi]
+	adc	r10,QWORD[16+rdi]
+	adc	r11,QWORD[24+rdi]
+	adc	r12,QWORD[32+rdi]
+	adc	r13,QWORD[40+rdi]
+	adc	r14,QWORD[48+rdi]
+	adc	r15,QWORD[56+rdi]
+
+	mov	QWORD[rdi],r8
+	mov	QWORD[8+rdi],r9
+	mov	QWORD[16+rdi],r10
+	mov	QWORD[24+rdi],r11
+	mov	QWORD[32+rdi],r12
+	mov	QWORD[40+rdi],r13
+	mov	QWORD[48+rdi],r14
+	mov	QWORD[56+rdi],r15
+
+	DB	0F3h,0C3h		;repret
+
+
+ALIGN	32
+__rsaz_512_mul:
+	lea	rdi,[8+rsp]
+
+	mov	rax,QWORD[rsi]
+	mul	rbx
+	mov	QWORD[rdi],rax
+	mov	rax,QWORD[8+rsi]
+	mov	r8,rdx
+
+	mul	rbx
+	add	r8,rax
+	mov	rax,QWORD[16+rsi]
+	mov	r9,rdx
+	adc	r9,0
+
+	mul	rbx
+	add	r9,rax
+	mov	rax,QWORD[24+rsi]
+	mov	r10,rdx
+	adc	r10,0
+
+	mul	rbx
+	add	r10,rax
+	mov	rax,QWORD[32+rsi]
+	mov	r11,rdx
+	adc	r11,0
+
+	mul	rbx
+	add	r11,rax
+	mov	rax,QWORD[40+rsi]
+	mov	r12,rdx
+	adc	r12,0
+
+	mul	rbx
+	add	r12,rax
+	mov	rax,QWORD[48+rsi]
+	mov	r13,rdx
+	adc	r13,0
+
+	mul	rbx
+	add	r13,rax
+	mov	rax,QWORD[56+rsi]
+	mov	r14,rdx
+	adc	r14,0
+
+	mul	rbx
+	add	r14,rax
+	mov	rax,QWORD[rsi]
+	mov	r15,rdx
+	adc	r15,0
+
+	lea	rbp,[8+rbp]
+	lea	rdi,[8+rdi]
+
+	mov	ecx,7
+	jmp	NEAR $L$oop_mul
+
+ALIGN	32
+$L$oop_mul:
+	mov	rbx,QWORD[rbp]
+	mul	rbx
+	add	r8,rax
+	mov	rax,QWORD[8+rsi]
+	mov	QWORD[rdi],r8
+	mov	r8,rdx
+	adc	r8,0
+
+	mul	rbx
+	add	r9,rax
+	mov	rax,QWORD[16+rsi]
+	adc	rdx,0
+	add	r8,r9
+	mov	r9,rdx
+	adc	r9,0
+
+	mul	rbx
+	add	r10,rax
+	mov	rax,QWORD[24+rsi]
+	adc	rdx,0
+	add	r9,r10
+	mov	r10,rdx
+	adc	r10,0
+
+	mul	rbx
+	add	r11,rax
+	mov	rax,QWORD[32+rsi]
+	adc	rdx,0
+	add	r10,r11
+	mov	r11,rdx
+	adc	r11,0
+
+	mul	rbx
+	add	r12,rax
+	mov	rax,QWORD[40+rsi]
+	adc	rdx,0
+	add	r11,r12
+	mov	r12,rdx
+	adc	r12,0
+
+	mul	rbx
+	add	r13,rax
+	mov	rax,QWORD[48+rsi]
+	adc	rdx,0
+	add	r12,r13
+	mov	r13,rdx
+	adc	r13,0
+
+	mul	rbx
+	add	r14,rax
+	mov	rax,QWORD[56+rsi]
+	adc	rdx,0
+	add	r13,r14
+	mov	r14,rdx
+	lea	rbp,[8+rbp]
+	adc	r14,0
+
+	mul	rbx
+	add	r15,rax
+	mov	rax,QWORD[rsi]
+	adc	rdx,0
+	add	r14,r15
+	mov	r15,rdx
+	adc	r15,0
+
+	lea	rdi,[8+rdi]
+
+	dec	ecx
+	jnz	NEAR $L$oop_mul
+
+	mov	QWORD[rdi],r8
+	mov	QWORD[8+rdi],r9
+	mov	QWORD[16+rdi],r10
+	mov	QWORD[24+rdi],r11
+	mov	QWORD[32+rdi],r12
+	mov	QWORD[40+rdi],r13
+	mov	QWORD[48+rdi],r14
+	mov	QWORD[56+rdi],r15
+
+	DB	0F3h,0C3h		;repret
+
+global	rsaz_512_scatter4
+
+ALIGN	16
+rsaz_512_scatter4:
+	lea	rcx,[r8*4+rcx]
+	mov	r9d,8
+	jmp	NEAR $L$oop_scatter
+ALIGN	16
+$L$oop_scatter:
+	mov	rax,QWORD[rdx]
+	lea	rdx,[8+rdx]
+	mov	DWORD[rcx],eax
+	shr	rax,32
+	mov	DWORD[64+rcx],eax
+	lea	rcx,[128+rcx]
+	dec	r9d
+	jnz	NEAR $L$oop_scatter
+	DB	0F3h,0C3h		;repret
+
+
+global	rsaz_512_gather4
+
+ALIGN	16
+rsaz_512_gather4:
+	lea	rdx,[r8*4+rdx]
+	mov	r9d,8
+	jmp	NEAR $L$oop_gather
+ALIGN	16
+$L$oop_gather:
+	mov	eax,DWORD[rdx]
+	mov	r8d,DWORD[64+rdx]
+	lea	rdx,[128+rdx]
+	shl	r8,32
+	or	rax,r8
+	mov	QWORD[rcx],rax
+	lea	rcx,[8+rcx]
+	dec	r9d
+	jnz	NEAR $L$oop_gather
+	DB	0F3h,0C3h		;repret
+
+EXTERN	__imp_RtlVirtualUnwind
+
+ALIGN	16
+se_handler:
+	push	rsi
+	push	rdi
+	push	rbx
+	push	rbp
+	push	r12
+	push	r13
+	push	r14
+	push	r15
+	pushfq
+	sub	rsp,64
+
+	mov	rax,QWORD[120+r8]
+	mov	rbx,QWORD[248+r8]
+
+	mov	rsi,QWORD[8+r9]
+	mov	r11,QWORD[56+r9]
+
+	mov	r10d,DWORD[r11]
+	lea	r10,[r10*1+rsi]
+	cmp	rbx,r10
+	jb	NEAR $L$common_seh_tail
+
+	mov	rax,QWORD[152+r8]
+
+	mov	r10d,DWORD[4+r11]
+	lea	r10,[r10*1+rsi]
+	cmp	rbx,r10
+	jae	NEAR $L$common_seh_tail
+
+	lea	rax,[((128+24+48))+rax]
+
+	mov	rbx,QWORD[((-8))+rax]
+	mov	rbp,QWORD[((-16))+rax]
+	mov	r12,QWORD[((-24))+rax]
+	mov	r13,QWORD[((-32))+rax]
+	mov	r14,QWORD[((-40))+rax]
+	mov	r15,QWORD[((-48))+rax]
+	mov	QWORD[144+r8],rbx
+	mov	QWORD[160+r8],rbp
+	mov	QWORD[216+r8],r12
+	mov	QWORD[224+r8],r13
+	mov	QWORD[232+r8],r14
+	mov	QWORD[240+r8],r15
+
+$L$common_seh_tail:
+	mov	rdi,QWORD[8+rax]
+	mov	rsi,QWORD[16+rax]
+	mov	QWORD[152+r8],rax
+	mov	QWORD[168+r8],rsi
+	mov	QWORD[176+r8],rdi
+
+	mov	rdi,QWORD[40+r9]
+	mov	rsi,r8
+	mov	ecx,154
+	DD	0xa548f3fc
+
+	mov	rsi,r9
+	xor	rcx,rcx
+	mov	rdx,QWORD[8+rsi]
+	mov	r8,QWORD[rsi]
+	mov	r9,QWORD[16+rsi]
+	mov	r10,QWORD[40+rsi]
+	lea	r11,[56+rsi]
+	lea	r12,[24+rsi]
+	mov	QWORD[32+rsp],r10
+	mov	QWORD[40+rsp],r11
+	mov	QWORD[48+rsp],r12
+	mov	QWORD[56+rsp],rcx
+	call	QWORD[__imp_RtlVirtualUnwind]
+
+	mov	eax,1
+	add	rsp,64
+	popfq
+	pop	r15
+	pop	r14
+	pop	r13
+	pop	r12
+	pop	rbp
+	pop	rbx
+	pop	rdi
+	pop	rsi
+	DB	0F3h,0C3h		;repret
+
+
+section	.pdata rdata align=4
+ALIGN	4
+	DD	$L$SEH_begin_rsaz_512_sqr wrt ..imagebase
+	DD	$L$SEH_end_rsaz_512_sqr wrt ..imagebase
+	DD	$L$SEH_info_rsaz_512_sqr wrt ..imagebase
+
+	DD	$L$SEH_begin_rsaz_512_mul wrt ..imagebase
+	DD	$L$SEH_end_rsaz_512_mul wrt ..imagebase
+	DD	$L$SEH_info_rsaz_512_mul wrt ..imagebase
+
+	DD	$L$SEH_begin_rsaz_512_mul_gather4 wrt ..imagebase
+	DD	$L$SEH_end_rsaz_512_mul_gather4 wrt ..imagebase
+	DD	$L$SEH_info_rsaz_512_mul_gather4 wrt ..imagebase
+
+	DD	$L$SEH_begin_rsaz_512_mul_scatter4 wrt ..imagebase
+	DD	$L$SEH_end_rsaz_512_mul_scatter4 wrt ..imagebase
+	DD	$L$SEH_info_rsaz_512_mul_scatter4 wrt ..imagebase
+
+	DD	$L$SEH_begin_rsaz_512_mul_by_one wrt ..imagebase
+	DD	$L$SEH_end_rsaz_512_mul_by_one wrt ..imagebase
+	DD	$L$SEH_info_rsaz_512_mul_by_one wrt ..imagebase
+
+section	.xdata rdata align=8
+ALIGN	8
+$L$SEH_info_rsaz_512_sqr:
+DB	9,0,0,0
+	DD	se_handler wrt ..imagebase
+	DD	$L$sqr_body wrt ..imagebase,$L$sqr_epilogue wrt ..imagebase
+$L$SEH_info_rsaz_512_mul:
+DB	9,0,0,0
+	DD	se_handler wrt ..imagebase
+	DD	$L$mul_body wrt ..imagebase,$L$mul_epilogue wrt ..imagebase
+$L$SEH_info_rsaz_512_mul_gather4:
+DB	9,0,0,0
+	DD	se_handler wrt ..imagebase
+	DD	$L$mul_gather4_body wrt ..imagebase,$L$mul_gather4_epilogue wrt ..imagebase
+$L$SEH_info_rsaz_512_mul_scatter4:
+DB	9,0,0,0
+	DD	se_handler wrt ..imagebase
+	DD	$L$mul_scatter4_body wrt ..imagebase,$L$mul_scatter4_epilogue wrt ..imagebase
+$L$SEH_info_rsaz_512_mul_by_one:
+DB	9,0,0,0
+	DD	se_handler wrt ..imagebase
+	DD	$L$mul_by_one_body wrt ..imagebase,$L$mul_by_one_epilogue wrt ..imagebase
diff --git a/third_party/boringssl/win-x86_64/crypto/bn/x86_64-mont.asm b/third_party/boringssl/win-x86_64/crypto/bn/x86_64-mont.asm
new file mode 100644
index 0000000..db0d1b9
--- /dev/null
+++ b/third_party/boringssl/win-x86_64/crypto/bn/x86_64-mont.asm
@@ -0,0 +1,941 @@
+default	rel
+%define XMMWORD
+%define YMMWORD
+%define ZMMWORD
+section	.text code align=64
+
+
+EXTERN	OPENSSL_ia32cap_P
+
+global	bn_mul_mont
+
+ALIGN	16
+bn_mul_mont:
+	mov	QWORD[8+rsp],rdi	;WIN64 prologue
+	mov	QWORD[16+rsp],rsi
+	mov	rax,rsp
+$L$SEH_begin_bn_mul_mont:
+	mov	rdi,rcx
+	mov	rsi,rdx
+	mov	rdx,r8
+	mov	rcx,r9
+	mov	r8,QWORD[40+rsp]
+	mov	r9,QWORD[48+rsp]
+
+
+	test	r9d,3
+	jnz	NEAR $L$mul_enter
+	cmp	r9d,8
+	jb	NEAR $L$mul_enter
+	cmp	rdx,rsi
+	jne	NEAR $L$mul4x_enter
+	test	r9d,7
+	jz	NEAR $L$sqr8x_enter
+	jmp	NEAR $L$mul4x_enter
+
+ALIGN	16
+$L$mul_enter:
+	push	rbx
+	push	rbp
+	push	r12
+	push	r13
+	push	r14
+	push	r15
+
+	mov	r9d,r9d
+	lea	r10,[2+r9]
+	mov	r11,rsp
+	neg	r10
+	lea	rsp,[r10*8+rsp]
+	and	rsp,-1024
+
+	mov	QWORD[8+r9*8+rsp],r11
+$L$mul_body:
+	mov	r12,rdx
+	mov	r8,QWORD[r8]
+	mov	rbx,QWORD[r12]
+	mov	rax,QWORD[rsi]
+
+	xor	r14,r14
+	xor	r15,r15
+
+	mov	rbp,r8
+	mul	rbx
+	mov	r10,rax
+	mov	rax,QWORD[rcx]
+
+	imul	rbp,r10
+	mov	r11,rdx
+
+	mul	rbp
+	add	r10,rax
+	mov	rax,QWORD[8+rsi]
+	adc	rdx,0
+	mov	r13,rdx
+
+	lea	r15,[1+r15]
+	jmp	NEAR $L$1st_enter
+
+ALIGN	16
+$L$1st:
+	add	r13,rax
+	mov	rax,QWORD[r15*8+rsi]
+	adc	rdx,0
+	add	r13,r11
+	mov	r11,r10
+	adc	rdx,0
+	mov	QWORD[((-16))+r15*8+rsp],r13
+	mov	r13,rdx
+
+$L$1st_enter:
+	mul	rbx
+	add	r11,rax
+	mov	rax,QWORD[r15*8+rcx]
+	adc	rdx,0
+	lea	r15,[1+r15]
+	mov	r10,rdx
+
+	mul	rbp
+	cmp	r15,r9
+	jne	NEAR $L$1st
+
+	add	r13,rax
+	mov	rax,QWORD[rsi]
+	adc	rdx,0
+	add	r13,r11
+	adc	rdx,0
+	mov	QWORD[((-16))+r15*8+rsp],r13
+	mov	r13,rdx
+	mov	r11,r10
+
+	xor	rdx,rdx
+	add	r13,r11
+	adc	rdx,0
+	mov	QWORD[((-8))+r9*8+rsp],r13
+	mov	QWORD[r9*8+rsp],rdx
+
+	lea	r14,[1+r14]
+	jmp	NEAR $L$outer
+ALIGN	16
+$L$outer:
+	mov	rbx,QWORD[r14*8+r12]
+	xor	r15,r15
+	mov	rbp,r8
+	mov	r10,QWORD[rsp]
+	mul	rbx
+	add	r10,rax
+	mov	rax,QWORD[rcx]
+	adc	rdx,0
+
+	imul	rbp,r10
+	mov	r11,rdx
+
+	mul	rbp
+	add	r10,rax
+	mov	rax,QWORD[8+rsi]
+	adc	rdx,0
+	mov	r10,QWORD[8+rsp]
+	mov	r13,rdx
+
+	lea	r15,[1+r15]
+	jmp	NEAR $L$inner_enter
+
+ALIGN	16
+$L$inner:
+	add	r13,rax
+	mov	rax,QWORD[r15*8+rsi]
+	adc	rdx,0
+	add	r13,r10
+	mov	r10,QWORD[r15*8+rsp]
+	adc	rdx,0
+	mov	QWORD[((-16))+r15*8+rsp],r13
+	mov	r13,rdx
+
+$L$inner_enter:
+	mul	rbx
+	add	r11,rax
+	mov	rax,QWORD[r15*8+rcx]
+	adc	rdx,0
+	add	r10,r11
+	mov	r11,rdx
+	adc	r11,0
+	lea	r15,[1+r15]
+
+	mul	rbp
+	cmp	r15,r9
+	jne	NEAR $L$inner
+
+	add	r13,rax
+	mov	rax,QWORD[rsi]
+	adc	rdx,0
+	add	r13,r10
+	mov	r10,QWORD[r15*8+rsp]
+	adc	rdx,0
+	mov	QWORD[((-16))+r15*8+rsp],r13
+	mov	r13,rdx
+
+	xor	rdx,rdx
+	add	r13,r11
+	adc	rdx,0
+	add	r13,r10
+	adc	rdx,0
+	mov	QWORD[((-8))+r9*8+rsp],r13
+	mov	QWORD[r9*8+rsp],rdx
+
+	lea	r14,[1+r14]
+	cmp	r14,r9
+	jb	NEAR $L$outer
+
+	xor	r14,r14
+	mov	rax,QWORD[rsp]
+	lea	rsi,[rsp]
+	mov	r15,r9
+	jmp	NEAR $L$sub
+ALIGN	16
+$L$sub:	sbb	rax,QWORD[r14*8+rcx]
+	mov	QWORD[r14*8+rdi],rax
+	mov	rax,QWORD[8+r14*8+rsi]
+	lea	r14,[1+r14]
+	dec	r15
+	jnz	NEAR $L$sub
+
+	sbb	rax,0
+	xor	r14,r14
+	mov	r15,r9
+ALIGN	16
+$L$copy:
+	mov	rsi,QWORD[r14*8+rsp]
+	mov	rcx,QWORD[r14*8+rdi]
+	xor	rsi,rcx
+	and	rsi,rax
+	xor	rsi,rcx
+	mov	QWORD[r14*8+rsp],r14
+	mov	QWORD[r14*8+rdi],rsi
+	lea	r14,[1+r14]
+	sub	r15,1
+	jnz	NEAR $L$copy
+
+	mov	rsi,QWORD[8+r9*8+rsp]
+	mov	rax,1
+	mov	r15,QWORD[rsi]
+	mov	r14,QWORD[8+rsi]
+	mov	r13,QWORD[16+rsi]
+	mov	r12,QWORD[24+rsi]
+	mov	rbp,QWORD[32+rsi]
+	mov	rbx,QWORD[40+rsi]
+	lea	rsp,[48+rsi]
+$L$mul_epilogue:
+	mov	rdi,QWORD[8+rsp]	;WIN64 epilogue
+	mov	rsi,QWORD[16+rsp]
+	DB	0F3h,0C3h		;repret
+$L$SEH_end_bn_mul_mont:
+
+ALIGN	16
+bn_mul4x_mont:
+	mov	QWORD[8+rsp],rdi	;WIN64 prologue
+	mov	QWORD[16+rsp],rsi
+	mov	rax,rsp
+$L$SEH_begin_bn_mul4x_mont:
+	mov	rdi,rcx
+	mov	rsi,rdx
+	mov	rdx,r8
+	mov	rcx,r9
+	mov	r8,QWORD[40+rsp]
+	mov	r9,QWORD[48+rsp]
+
+
+$L$mul4x_enter:
+	push	rbx
+	push	rbp
+	push	r12
+	push	r13
+	push	r14
+	push	r15
+
+	mov	r9d,r9d
+	lea	r10,[4+r9]
+	mov	r11,rsp
+	neg	r10
+	lea	rsp,[r10*8+rsp]
+	and	rsp,-1024
+
+	mov	QWORD[8+r9*8+rsp],r11
+$L$mul4x_body:
+	mov	QWORD[16+r9*8+rsp],rdi
+	mov	r12,rdx
+	mov	r8,QWORD[r8]
+	mov	rbx,QWORD[r12]
+	mov	rax,QWORD[rsi]
+
+	xor	r14,r14
+	xor	r15,r15
+
+	mov	rbp,r8
+	mul	rbx
+	mov	r10,rax
+	mov	rax,QWORD[rcx]
+
+	imul	rbp,r10
+	mov	r11,rdx
+
+	mul	rbp
+	add	r10,rax
+	mov	rax,QWORD[8+rsi]
+	adc	rdx,0
+	mov	rdi,rdx
+
+	mul	rbx
+	add	r11,rax
+	mov	rax,QWORD[8+rcx]
+	adc	rdx,0
+	mov	r10,rdx
+
+	mul	rbp
+	add	rdi,rax
+	mov	rax,QWORD[16+rsi]
+	adc	rdx,0
+	add	rdi,r11
+	lea	r15,[4+r15]
+	adc	rdx,0
+	mov	QWORD[rsp],rdi
+	mov	r13,rdx
+	jmp	NEAR $L$1st4x
+ALIGN	16
+$L$1st4x:
+	mul	rbx
+	add	r10,rax
+	mov	rax,QWORD[((-16))+r15*8+rcx]
+	adc	rdx,0
+	mov	r11,rdx
+
+	mul	rbp
+	add	r13,rax
+	mov	rax,QWORD[((-8))+r15*8+rsi]
+	adc	rdx,0
+	add	r13,r10
+	adc	rdx,0
+	mov	QWORD[((-24))+r15*8+rsp],r13
+	mov	rdi,rdx
+
+	mul	rbx
+	add	r11,rax
+	mov	rax,QWORD[((-8))+r15*8+rcx]
+	adc	rdx,0
+	mov	r10,rdx
+
+	mul	rbp
+	add	rdi,rax
+	mov	rax,QWORD[r15*8+rsi]
+	adc	rdx,0
+	add	rdi,r11
+	adc	rdx,0
+	mov	QWORD[((-16))+r15*8+rsp],rdi
+	mov	r13,rdx
+
+	mul	rbx
+	add	r10,rax
+	mov	rax,QWORD[r15*8+rcx]
+	adc	rdx,0
+	mov	r11,rdx
+
+	mul	rbp
+	add	r13,rax
+	mov	rax,QWORD[8+r15*8+rsi]
+	adc	rdx,0
+	add	r13,r10
+	adc	rdx,0
+	mov	QWORD[((-8))+r15*8+rsp],r13
+	mov	rdi,rdx
+
+	mul	rbx
+	add	r11,rax
+	mov	rax,QWORD[8+r15*8+rcx]
+	adc	rdx,0
+	lea	r15,[4+r15]
+	mov	r10,rdx
+
+	mul	rbp
+	add	rdi,rax
+	mov	rax,QWORD[((-16))+r15*8+rsi]
+	adc	rdx,0
+	add	rdi,r11
+	adc	rdx,0
+	mov	QWORD[((-32))+r15*8+rsp],rdi
+	mov	r13,rdx
+	cmp	r15,r9
+	jb	NEAR $L$1st4x
+
+	mul	rbx
+	add	r10,rax
+	mov	rax,QWORD[((-16))+r15*8+rcx]
+	adc	rdx,0
+	mov	r11,rdx
+
+	mul	rbp
+	add	r13,rax
+	mov	rax,QWORD[((-8))+r15*8+rsi]
+	adc	rdx,0
+	add	r13,r10
+	adc	rdx,0
+	mov	QWORD[((-24))+r15*8+rsp],r13
+	mov	rdi,rdx
+
+	mul	rbx
+	add	r11,rax
+	mov	rax,QWORD[((-8))+r15*8+rcx]
+	adc	rdx,0
+	mov	r10,rdx
+
+	mul	rbp
+	add	rdi,rax
+	mov	rax,QWORD[rsi]
+	adc	rdx,0
+	add	rdi,r11
+	adc	rdx,0
+	mov	QWORD[((-16))+r15*8+rsp],rdi
+	mov	r13,rdx
+
+	xor	rdi,rdi
+	add	r13,r10
+	adc	rdi,0
+	mov	QWORD[((-8))+r15*8+rsp],r13
+	mov	QWORD[r15*8+rsp],rdi
+
+	lea	r14,[1+r14]
+ALIGN	4
+$L$outer4x:
+	mov	rbx,QWORD[r14*8+r12]
+	xor	r15,r15
+	mov	r10,QWORD[rsp]
+	mov	rbp,r8
+	mul	rbx
+	add	r10,rax
+	mov	rax,QWORD[rcx]
+	adc	rdx,0
+
+	imul	rbp,r10
+	mov	r11,rdx
+
+	mul	rbp
+	add	r10,rax
+	mov	rax,QWORD[8+rsi]
+	adc	rdx,0
+	mov	rdi,rdx
+
+	mul	rbx
+	add	r11,rax
+	mov	rax,QWORD[8+rcx]
+	adc	rdx,0
+	add	r11,QWORD[8+rsp]
+	adc	rdx,0
+	mov	r10,rdx
+
+	mul	rbp
+	add	rdi,rax
+	mov	rax,QWORD[16+rsi]
+	adc	rdx,0
+	add	rdi,r11
+	lea	r15,[4+r15]
+	adc	rdx,0
+	mov	QWORD[rsp],rdi
+	mov	r13,rdx
+	jmp	NEAR $L$inner4x
+ALIGN	16
+$L$inner4x:
+	mul	rbx
+	add	r10,rax
+	mov	rax,QWORD[((-16))+r15*8+rcx]
+	adc	rdx,0
+	add	r10,QWORD[((-16))+r15*8+rsp]
+	adc	rdx,0
+	mov	r11,rdx
+
+	mul	rbp
+	add	r13,rax
+	mov	rax,QWORD[((-8))+r15*8+rsi]
+	adc	rdx,0
+	add	r13,r10
+	adc	rdx,0
+	mov	QWORD[((-24))+r15*8+rsp],r13
+	mov	rdi,rdx
+
+	mul	rbx
+	add	r11,rax
+	mov	rax,QWORD[((-8))+r15*8+rcx]
+	adc	rdx,0
+	add	r11,QWORD[((-8))+r15*8+rsp]
+	adc	rdx,0
+	mov	r10,rdx
+
+	mul	rbp
+	add	rdi,rax
+	mov	rax,QWORD[r15*8+rsi]
+	adc	rdx,0
+	add	rdi,r11
+	adc	rdx,0
+	mov	QWORD[((-16))+r15*8+rsp],rdi
+	mov	r13,rdx
+
+	mul	rbx
+	add	r10,rax
+	mov	rax,QWORD[r15*8+rcx]
+	adc	rdx,0
+	add	r10,QWORD[r15*8+rsp]
+	adc	rdx,0
+	mov	r11,rdx
+
+	mul	rbp
+	add	r13,rax
+	mov	rax,QWORD[8+r15*8+rsi]
+	adc	rdx,0
+	add	r13,r10
+	adc	rdx,0
+	mov	QWORD[((-8))+r15*8+rsp],r13
+	mov	rdi,rdx
+
+	mul	rbx
+	add	r11,rax
+	mov	rax,QWORD[8+r15*8+rcx]
+	adc	rdx,0
+	add	r11,QWORD[8+r15*8+rsp]
+	adc	rdx,0
+	lea	r15,[4+r15]
+	mov	r10,rdx
+
+	mul	rbp
+	add	rdi,rax
+	mov	rax,QWORD[((-16))+r15*8+rsi]
+	adc	rdx,0
+	add	rdi,r11
+	adc	rdx,0
+	mov	QWORD[((-32))+r15*8+rsp],rdi
+	mov	r13,rdx
+	cmp	r15,r9
+	jb	NEAR $L$inner4x
+
+	mul	rbx
+	add	r10,rax
+	mov	rax,QWORD[((-16))+r15*8+rcx]
+	adc	rdx,0
+	add	r10,QWORD[((-16))+r15*8+rsp]
+	adc	rdx,0
+	mov	r11,rdx
+
+	mul	rbp
+	add	r13,rax
+	mov	rax,QWORD[((-8))+r15*8+rsi]
+	adc	rdx,0
+	add	r13,r10
+	adc	rdx,0
+	mov	QWORD[((-24))+r15*8+rsp],r13
+	mov	rdi,rdx
+
+	mul	rbx
+	add	r11,rax
+	mov	rax,QWORD[((-8))+r15*8+rcx]
+	adc	rdx,0
+	add	r11,QWORD[((-8))+r15*8+rsp]
+	adc	rdx,0
+	lea	r14,[1+r14]
+	mov	r10,rdx
+
+	mul	rbp
+	add	rdi,rax
+	mov	rax,QWORD[rsi]
+	adc	rdx,0
+	add	rdi,r11
+	adc	rdx,0
+	mov	QWORD[((-16))+r15*8+rsp],rdi
+	mov	r13,rdx
+
+	xor	rdi,rdi
+	add	r13,r10
+	adc	rdi,0
+	add	r13,QWORD[r9*8+rsp]
+	adc	rdi,0
+	mov	QWORD[((-8))+r15*8+rsp],r13
+	mov	QWORD[r15*8+rsp],rdi
+
+	cmp	r14,r9
+	jb	NEAR $L$outer4x
+	mov	rdi,QWORD[16+r9*8+rsp]
+	mov	rax,QWORD[rsp]
+	mov	rdx,QWORD[8+rsp]
+	shr	r9,2
+	lea	rsi,[rsp]
+	xor	r14,r14
+
+	sub	rax,QWORD[rcx]
+	mov	rbx,QWORD[16+rsi]
+	mov	rbp,QWORD[24+rsi]
+	sbb	rdx,QWORD[8+rcx]
+	lea	r15,[((-1))+r9]
+	jmp	NEAR $L$sub4x
+ALIGN	16
+$L$sub4x:
+	mov	QWORD[r14*8+rdi],rax
+	mov	QWORD[8+r14*8+rdi],rdx
+	sbb	rbx,QWORD[16+r14*8+rcx]
+	mov	rax,QWORD[32+r14*8+rsi]
+	mov	rdx,QWORD[40+r14*8+rsi]
+	sbb	rbp,QWORD[24+r14*8+rcx]
+	mov	QWORD[16+r14*8+rdi],rbx
+	mov	QWORD[24+r14*8+rdi],rbp
+	sbb	rax,QWORD[32+r14*8+rcx]
+	mov	rbx,QWORD[48+r14*8+rsi]
+	mov	rbp,QWORD[56+r14*8+rsi]
+	sbb	rdx,QWORD[40+r14*8+rcx]
+	lea	r14,[4+r14]
+	dec	r15
+	jnz	NEAR $L$sub4x
+
+	mov	QWORD[r14*8+rdi],rax
+	mov	rax,QWORD[32+r14*8+rsi]
+	sbb	rbx,QWORD[16+r14*8+rcx]
+	mov	QWORD[8+r14*8+rdi],rdx
+	sbb	rbp,QWORD[24+r14*8+rcx]
+	mov	QWORD[16+r14*8+rdi],rbx
+
+	sbb	rax,0
+DB 66h, 48h, 0fh, 6eh, 0c0h
+	punpcklqdq	xmm0,xmm0
+	mov	QWORD[24+r14*8+rdi],rbp
+	xor	r14,r14
+
+	mov	r15,r9
+	pxor	xmm5,xmm5
+	jmp	NEAR $L$copy4x
+ALIGN	16
+$L$copy4x:
+	movdqu	xmm2,XMMWORD[r14*1+rsp]
+	movdqu	xmm4,XMMWORD[16+r14*1+rsp]
+	movdqu	xmm1,XMMWORD[r14*1+rdi]
+	movdqu	xmm3,XMMWORD[16+r14*1+rdi]
+	pxor	xmm2,xmm1
+	pxor	xmm4,xmm3
+	pand	xmm2,xmm0
+	pand	xmm4,xmm0
+	pxor	xmm2,xmm1
+	pxor	xmm4,xmm3
+	movdqu	XMMWORD[r14*1+rdi],xmm2
+	movdqu	XMMWORD[16+r14*1+rdi],xmm4
+	movdqa	XMMWORD[r14*1+rsp],xmm5
+	movdqa	XMMWORD[16+r14*1+rsp],xmm5
+
+	lea	r14,[32+r14]
+	dec	r15
+	jnz	NEAR $L$copy4x
+
+	shl	r9,2
+	mov	rsi,QWORD[8+r9*8+rsp]
+	mov	rax,1
+	mov	r15,QWORD[rsi]
+	mov	r14,QWORD[8+rsi]
+	mov	r13,QWORD[16+rsi]
+	mov	r12,QWORD[24+rsi]
+	mov	rbp,QWORD[32+rsi]
+	mov	rbx,QWORD[40+rsi]
+	lea	rsp,[48+rsi]
+$L$mul4x_epilogue:
+	mov	rdi,QWORD[8+rsp]	;WIN64 epilogue
+	mov	rsi,QWORD[16+rsp]
+	DB	0F3h,0C3h		;repret
+$L$SEH_end_bn_mul4x_mont:
+EXTERN	bn_sqr8x_internal
+
+
+ALIGN	32
+bn_sqr8x_mont:
+	mov	QWORD[8+rsp],rdi	;WIN64 prologue
+	mov	QWORD[16+rsp],rsi
+	mov	rax,rsp
+$L$SEH_begin_bn_sqr8x_mont:
+	mov	rdi,rcx
+	mov	rsi,rdx
+	mov	rdx,r8
+	mov	rcx,r9
+	mov	r8,QWORD[40+rsp]
+	mov	r9,QWORD[48+rsp]
+
+
+$L$sqr8x_enter:
+	mov	rax,rsp
+	push	rbx
+	push	rbp
+	push	r12
+	push	r13
+	push	r14
+	push	r15
+
+	mov	r10d,r9d
+	shl	r9d,3
+	shl	r10,3+2
+	neg	r9
+
+
+
+
+
+
+	lea	r11,[((-64))+r9*4+rsp]
+	mov	r8,QWORD[r8]
+	sub	r11,rsi
+	and	r11,4095
+	cmp	r10,r11
+	jb	NEAR $L$sqr8x_sp_alt
+	sub	rsp,r11
+	lea	rsp,[((-64))+r9*4+rsp]
+	jmp	NEAR $L$sqr8x_sp_done
+
+ALIGN	32
+$L$sqr8x_sp_alt:
+	lea	r10,[((4096-64))+r9*4]
+	lea	rsp,[((-64))+r9*4+rsp]
+	sub	r11,r10
+	mov	r10,0
+	cmovc	r11,r10
+	sub	rsp,r11
+$L$sqr8x_sp_done:
+	and	rsp,-64
+	mov	r10,r9
+	neg	r9
+
+	lea	r11,[64+r9*2+rsp]
+	mov	QWORD[32+rsp],r8
+	mov	QWORD[40+rsp],rax
+$L$sqr8x_body:
+
+	mov	rbp,r9
+DB	102,73,15,110,211
+	shr	rbp,3+2
+	mov	eax,DWORD[((OPENSSL_ia32cap_P+8))]
+	jmp	NEAR $L$sqr8x_copy_n
+
+ALIGN	32
+$L$sqr8x_copy_n:
+	movq	xmm0,QWORD[rcx]
+	movq	xmm1,QWORD[8+rcx]
+	movq	xmm3,QWORD[16+rcx]
+	movq	xmm4,QWORD[24+rcx]
+	lea	rcx,[32+rcx]
+	movdqa	XMMWORD[r11],xmm0
+	movdqa	XMMWORD[16+r11],xmm1
+	movdqa	XMMWORD[32+r11],xmm3
+	movdqa	XMMWORD[48+r11],xmm4
+	lea	r11,[64+r11]
+	dec	rbp
+	jnz	NEAR $L$sqr8x_copy_n
+
+	pxor	xmm0,xmm0
+DB	102,72,15,110,207
+DB	102,73,15,110,218
+	call	bn_sqr8x_internal
+
+	pxor	xmm0,xmm0
+	lea	rax,[48+rsp]
+	lea	rdx,[64+r9*2+rsp]
+	shr	r9,3+2
+	mov	rsi,QWORD[40+rsp]
+	jmp	NEAR $L$sqr8x_zero
+
+ALIGN	32
+$L$sqr8x_zero:
+	movdqa	XMMWORD[rax],xmm0
+	movdqa	XMMWORD[16+rax],xmm0
+	movdqa	XMMWORD[32+rax],xmm0
+	movdqa	XMMWORD[48+rax],xmm0
+	lea	rax,[64+rax]
+	movdqa	XMMWORD[rdx],xmm0
+	movdqa	XMMWORD[16+rdx],xmm0
+	movdqa	XMMWORD[32+rdx],xmm0
+	movdqa	XMMWORD[48+rdx],xmm0
+	lea	rdx,[64+rdx]
+	dec	r9
+	jnz	NEAR $L$sqr8x_zero
+
+	mov	rax,1
+	mov	r15,QWORD[((-48))+rsi]
+	mov	r14,QWORD[((-40))+rsi]
+	mov	r13,QWORD[((-32))+rsi]
+	mov	r12,QWORD[((-24))+rsi]
+	mov	rbp,QWORD[((-16))+rsi]
+	mov	rbx,QWORD[((-8))+rsi]
+	lea	rsp,[rsi]
+$L$sqr8x_epilogue:
+	mov	rdi,QWORD[8+rsp]	;WIN64 epilogue
+	mov	rsi,QWORD[16+rsp]
+	DB	0F3h,0C3h		;repret
+$L$SEH_end_bn_sqr8x_mont:
+DB	77,111,110,116,103,111,109,101,114,121,32,77,117,108,116,105
+DB	112,108,105,99,97,116,105,111,110,32,102,111,114,32,120,56
+DB	54,95,54,52,44,32,67,82,89,80,84,79,71,65,77,83
+DB	32,98,121,32,60,97,112,112,114,111,64,111,112,101,110,115
+DB	115,108,46,111,114,103,62,0
+ALIGN	16
+EXTERN	__imp_RtlVirtualUnwind
+
+ALIGN	16
+mul_handler:
+	push	rsi
+	push	rdi
+	push	rbx
+	push	rbp
+	push	r12
+	push	r13
+	push	r14
+	push	r15
+	pushfq
+	sub	rsp,64
+
+	mov	rax,QWORD[120+r8]
+	mov	rbx,QWORD[248+r8]
+
+	mov	rsi,QWORD[8+r9]
+	mov	r11,QWORD[56+r9]
+
+	mov	r10d,DWORD[r11]
+	lea	r10,[r10*1+rsi]
+	cmp	rbx,r10
+	jb	NEAR $L$common_seh_tail
+
+	mov	rax,QWORD[152+r8]
+
+	mov	r10d,DWORD[4+r11]
+	lea	r10,[r10*1+rsi]
+	cmp	rbx,r10
+	jae	NEAR $L$common_seh_tail
+
+	mov	r10,QWORD[192+r8]
+	mov	rax,QWORD[8+r10*8+rax]
+	lea	rax,[48+rax]
+
+	mov	rbx,QWORD[((-8))+rax]
+	mov	rbp,QWORD[((-16))+rax]
+	mov	r12,QWORD[((-24))+rax]
+	mov	r13,QWORD[((-32))+rax]
+	mov	r14,QWORD[((-40))+rax]
+	mov	r15,QWORD[((-48))+rax]
+	mov	QWORD[144+r8],rbx
+	mov	QWORD[160+r8],rbp
+	mov	QWORD[216+r8],r12
+	mov	QWORD[224+r8],r13
+	mov	QWORD[232+r8],r14
+	mov	QWORD[240+r8],r15
+
+	jmp	NEAR $L$common_seh_tail
+
+
+
+ALIGN	16
+sqr_handler:
+	push	rsi
+	push	rdi
+	push	rbx
+	push	rbp
+	push	r12
+	push	r13
+	push	r14
+	push	r15
+	pushfq
+	sub	rsp,64
+
+	mov	rax,QWORD[120+r8]
+	mov	rbx,QWORD[248+r8]
+
+	mov	rsi,QWORD[8+r9]
+	mov	r11,QWORD[56+r9]
+
+	mov	r10d,DWORD[r11]
+	lea	r10,[r10*1+rsi]
+	cmp	rbx,r10
+	jb	NEAR $L$common_seh_tail
+
+	mov	rax,QWORD[152+r8]
+
+	mov	r10d,DWORD[4+r11]
+	lea	r10,[r10*1+rsi]
+	cmp	rbx,r10
+	jae	NEAR $L$common_seh_tail
+
+	mov	rax,QWORD[40+rax]
+
+	mov	rbx,QWORD[((-8))+rax]
+	mov	rbp,QWORD[((-16))+rax]
+	mov	r12,QWORD[((-24))+rax]
+	mov	r13,QWORD[((-32))+rax]
+	mov	r14,QWORD[((-40))+rax]
+	mov	r15,QWORD[((-48))+rax]
+	mov	QWORD[144+r8],rbx
+	mov	QWORD[160+r8],rbp
+	mov	QWORD[216+r8],r12
+	mov	QWORD[224+r8],r13
+	mov	QWORD[232+r8],r14
+	mov	QWORD[240+r8],r15
+
+$L$common_seh_tail:
+	mov	rdi,QWORD[8+rax]
+	mov	rsi,QWORD[16+rax]
+	mov	QWORD[152+r8],rax
+	mov	QWORD[168+r8],rsi
+	mov	QWORD[176+r8],rdi
+
+	mov	rdi,QWORD[40+r9]
+	mov	rsi,r8
+	mov	ecx,154
+	DD	0xa548f3fc
+
+	mov	rsi,r9
+	xor	rcx,rcx
+	mov	rdx,QWORD[8+rsi]
+	mov	r8,QWORD[rsi]
+	mov	r9,QWORD[16+rsi]
+	mov	r10,QWORD[40+rsi]
+	lea	r11,[56+rsi]
+	lea	r12,[24+rsi]
+	mov	QWORD[32+rsp],r10
+	mov	QWORD[40+rsp],r11
+	mov	QWORD[48+rsp],r12
+	mov	QWORD[56+rsp],rcx
+	call	QWORD[__imp_RtlVirtualUnwind]
+
+	mov	eax,1
+	add	rsp,64
+	popfq
+	pop	r15
+	pop	r14
+	pop	r13
+	pop	r12
+	pop	rbp
+	pop	rbx
+	pop	rdi
+	pop	rsi
+	DB	0F3h,0C3h		;repret
+
+
+section	.pdata rdata align=4
+ALIGN	4
+	DD	$L$SEH_begin_bn_mul_mont wrt ..imagebase
+	DD	$L$SEH_end_bn_mul_mont wrt ..imagebase
+	DD	$L$SEH_info_bn_mul_mont wrt ..imagebase
+
+	DD	$L$SEH_begin_bn_mul4x_mont wrt ..imagebase
+	DD	$L$SEH_end_bn_mul4x_mont wrt ..imagebase
+	DD	$L$SEH_info_bn_mul4x_mont wrt ..imagebase
+
+	DD	$L$SEH_begin_bn_sqr8x_mont wrt ..imagebase
+	DD	$L$SEH_end_bn_sqr8x_mont wrt ..imagebase
+	DD	$L$SEH_info_bn_sqr8x_mont wrt ..imagebase
+section	.xdata rdata align=8
+ALIGN	8
+$L$SEH_info_bn_mul_mont:
+DB	9,0,0,0
+	DD	mul_handler wrt ..imagebase
+	DD	$L$mul_body wrt ..imagebase,$L$mul_epilogue wrt ..imagebase
+$L$SEH_info_bn_mul4x_mont:
+DB	9,0,0,0
+	DD	mul_handler wrt ..imagebase
+	DD	$L$mul4x_body wrt ..imagebase,$L$mul4x_epilogue wrt ..imagebase
+$L$SEH_info_bn_sqr8x_mont:
+DB	9,0,0,0
+	DD	sqr_handler wrt ..imagebase
+	DD	$L$sqr8x_body wrt ..imagebase,$L$sqr8x_epilogue wrt ..imagebase
diff --git a/third_party/boringssl/win-x86_64/crypto/bn/x86_64-mont5.asm b/third_party/boringssl/win-x86_64/crypto/bn/x86_64-mont5.asm
new file mode 100644
index 0000000..284318a
--- /dev/null
+++ b/third_party/boringssl/win-x86_64/crypto/bn/x86_64-mont5.asm
@@ -0,0 +1,2056 @@
+default	rel
+%define XMMWORD
+%define YMMWORD
+%define ZMMWORD
+section	.text code align=64
+
+
+EXTERN	OPENSSL_ia32cap_P
+
+global	bn_mul_mont_gather5
+
+ALIGN	64
+bn_mul_mont_gather5:
+	mov	QWORD[8+rsp],rdi	;WIN64 prologue
+	mov	QWORD[16+rsp],rsi
+	mov	rax,rsp
+$L$SEH_begin_bn_mul_mont_gather5:
+	mov	rdi,rcx
+	mov	rsi,rdx
+	mov	rdx,r8
+	mov	rcx,r9
+	mov	r8,QWORD[40+rsp]
+	mov	r9,QWORD[48+rsp]
+
+
+	test	r9d,7
+	jnz	NEAR $L$mul_enter
+	jmp	NEAR $L$mul4x_enter
+
+ALIGN	16
+$L$mul_enter:
+	mov	r9d,r9d
+	mov	rax,rsp
+	mov	r10d,DWORD[56+rsp]
+	push	rbx
+	push	rbp
+	push	r12
+	push	r13
+	push	r14
+	push	r15
+	lea	rsp,[((-40))+rsp]
+	movaps	XMMWORD[rsp],xmm6
+	movaps	XMMWORD[16+rsp],xmm7
+	lea	r11,[2+r9]
+	neg	r11
+	lea	rsp,[r11*8+rsp]
+	and	rsp,-1024
+
+	mov	QWORD[8+r9*8+rsp],rax
+$L$mul_body:
+	mov	r12,rdx
+	mov	r11,r10
+	shr	r10,3
+	and	r11,7
+	not	r10
+	lea	rax,[$L$magic_masks]
+	and	r10,3
+	lea	r12,[96+r11*8+r12]
+	movq	xmm4,QWORD[r10*8+rax]
+	movq	xmm5,QWORD[8+r10*8+rax]
+	movq	xmm6,QWORD[16+r10*8+rax]
+	movq	xmm7,QWORD[24+r10*8+rax]
+
+	movq	xmm0,QWORD[(((-96)))+r12]
+	movq	xmm1,QWORD[((-32))+r12]
+	pand	xmm0,xmm4
+	movq	xmm2,QWORD[32+r12]
+	pand	xmm1,xmm5
+	movq	xmm3,QWORD[96+r12]
+	pand	xmm2,xmm6
+	por	xmm0,xmm1
+	pand	xmm3,xmm7
+	por	xmm0,xmm2
+	lea	r12,[256+r12]
+	por	xmm0,xmm3
+
+DB	102,72,15,126,195
+
+	mov	r8,QWORD[r8]
+	mov	rax,QWORD[rsi]
+
+	xor	r14,r14
+	xor	r15,r15
+
+	movq	xmm0,QWORD[(((-96)))+r12]
+	movq	xmm1,QWORD[((-32))+r12]
+	pand	xmm0,xmm4
+	movq	xmm2,QWORD[32+r12]
+	pand	xmm1,xmm5
+
+	mov	rbp,r8
+	mul	rbx
+	mov	r10,rax
+	mov	rax,QWORD[rcx]
+
+	movq	xmm3,QWORD[96+r12]
+	pand	xmm2,xmm6
+	por	xmm0,xmm1
+	pand	xmm3,xmm7
+
+	imul	rbp,r10
+	mov	r11,rdx
+
+	por	xmm0,xmm2
+	lea	r12,[256+r12]
+	por	xmm0,xmm3
+
+	mul	rbp
+	add	r10,rax
+	mov	rax,QWORD[8+rsi]
+	adc	rdx,0
+	mov	r13,rdx
+
+	lea	r15,[1+r15]
+	jmp	NEAR $L$1st_enter
+
+ALIGN	16
+$L$1st:
+	add	r13,rax
+	mov	rax,QWORD[r15*8+rsi]
+	adc	rdx,0
+	add	r13,r11
+	mov	r11,r10
+	adc	rdx,0
+	mov	QWORD[((-16))+r15*8+rsp],r13
+	mov	r13,rdx
+
+$L$1st_enter:
+	mul	rbx
+	add	r11,rax
+	mov	rax,QWORD[r15*8+rcx]
+	adc	rdx,0
+	lea	r15,[1+r15]
+	mov	r10,rdx
+
+	mul	rbp
+	cmp	r15,r9
+	jne	NEAR $L$1st
+
+DB	102,72,15,126,195
+
+	add	r13,rax
+	mov	rax,QWORD[rsi]
+	adc	rdx,0
+	add	r13,r11
+	adc	rdx,0
+	mov	QWORD[((-16))+r15*8+rsp],r13
+	mov	r13,rdx
+	mov	r11,r10
+
+	xor	rdx,rdx
+	add	r13,r11
+	adc	rdx,0
+	mov	QWORD[((-8))+r9*8+rsp],r13
+	mov	QWORD[r9*8+rsp],rdx
+
+	lea	r14,[1+r14]
+	jmp	NEAR $L$outer
+ALIGN	16
+$L$outer:
+	xor	r15,r15
+	mov	rbp,r8
+	mov	r10,QWORD[rsp]
+
+	movq	xmm0,QWORD[(((-96)))+r12]
+	movq	xmm1,QWORD[((-32))+r12]
+	pand	xmm0,xmm4
+	movq	xmm2,QWORD[32+r12]
+	pand	xmm1,xmm5
+
+	mul	rbx
+	add	r10,rax
+	mov	rax,QWORD[rcx]
+	adc	rdx,0
+
+	movq	xmm3,QWORD[96+r12]
+	pand	xmm2,xmm6
+	por	xmm0,xmm1
+	pand	xmm3,xmm7
+
+	imul	rbp,r10
+	mov	r11,rdx
+
+	por	xmm0,xmm2
+	lea	r12,[256+r12]
+	por	xmm0,xmm3
+
+	mul	rbp
+	add	r10,rax
+	mov	rax,QWORD[8+rsi]
+	adc	rdx,0
+	mov	r10,QWORD[8+rsp]
+	mov	r13,rdx
+
+	lea	r15,[1+r15]
+	jmp	NEAR $L$inner_enter
+
+ALIGN	16
+$L$inner:
+	add	r13,rax
+	mov	rax,QWORD[r15*8+rsi]
+	adc	rdx,0
+	add	r13,r10
+	mov	r10,QWORD[r15*8+rsp]
+	adc	rdx,0
+	mov	QWORD[((-16))+r15*8+rsp],r13
+	mov	r13,rdx
+
+$L$inner_enter:
+	mul	rbx
+	add	r11,rax
+	mov	rax,QWORD[r15*8+rcx]
+	adc	rdx,0
+	add	r10,r11
+	mov	r11,rdx
+	adc	r11,0
+	lea	r15,[1+r15]
+
+	mul	rbp
+	cmp	r15,r9
+	jne	NEAR $L$inner
+
+DB	102,72,15,126,195
+
+	add	r13,rax
+	mov	rax,QWORD[rsi]
+	adc	rdx,0
+	add	r13,r10
+	mov	r10,QWORD[r15*8+rsp]
+	adc	rdx,0
+	mov	QWORD[((-16))+r15*8+rsp],r13
+	mov	r13,rdx
+
+	xor	rdx,rdx
+	add	r13,r11
+	adc	rdx,0
+	add	r13,r10
+	adc	rdx,0
+	mov	QWORD[((-8))+r9*8+rsp],r13
+	mov	QWORD[r9*8+rsp],rdx
+
+	lea	r14,[1+r14]
+	cmp	r14,r9
+	jb	NEAR $L$outer
+
+	xor	r14,r14
+	mov	rax,QWORD[rsp]
+	lea	rsi,[rsp]
+	mov	r15,r9
+	jmp	NEAR $L$sub
+ALIGN	16
+$L$sub:	sbb	rax,QWORD[r14*8+rcx]
+	mov	QWORD[r14*8+rdi],rax
+	mov	rax,QWORD[8+r14*8+rsi]
+	lea	r14,[1+r14]
+	dec	r15
+	jnz	NEAR $L$sub
+
+	sbb	rax,0
+	xor	r14,r14
+	mov	r15,r9
+ALIGN	16
+$L$copy:
+	mov	rsi,QWORD[r14*8+rsp]
+	mov	rcx,QWORD[r14*8+rdi]
+	xor	rsi,rcx
+	and	rsi,rax
+	xor	rsi,rcx
+	mov	QWORD[r14*8+rsp],r14
+	mov	QWORD[r14*8+rdi],rsi
+	lea	r14,[1+r14]
+	sub	r15,1
+	jnz	NEAR $L$copy
+
+	mov	rsi,QWORD[8+r9*8+rsp]
+	mov	rax,1
+	movaps	xmm6,XMMWORD[((-88))+rsi]
+	movaps	xmm7,XMMWORD[((-72))+rsi]
+	mov	r15,QWORD[((-48))+rsi]
+	mov	r14,QWORD[((-40))+rsi]
+	mov	r13,QWORD[((-32))+rsi]
+	mov	r12,QWORD[((-24))+rsi]
+	mov	rbp,QWORD[((-16))+rsi]
+	mov	rbx,QWORD[((-8))+rsi]
+	lea	rsp,[rsi]
+$L$mul_epilogue:
+	mov	rdi,QWORD[8+rsp]	;WIN64 epilogue
+	mov	rsi,QWORD[16+rsp]
+	DB	0F3h,0C3h		;repret
+$L$SEH_end_bn_mul_mont_gather5:
+
+ALIGN	32
+bn_mul4x_mont_gather5:
+	mov	QWORD[8+rsp],rdi	;WIN64 prologue
+	mov	QWORD[16+rsp],rsi
+	mov	rax,rsp
+$L$SEH_begin_bn_mul4x_mont_gather5:
+	mov	rdi,rcx
+	mov	rsi,rdx
+	mov	rdx,r8
+	mov	rcx,r9
+	mov	r8,QWORD[40+rsp]
+	mov	r9,QWORD[48+rsp]
+
+
+$L$mul4x_enter:
+DB	0x67
+	mov	rax,rsp
+	push	rbx
+	push	rbp
+	push	r12
+	push	r13
+	push	r14
+	push	r15
+	lea	rsp,[((-40))+rsp]
+	movaps	XMMWORD[rsp],xmm6
+	movaps	XMMWORD[16+rsp],xmm7
+DB	0x67
+	mov	r10d,r9d
+	shl	r9d,3
+	shl	r10d,3+2
+	neg	r9
+
+
+
+
+
+
+
+
+	lea	r11,[((-64))+r9*2+rsp]
+	sub	r11,rsi
+	and	r11,4095
+	cmp	r10,r11
+	jb	NEAR $L$mul4xsp_alt
+	sub	rsp,r11
+	lea	rsp,[((-64))+r9*2+rsp]
+	jmp	NEAR $L$mul4xsp_done
+
+ALIGN	32
+$L$mul4xsp_alt:
+	lea	r10,[((4096-64))+r9*2]
+	lea	rsp,[((-64))+r9*2+rsp]
+	sub	r11,r10
+	mov	r10,0
+	cmovc	r11,r10
+	sub	rsp,r11
+$L$mul4xsp_done:
+	and	rsp,-64
+	neg	r9
+
+	mov	QWORD[40+rsp],rax
+$L$mul4x_body:
+
+	call	mul4x_internal
+
+	mov	rsi,QWORD[40+rsp]
+	mov	rax,1
+	movaps	xmm6,XMMWORD[((-88))+rsi]
+	movaps	xmm7,XMMWORD[((-72))+rsi]
+	mov	r15,QWORD[((-48))+rsi]
+	mov	r14,QWORD[((-40))+rsi]
+	mov	r13,QWORD[((-32))+rsi]
+	mov	r12,QWORD[((-24))+rsi]
+	mov	rbp,QWORD[((-16))+rsi]
+	mov	rbx,QWORD[((-8))+rsi]
+	lea	rsp,[rsi]
+$L$mul4x_epilogue:
+	mov	rdi,QWORD[8+rsp]	;WIN64 epilogue
+	mov	rsi,QWORD[16+rsp]
+	DB	0F3h,0C3h		;repret
+$L$SEH_end_bn_mul4x_mont_gather5:
+
+
+ALIGN	32
+mul4x_internal:
+	shl	r9,5
+	mov	r10d,DWORD[56+rax]
+	lea	r13,[256+r9*1+rdx]
+	shr	r9,5
+	mov	r11,r10
+	shr	r10,3
+	and	r11,7
+	not	r10
+	lea	rax,[$L$magic_masks]
+	and	r10,3
+	lea	r12,[96+r11*8+rdx]
+	movq	xmm4,QWORD[r10*8+rax]
+	movq	xmm5,QWORD[8+r10*8+rax]
+	add	r11,7
+	movq	xmm6,QWORD[16+r10*8+rax]
+	movq	xmm7,QWORD[24+r10*8+rax]
+	and	r11,7
+
+	movq	xmm0,QWORD[(((-96)))+r12]
+	lea	r14,[256+r12]
+	movq	xmm1,QWORD[((-32))+r12]
+	pand	xmm0,xmm4
+	movq	xmm2,QWORD[32+r12]
+	pand	xmm1,xmm5
+	movq	xmm3,QWORD[96+r12]
+	pand	xmm2,xmm6
+DB	0x67
+	por	xmm0,xmm1
+	movq	xmm1,QWORD[((-96))+r14]
+DB	0x67
+	pand	xmm3,xmm7
+DB	0x67
+	por	xmm0,xmm2
+	movq	xmm2,QWORD[((-32))+r14]
+DB	0x67
+	pand	xmm1,xmm4
+DB	0x67
+	por	xmm0,xmm3
+	movq	xmm3,QWORD[32+r14]
+
+DB	102,72,15,126,195
+	movq	xmm0,QWORD[96+r14]
+	mov	QWORD[((16+8))+rsp],r13
+	mov	QWORD[((56+8))+rsp],rdi
+
+	mov	r8,QWORD[r8]
+	mov	rax,QWORD[rsi]
+	lea	rsi,[r9*1+rsi]
+	neg	r9
+
+	mov	rbp,r8
+	mul	rbx
+	mov	r10,rax
+	mov	rax,QWORD[rcx]
+
+	pand	xmm2,xmm5
+	pand	xmm3,xmm6
+	por	xmm1,xmm2
+
+	imul	rbp,r10
+
+
+
+
+
+
+
+	lea	r14,[((64+8))+r11*8+rsp]
+	mov	r11,rdx
+
+	pand	xmm0,xmm7
+	por	xmm1,xmm3
+	lea	r12,[512+r12]
+	por	xmm0,xmm1
+
+	mul	rbp
+	add	r10,rax
+	mov	rax,QWORD[8+r9*1+rsi]
+	adc	rdx,0
+	mov	rdi,rdx
+
+	mul	rbx
+	add	r11,rax
+	mov	rax,QWORD[16+rcx]
+	adc	rdx,0
+	mov	r10,rdx
+
+	mul	rbp
+	add	rdi,rax
+	mov	rax,QWORD[16+r9*1+rsi]
+	adc	rdx,0
+	add	rdi,r11
+	lea	r15,[32+r9]
+	lea	rcx,[64+rcx]
+	adc	rdx,0
+	mov	QWORD[r14],rdi
+	mov	r13,rdx
+	jmp	NEAR $L$1st4x
+
+ALIGN	32
+$L$1st4x:
+	mul	rbx
+	add	r10,rax
+	mov	rax,QWORD[((-32))+rcx]
+	lea	r14,[32+r14]
+	adc	rdx,0
+	mov	r11,rdx
+
+	mul	rbp
+	add	r13,rax
+	mov	rax,QWORD[((-8))+r15*1+rsi]
+	adc	rdx,0
+	add	r13,r10
+	adc	rdx,0
+	mov	QWORD[((-24))+r14],r13
+	mov	rdi,rdx
+
+	mul	rbx
+	add	r11,rax
+	mov	rax,QWORD[((-16))+rcx]
+	adc	rdx,0
+	mov	r10,rdx
+
+	mul	rbp
+	add	rdi,rax
+	mov	rax,QWORD[r15*1+rsi]
+	adc	rdx,0
+	add	rdi,r11
+	adc	rdx,0
+	mov	QWORD[((-16))+r14],rdi
+	mov	r13,rdx
+
+	mul	rbx
+	add	r10,rax
+	mov	rax,QWORD[rcx]
+	adc	rdx,0
+	mov	r11,rdx
+
+	mul	rbp
+	add	r13,rax
+	mov	rax,QWORD[8+r15*1+rsi]
+	adc	rdx,0
+	add	r13,r10
+	adc	rdx,0
+	mov	QWORD[((-8))+r14],r13
+	mov	rdi,rdx
+
+	mul	rbx
+	add	r11,rax
+	mov	rax,QWORD[16+rcx]
+	adc	rdx,0
+	mov	r10,rdx
+
+	mul	rbp
+	add	rdi,rax
+	mov	rax,QWORD[16+r15*1+rsi]
+	adc	rdx,0
+	add	rdi,r11
+	lea	rcx,[64+rcx]
+	adc	rdx,0
+	mov	QWORD[r14],rdi
+	mov	r13,rdx
+
+	add	r15,32
+	jnz	NEAR $L$1st4x
+
+	mul	rbx
+	add	r10,rax
+	mov	rax,QWORD[((-32))+rcx]
+	lea	r14,[32+r14]
+	adc	rdx,0
+	mov	r11,rdx
+
+	mul	rbp
+	add	r13,rax
+	mov	rax,QWORD[((-8))+rsi]
+	adc	rdx,0
+	add	r13,r10
+	adc	rdx,0
+	mov	QWORD[((-24))+r14],r13
+	mov	rdi,rdx
+
+	mul	rbx
+	add	r11,rax
+	mov	rax,QWORD[((-16))+rcx]
+	adc	rdx,0
+	mov	r10,rdx
+
+	mul	rbp
+	add	rdi,rax
+	mov	rax,QWORD[r9*1+rsi]
+	adc	rdx,0
+	add	rdi,r11
+	adc	rdx,0
+	mov	QWORD[((-16))+r14],rdi
+	mov	r13,rdx
+
+DB	102,72,15,126,195
+	lea	rcx,[r9*2+rcx]
+
+	xor	rdi,rdi
+	add	r13,r10
+	adc	rdi,0
+	mov	QWORD[((-8))+r14],r13
+
+	jmp	NEAR $L$outer4x
+
+ALIGN	32
+$L$outer4x:
+	mov	r10,QWORD[r9*1+r14]
+	mov	rbp,r8
+	mul	rbx
+	add	r10,rax
+	mov	rax,QWORD[rcx]
+	adc	rdx,0
+
+	movq	xmm0,QWORD[(((-96)))+r12]
+	movq	xmm1,QWORD[((-32))+r12]
+	pand	xmm0,xmm4
+	movq	xmm2,QWORD[32+r12]
+	pand	xmm1,xmm5
+	movq	xmm3,QWORD[96+r12]
+
+	imul	rbp,r10
+DB	0x67
+	mov	r11,rdx
+	mov	QWORD[r14],rdi
+
+	pand	xmm2,xmm6
+	por	xmm0,xmm1
+	pand	xmm3,xmm7
+	por	xmm0,xmm2
+	lea	r14,[r9*1+r14]
+	lea	r12,[256+r12]
+	por	xmm0,xmm3
+
+	mul	rbp
+	add	r10,rax
+	mov	rax,QWORD[8+r9*1+rsi]
+	adc	rdx,0
+	mov	rdi,rdx
+
+	mul	rbx
+	add	r11,rax
+	mov	rax,QWORD[16+rcx]
+	adc	rdx,0
+	add	r11,QWORD[8+r14]
+	adc	rdx,0
+	mov	r10,rdx
+
+	mul	rbp
+	add	rdi,rax
+	mov	rax,QWORD[16+r9*1+rsi]
+	adc	rdx,0
+	add	rdi,r11
+	lea	r15,[32+r9]
+	lea	rcx,[64+rcx]
+	adc	rdx,0
+	mov	r13,rdx
+	jmp	NEAR $L$inner4x
+
+ALIGN	32
+$L$inner4x:
+	mul	rbx
+	add	r10,rax
+	mov	rax,QWORD[((-32))+rcx]
+	adc	rdx,0
+	add	r10,QWORD[16+r14]
+	lea	r14,[32+r14]
+	adc	rdx,0
+	mov	r11,rdx
+
+	mul	rbp
+	add	r13,rax
+	mov	rax,QWORD[((-8))+r15*1+rsi]
+	adc	rdx,0
+	add	r13,r10
+	adc	rdx,0
+	mov	QWORD[((-32))+r14],rdi
+	mov	rdi,rdx
+
+	mul	rbx
+	add	r11,rax
+	mov	rax,QWORD[((-16))+rcx]
+	adc	rdx,0
+	add	r11,QWORD[((-8))+r14]
+	adc	rdx,0
+	mov	r10,rdx
+
+	mul	rbp
+	add	rdi,rax
+	mov	rax,QWORD[r15*1+rsi]
+	adc	rdx,0
+	add	rdi,r11
+	adc	rdx,0
+	mov	QWORD[((-24))+r14],r13
+	mov	r13,rdx
+
+	mul	rbx
+	add	r10,rax
+	mov	rax,QWORD[rcx]
+	adc	rdx,0
+	add	r10,QWORD[r14]
+	adc	rdx,0
+	mov	r11,rdx
+
+	mul	rbp
+	add	r13,rax
+	mov	rax,QWORD[8+r15*1+rsi]
+	adc	rdx,0
+	add	r13,r10
+	adc	rdx,0
+	mov	QWORD[((-16))+r14],rdi
+	mov	rdi,rdx
+
+	mul	rbx
+	add	r11,rax
+	mov	rax,QWORD[16+rcx]
+	adc	rdx,0
+	add	r11,QWORD[8+r14]
+	adc	rdx,0
+	mov	r10,rdx
+
+	mul	rbp
+	add	rdi,rax
+	mov	rax,QWORD[16+r15*1+rsi]
+	adc	rdx,0
+	add	rdi,r11
+	lea	rcx,[64+rcx]
+	adc	rdx,0
+	mov	QWORD[((-8))+r14],r13
+	mov	r13,rdx
+
+	add	r15,32
+	jnz	NEAR $L$inner4x
+
+	mul	rbx
+	add	r10,rax
+	mov	rax,QWORD[((-32))+rcx]
+	adc	rdx,0
+	add	r10,QWORD[16+r14]
+	lea	r14,[32+r14]
+	adc	rdx,0
+	mov	r11,rdx
+
+	mul	rbp
+	add	r13,rax
+	mov	rax,QWORD[((-8))+rsi]
+	adc	rdx,0
+	add	r13,r10
+	adc	rdx,0
+	mov	QWORD[((-32))+r14],rdi
+	mov	rdi,rdx
+
+	mul	rbx
+	add	r11,rax
+	mov	rax,rbp
+	mov	rbp,QWORD[((-16))+rcx]
+	adc	rdx,0
+	add	r11,QWORD[((-8))+r14]
+	adc	rdx,0
+	mov	r10,rdx
+
+	mul	rbp
+	add	rdi,rax
+	mov	rax,QWORD[r9*1+rsi]
+	adc	rdx,0
+	add	rdi,r11
+	adc	rdx,0
+	mov	QWORD[((-24))+r14],r13
+	mov	r13,rdx
+
+DB	102,72,15,126,195
+	mov	QWORD[((-16))+r14],rdi
+	lea	rcx,[r9*2+rcx]
+
+	xor	rdi,rdi
+	add	r13,r10
+	adc	rdi,0
+	add	r13,QWORD[r14]
+	adc	rdi,0
+	mov	QWORD[((-8))+r14],r13
+
+	cmp	r12,QWORD[((16+8))+rsp]
+	jb	NEAR $L$outer4x
+	sub	rbp,r13
+	adc	r15,r15
+	or	rdi,r15
+	xor	rdi,1
+	lea	rbx,[r9*1+r14]
+	lea	rbp,[rdi*8+rcx]
+	mov	rcx,r9
+	sar	rcx,3+2
+	mov	rdi,QWORD[((56+8))+rsp]
+	jmp	NEAR $L$sqr4x_sub
+
+global	bn_power5
+
+ALIGN	32
+bn_power5:
+	mov	QWORD[8+rsp],rdi	;WIN64 prologue
+	mov	QWORD[16+rsp],rsi
+	mov	rax,rsp
+$L$SEH_begin_bn_power5:
+	mov	rdi,rcx
+	mov	rsi,rdx
+	mov	rdx,r8
+	mov	rcx,r9
+	mov	r8,QWORD[40+rsp]
+	mov	r9,QWORD[48+rsp]
+
+
+	mov	rax,rsp
+	push	rbx
+	push	rbp
+	push	r12
+	push	r13
+	push	r14
+	push	r15
+	lea	rsp,[((-40))+rsp]
+	movaps	XMMWORD[rsp],xmm6
+	movaps	XMMWORD[16+rsp],xmm7
+	mov	r10d,r9d
+	shl	r9d,3
+	shl	r10d,3+2
+	neg	r9
+	mov	r8,QWORD[r8]
+
+
+
+
+
+
+
+	lea	r11,[((-64))+r9*2+rsp]
+	sub	r11,rsi
+	and	r11,4095
+	cmp	r10,r11
+	jb	NEAR $L$pwr_sp_alt
+	sub	rsp,r11
+	lea	rsp,[((-64))+r9*2+rsp]
+	jmp	NEAR $L$pwr_sp_done
+
+ALIGN	32
+$L$pwr_sp_alt:
+	lea	r10,[((4096-64))+r9*2]
+	lea	rsp,[((-64))+r9*2+rsp]
+	sub	r11,r10
+	mov	r10,0
+	cmovc	r11,r10
+	sub	rsp,r11
+$L$pwr_sp_done:
+	and	rsp,-64
+	mov	r10,r9
+	neg	r9
+
+
+
+
+
+
+
+
+
+
+	mov	QWORD[32+rsp],r8
+	mov	QWORD[40+rsp],rax
+$L$power5_body:
+DB	102,72,15,110,207
+DB	102,72,15,110,209
+DB	102,73,15,110,218
+DB	102,72,15,110,226
+
+	call	__bn_sqr8x_internal
+	call	__bn_sqr8x_internal
+	call	__bn_sqr8x_internal
+	call	__bn_sqr8x_internal
+	call	__bn_sqr8x_internal
+
+DB	102,72,15,126,209
+DB	102,72,15,126,226
+	mov	rdi,rsi
+	mov	rax,QWORD[40+rsp]
+	lea	r8,[32+rsp]
+
+	call	mul4x_internal
+
+	mov	rsi,QWORD[40+rsp]
+	mov	rax,1
+	mov	r15,QWORD[((-48))+rsi]
+	mov	r14,QWORD[((-40))+rsi]
+	mov	r13,QWORD[((-32))+rsi]
+	mov	r12,QWORD[((-24))+rsi]
+	mov	rbp,QWORD[((-16))+rsi]
+	mov	rbx,QWORD[((-8))+rsi]
+	lea	rsp,[rsi]
+$L$power5_epilogue:
+	mov	rdi,QWORD[8+rsp]	;WIN64 epilogue
+	mov	rsi,QWORD[16+rsp]
+	DB	0F3h,0C3h		;repret
+$L$SEH_end_bn_power5:
+
+global	bn_sqr8x_internal
+
+
+ALIGN	32
+bn_sqr8x_internal:
+__bn_sqr8x_internal:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+	lea	rbp,[32+r10]
+	lea	rsi,[r9*1+rsi]
+
+	mov	rcx,r9
+
+
+	mov	r14,QWORD[((-32))+rbp*1+rsi]
+	lea	rdi,[((48+8))+r9*2+rsp]
+	mov	rax,QWORD[((-24))+rbp*1+rsi]
+	lea	rdi,[((-32))+rbp*1+rdi]
+	mov	rbx,QWORD[((-16))+rbp*1+rsi]
+	mov	r15,rax
+
+	mul	r14
+	mov	r10,rax
+	mov	rax,rbx
+	mov	r11,rdx
+	mov	QWORD[((-24))+rbp*1+rdi],r10
+
+	mul	r14
+	add	r11,rax
+	mov	rax,rbx
+	adc	rdx,0
+	mov	QWORD[((-16))+rbp*1+rdi],r11
+	mov	r10,rdx
+
+
+	mov	rbx,QWORD[((-8))+rbp*1+rsi]
+	mul	r15
+	mov	r12,rax
+	mov	rax,rbx
+	mov	r13,rdx
+
+	lea	rcx,[rbp]
+	mul	r14
+	add	r10,rax
+	mov	rax,rbx
+	mov	r11,rdx
+	adc	r11,0
+	add	r10,r12
+	adc	r11,0
+	mov	QWORD[((-8))+rcx*1+rdi],r10
+	jmp	NEAR $L$sqr4x_1st
+
+ALIGN	32
+$L$sqr4x_1st:
+	mov	rbx,QWORD[rcx*1+rsi]
+	mul	r15
+	add	r13,rax
+	mov	rax,rbx
+	mov	r12,rdx
+	adc	r12,0
+
+	mul	r14
+	add	r11,rax
+	mov	rax,rbx
+	mov	rbx,QWORD[8+rcx*1+rsi]
+	mov	r10,rdx
+	adc	r10,0
+	add	r11,r13
+	adc	r10,0
+
+
+	mul	r15
+	add	r12,rax
+	mov	rax,rbx
+	mov	QWORD[rcx*1+rdi],r11
+	mov	r13,rdx
+	adc	r13,0
+
+	mul	r14
+	add	r10,rax
+	mov	rax,rbx
+	mov	rbx,QWORD[16+rcx*1+rsi]
+	mov	r11,rdx
+	adc	r11,0
+	add	r10,r12
+	adc	r11,0
+
+	mul	r15
+	add	r13,rax
+	mov	rax,rbx
+	mov	QWORD[8+rcx*1+rdi],r10
+	mov	r12,rdx
+	adc	r12,0
+
+	mul	r14
+	add	r11,rax
+	mov	rax,rbx
+	mov	rbx,QWORD[24+rcx*1+rsi]
+	mov	r10,rdx
+	adc	r10,0
+	add	r11,r13
+	adc	r10,0
+
+
+	mul	r15
+	add	r12,rax
+	mov	rax,rbx
+	mov	QWORD[16+rcx*1+rdi],r11
+	mov	r13,rdx
+	adc	r13,0
+	lea	rcx,[32+rcx]
+
+	mul	r14
+	add	r10,rax
+	mov	rax,rbx
+	mov	r11,rdx
+	adc	r11,0
+	add	r10,r12
+	adc	r11,0
+	mov	QWORD[((-8))+rcx*1+rdi],r10
+
+	cmp	rcx,0
+	jne	NEAR $L$sqr4x_1st
+
+	mul	r15
+	add	r13,rax
+	lea	rbp,[16+rbp]
+	adc	rdx,0
+	add	r13,r11
+	adc	rdx,0
+
+	mov	QWORD[rdi],r13
+	mov	r12,rdx
+	mov	QWORD[8+rdi],rdx
+	jmp	NEAR $L$sqr4x_outer
+
+ALIGN	32
+$L$sqr4x_outer:
+	mov	r14,QWORD[((-32))+rbp*1+rsi]
+	lea	rdi,[((48+8))+r9*2+rsp]
+	mov	rax,QWORD[((-24))+rbp*1+rsi]
+	lea	rdi,[((-32))+rbp*1+rdi]
+	mov	rbx,QWORD[((-16))+rbp*1+rsi]
+	mov	r15,rax
+
+	mul	r14
+	mov	r10,QWORD[((-24))+rbp*1+rdi]
+	add	r10,rax
+	mov	rax,rbx
+	adc	rdx,0
+	mov	QWORD[((-24))+rbp*1+rdi],r10
+	mov	r11,rdx
+
+	mul	r14
+	add	r11,rax
+	mov	rax,rbx
+	adc	rdx,0
+	add	r11,QWORD[((-16))+rbp*1+rdi]
+	mov	r10,rdx
+	adc	r10,0
+	mov	QWORD[((-16))+rbp*1+rdi],r11
+
+	xor	r12,r12
+
+	mov	rbx,QWORD[((-8))+rbp*1+rsi]
+	mul	r15
+	add	r12,rax
+	mov	rax,rbx
+	adc	rdx,0
+	add	r12,QWORD[((-8))+rbp*1+rdi]
+	mov	r13,rdx
+	adc	r13,0
+
+	mul	r14
+	add	r10,rax
+	mov	rax,rbx
+	adc	rdx,0
+	add	r10,r12
+	mov	r11,rdx
+	adc	r11,0
+	mov	QWORD[((-8))+rbp*1+rdi],r10
+
+	lea	rcx,[rbp]
+	jmp	NEAR $L$sqr4x_inner
+
+ALIGN	32
+$L$sqr4x_inner:
+	mov	rbx,QWORD[rcx*1+rsi]
+	mul	r15
+	add	r13,rax
+	mov	rax,rbx
+	mov	r12,rdx
+	adc	r12,0
+	add	r13,QWORD[rcx*1+rdi]
+	adc	r12,0
+
+DB	0x67
+	mul	r14
+	add	r11,rax
+	mov	rax,rbx
+	mov	rbx,QWORD[8+rcx*1+rsi]
+	mov	r10,rdx
+	adc	r10,0
+	add	r11,r13
+	adc	r10,0
+
+	mul	r15
+	add	r12,rax
+	mov	QWORD[rcx*1+rdi],r11
+	mov	rax,rbx
+	mov	r13,rdx
+	adc	r13,0
+	add	r12,QWORD[8+rcx*1+rdi]
+	lea	rcx,[16+rcx]
+	adc	r13,0
+
+	mul	r14
+	add	r10,rax
+	mov	rax,rbx
+	adc	rdx,0
+	add	r10,r12
+	mov	r11,rdx
+	adc	r11,0
+	mov	QWORD[((-8))+rcx*1+rdi],r10
+
+	cmp	rcx,0
+	jne	NEAR $L$sqr4x_inner
+
+DB	0x67
+	mul	r15
+	add	r13,rax
+	adc	rdx,0
+	add	r13,r11
+	adc	rdx,0
+
+	mov	QWORD[rdi],r13
+	mov	r12,rdx
+	mov	QWORD[8+rdi],rdx
+
+	add	rbp,16
+	jnz	NEAR $L$sqr4x_outer
+
+
+	mov	r14,QWORD[((-32))+rsi]
+	lea	rdi,[((48+8))+r9*2+rsp]
+	mov	rax,QWORD[((-24))+rsi]
+	lea	rdi,[((-32))+rbp*1+rdi]
+	mov	rbx,QWORD[((-16))+rsi]
+	mov	r15,rax
+
+	mul	r14
+	add	r10,rax
+	mov	rax,rbx
+	mov	r11,rdx
+	adc	r11,0
+
+	mul	r14
+	add	r11,rax
+	mov	rax,rbx
+	mov	QWORD[((-24))+rdi],r10
+	mov	r10,rdx
+	adc	r10,0
+	add	r11,r13
+	mov	rbx,QWORD[((-8))+rsi]
+	adc	r10,0
+
+	mul	r15
+	add	r12,rax
+	mov	rax,rbx
+	mov	QWORD[((-16))+rdi],r11
+	mov	r13,rdx
+	adc	r13,0
+
+	mul	r14
+	add	r10,rax
+	mov	rax,rbx
+	mov	r11,rdx
+	adc	r11,0
+	add	r10,r12
+	adc	r11,0
+	mov	QWORD[((-8))+rdi],r10
+
+	mul	r15
+	add	r13,rax
+	mov	rax,QWORD[((-16))+rsi]
+	adc	rdx,0
+	add	r13,r11
+	adc	rdx,0
+
+	mov	QWORD[rdi],r13
+	mov	r12,rdx
+	mov	QWORD[8+rdi],rdx
+
+	mul	rbx
+	add	rbp,16
+	xor	r14,r14
+	sub	rbp,r9
+	xor	r15,r15
+
+	add	rax,r12
+	adc	rdx,0
+	mov	QWORD[8+rdi],rax
+	mov	QWORD[16+rdi],rdx
+	mov	QWORD[24+rdi],r15
+
+	mov	rax,QWORD[((-16))+rbp*1+rsi]
+	lea	rdi,[((48+8))+rsp]
+	xor	r10,r10
+	mov	r11,QWORD[8+rdi]
+
+	lea	r12,[r10*2+r14]
+	shr	r10,63
+	lea	r13,[r11*2+rcx]
+	shr	r11,63
+	or	r13,r10
+	mov	r10,QWORD[16+rdi]
+	mov	r14,r11
+	mul	rax
+	neg	r15
+	mov	r11,QWORD[24+rdi]
+	adc	r12,rax
+	mov	rax,QWORD[((-8))+rbp*1+rsi]
+	mov	QWORD[rdi],r12
+	adc	r13,rdx
+
+	lea	rbx,[r10*2+r14]
+	mov	QWORD[8+rdi],r13
+	sbb	r15,r15
+	shr	r10,63
+	lea	r8,[r11*2+rcx]
+	shr	r11,63
+	or	r8,r10
+	mov	r10,QWORD[32+rdi]
+	mov	r14,r11
+	mul	rax
+	neg	r15
+	mov	r11,QWORD[40+rdi]
+	adc	rbx,rax
+	mov	rax,QWORD[rbp*1+rsi]
+	mov	QWORD[16+rdi],rbx
+	adc	r8,rdx
+	lea	rbp,[16+rbp]
+	mov	QWORD[24+rdi],r8
+	sbb	r15,r15
+	lea	rdi,[64+rdi]
+	jmp	NEAR $L$sqr4x_shift_n_add
+
+ALIGN	32
+$L$sqr4x_shift_n_add:
+	lea	r12,[r10*2+r14]
+	shr	r10,63
+	lea	r13,[r11*2+rcx]
+	shr	r11,63
+	or	r13,r10
+	mov	r10,QWORD[((-16))+rdi]
+	mov	r14,r11
+	mul	rax
+	neg	r15
+	mov	r11,QWORD[((-8))+rdi]
+	adc	r12,rax
+	mov	rax,QWORD[((-8))+rbp*1+rsi]
+	mov	QWORD[((-32))+rdi],r12
+	adc	r13,rdx
+
+	lea	rbx,[r10*2+r14]
+	mov	QWORD[((-24))+rdi],r13
+	sbb	r15,r15
+	shr	r10,63
+	lea	r8,[r11*2+rcx]
+	shr	r11,63
+	or	r8,r10
+	mov	r10,QWORD[rdi]
+	mov	r14,r11
+	mul	rax
+	neg	r15
+	mov	r11,QWORD[8+rdi]
+	adc	rbx,rax
+	mov	rax,QWORD[rbp*1+rsi]
+	mov	QWORD[((-16))+rdi],rbx
+	adc	r8,rdx
+
+	lea	r12,[r10*2+r14]
+	mov	QWORD[((-8))+rdi],r8
+	sbb	r15,r15
+	shr	r10,63
+	lea	r13,[r11*2+rcx]
+	shr	r11,63
+	or	r13,r10
+	mov	r10,QWORD[16+rdi]
+	mov	r14,r11
+	mul	rax
+	neg	r15
+	mov	r11,QWORD[24+rdi]
+	adc	r12,rax
+	mov	rax,QWORD[8+rbp*1+rsi]
+	mov	QWORD[rdi],r12
+	adc	r13,rdx
+
+	lea	rbx,[r10*2+r14]
+	mov	QWORD[8+rdi],r13
+	sbb	r15,r15
+	shr	r10,63
+	lea	r8,[r11*2+rcx]
+	shr	r11,63
+	or	r8,r10
+	mov	r10,QWORD[32+rdi]
+	mov	r14,r11
+	mul	rax
+	neg	r15
+	mov	r11,QWORD[40+rdi]
+	adc	rbx,rax
+	mov	rax,QWORD[16+rbp*1+rsi]
+	mov	QWORD[16+rdi],rbx
+	adc	r8,rdx
+	mov	QWORD[24+rdi],r8
+	sbb	r15,r15
+	lea	rdi,[64+rdi]
+	add	rbp,32
+	jnz	NEAR $L$sqr4x_shift_n_add
+
+	lea	r12,[r10*2+r14]
+DB	0x67
+	shr	r10,63
+	lea	r13,[r11*2+rcx]
+	shr	r11,63
+	or	r13,r10
+	mov	r10,QWORD[((-16))+rdi]
+	mov	r14,r11
+	mul	rax
+	neg	r15
+	mov	r11,QWORD[((-8))+rdi]
+	adc	r12,rax
+	mov	rax,QWORD[((-8))+rsi]
+	mov	QWORD[((-32))+rdi],r12
+	adc	r13,rdx
+
+	lea	rbx,[r10*2+r14]
+	mov	QWORD[((-24))+rdi],r13
+	sbb	r15,r15
+	shr	r10,63
+	lea	r8,[r11*2+rcx]
+	shr	r11,63
+	or	r8,r10
+	mul	rax
+	neg	r15
+	adc	rbx,rax
+	adc	r8,rdx
+	mov	QWORD[((-16))+rdi],rbx
+	mov	QWORD[((-8))+rdi],r8
+DB	102,72,15,126,213
+sqr8x_reduction:
+	xor	rax,rax
+	lea	rcx,[r9*2+rbp]
+	lea	rdx,[((48+8))+r9*2+rsp]
+	mov	QWORD[((0+8))+rsp],rcx
+	lea	rdi,[((48+8))+r9*1+rsp]
+	mov	QWORD[((8+8))+rsp],rdx
+	neg	r9
+	jmp	NEAR $L$8x_reduction_loop
+
+ALIGN	32
+$L$8x_reduction_loop:
+	lea	rdi,[r9*1+rdi]
+DB	0x66
+	mov	rbx,QWORD[rdi]
+	mov	r9,QWORD[8+rdi]
+	mov	r10,QWORD[16+rdi]
+	mov	r11,QWORD[24+rdi]
+	mov	r12,QWORD[32+rdi]
+	mov	r13,QWORD[40+rdi]
+	mov	r14,QWORD[48+rdi]
+	mov	r15,QWORD[56+rdi]
+	mov	QWORD[rdx],rax
+	lea	rdi,[64+rdi]
+
+DB	0x67
+	mov	r8,rbx
+	imul	rbx,QWORD[((32+8))+rsp]
+	mov	rax,QWORD[rbp]
+	mov	ecx,8
+	jmp	NEAR $L$8x_reduce
+
+ALIGN	32
+$L$8x_reduce:
+	mul	rbx
+	mov	rax,QWORD[16+rbp]
+	neg	r8
+	mov	r8,rdx
+	adc	r8,0
+
+	mul	rbx
+	add	r9,rax
+	mov	rax,QWORD[32+rbp]
+	adc	rdx,0
+	add	r8,r9
+	mov	QWORD[((48-8+8))+rcx*8+rsp],rbx
+	mov	r9,rdx
+	adc	r9,0
+
+	mul	rbx
+	add	r10,rax
+	mov	rax,QWORD[48+rbp]
+	adc	rdx,0
+	add	r9,r10
+	mov	rsi,QWORD[((32+8))+rsp]
+	mov	r10,rdx
+	adc	r10,0
+
+	mul	rbx
+	add	r11,rax
+	mov	rax,QWORD[64+rbp]
+	adc	rdx,0
+	imul	rsi,r8
+	add	r10,r11
+	mov	r11,rdx
+	adc	r11,0
+
+	mul	rbx
+	add	r12,rax
+	mov	rax,QWORD[80+rbp]
+	adc	rdx,0
+	add	r11,r12
+	mov	r12,rdx
+	adc	r12,0
+
+	mul	rbx
+	add	r13,rax
+	mov	rax,QWORD[96+rbp]
+	adc	rdx,0
+	add	r12,r13
+	mov	r13,rdx
+	adc	r13,0
+
+	mul	rbx
+	add	r14,rax
+	mov	rax,QWORD[112+rbp]
+	adc	rdx,0
+	add	r13,r14
+	mov	r14,rdx
+	adc	r14,0
+
+	mul	rbx
+	mov	rbx,rsi
+	add	r15,rax
+	mov	rax,QWORD[rbp]
+	adc	rdx,0
+	add	r14,r15
+	mov	r15,rdx
+	adc	r15,0
+
+	dec	ecx
+	jnz	NEAR $L$8x_reduce
+
+	lea	rbp,[128+rbp]
+	xor	rax,rax
+	mov	rdx,QWORD[((8+8))+rsp]
+	cmp	rbp,QWORD[((0+8))+rsp]
+	jae	NEAR $L$8x_no_tail
+
+DB	0x66
+	add	r8,QWORD[rdi]
+	adc	r9,QWORD[8+rdi]
+	adc	r10,QWORD[16+rdi]
+	adc	r11,QWORD[24+rdi]
+	adc	r12,QWORD[32+rdi]
+	adc	r13,QWORD[40+rdi]
+	adc	r14,QWORD[48+rdi]
+	adc	r15,QWORD[56+rdi]
+	sbb	rsi,rsi
+
+	mov	rbx,QWORD[((48+56+8))+rsp]
+	mov	ecx,8
+	mov	rax,QWORD[rbp]
+	jmp	NEAR $L$8x_tail
+
+ALIGN	32
+$L$8x_tail:
+	mul	rbx
+	add	r8,rax
+	mov	rax,QWORD[16+rbp]
+	mov	QWORD[rdi],r8
+	mov	r8,rdx
+	adc	r8,0
+
+	mul	rbx
+	add	r9,rax
+	mov	rax,QWORD[32+rbp]
+	adc	rdx,0
+	add	r8,r9
+	lea	rdi,[8+rdi]
+	mov	r9,rdx
+	adc	r9,0
+
+	mul	rbx
+	add	r10,rax
+	mov	rax,QWORD[48+rbp]
+	adc	rdx,0
+	add	r9,r10
+	mov	r10,rdx
+	adc	r10,0
+
+	mul	rbx
+	add	r11,rax
+	mov	rax,QWORD[64+rbp]
+	adc	rdx,0
+	add	r10,r11
+	mov	r11,rdx
+	adc	r11,0
+
+	mul	rbx
+	add	r12,rax
+	mov	rax,QWORD[80+rbp]
+	adc	rdx,0
+	add	r11,r12
+	mov	r12,rdx
+	adc	r12,0
+
+	mul	rbx
+	add	r13,rax
+	mov	rax,QWORD[96+rbp]
+	adc	rdx,0
+	add	r12,r13
+	mov	r13,rdx
+	adc	r13,0
+
+	mul	rbx
+	add	r14,rax
+	mov	rax,QWORD[112+rbp]
+	adc	rdx,0
+	add	r13,r14
+	mov	r14,rdx
+	adc	r14,0
+
+	mul	rbx
+	mov	rbx,QWORD[((48-16+8))+rcx*8+rsp]
+	add	r15,rax
+	adc	rdx,0
+	add	r14,r15
+	mov	rax,QWORD[rbp]
+	mov	r15,rdx
+	adc	r15,0
+
+	dec	ecx
+	jnz	NEAR $L$8x_tail
+
+	lea	rbp,[128+rbp]
+	mov	rdx,QWORD[((8+8))+rsp]
+	cmp	rbp,QWORD[((0+8))+rsp]
+	jae	NEAR $L$8x_tail_done
+
+	mov	rbx,QWORD[((48+56+8))+rsp]
+	neg	rsi
+	mov	rax,QWORD[rbp]
+	adc	r8,QWORD[rdi]
+	adc	r9,QWORD[8+rdi]
+	adc	r10,QWORD[16+rdi]
+	adc	r11,QWORD[24+rdi]
+	adc	r12,QWORD[32+rdi]
+	adc	r13,QWORD[40+rdi]
+	adc	r14,QWORD[48+rdi]
+	adc	r15,QWORD[56+rdi]
+	sbb	rsi,rsi
+
+	mov	ecx,8
+	jmp	NEAR $L$8x_tail
+
+ALIGN	32
+$L$8x_tail_done:
+	add	r8,QWORD[rdx]
+	xor	rax,rax
+
+	neg	rsi
+$L$8x_no_tail:
+	adc	r8,QWORD[rdi]
+	adc	r9,QWORD[8+rdi]
+	adc	r10,QWORD[16+rdi]
+	adc	r11,QWORD[24+rdi]
+	adc	r12,QWORD[32+rdi]
+	adc	r13,QWORD[40+rdi]
+	adc	r14,QWORD[48+rdi]
+	adc	r15,QWORD[56+rdi]
+	adc	rax,0
+	mov	rcx,QWORD[((-16))+rbp]
+	xor	rsi,rsi
+
+DB	102,72,15,126,213
+
+	mov	QWORD[rdi],r8
+	mov	QWORD[8+rdi],r9
+DB	102,73,15,126,217
+	mov	QWORD[16+rdi],r10
+	mov	QWORD[24+rdi],r11
+	mov	QWORD[32+rdi],r12
+	mov	QWORD[40+rdi],r13
+	mov	QWORD[48+rdi],r14
+	mov	QWORD[56+rdi],r15
+	lea	rdi,[64+rdi]
+
+	cmp	rdi,rdx
+	jb	NEAR $L$8x_reduction_loop
+
+	sub	rcx,r15
+	lea	rbx,[r9*1+rdi]
+	adc	rsi,rsi
+	mov	rcx,r9
+	or	rax,rsi
+DB	102,72,15,126,207
+	xor	rax,1
+DB	102,72,15,126,206
+	lea	rbp,[rax*8+rbp]
+	sar	rcx,3+2
+	jmp	NEAR $L$sqr4x_sub
+
+ALIGN	32
+$L$sqr4x_sub:
+DB	0x66
+	mov	r12,QWORD[rbx]
+	mov	r13,QWORD[8+rbx]
+	sbb	r12,QWORD[rbp]
+	mov	r14,QWORD[16+rbx]
+	sbb	r13,QWORD[16+rbp]
+	mov	r15,QWORD[24+rbx]
+	lea	rbx,[32+rbx]
+	sbb	r14,QWORD[32+rbp]
+	mov	QWORD[rdi],r12
+	sbb	r15,QWORD[48+rbp]
+	lea	rbp,[64+rbp]
+	mov	QWORD[8+rdi],r13
+	mov	QWORD[16+rdi],r14
+	mov	QWORD[24+rdi],r15
+	lea	rdi,[32+rdi]
+
+	inc	rcx
+	jnz	NEAR $L$sqr4x_sub
+	mov	r10,r9
+	neg	r9
+	DB	0F3h,0C3h		;repret
+
+global	bn_from_montgomery
+
+ALIGN	32
+bn_from_montgomery:
+	test	DWORD[48+rsp],7
+	jz	NEAR bn_from_mont8x
+	xor	eax,eax
+	DB	0F3h,0C3h		;repret
+
+
+
+ALIGN	32
+bn_from_mont8x:
+	mov	QWORD[8+rsp],rdi	;WIN64 prologue
+	mov	QWORD[16+rsp],rsi
+	mov	rax,rsp
+$L$SEH_begin_bn_from_mont8x:
+	mov	rdi,rcx
+	mov	rsi,rdx
+	mov	rdx,r8
+	mov	rcx,r9
+	mov	r8,QWORD[40+rsp]
+	mov	r9,QWORD[48+rsp]
+
+
+DB	0x67
+	mov	rax,rsp
+	push	rbx
+	push	rbp
+	push	r12
+	push	r13
+	push	r14
+	push	r15
+	lea	rsp,[((-40))+rsp]
+	movaps	XMMWORD[rsp],xmm6
+	movaps	XMMWORD[16+rsp],xmm7
+DB	0x67
+	mov	r10d,r9d
+	shl	r9d,3
+	shl	r10d,3+2
+	neg	r9
+	mov	r8,QWORD[r8]
+
+
+
+
+
+
+
+	lea	r11,[((-64))+r9*2+rsp]
+	sub	r11,rsi
+	and	r11,4095
+	cmp	r10,r11
+	jb	NEAR $L$from_sp_alt
+	sub	rsp,r11
+	lea	rsp,[((-64))+r9*2+rsp]
+	jmp	NEAR $L$from_sp_done
+
+ALIGN	32
+$L$from_sp_alt:
+	lea	r10,[((4096-64))+r9*2]
+	lea	rsp,[((-64))+r9*2+rsp]
+	sub	r11,r10
+	mov	r10,0
+	cmovc	r11,r10
+	sub	rsp,r11
+$L$from_sp_done:
+	and	rsp,-64
+	mov	r10,r9
+	neg	r9
+
+
+
+
+
+
+
+
+
+
+	mov	QWORD[32+rsp],r8
+	mov	QWORD[40+rsp],rax
+$L$from_body:
+	mov	r11,r9
+	lea	rax,[48+rsp]
+	pxor	xmm0,xmm0
+	jmp	NEAR $L$mul_by_1
+
+ALIGN	32
+$L$mul_by_1:
+	movdqu	xmm1,XMMWORD[rsi]
+	movdqu	xmm2,XMMWORD[16+rsi]
+	movdqu	xmm3,XMMWORD[32+rsi]
+	movdqa	XMMWORD[r9*1+rax],xmm0
+	movdqu	xmm4,XMMWORD[48+rsi]
+	movdqa	XMMWORD[16+r9*1+rax],xmm0
+DB	0x48,0x8d,0xb6,0x40,0x00,0x00,0x00
+	movdqa	XMMWORD[rax],xmm1
+	movdqa	XMMWORD[32+r9*1+rax],xmm0
+	movdqa	XMMWORD[16+rax],xmm2
+	movdqa	XMMWORD[48+r9*1+rax],xmm0
+	movdqa	XMMWORD[32+rax],xmm3
+	movdqa	XMMWORD[48+rax],xmm4
+	lea	rax,[64+rax]
+	sub	r11,64
+	jnz	NEAR $L$mul_by_1
+
+DB	102,72,15,110,207
+DB	102,72,15,110,209
+DB	0x67
+	mov	rbp,rcx
+DB	102,73,15,110,218
+	call	sqr8x_reduction
+
+	pxor	xmm0,xmm0
+	lea	rax,[48+rsp]
+	mov	rsi,QWORD[40+rsp]
+	jmp	NEAR $L$from_mont_zero
+
+ALIGN	32
+$L$from_mont_zero:
+	movdqa	XMMWORD[rax],xmm0
+	movdqa	XMMWORD[16+rax],xmm0
+	movdqa	XMMWORD[32+rax],xmm0
+	movdqa	XMMWORD[48+rax],xmm0
+	lea	rax,[64+rax]
+	sub	r9,32
+	jnz	NEAR $L$from_mont_zero
+
+	mov	rax,1
+	mov	r15,QWORD[((-48))+rsi]
+	mov	r14,QWORD[((-40))+rsi]
+	mov	r13,QWORD[((-32))+rsi]
+	mov	r12,QWORD[((-24))+rsi]
+	mov	rbp,QWORD[((-16))+rsi]
+	mov	rbx,QWORD[((-8))+rsi]
+	lea	rsp,[rsi]
+$L$from_epilogue:
+	mov	rdi,QWORD[8+rsp]	;WIN64 epilogue
+	mov	rsi,QWORD[16+rsp]
+	DB	0F3h,0C3h		;repret
+$L$SEH_end_bn_from_mont8x:
+global	bn_scatter5
+
+ALIGN	16
+bn_scatter5:
+	cmp	edx,0
+	jz	NEAR $L$scatter_epilogue
+	lea	r8,[r9*8+r8]
+$L$scatter:
+	mov	rax,QWORD[rcx]
+	lea	rcx,[8+rcx]
+	mov	QWORD[r8],rax
+	lea	r8,[256+r8]
+	sub	edx,1
+	jnz	NEAR $L$scatter
+$L$scatter_epilogue:
+	DB	0F3h,0C3h		;repret
+
+
+global	bn_gather5
+
+ALIGN	16
+bn_gather5:
+$L$SEH_begin_bn_gather5:
+
+DB	0x48,0x83,0xec,0x28
+DB	0x0f,0x29,0x34,0x24
+DB	0x0f,0x29,0x7c,0x24,0x10
+	mov	r11d,r9d
+	shr	r9d,3
+	and	r11,7
+	not	r9d
+	lea	rax,[$L$magic_masks]
+	and	r9d,3
+	lea	r8,[128+r11*8+r8]
+	movq	xmm4,QWORD[r9*8+rax]
+	movq	xmm5,QWORD[8+r9*8+rax]
+	movq	xmm6,QWORD[16+r9*8+rax]
+	movq	xmm7,QWORD[24+r9*8+rax]
+	jmp	NEAR $L$gather
+ALIGN	16
+$L$gather:
+	movq	xmm0,QWORD[(((-128)))+r8]
+	movq	xmm1,QWORD[((-64))+r8]
+	pand	xmm0,xmm4
+	movq	xmm2,QWORD[r8]
+	pand	xmm1,xmm5
+	movq	xmm3,QWORD[64+r8]
+	pand	xmm2,xmm6
+	por	xmm0,xmm1
+	pand	xmm3,xmm7
+DB	0x67,0x67
+	por	xmm0,xmm2
+	lea	r8,[256+r8]
+	por	xmm0,xmm3
+
+	movq	QWORD[rcx],xmm0
+	lea	rcx,[8+rcx]
+	sub	edx,1
+	jnz	NEAR $L$gather
+	movaps	xmm6,XMMWORD[rsp]
+	movaps	xmm7,XMMWORD[16+rsp]
+	lea	rsp,[40+rsp]
+	DB	0F3h,0C3h		;repret
+$L$SEH_end_bn_gather5:
+
+ALIGN	64
+$L$magic_masks:
+	DD	0,0,0,0,0,0,-1,-1
+	DD	0,0,0,0,0,0,0,0
+DB	77,111,110,116,103,111,109,101,114,121,32,77,117,108,116,105
+DB	112,108,105,99,97,116,105,111,110,32,119,105,116,104,32,115
+DB	99,97,116,116,101,114,47,103,97,116,104,101,114,32,102,111
+DB	114,32,120,56,54,95,54,52,44,32,67,82,89,80,84,79
+DB	71,65,77,83,32,98,121,32,60,97,112,112,114,111,64,111
+DB	112,101,110,115,115,108,46,111,114,103,62,0
+EXTERN	__imp_RtlVirtualUnwind
+
+ALIGN	16
+mul_handler:
+	push	rsi
+	push	rdi
+	push	rbx
+	push	rbp
+	push	r12
+	push	r13
+	push	r14
+	push	r15
+	pushfq
+	sub	rsp,64
+
+	mov	rax,QWORD[120+r8]
+	mov	rbx,QWORD[248+r8]
+
+	mov	rsi,QWORD[8+r9]
+	mov	r11,QWORD[56+r9]
+
+	mov	r10d,DWORD[r11]
+	lea	r10,[r10*1+rsi]
+	cmp	rbx,r10
+	jb	NEAR $L$common_seh_tail
+
+	mov	rax,QWORD[152+r8]
+
+	mov	r10d,DWORD[4+r11]
+	lea	r10,[r10*1+rsi]
+	cmp	rbx,r10
+	jae	NEAR $L$common_seh_tail
+
+	lea	r10,[$L$mul_epilogue]
+	cmp	rbx,r10
+	jb	NEAR $L$body_40
+
+	mov	r10,QWORD[192+r8]
+	mov	rax,QWORD[8+r10*8+rax]
+	jmp	NEAR $L$body_proceed
+
+$L$body_40:
+	mov	rax,QWORD[40+rax]
+$L$body_proceed:
+
+	movaps	xmm0,XMMWORD[((-88))+rax]
+	movaps	xmm1,XMMWORD[((-72))+rax]
+
+	mov	rbx,QWORD[((-8))+rax]
+	mov	rbp,QWORD[((-16))+rax]
+	mov	r12,QWORD[((-24))+rax]
+	mov	r13,QWORD[((-32))+rax]
+	mov	r14,QWORD[((-40))+rax]
+	mov	r15,QWORD[((-48))+rax]
+	mov	QWORD[144+r8],rbx
+	mov	QWORD[160+r8],rbp
+	mov	QWORD[216+r8],r12
+	mov	QWORD[224+r8],r13
+	mov	QWORD[232+r8],r14
+	mov	QWORD[240+r8],r15
+	movups	XMMWORD[512+r8],xmm0
+	movups	XMMWORD[528+r8],xmm1
+
+$L$common_seh_tail:
+	mov	rdi,QWORD[8+rax]
+	mov	rsi,QWORD[16+rax]
+	mov	QWORD[152+r8],rax
+	mov	QWORD[168+r8],rsi
+	mov	QWORD[176+r8],rdi
+
+	mov	rdi,QWORD[40+r9]
+	mov	rsi,r8
+	mov	ecx,154
+	DD	0xa548f3fc
+
+	mov	rsi,r9
+	xor	rcx,rcx
+	mov	rdx,QWORD[8+rsi]
+	mov	r8,QWORD[rsi]
+	mov	r9,QWORD[16+rsi]
+	mov	r10,QWORD[40+rsi]
+	lea	r11,[56+rsi]
+	lea	r12,[24+rsi]
+	mov	QWORD[32+rsp],r10
+	mov	QWORD[40+rsp],r11
+	mov	QWORD[48+rsp],r12
+	mov	QWORD[56+rsp],rcx
+	call	QWORD[__imp_RtlVirtualUnwind]
+
+	mov	eax,1
+	add	rsp,64
+	popfq
+	pop	r15
+	pop	r14
+	pop	r13
+	pop	r12
+	pop	rbp
+	pop	rbx
+	pop	rdi
+	pop	rsi
+	DB	0F3h,0C3h		;repret
+
+
+section	.pdata rdata align=4
+ALIGN	4
+	DD	$L$SEH_begin_bn_mul_mont_gather5 wrt ..imagebase
+	DD	$L$SEH_end_bn_mul_mont_gather5 wrt ..imagebase
+	DD	$L$SEH_info_bn_mul_mont_gather5 wrt ..imagebase
+
+	DD	$L$SEH_begin_bn_mul4x_mont_gather5 wrt ..imagebase
+	DD	$L$SEH_end_bn_mul4x_mont_gather5 wrt ..imagebase
+	DD	$L$SEH_info_bn_mul4x_mont_gather5 wrt ..imagebase
+
+	DD	$L$SEH_begin_bn_power5 wrt ..imagebase
+	DD	$L$SEH_end_bn_power5 wrt ..imagebase
+	DD	$L$SEH_info_bn_power5 wrt ..imagebase
+
+	DD	$L$SEH_begin_bn_from_mont8x wrt ..imagebase
+	DD	$L$SEH_end_bn_from_mont8x wrt ..imagebase
+	DD	$L$SEH_info_bn_from_mont8x wrt ..imagebase
+	DD	$L$SEH_begin_bn_gather5 wrt ..imagebase
+	DD	$L$SEH_end_bn_gather5 wrt ..imagebase
+	DD	$L$SEH_info_bn_gather5 wrt ..imagebase
+
+section	.xdata rdata align=8
+ALIGN	8
+$L$SEH_info_bn_mul_mont_gather5:
+DB	9,0,0,0
+	DD	mul_handler wrt ..imagebase
+	DD	$L$mul_body wrt ..imagebase,$L$mul_epilogue wrt ..imagebase
+ALIGN	8
+$L$SEH_info_bn_mul4x_mont_gather5:
+DB	9,0,0,0
+	DD	mul_handler wrt ..imagebase
+	DD	$L$mul4x_body wrt ..imagebase,$L$mul4x_epilogue wrt ..imagebase
+ALIGN	8
+$L$SEH_info_bn_power5:
+DB	9,0,0,0
+	DD	mul_handler wrt ..imagebase
+	DD	$L$power5_body wrt ..imagebase,$L$power5_epilogue wrt ..imagebase
+ALIGN	8
+$L$SEH_info_bn_from_mont8x:
+DB	9,0,0,0
+	DD	mul_handler wrt ..imagebase
+	DD	$L$from_body wrt ..imagebase,$L$from_epilogue wrt ..imagebase
+ALIGN	8
+$L$SEH_info_bn_gather5:
+DB	0x01,0x0d,0x05,0x00
+DB	0x0d,0x78,0x01,0x00
+DB	0x08,0x68,0x00,0x00
+DB	0x04,0x42,0x00,0x00
+ALIGN	8
diff --git a/third_party/boringssl/win-x86_64/crypto/cpu-x86_64-asm.asm b/third_party/boringssl/win-x86_64/crypto/cpu-x86_64-asm.asm
new file mode 100644
index 0000000..c92d7bb
--- /dev/null
+++ b/third_party/boringssl/win-x86_64/crypto/cpu-x86_64-asm.asm
@@ -0,0 +1,154 @@
+default	rel
+%define XMMWORD
+%define YMMWORD
+%define ZMMWORD
+section	.text code align=64
+
+
+global	OPENSSL_ia32_cpuid
+
+ALIGN	16
+OPENSSL_ia32_cpuid:
+	mov	QWORD[8+rsp],rdi	;WIN64 prologue
+	mov	QWORD[16+rsp],rsi
+	mov	rax,rsp
+$L$SEH_begin_OPENSSL_ia32_cpuid:
+	mov	rdi,rcx
+
+
+
+
+	mov	rdi,rcx
+	mov	r8,rbx
+
+	xor	eax,eax
+	mov	DWORD[8+rdi],eax
+	cpuid
+	mov	r11d,eax
+
+	xor	eax,eax
+	cmp	ebx,0x756e6547
+	setne	al
+	mov	r9d,eax
+	cmp	edx,0x49656e69
+	setne	al
+	or	r9d,eax
+	cmp	ecx,0x6c65746e
+	setne	al
+	or	r9d,eax
+	jz	NEAR $L$intel
+
+	cmp	ebx,0x68747541
+	setne	al
+	mov	r10d,eax
+	cmp	edx,0x69746E65
+	setne	al
+	or	r10d,eax
+	cmp	ecx,0x444D4163
+	setne	al
+	or	r10d,eax
+	jnz	NEAR $L$intel
+
+
+
+
+	mov	eax,0x80000000
+	cpuid
+
+
+	cmp	eax,0x80000001
+	jb	NEAR $L$intel
+	mov	r10d,eax
+	mov	eax,0x80000001
+	cpuid
+
+
+	or	r9d,ecx
+	and	r9d,0x00000801
+
+	cmp	r10d,0x80000008
+	jb	NEAR $L$intel
+
+	mov	eax,0x80000008
+	cpuid
+
+	movzx	r10,cl
+	inc	r10
+
+	mov	eax,1
+	cpuid
+
+	bt	edx,28
+	jnc	NEAR $L$generic
+	shr	ebx,16
+	cmp	bl,r10b
+	ja	NEAR $L$generic
+	and	edx,0xefffffff
+	jmp	NEAR $L$generic
+
+$L$intel:
+	cmp	r11d,4
+	mov	r10d,-1
+	jb	NEAR $L$nocacheinfo
+
+	mov	eax,4
+	mov	ecx,0
+	cpuid
+	mov	r10d,eax
+	shr	r10d,14
+	and	r10d,0xfff
+
+	cmp	r11d,7
+	jb	NEAR $L$nocacheinfo
+
+	mov	eax,7
+	xor	ecx,ecx
+	cpuid
+	mov	DWORD[8+rdi],ebx
+
+$L$nocacheinfo:
+	mov	eax,1
+	cpuid
+
+	and	edx,0xbfefffff
+	cmp	r9d,0
+	jne	NEAR $L$notintel
+	or	edx,0x40000000
+$L$notintel:
+	bt	edx,28
+	jnc	NEAR $L$generic
+	and	edx,0xefffffff
+	cmp	r10d,0
+	je	NEAR $L$generic
+
+	or	edx,0x10000000
+	shr	ebx,16
+	cmp	bl,1
+	ja	NEAR $L$generic
+	and	edx,0xefffffff
+$L$generic:
+	and	r9d,0x00000800
+	and	ecx,0xfffff7ff
+	or	r9d,ecx
+
+	mov	r10d,edx
+	bt	r9d,27
+	jnc	NEAR $L$clear_avx
+	xor	ecx,ecx
+DB	0x0f,0x01,0xd0
+	and	eax,6
+	cmp	eax,6
+	je	NEAR $L$done
+$L$clear_avx:
+	mov	eax,0xefffe7ff
+	and	r9d,eax
+	and	DWORD[8+rdi],0xffffffdf
+$L$done:
+	mov	DWORD[4+rdi],r9d
+	mov	DWORD[rdi],r10d
+	mov	rbx,r8
+	mov	rdi,QWORD[8+rsp]	;WIN64 epilogue
+	mov	rsi,QWORD[16+rsp]
+	DB	0F3h,0C3h		;repret
+$L$SEH_end_OPENSSL_ia32_cpuid:
+
diff --git a/third_party/boringssl/win-x86_64/crypto/md5/md5-x86_64.asm b/third_party/boringssl/win-x86_64/crypto/md5/md5-x86_64.asm
new file mode 100644
index 0000000..0e9d2c6
--- /dev/null
+++ b/third_party/boringssl/win-x86_64/crypto/md5/md5-x86_64.asm
@@ -0,0 +1,776 @@
+default	rel
+%define XMMWORD
+%define YMMWORD
+%define ZMMWORD
+section	.text code align=64
+
+ALIGN	16
+
+global	md5_block_asm_data_order
+
+md5_block_asm_data_order:
+	mov	QWORD[8+rsp],rdi	;WIN64 prologue
+	mov	QWORD[16+rsp],rsi
+	mov	rax,rsp
+$L$SEH_begin_md5_block_asm_data_order:
+	mov	rdi,rcx
+	mov	rsi,rdx
+	mov	rdx,r8
+
+
+	push	rbp
+	push	rbx
+	push	r12
+	push	r14
+	push	r15
+$L$prologue:
+
+
+
+
+	mov	rbp,rdi
+	shl	rdx,6
+	lea	rdi,[rdx*1+rsi]
+	mov	eax,DWORD[rbp]
+	mov	ebx,DWORD[4+rbp]
+	mov	ecx,DWORD[8+rbp]
+	mov	edx,DWORD[12+rbp]
+
+
+
+
+
+
+
+	cmp	rsi,rdi
+	je	NEAR $L$end
+
+
+$L$loop:
+	mov	r8d,eax
+	mov	r9d,ebx
+	mov	r14d,ecx
+	mov	r15d,edx
+	mov	r10d,DWORD[rsi]
+	mov	r11d,edx
+	xor	r11d,ecx
+	lea	eax,[((-680876936))+r10*1+rax]
+	and	r11d,ebx
+	xor	r11d,edx
+	mov	r10d,DWORD[4+rsi]
+	add	eax,r11d
+	rol	eax,7
+	mov	r11d,ecx
+	add	eax,ebx
+	xor	r11d,ebx
+	lea	edx,[((-389564586))+r10*1+rdx]
+	and	r11d,eax
+	xor	r11d,ecx
+	mov	r10d,DWORD[8+rsi]
+	add	edx,r11d
+	rol	edx,12
+	mov	r11d,ebx
+	add	edx,eax
+	xor	r11d,eax
+	lea	ecx,[606105819+r10*1+rcx]
+	and	r11d,edx
+	xor	r11d,ebx
+	mov	r10d,DWORD[12+rsi]
+	add	ecx,r11d
+	rol	ecx,17
+	mov	r11d,eax
+	add	ecx,edx
+	xor	r11d,edx
+	lea	ebx,[((-1044525330))+r10*1+rbx]
+	and	r11d,ecx
+	xor	r11d,eax
+	mov	r10d,DWORD[16+rsi]
+	add	ebx,r11d
+	rol	ebx,22
+	mov	r11d,edx
+	add	ebx,ecx
+	xor	r11d,ecx
+	lea	eax,[((-176418897))+r10*1+rax]
+	and	r11d,ebx
+	xor	r11d,edx
+	mov	r10d,DWORD[20+rsi]
+	add	eax,r11d
+	rol	eax,7
+	mov	r11d,ecx
+	add	eax,ebx
+	xor	r11d,ebx
+	lea	edx,[1200080426+r10*1+rdx]
+	and	r11d,eax
+	xor	r11d,ecx
+	mov	r10d,DWORD[24+rsi]
+	add	edx,r11d
+	rol	edx,12
+	mov	r11d,ebx
+	add	edx,eax
+	xor	r11d,eax
+	lea	ecx,[((-1473231341))+r10*1+rcx]
+	and	r11d,edx
+	xor	r11d,ebx
+	mov	r10d,DWORD[28+rsi]
+	add	ecx,r11d
+	rol	ecx,17
+	mov	r11d,eax
+	add	ecx,edx
+	xor	r11d,edx
+	lea	ebx,[((-45705983))+r10*1+rbx]
+	and	r11d,ecx
+	xor	r11d,eax
+	mov	r10d,DWORD[32+rsi]
+	add	ebx,r11d
+	rol	ebx,22
+	mov	r11d,edx
+	add	ebx,ecx
+	xor	r11d,ecx
+	lea	eax,[1770035416+r10*1+rax]
+	and	r11d,ebx
+	xor	r11d,edx
+	mov	r10d,DWORD[36+rsi]
+	add	eax,r11d
+	rol	eax,7
+	mov	r11d,ecx
+	add	eax,ebx
+	xor	r11d,ebx
+	lea	edx,[((-1958414417))+r10*1+rdx]
+	and	r11d,eax
+	xor	r11d,ecx
+	mov	r10d,DWORD[40+rsi]
+	add	edx,r11d
+	rol	edx,12
+	mov	r11d,ebx
+	add	edx,eax
+	xor	r11d,eax
+	lea	ecx,[((-42063))+r10*1+rcx]
+	and	r11d,edx
+	xor	r11d,ebx
+	mov	r10d,DWORD[44+rsi]
+	add	ecx,r11d
+	rol	ecx,17
+	mov	r11d,eax
+	add	ecx,edx
+	xor	r11d,edx
+	lea	ebx,[((-1990404162))+r10*1+rbx]
+	and	r11d,ecx
+	xor	r11d,eax
+	mov	r10d,DWORD[48+rsi]
+	add	ebx,r11d
+	rol	ebx,22
+	mov	r11d,edx
+	add	ebx,ecx
+	xor	r11d,ecx
+	lea	eax,[1804603682+r10*1+rax]
+	and	r11d,ebx
+	xor	r11d,edx
+	mov	r10d,DWORD[52+rsi]
+	add	eax,r11d
+	rol	eax,7
+	mov	r11d,ecx
+	add	eax,ebx
+	xor	r11d,ebx
+	lea	edx,[((-40341101))+r10*1+rdx]
+	and	r11d,eax
+	xor	r11d,ecx
+	mov	r10d,DWORD[56+rsi]
+	add	edx,r11d
+	rol	edx,12
+	mov	r11d,ebx
+	add	edx,eax
+	xor	r11d,eax
+	lea	ecx,[((-1502002290))+r10*1+rcx]
+	and	r11d,edx
+	xor	r11d,ebx
+	mov	r10d,DWORD[60+rsi]
+	add	ecx,r11d
+	rol	ecx,17
+	mov	r11d,eax
+	add	ecx,edx
+	xor	r11d,edx
+	lea	ebx,[1236535329+r10*1+rbx]
+	and	r11d,ecx
+	xor	r11d,eax
+	mov	r10d,DWORD[rsi]
+	add	ebx,r11d
+	rol	ebx,22
+	mov	r11d,edx
+	add	ebx,ecx
+	mov	r10d,DWORD[4+rsi]
+	mov	r11d,edx
+	mov	r12d,edx
+	not	r11d
+	lea	eax,[((-165796510))+r10*1+rax]
+	and	r12d,ebx
+	and	r11d,ecx
+	mov	r10d,DWORD[24+rsi]
+	or	r12d,r11d
+	mov	r11d,ecx
+	add	eax,r12d
+	mov	r12d,ecx
+	rol	eax,5
+	add	eax,ebx
+	not	r11d
+	lea	edx,[((-1069501632))+r10*1+rdx]
+	and	r12d,eax
+	and	r11d,ebx
+	mov	r10d,DWORD[44+rsi]
+	or	r12d,r11d
+	mov	r11d,ebx
+	add	edx,r12d
+	mov	r12d,ebx
+	rol	edx,9
+	add	edx,eax
+	not	r11d
+	lea	ecx,[643717713+r10*1+rcx]
+	and	r12d,edx
+	and	r11d,eax
+	mov	r10d,DWORD[rsi]
+	or	r12d,r11d
+	mov	r11d,eax
+	add	ecx,r12d
+	mov	r12d,eax
+	rol	ecx,14
+	add	ecx,edx
+	not	r11d
+	lea	ebx,[((-373897302))+r10*1+rbx]
+	and	r12d,ecx
+	and	r11d,edx
+	mov	r10d,DWORD[20+rsi]
+	or	r12d,r11d
+	mov	r11d,edx
+	add	ebx,r12d
+	mov	r12d,edx
+	rol	ebx,20
+	add	ebx,ecx
+	not	r11d
+	lea	eax,[((-701558691))+r10*1+rax]
+	and	r12d,ebx
+	and	r11d,ecx
+	mov	r10d,DWORD[40+rsi]
+	or	r12d,r11d
+	mov	r11d,ecx
+	add	eax,r12d
+	mov	r12d,ecx
+	rol	eax,5
+	add	eax,ebx
+	not	r11d
+	lea	edx,[38016083+r10*1+rdx]
+	and	r12d,eax
+	and	r11d,ebx
+	mov	r10d,DWORD[60+rsi]
+	or	r12d,r11d
+	mov	r11d,ebx
+	add	edx,r12d
+	mov	r12d,ebx
+	rol	edx,9
+	add	edx,eax
+	not	r11d
+	lea	ecx,[((-660478335))+r10*1+rcx]
+	and	r12d,edx
+	and	r11d,eax
+	mov	r10d,DWORD[16+rsi]
+	or	r12d,r11d
+	mov	r11d,eax
+	add	ecx,r12d
+	mov	r12d,eax
+	rol	ecx,14
+	add	ecx,edx
+	not	r11d
+	lea	ebx,[((-405537848))+r10*1+rbx]
+	and	r12d,ecx
+	and	r11d,edx
+	mov	r10d,DWORD[36+rsi]
+	or	r12d,r11d
+	mov	r11d,edx
+	add	ebx,r12d
+	mov	r12d,edx
+	rol	ebx,20
+	add	ebx,ecx
+	not	r11d
+	lea	eax,[568446438+r10*1+rax]
+	and	r12d,ebx
+	and	r11d,ecx
+	mov	r10d,DWORD[56+rsi]
+	or	r12d,r11d
+	mov	r11d,ecx
+	add	eax,r12d
+	mov	r12d,ecx
+	rol	eax,5
+	add	eax,ebx
+	not	r11d
+	lea	edx,[((-1019803690))+r10*1+rdx]
+	and	r12d,eax
+	and	r11d,ebx
+	mov	r10d,DWORD[12+rsi]
+	or	r12d,r11d
+	mov	r11d,ebx
+	add	edx,r12d
+	mov	r12d,ebx
+	rol	edx,9
+	add	edx,eax
+	not	r11d
+	lea	ecx,[((-187363961))+r10*1+rcx]
+	and	r12d,edx
+	and	r11d,eax
+	mov	r10d,DWORD[32+rsi]
+	or	r12d,r11d
+	mov	r11d,eax
+	add	ecx,r12d
+	mov	r12d,eax
+	rol	ecx,14
+	add	ecx,edx
+	not	r11d
+	lea	ebx,[1163531501+r10*1+rbx]
+	and	r12d,ecx
+	and	r11d,edx
+	mov	r10d,DWORD[52+rsi]
+	or	r12d,r11d
+	mov	r11d,edx
+	add	ebx,r12d
+	mov	r12d,edx
+	rol	ebx,20
+	add	ebx,ecx
+	not	r11d
+	lea	eax,[((-1444681467))+r10*1+rax]
+	and	r12d,ebx
+	and	r11d,ecx
+	mov	r10d,DWORD[8+rsi]
+	or	r12d,r11d
+	mov	r11d,ecx
+	add	eax,r12d
+	mov	r12d,ecx
+	rol	eax,5
+	add	eax,ebx
+	not	r11d
+	lea	edx,[((-51403784))+r10*1+rdx]
+	and	r12d,eax
+	and	r11d,ebx
+	mov	r10d,DWORD[28+rsi]
+	or	r12d,r11d
+	mov	r11d,ebx
+	add	edx,r12d
+	mov	r12d,ebx
+	rol	edx,9
+	add	edx,eax
+	not	r11d
+	lea	ecx,[1735328473+r10*1+rcx]
+	and	r12d,edx
+	and	r11d,eax
+	mov	r10d,DWORD[48+rsi]
+	or	r12d,r11d
+	mov	r11d,eax
+	add	ecx,r12d
+	mov	r12d,eax
+	rol	ecx,14
+	add	ecx,edx
+	not	r11d
+	lea	ebx,[((-1926607734))+r10*1+rbx]
+	and	r12d,ecx
+	and	r11d,edx
+	mov	r10d,DWORD[rsi]
+	or	r12d,r11d
+	mov	r11d,edx
+	add	ebx,r12d
+	mov	r12d,edx
+	rol	ebx,20
+	add	ebx,ecx
+	mov	r10d,DWORD[20+rsi]
+	mov	r11d,ecx
+	lea	eax,[((-378558))+r10*1+rax]
+	mov	r10d,DWORD[32+rsi]
+	xor	r11d,edx
+	xor	r11d,ebx
+	add	eax,r11d
+	rol	eax,4
+	mov	r11d,ebx
+	add	eax,ebx
+	lea	edx,[((-2022574463))+r10*1+rdx]
+	mov	r10d,DWORD[44+rsi]
+	xor	r11d,ecx
+	xor	r11d,eax
+	add	edx,r11d
+	rol	edx,11
+	mov	r11d,eax
+	add	edx,eax
+	lea	ecx,[1839030562+r10*1+rcx]
+	mov	r10d,DWORD[56+rsi]
+	xor	r11d,ebx
+	xor	r11d,edx
+	add	ecx,r11d
+	rol	ecx,16
+	mov	r11d,edx
+	add	ecx,edx
+	lea	ebx,[((-35309556))+r10*1+rbx]
+	mov	r10d,DWORD[4+rsi]
+	xor	r11d,eax
+	xor	r11d,ecx
+	add	ebx,r11d
+	rol	ebx,23
+	mov	r11d,ecx
+	add	ebx,ecx
+	lea	eax,[((-1530992060))+r10*1+rax]
+	mov	r10d,DWORD[16+rsi]
+	xor	r11d,edx
+	xor	r11d,ebx
+	add	eax,r11d
+	rol	eax,4
+	mov	r11d,ebx
+	add	eax,ebx
+	lea	edx,[1272893353+r10*1+rdx]
+	mov	r10d,DWORD[28+rsi]
+	xor	r11d,ecx
+	xor	r11d,eax
+	add	edx,r11d
+	rol	edx,11
+	mov	r11d,eax
+	add	edx,eax
+	lea	ecx,[((-155497632))+r10*1+rcx]
+	mov	r10d,DWORD[40+rsi]
+	xor	r11d,ebx
+	xor	r11d,edx
+	add	ecx,r11d
+	rol	ecx,16
+	mov	r11d,edx
+	add	ecx,edx
+	lea	ebx,[((-1094730640))+r10*1+rbx]
+	mov	r10d,DWORD[52+rsi]
+	xor	r11d,eax
+	xor	r11d,ecx
+	add	ebx,r11d
+	rol	ebx,23
+	mov	r11d,ecx
+	add	ebx,ecx
+	lea	eax,[681279174+r10*1+rax]
+	mov	r10d,DWORD[rsi]
+	xor	r11d,edx
+	xor	r11d,ebx
+	add	eax,r11d
+	rol	eax,4
+	mov	r11d,ebx
+	add	eax,ebx
+	lea	edx,[((-358537222))+r10*1+rdx]
+	mov	r10d,DWORD[12+rsi]
+	xor	r11d,ecx
+	xor	r11d,eax
+	add	edx,r11d
+	rol	edx,11
+	mov	r11d,eax
+	add	edx,eax
+	lea	ecx,[((-722521979))+r10*1+rcx]
+	mov	r10d,DWORD[24+rsi]
+	xor	r11d,ebx
+	xor	r11d,edx
+	add	ecx,r11d
+	rol	ecx,16
+	mov	r11d,edx
+	add	ecx,edx
+	lea	ebx,[76029189+r10*1+rbx]
+	mov	r10d,DWORD[36+rsi]
+	xor	r11d,eax
+	xor	r11d,ecx
+	add	ebx,r11d
+	rol	ebx,23
+	mov	r11d,ecx
+	add	ebx,ecx
+	lea	eax,[((-640364487))+r10*1+rax]
+	mov	r10d,DWORD[48+rsi]
+	xor	r11d,edx
+	xor	r11d,ebx
+	add	eax,r11d
+	rol	eax,4
+	mov	r11d,ebx
+	add	eax,ebx
+	lea	edx,[((-421815835))+r10*1+rdx]
+	mov	r10d,DWORD[60+rsi]
+	xor	r11d,ecx
+	xor	r11d,eax
+	add	edx,r11d
+	rol	edx,11
+	mov	r11d,eax
+	add	edx,eax
+	lea	ecx,[530742520+r10*1+rcx]
+	mov	r10d,DWORD[8+rsi]
+	xor	r11d,ebx
+	xor	r11d,edx
+	add	ecx,r11d
+	rol	ecx,16
+	mov	r11d,edx
+	add	ecx,edx
+	lea	ebx,[((-995338651))+r10*1+rbx]
+	mov	r10d,DWORD[rsi]
+	xor	r11d,eax
+	xor	r11d,ecx
+	add	ebx,r11d
+	rol	ebx,23
+	mov	r11d,ecx
+	add	ebx,ecx
+	mov	r10d,DWORD[rsi]
+	mov	r11d,0xffffffff
+	xor	r11d,edx
+	lea	eax,[((-198630844))+r10*1+rax]
+	or	r11d,ebx
+	xor	r11d,ecx
+	add	eax,r11d
+	mov	r10d,DWORD[28+rsi]
+	mov	r11d,0xffffffff
+	rol	eax,6
+	xor	r11d,ecx
+	add	eax,ebx
+	lea	edx,[1126891415+r10*1+rdx]
+	or	r11d,eax
+	xor	r11d,ebx
+	add	edx,r11d
+	mov	r10d,DWORD[56+rsi]
+	mov	r11d,0xffffffff
+	rol	edx,10
+	xor	r11d,ebx
+	add	edx,eax
+	lea	ecx,[((-1416354905))+r10*1+rcx]
+	or	r11d,edx
+	xor	r11d,eax
+	add	ecx,r11d
+	mov	r10d,DWORD[20+rsi]
+	mov	r11d,0xffffffff
+	rol	ecx,15
+	xor	r11d,eax
+	add	ecx,edx
+	lea	ebx,[((-57434055))+r10*1+rbx]
+	or	r11d,ecx
+	xor	r11d,edx
+	add	ebx,r11d
+	mov	r10d,DWORD[48+rsi]
+	mov	r11d,0xffffffff
+	rol	ebx,21
+	xor	r11d,edx
+	add	ebx,ecx
+	lea	eax,[1700485571+r10*1+rax]
+	or	r11d,ebx
+	xor	r11d,ecx
+	add	eax,r11d
+	mov	r10d,DWORD[12+rsi]
+	mov	r11d,0xffffffff
+	rol	eax,6
+	xor	r11d,ecx
+	add	eax,ebx
+	lea	edx,[((-1894986606))+r10*1+rdx]
+	or	r11d,eax
+	xor	r11d,ebx
+	add	edx,r11d
+	mov	r10d,DWORD[40+rsi]
+	mov	r11d,0xffffffff
+	rol	edx,10
+	xor	r11d,ebx
+	add	edx,eax
+	lea	ecx,[((-1051523))+r10*1+rcx]
+	or	r11d,edx
+	xor	r11d,eax
+	add	ecx,r11d
+	mov	r10d,DWORD[4+rsi]
+	mov	r11d,0xffffffff
+	rol	ecx,15
+	xor	r11d,eax
+	add	ecx,edx
+	lea	ebx,[((-2054922799))+r10*1+rbx]
+	or	r11d,ecx
+	xor	r11d,edx
+	add	ebx,r11d
+	mov	r10d,DWORD[32+rsi]
+	mov	r11d,0xffffffff
+	rol	ebx,21
+	xor	r11d,edx
+	add	ebx,ecx
+	lea	eax,[1873313359+r10*1+rax]
+	or	r11d,ebx
+	xor	r11d,ecx
+	add	eax,r11d
+	mov	r10d,DWORD[60+rsi]
+	mov	r11d,0xffffffff
+	rol	eax,6
+	xor	r11d,ecx
+	add	eax,ebx
+	lea	edx,[((-30611744))+r10*1+rdx]
+	or	r11d,eax
+	xor	r11d,ebx
+	add	edx,r11d
+	mov	r10d,DWORD[24+rsi]
+	mov	r11d,0xffffffff
+	rol	edx,10
+	xor	r11d,ebx
+	add	edx,eax
+	lea	ecx,[((-1560198380))+r10*1+rcx]
+	or	r11d,edx
+	xor	r11d,eax
+	add	ecx,r11d
+	mov	r10d,DWORD[52+rsi]
+	mov	r11d,0xffffffff
+	rol	ecx,15
+	xor	r11d,eax
+	add	ecx,edx
+	lea	ebx,[1309151649+r10*1+rbx]
+	or	r11d,ecx
+	xor	r11d,edx
+	add	ebx,r11d
+	mov	r10d,DWORD[16+rsi]
+	mov	r11d,0xffffffff
+	rol	ebx,21
+	xor	r11d,edx
+	add	ebx,ecx
+	lea	eax,[((-145523070))+r10*1+rax]
+	or	r11d,ebx
+	xor	r11d,ecx
+	add	eax,r11d
+	mov	r10d,DWORD[44+rsi]
+	mov	r11d,0xffffffff
+	rol	eax,6
+	xor	r11d,ecx
+	add	eax,ebx
+	lea	edx,[((-1120210379))+r10*1+rdx]
+	or	r11d,eax
+	xor	r11d,ebx
+	add	edx,r11d
+	mov	r10d,DWORD[8+rsi]
+	mov	r11d,0xffffffff
+	rol	edx,10
+	xor	r11d,ebx
+	add	edx,eax
+	lea	ecx,[718787259+r10*1+rcx]
+	or	r11d,edx
+	xor	r11d,eax
+	add	ecx,r11d
+	mov	r10d,DWORD[36+rsi]
+	mov	r11d,0xffffffff
+	rol	ecx,15
+	xor	r11d,eax
+	add	ecx,edx
+	lea	ebx,[((-343485551))+r10*1+rbx]
+	or	r11d,ecx
+	xor	r11d,edx
+	add	ebx,r11d
+	mov	r10d,DWORD[rsi]
+	mov	r11d,0xffffffff
+	rol	ebx,21
+	xor	r11d,edx
+	add	ebx,ecx
+
+	add	eax,r8d
+	add	ebx,r9d
+	add	ecx,r14d
+	add	edx,r15d
+
+
+	add	rsi,64
+	cmp	rsi,rdi
+	jb	NEAR $L$loop
+
+
+$L$end:
+	mov	DWORD[rbp],eax
+	mov	DWORD[4+rbp],ebx
+	mov	DWORD[8+rbp],ecx
+	mov	DWORD[12+rbp],edx
+
+	mov	r15,QWORD[rsp]
+	mov	r14,QWORD[8+rsp]
+	mov	r12,QWORD[16+rsp]
+	mov	rbx,QWORD[24+rsp]
+	mov	rbp,QWORD[32+rsp]
+	add	rsp,40
+$L$epilogue:
+	mov	rdi,QWORD[8+rsp]	;WIN64 epilogue
+	mov	rsi,QWORD[16+rsp]
+	DB	0F3h,0C3h		;repret
+$L$SEH_end_md5_block_asm_data_order:
+EXTERN	__imp_RtlVirtualUnwind
+
+ALIGN	16
+se_handler:
+	push	rsi
+	push	rdi
+	push	rbx
+	push	rbp
+	push	r12
+	push	r13
+	push	r14
+	push	r15
+	pushfq
+	sub	rsp,64
+
+	mov	rax,QWORD[120+r8]
+	mov	rbx,QWORD[248+r8]
+
+	lea	r10,[$L$prologue]
+	cmp	rbx,r10
+	jb	NEAR $L$in_prologue
+
+	mov	rax,QWORD[152+r8]
+
+	lea	r10,[$L$epilogue]
+	cmp	rbx,r10
+	jae	NEAR $L$in_prologue
+
+	lea	rax,[40+rax]
+
+	mov	rbp,QWORD[((-8))+rax]
+	mov	rbx,QWORD[((-16))+rax]
+	mov	r12,QWORD[((-24))+rax]
+	mov	r14,QWORD[((-32))+rax]
+	mov	r15,QWORD[((-40))+rax]
+	mov	QWORD[144+r8],rbx
+	mov	QWORD[160+r8],rbp
+	mov	QWORD[216+r8],r12
+	mov	QWORD[232+r8],r14
+	mov	QWORD[240+r8],r15
+
+$L$in_prologue:
+	mov	rdi,QWORD[8+rax]
+	mov	rsi,QWORD[16+rax]
+	mov	QWORD[152+r8],rax
+	mov	QWORD[168+r8],rsi
+	mov	QWORD[176+r8],rdi
+
+	mov	rdi,QWORD[40+r9]
+	mov	rsi,r8
+	mov	ecx,154
+	DD	0xa548f3fc
+
+	mov	rsi,r9
+	xor	rcx,rcx
+	mov	rdx,QWORD[8+rsi]
+	mov	r8,QWORD[rsi]
+	mov	r9,QWORD[16+rsi]
+	mov	r10,QWORD[40+rsi]
+	lea	r11,[56+rsi]
+	lea	r12,[24+rsi]
+	mov	QWORD[32+rsp],r10
+	mov	QWORD[40+rsp],r11
+	mov	QWORD[48+rsp],r12
+	mov	QWORD[56+rsp],rcx
+	call	QWORD[__imp_RtlVirtualUnwind]
+
+	mov	eax,1
+	add	rsp,64
+	popfq
+	pop	r15
+	pop	r14
+	pop	r13
+	pop	r12
+	pop	rbp
+	pop	rbx
+	pop	rdi
+	pop	rsi
+	DB	0F3h,0C3h		;repret
+
+
+section	.pdata rdata align=4
+ALIGN	4
+	DD	$L$SEH_begin_md5_block_asm_data_order wrt ..imagebase
+	DD	$L$SEH_end_md5_block_asm_data_order wrt ..imagebase
+	DD	$L$SEH_info_md5_block_asm_data_order wrt ..imagebase
+
+section	.xdata rdata align=8
+ALIGN	8
+$L$SEH_info_md5_block_asm_data_order:
+DB	9,0,0,0
+	DD	se_handler wrt ..imagebase
diff --git a/third_party/boringssl/win-x86_64/crypto/modes/aesni-gcm-x86_64.asm b/third_party/boringssl/win-x86_64/crypto/modes/aesni-gcm-x86_64.asm
new file mode 100644
index 0000000..d7fff6a
--- /dev/null
+++ b/third_party/boringssl/win-x86_64/crypto/modes/aesni-gcm-x86_64.asm
@@ -0,0 +1,20 @@
+default	rel
+%define XMMWORD
+%define YMMWORD
+%define ZMMWORD
+section	.text code align=64
+
+
+global	aesni_gcm_encrypt
+
+aesni_gcm_encrypt:
+	xor	eax,eax
+	DB	0F3h,0C3h		;repret
+
+
+global	aesni_gcm_decrypt
+
+aesni_gcm_decrypt:
+	xor	eax,eax
+	DB	0F3h,0C3h		;repret
+
diff --git a/third_party/boringssl/win-x86_64/crypto/modes/ghash-x86_64.asm b/third_party/boringssl/win-x86_64/crypto/modes/ghash-x86_64.asm
new file mode 100644
index 0000000..5d8fadc
--- /dev/null
+++ b/third_party/boringssl/win-x86_64/crypto/modes/ghash-x86_64.asm
@@ -0,0 +1,1507 @@
+default	rel
+%define XMMWORD
+%define YMMWORD
+%define ZMMWORD
+section	.text code align=64
+
+EXTERN	OPENSSL_ia32cap_P
+
+global	gcm_gmult_4bit
+
+ALIGN	16
+gcm_gmult_4bit:
+	mov	QWORD[8+rsp],rdi	;WIN64 prologue
+	mov	QWORD[16+rsp],rsi
+	mov	rax,rsp
+$L$SEH_begin_gcm_gmult_4bit:
+	mov	rdi,rcx
+	mov	rsi,rdx
+
+
+	push	rbx
+	push	rbp
+	push	r12
+$L$gmult_prologue:
+
+	movzx	r8,BYTE[15+rdi]
+	lea	r11,[$L$rem_4bit]
+	xor	rax,rax
+	xor	rbx,rbx
+	mov	al,r8b
+	mov	bl,r8b
+	shl	al,4
+	mov	rcx,14
+	mov	r8,QWORD[8+rax*1+rsi]
+	mov	r9,QWORD[rax*1+rsi]
+	and	bl,0xf0
+	mov	rdx,r8
+	jmp	NEAR $L$oop1
+
+ALIGN	16
+$L$oop1:
+	shr	r8,4
+	and	rdx,0xf
+	mov	r10,r9
+	mov	al,BYTE[rcx*1+rdi]
+	shr	r9,4
+	xor	r8,QWORD[8+rbx*1+rsi]
+	shl	r10,60
+	xor	r9,QWORD[rbx*1+rsi]
+	mov	bl,al
+	xor	r9,QWORD[rdx*8+r11]
+	mov	rdx,r8
+	shl	al,4
+	xor	r8,r10
+	dec	rcx
+	js	NEAR $L$break1
+
+	shr	r8,4
+	and	rdx,0xf
+	mov	r10,r9
+	shr	r9,4
+	xor	r8,QWORD[8+rax*1+rsi]
+	shl	r10,60
+	xor	r9,QWORD[rax*1+rsi]
+	and	bl,0xf0
+	xor	r9,QWORD[rdx*8+r11]
+	mov	rdx,r8
+	xor	r8,r10
+	jmp	NEAR $L$oop1
+
+ALIGN	16
+$L$break1:
+	shr	r8,4
+	and	rdx,0xf
+	mov	r10,r9
+	shr	r9,4
+	xor	r8,QWORD[8+rax*1+rsi]
+	shl	r10,60
+	xor	r9,QWORD[rax*1+rsi]
+	and	bl,0xf0
+	xor	r9,QWORD[rdx*8+r11]
+	mov	rdx,r8
+	xor	r8,r10
+
+	shr	r8,4
+	and	rdx,0xf
+	mov	r10,r9
+	shr	r9,4
+	xor	r8,QWORD[8+rbx*1+rsi]
+	shl	r10,60
+	xor	r9,QWORD[rbx*1+rsi]
+	xor	r8,r10
+	xor	r9,QWORD[rdx*8+r11]
+
+	bswap	r8
+	bswap	r9
+	mov	QWORD[8+rdi],r8
+	mov	QWORD[rdi],r9
+
+	mov	rbx,QWORD[16+rsp]
+	lea	rsp,[24+rsp]
+$L$gmult_epilogue:
+	mov	rdi,QWORD[8+rsp]	;WIN64 epilogue
+	mov	rsi,QWORD[16+rsp]
+	DB	0F3h,0C3h		;repret
+$L$SEH_end_gcm_gmult_4bit:
+global	gcm_ghash_4bit
+
+ALIGN	16
+gcm_ghash_4bit:
+	mov	QWORD[8+rsp],rdi	;WIN64 prologue
+	mov	QWORD[16+rsp],rsi
+	mov	rax,rsp
+$L$SEH_begin_gcm_ghash_4bit:
+	mov	rdi,rcx
+	mov	rsi,rdx
+	mov	rdx,r8
+	mov	rcx,r9
+
+
+	push	rbx
+	push	rbp
+	push	r12
+	push	r13
+	push	r14
+	push	r15
+	sub	rsp,280
+$L$ghash_prologue:
+	mov	r14,rdx
+	mov	r15,rcx
+	sub	rsi,-128
+	lea	rbp,[((16+128))+rsp]
+	xor	edx,edx
+	mov	r8,QWORD[((0+0-128))+rsi]
+	mov	rax,QWORD[((0+8-128))+rsi]
+	mov	dl,al
+	shr	rax,4
+	mov	r10,r8
+	shr	r8,4
+	mov	r9,QWORD[((16+0-128))+rsi]
+	shl	dl,4
+	mov	rbx,QWORD[((16+8-128))+rsi]
+	shl	r10,60
+	mov	BYTE[rsp],dl
+	or	rax,r10
+	mov	dl,bl
+	shr	rbx,4
+	mov	r10,r9
+	shr	r9,4
+	mov	QWORD[rbp],r8
+	mov	r8,QWORD[((32+0-128))+rsi]
+	shl	dl,4
+	mov	QWORD[((0-128))+rbp],rax
+	mov	rax,QWORD[((32+8-128))+rsi]
+	shl	r10,60
+	mov	BYTE[1+rsp],dl
+	or	rbx,r10
+	mov	dl,al
+	shr	rax,4
+	mov	r10,r8
+	shr	r8,4
+	mov	QWORD[8+rbp],r9
+	mov	r9,QWORD[((48+0-128))+rsi]
+	shl	dl,4
+	mov	QWORD[((8-128))+rbp],rbx
+	mov	rbx,QWORD[((48+8-128))+rsi]
+	shl	r10,60
+	mov	BYTE[2+rsp],dl
+	or	rax,r10
+	mov	dl,bl
+	shr	rbx,4
+	mov	r10,r9
+	shr	r9,4
+	mov	QWORD[16+rbp],r8
+	mov	r8,QWORD[((64+0-128))+rsi]
+	shl	dl,4
+	mov	QWORD[((16-128))+rbp],rax
+	mov	rax,QWORD[((64+8-128))+rsi]
+	shl	r10,60
+	mov	BYTE[3+rsp],dl
+	or	rbx,r10
+	mov	dl,al
+	shr	rax,4
+	mov	r10,r8
+	shr	r8,4
+	mov	QWORD[24+rbp],r9
+	mov	r9,QWORD[((80+0-128))+rsi]
+	shl	dl,4
+	mov	QWORD[((24-128))+rbp],rbx
+	mov	rbx,QWORD[((80+8-128))+rsi]
+	shl	r10,60
+	mov	BYTE[4+rsp],dl
+	or	rax,r10
+	mov	dl,bl
+	shr	rbx,4
+	mov	r10,r9
+	shr	r9,4
+	mov	QWORD[32+rbp],r8
+	mov	r8,QWORD[((96+0-128))+rsi]
+	shl	dl,4
+	mov	QWORD[((32-128))+rbp],rax
+	mov	rax,QWORD[((96+8-128))+rsi]
+	shl	r10,60
+	mov	BYTE[5+rsp],dl
+	or	rbx,r10
+	mov	dl,al
+	shr	rax,4
+	mov	r10,r8
+	shr	r8,4
+	mov	QWORD[40+rbp],r9
+	mov	r9,QWORD[((112+0-128))+rsi]
+	shl	dl,4
+	mov	QWORD[((40-128))+rbp],rbx
+	mov	rbx,QWORD[((112+8-128))+rsi]
+	shl	r10,60
+	mov	BYTE[6+rsp],dl
+	or	rax,r10
+	mov	dl,bl
+	shr	rbx,4
+	mov	r10,r9
+	shr	r9,4
+	mov	QWORD[48+rbp],r8
+	mov	r8,QWORD[((128+0-128))+rsi]
+	shl	dl,4
+	mov	QWORD[((48-128))+rbp],rax
+	mov	rax,QWORD[((128+8-128))+rsi]
+	shl	r10,60
+	mov	BYTE[7+rsp],dl
+	or	rbx,r10
+	mov	dl,al
+	shr	rax,4
+	mov	r10,r8
+	shr	r8,4
+	mov	QWORD[56+rbp],r9
+	mov	r9,QWORD[((144+0-128))+rsi]
+	shl	dl,4
+	mov	QWORD[((56-128))+rbp],rbx
+	mov	rbx,QWORD[((144+8-128))+rsi]
+	shl	r10,60
+	mov	BYTE[8+rsp],dl
+	or	rax,r10
+	mov	dl,bl
+	shr	rbx,4
+	mov	r10,r9
+	shr	r9,4
+	mov	QWORD[64+rbp],r8
+	mov	r8,QWORD[((160+0-128))+rsi]
+	shl	dl,4
+	mov	QWORD[((64-128))+rbp],rax
+	mov	rax,QWORD[((160+8-128))+rsi]
+	shl	r10,60
+	mov	BYTE[9+rsp],dl
+	or	rbx,r10
+	mov	dl,al
+	shr	rax,4
+	mov	r10,r8
+	shr	r8,4
+	mov	QWORD[72+rbp],r9
+	mov	r9,QWORD[((176+0-128))+rsi]
+	shl	dl,4
+	mov	QWORD[((72-128))+rbp],rbx
+	mov	rbx,QWORD[((176+8-128))+rsi]
+	shl	r10,60
+	mov	BYTE[10+rsp],dl
+	or	rax,r10
+	mov	dl,bl
+	shr	rbx,4
+	mov	r10,r9
+	shr	r9,4
+	mov	QWORD[80+rbp],r8
+	mov	r8,QWORD[((192+0-128))+rsi]
+	shl	dl,4
+	mov	QWORD[((80-128))+rbp],rax
+	mov	rax,QWORD[((192+8-128))+rsi]
+	shl	r10,60
+	mov	BYTE[11+rsp],dl
+	or	rbx,r10
+	mov	dl,al
+	shr	rax,4
+	mov	r10,r8
+	shr	r8,4
+	mov	QWORD[88+rbp],r9
+	mov	r9,QWORD[((208+0-128))+rsi]
+	shl	dl,4
+	mov	QWORD[((88-128))+rbp],rbx
+	mov	rbx,QWORD[((208+8-128))+rsi]
+	shl	r10,60
+	mov	BYTE[12+rsp],dl
+	or	rax,r10
+	mov	dl,bl
+	shr	rbx,4
+	mov	r10,r9
+	shr	r9,4
+	mov	QWORD[96+rbp],r8
+	mov	r8,QWORD[((224+0-128))+rsi]
+	shl	dl,4
+	mov	QWORD[((96-128))+rbp],rax
+	mov	rax,QWORD[((224+8-128))+rsi]
+	shl	r10,60
+	mov	BYTE[13+rsp],dl
+	or	rbx,r10
+	mov	dl,al
+	shr	rax,4
+	mov	r10,r8
+	shr	r8,4
+	mov	QWORD[104+rbp],r9
+	mov	r9,QWORD[((240+0-128))+rsi]
+	shl	dl,4
+	mov	QWORD[((104-128))+rbp],rbx
+	mov	rbx,QWORD[((240+8-128))+rsi]
+	shl	r10,60
+	mov	BYTE[14+rsp],dl
+	or	rax,r10
+	mov	dl,bl
+	shr	rbx,4
+	mov	r10,r9
+	shr	r9,4
+	mov	QWORD[112+rbp],r8
+	shl	dl,4
+	mov	QWORD[((112-128))+rbp],rax
+	shl	r10,60
+	mov	BYTE[15+rsp],dl
+	or	rbx,r10
+	mov	QWORD[120+rbp],r9
+	mov	QWORD[((120-128))+rbp],rbx
+	add	rsi,-128
+	mov	r8,QWORD[8+rdi]
+	mov	r9,QWORD[rdi]
+	add	r15,r14
+	lea	r11,[$L$rem_8bit]
+	jmp	NEAR $L$outer_loop
+ALIGN	16
+$L$outer_loop:
+	xor	r9,QWORD[r14]
+	mov	rdx,QWORD[8+r14]
+	lea	r14,[16+r14]
+	xor	rdx,r8
+	mov	QWORD[rdi],r9
+	mov	QWORD[8+rdi],rdx
+	shr	rdx,32
+	xor	rax,rax
+	rol	edx,8
+	mov	al,dl
+	movzx	ebx,dl
+	shl	al,4
+	shr	ebx,4
+	rol	edx,8
+	mov	r8,QWORD[8+rax*1+rsi]
+	mov	r9,QWORD[rax*1+rsi]
+	mov	al,dl
+	movzx	ecx,dl
+	shl	al,4
+	movzx	r12,BYTE[rbx*1+rsp]
+	shr	ecx,4
+	xor	r12,r8
+	mov	r10,r9
+	shr	r8,8
+	movzx	r12,r12b
+	shr	r9,8
+	xor	r8,QWORD[((-128))+rbx*8+rbp]
+	shl	r10,56
+	xor	r9,QWORD[rbx*8+rbp]
+	rol	edx,8
+	xor	r8,QWORD[8+rax*1+rsi]
+	xor	r9,QWORD[rax*1+rsi]
+	mov	al,dl
+	xor	r8,r10
+	movzx	r12,WORD[r12*2+r11]
+	movzx	ebx,dl
+	shl	al,4
+	movzx	r13,BYTE[rcx*1+rsp]
+	shr	ebx,4
+	shl	r12,48
+	xor	r13,r8
+	mov	r10,r9
+	xor	r9,r12
+	shr	r8,8
+	movzx	r13,r13b
+	shr	r9,8
+	xor	r8,QWORD[((-128))+rcx*8+rbp]
+	shl	r10,56
+	xor	r9,QWORD[rcx*8+rbp]
+	rol	edx,8
+	xor	r8,QWORD[8+rax*1+rsi]
+	xor	r9,QWORD[rax*1+rsi]
+	mov	al,dl
+	xor	r8,r10
+	movzx	r13,WORD[r13*2+r11]
+	movzx	ecx,dl
+	shl	al,4
+	movzx	r12,BYTE[rbx*1+rsp]
+	shr	ecx,4
+	shl	r13,48
+	xor	r12,r8
+	mov	r10,r9
+	xor	r9,r13
+	shr	r8,8
+	movzx	r12,r12b
+	mov	edx,DWORD[8+rdi]
+	shr	r9,8
+	xor	r8,QWORD[((-128))+rbx*8+rbp]
+	shl	r10,56
+	xor	r9,QWORD[rbx*8+rbp]
+	rol	edx,8
+	xor	r8,QWORD[8+rax*1+rsi]
+	xor	r9,QWORD[rax*1+rsi]
+	mov	al,dl
+	xor	r8,r10
+	movzx	r12,WORD[r12*2+r11]
+	movzx	ebx,dl
+	shl	al,4
+	movzx	r13,BYTE[rcx*1+rsp]
+	shr	ebx,4
+	shl	r12,48
+	xor	r13,r8
+	mov	r10,r9
+	xor	r9,r12
+	shr	r8,8
+	movzx	r13,r13b
+	shr	r9,8
+	xor	r8,QWORD[((-128))+rcx*8+rbp]
+	shl	r10,56
+	xor	r9,QWORD[rcx*8+rbp]
+	rol	edx,8
+	xor	r8,QWORD[8+rax*1+rsi]
+	xor	r9,QWORD[rax*1+rsi]
+	mov	al,dl
+	xor	r8,r10
+	movzx	r13,WORD[r13*2+r11]
+	movzx	ecx,dl
+	shl	al,4
+	movzx	r12,BYTE[rbx*1+rsp]
+	shr	ecx,4
+	shl	r13,48
+	xor	r12,r8
+	mov	r10,r9
+	xor	r9,r13
+	shr	r8,8
+	movzx	r12,r12b
+	shr	r9,8
+	xor	r8,QWORD[((-128))+rbx*8+rbp]
+	shl	r10,56
+	xor	r9,QWORD[rbx*8+rbp]
+	rol	edx,8
+	xor	r8,QWORD[8+rax*1+rsi]
+	xor	r9,QWORD[rax*1+rsi]
+	mov	al,dl
+	xor	r8,r10
+	movzx	r12,WORD[r12*2+r11]
+	movzx	ebx,dl
+	shl	al,4
+	movzx	r13,BYTE[rcx*1+rsp]
+	shr	ebx,4
+	shl	r12,48
+	xor	r13,r8
+	mov	r10,r9
+	xor	r9,r12
+	shr	r8,8
+	movzx	r13,r13b
+	shr	r9,8
+	xor	r8,QWORD[((-128))+rcx*8+rbp]
+	shl	r10,56
+	xor	r9,QWORD[rcx*8+rbp]
+	rol	edx,8
+	xor	r8,QWORD[8+rax*1+rsi]
+	xor	r9,QWORD[rax*1+rsi]
+	mov	al,dl
+	xor	r8,r10
+	movzx	r13,WORD[r13*2+r11]
+	movzx	ecx,dl
+	shl	al,4
+	movzx	r12,BYTE[rbx*1+rsp]
+	shr	ecx,4
+	shl	r13,48
+	xor	r12,r8
+	mov	r10,r9
+	xor	r9,r13
+	shr	r8,8
+	movzx	r12,r12b
+	mov	edx,DWORD[4+rdi]
+	shr	r9,8
+	xor	r8,QWORD[((-128))+rbx*8+rbp]
+	shl	r10,56
+	xor	r9,QWORD[rbx*8+rbp]
+	rol	edx,8
+	xor	r8,QWORD[8+rax*1+rsi]
+	xor	r9,QWORD[rax*1+rsi]
+	mov	al,dl
+	xor	r8,r10
+	movzx	r12,WORD[r12*2+r11]
+	movzx	ebx,dl
+	shl	al,4
+	movzx	r13,BYTE[rcx*1+rsp]
+	shr	ebx,4
+	shl	r12,48
+	xor	r13,r8
+	mov	r10,r9
+	xor	r9,r12
+	shr	r8,8
+	movzx	r13,r13b
+	shr	r9,8
+	xor	r8,QWORD[((-128))+rcx*8+rbp]
+	shl	r10,56
+	xor	r9,QWORD[rcx*8+rbp]
+	rol	edx,8
+	xor	r8,QWORD[8+rax*1+rsi]
+	xor	r9,QWORD[rax*1+rsi]
+	mov	al,dl
+	xor	r8,r10
+	movzx	r13,WORD[r13*2+r11]
+	movzx	ecx,dl
+	shl	al,4
+	movzx	r12,BYTE[rbx*1+rsp]
+	shr	ecx,4
+	shl	r13,48
+	xor	r12,r8
+	mov	r10,r9
+	xor	r9,r13
+	shr	r8,8
+	movzx	r12,r12b
+	shr	r9,8
+	xor	r8,QWORD[((-128))+rbx*8+rbp]
+	shl	r10,56
+	xor	r9,QWORD[rbx*8+rbp]
+	rol	edx,8
+	xor	r8,QWORD[8+rax*1+rsi]
+	xor	r9,QWORD[rax*1+rsi]
+	mov	al,dl
+	xor	r8,r10
+	movzx	r12,WORD[r12*2+r11]
+	movzx	ebx,dl
+	shl	al,4
+	movzx	r13,BYTE[rcx*1+rsp]
+	shr	ebx,4
+	shl	r12,48
+	xor	r13,r8
+	mov	r10,r9
+	xor	r9,r12
+	shr	r8,8
+	movzx	r13,r13b
+	shr	r9,8
+	xor	r8,QWORD[((-128))+rcx*8+rbp]
+	shl	r10,56
+	xor	r9,QWORD[rcx*8+rbp]
+	rol	edx,8
+	xor	r8,QWORD[8+rax*1+rsi]
+	xor	r9,QWORD[rax*1+rsi]
+	mov	al,dl
+	xor	r8,r10
+	movzx	r13,WORD[r13*2+r11]
+	movzx	ecx,dl
+	shl	al,4
+	movzx	r12,BYTE[rbx*1+rsp]
+	shr	ecx,4
+	shl	r13,48
+	xor	r12,r8
+	mov	r10,r9
+	xor	r9,r13
+	shr	r8,8
+	movzx	r12,r12b
+	mov	edx,DWORD[rdi]
+	shr	r9,8
+	xor	r8,QWORD[((-128))+rbx*8+rbp]
+	shl	r10,56
+	xor	r9,QWORD[rbx*8+rbp]
+	rol	edx,8
+	xor	r8,QWORD[8+rax*1+rsi]
+	xor	r9,QWORD[rax*1+rsi]
+	mov	al,dl
+	xor	r8,r10
+	movzx	r12,WORD[r12*2+r11]
+	movzx	ebx,dl
+	shl	al,4
+	movzx	r13,BYTE[rcx*1+rsp]
+	shr	ebx,4
+	shl	r12,48
+	xor	r13,r8
+	mov	r10,r9
+	xor	r9,r12
+	shr	r8,8
+	movzx	r13,r13b
+	shr	r9,8
+	xor	r8,QWORD[((-128))+rcx*8+rbp]
+	shl	r10,56
+	xor	r9,QWORD[rcx*8+rbp]
+	rol	edx,8
+	xor	r8,QWORD[8+rax*1+rsi]
+	xor	r9,QWORD[rax*1+rsi]
+	mov	al,dl
+	xor	r8,r10
+	movzx	r13,WORD[r13*2+r11]
+	movzx	ecx,dl
+	shl	al,4
+	movzx	r12,BYTE[rbx*1+rsp]
+	shr	ecx,4
+	shl	r13,48
+	xor	r12,r8
+	mov	r10,r9
+	xor	r9,r13
+	shr	r8,8
+	movzx	r12,r12b
+	shr	r9,8
+	xor	r8,QWORD[((-128))+rbx*8+rbp]
+	shl	r10,56
+	xor	r9,QWORD[rbx*8+rbp]
+	rol	edx,8
+	xor	r8,QWORD[8+rax*1+rsi]
+	xor	r9,QWORD[rax*1+rsi]
+	mov	al,dl
+	xor	r8,r10
+	movzx	r12,WORD[r12*2+r11]
+	movzx	ebx,dl
+	shl	al,4
+	movzx	r13,BYTE[rcx*1+rsp]
+	shr	ebx,4
+	shl	r12,48
+	xor	r13,r8
+	mov	r10,r9
+	xor	r9,r12
+	shr	r8,8
+	movzx	r13,r13b
+	shr	r9,8
+	xor	r8,QWORD[((-128))+rcx*8+rbp]
+	shl	r10,56
+	xor	r9,QWORD[rcx*8+rbp]
+	rol	edx,8
+	xor	r8,QWORD[8+rax*1+rsi]
+	xor	r9,QWORD[rax*1+rsi]
+	mov	al,dl
+	xor	r8,r10
+	movzx	r13,WORD[r13*2+r11]
+	movzx	ecx,dl
+	shl	al,4
+	movzx	r12,BYTE[rbx*1+rsp]
+	and	ecx,240
+	shl	r13,48
+	xor	r12,r8
+	mov	r10,r9
+	xor	r9,r13
+	shr	r8,8
+	movzx	r12,r12b
+	mov	edx,DWORD[((-4))+rdi]
+	shr	r9,8
+	xor	r8,QWORD[((-128))+rbx*8+rbp]
+	shl	r10,56
+	xor	r9,QWORD[rbx*8+rbp]
+	movzx	r12,WORD[r12*2+r11]
+	xor	r8,QWORD[8+rax*1+rsi]
+	xor	r9,QWORD[rax*1+rsi]
+	shl	r12,48
+	xor	r8,r10
+	xor	r9,r12
+	movzx	r13,r8b
+	shr	r8,4
+	mov	r10,r9
+	shl	r13b,4
+	shr	r9,4
+	xor	r8,QWORD[8+rcx*1+rsi]
+	movzx	r13,WORD[r13*2+r11]
+	shl	r10,60
+	xor	r9,QWORD[rcx*1+rsi]
+	xor	r8,r10
+	shl	r13,48
+	bswap	r8
+	xor	r9,r13
+	bswap	r9
+	cmp	r14,r15
+	jb	NEAR $L$outer_loop
+	mov	QWORD[8+rdi],r8
+	mov	QWORD[rdi],r9
+
+	lea	rsi,[280+rsp]
+	mov	r15,QWORD[rsi]
+	mov	r14,QWORD[8+rsi]
+	mov	r13,QWORD[16+rsi]
+	mov	r12,QWORD[24+rsi]
+	mov	rbp,QWORD[32+rsi]
+	mov	rbx,QWORD[40+rsi]
+	lea	rsp,[48+rsi]
+$L$ghash_epilogue:
+	mov	rdi,QWORD[8+rsp]	;WIN64 epilogue
+	mov	rsi,QWORD[16+rsp]
+	DB	0F3h,0C3h		;repret
+$L$SEH_end_gcm_ghash_4bit:
+global	gcm_init_clmul
+
+ALIGN	16
+gcm_init_clmul:
+$L$_init_clmul:
+$L$SEH_begin_gcm_init_clmul:
+
+DB	0x48,0x83,0xec,0x18
+DB	0x0f,0x29,0x34,0x24
+	movdqu	xmm2,XMMWORD[rdx]
+	pshufd	xmm2,xmm2,78
+
+
+	pshufd	xmm4,xmm2,255
+	movdqa	xmm3,xmm2
+	psllq	xmm2,1
+	pxor	xmm5,xmm5
+	psrlq	xmm3,63
+	pcmpgtd	xmm5,xmm4
+	pslldq	xmm3,8
+	por	xmm2,xmm3
+
+
+	pand	xmm5,XMMWORD[$L$0x1c2_polynomial]
+	pxor	xmm2,xmm5
+
+
+	pshufd	xmm6,xmm2,78
+	movdqa	xmm0,xmm2
+	pxor	xmm6,xmm2
+	movdqa	xmm1,xmm0
+	pshufd	xmm3,xmm0,78
+	pxor	xmm3,xmm0
+DB	102,15,58,68,194,0
+DB	102,15,58,68,202,17
+DB	102,15,58,68,222,0
+	pxor	xmm3,xmm0
+	pxor	xmm3,xmm1
+
+	movdqa	xmm4,xmm3
+	psrldq	xmm3,8
+	pslldq	xmm4,8
+	pxor	xmm1,xmm3
+	pxor	xmm0,xmm4
+
+	movdqa	xmm4,xmm0
+	movdqa	xmm3,xmm0
+	psllq	xmm0,5
+	pxor	xmm3,xmm0
+	psllq	xmm0,1
+	pxor	xmm0,xmm3
+	psllq	xmm0,57
+	movdqa	xmm3,xmm0
+	pslldq	xmm0,8
+	psrldq	xmm3,8
+	pxor	xmm0,xmm4
+	pxor	xmm1,xmm3
+
+
+	movdqa	xmm4,xmm0
+	psrlq	xmm0,1
+	pxor	xmm1,xmm4
+	pxor	xmm4,xmm0
+	psrlq	xmm0,5
+	pxor	xmm0,xmm4
+	psrlq	xmm0,1
+	pxor	xmm0,xmm1
+	pshufd	xmm3,xmm2,78
+	pshufd	xmm4,xmm0,78
+	pxor	xmm3,xmm2
+	movdqu	XMMWORD[rcx],xmm2
+	pxor	xmm4,xmm0
+	movdqu	XMMWORD[16+rcx],xmm0
+DB	102,15,58,15,227,8
+	movdqu	XMMWORD[32+rcx],xmm4
+	movdqa	xmm1,xmm0
+	pshufd	xmm3,xmm0,78
+	pxor	xmm3,xmm0
+DB	102,15,58,68,194,0
+DB	102,15,58,68,202,17
+DB	102,15,58,68,222,0
+	pxor	xmm3,xmm0
+	pxor	xmm3,xmm1
+
+	movdqa	xmm4,xmm3
+	psrldq	xmm3,8
+	pslldq	xmm4,8
+	pxor	xmm1,xmm3
+	pxor	xmm0,xmm4
+
+	movdqa	xmm4,xmm0
+	movdqa	xmm3,xmm0
+	psllq	xmm0,5
+	pxor	xmm3,xmm0
+	psllq	xmm0,1
+	pxor	xmm0,xmm3
+	psllq	xmm0,57
+	movdqa	xmm3,xmm0
+	pslldq	xmm0,8
+	psrldq	xmm3,8
+	pxor	xmm0,xmm4
+	pxor	xmm1,xmm3
+
+
+	movdqa	xmm4,xmm0
+	psrlq	xmm0,1
+	pxor	xmm1,xmm4
+	pxor	xmm4,xmm0
+	psrlq	xmm0,5
+	pxor	xmm0,xmm4
+	psrlq	xmm0,1
+	pxor	xmm0,xmm1
+	movdqa	xmm5,xmm0
+	movdqa	xmm1,xmm0
+	pshufd	xmm3,xmm0,78
+	pxor	xmm3,xmm0
+DB	102,15,58,68,194,0
+DB	102,15,58,68,202,17
+DB	102,15,58,68,222,0
+	pxor	xmm3,xmm0
+	pxor	xmm3,xmm1
+
+	movdqa	xmm4,xmm3
+	psrldq	xmm3,8
+	pslldq	xmm4,8
+	pxor	xmm1,xmm3
+	pxor	xmm0,xmm4
+
+	movdqa	xmm4,xmm0
+	movdqa	xmm3,xmm0
+	psllq	xmm0,5
+	pxor	xmm3,xmm0
+	psllq	xmm0,1
+	pxor	xmm0,xmm3
+	psllq	xmm0,57
+	movdqa	xmm3,xmm0
+	pslldq	xmm0,8
+	psrldq	xmm3,8
+	pxor	xmm0,xmm4
+	pxor	xmm1,xmm3
+
+
+	movdqa	xmm4,xmm0
+	psrlq	xmm0,1
+	pxor	xmm1,xmm4
+	pxor	xmm4,xmm0
+	psrlq	xmm0,5
+	pxor	xmm0,xmm4
+	psrlq	xmm0,1
+	pxor	xmm0,xmm1
+	pshufd	xmm3,xmm5,78
+	pshufd	xmm4,xmm0,78
+	pxor	xmm3,xmm5
+	movdqu	XMMWORD[48+rcx],xmm5
+	pxor	xmm4,xmm0
+	movdqu	XMMWORD[64+rcx],xmm0
+DB	102,15,58,15,227,8
+	movdqu	XMMWORD[80+rcx],xmm4
+	movaps	xmm6,XMMWORD[rsp]
+	lea	rsp,[24+rsp]
+$L$SEH_end_gcm_init_clmul:
+	DB	0F3h,0C3h		;repret
+
+global	gcm_gmult_clmul
+
+ALIGN	16
+gcm_gmult_clmul:
+$L$_gmult_clmul:
+	movdqu	xmm0,XMMWORD[rcx]
+	movdqa	xmm5,XMMWORD[$L$bswap_mask]
+	movdqu	xmm2,XMMWORD[rdx]
+	movdqu	xmm4,XMMWORD[32+rdx]
+DB	102,15,56,0,197
+	movdqa	xmm1,xmm0
+	pshufd	xmm3,xmm0,78
+	pxor	xmm3,xmm0
+DB	102,15,58,68,194,0
+DB	102,15,58,68,202,17
+DB	102,15,58,68,220,0
+	pxor	xmm3,xmm0
+	pxor	xmm3,xmm1
+
+	movdqa	xmm4,xmm3
+	psrldq	xmm3,8
+	pslldq	xmm4,8
+	pxor	xmm1,xmm3
+	pxor	xmm0,xmm4
+
+	movdqa	xmm4,xmm0
+	movdqa	xmm3,xmm0
+	psllq	xmm0,5
+	pxor	xmm3,xmm0
+	psllq	xmm0,1
+	pxor	xmm0,xmm3
+	psllq	xmm0,57
+	movdqa	xmm3,xmm0
+	pslldq	xmm0,8
+	psrldq	xmm3,8
+	pxor	xmm0,xmm4
+	pxor	xmm1,xmm3
+
+
+	movdqa	xmm4,xmm0
+	psrlq	xmm0,1
+	pxor	xmm1,xmm4
+	pxor	xmm4,xmm0
+	psrlq	xmm0,5
+	pxor	xmm0,xmm4
+	psrlq	xmm0,1
+	pxor	xmm0,xmm1
+DB	102,15,56,0,197
+	movdqu	XMMWORD[rcx],xmm0
+	DB	0F3h,0C3h		;repret
+
+global	gcm_ghash_clmul
+
+ALIGN	32
+gcm_ghash_clmul:
+$L$_ghash_clmul:
+	lea	rax,[((-136))+rsp]
+$L$SEH_begin_gcm_ghash_clmul:
+
+DB	0x48,0x8d,0x60,0xe0
+DB	0x0f,0x29,0x70,0xe0
+DB	0x0f,0x29,0x78,0xf0
+DB	0x44,0x0f,0x29,0x00
+DB	0x44,0x0f,0x29,0x48,0x10
+DB	0x44,0x0f,0x29,0x50,0x20
+DB	0x44,0x0f,0x29,0x58,0x30
+DB	0x44,0x0f,0x29,0x60,0x40
+DB	0x44,0x0f,0x29,0x68,0x50
+DB	0x44,0x0f,0x29,0x70,0x60
+DB	0x44,0x0f,0x29,0x78,0x70
+	movdqa	xmm10,XMMWORD[$L$bswap_mask]
+
+	movdqu	xmm0,XMMWORD[rcx]
+	movdqu	xmm2,XMMWORD[rdx]
+	movdqu	xmm7,XMMWORD[32+rdx]
+DB	102,65,15,56,0,194
+
+	sub	r9,0x10
+	jz	NEAR $L$odd_tail
+
+	movdqu	xmm6,XMMWORD[16+rdx]
+	mov	eax,DWORD[((OPENSSL_ia32cap_P+4))]
+	cmp	r9,0x30
+	jb	NEAR $L$skip4x
+
+	and	eax,71303168
+	cmp	eax,4194304
+	je	NEAR $L$skip4x
+
+	sub	r9,0x30
+	mov	rax,0xA040608020C0E000
+	movdqu	xmm14,XMMWORD[48+rdx]
+	movdqu	xmm15,XMMWORD[64+rdx]
+
+
+
+
+	movdqu	xmm3,XMMWORD[48+r8]
+	movdqu	xmm11,XMMWORD[32+r8]
+DB	102,65,15,56,0,218
+DB	102,69,15,56,0,218
+	movdqa	xmm5,xmm3
+	pshufd	xmm4,xmm3,78
+	pxor	xmm4,xmm3
+DB	102,15,58,68,218,0
+DB	102,15,58,68,234,17
+DB	102,15,58,68,231,0
+
+	movdqa	xmm13,xmm11
+	pshufd	xmm12,xmm11,78
+	pxor	xmm12,xmm11
+DB	102,68,15,58,68,222,0
+DB	102,68,15,58,68,238,17
+DB	102,68,15,58,68,231,16
+	xorps	xmm3,xmm11
+	xorps	xmm5,xmm13
+	movups	xmm7,XMMWORD[80+rdx]
+	xorps	xmm4,xmm12
+
+	movdqu	xmm11,XMMWORD[16+r8]
+	movdqu	xmm8,XMMWORD[r8]
+DB	102,69,15,56,0,218
+DB	102,69,15,56,0,194
+	movdqa	xmm13,xmm11
+	pshufd	xmm12,xmm11,78
+	pxor	xmm0,xmm8
+	pxor	xmm12,xmm11
+DB	102,69,15,58,68,222,0
+	movdqa	xmm1,xmm0
+	pshufd	xmm8,xmm0,78
+	pxor	xmm8,xmm0
+DB	102,69,15,58,68,238,17
+DB	102,68,15,58,68,231,0
+	xorps	xmm3,xmm11
+	xorps	xmm5,xmm13
+
+	lea	r8,[64+r8]
+	sub	r9,0x40
+	jc	NEAR $L$tail4x
+
+	jmp	NEAR $L$mod4_loop
+ALIGN	32
+$L$mod4_loop:
+DB	102,65,15,58,68,199,0
+	xorps	xmm4,xmm12
+	movdqu	xmm11,XMMWORD[48+r8]
+DB	102,69,15,56,0,218
+DB	102,65,15,58,68,207,17
+	xorps	xmm0,xmm3
+	movdqu	xmm3,XMMWORD[32+r8]
+	movdqa	xmm13,xmm11
+DB	102,68,15,58,68,199,16
+	pshufd	xmm12,xmm11,78
+	xorps	xmm1,xmm5
+	pxor	xmm12,xmm11
+DB	102,65,15,56,0,218
+	movups	xmm7,XMMWORD[32+rdx]
+	xorps	xmm8,xmm4
+DB	102,68,15,58,68,218,0
+	pshufd	xmm4,xmm3,78
+
+	pxor	xmm8,xmm0
+	movdqa	xmm5,xmm3
+	pxor	xmm8,xmm1
+	pxor	xmm4,xmm3
+	movdqa	xmm9,xmm8
+DB	102,68,15,58,68,234,17
+	pslldq	xmm8,8
+	psrldq	xmm9,8
+	pxor	xmm0,xmm8
+	movdqa	xmm8,XMMWORD[$L$7_mask]
+	pxor	xmm1,xmm9
+DB	102,76,15,110,200
+
+	pand	xmm8,xmm0
+DB	102,69,15,56,0,200
+	pxor	xmm9,xmm0
+DB	102,68,15,58,68,231,0
+	psllq	xmm9,57
+	movdqa	xmm8,xmm9
+	pslldq	xmm9,8
+DB	102,15,58,68,222,0
+	psrldq	xmm8,8
+	pxor	xmm0,xmm9
+	pxor	xmm1,xmm8
+	movdqu	xmm8,XMMWORD[r8]
+
+	movdqa	xmm9,xmm0
+	psrlq	xmm0,1
+DB	102,15,58,68,238,17
+	xorps	xmm3,xmm11
+	movdqu	xmm11,XMMWORD[16+r8]
+DB	102,69,15,56,0,218
+DB	102,15,58,68,231,16
+	xorps	xmm5,xmm13
+	movups	xmm7,XMMWORD[80+rdx]
+DB	102,69,15,56,0,194
+	pxor	xmm1,xmm9
+	pxor	xmm9,xmm0
+	psrlq	xmm0,5
+
+	movdqa	xmm13,xmm11
+	pxor	xmm4,xmm12
+	pshufd	xmm12,xmm11,78
+	pxor	xmm0,xmm9
+	pxor	xmm1,xmm8
+	pxor	xmm12,xmm11
+DB	102,69,15,58,68,222,0
+	psrlq	xmm0,1
+	pxor	xmm0,xmm1
+	movdqa	xmm1,xmm0
+DB	102,69,15,58,68,238,17
+	xorps	xmm3,xmm11
+	pshufd	xmm8,xmm0,78
+	pxor	xmm8,xmm0
+
+DB	102,68,15,58,68,231,0
+	xorps	xmm5,xmm13
+
+	lea	r8,[64+r8]
+	sub	r9,0x40
+	jnc	NEAR $L$mod4_loop
+
+$L$tail4x:
+DB	102,65,15,58,68,199,0
+DB	102,65,15,58,68,207,17
+DB	102,68,15,58,68,199,16
+	xorps	xmm4,xmm12
+	xorps	xmm0,xmm3
+	xorps	xmm1,xmm5
+	pxor	xmm1,xmm0
+	pxor	xmm8,xmm4
+
+	pxor	xmm8,xmm1
+	pxor	xmm1,xmm0
+
+	movdqa	xmm9,xmm8
+	psrldq	xmm8,8
+	pslldq	xmm9,8
+	pxor	xmm1,xmm8
+	pxor	xmm0,xmm9
+
+	movdqa	xmm4,xmm0
+	movdqa	xmm3,xmm0
+	psllq	xmm0,5
+	pxor	xmm3,xmm0
+	psllq	xmm0,1
+	pxor	xmm0,xmm3
+	psllq	xmm0,57
+	movdqa	xmm3,xmm0
+	pslldq	xmm0,8
+	psrldq	xmm3,8
+	pxor	xmm0,xmm4
+	pxor	xmm1,xmm3
+
+
+	movdqa	xmm4,xmm0
+	psrlq	xmm0,1
+	pxor	xmm1,xmm4
+	pxor	xmm4,xmm0
+	psrlq	xmm0,5
+	pxor	xmm0,xmm4
+	psrlq	xmm0,1
+	pxor	xmm0,xmm1
+	add	r9,0x40
+	jz	NEAR $L$done
+	movdqu	xmm7,XMMWORD[32+rdx]
+	sub	r9,0x10
+	jz	NEAR $L$odd_tail
+$L$skip4x:
+
+
+
+
+
+	movdqu	xmm8,XMMWORD[r8]
+	movdqu	xmm3,XMMWORD[16+r8]
+DB	102,69,15,56,0,194
+DB	102,65,15,56,0,218
+	pxor	xmm0,xmm8
+
+	movdqa	xmm5,xmm3
+	pshufd	xmm4,xmm3,78
+	pxor	xmm4,xmm3
+DB	102,15,58,68,218,0
+DB	102,15,58,68,234,17
+DB	102,15,58,68,231,0
+
+	lea	r8,[32+r8]
+	nop
+	sub	r9,0x20
+	jbe	NEAR $L$even_tail
+	nop
+	jmp	NEAR $L$mod_loop
+
+ALIGN	32
+$L$mod_loop:
+	movdqa	xmm1,xmm0
+	movdqa	xmm8,xmm4
+	pshufd	xmm4,xmm0,78
+	pxor	xmm4,xmm0
+
+DB	102,15,58,68,198,0
+DB	102,15,58,68,206,17
+DB	102,15,58,68,231,16
+
+	pxor	xmm0,xmm3
+	pxor	xmm1,xmm5
+	movdqu	xmm9,XMMWORD[r8]
+	pxor	xmm8,xmm0
+DB	102,69,15,56,0,202
+	movdqu	xmm3,XMMWORD[16+r8]
+
+	pxor	xmm8,xmm1
+	pxor	xmm1,xmm9
+	pxor	xmm4,xmm8
+DB	102,65,15,56,0,218
+	movdqa	xmm8,xmm4
+	psrldq	xmm8,8
+	pslldq	xmm4,8
+	pxor	xmm1,xmm8
+	pxor	xmm0,xmm4
+
+	movdqa	xmm5,xmm3
+
+	movdqa	xmm9,xmm0
+	movdqa	xmm8,xmm0
+	psllq	xmm0,5
+	pxor	xmm8,xmm0
+DB	102,15,58,68,218,0
+	psllq	xmm0,1
+	pxor	xmm0,xmm8
+	psllq	xmm0,57
+	movdqa	xmm8,xmm0
+	pslldq	xmm0,8
+	psrldq	xmm8,8
+	pxor	xmm0,xmm9
+	pshufd	xmm4,xmm5,78
+	pxor	xmm1,xmm8
+	pxor	xmm4,xmm5
+
+	movdqa	xmm9,xmm0
+	psrlq	xmm0,1
+DB	102,15,58,68,234,17
+	pxor	xmm1,xmm9
+	pxor	xmm9,xmm0
+	psrlq	xmm0,5
+	pxor	xmm0,xmm9
+	lea	r8,[32+r8]
+	psrlq	xmm0,1
+DB	102,15,58,68,231,0
+	pxor	xmm0,xmm1
+
+	sub	r9,0x20
+	ja	NEAR $L$mod_loop
+
+$L$even_tail:
+	movdqa	xmm1,xmm0
+	movdqa	xmm8,xmm4
+	pshufd	xmm4,xmm0,78
+	pxor	xmm4,xmm0
+
+DB	102,15,58,68,198,0
+DB	102,15,58,68,206,17
+DB	102,15,58,68,231,16
+
+	pxor	xmm0,xmm3
+	pxor	xmm1,xmm5
+	pxor	xmm8,xmm0
+	pxor	xmm8,xmm1
+	pxor	xmm4,xmm8
+	movdqa	xmm8,xmm4
+	psrldq	xmm8,8
+	pslldq	xmm4,8
+	pxor	xmm1,xmm8
+	pxor	xmm0,xmm4
+
+	movdqa	xmm4,xmm0
+	movdqa	xmm3,xmm0
+	psllq	xmm0,5
+	pxor	xmm3,xmm0
+	psllq	xmm0,1
+	pxor	xmm0,xmm3
+	psllq	xmm0,57
+	movdqa	xmm3,xmm0
+	pslldq	xmm0,8
+	psrldq	xmm3,8
+	pxor	xmm0,xmm4
+	pxor	xmm1,xmm3
+
+
+	movdqa	xmm4,xmm0
+	psrlq	xmm0,1
+	pxor	xmm1,xmm4
+	pxor	xmm4,xmm0
+	psrlq	xmm0,5
+	pxor	xmm0,xmm4
+	psrlq	xmm0,1
+	pxor	xmm0,xmm1
+	test	r9,r9
+	jnz	NEAR $L$done
+
+$L$odd_tail:
+	movdqu	xmm8,XMMWORD[r8]
+DB	102,69,15,56,0,194
+	pxor	xmm0,xmm8
+	movdqa	xmm1,xmm0
+	pshufd	xmm3,xmm0,78
+	pxor	xmm3,xmm0
+DB	102,15,58,68,194,0
+DB	102,15,58,68,202,17
+DB	102,15,58,68,223,0
+	pxor	xmm3,xmm0
+	pxor	xmm3,xmm1
+
+	movdqa	xmm4,xmm3
+	psrldq	xmm3,8
+	pslldq	xmm4,8
+	pxor	xmm1,xmm3
+	pxor	xmm0,xmm4
+
+	movdqa	xmm4,xmm0
+	movdqa	xmm3,xmm0
+	psllq	xmm0,5
+	pxor	xmm3,xmm0
+	psllq	xmm0,1
+	pxor	xmm0,xmm3
+	psllq	xmm0,57
+	movdqa	xmm3,xmm0
+	pslldq	xmm0,8
+	psrldq	xmm3,8
+	pxor	xmm0,xmm4
+	pxor	xmm1,xmm3
+
+
+	movdqa	xmm4,xmm0
+	psrlq	xmm0,1
+	pxor	xmm1,xmm4
+	pxor	xmm4,xmm0
+	psrlq	xmm0,5
+	pxor	xmm0,xmm4
+	psrlq	xmm0,1
+	pxor	xmm0,xmm1
+$L$done:
+DB	102,65,15,56,0,194
+	movdqu	XMMWORD[rcx],xmm0
+	movaps	xmm6,XMMWORD[rsp]
+	movaps	xmm7,XMMWORD[16+rsp]
+	movaps	xmm8,XMMWORD[32+rsp]
+	movaps	xmm9,XMMWORD[48+rsp]
+	movaps	xmm10,XMMWORD[64+rsp]
+	movaps	xmm11,XMMWORD[80+rsp]
+	movaps	xmm12,XMMWORD[96+rsp]
+	movaps	xmm13,XMMWORD[112+rsp]
+	movaps	xmm14,XMMWORD[128+rsp]
+	movaps	xmm15,XMMWORD[144+rsp]
+	lea	rsp,[168+rsp]
+$L$SEH_end_gcm_ghash_clmul:
+	DB	0F3h,0C3h		;repret
+
+global	gcm_init_avx
+
+ALIGN	32
+gcm_init_avx:
+	jmp	NEAR $L$_init_clmul
+
+global	gcm_gmult_avx
+
+ALIGN	32
+gcm_gmult_avx:
+	jmp	NEAR $L$_gmult_clmul
+
+global	gcm_ghash_avx
+
+ALIGN	32
+gcm_ghash_avx:
+	jmp	NEAR $L$_ghash_clmul
+
+ALIGN	64
+$L$bswap_mask:
+DB	15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0
+$L$0x1c2_polynomial:
+DB	1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0xc2
+$L$7_mask:
+	DD	7,0,7,0
+$L$7_mask_poly:
+	DD	7,0,450,0
+ALIGN	64
+
+$L$rem_4bit:
+	DD	0,0,0,471859200,0,943718400,0,610271232
+	DD	0,1887436800,0,1822425088,0,1220542464,0,1423966208
+	DD	0,3774873600,0,4246732800,0,3644850176,0,3311403008
+	DD	0,2441084928,0,2376073216,0,2847932416,0,3051356160
+
+$L$rem_8bit:
+	DW	0x0000,0x01C2,0x0384,0x0246,0x0708,0x06CA,0x048C,0x054E
+	DW	0x0E10,0x0FD2,0x0D94,0x0C56,0x0918,0x08DA,0x0A9C,0x0B5E
+	DW	0x1C20,0x1DE2,0x1FA4,0x1E66,0x1B28,0x1AEA,0x18AC,0x196E
+	DW	0x1230,0x13F2,0x11B4,0x1076,0x1538,0x14FA,0x16BC,0x177E
+	DW	0x3840,0x3982,0x3BC4,0x3A06,0x3F48,0x3E8A,0x3CCC,0x3D0E
+	DW	0x3650,0x3792,0x35D4,0x3416,0x3158,0x309A,0x32DC,0x331E
+	DW	0x2460,0x25A2,0x27E4,0x2626,0x2368,0x22AA,0x20EC,0x212E
+	DW	0x2A70,0x2BB2,0x29F4,0x2836,0x2D78,0x2CBA,0x2EFC,0x2F3E
+	DW	0x7080,0x7142,0x7304,0x72C6,0x7788,0x764A,0x740C,0x75CE
+	DW	0x7E90,0x7F52,0x7D14,0x7CD6,0x7998,0x785A,0x7A1C,0x7BDE
+	DW	0x6CA0,0x6D62,0x6F24,0x6EE6,0x6BA8,0x6A6A,0x682C,0x69EE
+	DW	0x62B0,0x6372,0x6134,0x60F6,0x65B8,0x647A,0x663C,0x67FE
+	DW	0x48C0,0x4902,0x4B44,0x4A86,0x4FC8,0x4E0A,0x4C4C,0x4D8E
+	DW	0x46D0,0x4712,0x4554,0x4496,0x41D8,0x401A,0x425C,0x439E
+	DW	0x54E0,0x5522,0x5764,0x56A6,0x53E8,0x522A,0x506C,0x51AE
+	DW	0x5AF0,0x5B32,0x5974,0x58B6,0x5DF8,0x5C3A,0x5E7C,0x5FBE
+	DW	0xE100,0xE0C2,0xE284,0xE346,0xE608,0xE7CA,0xE58C,0xE44E
+	DW	0xEF10,0xEED2,0xEC94,0xED56,0xE818,0xE9DA,0xEB9C,0xEA5E
+	DW	0xFD20,0xFCE2,0xFEA4,0xFF66,0xFA28,0xFBEA,0xF9AC,0xF86E
+	DW	0xF330,0xF2F2,0xF0B4,0xF176,0xF438,0xF5FA,0xF7BC,0xF67E
+	DW	0xD940,0xD882,0xDAC4,0xDB06,0xDE48,0xDF8A,0xDDCC,0xDC0E
+	DW	0xD750,0xD692,0xD4D4,0xD516,0xD058,0xD19A,0xD3DC,0xD21E
+	DW	0xC560,0xC4A2,0xC6E4,0xC726,0xC268,0xC3AA,0xC1EC,0xC02E
+	DW	0xCB70,0xCAB2,0xC8F4,0xC936,0xCC78,0xCDBA,0xCFFC,0xCE3E
+	DW	0x9180,0x9042,0x9204,0x93C6,0x9688,0x974A,0x950C,0x94CE
+	DW	0x9F90,0x9E52,0x9C14,0x9DD6,0x9898,0x995A,0x9B1C,0x9ADE
+	DW	0x8DA0,0x8C62,0x8E24,0x8FE6,0x8AA8,0x8B6A,0x892C,0x88EE
+	DW	0x83B0,0x8272,0x8034,0x81F6,0x84B8,0x857A,0x873C,0x86FE
+	DW	0xA9C0,0xA802,0xAA44,0xAB86,0xAEC8,0xAF0A,0xAD4C,0xAC8E
+	DW	0xA7D0,0xA612,0xA454,0xA596,0xA0D8,0xA11A,0xA35C,0xA29E
+	DW	0xB5E0,0xB422,0xB664,0xB7A6,0xB2E8,0xB32A,0xB16C,0xB0AE
+	DW	0xBBF0,0xBA32,0xB874,0xB9B6,0xBCF8,0xBD3A,0xBF7C,0xBEBE
+
+DB	71,72,65,83,72,32,102,111,114,32,120,56,54,95,54,52
+DB	44,32,67,82,89,80,84,79,71,65,77,83,32,98,121,32
+DB	60,97,112,112,114,111,64,111,112,101,110,115,115,108,46,111
+DB	114,103,62,0
+ALIGN	64
+EXTERN	__imp_RtlVirtualUnwind
+
+ALIGN	16
+se_handler:
+	push	rsi
+	push	rdi
+	push	rbx
+	push	rbp
+	push	r12
+	push	r13
+	push	r14
+	push	r15
+	pushfq
+	sub	rsp,64
+
+	mov	rax,QWORD[120+r8]
+	mov	rbx,QWORD[248+r8]
+
+	mov	rsi,QWORD[8+r9]
+	mov	r11,QWORD[56+r9]
+
+	mov	r10d,DWORD[r11]
+	lea	r10,[r10*1+rsi]
+	cmp	rbx,r10
+	jb	NEAR $L$in_prologue
+
+	mov	rax,QWORD[152+r8]
+
+	mov	r10d,DWORD[4+r11]
+	lea	r10,[r10*1+rsi]
+	cmp	rbx,r10
+	jae	NEAR $L$in_prologue
+
+	lea	rax,[24+rax]
+
+	mov	rbx,QWORD[((-8))+rax]
+	mov	rbp,QWORD[((-16))+rax]
+	mov	r12,QWORD[((-24))+rax]
+	mov	QWORD[144+r8],rbx
+	mov	QWORD[160+r8],rbp
+	mov	QWORD[216+r8],r12
+
+$L$in_prologue:
+	mov	rdi,QWORD[8+rax]
+	mov	rsi,QWORD[16+rax]
+	mov	QWORD[152+r8],rax
+	mov	QWORD[168+r8],rsi
+	mov	QWORD[176+r8],rdi
+
+	mov	rdi,QWORD[40+r9]
+	mov	rsi,r8
+	mov	ecx,154
+	DD	0xa548f3fc
+
+	mov	rsi,r9
+	xor	rcx,rcx
+	mov	rdx,QWORD[8+rsi]
+	mov	r8,QWORD[rsi]
+	mov	r9,QWORD[16+rsi]
+	mov	r10,QWORD[40+rsi]
+	lea	r11,[56+rsi]
+	lea	r12,[24+rsi]
+	mov	QWORD[32+rsp],r10
+	mov	QWORD[40+rsp],r11
+	mov	QWORD[48+rsp],r12
+	mov	QWORD[56+rsp],rcx
+	call	QWORD[__imp_RtlVirtualUnwind]
+
+	mov	eax,1
+	add	rsp,64
+	popfq
+	pop	r15
+	pop	r14
+	pop	r13
+	pop	r12
+	pop	rbp
+	pop	rbx
+	pop	rdi
+	pop	rsi
+	DB	0F3h,0C3h		;repret
+
+
+section	.pdata rdata align=4
+ALIGN	4
+	DD	$L$SEH_begin_gcm_gmult_4bit wrt ..imagebase
+	DD	$L$SEH_end_gcm_gmult_4bit wrt ..imagebase
+	DD	$L$SEH_info_gcm_gmult_4bit wrt ..imagebase
+
+	DD	$L$SEH_begin_gcm_ghash_4bit wrt ..imagebase
+	DD	$L$SEH_end_gcm_ghash_4bit wrt ..imagebase
+	DD	$L$SEH_info_gcm_ghash_4bit wrt ..imagebase
+
+	DD	$L$SEH_begin_gcm_init_clmul wrt ..imagebase
+	DD	$L$SEH_end_gcm_init_clmul wrt ..imagebase
+	DD	$L$SEH_info_gcm_init_clmul wrt ..imagebase
+
+	DD	$L$SEH_begin_gcm_ghash_clmul wrt ..imagebase
+	DD	$L$SEH_end_gcm_ghash_clmul wrt ..imagebase
+	DD	$L$SEH_info_gcm_ghash_clmul wrt ..imagebase
+section	.xdata rdata align=8
+ALIGN	8
+$L$SEH_info_gcm_gmult_4bit:
+DB	9,0,0,0
+	DD	se_handler wrt ..imagebase
+	DD	$L$gmult_prologue wrt ..imagebase,$L$gmult_epilogue wrt ..imagebase
+$L$SEH_info_gcm_ghash_4bit:
+DB	9,0,0,0
+	DD	se_handler wrt ..imagebase
+	DD	$L$ghash_prologue wrt ..imagebase,$L$ghash_epilogue wrt ..imagebase
+$L$SEH_info_gcm_init_clmul:
+DB	0x01,0x08,0x03,0x00
+DB	0x08,0x68,0x00,0x00
+DB	0x04,0x22,0x00,0x00
+$L$SEH_info_gcm_ghash_clmul:
+DB	0x01,0x33,0x16,0x00
+DB	0x33,0xf8,0x09,0x00
+DB	0x2e,0xe8,0x08,0x00
+DB	0x29,0xd8,0x07,0x00
+DB	0x24,0xc8,0x06,0x00
+DB	0x1f,0xb8,0x05,0x00
+DB	0x1a,0xa8,0x04,0x00
+DB	0x15,0x98,0x03,0x00
+DB	0x10,0x88,0x02,0x00
+DB	0x0c,0x78,0x01,0x00
+DB	0x08,0x68,0x00,0x00
+DB	0x04,0x01,0x15,0x00
diff --git a/third_party/boringssl/win-x86_64/crypto/rand/rdrand-x86_64.asm b/third_party/boringssl/win-x86_64/crypto/rand/rdrand-x86_64.asm
new file mode 100644
index 0000000..4c03791
--- /dev/null
+++ b/third_party/boringssl/win-x86_64/crypto/rand/rdrand-x86_64.asm
@@ -0,0 +1,70 @@
+default	rel
+%define XMMWORD
+%define YMMWORD
+%define ZMMWORD
+section	.text code align=64
+
+
+
+
+
+global	CRYPTO_rdrand
+
+ALIGN	16
+CRYPTO_rdrand:
+	mov	QWORD[8+rsp],rdi	;WIN64 prologue
+	mov	QWORD[16+rsp],rsi
+	mov	rax,rsp
+$L$SEH_begin_CRYPTO_rdrand:
+	mov	rdi,rcx
+
+
+	xor	rax,rax
+
+
+DB	0x48,0x0f,0xc7,0xf1
+
+	adc	rax,rax
+	mov	QWORD[rdi],rcx
+	mov	rdi,QWORD[8+rsp]	;WIN64 epilogue
+	mov	rsi,QWORD[16+rsp]
+	DB	0F3h,0C3h		;repret
+
+
+
+
+
+global	CRYPTO_rdrand_multiple8_buf
+
+ALIGN	16
+CRYPTO_rdrand_multiple8_buf:
+	mov	QWORD[8+rsp],rdi	;WIN64 prologue
+	mov	QWORD[16+rsp],rsi
+	mov	rax,rsp
+$L$SEH_begin_CRYPTO_rdrand_multiple8_buf:
+	mov	rdi,rcx
+	mov	rsi,rdx
+
+
+	test	rsi,rsi
+	jz	NEAR $L$out
+	mov	rdx,8
+$L$loop:
+
+
+DB	0x48,0x0f,0xc7,0xf1
+	jnc	NEAR $L$err
+	mov	QWORD[rdi],rcx
+	add	rdi,rdx
+	sub	rsi,rdx
+	jnz	NEAR $L$loop
+$L$out:
+	mov	rax,1
+	mov	rdi,QWORD[8+rsp]	;WIN64 epilogue
+	mov	rsi,QWORD[16+rsp]
+	DB	0F3h,0C3h		;repret
+$L$err:
+	xor	rax,rax
+	mov	rdi,QWORD[8+rsp]	;WIN64 epilogue
+	mov	rsi,QWORD[16+rsp]
+	DB	0F3h,0C3h		;repret
diff --git a/third_party/boringssl/win-x86_64/crypto/rc4/rc4-md5-x86_64.asm b/third_party/boringssl/win-x86_64/crypto/rc4/rc4-md5-x86_64.asm
new file mode 100644
index 0000000..f1ea965
--- /dev/null
+++ b/third_party/boringssl/win-x86_64/crypto/rc4/rc4-md5-x86_64.asm
@@ -0,0 +1,1372 @@
+default	rel
+%define XMMWORD
+%define YMMWORD
+%define ZMMWORD
+section	.text code align=64
+
+ALIGN	16
+
+global	rc4_md5_enc
+
+rc4_md5_enc:
+	mov	QWORD[8+rsp],rdi	;WIN64 prologue
+	mov	QWORD[16+rsp],rsi
+	mov	rax,rsp
+$L$SEH_begin_rc4_md5_enc:
+	mov	rdi,rcx
+	mov	rsi,rdx
+	mov	rdx,r8
+	mov	rcx,r9
+	mov	r8,QWORD[40+rsp]
+	mov	r9,QWORD[48+rsp]
+
+
+	cmp	r9,0
+	je	NEAR $L$abort
+	push	rbx
+	push	rbp
+	push	r12
+	push	r13
+	push	r14
+	push	r15
+	sub	rsp,40
+$L$body:
+	mov	r11,rcx
+	mov	r12,r9
+	mov	r13,rsi
+	mov	r14,rdx
+	mov	r15,r8
+	xor	rbp,rbp
+	xor	rcx,rcx
+
+	lea	rdi,[8+rdi]
+	mov	bpl,BYTE[((-8))+rdi]
+	mov	cl,BYTE[((-4))+rdi]
+
+	inc	bpl
+	sub	r14,r13
+	mov	eax,DWORD[rbp*4+rdi]
+	add	cl,al
+	lea	rsi,[rbp*4+rdi]
+	shl	r12,6
+	add	r12,r15
+	mov	QWORD[16+rsp],r12
+
+	mov	QWORD[24+rsp],r11
+	mov	r8d,DWORD[r11]
+	mov	r9d,DWORD[4+r11]
+	mov	r10d,DWORD[8+r11]
+	mov	r11d,DWORD[12+r11]
+	jmp	NEAR $L$oop
+
+ALIGN	16
+$L$oop:
+	mov	DWORD[rsp],r8d
+	mov	DWORD[4+rsp],r9d
+	mov	DWORD[8+rsp],r10d
+	mov	r12d,r11d
+	mov	DWORD[12+rsp],r11d
+	pxor	xmm0,xmm0
+	mov	edx,DWORD[rcx*4+rdi]
+	xor	r12d,r10d
+	mov	DWORD[rcx*4+rdi],eax
+	and	r12d,r9d
+	add	r8d,DWORD[r15]
+	add	al,dl
+	mov	ebx,DWORD[4+rsi]
+	add	r8d,3614090360
+	xor	r12d,r11d
+	movzx	eax,al
+	mov	DWORD[rsi],edx
+	add	r8d,r12d
+	add	cl,bl
+	rol	r8d,7
+	mov	r12d,r10d
+	movd	xmm0,DWORD[rax*4+rdi]
+
+	add	r8d,r9d
+	pxor	xmm1,xmm1
+	mov	edx,DWORD[rcx*4+rdi]
+	xor	r12d,r9d
+	mov	DWORD[rcx*4+rdi],ebx
+	and	r12d,r8d
+	add	r11d,DWORD[4+r15]
+	add	bl,dl
+	mov	eax,DWORD[8+rsi]
+	add	r11d,3905402710
+	xor	r12d,r10d
+	movzx	ebx,bl
+	mov	DWORD[4+rsi],edx
+	add	r11d,r12d
+	add	cl,al
+	rol	r11d,12
+	mov	r12d,r9d
+	movd	xmm1,DWORD[rbx*4+rdi]
+
+	add	r11d,r8d
+	mov	edx,DWORD[rcx*4+rdi]
+	xor	r12d,r8d
+	mov	DWORD[rcx*4+rdi],eax
+	and	r12d,r11d
+	add	r10d,DWORD[8+r15]
+	add	al,dl
+	mov	ebx,DWORD[12+rsi]
+	add	r10d,606105819
+	xor	r12d,r9d
+	movzx	eax,al
+	mov	DWORD[8+rsi],edx
+	add	r10d,r12d
+	add	cl,bl
+	rol	r10d,17
+	mov	r12d,r8d
+	pinsrw	xmm0,WORD[rax*4+rdi],1
+
+	add	r10d,r11d
+	mov	edx,DWORD[rcx*4+rdi]
+	xor	r12d,r11d
+	mov	DWORD[rcx*4+rdi],ebx
+	and	r12d,r10d
+	add	r9d,DWORD[12+r15]
+	add	bl,dl
+	mov	eax,DWORD[16+rsi]
+	add	r9d,3250441966
+	xor	r12d,r8d
+	movzx	ebx,bl
+	mov	DWORD[12+rsi],edx
+	add	r9d,r12d
+	add	cl,al
+	rol	r9d,22
+	mov	r12d,r11d
+	pinsrw	xmm1,WORD[rbx*4+rdi],1
+
+	add	r9d,r10d
+	mov	edx,DWORD[rcx*4+rdi]
+	xor	r12d,r10d
+	mov	DWORD[rcx*4+rdi],eax
+	and	r12d,r9d
+	add	r8d,DWORD[16+r15]
+	add	al,dl
+	mov	ebx,DWORD[20+rsi]
+	add	r8d,4118548399
+	xor	r12d,r11d
+	movzx	eax,al
+	mov	DWORD[16+rsi],edx
+	add	r8d,r12d
+	add	cl,bl
+	rol	r8d,7
+	mov	r12d,r10d
+	pinsrw	xmm0,WORD[rax*4+rdi],2
+
+	add	r8d,r9d
+	mov	edx,DWORD[rcx*4+rdi]
+	xor	r12d,r9d
+	mov	DWORD[rcx*4+rdi],ebx
+	and	r12d,r8d
+	add	r11d,DWORD[20+r15]
+	add	bl,dl
+	mov	eax,DWORD[24+rsi]
+	add	r11d,1200080426
+	xor	r12d,r10d
+	movzx	ebx,bl
+	mov	DWORD[20+rsi],edx
+	add	r11d,r12d
+	add	cl,al
+	rol	r11d,12
+	mov	r12d,r9d
+	pinsrw	xmm1,WORD[rbx*4+rdi],2
+
+	add	r11d,r8d
+	mov	edx,DWORD[rcx*4+rdi]
+	xor	r12d,r8d
+	mov	DWORD[rcx*4+rdi],eax
+	and	r12d,r11d
+	add	r10d,DWORD[24+r15]
+	add	al,dl
+	mov	ebx,DWORD[28+rsi]
+	add	r10d,2821735955
+	xor	r12d,r9d
+	movzx	eax,al
+	mov	DWORD[24+rsi],edx
+	add	r10d,r12d
+	add	cl,bl
+	rol	r10d,17
+	mov	r12d,r8d
+	pinsrw	xmm0,WORD[rax*4+rdi],3
+
+	add	r10d,r11d
+	mov	edx,DWORD[rcx*4+rdi]
+	xor	r12d,r11d
+	mov	DWORD[rcx*4+rdi],ebx
+	and	r12d,r10d
+	add	r9d,DWORD[28+r15]
+	add	bl,dl
+	mov	eax,DWORD[32+rsi]
+	add	r9d,4249261313
+	xor	r12d,r8d
+	movzx	ebx,bl
+	mov	DWORD[28+rsi],edx
+	add	r9d,r12d
+	add	cl,al
+	rol	r9d,22
+	mov	r12d,r11d
+	pinsrw	xmm1,WORD[rbx*4+rdi],3
+
+	add	r9d,r10d
+	mov	edx,DWORD[rcx*4+rdi]
+	xor	r12d,r10d
+	mov	DWORD[rcx*4+rdi],eax
+	and	r12d,r9d
+	add	r8d,DWORD[32+r15]
+	add	al,dl
+	mov	ebx,DWORD[36+rsi]
+	add	r8d,1770035416
+	xor	r12d,r11d
+	movzx	eax,al
+	mov	DWORD[32+rsi],edx
+	add	r8d,r12d
+	add	cl,bl
+	rol	r8d,7
+	mov	r12d,r10d
+	pinsrw	xmm0,WORD[rax*4+rdi],4
+
+	add	r8d,r9d
+	mov	edx,DWORD[rcx*4+rdi]
+	xor	r12d,r9d
+	mov	DWORD[rcx*4+rdi],ebx
+	and	r12d,r8d
+	add	r11d,DWORD[36+r15]
+	add	bl,dl
+	mov	eax,DWORD[40+rsi]
+	add	r11d,2336552879
+	xor	r12d,r10d
+	movzx	ebx,bl
+	mov	DWORD[36+rsi],edx
+	add	r11d,r12d
+	add	cl,al
+	rol	r11d,12
+	mov	r12d,r9d
+	pinsrw	xmm1,WORD[rbx*4+rdi],4
+
+	add	r11d,r8d
+	mov	edx,DWORD[rcx*4+rdi]
+	xor	r12d,r8d
+	mov	DWORD[rcx*4+rdi],eax
+	and	r12d,r11d
+	add	r10d,DWORD[40+r15]
+	add	al,dl
+	mov	ebx,DWORD[44+rsi]
+	add	r10d,4294925233
+	xor	r12d,r9d
+	movzx	eax,al
+	mov	DWORD[40+rsi],edx
+	add	r10d,r12d
+	add	cl,bl
+	rol	r10d,17
+	mov	r12d,r8d
+	pinsrw	xmm0,WORD[rax*4+rdi],5
+
+	add	r10d,r11d
+	mov	edx,DWORD[rcx*4+rdi]
+	xor	r12d,r11d
+	mov	DWORD[rcx*4+rdi],ebx
+	and	r12d,r10d
+	add	r9d,DWORD[44+r15]
+	add	bl,dl
+	mov	eax,DWORD[48+rsi]
+	add	r9d,2304563134
+	xor	r12d,r8d
+	movzx	ebx,bl
+	mov	DWORD[44+rsi],edx
+	add	r9d,r12d
+	add	cl,al
+	rol	r9d,22
+	mov	r12d,r11d
+	pinsrw	xmm1,WORD[rbx*4+rdi],5
+
+	add	r9d,r10d
+	mov	edx,DWORD[rcx*4+rdi]
+	xor	r12d,r10d
+	mov	DWORD[rcx*4+rdi],eax
+	and	r12d,r9d
+	add	r8d,DWORD[48+r15]
+	add	al,dl
+	mov	ebx,DWORD[52+rsi]
+	add	r8d,1804603682
+	xor	r12d,r11d
+	movzx	eax,al
+	mov	DWORD[48+rsi],edx
+	add	r8d,r12d
+	add	cl,bl
+	rol	r8d,7
+	mov	r12d,r10d
+	pinsrw	xmm0,WORD[rax*4+rdi],6
+
+	add	r8d,r9d
+	mov	edx,DWORD[rcx*4+rdi]
+	xor	r12d,r9d
+	mov	DWORD[rcx*4+rdi],ebx
+	and	r12d,r8d
+	add	r11d,DWORD[52+r15]
+	add	bl,dl
+	mov	eax,DWORD[56+rsi]
+	add	r11d,4254626195
+	xor	r12d,r10d
+	movzx	ebx,bl
+	mov	DWORD[52+rsi],edx
+	add	r11d,r12d
+	add	cl,al
+	rol	r11d,12
+	mov	r12d,r9d
+	pinsrw	xmm1,WORD[rbx*4+rdi],6
+
+	add	r11d,r8d
+	mov	edx,DWORD[rcx*4+rdi]
+	xor	r12d,r8d
+	mov	DWORD[rcx*4+rdi],eax
+	and	r12d,r11d
+	add	r10d,DWORD[56+r15]
+	add	al,dl
+	mov	ebx,DWORD[60+rsi]
+	add	r10d,2792965006
+	xor	r12d,r9d
+	movzx	eax,al
+	mov	DWORD[56+rsi],edx
+	add	r10d,r12d
+	add	cl,bl
+	rol	r10d,17
+	mov	r12d,r8d
+	pinsrw	xmm0,WORD[rax*4+rdi],7
+
+	add	r10d,r11d
+	movdqu	xmm2,XMMWORD[r13]
+	mov	edx,DWORD[rcx*4+rdi]
+	xor	r12d,r11d
+	mov	DWORD[rcx*4+rdi],ebx
+	and	r12d,r10d
+	add	r9d,DWORD[60+r15]
+	add	bl,dl
+	mov	eax,DWORD[64+rsi]
+	add	r9d,1236535329
+	xor	r12d,r8d
+	movzx	ebx,bl
+	mov	DWORD[60+rsi],edx
+	add	r9d,r12d
+	add	cl,al
+	rol	r9d,22
+	mov	r12d,r10d
+	pinsrw	xmm1,WORD[rbx*4+rdi],7
+
+	add	r9d,r10d
+	psllq	xmm1,8
+	pxor	xmm2,xmm0
+	pxor	xmm2,xmm1
+	pxor	xmm0,xmm0
+	mov	edx,DWORD[rcx*4+rdi]
+	xor	r12d,r9d
+	mov	DWORD[rcx*4+rdi],eax
+	and	r12d,r11d
+	add	r8d,DWORD[4+r15]
+	add	al,dl
+	mov	ebx,DWORD[68+rsi]
+	add	r8d,4129170786
+	xor	r12d,r10d
+	movzx	eax,al
+	mov	DWORD[64+rsi],edx
+	add	r8d,r12d
+	add	cl,bl
+	rol	r8d,5
+	mov	r12d,r9d
+	movd	xmm0,DWORD[rax*4+rdi]
+
+	add	r8d,r9d
+	pxor	xmm1,xmm1
+	mov	edx,DWORD[rcx*4+rdi]
+	xor	r12d,r8d
+	mov	DWORD[rcx*4+rdi],ebx
+	and	r12d,r10d
+	add	r11d,DWORD[24+r15]
+	add	bl,dl
+	mov	eax,DWORD[72+rsi]
+	add	r11d,3225465664
+	xor	r12d,r9d
+	movzx	ebx,bl
+	mov	DWORD[68+rsi],edx
+	add	r11d,r12d
+	add	cl,al
+	rol	r11d,9
+	mov	r12d,r8d
+	movd	xmm1,DWORD[rbx*4+rdi]
+
+	add	r11d,r8d
+	mov	edx,DWORD[rcx*4+rdi]
+	xor	r12d,r11d
+	mov	DWORD[rcx*4+rdi],eax
+	and	r12d,r9d
+	add	r10d,DWORD[44+r15]
+	add	al,dl
+	mov	ebx,DWORD[76+rsi]
+	add	r10d,643717713
+	xor	r12d,r8d
+	movzx	eax,al
+	mov	DWORD[72+rsi],edx
+	add	r10d,r12d
+	add	cl,bl
+	rol	r10d,14
+	mov	r12d,r11d
+	pinsrw	xmm0,WORD[rax*4+rdi],1
+
+	add	r10d,r11d
+	mov	edx,DWORD[rcx*4+rdi]
+	xor	r12d,r10d
+	mov	DWORD[rcx*4+rdi],ebx
+	and	r12d,r8d
+	add	r9d,DWORD[r15]
+	add	bl,dl
+	mov	eax,DWORD[80+rsi]
+	add	r9d,3921069994
+	xor	r12d,r11d
+	movzx	ebx,bl
+	mov	DWORD[76+rsi],edx
+	add	r9d,r12d
+	add	cl,al
+	rol	r9d,20
+	mov	r12d,r10d
+	pinsrw	xmm1,WORD[rbx*4+rdi],1
+
+	add	r9d,r10d
+	mov	edx,DWORD[rcx*4+rdi]
+	xor	r12d,r9d
+	mov	DWORD[rcx*4+rdi],eax
+	and	r12d,r11d
+	add	r8d,DWORD[20+r15]
+	add	al,dl
+	mov	ebx,DWORD[84+rsi]
+	add	r8d,3593408605
+	xor	r12d,r10d
+	movzx	eax,al
+	mov	DWORD[80+rsi],edx
+	add	r8d,r12d
+	add	cl,bl
+	rol	r8d,5
+	mov	r12d,r9d
+	pinsrw	xmm0,WORD[rax*4+rdi],2
+
+	add	r8d,r9d
+	mov	edx,DWORD[rcx*4+rdi]
+	xor	r12d,r8d
+	mov	DWORD[rcx*4+rdi],ebx
+	and	r12d,r10d
+	add	r11d,DWORD[40+r15]
+	add	bl,dl
+	mov	eax,DWORD[88+rsi]
+	add	r11d,38016083
+	xor	r12d,r9d
+	movzx	ebx,bl
+	mov	DWORD[84+rsi],edx
+	add	r11d,r12d
+	add	cl,al
+	rol	r11d,9
+	mov	r12d,r8d
+	pinsrw	xmm1,WORD[rbx*4+rdi],2
+
+	add	r11d,r8d
+	mov	edx,DWORD[rcx*4+rdi]
+	xor	r12d,r11d
+	mov	DWORD[rcx*4+rdi],eax
+	and	r12d,r9d
+	add	r10d,DWORD[60+r15]
+	add	al,dl
+	mov	ebx,DWORD[92+rsi]
+	add	r10d,3634488961
+	xor	r12d,r8d
+	movzx	eax,al
+	mov	DWORD[88+rsi],edx
+	add	r10d,r12d
+	add	cl,bl
+	rol	r10d,14
+	mov	r12d,r11d
+	pinsrw	xmm0,WORD[rax*4+rdi],3
+
+	add	r10d,r11d
+	mov	edx,DWORD[rcx*4+rdi]
+	xor	r12d,r10d
+	mov	DWORD[rcx*4+rdi],ebx
+	and	r12d,r8d
+	add	r9d,DWORD[16+r15]
+	add	bl,dl
+	mov	eax,DWORD[96+rsi]
+	add	r9d,3889429448
+	xor	r12d,r11d
+	movzx	ebx,bl
+	mov	DWORD[92+rsi],edx
+	add	r9d,r12d
+	add	cl,al
+	rol	r9d,20
+	mov	r12d,r10d
+	pinsrw	xmm1,WORD[rbx*4+rdi],3
+
+	add	r9d,r10d
+	mov	edx,DWORD[rcx*4+rdi]
+	xor	r12d,r9d
+	mov	DWORD[rcx*4+rdi],eax
+	and	r12d,r11d
+	add	r8d,DWORD[36+r15]
+	add	al,dl
+	mov	ebx,DWORD[100+rsi]
+	add	r8d,568446438
+	xor	r12d,r10d
+	movzx	eax,al
+	mov	DWORD[96+rsi],edx
+	add	r8d,r12d
+	add	cl,bl
+	rol	r8d,5
+	mov	r12d,r9d
+	pinsrw	xmm0,WORD[rax*4+rdi],4
+
+	add	r8d,r9d
+	mov	edx,DWORD[rcx*4+rdi]
+	xor	r12d,r8d
+	mov	DWORD[rcx*4+rdi],ebx
+	and	r12d,r10d
+	add	r11d,DWORD[56+r15]
+	add	bl,dl
+	mov	eax,DWORD[104+rsi]
+	add	r11d,3275163606
+	xor	r12d,r9d
+	movzx	ebx,bl
+	mov	DWORD[100+rsi],edx
+	add	r11d,r12d
+	add	cl,al
+	rol	r11d,9
+	mov	r12d,r8d
+	pinsrw	xmm1,WORD[rbx*4+rdi],4
+
+	add	r11d,r8d
+	mov	edx,DWORD[rcx*4+rdi]
+	xor	r12d,r11d
+	mov	DWORD[rcx*4+rdi],eax
+	and	r12d,r9d
+	add	r10d,DWORD[12+r15]
+	add	al,dl
+	mov	ebx,DWORD[108+rsi]
+	add	r10d,4107603335
+	xor	r12d,r8d
+	movzx	eax,al
+	mov	DWORD[104+rsi],edx
+	add	r10d,r12d
+	add	cl,bl
+	rol	r10d,14
+	mov	r12d,r11d
+	pinsrw	xmm0,WORD[rax*4+rdi],5
+
+	add	r10d,r11d
+	mov	edx,DWORD[rcx*4+rdi]
+	xor	r12d,r10d
+	mov	DWORD[rcx*4+rdi],ebx
+	and	r12d,r8d
+	add	r9d,DWORD[32+r15]
+	add	bl,dl
+	mov	eax,DWORD[112+rsi]
+	add	r9d,1163531501
+	xor	r12d,r11d
+	movzx	ebx,bl
+	mov	DWORD[108+rsi],edx
+	add	r9d,r12d
+	add	cl,al
+	rol	r9d,20
+	mov	r12d,r10d
+	pinsrw	xmm1,WORD[rbx*4+rdi],5
+
+	add	r9d,r10d
+	mov	edx,DWORD[rcx*4+rdi]
+	xor	r12d,r9d
+	mov	DWORD[rcx*4+rdi],eax
+	and	r12d,r11d
+	add	r8d,DWORD[52+r15]
+	add	al,dl
+	mov	ebx,DWORD[116+rsi]
+	add	r8d,2850285829
+	xor	r12d,r10d
+	movzx	eax,al
+	mov	DWORD[112+rsi],edx
+	add	r8d,r12d
+	add	cl,bl
+	rol	r8d,5
+	mov	r12d,r9d
+	pinsrw	xmm0,WORD[rax*4+rdi],6
+
+	add	r8d,r9d
+	mov	edx,DWORD[rcx*4+rdi]
+	xor	r12d,r8d
+	mov	DWORD[rcx*4+rdi],ebx
+	and	r12d,r10d
+	add	r11d,DWORD[8+r15]
+	add	bl,dl
+	mov	eax,DWORD[120+rsi]
+	add	r11d,4243563512
+	xor	r12d,r9d
+	movzx	ebx,bl
+	mov	DWORD[116+rsi],edx
+	add	r11d,r12d
+	add	cl,al
+	rol	r11d,9
+	mov	r12d,r8d
+	pinsrw	xmm1,WORD[rbx*4+rdi],6
+
+	add	r11d,r8d
+	mov	edx,DWORD[rcx*4+rdi]
+	xor	r12d,r11d
+	mov	DWORD[rcx*4+rdi],eax
+	and	r12d,r9d
+	add	r10d,DWORD[28+r15]
+	add	al,dl
+	mov	ebx,DWORD[124+rsi]
+	add	r10d,1735328473
+	xor	r12d,r8d
+	movzx	eax,al
+	mov	DWORD[120+rsi],edx
+	add	r10d,r12d
+	add	cl,bl
+	rol	r10d,14
+	mov	r12d,r11d
+	pinsrw	xmm0,WORD[rax*4+rdi],7
+
+	add	r10d,r11d
+	movdqu	xmm3,XMMWORD[16+r13]
+	add	bpl,32
+	mov	edx,DWORD[rcx*4+rdi]
+	xor	r12d,r10d
+	mov	DWORD[rcx*4+rdi],ebx
+	and	r12d,r8d
+	add	r9d,DWORD[48+r15]
+	add	bl,dl
+	mov	eax,DWORD[rbp*4+rdi]
+	add	r9d,2368359562
+	xor	r12d,r11d
+	movzx	ebx,bl
+	mov	DWORD[124+rsi],edx
+	add	r9d,r12d
+	add	cl,al
+	rol	r9d,20
+	mov	r12d,r11d
+	pinsrw	xmm1,WORD[rbx*4+rdi],7
+
+	add	r9d,r10d
+	mov	rsi,rcx
+	xor	rcx,rcx
+	mov	cl,sil
+	lea	rsi,[rbp*4+rdi]
+	psllq	xmm1,8
+	pxor	xmm3,xmm0
+	pxor	xmm3,xmm1
+	pxor	xmm0,xmm0
+	mov	edx,DWORD[rcx*4+rdi]
+	xor	r12d,r10d
+	mov	DWORD[rcx*4+rdi],eax
+	xor	r12d,r9d
+	add	r8d,DWORD[20+r15]
+	add	al,dl
+	mov	ebx,DWORD[4+rsi]
+	add	r8d,4294588738
+	movzx	eax,al
+	add	r8d,r12d
+	mov	DWORD[rsi],edx
+	add	cl,bl
+	rol	r8d,4
+	mov	r12d,r10d
+	movd	xmm0,DWORD[rax*4+rdi]
+
+	add	r8d,r9d
+	pxor	xmm1,xmm1
+	mov	edx,DWORD[rcx*4+rdi]
+	xor	r12d,r9d
+	mov	DWORD[rcx*4+rdi],ebx
+	xor	r12d,r8d
+	add	r11d,DWORD[32+r15]
+	add	bl,dl
+	mov	eax,DWORD[8+rsi]
+	add	r11d,2272392833
+	movzx	ebx,bl
+	add	r11d,r12d
+	mov	DWORD[4+rsi],edx
+	add	cl,al
+	rol	r11d,11
+	mov	r12d,r9d
+	movd	xmm1,DWORD[rbx*4+rdi]
+
+	add	r11d,r8d
+	mov	edx,DWORD[rcx*4+rdi]
+	xor	r12d,r8d
+	mov	DWORD[rcx*4+rdi],eax
+	xor	r12d,r11d
+	add	r10d,DWORD[44+r15]
+	add	al,dl
+	mov	ebx,DWORD[12+rsi]
+	add	r10d,1839030562
+	movzx	eax,al
+	add	r10d,r12d
+	mov	DWORD[8+rsi],edx
+	add	cl,bl
+	rol	r10d,16
+	mov	r12d,r8d
+	pinsrw	xmm0,WORD[rax*4+rdi],1
+
+	add	r10d,r11d
+	mov	edx,DWORD[rcx*4+rdi]
+	xor	r12d,r11d
+	mov	DWORD[rcx*4+rdi],ebx
+	xor	r12d,r10d
+	add	r9d,DWORD[56+r15]
+	add	bl,dl
+	mov	eax,DWORD[16+rsi]
+	add	r9d,4259657740
+	movzx	ebx,bl
+	add	r9d,r12d
+	mov	DWORD[12+rsi],edx
+	add	cl,al
+	rol	r9d,23
+	mov	r12d,r11d
+	pinsrw	xmm1,WORD[rbx*4+rdi],1
+
+	add	r9d,r10d
+	mov	edx,DWORD[rcx*4+rdi]
+	xor	r12d,r10d
+	mov	DWORD[rcx*4+rdi],eax
+	xor	r12d,r9d
+	add	r8d,DWORD[4+r15]
+	add	al,dl
+	mov	ebx,DWORD[20+rsi]
+	add	r8d,2763975236
+	movzx	eax,al
+	add	r8d,r12d
+	mov	DWORD[16+rsi],edx
+	add	cl,bl
+	rol	r8d,4
+	mov	r12d,r10d
+	pinsrw	xmm0,WORD[rax*4+rdi],2
+
+	add	r8d,r9d
+	mov	edx,DWORD[rcx*4+rdi]
+	xor	r12d,r9d
+	mov	DWORD[rcx*4+rdi],ebx
+	xor	r12d,r8d
+	add	r11d,DWORD[16+r15]
+	add	bl,dl
+	mov	eax,DWORD[24+rsi]
+	add	r11d,1272893353
+	movzx	ebx,bl
+	add	r11d,r12d
+	mov	DWORD[20+rsi],edx
+	add	cl,al
+	rol	r11d,11
+	mov	r12d,r9d
+	pinsrw	xmm1,WORD[rbx*4+rdi],2
+
+	add	r11d,r8d
+	mov	edx,DWORD[rcx*4+rdi]
+	xor	r12d,r8d
+	mov	DWORD[rcx*4+rdi],eax
+	xor	r12d,r11d
+	add	r10d,DWORD[28+r15]
+	add	al,dl
+	mov	ebx,DWORD[28+rsi]
+	add	r10d,4139469664
+	movzx	eax,al
+	add	r10d,r12d
+	mov	DWORD[24+rsi],edx
+	add	cl,bl
+	rol	r10d,16
+	mov	r12d,r8d
+	pinsrw	xmm0,WORD[rax*4+rdi],3
+
+	add	r10d,r11d
+	mov	edx,DWORD[rcx*4+rdi]
+	xor	r12d,r11d
+	mov	DWORD[rcx*4+rdi],ebx
+	xor	r12d,r10d
+	add	r9d,DWORD[40+r15]
+	add	bl,dl
+	mov	eax,DWORD[32+rsi]
+	add	r9d,3200236656
+	movzx	ebx,bl
+	add	r9d,r12d
+	mov	DWORD[28+rsi],edx
+	add	cl,al
+	rol	r9d,23
+	mov	r12d,r11d
+	pinsrw	xmm1,WORD[rbx*4+rdi],3
+
+	add	r9d,r10d
+	mov	edx,DWORD[rcx*4+rdi]
+	xor	r12d,r10d
+	mov	DWORD[rcx*4+rdi],eax
+	xor	r12d,r9d
+	add	r8d,DWORD[52+r15]
+	add	al,dl
+	mov	ebx,DWORD[36+rsi]
+	add	r8d,681279174
+	movzx	eax,al
+	add	r8d,r12d
+	mov	DWORD[32+rsi],edx
+	add	cl,bl
+	rol	r8d,4
+	mov	r12d,r10d
+	pinsrw	xmm0,WORD[rax*4+rdi],4
+
+	add	r8d,r9d
+	mov	edx,DWORD[rcx*4+rdi]
+	xor	r12d,r9d
+	mov	DWORD[rcx*4+rdi],ebx
+	xor	r12d,r8d
+	add	r11d,DWORD[r15]
+	add	bl,dl
+	mov	eax,DWORD[40+rsi]
+	add	r11d,3936430074
+	movzx	ebx,bl
+	add	r11d,r12d
+	mov	DWORD[36+rsi],edx
+	add	cl,al
+	rol	r11d,11
+	mov	r12d,r9d
+	pinsrw	xmm1,WORD[rbx*4+rdi],4
+
+	add	r11d,r8d
+	mov	edx,DWORD[rcx*4+rdi]
+	xor	r12d,r8d
+	mov	DWORD[rcx*4+rdi],eax
+	xor	r12d,r11d
+	add	r10d,DWORD[12+r15]
+	add	al,dl
+	mov	ebx,DWORD[44+rsi]
+	add	r10d,3572445317
+	movzx	eax,al
+	add	r10d,r12d
+	mov	DWORD[40+rsi],edx
+	add	cl,bl
+	rol	r10d,16
+	mov	r12d,r8d
+	pinsrw	xmm0,WORD[rax*4+rdi],5
+
+	add	r10d,r11d
+	mov	edx,DWORD[rcx*4+rdi]
+	xor	r12d,r11d
+	mov	DWORD[rcx*4+rdi],ebx
+	xor	r12d,r10d
+	add	r9d,DWORD[24+r15]
+	add	bl,dl
+	mov	eax,DWORD[48+rsi]
+	add	r9d,76029189
+	movzx	ebx,bl
+	add	r9d,r12d
+	mov	DWORD[44+rsi],edx
+	add	cl,al
+	rol	r9d,23
+	mov	r12d,r11d
+	pinsrw	xmm1,WORD[rbx*4+rdi],5
+
+	add	r9d,r10d
+	mov	edx,DWORD[rcx*4+rdi]
+	xor	r12d,r10d
+	mov	DWORD[rcx*4+rdi],eax
+	xor	r12d,r9d
+	add	r8d,DWORD[36+r15]
+	add	al,dl
+	mov	ebx,DWORD[52+rsi]
+	add	r8d,3654602809
+	movzx	eax,al
+	add	r8d,r12d
+	mov	DWORD[48+rsi],edx
+	add	cl,bl
+	rol	r8d,4
+	mov	r12d,r10d
+	pinsrw	xmm0,WORD[rax*4+rdi],6
+
+	add	r8d,r9d
+	mov	edx,DWORD[rcx*4+rdi]
+	xor	r12d,r9d
+	mov	DWORD[rcx*4+rdi],ebx
+	xor	r12d,r8d
+	add	r11d,DWORD[48+r15]
+	add	bl,dl
+	mov	eax,DWORD[56+rsi]
+	add	r11d,3873151461
+	movzx	ebx,bl
+	add	r11d,r12d
+	mov	DWORD[52+rsi],edx
+	add	cl,al
+	rol	r11d,11
+	mov	r12d,r9d
+	pinsrw	xmm1,WORD[rbx*4+rdi],6
+
+	add	r11d,r8d
+	mov	edx,DWORD[rcx*4+rdi]
+	xor	r12d,r8d
+	mov	DWORD[rcx*4+rdi],eax
+	xor	r12d,r11d
+	add	r10d,DWORD[60+r15]
+	add	al,dl
+	mov	ebx,DWORD[60+rsi]
+	add	r10d,530742520
+	movzx	eax,al
+	add	r10d,r12d
+	mov	DWORD[56+rsi],edx
+	add	cl,bl
+	rol	r10d,16
+	mov	r12d,r8d
+	pinsrw	xmm0,WORD[rax*4+rdi],7
+
+	add	r10d,r11d
+	movdqu	xmm4,XMMWORD[32+r13]
+	mov	edx,DWORD[rcx*4+rdi]
+	xor	r12d,r11d
+	mov	DWORD[rcx*4+rdi],ebx
+	xor	r12d,r10d
+	add	r9d,DWORD[8+r15]
+	add	bl,dl
+	mov	eax,DWORD[64+rsi]
+	add	r9d,3299628645
+	movzx	ebx,bl
+	add	r9d,r12d
+	mov	DWORD[60+rsi],edx
+	add	cl,al
+	rol	r9d,23
+	mov	r12d,-1
+	pinsrw	xmm1,WORD[rbx*4+rdi],7
+
+	add	r9d,r10d
+	psllq	xmm1,8
+	pxor	xmm4,xmm0
+	pxor	xmm4,xmm1
+	pxor	xmm0,xmm0
+	mov	edx,DWORD[rcx*4+rdi]
+	xor	r12d,r11d
+	mov	DWORD[rcx*4+rdi],eax
+	or	r12d,r9d
+	add	r8d,DWORD[r15]
+	add	al,dl
+	mov	ebx,DWORD[68+rsi]
+	add	r8d,4096336452
+	movzx	eax,al
+	xor	r12d,r10d
+	mov	DWORD[64+rsi],edx
+	add	r8d,r12d
+	add	cl,bl
+	rol	r8d,6
+	mov	r12d,-1
+	movd	xmm0,DWORD[rax*4+rdi]
+
+	add	r8d,r9d
+	pxor	xmm1,xmm1
+	mov	edx,DWORD[rcx*4+rdi]
+	xor	r12d,r10d
+	mov	DWORD[rcx*4+rdi],ebx
+	or	r12d,r8d
+	add	r11d,DWORD[28+r15]
+	add	bl,dl
+	mov	eax,DWORD[72+rsi]
+	add	r11d,1126891415
+	movzx	ebx,bl
+	xor	r12d,r9d
+	mov	DWORD[68+rsi],edx
+	add	r11d,r12d
+	add	cl,al
+	rol	r11d,10
+	mov	r12d,-1
+	movd	xmm1,DWORD[rbx*4+rdi]
+
+	add	r11d,r8d
+	mov	edx,DWORD[rcx*4+rdi]
+	xor	r12d,r9d
+	mov	DWORD[rcx*4+rdi],eax
+	or	r12d,r11d
+	add	r10d,DWORD[56+r15]
+	add	al,dl
+	mov	ebx,DWORD[76+rsi]
+	add	r10d,2878612391
+	movzx	eax,al
+	xor	r12d,r8d
+	mov	DWORD[72+rsi],edx
+	add	r10d,r12d
+	add	cl,bl
+	rol	r10d,15
+	mov	r12d,-1
+	pinsrw	xmm0,WORD[rax*4+rdi],1
+
+	add	r10d,r11d
+	mov	edx,DWORD[rcx*4+rdi]
+	xor	r12d,r8d
+	mov	DWORD[rcx*4+rdi],ebx
+	or	r12d,r10d
+	add	r9d,DWORD[20+r15]
+	add	bl,dl
+	mov	eax,DWORD[80+rsi]
+	add	r9d,4237533241
+	movzx	ebx,bl
+	xor	r12d,r11d
+	mov	DWORD[76+rsi],edx
+	add	r9d,r12d
+	add	cl,al
+	rol	r9d,21
+	mov	r12d,-1
+	pinsrw	xmm1,WORD[rbx*4+rdi],1
+
+	add	r9d,r10d
+	mov	edx,DWORD[rcx*4+rdi]
+	xor	r12d,r11d
+	mov	DWORD[rcx*4+rdi],eax
+	or	r12d,r9d
+	add	r8d,DWORD[48+r15]
+	add	al,dl
+	mov	ebx,DWORD[84+rsi]
+	add	r8d,1700485571
+	movzx	eax,al
+	xor	r12d,r10d
+	mov	DWORD[80+rsi],edx
+	add	r8d,r12d
+	add	cl,bl
+	rol	r8d,6
+	mov	r12d,-1
+	pinsrw	xmm0,WORD[rax*4+rdi],2
+
+	add	r8d,r9d
+	mov	edx,DWORD[rcx*4+rdi]
+	xor	r12d,r10d
+	mov	DWORD[rcx*4+rdi],ebx
+	or	r12d,r8d
+	add	r11d,DWORD[12+r15]
+	add	bl,dl
+	mov	eax,DWORD[88+rsi]
+	add	r11d,2399980690
+	movzx	ebx,bl
+	xor	r12d,r9d
+	mov	DWORD[84+rsi],edx
+	add	r11d,r12d
+	add	cl,al
+	rol	r11d,10
+	mov	r12d,-1
+	pinsrw	xmm1,WORD[rbx*4+rdi],2
+
+	add	r11d,r8d
+	mov	edx,DWORD[rcx*4+rdi]
+	xor	r12d,r9d
+	mov	DWORD[rcx*4+rdi],eax
+	or	r12d,r11d
+	add	r10d,DWORD[40+r15]
+	add	al,dl
+	mov	ebx,DWORD[92+rsi]
+	add	r10d,4293915773
+	movzx	eax,al
+	xor	r12d,r8d
+	mov	DWORD[88+rsi],edx
+	add	r10d,r12d
+	add	cl,bl
+	rol	r10d,15
+	mov	r12d,-1
+	pinsrw	xmm0,WORD[rax*4+rdi],3
+
+	add	r10d,r11d
+	mov	edx,DWORD[rcx*4+rdi]
+	xor	r12d,r8d
+	mov	DWORD[rcx*4+rdi],ebx
+	or	r12d,r10d
+	add	r9d,DWORD[4+r15]
+	add	bl,dl
+	mov	eax,DWORD[96+rsi]
+	add	r9d,2240044497
+	movzx	ebx,bl
+	xor	r12d,r11d
+	mov	DWORD[92+rsi],edx
+	add	r9d,r12d
+	add	cl,al
+	rol	r9d,21
+	mov	r12d,-1
+	pinsrw	xmm1,WORD[rbx*4+rdi],3
+
+	add	r9d,r10d
+	mov	edx,DWORD[rcx*4+rdi]
+	xor	r12d,r11d
+	mov	DWORD[rcx*4+rdi],eax
+	or	r12d,r9d
+	add	r8d,DWORD[32+r15]
+	add	al,dl
+	mov	ebx,DWORD[100+rsi]
+	add	r8d,1873313359
+	movzx	eax,al
+	xor	r12d,r10d
+	mov	DWORD[96+rsi],edx
+	add	r8d,r12d
+	add	cl,bl
+	rol	r8d,6
+	mov	r12d,-1
+	pinsrw	xmm0,WORD[rax*4+rdi],4
+
+	add	r8d,r9d
+	mov	edx,DWORD[rcx*4+rdi]
+	xor	r12d,r10d
+	mov	DWORD[rcx*4+rdi],ebx
+	or	r12d,r8d
+	add	r11d,DWORD[60+r15]
+	add	bl,dl
+	mov	eax,DWORD[104+rsi]
+	add	r11d,4264355552
+	movzx	ebx,bl
+	xor	r12d,r9d
+	mov	DWORD[100+rsi],edx
+	add	r11d,r12d
+	add	cl,al
+	rol	r11d,10
+	mov	r12d,-1
+	pinsrw	xmm1,WORD[rbx*4+rdi],4
+
+	add	r11d,r8d
+	mov	edx,DWORD[rcx*4+rdi]
+	xor	r12d,r9d
+	mov	DWORD[rcx*4+rdi],eax
+	or	r12d,r11d
+	add	r10d,DWORD[24+r15]
+	add	al,dl
+	mov	ebx,DWORD[108+rsi]
+	add	r10d,2734768916
+	movzx	eax,al
+	xor	r12d,r8d
+	mov	DWORD[104+rsi],edx
+	add	r10d,r12d
+	add	cl,bl
+	rol	r10d,15
+	mov	r12d,-1
+	pinsrw	xmm0,WORD[rax*4+rdi],5
+
+	add	r10d,r11d
+	mov	edx,DWORD[rcx*4+rdi]
+	xor	r12d,r8d
+	mov	DWORD[rcx*4+rdi],ebx
+	or	r12d,r10d
+	add	r9d,DWORD[52+r15]
+	add	bl,dl
+	mov	eax,DWORD[112+rsi]
+	add	r9d,1309151649
+	movzx	ebx,bl
+	xor	r12d,r11d
+	mov	DWORD[108+rsi],edx
+	add	r9d,r12d
+	add	cl,al
+	rol	r9d,21
+	mov	r12d,-1
+	pinsrw	xmm1,WORD[rbx*4+rdi],5
+
+	add	r9d,r10d
+	mov	edx,DWORD[rcx*4+rdi]
+	xor	r12d,r11d
+	mov	DWORD[rcx*4+rdi],eax
+	or	r12d,r9d
+	add	r8d,DWORD[16+r15]
+	add	al,dl
+	mov	ebx,DWORD[116+rsi]
+	add	r8d,4149444226
+	movzx	eax,al
+	xor	r12d,r10d
+	mov	DWORD[112+rsi],edx
+	add	r8d,r12d
+	add	cl,bl
+	rol	r8d,6
+	mov	r12d,-1
+	pinsrw	xmm0,WORD[rax*4+rdi],6
+
+	add	r8d,r9d
+	mov	edx,DWORD[rcx*4+rdi]
+	xor	r12d,r10d
+	mov	DWORD[rcx*4+rdi],ebx
+	or	r12d,r8d
+	add	r11d,DWORD[44+r15]
+	add	bl,dl
+	mov	eax,DWORD[120+rsi]
+	add	r11d,3174756917
+	movzx	ebx,bl
+	xor	r12d,r9d
+	mov	DWORD[116+rsi],edx
+	add	r11d,r12d
+	add	cl,al
+	rol	r11d,10
+	mov	r12d,-1
+	pinsrw	xmm1,WORD[rbx*4+rdi],6
+
+	add	r11d,r8d
+	mov	edx,DWORD[rcx*4+rdi]
+	xor	r12d,r9d
+	mov	DWORD[rcx*4+rdi],eax
+	or	r12d,r11d
+	add	r10d,DWORD[8+r15]
+	add	al,dl
+	mov	ebx,DWORD[124+rsi]
+	add	r10d,718787259
+	movzx	eax,al
+	xor	r12d,r8d
+	mov	DWORD[120+rsi],edx
+	add	r10d,r12d
+	add	cl,bl
+	rol	r10d,15
+	mov	r12d,-1
+	pinsrw	xmm0,WORD[rax*4+rdi],7
+
+	add	r10d,r11d
+	movdqu	xmm5,XMMWORD[48+r13]
+	add	bpl,32
+	mov	edx,DWORD[rcx*4+rdi]
+	xor	r12d,r8d
+	mov	DWORD[rcx*4+rdi],ebx
+	or	r12d,r10d
+	add	r9d,DWORD[36+r15]
+	add	bl,dl
+	mov	eax,DWORD[rbp*4+rdi]
+	add	r9d,3951481745
+	movzx	ebx,bl
+	xor	r12d,r11d
+	mov	DWORD[124+rsi],edx
+	add	r9d,r12d
+	add	cl,al
+	rol	r9d,21
+	mov	r12d,-1
+	pinsrw	xmm1,WORD[rbx*4+rdi],7
+
+	add	r9d,r10d
+	mov	rsi,rbp
+	xor	rbp,rbp
+	mov	bpl,sil
+	mov	rsi,rcx
+	xor	rcx,rcx
+	mov	cl,sil
+	lea	rsi,[rbp*4+rdi]
+	psllq	xmm1,8
+	pxor	xmm5,xmm0
+	pxor	xmm5,xmm1
+	add	r8d,DWORD[rsp]
+	add	r9d,DWORD[4+rsp]
+	add	r10d,DWORD[8+rsp]
+	add	r11d,DWORD[12+rsp]
+
+	movdqu	XMMWORD[r13*1+r14],xmm2
+	movdqu	XMMWORD[16+r13*1+r14],xmm3
+	movdqu	XMMWORD[32+r13*1+r14],xmm4
+	movdqu	XMMWORD[48+r13*1+r14],xmm5
+	lea	r15,[64+r15]
+	lea	r13,[64+r13]
+	cmp	r15,QWORD[16+rsp]
+	jb	NEAR $L$oop
+
+	mov	r12,QWORD[24+rsp]
+	sub	cl,al
+	mov	DWORD[r12],r8d
+	mov	DWORD[4+r12],r9d
+	mov	DWORD[8+r12],r10d
+	mov	DWORD[12+r12],r11d
+	sub	bpl,1
+	mov	DWORD[((-8))+rdi],ebp
+	mov	DWORD[((-4))+rdi],ecx
+
+	mov	r15,QWORD[40+rsp]
+	mov	r14,QWORD[48+rsp]
+	mov	r13,QWORD[56+rsp]
+	mov	r12,QWORD[64+rsp]
+	mov	rbp,QWORD[72+rsp]
+	mov	rbx,QWORD[80+rsp]
+	lea	rsp,[88+rsp]
+$L$epilogue:
+$L$abort:
+	mov	rdi,QWORD[8+rsp]	;WIN64 epilogue
+	mov	rsi,QWORD[16+rsp]
+	DB	0F3h,0C3h		;repret
+$L$SEH_end_rc4_md5_enc:
+EXTERN	__imp_RtlVirtualUnwind
+
+ALIGN	16
+se_handler:
+	push	rsi
+	push	rdi
+	push	rbx
+	push	rbp
+	push	r12
+	push	r13
+	push	r14
+	push	r15
+	pushfq
+	sub	rsp,64
+
+	mov	rax,QWORD[120+r8]
+	mov	rbx,QWORD[248+r8]
+
+	lea	r10,[$L$body]
+	cmp	rbx,r10
+	jb	NEAR $L$in_prologue
+
+	mov	rax,QWORD[152+r8]
+
+	lea	r10,[$L$epilogue]
+	cmp	rbx,r10
+	jae	NEAR $L$in_prologue
+
+	mov	r15,QWORD[40+rax]
+	mov	r14,QWORD[48+rax]
+	mov	r13,QWORD[56+rax]
+	mov	r12,QWORD[64+rax]
+	mov	rbp,QWORD[72+rax]
+	mov	rbx,QWORD[80+rax]
+	lea	rax,[88+rax]
+
+	mov	QWORD[144+r8],rbx
+	mov	QWORD[160+r8],rbp
+	mov	QWORD[216+r8],r12
+	mov	QWORD[224+r8],r13
+	mov	QWORD[232+r8],r14
+	mov	QWORD[240+r8],r15
+
+$L$in_prologue:
+	mov	rdi,QWORD[8+rax]
+	mov	rsi,QWORD[16+rax]
+	mov	QWORD[152+r8],rax
+	mov	QWORD[168+r8],rsi
+	mov	QWORD[176+r8],rdi
+
+	mov	rdi,QWORD[40+r9]
+	mov	rsi,r8
+	mov	ecx,154
+	DD	0xa548f3fc
+
+	mov	rsi,r9
+	xor	rcx,rcx
+	mov	rdx,QWORD[8+rsi]
+	mov	r8,QWORD[rsi]
+	mov	r9,QWORD[16+rsi]
+	mov	r10,QWORD[40+rsi]
+	lea	r11,[56+rsi]
+	lea	r12,[24+rsi]
+	mov	QWORD[32+rsp],r10
+	mov	QWORD[40+rsp],r11
+	mov	QWORD[48+rsp],r12
+	mov	QWORD[56+rsp],rcx
+	call	QWORD[__imp_RtlVirtualUnwind]
+
+	mov	eax,1
+	add	rsp,64
+	popfq
+	pop	r15
+	pop	r14
+	pop	r13
+	pop	r12
+	pop	rbp
+	pop	rbx
+	pop	rdi
+	pop	rsi
+	DB	0F3h,0C3h		;repret
+
+
+section	.pdata rdata align=4
+ALIGN	4
+	DD	$L$SEH_begin_rc4_md5_enc wrt ..imagebase
+	DD	$L$SEH_end_rc4_md5_enc wrt ..imagebase
+	DD	$L$SEH_info_rc4_md5_enc wrt ..imagebase
+
+section	.xdata rdata align=8
+ALIGN	8
+$L$SEH_info_rc4_md5_enc:
+DB	9,0,0,0
+	DD	se_handler wrt ..imagebase
diff --git a/third_party/boringssl/win-x86_64/crypto/rc4/rc4-x86_64.asm b/third_party/boringssl/win-x86_64/crypto/rc4/rc4-x86_64.asm
new file mode 100644
index 0000000..c7c3b7b
--- /dev/null
+++ b/third_party/boringssl/win-x86_64/crypto/rc4/rc4-x86_64.asm
@@ -0,0 +1,741 @@
+default	rel
+%define XMMWORD
+%define YMMWORD
+%define ZMMWORD
+section	.text code align=64
+
+EXTERN	OPENSSL_ia32cap_P
+
+global	asm_RC4
+
+ALIGN	16
+asm_RC4:
+	mov	QWORD[8+rsp],rdi	;WIN64 prologue
+	mov	QWORD[16+rsp],rsi
+	mov	rax,rsp
+$L$SEH_begin_asm_RC4:
+	mov	rdi,rcx
+	mov	rsi,rdx
+	mov	rdx,r8
+	mov	rcx,r9
+
+
+	or	rsi,rsi
+	jne	NEAR $L$entry
+	mov	rdi,QWORD[8+rsp]	;WIN64 epilogue
+	mov	rsi,QWORD[16+rsp]
+	DB	0F3h,0C3h		;repret
+$L$entry:
+	push	rbx
+	push	r12
+	push	r13
+$L$prologue:
+	mov	r11,rsi
+	mov	r12,rdx
+	mov	r13,rcx
+	xor	r10,r10
+	xor	rcx,rcx
+
+	lea	rdi,[8+rdi]
+	mov	r10b,BYTE[((-8))+rdi]
+	mov	cl,BYTE[((-4))+rdi]
+	cmp	DWORD[256+rdi],-1
+	je	NEAR $L$RC4_CHAR
+	mov	r8d,DWORD[OPENSSL_ia32cap_P]
+	xor	rbx,rbx
+	inc	r10b
+	sub	rbx,r10
+	sub	r13,r12
+	mov	eax,DWORD[r10*4+rdi]
+	test	r11,-16
+	jz	NEAR $L$loop1
+	bt	r8d,30
+	jc	NEAR $L$intel
+	and	rbx,7
+	lea	rsi,[1+r10]
+	jz	NEAR $L$oop8
+	sub	r11,rbx
+$L$oop8_warmup:
+	add	cl,al
+	mov	edx,DWORD[rcx*4+rdi]
+	mov	DWORD[rcx*4+rdi],eax
+	mov	DWORD[r10*4+rdi],edx
+	add	al,dl
+	inc	r10b
+	mov	edx,DWORD[rax*4+rdi]
+	mov	eax,DWORD[r10*4+rdi]
+	xor	dl,BYTE[r12]
+	mov	BYTE[r13*1+r12],dl
+	lea	r12,[1+r12]
+	dec	rbx
+	jnz	NEAR $L$oop8_warmup
+
+	lea	rsi,[1+r10]
+	jmp	NEAR $L$oop8
+ALIGN	16
+$L$oop8:
+	add	cl,al
+	mov	edx,DWORD[rcx*4+rdi]
+	mov	DWORD[rcx*4+rdi],eax
+	mov	ebx,DWORD[rsi*4+rdi]
+	ror	r8,8
+	mov	DWORD[r10*4+rdi],edx
+	add	dl,al
+	mov	r8b,BYTE[rdx*4+rdi]
+	add	cl,bl
+	mov	edx,DWORD[rcx*4+rdi]
+	mov	DWORD[rcx*4+rdi],ebx
+	mov	eax,DWORD[4+rsi*4+rdi]
+	ror	r8,8
+	mov	DWORD[4+r10*4+rdi],edx
+	add	dl,bl
+	mov	r8b,BYTE[rdx*4+rdi]
+	add	cl,al
+	mov	edx,DWORD[rcx*4+rdi]
+	mov	DWORD[rcx*4+rdi],eax
+	mov	ebx,DWORD[8+rsi*4+rdi]
+	ror	r8,8
+	mov	DWORD[8+r10*4+rdi],edx
+	add	dl,al
+	mov	r8b,BYTE[rdx*4+rdi]
+	add	cl,bl
+	mov	edx,DWORD[rcx*4+rdi]
+	mov	DWORD[rcx*4+rdi],ebx
+	mov	eax,DWORD[12+rsi*4+rdi]
+	ror	r8,8
+	mov	DWORD[12+r10*4+rdi],edx
+	add	dl,bl
+	mov	r8b,BYTE[rdx*4+rdi]
+	add	cl,al
+	mov	edx,DWORD[rcx*4+rdi]
+	mov	DWORD[rcx*4+rdi],eax
+	mov	ebx,DWORD[16+rsi*4+rdi]
+	ror	r8,8
+	mov	DWORD[16+r10*4+rdi],edx
+	add	dl,al
+	mov	r8b,BYTE[rdx*4+rdi]
+	add	cl,bl
+	mov	edx,DWORD[rcx*4+rdi]
+	mov	DWORD[rcx*4+rdi],ebx
+	mov	eax,DWORD[20+rsi*4+rdi]
+	ror	r8,8
+	mov	DWORD[20+r10*4+rdi],edx
+	add	dl,bl
+	mov	r8b,BYTE[rdx*4+rdi]
+	add	cl,al
+	mov	edx,DWORD[rcx*4+rdi]
+	mov	DWORD[rcx*4+rdi],eax
+	mov	ebx,DWORD[24+rsi*4+rdi]
+	ror	r8,8
+	mov	DWORD[24+r10*4+rdi],edx
+	add	dl,al
+	mov	r8b,BYTE[rdx*4+rdi]
+	add	sil,8
+	add	cl,bl
+	mov	edx,DWORD[rcx*4+rdi]
+	mov	DWORD[rcx*4+rdi],ebx
+	mov	eax,DWORD[((-4))+rsi*4+rdi]
+	ror	r8,8
+	mov	DWORD[28+r10*4+rdi],edx
+	add	dl,bl
+	mov	r8b,BYTE[rdx*4+rdi]
+	add	r10b,8
+	ror	r8,8
+	sub	r11,8
+
+	xor	r8,QWORD[r12]
+	mov	QWORD[r13*1+r12],r8
+	lea	r12,[8+r12]
+
+	test	r11,-8
+	jnz	NEAR $L$oop8
+	cmp	r11,0
+	jne	NEAR $L$loop1
+	jmp	NEAR $L$exit
+
+ALIGN	16
+$L$intel:
+	test	r11,-32
+	jz	NEAR $L$loop1
+	and	rbx,15
+	jz	NEAR $L$oop16_is_hot
+	sub	r11,rbx
+$L$oop16_warmup:
+	add	cl,al
+	mov	edx,DWORD[rcx*4+rdi]
+	mov	DWORD[rcx*4+rdi],eax
+	mov	DWORD[r10*4+rdi],edx
+	add	al,dl
+	inc	r10b
+	mov	edx,DWORD[rax*4+rdi]
+	mov	eax,DWORD[r10*4+rdi]
+	xor	dl,BYTE[r12]
+	mov	BYTE[r13*1+r12],dl
+	lea	r12,[1+r12]
+	dec	rbx
+	jnz	NEAR $L$oop16_warmup
+
+	mov	rbx,rcx
+	xor	rcx,rcx
+	mov	cl,bl
+
+$L$oop16_is_hot:
+	lea	rsi,[r10*4+rdi]
+	add	cl,al
+	mov	edx,DWORD[rcx*4+rdi]
+	pxor	xmm0,xmm0
+	mov	DWORD[rcx*4+rdi],eax
+	add	al,dl
+	mov	ebx,DWORD[4+rsi]
+	movzx	eax,al
+	mov	DWORD[rsi],edx
+	add	cl,bl
+	pinsrw	xmm0,WORD[rax*4+rdi],0
+	jmp	NEAR $L$oop16_enter
+ALIGN	16
+$L$oop16:
+	add	cl,al
+	mov	edx,DWORD[rcx*4+rdi]
+	pxor	xmm2,xmm0
+	psllq	xmm1,8
+	pxor	xmm0,xmm0
+	mov	DWORD[rcx*4+rdi],eax
+	add	al,dl
+	mov	ebx,DWORD[4+rsi]
+	movzx	eax,al
+	mov	DWORD[rsi],edx
+	pxor	xmm2,xmm1
+	add	cl,bl
+	pinsrw	xmm0,WORD[rax*4+rdi],0
+	movdqu	XMMWORD[r13*1+r12],xmm2
+	lea	r12,[16+r12]
+$L$oop16_enter:
+	mov	edx,DWORD[rcx*4+rdi]
+	pxor	xmm1,xmm1
+	mov	DWORD[rcx*4+rdi],ebx
+	add	bl,dl
+	mov	eax,DWORD[8+rsi]
+	movzx	ebx,bl
+	mov	DWORD[4+rsi],edx
+	add	cl,al
+	pinsrw	xmm1,WORD[rbx*4+rdi],0
+	mov	edx,DWORD[rcx*4+rdi]
+	mov	DWORD[rcx*4+rdi],eax
+	add	al,dl
+	mov	ebx,DWORD[12+rsi]
+	movzx	eax,al
+	mov	DWORD[8+rsi],edx
+	add	cl,bl
+	pinsrw	xmm0,WORD[rax*4+rdi],1
+	mov	edx,DWORD[rcx*4+rdi]
+	mov	DWORD[rcx*4+rdi],ebx
+	add	bl,dl
+	mov	eax,DWORD[16+rsi]
+	movzx	ebx,bl
+	mov	DWORD[12+rsi],edx
+	add	cl,al
+	pinsrw	xmm1,WORD[rbx*4+rdi],1
+	mov	edx,DWORD[rcx*4+rdi]
+	mov	DWORD[rcx*4+rdi],eax
+	add	al,dl
+	mov	ebx,DWORD[20+rsi]
+	movzx	eax,al
+	mov	DWORD[16+rsi],edx
+	add	cl,bl
+	pinsrw	xmm0,WORD[rax*4+rdi],2
+	mov	edx,DWORD[rcx*4+rdi]
+	mov	DWORD[rcx*4+rdi],ebx
+	add	bl,dl
+	mov	eax,DWORD[24+rsi]
+	movzx	ebx,bl
+	mov	DWORD[20+rsi],edx
+	add	cl,al
+	pinsrw	xmm1,WORD[rbx*4+rdi],2
+	mov	edx,DWORD[rcx*4+rdi]
+	mov	DWORD[rcx*4+rdi],eax
+	add	al,dl
+	mov	ebx,DWORD[28+rsi]
+	movzx	eax,al
+	mov	DWORD[24+rsi],edx
+	add	cl,bl
+	pinsrw	xmm0,WORD[rax*4+rdi],3
+	mov	edx,DWORD[rcx*4+rdi]
+	mov	DWORD[rcx*4+rdi],ebx
+	add	bl,dl
+	mov	eax,DWORD[32+rsi]
+	movzx	ebx,bl
+	mov	DWORD[28+rsi],edx
+	add	cl,al
+	pinsrw	xmm1,WORD[rbx*4+rdi],3
+	mov	edx,DWORD[rcx*4+rdi]
+	mov	DWORD[rcx*4+rdi],eax
+	add	al,dl
+	mov	ebx,DWORD[36+rsi]
+	movzx	eax,al
+	mov	DWORD[32+rsi],edx
+	add	cl,bl
+	pinsrw	xmm0,WORD[rax*4+rdi],4
+	mov	edx,DWORD[rcx*4+rdi]
+	mov	DWORD[rcx*4+rdi],ebx
+	add	bl,dl
+	mov	eax,DWORD[40+rsi]
+	movzx	ebx,bl
+	mov	DWORD[36+rsi],edx
+	add	cl,al
+	pinsrw	xmm1,WORD[rbx*4+rdi],4
+	mov	edx,DWORD[rcx*4+rdi]
+	mov	DWORD[rcx*4+rdi],eax
+	add	al,dl
+	mov	ebx,DWORD[44+rsi]
+	movzx	eax,al
+	mov	DWORD[40+rsi],edx
+	add	cl,bl
+	pinsrw	xmm0,WORD[rax*4+rdi],5
+	mov	edx,DWORD[rcx*4+rdi]
+	mov	DWORD[rcx*4+rdi],ebx
+	add	bl,dl
+	mov	eax,DWORD[48+rsi]
+	movzx	ebx,bl
+	mov	DWORD[44+rsi],edx
+	add	cl,al
+	pinsrw	xmm1,WORD[rbx*4+rdi],5
+	mov	edx,DWORD[rcx*4+rdi]
+	mov	DWORD[rcx*4+rdi],eax
+	add	al,dl
+	mov	ebx,DWORD[52+rsi]
+	movzx	eax,al
+	mov	DWORD[48+rsi],edx
+	add	cl,bl
+	pinsrw	xmm0,WORD[rax*4+rdi],6
+	mov	edx,DWORD[rcx*4+rdi]
+	mov	DWORD[rcx*4+rdi],ebx
+	add	bl,dl
+	mov	eax,DWORD[56+rsi]
+	movzx	ebx,bl
+	mov	DWORD[52+rsi],edx
+	add	cl,al
+	pinsrw	xmm1,WORD[rbx*4+rdi],6
+	mov	edx,DWORD[rcx*4+rdi]
+	mov	DWORD[rcx*4+rdi],eax
+	add	al,dl
+	mov	ebx,DWORD[60+rsi]
+	movzx	eax,al
+	mov	DWORD[56+rsi],edx
+	add	cl,bl
+	pinsrw	xmm0,WORD[rax*4+rdi],7
+	add	r10b,16
+	movdqu	xmm2,XMMWORD[r12]
+	mov	edx,DWORD[rcx*4+rdi]
+	mov	DWORD[rcx*4+rdi],ebx
+	add	bl,dl
+	movzx	ebx,bl
+	mov	DWORD[60+rsi],edx
+	lea	rsi,[r10*4+rdi]
+	pinsrw	xmm1,WORD[rbx*4+rdi],7
+	mov	eax,DWORD[rsi]
+	mov	rbx,rcx
+	xor	rcx,rcx
+	sub	r11,16
+	mov	cl,bl
+	test	r11,-16
+	jnz	NEAR $L$oop16
+
+	psllq	xmm1,8
+	pxor	xmm2,xmm0
+	pxor	xmm2,xmm1
+	movdqu	XMMWORD[r13*1+r12],xmm2
+	lea	r12,[16+r12]
+
+	cmp	r11,0
+	jne	NEAR $L$loop1
+	jmp	NEAR $L$exit
+
+ALIGN	16
+$L$loop1:
+	add	cl,al
+	mov	edx,DWORD[rcx*4+rdi]
+	mov	DWORD[rcx*4+rdi],eax
+	mov	DWORD[r10*4+rdi],edx
+	add	al,dl
+	inc	r10b
+	mov	edx,DWORD[rax*4+rdi]
+	mov	eax,DWORD[r10*4+rdi]
+	xor	dl,BYTE[r12]
+	mov	BYTE[r13*1+r12],dl
+	lea	r12,[1+r12]
+	dec	r11
+	jnz	NEAR $L$loop1
+	jmp	NEAR $L$exit
+
+ALIGN	16
+$L$RC4_CHAR:
+	add	r10b,1
+	movzx	eax,BYTE[r10*1+rdi]
+	test	r11,-8
+	jz	NEAR $L$cloop1
+	jmp	NEAR $L$cloop8
+ALIGN	16
+$L$cloop8:
+	mov	r8d,DWORD[r12]
+	mov	r9d,DWORD[4+r12]
+	add	cl,al
+	lea	rsi,[1+r10]
+	movzx	edx,BYTE[rcx*1+rdi]
+	movzx	esi,sil
+	movzx	ebx,BYTE[rsi*1+rdi]
+	mov	BYTE[rcx*1+rdi],al
+	cmp	rcx,rsi
+	mov	BYTE[r10*1+rdi],dl
+	jne	NEAR $L$cmov0
+	mov	rbx,rax
+$L$cmov0:
+	add	dl,al
+	xor	r8b,BYTE[rdx*1+rdi]
+	ror	r8d,8
+	add	cl,bl
+	lea	r10,[1+rsi]
+	movzx	edx,BYTE[rcx*1+rdi]
+	movzx	r10d,r10b
+	movzx	eax,BYTE[r10*1+rdi]
+	mov	BYTE[rcx*1+rdi],bl
+	cmp	rcx,r10
+	mov	BYTE[rsi*1+rdi],dl
+	jne	NEAR $L$cmov1
+	mov	rax,rbx
+$L$cmov1:
+	add	dl,bl
+	xor	r8b,BYTE[rdx*1+rdi]
+	ror	r8d,8
+	add	cl,al
+	lea	rsi,[1+r10]
+	movzx	edx,BYTE[rcx*1+rdi]
+	movzx	esi,sil
+	movzx	ebx,BYTE[rsi*1+rdi]
+	mov	BYTE[rcx*1+rdi],al
+	cmp	rcx,rsi
+	mov	BYTE[r10*1+rdi],dl
+	jne	NEAR $L$cmov2
+	mov	rbx,rax
+$L$cmov2:
+	add	dl,al
+	xor	r8b,BYTE[rdx*1+rdi]
+	ror	r8d,8
+	add	cl,bl
+	lea	r10,[1+rsi]
+	movzx	edx,BYTE[rcx*1+rdi]
+	movzx	r10d,r10b
+	movzx	eax,BYTE[r10*1+rdi]
+	mov	BYTE[rcx*1+rdi],bl
+	cmp	rcx,r10
+	mov	BYTE[rsi*1+rdi],dl
+	jne	NEAR $L$cmov3
+	mov	rax,rbx
+$L$cmov3:
+	add	dl,bl
+	xor	r8b,BYTE[rdx*1+rdi]
+	ror	r8d,8
+	add	cl,al
+	lea	rsi,[1+r10]
+	movzx	edx,BYTE[rcx*1+rdi]
+	movzx	esi,sil
+	movzx	ebx,BYTE[rsi*1+rdi]
+	mov	BYTE[rcx*1+rdi],al
+	cmp	rcx,rsi
+	mov	BYTE[r10*1+rdi],dl
+	jne	NEAR $L$cmov4
+	mov	rbx,rax
+$L$cmov4:
+	add	dl,al
+	xor	r9b,BYTE[rdx*1+rdi]
+	ror	r9d,8
+	add	cl,bl
+	lea	r10,[1+rsi]
+	movzx	edx,BYTE[rcx*1+rdi]
+	movzx	r10d,r10b
+	movzx	eax,BYTE[r10*1+rdi]
+	mov	BYTE[rcx*1+rdi],bl
+	cmp	rcx,r10
+	mov	BYTE[rsi*1+rdi],dl
+	jne	NEAR $L$cmov5
+	mov	rax,rbx
+$L$cmov5:
+	add	dl,bl
+	xor	r9b,BYTE[rdx*1+rdi]
+	ror	r9d,8
+	add	cl,al
+	lea	rsi,[1+r10]
+	movzx	edx,BYTE[rcx*1+rdi]
+	movzx	esi,sil
+	movzx	ebx,BYTE[rsi*1+rdi]
+	mov	BYTE[rcx*1+rdi],al
+	cmp	rcx,rsi
+	mov	BYTE[r10*1+rdi],dl
+	jne	NEAR $L$cmov6
+	mov	rbx,rax
+$L$cmov6:
+	add	dl,al
+	xor	r9b,BYTE[rdx*1+rdi]
+	ror	r9d,8
+	add	cl,bl
+	lea	r10,[1+rsi]
+	movzx	edx,BYTE[rcx*1+rdi]
+	movzx	r10d,r10b
+	movzx	eax,BYTE[r10*1+rdi]
+	mov	BYTE[rcx*1+rdi],bl
+	cmp	rcx,r10
+	mov	BYTE[rsi*1+rdi],dl
+	jne	NEAR $L$cmov7
+	mov	rax,rbx
+$L$cmov7:
+	add	dl,bl
+	xor	r9b,BYTE[rdx*1+rdi]
+	ror	r9d,8
+	lea	r11,[((-8))+r11]
+	mov	DWORD[r13],r8d
+	lea	r12,[8+r12]
+	mov	DWORD[4+r13],r9d
+	lea	r13,[8+r13]
+
+	test	r11,-8
+	jnz	NEAR $L$cloop8
+	cmp	r11,0
+	jne	NEAR $L$cloop1
+	jmp	NEAR $L$exit
+ALIGN	16
+$L$cloop1:
+	add	cl,al
+	movzx	ecx,cl
+	movzx	edx,BYTE[rcx*1+rdi]
+	mov	BYTE[rcx*1+rdi],al
+	mov	BYTE[r10*1+rdi],dl
+	add	dl,al
+	add	r10b,1
+	movzx	edx,dl
+	movzx	r10d,r10b
+	movzx	edx,BYTE[rdx*1+rdi]
+	movzx	eax,BYTE[r10*1+rdi]
+	xor	dl,BYTE[r12]
+	lea	r12,[1+r12]
+	mov	BYTE[r13],dl
+	lea	r13,[1+r13]
+	sub	r11,1
+	jnz	NEAR $L$cloop1
+	jmp	NEAR $L$exit
+
+ALIGN	16
+$L$exit:
+	sub	r10b,1
+	mov	DWORD[((-8))+rdi],r10d
+	mov	DWORD[((-4))+rdi],ecx
+
+	mov	r13,QWORD[rsp]
+	mov	r12,QWORD[8+rsp]
+	mov	rbx,QWORD[16+rsp]
+	add	rsp,24
+$L$epilogue:
+	mov	rdi,QWORD[8+rsp]	;WIN64 epilogue
+	mov	rsi,QWORD[16+rsp]
+	DB	0F3h,0C3h		;repret
+$L$SEH_end_asm_RC4:
+global	asm_RC4_set_key
+
+ALIGN	16
+asm_RC4_set_key:
+	mov	QWORD[8+rsp],rdi	;WIN64 prologue
+	mov	QWORD[16+rsp],rsi
+	mov	rax,rsp
+$L$SEH_begin_asm_RC4_set_key:
+	mov	rdi,rcx
+	mov	rsi,rdx
+	mov	rdx,r8
+
+
+	lea	rdi,[8+rdi]
+	lea	rdx,[rsi*1+rdx]
+	neg	rsi
+	mov	rcx,rsi
+	xor	eax,eax
+	xor	r9,r9
+	xor	r10,r10
+	xor	r11,r11
+
+	mov	r8d,DWORD[OPENSSL_ia32cap_P]
+	bt	r8d,20
+	jc	NEAR $L$c1stloop
+	jmp	NEAR $L$w1stloop
+
+ALIGN	16
+$L$w1stloop:
+	mov	DWORD[rax*4+rdi],eax
+	add	al,1
+	jnc	NEAR $L$w1stloop
+
+	xor	r9,r9
+	xor	r8,r8
+ALIGN	16
+$L$w2ndloop:
+	mov	r10d,DWORD[r9*4+rdi]
+	add	r8b,BYTE[rsi*1+rdx]
+	add	r8b,r10b
+	add	rsi,1
+	mov	r11d,DWORD[r8*4+rdi]
+	cmovz	rsi,rcx
+	mov	DWORD[r8*4+rdi],r10d
+	mov	DWORD[r9*4+rdi],r11d
+	add	r9b,1
+	jnc	NEAR $L$w2ndloop
+	jmp	NEAR $L$exit_key
+
+ALIGN	16
+$L$c1stloop:
+	mov	BYTE[rax*1+rdi],al
+	add	al,1
+	jnc	NEAR $L$c1stloop
+
+	xor	r9,r9
+	xor	r8,r8
+ALIGN	16
+$L$c2ndloop:
+	mov	r10b,BYTE[r9*1+rdi]
+	add	r8b,BYTE[rsi*1+rdx]
+	add	r8b,r10b
+	add	rsi,1
+	mov	r11b,BYTE[r8*1+rdi]
+	jnz	NEAR $L$cnowrap
+	mov	rsi,rcx
+$L$cnowrap:
+	mov	BYTE[r8*1+rdi],r10b
+	mov	BYTE[r9*1+rdi],r11b
+	add	r9b,1
+	jnc	NEAR $L$c2ndloop
+	mov	DWORD[256+rdi],-1
+
+ALIGN	16
+$L$exit_key:
+	xor	eax,eax
+	mov	DWORD[((-8))+rdi],eax
+	mov	DWORD[((-4))+rdi],eax
+	mov	rdi,QWORD[8+rsp]	;WIN64 epilogue
+	mov	rsi,QWORD[16+rsp]
+	DB	0F3h,0C3h		;repret
+$L$SEH_end_asm_RC4_set_key:
+EXTERN	__imp_RtlVirtualUnwind
+
+ALIGN	16
+stream_se_handler:
+	push	rsi
+	push	rdi
+	push	rbx
+	push	rbp
+	push	r12
+	push	r13
+	push	r14
+	push	r15
+	pushfq
+	sub	rsp,64
+
+	mov	rax,QWORD[120+r8]
+	mov	rbx,QWORD[248+r8]
+
+	lea	r10,[$L$prologue]
+	cmp	rbx,r10
+	jb	NEAR $L$in_prologue
+
+	mov	rax,QWORD[152+r8]
+
+	lea	r10,[$L$epilogue]
+	cmp	rbx,r10
+	jae	NEAR $L$in_prologue
+
+	lea	rax,[24+rax]
+
+	mov	rbx,QWORD[((-8))+rax]
+	mov	r12,QWORD[((-16))+rax]
+	mov	r13,QWORD[((-24))+rax]
+	mov	QWORD[144+r8],rbx
+	mov	QWORD[216+r8],r12
+	mov	QWORD[224+r8],r13
+
+$L$in_prologue:
+	mov	rdi,QWORD[8+rax]
+	mov	rsi,QWORD[16+rax]
+	mov	QWORD[152+r8],rax
+	mov	QWORD[168+r8],rsi
+	mov	QWORD[176+r8],rdi
+
+	jmp	NEAR $L$common_seh_exit
+
+
+
+ALIGN	16
+key_se_handler:
+	push	rsi
+	push	rdi
+	push	rbx
+	push	rbp
+	push	r12
+	push	r13
+	push	r14
+	push	r15
+	pushfq
+	sub	rsp,64
+
+	mov	rax,QWORD[152+r8]
+	mov	rdi,QWORD[8+rax]
+	mov	rsi,QWORD[16+rax]
+	mov	QWORD[168+r8],rsi
+	mov	QWORD[176+r8],rdi
+
+$L$common_seh_exit:
+
+	mov	rdi,QWORD[40+r9]
+	mov	rsi,r8
+	mov	ecx,154
+	DD	0xa548f3fc
+
+	mov	rsi,r9
+	xor	rcx,rcx
+	mov	rdx,QWORD[8+rsi]
+	mov	r8,QWORD[rsi]
+	mov	r9,QWORD[16+rsi]
+	mov	r10,QWORD[40+rsi]
+	lea	r11,[56+rsi]
+	lea	r12,[24+rsi]
+	mov	QWORD[32+rsp],r10
+	mov	QWORD[40+rsp],r11
+	mov	QWORD[48+rsp],r12
+	mov	QWORD[56+rsp],rcx
+	call	QWORD[__imp_RtlVirtualUnwind]
+
+	mov	eax,1
+	add	rsp,64
+	popfq
+	pop	r15
+	pop	r14
+	pop	r13
+	pop	r12
+	pop	rbp
+	pop	rbx
+	pop	rdi
+	pop	rsi
+	DB	0F3h,0C3h		;repret
+
+
+section	.pdata rdata align=4
+ALIGN	4
+	DD	$L$SEH_begin_asm_RC4 wrt ..imagebase
+	DD	$L$SEH_end_asm_RC4 wrt ..imagebase
+	DD	$L$SEH_info_asm_RC4 wrt ..imagebase
+
+	DD	$L$SEH_begin_asm_RC4_set_key wrt ..imagebase
+	DD	$L$SEH_end_asm_RC4_set_key wrt ..imagebase
+	DD	$L$SEH_info_asm_RC4_set_key wrt ..imagebase
+
+section	.xdata rdata align=8
+ALIGN	8
+$L$SEH_info_asm_RC4:
+DB	9,0,0,0
+	DD	stream_se_handler wrt ..imagebase
+$L$SEH_info_asm_RC4_set_key:
+DB	9,0,0,0
+	DD	key_se_handler wrt ..imagebase
diff --git a/third_party/boringssl/win-x86_64/crypto/sha/sha1-x86_64.asm b/third_party/boringssl/win-x86_64/crypto/sha/sha1-x86_64.asm
new file mode 100644
index 0000000..0f5361a
--- /dev/null
+++ b/third_party/boringssl/win-x86_64/crypto/sha/sha1-x86_64.asm
@@ -0,0 +1,2616 @@
+default	rel
+%define XMMWORD
+%define YMMWORD
+%define ZMMWORD
+section	.text code align=64
+
+EXTERN	OPENSSL_ia32cap_P
+
+global	sha1_block_data_order
+
+ALIGN	16
+sha1_block_data_order:
+	mov	QWORD[8+rsp],rdi	;WIN64 prologue
+	mov	QWORD[16+rsp],rsi
+	mov	rax,rsp
+$L$SEH_begin_sha1_block_data_order:
+	mov	rdi,rcx
+	mov	rsi,rdx
+	mov	rdx,r8
+
+
+	mov	r9d,DWORD[((OPENSSL_ia32cap_P+0))]
+	mov	r8d,DWORD[((OPENSSL_ia32cap_P+4))]
+	mov	r10d,DWORD[((OPENSSL_ia32cap_P+8))]
+	test	r8d,512
+	jz	NEAR $L$ialu
+	jmp	NEAR _ssse3_shortcut
+
+ALIGN	16
+$L$ialu:
+	mov	rax,rsp
+	push	rbx
+	push	rbp
+	push	r12
+	push	r13
+	push	r14
+	mov	r8,rdi
+	sub	rsp,72
+	mov	r9,rsi
+	and	rsp,-64
+	mov	r10,rdx
+	mov	QWORD[64+rsp],rax
+$L$prologue:
+
+	mov	esi,DWORD[r8]
+	mov	edi,DWORD[4+r8]
+	mov	r11d,DWORD[8+r8]
+	mov	r12d,DWORD[12+r8]
+	mov	r13d,DWORD[16+r8]
+	jmp	NEAR $L$loop
+
+ALIGN	16
+$L$loop:
+	mov	edx,DWORD[r9]
+	bswap	edx
+	mov	ebp,DWORD[4+r9]
+	mov	eax,r12d
+	mov	DWORD[rsp],edx
+	mov	ecx,esi
+	bswap	ebp
+	xor	eax,r11d
+	rol	ecx,5
+	and	eax,edi
+	lea	r13d,[1518500249+r13*1+rdx]
+	add	r13d,ecx
+	xor	eax,r12d
+	rol	edi,30
+	add	r13d,eax
+	mov	r14d,DWORD[8+r9]
+	mov	eax,r11d
+	mov	DWORD[4+rsp],ebp
+	mov	ecx,r13d
+	bswap	r14d
+	xor	eax,edi
+	rol	ecx,5
+	and	eax,esi
+	lea	r12d,[1518500249+r12*1+rbp]
+	add	r12d,ecx
+	xor	eax,r11d
+	rol	esi,30
+	add	r12d,eax
+	mov	edx,DWORD[12+r9]
+	mov	eax,edi
+	mov	DWORD[8+rsp],r14d
+	mov	ecx,r12d
+	bswap	edx
+	xor	eax,esi
+	rol	ecx,5
+	and	eax,r13d
+	lea	r11d,[1518500249+r11*1+r14]
+	add	r11d,ecx
+	xor	eax,edi
+	rol	r13d,30
+	add	r11d,eax
+	mov	ebp,DWORD[16+r9]
+	mov	eax,esi
+	mov	DWORD[12+rsp],edx
+	mov	ecx,r11d
+	bswap	ebp
+	xor	eax,r13d
+	rol	ecx,5
+	and	eax,r12d
+	lea	edi,[1518500249+rdi*1+rdx]
+	add	edi,ecx
+	xor	eax,esi
+	rol	r12d,30
+	add	edi,eax
+	mov	r14d,DWORD[20+r9]
+	mov	eax,r13d
+	mov	DWORD[16+rsp],ebp
+	mov	ecx,edi
+	bswap	r14d
+	xor	eax,r12d
+	rol	ecx,5
+	and	eax,r11d
+	lea	esi,[1518500249+rsi*1+rbp]
+	add	esi,ecx
+	xor	eax,r13d
+	rol	r11d,30
+	add	esi,eax
+	mov	edx,DWORD[24+r9]
+	mov	eax,r12d
+	mov	DWORD[20+rsp],r14d
+	mov	ecx,esi
+	bswap	edx
+	xor	eax,r11d
+	rol	ecx,5
+	and	eax,edi
+	lea	r13d,[1518500249+r13*1+r14]
+	add	r13d,ecx
+	xor	eax,r12d
+	rol	edi,30
+	add	r13d,eax
+	mov	ebp,DWORD[28+r9]
+	mov	eax,r11d
+	mov	DWORD[24+rsp],edx
+	mov	ecx,r13d
+	bswap	ebp
+	xor	eax,edi
+	rol	ecx,5
+	and	eax,esi
+	lea	r12d,[1518500249+r12*1+rdx]
+	add	r12d,ecx
+	xor	eax,r11d
+	rol	esi,30
+	add	r12d,eax
+	mov	r14d,DWORD[32+r9]
+	mov	eax,edi
+	mov	DWORD[28+rsp],ebp
+	mov	ecx,r12d
+	bswap	r14d
+	xor	eax,esi
+	rol	ecx,5
+	and	eax,r13d
+	lea	r11d,[1518500249+r11*1+rbp]
+	add	r11d,ecx
+	xor	eax,edi
+	rol	r13d,30
+	add	r11d,eax
+	mov	edx,DWORD[36+r9]
+	mov	eax,esi
+	mov	DWORD[32+rsp],r14d
+	mov	ecx,r11d
+	bswap	edx
+	xor	eax,r13d
+	rol	ecx,5
+	and	eax,r12d
+	lea	edi,[1518500249+rdi*1+r14]
+	add	edi,ecx
+	xor	eax,esi
+	rol	r12d,30
+	add	edi,eax
+	mov	ebp,DWORD[40+r9]
+	mov	eax,r13d
+	mov	DWORD[36+rsp],edx
+	mov	ecx,edi
+	bswap	ebp
+	xor	eax,r12d
+	rol	ecx,5
+	and	eax,r11d
+	lea	esi,[1518500249+rsi*1+rdx]
+	add	esi,ecx
+	xor	eax,r13d
+	rol	r11d,30
+	add	esi,eax
+	mov	r14d,DWORD[44+r9]
+	mov	eax,r12d
+	mov	DWORD[40+rsp],ebp
+	mov	ecx,esi
+	bswap	r14d
+	xor	eax,r11d
+	rol	ecx,5
+	and	eax,edi
+	lea	r13d,[1518500249+r13*1+rbp]
+	add	r13d,ecx
+	xor	eax,r12d
+	rol	edi,30
+	add	r13d,eax
+	mov	edx,DWORD[48+r9]
+	mov	eax,r11d
+	mov	DWORD[44+rsp],r14d
+	mov	ecx,r13d
+	bswap	edx
+	xor	eax,edi
+	rol	ecx,5
+	and	eax,esi
+	lea	r12d,[1518500249+r12*1+r14]
+	add	r12d,ecx
+	xor	eax,r11d
+	rol	esi,30
+	add	r12d,eax
+	mov	ebp,DWORD[52+r9]
+	mov	eax,edi
+	mov	DWORD[48+rsp],edx
+	mov	ecx,r12d
+	bswap	ebp
+	xor	eax,esi
+	rol	ecx,5
+	and	eax,r13d
+	lea	r11d,[1518500249+r11*1+rdx]
+	add	r11d,ecx
+	xor	eax,edi
+	rol	r13d,30
+	add	r11d,eax
+	mov	r14d,DWORD[56+r9]
+	mov	eax,esi
+	mov	DWORD[52+rsp],ebp
+	mov	ecx,r11d
+	bswap	r14d
+	xor	eax,r13d
+	rol	ecx,5
+	and	eax,r12d
+	lea	edi,[1518500249+rdi*1+rbp]
+	add	edi,ecx
+	xor	eax,esi
+	rol	r12d,30
+	add	edi,eax
+	mov	edx,DWORD[60+r9]
+	mov	eax,r13d
+	mov	DWORD[56+rsp],r14d
+	mov	ecx,edi
+	bswap	edx
+	xor	eax,r12d
+	rol	ecx,5
+	and	eax,r11d
+	lea	esi,[1518500249+rsi*1+r14]
+	add	esi,ecx
+	xor	eax,r13d
+	rol	r11d,30
+	add	esi,eax
+	xor	ebp,DWORD[rsp]
+	mov	eax,r12d
+	mov	DWORD[60+rsp],edx
+	mov	ecx,esi
+	xor	ebp,DWORD[8+rsp]
+	xor	eax,r11d
+	rol	ecx,5
+	xor	ebp,DWORD[32+rsp]
+	and	eax,edi
+	lea	r13d,[1518500249+r13*1+rdx]
+	rol	edi,30
+	xor	eax,r12d
+	add	r13d,ecx
+	rol	ebp,1
+	add	r13d,eax
+	xor	r14d,DWORD[4+rsp]
+	mov	eax,r11d
+	mov	DWORD[rsp],ebp
+	mov	ecx,r13d
+	xor	r14d,DWORD[12+rsp]
+	xor	eax,edi
+	rol	ecx,5
+	xor	r14d,DWORD[36+rsp]
+	and	eax,esi
+	lea	r12d,[1518500249+r12*1+rbp]
+	rol	esi,30
+	xor	eax,r11d
+	add	r12d,ecx
+	rol	r14d,1
+	add	r12d,eax
+	xor	edx,DWORD[8+rsp]
+	mov	eax,edi
+	mov	DWORD[4+rsp],r14d
+	mov	ecx,r12d
+	xor	edx,DWORD[16+rsp]
+	xor	eax,esi
+	rol	ecx,5
+	xor	edx,DWORD[40+rsp]
+	and	eax,r13d
+	lea	r11d,[1518500249+r11*1+r14]
+	rol	r13d,30
+	xor	eax,edi
+	add	r11d,ecx
+	rol	edx,1
+	add	r11d,eax
+	xor	ebp,DWORD[12+rsp]
+	mov	eax,esi
+	mov	DWORD[8+rsp],edx
+	mov	ecx,r11d
+	xor	ebp,DWORD[20+rsp]
+	xor	eax,r13d
+	rol	ecx,5
+	xor	ebp,DWORD[44+rsp]
+	and	eax,r12d
+	lea	edi,[1518500249+rdi*1+rdx]
+	rol	r12d,30
+	xor	eax,esi
+	add	edi,ecx
+	rol	ebp,1
+	add	edi,eax
+	xor	r14d,DWORD[16+rsp]
+	mov	eax,r13d
+	mov	DWORD[12+rsp],ebp
+	mov	ecx,edi
+	xor	r14d,DWORD[24+rsp]
+	xor	eax,r12d
+	rol	ecx,5
+	xor	r14d,DWORD[48+rsp]
+	and	eax,r11d
+	lea	esi,[1518500249+rsi*1+rbp]
+	rol	r11d,30
+	xor	eax,r13d
+	add	esi,ecx
+	rol	r14d,1
+	add	esi,eax
+	xor	edx,DWORD[20+rsp]
+	mov	eax,edi
+	mov	DWORD[16+rsp],r14d
+	mov	ecx,esi
+	xor	edx,DWORD[28+rsp]
+	xor	eax,r12d
+	rol	ecx,5
+	xor	edx,DWORD[52+rsp]
+	lea	r13d,[1859775393+r13*1+r14]
+	xor	eax,r11d
+	add	r13d,ecx
+	rol	edi,30
+	add	r13d,eax
+	rol	edx,1
+	xor	ebp,DWORD[24+rsp]
+	mov	eax,esi
+	mov	DWORD[20+rsp],edx
+	mov	ecx,r13d
+	xor	ebp,DWORD[32+rsp]
+	xor	eax,r11d
+	rol	ecx,5
+	xor	ebp,DWORD[56+rsp]
+	lea	r12d,[1859775393+r12*1+rdx]
+	xor	eax,edi
+	add	r12d,ecx
+	rol	esi,30
+	add	r12d,eax
+	rol	ebp,1
+	xor	r14d,DWORD[28+rsp]
+	mov	eax,r13d
+	mov	DWORD[24+rsp],ebp
+	mov	ecx,r12d
+	xor	r14d,DWORD[36+rsp]
+	xor	eax,edi
+	rol	ecx,5
+	xor	r14d,DWORD[60+rsp]
+	lea	r11d,[1859775393+r11*1+rbp]
+	xor	eax,esi
+	add	r11d,ecx
+	rol	r13d,30
+	add	r11d,eax
+	rol	r14d,1
+	xor	edx,DWORD[32+rsp]
+	mov	eax,r12d
+	mov	DWORD[28+rsp],r14d
+	mov	ecx,r11d
+	xor	edx,DWORD[40+rsp]
+	xor	eax,esi
+	rol	ecx,5
+	xor	edx,DWORD[rsp]
+	lea	edi,[1859775393+rdi*1+r14]
+	xor	eax,r13d
+	add	edi,ecx
+	rol	r12d,30
+	add	edi,eax
+	rol	edx,1
+	xor	ebp,DWORD[36+rsp]
+	mov	eax,r11d
+	mov	DWORD[32+rsp],edx
+	mov	ecx,edi
+	xor	ebp,DWORD[44+rsp]
+	xor	eax,r13d
+	rol	ecx,5
+	xor	ebp,DWORD[4+rsp]
+	lea	esi,[1859775393+rsi*1+rdx]
+	xor	eax,r12d
+	add	esi,ecx
+	rol	r11d,30
+	add	esi,eax
+	rol	ebp,1
+	xor	r14d,DWORD[40+rsp]
+	mov	eax,edi
+	mov	DWORD[36+rsp],ebp
+	mov	ecx,esi
+	xor	r14d,DWORD[48+rsp]
+	xor	eax,r12d
+	rol	ecx,5
+	xor	r14d,DWORD[8+rsp]
+	lea	r13d,[1859775393+r13*1+rbp]
+	xor	eax,r11d
+	add	r13d,ecx
+	rol	edi,30
+	add	r13d,eax
+	rol	r14d,1
+	xor	edx,DWORD[44+rsp]
+	mov	eax,esi
+	mov	DWORD[40+rsp],r14d
+	mov	ecx,r13d
+	xor	edx,DWORD[52+rsp]
+	xor	eax,r11d
+	rol	ecx,5
+	xor	edx,DWORD[12+rsp]
+	lea	r12d,[1859775393+r12*1+r14]
+	xor	eax,edi
+	add	r12d,ecx
+	rol	esi,30
+	add	r12d,eax
+	rol	edx,1
+	xor	ebp,DWORD[48+rsp]
+	mov	eax,r13d
+	mov	DWORD[44+rsp],edx
+	mov	ecx,r12d
+	xor	ebp,DWORD[56+rsp]
+	xor	eax,edi
+	rol	ecx,5
+	xor	ebp,DWORD[16+rsp]
+	lea	r11d,[1859775393+r11*1+rdx]
+	xor	eax,esi
+	add	r11d,ecx
+	rol	r13d,30
+	add	r11d,eax
+	rol	ebp,1
+	xor	r14d,DWORD[52+rsp]
+	mov	eax,r12d
+	mov	DWORD[48+rsp],ebp
+	mov	ecx,r11d
+	xor	r14d,DWORD[60+rsp]
+	xor	eax,esi
+	rol	ecx,5
+	xor	r14d,DWORD[20+rsp]
+	lea	edi,[1859775393+rdi*1+rbp]
+	xor	eax,r13d
+	add	edi,ecx
+	rol	r12d,30
+	add	edi,eax
+	rol	r14d,1
+	xor	edx,DWORD[56+rsp]
+	mov	eax,r11d
+	mov	DWORD[52+rsp],r14d
+	mov	ecx,edi
+	xor	edx,DWORD[rsp]
+	xor	eax,r13d
+	rol	ecx,5
+	xor	edx,DWORD[24+rsp]
+	lea	esi,[1859775393+rsi*1+r14]
+	xor	eax,r12d
+	add	esi,ecx
+	rol	r11d,30
+	add	esi,eax
+	rol	edx,1
+	xor	ebp,DWORD[60+rsp]
+	mov	eax,edi
+	mov	DWORD[56+rsp],edx
+	mov	ecx,esi
+	xor	ebp,DWORD[4+rsp]
+	xor	eax,r12d
+	rol	ecx,5
+	xor	ebp,DWORD[28+rsp]
+	lea	r13d,[1859775393+r13*1+rdx]
+	xor	eax,r11d
+	add	r13d,ecx
+	rol	edi,30
+	add	r13d,eax
+	rol	ebp,1
+	xor	r14d,DWORD[rsp]
+	mov	eax,esi
+	mov	DWORD[60+rsp],ebp
+	mov	ecx,r13d
+	xor	r14d,DWORD[8+rsp]
+	xor	eax,r11d
+	rol	ecx,5
+	xor	r14d,DWORD[32+rsp]
+	lea	r12d,[1859775393+r12*1+rbp]
+	xor	eax,edi
+	add	r12d,ecx
+	rol	esi,30
+	add	r12d,eax
+	rol	r14d,1
+	xor	edx,DWORD[4+rsp]
+	mov	eax,r13d
+	mov	DWORD[rsp],r14d
+	mov	ecx,r12d
+	xor	edx,DWORD[12+rsp]
+	xor	eax,edi
+	rol	ecx,5
+	xor	edx,DWORD[36+rsp]
+	lea	r11d,[1859775393+r11*1+r14]
+	xor	eax,esi
+	add	r11d,ecx
+	rol	r13d,30
+	add	r11d,eax
+	rol	edx,1
+	xor	ebp,DWORD[8+rsp]
+	mov	eax,r12d
+	mov	DWORD[4+rsp],edx
+	mov	ecx,r11d
+	xor	ebp,DWORD[16+rsp]
+	xor	eax,esi
+	rol	ecx,5
+	xor	ebp,DWORD[40+rsp]
+	lea	edi,[1859775393+rdi*1+rdx]
+	xor	eax,r13d
+	add	edi,ecx
+	rol	r12d,30
+	add	edi,eax
+	rol	ebp,1
+	xor	r14d,DWORD[12+rsp]
+	mov	eax,r11d
+	mov	DWORD[8+rsp],ebp
+	mov	ecx,edi
+	xor	r14d,DWORD[20+rsp]
+	xor	eax,r13d
+	rol	ecx,5
+	xor	r14d,DWORD[44+rsp]
+	lea	esi,[1859775393+rsi*1+rbp]
+	xor	eax,r12d
+	add	esi,ecx
+	rol	r11d,30
+	add	esi,eax
+	rol	r14d,1
+	xor	edx,DWORD[16+rsp]
+	mov	eax,edi
+	mov	DWORD[12+rsp],r14d
+	mov	ecx,esi
+	xor	edx,DWORD[24+rsp]
+	xor	eax,r12d
+	rol	ecx,5
+	xor	edx,DWORD[48+rsp]
+	lea	r13d,[1859775393+r13*1+r14]
+	xor	eax,r11d
+	add	r13d,ecx
+	rol	edi,30
+	add	r13d,eax
+	rol	edx,1
+	xor	ebp,DWORD[20+rsp]
+	mov	eax,esi
+	mov	DWORD[16+rsp],edx
+	mov	ecx,r13d
+	xor	ebp,DWORD[28+rsp]
+	xor	eax,r11d
+	rol	ecx,5
+	xor	ebp,DWORD[52+rsp]
+	lea	r12d,[1859775393+r12*1+rdx]
+	xor	eax,edi
+	add	r12d,ecx
+	rol	esi,30
+	add	r12d,eax
+	rol	ebp,1
+	xor	r14d,DWORD[24+rsp]
+	mov	eax,r13d
+	mov	DWORD[20+rsp],ebp
+	mov	ecx,r12d
+	xor	r14d,DWORD[32+rsp]
+	xor	eax,edi
+	rol	ecx,5
+	xor	r14d,DWORD[56+rsp]
+	lea	r11d,[1859775393+r11*1+rbp]
+	xor	eax,esi
+	add	r11d,ecx
+	rol	r13d,30
+	add	r11d,eax
+	rol	r14d,1
+	xor	edx,DWORD[28+rsp]
+	mov	eax,r12d
+	mov	DWORD[24+rsp],r14d
+	mov	ecx,r11d
+	xor	edx,DWORD[36+rsp]
+	xor	eax,esi
+	rol	ecx,5
+	xor	edx,DWORD[60+rsp]
+	lea	edi,[1859775393+rdi*1+r14]
+	xor	eax,r13d
+	add	edi,ecx
+	rol	r12d,30
+	add	edi,eax
+	rol	edx,1
+	xor	ebp,DWORD[32+rsp]
+	mov	eax,r11d
+	mov	DWORD[28+rsp],edx
+	mov	ecx,edi
+	xor	ebp,DWORD[40+rsp]
+	xor	eax,r13d
+	rol	ecx,5
+	xor	ebp,DWORD[rsp]
+	lea	esi,[1859775393+rsi*1+rdx]
+	xor	eax,r12d
+	add	esi,ecx
+	rol	r11d,30
+	add	esi,eax
+	rol	ebp,1
+	xor	r14d,DWORD[36+rsp]
+	mov	eax,r12d
+	mov	DWORD[32+rsp],ebp
+	mov	ebx,r12d
+	xor	r14d,DWORD[44+rsp]
+	and	eax,r11d
+	mov	ecx,esi
+	xor	r14d,DWORD[4+rsp]
+	lea	r13d,[((-1894007588))+r13*1+rbp]
+	xor	ebx,r11d
+	rol	ecx,5
+	add	r13d,eax
+	rol	r14d,1
+	and	ebx,edi
+	add	r13d,ecx
+	rol	edi,30
+	add	r13d,ebx
+	xor	edx,DWORD[40+rsp]
+	mov	eax,r11d
+	mov	DWORD[36+rsp],r14d
+	mov	ebx,r11d
+	xor	edx,DWORD[48+rsp]
+	and	eax,edi
+	mov	ecx,r13d
+	xor	edx,DWORD[8+rsp]
+	lea	r12d,[((-1894007588))+r12*1+r14]
+	xor	ebx,edi
+	rol	ecx,5
+	add	r12d,eax
+	rol	edx,1
+	and	ebx,esi
+	add	r12d,ecx
+	rol	esi,30
+	add	r12d,ebx
+	xor	ebp,DWORD[44+rsp]
+	mov	eax,edi
+	mov	DWORD[40+rsp],edx
+	mov	ebx,edi
+	xor	ebp,DWORD[52+rsp]
+	and	eax,esi
+	mov	ecx,r12d
+	xor	ebp,DWORD[12+rsp]
+	lea	r11d,[((-1894007588))+r11*1+rdx]
+	xor	ebx,esi
+	rol	ecx,5
+	add	r11d,eax
+	rol	ebp,1
+	and	ebx,r13d
+	add	r11d,ecx
+	rol	r13d,30
+	add	r11d,ebx
+	xor	r14d,DWORD[48+rsp]
+	mov	eax,esi
+	mov	DWORD[44+rsp],ebp
+	mov	ebx,esi
+	xor	r14d,DWORD[56+rsp]
+	and	eax,r13d
+	mov	ecx,r11d
+	xor	r14d,DWORD[16+rsp]
+	lea	edi,[((-1894007588))+rdi*1+rbp]
+	xor	ebx,r13d
+	rol	ecx,5
+	add	edi,eax
+	rol	r14d,1
+	and	ebx,r12d
+	add	edi,ecx
+	rol	r12d,30
+	add	edi,ebx
+	xor	edx,DWORD[52+rsp]
+	mov	eax,r13d
+	mov	DWORD[48+rsp],r14d
+	mov	ebx,r13d
+	xor	edx,DWORD[60+rsp]
+	and	eax,r12d
+	mov	ecx,edi
+	xor	edx,DWORD[20+rsp]
+	lea	esi,[((-1894007588))+rsi*1+r14]
+	xor	ebx,r12d
+	rol	ecx,5
+	add	esi,eax
+	rol	edx,1
+	and	ebx,r11d
+	add	esi,ecx
+	rol	r11d,30
+	add	esi,ebx
+	xor	ebp,DWORD[56+rsp]
+	mov	eax,r12d
+	mov	DWORD[52+rsp],edx
+	mov	ebx,r12d
+	xor	ebp,DWORD[rsp]
+	and	eax,r11d
+	mov	ecx,esi
+	xor	ebp,DWORD[24+rsp]
+	lea	r13d,[((-1894007588))+r13*1+rdx]
+	xor	ebx,r11d
+	rol	ecx,5
+	add	r13d,eax
+	rol	ebp,1
+	and	ebx,edi
+	add	r13d,ecx
+	rol	edi,30
+	add	r13d,ebx
+	xor	r14d,DWORD[60+rsp]
+	mov	eax,r11d
+	mov	DWORD[56+rsp],ebp
+	mov	ebx,r11d
+	xor	r14d,DWORD[4+rsp]
+	and	eax,edi
+	mov	ecx,r13d
+	xor	r14d,DWORD[28+rsp]
+	lea	r12d,[((-1894007588))+r12*1+rbp]
+	xor	ebx,edi
+	rol	ecx,5
+	add	r12d,eax
+	rol	r14d,1
+	and	ebx,esi
+	add	r12d,ecx
+	rol	esi,30
+	add	r12d,ebx
+	xor	edx,DWORD[rsp]
+	mov	eax,edi
+	mov	DWORD[60+rsp],r14d
+	mov	ebx,edi
+	xor	edx,DWORD[8+rsp]
+	and	eax,esi
+	mov	ecx,r12d
+	xor	edx,DWORD[32+rsp]
+	lea	r11d,[((-1894007588))+r11*1+r14]
+	xor	ebx,esi
+	rol	ecx,5
+	add	r11d,eax
+	rol	edx,1
+	and	ebx,r13d
+	add	r11d,ecx
+	rol	r13d,30
+	add	r11d,ebx
+	xor	ebp,DWORD[4+rsp]
+	mov	eax,esi
+	mov	DWORD[rsp],edx
+	mov	ebx,esi
+	xor	ebp,DWORD[12+rsp]
+	and	eax,r13d
+	mov	ecx,r11d
+	xor	ebp,DWORD[36+rsp]
+	lea	edi,[((-1894007588))+rdi*1+rdx]
+	xor	ebx,r13d
+	rol	ecx,5
+	add	edi,eax
+	rol	ebp,1
+	and	ebx,r12d
+	add	edi,ecx
+	rol	r12d,30
+	add	edi,ebx
+	xor	r14d,DWORD[8+rsp]
+	mov	eax,r13d
+	mov	DWORD[4+rsp],ebp
+	mov	ebx,r13d
+	xor	r14d,DWORD[16+rsp]
+	and	eax,r12d
+	mov	ecx,edi
+	xor	r14d,DWORD[40+rsp]
+	lea	esi,[((-1894007588))+rsi*1+rbp]
+	xor	ebx,r12d
+	rol	ecx,5
+	add	esi,eax
+	rol	r14d,1
+	and	ebx,r11d
+	add	esi,ecx
+	rol	r11d,30
+	add	esi,ebx
+	xor	edx,DWORD[12+rsp]
+	mov	eax,r12d
+	mov	DWORD[8+rsp],r14d
+	mov	ebx,r12d
+	xor	edx,DWORD[20+rsp]
+	and	eax,r11d
+	mov	ecx,esi
+	xor	edx,DWORD[44+rsp]
+	lea	r13d,[((-1894007588))+r13*1+r14]
+	xor	ebx,r11d
+	rol	ecx,5
+	add	r13d,eax
+	rol	edx,1
+	and	ebx,edi
+	add	r13d,ecx
+	rol	edi,30
+	add	r13d,ebx
+	xor	ebp,DWORD[16+rsp]
+	mov	eax,r11d
+	mov	DWORD[12+rsp],edx
+	mov	ebx,r11d
+	xor	ebp,DWORD[24+rsp]
+	and	eax,edi
+	mov	ecx,r13d
+	xor	ebp,DWORD[48+rsp]
+	lea	r12d,[((-1894007588))+r12*1+rdx]
+	xor	ebx,edi
+	rol	ecx,5
+	add	r12d,eax
+	rol	ebp,1
+	and	ebx,esi
+	add	r12d,ecx
+	rol	esi,30
+	add	r12d,ebx
+	xor	r14d,DWORD[20+rsp]
+	mov	eax,edi
+	mov	DWORD[16+rsp],ebp
+	mov	ebx,edi
+	xor	r14d,DWORD[28+rsp]
+	and	eax,esi
+	mov	ecx,r12d
+	xor	r14d,DWORD[52+rsp]
+	lea	r11d,[((-1894007588))+r11*1+rbp]
+	xor	ebx,esi
+	rol	ecx,5
+	add	r11d,eax
+	rol	r14d,1
+	and	ebx,r13d
+	add	r11d,ecx
+	rol	r13d,30
+	add	r11d,ebx
+	xor	edx,DWORD[24+rsp]
+	mov	eax,esi
+	mov	DWORD[20+rsp],r14d
+	mov	ebx,esi
+	xor	edx,DWORD[32+rsp]
+	and	eax,r13d
+	mov	ecx,r11d
+	xor	edx,DWORD[56+rsp]
+	lea	edi,[((-1894007588))+rdi*1+r14]
+	xor	ebx,r13d
+	rol	ecx,5
+	add	edi,eax
+	rol	edx,1
+	and	ebx,r12d
+	add	edi,ecx
+	rol	r12d,30
+	add	edi,ebx
+	xor	ebp,DWORD[28+rsp]
+	mov	eax,r13d
+	mov	DWORD[24+rsp],edx
+	mov	ebx,r13d
+	xor	ebp,DWORD[36+rsp]
+	and	eax,r12d
+	mov	ecx,edi
+	xor	ebp,DWORD[60+rsp]
+	lea	esi,[((-1894007588))+rsi*1+rdx]
+	xor	ebx,r12d
+	rol	ecx,5
+	add	esi,eax
+	rol	ebp,1
+	and	ebx,r11d
+	add	esi,ecx
+	rol	r11d,30
+	add	esi,ebx
+	xor	r14d,DWORD[32+rsp]
+	mov	eax,r12d
+	mov	DWORD[28+rsp],ebp
+	mov	ebx,r12d
+	xor	r14d,DWORD[40+rsp]
+	and	eax,r11d
+	mov	ecx,esi
+	xor	r14d,DWORD[rsp]
+	lea	r13d,[((-1894007588))+r13*1+rbp]
+	xor	ebx,r11d
+	rol	ecx,5
+	add	r13d,eax
+	rol	r14d,1
+	and	ebx,edi
+	add	r13d,ecx
+	rol	edi,30
+	add	r13d,ebx
+	xor	edx,DWORD[36+rsp]
+	mov	eax,r11d
+	mov	DWORD[32+rsp],r14d
+	mov	ebx,r11d
+	xor	edx,DWORD[44+rsp]
+	and	eax,edi
+	mov	ecx,r13d
+	xor	edx,DWORD[4+rsp]
+	lea	r12d,[((-1894007588))+r12*1+r14]
+	xor	ebx,edi
+	rol	ecx,5
+	add	r12d,eax
+	rol	edx,1
+	and	ebx,esi
+	add	r12d,ecx
+	rol	esi,30
+	add	r12d,ebx
+	xor	ebp,DWORD[40+rsp]
+	mov	eax,edi
+	mov	DWORD[36+rsp],edx
+	mov	ebx,edi
+	xor	ebp,DWORD[48+rsp]
+	and	eax,esi
+	mov	ecx,r12d
+	xor	ebp,DWORD[8+rsp]
+	lea	r11d,[((-1894007588))+r11*1+rdx]
+	xor	ebx,esi
+	rol	ecx,5
+	add	r11d,eax
+	rol	ebp,1
+	and	ebx,r13d
+	add	r11d,ecx
+	rol	r13d,30
+	add	r11d,ebx
+	xor	r14d,DWORD[44+rsp]
+	mov	eax,esi
+	mov	DWORD[40+rsp],ebp
+	mov	ebx,esi
+	xor	r14d,DWORD[52+rsp]
+	and	eax,r13d
+	mov	ecx,r11d
+	xor	r14d,DWORD[12+rsp]
+	lea	edi,[((-1894007588))+rdi*1+rbp]
+	xor	ebx,r13d
+	rol	ecx,5
+	add	edi,eax
+	rol	r14d,1
+	and	ebx,r12d
+	add	edi,ecx
+	rol	r12d,30
+	add	edi,ebx
+	xor	edx,DWORD[48+rsp]
+	mov	eax,r13d
+	mov	DWORD[44+rsp],r14d
+	mov	ebx,r13d
+	xor	edx,DWORD[56+rsp]
+	and	eax,r12d
+	mov	ecx,edi
+	xor	edx,DWORD[16+rsp]
+	lea	esi,[((-1894007588))+rsi*1+r14]
+	xor	ebx,r12d
+	rol	ecx,5
+	add	esi,eax
+	rol	edx,1
+	and	ebx,r11d
+	add	esi,ecx
+	rol	r11d,30
+	add	esi,ebx
+	xor	ebp,DWORD[52+rsp]
+	mov	eax,edi
+	mov	DWORD[48+rsp],edx
+	mov	ecx,esi
+	xor	ebp,DWORD[60+rsp]
+	xor	eax,r12d
+	rol	ecx,5
+	xor	ebp,DWORD[20+rsp]
+	lea	r13d,[((-899497514))+r13*1+rdx]
+	xor	eax,r11d
+	add	r13d,ecx
+	rol	edi,30
+	add	r13d,eax
+	rol	ebp,1
+	xor	r14d,DWORD[56+rsp]
+	mov	eax,esi
+	mov	DWORD[52+rsp],ebp
+	mov	ecx,r13d
+	xor	r14d,DWORD[rsp]
+	xor	eax,r11d
+	rol	ecx,5
+	xor	r14d,DWORD[24+rsp]
+	lea	r12d,[((-899497514))+r12*1+rbp]
+	xor	eax,edi
+	add	r12d,ecx
+	rol	esi,30
+	add	r12d,eax
+	rol	r14d,1
+	xor	edx,DWORD[60+rsp]
+	mov	eax,r13d
+	mov	DWORD[56+rsp],r14d
+	mov	ecx,r12d
+	xor	edx,DWORD[4+rsp]
+	xor	eax,edi
+	rol	ecx,5
+	xor	edx,DWORD[28+rsp]
+	lea	r11d,[((-899497514))+r11*1+r14]
+	xor	eax,esi
+	add	r11d,ecx
+	rol	r13d,30
+	add	r11d,eax
+	rol	edx,1
+	xor	ebp,DWORD[rsp]
+	mov	eax,r12d
+	mov	DWORD[60+rsp],edx
+	mov	ecx,r11d
+	xor	ebp,DWORD[8+rsp]
+	xor	eax,esi
+	rol	ecx,5
+	xor	ebp,DWORD[32+rsp]
+	lea	edi,[((-899497514))+rdi*1+rdx]
+	xor	eax,r13d
+	add	edi,ecx
+	rol	r12d,30
+	add	edi,eax
+	rol	ebp,1
+	xor	r14d,DWORD[4+rsp]
+	mov	eax,r11d
+	mov	DWORD[rsp],ebp
+	mov	ecx,edi
+	xor	r14d,DWORD[12+rsp]
+	xor	eax,r13d
+	rol	ecx,5
+	xor	r14d,DWORD[36+rsp]
+	lea	esi,[((-899497514))+rsi*1+rbp]
+	xor	eax,r12d
+	add	esi,ecx
+	rol	r11d,30
+	add	esi,eax
+	rol	r14d,1
+	xor	edx,DWORD[8+rsp]
+	mov	eax,edi
+	mov	DWORD[4+rsp],r14d
+	mov	ecx,esi
+	xor	edx,DWORD[16+rsp]
+	xor	eax,r12d
+	rol	ecx,5
+	xor	edx,DWORD[40+rsp]
+	lea	r13d,[((-899497514))+r13*1+r14]
+	xor	eax,r11d
+	add	r13d,ecx
+	rol	edi,30
+	add	r13d,eax
+	rol	edx,1
+	xor	ebp,DWORD[12+rsp]
+	mov	eax,esi
+	mov	DWORD[8+rsp],edx
+	mov	ecx,r13d
+	xor	ebp,DWORD[20+rsp]
+	xor	eax,r11d
+	rol	ecx,5
+	xor	ebp,DWORD[44+rsp]
+	lea	r12d,[((-899497514))+r12*1+rdx]
+	xor	eax,edi
+	add	r12d,ecx
+	rol	esi,30
+	add	r12d,eax
+	rol	ebp,1
+	xor	r14d,DWORD[16+rsp]
+	mov	eax,r13d
+	mov	DWORD[12+rsp],ebp
+	mov	ecx,r12d
+	xor	r14d,DWORD[24+rsp]
+	xor	eax,edi
+	rol	ecx,5
+	xor	r14d,DWORD[48+rsp]
+	lea	r11d,[((-899497514))+r11*1+rbp]
+	xor	eax,esi
+	add	r11d,ecx
+	rol	r13d,30
+	add	r11d,eax
+	rol	r14d,1
+	xor	edx,DWORD[20+rsp]
+	mov	eax,r12d
+	mov	DWORD[16+rsp],r14d
+	mov	ecx,r11d
+	xor	edx,DWORD[28+rsp]
+	xor	eax,esi
+	rol	ecx,5
+	xor	edx,DWORD[52+rsp]
+	lea	edi,[((-899497514))+rdi*1+r14]
+	xor	eax,r13d
+	add	edi,ecx
+	rol	r12d,30
+	add	edi,eax
+	rol	edx,1
+	xor	ebp,DWORD[24+rsp]
+	mov	eax,r11d
+	mov	DWORD[20+rsp],edx
+	mov	ecx,edi
+	xor	ebp,DWORD[32+rsp]
+	xor	eax,r13d
+	rol	ecx,5
+	xor	ebp,DWORD[56+rsp]
+	lea	esi,[((-899497514))+rsi*1+rdx]
+	xor	eax,r12d
+	add	esi,ecx
+	rol	r11d,30
+	add	esi,eax
+	rol	ebp,1
+	xor	r14d,DWORD[28+rsp]
+	mov	eax,edi
+	mov	DWORD[24+rsp],ebp
+	mov	ecx,esi
+	xor	r14d,DWORD[36+rsp]
+	xor	eax,r12d
+	rol	ecx,5
+	xor	r14d,DWORD[60+rsp]
+	lea	r13d,[((-899497514))+r13*1+rbp]
+	xor	eax,r11d
+	add	r13d,ecx
+	rol	edi,30
+	add	r13d,eax
+	rol	r14d,1
+	xor	edx,DWORD[32+rsp]
+	mov	eax,esi
+	mov	DWORD[28+rsp],r14d
+	mov	ecx,r13d
+	xor	edx,DWORD[40+rsp]
+	xor	eax,r11d
+	rol	ecx,5
+	xor	edx,DWORD[rsp]
+	lea	r12d,[((-899497514))+r12*1+r14]
+	xor	eax,edi
+	add	r12d,ecx
+	rol	esi,30
+	add	r12d,eax
+	rol	edx,1
+	xor	ebp,DWORD[36+rsp]
+	mov	eax,r13d
+
+	mov	ecx,r12d
+	xor	ebp,DWORD[44+rsp]
+	xor	eax,edi
+	rol	ecx,5
+	xor	ebp,DWORD[4+rsp]
+	lea	r11d,[((-899497514))+r11*1+rdx]
+	xor	eax,esi
+	add	r11d,ecx
+	rol	r13d,30
+	add	r11d,eax
+	rol	ebp,1
+	xor	r14d,DWORD[40+rsp]
+	mov	eax,r12d
+
+	mov	ecx,r11d
+	xor	r14d,DWORD[48+rsp]
+	xor	eax,esi
+	rol	ecx,5
+	xor	r14d,DWORD[8+rsp]
+	lea	edi,[((-899497514))+rdi*1+rbp]
+	xor	eax,r13d
+	add	edi,ecx
+	rol	r12d,30
+	add	edi,eax
+	rol	r14d,1
+	xor	edx,DWORD[44+rsp]
+	mov	eax,r11d
+
+	mov	ecx,edi
+	xor	edx,DWORD[52+rsp]
+	xor	eax,r13d
+	rol	ecx,5
+	xor	edx,DWORD[12+rsp]
+	lea	esi,[((-899497514))+rsi*1+r14]
+	xor	eax,r12d
+	add	esi,ecx
+	rol	r11d,30
+	add	esi,eax
+	rol	edx,1
+	xor	ebp,DWORD[48+rsp]
+	mov	eax,edi
+
+	mov	ecx,esi
+	xor	ebp,DWORD[56+rsp]
+	xor	eax,r12d
+	rol	ecx,5
+	xor	ebp,DWORD[16+rsp]
+	lea	r13d,[((-899497514))+r13*1+rdx]
+	xor	eax,r11d
+	add	r13d,ecx
+	rol	edi,30
+	add	r13d,eax
+	rol	ebp,1
+	xor	r14d,DWORD[52+rsp]
+	mov	eax,esi
+
+	mov	ecx,r13d
+	xor	r14d,DWORD[60+rsp]
+	xor	eax,r11d
+	rol	ecx,5
+	xor	r14d,DWORD[20+rsp]
+	lea	r12d,[((-899497514))+r12*1+rbp]
+	xor	eax,edi
+	add	r12d,ecx
+	rol	esi,30
+	add	r12d,eax
+	rol	r14d,1
+	xor	edx,DWORD[56+rsp]
+	mov	eax,r13d
+
+	mov	ecx,r12d
+	xor	edx,DWORD[rsp]
+	xor	eax,edi
+	rol	ecx,5
+	xor	edx,DWORD[24+rsp]
+	lea	r11d,[((-899497514))+r11*1+r14]
+	xor	eax,esi
+	add	r11d,ecx
+	rol	r13d,30
+	add	r11d,eax
+	rol	edx,1
+	xor	ebp,DWORD[60+rsp]
+	mov	eax,r12d
+
+	mov	ecx,r11d
+	xor	ebp,DWORD[4+rsp]
+	xor	eax,esi
+	rol	ecx,5
+	xor	ebp,DWORD[28+rsp]
+	lea	edi,[((-899497514))+rdi*1+rdx]
+	xor	eax,r13d
+	add	edi,ecx
+	rol	r12d,30
+	add	edi,eax
+	rol	ebp,1
+	mov	eax,r11d
+	mov	ecx,edi
+	xor	eax,r13d
+	lea	esi,[((-899497514))+rsi*1+rbp]
+	rol	ecx,5
+	xor	eax,r12d
+	add	esi,ecx
+	rol	r11d,30
+	add	esi,eax
+	add	esi,DWORD[r8]
+	add	edi,DWORD[4+r8]
+	add	r11d,DWORD[8+r8]
+	add	r12d,DWORD[12+r8]
+	add	r13d,DWORD[16+r8]
+	mov	DWORD[r8],esi
+	mov	DWORD[4+r8],edi
+	mov	DWORD[8+r8],r11d
+	mov	DWORD[12+r8],r12d
+	mov	DWORD[16+r8],r13d
+
+	sub	r10,1
+	lea	r9,[64+r9]
+	jnz	NEAR $L$loop
+
+	mov	rsi,QWORD[64+rsp]
+	mov	r14,QWORD[((-40))+rsi]
+	mov	r13,QWORD[((-32))+rsi]
+	mov	r12,QWORD[((-24))+rsi]
+	mov	rbp,QWORD[((-16))+rsi]
+	mov	rbx,QWORD[((-8))+rsi]
+	lea	rsp,[rsi]
+$L$epilogue:
+	mov	rdi,QWORD[8+rsp]	;WIN64 epilogue
+	mov	rsi,QWORD[16+rsp]
+	DB	0F3h,0C3h		;repret
+$L$SEH_end_sha1_block_data_order:
+
+ALIGN	16
+sha1_block_data_order_ssse3:
+	mov	QWORD[8+rsp],rdi	;WIN64 prologue
+	mov	QWORD[16+rsp],rsi
+	mov	rax,rsp
+$L$SEH_begin_sha1_block_data_order_ssse3:
+	mov	rdi,rcx
+	mov	rsi,rdx
+	mov	rdx,r8
+
+
+_ssse3_shortcut:
+	mov	rax,rsp
+	push	rbx
+	push	rbp
+	push	r12
+	push	r13
+	push	r14
+	lea	rsp,[((-160))+rsp]
+	movaps	XMMWORD[(-40-96)+rax],xmm6
+	movaps	XMMWORD[(-40-80)+rax],xmm7
+	movaps	XMMWORD[(-40-64)+rax],xmm8
+	movaps	XMMWORD[(-40-48)+rax],xmm9
+	movaps	XMMWORD[(-40-32)+rax],xmm10
+	movaps	XMMWORD[(-40-16)+rax],xmm11
+$L$prologue_ssse3:
+	mov	r14,rax
+	and	rsp,-64
+	mov	r8,rdi
+	mov	r9,rsi
+	mov	r10,rdx
+
+	shl	r10,6
+	add	r10,r9
+	lea	r11,[((K_XX_XX+64))]
+
+	mov	eax,DWORD[r8]
+	mov	ebx,DWORD[4+r8]
+	mov	ecx,DWORD[8+r8]
+	mov	edx,DWORD[12+r8]
+	mov	esi,ebx
+	mov	ebp,DWORD[16+r8]
+	mov	edi,ecx
+	xor	edi,edx
+	and	esi,edi
+
+	movdqa	xmm6,XMMWORD[64+r11]
+	movdqa	xmm9,XMMWORD[((-64))+r11]
+	movdqu	xmm0,XMMWORD[r9]
+	movdqu	xmm1,XMMWORD[16+r9]
+	movdqu	xmm2,XMMWORD[32+r9]
+	movdqu	xmm3,XMMWORD[48+r9]
+DB	102,15,56,0,198
+DB	102,15,56,0,206
+DB	102,15,56,0,214
+	add	r9,64
+	paddd	xmm0,xmm9
+DB	102,15,56,0,222
+	paddd	xmm1,xmm9
+	paddd	xmm2,xmm9
+	movdqa	XMMWORD[rsp],xmm0
+	psubd	xmm0,xmm9
+	movdqa	XMMWORD[16+rsp],xmm1
+	psubd	xmm1,xmm9
+	movdqa	XMMWORD[32+rsp],xmm2
+	psubd	xmm2,xmm9
+	jmp	NEAR $L$oop_ssse3
+ALIGN	16
+$L$oop_ssse3:
+	ror	ebx,2
+	pshufd	xmm4,xmm0,238
+	xor	esi,edx
+	movdqa	xmm8,xmm3
+	paddd	xmm9,xmm3
+	mov	edi,eax
+	add	ebp,DWORD[rsp]
+	punpcklqdq	xmm4,xmm1
+	xor	ebx,ecx
+	rol	eax,5
+	add	ebp,esi
+	psrldq	xmm8,4
+	and	edi,ebx
+	xor	ebx,ecx
+	pxor	xmm4,xmm0
+	add	ebp,eax
+	ror	eax,7
+	pxor	xmm8,xmm2
+	xor	edi,ecx
+	mov	esi,ebp
+	add	edx,DWORD[4+rsp]
+	pxor	xmm4,xmm8
+	xor	eax,ebx
+	rol	ebp,5
+	movdqa	XMMWORD[48+rsp],xmm9
+	add	edx,edi
+	and	esi,eax
+	movdqa	xmm10,xmm4
+	xor	eax,ebx
+	add	edx,ebp
+	ror	ebp,7
+	movdqa	xmm8,xmm4
+	xor	esi,ebx
+	pslldq	xmm10,12
+	paddd	xmm4,xmm4
+	mov	edi,edx
+	add	ecx,DWORD[8+rsp]
+	psrld	xmm8,31
+	xor	ebp,eax
+	rol	edx,5
+	add	ecx,esi
+	movdqa	xmm9,xmm10
+	and	edi,ebp
+	xor	ebp,eax
+	psrld	xmm10,30
+	add	ecx,edx
+	ror	edx,7
+	por	xmm4,xmm8
+	xor	edi,eax
+	mov	esi,ecx
+	add	ebx,DWORD[12+rsp]
+	pslld	xmm9,2
+	pxor	xmm4,xmm10
+	xor	edx,ebp
+	movdqa	xmm10,XMMWORD[((-64))+r11]
+	rol	ecx,5
+	add	ebx,edi
+	and	esi,edx
+	pxor	xmm4,xmm9
+	xor	edx,ebp
+	add	ebx,ecx
+	ror	ecx,7
+	pshufd	xmm5,xmm1,238
+	xor	esi,ebp
+	movdqa	xmm9,xmm4
+	paddd	xmm10,xmm4
+	mov	edi,ebx
+	add	eax,DWORD[16+rsp]
+	punpcklqdq	xmm5,xmm2
+	xor	ecx,edx
+	rol	ebx,5
+	add	eax,esi
+	psrldq	xmm9,4
+	and	edi,ecx
+	xor	ecx,edx
+	pxor	xmm5,xmm1
+	add	eax,ebx
+	ror	ebx,7
+	pxor	xmm9,xmm3
+	xor	edi,edx
+	mov	esi,eax
+	add	ebp,DWORD[20+rsp]
+	pxor	xmm5,xmm9
+	xor	ebx,ecx
+	rol	eax,5
+	movdqa	XMMWORD[rsp],xmm10
+	add	ebp,edi
+	and	esi,ebx
+	movdqa	xmm8,xmm5
+	xor	ebx,ecx
+	add	ebp,eax
+	ror	eax,7
+	movdqa	xmm9,xmm5
+	xor	esi,ecx
+	pslldq	xmm8,12
+	paddd	xmm5,xmm5
+	mov	edi,ebp
+	add	edx,DWORD[24+rsp]
+	psrld	xmm9,31
+	xor	eax,ebx
+	rol	ebp,5
+	add	edx,esi
+	movdqa	xmm10,xmm8
+	and	edi,eax
+	xor	eax,ebx
+	psrld	xmm8,30
+	add	edx,ebp
+	ror	ebp,7
+	por	xmm5,xmm9
+	xor	edi,ebx
+	mov	esi,edx
+	add	ecx,DWORD[28+rsp]
+	pslld	xmm10,2
+	pxor	xmm5,xmm8
+	xor	ebp,eax
+	movdqa	xmm8,XMMWORD[((-32))+r11]
+	rol	edx,5
+	add	ecx,edi
+	and	esi,ebp
+	pxor	xmm5,xmm10
+	xor	ebp,eax
+	add	ecx,edx
+	ror	edx,7
+	pshufd	xmm6,xmm2,238
+	xor	esi,eax
+	movdqa	xmm10,xmm5
+	paddd	xmm8,xmm5
+	mov	edi,ecx
+	add	ebx,DWORD[32+rsp]
+	punpcklqdq	xmm6,xmm3
+	xor	edx,ebp
+	rol	ecx,5
+	add	ebx,esi
+	psrldq	xmm10,4
+	and	edi,edx
+	xor	edx,ebp
+	pxor	xmm6,xmm2
+	add	ebx,ecx
+	ror	ecx,7
+	pxor	xmm10,xmm4
+	xor	edi,ebp
+	mov	esi,ebx
+	add	eax,DWORD[36+rsp]
+	pxor	xmm6,xmm10
+	xor	ecx,edx
+	rol	ebx,5
+	movdqa	XMMWORD[16+rsp],xmm8
+	add	eax,edi
+	and	esi,ecx
+	movdqa	xmm9,xmm6
+	xor	ecx,edx
+	add	eax,ebx
+	ror	ebx,7
+	movdqa	xmm10,xmm6
+	xor	esi,edx
+	pslldq	xmm9,12
+	paddd	xmm6,xmm6
+	mov	edi,eax
+	add	ebp,DWORD[40+rsp]
+	psrld	xmm10,31
+	xor	ebx,ecx
+	rol	eax,5
+	add	ebp,esi
+	movdqa	xmm8,xmm9
+	and	edi,ebx
+	xor	ebx,ecx
+	psrld	xmm9,30
+	add	ebp,eax
+	ror	eax,7
+	por	xmm6,xmm10
+	xor	edi,ecx
+	mov	esi,ebp
+	add	edx,DWORD[44+rsp]
+	pslld	xmm8,2
+	pxor	xmm6,xmm9
+	xor	eax,ebx
+	movdqa	xmm9,XMMWORD[((-32))+r11]
+	rol	ebp,5
+	add	edx,edi
+	and	esi,eax
+	pxor	xmm6,xmm8
+	xor	eax,ebx
+	add	edx,ebp
+	ror	ebp,7
+	pshufd	xmm7,xmm3,238
+	xor	esi,ebx
+	movdqa	xmm8,xmm6
+	paddd	xmm9,xmm6
+	mov	edi,edx
+	add	ecx,DWORD[48+rsp]
+	punpcklqdq	xmm7,xmm4
+	xor	ebp,eax
+	rol	edx,5
+	add	ecx,esi
+	psrldq	xmm8,4
+	and	edi,ebp
+	xor	ebp,eax
+	pxor	xmm7,xmm3
+	add	ecx,edx
+	ror	edx,7
+	pxor	xmm8,xmm5
+	xor	edi,eax
+	mov	esi,ecx
+	add	ebx,DWORD[52+rsp]
+	pxor	xmm7,xmm8
+	xor	edx,ebp
+	rol	ecx,5
+	movdqa	XMMWORD[32+rsp],xmm9
+	add	ebx,edi
+	and	esi,edx
+	movdqa	xmm10,xmm7
+	xor	edx,ebp
+	add	ebx,ecx
+	ror	ecx,7
+	movdqa	xmm8,xmm7
+	xor	esi,ebp
+	pslldq	xmm10,12
+	paddd	xmm7,xmm7
+	mov	edi,ebx
+	add	eax,DWORD[56+rsp]
+	psrld	xmm8,31
+	xor	ecx,edx
+	rol	ebx,5
+	add	eax,esi
+	movdqa	xmm9,xmm10
+	and	edi,ecx
+	xor	ecx,edx
+	psrld	xmm10,30
+	add	eax,ebx
+	ror	ebx,7
+	por	xmm7,xmm8
+	xor	edi,edx
+	mov	esi,eax
+	add	ebp,DWORD[60+rsp]
+	pslld	xmm9,2
+	pxor	xmm7,xmm10
+	xor	ebx,ecx
+	movdqa	xmm10,XMMWORD[((-32))+r11]
+	rol	eax,5
+	add	ebp,edi
+	and	esi,ebx
+	pxor	xmm7,xmm9
+	pshufd	xmm9,xmm6,238
+	xor	ebx,ecx
+	add	ebp,eax
+	ror	eax,7
+	pxor	xmm0,xmm4
+	xor	esi,ecx
+	mov	edi,ebp
+	add	edx,DWORD[rsp]
+	punpcklqdq	xmm9,xmm7
+	xor	eax,ebx
+	rol	ebp,5
+	pxor	xmm0,xmm1
+	add	edx,esi
+	and	edi,eax
+	movdqa	xmm8,xmm10
+	xor	eax,ebx
+	paddd	xmm10,xmm7
+	add	edx,ebp
+	pxor	xmm0,xmm9
+	ror	ebp,7
+	xor	edi,ebx
+	mov	esi,edx
+	add	ecx,DWORD[4+rsp]
+	movdqa	xmm9,xmm0
+	xor	ebp,eax
+	rol	edx,5
+	movdqa	XMMWORD[48+rsp],xmm10
+	add	ecx,edi
+	and	esi,ebp
+	xor	ebp,eax
+	pslld	xmm0,2
+	add	ecx,edx
+	ror	edx,7
+	psrld	xmm9,30
+	xor	esi,eax
+	mov	edi,ecx
+	add	ebx,DWORD[8+rsp]
+	por	xmm0,xmm9
+	xor	edx,ebp
+	rol	ecx,5
+	pshufd	xmm10,xmm7,238
+	add	ebx,esi
+	and	edi,edx
+	xor	edx,ebp
+	add	ebx,ecx
+	add	eax,DWORD[12+rsp]
+	xor	edi,ebp
+	mov	esi,ebx
+	rol	ebx,5
+	add	eax,edi
+	xor	esi,edx
+	ror	ecx,7
+	add	eax,ebx
+	pxor	xmm1,xmm5
+	add	ebp,DWORD[16+rsp]
+	xor	esi,ecx
+	punpcklqdq	xmm10,xmm0
+	mov	edi,eax
+	rol	eax,5
+	pxor	xmm1,xmm2
+	add	ebp,esi
+	xor	edi,ecx
+	movdqa	xmm9,xmm8
+	ror	ebx,7
+	paddd	xmm8,xmm0
+	add	ebp,eax
+	pxor	xmm1,xmm10
+	add	edx,DWORD[20+rsp]
+	xor	edi,ebx
+	mov	esi,ebp
+	rol	ebp,5
+	movdqa	xmm10,xmm1
+	add	edx,edi
+	xor	esi,ebx
+	movdqa	XMMWORD[rsp],xmm8
+	ror	eax,7
+	add	edx,ebp
+	add	ecx,DWORD[24+rsp]
+	pslld	xmm1,2
+	xor	esi,eax
+	mov	edi,edx
+	psrld	xmm10,30
+	rol	edx,5
+	add	ecx,esi
+	xor	edi,eax
+	ror	ebp,7
+	por	xmm1,xmm10
+	add	ecx,edx
+	add	ebx,DWORD[28+rsp]
+	pshufd	xmm8,xmm0,238
+	xor	edi,ebp
+	mov	esi,ecx
+	rol	ecx,5
+	add	ebx,edi
+	xor	esi,ebp
+	ror	edx,7
+	add	ebx,ecx
+	pxor	xmm2,xmm6
+	add	eax,DWORD[32+rsp]
+	xor	esi,edx
+	punpcklqdq	xmm8,xmm1
+	mov	edi,ebx
+	rol	ebx,5
+	pxor	xmm2,xmm3
+	add	eax,esi
+	xor	edi,edx
+	movdqa	xmm10,XMMWORD[r11]
+	ror	ecx,7
+	paddd	xmm9,xmm1
+	add	eax,ebx
+	pxor	xmm2,xmm8
+	add	ebp,DWORD[36+rsp]
+	xor	edi,ecx
+	mov	esi,eax
+	rol	eax,5
+	movdqa	xmm8,xmm2
+	add	ebp,edi
+	xor	esi,ecx
+	movdqa	XMMWORD[16+rsp],xmm9
+	ror	ebx,7
+	add	ebp,eax
+	add	edx,DWORD[40+rsp]
+	pslld	xmm2,2
+	xor	esi,ebx
+	mov	edi,ebp
+	psrld	xmm8,30
+	rol	ebp,5
+	add	edx,esi
+	xor	edi,ebx
+	ror	eax,7
+	por	xmm2,xmm8
+	add	edx,ebp
+	add	ecx,DWORD[44+rsp]
+	pshufd	xmm9,xmm1,238
+	xor	edi,eax
+	mov	esi,edx
+	rol	edx,5
+	add	ecx,edi
+	xor	esi,eax
+	ror	ebp,7
+	add	ecx,edx
+	pxor	xmm3,xmm7
+	add	ebx,DWORD[48+rsp]
+	xor	esi,ebp
+	punpcklqdq	xmm9,xmm2
+	mov	edi,ecx
+	rol	ecx,5
+	pxor	xmm3,xmm4
+	add	ebx,esi
+	xor	edi,ebp
+	movdqa	xmm8,xmm10
+	ror	edx,7
+	paddd	xmm10,xmm2
+	add	ebx,ecx
+	pxor	xmm3,xmm9
+	add	eax,DWORD[52+rsp]
+	xor	edi,edx
+	mov	esi,ebx
+	rol	ebx,5
+	movdqa	xmm9,xmm3
+	add	eax,edi
+	xor	esi,edx
+	movdqa	XMMWORD[32+rsp],xmm10
+	ror	ecx,7
+	add	eax,ebx
+	add	ebp,DWORD[56+rsp]
+	pslld	xmm3,2
+	xor	esi,ecx
+	mov	edi,eax
+	psrld	xmm9,30
+	rol	eax,5
+	add	ebp,esi
+	xor	edi,ecx
+	ror	ebx,7
+	por	xmm3,xmm9
+	add	ebp,eax
+	add	edx,DWORD[60+rsp]
+	pshufd	xmm10,xmm2,238
+	xor	edi,ebx
+	mov	esi,ebp
+	rol	ebp,5
+	add	edx,edi
+	xor	esi,ebx
+	ror	eax,7
+	add	edx,ebp
+	pxor	xmm4,xmm0
+	add	ecx,DWORD[rsp]
+	xor	esi,eax
+	punpcklqdq	xmm10,xmm3
+	mov	edi,edx
+	rol	edx,5
+	pxor	xmm4,xmm5
+	add	ecx,esi
+	xor	edi,eax
+	movdqa	xmm9,xmm8
+	ror	ebp,7
+	paddd	xmm8,xmm3
+	add	ecx,edx
+	pxor	xmm4,xmm10
+	add	ebx,DWORD[4+rsp]
+	xor	edi,ebp
+	mov	esi,ecx
+	rol	ecx,5
+	movdqa	xmm10,xmm4
+	add	ebx,edi
+	xor	esi,ebp
+	movdqa	XMMWORD[48+rsp],xmm8
+	ror	edx,7
+	add	ebx,ecx
+	add	eax,DWORD[8+rsp]
+	pslld	xmm4,2
+	xor	esi,edx
+	mov	edi,ebx
+	psrld	xmm10,30
+	rol	ebx,5
+	add	eax,esi
+	xor	edi,edx
+	ror	ecx,7
+	por	xmm4,xmm10
+	add	eax,ebx
+	add	ebp,DWORD[12+rsp]
+	pshufd	xmm8,xmm3,238
+	xor	edi,ecx
+	mov	esi,eax
+	rol	eax,5
+	add	ebp,edi
+	xor	esi,ecx
+	ror	ebx,7
+	add	ebp,eax
+	pxor	xmm5,xmm1
+	add	edx,DWORD[16+rsp]
+	xor	esi,ebx
+	punpcklqdq	xmm8,xmm4
+	mov	edi,ebp
+	rol	ebp,5
+	pxor	xmm5,xmm6
+	add	edx,esi
+	xor	edi,ebx
+	movdqa	xmm10,xmm9
+	ror	eax,7
+	paddd	xmm9,xmm4
+	add	edx,ebp
+	pxor	xmm5,xmm8
+	add	ecx,DWORD[20+rsp]
+	xor	edi,eax
+	mov	esi,edx
+	rol	edx,5
+	movdqa	xmm8,xmm5
+	add	ecx,edi
+	xor	esi,eax
+	movdqa	XMMWORD[rsp],xmm9
+	ror	ebp,7
+	add	ecx,edx
+	add	ebx,DWORD[24+rsp]
+	pslld	xmm5,2
+	xor	esi,ebp
+	mov	edi,ecx
+	psrld	xmm8,30
+	rol	ecx,5
+	add	ebx,esi
+	xor	edi,ebp
+	ror	edx,7
+	por	xmm5,xmm8
+	add	ebx,ecx
+	add	eax,DWORD[28+rsp]
+	pshufd	xmm9,xmm4,238
+	ror	ecx,7
+	mov	esi,ebx
+	xor	edi,edx
+	rol	ebx,5
+	add	eax,edi
+	xor	esi,ecx
+	xor	ecx,edx
+	add	eax,ebx
+	pxor	xmm6,xmm2
+	add	ebp,DWORD[32+rsp]
+	and	esi,ecx
+	xor	ecx,edx
+	ror	ebx,7
+	punpcklqdq	xmm9,xmm5
+	mov	edi,eax
+	xor	esi,ecx
+	pxor	xmm6,xmm7
+	rol	eax,5
+	add	ebp,esi
+	movdqa	xmm8,xmm10
+	xor	edi,ebx
+	paddd	xmm10,xmm5
+	xor	ebx,ecx
+	pxor	xmm6,xmm9
+	add	ebp,eax
+	add	edx,DWORD[36+rsp]
+	and	edi,ebx
+	xor	ebx,ecx
+	ror	eax,7
+	movdqa	xmm9,xmm6
+	mov	esi,ebp
+	xor	edi,ebx
+	movdqa	XMMWORD[16+rsp],xmm10
+	rol	ebp,5
+	add	edx,edi
+	xor	esi,eax
+	pslld	xmm6,2
+	xor	eax,ebx
+	add	edx,ebp
+	psrld	xmm9,30
+	add	ecx,DWORD[40+rsp]
+	and	esi,eax
+	xor	eax,ebx
+	por	xmm6,xmm9
+	ror	ebp,7
+	mov	edi,edx
+	xor	esi,eax
+	rol	edx,5
+	pshufd	xmm10,xmm5,238
+	add	ecx,esi
+	xor	edi,ebp
+	xor	ebp,eax
+	add	ecx,edx
+	add	ebx,DWORD[44+rsp]
+	and	edi,ebp
+	xor	ebp,eax
+	ror	edx,7
+	mov	esi,ecx
+	xor	edi,ebp
+	rol	ecx,5
+	add	ebx,edi
+	xor	esi,edx
+	xor	edx,ebp
+	add	ebx,ecx
+	pxor	xmm7,xmm3
+	add	eax,DWORD[48+rsp]
+	and	esi,edx
+	xor	edx,ebp
+	ror	ecx,7
+	punpcklqdq	xmm10,xmm6
+	mov	edi,ebx
+	xor	esi,edx
+	pxor	xmm7,xmm0
+	rol	ebx,5
+	add	eax,esi
+	movdqa	xmm9,XMMWORD[32+r11]
+	xor	edi,ecx
+	paddd	xmm8,xmm6
+	xor	ecx,edx
+	pxor	xmm7,xmm10
+	add	eax,ebx
+	add	ebp,DWORD[52+rsp]
+	and	edi,ecx
+	xor	ecx,edx
+	ror	ebx,7
+	movdqa	xmm10,xmm7
+	mov	esi,eax
+	xor	edi,ecx
+	movdqa	XMMWORD[32+rsp],xmm8
+	rol	eax,5
+	add	ebp,edi
+	xor	esi,ebx
+	pslld	xmm7,2
+	xor	ebx,ecx
+	add	ebp,eax
+	psrld	xmm10,30
+	add	edx,DWORD[56+rsp]
+	and	esi,ebx
+	xor	ebx,ecx
+	por	xmm7,xmm10
+	ror	eax,7
+	mov	edi,ebp
+	xor	esi,ebx
+	rol	ebp,5
+	pshufd	xmm8,xmm6,238
+	add	edx,esi
+	xor	edi,eax
+	xor	eax,ebx
+	add	edx,ebp
+	add	ecx,DWORD[60+rsp]
+	and	edi,eax
+	xor	eax,ebx
+	ror	ebp,7
+	mov	esi,edx
+	xor	edi,eax
+	rol	edx,5
+	add	ecx,edi
+	xor	esi,ebp
+	xor	ebp,eax
+	add	ecx,edx
+	pxor	xmm0,xmm4
+	add	ebx,DWORD[rsp]
+	and	esi,ebp
+	xor	ebp,eax
+	ror	edx,7
+	punpcklqdq	xmm8,xmm7
+	mov	edi,ecx
+	xor	esi,ebp
+	pxor	xmm0,xmm1
+	rol	ecx,5
+	add	ebx,esi
+	movdqa	xmm10,xmm9
+	xor	edi,edx
+	paddd	xmm9,xmm7
+	xor	edx,ebp
+	pxor	xmm0,xmm8
+	add	ebx,ecx
+	add	eax,DWORD[4+rsp]
+	and	edi,edx
+	xor	edx,ebp
+	ror	ecx,7
+	movdqa	xmm8,xmm0
+	mov	esi,ebx
+	xor	edi,edx
+	movdqa	XMMWORD[48+rsp],xmm9
+	rol	ebx,5
+	add	eax,edi
+	xor	esi,ecx
+	pslld	xmm0,2
+	xor	ecx,edx
+	add	eax,ebx
+	psrld	xmm8,30
+	add	ebp,DWORD[8+rsp]
+	and	esi,ecx
+	xor	ecx,edx
+	por	xmm0,xmm8
+	ror	ebx,7
+	mov	edi,eax
+	xor	esi,ecx
+	rol	eax,5
+	pshufd	xmm9,xmm7,238
+	add	ebp,esi
+	xor	edi,ebx
+	xor	ebx,ecx
+	add	ebp,eax
+	add	edx,DWORD[12+rsp]
+	and	edi,ebx
+	xor	ebx,ecx
+	ror	eax,7
+	mov	esi,ebp
+	xor	edi,ebx
+	rol	ebp,5
+	add	edx,edi
+	xor	esi,eax
+	xor	eax,ebx
+	add	edx,ebp
+	pxor	xmm1,xmm5
+	add	ecx,DWORD[16+rsp]
+	and	esi,eax
+	xor	eax,ebx
+	ror	ebp,7
+	punpcklqdq	xmm9,xmm0
+	mov	edi,edx
+	xor	esi,eax
+	pxor	xmm1,xmm2
+	rol	edx,5
+	add	ecx,esi
+	movdqa	xmm8,xmm10
+	xor	edi,ebp
+	paddd	xmm10,xmm0
+	xor	ebp,eax
+	pxor	xmm1,xmm9
+	add	ecx,edx
+	add	ebx,DWORD[20+rsp]
+	and	edi,ebp
+	xor	ebp,eax
+	ror	edx,7
+	movdqa	xmm9,xmm1
+	mov	esi,ecx
+	xor	edi,ebp
+	movdqa	XMMWORD[rsp],xmm10
+	rol	ecx,5
+	add	ebx,edi
+	xor	esi,edx
+	pslld	xmm1,2
+	xor	edx,ebp
+	add	ebx,ecx
+	psrld	xmm9,30
+	add	eax,DWORD[24+rsp]
+	and	esi,edx
+	xor	edx,ebp
+	por	xmm1,xmm9
+	ror	ecx,7
+	mov	edi,ebx
+	xor	esi,edx
+	rol	ebx,5
+	pshufd	xmm10,xmm0,238
+	add	eax,esi
+	xor	edi,ecx
+	xor	ecx,edx
+	add	eax,ebx
+	add	ebp,DWORD[28+rsp]
+	and	edi,ecx
+	xor	ecx,edx
+	ror	ebx,7
+	mov	esi,eax
+	xor	edi,ecx
+	rol	eax,5
+	add	ebp,edi
+	xor	esi,ebx
+	xor	ebx,ecx
+	add	ebp,eax
+	pxor	xmm2,xmm6
+	add	edx,DWORD[32+rsp]
+	and	esi,ebx
+	xor	ebx,ecx
+	ror	eax,7
+	punpcklqdq	xmm10,xmm1
+	mov	edi,ebp
+	xor	esi,ebx
+	pxor	xmm2,xmm3
+	rol	ebp,5
+	add	edx,esi
+	movdqa	xmm9,xmm8
+	xor	edi,eax
+	paddd	xmm8,xmm1
+	xor	eax,ebx
+	pxor	xmm2,xmm10
+	add	edx,ebp
+	add	ecx,DWORD[36+rsp]
+	and	edi,eax
+	xor	eax,ebx
+	ror	ebp,7
+	movdqa	xmm10,xmm2
+	mov	esi,edx
+	xor	edi,eax
+	movdqa	XMMWORD[16+rsp],xmm8
+	rol	edx,5
+	add	ecx,edi
+	xor	esi,ebp
+	pslld	xmm2,2
+	xor	ebp,eax
+	add	ecx,edx
+	psrld	xmm10,30
+	add	ebx,DWORD[40+rsp]
+	and	esi,ebp
+	xor	ebp,eax
+	por	xmm2,xmm10
+	ror	edx,7
+	mov	edi,ecx
+	xor	esi,ebp
+	rol	ecx,5
+	pshufd	xmm8,xmm1,238
+	add	ebx,esi
+	xor	edi,edx
+	xor	edx,ebp
+	add	ebx,ecx
+	add	eax,DWORD[44+rsp]
+	and	edi,edx
+	xor	edx,ebp
+	ror	ecx,7
+	mov	esi,ebx
+	xor	edi,edx
+	rol	ebx,5
+	add	eax,edi
+	xor	esi,edx
+	add	eax,ebx
+	pxor	xmm3,xmm7
+	add	ebp,DWORD[48+rsp]
+	xor	esi,ecx
+	punpcklqdq	xmm8,xmm2
+	mov	edi,eax
+	rol	eax,5
+	pxor	xmm3,xmm4
+	add	ebp,esi
+	xor	edi,ecx
+	movdqa	xmm10,xmm9
+	ror	ebx,7
+	paddd	xmm9,xmm2
+	add	ebp,eax
+	pxor	xmm3,xmm8
+	add	edx,DWORD[52+rsp]
+	xor	edi,ebx
+	mov	esi,ebp
+	rol	ebp,5
+	movdqa	xmm8,xmm3
+	add	edx,edi
+	xor	esi,ebx
+	movdqa	XMMWORD[32+rsp],xmm9
+	ror	eax,7
+	add	edx,ebp
+	add	ecx,DWORD[56+rsp]
+	pslld	xmm3,2
+	xor	esi,eax
+	mov	edi,edx
+	psrld	xmm8,30
+	rol	edx,5
+	add	ecx,esi
+	xor	edi,eax
+	ror	ebp,7
+	por	xmm3,xmm8
+	add	ecx,edx
+	add	ebx,DWORD[60+rsp]
+	xor	edi,ebp
+	mov	esi,ecx
+	rol	ecx,5
+	add	ebx,edi
+	xor	esi,ebp
+	ror	edx,7
+	add	ebx,ecx
+	add	eax,DWORD[rsp]
+	xor	esi,edx
+	mov	edi,ebx
+	rol	ebx,5
+	paddd	xmm10,xmm3
+	add	eax,esi
+	xor	edi,edx
+	movdqa	XMMWORD[48+rsp],xmm10
+	ror	ecx,7
+	add	eax,ebx
+	add	ebp,DWORD[4+rsp]
+	xor	edi,ecx
+	mov	esi,eax
+	rol	eax,5
+	add	ebp,edi
+	xor	esi,ecx
+	ror	ebx,7
+	add	ebp,eax
+	add	edx,DWORD[8+rsp]
+	xor	esi,ebx
+	mov	edi,ebp
+	rol	ebp,5
+	add	edx,esi
+	xor	edi,ebx
+	ror	eax,7
+	add	edx,ebp
+	add	ecx,DWORD[12+rsp]
+	xor	edi,eax
+	mov	esi,edx
+	rol	edx,5
+	add	ecx,edi
+	xor	esi,eax
+	ror	ebp,7
+	add	ecx,edx
+	cmp	r9,r10
+	je	NEAR $L$done_ssse3
+	movdqa	xmm6,XMMWORD[64+r11]
+	movdqa	xmm9,XMMWORD[((-64))+r11]
+	movdqu	xmm0,XMMWORD[r9]
+	movdqu	xmm1,XMMWORD[16+r9]
+	movdqu	xmm2,XMMWORD[32+r9]
+	movdqu	xmm3,XMMWORD[48+r9]
+DB	102,15,56,0,198
+	add	r9,64
+	add	ebx,DWORD[16+rsp]
+	xor	esi,ebp
+	mov	edi,ecx
+DB	102,15,56,0,206
+	rol	ecx,5
+	add	ebx,esi
+	xor	edi,ebp
+	ror	edx,7
+	paddd	xmm0,xmm9
+	add	ebx,ecx
+	add	eax,DWORD[20+rsp]
+	xor	edi,edx
+	mov	esi,ebx
+	movdqa	XMMWORD[rsp],xmm0
+	rol	ebx,5
+	add	eax,edi
+	xor	esi,edx
+	ror	ecx,7
+	psubd	xmm0,xmm9
+	add	eax,ebx
+	add	ebp,DWORD[24+rsp]
+	xor	esi,ecx
+	mov	edi,eax
+	rol	eax,5
+	add	ebp,esi
+	xor	edi,ecx
+	ror	ebx,7
+	add	ebp,eax
+	add	edx,DWORD[28+rsp]
+	xor	edi,ebx
+	mov	esi,ebp
+	rol	ebp,5
+	add	edx,edi
+	xor	esi,ebx
+	ror	eax,7
+	add	edx,ebp
+	add	ecx,DWORD[32+rsp]
+	xor	esi,eax
+	mov	edi,edx
+DB	102,15,56,0,214
+	rol	edx,5
+	add	ecx,esi
+	xor	edi,eax
+	ror	ebp,7
+	paddd	xmm1,xmm9
+	add	ecx,edx
+	add	ebx,DWORD[36+rsp]
+	xor	edi,ebp
+	mov	esi,ecx
+	movdqa	XMMWORD[16+rsp],xmm1
+	rol	ecx,5
+	add	ebx,edi
+	xor	esi,ebp
+	ror	edx,7
+	psubd	xmm1,xmm9
+	add	ebx,ecx
+	add	eax,DWORD[40+rsp]
+	xor	esi,edx
+	mov	edi,ebx
+	rol	ebx,5
+	add	eax,esi
+	xor	edi,edx
+	ror	ecx,7
+	add	eax,ebx
+	add	ebp,DWORD[44+rsp]
+	xor	edi,ecx
+	mov	esi,eax
+	rol	eax,5
+	add	ebp,edi
+	xor	esi,ecx
+	ror	ebx,7
+	add	ebp,eax
+	add	edx,DWORD[48+rsp]
+	xor	esi,ebx
+	mov	edi,ebp
+DB	102,15,56,0,222
+	rol	ebp,5
+	add	edx,esi
+	xor	edi,ebx
+	ror	eax,7
+	paddd	xmm2,xmm9
+	add	edx,ebp
+	add	ecx,DWORD[52+rsp]
+	xor	edi,eax
+	mov	esi,edx
+	movdqa	XMMWORD[32+rsp],xmm2
+	rol	edx,5
+	add	ecx,edi
+	xor	esi,eax
+	ror	ebp,7
+	psubd	xmm2,xmm9
+	add	ecx,edx
+	add	ebx,DWORD[56+rsp]
+	xor	esi,ebp
+	mov	edi,ecx
+	rol	ecx,5
+	add	ebx,esi
+	xor	edi,ebp
+	ror	edx,7
+	add	ebx,ecx
+	add	eax,DWORD[60+rsp]
+	xor	edi,edx
+	mov	esi,ebx
+	rol	ebx,5
+	add	eax,edi
+	ror	ecx,7
+	add	eax,ebx
+	add	eax,DWORD[r8]
+	add	esi,DWORD[4+r8]
+	add	ecx,DWORD[8+r8]
+	add	edx,DWORD[12+r8]
+	mov	DWORD[r8],eax
+	add	ebp,DWORD[16+r8]
+	mov	DWORD[4+r8],esi
+	mov	ebx,esi
+	mov	DWORD[8+r8],ecx
+	mov	edi,ecx
+	mov	DWORD[12+r8],edx
+	xor	edi,edx
+	mov	DWORD[16+r8],ebp
+	and	esi,edi
+	jmp	NEAR $L$oop_ssse3
+
+ALIGN	16
+$L$done_ssse3:
+	add	ebx,DWORD[16+rsp]
+	xor	esi,ebp
+	mov	edi,ecx
+	rol	ecx,5
+	add	ebx,esi
+	xor	edi,ebp
+	ror	edx,7
+	add	ebx,ecx
+	add	eax,DWORD[20+rsp]
+	xor	edi,edx
+	mov	esi,ebx
+	rol	ebx,5
+	add	eax,edi
+	xor	esi,edx
+	ror	ecx,7
+	add	eax,ebx
+	add	ebp,DWORD[24+rsp]
+	xor	esi,ecx
+	mov	edi,eax
+	rol	eax,5
+	add	ebp,esi
+	xor	edi,ecx
+	ror	ebx,7
+	add	ebp,eax
+	add	edx,DWORD[28+rsp]
+	xor	edi,ebx
+	mov	esi,ebp
+	rol	ebp,5
+	add	edx,edi
+	xor	esi,ebx
+	ror	eax,7
+	add	edx,ebp
+	add	ecx,DWORD[32+rsp]
+	xor	esi,eax
+	mov	edi,edx
+	rol	edx,5
+	add	ecx,esi
+	xor	edi,eax
+	ror	ebp,7
+	add	ecx,edx
+	add	ebx,DWORD[36+rsp]
+	xor	edi,ebp
+	mov	esi,ecx
+	rol	ecx,5
+	add	ebx,edi
+	xor	esi,ebp
+	ror	edx,7
+	add	ebx,ecx
+	add	eax,DWORD[40+rsp]
+	xor	esi,edx
+	mov	edi,ebx
+	rol	ebx,5
+	add	eax,esi
+	xor	edi,edx
+	ror	ecx,7
+	add	eax,ebx
+	add	ebp,DWORD[44+rsp]
+	xor	edi,ecx
+	mov	esi,eax
+	rol	eax,5
+	add	ebp,edi
+	xor	esi,ecx
+	ror	ebx,7
+	add	ebp,eax
+	add	edx,DWORD[48+rsp]
+	xor	esi,ebx
+	mov	edi,ebp
+	rol	ebp,5
+	add	edx,esi
+	xor	edi,ebx
+	ror	eax,7
+	add	edx,ebp
+	add	ecx,DWORD[52+rsp]
+	xor	edi,eax
+	mov	esi,edx
+	rol	edx,5
+	add	ecx,edi
+	xor	esi,eax
+	ror	ebp,7
+	add	ecx,edx
+	add	ebx,DWORD[56+rsp]
+	xor	esi,ebp
+	mov	edi,ecx
+	rol	ecx,5
+	add	ebx,esi
+	xor	edi,ebp
+	ror	edx,7
+	add	ebx,ecx
+	add	eax,DWORD[60+rsp]
+	xor	edi,edx
+	mov	esi,ebx
+	rol	ebx,5
+	add	eax,edi
+	ror	ecx,7
+	add	eax,ebx
+	add	eax,DWORD[r8]
+	add	esi,DWORD[4+r8]
+	add	ecx,DWORD[8+r8]
+	mov	DWORD[r8],eax
+	add	edx,DWORD[12+r8]
+	mov	DWORD[4+r8],esi
+	add	ebp,DWORD[16+r8]
+	mov	DWORD[8+r8],ecx
+	mov	DWORD[12+r8],edx
+	mov	DWORD[16+r8],ebp
+	movaps	xmm6,XMMWORD[((-40-96))+r14]
+	movaps	xmm7,XMMWORD[((-40-80))+r14]
+	movaps	xmm8,XMMWORD[((-40-64))+r14]
+	movaps	xmm9,XMMWORD[((-40-48))+r14]
+	movaps	xmm10,XMMWORD[((-40-32))+r14]
+	movaps	xmm11,XMMWORD[((-40-16))+r14]
+	lea	rsi,[r14]
+	mov	r14,QWORD[((-40))+rsi]
+	mov	r13,QWORD[((-32))+rsi]
+	mov	r12,QWORD[((-24))+rsi]
+	mov	rbp,QWORD[((-16))+rsi]
+	mov	rbx,QWORD[((-8))+rsi]
+	lea	rsp,[rsi]
+$L$epilogue_ssse3:
+	mov	rdi,QWORD[8+rsp]	;WIN64 epilogue
+	mov	rsi,QWORD[16+rsp]
+	DB	0F3h,0C3h		;repret
+$L$SEH_end_sha1_block_data_order_ssse3:
+ALIGN	64
+K_XX_XX:
+	DD	0x5a827999,0x5a827999,0x5a827999,0x5a827999
+	DD	0x5a827999,0x5a827999,0x5a827999,0x5a827999
+	DD	0x6ed9eba1,0x6ed9eba1,0x6ed9eba1,0x6ed9eba1
+	DD	0x6ed9eba1,0x6ed9eba1,0x6ed9eba1,0x6ed9eba1
+	DD	0x8f1bbcdc,0x8f1bbcdc,0x8f1bbcdc,0x8f1bbcdc
+	DD	0x8f1bbcdc,0x8f1bbcdc,0x8f1bbcdc,0x8f1bbcdc
+	DD	0xca62c1d6,0xca62c1d6,0xca62c1d6,0xca62c1d6
+	DD	0xca62c1d6,0xca62c1d6,0xca62c1d6,0xca62c1d6
+	DD	0x00010203,0x04050607,0x08090a0b,0x0c0d0e0f
+	DD	0x00010203,0x04050607,0x08090a0b,0x0c0d0e0f
+DB	0xf,0xe,0xd,0xc,0xb,0xa,0x9,0x8,0x7,0x6,0x5,0x4,0x3,0x2,0x1,0x0
+DB	83,72,65,49,32,98,108,111,99,107,32,116,114,97,110,115
+DB	102,111,114,109,32,102,111,114,32,120,56,54,95,54,52,44
+DB	32,67,82,89,80,84,79,71,65,77,83,32,98,121,32,60
+DB	97,112,112,114,111,64,111,112,101,110,115,115,108,46,111,114
+DB	103,62,0
+ALIGN	64
+EXTERN	__imp_RtlVirtualUnwind
+
+ALIGN	16
+se_handler:
+	push	rsi
+	push	rdi
+	push	rbx
+	push	rbp
+	push	r12
+	push	r13
+	push	r14
+	push	r15
+	pushfq
+	sub	rsp,64
+
+	mov	rax,QWORD[120+r8]
+	mov	rbx,QWORD[248+r8]
+
+	lea	r10,[$L$prologue]
+	cmp	rbx,r10
+	jb	NEAR $L$common_seh_tail
+
+	mov	rax,QWORD[152+r8]
+
+	lea	r10,[$L$epilogue]
+	cmp	rbx,r10
+	jae	NEAR $L$common_seh_tail
+
+	mov	rax,QWORD[64+rax]
+
+	mov	rbx,QWORD[((-8))+rax]
+	mov	rbp,QWORD[((-16))+rax]
+	mov	r12,QWORD[((-24))+rax]
+	mov	r13,QWORD[((-32))+rax]
+	mov	r14,QWORD[((-40))+rax]
+	mov	QWORD[144+r8],rbx
+	mov	QWORD[160+r8],rbp
+	mov	QWORD[216+r8],r12
+	mov	QWORD[224+r8],r13
+	mov	QWORD[232+r8],r14
+
+	jmp	NEAR $L$common_seh_tail
+
+
+ALIGN	16
+ssse3_handler:
+	push	rsi
+	push	rdi
+	push	rbx
+	push	rbp
+	push	r12
+	push	r13
+	push	r14
+	push	r15
+	pushfq
+	sub	rsp,64
+
+	mov	rax,QWORD[120+r8]
+	mov	rbx,QWORD[248+r8]
+
+	mov	rsi,QWORD[8+r9]
+	mov	r11,QWORD[56+r9]
+
+	mov	r10d,DWORD[r11]
+	lea	r10,[r10*1+rsi]
+	cmp	rbx,r10
+	jb	NEAR $L$common_seh_tail
+
+	mov	rax,QWORD[152+r8]
+
+	mov	r10d,DWORD[4+r11]
+	lea	r10,[r10*1+rsi]
+	cmp	rbx,r10
+	jae	NEAR $L$common_seh_tail
+
+	mov	rax,QWORD[232+r8]
+
+	lea	rsi,[((-40-96))+rax]
+	lea	rdi,[512+r8]
+	mov	ecx,12
+	DD	0xa548f3fc
+
+	mov	rbx,QWORD[((-8))+rax]
+	mov	rbp,QWORD[((-16))+rax]
+	mov	r12,QWORD[((-24))+rax]
+	mov	r13,QWORD[((-32))+rax]
+	mov	r14,QWORD[((-40))+rax]
+	mov	QWORD[144+r8],rbx
+	mov	QWORD[160+r8],rbp
+	mov	QWORD[216+r8],r12
+	mov	QWORD[224+r8],r13
+	mov	QWORD[232+r8],r14
+
+$L$common_seh_tail:
+	mov	rdi,QWORD[8+rax]
+	mov	rsi,QWORD[16+rax]
+	mov	QWORD[152+r8],rax
+	mov	QWORD[168+r8],rsi
+	mov	QWORD[176+r8],rdi
+
+	mov	rdi,QWORD[40+r9]
+	mov	rsi,r8
+	mov	ecx,154
+	DD	0xa548f3fc
+
+	mov	rsi,r9
+	xor	rcx,rcx
+	mov	rdx,QWORD[8+rsi]
+	mov	r8,QWORD[rsi]
+	mov	r9,QWORD[16+rsi]
+	mov	r10,QWORD[40+rsi]
+	lea	r11,[56+rsi]
+	lea	r12,[24+rsi]
+	mov	QWORD[32+rsp],r10
+	mov	QWORD[40+rsp],r11
+	mov	QWORD[48+rsp],r12
+	mov	QWORD[56+rsp],rcx
+	call	QWORD[__imp_RtlVirtualUnwind]
+
+	mov	eax,1
+	add	rsp,64
+	popfq
+	pop	r15
+	pop	r14
+	pop	r13
+	pop	r12
+	pop	rbp
+	pop	rbx
+	pop	rdi
+	pop	rsi
+	DB	0F3h,0C3h		;repret
+
+
+section	.pdata rdata align=4
+ALIGN	4
+	DD	$L$SEH_begin_sha1_block_data_order wrt ..imagebase
+	DD	$L$SEH_end_sha1_block_data_order wrt ..imagebase
+	DD	$L$SEH_info_sha1_block_data_order wrt ..imagebase
+	DD	$L$SEH_begin_sha1_block_data_order_ssse3 wrt ..imagebase
+	DD	$L$SEH_end_sha1_block_data_order_ssse3 wrt ..imagebase
+	DD	$L$SEH_info_sha1_block_data_order_ssse3 wrt ..imagebase
+section	.xdata rdata align=8
+ALIGN	8
+$L$SEH_info_sha1_block_data_order:
+DB	9,0,0,0
+	DD	se_handler wrt ..imagebase
+$L$SEH_info_sha1_block_data_order_ssse3:
+DB	9,0,0,0
+	DD	ssse3_handler wrt ..imagebase
+	DD	$L$prologue_ssse3 wrt ..imagebase,$L$epilogue_ssse3 wrt ..imagebase
diff --git a/third_party/boringssl/win-x86_64/crypto/sha/sha256-x86_64.asm b/third_party/boringssl/win-x86_64/crypto/sha/sha256-x86_64.asm
new file mode 100644
index 0000000..e6193c5
--- /dev/null
+++ b/third_party/boringssl/win-x86_64/crypto/sha/sha256-x86_64.asm
@@ -0,0 +1,2994 @@
+default	rel
+%define XMMWORD
+%define YMMWORD
+%define ZMMWORD
+section	.text code align=64
+
+
+EXTERN	OPENSSL_ia32cap_P
+global	sha256_block_data_order
+
+ALIGN	16
+sha256_block_data_order:
+	mov	QWORD[8+rsp],rdi	;WIN64 prologue
+	mov	QWORD[16+rsp],rsi
+	mov	rax,rsp
+$L$SEH_begin_sha256_block_data_order:
+	mov	rdi,rcx
+	mov	rsi,rdx
+	mov	rdx,r8
+
+
+	lea	r11,[OPENSSL_ia32cap_P]
+	mov	r9d,DWORD[r11]
+	mov	r10d,DWORD[4+r11]
+	mov	r11d,DWORD[8+r11]
+	test	r10d,512
+	jnz	NEAR $L$ssse3_shortcut
+	push	rbx
+	push	rbp
+	push	r12
+	push	r13
+	push	r14
+	push	r15
+	mov	r11,rsp
+	shl	rdx,4
+	sub	rsp,16*4+4*8
+	lea	rdx,[rdx*4+rsi]
+	and	rsp,-64
+	mov	QWORD[((64+0))+rsp],rdi
+	mov	QWORD[((64+8))+rsp],rsi
+	mov	QWORD[((64+16))+rsp],rdx
+	mov	QWORD[((64+24))+rsp],r11
+$L$prologue:
+
+	mov	eax,DWORD[rdi]
+	mov	ebx,DWORD[4+rdi]
+	mov	ecx,DWORD[8+rdi]
+	mov	edx,DWORD[12+rdi]
+	mov	r8d,DWORD[16+rdi]
+	mov	r9d,DWORD[20+rdi]
+	mov	r10d,DWORD[24+rdi]
+	mov	r11d,DWORD[28+rdi]
+	jmp	NEAR $L$loop
+
+ALIGN	16
+$L$loop:
+	mov	edi,ebx
+	lea	rbp,[K256]
+	xor	edi,ecx
+	mov	r12d,DWORD[rsi]
+	mov	r13d,r8d
+	mov	r14d,eax
+	bswap	r12d
+	ror	r13d,14
+	mov	r15d,r9d
+
+	xor	r13d,r8d
+	ror	r14d,9
+	xor	r15d,r10d
+
+	mov	DWORD[rsp],r12d
+	xor	r14d,eax
+	and	r15d,r8d
+
+	ror	r13d,5
+	add	r12d,r11d
+	xor	r15d,r10d
+
+	ror	r14d,11
+	xor	r13d,r8d
+	add	r12d,r15d
+
+	mov	r15d,eax
+	add	r12d,DWORD[rbp]
+	xor	r14d,eax
+
+	xor	r15d,ebx
+	ror	r13d,6
+	mov	r11d,ebx
+
+	and	edi,r15d
+	ror	r14d,2
+	add	r12d,r13d
+
+	xor	r11d,edi
+	add	edx,r12d
+	add	r11d,r12d
+
+	lea	rbp,[4+rbp]
+	add	r11d,r14d
+	mov	r12d,DWORD[4+rsi]
+	mov	r13d,edx
+	mov	r14d,r11d
+	bswap	r12d
+	ror	r13d,14
+	mov	edi,r8d
+
+	xor	r13d,edx
+	ror	r14d,9
+	xor	edi,r9d
+
+	mov	DWORD[4+rsp],r12d
+	xor	r14d,r11d
+	and	edi,edx
+
+	ror	r13d,5
+	add	r12d,r10d
+	xor	edi,r9d
+
+	ror	r14d,11
+	xor	r13d,edx
+	add	r12d,edi
+
+	mov	edi,r11d
+	add	r12d,DWORD[rbp]
+	xor	r14d,r11d
+
+	xor	edi,eax
+	ror	r13d,6
+	mov	r10d,eax
+
+	and	r15d,edi
+	ror	r14d,2
+	add	r12d,r13d
+
+	xor	r10d,r15d
+	add	ecx,r12d
+	add	r10d,r12d
+
+	lea	rbp,[4+rbp]
+	add	r10d,r14d
+	mov	r12d,DWORD[8+rsi]
+	mov	r13d,ecx
+	mov	r14d,r10d
+	bswap	r12d
+	ror	r13d,14
+	mov	r15d,edx
+
+	xor	r13d,ecx
+	ror	r14d,9
+	xor	r15d,r8d
+
+	mov	DWORD[8+rsp],r12d
+	xor	r14d,r10d
+	and	r15d,ecx
+
+	ror	r13d,5
+	add	r12d,r9d
+	xor	r15d,r8d
+
+	ror	r14d,11
+	xor	r13d,ecx
+	add	r12d,r15d
+
+	mov	r15d,r10d
+	add	r12d,DWORD[rbp]
+	xor	r14d,r10d
+
+	xor	r15d,r11d
+	ror	r13d,6
+	mov	r9d,r11d
+
+	and	edi,r15d
+	ror	r14d,2
+	add	r12d,r13d
+
+	xor	r9d,edi
+	add	ebx,r12d
+	add	r9d,r12d
+
+	lea	rbp,[4+rbp]
+	add	r9d,r14d
+	mov	r12d,DWORD[12+rsi]
+	mov	r13d,ebx
+	mov	r14d,r9d
+	bswap	r12d
+	ror	r13d,14
+	mov	edi,ecx
+
+	xor	r13d,ebx
+	ror	r14d,9
+	xor	edi,edx
+
+	mov	DWORD[12+rsp],r12d
+	xor	r14d,r9d
+	and	edi,ebx
+
+	ror	r13d,5
+	add	r12d,r8d
+	xor	edi,edx
+
+	ror	r14d,11
+	xor	r13d,ebx
+	add	r12d,edi
+
+	mov	edi,r9d
+	add	r12d,DWORD[rbp]
+	xor	r14d,r9d
+
+	xor	edi,r10d
+	ror	r13d,6
+	mov	r8d,r10d
+
+	and	r15d,edi
+	ror	r14d,2
+	add	r12d,r13d
+
+	xor	r8d,r15d
+	add	eax,r12d
+	add	r8d,r12d
+
+	lea	rbp,[20+rbp]
+	add	r8d,r14d
+	mov	r12d,DWORD[16+rsi]
+	mov	r13d,eax
+	mov	r14d,r8d
+	bswap	r12d
+	ror	r13d,14
+	mov	r15d,ebx
+
+	xor	r13d,eax
+	ror	r14d,9
+	xor	r15d,ecx
+
+	mov	DWORD[16+rsp],r12d
+	xor	r14d,r8d
+	and	r15d,eax
+
+	ror	r13d,5
+	add	r12d,edx
+	xor	r15d,ecx
+
+	ror	r14d,11
+	xor	r13d,eax
+	add	r12d,r15d
+
+	mov	r15d,r8d
+	add	r12d,DWORD[rbp]
+	xor	r14d,r8d
+
+	xor	r15d,r9d
+	ror	r13d,6
+	mov	edx,r9d
+
+	and	edi,r15d
+	ror	r14d,2
+	add	r12d,r13d
+
+	xor	edx,edi
+	add	r11d,r12d
+	add	edx,r12d
+
+	lea	rbp,[4+rbp]
+	add	edx,r14d
+	mov	r12d,DWORD[20+rsi]
+	mov	r13d,r11d
+	mov	r14d,edx
+	bswap	r12d
+	ror	r13d,14
+	mov	edi,eax
+
+	xor	r13d,r11d
+	ror	r14d,9
+	xor	edi,ebx
+
+	mov	DWORD[20+rsp],r12d
+	xor	r14d,edx
+	and	edi,r11d
+
+	ror	r13d,5
+	add	r12d,ecx
+	xor	edi,ebx
+
+	ror	r14d,11
+	xor	r13d,r11d
+	add	r12d,edi
+
+	mov	edi,edx
+	add	r12d,DWORD[rbp]
+	xor	r14d,edx
+
+	xor	edi,r8d
+	ror	r13d,6
+	mov	ecx,r8d
+
+	and	r15d,edi
+	ror	r14d,2
+	add	r12d,r13d
+
+	xor	ecx,r15d
+	add	r10d,r12d
+	add	ecx,r12d
+
+	lea	rbp,[4+rbp]
+	add	ecx,r14d
+	mov	r12d,DWORD[24+rsi]
+	mov	r13d,r10d
+	mov	r14d,ecx
+	bswap	r12d
+	ror	r13d,14
+	mov	r15d,r11d
+
+	xor	r13d,r10d
+	ror	r14d,9
+	xor	r15d,eax
+
+	mov	DWORD[24+rsp],r12d
+	xor	r14d,ecx
+	and	r15d,r10d
+
+	ror	r13d,5
+	add	r12d,ebx
+	xor	r15d,eax
+
+	ror	r14d,11
+	xor	r13d,r10d
+	add	r12d,r15d
+
+	mov	r15d,ecx
+	add	r12d,DWORD[rbp]
+	xor	r14d,ecx
+
+	xor	r15d,edx
+	ror	r13d,6
+	mov	ebx,edx
+
+	and	edi,r15d
+	ror	r14d,2
+	add	r12d,r13d
+
+	xor	ebx,edi
+	add	r9d,r12d
+	add	ebx,r12d
+
+	lea	rbp,[4+rbp]
+	add	ebx,r14d
+	mov	r12d,DWORD[28+rsi]
+	mov	r13d,r9d
+	mov	r14d,ebx
+	bswap	r12d
+	ror	r13d,14
+	mov	edi,r10d
+
+	xor	r13d,r9d
+	ror	r14d,9
+	xor	edi,r11d
+
+	mov	DWORD[28+rsp],r12d
+	xor	r14d,ebx
+	and	edi,r9d
+
+	ror	r13d,5
+	add	r12d,eax
+	xor	edi,r11d
+
+	ror	r14d,11
+	xor	r13d,r9d
+	add	r12d,edi
+
+	mov	edi,ebx
+	add	r12d,DWORD[rbp]
+	xor	r14d,ebx
+
+	xor	edi,ecx
+	ror	r13d,6
+	mov	eax,ecx
+
+	and	r15d,edi
+	ror	r14d,2
+	add	r12d,r13d
+
+	xor	eax,r15d
+	add	r8d,r12d
+	add	eax,r12d
+
+	lea	rbp,[20+rbp]
+	add	eax,r14d
+	mov	r12d,DWORD[32+rsi]
+	mov	r13d,r8d
+	mov	r14d,eax
+	bswap	r12d
+	ror	r13d,14
+	mov	r15d,r9d
+
+	xor	r13d,r8d
+	ror	r14d,9
+	xor	r15d,r10d
+
+	mov	DWORD[32+rsp],r12d
+	xor	r14d,eax
+	and	r15d,r8d
+
+	ror	r13d,5
+	add	r12d,r11d
+	xor	r15d,r10d
+
+	ror	r14d,11
+	xor	r13d,r8d
+	add	r12d,r15d
+
+	mov	r15d,eax
+	add	r12d,DWORD[rbp]
+	xor	r14d,eax
+
+	xor	r15d,ebx
+	ror	r13d,6
+	mov	r11d,ebx
+
+	and	edi,r15d
+	ror	r14d,2
+	add	r12d,r13d
+
+	xor	r11d,edi
+	add	edx,r12d
+	add	r11d,r12d
+
+	lea	rbp,[4+rbp]
+	add	r11d,r14d
+	mov	r12d,DWORD[36+rsi]
+	mov	r13d,edx
+	mov	r14d,r11d
+	bswap	r12d
+	ror	r13d,14
+	mov	edi,r8d
+
+	xor	r13d,edx
+	ror	r14d,9
+	xor	edi,r9d
+
+	mov	DWORD[36+rsp],r12d
+	xor	r14d,r11d
+	and	edi,edx
+
+	ror	r13d,5
+	add	r12d,r10d
+	xor	edi,r9d
+
+	ror	r14d,11
+	xor	r13d,edx
+	add	r12d,edi
+
+	mov	edi,r11d
+	add	r12d,DWORD[rbp]
+	xor	r14d,r11d
+
+	xor	edi,eax
+	ror	r13d,6
+	mov	r10d,eax
+
+	and	r15d,edi
+	ror	r14d,2
+	add	r12d,r13d
+
+	xor	r10d,r15d
+	add	ecx,r12d
+	add	r10d,r12d
+
+	lea	rbp,[4+rbp]
+	add	r10d,r14d
+	mov	r12d,DWORD[40+rsi]
+	mov	r13d,ecx
+	mov	r14d,r10d
+	bswap	r12d
+	ror	r13d,14
+	mov	r15d,edx
+
+	xor	r13d,ecx
+	ror	r14d,9
+	xor	r15d,r8d
+
+	mov	DWORD[40+rsp],r12d
+	xor	r14d,r10d
+	and	r15d,ecx
+
+	ror	r13d,5
+	add	r12d,r9d
+	xor	r15d,r8d
+
+	ror	r14d,11
+	xor	r13d,ecx
+	add	r12d,r15d
+
+	mov	r15d,r10d
+	add	r12d,DWORD[rbp]
+	xor	r14d,r10d
+
+	xor	r15d,r11d
+	ror	r13d,6
+	mov	r9d,r11d
+
+	and	edi,r15d
+	ror	r14d,2
+	add	r12d,r13d
+
+	xor	r9d,edi
+	add	ebx,r12d
+	add	r9d,r12d
+
+	lea	rbp,[4+rbp]
+	add	r9d,r14d
+	mov	r12d,DWORD[44+rsi]
+	mov	r13d,ebx
+	mov	r14d,r9d
+	bswap	r12d
+	ror	r13d,14
+	mov	edi,ecx
+
+	xor	r13d,ebx
+	ror	r14d,9
+	xor	edi,edx
+
+	mov	DWORD[44+rsp],r12d
+	xor	r14d,r9d
+	and	edi,ebx
+
+	ror	r13d,5
+	add	r12d,r8d
+	xor	edi,edx
+
+	ror	r14d,11
+	xor	r13d,ebx
+	add	r12d,edi
+
+	mov	edi,r9d
+	add	r12d,DWORD[rbp]
+	xor	r14d,r9d
+
+	xor	edi,r10d
+	ror	r13d,6
+	mov	r8d,r10d
+
+	and	r15d,edi
+	ror	r14d,2
+	add	r12d,r13d
+
+	xor	r8d,r15d
+	add	eax,r12d
+	add	r8d,r12d
+
+	lea	rbp,[20+rbp]
+	add	r8d,r14d
+	mov	r12d,DWORD[48+rsi]
+	mov	r13d,eax
+	mov	r14d,r8d
+	bswap	r12d
+	ror	r13d,14
+	mov	r15d,ebx
+
+	xor	r13d,eax
+	ror	r14d,9
+	xor	r15d,ecx
+
+	mov	DWORD[48+rsp],r12d
+	xor	r14d,r8d
+	and	r15d,eax
+
+	ror	r13d,5
+	add	r12d,edx
+	xor	r15d,ecx
+
+	ror	r14d,11
+	xor	r13d,eax
+	add	r12d,r15d
+
+	mov	r15d,r8d
+	add	r12d,DWORD[rbp]
+	xor	r14d,r8d
+
+	xor	r15d,r9d
+	ror	r13d,6
+	mov	edx,r9d
+
+	and	edi,r15d
+	ror	r14d,2
+	add	r12d,r13d
+
+	xor	edx,edi
+	add	r11d,r12d
+	add	edx,r12d
+
+	lea	rbp,[4+rbp]
+	add	edx,r14d
+	mov	r12d,DWORD[52+rsi]
+	mov	r13d,r11d
+	mov	r14d,edx
+	bswap	r12d
+	ror	r13d,14
+	mov	edi,eax
+
+	xor	r13d,r11d
+	ror	r14d,9
+	xor	edi,ebx
+
+	mov	DWORD[52+rsp],r12d
+	xor	r14d,edx
+	and	edi,r11d
+
+	ror	r13d,5
+	add	r12d,ecx
+	xor	edi,ebx
+
+	ror	r14d,11
+	xor	r13d,r11d
+	add	r12d,edi
+
+	mov	edi,edx
+	add	r12d,DWORD[rbp]
+	xor	r14d,edx
+
+	xor	edi,r8d
+	ror	r13d,6
+	mov	ecx,r8d
+
+	and	r15d,edi
+	ror	r14d,2
+	add	r12d,r13d
+
+	xor	ecx,r15d
+	add	r10d,r12d
+	add	ecx,r12d
+
+	lea	rbp,[4+rbp]
+	add	ecx,r14d
+	mov	r12d,DWORD[56+rsi]
+	mov	r13d,r10d
+	mov	r14d,ecx
+	bswap	r12d
+	ror	r13d,14
+	mov	r15d,r11d
+
+	xor	r13d,r10d
+	ror	r14d,9
+	xor	r15d,eax
+
+	mov	DWORD[56+rsp],r12d
+	xor	r14d,ecx
+	and	r15d,r10d
+
+	ror	r13d,5
+	add	r12d,ebx
+	xor	r15d,eax
+
+	ror	r14d,11
+	xor	r13d,r10d
+	add	r12d,r15d
+
+	mov	r15d,ecx
+	add	r12d,DWORD[rbp]
+	xor	r14d,ecx
+
+	xor	r15d,edx
+	ror	r13d,6
+	mov	ebx,edx
+
+	and	edi,r15d
+	ror	r14d,2
+	add	r12d,r13d
+
+	xor	ebx,edi
+	add	r9d,r12d
+	add	ebx,r12d
+
+	lea	rbp,[4+rbp]
+	add	ebx,r14d
+	mov	r12d,DWORD[60+rsi]
+	mov	r13d,r9d
+	mov	r14d,ebx
+	bswap	r12d
+	ror	r13d,14
+	mov	edi,r10d
+
+	xor	r13d,r9d
+	ror	r14d,9
+	xor	edi,r11d
+
+	mov	DWORD[60+rsp],r12d
+	xor	r14d,ebx
+	and	edi,r9d
+
+	ror	r13d,5
+	add	r12d,eax
+	xor	edi,r11d
+
+	ror	r14d,11
+	xor	r13d,r9d
+	add	r12d,edi
+
+	mov	edi,ebx
+	add	r12d,DWORD[rbp]
+	xor	r14d,ebx
+
+	xor	edi,ecx
+	ror	r13d,6
+	mov	eax,ecx
+
+	and	r15d,edi
+	ror	r14d,2
+	add	r12d,r13d
+
+	xor	eax,r15d
+	add	r8d,r12d
+	add	eax,r12d
+
+	lea	rbp,[20+rbp]
+	jmp	NEAR $L$rounds_16_xx
+ALIGN	16
+$L$rounds_16_xx:
+	mov	r13d,DWORD[4+rsp]
+	mov	r15d,DWORD[56+rsp]
+
+	mov	r12d,r13d
+	ror	r13d,11
+	add	eax,r14d
+	mov	r14d,r15d
+	ror	r15d,2
+
+	xor	r13d,r12d
+	shr	r12d,3
+	ror	r13d,7
+	xor	r15d,r14d
+	shr	r14d,10
+
+	ror	r15d,17
+	xor	r12d,r13d
+	xor	r15d,r14d
+	add	r12d,DWORD[36+rsp]
+
+	add	r12d,DWORD[rsp]
+	mov	r13d,r8d
+	add	r12d,r15d
+	mov	r14d,eax
+	ror	r13d,14
+	mov	r15d,r9d
+
+	xor	r13d,r8d
+	ror	r14d,9
+	xor	r15d,r10d
+
+	mov	DWORD[rsp],r12d
+	xor	r14d,eax
+	and	r15d,r8d
+
+	ror	r13d,5
+	add	r12d,r11d
+	xor	r15d,r10d
+
+	ror	r14d,11
+	xor	r13d,r8d
+	add	r12d,r15d
+
+	mov	r15d,eax
+	add	r12d,DWORD[rbp]
+	xor	r14d,eax
+
+	xor	r15d,ebx
+	ror	r13d,6
+	mov	r11d,ebx
+
+	and	edi,r15d
+	ror	r14d,2
+	add	r12d,r13d
+
+	xor	r11d,edi
+	add	edx,r12d
+	add	r11d,r12d
+
+	lea	rbp,[4+rbp]
+	mov	r13d,DWORD[8+rsp]
+	mov	edi,DWORD[60+rsp]
+
+	mov	r12d,r13d
+	ror	r13d,11
+	add	r11d,r14d
+	mov	r14d,edi
+	ror	edi,2
+
+	xor	r13d,r12d
+	shr	r12d,3
+	ror	r13d,7
+	xor	edi,r14d
+	shr	r14d,10
+
+	ror	edi,17
+	xor	r12d,r13d
+	xor	edi,r14d
+	add	r12d,DWORD[40+rsp]
+
+	add	r12d,DWORD[4+rsp]
+	mov	r13d,edx
+	add	r12d,edi
+	mov	r14d,r11d
+	ror	r13d,14
+	mov	edi,r8d
+
+	xor	r13d,edx
+	ror	r14d,9
+	xor	edi,r9d
+
+	mov	DWORD[4+rsp],r12d
+	xor	r14d,r11d
+	and	edi,edx
+
+	ror	r13d,5
+	add	r12d,r10d
+	xor	edi,r9d
+
+	ror	r14d,11
+	xor	r13d,edx
+	add	r12d,edi
+
+	mov	edi,r11d
+	add	r12d,DWORD[rbp]
+	xor	r14d,r11d
+
+	xor	edi,eax
+	ror	r13d,6
+	mov	r10d,eax
+
+	and	r15d,edi
+	ror	r14d,2
+	add	r12d,r13d
+
+	xor	r10d,r15d
+	add	ecx,r12d
+	add	r10d,r12d
+
+	lea	rbp,[4+rbp]
+	mov	r13d,DWORD[12+rsp]
+	mov	r15d,DWORD[rsp]
+
+	mov	r12d,r13d
+	ror	r13d,11
+	add	r10d,r14d
+	mov	r14d,r15d
+	ror	r15d,2
+
+	xor	r13d,r12d
+	shr	r12d,3
+	ror	r13d,7
+	xor	r15d,r14d
+	shr	r14d,10
+
+	ror	r15d,17
+	xor	r12d,r13d
+	xor	r15d,r14d
+	add	r12d,DWORD[44+rsp]
+
+	add	r12d,DWORD[8+rsp]
+	mov	r13d,ecx
+	add	r12d,r15d
+	mov	r14d,r10d
+	ror	r13d,14
+	mov	r15d,edx
+
+	xor	r13d,ecx
+	ror	r14d,9
+	xor	r15d,r8d
+
+	mov	DWORD[8+rsp],r12d
+	xor	r14d,r10d
+	and	r15d,ecx
+
+	ror	r13d,5
+	add	r12d,r9d
+	xor	r15d,r8d
+
+	ror	r14d,11
+	xor	r13d,ecx
+	add	r12d,r15d
+
+	mov	r15d,r10d
+	add	r12d,DWORD[rbp]
+	xor	r14d,r10d
+
+	xor	r15d,r11d
+	ror	r13d,6
+	mov	r9d,r11d
+
+	and	edi,r15d
+	ror	r14d,2
+	add	r12d,r13d
+
+	xor	r9d,edi
+	add	ebx,r12d
+	add	r9d,r12d
+
+	lea	rbp,[4+rbp]
+	mov	r13d,DWORD[16+rsp]
+	mov	edi,DWORD[4+rsp]
+
+	mov	r12d,r13d
+	ror	r13d,11
+	add	r9d,r14d
+	mov	r14d,edi
+	ror	edi,2
+
+	xor	r13d,r12d
+	shr	r12d,3
+	ror	r13d,7
+	xor	edi,r14d
+	shr	r14d,10
+
+	ror	edi,17
+	xor	r12d,r13d
+	xor	edi,r14d
+	add	r12d,DWORD[48+rsp]
+
+	add	r12d,DWORD[12+rsp]
+	mov	r13d,ebx
+	add	r12d,edi
+	mov	r14d,r9d
+	ror	r13d,14
+	mov	edi,ecx
+
+	xor	r13d,ebx
+	ror	r14d,9
+	xor	edi,edx
+
+	mov	DWORD[12+rsp],r12d
+	xor	r14d,r9d
+	and	edi,ebx
+
+	ror	r13d,5
+	add	r12d,r8d
+	xor	edi,edx
+
+	ror	r14d,11
+	xor	r13d,ebx
+	add	r12d,edi
+
+	mov	edi,r9d
+	add	r12d,DWORD[rbp]
+	xor	r14d,r9d
+
+	xor	edi,r10d
+	ror	r13d,6
+	mov	r8d,r10d
+
+	and	r15d,edi
+	ror	r14d,2
+	add	r12d,r13d
+
+	xor	r8d,r15d
+	add	eax,r12d
+	add	r8d,r12d
+
+	lea	rbp,[20+rbp]
+	mov	r13d,DWORD[20+rsp]
+	mov	r15d,DWORD[8+rsp]
+
+	mov	r12d,r13d
+	ror	r13d,11
+	add	r8d,r14d
+	mov	r14d,r15d
+	ror	r15d,2
+
+	xor	r13d,r12d
+	shr	r12d,3
+	ror	r13d,7
+	xor	r15d,r14d
+	shr	r14d,10
+
+	ror	r15d,17
+	xor	r12d,r13d
+	xor	r15d,r14d
+	add	r12d,DWORD[52+rsp]
+
+	add	r12d,DWORD[16+rsp]
+	mov	r13d,eax
+	add	r12d,r15d
+	mov	r14d,r8d
+	ror	r13d,14
+	mov	r15d,ebx
+
+	xor	r13d,eax
+	ror	r14d,9
+	xor	r15d,ecx
+
+	mov	DWORD[16+rsp],r12d
+	xor	r14d,r8d
+	and	r15d,eax
+
+	ror	r13d,5
+	add	r12d,edx
+	xor	r15d,ecx
+
+	ror	r14d,11
+	xor	r13d,eax
+	add	r12d,r15d
+
+	mov	r15d,r8d
+	add	r12d,DWORD[rbp]
+	xor	r14d,r8d
+
+	xor	r15d,r9d
+	ror	r13d,6
+	mov	edx,r9d
+
+	and	edi,r15d
+	ror	r14d,2
+	add	r12d,r13d
+
+	xor	edx,edi
+	add	r11d,r12d
+	add	edx,r12d
+
+	lea	rbp,[4+rbp]
+	mov	r13d,DWORD[24+rsp]
+	mov	edi,DWORD[12+rsp]
+
+	mov	r12d,r13d
+	ror	r13d,11
+	add	edx,r14d
+	mov	r14d,edi
+	ror	edi,2
+
+	xor	r13d,r12d
+	shr	r12d,3
+	ror	r13d,7
+	xor	edi,r14d
+	shr	r14d,10
+
+	ror	edi,17
+	xor	r12d,r13d
+	xor	edi,r14d
+	add	r12d,DWORD[56+rsp]
+
+	add	r12d,DWORD[20+rsp]
+	mov	r13d,r11d
+	add	r12d,edi
+	mov	r14d,edx
+	ror	r13d,14
+	mov	edi,eax
+
+	xor	r13d,r11d
+	ror	r14d,9
+	xor	edi,ebx
+
+	mov	DWORD[20+rsp],r12d
+	xor	r14d,edx
+	and	edi,r11d
+
+	ror	r13d,5
+	add	r12d,ecx
+	xor	edi,ebx
+
+	ror	r14d,11
+	xor	r13d,r11d
+	add	r12d,edi
+
+	mov	edi,edx
+	add	r12d,DWORD[rbp]
+	xor	r14d,edx
+
+	xor	edi,r8d
+	ror	r13d,6
+	mov	ecx,r8d
+
+	and	r15d,edi
+	ror	r14d,2
+	add	r12d,r13d
+
+	xor	ecx,r15d
+	add	r10d,r12d
+	add	ecx,r12d
+
+	lea	rbp,[4+rbp]
+	mov	r13d,DWORD[28+rsp]
+	mov	r15d,DWORD[16+rsp]
+
+	mov	r12d,r13d
+	ror	r13d,11
+	add	ecx,r14d
+	mov	r14d,r15d
+	ror	r15d,2
+
+	xor	r13d,r12d
+	shr	r12d,3
+	ror	r13d,7
+	xor	r15d,r14d
+	shr	r14d,10
+
+	ror	r15d,17
+	xor	r12d,r13d
+	xor	r15d,r14d
+	add	r12d,DWORD[60+rsp]
+
+	add	r12d,DWORD[24+rsp]
+	mov	r13d,r10d
+	add	r12d,r15d
+	mov	r14d,ecx
+	ror	r13d,14
+	mov	r15d,r11d
+
+	xor	r13d,r10d
+	ror	r14d,9
+	xor	r15d,eax
+
+	mov	DWORD[24+rsp],r12d
+	xor	r14d,ecx
+	and	r15d,r10d
+
+	ror	r13d,5
+	add	r12d,ebx
+	xor	r15d,eax
+
+	ror	r14d,11
+	xor	r13d,r10d
+	add	r12d,r15d
+
+	mov	r15d,ecx
+	add	r12d,DWORD[rbp]
+	xor	r14d,ecx
+
+	xor	r15d,edx
+	ror	r13d,6
+	mov	ebx,edx
+
+	and	edi,r15d
+	ror	r14d,2
+	add	r12d,r13d
+
+	xor	ebx,edi
+	add	r9d,r12d
+	add	ebx,r12d
+
+	lea	rbp,[4+rbp]
+	mov	r13d,DWORD[32+rsp]
+	mov	edi,DWORD[20+rsp]
+
+	mov	r12d,r13d
+	ror	r13d,11
+	add	ebx,r14d
+	mov	r14d,edi
+	ror	edi,2
+
+	xor	r13d,r12d
+	shr	r12d,3
+	ror	r13d,7
+	xor	edi,r14d
+	shr	r14d,10
+
+	ror	edi,17
+	xor	r12d,r13d
+	xor	edi,r14d
+	add	r12d,DWORD[rsp]
+
+	add	r12d,DWORD[28+rsp]
+	mov	r13d,r9d
+	add	r12d,edi
+	mov	r14d,ebx
+	ror	r13d,14
+	mov	edi,r10d
+
+	xor	r13d,r9d
+	ror	r14d,9
+	xor	edi,r11d
+
+	mov	DWORD[28+rsp],r12d
+	xor	r14d,ebx
+	and	edi,r9d
+
+	ror	r13d,5
+	add	r12d,eax
+	xor	edi,r11d
+
+	ror	r14d,11
+	xor	r13d,r9d
+	add	r12d,edi
+
+	mov	edi,ebx
+	add	r12d,DWORD[rbp]
+	xor	r14d,ebx
+
+	xor	edi,ecx
+	ror	r13d,6
+	mov	eax,ecx
+
+	and	r15d,edi
+	ror	r14d,2
+	add	r12d,r13d
+
+	xor	eax,r15d
+	add	r8d,r12d
+	add	eax,r12d
+
+	lea	rbp,[20+rbp]
+	mov	r13d,DWORD[36+rsp]
+	mov	r15d,DWORD[24+rsp]
+
+	mov	r12d,r13d
+	ror	r13d,11
+	add	eax,r14d
+	mov	r14d,r15d
+	ror	r15d,2
+
+	xor	r13d,r12d
+	shr	r12d,3
+	ror	r13d,7
+	xor	r15d,r14d
+	shr	r14d,10
+
+	ror	r15d,17
+	xor	r12d,r13d
+	xor	r15d,r14d
+	add	r12d,DWORD[4+rsp]
+
+	add	r12d,DWORD[32+rsp]
+	mov	r13d,r8d
+	add	r12d,r15d
+	mov	r14d,eax
+	ror	r13d,14
+	mov	r15d,r9d
+
+	xor	r13d,r8d
+	ror	r14d,9
+	xor	r15d,r10d
+
+	mov	DWORD[32+rsp],r12d
+	xor	r14d,eax
+	and	r15d,r8d
+
+	ror	r13d,5
+	add	r12d,r11d
+	xor	r15d,r10d
+
+	ror	r14d,11
+	xor	r13d,r8d
+	add	r12d,r15d
+
+	mov	r15d,eax
+	add	r12d,DWORD[rbp]
+	xor	r14d,eax
+
+	xor	r15d,ebx
+	ror	r13d,6
+	mov	r11d,ebx
+
+	and	edi,r15d
+	ror	r14d,2
+	add	r12d,r13d
+
+	xor	r11d,edi
+	add	edx,r12d
+	add	r11d,r12d
+
+	lea	rbp,[4+rbp]
+	mov	r13d,DWORD[40+rsp]
+	mov	edi,DWORD[28+rsp]
+
+	mov	r12d,r13d
+	ror	r13d,11
+	add	r11d,r14d
+	mov	r14d,edi
+	ror	edi,2
+
+	xor	r13d,r12d
+	shr	r12d,3
+	ror	r13d,7
+	xor	edi,r14d
+	shr	r14d,10
+
+	ror	edi,17
+	xor	r12d,r13d
+	xor	edi,r14d
+	add	r12d,DWORD[8+rsp]
+
+	add	r12d,DWORD[36+rsp]
+	mov	r13d,edx
+	add	r12d,edi
+	mov	r14d,r11d
+	ror	r13d,14
+	mov	edi,r8d
+
+	xor	r13d,edx
+	ror	r14d,9
+	xor	edi,r9d
+
+	mov	DWORD[36+rsp],r12d
+	xor	r14d,r11d
+	and	edi,edx
+
+	ror	r13d,5
+	add	r12d,r10d
+	xor	edi,r9d
+
+	ror	r14d,11
+	xor	r13d,edx
+	add	r12d,edi
+
+	mov	edi,r11d
+	add	r12d,DWORD[rbp]
+	xor	r14d,r11d
+
+	xor	edi,eax
+	ror	r13d,6
+	mov	r10d,eax
+
+	and	r15d,edi
+	ror	r14d,2
+	add	r12d,r13d
+
+	xor	r10d,r15d
+	add	ecx,r12d
+	add	r10d,r12d
+
+	lea	rbp,[4+rbp]
+	mov	r13d,DWORD[44+rsp]
+	mov	r15d,DWORD[32+rsp]
+
+	mov	r12d,r13d
+	ror	r13d,11
+	add	r10d,r14d
+	mov	r14d,r15d
+	ror	r15d,2
+
+	xor	r13d,r12d
+	shr	r12d,3
+	ror	r13d,7
+	xor	r15d,r14d
+	shr	r14d,10
+
+	ror	r15d,17
+	xor	r12d,r13d
+	xor	r15d,r14d
+	add	r12d,DWORD[12+rsp]
+
+	add	r12d,DWORD[40+rsp]
+	mov	r13d,ecx
+	add	r12d,r15d
+	mov	r14d,r10d
+	ror	r13d,14
+	mov	r15d,edx
+
+	xor	r13d,ecx
+	ror	r14d,9
+	xor	r15d,r8d
+
+	mov	DWORD[40+rsp],r12d
+	xor	r14d,r10d
+	and	r15d,ecx
+
+	ror	r13d,5
+	add	r12d,r9d
+	xor	r15d,r8d
+
+	ror	r14d,11
+	xor	r13d,ecx
+	add	r12d,r15d
+
+	mov	r15d,r10d
+	add	r12d,DWORD[rbp]
+	xor	r14d,r10d
+
+	xor	r15d,r11d
+	ror	r13d,6
+	mov	r9d,r11d
+
+	and	edi,r15d
+	ror	r14d,2
+	add	r12d,r13d
+
+	xor	r9d,edi
+	add	ebx,r12d
+	add	r9d,r12d
+
+	lea	rbp,[4+rbp]
+	mov	r13d,DWORD[48+rsp]
+	mov	edi,DWORD[36+rsp]
+
+	mov	r12d,r13d
+	ror	r13d,11
+	add	r9d,r14d
+	mov	r14d,edi
+	ror	edi,2
+
+	xor	r13d,r12d
+	shr	r12d,3
+	ror	r13d,7
+	xor	edi,r14d
+	shr	r14d,10
+
+	ror	edi,17
+	xor	r12d,r13d
+	xor	edi,r14d
+	add	r12d,DWORD[16+rsp]
+
+	add	r12d,DWORD[44+rsp]
+	mov	r13d,ebx
+	add	r12d,edi
+	mov	r14d,r9d
+	ror	r13d,14
+	mov	edi,ecx
+
+	xor	r13d,ebx
+	ror	r14d,9
+	xor	edi,edx
+
+	mov	DWORD[44+rsp],r12d
+	xor	r14d,r9d
+	and	edi,ebx
+
+	ror	r13d,5
+	add	r12d,r8d
+	xor	edi,edx
+
+	ror	r14d,11
+	xor	r13d,ebx
+	add	r12d,edi
+
+	mov	edi,r9d
+	add	r12d,DWORD[rbp]
+	xor	r14d,r9d
+
+	xor	edi,r10d
+	ror	r13d,6
+	mov	r8d,r10d
+
+	and	r15d,edi
+	ror	r14d,2
+	add	r12d,r13d
+
+	xor	r8d,r15d
+	add	eax,r12d
+	add	r8d,r12d
+
+	lea	rbp,[20+rbp]
+	mov	r13d,DWORD[52+rsp]
+	mov	r15d,DWORD[40+rsp]
+
+	mov	r12d,r13d
+	ror	r13d,11
+	add	r8d,r14d
+	mov	r14d,r15d
+	ror	r15d,2
+
+	xor	r13d,r12d
+	shr	r12d,3
+	ror	r13d,7
+	xor	r15d,r14d
+	shr	r14d,10
+
+	ror	r15d,17
+	xor	r12d,r13d
+	xor	r15d,r14d
+	add	r12d,DWORD[20+rsp]
+
+	add	r12d,DWORD[48+rsp]
+	mov	r13d,eax
+	add	r12d,r15d
+	mov	r14d,r8d
+	ror	r13d,14
+	mov	r15d,ebx
+
+	xor	r13d,eax
+	ror	r14d,9
+	xor	r15d,ecx
+
+	mov	DWORD[48+rsp],r12d
+	xor	r14d,r8d
+	and	r15d,eax
+
+	ror	r13d,5
+	add	r12d,edx
+	xor	r15d,ecx
+
+	ror	r14d,11
+	xor	r13d,eax
+	add	r12d,r15d
+
+	mov	r15d,r8d
+	add	r12d,DWORD[rbp]
+	xor	r14d,r8d
+
+	xor	r15d,r9d
+	ror	r13d,6
+	mov	edx,r9d
+
+	and	edi,r15d
+	ror	r14d,2
+	add	r12d,r13d
+
+	xor	edx,edi
+	add	r11d,r12d
+	add	edx,r12d
+
+	lea	rbp,[4+rbp]
+	mov	r13d,DWORD[56+rsp]
+	mov	edi,DWORD[44+rsp]
+
+	mov	r12d,r13d
+	ror	r13d,11
+	add	edx,r14d
+	mov	r14d,edi
+	ror	edi,2
+
+	xor	r13d,r12d
+	shr	r12d,3
+	ror	r13d,7
+	xor	edi,r14d
+	shr	r14d,10
+
+	ror	edi,17
+	xor	r12d,r13d
+	xor	edi,r14d
+	add	r12d,DWORD[24+rsp]
+
+	add	r12d,DWORD[52+rsp]
+	mov	r13d,r11d
+	add	r12d,edi
+	mov	r14d,edx
+	ror	r13d,14
+	mov	edi,eax
+
+	xor	r13d,r11d
+	ror	r14d,9
+	xor	edi,ebx
+
+	mov	DWORD[52+rsp],r12d
+	xor	r14d,edx
+	and	edi,r11d
+
+	ror	r13d,5
+	add	r12d,ecx
+	xor	edi,ebx
+
+	ror	r14d,11
+	xor	r13d,r11d
+	add	r12d,edi
+
+	mov	edi,edx
+	add	r12d,DWORD[rbp]
+	xor	r14d,edx
+
+	xor	edi,r8d
+	ror	r13d,6
+	mov	ecx,r8d
+
+	and	r15d,edi
+	ror	r14d,2
+	add	r12d,r13d
+
+	xor	ecx,r15d
+	add	r10d,r12d
+	add	ecx,r12d
+
+	lea	rbp,[4+rbp]
+	mov	r13d,DWORD[60+rsp]
+	mov	r15d,DWORD[48+rsp]
+
+	mov	r12d,r13d
+	ror	r13d,11
+	add	ecx,r14d
+	mov	r14d,r15d
+	ror	r15d,2
+
+	xor	r13d,r12d
+	shr	r12d,3
+	ror	r13d,7
+	xor	r15d,r14d
+	shr	r14d,10
+
+	ror	r15d,17
+	xor	r12d,r13d
+	xor	r15d,r14d
+	add	r12d,DWORD[28+rsp]
+
+	add	r12d,DWORD[56+rsp]
+	mov	r13d,r10d
+	add	r12d,r15d
+	mov	r14d,ecx
+	ror	r13d,14
+	mov	r15d,r11d
+
+	xor	r13d,r10d
+	ror	r14d,9
+	xor	r15d,eax
+
+	mov	DWORD[56+rsp],r12d
+	xor	r14d,ecx
+	and	r15d,r10d
+
+	ror	r13d,5
+	add	r12d,ebx
+	xor	r15d,eax
+
+	ror	r14d,11
+	xor	r13d,r10d
+	add	r12d,r15d
+
+	mov	r15d,ecx
+	add	r12d,DWORD[rbp]
+	xor	r14d,ecx
+
+	xor	r15d,edx
+	ror	r13d,6
+	mov	ebx,edx
+
+	and	edi,r15d
+	ror	r14d,2
+	add	r12d,r13d
+
+	xor	ebx,edi
+	add	r9d,r12d
+	add	ebx,r12d
+
+	lea	rbp,[4+rbp]
+	mov	r13d,DWORD[rsp]
+	mov	edi,DWORD[52+rsp]
+
+	mov	r12d,r13d
+	ror	r13d,11
+	add	ebx,r14d
+	mov	r14d,edi
+	ror	edi,2
+
+	xor	r13d,r12d
+	shr	r12d,3
+	ror	r13d,7
+	xor	edi,r14d
+	shr	r14d,10
+
+	ror	edi,17
+	xor	r12d,r13d
+	xor	edi,r14d
+	add	r12d,DWORD[32+rsp]
+
+	add	r12d,DWORD[60+rsp]
+	mov	r13d,r9d
+	add	r12d,edi
+	mov	r14d,ebx
+	ror	r13d,14
+	mov	edi,r10d
+
+	xor	r13d,r9d
+	ror	r14d,9
+	xor	edi,r11d
+
+	mov	DWORD[60+rsp],r12d
+	xor	r14d,ebx
+	and	edi,r9d
+
+	ror	r13d,5
+	add	r12d,eax
+	xor	edi,r11d
+
+	ror	r14d,11
+	xor	r13d,r9d
+	add	r12d,edi
+
+	mov	edi,ebx
+	add	r12d,DWORD[rbp]
+	xor	r14d,ebx
+
+	xor	edi,ecx
+	ror	r13d,6
+	mov	eax,ecx
+
+	and	r15d,edi
+	ror	r14d,2
+	add	r12d,r13d
+
+	xor	eax,r15d
+	add	r8d,r12d
+	add	eax,r12d
+
+	lea	rbp,[20+rbp]
+	cmp	BYTE[3+rbp],0
+	jnz	NEAR $L$rounds_16_xx
+
+	mov	rdi,QWORD[((64+0))+rsp]
+	add	eax,r14d
+	lea	rsi,[64+rsi]
+
+	add	eax,DWORD[rdi]
+	add	ebx,DWORD[4+rdi]
+	add	ecx,DWORD[8+rdi]
+	add	edx,DWORD[12+rdi]
+	add	r8d,DWORD[16+rdi]
+	add	r9d,DWORD[20+rdi]
+	add	r10d,DWORD[24+rdi]
+	add	r11d,DWORD[28+rdi]
+
+	cmp	rsi,QWORD[((64+16))+rsp]
+
+	mov	DWORD[rdi],eax
+	mov	DWORD[4+rdi],ebx
+	mov	DWORD[8+rdi],ecx
+	mov	DWORD[12+rdi],edx
+	mov	DWORD[16+rdi],r8d
+	mov	DWORD[20+rdi],r9d
+	mov	DWORD[24+rdi],r10d
+	mov	DWORD[28+rdi],r11d
+	jb	NEAR $L$loop
+
+	mov	rsi,QWORD[((64+24))+rsp]
+	mov	r15,QWORD[rsi]
+	mov	r14,QWORD[8+rsi]
+	mov	r13,QWORD[16+rsi]
+	mov	r12,QWORD[24+rsi]
+	mov	rbp,QWORD[32+rsi]
+	mov	rbx,QWORD[40+rsi]
+	lea	rsp,[48+rsi]
+$L$epilogue:
+	mov	rdi,QWORD[8+rsp]	;WIN64 epilogue
+	mov	rsi,QWORD[16+rsp]
+	DB	0F3h,0C3h		;repret
+$L$SEH_end_sha256_block_data_order:
+ALIGN	64
+
+K256:
+	DD	0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5
+	DD	0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5
+	DD	0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5
+	DD	0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5
+	DD	0xd807aa98,0x12835b01,0x243185be,0x550c7dc3
+	DD	0xd807aa98,0x12835b01,0x243185be,0x550c7dc3
+	DD	0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174
+	DD	0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174
+	DD	0xe49b69c1,0xefbe4786,0x0fc19dc6,0x240ca1cc
+	DD	0xe49b69c1,0xefbe4786,0x0fc19dc6,0x240ca1cc
+	DD	0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da
+	DD	0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da
+	DD	0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7
+	DD	0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7
+	DD	0xc6e00bf3,0xd5a79147,0x06ca6351,0x14292967
+	DD	0xc6e00bf3,0xd5a79147,0x06ca6351,0x14292967
+	DD	0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13
+	DD	0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13
+	DD	0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85
+	DD	0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85
+	DD	0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3
+	DD	0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3
+	DD	0xd192e819,0xd6990624,0xf40e3585,0x106aa070
+	DD	0xd192e819,0xd6990624,0xf40e3585,0x106aa070
+	DD	0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5
+	DD	0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5
+	DD	0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3
+	DD	0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3
+	DD	0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208
+	DD	0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208
+	DD	0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2
+	DD	0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2
+
+	DD	0x00010203,0x04050607,0x08090a0b,0x0c0d0e0f
+	DD	0x00010203,0x04050607,0x08090a0b,0x0c0d0e0f
+	DD	0x03020100,0x0b0a0908,0xffffffff,0xffffffff
+	DD	0x03020100,0x0b0a0908,0xffffffff,0xffffffff
+	DD	0xffffffff,0xffffffff,0x03020100,0x0b0a0908
+	DD	0xffffffff,0xffffffff,0x03020100,0x0b0a0908
+DB	83,72,65,50,53,54,32,98,108,111,99,107,32,116,114,97
+DB	110,115,102,111,114,109,32,102,111,114,32,120,56,54,95,54
+DB	52,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121
+DB	32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46
+DB	111,114,103,62,0
+
+ALIGN	64
+sha256_block_data_order_ssse3:
+	mov	QWORD[8+rsp],rdi	;WIN64 prologue
+	mov	QWORD[16+rsp],rsi
+	mov	rax,rsp
+$L$SEH_begin_sha256_block_data_order_ssse3:
+	mov	rdi,rcx
+	mov	rsi,rdx
+	mov	rdx,r8
+
+
+$L$ssse3_shortcut:
+	push	rbx
+	push	rbp
+	push	r12
+	push	r13
+	push	r14
+	push	r15
+	mov	r11,rsp
+	shl	rdx,4
+	sub	rsp,160
+	lea	rdx,[rdx*4+rsi]
+	and	rsp,-64
+	mov	QWORD[((64+0))+rsp],rdi
+	mov	QWORD[((64+8))+rsp],rsi
+	mov	QWORD[((64+16))+rsp],rdx
+	mov	QWORD[((64+24))+rsp],r11
+	movaps	XMMWORD[(64+32)+rsp],xmm6
+	movaps	XMMWORD[(64+48)+rsp],xmm7
+	movaps	XMMWORD[(64+64)+rsp],xmm8
+	movaps	XMMWORD[(64+80)+rsp],xmm9
+$L$prologue_ssse3:
+
+	mov	eax,DWORD[rdi]
+	mov	ebx,DWORD[4+rdi]
+	mov	ecx,DWORD[8+rdi]
+	mov	edx,DWORD[12+rdi]
+	mov	r8d,DWORD[16+rdi]
+	mov	r9d,DWORD[20+rdi]
+	mov	r10d,DWORD[24+rdi]
+	mov	r11d,DWORD[28+rdi]
+
+
+	jmp	NEAR $L$loop_ssse3
+ALIGN	16
+$L$loop_ssse3:
+	movdqa	xmm7,XMMWORD[((K256+512))]
+	movdqu	xmm0,XMMWORD[rsi]
+	movdqu	xmm1,XMMWORD[16+rsi]
+	movdqu	xmm2,XMMWORD[32+rsi]
+DB	102,15,56,0,199
+	movdqu	xmm3,XMMWORD[48+rsi]
+	lea	rbp,[K256]
+DB	102,15,56,0,207
+	movdqa	xmm4,XMMWORD[rbp]
+	movdqa	xmm5,XMMWORD[32+rbp]
+DB	102,15,56,0,215
+	paddd	xmm4,xmm0
+	movdqa	xmm6,XMMWORD[64+rbp]
+DB	102,15,56,0,223
+	movdqa	xmm7,XMMWORD[96+rbp]
+	paddd	xmm5,xmm1
+	paddd	xmm6,xmm2
+	paddd	xmm7,xmm3
+	movdqa	XMMWORD[rsp],xmm4
+	mov	r14d,eax
+	movdqa	XMMWORD[16+rsp],xmm5
+	mov	edi,ebx
+	movdqa	XMMWORD[32+rsp],xmm6
+	xor	edi,ecx
+	movdqa	XMMWORD[48+rsp],xmm7
+	mov	r13d,r8d
+	jmp	NEAR $L$ssse3_00_47
+
+ALIGN	16
+$L$ssse3_00_47:
+	sub	rbp,-128
+	ror	r13d,14
+	movdqa	xmm4,xmm1
+	mov	eax,r14d
+	mov	r12d,r9d
+	movdqa	xmm7,xmm3
+	ror	r14d,9
+	xor	r13d,r8d
+	xor	r12d,r10d
+	ror	r13d,5
+	xor	r14d,eax
+DB	102,15,58,15,224,4
+	and	r12d,r8d
+	xor	r13d,r8d
+DB	102,15,58,15,250,4
+	add	r11d,DWORD[rsp]
+	mov	r15d,eax
+	xor	r12d,r10d
+	ror	r14d,11
+	movdqa	xmm5,xmm4
+	xor	r15d,ebx
+	add	r11d,r12d
+	movdqa	xmm6,xmm4
+	ror	r13d,6
+	and	edi,r15d
+	psrld	xmm4,3
+	xor	r14d,eax
+	add	r11d,r13d
+	xor	edi,ebx
+	paddd	xmm0,xmm7
+	ror	r14d,2
+	add	edx,r11d
+	psrld	xmm6,7
+	add	r11d,edi
+	mov	r13d,edx
+	pshufd	xmm7,xmm3,250
+	add	r14d,r11d
+	ror	r13d,14
+	pslld	xmm5,14
+	mov	r11d,r14d
+	mov	r12d,r8d
+	pxor	xmm4,xmm6
+	ror	r14d,9
+	xor	r13d,edx
+	xor	r12d,r9d
+	ror	r13d,5
+	psrld	xmm6,11
+	xor	r14d,r11d
+	pxor	xmm4,xmm5
+	and	r12d,edx
+	xor	r13d,edx
+	pslld	xmm5,11
+	add	r10d,DWORD[4+rsp]
+	mov	edi,r11d
+	pxor	xmm4,xmm6
+	xor	r12d,r9d
+	ror	r14d,11
+	movdqa	xmm6,xmm7
+	xor	edi,eax
+	add	r10d,r12d
+	pxor	xmm4,xmm5
+	ror	r13d,6
+	and	r15d,edi
+	xor	r14d,r11d
+	psrld	xmm7,10
+	add	r10d,r13d
+	xor	r15d,eax
+	paddd	xmm0,xmm4
+	ror	r14d,2
+	add	ecx,r10d
+	psrlq	xmm6,17
+	add	r10d,r15d
+	mov	r13d,ecx
+	add	r14d,r10d
+	pxor	xmm7,xmm6
+	ror	r13d,14
+	mov	r10d,r14d
+	mov	r12d,edx
+	ror	r14d,9
+	psrlq	xmm6,2
+	xor	r13d,ecx
+	xor	r12d,r8d
+	pxor	xmm7,xmm6
+	ror	r13d,5
+	xor	r14d,r10d
+	and	r12d,ecx
+	pshufd	xmm7,xmm7,128
+	xor	r13d,ecx
+	add	r9d,DWORD[8+rsp]
+	mov	r15d,r10d
+	psrldq	xmm7,8
+	xor	r12d,r8d
+	ror	r14d,11
+	xor	r15d,r11d
+	add	r9d,r12d
+	ror	r13d,6
+	paddd	xmm0,xmm7
+	and	edi,r15d
+	xor	r14d,r10d
+	add	r9d,r13d
+	pshufd	xmm7,xmm0,80
+	xor	edi,r11d
+	ror	r14d,2
+	add	ebx,r9d
+	movdqa	xmm6,xmm7
+	add	r9d,edi
+	mov	r13d,ebx
+	psrld	xmm7,10
+	add	r14d,r9d
+	ror	r13d,14
+	psrlq	xmm6,17
+	mov	r9d,r14d
+	mov	r12d,ecx
+	pxor	xmm7,xmm6
+	ror	r14d,9
+	xor	r13d,ebx
+	xor	r12d,edx
+	ror	r13d,5
+	xor	r14d,r9d
+	psrlq	xmm6,2
+	and	r12d,ebx
+	xor	r13d,ebx
+	add	r8d,DWORD[12+rsp]
+	pxor	xmm7,xmm6
+	mov	edi,r9d
+	xor	r12d,edx
+	ror	r14d,11
+	pshufd	xmm7,xmm7,8
+	xor	edi,r10d
+	add	r8d,r12d
+	movdqa	xmm6,XMMWORD[rbp]
+	ror	r13d,6
+	and	r15d,edi
+	pslldq	xmm7,8
+	xor	r14d,r9d
+	add	r8d,r13d
+	xor	r15d,r10d
+	paddd	xmm0,xmm7
+	ror	r14d,2
+	add	eax,r8d
+	add	r8d,r15d
+	paddd	xmm6,xmm0
+	mov	r13d,eax
+	add	r14d,r8d
+	movdqa	XMMWORD[rsp],xmm6
+	ror	r13d,14
+	movdqa	xmm4,xmm2
+	mov	r8d,r14d
+	mov	r12d,ebx
+	movdqa	xmm7,xmm0
+	ror	r14d,9
+	xor	r13d,eax
+	xor	r12d,ecx
+	ror	r13d,5
+	xor	r14d,r8d
+DB	102,15,58,15,225,4
+	and	r12d,eax
+	xor	r13d,eax
+DB	102,15,58,15,251,4
+	add	edx,DWORD[16+rsp]
+	mov	r15d,r8d
+	xor	r12d,ecx
+	ror	r14d,11
+	movdqa	xmm5,xmm4
+	xor	r15d,r9d
+	add	edx,r12d
+	movdqa	xmm6,xmm4
+	ror	r13d,6
+	and	edi,r15d
+	psrld	xmm4,3
+	xor	r14d,r8d
+	add	edx,r13d
+	xor	edi,r9d
+	paddd	xmm1,xmm7
+	ror	r14d,2
+	add	r11d,edx
+	psrld	xmm6,7
+	add	edx,edi
+	mov	r13d,r11d
+	pshufd	xmm7,xmm0,250
+	add	r14d,edx
+	ror	r13d,14
+	pslld	xmm5,14
+	mov	edx,r14d
+	mov	r12d,eax
+	pxor	xmm4,xmm6
+	ror	r14d,9
+	xor	r13d,r11d
+	xor	r12d,ebx
+	ror	r13d,5
+	psrld	xmm6,11
+	xor	r14d,edx
+	pxor	xmm4,xmm5
+	and	r12d,r11d
+	xor	r13d,r11d
+	pslld	xmm5,11
+	add	ecx,DWORD[20+rsp]
+	mov	edi,edx
+	pxor	xmm4,xmm6
+	xor	r12d,ebx
+	ror	r14d,11
+	movdqa	xmm6,xmm7
+	xor	edi,r8d
+	add	ecx,r12d
+	pxor	xmm4,xmm5
+	ror	r13d,6
+	and	r15d,edi
+	xor	r14d,edx
+	psrld	xmm7,10
+	add	ecx,r13d
+	xor	r15d,r8d
+	paddd	xmm1,xmm4
+	ror	r14d,2
+	add	r10d,ecx
+	psrlq	xmm6,17
+	add	ecx,r15d
+	mov	r13d,r10d
+	add	r14d,ecx
+	pxor	xmm7,xmm6
+	ror	r13d,14
+	mov	ecx,r14d
+	mov	r12d,r11d
+	ror	r14d,9
+	psrlq	xmm6,2
+	xor	r13d,r10d
+	xor	r12d,eax
+	pxor	xmm7,xmm6
+	ror	r13d,5
+	xor	r14d,ecx
+	and	r12d,r10d
+	pshufd	xmm7,xmm7,128
+	xor	r13d,r10d
+	add	ebx,DWORD[24+rsp]
+	mov	r15d,ecx
+	psrldq	xmm7,8
+	xor	r12d,eax
+	ror	r14d,11
+	xor	r15d,edx
+	add	ebx,r12d
+	ror	r13d,6
+	paddd	xmm1,xmm7
+	and	edi,r15d
+	xor	r14d,ecx
+	add	ebx,r13d
+	pshufd	xmm7,xmm1,80
+	xor	edi,edx
+	ror	r14d,2
+	add	r9d,ebx
+	movdqa	xmm6,xmm7
+	add	ebx,edi
+	mov	r13d,r9d
+	psrld	xmm7,10
+	add	r14d,ebx
+	ror	r13d,14
+	psrlq	xmm6,17
+	mov	ebx,r14d
+	mov	r12d,r10d
+	pxor	xmm7,xmm6
+	ror	r14d,9
+	xor	r13d,r9d
+	xor	r12d,r11d
+	ror	r13d,5
+	xor	r14d,ebx
+	psrlq	xmm6,2
+	and	r12d,r9d
+	xor	r13d,r9d
+	add	eax,DWORD[28+rsp]
+	pxor	xmm7,xmm6
+	mov	edi,ebx
+	xor	r12d,r11d
+	ror	r14d,11
+	pshufd	xmm7,xmm7,8
+	xor	edi,ecx
+	add	eax,r12d
+	movdqa	xmm6,XMMWORD[32+rbp]
+	ror	r13d,6
+	and	r15d,edi
+	pslldq	xmm7,8
+	xor	r14d,ebx
+	add	eax,r13d
+	xor	r15d,ecx
+	paddd	xmm1,xmm7
+	ror	r14d,2
+	add	r8d,eax
+	add	eax,r15d
+	paddd	xmm6,xmm1
+	mov	r13d,r8d
+	add	r14d,eax
+	movdqa	XMMWORD[16+rsp],xmm6
+	ror	r13d,14
+	movdqa	xmm4,xmm3
+	mov	eax,r14d
+	mov	r12d,r9d
+	movdqa	xmm7,xmm1
+	ror	r14d,9
+	xor	r13d,r8d
+	xor	r12d,r10d
+	ror	r13d,5
+	xor	r14d,eax
+DB	102,15,58,15,226,4
+	and	r12d,r8d
+	xor	r13d,r8d
+DB	102,15,58,15,248,4
+	add	r11d,DWORD[32+rsp]
+	mov	r15d,eax
+	xor	r12d,r10d
+	ror	r14d,11
+	movdqa	xmm5,xmm4
+	xor	r15d,ebx
+	add	r11d,r12d
+	movdqa	xmm6,xmm4
+	ror	r13d,6
+	and	edi,r15d
+	psrld	xmm4,3
+	xor	r14d,eax
+	add	r11d,r13d
+	xor	edi,ebx
+	paddd	xmm2,xmm7
+	ror	r14d,2
+	add	edx,r11d
+	psrld	xmm6,7
+	add	r11d,edi
+	mov	r13d,edx
+	pshufd	xmm7,xmm1,250
+	add	r14d,r11d
+	ror	r13d,14
+	pslld	xmm5,14
+	mov	r11d,r14d
+	mov	r12d,r8d
+	pxor	xmm4,xmm6
+	ror	r14d,9
+	xor	r13d,edx
+	xor	r12d,r9d
+	ror	r13d,5
+	psrld	xmm6,11
+	xor	r14d,r11d
+	pxor	xmm4,xmm5
+	and	r12d,edx
+	xor	r13d,edx
+	pslld	xmm5,11
+	add	r10d,DWORD[36+rsp]
+	mov	edi,r11d
+	pxor	xmm4,xmm6
+	xor	r12d,r9d
+	ror	r14d,11
+	movdqa	xmm6,xmm7
+	xor	edi,eax
+	add	r10d,r12d
+	pxor	xmm4,xmm5
+	ror	r13d,6
+	and	r15d,edi
+	xor	r14d,r11d
+	psrld	xmm7,10
+	add	r10d,r13d
+	xor	r15d,eax
+	paddd	xmm2,xmm4
+	ror	r14d,2
+	add	ecx,r10d
+	psrlq	xmm6,17
+	add	r10d,r15d
+	mov	r13d,ecx
+	add	r14d,r10d
+	pxor	xmm7,xmm6
+	ror	r13d,14
+	mov	r10d,r14d
+	mov	r12d,edx
+	ror	r14d,9
+	psrlq	xmm6,2
+	xor	r13d,ecx
+	xor	r12d,r8d
+	pxor	xmm7,xmm6
+	ror	r13d,5
+	xor	r14d,r10d
+	and	r12d,ecx
+	pshufd	xmm7,xmm7,128
+	xor	r13d,ecx
+	add	r9d,DWORD[40+rsp]
+	mov	r15d,r10d
+	psrldq	xmm7,8
+	xor	r12d,r8d
+	ror	r14d,11
+	xor	r15d,r11d
+	add	r9d,r12d
+	ror	r13d,6
+	paddd	xmm2,xmm7
+	and	edi,r15d
+	xor	r14d,r10d
+	add	r9d,r13d
+	pshufd	xmm7,xmm2,80
+	xor	edi,r11d
+	ror	r14d,2
+	add	ebx,r9d
+	movdqa	xmm6,xmm7
+	add	r9d,edi
+	mov	r13d,ebx
+	psrld	xmm7,10
+	add	r14d,r9d
+	ror	r13d,14
+	psrlq	xmm6,17
+	mov	r9d,r14d
+	mov	r12d,ecx
+	pxor	xmm7,xmm6
+	ror	r14d,9
+	xor	r13d,ebx
+	xor	r12d,edx
+	ror	r13d,5
+	xor	r14d,r9d
+	psrlq	xmm6,2
+	and	r12d,ebx
+	xor	r13d,ebx
+	add	r8d,DWORD[44+rsp]
+	pxor	xmm7,xmm6
+	mov	edi,r9d
+	xor	r12d,edx
+	ror	r14d,11
+	pshufd	xmm7,xmm7,8
+	xor	edi,r10d
+	add	r8d,r12d
+	movdqa	xmm6,XMMWORD[64+rbp]
+	ror	r13d,6
+	and	r15d,edi
+	pslldq	xmm7,8
+	xor	r14d,r9d
+	add	r8d,r13d
+	xor	r15d,r10d
+	paddd	xmm2,xmm7
+	ror	r14d,2
+	add	eax,r8d
+	add	r8d,r15d
+	paddd	xmm6,xmm2
+	mov	r13d,eax
+	add	r14d,r8d
+	movdqa	XMMWORD[32+rsp],xmm6
+	ror	r13d,14
+	movdqa	xmm4,xmm0
+	mov	r8d,r14d
+	mov	r12d,ebx
+	movdqa	xmm7,xmm2
+	ror	r14d,9
+	xor	r13d,eax
+	xor	r12d,ecx
+	ror	r13d,5
+	xor	r14d,r8d
+DB	102,15,58,15,227,4
+	and	r12d,eax
+	xor	r13d,eax
+DB	102,15,58,15,249,4
+	add	edx,DWORD[48+rsp]
+	mov	r15d,r8d
+	xor	r12d,ecx
+	ror	r14d,11
+	movdqa	xmm5,xmm4
+	xor	r15d,r9d
+	add	edx,r12d
+	movdqa	xmm6,xmm4
+	ror	r13d,6
+	and	edi,r15d
+	psrld	xmm4,3
+	xor	r14d,r8d
+	add	edx,r13d
+	xor	edi,r9d
+	paddd	xmm3,xmm7
+	ror	r14d,2
+	add	r11d,edx
+	psrld	xmm6,7
+	add	edx,edi
+	mov	r13d,r11d
+	pshufd	xmm7,xmm2,250
+	add	r14d,edx
+	ror	r13d,14
+	pslld	xmm5,14
+	mov	edx,r14d
+	mov	r12d,eax
+	pxor	xmm4,xmm6
+	ror	r14d,9
+	xor	r13d,r11d
+	xor	r12d,ebx
+	ror	r13d,5
+	psrld	xmm6,11
+	xor	r14d,edx
+	pxor	xmm4,xmm5
+	and	r12d,r11d
+	xor	r13d,r11d
+	pslld	xmm5,11
+	add	ecx,DWORD[52+rsp]
+	mov	edi,edx
+	pxor	xmm4,xmm6
+	xor	r12d,ebx
+	ror	r14d,11
+	movdqa	xmm6,xmm7
+	xor	edi,r8d
+	add	ecx,r12d
+	pxor	xmm4,xmm5
+	ror	r13d,6
+	and	r15d,edi
+	xor	r14d,edx
+	psrld	xmm7,10
+	add	ecx,r13d
+	xor	r15d,r8d
+	paddd	xmm3,xmm4
+	ror	r14d,2
+	add	r10d,ecx
+	psrlq	xmm6,17
+	add	ecx,r15d
+	mov	r13d,r10d
+	add	r14d,ecx
+	pxor	xmm7,xmm6
+	ror	r13d,14
+	mov	ecx,r14d
+	mov	r12d,r11d
+	ror	r14d,9
+	psrlq	xmm6,2
+	xor	r13d,r10d
+	xor	r12d,eax
+	pxor	xmm7,xmm6
+	ror	r13d,5
+	xor	r14d,ecx
+	and	r12d,r10d
+	pshufd	xmm7,xmm7,128
+	xor	r13d,r10d
+	add	ebx,DWORD[56+rsp]
+	mov	r15d,ecx
+	psrldq	xmm7,8
+	xor	r12d,eax
+	ror	r14d,11
+	xor	r15d,edx
+	add	ebx,r12d
+	ror	r13d,6
+	paddd	xmm3,xmm7
+	and	edi,r15d
+	xor	r14d,ecx
+	add	ebx,r13d
+	pshufd	xmm7,xmm3,80
+	xor	edi,edx
+	ror	r14d,2
+	add	r9d,ebx
+	movdqa	xmm6,xmm7
+	add	ebx,edi
+	mov	r13d,r9d
+	psrld	xmm7,10
+	add	r14d,ebx
+	ror	r13d,14
+	psrlq	xmm6,17
+	mov	ebx,r14d
+	mov	r12d,r10d
+	pxor	xmm7,xmm6
+	ror	r14d,9
+	xor	r13d,r9d
+	xor	r12d,r11d
+	ror	r13d,5
+	xor	r14d,ebx
+	psrlq	xmm6,2
+	and	r12d,r9d
+	xor	r13d,r9d
+	add	eax,DWORD[60+rsp]
+	pxor	xmm7,xmm6
+	mov	edi,ebx
+	xor	r12d,r11d
+	ror	r14d,11
+	pshufd	xmm7,xmm7,8
+	xor	edi,ecx
+	add	eax,r12d
+	movdqa	xmm6,XMMWORD[96+rbp]
+	ror	r13d,6
+	and	r15d,edi
+	pslldq	xmm7,8
+	xor	r14d,ebx
+	add	eax,r13d
+	xor	r15d,ecx
+	paddd	xmm3,xmm7
+	ror	r14d,2
+	add	r8d,eax
+	add	eax,r15d
+	paddd	xmm6,xmm3
+	mov	r13d,r8d
+	add	r14d,eax
+	movdqa	XMMWORD[48+rsp],xmm6
+	cmp	BYTE[131+rbp],0
+	jne	NEAR $L$ssse3_00_47
+	ror	r13d,14
+	mov	eax,r14d
+	mov	r12d,r9d
+	ror	r14d,9
+	xor	r13d,r8d
+	xor	r12d,r10d
+	ror	r13d,5
+	xor	r14d,eax
+	and	r12d,r8d
+	xor	r13d,r8d
+	add	r11d,DWORD[rsp]
+	mov	r15d,eax
+	xor	r12d,r10d
+	ror	r14d,11
+	xor	r15d,ebx
+	add	r11d,r12d
+	ror	r13d,6
+	and	edi,r15d
+	xor	r14d,eax
+	add	r11d,r13d
+	xor	edi,ebx
+	ror	r14d,2
+	add	edx,r11d
+	add	r11d,edi
+	mov	r13d,edx
+	add	r14d,r11d
+	ror	r13d,14
+	mov	r11d,r14d
+	mov	r12d,r8d
+	ror	r14d,9
+	xor	r13d,edx
+	xor	r12d,r9d
+	ror	r13d,5
+	xor	r14d,r11d
+	and	r12d,edx
+	xor	r13d,edx
+	add	r10d,DWORD[4+rsp]
+	mov	edi,r11d
+	xor	r12d,r9d
+	ror	r14d,11
+	xor	edi,eax
+	add	r10d,r12d
+	ror	r13d,6
+	and	r15d,edi
+	xor	r14d,r11d
+	add	r10d,r13d
+	xor	r15d,eax
+	ror	r14d,2
+	add	ecx,r10d
+	add	r10d,r15d
+	mov	r13d,ecx
+	add	r14d,r10d
+	ror	r13d,14
+	mov	r10d,r14d
+	mov	r12d,edx
+	ror	r14d,9
+	xor	r13d,ecx
+	xor	r12d,r8d
+	ror	r13d,5
+	xor	r14d,r10d
+	and	r12d,ecx
+	xor	r13d,ecx
+	add	r9d,DWORD[8+rsp]
+	mov	r15d,r10d
+	xor	r12d,r8d
+	ror	r14d,11
+	xor	r15d,r11d
+	add	r9d,r12d
+	ror	r13d,6
+	and	edi,r15d
+	xor	r14d,r10d
+	add	r9d,r13d
+	xor	edi,r11d
+	ror	r14d,2
+	add	ebx,r9d
+	add	r9d,edi
+	mov	r13d,ebx
+	add	r14d,r9d
+	ror	r13d,14
+	mov	r9d,r14d
+	mov	r12d,ecx
+	ror	r14d,9
+	xor	r13d,ebx
+	xor	r12d,edx
+	ror	r13d,5
+	xor	r14d,r9d
+	and	r12d,ebx
+	xor	r13d,ebx
+	add	r8d,DWORD[12+rsp]
+	mov	edi,r9d
+	xor	r12d,edx
+	ror	r14d,11
+	xor	edi,r10d
+	add	r8d,r12d
+	ror	r13d,6
+	and	r15d,edi
+	xor	r14d,r9d
+	add	r8d,r13d
+	xor	r15d,r10d
+	ror	r14d,2
+	add	eax,r8d
+	add	r8d,r15d
+	mov	r13d,eax
+	add	r14d,r8d
+	ror	r13d,14
+	mov	r8d,r14d
+	mov	r12d,ebx
+	ror	r14d,9
+	xor	r13d,eax
+	xor	r12d,ecx
+	ror	r13d,5
+	xor	r14d,r8d
+	and	r12d,eax
+	xor	r13d,eax
+	add	edx,DWORD[16+rsp]
+	mov	r15d,r8d
+	xor	r12d,ecx
+	ror	r14d,11
+	xor	r15d,r9d
+	add	edx,r12d
+	ror	r13d,6
+	and	edi,r15d
+	xor	r14d,r8d
+	add	edx,r13d
+	xor	edi,r9d
+	ror	r14d,2
+	add	r11d,edx
+	add	edx,edi
+	mov	r13d,r11d
+	add	r14d,edx
+	ror	r13d,14
+	mov	edx,r14d
+	mov	r12d,eax
+	ror	r14d,9
+	xor	r13d,r11d
+	xor	r12d,ebx
+	ror	r13d,5
+	xor	r14d,edx
+	and	r12d,r11d
+	xor	r13d,r11d
+	add	ecx,DWORD[20+rsp]
+	mov	edi,edx
+	xor	r12d,ebx
+	ror	r14d,11
+	xor	edi,r8d
+	add	ecx,r12d
+	ror	r13d,6
+	and	r15d,edi
+	xor	r14d,edx
+	add	ecx,r13d
+	xor	r15d,r8d
+	ror	r14d,2
+	add	r10d,ecx
+	add	ecx,r15d
+	mov	r13d,r10d
+	add	r14d,ecx
+	ror	r13d,14
+	mov	ecx,r14d
+	mov	r12d,r11d
+	ror	r14d,9
+	xor	r13d,r10d
+	xor	r12d,eax
+	ror	r13d,5
+	xor	r14d,ecx
+	and	r12d,r10d
+	xor	r13d,r10d
+	add	ebx,DWORD[24+rsp]
+	mov	r15d,ecx
+	xor	r12d,eax
+	ror	r14d,11
+	xor	r15d,edx
+	add	ebx,r12d
+	ror	r13d,6
+	and	edi,r15d
+	xor	r14d,ecx
+	add	ebx,r13d
+	xor	edi,edx
+	ror	r14d,2
+	add	r9d,ebx
+	add	ebx,edi
+	mov	r13d,r9d
+	add	r14d,ebx
+	ror	r13d,14
+	mov	ebx,r14d
+	mov	r12d,r10d
+	ror	r14d,9
+	xor	r13d,r9d
+	xor	r12d,r11d
+	ror	r13d,5
+	xor	r14d,ebx
+	and	r12d,r9d
+	xor	r13d,r9d
+	add	eax,DWORD[28+rsp]
+	mov	edi,ebx
+	xor	r12d,r11d
+	ror	r14d,11
+	xor	edi,ecx
+	add	eax,r12d
+	ror	r13d,6
+	and	r15d,edi
+	xor	r14d,ebx
+	add	eax,r13d
+	xor	r15d,ecx
+	ror	r14d,2
+	add	r8d,eax
+	add	eax,r15d
+	mov	r13d,r8d
+	add	r14d,eax
+	ror	r13d,14
+	mov	eax,r14d
+	mov	r12d,r9d
+	ror	r14d,9
+	xor	r13d,r8d
+	xor	r12d,r10d
+	ror	r13d,5
+	xor	r14d,eax
+	and	r12d,r8d
+	xor	r13d,r8d
+	add	r11d,DWORD[32+rsp]
+	mov	r15d,eax
+	xor	r12d,r10d
+	ror	r14d,11
+	xor	r15d,ebx
+	add	r11d,r12d
+	ror	r13d,6
+	and	edi,r15d
+	xor	r14d,eax
+	add	r11d,r13d
+	xor	edi,ebx
+	ror	r14d,2
+	add	edx,r11d
+	add	r11d,edi
+	mov	r13d,edx
+	add	r14d,r11d
+	ror	r13d,14
+	mov	r11d,r14d
+	mov	r12d,r8d
+	ror	r14d,9
+	xor	r13d,edx
+	xor	r12d,r9d
+	ror	r13d,5
+	xor	r14d,r11d
+	and	r12d,edx
+	xor	r13d,edx
+	add	r10d,DWORD[36+rsp]
+	mov	edi,r11d
+	xor	r12d,r9d
+	ror	r14d,11
+	xor	edi,eax
+	add	r10d,r12d
+	ror	r13d,6
+	and	r15d,edi
+	xor	r14d,r11d
+	add	r10d,r13d
+	xor	r15d,eax
+	ror	r14d,2
+	add	ecx,r10d
+	add	r10d,r15d
+	mov	r13d,ecx
+	add	r14d,r10d
+	ror	r13d,14
+	mov	r10d,r14d
+	mov	r12d,edx
+	ror	r14d,9
+	xor	r13d,ecx
+	xor	r12d,r8d
+	ror	r13d,5
+	xor	r14d,r10d
+	and	r12d,ecx
+	xor	r13d,ecx
+	add	r9d,DWORD[40+rsp]
+	mov	r15d,r10d
+	xor	r12d,r8d
+	ror	r14d,11
+	xor	r15d,r11d
+	add	r9d,r12d
+	ror	r13d,6
+	and	edi,r15d
+	xor	r14d,r10d
+	add	r9d,r13d
+	xor	edi,r11d
+	ror	r14d,2
+	add	ebx,r9d
+	add	r9d,edi
+	mov	r13d,ebx
+	add	r14d,r9d
+	ror	r13d,14
+	mov	r9d,r14d
+	mov	r12d,ecx
+	ror	r14d,9
+	xor	r13d,ebx
+	xor	r12d,edx
+	ror	r13d,5
+	xor	r14d,r9d
+	and	r12d,ebx
+	xor	r13d,ebx
+	add	r8d,DWORD[44+rsp]
+	mov	edi,r9d
+	xor	r12d,edx
+	ror	r14d,11
+	xor	edi,r10d
+	add	r8d,r12d
+	ror	r13d,6
+	and	r15d,edi
+	xor	r14d,r9d
+	add	r8d,r13d
+	xor	r15d,r10d
+	ror	r14d,2
+	add	eax,r8d
+	add	r8d,r15d
+	mov	r13d,eax
+	add	r14d,r8d
+	ror	r13d,14
+	mov	r8d,r14d
+	mov	r12d,ebx
+	ror	r14d,9
+	xor	r13d,eax
+	xor	r12d,ecx
+	ror	r13d,5
+	xor	r14d,r8d
+	and	r12d,eax
+	xor	r13d,eax
+	add	edx,DWORD[48+rsp]
+	mov	r15d,r8d
+	xor	r12d,ecx
+	ror	r14d,11
+	xor	r15d,r9d
+	add	edx,r12d
+	ror	r13d,6
+	and	edi,r15d
+	xor	r14d,r8d
+	add	edx,r13d
+	xor	edi,r9d
+	ror	r14d,2
+	add	r11d,edx
+	add	edx,edi
+	mov	r13d,r11d
+	add	r14d,edx
+	ror	r13d,14
+	mov	edx,r14d
+	mov	r12d,eax
+	ror	r14d,9
+	xor	r13d,r11d
+	xor	r12d,ebx
+	ror	r13d,5
+	xor	r14d,edx
+	and	r12d,r11d
+	xor	r13d,r11d
+	add	ecx,DWORD[52+rsp]
+	mov	edi,edx
+	xor	r12d,ebx
+	ror	r14d,11
+	xor	edi,r8d
+	add	ecx,r12d
+	ror	r13d,6
+	and	r15d,edi
+	xor	r14d,edx
+	add	ecx,r13d
+	xor	r15d,r8d
+	ror	r14d,2
+	add	r10d,ecx
+	add	ecx,r15d
+	mov	r13d,r10d
+	add	r14d,ecx
+	ror	r13d,14
+	mov	ecx,r14d
+	mov	r12d,r11d
+	ror	r14d,9
+	xor	r13d,r10d
+	xor	r12d,eax
+	ror	r13d,5
+	xor	r14d,ecx
+	and	r12d,r10d
+	xor	r13d,r10d
+	add	ebx,DWORD[56+rsp]
+	mov	r15d,ecx
+	xor	r12d,eax
+	ror	r14d,11
+	xor	r15d,edx
+	add	ebx,r12d
+	ror	r13d,6
+	and	edi,r15d
+	xor	r14d,ecx
+	add	ebx,r13d
+	xor	edi,edx
+	ror	r14d,2
+	add	r9d,ebx
+	add	ebx,edi
+	mov	r13d,r9d
+	add	r14d,ebx
+	ror	r13d,14
+	mov	ebx,r14d
+	mov	r12d,r10d
+	ror	r14d,9
+	xor	r13d,r9d
+	xor	r12d,r11d
+	ror	r13d,5
+	xor	r14d,ebx
+	and	r12d,r9d
+	xor	r13d,r9d
+	add	eax,DWORD[60+rsp]
+	mov	edi,ebx
+	xor	r12d,r11d
+	ror	r14d,11
+	xor	edi,ecx
+	add	eax,r12d
+	ror	r13d,6
+	and	r15d,edi
+	xor	r14d,ebx
+	add	eax,r13d
+	xor	r15d,ecx
+	ror	r14d,2
+	add	r8d,eax
+	add	eax,r15d
+	mov	r13d,r8d
+	add	r14d,eax
+	mov	rdi,QWORD[((64+0))+rsp]
+	mov	eax,r14d
+
+	add	eax,DWORD[rdi]
+	lea	rsi,[64+rsi]
+	add	ebx,DWORD[4+rdi]
+	add	ecx,DWORD[8+rdi]
+	add	edx,DWORD[12+rdi]
+	add	r8d,DWORD[16+rdi]
+	add	r9d,DWORD[20+rdi]
+	add	r10d,DWORD[24+rdi]
+	add	r11d,DWORD[28+rdi]
+
+	cmp	rsi,QWORD[((64+16))+rsp]
+
+	mov	DWORD[rdi],eax
+	mov	DWORD[4+rdi],ebx
+	mov	DWORD[8+rdi],ecx
+	mov	DWORD[12+rdi],edx
+	mov	DWORD[16+rdi],r8d
+	mov	DWORD[20+rdi],r9d
+	mov	DWORD[24+rdi],r10d
+	mov	DWORD[28+rdi],r11d
+	jb	NEAR $L$loop_ssse3
+
+	mov	rsi,QWORD[((64+24))+rsp]
+	movaps	xmm6,XMMWORD[((64+32))+rsp]
+	movaps	xmm7,XMMWORD[((64+48))+rsp]
+	movaps	xmm8,XMMWORD[((64+64))+rsp]
+	movaps	xmm9,XMMWORD[((64+80))+rsp]
+	mov	r15,QWORD[rsi]
+	mov	r14,QWORD[8+rsi]
+	mov	r13,QWORD[16+rsi]
+	mov	r12,QWORD[24+rsi]
+	mov	rbp,QWORD[32+rsi]
+	mov	rbx,QWORD[40+rsi]
+	lea	rsp,[48+rsi]
+$L$epilogue_ssse3:
+	mov	rdi,QWORD[8+rsp]	;WIN64 epilogue
+	mov	rsi,QWORD[16+rsp]
+	DB	0F3h,0C3h		;repret
+$L$SEH_end_sha256_block_data_order_ssse3:
+EXTERN	__imp_RtlVirtualUnwind
+
+ALIGN	16
+se_handler:
+	push	rsi
+	push	rdi
+	push	rbx
+	push	rbp
+	push	r12
+	push	r13
+	push	r14
+	push	r15
+	pushfq
+	sub	rsp,64
+
+	mov	rax,QWORD[120+r8]
+	mov	rbx,QWORD[248+r8]
+
+	mov	rsi,QWORD[8+r9]
+	mov	r11,QWORD[56+r9]
+
+	mov	r10d,DWORD[r11]
+	lea	r10,[r10*1+rsi]
+	cmp	rbx,r10
+	jb	NEAR $L$in_prologue
+
+	mov	rax,QWORD[152+r8]
+
+	mov	r10d,DWORD[4+r11]
+	lea	r10,[r10*1+rsi]
+	cmp	rbx,r10
+	jae	NEAR $L$in_prologue
+	mov	rsi,rax
+	mov	rax,QWORD[((64+24))+rax]
+	lea	rax,[48+rax]
+
+	mov	rbx,QWORD[((-8))+rax]
+	mov	rbp,QWORD[((-16))+rax]
+	mov	r12,QWORD[((-24))+rax]
+	mov	r13,QWORD[((-32))+rax]
+	mov	r14,QWORD[((-40))+rax]
+	mov	r15,QWORD[((-48))+rax]
+	mov	QWORD[144+r8],rbx
+	mov	QWORD[160+r8],rbp
+	mov	QWORD[216+r8],r12
+	mov	QWORD[224+r8],r13
+	mov	QWORD[232+r8],r14
+	mov	QWORD[240+r8],r15
+
+	lea	r10,[$L$epilogue]
+	cmp	rbx,r10
+	jb	NEAR $L$in_prologue
+
+	lea	rsi,[((64+32))+rsi]
+	lea	rdi,[512+r8]
+	mov	ecx,8
+	DD	0xa548f3fc
+
+$L$in_prologue:
+	mov	rdi,QWORD[8+rax]
+	mov	rsi,QWORD[16+rax]
+	mov	QWORD[152+r8],rax
+	mov	QWORD[168+r8],rsi
+	mov	QWORD[176+r8],rdi
+
+	mov	rdi,QWORD[40+r9]
+	mov	rsi,r8
+	mov	ecx,154
+	DD	0xa548f3fc
+
+	mov	rsi,r9
+	xor	rcx,rcx
+	mov	rdx,QWORD[8+rsi]
+	mov	r8,QWORD[rsi]
+	mov	r9,QWORD[16+rsi]
+	mov	r10,QWORD[40+rsi]
+	lea	r11,[56+rsi]
+	lea	r12,[24+rsi]
+	mov	QWORD[32+rsp],r10
+	mov	QWORD[40+rsp],r11
+	mov	QWORD[48+rsp],r12
+	mov	QWORD[56+rsp],rcx
+	call	QWORD[__imp_RtlVirtualUnwind]
+
+	mov	eax,1
+	add	rsp,64
+	popfq
+	pop	r15
+	pop	r14
+	pop	r13
+	pop	r12
+	pop	rbp
+	pop	rbx
+	pop	rdi
+	pop	rsi
+	DB	0F3h,0C3h		;repret
+
+section	.pdata rdata align=4
+ALIGN	4
+	DD	$L$SEH_begin_sha256_block_data_order wrt ..imagebase
+	DD	$L$SEH_end_sha256_block_data_order wrt ..imagebase
+	DD	$L$SEH_info_sha256_block_data_order wrt ..imagebase
+	DD	$L$SEH_begin_sha256_block_data_order_ssse3 wrt ..imagebase
+	DD	$L$SEH_end_sha256_block_data_order_ssse3 wrt ..imagebase
+	DD	$L$SEH_info_sha256_block_data_order_ssse3 wrt ..imagebase
+section	.xdata rdata align=8
+ALIGN	8
+$L$SEH_info_sha256_block_data_order:
+DB	9,0,0,0
+	DD	se_handler wrt ..imagebase
+	DD	$L$prologue wrt ..imagebase,$L$epilogue wrt ..imagebase
+$L$SEH_info_sha256_block_data_order_ssse3:
+DB	9,0,0,0
+	DD	se_handler wrt ..imagebase
+	DD	$L$prologue_ssse3 wrt ..imagebase,$L$epilogue_ssse3 wrt ..imagebase
diff --git a/third_party/boringssl/win-x86_64/crypto/sha/sha512-x86_64.asm b/third_party/boringssl/win-x86_64/crypto/sha/sha512-x86_64.asm
new file mode 100644
index 0000000..b76cc0e
--- /dev/null
+++ b/third_party/boringssl/win-x86_64/crypto/sha/sha512-x86_64.asm
@@ -0,0 +1,1911 @@
+default	rel
+%define XMMWORD
+%define YMMWORD
+%define ZMMWORD
+section	.text code align=64
+
+
+EXTERN	OPENSSL_ia32cap_P
+global	sha512_block_data_order
+
+ALIGN	16
+sha512_block_data_order:
+	mov	QWORD[8+rsp],rdi	;WIN64 prologue
+	mov	QWORD[16+rsp],rsi
+	mov	rax,rsp
+$L$SEH_begin_sha512_block_data_order:
+	mov	rdi,rcx
+	mov	rsi,rdx
+	mov	rdx,r8
+
+
+	push	rbx
+	push	rbp
+	push	r12
+	push	r13
+	push	r14
+	push	r15
+	mov	r11,rsp
+	shl	rdx,4
+	sub	rsp,16*8+4*8
+	lea	rdx,[rdx*8+rsi]
+	and	rsp,-64
+	mov	QWORD[((128+0))+rsp],rdi
+	mov	QWORD[((128+8))+rsp],rsi
+	mov	QWORD[((128+16))+rsp],rdx
+	mov	QWORD[((128+24))+rsp],r11
+$L$prologue:
+
+	mov	rax,QWORD[rdi]
+	mov	rbx,QWORD[8+rdi]
+	mov	rcx,QWORD[16+rdi]
+	mov	rdx,QWORD[24+rdi]
+	mov	r8,QWORD[32+rdi]
+	mov	r9,QWORD[40+rdi]
+	mov	r10,QWORD[48+rdi]
+	mov	r11,QWORD[56+rdi]
+	jmp	NEAR $L$loop
+
+ALIGN	16
+$L$loop:
+	mov	rdi,rbx
+	lea	rbp,[K512]
+	xor	rdi,rcx
+	mov	r12,QWORD[rsi]
+	mov	r13,r8
+	mov	r14,rax
+	bswap	r12
+	ror	r13,23
+	mov	r15,r9
+
+	xor	r13,r8
+	ror	r14,5
+	xor	r15,r10
+
+	mov	QWORD[rsp],r12
+	xor	r14,rax
+	and	r15,r8
+
+	ror	r13,4
+	add	r12,r11
+	xor	r15,r10
+
+	ror	r14,6
+	xor	r13,r8
+	add	r12,r15
+
+	mov	r15,rax
+	add	r12,QWORD[rbp]
+	xor	r14,rax
+
+	xor	r15,rbx
+	ror	r13,14
+	mov	r11,rbx
+
+	and	rdi,r15
+	ror	r14,28
+	add	r12,r13
+
+	xor	r11,rdi
+	add	rdx,r12
+	add	r11,r12
+
+	lea	rbp,[8+rbp]
+	add	r11,r14
+	mov	r12,QWORD[8+rsi]
+	mov	r13,rdx
+	mov	r14,r11
+	bswap	r12
+	ror	r13,23
+	mov	rdi,r8
+
+	xor	r13,rdx
+	ror	r14,5
+	xor	rdi,r9
+
+	mov	QWORD[8+rsp],r12
+	xor	r14,r11
+	and	rdi,rdx
+
+	ror	r13,4
+	add	r12,r10
+	xor	rdi,r9
+
+	ror	r14,6
+	xor	r13,rdx
+	add	r12,rdi
+
+	mov	rdi,r11
+	add	r12,QWORD[rbp]
+	xor	r14,r11
+
+	xor	rdi,rax
+	ror	r13,14
+	mov	r10,rax
+
+	and	r15,rdi
+	ror	r14,28
+	add	r12,r13
+
+	xor	r10,r15
+	add	rcx,r12
+	add	r10,r12
+
+	lea	rbp,[24+rbp]
+	add	r10,r14
+	mov	r12,QWORD[16+rsi]
+	mov	r13,rcx
+	mov	r14,r10
+	bswap	r12
+	ror	r13,23
+	mov	r15,rdx
+
+	xor	r13,rcx
+	ror	r14,5
+	xor	r15,r8
+
+	mov	QWORD[16+rsp],r12
+	xor	r14,r10
+	and	r15,rcx
+
+	ror	r13,4
+	add	r12,r9
+	xor	r15,r8
+
+	ror	r14,6
+	xor	r13,rcx
+	add	r12,r15
+
+	mov	r15,r10
+	add	r12,QWORD[rbp]
+	xor	r14,r10
+
+	xor	r15,r11
+	ror	r13,14
+	mov	r9,r11
+
+	and	rdi,r15
+	ror	r14,28
+	add	r12,r13
+
+	xor	r9,rdi
+	add	rbx,r12
+	add	r9,r12
+
+	lea	rbp,[8+rbp]
+	add	r9,r14
+	mov	r12,QWORD[24+rsi]
+	mov	r13,rbx
+	mov	r14,r9
+	bswap	r12
+	ror	r13,23
+	mov	rdi,rcx
+
+	xor	r13,rbx
+	ror	r14,5
+	xor	rdi,rdx
+
+	mov	QWORD[24+rsp],r12
+	xor	r14,r9
+	and	rdi,rbx
+
+	ror	r13,4
+	add	r12,r8
+	xor	rdi,rdx
+
+	ror	r14,6
+	xor	r13,rbx
+	add	r12,rdi
+
+	mov	rdi,r9
+	add	r12,QWORD[rbp]
+	xor	r14,r9
+
+	xor	rdi,r10
+	ror	r13,14
+	mov	r8,r10
+
+	and	r15,rdi
+	ror	r14,28
+	add	r12,r13
+
+	xor	r8,r15
+	add	rax,r12
+	add	r8,r12
+
+	lea	rbp,[24+rbp]
+	add	r8,r14
+	mov	r12,QWORD[32+rsi]
+	mov	r13,rax
+	mov	r14,r8
+	bswap	r12
+	ror	r13,23
+	mov	r15,rbx
+
+	xor	r13,rax
+	ror	r14,5
+	xor	r15,rcx
+
+	mov	QWORD[32+rsp],r12
+	xor	r14,r8
+	and	r15,rax
+
+	ror	r13,4
+	add	r12,rdx
+	xor	r15,rcx
+
+	ror	r14,6
+	xor	r13,rax
+	add	r12,r15
+
+	mov	r15,r8
+	add	r12,QWORD[rbp]
+	xor	r14,r8
+
+	xor	r15,r9
+	ror	r13,14
+	mov	rdx,r9
+
+	and	rdi,r15
+	ror	r14,28
+	add	r12,r13
+
+	xor	rdx,rdi
+	add	r11,r12
+	add	rdx,r12
+
+	lea	rbp,[8+rbp]
+	add	rdx,r14
+	mov	r12,QWORD[40+rsi]
+	mov	r13,r11
+	mov	r14,rdx
+	bswap	r12
+	ror	r13,23
+	mov	rdi,rax
+
+	xor	r13,r11
+	ror	r14,5
+	xor	rdi,rbx
+
+	mov	QWORD[40+rsp],r12
+	xor	r14,rdx
+	and	rdi,r11
+
+	ror	r13,4
+	add	r12,rcx
+	xor	rdi,rbx
+
+	ror	r14,6
+	xor	r13,r11
+	add	r12,rdi
+
+	mov	rdi,rdx
+	add	r12,QWORD[rbp]
+	xor	r14,rdx
+
+	xor	rdi,r8
+	ror	r13,14
+	mov	rcx,r8
+
+	and	r15,rdi
+	ror	r14,28
+	add	r12,r13
+
+	xor	rcx,r15
+	add	r10,r12
+	add	rcx,r12
+
+	lea	rbp,[24+rbp]
+	add	rcx,r14
+	mov	r12,QWORD[48+rsi]
+	mov	r13,r10
+	mov	r14,rcx
+	bswap	r12
+	ror	r13,23
+	mov	r15,r11
+
+	xor	r13,r10
+	ror	r14,5
+	xor	r15,rax
+
+	mov	QWORD[48+rsp],r12
+	xor	r14,rcx
+	and	r15,r10
+
+	ror	r13,4
+	add	r12,rbx
+	xor	r15,rax
+
+	ror	r14,6
+	xor	r13,r10
+	add	r12,r15
+
+	mov	r15,rcx
+	add	r12,QWORD[rbp]
+	xor	r14,rcx
+
+	xor	r15,rdx
+	ror	r13,14
+	mov	rbx,rdx
+
+	and	rdi,r15
+	ror	r14,28
+	add	r12,r13
+
+	xor	rbx,rdi
+	add	r9,r12
+	add	rbx,r12
+
+	lea	rbp,[8+rbp]
+	add	rbx,r14
+	mov	r12,QWORD[56+rsi]
+	mov	r13,r9
+	mov	r14,rbx
+	bswap	r12
+	ror	r13,23
+	mov	rdi,r10
+
+	xor	r13,r9
+	ror	r14,5
+	xor	rdi,r11
+
+	mov	QWORD[56+rsp],r12
+	xor	r14,rbx
+	and	rdi,r9
+
+	ror	r13,4
+	add	r12,rax
+	xor	rdi,r11
+
+	ror	r14,6
+	xor	r13,r9
+	add	r12,rdi
+
+	mov	rdi,rbx
+	add	r12,QWORD[rbp]
+	xor	r14,rbx
+
+	xor	rdi,rcx
+	ror	r13,14
+	mov	rax,rcx
+
+	and	r15,rdi
+	ror	r14,28
+	add	r12,r13
+
+	xor	rax,r15
+	add	r8,r12
+	add	rax,r12
+
+	lea	rbp,[24+rbp]
+	add	rax,r14
+	mov	r12,QWORD[64+rsi]
+	mov	r13,r8
+	mov	r14,rax
+	bswap	r12
+	ror	r13,23
+	mov	r15,r9
+
+	xor	r13,r8
+	ror	r14,5
+	xor	r15,r10
+
+	mov	QWORD[64+rsp],r12
+	xor	r14,rax
+	and	r15,r8
+
+	ror	r13,4
+	add	r12,r11
+	xor	r15,r10
+
+	ror	r14,6
+	xor	r13,r8
+	add	r12,r15
+
+	mov	r15,rax
+	add	r12,QWORD[rbp]
+	xor	r14,rax
+
+	xor	r15,rbx
+	ror	r13,14
+	mov	r11,rbx
+
+	and	rdi,r15
+	ror	r14,28
+	add	r12,r13
+
+	xor	r11,rdi
+	add	rdx,r12
+	add	r11,r12
+
+	lea	rbp,[8+rbp]
+	add	r11,r14
+	mov	r12,QWORD[72+rsi]
+	mov	r13,rdx
+	mov	r14,r11
+	bswap	r12
+	ror	r13,23
+	mov	rdi,r8
+
+	xor	r13,rdx
+	ror	r14,5
+	xor	rdi,r9
+
+	mov	QWORD[72+rsp],r12
+	xor	r14,r11
+	and	rdi,rdx
+
+	ror	r13,4
+	add	r12,r10
+	xor	rdi,r9
+
+	ror	r14,6
+	xor	r13,rdx
+	add	r12,rdi
+
+	mov	rdi,r11
+	add	r12,QWORD[rbp]
+	xor	r14,r11
+
+	xor	rdi,rax
+	ror	r13,14
+	mov	r10,rax
+
+	and	r15,rdi
+	ror	r14,28
+	add	r12,r13
+
+	xor	r10,r15
+	add	rcx,r12
+	add	r10,r12
+
+	lea	rbp,[24+rbp]
+	add	r10,r14
+	mov	r12,QWORD[80+rsi]
+	mov	r13,rcx
+	mov	r14,r10
+	bswap	r12
+	ror	r13,23
+	mov	r15,rdx
+
+	xor	r13,rcx
+	ror	r14,5
+	xor	r15,r8
+
+	mov	QWORD[80+rsp],r12
+	xor	r14,r10
+	and	r15,rcx
+
+	ror	r13,4
+	add	r12,r9
+	xor	r15,r8
+
+	ror	r14,6
+	xor	r13,rcx
+	add	r12,r15
+
+	mov	r15,r10
+	add	r12,QWORD[rbp]
+	xor	r14,r10
+
+	xor	r15,r11
+	ror	r13,14
+	mov	r9,r11
+
+	and	rdi,r15
+	ror	r14,28
+	add	r12,r13
+
+	xor	r9,rdi
+	add	rbx,r12
+	add	r9,r12
+
+	lea	rbp,[8+rbp]
+	add	r9,r14
+	mov	r12,QWORD[88+rsi]
+	mov	r13,rbx
+	mov	r14,r9
+	bswap	r12
+	ror	r13,23
+	mov	rdi,rcx
+
+	xor	r13,rbx
+	ror	r14,5
+	xor	rdi,rdx
+
+	mov	QWORD[88+rsp],r12
+	xor	r14,r9
+	and	rdi,rbx
+
+	ror	r13,4
+	add	r12,r8
+	xor	rdi,rdx
+
+	ror	r14,6
+	xor	r13,rbx
+	add	r12,rdi
+
+	mov	rdi,r9
+	add	r12,QWORD[rbp]
+	xor	r14,r9
+
+	xor	rdi,r10
+	ror	r13,14
+	mov	r8,r10
+
+	and	r15,rdi
+	ror	r14,28
+	add	r12,r13
+
+	xor	r8,r15
+	add	rax,r12
+	add	r8,r12
+
+	lea	rbp,[24+rbp]
+	add	r8,r14
+	mov	r12,QWORD[96+rsi]
+	mov	r13,rax
+	mov	r14,r8
+	bswap	r12
+	ror	r13,23
+	mov	r15,rbx
+
+	xor	r13,rax
+	ror	r14,5
+	xor	r15,rcx
+
+	mov	QWORD[96+rsp],r12
+	xor	r14,r8
+	and	r15,rax
+
+	ror	r13,4
+	add	r12,rdx
+	xor	r15,rcx
+
+	ror	r14,6
+	xor	r13,rax
+	add	r12,r15
+
+	mov	r15,r8
+	add	r12,QWORD[rbp]
+	xor	r14,r8
+
+	xor	r15,r9
+	ror	r13,14
+	mov	rdx,r9
+
+	and	rdi,r15
+	ror	r14,28
+	add	r12,r13
+
+	xor	rdx,rdi
+	add	r11,r12
+	add	rdx,r12
+
+	lea	rbp,[8+rbp]
+	add	rdx,r14
+	mov	r12,QWORD[104+rsi]
+	mov	r13,r11
+	mov	r14,rdx
+	bswap	r12
+	ror	r13,23
+	mov	rdi,rax
+
+	xor	r13,r11
+	ror	r14,5
+	xor	rdi,rbx
+
+	mov	QWORD[104+rsp],r12
+	xor	r14,rdx
+	and	rdi,r11
+
+	ror	r13,4
+	add	r12,rcx
+	xor	rdi,rbx
+
+	ror	r14,6
+	xor	r13,r11
+	add	r12,rdi
+
+	mov	rdi,rdx
+	add	r12,QWORD[rbp]
+	xor	r14,rdx
+
+	xor	rdi,r8
+	ror	r13,14
+	mov	rcx,r8
+
+	and	r15,rdi
+	ror	r14,28
+	add	r12,r13
+
+	xor	rcx,r15
+	add	r10,r12
+	add	rcx,r12
+
+	lea	rbp,[24+rbp]
+	add	rcx,r14
+	mov	r12,QWORD[112+rsi]
+	mov	r13,r10
+	mov	r14,rcx
+	bswap	r12
+	ror	r13,23
+	mov	r15,r11
+
+	xor	r13,r10
+	ror	r14,5
+	xor	r15,rax
+
+	mov	QWORD[112+rsp],r12
+	xor	r14,rcx
+	and	r15,r10
+
+	ror	r13,4
+	add	r12,rbx
+	xor	r15,rax
+
+	ror	r14,6
+	xor	r13,r10
+	add	r12,r15
+
+	mov	r15,rcx
+	add	r12,QWORD[rbp]
+	xor	r14,rcx
+
+	xor	r15,rdx
+	ror	r13,14
+	mov	rbx,rdx
+
+	and	rdi,r15
+	ror	r14,28
+	add	r12,r13
+
+	xor	rbx,rdi
+	add	r9,r12
+	add	rbx,r12
+
+	lea	rbp,[8+rbp]
+	add	rbx,r14
+	mov	r12,QWORD[120+rsi]
+	mov	r13,r9
+	mov	r14,rbx
+	bswap	r12
+	ror	r13,23
+	mov	rdi,r10
+
+	xor	r13,r9
+	ror	r14,5
+	xor	rdi,r11
+
+	mov	QWORD[120+rsp],r12
+	xor	r14,rbx
+	and	rdi,r9
+
+	ror	r13,4
+	add	r12,rax
+	xor	rdi,r11
+
+	ror	r14,6
+	xor	r13,r9
+	add	r12,rdi
+
+	mov	rdi,rbx
+	add	r12,QWORD[rbp]
+	xor	r14,rbx
+
+	xor	rdi,rcx
+	ror	r13,14
+	mov	rax,rcx
+
+	and	r15,rdi
+	ror	r14,28
+	add	r12,r13
+
+	xor	rax,r15
+	add	r8,r12
+	add	rax,r12
+
+	lea	rbp,[24+rbp]
+	jmp	NEAR $L$rounds_16_xx
+ALIGN	16
+$L$rounds_16_xx:
+	mov	r13,QWORD[8+rsp]
+	mov	r15,QWORD[112+rsp]
+
+	mov	r12,r13
+	ror	r13,7
+	add	rax,r14
+	mov	r14,r15
+	ror	r15,42
+
+	xor	r13,r12
+	shr	r12,7
+	ror	r13,1
+	xor	r15,r14
+	shr	r14,6
+
+	ror	r15,19
+	xor	r12,r13
+	xor	r15,r14
+	add	r12,QWORD[72+rsp]
+
+	add	r12,QWORD[rsp]
+	mov	r13,r8
+	add	r12,r15
+	mov	r14,rax
+	ror	r13,23
+	mov	r15,r9
+
+	xor	r13,r8
+	ror	r14,5
+	xor	r15,r10
+
+	mov	QWORD[rsp],r12
+	xor	r14,rax
+	and	r15,r8
+
+	ror	r13,4
+	add	r12,r11
+	xor	r15,r10
+
+	ror	r14,6
+	xor	r13,r8
+	add	r12,r15
+
+	mov	r15,rax
+	add	r12,QWORD[rbp]
+	xor	r14,rax
+
+	xor	r15,rbx
+	ror	r13,14
+	mov	r11,rbx
+
+	and	rdi,r15
+	ror	r14,28
+	add	r12,r13
+
+	xor	r11,rdi
+	add	rdx,r12
+	add	r11,r12
+
+	lea	rbp,[8+rbp]
+	mov	r13,QWORD[16+rsp]
+	mov	rdi,QWORD[120+rsp]
+
+	mov	r12,r13
+	ror	r13,7
+	add	r11,r14
+	mov	r14,rdi
+	ror	rdi,42
+
+	xor	r13,r12
+	shr	r12,7
+	ror	r13,1
+	xor	rdi,r14
+	shr	r14,6
+
+	ror	rdi,19
+	xor	r12,r13
+	xor	rdi,r14
+	add	r12,QWORD[80+rsp]
+
+	add	r12,QWORD[8+rsp]
+	mov	r13,rdx
+	add	r12,rdi
+	mov	r14,r11
+	ror	r13,23
+	mov	rdi,r8
+
+	xor	r13,rdx
+	ror	r14,5
+	xor	rdi,r9
+
+	mov	QWORD[8+rsp],r12
+	xor	r14,r11
+	and	rdi,rdx
+
+	ror	r13,4
+	add	r12,r10
+	xor	rdi,r9
+
+	ror	r14,6
+	xor	r13,rdx
+	add	r12,rdi
+
+	mov	rdi,r11
+	add	r12,QWORD[rbp]
+	xor	r14,r11
+
+	xor	rdi,rax
+	ror	r13,14
+	mov	r10,rax
+
+	and	r15,rdi
+	ror	r14,28
+	add	r12,r13
+
+	xor	r10,r15
+	add	rcx,r12
+	add	r10,r12
+
+	lea	rbp,[24+rbp]
+	mov	r13,QWORD[24+rsp]
+	mov	r15,QWORD[rsp]
+
+	mov	r12,r13
+	ror	r13,7
+	add	r10,r14
+	mov	r14,r15
+	ror	r15,42
+
+	xor	r13,r12
+	shr	r12,7
+	ror	r13,1
+	xor	r15,r14
+	shr	r14,6
+
+	ror	r15,19
+	xor	r12,r13
+	xor	r15,r14
+	add	r12,QWORD[88+rsp]
+
+	add	r12,QWORD[16+rsp]
+	mov	r13,rcx
+	add	r12,r15
+	mov	r14,r10
+	ror	r13,23
+	mov	r15,rdx
+
+	xor	r13,rcx
+	ror	r14,5
+	xor	r15,r8
+
+	mov	QWORD[16+rsp],r12
+	xor	r14,r10
+	and	r15,rcx
+
+	ror	r13,4
+	add	r12,r9
+	xor	r15,r8
+
+	ror	r14,6
+	xor	r13,rcx
+	add	r12,r15
+
+	mov	r15,r10
+	add	r12,QWORD[rbp]
+	xor	r14,r10
+
+	xor	r15,r11
+	ror	r13,14
+	mov	r9,r11
+
+	and	rdi,r15
+	ror	r14,28
+	add	r12,r13
+
+	xor	r9,rdi
+	add	rbx,r12
+	add	r9,r12
+
+	lea	rbp,[8+rbp]
+	mov	r13,QWORD[32+rsp]
+	mov	rdi,QWORD[8+rsp]
+
+	mov	r12,r13
+	ror	r13,7
+	add	r9,r14
+	mov	r14,rdi
+	ror	rdi,42
+
+	xor	r13,r12
+	shr	r12,7
+	ror	r13,1
+	xor	rdi,r14
+	shr	r14,6
+
+	ror	rdi,19
+	xor	r12,r13
+	xor	rdi,r14
+	add	r12,QWORD[96+rsp]
+
+	add	r12,QWORD[24+rsp]
+	mov	r13,rbx
+	add	r12,rdi
+	mov	r14,r9
+	ror	r13,23
+	mov	rdi,rcx
+
+	xor	r13,rbx
+	ror	r14,5
+	xor	rdi,rdx
+
+	mov	QWORD[24+rsp],r12
+	xor	r14,r9
+	and	rdi,rbx
+
+	ror	r13,4
+	add	r12,r8
+	xor	rdi,rdx
+
+	ror	r14,6
+	xor	r13,rbx
+	add	r12,rdi
+
+	mov	rdi,r9
+	add	r12,QWORD[rbp]
+	xor	r14,r9
+
+	xor	rdi,r10
+	ror	r13,14
+	mov	r8,r10
+
+	and	r15,rdi
+	ror	r14,28
+	add	r12,r13
+
+	xor	r8,r15
+	add	rax,r12
+	add	r8,r12
+
+	lea	rbp,[24+rbp]
+	mov	r13,QWORD[40+rsp]
+	mov	r15,QWORD[16+rsp]
+
+	mov	r12,r13
+	ror	r13,7
+	add	r8,r14
+	mov	r14,r15
+	ror	r15,42
+
+	xor	r13,r12
+	shr	r12,7
+	ror	r13,1
+	xor	r15,r14
+	shr	r14,6
+
+	ror	r15,19
+	xor	r12,r13
+	xor	r15,r14
+	add	r12,QWORD[104+rsp]
+
+	add	r12,QWORD[32+rsp]
+	mov	r13,rax
+	add	r12,r15
+	mov	r14,r8
+	ror	r13,23
+	mov	r15,rbx
+
+	xor	r13,rax
+	ror	r14,5
+	xor	r15,rcx
+
+	mov	QWORD[32+rsp],r12
+	xor	r14,r8
+	and	r15,rax
+
+	ror	r13,4
+	add	r12,rdx
+	xor	r15,rcx
+
+	ror	r14,6
+	xor	r13,rax
+	add	r12,r15
+
+	mov	r15,r8
+	add	r12,QWORD[rbp]
+	xor	r14,r8
+
+	xor	r15,r9
+	ror	r13,14
+	mov	rdx,r9
+
+	and	rdi,r15
+	ror	r14,28
+	add	r12,r13
+
+	xor	rdx,rdi
+	add	r11,r12
+	add	rdx,r12
+
+	lea	rbp,[8+rbp]
+	mov	r13,QWORD[48+rsp]
+	mov	rdi,QWORD[24+rsp]
+
+	mov	r12,r13
+	ror	r13,7
+	add	rdx,r14
+	mov	r14,rdi
+	ror	rdi,42
+
+	xor	r13,r12
+	shr	r12,7
+	ror	r13,1
+	xor	rdi,r14
+	shr	r14,6
+
+	ror	rdi,19
+	xor	r12,r13
+	xor	rdi,r14
+	add	r12,QWORD[112+rsp]
+
+	add	r12,QWORD[40+rsp]
+	mov	r13,r11
+	add	r12,rdi
+	mov	r14,rdx
+	ror	r13,23
+	mov	rdi,rax
+
+	xor	r13,r11
+	ror	r14,5
+	xor	rdi,rbx
+
+	mov	QWORD[40+rsp],r12
+	xor	r14,rdx
+	and	rdi,r11
+
+	ror	r13,4
+	add	r12,rcx
+	xor	rdi,rbx
+
+	ror	r14,6
+	xor	r13,r11
+	add	r12,rdi
+
+	mov	rdi,rdx
+	add	r12,QWORD[rbp]
+	xor	r14,rdx
+
+	xor	rdi,r8
+	ror	r13,14
+	mov	rcx,r8
+
+	and	r15,rdi
+	ror	r14,28
+	add	r12,r13
+
+	xor	rcx,r15
+	add	r10,r12
+	add	rcx,r12
+
+	lea	rbp,[24+rbp]
+	mov	r13,QWORD[56+rsp]
+	mov	r15,QWORD[32+rsp]
+
+	mov	r12,r13
+	ror	r13,7
+	add	rcx,r14
+	mov	r14,r15
+	ror	r15,42
+
+	xor	r13,r12
+	shr	r12,7
+	ror	r13,1
+	xor	r15,r14
+	shr	r14,6
+
+	ror	r15,19
+	xor	r12,r13
+	xor	r15,r14
+	add	r12,QWORD[120+rsp]
+
+	add	r12,QWORD[48+rsp]
+	mov	r13,r10
+	add	r12,r15
+	mov	r14,rcx
+	ror	r13,23
+	mov	r15,r11
+
+	xor	r13,r10
+	ror	r14,5
+	xor	r15,rax
+
+	mov	QWORD[48+rsp],r12
+	xor	r14,rcx
+	and	r15,r10
+
+	ror	r13,4
+	add	r12,rbx
+	xor	r15,rax
+
+	ror	r14,6
+	xor	r13,r10
+	add	r12,r15
+
+	mov	r15,rcx
+	add	r12,QWORD[rbp]
+	xor	r14,rcx
+
+	xor	r15,rdx
+	ror	r13,14
+	mov	rbx,rdx
+
+	and	rdi,r15
+	ror	r14,28
+	add	r12,r13
+
+	xor	rbx,rdi
+	add	r9,r12
+	add	rbx,r12
+
+	lea	rbp,[8+rbp]
+	mov	r13,QWORD[64+rsp]
+	mov	rdi,QWORD[40+rsp]
+
+	mov	r12,r13
+	ror	r13,7
+	add	rbx,r14
+	mov	r14,rdi
+	ror	rdi,42
+
+	xor	r13,r12
+	shr	r12,7
+	ror	r13,1
+	xor	rdi,r14
+	shr	r14,6
+
+	ror	rdi,19
+	xor	r12,r13
+	xor	rdi,r14
+	add	r12,QWORD[rsp]
+
+	add	r12,QWORD[56+rsp]
+	mov	r13,r9
+	add	r12,rdi
+	mov	r14,rbx
+	ror	r13,23
+	mov	rdi,r10
+
+	xor	r13,r9
+	ror	r14,5
+	xor	rdi,r11
+
+	mov	QWORD[56+rsp],r12
+	xor	r14,rbx
+	and	rdi,r9
+
+	ror	r13,4
+	add	r12,rax
+	xor	rdi,r11
+
+	ror	r14,6
+	xor	r13,r9
+	add	r12,rdi
+
+	mov	rdi,rbx
+	add	r12,QWORD[rbp]
+	xor	r14,rbx
+
+	xor	rdi,rcx
+	ror	r13,14
+	mov	rax,rcx
+
+	and	r15,rdi
+	ror	r14,28
+	add	r12,r13
+
+	xor	rax,r15
+	add	r8,r12
+	add	rax,r12
+
+	lea	rbp,[24+rbp]
+	mov	r13,QWORD[72+rsp]
+	mov	r15,QWORD[48+rsp]
+
+	mov	r12,r13
+	ror	r13,7
+	add	rax,r14
+	mov	r14,r15
+	ror	r15,42
+
+	xor	r13,r12
+	shr	r12,7
+	ror	r13,1
+	xor	r15,r14
+	shr	r14,6
+
+	ror	r15,19
+	xor	r12,r13
+	xor	r15,r14
+	add	r12,QWORD[8+rsp]
+
+	add	r12,QWORD[64+rsp]
+	mov	r13,r8
+	add	r12,r15
+	mov	r14,rax
+	ror	r13,23
+	mov	r15,r9
+
+	xor	r13,r8
+	ror	r14,5
+	xor	r15,r10
+
+	mov	QWORD[64+rsp],r12
+	xor	r14,rax
+	and	r15,r8
+
+	ror	r13,4
+	add	r12,r11
+	xor	r15,r10
+
+	ror	r14,6
+	xor	r13,r8
+	add	r12,r15
+
+	mov	r15,rax
+	add	r12,QWORD[rbp]
+	xor	r14,rax
+
+	xor	r15,rbx
+	ror	r13,14
+	mov	r11,rbx
+
+	and	rdi,r15
+	ror	r14,28
+	add	r12,r13
+
+	xor	r11,rdi
+	add	rdx,r12
+	add	r11,r12
+
+	lea	rbp,[8+rbp]
+	mov	r13,QWORD[80+rsp]
+	mov	rdi,QWORD[56+rsp]
+
+	mov	r12,r13
+	ror	r13,7
+	add	r11,r14
+	mov	r14,rdi
+	ror	rdi,42
+
+	xor	r13,r12
+	shr	r12,7
+	ror	r13,1
+	xor	rdi,r14
+	shr	r14,6
+
+	ror	rdi,19
+	xor	r12,r13
+	xor	rdi,r14
+	add	r12,QWORD[16+rsp]
+
+	add	r12,QWORD[72+rsp]
+	mov	r13,rdx
+	add	r12,rdi
+	mov	r14,r11
+	ror	r13,23
+	mov	rdi,r8
+
+	xor	r13,rdx
+	ror	r14,5
+	xor	rdi,r9
+
+	mov	QWORD[72+rsp],r12
+	xor	r14,r11
+	and	rdi,rdx
+
+	ror	r13,4
+	add	r12,r10
+	xor	rdi,r9
+
+	ror	r14,6
+	xor	r13,rdx
+	add	r12,rdi
+
+	mov	rdi,r11
+	add	r12,QWORD[rbp]
+	xor	r14,r11
+
+	xor	rdi,rax
+	ror	r13,14
+	mov	r10,rax
+
+	and	r15,rdi
+	ror	r14,28
+	add	r12,r13
+
+	xor	r10,r15
+	add	rcx,r12
+	add	r10,r12
+
+	lea	rbp,[24+rbp]
+	mov	r13,QWORD[88+rsp]
+	mov	r15,QWORD[64+rsp]
+
+	mov	r12,r13
+	ror	r13,7
+	add	r10,r14
+	mov	r14,r15
+	ror	r15,42
+
+	xor	r13,r12
+	shr	r12,7
+	ror	r13,1
+	xor	r15,r14
+	shr	r14,6
+
+	ror	r15,19
+	xor	r12,r13
+	xor	r15,r14
+	add	r12,QWORD[24+rsp]
+
+	add	r12,QWORD[80+rsp]
+	mov	r13,rcx
+	add	r12,r15
+	mov	r14,r10
+	ror	r13,23
+	mov	r15,rdx
+
+	xor	r13,rcx
+	ror	r14,5
+	xor	r15,r8
+
+	mov	QWORD[80+rsp],r12
+	xor	r14,r10
+	and	r15,rcx
+
+	ror	r13,4
+	add	r12,r9
+	xor	r15,r8
+
+	ror	r14,6
+	xor	r13,rcx
+	add	r12,r15
+
+	mov	r15,r10
+	add	r12,QWORD[rbp]
+	xor	r14,r10
+
+	xor	r15,r11
+	ror	r13,14
+	mov	r9,r11
+
+	and	rdi,r15
+	ror	r14,28
+	add	r12,r13
+
+	xor	r9,rdi
+	add	rbx,r12
+	add	r9,r12
+
+	lea	rbp,[8+rbp]
+	mov	r13,QWORD[96+rsp]
+	mov	rdi,QWORD[72+rsp]
+
+	mov	r12,r13
+	ror	r13,7
+	add	r9,r14
+	mov	r14,rdi
+	ror	rdi,42
+
+	xor	r13,r12
+	shr	r12,7
+	ror	r13,1
+	xor	rdi,r14
+	shr	r14,6
+
+	ror	rdi,19
+	xor	r12,r13
+	xor	rdi,r14
+	add	r12,QWORD[32+rsp]
+
+	add	r12,QWORD[88+rsp]
+	mov	r13,rbx
+	add	r12,rdi
+	mov	r14,r9
+	ror	r13,23
+	mov	rdi,rcx
+
+	xor	r13,rbx
+	ror	r14,5
+	xor	rdi,rdx
+
+	mov	QWORD[88+rsp],r12
+	xor	r14,r9
+	and	rdi,rbx
+
+	ror	r13,4
+	add	r12,r8
+	xor	rdi,rdx
+
+	ror	r14,6
+	xor	r13,rbx
+	add	r12,rdi
+
+	mov	rdi,r9
+	add	r12,QWORD[rbp]
+	xor	r14,r9
+
+	xor	rdi,r10
+	ror	r13,14
+	mov	r8,r10
+
+	and	r15,rdi
+	ror	r14,28
+	add	r12,r13
+
+	xor	r8,r15
+	add	rax,r12
+	add	r8,r12
+
+	lea	rbp,[24+rbp]
+	mov	r13,QWORD[104+rsp]
+	mov	r15,QWORD[80+rsp]
+
+	mov	r12,r13
+	ror	r13,7
+	add	r8,r14
+	mov	r14,r15
+	ror	r15,42
+
+	xor	r13,r12
+	shr	r12,7
+	ror	r13,1
+	xor	r15,r14
+	shr	r14,6
+
+	ror	r15,19
+	xor	r12,r13
+	xor	r15,r14
+	add	r12,QWORD[40+rsp]
+
+	add	r12,QWORD[96+rsp]
+	mov	r13,rax
+	add	r12,r15
+	mov	r14,r8
+	ror	r13,23
+	mov	r15,rbx
+
+	xor	r13,rax
+	ror	r14,5
+	xor	r15,rcx
+
+	mov	QWORD[96+rsp],r12
+	xor	r14,r8
+	and	r15,rax
+
+	ror	r13,4
+	add	r12,rdx
+	xor	r15,rcx
+
+	ror	r14,6
+	xor	r13,rax
+	add	r12,r15
+
+	mov	r15,r8
+	add	r12,QWORD[rbp]
+	xor	r14,r8
+
+	xor	r15,r9
+	ror	r13,14
+	mov	rdx,r9
+
+	and	rdi,r15
+	ror	r14,28
+	add	r12,r13
+
+	xor	rdx,rdi
+	add	r11,r12
+	add	rdx,r12
+
+	lea	rbp,[8+rbp]
+	mov	r13,QWORD[112+rsp]
+	mov	rdi,QWORD[88+rsp]
+
+	mov	r12,r13
+	ror	r13,7
+	add	rdx,r14
+	mov	r14,rdi
+	ror	rdi,42
+
+	xor	r13,r12
+	shr	r12,7
+	ror	r13,1
+	xor	rdi,r14
+	shr	r14,6
+
+	ror	rdi,19
+	xor	r12,r13
+	xor	rdi,r14
+	add	r12,QWORD[48+rsp]
+
+	add	r12,QWORD[104+rsp]
+	mov	r13,r11
+	add	r12,rdi
+	mov	r14,rdx
+	ror	r13,23
+	mov	rdi,rax
+
+	xor	r13,r11
+	ror	r14,5
+	xor	rdi,rbx
+
+	mov	QWORD[104+rsp],r12
+	xor	r14,rdx
+	and	rdi,r11
+
+	ror	r13,4
+	add	r12,rcx
+	xor	rdi,rbx
+
+	ror	r14,6
+	xor	r13,r11
+	add	r12,rdi
+
+	mov	rdi,rdx
+	add	r12,QWORD[rbp]
+	xor	r14,rdx
+
+	xor	rdi,r8
+	ror	r13,14
+	mov	rcx,r8
+
+	and	r15,rdi
+	ror	r14,28
+	add	r12,r13
+
+	xor	rcx,r15
+	add	r10,r12
+	add	rcx,r12
+
+	lea	rbp,[24+rbp]
+	mov	r13,QWORD[120+rsp]
+	mov	r15,QWORD[96+rsp]
+
+	mov	r12,r13
+	ror	r13,7
+	add	rcx,r14
+	mov	r14,r15
+	ror	r15,42
+
+	xor	r13,r12
+	shr	r12,7
+	ror	r13,1
+	xor	r15,r14
+	shr	r14,6
+
+	ror	r15,19
+	xor	r12,r13
+	xor	r15,r14
+	add	r12,QWORD[56+rsp]
+
+	add	r12,QWORD[112+rsp]
+	mov	r13,r10
+	add	r12,r15
+	mov	r14,rcx
+	ror	r13,23
+	mov	r15,r11
+
+	xor	r13,r10
+	ror	r14,5
+	xor	r15,rax
+
+	mov	QWORD[112+rsp],r12
+	xor	r14,rcx
+	and	r15,r10
+
+	ror	r13,4
+	add	r12,rbx
+	xor	r15,rax
+
+	ror	r14,6
+	xor	r13,r10
+	add	r12,r15
+
+	mov	r15,rcx
+	add	r12,QWORD[rbp]
+	xor	r14,rcx
+
+	xor	r15,rdx
+	ror	r13,14
+	mov	rbx,rdx
+
+	and	rdi,r15
+	ror	r14,28
+	add	r12,r13
+
+	xor	rbx,rdi
+	add	r9,r12
+	add	rbx,r12
+
+	lea	rbp,[8+rbp]
+	mov	r13,QWORD[rsp]
+	mov	rdi,QWORD[104+rsp]
+
+	mov	r12,r13
+	ror	r13,7
+	add	rbx,r14
+	mov	r14,rdi
+	ror	rdi,42
+
+	xor	r13,r12
+	shr	r12,7
+	ror	r13,1
+	xor	rdi,r14
+	shr	r14,6
+
+	ror	rdi,19
+	xor	r12,r13
+	xor	rdi,r14
+	add	r12,QWORD[64+rsp]
+
+	add	r12,QWORD[120+rsp]
+	mov	r13,r9
+	add	r12,rdi
+	mov	r14,rbx
+	ror	r13,23
+	mov	rdi,r10
+
+	xor	r13,r9
+	ror	r14,5
+	xor	rdi,r11
+
+	mov	QWORD[120+rsp],r12
+	xor	r14,rbx
+	and	rdi,r9
+
+	ror	r13,4
+	add	r12,rax
+	xor	rdi,r11
+
+	ror	r14,6
+	xor	r13,r9
+	add	r12,rdi
+
+	mov	rdi,rbx
+	add	r12,QWORD[rbp]
+	xor	r14,rbx
+
+	xor	rdi,rcx
+	ror	r13,14
+	mov	rax,rcx
+
+	and	r15,rdi
+	ror	r14,28
+	add	r12,r13
+
+	xor	rax,r15
+	add	r8,r12
+	add	rax,r12
+
+	lea	rbp,[24+rbp]
+	cmp	BYTE[7+rbp],0
+	jnz	NEAR $L$rounds_16_xx
+
+	mov	rdi,QWORD[((128+0))+rsp]
+	add	rax,r14
+	lea	rsi,[128+rsi]
+
+	add	rax,QWORD[rdi]
+	add	rbx,QWORD[8+rdi]
+	add	rcx,QWORD[16+rdi]
+	add	rdx,QWORD[24+rdi]
+	add	r8,QWORD[32+rdi]
+	add	r9,QWORD[40+rdi]
+	add	r10,QWORD[48+rdi]
+	add	r11,QWORD[56+rdi]
+
+	cmp	rsi,QWORD[((128+16))+rsp]
+
+	mov	QWORD[rdi],rax
+	mov	QWORD[8+rdi],rbx
+	mov	QWORD[16+rdi],rcx
+	mov	QWORD[24+rdi],rdx
+	mov	QWORD[32+rdi],r8
+	mov	QWORD[40+rdi],r9
+	mov	QWORD[48+rdi],r10
+	mov	QWORD[56+rdi],r11
+	jb	NEAR $L$loop
+
+	mov	rsi,QWORD[((128+24))+rsp]
+	mov	r15,QWORD[rsi]
+	mov	r14,QWORD[8+rsi]
+	mov	r13,QWORD[16+rsi]
+	mov	r12,QWORD[24+rsi]
+	mov	rbp,QWORD[32+rsi]
+	mov	rbx,QWORD[40+rsi]
+	lea	rsp,[48+rsi]
+$L$epilogue:
+	mov	rdi,QWORD[8+rsp]	;WIN64 epilogue
+	mov	rsi,QWORD[16+rsp]
+	DB	0F3h,0C3h		;repret
+$L$SEH_end_sha512_block_data_order:
+ALIGN	64
+
+K512:
+	DQ	0x428a2f98d728ae22,0x7137449123ef65cd
+	DQ	0x428a2f98d728ae22,0x7137449123ef65cd
+	DQ	0xb5c0fbcfec4d3b2f,0xe9b5dba58189dbbc
+	DQ	0xb5c0fbcfec4d3b2f,0xe9b5dba58189dbbc
+	DQ	0x3956c25bf348b538,0x59f111f1b605d019
+	DQ	0x3956c25bf348b538,0x59f111f1b605d019
+	DQ	0x923f82a4af194f9b,0xab1c5ed5da6d8118
+	DQ	0x923f82a4af194f9b,0xab1c5ed5da6d8118
+	DQ	0xd807aa98a3030242,0x12835b0145706fbe
+	DQ	0xd807aa98a3030242,0x12835b0145706fbe
+	DQ	0x243185be4ee4b28c,0x550c7dc3d5ffb4e2
+	DQ	0x243185be4ee4b28c,0x550c7dc3d5ffb4e2
+	DQ	0x72be5d74f27b896f,0x80deb1fe3b1696b1
+	DQ	0x72be5d74f27b896f,0x80deb1fe3b1696b1
+	DQ	0x9bdc06a725c71235,0xc19bf174cf692694
+	DQ	0x9bdc06a725c71235,0xc19bf174cf692694
+	DQ	0xe49b69c19ef14ad2,0xefbe4786384f25e3
+	DQ	0xe49b69c19ef14ad2,0xefbe4786384f25e3
+	DQ	0x0fc19dc68b8cd5b5,0x240ca1cc77ac9c65
+	DQ	0x0fc19dc68b8cd5b5,0x240ca1cc77ac9c65
+	DQ	0x2de92c6f592b0275,0x4a7484aa6ea6e483
+	DQ	0x2de92c6f592b0275,0x4a7484aa6ea6e483
+	DQ	0x5cb0a9dcbd41fbd4,0x76f988da831153b5
+	DQ	0x5cb0a9dcbd41fbd4,0x76f988da831153b5
+	DQ	0x983e5152ee66dfab,0xa831c66d2db43210
+	DQ	0x983e5152ee66dfab,0xa831c66d2db43210
+	DQ	0xb00327c898fb213f,0xbf597fc7beef0ee4
+	DQ	0xb00327c898fb213f,0xbf597fc7beef0ee4
+	DQ	0xc6e00bf33da88fc2,0xd5a79147930aa725
+	DQ	0xc6e00bf33da88fc2,0xd5a79147930aa725
+	DQ	0x06ca6351e003826f,0x142929670a0e6e70
+	DQ	0x06ca6351e003826f,0x142929670a0e6e70
+	DQ	0x27b70a8546d22ffc,0x2e1b21385c26c926
+	DQ	0x27b70a8546d22ffc,0x2e1b21385c26c926
+	DQ	0x4d2c6dfc5ac42aed,0x53380d139d95b3df
+	DQ	0x4d2c6dfc5ac42aed,0x53380d139d95b3df
+	DQ	0x650a73548baf63de,0x766a0abb3c77b2a8
+	DQ	0x650a73548baf63de,0x766a0abb3c77b2a8
+	DQ	0x81c2c92e47edaee6,0x92722c851482353b
+	DQ	0x81c2c92e47edaee6,0x92722c851482353b
+	DQ	0xa2bfe8a14cf10364,0xa81a664bbc423001
+	DQ	0xa2bfe8a14cf10364,0xa81a664bbc423001
+	DQ	0xc24b8b70d0f89791,0xc76c51a30654be30
+	DQ	0xc24b8b70d0f89791,0xc76c51a30654be30
+	DQ	0xd192e819d6ef5218,0xd69906245565a910
+	DQ	0xd192e819d6ef5218,0xd69906245565a910
+	DQ	0xf40e35855771202a,0x106aa07032bbd1b8
+	DQ	0xf40e35855771202a,0x106aa07032bbd1b8
+	DQ	0x19a4c116b8d2d0c8,0x1e376c085141ab53
+	DQ	0x19a4c116b8d2d0c8,0x1e376c085141ab53
+	DQ	0x2748774cdf8eeb99,0x34b0bcb5e19b48a8
+	DQ	0x2748774cdf8eeb99,0x34b0bcb5e19b48a8
+	DQ	0x391c0cb3c5c95a63,0x4ed8aa4ae3418acb
+	DQ	0x391c0cb3c5c95a63,0x4ed8aa4ae3418acb
+	DQ	0x5b9cca4f7763e373,0x682e6ff3d6b2b8a3
+	DQ	0x5b9cca4f7763e373,0x682e6ff3d6b2b8a3
+	DQ	0x748f82ee5defb2fc,0x78a5636f43172f60
+	DQ	0x748f82ee5defb2fc,0x78a5636f43172f60
+	DQ	0x84c87814a1f0ab72,0x8cc702081a6439ec
+	DQ	0x84c87814a1f0ab72,0x8cc702081a6439ec
+	DQ	0x90befffa23631e28,0xa4506cebde82bde9
+	DQ	0x90befffa23631e28,0xa4506cebde82bde9
+	DQ	0xbef9a3f7b2c67915,0xc67178f2e372532b
+	DQ	0xbef9a3f7b2c67915,0xc67178f2e372532b
+	DQ	0xca273eceea26619c,0xd186b8c721c0c207
+	DQ	0xca273eceea26619c,0xd186b8c721c0c207
+	DQ	0xeada7dd6cde0eb1e,0xf57d4f7fee6ed178
+	DQ	0xeada7dd6cde0eb1e,0xf57d4f7fee6ed178
+	DQ	0x06f067aa72176fba,0x0a637dc5a2c898a6
+	DQ	0x06f067aa72176fba,0x0a637dc5a2c898a6
+	DQ	0x113f9804bef90dae,0x1b710b35131c471b
+	DQ	0x113f9804bef90dae,0x1b710b35131c471b
+	DQ	0x28db77f523047d84,0x32caab7b40c72493
+	DQ	0x28db77f523047d84,0x32caab7b40c72493
+	DQ	0x3c9ebe0a15c9bebc,0x431d67c49c100d4c
+	DQ	0x3c9ebe0a15c9bebc,0x431d67c49c100d4c
+	DQ	0x4cc5d4becb3e42b6,0x597f299cfc657e2a
+	DQ	0x4cc5d4becb3e42b6,0x597f299cfc657e2a
+	DQ	0x5fcb6fab3ad6faec,0x6c44198c4a475817
+	DQ	0x5fcb6fab3ad6faec,0x6c44198c4a475817
+
+	DQ	0x0001020304050607,0x08090a0b0c0d0e0f
+	DQ	0x0001020304050607,0x08090a0b0c0d0e0f
+DB	83,72,65,53,49,50,32,98,108,111,99,107,32,116,114,97
+DB	110,115,102,111,114,109,32,102,111,114,32,120,56,54,95,54
+DB	52,44,32,67,82,89,80,84,79,71,65,77,83,32,98,121
+DB	32,60,97,112,112,114,111,64,111,112,101,110,115,115,108,46
+DB	111,114,103,62,0
+EXTERN	__imp_RtlVirtualUnwind
+
+ALIGN	16
+se_handler:
+	push	rsi
+	push	rdi
+	push	rbx
+	push	rbp
+	push	r12
+	push	r13
+	push	r14
+	push	r15
+	pushfq
+	sub	rsp,64
+
+	mov	rax,QWORD[120+r8]
+	mov	rbx,QWORD[248+r8]
+
+	mov	rsi,QWORD[8+r9]
+	mov	r11,QWORD[56+r9]
+
+	mov	r10d,DWORD[r11]
+	lea	r10,[r10*1+rsi]
+	cmp	rbx,r10
+	jb	NEAR $L$in_prologue
+
+	mov	rax,QWORD[152+r8]
+
+	mov	r10d,DWORD[4+r11]
+	lea	r10,[r10*1+rsi]
+	cmp	rbx,r10
+	jae	NEAR $L$in_prologue
+	mov	rsi,rax
+	mov	rax,QWORD[((128+24))+rax]
+	lea	rax,[48+rax]
+
+	mov	rbx,QWORD[((-8))+rax]
+	mov	rbp,QWORD[((-16))+rax]
+	mov	r12,QWORD[((-24))+rax]
+	mov	r13,QWORD[((-32))+rax]
+	mov	r14,QWORD[((-40))+rax]
+	mov	r15,QWORD[((-48))+rax]
+	mov	QWORD[144+r8],rbx
+	mov	QWORD[160+r8],rbp
+	mov	QWORD[216+r8],r12
+	mov	QWORD[224+r8],r13
+	mov	QWORD[232+r8],r14
+	mov	QWORD[240+r8],r15
+
+	lea	r10,[$L$epilogue]
+	cmp	rbx,r10
+	jb	NEAR $L$in_prologue
+
+	lea	rsi,[((128+32))+rsi]
+	lea	rdi,[512+r8]
+	mov	ecx,12
+	DD	0xa548f3fc
+
+$L$in_prologue:
+	mov	rdi,QWORD[8+rax]
+	mov	rsi,QWORD[16+rax]
+	mov	QWORD[152+r8],rax
+	mov	QWORD[168+r8],rsi
+	mov	QWORD[176+r8],rdi
+
+	mov	rdi,QWORD[40+r9]
+	mov	rsi,r8
+	mov	ecx,154
+	DD	0xa548f3fc
+
+	mov	rsi,r9
+	xor	rcx,rcx
+	mov	rdx,QWORD[8+rsi]
+	mov	r8,QWORD[rsi]
+	mov	r9,QWORD[16+rsi]
+	mov	r10,QWORD[40+rsi]
+	lea	r11,[56+rsi]
+	lea	r12,[24+rsi]
+	mov	QWORD[32+rsp],r10
+	mov	QWORD[40+rsp],r11
+	mov	QWORD[48+rsp],r12
+	mov	QWORD[56+rsp],rcx
+	call	QWORD[__imp_RtlVirtualUnwind]
+
+	mov	eax,1
+	add	rsp,64
+	popfq
+	pop	r15
+	pop	r14
+	pop	r13
+	pop	r12
+	pop	rbp
+	pop	rbx
+	pop	rdi
+	pop	rsi
+	DB	0F3h,0C3h		;repret
+
+section	.pdata rdata align=4
+ALIGN	4
+	DD	$L$SEH_begin_sha512_block_data_order wrt ..imagebase
+	DD	$L$SEH_end_sha512_block_data_order wrt ..imagebase
+	DD	$L$SEH_info_sha512_block_data_order wrt ..imagebase
+section	.xdata rdata align=8
+ALIGN	8
+$L$SEH_info_sha512_block_data_order:
+DB	9,0,0,0
+	DD	se_handler wrt ..imagebase
+	DD	$L$prologue wrt ..imagebase,$L$epilogue wrt ..imagebase
diff --git a/tools/VERSION b/tools/VERSION
index 9256f87..b920ee5 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -25,7 +25,7 @@
 #
 CHANNEL stable
 MAJOR 1
-MINOR 12
-PATCH 2
+MINOR 13
+PATCH 0
 PRERELEASE 0
 PRERELEASE_PATCH 0
diff --git a/tools/apps/update_homebrew/bin/update_homebrew.dart b/tools/apps/update_homebrew/bin/update_homebrew.dart
index d87631a..50474c93 100644
--- a/tools/apps/update_homebrew/bin/update_homebrew.dart
+++ b/tools/apps/update_homebrew/bin/update_homebrew.dart
@@ -107,74 +107,11 @@
 
   var stableVersion = await getVersion('stable', revisions['stable']);
 
-  await new File('$repository/dartium.rb').writeAsString(
-      createDartiumFormula(revisions, hashes, devVersion, stableVersion),
-      flush: true);
   await new File('$repository/dart.rb').writeAsString(
       createDartFormula(revisions, hashes, devVersion, stableVersion),
       flush: true);
 }
 
-String createDartiumFormula(
-    Map revisions, Map hashes, String devVersion, String stableVersion) => '''
-require 'formula'
-
-class Dartium < Formula
-  homepage "https://www.dartlang.org"
-
-  version '$stableVersion'
-  url '$urlBase/stable/release/${revisions['stable']}/$dartiumFile'
-  sha256 '${hashes['stable'][dartiumFile]}'
-
-  devel do
-    version '$devVersion'
-    url '$urlBase/dev/release/${revisions['dev']}/$dartiumFile'
-    sha256 '${hashes['dev'][dartiumFile]}'
-
-    resource 'content_shell' do
-      url '$urlBase/dev/release/${revisions['dev']}/$contentShellFile'
-      sha256 '${hashes['dev'][contentShellFile]}'
-    end
-  end
-
-  resource 'content_shell' do
-    url '$urlBase/stable/release/${revisions['stable']}/$contentShellFile'
-    sha256 '${hashes['stable'][contentShellFile]}'
-  end
-
-  def shim_script target
-    <<-EOS.undent
-      #!/bin/bash
-      exec "#{prefix}/#{target}" "\$@"
-    EOS
-  end
-
-  def install
-    dartium_binary = 'Chromium.app/Contents/MacOS/Chromium'
-    prefix.install Dir['*']
-    (bin+"dartium").write shim_script dartium_binary
-
-    content_shell_binary = 'Content Shell.app/Contents/MacOS/Content Shell'
-    prefix.install resource('content_shell')
-    (bin+"content_shell").write shim_script content_shell_binary
-  end
-
-  def caveats; <<-EOS.undent
-    DEPRECATED
-      In the future, use the `dart` formula using
-      `--with-dartium` and/or `--with-content-shell`
-
-    To use with IntelliJ, set the Dartium execute home to:
-        #{prefix}/Chromium.app
-    EOS
-  end
-
-  test do
-    system "#{bin}/dartium"
-  end
-end
-''';
-
 String createDartFormula(
     Map revisions, Map hashes, String devVersion, String stableVersion) => '''
 require 'formula'
@@ -232,7 +169,7 @@
   def install
     libexec.install Dir['*']
     bin.install_symlink "#{libexec}/bin/dart"
-    bin.write_exec_script Dir["#{libexec}/bin/{pub,docgen,dart?*}"]
+    bin.write_exec_script Dir["#{libexec}/bin/{pub,dart?*}"]
 
     if build.with? 'dartium'
       dartium_binary = 'Chromium.app/Contents/MacOS/Chromium'
diff --git a/tools/bots/bot_utils.py b/tools/bots/bot_utils.py
index 8262462..da166aa 100644
--- a/tools/bots/bot_utils.py
+++ b/tools/bots/bot_utils.py
@@ -71,7 +71,7 @@
 
   Under every base path, the following structure is used:
     - /VERSION
-    - /api-docs/dart-api-docs.zip
+    - /api-docs/{dart-api-docs.zip,dartdocs-gen-api.zip}
     - /dartium/{chromedriver,content_shell,dartium}
          -{linux,macos,windows}-{ia32,x64}-release.zip
     - /sdk/dartsdk-{linux,macos,windows}-{ia32,x64}-release.zip
@@ -119,10 +119,6 @@
     return '/'.join([self.dartium_directory(revision),
       self.dartium_variant_zipfilename(name, system, arch, mode)])
 
-  def apidocs_zipfilepath(self, revision):
-    return '/'.join([self.apidocs_directory(revision),
-      self.apidocs_zipfilename()])
-
   def dartium_android_apk_filepath(self, revision, name, arch, mode):
     return '/'.join([self.dartium_android_directory(revision),
       self.dartium_android_apk_filename(name, arch, mode)])
@@ -263,25 +259,12 @@
   def execute(self, gsutil_args):
     self._layzCalculateGSUtilPath()
 
-    env = dict(os.environ)
-    # If we're on the buildbot, we use a specific boto file.
-    user_name = os.environ.get(
-        'USERNAME' if sys.platform == 'win32' else 'USER', '')
-    if user_name == 'chrome-bot':
-      boto_config = {
-        'Linux': '/mnt/data/b/build/site_config/.boto',
-        'Darwin': '/Volumes/data/b/build/site_config/.boto',
-        'Windows': r'e:\b\build\site_config\.boto',
-      }[platform.system()]
-      env['AWS_CREDENTIAL_FILE'] = boto_config
-      env['BOTO_CONFIG'] = boto_config
-
     if GSUtil.GSUTIL_IS_SHELL_SCRIPT:
       gsutil_command = [GSUtil.GSUTIL_PATH]
     else:
       gsutil_command = [sys.executable, GSUtil.GSUTIL_PATH]
 
-    return run(gsutil_command + gsutil_args, env=env,
+    return run(gsutil_command + gsutil_args,
                shell=(GSUtil.GSUTIL_IS_SHELL_SCRIPT and
                       sys.platform == 'win32'))
 
diff --git a/tools/bots/cross-vm.py b/tools/bots/cross-vm.py
index 1296fe9..9fd751f 100644
--- a/tools/bots/cross-vm.py
+++ b/tools/bots/cross-vm.py
@@ -51,8 +51,7 @@
 
       with bot.BuildStep('Upload build tarball'):
         uri = "%s/%s" % (GCS_BUCKET, tarball)
-        run([GSUTIL, 'cp', tarball, uri])
-        run([GSUTIL, 'setacl', 'public-read', uri])
+        run([GSUTIL, 'cp', '-a', 'public-read', tarball, uri])
 
     elif num_run == 2:
       with bot.BuildStep('tests'):
diff --git a/tools/bots/dart_sdk.py b/tools/bots/dart_sdk.py
index 40244cb..decf876 100644
--- a/tools/bots/dart_sdk.py
+++ b/tools/bots/dart_sdk.py
@@ -24,13 +24,6 @@
     Run([sys.executable, './tools/build.py', '--mode=release',
          '--arch=ia32,x64', 'create_sdk'])
 
-def BuildAPIDocs():
-  with bot.BuildStep('Build API docs'):
-    Run([sys.executable, './tools/build.py', '--mode=release',
-         '--arch=ia32', 'api_docs'])
-    Run([sys.executable, './tools/build.py', '--mode=release',
-         '--arch=ia32', 'dartdocgen'])
-
 def BuildDartdocAPIDocs(dirname):
   dart_sdk = os.path.join(bot_utils.DART_DIR,
                           utils.GetBuildRoot(BUILD_OS, 'release', 'ia32'),
@@ -44,10 +37,12 @@
                               'packages')
   footer_file = os.path.join(bot_utils.DART_DIR,
                               'tools', 'bots', 'dartdoc_footer.html')
+  url = 'https://api.dartlang.org/stable'
   with bot.BuildStep('Build API docs by dartdoc'):
     subprocess.call([dart_exe, '--package-root=' + packages_dir, dartdoc_dart, 
                     '--sdk-docs','--output', dirname, '--dart-sdk', dart_sdk, 
-                    '--footer' , footer_file, '--package-root=%s' % packages_dir], 
+                    '--footer' , footer_file,
+                    '--rel-canonical-prefix=' + url], 
                      stdout=open(os.devnull, 'wb'))
 
 def CreateUploadVersionFile():
@@ -100,57 +95,18 @@
   CreateUploadSDKZips()
 
 def CreateUploadAPIDocs():
-  api_path = os.path.join(bot_utils.DART_DIR,
-                          utils.GetBuildRoot(BUILD_OS, 'release', 'ia32'),
-                          'api_docs')
-  api_zip = os.path.join(bot_utils.DART_DIR,
-                         utils.GetBuildRoot(BUILD_OS, 'release', 'ia32'),
-                         'dart-api-docs.zip')
   dartdoc_dir =  os.path.join(bot_utils.DART_DIR,
                               utils.GetBuildRoot(BUILD_OS, 'release', 'ia32'),
                               'gen-dartdocs')
   dartdoc_zip =  os.path.join(bot_utils.DART_DIR,
                               utils.GetBuildRoot(BUILD_OS, 'release', 'ia32'),
                               'dartdocs-api.zip')
-  shutil.rmtree(api_path, ignore_errors=True)
-  FileDelete(api_zip)
-  BuildAPIDocs()
-  UploadApiDocs(api_path)
   UploadApiLatestFile()
-  CreateZip(api_path, api_zip)
-  DartArchiveUploadAPIDocs(api_zip)
   BuildDartdocAPIDocs(dartdoc_dir) 
   UploadDartdocApiDocs(dartdoc_dir)  
   CreateZip(dartdoc_dir, dartdoc_zip)  
   DartArchiveUploadDartdocAPIDocs(dartdoc_zip)
 
-def DartArchiveUploadAPIDocs(api_zip):
-  namer = bot_utils.GCSNamer(CHANNEL, bot_utils.ReleaseType.RAW)
-  revision = utils.GetArchiveVersion()
-  for revision in [revision, 'latest']:
-    destination = (namer.apidocs_directory(revision) + '/' +
-        namer.apidocs_zipfilename())
-    DartArchiveFile(api_zip, destination, checksum_files=False)
-
-def UploadApiDocs(dir_name):
-  apidocs_namer = bot_utils.GCSNamerApiDocs(CHANNEL)
-  revision = utils.GetArchiveVersion()
-  apidocs_destination_gcsdir = apidocs_namer.docs_dirpath(revision)
-  apidocs_destination_latestfile = apidocs_namer.docs_latestpath(revision)
-
-  # Return early if the documents have already been uploaded.
-  # (This can happen if a build was forced, or a commit had no changes in the
-  # dart repository (e.g. DEPS file update).)
-  if GsutilExists(apidocs_destination_gcsdir):
-    print ("Not uploading api docs, since %s is already present."
-           % apidocs_destination_gcsdir)
-    return
-
-  # Upload everything inside the built apidocs directory.
-  gsutil = bot_utils.GSUtil()
-  gsutil.upload(dir_name, apidocs_destination_gcsdir, recursive=True,
-                public=True)
-
 def DartArchiveUploadDartdocAPIDocs(api_zip):
   namer = bot_utils.GCSNamer(CHANNEL, bot_utils.ReleaseType.RAW)
   revision = utils.GetArchiveVersion()
diff --git a/tools/build.py b/tools/build.py
index fc2e1cf..0c5e235 100755
--- a/tools/build.py
+++ b/tools/build.py
@@ -77,11 +77,6 @@
       help='Name of the devenv.com/msbuild executable on Windows (varies for '
            'different versions of Visual Studio)',
       default=vs_executable)
-  result.add_option("--use-bootstrap-for-observatory",
-      help='Use a stripped down Dart binary built on the host machine '
-           'for building Observatory. Necessary on Linux machines which have '
-           'libc incompatibilities with the prebuilt Dart binaries.',
-      default=False, action="store_true")
   return result
 
 
@@ -391,8 +386,6 @@
   global filter_xcodebuild_output
   start_time = time.time()
   os.environ['DART_BUILD_MODE'] = mode
-  if options.use_bootstrap_for_observatory != False:
-    os.environ['DART_USE_BOOTSTRAP_BIN'] = '1'
   build_config = utils.GetBuildConf(mode, arch, target_os)
   if HOST_OS == 'macos':
     filter_xcodebuild_output = True
diff --git a/tools/create_sdk.py b/tools/create_sdk.py
index b4e2135..f377798 100755
--- a/tools/create_sdk.py
+++ b/tools/create_sdk.py
@@ -120,8 +120,8 @@
 
 
 def CopyDartScripts(home, sdk_root):
-  for executable in ['dart2js_sdk', 'dartanalyzer_sdk', 'dartfmt_sdk', 'docgen',
-                     'dartdocgen', 'pub_sdk', 'dartdoc']:
+  for executable in ['dart2js_sdk', 'dartanalyzer_sdk', 'dartfmt_sdk',
+                     'pub_sdk', 'dartdoc']:
     CopyShellScript(os.path.join(home, 'sdk', 'bin', executable),
                     os.path.join(sdk_root, 'bin'))
 
@@ -289,6 +289,7 @@
       f.close()
 
   Copy(join(HOME, 'README.dart-sdk'), join(SDK_tmp, 'README'))
+  Copy(join(HOME, 'LICENSE'), join(SDK_tmp, 'LICENSE'))
   Copy(join(HOME, 'sdk', 'api_readme.md'), join(SDK_tmp, 'lib', 'api_readme.md'))
 
   move(SDK_tmp, SDK)
diff --git a/tools/create_tarball.py b/tools/create_tarball.py
index f51e4bb..462bd9d 100755
--- a/tools/create_tarball.py
+++ b/tools/create_tarball.py
@@ -41,6 +41,7 @@
 
 # Ignore Git/SVN files, checked-in binaries, backup files, etc..
 ignoredPaths = ['tools/testing/bin',
+                'tools/sdks',
                 'third_party/7zip', 'third_party/android_tools',
                 'third_party/clang', 'third_party/d8',
                 'third_party/firefox_jsshell']
diff --git a/tools/dart2js/angular2_testing_deps/CURRENT_ANGULAR_DEPS b/tools/dart2js/angular2_testing_deps/CURRENT_ANGULAR_DEPS
index 8886d26..2e2224a 100644
--- a/tools/dart2js/angular2_testing_deps/CURRENT_ANGULAR_DEPS
+++ b/tools/dart2js/angular2_testing_deps/CURRENT_ANGULAR_DEPS
@@ -1 +1 @@
-0c282e826a3e35e6b6aa2dd430f899d159eaf458
+da6def3772e22665c381306fd5f8be30a60c2058
diff --git a/tools/dartium/update_deps.py b/tools/dartium/update_deps.py
index 128a82e..a8b1b4b 100755
--- a/tools/dartium/update_deps.py
+++ b/tools/dartium/update_deps.py
@@ -46,31 +46,24 @@
 
 TARGETS = {
   'dartium': (
-    'https://dart.googlecode.com/svn/branches/bleeding_edge/deps/dartium.deps',
+    'git@github.com:dart-lang/sdk.git',
+    'tools/deps/dartium.deps',
+    'origin/master',
     'dartium',
     # TODO(vsm): Reenable 'chromium'
     ['webkit'],
     BRANCH_CURRENT,
     ),
   'integration': (
+    # TODO(jacobr): what is the git repo for integration if any?
     'https://dart.googlecode.com/svn/branches/dartium_integration/deps/dartium.deps',
+    'tools/deps/dartium.deps',
+    'origin/master',
     'dartium',
     # TODO(vsm): Reenable 'chromium'
     ['webkit'],
     BRANCH_NEXT,
     ),
-  'clank': (
-    'https://dart.googlecode.com/svn/branches/bleeding_edge/deps/clank.deps',
-    'dartium',
-    ['webkit', 'chromium'],
-    BRANCH_CURRENT,
-    ),
-  'multivm': (
-    'https://dart.googlecode.com/svn/branches/bleeding_edge/deps/multivm.deps',
-    'multivm',
-    ['blink'],
-    BRANCH_MULTIVM,
-    ),
 }
 
 # Each element in this map represents a repository to update.  Entries
@@ -187,7 +180,7 @@
 
 def main():
   option_parser = optparse.OptionParser()
-  option_parser.add_option('', '--target', help="Update one of [dartium|integration|multivm|clank]", action="store", dest="target", default="dartium")
+  option_parser.add_option('', '--target', help="Update one of [dartium|integration]", action="store", dest="target", default="dartium")
   option_parser.add_option('', '--force', help="Push DEPS update to server without prompting", action="store_true", dest="force")
   options, args = option_parser.parse_args()
 
@@ -195,19 +188,23 @@
   if not target in TARGETS.keys():
     print "Error: invalid target"
     print "Choose one of " + str(TARGETS)
-  (deps_dir, prefix, repos, branch) = TARGETS[target]
+  (repo_name, deps_dir, repo_branch, prefix, repos, branch) = TARGETS[target]
   deps_file = deps_dir + '/DEPS'
+  repo_branch_parts = repo_branch.split('/')
 
   src_dir = "/usr/local/google/home/%s/dartium_deps_updater/deps/%s" % (os.environ["USER"], target)
   os.putenv("GIT_PAGER", "")
 
   if not os.path.exists(src_dir):
-    print run_cmd(['svn', 'co', deps_dir, src_dir])
+    print run_cmd(['git', 'clone', repo_name, src_dir])
 
   os.chdir(src_dir)
+  deps = run_cmd(['git', 'fetch'])
+  deps = run_cmd(['git', 'stash'])
+  deps = run_cmd(['git', 'checkout', '-B', repo_branch_parts[1], repo_branch])
 
   # parse DEPS
-  deps = run_cmd(['svn', 'cat', deps_file])
+  deps = run_cmd(['cat', deps_file])
   rev_num = {}
   for repo in repos:
     revision = '%s_%s_revision":\s*"(.+)"' % (prefix, repo)
@@ -241,19 +238,20 @@
 
   # make the next DEPS update
   os.chdir(src_dir)
-  run_cmd(['rm', 'DEPS'])
-  print run_cmd(['svn', 'update'])
+  run_cmd(['rm', deps_file])
   s = pending_updates[0]
 
   pattern = re.compile(prefix + '_' + s['repo'] + '_revision":\s*"(.+)"')
   new_deps = pattern.sub(prefix + '_' + s['repo'] + '_revision": "' + s['rev'] + '"', deps)
-  write_file('DEPS', new_deps)
+  write_file(deps_file, new_deps)
 
   commit_log = 'DEPS AutoUpdate: %s to %s (%s) %s\n' % (s['repo'], s['rev'], s['isotime'], s['author'])
   commit_log += s['info'] + '\n' + commit_url(s['repo'], s['rev'])
 
   write_file('commit_log.txt', commit_log)
-  print run_cmd(['svn', 'diff'])
+  run_cmd(['git', 'add', deps_file])
+
+  print run_cmd(['git', 'diff', 'HEAD'])
   print
   print "Commit log:"
   print "---------------------------------------------"
@@ -263,7 +261,8 @@
   if not options.force:
     print "Ready to push; press Enter to continue or Control-C to abort..."
     sys.stdin.readline()
-  print run_cmd(['svn', 'commit', '--file', 'commit_log.txt'])
+  print run_cmd(['git', 'commit', '-F', 'commit_log.txt'])
+  print run_cmd(['git', 'push', repo_branch_parts[0], repo_branch_parts[1]])
   print "Done."
 
 
diff --git a/tools/dartium/upload_steps.py b/tools/dartium/upload_steps.py
index 8665f84..2ab3fc8 100755
--- a/tools/dartium/upload_steps.py
+++ b/tools/dartium/upload_steps.py
@@ -192,7 +192,7 @@
 
   # Set ACL.
   if ACL is not None:
-    cmd = [GSUTIL, 'setacl', ACL, target]
+    cmd = [GSUTIL, 'acl', 'set', ACL, target]
     (status, output) = ExecuteCommand(cmd)
   return status
 
diff --git a/tools/deps/dartium.deps/DEPS b/tools/deps/dartium.deps/DEPS
index 44cfb744..3ec5f48 100644
--- a/tools/deps/dartium.deps/DEPS
+++ b/tools/deps/dartium.deps/DEPS
@@ -1,3 +1,4 @@
+
 import gclient_utils
 import os
 
@@ -12,8 +13,22 @@
   "dartium_chromium_branch": "master",
   "dartium_chromium_commit": "62a7524d4f71c9e0858d24b0aa1bbff3a2d09bff",
   "chromium_base_revision": "297060",
-  "dartium_webkit_branch": "/blink/branches/dart/2171_3/dartium",
-  "dartium_webkit_revision": "199763",
+  "dartium_webkit_branch": "/blink/branches/dart/2171_4",
+  "dartium_webkit_revision": "202698",
+
+  # We use mirrors of all github repos to guarantee reproducibility and
+  # consistency between what users see and what the bots see.
+  # We need the mirrors to not have 100+ bots pulling github constantly.
+  # We mirror our github repos on chromium git servers.
+  # DO NOT use this var if you don't see a mirror here:
+  #   https://chromium.googlesource.com/
+  # named like:
+  #   external/github.com/dart-lang/NAME
+  # It is ok to add a dependency directly on dart-lang (dart-lang only)
+  # github repo until the mirror has been created, but please do file a bug
+  # against infra to make that happen.
+  "github_mirror":
+      "https://chromium.googlesource.com/external/github.com/dart-lang/%s.git",
 
   "args_tag": "@0.13.0",
   "barback_rev" : "@29ee90dbcf77cfd64632fa2797a4c8a4f29a4b51",
@@ -21,6 +36,7 @@
   "collection_rev": "@1da9a07f32efa2ba0c391b289e2037391e31da0e",
   "crypto_rev" : "@2df57a1e26dd88e8d0614207d4b062c73209917d",
   "csslib_tag" : "@0.12.0",
+  "dart2js_info_rev" : "@c4ad464717e3a304fb0d44a6937c25ff2049b863",
   "glob_rev": "@704cf75e4f26b417505c5c611bdaacd8808467dd",
   "html_tag" : "@0.12.1+1",
   "http_rev" : "@9b93e1542c753090c50b46ef1592d44bc858bfe7",
@@ -33,8 +49,8 @@
   "mime_rev": "@75890811d4af5af080351ba8a2853ad4c8df98dd",
   "metatest_rev": "@e5aa8e4e19fc4188ac2f6d38368a47d8f07c3df1",
   "oauth2_rev": "@1bff41f4d54505c36f2d1a001b83b8b745c452f5",
-  "observatory_pub_packages_rev": "@cdc4b3d4c15b9c0c8e7702dff127b440afbb7485",
-  "package_config_tag": "@0.1.3",
+  "observatory_pub_packages_rev": "@5c199c5954146747f75ed127871207718dc87786",
+  "package_config_rev": "@0.1.3",
   "path_rev": "@b657c0854d1cf41c014986fa9d2321f1173df805",
   "plugin_tag": "@0.1.0",
   "pool_rev": "@22e12aeb16ad0b626900dbe79e4a25391ddfb28c",
@@ -53,7 +69,7 @@
   "zlib_rev": "@c3d0a6190f2f8c924a05ab6cc97b8f975bddd33f",
   "web_components_rev": "@0e636b534d9b12c9e96f841e6679398e91a986ec",
 
-  "co19_rev": "@801",
+  "co19_rev": "@ead3698f33d2cd41e75b6ce5d4a1203767cedd50",
   "fake_async_rev": "@38614",
 })
 
@@ -86,89 +102,84 @@
     Var("dartium_base") + Var("dartium_webkit_branch") + "@" +
         Var("dartium_webkit_revision"),
 
-  # Needed to run pub.
+  "src/dart/third_party/pkg/args":
+      (Var("github_mirror") % "args") + Var("args_tag"),
   "src/dart/third_party/pkg/barback":
-      "https://github.com/dart-lang/barback.git" + Var("barback_rev"),
+      (Var("github_mirror") % "barback") + Var("barback_rev"),
+  "src/dart/third_party/pkg/charcode":
+      (Var("github_mirror") % "charcode") + Var("charcode_tag"),
   "src/dart/third_party/pkg/crypto":
-      "https://github.com/dart-lang/crypto.git" + Var("crypto_rev"),
+      (Var("github_mirror") % "crypto") + Var("crypto_rev"),
   "src/dart/third_party/pkg/csslib":
-      "https://github.com/dart-lang/csslib.git" + Var("csslib_tag"),
+      (Var("github_mirror") % "csslib") + Var("csslib_tag"),
+  "src/dart/third_party/pkg/dart2js_info":
+      (Var("github_mirror") % "dart2js_info") + Var("dart2js_info_rev"),
   "src/dart/third_party/pkg/collection":
-      "https://github.com/dart-lang/collection.git" + Var("collection_rev"),
+      (Var("github_mirror") % "collection") + Var("collection_rev"),
   "src/dart/third_party/pkg/glob":
-      "https://github.com/dart-lang/glob.git" + Var("glob_rev"),
+      (Var("github_mirror") % "glob") + Var("glob_rev"),
   "src/dart/third_party/pkg/html":
-      "https://github.com/dart-lang/html.git" + Var("html_tag"),
+      (Var("github_mirror") % "html") + Var("html_tag"),
   "src/dart/third_party/pkg/json_rpc_2":
-      "https://github.com/dart-lang/json_rpc_2.git" + Var("json_rpc_2_rev"),
+      (Var("github_mirror") % "json_rpc_2") + Var("json_rpc_2_rev"),
   "src/dart/third_party/pkg/http":
-      "https://github.com/dart-lang/http.git" + Var("http_rev"),
+      (Var("github_mirror") % "http") + Var("http_rev"),
   "src/dart/third_party/pkg/http_multi_server":
-      "https://github.com/dart-lang/http_multi_server.git" +
+      (Var("github_mirror") % "http_multi_server") +
       Var("http_multi_server_tag"),
   "src/dart/third_party/pkg/http_parser":
-      "https://github.com/dart-lang/http_parser.git" + Var("http_parser_rev"),
+      (Var("github_mirror") % "http_parser") + Var("http_parser_rev"),
   "src/dart/third_party/pkg/http_throttle":
-      "https://github.com/dart-lang/http_throttle.git" + Var("http_throttle_rev"),
+      (Var("github_mirror") % "http_throttle") + Var("http_throttle_rev"),
   "src/dart/third_party/pkg/logging":
-      "https://github.com/dart-lang/logging.git" + Var("logging_rev"),
-  "src/dart/third_party/pkg/mime":
-      "https://github.com/dart-lang/mime.git" + Var("mime_rev"),
-  "src/dart/third_party/pkg/oauth2":
-    "https://github.com/dart-lang/oauth2.git" + Var("oauth2_rev"),
-  "src/dart/third_party/pkg/plugin":
-      "https://github.com/dart-lang/plugin.git" + Var("plugin_tag"),
-  "src/dart/third_party/pkg/pool":
-      "https://github.com/dart-lang/pool.git" + Var("pool_rev"),
-  "src/dart/third_party/pkg/pub":
-      "https://github.com/dart-lang/pub.git" + Var("pub_rev"),
-  "src/dart/third_party/pkg/pub_semver":
-      "https://github.com/dart-lang/pub_semver.git" + Var("pub_semver_tag"),
-  "src/dart/third_party/pkg/shelf":
-      "https://github.com/dart-lang/shelf.git" + Var("shelf_rev"),
-  "src/dart/third_party/pkg/shelf_web_socket":
-      "https://github.com/dart-lang/shelf_web_socket.git" +
-      Var("shelf_web_socket_rev"),
-  "src/dart/third_party/pkg/utf":
-      "https://github.com/dart-lang/utf.git" + Var("utf_rev"),
-  "src/dart/third_party/pkg/watcher":
-      "https://github.com/dart-lang/watcher.git" + Var("watcher_tag"),
-  "src/dart/third_party/pkg/yaml":
-      "https://github.com/dart-lang/yaml.git" + Var("yaml_rev"),
-
-  "src/dart/third_party/pkg/args":
-      "https://github.com/dart-lang/args.git" + Var("args_tag"),
-  "src/dart/third_party/pkg/charcode":
-      "https://github.com/dart-lang/charcode.git" + Var("charcode_tag"),
-  "src/dart/third_party/pkg/http_parser":
-      "https://github.com/dart-lang/http_parser.git" + Var("http_parser_rev"),
+      (Var("github_mirror") % "logging") + Var("logging_rev"),
   "src/dart/third_party/pkg/matcher":
-      "https://github.com/dart-lang/matcher.git" + Var("matcher_tag"),
+      (Var("github_mirror") % "matcher") + Var("matcher_tag"),
   "src/dart/third_party/pkg/metatest":
-      "https://github.com/dart-lang/metatest.git" + Var("metatest_rev"),
+      (Var("github_mirror") % "metatest") + Var("metatest_rev"),
+  "src/dart/third_party/pkg/mime":
+      (Var("github_mirror") % "mime") + Var("mime_rev"),
+  "src/dart/third_party/pkg/oauth2":
+      (Var("github_mirror") % "oauth2") + Var("oauth2_rev"),
   "src/dart/third_party/observatory_pub_packages":
-      "https://github.com/dart-lang/observatory_pub_packages.git"
-      + Var("observatory_pub_packages_rev"),
-  "src/dart/third_party/pkg/path":
-      "https://github.com/dart-lang/path.git" + Var("path_rev"),
+      (Var("github_mirror") % "observatory_pub_packages") +
+      Var("observatory_pub_packages_rev"),
   "src/dart/third_party/pkg/package_config":
-      "https://github.com/dart-lang/package_config.git" +
-      Var("package_config_tag"),
+      (Var("github_mirror") % "package_config") + Var("package_config_rev"),
+  "src/dart/third_party/pkg/path":
+      (Var("github_mirror") % "path") + Var("path_rev"),
+  "src/dart/third_party/pkg/plugin":
+      (Var("github_mirror") % "plugin") + Var("plugin_tag"),
+  "src/dart/third_party/pkg/pool":
+      (Var("github_mirror") % "pool") + Var("pool_rev"),
+  "src/dart/third_party/pkg/pub":
+      (Var("github_mirror") % "pub") + Var("pub_rev"),
+  "src/dart/third_party/pkg/pub_semver":
+      (Var("github_mirror") % "pub_semver") + Var("pub_semver_tag"),
+  "src/dart/third_party/pkg/shelf":
+      (Var("github_mirror") % "shelf") + Var("shelf_rev"),
+  "src/dart/third_party/pkg/shelf_web_socket":
+      (Var("github_mirror") % "shelf_web_socket") + Var("shelf_web_socket_rev"),
   "src/dart/third_party/pkg/source_span":
-      "https://github.com/dart-lang/source_span.git" + Var("source_span_rev"),
+      (Var("github_mirror") % "source_span") + Var("source_span_rev"),
   "src/dart/third_party/pkg/stack_trace":
-      "https://github.com/dart-lang/stack_trace.git" + Var("stack_trace_tag"),
+      (Var("github_mirror") % "stack_trace") + Var("stack_trace_tag"),
   "src/dart/third_party/pkg/string_scanner":
-      "https://github.com/dart-lang/string_scanner.git" +
-      Var("string_scanner_rev"),
+      (Var("github_mirror") % "string_scanner") + Var("string_scanner_rev"),
   "src/dart/third_party/pkg/test":
-      "https://github.com/dart-lang/test.git" + Var("test_tag"),
+      (Var("github_mirror") % "test") + Var("test_tag"),
+  "src/dart/third_party/pkg/utf":
+      (Var("github_mirror") % "utf") + Var("utf_rev"),
+  "src/dart/third_party/pkg/watcher":
+      (Var("github_mirror") % "watcher") + Var("watcher_tag"),
+  "src/dart/third_party/pkg/web_components":
+      (Var("github_mirror") % "web-components") + Var("web_components_rev"),
+  "src/dart/third_party/pkg/yaml":
+      (Var("github_mirror") % "yaml") + Var("yaml_rev"),
+
   # TODO(sigmund): should be src/dart/third_party/pkg/unittest (dartbug.com/21949)
   "src/dart/pkg/unittest":
-      "https://github.com/dart-lang/test.git" + Var("unittest_tag"),
-  "src/dart/third_party/pkg/web_components":
-      "https://github.com/dart-lang/web-components.git" +
-      Var("web_components_rev"),
+      (Var("github_mirror") % "test") + Var("unittest_tag"),
 
   "src/dart/third_party/WebCore":
     "http://dart.googlecode.com/svn/third_party/WebCore",
@@ -177,8 +188,8 @@
     "http://dart.googlecode.com/svn/third_party/fake_async" +
     Var("fake_async_rev"),
 
-  "src/dart/tests/co19/src": ((Var("googlecode_url") % "co19") +
-    "/trunk/co19/tests/co19/src" + Var("co19_rev")),
+  "src/dart/tests/co19/src":
+      (Var("github_mirror") % "co19") + Var("co19_rev"),
 
   "src/dart/third_party/zlib":
       Var("chromium_git") + "/chromium/src/third_party/zlib.git" +
@@ -228,8 +239,24 @@
     "--no_resume",
     "--bucket",
     "dart-dependencies",
-    "-d",
-    "-r",
+    "--recursive",
+    "--directory",
     "src/dart/tools/testing/bin",
   ],
 })
+hooks.append({
+  "name": "checked_in_dart_sdks",
+  "pattern": ".",
+  "action": [
+    "download_from_google_storage",
+    "--no_auth",
+    "--no_resume",
+    "--bucket",
+    "dart-dependencies",
+    "--recursive",
+    "--auto_platform",
+    "--extract",
+    "--directory",
+    "src/dart/tools/sdks",
+  ],
+})
diff --git a/tools/dom/scripts/css_code_generator.py b/tools/dom/scripts/css_code_generator.py
index 3a00dde..74de8e4 100644
--- a/tools/dom/scripts/css_code_generator.py
+++ b/tools/dom/scripts/css_code_generator.py
@@ -102,18 +102,8 @@
 
 
   class_file.write("""
-$if DART2JS
 $(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME $EXTENDS with
     $(CLASSNAME)Base $IMPLEMENTS {
-$else
-  $if JSINTEROP
-$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS) class $CLASSNAME extends
-    $(CLASSNAME)Base $IMPLEMENTS {
-  $else
-$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME $EXTENDS with
-    $(CLASSNAME)Base $IMPLEMENTS {
-  $endif
-$endif
   factory $CLASSNAME() => new CssStyleDeclaration.css('');
 
   factory $CLASSNAME.css(String css) {
@@ -252,7 +242,7 @@
   String get %s => this._%s;
 
   /** Sets the value of "%s" */
-  void set %s(String value) {
+  set %s(String value) {
     _%s = value == null ? '' : value;
   }
   @Returns('String')
@@ -266,15 +256,7 @@
 $endif
 }
 
-$if DART2JS
 class _CssStyleDeclarationSet extends Object with CssStyleDeclarationBase {
-$else
-  $if JSINTEROP
-class _CssStyleDeclarationSet extends CssStyleDeclarationBase {
-  $else
-class _CssStyleDeclarationSet extends Object with CssStyleDeclarationBase {
-  $endif
-$endif
   final Iterable<Element> _elementIterable;
   Iterable<CssStyleDeclaration> _elementCssStyleDeclarationSetIterable;
 
@@ -309,7 +291,7 @@
     property = dashifyName(camelName)
     class_file.write("""
   /** Sets the value of "%s" */
-  void set %s(String value) {
+  set %s(String value) {
     _setAll('%s', value);
   }
     """ % (property, camelName, camelName))
@@ -371,7 +353,7 @@
     if base_css_name in annotated:
       class_lines.append(annotated[base_css_name])
     class_lines.append("""
-  void set %s(String value) {
+  set %s(String value) {
     setProperty('%s', value, '');
   }
 """ % (camel_case_name, css_name))
diff --git a/tools/dom/scripts/generator.py b/tools/dom/scripts/generator.py
index 688a5f9..2cdc750 100644
--- a/tools/dom/scripts/generator.py
+++ b/tools/dom/scripts/generator.py
@@ -167,7 +167,7 @@
 
     'RTCIceCandidate': 'RTCIceCandidate,mozRTCIceCandidate',
 
-    'RTCIceCandidateEvent': 'RTCIceCandidateEvent,RTCPeerConnectionIceEvent', 
+    'RTCIceCandidateEvent': 'RTCIceCandidateEvent,RTCPeerConnectionIceEvent',
 
     'RTCSessionDescription': 'RTCSessionDescription,mozRTCSessionDescription',
 
@@ -514,21 +514,19 @@
       parameter_count = len(self.param_infos)
     return ', '.join(map(param_name, self.param_infos[:parameter_count]))
 
-  def wrap_unwrap_list_blink(self, return_type, type_registry):
-    """Return True if the type is a List<Node>"""
-    return return_type.startswith('List<Node>')
+  def isCallback(self, type_registry, type_id):
+    if type_id and not type_id.endswith('[]'):
+      callback_type = type_registry._database._all_interfaces[type_id]
+      return callback_type.operations[0].id == 'handleEvent' if len(callback_type.operations) > 0 else False
+    else:
+      return False
 
-  def wrap_unwrap_type_blink(self, return_type, type_registry):
-    """Returns True if the type is a blink type that requires wrap_jso or unwrap_jso.
-    Notice we look for any class that starts with HtmlNNNN e.g., HtmlDocument, etc. """
-    return (type_registry.HasInterface(return_type) or not(return_type) or
-            return_type == 'Object' or return_type.startswith('Html') or
-            return_type == 'MutationObserver')
-
-  def ParametersAsListOfVariables(self, parameter_count=None, type_registry=None, dart_js_interop=False):
+  def ParametersAsListOfVariables(self, parameter_count=None, type_registry=None, dart_js_interop=False, backend = None):
     """Returns a list of the first parameter_count parameter names
     as raw variables.
     """
+    isRemoveOperation = self.name == 'removeEventListener' or self.name == 'removeListener'
+
     if parameter_count is None:
       parameter_count = len(self.param_infos)
     if not type_registry:
@@ -545,19 +543,56 @@
         #    - type is Object
         #
         # JsObject maybe stored in the Dart class.
-        if (self.wrap_unwrap_type_blink(type_id, type_registry)):
-          if dart_js_interop and type_id == 'EventListener' and (self.name == 'addEventListener' or
-                                                                 self.name == 'addListener'):
-            # Events fired need to wrap the Javascript Object passed as a parameter in event.
-            parameters.append('unwrap_jso((Event event) => %s(wrap_jso(event)))' % p.name)
+        if (wrap_unwrap_type_blink(type_id, type_registry)):
+          type_is_callback = self.isCallback(type_registry, type_id)
+          if (dart_js_interop and type_id == 'EventListener' and
+              (self.name == 'addEventListener')):
+              # Events fired need use a JsFunction not a anonymous closure to
+              # insure the event can really be removed.
+              parameters.append('wrap_event_listener(this, %s)' % p.name)
+          elif (dart_js_interop and type_id == 'EventListener' and
+              (self.name == 'removeEventListener')):
+              # Find the JsFunction that corresponds to this Dart function.
+              parameters.append('_knownListeners[this.hashCode][identityHashCode(%s)]' % p.name)
+          elif dart_js_interop and type_id == 'FontFaceSetForEachCallback':
+              # forEach is supported in the DOM for FontFaceSet as it iterates
+              # over the Javascript Object the callback parameters are also
+              # Javascript objects and must be wrapped.
+              parameters.append('unwrap_jso((fontFace, fontFaceAgain, set) => %s(wrap_jso(fontFace), wrap_jso(fontFaceAgain), wrap_jso(set)))' % p.name)
+          elif dart_js_interop and type_id == 'HeadersForEachCallback':
+              # forEach is supported in the DOM for Headers as it iterates
+              # over the Javascript Object the callback parameters are also
+              # Javascript objects and must be wrapped.
+              parameters.append('unwrap_jso((String value, String key, map) => %s(value, key, wrap_jso(map)))' % p.name)
+          elif dart_js_interop and type_is_callback and not(isRemoveOperation):
+            # Any remove operation that has a a callback doesn't need wrapping.
+            # TODO(terry): Kind of hacky but handles all the cases we care about
+            callback_type = type_registry._database._all_interfaces[type_id]
+            callback_args_decl = []
+            callback_args_call = []
+            for callback_arg in callback_type.operations[0].arguments:
+              if dart_js_interop:
+                dart_type = '' # For non-primitives we will be passing JsObject for non-primitives, so ignore types
+              else:
+                dart_type = type_registry.DartType(callback_arg.type.id) + ' '
+              callback_args_decl.append('%s%s' % (dart_type, callback_arg.id))
+              if wrap_unwrap_type_blink(callback_arg.type.id, type_registry):
+                callback_args_call.append('wrap_jso(%s)' % callback_arg.id)
+              else:
+                callback_args_call.append(callback_arg.id)
+            parameters.append('unwrap_jso((%s) => %s(%s))' %
+                              (", ".join(callback_args_decl),
+                               p.name,
+                               ", ".join(callback_args_call)))
           else:
             parameters.append('unwrap_jso(%s)' % p.name)
         else:
           if dart_js_interop:
+            conversion = backend._InputConversion(p.type_id, self.declared_name)
             passParam = p.name
-            if type_id == 'Dictionary':
+            if conversion:
               # Need to pass the IDL Dictionary from Dart Map to JavaScript object.
-              passParam = '{0} != null ? new js.JsObject.jsify({0}) : {0}'.format(p.name)
+              passParam = '{0}({1})'.format(conversion.function_name, p.name)
           else:
             passParam = p.name
           parameters.append(passParam)
@@ -1396,3 +1431,35 @@
 
     class_name = '%sIDLTypeInfo' % type_data.clazz
     return globals()[class_name](type_name, type_data)
+
+def wrap_unwrap_list_blink(return_type, type_registry):
+    """Return True if the type is a List<Node>"""
+    return return_type.startswith('List<Node>')
+
+def wrap_unwrap_type_blink(return_type, type_registry):
+    """Returns True if the type is a blink type that requires wrap_jso or
+    unwrap_jso"""
+    if return_type and return_type.startswith('Html'):
+        return_type = return_type.replace('Html', 'HTML', 1)
+    return (type_registry.HasInterface(return_type) or not(return_type) or
+            return_type == 'Object' or
+            return_type == 'Future' or
+            return_type == 'SqlDatabase' or # renamed to Database
+            return_type == 'HTMLElement' or
+            return_type == 'MutationObserver' or
+            (return_type.endswith('[]') and return_type != 'DOMString[]'))
+
+def wrap_type_blink(return_type, type_registry):
+    """Returns True if the type is a blink type that requires wrap_jso but
+    NOT unwrap_jso"""
+    return (return_type == 'Map' or
+            return_type == 'Rectangle')
+
+def wrap_return_type_blink(return_type, type_name, type_registry):
+    """Returns True if we should wrap the returned value. This checks
+    a number of different variations, calling the more basic functions
+    above."""
+    return (wrap_unwrap_type_blink(return_type, type_registry) or
+            wrap_unwrap_type_blink(type_name, type_registry) or
+            wrap_type_blink(return_type, type_registry) or
+            wrap_unwrap_list_blink(return_type, type_registry))
diff --git a/tools/dom/scripts/go.sh b/tools/dom/scripts/go.sh
index 815c24c..946bdb9 100755
--- a/tools/dom/scripts/go.sh
+++ b/tools/dom/scripts/go.sh
@@ -34,4 +34,4 @@
 fi
 
 reset && \
-./dartdomgenerator.py --systems="$SYSTEMS" --logging=40 --update-dom-metadata
+./dartdomgenerator.py --systems="$SYSTEMS" --logging=40 --update-dom-metadata --gen-interop
diff --git a/tools/dom/scripts/htmldartgenerator.py b/tools/dom/scripts/htmldartgenerator.py
index 3edf60e..e7e500f 100644
--- a/tools/dom/scripts/htmldartgenerator.py
+++ b/tools/dom/scripts/htmldartgenerator.py
@@ -14,6 +14,7 @@
 from htmlrenamer import convert_to_future_members, custom_html_constructors, \
     keep_overloaded_members, overloaded_and_renamed, private_html_members, \
     renamed_html_members, renamed_overloads, removed_html_members
+from generator import TypeOrVar
 import logging
 import monitored
 import sys
@@ -324,6 +325,7 @@
                                              info.operations[0],
                                              info.name,
                                              'call:')
+
     if not method_name:
       if info.name == 'item':
         # FIXME: item should be renamed to operator[], not removed.
@@ -526,7 +528,7 @@
   def _AddConstructor(self,
       constructor_info, factory_name, factory_constructor_name):
     # Hack to ignore the Image constructor used by JavaScript.
-    if (self._interface.id == 'HTMLImageElement'
+    if ((self._interface.id == 'HTMLImageElement' or self._interface.id == 'Blob')
       and not constructor_info.pure_dart_constructor):
       return
 
@@ -595,6 +597,7 @@
         name = emitter.Format('_create_$VERSION', VERSION=version)
         arguments = constructor_info.idl_args[signature_index][:argument_count]
         args = None
+        call_template = ''
         if self._dart_use_blink:
             type_ids = [p.type.id for p in arguments]
             base_name, rs = \
@@ -603,6 +606,12 @@
                 self.DeriveQualifiedBlinkName(self._interface.id,
                                               base_name)
             args = constructor_info.ParametersAsArgumentList(argument_count)
+
+            # Handle converting Maps to Dictionaries, etc.
+            (factory_params, converted_arguments) = self._ConvertArgumentTypes(
+                stmts_emitter, arguments, argument_count, constructor_info)
+            args = ', '.join(converted_arguments)
+            call_template = 'wrap_jso($FACTORY_NAME($FACTORY_PARAMS))'
         else:
             qualified_name = emitter.Format(
                 '$FACTORY.$NAME',
@@ -611,9 +620,8 @@
             (factory_params, converted_arguments) = self._ConvertArgumentTypes(
                 stmts_emitter, arguments, argument_count, constructor_info)
             args = ', '.join(converted_arguments)
-        call_emitter.Emit('$FACTORY_NAME($FACTORY_PARAMS)',
-            FACTORY_NAME=qualified_name,
-            FACTORY_PARAMS=args)
+            call_template = '$FACTORY_NAME($FACTORY_PARAMS)'
+        call_emitter.Emit(call_template, FACTORY_NAME=qualified_name, FACTORY_PARAMS=args)
         self.EmitStaticFactoryOverload(constructor_info, name, arguments)
 
       def IsOptional(signature_index, argument):
@@ -699,7 +707,14 @@
     """ Declares an attribute but does not include the code to invoke it.
     """
     if read_only:
-      template = '\n  $TYPE get $NAME;\n'
+      # HACK(terry): Element is not abstract for Dartium so isContentEditable
+      # must have a body see impl_Element.darttemplate
+      if (self._interface.id == 'Element' and
+          attr_name == 'isContentEditable' and
+          self._dart_js_interop):
+        return
+      else:
+        template = '\n  $TYPE get $NAME;\n'
     else:
       template = '\n  $TYPE $NAME;\n'
 
@@ -714,9 +729,17 @@
       return_type_name - The name of the return type.
       method_name - The name of the method.
     """
+      # HACK(terry): Element is not abstract for Dartium so click
+      # must have a body see impl_Element.darttemplate
+    if (self._interface.id == 'Element' and
+        method_name == 'click' and
+        self._dart_js_interop):
+      return
+    else:
+      template = '\n  $TYPE $NAME($PARAMS);\n'
+
     self._members_emitter.Emit(
-             '\n'
-             '  $TYPE $NAME($PARAMS);\n',
+             template,
              TYPE=return_type_name,
              NAME=method_name,
              PARAMS=operation.ParametersAsDeclaration(self._DartType))
@@ -804,3 +827,49 @@
 
   def _TypeInfo(self, type_name):
     return self._type_registry.TypeInfo(type_name)
+
+  def _ConvertArgumentTypes(self, stmts_emitter, arguments, argument_count, info):
+    temp_version = [0]
+    converted_arguments = []
+    target_parameters = []
+    for position, arg in enumerate(arguments[:argument_count]):
+      conversion = self._InputConversion(arg.type.id, info.declared_name)
+      param_name = arguments[position].id
+      if conversion:
+        temp_version[0] += 1
+        temp_name = '%s_%s' % (param_name, temp_version[0])
+        temp_type = conversion.output_type
+        stmts_emitter.Emit(
+            '$(INDENT)$TYPE $NAME = $CONVERT($ARG);\n',
+            TYPE=TypeOrVar(temp_type),
+            NAME=temp_name,
+            CONVERT=conversion.function_name,
+            ARG=info.param_infos[position].name)
+        converted_arguments.append(temp_name)
+        param_type = temp_type
+        verified_type = temp_type  # verified by assignment in checked mode.
+      else:
+        converted_arguments.append(info.param_infos[position].name)
+        param_type = self._NarrowInputType(arg.type.id)
+        # Verified by argument checking on entry to the dispatcher.
+
+        verified_type = self._InputType(
+            info.param_infos[position].type_id, info)
+        # The native method does not need an argument type if we know the type.
+        # But we do need the native methods to have correct function types, so
+        # be conservative.
+        if param_type == verified_type:
+          if param_type in ['String', 'num', 'int', 'double', 'bool', 'Object']:
+            param_type = 'dynamic'
+
+      target_parameters.append(
+          '%s%s' % (TypeOrNothing(param_type), param_name))
+
+    return target_parameters, converted_arguments
+
+  def _InputType(self, type_name, info):
+    conversion = self._InputConversion(type_name, info.declared_name)
+    if conversion:
+      return conversion.input_type
+    else:
+      return self._NarrowInputType(type_name) if type_name else 'dynamic'
diff --git a/tools/dom/scripts/htmlrenamer.py b/tools/dom/scripts/htmlrenamer.py
index 96d3cfc..e207e79 100644
--- a/tools/dom/scripts/htmlrenamer.py
+++ b/tools/dom/scripts/htmlrenamer.py
@@ -176,6 +176,7 @@
 # constructor for dispatch purposes.
 custom_html_constructors = monitored.Set(
     'htmlrenamer.custom_html_constructors', [
+  'HTMLAudioElement',
   'HTMLOptionElement',
   'MutationObserver',
 ])
@@ -196,6 +197,7 @@
   'CanvasRenderingContext2D.arc',
   'CanvasRenderingContext2D.drawImage',
   'CanvasRenderingContext2D.getLineDash',
+  'Crypto.getRandomValues',
   'CSSStyleDeclaration.getPropertyValue',
   'CSSStyleDeclaration.setProperty',
   'CSSStyleDeclaration.var',
@@ -204,6 +206,7 @@
   'CustomEvent.initCustomEvent',
   'DeviceOrientationEvent.initDeviceOrientationEvent',
   'Document.createElement',
+  'Document.createElementNS',
   'Document.createEvent',
   'Document.createNodeIterator',
   'Document.createTextNode',
@@ -233,6 +236,7 @@
   'Document.webkitIsFullScreen',
   'Document.webkitVisibilityState',
 
+  'Element.animate',
   'Element.children',
   'Element.childElementCount',
   'Element.firstElementChild',
@@ -780,6 +784,8 @@
     'MouseEvent.y',
     'Navigator.registerServiceWorker',
     'Navigator.unregisterServiceWorker',
+    'Navigator.isProtocolHandlerRegistered',
+    'Navigator.unregisterProtocolHandler',
     'Node.compareDocumentPosition',
     'Node.get:DOCUMENT_POSITION_CONTAINED_BY',
     'Node.get:DOCUMENT_POSITION_CONTAINS',
@@ -821,6 +827,7 @@
     'Window.on:wheel',
     'WindowEventHandlers.on:beforeUnload',
     'WorkerGlobalScope.webkitIndexedDB',
+    'XMLHttpRequest.open',
 # TODO(jacobr): should these be removed?
     'Document.close',
     'Document.hasFocus',
diff --git a/tools/dom/scripts/systemhtml.py b/tools/dom/scripts/systemhtml.py
index 69ee642..24ecbb8 100644
--- a/tools/dom/scripts/systemhtml.py
+++ b/tools/dom/scripts/systemhtml.py
@@ -494,6 +494,7 @@
 
   def GenerateInterface(self):
     interface_name = self._interface_type_info.interface_name()
+
     implementation_name = self._interface_type_info.implementation_name()
     self._library_emitter.AddTypeEntry(self._library_name,
                                        self._interface.id, implementation_name)
@@ -559,15 +560,15 @@
 
     mixins = self._backend.Mixins()
 
-    # TODO(terry): Do we need a more generic solution other than handling NamedNodeMap
-    #              we can't call super on a mixin interface - yet.
-    if self._options.templates._conditions['DARTIUM'] and self._options.dart_js_interop and self._interface.id == 'NamedNodeMap':
-      mixins = None
     mixins_str = ''
     if mixins:
       mixins_str = ' with ' + ', '.join(mixins)
       if not base_class:
         base_class = 'Interceptor'
+      elif (base_class == 'NativeFieldWrapperClass2' and
+            self._options.dart_js_interop and
+            not(isinstance(self._backend, Dart2JSBackend))):
+        base_class = 'DartHtmlDomObject'
 
     annotations = self._metadata.GetFormattedMetadata(
         self._library_name, self._interface, None, '')
@@ -578,12 +579,20 @@
       # XMLHttpRequestProgressEvent can't be abstract we need to instantiate
       # for JsInterop.
       if (not(isinstance(self._backend, Dart2JSBackend)) and
-        self._interface.id == 'XMLHttpRequestProgressEvent'):
-        # Only suppress abstract for XMLHttpRequestProgressEvent for Dartium.
-        # Need to be able to instantiate the class; can't be abstract.
+        (self._interface.id == 'XMLHttpRequestProgressEvent' or
+         self._interface.id == 'DOMStringMap')):
+        # Suppress abstract for XMLHttpRequestProgressEvent and DOMStringMap
+        # for Dartium.  Need to be able to instantiate the class; can't be abstract.
         class_modifiers = ''
       else:
-        class_modifiers = 'abstract '
+        # For Dartium w/ JsInterop these suppressed interfaces are needed to
+        # instanciate the internal classes when wrap_jso is called for a JS object.
+        if (self._renamer.ShouldSuppressInterface(self._interface) and
+            not(isinstance(self._backend, Dart2JSBackend)) and
+            self._options.dart_js_interop):
+          class_modifiers = ''
+        else:
+          class_modifiers = 'abstract '
 
     native_spec = ''
     if not IsPureInterface(self._interface.id):
@@ -592,51 +601,57 @@
     class_name = self._interface_type_info.implementation_name()
 
     js_interop_equivalence_op = \
-      '  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);\n'
+      '  bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical(this, other);\n' \
+      + '  int get hashCode => unwrap_jso(this).hashCode;\n'
     # ClientRect overrides the equivalence operator.
     if interface_name == 'ClientRect' or interface_name == 'DomRectReadOnly':
         js_interop_equivalence_op = ''
 
     js_interop_wrapper = '''
 
+  @Deprecated("Internal Use Only")
   static {0} internalCreate{0}() {{
     return new {0}._internalWrap();
   }}
 
   factory {0}._internalWrap() {{
-    return new {0}._internal();
+    return new {0}.internal_();
   }}
 
-  {0}._internal() : super._internal();
+  @Deprecated("Internal Use Only")
+  {0}.internal_() : super.internal_();
 
 '''.format(class_name)
-    """
-    TODO(terry): Don't use Dart expando really don't need.
-      final Object expandoJsObject = new Object();
-      final Expando<JsObject> dartium_expando = new Expando<JsObject>("Expando_jsObject");
-    """
-    if base_class == 'NativeFieldWrapperClass2':
+    if base_class == 'NativeFieldWrapperClass2' or base_class == 'DartHtmlDomObject':
         js_interop_wrapper = '''
+  @Deprecated("Internal Use Only")
   static {0} internalCreate{0}() {{
     return new {0}._internalWrap();
   }}
 
-  JsObject blink_jsObject = null;
-
   factory {0}._internalWrap() {{
-    return new {0}._internal();
+    return new {0}.internal_();
   }}
 
-  {0}._internal() {{ }}
+  @Deprecated("Internal Use Only")
+  {0}.internal_() {{ }}
 
 {1}'''.format(class_name, js_interop_equivalence_op)
+        # Change to use the synthesized class so we can construct with a mixin
+        # classes prefixed with name of NativeFieldWrapperClass2 don't have a
+        # default constructor so classes with mixins can't be new'd.
+        if (self._options.templates._conditions['DARTIUM'] and
+            self._options.dart_js_interop and
+            (self._interface.id == 'NamedNodeMap' or
+             self._interface.id == 'CSSStyleDeclaration')):
+            base_class = 'DartHtmlDomObject'
 
     implementation_members_emitter = implementation_emitter.Emit(
         self._backend.ImplementationTemplate(),
         LIBRARYNAME='dart.dom.%s' % self._library_name,
         ANNOTATIONS=annotations,
         CLASS_MODIFIERS=class_modifiers,
-        CLASSNAME=self._interface_type_info.implementation_name(),
+        CLASSNAME=class_name,
         EXTENDS=' extends %s' % base_class if base_class else '',
         IMPLEMENTS=implements_str,
         MIXINS=mixins_str,
@@ -673,7 +688,8 @@
     # Write out the JsInterop code.
     if (implementation_members_emitter and
         self._options.templates._conditions['DARTIUM'] and
-        self._options.dart_js_interop):
+        self._options.dart_js_interop and
+        not IsPureInterface(self._interface.id)):
       implementation_members_emitter.Emit(js_interop_wrapper)
 
     if isElement and self._interface.id != 'Element':
@@ -980,7 +996,7 @@
       return self._AddConvertingSetter(attr, html_name, conversion)
     self._members_emitter.Emit(
         # TODO(sra): Use metadata to provide native name.
-        '\n  void set $HTML_NAME($TYPE value) {'
+        '\n  set $HTML_NAME($TYPE value) {'
         '\n    JS("void", "#.$NAME = #", this, value);'
         '\n  }'
         '\n',
@@ -1007,10 +1023,10 @@
   def _AddConvertingSetter(self, attr, html_name, conversion):
     self._members_emitter.Emit(
         # TODO(sra): Use metadata to provide native name.
-        '\n  void set $HTML_NAME($INPUT_TYPE value) {'
+        '\n  set $HTML_NAME($INPUT_TYPE value) {'
         '\n    this._set_$HTML_NAME = $CONVERT(value);'
         '\n  }'
-        '\n  void set _set_$HTML_NAME(/*$NATIVE_TYPE*/ value) {'
+        '\n  set _set_$HTML_NAME(/*$NATIVE_TYPE*/ value) {'
         '\n    JS("void", "#.$NAME = #", this, value);'
         '\n  }'
         '\n',
@@ -1059,53 +1075,6 @@
         NAME=html_name,
         PARAMS=info.ParametersAsDeclaration(self._NarrowInputType))
 
-  def _ConvertArgumentTypes(
-          self, stmts_emitter, arguments, argument_count, info):
-    temp_version = [0]
-    converted_arguments = []  
-    target_parameters = []
-    for position, arg in enumerate(arguments[:argument_count]):
-      conversion = self._InputConversion(arg.type.id, info.declared_name)
-      param_name = arguments[position].id
-      if conversion:
-        temp_version[0] += 1
-        temp_name = '%s_%s' % (param_name, temp_version[0])
-        temp_type = conversion.output_type
-        stmts_emitter.Emit(
-            '$(INDENT)$TYPE $NAME = $CONVERT($ARG);\n',
-            TYPE=TypeOrVar(temp_type),
-            NAME=temp_name,
-            CONVERT=conversion.function_name,
-            ARG=info.param_infos[position].name)
-        converted_arguments.append(temp_name)
-        param_type = temp_type
-        verified_type = temp_type  # verified by assignment in checked mode.
-      else:
-        converted_arguments.append(info.param_infos[position].name)
-        param_type = self._NarrowInputType(arg.type.id)
-        # Verified by argument checking on entry to the dispatcher.
-
-        verified_type = self._InputType(
-            info.param_infos[position].type_id, info)
-        # The native method does not need an argument type if we know the type.
-        # But we do need the native methods to have correct function types, so
-        # be conservative.
-        if param_type == verified_type:
-          if param_type in ['String', 'num', 'int', 'double', 'bool', 'Object']:
-            param_type = 'dynamic'
-
-      target_parameters.append(
-          '%s%s' % (TypeOrNothing(param_type), param_name))
-
-    return target_parameters, converted_arguments
-
-  def _InputType(self, type_name, info):
-    conversion = self._InputConversion(type_name, info.declared_name)
-    if conversion:
-      return conversion.input_type
-    else:
-      return self._NarrowInputType(type_name) if type_name else 'dynamic'
-
   def _AddOperationWithConversions(self, info, html_name):
     # Assert all operations have same return type.
     assert len(set([op.type.id for op in info.operations])) == 1
@@ -1346,10 +1315,14 @@
       items = self._typeMap.items()
       items.sort()
       for (idl_name, dart_name) in items:
-        function_emitter.Emit(
-          "  '$IDL_NAME': () => $DART_NAME.internalCreate$DART_NAME,\n",
-          IDL_NAME=idl_name,
-          DART_NAME=dart_name)
+        # DOMStringMap is in the abstract list but is used as a concrete class
+        # in Dartium.
+        if not IsPureInterface(idl_name):
+          # Handle classes that are concrete (abstract can't be instantiated).
+          function_emitter.Emit(
+            "  '$IDL_NAME': () => $DART_NAME.internalCreate$DART_NAME,\n",
+            IDL_NAME=idl_name,
+            DART_NAME=dart_name)
       if self._dart_path.endswith('html_dartium.dart'):
         function_emitter.Emit("  'polymer-element': () => HtmlElement.internalCreateHtmlElement,\n")
 
diff --git a/tools/dom/scripts/systemnative.py b/tools/dom/scripts/systemnative.py
index 99e511a..3fc0638 100644
--- a/tools/dom/scripts/systemnative.py
+++ b/tools/dom/scripts/systemnative.py
@@ -394,8 +394,8 @@
   def CustomJSMembers(self):
     return {}
 
-  def _InputConversion(self, type_name, info):
-    return None
+  def _InputConversion(self, idl_type, member):
+    return FindConversion(idl_type, 'set', self._interface.id, member)
 
   def GenerateCallback(self, info):
     if IsPureInterface(self._interface.id) or IsCustomType(self._interface.id):
@@ -516,7 +516,7 @@
     return template
 
   def RootClassName(self):
-    return 'NativeFieldWrapperClass2'
+    return 'DartHtmlDomObject'
 
   # This code matches up with the _generate_native_entry code in
   # dart_utilities.py in the dartium repository.  Any changes to this
@@ -645,7 +645,7 @@
         self._members_emitter.Emit(
             '\n  @DocsEditable()\n'
             '  static $INTERFACE_NAME $FACTORY_METHOD_NAME($PARAMETERS) => '
-            '$TOPLEVEL_NAME($OUTPARAMETERS);\n',
+            'wrap_jso($TOPLEVEL_NAME($OUTPARAMETERS));\n',
             INTERFACE_NAME=self._interface_type_info.interface_name(),
             FACTORY_METHOD_NAME=factory_method_name,
             PARAMETERS=typed_formals,
@@ -914,7 +914,7 @@
     if self._interface.id == 'ImageData' and html_name == 'data':
       html_name = '_data'
     type_info = self._TypeInfo(attr.type.id)
-    return_type = self.SecureOutputType(attr.type.id, False, read_only)
+    return_type = self.SecureOutputType(attr.type.id, False, False if self._dart_use_blink else True)
     parameters = []
     dart_declaration = '%s get %s' % (return_type, html_name)
     is_custom = _IsCustom(attr) and (_IsCustomValue(attr, None) or
@@ -932,8 +932,7 @@
         #    - type is Object
         #
         # JsObject maybe stored in the Dart class.
-        return_wrap_jso = (isinstance(type_info, InterfaceIDLTypeInfo) or
-                           not(type_info) or attr.type.id == 'Object')
+        return_wrap_jso = wrap_return_type_blink(return_type, attr.type.id, self._type_registry)
     wrap_unwrap_list.append(return_wrap_jso)       # wrap_jso the returned object
     wrap_unwrap_list.append(self._dart_use_blink)  # this must be unwrap_jso
 
@@ -996,7 +995,7 @@
                                           not(attr.type.id) or ptype == 'Object')
                   else 'value']
 
-    dart_declaration = 'void set %s(%s value)' % (html_name, ptype)
+    dart_declaration = 'set %s(%s value)' % (html_name, ptype)
     is_custom = _IsCustom(attr) and (_IsCustomValue(attr, None) or
                                      _IsCustomValue(attr, 'Setter'))
     # This seems to have been replaced with Custom=Setter (see above), but
@@ -1086,7 +1085,8 @@
       # Does nativeIndexGetter return a DartClass (JsObject) if so wrap_jso.
       wrap_jso_start = ''
       wrap_jso_end = ''
-      if isinstance(type_info, InterfaceIDLTypeInfo):
+      if (isinstance(type_info, InterfaceIDLTypeInfo) or
+          wrap_type_blink(type_info.narrow_dart_type(), self._type_registry)):
           wrap_jso_start = 'wrap_jso('
           wrap_jso_end = ')'
       blinkNativeIndexed = """
@@ -1097,7 +1097,7 @@
   }
 
   $TYPE _nativeIndexedGetter(int index) => %s$(DART_NATIVE_NAME)(unwrap_jso(this), index)%s;
- """ % (wrap_jso_start, wrap_jso_end, wrap_jso_start, wrap_jso_end)
+""" % (wrap_jso_start, wrap_jso_end, wrap_jso_start, wrap_jso_end)
       # Wrap the type to store the JsObject if Type is:
       #
       #    - known IDL type
@@ -1189,11 +1189,14 @@
     Arguments:
       info: An OperationInfo object.
     """
-    return_type = self.SecureOutputType(info.type_name, False, True)
+    return_type = self.SecureOutputType(info.type_name, False, False if dart_js_interop else True)
 
     formals = info.ParametersAsDeclaration(self._DartType)
 
-    parameters = info.ParametersAsListOfVariables(None, self._type_registry if self._dart_use_blink else None, dart_js_interop)
+    parameters = info.ParametersAsListOfVariables(None,
+                                                  self._type_registry if self._dart_use_blink else None,
+                                                  dart_js_interop,
+                                                  self)
     dart_declaration = '%s%s %s(%s)' % (
         'static ' if info.IsStatic() else '',
         return_type,
@@ -1219,11 +1222,15 @@
         #    - type is Object
         #
         # JsObject maybe stored in the Dart class.
-        return_wrap_jso = (info.wrap_unwrap_type_blink(return_type, self._type_registry) or
-                           return_type == 'Rectangle' or
-                           info.wrap_unwrap_list_blink(return_type, self._type_registry))
-    wrap_unwrap_list.append(return_wrap_jso)       # wrap_jso the returned object
-    wrap_unwrap_list.append(self._dart_use_blink)  # The 'this' parameter must be unwrap_jso
+        return_wrap_jso = wrap_return_type_blink(return_type, info.type_name, self._type_registry)
+        return_type_info = self._type_registry.TypeInfo(info.type_name)
+        if (isinstance(return_type_info, SequenceIDLTypeInfo) and
+            not isinstance(return_type_info._item_info, PrimitiveIDLTypeInfo)):
+                return_wrap_jso = True
+    # wrap_jso the returned object
+    wrap_unwrap_list.append(return_wrap_jso)
+    # The 'this' parameter must be unwrap_jso
+    wrap_unwrap_list.append(self._dart_use_blink)
 
     if info.callback_args:
       self._AddFutureifiedOperation(info, html_name)
@@ -1252,14 +1259,15 @@
       native_suffix = 'Callback'
       actuals = info.ParametersAsListOfVariables(argument_count,
                                                  self._type_registry if self._dart_use_blink else None,
-                                                 self._dart_js_interop)
+                                                 self._dart_js_interop,
+                                                 self)
       actuals_s = ", ".join(actuals)
       formals=actuals
       return_type = self.SecureOutputType(operation.type.id)
 
       return_wrap_jso = False
       if self._dart_use_blink:
-         return_wrap_jso = self._type_registry.HasInterface(return_type)
+          return_wrap_jso = wrap_return_type_blink(return_type, info.type_name, self._type_registry)
 
       native_suffix = 'Callback'
       is_custom = _IsCustom(operation)
@@ -1742,19 +1750,17 @@
   '''
                 if return_type == 'Rectangle':
                     jso_util_method = 'make_dart_rectangle'
-                # TODO(terry): More checks that the return is a List<Node>.
-                elif return_type.startswith('List<'):
-                    jso_util_method = 'wrap_jso_list'
-                else:
+                elif wrap_unwrap_list[0]:
                     jso_util_method = 'wrap_jso'
-                # Always return List<String> unwrapped.
-                if return_type != 'List<String>':
-                  emit_template = emit_jso_template % jso_util_method
-            caller_emitter.Emit(emit_template,
-                                METADATA=metadata,
-                                DART_DECLARATION=dart_declaration,
-                                DART_NAME=full_dart_name,
-                                ACTUALS=actuals)
+
+                emit_template = emit_jso_template % jso_util_method
+
+            if caller_emitter:
+              caller_emitter.Emit(emit_template,
+                                  METADATA=metadata,
+                                  DART_DECLARATION=dart_declaration,
+                                  DART_NAME=full_dart_name,
+                                  ACTUALS=actuals)
     cpp_callback_name = '%s%s' % (idl_name, native_suffix)
 
     self._cpp_resolver_emitter.Emit(
diff --git a/tools/dom/src/CssRectangle.dart b/tools/dom/src/CssRectangle.dart
index e82ddd9..440bebe 100644
--- a/tools/dom/src/CssRectangle.dart
+++ b/tools/dom/src/CssRectangle.dart
@@ -27,7 +27,7 @@
    * `height` function in jQuery and the calculated `height` CSS value,
    * converted to a num in pixels.
    */
-  void set height(newHeight) {
+  set height(newHeight) {
     if (newHeight is Dimension) {
       if (newHeight.value < 0) newHeight = new Dimension.px(0);
       _element.style.height = newHeight.toString();
@@ -45,7 +45,7 @@
    * and the calculated
    * `width` CSS value, converted to a dimensionless num in pixels.
    */
-  void set width(newWidth) {
+  set width(newWidth) {
     if (newWidth is Dimension) {
       if (newWidth.value < 0) newWidth = new Dimension.px(0);
       _element.style.width = newWidth.toString();
@@ -80,7 +80,7 @@
    * function in jQuery and the calculated `height` CSS value, converted to a
    * num in pixels.
    */
-  void set height(newHeight) {
+  set height(newHeight) {
     _elementList.forEach((e) => e.contentEdge.height = newHeight);
   }
 
@@ -90,7 +90,7 @@
    * This is equivalent to the `width` function in jQuery and the calculated
    * `width` CSS value, converted to a dimensionless num in pixels.
    */
-  void set width(newWidth) {
+  set width(newWidth) {
     _elementList.forEach((e) => e.contentEdge.width = newWidth);
   }
 }
@@ -197,7 +197,7 @@
    *
    * Note that only the content height can actually be set via this method.
    */
-  void set height(newHeight) {
+  set height(newHeight) {
     throw new UnsupportedError("Can only set height for content rect.");
   }
 
@@ -211,7 +211,7 @@
    *
    * Note that only the content width can be set via this method.
    */
-  void set width(newWidth) {
+  set width(newWidth) {
     throw new UnsupportedError("Can only set width for content rect.");
   }
 
diff --git a/tools/dom/src/Html5NodeValidator.dart b/tools/dom/src/Html5NodeValidator.dart
index a5e0e57..2bbaf41 100644
--- a/tools/dom/src/Html5NodeValidator.dart
+++ b/tools/dom/src/Html5NodeValidator.dart
@@ -423,11 +423,11 @@
   }
 
   bool allowsElement(Element element) {
-    return _allowedElements.contains(element.tagName);
+    return _allowedElements.contains(Element._safeTagName(element));
   }
 
   bool allowsAttribute(Element element, String attributeName, String value) {
-    var tagName = element.tagName;
+    var tagName = Element._safeTagName(element);
     var validator = _attributeValidators['$tagName::$attributeName'];
     if (validator == null) {
       validator = _attributeValidators['*::$attributeName'];
diff --git a/tools/dom/src/NodeValidatorBuilder.dart b/tools/dom/src/NodeValidatorBuilder.dart
index 4a41232..24f079b 100644
--- a/tools/dom/src/NodeValidatorBuilder.dart
+++ b/tools/dom/src/NodeValidatorBuilder.dart
@@ -358,11 +358,11 @@
   }
 
   bool allowsElement(Element element) {
-    return allowedElements.contains(element.tagName);
+    return allowedElements.contains(Element._safeTagName(element));
   }
 
   bool allowsAttribute(Element element, String attributeName, String value) {
-    var tagName = element.tagName;
+    var tagName = Element._safeTagName(element);
     if (allowedUriAttributes.contains('$tagName::$attributeName')) {
       return uriPolicy.allowsUri(value);
     } else if (allowedUriAttributes.contains('*::$attributeName')) {
@@ -403,10 +403,10 @@
       var isAttr = element.attributes['is'];
       if (isAttr != null) {
         return allowedElements.contains(isAttr.toUpperCase()) &&
-          allowedElements.contains(element.tagName);
+            allowedElements.contains(Element._safeTagName(element));
       }
     }
-    return allowCustomTag && allowedElements.contains(element.tagName);
+    return allowCustomTag && allowedElements.contains(Element._safeTagName(element));
   }
 
   bool allowsAttribute(Element element, String attributeName, String value) {
@@ -462,7 +462,7 @@
     // foreignobject tag as SvgElement. We don't want foreignobject contents
     // anyway, so just remove the whole tree outright. And we can't rely
     // on IE recognizing the SvgForeignObject type, so go by tagName. Bug 23144
-    if (element is svg.SvgElement && element.tagName == 'foreignObject') {
+    if (element is svg.SvgElement && Element._safeTagName(element) == 'foreignObject') {
       return false;
     }
     if (element is svg.SvgElement) {
diff --git a/tools/dom/src/Validators.dart b/tools/dom/src/Validators.dart
index 809f8e5..4dbe32c 100644
--- a/tools/dom/src/Validators.dart
+++ b/tools/dom/src/Validators.dart
@@ -72,7 +72,7 @@
   /**
    * A sanitizer for trees that we trust. It does no validation and allows
    * any elements. It is also more efficient, since it can pass the text
-   * directly through to the underlying APIs without creating a document 
+   * directly through to the underlying APIs without creating a document
    * fragment to be sanitized.
    */
   static const trusted = const _TrustedHtmlTreeSanitizer();
@@ -87,7 +87,7 @@
 
   sanitizeTree(Node node) {}
 }
-  
+
 /**
  * Defines the policy for what types of uris are allowed for particular
  * attribute values.
@@ -141,14 +141,14 @@
 
   bool allowsElement(Element element) {
     if (!validator.allowsElement(element)) {
-      throw new ArgumentError(element.tagName);
+      throw new ArgumentError(Element._safeTagName(element));
     }
     return true;
   }
 
   bool allowsAttribute(Element element, String attributeName, String value) {
     if (!validator.allowsAttribute(element, attributeName, value)) {
-      throw new ArgumentError('${element.tagName}[$attributeName="$value"]');
+      throw new ArgumentError('${Element._safeTagName(element)}[$attributeName="$value"]');
     }
   }
 }
@@ -190,7 +190,7 @@
   }
 
   /// Sanitize the element, assuming we can't trust anything about it.
-  void _sanitizeUntrustedElement(Element element, Node parent) {
+  void _sanitizeUntrustedElement(/* Element */ element, Node parent) {
     // If the _hasCorruptedAttributes does not successfully return false,
     // then we consider it corrupted and remove.
     // TODO(alanknight): This is a workaround because on Firefox
@@ -199,7 +199,9 @@
     // can't call methods. This does mean that you can't explicitly allow an
     // embed tag. The only thing that will let it through is a null
     // sanitizer that doesn't traverse the tree at all. But sanitizing while
-    // allowing embeds seems quite unlikely.
+    // allowing embeds seems quite unlikely. This is also the reason that we
+    // can't declare the type of element, as an embed won't pass any type
+    // check in dart2js.
     var corrupted = true;
     var attrs;
     var isAttr;
@@ -207,18 +209,27 @@
       // If getting/indexing attributes throws, count that as corrupt.
       attrs = element.attributes;
       isAttr = attrs['is'];
-      corrupted = Element._hasCorruptedAttributes(element);
+      var corruptedTest1 = Element._hasCorruptedAttributes(element);
+
+      // On IE, erratically, the hasCorruptedAttributes test can return false,
+      // even though it clearly is corrupted. A separate copy of the test
+      // inlining just the basic check seems to help.
+      corrupted = corruptedTest1 ? true : Element._hasCorruptedAttributesAdditionalCheck(element);
     } catch(e) {}
-     var elementText = 'element unprintable';
+    var elementText = 'element unprintable';
     try {
       elementText = element.toString();
     } catch(e) {}
-    var elementTagName = 'element tag unavailable';
     try {
-      elementTagName = element.tagName;
-    } catch(e) {}
-    _sanitizeElement(element, parent, corrupted, elementText, elementTagName,
-        attrs, isAttr);
+      var elementTagName = Element._safeTagName(element);
+      _sanitizeElement(element, parent, corrupted, elementText, elementTagName,
+          attrs, isAttr);
+    } on ArgumentError { // Thrown by _ThrowsNodeValidator
+      rethrow;
+    } catch(e) {  // Unexpected exception sanitizing -> remove
+      _removeNode(element, parent);
+      window.console.warn('Removing corrupted element $elementText');
+    }
   }
 
   /// Having done basic sanity checking on the element, and computed the
@@ -227,23 +238,23 @@
   void _sanitizeElement(Element element, Node parent, bool corrupted,
       String text, String tag, Map attrs, String isAttr) {
     if (false != corrupted) {
+       _removeNode(element, parent);
       window.console.warn(
           'Removing element due to corrupted attributes on <$text>');
-       _removeNode(element, parent);
        return;
     }
     if (!validator.allowsElement(element)) {
-      window.console.warn(
-          'Removing disallowed element <$tag>');
       _removeNode(element, parent);
+      window.console.warn(
+          'Removing disallowed element <$tag> from $parent');
       return;
     }
 
     if (isAttr != null) {
       if (!validator.allowsAttribute(element, 'is', isAttr)) {
+        _removeNode(element, parent);
         window.console.warn('Removing disallowed type extension '
             '<$tag is="$isAttr">');
-        _removeNode(element, parent);
         return;
       }
     }
diff --git a/tools/dom/src/WrappedList.dart b/tools/dom/src/WrappedList.dart
index 375ce7c..fd3ca95 100644
--- a/tools/dom/src/WrappedList.dart
+++ b/tools/dom/src/WrappedList.dart
@@ -34,7 +34,7 @@
 
   void operator []=(int index, E value) { _list[index] = value; }
 
-  void set length(int newLength) { _list.length = newLength; }
+  set length(int newLength) { _list.length = newLength; }
 
   void sort([int compare(E a, E b)]) { _list.sort(compare); }
 
diff --git a/tools/dom/src/_chrome/app_runtime.dart b/tools/dom/src/_chrome/app_runtime.dart
index 31aa9cd..03658f0 100644
--- a/tools/dom/src/_chrome/app_runtime.dart
+++ b/tools/dom/src/_chrome/app_runtime.dart
@@ -32,14 +32,14 @@
   /// FileEntry for the file.
   FileEntry get entry => JS('FileEntry', '#.entry', this._jsObject);
 
-  void set entry(FileEntry entry) {
+  set entry(FileEntry entry) {
     JS('void', '#.entry = #', this._jsObject, convertArgument(entry));
   }
 
   /// The MIME type of the file.
   String get type => JS('String', '#.type', this._jsObject);
 
-  void set type(String type) {
+  set type(String type) {
     JS('void', '#.type = #', this._jsObject, type);
   }
 
@@ -67,7 +67,7 @@
   /// The id of the file handler that the app is being invoked with.
   String get id => JS('String', '#.id', this._jsObject);
 
-  void set id(String id) {
+  set id(String id) {
     JS('void', '#.id = #', this._jsObject, id);
   }
 
@@ -81,7 +81,7 @@
     return __proxy_items;
   }
 
-  void set items(List<AppRuntimeLaunchItem> items) {
+  set items(List<AppRuntimeLaunchItem> items) {
     JS('void', '#.items = #', this._jsObject, convertArgument(items));
   }
 
diff --git a/tools/dom/src/_chrome/app_window.dart b/tools/dom/src/_chrome/app_window.dart
index 6c62ab0..515061e 100644
--- a/tools/dom/src/_chrome/app_window.dart
+++ b/tools/dom/src/_chrome/app_window.dart
@@ -35,25 +35,25 @@
    */
   int get left => JS('int', '#.left', this._jsObject);
 
-  void set left(int left) {
+  set left(int left) {
     JS('void', '#.left = #', this._jsObject, left);
   }
 
   int get top => JS('int', '#.top', this._jsObject);
 
-  void set top(int top) {
+  set top(int top) {
     JS('void', '#.top = #', this._jsObject, top);
   }
 
   int get width => JS('int', '#.width', this._jsObject);
 
-  void set width(int width) {
+  set width(int width) {
     JS('void', '#.width = #', this._jsObject, width);
   }
 
   int get height => JS('int', '#.height', this._jsObject);
 
-  void set height(int height) {
+  set height(int height) {
     JS('void', '#.height = #', this._jsObject, height);
   }
 
@@ -121,7 +121,7 @@
   /// same id is later opened.
   String get id => JS('String', '#.id', this._jsObject);
 
-  void set id(String id) {
+  set id(String id) {
     JS('void', '#.id = #', this._jsObject, id);
   }
 
@@ -129,7 +129,7 @@
   /// now.)
   int get defaultWidth => JS('int', '#.defaultWidth', this._jsObject);
 
-  void set defaultWidth(int defaultWidth) {
+  set defaultWidth(int defaultWidth) {
     JS('void', '#.defaultWidth = #', this._jsObject, defaultWidth);
   }
 
@@ -137,7 +137,7 @@
   /// now.)
   int get defaultHeight => JS('int', '#.defaultHeight', this._jsObject);
 
-  void set defaultHeight(int defaultHeight) {
+  set defaultHeight(int defaultHeight) {
     JS('void', '#.defaultHeight = #', this._jsObject, defaultHeight);
   }
 
@@ -145,7 +145,7 @@
   /// this now.)
   int get defaultLeft => JS('int', '#.defaultLeft', this._jsObject);
 
-  void set defaultLeft(int defaultLeft) {
+  set defaultLeft(int defaultLeft) {
     JS('void', '#.defaultLeft = #', this._jsObject, defaultLeft);
   }
 
@@ -153,77 +153,77 @@
   /// this now.)
   int get defaultTop => JS('int', '#.defaultTop', this._jsObject);
 
-  void set defaultTop(int defaultTop) {
+  set defaultTop(int defaultTop) {
     JS('void', '#.defaultTop = #', this._jsObject, defaultTop);
   }
 
   /// Width of the window. (Deprecated; use 'bounds'.)
   int get width => JS('int', '#.width', this._jsObject);
 
-  void set width(int width) {
+  set width(int width) {
     JS('void', '#.width = #', this._jsObject, width);
   }
 
   /// Height of the window. (Deprecated; use 'bounds'.)
   int get height => JS('int', '#.height', this._jsObject);
 
-  void set height(int height) {
+  set height(int height) {
     JS('void', '#.height = #', this._jsObject, height);
   }
 
   /// X coordinate of the window. (Deprecated; use 'bounds'.)
   int get left => JS('int', '#.left', this._jsObject);
 
-  void set left(int left) {
+  set left(int left) {
     JS('void', '#.left = #', this._jsObject, left);
   }
 
   /// Y coordinate of the window. (Deprecated; use 'bounds'.)
   int get top => JS('int', '#.top', this._jsObject);
 
-  void set top(int top) {
+  set top(int top) {
     JS('void', '#.top = #', this._jsObject, top);
   }
 
   /// Minimum width for the lifetime of the window.
   int get minWidth => JS('int', '#.minWidth', this._jsObject);
 
-  void set minWidth(int minWidth) {
+  set minWidth(int minWidth) {
     JS('void', '#.minWidth = #', this._jsObject, minWidth);
   }
 
   /// Minimum height for the lifetime of the window.
   int get minHeight => JS('int', '#.minHeight', this._jsObject);
 
-  void set minHeight(int minHeight) {
+  set minHeight(int minHeight) {
     JS('void', '#.minHeight = #', this._jsObject, minHeight);
   }
 
   /// Maximum width for the lifetime of the window.
   int get maxWidth => JS('int', '#.maxWidth', this._jsObject);
 
-  void set maxWidth(int maxWidth) {
+  set maxWidth(int maxWidth) {
     JS('void', '#.maxWidth = #', this._jsObject, maxWidth);
   }
 
   /// Maximum height for the lifetime of the window.
   int get maxHeight => JS('int', '#.maxHeight', this._jsObject);
 
-  void set maxHeight(int maxHeight) {
+  set maxHeight(int maxHeight) {
     JS('void', '#.maxHeight = #', this._jsObject, maxHeight);
   }
 
   /// Type of window to create.
   String get type => JS('String', '#.type', this._jsObject);
 
-  void set type(String type) {
+  set type(String type) {
     JS('void', '#.type = #', this._jsObject, type);
   }
 
   /// Frame type: 'none' or 'chrome' (defaults to 'chrome').
   String get frame => JS('String', '#.frame', this._jsObject);
 
-  void set frame(String frame) {
+  set frame(String frame) {
     JS('void', '#.frame = #', this._jsObject, frame);
   }
 
@@ -232,7 +232,7 @@
   /// before, the remembered bounds of the window will be used instead.
   AppWindowBounds get bounds => new AppWindowBounds._proxy(JS('', '#.bounds', this._jsObject));
 
-  void set bounds(AppWindowBounds bounds) {
+  set bounds(AppWindowBounds bounds) {
     JS('void', '#.bounds = #', this._jsObject, convertArgument(bounds));
   }
 
@@ -240,7 +240,7 @@
   /// experimental API permission.
   bool get transparentBackground => JS('bool', '#.transparentBackground', this._jsObject);
 
-  void set transparentBackground(bool transparentBackground) {
+  set transparentBackground(bool transparentBackground) {
     JS('void', '#.transparentBackground = #', this._jsObject, transparentBackground);
   }
 
@@ -248,7 +248,7 @@
   /// fullscreen, maximized, or minimized. Defaults to 'normal'.
   String get state => JS('String', '#.state', this._jsObject);
 
-  void set state(String state) {
+  set state(String state) {
     JS('void', '#.state = #', this._jsObject, state);
   }
 
@@ -256,14 +256,14 @@
   /// window to show it once it has been created. Defaults to false.
   bool get hidden => JS('bool', '#.hidden', this._jsObject);
 
-  void set hidden(bool hidden) {
+  set hidden(bool hidden) {
     JS('void', '#.hidden = #', this._jsObject, hidden);
   }
 
   /// If true, the window will be resizable by the user. Defaults to true.
   bool get resizable => JS('bool', '#.resizable', this._jsObject);
 
-  void set resizable(bool resizable) {
+  set resizable(bool resizable) {
     JS('void', '#.resizable = #', this._jsObject, resizable);
   }
 
@@ -274,7 +274,7 @@
   /// property to false.
   bool get singleton => JS('bool', '#.singleton', this._jsObject);
 
-  void set singleton(bool singleton) {
+  set singleton(bool singleton) {
     JS('void', '#.singleton = #', this._jsObject, singleton);
   }
 
diff --git a/tools/dom/src/_chrome/file_system.dart b/tools/dom/src/_chrome/file_system.dart
index b3d532a..83212c5 100644
--- a/tools/dom/src/_chrome/file_system.dart
+++ b/tools/dom/src/_chrome/file_system.dart
@@ -37,7 +37,7 @@
   /// *.htm").
   String get description => JS('String', '#.description', this._jsObject);
 
-  void set description(String description) {
+  set description(String description) {
     JS('void', '#.description = #', this._jsObject, description);
   }
 
@@ -45,14 +45,14 @@
   /// extensions must contain at least one valid element.
   List<String> get mimeTypes => JS('List<String>', '#.mimeTypes', this._jsObject);
 
-  void set mimeTypes(List<String> mimeTypes) {
+  set mimeTypes(List<String> mimeTypes) {
     JS('void', '#.mimeTypes = #', this._jsObject, mimeTypes);
   }
 
   /// Extensions to accept, e.g. "jpg", "gif", "crx".
   List<String> get extensions => JS('List<String>', '#.extensions', this._jsObject);
 
-  void set extensions(List<String> extensions) {
+  set extensions(List<String> extensions) {
     JS('void', '#.extensions = #', this._jsObject, extensions);
   }
 
@@ -84,7 +84,7 @@
   /// Type of the prompt to show. The default is 'openFile'.
   String get type => JS('String', '#.type', this._jsObject);
 
-  void set type(String type) {
+  set type(String type) {
     JS('void', '#.type = #', this._jsObject, type);
   }
 
@@ -92,7 +92,7 @@
   /// name to read or write. This is optional.
   String get suggestedName => JS('String', '#.suggestedName', this._jsObject);
 
-  void set suggestedName(String suggestedName) {
+  set suggestedName(String suggestedName) {
     JS('void', '#.suggestedName = #', this._jsObject, suggestedName);
   }
 
@@ -108,7 +108,7 @@
     return __proxy_accepts;
   }
 
-  void set accepts(List<FilesystemAcceptOption> accepts) {
+  set accepts(List<FilesystemAcceptOption> accepts) {
     JS('void', '#.accepts = #', this._jsObject, convertArgument(accepts));
   }
 
@@ -117,7 +117,7 @@
   /// contains no valid entries, this will always be reset to true.
   bool get acceptsAllTypes => JS('bool', '#.acceptsAllTypes', this._jsObject);
 
-  void set acceptsAllTypes(bool acceptsAllTypes) {
+  set acceptsAllTypes(bool acceptsAllTypes) {
     JS('void', '#.acceptsAllTypes = #', this._jsObject, acceptsAllTypes);
   }
 
diff --git a/tools/dom/src/_chrome/utils.dart b/tools/dom/src/_chrome/utils.dart
index b88019c..6770113 100644
--- a/tools/dom/src/_chrome/utils.dart
+++ b/tools/dom/src/_chrome/utils.dart
@@ -117,27 +117,27 @@
    */
   String get id => JS('String', '#.id', this._jsObject);
 
-  void set id(String id) {
+  set id(String id) {
     JS('void', '#.id = #', this._jsObject, id);
   }
 
   // TODO(sashab): Wrap these generic Lists somehow.
   List get conditions => JS('List', '#.conditions', this._jsObject);
 
-  void set conditions(List conditions) {
+  set conditions(List conditions) {
     JS('void', '#.conditions = #', this._jsObject, convertArgument(conditions));
   }
 
   // TODO(sashab): Wrap these generic Lists somehow.
   List get actions => JS('List', '#.actions', this._jsObject);
 
-  void set actions(List actions) {
+  set actions(List actions) {
     JS('void', '#.actions = #', this._jsObject, convertArgument(actions));
   }
 
   int get priority => JS('int', '#.priority', this._jsObject);
 
-  void set priority(int priority) {
+  set priority(int priority) {
     JS('void', '#.priority = #', this._jsObject, priority);
   }
 
diff --git a/tools/dom/src/dart2js_DOMImplementation.dart b/tools/dom/src/dart2js_DOMImplementation.dart
index dd82ad8..24e6a6c 100644
--- a/tools/dom/src/dart2js_DOMImplementation.dart
+++ b/tools/dom/src/dart2js_DOMImplementation.dart
@@ -83,7 +83,7 @@
   // properly.  Its fields and methods can only be accessed via JavaScript.
   var _location;
 
-  void set href(String val) => _setHref(_location, val);
+  set href(String val) => _setHref(_location, val);
   static void _setHref(location, val) {
     JS('void', '#.href = #', location, val);
   }
diff --git a/tools/dom/src/dartium_CustomElementSupport.dart b/tools/dom/src/dartium_CustomElementSupport.dart
index a14e07f..aec7b4a 100644
--- a/tools/dom/src/dartium_CustomElementSupport.dart
+++ b/tools/dom/src/dartium_CustomElementSupport.dart
@@ -8,9 +8,11 @@
 class _VMElementUpgrader implements ElementUpgrader {
   final Type _type;
   final Type _nativeType;
+  final String _extendsTag;
 
   _VMElementUpgrader(Document document, Type type, String extendsTag) :
       _type = type,
+      _extendsTag = extendsTag,
       _nativeType = _validateCustomType(type).reflectedType {
 
     if (extendsTag == null) {
@@ -26,11 +28,41 @@
     }
   }
 
-  Element upgrade(Element element) {
-    if (element.runtimeType != _nativeType) {
-      throw new UnsupportedError('Element is incorrect type');
+  Element upgrade(element) {
+    var jsObject;
+    var tag;
+    var isNativeElementExtension = false;
+
+    try {
+      tag = _getCustomElementName(element);
+    } catch (e) {
+      isNativeElementExtension = element.localName == _extendsTag;
     }
-    return _Utils.changeElementWrapper(element, _type);
+
+    if (element.runtimeType == HtmlElement || element.runtimeType == TemplateElement) {
+      if (tag != _extendsTag) {
+        throw new UnsupportedError('$tag is not registered.');
+      }
+      jsObject = unwrap_jso(element);
+    } else if (element.runtimeType == js.JsObjectImpl) {
+      // It's a Polymer core element (written in JS).
+      jsObject = element;
+    } else if (isNativeElementExtension) {
+      // Extending a native element.
+      jsObject = element.blink_jsObject;
+
+      // Element to extend is the real tag.
+      tag = element.localName;
+    } else if (tag != null && element.localName != tag) {
+      throw new UnsupportedError('Element is incorrect type. Got ${element.runtimeType}, expected native Html or Svg element to extend.');
+    } else if (tag == null) {
+      throw new UnsupportedError('Element is incorrect type. Got ${element.runtimeType}, expected HtmlElement/JsObjectImpl.');
+    }
+
+    // Remember Dart class to tagName for any upgrading done in wrap_jso.
+    addCustomElementType(tag, _type, _extendsTag);
+
+    return _createCustomUpgrader(_type, jsObject);
   }
 }
 
diff --git a/tools/dom/src/dartium_KeyEvent.dart b/tools/dom/src/dartium_KeyEvent.dart
index 2d133d3..327ddf0 100644
--- a/tools/dom/src/dartium_KeyEvent.dart
+++ b/tools/dom/src/dartium_KeyEvent.dart
@@ -29,6 +29,14 @@
 
 @Experimental()
 class KeyEvent extends _WrappedEvent implements KeyboardEvent {
+  /** Needed because KeyboardEvent is implements.
+   *  TODO(terry): Consider making blink_jsObject private (add underscore) for
+   *               all blink_jsObject.  Then needed private wrap/unwrap_jso
+   *               functions that delegate to a public wrap/unwrap_jso.
+   */
+  @Deprecated("Internal Use Only")
+  js.JsObject blink_jsObject;
+
   /** The parent KeyboardEvent that this KeyEvent is wrapping and "fixing". */
   KeyboardEvent _parent;
 
diff --git a/tools/dom/src/dartium_WrappedEvent.dart b/tools/dom/src/dartium_WrappedEvent.dart
index 2f7b8b8..9fa56fd 100644
--- a/tools/dom/src/dartium_WrappedEvent.dart
+++ b/tools/dom/src/dartium_WrappedEvent.dart
@@ -8,6 +8,13 @@
  * Helper class to implement custom events which wrap DOM events.
  */
 class _WrappedEvent implements Event {
+  /** Needed because KeyboardEvent is implements.
+   *  TODO(terry): Consider making blink_jsObject private (add underscore) for
+   *               all blink_jsObject.  Then needed private wrap/unwrap_jso
+   *               functions that delegate to a public wrap/unwrap_jso.
+   */
+  js.JsObject blink_jsObject;
+
   final Event wrapped;
 
   /** The CSS selector involved with event delegation. */
diff --git a/tools/dom/src/native_DOMImplementation.dart b/tools/dom/src/native_DOMImplementation.dart
index 34c032b..b18a026 100644
--- a/tools/dom/src/native_DOMImplementation.dart
+++ b/tools/dom/src/native_DOMImplementation.dart
@@ -124,6 +124,8 @@
     }
   }
 
+  static maybeUnwrapJso(obj) => unwrap_jso(obj);
+
   static List convertToList(List list) {
     // FIXME: [possible optimization]: do not copy the array if Dart_IsArray is fine w/ it.
     final length = list.length;
@@ -187,9 +189,7 @@
     return element;
   }
 
-  // TODO(terry): Enable below for Dartium w/ interop and remove other static window().
-  // static window() => wrap_jso(_blink.Blink_Utils.window()['window']);
-  static window() => _blink.Blink_Utils.window();
+  static window() => wrap_jso(js.context['window']);
 
   static forwardingPrint(String message) => _blink.Blink_Utils.forwardingPrint(message);
   static void spawnDomHelper(Function f, int replyTo) =>
@@ -771,7 +771,7 @@
     return [
         "inspect",
         (o) {
-          host.inspect(o, null);
+          host.callMethod("inspect", [o]);
           return o;
         },
         "dir",
@@ -806,15 +806,19 @@
   static Element createElement(Document document, String tagName) =>
     wrap_jso(_blink.Blink_Utils.createElement(unwrap_jso(document), tagName));
 
-  static void initializeCustomElement(HtmlElement element) =>
-    _blink.Blink_Utils.initializeCustomElement(unwrap_jso(element));
-
   static Element changeElementWrapper(HtmlElement element, Type type) =>
     _blink.Blink_Utils.changeElementWrapper(unwrap_jso(element), type);
 }
 
-class _DOMWindowCrossFrame extends NativeFieldWrapperClass2 implements
+class _DOMWindowCrossFrame extends DartHtmlDomObject implements
     WindowBase {
+  /** Needed because KeyboardEvent is implements.
+   *  TODO(terry): Consider making blink_jsObject private (add underscore) for
+   *               all blink_jsObject.  Then needed private wrap/unwrap_jso
+   *               functions that delegate to a public wrap/unwrap_jso.
+   */
+  js.JsObject blink_jsObject;
+
   _DOMWindowCrossFrame.internal();
 
   // Fields.
@@ -857,7 +861,7 @@
     'You can only attach EventListeners to your own window.');
 }
 
-class _HistoryCrossFrame extends NativeFieldWrapperClass2 implements HistoryBase {
+class _HistoryCrossFrame extends DartHtmlDomObject implements HistoryBase {
   _HistoryCrossFrame.internal();
 
   // Methods.
@@ -869,17 +873,17 @@
   String get typeName => "History";
 }
 
-class _LocationCrossFrame extends NativeFieldWrapperClass2 implements LocationBase {
+class _LocationCrossFrame extends DartHtmlDomObject implements LocationBase {
   _LocationCrossFrame.internal();
 
   // Fields.
-  void set href(String h) => _blink.Blink_LocationCrossFrame.set_href(this, h);
+  set href(String h) => _blink.Blink_LocationCrossFrame.set_href(this, h);
 
   // Implementation support.
   String get typeName => "Location";
 }
 
-class _DOMStringMap extends NativeFieldWrapperClass2 implements Map<String, String> {
+class _DOMStringMap extends DartHtmlDomObject implements Map<String, String> {
   _DOMStringMap.internal();
 
   bool containsValue(String value) => Maps.containsValue(this, value);
@@ -1109,10 +1113,6 @@
   throw new UnimplementedError("scheduleMicrotask in background isolates "
                                "are not supported in the browser"));
 
-void _initializeCustomElement(Element e) {
-  _Utils.initializeCustomElement(e);
-}
-
 // Class for unsupported native browser 'DOM' objects.
-class _UnsupportedBrowserObject extends NativeFieldWrapperClass2 {
+class _UnsupportedBrowserObject extends DartHtmlDomObject {
 }
diff --git a/tools/dom/templates/html/dart2js/html_dart2js.darttemplate b/tools/dom/templates/html/dart2js/html_dart2js.darttemplate
index e12a06c..30400a1 100644
--- a/tools/dom/templates/html/dart2js/html_dart2js.darttemplate
+++ b/tools/dom/templates/html/dart2js/html_dart2js.darttemplate
@@ -34,7 +34,7 @@
 
 import 'dart:async';
 import 'dart:collection';
-import 'dart:_internal' hide Symbol, deprecated;
+import 'dart:_internal' hide Symbol;
 import 'dart:html_common';
 import 'dart:indexed_db';
 import 'dart:isolate';
@@ -52,7 +52,7 @@
 import 'dart:web_sql';
 import 'dart:_js_helper' show
     convertDartClosureToJS, Creates, JavaScriptIndexingBehavior,
-    JSName, Native, Null, Returns, Inline, ForceInline,
+    JSName, Native, Returns, ForceInline,
     findDispatchTagForInterceptorClass, setNativeSubclassDispatchRecord,
     makeLeafDispatchRecord;
 import 'dart:_interceptors' show
@@ -149,3 +149,8 @@
   // TODO(17738): Implement this.
   throw new UnimplementedError();
 }
+
+/// Dartium functions that are a NOOP in dart2js.
+unwrap_jso(dartClass_instance) => dartClass_instance;
+wrap_jso(jsObject) => jsObject;
+createCustomUpgrader(Type customElementClass, $this) => $this;
diff --git a/tools/dom/templates/html/dart2js/indexed_db_dart2js.darttemplate b/tools/dom/templates/html/dart2js/indexed_db_dart2js.darttemplate
index 43a18e5..128f945 100644
--- a/tools/dom/templates/html/dart2js/indexed_db_dart2js.darttemplate
+++ b/tools/dom/templates/html/dart2js/indexed_db_dart2js.darttemplate
@@ -85,7 +85,7 @@
 import 'dart:html_common';
 import 'dart:_native_typed_data';
 import 'dart:typed_data';
-import 'dart:_js_helper' show Creates, Returns, JSName, Native, Null;
+import 'dart:_js_helper' show Creates, Returns, JSName, Native;
 import 'dart:_foreign_helper' show JS;
 import 'dart:_interceptors' show Interceptor, JSExtendableArray;
 
diff --git a/tools/dom/templates/html/dart2js/svg_dart2js.darttemplate b/tools/dom/templates/html/dart2js/svg_dart2js.darttemplate
index 7fc18ae..f36b929 100644
--- a/tools/dom/templates/html/dart2js/svg_dart2js.darttemplate
+++ b/tools/dom/templates/html/dart2js/svg_dart2js.darttemplate
@@ -14,7 +14,7 @@
 
 import 'dart:async';
 import 'dart:collection';
-import 'dart:_internal' hide deprecated;
+import 'dart:_internal';
 import 'dart:html';
 import 'dart:html_common';
 import 'dart:_js_helper' show Creates, Returns, JSName, Native;
diff --git a/tools/dom/templates/html/dart2js/web_audio_dart2js.darttemplate b/tools/dom/templates/html/dart2js/web_audio_dart2js.darttemplate
index 5aef22c..2959405 100644
--- a/tools/dom/templates/html/dart2js/web_audio_dart2js.darttemplate
+++ b/tools/dom/templates/html/dart2js/web_audio_dart2js.darttemplate
@@ -9,7 +9,7 @@
 
 import 'dart:async';
 import 'dart:collection';
-import 'dart:_internal' hide deprecated;
+import 'dart:_internal';
 import 'dart:html';
 import 'dart:html_common';
 import 'dart:_native_typed_data';
diff --git a/tools/dom/templates/html/dart2js/web_gl_dart2js.darttemplate b/tools/dom/templates/html/dart2js/web_gl_dart2js.darttemplate
index 107c1f6..c6d31c0 100644
--- a/tools/dom/templates/html/dart2js/web_gl_dart2js.darttemplate
+++ b/tools/dom/templates/html/dart2js/web_gl_dart2js.darttemplate
@@ -8,12 +8,12 @@
 library dart.dom.web_gl;
 
 import 'dart:collection';
-import 'dart:_internal' hide deprecated;
+import 'dart:_internal';
 import 'dart:html';
 import 'dart:html_common';
 import 'dart:_native_typed_data';
 import 'dart:typed_data';
-import 'dart:_js_helper' show Creates, JSName, Native, Null, Returns, convertDartClosureToJS;
+import 'dart:_js_helper' show Creates, JSName, Native, Returns, convertDartClosureToJS;
 import 'dart:_foreign_helper' show JS;
 import 'dart:_interceptors' show Interceptor, JSExtendableArray;
 
diff --git a/tools/dom/templates/html/dart2js/web_sql_dart2js.darttemplate b/tools/dom/templates/html/dart2js/web_sql_dart2js.darttemplate
index 4555e4d..2de24a0 100644
--- a/tools/dom/templates/html/dart2js/web_sql_dart2js.darttemplate
+++ b/tools/dom/templates/html/dart2js/web_sql_dart2js.darttemplate
@@ -16,7 +16,7 @@
 
 import 'dart:async';
 import 'dart:collection';
-import 'dart:_internal' hide deprecated;
+import 'dart:_internal';
 import 'dart:html';
 import 'dart:html_common';
 import 'dart:_js_helper' show convertDartClosureToJS, Creates, JSName, Native;
diff --git a/tools/dom/templates/html/dartium/html_dartium.darttemplate b/tools/dom/templates/html/dartium/html_dartium.darttemplate
index c6a200f..0e029f2 100644
--- a/tools/dom/templates/html/dartium/html_dartium.darttemplate
+++ b/tools/dom/templates/html/dartium/html_dartium.darttemplate
@@ -33,7 +33,7 @@
 
 import 'dart:async';
 import 'dart:collection';
-import 'dart:_internal' hide Symbol, deprecated;
+import 'dart:_internal' hide Symbol;
 import 'dart:html_common';
 import 'dart:indexed_db';
 import 'dart:indexed_db' show indexed_dbBlinkMap;
@@ -61,6 +61,7 @@
 import 'dart:web_audio' show web_audioBlinkMap;
 import 'dart:web_audio' show web_audioBlinkFunctionMap;
 import 'dart:_blink' as _blink;
+import 'dart:developer';
 
 export 'dart:math' show Rectangle, Point;
 
@@ -117,7 +118,7 @@
   }
 $if DARTIUM
 $if JSINTEROP
-  _window = wrap_jso(js.context['window']);
+  _window = wrap_jso(js.JsNative.getProperty(js.context, 'window'));
 $else
   _window = _Utils.window();
 $endif
@@ -150,6 +151,7 @@
   return _Utils.spawnDomUri(uri.toString());
 }
 // FIXME: Can we make this private?
+@Deprecated("Internal Use Only")
 final htmlBlinkMap = {
   '_HistoryCrossFrame': () => _HistoryCrossFrame,
   '_LocationCrossFrame': () => _LocationCrossFrame,
@@ -250,15 +252,16 @@
   return null;
 }
 
-
 $if JSINTEROP
 // FIXME: Can we make this private?
+@Deprecated("Internal Use Only")
 final htmlBlinkFunctionMap = {
 $!TYPE_FUNCTION_MAP
 };
 
 // TODO(terry): We may want to move this elsewhere if html becomes
 // a package to avoid dartium depending on pkg:html.
+@Deprecated("Internal Use Only")
 getHtmlCreateFunction(String key) {
   var result;
 
@@ -303,42 +306,42 @@
   return null;
 }
 
-Type _getHtmlFunction(String key) {
+Function _getHtmlFunction(String key) {
   if (htmlBlinkFunctionMap.containsKey(key)) {
     return htmlBlinkFunctionMap[key]();
   }
   return null;
 }
 
-Type _getWebGlFunction(String key) {
+Function _getWebGlFunction(String key) {
   if (web_glBlinkFunctionMap.containsKey(key)) {
     return web_glBlinkFunctionMap[key]();
   }
   return null;
 }
 
-Type _getIndexDbFunction(String key) {
+Function _getIndexDbFunction(String key) {
   if (indexed_dbBlinkFunctionMap.containsKey(key)) {
     return indexed_dbBlinkFunctionMap[key]();
   }
   return null;
 }
 
-Type _getWebAudioFunction(String key) {
+Function _getWebAudioFunction(String key) {
   if (web_audioBlinkFunctionMap.containsKey(key)) {
     return web_audioBlinkFunctionMap[key]();
   }
   return null;
 }
 
-Type _getWebSqlFunction(String key) {
+Function _getWebSqlFunction(String key) {
   if (web_sqlBlinkFunctionMap.containsKey(key)) {
     return web_sqlBlinkFunctionMap[key]();
   }
   return null;
 }
 
-Type _getSvgFunction(String key) {
+Function _getSvgFunction(String key) {
   if (svgBlinkFunctionMap.containsKey(key)) {
     return svgBlinkFunctionMap[key]();
   }
@@ -352,84 +355,146 @@
  **********                                                          **********
  ******************************************************************************/
 
-Rectangle make_dart_rectangle(r) => new Rectangle(r['top'], r['left'], r['width'], r['height']);
-
-
-/** Expando for JsObject, used by every Dart class associated with a Javascript
- *  class (e.g., DOM, WebAudio, etc.).
- */
-
-/**
- * Return the JsObject associated with a Dart class [dartClass_instance].
- */
-js.JsObject unwrap_jso(dartClass_instance) {
-  try {
-      if (dartClass_instance != null)
-          return dartClass_instance is! Function ? dartClass_instance.blink_jsObject : dartClass_instance;
-      else
-          return null;
-//      return dartClass_instance.dartium_expando[dartClass_instance.expandoJsObject];
-  } catch(NoSuchMethodException) {
-      // No blink_jsObject then return the dartClass_instance is probably an
-      // array that was already converted to a Dart class e.g., Uint8ClampedList.
-      return dartClass_instance;
+String _getCustomElementExtends(object) {
+  var entry = getCustomElementEntry(object);
+  if (entry != null) {
+    return entry['extends'];
   }
+  return null;
 }
 
-/**
- * Create Dart class that maps to the JS Type, add the JsObject as an expando
- * on the Dart class and return the created Dart class. 
- */
-wrap_jso(jsObject) {
-try {
-//  debug_or_assert("jsObject != null", jsObject != null);
-  if (jsObject is! js.JsObject) {
-      // JS Interop converted the object to a Dart class e.g., Uint8ClampedList.
-      return jsObject;
+// Return the tag name or is attribute of the custom element or data binding.
+String _getCustomElementName(element) {
+  var jsObject;
+  var tag = "";
+  var runtimeType = element.runtimeType;
+  if (runtimeType == HtmlElement) {
+    tag = element.localName;
+  } else if (runtimeType == TemplateElement) {
+    // Data binding with a Dart class.
+    tag = element.attributes['is'];
+  } else if (runtimeType == js.JsObjectImpl) {
+    // It's a Polymer core element (written in JS).
+    // Make sure it's an element anything else we can ignore.
+    if (element.hasProperty('nodeType') && element['nodeType'] == 1) {
+      if (js.JsNative.callMethod(element, 'hasAttribute', ['is'])) {
+        // It's data binding use the is attribute.
+        tag = js.JsNative.callMethod(element, 'getAttribute', ['is']);
+      } else {
+        // It's a custom element we want the local name.
+        tag = element['localName'];
+      }
+    }
+  } else {
+    throw new UnsupportedError('Element is incorrect type. Got ${runtimeType}, expected HtmlElement/HtmlTemplate/JsObjectImpl.');
   }
-  var constructor = jsObject['constructor'];
-  debug_or_assert("constructor != null", constructor != null);
-  var jsTypeName = constructor['name'];
-  debug_or_assert("constructor != null && jsTypeName.length > 0", constructor != null && jsTypeName.length > 0);
-  var func = getHtmlCreateFunction(jsTypeName);
-  debug_or_assert("func != null name = ${jsTypeName}", func != null);
-  var dartClass_instance = func();
-  dartClass_instance.blink_jsObject = jsObject;
-//  dartClass_instance.dartium_expando[dartClass_instance.expandoJsObject] = jsObject;
-  return dartClass_instance;
-} catch(e, stacktrace){
-  if (e is DebugAssertException)
-    window.console.log("${e.message}\n ${stacktrace}");
-  else
-    window.console.log("${stacktrace}");
-}
+
+  return tag;
 }
 
+/// An abstract class for all DOM objects we wrap in dart:html and related
+///  libraries.
+///
+/// ** Internal Use Only **
+@Deprecated("Internal Use Only")
+class DartHtmlDomObject {
+
+  /// The underlying JS DOM object.
+  @Deprecated("Internal Use Only")
+  js.JsObject blink_jsObject;
+
+}
+
+/// Upgrade a Dart HtmlElement to the user's Dart custom element class.
+_upgradeHtmlElement(dartInstance) {
+  // Only try upgrading HtmlElement (Dart class) if there is a failure then
+  // don't try it again - one failure is enough.
+  if (dartInstance.runtimeType == HtmlElement && !dartInstance.isBadUpgrade) {
+    // Must be exactly HtmlElement not something derived from it.
+
+    var customElementClass = getCustomElementType(dartInstance);
+
+    // Custom Element to upgrade.
+    if (customElementClass != null) {
+      var jsObject = dartInstance.blink_jsObject;
+      try {
+        dartInstance = _blink.Blink_Utils.constructElement(customElementClass, jsObject);
+      } catch (e) {
+        dartInstance._badUpgrade();
+      } finally {
+        dartInstance.blink_jsObject = jsObject;
+        js.setDartHtmlWrapperFor(jsObject, dartInstance);
+     }
+   }
+  }
+
+  return dartInstance;
+}
+
+@Deprecated("Internal Use Only")
 class DebugAssertException implements Exception {
   String message;
   DebugAssertException(this.message);
 }
 
+@Deprecated("Internal Use Only")
 debug_or_assert(message, expression) {
   if (!expression) {
     throw new DebugAssertException("$message");
   }
 }
 
-// Wrap JsObject node list to return a List<node>.
-List<Node> wrap_jso_list(jso_nodes) {
-  List<Node> nodes = new List<Node>();
-  var collectionLen = jso_nodes['length'];
-  for (var i = 0; i < collectionLen; i++) {
-    nodes.add(wrap_jso(jso_nodes.callMethod('item', [i])));
-  }
-  var frozen_nodes = new _FrozenElementList._wrap(nodes);
-  frozen_nodes.dartClass_instance = jso_nodes;
-  return frozen_nodes;
+// TODO(terry): Manage JS interop JsFunctions for each listener used for add/
+//              removeEventListener.  These JsFunctions will leak look at
+//              fixing with weak-refs in C++.  The key are the hashcodes of the
+//              user's this (this is needed for futures) and listener function.
+Map<int, Map<int, js.JsFunction>> _knownListeners = {};
+
+@Deprecated("Internal Use Only")
+js.JsFunction wrap_event_listener(theObject, Function listener) {
+  var thisHashCode = theObject.hashCode;
+  var listenerHashCode = identityHashCode(listener);
+
+  _knownListeners.putIfAbsent(thisHashCode, () => new Map<int, js.JsFunction>());
+  _knownListeners[thisHashCode].putIfAbsent(listenerHashCode, () =>
+    new js.JsFunction.withThis((theObject, event) => listener(wrap_jso(event))));
+
+  return _knownListeners[thisHashCode][listenerHashCode];
 }
+
+@Deprecated("Internal Use Only")
+Map<String, dynamic> convertNativeObjectToDartMap(js.JsObject jsObject) {
+  var result = new Map();
+  var keys = js.JsNative.callMethod(js.JsNative.getProperty(js.context, 'Object'), 'keys', [jsObject]);
+  for (var key in keys) {
+    result[key] = wrap_jso(js.JsNative.getProperty(jsObject, key));
+  }
+  return result;
+}
+
+/**
+ * Upgrade the JS HTMLElement to the Dart class.  Used by Dart's Polymer.
+ */
+_createCustomUpgrader(Type customElementClass, $this) {
+  var dartClass;
+  try {
+    dartClass = _blink.Blink_Utils.constructElement(customElementClass, $this);
+  } catch (e) {
+    dartClass._badUpgrade();
+    throw e;
+  } finally {
+    // Need to remember the Dart class that was created for this custom so
+    // return it and setup the blink_jsObject to the $this that we'll be working
+    // with as we talk to blink.
+    js.setDartHtmlWrapperFor($this, dartClass);
+  }
+
+  return dartClass;
+}
+
 $else
-unwrap_jso(dartClass_instance) => dartClass_instance;
-wrap_jso(jsObject) => jsObject;
-wrap_jso_list(jso_nodes) => jso_nodes;
-make_dart_rectangle(r) => r;
+class DartHtmlDomObject extends NativeFieldWrapperClass2 {}
+
+_createCustomUpgrader(Type customElementClass, $this) => $this;
+
 $endif
diff --git a/tools/dom/templates/html/dartium/indexed_db_dartium.darttemplate b/tools/dom/templates/html/dartium/indexed_db_dartium.darttemplate
index 62dd7e9..ef3928c 100644
--- a/tools/dom/templates/html/dartium/indexed_db_dartium.darttemplate
+++ b/tools/dom/templates/html/dartium/indexed_db_dartium.darttemplate
@@ -69,7 +69,7 @@
  * and where both the keys and the values are strings.
  *
  * * [dart:web_sql]&mdash;a database that can be queried with SQL.
- * 
+ *
  * For a tutorial about using the indexed_db library with Dart,
  * check out
  * [Use IndexedDB](http://www.dartlang.org/docs/tutorials/indexeddb/).
@@ -84,6 +84,7 @@
 import 'dart:html_common';
 import 'dart:nativewrappers';
 import 'dart:_blink' as _blink;
+import 'dart:js' as js;
 
 $!GENERATED_DART_FILES
 
@@ -106,12 +107,14 @@
       KeyRange.bound_(lower, upper, lowerOpen, upperOpen);
 }
 // FIXME: Can we make this private?
+@Deprecated("Internal Use Only")
 final indexed_dbBlinkMap = {
 $!TYPE_MAP
 };
 
 $if JSINTEROP
 // FIXME: Can we make this private?
+@Deprecated("Internal Use Only")
 final indexed_dbBlinkFunctionMap = {
 $!TYPE_FUNCTION_MAP
 };
diff --git a/tools/dom/templates/html/dartium/svg_dartium.darttemplate b/tools/dom/templates/html/dartium/svg_dartium.darttemplate
index 6dff8b6..ab2a99d 100644
--- a/tools/dom/templates/html/dartium/svg_dartium.darttemplate
+++ b/tools/dom/templates/html/dartium/svg_dartium.darttemplate
@@ -13,22 +13,25 @@
 
 import 'dart:async';
 import 'dart:collection';
-import 'dart:_internal' hide deprecated;
+import 'dart:_internal';
 import 'dart:html';
 import 'dart:html_common';
 import 'dart:nativewrappers';
 import 'dart:_blink' as _blink;
+import 'dart:js' as js;
 
 part '$AUXILIARY_DIR/shared_SVGFactoryProviders.dart';
 
 $!GENERATED_DART_FILES
 // FIXME: Can we make this private?
+@Deprecated("Internal Use Only")
 final svgBlinkMap = {
 $!TYPE_MAP
 };
 
 $if JSINTEROP
 // FIXME: Can we make this private?
+@Deprecated("Internal Use Only")
 final svgBlinkFunctionMap = {
 $!TYPE_FUNCTION_MAP
 };
diff --git a/tools/dom/templates/html/dartium/web_audio_dartium.darttemplate b/tools/dom/templates/html/dartium/web_audio_dartium.darttemplate
index c79c9d4..43b42c9 100644
--- a/tools/dom/templates/html/dartium/web_audio_dartium.darttemplate
+++ b/tools/dom/templates/html/dartium/web_audio_dartium.darttemplate
@@ -8,21 +8,24 @@
 
 import 'dart:async';
 import 'dart:collection';
-import 'dart:_internal' hide deprecated;
+import 'dart:_internal';
 import 'dart:html';
 import 'dart:html_common';
 import 'dart:nativewrappers';
 import 'dart:typed_data';
 import 'dart:_blink' as _blink;
+import 'dart:js' as js;
 
 $!GENERATED_DART_FILES
 // FIXME: Can we make this private?
+@Deprecated("Internal Use Only")
 final web_audioBlinkMap = {
 $!TYPE_MAP
 };
 
 $if JSINTEROP
 // FIXME: Can we make this private?
+@Deprecated("Internal Use Only")
 final web_audioBlinkFunctionMap = {
 $!TYPE_FUNCTION_MAP
 };
diff --git a/tools/dom/templates/html/dartium/web_gl_dartium.darttemplate b/tools/dom/templates/html/dartium/web_gl_dartium.darttemplate
index 5f12a23..7cc4289 100644
--- a/tools/dom/templates/html/dartium/web_gl_dartium.darttemplate
+++ b/tools/dom/templates/html/dartium/web_gl_dartium.darttemplate
@@ -8,23 +8,26 @@
 
 import 'dart:async';
 import 'dart:collection';
-import 'dart:_internal' hide deprecated;
+import 'dart:_internal';
 import 'dart:html';
 import 'dart:html_common';
 import 'dart:nativewrappers';
 import 'dart:typed_data';
 import 'dart:_blink' as _blink;
+import 'dart:js' as js;
 
 part '$AUXILIARY_DIR/WebGLConstants.dart';
 
 $!GENERATED_DART_FILES
 // FIXME: Can we make this private?
+@Deprecated("Internal Use Only")
 final web_glBlinkMap = {
 $!TYPE_MAP
 };
 
 $if JSINTEROP
 // FIXME: Can we make this private?
+@Deprecated("Internal Use Only")
 final web_glBlinkFunctionMap = {
 $!TYPE_FUNCTION_MAP
 };
diff --git a/tools/dom/templates/html/dartium/web_sql_dartium.darttemplate b/tools/dom/templates/html/dartium/web_sql_dartium.darttemplate
index 9823042..21ef127 100644
--- a/tools/dom/templates/html/dartium/web_sql_dartium.darttemplate
+++ b/tools/dom/templates/html/dartium/web_sql_dartium.darttemplate
@@ -1,3 +1,4 @@
+
 // DO NOT EDIT - unless you are editing documentation as per:
 // https://code.google.com/p/dart/wiki/ContributingHTMLDocumentation
 // Auto-generated dart:audio library.
@@ -16,20 +17,23 @@
 
 import 'dart:async';
 import 'dart:collection';
-import 'dart:_internal' hide deprecated;
+import 'dart:_internal';
 import 'dart:html';
 import 'dart:html_common';
 import 'dart:nativewrappers';
 import 'dart:_blink' as _blink;
+import 'dart:js' as js;
 
 $!GENERATED_DART_FILES
 // FIXME: Can we make this private?
+@Deprecated("Internal Use Only")
 final web_sqlBlinkMap = {
 $!TYPE_MAP
 };
 
 $if JSINTEROP
 // FIXME: Can we make this private?
+@Deprecated("Internal Use Only")
 final web_sqlBlinkFunctionMap = {
 $!TYPE_FUNCTION_MAP
 };
diff --git a/tools/dom/templates/html/impl/impl_Blob.darttemplate b/tools/dom/templates/html/impl/impl_Blob.darttemplate
index 3542811..0b12452 100644
--- a/tools/dom/templates/html/impl/impl_Blob.darttemplate
+++ b/tools/dom/templates/html/impl/impl_Blob.darttemplate
@@ -25,5 +25,22 @@
 
   static _create_bag() => JS('var', '{}');
   static _bag_set(bag, key, value) { JS('void', '#[#] = #', bag, key, value); }
+$else
+  $if JSINTEROP
+  factory Blob(List blobParts, [String type, String endings]) {
+    // TODO: any coercions on the elements of blobParts, e.g. coerce a typed
+    // array to ArrayBuffer if it is a total view.
+
+    var parts = convertDartToNative_List(blobParts.map(unwrap_jso).toList());
+    if (type == null && endings == null) {
+      return wrap_jso(_blink.BlinkBlob.instance.constructorCallback_1_(parts));
+    }
+    var bag = {};
+    if (type != null) bag['type'] = type;
+    if (endings != null) bag['endings'] = endings;
+    return wrap_jso(_blink.BlinkBlob.instance.constructorCallback_2_(parts,
+        convertDartToNative_Dictionary(bag)));
+  }
+  $endif
 $endif
 }
diff --git a/tools/dom/templates/html/impl/impl_CSSStyleDeclaration.darttemplate b/tools/dom/templates/html/impl/impl_CSSStyleDeclaration.darttemplate
index 12caf8c..7cb4628 100644
--- a/tools/dom/templates/html/impl/impl_CSSStyleDeclaration.darttemplate
+++ b/tools/dom/templates/html/impl/impl_CSSStyleDeclaration.darttemplate
@@ -11,18 +11,8 @@
 
 part of $LIBRARYNAME;
 
-$if DART2JS
 $(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME $EXTENDS with
     $(CLASSNAME)Base $IMPLEMENTS {
-$else
-  $if JSINTEROP
-$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS) class $CLASSNAME extends
-    $(CLASSNAME)Base $IMPLEMENTS {
-  $else
-$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME $EXTENDS with
-    $(CLASSNAME)Base $IMPLEMENTS {
-  $endif
-$endif
   factory $CLASSNAME() => new CssStyleDeclaration.css('');
 
   factory $CLASSNAME.css(String css) {
@@ -157,7 +147,7 @@
   String get background => this._background;
 
   /** Sets the value of "background" */
-  void set background(String value) {
+  set background(String value) {
     _background = value == null ? '' : value;
   }
   @Returns('String')
@@ -168,7 +158,7 @@
   String get backgroundAttachment => this._backgroundAttachment;
 
   /** Sets the value of "background-attachment" */
-  void set backgroundAttachment(String value) {
+  set backgroundAttachment(String value) {
     _backgroundAttachment = value == null ? '' : value;
   }
   @Returns('String')
@@ -179,7 +169,7 @@
   String get backgroundColor => this._backgroundColor;
 
   /** Sets the value of "background-color" */
-  void set backgroundColor(String value) {
+  set backgroundColor(String value) {
     _backgroundColor = value == null ? '' : value;
   }
   @Returns('String')
@@ -190,7 +180,7 @@
   String get backgroundImage => this._backgroundImage;
 
   /** Sets the value of "background-image" */
-  void set backgroundImage(String value) {
+  set backgroundImage(String value) {
     _backgroundImage = value == null ? '' : value;
   }
   @Returns('String')
@@ -201,7 +191,7 @@
   String get backgroundPosition => this._backgroundPosition;
 
   /** Sets the value of "background-position" */
-  void set backgroundPosition(String value) {
+  set backgroundPosition(String value) {
     _backgroundPosition = value == null ? '' : value;
   }
   @Returns('String')
@@ -212,7 +202,7 @@
   String get backgroundRepeat => this._backgroundRepeat;
 
   /** Sets the value of "background-repeat" */
-  void set backgroundRepeat(String value) {
+  set backgroundRepeat(String value) {
     _backgroundRepeat = value == null ? '' : value;
   }
   @Returns('String')
@@ -223,7 +213,7 @@
   String get border => this._border;
 
   /** Sets the value of "border" */
-  void set border(String value) {
+  set border(String value) {
     _border = value == null ? '' : value;
   }
   @Returns('String')
@@ -234,7 +224,7 @@
   String get borderBottom => this._borderBottom;
 
   /** Sets the value of "border-bottom" */
-  void set borderBottom(String value) {
+  set borderBottom(String value) {
     _borderBottom = value == null ? '' : value;
   }
   @Returns('String')
@@ -245,7 +235,7 @@
   String get borderBottomColor => this._borderBottomColor;
 
   /** Sets the value of "border-bottom-color" */
-  void set borderBottomColor(String value) {
+  set borderBottomColor(String value) {
     _borderBottomColor = value == null ? '' : value;
   }
   @Returns('String')
@@ -256,7 +246,7 @@
   String get borderBottomStyle => this._borderBottomStyle;
 
   /** Sets the value of "border-bottom-style" */
-  void set borderBottomStyle(String value) {
+  set borderBottomStyle(String value) {
     _borderBottomStyle = value == null ? '' : value;
   }
   @Returns('String')
@@ -267,7 +257,7 @@
   String get borderBottomWidth => this._borderBottomWidth;
 
   /** Sets the value of "border-bottom-width" */
-  void set borderBottomWidth(String value) {
+  set borderBottomWidth(String value) {
     _borderBottomWidth = value == null ? '' : value;
   }
   @Returns('String')
@@ -278,7 +268,7 @@
   String get borderCollapse => this._borderCollapse;
 
   /** Sets the value of "border-collapse" */
-  void set borderCollapse(String value) {
+  set borderCollapse(String value) {
     _borderCollapse = value == null ? '' : value;
   }
   @Returns('String')
@@ -289,7 +279,7 @@
   String get borderColor => this._borderColor;
 
   /** Sets the value of "border-color" */
-  void set borderColor(String value) {
+  set borderColor(String value) {
     _borderColor = value == null ? '' : value;
   }
   @Returns('String')
@@ -300,7 +290,7 @@
   String get borderLeft => this._borderLeft;
 
   /** Sets the value of "border-left" */
-  void set borderLeft(String value) {
+  set borderLeft(String value) {
     _borderLeft = value == null ? '' : value;
   }
   @Returns('String')
@@ -311,7 +301,7 @@
   String get borderLeftColor => this._borderLeftColor;
 
   /** Sets the value of "border-left-color" */
-  void set borderLeftColor(String value) {
+  set borderLeftColor(String value) {
     _borderLeftColor = value == null ? '' : value;
   }
   @Returns('String')
@@ -322,7 +312,7 @@
   String get borderLeftStyle => this._borderLeftStyle;
 
   /** Sets the value of "border-left-style" */
-  void set borderLeftStyle(String value) {
+  set borderLeftStyle(String value) {
     _borderLeftStyle = value == null ? '' : value;
   }
   @Returns('String')
@@ -333,7 +323,7 @@
   String get borderLeftWidth => this._borderLeftWidth;
 
   /** Sets the value of "border-left-width" */
-  void set borderLeftWidth(String value) {
+  set borderLeftWidth(String value) {
     _borderLeftWidth = value == null ? '' : value;
   }
   @Returns('String')
@@ -344,7 +334,7 @@
   String get borderRight => this._borderRight;
 
   /** Sets the value of "border-right" */
-  void set borderRight(String value) {
+  set borderRight(String value) {
     _borderRight = value == null ? '' : value;
   }
   @Returns('String')
@@ -355,7 +345,7 @@
   String get borderRightColor => this._borderRightColor;
 
   /** Sets the value of "border-right-color" */
-  void set borderRightColor(String value) {
+  set borderRightColor(String value) {
     _borderRightColor = value == null ? '' : value;
   }
   @Returns('String')
@@ -366,7 +356,7 @@
   String get borderRightStyle => this._borderRightStyle;
 
   /** Sets the value of "border-right-style" */
-  void set borderRightStyle(String value) {
+  set borderRightStyle(String value) {
     _borderRightStyle = value == null ? '' : value;
   }
   @Returns('String')
@@ -377,7 +367,7 @@
   String get borderRightWidth => this._borderRightWidth;
 
   /** Sets the value of "border-right-width" */
-  void set borderRightWidth(String value) {
+  set borderRightWidth(String value) {
     _borderRightWidth = value == null ? '' : value;
   }
   @Returns('String')
@@ -388,7 +378,7 @@
   String get borderSpacing => this._borderSpacing;
 
   /** Sets the value of "border-spacing" */
-  void set borderSpacing(String value) {
+  set borderSpacing(String value) {
     _borderSpacing = value == null ? '' : value;
   }
   @Returns('String')
@@ -399,7 +389,7 @@
   String get borderStyle => this._borderStyle;
 
   /** Sets the value of "border-style" */
-  void set borderStyle(String value) {
+  set borderStyle(String value) {
     _borderStyle = value == null ? '' : value;
   }
   @Returns('String')
@@ -410,7 +400,7 @@
   String get borderTop => this._borderTop;
 
   /** Sets the value of "border-top" */
-  void set borderTop(String value) {
+  set borderTop(String value) {
     _borderTop = value == null ? '' : value;
   }
   @Returns('String')
@@ -421,7 +411,7 @@
   String get borderTopColor => this._borderTopColor;
 
   /** Sets the value of "border-top-color" */
-  void set borderTopColor(String value) {
+  set borderTopColor(String value) {
     _borderTopColor = value == null ? '' : value;
   }
   @Returns('String')
@@ -432,7 +422,7 @@
   String get borderTopStyle => this._borderTopStyle;
 
   /** Sets the value of "border-top-style" */
-  void set borderTopStyle(String value) {
+  set borderTopStyle(String value) {
     _borderTopStyle = value == null ? '' : value;
   }
   @Returns('String')
@@ -443,7 +433,7 @@
   String get borderTopWidth => this._borderTopWidth;
 
   /** Sets the value of "border-top-width" */
-  void set borderTopWidth(String value) {
+  set borderTopWidth(String value) {
     _borderTopWidth = value == null ? '' : value;
   }
   @Returns('String')
@@ -454,7 +444,7 @@
   String get borderWidth => this._borderWidth;
 
   /** Sets the value of "border-width" */
-  void set borderWidth(String value) {
+  set borderWidth(String value) {
     _borderWidth = value == null ? '' : value;
   }
   @Returns('String')
@@ -465,7 +455,7 @@
   String get bottom => this._bottom;
 
   /** Sets the value of "bottom" */
-  void set bottom(String value) {
+  set bottom(String value) {
     _bottom = value == null ? '' : value;
   }
   @Returns('String')
@@ -476,7 +466,7 @@
   String get captionSide => this._captionSide;
 
   /** Sets the value of "caption-side" */
-  void set captionSide(String value) {
+  set captionSide(String value) {
     _captionSide = value == null ? '' : value;
   }
   @Returns('String')
@@ -487,7 +477,7 @@
   String get clear => this._clear;
 
   /** Sets the value of "clear" */
-  void set clear(String value) {
+  set clear(String value) {
     _clear = value == null ? '' : value;
   }
   @Returns('String')
@@ -498,7 +488,7 @@
   String get clip => this._clip;
 
   /** Sets the value of "clip" */
-  void set clip(String value) {
+  set clip(String value) {
     _clip = value == null ? '' : value;
   }
   @Returns('String')
@@ -509,7 +499,7 @@
   String get color => this._color;
 
   /** Sets the value of "color" */
-  void set color(String value) {
+  set color(String value) {
     _color = value == null ? '' : value;
   }
   @Returns('String')
@@ -520,7 +510,7 @@
   String get content => this._content;
 
   /** Sets the value of "content" */
-  void set content(String value) {
+  set content(String value) {
     _content = value == null ? '' : value;
   }
   @Returns('String')
@@ -531,7 +521,7 @@
   String get cursor => this._cursor;
 
   /** Sets the value of "cursor" */
-  void set cursor(String value) {
+  set cursor(String value) {
     _cursor = value == null ? '' : value;
   }
   @Returns('String')
@@ -542,7 +532,7 @@
   String get direction => this._direction;
 
   /** Sets the value of "direction" */
-  void set direction(String value) {
+  set direction(String value) {
     _direction = value == null ? '' : value;
   }
   @Returns('String')
@@ -553,7 +543,7 @@
   String get display => this._display;
 
   /** Sets the value of "display" */
-  void set display(String value) {
+  set display(String value) {
     _display = value == null ? '' : value;
   }
   @Returns('String')
@@ -564,7 +554,7 @@
   String get emptyCells => this._emptyCells;
 
   /** Sets the value of "empty-cells" */
-  void set emptyCells(String value) {
+  set emptyCells(String value) {
     _emptyCells = value == null ? '' : value;
   }
   @Returns('String')
@@ -575,7 +565,7 @@
   String get font => this._font;
 
   /** Sets the value of "font" */
-  void set font(String value) {
+  set font(String value) {
     _font = value == null ? '' : value;
   }
   @Returns('String')
@@ -586,7 +576,7 @@
   String get fontFamily => this._fontFamily;
 
   /** Sets the value of "font-family" */
-  void set fontFamily(String value) {
+  set fontFamily(String value) {
     _fontFamily = value == null ? '' : value;
   }
   @Returns('String')
@@ -597,7 +587,7 @@
   String get fontSize => this._fontSize;
 
   /** Sets the value of "font-size" */
-  void set fontSize(String value) {
+  set fontSize(String value) {
     _fontSize = value == null ? '' : value;
   }
   @Returns('String')
@@ -608,7 +598,7 @@
   String get fontStyle => this._fontStyle;
 
   /** Sets the value of "font-style" */
-  void set fontStyle(String value) {
+  set fontStyle(String value) {
     _fontStyle = value == null ? '' : value;
   }
   @Returns('String')
@@ -619,7 +609,7 @@
   String get fontVariant => this._fontVariant;
 
   /** Sets the value of "font-variant" */
-  void set fontVariant(String value) {
+  set fontVariant(String value) {
     _fontVariant = value == null ? '' : value;
   }
   @Returns('String')
@@ -630,7 +620,7 @@
   String get fontWeight => this._fontWeight;
 
   /** Sets the value of "font-weight" */
-  void set fontWeight(String value) {
+  set fontWeight(String value) {
     _fontWeight = value == null ? '' : value;
   }
   @Returns('String')
@@ -641,7 +631,7 @@
   String get height => this._height;
 
   /** Sets the value of "height" */
-  void set height(String value) {
+  set height(String value) {
     _height = value == null ? '' : value;
   }
   @Returns('String')
@@ -652,7 +642,7 @@
   String get left => this._left;
 
   /** Sets the value of "left" */
-  void set left(String value) {
+  set left(String value) {
     _left = value == null ? '' : value;
   }
   @Returns('String')
@@ -663,7 +653,7 @@
   String get letterSpacing => this._letterSpacing;
 
   /** Sets the value of "letter-spacing" */
-  void set letterSpacing(String value) {
+  set letterSpacing(String value) {
     _letterSpacing = value == null ? '' : value;
   }
   @Returns('String')
@@ -674,7 +664,7 @@
   String get lineHeight => this._lineHeight;
 
   /** Sets the value of "line-height" */
-  void set lineHeight(String value) {
+  set lineHeight(String value) {
     _lineHeight = value == null ? '' : value;
   }
   @Returns('String')
@@ -685,7 +675,7 @@
   String get listStyle => this._listStyle;
 
   /** Sets the value of "list-style" */
-  void set listStyle(String value) {
+  set listStyle(String value) {
     _listStyle = value == null ? '' : value;
   }
   @Returns('String')
@@ -696,7 +686,7 @@
   String get listStyleImage => this._listStyleImage;
 
   /** Sets the value of "list-style-image" */
-  void set listStyleImage(String value) {
+  set listStyleImage(String value) {
     _listStyleImage = value == null ? '' : value;
   }
   @Returns('String')
@@ -707,7 +697,7 @@
   String get listStylePosition => this._listStylePosition;
 
   /** Sets the value of "list-style-position" */
-  void set listStylePosition(String value) {
+  set listStylePosition(String value) {
     _listStylePosition = value == null ? '' : value;
   }
   @Returns('String')
@@ -718,7 +708,7 @@
   String get listStyleType => this._listStyleType;
 
   /** Sets the value of "list-style-type" */
-  void set listStyleType(String value) {
+  set listStyleType(String value) {
     _listStyleType = value == null ? '' : value;
   }
   @Returns('String')
@@ -729,7 +719,7 @@
   String get margin => this._margin;
 
   /** Sets the value of "margin" */
-  void set margin(String value) {
+  set margin(String value) {
     _margin = value == null ? '' : value;
   }
   @Returns('String')
@@ -740,7 +730,7 @@
   String get marginBottom => this._marginBottom;
 
   /** Sets the value of "margin-bottom" */
-  void set marginBottom(String value) {
+  set marginBottom(String value) {
     _marginBottom = value == null ? '' : value;
   }
   @Returns('String')
@@ -751,7 +741,7 @@
   String get marginLeft => this._marginLeft;
 
   /** Sets the value of "margin-left" */
-  void set marginLeft(String value) {
+  set marginLeft(String value) {
     _marginLeft = value == null ? '' : value;
   }
   @Returns('String')
@@ -762,7 +752,7 @@
   String get marginRight => this._marginRight;
 
   /** Sets the value of "margin-right" */
-  void set marginRight(String value) {
+  set marginRight(String value) {
     _marginRight = value == null ? '' : value;
   }
   @Returns('String')
@@ -773,7 +763,7 @@
   String get marginTop => this._marginTop;
 
   /** Sets the value of "margin-top" */
-  void set marginTop(String value) {
+  set marginTop(String value) {
     _marginTop = value == null ? '' : value;
   }
   @Returns('String')
@@ -784,7 +774,7 @@
   String get maxHeight => this._maxHeight;
 
   /** Sets the value of "max-height" */
-  void set maxHeight(String value) {
+  set maxHeight(String value) {
     _maxHeight = value == null ? '' : value;
   }
   @Returns('String')
@@ -795,7 +785,7 @@
   String get maxWidth => this._maxWidth;
 
   /** Sets the value of "max-width" */
-  void set maxWidth(String value) {
+  set maxWidth(String value) {
     _maxWidth = value == null ? '' : value;
   }
   @Returns('String')
@@ -806,7 +796,7 @@
   String get minHeight => this._minHeight;
 
   /** Sets the value of "min-height" */
-  void set minHeight(String value) {
+  set minHeight(String value) {
     _minHeight = value == null ? '' : value;
   }
   @Returns('String')
@@ -817,7 +807,7 @@
   String get minWidth => this._minWidth;
 
   /** Sets the value of "min-width" */
-  void set minWidth(String value) {
+  set minWidth(String value) {
     _minWidth = value == null ? '' : value;
   }
   @Returns('String')
@@ -828,7 +818,7 @@
   String get outline => this._outline;
 
   /** Sets the value of "outline" */
-  void set outline(String value) {
+  set outline(String value) {
     _outline = value == null ? '' : value;
   }
   @Returns('String')
@@ -839,7 +829,7 @@
   String get outlineColor => this._outlineColor;
 
   /** Sets the value of "outline-color" */
-  void set outlineColor(String value) {
+  set outlineColor(String value) {
     _outlineColor = value == null ? '' : value;
   }
   @Returns('String')
@@ -850,7 +840,7 @@
   String get outlineStyle => this._outlineStyle;
 
   /** Sets the value of "outline-style" */
-  void set outlineStyle(String value) {
+  set outlineStyle(String value) {
     _outlineStyle = value == null ? '' : value;
   }
   @Returns('String')
@@ -861,7 +851,7 @@
   String get outlineWidth => this._outlineWidth;
 
   /** Sets the value of "outline-width" */
-  void set outlineWidth(String value) {
+  set outlineWidth(String value) {
     _outlineWidth = value == null ? '' : value;
   }
   @Returns('String')
@@ -872,7 +862,7 @@
   String get overflow => this._overflow;
 
   /** Sets the value of "overflow" */
-  void set overflow(String value) {
+  set overflow(String value) {
     _overflow = value == null ? '' : value;
   }
   @Returns('String')
@@ -883,7 +873,7 @@
   String get padding => this._padding;
 
   /** Sets the value of "padding" */
-  void set padding(String value) {
+  set padding(String value) {
     _padding = value == null ? '' : value;
   }
   @Returns('String')
@@ -894,7 +884,7 @@
   String get paddingBottom => this._paddingBottom;
 
   /** Sets the value of "padding-bottom" */
-  void set paddingBottom(String value) {
+  set paddingBottom(String value) {
     _paddingBottom = value == null ? '' : value;
   }
   @Returns('String')
@@ -905,7 +895,7 @@
   String get paddingLeft => this._paddingLeft;
 
   /** Sets the value of "padding-left" */
-  void set paddingLeft(String value) {
+  set paddingLeft(String value) {
     _paddingLeft = value == null ? '' : value;
   }
   @Returns('String')
@@ -916,7 +906,7 @@
   String get paddingRight => this._paddingRight;
 
   /** Sets the value of "padding-right" */
-  void set paddingRight(String value) {
+  set paddingRight(String value) {
     _paddingRight = value == null ? '' : value;
   }
   @Returns('String')
@@ -927,7 +917,7 @@
   String get paddingTop => this._paddingTop;
 
   /** Sets the value of "padding-top" */
-  void set paddingTop(String value) {
+  set paddingTop(String value) {
     _paddingTop = value == null ? '' : value;
   }
   @Returns('String')
@@ -938,7 +928,7 @@
   String get pageBreakAfter => this._pageBreakAfter;
 
   /** Sets the value of "page-break-after" */
-  void set pageBreakAfter(String value) {
+  set pageBreakAfter(String value) {
     _pageBreakAfter = value == null ? '' : value;
   }
   @Returns('String')
@@ -949,7 +939,7 @@
   String get pageBreakBefore => this._pageBreakBefore;
 
   /** Sets the value of "page-break-before" */
-  void set pageBreakBefore(String value) {
+  set pageBreakBefore(String value) {
     _pageBreakBefore = value == null ? '' : value;
   }
   @Returns('String')
@@ -960,7 +950,7 @@
   String get pageBreakInside => this._pageBreakInside;
 
   /** Sets the value of "page-break-inside" */
-  void set pageBreakInside(String value) {
+  set pageBreakInside(String value) {
     _pageBreakInside = value == null ? '' : value;
   }
   @Returns('String')
@@ -971,7 +961,7 @@
   String get position => this._position;
 
   /** Sets the value of "position" */
-  void set position(String value) {
+  set position(String value) {
     _position = value == null ? '' : value;
   }
   @Returns('String')
@@ -982,7 +972,7 @@
   String get quotes => this._quotes;
 
   /** Sets the value of "quotes" */
-  void set quotes(String value) {
+  set quotes(String value) {
     _quotes = value == null ? '' : value;
   }
   @Returns('String')
@@ -993,7 +983,7 @@
   String get right => this._right;
 
   /** Sets the value of "right" */
-  void set right(String value) {
+  set right(String value) {
     _right = value == null ? '' : value;
   }
   @Returns('String')
@@ -1004,7 +994,7 @@
   String get tableLayout => this._tableLayout;
 
   /** Sets the value of "table-layout" */
-  void set tableLayout(String value) {
+  set tableLayout(String value) {
     _tableLayout = value == null ? '' : value;
   }
   @Returns('String')
@@ -1015,7 +1005,7 @@
   String get textAlign => this._textAlign;
 
   /** Sets the value of "text-align" */
-  void set textAlign(String value) {
+  set textAlign(String value) {
     _textAlign = value == null ? '' : value;
   }
   @Returns('String')
@@ -1026,7 +1016,7 @@
   String get textDecoration => this._textDecoration;
 
   /** Sets the value of "text-decoration" */
-  void set textDecoration(String value) {
+  set textDecoration(String value) {
     _textDecoration = value == null ? '' : value;
   }
   @Returns('String')
@@ -1037,7 +1027,7 @@
   String get textIndent => this._textIndent;
 
   /** Sets the value of "text-indent" */
-  void set textIndent(String value) {
+  set textIndent(String value) {
     _textIndent = value == null ? '' : value;
   }
   @Returns('String')
@@ -1048,7 +1038,7 @@
   String get textTransform => this._textTransform;
 
   /** Sets the value of "text-transform" */
-  void set textTransform(String value) {
+  set textTransform(String value) {
     _textTransform = value == null ? '' : value;
   }
   @Returns('String')
@@ -1059,7 +1049,7 @@
   String get top => this._top;
 
   /** Sets the value of "top" */
-  void set top(String value) {
+  set top(String value) {
     _top = value == null ? '' : value;
   }
   @Returns('String')
@@ -1070,7 +1060,7 @@
   String get unicodeBidi => this._unicodeBidi;
 
   /** Sets the value of "unicode-bidi" */
-  void set unicodeBidi(String value) {
+  set unicodeBidi(String value) {
     _unicodeBidi = value == null ? '' : value;
   }
   @Returns('String')
@@ -1081,7 +1071,7 @@
   String get verticalAlign => this._verticalAlign;
 
   /** Sets the value of "vertical-align" */
-  void set verticalAlign(String value) {
+  set verticalAlign(String value) {
     _verticalAlign = value == null ? '' : value;
   }
   @Returns('String')
@@ -1092,7 +1082,7 @@
   String get visibility => this._visibility;
 
   /** Sets the value of "visibility" */
-  void set visibility(String value) {
+  set visibility(String value) {
     _visibility = value == null ? '' : value;
   }
   @Returns('String')
@@ -1103,7 +1093,7 @@
   String get whiteSpace => this._whiteSpace;
 
   /** Sets the value of "white-space" */
-  void set whiteSpace(String value) {
+  set whiteSpace(String value) {
     _whiteSpace = value == null ? '' : value;
   }
   @Returns('String')
@@ -1114,7 +1104,7 @@
   String get width => this._width;
 
   /** Sets the value of "width" */
-  void set width(String value) {
+  set width(String value) {
     _width = value == null ? '' : value;
   }
   @Returns('String')
@@ -1125,7 +1115,7 @@
   String get wordSpacing => this._wordSpacing;
 
   /** Sets the value of "word-spacing" */
-  void set wordSpacing(String value) {
+  set wordSpacing(String value) {
     _wordSpacing = value == null ? '' : value;
   }
   @Returns('String')
@@ -1136,7 +1126,7 @@
   String get zIndex => this._zIndex;
 
   /** Sets the value of "z-index" */
-  void set zIndex(String value) {
+  set zIndex(String value) {
     _zIndex = value == null ? '' : value;
   }
   @Returns('String')
@@ -1146,15 +1136,7 @@
 $endif
 }
 
-$if DART2JS
 class _CssStyleDeclarationSet extends Object with CssStyleDeclarationBase {
-$else
-  $if JSINTEROP
-class _CssStyleDeclarationSet extends CssStyleDeclarationBase {
-  $else
-class _CssStyleDeclarationSet extends Object with CssStyleDeclarationBase {
-  $endif
-$endif
   final Iterable<Element> _elementIterable;
   Iterable<CssStyleDeclaration> _elementCssStyleDeclarationSetIterable;
 
@@ -1182,452 +1164,452 @@
   }
 
   /** Sets the value of "background" */
-  void set background(String value) {
+  set background(String value) {
     _setAll('background', value);
   }
     
   /** Sets the value of "background-attachment" */
-  void set backgroundAttachment(String value) {
+  set backgroundAttachment(String value) {
     _setAll('backgroundAttachment', value);
   }
     
   /** Sets the value of "background-color" */
-  void set backgroundColor(String value) {
+  set backgroundColor(String value) {
     _setAll('backgroundColor', value);
   }
     
   /** Sets the value of "background-image" */
-  void set backgroundImage(String value) {
+  set backgroundImage(String value) {
     _setAll('backgroundImage', value);
   }
     
   /** Sets the value of "background-position" */
-  void set backgroundPosition(String value) {
+  set backgroundPosition(String value) {
     _setAll('backgroundPosition', value);
   }
     
   /** Sets the value of "background-repeat" */
-  void set backgroundRepeat(String value) {
+  set backgroundRepeat(String value) {
     _setAll('backgroundRepeat', value);
   }
     
   /** Sets the value of "border" */
-  void set border(String value) {
+  set border(String value) {
     _setAll('border', value);
   }
     
   /** Sets the value of "border-bottom" */
-  void set borderBottom(String value) {
+  set borderBottom(String value) {
     _setAll('borderBottom', value);
   }
     
   /** Sets the value of "border-bottom-color" */
-  void set borderBottomColor(String value) {
+  set borderBottomColor(String value) {
     _setAll('borderBottomColor', value);
   }
     
   /** Sets the value of "border-bottom-style" */
-  void set borderBottomStyle(String value) {
+  set borderBottomStyle(String value) {
     _setAll('borderBottomStyle', value);
   }
     
   /** Sets the value of "border-bottom-width" */
-  void set borderBottomWidth(String value) {
+  set borderBottomWidth(String value) {
     _setAll('borderBottomWidth', value);
   }
     
   /** Sets the value of "border-collapse" */
-  void set borderCollapse(String value) {
+  set borderCollapse(String value) {
     _setAll('borderCollapse', value);
   }
     
   /** Sets the value of "border-color" */
-  void set borderColor(String value) {
+  set borderColor(String value) {
     _setAll('borderColor', value);
   }
     
   /** Sets the value of "border-left" */
-  void set borderLeft(String value) {
+  set borderLeft(String value) {
     _setAll('borderLeft', value);
   }
     
   /** Sets the value of "border-left-color" */
-  void set borderLeftColor(String value) {
+  set borderLeftColor(String value) {
     _setAll('borderLeftColor', value);
   }
     
   /** Sets the value of "border-left-style" */
-  void set borderLeftStyle(String value) {
+  set borderLeftStyle(String value) {
     _setAll('borderLeftStyle', value);
   }
     
   /** Sets the value of "border-left-width" */
-  void set borderLeftWidth(String value) {
+  set borderLeftWidth(String value) {
     _setAll('borderLeftWidth', value);
   }
     
   /** Sets the value of "border-right" */
-  void set borderRight(String value) {
+  set borderRight(String value) {
     _setAll('borderRight', value);
   }
     
   /** Sets the value of "border-right-color" */
-  void set borderRightColor(String value) {
+  set borderRightColor(String value) {
     _setAll('borderRightColor', value);
   }
     
   /** Sets the value of "border-right-style" */
-  void set borderRightStyle(String value) {
+  set borderRightStyle(String value) {
     _setAll('borderRightStyle', value);
   }
     
   /** Sets the value of "border-right-width" */
-  void set borderRightWidth(String value) {
+  set borderRightWidth(String value) {
     _setAll('borderRightWidth', value);
   }
     
   /** Sets the value of "border-spacing" */
-  void set borderSpacing(String value) {
+  set borderSpacing(String value) {
     _setAll('borderSpacing', value);
   }
     
   /** Sets the value of "border-style" */
-  void set borderStyle(String value) {
+  set borderStyle(String value) {
     _setAll('borderStyle', value);
   }
     
   /** Sets the value of "border-top" */
-  void set borderTop(String value) {
+  set borderTop(String value) {
     _setAll('borderTop', value);
   }
     
   /** Sets the value of "border-top-color" */
-  void set borderTopColor(String value) {
+  set borderTopColor(String value) {
     _setAll('borderTopColor', value);
   }
     
   /** Sets the value of "border-top-style" */
-  void set borderTopStyle(String value) {
+  set borderTopStyle(String value) {
     _setAll('borderTopStyle', value);
   }
     
   /** Sets the value of "border-top-width" */
-  void set borderTopWidth(String value) {
+  set borderTopWidth(String value) {
     _setAll('borderTopWidth', value);
   }
     
   /** Sets the value of "border-width" */
-  void set borderWidth(String value) {
+  set borderWidth(String value) {
     _setAll('borderWidth', value);
   }
     
   /** Sets the value of "bottom" */
-  void set bottom(String value) {
+  set bottom(String value) {
     _setAll('bottom', value);
   }
     
   /** Sets the value of "caption-side" */
-  void set captionSide(String value) {
+  set captionSide(String value) {
     _setAll('captionSide', value);
   }
     
   /** Sets the value of "clear" */
-  void set clear(String value) {
+  set clear(String value) {
     _setAll('clear', value);
   }
     
   /** Sets the value of "clip" */
-  void set clip(String value) {
+  set clip(String value) {
     _setAll('clip', value);
   }
     
   /** Sets the value of "color" */
-  void set color(String value) {
+  set color(String value) {
     _setAll('color', value);
   }
     
   /** Sets the value of "content" */
-  void set content(String value) {
+  set content(String value) {
     _setAll('content', value);
   }
     
   /** Sets the value of "cursor" */
-  void set cursor(String value) {
+  set cursor(String value) {
     _setAll('cursor', value);
   }
     
   /** Sets the value of "direction" */
-  void set direction(String value) {
+  set direction(String value) {
     _setAll('direction', value);
   }
     
   /** Sets the value of "display" */
-  void set display(String value) {
+  set display(String value) {
     _setAll('display', value);
   }
     
   /** Sets the value of "empty-cells" */
-  void set emptyCells(String value) {
+  set emptyCells(String value) {
     _setAll('emptyCells', value);
   }
     
   /** Sets the value of "font" */
-  void set font(String value) {
+  set font(String value) {
     _setAll('font', value);
   }
     
   /** Sets the value of "font-family" */
-  void set fontFamily(String value) {
+  set fontFamily(String value) {
     _setAll('fontFamily', value);
   }
     
   /** Sets the value of "font-size" */
-  void set fontSize(String value) {
+  set fontSize(String value) {
     _setAll('fontSize', value);
   }
     
   /** Sets the value of "font-style" */
-  void set fontStyle(String value) {
+  set fontStyle(String value) {
     _setAll('fontStyle', value);
   }
     
   /** Sets the value of "font-variant" */
-  void set fontVariant(String value) {
+  set fontVariant(String value) {
     _setAll('fontVariant', value);
   }
     
   /** Sets the value of "font-weight" */
-  void set fontWeight(String value) {
+  set fontWeight(String value) {
     _setAll('fontWeight', value);
   }
     
   /** Sets the value of "height" */
-  void set height(String value) {
+  set height(String value) {
     _setAll('height', value);
   }
     
   /** Sets the value of "left" */
-  void set left(String value) {
+  set left(String value) {
     _setAll('left', value);
   }
     
   /** Sets the value of "letter-spacing" */
-  void set letterSpacing(String value) {
+  set letterSpacing(String value) {
     _setAll('letterSpacing', value);
   }
     
   /** Sets the value of "line-height" */
-  void set lineHeight(String value) {
+  set lineHeight(String value) {
     _setAll('lineHeight', value);
   }
     
   /** Sets the value of "list-style" */
-  void set listStyle(String value) {
+  set listStyle(String value) {
     _setAll('listStyle', value);
   }
     
   /** Sets the value of "list-style-image" */
-  void set listStyleImage(String value) {
+  set listStyleImage(String value) {
     _setAll('listStyleImage', value);
   }
     
   /** Sets the value of "list-style-position" */
-  void set listStylePosition(String value) {
+  set listStylePosition(String value) {
     _setAll('listStylePosition', value);
   }
     
   /** Sets the value of "list-style-type" */
-  void set listStyleType(String value) {
+  set listStyleType(String value) {
     _setAll('listStyleType', value);
   }
     
   /** Sets the value of "margin" */
-  void set margin(String value) {
+  set margin(String value) {
     _setAll('margin', value);
   }
     
   /** Sets the value of "margin-bottom" */
-  void set marginBottom(String value) {
+  set marginBottom(String value) {
     _setAll('marginBottom', value);
   }
     
   /** Sets the value of "margin-left" */
-  void set marginLeft(String value) {
+  set marginLeft(String value) {
     _setAll('marginLeft', value);
   }
     
   /** Sets the value of "margin-right" */
-  void set marginRight(String value) {
+  set marginRight(String value) {
     _setAll('marginRight', value);
   }
     
   /** Sets the value of "margin-top" */
-  void set marginTop(String value) {
+  set marginTop(String value) {
     _setAll('marginTop', value);
   }
     
   /** Sets the value of "max-height" */
-  void set maxHeight(String value) {
+  set maxHeight(String value) {
     _setAll('maxHeight', value);
   }
     
   /** Sets the value of "max-width" */
-  void set maxWidth(String value) {
+  set maxWidth(String value) {
     _setAll('maxWidth', value);
   }
     
   /** Sets the value of "min-height" */
-  void set minHeight(String value) {
+  set minHeight(String value) {
     _setAll('minHeight', value);
   }
     
   /** Sets the value of "min-width" */
-  void set minWidth(String value) {
+  set minWidth(String value) {
     _setAll('minWidth', value);
   }
     
   /** Sets the value of "outline" */
-  void set outline(String value) {
+  set outline(String value) {
     _setAll('outline', value);
   }
     
   /** Sets the value of "outline-color" */
-  void set outlineColor(String value) {
+  set outlineColor(String value) {
     _setAll('outlineColor', value);
   }
     
   /** Sets the value of "outline-style" */
-  void set outlineStyle(String value) {
+  set outlineStyle(String value) {
     _setAll('outlineStyle', value);
   }
     
   /** Sets the value of "outline-width" */
-  void set outlineWidth(String value) {
+  set outlineWidth(String value) {
     _setAll('outlineWidth', value);
   }
     
   /** Sets the value of "overflow" */
-  void set overflow(String value) {
+  set overflow(String value) {
     _setAll('overflow', value);
   }
     
   /** Sets the value of "padding" */
-  void set padding(String value) {
+  set padding(String value) {
     _setAll('padding', value);
   }
     
   /** Sets the value of "padding-bottom" */
-  void set paddingBottom(String value) {
+  set paddingBottom(String value) {
     _setAll('paddingBottom', value);
   }
     
   /** Sets the value of "padding-left" */
-  void set paddingLeft(String value) {
+  set paddingLeft(String value) {
     _setAll('paddingLeft', value);
   }
     
   /** Sets the value of "padding-right" */
-  void set paddingRight(String value) {
+  set paddingRight(String value) {
     _setAll('paddingRight', value);
   }
     
   /** Sets the value of "padding-top" */
-  void set paddingTop(String value) {
+  set paddingTop(String value) {
     _setAll('paddingTop', value);
   }
     
   /** Sets the value of "page-break-after" */
-  void set pageBreakAfter(String value) {
+  set pageBreakAfter(String value) {
     _setAll('pageBreakAfter', value);
   }
     
   /** Sets the value of "page-break-before" */
-  void set pageBreakBefore(String value) {
+  set pageBreakBefore(String value) {
     _setAll('pageBreakBefore', value);
   }
     
   /** Sets the value of "page-break-inside" */
-  void set pageBreakInside(String value) {
+  set pageBreakInside(String value) {
     _setAll('pageBreakInside', value);
   }
     
   /** Sets the value of "position" */
-  void set position(String value) {
+  set position(String value) {
     _setAll('position', value);
   }
     
   /** Sets the value of "quotes" */
-  void set quotes(String value) {
+  set quotes(String value) {
     _setAll('quotes', value);
   }
     
   /** Sets the value of "right" */
-  void set right(String value) {
+  set right(String value) {
     _setAll('right', value);
   }
     
   /** Sets the value of "table-layout" */
-  void set tableLayout(String value) {
+  set tableLayout(String value) {
     _setAll('tableLayout', value);
   }
     
   /** Sets the value of "text-align" */
-  void set textAlign(String value) {
+  set textAlign(String value) {
     _setAll('textAlign', value);
   }
     
   /** Sets the value of "text-decoration" */
-  void set textDecoration(String value) {
+  set textDecoration(String value) {
     _setAll('textDecoration', value);
   }
     
   /** Sets the value of "text-indent" */
-  void set textIndent(String value) {
+  set textIndent(String value) {
     _setAll('textIndent', value);
   }
     
   /** Sets the value of "text-transform" */
-  void set textTransform(String value) {
+  set textTransform(String value) {
     _setAll('textTransform', value);
   }
     
   /** Sets the value of "top" */
-  void set top(String value) {
+  set top(String value) {
     _setAll('top', value);
   }
     
   /** Sets the value of "unicode-bidi" */
-  void set unicodeBidi(String value) {
+  set unicodeBidi(String value) {
     _setAll('unicodeBidi', value);
   }
     
   /** Sets the value of "vertical-align" */
-  void set verticalAlign(String value) {
+  set verticalAlign(String value) {
     _setAll('verticalAlign', value);
   }
     
   /** Sets the value of "visibility" */
-  void set visibility(String value) {
+  set visibility(String value) {
     _setAll('visibility', value);
   }
     
   /** Sets the value of "white-space" */
-  void set whiteSpace(String value) {
+  set whiteSpace(String value) {
     _setAll('whiteSpace', value);
   }
     
   /** Sets the value of "width" */
-  void set width(String value) {
+  set width(String value) {
     _setAll('width', value);
   }
     
   /** Sets the value of "word-spacing" */
-  void set wordSpacing(String value) {
+  set wordSpacing(String value) {
     _setAll('wordSpacing', value);
   }
     
   /** Sets the value of "z-index" */
-  void set zIndex(String value) {
+  set zIndex(String value) {
     _setAll('zIndex', value);
   }
     
@@ -1663,7 +1645,7 @@
     getPropertyValue('align-content');
 
   /** Sets the value of "align-content" */
-  void set alignContent(String value) {
+  set alignContent(String value) {
     setProperty('align-content', value, '');
   }
 
@@ -1672,7 +1654,7 @@
     getPropertyValue('align-items');
 
   /** Sets the value of "align-items" */
-  void set alignItems(String value) {
+  set alignItems(String value) {
     setProperty('align-items', value, '');
   }
 
@@ -1681,7 +1663,7 @@
     getPropertyValue('align-self');
 
   /** Sets the value of "align-self" */
-  void set alignSelf(String value) {
+  set alignSelf(String value) {
     setProperty('align-self', value, '');
   }
 
@@ -1690,7 +1672,7 @@
     getPropertyValue('animation');
 
   /** Sets the value of "animation" */
-  void set animation(String value) {
+  set animation(String value) {
     setProperty('animation', value, '');
   }
 
@@ -1699,7 +1681,7 @@
     getPropertyValue('animation-delay');
 
   /** Sets the value of "animation-delay" */
-  void set animationDelay(String value) {
+  set animationDelay(String value) {
     setProperty('animation-delay', value, '');
   }
 
@@ -1708,7 +1690,7 @@
     getPropertyValue('animation-direction');
 
   /** Sets the value of "animation-direction" */
-  void set animationDirection(String value) {
+  set animationDirection(String value) {
     setProperty('animation-direction', value, '');
   }
 
@@ -1717,7 +1699,7 @@
     getPropertyValue('animation-duration');
 
   /** Sets the value of "animation-duration" */
-  void set animationDuration(String value) {
+  set animationDuration(String value) {
     setProperty('animation-duration', value, '');
   }
 
@@ -1726,7 +1708,7 @@
     getPropertyValue('animation-fill-mode');
 
   /** Sets the value of "animation-fill-mode" */
-  void set animationFillMode(String value) {
+  set animationFillMode(String value) {
     setProperty('animation-fill-mode', value, '');
   }
 
@@ -1735,7 +1717,7 @@
     getPropertyValue('animation-iteration-count');
 
   /** Sets the value of "animation-iteration-count" */
-  void set animationIterationCount(String value) {
+  set animationIterationCount(String value) {
     setProperty('animation-iteration-count', value, '');
   }
 
@@ -1744,7 +1726,7 @@
     getPropertyValue('animation-name');
 
   /** Sets the value of "animation-name" */
-  void set animationName(String value) {
+  set animationName(String value) {
     setProperty('animation-name', value, '');
   }
 
@@ -1753,7 +1735,7 @@
     getPropertyValue('animation-play-state');
 
   /** Sets the value of "animation-play-state" */
-  void set animationPlayState(String value) {
+  set animationPlayState(String value) {
     setProperty('animation-play-state', value, '');
   }
 
@@ -1762,7 +1744,7 @@
     getPropertyValue('animation-timing-function');
 
   /** Sets the value of "animation-timing-function" */
-  void set animationTimingFunction(String value) {
+  set animationTimingFunction(String value) {
     setProperty('animation-timing-function', value, '');
   }
 
@@ -1771,7 +1753,7 @@
     getPropertyValue('app-region');
 
   /** Sets the value of "app-region" */
-  void set appRegion(String value) {
+  set appRegion(String value) {
     setProperty('app-region', value, '');
   }
 
@@ -1780,7 +1762,7 @@
     getPropertyValue('appearance');
 
   /** Sets the value of "appearance" */
-  void set appearance(String value) {
+  set appearance(String value) {
     setProperty('appearance', value, '');
   }
 
@@ -1789,7 +1771,7 @@
     getPropertyValue('aspect-ratio');
 
   /** Sets the value of "aspect-ratio" */
-  void set aspectRatio(String value) {
+  set aspectRatio(String value) {
     setProperty('aspect-ratio', value, '');
   }
 
@@ -1798,7 +1780,7 @@
     getPropertyValue('backface-visibility');
 
   /** Sets the value of "backface-visibility" */
-  void set backfaceVisibility(String value) {
+  set backfaceVisibility(String value) {
     setProperty('backface-visibility', value, '');
   }
 
@@ -1807,7 +1789,7 @@
     getPropertyValue('background');
 
   /** Sets the value of "background" */
-  void set background(String value) {
+  set background(String value) {
     setProperty('background', value, '');
   }
 
@@ -1816,7 +1798,7 @@
     getPropertyValue('background-attachment');
 
   /** Sets the value of "background-attachment" */
-  void set backgroundAttachment(String value) {
+  set backgroundAttachment(String value) {
     setProperty('background-attachment', value, '');
   }
 
@@ -1825,7 +1807,7 @@
     getPropertyValue('background-blend-mode');
 
   /** Sets the value of "background-blend-mode" */
-  void set backgroundBlendMode(String value) {
+  set backgroundBlendMode(String value) {
     setProperty('background-blend-mode', value, '');
   }
 
@@ -1834,7 +1816,7 @@
     getPropertyValue('background-clip');
 
   /** Sets the value of "background-clip" */
-  void set backgroundClip(String value) {
+  set backgroundClip(String value) {
     setProperty('background-clip', value, '');
   }
 
@@ -1843,7 +1825,7 @@
     getPropertyValue('background-color');
 
   /** Sets the value of "background-color" */
-  void set backgroundColor(String value) {
+  set backgroundColor(String value) {
     setProperty('background-color', value, '');
   }
 
@@ -1852,7 +1834,7 @@
     getPropertyValue('background-composite');
 
   /** Sets the value of "background-composite" */
-  void set backgroundComposite(String value) {
+  set backgroundComposite(String value) {
     setProperty('background-composite', value, '');
   }
 
@@ -1861,7 +1843,7 @@
     getPropertyValue('background-image');
 
   /** Sets the value of "background-image" */
-  void set backgroundImage(String value) {
+  set backgroundImage(String value) {
     setProperty('background-image', value, '');
   }
 
@@ -1870,7 +1852,7 @@
     getPropertyValue('background-origin');
 
   /** Sets the value of "background-origin" */
-  void set backgroundOrigin(String value) {
+  set backgroundOrigin(String value) {
     setProperty('background-origin', value, '');
   }
 
@@ -1879,7 +1861,7 @@
     getPropertyValue('background-position');
 
   /** Sets the value of "background-position" */
-  void set backgroundPosition(String value) {
+  set backgroundPosition(String value) {
     setProperty('background-position', value, '');
   }
 
@@ -1888,7 +1870,7 @@
     getPropertyValue('background-position-x');
 
   /** Sets the value of "background-position-x" */
-  void set backgroundPositionX(String value) {
+  set backgroundPositionX(String value) {
     setProperty('background-position-x', value, '');
   }
 
@@ -1897,7 +1879,7 @@
     getPropertyValue('background-position-y');
 
   /** Sets the value of "background-position-y" */
-  void set backgroundPositionY(String value) {
+  set backgroundPositionY(String value) {
     setProperty('background-position-y', value, '');
   }
 
@@ -1906,7 +1888,7 @@
     getPropertyValue('background-repeat');
 
   /** Sets the value of "background-repeat" */
-  void set backgroundRepeat(String value) {
+  set backgroundRepeat(String value) {
     setProperty('background-repeat', value, '');
   }
 
@@ -1915,7 +1897,7 @@
     getPropertyValue('background-repeat-x');
 
   /** Sets the value of "background-repeat-x" */
-  void set backgroundRepeatX(String value) {
+  set backgroundRepeatX(String value) {
     setProperty('background-repeat-x', value, '');
   }
 
@@ -1924,7 +1906,7 @@
     getPropertyValue('background-repeat-y');
 
   /** Sets the value of "background-repeat-y" */
-  void set backgroundRepeatY(String value) {
+  set backgroundRepeatY(String value) {
     setProperty('background-repeat-y', value, '');
   }
 
@@ -1933,7 +1915,7 @@
     getPropertyValue('background-size');
 
   /** Sets the value of "background-size" */
-  void set backgroundSize(String value) {
+  set backgroundSize(String value) {
     setProperty('background-size', value, '');
   }
 
@@ -1942,7 +1924,7 @@
     getPropertyValue('border');
 
   /** Sets the value of "border" */
-  void set border(String value) {
+  set border(String value) {
     setProperty('border', value, '');
   }
 
@@ -1951,7 +1933,7 @@
     getPropertyValue('border-after');
 
   /** Sets the value of "border-after" */
-  void set borderAfter(String value) {
+  set borderAfter(String value) {
     setProperty('border-after', value, '');
   }
 
@@ -1960,7 +1942,7 @@
     getPropertyValue('border-after-color');
 
   /** Sets the value of "border-after-color" */
-  void set borderAfterColor(String value) {
+  set borderAfterColor(String value) {
     setProperty('border-after-color', value, '');
   }
 
@@ -1969,7 +1951,7 @@
     getPropertyValue('border-after-style');
 
   /** Sets the value of "border-after-style" */
-  void set borderAfterStyle(String value) {
+  set borderAfterStyle(String value) {
     setProperty('border-after-style', value, '');
   }
 
@@ -1978,7 +1960,7 @@
     getPropertyValue('border-after-width');
 
   /** Sets the value of "border-after-width" */
-  void set borderAfterWidth(String value) {
+  set borderAfterWidth(String value) {
     setProperty('border-after-width', value, '');
   }
 
@@ -1987,7 +1969,7 @@
     getPropertyValue('border-before');
 
   /** Sets the value of "border-before" */
-  void set borderBefore(String value) {
+  set borderBefore(String value) {
     setProperty('border-before', value, '');
   }
 
@@ -1996,7 +1978,7 @@
     getPropertyValue('border-before-color');
 
   /** Sets the value of "border-before-color" */
-  void set borderBeforeColor(String value) {
+  set borderBeforeColor(String value) {
     setProperty('border-before-color', value, '');
   }
 
@@ -2005,7 +1987,7 @@
     getPropertyValue('border-before-style');
 
   /** Sets the value of "border-before-style" */
-  void set borderBeforeStyle(String value) {
+  set borderBeforeStyle(String value) {
     setProperty('border-before-style', value, '');
   }
 
@@ -2014,7 +1996,7 @@
     getPropertyValue('border-before-width');
 
   /** Sets the value of "border-before-width" */
-  void set borderBeforeWidth(String value) {
+  set borderBeforeWidth(String value) {
     setProperty('border-before-width', value, '');
   }
 
@@ -2023,7 +2005,7 @@
     getPropertyValue('border-bottom');
 
   /** Sets the value of "border-bottom" */
-  void set borderBottom(String value) {
+  set borderBottom(String value) {
     setProperty('border-bottom', value, '');
   }
 
@@ -2032,7 +2014,7 @@
     getPropertyValue('border-bottom-color');
 
   /** Sets the value of "border-bottom-color" */
-  void set borderBottomColor(String value) {
+  set borderBottomColor(String value) {
     setProperty('border-bottom-color', value, '');
   }
 
@@ -2041,7 +2023,7 @@
     getPropertyValue('border-bottom-left-radius');
 
   /** Sets the value of "border-bottom-left-radius" */
-  void set borderBottomLeftRadius(String value) {
+  set borderBottomLeftRadius(String value) {
     setProperty('border-bottom-left-radius', value, '');
   }
 
@@ -2050,7 +2032,7 @@
     getPropertyValue('border-bottom-right-radius');
 
   /** Sets the value of "border-bottom-right-radius" */
-  void set borderBottomRightRadius(String value) {
+  set borderBottomRightRadius(String value) {
     setProperty('border-bottom-right-radius', value, '');
   }
 
@@ -2059,7 +2041,7 @@
     getPropertyValue('border-bottom-style');
 
   /** Sets the value of "border-bottom-style" */
-  void set borderBottomStyle(String value) {
+  set borderBottomStyle(String value) {
     setProperty('border-bottom-style', value, '');
   }
 
@@ -2068,7 +2050,7 @@
     getPropertyValue('border-bottom-width');
 
   /** Sets the value of "border-bottom-width" */
-  void set borderBottomWidth(String value) {
+  set borderBottomWidth(String value) {
     setProperty('border-bottom-width', value, '');
   }
 
@@ -2077,7 +2059,7 @@
     getPropertyValue('border-collapse');
 
   /** Sets the value of "border-collapse" */
-  void set borderCollapse(String value) {
+  set borderCollapse(String value) {
     setProperty('border-collapse', value, '');
   }
 
@@ -2086,7 +2068,7 @@
     getPropertyValue('border-color');
 
   /** Sets the value of "border-color" */
-  void set borderColor(String value) {
+  set borderColor(String value) {
     setProperty('border-color', value, '');
   }
 
@@ -2095,7 +2077,7 @@
     getPropertyValue('border-end');
 
   /** Sets the value of "border-end" */
-  void set borderEnd(String value) {
+  set borderEnd(String value) {
     setProperty('border-end', value, '');
   }
 
@@ -2104,7 +2086,7 @@
     getPropertyValue('border-end-color');
 
   /** Sets the value of "border-end-color" */
-  void set borderEndColor(String value) {
+  set borderEndColor(String value) {
     setProperty('border-end-color', value, '');
   }
 
@@ -2113,7 +2095,7 @@
     getPropertyValue('border-end-style');
 
   /** Sets the value of "border-end-style" */
-  void set borderEndStyle(String value) {
+  set borderEndStyle(String value) {
     setProperty('border-end-style', value, '');
   }
 
@@ -2122,7 +2104,7 @@
     getPropertyValue('border-end-width');
 
   /** Sets the value of "border-end-width" */
-  void set borderEndWidth(String value) {
+  set borderEndWidth(String value) {
     setProperty('border-end-width', value, '');
   }
 
@@ -2131,7 +2113,7 @@
     getPropertyValue('border-fit');
 
   /** Sets the value of "border-fit" */
-  void set borderFit(String value) {
+  set borderFit(String value) {
     setProperty('border-fit', value, '');
   }
 
@@ -2140,7 +2122,7 @@
     getPropertyValue('border-horizontal-spacing');
 
   /** Sets the value of "border-horizontal-spacing" */
-  void set borderHorizontalSpacing(String value) {
+  set borderHorizontalSpacing(String value) {
     setProperty('border-horizontal-spacing', value, '');
   }
 
@@ -2149,7 +2131,7 @@
     getPropertyValue('border-image');
 
   /** Sets the value of "border-image" */
-  void set borderImage(String value) {
+  set borderImage(String value) {
     setProperty('border-image', value, '');
   }
 
@@ -2158,7 +2140,7 @@
     getPropertyValue('border-image-outset');
 
   /** Sets the value of "border-image-outset" */
-  void set borderImageOutset(String value) {
+  set borderImageOutset(String value) {
     setProperty('border-image-outset', value, '');
   }
 
@@ -2167,7 +2149,7 @@
     getPropertyValue('border-image-repeat');
 
   /** Sets the value of "border-image-repeat" */
-  void set borderImageRepeat(String value) {
+  set borderImageRepeat(String value) {
     setProperty('border-image-repeat', value, '');
   }
 
@@ -2176,7 +2158,7 @@
     getPropertyValue('border-image-slice');
 
   /** Sets the value of "border-image-slice" */
-  void set borderImageSlice(String value) {
+  set borderImageSlice(String value) {
     setProperty('border-image-slice', value, '');
   }
 
@@ -2185,7 +2167,7 @@
     getPropertyValue('border-image-source');
 
   /** Sets the value of "border-image-source" */
-  void set borderImageSource(String value) {
+  set borderImageSource(String value) {
     setProperty('border-image-source', value, '');
   }
 
@@ -2194,7 +2176,7 @@
     getPropertyValue('border-image-width');
 
   /** Sets the value of "border-image-width" */
-  void set borderImageWidth(String value) {
+  set borderImageWidth(String value) {
     setProperty('border-image-width', value, '');
   }
 
@@ -2203,7 +2185,7 @@
     getPropertyValue('border-left');
 
   /** Sets the value of "border-left" */
-  void set borderLeft(String value) {
+  set borderLeft(String value) {
     setProperty('border-left', value, '');
   }
 
@@ -2212,7 +2194,7 @@
     getPropertyValue('border-left-color');
 
   /** Sets the value of "border-left-color" */
-  void set borderLeftColor(String value) {
+  set borderLeftColor(String value) {
     setProperty('border-left-color', value, '');
   }
 
@@ -2221,7 +2203,7 @@
     getPropertyValue('border-left-style');
 
   /** Sets the value of "border-left-style" */
-  void set borderLeftStyle(String value) {
+  set borderLeftStyle(String value) {
     setProperty('border-left-style', value, '');
   }
 
@@ -2230,7 +2212,7 @@
     getPropertyValue('border-left-width');
 
   /** Sets the value of "border-left-width" */
-  void set borderLeftWidth(String value) {
+  set borderLeftWidth(String value) {
     setProperty('border-left-width', value, '');
   }
 
@@ -2239,7 +2221,7 @@
     getPropertyValue('border-radius');
 
   /** Sets the value of "border-radius" */
-  void set borderRadius(String value) {
+  set borderRadius(String value) {
     setProperty('border-radius', value, '');
   }
 
@@ -2248,7 +2230,7 @@
     getPropertyValue('border-right');
 
   /** Sets the value of "border-right" */
-  void set borderRight(String value) {
+  set borderRight(String value) {
     setProperty('border-right', value, '');
   }
 
@@ -2257,7 +2239,7 @@
     getPropertyValue('border-right-color');
 
   /** Sets the value of "border-right-color" */
-  void set borderRightColor(String value) {
+  set borderRightColor(String value) {
     setProperty('border-right-color', value, '');
   }
 
@@ -2266,7 +2248,7 @@
     getPropertyValue('border-right-style');
 
   /** Sets the value of "border-right-style" */
-  void set borderRightStyle(String value) {
+  set borderRightStyle(String value) {
     setProperty('border-right-style', value, '');
   }
 
@@ -2275,7 +2257,7 @@
     getPropertyValue('border-right-width');
 
   /** Sets the value of "border-right-width" */
-  void set borderRightWidth(String value) {
+  set borderRightWidth(String value) {
     setProperty('border-right-width', value, '');
   }
 
@@ -2284,7 +2266,7 @@
     getPropertyValue('border-spacing');
 
   /** Sets the value of "border-spacing" */
-  void set borderSpacing(String value) {
+  set borderSpacing(String value) {
     setProperty('border-spacing', value, '');
   }
 
@@ -2293,7 +2275,7 @@
     getPropertyValue('border-start');
 
   /** Sets the value of "border-start" */
-  void set borderStart(String value) {
+  set borderStart(String value) {
     setProperty('border-start', value, '');
   }
 
@@ -2302,7 +2284,7 @@
     getPropertyValue('border-start-color');
 
   /** Sets the value of "border-start-color" */
-  void set borderStartColor(String value) {
+  set borderStartColor(String value) {
     setProperty('border-start-color', value, '');
   }
 
@@ -2311,7 +2293,7 @@
     getPropertyValue('border-start-style');
 
   /** Sets the value of "border-start-style" */
-  void set borderStartStyle(String value) {
+  set borderStartStyle(String value) {
     setProperty('border-start-style', value, '');
   }
 
@@ -2320,7 +2302,7 @@
     getPropertyValue('border-start-width');
 
   /** Sets the value of "border-start-width" */
-  void set borderStartWidth(String value) {
+  set borderStartWidth(String value) {
     setProperty('border-start-width', value, '');
   }
 
@@ -2329,7 +2311,7 @@
     getPropertyValue('border-style');
 
   /** Sets the value of "border-style" */
-  void set borderStyle(String value) {
+  set borderStyle(String value) {
     setProperty('border-style', value, '');
   }
 
@@ -2338,7 +2320,7 @@
     getPropertyValue('border-top');
 
   /** Sets the value of "border-top" */
-  void set borderTop(String value) {
+  set borderTop(String value) {
     setProperty('border-top', value, '');
   }
 
@@ -2347,7 +2329,7 @@
     getPropertyValue('border-top-color');
 
   /** Sets the value of "border-top-color" */
-  void set borderTopColor(String value) {
+  set borderTopColor(String value) {
     setProperty('border-top-color', value, '');
   }
 
@@ -2356,7 +2338,7 @@
     getPropertyValue('border-top-left-radius');
 
   /** Sets the value of "border-top-left-radius" */
-  void set borderTopLeftRadius(String value) {
+  set borderTopLeftRadius(String value) {
     setProperty('border-top-left-radius', value, '');
   }
 
@@ -2365,7 +2347,7 @@
     getPropertyValue('border-top-right-radius');
 
   /** Sets the value of "border-top-right-radius" */
-  void set borderTopRightRadius(String value) {
+  set borderTopRightRadius(String value) {
     setProperty('border-top-right-radius', value, '');
   }
 
@@ -2374,7 +2356,7 @@
     getPropertyValue('border-top-style');
 
   /** Sets the value of "border-top-style" */
-  void set borderTopStyle(String value) {
+  set borderTopStyle(String value) {
     setProperty('border-top-style', value, '');
   }
 
@@ -2383,7 +2365,7 @@
     getPropertyValue('border-top-width');
 
   /** Sets the value of "border-top-width" */
-  void set borderTopWidth(String value) {
+  set borderTopWidth(String value) {
     setProperty('border-top-width', value, '');
   }
 
@@ -2392,7 +2374,7 @@
     getPropertyValue('border-vertical-spacing');
 
   /** Sets the value of "border-vertical-spacing" */
-  void set borderVerticalSpacing(String value) {
+  set borderVerticalSpacing(String value) {
     setProperty('border-vertical-spacing', value, '');
   }
 
@@ -2401,7 +2383,7 @@
     getPropertyValue('border-width');
 
   /** Sets the value of "border-width" */
-  void set borderWidth(String value) {
+  set borderWidth(String value) {
     setProperty('border-width', value, '');
   }
 
@@ -2410,7 +2392,7 @@
     getPropertyValue('bottom');
 
   /** Sets the value of "bottom" */
-  void set bottom(String value) {
+  set bottom(String value) {
     setProperty('bottom', value, '');
   }
 
@@ -2419,7 +2401,7 @@
     getPropertyValue('box-align');
 
   /** Sets the value of "box-align" */
-  void set boxAlign(String value) {
+  set boxAlign(String value) {
     setProperty('box-align', value, '');
   }
 
@@ -2428,7 +2410,7 @@
     getPropertyValue('box-decoration-break');
 
   /** Sets the value of "box-decoration-break" */
-  void set boxDecorationBreak(String value) {
+  set boxDecorationBreak(String value) {
     setProperty('box-decoration-break', value, '');
   }
 
@@ -2437,7 +2419,7 @@
     getPropertyValue('box-direction');
 
   /** Sets the value of "box-direction" */
-  void set boxDirection(String value) {
+  set boxDirection(String value) {
     setProperty('box-direction', value, '');
   }
 
@@ -2446,7 +2428,7 @@
     getPropertyValue('box-flex');
 
   /** Sets the value of "box-flex" */
-  void set boxFlex(String value) {
+  set boxFlex(String value) {
     setProperty('box-flex', value, '');
   }
 
@@ -2455,7 +2437,7 @@
     getPropertyValue('box-flex-group');
 
   /** Sets the value of "box-flex-group" */
-  void set boxFlexGroup(String value) {
+  set boxFlexGroup(String value) {
     setProperty('box-flex-group', value, '');
   }
 
@@ -2464,7 +2446,7 @@
     getPropertyValue('box-lines');
 
   /** Sets the value of "box-lines" */
-  void set boxLines(String value) {
+  set boxLines(String value) {
     setProperty('box-lines', value, '');
   }
 
@@ -2473,7 +2455,7 @@
     getPropertyValue('box-ordinal-group');
 
   /** Sets the value of "box-ordinal-group" */
-  void set boxOrdinalGroup(String value) {
+  set boxOrdinalGroup(String value) {
     setProperty('box-ordinal-group', value, '');
   }
 
@@ -2482,7 +2464,7 @@
     getPropertyValue('box-orient');
 
   /** Sets the value of "box-orient" */
-  void set boxOrient(String value) {
+  set boxOrient(String value) {
     setProperty('box-orient', value, '');
   }
 
@@ -2491,7 +2473,7 @@
     getPropertyValue('box-pack');
 
   /** Sets the value of "box-pack" */
-  void set boxPack(String value) {
+  set boxPack(String value) {
     setProperty('box-pack', value, '');
   }
 
@@ -2500,7 +2482,7 @@
     getPropertyValue('box-reflect');
 
   /** Sets the value of "box-reflect" */
-  void set boxReflect(String value) {
+  set boxReflect(String value) {
     setProperty('box-reflect', value, '');
   }
 
@@ -2509,7 +2491,7 @@
     getPropertyValue('box-shadow');
 
   /** Sets the value of "box-shadow" */
-  void set boxShadow(String value) {
+  set boxShadow(String value) {
     setProperty('box-shadow', value, '');
   }
 
@@ -2518,7 +2500,7 @@
     getPropertyValue('box-sizing');
 
   /** Sets the value of "box-sizing" */
-  void set boxSizing(String value) {
+  set boxSizing(String value) {
     setProperty('box-sizing', value, '');
   }
 
@@ -2527,7 +2509,7 @@
     getPropertyValue('caption-side');
 
   /** Sets the value of "caption-side" */
-  void set captionSide(String value) {
+  set captionSide(String value) {
     setProperty('caption-side', value, '');
   }
 
@@ -2536,7 +2518,7 @@
     getPropertyValue('clear');
 
   /** Sets the value of "clear" */
-  void set clear(String value) {
+  set clear(String value) {
     setProperty('clear', value, '');
   }
 
@@ -2545,7 +2527,7 @@
     getPropertyValue('clip');
 
   /** Sets the value of "clip" */
-  void set clip(String value) {
+  set clip(String value) {
     setProperty('clip', value, '');
   }
 
@@ -2554,7 +2536,7 @@
     getPropertyValue('clip-path');
 
   /** Sets the value of "clip-path" */
-  void set clipPath(String value) {
+  set clipPath(String value) {
     setProperty('clip-path', value, '');
   }
 
@@ -2563,7 +2545,7 @@
     getPropertyValue('color');
 
   /** Sets the value of "color" */
-  void set color(String value) {
+  set color(String value) {
     setProperty('color', value, '');
   }
 
@@ -2572,7 +2554,7 @@
     getPropertyValue('column-break-after');
 
   /** Sets the value of "column-break-after" */
-  void set columnBreakAfter(String value) {
+  set columnBreakAfter(String value) {
     setProperty('column-break-after', value, '');
   }
 
@@ -2581,7 +2563,7 @@
     getPropertyValue('column-break-before');
 
   /** Sets the value of "column-break-before" */
-  void set columnBreakBefore(String value) {
+  set columnBreakBefore(String value) {
     setProperty('column-break-before', value, '');
   }
 
@@ -2590,7 +2572,7 @@
     getPropertyValue('column-break-inside');
 
   /** Sets the value of "column-break-inside" */
-  void set columnBreakInside(String value) {
+  set columnBreakInside(String value) {
     setProperty('column-break-inside', value, '');
   }
 
@@ -2599,7 +2581,7 @@
     getPropertyValue('column-count');
 
   /** Sets the value of "column-count" */
-  void set columnCount(String value) {
+  set columnCount(String value) {
     setProperty('column-count', value, '');
   }
 
@@ -2608,7 +2590,7 @@
     getPropertyValue('column-fill');
 
   /** Sets the value of "column-fill" */
-  void set columnFill(String value) {
+  set columnFill(String value) {
     setProperty('column-fill', value, '');
   }
 
@@ -2617,7 +2599,7 @@
     getPropertyValue('column-gap');
 
   /** Sets the value of "column-gap" */
-  void set columnGap(String value) {
+  set columnGap(String value) {
     setProperty('column-gap', value, '');
   }
 
@@ -2626,7 +2608,7 @@
     getPropertyValue('column-rule');
 
   /** Sets the value of "column-rule" */
-  void set columnRule(String value) {
+  set columnRule(String value) {
     setProperty('column-rule', value, '');
   }
 
@@ -2635,7 +2617,7 @@
     getPropertyValue('column-rule-color');
 
   /** Sets the value of "column-rule-color" */
-  void set columnRuleColor(String value) {
+  set columnRuleColor(String value) {
     setProperty('column-rule-color', value, '');
   }
 
@@ -2644,7 +2626,7 @@
     getPropertyValue('column-rule-style');
 
   /** Sets the value of "column-rule-style" */
-  void set columnRuleStyle(String value) {
+  set columnRuleStyle(String value) {
     setProperty('column-rule-style', value, '');
   }
 
@@ -2653,7 +2635,7 @@
     getPropertyValue('column-rule-width');
 
   /** Sets the value of "column-rule-width" */
-  void set columnRuleWidth(String value) {
+  set columnRuleWidth(String value) {
     setProperty('column-rule-width', value, '');
   }
 
@@ -2662,7 +2644,7 @@
     getPropertyValue('column-span');
 
   /** Sets the value of "column-span" */
-  void set columnSpan(String value) {
+  set columnSpan(String value) {
     setProperty('column-span', value, '');
   }
 
@@ -2671,7 +2653,7 @@
     getPropertyValue('column-width');
 
   /** Sets the value of "column-width" */
-  void set columnWidth(String value) {
+  set columnWidth(String value) {
     setProperty('column-width', value, '');
   }
 
@@ -2680,7 +2662,7 @@
     getPropertyValue('columns');
 
   /** Sets the value of "columns" */
-  void set columns(String value) {
+  set columns(String value) {
     setProperty('columns', value, '');
   }
 
@@ -2689,7 +2671,7 @@
     getPropertyValue('content');
 
   /** Sets the value of "content" */
-  void set content(String value) {
+  set content(String value) {
     setProperty('content', value, '');
   }
 
@@ -2698,7 +2680,7 @@
     getPropertyValue('counter-increment');
 
   /** Sets the value of "counter-increment" */
-  void set counterIncrement(String value) {
+  set counterIncrement(String value) {
     setProperty('counter-increment', value, '');
   }
 
@@ -2707,7 +2689,7 @@
     getPropertyValue('counter-reset');
 
   /** Sets the value of "counter-reset" */
-  void set counterReset(String value) {
+  set counterReset(String value) {
     setProperty('counter-reset', value, '');
   }
 
@@ -2716,7 +2698,7 @@
     getPropertyValue('cursor');
 
   /** Sets the value of "cursor" */
-  void set cursor(String value) {
+  set cursor(String value) {
     setProperty('cursor', value, '');
   }
 
@@ -2725,7 +2707,7 @@
     getPropertyValue('direction');
 
   /** Sets the value of "direction" */
-  void set direction(String value) {
+  set direction(String value) {
     setProperty('direction', value, '');
   }
 
@@ -2734,7 +2716,7 @@
     getPropertyValue('display');
 
   /** Sets the value of "display" */
-  void set display(String value) {
+  set display(String value) {
     setProperty('display', value, '');
   }
 
@@ -2743,7 +2725,7 @@
     getPropertyValue('empty-cells');
 
   /** Sets the value of "empty-cells" */
-  void set emptyCells(String value) {
+  set emptyCells(String value) {
     setProperty('empty-cells', value, '');
   }
 
@@ -2752,7 +2734,7 @@
     getPropertyValue('filter');
 
   /** Sets the value of "filter" */
-  void set filter(String value) {
+  set filter(String value) {
     setProperty('filter', value, '');
   }
 
@@ -2761,7 +2743,7 @@
     getPropertyValue('flex');
 
   /** Sets the value of "flex" */
-  void set flex(String value) {
+  set flex(String value) {
     setProperty('flex', value, '');
   }
 
@@ -2770,7 +2752,7 @@
     getPropertyValue('flex-basis');
 
   /** Sets the value of "flex-basis" */
-  void set flexBasis(String value) {
+  set flexBasis(String value) {
     setProperty('flex-basis', value, '');
   }
 
@@ -2779,7 +2761,7 @@
     getPropertyValue('flex-direction');
 
   /** Sets the value of "flex-direction" */
-  void set flexDirection(String value) {
+  set flexDirection(String value) {
     setProperty('flex-direction', value, '');
   }
 
@@ -2788,7 +2770,7 @@
     getPropertyValue('flex-flow');
 
   /** Sets the value of "flex-flow" */
-  void set flexFlow(String value) {
+  set flexFlow(String value) {
     setProperty('flex-flow', value, '');
   }
 
@@ -2797,7 +2779,7 @@
     getPropertyValue('flex-grow');
 
   /** Sets the value of "flex-grow" */
-  void set flexGrow(String value) {
+  set flexGrow(String value) {
     setProperty('flex-grow', value, '');
   }
 
@@ -2806,7 +2788,7 @@
     getPropertyValue('flex-shrink');
 
   /** Sets the value of "flex-shrink" */
-  void set flexShrink(String value) {
+  set flexShrink(String value) {
     setProperty('flex-shrink', value, '');
   }
 
@@ -2815,7 +2797,7 @@
     getPropertyValue('flex-wrap');
 
   /** Sets the value of "flex-wrap" */
-  void set flexWrap(String value) {
+  set flexWrap(String value) {
     setProperty('flex-wrap', value, '');
   }
 
@@ -2824,7 +2806,7 @@
     getPropertyValue('float');
 
   /** Sets the value of "float" */
-  void set float(String value) {
+  set float(String value) {
     setProperty('float', value, '');
   }
 
@@ -2833,7 +2815,7 @@
     getPropertyValue('font');
 
   /** Sets the value of "font" */
-  void set font(String value) {
+  set font(String value) {
     setProperty('font', value, '');
   }
 
@@ -2842,7 +2824,7 @@
     getPropertyValue('font-family');
 
   /** Sets the value of "font-family" */
-  void set fontFamily(String value) {
+  set fontFamily(String value) {
     setProperty('font-family', value, '');
   }
 
@@ -2851,7 +2833,7 @@
     getPropertyValue('font-feature-settings');
 
   /** Sets the value of "font-feature-settings" */
-  void set fontFeatureSettings(String value) {
+  set fontFeatureSettings(String value) {
     setProperty('font-feature-settings', value, '');
   }
 
@@ -2860,7 +2842,7 @@
     getPropertyValue('font-kerning');
 
   /** Sets the value of "font-kerning" */
-  void set fontKerning(String value) {
+  set fontKerning(String value) {
     setProperty('font-kerning', value, '');
   }
 
@@ -2869,7 +2851,7 @@
     getPropertyValue('font-size');
 
   /** Sets the value of "font-size" */
-  void set fontSize(String value) {
+  set fontSize(String value) {
     setProperty('font-size', value, '');
   }
 
@@ -2878,7 +2860,7 @@
     getPropertyValue('font-size-delta');
 
   /** Sets the value of "font-size-delta" */
-  void set fontSizeDelta(String value) {
+  set fontSizeDelta(String value) {
     setProperty('font-size-delta', value, '');
   }
 
@@ -2887,7 +2869,7 @@
     getPropertyValue('font-smoothing');
 
   /** Sets the value of "font-smoothing" */
-  void set fontSmoothing(String value) {
+  set fontSmoothing(String value) {
     setProperty('font-smoothing', value, '');
   }
 
@@ -2896,7 +2878,7 @@
     getPropertyValue('font-stretch');
 
   /** Sets the value of "font-stretch" */
-  void set fontStretch(String value) {
+  set fontStretch(String value) {
     setProperty('font-stretch', value, '');
   }
 
@@ -2905,7 +2887,7 @@
     getPropertyValue('font-style');
 
   /** Sets the value of "font-style" */
-  void set fontStyle(String value) {
+  set fontStyle(String value) {
     setProperty('font-style', value, '');
   }
 
@@ -2914,7 +2896,7 @@
     getPropertyValue('font-variant');
 
   /** Sets the value of "font-variant" */
-  void set fontVariant(String value) {
+  set fontVariant(String value) {
     setProperty('font-variant', value, '');
   }
 
@@ -2923,7 +2905,7 @@
     getPropertyValue('font-variant-ligatures');
 
   /** Sets the value of "font-variant-ligatures" */
-  void set fontVariantLigatures(String value) {
+  set fontVariantLigatures(String value) {
     setProperty('font-variant-ligatures', value, '');
   }
 
@@ -2932,7 +2914,7 @@
     getPropertyValue('font-weight');
 
   /** Sets the value of "font-weight" */
-  void set fontWeight(String value) {
+  set fontWeight(String value) {
     setProperty('font-weight', value, '');
   }
 
@@ -2941,7 +2923,7 @@
     getPropertyValue('grid');
 
   /** Sets the value of "grid" */
-  void set grid(String value) {
+  set grid(String value) {
     setProperty('grid', value, '');
   }
 
@@ -2950,7 +2932,7 @@
     getPropertyValue('grid-area');
 
   /** Sets the value of "grid-area" */
-  void set gridArea(String value) {
+  set gridArea(String value) {
     setProperty('grid-area', value, '');
   }
 
@@ -2959,7 +2941,7 @@
     getPropertyValue('grid-auto-columns');
 
   /** Sets the value of "grid-auto-columns" */
-  void set gridAutoColumns(String value) {
+  set gridAutoColumns(String value) {
     setProperty('grid-auto-columns', value, '');
   }
 
@@ -2968,7 +2950,7 @@
     getPropertyValue('grid-auto-flow');
 
   /** Sets the value of "grid-auto-flow" */
-  void set gridAutoFlow(String value) {
+  set gridAutoFlow(String value) {
     setProperty('grid-auto-flow', value, '');
   }
 
@@ -2977,7 +2959,7 @@
     getPropertyValue('grid-auto-rows');
 
   /** Sets the value of "grid-auto-rows" */
-  void set gridAutoRows(String value) {
+  set gridAutoRows(String value) {
     setProperty('grid-auto-rows', value, '');
   }
 
@@ -2986,7 +2968,7 @@
     getPropertyValue('grid-column');
 
   /** Sets the value of "grid-column" */
-  void set gridColumn(String value) {
+  set gridColumn(String value) {
     setProperty('grid-column', value, '');
   }
 
@@ -2995,7 +2977,7 @@
     getPropertyValue('grid-column-end');
 
   /** Sets the value of "grid-column-end" */
-  void set gridColumnEnd(String value) {
+  set gridColumnEnd(String value) {
     setProperty('grid-column-end', value, '');
   }
 
@@ -3004,7 +2986,7 @@
     getPropertyValue('grid-column-start');
 
   /** Sets the value of "grid-column-start" */
-  void set gridColumnStart(String value) {
+  set gridColumnStart(String value) {
     setProperty('grid-column-start', value, '');
   }
 
@@ -3013,7 +2995,7 @@
     getPropertyValue('grid-row');
 
   /** Sets the value of "grid-row" */
-  void set gridRow(String value) {
+  set gridRow(String value) {
     setProperty('grid-row', value, '');
   }
 
@@ -3022,7 +3004,7 @@
     getPropertyValue('grid-row-end');
 
   /** Sets the value of "grid-row-end" */
-  void set gridRowEnd(String value) {
+  set gridRowEnd(String value) {
     setProperty('grid-row-end', value, '');
   }
 
@@ -3031,7 +3013,7 @@
     getPropertyValue('grid-row-start');
 
   /** Sets the value of "grid-row-start" */
-  void set gridRowStart(String value) {
+  set gridRowStart(String value) {
     setProperty('grid-row-start', value, '');
   }
 
@@ -3040,7 +3022,7 @@
     getPropertyValue('grid-template');
 
   /** Sets the value of "grid-template" */
-  void set gridTemplate(String value) {
+  set gridTemplate(String value) {
     setProperty('grid-template', value, '');
   }
 
@@ -3049,7 +3031,7 @@
     getPropertyValue('grid-template-areas');
 
   /** Sets the value of "grid-template-areas" */
-  void set gridTemplateAreas(String value) {
+  set gridTemplateAreas(String value) {
     setProperty('grid-template-areas', value, '');
   }
 
@@ -3058,7 +3040,7 @@
     getPropertyValue('grid-template-columns');
 
   /** Sets the value of "grid-template-columns" */
-  void set gridTemplateColumns(String value) {
+  set gridTemplateColumns(String value) {
     setProperty('grid-template-columns', value, '');
   }
 
@@ -3067,7 +3049,7 @@
     getPropertyValue('grid-template-rows');
 
   /** Sets the value of "grid-template-rows" */
-  void set gridTemplateRows(String value) {
+  set gridTemplateRows(String value) {
     setProperty('grid-template-rows', value, '');
   }
 
@@ -3076,7 +3058,7 @@
     getPropertyValue('height');
 
   /** Sets the value of "height" */
-  void set height(String value) {
+  set height(String value) {
     setProperty('height', value, '');
   }
 
@@ -3085,7 +3067,7 @@
     getPropertyValue('highlight');
 
   /** Sets the value of "highlight" */
-  void set highlight(String value) {
+  set highlight(String value) {
     setProperty('highlight', value, '');
   }
 
@@ -3094,7 +3076,7 @@
     getPropertyValue('hyphenate-character');
 
   /** Sets the value of "hyphenate-character" */
-  void set hyphenateCharacter(String value) {
+  set hyphenateCharacter(String value) {
     setProperty('hyphenate-character', value, '');
   }
 
@@ -3103,7 +3085,7 @@
     getPropertyValue('image-rendering');
 
   /** Sets the value of "image-rendering" */
-  void set imageRendering(String value) {
+  set imageRendering(String value) {
     setProperty('image-rendering', value, '');
   }
 
@@ -3112,7 +3094,7 @@
     getPropertyValue('isolation');
 
   /** Sets the value of "isolation" */
-  void set isolation(String value) {
+  set isolation(String value) {
     setProperty('isolation', value, '');
   }
 
@@ -3121,7 +3103,7 @@
     getPropertyValue('justify-content');
 
   /** Sets the value of "justify-content" */
-  void set justifyContent(String value) {
+  set justifyContent(String value) {
     setProperty('justify-content', value, '');
   }
 
@@ -3130,7 +3112,7 @@
     getPropertyValue('justify-self');
 
   /** Sets the value of "justify-self" */
-  void set justifySelf(String value) {
+  set justifySelf(String value) {
     setProperty('justify-self', value, '');
   }
 
@@ -3139,7 +3121,7 @@
     getPropertyValue('left');
 
   /** Sets the value of "left" */
-  void set left(String value) {
+  set left(String value) {
     setProperty('left', value, '');
   }
 
@@ -3148,7 +3130,7 @@
     getPropertyValue('letter-spacing');
 
   /** Sets the value of "letter-spacing" */
-  void set letterSpacing(String value) {
+  set letterSpacing(String value) {
     setProperty('letter-spacing', value, '');
   }
 
@@ -3157,7 +3139,7 @@
     getPropertyValue('line-box-contain');
 
   /** Sets the value of "line-box-contain" */
-  void set lineBoxContain(String value) {
+  set lineBoxContain(String value) {
     setProperty('line-box-contain', value, '');
   }
 
@@ -3166,7 +3148,7 @@
     getPropertyValue('line-break');
 
   /** Sets the value of "line-break" */
-  void set lineBreak(String value) {
+  set lineBreak(String value) {
     setProperty('line-break', value, '');
   }
 
@@ -3175,7 +3157,7 @@
     getPropertyValue('line-clamp');
 
   /** Sets the value of "line-clamp" */
-  void set lineClamp(String value) {
+  set lineClamp(String value) {
     setProperty('line-clamp', value, '');
   }
 
@@ -3184,7 +3166,7 @@
     getPropertyValue('line-height');
 
   /** Sets the value of "line-height" */
-  void set lineHeight(String value) {
+  set lineHeight(String value) {
     setProperty('line-height', value, '');
   }
 
@@ -3193,7 +3175,7 @@
     getPropertyValue('list-style');
 
   /** Sets the value of "list-style" */
-  void set listStyle(String value) {
+  set listStyle(String value) {
     setProperty('list-style', value, '');
   }
 
@@ -3202,7 +3184,7 @@
     getPropertyValue('list-style-image');
 
   /** Sets the value of "list-style-image" */
-  void set listStyleImage(String value) {
+  set listStyleImage(String value) {
     setProperty('list-style-image', value, '');
   }
 
@@ -3211,7 +3193,7 @@
     getPropertyValue('list-style-position');
 
   /** Sets the value of "list-style-position" */
-  void set listStylePosition(String value) {
+  set listStylePosition(String value) {
     setProperty('list-style-position', value, '');
   }
 
@@ -3220,7 +3202,7 @@
     getPropertyValue('list-style-type');
 
   /** Sets the value of "list-style-type" */
-  void set listStyleType(String value) {
+  set listStyleType(String value) {
     setProperty('list-style-type', value, '');
   }
 
@@ -3229,7 +3211,7 @@
     getPropertyValue('locale');
 
   /** Sets the value of "locale" */
-  void set locale(String value) {
+  set locale(String value) {
     setProperty('locale', value, '');
   }
 
@@ -3238,7 +3220,7 @@
     getPropertyValue('logical-height');
 
   /** Sets the value of "logical-height" */
-  void set logicalHeight(String value) {
+  set logicalHeight(String value) {
     setProperty('logical-height', value, '');
   }
 
@@ -3247,7 +3229,7 @@
     getPropertyValue('logical-width');
 
   /** Sets the value of "logical-width" */
-  void set logicalWidth(String value) {
+  set logicalWidth(String value) {
     setProperty('logical-width', value, '');
   }
 
@@ -3256,7 +3238,7 @@
     getPropertyValue('margin');
 
   /** Sets the value of "margin" */
-  void set margin(String value) {
+  set margin(String value) {
     setProperty('margin', value, '');
   }
 
@@ -3265,7 +3247,7 @@
     getPropertyValue('margin-after');
 
   /** Sets the value of "margin-after" */
-  void set marginAfter(String value) {
+  set marginAfter(String value) {
     setProperty('margin-after', value, '');
   }
 
@@ -3274,7 +3256,7 @@
     getPropertyValue('margin-after-collapse');
 
   /** Sets the value of "margin-after-collapse" */
-  void set marginAfterCollapse(String value) {
+  set marginAfterCollapse(String value) {
     setProperty('margin-after-collapse', value, '');
   }
 
@@ -3283,7 +3265,7 @@
     getPropertyValue('margin-before');
 
   /** Sets the value of "margin-before" */
-  void set marginBefore(String value) {
+  set marginBefore(String value) {
     setProperty('margin-before', value, '');
   }
 
@@ -3292,7 +3274,7 @@
     getPropertyValue('margin-before-collapse');
 
   /** Sets the value of "margin-before-collapse" */
-  void set marginBeforeCollapse(String value) {
+  set marginBeforeCollapse(String value) {
     setProperty('margin-before-collapse', value, '');
   }
 
@@ -3301,7 +3283,7 @@
     getPropertyValue('margin-bottom');
 
   /** Sets the value of "margin-bottom" */
-  void set marginBottom(String value) {
+  set marginBottom(String value) {
     setProperty('margin-bottom', value, '');
   }
 
@@ -3310,7 +3292,7 @@
     getPropertyValue('margin-bottom-collapse');
 
   /** Sets the value of "margin-bottom-collapse" */
-  void set marginBottomCollapse(String value) {
+  set marginBottomCollapse(String value) {
     setProperty('margin-bottom-collapse', value, '');
   }
 
@@ -3319,7 +3301,7 @@
     getPropertyValue('margin-collapse');
 
   /** Sets the value of "margin-collapse" */
-  void set marginCollapse(String value) {
+  set marginCollapse(String value) {
     setProperty('margin-collapse', value, '');
   }
 
@@ -3328,7 +3310,7 @@
     getPropertyValue('margin-end');
 
   /** Sets the value of "margin-end" */
-  void set marginEnd(String value) {
+  set marginEnd(String value) {
     setProperty('margin-end', value, '');
   }
 
@@ -3337,7 +3319,7 @@
     getPropertyValue('margin-left');
 
   /** Sets the value of "margin-left" */
-  void set marginLeft(String value) {
+  set marginLeft(String value) {
     setProperty('margin-left', value, '');
   }
 
@@ -3346,7 +3328,7 @@
     getPropertyValue('margin-right');
 
   /** Sets the value of "margin-right" */
-  void set marginRight(String value) {
+  set marginRight(String value) {
     setProperty('margin-right', value, '');
   }
 
@@ -3355,7 +3337,7 @@
     getPropertyValue('margin-start');
 
   /** Sets the value of "margin-start" */
-  void set marginStart(String value) {
+  set marginStart(String value) {
     setProperty('margin-start', value, '');
   }
 
@@ -3364,7 +3346,7 @@
     getPropertyValue('margin-top');
 
   /** Sets the value of "margin-top" */
-  void set marginTop(String value) {
+  set marginTop(String value) {
     setProperty('margin-top', value, '');
   }
 
@@ -3373,7 +3355,7 @@
     getPropertyValue('margin-top-collapse');
 
   /** Sets the value of "margin-top-collapse" */
-  void set marginTopCollapse(String value) {
+  set marginTopCollapse(String value) {
     setProperty('margin-top-collapse', value, '');
   }
 
@@ -3382,7 +3364,7 @@
     getPropertyValue('mask');
 
   /** Sets the value of "mask" */
-  void set mask(String value) {
+  set mask(String value) {
     setProperty('mask', value, '');
   }
 
@@ -3391,7 +3373,7 @@
     getPropertyValue('mask-box-image');
 
   /** Sets the value of "mask-box-image" */
-  void set maskBoxImage(String value) {
+  set maskBoxImage(String value) {
     setProperty('mask-box-image', value, '');
   }
 
@@ -3400,7 +3382,7 @@
     getPropertyValue('mask-box-image-outset');
 
   /** Sets the value of "mask-box-image-outset" */
-  void set maskBoxImageOutset(String value) {
+  set maskBoxImageOutset(String value) {
     setProperty('mask-box-image-outset', value, '');
   }
 
@@ -3409,7 +3391,7 @@
     getPropertyValue('mask-box-image-repeat');
 
   /** Sets the value of "mask-box-image-repeat" */
-  void set maskBoxImageRepeat(String value) {
+  set maskBoxImageRepeat(String value) {
     setProperty('mask-box-image-repeat', value, '');
   }
 
@@ -3418,7 +3400,7 @@
     getPropertyValue('mask-box-image-slice');
 
   /** Sets the value of "mask-box-image-slice" */
-  void set maskBoxImageSlice(String value) {
+  set maskBoxImageSlice(String value) {
     setProperty('mask-box-image-slice', value, '');
   }
 
@@ -3427,7 +3409,7 @@
     getPropertyValue('mask-box-image-source');
 
   /** Sets the value of "mask-box-image-source" */
-  void set maskBoxImageSource(String value) {
+  set maskBoxImageSource(String value) {
     setProperty('mask-box-image-source', value, '');
   }
 
@@ -3436,7 +3418,7 @@
     getPropertyValue('mask-box-image-width');
 
   /** Sets the value of "mask-box-image-width" */
-  void set maskBoxImageWidth(String value) {
+  set maskBoxImageWidth(String value) {
     setProperty('mask-box-image-width', value, '');
   }
 
@@ -3445,7 +3427,7 @@
     getPropertyValue('mask-clip');
 
   /** Sets the value of "mask-clip" */
-  void set maskClip(String value) {
+  set maskClip(String value) {
     setProperty('mask-clip', value, '');
   }
 
@@ -3454,7 +3436,7 @@
     getPropertyValue('mask-composite');
 
   /** Sets the value of "mask-composite" */
-  void set maskComposite(String value) {
+  set maskComposite(String value) {
     setProperty('mask-composite', value, '');
   }
 
@@ -3463,7 +3445,7 @@
     getPropertyValue('mask-image');
 
   /** Sets the value of "mask-image" */
-  void set maskImage(String value) {
+  set maskImage(String value) {
     setProperty('mask-image', value, '');
   }
 
@@ -3472,7 +3454,7 @@
     getPropertyValue('mask-origin');
 
   /** Sets the value of "mask-origin" */
-  void set maskOrigin(String value) {
+  set maskOrigin(String value) {
     setProperty('mask-origin', value, '');
   }
 
@@ -3481,7 +3463,7 @@
     getPropertyValue('mask-position');
 
   /** Sets the value of "mask-position" */
-  void set maskPosition(String value) {
+  set maskPosition(String value) {
     setProperty('mask-position', value, '');
   }
 
@@ -3490,7 +3472,7 @@
     getPropertyValue('mask-position-x');
 
   /** Sets the value of "mask-position-x" */
-  void set maskPositionX(String value) {
+  set maskPositionX(String value) {
     setProperty('mask-position-x', value, '');
   }
 
@@ -3499,7 +3481,7 @@
     getPropertyValue('mask-position-y');
 
   /** Sets the value of "mask-position-y" */
-  void set maskPositionY(String value) {
+  set maskPositionY(String value) {
     setProperty('mask-position-y', value, '');
   }
 
@@ -3508,7 +3490,7 @@
     getPropertyValue('mask-repeat');
 
   /** Sets the value of "mask-repeat" */
-  void set maskRepeat(String value) {
+  set maskRepeat(String value) {
     setProperty('mask-repeat', value, '');
   }
 
@@ -3517,7 +3499,7 @@
     getPropertyValue('mask-repeat-x');
 
   /** Sets the value of "mask-repeat-x" */
-  void set maskRepeatX(String value) {
+  set maskRepeatX(String value) {
     setProperty('mask-repeat-x', value, '');
   }
 
@@ -3526,7 +3508,7 @@
     getPropertyValue('mask-repeat-y');
 
   /** Sets the value of "mask-repeat-y" */
-  void set maskRepeatY(String value) {
+  set maskRepeatY(String value) {
     setProperty('mask-repeat-y', value, '');
   }
 
@@ -3535,7 +3517,7 @@
     getPropertyValue('mask-size');
 
   /** Sets the value of "mask-size" */
-  void set maskSize(String value) {
+  set maskSize(String value) {
     setProperty('mask-size', value, '');
   }
 
@@ -3544,7 +3526,7 @@
     getPropertyValue('mask-source-type');
 
   /** Sets the value of "mask-source-type" */
-  void set maskSourceType(String value) {
+  set maskSourceType(String value) {
     setProperty('mask-source-type', value, '');
   }
 
@@ -3553,7 +3535,7 @@
     getPropertyValue('max-height');
 
   /** Sets the value of "max-height" */
-  void set maxHeight(String value) {
+  set maxHeight(String value) {
     setProperty('max-height', value, '');
   }
 
@@ -3562,7 +3544,7 @@
     getPropertyValue('max-logical-height');
 
   /** Sets the value of "max-logical-height" */
-  void set maxLogicalHeight(String value) {
+  set maxLogicalHeight(String value) {
     setProperty('max-logical-height', value, '');
   }
 
@@ -3571,7 +3553,7 @@
     getPropertyValue('max-logical-width');
 
   /** Sets the value of "max-logical-width" */
-  void set maxLogicalWidth(String value) {
+  set maxLogicalWidth(String value) {
     setProperty('max-logical-width', value, '');
   }
 
@@ -3580,7 +3562,7 @@
     getPropertyValue('max-width');
 
   /** Sets the value of "max-width" */
-  void set maxWidth(String value) {
+  set maxWidth(String value) {
     setProperty('max-width', value, '');
   }
 
@@ -3589,7 +3571,7 @@
     getPropertyValue('max-zoom');
 
   /** Sets the value of "max-zoom" */
-  void set maxZoom(String value) {
+  set maxZoom(String value) {
     setProperty('max-zoom', value, '');
   }
 
@@ -3598,7 +3580,7 @@
     getPropertyValue('min-height');
 
   /** Sets the value of "min-height" */
-  void set minHeight(String value) {
+  set minHeight(String value) {
     setProperty('min-height', value, '');
   }
 
@@ -3607,7 +3589,7 @@
     getPropertyValue('min-logical-height');
 
   /** Sets the value of "min-logical-height" */
-  void set minLogicalHeight(String value) {
+  set minLogicalHeight(String value) {
     setProperty('min-logical-height', value, '');
   }
 
@@ -3616,7 +3598,7 @@
     getPropertyValue('min-logical-width');
 
   /** Sets the value of "min-logical-width" */
-  void set minLogicalWidth(String value) {
+  set minLogicalWidth(String value) {
     setProperty('min-logical-width', value, '');
   }
 
@@ -3625,7 +3607,7 @@
     getPropertyValue('min-width');
 
   /** Sets the value of "min-width" */
-  void set minWidth(String value) {
+  set minWidth(String value) {
     setProperty('min-width', value, '');
   }
 
@@ -3634,7 +3616,7 @@
     getPropertyValue('min-zoom');
 
   /** Sets the value of "min-zoom" */
-  void set minZoom(String value) {
+  set minZoom(String value) {
     setProperty('min-zoom', value, '');
   }
 
@@ -3643,7 +3625,7 @@
     getPropertyValue('mix-blend-mode');
 
   /** Sets the value of "mix-blend-mode" */
-  void set mixBlendMode(String value) {
+  set mixBlendMode(String value) {
     setProperty('mix-blend-mode', value, '');
   }
 
@@ -3652,7 +3634,7 @@
     getPropertyValue('object-fit');
 
   /** Sets the value of "object-fit" */
-  void set objectFit(String value) {
+  set objectFit(String value) {
     setProperty('object-fit', value, '');
   }
 
@@ -3661,7 +3643,7 @@
     getPropertyValue('object-position');
 
   /** Sets the value of "object-position" */
-  void set objectPosition(String value) {
+  set objectPosition(String value) {
     setProperty('object-position', value, '');
   }
 
@@ -3670,7 +3652,7 @@
     getPropertyValue('opacity');
 
   /** Sets the value of "opacity" */
-  void set opacity(String value) {
+  set opacity(String value) {
     setProperty('opacity', value, '');
   }
 
@@ -3679,7 +3661,7 @@
     getPropertyValue('order');
 
   /** Sets the value of "order" */
-  void set order(String value) {
+  set order(String value) {
     setProperty('order', value, '');
   }
 
@@ -3688,7 +3670,7 @@
     getPropertyValue('orientation');
 
   /** Sets the value of "orientation" */
-  void set orientation(String value) {
+  set orientation(String value) {
     setProperty('orientation', value, '');
   }
 
@@ -3697,7 +3679,7 @@
     getPropertyValue('orphans');
 
   /** Sets the value of "orphans" */
-  void set orphans(String value) {
+  set orphans(String value) {
     setProperty('orphans', value, '');
   }
 
@@ -3706,7 +3688,7 @@
     getPropertyValue('outline');
 
   /** Sets the value of "outline" */
-  void set outline(String value) {
+  set outline(String value) {
     setProperty('outline', value, '');
   }
 
@@ -3715,7 +3697,7 @@
     getPropertyValue('outline-color');
 
   /** Sets the value of "outline-color" */
-  void set outlineColor(String value) {
+  set outlineColor(String value) {
     setProperty('outline-color', value, '');
   }
 
@@ -3724,7 +3706,7 @@
     getPropertyValue('outline-offset');
 
   /** Sets the value of "outline-offset" */
-  void set outlineOffset(String value) {
+  set outlineOffset(String value) {
     setProperty('outline-offset', value, '');
   }
 
@@ -3733,7 +3715,7 @@
     getPropertyValue('outline-style');
 
   /** Sets the value of "outline-style" */
-  void set outlineStyle(String value) {
+  set outlineStyle(String value) {
     setProperty('outline-style', value, '');
   }
 
@@ -3742,7 +3724,7 @@
     getPropertyValue('outline-width');
 
   /** Sets the value of "outline-width" */
-  void set outlineWidth(String value) {
+  set outlineWidth(String value) {
     setProperty('outline-width', value, '');
   }
 
@@ -3751,7 +3733,7 @@
     getPropertyValue('overflow');
 
   /** Sets the value of "overflow" */
-  void set overflow(String value) {
+  set overflow(String value) {
     setProperty('overflow', value, '');
   }
 
@@ -3760,7 +3742,7 @@
     getPropertyValue('overflow-wrap');
 
   /** Sets the value of "overflow-wrap" */
-  void set overflowWrap(String value) {
+  set overflowWrap(String value) {
     setProperty('overflow-wrap', value, '');
   }
 
@@ -3769,7 +3751,7 @@
     getPropertyValue('overflow-x');
 
   /** Sets the value of "overflow-x" */
-  void set overflowX(String value) {
+  set overflowX(String value) {
     setProperty('overflow-x', value, '');
   }
 
@@ -3778,7 +3760,7 @@
     getPropertyValue('overflow-y');
 
   /** Sets the value of "overflow-y" */
-  void set overflowY(String value) {
+  set overflowY(String value) {
     setProperty('overflow-y', value, '');
   }
 
@@ -3787,7 +3769,7 @@
     getPropertyValue('padding');
 
   /** Sets the value of "padding" */
-  void set padding(String value) {
+  set padding(String value) {
     setProperty('padding', value, '');
   }
 
@@ -3796,7 +3778,7 @@
     getPropertyValue('padding-after');
 
   /** Sets the value of "padding-after" */
-  void set paddingAfter(String value) {
+  set paddingAfter(String value) {
     setProperty('padding-after', value, '');
   }
 
@@ -3805,7 +3787,7 @@
     getPropertyValue('padding-before');
 
   /** Sets the value of "padding-before" */
-  void set paddingBefore(String value) {
+  set paddingBefore(String value) {
     setProperty('padding-before', value, '');
   }
 
@@ -3814,7 +3796,7 @@
     getPropertyValue('padding-bottom');
 
   /** Sets the value of "padding-bottom" */
-  void set paddingBottom(String value) {
+  set paddingBottom(String value) {
     setProperty('padding-bottom', value, '');
   }
 
@@ -3823,7 +3805,7 @@
     getPropertyValue('padding-end');
 
   /** Sets the value of "padding-end" */
-  void set paddingEnd(String value) {
+  set paddingEnd(String value) {
     setProperty('padding-end', value, '');
   }
 
@@ -3832,7 +3814,7 @@
     getPropertyValue('padding-left');
 
   /** Sets the value of "padding-left" */
-  void set paddingLeft(String value) {
+  set paddingLeft(String value) {
     setProperty('padding-left', value, '');
   }
 
@@ -3841,7 +3823,7 @@
     getPropertyValue('padding-right');
 
   /** Sets the value of "padding-right" */
-  void set paddingRight(String value) {
+  set paddingRight(String value) {
     setProperty('padding-right', value, '');
   }
 
@@ -3850,7 +3832,7 @@
     getPropertyValue('padding-start');
 
   /** Sets the value of "padding-start" */
-  void set paddingStart(String value) {
+  set paddingStart(String value) {
     setProperty('padding-start', value, '');
   }
 
@@ -3859,7 +3841,7 @@
     getPropertyValue('padding-top');
 
   /** Sets the value of "padding-top" */
-  void set paddingTop(String value) {
+  set paddingTop(String value) {
     setProperty('padding-top', value, '');
   }
 
@@ -3868,7 +3850,7 @@
     getPropertyValue('page');
 
   /** Sets the value of "page" */
-  void set page(String value) {
+  set page(String value) {
     setProperty('page', value, '');
   }
 
@@ -3877,7 +3859,7 @@
     getPropertyValue('page-break-after');
 
   /** Sets the value of "page-break-after" */
-  void set pageBreakAfter(String value) {
+  set pageBreakAfter(String value) {
     setProperty('page-break-after', value, '');
   }
 
@@ -3886,7 +3868,7 @@
     getPropertyValue('page-break-before');
 
   /** Sets the value of "page-break-before" */
-  void set pageBreakBefore(String value) {
+  set pageBreakBefore(String value) {
     setProperty('page-break-before', value, '');
   }
 
@@ -3895,7 +3877,7 @@
     getPropertyValue('page-break-inside');
 
   /** Sets the value of "page-break-inside" */
-  void set pageBreakInside(String value) {
+  set pageBreakInside(String value) {
     setProperty('page-break-inside', value, '');
   }
 
@@ -3904,7 +3886,7 @@
     getPropertyValue('perspective');
 
   /** Sets the value of "perspective" */
-  void set perspective(String value) {
+  set perspective(String value) {
     setProperty('perspective', value, '');
   }
 
@@ -3913,7 +3895,7 @@
     getPropertyValue('perspective-origin');
 
   /** Sets the value of "perspective-origin" */
-  void set perspectiveOrigin(String value) {
+  set perspectiveOrigin(String value) {
     setProperty('perspective-origin', value, '');
   }
 
@@ -3922,7 +3904,7 @@
     getPropertyValue('perspective-origin-x');
 
   /** Sets the value of "perspective-origin-x" */
-  void set perspectiveOriginX(String value) {
+  set perspectiveOriginX(String value) {
     setProperty('perspective-origin-x', value, '');
   }
 
@@ -3931,7 +3913,7 @@
     getPropertyValue('perspective-origin-y');
 
   /** Sets the value of "perspective-origin-y" */
-  void set perspectiveOriginY(String value) {
+  set perspectiveOriginY(String value) {
     setProperty('perspective-origin-y', value, '');
   }
 
@@ -3940,7 +3922,7 @@
     getPropertyValue('pointer-events');
 
   /** Sets the value of "pointer-events" */
-  void set pointerEvents(String value) {
+  set pointerEvents(String value) {
     setProperty('pointer-events', value, '');
   }
 
@@ -3949,7 +3931,7 @@
     getPropertyValue('position');
 
   /** Sets the value of "position" */
-  void set position(String value) {
+  set position(String value) {
     setProperty('position', value, '');
   }
 
@@ -3958,7 +3940,7 @@
     getPropertyValue('print-color-adjust');
 
   /** Sets the value of "print-color-adjust" */
-  void set printColorAdjust(String value) {
+  set printColorAdjust(String value) {
     setProperty('print-color-adjust', value, '');
   }
 
@@ -3967,7 +3949,7 @@
     getPropertyValue('quotes');
 
   /** Sets the value of "quotes" */
-  void set quotes(String value) {
+  set quotes(String value) {
     setProperty('quotes', value, '');
   }
 
@@ -3976,7 +3958,7 @@
     getPropertyValue('resize');
 
   /** Sets the value of "resize" */
-  void set resize(String value) {
+  set resize(String value) {
     setProperty('resize', value, '');
   }
 
@@ -3985,7 +3967,7 @@
     getPropertyValue('right');
 
   /** Sets the value of "right" */
-  void set right(String value) {
+  set right(String value) {
     setProperty('right', value, '');
   }
 
@@ -3994,7 +3976,7 @@
     getPropertyValue('rtl-ordering');
 
   /** Sets the value of "rtl-ordering" */
-  void set rtlOrdering(String value) {
+  set rtlOrdering(String value) {
     setProperty('rtl-ordering', value, '');
   }
 
@@ -4003,7 +3985,7 @@
     getPropertyValue('ruby-position');
 
   /** Sets the value of "ruby-position" */
-  void set rubyPosition(String value) {
+  set rubyPosition(String value) {
     setProperty('ruby-position', value, '');
   }
 
@@ -4012,7 +3994,7 @@
     getPropertyValue('scroll-behavior');
 
   /** Sets the value of "scroll-behavior" */
-  void set scrollBehavior(String value) {
+  set scrollBehavior(String value) {
     setProperty('scroll-behavior', value, '');
   }
 
@@ -4021,7 +4003,7 @@
     getPropertyValue('shape-image-threshold');
 
   /** Sets the value of "shape-image-threshold" */
-  void set shapeImageThreshold(String value) {
+  set shapeImageThreshold(String value) {
     setProperty('shape-image-threshold', value, '');
   }
 
@@ -4030,7 +4012,7 @@
     getPropertyValue('shape-margin');
 
   /** Sets the value of "shape-margin" */
-  void set shapeMargin(String value) {
+  set shapeMargin(String value) {
     setProperty('shape-margin', value, '');
   }
 
@@ -4039,7 +4021,7 @@
     getPropertyValue('shape-outside');
 
   /** Sets the value of "shape-outside" */
-  void set shapeOutside(String value) {
+  set shapeOutside(String value) {
     setProperty('shape-outside', value, '');
   }
 
@@ -4048,7 +4030,7 @@
     getPropertyValue('size');
 
   /** Sets the value of "size" */
-  void set size(String value) {
+  set size(String value) {
     setProperty('size', value, '');
   }
 
@@ -4057,7 +4039,7 @@
     getPropertyValue('speak');
 
   /** Sets the value of "speak" */
-  void set speak(String value) {
+  set speak(String value) {
     setProperty('speak', value, '');
   }
 
@@ -4066,7 +4048,7 @@
     getPropertyValue('src');
 
   /** Sets the value of "src" */
-  void set src(String value) {
+  set src(String value) {
     setProperty('src', value, '');
   }
 
@@ -4075,7 +4057,7 @@
     getPropertyValue('tab-size');
 
   /** Sets the value of "tab-size" */
-  void set tabSize(String value) {
+  set tabSize(String value) {
     setProperty('tab-size', value, '');
   }
 
@@ -4084,7 +4066,7 @@
     getPropertyValue('table-layout');
 
   /** Sets the value of "table-layout" */
-  void set tableLayout(String value) {
+  set tableLayout(String value) {
     setProperty('table-layout', value, '');
   }
 
@@ -4093,7 +4075,7 @@
     getPropertyValue('tap-highlight-color');
 
   /** Sets the value of "tap-highlight-color" */
-  void set tapHighlightColor(String value) {
+  set tapHighlightColor(String value) {
     setProperty('tap-highlight-color', value, '');
   }
 
@@ -4102,7 +4084,7 @@
     getPropertyValue('text-align');
 
   /** Sets the value of "text-align" */
-  void set textAlign(String value) {
+  set textAlign(String value) {
     setProperty('text-align', value, '');
   }
 
@@ -4111,7 +4093,7 @@
     getPropertyValue('text-align-last');
 
   /** Sets the value of "text-align-last" */
-  void set textAlignLast(String value) {
+  set textAlignLast(String value) {
     setProperty('text-align-last', value, '');
   }
 
@@ -4120,7 +4102,7 @@
     getPropertyValue('text-combine');
 
   /** Sets the value of "text-combine" */
-  void set textCombine(String value) {
+  set textCombine(String value) {
     setProperty('text-combine', value, '');
   }
 
@@ -4129,7 +4111,7 @@
     getPropertyValue('text-decoration');
 
   /** Sets the value of "text-decoration" */
-  void set textDecoration(String value) {
+  set textDecoration(String value) {
     setProperty('text-decoration', value, '');
   }
 
@@ -4138,7 +4120,7 @@
     getPropertyValue('text-decoration-color');
 
   /** Sets the value of "text-decoration-color" */
-  void set textDecorationColor(String value) {
+  set textDecorationColor(String value) {
     setProperty('text-decoration-color', value, '');
   }
 
@@ -4147,7 +4129,7 @@
     getPropertyValue('text-decoration-line');
 
   /** Sets the value of "text-decoration-line" */
-  void set textDecorationLine(String value) {
+  set textDecorationLine(String value) {
     setProperty('text-decoration-line', value, '');
   }
 
@@ -4156,7 +4138,7 @@
     getPropertyValue('text-decoration-style');
 
   /** Sets the value of "text-decoration-style" */
-  void set textDecorationStyle(String value) {
+  set textDecorationStyle(String value) {
     setProperty('text-decoration-style', value, '');
   }
 
@@ -4165,7 +4147,7 @@
     getPropertyValue('text-decorations-in-effect');
 
   /** Sets the value of "text-decorations-in-effect" */
-  void set textDecorationsInEffect(String value) {
+  set textDecorationsInEffect(String value) {
     setProperty('text-decorations-in-effect', value, '');
   }
 
@@ -4174,7 +4156,7 @@
     getPropertyValue('text-emphasis');
 
   /** Sets the value of "text-emphasis" */
-  void set textEmphasis(String value) {
+  set textEmphasis(String value) {
     setProperty('text-emphasis', value, '');
   }
 
@@ -4183,7 +4165,7 @@
     getPropertyValue('text-emphasis-color');
 
   /** Sets the value of "text-emphasis-color" */
-  void set textEmphasisColor(String value) {
+  set textEmphasisColor(String value) {
     setProperty('text-emphasis-color', value, '');
   }
 
@@ -4192,7 +4174,7 @@
     getPropertyValue('text-emphasis-position');
 
   /** Sets the value of "text-emphasis-position" */
-  void set textEmphasisPosition(String value) {
+  set textEmphasisPosition(String value) {
     setProperty('text-emphasis-position', value, '');
   }
 
@@ -4201,7 +4183,7 @@
     getPropertyValue('text-emphasis-style');
 
   /** Sets the value of "text-emphasis-style" */
-  void set textEmphasisStyle(String value) {
+  set textEmphasisStyle(String value) {
     setProperty('text-emphasis-style', value, '');
   }
 
@@ -4210,7 +4192,7 @@
     getPropertyValue('text-fill-color');
 
   /** Sets the value of "text-fill-color" */
-  void set textFillColor(String value) {
+  set textFillColor(String value) {
     setProperty('text-fill-color', value, '');
   }
 
@@ -4219,7 +4201,7 @@
     getPropertyValue('text-indent');
 
   /** Sets the value of "text-indent" */
-  void set textIndent(String value) {
+  set textIndent(String value) {
     setProperty('text-indent', value, '');
   }
 
@@ -4228,7 +4210,7 @@
     getPropertyValue('text-justify');
 
   /** Sets the value of "text-justify" */
-  void set textJustify(String value) {
+  set textJustify(String value) {
     setProperty('text-justify', value, '');
   }
 
@@ -4237,7 +4219,7 @@
     getPropertyValue('text-line-through-color');
 
   /** Sets the value of "text-line-through-color" */
-  void set textLineThroughColor(String value) {
+  set textLineThroughColor(String value) {
     setProperty('text-line-through-color', value, '');
   }
 
@@ -4246,7 +4228,7 @@
     getPropertyValue('text-line-through-mode');
 
   /** Sets the value of "text-line-through-mode" */
-  void set textLineThroughMode(String value) {
+  set textLineThroughMode(String value) {
     setProperty('text-line-through-mode', value, '');
   }
 
@@ -4255,7 +4237,7 @@
     getPropertyValue('text-line-through-style');
 
   /** Sets the value of "text-line-through-style" */
-  void set textLineThroughStyle(String value) {
+  set textLineThroughStyle(String value) {
     setProperty('text-line-through-style', value, '');
   }
 
@@ -4264,7 +4246,7 @@
     getPropertyValue('text-line-through-width');
 
   /** Sets the value of "text-line-through-width" */
-  void set textLineThroughWidth(String value) {
+  set textLineThroughWidth(String value) {
     setProperty('text-line-through-width', value, '');
   }
 
@@ -4273,7 +4255,7 @@
     getPropertyValue('text-orientation');
 
   /** Sets the value of "text-orientation" */
-  void set textOrientation(String value) {
+  set textOrientation(String value) {
     setProperty('text-orientation', value, '');
   }
 
@@ -4282,7 +4264,7 @@
     getPropertyValue('text-overflow');
 
   /** Sets the value of "text-overflow" */
-  void set textOverflow(String value) {
+  set textOverflow(String value) {
     setProperty('text-overflow', value, '');
   }
 
@@ -4291,7 +4273,7 @@
     getPropertyValue('text-overline-color');
 
   /** Sets the value of "text-overline-color" */
-  void set textOverlineColor(String value) {
+  set textOverlineColor(String value) {
     setProperty('text-overline-color', value, '');
   }
 
@@ -4300,7 +4282,7 @@
     getPropertyValue('text-overline-mode');
 
   /** Sets the value of "text-overline-mode" */
-  void set textOverlineMode(String value) {
+  set textOverlineMode(String value) {
     setProperty('text-overline-mode', value, '');
   }
 
@@ -4309,7 +4291,7 @@
     getPropertyValue('text-overline-style');
 
   /** Sets the value of "text-overline-style" */
-  void set textOverlineStyle(String value) {
+  set textOverlineStyle(String value) {
     setProperty('text-overline-style', value, '');
   }
 
@@ -4318,7 +4300,7 @@
     getPropertyValue('text-overline-width');
 
   /** Sets the value of "text-overline-width" */
-  void set textOverlineWidth(String value) {
+  set textOverlineWidth(String value) {
     setProperty('text-overline-width', value, '');
   }
 
@@ -4327,7 +4309,7 @@
     getPropertyValue('text-rendering');
 
   /** Sets the value of "text-rendering" */
-  void set textRendering(String value) {
+  set textRendering(String value) {
     setProperty('text-rendering', value, '');
   }
 
@@ -4336,7 +4318,7 @@
     getPropertyValue('text-security');
 
   /** Sets the value of "text-security" */
-  void set textSecurity(String value) {
+  set textSecurity(String value) {
     setProperty('text-security', value, '');
   }
 
@@ -4345,7 +4327,7 @@
     getPropertyValue('text-shadow');
 
   /** Sets the value of "text-shadow" */
-  void set textShadow(String value) {
+  set textShadow(String value) {
     setProperty('text-shadow', value, '');
   }
 
@@ -4354,7 +4336,7 @@
     getPropertyValue('text-stroke');
 
   /** Sets the value of "text-stroke" */
-  void set textStroke(String value) {
+  set textStroke(String value) {
     setProperty('text-stroke', value, '');
   }
 
@@ -4363,7 +4345,7 @@
     getPropertyValue('text-stroke-color');
 
   /** Sets the value of "text-stroke-color" */
-  void set textStrokeColor(String value) {
+  set textStrokeColor(String value) {
     setProperty('text-stroke-color', value, '');
   }
 
@@ -4372,7 +4354,7 @@
     getPropertyValue('text-stroke-width');
 
   /** Sets the value of "text-stroke-width" */
-  void set textStrokeWidth(String value) {
+  set textStrokeWidth(String value) {
     setProperty('text-stroke-width', value, '');
   }
 
@@ -4381,7 +4363,7 @@
     getPropertyValue('text-transform');
 
   /** Sets the value of "text-transform" */
-  void set textTransform(String value) {
+  set textTransform(String value) {
     setProperty('text-transform', value, '');
   }
 
@@ -4390,7 +4372,7 @@
     getPropertyValue('text-underline-color');
 
   /** Sets the value of "text-underline-color" */
-  void set textUnderlineColor(String value) {
+  set textUnderlineColor(String value) {
     setProperty('text-underline-color', value, '');
   }
 
@@ -4399,7 +4381,7 @@
     getPropertyValue('text-underline-mode');
 
   /** Sets the value of "text-underline-mode" */
-  void set textUnderlineMode(String value) {
+  set textUnderlineMode(String value) {
     setProperty('text-underline-mode', value, '');
   }
 
@@ -4408,7 +4390,7 @@
     getPropertyValue('text-underline-position');
 
   /** Sets the value of "text-underline-position" */
-  void set textUnderlinePosition(String value) {
+  set textUnderlinePosition(String value) {
     setProperty('text-underline-position', value, '');
   }
 
@@ -4417,7 +4399,7 @@
     getPropertyValue('text-underline-style');
 
   /** Sets the value of "text-underline-style" */
-  void set textUnderlineStyle(String value) {
+  set textUnderlineStyle(String value) {
     setProperty('text-underline-style', value, '');
   }
 
@@ -4426,7 +4408,7 @@
     getPropertyValue('text-underline-width');
 
   /** Sets the value of "text-underline-width" */
-  void set textUnderlineWidth(String value) {
+  set textUnderlineWidth(String value) {
     setProperty('text-underline-width', value, '');
   }
 
@@ -4435,7 +4417,7 @@
     getPropertyValue('top');
 
   /** Sets the value of "top" */
-  void set top(String value) {
+  set top(String value) {
     setProperty('top', value, '');
   }
 
@@ -4444,7 +4426,7 @@
     getPropertyValue('touch-action');
 
   /** Sets the value of "touch-action" */
-  void set touchAction(String value) {
+  set touchAction(String value) {
     setProperty('touch-action', value, '');
   }
 
@@ -4453,7 +4435,7 @@
     getPropertyValue('touch-action-delay');
 
   /** Sets the value of "touch-action-delay" */
-  void set touchActionDelay(String value) {
+  set touchActionDelay(String value) {
     setProperty('touch-action-delay', value, '');
   }
 
@@ -4462,7 +4444,7 @@
     getPropertyValue('transform');
 
   /** Sets the value of "transform" */
-  void set transform(String value) {
+  set transform(String value) {
     setProperty('transform', value, '');
   }
 
@@ -4471,7 +4453,7 @@
     getPropertyValue('transform-origin');
 
   /** Sets the value of "transform-origin" */
-  void set transformOrigin(String value) {
+  set transformOrigin(String value) {
     setProperty('transform-origin', value, '');
   }
 
@@ -4480,7 +4462,7 @@
     getPropertyValue('transform-origin-x');
 
   /** Sets the value of "transform-origin-x" */
-  void set transformOriginX(String value) {
+  set transformOriginX(String value) {
     setProperty('transform-origin-x', value, '');
   }
 
@@ -4489,7 +4471,7 @@
     getPropertyValue('transform-origin-y');
 
   /** Sets the value of "transform-origin-y" */
-  void set transformOriginY(String value) {
+  set transformOriginY(String value) {
     setProperty('transform-origin-y', value, '');
   }
 
@@ -4498,7 +4480,7 @@
     getPropertyValue('transform-origin-z');
 
   /** Sets the value of "transform-origin-z" */
-  void set transformOriginZ(String value) {
+  set transformOriginZ(String value) {
     setProperty('transform-origin-z', value, '');
   }
 
@@ -4507,7 +4489,7 @@
     getPropertyValue('transform-style');
 
   /** Sets the value of "transform-style" */
-  void set transformStyle(String value) {
+  set transformStyle(String value) {
     setProperty('transform-style', value, '');
   }
 
@@ -4522,7 +4504,7 @@
   @SupportedBrowser(SupportedBrowser.FIREFOX)
   @SupportedBrowser(SupportedBrowser.IE, '10')
   @SupportedBrowser(SupportedBrowser.SAFARI)
-  void set transition(String value) {
+  set transition(String value) {
     setProperty('transition', value, '');
   }
 
@@ -4531,7 +4513,7 @@
     getPropertyValue('transition-delay');
 
   /** Sets the value of "transition-delay" */
-  void set transitionDelay(String value) {
+  set transitionDelay(String value) {
     setProperty('transition-delay', value, '');
   }
 
@@ -4540,7 +4522,7 @@
     getPropertyValue('transition-duration');
 
   /** Sets the value of "transition-duration" */
-  void set transitionDuration(String value) {
+  set transitionDuration(String value) {
     setProperty('transition-duration', value, '');
   }
 
@@ -4549,7 +4531,7 @@
     getPropertyValue('transition-property');
 
   /** Sets the value of "transition-property" */
-  void set transitionProperty(String value) {
+  set transitionProperty(String value) {
     setProperty('transition-property', value, '');
   }
 
@@ -4558,7 +4540,7 @@
     getPropertyValue('transition-timing-function');
 
   /** Sets the value of "transition-timing-function" */
-  void set transitionTimingFunction(String value) {
+  set transitionTimingFunction(String value) {
     setProperty('transition-timing-function', value, '');
   }
 
@@ -4567,7 +4549,7 @@
     getPropertyValue('unicode-bidi');
 
   /** Sets the value of "unicode-bidi" */
-  void set unicodeBidi(String value) {
+  set unicodeBidi(String value) {
     setProperty('unicode-bidi', value, '');
   }
 
@@ -4576,7 +4558,7 @@
     getPropertyValue('unicode-range');
 
   /** Sets the value of "unicode-range" */
-  void set unicodeRange(String value) {
+  set unicodeRange(String value) {
     setProperty('unicode-range', value, '');
   }
 
@@ -4585,7 +4567,7 @@
     getPropertyValue('user-drag');
 
   /** Sets the value of "user-drag" */
-  void set userDrag(String value) {
+  set userDrag(String value) {
     setProperty('user-drag', value, '');
   }
 
@@ -4594,7 +4576,7 @@
     getPropertyValue('user-modify');
 
   /** Sets the value of "user-modify" */
-  void set userModify(String value) {
+  set userModify(String value) {
     setProperty('user-modify', value, '');
   }
 
@@ -4603,7 +4585,7 @@
     getPropertyValue('user-select');
 
   /** Sets the value of "user-select" */
-  void set userSelect(String value) {
+  set userSelect(String value) {
     setProperty('user-select', value, '');
   }
 
@@ -4612,7 +4594,7 @@
     getPropertyValue('user-zoom');
 
   /** Sets the value of "user-zoom" */
-  void set userZoom(String value) {
+  set userZoom(String value) {
     setProperty('user-zoom', value, '');
   }
 
@@ -4621,7 +4603,7 @@
     getPropertyValue('vertical-align');
 
   /** Sets the value of "vertical-align" */
-  void set verticalAlign(String value) {
+  set verticalAlign(String value) {
     setProperty('vertical-align', value, '');
   }
 
@@ -4630,7 +4612,7 @@
     getPropertyValue('visibility');
 
   /** Sets the value of "visibility" */
-  void set visibility(String value) {
+  set visibility(String value) {
     setProperty('visibility', value, '');
   }
 
@@ -4639,7 +4621,7 @@
     getPropertyValue('white-space');
 
   /** Sets the value of "white-space" */
-  void set whiteSpace(String value) {
+  set whiteSpace(String value) {
     setProperty('white-space', value, '');
   }
 
@@ -4648,7 +4630,7 @@
     getPropertyValue('widows');
 
   /** Sets the value of "widows" */
-  void set widows(String value) {
+  set widows(String value) {
     setProperty('widows', value, '');
   }
 
@@ -4657,7 +4639,7 @@
     getPropertyValue('width');
 
   /** Sets the value of "width" */
-  void set width(String value) {
+  set width(String value) {
     setProperty('width', value, '');
   }
 
@@ -4666,7 +4648,7 @@
     getPropertyValue('will-change');
 
   /** Sets the value of "will-change" */
-  void set willChange(String value) {
+  set willChange(String value) {
     setProperty('will-change', value, '');
   }
 
@@ -4675,7 +4657,7 @@
     getPropertyValue('word-break');
 
   /** Sets the value of "word-break" */
-  void set wordBreak(String value) {
+  set wordBreak(String value) {
     setProperty('word-break', value, '');
   }
 
@@ -4684,7 +4666,7 @@
     getPropertyValue('word-spacing');
 
   /** Sets the value of "word-spacing" */
-  void set wordSpacing(String value) {
+  set wordSpacing(String value) {
     setProperty('word-spacing', value, '');
   }
 
@@ -4693,7 +4675,7 @@
     getPropertyValue('word-wrap');
 
   /** Sets the value of "word-wrap" */
-  void set wordWrap(String value) {
+  set wordWrap(String value) {
     setProperty('word-wrap', value, '');
   }
 
@@ -4702,7 +4684,7 @@
     getPropertyValue('wrap-flow');
 
   /** Sets the value of "wrap-flow" */
-  void set wrapFlow(String value) {
+  set wrapFlow(String value) {
     setProperty('wrap-flow', value, '');
   }
 
@@ -4711,7 +4693,7 @@
     getPropertyValue('wrap-through');
 
   /** Sets the value of "wrap-through" */
-  void set wrapThrough(String value) {
+  set wrapThrough(String value) {
     setProperty('wrap-through', value, '');
   }
 
@@ -4720,7 +4702,7 @@
     getPropertyValue('writing-mode');
 
   /** Sets the value of "writing-mode" */
-  void set writingMode(String value) {
+  set writingMode(String value) {
     setProperty('writing-mode', value, '');
   }
 
@@ -4729,7 +4711,7 @@
     getPropertyValue('z-index');
 
   /** Sets the value of "z-index" */
-  void set zIndex(String value) {
+  set zIndex(String value) {
     setProperty('z-index', value, '');
   }
 
@@ -4738,7 +4720,7 @@
     getPropertyValue('zoom');
 
   /** Sets the value of "zoom" */
-  void set zoom(String value) {
+  set zoom(String value) {
     setProperty('zoom', value, '');
   }
 }
diff --git a/tools/dom/templates/html/impl/impl_CanvasRenderingContext2D.darttemplate b/tools/dom/templates/html/impl/impl_CanvasRenderingContext2D.darttemplate
index 41b238e..bd70659e 100644
--- a/tools/dom/templates/html/impl/impl_CanvasRenderingContext2D.darttemplate
+++ b/tools/dom/templates/html/impl/impl_CanvasRenderingContext2D.darttemplate
@@ -280,7 +280,7 @@
   @DomName('CanvasRenderingContext2D.lineDashOffset')
   // TODO(14316): Firefox has this functionality with mozDashOffset, but it
   // needs to be polyfilled.
-  void set lineDashOffset(num value) {
+  set lineDashOffset(num value) {
     JS('void',
        'typeof #.lineDashOffset != "undefined" ? #.lineDashOffset = # : '
        '#.webkitLineDashOffset = #', this, this, value, this, value);
diff --git a/tools/dom/templates/html/impl/impl_Crypto.darttemplate b/tools/dom/templates/html/impl/impl_Crypto.darttemplate
new file mode 100644
index 0000000..1da09bb
--- /dev/null
+++ b/tools/dom/templates/html/impl/impl_Crypto.darttemplate
@@ -0,0 +1,26 @@
+// 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 $LIBRARYNAME;
+
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
+
+  TypedData getRandomValues(TypedData array) {
+$if DART2JS
+    return _getRandomValues(array);
+$else
+    var random = _getRandomValues(array);
+    // The semantics of the operation are that it modifies the argument, but we
+    // have no way of making a Dart typed data created initially in Dart reference
+    // externalized storage. So we copy the values back from the returned copy.
+    // TODO(alanknight): Make this less ridiculously slow.
+    for (var i = 0; i < random.length; i++) {
+      array[i] = random[i];
+    }
+    return array;
+$endif
+  }
+
+$!MEMBERS
+}
diff --git a/tools/dom/templates/html/impl/impl_CustomEvent.darttemplate b/tools/dom/templates/html/impl/impl_CustomEvent.darttemplate
index 29feca9..e16b74a 100644
--- a/tools/dom/templates/html/impl/impl_CustomEvent.darttemplate
+++ b/tools/dom/templates/html/impl/impl_CustomEvent.darttemplate
@@ -34,6 +34,11 @@
       e._initCustomEvent(type, canBubble, cancelable, null);
     }
 
+$if DARTIUM
+    // Need for identity.
+    js.setDartHtmlWrapperFor(e.blink_jsObject, e);
+
+$endif
     return e;
   }
 
diff --git a/tools/dom/templates/html/impl/impl_DOMException.darttemplate b/tools/dom/templates/html/impl/impl_DOMException.darttemplate
index be8c36c..9bbae84 100644
--- a/tools/dom/templates/html/impl/impl_DOMException.darttemplate
+++ b/tools/dom/templates/html/impl/impl_DOMException.darttemplate
@@ -40,7 +40,55 @@
     return errorName;
   }
 $endif
+$if JSINTEROP
+  String _name;
+  String _message;
+
+  // To suppress missing implicit constructor warnings.
+  factory DomException._() { throw new UnsupportedError("Not supported"); }
+
+  @Deprecated("Internal Use Only")
+  static DomException internalCreateDomException() {
+    return new DomException._internalWrap();
+  }
+
+  @Deprecated("Internal Use Only")
+  js.JsObject blink_jsObject;
+
+  factory DomException._internalWrap() {
+    return new DomException.internal_();
+  }
+
+  @Deprecated("Internal Use Only")
+  DomException.internal_() { }
+
+  @Deprecated("Internal Use Only")
+  DomException.jsInterop(String m) {
+    var name_index = m.indexOf(': ');
+    if (name_index < 0) {
+      _name = "";
+      _message = m;
+    } else {
+      _name = m.substring(0, name_index);
+      _message = m.substring(name_index + 1).trim();
+    }
+  }
+
+  @DomName('DOMException.message')
+  @DocsEditable()
+  String get message => _message;
+
+  @DomName('DOMException.name')
+  @DocsEditable()
+  String get name => _name;
+
+  @DomName('DOMException.toString')
+  @DocsEditable()
+  String toString() => "${_name}: $_message";
+
+$else
 $!MEMBERS
+$endif
 $if DART2JS
   @DomName('DOMException.toString')
   @DocsEditable()
diff --git a/tools/dom/templates/html/impl/impl_DataTransferItemList.darttemplate b/tools/dom/templates/html/impl/impl_DataTransferItemList.darttemplate
index 54acce1..31455d6 100644
--- a/tools/dom/templates/html/impl/impl_DataTransferItemList.darttemplate
+++ b/tools/dom/templates/html/impl/impl_DataTransferItemList.darttemplate
@@ -12,7 +12,10 @@
 $if DART2JS
     return JS('DataTransferItem', '#[#]', this, index);
 $else
-    return __getter__(index);
+    // TODO(alanknight): I think that all the __getter__ generators should just
+    // do property access, but that's major surgery. This one is a problem, so
+    // just hard-code it for now.
+    return _blink.Blink_JsNative_DomException.getProperty(unwrap_jso(this), index);
 $endif
   }
 
diff --git a/tools/dom/templates/html/impl/impl_Document.darttemplate b/tools/dom/templates/html/impl/impl_Document.darttemplate
index a9b19cf..2060813 100644
--- a/tools/dom/templates/html/impl/impl_Document.darttemplate
+++ b/tools/dom/templates/html/impl/impl_Document.darttemplate
@@ -26,11 +26,7 @@
    * [CSS selector specification](http://www.w3.org/TR/css3-selectors/).
    */
   ElementList<Element> querySelectorAll(String selectors) {
-$if JSINTEROP
-    return _querySelectorAll(selectors);
-$else
     return new _FrozenElementList._wrap(_querySelectorAll(selectors));
-$endif
   }
 
   /**
@@ -68,18 +64,74 @@
   @DomName('Document.createElement')
   Element createElement(String tagName, [String typeExtension]) {
 $if DART2JS
-    return _createElement(tagName, typeExtension);
+    if (typeExtension == null) {
+      return _createElement_2(tagName);
+    } else {
+      return _createElement(tagName, typeExtension);
+    }
 $else
-  $if JSINTEROP
-    return _createElement(tagName, typeExtension);
-  $else
-    if (typeExtension != null) {  
-      return _createElement(tagName, typeExtension);  
-    } else {  
-      // Fast-path for Dartium when typeExtension is not needed.  
-      return _Utils.createElement(this, tagName); 
-    } 
-  $endif
+    var newElement = (typeExtension == null) ?
+      _blink.BlinkDocument.instance.createElement_Callback_1_(unwrap_jso(this), tagName) :
+      _blink.BlinkDocument.instance.createElement_Callback_2_(unwrap_jso(this), tagName, typeExtension);
+
+    var wrapped = js.getDartHtmlWrapperFor(newElement);  // Here's our Dart class.
+    if (wrapped != null) {
+      wrapped.blink_jsObject = newElement;
+    } else {
+      wrapped = wrap_jso(newElement);
+      if (wrapped == null) {
+        wrapped = wrap_jso_custom_element(newElement);
+      } else {
+        js.setDartHtmlWrapperFor(wrapped.blink_jsObject, wrapped);
+      }
+    }
+
+    return wrapped;
+$endif
+  }
+
+$if DART2JS
+  // The two-argument version of this is automatically generated, but we need to
+  // omit the typeExtension if it's null on Firefox or we get an is="null" attribute.
+  @DomName('Document.createElement')
+  _createElement_2(String tagName) => JS('', '#.createElement(#)', this, tagName);
+
+  // The three-argument version of this is automatically generated, but we need to
+  // omit the typeExtension if it's null on Firefox or we get an is="null" attribute.
+  @DomName('Document.createElementNS')
+  _createElementNS_2(String namespaceURI, String qualifiedName) =>
+      JS('', '#.createElementNS(#, #)', this, namespaceURI, qualifiedName);
+
+$endif
+  @DomName('Document.createElementNS')
+  @DocsEditable()
+  Element createElementNS(String namespaceURI, String qualifiedName, [String typeExtension]) {
+$if DART2JS
+    if (typeExtension == null) {
+      return _createElementNS_2(namespaceURI, qualifiedName);
+    } else {
+      return _createElementNS(namespaceURI, qualifiedName, typeExtension);
+    }
+$else
+    var newElement = (typeExtension == null) ?
+      _blink.BlinkDocument.instance.createElementNS_Callback_2_(unwrap_jso(this), namespaceURI, qualifiedName) :
+      _blink.BlinkDocument.instance.createElementNS_Callback_3_(unwrap_jso(this), namespaceURI, qualifiedName, typeExtension);
+
+    var wrapped;
+
+    wrapped = js.getDartHtmlWrapperFor(newElement);  // Here's our Dart class.
+    if (wrapped != null) {
+      wrapped.blink_jsObject = newElement;
+    } else {
+      wrapped = wrap_jso(newElement);
+      if (wrapped == null) {
+        wrapped = wrap_jso_custom_element(newElement);
+      } else {
+        js.setDartHtmlWrapperFor(wrapped.blink_jsObject, wrapped);  // Here's our Dart class.
+      }
+    }
+
+    return wrapped;
 $endif
   }
 
diff --git a/tools/dom/templates/html/impl/impl_DocumentFragment.darttemplate b/tools/dom/templates/html/impl/impl_DocumentFragment.darttemplate
index 122b6f9..dd4d70b 100644
--- a/tools/dom/templates/html/impl/impl_DocumentFragment.darttemplate
+++ b/tools/dom/templates/html/impl/impl_DocumentFragment.darttemplate
@@ -38,7 +38,7 @@
     return _docChildren;
   }
 
-  void set children(List<Element> value) {
+  set children(List<Element> value) {
     // Copy list first since we don't want liveness during iteration.
     List copy = new List.from(value);
     var children = this.children;
@@ -58,12 +58,7 @@
    * [CSS selector specification](http://www.w3.org/TR/css3-selectors/).
    */
   ElementList<Element> querySelectorAll(String selectors) =>
-$if JSINTEROP
-    _querySelectorAll(selectors);
-$else
     new _FrozenElementList._wrap(_querySelectorAll(selectors));
-$endif
-
 
   String get innerHtml {
     final e = new Element.tag("div");
@@ -71,7 +66,7 @@
     return e.innerHtml;
   }
 
-  void set innerHtml(String value) {
+  set innerHtml(String value) {
     this.setInnerHtml(value);
   }
 
diff --git a/tools/dom/templates/html/impl/impl_DocumentType.darttemplate b/tools/dom/templates/html/impl/impl_DocumentType.darttemplate
new file mode 100644
index 0000000..88e7e6e
--- /dev/null
+++ b/tools/dom/templates/html/impl/impl_DocumentType.darttemplate
@@ -0,0 +1,16 @@
+// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+part of $LIBRARYNAME;
+
+@DocsEditable()
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
+$!MEMBERS
+$if DARTIUM
+  // Override this methods for Dartium _DocumentType can't be abstract.
+  Element get nextElementSibling => wrap_jso(_blink.BlinkDocumentType.instance.nextElementSibling_Getter_(unwrap_jso(this)));
+  Element get previousElementSibling => wrap_jso(_blink.BlinkDocumentType.instance.previousElementSibling_Getter_(unwrap_jso(this)));
+$endif
+}
+
diff --git a/tools/dom/templates/html/impl/impl_Element.darttemplate b/tools/dom/templates/html/impl/impl_Element.darttemplate
index 6f5ae1b..25608df 100644
--- a/tools/dom/templates/html/impl/impl_Element.darttemplate
+++ b/tools/dom/templates/html/impl/impl_Element.darttemplate
@@ -33,7 +33,7 @@
     _element._replaceChild(value, _childElements[index]);
   }
 
-  void set length(int newLength) {
+  set length(int newLength) {
     // TODO(jacobr): remove children when length is reduced.
     throw new UnsupportedError('Cannot resize element lists');
   }
@@ -97,7 +97,12 @@
   bool remove(Object object) {
     if (object is Element) {
       Element element = object;
+$if JSINTEROP
+      // We aren't preserving identity of nodes in JSINTEROP mode
+      if (element.parentNode == _element) {
+$else
       if (identical(element.parentNode, _element)) {
+$endif
         _element._removeChild(element);
         return true;
       }
@@ -281,7 +286,7 @@
     throw new UnsupportedError('Cannot modify list');
   }
 
-  void set length(int newLength) {
+  set length(int newLength) {
     throw new UnsupportedError('Cannot modify list');
   }
 
@@ -304,7 +309,7 @@
   CssStyleDeclarationBase get style =>
       new _CssStyleDeclarationSet(this);
 
-  void set classes(Iterable<String> value) {
+  set classes(Iterable<String> value) {
     // TODO(sra): This might be faster for Sets:
     //
     //     new _MultiElementCssClassSet(this).writeClasses(value)
@@ -328,7 +333,7 @@
 }
 
 @DocsEditable()
-$(ANNOTATIONS)$(NATIVESPEC)abstract class $CLASSNAME$EXTENDS$IMPLEMENTS {
+$(ANNOTATIONS)$(NATIVESPEC)class $CLASSNAME$EXTENDS$IMPLEMENTS {
 
   /**
    * Creates an HTML element from a valid fragment of HTML.
@@ -375,11 +380,7 @@
    *     }
    *     document.registerElement('x-custom', CustomElement);
    */
-  Element.created() : super._created() {
-    // Validate that this is a custom element & perform any additional
-    // initialization.
-    _initializeCustomElement(this);
-  }
+  Element.created() : super._created();
 
   /**
    * Creates the HTML element specified by the tag name.
@@ -560,7 +561,7 @@
    */
   Map<String, String> get attributes => new _ElementAttributeMap(this);
 
-  void set attributes(Map<String, String> value) {
+  set attributes(Map<String, String> value) {
     Map<String, String> attributes = this.attributes;
     attributes.clear();
     for (String key in value.keys) {
@@ -580,17 +581,9 @@
    *       element.style.background = 'red'; // Turns every child of body red.
    *     }
    */
-$if DART2JS
   List<Element> get children => new _ChildrenElementList._wrap(this);
-$else
-  $if JSINTEROP
-  List<Element> get children => new FilteredElementList(this);
-  $else
-  List<Element> get children => new _ChildrenElementList._wrap(this);
-  $endif
-$endif
 
-  void set children(List<Element> value) {
+  set children(List<Element> value) {
     // Copy list first since we don't want liveness during iteration.
     List copy = new List.from(value);
     var children = this.children;
@@ -611,11 +604,7 @@
    */
   @DomName('Element.querySelectorAll')
   ElementList<Element> querySelectorAll(String selectors) =>
-$if JSINTEROP
-    _querySelectorAll(selectors);
-$else
     new _FrozenElementList._wrap(_querySelectorAll(selectors));
-$endif
 
   /**
    * Alias for [querySelector]. Note this function is deprecated because its
@@ -648,7 +637,7 @@
    */
   CssClassSet get classes => new _ElementCssClassSet(this);
 
-  void set classes(Iterable<String> value) {
+  set classes(Iterable<String> value) {
     // TODO(sra): Do this without reading the classes in clear() and addAll(),
     // or writing the classes in clear().
     CssClassSet classSet = classes;
@@ -682,7 +671,7 @@
   Map<String, String> get dataset =>
     new _DataAttributeMap(attributes);
 
-  void set dataset(Map<String, String> value) {
+  set dataset(Map<String, String> value) {
     final data = this.dataset;
     data.clear();
     for (String key in value.keys) {
@@ -801,7 +790,6 @@
   @deprecated
   void leftView() {}
 
-$if DART2JS
   /**
    * Creates a new AnimationEffect object whose target element is the object
    * on which the method is called, and calls the play() method of the
@@ -816,18 +804,15 @@
    *     var animation = elem.animate([
    *       {"transform": "translate(100px, -100%)"},
    *       {"transform" : "translate(400px, 500px)"}
-   *     ], 1500);  
+   *     ], 1500);
    *
    * The [frames] parameter is an Iterable<Map>, where the
    * map entries specify CSS animation effects. The
    * [timing] paramter can be a double, representing the number of milliseconds
    * for the transition, or a Map with fields corresponding to those
    * of the [Timing] object.
-   *
-   * This is not yet supported in Dartium.
   **/
-// TODO(alanknight): Correct above comment once it works in Dartium.
-  @Experimental
+  @Experimental()
   @SupportedBrowser(SupportedBrowser.CHROME, '36')
   AnimationPlayer animate(Iterable<Map<String, dynamic>> frames, [timing]) {
     if (frames is! Iterable || !(frames.every((x) => x is Map))) {
@@ -836,7 +821,12 @@
     }
     var convertedFrames = frames;
     if (convertedFrames is Iterable) {
+$if DART2JS
       convertedFrames = frames.map(convertDartToNative_Dictionary).toList();
+$else
+      convertedFrames = convertDartToNative_List(
+          frames.map(convertDartToNative_Dictionary).toList());
+$endif
     }
     var convertedTiming = timing;
     if (convertedTiming is Map) {
@@ -847,6 +837,7 @@
       : _animate(convertedFrames, convertedTiming);
   }
 
+$if DART2JS
   @DomName('Element.animate')
   @JSName('animate')
   @Experimental() // untriaged
@@ -880,7 +871,7 @@
   // members of the component are used. The actual type is a subtype of Element.
   get xtag => _xtag != null ? _xtag : this;
 
-  void set xtag(Element value) {
+  set xtag(Element value) {
     _xtag = value;
   }
 
@@ -1006,7 +997,7 @@
 
   @JSName('insertAdjacentText')
   void _insertAdjacentText(String where, String text) native;
-  
+
 $else
 $endif
 
@@ -1269,8 +1260,13 @@
     // offsetParent, "tops out" at BODY. But people could conceivably pass in
     // the document.documentElement and I want it to return an absolute offset,
     // so we have the special case checking for HTML.
-    bool foundAsParent = identical(current, parent) || parent.tagName == 'HTML';
-    if (current == null || identical(current, parent)) {
+$if JSINTEROP
+    bool sameAsParent = current == parent;
+$else
+    bool sameAsParent = identical(current, parent);
+$endif
+    bool foundAsParent = sameAsParent || parent.tagName == 'HTML';
+    if (current == null || sameAsParent) {
       if (foundAsParent) return new Point(0, 0);
       throw new ArgumentError("Specified element is not a transitive offset "
           "parent of this element.");
@@ -1328,11 +1324,11 @@
     if (_parseDocument == null) {
       _parseDocument = document.implementation.createHtmlDocument('');
       _parseRange = _parseDocument.createRange();
-	
+
       // Workaround for Safari bug. Was also previously Chrome bug 229142
-      // - URIs are not resolved in new doc.	
-      var base = _parseDocument.createElement('base');	
-      base.href = document.baseUri;	
+      // - URIs are not resolved in new doc.
+      var base = _parseDocument.createElement('base');
+      base.href = document.baseUri;
       _parseDocument.head.append(base);
     }
     var contextElement;
@@ -1390,7 +1386,7 @@
    * This uses the default sanitization behavior to sanitize the HTML fragment,
    * use [setInnerHtml] to override the default behavior.
    */
-  void set innerHtml(String html) {
+  set innerHtml(String html) {
     this.setInnerHtml(html);
   }
 
@@ -1432,7 +1428,7 @@
    * used when an explicit accessor is not available.
    */
   ElementEvents get on => new ElementEvents(this);
-  
+
   /**
    * Verify if any of the attributes that we use in the sanitizer look unexpected,
    * possibly indicating DOM clobbering attacks.
@@ -1457,14 +1453,74 @@
 	     return true;
 	   }
 	 }
+         var length = 0;
+         if (element.children) {
+           length = element.children.length;
+         }
+         for (var i = 0; i < length; i++) {
+           var child = element.children[i];
+           // On IE it seems like we sometimes don't see the clobbered attribute,
+           // perhaps as a result of an over-optimization. Also use another route
+           // to check of attributes, children, or lastChild are clobbered. It may
+           // seem silly to check children as we rely on children to do this iteration,
+           // but it seems possible that the access to children might see the real thing,
+           // allowing us to check for clobbering that may show up in other accesses.
+           if (child["id"] == 'attributes' || child["name"] == 'attributes' ||
+               child["id"] == 'lastChild'  || child["name"] == 'lastChild' ||
+               child["id"] == 'children' || child["name"] == 'children') {
+             return true;
+           }
+         }
 	 return false;
           })(#)''', element);
   }
+
+  /// A secondary check for corruption, needed on IE
+  static bool _hasCorruptedAttributesAdditionalCheck(Element element) {
+    return JS('bool', r'!(#.attributes instanceof NamedNodeMap)', element);
+  }
 $else
-  // Dartium isn't affected by these attacks, because it goes directly to the C++ API.
-  static bool _hasCorruptedAttributes(Element element) => false;
+
+  static var _namedNodeMap = js.context["NamedNodeMap"];
+  static var _htmlCollection = js.context["HTMLCollection"];
+  static var _nodeList = js.context["NodeList"];
+
+  static bool _hasCorruptedAttributes(Element element) {
+    var attributes = unwrap_jso(element)["attributes"];
+    if (!attributes.instanceof(_namedNodeMap)) {
+      return true;
+    }
+    var childNodes = unwrap_jso(element.childNodes);
+    var length = childNodes["length"];
+    var lastChild = unwrap_jso(element.lastChild);
+    if (null != lastChild &&
+        lastChild != childNodes[length - 1]) {
+      return true;
+    }
+    var children = unwrap_jso(element._children);
+    if (null != children) { // On Safari, children can apparently be null.
+      if (!children.instanceof(_htmlCollection) ||
+          children.instanceof(_nodeList)) {
+	return true;
+      }
+    }
+    return false;
+  }
+
+  /// A secondary check for corruption, needed on IE
+  static bool _hasCorruptedAttributesAdditionalCheck(Element element) => false;
 $endif
 
+  static String _safeTagName(element) {
+    String result = 'element tag unavailable';
+    try {
+      if (element.tagName is String) {
+        result = element.tagName;
+      }
+    } catch (e) {}
+    return result;
+  }
+
 $if DART2JS
   @DomName('Element.offsetHeight')
   @DocsEditable()
@@ -1508,7 +1564,7 @@
 
   @DomName('Element.scrollLeft')
   @DocsEditable()
-  void set scrollLeft(int value) {
+  set scrollLeft(int value) {
     JS("void", "#.scrollLeft = #", this, value.round());
   }
 
@@ -1518,7 +1574,7 @@
 
   @DomName('Element.scrollTop')
   @DocsEditable()
-  void set scrollTop(int value) {
+  set scrollTop(int value) {
     JS("void", "#.scrollTop = #", this, value.round());
   }
 
@@ -1528,6 +1584,10 @@
 
 $else
   $if JSINTEROP
+  // Need to explicitly delegate because Element is no longer abstract for Dartium.
+  bool get isContentEditable => _blink.BlinkHTMLElement.instance.isContentEditable_Getter_(unwrap_jso(this));
+  void click() => _blink.BlinkHTMLElement.instance.click_Callback_0_(unwrap_jso(this));
+
   @DomName('Element.offsetHeight')
   @DocsEditable()
   int get offsetHeight => _blink.BlinkElement.instance.offsetHeight_Getter_(unwrap_jso(this)).round();
@@ -1570,7 +1630,7 @@
 
   @DomName('Element.scrollLeft')
   @DocsEditable()
-  void set scrollLeft(int value) => _blink.BlinkElement.instance.scrollLeft_Setter_(unwrap_jso(this), value.round());
+  set scrollLeft(int value) => _blink.BlinkElement.instance.scrollLeft_Setter_(unwrap_jso(this), value.round());
 
   @DomName('Element.scrollTop')
   @DocsEditable()
@@ -1578,7 +1638,7 @@
 
   @DomName('Element.scrollTop')
   @DocsEditable()
-  void set scrollTop(int value) => _blink.BlinkElement.instance.scrollTop_Setter_(unwrap_jso(this), value.round());
+  set scrollTop(int value) => _blink.BlinkElement.instance.scrollTop_Setter_(unwrap_jso(this), value.round());
 
   @DomName('Element.scrollWidth')
   @DocsEditable()
@@ -1626,7 +1686,7 @@
 
   @DomName('Element.scrollLeft')
   @DocsEditable()
-  void set scrollLeft(int value) => _blink.BlinkElement.scrollLeft_Setter(this, value.round());
+  set scrollLeft(int value) => _blink.BlinkElement.scrollLeft_Setter(this, value.round());
 
   @DomName('Element.scrollTop')
   @DocsEditable()
@@ -1634,7 +1694,7 @@
 
   @DomName('Element.scrollTop')
   @DocsEditable()
-  void set scrollTop(int value) => _blink.BlinkElement.scrollTop_Setter(this, value.round());
+  set scrollTop(int value) => _blink.BlinkElement.scrollTop_Setter(this, value.round());
 
   @DomName('Element.scrollWidth')
   @DocsEditable()
diff --git a/tools/dom/templates/html/impl/impl_EventTarget.darttemplate b/tools/dom/templates/html/impl/impl_EventTarget.darttemplate
index 8cb282e..61092fd 100644
--- a/tools/dom/templates/html/impl/impl_EventTarget.darttemplate
+++ b/tools/dom/templates/html/impl/impl_EventTarget.darttemplate
@@ -92,6 +92,12 @@
  */
 $(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
 
+$if DARTIUM
+  // Default constructor to allow other classes e.g. GlobalEventHandlers to be
+  // constructed using _internalWrap when mapping Blink object to Dart class.
+  EventTarget();
+
+$endif
   // Custom element created callback.
   EventTarget._created();
 
diff --git a/tools/dom/templates/html/impl/impl_FileReader.darttemplate b/tools/dom/templates/html/impl/impl_FileReader.darttemplate
index 0864441..ba5278f 100644
--- a/tools/dom/templates/html/impl/impl_FileReader.darttemplate
+++ b/tools/dom/templates/html/impl/impl_FileReader.darttemplate
@@ -13,7 +13,7 @@
 $if DART2JS
     var res = JS('Null|String|NativeByteBuffer', '#.result', this);
 $else
-    var res = _blink.BlinkFileReader.result_Getter(unwrap_jso(this));
+    var res = _blink.BlinkFileReader.instance.result_Getter_(unwrap_jso(this));
 $endif
     if (res is ByteBuffer) {
       return new Uint8List.view(res);
diff --git a/tools/dom/templates/html/impl/impl_HTMLAudioElement.darttemplate b/tools/dom/templates/html/impl/impl_HTMLAudioElement.darttemplate
new file mode 100644
index 0000000..838a8be
--- /dev/null
+++ b/tools/dom/templates/html/impl/impl_HTMLAudioElement.darttemplate
@@ -0,0 +1,20 @@
+// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+part of $LIBRARYNAME;
+
+@DocsEditable()
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
+$!MEMBERS
+$if JSINTEROP
+  factory AudioElement([String src]) {
+    if (src == null)
+      return wrap_jso(_blink.BlinkHTMLAudioElement.instance.constructorCallback_0_());
+    else
+      return wrap_jso(_blink.BlinkHTMLAudioElement.instance.constructorCallback_1_(src));
+  }
+$else
+  factory AudioElement([String src]) => new AudioElement._(src);
+$endif
+}
diff --git a/tools/dom/templates/html/impl/impl_HTMLDocument.darttemplate b/tools/dom/templates/html/impl/impl_HTMLDocument.darttemplate
index 3d9e6af..6cbf883 100644
--- a/tools/dom/templates/html/impl/impl_HTMLDocument.darttemplate
+++ b/tools/dom/templates/html/impl/impl_HTMLDocument.darttemplate
@@ -17,7 +17,7 @@
   BodyElement get body => _body;
 
   @DomName('Document.body')
-  void set body(BodyElement value) {
+  set body(BodyElement value) {
     _body = value;
   }
 $endif
@@ -90,7 +90,7 @@
 
   @DomName('Document.selectedStylesheetSet')
   String get selectedStylesheetSet => _selectedStylesheetSet;
-  void set selectedStylesheetSet(String value) {
+  set selectedStylesheetSet(String value) {
     _selectedStylesheetSet = value;
   }
 
@@ -101,7 +101,7 @@
   String get title => _title;
 
   @DomName('Document.title')
-  void set title(String value) {
+  set title(String value) {
     _title = value;
   }
 
@@ -187,6 +187,140 @@
 $else
   String get visibilityState => _webkitVisibilityState;
 $endif
+$if DARTIUM
+
+  /**
+   * Internal routine to find the DOM JS class name being extended for custom
+   * elements.
+   */
+  String _getJSClassName(ClassMirror classMirror) {
+    var jsClassName = null;
+    var isElement = false;
+
+    while (classMirror.superclass != null) {
+      var fullName = classMirror.superclass.qualifiedName;
+      isElement = isElement ||
+          (fullName == #dart.dom.html.Element || fullName == #dart.dom.svg.Element);
+
+      var domLibrary = MirrorSystem.getName(fullName).startsWith('dart.dom.');
+      if (jsClassName == null && domLibrary) {
+        // Lookup JS class name (if not found).
+        var metadatas = classMirror.metadata;
+        for (var metadata in metadatas) {
+          var metaDataMirror = metadata.reflectee;
+          var metaType = reflectClass(metaDataMirror.runtimeType);
+          if (MirrorSystem.getName(metaType.simpleName) == 'DomName' &&
+              (metaDataMirror.name.startsWith('HTML') || metaDataMirror.name.startsWith('SVG'))) {
+            jsClassName = metadata.reflectee.name;
+          }
+        }
+      }
+
+      classMirror = classMirror.superclass;
+    }
+
+    // If we're an element then everything is okay.
+    return isElement ? jsClassName : null;
+  }
+
+  // Get the first class that's a super of a dart.dom library.
+  ClassMirror _getDartHtmlClassName(ClassMirror classMirror) {
+    while (classMirror.superclass != null) {
+      var fullName = classMirror.superclass.qualifiedName;
+      var domLibrary = MirrorSystem.getName(fullName).startsWith('dart.dom.');
+      if (domLibrary) {
+        return classMirror.superclass;
+      }
+
+      classMirror = classMirror.superclass;
+    }
+
+    return null;
+  }
+
+  /**
+   * Get the class that immediately derived from a class in dart:html or
+   * dart:svg (has an attribute DomName of either HTML* or SVG*).
+   */
+  ClassMirror _getDomSuperClass(ClassMirror classMirror) {
+    var isElement = false;
+    var foundSuperElement = null;
+
+    while (classMirror.superclass != null) {
+      var fullName = classMirror.superclass.qualifiedName;
+      isElement = isElement || (fullName == #dart.dom.html.Element || fullName == #dart.dom.svg.Element);
+
+      var domLibrary = MirrorSystem.getName(fullName).startsWith('dart.dom.');
+      if (domLibrary) {
+        if (foundSuperElement == null) {
+          foundSuperElement = classMirror.superclass;
+        }
+        // Lookup JS class (if not found).
+        var metadatas = classMirror.metadata;
+        for (var metadata in metadatas) {
+          var metaDataMirror = metadata.reflectee;
+          var metaType = reflectClass(metaDataMirror.runtimeType);
+          if (MirrorSystem.getName(metaType.simpleName) == 'DomName' &&
+              (metaDataMirror.name.startsWith('HTML') || metaDataMirror.name.startsWith('SVG'))) {
+            if (isElement) return foundSuperElement;
+          }
+        }
+      }
+
+      classMirror = classMirror.superclass;
+    }
+
+    return null;
+  }
+
+  /**
+   * Does this CustomElement class have:
+   *
+   *   - a created constructor with no arguments?
+   *   - a created constructor with a super.created() initializer?
+   *
+   * e.g.,    MyCustomClass.created() : super.created();
+   */
+  bool _hasCreatedConstructor(ClassMirror classToRegister) {
+    var htmlClassMirror = _getDomSuperClass(classToRegister);
+
+    var classMirror = classToRegister;
+    while (classMirror != null && classMirror != htmlClassMirror) {
+      var createdParametersValid = false;
+      var superCreatedCalled = false;
+      var className = MirrorSystem.getName(classMirror.simpleName);
+      var methodMirror = classMirror.declarations[new Symbol("$className.created")];
+      if (methodMirror != null && methodMirror.isConstructor) {
+        createdParametersValid = true;                // Assume no parameters.
+        if (methodMirror.parameters.length != 0) {
+          // If any parameters each one must be optional.
+          methodMirror.parameters.forEach((parameter) {
+            createdParametersValid = createdParametersValid && parameter.isOptional;
+          });
+        }
+
+        // Get the created constructor source and look at the initializer;
+        // Must call super.created() if not its as an error.
+        var createdSource = methodMirror.source;
+        superCreatedCalled = createdSource.contains("super.created(");
+      }
+
+      if (!superCreatedCalled) {
+        throw new DomException.jsInterop('created constructor initializer must call super.created()');
+      } else if (!createdParametersValid) {
+        throw new DomException.jsInterop('created constructor must have no parameters');
+      }
+
+      classMirror = classMirror.superclass;
+      while (classMirror != classMirror.mixin) {
+        // Skip the mixins.
+        classMirror = classMirror.superclass;
+      }
+    }
+
+    return true;
+  }
+$endif
 
   @Experimental()
   /**
@@ -236,7 +370,143 @@
     _registerCustomElement(JS('', 'window'), this, tag, customElementClass,
         extendsTag);
 $else
-    _Utils.register(this, tag, customElementClass, extendsTag);
+    // Figure out which DOM class is being extended from the user's Dart class.
+    var classMirror = reflectClass(customElementClass);
+
+    var locationUri = classMirror.location.sourceUri.toString();
+    if (locationUri == 'dart:html' || locationUri == 'dart:svg') {
+      throw new DomException.jsInterop("HierarchyRequestError: Cannot register an existing dart:html or dart:svg type.");
+    }
+
+    if (classMirror.isAbstract) {
+      throw new DomException.jsInterop("HierarchyRequestError: Cannot register an abstract class.");
+    }
+
+    var jsClassName = _getJSClassName(classMirror);
+    if (jsClassName == null) {
+      // Only components derived from HTML* can be extended.
+      throw new DomException.jsInterop("HierarchyRequestError: Only HTML elements can be customized.");
+    }
+
+    var customClassType = _getDartHtmlClassName(classMirror);
+
+    if (extendsTag != null) {
+      var nativeElement = document.createElement(extendsTag);
+
+      // Trying to extend a native element is it the Dart class consistent with the
+      // extendsTag?
+      if (nativeElement.runtimeType != customClassType.reflectedType) {
+        var nativeElementClassMirror = reflectClass(nativeElement.runtimeType);
+        var customClassNativeElement = MirrorSystem.getName(customClassType.simpleName);
+        var extendsNativeElement = MirrorSystem.getName(nativeElementClassMirror.simpleName);
+        throw new DomException.jsInterop("HierarchyRequestError: Custom class type ($customClassNativeElement) and extendsTag class ($extendsNativeElement) don't match .");
+      }
+    } else if (customClassType.reflectedType != HtmlElement && customClassType.reflectedType != svg.SvgElement) {
+      var customClassName = MirrorSystem.getName(classMirror.simpleName);
+      var customClassElement = MirrorSystem.getName(customClassType.simpleName);
+      throw new DomException.jsInterop("HierarchyRequestError: Custom element $customClassName is a native $customClassElement should be derived from HtmlElement or SvgElement.");
+    }
+
+    if (_hasCreatedConstructor(classMirror)) {
+      // Start the hookup the JS way create an <x-foo> element that extends the
+      // <x-base> custom element. Inherit its prototype and signal what tag is
+      // inherited:
+      //
+      //     var myProto = Object.create(HTMLElement.prototype);
+      //     var myElement = document.registerElement('x-foo', {prototype: myProto});
+      var baseElement = js.JsNative.getProperty(js.context, jsClassName);
+      if (baseElement == null) {
+        // Couldn't find the HTML element so use a generic one.
+        baseElement = js.JsNative.getProperty(js.context, 'HTMLElement');
+      }
+      var elemProto = js.JsNative.callMethod(js.JsNative.getProperty(js.context, 'Object'), "create", [js.JsNative.getProperty(baseElement, 'prototype')]);
+
+      // Remember for any upgrading done in wrap_jso.
+      addCustomElementType(tag, customElementClass, extendsTag);
+
+      // TODO(terry): Hack to stop recursion re-creating custom element when the
+      //              created() constructor of the custom element does e.g.,
+      //
+      //                  MyElement.created() : super.created() {
+      //                    this.innerHtml = "<b>I'm an x-foo-with-markup!</b>";
+      //                  }
+      //
+      //              sanitizing causes custom element to created recursively
+      //              until stack overflow.
+      //
+      //              See https://github.com/dart-lang/sdk/issues/23666
+      int creating = 0;
+
+      // If any JS code is hooked we want to call it too.
+      var oldCreatedCallback = elemProto['createdCallback'];
+      var oldAttributeChangedCallback = elemProto['attributeChangedCallback'];
+      var oldAttachedCallback = elemProto['attachedCallback'];
+      var oldDetachedCallback = elemProto['detachedCallback'];
+
+      // TODO(jacobr): warning:
+      elemProto['createdCallback'] = js.JsNative.withThis(($this) {
+        if (_getJSClassName(reflectClass(customElementClass).superclass) != null && creating < 2) {
+          creating++;
+
+          var dartClass;
+          try {
+            if (extendsTag != null) {
+              // If we're extending a native element then create that element.
+              // Then upgrade that element to the customElementClass through
+              // normal flow.
+              dartClass = document.createElement(extendsTag);
+              js.setDartHtmlWrapperFor($this, dartClass);
+              dartClass.blink_jsObject = $this;
+            }
+
+            // Upgrade to the CustomElement Dart class.
+            dartClass = _blink.Blink_Utils.constructElement(customElementClass, $this);
+          } catch (e) {
+            // Got a problem make it an HtmlElement and rethrow the error.
+            dartClass = HtmlElement.internalCreateHtmlElement();
+            // We need to remember the JS object (because constructElement failed
+            // it normally sets up the blink_jsObject.
+            dartClass.blink_jsObject = $this;
+
+            // Mark to only try this once don't try upgrading from HtmlElement
+            // to the user's Dart class - we had a problem.
+            dartClass._badUpgrade();
+            throw e;
+          } finally {
+            // Need to remember the Dart class that was created for this custom so
+            // return it and setup the blink_jsObject to the $this that we'll be working
+            // with as we talk to blink.
+            js.setDartHtmlWrapperFor($this, dartClass);
+
+            creating--;
+          }
+        }
+
+        if (oldCreatedCallback != null)
+          oldCreatedCallback.apply([], thisArg: unwrap_jso($this));
+      });
+      elemProto['attributeChangedCallback'] = new js.JsFunction.withThis(($this, attrName, oldVal, newVal) {
+        $this.attributeChanged(attrName, oldVal, newVal);
+
+        if (oldAttributeChangedCallback != null)
+          oldAttributeChangedCallback.apply([], thisArg: unwrap_jso($this));
+      });
+      elemProto['attachedCallback'] = new js.JsFunction.withThis(($this) {
+        $this.attached();
+
+        if (oldAttachedCallback != null)
+          oldAttachedCallback.apply([], thisArg: unwrap_jso($this));
+      });
+      elemProto['detachedCallback'] = new js.JsFunction.withThis(($this) {
+        $this.detached();
+
+        if (oldDetachedCallback != null)
+          oldDetachedCallback.apply([], thisArg: unwrap_jso($this));
+      });
+      // document.registerElement('x-foo', {prototype: elemProto, extends: extendsTag});
+      var jsMap = new js.JsObject.jsify({'prototype': elemProto, 'extends': extendsTag});
+      js.JsNative.callMethod(js.JsNative.getProperty(js.context, 'document'), 'registerElement', [tag, jsMap]);
+    }
 $endif
   }
 
diff --git a/tools/dom/templates/html/impl/impl_HTMLElement.darttemplate b/tools/dom/templates/html/impl/impl_HTMLElement.darttemplate
new file mode 100644
index 0000000..1d12631
--- /dev/null
+++ b/tools/dom/templates/html/impl/impl_HTMLElement.darttemplate
@@ -0,0 +1,24 @@
+// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+part of $LIBRARYNAME;
+
+@DocsEditable()
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
+$!MEMBERS
+$if DARTIUM
+  // Flags to only try upgrading once. If there's a failure don't try upgrading
+  // anymore.
+  bool _badUpgradeOccurred = false;
+
+  /// Required for SDK Infrastructure. Internal use only.
+  ///
+  /// Did this encounter a failure attempting to upgrade to
+  /// a custom element.
+  @Deprecated("Required for SDK Infrastructure. Internal use only.")
+  bool get isBadUpgrade => _badUpgradeOccurred;
+
+  void _badUpgrade() { _badUpgradeOccurred = true; }
+$endif
+}
diff --git a/tools/dom/templates/html/impl/impl_HTMLFrameSetElement.darttemplate b/tools/dom/templates/html/impl/impl_HTMLFrameSetElement.darttemplate
new file mode 100644
index 0000000..88b5bcb
--- /dev/null
+++ b/tools/dom/templates/html/impl/impl_HTMLFrameSetElement.darttemplate
@@ -0,0 +1,21 @@
+// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+part of $LIBRARYNAME;
+
+@DocsEditable()
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
+$!MEMBERS
+$if DARTIUM
+  // Override these methods for Dartium _HTMLFrameSetElement can't be abstract.
+  Stream<Event> get onHashChange => hashChangeEvent.forTarget(this);
+  Stream<MessageEvent> get onMessage => messageEvent.forTarget(this);
+  Stream<Event> get onOffline => offlineEvent.forTarget(this);
+  Stream<Event> get onOnline => onlineEvent.forTarget(this);
+  Stream<PopStateEvent> get onPopState => popStateEvent.forTarget(this);
+  Stream<StorageEvent> get onStorage => storageEvent.forTarget(this);
+  Stream<Event> get onUnload => unloadEvent.forTarget(this);
+$endif
+}
+
diff --git a/tools/dom/templates/html/impl/impl_MutationObserver.darttemplate b/tools/dom/templates/html/impl/impl_MutationObserver.darttemplate
index d45e98a..de07dcb 100644
--- a/tools/dom/templates/html/impl/impl_MutationObserver.darttemplate
+++ b/tools/dom/templates/html/impl/impl_MutationObserver.darttemplate
@@ -21,14 +21,8 @@
 $if DARTIUM
   @DocsEditable()
   $if JSINTEROP
-  static MutationObserver _create(callback) => wrap_jso(_blink.BlinkMutationObserver.instance.constructorCallback_1_((List<MutationRecord> mutations, MutationObserver observer) {
-      var wrapped_mutations = [];
-      for (var mutation in mutations) {
-        // Wrap the Javascript object for each MutationRecord.
-        wrapped_mutations.add(wrap_jso(mutation));
-      }
-      // Wrap the MutationObserver too.
-      callback(wrapped_mutations, wrap_jso(observer));
+  static MutationObserver _create(callback) => wrap_jso(_blink.BlinkMutationObserver.instance.constructorCallback_1_((mutations, observer) {
+    callback(wrap_jso(mutations), wrap_jso(observer));
   }));
   $else
   static MutationObserver _create(callback) => _blink.BlinkMutationObserver.instance.constructorCallback_1_(callback);
diff --git a/tools/dom/templates/html/impl/impl_Node.darttemplate b/tools/dom/templates/html/impl/impl_Node.darttemplate
index 2a751d7..23b4afe 100644
--- a/tools/dom/templates/html/impl/impl_Node.darttemplate
+++ b/tools/dom/templates/html/impl/impl_Node.darttemplate
@@ -114,7 +114,12 @@
   bool remove(Object object) {
     if (object is! Node) return false;
     Node node = object;
+$if JSINTEROP
+    // We aren't preserving identity of nodes in JSINTEROP mode
+    if (_this != node.parentNode) return false;
+$else
     if (!identical(_this, node.parentNode)) return false;
+$endif
     _this._removeChild(node);
     return true;
   }
@@ -178,7 +183,7 @@
   // a local copy of childNodes is more efficient.
   int get length => _this.childNodes.length;
 
-  void set length(int value) {
+  set length(int value) {
     throw new UnsupportedError(
         "Cannot set length on immutable List.");
   }
@@ -192,7 +197,18 @@
 $(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
 
   // Custom element created callback.
+$if DART2JS
   Node._created() : super._created();
+$else
+  Node._created() : super._created() {
+    // By this point blink_jsObject should be setup if it's not then we weren't
+    // called by the registerElement createdCallback - probably created() was
+    // called directly which is verboten.
+    if (this.blink_jsObject == null) {
+      throw new DomException.jsInterop("the created constructor cannot be called directly");
+    }
+  }
+$endif
 
   /**
    * A modifiable list of this node's children.
@@ -201,7 +217,7 @@
     return new _ChildNodeListLazy(this);
   }
 
-  void set nodes(Iterable<Node> value) {
+  set nodes(Iterable<Node> value) {
     // Copy list first since we don't want liveness during iteration.
     // TODO(jacobr): there is a better way to do this.
     List copy = new List.from(value);
@@ -277,9 +293,7 @@
     return value == null ? super.toString() : value;
   }
 
-$if JSINTEROP
-  List<Node> _childNodes;
-
+$if DARTIUM
   /**
    * A list of this node's children.
    *
@@ -291,37 +305,8 @@
    */
   @DomName('Node.childNodes')
   @DocsEditable()
-  @Returns('NodeList')
-  @Creates('NodeList')
-  List<Node> get childNodes {
-    if (_childNodes == null) {
-       List<Node> nodes = new List<Node>();
-       var jsCollection = _blink.BlinkNode.instance.childNodes_Getter_(unwrap_jso(this));
-       var collectionLen = jsCollection['length'];
-       for (var i = 0; i < collectionLen; i++) {
-         nodes.add(wrap_jso(jsCollection.callMethod('item', [i])));
-       }
-      _childNodes = nodes;
-    }
-    return _childNodes;
-  }
+  List<Node> get childNodes => wrap_jso(_blink.BlinkNode.instance.childNodes_Getter_(unwrap_jso(this)));
 $else
-  $if DARTIUM
-  /**
-   * A list of this node's children.
-   *
-   * ## Other resources
-   *
-   * * [Node.childNodes]
-   * (https://developer.mozilla.org/en-US/docs/Web/API/Node.childNodes)
-   * from MDN.
-   */
-  @DomName('Node.childNodes')
-  @DocsEditable()
-  @Returns('NodeList')
-  @Creates('NodeList')
-  List<Node> get childNodes => _blink.BlinkNode.instance.childNodes_Getter_(this);
-  $else
   /**
    * A list of this node's children.
    *
@@ -337,7 +322,6 @@
   @Creates('NodeList')
   final List<Node> childNodes;
 
-  $endif
 $endif
 $!MEMBERS
 }
diff --git a/tools/dom/templates/html/impl/impl_SVGCursorElement.darttemplate b/tools/dom/templates/html/impl/impl_SVGCursorElement.darttemplate
new file mode 100644
index 0000000..1aa46f4
--- /dev/null
+++ b/tools/dom/templates/html/impl/impl_SVGCursorElement.darttemplate
@@ -0,0 +1,19 @@
+// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+part of $LIBRARYNAME;
+
+@DocsEditable()
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
+$!MEMBERS
+$if DARTIUM
+  // Override these methods for Dartium _SVGCursorElement can't be abstract.
+  StringList get requiredExtensions => wrap_jso(_blink.BlinkSVGCursorElement.instance.requiredExtensions_Getter_(unwrap_jso(this)));
+  StringList get requiredFeatures => wrap_jso(_blink.BlinkSVGCursorElement.instance.requiredFeatures_Getter_(unwrap_jso(this)));
+  StringList get systemLanguage => wrap_jso(_blink.BlinkSVGCursorElement.instance.systemLanguage_Getter_(unwrap_jso(this)));
+  AnimatedString get href => wrap_jso(_blink.BlinkSVGCursorElement.instance.href_Getter_(unwrap_jso(this)));
+  bool hasExtension(String extension) => _blink.BlinkSVGCursorElement.instance.hasExtension_Callback_1_(unwrap_jso(this), extension);
+$endif
+}
+
diff --git a/tools/dom/templates/html/impl/impl_SVGElement.darttemplate b/tools/dom/templates/html/impl/impl_SVGElement.darttemplate
index 2eaafe6..b41f7ec 100644
--- a/tools/dom/templates/html/impl/impl_SVGElement.darttemplate
+++ b/tools/dom/templates/html/impl/impl_SVGElement.darttemplate
@@ -58,7 +58,7 @@
 
   List<Element> get children => new FilteredElementList(this);
 
-  void set children(List<Element> value) {
+  set children(List<Element> value) {
     final children = this.children;
     children.clear();
     children.addAll(value);
@@ -78,7 +78,7 @@
     return container.innerHtml;
   }
 
-  void set innerHtml(String value) {
+  set innerHtml(String value) {
     this.setInnerHtml(value);
   }
 
@@ -143,5 +143,21 @@
     var e = new $CLASSNAME.tag(tag);
     return e is $CLASSNAME && !(e is UnknownElement);
   }
+
+$if JSINTEROP
+  set _svgClassName(AnimatedString value) =>
+      _blink.BlinkSVGElement.instance.className_Setter_(unwrap_jso(this), unwrap_jso(value));
+
+  String get className => _svgClassName.baseVal;
+
+  // Unbelievable hack. We can't create an SvgAnimatedString, but we can get
+  // the existing one and change its baseVal. Then we call the blink setter directly
+  // TODO(alanknight): Handle suppressing the SVGAnimated<*> better
+  set className(String s) {
+    var oldClass = _svgClassName;
+    oldClass.baseVal = s;
+    _svgClassName = oldClass;
+  }
+$endif
 $!MEMBERS
 }
diff --git a/tools/dom/templates/html/impl/impl_SVGFEDropShadowElement.darttemplate b/tools/dom/templates/html/impl/impl_SVGFEDropShadowElement.darttemplate
new file mode 100644
index 0000000..96363a8
--- /dev/null
+++ b/tools/dom/templates/html/impl/impl_SVGFEDropShadowElement.darttemplate
@@ -0,0 +1,19 @@
+// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+part of $LIBRARYNAME;
+
+@DocsEditable()
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
+$!MEMBERS
+$if DARTIUM
+  // Override these methods for Dartium _SVGFEDropShadowElement can't be abstract.
+  AnimatedLength get height => wrap_jso(_blink.BlinkSVGFEDropShadowElement.instance.height_Getter_(unwrap_jso(this)));
+  AnimatedString get result => wrap_jso(_blink.BlinkSVGFEDropShadowElement.instance.result_Getter_(unwrap_jso(this)));
+  AnimatedLength get width => wrap_jso(_blink.BlinkSVGFEDropShadowElement.instance.width_Getter_(unwrap_jso(this)));
+  AnimatedLength get x => wrap_jso(_blink.BlinkSVGFEDropShadowElement.instance.x_Getter_(unwrap_jso(this)));
+  AnimatedLength get y => wrap_jso(_blink.BlinkSVGFEDropShadowElement.instance.y_Getter_(unwrap_jso(this)));
+$endif
+}
+
diff --git a/tools/dom/templates/html/impl/impl_SVGGlyphRefElement.darttemplate b/tools/dom/templates/html/impl/impl_SVGGlyphRefElement.darttemplate
new file mode 100644
index 0000000..4c88084
--- /dev/null
+++ b/tools/dom/templates/html/impl/impl_SVGGlyphRefElement.darttemplate
@@ -0,0 +1,15 @@
+// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+part of $LIBRARYNAME;
+
+@DocsEditable()
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
+$!MEMBERS
+$if DARTIUM
+  // Override these methods for Dartium _SVGGlyphRefElement can't be abstract.
+  AnimatedString get href => wrap_jso(_blink.BlinkSVGGlyphRefElement.instance.href_Getter_(unwrap_jso(this)));
+$endif
+}
+
diff --git a/tools/dom/templates/html/impl/impl_SVGMPathElement.darttemplate b/tools/dom/templates/html/impl/impl_SVGMPathElement.darttemplate
new file mode 100644
index 0000000..59e012e
--- /dev/null
+++ b/tools/dom/templates/html/impl/impl_SVGMPathElement.darttemplate
@@ -0,0 +1,15 @@
+// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+part of $LIBRARYNAME;
+
+@DocsEditable()
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
+$!MEMBERS
+$if DARTIUM
+  // Override these methods for Dartium _SVGMPathElement can't be abstract.
+  AnimatedString get href => wrap_jso(_blink.BlinkSVGMPathElement.instance.href_Getter_(unwrap_jso(this)));
+$endif
+}
+
diff --git a/tools/dom/templates/html/impl/impl_ServiceWorker.darttemplate b/tools/dom/templates/html/impl/impl_ServiceWorker.darttemplate
new file mode 100644
index 0000000..6cb64ab
--- /dev/null
+++ b/tools/dom/templates/html/impl/impl_ServiceWorker.darttemplate
@@ -0,0 +1,15 @@
+// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+part of $LIBRARYNAME;
+
+@DocsEditable()
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
+$!MEMBERS
+$if DARTIUM
+  // Override these methods for Dartium _ServiceWorker can't be abstract.
+  Stream<ErrorEvent> get onError => errorEvent.forTarget(this);
+$endif
+}
+
diff --git a/tools/dom/templates/html/impl/impl_ShadowRoot.darttemplate b/tools/dom/templates/html/impl/impl_ShadowRoot.darttemplate
index 57a44bb..e08cb4d 100644
--- a/tools/dom/templates/html/impl/impl_ShadowRoot.darttemplate
+++ b/tools/dom/templates/html/impl/impl_ShadowRoot.darttemplate
@@ -35,7 +35,7 @@
   }
 
   @deprecated
-  void set resetStyleInheritance(bool value) {
+  set resetStyleInheritance(bool value) {
     _shadowRootDeprecationReport();
   }
 
@@ -47,7 +47,7 @@
   }
 
   @deprecated
-  void set applyAuthorStyles(bool value) {
+  set applyAuthorStyles(bool value) {
     _shadowRootDeprecationReport();
   }
 }
diff --git a/tools/dom/templates/html/impl/impl_Touch.darttemplate b/tools/dom/templates/html/impl/impl_Touch.darttemplate
index fbab125..bab04a5 100644
--- a/tools/dom/templates/html/impl/impl_Touch.darttemplate
+++ b/tools/dom/templates/html/impl/impl_Touch.darttemplate
@@ -20,14 +20,14 @@
   int get __radiusX => JS('num', '#.radiusX', this).round();
   int get __radiusY => JS('num', '#.radiusY', this).round();
 $else
-  int get __clientX => _blink.BlinkTouch.clientX_Getter(unwrap_jso(this)).round();
-  int get __clientY => _blink.BlinkTouch.clientY_Getter(unwrap_jso(this)).round();
-  int get __screenX => _blink.BlinkTouch.screenX_Getter(unwrap_jso(this)).round();
-  int get __screenY => _blink.BlinkTouch.screenY_Getter(unwrap_jso(this)).round();
-  int get __pageX => _blink.BlinkTouch.pageX_Getter(unwrap_jso(this)).round();
-  int get __pageY => _blink.BlinkTouch.pageY_Getter(unwrap_jso(this)).round();
-  int get __radiusX => _blink.BlinkTouch.radiusX_Getter(unwrap_jso(this)).round();
-  int get __radiusY => _blink.BlinkTouch.radiusY_Getter(unwrap_jso(this)).round();
+  int get __clientX => _blink.BlinkTouch.instance.clientX_Getter_(unwrap_jso(this)).round();
+  int get __clientY => _blink.BlinkTouch.instance.clientY_Getter_(unwrap_jso(this)).round();
+  int get __screenX => _blink.BlinkTouch.instance.screenX_Getter_(unwrap_jso(this)).round();
+  int get __screenY => _blink.BlinkTouch.instance.screenY_Getter_(unwrap_jso(this)).round();
+  int get __pageX => _blink.BlinkTouch.instance.pageX_Getter_(unwrap_jso(this)).round();
+  int get __pageY => _blink.BlinkTouch.instance.pageY_Getter_(unwrap_jso(this)).round();
+  int get __radiusX => _blink.BlinkTouch.instance.radiusX_Getter_(unwrap_jso(this)).round();
+  int get __radiusY => _blink.BlinkTouch.instance.radiusY_Getter_(unwrap_jso(this)).round();
 $endif
 
   @DomName('Touch.clientX')
diff --git a/tools/dom/templates/html/impl/impl_WheelEvent.darttemplate b/tools/dom/templates/html/impl/impl_WheelEvent.darttemplate
index 8a5e383..d4f5d3f 100644
--- a/tools/dom/templates/html/impl/impl_WheelEvent.darttemplate
+++ b/tools/dom/templates/html/impl/impl_WheelEvent.darttemplate
@@ -39,12 +39,12 @@
     if (view == null) {
       view = window;
     }
-    
+
     return JS('WheelEvent', 'new WheelEvent(#, #)',
         type, convertDartToNative_Dictionary(options));
 
 $else
-    return _blink.BlinkWheelEvent.constructorCallback_2(type, options);
+    return wrap_jso(_blink.BlinkWheelEvent.instance.constructorCallback_2_(type, convertDartToNative_Dictionary(options)));
 $endif
   }
 
diff --git a/tools/dom/templates/html/impl/impl_Window.darttemplate b/tools/dom/templates/html/impl/impl_Window.darttemplate
index b119a08..36dfc9a 100644
--- a/tools/dom/templates/html/impl/impl_Window.darttemplate
+++ b/tools/dom/templates/html/impl/impl_Window.darttemplate
@@ -85,13 +85,13 @@
    * Sets the window's location, which causes the browser to navigate to the new
    * location. [value] may be a Location object or a String.
    */
-  void set location(value) {
+  set location(value) {
     _location = value;
   }
 
   // Native getter and setter to access raw Location object.
   dynamic get _location => JS('Location|Null', '#.location', this);
-  void set _location(value) {
+  set _location(value) {
     JS('void', '#.location = #', this, value);
   }
 
@@ -320,7 +320,7 @@
 
   String get returnValue => _returnValue;
 
-  void set returnValue(String value) {
+  set returnValue(String value) {
     _returnValue = value;
     // FF and IE use the value as the return value, Chrome will return this from
     // the event callback function.
diff --git a/tools/dom/templates/html/impl/impl_WorkerLocation.darttemplate b/tools/dom/templates/html/impl/impl_WorkerLocation.darttemplate
new file mode 100644
index 0000000..73623a9
--- /dev/null
+++ b/tools/dom/templates/html/impl/impl_WorkerLocation.darttemplate
@@ -0,0 +1,23 @@
+// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+part of $LIBRARYNAME;
+
+@DocsEditable()
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
+$!MEMBERS
+$if DARTIUM
+  // Override these methods for Dartium _WorkerLocation can't be abstract.
+  String get hash => _blink.BlinkWorkerLocation.instance.hash_Getter_(unwrap_jso(this));
+  String get host => _blink.BlinkWorkerLocation.instance.host_Getter_(unwrap_jso(this));
+  String get hostname => _blink.BlinkWorkerLocation.instance.hostname_Getter_(unwrap_jso(this));
+  String get href => _blink.BlinkWorkerLocation.instance.href_Getter_(unwrap_jso(this));
+  String get origin => _blink.BlinkWorkerLocation.instance.origin_Getter_(unwrap_jso(this));
+  String get pathname => _blink.BlinkWorkerLocation.instance.pathname_Getter_(unwrap_jso(this));
+  String get port => _blink.BlinkWorkerLocation.instance.port_Getter_(unwrap_jso(this));
+  String get protocol => _blink.BlinkWorkerLocation.instance.protocol_Getter_(unwrap_jso(this));
+  String get search => _blink.BlinkWorkerLocation.instance.search_Getter_(unwrap_jso(this));
+$endif
+}
+
diff --git a/tools/dom/templates/html/impl/impl_WorkerNavigator.darttemplate b/tools/dom/templates/html/impl/impl_WorkerNavigator.darttemplate
new file mode 100644
index 0000000..137390c
--- /dev/null
+++ b/tools/dom/templates/html/impl/impl_WorkerNavigator.darttemplate
@@ -0,0 +1,23 @@
+// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+part of $LIBRARYNAME;
+
+@DocsEditable()
+$(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS {
+$!MEMBERS
+$if DARTIUM
+  // Override these methods for Dartium _WorkerNavigator can't be abstract.
+  String get appCodeName => _blink.BlinkWorkerNavigator.instance.appCodeName_Getter_(unwrap_jso(this));
+  String get appName => _blink.BlinkWorkerNavigator.instance.appCodeName_Getter_(unwrap_jso(this));
+  String get appVersion => _blink.BlinkWorkerNavigator.instance.appVersion_Getter_(unwrap_jso(this));
+  bool get dartEnabled => _blink.BlinkWorkerNavigator.instance.dartEnabled_Getter_(unwrap_jso(this));
+  String get platform => _blink.BlinkWorkerNavigator.instance.platform_Getter_(unwrap_jso(this));
+  String get product => _blink.BlinkWorkerNavigator.instance.product_Getter_(unwrap_jso(this));
+  String get userAgent => _blink.BlinkWorkerNavigator.instance.userAgent_Getter_(unwrap_jso(this));
+  int get hardwareConcurrency => _blink.BlinkWorkerNavigator.instance.hardwareConcurrency_Getter_(unwrap_jso(this));
+  bool get onLine => _blink.BlinkWorkerNavigator.instance.onLine_Getter_(unwrap_jso(this));
+$endif
+}
+
diff --git a/tools/dom/templates/html/impl/impl_XMLHttpRequest.darttemplate b/tools/dom/templates/html/impl/impl_XMLHttpRequest.darttemplate
index d7fffe9..7ee15d1 100644
--- a/tools/dom/templates/html/impl/impl_XMLHttpRequest.darttemplate
+++ b/tools/dom/templates/html/impl/impl_XMLHttpRequest.darttemplate
@@ -384,5 +384,34 @@
     return headers;
   }
 
+  /**
+   * Specify the desired `url`, and `method` to use in making the request.
+   *
+   * By default the request is done asyncronously, with no user or password
+   * authentication information. If `async` is false, the request will be send
+   * synchronously.
+   *
+   * Calling `open` again on a currently active request is equivalent to
+   * calling `abort`.
+   *
+   * Note: Most simple HTTP requests can be accomplished using the [getString],
+   * [request], [requestCrossOrigin], or [postFormData] methods. Use of this
+   * `open` method is intended only for more complext HTTP requests where
+   * finer-grained control is needed.
+   */
+  @DomName('XMLHttpRequest.open')
+  @DocsEditable()
+$if JSINTEROP
+  void open(String method, String url, {bool async, String user, String password}) {
+    if (async == null && user == null && password == null) {
+      _blink.BlinkXMLHttpRequest.instance.open_Callback_2_(unwrap_jso(this), method, url);
+    } else {
+      _blink.BlinkXMLHttpRequest.instance.open_Callback_5_(unwrap_jso(this), method, url, async, user, password);
+    }
+  }
+$else
+  void open(String method, String url, {bool async, String user, String password}) native;
+$endif
+
 $!MEMBERS
 }
diff --git a/tools/dom/templates/immutable_list_mixin.darttemplate b/tools/dom/templates/immutable_list_mixin.darttemplate
index 78a846f..b9820dc 100644
--- a/tools/dom/templates/immutable_list_mixin.darttemplate
+++ b/tools/dom/templates/immutable_list_mixin.darttemplate
@@ -7,7 +7,7 @@
 $endif
 
 $if DEFINE_LENGTH_SETTER
-  void set length(int value) {
+  set length(int value) {
     throw new UnsupportedError("Cannot resize immutable List.");
   }
 $endif
diff --git a/tools/gyp/configurations_make.gypi b/tools/gyp/configurations_make.gypi
index 9f8b0e2..683ca51 100644
--- a/tools/gyp/configurations_make.gypi
+++ b/tools/gyp/configurations_make.gypi
@@ -71,19 +71,19 @@
 
       'Dart_Linux_simarm_Base': {
         'abstract': 1,
-        'cflags': [ '-O3', '-m32', '-msse2' ],
+        'cflags': [ '-O3', '-m32', '-msse2', '-mfpmath=sse' ],
         'ldflags': [ '-m32', ],
       },
 
       'Dart_Linux_simarmv5te_Base': {
         'abstract': 1,
-        'cflags': [ '-O3', '-m32', '-msse2' ],
+        'cflags': [ '-O3', '-m32', '-msse2', '-mfpmath=sse' ],
         'ldflags': [ '-m32', ],
       },
 
       'Dart_Linux_simarm64_Base': {
         'abstract': 1,
-        'cflags': [ '-O3', '-m64', '-msse2' ],
+        'cflags': [ '-O3', '-m64', '-msse2', '-mfpmath=sse' ],
         'ldflags': [ '-m64', ],
       },
 
@@ -100,7 +100,7 @@
           ],
         }],
         ['_toolset=="host"', {
-          'cflags': ['-m32', '-msse2'],
+          'cflags': ['-m32', '-msse2', '-mfpmath=sse' ],
           'ldflags': ['-m32'],
         }]]
       },
@@ -131,7 +131,7 @@
           ],
         }],
         ['_toolset=="host"', {
-          'cflags': ['-m32', '-msse2'],
+          'cflags': ['-m32', '-msse2', '-mfpmath=sse' ],
           'ldflags': ['-m32'],
         }]]
       },
@@ -170,7 +170,7 @@
 
       'Dart_Linux_simmips_Base': {
         'abstract': 1,
-        'cflags': [ '-O3', '-m32', '-msse2' ],
+        'cflags': [ '-O3', '-m32', '-msse2', '-mfpmath=sse' ],
         'ldflags': [ '-m32', ],
       },
 
@@ -190,7 +190,7 @@
             ],
           }],
           ['_toolset=="host"',{
-            'cflags': [ '-O3', '-m32', '-msse2' ],
+            'cflags': [ '-O3', '-m32', '-msse2', '-mfpmath=sse' ],
             'ldflags': [ '-m32' ],
         }]]
       },
diff --git a/tools/gyp/find_mac_gcc_version.py b/tools/gyp/find_mac_gcc_version.py
index 40670ec..79e9af3e 100755
--- a/tools/gyp/find_mac_gcc_version.py
+++ b/tools/gyp/find_mac_gcc_version.py
@@ -25,7 +25,7 @@
       return '4.2'
     elif major == 4 and minor < 5:
       return 'com.apple.compilers.llvmgcc42'
-    elif (major == 4 and minor >= 5) or major == 5 or major == 6:
+    elif (major == 4 and minor >= 5) or major >= 5:
       # XCode seems to select the specific clang version automatically
       return 'com.apple.compilers.llvm.clang.1_0'
     else:
diff --git a/tools/make_links.py b/tools/make_links.py
index 5599e99..58bc9cb 100644
--- a/tools/make_links.py
+++ b/tools/make_links.py
@@ -28,6 +28,9 @@
 import sys
 import utils
 
+# Useful messages when we find orphaned checkouts.
+old_directories = {'package_config':
+  'Please remove third_party/pkg/package_config.'}
 
 def get_options():
   result = optparse.OptionParser()
@@ -86,6 +89,7 @@
         os.remove(full_link)
   else:
     os.makedirs(target)
+  linked_names = {}; 
   for source in args[1:]:
     # Assume the source directory is named ".../NAME/lib".
     split = source.split(':')
@@ -98,6 +102,15 @@
     # Remove any additional path components preceding NAME, if one wasn't
     # specified explicitly.
     if not name: (_, name) = os.path.split(path)
+    # We have an issue with left-behind checkouts in third_party/pkg and
+    # third_party/pkg_tested when we move entries in DEPS. This reports them.
+    if name in linked_names:
+      print 'Duplicate directory %s is linked to both %s and %s.' % (
+          name, linked_names[name], path)
+      if name in old_directories:
+        print old_directories[name]
+      return 1
+    linked_names[name] = path
     orig_source = source
     if utils.GuessOS() == 'win32':
       source = os.path.relpath(source)
diff --git a/tools/observatory_tool.py b/tools/observatory_tool.py
index fab2183..5b1c7c5 100755
--- a/tools/observatory_tool.py
+++ b/tools/observatory_tool.py
@@ -6,13 +6,16 @@
 
 import argparse
 import os
+import platform
 import shutil
 import subprocess
 import sys
+import utils
 
 SCRIPT_DIR = os.path.dirname(sys.argv[0])
 DART_ROOT = os.path.realpath(os.path.join(SCRIPT_DIR, '..'))
-RUN_PUB = os.path.join(DART_ROOT, 'tools/run_pub.py')
+PUB_PATH = os.path.join(DART_ROOT, 'third_party', 'pkg',
+                        'pub', 'bin', 'pub.dart')
 IGNORE_PATTERNS = shutil.ignore_patterns(
     '*.map',
     '*.concat.js',
@@ -24,7 +27,7 @@
     '*.log',
     '*~')
 
-usage = """obs_tool.py [options]"""
+usage = """observatory_tool.py [options]"""
 
 def BuildArguments():
   result = argparse.ArgumentParser(usage=usage)
@@ -34,68 +37,89 @@
   result.add_argument("--directory", help="observatory root", default=None)
   result.add_argument("--command", help="[get, build, deploy]", default=None)
   result.add_argument("--silent", help="silence all output", default=False)
+  result.add_argument("--sdk", help="Use prebuilt sdk", default=False)
   return result
 
 def ProcessOptions(options, args):
-  # Required options.
-  if (options.command == None) or (options.directory == None):
-    return False
-  # If we have a pub executable, we are running from the dart-sdk.
-  if (options.pub_executable != None):
-    return True
-  # Otherwise, we need a dart executable and a package root.
-  return ((options.package_root != None) and
-          (options.dart_executable != None))
+  with open(os.devnull, 'wb') as silent_sink:
+    # Required options.
+    if options.command is None or options.directory is None:
+      return False
+
+    # Set a default value for pub_snapshot.
+    options.pub_snapshot = None
+
+    # If we have a working pub executable, try and use that.
+    # TODO(whesse): Drop the pub-executable option if it isn't used.
+    if options.pub_executable is not None:
+      try:
+        if 0 == subprocess.call([options.pub_executable, '--version'],
+                                stdout=silent_sink,
+                                stderr=silent_sink):
+          return True
+      except OSError as e:
+        pass
+    options.pub_executable = None
+
+    if options.sdk is not None and utils.CheckedInSdkCheckExecutable():
+      # Use the checked in pub executable.
+      options.pub_snapshot = os.path.join(utils.CheckedInSdkPath(),
+                                          'bin',
+                                          'snapshots',
+                                          'pub.dart.snapshot');
+      try:
+        if 0 == subprocess.call([utils.CheckedInSdkExecutable(),
+                                 options.pub_snapshot,
+                                 '--version'],
+                                 stdout=silent_sink,
+                                 stderr=silent_sink):
+          return True
+      except OSError as e:
+        pass
+    options.pub_snapshot = None
+
+    # We need a dart executable and a package root.
+    return (options.package_root is not None and
+            options.dart_executable is not None)
 
 def ChangeDirectory(directory):
   os.chdir(directory);
 
-def PubGet(dart_executable, pub_executable, pkg_root, silent):
-  # Always remove pubspec.lock before running 'pub get'.
-  try:
-    os.remove('pubspec.lock');
-  except OSError as e:
-    pass
-  with open(os.devnull, 'wb') as silent_sink:
-    if (pub_executable != None):
-      return subprocess.call([pub_executable,
-                              'get',
-                              '--offline'],
-                              stdout=silent_sink if silent else None,
-                              stderr=silent_sink if silent else None)
-    else:
-      return subprocess.call(['python',
-                              RUN_PUB,
-                              '--package-root=' + pkg_root,
-                              '--dart-executable=' + dart_executable,
-                              'get',
-                              '--offline'],
-                              stdout=silent_sink if silent else None,
-                              stderr=silent_sink if silent else None,)
+def DisplayBootstrapWarning():
+  print """\
 
-def PubBuild(dart_executable, pub_executable, pkg_root, silent, output_dir):
+
+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 PubCommand(dart_executable,
+               pub_executable,
+               pub_snapshot,
+               pkg_root,
+               command,
+               silent):
   with open(os.devnull, 'wb') as silent_sink:
-    if (pub_executable != None):
-      return subprocess.call([pub_executable,
-                              'build',
-                              '--output',
-                              output_dir],
-                              stdout=silent_sink if silent else None,
-                              stderr=silent_sink if silent else None,)
+    if pub_executable is not None:
+      executable = [pub_executable]
+    elif pub_snapshot is not None:
+      executable = [utils.CheckedInSdkExecutable(), pub_snapshot]
     else:
-      return subprocess.call(['python',
-                              RUN_PUB,
-                              '--package-root=' + pkg_root,
-                              '--dart-executable=' + dart_executable,
-                              'build',
-                              '--output',
-                              output_dir],
-                              stdout=silent_sink if silent else None,
-                              stderr=silent_sink if silent else None,)
+      DisplayBootstrapWarning()
+      executable = [dart_executable, '--package-root=' + pkg_root, PUB_PATH]
+    return subprocess.call(executable + command,
+                           stdout=silent_sink if silent else None,
+                           stderr=silent_sink if silent else None)
 
 def Deploy(input_dir, output_dir):
   shutil.rmtree(output_dir)
   shutil.copytree(input_dir, output_dir, ignore=IGNORE_PATTERNS)
+  index_file = os.path.join(output_dir, 'web', 'index.html')
+  os.utime(index_file, None)
   return 0
 
 def RewritePubSpec(input_path, output_path, search, replace):
@@ -108,16 +132,26 @@
 def ExecuteCommand(options, args):
   cmd = options.command
   if (cmd == 'get'):
-    return PubGet(options.dart_executable,
-                  options.pub_executable,
-                  options.package_root,
-                  options.silent)
+    # Always remove pubspec.lock before running 'pub get'.
+    try:
+      os.remove('pubspec.lock');
+    except OSError as e:
+      pass
+    return PubCommand(options.dart_executable,
+                      options.pub_executable,
+                      options.pub_snapshot,
+                      options.package_root,
+                      ['get', '--offline'],
+                      options.silent)
   elif (cmd == 'build'):
-    return PubBuild(options.dart_executable,
-                    options.pub_executable,
-                    options.package_root,
-                    options.silent,
-                    args[0])
+    return PubCommand(options.dart_executable,
+                      options.pub_executable,
+                      options.pub_snapshot,
+                      options.package_root,
+                      ['build',
+                       '-DOBS_VER=' + utils.GetVersion(),
+                       '--output', args[0]],
+                      options.silent)
   elif (cmd == 'deploy'):
     Deploy('build', 'deployed')
   elif (cmd == 'rewrite'):
@@ -133,8 +167,6 @@
   if not ProcessOptions(options, args):
     parser.print_help()
     return 1
-  if os.getenv('DART_USE_BOOTSTRAP_BIN') != None:
-    dart_executable = options.dart_executable
   # Calculate absolute paths before changing directory.
   if (options.package_root != None):
     options.package_root = os.path.abspath(options.package_root)
@@ -142,6 +174,8 @@
     options.dart_executable = os.path.abspath(options.dart_executable)
   if (options.pub_executable != None):
     options.pub_executable = os.path.abspath(options.pub_executable)
+  if (options.pub_snapshot != None):
+    options.pub_snapshot = os.path.abspath(options.pub_snapshot)
   if len(args) == 1:
     args[0] = os.path.abspath(args[0])
   # Pub must be run from the project's root directory.
@@ -149,4 +183,4 @@
   return ExecuteCommand(options, args)
 
 if __name__ == '__main__':
-  sys.exit(main());
\ No newline at end of file
+  sys.exit(main());
diff --git a/tools/precompilation/test_linux.sh b/tools/precompilation/test_linux.sh
new file mode 100755
index 0000000..e8839e1
--- /dev/null
+++ b/tools/precompilation/test_linux.sh
@@ -0,0 +1,13 @@
+#!/bin/bash -ex
+
+# Usage:
+#   cd sdk
+#   ./tools/precompilation/test_linux.sh
+
+./tools/build.py -mdebug -ax64 runtime
+
+./out/DebugX64/dart_no_snapshot --gen-precompiled-snapshot ~/hello.dart
+
+gcc -m64 -shared -Wl,-soname,libprecompiled.so -o libprecompiled.so precompiled.S
+
+LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$PWD" gdb -ex run --args ./out/DebugX64/dart --run-precompiled-snapshot not_used.dart
diff --git a/tools/precompilation/test_linux_simarm.sh b/tools/precompilation/test_linux_simarm.sh
new file mode 100755
index 0000000..b55a5e9
--- /dev/null
+++ b/tools/precompilation/test_linux_simarm.sh
@@ -0,0 +1,13 @@
+#!/bin/bash -ex
+
+# Usage:
+#   cd sdk
+#   ./tools/precompilation/test_linux.sh
+
+./tools/build.py -mdebug -asimarm runtime
+
+./out/DebugSIMARM/dart_no_snapshot --gen-precompiled-snapshot ~/hello.dart
+
+gcc -m32 -shared -Wl,-soname,libprecompiled.so -o libprecompiled.so precompiled.S
+
+LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$PWD" gdb -ex run --args ./out/DebugSIMARM/dart --run-precompiled-snapshot not_used.dart
diff --git a/tools/precompilation/test_macos.sh b/tools/precompilation/test_macos.sh
new file mode 100755
index 0000000..48e318d
--- /dev/null
+++ b/tools/precompilation/test_macos.sh
@@ -0,0 +1,13 @@
+#!/bin/bash -ex
+
+# Usage:
+#   cd sdk
+#   ./tools/precompilation/test_macos.sh
+
+./tools/build.py -mdebug -ax64 runtime
+
+./xcodebuild/DebugX64/dart_no_snapshot --gen-precompiled-snapshot ~/hello.dart
+
+clang -m64 -dynamiclib -o libprecompiled.dylib precompiled.S
+
+LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$PWD" lldb -- ./xcodebuild/DebugX64/dart --run-precompiled-snapshot not_used.dart
diff --git a/tools/promote.py b/tools/promote.py
index 81ab402..d3013ab 100644
--- a/tools/promote.py
+++ b/tools/promote.py
@@ -131,10 +131,11 @@
     remove_gs_directory(to_loc)
     Gsutil(['-m', 'cp', '-a', 'public-read', '-R', from_loc, to_loc])
 
-    # Copy api-docs zipfile.
-    from_loc = raw_namer.apidocs_zipfilepath(revision)
-    to_loc = release_namer.apidocs_zipfilepath(to_revision)
-    Gsutil(['-m', 'cp', '-a', 'public-read', from_loc, to_loc])
+    # Copy api-docs directory.
+    from_loc = raw_namer.apidocs_directory(revision)
+    to_loc = release_namer.apidocs_directory(to_revision)
+    remove_gs_directory(to_loc)
+    Gsutil(['-m', 'cp', '-a', 'public-read', '-R', from_loc, to_loc])
 
     # Copy dartium directory.
     from_loc = raw_namer.dartium_directory(revision)
diff --git a/tools/run_pub.py b/tools/run_pub.py
deleted file mode 100755
index f54a411..0000000
--- a/tools/run_pub.py
+++ /dev/null
@@ -1,104 +0,0 @@
-#!/usr/bin/env python
-# 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.
-"""Used to run pub before the SDK has been built"""
-
-import argparse
-import os
-import platform
-import subprocess
-import sys
-
-SCRIPT_DIR = os.path.dirname(sys.argv[0])
-DART_ROOT = os.path.realpath(os.path.join(SCRIPT_DIR, '..'))
-PUB_PATH = os.path.join(DART_ROOT, 'third_party/pkg/pub/bin/pub.dart')
-CANARY_PATH = os.path.join(DART_ROOT, 'tools', 'canary.dart')
-
-usage = """run_pub.py --package-root=<package root>"""
-
-def BuildArguments():
-  result = argparse.ArgumentParser(usage=usage)
-  result.add_argument("--package-root", help="package root", default=None)
-  result.add_argument("--dart-executable", help="dart binary", default=None)
-  return result
-
-def ProcessOptions(options, args):
-  return ((options.package_root != None) and
-          (options.dart_executable != None))
-
-def GetPrebuiltDartExecutablePath(suffix):
-  osdict = {'Darwin':'macos', 'Linux':'linux', 'Windows':'windows'}
-  system = platform.system()
-  executable_name = 'dart'
-  if system == 'Windows':
-    executable_name = 'dart.exe'
-  try:
-    osname = osdict[system]
-  except KeyError:
-    print >>sys.stderr, ('WARNING: platform "%s" not supported') % (system)
-    return None;
-  return os.path.join(DART_ROOT,
-                      'tools',
-                      'testing',
-                      'bin',
-                      osname,
-                      executable_name + suffix)
-
-def RunPub(dart, pkg_root, args):
-  return subprocess.call([dart, '--package-root=' + pkg_root, PUB_PATH] + args)
-
-def TryRunningExecutable(dart_executable, pkg_root):
-  try:
-    return subprocess.call([dart_executable,
-                            '--package-root=' + pkg_root,
-                            CANARY_PATH]) == 42
-  except:
-    return False;
-
-def DisplayBootstrapWarning():
-  print """\
-
-
-WARNING: Your system cannot run the prebuilt Dart executable. Using the
-bootstrap Dart executable will make Debug builds long.
-Please see Wiki for instructions on replacing prebuilt Dart executable.
-
-https://code.google.com/p/dart/wiki/ReplacingPrebuiltDartExecutable
-
-"""
-
-def FindDartExecutable(fallback_executable, package_root):
-  # If requested, use the bootstrap binary instead of the prebuilt
-  # executable.
-  if os.getenv('DART_USE_BOOTSTRAP_BIN') != None:
-    return fallback_executable
-  # Try to find a working prebuilt dart executable.
-  dart_executable = GetPrebuiltDartExecutablePath('')
-  if TryRunningExecutable(dart_executable, package_root):
-    return dart_executable
-  dart_executable = GetPrebuiltDartExecutablePath('-arm')
-  if TryRunningExecutable(dart_executable, package_root):
-    return dart_executable
-  dart_executable = GetPrebuiltDartExecutablePath('-mips')
-  if TryRunningExecutable(dart_executable, package_root):
-    return dart_executable
-  # If the system cannot execute a prebuilt dart executable, use the bootstrap
-  # executable instead.
-  DisplayBootstrapWarning()
-  return fallback_executable
-
-def main():
-  # Parse the options.
-  parser = BuildArguments()
-  (options, args) = parser.parse_known_args()
-  if not ProcessOptions(options, args):
-    parser.print_help()
-    return 1
-  dart_executable = FindDartExecutable(options.dart_executable,
-                                       options.package_root)
-  return RunPub(dart_executable, options.package_root, args)
-
-
-if __name__ == '__main__':
-  sys.exit(main())
diff --git a/tools/sdks/.gitignore b/tools/sdks/.gitignore
new file mode 100644
index 0000000..2610d85
--- /dev/null
+++ b/tools/sdks/.gitignore
@@ -0,0 +1,6 @@
+/linux/dart-sdk
+/linux/dart-sdk.tar.gz
+/win/dart-sdk
+/win/dart-sdk.tar.gz
+/mac/dart-sdk
+/mac/dart-sdk.tar.gz
diff --git a/tools/sdks/README b/tools/sdks/README
new file mode 100644
index 0000000..f1f1fd3
--- /dev/null
+++ b/tools/sdks/README
@@ -0,0 +1,20 @@
+This directory contains the hashes of tar.gz files uploaded to cloud storage.
+Hooks in the DEPS files run "download_from_google_storage" to download these
+tarfiles, and unpack them.  These tar files contain a stable Dart SDK, which
+is used to build the observatory and to run the test scripts.
+
+The hooks use the --auto-platform feature, so that only the SDK for the
+current platform (linux, macos, or windows) is downloaded.  This requires
+the subdirectories to have the special names "linux", "win", and "mac", which
+the download script is hardcoded to recognize.
+
+The linux SDK has had two extra dart executables added to the bin directory.
+'dart-mips' and 'dart-arm' are executables compiled to run on mips and arm
+processors, respectively.
+
+To upload new versions of these tar files, use the "upload_to_google_storage"
+tool in depot_tools, and download the new stable SDKs from the dartlang.org
+web page.  The mips and arm executables must be copied from the machines that
+build them, and stripped.  There should be no need to update these tar files
+for every new stable version of Dart.
+
diff --git a/tools/sdks/linux/dart-sdk.tar.gz.sha1 b/tools/sdks/linux/dart-sdk.tar.gz.sha1
new file mode 100644
index 0000000..b9db509
--- /dev/null
+++ b/tools/sdks/linux/dart-sdk.tar.gz.sha1
@@ -0,0 +1 @@
+e525a9271e840f53382edfab773ad330384d8caa
\ No newline at end of file
diff --git a/tools/sdks/mac/dart-sdk.tar.gz.sha1 b/tools/sdks/mac/dart-sdk.tar.gz.sha1
new file mode 100644
index 0000000..d88e4ae
--- /dev/null
+++ b/tools/sdks/mac/dart-sdk.tar.gz.sha1
@@ -0,0 +1 @@
+b80cd51c9fe293de25273102de5b2721aacc8aba
\ No newline at end of file
diff --git a/tools/sdks/win/dart-sdk.tar.gz.sha1 b/tools/sdks/win/dart-sdk.tar.gz.sha1
new file mode 100644
index 0000000..97a2743
--- /dev/null
+++ b/tools/sdks/win/dart-sdk.tar.gz.sha1
@@ -0,0 +1 @@
+e098625fb19d40c9554f88e3306987c2c5988963
\ No newline at end of file
diff --git a/tools/signing_script.py b/tools/signing_script.py
deleted file mode 100755
index 5eefe1b..0000000
--- a/tools/signing_script.py
+++ /dev/null
@@ -1,286 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright (c) 2013, the Dart project authors.  Please see the AUTHORS file
-# for details. All rights reserved. Use of this source code is governed by a
-# BSD-style license that can be found in the LICENSE file.
-
-import imp
-import optparse
-import os
-import subprocess
-import sys
-
-DART_DIR = os.path.dirname(os.path.dirname(__file__))
-GSUTIL = os.path.join(DART_DIR, 'third_party', 'gsutil', 'gsutil')
-BOT_UTILS = os.path.join(DART_DIR, 'tools', 'bots', 'bot_utils.py')
-BASENAME_PATTERN = 'darteditor-%(system)s-%(bits)s'
-FILENAME_PATTERN = BASENAME_PATTERN + '.zip'
-
-DRY_RUN = False
-
-bot_utils = imp.load_source('bot_utils', BOT_UTILS)
-
-class ChangedWorkingDirectory(object):
-  def __init__(self, working_directory):
-    self._working_directory = working_directory
-
-  def __enter__(self):
-    self._old_cwd = os.getcwd()
-    print "Enter directory = ", self._working_directory
-    if not DRY_RUN:
-      os.chdir(self._working_directory)
-
-  def __exit__(self, *_):
-    print "Enter directory = ", self._old_cwd
-    os.chdir(self._old_cwd)
-
-def GetOptionsParser():
-  parser = optparse.OptionParser("usage: %prog [options]")
-  parser.add_option("--scratch-dir",
-                    help="Scratch directory to use.")
-  parser.add_option("--revision", type="int",
-                    help="Revision we want to sign.")
-  parser.add_option("--channel", type="string",
-                    default=None,
-                    help="Channel we want to sign.")
-  parser.add_option("--dry-run", action="store_true", dest="dry_run",
-                    default=False,
-                    help="Do a dry run and do not execute any commands.")
-  parser.add_option("--prepare", action="store_true", dest="prepare",
-                    default=False,
-                    help="Prepare the .exe/.zip files to sign.")
-  parser.add_option("--deploy", action="store_true", dest="deploy",
-                    default=False,
-                    help="Pack the signed .exe/.zip files and deploy.")
-  return parser
-
-def die(msg, withOptions=True):
-  print msg
-  if withOptions:
-    GetOptionsParser().print_usage()
-  sys.exit(1)
-
-def run(command):
-  """We use run() instead of builtin python methods, because not all
-  functionality can easily be done by python and we can support --dry-run"""
-
-  print "Running: ", command
-  if not DRY_RUN:
-    process = subprocess.Popen(command,
-                               stdout=subprocess.PIPE,
-                               stderr=subprocess.PIPE)
-    (stdout, stderr) = process.communicate()
-    if process.returncode != 0:
-      print "DEBUG: failed to run command '%s'" % command
-      print "DEBUG: stdout = ", stdout
-      print "DEBUG: stderr = ", stderr
-      print "DEBUG: returncode = ", process.returncode
-      raise OSError(process.returncode)
-
-def clean_directory(directory):
-  if os.path.exists(directory):
-    run(['rm', '-r', directory])
-  run(['mkdir', '-p', directory])
-
-def rm_tree(directory):
-  if os.path.exists(directory):
-    run(['rm', '-r', directory])
-
-def copy_tree(from_dir, to_dir):
-  if os.path.exists(to_dir):
-    run(['rm', '-r', to_dir])
-  run(['cp', '-Rp', from_dir, to_dir])
-
-def copy_file(from_file, to_file):
-  if os.path.exists(to_file):
-    run(['rm', to_file])
-  run(['cp', '-p', from_file, to_file])
-
-def copy_and_zip(from_dir, to_dir):
-  rm_tree(to_dir)
-  copy_tree(from_dir, to_dir)
-
-  dirname = os.path.basename(to_dir)
-  with ChangedWorkingDirectory(os.path.dirname(to_dir)):
-    run(['zip', '-r9', dirname + '.zip', dirname])
-
-def unzip_and_copy(extracted_zipfiledir, to_dir):
-  rm_tree(extracted_zipfiledir)
-  run(['unzip', extracted_zipfiledir + '.zip', '-d',
-       os.path.dirname(extracted_zipfiledir)])
-  rm_tree(to_dir)
-  copy_tree(extracted_zipfiledir, to_dir)
-
-def download_from_new_location(channel, config, destination):
-  namer = bot_utils.GCSNamer(channel,
-                             bot_utils.ReleaseType.RAW)
-  bucket = namer.editor_zipfilepath(config['revision'], config['system'],
-                                    config['bits'])
-  run([GSUTIL, 'cp', bucket, destination])
-
-def download_msi_installer_from_new_location(channel, config, destination):
-  namer = bot_utils.GCSNamer(channel, bot_utils.ReleaseType.RAW)
-  bucket = namer.editor_installer_filepath(
-      config['revision'], config['system'], config['bits'], 'msi')
-  run([GSUTIL, 'cp', bucket, destination])
-
-def upload_to_new_location(channel, config, source_zip):
-  namer = bot_utils.GCSNamer(channel,
-                             bot_utils.ReleaseType.SIGNED)
-  zipfilename = namer.editor_zipfilename(config['system'], config['bits'])
-  bucket = namer.editor_zipfilepath(config['revision'], config['system'],
-                                    config['bits'])
-
-  if not DRY_RUN:
-    bot_utils.CreateMD5ChecksumFile(source_zip, mangled_filename=zipfilename)
-    bot_utils.CreateSha256ChecksumFile(source_zip,
-                                       mangled_filename=zipfilename)
-  md5_zip_file = source_zip + '.md5sum'
-  sha256_zip_file = source_zip + '.sha256sum'
-
-  run([GSUTIL, 'cp', source_zip, bucket])
-  run([GSUTIL, 'cp', md5_zip_file, bucket + '.md5sum'])
-  run([GSUTIL, 'cp', sha256_zip_file, bucket + '.sha256sum'])
-  run([GSUTIL, 'setacl', 'public-read', bucket])
-  run([GSUTIL, 'setacl', 'public-read', bucket + '.md5sum'])
-  run([GSUTIL, 'setacl', 'public-read', bucket + '.sha256sum'])
-
-def upload_msi_installer_to_new_location(channel, config, signed_msi):
-  namer = bot_utils.GCSNamer(channel, bot_utils.ReleaseType.SIGNED)
-  bucket = namer.editor_installer_filepath(
-      config['revision'], config['system'], config['bits'], 'msi')
-  run([GSUTIL, 'cp', '-a', 'public-read', signed_msi, bucket])
-
-def main():
-  if sys.platform != 'linux2':
-    print "This script was only tested on linux. Please run it on linux!"
-    sys.exit(1)
-
-  parser = GetOptionsParser()
-  (options, args) = parser.parse_args()
-
-  if not options.scratch_dir:
-    die("No scratch directory given.")
-  if not options.revision:
-    die("No revision given.")
-  if not options.prepare and not options.deploy:
-    die("No prepare/deploy parameter given.")
-  if options.prepare and options.deploy:
-    die("Can't have prepare and deploy parameters at the same time.")
-  if len(args) > 0:
-    die("Invalid additional arguments: %s." % args)
-
-  if not options.channel:
-    die("You need to specify a channel with --channel.")
-
-  global DRY_RUN
-  DRY_RUN = options.dry_run
-
-  downloads_dir = os.path.join(options.scratch_dir, 'downloads')
-  presign_dir = os.path.join(options.scratch_dir, 'presign')
-  postsign_dir = os.path.join(options.scratch_dir, 'postsign')
-  uploads_dir = os.path.join(options.scratch_dir, 'uploads')
-
-  if options.prepare:
-    # Clean all directories
-    clean_directory(downloads_dir)
-    clean_directory(presign_dir)
-    clean_directory(postsign_dir)
-    clean_directory(uploads_dir)
-  elif options.deploy:
-    clean_directory(uploads_dir)
-
-  # These are the locations where we can find the *.app folders and *.exe files
-  # and the names we use inside the scratch directory.
-  locations = {
-    'macos' : {
-      'editor' : os.path.join('dart', 'DartEditor.app'),
-      'chrome' : os.path.join('dart', 'chromium', 'Chromium.app'),
-
-      'editor_scratch' : 'DartEditor%(bits)s.app',
-      'chrome_scratch' : 'Chromium%(bits)s.app',
-
-      'zip' : True,
-    },
-    'win32' : {
-      'editor' : os.path.join('dart', 'DartEditor.exe'),
-      'chrome' : os.path.join('dart', 'chromium', 'chrome.exe'),
-
-      'msi_scratch' : 'darteditor-installer-windows-%(bits)s.msi',
-      'editor_scratch' : 'DartEditor%(bits)s.exe',
-      'chrome_scratch' : 'chromium%(bits)s.exe',
-
-      'zip' : False,
-    },
-  }
-
-  # Desitination of zip files we download
-  for system in ('macos', 'win32'):
-    for bits in ('32', '64'):
-      config = {
-        'revision' : options.revision,
-        'system' : system,
-        'bits' : bits,
-      }
-
-      destination = os.path.join(downloads_dir, FILENAME_PATTERN % config)
-      destination_dir = os.path.join(downloads_dir, BASENAME_PATTERN % config)
-
-      deploy = os.path.join(uploads_dir, FILENAME_PATTERN % config)
-      deploy_dir = os.path.join(uploads_dir, BASENAME_PATTERN % config)
-
-      if options.prepare:
-        # Download *.zip files from GCS buckets
-        download_from_new_location(options.channel, config, destination)
-
-        run(['unzip', destination, '-d', destination_dir])
-
-        for name in ['editor', 'chrome']:
-          from_path = os.path.join(destination_dir, locations[system][name])
-          to_path = os.path.join(
-              presign_dir, locations[system]['%s_scratch' % name] % config)
-
-          if locations[system]['zip']:
-            # We copy a .app directory directory and zip it
-            copy_and_zip(from_path, to_path)
-          else:
-            # We copy an .exe file
-            copy_file(from_path, to_path)
-
-        # Download .*msi installer from GCS to presign directory
-        if system == 'win32':
-          presign_msi = os.path.join(
-              presign_dir, locations[system]['msi_scratch'] % config)
-          download_msi_installer_from_new_location(
-              options.channel, config, presign_msi)
-      elif options.deploy:
-        copy_tree(destination_dir, deploy_dir)
-
-        for name in ['editor', 'chrome']:
-          from_path = os.path.join(
-              postsign_dir, locations[system]['%s_scratch' % name] % config)
-          to_path = os.path.join(deploy_dir, locations[system][name])
-
-          if locations[system]['zip']:
-            # We unzip a zip file and copy the resulting signed .app directory
-            unzip_and_copy(from_path, to_path)
-          else:
-            # We copy the signed .exe file
-            copy_file(from_path, to_path)
-
-        deploy_zip_file = os.path.abspath(deploy)
-        with ChangedWorkingDirectory(deploy_dir):
-          run(['zip', '-r9', deploy_zip_file, 'dart'])
-
-        # Upload *.zip/*.zip.md5sum and set 'public-read' ACL
-        upload_to_new_location(options.channel, config, deploy_zip_file)
-
-        # Upload *.msi installer and set 'public-read ACL
-        if system == 'win32':
-          postsign_msi = os.path.join(
-              postsign_dir, locations[system]['msi_scratch'] % config)
-          upload_msi_installer_to_new_location(
-              options.channel, config, postsign_msi)
-
-if __name__ == '__main__':
-  main()
diff --git a/tools/task_kill.py b/tools/task_kill.py
index a091164..4a54965 100755
--- a/tools/task_kill.py
+++ b/tools/task_kill.py
@@ -30,7 +30,9 @@
     'iexplore': 'iexplore.exe',
     'firefox': 'firefox.exe',
     'git': 'git.exe',
-    'svn': 'svn.exe'
+    'svn': 'svn.exe',
+    'fletch': 'fletch.exe',
+    'fletch-vm': 'fletch-vm.exe',
   },
   'linux': {
     'chrome': 'chrome',
@@ -38,7 +40,9 @@
     'dart': 'dart',
     'firefox': 'firefox.exe',
     'git': 'git',
-    'svn': 'svn'
+    'svn': 'svn',
+    'fletch': 'fletch',
+    'fletch-vm': 'fletch-vm',
   },
   'macos': {
     'chrome': 'Chrome',
@@ -47,7 +51,9 @@
     'firefox': 'firefox',
     'safari': 'Safari',
     'git': 'git',
-    'svn': 'svn'
+    'svn': 'svn',
+    'fletch': 'fletch',
+    'fletch-vm': 'fletch-vm',
   }
 }
 
@@ -61,6 +67,8 @@
   parser = optparse.OptionParser("usage: %prog [options]")
   parser.add_option("--kill_dart", default=True,
                     help="Kill all dart processes")
+  parser.add_option("--kill_fletch", default=True,
+                    help="Kill all fletch and fletch-vm processes")
   parser.add_option("--kill_vc", default=True,
                     help="Kill all git and svn processes")
   parser.add_option("--kill_browsers", default=False,
@@ -189,11 +197,18 @@
   status = Kill("dart")
   return status
 
+def KillFletch():
+  status = Kill("fletch")
+  status += Kill("fletch-vm")
+  return status
+
 def Main():
   options = GetOptions()
   status = 0
   if options.kill_dart:
     status += KillDart()
+  if options.kill_fletch:
+    status += KillFletch()
   if options.kill_vc:
     status += KillVCSystems()
   if options.kill_browsers:
diff --git a/tools/testing/dart/compiler_configuration.dart b/tools/testing/dart/compiler_configuration.dart
index fc1d536..9ec90f0 100644
--- a/tools/testing/dart/compiler_configuration.dart
+++ b/tools/testing/dart/compiler_configuration.dart
@@ -155,7 +155,12 @@
       List<String> sharedOptions,
       List<String> originalArguments,
       CommandArtifact artifact) {
-    return <String>[]
+    List<String> args = [];
+    if (isChecked) {
+      args.add('--enable_asserts');
+      args.add('--enable_type_checks');
+    }
+    return args
         ..addAll(vmOptions)
         ..addAll(sharedOptions)
         ..addAll(originalArguments);
@@ -315,6 +320,10 @@
       CommandBuilder commandBuilder,
       List arguments,
       Map<String, String> environmentOverrides) {
+    arguments = new List.from(arguments);
+    if (isChecked) {
+      arguments.add('--enable_type_checks');
+    }
     return new CommandArtifact(
         <Command>[
             commandBuilder.getAnalysisCommand(
diff --git a/tools/testing/dart/test_suite.dart b/tools/testing/dart/test_suite.dart
index 2304b5c..b4e7b53 100644
--- a/tools/testing/dart/test_suite.dart
+++ b/tools/testing/dart/test_suite.dart
@@ -1468,6 +1468,8 @@
     String packageRoot =
       packageRootArgument(optionsFromFile['packageRoot']);
     if (packageRoot != null) args.add(packageRoot);
+    String packages = packagesArgument(optionsFromFile['packages']);
+    if (packages != null) args.add(packages);
     args.add('--out=$outputFile');
     args.add(inputFile);
     List<String> options = optionsFromFile['sharedOptions'];
@@ -1483,6 +1485,8 @@
     List<String> args = [];
     String packageRoot = packageRootArgument(optionsFromFile['packageRoot']);
     if (packageRoot != null) args.add(packageRoot);
+    String packages = packagesArgument(optionsFromFile['packages']);
+    if (packages != null) args.add(packages);
     args..add('package:polymer/deploy.dart')
         ..add('--test')..add(inputFile)
         ..add('--out')..add(outputDir)
@@ -1537,6 +1541,10 @@
     if (packageRoot != null) {
       args.add(packageRoot);
     }
+    String packages = packagesArgument(optionsFromFile['packages']);
+    if (packages != null) {
+      args.add(packages);
+    }
     args.addAll(additionalOptions(filePath));
     if (configuration['analyzer']) {
       args.add('--machine');
@@ -1581,6 +1589,13 @@
     return "--package-root=$packageRootPath";
   }
 
+  String packagesArgument(String packagesFromFile) {
+    if (packagesFromFile == null || packagesFromFile == "none") {
+      return null;
+    }
+    return "--packages=$packagesFromFile";
+  }
+
   /**
    * Special options for individual tests are currently specified in various
    * ways: with comments directly in test files, by using certain imports, or by
@@ -1655,6 +1670,7 @@
     RegExp dartOptionsRegExp = new RegExp(r"// DartOptions=(.*)");
     RegExp otherScriptsRegExp = new RegExp(r"// OtherScripts=(.*)");
     RegExp packageRootRegExp = new RegExp(r"// PackageRoot=(.*)");
+    RegExp packagesRegExp = new RegExp(r"// Packages=(.*)");
     RegExp isolateStubsRegExp = new RegExp(r"// IsolateStubs=(.*)");
     // TODO(gram) Clean these up once the old directives are not supported.
     RegExp domImportRegExp =
@@ -1670,6 +1686,7 @@
     List<String> dartOptions;
     List<String> sharedOptions;
     String packageRoot;
+    String packages;
 
     Iterable<Match> matches = testOptionsRegExp.allMatches(contents);
     for (var match in matches) {
@@ -1708,6 +1725,19 @@
       }
     }
 
+    matches = packagesRegExp.allMatches(contents);
+    for (var match in matches) {
+      if (packages != null) {
+        throw new Exception(
+            'More than one "// Packages=" line in test $filePath');
+      }
+      packages = match[1];
+      if (packages != 'none') {
+        // Packages=none means that no packages option should be given.
+        packages = '${filePath.directoryPath.join(new Path(packages))}';
+      }
+    }
+
     List<String> otherScripts = new List<String>();
     matches = otherScriptsRegExp.allMatches(contents);
     for (var match in matches) {
@@ -1732,6 +1762,7 @@
              "sharedOptions": sharedOptions == null ? [] : sharedOptions,
              "dartOptions": dartOptions,
              "packageRoot": packageRoot,
+             "packages": packages,
              "hasCompileError": false,
              "hasRuntimeError": false,
              "hasStaticWarning" : false,
@@ -2194,10 +2225,6 @@
 
   static List<String> standardOptions(Map configuration) {
     List args = ["--ignore-unrecognized-flags"];
-    if (configuration["checked"]) {
-      args.add('--enable_asserts');
-      args.add("--enable_type_checks");
-    }
     String compiler = configuration["compiler"];
     if (compiler == "dart2js") {
       args = ['--generate-code-with-compile-time-errors', '--test-mode'];
diff --git a/tools/utils.py b/tools/utils.py
index 2301d9b..7b203aa 100644
--- a/tools/utils.py
+++ b/tools/utils.py
@@ -75,14 +75,18 @@
 
 # Try to guess the number of cpus on this machine.
 def GuessCpus():
+  if os.getenv("DART_NUMBER_OF_CORES") is not None:
+    return int(os.getenv("DART_NUMBER_OF_CORES"))
   if os.path.exists("/proc/cpuinfo"):
     return int(commands.getoutput("grep -E '^processor' /proc/cpuinfo | wc -l"))
   if os.path.exists("/usr/bin/hostinfo"):
-    return int(commands.getoutput('/usr/bin/hostinfo | grep "processors are logically available." | awk "{ print \$1 }"'))
+    return int(commands.getoutput('/usr/bin/hostinfo |'
+        ' grep "processors are logically available." |'
+        ' awk "{ print \$1 }"'))
   win_cpu_count = os.getenv("NUMBER_OF_PROCESSORS")
   if win_cpu_count:
     return int(win_cpu_count)
-  return int(os.getenv("DART_NUMBER_OF_CORES", 2))
+  return 2
 
 def GetWindowsRegistryKeyName(name):
   import win32process
@@ -236,6 +240,7 @@
 ARCH_GUESS = GuessArchitecture()
 BASE_DIR = os.path.abspath(os.path.join(os.curdir, '..'))
 DART_DIR = os.path.abspath(os.path.join(__file__, '..', '..'))
+VERSION_FILE = os.path.join(DART_DIR, 'tools', 'VERSION')
 
 def GetBuildbotGSUtilPath():
   gsutil = '/b/build/scripts/slave/gsutil'
@@ -337,13 +342,12 @@
       return match.group(1)
     return None
 
-  version_file = os.path.join(DART_DIR, 'tools', 'VERSION')
   try:
-    fd = open(version_file)
+    fd = open(VERSION_FILE)
     content = fd.read()
     fd.close()
   except:
-    print "Warning: Couldn't read VERSION file (%s)" % version_file
+    print "Warning: Couldn't read VERSION file (%s)" % VERSION_FILE
     return None
 
   channel = match_against('^CHANNEL ([A-Za-z0-9]+)$', content)
@@ -357,7 +361,7 @@
     return Version(
         channel, major, minor, patch, prerelease, prerelease_patch)
   else:
-    print "Warning: VERSION file (%s) has wrong format" % version_file
+    print "Warning: VERSION file (%s) has wrong format" % VERSION_FILE
     return None
 
 
@@ -565,6 +569,7 @@
 
 
 def DartBinary():
+  # TODO(24311): Replace all uses of this with CheckedInSdk[Fix]Executable().
   tools_dir = os.path.dirname(os.path.realpath(__file__))
   dart_binary_prefix = os.path.join(tools_dir, 'testing', 'bin')
   if IsWindows():
@@ -591,6 +596,51 @@
   dart_binary_prefix = os.path.join(tools_dir, '..', 'sdk' , 'bin')
   return os.path.join(dart_binary_prefix, 'dart')
 
+
+# The checked-in SDKs are documented at
+#     https://github.com/dart-lang/sdk/wiki/The-checked-in-SDK-in-tools
+def CheckedInSdkPath():
+  # We don't use the normal macos, linux, win32 directory names here, instead,
+  # we use the names that the download_from_google_storage script uses.
+  osdict = {'Darwin':'mac', 'Linux':'linux', 'Windows':'win'}
+  system = platform.system()
+  try:
+    osname = osdict[system]
+  except KeyError:
+    print >>sys.stderr, ('WARNING: platform "%s" not supported') % (system)
+    return None;
+  tools_dir = os.path.dirname(os.path.realpath(__file__))
+  return os.path.join(tools_dir,
+                      'sdks',
+                      osname,
+                      'dart-sdk')
+
+
+def CheckedInSdkExecutable():
+  name = 'dart'
+  if IsWindows():
+    name = 'dart.exe'
+  elif GuessOS() == 'linux':
+    arch = GuessArchitecture()
+    if arch == 'mips':
+      name = 'dart-mips'
+    elif arch == 'arm':
+      name = 'dart-arm'
+  return os.path.join(CheckedInSdkPath(), 'bin', name)
+
+
+def CheckedInSdkCheckExecutable():
+  executable = CheckedInSdkExecutable()
+  canary_script = os.path.join(os.path.dirname(os.path.realpath(__file__)),
+                               'canary.dart')
+  try:
+    if 42 == subprocess.call([executable, canary_script]):
+      return True
+  except OSError as e:
+    pass
+  return False
+
+
 class TempDir(object):
   def __init__(self, prefix=''):
     self._temp_dir = None
diff --git a/utils/apidoc/.gitignore b/utils/apidoc/.gitignore
deleted file mode 100644
index adaa849..0000000
--- a/utils/apidoc/.gitignore
+++ /dev/null
@@ -1,22 +0,0 @@
-/Makefile
-/out
-/runtime
-/xcodebuild
-/*.Makefile
-/*.sln
-/*.target.mk
-/*.vcproj
-/*.vcxproj
-/*.vcxproj.filters
-/*.vcxproj.user
-/*.xcodeproj
-/Debug
-/DebugARM
-/DebugIA32
-/DebugSIMARM
-/DebugX64
-/Release
-/ReleaseARM
-/ReleaseIA32
-/ReleaseSIMARM
-/ReleaseX64
diff --git a/utils/apidoc/README.txt b/utils/apidoc/README.txt
deleted file mode 100644
index f1d7b8a..0000000
--- a/utils/apidoc/README.txt
+++ /dev/null
@@ -1,86 +0,0 @@
-Apidoc is a specialization of Dartdoc.
-Dartdoc generates static HTML documentation from Dart code.
-Apidoc wraps the dartdoc output with official dartlang.org skin, comments, etc.
-
-To use it, from the top level dart directory, run:
-
-    $ dart utils/apidoc/apidoc.dart [--out=<output directory>]
-
-This will create a "docs" directory with the docs for your libraries.
-
-
-How docs are generated
-----------------------
-
-To make beautiful docs from your library, dartdoc parses it and every library it
-imports (recursively). From each library, it parses all classes and members,
-finds the associated doc comments and builds crosslinked docs from them.
-
-"Doc comments" can be in one of a few forms:
-
-    /**
-     * JavaDoc style block comments.
-     */
-
-    /** Which can also be single line. */
-
-    /// Triple-slash line comments.
-    /// Which can be multiple lines.
-
-The body of a doc comment will be parsed as markdown which means you can apply
-most of the formatting and structuring you want while still having docs that
-look nice in plain text. For example:
-
-    /// This is a doc comment. This is the first paragraph in the comment. It
-    /// can span multiple lines.
-    ///
-    /// A blank line starts a new paragraph like this one.
-    ///
-    /// *   Unordered lists start with `*` or `-` or `+`.
-    /// *   And can have multiple items.
-    ///     1. You can nest lists.
-    ///     2. Like this numbered one.
-    ///
-    /// ---
-    ///
-    /// Three dashes, underscores, or tildes on a line by themselves create a
-    /// horizontal rule.
-    ///
-    ///     to.get(a.block + of.code) {
-    ///       indent(it, 4.lines);
-    ///       like(this);
-    ///     }
-    ///
-    /// There are a few inline styles you can apply: *emphasis*, **strong**,
-    /// and `inline code`. You can also use underscores for _emphasis_ and
-    /// __strong__.
-    ///
-    /// An H1 header using equals on the next line
-    /// ==========================================
-    ///
-    /// And an H2 in that style using hyphens
-    /// -------------------------------------
-    ///
-    /// # Or an H1 - H6 using leading hashes
-    /// ## H2
-    /// ### H3
-    /// #### H4 you can also have hashes at then end: ###
-    /// ##### H5
-    /// ###### H6
-
-There is also an extension to markdown specific to dartdoc: A name inside
-square brackets that is not a markdown link (i.e. doesn't have square brackets
-or parentheses following it) like:
-
-    Calls [someMethod], passing in [arg].
-
-is understood to be the name of some member or type that's in the scope of the
-member where that comment appears. Dartdoc will automatically figure out what
-the name refers to and generate an approriate link to that member or type.
-
-
-Attribution
------------
-
-dartdoc uses the delightful Silk icon set by Mark James.
-http://www.famfamfam.com/lab/icons/silk/
diff --git a/utils/apidoc/apidoc.dart b/utils/apidoc/apidoc.dart
deleted file mode 100644
index db74d32..0000000
--- a/utils/apidoc/apidoc.dart
+++ /dev/null
@@ -1,477 +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 generates the reference documentation for the core libraries that come
- * with dart. It is built on top of dartdoc, which is a general-purpose library
- * for generating docs from any Dart code. This library extends that to include
- * additional information and styling specific to our standard library.
- *
- * Usage:
- *
- *     $ dart apidoc.dart [--out=<output directory>]
- */
-library apidoc;
-
-import 'dart:async';
-import 'dart:convert';
-import 'dart:io';
-
-import 'html_diff.dart';
-
-import 'package:compiler/src/mirrors/source_mirrors.dart';
-import 'package:compiler/src/mirrors/mirrors_util.dart';
-import 'package:compiler/src/filenames.dart';
-import 'package:dartdoc/dartdoc.dart';
-import 'package:sdk_library_metadata/libraries.dart';
-import 'package:path/path.dart' as path;
-
-HtmlDiff _diff;
-
-void main(List<String> args) {
-  int mode = MODE_STATIC;
-  String outputDir = 'docs';
-  bool generateAppCache = false;
-
-  List<String> excludedLibraries = <String>[];
-
-  // For libraries that have names matching the package name,
-  // such as library unittest in package unittest, we just give
-  // the package name with a --include-lib argument, such as:
-  // --include-lib=unittest. These arguments are collected in
-  // includedLibraries.
-  List<String> includedLibraries = <String>[];
-
-  // For libraries that lie within packages but have a different name,
-  // such as the matcher library in package unittest, we can use
-  // --extra-lib with a full relative path under pkg, such as
-  // --extra-lib=unittest/lib/matcher.dart. These arguments are
-  // collected in extraLibraries.
-  List<String> extraLibraries = <String>[];
-
-  String packageRoot;
-  String version;
-
-  // Parse the command-line arguments.
-  for (int i = 0; i < args.length; i++) {
-    final arg = args[i];
-
-    switch (arg) {
-      case '--mode=static':
-        mode = MODE_STATIC;
-        break;
-
-      case '--mode=live-nav':
-        mode = MODE_LIVE_NAV;
-        break;
-
-      case '--generate-app-cache=true':
-        generateAppCache = true;
-        break;
-
-      default:
-        if (arg.startsWith('--exclude-lib=')) {
-          excludedLibraries.add(arg.substring('--exclude-lib='.length));
-        } else if (arg.startsWith('--include-lib=')) {
-          includedLibraries.add(arg.substring('--include-lib='.length));
-        } else if (arg.startsWith('--extra-lib=')) {
-          extraLibraries.add(arg.substring('--extra-lib='.length));
-        } else if (arg.startsWith('--out=')) {
-          outputDir = arg.substring('--out='.length);
-        } else if (arg.startsWith('--package-root=')) {
-          packageRoot = arg.substring('--package-root='.length);
-        } else if (arg.startsWith('--version=')) {
-          version = arg.substring('--version='.length);
-        } else {
-          print('Unknown option: $arg');
-          return;
-        }
-        break;
-    }
-  }
-
-  final libPath = path.join(scriptDir, '..', '..', 'sdk/');
-
-  cleanOutputDirectory(outputDir);
-
-  print('Copying static files...');
-  // The basic dartdoc-provided static content.
-  final copiedStatic = copyDirectory(
-      path.join(scriptDir,
-          '..', '..', 'sdk', 'lib', '_internal', 'dartdoc', 'static'),
-      outputDir);
-
-  // The apidoc-specific static content.
-  final copiedApiDocStatic = copyDirectory(
-      path.join(scriptDir, 'static'),
-      outputDir);
-
-  print('Parsing MDN data...');
-  final mdnFile = new File(path.join(scriptDir, 'mdn', 'database.json'));
-  final mdn = JSON.decode(mdnFile.readAsStringSync());
-
-  print('Cross-referencing dart:html...');
-  // TODO(amouravski): move HtmlDiff inside of the future chain below to re-use
-  // the MirrorSystem already analyzed.
-  _diff = new HtmlDiff(printWarnings:false);
-  Future htmlDiff = _diff.run(currentDirectory.resolveUri(path.toUri(libPath)));
-
-  // TODO(johnniwinther): Libraries for the compilation seem to be more like
-  // URIs. Perhaps Path should have a toURI() method.
-  // Add all of the core libraries.
-  final apidocLibraries = <Uri>[];
-  LIBRARIES.forEach((String name, LibraryInfo info) {
-    if (info.documented) {
-      apidocLibraries.add(Uri.parse('dart:$name'));
-    }
-  });
-
-  // TODO(amouravski): This code is really wonky.
-  var lister = new Directory(path.join(scriptDir, '..', '..', 'pkg')).list();
-  lister.listen((entity) {
-    if (entity is Directory) {
-      var libName = path.basename(entity.path);
-      var libPath = path.join(entity.path, 'lib', '${libName}.dart');
-
-      // Ignore some libraries.
-      if (excludedLibraries.contains(libName)) {
-        return;
-      }
-
-      // Ignore hidden directories (like .svn) as well as pkg.xcodeproj.
-      if (libName.startsWith('.') || libName.endsWith('.xcodeproj')) {
-        return;
-      }
-
-      if (new File(libPath).existsSync()) {
-        apidocLibraries.add(path.toUri(libPath));
-        includedLibraries.add(libName);
-      } else {
-        print('Warning: could not find package at ${entity.path}');
-      }
-    }
-  }, onDone: () {
-    // Add any --extra libraries that had full pkg paths.
-    // TODO(gram): if the handling of --include-lib libraries in the
-    // listen() block above is cleaned up, then this will need to be
-    // too, as it is a special case of the above.
-    for (var lib in extraLibraries) {
-      var libPath = '../../$lib';
-      if (new File(libPath).existsSync()) {
-        apidocLibraries.add(path.toUri(libPath));
-        var libName = path.basename(libPath).replaceAll('.dart', '');
-        includedLibraries.add(libName);
-      }
-    }
-
-    final apidoc = new Apidoc(mdn, outputDir, mode, generateAppCache,
-                              excludedLibraries, version);
-    apidoc.dartdocPath =
-        path.join(scriptDir, '..', '..', 'sdk', 'lib', '_internal', 'dartdoc');
-    // Select the libraries to include in the produced documentation:
-    apidoc.includeApi = true;
-    apidoc.includedLibraries = includedLibraries;
-
-    // TODO(amouravski): make apidoc use roughly the same flow as bin/dartdoc.
-    Future.wait([copiedStatic, copiedApiDocStatic, htmlDiff])
-      .then((_) => apidoc.documentLibraries(apidocLibraries, libPath,
-            packageRoot))
-      .then((_) => compileScript(mode, outputDir, libPath, apidoc.tmpPath))
-      .then((_) => print(apidoc.status))
-      .catchError((e, trace) {
-        print('Error: generation failed: ${e}');
-        if (trace != null) print("StackTrace: $trace");
-        apidoc.cleanup();
-        exit(1);
-      })
-      .whenComplete(() => apidoc.cleanup());
-  });
-}
-
-class Apidoc extends Dartdoc {
-  /** Big ball of JSON containing the scraped MDN documentation. */
-  final Map mdn;
-
-
-  // A set of type names (TypeMirror.simpleName values) to ignore while
-  // looking up information from MDN data.  TODO(eub, jacobr): fix up the MDN
-  // import scripts so they run correctly and generate data that doesn't have
-  // any entries that need to be ignored.
-  static Set<String> _mdnTypeNamesToSkip = null;
-
-  /**
-   * The URL to the page on MDN that content was pulled from for the current
-   * type being documented. Will be `null` if the type doesn't use any MDN
-   * content.
-   */
-  String mdnUrl = null;
-
-  Apidoc(this.mdn, String outputDir, int mode, bool generateAppCache,
-      [List<String> excludedLibraries, String version]) {
-    if (excludedLibraries != null) this.excludedLibraries = excludedLibraries;
-    this.version = version;
-    this.outputDir = outputDir;
-    this.mode = mode;
-    this.generateAppCache = generateAppCache;
-
-    // Skip bad entries in the checked-in mdn/database.json:
-    //  * UnknownElement has a top-level Gecko DOM page in German.
-    if (_mdnTypeNamesToSkip == null)
-      _mdnTypeNamesToSkip = new Set.from(['UnknownElement']);
-
-    mainTitle = 'Dart API Reference';
-    mainUrl = 'http://dartlang.org';
-
-    final note    = 'http://code.google.com/policies.html#restrictions';
-    final cca     = 'http://creativecommons.org/licenses/by/3.0/';
-    final bsd     = 'http://code.google.com/google_bsd_license.html';
-    final tos     = 'http://www.dartlang.org/tos.html';
-    final privacy = 'http://www.google.com/intl/en/privacy/privacy-policy.html';
-
-    footerText =
-        '''
-        <p>Except as otherwise <a href="$note">noted</a>, the content of this
-        page is licensed under the <a href="$cca">Creative Commons Attribution
-        3.0 License</a>, and code samples are licensed under the
-        <a href="$bsd">BSD License</a>.</p>
-        <p><a href="$tos">Terms of Service</a> |
-        <a href="$privacy">Privacy Policy</a></p>
-        ''';
-
-    searchEngineId = '011220921317074318178:i4mscbaxtru';
-    searchResultsUrl = 'http://www.dartlang.org/search.html';
-  }
-
-  void writeHeadContents(String title) {
-    super.writeHeadContents(title);
-
-    // Include the apidoc-specific CSS.
-    // TODO(rnystrom): Use our CSS pre-processor to combine these.
-    writeln(
-        '''
-        <link rel="stylesheet" type="text/css"
-            href="${relativePath('apidoc-styles.css')}" />
-        ''');
-
-    // Add the analytics code.
-    writeln(
-        '''
-        <script type="text/javascript">
-          var _gaq = _gaq || [];
-          _gaq.push(["_setAccount", "UA-26406144-9"]);
-          _gaq.push(["_trackPageview"]);
-
-          (function() {
-            var ga = document.createElement("script");
-            ga.type = "text/javascript"; ga.async = true;
-            ga.src = ("https:" == document.location.protocol ?
-              "https://ssl" : "http://www") + ".google-analytics.com/ga.js";
-            var s = document.getElementsByTagName("script")[0];
-            s.parentNode.insertBefore(ga, s);
-          })();
-        </script>
-        ''');
-  }
-
-  void docIndexLibrary(LibraryMirror library) {
-    // TODO(rnystrom): Hackish. The IO libraries reference this but we don't
-    // want it in the docs.
-    if (displayName(library) == 'dart:nativewrappers') return;
-    super.docIndexLibrary(library);
-  }
-
-  void docLibraryNavigationJson(LibraryMirror library, List libraryList) {
-    // TODO(rnystrom): Hackish. The IO libraries reference this but we don't
-    // want it in the docs.
-    if (displayName(library) == 'dart:nativewrappers') return;
-    super.docLibraryNavigationJson(library, libraryList);
-  }
-
-  void docLibrary(LibraryMirror library) {
-    // TODO(rnystrom): Hackish. The IO libraries reference this but we don't
-    // want it in the docs.
-    if (displayName(library) == 'dart:nativewrappers') return;
-    super.docLibrary(library);
-  }
-
-  DocComment getLibraryComment(LibraryMirror library) {
-    return super.getLibraryComment(library);
-  }
-
-  DocComment getTypeComment(TypeMirror type) {
-    return _mergeDocs(
-        includeMdnTypeComment(type), super.getTypeComment(type));
-  }
-
-  DocComment getMemberComment(DeclarationMirror member) {
-    return _mergeDocs(
-        includeMdnMemberComment(member), super.getMemberComment(member));
-  }
-
-  DocComment _mergeDocs(MdnComment mdnComment,
-                            DocComment fileComment) {
-    // Otherwise, prefer comment from the (possibly generated) Dart file.
-    if (fileComment != null) return fileComment;
-
-    // Finally, fallback on MDN if available.
-    if (mdnComment != null) {
-      mdnUrl = mdnComment.mdnUrl;
-      return mdnComment;
-    }
-
-    // We got nothing!
-    return null;
-  }
-
-  void docType(TypeMirror type) {
-    // Track whether we've inserted MDN content into this page.
-    mdnUrl = null;
-
-    super.docType(type);
-  }
-
-  void writeTypeFooter() {
-    if (mdnUrl != null) {
-      final MOZ = 'http://www.mozilla.org/';
-      final MDN = 'https://developer.mozilla.org';
-      final CCA = 'http://creativecommons.org/licenses/by-sa/2.5/';
-      final CONTRIB = 'https://developer.mozilla.org/Project:en/How_to_Help';
-      writeln(
-          '''
-          <p class="mdn-attribution">
-          <a href="$MDN">
-            <img src="${relativePath('mdn-logo-tiny.png')}" class="mdn-logo" />
-          </a>
-          This page includes <a href="$mdnUrl">content</a> from the
-          <a href="$MOZ">Mozilla Foundation</a> that is graciously
-          <a href="$MDN/Project:Copyrights">licensed</a> under a
-          <a href="$CCA">Creative Commons: Attribution-Sharealike license</a>.
-          Mozilla has no other association with Dart or dartlang.org. We
-          encourage you to improve the web by
-          <a href="$CONTRIB">contributing</a> to
-          <a href="$MDN">The Mozilla Developer Network</a>.
-          </p>
-          ''');
-    }
-  }
-
-  MdnComment lookupMdnComment(Mirror mirror) {
-    if (mirror is TypeMirror) {
-      return includeMdnTypeComment(mirror);
-    } else if (mirror is MethodMirror || mirror is VariableMirror) {
-      return includeMdnMemberComment(mirror);
-    } else {
-      return null;
-    }
-  }
-
-  /**
-   * Gets the MDN-scraped docs for [type], or `null` if this type isn't
-   * scraped from MDN.
-   */
-  MdnComment includeMdnTypeComment(TypeMirror type) {
-    if (_mdnTypeNamesToSkip.contains(type.simpleName)) {
-      return null;
-    }
-
-    var typeString = '';
-    if (HTML_LIBRARY_URIS.contains(getLibrary(type).uri)) {
-      // If it's an HTML type, try to map it to a base DOM type so we can find
-      // the MDN docs.
-      final domTypes = _diff.htmlTypesToDom[type.qualifiedName];
-
-      // Couldn't find a DOM type.
-      if ((domTypes == null) || (domTypes.length != 1)) return null;
-
-      // Use the corresponding DOM type when searching MDN.
-      // TODO(rnystrom): Shame there isn't a simpler way to get the one item
-      // out of a singleton Set.
-      // TODO(floitsch): switch to domTypes.first, once that's implemented.
-      var iter = domTypes.iterator;
-      iter.moveNext();
-      typeString = iter.current;
-    } else {
-      // Not a DOM type.
-      return null;
-    }
-
-    final mdnType = mdn[typeString];
-    if (mdnType == null) return null;
-    if (mdnType['skipped'] != null) return null;
-    if (mdnType['summary'] == null) return null;
-    if (mdnType['summary'].trim().isEmpty) return null;
-
-    // Remember which MDN page we're using so we can attribute it.
-    return new MdnComment(mdnType['summary'], mdnType['srcUrl']);
-  }
-
-  /**
-   * Gets the MDN-scraped docs for [member], or `null` if this type isn't
-   * scraped from MDN.
-   */
-  MdnComment includeMdnMemberComment(DeclarationMirror member) {
-    var library = getLibrary(member);
-    var memberString = '';
-    if (HTML_LIBRARY_URIS.contains(library.uri)) {
-      // If it's an HTML type, try to map it to a DOM type name so we can find
-      // the MDN docs.
-      final domMembers = _diff.htmlToDom[member.qualifiedName];
-
-      // Couldn't find a DOM type.
-      if ((domMembers == null) || (domMembers.length != 1)) return null;
-
-      // Use the corresponding DOM member when searching MDN.
-      // TODO(rnystrom): Shame there isn't a simpler way to get the one item
-      // out of a singleton Set.
-      // TODO(floitsch): switch to domTypes.first, once that's implemented.
-      var iter = domMembers.iterator;
-      iter.moveNext();
-      memberString = iter.current;
-    } else {
-      // Not a DOM type.
-      return null;
-    }
-
-    // Ignore top-level functions.
-    if (member.isTopLevel) return null;
-
-    var mdnMember = null;
-    var mdnType =  null;
-    var pieces = memberString.split('.');
-    if (pieces.length == 2) {
-      mdnType = mdn[pieces[0]];
-      if (mdnType == null) return null;
-      var nameToFind = pieces[1];
-      for (final candidateMember in mdnType['members']) {
-        if (candidateMember['name'] == nameToFind) {
-          mdnMember = candidateMember;
-          break;
-        }
-      }
-    }
-
-    if (mdnMember == null) return null;
-    if (mdnMember['help'] == null) return null;
-    if (mdnMember['help'].trim().isEmpty) return null;
-
-    // Remember which MDN page we're using so we can attribute it.
-    return new MdnComment(mdnMember['help'], mdnType['srcUrl']);
-  }
-
-  /**
-   * Returns a link to [member], relative to a type page that may be in a
-   * different library than [member].
-   */
-  String _linkMember(DeclarationMirror member) {
-    final typeName = member.owner.simpleName;
-    var memberName = '$typeName.${member.simpleName}';
-    if (member is MethodMirror && member.isConstructor) {
-      final separator = member.constructorName == '' ? '' : '.';
-      memberName = 'new $typeName$separator${member.constructorName}';
-    }
-
-    return a(memberUrl(member), memberName);
-  }
-}
-
diff --git a/utils/apidoc/docgen.gyp b/utils/apidoc/docgen.gyp
deleted file mode 100644
index 126e549..0000000
--- a/utils/apidoc/docgen.gyp
+++ /dev/null
@@ -1,102 +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.
-
-{
-  'variables' : {
-    'script_suffix%': '',
-  },
-  'conditions' : [
-    ['OS=="win"', {
-      'variables' : {
-        'script_suffix': '.bat',
-      },
-    }],
-  ],
-  'targets': [
-    {
-      'target_name': 'dartdocgen',
-      'type': 'none',
-      'dependencies': [
-        '../../create_sdk.gyp:create_sdk_internal',
-        '../../pkg/pkg.gyp:pkg_packages',
-        '../../pkg/pkg_files.gyp:pkg_files_stamp',
-      ],
-      'includes': [
-        '../../sdk/lib/core/core_sources.gypi',
-      ],
-      'actions': [
-        {
-          'action_name': 'run_docgen',
-          # The 'inputs' list records the files whose timestamps are
-          # compared to the files listed in 'outputs'.  If a file
-          # 'outputs' doesn't exist or if a file in 'inputs' is newer
-          # than a file in 'outputs', this action is executed.  Notice
-          # that the dependencies listed above has nothing to do with
-          # when this action is executed.  You must list a file in
-          # 'inputs' to make sure that it exists before the action is
-          # executed, or to make sure this action is re-run.
-          #
-          # We want to build the platform documentation whenever
-          # dartdoc, apidoc, or its dependency changes.  This prevents
-          # people from accidentally breaking apidoc when making
-          # changes to the platform libraries and or when modifying
-          # dart2js or the VM.
-          #
-          # In addition, we want to make sure that the platform
-          # documentation is regenerated when the platform sources
-          # changes.
-          #
-          # So we want this action to be re-run when a dart file
-          # changes in this directory, or in the SDK library (we may
-          # no longer need to list the files in ../../runtime/lib and
-          # ../../runtime/bin, as most of them has moved to
-          # ../../sdk/lib).
-          #
-          'inputs': [
-            '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)dart<(EXECUTABLE_SUFFIX)',
-            '<(SHARED_INTERMEDIATE_DIR)/utils_wrapper.dart.snapshot',
-            '<!@(["python", "../../tools/list_files.py", "\\.(css|ico|js|json|png|sh|txt|yaml|py)$", ".", "../../sdk/lib/_internal/dartdoc"])',
-	    # We implicitly depend on the sdk/lib and vm runtime files by depending on the dart binary above.
-            '<!@(["python", "../../tools/list_files.py", "\\.dart$", "."])',
-            '../../sdk/bin/dart',
-            '../../sdk/bin/dart.bat',
-            '../../sdk/bin/dart2js',
-            '../../sdk/bin/dart2js.bat',
-            # TODO(alanknight): The docgen name is deprecated in favour of
-            # dartdocgen, and should be removed eventually.
-            '../../sdk/bin/docgen',
-            '../../sdk/bin/dartdocgen',
-            '../../sdk/bin/docgen.bat',
-            '../../sdk/bin/dartdocgen.bat',
-            '../../tools/only_in_release_mode.py',
-            '<(PRODUCT_DIR)/dart-sdk/README',
-            '<(SHARED_INTERMEDIATE_DIR)/pkg_files.stamp',
-          ],
-          'outputs': [
-            '<(PRODUCT_DIR)/api_docs/docgen/index.json',
-          ],
-          'action': [
-            'python',
-            '../../tools/only_in_release_mode.py',
-            '<@(_outputs)',
-            '--',
-            '<(PRODUCT_DIR)/dart-sdk/bin/dartdocgen<(script_suffix)',
-            '--out=<(PRODUCT_DIR)/api_docs/docgen',
-            '--include-sdk',
-            '--no-include-dependent-packages',
-            '--package-root=<(PRODUCT_DIR)/packages',
-            '--exclude-lib=async_helper',
-            '--exclude-lib=compiler',
-            '--exclude-lib=dart2js_incremental',
-            '--exclude-lib=docgen',
-            '--exclude-lib=expect',
-            '--exclude-lib=try',
-            '../../pkg'
-          ],
-          'message': 'Running dartdocgen: <(_action)',
-        },
-      ],
-    }
-  ],
-}
diff --git a/utils/apidoc/html_diff.dart b/utils/apidoc/html_diff.dart
deleted file mode 100644
index 06adfca..0000000
--- a/utils/apidoc/html_diff.dart
+++ /dev/null
@@ -1,231 +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.
-
-/**
- * A script to assist in documenting the difference between the dart:html API
- * and the old DOM API.
- */
-library html_diff;
-
-import 'dart:async';
-
-import 'lib/metadata.dart';
-
-// TODO(rnystrom): Use "package:" URL (#4968).
-import '../../pkg/compiler/lib/src/mirrors/analyze.dart';
-import '../../pkg/compiler/lib/src/mirrors/source_mirrors.dart';
-import '../../pkg/compiler/lib/src/mirrors/mirrors_util.dart';
-import '../../pkg/compiler/lib/src/source_file_provider.dart';
-
-// TODO(amouravski): There is currently magic that looks at dart:* libraries
-// rather than the declared library names. This changed due to recent syntax
-// changes. We should only need to look at the library 'html'.
-final List<Uri> HTML_LIBRARY_URIS = [
-    new Uri(scheme: 'dart', path: 'html'),
-    new Uri(scheme: 'dart', path: 'indexed_db'),
-    new Uri(scheme: 'dart', path: 'svg'),
-    new Uri(scheme: 'dart', path: 'web_audio')];
-
-/**
- * A class for computing a many-to-many mapping between the types and
- * members in `dart:html` and the MDN DOM types. This mapping is
- * based on two indicators:
- *
- *   1. Auto-detected wrappers. Most `dart:html` types correspond
- *      straightforwardly to a single `@DomName` type, and
- *      have the same name.  In addition, most `dart:html` methods
- *      just call a single `@DomName` method. This class
- *      detects these simple correspondences automatically.
- *
- *   2. Manual annotations. When it's not clear which
- *      `@DomName` items a given `dart:html` item
- *      corresponds to, the `dart:html` item can be annotated in the
- *      documentation comments using the `@DomName` annotation.
- *
- * The `@DomName` annotations for types and members are of the form
- * `@DomName NAME(, NAME)*`, where the `NAME`s refer to the
- * `@DomName` types/members that correspond to the
- * annotated `dart:html` type/member. `NAME`s on member annotations
- * can refer to either fully-qualified member names (e.g.
- * `Document.createElement`) or unqualified member names
- * (e.g. `createElement`).  Unqualified member names are assumed to
- * refer to members of one of the corresponding `@DomName`
- * types.
- */
-class HtmlDiff {
-  /**
-   * A map from `dart:html` members to the corresponding fully qualified
-   * `@DomName` member(s).
-   */
-  final Map<String, Set<String>> htmlToDom;
-
-  /** A map from `dart:html` types to corresponding `@DomName` types. */
-  final Map<String, Set<String>> htmlTypesToDom;
-
-  /** If true, then print warning messages. */
-  final bool _printWarnings;
-
-  static LibraryMirror dom;
-
-  HtmlDiff({bool printWarnings: false}) :
-    _printWarnings = printWarnings,
-    htmlToDom = new Map<String, Set<String>>(),
-    htmlTypesToDom = new Map<String, Set<String>>();
-
-  void warn(String s) {
-    if (_printWarnings) {
-      print('Warning: $s');
-    }
-  }
-
-  /**
-   * Computes the `@DomName` to `dart:html` mapping, and
-   * places it in [htmlToDom] and [htmlTypesToDom]. Before this is run, dart2js
-   * should be initialized (via [parseOptions] and [initializeWorld]) and
-   * [HtmlDiff.initialize] should be called.
-   */
-  Future run(Uri libraryRoot) {
-    var result = new Completer();
-    var provider = new CompilerSourceFileProvider();
-    var handler = new FormattingDiagnosticHandler(provider);
-    Future<MirrorSystem> analysis = analyze(
-        HTML_LIBRARY_URIS, libraryRoot, null,
-        provider.readStringFromUri,
-        handler.diagnosticHandler);
-    analysis.then((MirrorSystem mirrors) {
-      for (var libraryUri in HTML_LIBRARY_URIS) {
-        var library = mirrors.libraries[libraryUri];
-        if (library == null) {
-          warn('Could not find $libraryUri');
-          result.complete(false);
-        }
-        for (ClassMirror type in classesOf(library.declarations)) {
-          final domTypes = htmlToDomTypes(type);
-          if (domTypes.isEmpty) continue;
-
-          htmlTypesToDom.putIfAbsent(qualifiedNameOf(type),
-              () => new Set()).addAll(domTypes);
-
-          membersOf(type.declarations).forEach(
-              (m) => _addMemberDiff(m, domTypes, nameOf(library)));
-        }
-      }
-      result.complete(true);
-    });
-    return result.future;
-  }
-
-  /**
-   * Records the `@DomName` to `dart:html` mapping for
-   * [htmlMember] (from `dart:html`). [domTypes] are the
-   * `@DomName` type values that correspond to [htmlMember]'s
-   * defining type.
-   */
-  void _addMemberDiff(DeclarationMirror htmlMember, List<String> domTypes,
-      String libraryName) {
-    var domMembers = htmlToDomMembers(htmlMember, domTypes);
-    if (htmlMember == null && !domMembers.isEmpty) {
-      warn('$libraryName member '
-           '${htmlMember.owner.simpleName}.'
-           '${htmlMember.simpleName} has no corresponding '
-           '$libraryName member.');
-    }
-
-    if (htmlMember == null) return;
-    if (!domMembers.isEmpty) {
-      htmlToDom[qualifiedNameOf(htmlMember)] = domMembers;
-    }
-  }
-
-  /**
-   * Returns the `@DomName` type values that correspond to
-   * [htmlType] from `dart:html`. This can be the empty list if no
-   * correspondence is found.
-   */
-  List<String> htmlToDomTypes(ClassMirror htmlType) {
-    if (htmlType.simpleName == null) return <String>[];
-
-    final domNameMetadata = findMetadata(htmlType.metadata, 'DomName');
-    if (domNameMetadata != null) {
-      var domNames = <String>[];
-      var names = domNameMetadata.getField(symbolOf('name'));
-      for (var s in names.reflectee.split(',')) {
-        domNames.add(s.trim());
-      }
-
-      if (domNames.length == 1 && domNames[0] == 'none') return <String>[];
-      return domNames;
-    }
-    return <String>[];
-  }
-
-  /**
-   * Returns the `@DomName` member values that correspond to
-   * [htmlMember] from `dart:html`. This can be the empty set if no
-   * correspondence is found.  [domTypes] are the
-   * `@DomName` type values that correspond to [htmlMember]'s
-   * defining type.
-   */
-  Set<String> htmlToDomMembers(DeclarationMirror htmlMember,
-                               List<String> domTypes) {
-    if (htmlMember.isPrivate) return new Set();
-
-    final domNameMetadata = findMetadata(htmlMember.metadata, 'DomName');
-    if (domNameMetadata != null) {
-      var domNames = <String>[];
-      var names = domNameMetadata.getField(symbolOf('name'));
-      for (var s in names.reflectee.split(',')) {
-        domNames.add(s.trim());
-      }
-
-      if (domNames.length == 1 && domNames[0] == 'none') return new Set();
-      final members = new Set();
-      domNames.forEach((name) {
-        var nameMembers = _membersFromName(name, domTypes);
-        if (nameMembers.isEmpty) {
-          if (name.contains('.')) {
-            warn('no member $name');
-          } else {
-            final options = <String>[];
-            for (var t in domTypes) {
-              options.add('$t.$name');
-            }
-            options.join(' or ');
-            warn('no member $options');
-          }
-        }
-        members.addAll(nameMembers);
-      });
-      return members;
-    }
-
-    return new Set();
-  }
-
-  /**
-   * Returns the `@DomName` strings that are indicated by
-   * [name]. [name] can be either an unqualified member name
-   * (e.g. `createElement`), in which case it's treated as the name of
-   * a member of one of [defaultTypes], or a fully-qualified member
-   * name (e.g. `Document.createElement`), in which case it's treated as a
-   * member of the @DomName element (`Document` in this case).
-   */
-  Set<String> _membersFromName(String name, List<String> defaultTypes) {
-    if (!name.contains('.', 0)) {
-      if (defaultTypes.isEmpty) {
-        warn('no default type for $name');
-        return new Set();
-      }
-      final members = new Set<String>();
-      defaultTypes.forEach((t) { members.add('$t.$name'); });
-      return members;
-    }
-
-    if (name.split('.').length != 2) {
-      warn('invalid member name ${name}');
-      return new Set();
-    }
-    return new Set.from([name]);
-  }
-}
diff --git a/utils/apidoc/lib/metadata.dart b/utils/apidoc/lib/metadata.dart
deleted file mode 100644
index c56b0b6..0000000
--- a/utils/apidoc/lib/metadata.dart
+++ /dev/null
@@ -1,15 +0,0 @@
-library metadata;
-
-import '../../../pkg/compiler/lib/src/mirrors/source_mirrors.dart';
-import '../../../pkg/compiler/lib/src/mirrors/mirrors_util.dart';
-
-/// Returns the metadata for the given string or null if not found.
-InstanceMirror findMetadata(List<InstanceMirror> metadataList, String find) {
-  return metadataList.firstWhere(
-      (metadata) {
-        if (metadata is TypeInstanceMirror) {
-          return nameOf(metadata.representedType) == find;
-        }
-        return nameOf(metadata.type) == find;
-      }, orElse: () => null);
-}
diff --git a/utils/apidoc/mdn/README.txt b/utils/apidoc/mdn/README.txt
deleted file mode 100644
index 1666752..0000000
--- a/utils/apidoc/mdn/README.txt
+++ /dev/null
@@ -1,76 +0,0 @@
-***** Current status
-
-Currently it runs all the way through, but the database.json has all
-members[] lists empty.  Most entries are skipped for "Suspect title";
-some have ".pageText not found".
-
-Currently only works on Linux; OS X (or other) will need minor path changes.
-
-You will need a reasonably modern node.js installed.
-0.5.9 is too old; 0.8.8 is not too old.
-
-I needed to add my own "DumpRenderTree_resources/missingImage.gif",
-for some reason.
-
-For the reasons above, we're currently just using the checked-in
-database.json from Feb 2012, but it has some bogus entries.  In
-particular, the one for UnknownElement would inject irrelevant German
-text into our docs.  So a hack in apidoc.dart (_mdnTypeNamesToSkip)
-works around this.
-
-***** Overview
-
-Here's a rough walkthrough of how this works. The ultimate output file is
-database.filtered.json.
-
-full_run.sh executes all of the scripts in the correct order.
-
-search.js
-- read data/domTypes.json
-- for each dom type:
-  - search for page on www.googleapis.com
-  - write search results to output/search/<type>.json
-    . this is a list of search results and urls to pages
-
-crawl.js
-- read data/domTypes.json
-- for each dom type:
-  - for each output/search/<type>.json:
-    - for each result in the file:
-      - try to scrape that cached MDN page from webcache.googleusercontent.com
-      - write mdn page to output/crawl/<type><index of result>.html
-- write output/crawl/cache.json
-  . it maps types -> search result page urls and titles
-
-extract.sh
-- compile extract.dart to js
-- run extractRunner.js
-  - read data/domTypes.json
-  - read output/crawl/cache.json
-  - read data/dartIdl.json
-  - for each scraped search result page:
-    - create a cleaned up html page in output/extract/<type><index>.html that
-      contains the scraped content + a script tag that includes extract.dart.js.
-    - create an args file in output/extract/<type><index>.html.json with some
-      data on how that file should be processed
-    - invoke dump render tree on that file
-    - when that returns, parse the console output and add it to database.json
-    - add any errors to output/errors.json
-  - save output/database.json
-
-extract.dart
-- xhr output/extract/<type><index>.html.json
-- all sorts of shenanigans to actually pull the content out of the html
-- build a JSON object with the results
-- do a postmessage with that object so extractRunner.js can pull it out
-
-- run postProcess.dart
-  - go through the results for each type looking for the best match
-  - write output/database.html
-  - write output/examples.html
-  - write output/obsolete.html
-  - write output/database.filtered.json which is the best matches
-
-***** Process for updating database.json using these scripts.
-
-TODO(eub) when I get the scripts to work all the way through.
diff --git a/utils/apidoc/mdn/crawl.js b/utils/apidoc/mdn/crawl.js
deleted file mode 100644
index 4a45fd4..0000000
--- a/utils/apidoc/mdn/crawl.js
+++ /dev/null
@@ -1,120 +0,0 @@
-// TODO(jacobr): convert this file to Dart once Dart supports all of the
-// nodejs functionality used here.  For example, search for all occurences of
-// "http." and "fs."
-var http = require('http');
-var fs = require('fs');
-
-try {
-  fs.mkdirSync('output/crawl');
-} catch (e) {
-  // It doesn't matter if the directories already exist.
-}
-
-var domTypes = JSON.parse(fs.readFileSync('data/domTypes.json', 'utf8'));
-
-var cacheData = {};
-
-function scrape(filename, link) {
-  console.log(link);
-  var httpsPrefix = "https://";
-  var prefix = 'https://developer.mozilla.org/';
-  var notFoundPrefix = 'https://developer.mozilla.org/Article_not_found?uri=';
-  if (link.indexOf(prefix) != 0 ) {
-    throw "Unexpected url: " + link;
-  }
-  var scrapePath = "/search?q=cache:" + link;
-  // We crawl content from googleusercontent.com so we don't have to worry about
-  // crawler politeness like we would have to if scraping developer.mozilla.org
-  // directly.
-  var options = {
-    host: 'webcache.googleusercontent.com',
-    path: scrapePath,
-    port: 80,
-    method: 'GET'
-  };
-
-  var req = http.request(options, function(res) {
-    res.setEncoding('utf8');
-    var data='';
-
-    res.on('data', function(d) {
-      data += d;
-    });
-    var onClose = function(e) {
-      console.log("Writing crawl result for " + link);
-      fs.writeFileSync("output/crawl/" + filename + ".html", data, 'utf8');
-    }
-    res.on('close', onClose);
-    res.on('end', onClose);
-  });
-  req.end();
-
-  req.on('error', function(e) {
-    throw "Error " + e + " scraping " + link;
-  });
-}
-
-for (var i = 0; i < domTypes.length; i++) {
-  var type = domTypes[i];
-
-  // Json containing the search results for the current type.
-  var data = fs.readFileSync("output/search/" + type + ".json");
-  json = JSON.parse(data);
-  if (!('items' in json)) {
-    console.warn("No search results for " + type);
-    continue;
-  }
-  var items = json['items'];
-
-  var entry = [];
-  cacheData[type] = entry;
-
-  // Hardcode the correct matching url for a few types where the search engine
-  // gets the wrong answer.
-  var link = null;
-  if (type == 'Screen') {
-    link = 'https://developer.mozilla.org/en/DOM/window.screen';
-  } else if (type == 'Text') {
-    link = 'https://developer.mozilla.org/en/DOM/Text';
-  } else if (type == 'Touch') {
-    link = 'https://developer.mozilla.org/en/DOM/Touch';
-  } else if (type == 'TouchEvent' || type == 'webkitTouchEvent' || type == 'WebkitTouchEvent' || type == 'WebKitTouchEvent') {
-    link = 'https://developer.mozilla.org/en/DOM/TouchEvent';
-  } else if (type == 'HTMLSpanElement') {
-    link = 'https://developer.mozilla.org/en/HTML/Element/span';
-  } else if (type == 'HTMLPreElement') {
-    link = 'https://developer.mozilla.org/en/HTML/Element/pre';
-  } else if (type == 'HTMLFrameElement') {
-    link = 'https://developer.mozilla.org/en/HTML/Element/frame';
-  } else if (type == 'HTMLFrameSetElement') {
-    link = 'https://developer.mozilla.org/en/HTML/Element/frameset';
-  } else if (type == 'Geolocation') {
-    link = 'https://developer.mozilla.org/en/nsIDOMGeolocation;'
-  } else if (type == 'Notification') {
-    link = 'https://developer.mozilla.org/en/DOM/notification';
-  } else if (type == 'IDBDatabase') {
-    link = 'https://developer.mozilla.org/en/IndexedDB/IDBDatabase'
-  }
-  if (link != null) {
-    entry.push({index: 0, link: link, title: type});
-    scrape(type + 0, link);
-    continue;
-  }
-
-  for (j = 0; j < items.length; j++) {
-    var item = items[j];
-    var prefix = 'https://developer.mozilla.org/';
-    var notFoundPrefix = 'https://developer.mozilla.org/Article_not_found?uri=';
-    // Be optimistic and replace article not found links with links to where the
-    // article should be.
-    link = item['link'];
-    if (link.indexOf(notFoundPrefix) == 0) {
-      link = prefix + link.substr(notFoundPrefix.length);
-    }
-
-    entry.push({index: j, link: link, title: item['title']});
-    scrape(type + j, link);
-  }
-}
-
-fs.writeFileSync('output/crawl/cache.json', JSON.stringify(cacheData, null, ' '), 'utf8');
diff --git a/utils/apidoc/mdn/data/dartIdl.json b/utils/apidoc/mdn/data/dartIdl.json
deleted file mode 100644
index fdb9b9e..0000000
--- a/utils/apidoc/mdn/data/dartIdl.json
+++ /dev/null
@@ -1 +0,0 @@
-{"KeyboardEvent": {"constructors": {}, "properties": {"keyIdentifier": true, "metaKey": true, "shiftKey": true, "altKey": true, "keyLocation": true, "ctrlKey": true, "altGraphKey": true}, "constants": {}, "methods": {"initKeyboardEvent": true}}, "SVGZoomEvent": {"constructors": {}, "properties": {"newTranslate": true, "newScale": true, "previousTranslate": true, "previousScale": true, "zoomRectScreen": true}, "constants": {}, "methods": {}}, "CDATASection": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "TextTrackCueList": {"constructors": {}, "properties": {"length": true}, "constants": {}, "methods": {"item": true, "getCueById": true}}, "HTMLFrameSetElement": {"constructors": {}, "properties": {"onload": true, "onblur": true, "onhashchange": true, "onoffline": true, "onerror": true, "ononline": true, "cols": true, "onresize": true, "onbeforeunload": true, "rows": true, "onpopstate": true, "onmessage": true, "onfocus": true, "onorientationchange": true, "onunload": true, "onstorage": true}, "constants": {}, "methods": {}}, "SVGFEDropShadowElement": {"constructors": {}, "properties": {"stdDeviationX": true, "stdDeviationY": true, "in1": true, "dx": true, "dy": true}, "constants": {}, "methods": {"setStdDeviation": true}}, "DelayNode": {"constructors": {}, "properties": {"delayTime": true}, "constants": {}, "methods": {}}, "Metadata": {"constructors": {}, "properties": {"modificationTime": true}, "constants": {}, "methods": {}}, "SVGFEMorphologyElement": {"constructors": {}, "properties": {"radiusY": true, "radiusX": true, "SVG_MORPHOLOGY_OPERATOR_UNKNOWN": true, "in1": true, "operator": true, "SVG_MORPHOLOGY_OPERATOR_DILATE": true, "SVG_MORPHOLOGY_OPERATOR_ERODE": true}, "constants": {}, "methods": {"setRadius": true}}, "SVGPathSegClosePath": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "SVGFETileElement": {"constructors": {}, "properties": {"in1": true}, "constants": {}, "methods": {}}, "WebGLShader": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "WebKitBlobBuilder": {"constructors": {}, "properties": {}, "constants": {}, "methods": {"getBlob": true, "append": true}}, "SVGLengthList": {"constructors": {}, "properties": {"numberOfItems": true}, "constants": {}, "methods": {"replaceItem": true, "appendItem": true, "clear": true, "getItem": true, "removeItem": true, "initialize": true, "insertItemBefore": true}}, "MutationCallback": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "SVGTSpanElement": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "WebGLBuffer": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "EventException": {"constructors": {}, "properties": {"DISPATCH_REQUEST_ERR": true, "UNSPECIFIED_EVENT_TYPE_ERR": true, "message": true, "code": true, "name": true}, "constants": {}, "methods": {"toString": true}}, "OESVertexArrayObject": {"constructors": {}, "properties": {"VERTEX_ARRAY_BINDING_OES": true}, "constants": {}, "methods": {"isVertexArrayOES": true, "createVertexArrayOES": true, "deleteVertexArrayOES": true, "bindVertexArrayOES": true}}, "MetadataCallback": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "WebKitAnimationList": {"constructors": {}, "properties": {"length": true}, "constants": {}, "methods": {"item": true}}, "HTMLSpanElement": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "SVGRect": {"constructors": {}, "properties": {"y": true, "width": true, "x": true, "height": true}, "constants": {}, "methods": {}}, "ErrorCallback": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "SVGAnimatedString": {"constructors": {}, "properties": {"animVal": true, "baseVal": true}, "constants": {}, "methods": {}}, "SVGPointList": {"constructors": {}, "properties": {"numberOfItems": true}, "constants": {}, "methods": {"replaceItem": true, "appendItem": true, "clear": true, "getItem": true, "removeItem": true, "initialize": true, "insertItemBefore": true}}, "HTMLOptionElement": {"constructors": {}, "properties": {"index": true, "selected": true, "form": true, "text": true, "defaultSelected": true, "value": true, "label": true, "disabled": true}, "constants": {}, "methods": {}}, "XPathException": {"constructors": {}, "properties": {"TYPE_ERR": true, "message": true, "code": true, "INVALID_EXPRESSION_ERR": true, "name": true}, "constants": {}, "methods": {"toString": true}}, "SVGAnimatedNumber": {"constructors": {}, "properties": {"animVal": true, "baseVal": true}, "constants": {}, "methods": {}}, "Entity": {"constructors": {}, "properties": {"systemId": true, "publicId": true, "notationName": true}, "constants": {}, "methods": {}}, "EntryArray": {"constructors": {}, "properties": {"length": true}, "constants": {}, "methods": {"item": true}}, "MediaError": {"constructors": {}, "properties": {"MEDIA_ERR_ABORTED": true, "code": true, "MEDIA_ERR_DECODE": true, "MEDIA_ERR_NETWORK": true, "MEDIA_ERR_SRC_NOT_SUPPORTED": true}, "constants": {}, "methods": {}}, "HTMLDocument": {"constructors": {}, "properties": {"all": true, "width": true, "embeds": true, "scripts": true, "height": true, "bgColor": true, "linkColor": true, "designMode": true, "plugins": true, "alinkColor": true, "compatMode": true, "activeElement": true, "fgColor": true, "dir": true, "vlinkColor": true}, "constants": {}, "methods": {"write": true, "hasFocus": true, "clear": true, "captureEvents": true, "releaseEvents": true, "close": true, "open": true, "writeln": true}}, "WebKitAnimation": {"constructors": {}, "properties": {"elapsedTime": true, "direction": true, "name": true, "DIRECTION_ALTERNATE": true, "FILL_FORWARDS": true, "FILL_BACKWARDS": true, "iterationCount": true, "fillMode": true, "delay": true, "ended": true, "FILL_BOTH": true, "DIRECTION_NORMAL": true, "paused": true, "duration": true, "FILL_NONE": true}, "constants": {}, "methods": {"play": true, "pause": true}}, "HTMLButtonElement": {"constructors": {}, "properties": {"labels": true, "value": true, "formMethod": true, "name": true, "form": true, "accessKey": true, "formTarget": true, "formEnctype": true, "formAction": true, "disabled": true, "willValidate": true, "validity": true, "formNoValidate": true, "autofocus": true, "type": true, "validationMessage": true}, "constants": {}, "methods": {"setCustomValidity": true, "checkValidity": true, "click": true}}, "SVGFECompositeElement": {"constructors": {}, "properties": {"SVG_FECOMPOSITE_OPERATOR_UNKNOWN": true, "SVG_FECOMPOSITE_OPERATOR_ATOP": true, "SVG_FECOMPOSITE_OPERATOR_IN": true, "in1": true, "in2": true, "k3": true, "k2": true, "k1": true, "SVG_FECOMPOSITE_OPERATOR_XOR": true, "SVG_FECOMPOSITE_OPERATOR_OVER": true, "k4": true, "operator": true, "SVG_FECOMPOSITE_OPERATOR_OUT": true, "SVG_FECOMPOSITE_OPERATOR_ARITHMETIC": true}, "constants": {}, "methods": {}}, "AbstractWorker": {"constructors": {}, "properties": {"onerror": true}, "constants": {}, "methods": {"removeEventListener": true, "dispatchEvent": true, "addEventListener": true}}, "WebKitMutationObserver": {"constructors": {}, "properties": {}, "constants": {}, "methods": {"disconnect": true}}, "SVGStopElement": {"constructors": {}, "properties": {"offset": true}, "constants": {}, "methods": {}}, "HTMLCollection": {"constructors": {}, "properties": {"length": true}, "constants": {}, "methods": {"item": true, "namedItem": true}}, "Worker": {"constructors": {}, "properties": {"onmessage": true}, "constants": {}, "methods": {"postMessage": true, "webkitPostMessage": true, "terminate": true}}, "SVGPatternElement": {"constructors": {}, "properties": {"height": true, "width": true, "patternUnits": true, "patternTransform": true, "x": true, "y": true, "patternContentUnits": true}, "constants": {}, "methods": {}}, "Float64Array": {"constructors": {}, "properties": {"length": true, "BYTES_PER_ELEMENT": true}, "constants": {}, "methods": {"subarray": true}}, "CSSStyleSheet": {"constructors": {}, "properties": {"rules": true, "cssRules": true, "ownerRule": true}, "constants": {}, "methods": {"addRule": true, "removeRule": true, "insertRule": true, "deleteRule": true}}, "SVGPathSegCurvetoQuadraticSmoothRel": {"constructors": {}, "properties": {"y": true, "x": true}, "constants": {}, "methods": {}}, "WorkerLocation": {"constructors": {}, "properties": {"search": true, "hash": true, "hostname": true, "host": true, "href": true, "pathname": true, "protocol": true, "port": true}, "constants": {}, "methods": {"toString": true}}, "ErrorEvent": {"constructors": {}, "properties": {"message": true, "lineno": true, "filename": true}, "constants": {}, "methods": {"initErrorEvent": true}}, "SVGException": {"constructors": {}, "properties": {"code": true, "name": true, "message": true, "SVG_WRONG_TYPE_ERR": true, "SVG_MATRIX_NOT_INVERTABLE": true, "SVG_INVALID_VALUE_ERR": true}, "constants": {}, "methods": {"toString": true}}, "HTMLAreaElement": {"constructors": {}, "properties": {"search": true, "hash": true, "target": true, "accessKey": true, "hostname": true, "ping": true, "shape": true, "protocol": true, "noHref": true, "host": true, "href": true, "coords": true, "pathname": true, "alt": true, "port": true}, "constants": {}, "methods": {}}, "HTMLFormElement": {"constructors": {}, "properties": {"elements": true, "name": true, "encoding": true, "autocomplete": true, "noValidate": true, "length": true, "target": true, "action": true, "acceptCharset": true, "method": true, "enctype": true}, "constants": {}, "methods": {"reset": true, "checkValidity": true, "submit": true}}, "SVGLength": {"constructors": {}, "properties": {"value": true, "SVG_LENGTHTYPE_NUMBER": true, "SVG_LENGTHTYPE_UNKNOWN": true, "SVG_LENGTHTYPE_PERCENTAGE": true, "SVG_LENGTHTYPE_MM": true, "SVG_LENGTHTYPE_CM": true, "SVG_LENGTHTYPE_EMS": true, "valueInSpecifiedUnits": true, "SVG_LENGTHTYPE_PC": true, "SVG_LENGTHTYPE_EXS": true, "valueAsString": true, "unitType": true, "SVG_LENGTHTYPE_PX": true, "SVG_LENGTHTYPE_IN": true, "SVG_LENGTHTYPE_PT": true}, "constants": {}, "methods": {"newValueSpecifiedUnits": true, "convertToSpecifiedUnits": true}}, "DataTransferItemList": {"constructors": {}, "properties": {"length": true}, "constants": {}, "methods": {"item": true, "add": true, "clear": true}}, "HTMLInputElement": {"constructors": {}, "properties": {"defaultChecked": true, "valueAsDate": true, "labels": true, "onwebkitspeechchange": true, "formEnctype": true, "accept": true, "disabled": true, "incremental": true, "selectionStart": true, "selectionEnd": true, "selectedOption": true, "formTarget": true, "alt": true, "webkitSpeech": true, "size": true, "checked": true, "min": true, "pattern": true, "accessKey": true, "indeterminate": true, "formAction": true, "valueAsNumber": true, "formNoValidate": true, "autofocus": true, "type": true, "validationMessage": true, "files": true, "multiple": true, "form": true, "max": true, "useMap": true, "webkitdirectory": true, "validity": true, "readOnly": true, "selectionDirection": true, "maxLength": true, "placeholder": true, "willValidate": true, "src": true, "formMethod": true, "webkitGrammar": true, "name": true, "align": true, "required": true, "list": true, "step": true, "value": true, "autocomplete": true, "defaultValue": true}, "constants": {}, "methods": {"setCustomValidity": true, "stepDown": true, "checkValidity": true, "stepUp": true, "setSelectionRange": true, "click": true, "select": true}}, "AudioBufferSourceNode": {"constructors": {}, "properties": {"buffer": true, "looping": true, "gain": true, "loop": true, "playbackRate": true}, "constants": {}, "methods": {"noteOn": true, "noteOff": true, "noteGrainOn": true}}, "CompositionEvent": {"constructors": {}, "properties": {"data": true}, "constants": {}, "methods": {"initCompositionEvent": true}}, "InjectedScriptHost": {"constructors": {}, "properties": {}, "constants": {}, "methods": {"databaseId": true, "isHTMLAllCollection": true, "evaluate": true, "inspect": true, "clearConsoleMessages": true, "internalConstructorName": true, "inspectedNode": true, "storageId": true, "copyText": true, "type": true}}, "DOMException": {"constructors": {}, "properties": {"NO_DATA_ALLOWED_ERR": true, "SYNTAX_ERR": true, "INVALID_CHARACTER_ERR": true, "SECURITY_ERR": true, "INUSE_ATTRIBUTE_ERR": true, "NOT_SUPPORTED_ERR": true, "INVALID_STATE_ERR": true, "WRONG_DOCUMENT_ERR": true, "ABORT_ERR": true, "message": true, "TYPE_MISMATCH_ERR": true, "code": true, "HIERARCHY_REQUEST_ERR": true, "NOT_FOUND_ERR": true, "DATA_CLONE_ERR": true, "NETWORK_ERR": true, "INVALID_MODIFICATION_ERR": true, "NAMESPACE_ERR": true, "URL_MISMATCH_ERR": true, "INVALID_NODE_TYPE_ERR": true, "INDEX_SIZE_ERR": true, "NO_MODIFICATION_ALLOWED_ERR": true, "VALIDATION_ERR": true, "INVALID_ACCESS_ERR": true, "name": true, "TIMEOUT_ERR": true, "DOMSTRING_SIZE_ERR": true, "QUOTA_EXCEEDED_ERR": true}, "constants": {}, "methods": {"toString": true}}, "SVGPathSegLinetoAbs": {"constructors": {}, "properties": {"y": true, "x": true}, "constants": {}, "methods": {}}, "SVGVKernElement": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "SVGAElement": {"constructors": {}, "properties": {"target": true}, "constants": {}, "methods": {}}, "SVGURIReference": {"constructors": {}, "properties": {"href": true}, "constants": {}, "methods": {}}, "TextMetrics": {"constructors": {}, "properties": {"width": true}, "constants": {}, "methods": {}}, "SVGAnimateTransformElement": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "HTMLHeadElement": {"constructors": {}, "properties": {"profile": true}, "constants": {}, "methods": {}}, "Int8Array": {"constructors": {}, "properties": {"length": true, "BYTES_PER_ELEMENT": true}, "constants": {}, "methods": {"subarray": true}}, "DeviceOrientationEvent": {"constructors": {}, "properties": {"alpha": true, "beta": true, "gamma": true}, "constants": {}, "methods": {"initDeviceOrientationEvent": true}}, "Node": {"constructors": {}, "properties": {"COMMENT_NODE": true, "DOCUMENT_POSITION_CONTAINED_BY": true, "parentNode": true, "nextSibling": true, "DOCUMENT_TYPE_NODE": true, "prefix": true, "nodeValue": true, "ATTRIBUTE_NODE": true, "childNodes": true, "DOCUMENT_POSITION_FOLLOWING": true, "parentElement": true, "DOCUMENT_POSITION_PRECEDING": true, "lastChild": true, "nodeName": true, "CDATA_SECTION_NODE": true, "ENTITY_REFERENCE_NODE": true, "localName": true, "DOCUMENT_FRAGMENT_NODE": true, "previousSibling": true, "nodeType": true, "DOCUMENT_NODE": true, "ENTITY_NODE": true, "TEXT_NODE": true, "DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC": true, "NOTATION_NODE": true, "DOCUMENT_POSITION_CONTAINS": true, "ownerDocument": true, "baseURI": true, "textContent": true, "DOCUMENT_POSITION_DISCONNECTED": true, "firstChild": true, "PROCESSING_INSTRUCTION_NODE": true, "namespaceURI": true, "ELEMENT_NODE": true, "attributes": true}, "constants": {}, "methods": {"compareDocumentPosition": true, "appendChild": true, "isDefaultNamespace": true, "removeEventListener": true, "replaceChild": true, "insertBefore": true, "isSupported": true, "contains": true, "isSameNode": true, "lookupNamespaceURI": true, "cloneNode": true, "removeChild": true, "lookupPrefix": true, "normalize": true, "hasChildNodes": true, "addEventListener": true, "hasAttributes": true, "dispatchEvent": true, "isEqualNode": true}}, "WebGLTexture": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "PositionErrorCallback": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "WebKitCSSKeyframesRule": {"constructors": {}, "properties": {"cssRules": true, "name": true}, "constants": {}, "methods": {"insertRule": true, "deleteRule": true, "findRule": true}}, "SVGTextPositioningElement": {"constructors": {}, "properties": {"y": true, "x": true, "rotate": true, "dx": true, "dy": true}, "constants": {}, "methods": {}}, "IDBDatabaseException": {"constructors": {}, "properties": {"code": true, "SERIAL_ERR": true, "CONSTRAINT_ERR": true, "READ_ONLY_ERR": true, "NOT_ALLOWED_ERR": true, "RECOVERABLE_ERR": true, "NOT_FOUND_ERR": true, "name": true, "TIMEOUT_ERR": true, "DATA_ERR": true, "UNKNOWN_ERR": true, "TRANSIENT_ERR": true, "NO_ERR": true, "ABORT_ERR": true, "message": true, "DEADLOCK_ERR": true, "NON_TRANSIENT_ERR": true}, "constants": {}, "methods": {"toString": true}}, "IDBCursor": {"constructors": {}, "properties": {"NEXT_NO_DUPLICATE": true, "direction": true, "NEXT": true, "source": true, "PREV_NO_DUPLICATE": true, "key": true, "PREV": true, "primaryKey": true}, "constants": {}, "methods": {"continue": true, "update": true, "delete": true}}, "SVGSwitchElement": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "SVGAnimateElement": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "SVGPathSegLinetoHorizontalRel": {"constructors": {}, "properties": {"x": true}, "constants": {}, "methods": {}}, "HTMLSourceElement": {"constructors": {}, "properties": {"media": true, "type": true, "src": true}, "constants": {}, "methods": {}}, "HTMLTableRowElement": {"constructors": {}, "properties": {"ch": true, "chOff": true, "sectionRowIndex": true, "rowIndex": true, "align": true, "bgColor": true, "vAlign": true, "cells": true}, "constants": {}, "methods": {"insertCell": true, "deleteCell": true}}, "FileException": {"constructors": {}, "properties": {"SYNTAX_ERR": true, "name": true, "SECURITY_ERR": true, "NOT_FOUND_ERR": true, "NOT_READABLE_ERR": true, "INVALID_STATE_ERR": true, "code": true, "INVALID_MODIFICATION_ERR": true, "NO_MODIFICATION_ALLOWED_ERR": true, "ABORT_ERR": true, "QUOTA_EXCEEDED_ERR": true, "PATH_EXISTS_ERR": true, "message": true, "TYPE_MISMATCH_ERR": true, "ENCODING_ERR": true}, "constants": {}, "methods": {"toString": true}}, "SVGFontFaceSrcElement": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "MutationRecord": {"constructors": {}, "properties": {"type": true, "target": true, "attributeName": true, "addedNodes": true, "nextSibling": true, "removedNodes": true, "oldValue": true, "attributeNamespace": true, "previousSibling": true}, "constants": {}, "methods": {}}, "CSSUnknownRule": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "IDBVersionChangeEvent": {"constructors": {}, "properties": {"version": true}, "constants": {}, "methods": {}}, "SVGSetElement": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "FileReader": {"constructors": {}, "properties": {"onabort": true, "onload": true, "readyState": true, "LOADING": true, "onerror": true, "onloadend": true, "onprogress": true, "DONE": true, "onloadstart": true, "error": true, "EMPTY": true, "result": true}, "constants": {}, "methods": {"readAsDataURL": true, "abort": true, "readAsArrayBuffer": true, "readAsText": true, "readAsBinaryString": true}}, "RGBColor": {"constructors": {}, "properties": {"blue": true, "green": true, "red": true}, "constants": {}, "methods": {}}, "StyleSheet": {"constructors": {}, "properties": {"title": true, "parentStyleSheet": true, "media": true, "disabled": true, "href": true, "ownerNode": true, "type": true}, "constants": {}, "methods": {}}, "VoidCallback": {"constructors": {}, "properties": {}, "constants": {}, "methods": {"handleEvent": true}}, "HTMLDirectoryElement": {"constructors": {}, "properties": {"compact": true}, "constants": {}, "methods": {}}, "DocumentFragment": {"constructors": {}, "properties": {}, "constants": {}, "methods": {"querySelectorAll": true, "querySelector": true}}, "SVGFESpotLightElement": {"constructors": {}, "properties": {"z": true, "limitingConeAngle": true, "specularExponent": true, "x": true, "y": true, "pointsAtZ": true, "pointsAtY": true, "pointsAtX": true}, "constants": {}, "methods": {}}, "SVGPreserveAspectRatio": {"constructors": {}, "properties": {"SVG_PRESERVEASPECTRATIO_XMINYMAX": true, "SVG_MEETORSLICE_UNKNOWN": true, "SVG_PRESERVEASPECTRATIO_XMINYMID": true, "SVG_PRESERVEASPECTRATIO_XMIDYMID": true, "SVG_MEETORSLICE_SLICE": true, "align": true, "SVG_PRESERVEASPECTRATIO_XMINYMIN": true, "meetOrSlice": true, "SVG_PRESERVEASPECTRATIO_XMAXYMIN": true, "SVG_PRESERVEASPECTRATIO_XMIDYMAX": true, "SVG_PRESERVEASPECTRATIO_NONE": true, "SVG_PRESERVEASPECTRATIO_UNKNOWN": true, "SVG_PRESERVEASPECTRATIO_XMAXYMID": true, "SVG_MEETORSLICE_MEET": true, "SVG_PRESERVEASPECTRATIO_XMIDYMIN": true, "SVG_PRESERVEASPECTRATIO_XMAXYMAX": true}, "constants": {}, "methods": {}}, "StorageInfo": {"constructors": {}, "properties": {"TEMPORARY": true, "PERSISTENT": true}, "constants": {}, "methods": {"requestQuota": true, "queryUsageAndQuota": true}}, "IDBIndex": {"constructors": {}, "properties": {"unique": true, "objectStore": true, "name": true, "keyPath": true}, "constants": {}, "methods": {"openKeyCursor": true, "getKey": true, "openCursor": true, "get": true}}, "DirectoryReader": {"constructors": {}, "properties": {}, "constants": {}, "methods": {"readEntries": true}}, "SVGAnimatedTransformList": {"constructors": {}, "properties": {"animVal": true, "baseVal": true}, "constants": {}, "methods": {}}, "DOMImplementation": {"constructors": {}, "properties": {}, "constants": {}, "methods": {"hasFeature": true, "createDocument": true, "createHTMLDocument": true, "createDocumentType": true, "createCSSStyleSheet": true}}, "HTMLDivElement": {"constructors": {}, "properties": {"align": true}, "constants": {}, "methods": {}}, "HTMLEmbedElement": {"constructors": {}, "properties": {"src": true, "name": true, "align": true, "height": true, "width": true, "type": true}, "constants": {}, "methods": {}}, "CSSRule": {"constructors": {}, "properties": {"WEBKIT_KEYFRAMES_RULE": true, "CHARSET_RULE": true, "MEDIA_RULE": true, "WEBKIT_REGION_STYLE_RULE": true, "IMPORT_RULE": true, "cssText": true, "parentRule": true, "UNKNOWN_RULE": true, "parentStyleSheet": true, "STYLE_RULE": true, "FONT_FACE_RULE": true, "WEBKIT_KEYFRAME_RULE": true, "type": true, "PAGE_RULE": true}, "constants": {}, "methods": {}}, "Notation": {"constructors": {}, "properties": {"systemId": true, "publicId": true}, "constants": {}, "methods": {}}, "DataView": {"constructors": {}, "properties": {}, "constants": {}, "methods": {"getUint16": true, "setUint8": true, "getInt16": true, "getFloat64": true, "setFloat64": true, "setInt32": true, "setInt16": true, "setUint32": true, "setFloat32": true, "getUint8": true, "setInt8": true, "getInt32": true, "getInt8": true, "setUint16": true, "getUint32": true, "getFloat32": true}}, "WorkerContext": {"constructors": {}, "properties": {"onerror": true, "self": true, "location": true, "webkitURL": true, "webkitNotifications": true, "navigator": true}, "constants": {}, "methods": {"removeEventListener": true, "setInterval": true, "importScripts": true, "addEventListener": true, "clearTimeout": true, "clearInterval": true, "dispatchEvent": true, "close": true, "setTimeout": true}}, "MutationEvent": {"constructors": {}, "properties": {"ADDITION": true, "REMOVAL": true, "attrName": true, "relatedNode": true, "attrChange": true, "MODIFICATION": true, "newValue": true, "prevValue": true}, "constants": {}, "methods": {"initMutationEvent": true}}, "SVGTextContentElement": {"constructors": {}, "properties": {"LENGTHADJUST_SPACINGANDGLYPHS": true, "LENGTHADJUST_SPACING": true, "lengthAdjust": true, "LENGTHADJUST_UNKNOWN": true, "textLength": true}, "constants": {}, "methods": {"getRotationOfChar": true, "getStartPositionOfChar": true, "selectSubString": true, "getExtentOfChar": true, "getEndPositionOfChar": true, "getCharNumAtPosition": true, "getSubStringLength": true, "getComputedTextLength": true, "getNumberOfChars": true}}, "Attr": {"constructors": {}, "properties": {"isId": true, "specified": true, "name": true, "value": true, "ownerElement": true}, "constants": {}, "methods": {}}, "OfflineAudioCompletionEvent": {"constructors": {}, "properties": {"renderedBuffer": true}, "constants": {}, "methods": {}}, "ImageData": {"constructors": {}, "properties": {"width": true, "data": true, "height": true}, "constants": {}, "methods": {}}, "TreeWalker": {"constructors": {}, "properties": {"filter": true, "root": true, "currentNode": true, "expandEntityReferences": true, "whatToShow": true}, "constants": {}, "methods": {"previousNode": true, "nextNode": true, "nextSibling": true, "parentNode": true, "firstChild": true, "lastChild": true, "previousSibling": true}}, "SVGFEImageElement": {"constructors": {}, "properties": {"preserveAspectRatio": true}, "constants": {}, "methods": {}}, "NodeSelector": {"constructors": {}, "properties": {}, "constants": {}, "methods": {"querySelectorAll": true, "querySelector": true}}, "EventTarget": {"constructors": {}, "properties": {}, "constants": {}, "methods": {"removeEventListener": true, "dispatchEvent": true, "addEventListener": true}}, "WebGLRenderbuffer": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "WebKitAnimationEvent": {"constructors": {}, "properties": {"elapsedTime": true, "animationName": true}, "constants": {}, "methods": {"initWebKitAnimationEvent": true}}, "AudioContext": {"constructors": {}, "properties": {"listener": true, "oncomplete": true, "sampleRate": true, "destination": true, "currentTime": true}, "constants": {}, "methods": {"createPanner": true, "createChannelSplitter": true, "createJavaScriptNode": true, "createHighPass2Filter": true, "createWaveShaper": true, "createDynamicsCompressor": true, "createGainNode": true, "createBufferSource": true, "decodeAudioData": true, "createDelayNode": true, "createBuffer": true, "createLowPass2Filter": true, "createAnalyser": true, "startRendering": true, "createChannelMerger": true, "createConvolver": true, "createBiquadFilter": true}}, "WebGLProgram": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "Geolocation": {"constructors": {}, "properties": {}, "constants": {}, "methods": {"getCurrentPosition": true, "clearWatch": true, "watchPosition": true}}, "HTMLQuoteElement": {"constructors": {}, "properties": {"cite": true}, "constants": {}, "methods": {}}, "SVGAnimatedLengthList": {"constructors": {}, "properties": {"animVal": true, "baseVal": true}, "constants": {}, "methods": {}}, "JavaScriptAudioNode": {"constructors": {}, "properties": {"onaudioprocess": true, "bufferSize": true}, "constants": {}, "methods": {}}, "OESStandardDerivatives": {"constructors": {}, "properties": {"FRAGMENT_SHADER_DERIVATIVE_HINT_OES": true}, "constants": {}, "methods": {}}, "File": {"constructors": {}, "properties": {"lastModifiedDate": true, "fileSize": true, "name": true, "fileName": true}, "constants": {}, "methods": {}}, "Navigator": {"constructors": {}, "properties": {"mimeTypes": true, "productSub": true, "vendor": true, "language": true, "appName": true, "appCodeName": true, "plugins": true, "cookieEnabled": true, "appVersion": true, "product": true, "platform": true, "vendorSub": true, "onLine": true, "userAgent": true}, "constants": {}, "methods": {"javaEnabled": true, "getStorageUpdates": true}}, "SVGFEFuncGElement": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "SVGFESpecularLightingElement": {"constructors": {}, "properties": {"specularConstant": true, "in1": true, "specularExponent": true, "surfaceScale": true}, "constants": {}, "methods": {}}, "XMLHttpRequestUpload": {"constructors": {}, "properties": {"onabort": true, "onerror": true, "onprogress": true, "onloadstart": true, "onload": true}, "constants": {}, "methods": {"removeEventListener": true, "dispatchEvent": true, "addEventListener": true}}, "SVGMatrix": {"constructors": {}, "properties": {"a": true, "c": true, "b": true, "e": true, "d": true, "f": true}, "constants": {}, "methods": {"inverse": true, "skewY": true, "flipX": true, "flipY": true, "rotateFromVector": true, "rotate": true, "scale": true, "scaleNonUniform": true, "skewX": true, "multiply": true, "translate": true}}, "XPathEvaluator": {"constructors": {}, "properties": {}, "constants": {}, "methods": {"evaluate": true, "createExpression": true, "createNSResolver": true}}, "NodeList": {"constructors": {}, "properties": {"length": true}, "constants": {}, "methods": {"item": true}}, "Uint32Array": {"constructors": {}, "properties": {"length": true, "BYTES_PER_ELEMENT": true}, "constants": {}, "methods": {"subarray": true}}, "DatabaseCallback": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "SVGFEFuncAElement": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "WebGLContextAttributes": {"constructors": {}, "properties": {"stencil": true, "preserveDrawingBuffer": true, "antialias": true, "depth": true, "premultipliedAlpha": true, "alpha": true}, "constants": {}, "methods": {}}, "FileSystemCallback": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "HTMLLinkElement": {"constructors": {}, "properties": {"sheet": true, "target": true, "sizes": true, "media": true, "charset": true, "rev": true, "hreflang": true, "disabled": true, "href": true, "rel": true, "type": true}, "constants": {}, "methods": {}}, "SQLStatementCallback": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "HTMLTextAreaElement": {"constructors": {}, "properties": {"labels": true, "cols": true, "disabled": true, "selectionStart": true, "selectionEnd": true, "wrap": true, "rows": true, "accessKey": true, "autofocus": true, "type": true, "validationMessage": true, "form": true, "validity": true, "willValidate": true, "selectionDirection": true, "maxLength": true, "placeholder": true, "name": true, "textLength": true, "required": true, "readOnly": true, "value": true, "defaultValue": true}, "constants": {}, "methods": {"setSelectionRange": true, "setCustomValidity": true, "checkValidity": true, "select": true}}, "HTMLBaseFontElement": {"constructors": {}, "properties": {"color": true, "size": true, "face": true}, "constants": {}, "methods": {}}, "HTMLDetailsElement": {"constructors": {}, "properties": {"open": true}, "constants": {}, "methods": {}}, "SVGPathSegLinetoVerticalAbs": {"constructors": {}, "properties": {"y": true}, "constants": {}, "methods": {}}, "EventSource": {"constructors": {}, "properties": {"onopen": true, "readyState": true, "URL": true, "onerror": true, "CONNECTING": true, "CLOSED": true, "onmessage": true, "OPEN": true}, "constants": {}, "methods": {"close": true, "removeEventListener": true, "dispatchEvent": true, "addEventListener": true}}, "SVGPathSegCurvetoCubicAbs": {"constructors": {}, "properties": {"y2": true, "y1": true, "y": true, "x2": true, "x": true, "x1": true}, "constants": {}, "methods": {}}, "SVGPathSegMovetoAbs": {"constructors": {}, "properties": {"y": true, "x": true}, "constants": {}, "methods": {}}, "HTMLMetaElement": {"constructors": {}, "properties": {"content": true, "scheme": true, "httpEquiv": true, "name": true}, "constants": {}, "methods": {}}, "StorageInfoErrorCallback": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "SVGLocatable": {"constructors": {}, "properties": {"farthestViewportElement": true, "nearestViewportElement": true}, "constants": {}, "methods": {"getCTM": true, "getBBox": true, "getTransformToElement": true, "getScreenCTM": true}}, "HTMLLegendElement": {"constructors": {}, "properties": {"accessKey": true, "align": true, "form": true}, "constants": {}, "methods": {}}, "DOMTokenList": {"constructors": {}, "properties": {"length": true}, "constants": {}, "methods": {"contains": true, "toggle": true, "remove": true, "item": true, "add": true, "toString": true}}, "DOMFileSystem": {"constructors": {}, "properties": {"root": true, "name": true}, "constants": {}, "methods": {}}, "SVGPathSegLinetoVerticalRel": {"constructors": {}, "properties": {"y": true}, "constants": {}, "methods": {}}, "SVGFEColorMatrixElement": {"constructors": {}, "properties": {"SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA": true, "SVG_FECOLORMATRIX_TYPE_SATURATE": true, "SVG_FECOLORMATRIX_TYPE_MATRIX": true, "SVG_FECOLORMATRIX_TYPE_HUEROTATE": true, "in1": true, "values": true, "type": true, "SVG_FECOLORMATRIX_TYPE_UNKNOWN": true}, "constants": {}, "methods": {}}, "SVGFontFaceFormatElement": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "HTMLMenuElement": {"constructors": {}, "properties": {"compact": true}, "constants": {}, "methods": {}}, "MessageEvent": {"constructors": {}, "properties": {"origin": true, "lastEventId": true, "data": true, "ports": true, "source": true}, "constants": {}, "methods": {"initMessageEvent": true, "webkitInitMessageEvent": true}}, "SQLTransactionErrorCallback": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "SVGCircleElement": {"constructors": {}, "properties": {"cy": true, "cx": true, "r": true}, "constants": {}, "methods": {}}, "NodeFilter": {"constructors": {}, "properties": {"SHOW_ENTITY": true, "FILTER_REJECT": true, "SHOW_ELEMENT": true, "SHOW_ALL": true, "FILTER_ACCEPT": true, "SHOW_DOCUMENT_FRAGMENT": true, "SHOW_PROCESSING_INSTRUCTION": true, "SHOW_DOCUMENT": true, "SHOW_COMMENT": true, "SHOW_CDATA_SECTION": true, "FILTER_SKIP": true, "SHOW_NOTATION": true, "SHOW_ATTRIBUTE": true, "SHOW_DOCUMENT_TYPE": true, "SHOW_ENTITY_REFERENCE": true, "SHOW_TEXT": true}, "constants": {}, "methods": {"acceptNode": true}}, "SVGSymbolElement": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "SVGPathSegCurvetoQuadraticAbs": {"constructors": {}, "properties": {"y": true, "x": true, "x1": true, "y1": true}, "constants": {}, "methods": {}}, "FileWriterCallback": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "TextEvent": {"constructors": {}, "properties": {"data": true}, "constants": {}, "methods": {"initTextEvent": true}}, "ClientRect": {"constructors": {}, "properties": {"right": true, "bottom": true, "top": true, "height": true, "width": true, "left": true}, "constants": {}, "methods": {}}, "HTMLTitleElement": {"constructors": {}, "properties": {"text": true}, "constants": {}, "methods": {}}, "SVGFEMergeNodeElement": {"constructors": {}, "properties": {"in1": true}, "constants": {}, "methods": {}}, "HTMLTableElement": {"constructors": {}, "properties": {"rows": true, "caption": true, "rules": true, "cellSpacing": true, "align": true, "width": true, "summary": true, "bgColor": true, "tBodies": true, "tFoot": true, "cellPadding": true, "border": true, "frame": true, "tHead": true}, "constants": {}, "methods": {"deleteTFoot": true, "deleteTHead": true, "createTFoot": true, "createCaption": true, "insertRow": true, "deleteRow": true, "deleteCaption": true, "createTHead": true}}, "Event": {"constructors": {}, "properties": {"CAPTURING_PHASE": true, "KEYUP": true, "FOCUS": true, "cancelable": true, "returnValue": true, "MOUSEOVER": true, "SELECT": true, "defaultPrevented": true, "KEYPRESS": true, "BUBBLING_PHASE": true, "KEYDOWN": true, "CHANGE": true, "MOUSEOUT": true, "type": true, "CLICK": true, "currentTarget": true, "srcElement": true, "clipboardData": true, "cancelBubble": true, "bubbles": true, "AT_TARGET": true, "timeStamp": true, "target": true, "MOUSEDRAG": true, "MOUSEUP": true, "MOUSEMOVE": true, "MOUSEDOWN": true, "DRAGDROP": true, "BLUR": true, "DBLCLICK": true, "eventPhase": true}, "constants": {}, "methods": {"initEvent": true, "stopImmediatePropagation": true, "stopPropagation": true, "preventDefault": true}}, "FileEntrySync": {"constructors": {}, "properties": {}, "constants": {}, "methods": {"createWriter": true, "file": true}}, "SVGStyleElement": {"constructors": {}, "properties": {"media": true, "type": true, "title": true}, "constants": {}, "methods": {}}, "SVGPolygonElement": {"constructors": {}, "properties": {"animatedPoints": true, "points": true}, "constants": {}, "methods": {}}, "CSSFontFaceRule": {"constructors": {}, "properties": {"style": true}, "constants": {}, "methods": {}}, "SQLTransactionSync": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "HTMLObjectElement": {"constructors": {}, "properties": {"willValidate": true, "code": true, "type": true, "name": true, "form": true, "standby": true, "data": true, "align": true, "useMap": true, "vspace": true, "validity": true, "declare": true, "codeBase": true, "width": true, "hspace": true, "contentDocument": true, "codeType": true, "height": true, "border": true, "archive": true, "validationMessage": true}, "constants": {}, "methods": {"setCustomValidity": true, "checkValidity": true}}, "CustomEvent": {"constructors": {}, "properties": {"detail": true}, "constants": {}, "methods": {"initCustomEvent": true}}, "DOMPluginArray": {"constructors": {}, "properties": {"length": true}, "constants": {}, "methods": {"item": true, "namedItem": true, "refresh": true}}, "HTMLMeterElement": {"constructors": {}, "properties": {"form": true, "min": true, "max": true, "labels": true, "value": true, "high": true, "low": true, "optimum": true}, "constants": {}, "methods": {}}, "SVGFEPointLightElement": {"constructors": {}, "properties": {"y": true, "x": true, "z": true}, "constants": {}, "methods": {}}, "WebGLUniformLocation": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "HTMLBodyElement": {"constructors": {}, "properties": {"onload": true, "onblur": true, "onhashchange": true, "onoffline": true, "onbeforeunload": true, "aLink": true, "text": true, "ononline": true, "onunload": true, "onresize": true, "bgColor": true, "onerror": true, "link": true, "background": true, "onpopstate": true, "onmessage": true, "onfocus": true, "vLink": true, "onorientationchange": true, "onstorage": true}, "constants": {}, "methods": {}}, "HTMLLabelElement": {"constructors": {}, "properties": {"control": true, "accessKey": true, "form": true, "htmlFor": true}, "constants": {}, "methods": {}}, "EntryCallback": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "CSSCharsetRule": {"constructors": {}, "properties": {"encoding": true}, "constants": {}, "methods": {}}, "WebGLRenderingContext": {"constructors": {}, "properties": {"RENDERBUFFER_INTERNAL_FORMAT": true, "LINE_WIDTH": true, "CONSTANT_ALPHA": true, "BLEND_SRC_ALPHA": true, "LESS": true, "DST_COLOR": true, "INCR_WRAP": true, "CCW": true, "STENCIL_BACK_PASS_DEPTH_FAIL": true, "BACK": true, "UNSIGNED_BYTE": true, "STENCIL_REF": true, "ACTIVE_ATTRIBUTES": true, "TEXTURE_CUBE_MAP_POSITIVE_X": true, "STENCIL_BACK_VALUE_MASK": true, "TEXTURE_CUBE_MAP_POSITIVE_Z": true, "NUM_COMPRESSED_TEXTURE_FORMATS": true, "TEXTURE12": true, "TEXTURE_MIN_FILTER": true, "LINK_STATUS": true, "BLEND": true, "TEXTURE16": true, "SHADER_COMPILER": true, "KEEP": true, "FUNC_REVERSE_SUBTRACT": true, "VERTEX_ATTRIB_ARRAY_ENABLED": true, "FRONT_AND_BACK": true, "FRONT": true, "DST_ALPHA": true, "DEPTH_STENCIL": true, "STENCIL_BACK_FUNC": true, "INVALID_FRAMEBUFFER_OPERATION": true, "BLEND_EQUATION": true, "UNPACK_FLIP_Y_WEBGL": true, "RENDERBUFFER_DEPTH_SIZE": true, "STENCIL_BACK_WRITEMASK": true, "NEAREST_MIPMAP_LINEAR": true, "TEXTURE_CUBE_MAP_POSITIVE_Y": true, "NEAREST": true, "RENDERBUFFER_WIDTH": true, "ARRAY_BUFFER_BINDING": true, "ARRAY_BUFFER": true, "FRAMEBUFFER_INCOMPLETE_DIMENSIONS": true, "LEQUAL": true, "VERSION": true, "COLOR_CLEAR_VALUE": true, "RENDERER": true, "GREEN_BITS": true, "MAX_TEXTURE_IMAGE_UNITS": true, "LOW_FLOAT": true, "MIRRORED_REPEAT": true, "TEXTURE18": true, "VIEWPORT": true, "FRAGMENT_SHADER": true, "LUMINANCE": true, "DECR_WRAP": true, "STENCIL_BACK_PASS_DEPTH_PASS": true, "ONE_MINUS_DST_ALPHA": true, "MEDIUM_INT": true, "MEDIUM_FLOAT": true, "OUT_OF_MEMORY": true, "POLYGON_OFFSET_FACTOR": true, "FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL": true, "TEXTURE_2D": true, "DITHER": true, "TEXTURE31": true, "TEXTURE30": true, "DEPTH_COMPONENT16": true, "TEXTURE13": true, "TEXTURE23": true, "DEPTH_TEST": true, "ONE_MINUS_DST_COLOR": true, "drawingBufferHeight": true, "STREAM_DRAW": true, "POLYGON_OFFSET_UNITS": true, "RGB": true, "SCISSOR_BOX": true, "NOTEQUAL": true, "MAX_VARYING_VECTORS": true, "DONT_CARE": true, "FRONT_FACE": true, "FRAMEBUFFER_ATTACHMENT_OBJECT_NAME": true, "INT_VEC2": true, "UNSIGNED_SHORT_4_4_4_4": true, "NONE": true, "BLEND_DST_ALPHA": true, "VERTEX_ATTRIB_ARRAY_SIZE": true, "SRC_COLOR": true, "COMPRESSED_TEXTURE_FORMATS": true, "MAX_VERTEX_ATTRIBS": true, "UNSIGNED_SHORT_5_5_5_1": true, "LOW_INT": true, "BLEND_EQUATION_RGB": true, "TEXTURE": true, "LINEAR_MIPMAP_LINEAR": true, "VERTEX_ATTRIB_ARRAY_BUFFER_BINDING": true, "CURRENT_PROGRAM": true, "COLOR_BUFFER_BIT": true, "STENCIL_BUFFER_BIT": true, "NICEST": true, "NO_ERROR": true, "FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE": true, "TEXTURE22": true, "ELEMENT_ARRAY_BUFFER_BINDING": true, "STENCIL_PASS_DEPTH_FAIL": true, "REPEAT": true, "TEXTURE26": true, "TEXTURE27": true, "TEXTURE24": true, "TEXTURE25": true, "STENCIL_INDEX": true, "TRIANGLE_FAN": true, "FLOAT_MAT3": true, "FLOAT_MAT2": true, "FLOAT_MAT4": true, "VERTEX_ATTRIB_ARRAY_NORMALIZED": true, "SAMPLE_COVERAGE_INVERT": true, "STATIC_DRAW": true, "FLOAT_VEC3": true, "FLOAT_VEC2": true, "STENCIL_ATTACHMENT": true, "ACTIVE_UNIFORMS": true, "INVALID_OPERATION": true, "DEPTH_ATTACHMENT": true, "MAX_COMBINED_TEXTURE_IMAGE_UNITS": true, "FRAMEBUFFER_COMPLETE": true, "BOOL_VEC4": true, "TEXTURE2": true, "TEXTURE1": true, "GEQUAL": true, "ACTIVE_TEXTURE": true, "TEXTURE6": true, "BOOL_VEC2": true, "BOOL_VEC3": true, "GENERATE_MIPMAP_HINT": true, "CULL_FACE": true, "TEXTURE9": true, "TEXTURE8": true, "COLOR_WRITEMASK": true, "DEPTH_COMPONENT": true, "VERTEX_ATTRIB_ARRAY_TYPE": true, "STENCIL_CLEAR_VALUE": true, "TEXTURE_BINDING_CUBE_MAP": true, "ONE_MINUS_SRC_ALPHA": true, "VERTEX_SHADER": true, "SUBPIXEL_BITS": true, "STENCIL_WRITEMASK": true, "ATTACHED_SHADERS": true, "FLOAT_VEC4": true, "TEXTURE17": true, "ONE_MINUS_CONSTANT_ALPHA": true, "TEXTURE15": true, "TEXTURE14": true, "SHORT": true, "SAMPLES": true, "TEXTURE11": true, "TEXTURE10": true, "FUNC_SUBTRACT": true, "RENDERBUFFER_STENCIL_SIZE": true, "PACK_ALIGNMENT": true, "UNSIGNED_INT": true, "TEXTURE19": true, "STENCIL_FUNC": true, "NEAREST_MIPMAP_NEAREST": true, "RENDERBUFFER_HEIGHT": true, "RENDERBUFFER_BINDING": true, "HIGH_INT": true, "GREATER": true, "RED_BITS": true, "BUFFER_SIZE": true, "BLEND_COLOR": true, "INT_VEC3": true, "INT_VEC4": true, "MAX_CUBE_MAP_TEXTURE_SIZE": true, "RENDERBUFFER_BLUE_SIZE": true, "drawingBufferWidth": true, "SAMPLE_COVERAGE": true, "TEXTURE21": true, "SRC_ALPHA": true, "STENCIL_TEST": true, "DEPTH_WRITEMASK": true, "FRAMEBUFFER_INCOMPLETE_ATTACHMENT": true, "POLYGON_OFFSET_FILL": true, "FUNC_ADD": true, "REPLACE": true, "LUMINANCE_ALPHA": true, "DEPTH_RANGE": true, "FASTEST": true, "STENCIL_FAIL": true, "MAX_RENDERBUFFER_SIZE": true, "STENCIL_BACK_FAIL": true, "BLEND_SRC_RGB": true, "ONE_MINUS_CONSTANT_COLOR": true, "RENDERBUFFER": true, "RGB5_A1": true, "RENDERBUFFER_ALPHA_SIZE": true, "UNPACK_COLORSPACE_CONVERSION_WEBGL": true, "MAX_FRAGMENT_UNIFORM_VECTORS": true, "BLEND_DST_RGB": true, "BROWSER_DEFAULT_WEBGL": true, "DEPTH_STENCIL_ATTACHMENT": true, "UNSIGNED_SHORT": true, "ZERO": true, "TEXTURE0": true, "LINE_LOOP": true, "BUFFER_USAGE": true, "TEXTURE7": true, "BYTE": true, "CW": true, "DYNAMIC_DRAW": true, "RENDERBUFFER_RED_SIZE": true, "FRAMEBUFFER_UNSUPPORTED": true, "RGBA4": true, "TEXTURE20": true, "VALIDATE_STATUS": true, "STENCIL_BITS": true, "TEXTURE_BINDING_2D": true, "TEXTURE4": true, "INT": true, "DEPTH_FUNC": true, "SAMPLER_2D": true, "BOOL": true, "MAX_VIEWPORT_DIMS": true, "ONE_MINUS_SRC_COLOR": true, "UNPACK_ALIGNMENT": true, "ALIASED_POINT_SIZE_RANGE": true, "INVALID_ENUM": true, "MAX_TEXTURE_SIZE": true, "SHADER_TYPE": true, "CULL_FACE_MODE": true, "TEXTURE5": true, "VERTEX_ATTRIB_ARRAY_POINTER": true, "TEXTURE_WRAP_S": true, "VERTEX_ATTRIB_ARRAY_STRIDE": true, "LINES": true, "EQUAL": true, "BLUE_BITS": true, "TEXTURE_WRAP_T": true, "DEPTH_BUFFER_BIT": true, "MAX_VERTEX_TEXTURE_IMAGE_UNITS": true, "ONE": true, "UNSIGNED_SHORT_5_6_5": true, "TEXTURE_CUBE_MAP_NEGATIVE_X": true, "TEXTURE_CUBE_MAP_NEGATIVE_Y": true, "TEXTURE_CUBE_MAP_NEGATIVE_Z": true, "DECR": true, "DELETE_STATUS": true, "DEPTH_BITS": true, "INCR": true, "SAMPLE_COVERAGE_VALUE": true, "ALPHA_BITS": true, "SAMPLE_ALPHA_TO_COVERAGE": true, "LINE_STRIP": true, "TEXTURE28": true, "INVALID_VALUE": true, "NEVER": true, "FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE": true, "BLEND_EQUATION_ALPHA": true, "TEXTURE_MAG_FILTER": true, "POINTS": true, "COLOR_ATTACHMENT0": true, "MAX_VERTEX_UNIFORM_VECTORS": true, "RGBA": true, "SRC_ALPHA_SATURATE": true, "STENCIL_INDEX8": true, "FRAMEBUFFER": true, "RGB565": true, "TEXTURE_CUBE_MAP": true, "SAMPLE_BUFFERS": true, "LINEAR": true, "TEXTURE29": true, "LINEAR_MIPMAP_NEAREST": true, "STENCIL_BACK_REF": true, "ELEMENT_ARRAY_BUFFER": true, "TRIANGLE_STRIP": true, "CONSTANT_COLOR": true, "COMPILE_STATUS": true, "RENDERBUFFER_GREEN_SIZE": true, "ALPHA": true, "TEXTURE3": true, "DEPTH_CLEAR_VALUE": true, "ALIASED_LINE_WIDTH_RANGE": true, "SHADING_LANGUAGE_VERSION": true, "STENCIL_PASS_DEPTH_PASS": true, "STENCIL_VALUE_MASK": true, "ALWAYS": true, "INVERT": true, "FLOAT": true, "FRAMEBUFFER_BINDING": true, "FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT": true, "UNPACK_PREMULTIPLY_ALPHA_WEBGL": true, "VENDOR": true, "HIGH_FLOAT": true, "SAMPLER_CUBE": true, "TRIANGLES": true, "CLAMP_TO_EDGE": true, "CURRENT_VERTEX_ATTRIB": true, "SCISSOR_TEST": true, "CONTEXT_LOST_WEBGL": true}, "constants": {}, "methods": {"activeTexture": true, "uniform4i": true, "isProgram": true, "stencilMaskSeparate": true, "checkFramebufferStatus": true, "uniform4f": true, "pixelStorei": true, "getProgramParameter": true, "uniformMatrix3fv": true, "hint": true, "isEnabled": true, "vertexAttrib1fv": true, "validateProgram": true, "attachShader": true, "getExtension": true, "createFramebuffer": true, "frontFace": true, "deleteFramebuffer": true, "uniform3i": true, "disable": true, "depthFunc": true, "isRenderbuffer": true, "finish": true, "uniform1iv": true, "copyTexImage2D": true, "clearDepth": true, "getShaderParameter": true, "disableVertexAttribArray": true, "getContextAttributes": true, "bufferData": true, "compileShader": true, "getTexParameter": true, "isTexture": true, "blendColor": true, "vertexAttrib3fv": true, "readPixels": true, "deleteTexture": true, "enableVertexAttribArray": true, "flush": true, "getBufferParameter": true, "createProgram": true, "uniform4iv": true, "uniform3iv": true, "drawArrays": true, "getParameter": true, "linkProgram": true, "framebufferTexture2D": true, "isBuffer": true, "createTexture": true, "vertexAttrib4f": true, "texImage2D": true, "createShader": true, "isContextLost": true, "bindRenderbuffer": true, "uniform2iv": true, "deleteShader": true, "getShaderInfoLog": true, "renderbufferStorage": true, "uniform4fv": true, "lineWidth": true, "copyTexSubImage2D": true, "texSubImage2D": true, "getActiveAttrib": true, "uniformMatrix2fv": true, "releaseShaderCompiler": true, "getProgramInfoLog": true, "blendFuncSeparate": true, "stencilFuncSeparate": true, "stencilOpSeparate": true, "vertexAttrib4fv": true, "blendEquation": true, "stencilFunc": true, "getError": true, "colorMask": true, "getActiveUniform": true, "vertexAttrib3f": true, "polygonOffset": true, "createRenderbuffer": true, "bufferSubData": true, "stencilMask": true, "enable": true, "depthMask": true, "isShader": true, "bindFramebuffer": true, "stencilOp": true, "uniform2fv": true, "createBuffer": true, "uniform2i": true, "getAttachedShaders": true, "useProgram": true, "viewport": true, "bindBuffer": true, "vertexAttribPointer": true, "getAttribLocation": true, "getVertexAttrib": true, "uniformMatrix4fv": true, "vertexAttrib2f": true, "cullFace": true, "deleteRenderbuffer": true, "vertexAttrib2fv": true, "clearStencil": true, "vertexAttrib1f": true, "getRenderbufferParameter": true, "getFramebufferAttachmentParameter": true, "deleteBuffer": true, "uniform1fv": true, "uniform1f": true, "getShaderSource": true, "getUniform": true, "clearColor": true, "depthRange": true, "uniform2f": true, "deleteProgram": true, "blendEquationSeparate": true, "detachShader": true, "uniform3fv": true, "sampleCoverage": true, "blendFunc": true, "generateMipmap": true, "drawElements": true, "texParameteri": true, "getUniformLocation": true, "uniform3f": true, "shaderSource": true, "bindAttribLocation": true, "clear": true, "getVertexAttribOffset": true, "scissor": true, "isFramebuffer": true, "texParameterf": true, "framebufferRenderbuffer": true, "bindTexture": true, "uniform1i": true}}, "MediaQueryListListener": {"constructors": {}, "properties": {}, "constants": {}, "methods": {"queryChanged": true}}, "Float32Array": {"constructors": {}, "properties": {"length": true, "BYTES_PER_ELEMENT": true}, "constants": {}, "methods": {"subarray": true}}, "AudioChannelSplitter": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "SVGPathSegLinetoRel": {"constructors": {}, "properties": {"y": true, "x": true}, "constants": {}, "methods": {}}, "HTMLTableColElement": {"constructors": {}, "properties": {"ch": true, "span": true, "chOff": true, "align": true, "width": true, "vAlign": true}, "constants": {}, "methods": {}}, "XMLHttpRequestProgressEvent": {"constructors": {}, "properties": {"totalSize": true, "position": true}, "constants": {}, "methods": {}}, "SVGScriptElement": {"constructors": {}, "properties": {"type": true}, "constants": {}, "methods": {}}, "AudioGain": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "IDBTransaction": {"constructors": {}, "properties": {"READ_ONLY": true, "onabort": true, "READ_WRITE": true, "oncomplete": true, "db": true, "onerror": true, "mode": true, "VERSION_CHANGE": true}, "constants": {}, "methods": {"dispatchEvent": true, "removeEventListener": true, "abort": true, "objectStore": true, "addEventListener": true}}, "HTMLModElement": {"constructors": {}, "properties": {"cite": true, "dateTime": true}, "constants": {}, "methods": {}}, "NavigatorUserMediaSuccessCallback": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "DatabaseSync": {"constructors": {}, "properties": {"version": true}, "constants": {}, "methods": {"changeVersion": true, "readTransaction": true, "transaction": true}}, "SVGPaint": {"constructors": {}, "properties": {"SVG_PAINTTYPE_RGBCOLOR_ICCCOLOR": true, "SVG_PAINTTYPE_NONE": true, "SVG_PAINTTYPE_URI_NONE": true, "SVG_PAINTTYPE_URI_RGBCOLOR": true, "SVG_PAINTTYPE_URI_CURRENTCOLOR": true, "uri": true, "SVG_PAINTTYPE_CURRENTCOLOR": true, "SVG_PAINTTYPE_URI": true, "SVG_PAINTTYPE_RGBCOLOR": true, "SVG_PAINTTYPE_URI_RGBCOLOR_ICCCOLOR": true, "SVG_PAINTTYPE_UNKNOWN": true, "paintType": true}, "constants": {}, "methods": {"setUri": true, "setPaint": true}}, "SVGTextPathElement": {"constructors": {}, "properties": {"TEXTPATH_METHODTYPE_UNKNOWN": true, "TEXTPATH_SPACINGTYPE_UNKNOWN": true, "TEXTPATH_SPACINGTYPE_AUTO": true, "spacing": true, "TEXTPATH_METHODTYPE_STRETCH": true, "startOffset": true, "TEXTPATH_METHODTYPE_ALIGN": true, "TEXTPATH_SPACINGTYPE_EXACT": true, "method": true}, "constants": {}, "methods": {}}, "WebKitLoseContext": {"constructors": {}, "properties": {}, "constants": {}, "methods": {"restoreContext": true, "loseContext": true}}, "ArrayBuffer": {"constructors": {}, "properties": {"byteLength": true}, "constants": {}, "methods": {"slice": true}}, "SVGPathSegArcRel": {"constructors": {}, "properties": {"angle": true, "largeArcFlag": true, "r2": true, "sweepFlag": true, "y": true, "x": true, "r1": true}, "constants": {}, "methods": {}}, "Touch": {"constructors": {}, "properties": {"clientX": true, "clientY": true, "identifier": true, "target": true, "webkitRotationAngle": true, "webkitForce": true, "pageX": true, "pageY": true, "screenY": true, "screenX": true, "webkitRadiusY": true, "webkitRadiusX": true}, "constants": {}, "methods": {}}, "IDBDatabase": {"constructors": {}, "properties": {"onabort": true, "onerror": true, "onversionchange": true, "version": true, "name": true}, "constants": {}, "methods": {"transaction": true, "createObjectStore": true, "removeEventListener": true, "addEventListener": true, "dispatchEvent": true, "close": true, "deleteObjectStore": true, "setVersion": true}}, "Notification": {"constructors": {}, "properties": {"onerror": true, "onclose": true, "ondisplay": true, "dir": true, "onclick": true, "replaceId": true}, "constants": {}, "methods": {"cancel": true, "removeEventListener": true, "dispatchEvent": true, "show": true, "addEventListener": true}}, "IDBKey": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "SVGColor": {"constructors": {}, "properties": {"SVG_COLORTYPE_RGBCOLOR": true, "rgbColor": true, "SVG_COLORTYPE_UNKNOWN": true, "colorType": true, "SVG_COLORTYPE_RGBCOLOR_ICCCOLOR": true, "SVG_COLORTYPE_CURRENTCOLOR": true}, "constants": {}, "methods": {"setRGBColorICCColor": true, "setColor": true, "setRGBColor": true}}, "XPathExpression": {"constructors": {}, "properties": {}, "constants": {}, "methods": {"evaluate": true}}, "ProgressEvent": {"constructors": {}, "properties": {"loaded": true, "lengthComputable": true, "total": true}, "constants": {}, "methods": {"initProgressEvent": true}}, "IDBKeyRange": {"constructors": {}, "properties": {"upper": true, "lower": true, "lowerOpen": true, "upperOpen": true}, "constants": {}, "methods": {"only": true, "lowerBound": true, "bound": true, "upperBound": true}}, "Int16Array": {"constructors": {}, "properties": {"length": true, "BYTES_PER_ELEMENT": true}, "constants": {}, "methods": {"subarray": true}}, "Screen": {"constructors": {}, "properties": {"availLeft": true, "pixelDepth": true, "width": true, "availHeight": true, "height": true, "availWidth": true, "availTop": true, "colorDepth": true}, "constants": {}, "methods": {}}, "Uint8Array": {"constructors": {}, "properties": {"length": true, "BYTES_PER_ELEMENT": true}, "constants": {}, "methods": {"subarray": true}}, "MediaList": {"constructors": {}, "properties": {"mediaText": true, "length": true}, "constants": {}, "methods": {"deleteMedium": true, "appendMedium": true, "item": true}}, "XPathNSResolver": {"constructors": {}, "properties": {}, "constants": {}, "methods": {"lookupNamespaceURI": true}}, "PositionCallback": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "HTMLOptGroupElement": {"constructors": {}, "properties": {"disabled": true, "label": true}, "constants": {}, "methods": {}}, "Database": {"constructors": {}, "properties": {"version": true}, "constants": {}, "methods": {"changeVersion": true, "readTransaction": true, "transaction": true}}, "SVGTransformList": {"constructors": {}, "properties": {"numberOfItems": true}, "constants": {}, "methods": {"consolidate": true, "replaceItem": true, "appendItem": true, "clear": true, "getItem": true, "removeItem": true, "initialize": true, "insertItemBefore": true, "createSVGTransformFromMatrix": true}}, "FileError": {"constructors": {}, "properties": {"SYNTAX_ERR": true, "SECURITY_ERR": true, "NOT_FOUND_ERR": true, "NOT_READABLE_ERR": true, "INVALID_STATE_ERR": true, "code": true, "INVALID_MODIFICATION_ERR": true, "NO_MODIFICATION_ALLOWED_ERR": true, "ABORT_ERR": true, "QUOTA_EXCEEDED_ERR": true, "PATH_EXISTS_ERR": true, "TYPE_MISMATCH_ERR": true, "ENCODING_ERR": true}, "constants": {}, "methods": {}}, "DOMWindow": {"constructors": {}, "properties": {"defaultStatus": true, "onreset": true, "personalbar": true, "ondurationchange": true, "onmousewheel": true, "pageXOffset": true, "menubar": true, "onload": true, "oninput": true, "locationbar": true, "console": true, "outerWidth": true, "innerHeight": true, "opener": true, "onmousemove": true, "location": true, "onsubmit": true, "onkeypress": true, "ononline": true, "onstalled": true, "onsearch": true, "onseeking": true, "name": true, "oncanplaythrough": true, "crypto": true, "onkeyup": true, "clientInformation": true, "onwaiting": true, "screenTop": true, "onchange": true, "event": true, "ontimeupdate": true, "onwebkitanimationstart": true, "ondragleave": true, "innerWidth": true, "onresize": true, "onselect": true, "closed": true, "onemptied": true, "onfocus": true, "ondrag": true, "onoffline": true, "parent": true, "sessionStorage": true, "screen": true, "onkeydown": true, "webkitURL": true, "onwebkitanimationiteration": true, "applicationCache": true, "toolbar": true, "onprogress": true, "scrollX": true, "scrollY": true, "onbeforeunload": true, "length": true, "onmessage": true, "onseeked": true, "onloadeddata": true, "outerHeight": true, "onscroll": true, "frames": true, "navigator": true, "onsuspend": true, "oninvalid": true, "onabort": true, "ondevicemotion": true, "onratechange": true, "top": true, "window": true, "onwebkitanimationend": true, "localStorage": true, "onmouseup": true, "screenY": true, "screenX": true, "onstorage": true, "pageYOffset": true, "onblur": true, "onmouseout": true, "onvolumechange": true, "onpopstate": true, "oncontextmenu": true, "ontouchend": true, "onunload": true, "devicePixelRatio": true, "screenLeft": true, "statusbar": true, "onpagehide": true, "history": true, "onerror": true, "ondragenter": true, "styleMedia": true, "onmousedown": true, "onplay": true, "onpause": true, "scrollbars": true, "webkitNotifications": true, "onloadstart": true, "defaultstatus": true, "ondragover": true, "self": true, "onclick": true, "performance": true, "document": true, "oncanplay": true, "status": true, "onended": true, "onhashchange": true, "ondragstart": true, "onpageshow": true, "frameElement": true, "offscreenBuffering": true, "ondrop": true, "ondeviceorientation": true, "onwebkittransitionend": true, "onloadedmetadata": true, "ondragend": true, "ontouchcancel": true, "ontouchmove": true, "onplaying": true, "ondblclick": true, "ontouchstart": true, "onmouseover": true}, "constants": {}, "methods": {"moveTo": true, "getMatchedCSSRules": true, "scrollTo": true, "clearTimeout": true, "prompt": true, "focus": true, "releaseEvents": true, "close": true, "open": true, "find": true, "webkitConvertPointFromPageToNode": true, "setTimeout": true, "confirm": true, "getComputedStyle": true, "resizeBy": true, "moveBy": true, "addEventListener": true, "print": true, "webkitConvertPointFromNodeToPage": true, "removeEventListener": true, "setInterval": true, "getSelection": true, "blur": true, "stop": true, "clearInterval": true, "webkitRequestAnimationFrame": true, "atob": true, "alert": true, "postMessage": true, "showModalDialog": true, "scrollBy": true, "btoa": true, "matchMedia": true, "captureEvents": true, "resizeTo": true, "dispatchEvent": true, "webkitPostMessage": true, "webkitCancelRequestAnimationFrame": true, "scroll": true}}, "OverflowEvent": {"constructors": {}, "properties": {"BOTH": true, "VERTICAL": true, "horizontalOverflow": true, "HORIZONTAL": true, "orient": true, "verticalOverflow": true}, "constants": {}, "methods": {"initOverflowEvent": true}}, "SpeechInputResultList": {"constructors": {}, "properties": {"length": true}, "constants": {}, "methods": {"item": true}}, "CSSPageRule": {"constructors": {}, "properties": {"style": true, "selectorText": true}, "constants": {}, "methods": {}}, "History": {"constructors": {}, "properties": {"length": true}, "constants": {}, "methods": {"forward": true, "go": true, "pushState": true, "replaceState": true, "back": true}}, "SVGPoint": {"constructors": {}, "properties": {"y": true, "x": true}, "constants": {}, "methods": {"matrixTransform": true}}, "NodeIterator": {"constructors": {}, "properties": {"referenceNode": true, "filter": true, "whatToShow": true, "root": true, "expandEntityReferences": true, "pointerBeforeReferenceNode": true}, "constants": {}, "methods": {"previousNode": true, "detach": true, "nextNode": true}}, "SVGLangSpace": {"constructors": {}, "properties": {"xmlspace": true, "xmllang": true}, "constants": {}, "methods": {}}, "DynamicsCompressorNode": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "FileWriter": {"constructors": {}, "properties": {"onabort": true, "readyState": true, "onerror": true, "onwrite": true, "onprogress": true, "length": true, "WRITING": true, "onwritestart": true, "INIT": true, "DONE": true, "error": true, "position": true, "onwriteend": true}, "constants": {}, "methods": {"write": true, "abort": true, "seek": true, "truncate": true}}, "SVGAnimationElement": {"constructors": {}, "properties": {"targetElement": true}, "constants": {}, "methods": {"getStartTime": true, "getCurrentTime": true, "getSimpleDuration": true}}, "XMLHttpRequest": {"constructors": {}, "properties": {"onabort": true, "onload": true, "readyState": true, "LOADING": true, "responseText": true, "OPENED": true, "asBlob": true, "onerror": true, "responseType": true, "status": true, "onprogress": true, "upload": true, "responseXML": true, "UNSENT": true, "DONE": true, "statusText": true, "HEADERS_RECEIVED": true, "responseBlob": true, "onreadystatechange": true, "onloadstart": true, "withCredentials": true}, "constants": {}, "methods": {"removeEventListener": true, "getAllResponseHeaders": true, "overrideMimeType": true, "addEventListener": true, "setRequestHeader": true, "send": true, "getResponseHeader": true, "abort": true, "dispatchEvent": true, "open": true}}, "HTMLOListElement": {"constructors": {}, "properties": {"compact": true, "start": true, "type": true}, "constants": {}, "methods": {}}, "SVGComponentTransferFunctionElement": {"constructors": {}, "properties": {"slope": true, "exponent": true, "SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY": true, "type": true, "SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN": true, "SVG_FECOMPONENTTRANSFER_TYPE_TABLE": true, "intercept": true, "amplitude": true, "offset": true, "SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE": true, "SVG_FECOMPONENTTRANSFER_TYPE_LINEAR": true, "SVG_FECOMPONENTTRANSFER_TYPE_GAMMA": true, "tableValues": true}, "constants": {}, "methods": {}}, "HTMLPreElement": {"constructors": {}, "properties": {"wrap": true, "width": true}, "constants": {}, "methods": {}}, "CloseEvent": {"constructors": {}, "properties": {"reason": true, "code": true, "wasClean": true}, "constants": {}, "methods": {"initCloseEvent": true}}, "MemoryInfo": {"constructors": {}, "properties": {"totalJSHeapSize": true, "usedJSHeapSize": true, "jsHeapSizeLimit": true}, "constants": {}, "methods": {}}, "XMLSerializer": {"constructors": {}, "properties": {}, "constants": {}, "methods": {"serializeToString": true}}, "StyleMedia": {"constructors": {}, "properties": {"type": true}, "constants": {}, "methods": {"matchMedium": true}}, "SVGDefsElement": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "SVGRectElement": {"constructors": {}, "properties": {"rx": true, "ry": true, "height": true, "width": true, "y": true, "x": true}, "constants": {}, "methods": {}}, "StorageInfoUsageCallback": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "HTMLMapElement": {"constructors": {}, "properties": {"name": true, "areas": true}, "constants": {}, "methods": {}}, "MessageChannel": {"constructors": {}, "properties": {"port2": true, "port1": true}, "constants": {}, "methods": {}}, "SVGUseElement": {"constructors": {}, "properties": {"width": true, "height": true, "instanceRoot": true, "animatedInstanceRoot": true, "y": true, "x": true}, "constants": {}, "methods": {}}, "SVGImageElement": {"constructors": {}, "properties": {"y": true, "width": true, "preserveAspectRatio": true, "x": true, "height": true}, "constants": {}, "methods": {}}, "SVGElementInstance": {"constructors": {}, "properties": {"onmousedown": true, "onerror": true, "ondragenter": true, "onreset": true, "nextSibling": true, "ondragleave": true, "onscroll": true, "parentNode": true, "oncopy": true, "onmousewheel": true, "onbeforepaste": true, "childNodes": true, "onabort": true, "onload": true, "oninput": true, "onchange": true, "onmouseout": true, "ondragover": true, "onbeforecut": true, "onresize": true, "onselect": true, "onmousemove": true, "onclick": true, "onfocus": true, "ondrag": true, "previousSibling": true, "onpaste": true, "onblur": true, "onsubmit": true, "ondragstart": true, "onmouseup": true, "ondrop": true, "onkeypress": true, "onkeydown": true, "onmouseover": true, "onbeforecopy": true, "lastChild": true, "onsearch": true, "oncontextmenu": true, "onunload": true, "ondblclick": true, "ondragend": true, "firstChild": true, "oncut": true, "correspondingUseElement": true, "onkeyup": true, "correspondingElement": true, "onselectstart": true}, "constants": {}, "methods": {"removeEventListener": true, "dispatchEvent": true, "addEventListener": true}}, "SharedWorkercontext": {"constructors": {}, "properties": {"name": true, "onconnect": true}, "constants": {}, "methods": {}}, "SQLTransaction": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "CanvasRenderingContext": {"constructors": {}, "properties": {"canvas": true}, "constants": {}, "methods": {}}, "PopStateEvent": {"constructors": {}, "properties": {"state": true}, "constants": {}, "methods": {"initPopStateEvent": true}}, "HTMLHeadingElement": {"constructors": {}, "properties": {"align": true}, "constants": {}, "methods": {}}, "HTMLCanvasElement": {"constructors": {}, "properties": {"width": true, "height": true}, "constants": {}, "methods": {"toDataURL": true, "getContext": true}}, "AudioProcessingEvent": {"constructors": {}, "properties": {"inputBuffer": true, "outputBuffer": true}, "constants": {}, "methods": {}}, "SVGFEGaussianBlurElement": {"constructors": {}, "properties": {"stdDeviationY": true, "in1": true, "stdDeviationX": true}, "constants": {}, "methods": {"setStdDeviation": true}}, "AudioNode": {"constructors": {}, "properties": {"numberOfInputs": true, "context": true, "numberOfOutputs": true}, "constants": {}, "methods": {"disconnect": true, "connect": true}}, "SpeechInputEvent": {"constructors": {}, "properties": {"results": true}, "constants": {}, "methods": {}}, "InspectorFrontendHost": {"constructors": {}, "properties": {}, "constants": {}, "methods": {"saveAs": true, "recordPanelShown": true, "disconnectFromBackend": true, "bringToFront": true, "port": true, "showContextMenu": true, "requestDetachWindow": true, "inspectedURLChanged": true, "moveWindowBy": true, "platform": true, "setExtensionAPI": true, "closeWindow": true, "setAttachedWindowHeight": true, "localizedStringsURL": true, "requestAttachWindow": true, "sendMessageToBackend": true, "loaded": true, "copyText": true, "recordSettingChanged": true, "hiddenPanels": true, "recordActionTaken": true}}, "SVGFontFaceUriElement": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "SVGFontFaceElement": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "NavigatorUserMediaError": {"constructors": {}, "properties": {"PERMISSION_DENIED": true, "code": true}, "constants": {}, "methods": {}}, "SVGFEFuncBElement": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "UIEvent": {"constructors": {}, "properties": {"which": true, "layerY": true, "layerX": true, "detail": true, "pageX": true, "pageY": true, "charCode": true, "keyCode": true, "view": true}, "constants": {}, "methods": {"initUIEvent": true}}, "Coordinates": {"constructors": {}, "properties": {"altitude": true, "longitude": true, "latitude": true, "altitudeAccuracy": true, "speed": true, "heading": true, "accuracy": true}, "constants": {}, "methods": {}}, "MediaQueryList": {"constructors": {}, "properties": {"matches": true, "media": true}, "constants": {}, "methods": {"addListener": true, "removeListener": true}}, "SVGAnimateMotionElement": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "Document": {"constructors": {}, "properties": {"domain": true, "onmousedown": true, "onselect": true, "links": true, "onerror": true, "ondragenter": true, "characterSet": true, "onblur": true, "ondragleave": true, "onscroll": true, "onsubmit": true, "oncopy": true, "onmousewheel": true, "images": true, "compatMode": true, "onbeforepaste": true, "onchange": true, "ontouchstart": true, "oninvalid": true, "documentURI": true, "onload": true, "oninput": true, "onpaste": true, "onmouseout": true, "ondragover": true, "title": true, "applets": true, "charset": true, "selectedStylesheetSet": true, "onbeforecut": true, "forms": true, "onmouseup": true, "onmousemove": true, "location": true, "onclick": true, "onfocus": true, "ondrag": true, "onwebkitfullscreenchange": true, "body": true, "onabort": true, "head": true, "onreset": true, "ondragstart": true, "anchors": true, "ondrop": true, "onkeypress": true, "URL": true, "xmlEncoding": true, "onkeydown": true, "webkitVisibilityState": true, "xmlStandalone": true, "cookie": true, "onmouseover": true, "inputEncoding": true, "preferredStylesheetSet": true, "onbeforecopy": true, "defaultView": true, "webkitHidden": true, "onsearch": true, "oncontextmenu": true, "ontouchend": true, "readyState": true, "ondragend": true, "documentElement": true, "ontouchcancel": true, "ontouchmove": true, "lastModified": true, "xmlVersion": true, "doctype": true, "styleSheets": true, "oncut": true, "implementation": true, "referrer": true, "onkeyup": true, "onselectionchange": true, "ondblclick": true, "onselectstart": true, "onreadystatechange": true, "defaultCharset": true}, "constants": {}, "methods": {"createAttribute": true, "getCSSCanvasContext": true, "adoptNode": true, "getOverrideStyle": true, "createDocumentFragment": true, "createProcessingInstruction": true, "createComment": true, "getElementsByClassName": true, "createAttributeNS": true, "queryCommandIndeterm": true, "getElementsByTagName": true, "getSelection": true, "createExpression": true, "createNSResolver": true, "createCDATASection": true, "evaluate": true, "createElementNS": true, "queryCommandState": true, "getElementsByTagNameNS": true, "createEntityReference": true, "createTreeWalker": true, "querySelector": true, "queryCommandValue": true, "createElement": true, "queryCommandSupported": true, "getElementsByName": true, "caretRangeFromPoint": true, "querySelectorAll": true, "execCommand": true, "importNode": true, "queryCommandEnabled": true, "getElementById": true, "createRange": true, "elementFromPoint": true, "createEvent": true, "createNodeIterator": true, "createTextNode": true}}, "SVGUnitTypes": {"constructors": {}, "properties": {"SVG_UNIT_TYPE_OBJECTBOUNDINGBOX": true, "SVG_UNIT_TYPE_UNKNOWN": true, "SVG_UNIT_TYPE_USERSPACEONUSE": true}, "constants": {}, "methods": {}}, "SVGForeignObjectElement": {"constructors": {}, "properties": {"y": true, "width": true, "x": true, "height": true}, "constants": {}, "methods": {}}, "SVGMarkerElement": {"constructors": {}, "properties": {"refY": true, "refX": true, "SVG_MARKERUNITS_USERSPACEONUSE": true, "markerUnits": true, "SVG_MARKER_ORIENT_ANGLE": true, "SVG_MARKER_ORIENT_UNKNOWN": true, "SVG_MARKER_ORIENT_AUTO": true, "SVG_MARKERUNITS_UNKNOWN": true, "SVG_MARKERUNITS_STROKEWIDTH": true, "orientType": true, "markerWidth": true, "orientAngle": true, "markerHeight": true}, "constants": {}, "methods": {"setOrientToAngle": true, "setOrientToAuto": true}}, "SVGPathElement": {"constructors": {}, "properties": {"pathSegList": true, "normalizedPathSegList": true, "animatedNormalizedPathSegList": true, "animatedPathSegList": true, "pathLength": true}, "constants": {}, "methods": {"createSVGPathSegArcRel": true, "createSVGPathSegMovetoAbs": true, "createSVGPathSegLinetoAbs": true, "createSVGPathSegArcAbs": true, "createSVGPathSegMovetoRel": true, "createSVGPathSegCurvetoCubicRel": true, "createSVGPathSegLinetoRel": true, "createSVGPathSegLinetoVerticalAbs": true, "createSVGPathSegCurvetoQuadraticRel": true, "createSVGPathSegLinetoVerticalRel": true, "getPointAtLength": true, "getPathSegAtLength": true, "createSVGPathSegLinetoHorizontalAbs": true, "getTotalLength": true, "createSVGPathSegCurvetoQuadraticAbs": true, "createSVGPathSegCurvetoCubicAbs": true, "createSVGPathSegCurvetoCubicSmoothRel": true, "createSVGPathSegClosePath": true, "createSVGPathSegLinetoHorizontalRel": true, "createSVGPathSegCurvetoCubicSmoothAbs": true, "createSVGPathSegCurvetoQuadraticSmoothRel": true, "createSVGPathSegCurvetoQuadraticSmoothAbs": true}}, "DocumentType": {"constructors": {}, "properties": {"publicId": true, "name": true, "notations": true, "entities": true, "internalSubset": true, "systemId": true}, "constants": {}, "methods": {}}, "DeviceMotionEvent": {"constructors": {}, "properties": {"interval": true}, "constants": {}, "methods": {}}, "Rect": {"constructors": {}, "properties": {"top": true, "left": true, "right": true, "bottom": true}, "constants": {}, "methods": {}}, "StorageEvent": {"constructors": {}, "properties": {"url": true, "oldValue": true, "storageArea": true, "newValue": true, "key": true}, "constants": {}, "methods": {"initStorageEvent": true}}, "PositionError": {"constructors": {}, "properties": {"PERMISSION_DENIED": true, "message": true, "code": true, "TIMEOUT": true, "POSITION_UNAVAILABLE": true}, "constants": {}, "methods": {}}, "SVGRenderingIntent": {"constructors": {}, "properties": {"RENDERING_INTENT_ABSOLUTE_COLORIMETRIC": true, "RENDERING_INTENT_SATURATION": true, "RENDERING_INTENT_UNKNOWN": true, "RENDERING_INTENT_PERCEPTUAL": true, "RENDERING_INTENT_RELATIVE_COLORIMETRIC": true, "RENDERING_INTENT_AUTO": true}, "constants": {}, "methods": {}}, "SVGPathSegList": {"constructors": {}, "properties": {"numberOfItems": true}, "constants": {}, "methods": {"replaceItem": true, "appendItem": true, "clear": true, "getItem": true, "removeItem": true, "initialize": true, "insertItemBefore": true}}, "SVGTRefElement": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "SVGAnimatedBoolean": {"constructors": {}, "properties": {"animVal": true, "baseVal": true}, "constants": {}, "methods": {}}, "SVGFEOffsetElement": {"constructors": {}, "properties": {"in1": true, "dx": true, "dy": true}, "constants": {}, "methods": {}}, "WebKitCSSMatrix": {"constructors": {}, "properties": {"m11": true, "m13": true, "m12": true, "m14": true, "m44": true, "m34": true, "m33": true, "m32": true, "m31": true, "a": true, "c": true, "b": true, "e": true, "d": true, "f": true, "m24": true, "m43": true, "m41": true, "m21": true, "m22": true, "m23": true, "m42": true}, "constants": {}, "methods": {"inverse": true, "rotateAxisAngle": true, "rotate": true, "toString": true, "scale": true, "skewY": true, "skewX": true, "multiply": true, "translate": true, "setMatrixValue": true}}, "HTMLAudioElement": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "BarInfo": {"constructors": {}, "properties": {"visible": true}, "constants": {}, "methods": {}}, "AudioPannerNode": {"constructors": {}, "properties": {"distanceGain": true, "EQUALPOWER": true, "distanceModel": true, "SOUNDFIELD": true, "HRTF": true, "panningModel": true, "coneInnerAngle": true, "coneOuterAngle": true, "maxDistance": true, "refDistance": true, "rolloffFactor": true, "coneGain": true, "coneOuterGain": true}, "constants": {}, "methods": {"setOrientation": true, "setPosition": true, "setVelocity": true}}, "HTMLVideoElement": {"constructors": {}, "properties": {"width": true, "poster": true, "webkitDecodedFrameCount": true, "height": true, "webkitSupportsFullscreen": true, "webkitDisplayingFullscreen": true, "webkitDroppedFrameCount": true, "videoWidth": true, "videoHeight": true}, "constants": {}, "methods": {"webkitExitFullScreen": true, "webkitEnterFullScreen": true, "webkitEnterFullscreen": true, "webkitExitFullscreen": true}}, "DOMMimeType": {"constructors": {}, "properties": {"suffixes": true, "type": true, "description": true, "enabledPlugin": true}, "constants": {}, "methods": {}}, "AudioGainNode": {"constructors": {}, "properties": {"gain": true}, "constants": {}, "methods": {}}, "Storage": {"constructors": {}, "properties": {"length": true}, "constants": {}, "methods": {"setItem": true, "clear": true, "key": true, "getItem": true, "removeItem": true}}, "SVGGlyphRefElement": {"constructors": {}, "properties": {"format": true, "dx": true, "dy": true, "y": true, "x": true, "glyphRef": true}, "constants": {}, "methods": {}}, "Location": {"constructors": {}, "properties": {"origin": true, "search": true, "hash": true, "hostname": true, "host": true, "href": true, "pathname": true, "protocol": true, "port": true}, "constants": {}, "methods": {"reload": true, "replace": true, "toString": true, "assign": true, "getParameter": true}}, "DOMSettableTokenList": {"constructors": {}, "properties": {"value": true}, "constants": {}, "methods": {}}, "Performance": {"constructors": {}, "properties": {"timing": true, "navigation": true, "memory": true}, "constants": {}, "methods": {}}, "HTMLFrameElement": {"constructors": {}, "properties": {"src": true, "contentDocument": true, "name": true, "noResize": true, "height": true, "width": true, "contentWindow": true, "location": true, "marginHeight": true, "scrolling": true, "longDesc": true, "frameBorder": true, "marginWidth": true}, "constants": {}, "methods": {}}, "SVGTextElement": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "HTMLDListElement": {"constructors": {}, "properties": {"compact": true}, "constants": {}, "methods": {}}, "AudioSourceNode": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "SVGFEFuncRElement": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "SVGLineElement": {"constructors": {}, "properties": {"x2": true, "y1": true, "x1": true, "y2": true}, "constants": {}, "methods": {}}, "SVGAnimatedNumberList": {"constructors": {}, "properties": {"animVal": true, "baseVal": true}, "constants": {}, "methods": {}}, "HTMLOutputElement": {"constructors": {}, "properties": {"name": true, "form": true, "htmlFor": true, "defaultValue": true, "labels": true, "validity": true, "willValidate": true, "value": true, "type": true, "validationMessage": true}, "constants": {}, "methods": {"setCustomValidity": true, "checkValidity": true}}, "SVGAnimatedLength": {"constructors": {}, "properties": {"animVal": true, "baseVal": true}, "constants": {}, "methods": {}}, "Counter": {"constructors": {}, "properties": {"identifier": true, "separator": true, "listStyle": true}, "constants": {}, "methods": {}}, "HTMLIsIndexElement": {"constructors": {}, "properties": {"prompt": true, "form": true}, "constants": {}, "methods": {}}, "HTMLParagraphElement": {"constructors": {}, "properties": {"align": true}, "constants": {}, "methods": {}}, "SVGFitToViewBox": {"constructors": {}, "properties": {"preserveAspectRatio": true, "viewBox": true}, "constants": {}, "methods": {}}, "DOMApplicationCache": {"constructors": {}, "properties": {"status": true, "DOWNLOADING": true, "ondownloading": true, "onchecking": true, "CHECKING": true, "UNCACHED": true, "onprogress": true, "OBSOLETE": true, "onerror": true, "IDLE": true, "UPDATEREADY": true, "onobsolete": true, "oncached": true, "onnoupdate": true, "onupdateready": true}, "constants": {}, "methods": {"removeEventListener": true, "dispatchEvent": true, "swapCache": true, "update": true, "addEventListener": true}}, "SVGAnimatedAngle": {"constructors": {}, "properties": {"animVal": true, "baseVal": true}, "constants": {}, "methods": {}}, "SVGNumberList": {"constructors": {}, "properties": {"numberOfItems": true}, "constants": {}, "methods": {"replaceItem": true, "appendItem": true, "clear": true, "getItem": true, "removeItem": true, "initialize": true, "insertItemBefore": true}}, "HTMLAppletElement": {"constructors": {}, "properties": {"code": true, "name": true, "align": true, "object": true, "height": true, "codeBase": true, "width": true, "vspace": true, "alt": true, "hspace": true, "archive": true}, "constants": {}, "methods": {}}, "AudioDestinationNode": {"constructors": {}, "properties": {"numberOfChannels": true}, "constants": {}, "methods": {}}, "HTMLUListElement": {"constructors": {}, "properties": {"compact": true, "type": true}, "constants": {}, "methods": {}}, "SVGMPathElement": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "WebKitCSSKeyframeRule": {"constructors": {}, "properties": {"style": true, "keyText": true}, "constants": {}, "methods": {}}, "ConvolverNode": {"constructors": {}, "properties": {"buffer": true}, "constants": {}, "methods": {}}, "HTMLAllCollection": {"constructors": {}, "properties": {"length": true}, "constants": {}, "methods": {"item": true, "namedItem": true, "tags": true}}, "WebKitPoint": {"constructors": {}, "properties": {"y": true, "x": true}, "constants": {}, "methods": {}}, "ClientRectList": {"constructors": {}, "properties": {"length": true}, "constants": {}, "methods": {"item": true}}, "SVGViewSpec": {"constructors": {}, "properties": {"transformString": true, "viewTarget": true, "viewTargetString": true, "transform": true, "preserveAspectRatioString": true, "viewBoxString": true}, "constants": {}, "methods": {}}, "PageTransitionEvent": {"constructors": {}, "properties": {"persisted": true}, "constants": {}, "methods": {"initPageTransitionEvent": true}}, "ScriptProfile": {"constructors": {}, "properties": {"head": true, "uid": true, "title": true}, "constants": {}, "methods": {}}, "WebGLContextEvent": {"constructors": {}, "properties": {"statusMessage": true}, "constants": {}, "methods": {}}, "TimeRanges": {"constructors": {}, "properties": {"length": true}, "constants": {}, "methods": {"start": true, "end": true}}, "PerformanceNavigation": {"constructors": {}, "properties": {"TYPE_RELOAD": true, "redirectCount": true, "TYPE_RESERVED": true, "TYPE_NAVIGATE": true, "type": true, "TYPE_BACK_FORWARD": true}, "constants": {}, "methods": {}}, "SVGFEBlendElement": {"constructors": {}, "properties": {"SVG_FEBLEND_MODE_NORMAL": true, "SVG_FEBLEND_MODE_MULTIPLY": true, "SVG_FEBLEND_MODE_SCREEN": true, "in1": true, "in2": true, "SVG_FEBLEND_MODE_DARKEN": true, "mode": true, "SVG_FEBLEND_MODE_LIGHTEN": true, "SVG_FEBLEND_MODE_UNKNOWN": true}, "constants": {}, "methods": {}}, "CanvasRenderingContext2D": {"constructors": {}, "properties": {"strokeStyle": true, "webkitLineDash": true, "lineWidth": true, "shadowBlur": true, "globalAlpha": true, "lineCap": true, "shadowOffsetX": true, "shadowOffsetY": true, "globalCompositeOperation": true, "miterLimit": true, "fillStyle": true, "webkitLineDashOffset": true, "shadowColor": true, "textBaseline": true, "lineJoin": true, "font": true, "textAlign": true}, "constants": {}, "methods": {"quadraticCurveTo": true, "restore": true, "moveTo": true, "lineTo": true, "clip": true, "setTransform": true, "createPattern": true, "stroke": true, "arc": true, "createImageData": true, "measureText": true, "setLineJoin": true, "setLineWidth": true, "fill": true, "scale": true, "drawImage": true, "setCompositeOperation": true, "translate": true, "transform": true, "fillText": true, "strokeText": true, "setAlpha": true, "rect": true, "save": true, "createRadialGradient": true, "setShadow": true, "isPointInPath": true, "bezierCurveTo": true, "arcTo": true, "fillRect": true, "setFillColor": true, "clearShadow": true, "setLineCap": true, "beginPath": true, "clearRect": true, "drawImageFromRect": true, "rotate": true, "setMiterLimit": true, "putImageData": true, "getImageData": true, "createLinearGradient": true, "strokeRect": true, "closePath": true, "setStrokeColor": true}}, "FileReaderSync": {"constructors": {}, "properties": {}, "constants": {}, "methods": {"readAsDataURL": true, "readAsText": true, "readAsArrayBuffer": true, "readAsBinaryString": true}}, "SVGEllipseElement": {"constructors": {}, "properties": {"cy": true, "cx": true, "rx": true, "ry": true}, "constants": {}, "methods": {}}, "HTMLScriptElement": {"constructors": {}, "properties": {"src": true, "htmlFor": true, "text": true, "charset": true, "defer": true, "async": true, "type": true, "event": true}, "constants": {}, "methods": {}}, "XMLHttpRequestException": {"constructors": {}, "properties": {"NETWORK_ERR": true, "message": true, "code": true, "name": true, "ABORT_ERR": true}, "constants": {}, "methods": {"toString": true}}, "JavaScriptCallFrame": {"constructors": {}, "properties": {"CLOSURE_SCOPE": true, "functionName": true, "column": true, "caller": true, "CATCH_SCOPE": true, "sourceID": true, "LOCAL_SCOPE": true, "scopeChain": true, "WITH_SCOPE": true, "GLOBAL_SCOPE": true, "line": true, "type": true}, "constants": {}, "methods": {"evaluate": true, "scopeType": true}}, "HTMLTrackElement": {"constructors": {}, "properties": {"src": true, "kind": true, "track": true, "label": true, "srclang": true, "isDefault": true}, "constants": {}, "methods": {}}, "AudioChannelMerger": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "PerformanceTiming": {"constructors": {}, "properties": {"secureConnectionStart": true, "redirectStart": true, "domContentLoadedEventStart": true, "responseEnd": true, "redirectEnd": true, "loadEventStart": true, "unloadEventStart": true, "domainLookupEnd": true, "connectEnd": true, "unloadEventEnd": true, "requestStart": true, "loadEventEnd": true, "navigationStart": true, "domLoading": true, "domInteractive": true, "fetchStart": true, "domComplete": true, "domContentLoadedEventEnd": true, "responseStart": true, "connectStart": true, "domainLookupStart": true}, "constants": {}, "methods": {}}, "SVGFilterPrimitiveStandardAttributes": {"constructors": {}, "properties": {"y": true, "width": true, "x": true, "result": true, "height": true}, "constants": {}, "methods": {}}, "NamedNodeMap": {"constructors": {}, "properties": {"length": true}, "constants": {}, "methods": {"removeNamedItemNS": true, "setNamedItemNS": true, "getNamedItemNS": true, "getNamedItem": true, "setNamedItem": true, "item": true, "removeNamedItem": true}}, "SVGFEDiffuseLightingElement": {"constructors": {}, "properties": {"surfaceScale": true, "kernelUnitLengthY": true, "diffuseConstant": true, "kernelUnitLengthX": true, "in1": true}, "constants": {}, "methods": {}}, "SVGGradientElement": {"constructors": {}, "properties": {"SVG_SPREADMETHOD_REFLECT": true, "SVG_SPREADMETHOD_UNKNOWN": true, "spreadMethod": true, "gradientUnits": true, "SVG_SPREADMETHOD_REPEAT": true, "gradientTransform": true, "SVG_SPREADMETHOD_PAD": true}, "constants": {}, "methods": {}}, "SVGPathSegCurvetoCubicRel": {"constructors": {}, "properties": {"y2": true, "y1": true, "y": true, "x2": true, "x": true, "x1": true}, "constants": {}, "methods": {}}, "SVGPathSegMovetoRel": {"constructors": {}, "properties": {"y": true, "x": true}, "constants": {}, "methods": {}}, "SVGTransform": {"constructors": {}, "properties": {"SVG_TRANSFORM_TRANSLATE": true, "angle": true, "matrix": true, "SVG_TRANSFORM_SKEWY": true, "SVG_TRANSFORM_SKEWX": true, "SVG_TRANSFORM_SCALE": true, "SVG_TRANSFORM_ROTATE": true, "SVG_TRANSFORM_MATRIX": true, "SVG_TRANSFORM_UNKNOWN": true, "type": true}, "constants": {}, "methods": {"setMatrix": true, "setRotate": true, "setScale": true, "setSkewX": true, "setSkewY": true, "setTranslate": true}}, "StringCallback": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "SVGZoomAndPan": {"constructors": {}, "properties": {"SVG_ZOOMANDPAN_UNKNOWN": true, "SVG_ZOOMANDPAN_MAGNIFY": true, "SVG_ZOOMANDPAN_DISABLE": true, "zoomAndPan": true}, "constants": {}, "methods": {}}, "SVGDescElement": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "WebGLDebugRendererInfo": {"constructors": {}, "properties": {"UNMASKED_VENDOR_WEBGL": true, "UNMASKED_RENDERER_WEBGL": true}, "constants": {}, "methods": {}}, "Uint16Array": {"constructors": {}, "properties": {"length": true, "BYTES_PER_ELEMENT": true}, "constants": {}, "methods": {"subarray": true}}, "DirectoryEntry": {"constructors": {}, "properties": {}, "constants": {}, "methods": {"getFile": true, "createReader": true, "removeRecursively": true, "getDirectory": true}}, "CSSPrimitiveValue": {"constructors": {}, "properties": {"CSS_PX": true, "CSS_STRING": true, "CSS_PT": true, "CSS_COUNTER": true, "CSS_IDENT": true, "CSS_EMS": true, "CSS_CM": true, "CSS_PC": true, "CSS_PERCENTAGE": true, "CSS_RECT": true, "CSS_HZ": true, "CSS_EXS": true, "CSS_ATTR": true, "CSS_GRAD": true, "CSS_KHZ": true, "CSS_URI": true, "CSS_RGBCOLOR": true, "CSS_S": true, "CSS_RAD": true, "CSS_DIMENSION": true, "CSS_MS": true, "primitiveType": true, "CSS_DEG": true, "CSS_MM": true, "CSS_NUMBER": true, "CSS_IN": true, "CSS_UNKNOWN": true}, "constants": {}, "methods": {"getRGBColorValue": true, "getFloatValue": true, "setFloatValue": true, "getRectValue": true, "getStringValue": true, "getCounterValue": true, "setStringValue": true}}, "DirectoryEntrySync": {"constructors": {}, "properties": {}, "constants": {}, "methods": {"getFile": true, "createReader": true, "removeRecursively": true, "getDirectory": true}}, "SVGAnimatedPreserveAspectRatio": {"constructors": {}, "properties": {"animVal": true, "baseVal": true}, "constants": {}, "methods": {}}, "Blob": {"constructors": {}, "properties": {"type": true, "size": true}, "constants": {}, "methods": {}}, "HTMLBRElement": {"constructors": {}, "properties": {"clear": true}, "constants": {}, "methods": {}}, "SVGAltGlyphDefElement": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "DOMMimeTypeArray": {"constructors": {}, "properties": {"length": true}, "constants": {}, "methods": {"item": true, "namedItem": true}}, "WebKitFlags": {"constructors": {}, "properties": {"exclusive": true, "create": true}, "constants": {}, "methods": {}}, "EntityReference": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "SpeechInputResult": {"constructors": {}, "properties": {"confidence": true, "utterance": true}, "constants": {}, "methods": {}}, "SQLStatementErrorCallback": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "AudioBufferCallback": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "CSSStyleRule": {"constructors": {}, "properties": {"style": true, "selectorText": true}, "constants": {}, "methods": {}}, "SVGPolylineElement": {"constructors": {}, "properties": {"animatedPoints": true, "points": true}, "constants": {}, "methods": {}}, "CanvasPattern": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "SQLTransactionSyncCallback": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "CSSImportRule": {"constructors": {}, "properties": {"media": true, "styleSheet": true, "href": true}, "constants": {}, "methods": {}}, "HTMLTableCaptionElement": {"constructors": {}, "properties": {"align": true}, "constants": {}, "methods": {}}, "SVGNumber": {"constructors": {}, "properties": {"value": true}, "constants": {}, "methods": {}}, "SVGPathSegCurvetoCubicSmoothRel": {"constructors": {}, "properties": {"x2": true, "x": true, "y2": true, "y": true}, "constants": {}, "methods": {}}, "AudioParam": {"constructors": {}, "properties": {"name": true, "defaultValue": true, "maxValue": true, "value": true, "minValue": true, "units": true}, "constants": {}, "methods": {"setValueAtTime": true, "linearRampToValueAtTime": true, "cancelScheduledValues": true, "exponentialRampToValueAtTime": true, "setTargetValueAtTime": true, "setValueCurveAtTime": true}}, "MessagePort": {"constructors": {}, "properties": {"onmessage": true}, "constants": {}, "methods": {"postMessage": true, "removeEventListener": true, "start": true, "addEventListener": true, "dispatchEvent": true, "webkitPostMessage": true, "close": true}}, "ElementTimeControl": {"constructors": {}, "properties": {}, "constants": {}, "methods": {"beginElementAt": true, "beginElement": true, "endElementAt": true, "endElement": true}}, "SVGPathSegArcAbs": {"constructors": {}, "properties": {"angle": true, "largeArcFlag": true, "r2": true, "sweepFlag": true, "y": true, "x": true, "r1": true}, "constants": {}, "methods": {}}, "WebGLDebugShaders": {"constructors": {}, "properties": {}, "constants": {}, "methods": {"getTranslatedShaderSource": true}}, "SVGFontElement": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "RangeException": {"constructors": {}, "properties": {"message": true, "code": true, "BAD_BOUNDARYPOINTS_ERR": true, "INVALID_NODE_TYPE_ERR": true, "name": true}, "constants": {}, "methods": {"toString": true}}, "LowPass2FilterNode": {"constructors": {}, "properties": {"cutoff": true, "resonance": true}, "constants": {}, "methods": {}}, "SVGElement": {"constructors": {}, "properties": {"ownerSVGElement": true, "viewportElement": true, "xmlbase": true, "id": true}, "constants": {}, "methods": {}}, "CSSValue": {"constructors": {}, "properties": {"cssValueType": true, "CSS_VALUE_LIST": true, "cssText": true, "CSS_INHERIT": true, "CSS_PRIMITIVE_VALUE": true, "CSS_CUSTOM": true}, "constants": {}, "methods": {}}, "ArrayBufferView": {"constructors": {}, "properties": {"buffer": true, "byteLength": true, "byteOffset": true}, "constants": {}, "methods": {}}, "HighPass2FilterNode": {"constructors": {}, "properties": {"cutoff": true, "resonance": true}, "constants": {}, "methods": {}}, "SVGFEConvolveMatrixElement": {"constructors": {}, "properties": {"divisor": true, "targetX": true, "kernelMatrix": true, "targetY": true, "bias": true, "in1": true, "edgeMode": true, "SVG_EDGEMODE_DUPLICATE": true, "orderX": true, "orderY": true, "SVG_EDGEMODE_UNKNOWN": true, "preserveAlpha": true, "kernelUnitLengthY": true, "SVG_EDGEMODE_NONE": true, "kernelUnitLengthX": true, "SVG_EDGEMODE_WRAP": true}, "constants": {}, "methods": {}}, "SVGAnimatedEnumeration": {"constructors": {}, "properties": {"animVal": true, "baseVal": true}, "constants": {}, "methods": {}}, "SVGAnimateColorElement": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "Geoposition": {"constructors": {}, "properties": {"timestamp": true, "coords": true}, "constants": {}, "methods": {}}, "HTMLDataListElement": {"constructors": {}, "properties": {"options": true}, "constants": {}, "methods": {}}, "Console": {"constructors": {}, "properties": {"memory": true}, "constants": {}, "methods": {"count": true, "info": true, "group": true, "log": true, "trace": true, "timeStamp": true, "dirxml": true, "time": true, "timeEnd": true, "assert": true, "groupEnd": true, "groupCollapsed": true, "warn": true, "error": true, "debug": true, "markTimeline": true, "dir": true}}, "HTMLMediaElement": {"constructors": {}, "properties": {"NETWORK_LOADING": true, "buffered": true, "HAVE_FUTURE_DATA": true, "HAVE_ENOUGH_DATA": true, "played": true, "webkitVideoDecodedByteCount": true, "paused": true, "ended": true, "currentSrc": true, "duration": true, "defaultMuted": true, "muted": true, "controls": true, "NETWORK_NO_SOURCE": true, "preload": true, "seeking": true, "HAVE_CURRENT_DATA": true, "webkitAudioDecodedByteCount": true, "webkitPreservesPitch": true, "volume": true, "networkState": true, "startTime": true, "NETWORK_IDLE": true, "seekable": true, "initialTime": true, "src": true, "readyState": true, "NETWORK_EMPTY": true, "currentTime": true, "HAVE_NOTHING": true, "webkitClosedCaptionsVisible": true, "playbackRate": true, "HAVE_METADATA": true, "defaultPlaybackRate": true, "error": true, "webkitHasClosedCaptions": true, "loop": true, "autoplay": true}, "constants": {}, "methods": {"load": true, "play": true, "pause": true, "canPlayType": true}}, "SVGMissingGlyphElement": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "DOMPlugin": {"constructors": {}, "properties": {"length": true, "description": true, "name": true, "filename": true}, "constants": {}, "methods": {"item": true, "namedItem": true}}, "OperationNotAllowedException": {"constructors": {}, "properties": {"message": true, "code": true, "NOT_ALLOWED_ERR": true, "name": true}, "constants": {}, "methods": {"toString": true}}, "CSSRuleList": {"constructors": {}, "properties": {"length": true}, "constants": {}, "methods": {"item": true}}, "StorageInfoQuotaCallback": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "WebKitCSSFilterValue": {"constructors": {}, "properties": {"CSS_FILTER_HUE_ROTATE": true, "CSS_FILTER_BLUR": true, "operationType": true, "CSS_FILTER_GRAYSCALE": true, "CSS_FILTER_SATURATE": true, "CSS_FILTER_GAMMA": true, "CSS_FILTER_SEPIA": true, "CSS_FILTER_INVERT": true, "CSS_FILTER_OPACITY": true, "CSS_FILTER_SHARPEN": true, "CSS_FILTER_REFERENCE": true, "CSS_FILTER_DROP_SHADOW": true}, "constants": {}, "methods": {}}, "SVGAngle": {"constructors": {}, "properties": {"valueInSpecifiedUnits": true, "unitType": true, "value": true, "SVG_ANGLETYPE_RAD": true, "SVG_ANGLETYPE_UNKNOWN": true, "valueAsString": true, "SVG_ANGLETYPE_DEG": true, "SVG_ANGLETYPE_GRAD": true, "SVG_ANGLETYPE_UNSPECIFIED": true}, "constants": {}, "methods": {"newValueSpecifiedUnits": true, "convertToSpecifiedUnits": true}}, "TextTrackCue": {"constructors": {}, "properties": {"textPosition": true, "direction": true, "snapToLines": true, "track": true, "linePosition": true, "pauseOnExit": true, "startTime": true, "endTime": true, "id": true, "alignment": true, "size": true}, "constants": {}, "methods": {"getCueAsSource": true, "getCueAsHTML": true}}, "SQLException": {"constructors": {}, "properties": {"code": true, "CONSTRAINT_ERR": true, "TOO_LARGE_ERR": true, "TIMEOUT_ERR": true, "UNKNOWN_ERR": true, "SYNTAX_ERR": true, "message": true, "VERSION_ERR": true, "QUOTA_ERR": true, "DATABASE_ERR": true}, "constants": {}, "methods": {}}, "RealtimeAnalyserNode": {"constructors": {}, "properties": {"smoothingTimeConstant": true, "maxDecibels": true, "fftSize": true, "minDecibels": true, "frequencyBinCount": true}, "constants": {}, "methods": {"getByteTimeDomainData": true, "getByteFrequencyData": true, "getFloatFrequencyData": true}}, "HTMLBaseElement": {"constructors": {}, "properties": {"href": true, "target": true}, "constants": {}, "methods": {}}, "SVGAnimatedInteger": {"constructors": {}, "properties": {"animVal": true, "baseVal": true}, "constants": {}, "methods": {}}, "HTMLSelectElement": {"constructors": {}, "properties": {"required": true, "multiple": true, "name": true, "form": true, "labels": true, "willValidate": true, "validity": true, "disabled": true, "length": true, "value": true, "selectedIndex": true, "autofocus": true, "validationMessage": true, "type": true, "options": true, "size": true}, "constants": {}, "methods": {"setCustomValidity": true, "namedItem": true, "remove": true, "item": true, "add": true, "checkValidity": true}}, "TextTrack": {"constructors": {}, "properties": {"None": true, "Loading": true, "activeCues": true, "language": true, "Showing": true, "kind": true, "label": true, "Disabled": true, "mode": true, "Error": true, "Loaded": true, "Hidden": true, "cues": true, "readyState": true}, "constants": {}, "methods": {"removeCue": true, "addCue": true}}, "SVGPathSegCurvetoCubicSmoothAbs": {"constructors": {}, "properties": {"x2": true, "x": true, "y2": true, "y": true}, "constants": {}, "methods": {}}, "HTMLIFrameElement": {"constructors": {}, "properties": {"src": true, "contentDocument": true, "name": true, "align": true, "sandbox": true, "height": true, "width": true, "contentWindow": true, "marginWidth": true, "marginHeight": true, "scrolling": true, "longDesc": true, "frameBorder": true}, "constants": {}, "methods": {}}, "SVGPathSeg": {"constructors": {}, "properties": {"PATHSEG_CURVETO_CUBIC_REL": true, "PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS": true, "PATHSEG_CURVETO_CUBIC_SMOOTH_REL": true, "PATHSEG_CURVETO_QUADRATIC_REL": true, "pathSegTypeAsLetter": true, "PATHSEG_UNKNOWN": true, "PATHSEG_LINETO_HORIZONTAL_REL": true, "PATHSEG_CURVETO_QUADRATIC_ABS": true, "PATHSEG_LINETO_REL": true, "PATHSEG_ARC_REL": true, "PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL": true, "pathSegType": true, "PATHSEG_CURVETO_CUBIC_ABS": true, "PATHSEG_LINETO_HORIZONTAL_ABS": true, "PATHSEG_MOVETO_ABS": true, "PATHSEG_LINETO_ABS": true, "PATHSEG_CLOSEPATH": true, "PATHSEG_CURVETO_CUBIC_SMOOTH_ABS": true, "PATHSEG_LINETO_VERTICAL_REL": true, "PATHSEG_MOVETO_REL": true, "PATHSEG_LINETO_VERTICAL_ABS": true, "PATHSEG_ARC_ABS": true}, "constants": {}, "methods": {}}, "SVGDocument": {"constructors": {}, "properties": {"rootElement": true}, "constants": {}, "methods": {"createEvent": true}}, "TouchEvent": {"constructors": {}, "properties": {"touches": true, "shiftKey": true, "changedTouches": true, "altKey": true, "metaKey": true, "targetTouches": true, "ctrlKey": true}, "constants": {}, "methods": {"initTouchEvent": true}}, "Text": {"constructors": {}, "properties": {"wholeText": true}, "constants": {}, "methods": {"splitText": true, "replaceWholeText": true}}, "WebGLVertexArrayObjectOES": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "HTMLTableCellElement": {"constructors": {}, "properties": {"ch": true, "chOff": true, "bgColor": true, "colSpan": true, "align": true, "height": true, "headers": true, "cellIndex": true, "rowSpan": true, "abbr": true, "vAlign": true, "scope": true, "noWrap": true, "width": true, "axis": true}, "constants": {}, "methods": {}}, "FileWriterSync": {"constructors": {}, "properties": {"position": true, "length": true}, "constants": {}, "methods": {"write": true, "seek": true, "truncate": true}}, "XSLTProcessor": {"constructors": {}, "properties": {}, "constants": {}, "methods": {"reset": true, "clearParameters": true, "getParameter": true, "transformToDocument": true, "removeParameter": true, "importStylesheet": true, "setParameter": true, "transformToFragment": true}}, "WheelEvent": {"constructors": {}, "properties": {"clientX": true, "clientY": true, "wheelDeltaX": true, "webkitDirectionInvertedFromDevice": true, "shiftKey": true, "wheelDelta": true, "offsetX": true, "offsetY": true, "altKey": true, "metaKey": true, "ctrlKey": true, "y": true, "x": true, "screenY": true, "screenX": true, "wheelDeltaY": true}, "constants": {}, "methods": {"initWebKitWheelEvent": true}}, "AudioBuffer": {"constructors": {}, "properties": {"duration": true, "sampleRate": true, "length": true, "numberOfChannels": true, "gain": true}, "constants": {}, "methods": {"getChannelData": true}}, "BeforeLoadEvent": {"constructors": {}, "properties": {"url": true}, "constants": {}, "methods": {"initBeforeLoadEvent": true}}, "SVGTransformable": {"constructors": {}, "properties": {"transform": true}, "constants": {}, "methods": {}}, "HashChangeEvent": {"constructors": {}, "properties": {"newURL": true, "oldURL": true}, "constants": {}, "methods": {"initHashChangeEvent": true}}, "SVGStringList": {"constructors": {}, "properties": {"numberOfItems": true}, "constants": {}, "methods": {"replaceItem": true, "appendItem": true, "clear": true, "getItem": true, "removeItem": true, "initialize": true, "insertItemBefore": true}}, "HTMLTableSectionElement": {"constructors": {}, "properties": {"rows": true, "align": true, "ch": true, "chOff": true, "vAlign": true}, "constants": {}, "methods": {"insertRow": true, "deleteRow": true}}, "SVGClipPathElement": {"constructors": {}, "properties": {"clipPathUnits": true}, "constants": {}, "methods": {}}, "SVGCursorElement": {"constructors": {}, "properties": {"y": true, "x": true}, "constants": {}, "methods": {}}, "SQLResultSet": {"constructors": {}, "properties": {"insertId": true, "rows": true, "rowsAffected": true}, "constants": {}, "methods": {}}, "DOMParser": {"constructors": {}, "properties": {}, "constants": {}, "methods": {"parseFromString": true}}, "IDBAny": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "MediaElementAudioSourceNode": {"constructors": {}, "properties": {"mediaElement": true}, "constants": {}, "methods": {}}, "Clipboard": {"constructors": {}, "properties": {"effectAllowed": true, "files": true, "types": true, "dropEffect": true, "items": true}, "constants": {}, "methods": {"setDragImage": true, "getData": true, "clearData": true, "setData": true}}, "EntrySync": {"constructors": {}, "properties": {"fullPath": true, "isFile": true, "isDirectory": true, "name": true, "filesystem": true}, "constants": {}, "methods": {"moveTo": true, "getParent": true, "getMetadata": true, "toURL": true, "remove": true, "copyTo": true}}, "HTMLProgressElement": {"constructors": {}, "properties": {"max": true, "labels": true, "value": true, "form": true, "position": true}, "constants": {}, "methods": {}}, "SVGGElement": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "HTMLOptionsCollection": {"constructors": {}, "properties": {"selectedIndex": true, "length": true}, "constants": {}, "methods": {"remove": true}}, "SVGHKernElement": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "IDBRequest": {"constructors": {}, "properties": {"readyState": true, "LOADING": true, "onerror": true, "webkitErrorMessage": true, "onsuccess": true, "errorCode": true, "source": true, "transaction": true, "DONE": true, "result": true}, "constants": {}, "methods": {"removeEventListener": true, "dispatchEvent": true, "addEventListener": true}}, "SVGFEDisplacementMapElement": {"constructors": {}, "properties": {"SVG_CHANNEL_B": true, "SVG_CHANNEL_A": true, "SVG_CHANNEL_G": true, "in1": true, "SVG_CHANNEL_UNKNOWN": true, "yChannelSelector": true, "SVG_CHANNEL_R": true, "scale": true, "in2": true, "xChannelSelector": true}, "constants": {}, "methods": {}}, "SVGFontFaceNameElement": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "IDBFactory": {"constructors": {}, "properties": {}, "constants": {}, "methods": {"getDatabaseNames": true, "deleteDatabase": true, "open": true, "cmp": true}}, "FileList": {"constructors": {}, "properties": {"length": true}, "constants": {}, "methods": {"item": true}}, "SQLTransactionCallback": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "HTMLFieldSetElement": {"constructors": {}, "properties": {"willValidate": true, "validity": true, "form": true, "validationMessage": true}, "constants": {}, "methods": {"setCustomValidity": true, "checkValidity": true}}, "CSSStyleDeclaration": {"constructors": {}, "properties": {"parentRule": true, "length": true, "cssText": true}, "constants": {}, "methods": {"getPropertyShorthand": true, "isPropertyImplicit": true, "setProperty": true, "getPropertyCSSValue": true, "item": true, "removeProperty": true, "getPropertyValue": true, "getPropertyPriority": true}}, "WebGLFramebuffer": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "SVGExternalResourcesRequired": {"constructors": {}, "properties": {"externalResourcesRequired": true}, "constants": {}, "methods": {}}, "ElementTraversal": {"constructors": {}, "properties": {"lastElementChild": true, "nextElementSibling": true, "firstElementChild": true, "childElementCount": true, "previousElementSibling": true}, "constants": {}, "methods": {}}, "FileCallback": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "CSSValueList": {"constructors": {}, "properties": {"length": true}, "constants": {}, "methods": {"item": true}}, "ValidityState": {"constructors": {}, "properties": {"rangeUnderflow": true, "tooLong": true, "rangeOverflow": true, "stepMismatch": true, "customError": true, "patternMismatch": true, "valueMissing": true, "typeMismatch": true, "valid": true}, "constants": {}, "methods": {}}, "WebSocket": {"constructors": {}, "properties": {"onopen": true, "readyState": true, "protocol": true, "URL": true, "onclose": true, "bufferedAmount": true, "onerror": true, "CONNECTING": true, "binaryType": true, "CLOSED": true, "onmessage": true, "extensions": true, "CLOSING": true, "OPEN": true}, "constants": {}, "methods": {"close": true, "removeEventListener": true, "dispatchEvent": true, "send": true, "addEventListener": true}}, "EntriesCallback": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "SVGAnimatedRect": {"constructors": {}, "properties": {"animVal": true, "baseVal": true}, "constants": {}, "methods": {}}, "Crypto": {"constructors": {}, "properties": {}, "constants": {}, "methods": {"getRandomValues": true}}, "SVGStylable": {"constructors": {}, "properties": {"className": true, "style": true}, "constants": {}, "methods": {"getPresentationAttribute": true}}, "Range": {"constructors": {}, "properties": {"START_TO_END": true, "endContainer": true, "NODE_AFTER": true, "endOffset": true, "END_TO_END": true, "collapsed": true, "START_TO_START": true, "NODE_BEFORE_AND_AFTER": true, "END_TO_START": true, "startOffset": true, "NODE_INSIDE": true, "NODE_BEFORE": true, "commonAncestorContainer": true, "startContainer": true}, "constants": {}, "methods": {"comparePoint": true, "toString": true, "cloneContents": true, "setEnd": true, "setEndAfter": true, "setStart": true, "setEndBefore": true, "surroundContents": true, "getBoundingClientRect": true, "setStartAfter": true, "cloneRange": true, "isPointInRange": true, "getClientRects": true, "collapse": true, "compareNode": true, "createContextualFragment": true, "setStartBefore": true, "insertNode": true, "selectNode": true, "selectNodeContents": true, "extractContents": true, "detach": true, "expand": true, "deleteContents": true, "intersectsNode": true}}, "Comment": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "ProcessingInstruction": {"constructors": {}, "properties": {"sheet": true, "data": true, "target": true}, "constants": {}, "methods": {}}, "HTMLLIElement": {"constructors": {}, "properties": {"type": true, "value": true}, "constants": {}, "methods": {}}, "SVGTests": {"constructors": {}, "properties": {"requiredFeatures": true, "systemLanguage": true, "requiredExtensions": true}, "constants": {}, "methods": {"hasExtension": true}}, "SVGSVGElement": {"constructors": {}, "properties": {"x": true, "currentTranslate": true, "pixelUnitToMillimeterX": true, "screenPixelToMillimeterY": true, "height": true, "width": true, "contentStyleType": true, "pixelUnitToMillimeterY": true, "currentScale": true, "y": true, "useCurrentView": true, "screenPixelToMillimeterX": true, "viewport": true, "contentScriptType": true}, "constants": {}, "methods": {"unpauseAnimations": true, "createSVGMatrix": true, "getIntersectionList": true, "setCurrentTime": true, "createSVGNumber": true, "unsuspendRedrawAll": true, "forceRedraw": true, "getEnclosureList": true, "createSVGAngle": true, "getCurrentTime": true, "animationsPaused": true, "createSVGTransform": true, "createSVGLength": true, "unsuspendRedraw": true, "checkIntersection": true, "createSVGPoint": true, "pauseAnimations": true, "createSVGTransformFromMatrix": true, "deselectAll": true, "checkEnclosure": true, "suspendRedraw": true, "createSVGRect": true, "getElementById": true}}, "DirectoryReaderSync": {"constructors": {}, "properties": {}, "constants": {}, "methods": {"readEntries": true}}, "ScriptProfileNode": {"constructors": {}, "properties": {"totalTime": true, "functionName": true, "selfTime": true, "url": true, "numberOfCalls": true, "visible": true, "callUID": true, "lineNumber": true, "children": true}, "constants": {}, "methods": {}}, "Int32Array": {"constructors": {}, "properties": {"length": true, "BYTES_PER_ELEMENT": true}, "constants": {}, "methods": {"subarray": true}}, "SQLResultSetRowList": {"constructors": {}, "properties": {"length": true}, "constants": {}, "methods": {"item": true}}, "NavigatorUserMediaErrorCallback": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "EntryArraySync": {"constructors": {}, "properties": {"length": true}, "constants": {}, "methods": {"item": true}}, "SharedWorker": {"constructors": {}, "properties": {"port": true}, "constants": {}, "methods": {}}, "SVGMetadataElement": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "SVGAltGlyphElement": {"constructors": {}, "properties": {"glyphRef": true, "format": true}, "constants": {}, "methods": {}}, "FileEntry": {"constructors": {}, "properties": {}, "constants": {}, "methods": {"createWriter": true, "file": true}}, "WebKitTransitionEvent": {"constructors": {}, "properties": {"elapsedTime": true, "propertyName": true}, "constants": {}, "methods": {"initWebKitTransitionEvent": true}}, "SQLError": {"constructors": {}, "properties": {"code": true, "CONSTRAINT_ERR": true, "TOO_LARGE_ERR": true, "TIMEOUT_ERR": true, "UNKNOWN_ERR": true, "SYNTAX_ERR": true, "message": true, "VERSION_ERR": true, "QUOTA_ERR": true, "DATABASE_ERR": true}, "constants": {}, "methods": {}}, "SVGPathSegCurvetoQuadraticRel": {"constructors": {}, "properties": {"y": true, "x": true, "x1": true, "y1": true}, "constants": {}, "methods": {}}, "HTMLKeygenElement": {"constructors": {}, "properties": {"name": true, "form": true, "challenge": true, "labels": true, "validity": true, "disabled": true, "willValidate": true, "autofocus": true, "type": true, "keytype": true, "validationMessage": true}, "constants": {}, "methods": {"setCustomValidity": true, "checkValidity": true}}, "SVGFEMergeElement": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "DOMFileSystemSync": {"constructors": {}, "properties": {"root": true, "name": true}, "constants": {}, "methods": {}}, "SVGFilterElement": {"constructors": {}, "properties": {"primitiveUnits": true, "height": true, "width": true, "filterResX": true, "filterResY": true, "y": true, "x": true, "filterUnits": true}, "constants": {}, "methods": {"setFilterRes": true}}, "SVGRadialGradientElement": {"constructors": {}, "properties": {"fx": true, "fy": true, "cy": true, "cx": true, "r": true}, "constants": {}, "methods": {}}, "SVGPathSegCurvetoQuadraticSmoothAbs": {"constructors": {}, "properties": {"y": true, "x": true}, "constants": {}, "methods": {}}, "SVGElementInstanceList": {"constructors": {}, "properties": {"length": true}, "constants": {}, "methods": {"item": true}}, "HTMLUnknownElement": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "DedicatedWorkerContext": {"constructors": {}, "properties": {"onmessage": true}, "constants": {}, "methods": {"postMessage": true, "webkitPostMessage": true}}, "SVGViewElement": {"constructors": {}, "properties": {"viewTarget": true}, "constants": {}, "methods": {}}, "HTMLHRElement": {"constructors": {}, "properties": {"width": true, "align": true, "noShade": true, "size": true}, "constants": {}, "methods": {}}, "SVGFEDistantLightElement": {"constructors": {}, "properties": {"elevation": true, "azimuth": true}, "constants": {}, "methods": {}}, "HTMLElement": {"constructors": {}, "properties": {"webkitdropzone": true, "contentEditable": true, "itemType": true, "innerHTML": true, "outerHTML": true, "id": true, "tabIndex": true, "className": true, "spellcheck": true, "itemRef": true, "children": true, "hidden": true, "lang": true, "isContentEditable": true, "outerText": true, "itemId": true, "classList": true, "title": true, "itemProp": true, "draggable": true, "innerText": true, "itemValue": true, "itemScope": true, "dir": true}, "constants": {}, "methods": {"insertAdjacentText": true, "insertAdjacentHTML": true, "insertAdjacentElement": true}}, "XPathResult": {"constructors": {}, "properties": {"invalidIteratorState": true, "snapshotLength": true, "BOOLEAN_TYPE": true, "resultType": true, "UNORDERED_NODE_ITERATOR_TYPE": true, "ORDERED_NODE_ITERATOR_TYPE": true, "STRING_TYPE": true, "ORDERED_NODE_SNAPSHOT_TYPE": true, "UNORDERED_NODE_SNAPSHOT_TYPE": true, "numberValue": true, "NUMBER_TYPE": true, "stringValue": true, "FIRST_ORDERED_NODE_TYPE": true, "booleanValue": true, "singleNodeValue": true, "ANY_UNORDERED_NODE_TYPE": true, "ANY_TYPE": true}, "constants": {}, "methods": {"snapshotItem": true, "iterateNext": true}}, "CanvasGradient": {"constructors": {}, "properties": {}, "constants": {}, "methods": {"addColorStop": true}}, "TouchList": {"constructors": {}, "properties": {"length": true}, "constants": {}, "methods": {"item": true}}, "SVGMaskElement": {"constructors": {}, "properties": {"maskContentUnits": true, "height": true, "width": true, "y": true, "x": true, "maskUnits": true}, "constants": {}, "methods": {}}, "WaveShaperNode": {"constructors": {}, "properties": {"curve": true}, "constants": {}, "methods": {}}, "HTMLMarqueeElement": {"constructors": {}, "properties": {"direction": true, "scrollDelay": true, "trueSpeed": true, "height": true, "bgColor": true, "vspace": true, "scrollAmount": true, "behavior": true, "hspace": true, "width": true, "loop": true}, "constants": {}, "methods": {"start": true, "stop": true}}, "WorkerNavigator": {"constructors": {}, "properties": {"platform": true, "onLine": true, "userAgent": true, "appVersion": true, "appName": true}, "constants": {}, "methods": {}}, "NotificationCenter": {"constructors": {}, "properties": {}, "constants": {}, "methods": {"createHTMLNotification": true, "checkPermission": true, "createNotification": true, "requestPermission": true}}, "OESTextureFloat": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "HTMLFontElement": {"constructors": {}, "properties": {"color": true, "size": true, "face": true}, "constants": {}, "methods": {}}, "DOMSelection": {"constructors": {}, "properties": {"isCollapsed": true, "focusOffset": true, "focusNode": true, "anchorOffset": true, "baseNode": true, "rangeCount": true, "extentOffset": true, "baseOffset": true, "anchorNode": true, "type": true, "extentNode": true}, "constants": {}, "methods": {"deleteFromDocument": true, "collapse": true, "extend": true, "modify": true, "addRange": true, "collapseToStart": true, "toString": true, "getRangeAt": true, "setBaseAndExtent": true, "containsNode": true, "collapseToEnd": true, "setPosition": true, "removeAllRanges": true, "selectAllChildren": true, "empty": true}}, "SVGLinearGradientElement": {"constructors": {}, "properties": {"x2": true, "y1": true, "x1": true, "y2": true}, "constants": {}, "methods": {}}, "SVGFETurbulenceElement": {"constructors": {}, "properties": {"SVG_TURBULENCE_TYPE_FRACTALNOISE": true, "baseFrequencyX": true, "SVG_STITCHTYPE_UNKNOWN": true, "stitchTiles": true, "seed": true, "SVG_TURBULENCE_TYPE_TURBULENCE": true, "baseFrequencyY": true, "SVG_STITCHTYPE_STITCH": true, "SVG_STITCHTYPE_NOSTITCH": true, "numOctaves": true, "type": true, "SVG_TURBULENCE_TYPE_UNKNOWN": true}, "constants": {}, "methods": {}}, "AudioListener": {"constructors": {}, "properties": {"dopplerFactor": true, "speedOfSound": true}, "constants": {}, "methods": {"setOrientation": true, "setPosition": true, "setVelocity": true}}, "HTMLAnchorElement": {"constructors": {}, "properties": {"origin": true, "charset": true, "protocol": true, "ping": true, "hreflang": true, "shape": true, "href": true, "download": true, "port": true, "accessKey": true, "hostname": true, "rev": true, "rel": true, "text": true, "pathname": true, "type": true, "hash": true, "host": true, "target": true, "search": true, "name": true, "coords": true}, "constants": {}, "methods": {"toString": true, "getParameter": true}}, "CSSMediaRule": {"constructors": {}, "properties": {"media": true, "cssRules": true}, "constants": {}, "methods": {"insertRule": true, "deleteRule": true}}, "MouseEvent": {"constructors": {}, "properties": {"clientX": true, "clientY": true, "fromElement": true, "dataTransfer": true, "relatedTarget": true, "shiftKey": true, "button": true, "offsetX": true, "offsetY": true, "altKey": true, "metaKey": true, "toElement": true, "ctrlKey": true, "y": true, "x": true, "screenY": true, "screenX": true}, "constants": {}, "methods": {"initMouseEvent": true}}, "WebGLActiveInfo": {"constructors": {}, "properties": {"type": true, "name": true, "size": true}, "constants": {}, "methods": {}}, "CharacterData": {"constructors": {}, "properties": {"length": true, "data": true}, "constants": {}, "methods": {"appendData": true, "deleteData": true, "substringData": true, "insertData": true, "replaceData": true}}, "IDBCursorWithValue": {"constructors": {}, "properties": {"value": true}, "constants": {}, "methods": {}}, "HTMLHtmlElement": {"constructors": {}, "properties": {"version": true, "manifest": true}, "constants": {}, "methods": {}}, "DataTransferItem": {"constructors": {}, "properties": {"kind": true, "type": true}, "constants": {}, "methods": {"getAsString": true, "getAsFile": true}}, "HTMLStyleElement": {"constructors": {}, "properties": {"disabled": true, "media": true, "sheet": true, "type": true}, "constants": {}, "methods": {}}, "DOMURL": {"constructors": {}, "properties": {}, "constants": {}, "methods": {"createObjectURL": true, "revokeObjectURL": true}}, "WebKitCSSTransformValue": {"constructors": {}, "properties": {"CSS_ROTATEX": true, "CSS_ROTATEY": true, "CSS_ROTATEZ": true, "CSS_SKEW": true, "CSS_SCALE3D": true, "CSS_SCALE": true, "CSS_TRANSLATE3D": true, "operationType": true, "CSS_PERSPECTIVE": true, "CSS_MATRIX": true, "CSS_ROTATE": true, "CSS_SCALEX": true, "CSS_SCALEY": true, "CSS_SCALEZ": true, "CSS_SKEWY": true, "CSS_SKEWX": true, "CSS_ROTATE3D": true, "CSS_TRANSLATE": true, "CSS_TRANSLATEX": true, "CSS_TRANSLATEY": true, "CSS_TRANSLATEZ": true, "CSS_MATRIX3D": true}, "constants": {}, "methods": {}}, "HTMLImageElement": {"constructors": {}, "properties": {"src": true, "crossOrigin": true, "lowsrc": true, "naturalHeight": true, "hspace": true, "align": true, "name": true, "height": true, "width": true, "naturalWidth": true, "x": true, "useMap": true, "y": true, "vspace": true, "alt": true, "isMap": true, "border": true, "longDesc": true, "complete": true}, "constants": {}, "methods": {}}, "CanvasPixelArray": {"constructors": {}, "properties": {"length": true}, "constants": {}, "methods": {}}, "StyleSheetList": {"constructors": {}, "properties": {"length": true}, "constants": {}, "methods": {"item": true}}, "Element": {"constructors": {}, "properties": {"tagName": true, "offsetParent": true, "onerror": true, "ondragenter": true, "onreset": true, "childElementCount": true, "onbeforecut": true, "clientWidth": true, "ondragleave": true, "clientTop": true, "oncopy": true, "onmousewheel": true, "offsetHeight": true, "onbeforepaste": true, "onchange": true, "oninvalid": true, "onabort": true, "onload": true, "oninput": true, "onpaste": true, "onmouseout": true, "ondragover": true, "clientLeft": true, "scrollWidth": true, "firstElementChild": true, "ontouchend": true, "onselect": true, "offsetLeft": true, "onclick": true, "offsetTop": true, "onmousemove": true, "onfocus": true, "ondrag": true, "style": true, "onwebkitfullscreenchange": true, "onblur": true, "onsubmit": true, "ondragstart": true, "onmouseup": true, "ondrop": true, "onkeypress": true, "nextElementSibling": true, "onkeydown": true, "scrollLeft": true, "onmouseover": true, "onbeforecopy": true, "onmousedown": true, "scrollHeight": true, "onsearch": true, "oncontextmenu": true, "onscroll": true, "ondragend": true, "ontouchcancel": true, "ontouchmove": true, "onselectstart": true, "lastElementChild": true, "clientHeight": true, "ontouchstart": true, "oncut": true, "previousElementSibling": true, "onkeyup": true, "scrollTop": true, "ondblclick": true, "offsetWidth": true}, "constants": {}, "methods": {"removeAttributeNS": true, "removeAttribute": true, "getAttribute": true, "focus": true, "hasAttributeNS": true, "setAttributeNS": true, "scrollIntoViewIfNeeded": true, "getAttributeNS": true, "removeAttributeNode": true, "getAttributeNode": true, "getBoundingClientRect": true, "getElementsByClassName": true, "blur": true, "getClientRects": true, "setAttributeNodeNS": true, "getElementsByTagName": true, "getElementsByTagNameNS": true, "hasAttribute": true, "scrollByPages": true, "querySelector": true, "webkitMatchesSelector": true, "scrollByLines": true, "scrollIntoView": true, "setAttribute": true, "querySelectorAll": true, "getAttributeNodeNS": true, "setAttributeNode": true}}, "SVGPathSegLinetoHorizontalAbs": {"constructors": {}, "properties": {"x": true}, "constants": {}, "methods": {}}, "IDBDatabaseError": {"constructors": {}, "properties": {"message": true, "code": true}, "constants": {}, "methods": {}}, "SVGFEFloodElement": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "Entry": {"constructors": {}, "properties": {"fullPath": true, "isFile": true, "isDirectory": true, "name": true, "filesystem": true}, "constants": {}, "methods": {"moveTo": true, "getParent": true, "getMetadata": true, "toURL": true, "remove": true, "copyTo": true}}, "IDBObjectStore": {"constructors": {}, "properties": {"transaction": true, "name": true, "keyPath": true}, "constants": {}, "methods": {"deleteIndex": true, "index": true, "get": true, "clear": true, "add": true, "openCursor": true, "put": true, "createIndex": true, "delete": true}}, "BiquadFilterNode": {"constructors": {}, "properties": {"PEAKING": true, "ALLPASS": true, "HIGHPASS": true, "Q": true, "frequency": true, "BANDPASS": true, "LOWPASS": true, "HIGHSHELF": true, "NOTCH": true, "type": true, "LOWSHELF": true, "gain": true}, "constants": {}, "methods": {}}, "IDBVersionChangeRequest": {"constructors": {}, "properties": {"onblocked": true}, "constants": {}, "methods": {}}, "HTMLParamElement": {"constructors": {}, "properties": {"valueType": true, "type": true, "name": true, "value": true}, "constants": {}, "methods": {}}, "SVGTitleElement": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "SVGGlyphElement": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}, "SVGFEComponentTransferElement": {"constructors": {}, "properties": {"in1": true}, "constants": {}, "methods": {}}, "DOMFormData": {"constructors": {}, "properties": {}, "constants": {}, "methods": {"append": true}}, "SVGAltGlyphItemElement": {"constructors": {}, "properties": {}, "constants": {}, "methods": {}}}
\ No newline at end of file
diff --git a/utils/apidoc/mdn/data/domTypes.json b/utils/apidoc/mdn/data/domTypes.json
deleted file mode 100644
index 3b978f3..0000000
--- a/utils/apidoc/mdn/data/domTypes.json
+++ /dev/null
@@ -1 +0,0 @@
-["AbstractWorker", "ArrayBuffer", "ArrayBufferView", "Attr", "AudioBuffer", "AudioBufferSourceNode", "AudioChannelMerger", "AudioChannelSplitter", "AudioContext", "AudioDestinationNode", "AudioGain", "AudioGainNode", "AudioListener", "AudioNode", "AudioPannerNode", "AudioParam", "AudioProcessingEvent", "AudioSourceNode", "BarInfo", "BeforeLoadEvent", "BiquadFilterNode", "Blob", "CDATASection", "CSSCharsetRule", "CSSFontFaceRule", "CSSImportRule", "CSSMediaRule", "CSSPageRule", "CSSPrimitiveValue", "CSSRule", "CSSRuleList", "CSSStyleDeclaration", "CSSStyleRule", "CSSStyleSheet", "CSSUnknownRule", "CSSValue", "CSSValueList", "CanvasGradient", "CanvasPattern", "CanvasPixelArray", "CanvasRenderingContext", "CanvasRenderingContext2D", "CharacterData", "ClientRect", "ClientRectList", "Clipboard", "CloseEvent", "Comment", "CompositionEvent", "Console", "ConvolverNode", "Coordinates", "Counter", "Crypto", "CustomEvent", "DOMApplicationCache", "DOMException", "DOMFileSystem", "DOMFileSystemSync", "DOMFormData", "DOMImplementation", "DOMMimeType", "DOMMimeTypeArray", "DOMParser", "DOMPlugin", "DOMPluginArray", "DOMSelection", "DOMSettableTokenList", "DOMTokenList", "DOMURL", "DOMWindow", "DataTransferItem", "DataTransferItemList", "DataView", "Database", "DatabaseSync", "DedicatedWorkerContext", "DelayNode", "DeviceMotionEvent", "DeviceOrientationEvent", "DirectoryEntry", "DirectoryEntrySync", "DirectoryReader", "DirectoryReaderSync", "Document", "DocumentFragment", "DocumentType", "DynamicsCompressorNode", "Element", "ElementTimeControl", "ElementTraversal", "Entity", "EntityReference", "Entry", "EntryArray", "EntryArraySync", "EntrySync", "ErrorEvent", "Event", "EventException", "EventSource", "EventTarget", "File", "FileEntry", "FileEntrySync", "FileError", "FileException", "FileList", "FileReader", "FileReaderSync", "FileWriter", "FileWriterSync", "Float32Array", "Float64Array", "Geolocation", "Geoposition", "HTMLAllCollection", "HTMLAnchorElement", "HTMLAppletElement", "HTMLAreaElement", "HTMLAudioElement", "HTMLBRElement", "HTMLBaseElement", "HTMLBaseFontElement", "HTMLBodyElement", "HTMLButtonElement", "HTMLCanvasElement", "HTMLCollection", "HTMLDListElement", "HTMLDataListElement", "HTMLDetailsElement", "HTMLDirectoryElement", "HTMLDivElement", "HTMLDocument", "HTMLElement", "HTMLEmbedElement", "HTMLFieldSetElement", "HTMLFontElement", "HTMLFormElement", "HTMLFrameElement", "HTMLFrameSetElement", "HTMLHRElement", "HTMLHeadElement", "HTMLHeadingElement", "HTMLHtmlElement", "HTMLIFrameElement", "HTMLImageElement", "HTMLInputElement", "HTMLIsIndexElement", "HTMLKeygenElement", "HTMLLIElement", "HTMLLabelElement", "HTMLLegendElement", "HTMLLinkElement", "HTMLMapElement", "HTMLMarqueeElement", "HTMLMediaElement", "HTMLMenuElement", "HTMLMetaElement", "HTMLMeterElement", "HTMLModElement", "HTMLOListElement", "HTMLObjectElement", "HTMLOptGroupElement", "HTMLOptionElement", "HTMLOptionsCollection", "HTMLOutputElement", "HTMLParagraphElement", "HTMLParamElement", "HTMLPreElement", "HTMLProgressElement", "HTMLQuoteElement", "HTMLScriptElement", "HTMLSelectElement", "HTMLSourceElement", "HTMLSpanElement", "HTMLStyleElement", "HTMLTableCaptionElement", "HTMLTableCellElement", "HTMLTableColElement", "HTMLTableElement", "HTMLTableRowElement", "HTMLTableSectionElement", "HTMLTextAreaElement", "HTMLTitleElement", "HTMLTrackElement", "HTMLUListElement", "HTMLUnknownElement", "HTMLVideoElement", "HashChangeEvent", "HighPass2FilterNode", "History", "IDBAny", "IDBCursor", "IDBCursorWithValue", "IDBDatabase", "IDBDatabaseError", "IDBDatabaseException", "IDBFactory", "IDBIndex", "IDBKey", "IDBKeyRange", "IDBObjectStore", "IDBRequest", "IDBTransaction", "IDBVersionChangeEvent", "IDBVersionChangeRequest", "ImageData", "InjectedScriptHost", "InspectorFrontendHost", "Int16Array", "Int32Array", "Int8Array", "JavaScriptAudioNode", "JavaScriptCallFrame", "KeyboardEvent", "Location", "LowPass2FilterNode", "MediaElementAudioSourceNode", "MediaError", "MediaList", "MediaQueryList", "MediaQueryListListener", "MemoryInfo", "MessageChannel", "MessageEvent", "MessagePort", "Metadata", "MouseEvent", "MutationCallback", "MutationEvent", "MutationRecord", "NamedNodeMap", "Navigator", "NavigatorUserMediaError", "NavigatorUserMediaSuccessCallback", "Node", "NodeFilter", "NodeIterator", "NodeList", "NodeSelector", "Notation", "Notification", "NotificationCenter", "OESStandardDerivatives", "OESTextureFloat", "OESVertexArrayObject", "OfflineAudioCompletionEvent", "OperationNotAllowedException", "OverflowEvent", "PageTransitionEvent", "Performance", "PerformanceNavigation", "PerformanceTiming", "PopStateEvent", "PositionError", "ProcessingInstruction", "ProgressEvent", "RGBColor", "Range", "RangeException", "RealtimeAnalyserNode", "Rect", "SQLError", "SQLException", "SQLResultSet", "SQLResultSetRowList", "SQLTransaction", "SQLTransactionSync", "SVGAElement", "SVGAltGlyphDefElement", "SVGAltGlyphElement", "SVGAltGlyphItemElement", "SVGAngle", "SVGAnimateColorElement", "SVGAnimateElement", "SVGAnimateMotionElement", "SVGAnimateTransformElement", "SVGAnimatedAngle", "SVGAnimatedBoolean", "SVGAnimatedEnumeration", "SVGAnimatedInteger", "SVGAnimatedLength", "SVGAnimatedLengthList", "SVGAnimatedNumber", "SVGAnimatedNumberList", "SVGAnimatedPreserveAspectRatio", "SVGAnimatedRect", "SVGAnimatedString", "SVGAnimatedTransformList", "SVGAnimationElement", "SVGCircleElement", "SVGClipPathElement", "SVGColor", "SVGComponentTransferFunctionElement", "SVGCursorElement", "SVGDefsElement", "SVGDescElement", "SVGDocument", "SVGElement", "SVGElementInstance", "SVGElementInstanceList", "SVGEllipseElement", "SVGException", "SVGExternalResourcesRequired", "SVGFEBlendElement", "SVGFEColorMatrixElement", "SVGFEComponentTransferElement", "SVGFECompositeElement", "SVGFEConvolveMatrixElement", "SVGFEDiffuseLightingElement", "SVGFEDisplacementMapElement", "SVGFEDistantLightElement", "SVGFEDropShadowElement", "SVGFEFloodElement", "SVGFEFuncAElement", "SVGFEFuncBElement", "SVGFEFuncGElement", "SVGFEFuncRElement", "SVGFEGaussianBlurElement", "SVGFEImageElement", "SVGFEMergeElement", "SVGFEMergeNodeElement", "SVGFEMorphologyElement", "SVGFEOffsetElement", "SVGFEPointLightElement", "SVGFESpecularLightingElement", "SVGFESpotLightElement", "SVGFETileElement", "SVGFETurbulenceElement", "SVGFilterElement", "SVGFilterPrimitiveStandardAttributes", "SVGFitToViewBox", "SVGFontElement", "SVGFontFaceElement", "SVGFontFaceFormatElement", "SVGFontFaceNameElement", "SVGFontFaceSrcElement", "SVGFontFaceUriElement", "SVGForeignObjectElement", "SVGGElement", "SVGGlyphElement", "SVGGlyphRefElement", "SVGGradientElement", "SVGHKernElement", "SVGImageElement", "SVGLangSpace", "SVGLength", "SVGLengthList", "SVGLineElement", "SVGLinearGradientElement", "SVGLocatable", "SVGMPathElement", "SVGMarkerElement", "SVGMaskElement", "SVGMatrix", "SVGMetadataElement", "SVGMissingGlyphElement", "SVGNumber", "SVGNumberList", "SVGPaint", "SVGPathElement", "SVGPathSeg", "SVGPathSegArcAbs", "SVGPathSegArcRel", "SVGPathSegClosePath", "SVGPathSegCurvetoCubicAbs", "SVGPathSegCurvetoCubicRel", "SVGPathSegCurvetoCubicSmoothAbs", "SVGPathSegCurvetoCubicSmoothRel", "SVGPathSegCurvetoQuadraticAbs", "SVGPathSegCurvetoQuadraticRel", "SVGPathSegCurvetoQuadraticSmoothAbs", "SVGPathSegCurvetoQuadraticSmoothRel", "SVGPathSegLinetoAbs", "SVGPathSegLinetoHorizontalAbs", "SVGPathSegLinetoHorizontalRel", "SVGPathSegLinetoRel", "SVGPathSegLinetoVerticalAbs", "SVGPathSegLinetoVerticalRel", "SVGPathSegList", "SVGPathSegMovetoAbs", "SVGPathSegMovetoRel", "SVGPatternElement", "SVGPoint", "SVGPointList", "SVGPolygonElement", "SVGPolylineElement", "SVGPreserveAspectRatio", "SVGRadialGradientElement", "SVGRect", "SVGRectElement", "SVGRenderingIntent", "SVGSVGElement", "SVGScriptElement", "SVGSetElement", "SVGStopElement", "SVGStringList", "SVGStylable", "SVGStyleElement", "SVGSwitchElement", "SVGSymbolElement", "SVGTRefElement", "SVGTSpanElement", "SVGTests", "SVGTextContentElement", "SVGTextElement", "SVGTextPathElement", "SVGTextPositioningElement", "SVGTitleElement", "SVGTransform", "SVGTransformList", "SVGTransformable", "SVGURIReference", "SVGUnitTypes", "SVGUseElement", "SVGVKernElement", "SVGViewElement", "SVGViewSpec", "SVGZoomAndPan", "SVGZoomEvent", "Screen", "ScriptProfile", "ScriptProfileNode", "SharedWorker", "SharedWorkercontext", "SpeechInputEvent", "SpeechInputResult", "SpeechInputResultList", "Storage", "StorageEvent", "StorageInfo", "StyleMedia", "StyleSheet", "StyleSheetList", "Text", "TextEvent", "TextMetrics", "TextTrack", "TextTrackCue", "TextTrackCueList", "TimeRanges", "Touch", "TouchEvent", "TouchList", "TreeWalker", "UIEvent", "Uint16Array", "Uint32Array", "Uint8Array", "ValidityState", "VoidCallback", "WaveShaperNode", "WebGLActiveInfo", "WebGLBuffer", "WebGLContextAttributes", "WebGLContextEvent", "WebGLDebugRendererInfo", "WebGLDebugShaders", "WebGLFramebuffer", "WebGLProgram", "WebGLRenderbuffer", "WebGLRenderingContext", "WebGLShader", "WebGLTexture", "WebGLUniformLocation", "WebGLVertexArrayObjectOES", "WebKitAnimation", "WebKitAnimationEvent", "WebKitAnimationList", "WebKitBlobBuilder", "WebKitCSSFilterValue", "WebKitCSSKeyframeRule", "WebKitCSSKeyframesRule", "WebKitCSSMatrix", "WebKitCSSTransformValue", "WebKitFlags", "WebKitLoseContext", "WebKitMutationObserver", "WebKitPoint", "WebKitTransitionEvent", "WebSocket", "WheelEvent", "Worker", "WorkerContext", "WorkerLocation", "WorkerNavigator", "XMLHttpRequest", "XMLHttpRequestException", "XMLHttpRequestProgressEvent", "XMLHttpRequestUpload", "XMLSerializer", "XPathEvaluator", "XPathException", "XPathExpression", "XPathNSResolver", "XPathResult", "XSLTProcessor", "AudioBufferCallback", "DatabaseCallback", "EntriesCallback", "EntryCallback", "ErrorCallback", "FileCallback", "FileSystemCallback", "FileWriterCallback", "MetadataCallback", "NavigatorUserMediaErrorCallback", "PositionCallback", "PositionErrorCallback", "SQLStatementCallback", "SQLStatementErrorCallback", "SQLTransactionCallback", "SQLTransactionErrorCallback", "SQLTransactionSyncCallback", "StorageInfoErrorCallback", "StorageInfoQuotaCallback", "StorageInfoUsageCallback", "StringCallback"]
\ No newline at end of file
diff --git a/utils/apidoc/mdn/database.json b/utils/apidoc/mdn/database.json
deleted file mode 100644
index 5875194..0000000
--- a/utils/apidoc/mdn/database.json
+++ /dev/null
@@ -1 +0,0 @@
-{"ErrorCallback":{"title":"JS_ReportErrorNumber","members":[],"srcUrl":"https://developer.mozilla.org/en/SpiderMonkey/JSAPI_Reference/JS_ReportErrorNumber","skipped":true,"cause":"Suspect title"},"SVGAnimatedLength":{"title":"SVGAnimatedLength","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody>\n</table>\n</div>\n<div id=\"compat-mobile\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody>\n</table>\n</div>","summary":"The <code>SVGAnimatedLength</code> interface is used for attributes of basic type <a title=\"https://developer.mozilla.org/en/SVG/Content_type#Length\" rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Content_type#Length\">&lt;length&gt;</a> which can be animated.","members":[{"name":"baseVal","help":"The base value of the given attribute before applying any animations.","obsolete":false},{"name":"animVal","help":"If the given attribute or property is being animated, contains the current animated value of the attribute or property. If the given attribute or property is not currently being animated, contains the same value as <code>baseVal</code>.","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/Document_Object_Model_(DOM)/SVGAnimatedLength"},"HTMLScriptElement":{"title":"script","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari</th> </tr> <tr> <td>Basic support</td> <td>1.0</td> <td>1.0 (1.7 or earlier)\n</td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> <tr> <td><code>async</code> attribute</td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td>3.6 (1.9.2)\n</td> <td>10</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> <tr> <td><code>defer</code> attribute</td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td>3.5 (1.9.1)\n</td> <td>4</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td>1.0 (1.0)\n</td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> <tr> <td><code>async</code> attribute</td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td>1.0 (1.0)\n</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> <tr> <td><code>defer</code> attribute</td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td>1.0 (1.0)\n</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> </tbody> </table>\n</div>","examples":["&lt;!-- HTML4 and (x)HTML --&gt;\n&lt;script type=\"text/javascript\" src=\"javascript.js\"&gt;\n\n&lt;!-- HTML5 --&gt;\n&lt;script src=\"javascript.js\"&gt;&lt;/script&gt;"],"srcUrl":"https://developer.mozilla.org/En/HTML/Element/Script","summary":"<p>The <code>script</code> element is used to embed or reference an executable script within an <abbr>HTML</abbr> or <abbr>XHTML</abbr> document.</p>\n<p>Scripts without <code>async</code> or <code>defer</code> attributes are fetched and executed immediately, before the browser continues to parse the page.</p>","members":[{"obsolete":false,"url":"","name":"language","help":"Like the <code>type</code> attribute, this attribute identifies the scripting language in use. Unlike the <code>type</code> attribute, however, this attribute’s possible values were never standardized. The <code>type</code> attribute should be used instead."},{"obsolete":false,"url":"","name":"defer","help":"This Boolean attribute is set to indicate to a browser that the script is meant to be executed after the document has been parsed. Since this feature hasn't yet been implemented by all other major browsers, authors should not assume that the script’s execution will actually be deferred. Never call <code>document.write()</code> from a <code>defer</code> script (since Gecko 1.9.2, this will blow away the document). The <code>defer</code> attribute shouldn't be used on scripts that don't have the <code>src</code> attribute. Since Gecko 1.9.2, the <code>defer</code> attribute is ignored on scripts that don't have the <code>src</code> attribute. However, in Gecko 1.9.1 even inline scripts are deferred if the <code>defer</code> attribute is set."},{"obsolete":false,"url":"","name":"src","help":"This attribute specifies the <abbr>URI</abbr> of an external script; this can be used as an alternative to embedding a script directly within a document. <code>script</code> elements with an <code>src</code> attribute specified should not have a script embedded within its tags."},{"obsolete":false,"url":"","name":"async","help":"Set this Boolean attribute to indicate that the browser should, if possible, execute the script asynchronously. It has no effect on inline scripts (i.e., scripts that don't have the <strong>src</strong> attribute). In older browsers that don't support the <strong>async</strong> attribute, parser-inserted scripts block the parser; script-inserted scripts execute asynchronously in IE and WebKit, but synchronously in Opera and pre-4.0 Firefox. In Firefox 4.0, the <code>async</code> DOM&nbsp;property defaults to <code>true</code> for script-created scripts, so the default behavior matches the behavior of IE&nbsp;and WebKit. To request script-inserted external scripts be executed in the insertion order in browsers where the <code>document.createElement(\"script\").async</code> evaluates to <code>true</code> (such as Firefox 4.0), set <code>.async=false</code> on the scripts you want to maintain order. Never call <code>document.write()</code> from an <code>async</code> script. In Gecko 1.9.2, calling <code>document.write()</code> has an unpredictable effect. In Gecko 2.0, calling <code>document.write()</code> from an <code>async</code> script has no effect (other than printing a warning to the error console)."},{"obsolete":false,"url":"","name":"type","help":"This attribute identifies the scripting language of code embedded within a <code>script</code> element or referenced via the element’s <code>src</code> attribute. This is specified as a <abbr title=\"Multi-purpose Internet Mail Extensions\">MIME</abbr> type; examples of supported <abbr title=\"Multi-purpose Internet Mail Extensions\">MIME</abbr> types include <code>text/javascript</code>, <code>text/ecmascript</code>, <code>application/javascript</code>, and <code>application/ecmascript</code>. If this attribute is absent, the script is treated as JavaScript."}]},"WebKitTransitionEvent":{"title":"Recent changes from mechaxl","members":[],"srcUrl":"https://developer.mozilla.org/Special:Contributions?target=mechaxl","skipped":true,"cause":"Suspect title"},"Int32Array":{"title":"Int32Array","srcUrl":"https://developer.mozilla.org/en/JavaScript_typed_arrays/Int32Array","seeAlso":"<li><a class=\"link-https\" title=\"https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/doc/spec/TypedArray-spec.html\" rel=\"external\" href=\"https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/doc/spec/TypedArray-spec.html\" target=\"_blank\">Typed Array Specification</a></li> <li><a title=\"en/JavaScript typed arrays\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays\">JavaScript typed arrays</a></li>","summary":"<p>The <code>Int32Array</code> type represents an array of twos-complement 32-bit signed integers.</p>\n<p>Once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).</p>","constructor":"<div class=\"note\"><strong>Note:</strong> In these methods, <code><em>TypedArray</em></code> represents any of the <a title=\"en/JavaScript typed arrays/ArrayBufferView#Typed array subclasses\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/ArrayBufferView#Typed_array_subclasses\">typed array object types</a>.</div>\n<table class=\"standard-table\"> <tbody> <tr> <td><code>Int32Array <a title=\"en/JavaScript typed arrays/Int32Array#Int32Array()\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/Int32Array#Int32Array()\">Int32Array</a>(unsigned long length);<br> </code></td> </tr> <tr> <td><code>Int32Array </code><code><a title=\"en/JavaScript typed arrays/Int32Array#Int32Array()\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/Int32Array#Int32Array%28%29\">Int32Array</a></code><code>(<em>TypedArray</em> array);<br> </code></td> </tr> <tr> <td><code>Int32Array </code><code><a title=\"en/JavaScript typed arrays/Int32Array#Int32Array()\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/Int32Array#Int32Array%28%29\">Int32Array</a></code><code>(sequence&lt;type&gt; array);<br> </code></td> </tr> <tr> <td><code>Int32Array </code><code><a title=\"en/JavaScript typed arrays/Int32Array#Int32Array()\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/Int32Array#Int32Array%28%29\">Int32Array</a></code><code>(ArrayBuffer buffer, optional unsigned long byteOffset, optional unsigned long length);<br> </code></td> </tr> </tbody>\n</table><p>Returns a new <code>Int32Array</code> object.</p>\n<pre>Int32Array Int32Array(\n&nbsp; unsigned long length\n);\n\nInt32Array Int32Array(\n&nbsp; <em>TypedArray</em> array\n);\n\nInt32Array Int32Array(\n&nbsp; sequence&lt;type&gt; array\n);\n\nInt32Array Int32Array(\n&nbsp; ArrayBuffer buffer,\n&nbsp; optional unsigned long byteOffset,\n&nbsp; optional unsigned long length\n);\n</pre>\n<div id=\"section_7\"><span id=\"Parameters\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>length</code></dt> <dd>The number of elements in the byte array. If unspecified, length of the array view will match the buffer's length.</dd> <dt><code>array</code></dt> <dd>An object of any of the typed array types (such as <code>Int16Array</code>), or a sequence of objects of a particular type, to copy into a new <a title=\"en/JavaScript typed arrays/ArrayBuffer\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/ArrayBuffer\"><code>ArrayBuffer</code></a>. Each value in the source array is converted to a 32-bit signed integer before being copied into the new array.</dd> <dt><code>buffer</code></dt> <dd>An existing <a title=\"en/JavaScript typed arrays/ArrayBuffer\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/ArrayBuffer\"><code>ArrayBuffer</code></a> to use as the storage for the new <code>Int32Array</code> object.</dd> <dt><code>byteOffset<br> </code></dt> <dd>The offset, in bytes, to the first byte in the specified buffer for the new view to reference. If not specified, the <code>Int32Array</code>'s view of the buffer will start with the first byte.</dd>\n</dl>\n</div><div id=\"section_8\"><span id=\"Return_value\"></span><h6 class=\"editable\">Return value</h6>\n<p>A new <code>Int32Array</code> object representing the specified data buffer.</p>\n</div>","members":[{"name":"subarray","help":"<p>Returns a new <code>Int32Array</code> view on the <a title=\"en/JavaScript typed arrays/ArrayBuffer\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/ArrayBuffer\"><code>ArrayBuffer</code></a> store for this <code>Int32Array</code> object.</p>\n\n<div id=\"section_15\"><span id=\"Parameters_3\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>begin</code></dt> <dd>The offset to the first element in the array to be referenced by the new <code>Int32Array</code> object.</dd> <dt><code>end</code> \n<span title=\"\">Optional</span>\n</dt> <dd>The offset to one past the last element in the array to be referenced by the new <code>Int32Array</code> object; if not specified, all elements from the one specified by <code>begin</code> to the end of the array are included in the new view.</dd>\n</dl>\n</div><div id=\"section_16\"><span id=\"Notes_2\"></span><h6 class=\"editable\">Notes</h6>\n<p>The range specified by <code>begin</code> and <code>end</code> is clamped to the valid index range for the current array; if the computed length of the new array would be negative, it's clamped to zero. If either <code>begin</code> or <code>end</code> is negative, it refers to an index from the end of the array instead of from the beginning.</p>\n<div class=\"note\"><strong>Note:</strong> Keep in mind that this is creating a new view on the existing buffer; changes to the new object's contents will impact the original object and vice versa.</div>\n</div>","idl":"<pre>Int32Array subarray(\n&nbsp; long begin,\n&nbsp; optional long end\n);\n</pre>","obsolete":false},{"name":"set","help":"<p>Sets multiple values in the typed array, reading input values from a specified array.</p>\n\n<div id=\"section_13\"><span id=\"Parameters_2\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>array</code></dt> <dd>An array from which to copy values. All values from the source array are copied into the target array, unless the length of the source array plus the offset exceeds the length of the target array, in which case an exception is thrown. If the source array is a typed array, the two arrays may share the same underlying <code><a title=\"en/JavaScript typed arrays/ArrayBuffer\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/ArrayBuffer\">ArrayBuffer</a></code>; the browser will intelligently copy the source range of the buffer to the destination range.</dd> <dt>offset \n<span title=\"\">Optional</span>\n</dt> <dd>The offset into the target array at which to begin writing values from the source <code>array</code>. If you omit this value, 0 is assumed (that is, the source <code>array</code> will overwrite values in the target array starting at index 0).</dd>\n</dl>\n</div>","idl":"<pre>void set(\n&nbsp; <em>TypedArray</em> array,\n&nbsp; optional unsigned long offset\n);\n\nvoid set(\n&nbsp; type[] array,\n&nbsp; optional unsigned long offset\n);\n</pre>","obsolete":false},{"name":"BYTES_PER_ELEMENT","help":"The size, in bytes, of each array element.","obsolete":false},{"name":"length","help":"The number of entries in the array. <strong>Read only.</strong>","obsolete":false}]},"MediaQueryList":{"title":"MediaQueryList","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td>6.0 (6.0)\n</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody>\n</table>\n</div>\n<div id=\"compat-mobile\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody>\n</table>\n</div>","srcUrl":"https://developer.mozilla.org/en/DOM/MediaQueryList","specification":"The CSSOM&nbsp;View Module:&nbsp;The&nbsp;MediaQueryList Interface","seeAlso":"<li><a title=\"En/CSS/Media queries\" rel=\"internal\" href=\"https://developer.mozilla.org/En/CSS/Media_queries\">Media queries</a></li> <li><a title=\"en/CSS/Using media queries from code\" rel=\"internal\" href=\"https://developer.mozilla.org/en/CSS/Using_media_queries_from_code\">Using media queries from code</a></li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/window.matchMedia\">window.matchMedia()</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/MediaQueryListListener\">MediaQueryListListener</a></code>\n</li>","summary":"<div><strong>DRAFT</strong>\n<div>This page is not complete.</div>\n</div>\n\n<p></p>\n<p>A <code>MediaQueryList</code> object maintains a list of <a title=\"En/CSS/Media queries\" rel=\"internal\" href=\"https://developer.mozilla.org/En/CSS/Media_queries\">media queries</a> on a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/document\">document</a></code>\n, and handles sending notifications to listeners when the media queries on the document change.</p>\n<p>This makes it possible to observe a document to detect when its media queries change, instead of polling the values periodically, if you need to programmatically detect changes to the values of media queries on a document.</p>","members":[{"name":"addListener","help":"<p>Adds a new listener to the media query list. If the specified listener is already in the list, this method has no effect.</p>\n\n<div id=\"section_5\"><span id=\"Parameters\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>listener</code></dt> <dd>The <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/MediaQueryListListener\">MediaQueryListListener</a></code>\n to invoke when the media query's evaluated result changes.</dd> <div id=\"section_6\"><span id=\"removeListener()\"></span></div></dl></div>","idl":"<pre>void addListener(\n&nbsp; MediaQueryListListener listener\n); \n</pre>","obsolete":false},{"name":"removeListener","help":"<div id=\"section_5\"><dl><div id=\"section_6\"><p>Removes a listener from the media query list. Does nothing if the specified listener isn't already in the list.</p> \n</div></dl>\n</div><div id=\"section_7\"><span id=\"Parameters_2\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>listener</code></dt> <dd>The <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/MediaQueryListListener\">MediaQueryListListener</a></code>\n to stop calling on changes to the media query's evaluated result.</dd>\n</dl>\n</div>","idl":"<pre>void removeListener(\n&nbsp; MediaQueryListListener listener\n); \n</pre>","obsolete":false},{"name":"matches","help":"<code>true</code> if the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/document\">document</a></code>\n currently matches the media query list; otherwise <code>false</code>. <strong>Read only.</strong>","obsolete":false},{"name":"media","help":"The serialized media query list.","obsolete":false}]},"DOMPlugin":{"title":"Plugin","summary":"The <code>Plugin</code> interface provides information about a browser plugin.","members":[{"obsolete":false,"url":"https://developer.mozilla.org/Article_not_found?uri=en/DOM/Plugin.item","name":"item","help":"Returns the MIME&nbsp;type of a supported content type, given the index number into a list of supported types."},{"obsolete":false,"url":"https://developer.mozilla.org/Article_not_found?uri=en/DOM/Plugin.namedItem","name":"namedItem","help":"Returns the MIME&nbsp;type of a supported item."},{"url":"https://developer.mozilla.org/Article_not_found?uri=en/DOM/Plugin.description","name":"description","help":"A human readable description of the plugin. <strong>Read only.</strong>","obsolete":false},{"url":"https://developer.mozilla.org/Article_not_found?uri=en/DOM/Plugin.filename","name":"filename","help":"The filename of the plugin file. <strong>Read only.</strong>","obsolete":false},{"url":"https://developer.mozilla.org/Article_not_found?uri=en/DOM/Plugin.name","name":"name","help":"The name of the plugin. <strong>Read only.</strong>","obsolete":false},{"url":"https://developer.mozilla.org/Article_not_found?uri=en/DOM/Plugin.version","name":"version","help":"The plugin's version number string. <strong>Read only.</strong>","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/DOM/Plugin"},"HTMLDListElement":{"title":"HTMLDListElement","summary":"DOM&nbsp;definition list elements expose the <a title=\"http://www.w3.org/TR/html5/grouping-content.html#htmldlistelement\" class=\" external\" rel=\"external nofollow\" href=\"http://www.w3.org/TR/html5/grouping-content.html#htmldlistelement\" target=\"_blank\">HTMLDListElement</a> (or <span><a rel=\"custom nofollow\" href=\"https://developer.mozilla.org/en/HTML\">HTML 4</a></span> <a class=\" external\" rel=\"external nofollow\" href=\"http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-52368974\" title=\"http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-52368974\" target=\"_blank\"><code>HTMLDListElement</code></a>) interface, which provides special properties (beyond the regular <a rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/element\">element</a> object interface they also have available to them by inheritance) for manipulating definition list elements. In \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span>, this interface inherits from HTMLElement, but defines no additional members.","members":[{"name":"compact","help":"Indicates that spacing between list items should be reduced.","obsolete":true}],"srcUrl":"https://developer.mozilla.org/en/DOM/HTMLDListElement"},"SVGRect":{"title":"SVGRect","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>","summary":"<p>The <code>SVGRect</code> represents rectangular geometry. Rectangles are defined as consisting of a (x,y) coordinate pair identifying a minimum X value, a minimum Y value, and a width and height, which are usually constrained to be non-negative.</p>\n<p>An <code>SVGRect</code> object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown.</p>","members":[{"name":"width","help":"The <em>width</em> coordinate of the rectangle, in user units.","obsolete":false},{"name":"height","help":"The <em>height</em> coordinate of the rectangle, in user units.","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/DOM/SVGRect"},"HTMLAppletElement":{"title":"applet","examples":["&lt;applet code=\"game.class\" align=\"left\" archive=\"game.zip\" height=\"250\" width=\"350\"&gt;\n\n&lt;param name=\"difficulty\" value=\"easy\"&gt;\n\n&lt;b&gt;Sorry, you need Java to play this game.&lt;/b&gt;\n\n&lt;/applet&gt;\n"],"summary":"Obsolete","members":[{"obsolete":false,"url":"","name":"datafld","help":"This attribute, supported by Internet Explorer 4 and higher, specifies the column name from the data source object that supplies the bound data. This attribute might be used to specify the various&nbsp;<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/param\">&lt;param&gt;</a></code>\n elements passed to the Java applet."},{"obsolete":false,"url":"","name":"width","help":"This attribute specifies in pixels the width that the applet needs."},{"obsolete":false,"url":"","name":"object","help":"This attribute specifies the URL of a serialized representation of an applet."},{"obsolete":false,"url":"","name":"code","help":"This attribute specifies the URL of the applet's class file to be loaded and executed. Applet filenames are identified by a .class filename extension. The URL specified by code might be relative to the <code>codebase</code> attribute."},{"obsolete":false,"url":"","name":"codebase","help":"This attribute gives the absolute or relative URL of the directory where applets' .class files referenced by the code attribute are stored."},{"obsolete":false,"url":"","name":"vspace","help":"This attribute specifies additional vertical space, in pixels, to be reserved above and below the applet."},{"obsolete":false,"url":"","name":"alt","help":"This attribute causes a descriptive text alternate to be displayed on browsers that do not support Java. Page designers should also remember that content enclosed within the <code>&lt;applet&gt;</code> element may also be rendered as alternative text."},{"obsolete":false,"url":"","name":"name","help":"This attribute assigns a name to the applet so that it can be identified by other resources; particularly scripts."},{"obsolete":false,"url":"","name":"align","help":"This attribute is used to position the applet on the page relative to content that might flow around it. The HTML 4.01 specification defines values of bottom, left, middle, right, and top, whereas Microsoft and Netscape also might support <strong>absbottom</strong>, <strong>absmiddle</strong>, <strong>baseline</strong>, <strong>center</strong>, and <strong>texttop</strong>."},{"obsolete":false,"url":"","name":"archive","help":"This attribute refers to an archived or compressed version of the applet and its associated class files, which might help reduce download time."},{"obsolete":false,"url":"","name":"height","help":"This attribute specifies the height, in pixels, that the applet needs."},{"obsolete":false,"url":"","name":"hspace","help":"This attribute specifies additional horizontal space, in pixels, to be reserved on either side of the applet."},{"obsolete":false,"url":"","name":"src","help":"As defined for Internet Explorer 4 and higher, this attribute specifies a URL for an associated file for the applet. The meaning and use is unclear and not part of the HTML standard."},{"obsolete":false,"url":"","name":"datasrc","help":"Like <code>datafld</code>, this attribute is used for data binding under Internet Explorer 4. It indicates the id of the data source object that supplies the data that is bound to the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/param\">&lt;param&gt;</a></code>\n elements associated with the applet."},{"obsolete":false,"url":"","name":"mayscript","help":"In the Netscape implementation, this attribute allows access to an applet by programs in a scripting language embedded in the document."}],"srcUrl":"https://developer.mozilla.org/en/HTML/Element/applet"},"SVGAnimatedPreserveAspectRatio":{"title":"SVGAnimatedPreserveAspectRatio","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>","summary":"The <code>SVGAnimatedPreserveAspectRatio</code> interface is used for attributes of type <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/SVGPreserveAspectRatio\">SVGPreserveAspectRatio</a></code>\n which can be animated.","members":[{"name":"baseVal","help":"The base value of the given attribute before applying any animations.","obsolete":false},{"name":"animVal","help":"A read only <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/SVGPreserveAspectRatio\">SVGPreserveAspectRatio</a></code>\n representing the current animated value of the given attribute. If the given attribute is not currently being animated, then the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/SVGPreserveAspectRatio\">SVGPreserveAspectRatio</a></code>\n will have the same contents as <code>baseVal</code>. The object referenced by <code>animVal</code> is always distinct from the one referenced by <code>baseVal</code>, even when the attribute is not animated.","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/DOM/SVGAnimatedPreserveAspectRatio"},"SVGPatternElement":{"title":"SVGPatternElement","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>","summary":"The <code>SVGPatternElement</code> interface corresponds to the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/pattern\">&lt;pattern&gt;</a></code>\n element.","members":[{"name":"patternUnits","help":"Corresponds to attribute \n<code><a rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Attribute/patternUnits\" class=\"new\">patternUnits</a></code> on the given <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/pattern\">&lt;pattern&gt;</a></code>\n element. Takes one of the constants defined in <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/SVGUnitTypes\" class=\"new\">SVGUnitTypes</a></code>\n.","obsolete":false},{"name":"patternContentUnits","help":"Corresponds to attribute \n<code><a rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Attribute/patternContentUnits\" class=\"new\">patternContentUnits</a></code> on the given <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/pattern\">&lt;pattern&gt;</a></code>\n element. Takes one of the constants defined in <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/SVGUnitTypes\" class=\"new\">SVGUnitTypes</a></code>\n.","obsolete":false},{"name":"patternTransform","help":"Corresponds to attribute \n<code><a rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Attribute/patternTransform\" class=\"new\">patternTransform</a></code> on the given <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/pattern\">&lt;pattern&gt;</a></code>\n element.","obsolete":false},{"name":"width","help":"Corresponds to attribute \n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Attribute/width\">width</a></code> on the given <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/pattern\">&lt;pattern&gt;</a></code>\n element.","obsolete":false},{"name":"height","help":"Corresponds to attribute \n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Attribute/height\">height</a></code> on the given <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/pattern\">&lt;pattern&gt;</a></code>\n element.","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/DOM/SVGPatternElement"},"SVGPathSegCurvetoCubicSmoothAbs":{"title":"SVGPathElement","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/SVGPathElement","skipped":true,"cause":"Suspect title"},"HTMLMenuElement":{"title":"menu","examples":["&lt;menu type=\"toolbar\"&gt;\n  &lt;li&gt;\n    &lt;menu label=\"File\"&gt;\n      &lt;button type=\"button\" onclick=\"new()\"&gt;New...&lt;/button&gt;\n      &lt;button type=\"button\" onclick=\"save()\"&gt;Save...&lt;/button&gt;\n    &lt;/menu&gt;\n  &lt;/li&gt;\n  &lt;li&gt;\n    &lt;menu label=\"Edit\"&gt;\n      &lt;button type=\"button\" onclick=\"cut()\"&gt;Cut...&lt;/button&gt;\n      &lt;button type=\"button\" onclick=\"copy()\"&gt;Copy...&lt;/button&gt;\n      &lt;button type=\"button\" onclick=\"paste()\"&gt;Paste...&lt;/button&gt;\n    &lt;/menu&gt;\n  &lt;/li&gt;\n&lt;/menu&gt;"],"srcUrl":"https://developer.mozilla.org/en/HTML/Element/menu","seeAlso":"<li>Other list-related HTML&nbsp;Elements: <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/ol\">&lt;ol&gt;</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/ul\">&lt;ul&gt;</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/li\">&lt;li&gt;</a></code>\n and the obsolete <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/dir\">&lt;dir&gt;</a></code>\n.</li> <li>The <code><a title=\"en/HTML/Global attributes#attr-contextmenu\" rel=\"internal\" href=\"https://developer.mozilla.org/en/HTML/Global_attributes#attr-contextmenu\">contextmenu</a></code> <a title=\"en/HTML/Global attributes\" rel=\"internal\" href=\"https://developer.mozilla.org/en/HTML/Global_attributes\">global attribute</a> can be used on an element to refer to the <code>id</code> of a <code>menu</code> with the <code>context</code> \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/menu#attr-type\">type</a></code>\n</li>","summary":"<p>The HTML <em>menu</em> element (<code>&lt;menu&gt;</code>) represents an unordered list of menu choices, or commands.</p>\n<p>There is no limitation to the depth and nesting of lists defined with the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/menu\">&lt;menu&gt;</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/ol\">&lt;ol&gt;</a></code>\n and <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/ul\">&lt;ul&gt;</a></code>\n elements.</p>\n<div class=\"note\"><strong>Usage note: </strong> The <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/menu\">&lt;menu&gt;</a></code>\n and <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/ul\">&lt;ul&gt;</a></code>\n both represent an unordered list of items. They differ in the way that the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/ul\">&lt;ul&gt;</a></code>\n element only contains items to display while the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/menu\">&lt;menu&gt;</a></code>\n element contains interactive items, to act on.</div>\n<div class=\"note\"><strong>Note</strong>: This element was deprecated in HTML4, but reintroduced in HTML5.</div>","members":[]},"MessageEvent":{"title":"MessageEvent","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td>4.0 (2.0)\n</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody>\n</table>\n</div>\n<div id=\"compat-mobile\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody>\n</table>\n</div>","srcUrl":"https://developer.mozilla.org/en/WebSockets/WebSockets_reference/MessageEvent","seeAlso":"WebSocket","summary":"<div><strong>DRAFT</strong>\n<div>This page is not complete.</div>\n</div>\n\n<p></p>\n<p>A <code>MessageEvent</code> is sent to clients using WebSockets when data is received from the server. This is delivered to the listener indicated by the <code>WebSocket</code> object's <code>onmessage</code> attribute.</p>","members":[{"name":"data","help":"The data from the server.","obsolete":false}]},"SVGFEDiffuseLightingElement":{"title":"feDiffuseLighting","seeAlso":"<li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/filter\">&lt;filter&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feBlend\">&lt;feBlend&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feColorMatrix\">&lt;feColorMatrix&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feComponentTransfer\">&lt;feComponentTransfer&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feComposite\">&lt;feComposite&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feConvolveMatrix\">&lt;feConvolveMatrix&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feDisplacementMap\">&lt;feDisplacementMap&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feDistantLight\">&lt;feDistantLight&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feFlood\">&lt;feFlood&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feGaussianBlur\">&lt;feGaussianBlur&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feImage\">&lt;feImage&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feMerge\">&lt;feMerge&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feMorphology\">&lt;feMorphology&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feOffset\">&lt;feOffset&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/fePointLight\">&lt;fePointLight&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feSpecularLighting\">&lt;feSpecularLighting&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feSpotLight\">&lt;feSpotLight&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feTile\">&lt;feTile&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feTurbulence\">&lt;feTurbulence&gt;</a></code>\n</li> <li><a title=\"en/SVG/Tutorial/Filter_effects\" rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Tutorial/Filter_effects\">SVG tutorial: Filter effects</a></li>","summary":"This filter takes in a light source and applies it to an image, using the alpha channel as a bump map.","members":[{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/kernelUnitLength","name":"kernelUnitLength","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/surfaceScale","name":"surfaceScale","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/class","name":"class","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/diffuseConstant","name":"diffuseConstant","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/in","name":"in","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/style","name":"style","help":"Specific attributes"}],"srcUrl":"https://developer.mozilla.org/en/SVG/Element/feDiffuseLighting"},"WebGLBuffer":{"title":"Using shaders to apply color in WebGL","members":[],"srcUrl":"https://developer.mozilla.org/en/WebGL/Using_shaders_to_apply_color_in_WebGL","skipped":true,"cause":"Suspect title"},"StorageEvent":{"title":"StorageEvent","seeAlso":"Specification","summary":"<div><div>\n\n<a rel=\"custom\" href=\"http://mxr.mozilla.org/mozilla-central/source/dom/interfaces/storage/nsIDOMStorageEvent.idl\"><code>dom/interfaces/storage/nsIDOMStorageEvent.idl</code></a><span><a rel=\"internal\" href=\"https://developer.mozilla.org/en/Interfaces/About_Scriptable_Interfaces\" title=\"en/Interfaces/About_Scriptable_Interfaces\">Scriptable</a></span></div><span>Describes an event occurring on HTML5 client-side storage data.</span><div><div>1.0</div><div>11.0</div><div></div><div>Introduced</div><div>Gecko 2.0</div><div title=\"Introduced in Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1)\n\"></div><div title=\"Last changed in Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1)\n\"></div></div>\n<div>Inherits from: <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsIDOMEvent\">nsIDOMEvent</a></code>\n<span>Last changed in Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1)\n</span></div></div>\n<p></p>\n<p>A <code>StorageEvent</code> is sent to a window when a storage area changes.</p>\n<div class=\"geckoVersionNote\">\n<p>\n</p><div class=\"geckoVersionHeading\">Gecko 2.0 note<div>(Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1)\n</div></div>\n<p></p>\n<p>Although this event existed prior to Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1)\n, it did not match the specification. The old event format is now represented by the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsIDOMStorageEventObsolete\">nsIDOMStorageEventObsolete</a></code>\n interface.</p>\n</div>","members":[{"name":"initStorageEvent","help":"<p>Initializes the event in a manner analogous to the similarly-named method in the DOM Events interfaces.</p>\n\n<div id=\"section_5\"><span id=\"Parameters\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>typeArg</code></dt> <dd>The name of the event.</dd> <dt><code>canBubbleArg</code></dt> <dd>A boolean indicating whether the event bubbles up through the DOM or not.</dd> <dt><code>cancelableArg</code></dt> <dd>A boolean indicating whether the event is cancelable.</dd> <dt><code>keyArg</code></dt> <dd>The key whose value is changing as a result of this event.</dd> <dt><code>oldValueArg</code></dt> <dd>The key's old value.</dd> <dt><code>newValueArg</code></dt> <dd>The key's new value.</dd> <dt><code>urlArg</code></dt> <dd>Missing Description</dd> <dt><code>storageAreaArg</code></dt> <dd>The DOM&nbsp;<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Storage\">Storage</a></code>\n object representing the storage area on which this event occurred.</dd>\n</dl></div>","idl":"<pre class=\"eval\">void initStorageEvent(\n  in DOMString typeArg,\n  in boolean canBubbleArg,\n  in boolean cancelableArg,\n  in DOMString keyArg,\n  in DOMString oldValueArg,\n  in DOMString newValueArg,\n  in DOMString urlArg,\n  in nsIDOMStorage storageAreaArg\n);\n</pre>","obsolete":false},{"name":"key","help":"Represents the key changed. The <code>key</code> attribute is <code>null</code> when the change is caused by the storage <code>clear()</code> method. <strong>Read only.</strong>","obsolete":false},{"name":"newValue","help":"The new value of the <code>key</code>. The <code>newValue</code> is <code>null</code> when the change has been invoked by storage <code>clear()</code> method or the <code>key</code> has been removed from the storage. <strong>Read only.</strong>","obsolete":false},{"name":"oldValue","help":"The original value of the <code>key</code>. The <code>oldValue</code> is <code>null</code> when the change has been invoked by storage <code>clear()</code> method or the <code>key</code> has been newly added and therefor doesn't have any previous value. <strong>Read only.</strong>","obsolete":false},{"name":"storageArea","help":"Represents the Storage object that was affected. <strong>Read only.</strong>","obsolete":false},{"name":"url","help":"The URL of the document whose <code>key</code> changed. <strong>Read only.</strong>","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/DOM/event/StorageEvent"},"SVGFEFloodElement":{"title":"feFlood","seeAlso":"<li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/filter\">&lt;filter&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/animate\">&lt;animate&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/animateColor\">&lt;animateColor&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/set\">&lt;set&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feBlend\">&lt;feBlend&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feColorMatrix\">&lt;feColorMatrix&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feComponentTransfer\">&lt;feComponentTransfer&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feComposite\">&lt;feComposite&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feConvolveMatrix\">&lt;feConvolveMatrix&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feDiffuseLighting\">&lt;feDiffuseLighting&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feDisplacementMap\">&lt;feDisplacementMap&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feGaussianBlur\">&lt;feGaussianBlur&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feImage\">&lt;feImage&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feMerge\">&lt;feMerge&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feMorphology\">&lt;feMorphology&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feOffset\">&lt;feOffset&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feSpecularLighting\">&lt;feSpecularLighting&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feTile\">&lt;feTile&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feTurbulence\">&lt;feTurbulence&gt;</a></code>\n</li> <li><a title=\"en/SVG/Tutorial/Filter_effects\" rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Tutorial/Filter_effects\">SVG tutorial: Filter effects</a></li>","summary":"The filter fills the filter subregion with the color and opacity defined by \n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Attribute/flood-color\">flood-color</a></code> and \n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Attribute/flood-opacity\">flood-opacity</a></code>.","members":[],"srcUrl":"https://developer.mozilla.org/en/SVG/Element/feFlood"},"DirectoryReaderSync":{"title":"DirectoryReaderSync","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td>13\n<span title=\"prefix\">webkit</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE&nbsp;Phone</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> </tr> </tbody> </table>\n</div>","summary":"<div><strong>`DRAFT</strong> <div>This page is not complete.</div>\n</div>\n<p>The <code>DirectoryReaderSync</code> interface of the <a title=\"en/DOM/File_API/File_System_API\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/File_API/File_System_API\">FileSystem API</a> lets a user list files and directories in a directory.</p>","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/File_API/File_System_API/DirectoryReaderSync"},"NotificationCenter":{"title":"Search Results | Mozilla Developer Network","members":[],"srcUrl":"https://developer.mozilla.org/en-US/search?q=NotificationCenter","skipped":true,"cause":"Suspect title"},"HTMLAllCollection":{"title":"Gecko DOM Referenz","members":[],"srcUrl":"https://developer.mozilla.org/de/Gecko-DOM-Referenz","skipped":true,"cause":"Suspect title"},"SVGAnimatedNumber":{"title":"SVGAnimatedNumber","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody>\n</table>\n</div>\n<div id=\"compat-mobile\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody>\n</table>\n</div>","summary":"The <code>SVGAnimatedNumber</code> interface is used for attributes of basic type <a title=\"https://developer.mozilla.org/en/SVG/Content_type#Number\" rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Content_type#Number\">&lt;Number&gt;</a> which can be animated.","members":[{"name":"baseVal","help":"The base value of the given attribute before applying any animations.","obsolete":false},{"name":"animVal","help":"If the given attribute or property is being animated, contains the current animated value of the attribute or property. If the given attribute or property is not currently being animated, contains the same value as <code>baseVal</code>.","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/DOM/SVGAnimatedNumber"},"WorkerContext":{"title":"Using web workers","members":[],"srcUrl":"https://developer.mozilla.org/En/Using_web_workers","skipped":true,"cause":"Suspect title"},"SVGPathSegLinetoVerticalRel":{"title":"SVGPathElement","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/SVGPathElement","skipped":true,"cause":"Suspect title"},"EntityReference":{"title":"EntityReference","summary":"<p><span>NOTE:&nbsp;This is not implemented in Mozilla</span></p>\n<p>Read-only reference to an entity reference in the DOM tree. Has no properties or methods of its own but inherits from <a class=\"internal\" title=\"En/DOM/Node\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/Node\"><code>Node</code></a>.</p>","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/EntityReference","specification":"http://www.w3.org/TR/DOM-Level-3-Cor...ml#ID-11C98490"},"FileCallback":{"title":"FileEntrySync","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/File_API/File_System_API/FileEntrySync","skipped":true,"cause":"Suspect title"},"SVGTests":{"title":"SVGTests","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td>12.0 (12)\n</td> <td>9.0</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Not supported.\">--</span></td> <td>12.0 (12)\n</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>","summary":"Interface <code>SVGTests</code> defines an interface which applies to all elements which have attributes \n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Attribute/requiredFeatures\">requiredFeatures</a></code>, \n<code><a rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Attribute/requiredExtensions\" class=\"new\">requiredExtensions</a></code> and \n<code><a rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Attribute/systemLanguage\" class=\"new\">systemLanguage</a></code>.","members":[{"name":"hasExtension","help":"Returns true if the browser supports the given extension, specified by a URI.","obsolete":false},{"name":"requiredFeatures","help":"Corresponds to attribute \n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Attribute/requiredFeatures\">requiredFeatures</a></code> on the given element.","obsolete":false},{"name":"requiredExtensions","help":"Corresponds to attribute \n<code><a rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Attribute/requiredExtensions\" class=\"new\">requiredExtensions</a></code> on the given element.","obsolete":false},{"name":"systemLanguage","help":"Corresponds to attribute \n<code><a rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Attribute/systemLanguage\" class=\"new\">systemLanguage</a></code> on the given element.","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/DOM/SVGTests"},"WorkerLocation":{"title":"Using web workers","members":[],"srcUrl":"https://developer.mozilla.org/En/Using_web_workers","skipped":true,"cause":"Suspect title"},"HTMLSelectElement":{"title":"HTMLSelectElement","examples":["<h5 class=\"editable\">Examples</h5>\n<div id=\"section_8\"><span id=\"Creating_Elements_from_Scratch\"></span><h6 class=\"editable\">Creating Elements from Scratch</h6>\n\n          <pre name=\"code\" class=\"js\">var sel = document.createElement(\"select\");\nvar opt1 = document.createElement(\"option\");\nvar opt2 = document.createElement(\"option\");\n\nopt1.value = \"1\";\nopt1.text = \"Option: Value 1\";\n\nopt2.value = \"2\";\nopt2.text = \"Option: Value 2\";\n\nsel.add(opt1, null);\nsel.add(opt2, null);\n\n/*\n  Produces the following, conceptually:\n\n  &lt;select&gt;\n    &lt;option value=\"1\"&gt;Option: Value 1&lt;/option&gt;\n    &lt;option value=\"2\"&gt;Option: Value 2&lt;/option&gt;\n  &lt;/select&gt;\n*/</pre>\n        \n<p>From \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span> and <span title=\"(Firefox 7.0 / Thunderbird 7.0 / SeaMonkey 2.4)\n\">Gecko&nbsp;7.0</span> the before parameter is optional. So the following is accepted.</p>\n<pre class=\"deki-transform\">...\nsel.add(opt1);\nsel.add(opt2);\n...\n</pre>\n</div><div id=\"section_9\"><span id=\"Append_to_an_Existing_Collection\"></span><h6 class=\"editable\">Append to an Existing Collection</h6>\n\n          <pre name=\"code\" class=\"js\">var sel = document.getElementById(\"existingList\");\n\nvar opt = document.createElement(\"option\");\nopt.value = \"3\";\nopt.text = \"Option: Value 3\";\n\nsel.add(opt, null);\n\n/*\n  Takes the existing following select object:\n\n  &lt;select id=\"existingList\" name=\"existingList\"&gt;\n    &lt;option value=\"1\"&gt;Option: Value 1&lt;/option&gt;\n    &lt;option value=\"2\"&gt;Option: Value 2&lt;/option&gt;\n  &lt;/select&gt;\n\n  And changes it to:\n\n  &lt;select id=\"existingList\" name=\"existingList\"&gt;\n    &lt;option value=\"1\"&gt;Option: Value 1&lt;/option&gt;\n    &lt;option value=\"2\"&gt;Option: Value 2&lt;/option&gt;\n    &lt;option value=\"3\"&gt;Option: Value 3&lt;/option&gt;\n  &lt;/select&gt;\n*/</pre>\n        \n<p>From \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span> and <span title=\"(Firefox 7.0 / Thunderbird 7.0 / SeaMonkey 2.4)\n\">Gecko&nbsp;7.0</span> the before parameter is optional. So the following is accepted.</p>\n<pre class=\"deki-transform\">...\nsel.add(opt);\n...\n</pre>\n</div><div id=\"section_10\"><span id=\"Inserting_to_an_Existing_Collection\"></span><h6 class=\"editable\">Inserting to an Existing Collection</h6>\n\n          <pre name=\"code\" class=\"js\">var sel = document.getElementById(\"existingList\");\n\nvar opt = document.createElement(\"option\");\nopt.value = \"3\";\nopt.text = \"Option: Value 3\";\n\nsel.add(opt, sel.options[1]);\n\n/*\n  Takes the existing following select object:\n\n  &lt;select id=\"existingList\" name=\"existingList\"&gt;\n    &lt;option value=\"1\"&gt;Option: Value 1&lt;/option&gt;\n    &lt;option value=\"2\"&gt;Option: Value 2&lt;/option&gt;\n  &lt;/select&gt;\n\n  And changes it to:\n\n  &lt;select id=\"existingList\" name=\"existingList\"&gt;\n    &lt;option value=\"1\"&gt;Option: Value 1&lt;/option&gt;\n    &lt;option value=\"3\"&gt;Option: Value 3&lt;/option&gt;\n    &lt;option value=\"2\"&gt;Option: Value 2&lt;/option&gt;\n  &lt;/select&gt;\n*/</pre>\n        \n<dl> <dt></dt>\n</dl>\n<p>\n\n</p><div><span>Obsolete since Gecko 5.0 (Firefox 5.0 / Thunderbird 5.0 / SeaMonkey 2.2)\n</span><span id=\"blur()\"></span></div></div>","<h5 class=\"editable\">Example</h5>\n\n          <pre name=\"code\" class=\"js\">var sel = document.getElementById(\"existingList\");\nsel.remove(1);\n\n/*\n  Takes the existing following select object:\n\n  &lt;select id=\"existingList\" name=\"existingList\"&gt;\n    &lt;option value=\"1\"&gt;Option: Value 1&lt;/option&gt;\n    &lt;option value=\"2\"&gt;Option: Value 2&lt;/option&gt;\n    &lt;option value=\"3\"&gt;Option: Value 3&lt;/option&gt;\n  &lt;/select&gt;\n\n  And changes it to:\n\n  &lt;select id=\"existingList\" name=\"existingList\"&gt;\n    &lt;option value=\"1\"&gt;Option: Value 1&lt;/option&gt;\n    &lt;option value=\"3\"&gt;Option: Value 3&lt;/option&gt;\n  &lt;/select&gt;\n*/</pre>","<h4 class=\"editable\">Get information about the selected option</h4>\n\n          <pre name=\"code\" class=\"js\">/* assuming we have the following HTML\n&lt;select id='s'&gt;\n    &lt;option&gt;First&lt;/option&gt;\n    &lt;option selected&gt;Second&lt;/option&gt;\n    &lt;option&gt;Third&lt;/option&gt;\n&lt;/select&gt;\n*/\n\nvar select = document.getElementById('s');\n\n// return the index of the selected option\nalert(select.selectedIndex); // 1\n\n// return the value of the selected option\nalert(select.options[select.selectedIndex].value) // Second</pre>"],"summary":"<code>DOM select</code> elements share all of the properties and methods of other HTML elements described in the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/element\">element</a></code>\n section. They also have the specialized interface <a class=\"external\" title=\"http://dev.w3.org/html5/spec/the-button-element.html#htmlselectelement\" rel=\"external\" href=\"http://dev.w3.org/html5/spec/the-button-element.html#htmlselectelement\" target=\"_blank\">HTMLSelectElement</a> (or \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML\">HTML 4</a></span> <a class=\"external\" title=\"http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-94282980\" rel=\"external\" href=\"http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-94282980\" target=\"_blank\">HTMLSelectElement</a>).","members":[{"name":"setCustomValidity","help":"<p><span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span> only. Sets the custom validity message for the selection element to the specified message. Use the empty string to indicate that the element does <em>not</em> have a custom validity error.</p>\n\n<div id=\"section_22\"><span id=\"Parameters_8\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>error</code></dt> <dd>The string to use for the custom validity message.</dd>\n</dl></div>","idl":"<pre class=\"eval\">void setCustomValidity(\n  in DOMString error\n);\n</pre>","obsolete":false},{"name":"add","help":"<p>Adds an element to the collection of <code>option</code> elements for this <code>select</code> element.</p>\n\n<div id=\"section_6\"><span id=\"Parameters\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>element</code></dt> <dd>An item to add to the collection of options.</dd> <dt><code>before</code> \n<span title=\"(Firefox 7.0 / Thunderbird 7.0 / SeaMonkey 2.4)\n\">Optional from Gecko 7.0</span>\n</dt> <dd>An item (or \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span>&nbsp;index of an item) that the new item should be inserted before. If this parameter is <code>null</code> (or the index does not exist), the new element is appended to the end of the collection.</dd>\n</dl>\n<div id=\"section_7\"><span id=\"Examples\"></span><h5 class=\"editable\">Examples</h5>\n<div id=\"section_8\"><span id=\"Creating_Elements_from_Scratch\"></span><h6 class=\"editable\">Creating Elements from Scratch</h6>\n\n          <pre name=\"code\" class=\"js\">var sel = document.createElement(\"select\");\nvar opt1 = document.createElement(\"option\");\nvar opt2 = document.createElement(\"option\");\n\nopt1.value = \"1\";\nopt1.text = \"Option: Value 1\";\n\nopt2.value = \"2\";\nopt2.text = \"Option: Value 2\";\n\nsel.add(opt1, null);\nsel.add(opt2, null);\n\n/*\n  Produces the following, conceptually:\n\n  &lt;select&gt;\n    &lt;option value=\"1\"&gt;Option: Value 1&lt;/option&gt;\n    &lt;option value=\"2\"&gt;Option: Value 2&lt;/option&gt;\n  &lt;/select&gt;\n*/</pre>\n        \n<p>From \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span> and <span title=\"(Firefox 7.0 / Thunderbird 7.0 / SeaMonkey 2.4)\n\">Gecko&nbsp;7.0</span> the before parameter is optional. So the following is accepted.</p>\n<pre class=\"deki-transform\">...\nsel.add(opt1);\nsel.add(opt2);\n...\n</pre>\n</div><div id=\"section_9\"><span id=\"Append_to_an_Existing_Collection\"></span><h6 class=\"editable\">Append to an Existing Collection</h6>\n\n          <pre name=\"code\" class=\"js\">var sel = document.getElementById(\"existingList\");\n\nvar opt = document.createElement(\"option\");\nopt.value = \"3\";\nopt.text = \"Option: Value 3\";\n\nsel.add(opt, null);\n\n/*\n  Takes the existing following select object:\n\n  &lt;select id=\"existingList\" name=\"existingList\"&gt;\n    &lt;option value=\"1\"&gt;Option: Value 1&lt;/option&gt;\n    &lt;option value=\"2\"&gt;Option: Value 2&lt;/option&gt;\n  &lt;/select&gt;\n\n  And changes it to:\n\n  &lt;select id=\"existingList\" name=\"existingList\"&gt;\n    &lt;option value=\"1\"&gt;Option: Value 1&lt;/option&gt;\n    &lt;option value=\"2\"&gt;Option: Value 2&lt;/option&gt;\n    &lt;option value=\"3\"&gt;Option: Value 3&lt;/option&gt;\n  &lt;/select&gt;\n*/</pre>\n        \n<p>From \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span> and <span title=\"(Firefox 7.0 / Thunderbird 7.0 / SeaMonkey 2.4)\n\">Gecko&nbsp;7.0</span> the before parameter is optional. So the following is accepted.</p>\n<pre class=\"deki-transform\">...\nsel.add(opt);\n...\n</pre>\n</div><div id=\"section_10\"><span id=\"Inserting_to_an_Existing_Collection\"></span><h6 class=\"editable\">Inserting to an Existing Collection</h6>\n\n          <pre name=\"code\" class=\"js\">var sel = document.getElementById(\"existingList\");\n\nvar opt = document.createElement(\"option\");\nopt.value = \"3\";\nopt.text = \"Option: Value 3\";\n\nsel.add(opt, sel.options[1]);\n\n/*\n  Takes the existing following select object:\n\n  &lt;select id=\"existingList\" name=\"existingList\"&gt;\n    &lt;option value=\"1\"&gt;Option: Value 1&lt;/option&gt;\n    &lt;option value=\"2\"&gt;Option: Value 2&lt;/option&gt;\n  &lt;/select&gt;\n\n  And changes it to:\n\n  &lt;select id=\"existingList\" name=\"existingList\"&gt;\n    &lt;option value=\"1\"&gt;Option: Value 1&lt;/option&gt;\n    &lt;option value=\"3\"&gt;Option: Value 3&lt;/option&gt;\n    &lt;option value=\"2\"&gt;Option: Value 2&lt;/option&gt;\n  &lt;/select&gt;\n*/</pre>\n        \n<dl> <dt></dt>\n</dl>\n<p>\n\n</p><div><span>Obsolete since Gecko 5.0 (Firefox 5.0 / Thunderbird 5.0 / SeaMonkey 2.2)\n</span><span id=\"blur()\"></span></div></div></div></div>","idl":"<pre class=\"eval\">void add(\n  in nsIDOMHTMLElement element,\n  in nsIDOMHTMLElement before \n<span style=\"border: 1px solid #9ED2A4; background-color: #C0FFC7; font-size: x-small; white-space: nowrap; padding: 2px;\" title=\"(Firefox 7.0 / Thunderbird 7.0 / SeaMonkey 2.4)\n\">Optional from Gecko 7.0</span>\n\n);\nvoid add(\n  in HTMLElement element,\n  in long before \n<span style=\"border: 1px solid #9ED2A4; background-color: #C0FFC7; font-size: x-small; white-space: nowrap; padding: 2px;\" title=\"(Firefox 7.0 / Thunderbird 7.0 / SeaMonkey 2.4)\n\">Optional from Gecko 7.0</span>\n\n);\n</pre>","obsolete":false},{"name":"item","help":"<div id=\"section_14\"><p><span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span> Gets an item from the options collection for this <code>select</code> element. You can also access an item by specifying the index in array-style brackets or parentheses, without calling this method explicitly.</p>\n\n</div><div id=\"section_15\"><span id=\"Parameters_5\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>index</code></dt> <dd>The zero-based index into the collection of the option to get.</dd>\n</dl>\n</div><div id=\"section_16\"><span id=\"Return_value_2\"></span><h6 class=\"editable\">Return value</h6>\n<p>The node at the specified index, or <code>null</code> if such a node does not exist in the collection.</p>\n<p>\n</p><div>\n<span id=\"namedItem()\"></span></div></div>","idl":"<pre class=\"eval\">nsIDOMNode item(\n  in unsigned long index\n);\n</pre>","obsolete":false},{"name":"remove","help":"<p>Removes the element at the specified index from the options collection for this select element.</p>\n\n<div id=\"section_20\"><span id=\"Parameters_7\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>index</code></dt> <dd>The zero-based index of the option element to remove from the collection.</dd>\n</dl>\n<div id=\"section_21\"><span id=\"Example\"></span><h5 class=\"editable\">Example</h5>\n\n          <pre name=\"code\" class=\"js\">var sel = document.getElementById(\"existingList\");\nsel.remove(1);\n\n/*\n  Takes the existing following select object:\n\n  &lt;select id=\"existingList\" name=\"existingList\"&gt;\n    &lt;option value=\"1\"&gt;Option: Value 1&lt;/option&gt;\n    &lt;option value=\"2\"&gt;Option: Value 2&lt;/option&gt;\n    &lt;option value=\"3\"&gt;Option: Value 3&lt;/option&gt;\n  &lt;/select&gt;\n\n  And changes it to:\n\n  &lt;select id=\"existingList\" name=\"existingList\"&gt;\n    &lt;option value=\"1\"&gt;Option: Value 1&lt;/option&gt;\n    &lt;option value=\"3\"&gt;Option: Value 3&lt;/option&gt;\n  &lt;/select&gt;\n*/</pre>\n        \n<p>\n</p><div>\n<span id=\"setCustomValidity()\"></span></div></div></div>","idl":"<pre class=\"eval\">void remove(\n  in long index\n);\n</pre>","obsolete":false},{"name":"focus","help":"<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML\">HTML 4</a></span> Gives input focus to this element. \n\n<span title=\"\">Obsolete since <a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span>","idl":"<pre class=\"eval\">void focus();\n</pre>","obsolete":false},{"name":"blur","help":"<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML\">HTML 4</a></span> Removes input focus from this element. \n\n<span title=\"\">Obsolete since <a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span>","idl":"<pre class=\"eval\">void blur();\n</pre>","obsolete":false},{"name":"namedItem","help":"<div id=\"section_16\"><p><span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span> Gets the item in the options collection with the specified name. The name string can match either the <strong>id</strong> or the <strong>name</strong> attribute of an option node. You can also access an item by specifying the name in array-style brackets or parentheses, without calling this method explicitly.</p>\n\n</div><div id=\"section_17\"><span id=\"Parameters_6\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>name</code></dt> <dd>The name of the option to get.</dd>\n</dl>\n</div><div id=\"section_18\"><span id=\"Return_value_3\"></span><h6 class=\"editable\">Return value</h6>\n<ul> <li>A node, if there is exactly one match.</li> <li><code>null</code> if there are no matches.</li> <li>A <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/NodeList\">NodeList</a></code>\n in tree order of nodes whose <strong>name</strong> or <strong>id</strong> attributes match the specified name.</li>\n</ul>\n</div>","idl":"<pre class=\"eval\">nsIDOMNode namedItem(\n  in DOMString name\n);\n</pre>","obsolete":false},{"name":"checkValidity","help":"<div id=\"section_11\"><p><span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span> Checks whether the element has any constraints and whether it satisfies them. If the element fails its constraints, the browser fires a cancelable <code>invalid</code> event at the element (and returns false).</p>\n\n</div><div id=\"section_12\"><span id=\"Parameters_3\"></span>\n\n</div><div id=\"section_13\"><span id=\"Return_value\"></span><h6 class=\"editable\">Return value</h6>\n<p>A <code>false</code> value if the <code>select</code> element is a candidate for constraint evaluation and it does not satisfy its constraints. Returns true if the element is not constrained, or if it satisfies its constraints.</p>\n<p>\n\n</p><div><span>Obsolete since Gecko 5.0 (Firefox 5.0 / Thunderbird 5.0 / SeaMonkey 2.2)\n</span><span id=\"focus()\"></span></div></div>","idl":"<pre class=\"eval\">boolean checkValidity();\n</pre>","obsolete":false},{"name":"autofocus","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/select#attr-autofocus\">autofocus</a></code>\n HTML attribute, which indicates whether the control should have input focus when the page loads, unless the user overrides it, for example by typing in a different control. Only one form-associated element in a document can have this attribute specified. \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span> \n<span title=\"(Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1)\n\">Requires Gecko 2.0</span>","obsolete":false},{"name":"disabled","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/select#attr-disabled\">disabled</a></code>\n HTML attribute, which indicates whether the control is disabled. If it is disabled, it does not accept clicks.","obsolete":false},{"name":"form","help":"The form that this element is associated with. If this element is a descendant of a form element, then this attribute is the ID of that form element. If the element is not a descendant of a form element, then: <ul> <li>\n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span> The attribute can be the ID of any form element in the same document.</li> <li>\n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML\">HTML 4</a></span> The attribute is null.</li> </ul> <strong>Read only.</strong>","obsolete":false},{"name":"labels","help":"A list of label elements associated with this select element.","obsolete":false},{"name":"length","help":"The number of <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/option\">&lt;option&gt;</a></code>\n elements in this <code>select</code> element.","obsolete":false},{"name":"multiple","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/select#attr-multiple\">multiple</a></code>\n HTML attribute, whichindicates whether multiple items can be selected.","obsolete":false},{"name":"name","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/select#attr-name\">name</a></code>\n HTML attribute, containing the name of this control used by servers and DOM search functions.","obsolete":false},{"name":"options","help":"The set of <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/option\">&lt;option&gt;</a></code>\n elements contained by this element. <strong>Read only.</strong>","obsolete":false},{"name":"required","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/select#attr-required\">required</a></code>\n HTML attribute, which indicates whether the user is required to select a value before submitting the form. \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span> \n<span title=\"(Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1)\n\">Requires Gecko 2.0</span>","obsolete":false},{"name":"selectedIndex","help":"The index of the first selected <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/option\">&lt;option&gt;</a></code>\n element.","obsolete":false},{"name":"selectedOptions","help":"The set of options that are selected. \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span>","obsolete":false},{"name":"size","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/select#attr-size\">size</a></code>\n HTML attribute, which contains the number of visible items in the control. The default is 1, \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span> unless <strong>multiple</strong> is true, in which case it is 4.","obsolete":false},{"name":"tabIndex","help":"The element's position in the tabbing order. \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML\">HTML 4</a></span> \n\n<span title=\"\">Obsolete since <a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span>","obsolete":true},{"url":"https://developer.mozilla.org/en/DOM/select.type","name":"type","help":"The form control's type. When <strong>multiple</strong> is true, it returns <code>select-multiple</code>; otherwise, it returns <code>select-one</code>.<strong>Read only.</strong>","obsolete":false},{"name":"validationMessage","help":"A localized message that describes the validation constraints that the control does not satisfy (if any). This attribute is the empty string if the control is not a candidate for constraint validation (<strong>willValidate</strong> is false), or it satisfies its constraints.<strong>Read only.</strong> \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span> \n<span title=\"(Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1)\n\">Requires Gecko 2.0</span>","obsolete":false},{"name":"validity","help":"The validity states that this control is in. <strong>Read only.</strong> \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span> \n<span title=\"(Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1)\n\">Requires Gecko 2.0</span>","obsolete":false},{"name":"value","help":"The value of this form control, that is, of the first selected option.","obsolete":false},{"name":"willValidate","help":"Indicates whether the button is a candidate for constraint validation. It is false if any conditions bar it from constraint validation. <strong>Read only.</strong> \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span> \n<span title=\"(Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1)\n\">Requires Gecko 2.0</span>","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/DOM/HTMLSelectElement"},"HTMLFieldSetElement":{"title":"HTMLFieldSetElement","summary":"DOM&nbsp;<code>fieldset</code> elements expose the <a class=\" external\" title=\"http://dev.w3.org/html5/spec/forms.html#htmlfieldsetelement\" rel=\"external\" href=\"http://dev.w3.org/html5/spec/forms.html#htmlfieldsetelement\" target=\"_blank\">HTMLFieldSetElement</a>&nbsp; (\n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML\">HTML 4</a></span> <a class=\" external\" title=\"http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-7365882\" rel=\"external\" href=\"http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-7365882\" target=\"_blank\">HTMLFieldSetElement</a>) interface, which provides special properties and methods (beyond the regular <a rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/element\">element</a> object interface they also have available to them by inheritance) for manipulating the layout and presentation of field-set elements.","members":[{"name":"checkValidity","help":"Always returns true because <code>fieldset</code> objects are never candidates for constraint validation.","obsolete":false},{"name":"setCustomValidity","help":"Sets a custom validity message for the field set. If this message is not the empty string, then the field set is suffering from a custom validity error, and does not validate.","obsolete":false},{"name":"disabled","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/fieldset#attr-disabled\">disabled</a></code>\n HTML&nbsp;attribute, indicating whether the user can interact with the control.","obsolete":false},{"name":"elements","help":"The elements belonging to this field set.","obsolete":false},{"name":"form","help":"The containing form element, if this element is in a form. Otherwise, the element the <a title=\"en/HTML/Element/fieldset#attr-name\" rel=\"internal\" href=\"https://developer.mozilla.org/en/HTML/Element/fieldset#attr-name\">name content attribute</a> points to \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span>. (<code>null</code> in \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML\">HTML 4</a></span>.)","obsolete":false},{"name":"name","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/fieldset#attr-name\">name</a></code>\n HTML&nbsp;attribute, containing the name of the field set, used for submitting the form.","obsolete":false},{"name":"type","help":"Must be the string <code>fieldset</code>.","obsolete":false},{"name":"validationMessage","help":"A localized message that describes the validation constraints that the element does not satisfy (if any). This is the empty string if the element&nbsp; is not a candidate for constraint validation (<strong>willValidate</strong> is false), or it satisfies its constraints.","obsolete":false},{"name":"validity","help":"The validity states that this element is in.","obsolete":false},{"name":"willValidate","help":"Always false because <code>fieldset</code> objects are never candidates for constraint validation.","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/DOM/HTMLFieldSetElement"},"CompositionEvent":{"title":"CompositionEvent","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td>9.0 (9.0)\n</td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td>9.0 (9.0)\n</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>","srcUrl":"https://developer.mozilla.org/en/DOM/CompositionEvent","specification":"DOM&nbsp;Level 3: Composition Events","seeAlso":"<li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DOM_event_reference/compositionstart\">compositionstart</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DOM_event_reference/compositionend\">compositionend</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DOM_event_reference/compositionupdate\">compositionupdate</a></code>\n</li> <li><a title=\"UIEvent\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/Event/UIEvent\">UIEvent</a></li> <li><a title=\"Event\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/event\">Event</a></li>","summary":"<div><div>\n\n<a rel=\"custom\" href=\"http://mxr.mozilla.org/mozilla-central/source/dom/interfaces/events/nsIDOMCompositionEvent.idl\"><code>dom/interfaces/events/nsIDOMCompositionEvent.idl</code></a><span><a rel=\"internal\" href=\"https://developer.mozilla.org/en/Interfaces/About_Scriptable_Interfaces\" title=\"en/Interfaces/About_Scriptable_Interfaces\">Scriptable</a></span></div><span>An event interface for composition events</span><div><div>1.0</div><div>11.0</div><div></div><div>Introduced</div><div>Gecko 9.0</div><div title=\"Introduced in Gecko 9.0 (Firefox 9.0 / Thunderbird 9.0 / SeaMonkey 2.6)\n\"></div><div title=\"Last changed in Gecko 9.0 (Firefox 9.0 / Thunderbird 9.0 / SeaMonkey 2.6)\n\"></div></div>\n<div>Inherits from: <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/XPCOM_Interface_Reference/nsIDOMUIEvent&amp;ident=nsIDOMUIEvent\" class=\"new\">nsIDOMUIEvent</a></code>\n<span>Last changed in Gecko 9.0 (Firefox 9.0 / Thunderbird 9.0 / SeaMonkey 2.6)\n</span></div></div>\n<p></p>\n<p>The DOM <code>CompositionEvent</code> represents events that occur due to the user indirectly entering text.</p>","members":[{"name":"initCompositionEvent","help":"<p>Initializes the attributes of a composition event.</p>\n\n<div id=\"section_5\"><span id=\"Parameters\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>typeArg</code></dt> <dd>The type of composition event; this will be one of <code>compositionstart</code>, <code>compositionupdate</code>, or <code>compositionend</code>.</dd> <dt><code>canBubbleArg</code></dt> <dd>Whether or not the event can bubble.</dd> <dt><code>cancelableArg</code></dt> <dd>Whether or not the event can be canceled.</dd> <dt><code>viewArg</code></dt> <dd>?</dd> <dt><code>dataArg</code></dt> <dd>The value of the <code>data</code> attribute.</dd> <dt><code>localeArg</code></dt> <dd>The value of the <code>locale</code> attribute.</dd>\n</dl>\n</div>","idl":"<pre>void initCompositionEvent(\n  in DOMString typeArg,\n  in boolean canBubbleArg,\n  in boolean cancelableArg,\n  in views::AbstractView viewArg,\n  in DOMString dataArg,\n  in DOMString localeArg\n);\n</pre>","obsolete":false},{"name":"data","help":"<p>For <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DOM_event_reference/compositionstart\">compositionstart</a></code>\n events, this is the currently selected text that will be replaced by the string being composed. This value doesn't change even if content changes the selection range; rather, it indicates the string that was selected when composition started.</p> <p>For <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DOM_event_reference/compositionupdate\">compositionupdate</a></code>\n, this is the string as it stands currently as editing is ongoing.</p> <p>For <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DOM_event_reference/compositionend\">compositionend</a></code>\n events, this is the string as committed to the editor.</p> <p><strong>Read only</strong>.</p>","obsolete":false},{"name":"locale","help":"The locale of current input method (for example, the keyboard layout locale if the composition is associated with IME). <strong>Read only.</strong>","obsolete":false}]},"SVGRadialGradientElement":{"title":"SVGRadialGradientElement","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>","summary":"The <code>SVGRadialGradientElement</code> interface corresponds to the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/radialGradient\">&lt;radialGradient&gt;</a></code>\n element.","members":[{"name":"cx","help":"Corresponds to attribute \n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Attribute/cx\">cx</a></code> on the given <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/radialGradient\">&lt;radialGradient&gt;</a></code>\n element.","obsolete":false},{"name":"cy","help":"Corresponds to attribute \n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Attribute/cy\">cy</a></code> on the given <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/radialGradient\">&lt;radialGradient&gt;</a></code>\n element.","obsolete":false},{"name":"fx","help":"Corresponds to attribute \n<code><a rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Attribute/fx\" class=\"new\">fx</a></code> on the given <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/radialGradient\">&lt;radialGradient&gt;</a></code>\n element.","obsolete":false},{"name":"fy","help":"Corresponds to attribute \n<code><a rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Attribute/fy\" class=\"new\">fy</a></code> on the given <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/radialGradient\">&lt;radialGradient&gt;</a></code>\n element.","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/DOM/SVGRadialGradientElement"},"TextMetrics":{"title":"TextMetrics","summary":"Returned by <a title=\"CanvasRenderingContext2D\" rel=\"internal\" href=\"https://developer.mozilla.org/CanvasRenderingContext2D\" class=\"new \">CanvasRenderingContext2D</a>'s <a title=\"CanvasRenderingContext2D.measureText\" rel=\"internal\" href=\"https://developer.mozilla.org/CanvasRenderingContext2D.measureText\" class=\"new \">measureText</a> method.","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/TextMetrics","specification":"http://www.whatwg.org/specs/web-apps...ml#textmetrics"},"SVGScriptElement":{"title":"SVGScriptElement","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody>\n</table>\n</div>\n<div id=\"compat-mobile\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody>\n</table>\n</div>","summary":"The <code>SVGScriptElement</code> interface corresponds to the SVG <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/script\">&lt;script&gt;</a></code>\n element.","members":[{"name":"type","help":"Corresponds to attribute \n<code><a rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Attribute/type\" class=\"new\">type</a></code> on the given element. A <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DOMException\">DOMException</a></code>\n is raised with code <code>NO_MODIFICATION_ALLOWED_ERR</code> on an attempt to change the value of a read only attribut.","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/DOM/SVGScriptElement"},"SVGFEBlendElement":{"title":"feBlend","seeAlso":"<li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/filter\">&lt;filter&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/animate\">&lt;animate&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/set\">&lt;set&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feColorMatrix\">&lt;feColorMatrix&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feComponentTransfer\">&lt;feComponentTransfer&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feComposite\">&lt;feComposite&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feConvolveMatrix\">&lt;feConvolveMatrix&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feDiffuseLighting\">&lt;feDiffuseLighting&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feDisplacementMap\">&lt;feDisplacementMap&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feFlood\">&lt;feFlood&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feGaussianBlur\">&lt;feGaussianBlur&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feImage\">&lt;feImage&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feMerge\">&lt;feMerge&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feMorphology\">&lt;feMorphology&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feOffset\">&lt;feOffset&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feSpecularLighting\">&lt;feSpecularLighting&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feTile\">&lt;feTile&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feTurbulence\">&lt;feTurbulence&gt;</a></code>\n</li> <li><a title=\"en/SVG/Tutorial/Filter_effects\" rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Tutorial/Filter_effects\">SVG tutorial: Filter effects</a></li>","summary":"The <code>feBlend</code> filter composes two objects together ruled by a certain blending mode. This is similar to what is known from image editing software when blending two layers. The mode is defined by the \n<code><a rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Attribute/mode\" class=\"new\">mode</a></code> attribute.","members":[{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/style","name":"style","help":"Specific attributes"},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/in2","name":"in2","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/mode","name":"mode","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/in","name":"in","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/class","name":"class","help":""}],"srcUrl":"https://developer.mozilla.org/en/SVG/Element/feBlend"},"HTMLAreaElement":{"title":"HTMLAreaElement","summary":"DOM area objects expose the <a class=\" external\" title=\"http://www.w3.org/TR/html5/the-map-element.html#htmlareaelement\" rel=\"external\" href=\"http://www.w3.org/TR/html5/the-map-element.html#htmlareaelement\" target=\"_blank\">HTMLAreaElement</a> (or \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML\">HTML 4</a></span> <a class=\" external\" title=\"http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-26019118\" rel=\"external\" href=\"http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-26019118\" target=\"_blank\"><code>HTMLAreaElement</code></a>) interface, which provides special properties and methods (beyond the regular <a href=\"https://developer.mozilla.org/en/DOM/element\" rel=\"internal\">element</a> object interface they also have available to them by inheritance) for manipulating the layout and presentation of area elements.","members":[{"name":"accessKey","help":"A single character that switches input focus to the control. \n\n<span title=\"\">Obsolete</span>&nbsp;in \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span>","obsolete":true},{"name":"alt","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/area#attr-alt\">alt</a></code>\n HTML attribute, containing alternative text for the element.","obsolete":false},{"name":"coords","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/area#attr-coords\">coords</a></code>\n HTML attribute, containing coordinates to define the hot-spot region.","obsolete":false},{"name":"hash","help":"The fragment identifier (including the leading hash mark (#)), if any, in the referenced URL.","obsolete":false},{"name":"host","help":"The hostname and port (if it's not the default port) in the referenced URL.","obsolete":false},{"name":"hostname","help":"The hostname in the referenced URL.","obsolete":false},{"name":"href","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/area#attr-href\">href</a></code>\n HTML attribute, containing a valid URL&nbsp;of a linked resource.","obsolete":false},{"name":"hreflang","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/area#attr-hreflang\">hreflang</a></code>\n HTML&nbsp;attribute, indicating the language of the linked resource.","obsolete":false},{"name":"media","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/area#attr-media\">media</a></code>\n HTML&nbsp;attribute, indicating target media of the linked resource.","obsolete":false},{"name":"noHref","help":"Indicates that this area is inactive. \n\n<span title=\"\">Obsolete</span> in \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span>","obsolete":true},{"name":"pathname","help":"The path name component, if any, of the referenced URL.","obsolete":false},{"name":"port","help":"The port component, if any, of the referenced URL.","obsolete":false},{"name":"protocol","help":"The protocol component (including trailing colon (:)), of the referenced URL.","obsolete":false},{"name":"rel","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/area#attr-rel\">rel</a></code>\n HTML&nbsp;attribute, indicating relationships of the current document to the linked resource.","obsolete":false},{"name":"relList","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/area#attr-rel\">rel</a></code>\n HTML&nbsp;attribute, indicating relationships of the current document to the linked resource, as a list of tokens.","obsolete":false},{"name":"search","help":"The search element (including leading question mark (?)), if any, of the referenced URL","obsolete":false},{"name":"shape","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/area#attr-shape\">shape</a></code>\n HTML&nbsp;attribute, indicating the shape of the hot-spot, limited to known values.","obsolete":false},{"name":"tabIndex","help":"The element's position in the tabbin order. \n\n<span title=\"\">Obsolete</span> in \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span>","obsolete":true},{"name":"target","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/area#attr-target\">target</a></code>\n HTML&nbsp;attribute, indicating the browsing context in which to open the linked resource.","obsolete":false},{"name":"type","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/area#attr-type\">type</a></code>\n HTML&nbsp;attribute, indicating the MIME type of the linked resource.","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/DOM/HTMLAreaElement"},"SQLError":{"title":"User talk:sdwilsh","members":[],"srcUrl":"https://developer.mozilla.org/User_talk:sdwilsh","skipped":true,"cause":"Suspect title"},"HTMLTableSectionElement":{"title":"thead","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari</th> </tr> <tr> <td>Basic support</td> <td>1.0</td> <td>1.0 (1.7 or earlier)\n</td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> <tr> <td><code>align/valign</code> attribute</td> <td>1.0</td> <td><span title=\"Not supported.\">--</span> <a rel=\"external\" href=\"https://bugzilla.mozilla.org/show_bug.cgi?id=915\" class=\"external\" title=\"\">\nbug 915</a>\n</td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> <tr> <td><code>char/charoff</code> attribute</td> <td>1.0</td> <td><span title=\"Not supported.\">--</span> <a rel=\"external\" href=\"https://bugzilla.mozilla.org/show_bug.cgi?id=2212\" class=\"external\" title=\"\">\nbug 2212</a>\n</td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> <tr> <td><code>bgcolor</code> attribute      </td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> </tr> </tbody>\n</table>\n</div>\n<div id=\"compat-mobile\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td>1.0 (1.0)\n</td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> <tr> <td><code>align/valign</code> attribute</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Not supported.\">--</span> <a rel=\"external\" href=\"https://bugzilla.mozilla.org/show_bug.cgi?id=915\" class=\"external\" title=\"\">\nbug 915</a>\n</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>char/charoff</code> attribute</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Not supported.\">--</span> <a rel=\"external\" href=\"https://bugzilla.mozilla.org/show_bug.cgi?id=2212\" class=\"external\" title=\"\">\nbug 2212</a>\n</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>bgcolor</code> attribute      </td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> </tr> </tbody>\n</table>\n</div>","examples":["See <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/table\">&lt;table&gt;</a></code>\n for examples on<code> &lt;thead&gt;</code>."],"srcUrl":"https://developer.mozilla.org/en/HTML/Element/thead","seeAlso":"<li>Other table-related HTML&nbsp;Elements: <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/caption\">&lt;caption&gt;</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/col\">&lt;col&gt;</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/colgroup\">&lt;colgroup&gt;</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/table\">&lt;table&gt;</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/tbody\">&lt;tbody&gt;</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/td\">&lt;td&gt;</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/tfoot\">&lt;tfoot&gt;</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/th\">&lt;th&gt;</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/tr\">&lt;tr&gt;</a></code>\n;</li> <li>CSS properties and pseudo-classes that may be specially useful to style the <span>&lt;thead&gt;</span> element:&nbsp;<br> <ul> <li>the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/CSS/%3Anth-child\">:nth-child</a></code>\n pseudo-class to set the alignment on the cells of the column;</li> <li>the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/CSS/text-align\">text-align</a></code>\n property to align all cells content on the same character, like '.'.</li> </ul> </li>","summary":"The <em>HTML Table Head Element</em> (<code>&lt;thead&gt;</code>) defines a set of rows defining the head of the columns of the table.","members":[{"obsolete":false,"url":"","name":"valign","help":"This attribute specifies the vertical alignment of the text within each row of cells of the table header. Possible values for this attribute are: <ul> <li><span>baseline</span>, which will put the text as close to the bottom of the cell as it is possible, but align it on the <a class=\" external\" title=\"http://en.wikipedia.org/wiki/Baseline_(typography)\" rel=\"external\" href=\"http://en.wikipedia.org/wiki/Baseline_%28typography%29\" target=\"_blank\">baseline</a> of the characters instead of the bottom of them. If characters are all of the size, this has the same effect as <span>bottom</span>.</li> <li><span>bottom</span>, which will put the text as close to the bottom of the cell as it is possible;</li> <li><span>middle</span>, which will center the text in the cell;</li> <li>and <span>top</span>, which will put the text as close to the top of the cell as it is possible.</li> </ul> <div class=\"note\"><strong>Note: </strong>Do not use this attribute as it is obsolete (and not supported) in the latest standard: instead set the CSS&nbsp;<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/CSS/vertical-align\">vertical-align</a></code>\n property on it.</div>"},{"obsolete":false,"url":"","name":"bgcolor","help":"This attribute defines the background color of each cell of the column. It is one of the 6-digit hexadecimal code as defined in <a title=\"http://www.w3.org/Graphics/Color/sRGB\" class=\" external\" rel=\"external\" href=\"http://www.w3.org/Graphics/Color/sRGB\" target=\"_blank\">sRGB</a>, prefixed by a '#'. One of the sixteen predefined color strings may be used: <table width=\"80%\" cellspacing=\"10\" cellpadding=\"0\" border=\"0\" align=\"center\" summary=\"Table of color names and their sRGB values\"> <tbody> <tr> <td>&nbsp;</td> <td><span>black</span> = \"#000000\"</td> <td>&nbsp;</td> <td><span>green</span> = \"#008000\"</td> </tr> <tr> <td>&nbsp;</td> <td><span>silver</span> = \"#C0C0C0\"</td> <td>&nbsp;</td> <td><span>lime</span> = \"#00FF00\"</td> </tr> <tr> <td>&nbsp;</td> <td><span>gray</span> = \"#808080\"</td> <td>&nbsp;</td> <td><span>olive</span> = \"#808000\"</td> </tr> <tr> <td>&nbsp;</td> <td><span>white</span> = \"#FFFFFF\"</td> <td>&nbsp;</td> <td><span>yellow</span> = \"#FFFF00\"</td> </tr> <tr> <td>&nbsp;</td> <td><span>maroon</span> = \"#800000\"</td> <td>&nbsp;</td> <td><span>navy</span> = \"#000080\"</td> </tr> <tr> <td>&nbsp;</td> <td><span>red</span> = \"#FF0000\"</td> <td>&nbsp;</td> <td><span>blue</span> = \"#0000FF\"</td> </tr> <tr> <td>&nbsp;</td> <td><span>purple</span> = \"#800080\"</td> <td>&nbsp;</td> <td><span>teal</span> = \"#008080\"</td> </tr> <tr> <td>&nbsp;</td> <td><span>fuchsia</span> = \"#FF00FF\"</td> <td>&nbsp;</td> <td><span>aqua</span> = \"#00FFFF\"</td> </tr> </tbody> </table> <div class=\"note\"><strong>Usage note:&nbsp;</strong>Do not use this attribute, as it is non-standard and only implemented in some versions of Microsoft Internet Explorer: the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/thead\">&lt;thead&gt;</a></code>\n element should be styled using <a title=\"en/CSS\" rel=\"internal\" href=\"https://developer.mozilla.org/en/CSS\">CSS</a>. To give a similar effect to the <strong>bgcolor</strong> attribute, use the <a title=\"en/CSS\" rel=\"internal\" href=\"https://developer.mozilla.org/en/CSS\">CSS</a> property <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/CSS/background-color\">background-color</a></code>\n, on the relevant <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/td\">&lt;td&gt;</a></code>\n or <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/th\">&lt;th&gt;</a></code>\n elements.</div>"},{"obsolete":false,"url":"","name":"char","help":"This attribute is used to set the character to align the cells in a column on. Typical values for this include a period (.) when attempting to align numbers or monetary values. If \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/tr#attr-align\">align</a></code>\n is not set to <span>char</span>, this attribute is ignored. <div class=\"note\"><strong>Note: </strong>Do not use this attribute as it is obsolete (and not supported) in the latest standard. To achieve the same effect as the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/thead#attr-char\">char</a></code>\n, in CSS3, you can use the character set using the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/thead#attr-char\">char</a></code>\n attribute as the value of the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/CSS/text-align\">text-align</a></code>\n property \n<span class=\"unimplementedInlineTemplate\">Unimplemented</span>\n.</div>"},{"obsolete":false,"url":"","name":"align","help":"This enumerated attribute specifies how horizontal alignment of each cell content will be handled. Possible values are: <ul> <li><span>left</span>, aligning the content to the left of the cell</li> <li><span>center</span>, centering the content in the cell</li> <li><span>right</span>, aligning the content to the right of the cell</li> <li><span>justify</span>, inserting spaces into the textual content so that the content is justified in the cell</li> <li><span>char</span>, aligning the textual content on a special character with a minimal offset, defined by the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/thead#attr-char\">char</a></code>\n and \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/thead#attr-charoff\">charoff</a></code>\n attributes \n<span class=\"unimplementedInlineTemplate\">Unimplemented (see<a rel=\"external\" href=\"https://bugzilla.mozilla.org/show_bug.cgi?id=2212\" class=\"external\" title=\"\">\nbug 2212</a>\n)</span>\n.</li> </ul> <p>If this attribute is not set,&nbsp; the <span>left</span> value is assumed.</p> <div class=\"note\"><strong>Note: </strong>Do not use this attribute as it is obsolete (not supported) in the latest standard. <ul> <li>To achieve the same effect as the <span>left</span>, <span>center</span>, <span>right</span> or <span>justify</span> values, use the CSS <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/CSS/text-align\">text-align</a></code>\n property on it.</li> <li>To achieve the same effect as the <span>char</span> value, in CSS3, you can use the value of the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/thead#attr-char\">char</a></code>\n as the value of the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/CSS/text-align\">text-align</a></code>\n property \n<span class=\"unimplementedInlineTemplate\">Unimplemented</span>\n.</li> </ul> </div>"},{"obsolete":false,"url":"","name":"charoff","help":"This attribute is used to indicate the number of characters to offset the column data from the alignment characters specified by the <strong>char</strong> attribute. <div class=\"note\"><strong>Note: </strong>Do not use this attribute as it is obsolete (and not supported) in the latest standard.</div>"}]},"SVGNumberList":{"title":"SVGNumberList","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>","summary":"<p>The <code>SVGNumberList</code> defines a list of <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/SVGNumber\">SVGNumber</a></code>\n objects.</p>\n<p>An <code>SVGNumberList</code> object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown.</p>\n<div class=\"geckoVersionNote\"> <p>\n</p><div class=\"geckoVersionHeading\">Gecko 5.0 note<div>(Firefox 5.0 / Thunderbird 5.0 / SeaMonkey 2.2)\n</div></div>\n<p></p> <p>Starting in Gecko 5.0 (Firefox 5.0 / Thunderbird 5.0 / SeaMonkey 2.2)\n,the <code>SVGNumberList</code> DOM interface is now indexable and can be accessed like arrays</p>\n</div>","members":[{"name":"clear","help":"<p>Clears all existing current items from the list, with the result being an empty list.</p> <p><strong>Exceptions:</strong></p> <ul> <li>a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DOMException\">DOMException</a></code>\n with code <code>NO_MODIFICATION_ALLOWED_ERR</code> is raised when the list corresponds to a read only attribute or when the object itself is read only.</li> </ul>","obsolete":false},{"name":"initialize","help":"<p>Clears all existing current items from the list and re-initializes the list to hold the single item specified by the parameter. If the inserted item is already in a list, it is removed from its previous list before it is inserted into this list. The inserted item is the item itself and not a copy. The return value is the item inserted into the list.</p> <p><strong>Exceptions:</strong></p> <ul> <li>a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DOMException\">DOMException</a></code>\n with code <code>NO_MODIFICATION_ALLOWED_ERR</code> is raised when the list corresponds to a read only attribute or when the object itself is read only.</li> </ul>","obsolete":false},{"name":"getItem","help":"<p>Returns the specified item from the list. The returned item is the item itself and not a copy. Any changes made to the item are immediately reflected in the list. The first item is number&nbsp;0.</p> <p><strong>Exceptions:</strong></p> <ul> <li>a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DOMException\">DOMException</a></code>\n with code <code>NO_MODIFICATION_ALLOWED_ERR</code> is raised when the list corresponds to a read only attribute or when the object itself is read only.</li> </ul>","obsolete":false},{"name":"insertItemBefore","help":"<p>Inserts a new item into the list at the specified position. The first item is number 0. If <code>newItem</code> is already in a list, it is removed from its previous list before it is inserted into this list. The inserted item is the item itself and not a copy. If the item is already in this list, note that the index of the item to insert before is before the removal of the item. If the <code>index</code> is equal to 0, then the new item is inserted at the front of the list. If the index is greater than or equal to <code>numberOfItems</code>, then the new item is appended to the end of the list.</p> <p><strong>Exceptions:</strong></p> <ul> <li>a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DOMException\">DOMException</a></code>\n with code <code>NO_MODIFICATION_ALLOWED_ERR</code> is raised when the list corresponds to a read only attribute or when the object itself is read only.</li> </ul>","obsolete":false},{"name":"replaceItem","help":"<p>Replaces an existing item in the list with a new item. If <code>newItem</code> is already in a list, it is removed from its previous list before it is inserted into this list. The inserted item is the item itself and not a copy. If the item is already in this list, note that the index of the item to replace is before the removal of the item.</p> <p><strong>Exceptions:</strong></p> <ul> <li>a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DOMException\">DOMException</a></code>\n with code <code>NO_MODIFICATION_ALLOWED_ERR</code> is raised when the list corresponds to a read only attribute or when the object itself is read only.</li> <li>a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DOMException\">DOMException</a></code>\n with code <code>INDEX_SIZE_ERR</code> is raised if the index number is greater than or equal to <code>numberOfItems</code>.</li> </ul>","obsolete":false},{"name":"removeItem","help":"<p>Removes an existing item from the list.</p> <p><strong>Exceptions:</strong></p> <ul> <li>a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DOMException\">DOMException</a></code>\n with code <code>NO_MODIFICATION_ALLOWED_ERR</code> is raised when the list corresponds to a read only attribute or when the object itself is read only.</li> <li>a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DOMException\">DOMException</a></code>\n with code <code>INDEX_SIZE_ERR</code> is raised if the index number is greater than or equal to <code>numberOfItems</code>.</li> </ul>","obsolete":false},{"name":"appendItem","help":"<p>Inserts a new item at the end of the list. If <code>newItem</code> is already in a list, it is removed from its previous list before it is inserted into this list. The inserted item is the item itself and not a copy.</p> <p><strong>Exceptions:</strong></p> <ul> <li>a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DOMException\">DOMException</a></code>\n with code <code>NO_MODIFICATION_ALLOWED_ERR</code> is raised when the list corresponds to a read only attribute or when the object itself is read only.</li> </ul>","obsolete":false},{"name":"numberOfItem","help":"The number of items in the list.","obsolete":false},{"name":"length","help":"The number of items in the list.","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/DOM/SVGNumberList"},"HTMLFrameSetElement":{"title":"frameset","summary":"<code>&lt;frameset&gt;</code> is an HTML element which is used to contain <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/frame\">&lt;frame&gt;</a></code>\n elements.","members":[],"srcUrl":"https://developer.mozilla.org/en/HTML/Element/frameset"},"ClientRectList":{"title":"Interface documentation status","members":[],"srcUrl":"https://developer.mozilla.org/User:trevorh/Interface_documentation_status","skipped":true,"cause":"Suspect title"},"SVGStylable":{"title":"SVGStylable","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody>\n</table>\n</div>\n<div id=\"compat-mobile\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody>\n</table>\n</div>","summary":"The <code>SVGStylable</code> interface is implemented on all objects corresponding to SVG elements that can have \n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Attribute/style\">style</a></code>, {{SVGAttr(\"class\") and presentation attributes specified on them.","members":[{"name":"getPresentationAttribute","help":"Returns the base (i.e., static) value of a given presentation attribute as an object of type <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/CSSValue\" class=\"new\">CSSValue</a></code>\n. The returned object is live; changes to the objects represent immediate changes to the objects to which the <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/CSSValue\" class=\"new\">CSSValue</a></code>\n is attached.","obsolete":false},{"name":"className","help":"Corresponds to attribute \n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Attribute/class\">class</a></code> on the given element.","obsolete":false},{"name":"style","help":"Corresponds to attribute \n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Attribute/style\">style</a></code> on the given element.","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/DOM/SVGStylable"},"SVGPaint":{"title":"Content type","members":[],"srcUrl":"https://developer.mozilla.org/en/SVG/Content_type","skipped":true,"cause":"Suspect title"},"SVGImageElement":{"title":"SVGImageElement","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>","summary":"The <code>SVGImageElement</code> interface corresponds to the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/image\">&lt;image&gt;</a></code>\n element.","members":[{"name":"width","help":"Corresponds to attribute \n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Attribute/width\">width</a></code> on the given <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/image\">&lt;image&gt;</a></code>\n element.","obsolete":false},{"name":"height","help":"Corresponds to attribute \n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Attribute/height\">height</a></code> on the given <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/image\">&lt;image&gt;</a></code>\n element.","obsolete":false},{"name":"preserveAspectRatio","help":"Corresponds to attribute \n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Attribute/preserveAspectRatio\">preserveAspectRatio</a></code> on the given <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/image\">&lt;image&gt;</a></code>\n element.","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/DOM/SVGImageElement"},"MediaQueryListListener":{"title":"MediaQueryListListener","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td>6.0 (6.0)\n</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody>\n</table>\n</div>\n<div id=\"compat-mobile\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody>\n</table>\n</div>","srcUrl":"https://developer.mozilla.org/en/DOM/MediaQueryListListener","specification":"The CSSOM&nbsp;View Module:&nbsp;The&nbsp;MediaQueryList Interface","seeAlso":"<li><a title=\"En/CSS/Media queries\" rel=\"internal\" href=\"https://developer.mozilla.org/En/CSS/Media_queries\">Media queries</a></li> <li><a title=\"en/CSS/Using media queries from code\" rel=\"internal\" href=\"https://developer.mozilla.org/en/CSS/Using_media_queries_from_code\">Using media queries from code</a></li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/MediaQueryList\">MediaQueryList</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/window.matchMedia\">window.matchMedia()</a></code>\n</li>","summary":"<div><strong>DRAFT</strong>\n<div>This page is not complete.</div>\n</div>\n\n<p></p>\n<p>A <code>MediaQueryList</code> object maintains a list of <a title=\"En/CSS/Media queries\" rel=\"internal\" href=\"https://developer.mozilla.org/En/CSS/Media_queries\">media queries</a> on a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/document\">document</a></code>\n, and handles sending notifications to listeners when the media queries on the document change.</p>\n<p>This makes it possible to observe a document to detect when its media queries change, instead of polling the values periodically, if you need to programmatically detect changes to the values of media queries on a document.</p>","members":[]},"HTMLLinkElement":{"title":"link","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari</th> </tr> <tr> <td>Basic support</td> <td>1.0</td> <td>1.0 (1.7 or earlier)\n</td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> <tr> <td>Alternative stylesheets</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td>3.0 (1.9)\n</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>disabled</code> attribute      </td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> </tr> <tr> <td><code>methods</code> attribute      </td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td>4.0</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> </tr> <tr> <td><code>sizes</code> attribute</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span> <a rel=\"external\" href=\"https://bugzilla.mozilla.org/show_bug.cgi?id=441770\" class=\"external\" title=\"\">\nbug 441770</a>\n</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> </tr> <tr> <td><code>load</code> and <code>error</code> events</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td>9.0 (9.0)\n</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td>1.0 (1.0)\n</td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> <tr> <td>Alternative stylesheets</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td>4.0 (2.0)\n</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>disabled</code> attribute      </td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> </tr> <tr> <td><code>methods</code> attribute      </td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td>4.0</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> </tr> <tr> <td><code>sizes</code> attribute</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span> <a rel=\"external\" href=\"https://bugzilla.mozilla.org/show_bug.cgi?id=441770\" class=\"external\" title=\"\">\nbug 441770</a>\n</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> </tr> <tr> <td><code>load</code> and <code>error</code> events</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td>9.0 (9.0)\n</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>","summary":"The <em>HTML Link Element</em> (&lt;link&gt;) specifies relationships between the current document and other documents. Possible uses for this element include defining a relational framework for navigation and linking the document to a style sheet.","members":[{"obsolete":false,"url":"","name":"target","help":"Defines the frame or window name that has the defined linking relationship or that will show the rendering of any linked resource."},{"obsolete":false,"url":"","name":"media","help":"This attribute specifies the media which the linked resource applies to. Its value must be a <a title=\"En/CSS/Media queries\" rel=\"internal\" href=\"https://developer.mozilla.org/en/CSS/Media_queries\">media query</a>. This attribute is mainly useful when linking to external stylesheets by allowing the user agent to pick the best adapted one for the device it runs on.<br> <div class=\"note\"><strong>Usage note:&nbsp;</strong> <p>&nbsp;</p> <ul> <li>In HTML 4, this can only be a simple white-space-separated list of media description literals, i.e., <a title=\"https://developer.mozilla.org/en/CSS/@media\" rel=\"internal\" href=\"https://developer.mozilla.org/en/CSS/@media\">media types and groups</a>, where defined and allowed as values for this attribute, such as <span>print</span>, <span>screen</span>, <span>aural</span>, <span>braille.</span> HTML5 extended this to any kind of <a title=\"En/CSS/Media queries\" rel=\"internal\" href=\"https://developer.mozilla.org/en/CSS/Media_queries\">media queries</a>, which are a superset of the allowed values of HTML 4.</li> <li>Browsers not supporting the <a title=\"En/CSS/Media queries\" rel=\"internal\" href=\"https://developer.mozilla.org/en/CSS/Media_queries\">CSS3 Media Queries</a> won't necessary recognized the adequate link; do not forget to set fallback links,&nbsp; the restricted set of media queries defined in HTML 4.</li> </ul> </div>"},{"obsolete":false,"url":"","name":"hreflang","help":"This attribute indicates the language of the linked resource. It is purely advisory. Allowed values are determined by <a class=\"external\" title=\"http://www.ietf.org/rfc/bcp/bcp47.txt\" rel=\"external\" href=\"http://www.ietf.org/rfc/bcp/bcp47.txt\" target=\"_blank\">BCP47</a> for HTML5 and by <a class=\"external\" title=\"http://www.ietf.org/rfc/rfc1766.txt\" rel=\"external\" href=\"http://www.ietf.org/rfc/rfc1766.txt\" target=\"_blank\">RFC1766</a> for HTML 4. Use this attribute only if the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/a#attr-href\">href</a></code>\n attribute is present."},{"obsolete":false,"url":"","name":"rel","help":"This attribute names a relationship of the linked document to the current document. The attribute must be a space-separated list of the <a title=\"en/HTML/Link types\" rel=\"internal\" href=\"https://developer.mozilla.org/en/HTML/Link_types\">link types values</a>. The most common use of this attribute is to specify a link to an external style sheet:&nbsp;the <strong>rel</strong> attribute is set to <code>stylesheet</code>, and the <strong>href</strong> attribute is set to the URL of an external style sheet to format the page. WebTV also supports the use of the value <code>next</code> for <strong>rel</strong> to preload the next page in a document series."},{"obsolete":false,"url":"","name":"sizes","help":"This attribute defines the sizes of the icons for visual media contained in the resource. It must be present only if the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/link#attr-rel\">rel</a></code>\n contains the <span>icon</span> <a title=\"en/HTML/Link types\" rel=\"internal\" href=\"https://developer.mozilla.org/en/HTML/Link_types\">link types value</a>. It may have the following values: <ul> <li><span>any</span>, meaning that the icon can be scaled to any size as it is in a vectorial format, like <span>image/svg</span>.</li> <li>a white-space separated list of sizes, each in the format <span><em>&lt;width in pixels&gt;</em>x<em>&lt;height in pixels&gt;</em></span> or <span><em>&lt;width in pixels&gt;</em>X<em>&lt;height in pixels&gt;</em></span>. Each of these sizes must be contained in the resource.</li> </ul> <div class=\"note\"><strong>Usage note:&nbsp;</strong> <p>&nbsp;</p> <ul> <li>Most icon format are only able to store one single icon; therefore most of the time the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element#attr-sizes\">sizes</a></code>\n contains only one entry. Among the major browsers, only the Apple's ICNS format allows the storage of multiple icons, and this format is only supported in WebKit.</li> <li>Apple's iOS does not support this attribute, hence Apple's iPhone and iPad use special, non-standard <a title=\"en/HTML/Link types\" rel=\"internal\" href=\"https://developer.mozilla.org/en/HTML/Link_types\">link types values</a> to define icon to be used as Web Clip or start-up placeholder: <span>apple-touch-icon</span> and <span>apple-touch-startup-icon</span>.</li> </ul> </div>"},{"obsolete":false,"url":"","name":"methods","help":"The value of this attribute provides information about the functions that might be performed on an object. The values generally are given by the HTTP protocol when it is used, but it might (for similar reasons as for the <strong>title</strong> attribute) be useful to include advisory information in advance in the link. For example, the browser might choose a different rendering of a link as a function of the methods specified; something that is searchable might get a different icon, or an outside link might render with an indication of leaving the current site. This attribute is not well understood nor supported, even by the defining browser, Internet Explorer 4. See <a class=\"external\" href=\"http://msdn.microsoft.com/en-us/library/ms534168%28VS.85%29.aspx\" rel=\"external nofollow\" target=\"_blank\" title=\"http://msdn.microsoft.com/en-us/library/ms534168(VS.85).aspx\">Methods Property (MSDN)</a>."},{"obsolete":false,"url":"","name":"href","help":"This attribute specifies the <a title=\"https://developer.mozilla.org/en/URIs_and_URLs\" rel=\"internal\" href=\"https://developer.mozilla.org/en/URIs_and_URLs\">URL</a> of the linked resource. A URL might be absolute or relative."},{"obsolete":false,"url":"","name":"charset","help":"This attribute defines the character encoding of the linked resource. The value is a space- and/or comma-delimited list of character sets as defined in <a class=\"external\" title=\"http://tools.ietf.org/html/rfc2045\" rel=\"external\" href=\"http://tools.ietf.org/html/rfc2045\" target=\"_blank\">RFC 2045</a>. The default value is ISO-8859-1. <div class=\"note\"><strong>Usage note: </strong>This attribute is obsolete in HTML5 and <span>must</span><strong> not be used by authors</strong>. To achieve its effect, use the <span>Content-Type:</span> HTTP header on the linked resource.</div>"},{"obsolete":false,"url":"","name":"rev","help":"The value of this attribute shows the relationship of the current document to the linked document, as defined by the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/link#attr-href\">href</a></code>\n attribute. The attribute thus defines the reverse relationship compared to the value of the <strong>rel</strong> attribute. <a title=\"en/HTML/Link types\" rel=\"internal\" href=\"https://developer.mozilla.org/en/HTML/Link_types\">Link types values</a> for the attribute are similar to the possible values for \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/link#attr-rel\">rel</a></code>\n.<br> <div class=\"note\"><strong>Usage note: </strong>This attribute is obsolete in HTML5. <strong>Do not use it</strong>. To achieve its effect, use the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/link#attr-rel\">rel</a></code>\n attribute with the opposite <a title=\"en/HTML/Link types\" rel=\"internal\" href=\"https://developer.mozilla.org/en/HTML/Link_types\">link types values</a>, e.g. <span>made</span> should be replaced by <span>author</span>. Also this attribute doesn't mean <em>revision</em> and must not be used with a version number, which is unfortunately the case on numerous sites.</div>"},{"obsolete":false,"url":"","name":"type","help":"This attribute is used to define the type of the content linked to. The value of the attribute should be a MIME type such as <strong>text/html</strong>, <strong>text/css</strong>, and so on. The common use of this attribute is to define the type of style sheet linked and the most common current value is <strong>text/css</strong>, which indicates a Cascading Style Sheet format."},{"obsolete":false,"url":"","name":"disabled","help":"This attribute is used to disable a link relationship. In conjunction with scripting, this attribute could be used to turn on and off various style sheet relationships. <div class=\"note\"> <p><strong>Note: </strong>While there is no <code>disabled</code> attribute in the HTML standard, there <strong>is</strong> a <code>disabled</code> attribute on the <code>HTMLLinkElement</code> DOM object.</p> <p>The use of&nbsp;<code>disabled</code> as an HTML attribute is non-standard and only used by some Microsoft browsers. <span>Do not use it</span>. To achieve a similar effect, use one of the following techniques:</p> <ul> <li>If the <code>disabled</code> attribute has been added directly to the element on the page, do not include the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/link\">&lt;link&gt;</a></code>\n element instead;</li> <li>Set the <code>disabled</code> <strong>property</strong> of the DOM object via scripting.</li> </ul> </div>"}],"srcUrl":"https://developer.mozilla.org/en/HTML/Element/link"},"CanvasPattern":{"title":"CanvasPattern","summary":"This is an opaque object created by <a title=\"en/DOM/CanvasRenderingContext2D\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/CanvasRenderingContext2D\">CanvasRenderingContext2D</a>'s <a title=\"en/DOM/CanvasRenderingContext2D.createPattern\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/CanvasRenderingContext2D.createPattern\" class=\"new \">createPattern</a> method (whether based on a image, canvas, or video).","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/CanvasPattern","specification":"http://www.whatwg.org/specs/web-apps...#canvaspattern"},"SVGAnimatedAngle":{"title":"SVGAnimatedAngle","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody>\n</table>\n</div>\n<div id=\"compat-mobile\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody>\n</table>\n</div>","summary":"The <code>SVGAnimatedAngle</code> interface is used for attributes of basic type <a title=\"https://developer.mozilla.org/en/SVG/Content_type#Angle\" rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Content_type#Angle\">&lt;angle&gt;</a> which can be animated.","members":[{"name":"baseVal","help":"The base value of the given attribute before applying any animations.","obsolete":false},{"name":"animVal","help":"A read only <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/SVGAngle\">SVGAngle</a></code>\n representing the current animated value of the given attribute. If the given attribute is not currently being animated, then the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/SVGAngle\">SVGAngle</a></code>\n will have the same contents as <code>baseVal</code>. The object referenced by <code>animVal</code> will always be distinct from the one referenced by <code>baseVal</code>, even when the attribute is not animated.","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/DOM/SVGAnimatedAngle"},"ProgressEvent":{"title":"nsIDOMProgressEvent","seeAlso":"<li><a title=\"En/Using XMLHttpRequest\" class=\"internal\" rel=\"internal\" href=\"https://developer.mozilla.org/En/XMLHttpRequest/Using_XMLHttpRequest\">Using XMLHttpRequest</a></li> <li><a title=\"En/XMLHttpRequest\" class=\"internal\" rel=\"internal\" href=\"https://developer.mozilla.org/en/XMLHttpRequest\">XMLHttpRequest</a></li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsIXMLHttpRequestEventTarget\">nsIXMLHttpRequestEventTarget</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/nsIXMLHttpRequest\">nsIXMLHttpRequest</a></code>\n</li>","summary":"<div><div>\n\n<a rel=\"custom\" href=\"http://mxr.mozilla.org/mozilla-central/source/dom/interfaces/events/nsIDOMProgressEvent.idl\"><code>dom/interfaces/events/nsIDOMProgressEvent.idl</code></a><span><a rel=\"internal\" href=\"https://developer.mozilla.org/en/Interfaces/About_Scriptable_Interfaces\" title=\"en/Interfaces/About_Scriptable_Interfaces\">Scriptable</a></span></div><span>This interface represents the events sent with progress information while uploading data using the <code>XMLHttpRequest</code> object.</span><div><div>1.0</div><div>11.0</div><div></div><div>Introduced</div><div>Gecko 1.9.1</div><div title=\"Introduced in Gecko 1.9.1 (Firefox 3.5 / Thunderbird 3.0 / SeaMonkey 2.0)\n\"></div><div title=\"Last changed in Gecko 1.9.1 (Firefox 3.5 / Thunderbird 3.0 / SeaMonkey 2.0)\n\"></div></div>\n<div>Inherits from: <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsIDOMEvent\">nsIDOMEvent</a></code>\n<span>Last changed in Gecko 1.9.1 (Firefox 3.5 / Thunderbird 3.0 / SeaMonkey 2.0)\n</span></div></div>\n<p></p>\n<p>The <code>nsIDOMProgressEvent</code> is used in the media elements (<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/video\">&lt;video&gt;</a></code>\n and <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/audio\">&lt;audio&gt;</a></code>\n) to inform interested code of the progress of the media download. This implementation is a placeholder until the specification is complete, and is compatible with the WebKit ProgressEvent.</p>","members":[{"name":"initProgressEvent","help":"<p>Initializes the progress event object.</p>\n\n<div id=\"section_5\"><span id=\"Parameters\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>typeArg</code></dt> <dd>The type of event. Must be one of \"<code>abort</code>\", \"<code>error</code>\", \"<code>load</code>\", \"<code>loadstart</code>\", or \"<code>progress</code>\".</dd> <dt><code>canBubbleArg</code></dt> <dd>Specifies whether or not the created event will bubble.</dd> <dt><code>cancelableArg</code></dt> <dd>Specifies whether or not the created event can be canceled.</dd> <dt><code>lengthComputableArg</code></dt> <dd>If the size of the data to be transferred is known, this should be <code>true</code>. Otherwise, specify <code>false</code>.</dd> <dt><code>loadedArg</code></dt> <dd>The number of bytes already transferred. Must be a non-negative value.</dd> <dt><code>totalArg</code></dt> <dd>The total number of bytes to be transferred. If <code>lengthComputable</code> is <code>false</code>, this must be zero.</dd>\n</dl>\n</div>","idl":"<pre class=\"eval\">void initProgressEvent(\n  in DOMString typeArg,\n  in boolean canBubbleArg,\n  in boolean cancelableArg,\n  in boolean lengthComputableArg,\n  in unsigned long long loadedArg,\n  in unsigned long long totalArg\n);\n</pre>","obsolete":false},{"name":"lengthComputable","help":"Specifies whether or not the total size of the transfer is known. <strong>Read only.</strong>","obsolete":false},{"name":"loaded","help":"The number of bytes transferred since the beginning of the operation. This doesn't include headers and other overhead, but only the content itself. <strong>Read only.</strong>","obsolete":false},{"name":"total","help":"The total number of bytes of content that will be transferred during the operation. If the total size is unknown, this value is zero. <strong>Read only.</strong>","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/XPCOM_Interface_Reference/NsIDOMProgressEvent"},"Screen":{"title":"window.screen","examples":["if (screen.pixelDepth &lt; 8) {\n  // use low-color version of page\n} else { \n  // use regular, colorful page\n}\n"],"summary":"Returns a reference to the screen object associated with the window.","members":[{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.screen.left","name":"left","help":"Returns the distance in pixels from the left side of the main screen to the left side of the current screen."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.screen.availWidth","name":"availWidth","help":"Returns the amount of horizontal space in pixels available to the window."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.screen.top","name":"top","help":"Returns the distance in pixels from the top side of the current screen."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.screen.colorDepth","name":"colorDepth","help":"Returns the color depth of the screen."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.screen.height","name":"height","help":"Returns the height of the screen in pixels."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.screen.availLeft","name":"availLeft","help":"Returns the first available pixel available from the left side of the screen."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.screen.pixelDepth","name":"pixelDepth","help":"Gets the bit depth of the screen."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.screen.width","name":"width","help":"Returns the width of the screen."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.screen.availTop","name":"availTop","help":"Specifies the y-coordinate of the first pixel that is not allocated to permanent or semipermanent user interface features."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.screen.availHeight","name":"availHeight","help":"Specifies the height of the screen, in pixels, minus permanent or semipermanent user interface features displayed by the operating system, such as the Taskbar on Windows."}],"srcUrl":"https://developer.mozilla.org/en/DOM/window.screen"},"SVGLengthList":{"title":"SVGLengthList","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody>\n</table>\n</div>\n<div id=\"compat-mobile\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody>\n</table>\n</div>","summary":"<p>The <code>SVGLengthList</code> defines a list of <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/SVGLength\">SVGLength</a></code>\n objects.</p>\n<p>An <code>SVGLengthList</code> object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown.</p>\n<div class=\"geckoVersionNote\">\n<p>\n</p><div class=\"geckoVersionHeading\">Gecko 5.0 note<div>(Firefox 5.0 / Thunderbird 5.0 / SeaMonkey 2.2)\n</div></div>\n<p></p>\n<p>Starting in Gecko 5.0 (Firefox 5.0 / Thunderbird 5.0 / SeaMonkey 2.2)\n,the <code>SVGLengthList</code> DOM interface is now indexable and can be accessed like arrays</p>\n</div>","members":[{"name":"clear","help":"<p>Clears all existing current items from the list, with the result being an empty list.</p> <p><strong>Exceptions:</strong></p> <ul> <li>a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DOMException\">DOMException</a></code>\n with code <code>NO_MODIFICATION_ALLOWED_ERR</code> is raised when the list corresponds to a read only attribute or when the object itself is read only.</li> </ul>","obsolete":false},{"name":"initialize","help":"<p>Clears all existing current items from the list and re-initializes the list to hold the single item specified by the parameter. If the inserted item is already in a list, it is removed from its previous list before it is inserted into this list. The inserted item is the item itself and not a copy. The return value is the item inserted into the list.</p> <p><strong>Exceptions:</strong></p> <ul> <li>a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DOMException\">DOMException</a></code>\n with code <code>NO_MODIFICATION_ALLOWED_ERR</code> is raised when the list corresponds to a read only attribute or when the object itself is read only.</li> </ul>","obsolete":false},{"name":"getItem","help":"<p>Returns the specified item from the list. The returned item is the item itself and not a copy. Any changes made to the item are immediately reflected in the list. The first item is number&nbsp;0.</p> <p><strong>Exceptions:</strong></p> <ul> <li>a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DOMException\">DOMException</a></code>\n with code <code>NO_MODIFICATION_ALLOWED_ERR</code> is raised when the list corresponds to a read only attribute or when the object itself is read only.</li> </ul>","obsolete":false},{"name":"insertItemBefore","help":"<p>Inserts a new item into the list at the specified position. The first item is number 0. If <code>newItem</code> is already in a list, it is removed from its previous list before it is inserted into this list. The inserted item is the item itself and not a copy. If the item is already in this list, note that the index of the item to insert before is before the removal of the item. If the <code>index</code> is equal to 0, then the new item is inserted at the front of the list. If the index is greater than or equal to <code>numberOfItems</code>, then the new item is appended to the end of the list.</p> <p><strong>Exceptions:</strong></p> <ul> <li>a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DOMException\">DOMException</a></code>\n with code <code>NO_MODIFICATION_ALLOWED_ERR</code> is raised when the list corresponds to a read only attribute or when the object itself is read only.</li> </ul>","obsolete":false},{"name":"replaceItem","help":"<p>Replaces an existing item in the list with a new item. If <code>newItem</code> is already in a list, it is removed from its previous list before it is inserted into this list. The inserted item is the item itself and not a copy. If the item is already in this list, note that the index of the item to replace is before the removal of the item.</p> <p><strong>Exceptions:</strong></p> <ul> <li>a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DOMException\">DOMException</a></code>\n with code <code>NO_MODIFICATION_ALLOWED_ERR</code> is raised when the list corresponds to a read only attribute or when the object itself is read only.</li> <li>a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DOMException\">DOMException</a></code>\n with code <code>INDEX_SIZE_ERR</code> is raised if the index number is greater than or equal to <code>numberOfItems</code>.</li> </ul>","obsolete":false},{"name":"removeItem","help":"<p>Removes an existing item from the list.</p> <p><strong>Exceptions:</strong></p> <ul> <li>a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DOMException\">DOMException</a></code>\n with code <code>NO_MODIFICATION_ALLOWED_ERR</code> is raised when the list corresponds to a read only attribute or when the object itself is read only.</li> <li>a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DOMException\">DOMException</a></code>\n with code <code>INDEX_SIZE_ERR</code> is raised if the index number is greater than or equal to <code>numberOfItems</code>.</li> </ul>","obsolete":false},{"name":"appendItem","help":"<p>Inserts a new item at the end of the list. If <code>newItem</code> is already in a list, it is removed from its previous list before it is inserted into this list. The inserted item is the item itself and not a copy.</p> <p><strong>Exceptions:</strong></p> <ul> <li>a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DOMException\">DOMException</a></code>\n with code <code>NO_MODIFICATION_ALLOWED_ERR</code> is raised when the list corresponds to a read only attribute or when the object itself is read only.</li> </ul>","obsolete":false},{"name":"numberOfItem","help":"The number of items in the list.","obsolete":false},{"name":"length","help":"The number of items in the list.","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/DOM/SVGLengthList"},"SVGViewSpec":{"title":"SVGSVGElement","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/SVGSVGElement","skipped":true,"cause":"Suspect title"},"HTMLModElement":{"title":"HTMLModElement","seeAlso":"<li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/del\">&lt;del&gt;</a></code>\n&nbsp;HTML&nbsp;element</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/ins\">&lt;ins&gt;</a></code>\n&nbsp;HTML&nbsp;element</li>","summary":"DOM mod (modification)&nbsp;objects expose the <a title=\"http://www.w3.org/TR/html5/edits.html#htmlmodelement\" class=\" external\" rel=\"external nofollow\" href=\"http://www.w3.org/TR/html5/edits.html#htmlmodelement\" target=\"_blank\">HTMLModElement</a> (or <span><a rel=\"custom nofollow\" href=\"https://developer.mozilla.org/en/HTML\">HTML 4</a></span> <a class=\" external\" rel=\"external nofollow\" href=\"http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-79359609\" title=\"http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-79359609\" target=\"_blank\"><code>HTMLModElement</code></a>) interface, which provides special properties (beyond the regular <a rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/element\">element</a> object interface they also have available to them by inheritance) for manipulating modification elements.","members":[{"name":"cite","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/del#attr-cite\">cite</a></code>\n HTML attribute, containing a URI of a resource explaining the change.","obsolete":false},{"name":"datetime","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/del#attr-datetime\">datetime</a></code>\n HTML attribute, containing a date-and-time string representing a timestamp for the change.","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/DOM/HTMLModElement"},"IDBKeyRange":{"title":"IDBKeyRange","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Asynchronous API</td> <td>12 \n<span title=\"prefix\">-webkit</span></td> <td>4.0 (2.0)\n</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> </tr> <tr> <td>Synchronous API<br> (used with <a title=\"https://developer.mozilla.org/En/Using_web_workers\" rel=\"internal\" href=\"https://developer.mozilla.org/En/Using_web_workers\">WebWorkers</a>)</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE&nbsp;Phone</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Asynchronous API</td> <td><span title=\"Not supported.\">--</span></td> <td>6.0 (6.0)\n</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> </tr> </tbody> </table>\n</div>","summary":"The <code>IDBKeyRange</code> interface of the <a title=\"en/IndexedDB\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB\">IndexedDB API</a> represents a continuous interval over some data type that is used for keys. Records can be retrieved from object stores and indexes using keys or a range of keys. You can limit the range using lower and upper bounds. For example, you can iterate over all values of a key between x and y.","members":[{"name":"lowerBound","help":"<p>Creates a key range with only a lower bound. By default, it includes the lower endpoint value and is closed.</p>\n<pre>IDBKeyRange lowerBound (\n  in any bound, \n  in optional boolean open\n);\n</pre>\n<div id=\"section_17\"><span id=\"Parameters_3\"></span><h5 class=\"editable\">Parameters</h5>\n<dl> <dt>bound</dt> <dd>The value of the lower bound.</dd> <dt>open</dt> <dd><em>Optional</em>. If false (default value), the range includes the lower-bound value.</dd>\n</dl>\n</div><div id=\"section_18\"><span id=\"Returns_3\"></span><h5 class=\"editable\">Returns</h5>\n<dl> <dt><code>IDBKeyRange</code></dt> <dd>The newly created key range.</dd>\n</dl>\n</div><div id=\"section_19\"><span id=\"Exceptions_3\"></span><h5 class=\"editable\">Exceptions</h5>\n<p>This method can raise an <a title=\"en/IndexedDB/IDBDatabaseException\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException\">IDBDatabaseException</a> with the following code:</p>\n<dl> <dt><code><a title=\"en/IndexedDB/IDBObjectStore\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBObjectStore\">DATA_ERR</a></code></dt> <dd>The value parameter was not passed a valid key.</dd>\n</dl>\n</div>","obsolete":false},{"name":"only","help":"<p>Creates a new key range containing a single value.</p>\n<pre>IDBKeyRange only (\n  in any value\n);\n</pre>\n<div id=\"section_13\"><span id=\"Parameters_2\"></span><h5 class=\"editable\">Parameters</h5>\n<dl> <dt>value</dt> <dd>The single value in the key range.</dd>\n</dl>\n</div><div id=\"section_14\"><span id=\"Returns_2\"></span><h5 class=\"editable\">Returns</h5>\n<dl> <dt><code>IDBKeyRange</code></dt> <dd>The newly created key range.</dd>\n</dl>\n</div><div id=\"section_15\"><span id=\"Exceptions_2\"></span><h5 class=\"editable\">Exceptions</h5>\n<p>This method can raise an <a title=\"en/IndexedDB/IDBDatabaseException\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException\">IDBDatabaseException</a> with the following code:</p>\n<dl> <dt><code><a title=\"en/IndexedDB/IDBObjectStore\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#DATA_ERR\">DATA_ERR</a></code></dt> <dd>The value parameter was not passed a valid key.</dd>\n</dl>\n</div>","obsolete":false},{"name":"bound","help":"<p>Creates a key range with upper and lower bounds. The bounds can be open (that is, the bounds excludes the endpoint values) or closed (that is, the bounds includes the endpoint values). By default, the bounds include the endpoints and are closed.</p>\n<pre>IDBKeyRange bound (\n   in any lower,\n   in any upper, \n   in optional boolean lowerOpen, \n   in optional boolean upperOpen\n);\n</pre>\n<div id=\"section_9\"><span id=\"Parameters\"></span><h5 class=\"editable\">Parameters</h5>\n<dl> <dt>lower</dt> <dd>The lower bound of the key range.</dd> <dt>upper</dt> <dd>The upper bound of the key range.</dd> <dt>lowerOpen</dt> <dd><em>Optional</em>. If false (default value), the range includes the lower bound value of the key range.</dd> <dt>upperOpen</dt> <dd><em>Optional</em>. If false (default value), the range includes the upper bound value of the key range.</dd>\n</dl>\n</div><div id=\"section_10\"><span id=\"Returns\"></span><h5 class=\"editable\">Returns</h5>\n<dl> <dt><code>IDBKeyRange</code></dt> <dd>The newly created key range.</dd>\n</dl>\n</div><div id=\"section_11\"><span id=\"Exceptions\"></span><h5 class=\"editable\">Exceptions</h5>\n<p>This method can raise an <a title=\"en/IndexedDB/IDBDatabaseException\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException\">IDBDatabaseException</a> with the following code:</p>\n<dl> <dt><code><a title=\"en/IndexedDB/IDBObjectStore\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#DATA_ERR\">DATA_ERR</a></code></dt> <dd>The following conditions raise an exception: <ul> <li>The lower or upper parameters were not passed a valid key.</li> <li>The lower key is greater than the upper key.</li> <li>The lower key and upper key match and either of the bounds are open.</li> </ul> </dd>\n</dl>\n</div>","obsolete":false},{"name":"upperBound","help":"<p>Creates a new upper-bound key range. By default, it includes the upper endpoint value and is closed.</p>\n<pre>IDBKeyRange upperBound (\n  in any bound, \n  in optional boolean open\n);\n</pre>\n<div id=\"section_21\"><span id=\"Parameters_4\"></span><h5 class=\"editable\">Parameters</h5>\n<dl> <dt>bound</dt> <dd>The value of the upper bound of the range.</dd> <dt>open</dt> <dd><em>Optional</em>. If false (default value), the range includes the lower-bound value.</dd>\n</dl>\n</div><div id=\"section_22\"><span id=\"Returns_4\"></span><h5 class=\"editable\">Returns</h5>\n<dl> <dt><code>IDBKeyRange</code></dt> <dd>The newly created key range.</dd>\n</dl>\n</div><div id=\"section_23\"><span id=\"Exceptions_4\"></span><h5 class=\"editable\">Exceptions</h5>\n<p>This method can raise an <a title=\"en/IndexedDB/IDBDatabaseException\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException\">IDBDatabaseException</a> with the following code:</p>\n<dl> <dt><code><a title=\"en/IndexedDB/IDBObjectStore\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#DATA_ERR\">DATA_ERR</a></code></dt> <dd>The value parameter was not passed a valid key.</dd>\n</dl>\n</div>","obsolete":false},{"url":"","name":"upperOpen","help":"Returns false if the upper-bound value is included in the key range.","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/IndexedDB/IDBKeyRange"},"HTMLParagraphElement":{"title":"HTMLParagraphElement","seeAlso":"<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/p\">&lt;p&gt;</a></code>\n HTML&nbsp;element","summary":"DOM p (paragraph) objects expose the <a title=\"http://www.w3.org/TR/html5/grouping-content.html#htmlparagraphelement\" class=\" external\" rel=\"external nofollow\" href=\"http://www.w3.org/TR/html5/grouping-content.html#htmlparagraphelement\" target=\"_blank\">HTMLParagraphElement</a> (or \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML\">HTML 4</a></span> <a class=\" external\" rel=\"external nofollow\" href=\"http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-84675076\" title=\"http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-84675076\" target=\"_blank\"><code>HTMLParagraphElement</code></a>) interface, which provides special properties (beyond the regular <a rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/element\">element</a> object interface they also have available to them by inheritance) for manipulating div elements. In \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span>, this interface inherits from HTMLElement, but defines no additional members.","members":[{"name":"align","help":"Enumerated attribute indicating alignment of the element's contents with respect to the surrounding context.","obsolete":true}],"srcUrl":"https://developer.mozilla.org/en/Document_Object_Model_(DOM)/HTMLParagraphElement"},"Int16Array":{"title":"Int16Array","srcUrl":"https://developer.mozilla.org/en/JavaScript_typed_arrays/Int16Array","seeAlso":"<li><a class=\" link-https\" title=\"https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/doc/spec/TypedArray-spec.html\" rel=\"external\" href=\"https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/doc/spec/TypedArray-spec.html\" target=\"_blank\">Typed Array Specification</a></li> <li><a title=\"en/JavaScript typed arrays\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays\">JavaScript typed arrays</a></li>","summary":"<p>The <code>Int16Array</code> type represents an array of twos-complement 16-bit signed integers.</p>\n<p>Once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).</p>","constructor":"<div class=\"note\"><strong>Note:</strong> In these methods, <code><em>TypedArray</em></code> represents any of the <a title=\"en/JavaScript typed arrays/ArrayBufferView#Typed array subclasses\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/ArrayBufferView#Typed_array_subclasses\">typed array object types</a>.</div>\n<table class=\"standard-table\"> <tbody> <tr> <td><code>Int16Array <a title=\"en/JavaScript typed arrays/Int16Array#Int16Array()\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/Int16Array#Int16Array()\">Int16Array</a>(unsigned long length);<br> </code></td> </tr> <tr> <td><code>Int16Array </code><code><a title=\"en/JavaScript typed arrays/Int16Array#Int16Array()\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/Int16Array#Int16Array%28%29\">Int16Array</a></code><code>(<em>TypedArray</em> array);<br> </code></td> </tr> <tr> <td><code>Int16Array </code><code><a title=\"en/JavaScript typed arrays/Int16Array#Int16Array()\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/Int16Array#Int16Array%28%29\">Int16Array</a></code><code>(sequence&lt;type&gt; array);<br> </code></td> </tr> <tr> <td><code>Int16Array </code><code><a title=\"en/JavaScript typed arrays/Int16Array#Int16Array()\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/Int16Array#Int16Array%28%29\">Int16Array</a></code><code>(ArrayBuffer buffer, optional unsigned long byteOffset, optional unsigned long length);<br> </code></td> </tr> </tbody>\n</table><p>Returns a new <code>Int16Array</code> object.</p>\n<pre>Int16Array Int16Array(\n&nbsp; unsigned long length\n);\n\nInt16Array Int16Array(\n&nbsp; <em>TypedArray</em> array\n);\n\nInt16Array Int16Array(\n&nbsp; sequence&lt;type&gt; array\n);\n\nInt16Array Int16Array(\n&nbsp; ArrayBuffer buffer,\n&nbsp; optional unsigned long byteOffset,\n&nbsp; optional unsigned long length\n);\n</pre>\n<div id=\"section_7\"><span id=\"Parameters\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>length</code></dt> <dd>The number of elements in the byte array. If unspecified, length of the array view will match the buffer's length.</dd> <dt><code>array</code></dt> <dd>An object of any of the typed array types (such as <code>Int32Array</code>), or a sequence of objects of a particular type, to copy into a new <a title=\"en/JavaScript typed arrays/ArrayBuffer\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/ArrayBuffer\"><code>ArrayBuffer</code></a>. Each value in the source array is converted to a 16-bit signed integer before being copied into the new array.</dd> <dt><code>buffer</code></dt> <dd>An existing <a title=\"en/JavaScript typed arrays/ArrayBuffer\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/ArrayBuffer\"><code>ArrayBuffer</code></a> to use as the storage for the new <code>Int16Array</code> object.</dd> <dt><code>byteOffset<br> </code></dt> <dd>The offset, in bytes, to the first byte in the specified buffer for the new view to reference. If not specified, the <code>Int16Array</code>'s view of the buffer will start with the first byte.</dd>\n</dl>\n</div><div id=\"section_8\"><span id=\"Return_value\"></span><h6 class=\"editable\">Return value</h6>\n<p>A new <code>Int16Array</code> object representing the specified data buffer.</p>\n</div>","members":[{"name":"subarray","help":"<p>Returns a new <code>Int16Array</code> view on the <a title=\"en/JavaScript typed arrays/ArrayBuffer\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/ArrayBuffer\"><code>ArrayBuffer</code></a> store for this <code>Int16Array</code> object.</p>\n\n<div id=\"section_15\"><span id=\"Parameters_3\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>begin</code></dt> <dd>The offset to the first element in the array to be referenced by the new <code>Int16Array</code> object.</dd> <dt><code>end</code> \n<span title=\"\">Optional</span>\n</dt> <dd>The offset to the last element in the array to be referenced by the new <code>Int16Array</code> object; if not specified, all elements from the one specified by <code>begin</code> to the end of the array are included in the new view.</dd>\n</dl>\n</div><div id=\"section_16\"><span id=\"Notes_2\"></span><h6 class=\"editable\">Notes</h6>\n<p>The range specified by <code>begin</code> and <code>end</code> is clamped to the valid index range for the current array; if the computed length of the new array would be negative, it's clamped to zero. If either <code>begin</code> or <code>end</code> is negative, it refers to an index from the end of the array instead of from the beginning.</p>\n<div class=\"note\"><strong>Note:</strong> Keep in mind that this is creating a new view on the existing buffer; changes to the new object's contents will impact the original object and vice versa.</div>\n</div>","idl":"<pre>Int16Array subarray(\n&nbsp; long begin,\n&nbsp; optional long end\n);\n</pre>","obsolete":false},{"name":"set","help":"<p>Sets multiple values in the typed array, reading input values from a specified array.</p>\n\n<div id=\"section_13\"><span id=\"Parameters_2\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>array</code></dt> <dd>An array from which to copy values. All values from the source array are copied into the target array, unless the length of the source array plus the offset exceeds the length of the target array, in which case an exception is thrown. If the source array is a typed array, the two arrays may share the same underlying <code><a title=\"en/JavaScript typed arrays/ArrayBuffer\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/ArrayBuffer\">ArrayBuffer</a></code>; the browser will intelligently copy the source range of the buffer to the destination range.</dd> <dt>offset \n<span title=\"\">Optional</span>\n</dt> <dd>The offset into the target array at which to begin writing values from the source <code>array</code>. If you omit this value, 0 is assumed (that is, the source <code>array</code> will overwrite values in the target array starting at index 0).</dd>\n</dl>\n</div>","idl":"<pre>void set(\n&nbsp; <em>TypedArray</em> array,\n&nbsp; optional unsigned long offset\n);\n\nvoid set(\n&nbsp; type[] array,\n&nbsp; optional unsigned long offset\n);\n</pre>","obsolete":false},{"name":"BYTES_PER_ELEMENT","help":"The size, in bytes, of each array element.","obsolete":false},{"name":"length","help":"The number of entries in the array. <strong>Read only.</strong>","obsolete":false}]},"FileEntry":{"title":"FileEntry","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td>13\n<span title=\"prefix\">webkit</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE&nbsp;Phone</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> </tr> </tbody> </table>\n</div>","summary":"<div><strong>DRAFT</strong> <div>This page is not complete.</div>\n</div>\n<p>The <code>FileEntry</code> interface of the <a title=\"en/DOM/File_API/File_System_API\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/File_API/File_System_API\">FileSystem API</a> represents a file in a file system.</p>","members":[{"name":"createWriter","help":"<p>Creates a new <code>FileWriter</code> associated with the file that the <code>FileEntry</code> represents.</p>\n<pre>void createWriter (\n in FileWriterCallback successCallback, optional ErrorCallback errorCallback\n);</pre> <div id=\"section_4\"><span id=\"Parameter\"></span><h5 class=\"editable\">Parameter</h5>\n<dl> <dt>successCallback</dt> <dd>A callback that is called with the new <code>FileWriter</code>.</dd> <dt>errorCallback</dt> <dd>A callback that is called when errors happen.</dd> </dl> </div><div id=\"section_5\"><span id=\"Returns\"></span><h5 class=\"editable\">Returns</h5>\n<dl> <dt><code>void</code></dt>\n</dl> </div>","obsolete":false},{"name":"file","help":"<p>Returns a File that represents the current state of the file that this <code>FileEntry</code> represents.</p>\n<pre>void file (\n  <em>FileCallback successCallback, optional ErrorCallback errorCallback</em>\n);</pre>\n<div id=\"section_7\"><span id=\"Parameter_2\"></span><h5 class=\"editable\">Parameter</h5>\n<dl> <dt>successCallback</dt> <dd>A callback that is called with the new <code>FileWriter</code>.</dd> <dt>errorCallback</dt> <dd>A callback that is called when errors happen.</dd> </dl> </div><div id=\"section_8\"><span id=\"Returns_2\"></span><h5 class=\"editable\">Returns</h5>\n<dl> <dt><code>void</code></dt>\n</dl>\n</div>","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/DOM/File_API/File_System_API/FileEntry"},"NodeIterator":{"title":"NodeIterator","members":[{"obsolete":false,"url":"https://developer.mozilla.org/En/DOM/NodeIterator.nextNode","name":"nextNode","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/En/DOM/NodeIterator.previousNode","name":"previousNode","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/En/DOM/NodeIterator.detach","name":"detach","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/En/DOM/NodeIterator.expandEntityReferences","name":"expandEntityReferences","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/En/DOM/NodeIterator.pointerBeforeReferenceNode","name":"pointerBeforeReferenceNode","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/En/DOM/NodeIterator.filter","name":"filter","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/En/DOM/NodeIterator.referenceNode","name":"referenceNode","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/En/DOM/NodeIterator.whatToShow","name":"whatToShow","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/En/DOM/NodeIterator.root","name":"root","help":""}],"srcUrl":"https://developer.mozilla.org/en/DOM/NodeIterator","specification":"DOM Level 2 Traversal: NodeIterator"},"SVGPathSegClosePath":{"title":"SVGPathElement","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/SVGPathElement","skipped":true,"cause":"Suspect title"},"FileWriterCallback":{"title":"FileEntrySync","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/File_API/File_System_API/FileEntrySync","skipped":true,"cause":"Suspect title"},"CanvasRenderingContext":{"title":"Interface Compatibility","members":[],"srcUrl":"https://developer.mozilla.org/En/Developer_Guide/Interface_Compatibility","skipped":true,"cause":"Suspect title"},"Uint32Array":{"title":"Uint32Array","srcUrl":"https://developer.mozilla.org/en/JavaScript_typed_arrays/Uint32Array","seeAlso":"<li><a title=\"https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/doc/spec/TypedArray-spec.html\" class=\" link-https\" rel=\"external\" href=\"https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/doc/spec/TypedArray-spec.html\" target=\"_blank\">Typed Array Specification</a></li> <li><a title=\"en/JavaScript typed arrays\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays\">JavaScript typed arrays</a></li>","summary":"<p>The <code>Uint32Array</code> type represents an array of 32-bit unsigned integers.</p>\n<p>Once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).</p>","constructor":"<div class=\"note\"><strong>Note:</strong> In these methods, <code><em>TypedArray</em></code> represents any of the <a title=\"en/JavaScript typed arrays/ArrayBufferView#Typed array subclasses\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/ArrayBufferView#Typed_array_subclasses\">typed array object types</a>.</div>\n<table class=\"standard-table\"> <tbody> <tr> <td><code>Uint32Array <a title=\"en/JavaScript typed arrays/Uint32Array#Uint32Array()\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/Uint32Array#Uint32Array()\">Uint32Array</a>(unsigned long length);<br> </code></td> </tr> <tr> <td><code>Uint32Array </code><code><a title=\"en/JavaScript typed arrays/Uint32Array#Uint32Array()\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/Uint32Array#Uint32Array%28%29\">Uint32Array</a></code><code>(<em>TypedArray</em> array);<br> </code></td> </tr> <tr> <td><code>Uint32Array </code><code><a title=\"en/JavaScript typed arrays/Uint32Array#Uint32Array()\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/Uint32Array#Uint32Array%28%29\">Uint32Array</a></code><code>(sequence&lt;type&gt; array);<br> </code></td> </tr> <tr> <td><code>Uint32Array </code><code><a title=\"en/JavaScript typed arrays/Uint32Array#Uint32Array()\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/Uint32Array#Uint32Array%28%29\">Uint32Array</a></code><code>(ArrayBuffer buffer, optional unsigned long byteOffset, optional unsigned long length);<br> </code></td> </tr> </tbody>\n</table><p>Returns a new <code>Uint32Array</code> object.</p>\n<pre>Uint32Array Uint32Array(\n&nbsp; unsigned long length\n);\n\nUint32Array Uint32Array(\n&nbsp; <em>TypedArray</em> array\n);\n\nUint32Array Uint32Array(\n&nbsp; sequence&lt;type&gt; array\n);\n\nUint32Array Uint32Array(\n&nbsp; ArrayBuffer buffer,\n&nbsp; optional unsigned long byteOffset,\n&nbsp; optional unsigned long length\n);\n</pre>\n<div id=\"section_7\"><span id=\"Parameters\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>length</code></dt> <dd>The number of elements in the byte array. If unspecified, length of the array view will match the buffer's length.</dd> <dt><code>array</code></dt> <dd>An object of any of the typed array types (such as <code>Int16Array</code>), or a sequence of objects of a particular type, to copy into a new <a title=\"en/JavaScript typed arrays/ArrayBuffer\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/ArrayBuffer\"><code>ArrayBuffer</code></a>. Each value in the source array is converted to a 32-bit unsigned integer before being copied into the new array.</dd> <dt><code>buffer</code></dt> <dd>An existing <a title=\"en/JavaScript typed arrays/ArrayBuffer\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/ArrayBuffer\"><code>ArrayBuffer</code></a> to use as the storage for the new <code>Uint32Array</code> object.</dd> <dt><code>byteOffset<br> </code></dt> <dd>The offset, in bytes, to the first byte in the specified buffer for the new view to reference. If not specified, the <code>Uint32Array</code>'s view of the buffer will start with the first byte.</dd>\n</dl>\n</div><div id=\"section_8\"><span id=\"Return_value\"></span><h6 class=\"editable\">Return value</h6>\n<p>A new <code>Uint32Array</code> object representing the specified data buffer.</p>\n</div>","members":[{"name":"subarray","help":"<p>Returns a new <code>Uint32Array</code> view on the <a title=\"en/JavaScript typed arrays/ArrayBuffer\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/ArrayBuffer\"><code>ArrayBuffer</code></a> store for this <code>Uint32Array</code> object.</p>\n\n<div id=\"section_15\"><span id=\"Parameters_3\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>begin</code></dt> <dd>The offset to the first element in the array to be referenced by the new <code>Uint32Array</code> object.</dd> <dt><code>end</code> \n<span title=\"\">Optional</span>\n</dt> <dd>The offset to the last element in the array to be referenced by the new <code>Uint32Array</code> object; if not specified, all elements from the one specified by <code>begin</code> to the end of the array are included in the new view.</dd>\n</dl>\n</div><div id=\"section_16\"><span id=\"Notes_2\"></span><h6 class=\"editable\">Notes</h6>\n<p>The range specified by <code>begin</code> and <code>end</code> is clamped to the valid index range for the current array; if the computed length of the new array would be negative, it's clamped to zero. If either <code>begin</code> or <code>end</code> is negative, it refers to an index from the end of the array instead of from the beginning.</p>\n<div class=\"note\"><strong>Note:</strong> Keep in mind that this is creating a new view on the existing buffer; changes to the new object's contents will impact the original object and vice versa.</div>\n</div>","idl":"<pre>Uint32Array subarray(\n&nbsp; long begin,\n&nbsp; optional long end\n);\n</pre>","obsolete":false},{"name":"set","help":"<p>Sets multiple values in the typed array, reading input values from a specified array.</p>\n\n<div id=\"section_13\"><span id=\"Parameters_2\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>array</code></dt> <dd>An array from which to copy values. All values from the source array are copied into the target array, unless the length of the source array plus the offset exceeds the length of the target array, in which case an exception is thrown. If the source array is a typed array, the two arrays may share the same underlying <code><a title=\"en/JavaScript typed arrays/ArrayBuffer\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/ArrayBuffer\">ArrayBuffer</a></code>; the browser will intelligently copy the source range of the buffer to the destination range.</dd> <dt>offset \n<span title=\"\">Optional</span>\n</dt> <dd>The offset into the target array at which to begin writing values from the source <code>array</code>. If you omit this value, 0 is assumed (that is, the source <code>array</code> will overwrite values in the target array starting at index 0).</dd>\n</dl>\n</div>","idl":"<pre>void set(\n&nbsp; <em>TypedArray</em> array,\n&nbsp; optional unsigned long offset\n);\n\nvoid set(\n&nbsp; type[] array,\n&nbsp; optional unsigned long offset\n);\n</pre>","obsolete":false},{"name":"BYTES_PER_ELEMENT","help":"The size, in bytes, of each array element.","obsolete":false},{"name":"length","help":"The number of entries in the array. <strong>Read only.</strong>","obsolete":false}]},"NodeFilter":{"title":"NodeFilter","examples":["<pre name=\"code\" class=\"js\">var nodeIterator = document.createNodeIterator(\n  // Node to use as root\n  document.getElementById('someId'),\n\n  // Onlly consider nodes that are text nodes (nodeType 3)\n  NodeFilter.SHOW_TEXT,\n\n  // Object containing the function to use for the acceptNode method\n  // of the NodeFilter\n    { acceptNode: function(node) {\n      // Logic to determine whether to accept, reject or skip node\n      // In this case, only accept nodes that have content\n      // other than whitespace\n      if ( ! /^\\s*$/.test(node.data) ) {\n        return NodeFilter.FILTER_ACCEPT;\n      }\n    }\n  },\n  false\n);\n\n// Show the content of every non-empty text node that is a child of root\nvar node;\n\nwhile ((node = iterator.nextNode())) {\n  alert(node.data);\n}</pre>\n        \n<p>Note that in order for the iterator to accept a node, the <a href=\"#acceptNode\">acceptNode</a> function must return <a href=\"#FILTER_ACCEPT\">NodeFilter.FILTER_ACCEPT</a>.</p>"],"members":[{"obsolete":false,"url":"","name":"acceptNode","help":"The accept node method used by the filter is supplied as an object property when constructing the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/NodeIterator\">NodeIterator</a></code>\n or <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/TreeWalker\">TreeWalker</a></code>\n."},{"name":"SHOW_ALL","help":"Shows all nodes.","obsolete":false},{"name":"SHOW_ATTRIBUTE","help":"Shows attribute <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Attr\">Attr</a></code>\n nodes. This is meaningful only when creating a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/NodeIterator\">NodeIterator</a></code>\n or <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/TreeWalker\">TreeWalker</a></code>\n with an <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Attr\">Attr</a></code>\n node as its root; in this case, it means that the attribute node will appear in the first position of the iteration or traversal. Since attributes are never children of other nodes, they do not appear when traversing over the document tree.","obsolete":false},{"name":"SHOW_CDATA_SECTION","help":"Shows <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/CDATASection\">CDATASection</a></code>\n&nbsp;nodes.","obsolete":false},{"name":"SHOW_COMMENT","help":"Shows <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Comment\">Comment</a></code>\n&nbsp;nodes.","obsolete":false},{"name":"SHOW_DOCUMENT","help":"Shows <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Document\">Document</a></code>\n&nbsp;nodes.","obsolete":false},{"name":"SHOW_DOCUMENT_FRAGMENT","help":"Shows <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DocumentFragment\">DocumentFragment</a></code>\n&nbsp;nodes.","obsolete":false},{"name":"SHOW_DOCUMENT_TYPE","help":"Shows <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DocumentType\">DocumentType</a></code>\n&nbsp;nodes.","obsolete":false},{"name":"SHOW_ELEMENT","help":"Shows <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Element\">Element</a></code>\n&nbsp;nodes.","obsolete":false},{"name":"SHOW_ENTITY","help":"Shows <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Entity\">Entity</a></code>\n&nbsp;nodes. This is meaningful only when creating a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/NodeIterator\">NodeIterator</a></code>\n or <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/TreeWalker\">TreeWalker</a></code>\n with an <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Entity\">Entity</a></code>\n node as its root; in this case, it means that the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Entity\">Entity</a></code>\n node will appear in the first position of the traversal. Since entities are not part of the document tree, they do not appear when traversing over the document tree.","obsolete":false},{"name":"SHOW_ENTITY_REFERENCE","help":"Shows <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/EntityReference\">EntityReference</a></code>\n&nbsp;nodes.","obsolete":false},{"name":"SHOW_NOTATION","help":"Shows <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Notation\">Notation</a></code>\n nodes. This is meaningful only when creating a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/NodeIterator\">NodeIterator</a></code>\n or <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/TreeWalker\">TreeWalker</a></code>\n with a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Notation\">Notation</a></code>\n node as its root; in this case, it means that the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Notation\">Notation</a></code>\n node will appear in the first position of the traversal. Since entities are not part of the document tree, they do not appear when traversing over the document tree.","obsolete":false},{"name":"SHOW_PROCESSING_INSTRUCTION","help":"Shows <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/ProcessingInstruction\">ProcessingInstruction</a></code>\n&nbsp;nodes.","obsolete":false},{"name":"SHOW_TEXT","help":"Shows <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Text\">Text</a></code>\n&nbsp;nodes.","obsolete":false},{"url":"","name":"FILTER_ACCEPT","help":"Value returned by the <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/NodeFilter.acceptNode\" class=\"new\">NodeFilter.acceptNode()</a></code>\n method when a node should be accepted.","obsolete":false},{"name":"FILTER_REJECT","help":"Value to be returned by the <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/NodeFilter.acceptNode\" class=\"new\">NodeFilter.acceptNode()</a></code>\n method when a node should be rejected. The children of rejected nodes are not visited by the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/NodeIterator\">NodeIterator</a></code>\n or <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/TreeWalker\">TreeWalker</a></code>\n object; this value is treated as \"skip this node and all its children\".","obsolete":false},{"name":"FILTER_SKIP","help":"Value to be returned by <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/NodeFilter.acceptNode\" class=\"new\">NodeFilter.acceptNode()</a></code>\n for nodes to be skipped by the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/NodeIterator\">NodeIterator</a></code>\n or <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/TreeWalker\">TreeWalker</a></code>\n object. The children of skipped nodes are still considered. This is treated as \"skip this node but not its children\".","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/DOM/NodeFilter","specification":"DOM Level 2 Traversal: NodeFilter"},"WebKitCSSKeyframeRule":{"title":"CSSRule","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/cssRule","skipped":true,"cause":"Suspect title"},"RGBColor":{"title":"color value","members":[],"srcUrl":"https://developer.mozilla.org/en/CSS/color_value","skipped":true,"cause":"Suspect title"},"CanvasRenderingContext2D":{"title":"CanvasRenderingContext2D","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td colspan=\"6\">Methods</td> </tr> <tr> <td><code>arc()</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>arcTo()</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>beginPath()</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>bezierCurveTo()</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>clearRect()</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>clip()</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>closePath()</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>createImageData()</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td>3.5 (1.9.1)</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>createLinearGradient()</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>createPattern()</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>createRadialGradient()</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>drawImage()</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>drawCustomFocusRing()</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td>\n<span class=\"unimplementedInlineTemplate\">Unimplemented (see<a rel=\"external\" href=\"https://bugzilla.mozilla.org/show_bug.cgi?id=540456\" class=\"external\" title=\"\">\nbug 540456</a>\n)</span>\n</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>drawSystemFocusRing()</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td>\n<span class=\"unimplementedInlineTemplate\">Unimplemented (see<a rel=\"external\" href=\"https://bugzilla.mozilla.org/show_bug.cgi?id=540456\" class=\"external\" title=\"\">\nbug 540456</a>\n)</span>\n</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>fill()</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>fillRect()</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>fillText()</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td>3.5 (1.9.1)</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>getImageData()</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>isPointInPath()</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>lineTo()</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>measureText()</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td>3.5 (1.9.1)</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>moveTo()</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>putImageData()</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>quadraticCurveTo()</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>rect()</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>restore()</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>rotate()</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>save()</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>scale()</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>scrollPathIntoView()</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>setTransform()</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td>3.0 (1.9.0)</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>stroke()</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>strokeRect()</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>strokeText()</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td>3.5 (1.9.1)</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>transform()</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td>3.0 (1.9.0)</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>translate()</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td colspan=\"6\">Attributes</td> </tr> <tr> <td><code>canvas</code></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> <tr> <td><code>fillstyle</code></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> <tr> <td><code>font</code></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> <tr> <td><code>globalAlpha</code></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> <tr> <td><code>globalCompositeOperation</code></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> <tr> <td><code>lineCap</code></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> <tr> <td><code>lineJoin</code></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> <tr> <td><code>lineWidth</code></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> <tr> <td><code>miterLimit</code></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> <tr> <td><code>shadowBlur</code></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> <tr> <td><code>shadowColor</code></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> <tr> <td><code>shadowOffsetX</code></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> <tr> <td><code>shadowOffsetY</code></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> <tr> <td><code>strokeStyle</code></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> <tr> <td><code>textAlign</code></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> <tr> <td><code>textBaseLine</code></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE&nbsp;Phone</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td colspan=\"6\">Methods</td> </tr> <tr> <td><code>arc()</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>arcTo()</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>beginPath()</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>bezierCurveTo()</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>clearRect()</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>clip()</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>closePath()</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>createImageData()</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>createLinearGradient()</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>createPattern()</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>createRadialGradient()</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>drawImage()</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>drawCustomFocusRing()</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>drawSystemFocusRing()</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>fill()</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>fillRect()</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>fillText()</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>getImageData()</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>isPointInPath()</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>lineTo()</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>measureText()</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>moveTo()</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>putImageData()</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>quadraticCurveTo()</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>rect()</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>restore()</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>rotate()</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>save()</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>scale()</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>scrollPathIntoView()</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>setTransform()</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>stroke()</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>strokeRect()</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>strokeText()</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>transform()</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>translate()</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td colspan=\"6\">Attributes</td> </tr> <tr> <td><code>canvas</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>fillstyle</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>font</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>globalAlpha</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>globalCompositeOperation</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>lineCap</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>lineJoin</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>lineWidth</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>miterLimit</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>shadowBlur</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>shadowColor</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>shadowOffsetX</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>shadowOffsetY</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>strokeStyle</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>textAlign</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>textBaseLine</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>","srcUrl":"https://developer.mozilla.org/en/DOM/CanvasRenderingContext2D","specification":"http://www.whatwg.org/specs/web-apps...eringcontext2d","summary":"The bulk of the operations available at present with <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/canvas\">&lt;canvas&gt;</a></code>\n are available through this interface, returned by a call to <code>getContext()</code> on the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/canvas\">&lt;canvas&gt;</a></code>\n element, with \"2d\" as its argument.","members":[{"name":"measureText","help":"","idl":"<pre class=\"eval\">nsIDOMTextMetrics measureText(\n  in DOMString text\n);\n</pre>","obsolete":false},{"name":"rotate","help":"","idl":"<pre class=\"eval\">void rotate(\n  in float angle\n);\n</pre>","obsolete":false},{"name":"arcTo","help":"<p>Adds an arc with the given control points and radius, connected to the previous point by a straight line.</p>\n\n<div id=\"section_13\"><span id=\"Parameters_2\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>x1</code></dt> <dd></dd> <dt><code>y1</code></dt> <dd></dd> <dt><code>x2</code></dt> <dd></dd> <dt><code>y2</code></dt> <dd></dd> <dt><code>radius</code></dt> <dd>The arc's radius.</dd>\n</dl>\n</div>","idl":"<pre class=\"eval\">void arcTo(\n  in float x1,\n  in float y1,\n  in float x2,\n  in float y2,\n  in float radius\n);\n</pre>","obsolete":false},{"name":"transform","help":"","idl":"<pre class=\"eval\">void transform(\n  in float m11,\n  in float m12,\n  in float m21,\n  in float m22,\n  in float dx,\n  in float dy\n);\n</pre>","obsolete":false},{"name":"save","help":"Saves the current drawing style state using a stack so you can revert any change you make to it using restore().","idl":"<pre class=\"eval\">void save();\n</pre>","obsolete":false},{"name":"beginPath","help":"","idl":"<pre class=\"eval\">void beginPath();\n</pre>","obsolete":false},{"name":"strokeRect","help":"<p>Paints a rectangle which it starting point is at <em>(x, y)</em> and has a<em> w</em> width and a <em>h</em> height onto the canvas, using the current stroke style.</p>\n\n<div id=\"section_88\"><span id=\"Parameters_33\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>x</code></dt> <dd>The x axis for the starting point of the rectangle.</dd> <dt><code>y</code></dt> <dd>The y axis for the starting point of the rectangle.</dd> <dt><code>w</code></dt> <dd>The rectangle's width.</dd> <dt><code>h</code></dt> <dd>The rectangle's height.</dd>\n</dl>\n</div>","idl":"<pre class=\"eval\">void strokeRect(\n  in float x,\n  in float y,\n  in float w,\n  in float h\n);\n</pre>","obsolete":false},{"name":"createLinearGradient","help":"","idl":"<pre class=\"eval\">nsIDOMCanvasGradient createLinearGradient(\n  in float x0,\n  in float y0,\n  in float x1,\n  in float y1\n);\n</pre>","obsolete":false},{"name":"arc","help":"<p>Adds an arc to the path which it center is at <em>(x, y)</em> position with radius<em> r</em> starting at <em>startAngle</em> and ending at <em>endAngle</em> going in the given direction by <em>anticlockwise</em> (defaulting to clockwise).</p>\n\n<div id=\"section_11\"><span id=\"Parameters\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>x</code></dt> <dd>The x axis of the coordinate for the arc's center</dd> <dt><code>y</code></dt> <dd>The y axis of the coordinate for the arc's center.</dd> <dt><code>radius</code></dt> <dd>The arc's radius</dd> <dt><code>startAngle</code></dt> <dd>The starting point, measured from the x axis , from which it will be drawed expressed as radians.</dd> <dt><code>endAngle</code></dt> <dd>The end arc's angle to which it will be drawed expressed as radians.</dd> <dt><code>anticlockwise</code> \n<span title=\"(Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1)\n\">Optional from Gecko 2.0</span>\n</dt> <dd>When <code>true</code> draws the arc anticlockwise, otherwise in a clockwise direction.</dd>\n</dl>\n</div>","idl":"<pre class=\"eval\">void arc(\n  in float x,\n  in float y,\n  in float radius,\n  in float startAngle,\n  in float endAngle,\n  in boolean anticlockwise [optional]\n);\n</pre>","obsolete":false},{"name":"bezierCurveTo","help":"","idl":"<pre class=\"eval\">void bezierCurveTo(\n  in float cp1x,\n  in float cp1y,\n  in float cp2x,\n  in float cp2y,\n  in float x,\n  in float y\n);\n</pre>","obsolete":false},{"name":"closePath","help":"","idl":"<pre class=\"eval\">void closePath();\n</pre>","obsolete":false},{"name":"drawSystemFocusRing","help":"","idl":"<pre class=\"eval\">void drawSystemFocusRing(Element element);\n</pre>","obsolete":false},{"name":"scale","help":"","idl":"<pre class=\"eval\">void scale(\n  in float x,\n  in float y\n);\n</pre>","obsolete":false},{"name":"createRadialGradient","help":"","idl":"<pre class=\"eval\">nsIDOMCanvasGradient createRadialGradient(\n  in float x0,\n  in float y0,\n  in float r0,\n  in float x1,\n  in float y1,\n  in float r1\n);\n</pre>","obsolete":false},{"name":"lineTo","help":"<p>Connects the last point in the subpath to the <code>x, y</code> coordinates with a straight line.</p>\n\n<div id=\"section_60\"><span id=\"Parameters_20\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>x</code></dt> <dd>The x axis of the coordinate for the end of the line.</dd> <dt><code>y</code></dt> <dd>The y axis of the coordinate for the end of the line.</dd>\n</dl>\n</div>","idl":"<pre class=\"eval\">void lineTo(\n  in float x,\n  in float y\n);\n</pre>","obsolete":false},{"name":"translate","help":"<p>Moves the origin point of the context to (x, y).</p>\n\n<div id=\"section_94\"><span id=\"Parameters_36\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>x</code></dt> <dd>The x axis for the point to be considered as the origin.</dd> <dt><code>y</code></dt> <dd>The x axis for the point to be considered as the origin.</dd>\n</dl>\n</div>","idl":"<pre class=\"eval\">void translate(\n  in float x,\n  in float y\n);\n</pre>","obsolete":false},{"name":"moveTo","help":"<p>Moves the starting point of a new subpath to the <strong>(x, y)</strong> coordinates.</p>\n\n<div id=\"section_65\"><span id=\"Parameters_22\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>x</code></dt> <dd>The x axis of the point.</dd> <dt><code>y</code></dt> <dd>The y axis of the point.</dd>\n</dl>\n</div>","idl":"<pre class=\"eval\">void moveTo(\n  in float x,\n  in float y\n);\n</pre>","obsolete":false},{"name":"scrollPathIntoView","help":"","idl":"<pre class=\"eval\">void scrollPathIntoView();\n</pre>","obsolete":false},{"name":"restore","help":"Restores the drawing style state to the last element on the 'state stack' saved by save()","idl":"<pre class=\"eval\">void restore();\n</pre>","obsolete":false},{"name":"createImageData","help":"","idl":"<pre class=\"eval\">void createImageData(in float width, in float height);\nImageData createImageData(ImageData imagedata);\n</pre>","obsolete":false},{"name":"createPattern","help":"<div id=\"section_31\"><span id=\"Parameters_10\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>image</code></dt> <dd>A DOM <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/element\">element</a></code>\n to use as the source image for the pattern. This can be any element, although typically you'll use an <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/Image\" class=\"new\">Image</a></code>\n or <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/canvas\">&lt;canvas&gt;</a></code>\n.</dd> <dt><code>repetition</code></dt> <dd>?</dd>\n</dl>\n</div><div id=\"section_32\"><span id=\"Return_value_3\"></span><h6 class=\"editable\">Return value</h6>\n<p>A new DOM canvas pattern object for use in pattern-based operations.</p>\n</div><div id=\"section_33\"><span id=\"Exceptions_thrown\"></span><h6 class=\"editable\">Exceptions thrown</h6>\n<dl> <dt><code>NS_ERROR_DOM_INVALID_STATE_ERR</code> \n<span title=\"(Firefox 10.0 / Thunderbird 10.0)\n\">Requires Gecko 10.0</span>\n</dt> <dd>The specified <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/canvas\">&lt;canvas&gt;</a></code>\n element for the <code>image</code> parameter is zero-sized (that is, one or both of its dimensions are 0 pixels).</dd>\n</dl>\n</div>","idl":"<pre class=\"eval\">nsIDOMCanvasPattern createPattern(\n  in nsIDOMHTMLElement image,\n  in DOMString repetition\n);\n</pre>","obsolete":false},{"name":"putImageData","help":"<h6 class=\"editable\">Compatibility notes</h6>\n<ul> <li>Starting in Gecko 10.0 (Firefox 10.0 / Thunderbird 10.0)\n, non-finite values to any of these parameters causes the call to putImageData() to be silently ignored, rather than throwing an exception.</li>\n</ul>","idl":"<pre class=\"eval\">void putImageData(\n  in long x,\n  in long y,\n  in unsigned long width,\n  in unsigned long height,\n  [array, size_is(dataLen)] in octet dataPtr,\n  in unsigned long dataLen,\n  in boolean hasDirtyRect,\n  in long dirtyX, [optional]\n  in long dirtyY, [optional]\n  in long dirtyWidth, [optional]\n  in long dirtyHeight [optional]\n);\n</pre>","obsolete":false},{"name":"clearRect","help":"<p>Clears the rectangle defined by it starting point at <em>(x, y)</em> and has a <em>w</em> width and a <em>h</em> height.</p>\n\n<div id=\"section_19\"><span id=\"Parameters_5\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>x</code></dt> <dd>The x axis of the coordinate for the rectangle starting point.</dd> <dt><code>y</code></dt> <dd>The y axis of the coordinate for the rectangle starting point.</dd> <dt><code>width</code></dt> <dd>The rectangle's width.</dd> <dt><code>height</code></dt> <dd>The rectangle's height.</dd>\n</dl>\n</div>","idl":"<pre class=\"eval\">void clearRect(\n  in float x,\n  in float y,\n  in float width,\n  in float height\n);\n</pre>","obsolete":false},{"name":"fill","help":"Fills the subpaths with the current fill style.","idl":"<pre class=\"eval\">void fill();\n</pre>","obsolete":false},{"name":"clip","help":"","idl":"<pre class=\"eval\">void clip();\n</pre>","obsolete":false},{"name":"rect","help":"","idl":"<pre class=\"eval\">void rect(\n  in float x,\n  in float y,\n  in float w,\n  in float h\n);\n</pre>","obsolete":false},{"name":"drawCustomFocusRing","help":"","idl":"<pre class=\"eval\">boolean drawCustomFocusRing(Element element);\n</pre>","obsolete":false},{"name":"stroke","help":"Strokes the subpaths with the current stroke style.","idl":"<pre class=\"eval\">void stroke();\n</pre>","obsolete":false},{"name":"setTransform","help":"","idl":"<pre class=\"eval\">void setTransform(\n  in float m11,\n  in float m12,\n  in float m21,\n  in float m22,\n  in float dx,\n  in float dy\n);\n</pre>","obsolete":false},{"name":"fillText","help":"","idl":"<pre class=\"eval\">void fillText(\n  in DOMString text,\n  in float x,\n  in float y,\n  in float maxWidth [optional]\n);\n</pre>","obsolete":false},{"name":"getImageData","help":"<p>Returns an <code><a class=\"external\" rel=\"external\" href=\"http://dev.w3.org/html5/2dcontext/Overview.html#imagedata\" title=\"http://dev.w3.org/html5/2dcontext/Overview.html#imagedata\" target=\"_blank\">ImageData</a></code> object representing the underlying pixel data for the area of the canvas denoted by the rectangle which starts at <em>(sx, sy)</em> and has a <em>sw</em> width and <em>sh</em> height.</p>\n\n<div id=\"section_53\"><span id=\"Parameters_18\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>sx</code></dt> <dd>The x axis of the coordinate for the rectangle startpoint from which the ImageData will be extracted.</dd> <dt><code>sy</code></dt> <dd>The x axis of the coordinate for the rectangle endpoint from which the ImageData will be extracted.</dd> <dt><code>sw</code></dt> <dd>The width of the rectangle from which the ImageData will be extracted.</dd> <dt><code>sh</code></dt> <dd>The height of the rectangle from which the ImageData will be extracted.</dd>\n</dl>\n</div><div id=\"section_54\"><span id=\"Return_value_6\"></span><h6 class=\"editable\">Return value</h6>\n<p>Returns an <code><a class=\"external\" rel=\"external\" href=\"http://www.w3.org/TR/2011/WD-2dcontext-20110405/#imagedata\" title=\"http://www.w3.org/TR/2011/WD-2dcontext-20110405/#imagedata\" target=\"_blank\">ImageData</a></code> object containing the image data for the given rectangle of the canvas.</p>\n</div>","idl":"<pre class=\"eval\">void getImageData(   \n  in double sx, \n  in double sy, \n  in double sw, \n  in double sh\n);\n</pre>","obsolete":false},{"name":"drawImage","help":"<p>Draws the specified image. This method is available in multiple formats, providing a great deal of flexibility in its use.</p>\n\n<div id=\"section_41\"><span id=\"Parameters_13\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>image</code></dt> <dd>An element to draw into the context; the specification permits any image element (that is, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/img\">&lt;img&gt;</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/canvas\">&lt;canvas&gt;</a></code>\n, and <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/video\">&lt;video&gt;</a></code>\n). Some browsers, including Firefox, let you use any arbitrary element.</dd> <dt><code>dx</code></dt> <dd>The X coordinate in the destination canvas at which to place the top-left corner of the source <code>image</code>.</dd> <dt><code>dy</code></dt> <dd>The Y coordinate in the destination canvas at which to place the top-left corner of the source <code>image</code>.</dd> <dt><code>dw</code></dt> <dd>The width to draw the <code>image</code> in the destination canvas. This allows scaling of the drawn image. If not specified, the image is not scaled in width when drawn.</dd> <dt><code>dh</code></dt> <dd>The height to draw the <code>image</code> in the destination canvas. This allows scaling of the drawn image. If not specified, the image is not scaled in height when drawn.</dd> <dt><code>sx</code></dt> <dd>The X coordinate of the top left corner of the sub-rectangle of the source image to draw into the destination context.</dd> <dt><code>sy</code></dt> <dd>The Y coordinate of the top left corner of the sub-rectangle of the source image to draw into the destination context.</dd> <dt><code>sw</code></dt> <dd>The width of the sub-rectangle of the source image to draw into the destination context. If not specified, the entire rectangle from the coordinates specified by <code>sx</code> and <code>sy</code> to the bottom-right corner of the image is used. If you specify a negative value, the image is flipped horizontally when drawn.</dd> <dt><code>sh</code></dt> <dd>The height of the sub-rectangle of the source image to draw into the destination context. If you specify a negative value, the image is flipped vertically when drawn.</dd>\n</dl>\n<p>The diagram below illustrates the meanings of the various parameters.</p>\n<p><img alt=\"drawImage.png\" class=\"internal default\" src=\"https://developer.mozilla.org/@api/deki/files/5494/=drawImage.png\"></p>\n</div><div id=\"section_42\"><span id=\"Exceptions_thrown_2\"></span><h6 class=\"editable\">Exceptions thrown</h6>\n<dl> <dt><code>INDEX_SIZE_ERR</code></dt> <dd>If the canvas or source rectangle width or height is zero.</dd> <dt><code>INVALID_STATE_ERR</code></dt> <dd>The image has no image data.</dd> <dt><code>TYPE_MISMATCH_ERR</code></dt> <dd>The specified source element isn't supported. This is not thrown by Firefox, since any element may be used as a source image.</dd>\n</dl>\n</div><div id=\"section_43\"><span id=\"Compatibility_notes\"></span><h6 class=\"editable\">Compatibility notes</h6>\n<ul> <li>Prior to Gecko 7.0 (Firefox 7.0 / Thunderbird 7.0 / SeaMonkey 2.4)\n, Firefox threw an exception if any of the coordinate values was non-finite or zero. As per the specification, this no longer happens.</li> <li>Support for flipping the image by using negative values for <code>sw</code> and <code>sh</code> was added in Gecko 5.0 (Firefox 5.0 / Thunderbird 5.0 / SeaMonkey 2.2)\n.</li> <li>Gecko 9.0 (Firefox 9.0 / Thunderbird 9.0 / SeaMonkey 2.6)\n now correctly supports CORS for drawing images across domains without <a title=\"en/CORS_Enabled_Image#What_is_a_.22tainted.22_canvas.3F\" rel=\"internal\" href=\"https://developer.mozilla.org/en/CORS_Enabled_Image#What_is_a_.22tainted.22_canvas.3F\">tainting the canvas</a>.</li>\n</ul>\n</div>","idl":"<pre class=\"eval\">void drawImage(\n  in nsIDOMElement image,\n  in float dx,\n  in float dy\n);\n\nvoid drawImage(\n  in nsIDOMElement image,\n  in float dx,\n  in float dy,\n  in float sw,\n  in float sh\n);\n\nvoid drawImage(\n  in nsIDOMElement image,\n  in float sx,\n  in float sy,\n  in float sw,\n  in float sh,\n  in float dx, \n  in float dy,\n  in float dw,\n  in float dh\n);\n</pre>","obsolete":false},{"name":"fillRect","help":"<p>Draws a filled rectangle at <em>(x, y) </em>position whose size is determined by <em>width</em> and <em>height</em>.</p>\n\n<div id=\"section_49\"><span id=\"Parameters_16\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>x</code></dt> <dd>The x axis of the coordinate for the rectangle starting point.</dd> <dt><code>y</code></dt> <dd>The y axis of the coordinate for the rectangle starting point.</dd> <dt><code>width</code></dt> <dd>The rectangle's width.</dd> <dt><code>height</code></dt> <dd>The rectangle's height.</dd>\n</dl>\n</div>","idl":"<pre class=\"eval\">void fillRect(\n  in float x,\n  in float y,\n  in float width,\n  in float height\n);\n</pre>","obsolete":false},{"name":"isPointInPath","help":"<p>Reports whether or not the specified point is contained in the current path.</p>\n\n<div id=\"section_56\"><span id=\"Parameters_19\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>x</code></dt> <dd>The X coordinate of the point to check.</dd> <dt><code>y</code></dt> <dd>The Y coordinate of the point to check.</dd>\n</dl>\n</div><div id=\"section_57\"><span id=\"Return_value_7\"></span><h6 class=\"editable\">Return value</h6>\n<p><code>true</code> if the specified point is contained in the current path; otherwise <code>false</code>.</p>\n</div><div id=\"section_58\"><span id=\"Compatibility_notes_2\"></span><h6 class=\"editable\">Compatibility notes</h6>\n<ul> <li>Prior to Gecko 7.0 (Firefox 7.0 / Thunderbird 7.0 / SeaMonkey 2.4)\n, this method incorrectly failed to multiply the specified point's coordinates by the current transformation matrix before comparing it to the path. Now this method works correctly even if the context is rotated, scaled, or otherwise transformed.</li>\n</ul>\n</div>","idl":"<pre class=\"eval\">boolean isPointInPath(\n  in float x,\n  in float y\n);\n</pre>","obsolete":false},{"name":"strokeText","help":"","idl":"<pre class=\"eval\">void strokeText(\n  in DOMString text,\n  in float x,\n  in float y,\n  in float maxWidth [optional]\n);\n</pre>","obsolete":false},{"name":"quadraticCurveTo","help":"","idl":"<pre class=\"eval\">void quadraticCurveTo(\n  in float cpx,\n  in float cpy,\n  in float x,\n  in float y\n);\n</pre>","obsolete":false},{"name":"DRAWWINDOW_DRAW_CARET","help":"Show the caret if appropriate when drawing. \n<span title=\"(Firefox 3.5 / Thunderbird 3.0 / SeaMonkey 2.0)\n\">Requires Gecko 1.9.1</span>","obsolete":false},{"name":"DRAWWINDOW_DO_NOT_FLUSH","help":"Do not flush pending layout notifications that could otherwise be batched up. \n<span title=\"(Firefox 3.5 / Thunderbird 3.0 / SeaMonkey 2.0)\n\">Requires Gecko 1.9.1</span>","obsolete":false},{"name":"DRAWWINDOW_DRAW_VIEW","help":"Draw scrollbars and scroll the viewport if they are present. \n<span title=\"(Firefox 3.6 / Thunderbird 3.1 / Fennec 1.0)\n\">Requires Gecko 1.9.2</span>","obsolete":false},{"name":"DRAWWINDOW_USE_WIDGET_LAYERS","help":"Use the widget layer manager if available. This means hardware acceleration may be used, but it might actually be slower or lower quality than normal. It will however more accurately reflect the pixels rendered to the screen. \n<span title=\"(Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1)\n\">Requires Gecko 2.0</span>","obsolete":false},{"name":"DRAWWINDOW_ASYNC_DECODE_IMAGES","help":"Do not synchronously decode images - draw what we have. \n<span title=\"(Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1)\n\">Requires Gecko 2.0</span>","obsolete":false},{"name":"canvas","help":"Back-reference to the canvas element for which this context was created. <strong>Read only.</strong>","obsolete":false},{"name":"fillStyle","help":"Color or style to use inside shapes. Default <code>#000</code> (black).","obsolete":false},{"name":"font","help":"Default value <code>10px sans-serif</code>.","obsolete":false},{"name":"globalAlpha","help":"Alpha value that is applied to shapes and images before they are composited onto the canvas. Default <code>1.0</code> (opaque).","obsolete":false},{"name":"globalCompositeOperation","help":"With <code>globalAplpha</code> applied this sets how shapes and images are drawn onto the existing bitmap. Possible values: <ul> <li><code>source-atop</code></li> <li><code>source-in</code></li> <li><code>source-out</code></li> <li><code>source-over</code> (default)</li> <li><code>destination-atop</code></li> <li><code>destination-in</code></li> <li><code>destination-out</code></li> <li><code>destination-over</code></li> <li><code>lighter</code></li> <li><code>xor</code></li> </ul>","obsolete":false},{"name":"lineCap","help":"Type of endings on the end of lines. Possible values: <code>butt</code> (default), <code>round</code>, <code>square</code>","obsolete":false},{"name":"lineJoin","help":"Defines the type of corners where two lines meet. Possible values: <code>round</code>, <code>bevel</code>, <code>miter</code> (default)","obsolete":false},{"name":"lineWidth","help":"Width of lines. Default <code>1.0</code>","obsolete":false},{"name":"miterLimit","help":"Default <code>10</code>.","obsolete":false},{"name":"shadowBlur","help":"Specifies the blurring effect. Default <code>0</code>","obsolete":false},{"name":"shadowColor","help":"Color of the shadow. Default fully-transparent black.","obsolete":false},{"name":"shadowOffsetX","help":"Horizontal distance the shadow will be offset. Default 0.","obsolete":false},{"name":"shadowOffsetY","help":"Vertical distance the shadow will be offset. Default 0.","obsolete":false},{"name":"strokeStyle","help":"Color or style to use for the lines around shapes. Default <code>#000</code> (black).","obsolete":false},{"name":"textAlign","help":"Possible values: <code>start</code> (default), <code>end</code>, <code>left</code>, <code>right</code> or <code>center</code>.","obsolete":false},{"name":"textBaseLine","help":"Possible values: <code>top</code>, <code>hanging</code>, <code>middle</code>, <code>alphabetic</code> (default), <code>ideographic</code>, <code>bottom</code>","obsolete":false},{"name":"webkitCurrentTransform","help":"Sets or gets the current transformation matrix. \n<span title=\"(Firefox 7.0 / Thunderbird 7.0 / SeaMonkey 2.4)\n\">Requires Gecko 7.0</span>","obsolete":false},{"name":"webkitCurrentTransformInverse","help":"Set or gets the current inversed transformation matrix. \n<span title=\"(Firefox 7.0 / Thunderbird 7.0 / SeaMonkey 2.4)\n\">Requires Gecko 7.0</span>","obsolete":false},{"name":"webkitDash","help":"An array which specifies the lengths of alternating dashes and gaps. \n<span title=\"(Firefox 7.0 / Thunderbird 7.0 / SeaMonkey 2.4)\n\">Requires Gecko 7.0</span>","obsolete":false},{"name":"webkitDashOffset","help":"Specifies where to start a dasharray on a line. \n<span title=\"(Firefox 7.0 / Thunderbird 7.0 / SeaMonkey 2.4)\n\">Requires Gecko 7.0</span>","obsolete":false},{"name":"webkitFillRule","help":"The <a class=\"external\" title=\"http://cairographics.org/manual/cairo-cairo-t.html#cairo-fill-rule-t\" rel=\"external\" href=\"http://cairographics.org/manual/cairo-cairo-t.html#cairo-fill-rule-t\" target=\"_blank\">fill rule</a> to use. This must be one of <code>evenodd</code> or <code>nonzero</code> (default).","obsolete":false},{"name":"webkitImageSmoothingEnabled","help":"Image smoothing mode; if disabled, images will not be smoothed if scaled. \n<span title=\"(Firefox 3.6 / Thunderbird 3.1 / Fennec 1.0)\n\">Requires Gecko 1.9.2</span>","obsolete":false},{"name":"webkitTextStyle","help":"<span title=\"(Firefox 3)\n\">Requires Gecko 1.9</span>\n \n\n<span class=\"deprecatedInlineTemplate\" title=\"\">Deprecated</span>\n\n Deprecated in favor of the HTML5 <code>font</code> attribute described above.","obsolete":true},{"name":"webkitLineDash","help":"An array which specifies the lengths of alternating dashes and gaps.","obsolete":false},{"name":"webkitLineDashOffset","help":"Specifies where to start a dasharray on a line.","obsolete":false}]},"StyleMedia":{"title":"style.media","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/style.media","skipped":true,"cause":"Suspect title"},"PerformanceTiming":{"title":"Navigation Timing","members":[],"srcUrl":"https://developer.mozilla.org/en/Navigation_timing","skipped":true,"cause":"Suspect title"},"DOMSettableTokenList":{"title":"HTMLOutputElement","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/HTMLOutputElement","skipped":true,"cause":"Suspect title"},"SVGDescElement":{"title":"SVGDescElement","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> </tbody>\n</table>\n</div>\n<div id=\"compat-mobile\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> </tbody>\n</table>\n</div>","summary":"The <code>SVGDescElement</code> interface corresponds to the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/desc\">&lt;desc&gt;</a></code>\n element.","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/SVGDescElement"},"HTMLEmbedElement":{"title":"HTMLEmbedElement","summary":"<strong>Note:</strong>&nbsp;This topic describes the HTMLEmbedElement interface as defined in the HTML5 standard. It does not address earlier, non-standardized version of the interface.","members":[{"name":"height","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/embed#attr-height\">height</a></code>\n HTML&nbsp;attribute, containing the displayed height of the resource.","obsolete":false},{"name":"src","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/embed#attr-src\">src</a></code>\n HTML&nbsp;attribute, containing the address of the resource.","obsolete":false},{"name":"type","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/embed#attr-type\">type</a></code>\n HTML&nbsp;attribute, containing the type of the resource.","obsolete":false},{"name":"width","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/embed#attr-width\">width</a></code>\n HTML&nbsp;attribute, containing the displayed width of the resource.","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/DOM/HTMLEmbedElement"},"CharacterData":{"title":"CharacterData","summary":"<code><a title=\"En/DOM/Text\" rel=\"internal\" href=\"https://developer.mozilla.org/En/DOM/Text\">Text</a></code>, <code><a title=\"En/DOM/Comment\" rel=\"internal\" href=\"https://developer.mozilla.org/En/DOM/Comment\">Comment</a></code>, and <code><a title=\"en/DOM/CDATASection\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/CDATASection\">CDATASection</a></code> all implement CharacterData, which in turn also implements <code><a class=\"internal\" title=\"En/DOM/Node\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/Node\">Node</a></code>. See <code>Node</code> for the remaining methods, properties, and constants.","members":[{"obsolete":false,"url":"https://developer.mozilla.org/En/DOM/CharacterData.data","name":"data","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/En/DOM/CharacterData.length","name":"length","help":""}],"srcUrl":"https://developer.mozilla.org/En/DOM/CharacterData","specification":"http://www.w3.org/TR/DOM-Level-3-Cor...ml#ID-FF21A306"},"IDBFactory":{"title":"IDBFactory","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td><code>open()</code> old specification</td> <td>12\n<span title=\"prefix\">webkit</span></td> <td>4.0 (2.0)\n\n<span title=\"prefix\">moz</span> until 9.0 (9.0)\n</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> </tr> <tr> <td><code>open()</code> new specification</td> <td><span title=\"Not supported.\">--</span></td> <td>10.0 (10.0)\n</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> </tr> <tr> <td><code>cmp ()</code></td> <td>16\n<span title=\"prefix\">webkit</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> </tr> <tr> <td><code>deleteDatabase()</code></td> <td>17\n<span title=\"prefix\">webkit</span></td> <td>10.0 (10.0)\n</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE&nbsp;Phone</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Not supported.\">--</span></td> <td>6.0 (6.0)\n</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> </tr> </tbody> </table>\n</div>","examples":["<p>In the following code snippet, we open a database asynchronously and make a request. Event handlers are registered for responding to various situations.</p>\n\n          <pre name=\"code\" class=\"js\">// Taking care of the browser-specific prefixes.\nif ('webkitIndexedDB' in window) {\n   window.indexedDB = window.webkitIndexedDB;   \n} else if ('mozIndexedDB' in window) {\n   window.indexedDB = window.mozIndexedDB;\n... \n\n//Open a database called myAwesomeDatabase\nvar request = window.indexedDB.open('myAwesomeDatabase');\n//When a success event happens, do something.\nrequest.onsuccess = function(event) {\n        var db = this.result;\n        var transaction = db.transaction([], IDBTransaction.READ_ONLY);\n        var curRequest = transaction.objectStore('ObjectStore Name').openCursor();\n        curRequest.onsuccess = ...;\n    };\n//When an error event happens, do something else.\nrequest.onerror = function(event) {\n         ...;\n    };</pre>"],"srcUrl":"https://developer.mozilla.org/en/IndexedDB/IDBFactory","summary":"<p>The <code>IDBFactory</code> interface of the <a title=\"en/IndexedDB\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB\">IndexedDB&nbsp;API</a> lets applications asynchronously access the indexed databases. The object that implements the interface is&nbsp; <code>window.indexedDB</code>. You open—that is, create and access—and delete a database with the object and not directly with <code>IDBFactory</code>.</p>\n<p>This interface still has vendor prefixes, that is to say, you have to make calls with <code>mozIndexedDB.open()</code> for Firefox and <code>webkitIndexedDB.open()</code> for Chrome.</p>","members":[{"name":"open","help":"<div class=\"warning\"><strong>Warning:</strong> The description documents the old specification. Some browsers still implement this method. The specifications have changed, but the changes have not yet been implemented by all browser. See the compatibility table for more information.</div>\n<p>Request opening a <a title=\"en/IndexedDB#gloss database connection\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB#gloss_database_connection\">connection to a database</a>. The method returns &nbsp;an IDBRequest object&nbsp;immediately, and performs the opening operation asynchronously.&nbsp;</p>\n<p>The opening operation—which is performed in a separate thread—consists of the following steps:</p>\n<ol> <li>If a database named <code>myAwesomeDatabase</code> already exists: <ul> <li>Wait until any existing <code><a title=\"en/IndexedDB/IDBTransaction#VERSION CHANGE\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBTransaction#VERSION_CHANGE\">VERSION_CHANGE</a></code> transactions have finished.</li> <li>If the database has a deletion pending, wait until it has been deleted.</li> </ul> </li> <li>If no database with that name exists, create a database with the provided name, with the empty string as its version, and no object stores.</li> <li>Create a connection to the database.</li>\n</ol>\n<p>If the operation is successful, an <a title=\"en/IndexedDB/IDBSuccessEvent\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBSuccessEvent\">IDBSuccessEvent</a> is fired on the request object that is returned from this method, with its <a title=\"en/IndexedDB/IDBSuccessEvent#attr result\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBSuccessEvent#attr_result\">result</a> attribute set to the new <a title=\"en/IndexedDB/IDBDatabase\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabase\">IDBDatabase</a> object for the connection.</p>\n<p>If an error occurs while the database connection is being opened, then an <a title=\"en/IndexedDB/IDBErrorEvent\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBErrorEvent\">error event</a> is fired on the request object returned from this method, with its <a title=\"en/IndexedDB/IDBErrorEvent#attr code\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBErrorEvent#attr_code\"><code>code</code></a> and&nbsp; <code><a title=\"en/IndexedDB/IDBErrorEvent#attr message\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBErrorEvent#attr_message\">message</a></code> set to appropriate values.</p>\n\n<div id=\"section_5\"><span id=\"Parameters\"></span><h5 class=\"editable\">Parameters</h5>\n<dl> <dt>name</dt> <dd>The name of the database.</dd> <dt>version</dt> <dd>The version of the database.</dd>\n</dl>\n</div><div id=\"section_6\"><span id=\"Returns\"></span><h5 class=\"editable\">Returns</h5>\n<dl> <dt><code><a title=\"en/IndexedDB/IDBRequest\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBRequest\">IDBRequest</a></code></dt> <dd>A request object on which subsequent events related to this request are fired. In the latest draft of the specification, which has not yet been implemented by browsers, the returned object is <code>IDBOpenRequest</code>.</dd>\n</dl>\n</div>","idl":"<pre>IDBRequest open(\n&nbsp; in DOMString name\n);</pre>","obsolete":false},{"name":"cmp","help":"<p>Compares two values as keys to determine equality and ordering for IndexedDB operations, such as storing and iterating. Do not use this method for comparing arbitrary JavaScript values, because many JavaScript values are either not valid IndexedDB keys (booleans and objects, for example) or are treated as equivalent IndexedDB keys (for example, since IndexedDB ignores arrays with non-numeric properties and treats them as empty arrays, so any non-numeric array are treated as equivalent).</p>\n<p>This throws an exception if either of the values is not a valid key. &nbsp;</p>\n\n<div id=\"section_11\"><span id=\"Parameters_3\"></span><h5 class=\"editable\">Parameters</h5>\n<dl> <dt>first</dt> <dd>The first key to compare.</dd> <dt>second</dt> <dd>The second key to compare.</dd>\n</dl>\n</div><div id=\"section_12\"><span id=\"Returns_3\"></span><h5 class=\"editable\">Returns</h5>\n<dl> <dt>Integer</dt> <dd> <table class=\"standard-table\" width=\"434\"> <thead> <tr> <th scope=\"col\" width=\"216\">Returned value</th> <th scope=\"col\" width=\"206\">Description</th> </tr> </thead> <tbody> <tr> <td>-1</td> <td>1st key &lt; 2nd</td> </tr> <tr> <td>0</td> <td>1st key = 2nd</td> </tr> <tr> <td>1</td> <td>1st key &gt; 2nd</td> </tr> </tbody> </table> </dd>\n</dl>\n</div><div id=\"section_13\"><span id=\"Exceptions\"></span><h5 class=\"editable\">Exceptions</h5>\n<p>This method can raise an <a title=\"en/IndexedDB/IDBDatabaseException\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException\">IDBDatabaseException</a> with the following code:</p>\n<br>\n<br>\n<br><table class=\"standard-table\"> <thead> <tr> <th scope=\"col\" width=\"131\">Attribute</th> <th scope=\"col\" width=\"698\">Description</th> </tr> <tr> <td><code><a title=\"en/IndexedDB/IDBDatabaseException#NON_TRANSIENT_ERR\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#NON_TRANSIENT_ERR\">NON_TRANSIENT_ERR</a></code></td> <td>One of the supplied keys was not a valid key.</td> </tr> </thead> <tbody> </tbody>\n</table>\n</div>","idl":"<pre>int cmp(\n  in any first, in any second\n);\n</pre>","obsolete":false},{"name":"deleteDatabase","help":"<p>Request deleting a database. The method returns&nbsp;&nbsp;an IDBRequest object&nbsp;immediately, and performs the deletion operation&nbsp;asynchronously.</p>\n<p>The deletion operation (performed in a different thread) consists of the following steps:</p>\n<ol> <li>If there is no database with the given name, exit successfully.</li> <li>Fire an <a title=\"en/IndexedDB/IDBVersionChangeEvent\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBVersionChangeEvent\">IDBVersionChangeEvent</a> at all connection objects connected to the named database, with <code><a title=\"en/IndexedDB/IDBVersionChangeEvent#attr version\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBVersionChangeEvent#attr_version\">version</a></code> set to <code>null</code>.</li> <li>If any connection objects connected to the database are still open, fire a <code>blocked</code> event at the request object returned by the <code>deleteDatabase</code> method, using <a title=\"en/IndexedDB/IDBVersionChangeEvent\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBVersionChangeEvent\">IDBVersionChangeEvent</a> with <code><a title=\"en/IndexedDB/IDBVersionChangeEvent#attr version\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBVersionChangeEvent#attr_version\">version</a></code> set to <code>null</code>.</li> <li>Wait until all open connections to the database are closed.</li> <li>Delete the database.</li>\n</ol>\n<p>If the database is successfully deleted, then an <a title=\"en/IndexedDB/IDBSuccessEvent\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBSuccessEvent\">IDBSuccessEvent</a> is fired on the request object returned from this method, with its <code><a title=\"en/IndexedDB/IDBSuccessEvent#attr result\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBSuccessEvent#attr_result\">result</a></code> set to <code>null</code>.</p>\n<p>If an error occurs while the database is being deleted, then an error event is fired on the request object that is returned from this method, with its <code><a title=\"en/IndexedDB/IDBErrorEvent#attr code\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBErrorEvent#attr_code\">code</a></code> and <code><a title=\"en/IndexedDB/IDBErrorEvent#attr message\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBErrorEvent#attr_message\">message</a></code> set to appropriate values.</p>\n<p><strong>Tip:</strong> If the browser you are using hasn't implemented this yet, you can delete the object stores one by one, thus effectively removing the database.</p>\n\n<div id=\"section_8\"><span id=\"Parameters_2\"></span><h5 class=\"editable\">Parameters</h5>\n<dl> <dt>name</dt> <dd>The name of the database.</dd>\n</dl>\n</div><div id=\"section_9\"><span id=\"Returns_2\"></span><h5 class=\"editable\">Returns</h5>\n<dl> <dt><code><a title=\"en/IndexedDB/IDBRequest\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBRequest\">IDBRequest</a></code></dt> <dd>A request object on which subsequent events related to this request are fired. In the latest draft of the specification, which has not yet been implemented by browsers, the returned object is <code>IDBOpenRequest</code>.</dd>\n</dl>\n</div>","idl":"<pre>IDBRequest deleteDatabase(\n  in DOMString name\n);\n</pre>","obsolete":false}]},"SVGLinearGradientElement":{"title":"SVGLinearGradientElement","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>","summary":"The <code>SVGLinearGradientElement</code> interface corresponds to the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/linearGradient\">&lt;linearGradient&gt;</a></code>\n element.","members":[{"name":"x1","help":"Corresponds to attribute \n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Attribute/x1\">x1</a></code> on the given <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/linearGradient\">&lt;linearGradient&gt;</a></code>\n element.","obsolete":false},{"name":"y1","help":"Corresponds to attribute \n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Attribute/y1\">y1</a></code> on the given <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/linearGradient\">&lt;linearGradient&gt;</a></code>\n element.","obsolete":false},{"name":"x2","help":"Corresponds to attribute \n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Attribute/x2\">x2</a></code> on the given <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/linearGradient\">&lt;linearGradient&gt;</a></code>\n element.","obsolete":false},{"name":"y2","help":"Corresponds to attribute \n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Attribute/y2\">y2</a></code> on the given <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/linearGradient\">&lt;linearGradient&gt;</a></code>\n element.","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/DOM/SVGLinearGradientElement"},"AudioParam":{"title":"Using the Right Markup to Invoke Plugins","members":[],"srcUrl":"https://developer.mozilla.org/en/using_the_right_markup_to_invoke_plugins","skipped":true,"cause":"Suspect title"},"HTMLFontElement":{"title":"font","summary":"Obsolete","members":[{"obsolete":false,"url":"","name":"face","help":"This attribute contains a comma-sperated list of one or more font names. The document text in the default style is rendered in the first font face that the client's browser supports. If no font listed is installed on the local system, the browser typically defaults to the proportional or fixed-width font for that system."},{"obsolete":false,"url":"","name":"color","help":"This attribute sets the text color using either a named color or a color specified in the hexadecimal #RRGGBB format."},{"obsolete":false,"url":"","name":"size","help":"This attribute specifies the font size as either a numeric or relative value. Numeric values range from <span>1</span> to <span>7</span> with <span>1</span> being the smallest and <span>3</span> the default. It can be defined using a relative value, like <span>+2</span> or <span>-3</span>, which set it relative to the value of the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/basefont#attr-size\">size</a></code>\n attribute of the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/basefont\">&lt;basefont&gt;</a></code>\n element, or relative to <span>3</span>, the default value, if none does exist."}],"srcUrl":"https://developer.mozilla.org/en/HTML/Element/font"},"WebKitFlags":{"title":"JSClass.flags","summary":"<p>The <strong><code><a title=\"en/SpiderMonkey/JSAPI_Reference/JSClass\" rel=\"internal\" href=\"https://developer.mozilla.org/en/SpiderMonkey/JSAPI_Reference/JSClass\">JSClass</a>.flags</code></strong> field allows an application to enable optional <code>JSClass</code> features on a per-class basis. The <code>flags</code> field is of type <code>uint32</code>. Its value is the logical OR of zero or more of the following constants:</p>\n<table class=\"fullwidth-table\"> <tbody> <tr> <th>Flag</th> <th>Meaning</th> </tr> <tr> <td> <p><code>JSCLASS_HAS_PRIVATE</code></p> </td> <td> <p>This class uses private data. If this flag is set, each instance of the class has a field for private data. The field can be accessed using <code><a title=\"en/SpiderMonkey/JSAPI_Reference/JS_GetPrivate\" rel=\"internal\" href=\"https://developer.mozilla.org/en/SpiderMonkey/JSAPI_Reference/JS_GetPrivate\">JS_GetPrivate</a></code> and <code><a title=\"en/SpiderMonkey/JSAPI_Reference/JS_SetPrivate\" rel=\"internal\" href=\"https://developer.mozilla.org/en/SpiderMonkey/JSAPI_Reference/JS_SetPrivate\">JS_SetPrivate</a></code>.</p> <p><a rel=\"custom\" href=\"http://mxr.mozilla.org/mozilla-central/ident?i=JSCLASS_HAS_PRIVATE\">MXR ID Search for <code>JSCLASS_HAS_PRIVATE</code></a>\n</p> </td> </tr> <tr> <td> <p><code>JSCLASS_NEW_ENUMERATE</code></p> </td> <td> <p>This class's <code>enumerate</code> hook is actually a <code><a title=\"en/SpiderMonkey/JSAPI_Reference/JSClass.enumerate\" rel=\"internal\" href=\"https://developer.mozilla.org/en/SpiderMonkey/JSAPI_Reference/JSClass.enumerate\">JSNewEnumerateOp</a></code>, not a <code><a title=\"en/SpiderMonkey/JSAPI_Reference/JSEnumerateOp\" rel=\"internal\" href=\"https://developer.mozilla.org/en/SpiderMonkey/JSAPI_Reference/JSEnumerateOp\">JSEnumerateOp</a></code>.</p> <p><a rel=\"custom\" href=\"http://mxr.mozilla.org/mozilla-central/ident?i=JSCLASS_NEW_ENUMERATE\">MXR ID Search for <code>JSCLASS_NEW_ENUMERATE</code></a>\n</p> </td> </tr> <tr> <td> <p><code>JSCLASS_NEW_RESOLVE</code></p> </td> <td> <p>This class's <code>resolve</code> hook is actually a <code><a title=\"En/SpiderMonkey/JSAPI_Reference/JSNewResolveOp\" rel=\"internal\" href=\"https://developer.mozilla.org/En/SpiderMonkey/JSAPI_Reference/JSNewResolveOp\">JSNewResolveOp</a></code>, not a <code><a title=\"en/SpiderMonkey/JSAPI_Reference/JSClass.resolve\" rel=\"internal\" href=\"https://developer.mozilla.org/en/SpiderMonkey/JSAPI_Reference/JSClass.resolve\">JSResolveOp</a></code>.</p> <p><a rel=\"custom\" href=\"http://mxr.mozilla.org/mozilla-central/ident?i=JSCLASS_NEW_RESOLVE\">MXR ID Search for <code>JSCLASS_NEW_RESOLVE</code></a>\n</p> </td> </tr> <tr> <td> <p><code>JSCLASS_PRIVATE_IS_NSISUPPORTS</code></p> </td> <td> <p>Mozilla extension. The private field of each object of this class points to an <a title=\"en/XPCOM\" rel=\"internal\" href=\"https://developer.mozilla.org/en/XPCOM\">XPCOM</a> object (see <code><a title=\"en/nsISupports\" rel=\"internal\" href=\"https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsISupports\">nsISupports</a></code>). This is only meaningful if SpiderMonkey is built with <a title=\"en/XPConnect\" rel=\"internal\" href=\"https://developer.mozilla.org/en/XPConnect\">XPConnect</a> and the <code>JSCLASS_HAS_PRIVATE</code> flag is also set.</p> <p><a rel=\"custom\" href=\"http://mxr.mozilla.org/mozilla-central/ident?i=JSCLASS_PRIVATE_IS_NSISUPPORTS\">MXR ID Search for <code>JSCLASS_PRIVATE_IS_NSISUPPORTS</code></a>\n</p> </td> </tr> <tr> <td> <p><code>JSCLASS_SHARE_ALL_PROPERTIES</code></p> </td> <td> <p>Instructs SpiderMonkey to automatically give all properties of objects of this class the <code><a title=\"en/SpiderMonkey/JSAPI_Reference/JS_GetPropertyAttributes\" rel=\"internal\" href=\"https://developer.mozilla.org/en/SpiderMonkey/JSAPI_Reference/JS_GetPropertyAttributes\">JSPROP_SHARED</a></code> attribute.</p> <p><a rel=\"custom\" href=\"http://mxr.mozilla.org/mozilla-central/ident?i=JSCLASS_SHARE_ALL_PROPERTIES\">MXR ID Search for <code>JSCLASS_SHARE_ALL_PROPERTIES</code></a>\n</p> </td> </tr> <tr> <td> <p><code>JSCLASS_NEW_RESOLVE_GETS_START</code></p> </td> <td> <p>The <code>resolve</code> hook expects to receive the starting object in the prototype chain passed in via the <code>*objp</code> in/out parameter. (This is meaningful only if the <code>JSCLASS_NEW_RESOLVE</code> flag is also set.)</p> <p><a rel=\"custom\" href=\"http://mxr.mozilla.org/mozilla-central/ident?i=JSCLASS_NEW_RESOLVE_GETS_START\">MXR ID Search for <code>JSCLASS_NEW_RESOLVE_GETS_START</code></a>\n</p> </td> </tr> <tr> <td id=\"JSCLASS_CONSTRUCT_PROTOTYPE\"> <p><code>JSCLASS_CONSTRUCT_PROTOTYPE</code></p> </td> <td> <p>Instructs <code><a title=\"en/SpiderMonkey/JSAPI_Reference/JS_InitClass\" rel=\"internal\" href=\"https://developer.mozilla.org/en/SpiderMonkey/JSAPI_Reference/JS_InitClass\">JS_InitClass</a></code> to invoke the constructor when creating the class prototype.</p> <p><a rel=\"custom\" href=\"http://mxr.mozilla.org/mozilla-central/ident?i=JSCLASS_CONSTRUCT_PROTOTYPE\">MXR ID Search for <code>JSCLASS_CONSTRUCT_PROTOTYPE</code></a>\n</p> </td> </tr> <tr> <td> <p><code>JSCLASS_HAS_RESERVED_SLOTS(n)</code></p> </td> <td> <p>Indicates that instances of this class have <code>n</code> <em>reserved slots</em>. <code>n</code> is an integer in the range <code>[0..255]</code>. The slots initially contain unspecified valid <code>jsval</code> values. They can be accessed using <code><a title=\"en/SpiderMonkey/JSAPI_Reference/JS_GetReservedSlot\" rel=\"internal\" href=\"https://developer.mozilla.org/en/SpiderMonkey/JSAPI_Reference/JS_GetReservedSlot\">JS_GetReservedSlot</a></code> and <code><a title=\"en/JS_SetReservedSlot\" rel=\"internal\" href=\"https://developer.mozilla.org/en/SpiderMonkey/JSAPI_Reference/JS_GetReservedSlot\">JS_SetReservedSlot</a></code>.</p> <p>(The <code><a title=\"en/SpiderMonkey/JSAPI_Reference/JSClass.reserveSlots\" rel=\"internal\" href=\"https://developer.mozilla.org/en/SpiderMonkey/JSAPI_Reference/JSClass.reserveSlots\">JSClass.reserveSlots</a></code> hook also allocates reserved slots to objects.)</p> <p><a rel=\"custom\" href=\"http://mxr.mozilla.org/mozilla-central/ident?i=JSCLASS_HAS_RESERVED_SLOTS\">MXR ID Search for <code>JSCLASS_HAS_RESERVED_SLOTS</code></a>\n</p> </td> </tr> <tr> <td> <p><code>JSCLASS_IS_EXTENDED</code></p> </td> <td> <p>Indicates that this <code>JSClass</code> is really a <code><a title=\"en/SpiderMonkey/JSAPI_Reference/JSExtendedClass\" rel=\"internal\" href=\"https://developer.mozilla.org/en/SpiderMonkey/JSAPI_Reference/JSExtendedClass\">JSExtendedClass</a></code>.</p> <p><a rel=\"custom\" href=\"http://mxr.mozilla.org/mozilla-central/ident?i=JSCLASS_IS_EXTENDED\">MXR ID Search for <code>JSCLASS_IS_EXTENDED</code></a>\n</p> </td> </tr> <tr> <td> <p><code>JSCLASS_MARK_IS_TRACE</code></p> </td> <td> <p>Indicates that the <code><a title=\"en/SpiderMonkey/JSAPI_Reference/JSClass.mark\" rel=\"internal\" href=\"https://developer.mozilla.org/en/SpiderMonkey/JSAPI_Reference/JSClass.mark\">mark</a></code> hook implements the new <code><a title=\"en/SpiderMonkey/JSAPI_Reference/JSTraceOp\" rel=\"internal\" href=\"https://developer.mozilla.org/en/SpiderMonkey/JSAPI_Reference/JSTraceOp\">JSTraceOp</a></code> signature instead of the old <code><a title=\"en/SpiderMonkey/JSAPI_Reference/JSClass.mark\" rel=\"internal\" href=\"https://developer.mozilla.org/en/SpiderMonkey/JSAPI_Reference/JSClass.mark\">JSMarkOp</a></code> signature. This is recommended for all new code that needs custom marking.</p> <p><a rel=\"custom\" href=\"http://mxr.mozilla.org/mozilla-central/ident?i=JSCLASS_MARK_IS_TRACE\">MXR ID Search for <code>JSCLASS_MARK_IS_TRACE</code></a>\n</p> </td> </tr> <tr> <td> <p><code>JSCLASS_GLOBAL_FLAGS</code></p> </td> <td> <p>This flag is only relevant for the class of an object that is used as a global object. (ECMAScript specifies a single global object, but in SpiderMonkey the global object is the last object in the <a title=\"en/SpiderMonkey/JSAPI_Reference/JS_GetScopeChain\" rel=\"internal\" href=\"https://developer.mozilla.org/en/SpiderMonkey/JSAPI_Reference/JS_GetScopeChain\">scope chain</a>, which can be different objects at different times. This is actually quite subtle. <code><a title=\"en/SpiderMonkey/JSAPI_Reference/JS_ExecuteScript\" rel=\"internal\" href=\"https://developer.mozilla.org/en/SpiderMonkey/JSAPI_Reference/JS_ExecuteScript\">JS_ExecuteScript</a></code> and similar APIs set the global object for the code they execute. <code><a title=\"en/SpiderMonkey/JSAPI_Reference/JS_SetGlobalObject\" rel=\"internal\" href=\"https://developer.mozilla.org/en/SpiderMonkey/JSAPI_Reference/JS_SetGlobalObject\">JS_SetGlobalObject</a></code> sets an object which is sometimes used as the global object, as a last resort.)</p> <p>Enable standard ECMAScript behavior for setting the prototype of certain objects, such as <code>Function</code> objects. If the global object does not have this flag, then scripts may cause nonstandard behavior by replacing standard constructors or prototypes (such as <code>Function.prototype</code>.)</p> <p>Objects that can end up with the wrong prototype object, if this flag is not present, include: <code>arguments</code> objects (\n<a rel=\"custom\" href=\"http://bclary.com/2004/11/07/#a-10.1.8\">§10.1.8</a>\n specifies \"the original <code>Object</code> prototype\"), <code>Function</code> objects (\n<a rel=\"custom\" href=\"http://bclary.com/2004/11/07/#a-13.2\">§13.2</a>\n specifies \"the original <code>Function</code> prototype\"), and objects created by many standard constructors (\n<a rel=\"custom\" href=\"http://bclary.com/2004/11/07/#a-15.4.2.1\">§15.4.2.1</a>\n and others).</p> <p><a rel=\"custom\" href=\"http://mxr.mozilla.org/mozilla-central/ident?i=JSCLASS_GLOBAL_FLAGS\">MXR ID Search for <code>JSCLASS_GLOBAL_FLAGS</code></a>\n</p> </td> </tr> </tbody>\n</table>\n<p>SpiderMonkey reserves a few other flags for its internal use. They are <code>JSCLASS_IS_ANONYMOUS</code>, <code>JSCLASS_IS_GLOBAL</code>, and <code>JSCLASS_HAS_CACHED_PROTO</code>. JSAPI applications should not use these flags.</p>","members":[],"srcUrl":"https://developer.mozilla.org/en/JSClass.flags"},"SVGTransformList":{"title":"SVGTransformList","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>length</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td>9.0 (9.0)\n</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td>\n11.5</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>length</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td>9.0 (9.0)\n</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>","summary":"<p>The <code>SVGTransformList</code> defines a list of <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/SVGTransform\">SVGTransform</a></code>\n objects.</p>\n<p>An <code>SVGTransformList</code> object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown.</p>\n<div class=\"geckoVersionNote\"> <p>\n</p><div class=\"geckoVersionHeading\">Gecko 9.0 note<div>(Firefox 9.0 / Thunderbird 9.0 / SeaMonkey 2.6)\n</div></div>\n<p></p> <p>Starting in Gecko 9.0 (Firefox 9.0 / Thunderbird 9.0 / SeaMonkey 2.6)\n,the <code>SVGTransformList</code> DOM interface is now indexable and can be accessed like Arrays</p>\n</div>","members":[{"name":"clear","help":"<p>Clears all existing current items from the list, with the result being an empty list.</p> <p><strong>Exceptions:</strong></p> <ul> <li>a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DOMException\">DOMException</a></code>\n with code <code>NO_MODIFICATION_ALLOWED_ERR</code> is raised when the list corresponds to a read only attribute or when the object itself is read only.</li> </ul>","obsolete":false},{"name":"initialize","help":"<p>Clears all existing current items from the list and re-initializes the list to hold the single item specified by the parameter. If the inserted item is already in a list, it is removed from its previous list before it is inserted into this list. The inserted item is the item itself and not a copy. The return value is the item inserted into the list.</p> <p><strong>Exceptions:</strong></p> <ul> <li>a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DOMException\">DOMException</a></code>\n with code <code>NO_MODIFICATION_ALLOWED_ERR</code> is raised when the list corresponds to a read only attribute or when the object itself is read only.</li> </ul>","obsolete":false},{"name":"getItem","help":"<p>Returns the specified item from the list. The returned item is the item itself and not a copy. Any changes made to the item are immediately reflected in the list. The first item is number&nbsp;0.</p> <p><strong>Exceptions:</strong></p> <ul> <li>a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DOMException\">DOMException</a></code>\n with code <code>NO_MODIFICATION_ALLOWED_ERR</code> is raised when the list corresponds to a read only attribute or when the object itself is read only.</li> </ul>","obsolete":false},{"name":"insertItemBefore","help":"<p>Inserts a new item into the list at the specified position. The first item is number 0. If <code>newItem</code> is already in a list, it is removed from its previous list before it is inserted into this list. The inserted item is the item itself and not a copy. If the item is already in this list, note that the index of the item to insert before is before the removal of the item. If the <code>index</code> is equal to 0, then the new item is inserted at the front of the list. If the index is greater than or equal to <code>numberOfItems</code>, then the new item is appended to the end of the list.</p> <p><strong>Exceptions:</strong></p> <ul> <li>a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DOMException\">DOMException</a></code>\n with code <code>NO_MODIFICATION_ALLOWED_ERR</code> is raised when the list corresponds to a read only attribute or when the object itself is read only.</li> </ul>","obsolete":false},{"name":"replaceItem","help":"<p>Replaces an existing item in the list with a new item. If <code>newItem</code> is already in a list, it is removed from its previous list before it is inserted into this list. The inserted item is the item itself and not a copy. If the item is already in this list, note that the index of the item to replace is before the removal of the item.</p> <p><strong>Exceptions:</strong></p> <ul> <li>a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DOMException\">DOMException</a></code>\n with code <code>NO_MODIFICATION_ALLOWED_ERR</code> is raised when the list corresponds to a read only attribute or when the object itself is read only.</li> <li>a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DOMException\">DOMException</a></code>\n with code <code>INDEX_SIZE_ERR</code> is raised if the index number is greater than or equal to <code>numberOfItems</code>.</li> </ul>","obsolete":false},{"name":"removeItem","help":"<p>Removes an existing item from the list.</p> <p><strong>Exceptions:</strong></p> <ul> <li>a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DOMException\">DOMException</a></code>\n with code <code>NO_MODIFICATION_ALLOWED_ERR</code> is raised when the list corresponds to a read only attribute or when the object itself is read only.</li> <li>a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DOMException\">DOMException</a></code>\n with code <code>INDEX_SIZE_ERR</code> is raised if the index number is greater than or equal to <code>numberOfItems</code>.</li> </ul>","obsolete":false},{"name":"appendItem","help":"<p>Inserts a new item at the end of the list. If <code>newItem</code> is already in a list, it is removed from its previous list before it is inserted into this list. The inserted item is the item itself and not a copy.</p> <p><strong>Exceptions:</strong></p> <ul> <li>a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DOMException\">DOMException</a></code>\n with code <code>NO_MODIFICATION_ALLOWED_ERR</code> is raised when the list corresponds to a read only attribute or when the object itself is read only.</li> </ul>","obsolete":false},{"name":"numberOfItem","help":"The number of items in the list.","obsolete":false},{"name":"length","help":"The number of items in the list.","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/DOM/SVGTransformList"},"Metadata":{"title":"metadata","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\">\n<table class=\"compat-table\"> <tbody> \n<tr><th scope=\"col\">Feature</th><th scope=\"col\">Chrome</th><th scope=\"col\">Firefox (Gecko)</th><th scope=\"col\">Internet Explorer</th><th scope=\"col\">Opera</th><th scope=\"col\">Safari</th></tr> <tr> <td>Basic support</td> <td>1.0</td> <td>1.5 (1.8)\n</td> <td>\n9.0</td> <td>\n8.0</td> <td>\n3.0.4</td> </tr> </tbody>\n</table>\n</div>\n<div id=\"compat-mobile\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE&nbsp;Phone</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td>\n3.0</td> <td>1.0 (1.8)\n</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td>\n3.0.4</td> </tr> </tbody>\n</table>\n</div>\n<p>The chart is based on <a title=\"en/SVG/Compatibility sources\" rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Compatibility_sources\">these sources</a>.</p>","summary":"Metadata is structured data about data. Metadata which is included with SVG content should be specified within <code>metadata</code> elements. The contents of the <code>metadata</code> should be elements from other XML namespaces such as RDF, FOAF, etc.","members":[],"srcUrl":"https://developer.mozilla.org/en/SVG/Element/metadata"},"HTMLMeterElement":{"title":"meter","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari</th> </tr> <tr> <td>Basic support</td> <td>6.0</td> <td><span title=\"Not supported.\">--</span> <a rel=\"external\" href=\"https://bugzilla.mozilla.org/show_bug.cgi?id=555985\" class=\"external\" title=\"\">\nbug 555985</a>\n</td> <td><span title=\"Not supported.\">--</span></td> <td>11.0</td> <td>\n<em><a rel=\"custom\" href=\"http://nightly.webkit.org/\">Nightly build</a></em></td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span> <a rel=\"external\" href=\"https://bugzilla.mozilla.org/show_bug.cgi?id=555985\" class=\"external\" title=\"\">\nbug 555985</a>\n</td> <td><span title=\"Not supported.\">--</span></td> <td>11.0</td> <td><span title=\"Not supported.\">--</span></td> </tr> </tbody> </table>\n</div>","examples":["<div id=\"section_5\"><span id=\"Simple_example\"></span><h4 class=\"editable\">Simple example</h4>\n\n          <pre name=\"code\" class=\"xml\">&lt;p&gt;Heat the oven to &lt;meter min=\"200\" max=\"500\" value=\"350\"&gt;350 degrees&lt;/meter&gt;.&lt;/p&gt;</pre>\n        \n<p>On Google Chrome, the resulting meter looks like this:</p>\n<p><img class=\"internal default\" alt=\"meter1.png\" src=\"https://developer.mozilla.org/@api/deki/files/4940/=meter1.png\"></p>\n</div><div id=\"section_6\"><span id=\"Hilo_Range_example\"></span><span id=\"High_and_Low_range_example\"></span><h4 class=\"editable\">High and Low range example</h4>\n<p>Note that in this example the <strong>min</strong> attribute is omitted; this is allowed, as it will default to 0.</p>\n\n          <pre name=\"code\" class=\"xml\">&lt;p&gt;He got a &lt;meter low=\"69\" high=\"80\" max=\"100\" value=\"84\"&gt;B&lt;/meter&gt; on the exam.&lt;/p&gt;</pre>\n        \n<p>On Google Chrome, the resulting meter looks like this:</p>\n<p><img class=\"internal default\" alt=\"meter2.png\" src=\"https://developer.mozilla.org/@api/deki/files/4941/=meter2.png\"></p>\n</div>"],"srcUrl":"https://developer.mozilla.org/en/HTML/Element/meter","summary":"<p>The HTML <em>meter</em> element (<code>&lt;meter&gt;</code>) represents either a scalar value within a known range or a fractional value.</p>\n<div class=\"note\"><strong>Usage note: </strong>Unless the <strong>value</strong> attribute is between 0 and 1 (inclusive), the <strong>min</strong> attribute and <strong>max</strong> attribute should define the range so that the <strong>value</strong> attribute's value is within it.</div>","members":[{"obsolete":false,"url":"","name":"min","help":"The lower numeric bound of the measured range. This must be less than the maximum value (<strong>max</strong> attribute), if specified. If unspecified, the minimum value is 0."},{"obsolete":false,"url":"","name":"form","help":"This attribute associates the element with a <code>form</code> element that has ownership of the <code>meter</code> element. For example, a <code>meter</code> might be displaying a range corresponding to an <code>input</code> element of <strong>type</strong> <em>number</em>. This attribute is only used if the <code>meter</code> element is being used as a form-associated element; even then, it may be omitted if the element appears as a descendant of a <code>form</code> element."},{"obsolete":false,"url":"","name":"max","help":"The upper numeric bound of the measured range. This must be greater than the minimum value (<strong>min</strong> attribute), if specified. If unspecified, the maximum value is 1."},{"obsolete":false,"url":"","name":"optimum","help":"This attribute indicates the optimal numeric value. It must be within the range (as defined by the <strong>min</strong> attribute and <strong>max</strong> attribute). When used with the <strong>low</strong> attribute and <strong>high</strong> attribute, it gives an indication where along the range is considered preferable. For example, if it is between the <strong>min</strong> attribute and the <strong>low</strong> attribute, then the lower range is considered preferred."},{"obsolete":false,"url":"","name":"high","help":"The lower numeric bound of the high end of the measured range. This must be less than the maximum value (<strong>max</strong> attribute), and it also must be greater than the low value and minimum value (<strong>low</strong> attribute and <strong>min</strong> attribute, respectively), if any are specified. If unspecified, or if greater than the maximum value, the <strong>high</strong> value is equal to the maximum value."},{"obsolete":false,"url":"","name":"low","help":"The upper numeric bound of the low end of the measured range. This must be greater than the minimum value (<strong>min</strong> attribute), and it also must be less than the high value and maximum value (<strong>high</strong> attribute and <strong>max</strong> attribute, respectively), if any are specified. If unspecified, or if less than the minimum value, the <strong>low</strong> value is equal to the minimum value."},{"obsolete":false,"url":"","name":"value","help":"The current numeric value. This must be between the minimum and maximum values (<strong>min</strong> attribute and <strong>max</strong> attribute) if they are specified. If unspecified or malformed, the value is 0. If specified, but not within the range given by the <strong>min</strong> attribute and <strong>max</strong> attribute, the value is equal to the nearest end of the range."}]},"SVGStringList":{"title":"SVGStringList","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td>12.0 (12)\n</td> <td>9.0</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td>12.0 (12)\n</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>","summary":"<p>The <code>SVGStringList</code> defines a list of <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DOMString\">DOMString</a></code>\n objects.</p>\n<p>An <code>SVGStringList</code> object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown.</p>","members":[{"name":"clear","help":"<p>Clears all existing current items from the list, with the result being an empty list.</p> <p><strong>Exceptions:</strong></p> <ul> <li>a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DOMException\">DOMException</a></code>\n with code <code>NO_MODIFICATION_ALLOWED_ERR</code> is raised when the list corresponds to a read only attribute or when the object itself is read only.</li> </ul>","obsolete":false},{"name":"initialize","help":"<p>Clears all existing current items from the list and re-initializes the list to hold the single item specified by the parameter. If the inserted item is already in a list, it is removed from its previous list before it is inserted into this list. The inserted item is the item itself and not a copy. The return value is the item inserted into the list.</p> <p><strong>Exceptions:</strong></p> <ul> <li>a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DOMException\">DOMException</a></code>\n with code <code>NO_MODIFICATION_ALLOWED_ERR</code> is raised when the list corresponds to a read only attribute or when the object itself is read only.</li> </ul>","obsolete":false},{"name":"getItem","help":"<p>Returns the specified item from the list. The returned item is the item itself and not a copy. Any changes made to the item are immediately reflected in the list. The first item is number&nbsp;0.</p> <p><strong>Exceptions:</strong></p> <ul> <li>a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DOMException\">DOMException</a></code>\n with code <code>NO_MODIFICATION_ALLOWED_ERR</code> is raised when the list corresponds to a read only attribute or when the object itself is read only.</li> </ul>","obsolete":false},{"name":"insertItemBefore","help":"<p>Inserts a new item into the list at the specified position. The first item is number 0. If <code>newItem</code> is already in a list, it is removed from its previous list before it is inserted into this list. The inserted item is the item itself and not a copy. If the item is already in this list, note that the index of the item to insert before is before the removal of the item. If the <code>index</code> is equal to 0, then the new item is inserted at the front of the list. If the index is greater than or equal to <code>numberOfItems</code>, then the new item is appended to the end of the list.</p> <p><strong>Exceptions:</strong></p> <ul> <li>a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DOMException\">DOMException</a></code>\n with code <code>NO_MODIFICATION_ALLOWED_ERR</code> is raised when the list corresponds to a read only attribute or when the object itself is read only.</li> </ul>","obsolete":false},{"name":"replaceItem","help":"<p>Replaces an existing item in the list with a new item. If <code>newItem</code> is already in a list, it is removed from its previous list before it is inserted into this list. The inserted item is the item itself and not a copy. If the item is already in this list, note that the index of the item to replace is before the removal of the item.</p> <p><strong>Exceptions:</strong></p> <ul> <li>a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DOMException\">DOMException</a></code>\n with code <code>NO_MODIFICATION_ALLOWED_ERR</code> is raised when the list corresponds to a read only attribute or when the object itself is read only.</li> <li>a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DOMException\">DOMException</a></code>\n with code <code>INDEX_SIZE_ERR</code> is raised if the index number is greater than or equal to <code>numberOfItems</code>.</li> </ul>","obsolete":false},{"name":"removeItem","help":"<p>Removes an existing item from the list.</p> <p><strong>Exceptions:</strong></p> <ul> <li>a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DOMException\">DOMException</a></code>\n with code <code>NO_MODIFICATION_ALLOWED_ERR</code> is raised when the list corresponds to a read only attribute or when the object itself is read only.</li> <li>a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DOMException\">DOMException</a></code>\n with code <code>INDEX_SIZE_ERR</code> is raised if the index number is greater than or equal to <code>numberOfItems</code>.</li> </ul>","obsolete":false},{"name":"appendItem","help":"<p>Inserts a new item at the end of the list. If <code>newItem</code> is already in a list, it is removed from its previous list before it is inserted into this list. The inserted item is the item itself and not a copy.</p> <p><strong>Exceptions:</strong></p> <ul> <li>a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DOMException\">DOMException</a></code>\n with code <code>NO_MODIFICATION_ALLOWED_ERR</code> is raised when the list corresponds to a read only attribute or when the object itself is read only.</li> </ul>","obsolete":false},{"name":"numberOfItem","help":"The number of items in the list.","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/DOM/SVGStringList"},"HTMLDivElement":{"title":"HTMLDivElement","seeAlso":"<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/div\">&lt;div&gt;</a></code>\n HTML&nbsp;element","summary":"DOM&nbsp;div (document division) objects expose the <a title=\"http://www.w3.org/TR/html5/grouping-content.html#htmldivelement\" class=\" external\" rel=\"external nofollow\" href=\"http://www.w3.org/TR/html5/grouping-content.html#htmldivelement\" target=\"_blank\">HTMLDivElement</a> (or \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML\">HTML 4</a></span> <a class=\" external\" rel=\"external nofollow\" href=\"http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-22445964\" title=\"http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-22445964\" target=\"_blank\"><code>HTMLDivElement</code></a>) interface, which provides special properties (beyond the regular <a rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/element\">element</a> object interface they also have available to them by inheritance) for manipulating div elements. In \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span>, this interface inherits from HTMLElement, but defines no additional members.","members":[{"name":"align","help":"Enumerated attribute indicating alignment of the element's contents with respect to the surrounding context.","obsolete":true}],"srcUrl":"https://developer.mozilla.org/en/DOM/HTMLDivElement"},"SVGAltGlyphItemElement":{"title":"altGlyphItem","seeAlso":"<li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/glyph\">&lt;glyph&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/glyphRef\">&lt;glyphRef&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/altGlyphDef\">&lt;altGlyphDef&gt;</a></code>\n</li>","summary":"The <code>altGlyphItem</code> element provides a set of candidates for glyph substitution by the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/altGlyph\">&lt;altGlyph&gt;</a></code>\n element.","members":[],"srcUrl":"https://developer.mozilla.org/en/SVG/Element/altGlyphItem"},"TimeRanges":{"title":"TimeRanges","summary":"<p>The <code>TimeRanges</code> interface is used to represent a set of time ranges, primarily for the purpose of tracking which portions of media have been buffered when loading it for use by the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/audio\">&lt;audio&gt;</a></code>\n and <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/video\">&lt;video&gt;</a></code>\n&nbsp;elements.</p>\n<p>A <code>TimeRanges</code> object includes one or more ranges of time, each specified by a starting and ending time offset. You reference each time range by using the <code>start()</code> and <code>end()</code> methods, passing the index number of the time range you want to retrieve.</p>","members":[{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/TimeRanges.start","name":"start","help":"Returns the time for the start of the range with the specified index."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/TimeRanges.end","name":"end","help":"Returns the time for the end of the specified range."},{"url":"https://developer.mozilla.org/en/DOM/TimeRanges.length","name":"length","help":"The number of time ranges represented by the time range object. <strong>Read only.</strong>","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/DOM/TimeRanges","specification":"WHATWG Working Draft"},"ArrayBuffer":{"title":"ArrayBuffer","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari</th> </tr> <tr> <td>Basic support</td> <td>7</td> <td>4.0 (2)\n</td> <td>10</td> <td>11.6</td> <td>5.1</td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td>4.0</td> <td>4.0 (2)\n</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td>4.2</td> </tr> </tbody> </table>\n</div>","examples":["<p>In this example, we create a 32-byte buffer:</p>\n\n          <pre name=\"code\" class=\"js\">var buf = new ArrayBuffer(32);</pre>"],"srcUrl":"https://developer.mozilla.org/en/JavaScript_typed_arrays/ArrayBuffer","seeAlso":"<li><a class=\"link-https\" title=\"https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/doc/spec/TypedArray-spec.html\" rel=\"external\" href=\"https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/doc/spec/TypedArray-spec.html\" target=\"_blank\">Typed Array Specification</a></li> <li><a title=\"en/JavaScript typed arrays\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays\">JavaScript typed arrays</a></li>","summary":"The <code>ArrayBuffer</code> is a data type that is used to represent a generic, fixed-length binary data buffer. You can't directly manipulate the contents of an <code>ArrayBuffer</code>; instead, you create an <a title=\"en/JavaScript typed arrays/ArrayBufferView\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/ArrayBufferView\"><code>ArrayBufferView</code></a> object which represents the buffer in a specific format, and use that to read and write the contents of the buffer.","members":[{"name":"byteLength","help":"The size, in bytes, of the array. This is established when the array is constructed and cannot be changed. <strong>Read only.</strong>","obsolete":false}]},"SVGElementInstance":{"title":"SVGUseElement","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/SVGUseElement","skipped":true,"cause":"Suspect title"},"SVGFEMergeNodeElement":{"title":"feMergeNode","seeAlso":"<li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/filter\">&lt;filter&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/animate\">&lt;animate&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/set\">&lt;set&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feMerge\">&lt;feMerge&gt;</a></code>\n</li> <li><a title=\"en/SVG/Tutorial/Filter_effects\" rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Tutorial/Filter_effects\">SVG tutorial: Filter effects</a></li>","summary":"The feMergeNode takes the result of another filter to be processed by its parent <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feMerge\">&lt;feMerge&gt;</a></code>\n.","members":[],"srcUrl":"https://developer.mozilla.org/en/SVG/Element/feMergeNode"},"HTMLOutputElement":{"title":"HTMLOutputElement","members":[{"name":"checkValidity","help":"<p>      in Gecko 2.0. Returns false if the element is a candidate for constraint validation, and it does not satisfy its constraints. In this case, it also fires an <code>invalid</code> event at the element. It returns true if the element is not a candidate for constraint validation, or if it satisfies its constraints.</p> <p>The standard behavior is to always return true because <code>output</code> objects are never candidates for constraint validation.</p>","obsolete":false},{"name":"setCustomValidity","help":"Sets a custom validity message for the element. If this message is not the empty string, then the element is suffering from a custom validity error, and does not validate.","obsolete":false},{"name":"defaultValue","help":"The default value of the element, initially the empty string.","obsolete":false},{"name":"form","help":"Indicates the control's form owner, reflecting the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/output#attr-form\">form</a></code>\n&nbsp;HTML&nbsp;attribute if it is defined.","obsolete":false},{"name":"htmlFor","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/output#attr-for\">for</a></code>\n HTML attribute, containing a list of IDs of other elements in the same document that contribute to (or otherwise affect) the calculated <strong>value</strong>.","obsolete":false},{"name":"labels","help":"A list of label elements associated with this output element.","obsolete":false},{"name":"name","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/output#attr-name\">name</a></code>\n HTML attribute, containing the name for the control that is submitted with form data.","obsolete":false},{"name":"type","help":"Must be the string <code>output</code>.","obsolete":false},{"name":"validationMessage","help":"A localized message that describes the validation constraints that the control does not satisfy (if any). This is the empty string if the control is not a candidate for constraint validation (<strong>willValidate</strong> is false), or it satisfies its constraints.","obsolete":false},{"name":"validity","help":"The validity states that this element is in.","obsolete":false},{"name":"value","help":"The value of the contents of the elements. Behaves like the <strong><a title=\"En/DOM/Node.textContent\" rel=\"internal\" href=\"https://developer.mozilla.org/En/DOM/Node.textContent\">textContent</a></strong> property.","obsolete":false},{"name":"willValidate","help":"<p>      in Gecko 2.0. Indicates whether the element is a candidate for constraint validation. It is false if any conditions bar it from constraint validation. (See <a rel=\"external\" href=\"https://bugzilla.mozilla.org/show_bug.cgi?id=604673\" class=\"external\" title=\"\">\nbug 604673</a>\n.)</p> <p>The standard behavior is to always return false because <code>output</code> objects are never candidates for constraint validation.</p>","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/DOM/HTMLOutputElement"},"Comment":{"title":"Comment","summary":"<p>A comment is used to add notations within markup; although it is generally not displayed, it is still available to be read in the source view (in Firefox:&nbsp;View -&gt; Page Source).&nbsp; These are represented in HTML and XML as content between <code>&lt;!--</code> and&nbsp; <code>--&gt; . </code>In XML, the character sequence \"--\" cannot be used within a comment.</p>\n<p>A comment has no special properties or methods of its own, but inherits those of <a title=\"En/DOM/CharacterData\" rel=\"internal\" href=\"https://developer.mozilla.org/En/DOM/CharacterData\">CharacterData</a> (which inherits from <a title=\"en/DOM/Node\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/Node\">Node</a>).</p>","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/Comment","specification":"http://www.w3.org/TR/DOM-Level-3-Cor...#ID-1728279322"},"HashChangeEvent":{"title":"window.onhashchange","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/window.onhashchange","skipped":true,"cause":"Suspect title"},"HTMLLabelElement":{"title":"HTMLLabelElement","summary":"DOM Label objects inherit all of the properties and methods of DOM <a title=\"en/DOM/element\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/element\">element</a>, and also expose the <a title=\"http://dev.w3.org/html5/spec/forms.html#htmllabelelement\" class=\" external\" rel=\"external\" href=\"http://dev.w3.org/html5/spec/forms.html#htmllabelelement\" target=\"_blank\">HTMLLabelElement</a>(or \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML\">HTML 4</a></span> <a class=\" external\" title=\"http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-13691394\" rel=\"external\" href=\"http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-13691394\" target=\"_blank\">HTMLLabelElement</a>) interface.","members":[{"name":"accessKey","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/label#attr-accesskey\">accesskey</a></code>\n&nbsp;HTML&nbsp;attribute. In \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span> this attribute is inherited from <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/HTMLElement\">HTMLElement</a></code>","obsolete":false},{"name":"control","help":"The labeled control.","obsolete":false},{"name":"form","help":"The form owner of this label.","obsolete":false},{"name":"htmlFor","help":"The ID of the labeled control. Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/label#attr-for\">for</a></code>\n attribute.","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/DOM/HTMLLabelElement"},"CSSPageRule":{"title":"cssRule","members":[],"srcUrl":"https://developer.mozilla.org/pl/DOM/cssRule","skipped":true,"cause":"Suspect title"},"HTMLLegendElement":{"title":"HTMLLegendElement","summary":"DOM&nbsp;Legend objects inherit all of the properties and methods of DOM <a href=\"https://developer.mozilla.org/en/DOM/HTMLElement\" title=\"en/DOM/HTMLElement\" rel=\"internal\">HTMLElement</a>, and also expose the <a title=\"http://www.w3.org/TR/html5/forms.html#htmllegendelement\" class=\" external\" rel=\"external nofollow\" href=\"http://www.w3.org/TR/html5/forms.html#htmllegendelement\" target=\"_blank\">HTMLLegendElement</a> \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span> (or <a class=\" external\" title=\"http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-21482039\" rel=\"external\" href=\"http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-21482039\" target=\"_blank\">HTMLLegendElement</a> \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML\">HTML 4</a></span>) interface.","members":[{"name":"form","help":"The form that this legend belongs to. If the legend has a fieldset element as its parent, then this attribute returns the same value as the <strong>form</strong> attribute on the parent fieldset element. Otherwise, it returns null.","obsolete":false},{"name":"accessKey","help":"A single-character access key to give access to the element. \n\n<span title=\"\">Obsolete</span> in \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span>","obsolete":true},{"name":"align","help":"Alignment relative to the form set. \n\n<span title=\"\">Obsolete</span> in \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span>, \n\n<span class=\"deprecatedInlineTemplate\" title=\"\">Deprecated</span>\n\n in \n<span>HTML 4.01</span>","obsolete":true}],"srcUrl":"https://developer.mozilla.org/en/DOM/HTMLLegendElement"},"SVGElement":{"title":"SVGElement","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td>9.0</td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> </tbody>\n</table>\n</div>\n<div id=\"compat-mobile\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> </tbody>\n</table>\n</div>","srcUrl":"https://developer.mozilla.org/en/DOM/SVGElement","seeAlso":"DOM <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/SVG/Element/element\" class=\"new\">&lt;element&gt;</a></code>\n reference","summary":"All of the SVG DOM interfaces that correspond directly to elements in the SVG language derive from the <code>SVGElement</code> interface.","members":[{"name":"id","help":"The value of the \n<code><a rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Attribute/id\" class=\"new\">id</a></code> attribute on the given element, or the empty string if <code>id</code> is not present. ","obsolete":false},{"name":"xmlbase","help":"Corresponds to attribute \n<code><a rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Attribute/xml%3Abase\" class=\"new\">xml:base</a></code> on the given element.","obsolete":false},{"name":"ownerSVGElement","help":"The nearest ancestor <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/svg\">&lt;svg&gt;</a></code>\n element. <code>Null</code> if the given element is the outermost svg element.","obsolete":false},{"name":"viewportElement","help":"The element which established the current viewport. Often, the nearest ancestor <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/svg\">&lt;svg&gt;</a></code>\n element. <code>Null</code> if the given element is the outermost svg element.","obsolete":false}]},"SVGAnimatedRect":{"title":"SVGAnimatedRect","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody>\n</table>\n</div>\n<div id=\"compat-mobile\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody>\n</table>\n</div>","summary":"The <code>SVGAnimatedRect</code> interface is used for attributes of basic <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/SVGRect\">SVGRect</a></code>\n which can be animated.","members":[{"name":"baseVal","help":"The base value of the given attribute before applying any animations.","obsolete":false},{"name":"animVal","help":"A read only <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/SVGRect\">SVGRect</a></code>\n representing the current animated value of the given attribute. If the given attribute is not currently being animated, then the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/SVGRect\">SVGRect</a></code>\n will have the same contents as <code>baseVal</code>. The object referenced by <code>animVal</code> will always be distinct from the one referenced by <code>baseVal</code>, even when the attribute is not animated.","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/Document_Object_Model_(DOM)/SVGAnimatedRect"},"HTMLKeygenElement":{"title":"HTMLKeygenElement","summary":"<strong>Note:</strong>&nbsp;This page describes the Keygen Element interface as specified, not as currently implemented by Gecko. See <a rel=\"external\" href=\"https://bugzilla.mozilla.org/show_bug.cgi?id=101019\" class=\"external\" title=\"\">\nbug 101019</a>\n for details and status.","members":[{"name":"checkValidity","help":"Always returns true because <code>keygen</code> objects are never candidates for constraint validation.","obsolete":false},{"name":"setCustomValidity","help":"Sets a custom validity message for the element. If this message is not the empty string, then the element is suffering from a custom validity error, and does not validate.","obsolete":false},{"name":"autofocus","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/keygen#attr-autofocus\">autofocus</a></code>\n&nbsp;HTML attribute, indicating that the form control should have input focus when the page loads.","obsolete":false},{"name":"challenge","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/keygen#attr-challenge\">challenge</a></code>\n HTML&nbsp;attribute, containing a challenge string that is packaged with the submitted key.","obsolete":false},{"name":"disabled","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/keygen#attr-disabled\">disabled</a></code>\n&nbsp;HTML attribute, indicating that the control is not available for interaction.","obsolete":false},{"name":"form","help":"Indicates the control's form owner, reflecting the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/keygen#attr-form\">form</a></code>\n&nbsp;HTML&nbsp;attribute if it is defined.","obsolete":false},{"name":"keytype","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/keygen#attr-keytype\">keytype</a></code>\n HTML&nbsp;attribute, containing the type of key used.","obsolete":false},{"name":"labels","help":"A list of label elements associated with this keygen element.","obsolete":false},{"name":"name","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/keygen#attr-name\">name</a></code>\n HTML attribute, containing the name for the control that is submitted with form data.","obsolete":false},{"name":"type","help":"Must be the value <code>keygen</code>.","obsolete":false},{"name":"validationMessage","help":"A localized message that describes the validation constraints that the control does not satisfy (if any). This is the empty string if the control is not a candidate for constraint validation (<strong>willValidate</strong> is false), or it satisfies its constraints.","obsolete":false},{"name":"validity","help":"The validity states that this element is in.","obsolete":false},{"name":"willValidate","help":"Always false because <code>keygen</code> objects are never candidates for constraint validation.","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/DOM/HTMLKeygenElement"},"SVGFontElement":{"title":"SVGFontElement","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>","srcUrl":"https://developer.mozilla.org/en/DOM/SVGFontElement","seeAlso":"<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/font\">&lt;font&gt;</a></code>\n SVG Element","summary":"<p>The <code>SVGHFontElement</code> interface corresponds to the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/font\">&lt;font&gt;</a></code>\n elements.</p>\n<p>Object-oriented access to the attributes of the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/font\">&lt;font&gt;</a></code>\n element via the SVG DOM is not possible.</p>","members":[]},"HTMLUListElement":{"title":"ul","seeAlso":"<li>Other list-related HTML&nbsp;Elements: <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/ol\">&lt;ol&gt;</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/li\">&lt;li&gt;</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/menu\">&lt;menu&gt;</a></code>\n and the obsolete <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/dir\">&lt;dir&gt;</a></code>\n;</li> <li>CSS properties that may be specially useful to style the <span>&lt;ul&gt;</span> element:&nbsp; <ul> <li>the <a title=\"en/CSS/list-style\" rel=\"internal\" href=\"https://developer.mozilla.org/en/CSS/list-style\">list-style</a> property, useful to choose the way the ordinal is displayed,</li> <li><a title=\"en/CSS_Counters\" rel=\"internal\" href=\"https://developer.mozilla.org/en/CSS_Counters\">CSS counters</a>, useful to handle complex nested lists,</li> <li>the <a title=\"en/CSS/line-height\" rel=\"internal\" href=\"https://developer.mozilla.org/en/CSS/line-height\">line-height</a> property, useful to simulate the deprecated \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/ul#attr-compact\">compact</a></code>\n attribute,</li> <li>the <a title=\"en/CSS/margin\" rel=\"internal\" href=\"https://developer.mozilla.org/en/CSS/margin\">margin</a> property, useful to control the indent of the list.</li> </ul> </li>","summary":"<p>The HTML <em>unordered list</em> element (<code>&lt;ul&gt;</code>) represents an unordered list of items, namely a collection of items that do not have a numerical ordering, and their order in the list is meaningless. Typically, unordered-list items are displayed with a bullet, which can be of several forms, like a dot, a circle or a squared. The bullet style is not defined in the HTML description of the page, but in its associated CSS, using the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/CSS/list-style-type\">list-style-type</a></code>\n property.</p>\n<p>There is no limitation to the depth and imbrication of lists defined with the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/ol\">&lt;ol&gt;</a></code>\n and <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/ul\">&lt;ul&gt;</a></code>\n elements.</p>\n<div class=\"note\"><strong>Usage note: </strong> The <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/ol\">&lt;ol&gt;</a></code>\n and <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/ul\">&lt;ul&gt;</a></code>\n both represent a list of items. They differ in the way that, with the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/ol\">&lt;ol&gt;</a></code>\n element, the order is meaningful. As a rule of thumb to determine which one to use, try changing the order of the list items; if the meaning is changed, the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/ol\">&lt;ol&gt;</a></code>\n element should be used, else the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/ul\">&lt;ul&gt;</a></code>\n is adequate.</div>","members":[{"obsolete":false,"url":"","name":"compact","help":"This Boolean attribute hints that the list should be rendered in a compact style. The interpretation of this attribute depends on the user agent and it doesn't work in all browsers. <div class=\"note\"><strong>Usage note:&nbsp;</strong>Do not use this attribute, as it has been deprecated: the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/ol\">&lt;ol&gt;</a></code>\n element should be styled using <a title=\"en/CSS\" rel=\"internal\" href=\"https://developer.mozilla.org/en/CSS\">CSS</a>. To give a similar effect than the <span>compact</span> attribute, the <a title=\"en/CSS\" rel=\"internal\" href=\"https://developer.mozilla.org/en/CSS\">CSS</a> property <a title=\"en/CSS/line-height\" rel=\"internal\" href=\"https://developer.mozilla.org/en/CSS/line-height\">line-height</a> can be used with a value of <span>80%</span>.</div>"},{"obsolete":false,"url":"","name":"type","help":"Used to set the bullet style for the list. The values defined under <a title=\"en/HTML3.2\" rel=\"internal\" href=\"https://developer.mozilla.org/en/HTML3.2\" class=\"new \">HTML3.2</a> and the transitional version of <a title=\"en/HTML4.01\" rel=\"internal\" href=\"https://developer.mozilla.org/en/HTML4.01\" class=\"new \">HTML 4.0/4.01</a> are<span>:</span> <ul> <li><code>circle</code>,</li> <li><code>disc</code>,</li> <li>and <code>square</code>.</li> </ul> <p>A fourth bullet type has been defined in the WebTV interface, but not all browsers support it: <code>triangle.</code></p> <p>If not present and if no <a title=\"en/CSS\" rel=\"internal\" href=\"https://developer.mozilla.org/en/CSS\">CSS</a> <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/CSS/list-style-type\">list-style-type</a></code>\n property does apply to the element, the user agent decide to use a kind of bullets depending on the nesting level of the list.</p> <div class=\"note\"><strong>Usage note:</strong> Do not use this attribute, as it has been deprecated: use the <a title=\"en/CSS\" rel=\"internal\" href=\"https://developer.mozilla.org/en/CSS\">CSS</a> <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/CSS/list-style-type\">list-style-type</a></code>\n property instead.</div>"}],"srcUrl":"https://developer.mozilla.org/en/HTML/Element/ul"},"SVGMarkerElement":{"title":"marker","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\">\n<table class=\"compat-table\"> <tbody> \n<tr><th scope=\"col\">Feature</th><th scope=\"col\">Chrome</th><th scope=\"col\">Firefox (Gecko)</th><th scope=\"col\">Internet Explorer</th><th scope=\"col\">Opera</th><th scope=\"col\">Safari</th></tr> <tr> <td>Basic support</td> <td>1.0</td> <td>1.5 (1.8)\n</td> <td>\n9.0</td> <td>\n9.0</td> <td>\n3.0.4</td> </tr> </tbody>\n</table>\n</div>\n<div id=\"compat-mobile\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE&nbsp;Phone</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td>\n3.0</td> <td>1.0 (1.8)\n</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td>\n3.0.4</td> </tr> </tbody>\n</table>\n</div>\n<p>The chart is based on <a title=\"en/SVG/Compatibility sources\" rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Compatibility_sources\">these sources</a>.</p>","examples":["<tr> <th scope=\"col\">Source code</th> <th scope=\"col\">Output result</th> </tr> <tr> <td>\n          <pre name=\"code\" class=\"xml\">&lt;?xml version=\"1.0\"?&gt;\n&lt;svg width=\"120\" height=\"120\" viewBox=\"0 0 120 120\"\n     xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\"\n     xmlns:xlink=\"http://www.w3.org/1999/xlink\"&gt;\n\n    &lt;defs&gt;\n        &lt;marker id=\"Triangle\"\n                viewBox=\"0 0 10 10\" \n                refX=\"1\" refY=\"5\"\n                markerWidth=\"6\" \n                markerHeight=\"6\"\n                orient=\"auto\"&gt;\n            &lt;path d=\"M 0 0 L 10 5 L 0 10 z\" /&gt;\n\t    &lt;/marker&gt;\n    &lt;/defs&gt;\n\n    &lt;polyline points=\"10,90 50,80 90,20\"\n              fill=\"none\" stroke=\"black\" \n              stroke-width=\"2\"\n              marker-end=\"url(#Triangle)\" /&gt;\n&lt;/svg&gt;</pre>\n        </td> <td>\n<iframe src=\"https://developer.mozilla.org/@api/deki/services/developer.mozilla.org/39/images/f3ac8fb0-712a-178f-f696-81bc9eecbd0f.svg\" width=\"120px\" height=\"120px\" marginwidth=\"0\" marginheight=\"0\" hspace=\"0\" vspace=\"0\" frameborder=\"0\" scrolling=\"no\"></iframe>\n</td> </tr>"],"srcUrl":"https://developer.mozilla.org/en/SVG/Element/marker","summary":"The <code>marker</code> element defines the graphics that is to be used for drawing arrowheads or polymarkers on a given <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/path\">&lt;path&gt;</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/line\">&lt;line&gt;</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/polyline\">&lt;polyline&gt;</a></code>\n or <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/polygon\">&lt;polygon&gt;</a></code>\n element.","members":[{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/class","name":"class","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/transform","name":"transform","help":"Specific attributes"},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/markerHeight","name":"markerHeight","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/externalResourcesRequired","name":"externalResourcesRequired","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/viewBox","name":"viewBox","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/preserveAspectRatio","name":"preserveAspectRatio","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/refY","name":"refY","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/refX","name":"refX","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/markerWidth","name":"markerWidth","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/markerUnits","name":"markerUnits","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/orient","name":"orient","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/style","name":"style","help":""}]},"KeyboardEvent":{"title":"KeyboardEvent","examples":["&lt;!DOCTYPE html&gt;\n&lt;html&gt;\n&lt;head&gt;\n&lt;script&gt;\n  var metaChar = false;\n  var exampleKey = 16;\n  function keyEvent(event) {\n    var key = event.keyCode || event.which;\n    var keychar = String.fromCharCode(key);\n    if (key == exampleKey) {\n      metaChar = true;\n    }\n    if (key != exampleKey) {\n      if (metaChar) {\n        alert(\"Combination of metaKey + \" + keychar);\n        metaChar = false;\n      } else {\n        alert(\"Key pressed \" + key);\n      }\n    }\n  }\n\n  function metaKeyUp (event) {\n    var key = event.keyCode || event.which;\n    if (key==exampleKey) {\n      metaChar = false;\n    }\n  }\n&lt;/script&gt;\n&lt;/head&gt;\n\n&lt;body onkeydown=\"keyEvent(event)\" onkeyup=\"metaKeyUp(event)\"&gt;\n&lt;/body&gt;\n&lt;/html&gt;"],"srcUrl":"https://developer.mozilla.org/en/DOM/KeyboardEvent","specification":"DOM&nbsp;3 Events:&nbsp;KeyboardEvent","summary":"<div class=\"deprecatedHeaderTemplate\"><p>Deprecated</p></div>\n<p></p>\n<p><code>KeyboardEvent</code> objects describe a user interaction with the keyboard. Each event describes a key; the event type (<code>keydown</code>, <code>keypress</code>, or <code>keyup</code>) identifies what kind of activity was performed.</p>\n<div class=\"note\"><strong>Note:</strong> The <code>KeyboardEvent</code> interface is deprecated in DOM&nbsp;Level 3 in favor of the new <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/TextInput\" class=\"new\">TextInput</a></code>\n interface and the corresponding <code>textinput</code> event, which have improved support for alternate input methods.&nbsp; However, DOM Level 3 <code>textinput</code> events are <a title=\"https://bugzilla.mozilla.org/show_bug.cgi?id=622245\" class=\" link-https\" rel=\"external\" href=\"https://bugzilla.mozilla.org/show_bug.cgi?id=622245\" target=\"_blank\">not yet implemented</a> in Gecko (as of version 6.0), so code written for Gecko browsers should continue to use <code>KeyboardEvent</code> for now.</div>","members":[{"name":"initKeyboardEvent","help":"<p>Initializes the attributes of a keyboard event object.</p>\n\n<div id=\"section_11\"><span id=\"Parameters_2\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>typeArg</code></dt> <dd>The type of keyboard event; this will be one of <code>keydown</code>, <code>keypress</code>, or <code>keyup</code>.</dd> <dt><code>canBubbleArg</code></dt> <dd>Whether or not the event can bubble.</dd> <dt><code>cancelableArg</code></dt> <dd>Whether or not the event can be canceled.</dd> <dt><code>viewArg</code></dt> <dd>?</dd> <dt><code>charArg</code></dt> <dd>The value of the char attribute.</dd> <dt><code>keyArg</code></dt> <dd>The value of the key attribute.</dd> <dt><code>locationArg</code></dt> <dd>The value of the location attribute.</dd> <dt><code>modifiersListArg</code></dt> <dd>A whitespace-delineated list of modifier keys that should be considered to be active on the event's key. For example, specifying \"Control Shift\" indicates that the user was holding down the Control and Shift keys when pressing the key described by the event.</dd> <dt><code>repeatArg</code></dt> <dd>The value of the repeat attribute.</dd> <dt><code>localeArg</code></dt> <dd>The value of the locale attribute.</dd>\n</dl>\n</div>","idl":"<pre>void initKeyboardEvent(\n&nbsp;&nbsp;in DOMString typeArg,\n&nbsp;&nbsp;in boolean canBubbleArg,\n&nbsp;&nbsp;in boolean cancelableArg,\n&nbsp;&nbsp;in views::AbstractView viewArg,\n&nbsp;&nbsp;in DOMString charArg,\n&nbsp;&nbsp;in DOMString keyArg,\n&nbsp;&nbsp;in unsigned long locationArg,\n&nbsp;&nbsp;in DOMString modifiersListArg,\n&nbsp;&nbsp;in boolean repeat,\n&nbsp;&nbsp;in DOMString localeArg\n);\n</pre>","obsolete":false},{"name":"getModifierState","help":"<p>Returns the current state of the specified modifier key.</p>\n\n<div id=\"section_8\"><span id=\"Parameters\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>keyArg</code></dt> <dd>A string identifying the modifier key whose value you wish to determine. This may be an implementation-defined value or one of:&nbsp;\"Alt\", \"AltGraph\", \"CapsLock\", \"Control\", \"Fn\", \"Meta\", \"NumLock\", \"Scroll\", \"Shift\", \"SymbolLock\", or \"Win\".</dd>\n</dl>\n</div><div id=\"section_9\"><span id=\"Return_value\"></span><h6 class=\"editable\">Return value</h6>\n<p><code>true</code> if the specified modifier key is engaged; otherwise <code>false</code>.</p>\n</div>","idl":"<pre>boolean getModifierState(\n&nbsp;&nbsp;in DOMString keyArg\n);\n</pre>","obsolete":false},{"name":"DOM_VK_CANCEL","help":"Cancel key.","obsolete":false},{"name":"DOM_VK_HELP","help":"Help key.","obsolete":false},{"name":"DOM_VK_BACK_SPACE","help":"Backspace key.","obsolete":false},{"name":"DOM_VK_TAB","help":"Tab key.","obsolete":false},{"name":"DOM_VK_CLEAR","help":"Clear key.","obsolete":false},{"name":"DOM_VK_RETURN","help":"Return/enter key on the main keyboard.","obsolete":false},{"name":"DOM_VK_ENTER","help":"Enter key on the numeric keypad.","obsolete":false},{"name":"DOM_VK_SHIFT","help":"Shift key.","obsolete":false},{"name":"DOM_VK_CONTROL","help":"Control key.","obsolete":false},{"name":"DOM_VK_ALT","help":"Alt (Option on Mac)&nbsp;key.","obsolete":false},{"name":"DOM_VK_PAUSE","help":"Pause key.","obsolete":false},{"name":"DOM_VK_CAPS_LOCK","help":"Caps lock.","obsolete":false},{"name":"DOM_VK_ESCAPE","help":"Escape key.","obsolete":false},{"name":"DOM_VK_SPACE","help":"Space bar.","obsolete":false},{"name":"DOM_VK_PAGE_UP","help":"Page Up key.","obsolete":false},{"name":"DOM_VK_PAGE_DOWN","help":"Page Down key.","obsolete":false},{"name":"DOM_VK_END","help":"End key.","obsolete":false},{"name":"DOM_VK_HOME","help":"Home key.","obsolete":false},{"name":"DOM_VK_LEFT","help":"Left arrow.","obsolete":false},{"name":"DOM_VK_UP","help":"Up arrow.","obsolete":false},{"name":"DOM_VK_RIGHT","help":"Right arrow.","obsolete":false},{"name":"DOM_VK_DOWN","help":"Down arrow.","obsolete":false},{"name":"DOM_VK_SELECT","help":"","obsolete":false},{"name":"DOM_VK_PRINT","help":"","obsolete":false},{"name":"DOM_VK_EXECUTE","help":"","obsolete":false},{"name":"DOM_VK_PRINTSCREEN","help":"Print Screen key.","obsolete":false},{"name":"DOM_VK_INSERT","help":"Ins(ert) key.","obsolete":false},{"name":"DOM_VK_DELETE","help":"Del(ete)&nbsp;key.","obsolete":false},{"name":"DOM_VK_SEMICOLON","help":"","obsolete":false},{"name":"DOM_VK_EQUALS","help":"","obsolete":false},{"name":"DOM_VK_A","help":"","obsolete":false},{"name":"DOM_VK_B","help":"","obsolete":false},{"name":"DOM_VK_C","help":"","obsolete":false},{"name":"DOM_VK_D","help":"","obsolete":false},{"name":"DOM_VK_E","help":"","obsolete":false},{"name":"DOM_VK_F","help":"","obsolete":false},{"name":"DOM_VK_G","help":"","obsolete":false},{"name":"DOM_VK_H","help":"","obsolete":false},{"name":"DOM_VK_I","help":"","obsolete":false},{"name":"DOM_VK_J","help":"","obsolete":false},{"name":"DOM_VK_K","help":"","obsolete":false},{"name":"DOM_VK_L","help":"","obsolete":false},{"name":"DOM_VK_M","help":"","obsolete":false},{"name":"DOM_VK_N","help":"","obsolete":false},{"name":"DOM_VK_O","help":"","obsolete":false},{"name":"DOM_VK_P","help":"","obsolete":false},{"name":"DOM_VK_Q","help":"","obsolete":false},{"name":"DOM_VK_R","help":"","obsolete":false},{"name":"DOM_VK_S","help":"","obsolete":false},{"name":"DOM_VK_T","help":"","obsolete":false},{"name":"DOM_VK_U","help":"","obsolete":false},{"name":"DOM_VK_V","help":"","obsolete":false},{"name":"DOM_VK_W","help":"","obsolete":false},{"name":"DOM_VK_X","help":"","obsolete":false},{"name":"DOM_VK_Y","help":"","obsolete":false},{"name":"DOM_VK_Z","help":"","obsolete":false},{"name":"DOM_VK_CONTEXT_MENU","help":"","obsolete":false},{"name":"DOM_VK_MULTIPLY","help":"* on the numeric keypad.","obsolete":false},{"name":"DOM_VK_ADD","help":"+ on the numeric keypad.","obsolete":false},{"name":"DOM_VK_SEPARATOR","help":"","obsolete":false},{"name":"DOM_VK_SUBTRACT","help":"- on the numeric keypad.","obsolete":false},{"name":"DOM_VK_DECIMAL","help":"Decimal point on the numeric keypad.","obsolete":false},{"name":"DOM_VK_DIVIDE","help":"/ on the numeric keypad.","obsolete":false},{"name":"DOM_VK_NUM_LOCK","help":"Num Lock key.","obsolete":false},{"name":"DOM_VK_SCROLL_LOCK","help":"Scroll Lock key.","obsolete":false},{"name":"DOM_VK_COMMA","help":"Comma (\",\") key.","obsolete":false},{"name":"DOM_VK_PERIOD","help":"Period (\".\") key.","obsolete":false},{"name":"DOM_VK_SLASH","help":"Slash (\"/\") key.","obsolete":false},{"name":"DOM_VK_BACK_QUOTE","help":"Back tick (\"`\") key.","obsolete":false},{"name":"DOM_VK_OPEN_BRACKET","help":"Open square bracket (\"[\") key.","obsolete":false},{"name":"DOM_VK_BACK_SLASH","help":"Back slash (\"\\\") key.","obsolete":false},{"name":"DOM_VK_CLOSE_BRACKET","help":"Close square bracket (\"]\") key.","obsolete":false},{"name":"DOM_VK_QUOTE","help":"Quote ('\"') key.","obsolete":false},{"name":"DOM_VK_META","help":"Meta (Command on Mac)&nbsp;key.","obsolete":false},{"name":"DOM_VK_KANA","help":"Linux support for this keycode was added in Gecko 4.0.","obsolete":false},{"name":"DOM_VK_HANGUL","help":"Linux support for this keycode was added in Gecko 4.0.","obsolete":false},{"name":"DOM_VK_JUNJA","help":"Linux support for this keycode was added in Gecko 4.0.","obsolete":false},{"name":"DOM_VK_FINAL","help":"Linux support for this keycode was added in Gecko 4.0.","obsolete":false},{"name":"DOM_VK_HANJA","help":"Linux support for this keycode was added in Gecko 4.0.","obsolete":false},{"name":"DOM_VK_KANJI","help":"Linux support for this keycode was added in Gecko 4.0.","obsolete":false},{"name":"DOM_VK_CONVERT","help":"Linux support for this keycode was added in Gecko 4.0.","obsolete":false},{"name":"DOM_VK_NONCONVERT","help":"Linux support for this keycode was added in Gecko 4.0.","obsolete":false},{"name":"DOM_VK_ACCEPT","help":"Linux support for this keycode was added in Gecko 4.0.","obsolete":false},{"name":"DOM_VK_MODECHANGE","help":"Linux support for this keycode was added in Gecko 4.0.","obsolete":false},{"name":"DOM_VK_SELECT","help":"Linux support for this keycode was added in Gecko 4.0.","obsolete":false},{"name":"DOM_VK_PRINT","help":"Linux support for this keycode was added in Gecko 4.0.","obsolete":false},{"name":"DOM_VK_EXECUTE","help":"Linux support for this keycode was added in Gecko 4.0.","obsolete":false},{"name":"DOM_VK_SLEEP","help":"Linux support for this keycode was added in Gecko 4.0.","obsolete":false},{"name":"DOM_KEY_LOCATION_STANDARD","help":"The key must not be distinguished between the left and right versions of the key, and was not pressed on the numeric keypad or a key that is considered to be part of the keypad.","obsolete":false},{"name":"DOM_KEY_LOCATION_LEFT","help":"The key was the left-hand version of the key; for example, this is the value of the <code>location</code> attribute when the left-hand Control key is pressed on a standard 101 key US&nbsp;keyboard. This value is only used for keys that have more that one possible location on the keyboard.","obsolete":false},{"name":"DOM_KEY_LOCATION_RIGHT","help":"The key was the right-hand version of the key; for example, this is the value of the <code>location</code> attribute when the right-hand Control key is pressed on a standard 101 key US&nbsp;keyboard. This value is only used for keys that have more that one possible location on the keyboard.","obsolete":false},{"name":"DOM_KEY_LOCATION_NUMPAD","help":"The key was on the numeric keypad, or has a virtual key code that corresponds to the numeric keypad.","obsolete":false},{"name":"DOM_KEY_LOCATION_MOBILE","help":"The key was on a mobile device; this can be on either a physical keypad or a virtual keyboard.","obsolete":false},{"name":"DOM_KEY_LOCATION_JOYSTICK","help":"The key was a button on a game controller or a joystick on a mobile device.","obsolete":false},{"name":"altKey","help":"<code>true</code> if the Alt (or Option, on Mac) key was active when the key event was generated. <strong>Read only.</strong>","obsolete":false},{"name":"char","help":"<p>The character value of the key. If the key corresponds to a printable character, this value is a non-empty Unicode string containing that character. If the key doesn't have a printable representation, this is an empty string. <strong>Read only.</strong></p> <div class=\"note\">Not yet implemented in Gecko.</div> <div class=\"note\"><strong>Note:</strong> If the key is used as a macro that inserts multiple characters, this attribute's value is the entire string, not just the first character.</div>","obsolete":false},{"name":"charCode","help":"<p>The Unicode reference number of the key; this attribute is used only by the <code>keypress</code>&nbsp;event. For keys whose <code>char</code> attribute contains multiple characters, this is the Unicode value of the first character in that attribute. <strong>Read only.</strong></p> <div class=\"warning\"><strong>Warning:</strong> This attribute is deprecated; you should use <code>char</code> instead, if available.</div>","obsolete":true},{"name":"ctrlKey","help":"<code>true</code> if the Control key was active when the key event was generated. <strong>Read only.</strong>","obsolete":false},{"name":"key","help":"<p>The key value of the key represented by the event. If the value has a printed representation, this attribute's value is the same as the <code>char</code> attribute. Otherwise, it's one of the key value strings specified in <a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/KeyboardEvent#Key_values\">Key values</a>. If the key can't be identified, this is the string \"Unidentified\". <strong>Read only.</strong></p> <div class=\"note\">Not yet implemented in Gecko.</div>","obsolete":false},{"name":"keyCode","help":"<p>A system and implementation dependent numerical code identifying the unmodified value of the pressed key. This is usually the decimal ASCII (<a rel=\"custom\" href=\"http://tools.ietf.org/html/20\">RFC 20</a>) or Windows 1252 code corresponding to the key; see <a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/KeyboardEvent#Virtual_key_codes\">Virtual key codes</a>&nbsp;for a list of common values. If the key can't be identified, this value is 0. <strong>Read only.</strong></p> <div class=\"warning\"><strong>Warning:</strong> This attribute is deprecated; you should use <code>key</code> instead, if available.</div>","obsolete":true},{"name":"locale","help":"<p>A locale string indicating the locale the keyboard is configured for. This may be the empty string if the browser or device doesn't know the keyboard's locale. <strong>Read only.</strong></p> <div class=\"note\"><strong>Note:</strong> This does not describe the locale of the data being entered. A user may be using one keyboard layout while typing text in a different language.</div>","obsolete":false},{"name":"location","help":"The location of the key on the keyboard or other input device; see <a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/KeyboardEvent#Key_location_constants\">Key location constants</a> below. <strong>Read only.</strong>","obsolete":false},{"name":"metaKey","help":"<code>true</code> if the Meta (or Command, on Mac) key was active when the key event was generated. <strong>Read only.</strong>","obsolete":false},{"name":"repeat","help":"true if the key is being held down such that it is automatically repeating. <strong>Read only.</strong>","obsolete":false},{"name":"shiftKey","help":"<code>true</code> if the Shift key was active when the key event was generated. <strong>Read only.</strong>","obsolete":false},{"name":"which","help":"<p>A system and implementation dependent numeric code identifying the unmodified value of the pressed key; this is usually the same as <code>keyCode</code>. <strong>Read only.</strong></p> <div class=\"warning\"><strong>Warning:</strong> This attribute is deprecated; you should use <code>key</code> instead, if available.</div>","obsolete":true}]},"Location":{"title":"window.location","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE&nbsp;Phone</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>","examples":["<p>Whenever a property of the location object is modified, a document will be loaded using the URL as if <code>window.location.assign()</code> had been called with the modified URL.</p>\n<div id=\"section_8\"><span id=\"Replace_the_current_document_with_the_one_at_the_given_URL:\"></span><h5 class=\"editable\">Replace the current document with the one at the given URL:</h5>\n\n          <pre name=\"code\" class=\"js\">function goMoz() { \n   window.location = \"http://www.mozilla.org\";\n} \n\n// in html: &lt;button onclick=\"goMoz();\"&gt;Mozilla&lt;/button&gt;</pre>\n        \n<div class=\"note\"><strong>Note:</strong> The example above works in situations where <code>window.location.hash</code>&nbsp;does not need to be retained. However, in Gecko-based browsers, setting <code>window.location.pathname</code> in this manner will erase any information in <code>window.location.hash</code>, whereas in WebKit (and possibly other browsers), setting the pathname will not alter the the hash. If you need to change pathname but keep the hash as is, use the <code>replace()</code> method instead, which should work consistently across browsers.</div>\n<p><br> Consider the following example, which will reload the page by using the <code>replace()</code> method to insert the value of <code>window.location.pathname</code> into the hash (similar to Twitter's reload of <a class=\" external\" rel=\"external\" href=\"http://twitter.com/username\" title=\"http://twitter.com/username\" target=\"_blank\">http://twitter.com/username</a> to <a class=\" external\" rel=\"external\" href=\"http://twitter.com/#!/username\" title=\"http://twitter.com/#!/username\" target=\"_blank\">http://twitter.com/#!/username</a>):</p>\n\n          <pre name=\"code\" class=\"js\">function reloadPageWithHash() {\n  var initialPage = window.location.pathname;\n  window.location.replace('http://example.com/#' + initialPage);\n}</pre>\n        \n</div><div id=\"section_9\"><span id=\"Display_the_properties_of_the_current_URL_in_an_alert_dialog:\"></span><h5 class=\"editable\">Display the properties of the current URL in an alert dialog:</h5>\n\n          <pre name=\"code\" class=\"js\">function showLoc() {\n  var oLocation = window.location, aLog = [\"Property (Typeof): Value\", \"window.location (\" + (typeof oLocation) + \"): \" + oLocation ];\n  for (var sProp in oLocation){\n    aLog.push(sProp + \" (\" + (typeof oLocation[sProp]) + \"): \" +  (oLocation[sProp] || \"n/a\"));\n  }\n  alert(aLog.join(\"\\n\"));\n}\n\n// in html: &lt;button onclick=\"showLoc();\"&gt;Show location properties&lt;/button&gt;</pre>\n        \n</div><div id=\"section_10\"><span id=\"Send_a_string_of_data_to_the_server_by_modifying_the_search_property:\"></span><h5 class=\"editable\">Send a string of data to the server by modifying the <code>search</code> property:</h5>\n\n          <pre name=\"code\" class=\"js\">function sendData (sData) {\n  window.location.search = sData;\n}\n\n// in html: &lt;button onclick=\"sendData('Some data');\"&gt;Send data&lt;/button&gt;</pre>\n        \n<p>The current URL with \"?Some%20data\" appended is sent to the server (if no action is taken by the server, the current document is reloaded with the modified search string).</p>\n</div><div id=\"section_11\"><span id=\"Get_the_value_of_a_single_window.location.search_key:\"></span><h5 class=\"editable\">Get the value of a single <code>window.location.search</code> key:</h5>\n\n          <pre name=\"code\" class=\"js\">function loadPageVar (sVar) {\n  return unescape(window.location.search.replace(new RegExp(\"^(?:.*[&amp;\\\\?]\" + escape(sVar).replace(/[\\.\\+\\*]/g, \"\\\\$&amp;\") + \"(?:\\\\=([^&amp;]*))?)?.*$\", \"i\"), \"$1\"));\n}\n\nalert(loadPageVar(\"name\"));</pre>\n        \n</div><div id=\"section_12\"><span id=\"Nestle_the_variables_obtained_through_the_window.location.search_string_in_an_object_named_oGetVars.2C_also_attempting_to_recognize_their_typeof:\"></span><h5 class=\"editable\">Nestle the variables obtained through the <code>window.location.search</code> string in an object named <code>oGetVars</code>, also attempting to recognize their <code><a title=\"en/JavaScript/Reference/Operators/typeof\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript/Reference/Operators/typeof\">typeof</a></code>:</h5>\n\n          <pre name=\"code\" class=\"js\">var oGetVars = {};\n\nfunction buildValue(sValue) {\n  if (/^\\s*$/.test(sValue)) { return null; }\n  if (/^(true|false)$/i.test(sValue)) { return sValue.toLowerCase() === \"true\"; }\n  if (isFinite(sValue)) { return parseFloat(sValue); }\n  if (isFinite(Date.parse(sValue))) { return new Date(sValue); }\n  return sValue;\n}\n\nif (window.location.search.length &gt; 1) {\n  for (var aItKey, nKeyId = 0, aCouples = window.location.search.substr(1).split(\"&amp;\"); nKeyId &lt; aCouples.length; nKeyId++) {\n    aItKey = aCouples[nKeyId].split(\"=\");\n    oGetVars[unescape(aItKey[0])] = aItKey.length &gt; 1 ? buildValue(unescape(aItKey[1])) : null;\n  }\n}\n\n// alert(oGetVars.yourVar);</pre>\n        \n<p>…the same thing obtained by an anonymous constructor – useful for a global variable declaration:</p>\n\n          <pre name=\"code\" class=\"js\">var oGetVars = new (function (sSearch) {\n  var rNull = /^\\s*$/, rBool = /^(true|false)$/i;\n  function buildValue(sValue) {\n    if (rNull.test(sValue)) { return null; }\n    if (rBool.test(sValue)) { return sValue.toLowerCase() === \"true\"; }\n    if (isFinite(sValue)) { return parseFloat(sValue); }\n    if (isFinite(Date.parse(sValue))) { return new Date(sValue); }\n    return sValue;\n  }\n  if (sSearch.length &gt; 1) {\n    for (var aItKey, nKeyId = 0, aCouples = sSearch.substr(1).split(\"&amp;\"); nKeyId &lt; aCouples.length; nKeyId++) {\n      aItKey = aCouples[nKeyId].split(\"=\");\n      this[unescape(aItKey[0])] = aItKey.length &gt; 1 ? buildValue(unescape(aItKey[1])) : null;\n    }\n  }\n})(window.location.search);\n\n// alert(oGetVars.yourVar);</pre>\n        \n</div><div id=\"section_13\"><span id=\"Using_bookmars_without_changing_the_window.location.hash_property:\"></span><h5 class=\"editable\">Using bookmars without changing the <code>window.location.hash</code> property:</h5>\n\n          <pre name=\"code\" class=\"xml\">&lt;!doctype html&gt;\n&lt;html&gt;\n&lt;head&gt;\n&lt;meta content=\"text/html; charset=UTF-8\" http-equiv=\"Content-Type\" /&gt;\n&lt;title&gt;MDN Example&lt;/title&gt;\n&lt;script type=\"text/javascript\"&gt;\nfunction showNode (oNode) {\n  var nLeft = 0, nTop = 0;\n  for (var oItNode = oNode; oItNode; nLeft += oItNode.offsetLeft, nTop += oItNode.offsetTop, oItNode = oItNode.offsetParent);\n  document.documentElement.scrollTop = nTop;\n  document.documentElement.scrollLeft = nLeft;\n}\n\nfunction showBookmark (sBookmark, bUseHash) {\n  if (bUseHash) { window.location.hash = \"#\" + sBookmark; return; }\n  var oBookmark = document.getElementById(sBookmark);\n  if (oBookmark) { showNode(oBookmark); }\n}\n&lt;/script&gt;\n&lt;style type=\"text/css\"&gt;\nspan.intLink {\n  cursor: pointer;\n  color: #0000ff;\n  text-decoration: underline;\n}\n&lt;/style&gt;\n&lt;/head&gt;\n\n&lt;body&gt;\n&lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam ultrices dolor ac dolor imperdiet ullamcorper. Suspendisse quam libero, luctus auctor mollis sed, malesuada condimentum magna. Quisque in ante tellus, in placerat est. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Donec a mi magna, quis mattis dolor. Etiam sit amet ligula quis urna auctor imperdiet nec faucibus ante. Mauris vel consectetur dolor. Nunc eget elit eget velit pulvinar fringilla consectetur aliquam purus. Curabitur convallis, justo posuere porta egestas, velit erat ornare tortor, non viverra justo diam eget arcu. Phasellus adipiscing fermentum nibh ac commodo. Nam turpis nunc, suscipit a hendrerit vitae, volutpat non ipsum.&lt;/p&gt;\n&lt;p&gt;Duis lobortis sapien quis nisl luctus porttitor. In tempor semper libero, eu tincidunt dolor eleifend sit amet. Ut nec velit in dolor tincidunt rhoncus non non diam. Morbi auctor ornare orci, non euismod felis gravida nec. Curabitur elementum nisi a eros rutrum nec blandit diam placerat. Aenean tincidunt risus ut nisi consectetur cursus. Ut vitae quam elit. Donec dignissim est in quam tempor consequat. Aliquam aliquam diam non felis convallis suscipit. Nulla facilisi. Donec lacus risus, dignissim et fringilla et, egestas vel eros. Duis malesuada accumsan dui, at fringilla mauris bibendum quis. Cras adipiscing ultricies fermentum. Praesent bibendum condimentum feugiat.&lt;/p&gt;\n&lt;p id=\"myBookmark1\"&gt;[&amp;nbsp;&lt;span class=\"intLink\" onclick=\"showBookmark('myBookmark2');\"&gt;Go to bookmark #2&lt;/span&gt;&amp;nbsp;]&lt;/p&gt;\n&lt;p&gt;Vivamus blandit massa ut metus mattis in fringilla lectus imperdiet. Proin ac ante a felis ornare vehicula. Fusce pellentesque lacus vitae eros convallis ut mollis magna pellentesque. Pellentesque placerat enim at lacus ultricies vitae facilisis nisi fringilla. In tincidunt tincidunt tincidunt. Nulla vitae tempor nisl. Etiam congue, elit vitae egestas mollis, ipsum nisi malesuada turpis, a volutpat arcu arcu id risus.&lt;/p&gt;\n&lt;p&gt;Nam faucibus, ligula eu fringilla pulvinar, lectus tellus iaculis nunc, vitae scelerisque metus leo non metus. Proin mattis lobortis lobortis. Quisque accumsan faucibus erat, vel varius tortor ultricies ac. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nec libero nunc. Nullam tortor nunc, elementum a consectetur et, ultrices eu orci. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque a nisl eu sem vehicula egestas.&lt;/p&gt;\n&lt;p&gt;Aenean viverra varius mauris, sed elementum lacus interdum non. Phasellus sit amet lectus vitae eros egestas pellentesque fermentum eget magna. Quisque mauris nisl, gravida vitae placerat et, condimentum id metus. Nulla eu est dictum dolor pulvinar volutpat. Pellentesque vitae sollicitudin nunc. Donec neque magna, lobortis id egestas nec, sodales quis lectus. Fusce cursus sollicitudin porta. Suspendisse ut tortor in mauris tincidunt rhoncus. Maecenas tincidunt fermentum facilisis. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.&lt;/p&gt;\n&lt;p&gt;Suspendisse turpis nisl, consectetur in lacinia ut, ornare vel mi. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin non lectus eu turpis vulputate cursus. Mauris interdum tincidunt erat id pharetra. Nullam in libero elit, sed consequat lectus. Morbi odio nisi, porta vitae molestie ut, gravida ut nunc. Ut non est dui, id ullamcorper orci. Praesent vel elementum felis. Maecenas ornare, dui quis auctor hendrerit, turpis sem ullamcorper odio, in auctor magna metus quis leo. Morbi at odio ante.&lt;/p&gt;\n&lt;p&gt;Curabitur est ipsum, porta ac viverra faucibus, eleifend sed eros. In sit amet vehicula tortor. Vestibulum viverra pellentesque erat a elementum. Integer commodo ultricies lorem, eget tincidunt risus viverra et. In enim turpis, porttitor ac ornare et, suscipit sit amet nisl. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Pellentesque vel ultrices nibh. Sed commodo aliquam aliquam. Nulla euismod, odio ut eleifend mollis, nisi dui gravida nibh, vitae laoreet turpis purus id ipsum. Donec convallis, velit non scelerisque bibendum, diam nulla auctor nunc, vel dictum risus ipsum sit amet est. Praesent ut nibh sit amet nibh congue pulvinar. Suspendisse dictum porttitor tempor.&lt;/p&gt;\n&lt;p&gt;Vestibulum dignissim erat vitae lectus auctor ac bibendum eros semper. Integer aliquet, leo non ornare faucibus, risus arcu tristique dolor, a aliquet massa mauris quis arcu. In porttitor, lectus ac semper egestas, ligula magna laoreet libero, eu commodo mauris odio id ante. In hac habitasse platea dictumst. In pretium erat diam, nec consequat eros. Praesent augue mi, consequat sed porttitor at, volutpat vitae eros. Sed pretium pharetra dapibus. Donec auctor interdum erat, lacinia molestie nibh commodo ut. Maecenas vestibulum vulputate felis, ut ullamcorper arcu faucibus in. Curabitur id arcu est. In semper mollis lorem at pellentesque. Sed lectus nisl, vestibulum id scelerisque eu, feugiat et tortor. Pellentesque porttitor facilisis ultricies.&lt;/p&gt;\n&lt;p id=\"myBookmark2\"&gt;[&amp;nbsp;&lt;span class=\"intLink\" onclick=\"showBookmark('myBookmark1');\"&gt;Go to bookmark #1&lt;/span&gt; | &lt;span class=\"intLink\" onclick=\"showBookmark('myBookmark1', true);\"&gt;Go to bookmark #1 using location.hash&lt;/span&gt; | &lt;span class=\"intLink\" onclick=\"showBookmark('myBookmark3');\"&gt;Go to bookmark #3&lt;/span&gt;&amp;nbsp;]&lt;/p&gt;\n&lt;p&gt;Phasellus tempus fringilla nunc, eget sagittis orci molestie vel. Nulla sollicitudin diam non quam iaculis ac porta justo venenatis. Quisque tellus urna, molestie vitae egestas sit amet, suscipit sed sem. Quisque nec lorem eu velit faucibus tristique ut ut dolor. Cras eu tortor ut libero placerat venenatis ut ut massa. Sed quis libero augue, et consequat libero. Morbi rutrum augue sed turpis elementum sed luctus nisl molestie. Aenean vitae purus risus, a semper nisl. Pellentesque malesuada, est id sagittis consequat, libero mauris tincidunt tellus, eu sagittis arcu purus rutrum eros. Quisque eget eleifend mi. Duis pharetra mi ac eros mattis lacinia rutrum ipsum varius.&lt;/p&gt;\n&lt;p&gt;Fusce cursus pulvinar aliquam. Duis justo enim, ornare vitae elementum sed, porta a quam. Aliquam eu enim eu libero mollis tempus. Morbi ornare aliquam posuere. Proin faucibus luctus libero, sed ultrices lorem sagittis et. Vestibulum malesuada, ante nec molestie vehicula, quam diam mollis ipsum, rhoncus posuere mauris lectus in eros. Nullam feugiat ultrices augue, ac sodales sem mollis in.&lt;/p&gt;\n&lt;p id=\"myBookmark3\"&gt;&lt;em&gt;Here is the bookmark #3&lt;/em&gt;&lt;/p&gt;\n&lt;p&gt;Proin vitae sem non lorem pellentesque molestie. Nam tempus massa et turpis placerat sit amet sollicitudin orci sodales. Pellentesque enim enim, sagittis a lobortis ut, tempus sed arcu. Aliquam augue turpis, varius vel bibendum ut, aliquam at diam. Nam lobortis, dui eu hendrerit pellentesque, sem neque porttitor erat, non dapibus velit lectus in metus. Vestibulum sit amet felis enim. In quis est vitae nunc malesuada consequat nec nec sapien. Suspendisse aliquam massa placerat dui lacinia luctus sed vitae risus. Fusce tempus, neque id ultrices volutpat, mi urna auctor arcu, viverra semper libero sem vel enim. Mauris dictum, elit non placerat malesuada, libero elit euismod nibh, nec posuere massa arcu eu risus. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer urna velit, dapibus eget varius feugiat, pellentesque sit amet ligula. Maecenas nulla nisl, facilisis eu egestas scelerisque, mollis eget metus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Morbi sed congue mi.&lt;/p&gt;\n&lt;p&gt;Fusce metus velit, pharetra at vestibulum nec, facilisis porttitor mi. Curabitur ligula sapien, fermentum vel porttitor id, rutrum sit amet magna. Sed sit amet sollicitudin turpis. Aenean luctus rhoncus dolor, et pulvinar ante egestas et. Donec ac massa orci, quis dapibus augue. Vivamus consectetur auctor pellentesque. Praesent vestibulum tincidunt ante sed consectetur. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Fusce purus metus, imperdiet vitae iaculis convallis, bibendum vitae turpis.&lt;/p&gt;\n&lt;p&gt;Fusce aliquet molestie dolor, in ornare dui sodales nec. In molestie sollicitudin felis a porta. Mauris nec orci sit amet orci blandit tristique congue nec nunc. Praesent et tellus sollicitudin mauris accumsan fringilla. Morbi sodales, justo eu sollicitudin lacinia, lectus sapien ullamcorper eros, quis molestie urna elit bibendum risus. Proin eget tincidunt quam. Nam luctus commodo mauris, eu posuere nunc luctus non. Nulla facilisi. Vivamus eget leo rhoncus quam accumsan fringilla. Aliquam sit amet lorem est. Nullam vel tellus nibh, id imperdiet orci. Integer egestas leo eu turpis blandit scelerisque.&lt;/p&gt;\n&lt;p&gt;Etiam in blandit tellus. Integer sed varius quam. Vestibulum dapibus mi gravida arcu viverra blandit. Praesent tristique augue id sem adipiscing pellentesque. Sed sollicitudin, leo sed interdum elementum, nisi ante condimentum leo, eget ornare libero diam semper quam. Vivamus augue urna, porta eget ultrices et, dapibus ut ligula. Ut laoreet consequat faucibus. Praesent at lectus ut lectus malesuada mollis. Nam interdum adipiscing eros, nec sodales mi porta nec. Proin et quam vitae sem interdum aliquet. Proin vel odio at lacus vehicula aliquet.&lt;/p&gt;\n&lt;p&gt;Etiam placerat dui ut sem ornare vel vestibulum augue mattis. Sed semper malesuada mi, eu bibendum lacus lobortis nec. Etiam fringilla elementum risus, eget consequat urna laoreet nec. Etiam mollis quam non sem convallis vel consectetur lectus ullamcorper. Aenean mattis lacus quis ligula mattis eget vestibulum diam hendrerit. In non placerat mauris. Praesent faucibus nunc quis eros sagittis viverra. In hac habitasse platea dictumst. Suspendisse eget nisl erat, ac molestie massa. Praesent mollis vestibulum tincidunt. Fusce suscipit laoreet malesuada. Aliquam erat volutpat. Aliquam dictum elementum rhoncus. Praesent in est massa, pulvinar sodales nunc. Pellentesque gravida euismod mi ac convallis.&lt;/p&gt;\n&lt;p&gt;Mauris vel odio vel nulla facilisis lacinia. Aliquam ultrices est at leo blandit tincidunt. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Suspendisse porttitor adipiscing facilisis. Duis cursus quam iaculis augue interdum porttitor. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Duis vulputate magna ac metus pretium condimentum. In tempus, est eget vestibulum blandit, velit massa dignissim nisl, ut scelerisque lorem neque vel velit. Maecenas fermentum commodo viverra. Curabitur a nibh non velit aliquam cursus. Integer semper condimentum tortor a pellentesque. Pellentesque semper, nisl id porttitor vehicula, sem dui feugiat lacus, vitae consequat augue urna vel odio.&lt;/p&gt;\n&lt;p&gt;Vestibulum id neque nec turpis iaculis pulvinar et a massa. Vestibulum sed nibh vitae arcu eleifend egestas. Mauris fermentum ultrices blandit. Suspendisse vitae lorem libero. Aenean et pellentesque tellus. Morbi quis neque orci, eu dignissim dui. Fusce sollicitudin mauris ac arcu vestibulum imperdiet. Proin ultricies nisl sit amet enim imperdiet eu ornare dui tempus. Maecenas lobortis nisi a tortor vestibulum vel eleifend tellus vestibulum. Donec metus sapien, hendrerit a fermentum id, dictum quis libero.&lt;/p&gt;\n&lt;p&gt;Pellentesque a lorem nulla, in tempor justo. Duis odio nisl, dignissim sed consequat sit amet, hendrerit ac neque. Nunc ac augue nec massa tempor rhoncus. Nam feugiat, tellus a varius euismod, justo nisl faucibus velit, ut vulputate justo massa eu nibh. Sed bibendum urna quis magna facilisis in accumsan dolor malesuada. Morbi sit amet nunc risus, in faucibus sem. Nullam sollicitudin magna sed sem mollis id commodo libero condimentum. Duis eu massa et lacus semper molestie ut adipiscing sem.&lt;/p&gt;\n&lt;p&gt;Sed id nulla mi, eget suscipit eros. Aliquam tempus molestie rutrum. In quis varius elit. Nullam dignissim neque nec velit vulputate porttitor. Mauris ac ligula sit amet elit fermentum rhoncus. In tellus urna, pulvinar quis condimentum ut, porta nec justo. In hac habitasse platea dictumst. Proin volutpat elit id quam molestie ac commodo lacus sagittis. Quisque placerat, augue tempor placerat pulvinar, nisi nisi venenatis urna, eget convallis eros velit quis magna. Suspendisse volutpat iaculis quam, ut tristique lacus luctus quis.&lt;/p&gt;\n&lt;p&gt;Nullam commodo suscipit lacus non aliquet. Phasellus ac nisl lorem, sed facilisis ligula. Nam cursus lobortis placerat. Sed dui nisi, elementum eu sodales ac, placerat sit amet mauris. Pellentesque dapibus tellus ut ipsum aliquam eu auctor dui vehicula. Quisque ultrices laoreet erat, at ultrices tortor sodales non. Sed venenatis luctus magna, ultricies ultricies nunc fringilla eget. Praesent scelerisque urna vitae nibh tristique varius consequat neque luctus. Integer ornare, erat a porta tempus, velit justo fermentum elit, a fermentum metus nisi eu ipsum. Vivamus eget augue vel dui viverra adipiscing congue ut massa. Praesent vitae eros erat, pulvinar laoreet magna. Maecenas vestibulum mollis nunc in posuere. Pellentesque sit amet metus a turpis lobortis tempor eu vel tortor. Cras sodales eleifend interdum.&lt;/p&gt;\n&lt;/body&gt;\n&lt;/html&gt;</pre>\n        \n<div class=\"note\"><strong>Note:</strong> The function <code>showNode</code> is also an example of the use of the <code><a title=\"en/JavaScript/Reference/Statements/for\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript/Reference/Statements/for\">for</a></code> cycle without a <code>statement</code> section. In this case <strong>a semicolon is always put immediately after the declaration of the cycle</strong>.</div>\n<p>…the same thing but with a dynamic page scroll:</p>\n\n          <pre name=\"code\" class=\"js\">function showBookmark (sBookmark) {\n  /*\n  * nDuration: the duration in milliseconds of each scroll\n  * nFrames: number of frames for each scroll\n  */ \n  var  nDuration = 500, nFrames = 10,\n    nLeft = 0, nTop = 0, oNode = document.getElementById(sBookmark),\n    nScrTop = document.documentElement.scrollTop,\n    nScrLeft = document.documentElement.scrollLeft;\n\n  for (var oItNode = oNode; oItNode; nLeft += oItNode.offsetLeft, nTop += oItNode.offsetTop, oItNode = oItNode.offsetParent);\n\n  for (var nItFrame = 1; nItFrame &lt; nFrames + 1; nItFrame++) {\n    setTimeout(\"document.documentElement.scrollTop=\" + Math.round(nScrTop + ((nTop - nScrTop) * nItFrame / nFrames)) + \";document.documentElement.scrollLeft=\" + Math.round(nScrLeft + ((nTop - nScrLeft) * nItFrame / nFrames)) + \";\", Math.round(nDuration * nItFrame / nFrames));\n  }\n}</pre>\n        \n</div>","<p>Whenever a property of the location object is modified, a document will be loaded using the URL as if <code>window.location.assign()</code> had been called with the modified URL.</p>\n<div id=\"section_8\"><span id=\"Replace_the_current_document_with_the_one_at_the_given_URL:\"></span><h5 class=\"editable\">Replace the current document with the one at the given URL:</h5>\n\n          <pre name=\"code\" class=\"js\">function goMoz() { \n   window.location = \"http://www.mozilla.org\";\n} \n\n// in html: &lt;button onclick=\"goMoz();\"&gt;Mozilla&lt;/button&gt;</pre>\n        \n<div class=\"note\"><strong>Note:</strong> The example above works in situations where <code>window.location.hash</code>&nbsp;does not need to be retained. However, in Gecko-based browsers, setting <code>window.location.pathname</code> in this manner will erase any information in <code>window.location.hash</code>, whereas in WebKit (and possibly other browsers), setting the pathname will not alter the the hash. If you need to change pathname but keep the hash as is, use the <code>replace()</code> method instead, which should work consistently across browsers.</div>\n<p><br> Consider the following example, which will reload the page by using the <code>replace()</code> method to insert the value of <code>window.location.pathname</code> into the hash (similar to Twitter's reload of <a class=\" external\" rel=\"external\" href=\"http://twitter.com/username\" title=\"http://twitter.com/username\" target=\"_blank\">http://twitter.com/username</a> to <a class=\" external\" rel=\"external\" href=\"http://twitter.com/#!/username\" title=\"http://twitter.com/#!/username\" target=\"_blank\">http://twitter.com/#!/username</a>):</p>\n\n          <pre name=\"code\" class=\"js\">function reloadPageWithHash() {\n  var initialPage = window.location.pathname;\n  window.location.replace('http://example.com/#' + initialPage);\n}</pre>\n        \n</div><div id=\"section_9\"><span id=\"Display_the_properties_of_the_current_URL_in_an_alert_dialog:\"></span><h5 class=\"editable\">Display the properties of the current URL in an alert dialog:</h5>\n\n          <pre name=\"code\" class=\"js\">function showLoc() {\n  var oLocation = window.location, aLog = [\"Property (Typeof): Value\", \"window.location (\" + (typeof oLocation) + \"): \" + oLocation ];\n  for (var sProp in oLocation){\n    aLog.push(sProp + \" (\" + (typeof oLocation[sProp]) + \"): \" +  (oLocation[sProp] || \"n/a\"));\n  }\n  alert(aLog.join(\"\\n\"));\n}\n\n// in html: &lt;button onclick=\"showLoc();\"&gt;Show location properties&lt;/button&gt;</pre>\n        \n</div><div id=\"section_10\"><span id=\"Send_a_string_of_data_to_the_server_by_modifying_the_search_property:\"></span><h5 class=\"editable\">Send a string of data to the server by modifying the <code>search</code> property:</h5>\n\n          <pre name=\"code\" class=\"js\">function sendData (sData) {\n  window.location.search = sData;\n}\n\n// in html: &lt;button onclick=\"sendData('Some data');\"&gt;Send data&lt;/button&gt;</pre>\n        \n<p>The current URL with \"?Some%20data\" appended is sent to the server (if no action is taken by the server, the current document is reloaded with the modified search string).</p>\n</div><div id=\"section_11\"><span id=\"Get_the_value_of_a_single_window.location.search_key:\"></span><h5 class=\"editable\">Get the value of a single <code>window.location.search</code> key:</h5>\n\n          <pre name=\"code\" class=\"js\">function loadPageVar (sVar) {\n  return unescape(window.location.search.replace(new RegExp(\"^(?:.*[&amp;\\\\?]\" + escape(sVar).replace(/[\\.\\+\\*]/g, \"\\\\$&amp;\") + \"(?:\\\\=([^&amp;]*))?)?.*$\", \"i\"), \"$1\"));\n}\n\nalert(loadPageVar(\"name\"));</pre>\n        \n</div><div id=\"section_12\"><span id=\"Nestle_the_variables_obtained_through_the_window.location.search_string_in_an_object_named_oGetVars.2C_also_attempting_to_recognize_their_typeof:\"></span><h5 class=\"editable\">Nestle the variables obtained through the <code>window.location.search</code> string in an object named <code>oGetVars</code>, also attempting to recognize their <code><a title=\"en/JavaScript/Reference/Operators/typeof\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript/Reference/Operators/typeof\">typeof</a></code>:</h5>\n\n          <pre name=\"code\" class=\"js\">var oGetVars = {};\n\nfunction buildValue(sValue) {\n  if (/^\\s*$/.test(sValue)) { return null; }\n  if (/^(true|false)$/i.test(sValue)) { return sValue.toLowerCase() === \"true\"; }\n  if (isFinite(sValue)) { return parseFloat(sValue); }\n  if (isFinite(Date.parse(sValue))) { return new Date(sValue); }\n  return sValue;\n}\n\nif (window.location.search.length &gt; 1) {\n  for (var aItKey, nKeyId = 0, aCouples = window.location.search.substr(1).split(\"&amp;\"); nKeyId &lt; aCouples.length; nKeyId++) {\n    aItKey = aCouples[nKeyId].split(\"=\");\n    oGetVars[unescape(aItKey[0])] = aItKey.length &gt; 1 ? buildValue(unescape(aItKey[1])) : null;\n  }\n}\n\n// alert(oGetVars.yourVar);</pre>\n        \n<p>…the same thing obtained by an anonymous constructor – useful for a global variable declaration:</p>\n\n          <pre name=\"code\" class=\"js\">var oGetVars = new (function (sSearch) {\n  var rNull = /^\\s*$/, rBool = /^(true|false)$/i;\n  function buildValue(sValue) {\n    if (rNull.test(sValue)) { return null; }\n    if (rBool.test(sValue)) { return sValue.toLowerCase() === \"true\"; }\n    if (isFinite(sValue)) { return parseFloat(sValue); }\n    if (isFinite(Date.parse(sValue))) { return new Date(sValue); }\n    return sValue;\n  }\n  if (sSearch.length &gt; 1) {\n    for (var aItKey, nKeyId = 0, aCouples = sSearch.substr(1).split(\"&amp;\"); nKeyId &lt; aCouples.length; nKeyId++) {\n      aItKey = aCouples[nKeyId].split(\"=\");\n      this[unescape(aItKey[0])] = aItKey.length &gt; 1 ? buildValue(unescape(aItKey[1])) : null;\n    }\n  }\n})(window.location.search);\n\n// alert(oGetVars.yourVar);</pre>\n        \n</div><div id=\"section_13\"><span id=\"Using_bookmars_without_changing_the_window.location.hash_property:\"></span><h5 class=\"editable\">Using bookmars without changing the <code>window.location.hash</code> property:</h5>\n\n          <pre name=\"code\" class=\"xml\">&lt;!doctype html&gt;\n&lt;html&gt;\n&lt;head&gt;\n&lt;meta content=\"text/html; charset=UTF-8\" http-equiv=\"Content-Type\" /&gt;\n&lt;title&gt;MDN Example&lt;/title&gt;\n&lt;script type=\"text/javascript\"&gt;\nfunction showNode (oNode) {\n  var nLeft = 0, nTop = 0;\n  for (var oItNode = oNode; oItNode; nLeft += oItNode.offsetLeft, nTop += oItNode.offsetTop, oItNode = oItNode.offsetParent);\n  document.documentElement.scrollTop = nTop;\n  document.documentElement.scrollLeft = nLeft;\n}\n\nfunction showBookmark (sBookmark, bUseHash) {\n  if (bUseHash) { window.location.hash = \"#\" + sBookmark; return; }\n  var oBookmark = document.getElementById(sBookmark);\n  if (oBookmark) { showNode(oBookmark); }\n}\n&lt;/script&gt;\n&lt;style type=\"text/css\"&gt;\nspan.intLink {\n  cursor: pointer;\n  color: #0000ff;\n  text-decoration: underline;\n}\n&lt;/style&gt;\n&lt;/head&gt;\n\n&lt;body&gt;\n&lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam ultrices dolor ac dolor imperdiet ullamcorper. Suspendisse quam libero, luctus auctor mollis sed, malesuada condimentum magna. Quisque in ante tellus, in placerat est. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Donec a mi magna, quis mattis dolor. Etiam sit amet ligula quis urna auctor imperdiet nec faucibus ante. Mauris vel consectetur dolor. Nunc eget elit eget velit pulvinar fringilla consectetur aliquam purus. Curabitur convallis, justo posuere porta egestas, velit erat ornare tortor, non viverra justo diam eget arcu. Phasellus adipiscing fermentum nibh ac commodo. Nam turpis nunc, suscipit a hendrerit vitae, volutpat non ipsum.&lt;/p&gt;\n&lt;p&gt;Duis lobortis sapien quis nisl luctus porttitor. In tempor semper libero, eu tincidunt dolor eleifend sit amet. Ut nec velit in dolor tincidunt rhoncus non non diam. Morbi auctor ornare orci, non euismod felis gravida nec. Curabitur elementum nisi a eros rutrum nec blandit diam placerat. Aenean tincidunt risus ut nisi consectetur cursus. Ut vitae quam elit. Donec dignissim est in quam tempor consequat. Aliquam aliquam diam non felis convallis suscipit. Nulla facilisi. Donec lacus risus, dignissim et fringilla et, egestas vel eros. Duis malesuada accumsan dui, at fringilla mauris bibendum quis. Cras adipiscing ultricies fermentum. Praesent bibendum condimentum feugiat.&lt;/p&gt;\n&lt;p id=\"myBookmark1\"&gt;[&amp;nbsp;&lt;span class=\"intLink\" onclick=\"showBookmark('myBookmark2');\"&gt;Go to bookmark #2&lt;/span&gt;&amp;nbsp;]&lt;/p&gt;\n&lt;p&gt;Vivamus blandit massa ut metus mattis in fringilla lectus imperdiet. Proin ac ante a felis ornare vehicula. Fusce pellentesque lacus vitae eros convallis ut mollis magna pellentesque. Pellentesque placerat enim at lacus ultricies vitae facilisis nisi fringilla. In tincidunt tincidunt tincidunt. Nulla vitae tempor nisl. Etiam congue, elit vitae egestas mollis, ipsum nisi malesuada turpis, a volutpat arcu arcu id risus.&lt;/p&gt;\n&lt;p&gt;Nam faucibus, ligula eu fringilla pulvinar, lectus tellus iaculis nunc, vitae scelerisque metus leo non metus. Proin mattis lobortis lobortis. Quisque accumsan faucibus erat, vel varius tortor ultricies ac. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nec libero nunc. Nullam tortor nunc, elementum a consectetur et, ultrices eu orci. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque a nisl eu sem vehicula egestas.&lt;/p&gt;\n&lt;p&gt;Aenean viverra varius mauris, sed elementum lacus interdum non. Phasellus sit amet lectus vitae eros egestas pellentesque fermentum eget magna. Quisque mauris nisl, gravida vitae placerat et, condimentum id metus. Nulla eu est dictum dolor pulvinar volutpat. Pellentesque vitae sollicitudin nunc. Donec neque magna, lobortis id egestas nec, sodales quis lectus. Fusce cursus sollicitudin porta. Suspendisse ut tortor in mauris tincidunt rhoncus. Maecenas tincidunt fermentum facilisis. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.&lt;/p&gt;\n&lt;p&gt;Suspendisse turpis nisl, consectetur in lacinia ut, ornare vel mi. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin non lectus eu turpis vulputate cursus. Mauris interdum tincidunt erat id pharetra. Nullam in libero elit, sed consequat lectus. Morbi odio nisi, porta vitae molestie ut, gravida ut nunc. Ut non est dui, id ullamcorper orci. Praesent vel elementum felis. Maecenas ornare, dui quis auctor hendrerit, turpis sem ullamcorper odio, in auctor magna metus quis leo. Morbi at odio ante.&lt;/p&gt;\n&lt;p&gt;Curabitur est ipsum, porta ac viverra faucibus, eleifend sed eros. In sit amet vehicula tortor. Vestibulum viverra pellentesque erat a elementum. Integer commodo ultricies lorem, eget tincidunt risus viverra et. In enim turpis, porttitor ac ornare et, suscipit sit amet nisl. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Pellentesque vel ultrices nibh. Sed commodo aliquam aliquam. Nulla euismod, odio ut eleifend mollis, nisi dui gravida nibh, vitae laoreet turpis purus id ipsum. Donec convallis, velit non scelerisque bibendum, diam nulla auctor nunc, vel dictum risus ipsum sit amet est. Praesent ut nibh sit amet nibh congue pulvinar. Suspendisse dictum porttitor tempor.&lt;/p&gt;\n&lt;p&gt;Vestibulum dignissim erat vitae lectus auctor ac bibendum eros semper. Integer aliquet, leo non ornare faucibus, risus arcu tristique dolor, a aliquet massa mauris quis arcu. In porttitor, lectus ac semper egestas, ligula magna laoreet libero, eu commodo mauris odio id ante. In hac habitasse platea dictumst. In pretium erat diam, nec consequat eros. Praesent augue mi, consequat sed porttitor at, volutpat vitae eros. Sed pretium pharetra dapibus. Donec auctor interdum erat, lacinia molestie nibh commodo ut. Maecenas vestibulum vulputate felis, ut ullamcorper arcu faucibus in. Curabitur id arcu est. In semper mollis lorem at pellentesque. Sed lectus nisl, vestibulum id scelerisque eu, feugiat et tortor. Pellentesque porttitor facilisis ultricies.&lt;/p&gt;\n&lt;p id=\"myBookmark2\"&gt;[&amp;nbsp;&lt;span class=\"intLink\" onclick=\"showBookmark('myBookmark1');\"&gt;Go to bookmark #1&lt;/span&gt; | &lt;span class=\"intLink\" onclick=\"showBookmark('myBookmark1', true);\"&gt;Go to bookmark #1 using location.hash&lt;/span&gt; | &lt;span class=\"intLink\" onclick=\"showBookmark('myBookmark3');\"&gt;Go to bookmark #3&lt;/span&gt;&amp;nbsp;]&lt;/p&gt;\n&lt;p&gt;Phasellus tempus fringilla nunc, eget sagittis orci molestie vel. Nulla sollicitudin diam non quam iaculis ac porta justo venenatis. Quisque tellus urna, molestie vitae egestas sit amet, suscipit sed sem. Quisque nec lorem eu velit faucibus tristique ut ut dolor. Cras eu tortor ut libero placerat venenatis ut ut massa. Sed quis libero augue, et consequat libero. Morbi rutrum augue sed turpis elementum sed luctus nisl molestie. Aenean vitae purus risus, a semper nisl. Pellentesque malesuada, est id sagittis consequat, libero mauris tincidunt tellus, eu sagittis arcu purus rutrum eros. Quisque eget eleifend mi. Duis pharetra mi ac eros mattis lacinia rutrum ipsum varius.&lt;/p&gt;\n&lt;p&gt;Fusce cursus pulvinar aliquam. Duis justo enim, ornare vitae elementum sed, porta a quam. Aliquam eu enim eu libero mollis tempus. Morbi ornare aliquam posuere. Proin faucibus luctus libero, sed ultrices lorem sagittis et. Vestibulum malesuada, ante nec molestie vehicula, quam diam mollis ipsum, rhoncus posuere mauris lectus in eros. Nullam feugiat ultrices augue, ac sodales sem mollis in.&lt;/p&gt;\n&lt;p id=\"myBookmark3\"&gt;&lt;em&gt;Here is the bookmark #3&lt;/em&gt;&lt;/p&gt;\n&lt;p&gt;Proin vitae sem non lorem pellentesque molestie. Nam tempus massa et turpis placerat sit amet sollicitudin orci sodales. Pellentesque enim enim, sagittis a lobortis ut, tempus sed arcu. Aliquam augue turpis, varius vel bibendum ut, aliquam at diam. Nam lobortis, dui eu hendrerit pellentesque, sem neque porttitor erat, non dapibus velit lectus in metus. Vestibulum sit amet felis enim. In quis est vitae nunc malesuada consequat nec nec sapien. Suspendisse aliquam massa placerat dui lacinia luctus sed vitae risus. Fusce tempus, neque id ultrices volutpat, mi urna auctor arcu, viverra semper libero sem vel enim. Mauris dictum, elit non placerat malesuada, libero elit euismod nibh, nec posuere massa arcu eu risus. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer urna velit, dapibus eget varius feugiat, pellentesque sit amet ligula. Maecenas nulla nisl, facilisis eu egestas scelerisque, mollis eget metus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Morbi sed congue mi.&lt;/p&gt;\n&lt;p&gt;Fusce metus velit, pharetra at vestibulum nec, facilisis porttitor mi. Curabitur ligula sapien, fermentum vel porttitor id, rutrum sit amet magna. Sed sit amet sollicitudin turpis. Aenean luctus rhoncus dolor, et pulvinar ante egestas et. Donec ac massa orci, quis dapibus augue. Vivamus consectetur auctor pellentesque. Praesent vestibulum tincidunt ante sed consectetur. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Fusce purus metus, imperdiet vitae iaculis convallis, bibendum vitae turpis.&lt;/p&gt;\n&lt;p&gt;Fusce aliquet molestie dolor, in ornare dui sodales nec. In molestie sollicitudin felis a porta. Mauris nec orci sit amet orci blandit tristique congue nec nunc. Praesent et tellus sollicitudin mauris accumsan fringilla. Morbi sodales, justo eu sollicitudin lacinia, lectus sapien ullamcorper eros, quis molestie urna elit bibendum risus. Proin eget tincidunt quam. Nam luctus commodo mauris, eu posuere nunc luctus non. Nulla facilisi. Vivamus eget leo rhoncus quam accumsan fringilla. Aliquam sit amet lorem est. Nullam vel tellus nibh, id imperdiet orci. Integer egestas leo eu turpis blandit scelerisque.&lt;/p&gt;\n&lt;p&gt;Etiam in blandit tellus. Integer sed varius quam. Vestibulum dapibus mi gravida arcu viverra blandit. Praesent tristique augue id sem adipiscing pellentesque. Sed sollicitudin, leo sed interdum elementum, nisi ante condimentum leo, eget ornare libero diam semper quam. Vivamus augue urna, porta eget ultrices et, dapibus ut ligula. Ut laoreet consequat faucibus. Praesent at lectus ut lectus malesuada mollis. Nam interdum adipiscing eros, nec sodales mi porta nec. Proin et quam vitae sem interdum aliquet. Proin vel odio at lacus vehicula aliquet.&lt;/p&gt;\n&lt;p&gt;Etiam placerat dui ut sem ornare vel vestibulum augue mattis. Sed semper malesuada mi, eu bibendum lacus lobortis nec. Etiam fringilla elementum risus, eget consequat urna laoreet nec. Etiam mollis quam non sem convallis vel consectetur lectus ullamcorper. Aenean mattis lacus quis ligula mattis eget vestibulum diam hendrerit. In non placerat mauris. Praesent faucibus nunc quis eros sagittis viverra. In hac habitasse platea dictumst. Suspendisse eget nisl erat, ac molestie massa. Praesent mollis vestibulum tincidunt. Fusce suscipit laoreet malesuada. Aliquam erat volutpat. Aliquam dictum elementum rhoncus. Praesent in est massa, pulvinar sodales nunc. Pellentesque gravida euismod mi ac convallis.&lt;/p&gt;\n&lt;p&gt;Mauris vel odio vel nulla facilisis lacinia. Aliquam ultrices est at leo blandit tincidunt. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Suspendisse porttitor adipiscing facilisis. Duis cursus quam iaculis augue interdum porttitor. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Duis vulputate magna ac metus pretium condimentum. In tempus, est eget vestibulum blandit, velit massa dignissim nisl, ut scelerisque lorem neque vel velit. Maecenas fermentum commodo viverra. Curabitur a nibh non velit aliquam cursus. Integer semper condimentum tortor a pellentesque. Pellentesque semper, nisl id porttitor vehicula, sem dui feugiat lacus, vitae consequat augue urna vel odio.&lt;/p&gt;\n&lt;p&gt;Vestibulum id neque nec turpis iaculis pulvinar et a massa. Vestibulum sed nibh vitae arcu eleifend egestas. Mauris fermentum ultrices blandit. Suspendisse vitae lorem libero. Aenean et pellentesque tellus. Morbi quis neque orci, eu dignissim dui. Fusce sollicitudin mauris ac arcu vestibulum imperdiet. Proin ultricies nisl sit amet enim imperdiet eu ornare dui tempus. Maecenas lobortis nisi a tortor vestibulum vel eleifend tellus vestibulum. Donec metus sapien, hendrerit a fermentum id, dictum quis libero.&lt;/p&gt;\n&lt;p&gt;Pellentesque a lorem nulla, in tempor justo. Duis odio nisl, dignissim sed consequat sit amet, hendrerit ac neque. Nunc ac augue nec massa tempor rhoncus. Nam feugiat, tellus a varius euismod, justo nisl faucibus velit, ut vulputate justo massa eu nibh. Sed bibendum urna quis magna facilisis in accumsan dolor malesuada. Morbi sit amet nunc risus, in faucibus sem. Nullam sollicitudin magna sed sem mollis id commodo libero condimentum. Duis eu massa et lacus semper molestie ut adipiscing sem.&lt;/p&gt;\n&lt;p&gt;Sed id nulla mi, eget suscipit eros. Aliquam tempus molestie rutrum. In quis varius elit. Nullam dignissim neque nec velit vulputate porttitor. Mauris ac ligula sit amet elit fermentum rhoncus. In tellus urna, pulvinar quis condimentum ut, porta nec justo. In hac habitasse platea dictumst. Proin volutpat elit id quam molestie ac commodo lacus sagittis. Quisque placerat, augue tempor placerat pulvinar, nisi nisi venenatis urna, eget convallis eros velit quis magna. Suspendisse volutpat iaculis quam, ut tristique lacus luctus quis.&lt;/p&gt;\n&lt;p&gt;Nullam commodo suscipit lacus non aliquet. Phasellus ac nisl lorem, sed facilisis ligula. Nam cursus lobortis placerat. Sed dui nisi, elementum eu sodales ac, placerat sit amet mauris. Pellentesque dapibus tellus ut ipsum aliquam eu auctor dui vehicula. Quisque ultrices laoreet erat, at ultrices tortor sodales non. Sed venenatis luctus magna, ultricies ultricies nunc fringilla eget. Praesent scelerisque urna vitae nibh tristique varius consequat neque luctus. Integer ornare, erat a porta tempus, velit justo fermentum elit, a fermentum metus nisi eu ipsum. Vivamus eget augue vel dui viverra adipiscing congue ut massa. Praesent vitae eros erat, pulvinar laoreet magna. Maecenas vestibulum mollis nunc in posuere. Pellentesque sit amet metus a turpis lobortis tempor eu vel tortor. Cras sodales eleifend interdum.&lt;/p&gt;\n&lt;/body&gt;\n&lt;/html&gt;</pre>\n        \n<div class=\"note\"><strong>Note:</strong> The function <code>showNode</code> is also an example of the use of the <code><a title=\"en/JavaScript/Reference/Statements/for\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript/Reference/Statements/for\">for</a></code> cycle without a <code>statement</code> section. In this case <strong>a semicolon is always put immediately after the declaration of the cycle</strong>.</div>\n<p>…the same thing but with a dynamic page scroll:</p>\n\n          <pre name=\"code\" class=\"js\">function showBookmark (sBookmark) {\n  /*\n  * nDuration: the duration in milliseconds of each scroll\n  * nFrames: number of frames for each scroll\n  */ \n  var  nDuration = 500, nFrames = 10,\n    nLeft = 0, nTop = 0, oNode = document.getElementById(sBookmark),\n    nScrTop = document.documentElement.scrollTop,\n    nScrLeft = document.documentElement.scrollLeft;\n\n  for (var oItNode = oNode; oItNode; nLeft += oItNode.offsetLeft, nTop += oItNode.offsetTop, oItNode = oItNode.offsetParent);\n\n  for (var nItFrame = 1; nItFrame &lt; nFrames + 1; nItFrame++) {\n    setTimeout(\"document.documentElement.scrollTop=\" + Math.round(nScrTop + ((nTop - nScrTop) * nItFrame / nFrames)) + \";document.documentElement.scrollLeft=\" + Math.round(nScrLeft + ((nTop - nScrLeft) * nItFrame / nFrames)) + \";\", Math.round(nDuration * nItFrame / nFrames));\n  }\n}</pre>\n        \n</div>"],"srcUrl":"https://developer.mozilla.org/en/DOM/window.location","specification":"HTML Specification: window . location","seeAlso":"Manipulating the browser history","summary":"Returns a <a href=\"#Location_object\"> <code>Location</code> object</a>, which contains information about the URL of the document and provides methods for changing that URL. You can also assign to this property to load another URL.","members":[{"name":"assign","help":"Load the document at the provided URL.","obsolete":false},{"name":"reload","help":"Reload the document from the current URL. <code>forceget</code> is a boolean, which, when it is <code>true</code>, causes the page to always be reloaded from the server. If it is <code>false</code> or not specified, the browser may reload the page from its cache.","obsolete":false},{"name":"replace","help":"Replace the current document with the one at the provided URL. The difference from the <code>assign()</code> method is that after using <code>replace()</code> the current page will not be saved in session history, meaning the user won't be able to use the Back button to navigate to it.","obsolete":false},{"name":"toString","help":"Returns the string representation of the <code>Location</code> object's URL. See the <a title=\"en/Core_JavaScript_1.5_Reference/Global_Objects/Object/toString\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object/toString\">JavaScript reference</a> for details.","obsolete":false},{"name":"hash","help":"the part of the URL that follows the # symbol, including the # symbol.<br> You can listen for the <a title=\"en/DOM/window.onhashchange\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/window.onhashchange\">hashchange event</a> to get notified of changes to the hash in supporting browsers.","obsolete":false},{"name":"host","help":"the host name and port number.","obsolete":false},{"name":"hostname","help":"the host name (without the port number or square brackets).","obsolete":false},{"name":"href","help":"the entire URL.","obsolete":false},{"name":"pathname","help":"the path (relative to the host).","obsolete":false},{"name":"port","help":"the port number of the URL.","obsolete":false},{"name":"protocol","help":"the protocol of the URL.","obsolete":false},{"name":"search","help":"the part of the URL that follows the&nbsp;? symbol, including the&nbsp;? symbol.","obsolete":false},{"name":"assign","help":"Load the document at the provided URL.","obsolete":false},{"name":"reload","help":"Reload the document from the current URL. <code>forceget</code> is a boolean, which, when it is <code>true</code>, causes the page to always be reloaded from the server. If it is <code>false</code> or not specified, the browser may reload the page from its cache.","obsolete":false},{"name":"replace","help":"Replace the current document with the one at the provided URL. The difference from the <code>assign()</code> method is that after using <code>replace()</code> the current page will not be saved in session history, meaning the user won't be able to use the Back button to navigate to it.","obsolete":false},{"name":"toString","help":"Returns the string representation of the <code>Location</code> object's URL. See the <a title=\"en/Core_JavaScript_1.5_Reference/Global_Objects/Object/toString\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object/toString\">JavaScript reference</a> for details.","obsolete":false},{"name":"hash","help":"the part of the URL that follows the # symbol, including the # symbol.<br> You can listen for the <a title=\"en/DOM/window.onhashchange\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/window.onhashchange\">hashchange event</a> to get notified of changes to the hash in supporting browsers.","obsolete":false},{"name":"host","help":"the host name and port number.","obsolete":false},{"name":"hostname","help":"the host name (without the port number or square brackets).","obsolete":false},{"name":"href","help":"the entire URL.","obsolete":false},{"name":"pathname","help":"the path (relative to the host).","obsolete":false},{"name":"port","help":"the port number of the URL.","obsolete":false},{"name":"protocol","help":"the protocol of the URL.","obsolete":false},{"name":"search","help":"the part of the URL that follows the&nbsp;? symbol, including the&nbsp;? symbol.","obsolete":false}]},"OverflowEvent":{"title":"XUL Events","members":[],"srcUrl":"https://developer.mozilla.org/en/XUL/Events","skipped":true,"cause":"Suspect title"},"SVGPathSegMovetoAbs":{"title":"SVGPathElement","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/SVGPathElement","skipped":true,"cause":"Suspect title"},"SVGSymbolElement":{"title":"SVGSymbolElement","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody>\n</table>\n</div>\n<div id=\"compat-mobile\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody>\n</table>\n</div>","summary":"The <code>SVGSymbolElement</code> interface corresponds to the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/symbol\">&lt;symbol&gt;</a></code>\n element.","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/SVGSymbolElement"},"HTMLDetailsElement":{"title":"details","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari</th> </tr> <tr> <td>Basic support</td> <td>12</td> <td><span title=\"Not supported.\">--</span> <a rel=\"external\" href=\"https://bugzilla.mozilla.org/show_bug.cgi?id=591737\" class=\"external\" title=\"\">\nbug 591737</a>\n</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td>4.0</td> <td><span title=\"Not supported.\">--</span> <a rel=\"external\" href=\"https://bugzilla.mozilla.org/show_bug.cgi?id=591737\" class=\"external\" title=\"\">\nbug 591737</a>\n</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> </tr> </tbody> </table>\n</div>","examples":["&lt;details&gt;\n  &lt;summary&gt;Some details&lt;/summary&gt;\n  &lt;p&gt;More info about the details.&lt;/p&gt;\n&lt;/details&gt;"],"srcUrl":"https://developer.mozilla.org/en/HTML/Element/details","seeAlso":"&lt;summary&gt;","summary":"The HTML <em>details</em> element (<code>&lt;details&gt;</code>) is used as a disclosure widget from which the user the retrieve additional information.","members":[{"obsolete":false,"url":"","name":"open","help":"This Boolean attribute indicates whether the details will be shown to the user on page load. If omitted the details will be hidden."}]},"SVGTextPathElement":{"title":"textPath","examples":["&lt;?xml version=\"1.0\" standalone=\"no\"?&gt;\n&lt;!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \n  \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\"&gt;\n&lt;svg width=\"12cm\" height=\"3.6cm\" viewBox=\"0 0 1000 300\" version=\"1.1\"\n     xmlns=\"http://www.w3.org/2000/svg\" \n     xmlns:xlink=\"http://www.w3.org/1999/xlink\"&gt;\n  &lt;defs&gt;\n    &lt;path id=\"MyPath\"\n          d=\"M 100 200 \n             C 200 100 300   0 400 100\n             C 500 200 600 300 700 200\n             C 800 100 900 100 900 100\" /&gt;\n  &lt;/defs&gt;\n\n  &lt;use xlink:href=\"#MyPath\" fill=\"none\" stroke=\"red\"  /&gt;\n\n  &lt;text font-family=\"Verdana\" font-size=\"42.5\" fill=\"blue\" &gt;\n    &lt;textPath xlink:href=\"#MyPath\"&gt;\n      We go up, then we go down, then up again\n    &lt;/textPath&gt;\n  &lt;/text&gt;\n\n  &lt;!-- Show outline of canvas using 'rect' element --&gt;\n  &lt;rect x=\"1\" y=\"1\" width=\"998\" height=\"298\"\n        fill=\"none\" stroke=\"blue\" stroke-width=\"2\" /&gt;\n&lt;/svg&gt;"],"summary":"In addition to text drawn in a straight line, SVG also includes the ability to place text along the shape of a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/path\">&lt;path&gt;</a></code>\n element. To specify that a block of text is to be rendered along the shape of a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/path\">&lt;path&gt;</a></code>\n, include the given text within a <code>textPath</code> element which includes an <code>xlink:href</code> attribute with a reference to a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/path\">&lt;path&gt;</a></code>\n element.","members":[{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/startOffset","name":"startOffset","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/class","name":"class","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/spacing","name":"spacing","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/method","name":"method","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/externalResourcesRequired","name":"externalResourcesRequired","help":"Specific attributes"},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/style","name":"style","help":""}],"srcUrl":"https://developer.mozilla.org/en/SVG/Element/textPath"},"SVGTextPositioningElement":{"title":"SVGTextPositioningElement","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>","summary":"The <code>SVGTextPositioningElement</code> interface is inherited by text-related interfaces: <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/SVGTextElement\">SVGTextElement</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/SVGTSpanElement\">SVGTSpanElement</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/SVGTRefElement\">SVGTRefElement</a></code>\n and <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/SVGAltGlyphElement\" class=\"new\">SVGAltGlyphElement</a></code>\n.","members":[{"name":"dx","help":"Corresponds to attribute \n<code><a rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Attribute/dx\" class=\"new\">dx</a></code> on the given element.","obsolete":false},{"name":"dy","help":"Corresponds to attribute \n<code><a rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Attribute/dy\" class=\"new\">dy</a></code> on the given element.","obsolete":false},{"name":"rotate","help":"Corresponds to attribute \n<code><a rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Attribute/rotate\" class=\"new\">rotate</a></code> on the given element.","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/DOM/SVGTextPositioningElement"},"SVGSwitchElement":{"title":"SVGSwitchElement","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>","summary":"The <code>SVGSwitchElement</code> interface corresponds to the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/switch\">&lt;switch&gt;</a></code>\n element.","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/SVGSwitchElement"},"SVGEllipseElement":{"title":"SVGEllipseElement","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td>9.0</td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> </tbody>\n</table>\n</div>\n<div id=\"compat-mobile\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> </tbody>\n</table>\n</div>","srcUrl":"https://developer.mozilla.org/en/DOM/SVGEllipseElement","seeAlso":"<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/ellipse\">&lt;ellipse&gt;</a></code>\n SVG Element","summary":"The <code>SVGEllipseElement</code> interface provides access to the properties of <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/ellipse\">&lt;ellipse&gt;</a></code>\n elements, as well as methods to manipulate them.","members":[{"name":"cx","help":"Corresponds to attribute \n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Attribute/cx\">cx</a></code> on the given <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/ellipse\">&lt;ellipse&gt;</a></code>\n element.","obsolete":false},{"name":"cy","help":"Corresponds to attribute \n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Attribute/cy\">cy</a></code> on the given <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/ellipse\">&lt;ellipse&gt;</a></code>\n element.","obsolete":false},{"name":"rx","help":"Corresponds to attribute \n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Attribute/rx\">rx</a></code> on the given <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/ellipse\">&lt;ellipse&gt;</a></code>\n element.","obsolete":false},{"name":"ry","help":"Corresponds to attribute \n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Attribute/ry\">ry</a></code> on the given <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/ellipse\">&lt;ellipse&gt;</a></code>\n element.","obsolete":false}]},"Database":{"title":"The Places database","summary":"<div><p>This content covers features introduced in <a rel=\"custom\" href=\"https://developer.mozilla.org/en/Firefox_3_for_developers\">Firefox 3</a>.</p></div>\n<p></p>\n<p>This document provides a high-level overview of the overall database design of the <a title=\"en/Places\" rel=\"internal\" href=\"https://developer.mozilla.org/en/Places\">Places</a> system. Places is designed to be a complete replacement for the Firefox bookmarks and history systems using <a title=\"en/Storage\" rel=\"internal\" href=\"https://developer.mozilla.org/en/Storage\">Storage.</a></p>\n<p>View the <a class=\" external\" rel=\"external\" href=\"http://people.mozilla.org/~dietrich/places-erd.png\" title=\"http://people.mozilla.org/~dietrich/places-erd.png\" target=\"_blank\">schema diagram</a>.</p>","members":[],"srcUrl":"https://developer.mozilla.org/en/The_Places_database"},"DOMException":{"title":"DOMException","summary":"<p>The following are the <strong>DOMException</strong> codes:</p>\n<table class=\"standard-table\"> <thead> <tr> <th scope=\"col\">Code</th> <th scope=\"col\">'Abstract' Constant name</th> </tr> </thead> <tbody> <tr> <th colspan=\"2\">Level 1</th> </tr> <tr> <td><code>1</code></td> <td><code>INDEX_SIZE_ERR</code></td> </tr> <tr> <td><code>2</code></td> <td><code>DOMSTRING_SIZE_ERR</code></td> </tr> <tr> <td><code>3</code></td> <td><code>HIERARCHY_REQUEST_ERR</code></td> </tr> <tr> <td><code>4</code></td> <td><code>WRONG_DOCUMENT_ERR</code></td> </tr> <tr> <td><code>5</code></td> <td><code>INVALID_CHARACTER_ERR</code></td> </tr> <tr> <td><code>6</code></td> <td><code>NO_DATA_ALLOWED_ERR</code></td> </tr> <tr> <td><code>7</code></td> <td><code>NO_MODIFICATION_ALLOWED_ERR</code></td> </tr> <tr> <td><code>8</code></td> <td><code>NOT_FOUND_ERR</code></td> </tr> <tr> <td><code>9</code></td> <td><code>NOT_SUPPORTED_ERR</code></td> </tr> <tr> <td><code>10</code></td> <td><code>INUSE_ATTRIBUTE_ERR</code></td> </tr> <tr> <th colspan=\"2\">Level 2</th> </tr> <tr> <td><code>11</code></td> <td><code>INVALID_STATE_ERR</code></td> </tr> <tr> <td><code>12</code></td> <td><code>SYNTAX_ERR</code></td> </tr> <tr> <td><code>13</code></td> <td><code>INVALID_MODIFICATION_ERR</code></td> </tr> <tr> <td><code>14</code></td> <td><code>NAMESPACE_ERR</code></td> </tr> <tr> <td><code>15</code></td> <td><code>INVALID_ACCESS_ERR</code></td> </tr> <tr> <th colspan=\"2\"><strong>Level 3</strong></th> </tr> <tr> <td><code>16</code></td> <td><code>VALIDATION_ERR</code></td> </tr> <tr> <td><code>17</code></td> <td><code>TYPE_MISMATCH_ERR</code></td> </tr> </tbody>\n</table>","members":[],"srcUrl":"https://developer.mozilla.org/En/DOM/DOMException","specification":"http://www.w3.org/TR/DOM-Level-3-Cor...ml#ID-17189187"},"Navigator":{"title":"window.navigator","examples":["alert(\"You're using \" + navigator.appName);\n"],"srcUrl":"https://developer.mozilla.org/en/DOM/window.navigator","specification":"Defined in <a class=\"external\" title=\"http://www.whatwg.org/html/#navigator\" rel=\"external\" href=\"http://www.whatwg.org/html/#navigator\" target=\"_blank\">HTML</a>.","seeAlso":"DOM Client Object Cross-Reference:navigator","summary":"Returns a reference to the navigator object, which can be queried for information about the application running the script.","members":[{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.navigator.javaEnabled","name":"javaEnabled","help":"Indicates whether the host browser is Java-enabled or not."},{"obsolete":false,"url":"https://developer.mozilla.org/Article_not_found?uri=en/DOM/window.navigator.taintEnabled","name":"taintEnabled","help":"Returns <code>false</code>. JavaScript taint/untaint functions removed in JavaScript 1.2. Removed from Firefox 9."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.navigator.registerContentHandler","name":"registerContentHandler","help":"Allows web sites to register themselves as a possible handler for a given MIME type."},{"name":"webkitIsLocallyAvailable","help":"Lets code check to see if the document at a given URI is available without using the network.","obsolete":false},{"obsolete":false,"url":"https://developer.mozilla.org/Article_not_found?uri=en/DOM/window.navigator.registerProtocolHandler","name":"registerProtocolHandler","help":"Allows web sites to register themselves as a possible handler for a given protocol."},{"obsolete":false,"url":"https://developer.mozilla.org/Article_not_found?uri=en/DOM/window.navigator.preference","name":"preference","help":"Sets a user preference. This method is <a class=\"external\" rel=\"external\" href=\"http://www.faqts.com/knowledge_base/view.phtml/aid/1608/fid/125/lang/en\" title=\"http://www.faqts.com/knowledge_base/view.phtml/aid/1608/fid/125/lang/en\" target=\"_blank\">only available to privileged code</a> and is obsolete; you should use the XPCOM <a title=\"en/Preferences_API\" rel=\"internal\" href=\"https://developer.mozilla.org/en/Preferences_API\">Preferences API</a> instead."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.navigator.appVersion","name":"appVersion","help":"Returns the version of the browser as a string. Do not rely on this property to return the correct value."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.navigator.appName","name":"appName","help":"Returns the official name of the browser. Do not rely on this property to return the correct value."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.navigator.cookieEnabled","name":"cookieEnabled","help":"Returns a boolean indicating whether cookies are enabled in the browser or not."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.navigator.productSub","name":"productSub","help":"Returns the build number of the current browser (e.g. \"20060909\")"},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.navigator.userAgent","name":"userAgent","help":"Returns the user agent string for the current browser."},{"name":"webkitBattery","help":"Returns a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/window.navigator.mozBattery\">battery</a></code>\n object you can use to get information about the battery charging status.","obsolete":false},{"obsolete":false,"url":"https://developer.mozilla.org/Article_not_found?uri=en/DOM/window.navigator.securitypolicy","name":"securitypolicy","help":"Returns an empty string. In Netscape 4.7x, returns \"US &amp; CA domestic policy\" or \"Export policy\"."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.navigator.buildID","name":"buildID","help":"Returns the build identifier of the browser (e.g. \"2006090803\")"},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.navigator.vendor","name":"vendor","help":"Returns the vendor name of the current browser (e.g. \"Netscape6\")"},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/navigator.doNotTrack","name":"doNotTrack","help":"Reports the value of the user's do-not-track preference. When this value is \"yes\", your web site or application should not track the user."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.navigator.appCodeName","name":"appCodeName","help":"Returns the internal \"code\" name of the current browser. Do not rely on this property to return the correct value."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/navigator.id","name":"id","help":"Returns the <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/window.navigator.id\" class=\"new\">id</a></code>\n object which you can use to add support for <a title=\"BrowserID\" rel=\"internal\" href=\"https://developer.mozilla.org/en/BrowserID\">BrowserID</a> to your web site."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.navigator.onLine","name":"onLine","help":"Returns a boolean indicating whether the browser is working online."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.navigator.vendorSub","name":"vendorSub","help":"Returns the vendor version number (e.g. \"6.1\")"},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.navigator.mimeTypes","name":"mimeTypes","help":"Returns a list of the MIME types supported by the browser."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.navigator.plugins","name":"plugins","help":"Returns an array of the plugins installed in the browser."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.navigator.platform","name":"platform","help":"Returns a string representing the platform of the browser."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.navigator.language","name":"language","help":"Returns a string representing the language version of the browser."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.navigator.product","name":"product","help":"Returns the product name of the current browser. (e.g. \"Gecko\")"},{"obsolete":false,"url":"https://developer.mozilla.org/en/API/Mouse_Lock_API","name":"webkitPointer","help":"Returns a PointerLock object for the <a title=\"Mouse Lock API\" rel=\"internal\" href=\"https://developer.mozilla.org/en/API/Mouse_Lock_API\">Mouse Lock API</a>."},{"name":"webkitNotification","help":"<dt><code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/navigator.webkitNotification\" class=\"new\">navigator.webkitNotification</a></code>\n</dt> <dd>Returns a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/navigator.mozNotification\">notification</a></code>\n object you can use to deliver notifications to the user from your web application.</dd>","obsolete":false},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.navigator.oscpu","name":"oscpu","help":"Returns a string that represents the current operating system."}]},"SVGViewElement":{"title":"SVGViewElement","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody>\n</table>\n</div>\n<div id=\"compat-mobile\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody>\n</table>\n</div>","srcUrl":"https://developer.mozilla.org/en/DOM/SVGViewElement","seeAlso":"<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/view\">&lt;view&gt;</a></code>\n SVG Element","summary":"The <code>SVGViewElement</code> interface provides access to the properties of <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/view\">&lt;view&gt;</a></code>\n elements, as well as methods to manipulate them.","members":[{"name":"viewTarget","help":"Corresponds to attribute \n<code><a rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Attribute/viewTarget\" class=\"new\">viewTarget</a></code> on the given <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/view\">&lt;view&gt;</a></code>\n element. A list of DOMString values which contain the names listed in the \n<code><a rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Attribute/viewTarget\" class=\"new\">viewTarget</a></code> attribute. Each of the DOMString values can be associated with the corresponding element using the getElementById() method call.","obsolete":false}]},"Text":{"title":"Text","summary":"<p>In the <a title=\"en/DOM\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM\">DOM</a>, the Text interface represents the textual content of an <a class=\"internal\" title=\"En/DOM/Element\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/element\">Element</a> or <a class=\"internal\" title=\"En/DOM/Attr\" rel=\"internal\" href=\"https://developer.mozilla.org/En/DOM/Attr\">Attr</a>.&nbsp; If an element has no markup within its content, it has a single child implementing Text that contains the element's text.&nbsp; However, if the element contains markup, it is parsed into information items and Text nodes that form its children.</p>\n<p>New documents have a single Text node for each block of text.&nbsp; Over time, more Text nodes may be created as the document's content changes.&nbsp; The <code>Node.normalize()</code>&nbsp;method merges adjacent Text objects back into a single node for each block of text.</p>\n<p>Text also implements the <a title=\"En/DOM/CharacterData\" rel=\"internal\" href=\"https://developer.mozilla.org/En/DOM/CharacterData\">CharacterData</a> interface (which implements the Node interface).</p>","members":[{"obsolete":false,"url":"https://developer.mozilla.org/En/DOM/Text.replaceWholeText","name":"replaceWholeText","help":"Replaces the text of the current node and all logically adjacent nodes with the specified text. <div class=\"note\"><strong>Note: </strong>Do not use this method as it has been removed from the standard and is no longer implemented in recent browsers, like Firefox 10.</div>"},{"obsolete":false,"url":"https://developer.mozilla.org/En/DOM/Text.splitText","name":"splitText","help":"Breaks the node into two nodes at a specified offset."},{"url":"https://developer.mozilla.org/En/DOM/Text.isElementContentWhitespace","name":"isElementContentWhitespace","help":"<p>Returns whether or not the text node contains only whitespace.&nbsp; Read only.</p> <div class=\"note\"><strong>Note: </strong>Do not use this property as it has been removed from the standard and is no longer implemented in recent browsers, like Firefox 10.</div>","obsolete":false},{"url":"https://developer.mozilla.org/En/DOM/Text.wholeText","name":"wholeText","help":"Returns all text of all Text nodes logically adjacent to this node, concatenated in document order.","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/DOM/Text","specification":"http://www.w3.org/TR/DOM-Level-3-Cor...#ID-1312295772"},"SVGAnimatedTransformList":{"title":"SVGAnimatedTransformList","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td>9.0 (9.0)\n</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Not supported.\">--</span></td> <td>9.0 (9.0)\n</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>","summary":"The <code>SVGAnimatedTransformList</code> interface is used for attributes which take a list of numbers and which can be animated.","members":[{"name":"baseVal","help":"The base value of the given attribute before applying any animations.","obsolete":false},{"name":"animVal","help":"A read only <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/SVGTransformList\">SVGTransformList</a></code>\n representing the current animated value of the given attribute. If the given attribute is not currently being animated, then the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/SVGTransformList\">SVGTransformList</a></code>\n will have the same contents as <code>baseVal</code>. The object referenced by <code>animVal</code> will always be distinct from the one referenced by <code>baseVal</code>, even when the attribute is not animated.","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/DOM/SVGAnimatedTransformList"},"PerformanceNavigation":{"title":"Navigation Timing","members":[],"srcUrl":"https://developer.mozilla.org/en/Navigation_timing","skipped":true,"cause":"Suspect title"},"SVGPathElement":{"title":"SVGPathElement","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>","srcUrl":"https://developer.mozilla.org/en/DOM/SVGPathElement","seeAlso":"<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/path\">&lt;path&gt;</a></code>\n SVG Element","summary":"The <code>SVGPathElement</code> interface corresponds to the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/path\">&lt;path&gt;</a></code>\n element.","members":[{"name":"getTotalLength","help":"Returns the computed value for the total length of the path using the browser's distance-along-a-path algorithm, as a distance in the current user coordinate system.","obsolete":false},{"name":"getPointAtLength","help":"Returns the (x,y) coordinate in user space which is distance units along the path, utilizing the browser's distance-along-a-path algorithm.","obsolete":false},{"name":"getPathSegAtLength","help":"Returns the index into <code>pathSegList</code> which is <code>distance</code> units along the path, utilizing the user agent's distance-along-a-path algorithm.","obsolete":false},{"name":"createSVGPathSegClosePath","help":"Returns a stand-alone, parentless <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/SVGPathSegClosePath\" class=\"new\">SVGPathSegClosePath</a></code>\n object.","obsolete":false},{"name":"createSVGPathSegMovetoAbs","help":"Returns a stand-alone, parentless <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/SVGPathSegMovetoAbs\" class=\"new\">SVGPathSegMovetoAbs</a></code>\n object.<br> <br> <strong>Parameters:</strong> <ul> <li><code>float <em>x</em></code><br> The absolute X coordinate for the end point of this path segment.</li> <li><code>float <em>y</em></code><br> The absolute Y coordinate for the end point of this path segment.</li> </ul>","obsolete":false},{"name":"createSVGPathSegMovetoRel","help":"Returns a stand-alone, parentless <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/SVGPathSegMovetoRel\" class=\"new\">SVGPathSegMovetoRel</a></code>\n object.<br> <br> <strong>Parameters:</strong> <ul> <li><code>float <em>x</em></code><br> The relative X coordinate for the end point of this path segment.</li> <li><code>float <em>y</em></code><br> The relative Y coordinate for the end point of this path segment.</li> </ul>","obsolete":false},{"name":"createSVGPathSegLinetoAbs","help":"Returns a stand-alone, parentless <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/SVGPathSegLinetoAbs\" class=\"new\">SVGPathSegLinetoAbs</a></code>\n object.<br> <br> <strong>Parameters:</strong> <ul> <li><code>float <em>x</em></code><br> The absolute X coordinate for the end point of this path segment.</li> <li><code>float <em>y</em></code><br> The absolute Y coordinate for the end point of this path segment.</li> </ul>","obsolete":false},{"name":"createSVGPathSegLinetoRel","help":"Returns a stand-alone, parentless <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/SVGPathSegLinetoRel\" class=\"new\">SVGPathSegLinetoRel</a></code>\n object.<br> <br> <strong>Parameters:</strong> <ul> <li><code>float <em>x</em></code><br> The relative X coordinate for the end point of this path segment.</li> <li><code>float <em>y</em></code><br> The relative Y coordinate for the end point of this path segment.</li> </ul>","obsolete":false},{"name":"createSVGPathSegCurvetoCubicAbs","help":"Returns a stand-alone, parentless <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/SVGPathSegCurvetoCubicAbs\" class=\"new\">SVGPathSegCurvetoCubicAbs</a></code>\n object.<br> <br> Parameters: <ul> <li><code>float <em>x</em></code><br> The absolute X coordinate for the end point of this path segment.</li> <li><code>float <em>y</em> </code><br> The absolute Y coordinate for the end point of this path segment.</li> <li><code>float <em>x1</em></code><br> The absolute X coordinate for the first control point.</li> <li><code>float <em>y1</em></code><br> The absolute Y coordinate for the first control point.</li> <li><code>float <em>x2</em></code><br> The absolute X coordinate for the second control point.</li> <li><code>float <em>y2</em></code><br> The absolute Y coordinate for the second control point.</li> </ul>","obsolete":false},{"name":"createSVGPathSegCurvetoCubicRel","help":"Returns a stand-alone, parentless <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/SVGPathSegCurvetoCubicRel\" class=\"new\">SVGPathSegCurvetoCubicRel</a></code>\n object.<br> <br> Parameters: <ul> <li><code>float <em>x</em></code><br> The relative X coordinate for the end point of this path segment.</li> <li><code>float <em>y</em> </code><br> The relative Y coordinate for the end point of this path segment.</li> <li><code>float <em>x1</em></code><br> The relative X coordinate for the first control point.</li> <li><code>float <em>y1</em></code><br> The relative Y coordinate for the first control point.</li> <li><code>float <em>x2</em></code><br> The relative X coordinate for the second control point.</li> <li><code>float <em>y2</em></code><br> The relative Y coordinate for the second control point.</li> </ul>","obsolete":false},{"name":"createSVGPathSegCurvetoQuadraticAbs","help":"Returns a stand-alone, parentless <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/SVGPathSegCurvetoQuadraticAbs\" class=\"new\">SVGPathSegCurvetoQuadraticAbs</a></code>\n object.<br> <br> Parameters: <ul> <li><code>float <em>x</em></code><br> The absolute X coordinate for the end point of this path segment.</li> <li><code>float <em>y</em> </code><br> The absolute Y coordinate for the end point of this path segment.</li> <li><code>float <em>x1</em></code><br> The absolute X coordinate for the first control point.</li> <li><code>float <em>y1</em></code><br> The absolute Y coordinate for the first control point.</li> </ul>","obsolete":false},{"name":"createSVGPathSegCurvetoQuadraticRel","help":"Returns a stand-alone, parentless <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/SVGPathSegCurvetoQuadraticRel\" class=\"new\">SVGPathSegCurvetoQuadraticRel</a></code>\n object.<br> <br> Parameters: <ul> <li><code>float <em>x</em></code><br> The relative X coordinate for the end point of this path segment.</li> <li><code>float <em>y</em> </code><br> The relative Y coordinate for the end point of this path segment.</li> <li><code>float <em>x1</em></code><br> The relative X coordinate for the first control point.</li> <li><code>float <em>y1</em></code><br> The relative Y coordinate for the first control point.</li> </ul>","obsolete":false},{"name":"createSVGPathSegArcAbs","help":"Returns a stand-alone, parentless <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/SVGPathSegArcAbs\" class=\"new\">SVGPathSegArcAbs</a></code>\n object.<br> <br> <strong>Parameters:</strong> <ul> <li><code>float <em>x</em></code><br> The absolute X coordinate for the end point of this path segment.</li> <li><code>float <em>y</em> </code><br> The absolute Y coordinate for the end point of this path segment.</li> <li><code>float <em>r1</em></code><br> The x-axis radius for the ellipse.</li> <li><code>float <em>r2 </em></code><br> The y-axis radius for the ellipse.</li> <li><code>float <em>angle </em></code><br> The rotation angle in degrees for the ellipse's x-axis relative to the x-axis of the user coordinate system.</li> <li><code>boolean <em>largeArcFlag </em></code><br> The value of the large-arc-flag parameter.</li> <li><code>boolean <em>sweepFlag </em></code><br> The value of the large-arc-flag parameter.</li> </ul>","obsolete":false},{"name":"createSVGPathSegArcRel","help":"Returns a stand-alone, parentless <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/SVGPathSegArcRel\" class=\"new\">SVGPathSegArcRel</a></code>\n object.<br> <br> <strong>Parameters:</strong> <ul> <li><code>float <em>x</em></code><br> The relative X coordinate for the end point of this path segment.</li> <li><code>float <em>y</em> </code><br> The relative Y coordinate for the end point of this path segment.</li> <li><code>float <em>r1</em></code><br> The x-axis radius for the ellipse.</li> <li><code>float <em>r2 </em></code><br> The y-axis radius for the ellipse.</li> <li><code>float <em>angle </em></code><br> The rotation angle in degrees for the ellipse's x-axis relative to the x-axis of the user coordinate system.</li> <li><code>boolean <em>largeArcFlag </em></code><br> The value of the large-arc-flag parameter.</li> <li><code>boolean <em>sweepFlag </em></code><br> The value of the large-arc-flag parameter.</li> </ul>","obsolete":false},{"name":"createSVGPathSegLinetoHorizontalAbs","help":"Returns a stand-alone, parentless <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/SVGPathSegLinetoHorizontalAbs\" class=\"new\">SVGPathSegLinetoHorizontalAbs</a></code>\n object.<br> <br> <strong>Parameters:</strong> <ul> <li><code>float <em>x</em></code><br> The absolute X coordinate for the end point of this path segment.</li> </ul>","obsolete":false},{"name":"createSVGPathSegLinetoHorizontalRel","help":"Returns a stand-alone, parentless <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/SVGPathSegLinetoHorizontalRel\" class=\"new\">SVGPathSegLinetoHorizontalRel</a></code>\n object.<br> <br> <strong>Parameters:</strong> <ul> <li><code>float <em>x</em></code><br> The relative X coordinate for the end point of this path segment.</li> </ul>","obsolete":false},{"name":"createSVGPathSegLinetoVerticalAbs","help":"Returns a stand-alone, parentless <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/SVGPathSegLinetoVerticalAbs\" class=\"new\">SVGPathSegLinetoVerticalAbs</a></code>\n object.<br> <br> <strong>Parameters:</strong> <ul> <li><code>float <em>y</em></code><br> The absolute Y coordinate for the end point of this path segment.</li> </ul>","obsolete":false},{"name":"createSVGPathSegLinetoVerticalRel","help":"Returns a stand-alone, parentless <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/SVGPathSegLinetoVerticalRel\" class=\"new\">SVGPathSegLinetoVerticalRel</a></code>\n object.<br> <br> <strong>Parameters:</strong> <ul> <li><code>float <em>y</em></code><br> The relative Y coordinate for the end point of this path segment.</li> </ul>","obsolete":false},{"name":"createSVGPathSegCurvetoCubicSmoothAbs","help":"Returns a stand-alone, parentless <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/SVGPathSegCurvetoCubicSmoothAbs\" class=\"new\">SVGPathSegCurvetoCubicSmoothAbs</a></code>\n object.<br> <br> Parameters <ul> <li><code>float <em>x </em></code><br> The absolute X coordinate for the end point of this path segment.</li> <li><code>float <em>y </em></code><br> The absolute Y coordinate for the end point of this path segment.</li> <li><code>float <em>x2 </em></code><br> The absolute X coordinate for the second control point.</li> <li><code>float <em>y2 </em></code><br> The absolute Y coordinate for the second control point.</li> </ul>","obsolete":false},{"name":"createSVGPathSegCurvetoCubicSmoothRel","help":"Returns a stand-alone, parentless <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/SVGPathSegCurvetoCubicSmoothRel\" class=\"new\">SVGPathSegCurvetoCubicSmoothRel</a></code>\n object.<br> <br> Parameters <ul> <li><code>float <em>x </em></code><br> The absolute X coordinate for the end point of this path segment.</li> <li><code>float <em>y </em></code><br> The absolute Y coordinate for the end point of this path segment.</li> <li><code>float <em>x2 </em></code><br> The absolute X coordinate for the second control point.</li> <li><code>float <em>y2 </em></code><br> The absolute Y coordinate for the second control point.</li> </ul>","obsolete":false},{"name":"createSVGPathSegCurvetoQuadraticSmoothAbs","help":"Returns a stand-alone, parentless <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/SVGPathSegCurvetoQuadraticSmoothAbs\" class=\"new\">SVGPathSegCurvetoQuadraticSmoothAbs</a></code>\n object.<br> <br> <strong>Parameters:</strong> <ul> <li><code>float <em>x</em></code><br> The absolute X coordinate for the end point of this path segment.</li> <li><code>float <em>y</em></code><br> The absolute Y coordinate for the end point of this path segment.</li> </ul>","obsolete":false},{"name":"createSVGPathSegCurvetoQuadraticSmoothRel","help":"Returns a stand-alone, parentless <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/SVGPathSegCurvetoQuadraticSmoothRel\" class=\"new\">SVGPathSegCurvetoQuadraticSmoothRel</a></code>\n object.<br> <br> <strong>Parameters:</strong> <ul> <li><code>float <em>x</em></code><br> The absolute X coordinate for the end point of this path segment.</li> <li><code>float <em>y</em></code><br> The absolute Y coordinate for the end point of this path segment.</li> </ul>","obsolete":false},{"name":"pathLength","help":"Corresponds to attribute \n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Attribute/pathLength\">pathLength</a></code> on the given <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/path\">&lt;path&gt;</a></code>\n element.","obsolete":false}]},"HTMLCanvasElement":{"title":"HTMLCanvasElement","examples":["<p>First do your drawing on the canvas, then call <code>canvas.toDataURL()</code> to get the data: URL for the canvas.</p>\n\n          <pre name=\"code\" class=\"js\">function test() {\n var canvas = document.getElementById(\"canvas\");\n var url = canvas.toDataURL();\n \n var newImg = document.createElement(\"img\");\n newImg.src = url;\n document.body.appendChild(newImg);\n}</pre>","<p>Once you've drawn content into a canvas, you can convert it into a file of any supported image format. The code snippet below, for example, takes the image in the canvas element whose ID&nbsp;is \"canvas\", obtains a copy of it as a PNG&nbsp;image, then appends a new <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/img\">&lt;img&gt;</a></code>\n element to the document, whose source image is the one created using the canvas.</p>\n\n          <pre name=\"code\" class=\"js\">function test() {\n var canvas = document.getElementById(\"canvas\");\n canvas.toBlob(function(blob) {\n    var newImg = document.createElement(\"img\"),\n        url = URL.createObjectURL(blob);\n    newImg.onload = function() {\n        // no longer need to read the blob so it's revoked\n        URL.revokeObjectURL(url);\n    };\n    newImg.src = url;\n    document.body.appendChild(newImg);\n });\n}</pre>\n        \n<p>You can use this technique in association with mouse events in order to dynamically change images (grayscale versus color in this example):</p>\n\n          <pre name=\"code\" class=\"xml\">&lt;!doctype html&gt;\n&lt;html&gt;\n&lt;head&gt;\n&lt;meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" /&gt;\n&lt;title&gt;MDC Example&lt;/title&gt;\n&lt;script type=\"text/javascript\"&gt;\nfunction showColorImg() {\n    this.style.display = \"none\";\n    this.nextSibling.style.display = \"inline\";\n}\n\nfunction showGrayImg() {\n    this.previousSibling.style.display = \"inline\";\n    this.style.display = \"none\";\n}\n\nfunction removeColors() {\n    var aImages = document.getElementsByClassName(\"grayscale\"), nImgsLen = aImages.length, oCanvas = document.createElement(\"canvas\"), oCtx = oCanvas.getContext(\"2d\");\n    for (var nWidth, nHeight, oImgData, oGrayImg, nPixel, aPix, nPixLen, nImgId = 0; nImgId &lt; nImgsLen; nImgId++) {\n        oColorImg = aImages[nImgId];\n        nWidth = oColorImg.offsetWidth;\n        nHeight = oColorImg.offsetHeight;\n        oCanvas.width = nWidth;\n        oCanvas.height = nHeight;\n        oCtx.drawImage(oColorImg, 0, 0);\n        oImgData = oCtx.getImageData(0, 0, nWidth, nHeight);\n        aPix = oImgData.data;\n        nPixLen = aPix.length;\n        for (nPixel = 0; nPixel &lt; nPixLen; nPixel += 4) {\n            aPix[nPixel + 2] = aPix[nPixel + 1] = aPix[nPixel] = (aPix[nPixel] + aPix[nPixel + 1] + aPix[nPixel + 2]) / 3;\n        }\n        oCtx.putImageData(oImgData, 0, 0);\n        oGrayImg = new Image();\n        oGrayImg.src = oCanvas.toDataURL();\n        oGrayImg.onmouseover = showColorImg;\n        oColorImg.onmouseout = showGrayImg;\n        oCtx.clearRect(0, 0, nWidth, nHeight);\n        oColorImg.style.display = \"none\";\n        oColorImg.parentNode.insertBefore(oGrayImg, oColorImg);\n    }\n}\n&lt;/script&gt;\n&lt;/head&gt;\n\n&lt;body onload=\"removeColors();\"&gt;\n&lt;p&gt;&lt;img class=\"grayscale\" src=\"chagall.jpg\" alt=\"\" /&gt;&lt;/p&gt;\n&lt;/body&gt;\n&lt;/html&gt;</pre>\n        \n<p>Note that here we're creating a PNG&nbsp;image; if you add a second parameter to the <code>toBlob()</code>&nbsp;call, you can specify the image type. For example, to get the image in JPEG format:</p>\n<pre class=\"deki-transform\"> canvas.toBlob(function(blob){...}, \"image/jpeg\", 0.95); // JPEG at 95% quality</pre>\n<p>\n<a rel=\"internal\" href=\"https://developer.mozilla.org/samples/domref/mozGetAsFile.html\" title=\"samples/domref/mozGetAsFile.html\" class=\" new\"><span>View the live example</span></a> (uses <code>mozGetAsFile()</code>)</p>"],"summary":"DOM&nbsp;canvas elements expose the <code><a class=\"external\" href=\"http://www.w3.org/TR/html5/the-canvas-element.html#htmlcanvaselement\" rel=\"external nofollow\" target=\"_blank\" title=\"http://www.w3.org/TR/html5/the-canvas-element.html#htmlcanvaselement\">HTMLCanvasElement</a></code> interface, which provides properties and methods for manipulating the layout and presentation of canvas elements. The <code>HTMLCanvasElement</code> interface inherits the properties and methods of the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/element\">element</a></code>\n object interface.","members":[{"name":"getContext","help":"Returns a drawing context on the canvas, or null if the context ID is not supported. A drawing context lets you draw on the canvas. The currently accepted values are \"2d\" and \"experimental-webgl\". The \"experimental-webgl\" context is only available on browsers that implement <a title=\"En/WebGL\" rel=\"internal\" href=\"https://developer.mozilla.org/en/WebGL\">WebGL</a>. Calling getContext with \"2d\" returns a <code><a href=\"https://developer.mozilla.org/en/DOM/CanvasRenderingContext2D\" rel=\"internal\">CanvasRenderingContext2D</a></code> Object, whereas calling it with \"experimental-webgl\" returns a <code>WebGLRenderingContext</code> Object.","obsolete":false},{"name":"toDataURL","help":"<p>Returns a <code>data:</code> URL containing a representation of the image in the format specified by <code>type</code> (defaults to PNG).</p> <ul> <li>If the height or width of the canvas is 0, <code>\"data:,</code>\" representing the empty string, is returned.</li> <li>If the type requested is not <code>image/png</code>, and the returned value starts with <code>data:image/png</code>, then the requested type is not supported.</li> <li>Chrome supports the&nbsp;<code>image/webp&nbsp;</code>type.</li> <li>If the requested type is <code>image/jpeg&nbsp;</code>or&nbsp;<code>image/webp</code>, then the second argument, if it is between 0.0 and 1.0, is treated as indicating image quality; if the second argument is anything else, the default value for image quality is used. Other arguments are ignored.</li> </ul>","obsolete":false},{"name":"webkitGetAsFile","help":"Returns a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/File\">File</a></code>\n object representing the image contained in the canvas; this file is a memory-based file, with the specified <code>name</code> and. If <code>type</code> is not specified, the image type is <code>image/png</code>.","obsolete":false},{"name":"height","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/canvas#attr-height\">height</a></code>\n HTML attribute, specifying the height of the coordinate space in CSS pixels.","obsolete":false},{"name":"width","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/canvas#attr-width\">width</a></code>\n HTML attribute, specifying the width of the coordinate space in CSS pixels.","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/DOM/HTMLCanvasElement"},"SVGAltGlyphElement":{"title":"altGlyph","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr>\n\n</tr><tr><th scope=\"col\">Feature</th><th scope=\"col\">Chrome</th><th scope=\"col\">Firefox (Gecko)</th><th scope=\"col\">Internet Explorer</th><th scope=\"col\">Opera</th><th scope=\"col\">Safari</th></tr> <tr><td>Basic support</td> <td>1.0</td> <td>4.0 (2.0)\n <a href=\"#supportGecko\">[1]</a></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td>\n10.6</td> <td>\n4.0</td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE&nbsp;Phone</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td>4.0 (2.0)\n <a href=\"#supportGecko\">[1]</a></td> <td><span title=\"Not supported.\">--</span></td> <td>11.0\n</td> <td>\n4.0</td> </tr> </tbody> </table>\n</div>\n<p id=\"supportGecko\">[1] partial support, see <a href=\"https://bugzilla.mozilla.org/show_bug.cgi?id=456286\" rel=\"external\">bug 456286</a> and <a href=\"https://bugzilla.mozilla.org/show_bug.cgi?id=571808\" rel=\"external\">bug 571808</a>.</p>\n<p>The chart is based on <a title=\"en/SVG/Compatibility sources\" rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Compatibility_sources\">these sources</a>.</p>","srcUrl":"https://developer.mozilla.org/en/SVG/Element/altGlyph","seeAlso":"<li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/tspan\">&lt;tspan&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/glyph\">&lt;glyph&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/altGlyphDef\">&lt;altGlyphDef&gt;</a></code>\n</li>","summary":"The <code>altGlyph</code> element allows sophisticated selection of the glyphs used to render its child character data.","members":[{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/format","name":"format","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/rotate","name":"rotate","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/dx","name":"dx","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/class","name":"class","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/glyphRef","name":"glyphRef","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/dy","name":"dy","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/externalResourcesRequired","name":"externalResourcesRequired","help":"Specific attributes"},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/style","name":"style","help":""}]},"DeviceOrientationEvent":{"title":"DeviceOrientationEvent","examples":["if (window.DeviceOrientationEvent) {\n    window.addEventListener(\"deviceorientation\", function( event ) {\n\t//alpha: rotation around z-axis\n\tvar rotateDegrees = event.alpha;\n\t//gamma: left to right\n\tvar leftToRight = event.gamma;\n\t//beta: front back motion\n\tvar frontToBack = event.beta;\n\t\t\t\t \n\thandleOrientationEvent( frontToBack, leftToRight, rotateDegrees );\n    }, false);\n}\n\nvar handleOrientationEvent = function( frontToBack, leftToRight, rotateDegrees ){\n    //do something amazing\n};"],"srcUrl":"https://developer.mozilla.org/en/DOM/DeviceOrientationEvent","specification":"DeviceOrientation specification","seeAlso":"<li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DeviceMotionEvent\">DeviceMotionEvent</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/window.ondeviceorientation\">window.ondeviceorientation</a></code>\n</li> <li><a title=\"Detecting device orientation\" rel=\"internal\" href=\"https://developer.mozilla.org/en/Detecting_device_orientation\">Detecting device orientation</a></li> <li><a title=\"Orientation and motion data explained\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/Orientation_and_motion_data_explained\">Orientation and motion data explained</a></li>","summary":"A <code>DeviceOrientationEvent</code> object describes an event that provides information about the current orientation of the device as compared to the Earth coordinate frame. See <a title=\"Orientation and motion data explained\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/Orientation_and_motion_data_explained\">Orientation and motion data explained</a> for details.","members":[{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/DeviceOrientationEvent.alpha","name":"alpha","help":"The current orientation of the device around the Z axis; that is, how far the device is rotated around a line perpendicular to the device. <strong>Read only.</strong>"},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/DeviceOrientationEvent.absolute","name":"absolute","help":"This attribute's value is <code>true</code> if the orientation is provided as a difference between the device coordinate frame and the Earth coordinate frame; if the device can't detect the Earth coordinate frame, this value is <code>false</code>. <strong>Read only.</strong>"},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/DeviceOrientationEvent.beta","name":"beta","help":"The current orientation of the device around the X axis; that is, how far the device is tipped forward or backward. <strong>Read only.</strong>"},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/DeviceOrientationEvent.gamma","name":"gamma","help":"<dl><dd>The current orientation of the device around the Y axis; that is, how far the device is turned left or right. <strong>Read only.</strong></dd>\n</dl>\n<div class=\"note\"><strong>Note:</strong> If the browser is not able to provide notification information, all values are 0.</div>"}]},"Geolocation":{"title":"nsIDOMGeoGeolocation","members":[{"name":"getCurrentPosition","help":"<p>Acquires the user's current position via a new position object. If this fails, <code>errorCallback</code> is invoked with an <code>nsIDOMGeoPositionError</code> argument.</p>\n\n<div id=\"section_8\"><span id=\"Parameters_2\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>successCallback</code></dt> <dd>An <code><a class=\"internal\" title=\"En/NsIDOMGeoPositionCallback\" rel=\"internal\" href=\"https://developer.mozilla.org/en/XPCOM_Interface_Reference/NsIDOMGeoPositionCallback\">nsIDOMGeoPositionCallback</a></code> to be called when the current position is available.</dd>\n</dl>\n<dl> <dt><code>errorCallback</code></dt> <dd>An <code><a class=\"internal\" title=\"En/NsIDOMGeoPositionErrorCallback\" rel=\"internal\" href=\"https://developer.mozilla.org/en/XPCOM_Interface_Reference/NsIDOMGeoPositionErrorCallback\"> nsIDOMGeoPositionErrorCallback</a></code> that is called if an error occurs while retrieving the position; this parameter is optional.</dd>\n</dl>\n<dl> <dt><code>options</code></dt> <dd>An <code><a class=\"internal\" title=\"En/NsIDOMGeoPositionOptions\" rel=\"internal\" href=\"https://developer.mozilla.org/en/XPCOM_Interface_Reference/NsIDOMGeoPositionOptions\">nsIDOMGeoPositionOptions</a></code> object specifying options; this parameter is optional.</dd>\n</dl>\n</div>","idl":"<pre>void getCurrentPosition(\n&nbsp;&nbsp;in nsIDOMGeoPositionCallback successCallback,\n&nbsp;&nbsp;[optional] in nsIDOMGeoPositionErrorCallback errorCallback, \n &nbsp;[optional] in nsIDOMGeoPositionOptions options\n);</pre>","obsolete":false},{"name":"clearWatch","help":"When the <code>clearWatch()</code> method is called, the <code>watch()</code> process stops calling for new position identifiers and cease invoking callbacks.","idl":"<pre>void clearWatch(\n&nbsp;&nbsp;in unsigned short watchId\n);</pre>","obsolete":false},{"name":"watchPosition","help":"<p>Similar to <a title=\"En/NsIDOMGeoGeolocation#getCurrentPosition()\" class=\"internal\" rel=\"internal\" href=\"https://developer.mozilla.org/en/XPCOM_Interface_Reference/NsIDOMGeoGeolocation#getCurrentPosition()\"><code>getCurrentPosition()</code></a>, except it continues to call the callback with updated position information periodically until <a title=\"En/NsIDOMGeoGeolocation#clearWatch()\" class=\"internal\" rel=\"internal\" href=\"https://developer.mozilla.org/en/XPCOM_Interface_Reference/NsIDOMGeoGeolocation#clearWatch()\"><code>clearWatch()</code></a>&nbsp;is called.</p>\n\n<div id=\"section_10\"><span id=\"Parameters_3\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>successCallback</code></dt> <dd>An <code><a class=\"internal\" title=\"En/NsIDOMGeoPositionCallback\" rel=\"internal\" href=\"https://developer.mozilla.org/en/XPCOM_Interface_Reference/NsIDOMGeoPositionCallback\">nsIDOMGeoPositionCallback</a></code> that is to be called whenever new position information is available.</dd>\n</dl>\n<dl> <dt><code>errorCallback</code></dt> <dd>An <code><a class=\"internal\" title=\"En/NsIDOMGeoPositionErrorCallback\" rel=\"internal\" href=\"https://developer.mozilla.org/en/XPCOM_Interface_Reference/NsIDOMGeoPositionErrorCallback\"> nsIDOMGeoPositionErrorCallback</a></code> to call when an error occurs; this is an optional parameter.</dd>\n</dl>\n<dl> <dt><code>options</code></dt> <dd>An <code><a class=\"internal\" title=\"En/NsIDOMGeoPositionOptions\" rel=\"internal\" href=\"https://developer.mozilla.org/en/XPCOM_Interface_Reference/NsIDOMGeoPositionOptions\">nsIDOMGeoPositionOptions</a></code> object specifying options; this parameter is optional.</dd>\n</dl>\n</div><div id=\"section_11\"><span id=\"Return_value\"></span><h6 class=\"editable\">Return value</h6>\n<p>An ID&nbsp;number that can be used to reference the watcher in the future when calling <code><a title=\"en/nsIDOMGeolocation#clearWatch()\" class=\"internal\" rel=\"internal\" href=\"https://developer.mozilla.org/en/XPCOM_Interface_Reference/NsIDOMGeoGeolocation#clearWatch()\">clearWatch()</a></code>.</p>\n</div>","idl":"<pre>unsigned short watchPosition(\n&nbsp;&nbsp;in nsIDOMGeoPositionCallback successCallback,\n&nbsp;&nbsp;[optional] in nsIDOMGeoPositionErrorCallback errorCallback,\n&nbsp;&nbsp;[optional] in nsIDOMGeoPositionOptions options\n);</pre>","obsolete":false},{"name":"lastPosition","help":"The most recently retrieved location as seen by the provider. May be <code>null</code>. <strong>Read only.</strong>","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/nsIDOMGeolocation;"},"SVGPathSegCurvetoQuadraticRel":{"title":"SVGPathElement","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/SVGPathElement","skipped":true,"cause":"Suspect title"},"SVGFitToViewBox":{"title":"SVGPatternElement","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/SVGPatternElement","skipped":true,"cause":"Suspect title"},"SVGAnimatedLengthList":{"title":"SVGAnimatedLengthList","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody>\n</table>\n</div>\n<div id=\"compat-mobile\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody>\n</table>\n</div>","summary":"The <code>SVGAnimatedLengthList</code> interface is used for attributes of type <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/SVGLengthList\">SVGLengthList</a></code>\n which can be animated.","members":[{"name":"baseVal","help":"The base value of the given attribute before applying any animations.","obsolete":false},{"name":"animVal","help":"A read only <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/SVGLengthList\">SVGLengthList</a></code>\n representing the current animated value of the given attribute. If the given attribute is not currently being animated, then the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/SVGLengthList\">SVGLengthList</a></code>\n will have the same contents as <code>baseVal</code>. The object referenced by <code>animVal</code> will always be distinct from the one referenced by <code>baseVal</code>, even when the attribute is not animated.","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/DOM/SVGAnimatedLengthList"},"HTMLTableCellElement":{"title":"td","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari</th> </tr> <tr> <td>Basic support</td> <td>1.0</td> <td>1.0 (1.7 or earlier)\n</td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> <tr> <td><code>align/valign</code> attribute</td> <td>1.0</td> <td><span title=\"Not supported.\">--</span> <a rel=\"external\" href=\"https://bugzilla.mozilla.org/show_bug.cgi?id=915\" class=\"external\" title=\"\">\nbug 915</a>\n</td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> <tr> <td><code>char/charoff</code> attribute</td> <td>1.0</td> <td><span title=\"Not supported.\">--</span> <a rel=\"external\" href=\"https://bugzilla.mozilla.org/show_bug.cgi?id=2212\" class=\"external\" title=\"\">\nbug 2212</a>\n</td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> <tr> <td><code>bgcolor</code> attribute      </td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td>1.0 (1.0)\n</td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> <tr> <td><code>align/valign</code> attribute</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Not supported.\">--</span> <a rel=\"external\" href=\"https://bugzilla.mozilla.org/show_bug.cgi?id=915\" class=\"external\" title=\"\">\nbug 915</a>\n</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>char/charoff</code> attribute</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Not supported.\">--</span> <a rel=\"external\" href=\"https://bugzilla.mozilla.org/show_bug.cgi?id=2212\" class=\"external\" title=\"\">\nbug 2212</a>\n</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>bgcolor</code> attribute      </td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> </tr> </tbody> </table>\n</div>","examples":["Please see the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/table\">&lt;table&gt;</a></code>\n page for examples on <code>&lt;td&gt;</code>."],"srcUrl":"https://developer.mozilla.org/en/HTML/Element/td","seeAlso":"Other table-related HTML&nbsp;Elements: <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/caption\">&lt;caption&gt;</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/col\">&lt;col&gt;</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/colgroup\">&lt;colgroup&gt;</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/table\">&lt;table&gt;</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/tbody\">&lt;tbody&gt;</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/tfoot\">&lt;tfoot&gt;</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/th\">&lt;th&gt;</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/thead\">&lt;thead&gt;</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/tr\">&lt;tr&gt;</a></code>\n.","summary":"The <em>HTML Table Cell Element</em> (<code>&lt;td&gt;</code>) defines a cell that content data.","members":[{"obsolete":false,"url":"","name":"rowspan","help":"This attribute contains a non-negative integer value that indicates for how many rows the cell extends. Its default value is <span>1</span>; if its value is set to <span>0</span>, it extends until the end of the table section (<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/thead\">&lt;thead&gt;</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/tbody\">&lt;tbody&gt;</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/tfoot\">&lt;tfoot&gt;</a></code>\n, even if implicitly defined, that the cell belongs to. Values higher than 65534 are clipped down to 65534."},{"obsolete":false,"url":"","name":"valign","help":"This attribute specifies the vertical alignment of the text within each row of cells of the table header. Possible values for this attribute are: <ul> <li><span>baseline</span>, which will put the text as close to the bottom of the cell as it is possible, but align it on the <a class=\"external\" title=\"http://en.wikipedia.org/wiki/Baseline_(typography)\" rel=\"external\" href=\"http://en.wikipedia.org/wiki/Baseline_%28typography%29\" target=\"_blank\">baseline</a> of the characters instead of the bottom of them. If characters are all of the size, this has the same effect as <span>bottom</span>.</li> <li><span>bottom</span>, which will put the text as close to the bottom of the cell as it is possible;</li> <li><span>middle</span>, which will center the text in the cell;</li> <li>and <span>top</span>, which will put the text as close to the top of the cell as it is possible.</li> </ul> <div class=\"note\"><strong>Note: </strong>Do not use this attribute as it is obsolete (and not supported) in the latest standard: instead set the CSS&nbsp;<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/CSS/vertical-align\">vertical-align</a></code>\n property on it.</div>"},{"obsolete":false,"url":"","name":"bgcolor","help":"This attribute defines the background color of each cell of the column. It is one of the 6-digit hexadecimal codes as defined in <a class=\"external\" title=\"http://www.w3.org/Graphics/Color/sRGB\" rel=\"external\" href=\"http://www.w3.org/Graphics/Color/sRGB\" target=\"_blank\">sRGB</a>, prefixed by a '#'. One of the sixteen predefined color strings may be used: <table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"10\" summary=\"Table of color names and their sRGB values\" width=\"80%\"> <tbody> <tr> <td>&nbsp;</td> <td><span>black</span> = \"#000000\"</td> <td>&nbsp;</td> <td><span>green</span> = \"#008000\"</td> </tr> <tr> <td>&nbsp;</td> <td><span>silver</span> = \"#C0C0C0\"</td> <td>&nbsp;</td> <td><span>lime</span> = \"#00FF00\"</td> </tr> <tr> <td>&nbsp;</td> <td><span>gray</span> = \"#808080\"</td> <td>&nbsp;</td> <td><span>olive</span> = \"#808000\"</td> </tr> <tr> <td>&nbsp;</td> <td><span>white</span> = \"#FFFFFF\"</td> <td>&nbsp;</td> <td><span>yellow</span> = \"#FFFF00\"</td> </tr> <tr> <td>&nbsp;</td> <td><span>maroon</span> = \"#800000\"</td> <td>&nbsp;</td> <td><span>navy</span> = \"#000080\"</td> </tr> <tr> <td>&nbsp;</td> <td><span>red</span> = \"#FF0000\"</td> <td>&nbsp;</td> <td><span>blue</span> = \"#0000FF\"</td> </tr> <tr> <td>&nbsp;</td> <td><span>purple</span> = \"#800080\"</td> <td>&nbsp;</td> <td><span>teal</span> = \"#008080\"</td> </tr> <tr> <td>&nbsp;</td> <td><span>fuchsia</span> = \"#FF00FF\"</td> <td>&nbsp;</td> <td><span>aqua</span> = \"#00FFFF\"</td> </tr> </tbody> </table> <div class=\"note\"><strong>Usage note:&nbsp;</strong>Do not use this attribute, as it is non-standard and only implemented some versions of Microsoft Internet Explorer: the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/td\">&lt;td&gt;</a></code>\n element should be styled using <a title=\"en/CSS\" rel=\"internal\" href=\"https://developer.mozilla.org/en/CSS\">CSS</a>. To give a similar effect to the <strong>bgcolor</strong> attribute, use the <a title=\"en/CSS\" rel=\"internal\" href=\"https://developer.mozilla.org/en/CSS\">CSS</a> property <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/CSS/background-color\">background-color</a></code>\n instead.</div>"},{"obsolete":false,"url":"","name":"headers","help":"This attributes a list of space-separated strings, each corresponding to the <strong>id</strong> attribute of the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/th\">&lt;th&gt;</a></code>\n elements that applies to this element."},{"obsolete":false,"url":"","name":"align","help":"This enumerated attribute specifies how horizontal alignment of each cell content will be handled. Possible values are: <ul> <li><span>left</span>, aligning the content to the left of the cell</li> <li><span>center</span>, centering the content in the cell</li> <li><span>right</span>, aligning the content to the right of the cell</li> <li><span>justify</span>, inserting spaces into the textual content so that the content is justified in the cell</li> <li><span>char</span>, aligning the textual content on a special character with a minimal offset, defined by the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/td#attr-char\">char</a></code>\n and \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/td#attr-charoff\">charoff</a></code>\n attributes \n<span class=\"unimplementedInlineTemplate\">Unimplemented (see<a rel=\"external\" href=\"https://bugzilla.mozilla.org/show_bug.cgi?id=2212\" class=\"external\" title=\"\">\nbug 2212</a>\n)</span>\n.</li> </ul> <p>If this attribute is not set,&nbsp; the <span>left</span> value is assumed.</p> <div class=\"note\"><strong>Note: </strong>Do not use this attribute as it is obsolete (not supported) in the latest standard. <ul> <li>To achieve the same effect as the <span>left</span>, <span>center</span>, <span>right</span> or <span>justify</span> values, use the CSS <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/CSS/text-align\">text-align</a></code>\n property on it.</li> <li>To achieve the same effect as the <span>char</span> value, in CSS3, you can use the value of the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/td#attr-char\">char</a></code>\n as the value of the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/CSS/text-align\">text-align</a></code>\n property \n<span class=\"unimplementedInlineTemplate\">Unimplemented</span>\n.</li> </ul> </div>"},{"obsolete":false,"url":"","name":"scope","help":""},{"obsolete":false,"url":"","name":"axis","help":"This attribute contains a list of space-separated strings. Each string is the ID of a group of cells that this header applies to. <div class=\"note\"><strong>Note: </strong>Do not use this attribute as it is obsolete in the latest standard: instead use the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/td#attr-scope\">scope</a></code>\n attribute.</div>"},{"obsolete":false,"url":"","name":"abbr","help":"This attribute contains a short abbreviated description of the content of the cell. Some user-agents, such as speech readers, may present this description before the content itself. <div class=\"note\"><strong>Note: </strong>Do not use this attribute as it is obsolete in the latest standard: instead either consider starting the cell content by an independent abbreviated content itself or use the abbreviated content as the cell content and use the long content as the description of the cell by putting it in the <strong>title</strong> attribute.</div>"},{"obsolete":false,"url":"","name":"char","help":"This attribute is used to set the character to align the cells in a column on. Typical values for this include a period (.) when attempting to align numbers or monetary values. If \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/td#attr-align\">align</a></code>\n is not set to <span>char</span>, this attribute is ignored. <div class=\"note\"><strong>Note: </strong>Do not use this attribute as it is obsolete (and not supported) in the latest standard. To achieve the same effect as the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/thead#attr-char\">char</a></code>\n, in CSS3, you can use the character set using the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/th#attr-char\">char</a></code>\n attribute as the value of the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/CSS/text-align\">text-align</a></code>\n property \n<span class=\"unimplementedInlineTemplate\">Unimplemented</span>\n.</div>"},{"obsolete":false,"url":"","name":"colspan","help":"This attribute contains a non-negative integer value that indicates for how many columns the cell extends. Its default value is <span>1</span>; if its value is set to <span>0</span>, it extends until the end of the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/colgroup\">&lt;colgroup&gt;</a></code>\n, even if implicitly defined, that the cell belongs to. Values higher than 1000 are clipped down to 1000."},{"obsolete":false,"url":"","name":"charoff","help":"This attribute is used to indicate the number of characters to offset the column data from the alignment characters specified by the <strong>char</strong> attribute. <div class=\"note\"><strong>Note: </strong>Do not use this attribute as it is obsolete (and not supported) in the latest standard.</div>"}]},"DOMWindow":{"title":"window","seeAlso":"Working with windows in chrome code","summary":"<p>This section provides a brief reference for all of the methods, properties, and events available through the DOM <code>window</code> object. The <code>window</code> object implements the <code>Window</code> interface, which in turn inherits from the <code><a class=\"external\" rel=\"external\" href=\"http://www.w3.org/TR/DOM-Level-2-Views/views.html#Views-AbstractView\" title=\"http://www.w3.org/TR/DOM-Level-2-Views/views.html#Views-AbstractView\" target=\"_blank\">AbstractView</a></code> interface. Some additional global functions, namespaces objects, and constructors, not typically associated with the window, but available on it, are listed in the <a title=\"https://developer.mozilla.org/en/JavaScript/Reference\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript/Reference\">JavaScript Reference</a>.</p>\n<p>The <code>window</code> object represents the window itself. The <code>document</code> property of a <code>window</code> points to the <a title=\"en/DOM/document\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/document\">DOM document</a> loaded in that window. A window for a given document can be obtained using the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/document.defaultView\">document.defaultView</a></code>\n property.</p>\n<p>In a tabbed browser, such as Firefox, each tab contains its own <code>window</code> object (and if you're writing an extension, the browser window itself is a separate window too - see <a title=\"en/Working_with_windows_in_chrome_code#Content_windows\" rel=\"internal\" href=\"https://developer.mozilla.org/en/Working_with_windows_in_chrome_code#Content_windows\">Working with windows in chrome code</a> for more information). That is, the <code>window</code> object is not shared between tabs in the same window. Some methods, namely <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/window.resizeTo\">window.resizeTo</a></code>\n and <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/window.resizeBy\">window.resizeBy</a></code>\n apply to the whole window and not to the specific tab the <code>window</code> object belongs to. Generally, anything that can't reasonably pertain to a tab pertains to the window instead.</p>","members":[{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.captureEvents","name":"captureEvents","help":"Registers the window to capture all events of the specified type."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.showModalDialog","name":"showModalDialog","help":"Displays a modal dialog."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.routeEvent","name":"routeEvent","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.sizeToContent","name":"sizeToContent","help":"Sizes the window according to its content."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.scrollTo","name":"scrollTo","help":"Scrolls to a particular set of coordinates in the document."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.setTimeout","name":"setTimeout","help":"Sets a delay for executing a function."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.matchMedia","name":"matchMedia","help":"Returns a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/MediaQueryList\">MediaQueryList</a></code>\n object representing the specified media query string."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.minimize","name":"minimize","help":"Minimizes the window."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.scroll","name":"scroll","help":"Scrolls the window to a particular place in the document."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.clearTimeout","name":"clearTimeout","help":"Cancels the repeated execution set using <code>setTimeout</code>."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.setInterval","name":"setInterval","help":"Execute a function each X milliseconds."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.moveTo","name":"moveTo","help":"Moves the window to the specified coordinates."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.scrollByLines","name":"scrollByLines","help":"Scrolls the document by the given number of lines."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.alert","name":"alert","help":"Displays an alert dialog."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.dispatchEvent","name":"dispatchEvent","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.moveBy","name":"moveBy","help":"Moves the current window by a specified amount."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.btoa","name":"btoa","help":"Creates a base-64 encoded ASCII string from a string of binary data."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.releaseEvents","name":"releaseEvents","help":"Releases the window from trapping events of a specific type."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.find","name":"find","help":"Searches for a given string in a window."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.postMessage","name":"postMessage","help":"Provides a secure means for one window to send a string of data to another window, which need not be within the same domain as the first, in a secure manner."},{"obsolete":false,"url":"https://developer.mozilla.org/Article_not_found?uri=en/DOM/window.maximize","name":"maximize","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.escape","name":"escape","help":"Encodes a string."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.blur","name":"blur","help":"Sets focus away from the window."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.home","name":"home","help":"Returns the browser to the home page."},{"obsolete":false,"url":"https://developer.mozilla.org/Article_not_found?uri=en/DOM/window.disableExternalCapture","name":"disableExternalCapture","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.updateCommands","name":"updateCommands","help":"<dd>Updates the state of commands of the current chrome window (UI).</dd> <dt><a class=\"internal\" title=\"En/DOM/window.XPCNativeWrapper\" rel=\"internal\" href=\"https://developer.mozilla.org/en/XPCNativeWrapper\">window.XPCNativeWrapper</a></dt> <dt><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/window.XPCSafeJSObjectWrapper\">window.XPCSafeJSObjectWrapper</a></code>\n</dt>"},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.stop","name":"stop","help":"This method stops window loading."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.clearImmediate","name":"clearImmediate","help":"Cancels the repeated execution set using <code>setImmediate</code>."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.atob","name":"atob","help":"Decodes a string of data which has been encoded using base-64 encoding."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.focus","name":"focus","help":"Sets focus on the current window."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.prompt","name":"prompt","help":"<dd>Returns the text entered by the user in a prompt dialog.</dd> <dt><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/window.QueryInterface\">window.QueryInterface</a></code>\n</dt>"},{"obsolete":false,"url":"https://developer.mozilla.org/Article_not_found?uri=en/DOM/window.setResizable","name":"setResizable","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.getComputedStyle","name":"getComputedStyle","help":"Gets computed style for the specified element. Computed style indicates the computed values of all CSS properties of the element."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.clearInterval","name":"clearInterval","help":"Cancels the repeated execution set using <code>setInterval</code>."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.scrollBy","name":"scrollBy","help":"Scrolls the document in the window by the given amount."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.getAttention","name":"getAttention","help":"Flashes the application icon."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.openDialog","name":"openDialog","help":"Opens a new dialog window."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.open","name":"open","help":"Opens a new window."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.resizeTo","name":"resizeTo","help":"Dynamically resizes window."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.restore","name":"restore","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/Article_not_found?uri=en/DOM/window.getAttentionWithCycleCount","name":"getAttentionWithCycleCount","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.close","name":"close","help":"Closes the current window."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.print","name":"print","help":"Opens the Print Dialog to print the current document."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.dump","name":"dump","help":"Writes a message to the console."},{"obsolete":false,"url":"https://developer.mozilla.org/Article_not_found?uri=en/DOM/window.enableExternalCapture","name":"enableExternalCapture","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.forward","name":"forward","help":"<dd>Moves the window one document forward in the history.</dd> <dt><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/window.GeckoActiveXObject\">window.GeckoActiveXObject</a></code>\n</dt>"},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/element.removeEventListener","name":"removeEventListener","help":"Removes an event listener from the window."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.setImmediate","name":"setImmediate","help":"Execute a function after the browser has finished other heavy tasks"},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.setCursor","name":"setCursor","help":"Changes the cursor for the current window"},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.back","name":"back","help":"Moves back one in the window history."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.scrollByPages","name":"scrollByPages","help":"Scrolls the current document by the specified number of pages."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/element.addEventListener","name":"addEventListener","help":"Register an event handler to a specific event type on the window."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.unescape","name":"unescape","help":"Unencodes a value that has been encoded in hexadecimal (e.g. a cookie)."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.confirm","name":"confirm","help":"Displays a dialog with a message that the user needs to respond to."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.getSelection","name":"getSelection","help":"Returns the selection object representing the selected item(s)."},{"name":"webkitRequestAnimationFrame","help":"Tells the browser that an animation is in progress, requesting that the browser schedule a repaint of the window for the next animation frame. This will cause a <code>MozBeforePaint</code> event to fire before that repaint occurs.","obsolete":false},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.resizeBy","name":"resizeBy","help":"Resizes the current window by a certain amount."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.scrollX","name":"scrollX","help":"Returns the number of pixels that the document has already been scrolled horizontally."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/Storage#sessionStorage","name":"sessionStorage","help":"A storage object for storing data within a single page session."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.self","name":"self","help":"Returns an object reference to the window object itself."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.statusbar","name":"statusbar","help":"Returns the statusbar object, whose visibility can be toggled in the window."},{"name":"webkitAnimationStartTime","help":"The time in milliseconds since epoch at which the current animation cycle began.","obsolete":false},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.fullScreen","name":"fullScreen","help":"This property indicates whether the window is displayed in full screen or not."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.dialogArguments","name":"dialogArguments","help":"Gets the arguments passed to the window (if it's a dialog box) at the time <code><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/window.showModalDialog\">window.showModalDialog()</a></code>\n</code> was called. This is an <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsIArray\">nsIArray</a></code>\n."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.history","name":"history","help":"Returns a reference to the history object."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.outerWidth","name":"outerWidth","help":"Gets the width of the outside of the browser window."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.closed","name":"closed","help":"<dd>This property indicates whether the current window is closed or not.</dd> <dt><a title=\"en/Components_object\" rel=\"internal\" href=\"https://developer.mozilla.org/en/Components_object\">window.Components</a></dt> <dd>The entry point to many <a title=\"en/XPCOM\" rel=\"internal\" href=\"https://developer.mozilla.org/en/XPCOM\">XPCOM</a> features. Some properties, e.g. <a title=\"en/Components.classes\" rel=\"internal\" href=\"https://developer.mozilla.org/en/Components.classes\">classes</a>, are only available to sufficiently privileged code.</dd>"},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.directories","name":"directories","help":"Synonym of <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/window.personalbar\">window.personalbar</a></code>"},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.scrollX","name":"pageXOffset","help":"An alias for <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/window.scrollX\">window.scrollX</a></code>\n."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.top","name":"top","help":"<dd>Returns a reference to the topmost window in the window hierarchy. This property is read only.</dd> <dt><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/window.URL\">window.URL</a></code>\n \n<span title=\"(Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1)\n\">Requires Gecko 2.0</span>\n</dt> <dd>A DOM&nbsp;URL&nbsp;object, which provides the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/window.URL.createObjectURL\">window.URL.createObjectURL()</a></code>\n and <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/window.URL.revokeObjectURL\">window.URL.revokeObjectURL()</a></code>\n methods.</dd>"},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.screenX","name":"screenX","help":"Returns the horizontal distance of the left border of the user's browser from the left side of the screen."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.content","name":"content","help":"Returns a reference to the content element in the current window. The variant with underscore is deprecated."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.scrollbars","name":"scrollbars","help":"Returns the scrollbars object, whose visibility can be toggled in the window."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.personalbar","name":"personalbar","help":"Returns the personalbar object, whose visibility can be toggled in the window."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.screen","name":"screen","help":"Returns a reference to the screen object associated with the window."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.defaultStatus","name":"defaultStatus","help":"Gets/sets the status bar text for the given window."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.screenY","name":"screenY","help":"Returns the vertical distance of the top border of the user's browser from the top side of the screen."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.messageManager","name":"messageManager","help":"Returns the <a title=\"en/The message manager\" rel=\"internal\" href=\"https://developer.mozilla.org/en/The_message_manager\">message manager</a> object for this window."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.toolbar","name":"toolbar","help":"Returns the toolbar object, whose visibility can be toggled in the window."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.length","name":"length","help":"Returns the number of frames in the window. See also <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/window.frames\">window.frames</a></code>\n."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.outerHeight","name":"outerHeight","help":"Gets the height of the outside of the browser window."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.scrollMaxY","name":"scrollMaxY","help":"The maximum offset that the window can be scrolled to vertically (i.e., the document height minus the viewport height)."},{"name":"webkitPaintCount","help":"Returns the number of times the current document has been rendered to the screen in this window. This can be used to compute rendering performance.","obsolete":false},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/Storage#localStorage","name":"localStorage","help":"Returns a reference to the local storage object used to store data that may only be accessed by the origin that created it."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.innerHeight","name":"innerHeight","help":"Gets the height of the content area of the browser window including, if rendered, the horizontal scrollbar."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.name","name":"name","help":"Gets/sets the name of the window."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.parent","name":"parent","help":"Returns a reference to the parent of the current window or subframe."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.innerWidth","name":"innerWidth","help":"Gets the width of the content area of the browser window including, if rendered, the vertical scrollbar."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.opener","name":"opener","help":"Returns a reference to the window that opened this current window."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.status","name":"status","help":"Gets/sets the text in the statusbar at the bottom of the browser."},{"obsolete":false,"url":"https://developer.mozilla.org/Article_not_found?uri=en/DOM/window.globalStorage","name":"globalStorage","help":"Multiple storage objects that are used for storing data across multiple pages. Note that this is non-standard; it is recommended that you use <a class=\"internal\" title=\"en/DOM/Storage#localStorage\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/Storage#localStorage\">window.localStorage</a> instead."},{"obsolete":false,"url":"https://developer.mozilla.org/Article_not_found?uri=en/DOM/window.returnValue","name":"returnValue","help":"The return value to be returned to the function that called <code><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/window.showModalDialog\">window.showModalDialog()</a></code>\n</code> to display the window as a modal dialog."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.locationbar","name":"locationbar","help":"Returns the locationbar object, whose visibility can be toggled in the window."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.navigator","name":"navigator","help":"Returns a reference to the navigator object."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.document","name":"document","help":"Returns a reference to the document that the window contains."},{"name":"webkitInnerScreenX","help":"Returns the horizontal (X)&nbsp;coordinate of the top-left corner of the window's viewport, in screen coordinates. This value is reported in CSS&nbsp;pixels. See <code>mozScreenPixelsPerCSSPixel</code> in <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsIDOMWindowUtils\">nsIDOMWindowUtils</a></code>\n for a conversion factor to adapt to screen pixels if needed.","obsolete":false},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.frames","name":"frames","help":"Returns an array of the subframes in the current window."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.menubar","name":"menubar","help":"Returns the menubar object, whose visibility can be toggled in the window."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.location","name":"location","help":"Gets/sets the location, or current URL, of the window object."},{"name":"webkitInnerScreenY","help":"Returns the vertical (Y)&nbsp;coordinate of the top-left corner of the window's viewport, in screen coordinates. This value is reported in CSS&nbsp;pixels. See <code>mozScreenPixelsPerCSSPixel</code> for a conversion factor to adapt to screen pixels if needed.","obsolete":false},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.applicationCache","name":"applicationCache","help":"An <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/nsIDOMOfflineResourceList\">nsIDOMOfflineResourceList</a></code>\n object providing access to the offline resources for the window."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.window","name":"window","help":"<dd>Returns a reference to the current window.</dd> <dt>window[0], window[1], etc.</dt> <dd>Returns a reference to the <code>window</code> object in the frames. See <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/window.frames\">window.frames</a></code>\n for more details.</dd>"},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.controllers","name":"controllers","help":"Returns the XUL controller objects for the current chrome window."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.frameElement","name":"frameElement","help":"Returns the element in which the window is embedded, or null if the window is not embedded."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.scrollY","name":"scrollY","help":"Returns the number of pixels that the document has already been scrolled vertically."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.scrollMaxX","name":"scrollMaxX","help":"<dd>The maximum offset that the window can be scrolled to horizontally.</dd> <dd>(i.e., the document width minus the viewport width)</dd>"},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.sidebar","name":"sidebar","help":"Returns a reference to the window object of the sidebar."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.pkcs11","name":"pkcs11","help":"Formerly provided access to install and remove PKCS11 modules. Now this property is always null."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.crypto","name":"crypto","help":"Returns the browser crypto object."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.scrollY","name":"pageYOffset","help":"An alias for <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/window.scrollY\">window.scrollY</a></code>"},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.onabort","name":"onabort","help":"An event handler property for abort events on the window."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.onclose","name":"onclose","help":"An event handler property for handling the window close event."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.onmousemove","name":"onmousemove","help":"An event handler property for mousemove events on the window."},{"obsolete":false,"url":"https://developer.mozilla.org/Article_not_found?uri=en/DOM/window.onpageshow","name":"onpageshow","help":"An event handler property for pageshow events on the window."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.onunload","name":"onunload","help":"An event handler property for unload events on the window."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.onkeydown","name":"onkeydown","help":"An event handler property for keydown events on the window."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.onsubmit","name":"onsubmit","help":"An event handler property for submits on window forms."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.onblur","name":"onblur","help":"An event handler property for blur events on the window."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.onmouseout","name":"onmouseout","help":"An event handler property for mouseout events on the window."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.onload","name":"onload","help":"An event handler property for window loading."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.onscroll","name":"onscroll","help":"An event handler property for window scrolling."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.onresize","name":"onresize","help":"An event handler property for window resizing."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.ondragdrop","name":"ondragdrop","help":"An event handler property for drag and drop events on the window."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.onpopstate","name":"onpopstate","help":"An event handler property for popstate events, which are fired when navigating to a session history entry representing a state object."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.onbeforeunload","name":"onbeforeunload","help":"An event handler property for before-unload events on the window."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.onmousedown","name":"onmousedown","help":"An event handler property for mousedown events on the window."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.onmouseup","name":"onmouseup","help":"An event handler property for mouseup events on the window."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.onhashchange","name":"onhashchange","help":"An event handler property for hash change events on the window; called when the part of the URL after the hash mark (\"#\") changes."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.onchange","name":"onchange","help":"An event handler property for change events on the window."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.onerror","name":"onerror","help":"An event handler property for errors raised on the window."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.onselect","name":"onselect","help":"An event handler property for window selection."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.onreset","name":"onreset","help":"An event handler property for reset events on the window."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.onmouseover","name":"onmouseover","help":"An event handler property for mouseover events on the window."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.onkeypress","name":"onkeypress","help":"An event handler property for keypress events on the window."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.onmozbeforepaint","name":"onmozbeforepaint","help":"An event handler property for the <code>MozBeforePaint</code> event, which is sent before repainting the window if the event has been requested by a call to the <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/window.mozRequestAnimationFrame\" class=\"new\">window.mozRequestAnimationFrame()</a></code>\n method."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.onclick","name":"onclick","help":"An event handler property for click events on the window."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.ondevicemotion","name":"ondevicemotion","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.onpaint","name":"onpaint","help":"An event handler property for paint events on the window."},{"obsolete":false,"url":"https://developer.mozilla.org/Article_not_found?uri=en/DOM/window.onpagehide","name":"onpagehide","help":"An event handler property for pagehide events on the window."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.onfocus","name":"onfocus","help":"An event handler property for focus events on the window."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.onkeyup","name":"onkeyup","help":"An event handler property for keyup events on the window."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.ondeviceorientation","name":"ondeviceorientation","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.oncontextmenu","name":"oncontextmenu","help":"An event handler property for right-click events on the window."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.onabort","name":"onabort","help":"An event handler property for abort events on the window."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.onmousemove","name":"onmousemove","help":"An event handler property for mousemove events on the window."},{"obsolete":false,"url":"https://developer.mozilla.org/Article_not_found?uri=en/DOM/window.onpageshow","name":"onpageshow","help":"An event handler property for pageshow events on the window."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.onunload","name":"onunload","help":"An event handler property for unload events on the window."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.onkeydown","name":"onkeydown","help":"An event handler property for keydown events on the window."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.onsubmit","name":"onsubmit","help":"An event handler property for submits on window forms."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.onblur","name":"onblur","help":"An event handler property for blur events on the window."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.onmouseout","name":"onmouseout","help":"An event handler property for mouseout events on the window."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.onload","name":"onload","help":"An event handler property for window loading."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.onscroll","name":"onscroll","help":"An event handler property for window scrolling."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.onresize","name":"onresize","help":"An event handler property for window resizing."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.onpopstate","name":"onpopstate","help":"An event handler property for popstate events, which are fired when navigating to a session history entry representing a state object."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.onbeforeunload","name":"onbeforeunload","help":"An event handler property for before-unload events on the window."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.onmousedown","name":"onmousedown","help":"An event handler property for mousedown events on the window."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.onmouseup","name":"onmouseup","help":"An event handler property for mouseup events on the window."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.onhashchange","name":"onhashchange","help":"An event handler property for hash change events on the window; called when the part of the URL after the hash mark (\"#\") changes."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.onchange","name":"onchange","help":"An event handler property for change events on the window."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.onerror","name":"onerror","help":"An event handler property for errors raised on the window."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.onselect","name":"onselect","help":"An event handler property for window selection."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.onreset","name":"onreset","help":"An event handler property for reset events on the window."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.onmouseover","name":"onmouseover","help":"An event handler property for mouseover events on the window."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.onkeypress","name":"onkeypress","help":"An event handler property for keypress events on the window."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.onclick","name":"onclick","help":"An event handler property for click events on the window."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.ondevicemotion","name":"ondevicemotion","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/Article_not_found?uri=en/DOM/window.onpagehide","name":"onpagehide","help":"An event handler property for pagehide events on the window."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.onfocus","name":"onfocus","help":"An event handler property for focus events on the window."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.onkeyup","name":"onkeyup","help":"An event handler property for keyup events on the window."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.ondeviceorientation","name":"ondeviceorientation","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/window.oncontextmenu","name":"oncontextmenu","help":"An event handler property for right-click events on the window."}],"srcUrl":"https://developer.mozilla.org/en/DOM/window"},"HTMLOListElement":{"title":"ol","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p> <div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari</th> </tr> <tr> <td>Basic support</td> <td>1.0</td> <td>1.0 (1.7 or earlier)\n</td> <td>1.0</td> <td>1.0</td> <td>1.0</td> </tr> <tr> <td><code>reversed</code> attribute</td> <td><span title=\"Not supported.\">--</span> \n<a rel=\"external\" href=\"https://bugs.webkit.org/show_bug.cgi?id=36724\" class=\"external\" title=\"RESOLVED FIXED - Add support for &lt;ol reversed&gt;\">\nWebKit bug 36724</a></td> <td><span title=\"Not supported.\">--</span> <a rel=\"external\" href=\"https://bugzilla.mozilla.org/show_bug.cgi?id=601912\" class=\"external\" title=\"\">\nbug 601912</a>\n</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span> \n<a rel=\"external\" href=\"https://bugs.webkit.org/show_bug.cgi?id=36724\" class=\"external\" title=\"RESOLVED FIXED - Add support for &lt;ol reversed&gt;\">\nWebKit bug 36724</a></td> </tr> </tbody> </table> </div> <div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td>1.0 (1.0)\n</td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> <tr> <td><code>reversed</code> attribute</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span> <a rel=\"external\" href=\"https://bugzilla.mozilla.org/show_bug.cgi?id=601912\" class=\"external\" title=\"\">\nbug 601912</a>\n</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> </tr> </tbody> </table> </div>","examples":["<div id=\"section_6\"><span id=\"Simple_example\"></span><h4 class=\"editable\">Simple example</h4> \n          <pre name=\"code\" class=\"xml\">&lt;ol&gt;\n  &lt;li&gt;first item&lt;/li&gt;\n  &lt;li&gt;second item&lt;/li&gt;\n  &lt;li&gt;third item&lt;/li&gt;\n&lt;/ol&gt;</pre>\n         <p>Above HTML will output:</p> <ol> <li>first item</li> <li>second item</li> <li>third item</li> </ol> </div><div id=\"section_7\"><span id=\"Using_the_start_attribute\"></span><h4 class=\"editable\">Using the <span><code>start</code></span> attribute</h4> \n          <pre name=\"code\" class=\"xml\">&lt;ol start=\"7\"&gt;\n  &lt;li&gt;first item&lt;/li&gt;\n  &lt;li&gt;second item&lt;/li&gt;\n  &lt;li&gt;third item&lt;/li&gt;\n&lt;/ol&gt;</pre>\n         <p>Above HTML will output:</p> <ol start=\"7\"> <li>first item</li> <li>second item</li> <li>third item</li> </ol> </div><div id=\"section_8\"><span id=\"Nesting_lists\"></span><h4 class=\"editable\">Nesting lists</h4> \n          <pre name=\"code\" class=\"xml\">&lt;ol&gt;\n  &lt;li&gt;first item&lt;/li&gt;\n  &lt;li&gt;second item      &lt;!-- Look, the closing &lt;/li&gt; tag is not placed here! --&gt;\n    &lt;ol&gt;\n      &lt;li&gt;second item first subitem&lt;/li&gt;\n      &lt;li&gt;second item second subitem&lt;/li&gt;\n      &lt;li&gt;second item third subitem&lt;/li&gt;\n    &lt;/ol&gt;\n  &lt;/li&gt;                &lt;!-- Here is the closing &lt;/li&gt; tag --&gt;\n  &lt;li&gt;third item&lt;/li&gt;\n&lt;/ol&gt;</pre>\n         <p>Above HTML will output:</p> <ol> <li>first item</li> <li>second item <ol> <li>second item first subitem</li> <li>second item second subitem</li> <li>second item third subitem</li> </ol> </li> <li>third item</li> </ol> </div><div id=\"section_9\"><span id=\"Nested_.3Col.3E_and_.3Cul.3E\"></span><h4 class=\"editable\">Nested &lt;ol&gt; and &lt;ul&gt;</h4> \n          <pre name=\"code\" class=\"xml\">&lt;ol&gt;\n  &lt;li&gt;first item&lt;/li&gt;\n  &lt;li&gt;second item      &lt;!-- Look, the closing &lt;/li&gt; tag is not placed here! --&gt;\n    &lt;ul&gt;\n      &lt;li&gt;second item first subitem&lt;/li&gt;\n      &lt;li&gt;second item second subitem&lt;/li&gt;\n      &lt;li&gt;second item third subitem&lt;/li&gt;\n    &lt;/ul&gt;\n  &lt;/li&gt;                &lt;!-- Here is the closing &lt;/li&gt; tag --&gt;\n  &lt;li&gt;third item&lt;/li&gt;\n&lt;/ol&gt;</pre>\n         <p>Above HTML will output:</p> <ol> <li>first item</li> <li>second item <ul> <li>second item first subitem</li> <li>second item second subitem</li> <li>second item third subitem</li> </ul> </li> <li>third item</li> </ol> </div>"],"srcUrl":"https://developer.mozilla.org/en/HTML/Element/ol","seeAlso":"<li>Other list-related HTML&nbsp;Elements: <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/ul\">&lt;ul&gt;</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/li\">&lt;li&gt;</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/menu\">&lt;menu&gt;</a></code>\n and the obsolete <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/dir\">&lt;dir&gt;</a></code>\n;</li> <li>CSS properties that may be specially useful to style the <span>&lt;ol&gt;</span> element:&nbsp; <ul> <li>the <a title=\"en/CSS/list-style\" rel=\"internal\" href=\"https://developer.mozilla.org/en/CSS/list-style\">list-style</a> property, useful to choose the way the ordinal is displayed,</li> <li><a title=\"en/CSS_Counters\" rel=\"internal\" href=\"https://developer.mozilla.org/en/CSS_Counters\">CSS counters</a>, useful to handle complex nested lists,</li> <li>the <a title=\"en/CSS/line-height\" rel=\"internal\" href=\"https://developer.mozilla.org/en/CSS/line-height\">line-height</a> property, useful to simulate the deprecated \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/ol#attr-compact\">compact</a></code>\n attribute,</li> <li>the <a title=\"en/CSS/margin\" rel=\"internal\" href=\"https://developer.mozilla.org/en/CSS/margin\">margin</a> property, useful to control the indent of the list.</li> </ul> </li>","summary":"<p>The HTML <em>ordered list</em> element (<code>&lt;ol&gt;</code>) represents an ordered list of items. Typically, ordered-list items are displayed with a preceding numbering, which can be of any form, like numerals, letters or Romans numerals or even simple bullets. This numbered style is not defined in the HTML description of the page, but in its associated CSS, using the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/CSS/list-style-type\">list-style-type</a></code>\n property.</p>\n<p>There is no limitation to the depth and imbrication of lists defined with the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/ol\">&lt;ol&gt;</a></code>\n and <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/ul\">&lt;ul&gt;</a></code>\n elements.</p>\n<div class=\"note\"><strong>Usage note: </strong> The <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/ol\">&lt;ol&gt;</a></code>\n and <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/ul\">&lt;ul&gt;</a></code>\n both represent a list of items. They differ in the way that, with the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/ol\">&lt;ol&gt;</a></code>\n element, the order is meaningful. As a rule of thumb to determine which one to use, try changing the order of the list items; if the meaning is changed, the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/ol\">&lt;ol&gt;</a></code>\n element should be used, else the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/ul\">&lt;ul&gt;</a></code>\n is adequate.</div>","members":[{"obsolete":false,"url":"","name":"compact","help":"This Boolean attribute hints that the list should be rendered in a compact style. The interpretation of this attribute depends on the user agent and it doesn't work in all browsers. <div class=\"note\"><strong>Usage note:&nbsp;</strong>Do not use this attribute, as it has been deprecated: the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/ol\">&lt;ol&gt;</a></code>\n element should be styled using <a title=\"en/CSS\" rel=\"internal\" href=\"https://developer.mozilla.org/en/CSS\">CSS</a>. To give a similar effect than the <span>compact</span> attribute, the <a title=\"en/CSS\" rel=\"internal\" href=\"https://developer.mozilla.org/en/CSS\">CSS</a> property <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/CSS/line-height\">line-height</a></code>\n can be used with a value of <span>80%</span>.</div>"},{"obsolete":false,"url":"","name":"reversed","help":"This Boolean attribute specifies that the items of the item are specified in the reverse order, i.e. that the least important one is listed first. Browsers, by default, numbered the items in the reverse order too."},{"obsolete":false,"url":"","name":"start","help":"This integer attribute specifies the start value for numbering the individual list items. Although the ordering type of list elements might be Roman numerals, such as XXXI, or letters, the value of start is always represented as a number. To start numbering elements from the letter \"C\", use <code>&lt;ol start=\"3\"&gt;</code>. <div class=\"note\"><strong>Note</strong>: that attribute was deprecated in HTML4, but reintroduced in HTML5.</div>"},{"obsolete":false,"url":"","name":"type","help":"Indicates the numbering type: <ul> <li><span><code>'a'</code></span> indicates lowercase letters,</li> <li><span id=\"1284454877507S\">&nbsp;</span><span><code>'<span id=\"1284454878023E\">&nbsp;</span>A'</code></span> indicates uppercase letters,</li> <li><span><code>'i'</code></span> indicates lowercase Roman numerals,</li> <li><span><code>'I'</code></span> indicates uppercase Roman numerals,</li> <li>and <span><code>'1'</code></span> indicates numbers.</li> </ul> <p>The type set is used for the entire list unless a different \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/li#attr-type\">type</a></code>\n attribute is used within an enclosed <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/li\">&lt;li&gt;</a></code>\n element.</p> <div class=\"note\"><strong>Usage note:&nbsp;</strong>Do not use this attribute, as it has been deprecated: use the <a title=\"en/CSS\" rel=\"internal\" href=\"https://developer.mozilla.org/en/CSS\">CSS</a> <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/CSS/list-style-type\">list-style-type</a></code>\n property instead.</div>"}]},"IDBRequest":{"title":"IDBRequest","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td>12 \n<span title=\"prefix\">-webkit</span></td> <td>4.0 (2.0)\n</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE&nbsp;Phone</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Not supported.\">--</span></td> <td>6.0 (6.0)\n</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> </tr> </tbody> </table>\n</div>","examples":["<p>In the following code snippet, we open a database asynchronously and make a request. Event handlers are registered for responding to various situations.</p>\n\n          <pre name=\"code\" class=\"js\">var request = window.indexedDB.open('Database Name');\nrequest.onsuccess = function(event) {\n        var db = this.result;\n        var transaction = db.transaction([], IDBTransaction.READ_ONLY);\n        var curRequest = transaction.objectStore('ObjectStore Name').openCursor();\n        curRequest.onsuccess = ...;\n    };\nrequest.onerror = function(event) {\n         ...;\n    };</pre>"],"srcUrl":"https://developer.mozilla.org/en/IndexedDB/IDBRequest","summary":"<p>The <code>IDBRequest</code> interface of the IndexedDB&nbsp;API provides access to results of asynchronous requests to databases and database objects using event handler attributes. Each reading and writing operation on a database is done using a request.</p>\n<p>The request object does not initially contain any information about the result of the operation, but once information becomes available, an event is fired on the request, and the information becomes available through the properties of the <code>IDBRequest</code> instance.</p>\n<p>Inherits from: <a title=\"en/DOM/EventTarget\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/EventTarget\">EventTarget</a></p>","members":[{"url":"","name":"DONE","help":"The request has completed or an error has occurred. Initially false","obsolete":false},{"url":"","name":"LOADING","help":"The request has been started, but its result is not yet available.","obsolete":false},{"name":"onerror","help":"","obsolete":false},{"name":"onsuccess","help":"","obsolete":false}]},"SVGFEComponentTransferElement":{"title":"feComponentTransfer","seeAlso":"<li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/filter\">&lt;filter&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feBlend\">&lt;feBlend&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feColorMatrix\">&lt;feColorMatrix&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feComposite\">&lt;feComposite&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feConvolveMatrix\">&lt;feConvolveMatrix&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feDiffuseLighting\">&lt;feDiffuseLighting&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feDisplacementMap\">&lt;feDisplacementMap&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feFlood\">&lt;feFlood&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feFuncA\">&lt;feFuncA&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feFuncB\">&lt;feFuncB&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feFuncG\">&lt;feFuncG&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feFuncR\">&lt;feFuncR&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feGaussianBlur\">&lt;feGaussianBlur&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feImage\">&lt;feImage&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feMerge\">&lt;feMerge&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feMorphology\">&lt;feMorphology&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feOffset\">&lt;feOffset&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feSpecularLighting\">&lt;feSpecularLighting&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feTile\">&lt;feTile&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feTurbulence\">&lt;feTurbulence&gt;</a></code>\n</li> <li><a title=\"en/SVG/Tutorial/Filter_effects\" rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Tutorial/Filter_effects\">SVG tutorial: Filter effects</a></li>","summary":"The color of each pixel is modified by changing each channel (R, G, B, and A) to the result of what the children <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feFuncR\">&lt;feFuncR&gt;</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feFuncB\">&lt;feFuncB&gt;</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feFuncG\">&lt;feFuncG&gt;</a></code>\n, and <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feFuncA\">&lt;feFuncA&gt;</a></code>\n return.","members":[],"srcUrl":"https://developer.mozilla.org/en/SVG/Element/feComponentTransfer"},"HTMLQuoteElement":{"title":"HTMLQuoteElement","summary":"DOM quote objects expose the <a class=\" external\" title=\"http://www.w3.org/TR/html5/grouping-content.html#htmlquoteelement\" rel=\"external\" href=\"http://www.w3.org/TR/html5/grouping-content.html#htmlquoteelement\" target=\"_blank\">HTMLQuoteElement</a> (or \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML\">HTML 4</a></span> <a class=\" external\" title=\"http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-70319763\" rel=\"external\" href=\"http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-70319763\" target=\"_blank\"><code>HTMLQuoteElement</code></a>) interface, which provides special properties&nbsp; (beyond the regular <a href=\"https://developer.mozilla.org/en/DOM/element\" rel=\"internal\">element</a> object interface they also have available to them by inheritance) for manipulating quote elements.","members":[{"name":"cite","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/blockquote#attr-cite\">cite</a></code>\n HTML attribute, containing a URL for the source of the quotation.","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/DOM/HTMLQuoteElement"},"HTMLOptionElement":{"title":"HTMLOptionElement","summary":"<p>DOM&nbsp;<em>option</em> elements elements share all of the properties and methods of other HTML elements described in the <a title=\"en/DOM/element\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/element\">element</a> section. They also have the specialized interface <a title=\"http://dev.w3.org/html5/spec/the-button-element.html#htmloptionelement\" class=\" external\" rel=\"external\" href=\"http://dev.w3.org/html5/spec/the-button-element.html#htmloptionelement\" target=\"_blank\">HTMLOptionElement</a> (or \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML\">HTML 4</a></span> <a class=\"external\" title=\"http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-70901257\" rel=\"external\" href=\"http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-70901257\" target=\"_blank\">HTMLOptionElement</a>).</p>\n<p>No methods are defined on this interface.</p>","members":[{"name":"defaultSelected","help":"Reflects the value of the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/option#attr-selected\">selected</a></code>\n HTML attribute. which indicates whether the option is selected by default.","obsolete":false},{"name":"disabled","help":"Reflects the value of the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/option#attr-disabled\">disabled</a></code>\n HTML&nbsp;attribute, which indicates that the option is unavailable to be selected. An option can also be disabled if it is a child of an <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/optgroup\">&lt;optgroup&gt;</a></code>\n element that is disabled.","obsolete":false},{"name":"form","help":"If the option is a descendent of a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/select\">&lt;select&gt;</a></code>\n element, then this property has the same value as the <code>form</code> property of the corresponding {{DomXref(\"HTMLSelectElement\") object; otherwise, it is null.","obsolete":false},{"name":"index","help":"The position of the option within the list of options it belongs to, in tree-order. If the option is not part of a list of options, the value is 0.","obsolete":false},{"name":"label","help":"Reflects the value of the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/option#attr-label\">label</a></code>\n HTML attribute, which provides a label for the option. If this attribute isn't specifically set, reading it returns the element's text content.","obsolete":false},{"name":"selected","help":"Indicates whether the option is selected.","obsolete":false},{"name":"text","help":"Contains the text content of the element.","obsolete":false},{"name":"value","help":"Reflects the value of the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/option#attr-value\">value</a></code>\n HTML attribute, if it exists; otherwise reflects value of the <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/textContent\" class=\"new\">textContent</a></code>\n&nbsp;IDL&nbsp;attribute.","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/DOM/HTMLOptionElement"},"SVGFETileElement":{"title":"feTile","seeAlso":"<li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/filter\">&lt;filter&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/animate\">&lt;animate&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/set\">&lt;set&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feBlend\">&lt;feBlend&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feColorMatrix\">&lt;feColorMatrix&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feComponentTransfer\">&lt;feComponentTransfer&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feComposite\">&lt;feComposite&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feConvolveMatrix\">&lt;feConvolveMatrix&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feDiffuseLighting\">&lt;feDiffuseLighting&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feDisplacementMap\">&lt;feDisplacementMap&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feFlood\">&lt;feFlood&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feGaussianBlur\">&lt;feGaussianBlur&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feImage\">&lt;feImage&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feMerge\">&lt;feMerge&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feMorphology\">&lt;feMorphology&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feOffset\">&lt;feOffset&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feSpecularLighting\">&lt;feSpecularLighting&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feTurbulence\">&lt;feTurbulence&gt;</a></code>\n</li> <li><a title=\"en/SVG/Tutorial/Filter_effects\" rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Tutorial/Filter_effects\">SVG tutorial: Filter effects</a></li>","summary":"An input image is tiled and the result used to fill a target. The effect is similar to the one of a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/pattern\">&lt;pattern&gt;</a></code>\n.","members":[],"srcUrl":"https://developer.mozilla.org/en/SVG/Element/feTile"},"SVGPathSegList":{"title":"User talk:Jeff Schiller","members":[],"srcUrl":"https://developer.mozilla.org/User_talk:Jeff_Schiller","skipped":true,"cause":"Suspect title"},"XSLTProcessor":{"title":"XSLTProcessor","summary":"<p>XSLTProcesor is an object providing an interface to XSLT engine in Mozilla. It is available to unprivileged JavaScript.</p>\n<ul> <li><a title=\"en/Using_the_Mozilla_JavaScript_interface_to_XSL_Transformations\" rel=\"internal\" href=\"https://developer.mozilla.org/en/Using_the_Mozilla_JavaScript_interface_to_XSL_Transformations\">Using the Mozilla JavaScript interface to XSL Transformations</a></li> <li><a title=\"en/The_XSLT//JavaScript_Interface_in_Gecko\" rel=\"internal\" href=\"https://developer.mozilla.org/en/The_XSLT%2F%2FJavaScript_Interface_in_Gecko\">The XSLT/JavaScript Interface in Gecko</a></li>\n</ul>","members":[],"srcUrl":"https://developer.mozilla.org/en/XSLTProcessor"},"WebKitPoint":{"title":"Point","summary":"The <code>Point</code> class offers methods for performing common geometry operations on two dimensional points.","constructor":"<p>Creates a new <code>Point</code> object.</p>\n<pre>let p = new Point(x, y);\n</pre>\n<p>The new point, <code>p</code>, has the specified X&nbsp;and Y&nbsp;coordinates.</p>","members":[],"srcUrl":"https://developer.mozilla.org/en/JavaScript_code_modules/Geometry.jsm/Point"},"NamedNodeMap":{"title":"NamedNodeMap","summary":"A collection of nodes returned by <a title=\"En/DOM/Element.attributes\" class=\"internal\" rel=\"internal\" href=\"https://developer.mozilla.org/En/DOM/Node.attributes\"><code>Element.attributes</code></a> (also potentially for <code><a title=\"En/DOM/DocumentType.entities\" rel=\"internal\" href=\"https://developer.mozilla.org/En/DOM/DocumentType.entities\" class=\"new internal\">DocumentType.entities</a></code>, <code><a title=\"En/DOM/DocumentType.notations\" rel=\"internal\" href=\"https://developer.mozilla.org/En/DOM/DocumentType.notations\" class=\"new internal\">DocumentType.notations</a></code>). <code>NamedNodeMap</code>s are not in any particular order (unlike <code><a title=\"En/DOM/NodeList\" class=\"internal\" rel=\"internal\" href=\"https://developer.mozilla.org/En/DOM/NodeList\">NodeList</a></code>), although they may be accessed by an index as in an array (they may also be accessed with the <code>item</code>() method). A NamedNodeMap object are live and will thus be auto-updated if changes are made to their contents internally or elsewhere.","members":[{"obsolete":false,"url":"https://developer.mozilla.org/En/DOM/NamedNodeMap.length","name":"length","help":""}],"srcUrl":"https://developer.mozilla.org/en/DOM/NamedNodeMap","specification":"http://www.w3.org/TR/DOM-Level-3-Cor...#ID-1780488922"},"DOMParser":{"title":"DOMParser","summary":"This page redirects to a page that no longer exists <a rel=\"internal\" class=\"new\" href=\"https://developer.mozilla.org/en/Document_Object_Model_(DOM)/DOMParser\">en/Document_Object_Model_(DOM)/DOMParser</a>.","members":[],"srcUrl":"https://developer.mozilla.org/en/DOMParser"},"HTMLObjectElement":{"title":"HTMLObjectElement","summary":"DOM <code>Object</code> objects expose the <a title=\"http://dev.w3.org/html5/spec/the-iframe-element.html#htmlobjectelement\" class=\" external\" rel=\"external nofollow\" href=\"http://dev.w3.org/html5/spec/the-iframe-element.html#htmlobjectelement\" target=\"_blank\">HTMLObjectElement</a> (or <span><a rel=\"custom nofollow\" href=\"https://developer.mozilla.org/en/HTML\">HTML 4</a></span> <a class=\" external\" rel=\"external nofollow\" href=\"http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html#ID-9893177\" title=\"http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html#ID-9893177\" target=\"_blank\">HTMLObjectElement</a>) interface, which provides special properties and methods (beyond the regular <a rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/element\">element</a> object interface they also have available to them by inheritance) for manipulating the layout and presentation of Object element, representing external resources.","members":[{"name":"checkValidity","help":"Always returns true, because <code>object</code> objects are never candidates for constraint validation.","obsolete":false},{"name":"setCustomValidity","help":"Sets a custom validity message for the element. If this message is not the empty string, then the element is suffering from a custom validity error, and does not validate.","obsolete":false},{"name":"align","help":"Alignment of the object relative to its context. \n\n<span title=\"\">Obsolete</span> in \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span>.","obsolete":true},{"name":"archive","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/object#attr-archive\">archive</a></code>\n&nbsp;HTML attribute, containing a list of archives for resources for this object. \n\n<span title=\"\">Obsolete</span> in \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span>.","obsolete":true},{"name":"border","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/object#attr-border\">border</a></code>\n&nbsp;HTML attribute, specifying the width of a border around the object. \n\n<span title=\"\">Obsolete</span> in \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span>.","obsolete":true},{"name":"code","help":"The name of an applet class file, containing either the applet's subclass, or the path to get to the class, including the class file itself. \n\n<span title=\"\">Obsolete</span> in \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span>.","obsolete":true},{"name":"codeBase","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/object#attr-codebase\">codebase</a></code>\n&nbsp;HTML attribute, specifying the base path to use to resolve relative URIs. \n\n<span title=\"\">Obsolete</span> in \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span>.","obsolete":true},{"name":"codeType","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/object#attr-codetype\">codetype</a></code>\n&nbsp;HTML attribute, specifying the content type of the data. \n\n<span title=\"\">Obsolete</span> in \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span>.","obsolete":true},{"name":"contentDocument","help":"The active document of the object element's nested browsing context, if any; otherwise null.","obsolete":false},{"name":"contentWindow","help":"The window proxy of the object element's nested browsing context, if any; otherwise null.","obsolete":false},{"name":"data","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/object#attr-data\">data</a></code>\n HTML&nbsp;attribute, specifying the address of a resource's data.","obsolete":false},{"name":"declare","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/object#attr-declare\">declare</a></code>\n HTML&nbsp;attribute, indicating that this is a declaration, not an instantiation, of the object. \n\n<span title=\"\">Obsolete</span> in \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span>.","obsolete":true},{"name":"form","help":"The object element's form owner, or null if there isn't one.","obsolete":false},{"name":"height","help":"Reflects the {{htmlattrxref(\"height\", \"object)}}&nbsp;HTML attribute, specifying the displayed height of the resource in CSS pixels.","obsolete":false},{"name":"hspace","help":"Horizontal space in pixels around the control. \n\n<span title=\"\">Obsolete</span> in \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span>.","obsolete":true},{"name":"name","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/object#attr-name\">name</a></code>\n&nbsp;HTML attribute, specifying the name of the object (\n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML\">HTML 4</a></span>, or of a browsing context (\n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span>.","obsolete":false},{"name":"standby","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/object#attr-standby\">standby</a></code>\n HTML&nbsp;attribute, specifying a message to display while the object loads. \n\n<span title=\"\">Obsolete</span> in \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span>.","obsolete":true},{"name":"tabIndex","help":"he position of the element in the tabbing navigation order for the current document. \n\n<span title=\"\">Obsolete</span> in \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span>.","obsolete":true},{"name":"type","help":"Reflects the {{htmlattrxref(\"type\", \"object)}}&nbsp;HTML attribute, specifying the MIME type of the resource.","obsolete":false},{"name":"useMap","help":"Reflects the {{htmlattrxref(\"usemap\", \"object)}}&nbsp;HTML attribute, specifying a {{HTMLElement(\"map\")}} element to use.","obsolete":false},{"name":"validationMessage","help":"A localized message that describes the validation constraints that the control does not satisfy (if any). This is the empty string if the control is not a candidate for constraint validation (<strong>willValidate</strong> is false), or it satisfies its constraints.","obsolete":false},{"name":"validity","help":"The validity states that this element is in.","obsolete":false},{"name":"vspace","help":"Horizontal space in pixels around the control. \n\n<span title=\"\">Obsolete</span> in \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span>.","obsolete":true},{"name":"width","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/object#attr-width\">width</a></code>\n&nbsp;HTML attribute, specifying the displayed width of the resource in CSS pixels.","obsolete":false},{"name":"willValidate","help":"Indicates whether the element is a candidate for constraint validation. Always false for <code>object</code> objects.","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/DOM/HTMLObjectElement"},"HTMLPreElement":{"title":"pre","examples":["<pre name=\"code\" class=\"xml\">&lt;!-- Some example CSS code --&gt;\n&lt;pre&gt;\nbody {\n  color:red;\n}\n&lt;/pre&gt;</pre>\n        \n<div id=\"section_4\"><span id=\"Result\"></span><h4 class=\"editable\">Result</h4>\n<p>&nbsp;</p>\n<pre>body {\n  color:red;\n}\n</pre>\n</div>"],"summary":"This element represents preformatted text. Text within this element is typically displayed in a non-proportional font exactly as it is laid out in the file. Whitespaces inside this element are displayed as typed.","members":[],"srcUrl":"https://developer.mozilla.org/en/HTML/Element/pre"},"TouchList":{"title":"TouchList","examples":["See the <a title=\"en/DOM/Touch events#Example\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/Touch_events#Example\">example on the main Touch events article</a>."],"srcUrl":"https://developer.mozilla.org/en/DOM/TouchList","seeAlso":"<li><a title=\"en/DOM/Touch events\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/Touch_events\">Touch events</a></li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Touch\">Touch</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/TouchEvent\">TouchEvent</a></code>\n</li>","summary":"A <code>TouchList</code> represents a list of all of the points of contact with a touch surface; for example, if the user has three fingers on the screen (or trackpad), the corresponding <code>TouchList</code> would have one <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Touch\">Touch</a></code>\n object for each finger, for a total of three entries.","members":[{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/TouchList.identifiedTouch","name":"identifiedTouch","help":"Returns the first <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Touch\">Touch</a></code>\n&nbsp;item in the list whose identifier matches a specified value."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/TouchList.item","name":"item","help":"Returns the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Touch\">Touch</a></code>\n object at the specified index in the list. You can also simply reference the <code>TouchList</code> using array syntax (<code>touchList[x]</code>)."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/TouchList.length","name":"length","help":"The number of <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Touch\">Touch</a></code>\n&nbsp;objects in the <code>TouchList</code>. <strong>Read only.</strong>"}]},"History":{"title":"window.history","examples":["history.back();     // equivalent to clicking back button\nhistory.go(-1);     // equivalent to history.back();\n"],"srcUrl":"https://developer.mozilla.org/en/DOM/window.history","specification":"HTML5 History interface","summary":"Returns a reference to the <code>History</code> object, which provides an interface for manipulating the browser <em>session history</em> (pages visited in the tab or frame that the current page is loaded in).","members":[{"name":"back","help":"<p>Goes to the previous page in session history, the same action as when the user clicks the browser's Back button. Equivalent to <code>history.go(-1)</code>.</p> <div class=\"note\"><strong>Note:</strong> Calling this method to go back beyond the first page in the session history has no effect and doesn't raise an exception.</div>","obsolete":false},{"name":"forward","help":"<p>Goes to the next page in session history, the same action as when the user clicks the browser's Forward button; this is equivalent to <code>history.go(1)</code>.</p> <div class=\"note\"><strong>Note:</strong> Calling this method to go back beyond the last page in the session history has no effect and doesn't raise an exception.</div>","obsolete":false},{"name":"go","help":"Loads a page from the session history, identified by its relative location to the current page, for example <code>-1</code> for the previous page or <code>1</code> for the next page. When <code><em>integerDelta</em></code> is out of bounds (e.g. -1 when there are no previously visited pages in the session history), the method doesn't do anything and doesn't raise an exception. Calling <code>go()</code> without parameters or with a non-integer argument has no effect (unlike Internet Explorer, <a class=\"external\" title=\"http://msdn.microsoft.com/en-us/library/ms536443(VS.85).aspx\" rel=\"external\" href=\"http://msdn.microsoft.com/en-us/library/ms536443(VS.85).aspx\" target=\"_blank\">which supports string URLs as the argument</a>).","obsolete":false},{"name":"pushState","help":"<p>Pushes the given data onto the session history stack with the specified title and, if provided, URL. The data is treated as opaque by the DOM; you may specify any JavaScript object that can be serialized.&nbsp; Note that Firefox currently ignores the title parameter; for more information, see <a title=\"en/DOM/Manipulating the browser history\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/Manipulating_the_browser_history\">manipulating the browser history</a>.</p> <div class=\"note\"><strong>Note:</strong> In Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1)\n through Gecko 5.0 (Firefox 5.0 / Thunderbird 5.0 / SeaMonkey 2.2)\n, the passed object is serialized using JSON. Starting in Gecko 6.0 (Firefox 6.0 / Thunderbird 6.0 / SeaMonkey 2.3)\n, the object is serialized using <a title=\"en/DOM/The structured clone algorithm\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/The_structured_clone_algorithm\">the structured clone algorithm</a>. This allows a wider variety of objects to be safely passed.</div>","obsolete":false},{"name":"replaceState","help":"<p>Updates the most recent entry on the history stack to have the specified data, title, and, if provided, URL. The data is treated as opaque by the DOM; you may specify any JavaScript object that can be serialized.&nbsp; Note that Firefox currently ignores the title parameter; for more information, see <a title=\"en/DOM/Manipulating the browser history\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/Manipulating_the_browser_history\">manipulating the browser history</a>.</p> <div class=\"note\"><strong>Note:</strong> In Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1)\n through Gecko 5.0 (Firefox 5.0 / Thunderbird 5.0 / SeaMonkey 2.2)\n, the passed object is serialized using JSON. Starting in Gecko 6.0 (Firefox 6.0 / Thunderbird 6.0 / SeaMonkey 2.3)\n, the object is serialized using <a title=\"en/DOM/The structured clone algorithm\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/The_structured_clone_algorithm\">the structured clone algorithm</a>. This allows a wider variety of objects to be safely passed.</div>","obsolete":false},{"name":"length","help":"Read-only. Returns the number of elements in the session history, including the currently loaded page. For example, for a page loaded in a new tab this property returns <code>1</code>.","obsolete":false},{"name":"current","help":"Returns the URL of the active item of the session history. This property is not available to web content and is not supported by other browsers. Use <code><a title=\"en/DOM/window.location\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/window.location\">location.href</a></code> instead.","obsolete":false},{"name":"next","help":"Returns the URL of the next item in the session history. This property is not available to web content and is not supported by other browsers.","obsolete":false},{"name":"previous","help":"Returns the URL of the previous item in the session history. This property is not available to web content and is not supported by other browsers.","obsolete":false},{"name":"state","help":"Returns the state at the top of the history stack. This is a way to look at the state without having to wait for a <code>popstate</code> event. <strong>Read only.</strong>","obsolete":false},{"name":"back","help":"<p>Goes to the previous page in session history, the same action as when the user clicks the browser's Back button. Equivalent to <code>history.go(-1)</code>.</p> <div class=\"note\"><strong>Note:</strong> Calling this method to go back beyond the first page in the session history has no effect and doesn't raise an exception.</div>","obsolete":false},{"name":"forward","help":"<p>Goes to the next page in session history, the same action as when the user clicks the browser's Forward button; this is equivalent to <code>history.go(1)</code>.</p> <div class=\"note\"><strong>Note:</strong> Calling this method to go back beyond the last page in the session history has no effect and doesn't raise an exception.</div>","obsolete":false},{"name":"go","help":"Loads a page from the session history, identified by its relative location to the current page, for example <code>-1</code> for the previous page or <code>1</code> for the next page. When <code><em>integerDelta</em></code> is out of bounds (e.g. -1 when there are no previously visited pages in the session history), the method doesn't do anything and doesn't raise an exception. Calling <code>go()</code> without parameters or with a non-integer argument has no effect (unlike Internet Explorer, <a class=\"external\" title=\"http://msdn.microsoft.com/en-us/library/ms536443(VS.85).aspx\" rel=\"external\" href=\"http://msdn.microsoft.com/en-us/library/ms536443(VS.85).aspx\" target=\"_blank\">which supports string URLs as the argument</a>).","obsolete":false},{"name":"pushState","help":"<p>Pushes the given data onto the session history stack with the specified title and, if provided, URL. The data is treated as opaque by the DOM; you may specify any JavaScript object that can be serialized.&nbsp; Note that Firefox currently ignores the title parameter; for more information, see <a title=\"en/DOM/Manipulating the browser history\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/Manipulating_the_browser_history\">manipulating the browser history</a>.</p> <div class=\"note\"><strong>Note:</strong> In Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1)\n through Gecko 5.0 (Firefox 5.0 / Thunderbird 5.0 / SeaMonkey 2.2)\n, the passed object is serialized using JSON. Starting in Gecko 6.0 (Firefox 6.0 / Thunderbird 6.0 / SeaMonkey 2.3)\n, the object is serialized using <a title=\"en/DOM/The structured clone algorithm\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/The_structured_clone_algorithm\">the structured clone algorithm</a>. This allows a wider variety of objects to be safely passed.</div>","obsolete":false},{"name":"replaceState","help":"<p>Updates the most recent entry on the history stack to have the specified data, title, and, if provided, URL. The data is treated as opaque by the DOM; you may specify any JavaScript object that can be serialized.&nbsp; Note that Firefox currently ignores the title parameter; for more information, see <a title=\"en/DOM/Manipulating the browser history\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/Manipulating_the_browser_history\">manipulating the browser history</a>.</p> <div class=\"note\"><strong>Note:</strong> In Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1)\n through Gecko 5.0 (Firefox 5.0 / Thunderbird 5.0 / SeaMonkey 2.2)\n, the passed object is serialized using JSON. Starting in Gecko 6.0 (Firefox 6.0 / Thunderbird 6.0 / SeaMonkey 2.3)\n, the object is serialized using <a title=\"en/DOM/The structured clone algorithm\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/The_structured_clone_algorithm\">the structured clone algorithm</a>. This allows a wider variety of objects to be safely passed.</div>","obsolete":false},{"name":"length","help":"Read-only. Returns the number of elements in the session history, including the currently loaded page. For example, for a page loaded in a new tab this property returns <code>1</code>.","obsolete":false},{"name":"current","help":"Returns the URL of the active item of the session history. This property is not available to web content and is not supported by other browsers. Use <code><a title=\"en/DOM/window.location\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/window.location\">location.href</a></code> instead.","obsolete":false},{"name":"next","help":"Returns the URL of the next item in the session history. This property is not available to web content and is not supported by other browsers.","obsolete":false},{"name":"previous","help":"Returns the URL of the previous item in the session history. This property is not available to web content and is not supported by other browsers.","obsolete":false},{"name":"state","help":"Returns the state at the top of the history stack. This is a way to look at the state without having to wait for a <code>popstate</code> event. <strong>Read only.</strong>","obsolete":false},{"name":"back","help":"<p>Goes to the previous page in session history, the same action as when the user clicks the browser's Back button. Equivalent to <code>history.go(-1)</code>.</p> <div class=\"note\"><strong>Note:</strong> Calling this method to go back beyond the first page in the session history has no effect and doesn't raise an exception.</div>","obsolete":false},{"name":"forward","help":"<p>Goes to the next page in session history, the same action as when the user clicks the browser's Forward button; this is equivalent to <code>history.go(1)</code>.</p> <div class=\"note\"><strong>Note:</strong> Calling this method to go back beyond the last page in the session history has no effect and doesn't raise an exception.</div>","obsolete":false},{"name":"go","help":"Loads a page from the session history, identified by its relative location to the current page, for example <code>-1</code> for the previous page or <code>1</code> for the next page. When <code><em>integerDelta</em></code> is out of bounds (e.g. -1 when there are no previously visited pages in the session history), the method doesn't do anything and doesn't raise an exception. Calling <code>go()</code> without parameters or with a non-integer argument has no effect (unlike Internet Explorer, <a class=\"external\" title=\"http://msdn.microsoft.com/en-us/library/ms536443(VS.85).aspx\" rel=\"external\" href=\"http://msdn.microsoft.com/en-us/library/ms536443(VS.85).aspx\" target=\"_blank\">which supports string URLs as the argument</a>).","obsolete":false},{"name":"pushState","help":"<p>Pushes the given data onto the session history stack with the specified title and, if provided, URL. The data is treated as opaque by the DOM; you may specify any JavaScript object that can be serialized.&nbsp; Note that Firefox currently ignores the title parameter; for more information, see <a title=\"en/DOM/Manipulating the browser history\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/Manipulating_the_browser_history\">manipulating the browser history</a>.</p> <div class=\"note\"><strong>Note:</strong> In Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1)\n through Gecko 5.0 (Firefox 5.0 / Thunderbird 5.0 / SeaMonkey 2.2)\n, the passed object is serialized using JSON. Starting in Gecko 6.0 (Firefox 6.0 / Thunderbird 6.0 / SeaMonkey 2.3)\n, the object is serialized using <a title=\"en/DOM/The structured clone algorithm\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/The_structured_clone_algorithm\">the structured clone algorithm</a>. This allows a wider variety of objects to be safely passed.</div>","obsolete":false},{"name":"replaceState","help":"<p>Updates the most recent entry on the history stack to have the specified data, title, and, if provided, URL. The data is treated as opaque by the DOM; you may specify any JavaScript object that can be serialized.&nbsp; Note that Firefox currently ignores the title parameter; for more information, see <a title=\"en/DOM/Manipulating the browser history\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/Manipulating_the_browser_history\">manipulating the browser history</a>.</p> <div class=\"note\"><strong>Note:</strong> In Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1)\n through Gecko 5.0 (Firefox 5.0 / Thunderbird 5.0 / SeaMonkey 2.2)\n, the passed object is serialized using JSON. Starting in Gecko 6.0 (Firefox 6.0 / Thunderbird 6.0 / SeaMonkey 2.3)\n, the object is serialized using <a title=\"en/DOM/The structured clone algorithm\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/The_structured_clone_algorithm\">the structured clone algorithm</a>. This allows a wider variety of objects to be safely passed.</div>","obsolete":false},{"name":"length","help":"Read-only. Returns the number of elements in the session history, including the currently loaded page. For example, for a page loaded in a new tab this property returns <code>1</code>.","obsolete":false},{"name":"current","help":"Returns the URL of the active item of the session history. This property is not available to web content and is not supported by other browsers. Use <code><a title=\"en/DOM/window.location\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/window.location\">location.href</a></code> instead.","obsolete":false},{"name":"next","help":"Returns the URL of the next item in the session history. This property is not available to web content and is not supported by other browsers.","obsolete":false},{"name":"previous","help":"Returns the URL of the previous item in the session history. This property is not available to web content and is not supported by other browsers.","obsolete":false},{"name":"state","help":"Returns the state at the top of the history stack. This is a way to look at the state without having to wait for a <code>popstate</code> event. <strong>Read only.</strong>","obsolete":false},{"name":"back","help":"<p>Goes to the previous page in session history, the same action as when the user clicks the browser's Back button. Equivalent to <code>history.go(-1)</code>.</p> <div class=\"note\"><strong>Note:</strong> Calling this method to go back beyond the first page in the session history has no effect and doesn't raise an exception.</div>","obsolete":false},{"name":"forward","help":"<p>Goes to the next page in session history, the same action as when the user clicks the browser's Forward button; this is equivalent to <code>history.go(1)</code>.</p> <div class=\"note\"><strong>Note:</strong> Calling this method to go back beyond the last page in the session history has no effect and doesn't raise an exception.</div>","obsolete":false},{"name":"go","help":"Loads a page from the session history, identified by its relative location to the current page, for example <code>-1</code> for the previous page or <code>1</code> for the next page. When <code><em>integerDelta</em></code> is out of bounds (e.g. -1 when there are no previously visited pages in the session history), the method doesn't do anything and doesn't raise an exception. Calling <code>go()</code> without parameters or with a non-integer argument has no effect (unlike Internet Explorer, <a class=\"external\" title=\"http://msdn.microsoft.com/en-us/library/ms536443(VS.85).aspx\" rel=\"external\" href=\"http://msdn.microsoft.com/en-us/library/ms536443(VS.85).aspx\" target=\"_blank\">which supports string URLs as the argument</a>).","obsolete":false},{"name":"pushState","help":"<p>Pushes the given data onto the session history stack with the specified title and, if provided, URL. The data is treated as opaque by the DOM; you may specify any JavaScript object that can be serialized.&nbsp; Note that Firefox currently ignores the title parameter; for more information, see <a title=\"en/DOM/Manipulating the browser history\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/Manipulating_the_browser_history\">manipulating the browser history</a>.</p> <div class=\"note\"><strong>Note:</strong> In Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1)\n through Gecko 5.0 (Firefox 5.0 / Thunderbird 5.0 / SeaMonkey 2.2)\n, the passed object is serialized using JSON. Starting in Gecko 6.0 (Firefox 6.0 / Thunderbird 6.0 / SeaMonkey 2.3)\n, the object is serialized using <a title=\"en/DOM/The structured clone algorithm\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/The_structured_clone_algorithm\">the structured clone algorithm</a>. This allows a wider variety of objects to be safely passed.</div>","obsolete":false},{"name":"replaceState","help":"<p>Updates the most recent entry on the history stack to have the specified data, title, and, if provided, URL. The data is treated as opaque by the DOM; you may specify any JavaScript object that can be serialized.&nbsp; Note that Firefox currently ignores the title parameter; for more information, see <a title=\"en/DOM/Manipulating the browser history\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/Manipulating_the_browser_history\">manipulating the browser history</a>.</p> <div class=\"note\"><strong>Note:</strong> In Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1)\n through Gecko 5.0 (Firefox 5.0 / Thunderbird 5.0 / SeaMonkey 2.2)\n, the passed object is serialized using JSON. Starting in Gecko 6.0 (Firefox 6.0 / Thunderbird 6.0 / SeaMonkey 2.3)\n, the object is serialized using <a title=\"en/DOM/The structured clone algorithm\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/The_structured_clone_algorithm\">the structured clone algorithm</a>. This allows a wider variety of objects to be safely passed.</div>","obsolete":false},{"name":"length","help":"Read-only. Returns the number of elements in the session history, including the currently loaded page. For example, for a page loaded in a new tab this property returns <code>1</code>.","obsolete":false},{"name":"current","help":"Returns the URL of the active item of the session history. This property is not available to web content and is not supported by other browsers. Use <code><a title=\"en/DOM/window.location\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/window.location\">location.href</a></code> instead.","obsolete":false},{"name":"next","help":"Returns the URL of the next item in the session history. This property is not available to web content and is not supported by other browsers.","obsolete":false},{"name":"previous","help":"Returns the URL of the previous item in the session history. This property is not available to web content and is not supported by other browsers.","obsolete":false},{"name":"state","help":"Returns the state at the top of the history stack. This is a way to look at the state without having to wait for a <code>popstate</code> event. <strong>Read only.</strong>","obsolete":false}]},"SVGPathSegCurvetoQuadraticSmoothRel":{"title":"SVGPathElement","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/SVGPathElement","skipped":true,"cause":"Suspect title"},"SVGFEMorphologyElement":{"title":"feMorphology","seeAlso":"<li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/filter\">&lt;filter&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/animate\">&lt;animate&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/set\">&lt;set&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feBlend\">&lt;feBlend&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feColorMatrix\">&lt;feColorMatrix&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feComponentTransfer\">&lt;feComponentTransfer&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feComposite\">&lt;feComposite&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feConvolveMatrix\">&lt;feConvolveMatrix&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feDiffuseLighting\">&lt;feDiffuseLighting&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feDisplacementMap\">&lt;feDisplacementMap&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feFlood\">&lt;feFlood&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feGaussianBlur\">&lt;feGaussianBlur&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feImage\">&lt;feImage&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feMerge\">&lt;feMerge&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feOffset\">&lt;feOffset&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feSpecularLighting\">&lt;feSpecularLighting&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feTile\">&lt;feTile&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feTurbulence\">&lt;feTurbulence&gt;</a></code>\n</li> <li><a title=\"en/SVG/Tutorial/Filter_effects\" rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Tutorial/Filter_effects\">SVG tutorial: Filter effects</a></li>","summary":"This filter is used to erode or dilate the input image. It's usefulness lies especially in fattening or thinning effects.","members":[{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/class","name":"class","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/style","name":"style","help":"Specific attributes"},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/in","name":"in","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/radius","name":"radius","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/operator","name":"operator","help":""}],"srcUrl":"https://developer.mozilla.org/en/SVG/Element/feMorphology"},"HTMLSpanElement":{"title":"span","examples":["<pre name=\"code\" class=\"xml\">&lt;p&gt;&lt;span&gt;Some text&lt;/span&gt;&lt;/p&gt;</pre>\n        \n<div id=\"section_6\"><span id=\"Result\"></span><h4 class=\"editable\">Result</h4>\n<p><span>Some text</span></p></div>"],"summary":"This HTML element is a generic inline container for phrasing content, which does not inherently represent anything. It can be used to group elements for styling purposes (using the <strong>class</strong> or <strong>id</strong> attributes), or because they share attribute values, such as <strong>lang</strong>. It should be used only when no other semantic element is appropriate. &lt;span&gt; is very much like a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/div\">&lt;div&gt;</a></code>\n element, but <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/div\">&lt;div&gt;</a></code>\n is a block-level element whereas a &lt;span&gt; is an inline element.","members":[],"srcUrl":"https://developer.mozilla.org/en/HTML/Element/span"},"SVGAnimateElement":{"title":"SVGAnimateElement","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> </tbody>\n</table>\n</div>\n<div id=\"compat-mobile\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> </tbody>\n</table>\n</div>","summary":"The <code>SVGAnimateElement</code> interface corresponds to the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/animate\">&lt;animate&gt;</a></code>\n element.","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/SVGAnimateElement"},"MetadataCallback":{"title":"EntrySync","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/File_API/File_System_API/EntrySync","skipped":true,"cause":"Suspect title"},"EntriesCallback":{"title":"DirectoryReaderSync","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/File_API/File_System_API/DirectoryReaderSync","skipped":true,"cause":"Suspect title"},"UIEvent":{"title":"UIEvent","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>","srcUrl":"https://developer.mozilla.org/en/DOM/UIEvent","specification":"DOM&nbsp;3 Events: UIEvent","seeAlso":"Event","summary":"<div><div>\n\n<a rel=\"custom\" href=\"http://mxr.mozilla.org/mozilla-central/source/dom/interfaces/events/nsIDOMUIEvent.idl\"><code>dom/interfaces/events/nsIDOMUIEvent.idl</code></a><span><a rel=\"internal\" href=\"https://developer.mozilla.org/en/Interfaces/About_Scriptable_Interfaces\" title=\"en/Interfaces/About_Scriptable_Interfaces\">Scriptable</a></span></div><span>A basic event interface for all user interface events</span><div><div>1.0</div><div>11.0</div><div title=\"Introduced in Gecko 1.0 \n\"></div><div title=\"Last changed in Gecko 9.0 \n\"></div></div>\n<div>Inherits from: <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsIDOMEvent\">nsIDOMEvent</a></code>\n<span>Last changed in Gecko 9.0 (Firefox 9.0 / Thunderbird 9.0 / SeaMonkey 2.6)\n</span></div></div>\n<p></p>\n<p>The DOM <code>UIEvent</code> represents simple user interface events.</p>","members":[{"name":"initUIEvent","help":"<p>Initializes the UIEvent object.</p>\n\n<div id=\"section_5\"><span id=\"Parameters\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>typeArg</code></dt> <dd>The type of UI event.</dd> <dt><code>canBubbleArg</code></dt> <dd>Whether or not the event can bubble.</dd> <dt><code>cancelableArg</code></dt> <dd>Whether or not the event can be canceled.</dd> <dt><code>viewArg</code></dt> <dd>Specifies the <code>view</code> attribute value. This may be <code>null</code>.</dd> <dt><code>detailArg</code></dt> <dd>Specifies the detail attribute value.</dd>\n</dl>\n</div>","idl":"<pre><code>void initUIEvent(\n  in DOMString typeArg,\n  in boolean canBubbleArg,\n  in boolean cancelableArg,\n  in views::AbstractView viewArg,\n  in long detailArg\n);</code>\n</pre>","obsolete":false},{"name":"detail","help":"Detail about the event, depending on the type of event. <strong>Read only.</strong>","obsolete":false},{"name":"view","help":"A view which generated the event. <strong>Read only.</strong>","obsolete":false}]},"SVGStopElement":{"title":"SVGStopElement","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody>\n</table>\n</div>\n<div id=\"compat-mobile\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody>\n</table>\n</div>","summary":"The <code>SVGStopElement</code> interface corresponds to the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/stop\">&lt;stop&gt;</a></code>\n element.","members":[{"name":"offset","help":"Corresponds to attribute \n<code><a rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Attribute/offset\" class=\"new\">offset</a></code> on the given <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/stop\">&lt;stop&gt;</a></code>\n element.","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/DOM/SVGStopElement"},"SVGGradientElement":{"title":"SVGGradientElement","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>","summary":"The <code>SVGGradient</code> interface is a base interface used by <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/SVGLinearGradientElement\">SVGLinearGradientElement</a></code>\n and <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/SVGRadialGradientElement\">SVGRadialGradientElement</a></code>\n.","members":[{"name":"SVG_SPREADMETHOD_UNKNOWN","help":"The type is not one of predefined types. It is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type.","obsolete":false},{"name":"SVG_SPREADMETHOD_PAD","help":"Corresponds to value <em>pad</em>.","obsolete":false},{"name":"SVG_SPREADMETHOD_REFLECT","help":"Corresponds to value <em>reflect</em>.","obsolete":false},{"name":"SVG_SPREADMETHOD_REPEAT","help":"Corresponds to value <em>repeat</em>.","obsolete":false},{"name":"gradientUnits","help":"Corresponds to attribute \n<code><a rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Attribute/gradientUnits\" class=\"new\">gradientUnits</a></code> on the given element. Takes one of the constants defined in <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/SVGUnitTypes\" class=\"new\">SVGUnitTypes</a></code>\n.","obsolete":false},{"name":"gradientTransform","help":"Corresponds to attribute \n<code><a rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Attribute/gradientTransform\" class=\"new\">gradientTransform</a></code> on the given element.","obsolete":false},{"name":"spreadMethod","help":"Corresponds to attribute \n<code><a rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Attribute/spreadMethod\" class=\"new\">spreadMethod</a></code> on the given element. One of the Spread Method Types defined on this interface.","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/DOM/SVGGradientElement"},"SVGMatrix":{"title":"SVGMatrix","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>","summary":"<p>Many of SVG's graphics operations utilize 2x3 matrices of the form:</p>\n<pre>[a c e]\n[b d f]</pre>\n<p>which, when expanded into a 3x3 matrix for the purposes of matrix arithmetic, become:</p>\n<pre>[a c e]\n[b d f]\n[0 0 1]\n</pre>\n<p>An <code>SVGMatrix</code> object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown.</p>","members":[{"name":"multiply","help":"Performs matrix multiplication. This matrix is post-multiplied by another matrix, returning the resulting new matrix.","obsolete":false},{"name":"inverse","help":"<p>Return the inverse matrix</p> <p><strong>Exceptions:</strong></p> <ul> <li>a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DOMException\">DOMException</a></code>\n with code <code>SVG_MATRIX_NOT_INVERTABLE</code> is raised if the matrix is not invertable.</li> </ul>","obsolete":false},{"name":"translate","help":"Post-multiplies a translation transformation on the current matrix and returns the resulting matrix.","obsolete":false},{"name":"scale","help":"Post-multiplies a uniform scale transformation on the current matrix and returns the resulting matrix.","obsolete":false},{"name":"scaleNonUniform","help":"Post-multiplies a non-uniform scale transformation on the current matrix and returns the resulting matrix.","obsolete":false},{"name":"rotate","help":"Post-multiplies a rotation transformation on the current matrix and returns the resulting matrix.","obsolete":false},{"name":"rotateFromVector","help":"<p>Post-multiplies a rotation transformation on the current matrix and returns the resulting matrix. The rotation angle is determined by taking (+/-) atan(y/x). The direction of the vector (x,&nbsp;y) determines whether the positive or negative angle value is used.</p> <p><strong>Exceptions:</strong></p> <ul> <li>a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DOMException\">DOMException</a></code>\n with code <code>SVG_INVALID_VALUE_ERR</code> is raised if one of the parameters has an invalid value.</li> </ul>","obsolete":false},{"name":"flipX","help":"Post-multiplies the transformation [-1&nbsp;0&nbsp;0&nbsp;1&nbsp;0&nbsp;0] and returns the resulting matrix.","obsolete":false},{"name":"flipY","help":"Post-multiplies the transformation [1&nbsp;0&nbsp;0&nbsp;-1&nbsp;0&nbsp;0] and returns the resulting matrix.","obsolete":false},{"name":"skewX","help":"Post-multiplies a skewX transformation on the current matrix and returns the resulting matrix.","obsolete":false},{"name":"skewY","help":"Post-multiplies a skewY transformation on the current matrix and returns the resulting matrix.","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/DOM/SVGMatrix"},"IDBTransaction":{"title":"IDBTransaction","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td>12\n<span title=\"prefix\">-webkit</span></td> <td>4.0 (2.0)\n</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE&nbsp;Phone</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Not supported.\">--</span></td> <td>6.0 (6.0)\n</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> </tr> </tbody> </table>\n</div>","examples":["<p>In the following code snippet, we open a transaction and add data to the object store.&nbsp;&nbsp;Because the specification is still evolving, Chrome uses prefixes in the methods.&nbsp;Chrome uses the&nbsp;<code>webkit</code>&nbsp;prefix.&nbsp;<span>For example,&nbsp;</span><span>instead of just&nbsp;</span><span><code>IDBTransaction.READ_WRITE</code>, </span><span>use <code>webkitIDBTransaction.READ_WRITE</code>.&nbsp;</span><span>Firefox does not use prefixes, except in the opening method (<code>mozIndexedDB</code>)</span><span>. </span><span>Event handlers are registered for responding to various situations.</span></p>\n\n          <pre name=\"code\" class=\"js\">// Take care of the browser prefixes.\nif (window.indexedDb) {\n} else if (window.webkitIndexedDB) {\n    window.indexedDB = window.webkitIndexedDB;\n    window.IDBTransaction = window.webkitIDBTransaction;\n} else if (window.mozIndexedDB) {\n    window.indexedDB = window.mozIndexedDB;\n} else {\n   /* Browser not supported. */\n}\n   \n...   \n\nvar idbReq = window.indexedDB.open('Database Name');\nidbReq.onsuccess = function(event) {\n   var db = this.result;\n   var trans = db.transaction(['monster_store','hero_store'], IDBTransaction.READ_WRITE);\n   var store = trans.objectStore('monster_store');\n   var req = store.put(value, key);\n   req.onsuccess = ...\n   req.onerror = ...\n};\nidbReq.onerror = function(event) {\n    ...\n};</pre>"],"srcUrl":"https://developer.mozilla.org/en/IndexedDB/IDBTransaction","summary":"<p>The <code>IDBTransaction</code> interface of the <a title=\"en/IndexedDB\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB\">IndexedDB&nbsp;API</a> provides a static, asynchronous transaction on a database using event handler attributes. All reading and writing of data are done within transactions. You actually use <code><a title=\"en/IndexedDB/IDBDatabase\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabase\">IDBDatabase</a></code> to start transactions and use <code>IDBTransaction</code> to set the mode of the transaction and access an object store and make your request. You can also use it to abort transactions.</p>\n<p>Inherits from: <a title=\"en/DOM/EventTarget\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/EventTarget\">EventTarget</a></p>","members":[{"name":"abort","help":"<p>Returns immediately, and undoes all the changes to objects in the database associated with this transaction. If this transaction has been aborted or completed, then this method throws an <a title=\"en/IndexedDB/IDBErrorEvent\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBErrorEvent\">error event</a>, with its <a title=\"en/IndexedDB/IDBErrorEvent#attr code\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBErrorEvent#attr_code\">code</a> set to <code><a title=\"en/IndexedDB/IDBDatabaseException#ABORT ERR\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#ABORT_ERR\">ABORT_ERR</a></code> and a suitable <a title=\"en/IndexedDB/IDBEvent#attr message\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBEvent#attr_message\">message</a>.</p>\n\n<p>All pending <a title=\"IDBRequest\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBRequest\"><code>IDBRequest</code></a> objects created during this transaction have their <code>errorCode</code> set to <code>ABORT_ERR</code>.</p>\n<div id=\"section_12\"><span id=\"Exceptions\"></span><h5 class=\"editable\">Exceptions</h5>\n<p>This method can raise an <a title=\"en/IndexedDB/IDBDatabaseException\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException\">IDBDatabaseException</a>, with the following code:</p>\n<dl> <dt><code><a title=\"en/IndexedDB/IDBDatabaseException#NOT ALLOWED ERR\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#NOT_ALLOWED_ERR\">NOT_ALLOWED_ERR</a></code></dt> <dd>The transaction has already been committed or aborted.</dd>\n</dl>\n</div>","idl":"<pre>void abort(\n);\n</pre>","obsolete":false},{"name":"objectStore","help":"<p>Returns an object store that has already been added to the scope of this transaction. Every call to this method on the same transaction object, with the same name, returns the same <a title=\"en/IndexedDB/IDBObjectStore\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBObjectStore\">IDBObjectStore</a> instance. If this method is called on a different transaction object, a different IDBObjectStore instance is returned.</p>\n\n<div id=\"section_14\"><span id=\"Parameters\"></span><h5 class=\"editable\">Parameters</h5>\n<dl> <dt>name</dt> <dd>The name of the requested object store.</dd>\n</dl>\n</div><div id=\"section_15\"><span id=\"Returns\"></span><h5 class=\"editable\">Returns</h5>\n<dl> <dt><code><a title=\"IDBObjectStore\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBObjectStore\">IDBObjectStore</a></code></dt> <dd>An object for accessing the requested object store.</dd>\n</dl>\n</div><div id=\"section_16\"><span id=\"Exceptions_2\"></span><h5 class=\"editable\">Exceptions</h5>\n<p>The method can raise an <a title=\"en/IndexedDB/IDBDatabaseException\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException\">IDBDatabaseException</a> with the following code:</p>\n<dl> <dt><code><a title=\"en/IndexedDB/DatabaseException#NOT FOUND ERR\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#NOT_FOUND_ERR\">NOT_FOUND_ERR</a></code></dt> <dd>The requested object store is not in this transaction's scope.</dd> <dt><code><a title=\"en/IndexedDB/DatabaseException#NOT FOUND ERR\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#NOT_FOUND_ERR\">NOT_ALLOWED_ERR</a></code></dt> <dd>request is made on a source object that has been deleted or removed..</dd>\n</dl>\n</div>","idl":"<pre><code>IDBObjectStore objectStore(\n&nbsp; in DOMString name\n) raises (IDBDatabaseException);</code>\n</pre>","obsolete":false},{"url":"","name":"READ_ONLY","help":"Allows data to be read but not changed.&nbsp;","obsolete":false},{"url":"","name":"READ_WRITE","help":"Allows reading and writing of data in existing data stores to be changed.","obsolete":false},{"url":"","name":"VERSION_CHANGE","help":"Allows any operation to be performed, including ones that delete and create object stores and indexes. This mode is for updating the version number of transactions that were started using the <a title=\"en/IndexedDB/IDBDatabase#setVersion\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabase#setVersion\"><code>setVersion()</code></a> method of <a title=\"en/IndexedDB/IDBDatabase\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabase\">IDBDatabase</a> objects. Transactions of this mode cannot run concurrently with other transactions.","obsolete":false},{"url":"","name":"db","help":"The database connection that this transaction is associated with.","obsolete":false},{"url":"","name":"mode","help":"The mode for isolating access to data in the object stores that are in the scope of the transaction. For possible values, see Constants. The default value is <code><a href=\"#const_read_only\" title=\"#const read only\">READ_ONLY</a></code>.","obsolete":false},{"url":"","name":"onabort","help":"The event handler for the <code>onabort</code> event.","obsolete":false},{"url":"","name":"oncomplete","help":"The event handler for the <code>oncomplete</code> event.","obsolete":false},{"url":"","name":"onerror","help":"The event handler for the <code>error </code>event.","obsolete":false},{"name":"onabort","help":"","obsolete":false},{"name":"oncomplete","help":"","obsolete":false},{"name":"onerror","help":"","obsolete":false}]},"Entry":{"title":"Entry","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td>13\n<span title=\"prefix\">webkit</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE&nbsp;Phone</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> </tr> </tbody> </table>\n</div>","summary":"<div><strong>DRAFT</strong> <div>This page is not complete.</div>\n</div>\n<p>The <code>Entry</code> interface of the <a title=\"en/DOM/File_API/File_System_API\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/File_API/File_System_API\">FileSystem API</a> represents entries in a file system. The entries can be a file&nbsp;or a <a href=\"https://developer.mozilla.org/en/DOM/File_API/File_system_API/DirectoryEntry\" rel=\"internal\" title=\"en/DOM/File_API/File_system_API/DirectoryEntry\">DirectoryEntry</a>.</p>","members":[{"name":"getMetadata","help":"<p>Look up metadata about this entry.</p>\n<pre>void getMetada (\n  in MetadataCallback ErrorCallback\n);</pre>\n<div id=\"section_6\"><span id=\"Parameter\"></span><h5 class=\"editable\">Parameter</h5>\n<dl> <dt>successCallback</dt> <dd>A callback that is called with the time of the last modification.</dd> <dt>errorCallback</dt> <dd>A callback that is called when errors happen.</dd>\n</dl>\n</div><div id=\"section_7\"><span id=\"Returns\"></span><h5 class=\"editable\">Returns</h5>\n<dl> <dt><code>void</code></dt>\n</dl>\n</div>","obsolete":false},{"name":"getParent","help":"<p>Look up the parent <code>DirectoryEntry</code> containing this entry. If this entry is the root of its filesystem, its parent is itself.</p>\n<pre>void getParent (\n  <em>(in EntryCallback successCallback, optional ErrorCallback errorCallback);</em>\n);</pre>\n<div id=\"section_21\"><span id=\"Parameter_6\"></span><h5 class=\"editable\">Parameter</h5>\n<dl> <dt>parent</dt> <dd>The directory to which to move the entry.</dd> <dt>newName</dt> <dd>The new name of the entry. Defaults to the entry's current name if unspecified.</dd> <dt>successCellback</dt> <dd>A callback that is called with the entry for the new object.</dd> <dt>errorCallback</dt> <dd>A callback that is called when errors happen.</dd>\n</dl>\n</div><div id=\"section_22\"><span id=\"Returns_6\"></span><h5 class=\"editable\">Returns</h5>\n<dl> <dt><code>void</code></dt>\n</dl>\n</div>","obsolete":false},{"name":"remove","help":"<p>Deletes a file or directory. You cannot delete an empty directory or the root directory of a filesystem.</p>\n<pre>void remove (\n  <em>(in VoidCallback successCallback, optional ErrorCallback errorCallback);</em>\n);</pre>\n<div id=\"section_18\"><span id=\"Parameter_5\"></span><h5 class=\"editable\">Parameter</h5>\n<dl> <dt>successCallback</dt> <dd>A callback that is called with the entry for the new object.</dd> <dt>errorCallback</dt> <dd>A callback that is called when errors happen.</dd>\n</dl>\n</div><div id=\"section_19\"><span id=\"Returns_5\"></span><h5 class=\"editable\">Returns</h5>\n<dl> <dt><code>void</code></dt>\n</dl>\n</div>","obsolete":false},{"name":"copyTo","help":"<p>Copy an entry to a different location on the file system. You cannot copy an entry inside itself if it is a directory nor can you copy it into its parent if a name different from its current one isn't provided. Directory copies are always recursive—that is, they copy all contents of the directory.</p>\n<pre>void vopyTo (\n  <em>(in DirectoryEntry parent, optional DOMString newName, optional EntryCallback successCallback, optional ErrorCallback errorCallback);</em>\n);</pre>\n<div id=\"section_12\"><span id=\"Parameter_3\"></span><h5 class=\"editable\">Parameter</h5>\n<dl> <dt>parent</dt> <dd>The directory to which to move the entry.</dd> <dt>newName</dt> <dd>The new name of the entry. Defaults to the entry's current name if unspecified.</dd> <dt>successCallback</dt> <dd>A callback that is called with the entry for the new object.</dd> <dt>errorCallback</dt> <dd>A callback that is called when errors happen.</dd>\n</dl>\n</div><div id=\"section_13\"><span id=\"Returns_3\"></span><h5 class=\"editable\">Returns</h5>\n<dl> <dt><code>void</code></dt>\n</dl>\n</div>","obsolete":false},{"name":"moveTo","help":"<p>Move an entry to a different location on the file system. You cannot do the following:</p>\n<ul> <li>move a directory inside itself or to any child at any depth;</li> <li>move an entry into its parent if a name different from its current one isn't provided;</li> <li>move a file to a path occupied by a directory;</li> <li>move a directory to a path occupied by a file;</li> <li>move any element to a path occupied by a directory which is not empty.</li>\n</ul>\n<p>Moving a file over an existing file&nbsp;replaces that existing file. A move of a directory on top of an existing empty directory&nbsp;replaces that directory.</p>\n<pre>void moveTo (\n  <em>(in DirectoryEntry parent, optional DOMString newName, optional EntryCallback successCallback, optional ErrorCallback errorCallback);</em>\n);</pre>\n<div id=\"section_9\"><span id=\"Parameter_2\"></span><h5 class=\"editable\">Parameter</h5>\n<dl> <dt>parent</dt> <dd>The directory to which to move the entry.</dd> <dt>newName</dt> <dd>The new name of the entry. Defaults to the entry's current name if unspecified.</dd> <dt>successCallback</dt> <dd>A callback that is called with the entry for the new object.</dd> <dt>errorCallback</dt> <dd>A callback that is called when errors happen.</dd>\n</dl>\n</div><div id=\"section_10\"><span id=\"Returns_2\"></span><h5 class=\"editable\">Returns</h5>\n<dl> <dt><code>void</code></dt>\n</dl>\n</div>","obsolete":false},{"name":"toURL","help":"<p>Returns a URL that can be used to identify this entry. It has no specific expiration. Bcause it describes a location on disk, it is valid for as long as that location exists. Users can supply&nbsp;<code>mimeType</code>&nbsp;to simulate the optional mime-type header associated with HTTP downloads.</p>\n<pre>DOMString toURL (\n  <em>(in </em>optional DOMString mimeType<em>);</em>\n);</pre>\n<div id=\"section_15\"><span id=\"Parameter_4\"></span><h5 class=\"editable\">Parameter</h5>\n<dl> <dt>mimeType</dt> <dd>For a FileEntry, the mime type to be used to interpret the file, when loaded through this URL.</dd>\n</dl>\n</div><div id=\"section_16\"><span id=\"Returns_4\"></span><h5 class=\"editable\">Returns</h5>\n<dl> <dt><code>DOMString</code></dt>\n</dl>\n</div>","obsolete":false},{"url":"","name":"filesystem","help":"The file system on which the entry resides.","obsolete":false},{"url":"","name":"fullpath","help":"The full&nbsp;absolute path&nbsp;from the root to the entry. An&nbsp;absolute path&nbsp;is a&nbsp;relative path&nbsp;from the root directory, prepended with a '/'. A relative path describes how to get from a particular directory to a file or directory. All methods that accept paths are on DirectoryEntry or DirectoryEntrySync objects; the paths, if relative, are interpreted as being relative to the directories represented by these objects.","obsolete":false},{"url":"","name":"isDirectory","help":"The entry is a directory.","obsolete":false},{"url":"","name":"isFile","help":"The entry is a file.","obsolete":false},{"url":"","name":"name","help":"The name of the entry, excluding the path leading to it.","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/DOM/File_API/File_System_API/Entry"},"WheelEvent":{"title":"nsIDOMMouseScrollEvent","members":[],"srcUrl":"https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsIDOMMouseScrollEvent","skipped":true,"cause":"Suspect title"},"Coordinates":{"title":"Drawing shapes","members":[],"srcUrl":"https://developer.mozilla.org/en/Canvas_tutorial/Drawing_shapes","skipped":true,"cause":"Suspect title"},"HTMLDocument":{"title":"HTMLDocument","summary":"<p><code>HTMLDocument</code> is an abstract interface of the <a title=\"en/DOM\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM\">DOM</a> which provides access to special properties and methods not present by default on a regular (XML) document.</p>\n<p>Its methods and properties are noted (as asterisks) on the <a title=\"en/DOM/document\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/document\">document</a> page.</p>","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/HTMLDocument","specification":"http://www.w3.org/TR/DOM-Level-2-HTM...ml#ID-26809268"},"SVGDefsElement":{"title":"SVGDefsElement","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> </tbody> </table>\n</div>","summary":"The <code>SVGDefsElement</code> interface corresponds to the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/defs\">&lt;defs&gt;</a></code>\n element.","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/SVGDefsElement"},"Touch":{"title":"Touch","examples":["See the <a title=\"en/DOM/Touch events#Example\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/Touch_events#Example\">example on the main Touch events article</a>."],"srcUrl":"https://developer.mozilla.org/en/DOM/Touch","specification":"Touch Events Specification","seeAlso":"<li><a title=\"en/DOM/Touch events\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/Touch_events\">Touch events</a></li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Touch\">Touch</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/TouchList\">TouchList</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/TouchEvent\">TouchEvent</a></code>\n</li>","summary":"A <code>Touch</code> object represents a single point of contact between the user and a touch-sensitive interface device (which may be, for example, a touchscreen or a trackpad).","members":[{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/Touch.screenY","name":"screenY","help":"The Y coordinate of the touch point relative to the screen, not including any scroll offset. <strong>Read only.</strong>"},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/Touch.pageY","name":"pageY","help":"The Y coordinate of the touch point relative to the viewport, including any scroll offset. <strong>Read only.</strong>"},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/Touch.identifier","name":"identifier","help":"A unique identifier for this <code>Touch</code> object. A given touch (say, by a finger) will have the same identifier for the duration of its movement around the surface. This lets you ensure that you're tracking the same touch all the time. <strong>Read only.</strong>"},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/Touch.clientY","name":"clientY","help":"The Y coordinate of the touch point relative to the viewport, not including any scroll offset. <strong>Read only.</strong>"},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/Touch.pageX","name":"pageX","help":"The X coordinate of the touch point relative to the viewport, including any scroll offset. <strong>Read only.</strong>"},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/Touch.clientX","name":"clientX","help":"The X coordinate of the touch point relative to the viewport, not including any scroll offset. <strong>Read only.</strong>"},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/Touch.radiusX","name":"radiusX","help":"The X radius of the ellipse that most closely circumscribes the area of contact with the screen. The value is in pixels of the same scale as <code>screenX</code>. <strong>Read only.</strong>"},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/Touch.rotationAngle","name":"rotationAngle","help":"The angle (in degrees)&nbsp;that the ellipse described by radiusX and radiusY must be rotated, clockwise, to most accurately cover the area of contact between the user and the surface. <strong>Read only.</strong>"},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/Touch.screenX","name":"screenX","help":"The X coordinate of the touch point relative to the screen, not including any scroll offset. <strong>Read only.</strong>"},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/Touch.force","name":"force","help":"The amount of pressure being applied to the surface by the user, as a float between 0.0 (no pressure) and 1.0 (maximum pressure). <strong>Read only.</strong>"},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/Touch.radiusY","name":"radiusY","help":"The Y radius of the ellipse that most closely circumscribes the area of contact with the screen. The value is in pixels of the same scale as <code>screenY</code>. <strong>Read only.</strong>"}]},"HTMLDataListElement":{"title":"HTMLDataListElement","seeAlso":"The <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/datalist\">&lt;datalist&gt;</a></code>\n element, which implements this interface.","summary":"DOM Datalist objects expose the <a class=\" external\" title=\"http://www.whatwg.org/specs/web-apps/current-work/multipage/the-button-element.html#the-datalist-element\" rel=\"external\" href=\"http://www.whatwg.org/specs/web-apps/current-work/multipage/the-button-element.html#the-datalist-element\" target=\"_blank\">HTMLDataListElement</a> interface, which provides special properties (beyond the <a href=\"https://developer.mozilla.org/en/DOM/element\" rel=\"internal\">element</a> object interface they also have available to them by inheritance) to manipulate <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/datalist\">&lt;datalist&gt;</a></code>\n elements and their content.","members":[{"name":"options","help":"A collection of the contained option elements.","obsolete":false},{"name":"options","help":"A collection of the contained option elements.","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/DOM/HTMLDataListElement"},"CSSValue":{"title":"text-overflow","members":[],"srcUrl":"https://developer.mozilla.org/en/CSS/text-overflow","skipped":true,"cause":"Suspect title"},"HTMLBaseElement":{"title":"HTMLBaseElement","summary":"The <code>base</code> object exposes the <a class=\" external\" title=\"http://www.w3.org/TR/html5/semantics.html#htmlbaseelement\" rel=\"external\" href=\"http://www.w3.org/TR/html5/semantics.html#htmlbaseelement\" target=\"_blank\">HTMLBaseElement</a> (or \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML\">HTML 4</a></span> <a class=\"external\" target=\"_blank\" rel=\"external\" href=\"http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-73629039\" title=\"http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-73629039\">HTMLBaseElement</a>) interface which contains the base URI&nbsp;for a document.&nbsp; This object inherits all of the properties and methods as described in the <a class=\"internal\" title=\"en/DOM/element\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/element\">element</a> section.","members":[{"name":"href","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/base#attr-href\">href</a></code>\n HTML attribute, containing a base URL for relative URLs in the document.","obsolete":false},{"name":"target","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/base#attr-target\">target</a></code>\n HTML attribute, containing a default target browsing context or frame for elements that do not have a target reference specified.","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/DOM/HTMLBaseElement"},"CanvasGradient":{"title":"CanvasGradient","summary":"This is an opaque object representing a gradient and returned by <a title=\"en/DOM/CanvasRenderingContext2D\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/CanvasRenderingContext2D\">CanvasRenderingContext2D</a>'s <a title=\"en/DOM/CanvasRenderingContext2D.createLinearGradient\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/CanvasRenderingContext2D\">createLinearGradient</a> or <a title=\"en/DOM/CanvasRenderingContext2D.createRadialGradient\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/CanvasRenderingContext2D\">createRadialGradient</a> methods.","members":[{"name":"addColorStop","help":"","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/DOM/CanvasGradient","specification":"http://www.whatwg.org/specs/web-apps...canvasgradient"},"HTMLLIElement":{"title":"li","examples":["<pre name=\"code\" class=\"xml\">&lt;ol&gt;\n    &lt;li&gt;first item&lt;/li&gt;\n    &lt;li&gt;second item&lt;/li&gt;\n    &lt;li&gt;third item&lt;/li&gt;\n&lt;/ol&gt;</pre>\n        \n<p>The above HTML will output:</p>\n<ol> <li>first item</li> <li>second item</li> <li>third item</li>\n</ol>\n\n          <pre name=\"code\" class=\"xml\">&lt;ul&gt;\n    &lt;li&gt;first item&lt;/li&gt;\n    &lt;li&gt;second item&lt;/li&gt;\n    &lt;li&gt;third item&lt;/li&gt;\n&lt;/ul&gt;</pre>\n        \n<ul> <li>first item</li> <li>second item</li> <li>third item</li>\n</ul>\n<p>For more detailed examples, see the <a title=\"en/HTML/Element/ol#Examples\" rel=\"internal\" href=\"https://developer.mozilla.org/en/HTML/Element/ol#Examples\">&lt;ol&gt;</a> and <a title=\"en/HTML/Element/ul#Examples\" rel=\"internal\" href=\"https://developer.mozilla.org/en/HTML/Element/ul#Examples\">&lt;ul&gt;</a> pages.</p>"],"srcUrl":"https://developer.mozilla.org/en/HTML/Element/li","seeAlso":"<li>Other list-related HTML&nbsp;Elements: <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/ul\">&lt;ul&gt;</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/li\">&lt;li&gt;</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/menu\">&lt;menu&gt;</a></code>\n and the obsolete <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/dir\">&lt;dir&gt;</a></code>\n;</li> <li>CSS properties that may be specially useful to style the <span>&lt;li&gt;</span> element: <ul> <li>the <a title=\"en/CSS/list-style\" rel=\"internal\" href=\"https://developer.mozilla.org/en/CSS/list-style\">list-style</a> property, to choose the way the ordinal is displayed,</li> <li><a title=\"en/CSS_Counters\" rel=\"internal\" href=\"https://developer.mozilla.org/en/CSS_Counters\">CSS counters</a>, to handle complex nested lists,</li> <li>the <a title=\"en/CSS/margin\" rel=\"internal\" href=\"https://developer.mozilla.org/en/CSS/margin\">margin</a> property, to control the indent of the list item.</li> </ul> </li>","summary":"The <em>HTML List item element</em> (<code>&lt;li&gt;</code>) is used to represent a list item. It should be contained in an ordered list (<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/ol\">&lt;ol&gt;</a></code>\n), an unordered list (<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/ul\">&lt;ul&gt;</a></code>\n) or a menu (<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/menu\">&lt;menu&gt;</a></code>\n), where it represents a single entity in that list. In menus and unordered lists, list items are ordinarily displayed using bullet points. In order lists, they are usually displayed with some ascending counter on the left such as a number or letter","members":[{"obsolete":false,"url":"","name":"type","help":"This character attributes indicates the numbering type: <ul> <li><code>a</code>: lowercase letters</li> <li><code>A</code>: uppercase letters</li> <li><code>i</code>: lowercase Roman numerals</li> <li><code>I</code>: uppercase Roman numerals</li> <li><code>1</code>: numbers</li> </ul> This type overrides the one used by its parent <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/ol\">&lt;ol&gt;</a></code>\n element, if any.<br> <div class=\"note\"><strong>Usage note:</strong> This attribute has been deprecated: use the CSS <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/CSS/list-style-type\">list-style-type</a></code>\n property instead.</div>"},{"obsolete":false,"url":"","name":"value","help":"This integer attributes indicates the current ordinal value of the item in the list as defined by the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/ol\">&lt;ol&gt;</a></code>\n element. The only allowed value for this attribute is a number, even if the list is displayed with Roman numerals or letters. List items that follow this one continue numbering from the value set. The <strong>value</strong> attribute has no meaning for unordered lists (<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/ul\">&lt;ul&gt;</a></code>\n) or for menus (<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/menu\">&lt;menu&gt;</a></code>\n). <div class=\"note\"><strong>Note</strong>: This attribute was deprecated in HTML4, but reintroduced in HTML5.</div> <div class=\"geckoVersionNote\"> <p>\n</p><div class=\"geckoVersionHeading\">Gecko 9.0 note<div>(Firefox 9.0 / Thunderbird 9.0 / SeaMonkey 2.6)\n</div></div>\n<p></p> <p>Prior to <span title=\"(Firefox 9.0 / Thunderbird 9.0 / SeaMonkey 2.6)\n\">Gecko&nbsp;9.0</span>, negative values were incorrectly converted to 0. Starting in <span title=\"(Firefox 9.0 / Thunderbird 9.0 / SeaMonkey 2.6)\n\">Gecko&nbsp;9.0</span> all integer values are correctly parsed.</p> </div>"}]},"HTMLImageElement":{"title":"HTMLImageElement","examples":["var img1 = new Image(); // DOM 0\nimg1.src = 'image1.png';\nimg1.alt = 'alt';\ndocument.body.appendChild(img1);\n\nvar img2 = document.createElement('img'); // use DOM <a href=\"http://mxr.mozilla.org/mozilla-central/source/dom/interfaces/html/nsIDOMHTMLImageElement.idl\" title=\"http://mxr.mozilla.org/mozilla-central/source/dom/interfaces/html/nsIDOMHTMLImageElement.idl\">HTMLImageElement</a>\nimg2.src = 'image2.jpg';\nimg2.alt = 'alt text';\ndocument.body.appendChild(img2);\n\n// using first image in the document\nalert(document.images[0].src);\n"],"summary":"DOM image objects expose the <a title=\"http://www.w3.org/TR/html5/embedded-content-1.html#htmlimageelement\" class=\" external\" rel=\"external\" href=\"http://www.w3.org/TR/html5/embedded-content-1.html#htmlimageelement\" target=\"_blank\">HTMLImageElement</a> (or \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML\">HTML 4</a></span> <a title=\"http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-17701901\" class=\" external\" rel=\"external\" href=\"http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-17701901\" target=\"_blank\"><code>HTMLImageElement</code></a>) interface, which provides special properties and methods (beyond the regular <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/element\">element</a></code>\n object interface they also have available to them by inheritance) for manipulating the layout and presentation of input elements.","members":[{"name":"align","help":"Indicates the alignment of the image with respect to the surrounding context.","obsolete":true},{"name":"alt","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/img#attr-alt\">alt</a></code>\n HTML attribute, indicating fallback context for the image.","obsolete":false},{"name":"border","help":"Width of the border around the image.","obsolete":true},{"name":"complete","help":"True if the browser has fetched the image, and it is in a <a title=\"en/HTML/Element/Img#Image Format\" rel=\"internal\" href=\"https://developer.mozilla.org/En/HTML/Element/Img#Image_Format\">supported image type</a> that was decoded without errors.","obsolete":false},{"name":"crossOrigin","help":"The CORS setting for this image element. See <a title=\"en/HTML/CORS settings attributes\" rel=\"internal\" href=\"https://developer.mozilla.org/en/HTML/CORS_settings_attributes\">CORS&nbsp;settings attributes</a> for details.","obsolete":false},{"name":"height","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/img#attr-height\">height</a></code>\n HTML attribute, indicating the rendered height of the image in CSS&nbsp;pixels.","obsolete":false},{"name":"hspace","help":"Space to the left and right of the image.","obsolete":true},{"name":"isMap","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/img#attr-ismap\">ismap</a></code>\n HTML attribute, indicating that the image is part of a server-side image map.","obsolete":false},{"name":"longDesc","help":"URI of a long description of the image.","obsolete":true},{"name":"naturalHeight","help":"Intrinsic height of the image in CSS&nbsp;pixels, if it is available; otherwise, 0.","obsolete":false},{"name":"naturalWidth","help":"Intrinsic width of the image in CSS&nbsp;pixels, if it is available; otherwise, 0.","obsolete":false},{"name":"src","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element#attr-src\">src</a></code>\n HTML attribute, containing the URL of the image.","obsolete":false},{"name":"useMap","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/img#attr-usemap\">usemap</a></code>\n HTML attribute, containing a partial URL of a map element.","obsolete":false},{"name":"vspace","help":"Space above and below the image.","obsolete":true},{"name":"width","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/img#attr-width\">width</a></code>\n HTML attribute, indicating the rendered width of the image in CSS&nbsp;pixels.","obsolete":false},{"name":"lowsrc","help":"A reference to a low-quality (but faster to load) copy of the image.","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/DOM/HTMLImageElement"},"StringCallback":{"title":"HTTP server for unit tests","members":[],"srcUrl":"https://developer.mozilla.org/En/Httpd.js/HTTP_server_for_unit_tests","skipped":true,"cause":"Suspect title"},"SVGAngle":{"title":"SVGAngle","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>","summary":"<p>The <code>SVGAngle</code> interface correspond to the <a title=\"https://developer.mozilla.org/en/SVG/Content_type#Angle\" rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Content_type#Angle\">&lt;angle&gt;</a> basic data type.</p>\n<p>An <code>SVGAngle</code> object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown.</p>","members":[{"name":"newValueSpecifiedUnits","help":"<p>Reset the value as a number with an associated unitType, thereby replacing the values for all of the attributes on the object.</p> <p><strong>Exceptions:</strong></p> <ul> <li>a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DOMException\">DOMException</a></code>\n with code <code>NOT_SUPPORTED_ERR</code> is raised if <code>unitType</code> is <code>SVG_ANGLETYPE_UNKNOWN</code> or not a valid unit type constant (one of the other <code>SVG_ANGLETYPE_*</code> constants defined on this interface).</li> <li>a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DOMException\">DOMException</a></code>\n with code <code>NO_MODIFICATION_ALLOWED_ERR</code> is raised when the length corresponds to a read only attribute or when the object itself is read only.</li> </ul>","obsolete":false},{"name":"convertToSpecifiedUnits","help":"Preserve the same underlying stored value, but reset the stored unit identifier to the given <code><em>unitType</em></code>. Object attributes <code>unitType</code>, <code>valueInSpecifiedUnits</code> and <code>valueAsString</code> might be modified as a result of this method.","obsolete":false},{"name":"SVG_ANGLETYPE_UNKNOWN","help":"The unit type is not one of predefined unit types. It is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type.","obsolete":false},{"name":"SVG_ANGLETYPE_UNSPECIFIED","help":"No unit type was provided (i.e., a unitless value was specified). For angles, a unitless value is treated the same as if degrees were specified.","obsolete":false},{"name":"SVG_ANGLETYPE_DEG","help":"The unit type was explicitly set to degrees.","obsolete":false},{"name":"SVG_ANGLETYPE_RAD","help":"The unit type is radians.","obsolete":false},{"name":"SVG_ANGLETYPE_GRAD","help":"The unit type is gradians.","obsolete":false},{"name":"unitType","help":"The type of the value as specified by one of the SVG_ANGLETYPE_* constants defined on this interface.","obsolete":false},{"name":"value","help":"<p>The value as a floating point value, in user units. Setting this attribute will cause <code>valueInSpecifiedUnits</code> and <code>valueAsString</code> to be updated automatically to reflect this setting.</p> <p><strong>Exceptions on setting:</strong> a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DOMException\">DOMException</a></code>\n with code <code>NO_MODIFICATION_ALLOWED_ERR</code> is raised when the length corresponds to a read only attribute or when the object itself is read only.</p>","obsolete":false},{"name":"valueInSpecifiedUnits","help":"<p>The value as a floating point value, in the units expressed by <code>unitType</code>. Setting this attribute will cause <code>value</code> and <code>valueAsString</code> to be updated automatically to reflect this setting.</p> <p><strong>Exceptions on setting:</strong> a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DOMException\">DOMException</a></code>\n with code <code>NO_MODIFICATION_ALLOWED_ERR</code> is raised when the length corresponds to a read only attribute or when the object itself is read only.</p>","obsolete":false},{"name":"valueAsString","help":"<p>The value as a string value, in the units expressed by <code>unitType</code>. Setting this attribute will cause <code>value</code>, <code>valueInSpecifiedUnits</code> and <code>unitType</code> to be updated automatically to reflect this setting.</p> <p><strong>Exceptions on setting:</strong></p> <ul> <li>a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DOMException\">DOMException</a></code>\n with code <code>SYNTAX_ERR</code> is raised if the assigned string cannot be parsed as a valid <a title=\"https://developer.mozilla.org/en/SVG/Content_type#Angle\" rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Content_type#Angle\">&lt;angle&gt;</a>.</li> <li>a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DOMException\">DOMException</a></code>\n with code <code>NO_MODIFICATION_ALLOWED_ERR</code> is raised when the length corresponds to a read only attribute or when the object itself is read only.</li> </ul>","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/DOM/SVGAngle"},"DocumentType":{"title":"DocumentType","summary":"<p><span>NOTE:&nbsp;This interface is not fully supported in Mozilla at present, including for indicating internalSubset information which Gecko generally does otherwise support.</span></p>\n<p><code>DocumentType</code> inherits <a title=\"en/DOM/Node\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/Node\">Node</a>'s properties, methods, and constants as well as the following properties of its own:</p>","members":[{"obsolete":false,"url":"https://developer.mozilla.org/En/DOM/DocumentType.name","name":"name","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/En/DOM/DocumentType.systemId","name":"systemId","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/En/DOM/DocumentType.publicId","name":"publicId","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/En/DOM/DocumentType.internalSubset","name":"internalSubset","help":""}],"srcUrl":"https://developer.mozilla.org/en/DOM/DocumentType","specification":"http://www.w3.org/TR/DOM-Level-3-Cor...l#ID-412266927"},"HTMLTableElement":{"title":"HTMLTableElement","summary":"<code>table</code> objects expose the <code><a class=\"external\" rel=\"external\" href=\"http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-64060425\" title=\"http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-64060425\" target=\"_blank\">HTMLTableElement</a></code> interface, which provides special properties and methods (beyond the regular <a rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/element\" title=\"en/DOM/element\">element</a> object interface they also have available to them by inheritance) for manipulating the layout and presentation of tables in HTML.\n","members":[{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/table.deleteTHead","name":"deleteTHead","help":"<b>deleteTHead</b> removes the table header.\n"},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/table.createTFoot","name":"createTFoot","help":"<b>createTFoot</b> creates a table footer.\n"},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/table.insertRow","name":"insertRow","help":"<b>insertRow</b> inserts a new row.\n"},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/table.deleteCaption","name":"deleteCaption","help":"<b>deleteCaption</b> removes the table caption.\n"},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/table.createCaption","name":"createCaption","help":"<b>createCaption</b> creates a new caption for the table.\n"},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/table.deleteTFoot","name":"deleteTFoot","help":"<b>deleteTFoot</b> removes a table footer.\n"},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/table.createTHead","name":"createTHead","help":"<b>createTHead</b> creates a table header.\n"},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/table.deleteRow","name":"deleteRow","help":"<b>deleteRow</b> removes a row.\n"},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/table.caption","name":"caption","help":"<b>caption</b> returns the table caption.\n"},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/table.tFoot","name":"tFoot","help":"<b>tFoot</b> returns the table footer.\n"},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/table.rows","name":"rows","help":"<b>rows</b> returns the rows in the table.\n"},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/table.width","name":"width","help":"<b>width</b> gets/sets the width of the table.\n"},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/table.cellSpacing","name":"cellSpacing","help":"<b>cellSpacing</b> gets/sets the spacing around the table.\n"},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/table.tHead","name":"tHead","help":"<b>tHead</b> returns the table head.\n"},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/table.bgColor","name":"bgColor","help":"<b>bgColor</b> gets/sets the background color of the table.\n"},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/table.align","name":"align","help":"<b>align</b> gets/sets the alignment of the table.\n"},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/table.cellPadding","name":"cellPadding","help":"<b>cellPadding</b> gets/sets the cell padding.\n"},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/table.tBodies","name":"tBodies","help":"<b>tBodies</b> returns the table bodies.\n"},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/table.summary","name":"summary","help":"<b>summary</b> gets/sets the table summary.\n"},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/table.frame","name":"frame","help":"<b>frame</b> specifies which sides of the table have borders.\n"},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/table.rules","name":"rules","help":"<b>rules</b> specifies which interior borders are visible.\n"},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/table.border","name":"border","help":"<b>border</b> gets/sets the table border.\n"}],"srcUrl":"https://developer.mozilla.org/en/DOM/HTMLTableElement"},"CSSRuleList":{"title":"CSSRuleList","examples":["// get the first style sheet’s first rule\nvar first_rule = document.styleSheets[0].cssRules[0];"],"srcUrl":"https://developer.mozilla.org/en/DOM/CSSRuleList","specification":"<li><a title=\"http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSRuleList\" class=\" external\" rel=\"external\" href=\"http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSRuleList\" target=\"_blank\">DOM Level 2 Style: <code>CSSRuleList</code> interface</a></li> <li><a class=\"external\" rel=\"external\" href=\"http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleSheet-cssRules\" title=\"http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleSheet-cssRules\" target=\"_blank\">DOM Level 2 Style: <code>CSSStyleSheet</code> attribute <code>cssRules</code></a></li> <li><a title=\"http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSMediaRule-cssRules\" class=\" external\" rel=\"external\" href=\"http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSMediaRule-cssRules\" target=\"_blank\">DOM Level 2 Style: <code>CSSMediaRule</code> attribute </a><code><a title=\"http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSMediaRule-cssRules\" class=\" external\" rel=\"external\" href=\"http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSMediaRule-cssRules\" target=\"_blank\">cssRules</a></code></li> <li><a title=\"http://dev.w3.org/csswg/css3-animations/#DOM-CSSKeyframesRule\" class=\" external\" rel=\"external\" href=\"http://dev.w3.org/csswg/css3-animations/#DOM-CSSKeyframesRule\" target=\"_blank\">CSS Animations: <code>CSSKeyframesRule</code> interface</a></li>","seeAlso":"CSSRule","summary":"A <code>CSSRuleList</code> is an array-like object containing an ordered collection of <code><a title=\"en/DOM/cssRule\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/cssRule\">CSSRule</a></code> objects.","members":[]},"SVGSVGElement":{"title":"SVGSVGElement","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td>9.0</td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> </tbody>\n</table>\n</div>\n<div id=\"compat-mobile\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> </tbody>\n</table>\n</div>","srcUrl":"https://developer.mozilla.org/en/DOM/SVGSVGElement","seeAlso":"<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/circle\">&lt;circle&gt;</a></code>\n SVG Element","summary":"The <code>SVGSVGElement</code> interface provides access to the properties of <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/svg\">&lt;svg&gt;</a></code>\n elements, as well as methods to manipulate them. This interface contains also various miscellaneous commonly-used utility methods, such as matrix operations and the ability to control the time of redraw on visual rendering devices.","members":[{"name":"suspendRedraw","help":"<p>Takes a time-out value which indicates that redraw shall not occur until:</p> <ol> <li>the corresponding unsuspendRedraw() call has been made,</li> <li>an unsuspendRedrawAll() call has been made, or</li> <li>its timer has timed out.</li> </ol> <p>In environments that do not support interactivity (e.g., print media), then redraw shall not be suspended. Calls to <code>suspendRedraw()</code> and <code>unsuspendRedraw()</code> should, but need not be, made in balanced pairs.</p> <p>To suspend redraw actions as a collection of SVG DOM changes occur, precede the changes to the SVG DOM with a method call similar to:</p> <p><code>suspendHandleID = suspendRedraw(maxWaitMilliseconds);</code></p> <p>and follow the changes with a method call similar to:</p> <p><code>unsuspendRedraw(suspendHandleID);</code></p> <p>Note that multiple suspendRedraw calls can be used at once and that each such method call is treated independently of the other suspendRedraw method calls.</p>","obsolete":false},{"name":"unsuspendRedraw","help":"Cancels a specified <code>suspendRedraw()</code> by providing a unique suspend handle ID that was returned by a previous <code>suspendRedraw()</code> call.","obsolete":false},{"name":"unsuspendRedrawAll","help":"Cancels all currently active <code>suspendRedraw()</code> method calls. This method is most useful at the very end of a set of SVG DOM calls to ensure that all pending <code>suspendRedraw()</code> method calls have been cancelled.","obsolete":false},{"name":"forceRedraw","help":"In rendering environments supporting interactivity, forces the user agent to immediately redraw all regions of the viewport that require updating.","obsolete":false},{"name":"pauseAnimations","help":"Suspends (i.e., pauses) all currently running animations that are defined within the SVG document fragment corresponding to this <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/svg\">&lt;svg&gt;</a></code>\n element, causing the animation clock corresponding to this document fragment to stand still until it is unpaused.","obsolete":false},{"name":"unpauseAnimations","help":"Unsuspends (i.e., unpauses) currently running animations that are defined within the SVG document fragment, causing the animation clock to continue from the time at which it was suspended.","obsolete":false},{"name":"animationsPaused","help":"Returns true if this SVG document fragment is in a paused state.","obsolete":false},{"name":"getCurrentTime","help":"Returns the current time in seconds relative to the start time for the current SVG document fragment. If getCurrentTime is called before the document timeline has begun (for example, by script running in a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/script\">&lt;script&gt;</a></code>\n element before the document's SVGLoad event is dispatched), then 0 is returned.","obsolete":false},{"name":"setCurrentTime","help":"Adjusts the clock for this SVG document fragment, establishing a new current time. If <code>setCurrentTime</code> is called before the document timeline has begun (for example, by script running in a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/script\">&lt;script&gt;</a></code>\n element before the document's SVGLoad event is dispatched), then the value of seconds in the last invocation of the method gives the time that the document will seek to once the document timeline has begun.","obsolete":false},{"name":"getIntersectionList","help":"Returns the list of graphics elements whose rendered content intersects the supplied rectangle. Each candidate graphics element is to be considered a match only if the same graphics element can be a target of pointer events as defined in \n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Attribute/pointer-events\">pointer-events</a></code> processing.","obsolete":false},{"name":"getEnclosureList","help":"Returns the list of graphics elements whose rendered content is entirely contained within the supplied rectangle. Each candidate graphics element is to be considered a match only if the same graphics element can be a target of pointer events as defined in \n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Attribute/pointer-events\">pointer-events</a></code> processing.","obsolete":false},{"name":"checkIntersection","help":"Returns true if the rendered content of the given element intersects the supplied rectangle. Each candidate graphics element is to be considered a match only if the same graphics element can be a target of pointer events as defined in \n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Attribute/pointer-events\">pointer-events</a></code> processing.","obsolete":false},{"name":"checkEnclosure","help":"Returns true if the rendered content of the given element is entirely contained within the supplied rectangle. Each candidate graphics element is to be considered a match only if the same graphics element can be a target of pointer events as defined in \n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Attribute/pointer-events\">pointer-events</a></code> processing.","obsolete":false},{"name":"deselectAll","help":"Unselects any selected objects, including any selections of text strings and type-in bars.","obsolete":false},{"name":"createSVGNumber","help":"Creates an <code>SVGNumber</code> object outside of any document trees. The object is initialized to a value of zero.","obsolete":false},{"name":"createSVGLength","help":"Creates an <code>SVGLength</code> object outside of any document trees. The object is initialized to a value of zero user units.","obsolete":false},{"name":"createSVGAngle","help":"Creates an <code>SVGAngle</code> object outside of any document trees. The object is initialized to a value of zero degrees (unitless).","obsolete":false},{"name":"createSVGPoint","help":"Creates an <code>SVGPoint</code> object outside of any document trees. The object is initialized to the point (0,0) in the user coordinate system.","obsolete":false},{"name":"createSVGMatrix","help":"Creates an <code>SVGMatrix</code> object outside of any document trees. The object is initialized to the identity matrix.","obsolete":false},{"name":"createSVGRect","help":"Creates an <code>SVGRect</code> object outside of any document trees. The object is initialized such that all values are set to 0 user units.","obsolete":false},{"name":"createSVGTransform","help":"Creates an <code>SVGTransform</code> object outside of any document trees. The object is initialized to an identity matrix transform (<code>SVG_TRANSFORM_MATRIX</code>).","obsolete":false},{"name":"createSVGTransformFromMatrix","help":"Creates an <code>SVGTransform</code> object outside of any document trees. The object is initialized to the given matrix transform (i.e., <code>SVG_TRANSFORM_MATRIX</code>). The values from the parameter matrix are copied, the matrix parameter is not adopted as <code>SVGTransform::matrix</code>.","obsolete":false},{"name":"getElementById","help":"Searches this SVG document fragment (i.e., the search is restricted to a subset of the document tree) for an Element whose id is given by <em>elementId</em>. If an Element is found, that Element is returned. If no such element exists, returns null. Behavior is not defined if more than one element has this id.","obsolete":false},{"name":"width","help":"Corresponds to attribute \n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Attribute/width\">width</a></code> on the given <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/svg\">&lt;svg&gt;</a></code>\n element.","obsolete":false},{"name":"height","help":"Corresponds to attribute \n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Attribute/height\">height</a></code> on the given <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/svg\">&lt;svg&gt;</a></code>\n element.","obsolete":false},{"name":"contentScriptType","help":"Corresponds to attribute \n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Attribute/contentScriptType\">contentScriptType</a></code> on the given <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/svg\">&lt;svg&gt;</a></code>\n element.","obsolete":false},{"name":"contentStyleType","help":"Corresponds to attribute \n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Attribute/contentStyleType\">contentStyleType</a></code> on the given <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/svg\">&lt;svg&gt;</a></code>\n element.","obsolete":false},{"name":"viewport","help":"The position and size of the viewport (implicit or explicit) that corresponds to this <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/svg\">&lt;svg&gt;</a></code>\n element. When the browser is actually rendering the content, then the position and size values represent the actual values when rendering. The position and size values are unitless values in the coordinate system of the parent element. If no parent element exists (i.e., <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/svg\">&lt;svg&gt;</a></code>\n element represents the root of the document tree), if this SVG document is embedded as part of another document (e.g., via the HTML <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/object\">&lt;object&gt;</a></code>\n element), then the position and size are unitless values in the coordinate system of the parent document. (If the parent uses CSS or XSL layout, then unitless values represent pixel units for the current CSS or XSL viewport.)","obsolete":false},{"name":"pixelUnitToMillimeterX","help":"Size of a pixel units (as defined by CSS2) along the x-axis of the viewport, which represents a unit somewhere in the range of 70dpi to 120dpi, and, on systems that support this, might actually match the characteristics of the target medium. On systems where it is impossible to know the size of a pixel, a suitable default pixel size is provided.","obsolete":false},{"name":"pixelUnitToMillimeterY","help":"Corresponding size of a pixel unit along the y-axis of the viewport.","obsolete":false},{"name":"screenPixelToMillimeterX","help":"User interface (UI) events in DOM Level 2 indicate the screen positions at which the given UI event occurred. When the browser actually knows the physical size of a \"screen unit\", this attribute will express that information; otherwise, user agents will provide a suitable default value such as .28mm.","obsolete":false},{"name":"screenPixelToMillimeterY","help":"Corresponding size of a screen pixel along the y-axis of the viewport.","obsolete":false},{"name":"useCurrentView","help":"The initial view (i.e., before magnification and panning) of the current innermost SVG document fragment can be either the \"standard\" view (i.e., based on attributes on the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/svg\">&lt;svg&gt;</a></code>\n element such as \n<code><a rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Attribute/viewBox\" class=\"new\">viewBox</a></code>) or to a \"custom\" view (i.e., a hyperlink into a particular <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/view\">&lt;view&gt;</a></code>\n or other element). If the initial view is the \"standard\" view, then this attribute is false. If the initial view is a \"custom\" view, then this attribute is true.","obsolete":false},{"name":"currentView","help":"The definition of the initial view (i.e., before magnification and panning) of the current innermost SVG document fragment. The meaning depends on the situation:<br> <ul> <li>If the initial view was a \"standard\" view, then: <ul> <li>the values for \n<code><a rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Attribute/viewBox\" class=\"new\">viewBox</a></code>, \n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Attribute/preserveAspectRatio\">preserveAspectRatio</a></code> and \n<code><a rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Attribute/zoomAndPan\" class=\"new\">zoomAndPan</a></code> within \n<code><a rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Attribute/currentView\" class=\"new\">currentView</a></code> will match the values for the corresponding DOM attributes that are on <code>SVGSVGElement</code> directly</li> <li>the values for \n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Attribute/transform\">transform</a></code> and \n<code><a rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Attribute/viewTarget\" class=\"new\">viewTarget</a></code> within \n<code><a rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Attribute/currentView\" class=\"new\">currentView</a></code> will be null</li> </ul> </li> <li>If the initial view was a link into a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/view\">&lt;view&gt;</a></code>\n element, then: <ul> <li>the values for \n<code><a rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Attribute/viewBox\" class=\"new\">viewBox</a></code>, \n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Attribute/preserveAspectRatio\">preserveAspectRatio</a></code> and \n<code><a rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Attribute/zoomAndPan\" class=\"new\">zoomAndPan</a></code> within \n<code><a rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Attribute/currentView\" class=\"new\">currentView</a></code> will correspond to the corresponding attributes for the given <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/view\">&lt;view&gt;</a></code>\n element</li> <li>the values for \n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Attribute/transform\">transform</a></code> and \n<code><a rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Attribute/viewTarget\" class=\"new\">viewTarget</a></code> within \n<code><a rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Attribute/currentView\" class=\"new\">currentView</a></code> will be null</li> </ul> </li> <li>If the initial view was a link into another element (i.e., other than a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/view\">&lt;view&gt;</a></code>\n), then: <ul> <li>the values for \n<code><a rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Attribute/viewBox\" class=\"new\">viewBox</a></code>, \n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Attribute/preserveAspectRatio\">preserveAspectRatio</a></code> and \n<code><a rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Attribute/zoomAndPan\" class=\"new\">zoomAndPan</a></code> within \n<code><a rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Attribute/currentView\" class=\"new\">currentView</a></code> will match the values for the corresponding DOM attributes that are on <code>SVGSVGElement</code> directly for the closest ancestor <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/svg\">&lt;svg&gt;</a></code>\n element</li> <li>the values for \n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Attribute/transform\">transform</a></code> within \n<code><a rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Attribute/currentView\" class=\"new\">currentView</a></code> will be null</li> <li>the \n<code><a rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Attribute/viewTarget\" class=\"new\">viewTarget</a></code> within \n<code><a rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Attribute/currentView\" class=\"new\">currentView</a></code> will represent the target of the link</li> </ul> </li> <li>If the initial view was a link into the SVG document fragment using an SVG view specification fragment identifier (i.e., #svgView(...)), then: <ul> <li>the values for \n<code><a rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Attribute/viewBox\" class=\"new\">viewBox</a></code>, \n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Attribute/preserveAspectRatio\">preserveAspectRatio</a></code>, \n<code><a rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Attribute/zoomAndPan\" class=\"new\">zoomAndPan</a></code>, \n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Attribute/transform\">transform</a></code> and \n<code><a rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Attribute/viewTarget\" class=\"new\">viewTarget</a></code> within \n<code><a rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Attribute/currentView\" class=\"new\">currentView</a></code> will correspond to the values from the SVG view specification fragment identifier</li> </ul> </li> </ul>","obsolete":false},{"name":"currentTranslate","help":"On an outermost <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/svg\">&lt;svg&gt;</a></code>\n element, the corresponding translation factor that takes into account user \"magnification\".","obsolete":false},{"name":"currentScale","help":"On an outermost <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/svg\">&lt;svg&gt;</a></code>\n element, this attribute indicates the current scale factor relative to the initial view to take into account user magnification and panning operations. DOM attributes <code>currentScale</code> and <code>currentTranslate</code> are equivalent to the 2x3 matrix <code>[a b c d e f] = [currentScale 0 0 currentScale currentTranslate.x currentTranslate.y]</code>. If \"magnification\" is enabled (i.e., <code>zoomAndPan=\"magnify\"</code>), then the effect is as if an extra transformation were placed at the outermost level on the SVG document fragment (i.e., outside the outermost <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/svg\">&lt;svg&gt;</a></code>\n element).","obsolete":false}]},"SVGPreserveAspectRatio":{"title":"SVGPreserveAspectRatio","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>","summary":"<p>The <code>SVGPreserveAspectRatio</code> interface corresponds to the \n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Attribute/preserveAspectRatio\">preserveAspectRatio</a></code> attribute, which is available for some of SVG's elements.</p>\n<p>An <code>SVGPreserveAspectRatio</code> object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown.</p>","members":[{"name":"SVG_PRESERVEASPECTRATIO_UNKNOWN","help":"The enumeration was set to a value that is not one of predefined types. It is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type.","obsolete":false},{"name":"SVG_PRESERVEASPECTRATIO_NONE","help":"Corresponds to value <code>none</code> for attribute \n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Attribute/preserveAspectRatio\">preserveAspectRatio</a></code>.","obsolete":false},{"name":"SVG_PRESERVEASPECTRATIO_XMINYMIN","help":"Corresponds to value <code>xMinYMin</code> for attribute \n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Attribute/preserveAspectRatio\">preserveAspectRatio</a></code>.","obsolete":false},{"name":"SVG_PRESERVEASPECTRATIO_XMIDYMIN","help":"Corresponds to value <code>xMidYMin</code> for attribute \n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Attribute/preserveAspectRatio\">preserveAspectRatio</a></code>.","obsolete":false},{"name":"SVG_PRESERVEASPECTRATIO_XMAXYMIN","help":"Corresponds to value <code>xMaxYMin</code> for attribute \n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Attribute/preserveAspectRatio\">preserveAspectRatio</a></code>.","obsolete":false},{"name":"SVG_PRESERVEASPECTRATIO_XMINYMID","help":"Corresponds to value <code>xMinYMid</code> for attribute \n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Attribute/preserveAspectRatio\">preserveAspectRatio</a></code>.","obsolete":false},{"name":"SVG_PRESERVEASPECTRATIO_XMIDYMID","help":"Corresponds to value <code>xMidYMid</code> for attribute \n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Attribute/preserveAspectRatio\">preserveAspectRatio</a></code>.","obsolete":false},{"name":"SVG_PRESERVEASPECTRATIO_XMAXYMID","help":"Corresponds to value <code>xMaxYMid</code> for attribute \n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Attribute/preserveAspectRatio\">preserveAspectRatio</a></code>.","obsolete":false},{"name":"SVG_PRESERVEASPECTRATIO_XMINYMAX","help":"Corresponds to value <code>xMinYMax</code> for attribute \n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Attribute/preserveAspectRatio\">preserveAspectRatio</a></code>.","obsolete":false},{"name":"SVG_PRESERVEASPECTRATIO_XMIDYMAX","help":"Corresponds to value <code>xMidYMax</code> for attribute \n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Attribute/preserveAspectRatio\">preserveAspectRatio</a></code>.","obsolete":false},{"name":"SVG_PRESERVEASPECTRATIO_XMAXYMAX","help":"Corresponds to value <code>xMaxYMax</code> for attribute \n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Attribute/preserveAspectRatio\">preserveAspectRatio</a></code>.","obsolete":false},{"name":"SVG_MEETORSLICE_UNKNOWN","help":"The enumeration was set to a value that is not one of predefined types. It is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type.","obsolete":false},{"name":"SVG_MEETORSLICE_MEET","help":"Corresponds to value <code>meet</code> for attribute \n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Attribute/preserveAspectRatio\">preserveAspectRatio</a></code>.","obsolete":false},{"name":"SVG_MEETORSLICE_SLICE","help":"Corresponds to value <code>slice</code> for attribute \n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Attribute/preserveAspectRatio\">preserveAspectRatio</a></code>.","obsolete":false},{"name":"align","help":"The type of the alignment value as specified by one of the SVG_PRESERVEASPECTRATIO_* constants defined on this interface.","obsolete":false},{"name":"meetOrSlice","help":"The type of the meet-or-slice value as specified by one of the SVG_MEETORSLICE_* constants defined on this interface.","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/DOM/SVGPreserveAspectRatio"},"MediaError":{"title":"HTMLMediaElement","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/HTMLMediaElement","skipped":true,"cause":"Suspect title"},"WebSocket":{"title":"WebSocket","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td>4.0 (2.0)\n</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td>Sub-protocol support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td>6.0 (6.0)\n</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td>7.0 (7.0)\n</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td>Sub-protocol support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td>7.0 (7.0)\n</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>","srcUrl":"https://developer.mozilla.org/en/WebSockets/WebSockets_reference/WebSocket","seeAlso":"<li><a title=\"en/WebSockets/Writing WebSocket client applications\" rel=\"internal\" href=\"https://developer.mozilla.org/en/WebSockets/Writing_WebSocket_client_applications\">Writing WebSocket client applications</a></li> <li><a class=\"external\" title=\"http://dev.w3.org/html5/websockets/\" rel=\"external\" href=\"http://dev.w3.org/html5/websockets/\" target=\"_blank\">HTML5:&nbsp;WebSockets</a></li>","summary":"<div><p><strong>This is an experimental feature</strong><br>Because this feature is still in development in some browsers, check the <a href=\"#AutoCompatibilityTable\">compatibility table</a> for the proper prefixes to use in various browsers.</p></div>\n<p></p>\n<p>The <code>WebSocket</code> object provides the API&nbsp;for creating and managing a <a title=\"en/WebSockets\" rel=\"internal\" href=\"https://developer.mozilla.org/en/WebSockets\">WebSocket</a> connection to a server, as well as for sending and receiving data on the connection.</p>","members":[{"name":"send","help":"<p>Transmits data to the server over the WebSocket connection.</p>\n\n<div id=\"section_11\"><span id=\"Parameters_2\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>data</code></dt> <dd>A text string to send to the server.</dd>\n</dl>\n</div><div id=\"section_12\"><span id=\"Exceptions_thrown_2\"></span><h6 class=\"editable\">Exceptions thrown</h6>\n<dl> <dt><code>INVALID_STATE_ERR</code></dt> <dd>The connection is not currently <code>OPEN</code>.</dd> <dt><code>SYNTAX_ERR</code></dt> <dd>The data is a string that has unpaired surrogates.</dd>\n</dl>\n</div><div id=\"section_13\"><span id=\"Remarks\"></span><h6 class=\"editable\">Remarks</h6>\n<div class=\"geckoVersionNote\"> <p>\n</p><div class=\"geckoVersionHeading\">Gecko 6.0 note<div>(Firefox 6.0 / Thunderbird 6.0 / SeaMonkey 2.3)\n</div></div>\n<p></p> <p>Gecko's implementation of the <code>send()</code>&nbsp;method differs somewhat from the specification in Gecko 6.0; Gecko returns a <code>boolean</code> indicating whether or not the connection is still open (and, by extension, that the data was successfully queued or transmitted); this is corrected in Gecko 8.0 (Firefox 8.0 / Thunderbird 8.0 / SeaMonkey 2.5)\n. In addition, at this time, Gecko does not support <code><a title=\"en/JavaScript typed arrays/ArrayBuffer\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/ArrayBuffer\">ArrayBuffer</a></code> or <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Blob\">Blob</a></code>\n data types.</p>\n</div>\n</div>","idl":"<pre class=\"eval\">void send(\n  in DOMString data\n);\n\nvoid send(\n&nbsp; in ArrayBuffer data\n);\n\nvoid send(\n&nbsp; in Blob data\n); \n</pre>","obsolete":false},{"name":"close","help":"<p>Closes the WebSocket connection or connection attempt, if any. If the connection is already <code>CLOSED</code>, this method does nothing.</p>\n\n<div id=\"section_7\"><span id=\"Parameters\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>code</code> \n<span title=\"\">Optional</span>\n</dt> <dd>A numeric value indicating the status code explaining why the connection is being closed. If this parameter is not specified, a default value of 1000 (indicating a normal \"transaction complete\"&nbsp;closure)&nbsp;is assumed. See the <a title=\"en/WebSockets/WebSockets reference/CloseEvent#Status codes\" rel=\"internal\" href=\"https://developer.mozilla.org/en/WebSockets/WebSockets_reference/CloseEvent#Status_codes\">list of status codes</a> on the <a title=\"en/WebSockets/WebSockets reference/CloseEvent\" rel=\"internal\" href=\"https://developer.mozilla.org/en/WebSockets/WebSockets_reference/CloseEvent\"><code>CloseEvent</code></a> page for permitted values.</dd> <dt><code>reason</code> \n<span title=\"\">Optional</span>\n</dt> <dd>A human-readable string explaining why the connection is closing. This string must be no longer than 123 UTF-8 characters.</dd>\n</dl>\n</div><div id=\"section_8\"><span id=\"Exceptions_thrown\"></span><h6 class=\"editable\">Exceptions thrown</h6>\n<dl> <dt><code>INVALID_ACCESS_ERR</code></dt> <dd>An invalid <code>code</code> was specified.</dd> <dt><code>SYNTAX_ERR</code></dt> <dd>The <code>reason</code> string is too long or contains unpaired surrogates.</dd>\n</dl>\n</div>","idl":"<pre class=\"eval\">void close(\n&nbsp; in optional unsigned short code,\n&nbsp;&nbsp;in optional DOMString reason\n);\n</pre>","obsolete":false},{"name":"CONNECTING","help":"The connection is not yet open.","obsolete":false},{"name":"OPEN","help":"The connection is open and ready to communicate.","obsolete":false},{"name":"CLOSING","help":"The connection is in the process of closing.","obsolete":false},{"name":"CLOSED","help":"The connection is closed or couldn't be opened.","obsolete":false},{"name":"binaryType","help":"A string indicating the type of binary data being transmitted by the connection. This should be either \"blob\"&nbsp;if DOM&nbsp;<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Blob\">Blob</a></code>\n&nbsp;objects are being used or \"arraybuffer\" if <a title=\"en/JavaScript typed arrays/ArrayBuffer\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/ArrayBuffer\"><code>ArrayBuffer</code></a> objects are being used.","obsolete":false},{"name":"bufferedAmount","help":"The number of bytes of data that have been queued using calls to  but not yet transmitted to the network. This value does not reset to zero when the connection is closed; if you keep calling , this will continue to climb. <strong>Read only.</strong>","obsolete":false},{"name":"extensions","help":"The extensions selected by the server. This is currently only the empty string or a list of extensions as negotiated by the connection.","obsolete":false},{"name":"onclose","help":"An event listener to be called when the WebSocket connection's <code>readyState</code> changes to <code>CLOSED</code>. The listener receives a <a title=\"en/WebSockets/WebSockets reference/CloseEvent\" rel=\"internal\" href=\"https://developer.mozilla.org/en/WebSockets/WebSockets_reference/CloseEvent\"><code>CloseEvent</code></a> named \"close\".","obsolete":false},{"name":"onerror","help":"An event listener to be called when an error occurs. This is a simple event named \"error\".","obsolete":false},{"name":"onmessage","help":"An event listener to be called when a message is received from the server. The listener receives a <a title=\"en/WebSockets/WebSockets reference/MessageEvent\" rel=\"internal\" href=\"https://developer.mozilla.org/en/WebSockets/WebSockets_reference/MessageEvent\"><code>MessageEvent</code></a> named \"message\".","obsolete":false},{"name":"onopen","help":"An event listener to be called when the WebSocket connection's <code>readyState</code> changes to <code>OPEN</code>; this indicates that the connection is ready to send and receive data. The event is a simple one with the name \"open\".","obsolete":false},{"name":"protocol","help":"A string indicating the name of the sub-protocol the server selected; this will be one of the strings specified in the <code>protocols</code> parameter when creating the WebSocket object.","obsolete":false},{"name":"readyState","help":"The current state of the connection; this is one of the <a rel=\"custom\" href=\"https://developer.mozilla.org/en/WebSockets/WebSockets_reference/WebSocket#Ready_state_constants\">Ready state constants</a>. <strong>Read only.</strong>","obsolete":false},{"name":"url","help":"The URL&nbsp;as resolved by the constructor. This is always an absolute URL. <strong>Read only.</strong>","obsolete":false}]},"SVGAnimatedInteger":{"title":"SVGAnimatedInteger","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody>\n</table>\n</div>\n<div id=\"compat-mobile\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody>\n</table>\n</div>","summary":"The <code>SVGAnimatedInteger</code> interface is used for attributes of basic type <a title=\"https://developer.mozilla.org/en/SVG/Content_type#Integer\" rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Content_type#Integer\">&lt;integer&gt;</a> which can be animated.","members":[{"name":"baseVal","help":"The base value of the given attribute before applying any animations.","obsolete":false},{"name":"animVal","help":"If the given attribute or property is being animated, contains the current animated value of the attribute or property. If the given attribute or property is not currently being animated, contains the same value as <code>baseVal</code>.","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/DOM/SVGAnimatedInteger"},"PositionError":{"title":"Using geolocation","members":[],"srcUrl":"https://developer.mozilla.org/en/Using_geolocation","skipped":true,"cause":"Suspect title"},"Worker":{"title":"Worker","srcUrl":"https://developer.mozilla.org/En/DOM/Worker","seeAlso":"<li><a class=\"internal\" title=\"en/Using DOM workers\" rel=\"internal\" href=\"https://developer.mozilla.org/En/Using_web_workers\">Using web workers</a></li> <li><a title=\"https://developer.mozilla.org/En/DOM/Worker/Functions_available_to_workers\" rel=\"internal\" href=\"https://developer.mozilla.org/En/DOM/Worker/Functions_available_to_workers\">Functions available to workers</a></li> <li>\n<a rel=\"custom\" href=\"http://www.w3.org/TR/workers/\">Web Workers - W3C</a><span title=\"Working Draft\">WD</span></li> <li><a class=\"external\" title=\"http://www.whatwg.org/specs/web-workers/current-work/\" rel=\"external\" href=\"http://www.whatwg.org/specs/web-workers/current-work/\" target=\"_blank\">Web Workers specification - WHATWG</a></li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/SharedWorker\">SharedWorker</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/ChromeWorker\">ChromeWorker</a></code>\n</li>","summary":"<p>Workers are background tasks that can be easily created and can send messages back to their creators. Creating a worker is as simple as calling the <code>Worker()</code>&nbsp;constructor, specifying a script to be run in the worker thread.</p>\n<p>Of note is the fact that workers may in turn spawn new workers as long as those workers are hosted within the same origin as the parent page.&nbsp; In addition, workers may use <a title=\"En/XMLHttpRequest\" class=\"internal\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/XMLHttpRequest\"><code>XMLHttpRequest</code></a> for network I/O, with the exception that the <code>responseXML</code> and <code>channel</code> attributes on <code>XMLHttpRequest</code> always return <code>null</code>.</p>\n<p>For a list of global functions available to workers, see <a title=\"En/DOM/Worker/Functions available to workers\" rel=\"internal\" href=\"https://developer.mozilla.org/En/DOM/Worker/Functions_available_to_workers\">Functions available to workers</a>.</p>\n<div class=\"geckoVersionNote\">\n<p>\n</p><div class=\"geckoVersionHeading\">Gecko 2.0 note<div>(Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1)\n</div></div>\n<p></p>\n<p>If you want to use workers in extensions, and would like to have access to <a title=\"en/js-ctypes\" rel=\"internal\" href=\"https://developer.mozilla.org/en/js-ctypes\">js-ctypes</a>, you should use the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/ChromeWorker\">ChromeWorker</a></code>\n object instead.</p>\n</div>\n<p>See <a class=\"internal\" title=\"en/Using DOM workers\" rel=\"internal\" href=\"https://developer.mozilla.org/En/Using_web_workers\">Using web workers</a> for examples and details.</p>","constructor":"<p>The constructor creates a web worker that executes the script at the specified URL. This script must obey the <a title=\"Same origin policy for JavaScript\" rel=\"internal\" href=\"https://developer.mozilla.org/en/Same_origin_policy_for_JavaScript\">same-origin policy</a>. Note that there is a disagreement among browser manufacturers about whether a data URI is of the same origin or not. Though Gecko 10.0 (Firefox 10.0 / Thunderbird 10.0)\n and later accept data URIs, that's not the case in all other browsers.</p>\n<pre>Worker(\n&nbsp;&nbsp;in DOMString aStringURL\n);\n</pre>\n<div id=\"section_6\"><span id=\"Parameters\"></span><h5 class=\"editable\">Parameters</h5>\n<dl> <dt><code>aStringURL</code></dt> <dd>The URL of the script the worker is to execute. It must obey the same-origin policy (or be a data URI for Gecko 10.0 or later).</dd>\n</dl>\n<div id=\"section_7\"><span id=\"Return_value\"></span><h6 class=\"editable\">Return value</h6>\n<p>A new <code>Worker</code>.</p>\n</div></div>","members":[{"name":"postMessage","help":"<p>Sends a message to the worker's inner scope. This accepts a single parameter, which is the data to send to the worker. The data may be any value or JavaScript object that does not contain functions or cyclical references (since the object is converted to <a class=\"internal\" title=\"En/JSON\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JSON\">JSON</a> internally).</p>\n\n<div id=\"section_10\"><span id=\"Parameters_2\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>aMessage<br> </code></dt> <dd>The object to deliver to the worker; this will be in the data field in the event delivered to the <code>onmessage</code> handler. This may be any value or JavaScript object that does not contain functions or cyclical references (since the object is converted to <a class=\"internal\" title=\"En/JSON\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JSON\">JSON</a> internally).</dd>\n</dl>\n</div>","idl":"<pre>void postMessage(\n&nbsp;&nbsp;in JSObject aMessage\n);\n</pre>","obsolete":false},{"name":"terminate","help":"<p>Immediately terminates the worker. This does not offer the worker an opportunity to finish its operations; it is simply stopped at once.</p>\n<pre>void terminate();\n</pre>","obsolete":false},{"name":"onmessage","help":"An event listener that is called whenever a <code>MessageEvent</code> with type <code>message</code> bubbles through the worker. The message is stored in the event's <code>data</code> member.","obsolete":false},{"name":"onerror","help":"An event listener that is called whenever an <code>ErrorEvent</code> with type <code>error</code> bubbles through the worker.","obsolete":false}]},"Rect":{"title":"rect","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\">\nFeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari <table class=\"compat-table\"> <tbody> <tr> <td>Basic support</td> <td>1.0</td> <td>1.5 (1.8)\n</td> <td>\n9.0</td> <td>\n8.0</td> <td>\n3.0.4</td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE&nbsp;Phone</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td>\n3.0</td> <td>1.0 (1.8)\n</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td>\n3.0.4</td> </tr> </tbody> </table>\n</div>\n<p>The chart is based on <a title=\"en/SVG/Compatibility sources\" rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Compatibility_sources\">these sources</a>.</p>","srcUrl":"https://developer.mozilla.org/en/SVG/Element/rect","seeAlso":"&lt;path&gt;","summary":"The <code>rect</code> element is an SVG basic shape, used to create rectangles based on the position of a corner and their width and height. It may also be used to create rectangles with rounded corners.","members":[]},"SVGPathSegMovetoRel":{"title":"SVGPathElement","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/SVGPathElement","skipped":true,"cause":"Suspect title"},"HTMLDirectoryElement":{"title":"dir","seeAlso":"<li>Other list-related HTML&nbsp;Elements: <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/ol\">&lt;ol&gt;</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/ul\">&lt;ul&gt;</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/li\">&lt;li&gt;</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/menu\">&lt;menu&gt;</a></code>\n;</li> <li>CSS properties that may be specially useful to style the <span>&lt;dir&gt;</span> element:&nbsp; <ul> <li>the <a title=\"en/CSS/list-style\" rel=\"internal\" href=\"https://developer.mozilla.org/en/CSS/list-style\">list-style</a> property, useful to choose the way the ordinal is displayed,</li> <li><a title=\"en/CSS_Counters\" rel=\"internal\" href=\"https://developer.mozilla.org/en/CSS_Counters\">CSS counters</a>, useful to handle complex nested lists,</li> <li>the <a title=\"en/CSS/line-height\" rel=\"internal\" href=\"https://developer.mozilla.org/en/CSS/line-height\">line-height</a> property, useful to simulate the deprecated \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/dir#attr-compact\">compact</a></code>\n attribute,</li> <li>the <a title=\"en/CSS/margin\" rel=\"internal\" href=\"https://developer.mozilla.org/en/CSS/margin\">margin</a> property, useful to control the indent of the list.</li> </ul> </li>","summary":"Obsolete","members":[{"obsolete":false,"url":"","name":"compact","help":"This Boolean attribute hints that the list should be rendered in a compact style. The interpretation of this attribute depends on the user agent and it doesn't work in all browsers. <div class=\"note\"><strong>Usage note:&nbsp;</strong>Do not use this attribute, as it has been deprecated: the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/dir\">&lt;dir&gt;</a></code>\n element should be styled using <a title=\"en/CSS\" rel=\"internal\" href=\"https://developer.mozilla.org/en/CSS\">CSS</a>. To give a similar effect than the <span>compact</span> attribute, the <a title=\"en/CSS\" rel=\"internal\" href=\"https://developer.mozilla.org/en/CSS\">CSS</a> property <a title=\"en/CSS/line-height\" rel=\"internal\" href=\"https://developer.mozilla.org/en/CSS/line-height\">line-height</a> can be used with a value of <span>80%</span>.</div>"}],"srcUrl":"https://developer.mozilla.org/en/HTML/Element/dir"},"SVGPointList":{"title":"SVGAnimatedPoints","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/SVGAnimatedPoints","skipped":true,"cause":"Suspect title"},"SVGFESpecularLightingElement":{"title":"feSpecularLighting","seeAlso":"<li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/filter\">&lt;filter&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feBlend\">&lt;feBlend&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feColorMatrix\">&lt;feColorMatrix&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feComponentTransfer\">&lt;feComponentTransfer&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feComposite\">&lt;feComposite&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feConvolveMatrix\">&lt;feConvolveMatrix&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feDiffuseLighting\">&lt;feDiffuseLighting&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feDisplacementMap\">&lt;feDisplacementMap&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feDistantLight\">&lt;feDistantLight&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feFlood\">&lt;feFlood&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feGaussianBlur\">&lt;feGaussianBlur&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feImage\">&lt;feImage&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feMerge\">&lt;feMerge&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feMorphology\">&lt;feMorphology&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feOffset\">&lt;feOffset&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/fePointLight\">&lt;fePointLight&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feSpotLight\">&lt;feSpotLight&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feTile\">&lt;feTile&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feTurbulence\">&lt;feTurbulence&gt;</a></code>\n</li> <li><a title=\"en/SVG/Tutorial/Filter_effects\" rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Tutorial/Filter_effects\">SVG tutorial: Filter effects</a></li>","members":[{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/kernelUnitLength","name":"kernelUnitLength","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/surfaceScale","name":"surfaceScale","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/class","name":"class","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/specularExponent","name":"specularExponent","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/specularConstant","name":"specularConstant","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/in","name":"in","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/style","name":"style","help":"Specific attributes"}],"srcUrl":"https://developer.mozilla.org/en/SVG/Element/feSpecularLighting"},"NodeSelector":{"title":"Locating DOM elements using selectors","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/Locating_DOM_elements_using_selectors","skipped":true,"cause":"Suspect title"},"FileException":{"title":"FileException","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td>13\n<span title=\"prefix\">webkit</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE&nbsp;Phone</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> </tr> </tbody> </table>\n</div>","summary":"<strong>DRAFT</strong> <div>This page is not complete.</div>","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/File_API/File_System_API/FileException"},"SVGAnimationElement":{"title":"SVGAnimationElement","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> </tbody>\n</table>\n</div>\n<div id=\"compat-mobile\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> </tbody>\n</table>\n</div>","summary":"The <code>SVGAnimationElement</code> interface is the base interface for all of the animation element interfaces: <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/SVGAnimateElement\">SVGAnimateElement</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/SVGSetElement\">SVGSetElement</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/SVGAnimateColorElement\">SVGAnimateColorElement</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/SVGAnimateMotionElement\">SVGAnimateMotionElement</a></code>\n and <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/SVGAnimateTransformElement\">SVGAnimateTransformElement</a></code>\n.","members":[{"name":"getStartTime","help":"Returns the begin time, in seconds, for this animation element's current interval, if it exists, regardless of whether the interval has begun yet. If there is no current interval, then a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DOMException\">DOMException</a></code>\n with code INVALID_STATE_ERR is thrown.","obsolete":false},{"name":"getCurrentTime","help":"Returns the current time in seconds relative to time zero for the given time container.","obsolete":false},{"name":"getSimpleDuration","help":"Returns the number of seconds for the simple duration for this animation. If the simple duration is undefined (e.g., the end time is indefinite), then a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DOMException\">DOMException</a></code>\n with code NOT_SUPPORTED_ERR is raised.","obsolete":false},{"name":"targetElement","help":"The element which is being animated.","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/DOM/SVGAnimationElement"},"SVGAnimatedBoolean":{"title":"SVGAnimatedBoolean","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody>\n</table>\n</div>\n<div id=\"compat-mobile\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody>\n</table>\n</div>","summary":"The <code>SVGAnimatedBoolean</code> interface is used for attributes of type boolean which can be animated.","members":[{"name":"baseVal","help":"The base value of the given attribute before applying any animations.","obsolete":false},{"name":"animVal","help":"If the given attribute or property is being animated, contains the current animated value of the attribute or property. If the given attribute or property is not currently being animated, contains the same value as <code>baseVal</code>.","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/Document_Object_Model_(DOM)/SVGAnimatedBoolean"},"XPathExpression":{"title":"XPathExpression","summary":"An XPathExpression is a compiled XPath query returned from <a rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/document.createExpression\" title=\"en/DOM/document.createExpression\">document.createExpression()</a>. It has a method <code>evaluate()</code> which can be used to execute the compiled XPath.\n","members":[],"srcUrl":"https://developer.mozilla.org/en/XPathExpression"},"HTMLCollection":{"title":"HTMLCollection","compatibility":"Different browsers behave differently when there are more than one elements matching the string used as an index (or <code>namedItem</code>'s argument). Firefox 8 behaves as specified in DOM 2 and DOM4, returning the first matching element. WebKit browsers and Internet Explorer in this case return another <code>HTMLCollection</code> and Opera returns a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/NodeList\">NodeList</a></code>\n of all matching elements.","srcUrl":"https://developer.mozilla.org/en/DOM/HTMLCollection","specification":"<li><a class=\"external\" title=\"http://www.w3.org/TR/html5/common-dom-interfaces.html#htmlcollection-0\" rel=\"external\" href=\"http://www.w3.org/TR/html5/common-dom-interfaces.html#htmlcollection-0\" target=\"_blank\">HTML 5, Section 2.7.2, Collections</a></li> <li><a class=\"external\" title=\"http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-75708506\" rel=\"external\" href=\"http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-75708506\" target=\"_blank\">DOM&nbsp;Level 2 HTML, Section 1.4, Miscellaneous Object Definitions</a></li> <li><a class=\"external\" title=\"http://www.w3.org/TR/domcore/#interface-htmlcollection\" rel=\"external\" href=\"http://www.w3.org/TR/domcore/#interface-htmlcollection\" target=\"_blank\">DOM4: HTMLCollection</a></li>","seeAlso":"<li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/NodeList\">NodeList</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/HTMLOptionsCollection\">HTMLOptionsCollection</a></code>\n</li>","summary":"<p><code>HTMLCollection</code> is an interface representing a generic collection of elements (in document order) and offers methods and properties for traversing the list.</p>\n<div class=\"note\"><strong>Note:</strong> This interface is called <code>HTMLCollection</code> for historical reasons (before DOM4, collections implementing this interface could only have HTML elements as their items).</div>\n<p><code>HTMLCollection</code>s in the HTML DOM are live; they are automatically updated when the underlying document is changed.</p>","members":[{"name":"item","help":"Returns the specific node at the given zero-based <code>index</code> into the list. Returns <code>null</code> if the <code>index</code> is out of range.","obsolete":false},{"name":"namedItem","help":"Returns the specific node whose ID or, as a fallback, name matches the string specified by <code>name</code>. Matching by name is only done as a last resort, only in HTML, and only if the referenced element supports the <code>name</code> attribute. Returns <code>null</code> if no node exists by the given name.","obsolete":false},{"name":"length","help":"The number of items in the collection. <strong>Read only</strong>.","obsolete":false}]},"HTMLFrameElement":{"title":"frame","examples":["&lt;frameset cols=\"50%,50%\"&gt;\n  &lt;frame src=\"https://developer.mozilla.org/en/HTML/Element/iframe\" /&gt;\n  &lt;frame src=\"https://developer.mozilla.org/en/HTML/Element/frame\" /&gt;\n&lt;/frameset&gt;"],"summary":"<p><code>&lt;frame&gt;</code> is an HTML element which defines a particular area in which another HTML document can be displayed. A frame should be used within a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/frameset\">&lt;frameset&gt;</a></code>\n.</p>\n<p>Using the <code>&lt;frame&gt;</code> element is not encouraged because of certain disadvantages such as performance problems and lack of accessibility for users with screen readers. Instead of the <code>&lt;frame&gt;</code> element, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/iframe\">&lt;iframe&gt;</a></code>\n&nbsp;may be preferred.</p>","members":[{"obsolete":false,"url":"","name":"src","help":"This attribute is specify document which will be displayed by frame."},{"obsolete":false,"url":"","name":"name","help":"This attribute is used to labeling frames. Without labeling all links will open in the frame that they are in."},{"obsolete":false,"url":"","name":"scrolling","help":"This attribute defines existence of scrollbar. If this attribute is not used, browser put a scrollbar when necessary. There are two choices; \"yes\" for showing a scrollbar even when it is not necessary and \"no\" for do not showing a scrollbar even when it is necessary."},{"obsolete":false,"url":"","name":"noresize","help":"This attribute avoid resizing of frames by users."},{"obsolete":false,"url":"","name":"marginheight","help":"This attribute defines how tall the margin between frames will be."},{"obsolete":false,"url":"","name":"frameborder","help":"This attribute allows you to put borders for frames."},{"obsolete":false,"url":"","name":"marginwidth","help":"This attribute defines how wide the margin between frames will be."}],"srcUrl":"https://developer.mozilla.org/en/HTML/Element/frame"},"SVGTRefElement":{"title":"SVGTRefElement","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>","srcUrl":"https://developer.mozilla.org/en/DOM/SVGTRefElement","seeAlso":"<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/tref\">&lt;tref&gt;</a></code>\n SVG Element","summary":"The <code>SVGTRefElement</code> interface provides access to the properties of <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/tref\">&lt;tref&gt;</a></code>\n elements, as well as methods to manipulate them.","members":[]},"Counter":{"title":"CSS Counters","srcUrl":"https://developer.mozilla.org/en/CSS_Counters","specification":"CSS 2.1","seeAlso":"<ul> <li><a title=\"en/CSS/counter-reset\" rel=\"internal\" href=\"https://developer.mozilla.org/en/CSS/counter-reset\">counter-reset</a></li> <li><a title=\"en/CSS/counter-increment\" rel=\"internal\" href=\"https://developer.mozilla.org/en/CSS/counter-increment\">counter-increment</a></li>\n</ul>\n<p><em>There is an additional example available at <a class=\" external\" rel=\"external\" href=\"http://www.mezzoblue.com/archives/2006/11/01/counter_intu/\" title=\"http://www.mezzoblue.com/archives/2006/11/01/counter_intu/\" target=\"_blank\">http://www.mezzoblue.com/archives/20.../counter_intu/</a>. This blog entry was posted on November 01, 2006, but appears to be accurate.</em></p>","summary":"CSS counters are an implementation of <a class=\"external\" rel=\"external\" href=\"http://www.w3.org/TR/CSS21/generate.html#counters\" title=\"http://www.w3.org/TR/CSS21/generate.html#counters\" target=\"_blank\">Automatic counters and numbering</a> in CSS 2.1. The value of a counter is manipulated through the use of <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/CSS/counter-reset\">counter-reset</a></code>\n and <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/CSS/counter-increment\">counter-increment</a></code>\n and is displayed on a page using the <code>counter()</code> or <code>counters()</code> function of the <code><a title=\"en/CSS/content\" rel=\"internal\" href=\"https://developer.mozilla.org/en/CSS/content\">content</a></code> property.","members":[]},"WebKitAnimation":{"title":"CSS animations","examples":["<strong>Note:</strong> The examples here use the <code>-moz-</code> prefix on the animation CSS properties for brevity; the live examples you can click to see in your browser also include the <code>-webkit-</code> prefixed versions."],"srcUrl":"https://developer.mozilla.org/en/CSS/CSS_animations","seeAlso":"<li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Event/AnimationEvent\">AnimationEvent</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/CSS/animation\">animation</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/CSS/animation-delay\">animation-delay</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/CSS/animation-direction\">animation-direction</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/CSS/animation-duration\">animation-duration</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/CSS/animation-fill-mode\">animation-fill-mode</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/CSS/animation-iteration-count\">animation-iteration-count</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/CSS/animation-name\">animation-name</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/CSS/animation-play-state\">animation-play-state</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/CSS/animation-timing-function\">animation-timing-function</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/CSS/@keyframes\">@keyframes</a></code>\n</li> <li><a title=\"en/CSS/CSS animations/Detecting CSS animation support\" rel=\"internal\" href=\"https://developer.mozilla.org/en/CSS/CSS_animations/Detecting_CSS_animation_support\">Detecting CSS animation support</a></li> <li>This <a class=\"external\" title=\"http://hacks.mozilla.org/2011/06/add-on-sdk-and-the-beta-of-add-on-builder-now-available/\" rel=\"external\" href=\"http://hacks.mozilla.org/2011/06/add-on-sdk-and-the-beta-of-add-on-builder-now-available/\" target=\"_blank\">post</a> from Mozilla hacks, provides two additional examples: <ul> <li><a class=\" external\" rel=\"external\" href=\"http://jsfiddle.net/T88X5/3/light/\" title=\"http://jsfiddle.net/T88X5/3/light/\" target=\"_blank\">http://jsfiddle.net/T88X5/3/light/</a></li> <li><a class=\" external\" rel=\"external\" href=\"http://jsfiddle.net/RtvCB/9/light/\" title=\"http://jsfiddle.net/RtvCB/9/light/\" target=\"_blank\">http://jsfiddle.net/RtvCB/9/light/</a></li> </ul> </li>","summary":"<p>CSS&nbsp;animations make it possible to animate transitions from one CSS style configuration to another. Animations consist of two components:&nbsp;A style describing the animation and a set of keyframes that indicate the start and end states of the animation's CSS style, as well as possible intermediate waypoints along the way.</p>\n<p>There are three key advantages to CSS&nbsp;animations over traditional script-driven animation techniques:</p>\n<ol> <li>They're easy to use for simple animations; you can create them without even having to know JavaScript.</li> <li>The animations run well, even under moderate system load. Simple animations can often perform poorly in JavaScript (unless they're well made). The rendering engine can use frame-skipping and other techniques to keep the performance as smooth as possible.</li> <li>Letting the browser control the animation sequence lets the browser optimize performance and efficiency by, for example, reducing the update frequency of animations running in tabs that aren't currently visible.</li>\n</ol>","members":[]},"SVGGlyphElement":{"title":"SVGGlyphElement","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>","srcUrl":"https://developer.mozilla.org/en/DOM/SVGGlyphElement","seeAlso":"<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/glyph\">&lt;glyph&gt;</a></code>\n SVG Element","summary":"<p>The <code>SVGGlyphElement</code> interface corresponds to the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/glyph\">&lt;glyph&gt;</a></code>\n elements.</p>\n<p>Object-oriented access to the attributes of the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/glyph\">&lt;glyph&gt;</a></code>\n element via the SVG DOM is not possible.</p>","members":[]},"SVGPathSegCurvetoQuadraticSmoothAbs":{"title":"SVGPathElement","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/SVGPathElement","skipped":true,"cause":"Suspect title"},"HTMLTableCaptionElement":{"title":"HTMLTableCaptionElement","seeAlso":"<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/caption\">&lt;caption&gt;</a></code>\n&nbsp;HTML&nbsp;element","summary":"DOM table caption elements expose the <a title=\"http://www.w3.org/TR/html5/tabular-data.html#htmltablecaptionelement\" class=\" external\" rel=\"external nofollow\" href=\"http://www.w3.org/TR/html5/tabular-data.html#htmltablecaptionelement\" target=\"_blank\">HTMLTableCaptionElement</a> (or <span><a rel=\"custom nofollow\" href=\"https://developer.mozilla.org/en/HTML\">HTML 4</a></span> <a class=\" external\" rel=\"external nofollow\" href=\"http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-12035137\" title=\"http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-12035137\" target=\"_blank\"><code>HTMLTableCaptionElement</code></a>) interface, which provides special properties (beyond the regular <a rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/element\">element</a> object interface they also have available to them by inheritance) for manipulating definition list elements. In <span><a rel=\"custom nofollow\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML 5</a></span>, this interface inherits from HTMLElement, but defines no additional members.","members":[{"name":"align","help":"Enumerated attribute indicating alignment of the caption with respect to the table.","obsolete":true}],"srcUrl":"https://developer.mozilla.org/en/DOM/HTMLTableCaptionElement"},"Crypto":{"title":"JavaScript crypto","summary":"Non-standard","members":[],"srcUrl":"https://developer.mozilla.org/en/JavaScript_crypto"},"Entity":{"title":"Entity","summary":"<p><span>NOTE:&nbsp;This is not implemented in Mozilla</span></p>\n<p>Read-only reference to a DTD entity. Also inherits the methods and properties of <a title=\"En/DOM/Node\" class=\"internal\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/Node\"><code>Node</code></a>.</p>","members":[{"obsolete":false,"url":"https://developer.mozilla.org/En/DOM/Entity.xmlEncoding","name":"xmlEncoding","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/En/DOM/Entity.systemId","name":"systemId","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/En/DOM/Entity.inputEncoding","name":"inputEncoding","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/En/DOM/Entity.xmlVersion","name":"xmlVersion","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/En/DOM/Entity.notationName","name":"notationName","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/En/DOM/Entity.publicId","name":"publicId","help":""}],"srcUrl":"https://developer.mozilla.org/en/DOM/Entity","specification":"http://www.w3.org/TR/DOM-Level-3-Cor...ml#ID-527DCFF2"},"CloseEvent":{"title":"CloseEvent","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td>8.0 (8.0)\n</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td>8.0 (8.0)\n</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>","srcUrl":"https://developer.mozilla.org/en/WebSockets/WebSockets_reference/CloseEvent","seeAlso":"WebSocket","summary":"A <code>CloseEvent</code> is sent to clients using WebSockets when the connection is closed. This is delivered to the listener indicated by the <code>WebSocket</code> object's <code>onclose</code> attribute.","members":[{"name":"code","help":"The WebSocket connection close code provided by the server. See <a title=\"en/XPCOM_Interface_Reference/nsIWebSocketChannel#Status_codes\" rel=\"internal\" href=\"https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsIWebSocketChannel#Status_codes\">Status codes</a> for possible values.","obsolete":false},{"name":"reason","help":"A string indicating the reason the server closed the connection. This is specific to the particular server and sub-protocol.","obsolete":false},{"name":"wasClean","help":"Indicates whether or not the connection was cleanly closed.","obsolete":false}]},"TextEvent":{"title":"document.createEvent","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/document.createEvent","skipped":true,"cause":"Suspect title"},"SVGTSpanElement":{"title":"SVGTSpanElement","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> </tbody> </table>\n</div>","srcUrl":"https://developer.mozilla.org/en/DOM/SVGTSpanElement","seeAlso":"<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/tspan\">&lt;tspan&gt;</a></code>\n SVG Element","summary":"The <code>SVGTSpanElement</code> interface provides access to the properties of <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/tspan\">&lt;tspan&gt;</a></code>\n elements, as well as methods to manipulate them.","members":[]},"Event":{"title":"Event","seeAlso":"<ul> <li><a class=\"internal\" title=\"En/Listening to events\" rel=\"internal\" href=\"https://developer.mozilla.org/En/Listening_to_events\">Listening to events</a></li> <li><a class=\"internal\" title=\"En/Listening to events on all tabs\" rel=\"internal\" href=\"https://developer.mozilla.org/En/Listening_to_events_on_all_tabs\">Listening to events on all tabs</a></li> <li><a title=\"Creating and triggering custom events\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/Creating_and_triggering_events\">Creating and triggering custom events</a></li> <li><a class=\"internal\" title=\"En/DOM/Mouse gesture events\" rel=\"internal\" href=\"https://developer.mozilla.org/En/DOM/Mouse_gesture_events\">Mouse gesture events</a></li> <li><a title=\"https://wiki.mozilla.org/Events\" class=\" link-https\" rel=\"external\" href=\"https://wiki.mozilla.org/Events\" target=\"_blank\">Mozilla related events</a></li>\n</ul>\n<p></p>\n<div><img alt=\"Replacing Emoji...\" src=\"data:image/gif;base64,R0lGODlhEAAQAOYAAP////7+/qOjo/39/enp6bW1tfn5+fr6+vX19fz8/Kurq+3t7cDAwLGxscfHx+Xl5fT09LS0tPf398HBwc/Pz+bm5gMDA+Tk5N/f38TExO7u7pqamsLCwtTU1OLi4jw8PKioqLCwsPLy8q2trbKystvb26qqqtnZ2dfX17u7uyYmJs3NzdjY2Lm5uZ6ensvLy66urvv7++zs7FJSUurq6oWFhfb29kpKStzc3AwMDNHR0aSkpCkpKefn511dXb29vaenp8zMzLe3t/Hx8dDQ0FlZWWZmZsrKyqampvDw8ODg4Li4uL+/v+jo6PPz88jIyHp6eqWlpb6+vk5OTsPDw8bGxsXFxRQUFGpqat3d3fj4+NbW1rq6ury8vJCQkG5ubhwcHN7e3paWloKCgoyMjImJiWFhYXR0dFRUVIeHh5OTk0ZGRo6OjldXV39/fzIyMnd3d9ra2nx8fDY2NnFxcUFBQWxsbJSUlHh4eKGhoaKioi0tLSMjI4CAgNLS0qysrCH/C05FVFNDQVBFMi4wAwEAAAAh+QQEBQAAACwAAAAAEAAQAAAHyIAAggADgi1oCYOKghVfHQAbVwkHLSWLAE1vPgBqYAAUAj2KFQQAETw/ZXwrOy8ABwQBA2NFPwg+XjoFUSE2FREgEgAYNTNwNlqCk08CBReKL1GFih0sgyk7USAelxAOEwxHQGxeYmGXIi0kDVKDFzoBixjPgxIZG38xiz8CVCIAAZYICOKtA4QhSrogYAHEhAEAJSoAICDgxIsCDwRsAZDkxDQABkhECJBhBAArUTRcIqDgAQAOCgIggIHiUgBhAFakiGcgkaBAACH5BAQFAAAALAAAAAANAAsAAAdvgACCAAOCG3SFg4IXcDgAX3MDWjdMgzI+bgBnHwB3Fg4ADxoAHGgcUDcnFnSEYmNBEnIuOgwgKjIVABUCcmISB4IHIksCg1tcAYoAHSxBP0IFPcoAEA4TDQ0FTdMiLYMLYcmKGBcABhRIITHKPwKBACH5BAQFAAAALAAAAAAQAAgAAAdkgACCAAOCCmSFg4oAPWIPAGVmA04+XYsASWMuAGxGnDxUigROAERQHRtYKDw1AAZZAQMRIHEGG1wYQQ1rMh1FORoAGgwCEQYxggkQchZvBQGDF0TQiml3gysME1ULl00bTAxHgQAh+QQEBQAAACwDAAAADQAKAAAHZ4AAAQAAUkADhIkAMgUEAEhpAwhjRIkIJgUAIGUAAlM6ihh6KCNkODMuABAYATgHXFQXKEx2MlZTdTYCQjEJhAkIbjwzPwEXRIOKG0CJVQuKhBdpZGIwBU3QADgfPCpTC2HJiSFdiYEAIfkEBAUAAAAsBQAAAAsADgAAB3mAAAA6TAGChwALABwmARIuHYcpABlAAC1QOIcCHg55F3IFADYeAVwUMjhBXkkUXz42MQmCA1piM2dBAYaII6KIiE1jX1hkwAAeRTdrX7yHJA6HMYgBN3x5ig4dEEMsRhd3V21aAicvBQ96UgBbGwkRARkjAFZRioKBACH5BAQFAAAALAgAAQAIAA8AAAdigAoBBy0lAIcjABQCFYcAITI7LwBaFwEPWSFOcWpjNgADBiNQYiyOABxPp4cLG2U1Lo49UF92ZY4FVqsBZipnSgAXJm0EAm9vNmRLFgUAcSQDiT58BI6CF2DNhykBACIJjoEAIfkEBAUAAAAsBgACAAoADgAAB22AABkjABQCPQCJHg4hMjsvAAcEARQyD1khNhURIBIJiQMHTwIhGImnAEeQqKcaI0g7BawyG15eSKwcK6yJAWMzZA8AO0pxQmYEBUVmWiFfbQ4qLgAeRwMDPlMAZzwoqGhTARVrUqhQcAMAnqeBACH5BAQFAAAALAMABQANAAsAAAdygAJCMQkAAAMHTwIFFwAXRAGGkh0sklULkpIQDhMMRwVNmYYaJgohUgsskZlEKJJIbQiZAXpQIDIALR5GYhcYGW4aR301WgATYBFjaCszIQAERAMaPHADZ3UAajNhlh84AF9zAzJGVZIDsgBeWIVahYaBACH5BAQFAAAALAAACAAQAAgAAAdlgBMNDUAoAIeIIi0kDVKIFAIDiIcYF5NDUDl7NpMAKQJUIgAJHzkbBFAbND0dGyIoQCYGAEtZAEcqChtnJ1AcAEknkodDN1MDXmYAI3IVnQAdcxMAZD4BSWUvzwEQhztjkloJiIEAIfkEBAUAAAAsAAAGAA0ACgAAB2SAAIJWGwOChx0sUDMzZkGHhxAOfUVtRRmQgiIthywkhpAYFwBDZHt1Epk/AgNGfGU9Yn8LMihdCCwAR5gdM0shaiV5W5AQX3QBIGUAP1EahxdGKwBINQEiMCiHAakAKS6GBgmBACH5BAQFAAAALAAAAwALAA0AAAdygABPGAA6Ah4OITI7Az5XLiJYGTIPWSEATWx8c04xAAADB58ADmQDo59eWF9wHaifeGs3aEevqCUMp68QSG1GBq8DblMuCw0MQ0NKXQAUFAAYUA5MBQ8CozZeagE/IwBWow81JwATCgEIowESnyspAQCBACH5BAQFAAAALAAAAAAIAA8AAAdhgACCAAmCOoM4b4ccg0N8dQAZACgeAFUWIQ0DM3MKCGhQJ5NYKmgIB4MAHF4DgjtlZGolg2RYWGcoqYIXRAGDEiluZagAAxtQBUkZHRAAfnEAPQInL4MGJBEBkoIECg+qgQA7\" title=\"Replacing Emoji...\"></div>","summary":"<p>This chapter describes the DOM Event Model. The <a class=\"external\" rel=\"external\" href=\"http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-Event\" title=\"http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-Event\" target=\"_blank\">Event</a> interface itself is described, as well as the interfaces for event registration on nodes in the DOM, and <a title=\"en/DOM/element.addEventListener\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/element.addEventListener\">event listeners</a>, and several longer examples that show how the various event interfaces relate to one another.</p>\n<p>There is an excellent diagram that clearly explains the three phases of event flow through the DOM in the <a class=\"external\" title=\"http://www.w3.org/TR/DOM-Level-3-Events/#dom-event-architecture\" rel=\"external\" href=\"http://www.w3.org/TR/DOM-Level-3-Events/#dom-event-architecture\" target=\"_blank\">DOM Level 3 Events draft</a>.</p>","members":[{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/event.stopPropagation","name":"stopPropagation","help":"Stops the propagation of events further along in the DOM."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/event.preventDefault","name":"preventDefault","help":"Cancels the event (if it is cancelable)."},{"obsolete":false,"url":"https://developer.mozilla.org/Article_not_found?uri=en/DOM/event.preventCapture","name":"preventCapture","help":"Obsolete, use <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/event.stopPropagation\">event.stopPropagation</a></code>\n instead."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/event.stopImmediatePropagation","name":"stopImmediatePropagation","help":"For this particular event, no other listener will be called. Neither those attached on the same element, nor those attached on elements which will be traversed later (in capture phase, for instance)"},{"obsolete":false,"url":"https://developer.mozilla.org/Article_not_found?uri=en/DOM/event.preventBubble","name":"preventBubble","help":"Prevents the event from bubbling. Obsolete, use <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/event.stopPropagation\">event.stopPropagation</a></code>\n instead."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/event.initEvent","name":"initEvent","help":"Initializes the value of an Event created through the <code>DocumentEvent</code> interface."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/event.originalTarget","name":"originalTarget","help":"The original target of the event, before any retargetings (Mozilla-specific)."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/event.timeStamp","name":"timeStamp","help":"The time that the event was created."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/event.bubbles","name":"bubbles","help":"A boolean indicating whether the event bubbles up through the DOM or not."},{"name":"webkitInputSource","help":"The type of device that generated the event. This is a Gecko-specific value.","obsolete":false},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/event.defaultPrevented","name":"defaultPrevented","help":"Indicates whether or not <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/event.preventDefault\">event.preventDefault()</a></code>\n has been called on the event."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/event.target","name":"target","help":"A reference to the target to which the event was originally dispatched."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/event.currentTarget","name":"currentTarget","help":"A reference to the currently registered target for the event."},{"obsolete":false,"url":"https://developer.mozilla.org/Article_not_found?uri=en/DOM/event.isTrusted","name":"isTrusted","help":"Indicates whether or not the event was initiated by the browser (after a user click for instance) or by a script (using an event creation method, like <a title=\"event.initEvent\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/event.initEvent\">event.initEvent</a>)"},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/event.eventPhase","name":"eventPhase","help":"Indicates which phase of the event flow is being processed."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/event.explicitOriginalTarget","name":"explicitOriginalTarget","help":"The explicit original target of the event (Mozilla-specific)."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/event.cancelBubble","name":"cancelBubble","help":"A boolean indicating whether the bubbling of the event has been canceled or not."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/event.cancelable","name":"cancelable","help":"A boolean indicating whether the event is cancelable."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/event.type","name":"type","help":"The name of the event (case-insensitive)."}],"srcUrl":"https://developer.mozilla.org/en/DOM/event"},"SVGTransform":{"title":"SVGTransform","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>","summary":"<p><code>SVGTransform</code> is the interface for one of the component transformations within an <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/SVGTransformList\">SVGTransformList</a></code>\n; thus, an <code>SVGTransform</code> object corresponds to a single component (e.g., <code>scale(…)</code> or <code>matrix(…)</code>) within a \n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Attribute/transform\">transform</a></code> attribute.</p>\n<p>An <code>SVGTransform</code> object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown.</p>","members":[{"name":"setMatrix","help":"<p>Sets the transform type to <code>SVG_TRANSFORM_MATRIX</code>, with parameter matrix defining the new transformation. Note that the values from the parameter <code>matrix</code> are copied.</p> <p><strong>Exceptions:</strong></p> <ul> <li>a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DOMException\">DOMException</a></code>\n with code <code>NO_MODIFICATION_ALLOWED_ERR</code> is raised when attempting to modify a read only attribute or when the object itself is read only.</li> </ul>","obsolete":false},{"name":"setTranslate","help":"<p>Sets the transform type to <code>SVG_TRANSFORM_TRANSLATE</code>, with parameters <code>tx</code> and <code>ty</code> defining the translation amounts.</p> <p><strong>Exceptions:</strong></p> <ul> <li>a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DOMException\">DOMException</a></code>\n with code <code>NO_MODIFICATION_ALLOWED_ERR</code> is raised when attempting to modify a read only attribute or when the object itself is read only.</li> </ul>","obsolete":false},{"name":"setScale","help":"<p>Sets the transform type to <code>SVG_TRANSFORM_SCALE</code>, with parameters <code>sx</code> and <code>sy</code> defining the scale amounts.</p> <p><strong>Exceptions:</strong></p> <ul> <li>a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DOMException\">DOMException</a></code>\n with code <code>NO_MODIFICATION_ALLOWED_ERR</code> is raised when attempting to modify a read only attribute or when the object itself is read only.</li> </ul>","obsolete":false},{"name":"setRotate","help":"<p>Sets the transform type to <code>SVG_TRANSFORM_ROTATE</code>, with parameter <code>angle</code> defining the rotation angle and parameters <code>cx</code> and <code>cy</code> defining the optional center of rotation.</p> <p><strong>Exceptions:</strong></p> <ul> <li>a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DOMException\">DOMException</a></code>\n with code <code>NO_MODIFICATION_ALLOWED_ERR</code> is raised when attempting to modify a read only attribute or when the object itself is read only.</li> </ul>","obsolete":false},{"name":"setSkewX","help":"<p>Sets the transform type to <code>SVG_TRANSFORM_SKEWX</code>, with parameter <code>angle</code> defining the amount of skew.</p> <p><strong>Exceptions:</strong></p> <ul> <li>a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DOMException\">DOMException</a></code>\n with code <code>NO_MODIFICATION_ALLOWED_ERR</code> is raised when attempting to modify a read only attribute or when the object itself is read only.</li> </ul>","obsolete":false},{"name":"setSkewY","help":"<p>Sets the transform type to <code>SVG_TRANSFORM_SKEWY</code>, with parameter <code>angle</code> defining the amount of skew.</p> <p><strong>Exceptions:</strong></p> <ul> <li>a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DOMException\">DOMException</a></code>\n with code <code>NO_MODIFICATION_ALLOWED_ERR</code> is raised when attempting to modify a read only attribute or when the object itself is read only.</li> </ul>","obsolete":false},{"name":"SVG_TRANSFORM_UNKNOWN","help":"The unit type is not one of predefined unit types. It is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type.","obsolete":false},{"name":"SVG_TRANSFORM_MATRIX","help":"A <code>matrix(…)</code> transformation","obsolete":false},{"name":"SVG_TRANSFORM_TRANSLATE","help":"A <code>translate(…)</code> transformation","obsolete":false},{"name":"SVG_TRANSFORM_SCALE","help":"A <code>scale(…)</code> transformation","obsolete":false},{"name":"SVG_ANGLETYPE_ROTATE","help":"A <code>rotate(…)</code> transformation","obsolete":false},{"name":"SVG_ANGLETYPE_SKEWX","help":"A <code>skewx(…)</code> transformation","obsolete":false},{"name":"SVG_ANGLETYPE_SKEWY","help":"A <code>skewy(…)</code> transformation","obsolete":false},{"name":"type","help":"The type of the value as specified by one of the SVG_TRANSFORM_* constants defined on this interface.","obsolete":false},{"name":"angle","help":"A convenience attribute for <code>SVG_TRANSFORM_ROTATE</code>, <code>SVG_TRANSFORM_SKEWX</code> and <code>SVG_TRANSFORM_SKEWY</code>. It holds the angle that was specified.<br> <br> For <code>SVG_TRANSFORM_MATRIX</code>, <code>SVG_TRANSFORM_TRANSLATE</code> and <code>SVG_TRANSFORM_SCALE</code>, <code>angle</code> will be zero.","obsolete":false},{"name":"matrix","help":"<p>The matrix that represents this transformation. The matrix object is live, meaning that any changes made to the <code>SVGTransform</code> object are immediately reflected in the matrix object and vice versa. In case the matrix object is changed directly (i.e., without using the methods on the <code>SVGTransform</code> interface itself) then the type of the <code>SVGTransform</code> changes to <code>SVG_TRANSFORM_MATRIX</code>.</p> <ul> <li>For <code>SVG_TRANSFORM_MATRIX</code>, the matrix contains the a, b, c, d, e, f values supplied by the user.</li> <li>For <code>SVG_TRANSFORM_TRANSLATE</code>, e and f represent the translation amounts (a=1, b=0, c=0 and d=1).</li> <li>For <code>SVG_TRANSFORM_SCALE</code>, a and d represent the scale amounts (b=0, c=0, e=0 and f=0).</li> <li>For <code>SVG_TRANSFORM_SKEWX</code> and <code>SVG_TRANSFORM_SKEWY</code>, a, b, c and d represent the matrix which will result in the given skew (e=0 and f=0).</li> <li>For <code>SVG_TRANSFORM_ROTATE</code>, a, b, c, d, e and f together represent the matrix which will result in the given rotation. When the rotation is around the center point (0, 0), e and f will be zero.</li> </ul>","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/DOM/SVGTransform"},"SVGFEConvolveMatrixElement":{"title":"feConvolveMatrix","seeAlso":"<li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/filter\">&lt;filter&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/animate\">&lt;animate&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/set\">&lt;set&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feBlend\">&lt;feBlend&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feColorMatrix\">&lt;feColorMatrix&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feComponentTransfer\">&lt;feComponentTransfer&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feComposite\">&lt;feComposite&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feDiffuseLighting\">&lt;feDiffuseLighting&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feDisplacementMap\">&lt;feDisplacementMap&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feFlood\">&lt;feFlood&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feGaussianBlur\">&lt;feGaussianBlur&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feImage\">&lt;feImage&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feMerge\">&lt;feMerge&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feMorphology\">&lt;feMorphology&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feOffset\">&lt;feOffset&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feSpecularLighting\">&lt;feSpecularLighting&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feTile\">&lt;feTile&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feTurbulence\">&lt;feTurbulence&gt;</a></code>\n</li> <li><a title=\"en/SVG/Tutorial/Filter_effects\" rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Tutorial/Filter_effects\">SVG tutorial: Filter effects</a></li>","summary":"The filter modifies a pixel by means of a convolution matrix, that also takes neighboring pixels into account.","members":[{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/targetY","name":"targetY","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/edgeMode","name":"edgeMode","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/kernelUnitLength","name":"kernelUnitLength","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/class","name":"class","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/in","name":"in","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/preserveAlpha","name":"preserveAlpha","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/divisor","name":"divisor","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/targetX","name":"targetX","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/kernelMatrix","name":"kernelMatrix","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/bias","name":"bias","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/order","name":"order","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/style","name":"style","help":"Specific attributes"}],"srcUrl":"https://developer.mozilla.org/en/SVG/Element/feConvolveMatrix"},"HTMLFormElement":{"title":"HTMLFormElement","examples":["<p>The following example shows how to create a new form element, modify its attributes and submit it.</p>\n<pre class=\"deki-transform\">// Create a form\nvar f = document.createElement(\"form\");\n\n// Add it to the document body\ndocument.body.appendChild(f);\n\n// Add action and method attributes\nf.action = \"/cgi-bin/some.cgi\";\nf.method = \"POST\"\n\n// Call the form's submit method\nf.submit();\n</pre>\n<p>In addition, the following complete HTML document shows how to extract information from a form element and to set some of its attributes.</p>\n<pre class=\"deki-transform\">&lt;title&gt;Form example&lt;/title&gt;\n&lt;script type=\"text/javascript\"&gt;\n  function getFormInfo() {\n    var info;\n\n    // Get a reference using the forms collection\n    var f = document.forms[\"formA\"];\n    info = \"f.elements: \" + f.elements + \"\\n\"\n         + \"f.length: \" + f.length + \"\\n\"\n         + \"f.name: \" + f.name + \"\\n\"\n         + \"f.acceptCharset: \" + f.acceptCharset + \"\\n\"\n         + \"f.action: \" + f.action + \"\\n\"\n         + \"f.enctype: \" + f.enctype + \"\\n\"\n         + \"f.encoding: \" + f.encoding + \"\\n\"\n         + \"f.method: \" + f.method + \"\\n\"\n         + \"f.target: \" + f.target;\n    document.forms[\"formA\"].elements['tex'].value = info;\n  }\n\n  // A reference to the form is passed from the\n  // button's onclick attribute using 'this.form'\n  function setFormInfo(f) {\n    f.method = \"GET\";\n    f.action = \"/cgi-bin/evil_executable.cgi\";\n    f.name   = \"totally_new\";\n  }\n&lt;/script&gt;\n\n&lt;h1&gt;Form  example&lt;/h1&gt;\n\n&lt;form name=\"formA\" id=\"formA\"\n action=\"/cgi-bin/test\" method=\"POST\"&gt;\n &lt;p&gt;Click \"Info\" to see information about the form.\n    Click set to change settings, then info again\n    to see their effect&lt;/p&gt;\n &lt;p&gt;\n  &lt;input type=\"button\" value=\"info\"\n   onclick=\"getFormInfo();\"&gt;\n  &lt;input type=\"button\" value=\"set\"\n   onclick=\"setFormInfo(this.form);\"&gt;\n  &lt;input type=\"reset\" value=\"reset\"&gt;\n  &lt;br&gt;\n  &lt;textarea id=\"tex\" style=\"height:15em; width:20em\"&gt;\n  &lt;/textarea&gt;\n &lt;/p&gt;\n&lt;/form&gt;\n</pre>"],"srcUrl":"https://developer.mozilla.org/en/DOM/HTMLFormElement","specification":"<p><a class=\" external\" title=\"http://www.w3.org/TR/html5/forms.html#the-form-element\" rel=\"external\" href=\"http://www.w3.org/TR/html5/forms.html#the-form-element\" target=\"_blank\">HTML 5, Section 4.10.3, The form Element</a></p>\n<p><a class=\" external\" title=\"http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html#ID-40002357\" rel=\"external\" href=\"http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html#ID-40002357\" target=\"_blank\">DOM&nbsp;Level 2 HTML, Section 1.6.5, Object definitions</a></p>","summary":"<p><code>FORM</code> elements share all of the properties and methods of other HTML elements described in the <a title=\"en/DOM/element\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/element\">element</a> section.</p>\n<p>This interface provides methods to create and modify <code>FORM</code> elements using the DOM.</p>","members":[{"name":"dispatchFormChange","help":"Broadcasts form change events. That is, for each item in the <strong>elements</strong> collection, fire an event named formchange at the item.","obsolete":false},{"name":"dispatchFormInput","help":"Broadcasts form input events. That is, for each item in the <strong>elements</strong> collection, fire an event named <code>forminput</code> at the item.","obsolete":false},{"name":"item","help":"Gets the item in the <strong>elements</strong> collection at the specified index, or null if there is no item at that index. You can also specify the index in array-style brackets or parentheses after the form object name, without calling this method explicitly.","obsolete":false},{"name":"namedItem","help":"Gets the item or list of items in <strong>elements</strong> collection whose <strong>name</strong> or <strong>id</strong> match the specified name, or null if no items match. You can also specify the name in array-style brackets or parentheses after the form object name, without calling this method explicitly.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/form.submit","name":"submit","help":"Submits the form to the server.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/form.reset","name":"reset","help":"Resets the forms to its initial state.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/form.acceptCharset","name":"acceptCharset","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/form#attr-accept-charset\">accept-charset</a></code>\n&nbsp;HTML&nbsp;attribute, containing a list of character encodings that the server accepts.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/form.action","name":"action","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/form#attr-action\">action</a></code>\n&nbsp;HTML&nbsp;attribute, containing the URI&nbsp;of a program that processes the information submitted by the form.","obsolete":false},{"name":"autocomplete","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/form#attr-autocomplete\">autocomplete</a></code>\n HTML&nbsp;attribute, containing a string that indicates whether the controls in this form can have their values automatically populated by the browser.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/form.elements","name":"elements","help":"All the form controls belonging to this form element.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/form.encoding","name":"encoding","help":"Synonym for <strong>enctype</strong>.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/form.enctype","name":"enctype","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/form#attr-enctype\">enctype</a></code>\n&nbsp;HTML&nbsp;attribute, indicating the type of content that is used to transmit the form to the server. Only specified values can be set.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/form.length","name":"length","help":"The number of controls in the form.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/form.method","name":"method","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/form#attr-method\">method</a></code>\n&nbsp;HTML&nbsp;attribute, indicating the HTTP&nbsp;method used to submit the form. Only specified values can be set.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/form.name","name":"name","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/form#attr-name\">name</a></code>\n&nbsp;HTML&nbsp;attribute, containing the name of the form.","obsolete":false},{"name":"noValidate","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/form#attr-novalidate\">novalidate</a></code>\n HTML attribute, indicating that the form should not be validated.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/form.target","name":"target","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/form#attr-target\">target</a></code>\n HTML attribute, indicating where to display the results received from submitting the form.","obsolete":false}]},"SVGPathSegLinetoHorizontalRel":{"title":"SVGPathElement","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/SVGPathElement","skipped":true,"cause":"Suspect title"},"Range":{"title":"range","summary":"<p>The <code>Range</code> object represents a fragment of a document that can contain nodes and parts of text nodes in a given document.</p>\n<p>A range can be created using the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Document.createRange\">Document.createRange</a></code>\n&nbsp;method of the&nbsp;<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Document\">Document</a></code>\n&nbsp;object. Range objects can also be retrieved by using the <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/Selection.getRangeAt\" class=\"new\">Selection.getRangeAt</a></code>\n&nbsp;method of the&nbsp;<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Selection\">Selection</a></code>\n&nbsp;object.</p>","members":[{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/range.comparePoint","name":"comparePoint","help":"Returns -1, 0, or 1 indicating whether the point occurs before, inside, or after the range."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/range.intersectsNode","name":"intersectsNode","help":"Returns a <code>boolean</code> indicating whether the given node intersects the range."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/range.selectNode","name":"selectNode","help":"Sets the Range to contain the&nbsp;<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Node\">Node</a></code>\n&nbsp;and its contents."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/range.compareNode","name":"compareNode","help":"Returns a constant representing whether the&nbsp;<a title=\"en/DOM/Node\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/Node\">Node</a>&nbsp;is before, after, inside, or surrounding the range."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/range.setEndAfter","name":"setEndAfter","help":"Sets the end position of a Range relative to another&nbsp;<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Node\">Node</a></code>\n."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/range.setEndBefore","name":"setEndBefore","help":"Sets the end position of a Range relative to another&nbsp;<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Node\">Node</a></code>\n."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/range.extractContents","name":"extractContents","help":"Moves contents of a Range from the document tree into a&nbsp;<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DocumentFragment\">DocumentFragment</a></code>\n."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/range.insertNode","name":"insertNode","help":"Insert a&nbsp;<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Node\">Node</a></code>\n&nbsp;at the start of a Range."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/range.getClientRects","name":"getClientRects","help":"Returns a list of <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/ClientRect\" class=\"new\">ClientRect</a></code>\n objects that aggregates the results of <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Element.getClientRects\">Element.getClientRects()</a></code>\n for all the elements in the range."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/range.cloneContents","name":"cloneContents","help":"Returns a&nbsp;<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DocumentFragment\">DocumentFragment</a></code>\n&nbsp;copying the nodes of a Range."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/range.deleteContents","name":"deleteContents","help":"Removes the contents of a Range from the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Document\">Document</a></code>\n."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/range.compareBoundaryPoints","name":"compareBoundaryPoints","help":"Compares the boundary points of two Ranges."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/range.setStartBefore","name":"setStartBefore","help":"Sets the start position of a Range relative to another&nbsp;<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Node\">Node</a></code>\n."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/range.detach","name":"detach","help":"Releases Range from use to improve performance."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/range.getBoundingClientRect","name":"getBoundingClientRect","help":"Returns a <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/ClientRect\" class=\"new\">ClientRect</a></code>\n object which bounds the entire contents of the range; this would be the union of all the rectangles returned by <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/range.getClientRects\">range.getClientRects()</a></code>\n."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/range.isPointInRange","name":"isPointInRange","help":"Returns a <code>boolean</code> indicating whether the given point is in the range."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/range.selectNodeContents","name":"selectNodeContents","help":"Sets the Range to contain the contents of a&nbsp;<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Node\">Node</a></code>\n."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/range.cloneRange","name":"cloneRange","help":"Returns a Range object with boundary points identical to the cloned Range."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/range.toString","name":"toString","help":"Returns the text of the Range"},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/range.setStart","name":"setStart","help":"Sets the start position of a Range."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/range.setStartAfter","name":"setStartAfter","help":"Sets the start position of a Range relative to another&nbsp;<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Node\">Node</a></code>\n."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/range.createContextualFragment","name":"createContextualFragment","help":"Returns a&nbsp;<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DocumentFragment\">DocumentFragment</a></code>\n&nbsp;created from a given string of code."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/range.setEnd","name":"setEnd","help":"Sets the end position of a Range."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/range.collapse","name":"collapse","help":"Collapses the Range to one of its boundary points."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/range.surroundContents","name":"surroundContents","help":"Moves content of a Range into a new&nbsp;<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Node\">Node</a></code>\n."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/range.startOffset","name":"startOffset","help":"Returns a number representing where in the startContainer the Range starts."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/range.startContainer","name":"startContainer","help":"Returns the&nbsp;<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Node\">Node</a></code>\n&nbsp;within which the Range starts."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/range.endOffset","name":"endOffset","help":"Returns a number representing where in the endContainer the Range ends."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/range.collapsed","name":"collapsed","help":"Returns a&nbsp;<code>boolean</code>&nbsp;indicating whether the range's start and end points are at the same position."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/range.endContainer","name":"endContainer","help":"Returns the&nbsp;<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Node\">Node</a></code>\n&nbsp;within which the Range ends."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/range.commonAncestorContainer","name":"commonAncestorContainer","help":"Returns the deepest&nbsp;<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Node\">Node</a></code>\n&nbsp;that contains the startContainer and endContainer Nodes."}],"srcUrl":"https://developer.mozilla.org/en/DOM/range"},"HTMLIFrameElement":{"title":"HTMLIFrameElement","seeAlso":"<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/iframe\">&lt;iframe&gt;</a></code>\n&nbsp;HTML&nbsp;Element","summary":"DOM iframe objects expose the <a class=\"external\" href=\"http://www.w3.org/TR/html5/the-iframe-element.html#htmliframeelement\" rel=\"external nofollow\" target=\"_blank\" title=\"http://www.w3.org/TR/html5/the-iframe-element.html#htmliframeelement\">HTMLIFrameElement</a> (or <span><a href=\"https://developer.mozilla.org/en/HTML\" rel=\"custom nofollow\">HTML 4</a></span> <a class=\"external\" href=\"http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-50708718\" rel=\"external nofollow\" target=\"_blank\" title=\"http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-50708718\"><code>HTMLIFrameElement</code></a>) interface, which provides special properties and methods (beyond the regular <a href=\"https://developer.mozilla.org/en/DOM/element\" rel=\"internal\">element</a> object interface they also have available to them by inheritance) for manipulating the layout and presentation of inline frame elements.","members":[{"name":"align","help":"Specifies the alignment of the frame with respect to the surrounding context.","obsolete":true},{"name":"contentDocument","help":"The active document in the inline frame's nested browsing context.","obsolete":false},{"name":"contentWindow","help":"The window proxy for the nested browsing context.","obsolete":false},{"name":"frameborder","help":"Indicates whether to create borders between frames.","obsolete":false},{"name":"height","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/iframe#attr-height\">height</a></code>\n HTML&nbsp;attribute, indicating the height of the frame.","obsolete":false},{"name":"longDesc","help":"URI of a long description of the frame.","obsolete":false},{"name":"marginHeight","help":"Height of the frame margin.","obsolete":false},{"name":"marginWidth","help":"Width of the frame margin.","obsolete":false},{"name":"webkitallowfullscreen","help":"Indicates whether or not the inline frame is willing to be placed into full screen mode. See <a title=\"https://developer.mozilla.org/en/DOM/Using_full-screen_mode\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/Using_full-screen_mode\">Using full-screen mode</a> for details.","obsolete":false},{"name":"name","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/iframe#attr-name\">name</a></code>\n HTML&nbsp;attribute, containing a name by which to refer to the frame.","obsolete":false},{"name":"sandbox","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/iframe#attr-sandbox\">sandbox</a></code>\n HTML&nbsp;attribute, indicating extra restrictions on the behavior of the nested content.","obsolete":false},{"name":"scrolling","help":"Indicates whether the browser should provide scrollbars for the frame.","obsolete":false},{"name":"seamless","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/iframe#attr-seamless\">seamless</a></code>\n HTML&nbsp;attribute, indicating that the inline frame should be rendered seamlessly with the parent document.","obsolete":false},{"name":"src","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/iframe#attr-src\">src</a></code>\n HTML&nbsp;attribute, containing the address of the content to be embedded.","obsolete":false},{"name":"srcdoc","help":"The content to display in the frame.","obsolete":false},{"name":"width","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/iframe#attr-width\">width</a></code>\n&nbsp;HTML&nbsp;attribute, indicating the width of the frame.","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/DOM/HTMLIFrameElement"},"IDBDatabaseException":{"title":"IDBDatabaseException","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td>12 \n<span title=\"prefix\">-webkit</span></td> <td>4.0 (2.0)\n</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> </tr> <tr> <td><code>VER_ERR</code></td> <td><span title=\"Not supported.\">--</span></td> <td>10.0 (10.0)\n</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE&nbsp;Phone</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Not supported.\">--</span></td> <td>4.0 (2.0)\n</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> </tr> <tr> <td><code>VER_ERR</code></td> <td><span title=\"Not supported.\">--</span></td> <td>10.0 (10.0)\n</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> </tr> </tbody> </table>\n</div>","summary":"In the <a title=\"en/IndexedDB\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB\">IndexedDB API</a>, an <code>IDBDatabaseException</code> object represents exception conditions that can be encountered while performing database operations.","members":[{"url":"","name":"ABORT_ERR","help":"A request was aborted, for example, through a call to<a title=\"en/IndexedDB/IDBTransaction#abort\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBTransaction#abort\"> <code>IDBTransaction.abort</code></a>.","obsolete":false},{"url":"","name":"CONSTRAINT_ERR","help":"A mutation operation in the transaction failed because a constraint was not satisfied. For example, an object, such as an object store or index, already exists and a request attempted to create a new one.","obsolete":false},{"url":"","name":"DATA_ERR","help":"Data provided to an operation does not meet requirements.","obsolete":false},{"url":"","name":"NON_TRANSIENT_ERR","help":"An operation was not allowed on an object. Unless the cause of the error is corrected, retrying the same operation would result in failure.","obsolete":false},{"url":"","name":"NOT_ALLOWED_ERR","help":"<p>An operation was called on an object where it is not allowed or at a time when it is not allowed. It also occurs if a request is made on a source object that has been deleted or removed.</p> <p>More specific variants of this error includes: <code> TRANSACTION_INACTIVE_ERR</code> and <code>READ_ONLY_ERR</code>.</p>","obsolete":false},{"url":"","name":"NOT_FOUND_ERR","help":"The operation failed, because the requested database object could not be found; for example, an object store did not exist but was being opened.","obsolete":false},{"url":"","name":"QUOTA_ERR","help":"Either there's not enough remaining storage space or the storage quota was reached and the user declined to give more space to the database.","obsolete":false},{"url":"","name":"READ_ONLY_ERR","help":"A mutation operation was attempted in a <code>READ_ONLY</code>&nbsp;transaction.","obsolete":false},{"url":"","name":"TIMEOUT_ERR","help":"A lock for the transaction could not be obtained in a reasonable time.","obsolete":false},{"url":"","name":"TRANSACTION_INACTIVE_ERR","help":"A request was made against a transaction that is either not currently active or is already finished.","obsolete":false},{"url":"","name":"UNKNOWN_ERR","help":"The operation failed for reasons unrelated to the database itself, and it is not covered by any other error code; for example, a failure due to disk IO errors.","obsolete":false},{"url":"","name":"VER_ERR","help":"A request to open a database with a version lower than the one it already has. This can only happen with <a title=\"en/IndexedDB/IDBOpenDBRequest\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBOpenDBRequest\"><code>IDBOpenDBRequest</code></a>.","obsolete":false},{"url":"","name":"code","help":"The most appropriate error code for the condition.","obsolete":false},{"url":"","name":"message","help":"Error message describing the exception raised.","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException"},"DirectoryEntry":{"title":"DirectoryEntry","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td>13\n<span title=\"prefix\">webkit</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE&nbsp;Phone</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> </tr> </tbody> </table>\n</div>","summary":"<div><strong>DRAFT</strong> <div>This page is not complete.</div>\n</div>\n<p>The <code>DirectoryEntry</code> interface of the <a title=\"en/DOM/File_API/File_System_API\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/File_API/File_System_API\">FileSystem API</a> represents a directory in a file system.</p>","members":[{"name":"getFile","help":"<p>Creates or looks up a file.</p>\n<pre>void moveTo (\n  <em>(in DOMString path, optional Flags options, optional EntryCallback successCallback, optional ErrorCallback errorCallback);</em>\n);</pre>\n<div id=\"section_9\"><span id=\"Parameter\"></span><h5 class=\"editable\">Parameter</h5>\n<dl> <dt>path</dt> <dd>Either an absolute path or a relative path from this DirectoryEntry to the file to be looked up or created. It is an error to attempt to create a file whose immediate parent does not yet exist.</dd> <dt>options</dt>\n</dl>\n<ul> <li>If create and exclusive are both true, and the path already exists, getFile must fail.</li> <li> If create is true, the path doesn't exist, and no other error occurs, getFile must create it as a zero-length file and return a corresponding FileEntry. </li> <li>If create is not true and the path doesn't exist, getFile must fail. </li> <li>If create is not true and the path exists, but is a directory, getFile must fail. </li> <li>Otherwise, if no other error occurs, getFile must return a FileEntry corresponding to path.</li>\n</ul>\n<dl> <dt>successCallback</dt> <dd>A callback that is called to return the file selected or created.</dd> <dt>errorCallback</dt> <dd>A callback that is called when errors happen.</dd> </dl> </div><div id=\"section_10\"><span id=\"Returns_3\"></span><h5 class=\"editable\">Returns</h5>\n<dl> <dt><code>void</code></dt>\n</dl> </div>","obsolete":false},{"name":"getDirectory","help":"<p>Creates or looks up a directory.</p>\n<pre>void vopyTo (\n  <em>(in DOMString path, optional Flags options, optional EntryCallback successCallback, optional ErrorCallback errorCallback);</em>\n);</pre>\n<div id=\"section_12\"><span id=\"Parameter_2\"></span><h5 class=\"editable\">Parameter</h5>\n<dl> <dt>path</dt> <dd>Either an absolute path or a relative path from this DirectoryEntry to the file to be looked up or created. It is an error to attempt to create a file whose immediate parent does not yet exist.</dd> <dt>options</dt>\n</dl>\n<ul> <li>If create and exclusive are both true, and the path already exists, getDirectory must fail.</li> <li> If create is true, the path doesn't exist, and no other error occurs, getDirectory must create it as a zero-length file and return a corresponding getDirectory. </li> <li>If create is not true and the path doesn't exist, getDirectory must fail. </li> <li>If create is not true and the path exists, but is a directory, getDirectory must fail. </li> <li>Otherwise, if no other error occurs, getFile must return a getDirectory corresponding to path.</li>\n</ul> <dt>successCallback</dt> <dd>A callback that is called to return the DirectoryEntry selected or created.</dd> <dt>errorCallback</dt> <dd>A callback that is called when errors happen.</dd>\n </div><div id=\"section_13\"><span id=\"Returns_4\"></span><h5 class=\"editable\">Returns</h5>\n<dl> <dt><code>void</code></dt>\n</dl> </div>","obsolete":false},{"name":"removeRecursively","help":"<p>Deletes a directory and all of its contents, if any. If you are deleting a directory that contains a file that cannot be removed, some of the contents of the directory might be deleted. You cannot delete the root directory of a file system.</p>\n<pre>DOMString toURL (\n  <em>(in </em>VoidCallback successCallback, optional ErrorCallback errorCallback<em>);</em>\n);</pre>\n<div id=\"section_15\"><span id=\"Parameter_3\"></span><h5 class=\"editable\">Parameter</h5>\n<dl>\n<dt>successCallback</dt> <dd>A callback that is called to return the DirectoryEntry selected or created.</dd> <dt>errorCallback</dt> <dd>A callback that is called when errors happen.</dd>\n</dl> </div><div id=\"section_16\"><span id=\"Returns_5\"></span><h5 class=\"editable\">Returns</h5>\n<dl> <dt><code>void</code></dt>\n</dl>\n</div>","obsolete":false},{"name":"createReader","help":"<p>Creates a new DirectoryReader to read entries from this Directory.</p>\n<pre>void getMetada ();</pre> <div id=\"section_7\"><span id=\"Returns_2\"></span><h5 class=\"editable\">Returns</h5>\n<dl> <dt><code>DirectoryReader</code></dt>\n</dl> </div>","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/DOM/File_API/File_System_API/DirectoryEntry"},"HTMLOptGroupElement":{"title":"optgroup","examples":["<pre name=\"code\" class=\"xml\">&lt;select&gt;\n  &lt;optgroup label=\"Group 1\"&gt;\n    &lt;option&gt;Option 1.1&lt;/option&gt;\n  &lt;/optgroup&gt; \n  &lt;optgroup label=\"Group 2\"&gt;\n    &lt;option&gt;Option 2.1&lt;/option&gt;\n    &lt;option&gt;Option 2.2&lt;/option&gt;\n  &lt;/optgroup&gt;\n  &lt;optgroup label=\"Group 3\" disabled&gt;\n    &lt;option&gt;Option 3.1&lt;/option&gt;\n    &lt;option&gt;Option 3.2&lt;/option&gt;\n    &lt;option&gt;Option 3.3&lt;/option&gt;\n  &lt;/optgroup&gt;\n&lt;/select&gt;</pre>\n        \n<p>&lt;form&gt; <select> <optgroup label=\"Group 1\">\n<option>Option 1.1</option>\n</optgroup> <optgroup label=\"Group 2\">\n<option>Option 2.1</option>\n<option>Option 2.2</option>\n</optgroup> <optgroup disabled=\"\" label=\"Group 3\">\n<option>Option 3.1</option>\n<option>Option 3.2</option>\n<option>Option 3.3</option>\n</optgroup> </select> &lt;/form&gt;</p>"],"srcUrl":"https://developer.mozilla.org/en/HTML/Element/optgroup","seeAlso":"Other form-related elements: <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/form\">&lt;form&gt;</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/legend\">&lt;legend&gt;</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/label\">&lt;label&gt;</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/button\">&lt;button&gt;</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/select\">&lt;select&gt;</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/datalist\">&lt;datalist&gt;</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/option\">&lt;option&gt;</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/fieldset\">&lt;fieldset&gt;</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/textarea\">&lt;textarea&gt;</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/keygen\">&lt;keygen&gt;</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/input\">&lt;input&gt;</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/output\">&lt;output&gt;</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/progress\">&lt;progress&gt;</a></code>\n and <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/meter\">&lt;meter&gt;</a></code>\n.","summary":"In a web form, the HTML <em>optgroup</em> element (&lt;optgroup&gt;) creates a grouping of options within a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/select\">&lt;select&gt;</a></code>\n element.","members":[{"obsolete":false,"url":"","name":"label","help":"The name of the group of options, which the browser can use when labeling the options in the user interface. This attribute is mandatory if this element is used."},{"obsolete":false,"url":"","name":"disabled","help":"If this Boolean attribute is set, none of the items in this option group is selectable. Often browsers grey out such control and it won't received any browsing events, like mouse clicks or focus-related ones."}]},"SVGZoomAndPan":{"title":"SVGViewElement","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/SVGViewElement","skipped":true,"cause":"Suspect title"},"Console":{"title":"Using the Web Console","examples":["<p>Let's say you have a DOM&nbsp;node with the ID&nbsp;\"title\". In fact, this page you're reading right now has one, so you can open up the Web Console and try this right now.</p>\n<p>Let's take a look at the contents of that node by using the <code>$()</code>&nbsp;and <code>inspect()</code>&nbsp;functions:</p>\n<p><code>inspect($(\"title\"))</code></p>\n<p>This automatically opens up the object inspector, showing you the contents of the DOM&nbsp;node with the ID \"title\".</p>","<p>Let's say you have a DOM&nbsp;node with the ID&nbsp;\"title\". In fact, this page you're reading right now has one, so you can open up the Web Console and try this right now.</p>\n<p>Let's take a look at the contents of that node by using the <code>$()</code>&nbsp;and <code>inspect()</code>&nbsp;functions:</p>\n<p><code>inspect($(\"title\"))</code></p>\n<p>This automatically opens up the object inspector, showing you the contents of the DOM&nbsp;node with the ID \"title\".</p>","<p>That's well and good if you happen to be sitting at the browser exhibiting some problem, but let's say you're debugging remotely for a user, and need a look at the contents of a node. You can have your user open up the Web Console and dump the contents of the node into the log, then copy and paste it into an email to you, using the <code>pprint()</code>&nbsp;function:</p>\n<pre>pprint($(\"title\"))\n</pre>\n<p>This spews out the contents of the node so you can take a look. Of course, this may be more useful with other objects than a DOM&nbsp;node, but you get the idea.</p>","<p>That's well and good if you happen to be sitting at the browser exhibiting some problem, but let's say you're debugging remotely for a user, and need a look at the contents of a node. You can have your user open up the Web Console and dump the contents of the node into the log, then copy and paste it into an email to you, using the <code>pprint()</code>&nbsp;function:</p>\n<pre>pprint($(\"title\"))\n</pre>\n<p>This spews out the contents of the node so you can take a look. Of course, this may be more useful with other objects than a DOM&nbsp;node, but you get the idea.</p>"],"srcUrl":"https://developer.mozilla.org/en/Using_the_Web_Console","seeAlso":"Web Console Helpers","summary":"<p>Beginning with Firefox 4, the old <a title=\"en/Error Console\" rel=\"internal\" href=\"https://developer.mozilla.org/en/Error_Console\">Error Console</a> has been deprecated in favor of the new, improved Web&nbsp;Console. The Web Console is something of a heads-up display for the web, letting you view error messages and other logged information. In addition, there are methods you can call to output information to the console, making it a useful debugging aid, and you can evaluate JavaScript on the fly.</p>\n<p><a title=\"webconsole.png\" rel=\"internal\" href=\"https://developer.mozilla.org/@api/deki/files/4748/=webconsole.png\"><img alt=\"webconsole.png\" class=\"internal default\" src=\"https://developer.mozilla.org/@api/deki/files/4748/=webconsole.png\"></a></p>\n<p>The Web Console won't replace more advanced debugging tools like <a class=\"external\" title=\"http://getfirebug.com/\" rel=\"external\" href=\"http://getfirebug.com/\" target=\"_blank\">Firebug</a>; what it does give you, however, is a way to let remote users of your site or web application gather and report console logs and other information to you. It also provides a lightweight way to debug content if you don't happen to have Firebug installed when something goes wrong.</p>\n<div class=\"note\"><strong>Note:</strong> The Error Console is still available; you can re-enable it by changing the <code>devtools.errorconsole.enabled</code> preference to <code>true</code> and restarting the browser.</div>","members":[]},"EntrySync":{"title":"EntrySync","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td>13\n<span title=\"prefix\">webkit</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE&nbsp;Phone</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> </tr> </tbody> </table>\n</div>","summary":"<div><strong>DRAFT</strong> <div>This page is not complete.</div>\n</div>\n<p>The <code>EntrySync</code> interface of the <a title=\"en/DOM/File_API/File_System_API\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/File_API/File_System_API\">FileSystem API</a> represents entries in a file system. The entries can be a file&nbsp;or a <a href=\"https://developer.mozilla.org/en/DOM/File_API/File_system_API/DirectoryEntry\" rel=\"internal\" title=\"en/DOM/File_API/File_system_API/DirectoryEntry\">DirectoryEntry</a>.</p>","members":[{"name":"getMetadata","help":"<p>Look up metadata about this entry.</p>\n<pre>void getMetada (\n  in MetadataCallback ErrorCallback\n);</pre>\n<div id=\"section_4\"><span id=\"Parameter\"></span><h5 class=\"editable\">Parameter</h5>\n<dl> <dt>successCallback</dt> <dd>A callback that is called with the time of the last modification.</dd> <dt>errorCallback</dt> <dd>A callback that is called when errors happen.</dd>\n</dl>\n</div><div id=\"section_5\"><span id=\"Returns\"></span><h5 class=\"editable\">Returns</h5>\n<dl> <dt><code>void</code></dt>\n</dl>\n</div>","obsolete":false},{"name":"getParent","help":"<p>Look up the parent <code>DirectoryEntry</code> containing this entry. If this entry is the root of its filesystem, its parent is itself.</p>\n<pre>void getParent (\n  <em>(in EntryCallback successCallback, optional ErrorCallback errorCallback);</em>\n);</pre>\n<div id=\"section_19\"><span id=\"Parameter_6\"></span><h5 class=\"editable\">Parameter</h5>\n<dl> <dt>parent</dt> <dd>The directory to which to move the entry.</dd> <dt>newName</dt> <dd>The new name of the entry. Defaults to the entry's current name if unspecified.</dd> <dt>successCellback</dt> <dd>A callback that is called with the entry for the new object.</dd> <dt>errorCallback</dt> <dd>A callback that is called when errors happen.</dd>\n</dl>\n</div><div id=\"section_20\"><span id=\"Returns_6\"></span><h5 class=\"editable\">Returns</h5>\n<dl> <dt><code>void</code></dt>\n</dl> </div>","obsolete":false},{"name":"remove","help":"<p>Deletes a file or directory. You cannot delete an empty directory or the root directory of a filesystem.</p>\n<pre>void remove (\n  <em>(in VoidCallback successCallback, optional ErrorCallback errorCallback);</em>\n);</pre>\n<div id=\"section_16\"><span id=\"Parameter_5\"></span><h5 class=\"editable\">Parameter</h5>\n<dl> <dt>successCallback</dt> <dd>A callback that is called with the entry for the new object.</dd> <dt>errorCallback</dt> <dd>A callback that is called when errors happen.</dd>\n</dl>\n</div><div id=\"section_17\"><span id=\"Returns_5\"></span><h5 class=\"editable\">Returns</h5>\n<dl> <dt><code>void</code></dt>\n</dl>\n</div>","obsolete":false},{"name":"copyTo","help":"<p>Copy an entry to a different location on the file system. You cannot copy an entry inside itself if it is a directory nor can you copy it into its parent if a name different from its current one isn't provided. Directory copies are always recursive—that is, they copy all contents of the directory.</p>\n<pre>void vopyTo (\n  <em>(in DirectoryEntry parent, optional DOMString newName, optional EntryCallback successCallback, optional ErrorCallback errorCallback);</em>\n);</pre>\n<div id=\"section_10\"><span id=\"Parameter_3\"></span><h5 class=\"editable\">Parameter</h5>\n<dl> <dt>parent</dt> <dd>The directory to which to move the entry.</dd> <dt>newName</dt> <dd>The new name of the entry. Defaults to the entry's current name if unspecified.</dd> <dt>successCallback</dt> <dd>A callback that is called with the entry for the new object.</dd> <dt>errorCallback</dt> <dd>A callback that is called when errors happen.</dd>\n</dl>\n</div><div id=\"section_11\"><span id=\"Returns_3\"></span><h5 class=\"editable\">Returns</h5>\n<dl> <dt><code>void</code></dt>\n</dl>\n</div>","obsolete":false},{"name":"moveTo","help":"<p>Move an entry to a different location on the file system. You cannot do the following:</p>\n<ul> <li>move a directory inside itself or to any child at any depth;</li> <li>move an entry into its parent if a name different from its current one isn't provided;</li> <li>move a file to a path occupied by a directory;</li> <li>move a directory to a path occupied by a file;</li> <li>move any element to a path occupied by a directory which is not empty.</li>\n</ul>\n<p>Moving a file over an existing file&nbsp;replaces that existing file. A move of a directory on top of an existing empty directory&nbsp;replaces that directory.</p>\n<pre>void moveTo (\n  <em>(in DirectoryEntry parent, optional DOMString newName, optional EntryCallback successCallback, optional ErrorCallback errorCallback);</em>\n);</pre>\n<div id=\"section_7\"><span id=\"Parameter_2\"></span><h5 class=\"editable\">Parameter</h5>\n<dl> <dt>parent</dt> <dd>The directory to which to move the entry.</dd> <dt>newName</dt> <dd>The new name of the entry. Defaults to the entry's current name if unspecified.</dd> <dt>successCallback</dt> <dd>A callback that is called with the entry for the new object.</dd> <dt>errorCallback</dt> <dd>A callback that is called when errors happen.</dd>\n</dl>\n</div><div id=\"section_8\"><span id=\"Returns_2\"></span><h5 class=\"editable\">Returns</h5>\n<dl> <dt><code>void</code></dt>\n</dl>\n</div>","obsolete":false},{"name":"toURL","help":"<p>Returns a URL that can be used to identify this entry. It has no specific expiration. Bcause it describes a location on disk, it is valid for as long as that location exists. Users can supply&nbsp;<code>mimeType</code>&nbsp;to simulate the optional mime-type header associated with HTTP downloads.</p>\n<pre>DOMString toURL (\n  <em>(in </em>optional DOMString mimeType<em>);</em>\n);</pre>\n<div id=\"section_13\"><span id=\"Parameter_4\"></span><h5 class=\"editable\">Parameter</h5>\n<dl> <dt>mimeType</dt> <dd>For a FileEntry, the mime type to be used to interpret the file, when loaded through this URL.</dd>\n</dl>\n</div><div id=\"section_14\"><span id=\"Returns_4\"></span><h5 class=\"editable\">Returns</h5>\n<dl> <dt><code>DOMString</code></dt>\n</dl>\n</div>","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/DOM/File_API/File_System_API/EntrySync"},"SVGException":{"title":"User talk:Jeff Schiller","members":[],"srcUrl":"https://developer.mozilla.org/User_talk:Jeff_Schiller","skipped":true,"cause":"Suspect title"},"XPathEvaluator":{"title":"nsIDOMXPathEvaluator","seeAlso":"<li><a title=\"en/Introduction to using XPath in JavaScript\" rel=\"internal\" href=\"https://developer.mozilla.org/en/Introduction_to_using_XPath_in_JavaScript\">Introduction to using XPath in JavaScript</a></li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/document.evaluate\">document.evaluate</a></code>\n</li> <li>\n<a rel=\"custom\" href=\"http://www.w3.org/TR/DOM-Level-3-XPath\">DOM Level 3 XPath Specification</a></li> <li>\n<a rel=\"custom\" href=\"http://www.w3.org/TR/xpath\">XML Path Language (XPath)</a><span title=\"Recommendation\">REC</span></li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsIDOMXPathResult\">nsIDOMXPathResult</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsIDOMXPathException\">nsIDOMXPathException</a></code>\n</li>","summary":"<div><div>\n\n<a rel=\"custom\" href=\"http://mxr.mozilla.org/mozilla-central/source/dom/interfaces/xpath/nsIDOMXPathEvaluator.idl\"><code>dom/interfaces/xpath/nsIDOMXPathEvaluator.idl</code></a><span><a rel=\"internal\" href=\"https://developer.mozilla.org/en/Interfaces/About_Scriptable_Interfaces\" title=\"en/Interfaces/About_Scriptable_Interfaces\">Scriptable</a></span></div><span>This interface is used to evaluate XPath expressions against a DOM node.</span><div>Inherits from: <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsISupports\">nsISupports</a></code>\n<span>Last changed in Gecko 1.7 \n</span></div></div>\n<p></p>\n<p>Implemented by: <code>@mozilla.org/dom/xpath-evaluator;1</code>. To create an instance, use:</p>\n<pre class=\"eval\">var domXPathEvaluator = Components.classes[\"@mozilla.org/dom/xpath-evaluator;1\"]\n                        .createInstance(Components.interfaces.nsIDOMXPathEvaluator);\n</pre>","members":[{"name":"createExpression","help":"<p>Creates an <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsIDOMXPathExpression\">nsIDOMXPathExpression</a></code>\n which can then be used for (repeated) evaluations.</p>\n<div class=\"geckoVersionNote\">\n<p>\n</p><div class=\"geckoVersionHeading\">Gecko 1.9 note<div>(Firefox 3)\n</div></div>\n<p></p>\n<p>Prior to Gecko 1.9, you could call this method on documents other than the one you planned to run the XPath against; starting with Gecko 1.9, however, you must call it on the same document.</p>\n</div>\n\n<div id=\"section_4\"><span id=\"Parameters\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>expression</code></dt> <dd>A string representing the XPath to be created.</dd> <dt><code>resolver</code></dt> <dd>A name space resolver created by , or a user defined name space resolver. Read more on <a title=\"en/Introduction to using XPath in JavaScript#Implementing a User Defined Namespace Resolver\" rel=\"internal\" href=\"https://developer.mozilla.org/en/Introduction_to_using_XPath_in_JavaScript#Implementing_a_User_Defined_Namespace_Resolver\">Implementing a User Defined Namespace Resolver</a> if you wish to take the latter approach.</dd>\n</dl>\n</div><div id=\"section_5\"><span id=\"Return_value\"></span><h6 class=\"editable\">Return value</h6>\n<p>An XPath expression, as an <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsIDOMXPathExpression\">nsIDOMXPathExpression</a></code>\n object.</p>\n</div>","idl":"<pre class=\"eval\"> nsIDOMXPathExpression createExpression(\n   in DOMString expression,\n   in nsIDOMXPathNSResolver resolver\n );\n</pre>","obsolete":false},{"name":"createNSResolver","help":"<p>Creates an <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsIDOMXPathExpression\">nsIDOMXPathExpression</a></code>\n which resolves name spaces with respect to the definitions in scope for a specified node. It is used to resolve prefixes within the XPath itself, so that they can be matched with the document. <code>null</code> is common for HTML documents or when no name space prefixes are used.</p>\n\n<div id=\"section_7\"><span id=\"Parameters_2\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>nodeResolver</code></dt> <dd>The node to be used as a context for name space resolution.</dd>\n</dl>\n</div><div id=\"section_8\"><span id=\"Return_value_2\"></span><h6 class=\"editable\">Return value</h6>\n<p>A name space resolver.</p>\n</div>","idl":"<pre class=\"eval\">nsIDOMXPathNSResolver createNSResolver(\n  in nsIDOMNode nodeResolver\n);\n</pre>","obsolete":false},{"name":"evaluate","help":"<p>Evaluate the specified XPath expression.</p>\n\n<div id=\"section_10\"><span id=\"Parameters_3\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>expression</code></dt> <dd>A string representing the XPath to be evaluated.</dd> <dt><code>contextNode</code></dt> <dd>A DOM Node to evaluate the XPath expression against. To evaluate against a whole document, use the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/document.documentElement\">document.documentElement</a></code>\n.</dd> <dt><code>resolver</code></dt> <dd>A name space resolver created by , or a user defined name space resolver. Read more on <a title=\"en/Introduction to using XPath in JavaScript#Implementing a User Defined Namespace Resolver\" rel=\"internal\" href=\"https://developer.mozilla.org/en/Introduction_to_using_XPath_in_JavaScript#Implementing_a_User_Defined_Namespace_Resolver\">Implementing a User Defined Namespace Resolver</a> if you wish to take the latter approach.</dd> <dt><code>type</code></dt> <dd>A number that corresponds to one of the type constants of <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/XPCOM_Interface_Reference/nsIXPathResult&amp;ident=nsIXPathResult\" class=\"new\">nsIXPathResult</a></code>\n.</dd> <dt><code>result</code></dt> <dd>An existing <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/XPCOM_Interface_Reference/nsIXPathResult&amp;ident=nsIXPathResult\" class=\"new\">nsIXPathResult</a></code>\n to use for the result. Using <code>null</code> will create a new <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/XPCOM_Interface_Reference/nsIXPathResult&amp;ident=nsIXPathResult\" class=\"new\">nsIXPathResult</a></code>\n.</dd>\n</dl>\n</div><div id=\"section_11\"><span id=\"Return_value_3\"></span><h6 class=\"editable\">Return value</h6>\n<p>An XPath result.</p>\n</div>","idl":"<pre class=\"eval\">nsISupports evaluate(\n  in DOMString expression,\n  in nsIDOMNode contextNode,\n  in nsIDOMXPathNSResolver resolver,\n  in unsigned short type,\n  in nsISupports result\n);\n</pre>","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsIDOMXPathEvaluator"},"SharedWorker":{"title":"SharedWorker","seeAlso":"<li><a title=\"En/DOM/Worker\" class=\"internal\" rel=\"internal\" href=\"https://developer.mozilla.org/En/DOM/Worker\"><code>Worker</code></a></li> <li><a title=\"en/Using DOM workers\" class=\"internal\" rel=\"internal\" href=\"https://developer.mozilla.org/en/Using_DOM_workers\">Using DOM&nbsp;workers</a></li>","summary":"Not yet implemented by Firefox.","members":[],"srcUrl":"https://developer.mozilla.org/En/DOM/SharedWorker"},"WebKitCSSKeyframesRule":{"title":"CSSRuleList","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/CSSRuleList","skipped":true,"cause":"Suspect title"},"HTMLSourceElement":{"title":"HTMLSourceElement","members":[{"name":"media","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/source#attr-media\">media</a></code>\n HTML&nbsp;attribute, containing the intended type of the media resource.","obsolete":false},{"name":"src","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/source#attr-src\">src</a></code>\n HTML&nbsp;attribute, containing the URL&nbsp;for the media resource.","obsolete":false},{"name":"type","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/source#attr-type\">type</a></code>\n HTML&nbsp;attribute, containing the type of the media resource.","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/DOM/HTMLSourceElement"},"HTMLMetaElement":{"title":"HTMLMetaElement","summary":"The meta objects expose the <a class=\" external\" target=\"_blank\" rel=\"external\" href=\"http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-37041454\" title=\"http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-37041454\">HTMLMetaElement</a> interface which contains descriptive metadata about a document.&nbsp; This object inherits all of the properties and methods described in the <a class=\"internal\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/element\">element</a> section.","members":[{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/meta.scheme","name":"scheme","help":"Gets or sets the name of a scheme used to interpret the value of a meta-data property."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/meta.content","name":"content","help":"Gets or sets the value of meta-data property."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/meta.httpEquiv","name":"httpEquiv","help":"Gets or sets the name of an HTTP&nbsp;response header to define for a document."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/meta.name","name":"name","help":"Gets or sets the name of a meta-data property to define for a document."}],"srcUrl":"https://developer.mozilla.org/en/DOM/HTMLMetaElement"},"ElementTimeControl":{"title":"SVGAnimationElement","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/SVGAnimationElement","skipped":true,"cause":"Suspect title"},"SVGMPathElement":{"title":"SVGMPathElement","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> </tbody>\n</table>\n</div>\n<div id=\"compat-mobile\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> </tbody>\n</table>\n</div>","summary":"The <code>SVGMPathElement</code> interface corresponds to the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/mpath\">&lt;mpath&gt;</a></code>\n element.","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/SVGMPathElement"},"SVGPathSegLinetoVerticalAbs":{"title":"SVGPathElement","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/SVGPathElement","skipped":true,"cause":"Suspect title"},"SVGRectElement":{"title":"SVGRectElement","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td>9.0</td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> </tbody>\n</table>\n</div>\n<div id=\"compat-mobile\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> </tbody>\n</table>\n</div>","srcUrl":"https://developer.mozilla.org/en/Document_Object_Model_(DOM)/SVGRectElement","seeAlso":"<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/rect\">&lt;rect&gt;</a></code>\n SVG Element","summary":"The <code>SVGRectElement</code> interface provides access to the properties of <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/rect\">&lt;rect&gt;</a></code>\n elements, as well as methods to manipulate them.","members":[{"name":"width","help":"Corresponds to attribute \n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Attribute/width\">width</a></code> on the given <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/rect\">&lt;rect&gt;</a></code>\n element.","obsolete":false},{"name":"height","help":"Corresponds to attribute \n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Attribute/height\">height</a></code> on the given <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/rect\">&lt;rect&gt;</a></code>\n element.","obsolete":false},{"name":"rx","help":"Corresponds to attribute \n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Attribute/rx\">rx</a></code> on the given <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/rect\">&lt;rect&gt;</a></code>\n element.","obsolete":false},{"name":"ry","help":"Corresponds to attribute \n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Attribute/ry\">ry</a></code> on the given <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/rect\">&lt;rect&gt;</a></code>\n element.","obsolete":false}]},"TreeWalker":{"title":"treeWalker","summary":"<p>The <code>TreeWalker</code> object represents the nodes of a document subtree and a position within them.</p>\n<p>A TreeWalker can be created using the <code><a title=\"en/DOM/document.createTreeWalker\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/document.createTreeWalker\">createTreeWalker()</a></code> method of the <code><a title=\"en/DOM/document\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/document\">document</a></code> object.</p>","members":[{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/treeWalker.previousSibling","name":"previousSibling","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/treeWalker.nextNode","name":"nextNode","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/treeWalker.lastChild","name":"lastChild","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/treeWalker.previousNode","name":"previousNode","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/treeWalker.firstChild","name":"firstChild","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/treeWalker.parentNode","name":"parentNode","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/treeWalker.nextSibling","name":"nextSibling","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/treeWalker.filter","name":"filter","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/treeWalker.ExpandEntityReferences","name":"expandEntityReferences","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/treeWalker.whatToShow","name":"whatToShow","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/treeWalker.root","name":"root","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/treeWalker.currentNode","name":"currentNode","help":""}],"srcUrl":"https://developer.mozilla.org/en/DOM/Treewalker","specification":"DOM Level 2 Traversal: TreeWalker"},"HTMLVideoElement":{"title":"HTMLVideoElement","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td>4.0 (2.0)\n</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td>4.0 (2.0)\n</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>","srcUrl":"https://developer.mozilla.org/en/DOM/HTMLVideoElement","seeAlso":"<li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/HTMLAudioElement\">HTMLAudioElement</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/HTMLMediaELement\">HTMLMediaELement</a></code>\n</li> <li><a class=\" external\" rel=\"external\" href=\"http://people.mozilla.org/~cpearce/paint-stats-demo.html\" title=\"http://people.mozilla.org/~cpearce/paint-stats-demo.html\" target=\"_blank\">Demo of video paint statistics</a></li>","summary":"DOM <code>video</code> objects expose the <a class=\"external\" title=\"http://www.w3.org/TR/html5/video.html#htmlvideoelement\" rel=\"external\" href=\"http://www.w3.org/TR/html5/video.html#htmlvideoelement\" target=\"_blank\">HTMLVideoElement</a> interface, which provides special properties (beyond the regular <a href=\"https://developer.mozilla.org/en/DOM/element\" rel=\"internal\">element</a> object and <a title=\"en/DOM/HTMLMediaElement\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/HTMLMediaElement\">HTMLMediaElement</a> interfaces they also have available to them by inheritance) for manipulating video objects.","members":[{"name":"height","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/video#attr-height\">height</a></code>\n HTML attribute, which specifies the height of the display area, in CSS pixels.","obsolete":false},{"name":"poster","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/video#attr-poster\">poster</a></code>\n HTML&nbsp;attribute, which specifies an image to show while no video data is available.","obsolete":false},{"name":"videoHeight","help":"The intrinsic height of the resource in CSS pixels, taking into account the dimensions, aspect ratio, clean aperture, resolution, and so forth, as defined for the format used by the resource. If the element's ready state is HAVE_NOTHING, the value is 0.","obsolete":false},{"name":"videoWidth","help":"The intrinsic width of the resource in CSS pixels, taking into account the dimensions, aspect ratio, clean aperture, resolution, and so forth, as defined for the format used by the resource. If the element's ready state is HAVE_NOTHING, the value is 0.","obsolete":false},{"name":"width","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/video#attr-width\">width</a></code>\n&nbsp;HTML&nbsp;attribute, which specifies the width of the display area, in CSS pixels.","obsolete":false}]},"FileReaderSync":{"title":"FileReaderSync","seeAlso":"<li>\n<a rel=\"custom\" href=\"http://dev.w3.org/2006/webapi/FileAPI/#FileReader-interface\">File API Specification: FileReaderSync</a><span title=\"Working Draft\">WD</span></li> <li>Related interfaces: <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/FileReader\">FileReader</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/BlobBuilder\">BlobBuilder</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/File\">File</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Blob\">Blob</a></code>\n</li>","summary":"<p>The <code>FileReaderSync</code> interface allows to read <code>File</code> or <code>Blob</code> objects in a synchronous way.</p>\n<p>This interface is <a title=\"https://developer.mozilla.org/En/DOM/Worker/Functions_available_to_workers\" rel=\"internal\" href=\"https://developer.mozilla.org/En/DOM/Worker/Functions_available_to_workers\">only available</a> in <a title=\"Worker\" rel=\"internal\" href=\"https://developer.mozilla.org/En/DOM/Worker\">workers</a> as it enables synchronous I/O that could potentially block.</p>","members":[{"name":"readAsDataURL","help":"<p>This method reads the contents of the specified <code><a href=\"https://developer.mozilla.org/en/DOM/Blob\" rel=\"custom\">Blob</a></code> or <code><a href=\"https://developer.mozilla.org/en/DOM/File\" rel=\"custom\">File</a></code>. When the read operation is finished, it returns a data URL representing the file's data. If an error happened during the read, the adequate exception is sent.</p>\n\n<div id=\"section_5\"> <div id=\"section_17\"><span id=\"Parameters_4\"></span><h4 class=\"editable\"><span>Parameters</span></h4> <dl> <dt><code>blob</code></dt> <dd>The DOM <code><a href=\"https://developer.mozilla.org/en/DOM/Blob\" rel=\"custom\">Blob</a></code> or <code><a href=\"https://developer.mozilla.org/en/DOM/File\" rel=\"custom\">File</a></code> to read.</dd> </dl>\n</div></div>\n<div id=\"section_6\"> <div id=\"section_18\"><span id=\"Return_value_4\"></span><h4 class=\"editable\"><span>Return value</span></h4> <p>An <a title=\"DOMString\" rel=\"internal\" href=\"https://developer.mozilla.org/En/DOM/DOMString\"><code>DOMString</code></a> representing the file's data as a data URL.</p>\n</div></div>\n<div id=\"section_19\"><span id=\"Exceptions_4\"></span><h4 class=\"editable\"><span>Exceptions</span></h4>\n<p>The following exceptions can be raised by this method:</p>\n<dl> <dt><code>NotFoundError</code></dt> <dd>is raised when the resource represented by the DOM <code><a href=\"https://developer.mozilla.org/en/DOM/Blob\" rel=\"custom\">Blob</a></code> or <code><a href=\"https://developer.mozilla.org/en/DOM/File\" rel=\"custom\">File</a></code> cannot be found, e. g. because it has been erased.</dd> <dt><code>SecurityError</code></dt> <dd>is raised when one of the following problematic situation is detected: <ul> <li>the resource has been modified by a third party;</li> <li>too many read are performed simultaneously;</li> <li>the file pointed by the resource is unsafe for a use from the Web (like it is a system file).</li> </ul> </dd> <dt><code>NotReadableError</code></dt> <dd>is raised when the resource cannot be read due to a permission problem, like a concurrent lock.</dd> <dt><code>EncodingError</code></dt> <dd>is raised when the resource is a data URL and exceed the limit length defined by each browser.</dd>\n</dl>\n<dl> <dt></dt>\n</dl></div>","idl":"<pre class=\"eval\">void readAsDataURL(\n  in Blob file\n);\n</pre>","obsolete":false},{"name":"readAsText","help":"<p>This methods reads the specified blob's contents. When the read operation is finished, it returns a <a title=\"DOMString\" rel=\"internal\" href=\"https://developer.mozilla.org/En/DOM/DOMString\"><code>DOMString</code></a> containing the file represented as a text string. The optional <strong><code>encoding</code></strong> parameter indicates the encoding to be used. If not present, the method will apply a detection algorithm for it. If an error happened during the read, the adequate exception is sent.</p>\n\n<div id=\"section_13\"><span id=\"Parameters_3\"></span><h4 class=\"editable\">Parameters</h4>\n<dl> <dt><code>blob</code></dt> <dd>The DOM <code><a href=\"https://developer.mozilla.org/en/DOM/Blob\" rel=\"custom\">Blob</a></code> or <code><a href=\"https://developer.mozilla.org/en/DOM/File\" rel=\"custom\">File</a></code> to read into the <a title=\"DOMString\" rel=\"internal\" href=\"https://developer.mozilla.org/En/DOM/DOMString\"><code>DOMString</code></a>.</dd> <dt><code>encoding</code></dt> <dd>Optional. A string representing the encoding to be used, like <strong>iso-8859-1</strong> or <strong>UTF-8</strong>.</dd>\n</dl>\n</div><div id=\"section_14\"><span id=\"Return_value_3\"></span><h4 class=\"editable\">Return value</h4>\n<p>A <a href=\"https://developer.mozilla.org/en/DOM/DOMString\" rel=\"internal\" title=\"DOMString\"><code>DOMString</code></a> containing the raw binary data from the resource</p>\n</div><div id=\"section_15\"><span id=\"Exceptions_3\"></span><h4 class=\"editable\">Exceptions</h4>\n<p>The following exceptions can be raised by this method:</p>\n<dl> <dt><code>NotFoundError</code></dt> <dd>is raised when the resource represented by the DOM <code><a href=\"https://developer.mozilla.org/en/DOM/Blob\" rel=\"custom\">Blob</a></code> or <code><a href=\"https://developer.mozilla.org/en/DOM/File\" rel=\"custom\">File</a></code> cannot be found, e. g. because it has been erased.</dd> <dt><code>SecurityError</code></dt> <dd>is raised when one of the following problematic situation is detected: <ul> <li>the resource has been modified by a third party;</li> <li>two many read are performed simultaneously;</li> <li>the file pointed by the resource is unsafe for a use from the Web (like it is a system file).</li> </ul> </dd> <dt><code>NotReadableError</code></dt> <dd>is raised when the resource cannot be read due to a permission problem, like a concurrent lock.</dd>\n</dl>\n</div>","idl":"<pre class=\"eval\">void readAsText(\n  in Blob blob,\n  in DOMString encoding \n<span style=\"border: 1px solid #9ED2A4; background-color: #C0FFC7; font-size: x-small; white-space: nowrap; padding: 2px;\" title=\"\">Optional</span>\n\n);\n</pre>","obsolete":false},{"name":"readAsBinaryString","help":"<p>This method reads the contents of the specified <code><a href=\"https://developer.mozilla.org/en/DOM/Blob\" rel=\"custom\">Blob</a></code>, which may be a <code><a href=\"https://developer.mozilla.org/en/DOM/File\" rel=\"custom\">File</a></code>. When the read operation is finished, it returns a <a title=\"DOMString\" rel=\"internal\" href=\"https://developer.mozilla.org/En/DOM/DOMString\"><code>DOMString</code></a> containing the raw binary data from the file. If an error happened during the read, the adequate exception is sent.</p>\n<div class=\"note\"><strong>Note</strong> <strong>: </strong>This method is deprecated and <code>readAsArrayBuffer()</code> should be used instead.</div>\n\n<div id=\"section_9\"><span id=\"Parameters_2\"></span><h4 class=\"editable\">Parameters</h4>\n<dl> <dt><code>blob</code></dt> <dd>The DOM <code><a href=\"https://developer.mozilla.org/en/DOM/Blob\" rel=\"custom\">Blob</a></code> or <code><a href=\"https://developer.mozilla.org/en/DOM/File\" rel=\"custom\">File</a></code> to read into the <a title=\"DOMString\" rel=\"internal\" href=\"https://developer.mozilla.org/En/DOM/DOMString\"><code>DOMString</code></a>.</dd>\n</dl>\n</div><div id=\"section_10\"><span id=\"Return_value_2\"></span><h4 class=\"editable\">Return value</h4>\n<p><code>A </code><a title=\"DOMString\" rel=\"internal\" href=\"https://developer.mozilla.org/En/DOM/DOMString\"><code>DOMString</code></a> containing the raw binary data from the resource</p>\n</div><div id=\"section_11\"><span id=\"Exceptions_2\"></span><h4 class=\"editable\">Exceptions</h4>\n<p>The following exceptions can be raised by this method:</p>\n<dl> <dt><code>NotFoundError</code></dt> <dd>is raised when the resource represented by the DOM <code><a href=\"https://developer.mozilla.org/en/DOM/Blob\" rel=\"custom\">Blob</a></code> or <code><a href=\"https://developer.mozilla.org/en/DOM/File\" rel=\"custom\">File</a></code> cannot be found, e. g. because it has been erased.</dd> <dt><code>SecurityError</code></dt> <dd>is raised when one of the following problematic situation is detected: <ul> <li>the resource has been modified by a third party;</li> <li>two many read are performed simultaneously;</li> <li>the file pointed by the resource is unsafe for a use from the Web (like it is a system file).</li> </ul> </dd> <dt><code>NotReadableError</code></dt> <dd>is raised when the resource cannot be read due to a permission problem, like a concurrent lock.</dd> <dt><code>EncodingError</code></dt> <dd>is raised when the resource is a data URL and exceed the limit length defined by each browser.</dd>\n</dl>\n</div>","idl":"<pre class=\"eval\">void readAsBinaryString(\n  in Blob blob\n);\n</pre>","obsolete":false},{"name":"readAsArrayBuffer","help":"<p>This method reads the contents of the specified <code><a href=\"https://developer.mozilla.org/en/DOM/Blob\" rel=\"custom\">Blob</a></code> or <code><a href=\"https://developer.mozilla.org/en/DOM/File\" rel=\"custom\">File</a></code>. When the read operation is finished, it returns an <code><a href=\"../JavaScript_typed_arrays/ArrayBuffer\" rel=\"internal\" title=\"/en/JavaScript_typed_arrays/ArrayBuffer\">ArrayBuffer</a></code> representing the file's data. If an error happened during the read, the adequate exception is sent.</p>\n\n<div id=\"section_5\"><span id=\"Parameters\"></span><h4 class=\"editable\">Parameters</h4>\n<dl> <dt><code>blob</code></dt> <dd>The DOM <code><a href=\"https://developer.mozilla.org/en/DOM/Blob\" rel=\"custom\">Blob</a></code> or <code><a href=\"https://developer.mozilla.org/en/DOM/File\" rel=\"custom\">File</a></code> to read into the <code><a href=\"../JavaScript_typed_arrays/ArrayBuffer\" rel=\"internal\" title=\"/en/JavaScript_typed_arrays/ArrayBuffer\">ArrayBuffer</a></code>.</dd>\n</dl>\n</div><div id=\"section_6\"><span id=\"Return_value\"></span><h4 class=\"editable\">Return value</h4>\n<p>An <code><a href=\"../JavaScript_typed_arrays/ArrayBuffer\" rel=\"internal\" title=\"/en/JavaScript_typed_arrays/ArrayBuffer\">ArrayBuffer</a></code> representing the file's data.</p>\n</div><div id=\"section_7\"><span id=\"Exceptions\"></span><h4 class=\"editable\">Exceptions</h4>\n<p>The following exceptions can be raised by this method:</p>\n<dl> <dt><code>NotFoundError</code></dt> <dd>is raised when the resource represented by the DOM <code><a href=\"https://developer.mozilla.org/en/DOM/Blob\" rel=\"custom\">Blob</a></code> or <code><a href=\"https://developer.mozilla.org/en/DOM/File\" rel=\"custom\">File</a></code> cannot be found, e. g. because it has been erased.</dd> <dt><code>SecurityError</code></dt> <dd>is raised when one of the following problematic situation is detected: <ul> <li>the resource has been modified by a third party;</li> <li>two many read are performed simultaneously;</li> <li>the file pointed by the resource is unsafe for a use from the Web (like it is a system file).</li> </ul> </dd> <dt><code>NotReadableError</code></dt> <dd>is raised when the resource cannot be read due to a permission problem, like a concurrent lock.</dd> <dt><code>EncodingError</code></dt> <dd>is raised when the resource is a data URL and exceed the limit length defined by each browser.</dd>\n</dl>\n</div>","idl":"<pre class=\"eval\">void readAsArrayBuffer(\n  in Blob blob\n);\n</pre>","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/DOM/FileReaderSync"},"MediaList":{"title":"XPCOM array guide","members":[],"srcUrl":"https://developer.mozilla.org/en/XPCOM_array_guide","skipped":true,"cause":"Suspect title"},"ValidityState":{"title":"ValidityState","summary":"The DOM&nbsp;<code>ValidityState</code> interface represents the <em>validity states</em> that an element can be in, with respect to constraint validation.","members":[{"name":"customError","help":"The element's custom validity message has been set to a non-empty string by calling the element's setCustomValidity() method.","obsolete":false},{"name":"patternMismatch","help":"The value does not match the specified \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/input#attr-pattern\">pattern</a></code>\n.","obsolete":false},{"name":"rangeOverflow","help":"The value is greater than the specified \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/input#attr-max\">max</a></code>\n.","obsolete":false},{"name":"rangeUnderflow","help":"The value is less than the specified \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/input#attr-min\">min</a></code>\n.","obsolete":false},{"name":"stepMismatch","help":"The value does not fit the rules determined by \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/input#attr-step\">step</a></code>\n.","obsolete":false},{"name":"tooLong","help":"<p>The value exceeds the specified <strong>maxlength</strong> for <a title=\"en/DOM/HTMLInputElement\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/HTMLInputElement\">HTMLInputElement</a> or <a title=\"en/DOM/textarea\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/HTMLTextAreaElement\">HTMLTextAreaElement</a> objects.</p> <div class=\"note\"><strong>Note:</strong> This will never be <code>true</code> in Gecko, because elements' values are prevented from being longer than <strong>maxlength</strong>.</div>","obsolete":false},{"name":"typeMismatch","help":"The value is not in the required syntax (when \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/input#attr-type\">type</a></code>\n is <code>email</code> or <code>url</code>).","obsolete":false},{"name":"valid","help":"No other constraint validation conditions are true.","obsolete":false},{"name":"valueMissing","help":"The element has a \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/input#attr-required\">required</a></code>\n attribute, but no value.","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/DOM/ValidityState","specification":"W3C HTML5 Specification: Constraints: The Constraint Validation API"},"CSSStyleDeclaration":{"title":"CSSStyleDeclaration","examples":["var styleObj= document.styleSheets[0].cssRules[0].style;\nalert(styleObj.cssText);\nfor (var i = styleObj.length-1; i &gt;= 0; i--) {\n   var nameString = styleObj[i];\n   styleObj.removeProperty(nameString);\n}\nalert(styleObj.cssText);"],"srcUrl":"https://developer.mozilla.org/en/DOM/CSSStyleDeclaration","specification":"DOM Level 2 CSS: CSSStyleDeclaration","summary":"<p>A CSSStyleDeclaration is an interface to the <a class=\"external\" rel=\"external\" href=\"http://www.w3.org/TR/1998/REC-CSS2-19980512/syndata.html#block\" title=\"http://www.w3.org/TR/1998/REC-CSS2-19980512/syndata.html#block\" target=\"_blank\">declaration block</a> returned by the <code><a href=\"https://developer.mozilla.org/en/DOM/cssRule.style\" rel=\"internal\" title=\"en/DOM/cssRule.style\">style</a></code> property of a <code><a href=\"https://developer.mozilla.org/en/DOM/cssRule\" rel=\"internal\" title=\"en/DOM/cssRule\">cssRule</a></code> in a <a href=\"https://developer.mozilla.org/en/DOM/stylesheet\" rel=\"internal\" title=\"en/DOM/stylesheet\">stylesheet</a>, when the&nbsp;rule is a <a title=\"en/DOM/cssRule#CSSStyleRule\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/cssRule#CSSStyleRule\">CSSStyleRule</a>.</p>\n<p>CSSStyleDeclaration is also a <strong>read-only </strong>interface to the result of <a title=\"en/DOM/window.getComputedStyle\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/window.getComputedStyle\">getComputedStyle</a>.</p>","members":[{"name":"removeProperty","help":" Returns the value deleted.<br> Example: <em>valString</em>= <em>styleObj</em>.removeProperty('color')","obsolete":false},{"name":"setProperty","help":" No return.<br> Example: <em>styleObj</em>.setProperty('color', 'red', 'important')","obsolete":false},{"name":"item","help":" Returns a property name.<br> Example: <em>nameString</em>= <em>styleObj</em>.item(0)<br> Alternative: <em>nameString</em>= <em>styleObj</em>[0]","obsolete":false},{"name":"getPropertyValue","help":" Returns the property value.<br> Example: <em>valString</em>= <em>styleObj</em>.getPropertyValue('color')","obsolete":false},{"name":"getPropertyCSSValue","help":"<span>Only supported via getComputedStyle.<br> </span>Returns a <a class=\"external\" title=\"http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSValue\" rel=\"external\" href=\"http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSValue\" target=\"_blank\">CSSValue</a>, or <code>null</code> for <a title=\"en/Guide to Shorthand CSS\" rel=\"internal\" href=\"https://developer.mozilla.org/en/Guide_to_Shorthand_CSS\">Shorthand properties</a>.<br> Example: <em>cssString</em>= window.getComputedStyle(<em>elem</em>, <code>null</code>).getPropertyCSSValue('color').cssText;<br> Note: Gecko 1.9 returns null unless using <a title=\"en/DOM/window.getComputedStyle\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/window.getComputedStyle\">getComputedStyle()</a>.<br> Note: this method may be <a class=\"external\" title=\"http://lists.w3.org/Archives/Public/www-style/2003Oct/0347.html\" rel=\"external\" href=\"http://lists.w3.org/Archives/Public/www-style/2003Oct/0347.html\" target=\"_blank\">deprecated by the W3C</a>.","obsolete":false},{"name":"getPropertyPriority","help":" Returns the optional priority, \"important\".<br> Example: <em>priString</em>= <em>styleObj</em>.getPropertyPriority('color')","obsolete":false},{"name":"parentRule","help":" The containing <code><a href=\"https://developer.mozilla.org/en/DOM/cssRule\" rel=\"internal\" title=\"en/DOM/cssRule\">cssRule</a>.</code>","obsolete":false},{"name":"cssText","help":" Textual representation of the declaration block. Setting this attribute changes the style.","obsolete":false},{"name":"length","help":" The number of properties. See the <strong>item</strong> method below.","obsolete":false}]},"HTMLBaseFontElement":{"title":"basefont","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody>\n</table>\n</div>\n<div id=\"compat-mobile\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody>\n</table>\n</div>","examples":["&lt;basefont color=\"#FF0000\" face=\"Helvetica\" size=\"+2\" /&gt;\n"],"srcUrl":"https://developer.mozilla.org/en/HTML/Element/basefont","summary":"Obsolete","members":[{"obsolete":false,"url":"","name":"face","help":"This attribute contains a list of one or more font names. The document text in the default style is rendered in the first font face that the client's browser supports. If no font listed is installed on the local system, the browser typically defaults to the proportional or fixed-width font for that system."},{"obsolete":false,"url":"","name":"color","help":"This attribute sets the text color using either a named color or a color specified in the hexadecimal #RRGGBB format."},{"obsolete":false,"url":"","name":"size","help":"This attribute specifies the font size as either a numeric or relative value. Numeric values range from 1 to 7 with 1 being the smallest and 3 the default."}]},"SVGAElement":{"title":"SVGAElement","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td>9.0</td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> </tbody>\n</table>\n</div>\n<div id=\"compat-mobile\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> </tbody>\n</table>\n</div>","srcUrl":"https://developer.mozilla.org/en/Document_Object_Model_(DOM)/SVGAElement","seeAlso":"<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/a\">&lt;a&gt;</a></code>\n SVG Element","summary":"The <code>SVGAElement</code> interface provides access to the properties of <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/a\">&lt;a&gt;</a></code>\n elements, as well as methods to manipulate them.","members":[{"name":"target","help":"Corresponds to attribute \n<code><a rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Attribute/target\" class=\"new\">target</a></code> on the given <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/a\">&lt;a&gt;</a></code>\n element.","obsolete":false}]},"DeviceMotionEvent":{"title":"DeviceMotionEvent","examples":["&lt;coming soon&gt;"],"srcUrl":"https://developer.mozilla.org/en/DOM/DeviceMotionEvent","specification":"DeviceOrientation specification","summary":"A <code>DeviceMotionEvent</code> object describes an event that indicates the amount of physical motion of the device that has occurred, and is fired at a set interval (rather than in response to motion). It provides information about the rate of rotation, as well as acceleration along all three axes.","members":[{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/DeviceMotionEvent.accelerationIncludingGravity","name":"accelerationIncludingGravity","help":"The acceleration of the device. This value includes the effect of gravity, and may be the only value available on devices that don't have a gyroscope to allow them to properly remove gravity from the data. <strong>Read only.</strong>"},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/DeviceMotionEvent.interval","name":"interval","help":"The interval, in milliseconds, at which the <code>DeviceMotionEvent</code> is fired. The next event will be fired in approximately this amount of time."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/DeviceMotionEvent.acceleration","name":"acceleration","help":"The acceleration of the device. This value has taken into account the effect of gravity and removed it from the figures. This value may not exist if the hardware doesn't know how to remove gravity from the acceleration data. <strong>Read only.</strong>"},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/DeviceMotionEvent.rotationRate","name":"rotationRate","help":"The rates of rotation of the device about all three axes. <strong>Read only.</strong>"}]},"ErrorEvent":{"title":"error","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/DOM_event_reference/error","skipped":true,"cause":"Suspect title"},"SVGFEGaussianBlurElement":{"title":"feGaussianBlur","seeAlso":"<li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/filter\">&lt;filter&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/animate\">&lt;animate&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/set\">&lt;set&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feBlend\">&lt;feBlend&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feColorMatrix\">&lt;feColorMatrix&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feComponentTransfer\">&lt;feComponentTransfer&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feComposite\">&lt;feComposite&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feConvolveMatrix\">&lt;feConvolveMatrix&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feDiffuseLighting\">&lt;feDiffuseLighting&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feDisplacementMap\">&lt;feDisplacementMap&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feFlood\">&lt;feFlood&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feImage\">&lt;feImage&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feMerge\">&lt;feMerge&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feMorphology\">&lt;feMorphology&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feOffset\">&lt;feOffset&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feSpecularLighting\">&lt;feSpecularLighting&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feTile\">&lt;feTile&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feTurbulence\">&lt;feTurbulence&gt;</a></code>\n</li> <li><a title=\"en/SVG/Tutorial/Filter_effects\" rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Tutorial/Filter_effects\">SVG tutorial: Filter effects</a></li>","summary":"The filter blurs the input image by the amount specified in \n<code><a rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Attribute/stdDeviation\" class=\"new\">stdDeviation</a></code>, which defines the bell-curve.","members":[],"srcUrl":"https://developer.mozilla.org/en/SVG/Element/feGaussianBlur"},"MouseEvent":{"title":"MouseEvent","srcUrl":"https://developer.mozilla.org/en/DOM/MouseEvent","specification":"DOM&nbsp;Level 2:&nbsp;MouseEvent","seeAlso":"<li><a title=\"UIEvent\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/Event/UIEvent\">UIEvent</a></li> <li><a title=\"Event\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/event\">Event</a></li>","summary":"The DOM&nbsp;<code>MouseEvent</code> represents events that occur due to the user interacting with a pointing device (such as a mouse). It's represented by the <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/XPCOM_Interface_Reference/nsINSDOMMouseEvent&amp;ident=nsINSDOMMouseEvent\" class=\"new\">nsINSDOMMouseEvent</a></code>\n&nbsp;interface, which extends the <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/XPCOM_Interface_Reference/nsIDOMMouseEvent&amp;ident=nsIDOMMouseEvent\" class=\"new\">nsIDOMMouseEvent</a></code>\n interface.","members":[{"name":"screenX","help":"The X coordinate of the mouse pointer in global (screen)&nbsp;coordinates. <strong>Read only.</strong>","obsolete":false},{"name":"screenY","help":"The Y coordinate of the mouse pointer in global (screen)&nbsp;coordinates. <strong>Read only.</strong>","obsolete":false},{"name":"clientX","help":"The X coordinate of the mouse pointer in local (DOM content)&nbsp;coordinates. <strong>Read only.</strong>","obsolete":false},{"name":"clientY","help":"The Y coordinate of the mouse pointer in local (DOM content)&nbsp;coordinates. <strong>Read only.</strong>","obsolete":false},{"name":"ctrlKey","help":"<code>true</code> if the control key was down when the mouse event was fired. <strong>Read only.</strong>","obsolete":false},{"name":"shiftKey","help":"<code>true</code> if the shift key was down when the mouse event was fired. <strong>Read only.</strong>","obsolete":false},{"name":"altKey","help":"<code>true</code> if the alt key was down when the mouse event was fired. <strong>Read only.</strong>","obsolete":false},{"name":"metaKey","help":"<code>true</code> if the meta key was down when the mouse event was fired. <strong>Read only.</strong>","obsolete":false},{"name":"button","help":"The button number that was pressed when the mouse event was fired:&nbsp;Left button=0, middle button=1 (if present), right button=2. For mice configured for left handed use in which the button actions are reversed the values are instead read from right to left. <strong>Read only.</strong>","obsolete":false},{"name":"relatedTarget","help":"The target to which the event applies. <strong>Read only.</strong>","obsolete":false},{"name":"webkitPressure","help":"The amount of pressure applied to a touch or tablet device when generating the event; this value ranges between 0.0 (minimum pressure)&nbsp;and 1.0 (maximum pressure). <strong>Read only.</strong>","obsolete":false}]},"HTMLUnknownElement":{"title":"Gecko DOM Referenz","summary":"<p>Dies ist die Übersichtsseite der Gecko DOM Referenz.</p>\n<div class=\"warning\">Diese Referenz ist im Moment noch sehr unvollständig. Hilf mit: registriere dich und schreib mit!</div>\n<div class=\"note\">Diese Referenz trennt zwischen Methoden und Eigenschaften die für Webinhalte verfügbar oder nur für Entwickler von Erweiterungen verfügbar sind. Erweiterungsentwickler halten sich bitte an die englische Funktionsreferenz im Mozilla Developer Center.</div>","members":[],"srcUrl":"https://developer.mozilla.org/de/Gecko-DOM-Referenz"},"XMLHttpRequestUpload":{"title":"Using XMLHttpRequest","members":[],"srcUrl":"https://developer.mozilla.org/En/XMLHttpRequest/Using_XMLHttpRequest","skipped":true,"cause":"Suspect title"},"HTMLOptionsCollection":{"title":"HTMLOptionsCollection","srcUrl":"https://developer.mozilla.org/en/DOM/HTMLOptionsCollection","specification":"<li><a class=\" external\" rel=\"external\" href=\"http://www.w3.org/TR/DOM-Level-2-HTML/html.html#HTMLOptionsCollection\" title=\"http://www.w3.org/TR/DOM-Level-2-HTML/html.html#HTMLOptionsCollection\" target=\"_blank\">http://www.w3.org/TR/DOM-Level-2-HTM...ionsCollection</a></li> <li><a class=\" external\" rel=\"external\" href=\"http://dev.w3.org/html5/spec/common-dom-interfaces.html#htmloptionscollection\" title=\"http://dev.w3.org/html5/spec/common-dom-interfaces.html#htmloptionscollection\" target=\"_blank\">http://dev.w3.org/html5/spec/common-...ionscollection</a></li>","seeAlso":"HTMLCollection","summary":"HTMLOptionsCollection is an interface representing a collection of HTML option elements (in document order)&nbsp;and offers methods and properties for traversing the list as well as optionally altering its items. This type is returned solely by the \"options\" property of <a title=\"En/DOM/select\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/HTMLSelectElement\">select</a>.","members":[{"name":"length","help":"As optionally allowed by the spec, Mozilla allows this property to be set, either removing options at the end when using a shorter length, or adding blank options at the end when setting a longer length. Other implementations could potentially throw a <a title=\"En/DOM/DOMException\" rel=\"internal\" href=\"https://developer.mozilla.org/En/DOM/DOMException\">DOMException</a>.","obsolete":false}]},"Storage":{"title":"Storage","seeAlso":"<ul> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/mozIStorageConnection\">mozIStorageConnection</a></code>\n Database connection to a specific file or in-memory data storage</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/mozIStorageStatement\">mozIStorageStatement</a></code>\n Create and execute SQL statements on a SQLite database.</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/mozIStorageValueArray\">mozIStorageValueArray</a></code>\n Wraps an array of SQL values, such as a result row.</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/mozIStorageFunction\">mozIStorageFunction</a></code>\n Create a new SQLite function.</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/mozIStorageAggregateFunction\">mozIStorageAggregateFunction</a></code>\n Create a new SQLite aggregate function.</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/mozIStorageProgressHandler\">mozIStorageProgressHandler</a></code>\n Monitor progress during the execution of a statement.</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/mozIStorageStatementWrapper\">mozIStorageStatementWrapper</a></code>\n Storage statement wrapper</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/XPCOM_Interface_Reference/mozIStorageService\">mozIStorageService</a></code>\n Storage Service</li>\n</ul>\n<ul> <li><a title=\"en/Storage/Performance\" rel=\"internal\" href=\"https://developer.mozilla.org/en/Storage/Performance\">Storage:Performance</a> How to get your database connection performing well.</li> <li><a class=\"link-https\" rel=\"external\" href=\"https://addons.mozilla.org/en-US/firefox/addon/3072\" title=\"https://addons.mozilla.org/en-US/firefox/addon/3072\" target=\"_blank\">Storage Inspector Extension</a> Makes it easy to view any sqlite database files in the current profile.</li> <li><a class=\"external\" rel=\"external\" href=\"http://www.sqlite.org/lang.html\" title=\"http://www.sqlite.org/lang.html\" target=\"_blank\">SQLite Syntax</a> Query language understood by SQLite</li> <li><a class=\"external\" rel=\"external\" href=\"http://sqlitebrowser.sourceforge.net/\" title=\"http://sqlitebrowser.sourceforge.net/\" target=\"_blank\">SQLite Database Browser</a> is a capable free tool available for many platforms. It can be handy for examining existing databases and testing SQL statements.</li> <li><a class=\"link-https\" rel=\"external\" href=\"https://addons.mozilla.org/en-US/firefox/addon/5817\" title=\"https://addons.mozilla.org/en-US/firefox/addon/5817\" target=\"_blank\">SQLite Manager Extension</a> helps manage sqlite database files on your computer.</li>\n</ul>","summary":"<p><strong>Storage</strong> is a <a class=\"external\" rel=\"external\" href=\"http://www.sqlite.org/\" title=\"http://www.sqlite.org/\" target=\"_blank\">SQLite</a> database API. It is available to trusted callers, meaning extensions and Firefox components only.</p>\n<p>The API is currently \"unfrozen\", which means it is subject to change at any time; in fact, it has changed somewhat with each release of Firefox since it was introduced, and will likely continue to do so for a while.</p>\n<div class=\"note\"><strong>Note:</strong> Storage is not the same as the <a title=\"en/DOM/Storage\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/Storage\">DOM:Storage</a> feature which can be used by web pages to store persistent data or the <a title=\"en/Session_store_API\" rel=\"internal\" href=\"https://developer.mozilla.org/en/Session_store_API\">Session store API</a> (an <a title=\"en/XPCOM\" rel=\"internal\" href=\"https://developer.mozilla.org/en/XPCOM\">XPCOM</a> storage utility for use by extensions).</div>","members":[],"srcUrl":"https://developer.mozilla.org/en/Storage"},"SVGFontFaceFormatElement":{"title":"SVGFontFaceFormatElement","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>","srcUrl":"https://developer.mozilla.org/en/DOM/SVGFontFaceFormatElement","seeAlso":"<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/font-face-format\">&lt;font-face-format&gt;</a></code>\n SVG Element","summary":"<p>The <code>SVGFontFaceFormatElement</code> interface corresponds to the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/font-face-format\">&lt;font-face-format&gt;</a></code>\n elements.</p>\n<p>Object-oriented access to the attributes of the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/font-face-format\">&lt;font-face-format&gt;</a></code>\n element via the SVG DOM is not possible.</p>","members":[]},"SVGUnitTypes":{"title":"SVGPatternElement","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/SVGPatternElement","skipped":true,"cause":"Suspect title"},"Attr":{"title":"Attr","summary":"<p>This type represents a DOM&nbsp;element's attribute as an object. In most DOM methods, you will probably directly retrieve the attribute as a string (e.g., <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Element.getAttribute\">Element.getAttribute()</a></code>\n, but certain functions (e.g., <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Element.getAttributeNode\">Element.getAttributeNode()</a></code>\n)&nbsp;or means of iterating give <code>Attr</code> types.</p>\n<div class=\"warning\"><strong>Warning:</strong> In DOM Core 1, 2 and 3, Attr inherited from Node. This is no longer the case in <a class=\"external\" rel=\"external\" href=\"http://www.w3.org/TR/dom/\" title=\"http://www.w3.org/TR/dom/\" target=\"_blank\">DOM4</a>. In order to bring the implementation of <code>Attr</code> up to specification, work is underway to change it to no longer inherit from <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Node\">Node</a></code>\n. You should not be using any <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Node\">Node</a></code>\n properties or methods on <code>Attr</code> objects. Starting in Gecko 7.0 (Firefox 7.0 / Thunderbird 7.0 / SeaMonkey 2.4)\n, the ones that are going to be removed output warning messages to the console. You should revise your code accordingly. See <a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Attr#Deprecated_properties_and_methods\">Deprecated properties and methods</a> for a complete list.</div>","members":[{"obsolete":false,"url":"https://developer.mozilla.org/En/DOM/Attr.schemaTypeInfo","name":"schemaTypeInfo","help":"?"},{"obsolete":false,"url":"https://developer.mozilla.org/En/DOM/Attr.ownerElement","name":"ownerElement","help":"This property has been deprecated and will be removed in the future. Since you can only get Attr objects from elements, you should already know th"},{"obsolete":false,"url":"https://developer.mozilla.org/En/DOM/Attr.isId","name":"isId","help":"Indicates whether the attribute is an \"ID attribute\". An \"ID attribute\" being an attribute which value is expected to be unique across a DOM Document. In HTML DOM, \"id\" is the only ID attribute, but XML documents could define others. Whether or not an attribute is unique is often determined by a DTD or other schema description."},{"obsolete":false,"url":"https://developer.mozilla.org/En/DOM/Attr.name","name":"name","help":"The attribute's name."},{"obsolete":false,"url":"https://developer.mozilla.org/En/DOM/Attr.specified","name":"specified","help":"This property has been deprecated and will be removed in the future; it now always returns <code>true</code>."},{"obsolete":false,"url":"https://developer.mozilla.org/En/DOM/Attr.value","name":"value","help":"The attribute's value."}],"srcUrl":"https://developer.mozilla.org/en/DOM/Attr","specification":"<li><a class=\"external\" title=\"http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-637646024\" rel=\"external\" href=\"http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-637646024\" target=\"_blank\">Document Object Model Core level 3: Interface Attr</a></li> <li><a class=\"external\" rel=\"external\" href=\"http://www.w3.org/TR/dom/#interface-attr\" title=\"http://www.w3.org/TR/dom/#interface-attr\" target=\"_blank\">Document Object Model 4: Interface Attr</a></li>"},"PopStateEvent":{"title":"Manipulating the browser history","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/Manipulating_the_browser_history","skipped":true,"cause":"Suspect title"},"DocumentFragment":{"title":"DocumentFragment","summary":"<p>DocumentFragment has no properties or methods of its own, but inherits from <a title=\"En/DOM/Node\" class=\"internal\" rel=\"internal\" href=\"https://developer.mozilla.org/En/DOM/Node\"><code>Node</code></a>. </p>\n<p>A <code><a class=\"external\" rel=\"external\" href=\"http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-B63ED1A3\" title=\"http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-B63ED1A3\" target=\"_blank\">DocumentFragment</a></code> is a minimal document object that has no parent. It is used as a light-weight version of document to store well-formed or potentially non-well-formed fragments of XML.</p>\n<p>See <a title=\"En/DOM/Node\" class=\"internal\" rel=\"internal\" href=\"https://developer.mozilla.org/En/DOM/Node\"><code>Node</code></a> for a listing of its properties, constants and methods.</p>\n<p>Various other methods can take a document fragment as an argument (e.g., any <code><a class=\"external\" rel=\"external\" href=\"http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-1950641247\" title=\"http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-1950641247\" target=\"_blank\">Node</a></code> interface methods such as <code><a title=\"En/DOM/Node.appendChild\" rel=\"internal\" href=\"https://developer.mozilla.org/En/DOM/Node.appendChild\">appendChild</a></code> and <code><a title=\"En/DOM/Node.insertBefore\" rel=\"internal\" href=\"https://developer.mozilla.org/En/DOM/Node.insertBefore\">insertBefore</a></code>), in which case the children of the fragment are appended or inserted, not the fragment itself.</p>","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/DocumentFragment","specification":"http://www.w3.org/TR/DOM-Level-3-Cor...ml#ID-B63ED1A3"},"SVGAltGlyphDefElement":{"title":"altGlyphDef","seeAlso":"<li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/glyph\">&lt;glyph&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/glyphRef\">&lt;glyphRef&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/altGlyphDef\">&lt;altGlyphDef&gt;</a></code>\n</li>","summary":"The <code>altGlyphDef</code> element defines a substitution representation for glyphs.","members":[],"srcUrl":"https://developer.mozilla.org/en/SVG/Element/altGlyphDef"},"SVGFontFaceSrcElement":{"title":"SVGFontFaceSrcElement","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>","srcUrl":"https://developer.mozilla.org/en/DOM/SVGFontFaceSrcElement","seeAlso":"<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/font-face-src\">&lt;font-face-src&gt;</a></code>\n SVG Element","summary":"<p>The <code>SVGFontFaceSrcElement</code> interface corresponds to the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/font-face-src\">&lt;font-face-src&gt;</a></code>\n elements.</p>\n<p>Object-oriented access to the attributes of the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/font-face-src\">&lt;font-face-src&gt;</a></code>\n element via the SVG DOM is not possible.</p>","members":[]},"SVGUseElement":{"title":"SVGUseElement","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>","srcUrl":"https://developer.mozilla.org/en/DOM/SVGUseElement","seeAlso":"<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/use\">&lt;use&gt;</a></code>\n SVG Element","summary":"The <code>SVGUseElement</code> interface provides access to the properties of <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/use\">&lt;use&gt;</a></code>\n elements, as well as methods to manipulate them.","members":[{"name":"width","help":"Corresponds to attribute \n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Attribute/width\">width</a></code> on the given <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/use\">&lt;use&gt;</a></code>\n element.","obsolete":false},{"name":"height","help":"Corresponds to attribute \n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Attribute/height\">height</a></code> on the given <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/use\">&lt;use&gt;</a></code>\n element.","obsolete":false},{"name":"instanceRoot","help":"The root of the instance tree. See description of <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/SVGElementInstance\" class=\"new\">SVGElementInstance</a></code>\n to learn more about the instance tree.","obsolete":false},{"name":"animatedInstanceRoot","help":"If the \n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Attribute/xlink%3Ahref\">xlink:href</a></code> attribute is being animated, contains the current animated root of the instance tree. If the \n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Attribute/xlink%3Ahref\">xlink:href</a></code> attribute is not currently being animated, contains the same value as <code>instanceRoot</code>. See description of <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/SVGElementInstance\" class=\"new\">SVGElementInstance</a></code>\n to learn more about the instance tree.","obsolete":false}]},"SVGPathSegCurvetoCubicSmoothRel":{"title":"SVGPathElement","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/SVGPathElement","skipped":true,"cause":"Suspect title"},"FileWriter":{"title":"FileEntrySync","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/File_API/File_System_API/FileEntrySync","skipped":true,"cause":"Suspect title"},"SVGLength":{"title":"SVGLength","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody>\n</table>\n</div>\n<div id=\"compat-mobile\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody>\n</table>\n</div>","summary":"<p>The <code>SVGLength</code> interface correspond to the <a title=\"https://developer.mozilla.org/en/SVG/Content_type#Length\" rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Content_type#Length\">&lt;length&gt;</a> basic data type.</p>\n<p>An <code>SVGLength</code> object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown.</p>","members":[{"name":"newValueSpecifiedUnits","help":"<p>Reset the value as a number with an associated unitType, thereby replacing the values for all of the attributes on the object.</p> <p><strong>Exceptions:</strong></p> <ul> <li>a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DOMException\">DOMException</a></code>\n with code <code>NOT_SUPPORTED_ERR</code> is raised if <code>unitType</code> is <code>SVG_LENGTHTYPE_UNKNOWN</code> or not a valid unit type constant (one of the other <code>SVG_LENGTHTYPE_*</code> constants defined on this interface).</li> <li>a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DOMException\">DOMException</a></code>\n with code <code>NO_MODIFICATION_ALLOWED_ERR</code> is raised when the length corresponds to a read only attribute or when the object itself is read only.</li> </ul>","obsolete":false},{"name":"convertToSpecifiedUnits","help":"Preserve the same underlying stored value, but reset the stored unit identifier to the given <code><em>unitType</em></code>. Object attributes <code>unitType</code>, <code>valueInSpecifiedUnits</code> and <code>valueAsString</code> might be modified as a result of this method. For example, if the original value were \"<em>0.5cm</em>\" and the method was invoked to convert to millimeters, then the <code>unitType</code> would be changed to <code>SVG_LENGTHTYPE_MM</code>, <code>valueInSpecifiedUnits</code> would be changed to the numeric value 5 and <code>valueAsString</code> would be changed to \"<em>5mm</em>\".","obsolete":false},{"name":"SVG_LENGTHTYPE_UNKNOWN","help":"The unit type is not one of predefined unit types. It is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type.","obsolete":false},{"name":"SVG_LENGTHTYPE_NUMBER","help":"No unit type was provided (i.e., a unitless value was specified), which indicates a value in user units.","obsolete":false},{"name":"SVG_LENGTHTYPE_PERCENTAGE","help":"A percentage value was specified.","obsolete":false},{"name":"SVG_LENGTHTYPE_EMS","help":"A value was specified using the em units defined in CSS2.","obsolete":false},{"name":"SVG_LENGTHTYPE_EXS","help":"A value was specified using the ex units defined in CSS2.","obsolete":false},{"name":"SVG_LENGTHTYPE_PX","help":"A value was specified using the px units defined in CSS2.","obsolete":false},{"name":"SVG_LENGTHTYPE_CM","help":"A value was specified using the cm units defined in CSS2.","obsolete":false},{"name":"SVG_LENGTHTYPE_MM","help":"A value was specified using the mm units defined in CSS2.","obsolete":false},{"name":"SVG_LENGTHTYPE_IN","help":"A value was specified using the in units defined in CSS2.","obsolete":false},{"name":"SVG_LENGTHTYPE_PT","help":"A value was specified using the pt units defined in CSS2.","obsolete":false},{"name":"SVG_LENGTHTYPE_PC","help":"A value was specified using the pc units defined in CSS2.","obsolete":false},{"name":"unitType","help":"The type of the value as specified by one of the SVG_LENGTHTYPE_* constants defined on this interface.","obsolete":false},{"name":"value","help":"<p>The value as a floating point value, in user units. Setting this attribute will cause <code>valueInSpecifiedUnits</code> and <code>valueAsString</code> to be updated automatically to reflect this setting.</p> <p><strong>Exceptions on setting:</strong> a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DOMException\">DOMException</a></code>\n with code <code>NO_MODIFICATION_ALLOWED_ERR</code> is raised when the length corresponds to a read only attribute or when the object itself is read only.</p>","obsolete":false},{"name":"valueInSpecifiedUnits","help":"<p>The value as a floating point value, in the units expressed by <code>unitType</code>. Setting this attribute will cause <code>value</code> and <code>valueAsString</code> to be updated automatically to reflect this setting.</p> <p><strong>Exceptions on setting:</strong> a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DOMException\">DOMException</a></code>\n with code <code>NO_MODIFICATION_ALLOWED_ERR</code> is raised when the length corresponds to a read only attribute or when the object itself is read only.</p>","obsolete":false},{"name":"valueAsString","help":"<p>The value as a string value, in the units expressed by <code>unitType</code>. Setting this attribute will cause <code>value</code>, <code>valueInSpecifiedUnits</code> and <code>unitType</code> to be updated automatically to reflect this setting.</p> <p><strong>Exceptions on setting:</strong></p> <ul> <li>a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DOMException\">DOMException</a></code>\n with code <code>SYNTAX_ERR</code> is raised if the assigned string cannot be parsed as a valid <a title=\"https://developer.mozilla.org/en/SVG/Content_type#Length\" rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Content_type#Length\">&lt;length&gt;</a>.</li> <li>a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DOMException\">DOMException</a></code>\n with code <code>NO_MODIFICATION_ALLOWED_ERR</code> is raised when the length corresponds to a read only attribute or when the object itself is read only.</li> </ul>","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/Document_Object_Model_(DOM)/SVGLength"},"HTMLMediaElement":{"title":"HTMLMediaElement","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td>3.5 (1.9.1)\n</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span>`</td> </tr> <tr> <td><code>buffered</code> property</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td>4.0 (2.0)\n</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>loop</code> property</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td>11.0 (11.0)\n</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>defaultMuted</code> property</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td>11.0 (11.0)\n</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>seekable</code> property</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td>8.0 (8.0)\n</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>buffered</code> property</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td>4.0 (2.0)\n</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>defaultMuted</code> property</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td>11.0 (11.0)\n</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>loop</code> property</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td>11.0 (11.0)\n</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>seekable</code> property</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td>8.0 (8.0)\n</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>","summary":"HTML media elements (such as <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/audio\">&lt;audio&gt;</a></code>\n and <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/video\">&lt;video&gt;</a></code>\n) expose the <code>HTMLMediaElement</code> interface which provides special properties and methods (beyond the regular <a href=\"https://developer.mozilla.org/en/DOM/element\" rel=\"internal\">element</a> object interface they also have available to them by inheritance) for manipulating the layout and presentation of media elements.","members":[{"name":"canPlayType","help":"Determines whether the specified media type can be played back.","obsolete":false},{"name":"load","help":"Begins loading the media content from the server.","obsolete":false},{"name":"pause","help":"Pauses the media playback.","obsolete":false},{"name":"play","help":"Begins playback of the media. If you have changed the <strong>src</strong> attribute of the media element since the page was loaded, you must call load() before play(), otherwise the original media plays again.","obsolete":false},{"name":"autoplay","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/video#attr-autoplay\">autoplay</a></code>\n HTML&nbsp;attribute, indicating whether to begin playing as soon as enough media is available.","obsolete":false},{"name":"buffered","help":"The ranges of the media source that the browser has buffered, if any.","obsolete":false},{"name":"controls","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/video#attr-controls\">controls</a></code>\n HTML attribute, indicating whether user interface items for controlling the resource should be displayed.","obsolete":false},{"name":"currentSrc","help":"The absolute URL of the chosen media resource (if, for example, the server selects a media file based on the resolution of the user's display), or an empty string if the <code>networkState</code> is <code>EMPTY</code>.","obsolete":false},{"name":"currentTime","help":"The current playback time, in seconds.&nbsp; Setting this value seeks the media to the new time.","obsolete":false},{"name":"defaultMuted","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/video#attr-muted\">muted</a></code>\n HTML attribute, indicating whether the media element's audio output should be muted by default. Changing the value dynamically will not unmute the audio (it only controls the default state).","obsolete":false},{"name":"defaultPlaybackRate","help":"The default playback rate for the media.&nbsp; The Ogg backend does not support this.&nbsp; 1.0 is \"normal speed,\" values lower than 1.0 make the media play slower than normal, higher values make it play faster.&nbsp; The value 0.0 is invalid and throws a <code>NOT_SUPPORTED_ERR</code>&nbsp;exception.","obsolete":false},{"name":"duration","help":"The length of the media in seconds, or zero if no media data is available.&nbsp; If the media data is available but the length is unknown, this value is <code>NaN</code>.&nbsp; If the media is streamed and has no predefined length, the value is <code>Inf</code>.","obsolete":false},{"name":"ended","help":"Indicates whether the media element has ended playback.","obsolete":false},{"name":"error","help":"The media error object for the most recent error, or null if there has not been an error.","obsolete":false},{"name":"loop","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/video#attr-loop\">loop</a></code>\n HTML&nbsp;attribute, indicating whether the media element should start over when it reaches the end.","obsolete":false},{"name":"webkitChannels","help":"The number of channels in the audio resource (e.g., 2 for stereo). ","obsolete":false},{"name":"webkitFrameBufferLength","help":"Indicates the number of samples that will be returned in the framebuffer of each <code>MozAudioAvailable</code> event. This number is a total for all channels, and by default is set to be the number of channels * 1024 (e.g., 2 channels * 1024 samples = 2048 total).","obsolete":false},{"name":"webkitFrameBufferLength","help":"The <code>mozFrameBufferLength</code> property can be set to a new value, for lower latency, or larger amounts of data, etc. The size given <em>must</em> be a number between 512 and 16384. Using any other size results in an exception being thrown. The best time to set a new length is after the <code>loadedmetadata</code> event fires, when the audio info is known, but before the audio has started or <code>MozAudioAvailable</code> events have begun firing.","obsolete":false},{"name":"webkitSampleRate","help":"The number of samples per second that will be played, for example 44100. ","obsolete":false},{"name":"muted","help":"<code>true</code> if the audio is muted, and <code>false</code> otherwise.","obsolete":false},{"name":"networkState","help":"<p>The current state of fetching the media over the network.</p> <table class=\"standard-table\"> <tbody> <tr> <td class=\"header\">Constant</td> <td class=\"header\">Value</td> <td class=\"header\">Description</td> </tr> <tr> <td><code>EMPTY</code></td> <td>0</td> <td>There is no data yet.&nbsp; The <code>readyState</code> is also <code>HAVE_NOTHING</code>.</td> </tr> <tr> <td><code>LOADING</code></td> <td>1</td> <td>The media is loading.</td> </tr> <tr> <td><code>LOADED_METADATA</code></td> <td>2</td> <td>The media's metadata has been loaded.</td> </tr> <tr> <td><code>LOADED_FIRST_FRAME</code></td> <td>3</td> <td>The media's first frame has been loaded.</td> </tr> <tr> <td><code>LOADED</code></td> <td>4</td> <td>The media has been fully loaded.</td> </tr> </tbody> </table>","obsolete":false},{"name":"EMPTY","help":"There is no data yet.&nbsp; The <code>readyState</code> is also <code>HAVE_NOTHING</code>.","obsolete":false},{"name":"LOADING","help":"The media is loading.","obsolete":false},{"name":"LOADED_METADATA","help":"The media's metadata has been loaded.","obsolete":false},{"name":"LOADED_FIRST_FRAME","help":"The media's first frame has been loaded.","obsolete":false},{"name":"LOADED","help":"The media has been fully loaded.","obsolete":false},{"name":"paused","help":"Indicates whether the media element is paused.","obsolete":false},{"name":"playbackRate","help":"The current rate at which the media is being played back. This is used to implement user controls for fast forward, slow motion, and so forth. The normal playback rate is multiplied by this value to obtain the current rate, so a value of 1.0 indicates normal speed.&nbsp; Not supported by the Ogg backend.","obsolete":false},{"name":"played","help":"The ranges of the media source that the browser has played, if any.","obsolete":false},{"name":"preload","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/video#attr-preload\">preload</a></code>\n HTML attribute, indicating what data should be preloaded at page-load time, if any.","obsolete":false},{"name":"readyState","help":"<p>The readiness state of the media:</p> <table class=\"standard-table\"> <tbody> <tr> <td class=\"header\">Constant</td> <td class=\"header\">Value</td> <td class=\"header\">Description</td> </tr> <tr> <td><code>HAVE_NOTHING</code></td> <td>0</td> <td>No information is available about the media resource.</td> </tr> <tr> <td><code>HAVE_METADATA</code></td> <td>1</td> <td>Enough of the media resource has been retrieved that the metadata attributes are initialized.&nbsp; Seeking will no longer raise an exception.</td> </tr> <tr> <td><code>HAVE_CURRENT_DATA</code></td> <td>2</td> <td>Data is available for the current playback position, but not enough to actually play more than one frame.</td> </tr> <tr> <td><code>HAVE_FUTURE_DATA</code></td> <td>3</td> <td>Data for the current playback position as well as for at least a little bit of time into the future is available (in other words, at least two frames of video, for example).</td> </tr> <tr> <td><code>HAVE_ENOUGH_DATA</code></td> <td>4</td> <td>Enough data is available—and the download rate is high enough—that the media can be played through to the end without interruption.</td> </tr> </tbody> </table>","obsolete":false},{"name":"HAVE_NOTHING","help":"No information is available about the media resource.","obsolete":false},{"name":"HAVE_METADATA","help":"Enough of the media resource has been retrieved that the metadata attributes are initialized.&nbsp; Seeking will no longer raise an exception.","obsolete":false},{"name":"HAVE_CURRENT_DATA","help":"Data is available for the current playback position, but not enough to actually play more than one frame.","obsolete":false},{"name":"HAVE_FUTURE_DATA","help":"Data for the current playback position as well as for at least a little bit of time into the future is available (in other words, at least two frames of video, for example).","obsolete":false},{"name":"HAVE_ENOUGH_DATA","help":"Enough data is available—and the download rate is high enough—that the media can be played through to the end without interruption.","obsolete":false},{"name":"seekable","help":"The time ranges that the user is able to seek to, if any.","obsolete":false},{"name":"seeking","help":"Indicates whether the media is in the process of seeking to a new position.","obsolete":false},{"name":"src","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/video#attr-src\">src</a></code>\n HTML attribute, containing the URL of a media resource to use.","obsolete":false},{"name":"startTime","help":"The earliest possible position in the media, in seconds.","obsolete":false},{"name":"volume","help":"The audio volume, from 0.0 (silent) to 1.0 (loudest).","obsolete":false},{"name":"EMPTY","help":"There is no data yet.&nbsp; The <code>readyState</code> is also <code>HAVE_NOTHING</code>.","obsolete":false},{"name":"LOADING","help":"The media is loading.","obsolete":false},{"name":"LOADED_METADATA","help":"The media's metadata has been loaded.","obsolete":false},{"name":"LOADED_FIRST_FRAME","help":"The media's first frame has been loaded.","obsolete":false},{"name":"LOADED","help":"The media has been fully loaded.","obsolete":false},{"name":"HAVE_NOTHING","help":"No information is available about the media resource.","obsolete":false},{"name":"HAVE_METADATA","help":"Enough of the media resource has been retrieved that the metadata attributes are initialized.&nbsp; Seeking will no longer raise an exception.","obsolete":false},{"name":"HAVE_CURRENT_DATA","help":"Data is available for the current playback position, but not enough to actually play more than one frame.","obsolete":false},{"name":"HAVE_FUTURE_DATA","help":"Data for the current playback position as well as for at least a little bit of time into the future is available (in other words, at least two frames of video, for example).","obsolete":false},{"name":"HAVE_ENOUGH_DATA","help":"Enough data is available—and the download rate is high enough—that the media can be played through to the end without interruption.","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/DOM/HTMLMediaElement"},"SVGPathSegLinetoHorizontalAbs":{"title":"SVGPathElement","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/SVGPathElement","skipped":true,"cause":"Suspect title"},"SVGDocument":{"title":"Scripting","members":[],"srcUrl":"https://developer.mozilla.org/en/SVG/Scripting","skipped":true,"cause":"Suspect title"},"XPathException":{"title":"Interface documentation status","members":[],"srcUrl":"https://developer.mozilla.org/User:trevorh/Interface_documentation_status","skipped":true,"cause":"Suspect title"},"SVGMissingGlyphElement":{"title":"SVGMissingGlyphElement","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>","srcUrl":"https://developer.mozilla.org/en/DOM/SVGMissingGlyphElement","seeAlso":"<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/missing-glyph\">&lt;missing-glyph&gt;</a></code>\n SVG Element","summary":"<p>The <code>SVGMissingGlyphElement</code> interface corresponds to the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/missing-glyph\">&lt;missing-glyph&gt;</a></code>\n elements.</p>\n<p>Object-oriented access to the attributes of the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/missing-glyph\">&lt;missing-glyph&gt;</a></code>\n element via the SVG DOM is not possible.</p>","members":[]},"CSSCharsetRule":{"title":"cssRule","members":[],"srcUrl":"https://developer.mozilla.org/pl/DOM/cssRule","skipped":true,"cause":"Suspect title"},"WebGLRenderingContext":{"title":"HTMLCanvasElement","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/HTMLCanvasElement","skipped":true,"cause":"Suspect title"},"SVGAnimateColorElement":{"title":"SVGAnimateColorElement","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> </tbody>\n</table>\n</div>\n<div id=\"compat-mobile\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> </tbody>\n</table>\n</div>","summary":"The <code>SVGAnimateColorElement</code> interface corresponds to the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/animateColor\">&lt;animateColor&gt;</a></code>\n element.","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/SVGAnimateColorElement"},"HTMLMarqueeElement":{"title":"marquee","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari</th> </tr> <tr> <td>Basic support</td> <td>1.0</td> <td>1.0 (1.7 or earlier)\n</td> <td>2.0</td> <td>7.2</td> <td>1.2</td> </tr> <tr> <td><code>truespeed</code> attribute</td> <td><span title=\"Not supported.\">--</span></td> <td>3.0 (1.9)\n</td> <td>4.0</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> </tr> <tr> <td><code>hspace/vspace</code> attribute</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td>3.0 (1.9)\n</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>loop</code> attribute</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td>3.0 (1.9)\n</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody>\n</table>\n</div>\n<div id=\"compat-mobile\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td>1.0 (1.0)\n</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>truespeed</code> attribute</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td>1.0 (1.0)\n</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>hspace/vspace</code> attribute</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td>1.0 (1.0)\n</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> <tr> <td><code>loop</code> attribute</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td>1.0 (1.0)\n</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody>\n</table>\n</div>","examples":["  &lt;marquee&gt;This text will scroll from right to left&lt;/marquee&gt;\n\n  &lt;marquee direction=\"up\"&gt;This text will scroll from bottom to top&lt;/marquee&gt;\n\n  &lt;marquee direction=\"down\" width=\"250\" height=\"200\" behavior=\"alternate\" style=\"border:solid\"&gt;\n    &lt;marquee behavior=\"alternate\"&gt;\n      This text will bounce\n    &lt;/marquee&gt;\n  &lt;/marquee&gt;\n"],"srcUrl":"https://developer.mozilla.org/en/HTML/Element/marquee","summary":"Non-standard","members":[{"name":"stop","help":"Stops scrolling of the marquee.","obsolete":false},{"name":"start","help":"Starts scrolling of the marquee.","obsolete":false},{"obsolete":false,"url":"","name":"truespeed","help":"By default,<code> scrolldelay </code>values lower than 60 are ignored. If<code> truespeed </code>is present, those values are not ignored."},{"obsolete":false,"url":"","name":"vspace","help":"Sets the vertical margin in pixels or percentage value."},{"obsolete":false,"url":"","name":"bgcolor","help":"Sets the background color through color name or hexadecimal value."},{"obsolete":false,"url":"","name":"scrollamount","help":"Sets the amount of scrolling at each interval in pixels. The default value is 6."},{"obsolete":false,"url":"","name":"height","help":"Sets the height in pixels or percentage value."},{"obsolete":false,"url":"","name":"loop","help":"Sets the number of times the marquee will scroll. If no value is specified, the default value is −1, which means the marquee will scroll continuously."},{"obsolete":false,"url":"","name":"width","help":"Sets the width in pixels or percentage value."},{"obsolete":false,"url":"","name":"direction","help":"Sets the direction of the scrolling within the marquee. Possible values are <code>left</code>, <code>right</code>, <code>up</code> and <code>down</code>. If no value is specified, the default value is <code>left</code>."},{"obsolete":false,"url":"","name":"behavior","help":"Sets how the text is scrolled within the marquee. Possible values are <code>scroll</code>, <code>slide</code> and <code>alternate</code>. If no value is specified, the default value is <code>scroll</code>."},{"obsolete":false,"url":"","name":"hspace","help":"Sets the horizontal margin"},{"obsolete":false,"url":"","name":"scrolldelay","help":"Sets the interval between each scroll movement in milliseconds. The default value is 85. Note that any value smaller than 60 is ignored and the value 60 is used instead, unless<code> truespeed </code>is specified."}]},"FileList":{"title":"FileList","examples":["<p>This example iterates over all the files selected by the user using an <code>input</code> element:</p>\n<pre class=\"eval\">// fileInput is an HTML&nbsp;input element: &lt;input type=\"file\" id=\"myfileinput\" multiple&gt;\nvar fileInput = document.getElementById(\"myfileinput\");\n\n// files is a FileList object (similar to NodeList)\nvar files = fileInput.files;\nvar file;\n\n// loop trough files\nfor (var i = 0; i &lt; files.length; i++) {\n\n    // get item\n    file = files.item(i);\n    //or\n    file = files[i];\n\n    alert(file.name);\n}</pre>"],"srcUrl":"https://developer.mozilla.org/en/DOM/FileList","specification":"<a title=\"http://www.whatwg.org/specs/web-apps/current-work/multipage/number-state.html#concept-input-type-file-selected\" class=\" external\" rel=\"external\" href=\"http://www.whatwg.org/specs/web-apps/current-work/multipage/number-state.html#concept-input-type-file-selected\" target=\"_blank\">File upload state</a> (HTML&nbsp;5 working draft)","summary":"<p>An object of this type is returned by the <code>files</code> property of the HTML&nbsp;input element; this lets you access the list of files selected with the <code>&lt;input type=\"file\"&gt;</code> element. It's also used for a list of files dropped into web content when using the drag and drop API; see the <a title=\"En/DragDrop/DataTransfer\" rel=\"internal\" href=\"https://developer.mozilla.org/En/DragDrop/DataTransfer\"><code>DataTransfer</code></a> object for details on this usage.</p>\n<p>\n\n</p><div><p>Gecko 1.9.2 note</p><p>Prior to Gecko 1.9.2, the input element only supported a single file being selected at a time, meaning that the FileList would contain only one file. Starting with Gecko 1.9.2, if the input element's multiple attribute is true, the FileList may contain multiple files.</p></div>","members":[{"name":"item","help":"<p>Returns a <a title=\"en/DOM/File\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/File\"><code>File</code></a> object representing the file at the specified index in the file list.</p>\n\n<div id=\"section_6\"><span id=\"Parameters\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>index</code></dt> <dd>The zero-based index of the file to retrieve from the list.</dd>\n</dl>\n</div><div id=\"section_7\"><span id=\"Return_value\"></span><h6 class=\"editable\">Return value</h6>\n<p>The <a title=\"en/DOM/File\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/File\"><code>File</code></a> representing the requested file.</p>\n</div>","idl":"<pre class=\"eval\"> File item(\n   index\n );\n</pre>","obsolete":false},{"name":"length","help":"A read-only value indicating the number of files in the list.","obsolete":false},{"name":"length","help":"A read-only value indicating the number of files in the list.","obsolete":false}]},"SVGVKernElement":{"title":"SVGVKernElement","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>","srcUrl":"https://developer.mozilla.org/en/DOM/SVGVKernElement","seeAlso":"<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/vkern\">&lt;vkern&gt;</a></code>\n SVG Element","summary":"<p>The <code>SVGVKernElement</code> interface corresponds to the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/vkern\">&lt;vkern&gt;</a></code>\n elements.</p>\n<p>Object-oriented access to the attributes of the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/vkern\">&lt;vkern&gt;</a></code>\n element via the SVG DOM is not possible.</p>","members":[]},"CSSValueList":{"title":"Interface documentation status","members":[],"srcUrl":"https://developer.mozilla.org/User:trevorh/Interface_documentation_status","skipped":true,"cause":"Suspect title"},"SVGAnimateTransformElement":{"title":"SVGAnimateTransformElement","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> </tbody>\n</table>\n</div>\n<div id=\"compat-mobile\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> </tbody>\n</table>\n</div>","summary":"The <code>SVGAnimateTransformElement</code> interface corresponds to the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/animateTransform\">&lt;animateTransform&gt;</a></code>\n element.","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/SVGAnimateTransformElement"},"Float32Array":{"title":"Float32Array","srcUrl":"https://developer.mozilla.org/en/JavaScript_typed_arrays/Float32Array","seeAlso":"<li><a class=\"link-https\" title=\"https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/doc/spec/TypedArray-spec.html\" rel=\"external\" href=\"https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/doc/spec/TypedArray-spec.html\" target=\"_blank\">Typed Array Specification</a></li> <li><a title=\"en/JavaScript typed arrays\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays\">JavaScript typed arrays</a></li>","summary":"<p>The <code>Float32Array</code> type represents an array of 32-bit floating point numbers (corresponding to the C <code>float</code> data type).</p>\n<p>Once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).</p>","constructor":"<div class=\"note\"><strong>Note:</strong> In these methods, <code><em>TypedArray</em></code> represents any of the <a title=\"en/JavaScript typed arrays/ArrayBufferView#Typed array subclasses\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/ArrayBufferView#Typed_array_subclasses\">typed array object types</a>.</div>\n<table class=\"standard-table\"> <tbody> <tr> <td><code>Float32Array <a title=\"en/JavaScript typed arrays/Float32Array#Float32Array()\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/Float32Array#Float32Array()\">Float32Array</a>(unsigned long length);<br> </code></td> </tr> <tr> <td><code>Float32Array </code><code><a title=\"en/JavaScript typed arrays/Float32Array#Float32Array()\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/Float32Array#Float32Array%28%29\">Float32Array</a></code><code>(<em>TypedArray</em> array);<br> </code></td> </tr> <tr> <td><code>Float32Array </code><code><a title=\"en/JavaScript typed arrays/Float32Array#Float32Array()\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/Float32Array#Float32Array%28%29\">Float32Array</a></code><code>(sequence&lt;type&gt; array);<br> </code></td> </tr> <tr> <td><code>Float32Array </code><code><a title=\"en/JavaScript typed arrays/Float32Array#Float32Array()\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/Float32Array#Float32Array%28%29\">Float32Array</a></code><code>(ArrayBuffer buffer, optional unsigned long byteOffset, optional unsigned long length);<br> </code></td> </tr> </tbody>\n</table><p>Returns a new <code>Float32Array</code> object.</p>\n<pre>Float32Array Float32Array(\n&nbsp; unsigned long length\n);\n\nFloat32Array Float32Array(\n&nbsp; <em>TypedArray</em> array\n);\n\nFloat32Array Float32Array(\n&nbsp; sequence&lt;type&gt; array\n);\n\nFloat32Array Float32Array(\n&nbsp; ArrayBuffer buffer,\n&nbsp; optional unsigned long byteOffset,\n&nbsp; optional unsigned long length\n);\n</pre>\n<div id=\"section_7\"><span id=\"Parameters\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>length</code></dt> <dd>The number of elements in the byte array. If unspecified, length of the array view will match the buffer's length.</dd> <dt><code>array</code></dt> <dd>An object of any of the typed array types (such as <span>Uint8</span><code>Array</code>), or a sequence of objects of a particular type, to copy into a new <a title=\"en/JavaScript typed arrays/ArrayBuffer\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/ArrayBuffer\"><code>ArrayBuffer</code></a>. Each value in the source array is converted to a 32-bit floating point number before being copied into the new array.</dd> <dt><code>buffer</code></dt> <dd>An existing <a title=\"en/JavaScript typed arrays/ArrayBuffer\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/ArrayBuffer\"><code>ArrayBuffer</code></a> to use as the storage for the new <code>Float32Array</code> object.</dd> <dt><code>byteOffset<br> </code></dt> <dd>The offset, in bytes, to the first byte in the specified buffer for the new view to reference. If not specified, the <code>Float32Array</code>'s view of the buffer will start with the first byte.</dd>\n</dl>\n</div><div id=\"section_8\"><span id=\"Return_value\"></span><h6 class=\"editable\">Return value</h6>\n<p>A new <code>Float32Array</code> object representing the specified data buffer.</p>\n</div>","members":[{"name":"subarray","help":"<p>Returns a new <code>Float32Array</code> view on the <a title=\"en/JavaScript typed arrays/ArrayBuffer\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/ArrayBuffer\"><code>ArrayBuffer</code></a> store for this <code>Float32Array</code> object.</p>\n\n<div id=\"section_15\"><span id=\"Parameters_3\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>begin</code></dt> <dd>The offset to the first element in the array to be referenced by the new <code>Float32Array</code> object.</dd> <dt><code>end</code> \n<span title=\"\">Optional</span>\n</dt> <dd>The offset to the last element in the array to be referenced by the new <code>Float32Array</code> object; if not specified, all elements from the one specified by <code>begin</code> to the end of the array are included in the new view.</dd>\n</dl>\n</div><div id=\"section_16\"><span id=\"Notes_2\"></span><h6 class=\"editable\">Notes</h6>\n<p>The range specified by <code>begin</code> and <code>end</code> is clamped to the valid index range for the current array; if the computed length of the new array would be negative, it's clamped to zero. If either <code>begin</code> or <code>end</code> is negative, it refers to an index from the end of the array instead of from the beginning.</p>\n<div class=\"note\"><strong>Note:</strong> Keep in mind that this is creating a new view on the existing buffer; changes to the new object's contents will impact the original object and vice versa.</div>\n</div>","idl":"<pre>Float32Array subarray(\n&nbsp; long begin,\n&nbsp; optional long end\n);\n</pre>","obsolete":false},{"name":"set","help":"<p>Sets multiple values in the typed array, reading input values from a specified array.</p>\n\n<div id=\"section_13\"><span id=\"Parameters_2\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>array</code></dt> <dd>An array from which to copy values. All values from the source array are copied into the target array, unless the length of the source array plus the offset exceeds the length of the target array, in which case an exception is thrown. If the source array is a typed array, the two arrays may share the same underlying <code><a title=\"en/JavaScript typed arrays/ArrayBuffer\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/ArrayBuffer\">ArrayBuffer</a></code>; the browser will intelligently copy the source range of the buffer to the destination range.</dd> <dt>offset \n<span title=\"\">Optional</span>\n</dt> <dd>The offset into the target array at which to begin writing values from the source <code>array</code>. If you omit this value, 0 is assumed (that is, the source <code>array</code> will overwrite values in the target array starting at index 0).</dd>\n</dl>\n</div>","idl":"<pre>void set(\n&nbsp; <em>TypedArray</em> array,\n&nbsp; optional unsigned long offset\n);\n\nvoid set(\n&nbsp; type[] array,\n&nbsp; optional unsigned long offset\n);\n</pre>","obsolete":false},{"name":"BYTES_PER_ELEMENT","help":"The size, in bytes, of each array element.","obsolete":false},{"name":"length","help":"The number of entries in the array. <strong>Read only.</strong>","obsolete":false}]},"ArrayBufferView":{"title":"ArrayBufferView","seeAlso":"<li><a title=\"en/JavaScript typed arrays/DataView\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/DataView\"><code>DataView</code></a></li> <li><a class=\"link-https\" title=\"https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/doc/spec/TypedArray-spec.html\" rel=\"external\" href=\"https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/doc/spec/TypedArray-spec.html\" target=\"_blank\">Typed Array Specification</a></li> <li><a title=\"en/JavaScript typed arrays\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays\">JavaScript typed arrays</a></li>","summary":"<p>The <code>ArrayBufferView</code> type describes a particular view on the contents of an <a title=\"en/JavaScript typed arrays/ArrayBuffer\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/ArrayBuffer\"><code>ArrayBuffer</code></a>'s data.</p>\n<p>Of note is that you may create multiple views into the same buffer, each looking at the buffer's contents starting at a particular offset. This makes it possible to set up views of different data types to read the contents of a buffer based on the types of data at specific offsets into the buffer.</p>\n<div class=\"note\"><strong>Note:</strong> Typically, you'll instantiate one of the <a title=\"en/JavaScript typed arrays/ArrayBufferView#Typed array subclasses\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/ArrayBufferView#Typed_array_subclasses\">subclasses</a> of this object instead of this base class. Those provide access to the data formatted using specific data types.</div>","members":[{"name":"buffer","help":"The buffer this view references. <strong>Read only.</strong>","obsolete":false},{"name":"byteLength","help":"The length, in bytes, of the view. <strong>Read only.</strong>","obsolete":false},{"name":"byteOffset","help":"The offset, in bytes, to the first byte of the view within the <a title=\"en/JavaScript typed arrays/ArrayBuffer\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/ArrayBuffer\"><code>ArrayBuffer</code></a>.","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/JavaScript_typed_arrays/ArrayBufferView"},"HTMLTableColElement":{"title":"HTMLTableColElement","seeAlso":"<li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/col\">&lt;col&gt;</a></code>\n HTML&nbsp;element</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/colgroup\">&lt;colgroup&gt;</a></code>\n&nbsp;HTML element</li>","summary":"DOM table column objects (which may correspond to <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/col\">&lt;col&gt;</a></code>\n&nbsp;or <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/colgroup\">&lt;colgroup&gt;</a></code>\n HTML elements) expose the <a target=\"_blank\" href=\"http://www.w3.org/TR/html5/tabular-data.html#htmltablecolelement\" rel=\"external nofollow\" class=\" external\" title=\"http://www.w3.org/TR/html5/tabular-data.html#htmltablecolelement\">HTMLTableColElement</a> (or <span><a href=\"https://developer.mozilla.org/en/HTML\" rel=\"custom nofollow\">HTML 4</a></span> <a target=\"_blank\" title=\"http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-84150186\" href=\"http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-84150186\" rel=\"external nofollow\" class=\" external\"><code>HTMLTableColElement</code></a>) interface, which provides special properties (beyond the regular <a href=\"https://developer.mozilla.org/en/DOM/element\" rel=\"internal\">element</a> object interface they also have available to them by inheritance) for manipulating table column elements.","members":[{"name":"align","help":"Indicates the horizontal alignment of the cell data in the column.","obsolete":true},{"name":"ch","help":"Alignment character for cell data.","obsolete":true},{"name":"chOff","help":"Offset for the alignment character.","obsolete":true},{"name":"span","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/col#attr-span\">span</a></code>\n HTML&nbsp;attribute, indicating the number of columns to apply this object's attributes to. Must be a positive integer.","obsolete":false},{"name":"vAlign","help":"Indicates the vertical alignment of the cell data in the column.","obsolete":true},{"name":"width","help":"Default column width.","obsolete":true}],"srcUrl":"https://developer.mozilla.org/en/DOM/HTMLTableColElement"},"SVGCursorElement":{"title":"SVGCursorElement","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>","srcUrl":"https://developer.mozilla.org/en/DOM/SVGCursorElement","seeAlso":"<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/cursor\">&lt;cursor&gt;</a></code>\n SVG Element","summary":"The <code>SVGCursorElement</code> interface provides access to the properties of <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/cursor\">&lt;cursor&gt;</a></code>\n elements, as well as methods to manipulate them.","members":[]},"XPathNSResolver":{"title":"document.createNSResolver","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/document.createNSResolver","skipped":true,"cause":"Suspect title"},"SVGTransformable":{"title":"SVGTransformable","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody>\n</table>\n</div>\n<div id=\"compat-mobile\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody>\n</table>\n</div>","summary":"Interface <code>SVGTransformable</code> contains properties and methods that apply to all elements which have attribute \n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Attribute/transform\">transform</a></code>.","members":[{"name":"transform","help":"Corresponds to attribute \n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Attribute/transform\">transform</a></code> on the given element.","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/Document_Object_Model_(DOM)/SVGTransformable"},"IDBDatabase":{"title":"IDBDatabase","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td>12\n<span title=\"prefix\">webkit</span></td> <td>4.0 (2.0)\n</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> </tr> <tr> <td><code>setVersion</code></td> <td>12\n<span title=\"prefix\">webkit</span></td> <td>From 4.0 (2.0)\n to 9.0 (9.0)\n</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> </tr> <tr> <td>2-parameter <code>open</code></td> <td><span title=\"Not supported.\">--</span></td> <td>10.0 (10.0)\n</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE&nbsp;Phone</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Not supported.\">--</span></td> <td>6.0 (6.0)\n</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> </tr> </tbody> </table>\n</div>","examples":["<h4 class=\"editable\">Example</h4>\n<p>In the following code snippet, we open a database asynchronously and make a request.&nbsp;&nbsp;Because the specification is still evolving, Chrome and Firefox put prefixes in the methods.&nbsp;Chrome uses the <code>webkit</code>&nbsp;prefix while Firefox uses the <code>moz</code>&nbsp;prefix.&nbsp;Event handlers are registered for responding to various situations.</p>\n\n          <pre name=\"code\" class=\"js\">// Taking care of the browser-specific prefixes.\nif ('webkitIndexedDB' in window) {\n   window.indexedDB = window.webkitIndexedDB;\n   window.IDBTransaction = window.webkitIDBTransaction;\n} else if ('mozIndexedDB' in window) {\n   window.indexedDB = window.mozIndexedDB;\n}\n\n//Open a connection to the database with the name \"creatures\" \n//with the empty string as its version.  \n\nvar creatures = {};\ncreatures.indexedDB = {};\n\ncreatures.indexedDB.open = function() {\n  var request = indexedDB.open(\"creatures\");\n\n  //The open request isn't executed yet, but an IDBRequest object is returned. \n  //Create listeners to the IDBRequest. \n  \n  //If the version of the db changes, the onupgradeneeded callback is executed.\n  request.onupgradeneeded = function(event) {\n    // event.target.trans is a CHANGE_VERSION transaction\n    \n    // create an object store called \"swamp\"\n    // and define an optional parameter object, the \"terrorizedPopulace\" keyPath.        \n    // The keyPath must be what makes an object unique and every object must have it.  \n    // If every creature had a unique identification number, that would also be a good keyPath. \n        \n    var datastore = db.createObjectStore(\"swamp\",\n       {keyPath: \"terrorizedPopulace\"});\n  }\n  \n  //If the open request is successful, the onsuccess callback is executed. \n  request.onsuccess = function(event) {\n    creatures.indexedDB.db = event.target.result;     \n    creatures.indexedDB.getAllSwampCreatures();\n  };\n\n  request.onerror = creatures.indexedDB.onerror;\n}</pre>","<h4 class=\"editable\">Example</h4>\n<p>In the following code snippet, we open a database asynchronously and make a request.&nbsp;&nbsp;Because the specification is still evolving, Chrome and Firefox put prefixes in the methods.&nbsp;Chrome uses the <code>webkit</code>&nbsp;prefix while Firefox uses the <code>moz</code>&nbsp;prefix.&nbsp;Event handlers are registered for responding to various situations.</p>\n\n          <pre name=\"code\" class=\"js\">// Taking care of the browser-specific prefixes.\nif ('webkitIndexedDB' in window) {\n   window.indexedDB = window.webkitIndexedDB;\n   window.IDBTransaction = window.webkitIDBTransaction;\n} else if ('mozIndexedDB' in window) {\n   window.indexedDB = window.mozIndexedDB;\n}\n\n//Open a connection to the database with the name \"creatures\" \n//with the empty string as its version.  \n\nvar creatures = {};\ncreatures.indexedDB = {};\n\ncreatures.indexedDB.open = function() {\n  var request = indexedDB.open(\"creatures\");\n\n  //The open request isn't executed yet, but an IDBRequest object is returned. \n  //Create listeners to the IDBRequest. \n  \n  //If the version of the db changes, the onupgradeneeded callback is executed.\n  request.onupgradeneeded = function(event) {\n    // event.target.trans is a CHANGE_VERSION transaction\n    \n    // create an object store called \"swamp\"\n    // and define an optional parameter object, the \"terrorizedPopulace\" keyPath.        \n    // The keyPath must be what makes an object unique and every object must have it.  \n    // If every creature had a unique identification number, that would also be a good keyPath. \n        \n    var datastore = db.createObjectStore(\"swamp\",\n       {keyPath: \"terrorizedPopulace\"});\n  }\n  \n  //If the open request is successful, the onsuccess callback is executed. \n  request.onsuccess = function(event) {\n    creatures.indexedDB.db = event.target.result;     \n    creatures.indexedDB.getAllSwampCreatures();\n  };\n\n  request.onerror = creatures.indexedDB.onerror;\n}</pre>","<h4 class=\"editable\">Example</h4>\n<p>The following is an example of how to open a read-write transaction.</p>\n\n          <pre name=\"code\" class=\"js\">//Open a transaction with a scope of data stores and a read-write mode.\nvar trans = db.transaction(['list-of-store-names'], IDBTransaction.READ_WRITE);\n\n//\"objectStore()\" is an IDBTransaction method that returns an object store \n//that has already been added to the scope of the transaction.  \nvar store = trans.objectStore('your-store-name');\nvar req = store.put(value, key); \nreq.onsuccess = ...; \nreq.onerror = ...;</pre>","<h4 class=\"editable\">Example</h4>\n<p>The following is an example of how to open a read-write transaction.</p>\n\n          <pre name=\"code\" class=\"js\">//Open a transaction with a scope of data stores and a read-write mode.\nvar trans = db.transaction(['list-of-store-names'], IDBTransaction.READ_WRITE);\n\n//\"objectStore()\" is an IDBTransaction method that returns an object store \n//that has already been added to the scope of the transaction.  \nvar store = trans.objectStore('your-store-name');\nvar req = store.put(value, key); \nreq.onsuccess = ...; \nreq.onerror = ...;</pre>"],"srcUrl":"https://developer.mozilla.org/en/IndexedDB/IDBDatabase","summary":"<p>The <code>IDBDatabase</code> interface of the IndexedDB&nbsp;API provides asynchronous access to a <a title=\"en/IndexedDB#database connection\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB#database_connection\">connection to a database</a>. Use it to create, manipulate, and delete objects in that database. The interface also provides the only way to get a <a title=\"en/IndexedDB#gloss transaction\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB#gloss_transaction\">transaction</a>&nbsp;and manage versions on that database.</p>\n<p>Inherits from: <a title=\"en/DOM/EventTarget\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/EventTarget\">EventTarget</a></p>","members":[{"name":"keyPath","help":"The <a title=\"en/IndexedDB#gloss key path\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB#gloss_key_path\">key path</a> to be used by the new object store. If empty or not specified, the object store is created without a key path and uses <a title=\"en/IndexedDB#gloss out-of-line key\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB#gloss_out-of-line_key\">out-of-line keys</a>.","obsolete":false},{"name":"autoIncrement","help":"If true, the object store has a <a title=\"en/IndexedDB#gloss key generator\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB#gloss_key_generator\">key generator</a>. Defaults to <code>false</code>.","obsolete":false},{"url":"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#NOT_ALLOWED_ERR","name":"NOT_ALLOWED_ERR","help":"The method was not called from a <code><a title=\"en/IndexedDB/IDBTransaction#VERSION CHANGE\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBTransaction#VERSION_CHANGE\">VERSION_CHANGE</a></code> transaction callback. You must call <code>setVersion()</code> first.","obsolete":false},{"url":"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#CONSTRAINT_ERR","name":"CONSTRAINT_ERR","help":"An object store with the given name (based on case-sensitive comparison) already exists in the connected database.","obsolete":false},{"url":"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#NON_TRANSIENT_ERR","name":"NON_TRANSIENT_ERR","help":"<code>optionalParameters</code> has attributes other than <code>keyPath</code> and <code>autoIncrement</code>.","obsolete":false},{"url":"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#NOT_ALLOWED_ERR","name":"NOT_ALLOWED_ERR","help":"The method was not called from a <code><a title=\"en/IndexedDB/IDBTransaction#VERSION CHANGE\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBTransaction#VERSION_CHANGE\">VERSION_CHANGE</a></code> transaction callback. You must call <code>setVersion()</code> first.","obsolete":false},{"url":"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#NOT_FOUND_ERR","name":"NOT_FOUND_ERR","help":"You are trying to delete an object store that does not exist. Names are case sensitive.","obsolete":false},{"url":"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#NOT_ALLOWED_ERR","name":"NOT_ALLOWED_ERR","help":"The error is thrown for one of two reasons: <ul> <li>The <code>close()</code> method has been called on this IDBDatabase instance.</li> <li>The object store has been deleted or removed.</li> </ul>","obsolete":false},{"url":"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#NOT_FOUND_ERR","name":"NOT_FOUND_ERR","help":"One of the object stores doesn't exist in the connected database.","obsolete":false},{"name":"deleteObjectStore","help":"<p>Destroys the object store with the given name in the connected database, along with any indexes that reference it.&nbsp;</p>\n<p>As with <code>createObjectStore()</code>, this method can be called <em>only</em> within a <code><a title=\"en/IndexedDB/IDBTransaction#VERSION CHANGE\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBTransaction#VERSION_CHANGE\">VERSION_CHANGE</a></code> transaction. So you must call the <code>setVersion()</code> method first before you can remove any object store or index.</p>\n\n<div id=\"section_15\"><span id=\"Parameters_2\"></span><h5 class=\"editable\">Parameters</h5>\n<dl> <dt>name</dt> <dd>The name of the data store to delete.</dd>\n</dl>\n</div><div id=\"section_16\"><span id=\"Returns_2\"></span><h5 class=\"editable\">Returns</h5>\n<p><code>void</code></p>\n</div><div id=\"section_17\"><span id=\"Exceptions_2\"></span><h5 class=\"editable\">Exceptions</h5>\n<p>This method can raise an <a title=\"en/IndexedDB/IDBDatabaseException\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException\">IDBDatabaseException</a> with the following codes:</p>\n<table class=\"standard-table\"> <thead> <tr> <th scope=\"col\" width=\"131\">Exception</th> <th scope=\"col\" width=\"698\">Description</th> </tr> </thead> <tbody> <tr> <td><code><a title=\"en/IndexedDB/DatabaseException#NOT ALLOWED ERR\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#NOT_ALLOWED_ERR\">NOT_ALLOWED_ERR</a></code></td> <td>The method was not called from a <code><a title=\"en/IndexedDB/IDBTransaction#VERSION CHANGE\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBTransaction#VERSION_CHANGE\">VERSION_CHANGE</a></code> transaction callback. You must call <code>setVersion()</code> first.</td> </tr> <tr> <td><code><a title=\"en/IndexedDB/IDBDatabaseException#NOT FOUND ERR\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#NOT_FOUND_ERR\">NOT_FOUND_ERR</a></code></td> <td>You are trying to delete an object store that does not exist. Names are case sensitive.</td> </tr> </tbody>\n</table>\n</div>","idl":"<pre>IDBRequest deleteObjectStore(\n&nbsp; in DOMString <em>name</em>\n) raises (IDBDatabaseException);\n</pre>","obsolete":false},{"name":"transaction","help":"<p>Immediately returns an <a title=\"en/IndexedDB/IDBTransaction\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBTransaction\">IDBTransaction</a> object, and starts a transaction in a separate thread. &nbsp;The method returns a transaction object (<a title=\"en/IndexedDB/IDBTransaction\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBTransaction\"><code>IDBTransaction</code></a>) containing the <a title=\"en/IndexedDB/IDBTransaction#objectStore()\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBTransaction#objectStore()\">objectStore()</a> method, which you can use to access your object store.&nbsp;</p>\n\n<div id=\"section_22\"><span id=\"Parameters_4\"></span><h5 class=\"editable\">Parameters</h5>\n<dl> <dt>storeNames</dt> <dd>The names of object stores and indexes that are in the scope of the new transaction. Specify only the object stores that you need to access.</dd> <dt>mode</dt> <dd><em>Optional</em>. The types of access that can be performed in the transaction. Transactions are opened in one of three modes: <code>READ_ONLY</code>, <code>READ_WRITE</code>, and <code>VERSION_CHANGE</code>. If you don't provide the parameter, the default access mode is <code>READ_ONLY</code>. To avoid slowing things down, don't open a <code>READ_WRITE</code> transaction, unless you actually need to write into the database.</dd>\n</dl>\n</div><div id=\"section_23\"><span id=\"Sample_code\"></span><h5 class=\"editable\">Sample code</h5>\n<p>To start a transaction with the following scope, you can use the code snippets in the table. As noted earlier:</p>\n<ul> <li>Add prefixes to the methods in WebKit browsers, (that is, instead of <code>IDBTransaction.READ_ONLY</code>, use <code>webkitIDBTransaction.READ_ONLY</code>).</li> <li>The default mode is <code>READ_ONLY</code>, so you don't really have to specify it. Of course, if you need to write into the object store, you can open the transaction in the <code>READ_WRITE</code> mode.</li>\n</ul>\n<table class=\"standard-table\"> <thead> <tr> <th scope=\"col\" width=\"185\">Scope</th> <th scope=\"col\" width=\"1018\">Code</th> </tr> <tr> <td>Single object store</td> <td> <p><code>var transaction = db.transaction(['my-store-name'], IDBTransaction.READ_ONLY); </code></p> <p>Alternatively:</p> <p><code>var transaction = db.transaction('my-store-name', IDBTransaction.READ_ONLY);</code></p> </td> </tr> <tr> <td>Multiple object stores</td> <td><code>var transaction = db.transaction(['my-store-name', 'my-store-name2'], IDBTransaction.READ_ONLY);</code></td> </tr> <tr> <td>All object stores</td> <td> <p><code>var transaction = db.transaction(db.objectStoreNames, IDBTransaction.READ_ONLY);</code></p> <p>You cannot pass an empty array into the storeNames parameter, such as in the following: <code>var transaction = db.transaction([], IDBTransaction.READ_ONLY);.</code></p> <div class=\"warning\"><strong>Warning:</strong>&nbsp; Accessing all obejct stores under the <code>READ_WRITE</code> mode means that you can run only that transaction. You cannot have writing transactions with overlapping scopes.</div> </td> </tr> </thead> <tbody> </tbody>\n</table>\n</div><div id=\"section_24\"><span id=\"Returns_4\"></span><h5 class=\"editable\">Returns</h5>\n<dl> <dt><code><a title=\"en/IndexedDB/IDBTransaction\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBVersionChangeRequest\">IDBTransaction</a></code></dt> <dd>The transaction object.</dd>\n</dl>\n</div><div id=\"section_25\"><span id=\"Exceptions_3\"></span><h5 class=\"editable\">Exceptions</h5>\n<p>This method can raise an <a title=\"en/IndexedDB/IDBDatabaseException\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException\">IDBDatabaseException</a> with the following codes:</p>\n<table class=\"standard-table\"> <thead> <tr> <th scope=\"col\" width=\"131\">Exception</th> <th scope=\"col\" width=\"698\">Description</th> </tr> </thead> <tbody> <tr> <td><code><a title=\"en/IndexedDB/DatabaseException#NOT ALLOWED ERR\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#NOT_ALLOWED_ERR\">NOT_ALLOWED_ERR</a></code></td> <td>The error is thrown for one of two reasons: <ul> <li>The <code>close()</code> method has been called on this IDBDatabase instance.</li> <li>The object store has been deleted or removed.</li> </ul> </td> </tr> <tr> <td><code><a title=\"en/IndexedDB/IDBDatabaseException#NOT FOUND ERR\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#NOT_FOUND_ERR\">NOT_FOUND_ERR</a></code></td> <td>One of the object stores doesn't exist in the connected database.</td> </tr> </tbody>\n</table>\n</div>","idl":"<pre>IDBTransaction transaction(\n&nbsp; in optional any <em>storeNames</em>,\n&nbsp; in optional unsigned short <em>mode</em>&nbsp; \n) raises (IDBDatabaseException);</pre>","obsolete":false},{"name":"setVersion","help":"<div class=\"warning\"><strong>Warning:</strong> The latest draft of the specification dropped this method. Some not up-to-date browsers still implement this method. The new way is to define the version in the <code>IDBDatabase.open()</code> method and to create and delete object stores in the <code>onupdateneeded</code> event handler associated to the returned request.</div>\n<p>Updates the version of the database. Returns immediately and runs a <code><a title=\"en/IndexedDB/IDBTransaction#VERSION CHANGE\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBTransaction#VERSION_CHANGE\">VERSION_CHANGE</a></code> transaction on the connected database in a separate thread.</p>\n<p>Call this method before creating or deleting an object store.</p>\n\n<div id=\"section_19\"><span id=\"Parameters_3\"></span><h5 class=\"editable\">Parameters</h5>\n<dl> <dt>version</dt> <dd>The version to store in the database.</dd>\n</dl>\n</div><div id=\"section_20\"><span id=\"Returns_3\"></span><h5 class=\"editable\">Returns</h5>\n<dl> <dt><code><a title=\"en/IndexedDB/IDBObjectStore\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBVersionChangeRequest\">IDBVersionChangeRequest</a></code></dt> <dd>The request to change the version of a database.</dd>\n</dl>\n</div>","idl":"<pre>IDBVersionChangeRequest setVersion(\n&nbsp; in DOMString <em>version</em>\n) raises (IDBDatabaseException);\n</pre>","obsolete":false},{"name":"createObjectStore","help":"<p>Creates and returns a new object store or index. The method takes the name of the store as well as a parameter object. The parameter object lets you define important optional properties. You can use the property to uniquely identify individual objects in the store. As the property is an identifier, it should be unique to every object, and every object should have that property.</p>\n<p>But before you can create any object store or index,&nbsp;you must first call the <code><a href=\"#setVersion()\">setVersion()</a></code><a href=\"#setVersion()\"> method</a>.</p>\n\n<div id=\"section_11\"><span id=\"Parameters\"></span><h5 class=\"editable\">Parameters</h5>\n<dl> <dt>name</dt> <dd>The name of the new object store.</dd> <dt>optionalParameters</dt> <dd> <div class=\"warning\"><strong>Warning:</strong> The latest draft of the specification changed this to <code>IDBDatabaseOptionalParameters</code>, which is not yet recognized by any browser</div> <p><em>Optional</em>. Options object whose attributes are optional parameters to the method. It includes the following properties:</p> <table class=\"standard-table\"> <thead> <tr> <th scope=\"col\" width=\"131\">Attribute</th> <th scope=\"col\" width=\"698\">Description</th> </tr> </thead> <tbody> <tr> <td><code>keyPath</code></td> <td>The <a title=\"en/IndexedDB#gloss key path\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB#gloss_key_path\">key path</a> to be used by the new object store. If empty or not specified, the object store is created without a key path and uses <a title=\"en/IndexedDB#gloss out-of-line key\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB#gloss_out-of-line_key\">out-of-line keys</a>.</td> </tr> <tr> <td><code>autoIncrement</code></td> <td>If true, the object store has a <a title=\"en/IndexedDB#gloss key generator\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB#gloss_key_generator\">key generator</a>. Defaults to <code>false</code>.</td> </tr> </tbody> </table> <p>Unknown parameters are ignored.</p> </dd>\n</dl>\n</div><div id=\"section_12\"><span id=\"Returns\"></span><h5 class=\"editable\">Returns</h5>\n<dl> <dt><code><a title=\"en/IndexedDB/IDBObjectStore\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBObjectStore\">IDBObjectStore</a></code></dt> <dd>The newly created object store.</dd>\n</dl>\n</div><div id=\"section_13\"><span id=\"Exceptions\"></span><h5 class=\"editable\">Exceptions</h5>\n<p>This method can raise an <a title=\"en/IndexedDB/IDBDatabaseException\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException\">IDBDatabaseException</a> with the following codes:</p>\n<table class=\"standard-table\"> <thead> <tr> <th scope=\"col\" width=\"131\">Exception</th> <th scope=\"col\" width=\"698\">Description</th> </tr> </thead> <tbody> <tr> <td><code><a title=\"en/IndexedDB/DatabaseException#NOT ALLOWED ERR\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#NOT_ALLOWED_ERR\">NOT_ALLOWED_ERR</a></code></td> <td>The method was not called from a <code><a title=\"en/IndexedDB/IDBTransaction#VERSION CHANGE\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBTransaction#VERSION_CHANGE\">VERSION_CHANGE</a></code> transaction callback. You must call <code>setVersion()</code> first.</td> </tr> <tr> <td><code><a title=\"en/IndexedDB/DatabaseException#CONSTRAINT ERR\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#CONSTRAINT_ERR\">CONSTRAINT_ERR</a></code></td> <td>An object store with the given name (based on case-sensitive comparison) already exists in the connected database.</td> </tr> <tr> <td><code><a title=\"en/IndexedDB/IDBDatabaseException#NON_TRANSIENT_ERR\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#NON_TRANSIENT_ERR\">NON_TRANSIENT_ERR</a></code></td> <td><code>optionalParameters</code> has attributes other than <code>keyPath</code> and <code>autoIncrement</code>.</td> </tr> </tbody>\n</table>\n</div>","idl":"<pre>IDBObjectStore createObjectStore(\n&nbsp; in DOMString <em>name</em>,\n&nbsp; in <code>Object <em>optionalParameters</em></code>\n) raises (IDBDatabaseException);\n</pre>","obsolete":false},{"name":"close","help":"<p>Returns immediately and closes the connection in a separate thread. The connection is not actually closed until all transactions created using this connection are complete. No new transactions can be created for this connection once this method is called. Methods that create transactions throw an exception if a closing operation is pending.</p>\n<pre>void close();\n</pre>","obsolete":false},{"url":"","name":"name","help":"Name of the connected database.","obsolete":false},{"url":"","name":"version","help":"The version of the connected database. When a database is first created, this attribute is the empty string.","obsolete":false},{"url":"","name":"objectStoreNames","help":"A list of the names of the <a title=\"en/IndexedDB#gloss object store\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB#gloss_object_store\">object stores</a> currently in the connected database.","obsolete":false},{"name":"onabort","help":"","obsolete":false},{"name":"onerror","help":"","obsolete":false},{"name":"onversionchange","help":"","obsolete":false}]},"CSSRule":{"title":"CSSRule","srcUrl":"https://developer.mozilla.org/en/DOM/cssRule","specification":"<li><a class=\"external\" rel=\"external\" href=\"http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSRule\" title=\"http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSRule\" target=\"_blank\">DOM Level 2 CSS: CSSRule</a></li> <li><a class=\" external\" title=\"http://dev.w3.org/csswg/cssom/#css-rules\" rel=\"external\" href=\"http://dev.w3.org/csswg/cssom/#css-rules\" target=\"_blank\">CSS Object Model: CSS Rules</a></li>","seeAlso":"Using dynamic styling information","summary":"<p>An object implementing the <code>CSSRule</code> DOM interface represents a single CSS rule. References to a <code>CSSRule</code>-implementing object may be obtained by looking at a <a title=\"en/DOM/stylesheet\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/CSSStyleSheet\">CSS style sheet's</a> <code><a title=\"en/DOM/CSSStyleSheet/cssRules\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/CSSStyleSheet\">cssRules</a></code> list.</p>\n<p>There are several kinds of rules. The <code>CSSRule</code> interface specifies the properties common to all rules, while properties unique to specific rule types are specified in the more specialized interfaces for those rules' respective types.</p>","members":[{"name":"STYLE_RULE","help":"","obsolete":false},{"name":"MEDIA_RULE","help":"","obsolete":false},{"name":"FONT_FACE_RULE","help":"","obsolete":false},{"name":"PAGE_RULE","help":"","obsolete":false},{"name":"IMPORT_RULE","help":"","obsolete":false},{"name":"CHARSET_RULE","help":"","obsolete":false},{"name":"UNKNOWN_RULE","help":"","obsolete":false},{"name":"KEYFRAMES_RULE","help":"","obsolete":false},{"name":"KEYFRAME_RULE","help":"","obsolete":false},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/cssRule/parentRule","name":"parentRule","help":"Returns the containing rule, otherwise <code>null</code>. E.g. if this rule is a style rule inside an <code><a title=\"en/CSS/@media\" rel=\"internal\" href=\"https://developer.mozilla.org/en/CSS/@media\">@media</a></code> block, the parent rule would be that <code><a title=\"en/DOM/CSSMediaRule\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/CSSMediaRule\">CSSMediaRule</a></code>."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/CSSRule/parentStyleSheet","name":"parentStyleSheet","help":"Returns the <code><a title=\"en/DOM/CSSStyleSheet\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/CSSStyleSheet\">CSSStyleSheet</a></code> object for the style sheet that contains this rule"},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/CSSRule/cssText","name":"cssText","help":"Returns the textual representation of the rule, e.g. <code>\"h1,h2 { font-size: 16pt }\"</code>"},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/cssRule/type","name":"type","help":"One of the <a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/cssRule#Type_constants\">Type constants</a>&nbsp;indicating the type of CSS&nbsp;rule."}]},"DOMSelection":{"title":"Selection","seeAlso":"<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/window.getSelection\">window.getSelection</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/document.getSelection\">document.getSelection</a></code>\n, <a title=\"en/dom/Range\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/range\">Range</a>","summary":"<p>Selection is the class of the object returned by <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/window.getSelection\">window.getSelection()</a></code>\n and other methods. It represents the text selection in the greater page, possibly spanning multiple elements, when the user drags over static text and other parts of the page. For information about text selection in an individual text editing element, see <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/HTMLInputElement\">Input</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/HTMLTextAreaElement\">TextArea</a></code>\n and <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/document.activeElement\">document.activeElement</a></code>\n which typically return the parent object returned from <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/window.getSelection\">window.getSelection()</a></code>\n.</p>\n<p>A selection object represents the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/range\">ranges</a></code>\n that the user has selected. Typically, it holds only one range, accessed as follows:</p>\n\n          <pre name=\"code\" class=\"js\">var selObj = window.getSelection();\nvar range  = selObj.getRangeAt(0);</pre>\n        \n<ul> <li><code>selObj</code> is a Selection object</li> <li><code>range</code> is a <a title=\"en/DOM/Range\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/range\">Range</a> object</li>\n</ul>\n<p>Calling the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Selection/toString\">Selection/toString()</a></code>\n method returns the text contained in the selection, e.g</p>\n\n          <pre name=\"code\" class=\"js\">var selObj = window.getSelection();\nwindow.alert(selObj);</pre>\n        \n<p>Note that using a selection object as the argument to <code>window.alert</code> will call the object's <code>toString</code> method.</p>","members":[{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/Selection/selectAllChildren","name":"selectAllChildren","help":"Adds all the children of the specified node to the selection."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/Selection/removeRange","name":"removeRange","help":"Removes a range from the selection."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/Selection/extend","name":"extend","help":"Moves the focus of the selection to a specified point."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/Selection/modify","name":"modify","help":"Changes the current selection."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/Selection/addRange","name":"addRange","help":"A range object that will be added to the selection."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/Selection/collapseToStart","name":"collapseToStart","help":"Collapses the selection to the start of the first range in the selection."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/Selection/collapseToEnd","name":"collapseToEnd","help":"Collapses the selection to the end of the last range in the selection."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/Selection/toString","name":"toString","help":"Returns a string currently being represented by the selection object, i.e. the currently selected text."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/Selection/selectionLanguageChange","name":"selectionLanguageChange","help":"Modifies the cursor Bidi level after a change in keyboard direction."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/Selection/getRangeAt","name":"getRangeAt","help":"Returns a range object representing one of the ranges currently selected."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/Selection/collapse","name":"collapse","help":"Collapses the current selection to a single point."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/Selection/removeAllRanges","name":"removeAllRanges","help":"Removes all ranges from the selection."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/Selection/deleteFromDocument","name":"deleteFromDocument","help":"Deletes the selection's content from the document."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/Selection/containsNode","name":"containsNode","help":"Indicates if a certain node is part of the selection."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/Selection/focusOffset","name":"focusOffset","help":"Returns the number of characters that the selection's focus is offset within the focusNode."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/Selection/rangeCount","name":"rangeCount","help":"Returns the number of ranges in the selection."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/Selection/anchorNode","name":"anchorNode","help":"Returns the node in which the selection begins."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/Selection/anchorOffset","name":"anchorOffset","help":"Returns the number of characters that the selection's anchor is offset within the anchorNode."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/Selection/isCollapsed","name":"isCollapsed","help":"Returns a Boolean indicating whether the selection's start and end points are at the same position."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/Selection/focusNode","name":"focusNode","help":"Returns the node in which the selection ends."}],"srcUrl":"https://developer.mozilla.org/en/DOM/Selection"},"SVGPathSegArcRel":{"title":"SVGPathElement","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/SVGPathElement","skipped":true,"cause":"Suspect title"},"CSSStyleRule":{"title":"CSSStyleRule","seeAlso":"CSSRule","summary":"An object representing a single CSS style rule. <code>CSSStyleRule</code> implements the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/CSSRule\">CSSRule</a></code>\n interface.","members":[{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/CSSStyleRule/selectorText","name":"selectorText","help":"Gets/sets the textual representation of the selector for this rule, e.g. <code>\"h1,h2\"</code>."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/CSSStyleRule/style","name":"style","help":"Returns the <code><a title=\"en/DOM/CSSStyleDeclaration\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/CSSStyleDeclaration\">CSSStyleDeclaration</a></code> object for the rule. <strong>Read only.</strong>"}],"srcUrl":"https://developer.mozilla.org/en/DOM/CSSStyleRule"},"Blob":{"title":"Blob","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td>5 \n<span title=\"prefix\">webkit</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span>\n<span title=\"prefix\">moz</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE&nbsp;Phone</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>","srcUrl":"https://developer.mozilla.org/en/DOM/Blob","seeAlso":"<li>\n<a rel=\"custom\" href=\"http://www.w3.org/TR/FileAPI/#dfn-Blob\">File API Specification: Blob</a><span title=\"Working Draft\">WD</span></li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/BlobBuilder\">BlobBuilder</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/File\">File</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/XMLHttpRequest/FormData\">FormData</a></code>\n</li>","summary":"<div><p><strong>This is an experimental feature</strong><br>Because this feature is still in development in some browsers, check the <a href=\"#AutoCompatibilityTable\">compatibility table</a> for the proper prefixes to use in various browsers.</p></div>\n<p></p>\n<p>A <code>Blob</code> object represents a file-like object of immutable, raw data. Blobs represent data that isn't necessarily in a JavaScript-native format. The <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/File\">File</a></code>\n interface is based on <code>Blob</code>, inheriting blob functionality and expanding it to support files on the user's system.</p>\n<p>An easy way to construct a <code>Blob</code> is by using the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/BlobBuilder\">BlobBuilder</a></code>\n interface, which lets you iteratively append data to a blob, then retrieve the completed blob when you're ready to use it for something. Another way is to use the <code>slice()</code> method to create a blob that contains a subset of another blob's data.</p>\n<div class=\"note\"><strong>Note:</strong> The <code>slice()</code> method has vendor prefixes: <code>blob.mozSlice()</code> for Firefox and <code>blob.webkitSlice()</code> for Chrome. An old version of the <code>slice()</code> method, without vendor prefixes, had different semantics, as described below.</div>","members":[{"name":"size","help":"The size, in bytes, of the data contained in the <code>Blob</code> object. <strong>Read only.</strong>","obsolete":false},{"name":"type","help":"An ASCII-encoded string, in all lower case, indicating the MIME&nbsp;type of the data contained in the <code>Blob</code>. If the type is unknown, this string is empty. <strong>Read only.</strong>","obsolete":false}]},"HTMLHRElement":{"title":"HTMLHRElement","seeAlso":"<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/hr\">&lt;hr&gt;</a></code>\n HTML&nbsp;element","summary":"DOM <code>hr</code> elements expose the <a target=\"_blank\" rel=\"external nofollow\" class=\" external\" title=\"http://www.w3.org/TR/html5/grouping-content.html#htmlhrelement\" href=\"http://www.w3.org/TR/html5/grouping-content.html#htmlhrelement\">HTMLHRElement</a> (or <span><a rel=\"custom nofollow\" href=\"https://developer.mozilla.org/en/HTML\">HTML 4</a></span> <a target=\"_blank\" title=\"http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-68228811\" rel=\"external nofollow\" class=\" external\" href=\"http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-68228811\"><code>HTMLHRElement</code></a>) interface, which provides special properties (beyond the regular <a rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/element\">element</a> object interface they also have available to them by inheritance) for manipulating <code>hr</code> elements. In <span><a rel=\"custom nofollow\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML 5</a></span>, this interface inherits from HTMLElement, but defines no additional members.","members":[{"name":"align","help":"Enumerated attribute indicating alignment of the rule with respect to the surrounding context.","obsolete":true},{"name":"noshade","help":"Sets the rule to have no shading.","obsolete":true},{"name":"size","help":"The height of the rule.","obsolete":true},{"name":"width","help":"The width of the rule on the page.","obsolete":true}],"srcUrl":"https://developer.mozilla.org/en/DOM/HTMLHRElement"},"DirectoryReader":{"title":"DirectoryReader","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td>13\n<span title=\"prefix\">webkit</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE&nbsp;Phone</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> </tr> </tbody> </table>\n</div>","summary":"<div><strong>`DRAFT</strong> <div>This page is not complete.</div>\n</div>\n<p>The <code>DirectoryReader</code> interface of the <a title=\"en/DOM/File_API/File_System_API\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/File_API/File_System_API\">FileSystem API</a> lets a user list files and directories in a directory.</p>","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/File_API/File_System_API/DirectoryReader"},"WebKitBlobBuilder":{"title":"BlobBuilder","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari</th> </tr> <tr> <td>Basic support</td> <td> <p>8</p> <p>As <code>WebKitBlobBuilder</code>.</p> </td> <td> <p>6.0 (6.0)\n</p> <p>As <code>MozBlobBuilder</code>.</p> </td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td> <p>\n<em>Nightly build</em></p> <p>As <code>WebKitBlobBuilder</code>.</p> </td> </tr> </tbody>\n</table>\n</div>\n<div id=\"compat-mobile\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td> <p>6.0 (6.0)\n</p> <p>As <code>MozBlobBuilder</code>.</p> </td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody>\n</table>\n</div>","srcUrl":"https://developer.mozilla.org/en/DOM/BlobBuilder","seeAlso":"<li>\n<a rel=\"custom\" href=\"http://dev.w3.org/2009/dap/file-system/file-writer.html#idl-def-BlobBuilder\">File API Specification: BlobBuilder</a><span title=\"Working Draft\">WD</span></li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Blob\">Blob</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/File\">File</a></code>\n</li>","summary":"<div><p><strong>This is an experimental feature</strong><br>Because this feature is still in development in some browsers, check the <a href=\"#AutoCompatibilityTable\">compatibility table</a> for the proper prefixes to use in various browsers.</p></div>\n<p></p>\n<p>The <code>BlobBuilder</code> interface provides an easy way to construct <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Blob\">Blob</a></code>\n objects. Just create a <code>BlobBuilder</code> and append chunks of data to it by calling the  method. When you're done building your blob, call  to retrieve a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Blob\">Blob</a></code>\n containing the data you sent into the blob builder.</p>","members":[{"name":"getBlob","help":"<p>Returns the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Blob\">Blob</a></code>\n object that has been constructed using the data passed through calls to .</p>\n\n<div id=\"section_6\"><span id=\"Parameters_2\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt>contentType \n<span title=\"\">Optional</span>\n</dt> <dd>The MIME type of the data to be returned in the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Blob\">Blob</a></code>\n. This will be the value of the <code>Blob</code> object's type property.</dd>\n</dl>\n</div><div id=\"section_7\"><span id=\"Return_value\"></span><h6 class=\"editable\">Return value</h6>\n<p>A <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Blob\">Blob</a></code>\n object containing all of the data passed to any calls to &nbsp;made since the <code>BlobBuilder</code> was created. This also resets the BlobBuilder so that the next call to &nbsp;is starting a new, empty blob.</p>\n</div>","idl":"<pre class=\"eval\">Blob getBlob(\n&nbsp; in DOMString contentType \n<span style=\"border: 1px solid #9ED2A4; background-color: #C0FFC7; font-size: x-small; white-space: nowrap; padding: 2px;\" title=\"\">Optional</span>\n\n); \n</pre>","obsolete":false},{"name":"append","help":"<p>Appends the contents of the specified JavaScript object to the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Blob\">Blob</a></code>\n being built. If the value you specify isn't a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Blob\">Blob</a></code>\n, <a title=\"en/JavaScript typed arrays/Arraybuffer\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/ArrayBuffer\"><code>ArrayBuffer</code></a>, or <a title=\"en/JavaScript/Reference/Global Objects/String\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String\"><code>String</code></a>, the value is coerced to a string before being appended to the blob.</p>\n<pre>void append(\n&nbsp; in ArrayBuffer data\n};\n\nvoid append(\n&nbsp; in Blob data\n};\n\n\nvoid append(\n&nbsp; in String data,\n  [optional] in String endings\n};\n</pre>\n<div id=\"section_4\"><span id=\"Parameters\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>data</code></dt> <dd>The data to append to the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Blob\">Blob</a></code>\n being constructed.</dd> <dt><code>endings</code></dt> <dd>Specifies how strings containing <code>\\n</code> are to be written out. This can be <code>\"transparent\"</code> (endings unchanged) or <code>\"native\"</code> (endings changed to match host OS filesystem convention). The default value is <code>\"transparent\"</code>.</dd>\n</dl>\n</div>","obsolete":false}]},"HTMLParamElement":{"title":"param","examples":["Please see the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/object\">&lt;object&gt;</a></code>\n page for examples on &lt;param&gt;."],"summary":"<strong>Parameter </strong>element which defines parameters for <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/object\">&lt;object&gt;</a></code>\n.","members":[{"obsolete":false,"url":"","name":"valuetype","help":"<p>Specifies the type of the <code>value</code> attribute. Possible values are:</p> <ul> <li>data: Default value. The value is passed to the object's implementation as a string.</li> <li>ref: The value is a URI to a resource where run-time values are stored.</li> <li>object: An ID of another <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/object\">&lt;object&gt;</a></code>\n in the same document.</li> </ul>"},{"obsolete":false,"url":"","name":"name","help":"Name of the parameter."},{"obsolete":false,"url":"","name":"type","help":"Only used if the <code>valuetype</code> is set to \"ref\". Specifies the type of values found at the URI specified by value."},{"obsolete":false,"url":"","name":"value","help":"Value of the parameter."}],"srcUrl":"https://developer.mozilla.org/en/HTML/Element/param"},"SVGMetadataElement":{"title":"metadata","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\">\n<table class=\"compat-table\"> <tbody> \n<tr><th scope=\"col\">Feature</th><th scope=\"col\">Chrome</th><th scope=\"col\">Firefox (Gecko)</th><th scope=\"col\">Internet Explorer</th><th scope=\"col\">Opera</th><th scope=\"col\">Safari</th></tr> <tr> <td>Basic support</td> <td>1.0</td> <td>1.5 (1.8)\n</td> <td>\n9.0</td> <td>\n8.0</td> <td>\n3.0.4</td> </tr> </tbody>\n</table>\n</div>\n<div id=\"compat-mobile\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE&nbsp;Phone</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td>\n3.0</td> <td>1.0 (1.8)\n</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td>\n3.0.4</td> </tr> </tbody>\n</table>\n</div>\n<p>The chart is based on <a title=\"en/SVG/Compatibility sources\" rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Compatibility_sources\">these sources</a>.</p>","summary":"Metadata is structured data about data. Metadata which is included with SVG content should be specified within <code>metadata</code> elements. The contents of the <code>metadata</code> should be elements from other XML namespaces such as RDF, FOAF, etc.","members":[],"srcUrl":"https://developer.mozilla.org/en/SVG/Element/metadata"},"Notification":{"title":"notification","seeAlso":"<li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/navigator.mozNotification\">navigator.mozNotification</a></code>\n</li> <li><a title=\"en/DOM/Displaying notifications\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/Displaying_notifications\">Displaying notifications</a></li>","summary":"<div class=\"geckoMinversionHeaderTemplate\"><p>Mobile Only in Gecko 2.0</p><p>Available only in Firefox Mobile as of Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1)\n</p></div>\n\n<div><p>Non-standard</p></div><p></p>\n<p>The notification object, which you create using the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/navigator.mozNotification\">navigator.mozNotification</a></code>\n&nbsp;object's <code>createNotification()</code>&nbsp;method, is used to configure and display desktop notifications to the user.</p>","members":[{"name":"show","help":"Displays the notification.","idl":"<pre class=\"eval\">void show();\n</pre>","obsolete":false},{"name":"onclick","help":"&nbsp;A function to call when the notification is clicked.","obsolete":false},{"name":"onclose","help":"&nbsp;A function to call when the notification is dismissed.","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/DOM/notification"},"HTMLTitleElement":{"title":"HTMLTitleElement","summary":"The <code>title</code> object exposes the <a target=\"_blank\" class=\" external\" rel=\"external\" href=\"http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-79243169\" title=\"http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-79243169\">HTMLTitleElement</a> interface which contains the title for a document.&nbsp; This element inherits all of the properties and methods described in the <a title=\"en/DOM/element\" class=\"internal\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/element\">element</a> section.","members":[{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/title.text","name":"text","help":"Gets or sets the text content of the document's title."}],"srcUrl":"https://developer.mozilla.org/en/DOM/HTMLTitleElement"},"Performance":{"title":"Performance","summary":"The articles linked to from here will help you improve performance, whether you're developing core Mozilla code or an add-on.","members":[],"srcUrl":"https://developer.mozilla.org/en/Performance"},"MessagePort":{"title":"nsIWorkerMessagePort","seeAlso":"<li><a class=\"internal\" title=\"En/Using DOM workers\" rel=\"internal\" href=\"https://developer.mozilla.org/En/Using_web_workers\">Using web workers</a></li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsIWorkerMessageEvent\">nsIWorkerMessageEvent</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsIWorkerGlobalScope\">nsIWorkerGlobalScope</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsIWorkerScope\">nsIWorkerScope</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsIAbstractWorker\">nsIAbstractWorker</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsIWorker\">nsIWorker</a></code>\n</li>","summary":"<div>\n\n<a rel=\"custom\" href=\"http://mxr.mozilla.org/mozilla-central/source/dom/interfaces/threads/nsIDOMWorkers.idl\"><code>dom/interfaces/threads/nsIDOMWorkers.idl</code></a><span><a rel=\"internal\" href=\"https://developer.mozilla.org/en/Interfaces/About_Scriptable_Interfaces\" title=\"en/Interfaces/About_Scriptable_Interfaces\">Scriptable</a></span></div><span>This interface represents a worker thread's message port, which is used to allow the worker to post messages back to its creator.</span><div><div>1.0</div><div>11.0</div><div></div><div>Introduced</div><div>Gecko 1.9.1</div><div title=\"Introduced in Gecko 1.9.1 (Firefox 3.5 / Thunderbird 3.0 / SeaMonkey 2.0)\n\"></div><div title=\"Last changed in Gecko 1.9.1 (Firefox 3.5 / Thunderbird 3.0 / SeaMonkey 2.0)\n\"></div></div>\n<div>Inherits from: <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsISupports\">nsISupports</a></code>\n<span>Last changed in Gecko 1.9.1 (Firefox 3.5 / Thunderbird 3.0 / SeaMonkey 2.0)\n</span></div>","members":[{"name":"postMessage","help":"<p>Posts a message into the event queue.</p>\n\n<div id=\"section_4\"><span id=\"Parameters\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>aMessage</code></dt> <dd>The message to post.</dd>\n</dl>\n</div>","idl":"<pre class=\"eval\"> void postMessage(\n   in DOMString aMessage\n );\n</pre>","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/XPCOM_Interface_Reference/NsIWorkerMessagePort"},"HTMLHeadingElement":{"title":"HTMLHeadingElement","seeAlso":"HTML&nbsp;Heading elements","summary":"DOM heading elements expose the <a title=\"http://www.w3.org/TR/html5/sections.html#htmlheadingelement\" class=\" external\" rel=\"external nofollow\" href=\"http://www.w3.org/TR/html5/sections.html#htmlheadingelement\" target=\"_blank\">HTMLHeadingElement</a> (or <span><a rel=\"custom nofollow\" href=\"https://developer.mozilla.org/en/HTML\">HTML 4</a></span> <a class=\" external\" rel=\"external nofollow\" href=\"http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-43345119\" title=\"http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-43345119\" target=\"_blank\"><code>HTMLHeadingElement</code></a>) interface. In <span><a rel=\"custom nofollow\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML 5</a></span>, this interface inherits from HTMLElement, but defines no additional members, though in <span><a rel=\"custom nofollow\" href=\"https://developer.mozilla.org/en/HTML\">HTML 4</a></span> it introduces the deprecated <code>align</code> property.","members":[{"name":"align","help":"Enumerated attribute indicating alignment of the heading with respect to the surrounding context.","obsolete":true}],"srcUrl":"https://developer.mozilla.org/en/DOM/HTMLHeadingElement"},"SVGFontFaceElement":{"title":"SVGFontFaceElement","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>","srcUrl":"https://developer.mozilla.org/en/DOM/SVGFontFaceElement","seeAlso":"<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/font-face\">&lt;font-face&gt;</a></code>\n SVG Element","summary":"<p>The <code>SVGFontFaceElement</code> interface corresponds to the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/font-face\">&lt;font-face&gt;</a></code>\n elements.</p>\n<p>Object-oriented access to the attributes of the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/font-face\">&lt;font-face&gt;</a></code>\n element via the SVG DOM is not possible.</p>","members":[]},"SVGExternalResourcesRequired":{"title":"SVGImageElement","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/SVGImageElement","skipped":true,"cause":"Suspect title"},"WebKitAnimationEvent":{"title":"AnimationEvent","srcUrl":"https://developer.mozilla.org/en/DOM/event/AnimationEvent","specification":"<a rel=\"custom\" href=\"http://www.w3.org/TR/css3-animations/#animation-events-\">CSS Animations Module Level 3: Animation Events</a><span title=\"Working Draft\">WD</span>","seeAlso":"<li><a rel=\"internal\" href=\"https://developer.mozilla.org/en/CSS/CSS_animations\" title=\"en/CSS/CSS_animations\">CSS animations</a></li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/CSS/animation\">animation</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/CSS/animation-delay\">animation-delay</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/CSS/animation-direction\">animation-direction</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/CSS/animation-duration\">animation-duration</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/CSS/animation-fill-mode\">animation-fill-mode</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/CSS/animation-iteration-count\">animation-iteration-count</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/CSS/animation-name\">animation-name</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/CSS/animation-play-state\">animation-play-state</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/CSS/animation-timing-function\">animation-timing-function</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/CSS/@keyframes\">@keyframes</a></code>\n</li>","summary":"<code>AnimationEvent</code> objects provide information about events that occur related to <a rel=\"internal\" href=\"https://developer.mozilla.org/en/CSS/CSS_animations\" title=\"en/CSS/CSS_animations\">CSS animations</a>.","members":[{"name":"animationName","help":"The name of the animation on which the animation event occurred.","obsolete":false},{"name":"elapsedTime","help":"The amount of time, in seconds, the animation had been running at the time the event occurred.","obsolete":false}]},"HTMLBodyElement":{"title":"HTMLBodyElement","seeAlso":"<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/body\">&lt;body&gt;</a></code>\n HTML&nbsp;element","summary":"DOM body elements expose the <a href=\"http://www.w3.org/TR/html5/sections.html#the-body-element\" target=\"_blank\" rel=\"external nofollow\" class=\" external\" title=\"http://www.w3.org/TR/html5/sections.html#the-body-element\">HTMLBodyElement</a> (or \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML\">HTML 4</a></span> <a href=\"http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-48250443\" target=\"_blank\" title=\"http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-48250443\" rel=\"external nofollow\" class=\" external\"><code>HTMLBodyElement</code></a>) interface, which provides special properties (beyond the regular <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/element\">element</a></code>\n object interface they also have available to them by inheritance) for manipulating body elements.","members":[{"name":"aLink","help":"Color of active hyperlinks.","obsolete":true},{"name":"background","help":"<p>URI for a background image resource.</p> <div class=\"note\"><strong>Note:</strong> Starting in Gecko 7.0 (Firefox 7.0 / Thunderbird 7.0 / SeaMonkey 2.4)\n, this value is no longer resolved as a URI; instead, it's treated as a simple string.</div>","obsolete":true},{"name":"bgColor","help":"Background color for the document.","obsolete":true},{"name":"link","help":"Color of unvisited links.","obsolete":true},{"name":"onafterprint","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/body#attr-onafterprint\">onafterprint</a></code>\n HTML&nbsp;attribute value for a function to call after the user has printed the document.","obsolete":false},{"name":"onbeforeprint","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/body#attr-onbeforeprint\">onbeforeprint</a></code>\n HTML&nbsp;attribute value for a function to call when the user has requested printing the document.","obsolete":false},{"name":"onbeforeunload","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/body#attr-onbeforeunload\">onbeforeunload</a></code>\n HTML&nbsp;attribute value for a function to call when the document is about to be unloaded.","obsolete":false},{"name":"onblur","help":"<p>Exposes the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/window.onblur\">window.onblur</a></code>\n event handler to call when the window loses focus.</p> <div class=\"note\"><strong>Note:</strong> This handler is triggered when the event reaches the window, not the body element. Use <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/element.addEventListener\">addEventListener()</a></code>\n to attach an event listener to the body element.</div>","obsolete":false},{"name":"onerror","help":"<p>Exposes the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/window.onerror\">window.onerror</a></code>\n event handler to call when the document fails to load properly.</p> <div class=\"note\"><strong>Note:</strong> This handler is triggered when the event reaches the window, not the body element. Use <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/element.addEventListener\">addEventListener()</a></code>\n to attach an event listener to the body element.</div>","obsolete":false},{"name":"onfocus","help":"<p>Exposes the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/window.onfocus\">window.onfocus</a></code>\n event handler to call when the window gains focus.</p> <div class=\"note\"><strong>Note:</strong> This handler is triggered when the event reaches the window, not the body element. Use <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/element.addEventListener\">addEventListener()</a></code>\n to attach an event listener to the body element.</div>","obsolete":false},{"name":"onhashchange","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/body#attr-onhashchange\">onhashchange</a></code>\n HTML&nbsp;attribute value for a function to call when the fragment identifier in the address of the document changes.","obsolete":false},{"name":"onload","help":"<p>Exposes the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/window.onload\">window.onload</a></code>\n event handler to call when the window gains focus.</p> <div class=\"note\"><strong>Note:</strong> This handler is triggered when the event reaches the window, not the body element. Use <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/element.addEventListener\">addEventListener()</a></code>\n to attach an event listener to the body element.</div>","obsolete":false},{"name":"onmessage","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/body#attr-onmessage\">onmessage</a></code>\n HTML&nbsp;attribute value for a function to call when the document receives a message.","obsolete":false},{"name":"onoffline","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/body#attr-onoffline\">onoffline</a></code>\n HTML&nbsp;attribute value for a function to call when network communication fails.","obsolete":false},{"name":"ononline","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/body#attr-ononline\">ononline</a></code>\n HTML&nbsp;attribute value for a function to call when network communication is restored.","obsolete":false},{"name":"onpopstate","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/body#attr-onpopstate\">onpopstate</a></code>\n HTML&nbsp;attribute value for a function to call when the user has navigated session history.","obsolete":false},{"name":"onredo","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/body#attr-onredo\">onredo</a></code>\n HTML&nbsp;attribute value for a function to call when the user has moved forward in undo transaction history.","obsolete":false},{"name":"onresize","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/body#attr-onresize\">onresize</a></code>\n HTML&nbsp;attribute value for a function to call when the document has been resized.","obsolete":false},{"name":"onstorage","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/body#attr-onpopstate\">onpopstate</a></code>\n HTML&nbsp;attribute value for a function to call when the storage area has changed.","obsolete":false},{"name":"onundo","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/body#attr-onundo\">onundo</a></code>\n HTML&nbsp;attribute value for a function to call when the user has moved backward in undo transaction history.","obsolete":false},{"name":"onunload","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/body#attr-onunload\">onunload</a></code>\n HTML&nbsp;attribute value for a function to call when when the document is going away.","obsolete":false},{"name":"text","help":"Foreground color of text.","obsolete":true},{"name":"vLink","help":"Color of visited links.","obsolete":true}],"srcUrl":"https://developer.mozilla.org/en/DOM/HTMLBodyElement"},"Uint8Array":{"title":"Uint8Array","srcUrl":"https://developer.mozilla.org/en/JavaScript_typed_arrays/Uint8Array","seeAlso":"<li><a title=\"https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/doc/spec/TypedArray-spec.html\" class=\" link-https\" rel=\"external\" href=\"https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/doc/spec/TypedArray-spec.html\" target=\"_blank\">Typed Array Specification</a></li> <li><a title=\"en/JavaScript typed arrays\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays\">JavaScript typed arrays</a></li>","summary":"<p>The <code>UInt8Array</code> type represents an array of 8-bit unsigned integers.</p>\n<p>Once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).</p>","constructor":"<div class=\"note\"><strong>Note:</strong> In these methods, <code><em>TypedArray</em></code> represents any of the <a title=\"en/JavaScript typed arrays/ArrayBufferView#Typed array subclasses\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/ArrayBufferView#Typed_array_subclasses\">typed array object types</a>.</div>\n<table class=\"standard-table\"> <tbody> <tr> <td><code>Uint8Array <a title=\"en/JavaScript typed arrays/Uint8Array#Int8Array()\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/Uint8Array#Int8Array%28%29\">Uint8Array</a>(unsigned long length);<br> </code></td> </tr> <tr> <td><code>Uint8Array </code><code><a title=\"en/JavaScript typed arrays/Uint8Array#Int8Array()\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/Uint8Array#Int8Array%28%29\">Uint8Array</a></code><code>(<em>TypedArray</em> array);<br> </code></td> </tr> <tr> <td><code>Uint8Array </code><code><a title=\"en/JavaScript typed arrays/Uint8Array#Int8Array()\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/Uint8Array#Int8Array%28%29\">Uint8Array</a></code><code>(sequence&lt;type&gt; array);<br> </code></td> </tr> <tr> <td><code>Uint8Array </code><code><a title=\"en/JavaScript typed arrays/Uint8Array#Int8Array()\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/Uint8Array#Int8Array%28%29\">Uint8Array</a></code><code>(ArrayBuffer buffer, optional unsigned long byteOffset, optional unsigned long length);<br> </code></td> </tr> </tbody>\n</table><p>Returns a new Uint8Array object.</p>\n<pre>Uint8Array Uint8Array(\n&nbsp; unsigned long length\n);\n\nUint8Array Uint8Array(\n&nbsp; <em>TypedArray</em> array\n);\n\nUint8Array Uint8Array(\n&nbsp; sequence&lt;type&gt; array\n);\n\nUint8Array Uint8Array(\n&nbsp; ArrayBuffer buffer,\n&nbsp; optional unsigned long byteOffset,\n&nbsp; optional unsigned long length\n);\n</pre>\n<div id=\"section_7\"><span id=\"Parameters\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>length</code></dt> <dd>The number of elements in the byte array. If unspecified, length of the array view will match the buffer's length.</dd> <dt><code>array</code></dt> <dd>An object of any of the typed array types (such as <code>Int32Array</code>), or a sequence of objects of a particular type, to copy into a new <a title=\"en/JavaScript typed arrays/ArrayBuffer\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/ArrayBuffer\"><code>ArrayBuffer</code></a>. Each value in the source array is converted to an 8-bit unsigned integer before being copied into the new array.</dd> <dt><code>buffer</code></dt> <dd>An existing <a title=\"en/JavaScript typed arrays/ArrayBuffer\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/ArrayBuffer\"><code>ArrayBuffer</code></a> to use as the storage for the new <code>Uint8Array</code> object.</dd> <dt><code>byteOffset<br> </code></dt> <dd>The offset, in bytes, to the first byte in the specified buffer for the new view to reference. If not specified, the <code>Uint8Array</code>'s view of the buffer will start with the first byte.</dd>\n</dl>\n</div><div id=\"section_8\"><span id=\"Return_value\"></span><h6 class=\"editable\">Return value</h6>\n<p>A new <code>Uint8Array</code> object representing the specified data buffer.</p>\n</div>","members":[{"name":"subarray","help":"<p>Returns a new <code>Uint8Array</code> view on the <a title=\"en/JavaScript typed arrays/ArrayBuffer\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/ArrayBuffer\"><code>ArrayBuffer</code></a> store for this <code>Uint8Array</code> object.</p>\n\n<div id=\"section_15\"><span id=\"Parameters_3\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>begin</code></dt> <dd>The offset to the first element in the array to be referenced by the new <code>Uint8Array</code> object.</dd> <dt><code>end</code> \n<span title=\"\">Optional</span>\n</dt> <dd>The offset to the element after last element in the array to be referenced by the new <code>Uint8Array</code> object; if not specified, all elements from the one specified by <code>begin</code> to the end of the array are included in the new view.</dd>\n</dl>\n</div><div id=\"section_16\"><span id=\"Notes_2\"></span><h6 class=\"editable\">Notes</h6>\n<p>The range specified by <code>begin</code> and <code>end</code> is clamped to the valid index range for the current array; if the computed length of the new array would be negative, it's clamped to zero. If either begin or end is negative, it refers to an index from the end of the array instead of from the beginning.</p>\n<div class=\"note\"><strong>Note:</strong> Keep in mind that this is creating a new view on the existing buffer; changes to the new object's contents will impact the original object and vice versa.</div></div>","idl":"<pre>Uint8Array subarray(\n&nbsp; long begin,\n&nbsp; optional long end\n);\n</pre>","obsolete":false},{"name":"set","help":"<p>Sets multiple values in the typed array, reading input values from a specified array.</p>\n\n<div id=\"section_13\"><span id=\"Parameters_2\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>array</code></dt> <dd>An array from which to copy values. All values from the source array are copied into the target array, unless the length of the source array plus the offset exceeds the length of the target array, in which case an exception is thrown. If the source array is a typed array, the two arrays may share the same underlying <code><a title=\"en/JavaScript typed arrays/ArrayBuffer\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/ArrayBuffer\">ArrayBuffer</a></code>; the browser will intelligently copy the source range of the buffer to the destination range.</dd> <dt>offset \n<span title=\"\">Optional</span>\n</dt> <dd>The offset into the target array at which to begin writing values from the source <code>array</code>. If you omit this value, 0 is assumed (that is, the source <code>array</code> will overwrite values in the target array starting at index 0).</dd>\n</dl>\n</div>","idl":"<pre>void set(\n&nbsp; <em>TypedArray</em> array,\n&nbsp; optional unsigned long offset\n);\n\nvoid set(\n&nbsp; type[] array,\n&nbsp; optional unsigned long offset\n);\n</pre>","obsolete":false},{"name":"BYTES_PER_ELEMENT","help":"The size, in bytes, of each array element.","obsolete":false},{"name":"length","help":"The number of entries in the array; for these 8-bit values, this is the same as the size of the array in bytes. <strong>Read only.</strong>","obsolete":false}]},"NodeList":{"title":"NodeList","examples":["<p>It's possible to loop over the items in a <code>NodeList</code> using:</p>\n\n          <pre name=\"code\" class=\"js\">for (var i = 0; i &lt; myNodeList.length; ++i) {\n  var item = myNodeList[i];  // Calling myNodeList.item(i) isn't necessary in JavaScript\n}</pre>\n        \n<p>Don't be tempted to use <code><a title=\"en/Core JavaScript 1.5 Reference/Statements/for...in\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript/Reference/Statements/for...in\">for...in</a></code> or <code><a title=\"en/Core JavaScript 1.5 Reference/Statements/for each...in\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript/Reference/Statements/for_each...in\">for each...in</a></code> to enumerate the items in the list, since that will also enumerate the length and item properties of the <code>NodeList</code> and cause errors if your script assumes it only has to deal with <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/element\">element</a></code>\n objects.</p>"],"srcUrl":"https://developer.mozilla.org/En/DOM/NodeList","specification":"DOM Level 3","summary":"NodeList objects are collections of nodes returned by <a title=\"document.getElementsByTagName\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/document.getElementsByTagName\"><code>getElementsByTagName</code></a>, <a title=\"document.getElementsByTagNameNS\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/document.getElementsByTagNameNS\"><code>getElementsByTagNameNS</code></a>, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Node.childNodes\">Node.childNodes</a></code>\n, <a title=\"document.querySelectorAll\" rel=\"internal\" href=\"https://developer.mozilla.org/En/DOM/Document.querySelectorAll\">querySelectorAll</a>, <a title=\"document.getElementsByClassName\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/document.getElementsByClassName\"><code>getElementsByClassName</code></a>, etc.NodeList objects are collections of nodes returned by <a title=\"document.getElementsByTagName\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/document.getElementsByTagName\"><code>getElementsByTagName</code></a>, <a title=\"document.getElementsByTagNameNS\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/document.getElementsByTagNameNS\"><code>getElementsByTagNameNS</code></a>, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Node.childNodes\">Node.childNodes</a></code>\n, <a title=\"document.querySelectorAll\" rel=\"internal\" href=\"https://developer.mozilla.org/En/DOM/Document.querySelectorAll\">querySelectorAll</a>, <a title=\"document.getElementsByClassName\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/document.getElementsByClassName\"><code>getElementsByClassName</code></a>, etc.","members":[{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/NodeList.item","name":"item","help":"Returns an item in the list by its index, or <code>null</code> if out-of-bounds. Equivalent to nodeList[idx]"},{"name":"length","help":"Reflects the number of elements in the NodeList.&nbsp;","obsolete":false}]},"DOMURL":{"title":"Drawing DOM objects into a canvas","members":[],"srcUrl":"https://developer.mozilla.org/en/HTML/Canvas/Drawing_DOM_objects_into_a_canvas","skipped":true,"cause":"Suspect title"},"FileError":{"title":"FileError","seeAlso":"<li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/FileReader\">FileReader</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/File\">File</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Blob\">Blob</a></code>\n</li> <li>\n<a rel=\"custom\" href=\"http://www.w3.org/TR/FileAPI/#FileErrorInterface\">Specification: FileAPI FileError</a><span title=\"Working Draft\">WD</span></li>","summary":"Represents an error that occurs while using the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/FileReader\">FileReader</a></code>\n interface.","members":[{"name":"ABORT_ERR","help":"The file operation was aborted, probably due to a call to the <code>FileReader</code> <code>abort()</code>&nbsp;method.","obsolete":false},{"name":"ENCODING_ERR","help":"The file data cannot be accurately represented in a data URL.","obsolete":false},{"name":"NOT_FOUND_ERR","help":"File not found.","obsolete":false},{"name":"NOT_READABLE_ERR","help":"File could not be read.","obsolete":false},{"name":"SECURITY_ERR","help":"The file could not be accessed for security reasons.","obsolete":false},{"name":"code","help":"The <a title=\"en/nsIDOMFileError#Error codes\" rel=\"internal\" href=\"https://developer.mozilla.org/en/nsIDOMFileError#Error_codes\">error code</a>.","obsolete":false},{"name":"code","help":"The <a title=\"en/nsIDOMFileError#Error codes\" rel=\"internal\" href=\"https://developer.mozilla.org/en/nsIDOMFileError#Error_codes\">error code</a>.","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/DOM/FileError"},"CSSMediaRule":{"title":"cssMediaRule","srcUrl":"https://developer.mozilla.org/en/DOM/cssMediaRule","specification":"<li><a class=\"external\" title=\"http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSMediaRule\" rel=\"external\" href=\"http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSMediaRule\" target=\"_blank\">DOM Level 2 CSS: CSSRule</a></li> <li><a class=\"external\" title=\"http://dev.w3.org/csswg/cssom/#cssmediarule\" rel=\"external\" href=\"http://dev.w3.org/csswg/cssom/#cssmediarule\" target=\"_blank\">CSS Object Model: CSS Media Rule</a></li>","seeAlso":"CSSRule","summary":"An object representing a single CSS media rule.&nbsp;<code>CSSMediaRule</code>&nbsp;implements the&nbsp;<code><a href=\"https://developer.mozilla.org/en/DOM/CSSRule\" rel=\"custom\">CSSRule</a></code>&nbsp;interface.","members":[{"name":"insertRule","help":"Inserts a new style rule into the current style sheet.","obsolete":false},{"name":"deleteRule","help":"Deletes a rule from the style sheet.","obsolete":false},{"name":"media","help":"Specifies the intended destination medium for style information.","obsolete":false},{"name":"cssRules","help":"Returns a <code><a title=\"en/DOM/CSSRuleList\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/CSSRuleList\">CSSRuleList</a></code> of the CSS rules in the media rule.","obsolete":false}]},"HTMLElement":{"title":"element","summary":"<p>This chapter provides a brief reference for the general methods, properties, and events available to most HTML and XML elements in the Gecko DOM.</p>\n<p>Various W3C specifications apply to elements:</p>\n<ul> <li><a class=\"external\" rel=\"external\" href=\"http://www.w3.org/TR/DOM-Level-2-Core/\" title=\"http://www.w3.org/TR/DOM-Level-2-Core/\" target=\"_blank\">DOM Core Specification</a>—describes the core interfaces shared by most DOM objects in HTML and XML documents</li> <li><a class=\"external\" rel=\"external\" href=\"http://www.w3.org/TR/DOM-Level-2-HTML/\" title=\"http://www.w3.org/TR/DOM-Level-2-HTML/\" target=\"_blank\">DOM HTML Specification</a>—describes interfaces for objects in HTML and XHTML documents that build on the core specification</li> <li><a class=\"external\" rel=\"external\" href=\"http://www.w3.org/TR/DOM-Level-2-Events/\" title=\"http://www.w3.org/TR/DOM-Level-2-Events/\" target=\"_blank\">DOM Events Specification</a>—describes events shared by most DOM objects, building on the DOM Core and <a class=\"external\" rel=\"external\" href=\"http://www.w3.org/TR/DOM-Level-2-Views/\" title=\"http://www.w3.org/TR/DOM-Level-2-Views/\" target=\"_blank\">Views</a> specifications</li> <li><a class=\"external\" title=\"http://www.w3.org/TR/ElementTraversal/\" rel=\"external\" href=\"http://www.w3.org/TR/ElementTraversal/\" target=\"_blank\">Element Traversal Specification</a>—describes the new attributes that allow traversal of elements in the DOM&nbsp;tree \n<span>New in <a rel=\"custom\" href=\"https://developer.mozilla.org/en/Firefox_3.5_for_developers\">Firefox 3.5</a></span>\n</li>\n</ul>\n<p>The articles listed here span the above and include links to the appropriate W3C DOM specification.</p>\n<p>While these interfaces are generally shared by most HTML and XML elements, there are more specialized interfaces for particular objects listed in the DOM HTML Specification. Note, however, that these HTML&nbsp;interfaces are \"only for [HTML 4.01] and [XHTML 1.0] documents and are not guaranteed to work with any future version of XHTML.\" The HTML 5 draft does state it aims for backwards compatibility with these HTML&nbsp;interfaces but says of them that \"some features that were formerly deprecated, poorly supported, rarely used or considered unnecessary have been removed.\" One can avoid the potential conflict by moving entirely to DOM&nbsp;XML attribute methods such as <code>getAttribute()</code>.</p>\n<p><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/HTMLHtmlElement\">Html</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/HTMLHeadElement\">Head</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/HTMLLinkElement\">Link</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/HTMLTitleElement\">Title</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/HTMLMetaElement\">Meta</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/HTMLBaseElement\">Base</a></code>\n, <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/HTMLIsIndexElement\" class=\"new\">IsIndex</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/HTMLStyleElement\">Style</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/HTMLBodyElement\">Body</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/HTMLFormElement\">Form</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/HTMLSelectElement\">Select</a></code>\n, <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/HTMLOptGroupElement\" class=\"new\">OptGroup</a></code>\n, <a title=\"en/HTML/Element/HTMLOptionElement\" rel=\"internal\" href=\"https://developer.mozilla.org/en/HTML/Element/HTMLOptionElement\" class=\"new \">Option</a>, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/HTMLInputElement\">Input</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/HTMLTextAreaElement\">TextArea</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/HTMLButtonElement\">Button</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/HTMLLabelElement\">Label</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/HTMLFieldSetElement\">FieldSet</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/HTMLLegendElement\">Legend</a></code>\n, <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/HTMLUListElement\" class=\"new\">UList</a></code>\n, <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/OList\" class=\"new\">OList</a></code>\n, <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/DList\" class=\"new\">DList</a></code>\n, <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/Directory\" class=\"new\">Directory</a></code>\n, <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/Menu\" class=\"new\">Menu</a></code>\n, <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/LI\" class=\"new\">LI</a></code>\n, <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/Div\" class=\"new\">Div</a></code>\n, <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/Paragraph\" class=\"new\">Paragraph</a></code>\n, <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/Heading\" class=\"new\">Heading</a></code>\n, <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/Quote\" class=\"new\">Quote</a></code>\n, <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/Pre\" class=\"new\">Pre</a></code>\n, <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/BR\" class=\"new\">BR</a></code>\n, <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/BaseFont\" class=\"new\">BaseFont</a></code>\n, <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/Font\" class=\"new\">Font</a></code>\n, <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/HR\" class=\"new\">HR</a></code>\n, <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/Mod\" class=\"new\">Mod</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/HTMLAnchorElement\">Anchor</a></code>\n, <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/Image\" class=\"new\">Image</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/HTMLObjectElement\">Object</a></code>\n, <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/Param\" class=\"new\">Param</a></code>\n, <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/Applet\" class=\"new\">Applet</a></code>\n, <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/Map\" class=\"new\">Map</a></code>\n, <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/Area\" class=\"new\">Area</a></code>\n, <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/Script\" class=\"new\">Script</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/HTMLTableElement\">Table</a></code>\n, <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/TableCaption\" class=\"new\">TableCaption</a></code>\n, <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/TableCol\" class=\"new\">TableCol</a></code>\n, <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/TableSection\" class=\"new\">TableSection</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/HTMLTableRowElement\">TableRow</a></code>\n, <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/TableCell\" class=\"new\">TableCell</a></code>\n, <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/FrameSet\" class=\"new\">FrameSet</a></code>\n, <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/Frame\" class=\"new\">Frame</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/HTMLIFrameElement\">IFrame</a></code>\n</p>","members":[{"url":"https://developer.mozilla.org/en/DOM/element.addEventListener","name":"addEventListener","help":" Register an event handler to a specific event type on the element.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Node.appendChild","name":"appendChild","help":" Insert a node as the last child node of this element.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.blur","name":"blur","help":" Removes keyboard focus from the current element.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.click","name":"click","help":" Simulates a click on the current element.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Node.cloneNode","name":"cloneNode","help":" Clone a node, and optionally, all of its contents.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Node.compareDocumentPosition","name":"compareDocumentPosition","help":"","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.dispatchEvent","name":"dispatchEvent","help":" Dispatch an event to this node in the DOM.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.focus","name":"focus","help":" Gives keyboard focus to the current element.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.getAttribute","name":"getAttribute","help":" Retrieve the value of the named attribute from the current node.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.getAttributeNS","name":"getAttributeNS","help":" Retrieve the value of the attribute with the specified name and namespace, from the current node.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.getAttributeNode","name":"getAttributeNode","help":" Retrieve the node representation of the named attribute from the current node.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.getAttributeNodeNS","name":"getAttributeNodeNS","help":" Retrieve the node representation of the attribute with the specified name and namespace, from the current node.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.getBoundingClientRect","name":"getBoundingClientRect","help":"","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Element.getElementsByClassName","name":"getElementsByClassName","help":"","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.getElementsByTagName","name":"getElementsByTagName","help":" Retrieve a set of all descendant elements, of a particular tag name, from the current element.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.getElementsByTagNameNS","name":"getElementsByTagNameNS","help":" Retrieve a set of all descendant elements, of a particular tag name and namespace, from the current element.","obsolete":false},{"url":"https://developer.mozilla.org/Article_not_found?uri=en/DOM/Node.getFeature","name":"getFeature","help":"","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Node.getUserData","name":"getUserData","help":"","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.hasAttribute","name":"hasAttribute","help":" Check if the element has the specified attribute, or not.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.hasAttributeNS","name":"hasAttributeNS","help":" Check if the element has the specified attribute, in the specified namespace, or not.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Node.hasAttributes","name":"hasAttributes","help":" Check if the element has any attributes, or not.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Node.hasChildNodes","name":"hasChildNodes","help":" Check if the element has any child nodes, or not.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Node.insertBefore","name":"insertBefore","help":" Inserts the first node before the second, child, Node in the DOM.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Node.isDefaultNamespace","name":"isDefaultNamespace","help":"","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Node.isEqualNode","name":"isEqualNode","help":"","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Node.isSameNode","name":"isSameNode","help":"","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Node.isSupported","name":"isSupported","help":"","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Node.lookupNamespaceURI","name":"lookupNamespaceURI","help":"","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Node.lookupPrefix","name":"lookupPrefix","help":"","obsolete":false},{"name":"webkitMatchesSelector","help":" Returns whether or not the element would be selected by the specified selector string.","obsolete":false},{"name":"webkitRequestFullScreen","help":" Asynchronously asks the browser to make the element full-screen.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Node.normalize","name":"normalize","help":" Clean up all the text nodes under this element (merge adjacent, remove empty).","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Element.querySelector","name":"querySelector","help":"","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Element.querySelectorAll","name":"querySelectorAll","help":"","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.removeAttribute","name":"removeAttribute","help":" Remove the named attribute from the current node.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.removeAttributeNS","name":"removeAttributeNS","help":" Remove the attribute with the specified name and namespace, from the current node.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.removeAttributeNode","name":"removeAttributeNode","help":" Remove the node representation of the named attribute from the current node.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Node.removeChild","name":"removeChild","help":" Removes a child node from the current element.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.removeEventListener","name":"removeEventListener","help":" Removes an event listener from the element.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Node.replaceChild","name":"replaceChild","help":" Replaces one child node in the current element with another.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.scrollIntoView","name":"scrollIntoView","help":" Scrolls the page until the element gets into the view.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.setAttribute","name":"setAttribute","help":" Set the value of the named attribute from the current node.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.setAttributeNS","name":"setAttributeNS","help":" Set the value of the attribute with the specified name and namespace, from the current node.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.setAttributeNode","name":"setAttributeNode","help":" Set the node representation of the named attribute from the current node.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.setAttributeNodeNS","name":"setAttributeNodeNS","help":" Set the node representation of the attribute with the specified name and namespace, from the current node.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.setCapture","name":"setCapture","help":" Sets up mouse event capture, redirecting all mouse events to this element.","obsolete":false},{"url":"https://developer.mozilla.org/Article_not_found?uri=en/DOM/element.setIdAttributeNS","name":"setIdAttributeNS","help":" Sets the attribute to be treated as an ID type attribute.","obsolete":false},{"url":"https://developer.mozilla.org/Article_not_found?uri=en/DOM/element.setIdAttributeNode","name":"setIdAttributeNode","help":" Sets the attribute to be treated as an ID type attribute.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Node.setUserData","name":"setUserData","help":"","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Element.insertAdjacentHTML","name":"insertAdjacentHTML","help":" Parses the text as HTML or XML and inserts the resulting nodes into the tree in the position given.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Node.attributes","name":"attributes","help":"All attributes associated with an element.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Node.baseURI","name":"baseURI","help":"Base URI as a string","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.baseURIObject","name":"baseURIObject","help":"The read-only <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsIURI\">nsIURI</a></code>\n object representing the base URI for the element.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Element.childElementCount","name":"childElementCount","help":"The number of child nodes that are elements.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Node.childNodes","name":"childNodes","help":"All child nodes of an element.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Element.children","name":"children","help":"A live <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/XPCOM_Interface_Reference/nsIDOMNodeList&amp;ident=nsIDOMNodeList\" class=\"new\">nsIDOMNodeList</a></code>\n of the current child elements.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.classList","name":"classList","help":"Token list of class attribute","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.className","name":"className","help":"Gets/sets the class of the element.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.clientHeight","name":"clientHeight","help":"The inner height of an element.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.clientLeft","name":"clientLeft","help":"The width of the left border of an element.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.clientTop","name":"clientTop","help":"The width of the top border of an element.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.clientWidth","name":"clientWidth","help":"The inner width of an element.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Element.contentEditable","name":"contentEditable","help":"Gets/sets whether or not the element is editable.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.dataset","name":"dataset","help":"Allows access to read and write custom data attributes on the element.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.dir","name":"dir","help":"Gets/sets the directionality of the element.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Node.firstChild","name":"firstChild","help":"The first direct child node of an element, or <code>null</code> if this element has no child nodes.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Element.firstElementChild","name":"firstElementChild","help":"The first direct child element of an element, or <code>null</code> if the element has no child elements.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.id","name":"id","help":"Gets/sets the id of the element.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.innerHTML","name":"innerHTML","help":"Gets/sets the markup of the element's content.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Element.isContentEditable","name":"isContentEditable","help":"Indicates whether or not the content of the element can be edited. Read only.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.lang","name":"lang","help":"Gets/sets the language of an element's attributes, text, and element contents.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Node.lastChild","name":"lastChild","help":"The last direct child node of an element, or <code>null</code> if this element has no child nodes.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Element.lastElementChild","name":"lastElementChild","help":"The last direct child element of an element, or <code>null</code> if the element has no child elements.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Node.localName","name":"localName","help":"The local part of the qualified name of an element. In Firefox 3.5 and earlier, the property upper-cases the local name for HTML&nbsp;elements (but not XHTML&nbsp;elements). In later versions, this does not happen, so the property is in lower case for both HTML&nbsp;and XHTML. \n<span title=\"(Firefox 3.6 / Thunderbird 3.1 / Fennec 1.0)\n\">Requires Gecko 1.9.2</span>","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.name","name":"name","help":"Gets/sets the name attribute of an element.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Node.namespaceURI","name":"namespaceURI","help":"The namespace URI of this node, or <code>null</code> if it is no namespace. In Firefox 3.5 and earlier, HTML&nbsp;elements are in no namespace. In later versions, HTML&nbsp;elements are in the <code><a class=\"linkification-ext external\" title=\"Linkification: http://www.w3.org/1999/xhtml\" rel=\"external\" href=\"http://www.w3.org/1999/xhtml\" target=\"_blank\">http://www.w3.org/1999/xhtml</a></code> namespace in both HTML&nbsp;and XML&nbsp;trees. \n<span title=\"(Firefox 3.6 / Thunderbird 3.1 / Fennec 1.0)\n\">Requires Gecko 1.9.2</span>","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Node.nextSibling","name":"nextSibling","help":"The node immediately following the given one in the tree, or <code>null</code> if there is no sibling node.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Element.nextElementSibling","name":"nextElementSibling","help":"The element immediately following the given one in the tree, or <code>null</code> if there's no sibling node.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Node.nodeName","name":"nodeName","help":"The name of the node.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Node.nodePrincipal","name":"nodePrincipal","help":"The node's principal.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Node.nodeType","name":"nodeType","help":"A number representing the type of the node. Is always equal to <code>1</code> for DOM elements.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Node.nodeValue","name":"nodeValue","help":"The value of the node. Is always equal to <code>null</code> for DOM elements.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.offsetHeight","name":"offsetHeight","help":"The height of an element, relative to the layout.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.offsetLeft","name":"offsetLeft","help":"The distance from this element's left border to its <code>offsetParent</code>'s left border.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.offsetParent","name":"offsetParent","help":"The element from which all offset calculations are currently computed.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.offsetTop","name":"offsetTop","help":"The distance from this element's top border to its <code>offsetParent</code>'s top border.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.offsetWidth","name":"offsetWidth","help":"The width of an element, relative to the layout.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.outerHTML","name":"outerHTML","help":"Gets the markup of the element including its content. When used as a setter, replaces the element with nodes parsed from the given string.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Node.ownerDocument","name":"ownerDocument","help":"The document that this node is in, or <code>null</code> if the node is not inside of one.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Node.parentNode","name":"parentNode","help":"The parent element of this node, or <code>null</code> if the node is not inside of a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/document\">DOM Document</a></code>\n.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Node.prefix","name":"prefix","help":"The namespace prefix of the node, or <code>null</code> if no prefix is specified.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Node.previousSibling","name":"previousSibling","help":"The node immediately preceding the given one in the tree, or <code>null</code> if there is no sibling node.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Element.previousElementSibling","name":"previousElementSibling","help":"The element immediately preceding the given one in the tree, or <code>null</code> if there is no sibling element.","obsolete":false},{"url":"https://developer.mozilla.org/Article_not_found?uri=en/DOM/element.schemaTypeInfo","name":"schemaTypeInfo","help":"Returns TypeInfo regarding schema information for the element (also available on <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Attr\">Attr</a></code>\n).","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.scrollHeight","name":"scrollHeight","help":"The scroll view height of an element.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.scrollLeft","name":"scrollLeft","help":"Gets/sets the left scroll offset of an element.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.scrollTop","name":"scrollTop","help":"Gets/sets the top scroll offset of an element.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.scrollWidth","name":"scrollWidth","help":"The scroll view width of an element.","obsolete":false},{"url":"https://developer.mozilla.org/en/XUL/Attribute/spellcheck","name":"spellcheck","help":"Controls <a title=\"en/Controlling_spell_checking_in_HTML_forms\" rel=\"internal\" href=\"https://developer.mozilla.org/en/HTML/Controlling_spell_checking_in_HTML_forms\">spell-checking</a> (present on all HTML&nbsp;elements)","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.style","name":"style","help":"An object representing the declarations of an element's style attributes.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.tabIndex","name":"tabIndex","help":"Gets/sets the position of the element in the tabbing order.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.tagName","name":"tagName","help":"The name of the tag for the given element.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Node.textContent","name":"textContent","help":"Gets/sets the textual contents of an element and all its descendants.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.title","name":"title","help":"A string that appears in a popup box when mouse is over the element.","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/DOM/element"},"SVGZoomEvent":{"title":"document.createEvent","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/document.createEvent","skipped":true,"cause":"Suspect title"},"Document":{"title":"document","summary":"<p>Each web page loaded in the browser has its own <strong>document</strong> object. This object serves as an entry point to the web page's content (the <a title=\"en/Using_the_W3C_DOM_Level_1_Core\" rel=\"internal\" href=\"https://developer.mozilla.org/en/Using_the_W3C_DOM_Level_1_Core\">DOM tree</a>, including elements such as <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/body\">&lt;body&gt;</a></code>\n and <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/table\">&lt;table&gt;</a></code>\n) and provides functionality global to the document (such as obtaining the page's URL and creating new elements in the document).</p>\n<p>A document object can be obtained from various APIs:</p>\n<ul> <li>Most commonly, you work with the document the script is running in by using <code>document</code> in document's <a title=\"en/HTML/Element/Script\" rel=\"internal\" href=\"https://developer.mozilla.org/En/HTML/Element/Script\">scripts</a>. (The same document can also be referred to as <a title=\"window.document\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/window.document\"><code>window.document</code></a>.)</li> <li>The document of an iframe via the iframe's <code><a title=\"en/DOM/HTMLIFrameElement#Properties\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/HTMLIFrameElement#Properties\">contentDocument</a></code> property.</li> <li>The <a title=\"en/XMLHttpRequest#Attributes\" rel=\"internal\" href=\"https://developer.mozilla.org/en/nsIXMLHttpRequest#Attributes\"><code>responseXML</code> of an <code>XMLHttpRequest</code> object</a>.</li> <li>The document, that given node or element belongs to, can be retrieved using the node's <code><a title=\"en/DOM/Node.ownerDocument\" rel=\"internal\" href=\"https://developer.mozilla.org/En/DOM/Node.ownerDocument\">ownerDocument</a></code> property.</li> <li>...and more.</li>\n</ul>\n<p>Depending on the kind of the document (e.g. <a title=\"en/HTML\" rel=\"internal\" href=\"https://developer.mozilla.org/en/HTML\">HTML</a> or <a title=\"en/XML\" rel=\"internal\" href=\"https://developer.mozilla.org/en/XML\">XML</a>) different APIs may be available on the document object. This theoretical availability of APIs is usually described in terms of <em>implementing interfaces</em> defined in the relevant W3C DOM specifications:</p>\n<ul> <li>All document objects implement the DOM Core <a class=\"external\" rel=\"external\" href=\"http://www.w3.org/TR/DOM-Level-2-Core/core.html#i-Document\" title=\"http://www.w3.org/TR/DOM-Level-2-Core/core.html#i-Document\" target=\"_blank\"><code>Document</code></a> and <code><a title=\"en/DOM/Node\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/Node\">Node</a></code> interfaces, meaning that the \"core\" properties and methods are available for all kinds of documents.</li> <li>In addition to the generalized DOM Core document interface, HTML documents also implement the <code><a class=\"external\" rel=\"external\" href=\"http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-26809268\" title=\"http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-26809268\" target=\"_blank\">HTMLDocument</a></code> interface, which is a more specialized interface for dealing with HTML documents (e.g., <a title=\"en/DOM/document.cookie\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/document.cookie\">document.cookie</a>, <a title=\"en/DOM/document.alinkColor\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/document.alinkColor\">document.alinkColor</a>).</li> <li><a title=\"en/XUL\" rel=\"internal\" href=\"https://developer.mozilla.org/en/XUL\">XUL</a> documents (available to Mozilla add-on and application developers) implement their own additions to the core Document functionality.</li>\n</ul>\n<p>Methods or properties listed here that are part of a more specialized interface have an asterisk (*) next to them and have additional information in the&nbsp; Availability column.</p>\n<p>Note that some APIs listed below are not available in all browsers for various reasons:</p>\n<ul> <li><strong>Obsolete</strong>: on its way of being removed from supporting browsers.</li> <li><strong>Non-standard</strong>: either an experimental feature not (yet?) agreed upon by all vendors, or a feature targeted specifically at the code running in a specific browser (e.g. Mozilla has a few DOM APIs created for its add-ons and application development).</li> <li>Part of a completed or an emerging standard, but not (yet?) implemented in all browsers or implemented in the newest versions of the browsers.</li>\n</ul>\n<p>Detailed browser compatibility tables are located at the pages describing each property or method.</p>","members":[{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/document.getElementById","name":"getElementById","help":"Returns an object reference to the identified element."},{"obsolete":false,"url":"https://developer.mozilla.org/Article_not_found?uri=en/DOM/document.captureEvents","name":"captureEvents","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/Article_not_found?uri=en/DOM/document.routeEvent","name":"routeEvent","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/Article_not_found?uri=en/DOM/document.queryCommandIndeterm","name":"queryCommandIndeterm","help":"Returns true if the <a title=\"en/Midas\" rel=\"internal\" href=\"https://developer.mozilla.org/en/Midas\">Midas</a> command is in a indeterminate state on the current range."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/document.createEvent","name":"createEvent","help":"Creates an event."},{"obsolete":false,"url":"https://developer.mozilla.org/Article_not_found?uri=en/DOM/document.execCommandShowHelp","name":"execCommandShowHelp","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/document.createDocumentFragment","name":"createDocumentFragment","help":"Creates a new document fragment."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/document.elementFromPoint","name":"elementFromPoint","help":"Returns the element visible at the specified coordinates."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/document.load","name":"load","help":"Load an XML document"},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/document.getElementsByTagName","name":"getElementsByTagName","help":"Returns a list of elements with the given tag name."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/document.getBoxObjectFor","name":"getBoxObjectFor","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/Article_not_found?uri=en/DOM/document.createAttributeNS","name":"createAttributeNS","help":"Creates a new attribute node in a given namespace and returns it."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/document.getElementsByClassName","name":"getElementsByClassName","help":"Returns a list of elements with the given class name."},{"obsolete":false,"url":"https://developer.mozilla.org/Article_not_found?uri=en/DOM/document.normalizeDocument","name":"normalizeDocument","help":"Replaces entities, normalizes text nodes, etc."},{"obsolete":false,"url":"https://developer.mozilla.org/Article_not_found?uri=en/DOM/document.queryCommandState","name":"queryCommandState","help":"Returns true if the <a title=\"en/Midas\" rel=\"internal\" href=\"https://developer.mozilla.org/en/Midas\">Midas</a> command has been executed on the current range."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/document.queryCommandSupported","name":"queryCommandSupported","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/document.hasFocus","name":"hasFocus","help":"Returns <code>true</code> if the focus is currently located anywhere inside the specified document."},{"obsolete":false,"url":"https://developer.mozilla.org/Article_not_found?uri=en/DOM/document.queryCommandText","name":"queryCommandText","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/Article_not_found?uri=en/DOM/document.releaseEvents","name":"releaseEvents","help":"<dt><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Node.removeChild\">Node.removeChild</a></code>\n</dt> <dd>Removes a child node from the DOM</dd>"},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/document.importNode","name":"importNode","help":"<dd>Returns a clone of a node from an external document</dd> <dt><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Node.insertBefore\">Node.insertBefore</a></code>\n</dt> <dd>Inserts the specified node before a reference node as a child of the current node.</dd> <dt><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Node.isDefaultNamespace\">Node.isDefaultNamespace</a></code>\n</dt> <dd>Returns true if the namespace is the default namespace on the given node</dd> <dt><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Node.isEqualNode\">Node.isEqualNode</a></code>\n</dt> <dd>Indicates whether the node is equal to the given node</dd> <dt><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Node.isSameNode\">Node.isSameNode</a></code>\n</dt> <dd>Indicates whether the node is the same as the given node</dd> <dt><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Node.isSupported\">Node.isSupported</a></code>\n</dt> <dd>Tests whether the DOM implementation implements a specific feature and that feature is supported by this node or document</dd>"},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/document.write","name":"write","help":"Writes text to a document."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/document.releaseCapture","name":"releaseCapture","help":"Releases the current mouse capture if it's on an element in this document."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/document.evaluate","name":"evaluate","help":"Evaluates an XPath expression."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/document.createTextNode","name":"createTextNode","help":"Creates a text node."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/document.querySelector","name":"querySelector","help":"Returns the first Element node within the document, in document order, that matches the specified selectors."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/document.createExpression","name":"createExpression","help":"Compiles an <code><a title=\"en/XPathExpression\" rel=\"internal\" href=\"https://developer.mozilla.org/en/XPathExpression\">XPathExpression</a></code> which can then be used for (repeated) evaluations."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/document.createElement","name":"createElement","help":"Creates a new element with the given tag name."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/document.createCDATASection","name":"createCDATASection","help":"Creates a new CDATA node and returns it."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/document.createComment","name":"createComment","help":"Creates a new comment node and returns it."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/document.adoptNode","name":"adoptNode","help":"<dd>Adopt node from an external document</dd> <dt><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Node.appendChild\">Node.appendChild</a></code>\n</dt> <dd>Adds a node to the end of the list of children of a specified parent node.</dd>"},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/document.createAttribute","name":"createAttribute","help":"Creates a new attribute node and returns it."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/document.querySelectorAll","name":"querySelectorAll","help":"Returns a list of all the Element nodes within the document that match the specified selectors."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/document.createElementNS","name":"createElementNS","help":"Creates a new element with the given tag name and namespace URI."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/document.createEntityReference","name":"createEntityReference","help":"Creates a new entity reference object and returns it."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/document.open","name":"open","help":"Opens a document stream for writing."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/document.createProcessingInstruction","name":"createProcessingInstruction","help":"Creates a new processing instruction element and returns it."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/document.createTreeWalker","name":"createTreeWalker","help":"Creates a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/treeWalker\">treeWalker</a></code>\n object."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/document.getElementsByName","name":"getElementsByName","help":"Returns a list of elements with the given name."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/document.close","name":"close","help":"<dd>Closes a document stream for writing.</dd> <dt><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Node.compareDocumentPosition\">Node.compareDocumentPosition</a></code>\n</dt> <dd>Compares the position of the current node against another node in any other document.</dd>"},{"name":"webkitSetImageElement","help":"<dd>Allows you to change the element being used as the background image for a specified element ID.</dd> <dt><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Node.setUserData\">Node.setUserData</a></code>\n</dt> <dd>Attaches arbitrary data to a node, along with a user-defined key and an optional handler to be triggered upon events such as cloning of the node upon which the data was attached</dd>","obsolete":false},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/document.writeln","name":"writeln","help":"Write a line of text to a document."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/document.createNSResolver","name":"createNSResolver","help":"Creates an XPathNSResolver."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/document.enableStyleSheetsForSet","name":"enableStyleSheetsForSet","help":"Enables the style sheets for the specified style sheet set."},{"obsolete":false,"url":"https://developer.mozilla.org/Article_not_found?uri=en/DOM/document.removeEventListener","name":"removeEventListener","help":"<dd>Removes an event listener from the document</dd> <dt><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Node.replaceChild\">Node.replaceChild</a></code>\n</dt> <dd>Replaces one child node of the specified node with another</dd>"},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/document.loadOverlay","name":"loadOverlay","help":"<dd>Loads a <a title=\"en/XUL_Overlays\" rel=\"internal\" href=\"https://developer.mozilla.org/en/XUL_Overlays\">XUL overlay</a> dynamically. This only works in XUL documents.</dd> <dt><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Node.lookupNamespaceURI\">Node.lookupNamespaceURI</a></code>\n</dt> <dd>Returns the namespaceURI associated with a given prefix on the given node object</dd> <dt><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Node.lookupPrefix\">Node.lookupPrefix</a></code>\n</dt> <dd>Returns the prefix for a given namespaceURI on the given node if present</dd> <dt><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Node.normalize\">Node.normalize</a></code>\n</dt> <dd>Normalizes the node or document</dd>"},{"obsolete":false,"url":"https://developer.mozilla.org/en/Rich-Text_Editing_in_Mozilla#Executing_Commands","name":"execCommand","help":"Executes a <a title=\"en/Midas\" rel=\"internal\" href=\"https://developer.mozilla.org/en/Midas\">Midas</a> command."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/document.clear","name":"clear","help":"<dd>In majority of modern browsers, including recent versions of Firefox and Internet Explorer, this method does nothing.</dd> <dt><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Node.cloneNode\">Node.cloneNode</a></code>\n</dt> <dd>Makes a copy of a node or document</dd>"},{"obsolete":false,"url":"https://developer.mozilla.org/Article_not_found?uri=en/DOM/document.queryCommandValue","name":"queryCommandValue","help":"Returns the current value of the current range for <a title=\"en/Midas\" rel=\"internal\" href=\"https://developer.mozilla.org/en/Midas\">Midas</a> command. As of Firefox 2.0.0.2, queryCommandValue will return an empty string when a command value has not been explicitly set."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/document.getSelection","name":"getSelection","help":"<dd>Returns a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Selection\">Selection</a></code>\n object related to text selected in the document.</dd> <dt><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Node.getUserData\">Node.getUserData</a></code>\n</dt> <dd>Returns any data previously set on the node via setUserData() by key</dd> <dt><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Node.hasAttributes\">Node.hasAttributes</a></code>\n</dt> <dd>Indicates whether the node possesses attributes</dd> <dt><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Node.hasChildNodes\">Node.hasChildNodes</a></code>\n</dt> <dd>Returns a Boolean value indicating whether the current element has child nodes or not.</dd>"},{"obsolete":false,"url":"https://developer.mozilla.org/Article_not_found?uri=en/DOM/document.queryCommandEnabled","name":"queryCommandEnabled","help":"Returns true if the <a title=\"en/Midas\" rel=\"internal\" href=\"https://developer.mozilla.org/en/Midas\">Midas</a> command can be executed on the current range."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/document.getElementsByTagNameNS","name":"getElementsByTagNameNS","help":"<dd>Returns a list of elements with the given tag name and namespace.</dd> <dt><code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/Node.getFeature\" class=\"new\">Node.getFeature</a></code>\n</dt>"},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/document.createRange","name":"createRange","help":"Creates a Range object."},{"url":"https://developer.mozilla.org/en/DOM/document.activeElement","name":"activeElement","help":"Returns the currently focused element","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/document.alinkColor","name":"alinkColor","help":"Returns or sets the color of active links in the document body.","obsolete":true},{"url":"https://developer.mozilla.org/En/DOM/document.all","name":"all","help":"","obsolete":true},{"url":"https://developer.mozilla.org/en/DOM/document.anchors","name":"anchors","help":"Returns a list of all of the anchors in the document.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/document.applets","name":"applets","help":"Returns an ordered list of the applets within a document.","obsolete":true},{"url":"https://developer.mozilla.org/en/DOM/document.async","name":"async","help":"Used with <a title=\"en/DOM/document.load\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/document.load\">document.load</a> to indicate an asynchronous request.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/document.baseURIObject","name":"baseURIObject","help":"(<span>Mozilla</span><strong> add-ons only!</strong>) Returns an <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsIURI\">nsIURI</a></code>\n object representing the base URI for the document.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/document.bgColor","name":"bgColor","help":"Gets/sets the background color of the current document.","obsolete":true},{"url":"https://developer.mozilla.org/en/DOM/document.body","name":"body","help":"Returns the BODY node of the current document.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/document.characterSet","name":"characterSet","help":"Returns the character set being used by the document.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/document.compatMode","name":"compatMode","help":"Indicates whether the document is rendered in Quirks or Strict mode.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/document.contentType","name":"contentType","help":"Returns the Content-Type from the MIME Header of the current document.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/document.cookie","name":"cookie","help":"Returns a semicolon-separated list of the cookies for that document or sets a single cookie.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/document.currentScript","name":"currentScript","help":"Returns the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/script\">&lt;script&gt;</a></code>\n element that is currently executing.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/document.defaultView","name":"defaultView","help":"Returns a reference to the window object.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/document.designMode","name":"designMode","help":"Gets/sets WYSYWIG editing capability of <a title=\"en/Midas\" rel=\"internal\" href=\"https://developer.mozilla.org/en/Midas\">Midas</a>. It can only be used for HTML documents.","obsolete":false},{"url":"https://developer.mozilla.org/En/DOM/Document.dir","name":"dir","help":"Gets/sets directionality (rtl/ltr) of the document","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/document.doctype","name":"doctype","help":"Returns the Document Type Definition (DTD) of the current document.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/document.documentElement","name":"documentElement","help":"Returns the Element that is a direct child of document. For HTML documents, this is normally the HTML element.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/document.documentURI","name":"documentURI","help":"Returns the document location.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/document.documentURIObject","name":"documentURIObject","help":"(<strong>Mozilla add-ons only!</strong>) Returns the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsIURI\">nsIURI</a></code>\n object representing the URI of the document. This property only has special meaning in privileged JavaScript code (with UniversalXPConnect privileges).","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/document.domain","name":"domain","help":"Returns the domain of the current document.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/document.embeds","name":"embeds","help":"Returns a list of the embedded OBJECTS within the current document.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/document.fgColor","name":"fgColor","help":"Gets/sets the foreground color, or text color, of the current document.","obsolete":true},{"name":"fileSize","help":"(<strong>IE-only!</strong>) Returns size in bytes of the document. See <a class=\"external\" title=\"http://msdn.microsoft.com/en-us/library/ms533752%28v=VS.85%29.aspx\" rel=\"external\" href=\"http://msdn.microsoft.com/en-us/library/ms533752%28v=VS.85%29.aspx\" target=\"_blank\">MSDN</a>.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/document.forms","name":"forms","help":"Returns a list of the FORM elements within the current document.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/document.head","name":"head","help":"Returns the HEAD node of the current document.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/document.height","name":"height","help":"Gets/sets the height of the current document.","obsolete":true},{"url":"https://developer.mozilla.org/en/DOM/document.images","name":"images","help":"Returns a list of the images in the current document.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/document.implementation","name":"implementation","help":"Returns the DOM implementation associated with the current document.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/document.inputEncoding","name":"inputEncoding","help":"Returns the encoding used when the document was parsed.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/document.lastModified","name":"lastModified","help":"Returns the date on which the document was last modified.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/document.lastStyleSheetSet","name":"lastStyleSheetSet","help":"Returns the name of the style sheet set that was last enabled. Has the value <code>null</code> until the style sheet is changed by setting the value of <code>selectedStyleSheetSet</code>.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/document.linkColor","name":"linkColor","help":"Gets/sets the color of hyperlinks in the document.","obsolete":true},{"url":"https://developer.mozilla.org/en/DOM/document.links","name":"links","help":"Returns a list of all the hyperlinks in the document.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/document.location","name":"location","help":"Returns the URI of the current document.","obsolete":false},{"name":"webkitSyntheticDocument","help":"<code>true</code> if this document is synthetic, such as a standalone image, video, audio file, or the like.","obsolete":false},{"name":"webkitFullScreen","help":"<code>true</code> when the document is in <a title=\"en/DOM/Using full-screen mode\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/Using_full-screen_mode\">full-screen mode</a>.","obsolete":false},{"name":"webkitFullScreenElement","help":"The element that's currently in full screen mode for this document.","obsolete":false},{"name":"webkitFullScreenEnabled","help":"<code>true</code> if calling <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/element.mozRequestFullscreen\">element.mozRequestFullscreen()</a></code>\n would succeed in the curent document.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/document.plugins","name":"plugins","help":"Returns a list of the available plugins.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/document.popupNode","name":"popupNode","help":"Returns the node upon which a popup was invoked (XUL documents only).","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/document.preferredStyleSheetSet","name":"preferredStyleSheetSet","help":"Returns the preferred style sheet set as specified by the page author.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/document.readyState","name":"readyState","help":"Returns loading status of the document","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/document.referrer","name":"referrer","help":"Returns the URI of the page that linked to this page.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/document.scripts","name":"scripts","help":"Returns all the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/script\">&lt;script&gt;</a></code>\n elements on the document.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/document.selectedStyleSheetSet","name":"selectedStyleSheetSet","help":"Returns which style sheet set is currently in use.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/document.styleSheets","name":"styleSheets","help":"Returns a list of the stylesheet objects on the current document.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/document.styleSheetSets","name":"styleSheetSets","help":"Returns a list of the style sheet sets available on the document.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/document.title","name":"title","help":"Returns the title of the current document.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/document.tooltipNode","name":"tooltipNode","help":"Returns the node which is the target of the current tooltip.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/document.URL","name":"URL","help":"Returns a string containing the URL of the current document.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/document.vlinkColor","name":"vlinkColor","help":"Gets/sets the color of visited hyperlinks.","obsolete":true},{"url":"https://developer.mozilla.org/en/DOM/document.width","name":"width","help":"Returns the width of the current document.","obsolete":true},{"url":"https://developer.mozilla.org/En/DOM/Document.xmlEncoding","name":"xmlEncoding","help":"Returns the encoding as determined by the XML declaration.<br> <div class=\"note\">Firefox 10 and later don't implement it anymore.</div>","obsolete":true},{"url":"https://developer.mozilla.org/en/DOM/document.xmlStandalone","name":"xmlStandalone","help":"Returns <code>true</code> if the XML declaration specifies the document is standalone (<em>e.g.,</em> An external part of the DTD affects the document's content), else <code>false</code>.","obsolete":true},{"url":"https://developer.mozilla.org/en/DOM/document.xmlVersion","name":"xmlVersion","help":"Returns the version number as specified in the XML declaration or <code>\"1.0\"</code> if the declaration is absent.","obsolete":true},{"obsolete":false,"url":"https://developer.mozilla.org/Article_not_found?uri=en/DOM/document.ononline","name":"ononline","help":"Returns the event handling code for the <code>online</code> event."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/document.onreadystatechange","name":"onreadystatechange","help":"<dl><dd>Returns the event handling code for the <code>readystatechange</code> event.</dd>\n</dl>\n<div class=\"geckoVersionNote\"> <p>\n</p><div class=\"geckoVersionHeading\">Gecko 9.0 note<div>(Firefox 9.0 / Thunderbird 9.0 / SeaMonkey 2.6)\n</div></div>\n<p></p> <p>Starting in Gecko 9.0 (Firefox 9.0 / Thunderbird 9.0 / SeaMonkey 2.6)\n, you can now use the syntax <code>if (\"onabort\" in document)</code> to determine whether or not a given event handler property exists. This is because event handler interfaces have been updated to be proper web IDL interfaces. See <a title=\"en/DOM/DOM event handlers\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/DOM_event_handlers\">DOM event handlers</a> for details.</p>\n</div>"},{"obsolete":false,"url":"https://developer.mozilla.org/Article_not_found?uri=en/DOM/document.onoffline","name":"onoffline","help":"Returns the event handling code for the <code>offline</code> event."}],"srcUrl":"https://developer.mozilla.org/en/DOM/document","specification":"http://www.w3.org/TR/DOM-Level-3-Cor...tml#i-Document"},"SVGPathSeg":{"title":"User talk:Jeff Schiller","members":[],"srcUrl":"https://developer.mozilla.org/User_talk:Jeff_Schiller","skipped":true,"cause":"Suspect title"},"HTMLHtmlElement":{"title":"HTMLHtmlElement","seeAlso":"<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/html\">&lt;html&gt;</a></code>\n HTML&nbsp;element","summary":"<p>The <code>html</code> object exposes the <a class=\" external\" title=\"http://www.w3.org/TR/html5/semantics.html#htmlhtmlelement\" rel=\"external\" href=\"http://www.w3.org/TR/html5/semantics.html#htmlhtmlelement\" target=\"_blank\">HTMLHtmlElement</a> (\n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML\">HTML 4</a></span> <a target=\"_blank\" class=\"external\" rel=\"external\" href=\"http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-33759296\" title=\"http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-33759296\">HTMLHtmlElement</a>) interface and serves as the root node for a given HTML&nbsp;document.&nbsp; This object inherits the properties and methods described in the <a title=\"en/DOM/element\" class=\"internal\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/element\">element</a> section.&nbsp; In \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span>, this interface inherits from HTMLElement, but provides no other members.</p>\n<p>You can retrieve the <code>html</code> object for a document by obtaining the value of the <a class=\"internal\" title=\"en/DOM/document.documentElement\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/document.documentElement\"><code>document.documentElement</code></a> property.</p>","members":[{"name":"version","help":"Version of the HTML&nbsp;Document Type Definition that governs this document.","obsolete":true}],"srcUrl":"https://developer.mozilla.org/En/DOM/Html"},"HTMLStyleElement":{"title":"HTMLStyleElement","seeAlso":"<li><a title=\"en/DOM/element.style\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/element.style\">DOM element.style Object</a></li> <li><a title=\"en/DOM/stylesheet\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/stylesheet\">DOM stylesheet Object</a></li> <li><a title=\"en/DOM/cssRule\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/cssRule\">DOM cssRule Object</a></li> <li><a title=\"en/DOM/CSS\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/CSS\">DOM CSS Properties List</a></li> <li><a title=\"http://www.whatwg.org/html/#the-style-element\" class=\" external\" rel=\"external\" href=\"http://www.whatwg.org/html/#the-style-element\" target=\"_blank\">The <code>style</code> element in the HTML specification</a></li>","summary":"See <a title=\"en/DOM/Using_dynamic_styling_information\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/Using_dynamic_styling_information\">Using dynamic styling information</a> for an overview of the objects used to manipulate specified CSS properties using the DOM.","members":[{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/style.media","name":"media","help":"Specifies the intended destination medium for style information."},{"obsolete":false,"url":"https://developer.mozilla.org/En/DOM/style.disabled","name":"disabled","help":"Returns true if the stylesheet is disabled, and false if not"},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/style.type","name":"type","help":"Returns the type of style being applied by this statement."}],"srcUrl":"https://developer.mozilla.org/en/DOM/HTMLStyleElement"},"ClientRect":{"title":"nsIDOMClientRect","seeAlso":"<a rel=\"custom\" href=\"http://www.w3.org/TR/cssom-view/#the-clientrect-interface\">CSSOM View Module : The ClientRect Interface</a><span title=\"Working Draft\">WD</span>","summary":"<div>\n\n<a rel=\"custom\" href=\"http://mxr.mozilla.org/mozilla-central/source/dom/interfaces/base/nsIDOMClientRect.idl\"><code>dom/interfaces/base/nsIDOMClientRect.idl</code></a><span><a rel=\"internal\" href=\"https://developer.mozilla.org/en/Interfaces/About_Scriptable_Interfaces\" title=\"en/Interfaces/About_Scriptable_Interfaces\">Scriptable</a></span></div><span>Represents a rectangular box. The type of box is specified by the method that returns such an object. It is returned by functions like <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/element.getBoundingClientRect\">element.getBoundingClientRect</a></code>\n.</span><div><div>1.0</div><div>11.0</div><div></div><div>Introduced</div><div>Gecko 1.9</div><div title=\"Introduced in Gecko 1.9 (Firefox 3)\n\"></div><div title=\"Last changed in Gecko 1.9.1 (Firefox 3)\n\"></div></div>\n<div>Inherits from: <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsISupports\">nsISupports</a></code>\n<span>Last changed in Gecko 1.9.1 (Firefox 3.5 / Thunderbird 3.0 / SeaMonkey 2.0)\n</span></div>","members":[{"name":"bottom","help":"Y-coordinate, relative to the viewport origin, of the bottom of the rectangle box. <strong>Read only.</strong>","obsolete":false},{"name":"height","help":"Height of the rectangle box (This is identical to <code>bottom</code> minus <code>top</code>). <strong>Read only.</strong>","obsolete":false},{"name":"left","help":"X-coordinate, relative to the viewport origin, of the left of the rectangle box. <strong>Read only.</strong>","obsolete":false},{"name":"right","help":"X-coordinate, relative to the viewport origin, of the right of the rectangle box. <strong>Read only.</strong>","obsolete":false},{"name":"top","help":"Y-coordinate, relative to the viewport origin, of the top of the rectangle box. <strong>Read only.</strong>","obsolete":false},{"name":"width","help":"Width of the rectangle box (This is identical to <code>right</code> minus <code>left</code>). <strong>Read only.</strong> \n<span title=\"(Firefox 3.5 / Thunderbird 3.0 / SeaMonkey 2.0)\n\">Requires Gecko 1.9.1</span>","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsIDOMClientRect"},"SVGPathSegLinetoAbs":{"title":"SVGPathElement","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/SVGPathElement","skipped":true,"cause":"Suspect title"},"XMLSerializer":{"title":"XMLSerializer","seeAlso":"<li><a title=\"en/Parsing_and_serializing_XML\" rel=\"internal\" href=\"https://developer.mozilla.org/en/Parsing_and_serializing_XML\">Parsing and serializing XML</a></li> <li><a title=\"en/XMLHttpRequest\" rel=\"internal\" href=\"https://developer.mozilla.org/en/XMLHttpRequest\">XMLHttpRequest</a></li> <li><a title=\"en/DOMParser\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOMParser\">DOMParser</a></li>","summary":"<div dir=\"ltr\" id=\"result_box\">XMLSerializer can be used to convert DOM subtree or DOM document into text. XMLSerializer is available to unprivileged scripts.</div>\n<p><code> </code></p>\n<div class=\"note\">\n<div dir=\"ltr\">XMLSerializer is mainly useful for applications and extensions based on the Mozilla platform. While it is available for web pages, it's not part of any standard and level of support in other browsers unknown.</div>\n<div id=\"result_box\" dir=\"ltr\">&nbsp;</div>\n</div>","members":[{"name":"serializeToString","help":"<div dir=\"ltr\" id=\"serializeToString\" class=\"\">\n&nbsp;&nbsp;&nbsp;&nbsp; Returns the serialized subtree of a string.\n<dt></dt>\n</div>\n<div dir=\"ltr\" id=\"serializeToStream\"><strong>serializeToStream </strong></div>\n<div dir=\"ltr\">&nbsp;&nbsp;&nbsp;&nbsp; The subtree rooted by the specified element is serialized to a byte stream using the character set specified.&nbsp;&nbsp;&nbsp;&nbsp;</div>\n<div dir=\"ltr\" id=\"Example\"><span>Example</span></div>\n\n          <pre name=\"code\" class=\"js\">var s = new XMLSerializer();\n var d = document;\n var str = s.serializeToString(d);\n alert(str);</pre>\n        \n\n          <pre name=\"code\" class=\"js\">var s = new XMLSerializer();\n var stream = {\n   close : function()\n   {\n     alert(\"Stream closed\");\n   },\n   flush : function()\n   {\n   },\n   write : function(string, count)\n   {\n     alert(\"'\" + string + \"'\\n bytes count: \" + count + \"\");\n   }\n };\n s.serializeToStream(document, stream, \"UTF-8\");</pre>","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/XMLSerializer"},"Element":{"title":"element","summary":"<p>This chapter provides a brief reference for the general methods, properties, and events available to most HTML and XML elements in the Gecko DOM.</p>\n<p>Various W3C specifications apply to elements:</p>\n<ul> <li><a class=\"external\" rel=\"external\" href=\"http://www.w3.org/TR/DOM-Level-2-Core/\" title=\"http://www.w3.org/TR/DOM-Level-2-Core/\" target=\"_blank\">DOM Core Specification</a>—describes the core interfaces shared by most DOM objects in HTML and XML documents</li> <li><a class=\"external\" rel=\"external\" href=\"http://www.w3.org/TR/DOM-Level-2-HTML/\" title=\"http://www.w3.org/TR/DOM-Level-2-HTML/\" target=\"_blank\">DOM HTML Specification</a>—describes interfaces for objects in HTML and XHTML documents that build on the core specification</li> <li><a class=\"external\" rel=\"external\" href=\"http://www.w3.org/TR/DOM-Level-2-Events/\" title=\"http://www.w3.org/TR/DOM-Level-2-Events/\" target=\"_blank\">DOM Events Specification</a>—describes events shared by most DOM objects, building on the DOM Core and <a class=\"external\" rel=\"external\" href=\"http://www.w3.org/TR/DOM-Level-2-Views/\" title=\"http://www.w3.org/TR/DOM-Level-2-Views/\" target=\"_blank\">Views</a> specifications</li> <li><a class=\"external\" title=\"http://www.w3.org/TR/ElementTraversal/\" rel=\"external\" href=\"http://www.w3.org/TR/ElementTraversal/\" target=\"_blank\">Element Traversal Specification</a>—describes the new attributes that allow traversal of elements in the DOM&nbsp;tree \n<span>New in <a rel=\"custom\" href=\"https://developer.mozilla.org/en/Firefox_3.5_for_developers\">Firefox 3.5</a></span>\n</li>\n</ul>\n<p>The articles listed here span the above and include links to the appropriate W3C DOM specification.</p>\n<p>While these interfaces are generally shared by most HTML and XML elements, there are more specialized interfaces for particular objects listed in the DOM HTML Specification. Note, however, that these HTML&nbsp;interfaces are \"only for [HTML 4.01] and [XHTML 1.0] documents and are not guaranteed to work with any future version of XHTML.\" The HTML 5 draft does state it aims for backwards compatibility with these HTML&nbsp;interfaces but says of them that \"some features that were formerly deprecated, poorly supported, rarely used or considered unnecessary have been removed.\" One can avoid the potential conflict by moving entirely to DOM&nbsp;XML attribute methods such as <code>getAttribute()</code>.</p>\n<p><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/HTMLHtmlElement\">Html</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/HTMLHeadElement\">Head</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/HTMLLinkElement\">Link</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/HTMLTitleElement\">Title</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/HTMLMetaElement\">Meta</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/HTMLBaseElement\">Base</a></code>\n, <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/HTMLIsIndexElement\" class=\"new\">IsIndex</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/HTMLStyleElement\">Style</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/HTMLBodyElement\">Body</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/HTMLFormElement\">Form</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/HTMLSelectElement\">Select</a></code>\n, <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/HTMLOptGroupElement\" class=\"new\">OptGroup</a></code>\n, <a title=\"en/HTML/Element/HTMLOptionElement\" rel=\"internal\" href=\"https://developer.mozilla.org/en/HTML/Element/HTMLOptionElement\" class=\"new \">Option</a>, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/HTMLInputElement\">Input</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/HTMLTextAreaElement\">TextArea</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/HTMLButtonElement\">Button</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/HTMLLabelElement\">Label</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/HTMLFieldSetElement\">FieldSet</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/HTMLLegendElement\">Legend</a></code>\n, <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/HTMLUListElement\" class=\"new\">UList</a></code>\n, <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/OList\" class=\"new\">OList</a></code>\n, <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/DList\" class=\"new\">DList</a></code>\n, <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/Directory\" class=\"new\">Directory</a></code>\n, <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/Menu\" class=\"new\">Menu</a></code>\n, <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/LI\" class=\"new\">LI</a></code>\n, <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/Div\" class=\"new\">Div</a></code>\n, <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/Paragraph\" class=\"new\">Paragraph</a></code>\n, <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/Heading\" class=\"new\">Heading</a></code>\n, <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/Quote\" class=\"new\">Quote</a></code>\n, <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/Pre\" class=\"new\">Pre</a></code>\n, <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/BR\" class=\"new\">BR</a></code>\n, <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/BaseFont\" class=\"new\">BaseFont</a></code>\n, <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/Font\" class=\"new\">Font</a></code>\n, <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/HR\" class=\"new\">HR</a></code>\n, <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/Mod\" class=\"new\">Mod</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/HTMLAnchorElement\">Anchor</a></code>\n, <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/Image\" class=\"new\">Image</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/HTMLObjectElement\">Object</a></code>\n, <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/Param\" class=\"new\">Param</a></code>\n, <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/Applet\" class=\"new\">Applet</a></code>\n, <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/Map\" class=\"new\">Map</a></code>\n, <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/Area\" class=\"new\">Area</a></code>\n, <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/Script\" class=\"new\">Script</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/HTMLTableElement\">Table</a></code>\n, <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/TableCaption\" class=\"new\">TableCaption</a></code>\n, <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/TableCol\" class=\"new\">TableCol</a></code>\n, <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/TableSection\" class=\"new\">TableSection</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/HTMLTableRowElement\">TableRow</a></code>\n, <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/TableCell\" class=\"new\">TableCell</a></code>\n, <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/FrameSet\" class=\"new\">FrameSet</a></code>\n, <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/Frame\" class=\"new\">Frame</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/HTMLIFrameElement\">IFrame</a></code>\n</p>","members":[{"url":"https://developer.mozilla.org/en/DOM/element.addEventListener","name":"addEventListener","help":" Register an event handler to a specific event type on the element.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Node.appendChild","name":"appendChild","help":" Insert a node as the last child node of this element.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.blur","name":"blur","help":" Removes keyboard focus from the current element.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.click","name":"click","help":" Simulates a click on the current element.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Node.cloneNode","name":"cloneNode","help":" Clone a node, and optionally, all of its contents.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Node.compareDocumentPosition","name":"compareDocumentPosition","help":"","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.dispatchEvent","name":"dispatchEvent","help":" Dispatch an event to this node in the DOM.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.focus","name":"focus","help":" Gives keyboard focus to the current element.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.getAttribute","name":"getAttribute","help":" Retrieve the value of the named attribute from the current node.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.getAttributeNS","name":"getAttributeNS","help":" Retrieve the value of the attribute with the specified name and namespace, from the current node.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.getAttributeNode","name":"getAttributeNode","help":" Retrieve the node representation of the named attribute from the current node.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.getAttributeNodeNS","name":"getAttributeNodeNS","help":" Retrieve the node representation of the attribute with the specified name and namespace, from the current node.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.getBoundingClientRect","name":"getBoundingClientRect","help":"","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Element.getElementsByClassName","name":"getElementsByClassName","help":"","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.getElementsByTagName","name":"getElementsByTagName","help":" Retrieve a set of all descendant elements, of a particular tag name, from the current element.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.getElementsByTagNameNS","name":"getElementsByTagNameNS","help":" Retrieve a set of all descendant elements, of a particular tag name and namespace, from the current element.","obsolete":false},{"url":"https://developer.mozilla.org/Article_not_found?uri=en/DOM/Node.getFeature","name":"getFeature","help":"","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Node.getUserData","name":"getUserData","help":"","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.hasAttribute","name":"hasAttribute","help":" Check if the element has the specified attribute, or not.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.hasAttributeNS","name":"hasAttributeNS","help":" Check if the element has the specified attribute, in the specified namespace, or not.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Node.hasAttributes","name":"hasAttributes","help":" Check if the element has any attributes, or not.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Node.hasChildNodes","name":"hasChildNodes","help":" Check if the element has any child nodes, or not.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Node.insertBefore","name":"insertBefore","help":" Inserts the first node before the second, child, Node in the DOM.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Node.isDefaultNamespace","name":"isDefaultNamespace","help":"","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Node.isEqualNode","name":"isEqualNode","help":"","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Node.isSameNode","name":"isSameNode","help":"","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Node.isSupported","name":"isSupported","help":"","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Node.lookupNamespaceURI","name":"lookupNamespaceURI","help":"","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Node.lookupPrefix","name":"lookupPrefix","help":"","obsolete":false},{"name":"webkitMatchesSelector","help":" Returns whether or not the element would be selected by the specified selector string.","obsolete":false},{"name":"webkitRequestFullScreen","help":" Asynchronously asks the browser to make the element full-screen.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Node.normalize","name":"normalize","help":" Clean up all the text nodes under this element (merge adjacent, remove empty).","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Element.querySelector","name":"querySelector","help":"","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Element.querySelectorAll","name":"querySelectorAll","help":"","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.removeAttribute","name":"removeAttribute","help":" Remove the named attribute from the current node.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.removeAttributeNS","name":"removeAttributeNS","help":" Remove the attribute with the specified name and namespace, from the current node.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.removeAttributeNode","name":"removeAttributeNode","help":" Remove the node representation of the named attribute from the current node.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Node.removeChild","name":"removeChild","help":" Removes a child node from the current element.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.removeEventListener","name":"removeEventListener","help":" Removes an event listener from the element.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Node.replaceChild","name":"replaceChild","help":" Replaces one child node in the current element with another.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.scrollIntoView","name":"scrollIntoView","help":" Scrolls the page until the element gets into the view.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.setAttribute","name":"setAttribute","help":" Set the value of the named attribute from the current node.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.setAttributeNS","name":"setAttributeNS","help":" Set the value of the attribute with the specified name and namespace, from the current node.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.setAttributeNode","name":"setAttributeNode","help":" Set the node representation of the named attribute from the current node.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.setAttributeNodeNS","name":"setAttributeNodeNS","help":" Set the node representation of the attribute with the specified name and namespace, from the current node.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.setCapture","name":"setCapture","help":" Sets up mouse event capture, redirecting all mouse events to this element.","obsolete":false},{"url":"https://developer.mozilla.org/Article_not_found?uri=en/DOM/element.setIdAttributeNS","name":"setIdAttributeNS","help":" Sets the attribute to be treated as an ID type attribute.","obsolete":false},{"url":"https://developer.mozilla.org/Article_not_found?uri=en/DOM/element.setIdAttributeNode","name":"setIdAttributeNode","help":" Sets the attribute to be treated as an ID type attribute.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Node.setUserData","name":"setUserData","help":"","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Element.insertAdjacentHTML","name":"insertAdjacentHTML","help":" Parses the text as HTML or XML and inserts the resulting nodes into the tree in the position given.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Node.attributes","name":"attributes","help":"All attributes associated with an element.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Node.baseURI","name":"baseURI","help":"Base URI as a string","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.baseURIObject","name":"baseURIObject","help":"The read-only <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsIURI\">nsIURI</a></code>\n object representing the base URI for the element.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Element.childElementCount","name":"childElementCount","help":"The number of child nodes that are elements.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Node.childNodes","name":"childNodes","help":"All child nodes of an element.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Element.children","name":"children","help":"A live <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/XPCOM_Interface_Reference/nsIDOMNodeList&amp;ident=nsIDOMNodeList\" class=\"new\">nsIDOMNodeList</a></code>\n of the current child elements.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.classList","name":"classList","help":"Token list of class attribute","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.className","name":"className","help":"Gets/sets the class of the element.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.clientHeight","name":"clientHeight","help":"The inner height of an element.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.clientLeft","name":"clientLeft","help":"The width of the left border of an element.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.clientTop","name":"clientTop","help":"The width of the top border of an element.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.clientWidth","name":"clientWidth","help":"The inner width of an element.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Element.contentEditable","name":"contentEditable","help":"Gets/sets whether or not the element is editable.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.dataset","name":"dataset","help":"Allows access to read and write custom data attributes on the element.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.dir","name":"dir","help":"Gets/sets the directionality of the element.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Node.firstChild","name":"firstChild","help":"The first direct child node of an element, or <code>null</code> if this element has no child nodes.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Element.firstElementChild","name":"firstElementChild","help":"The first direct child element of an element, or <code>null</code> if the element has no child elements.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.id","name":"id","help":"Gets/sets the id of the element.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.innerHTML","name":"innerHTML","help":"Gets/sets the markup of the element's content.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Element.isContentEditable","name":"isContentEditable","help":"Indicates whether or not the content of the element can be edited. Read only.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.lang","name":"lang","help":"Gets/sets the language of an element's attributes, text, and element contents.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Node.lastChild","name":"lastChild","help":"The last direct child node of an element, or <code>null</code> if this element has no child nodes.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Element.lastElementChild","name":"lastElementChild","help":"The last direct child element of an element, or <code>null</code> if the element has no child elements.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Node.localName","name":"localName","help":"The local part of the qualified name of an element. In Firefox 3.5 and earlier, the property upper-cases the local name for HTML&nbsp;elements (but not XHTML&nbsp;elements). In later versions, this does not happen, so the property is in lower case for both HTML&nbsp;and XHTML. \n<span title=\"(Firefox 3.6 / Thunderbird 3.1 / Fennec 1.0)\n\">Requires Gecko 1.9.2</span>","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.name","name":"name","help":"Gets/sets the name attribute of an element.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Node.namespaceURI","name":"namespaceURI","help":"The namespace URI of this node, or <code>null</code> if it is no namespace. In Firefox 3.5 and earlier, HTML&nbsp;elements are in no namespace. In later versions, HTML&nbsp;elements are in the <code><a class=\"linkification-ext external\" title=\"Linkification: http://www.w3.org/1999/xhtml\" rel=\"external\" href=\"http://www.w3.org/1999/xhtml\" target=\"_blank\">http://www.w3.org/1999/xhtml</a></code> namespace in both HTML&nbsp;and XML&nbsp;trees. \n<span title=\"(Firefox 3.6 / Thunderbird 3.1 / Fennec 1.0)\n\">Requires Gecko 1.9.2</span>","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Node.nextSibling","name":"nextSibling","help":"The node immediately following the given one in the tree, or <code>null</code> if there is no sibling node.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Element.nextElementSibling","name":"nextElementSibling","help":"The element immediately following the given one in the tree, or <code>null</code> if there's no sibling node.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Node.nodeName","name":"nodeName","help":"The name of the node.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Node.nodePrincipal","name":"nodePrincipal","help":"The node's principal.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Node.nodeType","name":"nodeType","help":"A number representing the type of the node. Is always equal to <code>1</code> for DOM elements.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Node.nodeValue","name":"nodeValue","help":"The value of the node. Is always equal to <code>null</code> for DOM elements.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.offsetHeight","name":"offsetHeight","help":"The height of an element, relative to the layout.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.offsetLeft","name":"offsetLeft","help":"The distance from this element's left border to its <code>offsetParent</code>'s left border.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.offsetParent","name":"offsetParent","help":"The element from which all offset calculations are currently computed.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.offsetTop","name":"offsetTop","help":"The distance from this element's top border to its <code>offsetParent</code>'s top border.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.offsetWidth","name":"offsetWidth","help":"The width of an element, relative to the layout.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.outerHTML","name":"outerHTML","help":"Gets the markup of the element including its content. When used as a setter, replaces the element with nodes parsed from the given string.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Node.ownerDocument","name":"ownerDocument","help":"The document that this node is in, or <code>null</code> if the node is not inside of one.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Node.parentNode","name":"parentNode","help":"The parent element of this node, or <code>null</code> if the node is not inside of a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/document\">DOM Document</a></code>\n.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Node.prefix","name":"prefix","help":"The namespace prefix of the node, or <code>null</code> if no prefix is specified.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Node.previousSibling","name":"previousSibling","help":"The node immediately preceding the given one in the tree, or <code>null</code> if there is no sibling node.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Element.previousElementSibling","name":"previousElementSibling","help":"The element immediately preceding the given one in the tree, or <code>null</code> if there is no sibling element.","obsolete":false},{"url":"https://developer.mozilla.org/Article_not_found?uri=en/DOM/element.schemaTypeInfo","name":"schemaTypeInfo","help":"Returns TypeInfo regarding schema information for the element (also available on <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Attr\">Attr</a></code>\n).","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.scrollHeight","name":"scrollHeight","help":"The scroll view height of an element.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.scrollLeft","name":"scrollLeft","help":"Gets/sets the left scroll offset of an element.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.scrollTop","name":"scrollTop","help":"Gets/sets the top scroll offset of an element.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.scrollWidth","name":"scrollWidth","help":"The scroll view width of an element.","obsolete":false},{"url":"https://developer.mozilla.org/en/XUL/Attribute/spellcheck","name":"spellcheck","help":"Controls <a title=\"en/Controlling_spell_checking_in_HTML_forms\" rel=\"internal\" href=\"https://developer.mozilla.org/en/HTML/Controlling_spell_checking_in_HTML_forms\">spell-checking</a> (present on all HTML&nbsp;elements)","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.style","name":"style","help":"An object representing the declarations of an element's style attributes.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.tabIndex","name":"tabIndex","help":"Gets/sets the position of the element in the tabbing order.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.tagName","name":"tagName","help":"The name of the tag for the given element.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Node.textContent","name":"textContent","help":"Gets/sets the textual contents of an element and all its descendants.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.title","name":"title","help":"A string that appears in a popup box when mouse is over the element.","obsolete":false},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/element.onkeyup","name":"onkeyup","help":"Returns the event handling code for the keyup event."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/element.oncut","name":"oncut","help":"Returns the event handling code for the cut event."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/element.onbeforescriptexecute","name":"onbeforescriptexecute","help":"The event handling code for the <code>beforescriptexecute</code> event; this is used only for <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/script\">&lt;script&gt;</a></code>\n elements."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/element.onkeydown","name":"onkeydown","help":"Returns the event handling code for the keydown event."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/element.onpaste","name":"onpaste","help":"Returns the event handling code for the paste event."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/element.onkeypress","name":"onkeypress","help":"Returns the event handling code for the keypress event."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/element.onscroll","name":"onscroll","help":"Returns the event handling code for the scroll event."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/element.onmouseout","name":"onmouseout","help":"Returns the event handling code for the mouseout event."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/element.onmousemove","name":"onmousemove","help":"Returns the event handling code for the mousemove event."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/element.onclick","name":"onclick","help":"Returns the event handling code for the click event."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/element.oncopy","name":"oncopy","help":"Returns the event handling code for the copy event."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/element.onresize","name":"onresize","help":"Returns the event handling code for the resize event."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/element.onblur","name":"onblur","help":"Returns the event handling code for the blur event."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/element.onmouseover","name":"onmouseover","help":"Returns the event handling code for the mouseover event."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/element.onafterscriptexecute","name":"onafterscriptexecute","help":"The event handling code for the <code>afterscriptexecute</code> event; this is used only for <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/script\">&lt;script&gt;</a></code>\n elements."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/element.ondblclick","name":"ondblclick","help":"Returns the event handling code for the dblclick event."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/element.onfocus","name":"onfocus","help":"Returns the event handling code for the focus event."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/element.onmousedown","name":"onmousedown","help":"Returns the event handling code for the mousedown event."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/element.onmouseup","name":"onmouseup","help":"Returns the event handling code for the mouseup event."},{"obsolete":false,"url":"https://developer.mozilla.org/Article_not_found?uri=en/DOM/element.oncontextmenu","name":"oncontextmenu","help":"Returns the event handling code for the contextmenu event."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/element.onchange","name":"onchange","help":"Returns the event handling code for the change event."},{"obsolete":false,"url":"https://developer.mozilla.org/Article_not_found?uri=en/DOM/element.onbeforeunload","name":"onbeforeunload","help":"Returns the event handling code for the beforeunload event."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/element.onkeyup","name":"onkeyup","help":"Returns the event handling code for the keyup event."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/element.oncut","name":"oncut","help":"Returns the event handling code for the cut event."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/element.onkeydown","name":"onkeydown","help":"Returns the event handling code for the keydown event."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/element.onpaste","name":"onpaste","help":"Returns the event handling code for the paste event."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/element.onkeypress","name":"onkeypress","help":"Returns the event handling code for the keypress event."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/element.onscroll","name":"onscroll","help":"Returns the event handling code for the scroll event."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/element.onmouseout","name":"onmouseout","help":"Returns the event handling code for the mouseout event."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/element.onmousemove","name":"onmousemove","help":"Returns the event handling code for the mousemove event."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/element.onclick","name":"onclick","help":"Returns the event handling code for the click event."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/element.oncopy","name":"oncopy","help":"Returns the event handling code for the copy event."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/element.onblur","name":"onblur","help":"Returns the event handling code for the blur event."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/element.onmouseover","name":"onmouseover","help":"Returns the event handling code for the mouseover event."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/element.ondblclick","name":"ondblclick","help":"Returns the event handling code for the dblclick event."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/element.onfocus","name":"onfocus","help":"Returns the event handling code for the focus event."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/element.onmousedown","name":"onmousedown","help":"Returns the event handling code for the mousedown event."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/element.onmouseup","name":"onmouseup","help":"Returns the event handling code for the mouseup event."},{"obsolete":false,"url":"https://developer.mozilla.org/Article_not_found?uri=en/DOM/element.oncontextmenu","name":"oncontextmenu","help":"Returns the event handling code for the contextmenu event."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/element.onchange","name":"onchange","help":"Returns the event handling code for the change event."}],"srcUrl":"https://developer.mozilla.org/en/DOM/element"},"SVGLineElement":{"title":"SVGLineElement","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td>9.0</td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> </tbody>\n</table>\n</div>\n<div id=\"compat-mobile\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> </tbody>\n</table>\n</div>","srcUrl":"https://developer.mozilla.org/en/DOM/SVGLineElement","seeAlso":"<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/line\">&lt;line&gt;</a></code>\n SVG Element","summary":"The <code>SVGLineElement</code> interface provides access to the properties of <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/line\">&lt;line&gt;</a></code>\n elements, as well as methods to manipulate them.","members":[{"name":"x1","help":"Corresponds to attribute \n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Attribute/x1\">x1</a></code> on the given <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/line\">&lt;line&gt;</a></code>\n element.","obsolete":false},{"name":"y1","help":"Corresponds to attribute \n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Attribute/y1\">y1</a></code> on the given <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/line\">&lt;line&gt;</a></code>\n element.","obsolete":false},{"name":"x2","help":"Corresponds to attribute \n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Attribute/x2\">x2</a></code> on the given <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/line\">&lt;line&gt;</a></code>\n element.","obsolete":false},{"name":"y2","help":"Corresponds to attribute \n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Attribute/y2\">y2</a></code> on the given <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/line\">&lt;line&gt;</a></code>\n element.","obsolete":false}]},"SVGFETurbulenceElement":{"title":"feTurbulence","seeAlso":"<li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/filter\">&lt;filter&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/animate\">&lt;animate&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/set\">&lt;set&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feBlend\">&lt;feBlend&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feColorMatrix\">&lt;feColorMatrix&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feComponentTransfer\">&lt;feComponentTransfer&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feComposite\">&lt;feComposite&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feConvolveMatrix\">&lt;feConvolveMatrix&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feDiffuseLighting\">&lt;feDiffuseLighting&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feDisplacementMap\">&lt;feDisplacementMap&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feFlood\">&lt;feFlood&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feGaussianBlur\">&lt;feGaussianBlur&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feImage\">&lt;feImage&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feMerge\">&lt;feMerge&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feMorphology\">&lt;feMorphology&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feOffset\">&lt;feOffset&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feSpecularLighting\">&lt;feSpecularLighting&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feTile\">&lt;feTile&gt;</a></code>\n</li> <li><a title=\"en/SVG/Tutorial/Filter_effects\" rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Tutorial/Filter_effects\">SVG tutorial: Filter effects</a></li>","summary":"The filter primitive creates a perturbation image, like cloud or marble textures.","members":[{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/stitchTiles","name":"stitchTiles","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/numOctaves","name":"numOctaves","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/class","name":"class","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/seed","name":"seed","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/baseFrequency","name":"baseFrequency","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/type","name":"type","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/style","name":"style","help":"Specific attributes"}],"srcUrl":"https://developer.mozilla.org/en/SVG/Element/feTurbulence"},"CSSFontFaceRule":{"title":"CSSRule","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/cssRule","skipped":true,"cause":"Suspect title"},"DOMImplementation":{"title":"DOMImplementation","summary":"Provides methods which are not dependent on any particular DOM instances. Returned by <code><a title=\"En/DOM/Document.implementation\" class=\"internal\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/document.implementation\">document.implementation</a></code>.","members":[{"url":"https://developer.mozilla.org/En/DOM/DOMImplementation.createDocument","name":"createDocument","help":"","obsolete":false},{"url":"https://developer.mozilla.org/En/DOM/DOMImplementation.createDocumentType","name":"createDocumentType","help":"","obsolete":false},{"url":"https://developer.mozilla.org/En/DOM/DOMImplementation.createHTMLDocument","name":"createHTMLDocument","help":"","obsolete":false},{"url":"https://developer.mozilla.org/En/DOM/DOMImplementation.getFeature","name":"getFeature","help":"","obsolete":false},{"url":"https://developer.mozilla.org/En/DOM/DOMImplementation.hasFeature","name":"hasFeature","help":"","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/DOM/DOMImplementation","specification":"DOM&nbsp;Level 3"},"HTMLAudioElement":{"title":"HTMLAudioElement","seeAlso":"<li><a title=\"en/Introducing the Audio API Extension\" rel=\"internal\" href=\"https://developer.mozilla.org/en/Introducing_the_Audio_API_Extension\">Introducing the Audio API Extension</a></li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/audio\">&lt;audio&gt;</a></code>\n</li>","summary":"<p>The <code>HTMLAudioElement</code> interface provides access to the properties of <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/audio\">&lt;audio&gt;</a></code>\n&nbsp;elements, as well as methods to manipulate them. It's derived from the <a title=\"en/DOM/HTMLMediaElement\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/HTMLMediaElement\" class=\" new\"><code>HTMLMediaElement</code></a> interface; it's implemented by <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsIDOMHTMLMediaElement\">nsIDOMHTMLMediaElement</a></code>\n.</p>\n<p>For details on how to use the audio streaming features exposed by this interface, please see <a title=\"en/Introducing the Audio API Extension\" rel=\"internal\" href=\"https://developer.mozilla.org/en/Introducing_the_Audio_API_Extension\">Introducing the Audio API Extension</a>.</p>","members":[{"name":"webkitWriteAudio","help":"Writes audio into the stream at the current offset. Returns the number of bytes actually written to the stream.","obsolete":false},{"name":"webkitCurrentSampleOffset","help":"Indicates the current offset of the audio stream that was created by a call to <code>mozWriteAudio()</code>. This offset is specified as the number of samples since the beginning of the stream.","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/Document_Object_Model_(DOM)/HTMLAudioElement"},"SVGSetElement":{"title":"SVGSetElement","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> </tbody>\n</table>\n</div>\n<div id=\"compat-mobile\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> </tbody>\n</table>\n</div>","summary":"The <code>SVGSetElement</code> interface corresponds to the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/set\">&lt;set&gt;</a></code>\n element.","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/SVGSetElement"},"SVGFEImageElement":{"title":"feImage","seeAlso":"<li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/filter\">&lt;filter&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/animate\">&lt;animate&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/animateTransform\">&lt;animateTransform&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/set\">&lt;set&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feBlend\">&lt;feBlend&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feColorMatrix\">&lt;feColorMatrix&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feComponentTransfer\">&lt;feComponentTransfer&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feComposite\">&lt;feComposite&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feConvolveMatrix\">&lt;feConvolveMatrix&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feDiffuseLighting\">&lt;feDiffuseLighting&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feDisplacementMap\">&lt;feDisplacementMap&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feFlood\">&lt;feFlood&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feGaussianBlur\">&lt;feGaussianBlur&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feMerge\">&lt;feMerge&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feMorphology\">&lt;feMorphology&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feOffset\">&lt;feOffset&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feSpecularLighting\">&lt;feSpecularLighting&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feTile\">&lt;feTile&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feTurbulence\">&lt;feTurbulence&gt;</a></code>\n</li> <li><a title=\"en/SVG/Tutorial/Filter_effects\" rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Tutorial/Filter_effects\">SVG tutorial: Filter effects</a></li>","summary":"The feImage filter fetches image data from an external source and provides the pixel data as output.","members":[{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/class","name":"class","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/style","name":"style","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/externalResourcesRequired","name":"externalResourcesRequired","help":"Specific attributes"},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/preserveAspectRatio","name":"preserveAspectRatio","help":""}],"srcUrl":"https://developer.mozilla.org/en/SVG/Element/feImage"},"IDBIndex":{"title":"IDBIndex","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td>12\n<span title=\"prefix\">-webkit</span>&nbsp;</td> <td>4.0 (2.0)\n</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> </tr> <tr> <td><code>count()</code></td> <td><span title=\"Not supported.\">--</span></td> <td>10.0 (10.0)\n</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE&nbsp;Phone</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Not supported.\">--</span></td> <td>4.0 (2.0)\n</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> </tr> <tr> <td><code>count()</code></td> <td><span title=\"Not supported.\">--</span></td> <td>10.0 (10.0)\n</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> </tr> </tbody> </table>\n</div>","examples":["<p>The following is an example based on the HTML5Rocks article on <a class=\"external\" rel=\"external\" href=\"http://www.html5rocks.com/en/tutorials/indexeddb/todo/#toc-step4\" title=\"http://www.html5rocks.com/en/tutorials/indexeddb/todo/#toc-step4\" target=\"_blank\">IndexedDB</a>. For Chrome, use the <code>webkit</code> prefix. For example, <code>IDBKeyRange</code> would be <code>webkitIDBKeyRange</code>.</p>\n\n          <pre name=\"code\" class=\"js\">// Taking care of the browser-specific prefixes.\nif ('webkitIndexedDB' in window) {\n   window.indexedDB = window.webkitIndexedDB;\n   window.IDBTransaction = window.webkitIDBTransaction;\n   window.IDBKeyRange = window.webkitIDBKeyRange;\n} else if ('mozIndexedDB' in window) {\n   window.indexedDB = window.mozIndexedDB;\n}\n\n...\n  \nhtml5rocks.indexedDB.getAllTodoItems = function() {\n  var todos = document.getElementById(\"todoItems\");\n  todos.innerHTML = \"\";\n  \n  // Start a transaction.\n  var db = html5rocks.indexedDB.db;\n  // Open an object store called \"todo\" \n  // in \"READ_WRITE\" mode. \n  var trans = db.transaction([\"todo\"], IDBTransaction.READ_WRITE, 0);\n  var store = trans.objectStore(\"todo\");\n\n  // We select the range of data we want to make queries over \n  // In this case, we get everything. \n  // To see how you set ranges, see IDBKeyRange.\n  var keyRange = IDBKeyRange.lowerBound(0);\n  // We open a cursor and attach events.\n  var cursorRequest = store.openCursor(keyRange);\n\n  cursorRequest.onsuccess = function(e) {\n    var result = e.target.result;\n    if(!!result == false)\n      return;\n\n    renderTodo(result.value);\n    // The success event handler is fired once for each entry.\n    // So call \"continue\" on your result object.\n    // This lets you iterate across the data\n\n    result.continue();\n  };\n\n  cursorRequest.onerror = html5rocks.indexedDB.onerror;\n};</pre>"],"srcUrl":"https://developer.mozilla.org/en/IndexedDB/IDBIndex","summary":"<p>The <code>IDBIndex</code> interface of the <a title=\"en/IndexedDB\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB\">IndexedDB API</a> provides asynchronous access to an <a title=\"en/IndexedDB#gloss index\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB#gloss_index\">index</a> in a database. An index is a kind of object store for looking up records in another object store, called the <em>referenced object store</em>. You use this interface to retrieve data.</p>\n<p>Inherits from: <a title=\"en/DOM/EventTarget\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/EventTarget\">EventTarget</a></p>","members":[{"url":"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#TRANSACTION_INACTIVE_ERR","name":"TRANSACTION_INACTIVE_ERR","help":"The index's transaction is not active.","obsolete":false},{"url":"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#DATA_ERR","name":"DATA_ERR","help":"The <code>key</code> parameter was not a valid value.","obsolete":false},{"url":"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#NOT_ALLOWED_ERR","name":"NOT_ALLOWED_ERR","help":"The request was made on a source object that has been deleted or removed.","obsolete":false},{"url":"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#TRANSACTION_INACTIVE_ERR","name":"TRANSACTION_INACTIVE_ERR","help":"The index's transaction is not active.","obsolete":false},{"url":"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#DATA_ERR","name":"DATA_ERR","help":"The <code>key</code> parameter was not a valid value.","obsolete":false},{"url":"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#NOT_ALLOWED_ERR","name":"NOT_ALLOWED_ERR","help":"The request was made on a source object that has been deleted or removed.","obsolete":false},{"url":"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#DATA_ERR","name":"DATA_ERR","help":"The <code>key</code> parameter was not a valid value.","obsolete":false},{"url":"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#NOT_ALLOWED_ERR","name":"NOT_ALLOWED_ERR","help":"The request was made on a source object that has been deleted or removed.","obsolete":false},{"url":"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#TRANSACTION_INACTIVE_ERR","name":"TRANSACTION_INACTIVE_ERR","help":"The index's transaction is not active.","obsolete":false},{"url":"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#DATA_ERR","name":"DATA_ERR","help":"The <code>key</code> parameter was not a valid value.","obsolete":false},{"url":"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#NOT_ALLOWED_ERR","name":"NOT_ALLOWED_ERR","help":"The request was made on a source object that has been deleted or removed.","obsolete":false},{"url":"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#TRANSACTION_INACTIVE_ERR","name":"TRANSACTION_INACTIVE_ERR","help":"The index's transaction is not active.","obsolete":false},{"url":"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#DATA_ERR","name":"DATA_ERR","help":"The <code>key</code> parameter was not a valid value.","obsolete":false},{"url":"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#NOT_ALLOWED_ERR","name":"NOT_ALLOWED_ERR","help":"The request was made on a source object that has been deleted or removed.","obsolete":false},{"name":"openKeyCursor","help":"<p>Returns an <a title=\"en/IndexedDB/IDBRequest\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBRequest\">IDBRequest</a> object, and, in a separate thread, creates a cursor over the specified key range, as arranged by this index. The method sets the position of the cursor to the appropriate record, based on the specified direction.</p>\n<ul> <li>If the key range is not specified or is null, then the range includes all the records.</li> <li>If at least one record matches the key range, then a <a title=\"en/IndexedDB/IDBSuccessEvent\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBSuccessEvent\">success event</a> is fired on the result object, with its <a title=\"en/IndexedDB/IDBSuccessEvent#attr result\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBSuccessEvent#attr_result\">result</a> set to the new <a title=\"en/IndexedDB/IDBCursor\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBCursor\">IDBCursor</a> object; the <code><a title=\"en/IndexedDB/IDBCursor#attr value\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBCursor#attr_value\">value</a></code> of the cursor object is set to the value of the found record.</li> <li>If no records match the key range, then then an <a title=\"en/IndexedDB/IDBErrorEvent\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBErrorEvent\">error event</a> is fired on the request object, with its <code><a title=\"en/IndexedDB/IDBErrorEvent#attr code\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBErrorEvent#attr_code\">code</a></code> set to <code><a href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#NOT_FOUND_ERR\" rel=\"internal\">NOT_FOUND_ERR</a></code> and a suitable <code><a title=\"en/IndexedDB/IDBErrorEvent#attr message\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBErrorEvent#attr_message\">message</a></code>.</li>\n</ul>\n<pre>IDBRequest openKeyCursor (\n  in optional any? range, \n  in optional unsigned short direction\n) raises (IDBDatabaseException);\n</pre>\n<div id=\"section_23\"><span id=\"Parameters_5\"></span><h5 class=\"editable\">Parameters</h5>\n<dl> <dt>range</dt> <dd><em>Optional.</em> The key range to use as the cursor's range.</dd> <dt>direction</dt> <dd><em>Optional.</em> The cursor's required direction. See <a title=\"en/IndexedDB/IDBCursor#Constants\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBCursor#Constants\">IDBCursor Constants</a> for possible values.</dd>\n</dl>\n</div><div id=\"section_24\"><span id=\"Returns_5\"></span><h5 class=\"editable\">Returns</h5>\n<dl> <dt><code><a href=\"https://developer.mozilla.org/en/IndexedDB/IDBRequest\" rel=\"internal\">IDBRequest</a></code></dt>\n</dl>\n<dl> <dd>A request object on which subsequent events related to this operation are fired.</dd>\n</dl>\n</div><div id=\"section_25\"><span id=\"Exceptions_5\"></span><h5 class=\"editable\">Exceptions</h5>\n<p>This method can raise an <a title=\"en/IndexedDB/IDBDatabaseException\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException\">IDBDatabaseException</a> with the following code:</p>\n<table class=\"standard-table\"> <thead> <tr> <th scope=\"col\" width=\"131\">Attribute</th> <th scope=\"col\" width=\"698\">Description</th> </tr> </thead> <tbody> <tr> <td><a title=\"en/IndexedDB/IDBDatabaseException#TRANSACTION INACTIVE ERR\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#TRANSACTION_INACTIVE_ERR\"><code>TRANSACTION_INACTIVE_ERR</code></a></td> <td>The index's transaction is not active.</td> </tr> <tr> <td><code><a title=\"en/IndexedDB/IDBDatabaseException#DATA ERR\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#DATA_ERR\">DATA_ERR</a></code></td> <td>The <code>key</code> parameter was not a valid value.</td> </tr> <tr> <td><code><a title=\"en/IndexedDB/IDBDatabaseException#NOT_ALLOWED_ERR\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#NOT_ALLOWED_ERR\">NOT_ALLOWED_ERR</a></code></td> <td>The request was made on a source object that has been deleted or removed.</td> </tr> </tbody>\n</table>\n</div>","obsolete":false},{"name":"openCursor","help":"<p>Returns an <a title=\"en/IndexedDB/IDBRequest\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBRequest\">IDBRequest</a> object, and, in a separate thread, creates a <a title=\"en/IndexedDB#gloss cursor\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB#gloss_cursor\">cursor</a> over the specified key range. The method sets the position of the cursor to the appropriate record, based on the specified direction.</p>\n<ul> <li>If the key range is not specified or is null, then the range includes all the records.</li> <li>If at least one record matches the key range, then a <a title=\"en/IndexedDB/IDBSuccessEvent\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBSuccessEvent\">success event</a> is fired on the result object, with its <a title=\"en/IndexedDB/IDBSuccessEvent#attr result\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBSuccessEvent#attr_result\">result</a> set to the new <a title=\"en/IndexedDB/IDBCursor\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBCursor\">IDBCursor</a> object; the <code><a title=\"en/IndexedDB/IDBCursor#attr value\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBCursor#attr_value\">value</a></code> of the cursor object is set to a structured clone of the referenced value.</li> <li>If no records match the key range, then then an <a title=\"en/IndexedDB/IDBErrorEvent\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBErrorEvent\">error event</a> is fired on the request object, with its <code><a title=\"en/IndexedDB/IDBErrorEvent#attr code\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBErrorEvent#attr_code\">code</a></code> set to <code><a href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#NOT_FOUND_ERR\" rel=\"internal\">NOT_FOUND_ERR</a></code> and a suitable <code><a title=\"en/IndexedDB/IDBErrorEvent#attr message\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBErrorEvent#attr_message\">message</a></code>.</li>\n</ul>\n<pre>IDBRequest openCursor (\n  in optional any? range, \n  in optional unsigned short direction\n) raises (IDBDatabaseException);\n</pre>\n<div id=\"section_19\"><span id=\"Parameters_4\"></span><h5 class=\"editable\">Parameters</h5>\n<dl> <dt>range</dt> <dd><em>Optional.</em> The key range to use as the cursor's range.</dd> <dt>direction</dt> <dd><em>Optional.</em> The cursor's required <a title=\"en/indexedDB#gloss direction\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB#gloss_direction\">direction</a>. See <a title=\"en/IndexedDB/IDBCursor#Constants\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBCursor#Constants\">IDBCursor Constants</a> for possible values.</dd>\n</dl>\n</div><div id=\"section_20\"><span id=\"Returns_4\"></span><h5 class=\"editable\">Returns</h5>\n<dl> <dt><code><a href=\"https://developer.mozilla.org/en/IndexedDB/IDBRequest\" rel=\"internal\">IDBRequest</a></code></dt>\n</dl>\n<dl> <dd>A request object on which subsequent events related to this operation are fired.</dd>\n</dl>\n</div><div id=\"section_21\"><span id=\"Exceptions_4\"></span><h5 class=\"editable\">Exceptions</h5>\n<p>This method can raise an <a title=\"en/IndexedDB/IDBDatabaseException\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException\">IDBDatabaseException</a> with the following code:</p>\n<table class=\"standard-table\"> <thead> <tr> <th scope=\"col\" width=\"131\">Attribute</th> <th scope=\"col\" width=\"698\">Description</th> </tr> </thead> <tbody> <tr> <td><a title=\"en/IndexedDB/IDBDatabaseException#TRANSACTION INACTIVE ERR\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#TRANSACTION_INACTIVE_ERR\"><code>TRANSACTION_INACTIVE_ERR</code></a></td> <td>The index's transaction is not active.</td> </tr> <tr> <td><code><a title=\"en/IndexedDB/IDBDatabaseException#DATA ERR\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#DATA_ERR\">DATA_ERR</a></code></td> <td>The <code>key</code> parameter was not a valid value.</td> </tr> <tr> <td><code><a title=\"en/IndexedDB/IDBDatabaseException#NOT_ALLOWED_ERR\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#NOT_ALLOWED_ERR\">NOT_ALLOWED_ERR</a></code></td> <td>The request was made on a source object that has been deleted or removed.</td> </tr> </tbody>\n</table>\n</div>","obsolete":false},{"name":"get","help":"<p>Returns an <a title=\"https://developer.mozilla.org/en/IndexedDB/IDBRequest\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBRequest\">IDBRequest</a> object, and, in a separate thread, finds either:</p>\n<ul> <li>The value in the referenced object store that corresponds to the given key.</li> <li>The first corresponding value, if <code>key</code> is a key range.</li>\n</ul>\n<p>If a value is successfully found, then a structured clone of it is created and set as the <code><a title=\"en/IndexedDB/IDBRequest#attr result\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBRequest#attr_result\">result</a></code> of the request object.</p>\n<p></p><div class=\"note\"><strong>Note:</strong>&nbsp;This method produces the same result for: a) a record that doesn't exist in the database and b) a record that has an undefined value. To tell these situations apart, call the openCursor() method with the same key. That method provides a cursor if the record exists, and not if it does not.</div>\n<p></p>\n<pre>IDBRequest get (\n  in any key\n) raises (IDBDatabaseException);\n</pre>\n<div id=\"section_7\"><span id=\"Parameters\"></span><h5 class=\"editable\">Parameters</h5>\n<dl> <dt>key</dt> <dd>The key or key range that identifies the record to be retrieved.</dd>\n</dl>\n</div><div id=\"section_8\"><span id=\"Returns\"></span><h5 class=\"editable\">Returns</h5>\n<dl> <dt><code><a href=\"https://developer.mozilla.org/en/IndexedDB/IDBRequest\" rel=\"internal\">IDBRequest</a></code></dt>\n</dl>\n<dl> <dd>A request object on which subsequent events related to this operation are fired.</dd>\n</dl>\n</div><div id=\"section_9\"><span id=\"Exceptions\"></span><h5 class=\"editable\">Exceptions</h5>\n<p>This method can raise an <a title=\"en/IndexedDB/IDBDatabaseException\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException\">IDBDatabaseException</a> with the following code:</p>\n<table class=\"standard-table\"> <thead> <tr> <th scope=\"col\" width=\"131\">Attribute</th> <th scope=\"col\" width=\"698\">Description</th> </tr> </thead> <tbody> <tr> <td><a title=\"en/IndexedDB/IDBDatabaseException#TRANSACTION INACTIVE ERR\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#TRANSACTION_INACTIVE_ERR\"><code>TRANSACTION_INACTIVE_ERR</code></a></td> <td>The index's transaction is not active.</td> </tr> <tr> <td><code><a title=\"en/IndexedDB/IDBDatabaseException#DATA ERR\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#DATA_ERR\">DATA_ERR</a></code></td> <td>The <code>key</code> parameter was not a valid value.</td> </tr> <tr> <td><code><a title=\"en/IndexedDB/IDBDatabaseException#NOT_ALLOWED_ERR\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#NOT_ALLOWED_ERR\">NOT_ALLOWED_ERR</a></code></td> <td>The request was made on a source object that has been deleted or removed.</td> </tr> </tbody>\n</table>\n</div>","obsolete":false},{"name":"getKey","help":"<p>Returns an <a title=\"https://developer.mozilla.org/en/IndexedDB/IDBRequest\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBRequest\">IDBRequest</a> object, and, in a separate thread, finds either:</p>\n<ul> <li>The value in the index that corresponds to the given key</li> <li>The first corresponding value, if <code>key</code> is a key range.</li>\n</ul>\n<p>If a value is successfully found, then a structured clone of it is created and set as the <code><a title=\"en/IndexedDB/IDBRequest#attr result\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBRequest#attr_result\">result</a></code> of the request object.</p>\n<p></p><div class=\"note\"><strong>Note:</strong>&nbsp;This method produces the same result for: a) a record that doesn't exist in the database and b) a record that has an undefined value. To tell these situations apart, call the openCursor() method with the same key. That method provides a cursor if the record exists, and not if it does not.</div>\n<p></p>\n<pre>IDBRequest getKey (\n  in any key\n) raises (IDBDatabaseException);\n</pre>\n<div id=\"section_11\"><span id=\"Parameters_2\"></span><h5 class=\"editable\">Parameters</h5>\n<dl> <dt>key</dt> <dd>The key or key range that identifies the record to be retrieved.</dd>\n</dl>\n</div><div id=\"section_12\"><span id=\"Returns_2\"></span><h5 class=\"editable\">Returns</h5>\n<dl> <dt><code><a href=\"https://developer.mozilla.org/en/IndexedDB/IDBRequest\" rel=\"internal\">IDBRequest</a></code></dt>\n</dl>\n<dl> <dd>A request object on which subsequent events related to this operation are fired.</dd>\n</dl>\n</div><div id=\"section_13\"><span id=\"Exceptions_2\"></span><h5 class=\"editable\">Exceptions</h5>\n<p>This method can raise a <a title=\"en/IndexedDB/IDBDatabaseException\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException\">IDBDatabaseException</a> with the following code:</p>\n<table class=\"standard-table\"> <thead> <tr> <th scope=\"col\" width=\"131\">Attribute</th> <th scope=\"col\" width=\"698\">Description</th> </tr> </thead> <tbody> <tr> <td><a title=\"en/IndexedDB/IDBDatabaseException#TRANSACTION INACTIVE ERR\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#TRANSACTION_INACTIVE_ERR\"><code>TRANSACTION_INACTIVE_ERR</code></a></td> <td>The index's transaction is not active.</td> </tr> <tr> <td><code><a title=\"en/IndexedDB/IDBDatabaseException#DATA ERR\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#DATA_ERR\">DATA_ERR</a></code></td> <td>The <code>key</code> parameter was not a valid value.</td> </tr> <tr> <td><code><a title=\"en/IndexedDB/IDBDatabaseException#NOT_ALLOWED_ERR\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#NOT_ALLOWED_ERR\">NOT_ALLOWED_ERR</a></code></td> <td>The request was made on a source object that has been deleted or removed.</td> </tr> </tbody>\n</table>\n</div>","obsolete":false},{"name":"count","help":"<p>Returns an <a title=\"https://developer.mozilla.org/en/IndexedDB/IDBRequest\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBRequest\">IDBRequest</a> object, and in a separate thread, returns the number of records within a key range. For example, if you want to see how many records are between keys 1000 and 2000 in an object store, you can write the following: <code> var req = store.count(<a title=\"en/IndexedDB/IDBKeyRange\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBKeyRange\">IDBKeyRange</a>.bound(1000, 2000));</code></p>\n<pre>IDBRequest count (\n  in optional any key\n) raises (IDBDatabaseException);\n</pre>\n<div id=\"section_15\"><span id=\"Parameters_3\"></span><h5 class=\"editable\">Parameters</h5>\n<dl> <dt>key</dt> <dd>The key or key range that identifies the record to be counted.</dd>\n</dl></div><div id=\"section_16\"><span id=\"Returns_3\"></span><h5 class=\"editable\">Returns</h5>\n<dl> <dt><code><a href=\"https://developer.mozilla.org/en/IndexedDB/IDBRequest\" rel=\"internal\">IDBRequest</a></code></dt>\n</dl>\n<dl> <dd>A request object on which subsequent events related to this operation are fired.</dd>\n</dl>\n</div><div id=\"section_17\"><span id=\"Exceptions_3\"></span><h5 class=\"editable\">Exceptions</h5>\n<p>This method can raise a <a title=\"en/IndexedDB/IDBDatabaseException\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException\">IDBDatabaseException</a> with the following code:</p>\n<table class=\"standard-table\"> <thead> <tr> <th scope=\"col\" width=\"131\">Attribute</th> <th scope=\"col\" width=\"698\">Description</th> </tr> </thead> <tbody> <tr> <td><code><a title=\"en/IndexedDB/IDBDatabaseException#DATA ERR\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#DATA_ERR\">DATA_ERR</a></code></td> <td>The <code>key</code> parameter was not a valid value.</td> </tr> <tr> <td><code><a title=\"en/IndexedDB/IDBDatabaseException#NOT_ALLOWED_ERR\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#NOT_ALLOWED_ERR\">NOT_ALLOWED_ERR</a></code></td> <td>The request was made on a source object that has been deleted or removed.</td> </tr> </tbody>\n</table>\n</div>","obsolete":false}]},"DatabaseSync":{"title":"IDBDatabaseSync","summary":"<div><strong>DRAFT</strong>\n<div>This page is not complete.</div>\n</div>\n\n<p></p>\n<p>The <code>DatabaseSync</code> interface in the <a title=\"en/IndexedDB\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB\">IndexedDB API</a> represents a synchronous <a title=\"en/IndexedDB#gloss database connection\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB#gloss_database_connection\">connection to a database</a>.</p>","members":[{"name":"setVersion","help":"<p>Sets the version of the connected database.</p>\n<pre>void setVersion (\n  in DOMString version\n);\n</pre>\n<div id=\"section_17\"><span id=\"Parameters_4\"></span><h5 class=\"editable\">Parameters</h5>\n<dl> <dt>version</dt> <dd>The version to store in the database.</dd> <div id=\"section_18\"><span id=\"Returns_4\"></span><h5 class=\"editable\">Returns</h5> <p><code>void</code></p>\n</div></dl>\n</div>","obsolete":false},{"name":"transaction","help":"<p>Creates and returns a transaction, acquiring locks on the given database objects, within the specified timeout duration, if possible.</p>\n<pre>IDBTransactionSync transaction (\n  in optional DOMStringList storeNames,\n  in optional unsigned int timeout\n) raises (IDBDatabaseException);\n</pre>\n<div id=\"section_20\"><span id=\"Parameters_5\"></span><h5 class=\"editable\">Parameters</h5>\n<dl> <dt>storeNames</dt> <dd>The names of object stores and indexes in the scope of the new transaction.</dd> <dt>timeout</dt> <dd>The interval that this operation is allowed to take to acquire locks on all the objects stores and indexes identified in <code>storeNames</code>.</dd>\n</dl>\n</div><div id=\"section_21\"><span id=\"Returns_5\"></span><h5 class=\"editable\">Returns</h5>\n<dl> <dt><code><a title=\"en/IndexedDB/TransactionSync\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBTransactionSync\">IDBTransactionSync</a></code></dt> <dd>An object to access the newly created transaction.</dd>\n</dl>\n</div><div id=\"section_22\"><span id=\"Exceptions_4\"></span><h5 class=\"editable\">Exceptions</h5>\n<p>This method can raise an IDBDatabaseException with the following code:</p>\n<dl> <dt><code><a title=\"en/IndexedDB/DatabaseException#TIMEOUT ERR\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#TIMEOUT_ERR\">TIMEOUT_ERR</a></code></dt> <dd>If reserving all the database objects identified in <code>storeNames</code> takes longer than the <code>timeout</code> interval.</dd>\n</dl></div>","obsolete":false},{"name":"removeObjectStore","help":"<p>Destroys an object store with the given name, as well as all indexes that reference that object store.</p>\n<pre>void removeObjectStore (\n  in DOMString storeName\n) raises (IDBDatabaseException);\n</pre>\n<div id=\"section_13\"><span id=\"Parameters_3\"></span><h5 class=\"editable\">Parameters</h5>\n<dl> <dt>storeName</dt> <dd>The name of an existing object store to remove.</dd>\n</dl>\n</div><div id=\"section_14\"><span id=\"Returns_3\"></span><h5 class=\"editable\">Returns</h5>\n<p><code>void</code></p>\n</div><div id=\"section_15\"><span id=\"Exceptions_3\"></span><h5 class=\"editable\">Exceptions</h5>\n<p>This method can raise an IDBDatabaseException with the following code:</p>\n<dl> <dt><code><a title=\"en/IndexedDB/DatabaseException#NOT FOUND ERR\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#NOT_FOUND_ERR\">NOT_FOUND_ERR</a></code></dt>\n</dl>\n<dl> <dd>If the object store with the given name (based on case-sensitive comparison) does not exist in the connected database.</dd>\n</dl>\n</div>","obsolete":false},{"name":"createObjectStore","help":"<p>Creates and returns a new object store with the given name in the connected database.</p>\n\n<div id=\"section_5\"><span id=\"Parameters\"></span><h5 class=\"editable\">Parameters</h5>\n<dl> <dt>name</dt> <dd>The name of a new object store.</dd> <dt>keypath</dt> <dd>The <a title=\"en/IndexedDB#gloss key path\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB#gloss_key_path\">key path</a> used by the new object store. If a null path is specified, then the object store does not have a key path, and uses out-of-line keys.</dd> <dt>autoIncrement</dt> <dd>If true, the object store uses a <a title=\"en/IndexedDB#gloss key generator\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB#gloss_key_generator\">key generator</a>; if false, it does not use one.</dd>\n</dl>\n</div><div id=\"section_6\"><span id=\"Returns\"></span><h5 class=\"editable\">Returns</h5>\n<dl> <dt><a title=\"en/IndexedDB/ObjectStoreSync\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBObjectStoreSync\"><code>IDBObjectStoreSync</code></a></dt> <dd>An object to access the newly created object store.</dd>\n</dl>\n</div><div id=\"section_7\"><span id=\"Exceptions\"></span><h5 class=\"editable\">Exceptions</h5>\n<p>This method can raise an IDBDatabaseException with the following code:</p>\n<dl> <dt><code><a title=\"en/IndexedDB/DatabaseException#CONSTRAINT ERR\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#CONSTRAINT_ERR\">CONSTRAINT_ERR</a></code></dt> <dd>If an object store with the same name (based on case-sensitive comparison) already exists in the connected database.</dd>\n</dl>\n</div>","idl":"<pre class=\"eval\"> IDBObjectStoreSync createObjectStore(   \n  in DOMString name,   \n  in DOMString keypath,   \n  in optional boolean autoIncrement \n) raises  (IDBDatabaseException);\n</pre>","obsolete":false},{"name":"openObjectStore","help":"<p>Opens the object store with the given name in the connected database using the specified mode.</p>\n<pre>IDBObjectStoreSync openObjectStore (\n  in DOMString name, \n  in optional unsigned short mode\n) raises (IDBDatabaseException);\n</pre>\n<div id=\"section_9\"><span id=\"Parameters_2\"></span><h5 class=\"editable\">Parameters</h5>\n<dl> <dt>name</dt> <dd>The name of the object store to open.</dd> <dt>mode</dt> <dd>The mode that is used to access the object store.</dd>\n</dl>\n</div><div id=\"section_10\"><span id=\"Returns_2\"></span><h5 class=\"editable\">Returns</h5>\n<dl> <dt><a title=\"en/IndexedDB/ObjectStoreSync\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBObjectStoreSync\"><code>IDBObjectStoreSync</code></a></dt> <dd>An object to access the opened object store.</dd>\n</dl>\n</div><div id=\"section_11\"><span id=\"Exceptions_2\"></span><h5 class=\"editable\">Exceptions</h5>\n<p>This method can raise an IDBDatabaseException with the following code:</p>\n<dl> <dt><code><a title=\"en/IndexedDB/DatabaseException#NOT FOUND ERR\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#NOT_FOUND_ERR\">NOT_FOUND_ERR</a></code></dt> <dd>If an object store with the given name (based on case-sensitive comparison) already exists in the connected database.</dd>\n</dl>\n</div>","obsolete":false},{"url":"","name":"name","help":"The name of the connected database.","obsolete":false},{"url":"","name":"objectStores","help":"The names of the object stores that exist in the connected database.","obsolete":false},{"url":"","name":"version","help":"The version of the connected database. Has the null value when the database is first created.","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseSync"},"DOMTokenList":{"title":"DOMTokenList","summary":"This type represents a set of space-separated tokens. Commonly returned by <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/element.classList\">HTMLElement.classList</a></code>\n, HTMLLinkElement.relList, HTMLAnchorElement.relList or HTMLAreaElement.relList. It is indexed beginning with 0 as with JavaScript arrays. DOMTokenList is always case-sensitive.","members":[{"obsolete":false,"url":"https://developer.mozilla.org/Article_not_found?uri=en/DOM/DOMTokenList.remove","name":"remove","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/Article_not_found?uri=en/DOM/DOMTokenList.contains","name":"contains","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/Article_not_found?uri=en/DOM/DOMTokenList.add","name":"add","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/Article_not_found?uri=en/DOM/DOMTokenList.item","name":"item","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/Article_not_found?uri=en/DOM/DOMTokenList.toggle","name":"toggle","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/Article_not_found?uri=en/DOM/DOMTokenList.length","name":"length","help":""}],"srcUrl":"https://developer.mozilla.org/en/DOM/DOMTokenList","specification":"http://www.whatwg.org/specs/web-apps/current-work/#domtokenlist"},"HTMLHeadElement":{"title":"HTMLHeadElement","seeAlso":"<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/head\">&lt;head&gt;</a></code>\n HTML&nbsp;element","summary":"The DOM <code>head</code> element exposes the <a title=\"http://www.w3.org/TR/html5/semantics.html#htmlheadelement\" class=\" external\" rel=\"external\" href=\"http://www.w3.org/TR/html5/semantics.html#htmlheadelement\" target=\"_blank\">HTMLHeadElement</a> (or \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML\">HTML 4</a></span>&nbsp; <a class=\" external\" target=\"_blank\" rel=\"external\" href=\"http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-77253168\" title=\"http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-77253168\">HTMLHeadElement</a>) interface, which contains the descriptive information, or metadata, for a document. This object inherits all of the properties and methods described in the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/element\">element</a></code>\n section. In \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span>, this interface inherits from HTMLElement, but defines no additional members.","members":[{"name":"profile","help":"The URIs of one or more metadata profiles (white space separated). \n\n<span class=\"deprecatedInlineTemplate\" title=\"(Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1)\n\">Deprecated since Gecko 2.0</span>\n\n \n\n<span title=\"(Firefox 7.0 / Thunderbird 7.0 / SeaMonkey 2.4)\n\">Obsolete since Gecko 7.0</span>","obsolete":true}],"srcUrl":"https://developer.mozilla.org/en/DOM/HTMLHeadElement"},"SVGFEPointLightElement":{"title":"fePointLight","seeAlso":"<li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/filter\">&lt;filter&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/animate\">&lt;animate&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/set\">&lt;set&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feDiffuseLighting\">&lt;feDiffuseLighting&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feSpecularLighting\">&lt;feSpecularLighting&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feDistantLight\">&lt;feDistantLight&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feSpotLight\">&lt;feSpotLight&gt;</a></code>\n</li> <li><a title=\"en/SVG/Tutorial/Filter_effects\" rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Tutorial/Filter_effects\">SVG tutorial: Filter effects</a></li>","members":[],"srcUrl":"https://developer.mozilla.org/en/SVG/Element/fePointLight"},"SVGPolylineElement":{"title":"polyline","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\">\n<table class=\"compat-table\"> <tbody> \n<tr><th scope=\"col\">Feature</th><th scope=\"col\">Chrome</th><th scope=\"col\">Firefox (Gecko)</th><th scope=\"col\">Internet Explorer</th><th scope=\"col\">Opera</th><th scope=\"col\">Safari</th></tr> <tr> <td>Basic support</td> <td>1.0</td> <td>1.5 (1.8)\n</td> <td>\n9.0</td> <td>\n8.0</td> <td>\n3.0.4</td> </tr> </tbody>\n</table>\n</div>\n<div id=\"compat-mobile\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE&nbsp;Phone</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td>\n3.0</td> <td>1.0 (1.8)\n</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td>\n3.0.4</td> </tr> </tbody>\n</table>\n</div>\n<p>The chart is based on <a title=\"en/SVG/Compatibility sources\" rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Compatibility_sources\">these sources</a>.</p>","examples":["<tr> <th scope=\"col\">Source code</th> <th scope=\"col\">Output result</th> </tr> <tr> <td>\n          <pre name=\"code\" class=\"xml\">&lt;?xml version=\"1.0\"?&gt;\n&lt;svg width=\"120\" height=\"120\" \n     viewPort=\"0 0 120 120\" version=\"1.1\"\n     xmlns=\"http://www.w3.org/2000/svg\"&gt;\n\n    &lt;polyline fill=\"none\" stroke=\"black\" \n              points=\"20,100 40,60 70,80 100,20\"/&gt;\n\n&lt;/svg&gt;</pre>\n        </td> <td>\n<iframe src=\"https://developer.mozilla.org/@api/deki/services/developer.mozilla.org/39/images/00770706-ef3b-c098-02e7-ff059dc17fa0.svg\" width=\"120px\" height=\"120px\" marginwidth=\"0\" marginheight=\"0\" hspace=\"0\" vspace=\"0\" frameborder=\"0\" scrolling=\"no\"></iframe>\n</td> </tr>"],"srcUrl":"https://developer.mozilla.org/en/SVG/Element/polyline","seeAlso":"<li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/line\">&lt;line&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/polygon\">&lt;polygon&gt;</a></code>\n</li>","summary":"The <code>polyline</code> element is an SVG basic shape, used to create a series of straight lines connecting several points. Typically a <code>polyline</code> is used to create open shapes","members":[{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/style","name":"style","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/points","name":"points","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/transform","name":"transform","help":"Specific attributes"},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/externalResourcesRequired","name":"externalResourcesRequired","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/class","name":"class","help":""}]},"FileEntrySync":{"title":"FileEntrySync","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td>13\n<span title=\"prefix\">webkit</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE&nbsp;Phone</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> </tr> </tbody> </table>\n</div>","summary":"<div><strong>DRAFT</strong> <div>This page is not complete.</div>\n</div>\n<p>The <code>FileEntrySync</code>&nbsp;interface of the <a title=\"en/DOM/File_API/File_System_API\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/File_API/File_System_API\">FileSystem API</a> represents a file in a file system.</p>","members":[{"name":"createWriter","help":"<p>Creates a new <code>FileWriter</code> associated with the file that the <code>FileEntry</code> represents.</p>\n<pre>void createWriter (\n in FileWriterCallback successCallback, optional ErrorCallback errorCallback\n);</pre>\n<div id=\"section_4\"><span id=\"Parameter\"></span><h5 class=\"editable\">Parameter</h5>\n<dl> <dt>successCallback</dt> <dd>A callback that is called with the new <code>FileWriter</code>.</dd> <dt>errorCallback</dt> <dd>A callback that is called when errors happen.</dd>\n</dl>\n</div><div id=\"section_5\"><span id=\"Returns\"></span><h5 class=\"editable\">Returns</h5>\n<dl> <dt><code>void</code></dt>\n</dl>\n</div>","obsolete":false},{"name":"file","help":"<p>Returns a File that represents the current state of the file that this <code>FileEntry</code> represents.</p>\n<pre>void file (\n  <em>FileCallback successCallback, optional ErrorCallback errorCallback</em>\n);</pre>\n<div id=\"section_7\"><span id=\"Parameter_2\"></span><h5 class=\"editable\">Parameter</h5>\n<dl> <dt>successCallback</dt> <dd>A callback that is called with the new <code>FileWriter</code>.</dd> <dt>errorCallback</dt> <dd>A callback that is called when errors happen.</dd>\n</dl>\n</div><div id=\"section_8\"><span id=\"Returns_2\"></span><h5 class=\"editable\">Returns</h5>\n<dl> <dt><code>void</code></dt>\n</dl>\n</div>","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/DOM/File_API/File_System_API/FileEntrySync"},"SVGFilterElement":{"title":"filter","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<p></p><div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th scope=\"col\">Feature</th> <th scope=\"col\">Chrome</th> <th scope=\"col\">Firefox (Gecko)</th> <th scope=\"col\">Internet Explorer</th> <th scope=\"col\">Opera</th> <th scope=\"col\">Safari</th> </tr><tr><td>Basic Support</td><td>1.0 [1]</td><td>4.0 (2.0)\n</td><td>\n10.0</td><td>9.0\n</td><td>\n3.0 [1]</td></tr></tbody></table></div>\n <div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th scope=\"col\">Feature</th> <th scope=\"col\">Android</th> <th scope=\"col\">Firefox Mobile (Gecko)</th> <th scope=\"col\">IE Phone</th> <th scope=\"col\">Opera Mobile</th> <th scope=\"col\">Safari Mobile</th> </tr><tr><td>Basic Support</td><td><span title=\"Compatibility unknown; please update this.\">?</span></td><td>4.0 (2.0)\n</td><td><span title=\"Not supported.\">--</span></td><td>9.5\n</td><td>\n3.0 [1]</td></tr></tbody></table></div><p></p>\n<p id=\"compatWebkit\">[1] There remain <a class=\"link-https\" rel=\"external\" href=\"https://bugs.webkit.org/show_bug.cgi?id=26389\" title=\"https://bugs.webkit.org/show_bug.cgi?id=26389\" target=\"_blank\">some issues</a> in Webkit browsers.</p>\n<p>The chart is based on <a title=\"en/SVG/Compatibility sources\" rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Compatibility_sources\">these sources</a>.</p>","srcUrl":"https://developer.mozilla.org/en/SVG/Element/filter","seeAlso":"<li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feBlend\">&lt;feBlend&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feColorMatrix\">&lt;feColorMatrix&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feComponentTransfer\">&lt;feComponentTransfer&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feComposite\">&lt;feComposite&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feConvolveMatrix\">&lt;feConvolveMatrix&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feDiffuseLighting\">&lt;feDiffuseLighting&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feDisplacementMap\">&lt;feDisplacementMap&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feFlood\">&lt;feFlood&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feGaussianBlur\">&lt;feGaussianBlur&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feImage\">&lt;feImage&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feMerge\">&lt;feMerge&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feMorphology\">&lt;feMorphology&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feOffset\">&lt;feOffset&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feSpecularLighting\">&lt;feSpecularLighting&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feTile\">&lt;feTile&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feTurbulence\">&lt;feTurbulence&gt;</a></code>\n</li> <li><a title=\"en/SVG/Tutorial/Filter_effects\" rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Tutorial/Filter_effects\">SVG tutorial: Filter effects</a></li>","summary":"The <code>filter</code> element serves as container for atomic filter operations. It is never rendered directly. A filter is referenced by using the \n<code><a rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Attribute/filter\" class=\"new\">filter</a></code> attribute on the target SVG element.","members":[{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/class","name":"class","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/filterRes","name":"filterRes","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/height","name":"height","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/primitiveUnits","name":"primitiveUnits","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/width","name":"width","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/filterUnits","name":"filterUnits","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/externalResourcesRequired","name":"externalResourcesRequired","help":"Specific attributes"},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/style","name":"style","help":""}]},"EntryCallback":{"title":"DirectoryEntrySync","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/File_API/File_System_API/DirectoryEntrySync","skipped":true,"cause":"Suspect title"},"AudioBuffer":{"title":"Introducing the Audio API extension","members":[],"srcUrl":"https://developer.mozilla.org/en/Introducing_the_Audio_API_Extension","skipped":true,"cause":"Suspect title"},"SVGAnimatedString":{"title":"SVGAnimatedString","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody>\n</table>\n</div>\n<div id=\"compat-mobile\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody>\n</table>\n</div>","summary":"The <code>SVGAnimatedString</code> interface is used for attributes of type <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DOMString\">DOMString</a></code>\n which can be animated.","members":[{"name":"baseVal","help":"The base value of the given attribute before applying any animations.","obsolete":false},{"name":"animVal","help":"If the given attribute or property is being animated, contains the current animated value of the attribute or property. If the given attribute or property is not currently being animated, contains the same value as <code>baseVal</code>.","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/DOM/SVGAnimatedString"},"RangeException":{"title":"window.btoa","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/window.btoa","skipped":true,"cause":"Suspect title"},"ProcessingInstruction":{"title":"ProcessingInstruction","srcUrl":"https://developer.mozilla.org/en/DOM/ProcessingInstruction","specification":"DOM Level 1 Core: ProcessingInstruction interface","seeAlso":"document.createProcessingInstruction","summary":"<p>A processing instruction provides an opportunity for application-specific instructions to be embedded within XML and which can be ignored by XML processors which do not support processing their instructions (outside of their having a place in the DOM).</p>\n<p>A Processing instruction is distinct from a <a title=\"en/XML/XML_Declaration\" rel=\"internal\" href=\"https://developer.mozilla.org/en/XML/XML_Declaration\" class=\"new \">XML Declaration</a> which is used for other information about the document such as encoding and which appear (if it does) as the first item in the document.</p>\n<p>User-defined processing instructions cannot begin with 'xml', as these are reserved (e.g., as used in &lt;?<a title=\"en/XML/xml-stylesheet\" rel=\"internal\" href=\"https://developer.mozilla.org/en/XML/xml-stylesheet\" class=\"new \">xml-stylesheet</a>&nbsp;?&gt;).</p>\n<p>Also inherits methods and properties from <a class=\"internal\" title=\"En/DOM/Node\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/Node\"><code>Node</code></a>.</p>","members":[{"name":"target","help":"","obsolete":false},{"name":"data","help":"","obsolete":false}]},"Uint16Array":{"title":"Uint16Array","srcUrl":"https://developer.mozilla.org/en/JavaScript_typed_arrays/Uint16Array","seeAlso":"<li><a class=\"link-https\" title=\"https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/doc/spec/TypedArray-spec.html\" rel=\"external\" href=\"https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/doc/spec/TypedArray-spec.html\" target=\"_blank\">Typed Array Specification</a></li> <li><a title=\"en/JavaScript typed arrays\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays\">JavaScript typed arrays</a></li>","summary":"<p>The <code>Uint16Array</code> type represents an array of unsigned 16-bit integers..</p>\n<p>Once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).</p>","constructor":"<div class=\"note\"><strong>Note:</strong> In these methods, <code><em>TypedArray</em></code> represents any of the <a title=\"en/JavaScript typed arrays/ArrayBufferView#Typed array subclasses\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/ArrayBufferView#Typed_array_subclasses\">typed array object types</a>.</div>\n<table class=\"standard-table\"> <tbody> <tr> <td><code>Uint16Array <a title=\"en/JavaScript typed arrays/Uint16Array#Uint16Array()\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/Uint16Array#Uint16Array()\">Uint16Array</a>(unsigned long length);<br> </code></td> </tr> <tr> <td><code>Uint16Array </code><code><a title=\"en/JavaScript typed arrays/Uint16Array#Uint16Array()\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/Uint16Array#Uint16Array%28%29\">Uint16Array</a></code><code>(<em>TypedArray</em> array);<br> </code></td> </tr> <tr> <td><code>Uint16Array </code><code><a title=\"en/JavaScript typed arrays/Uint16Array#Uint16Array()\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/Uint16Array#Uint16Array%28%29\">Uint16Array</a></code><code>(sequence&lt;type&gt; array);<br> </code></td> </tr> <tr> <td><code>Uint16Array </code><code><a title=\"en/JavaScript typed arrays/Uint16Array#Uint16Array()\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/Uint16Array#Uint16Array%28%29\">Uint16Array</a></code><code>(ArrayBuffer buffer, optional unsigned long byteOffset, optional unsigned long length);<br> </code></td> </tr> </tbody>\n</table><p>Returns a new <code>Uint16Array</code> object.</p>\n<pre>Uint16Array Uint16Array(\n&nbsp; unsigned long length\n);\n\nUint16Array Uint16Array(\n&nbsp; <em>TypedArray</em> array\n);\n\nUint16Array Uint16Array(\n&nbsp; sequence&lt;type&gt; array\n);\n\nUint16Array Uint16Array(\n&nbsp; ArrayBuffer buffer,\n&nbsp; optional unsigned long byteOffset,\n&nbsp; optional unsigned long length\n);\n</pre>\n<div id=\"section_7\"><span id=\"Parameters\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>length</code></dt> <dd>The number of elements in the byte array. If unspecified, length of the array view will match the buffer's length.</dd> <dt><code>array</code></dt> <dd>An object of any of the typed array types (such as <code>Int32Array</code>), or a sequence of objects of a particular type, to copy into a new <a title=\"en/JavaScript typed arrays/ArrayBuffer\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/ArrayBuffer\"><code>ArrayBuffer</code></a>. Each value in the source array is converted to a 16-bit unsigned integer before being copied into the new array.</dd> <dt><code>buffer</code></dt> <dd>An existing <a title=\"en/JavaScript typed arrays/ArrayBuffer\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/ArrayBuffer\"><code>ArrayBuffer</code></a> to use as the storage for the new <code>Uint16Array</code> object.</dd> <dt><code>byteOffset<br> </code></dt> <dd>The offset, in bytes, to the first byte in the specified buffer for the new view to reference. If not specified, the <code>Uint16Array</code>'s view of the buffer will start with the first byte.</dd>\n</dl>\n</div><div id=\"section_8\"><span id=\"Return_value\"></span><h6 class=\"editable\">Return value</h6>\n<p>A new <code>Uint16Array</code> object representing the specified data buffer.</p>\n</div>","members":[{"name":"subarray","help":"<p>Returns a new <code>Uint16Array</code> view on the <a title=\"en/JavaScript typed arrays/ArrayBuffer\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/ArrayBuffer\"><code>ArrayBuffer</code></a> store for this <code>Uint16Array</code> object.</p>\n\n<div id=\"section_15\"><span id=\"Parameters_3\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>begin</code></dt> <dd>The offset to the first element in the array to be referenced by the new <code>Uint16Array</code> object.</dd> <dt><code>end</code> \n<span title=\"\">Optional</span>\n</dt> <dd>The offset to the last element in the array to be referenced by the new <code>Uint16Array</code> object; if not specified, all elements from the one specified by <code>begin</code> to the end of the array are included in the new view.</dd>\n</dl>\n</div><div id=\"section_16\"><span id=\"Notes_2\"></span><h6 class=\"editable\">Notes</h6>\n<p>The range specified by <code>begin</code> and <code>end</code> is clamped to the valid index range for the current array; if the computed length of the new array would be negative, it's clamped to zero. If either <code>begin</code> or <code>end</code> is negative, it refers to an index from the end of the array instead of from the beginning.</p>\n<div class=\"note\"><strong>Note:</strong> Keep in mind that this is creating a new view on the existing buffer; changes to the new object's contents will impact the original object and vice versa.</div>\n</div>","idl":"<pre>Uint16Array subarray(\n&nbsp; long begin,\n&nbsp; optional long end\n);\n</pre>","obsolete":false},{"name":"set","help":"<p>Sets multiple values in the typed array, reading input values from a specified array.</p>\n\n<div id=\"section_13\"><span id=\"Parameters_2\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>array</code></dt> <dd>An array from which to copy values. All values from the source array are copied into the target array, unless the length of the source array plus the offset exceeds the length of the target array, in which case an exception is thrown. If the source array is a typed array, the two arrays may share the same underlying <code><a title=\"en/JavaScript typed arrays/ArrayBuffer\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/ArrayBuffer\">ArrayBuffer</a></code>; the browser will intelligently copy the source range of the buffer to the destination range.</dd> <dt>offset \n<span title=\"\">Optional</span>\n</dt> <dd>The offset into the target array at which to begin writing values from the source <code>array</code>. If you omit this value, 0 is assumed (that is, the source <code>array</code> will overwrite values in the target array starting at index 0).</dd>\n</dl>\n</div>","idl":"<pre>void set(\n&nbsp; <em>TypedArray</em> array,\n&nbsp; optional unsigned long offset\n);\n\nvoid set(\n&nbsp; type[] array,\n&nbsp; optional unsigned long offset\n);\n</pre>","obsolete":false},{"name":"BYTES_PER_ELEMENT","help":"The size, in bytes, of each array element.","obsolete":false},{"name":"length","help":"The number of entries in the array. <strong>Read only.</strong>","obsolete":false}]},"HTMLTextAreaElement":{"title":"HTMLTextAreaElement","examples":["<p>Insert HTML tags or <em>smiles</em> or any custom text in a textarea:</p>\n\n          <pre name=\"code\" class=\"xml\">&lt;!doctype html&gt;\n&lt;html&gt;\n&lt;head&gt;\n&lt;meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" /&gt;\n&lt;title&gt;MDC Example&lt;/title&gt;\n&lt;script type=\"text/javascript\"&gt;\n\tfunction insertMetachars(sStartTag, sEndTag) {\n\t\tvar bDouble = arguments.length &gt; 1, oMsgInput = document.myForm.myTxtArea, nSelStart = oMsgInput.selectionStart, nSelEnd = oMsgInput.selectionEnd, sOldText = oMsgInput.value;\n\t\toMsgInput.value = sOldText.substring(0, nSelStart) + (bDouble ? sStartTag + sOldText.substring(nSelStart, nSelEnd) + sEndTag : sStartTag) + sOldText.substring(nSelEnd);\n\t\toMsgInput.setSelectionRange(bDouble || nSelStart === nSelEnd ? nSelStart + sStartTag.length : nSelStart, (bDouble ? nSelEnd : nSelStart) + sStartTag.length);\n\t\toMsgInput.focus();\n\t}\n&lt;/script&gt;\n&lt;style type=\"text/css\"&gt;\n\t.intLink {\n\t\tcursor: pointer;\n\t\ttext-decoration: underline;\n\t\tcolor: #0000ff;\n\t}\n&lt;/style&gt;\n&lt;/head&gt;\n\n&lt;body&gt;\n\n&lt;form name=\"myForm\"&gt;\n&lt;p&gt;[&amp;nbsp;&lt;span class=\"intLink\" onclick=\"insertMetachars('&amp;lt;strong&amp;gt;','&amp;lt;\\/strong&amp;gt;');\"&gt;&lt;strong&gt;Bold&lt;/strong&gt;&lt;/span&gt; | &lt;span class=\"intLink\" onclick=\"insertMetachars('&amp;lt;em&amp;gt;','&amp;lt;\\/em&amp;gt;');\"&gt;&lt;em&gt;Italic&lt;/em&gt;&lt;/span&gt; | &lt;span class=\"intLink\" onclick=\"var newURL=prompt('Enter the full URL for the link');if(newURL){insertMetachars('&amp;lt;a href=\\u0022'+newURL+'\\u0022&amp;gt;','&amp;lt;\\/a&amp;gt;');}else{document.myForm.myTxtArea.focus();}\"&gt;URL&lt;/span&gt; | &lt;span class=\"intLink\" onclick=\"insertMetachars('\\n&amp;lt;code&amp;gt;\\n','\\n&amp;lt;\\/code&amp;gt;\\n');\"&gt;code&lt;/span&gt; | &lt;span class=\"intLink\" onclick=\"insertMetachars(' :-)');\"&gt;smile&lt;/span&gt; | etc. etc.&amp;nbsp;]&lt;/p&gt;\n&lt;p&gt;&lt;textarea rows=\"10\" cols=\"50\" name=\"myTxtArea\"&gt;Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut facilisis, arcu vitae adipiscing placerat, nisl lectus accumsan nisi, vitae iaculis sem neque vel lectus. Praesent tristique commodo lorem quis fringilla. Sed ac tellus eros. Sed consectetur eleifend felis vitae luctus. Praesent sagittis, est eget bibendum tincidunt, ligula diam tincidunt augue, a fermentum odio velit eget mi. Phasellus mattis, elit id fringilla semper, orci magna cursus ligula, non venenatis lacus augue sit amet dui. Pellentesque lacinia odio id nisi pulvinar commodo tempus at odio. Ut consectetur eros porttitor nunc mollis ultrices. Aenean porttitor, purus sollicitudin viverra auctor, neque erat blandit sapien, sit amet tincidunt massa mi ac nibh. Proin nibh sem, bibendum ut placerat nec, cursus et lacus. Phasellus vel augue turpis. Nunc eu mauris eu leo blandit mollis interdum eget lorem. &lt;/textarea&gt;&lt;/p&gt;\n&lt;/form&gt;\n\n&lt;/body&gt;\n&lt;/html&gt;</pre>\n        \n<p>Create a textarea with a maximum number of characters per line and a maximum number of lines:</p>\n\n          <pre name=\"code\" class=\"xml\">&lt;!doctype html&gt;\n&lt;html&gt;\n&lt;head&gt;\n&lt;meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" /&gt;\n&lt;title&gt;MDC Example&lt;/title&gt;\n&lt;script type=\"text/javascript\"&gt;\nfunction checkRows(oField, oKeyEvent) {\n\tvar\tnKey = (oKeyEvent || /* old IE */ window.event || /* check is not supported! */ { keyCode: 38 }).keyCode,\n\n\t\t// put here the maximum number of characters per line:\n\t\tnCols = 30,\n\t\t// put here the maximum number of lines:\n\t\tnRows = 5,\n\n\t\tnSelS = oField.selectionStart, nSelE = oField.selectionEnd,\n\t\tsVal = oField.value, nLen = sVal.length,\n\n\t\tnBackward = nSelS &gt;= nCols ? nSelS - nCols : 0,\n\t\tnDeltaForw = sVal.substring(nBackward, nSelS).search(new RegExp(\"\\\\n(?!.{0,\" + String(nCols - 2) + \"}\\\\n)\")) + 1,\n\t\tnRowStart = nBackward + nDeltaForw,\n\t\taReturns = (sVal.substring(0, nSelS) + sVal.substring(nSelE, sVal.length)).match(/\\n/g),\n\t\tnRowEnd = nSelE + nRowStart + nCols - nSelS,\n\t\tsRow = sVal.substring(nRowStart, nSelS) + sVal.substring(nSelE, nRowEnd &gt; nLen ? nLen : nRowEnd),\n\t\tbKeepCols = nKey === 13 || nLen + 1 &lt; nCols || /\\n/.test(sRow) || ((nRowStart === 0 || nDeltaForw &gt; 0 || nKey &gt; 0) &amp;&amp; (sRow.length &lt; nCols || (nKey &gt; 0 &amp;&amp; (nLen === nRowEnd || sVal.charAt(nRowEnd) === \"\\n\"))));\n\n\treturn (nKey !== 13 || (aReturns ? aReturns.length + 1 : 1) &lt; nRows) &amp;&amp; ((nKey &gt; 32 &amp;&amp; nKey &lt; 41) || bKeepCols);\n}\n&lt;/script&gt;\n&lt;/head&gt;\n\n&lt;body&gt;\n&lt;p&gt;Textarea with fixed number of characters per line:&lt;br /&gt;\n&lt;textarea cols=\"50\" rows=\"10\" name=\"myInput\" onkeypress=\"return checkRows(this, event);\" onpaste=\"return false;\" /&gt;&lt;/textarea&gt;&lt;/p&gt;\n&lt;/form&gt;\n&lt;/body&gt;\n&lt;/html&gt;</pre>"],"summary":"DOM <code>TextArea</code> objects expose the <a title=\"http://dev.w3.org/html5/spec/the-button-element.html#the-textarea-element\" class=\" external\" rel=\"external\" href=\"http://dev.w3.org/html5/spec/the-button-element.html#the-textarea-element\" target=\"_blank\">HTMLTextAreaElement</a> (or \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML\">HTML 4</a></span> <code><a title=\"http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-24874179\" class=\"external\" rel=\"external\" href=\"http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-24874179\" target=\"_blank\">HTMLTextAreaElement</a></code>) interface, which provides special properties and methods (beyond the regular <a title=\"en/DOM/element\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/element\">element</a> object interface they also have available to them by inheritance) for manipulating the layout and presentation of <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/textarea\">&lt;textarea&gt;</a></code>\n elements.","members":[{"name":"blur","help":"Removes input focus from this control. \n\n<span title=\"\">Obsolete</span> in \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span>","obsolete":true},{"name":"checkValidity","help":"Returns false if the button is a candidate for constraint validation, and it does not satisfy its constraints. In this case, it also fires an <code>invalid</code> event at the control. It returns true if the control is not a candidate for constraint validation, or if it satisfies its constraints.","obsolete":false},{"name":"focus","help":"Gives input focus to this control. \n\n<span title=\"\">Obsolete</span> in \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span>","obsolete":true},{"name":"select","help":"Selects the contents of the control.","obsolete":false},{"name":"setCustomValidity","help":"Sets a custom validity message for the element. If this message is not the empty string, then the element is suffering from a custom validity error, and does not validate.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Input.setSelectionRange","name":"setSelectionRange","help":"Selects a range of text, and sets <code>selectionStart</code> and <code>selectionEnd</code>. If either argument is greater than the length of the value, it is treated as pointing to the end of the value. If <code>end</code> is less than <code>start</code>, then both are treated as the value of <code>end</code>.","obsolete":false},{"name":"accessKey","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/textarea#attr-accesskey\">accesskey</a></code>\n HTML attribute. \n\n<span title=\"\">Obsolete</span> in \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span>","obsolete":true},{"name":"autofocus","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/textarea#attr-autofocus\">autofocus</a></code>\n HTML&nbsp;attribute, indicating that the control should have input focus when the page loads","obsolete":false},{"name":"cols","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/textarea#attr-cols\">cols</a></code>\n HTML attribute, indicating the visible width of the text area.","obsolete":false},{"name":"defaultValue","help":"The control's default value, which behaves like the <strong><a title=\"en/DOM/element.textContent\" rel=\"internal\" href=\"https://developer.mozilla.org/En/DOM/Node.textContent\">textContent</a></strong> property.","obsolete":false},{"name":"disabled","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/textarea#attr-disabled\">disabled</a></code>\n HTML attribute, indicating that the control is not available for interaction.","obsolete":false},{"name":"form","help":"<p>The containing form element, if this element is in a form. If this element is not contained in a form element:</p> <ul> <li>\n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span> this can be the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/form#attr-id\">id</a></code>\n attribute of any <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/form\">&lt;form&gt;</a></code>\n element in the same document.</li> <li>\n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML\">HTML 4</a></span> this must be <code>null</code>.</li> </ul>","obsolete":false},{"name":"labels","help":"A list of <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/label\">&lt;label&gt;</a></code>\n elements that are labels for this element.","obsolete":false},{"name":"maxLength","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/textarea#attr-maxlength\">maxlength</a></code>\n HTML&nbsp;attribute, indicating the maximum number of characters the user can enter. This constraint is evaluated only when the value changes.","obsolete":false},{"name":"name","help":"Reflects \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/textarea#attr-name\">name</a></code>\n HTML attribute, containing the name of the control.","obsolete":false},{"name":"placeholder","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/textarea#attr-placeholder\">placeholder</a></code>\n HTML attribute, containing a hint to the user about what to enter in the control.","obsolete":false},{"name":"readOnly","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/textarea#attr-readonly\">readonly</a></code>\n HTML attribute, indicating that the user cannot modify the value of the control.","obsolete":false},{"name":"required","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/textarea#attr-required\">required</a></code>\n HTML attribute, indicating that the user must specify a value before submitting the form.","obsolete":false},{"name":"rows","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/textarea#attr-rows\">rows</a></code>\n HTML attribute, indicating the number of visible text lines for the control.","obsolete":false},{"name":"selectionDirection","help":"The direction in which selection occurred. This is \"forward\" if selection was performed in the start-to-end direction of the current locale, or \"backward\" for the opposite direction. This can also be \"none\"&nbsp;if the direction is unknown.\"","obsolete":false},{"name":"selectionEnd","help":"The index of the end of selected text. \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span> If no text is selected, contains the index of the character that follows the input cursor. On being set, the control behaves as if <strong>setSelectionRange</strong>() had been called with this as the second argument, and <strong>selectionStart</strong> as the first argument.","obsolete":false},{"name":"selectionStart","help":"The index of the beginning of selected text. \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span> If no text is selected, contains the index of the character that follows the input cursor. On being set, the control behaves as if <strong>setSelectionRange</strong>() had been called with this as the first argument, and <strong>selectionEnd</strong> as the second argument.","obsolete":false},{"name":"tabIndex","help":"The position of the element in the tabbing navigation order for the current document. \n\n<span title=\"\">Obsolete</span> in \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span>","obsolete":true},{"name":"textLength","help":"The codepoint length of the control's value.","obsolete":false},{"name":"type","help":"The string <code>textarea</code>.","obsolete":false},{"name":"validationMessage","help":"A localized message that describes the validation constraints that the control does not satisfy (if any). This is the empty string if the control is not a candidate for constraint validation (<strong>willValidate</strong> is false), or it satisfies its constraints.","obsolete":false},{"name":"validity","help":"The validity states that this element is in.","obsolete":false},{"name":"value","help":"The raw value contained in the control.","obsolete":false},{"name":"willValidate","help":"Indicates whether the element is a candidate for constraint validation. It is false if any conditions bar it from constraint validation.","obsolete":false},{"name":"wrap","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/textarea#attr-wrap\">wrap</a></code>\n HTML attribute, indicating how the control wraps text.","obsolete":false},{"name":"blur","help":"Removes input focus from this control. \n\n<span title=\"\">Obsolete</span> in \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span>","obsolete":true},{"name":"checkValidity","help":"Returns false if the button is a candidate for constraint validation, and it does not satisfy its constraints. In this case, it also fires an <code>invalid</code> event at the control. It returns true if the control is not a candidate for constraint validation, or if it satisfies its constraints.","obsolete":false},{"name":"focus","help":"Gives input focus to this control. \n\n<span title=\"\">Obsolete</span> in \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span>","obsolete":true},{"name":"select","help":"Selects the contents of the control.","obsolete":false},{"name":"setCustomValidity","help":"Sets a custom validity message for the element. If this message is not the empty string, then the element is suffering from a custom validity error, and does not validate.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Input.setSelectionRange","name":"setSelectionRange","help":"Selects a range of text, and sets <code>selectionStart</code> and <code>selectionEnd</code>. If either argument is greater than the length of the value, it is treated as pointing to the end of the value. If <code>end</code> is less than <code>start</code>, then both are treated as the value of <code>end</code>.","obsolete":false},{"name":"accessKey","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/textarea#attr-accesskey\">accesskey</a></code>\n HTML attribute. \n\n<span title=\"\">Obsolete</span> in \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span>","obsolete":true},{"name":"autofocus","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/textarea#attr-autofocus\">autofocus</a></code>\n HTML&nbsp;attribute, indicating that the control should have input focus when the page loads","obsolete":false},{"name":"cols","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/textarea#attr-cols\">cols</a></code>\n HTML attribute, indicating the visible width of the text area.","obsolete":false},{"name":"defaultValue","help":"The control's default value, which behaves like the <strong><a title=\"en/DOM/element.textContent\" rel=\"internal\" href=\"https://developer.mozilla.org/En/DOM/Node.textContent\">textContent</a></strong> property.","obsolete":false},{"name":"disabled","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/textarea#attr-disabled\">disabled</a></code>\n HTML attribute, indicating that the control is not available for interaction.","obsolete":false},{"name":"form","help":"<p>The containing form element, if this element is in a form. If this element is not contained in a form element:</p> <ul> <li>\n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span> this can be the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/form#attr-id\">id</a></code>\n attribute of any <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/form\">&lt;form&gt;</a></code>\n element in the same document.</li> <li>\n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML\">HTML 4</a></span> this must be <code>null</code>.</li> </ul>","obsolete":false},{"name":"labels","help":"A list of <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/label\">&lt;label&gt;</a></code>\n elements that are labels for this element.","obsolete":false},{"name":"maxLength","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/textarea#attr-maxlength\">maxlength</a></code>\n HTML&nbsp;attribute, indicating the maximum number of characters the user can enter. This constraint is evaluated only when the value changes.","obsolete":false},{"name":"name","help":"Reflects \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/textarea#attr-name\">name</a></code>\n HTML attribute, containing the name of the control.","obsolete":false},{"name":"placeholder","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/textarea#attr-placeholder\">placeholder</a></code>\n HTML attribute, containing a hint to the user about what to enter in the control.","obsolete":false},{"name":"readOnly","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/textarea#attr-readonly\">readonly</a></code>\n HTML attribute, indicating that the user cannot modify the value of the control.","obsolete":false},{"name":"required","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/textarea#attr-required\">required</a></code>\n HTML attribute, indicating that the user must specify a value before submitting the form.","obsolete":false},{"name":"rows","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/textarea#attr-rows\">rows</a></code>\n HTML attribute, indicating the number of visible text lines for the control.","obsolete":false},{"name":"selectionDirection","help":"The direction in which selection occurred. This is \"forward\" if selection was performed in the start-to-end direction of the current locale, or \"backward\" for the opposite direction. This can also be \"none\"&nbsp;if the direction is unknown.\"","obsolete":false},{"name":"selectionEnd","help":"The index of the end of selected text. \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span> If no text is selected, contains the index of the character that follows the input cursor. On being set, the control behaves as if <strong>setSelectionRange</strong>() had been called with this as the second argument, and <strong>selectionStart</strong> as the first argument.","obsolete":false},{"name":"selectionStart","help":"The index of the beginning of selected text. \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span> If no text is selected, contains the index of the character that follows the input cursor. On being set, the control behaves as if <strong>setSelectionRange</strong>() had been called with this as the first argument, and <strong>selectionEnd</strong> as the second argument.","obsolete":false},{"name":"tabIndex","help":"The position of the element in the tabbing navigation order for the current document. \n\n<span title=\"\">Obsolete</span> in \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span>","obsolete":true},{"name":"textLength","help":"The codepoint length of the control's value.","obsolete":false},{"name":"type","help":"The string <code>textarea</code>.","obsolete":false},{"name":"validationMessage","help":"A localized message that describes the validation constraints that the control does not satisfy (if any). This is the empty string if the control is not a candidate for constraint validation (<strong>willValidate</strong> is false), or it satisfies its constraints.","obsolete":false},{"name":"validity","help":"The validity states that this element is in.","obsolete":false},{"name":"value","help":"The raw value contained in the control.","obsolete":false},{"name":"willValidate","help":"Indicates whether the element is a candidate for constraint validation. It is false if any conditions bar it from constraint validation.","obsolete":false},{"name":"wrap","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/textarea#attr-wrap\">wrap</a></code>\n HTML attribute, indicating how the control wraps text.","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/DOM/HTMLTextAreaElement"},"HTMLProgressElement":{"title":"progress","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari</th> </tr> <tr> <td>Basic support</td> <td>6.0</td> <td>6.0 (6.0)\n</td> <td><span title=\"Not supported.\">--</span></td> <td>11.0</td> <td><span title=\"Not supported.\">--</span></td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Not supported.\">--</span></td> <td>6.0 (6.0)\n</td> <td><span title=\"Not supported.\">--</span></td> <td>11.0</td> <td><span title=\"Not supported.\">--</span></td> </tr> </tbody> </table>\n</div>","examples":["&lt;progress value=\"70\" max=\"100\"&gt;70 %&lt;/progress&gt;"],"srcUrl":"https://developer.mozilla.org/en/HTML/Element/progress","seeAlso":"<li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/CSS/orient\">orient</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/CSS/%3Aindeterminate\">:indeterminate</a></code>\n</li>","summary":"The HTML <em>progress</em> (<code>&lt;progress&gt;</code>) element is used to view the completion progress of a task. While the specifics of how it's displayed is left up to the browser developer, it's typically displayed as a progress bar.","members":[{"obsolete":false,"url":"","name":"max","help":"This attribute describes how much work the task indicated by the <code>progress</code> element requires."},{"obsolete":false,"url":"","name":"form","help":"This attribute specifies the form which the <code>progress</code> element belongs to."},{"obsolete":false,"url":"","name":"value","help":"<dl><dd>This attribute specifies how much of the task that has been completed. If there is no <code>value</code> attribute, the progress bar is indeterminate; this indicates that an activity is ongoing with no indication of how long it is expected to take.</dd>\n</dl>\n<p>You can use the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/CSS/orient\">orient</a></code>\n property to specify whether the progress bar should be rendered horizontally (the default) or vertically. The <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/CSS/%3Aindeterminate\">:indeterminate</a></code>\n pseudo-class can be used to match against indeterminate progress bars.</p>"}]},"Float64Array":{"title":"Float64Array","srcUrl":"https://developer.mozilla.org/en/JavaScript_typed_arrays/Float64Array","seeAlso":"<li><a class=\"link-https\" title=\"https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/doc/spec/TypedArray-spec.html\" rel=\"external\" href=\"https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/doc/spec/TypedArray-spec.html\" target=\"_blank\">Typed Array Specification</a></li> <li><a title=\"en/JavaScript typed arrays\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays\">JavaScript typed arrays</a></li>","summary":"<p>The <code>Float64Array</code> type represents an array of 64-bit floating point numbers (corresponding to the C <code>double</code> data type).</p>\n<p>Once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).</p>","constructor":"<div class=\"note\"><strong>Note:</strong> In these methods, <code><em>TypedArray</em></code> represents any of the <a title=\"en/JavaScript typed arrays/ArrayBufferView#Typed array subclasses\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/ArrayBufferView#Typed_array_subclasses\">typed array object types</a>.</div>\n<table class=\"standard-table\"> <tbody> <tr> <td><code>Float64Array <a title=\"en/JavaScript typed arrays/Float64Array#Float64Array()\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/Float64Array#Float64Array%28%29\">Float64Array</a>(unsigned long length);<br> </code></td> </tr> <tr> <td><code>Float64Array </code><code><a title=\"en/JavaScript typed arrays/Float64Array#Float64Array()\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/Float64Array#Float64Array%28%29\">Float64Array</a></code><code>(<em>TypedArray</em> array);<br> </code></td> </tr> <tr> <td><code>Float64Array </code><code><a title=\"en/JavaScript typed arrays/Float64Array#Float64Array()\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/Float64Array#Float64Array%28%29\">Float64Array</a></code><code>(sequence&lt;type&gt; array);<br> </code></td> </tr> <tr> <td><code>Float64Array </code><code><a title=\"en/JavaScript typed arrays/Float64Array#Float64Array()\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/Float64Array#Float64Array%28%29\">Float64Array</a></code><code>(ArrayBuffer buffer, optional unsigned long byteOffset, optional unsigned long length);<br> </code></td> </tr> </tbody>\n</table><p>Returns a new <code>Float64Array</code> object.</p>\n<pre>Float64Array Float64Array(\n&nbsp; unsigned long length\n);\n\nFloat64Array Float64Array(\n&nbsp; <em>TypedArray</em> array\n);\n\nFloat64Array Float64Array(\n&nbsp; sequence&lt;type&gt; array\n);\n\nFloat64Array Float64Array(\n&nbsp; ArrayBuffer buffer,\n&nbsp; optional unsigned long byteOffset,\n&nbsp; optional unsigned long length\n);\n</pre>\n<div id=\"section_7\"><span id=\"Parameters\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>length</code></dt> <dd>The number of elements in the byte array. If unspecified, length of the array view will match the buffer's length.</dd> <dt><code>array</code></dt> <dd>An object of any of the typed array types (such as <span>Uint8</span><code>Array</code>), or a sequence of objects of a particular type, to copy into a new <a title=\"en/JavaScript typed arrays/ArrayBuffer\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/ArrayBuffer\"><code>ArrayBuffer</code></a>. Each value in the source array is converted to a 64-bit floating point number before being copied into the new array.</dd> <dt><code>buffer</code></dt> <dd>An existing <a title=\"en/JavaScript typed arrays/ArrayBuffer\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/ArrayBuffer\"><code>ArrayBuffer</code></a> to use as the storage for the new <code>Float64Array</code> object.</dd> <dt><code>byteOffset<br> </code></dt> <dd>The offset, in bytes, to the first byte in the specified buffer for the new view to reference. If not specified, the <code>Float64Array</code>'s view of the buffer will start with the first byte.</dd>\n</dl>\n</div><div id=\"section_8\"><span id=\"Return_value\"></span><h6 class=\"editable\">Return value</h6>\n<p>A new <code>Float64Array</code> object representing the specified data buffer.</p>\n</div>","members":[{"name":"subarray","help":"<p>Returns a new <code>Float64Array</code> view on the <a title=\"en/JavaScript typed arrays/ArrayBuffer\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/ArrayBuffer\"><code>ArrayBuffer</code></a> store for this <code>Float64Array</code> object.</p>\n\n<div id=\"section_15\"><span id=\"Parameters_3\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>begin</code></dt> <dd>The offset to the first element in the array to be referenced by the new <code>Float64Array</code> object.</dd> <dt><code>end</code> \n<span title=\"\">Optional</span>\n</dt> <dd>The offset to the last element in the array to be referenced by the new <code>Float64Array</code> object; if not specified, all elements from the one specified by <code>begin</code> to the end of the array are included in the new view.</dd>\n</dl>\n</div><div id=\"section_16\"><span id=\"Notes_2\"></span><h6 class=\"editable\">Notes</h6>\n<p>The range specified by <code>begin</code> and <code>end</code> is clamped to the valid index range for the current array; if the computed length of the new array would be negative, it's clamped to zero. If either <code>begin</code> or <code>end</code> is negative, it refers to an index from the end of the array instead of from the beginning.</p>\n<div class=\"note\"><strong>Note:</strong> Keep in mind that this is creating a new view on the existing buffer; changes to the new object's contents will impact the original object and vice versa.</div>\n</div>","idl":"<pre>Float64Array subarray(\n&nbsp; long begin,\n&nbsp; optional long end\n);\n</pre>","obsolete":false},{"name":"set","help":"<p>Sets multiple values in the typed array, reading input values from a specified array.</p>\n\n<div id=\"section_13\"><span id=\"Parameters_2\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>array</code></dt> <dd>An array from which to copy values. All values from the source array are copied into the target array, unless the length of the source array plus the offset exceeds the length of the target array, in which case an exception is thrown. If the source array is a typed array, the two arrays may share the same underlying <code><a title=\"en/JavaScript typed arrays/ArrayBuffer\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/ArrayBuffer\">ArrayBuffer</a></code>; the browser will intelligently copy the source range of the buffer to the destination range.</dd> <dt>offset \n<span title=\"\">Optional</span>\n</dt> <dd>The offset into the target array at which to begin writing values from the source <code>array</code>. If you omit this value, 0 is assumed (that is, the source <code>array</code> will overwrite values in the target array starting at index 0).</dd>\n</dl>\n</div>","idl":"<pre>void set(\n&nbsp; <em>TypedArray</em> array,\n&nbsp; optional unsigned long offset\n);\n\nvoid set(\n&nbsp; type[] array,\n&nbsp; optional unsigned long offset\n);\n</pre>","obsolete":false},{"name":"BYTES_PER_ELEMENT","help":"The size, in bytes, of each array element.","obsolete":false},{"name":"length","help":"The number of entries in the array. <strong>Read only.</strong>","obsolete":false}]},"XMLHttpRequest":{"title":"XMLHttpRequest","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td>1</td> <td>1.0</td> <td> <p>5 (via ActiveXObject)</p> <p>7 (XMLHttpRequest)</p> </td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td>1.2</td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE&nbsp;Phone</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>","srcUrl":"https://developer.mozilla.org/en/XMLHttpRequest","seeAlso":"<li>MDN articles about XMLHttpRequest: <ul> <li><a title=\"en/AJAX/Getting_Started\" rel=\"internal\" href=\"https://developer.mozilla.org/en/AJAX/Getting_Started\">AJAX - Getting Started</a></li> <li><a class=\"internal\" title=\"En/Using XMLHttpRequest\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/XMLHttpRequest/Using_XMLHttpRequest\">Using XMLHttpRequest</a></li> <li><a title=\"en/HTML_in_XMLHttpRequest\" rel=\"internal\" href=\"https://developer.mozilla.org/en/HTML_in_XMLHttpRequest\">HTML in XMLHttpRequest</a></li> <li><a title=\"en/XMLHttpRequest/FormData\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/XMLHttpRequest/FormData\"><code>FormData</code></a></li> </ul> </li> <li>XMLHttpRequest references from W3C and browser vendors: <ul> <li><a class=\"external\" rel=\"external\" href=\"http://www.w3.org/TR/XMLHttpRequest/\" title=\"http://www.w3.org/TR/XMLHttpRequest/\" target=\"_blank\">W3C: XMLHttpRequest</a> (base features)</li> <li><a class=\"external\" title=\"http://dvcs.w3.org/hg/xhr/raw-file/tip/Overview.html\" rel=\"external\" href=\"http://dvcs.w3.org/hg/xhr/raw-file/tip/Overview.html\" target=\"_blank\">W3C: XMLHttpRequest</a> (latest editor's draft with extensions to the base functionality, formerly <a class=\"external\" title=\"http://www.w3.org/TR/XMLHttpRequest2/\" rel=\"external\" href=\"http://www.w3.org/TR/XMLHttpRequest2/\" target=\"_blank\">XMLHttpRequest Level 2</a>)</li> <li><a class=\"external\" rel=\"external\" href=\"http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk/html/xmobjxmlhttprequest.asp\" title=\"http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk/html/xmobjxmlhttprequest.asp\" target=\"_blank\">Microsoft documentation</a></li> <li><a class=\"external\" rel=\"external\" href=\"http://developer.apple.com/internet/webcontent/xmlhttpreq.html\" title=\"http://developer.apple.com/internet/webcontent/xmlhttpreq.html\" target=\"_blank\">Apple developers' reference</a></li> </ul> </li> <li><a class=\"external\" rel=\"external\" href=\"http://jibbering.com/2002/4/httprequest.html\" title=\"http://jibbering.com/2002/4/httprequest.html\" target=\"_blank\">\"Using the XMLHttpRequest Object\" (jibbering.com)</a></li> <li><a class=\"external\" rel=\"external\" href=\"http://www.peej.co.uk/articles/rich-user-experience.html\" title=\"http://www.peej.co.uk/articles/rich-user-experience.html\" target=\"_blank\">XMLHttpRequest - REST and the Rich User Experience</a></li>","summary":"<p><code>XMLHttpRequest</code> is a <a class=\"internal\" title=\"En/JavaScript\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript\">JavaScript</a> object that was designed by Microsoft and adopted by Mozilla, Apple, and Google. It's now being <a class=\"external\" title=\"http://www.w3.org/TR/XMLHttpRequest/\" rel=\"external\" href=\"http://www.w3.org/TR/XMLHttpRequest/\" target=\"_blank\">standardized in the W3C</a>. It provides an easy way to retrieve data at a URL. Despite its name, <code>XMLHttpRequest</code> can be used to retrieve any type of data, not just XML, and it supports protocols other than <a title=\"en/HTTP\" rel=\"internal\" href=\"https://developer.mozilla.org/en/HTTP\">HTTP</a> (including <code>file</code> and <code>ftp</code>).</p>\n<p>To create an instance of <code>XMLHttpRequest</code>, simply do this:</p>\n<pre>var req = new XMLHttpRequest();\n</pre>\n<p>For details about how to use <code>XMLHttpRequest</code>, see <a class=\"internal\" title=\"En/Using XMLHttpRequest\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/XMLHttpRequest/Using_XMLHttpRequest\">Using XMLHttpRequest</a>.</p>","members":[{"name":"sendAsBinary","help":"<div id=\"section_12\"><p><span title=\"(Firefox 3)\n\">Requires Gecko 1.9</span>\n</p>\n<p>A variant of the <code>send()</code>method that sends binary data.</p>\n\n</div><div id=\"section_13\"><span id=\"Parameters_4\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>body</code></dt> <dd>The request body as a DOMstring. This data is converted to a string of single-byte characters by truncation (removing the high-order byte of each character).</dd>\n</dl>\n</div>","idl":"<pre>void sendAsBinary(\n in DOMString body\n);\n</pre>","obsolete":false},{"name":"send","help":"<p>Sends the request. If the request is asynchronous (which is the default), this method returns as soon as the request is sent. If the request is synchronous, this method doesn't return until the response has arrived.</p>\n<div class=\"note\"><strong>Note:</strong> Any event listeners you wish to set must be set before calling <code>send()</code>.</div>\n\n<div id=\"section_11\"><span id=\"Parameters_3\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>body</code></dt> <dd>This may be an <code>nsIDocument</code>, <code>nsIInputStream</code>, or a string (an <code>nsISupportsString</code> if called from native code) that is used to populate the body of a POST request. Starting with Gecko 1.9.2, you may also specify an DOM<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/File\">File</a></code>\n , and starting with Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1)\n you may also specify a <a title=\"en/XMLHttpRequest/FormData\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/XMLHttpRequest/FormData\"><code>FormData</code></a> object.</dd>\n</dl>\n</div>","idl":"<pre>void send(\n [optional] in nsIVariant body\n);\n</pre>","obsolete":false},{"name":"getResponseHeader","help":"Returns the string containing the text of the specified header, or <code>null</code> if either the response has not yet been received or the header doesn't exist in the response.","idl":"<pre>ACString getResponseHeader(\n in AUTF8String header\n);\n</pre>","obsolete":false},{"name":"setRequestHeader","help":"<p>Sets the value of an HTTP request header.You must call <a class=\"internal\" title=\"/en/XMLHttpRequest#open()\" rel=\"internal\" href=\"https://developer.mozilla.org/en/nsIXMLHttpRequest#open()\"><code>open()</code></a>before using this method.</p>\n\n<div id=\"section_15\"><span id=\"Parameters_5\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>header</code></dt> <dd>The name of the header whose value is to be set.</dd> <dt><code>value</code></dt> <dd>The value to set as the body of the header.</dd>\n</dl>\n</div>","idl":"<pre>void setRequestHeader(\n in AUTF8String header,\n in AUTF8String value\n);\n</pre>","obsolete":false},{"name":"init","help":"<p>Initializes the object for use from C++code.</p>\n<div class=\"warning\"><strong>Warning:</strong> This method must <em>not</em> be called from JavaScript.</div>\n\n<div id=\"section_7\"><span id=\"Parameters\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>principal</code></dt> <dd>The principal to use for the request; must not be <code>null</code>.</dd> <dt><code>scriptContext</code></dt> <dd>The script context to use for the request; must not be <code>null</code>.</dd> <dt><code>ownerWindow</code></dt> <dd>The window associated with the request; may be <code>null</code>.</dd>\n</dl>\n</div>","idl":"<pre>[noscript] void init(\n in nsIPrincipal principal,\n in nsIScriptContext scriptContext,\n in nsPIDOMWindow ownerWindow\n);\n</pre>","obsolete":false},{"name":"open","help":"<p>Initializes a request. This method is to be used from JavaScript code; to initialize a request from native code, use <a class=\"internal\" title=\"/en/XMLHttpRequest#openRequest()\" rel=\"internal\" href=\"https://developer.mozilla.org/en/nsIXMLHttpRequest#openRequest()\"><code>openRequest()</code></a>instead.</p>\n<div class=\"note\"><strong>Note:</strong> Calling this method an already active request (one for which <code>open()</code>or <code>openRequest()</code>has already been called) is the equivalent of calling <code>abort()</code>.</div>\n\n<div id=\"section_9\"><span id=\"Parameters_2\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>method</code></dt> <dd>The HTTP method to use; either \"POST\" or \"GET\". Ignored for non-HTTP(S) URLs.</dd> <dt><code>url</code></dt> <dd>The URL to which to send the request.</dd> <dt><code>async</code></dt> <dd>An optional boolean parameter, defaulting to <code>true</code>, indicating whether or not to perform the operation asynchronously. If this value is <code>false</code>, the <code>send()</code>method does not return until the response is received. If <code>true</code>, notification of a completed transaction is provided using event listeners. This <em>must</em> be true if the <code>multipart</code> attribute is <code>true</code>, or an exception will be thrown.</dd> <dt><code>user</code></dt> <dd>The optional user name to use for authentication purposes; by default, this is an empty string.</dd> <dt><code>password</code></dt> <dd>The optional password to use for authentication purposes; by default, this is an empty string.</dd>\n</dl>\n<p></p></div>","idl":"<pre>void open(\n in AUTF8String method,\n in AUTF8String url,\n [optional] in boolean async,\n [optional] in AString user,\n [optional] in AString password\n);\n</pre>","obsolete":false},{"name":"openRequest","help":"Initializes a request. This method is to be used from native code; to initialize a request from JavaScript code, use <a class=\"internal\" title=\"/en/XMLHttpRequest#open()\" rel=\"internal\" href=\"https://developer.mozilla.org/en/nsIXMLHttpRequest#open()\"><code>open()</code></a>instead. See the documentation for <code>open()</code>.","obsolete":false},{"name":"abort","help":"Aborts the request if it has already been sent.","obsolete":false},{"name":"overrideMimeType","help":"Overrides the MIME type returned by the server. This may be used, for example, to force a stream to be treated and parsed as text/xml, even if the server does not report it as such.This method must be called before <code>send()</code>.","idl":"<pre>void overrideMimeType(\n in AUTF8String mimetype\n);\n</pre>","obsolete":false},{"name":"getAllResponseHeaders","help":"<pre>string getAllResponseHeaders();\n</pre>\n<p>Returns all the response headers as a string, or <code>null</code> if no response has been received.<strong> Note:</strong> For multipart requests, this returns the headers from the <em>current</em> part of the request, not from the original channel.</p>","obsolete":false},{"name":"channel","help":"The channel used by the object when performing the request. This is <code>null</code> if the channel hasn't been created yet. In the case of a multi-part request, this is the initial channel, not the different parts in the multi-part request. <strong>Requires elevated privileges to access; read-only.</strong>","obsolete":false},{"name":"webkitBackgroundRequest","help":"<p>Indicates whether or not the object represents a background service request. If <code>true</code>, no load group is associated with the request, and security dialogs are prevented from being shown to the user. <strong>Requires elevated privileges to access.</strong></p> <p>In cases in which a security dialog (such as authentication or a bad certificate notification) would normally be shown, the request simply fails instead.</p>","obsolete":false},{"name":"webkitResponseArrayBuffer","help":"The response to the request, as a JavaScript typed array. This is NULL&nbsp;if the request was not successful, or if it hasn't been sent yet. <strong>Read only.</strong>","obsolete":true},{"name":"multipart","help":"<p>Indicates whether or not the response is expected to be a stream of possibly multiple XML documents. If set to <code>true</code>, the content type of the initial response must be <code>multipart/x-mixed-replace</code> or an error will occur. All requests must be asynchronous.</p> <p>This enables support for server push; for each XML document that's written to this request, a new XML DOM document is created and the <code>onload</code> handler is called between documents.</p> <div class=\"note\"><strong>Note:</strong> When this is set, the <code>onload</code> handler and other event handlers are not reset after the first XMLdocument is loaded, and the <code>onload</code> handler is called after each part of the response is received.</div>","obsolete":false},{"name":"readyState","help":"<p>The state of the request:</p> <table class=\"standard-table\"> <tbody> <tr> <td class=\"header\">Value</td> <td class=\"header\">State</td> <td class=\"header\">Description</td> </tr> <tr> <td><code>0</code></td> <td><code>UNSENT</code></td> <td><code>open()</code>has not been called yet.</td> </tr> <tr> <td><code>1</code></td> <td><code>OPENED</code></td> <td><code>send()</code>has not been called yet.</td> </tr> <tr> <td><code>2</code></td> <td><code>HEADERS_RECEIVED</code></td> <td><code>send()</code> has been called, and headers and status are available.</td> </tr> <tr> <td><code>3</code></td> <td><code>LOADING</code></td> <td>Downloading; <code>responseText</code> holds partial data.</td> </tr> <tr> <td><code>4</code></td> <td><code>DONE</code></td> <td>The operation is complete.</td> </tr> </tbody> </table>","obsolete":false},{"name":"response","help":"The response entity body according to <code><a href=\"#responseType\">responseType</a></code>, as an <a title=\"en/JavaScript typed arrays/ArrayBuffer\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/ArrayBuffer\"><code>ArrayBuffer</code></a>, <a title=\"en/DOM/Blob\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/Blob\"><code>Blob</code></a>, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Document\">Document</a></code>\n, JavaScript object (for \"moz-json\"), or string. This is <code>NULL</code>&nbsp;if the request is not complete or was not successful.","obsolete":false},{"name":"responseText","help":"The response to the request as text, or <code>null</code> if the request was unsuccessful or has not yet been sent. <strong>Read-only.</strong>","obsolete":false},{"name":"responseType","help":"<p>Can be set to change the response type. This tells the server what format you want the response to be in.</p> <table class=\"standard-table\"> <tbody> <tr> <td class=\"header\">Value</td> <td class=\"header\">Data type of <code>response</code> property</td> </tr> <tr> <td><em>empty string</em></td> <td>String (this is the default)</td> </tr> <tr> <td>\"arraybuffer\"</td> <td><a title=\"en/JavaScript typed arrays/ArrayBuffer\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/ArrayBuffer\"><code>ArrayBuffer</code></a></td> </tr> <tr> <td>\"blob\"</td> <td><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Blob\">Blob</a></code>\n</td> </tr> <tr> <td>\"document\"</td> <td><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Document\">Document</a></code>\n</td> </tr> <tr> <td>\"text\"</td> <td>String</td> </tr> <tr> <td>\"moz-json\"</td> <td>JavaScript object, parsed from a JSON string returned by the server \n<span title=\"(Firefox 9.0 / Thunderbird 9.0 / SeaMonkey 2.6)\n\">Requires Gecko 9.0</span>\n</td> </tr> </tbody> </table>","obsolete":false},{"name":"responseXML","help":"<p>The response to the request as a DOM <code><a class=\"internal\" title=\"En/DOM/Document\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/document\">Document</a></code> object, or <code>null</code> if the request was unsuccessful, has not yet been sent, or cannot be parsed as XML. The response is parsed as if it were a <code>text/xml</code> stream. <strong>Read-only.</strong></p> <div class=\"note\"><strong>Note:</strong> If the server doesn't apply the <code>text/xml</code> Content-Type header, you can use <code>overrideMimeType()</code>to force <code>XMLHttpRequest</code> to parse it as XML anyway.</div>","obsolete":false},{"name":"status","help":"The status of the response to the request. This is the HTTP result code (for example, <code>status</code> is 200 for a successful request). <strong>Read-only.</strong>","obsolete":false},{"name":"statusText","help":"The response string returned by the HTTP server. Unlike <code>status</code>, this includes the entire text of the response message (\"<code>200 OK</code>\", for example). <strong>Read-only.</strong>","obsolete":false},{"name":"upload","help":"The upload process can be tracked by adding an event listener to <code>upload</code>. \n<span>New in <a rel=\"custom\" href=\"https://developer.mozilla.org/en/Firefox_3.5_for_developers\">Firefox 3.5</a></span>","obsolete":false},{"name":"withCredentials","help":"<p>Indicates whether or not cross-site Access-Control requests should be made using credentials such as cookies or authorization headers. \n<span>New in <a rel=\"custom\" href=\"https://developer.mozilla.org/en/Firefox_3.5_for_developers\">Firefox 3.5</a></span>\n</p> <div class=\"note\"><strong>Note:</strong> This never affects same-site requests.</div> <p>The default is <code>false</code>.</p>","obsolete":false},{"name":"UNSENT","help":"<code>open()</code>has not been called yet.","obsolete":false},{"name":"OPENED","help":"<code>send()</code>has not been called yet.","obsolete":false},{"name":"HEADERS_RECEIVED","help":"<code>send()</code> has been called, and headers and status are available.","obsolete":false},{"name":"LOADING","help":"Downloading; <code>responseText</code> holds partial data.","obsolete":false},{"name":"DONE","help":"The operation is complete.","obsolete":false},{"name":"empty","help":"","obsolete":false}]},"SVGCircleElement":{"title":"SVGCircleElement","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td>9.0</td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> </tbody>\n</table>\n</div>\n<div id=\"compat-mobile\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> </tbody>\n</table>\n</div>","srcUrl":"https://developer.mozilla.org/en/Document_Object_Model_(DOM)/SVGCircleElement","seeAlso":"<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/circle\">&lt;circle&gt;</a></code>\n SVG Element","summary":"The <code>SVGCircleElement</code> interface provides access to the properties of <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/circle\">&lt;circle&gt;</a></code>\n elements, as well as methods to manipulate them.","members":[{"name":"cx","help":"Corresponds to attribute \n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Attribute/cx\">cx</a></code> on the given <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/circle\">&lt;circle&gt;</a></code>\n element.","obsolete":false},{"name":"cy","help":"Corresponds to attribute \n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Attribute/cy\">cy</a></code> on the given <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/circle\">&lt;circle&gt;</a></code>\n element.","obsolete":false}]},"IDBObjectStore":{"title":"IDBObjectStore","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td>12</td> <td>4.0 (2.0)\n</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> </tr> <tr> <td><code>count()</code></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td>10.0 (10.0)\n</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE&nbsp;Phone</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Not supported.\">--</span></td> <td>6.0 (6.0)\n</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> </tr> <tr> <td><code>count()</code></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> </tr> </tbody> </table>\n</div>","summary":"The <code>IDBObjectStore</code> interface of the <a title=\"en/IndexedDB\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB\">IndexedDB API</a> represents an <a title=\"en/IndexedDB#gloss object store\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB#gloss_object_store\">object store</a> in a database.&nbsp;Records within an object store are sorted according to their keys. This sorting enable fast insertion, look-up, and &nbsp;ordered retrieval.&nbsp;","members":[{"name":"unique","help":"If true, the index will not allow duplicate values for a single key.","obsolete":false},{"name":"multientry","help":"If true, the index will add an entry in the index for each array element when the <em>keypath</em> resolves to an Array. If false, it will add one single entry containing the Array.","obsolete":false},{"name":"add","help":"<p>Returns an <a title=\"en/IndexedDB/IDBRequest\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBRequest\">IDBRequest</a> object, and, in a separate thread, creates a <a class=\"external\" title=\"http://www.whatwg.org/specs/web-apps/current-work/multipage/urls.html#structured-clone\" rel=\"external\" href=\"http://www.whatwg.org/specs/web-apps/current-work/multipage/urls.html#structured-clone\" target=\"_blank\">structured clone</a> of the <code>value</code>, and stores the cloned value in the object store. If the record is successfully stored, then a success event is fired on the returned request object, using the <a title=\"en/IndexedDB/IDBTransactionEvent\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBTransactionEvent\">IDBTransactionEvent</a> interface, with the <code><a title=\"en/IndexedDB/IDBSuccessEvent#attr result\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBSuccessEvent#attr_result\">result</a></code> set to the key for the stored record, and <code><a title=\"en/IndexedDB/IDBTransactionEvent#attr transaction\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBTransactionEvent#attr_transaction\">transaction</a></code> set to the transaction in which this object store is opened. If a record already exists in the object store with the <code>key</code> parameter as its key, then an error event is fired on the returned request object, with <a title=\"en/IndexedDB/IDBErrorEvent#attr code\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBErrorEvent#attr_code\">code</a> set to <code><a title=\"en/IndexedDB/DatabaseException#CONSTRAINT ERR\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#CONSTRAINT_ERR\">CONSTRAINT_ERR</a></code>.</p>\n\n<div id=\"section_5\"><span id=\"Parameters\"></span><h5 class=\"editable\">Parameters</h5>\n<dl> <dt>value</dt> <dd>The value to be stored.</dd> <dt>key</dt> <dd>The key to use to identify the record. If unspecified, it results to null.</dd>\n</dl>\n</div><div id=\"section_6\"><span id=\"Returns\"></span><h5 class=\"editable\">Returns</h5>\n<dl> <dt><a title=\"en/IndexedDB/IDBRequest\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBRequest\">IDBRequest</a></dt> <dd>A request object on which subsequent events related to this operation are fired.</dd>\n</dl>\n</div><div id=\"section_7\"><span id=\"Exceptions\"></span><h5 class=\"editable\">Exceptions</h5>\n<p>This method can raise an <a title=\"en/IndexedDB/IDBDatabaseException\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException\">IDBDatabaseException</a> with the following codes:</p>\n<dl> <dt><code><a title=\"en/IndexedDB/DatabaseException#DATA ERR\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#DATA_ERR\">DATA_ERR</a></code></dt> <dd>If the object store uses in-line keys or has a key generator, and a key parameter was provided.<br> If the object store uses out-of-line keys and has no key generator, and no key parameter was provided.<br> If the object store uses in-line keys but no key generator, and the object store's key path does not yield a valid key.<br> If the key parameter was provided but does not contain a valid key.<br> If there are indexed on this object store, and using their key path on the value parameter yields a value that is not a valid key.</dd> <dt><code><a title=\"en/IndexedDB/IDBDatabaseException#READ ONLY ERR\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#READ_ONLY_ERR\">READ_ONLY_ERR</a></code></dt> <dd>If the mode of the associated transaction is <code><a title=\"en/IndexedDB/IDBTransaction#READ ONLY\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBTransaction#READ_ONLY\">READ_ONLY</a></code>.</dd> <dt><code><a title=\"en/IndexedDB/IDBDatabaseException#TRANSACTION INACTIVE ERR\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#TRANSACTION_INACTIVE_ERR\">TRANSACTION_INACTIVE_ERR</a></code></dt> <dd>If the associated transaction is not active.</dd>\n</dl>\n<p>This method can raise a <a title=\"en/DOM/DOMException\" rel=\"internal\" href=\"https://developer.mozilla.org/En/DOM/DOMException\">DOMException</a> with the following code:</p>\n<dl> <dt><code>DATA_CLONE_ERR</code></dt> <dd>If the data being stored could not be cloned by the internal structured cloning algorithm.</dd>\n</dl>\n<dl>\n</dl>\n</div>","idl":"<pre>IDBRequest add(\n&nbsp; in any value,\n&nbsp; in optional any key\n) raises (IDBDatabaseException, DOMException);\n</pre>","obsolete":false},{"name":"put","help":"<p>Returns an <a title=\"en/IndexedDB/IDBRequest\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBRequest\">IDBRequest</a> object, and, in a separate thread, creates a <a class=\"external\" title=\"http://www.whatwg.org/specs/web-apps/current-work/multipage/urls.html#structured-clone\" rel=\"external\" href=\"http://www.whatwg.org/specs/web-apps/current-work/multipage/urls.html#structured-clone\" target=\"_blank\">structured clone</a> of the <code>value</code>, and stores the cloned value in the object store. If the record is successfully stored, then a success event is fired on the returned request object, using the <a title=\"en/IndexedDB/IDBTransactionEvent\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBTransactionEvent\">IDBTransactionEvent</a> interface, with the <code><a title=\"en/IndexedDB/IDBSuccessEvent#attr result\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBSuccessEvent#attr_result\">result</a></code> set to the key for the stored record, and <code><a title=\"en/IndexedDB/IDBTransactionEvent#attr transaction\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBTransactionEvent#attr_transaction\">transaction</a></code> set to the transaction in which this object store is opened.</p>\n\n<div id=\"section_39\"><span id=\"Parameters_9\"></span><h5 class=\"editable\">Parameters</h5>\n<dl> <dt>value</dt> <dd>The value to be stored.</dd> <dt>key</dt> <dd>The key to use to identify the record. If unspecified, it results to null.</dd>\n</dl>\n</div><div id=\"section_40\"><span id=\"Returns_9\"></span><h5 class=\"editable\">Returns</h5>\n<dl> <dt>IDBRequest</dt> <dd>A request object on which subsequent events related to this operation are fired.</dd>\n</dl>\n</div><div id=\"section_41\"><span id=\"Exceptions_10\"></span><h5 class=\"editable\">Exceptions</h5>\n<p>This method can raise an <a title=\"en/IndexedDB/IDBDatabaseException\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException\">IDBDatabaseException</a> with the following codes:</p>\n<dl> <li> <ul> <li>If this object store uses <a title=\"en/IndexedDB#gloss out-of-line key\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB#gloss_out-of-line_key\">out-of-line keys</a> and does not use a <a title=\"en/IndexedDB#gloss key generator\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB#gloss_key_generator\">key generator</a>, but the <code>key</code> parameter was not passed</li> <li>If the object store uses <a title=\"en/IndexedDB#gloss in-line key\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB#gloss_in-line_key\">in-line keys</a>, but the <code>value</code> object does not have a property identified by the object store's key path.</li> </ul> </li> <dt><code><a title=\"en/IndexedDB/DatabaseException#NOT ALLOWED ERR\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#NOT_ALLOWED_ERR\">NOT_ALLOWED_ERR</a></code></dt> <dd>If the object store is not in the <a title=\"en/IndexedDB#gloss scope\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB#gloss_scope\">scope</a> of any existing <a title=\"en/IndexedDB#gloss transaction\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB#gloss_transaction\">transaction</a>, or if the associated transaction's mode is <a title=\"en/IndexedDB/IDBTransaction#const read only\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBTransaction#const_read_only\"><code>READ_ONLY</code></a>&nbsp;or <a title=\"en/IndexedDB/IDBTransaction#const snapshot read\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBTransaction#const_snapshot_read\"><code>SNAPSHOT_READ</code></a>.</dd> <dt><code><a title=\"en/IndexedDB/IDBDatabaseException#SERIAL ERR\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#SERIAL_ERR\">SERIAL_ERR</a></code></dt> <dd>If the data being stored could not be serialized by the internal structured cloning algorithm.</dd>\n</dl>\n<p>This method can raise a <a title=\"en/DOM/DOMException\" rel=\"internal\" href=\"https://developer.mozilla.org/En/DOM/DOMException\">DOMException</a> with the following code:</p>\n<dl> <dt><code>DATA_CLONE_ERR</code></dt> <dd>If the data being stored could not be cloned by the internal structured cloning algorithm.</dd>\n</dl>\n</div>","idl":"<pre>IDBRequest put(\n&nbsp; in any value,\n&nbsp; in optional any key\n) raises (IDBDatabaseException, DOMException);\n</pre>","obsolete":false},{"name":"createIndex","help":"<p>Creates and returns a new index in the connected database. Note that this method must be called only from a <a title=\"en/IndexedDB/IDBTransaction#VERSION CHANGE\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBTransaction#VERSION_CHANGE\"><code>VERSION_CHANGE</code></a> transaction callback.</p>\n<pre>IDBIndex createIndex (\n&nbsp; in DOMString name, \n&nbsp; in DOMString keyPath, \n&nbsp; in Object optionalParameters\n) raises (IDBDatabaseException);\n\n</pre>\n<div id=\"section_16\"><span id=\"Parameters_3\"></span><h5 class=\"editable\">Parameters</h5>\n<dl> <dt>name</dt> <dd>The name of the index to create.</dd> <dt>keyPath</dt> <dd>The key path for the index to use.</dd> <dt>optionalParameters</dt> <dd> <div class=\"warning\"><strong>Warning:</strong> The latest draft of the specification changed this to <code>IDBIndexParameters</code>, which is not yet recognized by any browser</div> <p>Options object whose attributes are optional parameters to the method. It includes the following properties:</p> <table class=\"standard-table\"> <thead> <tr> <th scope=\"col\" width=\"131\">Attribute</th> <th scope=\"col\" width=\"698\">Description</th> </tr> </thead> <tbody> <tr> <td><code>unique</code></td> <td>If true, the index will not allow duplicate values for a single key.</td> </tr> <tr> <td><code>multientry</code></td> <td>If true, the index will add an entry in the index for each array element when the <em>keypath</em> resolves to an Array. If false, it will add one single entry containing the Array.</td> </tr> </tbody> </table> <p>Unknown parameters are ignored.</p> </dd> <dd></dd>\n</dl>\n</div><div id=\"section_17\"><span id=\"Returns_4\"></span><h5 class=\"editable\">Returns</h5>\n<dl> <dt><a title=\"en/IndexedDB/IDBIndex\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBIndex\">IDBIndex</a></dt> <dd>The newly created index.</dd>\n</dl>\n</div><div id=\"section_18\"><span id=\"Exceptions_4\"></span><h5 class=\"editable\">Exceptions</h5>\n<p>This method can raise an <a title=\"en/IndexedDB/IDBDatabaseException\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException\">IDBDatabaseException</a> with the following codes:</p>\n<dl> <dt><code><a title=\"en/IndexedDB/DatabaseException#CONSTRAINT ERR\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#CONSTRAINT_ERR\">CONSTRAINT_ERR</a></code></dt> <dd>If an index with the same name (based on case-sensitive comparison) already exists in the connected database.</dd> <dt><code><a title=\"en/IndexedDB/DatabaseException#NOT ALLOWED ERR\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#NOT_ALLOWED_ERR\">NOT_ALLOWED_ERR</a></code></dt> <dd>If this method was not called from a <a title=\"en/IndexedDB/IDBTransaction#VERSION CHANGE\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBTransaction#VERSION_CHANGE\"><code>VERSION_CHANGE</code></a> transaction callback.</dd>\n</dl></div>","obsolete":false},{"name":"index","help":"<p>Opens the named index in this object store.</p>\n\n<div id=\"section_31\"><span id=\"Parameters_7\"></span><h5 class=\"editable\">Parameters</h5>\n<dl> <dt>name</dt> <dd>The name of the index to open.</dd>\n</dl>\n</div><div id=\"section_32\"><span id=\"Returns_7\"></span><h5 class=\"editable\">Returns</h5>\n<dl> <dt><code><a title=\"en/IndexedDB/IDBIndex\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBIndex\">IDBIndex</a></code></dt> <dd>An object for accessing the index.</dd>\n</dl>\n</div><div id=\"section_33\"><span id=\"Exceptions_8\"></span><h5 class=\"editable\">Exceptions</h5>\n<p>This method can raise an <a title=\"en/IndexedDB/IDBDatabaseException\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException\">IDBDatabaseException</a> with the following code:</p>\n<dl> <dt><code><a title=\"en/IndexedDB/IDBDatabaseException#NOT FOUND ERR\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#NOT_FOUND_ERR\">NOT_FOUND_ERR</a></code></dt> <dd>If no index exists with the specified name (based on case-sensitive comparison) in the connected database.</dd>\n</dl>\n</div>","idl":"<pre>IDBIndex index(\n&nbsp; in DOMString name\n) raises (IDBDatabaseException);\n</pre>","obsolete":false},{"name":"clear","help":"<p>If the mode of the transaction that this object store belongs to is <code><a title=\"en/IndexedDB/IDBTransaction#READ ONLY\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBTransaction#READ_ONLY\">READ_ONLY</a></code>, this method raises an&nbsp;<a title=\"en/IndexedDB/IDBDatabaseException\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException\">IDBDatabaseException</a> with its code set to <code><a title=\"en/IndexedDB/IDBDatabaseException#READ ONLY ERR\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#READ_ONLY_ERR\">READ_ONLY_ERR</a></code>. Otherwise, this method creates and immediately returns an <a title=\"en/IndexedDB/IDBRequest\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBRequest\">IDBRequest</a> object, and clears this object store in a separate thread. Clearing an object store consists of removing all records from the object store and removing all records in indexes that reference the object store.</p>\n\n<div id=\"section_9\"><span id=\"Returns_2\"></span><h5 class=\"editable\">Returns</h5>\n<dl> <dt><a title=\"en/IndexedDB/IDBRequest\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBRequest\">IDBRequest</a></dt> <dd>A request object on which subsequent events related to this operation are fired.</dd>\n</dl>\n</div><div id=\"section_10\"><span id=\"Exceptions_2\"></span><h5 class=\"editable\">Exceptions</h5>\n<p>This method can raise an <a title=\"en/IndexedDB/IDBDatabaseException\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException\">IDBDatabaseException</a> with the following codes:</p>\n<dl> <dt><a title=\"en/IndexedDB/IDBDatabaseException#READ ONLY ERR\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#READ_ONLY_ERR\"><code>READ_ONLY_ERR</code></a></dt> <dd>If the mode of the transaction that this object store belongs to is READ_ONLY.</dd> <dt><a title=\"en/IndexedDB/IDBDatabaseException#TRANSACTION INACTIVE ERR\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#TRANSACTION_INACTIVE_ERR\"><code>TRANSACTION_INACTIVE_ERR</code></a></dt> <dd>If the transaction that this object store belongs to is not active.</dd>\n</dl></div>","idl":"<pre>IDBRequest clear(\n) raises (IDBDatabaseException); \n</pre>","obsolete":false},{"name":"openCursor","help":"<p>Immediately returns an <a title=\"en/IndexedDB/IDBRequest\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBRequest\">IDBRequest</a> object, and creates a <a title=\"en/IndexedDB#gloss cursor\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB#gloss_cursor\">cursor</a> over the records in this object store, in a separate thread. If there is even a single record that matches the <a title=\"en/IndexedDB#gloss key range\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB#gloss_key_range\">key range</a>, then a success event is fired on the returned object, with its <code><a title=\"en/IndexedDB/IDBSuccessEvent#attr result\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBSuccessEvent#attr_result\">result</a></code> set to the <a title=\"en/IndexedDB/IDBCursor\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBCursor\">IDBCursor</a> object for the new cursor. If no records match the key range, then a success event is fired on the returned object, with its <code><a title=\"en/IndexedDB/IDBSuccessEvent#attr result\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBSuccessEvent#attr_result\">result</a></code> set to null.</p>\n<pre>IDBRequest openCursor (\n&nbsp; in optional IDBKeyRange range, \n&nbsp; in optional unsigned short direction\n) raises (IDBDatabaseException);\n</pre>\n<div id=\"section_35\"><span id=\"Parameters_8\"></span><h5 class=\"editable\">Parameters</h5>\n<dl> <dt>range</dt> <dd>The key range to use as the cursor's range. If this parameter is unspecified or null, then the range includes all the records in the object store.</dd> <dt>direction</dt> <dd>The cursor's <a title=\"en/IndexedDB#gloss direction\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB#gloss_direction\">direction</a>.</dd>\n</dl>\n</div><div id=\"section_36\"><span id=\"Returns_8\"></span><h5 class=\"editable\">Returns</h5>\n<dl> <dt><code><a title=\"en/IndexedDB/IDBRequest\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBRequest\">IDBRequest</a></code></dt> <dd>A request object on which subsequent events related to this operation are fired.</dd>\n</dl>\n</div><div id=\"section_37\"><span id=\"Exceptions_9\"></span><h5 class=\"editable\">Exceptions</h5>\n<p>This method can raise an IDBDatabaseException with the following code:</p>\n<dl> <dt><code><a title=\"en/IndexedDB/DatabaseException#NOT ALLOWED ERR\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#NOT_ALLOWED_ERR\">NOT_ALLOWED_ERR</a></code></dt> <dd>If this object store is not in the scope of any existing transaction on the connected database.</dd>\n</dl>\n</div>","obsolete":false},{"name":"get","help":"<p>Immediately returns an <a title=\"en/IndexedDB/IDBRequest\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBRequest\">IDBRequest</a> object, and retrieves the requested record from the object store in a separate thread. If the operation is successful, then a success event is fired on the returned object, using the <a title=\"en/IndexedDB/IDBTransactionEvent\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBTransactionEvent\">IDBTransactionEvent</a> interface, with its <code><a title=\"en/IndexedDB/IDBSuccessEvent#attr result\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBSuccessEvent#attr_result\">result</a></code> set to the retrieved value, and <code><a title=\"en/IndexedDB/IDBTransactionEvent#attr transaction\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBTransactionEvent#attr_transaction\">transaction</a></code> set to the transaction in which this object store is opened. If a record does not exist in the object store for the key parameter, then an error event is fired on the returned object, with its <code><a title=\"en/IndexedDB/IDBErrorEvent#attr code\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBErrorEvent#attr_code\">code</a></code> set to <code><a title=\"en/IndexedDB/IDBDatabaseException#NOT FOUND ERR\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#NOT_FOUND_ERR\">NOT_FOUND_ERR</a></code> and an appropriate <code><a title=\"en/IndexedDB/IDBErrorEvent#attr message\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBErrorEvent#attr_message\">message</a></code>.</p>\n<p></p><div class=\"note\"><strong>Note:</strong>&nbsp;This function produces the same result if no record with the given key exists in the database as when a record exists, but with an undefined value. To tell these situations apart, call the openCursor() method with the same key. That method provides a cursor if the record exists, and not if it does not.</div>\n<p></p>\n\n<div id=\"section_27\"><span id=\"Parameters_6\"></span><h5 class=\"editable\">Parameters</h5>\n<dl> <dt>key</dt> <dd>The key identifying the record to retrieve.</dd>\n</dl>\n</div><div id=\"section_28\"><span id=\"Returns_6\"></span><h5 class=\"editable\">Returns</h5>\n<dl> <dt><code><a title=\"en/IndexedDB/IDBRequest\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBRequest\">IDBRequest</a></code></dt> <dd>A request object on which subsequent events related to this operation are fired.</dd>\n</dl>\n</div><div id=\"section_29\"><span id=\"Exceptions_7\"></span><h5 class=\"editable\">Exceptions</h5>\n<p>This method can raise an <a title=\"en/IndexedDB/IDBDatabaseException\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException\">IDBDatabaseException</a> with the following code:</p>\n<dl> <dt><code><a title=\"en/IndexedDB/IDBDatabaseException#DATA ERR\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#DATA_ERR\">DATA_ERR</a></code></dt> <dd>If the <code>key</code> parameter was not a valid value.</dd> <dt><code><a title=\"en/IndexedDB/IDBDatabaseException#TRANSACTION INACTIVE ERR\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#TRANSACTION_INACTIVE_ERR\">TRANSACTION_INACTIVE_ERR</a></code></dt> <dd>If the associated transaction is not active.</dd>\n</dl>\n</div>","idl":"<pre>IDBRequest get(\n&nbsp; in any key\n) raises (IDBDatabaseException);\n</pre>","obsolete":false},{"name":"delete","help":"<p>Immediately returns an <code><a title=\"en/IndexedDB/IDBRequest\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBRequest\">IDBRequest</a></code> object, and removes the record specified by the given key from this object store, and any indexes that reference it, in a separate thread. If no record exists in this object store corresponding to the key, an error event is fired on the returned request object, with its <code><a title=\"en/IndexedDB/IDBErrorEvent#attr code\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBErrorEvent#attr_code\">code</a></code> set to <code><a title=\"en/IndexedDB/IDBDatabaseException#NOT FOUND ERR\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#NOT_FOUND_ERR\">NOT_FOUND_ERR</a></code> and an appropriate <code><a title=\"en/IndexedDB/IDBErrorEvent#attr message\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBErrorEvent#attr_message\">message</a></code>. If the record is successfully removed, then a success event is fired on the returned request object, using the <code><a title=\"en/IndexedDB/IDBTransactionEvent\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBTransactionEvent\">IDBTransactionEvent</a></code> interface, with the <code><a title=\"en/IndexedDB/IDBSuccessEvent#attr result\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBSuccessEvent#attr_result\">result</a></code> set to <code>undefined</code>, and <a title=\"en/IndexedDB/IDBTransactionEvent#attr transaction\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBTransactionEvent#attr_transaction\">transaction</a> set to the transaction in which this object store is opened.</p>\n<pre>IDBRequest delete (\n  in any key\n) raises (IDBDatabaseException); \n</pre>\n<div id=\"section_20\"><span id=\"Parameters_4\"></span><h5 class=\"editable\">Parameters</h5>\n<dl> <dt>key</dt> <dd>The key to use to identify the record.</dd>\n</dl>\n</div><div id=\"section_21\"><span id=\"Returns_5\"></span><h5 class=\"editable\">Returns</h5>\n<dl> <dt><a title=\"en/IndexedDB/IDBRequest\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBRequest\">IDBRequest</a></dt> <dd>A request object on which subsequent events related to this operation are fired.</dd>\n</dl>\n</div><div id=\"section_22\"><span id=\"Exceptions_5\"></span><h5 class=\"editable\">Exceptions</h5>\n<p>This method can raise an <a title=\"en/IndexedDB/IDBDatabaseException\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException\">IDBDatabaseException</a> with the following codes:</p></div>","obsolete":false},{"name":"deleteIndex","help":"<p>Destroys the index with the specified name in the connected database. Note that this method must be called only from a <code><a title=\"en/IndexedDB/IDBTransaction#VERSION CHANGE\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBTransaction#VERSION_CHANGE\">VERSION_CHANGE</a></code> transaction callback.</p>\n<pre>void removeIndex(\n  in DOMString indexName\n) raises (IDBDatabaseException); \n</pre>\n<div id=\"section_24\"><span id=\"Parameters_5\"></span><h5 class=\"editable\">Parameters</h5>\n<p>&nbsp;</p>\n<dl> <dt><code><a title=\"en/IndexedDB/DatabaseException#NOT ALLOWED ERR\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#NOT_ALLOWED_ERR\">NOT_ALLOWED_ERR</a></code></dt> <dd>If the object store is not in the <a title=\"en/IndexedDB#gloss scope\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB#gloss_scope\">scope</a> of any existing <a title=\"en/IndexedDB#gloss transaction\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB#gloss_transaction\">transaction</a>, or if the associated transaction's mode is <a title=\"en/IndexedDB/IDBTransaction#const read only\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBTransaction#const_read_only\"><code>READ_ONLY</code></a>&nbsp;or <a title=\"en/IndexedDB/IDBTransaction#const snapshot read\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBTransaction#const_snapshot_read\"><code>SNAPSHOT_READ</code></a>.</dd> <dt><code><a title=\"en/IndexedDB/IDBDatabaseException#TRANSACTION INACTIVE ERR\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#TRANSACTION_INACTIVE_ERR\">TRANSACTION_INACTIVE_ERR</a></code></dt> <dd>If the associated transaction is not active.</dd> <dt>indexName</dt> <dd>The name of the existing index to remove.</dd>\n</dl>\n</div><div id=\"section_25\"><span id=\"Exceptions_6\"></span><h5 class=\"editable\">Exceptions</h5>\n<p>This method can raise an <a title=\"en/IndexedDB/IDBDatabaseException\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException\">IDBDatabaseException</a> with the following codes:</p>\n<dl> <dt><code><a title=\"en/IndexedDB/DatabaseException#NOT ALLOWED ERR\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#NOT_ALLOWED_ERR\">NOT_ALLOWED_ERR</a></code></dt> <dd>If this method was not called from a <a title=\"en/IndexedDB/IDBTransaction#VERSION CHANGE\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBTransaction#VERSION_CHANGE\">VERSION_CHANGE</a> transaction callback.</dd> <dt><code><a title=\"en/IndexedDB/IDBDatabaseException#NOT FOUND ERR\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#NOT_FOUND_ERR\">NOT_FOUND_ERR</a></code></dt> <dd>If no index exists with the specified name (based on case-sensitive comparison) in the connected database.</dd>\n</dl>\n</div>","obsolete":false},{"name":"count","help":"<p>Immediately returns an <a title=\"IDBRequest\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBRequest\">IDBRequest</a> object and asynchronously count the amount of objects in the object store that match the parameter, a key or a key range. If the parameter is not valid returns an exception.</p>\n\n<div id=\"section_12\"><span id=\"Parameters_2\"></span><h5 class=\"editable\">Parameters</h5>\n<dl> <dt>key</dt> <dd>The key or key range that identifies the records to be counted.</dd>\n</dl>\n</div><div id=\"section_13\"><span id=\"Returns_3\"></span><h5 class=\"editable\">Returns</h5>\n<dl> <dt><a title=\"en/IndexedDB/IDBRequest\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBRequest\">IDBRequest</a></dt> <dd>A request object on which subsequent events related to this operation are fired.</dd>\n</dl>\n</div><div id=\"section_14\"><span id=\"Exceptions_3\"></span><h5 class=\"editable\">Exceptions</h5>\n<p>This method can raise an <a title=\"IDBDatabaseException\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException\">IDBDatabaseException</a> with the following codes:</p>\n<dl> <dt><code><a href=\"IDBDatabaseException#DATA_ERR\" rel=\"internal\" title=\"en/IndexedDB/DatabaseException#DATA ERR\">DATA_ERR</a></code></dt> <dd>If the object store uses in-line keys or has a key generator, and a key parameter was provided.<br> If the object store uses out-of-line keys and has no key generator, and no key parameter was provided.<br> If the object store uses in-line keys but no key generator, and the object store's key path does not yield a valid key.<br> If the key parameter was provided but does not contain a valid key.<br> If there are indexed on this object store, and using their key path on the value parameter yields a value that is not a valid key.</dd> <dt><code><a href=\"IDBDatabaseException#NOT_ALLOWED_ERR\" rel=\"internal\" title=\"en/IndexedDB/IDBDatabaseException#NOT_ALLOWED_ERR\">NOT_ALLOWED_ERR</a></code></dt> <dd>The request was made on a source object that has been deleted or removed.</dd>\n</dl></div>","idl":"<pre>IDBRequest count(\n  in option any key\n) raises (IDBDatabaseException);\n</pre>","obsolete":false},{"url":"","name":"indexNames","help":"A list of the names of <a title=\"en/IndexedDB#gloss index\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB#gloss_index\">indexes</a> on objects in this object store.","obsolete":false},{"url":"","name":"keyPath","help":"The <a title=\"en/IndexedDB#gloss key path\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB#gloss_key_path\">key path</a> of this object store. If this attribute is null, the application must provide a key for each modification operation.","obsolete":false},{"url":"","name":"name","help":"The name of this object store.","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/IndexedDB/IDBObjectStore"},"SVGFEMergeElement":{"title":"feMerge","seeAlso":"<li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/filter\">&lt;filter&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feBlend\">&lt;feBlend&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feColorMatrix\">&lt;feColorMatrix&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feComponentTransfer\">&lt;feComponentTransfer&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feComposite\">&lt;feComposite&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feConvolveMatrix\">&lt;feConvolveMatrix&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feDiffuseLighting\">&lt;feDiffuseLighting&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feDisplacementMap\">&lt;feDisplacementMap&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feFlood\">&lt;feFlood&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feGaussianBlur\">&lt;feGaussianBlur&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feImage\">&lt;feImage&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feMergeNode\">&lt;feMergeNode&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feMorphology\">&lt;feMorphology&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feOffset\">&lt;feOffset&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feSpecularLighting\">&lt;feSpecularLighting&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feTile\">&lt;feTile&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feTurbulence\">&lt;feTurbulence&gt;</a></code>\n</li> <li><a title=\"en/SVG/Tutorial/Filter_effects\" rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Tutorial/Filter_effects\">SVG tutorial: Filter effects</a></li>","summary":"The feMerge filter allows filter effects to be applied concurrently instead of sequentially. This is achieved by other filters storing their output via the \n<code><a rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Attribute/result\" class=\"new\">result</a></code> attribute and then accessing it in a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feMergeNode\">&lt;feMergeNode&gt;</a></code>\n child.","members":[],"srcUrl":"https://developer.mozilla.org/en/SVG/Element/feMerge"},"CDATASection":{"title":"CDATASection","summary":"<p>A CDATA Section can be used within XML to include extended portions of unescaped text, such that the symbols &lt; and &amp; do not need escaping as they normally do within XML when used as text.</p>\n<p>It takes the form:</p>\n<pre class=\"eval\">&lt;![CDATA[  ... ]]&gt;\n</pre>\n<p>For example:</p>\n<pre class=\"eval\">&lt;foo&gt;Here is a CDATA section: &lt;![CDATA[  &lt; &gt; &amp; ]]&gt; with all kinds of unescaped text. &lt;/foo&gt;\n</pre>\n<p>The only sequence which is not allowed within a CDATA section is the closing sequence of a CDATA section itself:</p>\n<pre class=\"eval\">&lt;![CDATA[  ]]&gt; will cause an error   ]]&gt;\n</pre>\n<p>Note that CDATA sections should not be used (without hiding) within HTML.</p>\n<p>As a CDATASection has no properties or methods unique to itself and only directly implements the Text interface, one can refer to <a title=\"En/DOM/Text\" rel=\"internal\" href=\"https://developer.mozilla.org/En/DOM/Text\">Text</a> to find its properties and methods.</p>","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/CDATASection","specification":"http://www.w3.org/TR/DOM-Level-3-Cor...l#ID-667469212"},"Node":{"title":"Node","summary":"A <code>Node</code> is an interface from which a number of DOM types inherit, and allows these various types to be treated (or tested) similarly.<br> The following all inherit this interface and its methods and properties (though they may return null in particular cases where not relevant; or throw an exception when adding children to a node type for which no children can exist): <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Document\">Document</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Element\">Element</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Attr\">Attr</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/CharacterData\">CharacterData</a></code>\n (which <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Text\">Text</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Comment\">Comment</a></code>\n, and <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/CDATASection\">CDATASection</a></code>\n inherit), <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/ProcessingInstruction\">ProcessingInstruction</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DocumentFragment\">DocumentFragment</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DocumentType\">DocumentType</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Notation\">Notation</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Entity\">Entity</a></code>\n, <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/EntityReference\">EntityReference</a></code>","members":[{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/Node.isDefaultNamespace","name":"isDefaultNamespace","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/Node.appendChild","name":"appendChild","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/Node.isSupported","name":"isSupported","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/Node.contains","name":"contains","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/Node.compareDocumentPosition","name":"compareDocumentPosition","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/Node.isEqualNode","name":"isEqualNode","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/Node.removeChild","name":"removeChild","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/Node.setUserData","name":"setUserData","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/Node.hasChildNodes","name":"hasChildNodes","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/Node.hasAttributes","name":"hasAttributes","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/Node.isSameNode","name":"isSameNode","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/Node.cloneNode","name":"cloneNode","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/Node.lookupNamespaceURI","name":"lookupNamespaceURI","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/Article_not_found?uri=en/DOM/Node.getFeature","name":"getFeature","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/Node.normalize","name":"normalize","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/Node.getUserData","name":"getUserData","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/Node.replaceChild","name":"replaceChild","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/Node.insertBefore","name":"insertBefore","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/Node.lookupPrefix","name":"lookupPrefix","help":""},{"name":"ELEMENT_NODE","help":"","obsolete":false},{"name":"ATTRIBUTE_NODE","help":"","obsolete":false},{"name":"TEXT_NODE","help":"","obsolete":false},{"name":"DATA_SECTION_NODE","help":"","obsolete":false},{"name":"ENTITY_REFERENCE_NODE","help":"","obsolete":false},{"name":"ENTITY_NODE","help":"","obsolete":false},{"name":"PROCESSING_INSTRUCTION_NODE","help":"","obsolete":false},{"name":"COMMENT_NODE","help":"","obsolete":false},{"name":"DOCUMENT_NODE","help":"","obsolete":false},{"name":"DOCUMENT_TYPE_NODE","help":"","obsolete":false},{"name":"DOCUMENT_FRAGMENT_NODE","help":"","obsolete":false},{"name":"NOTATION_NODE","help":"","obsolete":false},{"name":"DOCUMENT_POSITION_DISCONNECTED","help":"","obsolete":false},{"name":"DOCUMENT_POSITION_PRECEDING","help":"","obsolete":false},{"name":"DOCUMENT_POSITION_FOLLOWING","help":"","obsolete":false},{"name":"DOCUMENT_POSITION_CONTAINS","help":"","obsolete":false},{"name":"DOCUMENT_POSITION_CONTAINED_BY","help":"","obsolete":false},{"name":"DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC","help":"","obsolete":false},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/Node.previousSibling","name":"previousSibling","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/Node.textContent","name":"textContent","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/Node.firstChild","name":"firstChild","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/Node.nodeType","name":"nodeType","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/Node.prefix","name":"prefix","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/Node.parentNode","name":"parentNode","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/Node.nextSibling","name":"nextSibling","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/Node.baseURI","name":"baseURI","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/Node.childNodes","name":"childNodes","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/Node.namespaceURI","name":"namespaceURI","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/Node.lastChild","name":"lastChild","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/Node.parentElement","name":"parentElement","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/Node.nodePrincipal","name":"nodePrincipal","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/Node.attributes","name":"attributes","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/Node.nodeValue","name":"nodeValue","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/Node.nodeName","name":"nodeName","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/Node.ownerDocument","name":"ownerDocument","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/Node.localName","name":"localName","help":""}],"srcUrl":"https://developer.mozilla.org/en/DOM/Node","specification":"<li><a class=\"external\" rel=\"external\" href=\"http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-1950641247\" title=\"http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-1950641247\" target=\"_blank\">DOM Level 1 Core: Node interface</a></li> <li><a class=\"external\" title=\"http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-1950641247\" rel=\"external\" href=\"http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-1950641247\" target=\"_blank\">DOM&nbsp;Level 2 Core: Node interface</a></li> <li><a class=\"external\" title=\"http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-1950641247\" rel=\"external\" href=\"http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-1950641247\" target=\"_blank\">DOM&nbsp;Level 3 Core: Node interface</a></li>"},"File":{"title":"File","srcUrl":"https://developer.mozilla.org/en/DOM/File","specification":"<a title=\"http://www.whatwg.org/specs/web-apps/current-work/multipage/number-state.html#concept-input-type-file-selected\" class=\" external\" rel=\"external\" href=\"http://www.whatwg.org/specs/web-apps/current-work/multipage/number-state.html#concept-input-type-file-selected\" target=\"_blank\">File upload state</a> (HTML&nbsp;5 working draft)","seeAlso":"<li><a title=\"en/Using files from web applications\" rel=\"internal\" href=\"https://developer.mozilla.org/en/Using_files_from_web_applications\">Using files from web applications</a></li> <li><a title=\"en/Extensions/Using the DOM File API in chrome code\" rel=\"internal\" href=\"https://developer.mozilla.org/en/Extensions/Using_the_DOM_File_API_in_chrome_code\">Using the DOM&nbsp;File API&nbsp;in chrome code</a></li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/FileReader\">FileReader</a></code>\n</li> <li><a rel=\"external\" href=\"https://bugzilla.mozilla.org/show_bug.cgi?id=523771\" class=\"external\" title=\"\">\nbug 523771</a>\n - Support &lt;input type=file multiple&gt;</li>","summary":"<p>The <code>File</code> object provides information about -- and access to the contents of -- files. These are generally retrieved from a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/FileList\">FileList</a></code>\n object returned as a result of a user selecting files using the <code>input</code> element, or from a drag and drop operation's <a title=\"En/DragDrop/DataTransfer\" rel=\"internal\" href=\"https://developer.mozilla.org/En/DragDrop/DataTransfer\"><code>DataTransfer</code></a> object.</p>\n<div class=\"geckoVersionNote\">\n<p>\n</p><div class=\"geckoVersionHeading\">Gecko 2.0 note<div>(Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1)\n</div></div>\n<p></p>\n<p>Starting in Gecko 2.0&nbsp;(Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1)\n, the File object inherits from the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Blob\">Blob</a></code>\n&nbsp;interface, which provides methods and properties providing further information about the file.</p>\n</div>\n<p>The file reference can be saved when the form is submitted while the user is offline, so that the data can be retrieved and uploaded when the Internet connection is restored.</p>\n<div class=\"note\"><strong>Note:</strong> The <code>File</code> object as implemented by Gecko offers several non-standard methods for reading the contents of the file. These should <em>not</em> be used, as they will prevent your web application from being used in other browsers, as well as in future versions of Gecko, which will likely remove these methods.</div>","members":[{"url":"https://developer.mozilla.org/en/DOM/File.fileName","name":"fileName","help":"The name of the file referenced by the <code>File</code> object. <strong>Read only.</strong> \n\n<span title=\"(Firefox 7.0 / Thunderbird 7.0 / SeaMonkey 2.4)\n\">Obsolete since Gecko 7.0</span>","obsolete":true},{"url":"https://developer.mozilla.org/en/DOM/File.fileSize","name":"fileSize","help":"The size of the referenced file in bytes. <strong>Read only.</strong> \n\n<span title=\"(Firefox 7.0 / Thunderbird 7.0 / SeaMonkey 2.4)\n\">Obsolete since Gecko 7.0</span>","obsolete":true},{"name":"webkitFullPath","help":"The full path of the referenced file; available only to code with UniversalFileRead privileges in chrome. <strong>Read only.</strong>       \n<span title=\"(Firefox 3.6 / Thunderbird 3.1 / Fennec 1.0)\n\">Requires Gecko 1.9.2</span>","obsolete":false},{"name":"webkitFullPathInternal","help":"This is an internal-use-only property that does not do security checks. It can only be used from native code, and is used to optimize performance in special cases in which security is not a concern. <strong>Read only.</strong>        \n<span title=\"(Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1)\n\">Requires Gecko 2.0</span>","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/File.name","name":"name","help":"The name of the file referenced by the <code>File</code> object. <strong>Read only.</strong> \n<span title=\"(Firefox 3.6 / Thunderbird 3.1 / Fennec 1.0)\n\">Requires Gecko 1.9.2</span>","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/File.size","name":"size","help":"The size (in bytes) of the file referenced by the File object. <strong>Read only.</strong> \n<span title=\"(Firefox 3.6 / Thunderbird 3.1 / Fennec 1.0)\n\">Requires Gecko 1.9.2</span>","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/File.type","name":"type","help":"The type (MIME type) of the file referenced by the File object. <strong>Read only.</strong> \n<span title=\"(Firefox 3.6 / Thunderbird 3.1 / Fennec 1.0)\n\">Requires Gecko 1.9.2</span>","obsolete":false}]},"SVGAnimateMotionElement":{"title":"SVGAnimateMotionElement","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> </tbody>\n</table>\n</div>\n<div id=\"compat-mobile\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> </tbody>\n</table>\n</div>","summary":"The <code>SVGAnimateMotionElement</code> interface corresponds to the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/animateMotion\">&lt;animateMotion&gt;</a></code>\n element.","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/SVGAnimateMotionElement"},"CSSImportRule":{"title":"cssRule","members":[],"srcUrl":"https://developer.mozilla.org/pl/DOM/cssRule","skipped":true,"cause":"Suspect title"},"IDBCursor":{"title":"IDBCursor","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td>12\n<span title=\"prefix\">webkit</span></td> <td>4.0 (2.0)\n</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE&nbsp;Phone</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Not supported.\">--</span></td> <td>6.0 (6.0)\n</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> </tr> </tbody> </table>\n</div>","examples":["<h4 class=\"editable\">Example</h4>\n<p>In the following code snippet, we open a transaction and manipulate an entire data set using a cursor. Because the specification is still evolving, Chrome uses prefixes in the methods. Chrome uses the <code>webkit</code> prefix. For example, instead of just <code>IDBCursor.NEXT</code>, use <code>webkitIDBCursor.NEXT</code>. Firefox does not use prefixes, except in the opening method (<code>mozIndexedDB</code>). Event handlers are registered for responding to various situations.</p>\n\n          <pre name=\"code\" class=\"js\">// Taking care of the browser-specific prefixes.\nwindow.indexedDB = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB;\nwindow.IDBTransaction = window.IDBTransaction || window.webkitIDBTransaction;\nwindow.IDBKeyRange = window.IDBKeyRange || window.webkitIDBKeyRange;\nwindow.IDBCursor = window.IDBCursor || window.webkitIDBCursor;\nvar db;\n\n...\n\nfunction cursorTest() {\n  // Start a transaction on an object store called \"my-store-name\"\n  // By default, transactions are opened with read-only access.\n  // If you want to have write access, see IDBDatabase.\n  var trans = db.transaction('my-store-name');\n  // Get a reference to the object store.\n  var store = trans.objectStore('my-store-name');\n  // Create a cursor with two optional parameters.  \n  // The first parameter sets the cursor over a specified key range;\n  // while the second one sets the direction of the cursor.  \n  // In this case, the direction is set to IDBCursor.PREV,  \n  // which lets you start at the upper bound of the key range\n  // and then moves downwards. \n  // If you don't want duplicates included, use PREV_NO_DUPLICATE instead.\n  var curreq = store.openCursor(IDBKeyRange.bound(1, 4), IDBCursor.PREV); \n  // The \"onsuccess\" event fires when the cursor is created and \n  // every time the cursor iterates over data. \n  // The following block of code runs multiple times,\n  // until the cursor runs out of data to iterate over.\n  // At that point, the result's request becomes null.\n  curreq.onsuccess = function (e) {\n    var cursor = curreq.result;\n    // If the cursor is pointing at something, ask for the data.    \n    if (cursor) {\n      var getreq = store.get(cursor.key);\n      // After the data has been retrieved, show it.\n      getreq.onsuccess = function (e) {\n        console.log('key:', cursor.key, 'value:', getreq.result);\n        // OK, now move the cursor to the next item. \n        cursor.continue();\n      };\n    }\n  };\n};</pre>\n        \n<p>To learn more about various topics, see the following</p>\n<ul> <li>Starting transactions - <span class=\"eval deki-transform\"><a title=\"en/IndexedDB/IDBDatabase#transaction()\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabase#transaction()\">IDBDatabase</a></span></li> <li>Setting transaction modes - <a title=\"en/IndexedDB/IDBTransaction#Mode_constants\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBTransaction#Mode_constants\">IDBTransaction</a></li> <li>Setting a range of keys - <a title=\"en/IndexedDB/IDBKeyRange\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBKeyRange\">IDBKeyRange</a></li> <li>Creating cursors - <a title=\"en/IndexedDB/IDBIndex#openCursor\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBIndex#openCursor\">IDBIndex</a></li>\n</ul>","<h4 class=\"editable\">Example</h4>\n<p>In the following code snippet, we open a transaction and manipulate an entire data set using a cursor. Because the specification is still evolving, Chrome uses prefixes in the methods. Chrome uses the <code>webkit</code> prefix. For example, instead of just <code>IDBCursor.NEXT</code>, use <code>webkitIDBCursor.NEXT</code>. Firefox does not use prefixes, except in the opening method (<code>mozIndexedDB</code>). Event handlers are registered for responding to various situations.</p>\n\n          <pre name=\"code\" class=\"js\">// Taking care of the browser-specific prefixes.\nwindow.indexedDB = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB;\nwindow.IDBTransaction = window.IDBTransaction || window.webkitIDBTransaction;\nwindow.IDBKeyRange = window.IDBKeyRange || window.webkitIDBKeyRange;\nwindow.IDBCursor = window.IDBCursor || window.webkitIDBCursor;\nvar db;\n\n...\n\nfunction cursorTest() {\n  // Start a transaction on an object store called \"my-store-name\"\n  // By default, transactions are opened with read-only access.\n  // If you want to have write access, see IDBDatabase.\n  var trans = db.transaction('my-store-name');\n  // Get a reference to the object store.\n  var store = trans.objectStore('my-store-name');\n  // Create a cursor with two optional parameters.  \n  // The first parameter sets the cursor over a specified key range;\n  // while the second one sets the direction of the cursor.  \n  // In this case, the direction is set to IDBCursor.PREV,  \n  // which lets you start at the upper bound of the key range\n  // and then moves downwards. \n  // If you don't want duplicates included, use PREV_NO_DUPLICATE instead.\n  var curreq = store.openCursor(IDBKeyRange.bound(1, 4), IDBCursor.PREV); \n  // The \"onsuccess\" event fires when the cursor is created and \n  // every time the cursor iterates over data. \n  // The following block of code runs multiple times,\n  // until the cursor runs out of data to iterate over.\n  // At that point, the result's request becomes null.\n  curreq.onsuccess = function (e) {\n    var cursor = curreq.result;\n    // If the cursor is pointing at something, ask for the data.    \n    if (cursor) {\n      var getreq = store.get(cursor.key);\n      // After the data has been retrieved, show it.\n      getreq.onsuccess = function (e) {\n        console.log('key:', cursor.key, 'value:', getreq.result);\n        // OK, now move the cursor to the next item. \n        cursor.continue();\n      };\n    }\n  };\n};</pre>\n        \n<p>To learn more about various topics, see the following</p>\n<ul> <li>Starting transactions - <span class=\"eval deki-transform\"><a title=\"en/IndexedDB/IDBDatabase#transaction()\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabase#transaction()\">IDBDatabase</a></span></li> <li>Setting transaction modes - <a title=\"en/IndexedDB/IDBTransaction#Mode_constants\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBTransaction#Mode_constants\">IDBTransaction</a></li> <li>Setting a range of keys - <a title=\"en/IndexedDB/IDBKeyRange\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBKeyRange\">IDBKeyRange</a></li> <li>Creating cursors - <a title=\"en/IndexedDB/IDBIndex#openCursor\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBIndex#openCursor\">IDBIndex</a></li>\n</ul>"],"srcUrl":"https://developer.mozilla.org/en/IndexedDB/IDBCursor","summary":"The <code>IDBCursor</code> interface of the <a title=\"en/IndexedDB\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB\">IndexedDB API</a> represents a <a title=\"en/IndexedDB#gloss_cursor\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/Basic_Concepts_Behind_IndexedDB#gloss_cursor\">cursor</a> for traversing or iterating over multiple records in a database.","members":[{"url":"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#DATA_ERR","name":"DATA_ERR","help":"The underlying object store uses <a title=\"en/IndexedDB/Basic_Concepts_Behind_IndexedDB#gloss in-line keys\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/Basic_Concepts_Behind_IndexedDB#gloss_in-line_keys\">in-line keys</a>, and the key for the cursor's position does not match the <code>value</code> property at the object store's&nbsp;<a class=\"external\" title=\"object store key path\" rel=\"external\" href=\"http://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html#dfn-object-store-key-path\" target=\"_blank\">key path</a>.","obsolete":false},{"url":"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#NOT_ALLOWED_ERR","name":"NOT_ALLOWED_ERR","help":"The cursor was created using <a title=\"en/IndexedDB/IDBIndex#openKeyCursor\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBIndex#openKeyCursor\">openKeyCursor()</a>, or if it is currently being iterated (you cannot call this method again until the new cursor data has been loaded), or if it has iterated past the end of its range.","obsolete":false},{"url":"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#READ_ONLY_ERR","name":"READ_ONLY_ERR","help":"The cursor is in a transaction whose mode is <code><a title=\"en/IndexedDB/IDBTransaction#READ ONLY\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBTransaction#READ_ONLY\">READ_ONLY</a></code>.","obsolete":false},{"url":"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#TRANSACTION_INACTIVE_ERR","name":"TRANSACTION_INACTIVE_ERR","help":"The transaction that this cursor belongs to is inactive.","obsolete":false},{"name":"DATA_CLONE_ERR","help":"If the value could not be cloned.","obsolete":false},{"url":"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#NON_TRANSIET_ERR","name":"NON_TRANSIENT_ERR","help":"The value passed into the <code>count</code> parameter was zero or a negative number.","obsolete":false},{"url":"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#NOT_ALLOWED_ERR","name":"NOT_ALLOWED_ERR","help":"The cursor was created using <a title=\"en/IndexedDB/IDBIndex#openKeyCursor\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBIndex#openKeyCursor\">openKeyCursor()</a>, or if it is currently being iterated (you cannot call this method again until the new cursor data has been loaded), or if it has iterated past the end of its range.","obsolete":false},{"url":"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#TRANSACTION_INACTIVE_ERR","name":"TRANSACTION_INACTIVE_ERR","help":"The transaction that this cursor belongs to is inactive.","obsolete":false},{"url":"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#DATA_ERR","name":"DATA_ERR","help":"If the <code>key</code> parameter was specified, but did not contain a valid key.","obsolete":false},{"url":"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#NOT_ALLOWED_ERR","name":"NOT_ALLOWED_ERR","help":"The cursor was created using <a title=\"en/IndexedDB/IDBIndex#openKeyCursor\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBIndex#openKeyCursor\">openKeyCursor()</a>, or if it is currently being iterated (you cannot call this method again until the new cursor data has been loaded), or if it has iterated past the end of its range.","obsolete":false},{"url":"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#TRANSACTION_INACTIVE_ERR","name":"TRANSACTION_INACTIVE_ERR","help":"The transaction that this cursor belongs to is inactive.","obsolete":false},{"url":"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#NOT_ALLOWED_ERR","name":"NOT_ALLOWED_ERR","help":"The cursor was created using <a title=\"en/IndexedDB/IDBIndex#openKeyCursor\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBIndex#openKeyCursor\">openKeyCursor()</a>, or if it is currently being iterated (you cannot call this method again until the new cursor data has been loaded), or if it has iterated past the end of its range.","obsolete":false},{"url":"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#READ_ONLY_ERR","name":"READ_ONLY_ERR","help":"The cursor is in a transaction whose mode is <code><a title=\"en/IndexedDB/IDBTransaction#READ ONLY\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBTransaction#READ_ONLY\">READ_ONLY</a></code>.","obsolete":false},{"url":"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#TRANSACTION_INACTIVE_ERR","name":"TRANSACTION_INACTIVE_ERR","help":"The transaction that this cursor belongs to is inactive.","obsolete":false},{"name":"advance","help":"<p>Sets the number times a cursor should move its position forward.</p>\n<pre>IDBRequest advance (\n  in long <em>count</em>\n) raises (IDBDatabaseException);</pre>\n<div id=\"section_13\"><span id=\"Parameter_2\"></span><h5 class=\"editable\">Parameter</h5>\n<dl> <dt>count</dt> <dd>The number of advances forward the cursor should make.</dd>\n</dl>\n</div><div id=\"section_14\"><span id=\"Returns_2\"></span><h5 class=\"editable\">Returns</h5>\n<dl> <dt><code>void</code></dt>\n</dl>\n</div><div id=\"section_15\"><span id=\"Exceptions_2\"></span><h5 class=\"editable\">Exceptions</h5>\n<p>This method can raise an <a title=\"en/IndexedDB/IDBDatabaseException\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException\">IDBDatabaseException</a> with the following codes:</p>\n<table class=\"standard-table\"> <thead> <tr> <th scope=\"col\" width=\"131\">Exception</th> <th scope=\"col\" width=\"698\">Description</th> </tr> </thead> <tbody> <tr> <td><a title=\"en/IndexedDB/IDBDatabaseException#NON_TRANSIET_ERR\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#NON_TRANSIET_ERR\"><code>NON_TRANSIENT_ERR</code></a></td> <td> <p>The value passed into the <code>count</code> parameter was zero or a negative number.</p> </td> </tr> <tr> <td><code><a title=\"en/IndexedDB/IDBDatabaseException#NOT ALLOWED ERR\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#NOT_ALLOWED_ERR\">NOT_ALLOWED_ERR</a></code></td> <td>The cursor was created using <a title=\"en/IndexedDB/IDBIndex#openKeyCursor\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBIndex#openKeyCursor\">openKeyCursor()</a>, or if it is currently being iterated (you cannot call this method again until the new cursor data has been loaded), or if it has iterated past the end of its range.</td> </tr> <tr> <td><code><a title=\"en/IndexedDB/IDBDatabaseException#TRANSACTION INACTIVE ERR\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#TRANSACTION_INACTIVE_ERR\">TRANSACTION_INACTIVE_ERR</a></code></td> <td>The transaction that this cursor belongs to is inactive.</td> </tr> </tbody>\n</table>\n</div>","obsolete":false},{"name":"delete","help":"<p>Returns an <code><a title=\"en/IndexedDB/IDBRequest\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBRequest\">IDBRequest</a></code> object, and, in a separate thread, deletes the record at the cursor's position, without changing the cursor's position. Once the record is deleted, the cursor's <code>value</code> is set to <code>null</code>.</p>\n<pre>IDBRequest delete (\n) raises (IDBDatabaseException);</pre>\n<div id=\"section_21\"><span id=\"Returns_4\"></span><h5 class=\"editable\">Returns</h5>\n<dl> <dt><code><a title=\"en/IndexedDB/IDBRequest\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBRequest\">IDBRequest</a></code></dt> <dd>A request object on which subsequent events related to this operation are fired. The <code>result</code> attribute is set to <code>undefined</code>.</dd>\n</dl>\n</div><div id=\"section_22\"><span id=\"Exceptions_4\"></span><h5 class=\"editable\">Exceptions</h5>\n<p>This method can raise an <a title=\"en/IndexedDB/IDBDatabaseException\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException\">IDBDatabaseException</a> with the following code:</p>\n<table class=\"standard-table\"> <thead> <tr> <th scope=\"col\" width=\"131\">Exception</th> <th scope=\"col\" width=\"698\">Description</th> </tr> </thead> <tbody> <tr> <td><code><a title=\"en/IndexedDB/IDBDatabaseException#NOT ALLOWED ERR\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#NOT_ALLOWED_ERR\">NOT_ALLOWED_ERR</a></code></td> <td>The cursor was created using <a title=\"en/IndexedDB/IDBIndex#openKeyCursor\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBIndex#openKeyCursor\">openKeyCursor()</a>, or if it is currently being iterated (you cannot call this method again until the new cursor data has been loaded), or if it has iterated past the end of its range.</td> </tr> <tr> <td><code><a title=\"en/IndexedDB/IDBDatabaseException#READ ONLY ERR\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#READ_ONLY_ERR\">READ_ONLY_ERR</a></code></td> <td>The cursor is in a transaction whose mode is <code><a title=\"en/IndexedDB/IDBTransaction#READ ONLY\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBTransaction#READ_ONLY\">READ_ONLY</a></code>.</td> </tr> <tr> <td><code><a title=\"en/IndexedDB/IDBDatabaseException#TRANSACTION INACTIVE ERR\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#TRANSACTION_INACTIVE_ERR\">TRANSACTION_INACTIVE_ERR</a></code></td> <td>The transaction that this cursor belongs to is inactive.</td> </tr> </tbody>\n</table>\n</div>","obsolete":false},{"name":"continue","help":"<p>Advances the cursor to the next position along its direction, to the item whose key matches the optional <code>key</code> parameter. If no key is specified, advance to the immediate next position, based on the cursor's direction.</p>\n<pre>void continue (\n  in optional any <em>key</em>\n) raises (IDBDatabaseException);</pre>\n<div id=\"section_17\"><span id=\"Returns_3\"></span><h5 class=\"editable\">Returns</h5>\n<dl> <dt><code>void</code></dt>\n</dl>\n</div><div id=\"section_18\"><span id=\"Parameters\"></span><h5 class=\"editable\">Parameters</h5>\n<dl> <dt>key</dt> <dd>The key to position the cursor at.</dd>\n</dl>\n</div><div id=\"section_19\"><span id=\"Exceptions_3\"></span><h5 class=\"editable\">Exceptions</h5>\n<p>This method can raise an <a title=\"en/IndexedDB/IDBDatabaseException\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException\">IDBDatabaseException</a>, with the following codes:</p>\n<table class=\"standard-table\"> <thead> <tr> <th scope=\"col\" width=\"131\">Exception</th> <th scope=\"col\" width=\"698\">Description</th> </tr> </thead> <tbody> <tr> <td><code><a title=\"en/IndexedDB/IDBDatabaseException#DATA ERR\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#DATA_ERR\">DATA_ERR</a></code></td> <td>If the <code>key</code> parameter was specified, but did not contain a valid key.</td> </tr> <tr> <td><code><a title=\"en/IndexedDB/IDBDatabaseException#NOT ALLOWED ERR\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#NOT_ALLOWED_ERR\">NOT_ALLOWED_ERR</a></code></td> <td>The cursor was created using <a title=\"en/IndexedDB/IDBIndex#openKeyCursor\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBIndex#openKeyCursor\">openKeyCursor()</a>, or if it is currently being iterated (you cannot call this method again until the new cursor data has been loaded), or if it has iterated past the end of its range.</td> </tr> <tr> <td><code><a title=\"en/IndexedDB/IDBDatabaseException#TRANSACTION INACTIVE ERR\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#TRANSACTION_INACTIVE_ERR\">TRANSACTION_INACTIVE_ERR</a></code></td> <td>The transaction that this cursor belongs to is inactive.</td> </tr> </tbody>\n</table>\n</div>","obsolete":false},{"name":"update","help":"<p>Returns an IDBRequest object, and, in a separate thread, updates the value at the current position of the cursor in the object store. If the cursor points to a record that has just been deleted, a new record is created.</p>\n<pre>IDBRequest update (\n  in any <em>value</em>\n) raises (IDBDatabaseException, DOMException);\n</pre>\n<div id=\"section_9\"><span id=\"Parameter\"></span><h5 class=\"editable\">Parameter</h5>\n<dl> <dt>value</dt> <dd>The value to be stored.</dd>\n</dl>\n</div><div id=\"section_10\"><span id=\"Returns\"></span><h5 class=\"editable\">Returns</h5>\n<dl> <dt><code><a title=\"en/IndexedDB/IDBRequest\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBRequest\">IDBRequest</a></code></dt> <dd>A request object on which subsequent events related to this operation are fired.</dd>\n</dl>\n</div><div id=\"section_11\"><span id=\"Exceptions\"></span><h5 class=\"editable\">Exceptions</h5>\n<p>This method can raise an <a title=\"en/IndexedDB/IDBDatabaseException\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException\">IDBDatabaseException</a> with the following codes:</p>\n<table class=\"standard-table\"> <thead> <tr> <th scope=\"col\" width=\"131\">Exception</th> <th scope=\"col\" width=\"698\">Description</th> </tr> </thead> <tbody> <tr> <td><code><a title=\"en/IndexedDB/IDBDatabaseException#DATA ERR\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#DATA_ERR\">DATA_ERR</a></code></td> <td> <p>The underlying object store uses <a title=\"en/IndexedDB/Basic_Concepts_Behind_IndexedDB#gloss in-line keys\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/Basic_Concepts_Behind_IndexedDB#gloss_in-line_keys\">in-line keys</a>, and the key for the cursor's position does not match the <code>value</code> property at the object store's&nbsp;<a class=\"external\" title=\"object store key path\" rel=\"external\" href=\"http://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html#dfn-object-store-key-path\" target=\"_blank\">key path</a>.</p> </td> </tr> <tr> <td><code><a title=\"en/IndexedDB/IDBDatabaseException#NOT ALLOWED ERR\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#NOT_ALLOWED_ERR\">NOT_ALLOWED_ERR</a></code></td> <td>The cursor was created using <a title=\"en/IndexedDB/IDBIndex#openKeyCursor\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBIndex#openKeyCursor\">openKeyCursor()</a>, or if it is currently being iterated (you cannot call this method again until the new cursor data has been loaded), or if it has iterated past the end of its range.</td> </tr> <tr> <td><code><a title=\"en/IndexedDB/IDBDatabaseException#READ ONLY ERR\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#READ_ONLY_ERR\">READ_ONLY_ERR</a></code></td> <td>The cursor is in a transaction whose mode is <code><a title=\"en/IndexedDB/IDBTransaction#READ ONLY\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBTransaction#READ_ONLY\">READ_ONLY</a></code>.</td> </tr> <tr> <td><code><a title=\"en/IndexedDB/IDBDatabaseException#TRANSACTION INACTIVE ERR\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabaseException#TRANSACTION_INACTIVE_ERR\">TRANSACTION_INACTIVE_ERR</a></code></td> <td>The transaction that this cursor belongs to is inactive.</td> </tr> </tbody>\n</table>\n<p>It can also raise a <a title=\"En/DOM/DOMException\" rel=\"internal\" href=\"https://developer.mozilla.org/En/DOM/DOMException\">DOMException</a> with the following code:</p>\n<table class=\"standard-table\"> <thead> <tr> <th scope=\"col\" width=\"131\">Attribute</th> <th scope=\"col\" width=\"698\">Description</th> </tr> </thead> <tbody> <tr> <td><code>DATA_CLONE_ERR</code></td> <td>If the value could not be cloned.</td> </tr> </tbody>\n</table>\n</div>","obsolete":false},{"url":"","name":"NEXT","help":"The cursor shows all records, including duplicates. It starts at the lower bound of the key range and moves upwards (monotonically increasing in the order of keys).","obsolete":false},{"url":"","name":"NEXT_NO_DUPLICATE","help":"The cursor shows all records, excluding duplicates. If multiple records exist with the same key, only the first one iterated is retrieved. It starts at the lower bound of the key range and moves upwards.","obsolete":false},{"url":"","name":"PREV","help":"The cursor shows all records, including duplicates. It starts at the upper bound of the key range and moves downwards (monotonically decreasing in the order of keys).","obsolete":false},{"url":"","name":"PREV_NO_DUPLICATE","help":"The cursor shows all records, excluding duplicates. If multiple records exist with the same key, only the first one iterated is retrieved. It starts at the upper bound of the key range and moves downwards.","obsolete":false},{"url":"","name":"source","help":"On getting, returns the <code>IDBObjectStore</code> or <code>IDBIndex</code> that the cursor is iterating. This function never returns null or throws an exception, even if the cursor is currently being iterated, has iterated past its end, or its transaction is not active.","obsolete":false},{"url":"","name":"direction","help":"On getting, returns the <a title=\"en/IndexedDB/Basic_Concepts_Behind_IndexedDB#gloss direction\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/Basic_Concepts_Behind_IndexedDB#gloss_direction\">direction</a> of traversal of the cursor. See Constants for possible values.","obsolete":false},{"url":"","name":"key","help":"Returns the key for the record at the cursor's position. If the cursor is outside its range, this is <code>undefined</code>.","obsolete":false},{"url":"","name":"primaryKey","help":"Returns the cursor's current effective key. If the cursor is currently being iterated or has iterated outside its range, this is <code>undefined</code>.","obsolete":false}]},"CSSPrimitiveValue":{"title":"Interface documentation status","members":[],"srcUrl":"https://developer.mozilla.org/User:trevorh/Interface_documentation_status","skipped":true,"cause":"Suspect title"},"SVGPoint":{"title":"SVGSVGElement","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/SVGSVGElement","skipped":true,"cause":"Suspect title"},"VoidCallback":{"title":"Mouse Lock API","members":[],"srcUrl":"https://developer.mozilla.org/en/API/Mouse_Lock_API","skipped":true,"cause":"Suspect title"},"EventTarget":{"title":"EventTarget","summary":"An <code>EventTarget</code> is a DOM interface implemented by objects that can receive DOM events and have listeners for them. The most common <code>EventTarget</code>s are <a rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/element\" title=\"en/DOM/element\">DOM elements</a>, although other objects can be <code>EventTarget</code>s too, for example <a rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/document\" title=\"en/DOM/document\">document</a>, <a rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/window\" title=\"en/DOM/window\">window</a>, <a rel=\"internal\" href=\"https://developer.mozilla.org/en/XMLHttpRequest\" title=\"en/XMLHttpRequest\">XMLHttpRequest</a>, and others.\n","members":[{"url":"https://developer.mozilla.org/en/DOM/element.addEventListener","name":"addEventListener","help":"\nRegister an event handler of a specific event type on the <code>EventTarget</code>.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.removeEventListener","name":"removeEventListener","help":"\nRemoves an event listener from the <code>EventTarget</code>.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.dispatchEvent","name":"dispatchEvent","help":"\nDispatch an event to this <code>EventTarget</code>.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.addEventListener","name":"addEventListener","help":"\nRegister an event handler of a specific event type on the <code>EventTarget</code>.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.removeEventListener","name":"removeEventListener","help":"\nRemoves an event listener from the <code>EventTarget</code>.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.dispatchEvent","name":"dispatchEvent","help":"\nDispatch an event to this <code>EventTarget</code>.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.addEventListener","name":"addEventListener","help":"\nRegister an event handler of a specific event type on the <code>EventTarget</code>.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.removeEventListener","name":"removeEventListener","help":"\nRemoves an event listener from the <code>EventTarget</code>.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/element.dispatchEvent","name":"dispatchEvent","help":"\nDispatch an event to this <code>EventTarget</code>.","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/DOM/EventTarget","specification":"DOM Level 2 Events: EventTarget"},"SVGAnimatedNumberList":{"title":"SVGAnimatedNumberList","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody>\n</table>\n</div>\n<div id=\"compat-mobile\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody>\n</table>\n</div>","summary":"The <code>SVGAnimatedNumber</code> interface is used for attributes which take a list of numbers and which can be animated.","members":[{"name":"baseVal","help":"The base value of the given attribute before applying any animations.","obsolete":false},{"name":"animVal","help":"A read only <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/SVGNumberList\">SVGNumberList</a></code>\n representing the current animated value of the given attribute. If the given attribute is not currently being animated, then the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/SVGNumberList\">SVGNumberList</a></code>\n will have the same contents as <code>baseVal</code>. The object referenced by <code>animVal</code> will always be distinct from the one referenced by <code>baseVal</code>, even when the attribute is not animated.","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/DOM/SVGAnimatedNumberList"},"ImageData":{"title":"ImageData","srcUrl":"https://developer.mozilla.org/en/DOM/ImageData","specification":"http://www.whatwg.org/specs/web-apps...html#imagedata","seeAlso":"Pixel manipulation with canvas","summary":"Used with the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/canvas\">&lt;canvas&gt;</a></code>\n element. Returned by <a title=\"en/DOM/CanvasRenderingContext2D\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/CanvasRenderingContext2D\">CanvasRenderingContext2D</a>'s <a title=\"en/DOM/CanvasRenderingContext2D.createImageData\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/CanvasRenderingContext2D.createImageData\" class=\"new \">createImageData</a> and <a title=\"en/DOM/CanvasRenderingContext2D.getImageData\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/CanvasRenderingContext2D.getImageData\" class=\"new \">getImageData</a> (and accepted as first argument in <a title=\"en/DOM/CanvasRenderingContext2D.putImageData\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/CanvasRenderingContext2D.putImageData\" class=\"new \">putImageData</a>)","members":[]},"HTMLTrackElement":{"title":"track","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari</th> </tr> <tr> <td>Basic support</td> <td>16*</td> <td><span title=\"Not supported.\">--</span><br> \n<span class=\"unimplementedInlineTemplate\">Unimplemented (see<a rel=\"external\" href=\"https://bugzilla.mozilla.org/show_bug.cgi?id=629350\" class=\"external\" title=\"\">\nbug 629350</a>\n)</span>\n</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> </tr> </tbody> </table>\n</div>\n<p>* Partially implemented in Chrome 16 and currently behind the --enable-video-track flag or enabling the feature in about:flags.</p>","examples":["&lt;video src=\"sample.ogv\"&gt;\n   &lt;track kind=\"captions\" src=\"sampleCaptions.srt\" srclang=\"en\"&gt;&lt;/track&gt;\n   &lt;track kind=\"descriptions\" src=\"sampleDesciptions.srt\" srclang=\"en\"&gt;&lt;/track&gt;\n   &lt;track kind=\"chapters\" src=\"sampleChapters.srt\" srclang=\"en\"&gt;&lt;/track&gt;\n   &lt;track kind=\"subtitles\" src=\"sampleSubtitles_de.srt\" srclang=\"de\"&gt;&lt;/track&gt;\n   &lt;track kind=\"subtitles\" src=\"sampleSubtitles_en.srt\" srclang=\"en\"&gt;&lt;/track&gt;\n   &lt;track kind=\"subtitles\" src=\"sampleSubtitles_ja.srt\" srclang=\"ja\"&gt;&lt;/track&gt;\n   &lt;track kind=\"subtitles\" src=\"sampleSubtitles_oz.srt\" srclang=\"oz\"&gt;&lt;/track&gt;\n   &lt;track kind=\"metadata\" src=\"keyStage1.srt\" srclang=\"en\" label=\"Key Stage 1\"&gt;&lt;/track&gt;\n   &lt;track kind=\"metadata\" src=\"keyStage2.srt\" srclang=\"en\" label=\"Key Stage 2\"&gt;&lt;/track&gt;\n   &lt;track kind=\"metadata\" src=\"keyStage3.srt\" srclang=\"en\" label=\"Key Stage 3\"&gt;&lt;/track&gt; \n&lt;/video&gt;"],"srcUrl":"https://developer.mozilla.org/en/HTML/Element/track","specification":"http://www.w3.org/TR/html5/video.html#the-track-element","summary":"<p>The <code>track</code>&nbsp;element is used as a child of the media elements—<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/audio\">&lt;audio&gt;</a></code>\n and <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/video\">&lt;video&gt;</a></code>\n—and does not represent anything on its own. It lets you specify timed text tracks (or time-based data).</p>\n<p>The type of data that <code> track</code> adds to the media is set in the <code>kind</code> attribute, which can take values of <code>subtitles</code>, <code>captions</code>, <code>descriptions</code>, <code>chapters</code> or <code>metadata</code>. The element points to a source file containing timed text that the browser exposes when the user requests additional data. </p>","members":[{"obsolete":false,"url":"","name":"label","help":"A user-readable title of the text track Used by the browser when listing available text tracks."},{"obsolete":false,"url":"","name":"kind","help":"Kind of text track. The following keywords are allowed: <ul> <li>subtitles: A transcription or translation of the dialogue.</li> <li>captions: A transcription or translation of the dialogue or other sound effects. Suitable for users who are deaf or when the sound is muted.</li> <li>descriptions: Textual descriptions of the video content. Suitable for users who are blind.</li> <li>chapters: Chapter titles, intended to be used when the user is navigating the media resource.</li> <li>metadata: Tracks used by script. Not visible to the user.</li> </ul>"},{"obsolete":false,"url":"","name":"default","help":"This attribute indicates that the track should be enabled unless the user's preferences indicate that another track is more appropriate. This may only be used on one <code>track</code> element per media element."},{"obsolete":false,"url":"","name":"src","help":"Address of the track. Must be a valid URL. This attribute must be defined."},{"obsolete":false,"url":"","name":"srclang","help":"Language of the track text data."}]},"StyleSheetList":{"title":"document.styleSheets","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/document.styleSheets","skipped":true,"cause":"Suspect title"},"SVGColor":{"title":"Colori","summary":"<p>This page explains more about how you can specify color in CSS.\n</p><p>In your sample stylesheet, you introduce background colors.\n</p>","members":[],"srcUrl":"https://developer.mozilla.org/it/Conoscere_i_CSS/Colori"},"SVGPathSegArcAbs":{"title":"SVGPathElement","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/SVGPathElement","skipped":true,"cause":"Suspect title"},"SVGFEColorMatrixElement":{"title":"feColorMatrix","seeAlso":"<li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/filter\">&lt;filter&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/animate\">&lt;animate&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/set\">&lt;set&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feBlend\">&lt;feBlend&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feComponentTransfer\">&lt;feComponentTransfer&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feComposite\">&lt;feComposite&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feConvolveMatrix\">&lt;feConvolveMatrix&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feDiffuseLighting\">&lt;feDiffuseLighting&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feDisplacementMap\">&lt;feDisplacementMap&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feFlood\">&lt;feFlood&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feGaussianBlur\">&lt;feGaussianBlur&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feImage\">&lt;feImage&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feMerge\">&lt;feMerge&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feMorphology\">&lt;feMorphology&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feOffset\">&lt;feOffset&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feSpecularLighting\">&lt;feSpecularLighting&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feTile\">&lt;feTile&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feTurbulence\">&lt;feTurbulence&gt;</a></code>\n</li> <li><a title=\"en/SVG/Tutorial/Filter_effects\" rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Tutorial/Filter_effects\">SVG tutorial: Filter effects</a></li>","summary":"This filter changes colors based on a transformation matrix. Every pixel's color value (represented by an [R,G,B,A] vector) is <a title=\"http://en.wikipedia.org/wiki/Matrix_multiplication\" class=\" external\" rel=\"external\" href=\"http://en.wikipedia.org/wiki/Matrix_multiplication\" target=\"_blank\">matrix multiplated</a> to create a new color.","members":[{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/style","name":"style","help":"Specific attributes"},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/in","name":"in","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/type","name":"type","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/values","name":"values","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/class","name":"class","help":""}],"srcUrl":"https://developer.mozilla.org/en/SVG/Element/feColorMatrix"},"SVGPathSegCurvetoQuadraticAbs":{"title":"SVGPathElement","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/SVGPathElement","skipped":true,"cause":"Suspect title"},"SVGPathSegCurvetoCubicAbs":{"title":"SVGPathElement","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/SVGPathElement","skipped":true,"cause":"Suspect title"},"SVGGElement":{"title":"SVGGElement","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td>9.0</td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> </tbody>\n</table>\n</div>\n<div id=\"compat-mobile\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> </tbody>\n</table>\n</div>","summary":"The <code>SVGGElement</code> interface corresponds to the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/g\">&lt;g&gt;</a></code>\n element.","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/SVGGElement"},"EventException":{"title":"DekiScript Code Snippets","members":[],"srcUrl":"https://developer.mozilla.org/User:IgorKitsa/Some_Algorithms","skipped":true,"cause":"Suspect title"},"SVGPolygonElement":{"title":"polygon","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\">\n<table class=\"compat-table\"> <tbody> \n<tr><th scope=\"col\">Feature</th><th scope=\"col\">Chrome</th><th scope=\"col\">Firefox (Gecko)</th><th scope=\"col\">Internet Explorer</th><th scope=\"col\">Opera</th><th scope=\"col\">Safari</th></tr> <tr> <td>Basic support</td> <td>1.0</td> <td>1.5 (1.8)\n</td> <td>\n9.0</td> <td>\n8.0</td> <td>\n3.0.4</td> </tr> </tbody>\n</table>\n</div>\n<div id=\"compat-mobile\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE&nbsp;Phone</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td>\n3.0</td> <td>1.0 (1.8)\n</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td>\n3.0.4</td> </tr> </tbody>\n</table>\n</div>\n<p>The chart is based on <a title=\"en/SVG/Compatibility sources\" rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Compatibility_sources\">these sources</a>.</p>","examples":["<tr> <th scope=\"col\">Source code</th> <th scope=\"col\">Output result</th> </tr> <tr> <td>\n          <pre name=\"code\" class=\"xml\">&lt;?xml version=\"1.0\"?&gt;\n&lt;svg width=\"120\" height=\"120\" \n     viewPort=\"0 0 120 120\" version=\"1.1\"\n     xmlns=\"http://www.w3.org/2000/svg\"&gt;\n\n    &lt;polygon points=\"60,20 100,40 100,80 60,100 20,80 20,40\"/&gt;\n\n&lt;/svg&gt;</pre>\n        </td> <td>\n<iframe src=\"https://developer.mozilla.org/@api/deki/services/developer.mozilla.org/39/images/3a819e42-12f2-6fab-61fa-69d9f937e686.svg\" width=\"120px\" height=\"120px\" marginwidth=\"0\" marginheight=\"0\" hspace=\"0\" vspace=\"0\" frameborder=\"0\" scrolling=\"no\"></iframe>\n</td> </tr>"],"srcUrl":"https://developer.mozilla.org/en/SVG/Element/polygon","summary":"The <code>polygon</code> element defines a closed shape consisting of a set of connected straight line segments.","members":[{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/style","name":"style","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/points","name":"points","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/transform","name":"transform","help":"Specific attributes"},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/externalResourcesRequired","name":"externalResourcesRequired","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/class","name":"class","help":""}]},"SVGFEOffsetElement":{"title":"feOffset","seeAlso":"<li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/filter\">&lt;filter&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/animate\">&lt;animate&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/set\">&lt;set&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feBlend\">&lt;feBlend&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feColorMatrix\">&lt;feColorMatrix&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feComponentTransfer\">&lt;feComponentTransfer&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feComposite\">&lt;feComposite&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feConvolveMatrix\">&lt;feConvolveMatrix&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feDiffuseLighting\">&lt;feDiffuseLighting&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feDisplacementMap\">&lt;feDisplacementMap&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feFlood\">&lt;feFlood&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feGaussianBlur\">&lt;feGaussianBlur&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feImage\">&lt;feImage&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feMerge\">&lt;feMerge&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feMorphology\">&lt;feMorphology&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feSpecularLighting\">&lt;feSpecularLighting&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feTile\">&lt;feTile&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feTurbulence\">&lt;feTurbulence&gt;</a></code>\n</li> <li><a title=\"en/SVG/Tutorial/Filter_effects\" rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Tutorial/Filter_effects\">SVG tutorial: Filter effects</a></li>","summary":"The input image as a whole is offset by the values specified in the \n<code><a rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Attribute/dx\" class=\"new\">dx</a></code> and \n<code><a rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Attribute/dy\" class=\"new\">dy</a></code> attributes. It's used in creating drop-shadows.","members":[{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/style","name":"style","help":"Specific attributes"},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/dy","name":"dy","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/in","name":"in","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/dx","name":"dx","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/class","name":"class","help":""}],"srcUrl":"https://developer.mozilla.org/en/SVG/Element/feOffset"},"TouchEvent":{"title":"TouchEvent","examples":["See the <a title=\"en/DOM/Touch events#Example\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/Touch_events#Example\">example on the main Touch events article</a>."],"srcUrl":"https://developer.mozilla.org/en/DOM/TouchEvent","seeAlso":"<li><a title=\"en/DOM/Touch events\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/Touch_events\">Touch events</a></li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Touch\">Touch</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/TouchList\">TouchList</a></code>\n</li>","summary":"<p>A <code>TouchEvent</code> represents an event sent when the state of contacts with a touch-sensitive surface changes. This surface can be a touch screen or trackpad, for example. The event can describe one or more points of contact with the screen and includes support for detecting movement, addition and removal of contact points, and so forth.</p>\n<p>Touches are represented by the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Touch\">Touch</a></code>\n&nbsp;object; each touch is described by a position, size and shape, amount of pressure, and target element. Lists of touches are represented by <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/TouchList\">TouchList</a></code>\n objects.</p>","members":[{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/TouchEvent.targetTouches","name":"targetTouches","help":"A <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/TouchList\">TouchList</a></code>\n of all the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Touch\">Touch</a></code>\n&nbsp;objects that are both currently in contact with the touch surface <strong>and</strong> were also started on the same element that is the target of the event. <strong>Read only.</strong>"},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/event.metaKey","name":"metaKey","help":"A Boolean value indicating whether or not the meta key was down when the touch event was fired. <strong>Read only.</strong>"},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/event.ctrlKey","name":"ctrlKey","help":"A Boolean value indicating whether or not the control key was down when the touch event was fired. <strong>Read only.</strong>"},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/event.altKey","name":"altKey","help":"A Boolean value indicating whether or not the alt key was down when the touch event was fired. <strong>Read only.</strong>"},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/event.shiftKey","name":"shiftKey","help":"A Boolean value indicating whether or not the shift key was down when the touch event was fired. <strong>Read only.</strong>"},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/TouchEvent.touches","name":"touches","help":"A <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/TouchList\">TouchList</a></code>\n of all the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Touch\">Touch</a></code>\n&nbsp;objects representing all current points of contact with the surface, regardless of target or changed status. <strong>Read only.</strong>"},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/TouchEvent.changedTouches","name":"changedTouches","help":"A <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/TouchList\">TouchList</a></code>\n of all the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Touch\">Touch</a></code>\n objects representing individual points of contact whose states changed between the previous touch event and this one. <strong>Read only.</strong>"},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/event.type","name":"type","help":"The type of touch event that occurred. See <a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/TouchEvent#Touch_event_types\">Touch event types</a>&nbsp;for possible values and details."}]},"HTMLMapElement":{"title":"map","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari</th> </tr> <tr> <td>Basic support</td> <td>1.0</td> <td> <p>1.0 (1.7 or earlier)\n</p> <p>Starting in Gecko 5.0 (Firefox 5.0 / Thunderbird 5.0 / SeaMonkey 2.2)\n, empty maps are no longer skipped over in favor of non-empty ones when matching when in quirks mode. See the section <a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/map#Gecko_notes\">Gecko notes</a> below.</p> </td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td>1.0</td> <td>1.0</td> </tr> </tbody>\n</table>\n</div>\n<div id=\"compat-mobile\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td>1.0</td> <td>1.0 (1)\n</td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td>1.0</td> <td>1.0</td> </tr> </tbody>\n</table>\n</div>","examples":["&lt;map&gt;\n  &lt;area shape=\"circle\" coords=\"200,250,25\" href=\"another.htm\" /&gt; \n  &lt;area shape=\"default\" /&gt;\n&lt;/map&gt;"],"srcUrl":"https://developer.mozilla.org/en/HTML/Element/map","seeAlso":"<li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/a\">&lt;a&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/area\">&lt;area&gt;</a></code>\n</li>","summary":"The HTML <em>Map</em> element (<code>&lt;map&gt;</code>) is used with <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/area\">&lt;area&gt;</a></code>\n elements to define a image map.","members":[]},"SVGClipPathElement":{"title":"SVGClipPathElement","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> </tbody> </table>\n</div>","srcUrl":"https://developer.mozilla.org/en/DOM/SVGClipPathElement","seeAlso":"<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/clipPath\">&lt;clipPath&gt;</a></code>\n SVG Element","summary":"The <code>SVGClipPathElement</code> interface provides access to the properties of <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/clipPath\">&lt;clipPath&gt;</a></code>\n elements, as well as methods to manipulate them.","members":[{"name":"clipPathUnits","help":"Corresponds to attribute \n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Attribute/clipPathUnits\">clipPathUnits</a></code> on the given <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/clipPath\">&lt;clipPath&gt;</a></code>\n element. Takes one of the constants defined in <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/SVGUnitTypes\" class=\"new\">SVGUnitTypes</a></code>","obsolete":false}]},"EventSource":{"title":"EventSource","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari</th> </tr> <tr> <td>EventSource support</td> <td>9</td> <td>6.0 (6.0)\n</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td>11</td> <td>5</td> </tr> <tr> <td><a title=\"HTTP access control\" rel=\"internal\" href=\"https://developer.mozilla.org/En/HTTP_access_control\">Cross-Origin Resource Sharing</a><br> support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td>11.0 (11.0)\n</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>EventSource support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>","srcUrl":"https://developer.mozilla.org/en/Server-sent_events/EventSource","seeAlso":"<li>\n<a rel=\"custom\" href=\"http://www.w3.org/TR/eventsource/#the-eventsource-interface\">Server-Sent Events: The EventSource Interface</a><span title=\"Working Draft\">WD</span></li> <li><a title=\"en/Server-sent events/Using server-sent events\" rel=\"internal\" href=\"https://developer.mozilla.org/en/Server-sent_events/Using_server-sent_events\">Using server-sent events</a></li>","summary":"<p>The <code>EventSource</code> interface is used to manage server-sent events. You can set the onmessage attribute to a JavaScript function to receive non-typed messages (that is, messages with no <code>event</code> field). You can also call <code>addEventListener()</code> to listen for events just like any other event source.</p>\n<p>See <a title=\"en/Server-sent events/Using server-sent events\" rel=\"internal\" href=\"https://developer.mozilla.org/en/Server-sent_events/Using_server-sent_events\">Using server-sent events</a> for further details.</p>","members":[{"name":"init","help":"<div id=\"section_6\"><p>Initializes the object for use from C++ code with the principal, script context, and owner window that should be used.</p>\n\n</div><div id=\"section_7\"><span id=\"Parameters_2\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>principal</code></dt> <dd>The principal to use for the request. This must not be <code>null</code>.</dd> <dt><code>scriptContext</code></dt> <dd>The script context to use for the request. May be <code>null</code>.</dd> <dt><code>ownerWindow</code></dt> <dd>The associated window for the request. May be <code>null</code>.</dd> <dt><code>url</code></dt> <dd>The <code>EventSource</code>'s URL. This must not be empty.</dd>\n</dl>\n</div>","idl":"<pre class=\"eval\">void init(\n  in nsIPrincipal principal,\n  in nsIScriptContext scriptContext,\n  in nsPIDOMWindow ownerWindow,\n  in DOMString url\n);\n</pre>","obsolete":false},{"name":"close","help":"Closes the connection, if any, and sets the <code>readyState</code> attribute to <code>CLOSED</code>. If the connection is already closed, the method does nothing.","idl":"<pre class=\"eval\">void close();\n</pre>","obsolete":false},{"name":"CONNECTING","help":"The connection is being established.","obsolete":false},{"name":"OPEN","help":"The connection is open and dispatching events.","obsolete":false},{"name":"CLOSED","help":"The connection is not being established, has been closed or there was a fatal error.","obsolete":false},{"name":"onerror","help":"A JavaScript function to call when an error occurs.","obsolete":false},{"name":"onmessage","help":"A JavaScript function to call when an a message without an <code>event</code> field arrives.","obsolete":false},{"name":"onopen","help":"A JavaScript function to call when the connection has opened.","obsolete":false},{"name":"readyState","help":"The state of the connection, must be one of <code>CONNECTING</code>, <code>OPEN</code>, or <code>CLOSED</code>. <strong>Read only.</strong>","obsolete":false},{"name":"url","help":"Read only.","obsolete":false}]},"CSSStyleSheet":{"title":"CSSStyleSheet","srcUrl":"https://developer.mozilla.org/en/DOM/CSSStyleSheet","specification":"DOM Level 2 CSS: <code>CSSStyleSheet</code> interface","seeAlso":"StyleSheet","summary":"<p>An object implementing the <code>CSSStyleSheet</code> interface represents a single <a title=\"en/CSS\" rel=\"internal\" href=\"https://developer.mozilla.org/en/CSS\">CSS</a> style sheet.</p>\n<p>A CSS style sheet consists of CSS rules, each of which can be manipulated through an object that corresponds to that rule and that implements the <code><a title=\"en/DOM/cssRule\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/cssRule\">CSSRule</a></code> interface. The <code>CSSStyleSheet</code> itself lets you examine and modify its corresponding style sheet, including its list of rules.</p>\n<p>In practice, every <code>CSSStyleSheet</code> also implements the more generic <code><a title=\"en/DOM/StyleSheet\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/stylesheet\">StyleSheet</a></code> interface. A list of <code>CSSStyleSheet</code>-implementing objects corresponding to the style sheets for a given document can be reached by the <code><a title=\"en/DOM/document.styleSheets\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/document.styleSheets\">document.styleSheets</a></code> property, if the document is styled by an external CSS style sheet or an inline <code><a title=\"en/HTML/element/style\" rel=\"internal\" href=\"https://developer.mozilla.org/en/HTML/Element/style\">style</a></code> element.</p>","members":[{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/CSSStyleSheet/insertRule","name":"insertRule","help":"Inserts a new style rule into the current style sheet."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/CSSStyleSheet/deleteRule","name":"deleteRule","help":"Deletes a rule from the style sheet."},{"name":"ownerRule","help":"If this style sheet is imported into the document using an <code><a title=\"en/CSS/@import\" rel=\"internal\" href=\"https://developer.mozilla.org/en/CSS/@import\">@import</a></code> rule, the <code>ownerRule</code> property will return that <code><a title=\"en/DOM/CSSImportRule\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/CSSImportRule\" class=\"new \">CSSImportRule</a></code>, otherwise it returns <code>null</code>.","obsolete":false},{"name":"cssRules","help":"Returns a <code><a title=\"en/DOM/CSSRuleList\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/CSSRuleList\">CSSRuleList</a></code> of the CSS rules in the style sheet.","obsolete":false}]},"SVGStyleElement":{"title":"SVGStyleElement","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody>\n</table>\n</div>\n<div id=\"compat-mobile\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody>\n</table>\n</div>","summary":"The <code>SVGStyleElement</code> interface corresponds to the SVG <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/style\">&lt;style&gt;</a></code>\n element.","members":[{"name":"type","help":"Corresponds to attribute \n<code><a rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Attribute/type\" class=\"new\">type</a></code> on the given element. A <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DOMException\">DOMException</a></code>\n is raised with code <code>NO_MODIFICATION_ALLOWED_ERR</code> on an attempt to change the value of a read only attribut.","obsolete":false},{"name":"media","help":"Corresponds to attribute \n<code><a rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Attribute/media\" class=\"new\">media</a></code> on the given element. A <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DOMException\">DOMException</a></code>\n is raised with code <code>NO_MODIFICATION_ALLOWED_ERR</code> on an attempt to change the value of a read only attribut.","obsolete":false},{"name":"title","help":"Corresponds to attribute \n<code><a rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Attribute/title\" class=\"new\">title</a></code> on the given element. A <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DOMException\">DOMException</a></code>\n is raised with code <code>NO_MODIFICATION_ALLOWED_ERR</code> on an attempt to change the value of a read only attribut.","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/DOM/SVGStyleElement"},"StyleSheet":{"title":"stylesheet","srcUrl":"https://developer.mozilla.org/en/DOM/stylesheet","specification":"DOM Level 2 Style Sheets: <code>StyleSheet</code> interface","seeAlso":"CSSStyleSheet","summary":"An object implementing the <code>StyleSheet</code> interface represents a single style sheet.&nbsp; CSS style sheets will further implement the more specialized <code><a title=\"en/DOM/CSSStyleSheet\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/CSSStyleSheet\">CSSStyleSheet</a></code> interface.","members":[{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/StyleSheet/title","name":"title","help":"Returns the advisory title of the current style sheet."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/StyleSheet/parentStyleSheet","name":"parentStyleSheet","help":"Returns the stylesheet that is including this one, if any."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/StyleSheet/media","name":"media","help":"Specifies the intended destination medium for style information."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/StyleSheet/ownerNode","name":"ownerNode","help":"Returns the node that associates this style sheet with the document."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/StyleSheet/href","name":"href","help":"Returns the location of the stylesheet."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/StyleSheet/disabled","name":"disabled","help":"This property indicates whether the current stylesheet has been applied or not."},{"obsolete":false,"url":"https://developer.mozilla.org/en/DOM/StyleSheet/type","name":"type","help":"Specifies the style sheet language for this style sheet."}]},"SVGMaskElement":{"title":"SVGMaskElement","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td>9.0</td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> </tbody> </table>\n</div>","srcUrl":"https://developer.mozilla.org/en/DOM/SVGMaskElement","seeAlso":"<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/mask\">&lt;mask&gt;</a></code>\n SVG Element","summary":"The <code>SVGMaskElement</code> interface provides access to the properties of <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/mask\">&lt;mask&gt;</a></code>\n elements, as well as methods to manipulate them.","members":[{"name":"maskUnits","help":"Corresponds to attribute \n<code><a rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Attribute/maskUnits\" class=\"new\">maskUnits</a></code> on the given <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/mask\">&lt;mask&gt;</a></code>\n element. Takes one of the constants defined in <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/SVGUnitTypes\" class=\"new\">SVGUnitTypes</a></code>","obsolete":false},{"name":"maskContentUnits","help":"Corresponds to attribute \n<code><a rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Attribute/maskContentUnits\" class=\"new\">maskContentUnits</a></code> on the given <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/mask\">&lt;mask&gt;</a></code>\n element. Takes one of the constants defined in <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/DOM/SVGUnitTypes\" class=\"new\">SVGUnitTypes</a></code>","obsolete":false},{"name":"width","help":"Corresponds to attribute \n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Attribute/width\">width</a></code> on the given <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/mask\">&lt;mask&gt;</a></code>\n element.","obsolete":false},{"name":"height","help":"Corresponds to attribute \n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Attribute/height\">height</a></code> on the given <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/mask\">&lt;mask&gt;</a></code>\n element.","obsolete":false}]},"HTMLInputElement":{"title":"HTMLInputElement","seeAlso":"<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/input\">&lt;input&gt;</a></code>\n&nbsp;HTML&nbsp;element","summary":"DOM <code>Input</code> objects expose the <a title=\"http://dev.w3.org/html5/spec/the-input-element.html#htmlinputelement\" class=\" external\" rel=\"external\" href=\"http://dev.w3.org/html5/spec/the-input-element.html#htmlinputelement\" target=\"_blank\">HTMLInputElement</a> (or \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML\">HTML 4</a></span> <a class=\" external\" rel=\"external\" href=\"http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-6043025\" title=\"http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-6043025\" target=\"_blank\"><code>HTMLInputElement</code></a>) interface, which provides special properties and methods (beyond the regular <a rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/element\">element</a> object interface they also have available to them by inheritance) for manipulating the layout and presentation of input elements.","members":[{"name":"blur","help":"Removes focus from input; keystrokes will subsequently go nowhere.","obsolete":false},{"name":"checkValidity","help":"Returns false if the element is a candidate for constraint validation, and it does not satisfy its constraints. In this case, it also fires an <code>invalid</code> event at the element. It returns true if the element is not a candidate for constraint validation, or if it satisfies its constraints.","obsolete":false},{"name":"click","help":"Simulates a click on the element.","obsolete":false},{"name":"focus","help":"Focus on input; keystrokes will subsequently go to this element.","obsolete":false},{"name":"webkitGetFileNameArray","help":"Returns an array of all the file names from the input.","obsolete":false},{"name":"webkitSetFileNameArray","help":"Sets the filenames for the files selected on the input.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Input.select","name":"select","help":"Selects the input text in the element, and focuses it so the user can subsequently replace the whole entry.","obsolete":false},{"name":"setCustomValidity","help":"Sets a custom validity message for the element. If this message is not the empty string, then the element is suffering from a custom validity error, and does not validate.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Input.setSelectionRange","name":"setSelectionRange","help":"Selects a range of text in the element (but does not focus it). The optional <code>selectionDirection</code> parameter may be \"forward\" or \"backward\" to establish the direction in which selection was set, or \"none\"if the direction is unknown or not relevant. The default is \"none\". Specifying <code>selectionDirection</code> sets the value of the <code>selectionDirection</code> property.","obsolete":false},{"name":"stepDown","help":"<p>Decrements the <strong>value</strong> by (<strong>step</strong> * <code>n</code>), where <code>n</code> defaults to 1 if not specified. Throws an INVALID_STATE_ERR exception:</p> <ul> <li>if the method is not applicable to for the current <strong>type</strong> value.</li> <li>if the element has no step value.</li> <li>if the <strong>value</strong> cannot be converted to a number.</li> <li>if the resulting value is above the <strong>max</strong> or below the <strong>min</strong>.&nbsp;</li> </ul>","obsolete":false},{"name":"stepUp","help":"<p>Increments the <strong>value</strong> by (<strong>step</strong> * <code>n</code>), where <code>n</code> defaults to 1 if not specified. Throws an INVALID_STATE_ERR exception:</p> <ul> <li>if the method is not applicable to for the current <strong>type</strong> value.</li> <li>if the element has no step value.</li> <li>if the <strong>value</strong> cannot be converted to a number.</li> <li>if the resulting value is above the <strong>max</strong> or below the <strong>min</strong>.</li> </ul>","obsolete":false},{"name":"accept","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/input#attr-accept\">accept</a></code>\n HTML&nbsp;attribute, containing comma-separated list of file types accepted by the server when <strong>type</strong> is <code>file</code>.","obsolete":false},{"name":"accessKey","help":"A single character that switches input focus to the control. \n\n<span title=\"\">Obsolete</span>&nbsp;in \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span>","obsolete":true},{"name":"align","help":"Alignment of the element.\n\n<span title=\"\">Obsolete</span>&nbsp;in \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span>","obsolete":true},{"name":"alt","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/input#attr-alt\">alt</a></code>\n&nbsp;HTML attribute, containing alternative text to use when <strong>type</strong> is <code>image.</code>","obsolete":false},{"name":"autocomplete","help":"Reflects the {{htmlattrxref(\"autocomplete\", \"input)}} HTML attribute, indicating whether the value of the control can be automatically completed by the browser. Ignored if the value of the <strong>type</strong> attribute is <span>hidden</span>, <span>checkbox</span>, <span>radio</span>, <span>file</span>, or a button type (<span>button</span>, <span>submit</span>, <span>reset</span>, <span>image</span>). Possible values are: <ul> <li><span>off</span>: The user must explicitly enter a value into this field for every use, or the document provides its own auto-completion method; the browser does not automatically complete the entry.</li> <li><span>on</span>: The browser can automatically complete the value based on values that the user has entered during previous uses.</li> </ul>","obsolete":false},{"name":"autofocus","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/input#attr-autofocus\">autofocus</a></code>\n HTML&nbsp;attribute, which specifies that a form control should have input focus when the page loads, unless the user overrides it, for example by typing in a different control. Only one form element in a document can have the <strong>autofocus</strong> attribute. It cannot be applied if the <strong>type</strong> attribute is set to <code>hidden</code> (that is, you cannot automatically set focus to a hidden control).","obsolete":false},{"name":"checked","help":"The current state of the element when <strong>type</strong> is <code>checkbox</code> or <code>radio</code>.","obsolete":false},{"name":"defaultChecked","help":"The default state of a radio button or checkbox as originally specified in HTML that created this object.","obsolete":false},{"name":"defaultValue","help":"The default value as originally specified in HTML that created this object.","obsolete":false},{"name":"disabled","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/input#attr-disabled\">disabled</a></code>\n HTML attribute, indicating that the control is not available for interaction.","obsolete":false},{"name":"files","help":"A list of selected files.","obsolete":false},{"name":"form","help":"<p>The containing form element, if this element is in a form. If this element is not contained in a form element:</p> <ul> <li>\n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span> this can be the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/form#attr-id\">id</a></code>\n attribute of any <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/form\">&lt;form&gt;</a></code>\n element in the same document. Even if the attribute is set on <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/input\">&lt;input&gt;</a></code>\n, this property will be <code>null</code>, if it isn't the id of a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/form\">&lt;form&gt;</a></code>\n element.</li> <li>\n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML\">HTML 4</a></span> this must be <code>null</code>.</li> </ul>","obsolete":false},{"name":"formAction","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/input#attr-formaction\">formaction</a></code>\n HTML attribute, containing the URI&nbsp;of a program that processes information submitted by the element. If specified, this attribute overrides the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/form#attr-action\">action</a></code>\n attribute of the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/form\">&lt;form&gt;</a></code>\n element that owns this element.","obsolete":false},{"name":"formEncType","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/input#attr-formenctype\">formenctype</a></code>\n HTML&nbsp;attribute, containing the type of content that is used to submit the form to the server. If specified, this attribute overrides the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/form#attr-enctype\">enctype</a></code>\n attribute of the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/form\">&lt;form&gt;</a></code>\n element that owns this element.","obsolete":false},{"name":"formMethod","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/input#attr-formmethod\">formmethod</a></code>\n&nbsp;HTML&nbsp;attribute, containing the HTTP&nbsp;method that the browser uses to submit the form. If specified, this attribute overrides the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/form#attr-method\">method</a></code>\n attribute of the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/form\">&lt;form&gt;</a></code>\n element that owns this element.","obsolete":false},{"name":"formNoValidate","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/input#attr-formnovalidate\">formnovalidate</a></code>\n&nbsp;HTML&nbsp;attribute, indicating that the form is not to be validated when it is submitted. If specified, this attribute overrides the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/form#attr-novalidate\">novalidate</a></code>\n attribute of the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/form\">&lt;form&gt;</a></code>\n element that owns this element.","obsolete":false},{"name":"formTarget","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/input#attr-formtarget\">formtarget</a></code>\n HTML&nbsp;attribute, containing a name or keyword indicating where to display the response that is received after submitting the form. If specified, this attribute overrides the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/form#attr-target\">target</a></code>\n attribute of the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/form\">&lt;form&gt;</a></code>\n element that owns this element.","obsolete":false},{"name":"height","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/input#attr-height\">height</a></code>\n HTML attribute, which defines the height of the image displayed for the button, if the value of <strong>type</strong> is <span>image</span>.","obsolete":false},{"name":"indeterminate","help":"Indicates that a checkbox is neither on nor off.","obsolete":false},{"name":"labels","help":"A list of <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/label\">&lt;label&gt;</a></code>\n elements that are labels for this element.","obsolete":false},{"name":"list","help":"Identifies a list of pre-defined options to suggest to the user. The value must be the <strong>id</strong> of a <code><a class=\"new\" href=\"https://developer.mozilla.org/en/HTML/Element/datalist\" rel=\"internal\">&lt;datalist&gt;</a></code> element in the same document. The browser displays only options that are valid values for this input element. This attribute is ignored when the <strong>type</strong> attribute's value is <span>hidden</span>, <span>checkbox</span>, <span>radio</span>, <span>file</span>, or a button type.","obsolete":false},{"name":"max","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/input#attr-max\">max</a></code>\n HTML&nbsp;attribute, containing the maximum (numeric or date-time) value for this item, which must not be less than its minimum (<strong>min</strong> attribute) value.","obsolete":false},{"name":"maxLength","help":"<p>Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/input#attr-maxlength\">maxlength</a></code>\n&nbsp;HTML attribute, containing the maximum length of text (in Unicode code points) that the value can be changed to. The constraint is evaluated only when the value is changed</p> <div class=\"note\"><strong>Note:</strong> If you set <code>maxlength</code> to a negative value programmatically, an exception will be thrown.</div>","obsolete":false},{"name":"min","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/input#attr-min\">min</a></code>\n HTML&nbsp;attribute, containing the minimum (numeric or date-time) value for this item, which must not be greater than its maximum (<strong>max</strong> attribute) value.","obsolete":false},{"name":"multiple","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/input#attr-multiple\">multiple</a></code>\n HTML&nbsp;attribute, indicating whether more than one value is possible (e.g., multiple files).","obsolete":false},{"name":"name","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/input#attr-name\">name</a></code>\n HTML&nbsp;attribute, containing a name that identifies the element when submitting the form.","obsolete":false},{"name":"pattern","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/input#attr-pattern\">pattern</a></code>\n HTML&nbsp;attribute, containing a regular expression that the control's value is checked against. The pattern must match the entire value, not just some subset. Use the <strong>title</strong> attribute to describe the pattern to help the user. This attribute applies when the value of the <strong>type</strong> attribute is <span>text</span>, <span>search</span>, <span>tel</span>, <span>url</span> or <span>email</span>; otherwise it is ignored.","obsolete":false},{"name":"placeholder","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/input#attr-placeholder\">placeholder</a></code>\n HTML&nbsp;attribute, containing a hint to the user of what can be entered in the control. The placeholder text must not contain carriage returns or line-feeds. This attribute applies when the value of the <strong>type</strong> attribute is <span>text</span>, <span>search</span>, <span>tel</span>, <span>url</span> or <span>email</span>; otherwise it is ignored.","obsolete":false},{"name":"readOnly","help":"<p>Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/input#attr-readonly\">readonly</a></code>\n HTML&nbsp;attribute, indicating that the user cannot modify the value of the control.</p> <p><span><a href=\"https://developer.mozilla.org/en/HTML/HTML5\" rel=\"custom nofollow\">HTML 5</a></span> This is ignored if the value of the <strong>type</strong> attribute is <span>hidden</span>, <span>range</span>, <span>color</span>, <span>checkbox</span>, <span>radio</span>, <span>file</span>, or a button type.</p>","obsolete":false},{"name":"required","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/input#attr-required\">required</a></code>\n HTML&nbsp;attribute, indicating that the user must fill in a value before submitting a form.","obsolete":false},{"name":"selectionDirection","help":"The direction in which selection occurred. This is \"forward\" if selection was performed in the start-to-end direction of the current locale, or \"backward\" for the opposite direction. This can also be \"none\"&nbsp;if the direction is unknown.\"","obsolete":false},{"name":"selectionEnd","help":"The index of the end of selected text.","obsolete":false},{"name":"selectionStart","help":"The index of the beginning of selected text.","obsolete":false},{"name":"size","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/input#attr-size\">size</a></code>\n HTML&nbsp;attribute, containing size of the control. This value is in pixels unless the value of <strong>type</strong> is <span>text</span> or <span>password</span>, in which case, it is an integer number of characters. \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span> Applies only when <strong>type</strong> is set to <span>text</span>, <span>search</span>, <span>tel</span>, <span>url</span>, <span>email</span>, or <span>password</span>; otherwise it is ignored.","obsolete":false},{"name":"src","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/input#attr-src\">src</a></code>\n HTML&nbsp;attribute, which specifies a URI for the location of an image to display on the graphical submit button, if the value of <strong>type</strong> is <span>image</span>; otherwise it is ignored.","obsolete":false},{"name":"step","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/input#attr-step\">step</a></code>\n HTML&nbsp;attribute, which works with<strong> min</strong> and <strong>max</strong> to limit the increments at which a numeric or date-time value can be set. It can be the string <span>any</span> or a positive floating point number. If this is not set to <span>any</span>, the control accepts only values at multiples of the step value greater than the minimum.","obsolete":false},{"name":"tabIndex","help":"The position of the element in the tabbing navigation order for the current document. \n\n<span title=\"\">Obsolete</span> in \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span>","obsolete":true},{"name":"type","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/input#attr-type\">type</a></code>\n HTML&nbsp;attribute, indicating the type of control to display. See \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/input#attr-type\">type</a></code>\n attribute of <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/input\">&lt;input&gt;</a></code>\n for possible values.","obsolete":false},{"name":"useMap","help":"A client-side image map. \n\n<span title=\"\">Obsolete</span> in \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span>","obsolete":true},{"name":"validationMessage","help":"A localized message that describes the validation constraints that the control does not satisfy (if any). This is the empty string if the control is not a candidate for constraint validation (<strong>willValidate</strong> is false), or it satisfies its constraints.","obsolete":false},{"name":"validity","help":"The validity states that this element is in.&nbsp;","obsolete":false},{"name":"value","help":"Current value in the control.","obsolete":false},{"name":"valueAsDate","help":"The value of the element, interpreted as a date, or <code>null</code> if conversion is not possible.","obsolete":false},{"name":"valueAsNumber","help":"<p>The value of the element, interpreted as one of the following in order:</p> <ol> <li>a time value</li> <li>a number</li> <li><code>null</code> if conversion is not possible</li> </ol>","obsolete":false},{"name":"width","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/input#attr-width\">width</a></code>\n HTML&nbsp;attribute, which defines the width of the image displayed for the button, if the value of <strong>type</strong> is <span>image</span>.","obsolete":false},{"name":"willValidate","help":"Indicates whether the element is a candidate for constraint validation. It is false if any conditions bar it from constraint validation.","obsolete":false},{"name":"blur","help":"Removes focus from input; keystrokes will subsequently go nowhere.","obsolete":false},{"name":"checkValidity","help":"Returns false if the element is a candidate for constraint validation, and it does not satisfy its constraints. In this case, it also fires an <code>invalid</code> event at the element. It returns true if the element is not a candidate for constraint validation, or if it satisfies its constraints.","obsolete":false},{"name":"click","help":"Simulates a click on the element.","obsolete":false},{"name":"focus","help":"Focus on input; keystrokes will subsequently go to this element.","obsolete":false},{"name":"webkitGetFileNameArray","help":"Returns an array of all the file names from the input.","obsolete":false},{"name":"webkitSetFileNameArray","help":"Sets the filenames for the files selected on the input.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Input.select","name":"select","help":"Selects the input text in the element, and focuses it so the user can subsequently replace the whole entry.","obsolete":false},{"name":"setCustomValidity","help":"Sets a custom validity message for the element. If this message is not the empty string, then the element is suffering from a custom validity error, and does not validate.","obsolete":false},{"url":"https://developer.mozilla.org/en/DOM/Input.setSelectionRange","name":"setSelectionRange","help":"Selects a range of text in the element (but does not focus it). The optional <code>selectionDirection</code> parameter may be \"forward\" or \"backward\" to establish the direction in which selection was set, or \"none\"if the direction is unknown or not relevant. The default is \"none\". Specifying <code>selectionDirection</code> sets the value of the <code>selectionDirection</code> property.","obsolete":false},{"name":"stepDown","help":"<p>Decrements the <strong>value</strong> by (<strong>step</strong> * <code>n</code>), where <code>n</code> defaults to 1 if not specified. Throws an INVALID_STATE_ERR exception:</p> <ul> <li>if the method is not applicable to for the current <strong>type</strong> value.</li> <li>if the element has no step value.</li> <li>if the <strong>value</strong> cannot be converted to a number.</li> <li>if the resulting value is above the <strong>max</strong> or below the <strong>min</strong>.&nbsp;</li> </ul>","obsolete":false},{"name":"stepUp","help":"<p>Increments the <strong>value</strong> by (<strong>step</strong> * <code>n</code>), where <code>n</code> defaults to 1 if not specified. Throws an INVALID_STATE_ERR exception:</p> <ul> <li>if the method is not applicable to for the current <strong>type</strong> value.</li> <li>if the element has no step value.</li> <li>if the <strong>value</strong> cannot be converted to a number.</li> <li>if the resulting value is above the <strong>max</strong> or below the <strong>min</strong>.</li> </ul>","obsolete":false},{"name":"accept","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/input#attr-accept\">accept</a></code>\n HTML&nbsp;attribute, containing comma-separated list of file types accepted by the server when <strong>type</strong> is <code>file</code>.","obsolete":false},{"name":"accessKey","help":"A single character that switches input focus to the control. \n\n<span title=\"\">Obsolete</span>&nbsp;in \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span>","obsolete":true},{"name":"align","help":"Alignment of the element.\n\n<span title=\"\">Obsolete</span>&nbsp;in \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span>","obsolete":true},{"name":"alt","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/input#attr-alt\">alt</a></code>\n&nbsp;HTML attribute, containing alternative text to use when <strong>type</strong> is <code>image.</code>","obsolete":false},{"name":"autocomplete","help":"Reflects the {{htmlattrxref(\"autocomplete\", \"input)}} HTML attribute, indicating whether the value of the control can be automatically completed by the browser. Ignored if the value of the <strong>type</strong> attribute is <span>hidden</span>, <span>checkbox</span>, <span>radio</span>, <span>file</span>, or a button type (<span>button</span>, <span>submit</span>, <span>reset</span>, <span>image</span>). Possible values are: <ul> <li><span>off</span>: The user must explicitly enter a value into this field for every use, or the document provides its own auto-completion method; the browser does not automatically complete the entry.</li> <li><span>on</span>: The browser can automatically complete the value based on values that the user has entered during previous uses.</li> </ul>","obsolete":false},{"name":"autofocus","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/input#attr-autofocus\">autofocus</a></code>\n HTML&nbsp;attribute, which specifies that a form control should have input focus when the page loads, unless the user overrides it, for example by typing in a different control. Only one form element in a document can have the <strong>autofocus</strong> attribute. It cannot be applied if the <strong>type</strong> attribute is set to <code>hidden</code> (that is, you cannot automatically set focus to a hidden control).","obsolete":false},{"name":"checked","help":"The current state of the element when <strong>type</strong> is <code>checkbox</code> or <code>radio</code>.","obsolete":false},{"name":"defaultChecked","help":"The default state of a radio button or checkbox as originally specified in HTML that created this object.","obsolete":false},{"name":"defaultValue","help":"The default value as originally specified in HTML that created this object.","obsolete":false},{"name":"disabled","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/input#attr-disabled\">disabled</a></code>\n HTML attribute, indicating that the control is not available for interaction.","obsolete":false},{"name":"files","help":"A list of selected files.","obsolete":false},{"name":"form","help":"<p>The containing form element, if this element is in a form. If this element is not contained in a form element:</p> <ul> <li>\n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span> this can be the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/form#attr-id\">id</a></code>\n attribute of any <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/form\">&lt;form&gt;</a></code>\n element in the same document. Even if the attribute is set on <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/input\">&lt;input&gt;</a></code>\n, this property will be <code>null</code>, if it isn't the id of a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/form\">&lt;form&gt;</a></code>\n element.</li> <li>\n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML\">HTML 4</a></span> this must be <code>null</code>.</li> </ul>","obsolete":false},{"name":"formAction","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/input#attr-formaction\">formaction</a></code>\n HTML attribute, containing the URI&nbsp;of a program that processes information submitted by the element. If specified, this attribute overrides the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/form#attr-action\">action</a></code>\n attribute of the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/form\">&lt;form&gt;</a></code>\n element that owns this element.","obsolete":false},{"name":"formEncType","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/input#attr-formenctype\">formenctype</a></code>\n HTML&nbsp;attribute, containing the type of content that is used to submit the form to the server. If specified, this attribute overrides the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/form#attr-enctype\">enctype</a></code>\n attribute of the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/form\">&lt;form&gt;</a></code>\n element that owns this element.","obsolete":false},{"name":"formMethod","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/input#attr-formmethod\">formmethod</a></code>\n&nbsp;HTML&nbsp;attribute, containing the HTTP&nbsp;method that the browser uses to submit the form. If specified, this attribute overrides the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/form#attr-method\">method</a></code>\n attribute of the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/form\">&lt;form&gt;</a></code>\n element that owns this element.","obsolete":false},{"name":"formNoValidate","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/input#attr-formnovalidate\">formnovalidate</a></code>\n&nbsp;HTML&nbsp;attribute, indicating that the form is not to be validated when it is submitted. If specified, this attribute overrides the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/form#attr-novalidate\">novalidate</a></code>\n attribute of the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/form\">&lt;form&gt;</a></code>\n element that owns this element.","obsolete":false},{"name":"formTarget","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/input#attr-formtarget\">formtarget</a></code>\n HTML&nbsp;attribute, containing a name or keyword indicating where to display the response that is received after submitting the form. If specified, this attribute overrides the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/form#attr-target\">target</a></code>\n attribute of the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/form\">&lt;form&gt;</a></code>\n element that owns this element.","obsolete":false},{"name":"height","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/input#attr-height\">height</a></code>\n HTML attribute, which defines the height of the image displayed for the button, if the value of <strong>type</strong> is <span>image</span>.","obsolete":false},{"name":"indeterminate","help":"Indicates that a checkbox is neither on nor off.","obsolete":false},{"name":"labels","help":"A list of <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/label\">&lt;label&gt;</a></code>\n elements that are labels for this element.","obsolete":false},{"name":"list","help":"Identifies a list of pre-defined options to suggest to the user. The value must be the <strong>id</strong> of a <code><a class=\"new\" href=\"https://developer.mozilla.org/en/HTML/Element/datalist\" rel=\"internal\">&lt;datalist&gt;</a></code> element in the same document. The browser displays only options that are valid values for this input element. This attribute is ignored when the <strong>type</strong> attribute's value is <span>hidden</span>, <span>checkbox</span>, <span>radio</span>, <span>file</span>, or a button type.","obsolete":false},{"name":"max","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/input#attr-max\">max</a></code>\n HTML&nbsp;attribute, containing the maximum (numeric or date-time) value for this item, which must not be less than its minimum (<strong>min</strong> attribute) value.","obsolete":false},{"name":"maxLength","help":"<p>Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/input#attr-maxlength\">maxlength</a></code>\n&nbsp;HTML attribute, containing the maximum length of text (in Unicode code points) that the value can be changed to. The constraint is evaluated only when the value is changed</p> <div class=\"note\"><strong>Note:</strong> If you set <code>maxlength</code> to a negative value programmatically, an exception will be thrown.</div>","obsolete":false},{"name":"min","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/input#attr-min\">min</a></code>\n HTML&nbsp;attribute, containing the minimum (numeric or date-time) value for this item, which must not be greater than its maximum (<strong>max</strong> attribute) value.","obsolete":false},{"name":"multiple","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/input#attr-multiple\">multiple</a></code>\n HTML&nbsp;attribute, indicating whether more than one value is possible (e.g., multiple files).","obsolete":false},{"name":"name","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/input#attr-name\">name</a></code>\n HTML&nbsp;attribute, containing a name that identifies the element when submitting the form.","obsolete":false},{"name":"pattern","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/input#attr-pattern\">pattern</a></code>\n HTML&nbsp;attribute, containing a regular expression that the control's value is checked against. The pattern must match the entire value, not just some subset. Use the <strong>title</strong> attribute to describe the pattern to help the user. This attribute applies when the value of the <strong>type</strong> attribute is <span>text</span>, <span>search</span>, <span>tel</span>, <span>url</span> or <span>email</span>; otherwise it is ignored.","obsolete":false},{"name":"placeholder","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/input#attr-placeholder\">placeholder</a></code>\n HTML&nbsp;attribute, containing a hint to the user of what can be entered in the control. The placeholder text must not contain carriage returns or line-feeds. This attribute applies when the value of the <strong>type</strong> attribute is <span>text</span>, <span>search</span>, <span>tel</span>, <span>url</span> or <span>email</span>; otherwise it is ignored.","obsolete":false},{"name":"readOnly","help":"<p>Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/input#attr-readonly\">readonly</a></code>\n HTML&nbsp;attribute, indicating that the user cannot modify the value of the control.</p> <p><span><a href=\"https://developer.mozilla.org/en/HTML/HTML5\" rel=\"custom nofollow\">HTML 5</a></span> This is ignored if the value of the <strong>type</strong> attribute is <span>hidden</span>, <span>range</span>, <span>color</span>, <span>checkbox</span>, <span>radio</span>, <span>file</span>, or a button type.</p>","obsolete":false},{"name":"required","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/input#attr-required\">required</a></code>\n HTML&nbsp;attribute, indicating that the user must fill in a value before submitting a form.","obsolete":false},{"name":"selectionDirection","help":"The direction in which selection occurred. This is \"forward\" if selection was performed in the start-to-end direction of the current locale, or \"backward\" for the opposite direction. This can also be \"none\"&nbsp;if the direction is unknown.\"","obsolete":false},{"name":"selectionEnd","help":"The index of the end of selected text.","obsolete":false},{"name":"selectionStart","help":"The index of the beginning of selected text.","obsolete":false},{"name":"size","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/input#attr-size\">size</a></code>\n HTML&nbsp;attribute, containing size of the control. This value is in pixels unless the value of <strong>type</strong> is <span>text</span> or <span>password</span>, in which case, it is an integer number of characters. \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span> Applies only when <strong>type</strong> is set to <span>text</span>, <span>search</span>, <span>tel</span>, <span>url</span>, <span>email</span>, or <span>password</span>; otherwise it is ignored.","obsolete":false},{"name":"src","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/input#attr-src\">src</a></code>\n HTML&nbsp;attribute, which specifies a URI for the location of an image to display on the graphical submit button, if the value of <strong>type</strong> is <span>image</span>; otherwise it is ignored.","obsolete":false},{"name":"step","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/input#attr-step\">step</a></code>\n HTML&nbsp;attribute, which works with<strong> min</strong> and <strong>max</strong> to limit the increments at which a numeric or date-time value can be set. It can be the string <span>any</span> or a positive floating point number. If this is not set to <span>any</span>, the control accepts only values at multiples of the step value greater than the minimum.","obsolete":false},{"name":"tabIndex","help":"The position of the element in the tabbing navigation order for the current document. \n\n<span title=\"\">Obsolete</span> in \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span>","obsolete":true},{"name":"type","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/input#attr-type\">type</a></code>\n HTML&nbsp;attribute, indicating the type of control to display. See \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/input#attr-type\">type</a></code>\n attribute of <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/input\">&lt;input&gt;</a></code>\n for possible values.","obsolete":false},{"name":"useMap","help":"A client-side image map. \n\n<span title=\"\">Obsolete</span> in \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span>","obsolete":true},{"name":"validationMessage","help":"A localized message that describes the validation constraints that the control does not satisfy (if any). This is the empty string if the control is not a candidate for constraint validation (<strong>willValidate</strong> is false), or it satisfies its constraints.","obsolete":false},{"name":"validity","help":"The validity states that this element is in.&nbsp;","obsolete":false},{"name":"value","help":"Current value in the control.","obsolete":false},{"name":"valueAsDate","help":"The value of the element, interpreted as a date, or <code>null</code> if conversion is not possible.","obsolete":false},{"name":"valueAsNumber","help":"<p>The value of the element, interpreted as one of the following in order:</p> <ol> <li>a time value</li> <li>a number</li> <li><code>null</code> if conversion is not possible</li> </ol>","obsolete":false},{"name":"width","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/input#attr-width\">width</a></code>\n HTML&nbsp;attribute, which defines the width of the image displayed for the button, if the value of <strong>type</strong> is <span>image</span>.","obsolete":false},{"name":"willValidate","help":"Indicates whether the element is a candidate for constraint validation. It is false if any conditions bar it from constraint validation.","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/DOM/HTMLInputElement"},"HTMLButtonElement":{"title":"HTMLButtonElement","summary":"DOM&nbsp;<code>Button </code>objects expose the <a class=\" external\" title=\"http://www.w3.org/TR/html5/the-button-element.html#the-button-element\" rel=\"external\" href=\"http://www.w3.org/TR/html5/the-button-element.html#the-button-element\" target=\"_blank\">HTMLButtonElement</a> \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span>&nbsp;(or <a class=\" external\" title=\"http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-34812697\" rel=\"external\" href=\"http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-34812697\" target=\"_blank\">HTMLButtonElement</a> \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML\">HTML 4</a></span>) interface, which provides properties and methods (beyond the <a href=\"https://developer.mozilla.org/en/DOM/element\" rel=\"internal\">element</a> object interface they also have available to them by inheritance) for manipulating the layout and presentation of button elements.","members":[{"name":"checkValidity","help":"Not supported for button elements.","obsolete":false},{"name":"setCustomValidity","help":"Not supported for button elements.","obsolete":false},{"name":"accessKey","help":"A single-character keyboard key to give access to the button. In \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span> this attribute is inherited from <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/HTMLElement\">HTMLElement</a></code>","obsolete":false},{"name":"autofocus","help":"The control should have input focus when the page loads, unless the user overrides it, for example by typing in a different control. Only one form-associated element in a document can have this attribute specified.","obsolete":false},{"name":"disabled","help":"The control is disabled, meaning that it does not accept any clicks.","obsolete":false},{"name":"form","help":"<p>The form that this button is associated with. If the button is a descendant of a form element, then this attribute is the ID of that form element.</p> <p>If the button is not a descendant of a form element, then:</p> <ul> <li>\n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span> The attribute can be the ID of any form element in the same document.</li> <li>\n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML\">HTML 4</a></span> The attribute is null.</li> </ul>","obsolete":false},{"name":"formAction","help":"The URI&nbsp;of a program that processes information submitted by the button. If specified, this attribute overrides the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/form#attr-action\">action</a></code>\n attribute of the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/form\">&lt;form&gt;</a></code>\n element that owns this element.","obsolete":false},{"name":"formEncType","help":"The type of content that is used to submit the form to the server. If specified, this attribute overrides the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/form#attr-enctype\">enctype</a></code>\n attribute of the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/form\">&lt;form&gt;</a></code>\n element that owns this element.","obsolete":false},{"name":"formMethod","help":"The HTTP&nbsp;method that the browser uses to submit the form. If specified, this attribute overrides the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/form#attr-method\">method</a></code>\n attribute of the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/form\">&lt;form&gt;</a></code>\n element that owns this element.","obsolete":false},{"name":"formNoValidate","help":"Indicates that the form is not to be validated when it is submitted. If specified, this attribute overrides the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/form#attr-enctype\">enctype</a></code>\n attribute of the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/form\">&lt;form&gt;</a></code>\n element that owns this element.","obsolete":false},{"name":"formTarget","help":"A name or keyword indicating where to display the response that is received after submitting the form. If specified, this attribute overrides the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/form#attr-target\">target</a></code>\n attribute of the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/form\">&lt;form&gt;</a></code>\n element that owns this element.","obsolete":false},{"name":"labels","help":"A list of <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/label\">&lt;label&gt;</a></code>\n elements that are labels for this button.","obsolete":false},{"name":"name","help":"The name of the object when submitted with a form. \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span> If specified, it must not be the empty string.","obsolete":false},{"name":"tabIndex","help":"Number that represents this element's position in the tabbing order. in \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span> this attribute is inherited as a <a title=\"en/HTML/Global attributes#attr-tabindex\" rel=\"internal\" href=\"https://developer.mozilla.org/en/HTML/Global_attributes#attr-tabindex\">global attribute</a>.","obsolete":false},{"name":"type","help":"<p>Indicates the behavior of the button. This is an enumerated attribute with the following possible values:</p> <ul> <li><code>submit</code>:&nbsp;The button submits the form. This is the default value if the attribute is not specified, \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span> or if it is dynamically changed to an empty or invalid value.</li> <li><code>reset</code>:&nbsp;The button resets the form.</li> <li><code>button</code>:&nbsp;The button does nothing.</li> </ul>","obsolete":false},{"name":"validationMessage","help":"A localized message that describes the validation constraints that the control does not satisfy (if any). This attribute is the empty string if the control is not a candidate for constraint validation (<strong>willValidate</strong> is false), or it satisfies its constraints.","obsolete":false},{"name":"validity","help":"The validity states that this button is in.","obsolete":false},{"name":"value","help":"The current form control value of the button.&nbsp;","obsolete":false},{"name":"willValidate","help":"Indicates whether the button is a candidate for constraint validation. It is false if any conditions bar it from constraint validation.","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/DOM/HTMLButtonElement"},"PageTransitionEvent":{"title":"Interface documentation status","members":[],"srcUrl":"https://developer.mozilla.org/User:trevorh/Interface_documentation_status","skipped":true,"cause":"Suspect title"},"TextTrack":{"title":"track","members":[],"srcUrl":"https://developer.mozilla.org/en/HTML/Element/track","skipped":true,"cause":"Suspect title"},"SVGLangSpace":{"title":"SVGImageElement","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/SVGImageElement","skipped":true,"cause":"Suspect title"},"SVGTitleElement":{"title":"SVGTitleElement","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> </tbody>\n</table>\n</div>\n<div id=\"compat-mobile\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> </tbody>\n</table>\n</div>","summary":"The <code>SVGTitleElement</code> interface corresponds to the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/title\">&lt;title&gt;</a></code>\n element.","members":[],"srcUrl":"https://developer.mozilla.org/en/Document_Object_Model_(DOM)/SVGTitleElement"},"SVGFECompositeElement":{"title":"feComposite","seeAlso":"<li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/filter\">&lt;filter&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/animate\">&lt;animate&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/set\">&lt;set&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feBlend\">&lt;feBlend&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feColorMatrix\">&lt;feColorMatrix&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feComponentTransfer\">&lt;feComponentTransfer&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feConvolveMatrix\">&lt;feConvolveMatrix&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feDiffuseLighting\">&lt;feDiffuseLighting&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feDisplacementMap\">&lt;feDisplacementMap&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feFlood\">&lt;feFlood&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feGaussianBlur\">&lt;feGaussianBlur&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feImage\">&lt;feImage&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feMerge\">&lt;feMerge&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feMorphology\">&lt;feMorphology&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feOffset\">&lt;feOffset&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feSpecularLighting\">&lt;feSpecularLighting&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feTile\">&lt;feTile&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feTurbulence\">&lt;feTurbulence&gt;</a></code>\n</li> <li><a title=\"en/SVG/Tutorial/Filter_effects\" rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Tutorial/Filter_effects\">SVG tutorial: Filter effects</a></li>","summary":"<p>Two input images are joined by means of an \n<code><a rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Attribute/operator\" class=\"new\">operator</a></code> applied to each input pixel together with an arithmetic operation</p>\n<pre>result = k1*in1*in2 + k2*in1 + k3*in2 + k4</pre>","members":[{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/in2","name":"in2","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/k1","name":"k1","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/operator","name":"operator","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/class","name":"class","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/k2","name":"k2","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/in","name":"in","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/k3","name":"k3","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/k4","name":"k4","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/style","name":"style","help":"Specific attributes"}],"srcUrl":"https://developer.mozilla.org/en/SVG/Element/feComposite"},"ElementTraversal":{"title":"element","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/element","skipped":true,"cause":"Suspect title"},"SVGAnimatedEnumeration":{"title":"SVGAnimatedEnumeration","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody>\n</table>\n</div>\n<div id=\"compat-mobile\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody>\n</table>\n</div>","summary":"The <code>SVGAnimatedEnumeration</code> interface is used for attributes whose value must be a constant from a particular enumeration and which can be animated.","members":[{"name":"baseVal","help":"The base value of the given attribute before applying any animations.","obsolete":false},{"name":"animVal","help":"If the given attribute or property is being animated, contains the current animated value of the attribute or property. If the given attribute or property is not currently being animated, contains the same value as <code>baseVal</code>.","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/DOM/SVGAnimatedEnumeration"},"CustomEvent":{"title":"CustomEvent","summary":"The DOM <code>CustomEvent</code> are events initialized by an application for any purpose. It's represented by the <code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/XPCOM_Interface_Reference/nsIDOMCustomEvent&amp;ident=nsIDOMCustomEvent\" class=\"new\">nsIDOMCustomEvent</a></code>\n&nbsp;interface, which extends the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsIDOMEvent\">nsIDOMEvent</a></code>\n interface.","members":[{"name":"initCustomEvent","help":"<p>Initializes the event in a manner analogous to the similarly-named method in the DOM Events interfaces.</p>\n\n<div id=\"section_5\"><span id=\"Parameters\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>type</code></dt> <dd>The name of the event.</dd> <dt><code>canBubble</code></dt> <dd>A boolean indicating whether the event bubbles up through the DOM or not.</dd> <dt><code>cancelable</code></dt> <dd>A boolean indicating whether the event is cancelable.</dd> <dt><code>detail</code></dt> <dd>The data passed when initializing the event.</dd>\n</dl>\n</div>","idl":"<pre class=\"eval\">void initCustomEvent(\n  in DOMString type,\n  in boolean canBubble,\n  in boolean cancelable,\n  in any detail\n);\n</pre>","obsolete":false},{"name":"detail","help":"The data passed when initializing the event.","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/DOM/CustomEvent","specification":"<a rel=\"custom\" href=\"http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html#interface-CustomEvent\">DOM Level 3 Events : CustomEvent</a><span title=\"Working Draft\">WD</span>"},"FileReader":{"title":"FileReader","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Firefox (Gecko)</th> <th>Chrome</th> <th>Internet Explorer*</th> <th>Opera*</th> <th>Safari</th> </tr> <tr> <td>Basic support</td> <td>3.6 (1.9.2)\n</td> <td>7</td> <td>10</td> <td><span title=\"Not supported.\">--</span></td> <td>\n<em><a rel=\"custom\" href=\"http://nightly.webkit.org/\">Nightly build</a></em></td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Firefox Mobile (Gecko)</th> <th>Android</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>\n<p>*IE9 has a <a class=\"external\" title=\"http://html5labs.interoperabilitybridges.com/prototypes/fileapi/fileapi/info\" rel=\"external\" href=\"http://html5labs.interoperabilitybridges.com/prototypes/fileapi/fileapi/info\" target=\"_blank\">File API Lab</a>. Opera has <a class=\"external\" title=\"http://my.opera.com/desktopteam/blog/2011/04/05/stability-gmail-socks\" rel=\"external\" href=\"http://my.opera.com/desktopteam/blog/2011/04/05/stability-gmail-socks\" target=\"_blank\">partial support</a> in 11.10.</p>","srcUrl":"https://developer.mozilla.org/en/DOM/FileReader","seeAlso":"<li><a title=\"en/Using files from web applications\" rel=\"internal\" href=\"https://developer.mozilla.org/en/Using_files_from_web_applications\">Using files from web applications</a></li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/File\">File</a></code>\n</li> <li>\n<a rel=\"custom\" href=\"http://www.w3.org/TR/FileAPI/#FileReader-interface\">Specification: File API: FileReader</a><span title=\"Working Draft\">WD</span></li>","summary":"<p>The <code>FileReader</code> object lets web applications asynchronously read the contents of files (or raw data buffers) stored on the user's computer, using <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/File\">File</a></code>\n or <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Blob\">Blob</a></code>\n objects to specify the file or data to read. File objects may be obtained in one of two ways: from a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/FileList\">FileList</a></code>\n object returned as a result of a user selecting files using the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/input\">&lt;input&gt;</a></code>\n element, or from a drag and drop operation's <a title=\"En/DragDrop/DataTransfer\" rel=\"internal\" href=\"https://developer.mozilla.org/En/DragDrop/DataTransfer\"><code>DataTransfer</code></a> object.</p>\n<p>To create a <code>FileReader</code>, simply do the following:</p>\n<pre>var reader = new FileReader();\n</pre>\n<p>See <a title=\"en/Using files from web applications\" rel=\"internal\" href=\"https://developer.mozilla.org/en/Using_files_from_web_applications\">Using files from web applications</a> for details and examples.</p>","members":[{"name":"readAsDataURL","help":"<p>Starts reading the contents of the specified <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Blob\">Blob</a></code>\n or <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/File\">File</a></code>\n. When the read operation is finished, the <code>readyState</code> will become <code>DONE</code>, and the <code>onloadend</code> callback, if any, will be called. At that time, the <code>result</code> attribute contains a <code>data:</code> URL representing the file's data.</p>\n\n<p>This method is useful, for example, to get a preview of an image before uploading it:</p>\n\n          <pre name=\"code\" class=\"xml\">&lt;!doctype html&gt;\n&lt;html&gt;\n&lt;head&gt;\n&lt;meta content=\"text/html; charset=UTF-8\" http-equiv=\"Content-Type\" /&gt;\n&lt;title&gt;Image preview example&lt;/title&gt;\n&lt;script type=\"text/javascript\"&gt;\noFReader = new FileReader(), rFilter = /^(image\\/bmp|image\\/cis-cod|image\\/gif|image\\/ief|image\\/jpeg|image\\/jpeg|image\\/jpeg|image\\/pipeg|image\\/png|image\\/svg\\+xml|image\\/tiff|image\\/x-cmu-raster|image\\/x-cmx|image\\/x-icon|image\\/x-portable-anymap|image\\/x-portable-bitmap|image\\/x-portable-graymap|image\\/x-portable-pixmap|image\\/x-rgb|image\\/x-xbitmap|image\\/x-xpixmap|image\\/x-xwindowdump)$/i;\n\noFReader.onload = function (oFREvent) {\n  document.getElementById(\"uploadPreview\").src = oFREvent.target.result;\n};\n\nfunction loadImageFile() {\n  if (document.getElementById(\"uploadImage\").files.length === 0) { return; }\n  var oFile = document.getElementById(\"uploadImage\").files[0];\n  if (!rFilter.test(oFile.type)) { alert(\"You must select a valid image file!\"); return; }\n  oFReader.readAsDataURL(oFile);\n}\n&lt;/script&gt;\n&lt;/head&gt;\n\n&lt;body onload=\"loadImageFile();\"&gt;\n&lt;form name=\"uploadForm\"&gt;\n&lt;table&gt;\n&lt;tbody&gt;\n&lt;tr&gt;\n&lt;td&gt;&lt;img id=\"uploadPreview\" style=\"width: 100px; height: 100px;\" src=\"data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%3F%3E%0A%3Csvg%20width%3D%22153%22%20height%3D%22153%22%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%3E%0A%20%3Cg%3E%0A%20%20%3Ctitle%3ENo%20image%3C/title%3E%0A%20%20%3Crect%20id%3D%22externRect%22%20height%3D%22150%22%20width%3D%22150%22%20y%3D%221.5%22%20x%3D%221.500024%22%20stroke-width%3D%223%22%20stroke%3D%22%23666666%22%20fill%3D%22%23e1e1e1%22/%3E%0A%20%20%3Ctext%20transform%3D%22matrix%286.66667%2C%200%2C%200%2C%206.66667%2C%20-960.5%2C%20-1099.33%29%22%20xml%3Aspace%3D%22preserve%22%20text-anchor%3D%22middle%22%20font-family%3D%22Fantasy%22%20font-size%3D%2214%22%20id%3D%22questionMark%22%20y%3D%22181.249569%22%20x%3D%22155.549819%22%20stroke-width%3D%220%22%20stroke%3D%22%23666666%22%20fill%3D%22%23000000%22%3E%3F%3C/text%3E%0A%20%3C/g%3E%0A%3C/svg%3E\" alt=\"Image preview\" /&gt;&lt;/td&gt;\n&lt;td&gt;&lt;input id=\"uploadImage\" type=\"file\" name=\"myPhoto\" onchange=\"loadImageFile();\" /&gt;&lt;/td&gt;\n&lt;/tr&gt;\n&lt;/tbody&gt;\n&lt;/table&gt;\n&lt;p&gt;&lt;input type=\"submit\" value=\"Send\" /&gt;&lt;/p&gt;\n&lt;/form&gt;\n&lt;/body&gt;\n&lt;/html&gt;</pre>\n        \n<div id=\"section_13\"><span id=\"Parameters_4\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>file</code></dt> <dd>The DOM <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Blob\">Blob</a></code>\n or <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/File\">File</a></code>\n from which to read.</dd>\n</dl>\n</div>","idl":"<pre class=\"eval\">void readAsDataURL(\n  in Blob file\n);\n</pre>","obsolete":false},{"name":"readAsText","help":"<p>Starts reading the specified blob's contents. When the read operation is finished, the <code>readyState</code> will become <code>DONE</code>, and the <code>onloadend</code> callback, if any, will be called. At that time, the <code>result</code> attribute contains the contents of the file as a text string.</p>\n\n<div id=\"section_15\"><span id=\"Parameters_5\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>blob</code></dt> <dd>The DOM <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Blob\">Blob</a></code>\n or <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/File\">File</a></code>\n from which to read.</dd> <dt><code>encoding</code> \n<span title=\"\">Optional</span>\n</dt> <dd>A string indicating the encoding to use for the returned data. By default, UTF-8 is assumed if this parameter is not specified.</dd>\n</dl>\n</div>","idl":"<pre class=\"eval\">void readAsText(\n  in Blob blob,\n  in DOMString encoding \n<span style=\"border: 1px solid #9ED2A4; background-color: #C0FFC7; font-size: x-small; white-space: nowrap; padding: 2px;\" title=\"\">Optional</span>\n\n);\n</pre>","obsolete":false},{"name":"abort","help":"<p>Aborts the read operation. Upon return, the <code>readyState</code> will be <code>DONE</code>.</p>\n\n<div id=\"section_7\"><span id=\"Parameters\"></span><h6 class=\"editable\">Parameters</h6>\n<p>None.</p>\n</div><div id=\"section_8\"><span id=\"Exceptions_thrown\"></span><h6 class=\"editable\">Exceptions thrown</h6>\n<dl> <dt><code>DOM_FILE_ABORT_ERR</code></dt> <dd><code>abort()</code> was called while no read operation was in progress (that is, the state wasn't <code>LOADING</code>). <div class=\"note\"><strong>Note:</strong>&nbsp;This exception was not thrown by Gecko until Gecko 6.0 (Firefox 6.0 / Thunderbird 6.0 / SeaMonkey 2.3)\n.</div>\n</dd>\n</dl>\n<p>\n</p><div>\n<span id=\"readAsArrayBuffer()\"></span></div></div>","idl":"<pre class=\"eval\">void abort();\n</pre>","obsolete":false},{"name":"readAsBinaryString","help":"<p>Starts reading the contents of the specified <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Blob\">Blob</a></code>\n, which may be a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/File\">File</a></code>\n. When the read operation is finished, the <code>readyState</code> will become <code>DONE</code>, and the <code>onloadend</code> callback, if any, will be called. At that time, the <code>result</code> attribute contains the raw binary data from the file.</p>\n\n<div id=\"section_11\"><span id=\"Parameters_3\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>blob</code></dt> <dd>The DOM <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Blob\">Blob</a></code>\n or <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/File\">File</a></code>\n from which to read.</dd>\n</dl>\n</div>","idl":"<pre class=\"eval\">void readAsBinaryString(\n  in Blob blob\n);\n</pre>","obsolete":false},{"name":"readAsArrayBuffer","help":"<div id=\"section_8\"><p>Starts reading the contents of the specified <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Blob\">Blob</a></code>\n or <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/File\">File</a></code>\n. When the read operation is finished, the <code>readyState</code> will become <code>DONE</code>, and the <code>onloadend</code> callback, if any, will be called. At that time, the <code>result</code> attribute contains an <code><a title=\"/en/JavaScript_typed_arrays/ArrayBuffer\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/ArrayBuffer\">ArrayBuffer</a></code> representing the file's data.</p>\n\n</div><div id=\"section_9\"><span id=\"Parameters_2\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>blob</code></dt> <dd>The DOM <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/Blob\">Blob</a></code>\n or <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/File\">File</a></code>\n to read into the <code><a title=\"/en/JavaScript_typed_arrays/ArrayBuffer\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/ArrayBuffer\">ArrayBuffer</a></code>.</dd>\n</dl>\n</div>","idl":"<pre class=\"eval\">void readAsArrayBuffer(\n  in Blob blob\n);\n</pre>","obsolete":false},{"name":"EMPTY","help":"No data has been loaded yet.","obsolete":false},{"name":"LOADING","help":"Data is currently being loaded.","obsolete":false},{"name":"DONE","help":"The entire read request has been completed.","obsolete":false},{"name":"error","help":"The error that occurred while reading the file. <strong>Read only.</strong>","obsolete":false},{"name":"readyState","help":"Indicates the state of the <code>FileReader</code>. This will be one of the <a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/FileReader#State_constants\">State constants</a>. <strong>Read only.</strong>","obsolete":false},{"name":"result","help":"The file's contents. This property is only valid after the read operation is complete, and the format of the data depends on which of the methods was used to initiate the read operation. <strong>Read only.</strong>","obsolete":false},{"name":"onload","help":"Called when the read operation is successfully completed.","obsolete":false},{"name":"onabort","help":"Called when the read operation is aborted.","obsolete":false},{"name":"onloadend","help":"Called when the read is completed, whether successful or not. This is called after either <code>onload</code> or <code>onerror</code>.","obsolete":false},{"name":"onprogress","help":"Called periodically while the data is being read.","obsolete":false},{"name":"onloadstart","help":"Called when reading the data is about to begin.","obsolete":false},{"name":"onerror","help":"Called when an error occurs.","obsolete":false}]},"DataView":{"title":"DataView","srcUrl":"https://developer.mozilla.org/en/JavaScript_typed_arrays/DataView","seeAlso":"<li><a class=\"external\" rel=\"external\" href=\"http://www.khronos.org/registry/typedarray/specs/latest/#8\" title=\"http://www.khronos.org/registry/typedarray/specs/latest/#8\" target=\"_blank\">DataView Specification</a></li> <li><a class=\"external\" rel=\"external\" href=\"http://www.khronos.org/registry/typedarray/specs/latest/\" title=\"http://www.khronos.org/registry/typedarray/specs/latest/\" target=\"_blank\">Typed Array Specification</a></li> <li><a title=\"en/JavaScript typed arrays\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays\">JavaScript typed arrays</a></li> <li><a class=\"link-https\" rel=\"external\" href=\"https://github.com/vjeux/jDataView\" title=\"https://github.com/vjeux/jDataView\" target=\"_blank\">jDataView</a>: a Javascript library that provides the DataView API to all browsers.</li>","summary":"<div><strong>DRAFT</strong>\n<div>This page is not complete.</div>\n</div>\n\n<p></p>\n<div class=\"note\"><strong>Note:</strong> <code>DataView</code> is not yet implemented in Gecko. It is implemented in Chrome 9.</div>\n<p>An <code>ArrayBuffer</code> is a useful object for representing an arbitrary chunk of data. In many cases, such data will be read from disk or from the network, and will not follow the alignment restrictions that are imposed on the <a title=\"en/JavaScript_typed_arrays/ArrayBufferView\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/ArrayBufferView\">Typed Array Views</a> described earlier. In addition, the data will often be heterogeneous in nature and have a defined byte order.</p>\n<p>The <code>DataView</code> view provides a low-level interface for reading such data from and writing it to an <code><a title=\"en/JavaScript_typed_arrays/ArrayBuffer\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/ArrayBuffer\">ArrayBuffer</a></code>.</p>","constructor":"DataView DataView(<a title=\"en/JavaScript_typed_arrays/ArrayBuffer\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/ArrayBuffer\">ArrayBuffer</a> buffer, optional unsigned long byteOffset, optional unsigned long byteLength);<p>Returns a new <code>DataView</code> object using the passed <a title=\"en/JavaScript_typed_arrays/ArrayBuffer\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/ArrayBuffer\">ArrayBuffer</a> for its storage.</p>\n<pre>DataView DataView(\n&nbsp; ArrayBuffer buffer,\n&nbsp; optional unsigned long byteOffset,\n&nbsp; optional unsigned long byteLength\n);\n</pre>\n<div id=\"section_6\"><span id=\"Parameters\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>buffer</code></dt> <dd>An existing <a title=\"en/JavaScript_typed_arrays/ArrayBuffer\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/ArrayBuffer\"><code>ArrayBuffer</code></a> to use as the storage for the new <code>DataView</code> object.</dd> <dt><code>byteOffset</code> \n<span title=\"\">Optional</span>\n</dt> <dd>The offset, in bytes, to the first byte in the specified buffer for the new view to reference. If not specified, the view of the buffer will start with the first byte.</dd> <dt><code>byteLength</code> \n<span title=\"\">Optional</span>\n</dt> <dd>The number of elements in the byte array. If unspecified, length of the view will match the buffer's length.</dd>\n</dl>\n</div><div id=\"section_7\"><span id=\"Return_value\"></span><h6 class=\"editable\">Return value</h6>\n<p>A new <code>DataView</code> object representing the specified data buffer.</p>\n</div><div id=\"section_8\"><span id=\"Exceptions_thrown\"></span><h6 class=\"editable\">Exceptions thrown</h6>\n<dl> <dt><code>INDEX_SIZE_ERR</code></dt> <dd>The <code>byteOffset</code> and <code>byteLength</code> result in the specified view extending past the end of the buffer.</dd>\n</dl>\n</div>","members":[{"name":"getInt8","help":"<p>Gets a signed 8-bit integer at the specified byte offset from the start of the view.</p>\n\n<div id=\"section_11\"><span id=\"Parameters_2\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>offset</code></dt> <dd>The offset, in byte, from the start of the view where to read the data.</dd>\n</dl>\n</div><div id=\"section_12\"><span id=\"Exceptions_thrown_2\"></span><h6 class=\"editable\">Exceptions thrown</h6>\n<dl> <dt><code>INDEX_SIZE_ERR</code></dt> <dd>The <code>byteOffset</code> is set such as it would read beyond the end of the view</dd>\n</dl>\n</div>","idl":"<pre>byte getInt8(\n  unsigned long byteOffset\n);\n</pre>","obsolete":false},{"name":"getUint8","help":"<p>Gets an unsigned 8-bit integer at the specified byte offset from the start of the view.</p>\n\n<div id=\"section_14\"><span id=\"Parameters_3\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>offset</code></dt> <dd>The offset, in byte, from the start of the view where to read the data.</dd>\n</dl>\n<dl> <dt><code>INDEX_SIZE_ERR</code></dt> <dd>The <code>byteOffset</code> is set such as it would read beyond the end of the view</dd>\n</dl>\n</div>","idl":"<pre>byte getUint8(\n  unsigned long byteOffset\n);\n</pre>","obsolete":false}]},"SVGLocatable":{"title":"SVGSVGElement","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/SVGSVGElement","skipped":true,"cause":"Suspect title"},"SVGHKernElement":{"title":"SVGHKernElement","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>","srcUrl":"https://developer.mozilla.org/en/DOM/SVGHKernElement","seeAlso":"<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/hkern\">&lt;hkern&gt;</a></code>\n SVG Element","summary":"<p>The <code>SVGHKernElement</code> interface corresponds to the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/hkern\">&lt;hkern&gt;</a></code>\n elements.</p>\n<p>Object-oriented access to the attributes of the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/hkern\">&lt;hkern&gt;</a></code>\n element via the SVG DOM is not possible.</p>","members":[]},"SVGNumber":{"title":"SVGNumber","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody>\n</table>\n</div>\n<div id=\"compat-mobile\">\n<table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody>\n</table>\n</div>","summary":"<p>The <code>SVGNumber</code> interface correspond to the <a title=\"https://developer.mozilla.org/en/SVG/Content_type#Number\" rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Content_type#Number\">&lt;number&gt;</a> basic data type.</p>\n<p>An <code>SVGNumber</code> object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown.</p>","members":[{"name":"value","help":"<p>The value of the given attribute.</p> <p><strong>Exceptions on setting:</strong> a <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/DOM/DOMException\">DOMException</a></code>\n with code <code>NO_MODIFICATION_ALLOWED_ERR</code> is Raised on an attempt to change the value of a read only attribute.</p>","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/DOM/SVGNumber"},"DirectoryEntrySync":{"title":"DirectoryEntrySync","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td>13\n<span title=\"prefix\">webkit</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE&nbsp;Phone</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> </tr> </tbody> </table>\n</div>","summary":"<div><strong>DRAFT</strong> <div>This page is not complete.</div>\n</div>\n<p>The <code>DirectoryEntry</code> interface of the <a title=\"en/DOM/File_API/File_System_API\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/File_API/File_System_API\">FileSystem API</a> represents a directory in a file system.</p>","members":[{"name":"getFile","help":"<p>Creates or looks up a file.</p>\n<pre>void moveTo (\n  <em>(in DOMString path, optional Flags options, optional EntryCallback successCallback, optional ErrorCallback errorCallback);</em>\n);</pre>\n<div id=\"section_8\"><span id=\"Parameter\"></span><h5 class=\"editable\">Parameter</h5>\n<dl> <dt>path</dt> <dd>Either an absolute path or a relative path from this DirectoryEntry to the file to be looked up or created. It is an error to attempt to create a file whose immediate parent does not yet exist.</dd> <dt>options</dt>\n</dl>\n<ul> <li>If create and exclusive are both true, and the path already exists, getFile must fail.</li> <li>If create is true, the path doesn't exist, and no other error occurs, getFile must create it as a zero-length file and return a corresponding FileEntry.</li> <li>If create is not true and the path doesn't exist, getFile must fail.</li> <li>If create is not true and the path exists, but is a directory, getFile must fail.</li> <li>Otherwise, if no other error occurs, getFile must return a FileEntry corresponding to path.</li>\n</ul>\n<dl> <dt>successCallback</dt> <dd>A callback that is called to return the file selected or created.</dd> <dt>errorCallback</dt> <dd>A callback that is called when errors happen.</dd>\n</dl>\n</div><div id=\"section_9\"><span id=\"Returns_3\"></span><h5 class=\"editable\">Returns</h5>\n<dl> <dt><code>void</code></dt>\n</dl>\n</div>","obsolete":false},{"name":"getDirectory","help":"<p>Creates or looks up a directory.</p>\n<pre>void vopyTo (\n  <em>(in DOMString path, optional Flags options, optional EntryCallback successCallback, optional ErrorCallback errorCallback);</em>\n);</pre>\n<div id=\"section_11\"><span id=\"Parameter_2\"></span><h5 class=\"editable\">Parameter</h5>\n<dl> <dt>path</dt> <dd>Either an absolute path or a relative path from this DirectoryEntry to the file to be looked up or created. It is an error to attempt to create a file whose immediate parent does not yet exist.</dd> <dt>options</dt>\n</dl>\n<ul> <li>If create and exclusive are both true, and the path already exists, getDirectory must fail.</li> <li>If create is true, the path doesn't exist, and no other error occurs, getDirectory must create it as a zero-length file and return a corresponding getDirectory.</li> <li>If create is not true and the path doesn't exist, getDirectory must fail.</li> <li>If create is not true and the path exists, but is a directory, getDirectory must fail.</li> <li>Otherwise, if no other error occurs, getFile must return a getDirectory corresponding to path.</li>\n</ul>\n<dt>successCallback</dt>\n<dd>A callback that is called to return the DirectoryEntry selected or created.</dd>\n<dt>errorCallback</dt>\n<dd>A callback that is called when errors happen.</dd>\n</div><div id=\"section_12\"><span id=\"Returns_4\"></span><h5 class=\"editable\">Returns</h5>\n<dl> <dt><code>void</code></dt>\n</dl>\n</div>","obsolete":false},{"name":"removeRecursively","help":"<p>Deletes a directory and all of its contents, if any. If you are deleting a directory that contains a file that cannot be removed, some of the contents of the directory might be deleted. You cannot delete the root directory of a file system.</p>\n<pre>DOMString toURL (\n  <em>(in </em>VoidCallback successCallback, optional ErrorCallback errorCallback<em>);</em>\n);</pre>\n<div id=\"section_14\"><span id=\"Parameter_3\"></span><h5 class=\"editable\">Parameter</h5>\n<dl> <dt>successCallback</dt> <dd>A callback that is called to return the DirectoryEntry selected or created.</dd> <dt>errorCallback</dt> <dd>A callback that is called when errors happen.</dd>\n</dl>\n</div><div id=\"section_15\"><span id=\"Returns_5\"></span><h5 class=\"editable\">Returns</h5>\n<dl> <dt><code>void</code></dt>\n</dl>\n</div>","obsolete":false},{"name":"createReader","help":"<p>Creates a new DirectoryReader to read entries from this Directory.</p>\n<pre>void getMetada ();</pre>\n<div id=\"section_6\"><span id=\"Returns_2\"></span><h5 class=\"editable\">Returns</h5>\n<dl> <dt><code>DirectoryReader</code></dt>\n</dl>\n</div>","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/DOM/File_API/File_System_API/DirectoryEntrySync"},"HTMLTableRowElement":{"title":"HTMLTableRowElement","summary":"DOM <code>table row</code> objects expose the <code><a class=\"external\" rel=\"external\" href=\"http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-6986576\" title=\"http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-6986576\" target=\"_blank\">HTMLTableRowElement</a></code> interface, which provides special properties and methods (beyond the regular <a title=\"en/DOM/element\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/element\">element</a> object interface they also have available to them by inheritance) for manipulating the layout and presentation of rows in an HTML table.","members":[{"name":"insertCell","help":"","obsolete":false},{"name":"deleteCell","help":"row.insertCell","obsolete":false},{"name":"bgColor","help":"row.cells","obsolete":false},{"name":"align","help":"<a title=\"en/DOM/tableRow.bgColor\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/tableRow.bgColor\" class=\"new \">row.bgColor</a> \n\n<span class=\"deprecatedInlineTemplate\" title=\"\">Deprecated</span>","obsolete":false},{"name":"cells","help":"row.ch","obsolete":false},{"name":"rowIndex","help":"row.sectionRowIndex","obsolete":false},{"name":"sectionRowIndex","help":"row.vAlign","obsolete":false},{"name":"ch","help":"row.chOff","obsolete":false},{"name":"chOff","help":"row.rowIndex","obsolete":false},{"name":"vAlign","help":"","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/DOM/HTMLTableRowElement"},"CanvasPixelArray":{"title":"CanvasPixelArray","summary":"<p>Returned by <a title=\"en/DOM/ImageData\" rel=\"internal\" href=\"https://developer.mozilla.org/en/DOM/ImageData\">ImageData</a>'s <code>data</code> attribute.</p>\n<p>The <code>CanvasPixelArray</code> object indicates the color components of each pixel of an image, first for each of its three RGB&nbsp;values in order (0-255) and then its alpha component (0-255), proceeding from left-to-right, for each row (rows are top to bottom).&nbsp;</p>\n<pre class=\"idl\">  readonly attribute unsigned long <strong>length</strong>\n  <a href=\"http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-canvaspixelarray-get\" title=\"dom-CanvasPixelArray-get\">getter</a> <strong>octet</strong> (in unsigned long index);\n  <a href=\"http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-canvaspixelarray-set\" title=\"dom-CanvasPixelArray-set\">setter</a> <strong>void</strong> (in unsigned long index, in octet value);\n</pre>","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/CanvasPixelArray","specification":"http://www.whatwg.org/specs/web-apps...nvaspixelarray"},"SVGURIReference":{"title":"SVGImageElement","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/SVGImageElement","skipped":true,"cause":"Suspect title"},"SVGFontFaceNameElement":{"title":"SVGFontFaceNameElement","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>","srcUrl":"https://developer.mozilla.org/en/DOM/SVGFontFaceNameElement","seeAlso":"<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/font-face-name\">&lt;font-face-name&gt;</a></code>\n SVG Element","summary":"<p>The <code>SVGFontFaceNameElement</code> interface corresponds to the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/font-face-name\">&lt;font-face-name&gt;</a></code>\n elements.</p>\n<p>Object-oriented access to the attributes of the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/font-face-name\">&lt;font-face-name&gt;</a></code>\n element via the SVG DOM is not possible.</p>","members":[]},"HTMLIsIndexElement":{"title":"HTTP","members":[],"srcUrl":"https://developer.mozilla.org/en/HTTP?action=edit","skipped":true,"cause":"Suspect title"},"Geoposition":{"title":"Using geolocation","members":[],"srcUrl":"https://developer.mozilla.org/en/Using_geolocation","skipped":true,"cause":"Suspect title"},"SVGPathSegLinetoRel":{"title":"SVGPathElement","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/SVGPathElement","skipped":true,"cause":"Suspect title"},"SVGTextContentElement":{"title":"SVGTextPositioningElement","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/SVGTextPositioningElement","skipped":true,"cause":"Suspect title"},"Notation":{"title":"Notation","summary":"<p><span>NOTE:&nbsp;This is not implemented in Mozilla</span></p>\n<p>Represents a DTD notation (read-only). May declare format of an unparsed entity or formally declare the document's processing instruction targets. Inherits methods and properties from <a title=\"En/DOM/Node\" class=\"internal\" rel=\"internal\" href=\"https://developer.mozilla.org/En/DOM/Node\"><code>Node</code></a>. Its <code><a title=\"En/DOM/Node/NodeName\" rel=\"internal\" href=\"https://developer.mozilla.org/En/DOM/Node/NodeName\" class=\"new internal\">nodeName</a></code> is the notation name. Has no parent.</p>","members":[{"obsolete":false,"url":"https://developer.mozilla.org/En/DOM/Notation.systemId","name":"systemId","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/En/DOM/Notation.publicId","name":"publicId","help":""}],"srcUrl":"https://developer.mozilla.org/en/DOM/Notation","specification":"http://www.w3.org/TR/DOM-Level-3-Cor...ml#ID-5431D1B9"},"MutationEvent":{"title":"document.createEvent","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/document.createEvent","skipped":true,"cause":"Suspect title"},"Int8Array":{"title":"Int8Array","srcUrl":"https://developer.mozilla.org/en/JavaScript_typed_arrays/Int8Array","seeAlso":"<li><a class=\"link-https\" title=\"https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/doc/spec/TypedArray-spec.html\" rel=\"external\" href=\"https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/doc/spec/TypedArray-spec.html\" target=\"_blank\">Typed Array Specification</a></li> <li><a title=\"en/JavaScript typed arrays\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays\">JavaScript typed arrays</a></li>","summary":"<p>The <code>Int8Array</code> type represents an array of twos-complement 8-bit signed integers.</p>\n<p>Once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).</p>","constructor":"<div class=\"note\"><strong>Note:</strong> In these methods, <code><em>TypedArray</em></code> represents any of the <a title=\"en/JavaScript typed arrays/ArrayBufferView#Typed array subclasses\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/ArrayBufferView#Typed_array_subclasses\">typed array object types</a>.</div>\n<table class=\"standard-table\"> <tbody> <tr> <td><code>Int8Array <a title=\"en/JavaScript typed arrays/Int8Array#Int8Array()\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/Int8Array#Int8Array%28%29\">Int8Array</a>(unsigned long length);<br> </code></td> </tr> <tr> <td><code>Int8Array <a title=\"en/JavaScript typed arrays/Int8Array#Int8Array()\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/Int8Array#Int8Array%28%29\">Int8Array</a>(<em>TypedArray</em> array);<br> </code></td> </tr> <tr> <td><code>Int8Array <a title=\"en/JavaScript typed arrays/Int8Array#Int8Array()\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/Int8Array#Int8Array%28%29\">Int8Array</a>(sequence&lt;type&gt; array);<br> </code></td> </tr> <tr> <td><code>Int8Array&nbsp;<a title=\"en/JavaScript typed arrays/Int8Array#Int8Array()\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/Int8Array#Int8Array%28%29\">Int8Array</a>(ArrayBuffer buffer, optional unsigned long byteOffset, optional unsigned long length);<br> </code></td> </tr> </tbody>\n</table><p>Returns a new <code>Int8Array</code> object.</p>\n<pre>Int8Array Int8Array(\n&nbsp; unsigned long length\n);\n\nInt8Array Int8Array(\n&nbsp; <em>TypedArray</em> array\n);\n\nInt8Array Int8Array(\n&nbsp; sequence&lt;type&gt; array\n);\n\nInt8Array Int8Array(\n&nbsp; ArrayBuffer buffer,\n&nbsp; optional unsigned long byteOffset,\n&nbsp; optional unsigned long length\n);\n</pre>\n<div id=\"section_7\"><span id=\"Parameters\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>length</code></dt> <dd>The number of elements in the byte array. If unspecified, length of the array view will match the buffer's length.</dd> <dt><code>array</code></dt> <dd>An object of any of the typed array types (such as <code>Int32Array</code>), or a sequence of objects of a particular type, to copy into a new <a title=\"en/JavaScript typed arrays/ArrayBuffer\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/ArrayBuffer\"><code>ArrayBuffer</code></a>. Each value in the source array is converted to an 8-bit integer before being copied into the new array.</dd> <dt><code>buffer</code></dt> <dd>An existing <a title=\"en/JavaScript typed arrays/ArrayBuffer\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/ArrayBuffer\"><code>ArrayBuffer</code></a> to use as the storage for the new <code>Int8Array</code> object.</dd> <dt><code>byteOffset<br> </code></dt> <dd>The offset, in bytes, to the first byte in the specified buffer for the new view to reference. If not specified, the <code>Int8Array</code>'s view of the buffer will start with the first byte.</dd>\n</dl>\n</div><div id=\"section_8\"><span id=\"Return_value\"></span><h6 class=\"editable\">Return value</h6>\n<p>A new <code>Int8Array</code> object representing the specified data buffer.</p>\n</div>","members":[{"name":"subarray","help":"<p>Returns a new <code>Int8Array</code> view on the <a title=\"en/JavaScript typed arrays/ArrayBuffer\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/ArrayBuffer\"><code>ArrayBuffer</code></a> store for this <code>Int8Array</code> object.</p>\n\n<div id=\"section_15\"><span id=\"Parameters_3\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>begin</code></dt> <dd>The offset to the first element in the array to be referenced by the new <code>Int8Array</code> object.</dd> <dt><code>end</code> \n<span title=\"\">Optional</span>\n</dt> <dd>The offset to the last element in the array to be referenced by the new <code>Int8Array</code> object; if not specified, all elements from the one specified by <code>begin</code> to the end of the array are included in the new view.</dd>\n</dl>\n</div><div id=\"section_16\"><span id=\"Notes_2\"></span><h6 class=\"editable\">Notes</h6>\n<p>The range specified by <code>begin</code> and <code>end</code> is clamped to the valid index range for the current array; if the computed length of the new array would be negative, it's clamped to zero. If either <code>begin</code> or <code>end</code> is negative, it refers to an index from the end of the array instead of from the beginning.</p>\n<div class=\"note\"><strong>Note:</strong> Keep in mind that this is creating a new view on the existing buffer; changes to the new object's contents will impact the original object and vice versa.</div>\n</div>","idl":"<pre>Int8Array subarray(\n&nbsp; long begin,\n&nbsp; optional long end\n);\n</pre>","obsolete":false},{"name":"set","help":"<p>Sets multiple values in the typed array, reading input values from a specified array.</p>\n\n<div id=\"section_13\"><span id=\"Parameters_2\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>array</code></dt> <dd>An array from which to copy values. All values from the source array are copied into the target array, unless the length of the source array plus the offset exceeds the length of the target array, in which case an exception is thrown. If the source array is a typed array, the two arrays may share the same underlying <code><a title=\"en/JavaScript typed arrays/ArrayBuffer\" rel=\"internal\" href=\"https://developer.mozilla.org/en/JavaScript_typed_arrays/ArrayBuffer\">ArrayBuffer</a></code>; the browser will intelligently copy the source range of the buffer to the destination range.</dd> <dt>offset \n<span title=\"\">Optional</span>\n</dt> <dd>The offset into the target array at which to begin writing values from the source <code>array</code>. If you omit this value, 0 is assumed (that is, the source <code>array</code> will overwrite values in the target array starting at index 0).</dd>\n</dl>\n</div>","idl":"<pre>void set(\n&nbsp; <em>TypedArray</em> array,\n&nbsp; optional unsigned long offset\n);\n\nvoid set(\n&nbsp; type[] array,\n&nbsp; optional unsigned long offset\n);\n</pre>","obsolete":false},{"name":"BYTES_PER_ELEMENT","help":"The size, in bytes, of each array element.","obsolete":false},{"name":"length","help":"The number of entries in the array; for these 8-bit values, this is the same as the size of the array in bytes. <strong>Read only.</strong>","obsolete":false}]},"IDBVersionChangeRequest":{"title":"IDBVersionChangeRequest","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td>12 \n<span title=\"prefix\">-webkit</span></td> <td>From 4.0 (2.0)\n to 4.0 (2.0)\n</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE&nbsp;Phone</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Not supported.\">--</span></td> <td>6.0 (6.0)\n</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> </tr> </tbody> </table>\n</div>","summary":"<div class=\"warning\"><strong>Warning: </strong> The latest specification does not include this interface anymore as the <code>IDBDatabase.setVersion()</code> method has been removed. However, it is still implemented in not up-to-date browsers. See the compatibility table for version details.<br> The new way to do it is to use the <a title=\"en/IndexedDB/IDBOpenDBRequest\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBOpenDBRequest\"><code>IDBOpenDBRequest</code></a> interface which has now the <code>onblocked</code> handler and the newly needed <code>onupgradeneeded</code> one.</div>\n<p>The <code>IDBVersionChangeRequest</code> interface the <a title=\"en/IndexedDB\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB\">IndexedDB API </a>represents a request to change the version of a database. It is used only by the <a title=\"en/IndexedDB/IDBDatabase#setVersion\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabase#setVersion\"><code>setVersion()</code></a> method of <code><a title=\"en/IndexedDB/IDBDatabase\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBDatabase\">IDBDatabase</a></code>.</p>\n<p>Inherits from:&nbsp;<code><a title=\"en/IndexedDB/IDBRequest\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBRequest\">IDBRequest</a></code></p>","members":[{"url":"","name":"onblocked","help":"The event handler for the blocked event.","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/IndexedDB/IDBVersionChangeRequest"},"SVGPathSegCurvetoCubicRel":{"title":"SVGPathElement","members":[],"srcUrl":"https://developer.mozilla.org/en/DOM/SVGPathElement","skipped":true,"cause":"Suspect title"},"IDBVersionChangeEvent":{"title":"IDBVersionChangeEvent","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td><code>version</code></td> <td>12</td> <td> <p>From 4.0 (2.0)\n to</p> <p>9.0 (9.0)\n</p> </td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> </tr> <tr> <td><code>oldVersion</code></td> <td><span title=\"Not supported.\">--</span></td> <td> <p>10.0 (10.0)\n</p> </td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> </tr> <tr> <td><code>newVersion</code></td> <td><span title=\"Not supported.\">--</span></td> <td> <p>10.0 (10.0)\n</p> </td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE&nbsp;Phone</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Not supported.\">--</span></td> <td>4.0 (2.0)\n</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Not supported.\">--</span></td> </tr> </tbody> </table>\n</div>","summary":"<p>The <code>IDBVersionChangeEvent</code> interface of the <a title=\"en/IndexedDB\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB\">IndexedDB&nbsp;API</a> indicates that the version of the database has changed.</p>\n<p>The specification has changed and some not up-to-date browsers only support the deprecated unique attribute, <code>version</code>, from an early draft version.</p>","members":[{"url":"","name":"oldVersion","help":"Returns the old version of the database.","obsolete":false},{"url":"","name":"newVersion","help":"Returns the new version of the database.","obsolete":false},{"url":"","name":"version","help":"<div class=\"warning\"><strong>Warning:</strong> While this property is still implemented by not up-to-date browsers, the latest specification does replace it by the <code>oldVersion</code> and <code>newVersion</code> attributes. See compatibility table to know what browsers support them.</div> The new version of the database in a <a title=\"en/IndexedDB/IDBTransaction#VERSION CHANGE\" rel=\"internal\" href=\"https://developer.mozilla.org/en/IndexedDB/IDBTransaction#VERSION_CHANGE\">VERSION_CHANGE</a> transaction.","obsolete":true}],"srcUrl":"https://developer.mozilla.org/en/IndexedDB/IDBVersionChangeEvent"},"SVGTextElement":{"title":"SVGTextElement","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> </tbody> </table>\n</div>","srcUrl":"https://developer.mozilla.org/en/DOM/SVGTextElement","seeAlso":"<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/text\">&lt;text&gt;</a></code>\n SVG Element","summary":"The <code>SVGTextElement</code> interface provides access to the properties of <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/text\">&lt;text&gt;</a></code>\n elements, as well as methods to manipulate them.","members":[]},"HTMLBRElement":{"title":"HTMLBRElement","summary":"DOM break elements expose the <a class=\"external\" href=\"http://www.w3.org/TR/html5/text-level-semantics.html#the-br-element\" rel=\"external nofollow\" target=\"_blank\" title=\"http://www.w3.org/TR/html5/text-level-semantics.html#the-br-element\">HTMLBRElement</a> (or <span><a href=\"https://developer.mozilla.org/en/HTML\" rel=\"custom nofollow\">HTML 4</a></span> <a class=\"external\" href=\"http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-56836063\" rel=\"external nofollow\" target=\"_blank\" title=\"http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-56836063\"><code>HTMLBRElement</code></a>) interface which inherits from HTMLElement, but defines no additional members in \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span>. The introduced additional property is also deprecated in \n<span>HTML 4.01</span>.","members":[{"name":"clear","help":"Indicates flow of text around floating objects.","obsolete":true}],"srcUrl":"https://developer.mozilla.org/en/DOM/HTMLBRElement"},"WebGLTexture":{"title":"Cross-domain textures","members":[],"srcUrl":"https://developer.mozilla.org/en/WebGL/Cross-Domain_Textures","skipped":true,"cause":"Suspect title"},"SVGForeignObjectElement":{"title":"SVGForeignObjectElement","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td>9.0</td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Not supported.\">--</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> <td><span title=\"Please update this with the earliest version of support.\">(Supported)</span></td> </tr> </tbody> </table>\n</div>","srcUrl":"https://developer.mozilla.org/en/DOM/SVGForeignObjectElement","seeAlso":"<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/foreignObject\">&lt;foreignObject&gt;</a></code>\n SVG Element","summary":"The <code>SVGForeignObjectElement</code> interface provides access to the properties of <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/foreignObject\">&lt;foreignObject&gt;</a></code>\n elements, as well as methods to manipulate them.","members":[{"name":"width","help":"Corresponds to attribute \n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Attribute/width\">width</a></code> on the given <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/foreignObject\">&lt;foreignObject&gt;</a></code>\n element.","obsolete":false},{"name":"height","help":"Corresponds to attribute \n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Attribute/height\">height</a></code> on the given <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/foreignObject\">&lt;foreignObject&gt;</a></code>\n element.","obsolete":false}]},"XPathResult":{"title":"XPathResult","seeAlso":"document.evaluate()","summary":"Refer to <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsIDOMXPathResult\">nsIDOMXPathResult</a></code>\n for more detail.","members":[{"obsolete":false,"url":"https://developer.mozilla.org/en/SnapshotItem()","name":"snapshotItem","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/IterateNext()","name":"iterateNext","help":""},{"name":"ANY_TYPE","help":"A result set containing whatever type naturally results from evaluation of the expression. Note that if the result is a node-set then UNORDERED_NODE_ITERATOR_TYPE is always the resulting type.\n","obsolete":false},{"name":"NUMBER_TYPE","help":"A result containing a single number. This is useful for example, in an XPath expression using the <code>count()</code> function.\n","obsolete":false},{"name":"STRING_TYPE","help":"A result containing a single string.\n","obsolete":false},{"name":"BOOLEAN_TYPE","help":"A result containing a single boolean value. This is useful for example, in an XPath expression using the <code>not()</code> function.\n","obsolete":false},{"name":"UNORDERED_NODE_ITERATOR_TYPE","help":"A result node-set containing all the nodes matching the expression. The nodes may not necessarily be in the same order that they appear in the document.\n","obsolete":false},{"name":"ORDERED_NODE_ITERATOR_TYPE","help":"A result node-set containing all the nodes matching the expression. The nodes in the result set are in the same order that they appear in the document.\n","obsolete":false},{"name":"UNORDERED_NODE_SNAPSHOT_TYPE","help":"A result node-set containing snapshots of all the nodes matching the expression. The nodes may not necessarily be in the same order that they appear in the document.\n","obsolete":false},{"name":"ORDERED_NODE_SNAPSHOT_TYPE","help":"A result node-set containing snapshots of all the nodes matching the expression. The nodes in the result set are in the same order that they appear in the document.\n","obsolete":false},{"name":"ANY_UNORDERED_NODE_TYPE","help":"A result node-set containing any single node that matches the expression. The node is not necessarily the first node in the document that matches the expression.\n","obsolete":false},{"name":"FIRST_ORDERED_NODE_TYPE","help":"A result node-set containing the first node in the document that matches the expression.\n","obsolete":false},{"obsolete":false,"url":"https://developer.mozilla.org/en/NumberValue","name":"numberValue","help":"readonly float"},{"obsolete":false,"url":"https://developer.mozilla.org/en/BooleanValue","name":"booleanValue","help":"readonly boolean"},{"obsolete":false,"url":"https://developer.mozilla.org/en/SingleNodeValue","name":"singleNodeValue","help":"readonly Node"},{"obsolete":false,"url":"https://developer.mozilla.org/en/SnapshotLength","name":"snapshotLength","help":"readonly Integer"},{"obsolete":false,"url":"https://developer.mozilla.org/en/InvalidInteratorState","name":"invalidIteratorState","help":"readonly boolean"},{"obsolete":false,"url":"https://developer.mozilla.org/en/StringValue","name":"stringValue","help":"readonly String"},{"obsolete":false,"url":"https://developer.mozilla.org/en/ResultType","name":"resultType","help":"readonly integer (short)"}],"srcUrl":"https://developer.mozilla.org/en/XPathResult"},"SVGFontFaceUriElement":{"title":"SVGFontFaceUriElement","compatibility":"<div class=\"htab\"><a name=\"AutoCompatibilityTable\"></a>\n<ul> <li class=\"selected\">Desktop</li> <li>Mobile</li>\n</ul>\n</div><p></p>\n<div id=\"compat-desktop\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>\n<div id=\"compat-mobile\"> <table class=\"compat-table\"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> <td><span title=\"Compatibility unknown; please update this.\">?</span></td> </tr> </tbody> </table>\n</div>","srcUrl":"https://developer.mozilla.org/en/DOM/SVGFontFaceUriElement","seeAlso":"<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/font-face-uri\">&lt;font-face-uri&gt;</a></code>\n SVG Element","summary":"<p>The <code>SVGFontFaceUriElement</code> interface corresponds to the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/font-face-uri\">&lt;font-face-uri&gt;</a></code>\n elements.</p>\n<p>Object-oriented access to the attributes of the <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/font-face-uri\">&lt;font-face-uri&gt;</a></code>\n element via the SVG DOM is not possible.</p>","members":[]},"HTMLAnchorElement":{"title":"HTMLAnchorElement","summary":"DOM anchor elements expose the <a target=\"_blank\" href=\"http://www.w3.org/TR/html5/text-level-semantics.html#htmlanchorelement\" rel=\"external nofollow\" class=\" external\" title=\"http://www.w3.org/TR/html5/text-level-semantics.html#htmlanchorelement\">HTMLAnchorElement</a> (or <span><a href=\"https://developer.mozilla.org/en/HTML\" rel=\"custom nofollow\">HTML 4</a></span> <a target=\"_blank\" title=\"http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-48250443\" href=\"http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-48250443\" rel=\"external nofollow\" class=\" external\"><code>HTMLAnchorElement</code></a>) interface, which provides special properties and methods (beyond the regular <a href=\"https://developer.mozilla.org/en/DOM/element\" rel=\"internal\">element</a> object interface they also have available to them by inheritance) for manipulating the layout and presentation of hyperlink elements.","members":[{"name":"blur","help":"Removes keyboard focus from the current element.","obsolete":false},{"name":"focus","help":"Gives keyboard focus to the current element.","obsolete":false},{"name":"accessKey","help":"A single character that switches input focus to the hyperlink. \n\n<span title=\"\">Obsolete</span> in \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span>","obsolete":true},{"name":"charset","help":"The character encoding of the linked resource. \n\n<span title=\"\">Obsolete</span> in \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span>","obsolete":true},{"name":"coords","help":"Comma-separated list of coordinates. \n\n<span title=\"\">Obsolete</span> in \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span>","obsolete":true},{"name":"hash","help":"The fragment identifier (including the leading hash mark (#)), if any, in the referenced URL.","obsolete":false},{"name":"host","help":"The hostname and port (if it's not the default port) in the referenced URL.","obsolete":false},{"name":"hostname","help":"The hostname in the referenced URL.","obsolete":false},{"name":"href","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/a#attr-href\">href</a></code>\n HTML attribute, containing a valid URL of a linked resource.","obsolete":false},{"name":"hreflang","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/a#attr-hreflang\">hreflang</a></code>\n HTML&nbsp;attribute, indicating the language of the linked resource.","obsolete":false},{"name":"media","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/a#attr-media\">media</a></code>\n HTML attribute, indicating the intended media for the linked resource.","obsolete":false},{"name":"name","help":"Anchor name. \n\n<span title=\"\">Obsolete</span> in \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span>","obsolete":true},{"name":"pathname","help":"The path name component, if any, of the referenced URL.","obsolete":false},{"name":"port","help":"The port component, if any, of the referenced URL.","obsolete":false},{"name":"protocol","help":"The protocol component (including trailing colon (:)), of the referenced URL.","obsolete":false},{"name":"rel","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/a#attr-rel\">rel</a></code>\n HTML attribute, specifying the relationship of the target object to the link object.","obsolete":false},{"name":"relList","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/a#attr-rel\">rel</a></code>\n HTML&nbsp;attribute, as a list of tokens.","obsolete":false},{"name":"rev","help":"Reverse link type. \n\n<span title=\"\">Obsolete</span> in \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span>","obsolete":true},{"name":"search","help":"The search element (including leading question mark (?)), if any, of the referenced URL","obsolete":false},{"name":"shape","help":"The shape of the active area. \n\n<span title=\"\">Obsolete</span> in \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span>","obsolete":true},{"name":"tabIndex","help":"The position of the element in the tabbing navigation order for the current document. \n\n<span title=\"\">Obsolete</span> in \n<span><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/HTML5\">HTML5</a></span>","obsolete":true},{"name":"target","help":"Reflectst the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/a#attr-target\">target</a></code>\n HTML attribute, indicating where to display the linked resource.","obsolete":false},{"name":"text","help":"Same as the <strong><a title=\"https://developer.mozilla.org/En/DOM/Node.textContent\" rel=\"internal\" href=\"https://developer.mozilla.org/En/DOM/Node.textContent\">textContent</a></strong> property.","obsolete":false},{"name":"type","help":"Reflects the \n\n<code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/HTML/Element/a#attr-type\">type</a></code>\n HTML attribute, indicating the MIME type of the linked resource.","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/DOM/HTMLAnchorElement"},"SVGFEDisplacementMapElement":{"title":"feDisplacementMap","seeAlso":"<li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/filter\">&lt;filter&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/animate\">&lt;animate&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/set\">&lt;set&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feBlend\">&lt;feBlend&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feColorMatrix\">&lt;feColorMatrix&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feComponentTransfer\">&lt;feComponentTransfer&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feComposite\">&lt;feComposite&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feConvolveMatrix\">&lt;feConvolveMatrix&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feDiffuseLighting\">&lt;feDiffuseLighting&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feFlood\">&lt;feFlood&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feGaussianBlur\">&lt;feGaussianBlur&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feImage\">&lt;feImage&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feMerge\">&lt;feMerge&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feMorphology\">&lt;feMorphology&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feOffset\">&lt;feOffset&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feSpecularLighting\">&lt;feSpecularLighting&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feTile\">&lt;feTile&gt;</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/SVG/Element/feTurbulence\">&lt;feTurbulence&gt;</a></code>\n</li> <li><a title=\"en/SVG/Tutorial/Filter_effects\" rel=\"internal\" href=\"https://developer.mozilla.org/en/SVG/Tutorial/Filter_effects\">SVG tutorial: Filter effects</a></li>","summary":"The pixel value of an input image i2 is used to displace the original image i1.","members":[{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/in2","name":"in2","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/scale","name":"scale","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/yChannelSelector","name":"yChannelSelector","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/class","name":"class","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/xChannelSelector","name":"xChannelSelector","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/in","name":"in","help":""},{"obsolete":false,"url":"https://developer.mozilla.org/en/SVG/Attribute/style","name":"style","help":"Specific attributes"}],"srcUrl":"https://developer.mozilla.org/en/SVG/Element/feDisplacementMap"},"Clipboard":{"title":"nsIClipboard","seeAlso":"<li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsIClipboardOwner\">nsIClipboardOwner</a></code>\n</li> <li><code><a rel=\"internal\" href=\"https://developer.mozilla.org/Article_not_found?uri=en/XPCOM_Interface_Reference/nsITransferable&amp;ident=nsITransferable\" class=\"new\">nsITransferable</a></code>\n</li> <li><code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsIArray\">nsIArray</a></code>\n</li> <li><a title=\"Using the Clipboard\" class=\"internal\" rel=\"internal\" href=\"https://developer.mozilla.org/en/Using_the_Clipboard\">Using the Clipboard</a></li>","summary":"<div>\n\n<a rel=\"custom\" href=\"http://mxr.mozilla.org/mozilla-central/source/widget/public/nsIClipboard.idl\"><code>widget/public/nsIClipboard.idl</code></a><span><a rel=\"internal\" href=\"https://developer.mozilla.org/en/Interfaces/About_Scriptable_Interfaces\" title=\"en/Interfaces/About_Scriptable_Interfaces\">Scriptable</a></span></div><span>This interface supports basic clipboard operations such as: setting, retrieving, emptying, matching and supporting clipboard data.</span><div>Inherits from: <code><a rel=\"custom\" href=\"https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsISupports\">nsISupports</a></code>\n<span>Last changed in Gecko 1.8 (Firefox 1.5 / Thunderbird 1.5 / SeaMonkey 1.0)\n</span></div>","members":[{"name":"hasDataMatchingFlavors","help":"<p>This method provides a way to give correct UI feedback about, for instance, whether a paste should be allowed. It does <strong>not</strong> actually retrieve the data and should be a very inexpensive call. All it does is check if there is data on the clipboard matching any of the flavors in the given list.</p>\n\n<div id=\"section_10\"><span id=\"Parameters_4\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>aFlavorList</code></dt> <dd>An array of ASCII strings.</dd> <dt><code>aLength</code></dt> <dd>The length of the <code>aFlavorList</code>.</dd> <dt><code>aWhichClipboard</code></dt> <dd>Specifies the clipboard to which this operation applies.</dd>\n</dl>\n</div><div id=\"section_11\"><span id=\"Return_value\"></span><h6 class=\"editable\">Return value</h6>\n<p>Returns <code>true</code>, if data is present and it matches the specified flavor. Otherwise it returns <code>false</code>.</p>\n</div>","idl":"<pre class=\"eval\">boolean hasDataMatchingFlavors(\n  [array, size_is(aLength)] in string aFlavorList,\n  in unsigned long aLength, \n<span title=\"(Firefox 3)\n\" style=\"border: 1px solid rgb(129, 129, 81); background-color: rgb(255, 255, 225); font-size: x-small; white-space: nowrap; padding: 2px;\">Requires Gecko 1.9</span>\n\n  in long aWhichClipboard \n);\n</pre>","obsolete":false},{"name":"emptyClipboard","help":"<p>This method empties the clipboard and notifies the clipboard owner. It empties the \"logical\" clipboard. It does not clear the native clipboard.</p>\n\n<div id=\"section_5\"><span id=\"Parameters\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>aWhichClipboard</code></dt> <dd>Specifies the clipboard to which this operation applies.</dd>\n</dl>\n<p>\n\n</p><div><span>Obsolete since Gecko 1.8 (Firefox 1.5 / Thunderbird 1.5 / SeaMonkey 1.0)\n</span><span id=\"forceDataToClipboard()\"></span></div></div>","idl":"<pre class=\"eval\">void emptyClipboard(\n  in long aWhichClipboard \n);\n</pre>","obsolete":false},{"name":"forceDataToClipboard","help":"<div id=\"section_5\"><p>Some platforms support deferred notification for putting data on the clipboard This method forces the data onto the clipboard in its various formats This may be used if the application going away.</p>\n\n</div><div id=\"section_6\"><span id=\"Parameters_2\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>aWhichClipboard</code></dt> <dd>Specifies the clipboard to which this operation applies.</dd>\n</dl>\n</div>","idl":"<pre class=\"eval\">void forceDataToClipboard(\n  in long aWhichClipboard \n);\n</pre>","obsolete":false},{"name":"setData","help":"<p>This method sets the data from a transferable on the native clipboard.</p>\n\n<div id=\"section_13\"><span id=\"Parameters_5\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>aTransferable</code></dt> <dd>The transferable containing the data to put on the clipboard.</dd> <dt><code>anOwner</code></dt> <dd>The owner of the transferable.</dd> <dt><code>aWhichClipboard</code></dt> <dd>Specifies the clipboard to which this operation applies.</dd>\n</dl>\n</div>","idl":"<pre class=\"eval\">void setData(\n  in nsITransferable aTransferable,\n  in nsIClipboardOwner anOwner,\n  in long aWhichClipboard \n);\n</pre>","obsolete":false},{"name":"getData","help":"<p>This method retrieves data from the clipboard into a transferable.</p>\n\n<div id=\"section_8\"><span id=\"Parameters_3\"></span><h6 class=\"editable\">Parameters</h6>\n<dl> <dt><code>aTransferable</code></dt> <dd>The transferable to receive data from the clipboard.</dd> <dt><code>aWhichClipboard</code></dt> <dd>Specifies the clipboard to which this operation applies.</dd>\n</dl>\n</div>","idl":"<pre class=\"eval\">void getData(\n  in nsITransferable aTransferable,\n  in long aWhichClipboard \n);\n</pre>","obsolete":false},{"name":"supportsSelectionClipboard","help":"<p>This method allows clients to determine if the implementation supports the concept of a separate clipboard for selection.</p>\n\n<div id=\"section_15\"><span id=\"Parameters_6\"></span>\n\n</div><div id=\"section_16\"><span id=\"Return_value_2\"></span><h6 class=\"editable\">Return value</h6>\n<p>Returns <code>true</code> if <code>kSelectionClipboard</code> is available. Otherwise it returns <code>false</code>.</p>\n</div>","idl":"<pre class=\"eval\">boolean supportsSelectionClipboard();\n</pre>","obsolete":false},{"name":"kSelectionClipboard","help":"Clipboard for selection.","obsolete":false},{"name":"kGlobalClipboard","help":"Clipboard for global use.","obsolete":false}],"srcUrl":"https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsIClipboard"},"CSSUnknownRule":{"title":"cssRule","members":[],"srcUrl":"https://developer.mozilla.org/pl/DOM/cssRule","skipped":true,"cause":"Suspect title"}}
\ No newline at end of file
diff --git a/utils/apidoc/mdn/extract.dart b/utils/apidoc/mdn/extract.dart
deleted file mode 100644
index 210e84c..0000000
--- a/utils/apidoc/mdn/extract.dart
+++ /dev/null
@@ -1,1321 +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.
-
-import "dart:collection";
-import 'dart:convert';
-import 'dart:html';
-
-// Workaround for HTML lib missing feature.
-Range newRange() {
-  return document.createRange();
-}
-
-// Temporary range object to optimize performance computing client rects
-// from text nodes.
-Range _tempRange;
-// Hacks because ASYNC measurement is annoying when just writing a script.
-ClientRect getClientRect(Node n) {
-  if (n is Element) {
-    return n.$dom_getBoundingClientRect();
-  } else {
-    // Crazy hacks that works for nodes.... create a range and measure it.
-    if (_tempRange == null) {
-      _tempRange = newRange();
-    }
-    _tempRange.setStartBefore(n);
-    _tempRange.setEndAfter(n);
-     return _tempRange.getBoundingClientRect();
-  }
-}
-
-/**
- * CSS class that is added to elements in the DOM to indicate that they should
- * be removed when extracting blocks of documentation.  This is helpful when
- * running this script in a web browser as it is easy to visually see what
- * blocks of information were extracted when using CSS such as DEBUG_CSS
- * which highlights elements that should be removed.
- */
-const DART_REMOVED = "dart-removed";
-
-const DEBUG_CSS = """
-<style type="text/css">
-  .dart-removed {
-    background-color: rgba(255, 0, 0, 0.5);
-   }
-</style>""";
-
-const MIN_PIXELS_DIFFERENT_LINES = 10;
-
-const IDL_SELECTOR = "pre.eval, pre.idl";
-
-Map data;
-
-// TODO(rnystrom): Hack! Copied from domTypes.json. Instead of hard-coding
-// these, should use the same mapping that the DOM/HTML code generators use.
-var domTypes;
-const domTypesRaw = const [
-  "AbstractWorker", "ArrayBuffer", "ArrayBufferView", "Attr",
-  "AudioBuffer", "AudioBufferSourceNode", "AudioChannelMerger",
-  "AudioChannelSplitter", "AudioContext", "AudioDestinationNode",
-  "AudioGain", "AudioGainNode", "AudioListener", "AudioNode",
-  "AudioPannerNode", "AudioParam", "AudioProcessingEvent",
-  "AudioSourceNode", "BarInfo", "BeforeLoadEvent", "BiquadFilterNode",
-  "Blob", "CDATASection", "CSSCharsetRule", "CSSFontFaceRule",
-  "CSSImportRule", "CSSMediaRule", "CSSPageRule", "CSSPrimitiveValue",
-  "CSSRule", "CSSRuleList", "CSSStyleDeclaration", "CSSStyleRule",
-  "CSSStyleSheet", "CSSUnknownRule", "CSSValue", "CSSValueList",
-  "CanvasGradient", "CanvasPattern", "CanvasPixelArray",
-  "CanvasRenderingContext", "CanvasRenderingContext2D",
-  "CharacterData", "ClientRect", "ClientRectList", "Clipboard",
-  "CloseEvent", "Comment", "CompositionEvent", "Console",
-  "ConvolverNode", "Coordinates", "Counter", "Crypto", "CustomEvent",
-  "DOMApplicationCache", "DOMException", "DOMFileSystem",
-  "DOMFileSystemSync", "DOMFormData", "DOMImplementation",
-  "DOMMimeType", "DOMMimeTypeArray", "DOMParser", "DOMPlugin",
-  "DOMPluginArray", "DOMSelection", "DOMSettableTokenList",
-  "DOMTokenList", "DOMURL", "DOMWindow", "DataTransferItem",
-  "DataTransferItemList", "DataView", "Database", "DatabaseSync",
-  "DedicatedWorkerContext", "DelayNode", "DeviceMotionEvent",
-  "DeviceOrientationEvent", "DirectoryEntry", "DirectoryEntrySync",
-  "DirectoryReader", "DirectoryReaderSync", "Document",
-  "DocumentFragment", "DocumentType", "DynamicsCompressorNode",
-  "Element", "ElementTimeControl", "ElementTraversal", "Entity",
-  "EntityReference", "Entry", "EntryArray", "EntryArraySync",
-  "EntrySync", "ErrorEvent", "Event", "EventException", "EventSource",
-  "EventTarget", "File", "FileEntry", "FileEntrySync", "FileError",
-  "FileException", "FileList", "FileReader", "FileReaderSync",
-  "FileWriter", "FileWriterSync", "Float32Array", "Float64Array",
-  "Geolocation", "Geoposition", "HTMLAllCollection",
-  "HTMLAnchorElement", "HTMLAppletElement", "HTMLAreaElement",
-  "HTMLAudioElement", "HTMLBRElement", "HTMLBaseElement",
-  "HTMLBaseFontElement", "HTMLBodyElement", "HTMLButtonElement",
-  "HTMLCanvasElement", "HTMLCollection", "HTMLDListElement",
-  "HTMLDataListElement", "HTMLDetailsElement", "HTMLDirectoryElement",
-  "HTMLDivElement", "HTMLDocument", "HTMLElement", "HTMLEmbedElement",
-  "HTMLFieldSetElement", "HTMLFontElement", "HTMLFormElement",
-  "HTMLFrameElement", "HTMLFrameSetElement", "HTMLHRElement",
-  "HTMLHeadElement", "HTMLHeadingElement", "HTMLHtmlElement",
-  "HTMLIFrameElement", "HTMLImageElement", "HTMLInputElement",
-  "HTMLIsIndexElement", "HTMLKeygenElement", "HTMLLIElement",
-  "HTMLLabelElement", "HTMLLegendElement", "HTMLLinkElement",
-  "HTMLMapElement", "HTMLMarqueeElement", "HTMLMediaElement",
-  "HTMLMenuElement", "HTMLMetaElement", "HTMLMeterElement",
-  "HTMLModElement", "HTMLOListElement", "HTMLObjectElement",
-  "HTMLOptGroupElement", "HTMLOptionElement", "HTMLOptionsCollection",
-  "HTMLOutputElement", "HTMLParagraphElement", "HTMLParamElement",
-  "HTMLPreElement", "HTMLProgressElement", "HTMLQuoteElement",
-  "HTMLScriptElement", "HTMLSelectElement", "HTMLSourceElement",
-  "HTMLSpanElement", "HTMLStyleElement", "HTMLTableCaptionElement",
-  "HTMLTableCellElement", "HTMLTableColElement", "HTMLTableElement",
-  "HTMLTableRowElement", "HTMLTableSectionElement",
-  "HTMLTextAreaElement", "HTMLTitleElement", "HTMLTrackElement",
-  "HTMLUListElement", "HTMLUnknownElement", "HTMLVideoElement",
-  "HashChangeEvent", "HighPass2FilterNode", "History", "IDBAny",
-  "IDBCursor", "IDBCursorWithValue", "IDBDatabase",
-  "IDBDatabaseError", "IDBDatabaseException", "IDBFactory",
-  "IDBIndex", "IDBKey", "IDBKeyRange", "IDBObjectStore", "IDBRequest",
-  "IDBTransaction", "IDBVersionChangeEvent",
-  "IDBVersionChangeRequest", "ImageData", "InjectedScriptHost",
-  "InspectorFrontendHost", "Int16Array", "Int32Array", "Int8Array",
-  "JavaScriptAudioNode", "JavaScriptCallFrame", "KeyboardEvent",
-  "Location", "LowPass2FilterNode", "MediaElementAudioSourceNode",
-  "MediaError", "MediaList", "MediaQueryList",
-  "MediaQueryListListener", "MemoryInfo", "MessageChannel",
-  "MessageEvent", "MessagePort", "Metadata", "MouseEvent",
-  "MutationCallback", "MutationEvent", "MutationRecord",
-  "NamedNodeMap", "Navigator", "NavigatorUserMediaError",
-  "NavigatorUserMediaSuccessCallback", "Node", "NodeFilter",
-  "NodeIterator", "NodeList", "NodeSelector", "Notation",
-  "Notification", "NotificationCenter", "OESStandardDerivatives",
-  "OESTextureFloat", "OESVertexArrayObject",
-  "OfflineAudioCompletionEvent", "OperationNotAllowedException",
-  "OverflowEvent", "PageTransitionEvent", "Performance",
-  "PerformanceNavigation", "PerformanceTiming", "PopStateEvent",
-  "PositionError", "ProcessingInstruction", "ProgressEvent",
-  "RGBColor", "Range", "RangeException", "RealtimeAnalyserNode",
-  "Rect", "SQLError", "SQLException", "SQLResultSet",
-  "SQLResultSetRowList", "SQLTransaction", "SQLTransactionSync",
-  "SVGAElement", "SVGAltGlyphDefElement", "SVGAltGlyphElement",
-  "SVGAltGlyphItemElement", "SVGAngle", "SVGAnimateColorElement",
-  "SVGAnimateElement", "SVGAnimateMotionElement",
-  "SVGAnimateTransformElement", "SVGAnimatedAngle",
-  "SVGAnimatedBoolean", "SVGAnimatedEnumeration",
-  "SVGAnimatedInteger", "SVGAnimatedLength", "SVGAnimatedLengthList",
-  "SVGAnimatedNumber", "SVGAnimatedNumberList",
-  "SVGAnimatedPreserveAspectRatio", "SVGAnimatedRect",
-  "SVGAnimatedString", "SVGAnimatedTransformList",
-  "SVGAnimationElement", "SVGCircleElement", "SVGClipPathElement",
-  "SVGColor", "SVGComponentTransferFunctionElement",
-  "SVGCursorElement", "SVGDefsElement", "SVGDescElement",
-  "SVGDocument", "SVGElement", "SVGElementInstance",
-  "SVGElementInstanceList", "SVGEllipseElement", "SVGException",
-  "SVGExternalResourcesRequired", "SVGFEBlendElement",
-  "SVGFEColorMatrixElement", "SVGFEComponentTransferElement",
-  "SVGFECompositeElement", "SVGFEConvolveMatrixElement",
-  "SVGFEDiffuseLightingElement", "SVGFEDisplacementMapElement",
-  "SVGFEDistantLightElement", "SVGFEDropShadowElement",
-  "SVGFEFloodElement", "SVGFEFuncAElement", "SVGFEFuncBElement",
-  "SVGFEFuncGElement", "SVGFEFuncRElement",
-  "SVGFEGaussianBlurElement", "SVGFEImageElement",
-  "SVGFEMergeElement", "SVGFEMergeNodeElement",
-  "SVGFEMorphologyElement", "SVGFEOffsetElement",
-  "SVGFEPointLightElement", "SVGFESpecularLightingElement",
-  "SVGFESpotLightElement", "SVGFETileElement",
-  "SVGFETurbulenceElement", "SVGFilterElement",
-  "SVGFilterPrimitiveStandardAttributes", "SVGFitToViewBox",
-  "SVGFontElement", "SVGFontFaceElement", "SVGFontFaceFormatElement",
-  "SVGFontFaceNameElement", "SVGFontFaceSrcElement",
-  "SVGFontFaceUriElement", "SVGForeignObjectElement", "SVGGElement",
-  "SVGGlyphElement", "SVGGlyphRefElement", "SVGGradientElement",
-  "SVGHKernElement", "SVGImageElement", "SVGLangSpace", "SVGLength",
-  "SVGLengthList", "SVGLineElement", "SVGLinearGradientElement",
-  "SVGLocatable", "SVGMPathElement", "SVGMarkerElement",
-  "SVGMaskElement", "SVGMatrix", "SVGMetadataElement",
-  "SVGMissingGlyphElement", "SVGNumber", "SVGNumberList", "SVGPaint",
-  "SVGPathElement", "SVGPathSeg", "SVGPathSegArcAbs",
-  "SVGPathSegArcRel", "SVGPathSegClosePath",
-  "SVGPathSegCurvetoCubicAbs", "SVGPathSegCurvetoCubicRel",
-  "SVGPathSegCurvetoCubicSmoothAbs",
-  "SVGPathSegCurvetoCubicSmoothRel", "SVGPathSegCurvetoQuadraticAbs",
-  "SVGPathSegCurvetoQuadraticRel",
-  "SVGPathSegCurvetoQuadraticSmoothAbs",
-  "SVGPathSegCurvetoQuadraticSmoothRel", "SVGPathSegLinetoAbs",
-  "SVGPathSegLinetoHorizontalAbs", "SVGPathSegLinetoHorizontalRel",
-  "SVGPathSegLinetoRel", "SVGPathSegLinetoVerticalAbs",
-  "SVGPathSegLinetoVerticalRel", "SVGPathSegList",
-  "SVGPathSegMovetoAbs", "SVGPathSegMovetoRel", "SVGPatternElement",
-  "SVGPoint", "SVGPointList", "SVGPolygonElement",
-  "SVGPolylineElement", "SVGPreserveAspectRatio",
-  "SVGRadialGradientElement", "SVGRect", "SVGRectElement",
-  "SVGRenderingIntent", "SVGSVGElement", "SVGScriptElement",
-  "SVGSetElement", "SVGStopElement", "SVGStringList", "SVGStylable",
-  "SVGStyleElement", "SVGSwitchElement", "SVGSymbolElement",
-  "SVGTRefElement", "SVGTSpanElement", "SVGTests",
-  "SVGTextContentElement", "SVGTextElement", "SVGTextPathElement",
-  "SVGTextPositioningElement", "SVGTitleElement", "SVGTransform",
-  "SVGTransformList", "SVGTransformable", "SVGURIReference",
-  "SVGUnitTypes", "SVGUseElement", "SVGVKernElement",
-  "SVGViewElement", "SVGViewSpec", "SVGZoomAndPan", "SVGZoomEvent",
-  "Screen", "ScriptProfile", "ScriptProfileNode", "SharedWorker",
-  "SharedWorkercontext", "SpeechInputEvent", "SpeechInputResult",
-  "SpeechInputResultList", "Storage", "StorageEvent", "StorageInfo",
-  "StyleMedia", "StyleSheet", "StyleSheetList", "Text", "TextEvent",
-  "TextMetrics", "TextTrack", "TextTrackCue", "TextTrackCueList",
-  "TimeRanges", "Touch", "TouchEvent", "TouchList", "TreeWalker",
-  "UIEvent", "Uint16Array", "Uint32Array", "Uint8Array",
-  "ValidityState", "VoidCallback", "WaveShaperNode",
-  "WebGLActiveInfo", "WebGLBuffer", "WebGLContextAttributes",
-  "WebGLContextEvent", "WebGLDebugRendererInfo", "WebGLDebugShaders",
-  "WebGLFramebuffer", "WebGLProgram", "WebGLRenderbuffer",
-  "WebGLRenderingContext", "WebGLShader", "WebGLTexture",
-  "WebGLUniformLocation", "WebGLVertexArrayObjectOES",
-  "WebKitAnimation", "WebKitAnimationEvent", "WebKitAnimationList",
-  "WebKitBlobBuilder", "WebKitCSSFilterValue",
-  "WebKitCSSKeyframeRule", "WebKitCSSKeyframesRule",
-  "WebKitCSSMatrix", "WebKitCSSTransformValue", "WebKitFlags",
-  "WebKitLoseContext", "WebKitMutationObserver", "WebKitPoint",
-  "WebKitTransitionEvent", "WebSocket", "WheelEvent", "Worker",
-  "WorkerContext", "WorkerLocation", "WorkerNavigator",
-  "XMLHttpRequest", "XMLHttpRequestException",
-  "XMLHttpRequestProgressEvent", "XMLHttpRequestUpload",
-  "XMLSerializer", "XPathEvaluator", "XPathException",
-  "XPathExpression", "XPathNSResolver", "XPathResult",
-  "XSLTProcessor", "AudioBufferCallback", "DatabaseCallback",
-  "EntriesCallback", "EntryCallback", "ErrorCallback", "FileCallback",
-  "FileSystemCallback", "FileWriterCallback", "MetadataCallback",
-  "NavigatorUserMediaErrorCallback", "PositionCallback",
-  "PositionErrorCallback", "SQLStatementCallback",
-  "SQLStatementErrorCallback", "SQLTransactionCallback",
-  "SQLTransactionErrorCallback", "SQLTransactionSyncCallback",
-  "StorageInfoErrorCallback", "StorageInfoQuotaCallback",
-  "StorageInfoUsageCallback", "StringCallback"
-];
-
-Map dbEntry;
-
-Map get dartIdl => data['dartIdl'];
-String get currentType => data['type'];
-
-String _currentTypeShort;
-String get currentTypeShort {
-  if (_currentTypeShort == null) {
-    _currentTypeShort = currentType;
-    _currentTypeShort = trimPrefix(_currentTypeShort, "HTML");
-    _currentTypeShort = trimPrefix(_currentTypeShort, "SVG");
-    _currentTypeShort = trimPrefix(_currentTypeShort, "DOM");
-    _currentTypeShort = trimPrefix(_currentTypeShort, "WebKit");
-    _currentTypeShort = trimPrefix(_currentTypeShort, "Webkit");
-  }
-  return _currentTypeShort;
-}
-
-String _currentTypeTiny;
-String get currentTypeTiny {
-  if (_currentTypeTiny == null) {
-    _currentTypeTiny = currentTypeShort;
-    _currentTypeTiny = trimEnd(_currentTypeTiny, "Element");
-  }
-  return _currentTypeTiny;
-}
-
-Map get searchResult => data['searchResult'];
-String get pageUrl => searchResult['link'];
-
-String _pageDomain;
-String get pageDomain {
-  if (_pageDomain == null) {
-    _pageDomain = pageUrl.substring(0, pageUrl.indexOf("/", "https://".length));
-  }
-  return _pageDomain;
-}
-
-String get pageDir {
-  return pageUrl.substring(0, pageUrl.lastIndexOf('/') + 1);
-}
-
-String getAbsoluteUrl(AnchorElement anchor) {
-  if (anchor == null || anchor.href.length == 0) return '';
-  String path = anchor.href;
-  RegExp fullUrlRegExp = new RegExp("^https?://");
-  if (fullUrlRegExp.hasMatch(path)) return path;
-  if (path.startsWith('/')) {
-    return "$pageDomain$path";
-  } else if (path.startsWith("#")) {
-    return "$pageUrl$path";
-  } else {
-    return "$pageDir$path";
-  }
-}
-
-bool inTable(Node n) {
-  while (n != null) {
-    if (n is TableElement) return true;
-    n = n.parent;
-  }
-  return false;
-}
-
-String escapeHTML(str) {
-  Element e = new Element.tag("div");
-  e.text = str;
-  return e.innerHTML;
-}
-
-List<Text> getAllTextNodes(Element elem) {
-  final nodes = <Text>[];
-  helper(Node n) {
-    if (n is Text) {
-      nodes.add(n);
-    } else {
-      for (Node child in n.nodes) {
-        helper(child);
-      }
-    }
-  };
-
-  helper(elem);
-  return nodes;
-}
-
-/**
- * Whether a node and its children are all types that are safe to skip if the
- * nodes have no text content.
- */
-bool isSkippableType(Node n) {
-  // TODO(jacobr): are there any types we don't want to skip even if they
-  // have no text content?
-  if (n is ImageElement || n is CanvasElement || n is InputElement
-      || n is ObjectElement) {
-    return false;
-  }
-  if (n is Text) return true;
-
-  for (final child in n.nodes) {
-    if (!isSkippableType(child)) {
-      return false;
-    }
-  }
-  return true;
-}
-
-bool isSkippable(Node n) {
-  if (!isSkippableType(n)) return false;
-  return n.text.trim().length == 0;
-}
-
-void onEnd() {
-  // Hideous hack to send JSON back to JS.
-  String dbJson = JSON.encode(dbEntry);
-  // workaround bug in JSON.decode.
-  dbJson = dbJson.replaceAll("ZDARTIUMDOESNTESCAPESLASHNJXXXX", "\\n");
-
-  // Use postMessage to end the JSON to JavaScript. TODO(jacobr): use a simple
-  // isolate based Dart-JS interop solution in the future.
-  window.postMessage("START_DART_MESSAGE_UNIQUE_IDENTIFIER$dbJson", "*");
-}
-
-class SectionParseResult {
-  final String html;
-  final String url;
-  final String idl;
-  SectionParseResult(this.html, this.url, this.idl);
-}
-
-String genCleanHtml(Element root) {
-  for (final e in root.queryAll(".$DART_REMOVED")) {
-    e.classes.remove(DART_REMOVED);
-  }
-
-  // Ditch inline styles.
-  for (final e in root.queryAll('[style]')) {
-    e.attributes.remove('style');
-  }
-
-  // These elements are just tags that we should suppress.
-  for (final e in root.queryAll(".lang.lang-en")) {
-    e.remove();
-  }
-
-  Element parametersHeader;
-  Element returnValueHeader;
-  for (final e in root.queryAll("h6")) {
-    if (e.text == 'Parameters') {
-      parametersHeader = e;
-    } else if (e.text == 'Return value') {
-      returnValueHeader = e;
-    }
-  }
-
-  if (parametersHeader != null) {
-    int numEmptyParameters = 0;
-    final parameterDescriptions = root.queryAll("dd");
-    for (Element parameterDescription in parameterDescriptions) {
-      if (parameterDescription.text.trim().length == 0) {
-        numEmptyParameters++;
-      }
-    }
-    if (numEmptyParameters > 0 &&
-        numEmptyParameters == parameterDescriptions.length) {
-      // Remove the parameter list as it adds zero value as all descriptions
-      // are empty.
-      parametersHeader.remove();
-      for (final e in root.queryAll("dl")) {
-        e.remove();
-      }
-    } else if (parameterDescriptions.length == 0 &&
-        parametersHeader.nextElementSibling != null &&
-        parametersHeader.nextElementSibling.text.trim() == 'None.') {
-      // No need to display that the function takes 0 parameters.
-      parametersHeader.nextElementSibling.remove();
-      parametersHeader.remove();
-    }
-  }
-
-  // Heuristic: if the return value is a single word it is a type name not a
-  // useful text description so suppress it.
-  if (returnValueHeader != null &&
-      returnValueHeader.nextElementSibling != null &&
-      returnValueHeader.nextElementSibling.text.trim().split(' ').length < 2) {
-    returnValueHeader.nextElementSibling.remove();
-    returnValueHeader.remove();
-  }
-
-  bool changed = true;
-  while (changed) {
-    changed = false;
-    while (root.nodes.length == 1 && root.nodes.first is Element) {
-      root = root.nodes.first;
-      changed = true;
-    }
-
-    // Trim useless nodes from the front.
-    while (root.nodes.length > 0 &&
-        isSkippable(root.nodes.first)) {
-      root.nodes.first.remove();
-      changed = true;
-    }
-
-    // Trim useless nodes from the back.
-    while (root.nodes.length > 0 &&
-        isSkippable(root.nodes.last)) {
-      root.nodes.last.remove();
-      changed = true;
-    }
-  }
-  return JSONFIXUPHACK(root.innerHTML);
-}
-
-String genPrettyHtmlFromElement(Element e) {
-  e = e.clone(true);
-  return genCleanHtml(e);
-}
-
-class PostOrderTraversalIterator implements Iterator<Node> {
-
-  Node _next;
-  Node _current;
-
-  PostOrderTraversalIterator(Node start) {
-    _next = _leftMostDescendent(start);
-  }
-
-  Node get current => _current;
-  bool get hasNext => _next != null;
-
-  bool moveNext() {
-    _current = _next;
-    if (_next == null) return false;
-    if (_next.nextNode != null) {
-      _next = _leftMostDescendent(_next.nextNode);
-    } else {
-      _next = _next.parent;
-    }
-    return true;
-  }
-
-  static Node _leftMostDescendent(Node n) {
-    while (n.nodes.length > 0) {
-      n = n.nodes.first;
-    }
-    return n;
-  }
-}
-
-class PostOrderTraversal extends IterableBase<Node> {
-  final Node _node;
-  PostOrderTraversal(this._node);
-
-  Iterator<Node> get iterator => new PostOrderTraversalIterator(_node);
-}
-
-/**
- * Estimate what content represents the first line of text within the [section]
- * range returning null if there isn't a plausible first line of text that
- * contains the string [prop].  We measure the actual rendered client rectangle
- * for the text and use heuristics defining how many pixels text can vary by
- * and still be viewed as being on the same line.
- */
-Range findFirstLine(Range section, String prop) {
-  final firstLine = newRange();
-  firstLine.setStart(section.startContainer, section.startOffset);
-
-  num maxBottom = null;
-  for (final n in new PostOrderTraversal(section.startContainer)) {
-    int compareResult = section.comparePoint(n, 0);
-    if (compareResult == -1) {
-      // before range so skip.
-      continue;
-    } else if (compareResult > 0) {
-      // After range so exit.
-      break;
-    }
-
-    final rect = getClientRect(n);
-    num bottom = rect.bottom;
-    if (rect.height > 0 && rect.width > 0) {
-      if (maxBottom != null &&
-          maxBottom + MIN_PIXELS_DIFFERENT_LINES < bottom) {
-        break;
-      } else if (maxBottom == null || maxBottom > bottom) {
-        maxBottom = bottom;
-      }
-    }
-
-    firstLine.setEndAfter(n);
-  }
-
-  // If the first line of text in the section does not contain the property
-  // name then we're not confident we are able to extract a high accuracy match
-  // so we should not return anything.
-  if (!firstLine.toString().contains(stripWebkit(prop))) {
-    return null;
-  }
-  return firstLine;
-}
-
-/** Find child anchor elements that contain the text [prop]. */
-AnchorElement findAnchorElement(Element root, String prop) {
-  for (AnchorElement a in root.queryAll("a")) {
-    if (a.text.contains(prop)) {
-      return a;
-    }
-  }
-  return null;
-}
-
-// First surrounding element with an ID is safe enough.
-Element findTighterRoot(Element elem, Element root) {
-  Element candidate = elem;
-  while (root != candidate) {
-    candidate = candidate.parent;
-    if (candidate.id.length > 0 && candidate.id.indexOf("section_") != 0) {
-      break;
-    }
-  }
-  return candidate;
-}
-
-// TODO(jacobr): this is very slow and ugly.. consider rewriting or at least
-// commenting carefully.
-SectionParseResult filteredHtml(Element elem, Element root, String prop,
-    Function fragmentGeneratedCallback) {
-  // Using a tighter root avoids false positives at the risk of trimming
-  // text we shouldn't.
-  root = findTighterRoot(elem, root);
-  final range = newRange();
-  range.setStartBefore(elem);
-
-  Element current = elem;
-  while (current != null) {
-    range.setEndBefore(current);
-    if (current.classes.contains(DART_REMOVED) &&
-        range.toString().trim().length > 0) {
-      break;
-    }
-    if (current.firstElementChild != null) {
-      current = current.firstElementChild;
-    } else {
-      while (current != null) {
-        range.setEndAfter(current);
-        if (current == root) {
-          current = null;
-          break;
-        }
-        if (current.nextElementSibling != null) {
-          current = current.nextElementSibling;
-          break;
-        }
-        current = current.parent;
-      }
-    }
-  }
-  String url = null;
-  if (prop != null) {
-    Range firstLine = findFirstLine(range, prop);
-    if (firstLine != null) {
-      range.setStart(firstLine.endContainer, firstLine.endOffset);
-      DocumentFragment firstLineClone = firstLine.cloneContents();
-      AnchorElement anchor = findAnchorElement(firstLineClone, prop);
-      if (anchor != null) {
-        url = getAbsoluteUrl(anchor);
-      }
-    }
-  }
-  final fragment = range.cloneContents();
-  if (fragmentGeneratedCallback != null) {
-    fragmentGeneratedCallback(fragment);
-  }
-  // Strip tags we don't want
-  for (Element e in fragment.queryAll("script, object, style")) {
-    e.remove();
-  }
-
-  // Extract idl
-  final idl = new StringBuffer();
-  if (prop != null && prop.length > 0) {
-    // Only expect properties to have HTML.
-    for(Element e in fragment.queryAll(IDL_SELECTOR)) {
-      idl.write(e.outerHTML);
-      e.remove();
-    }
-    // TODO(jacobr) this is a very basic regex to see if text looks like IDL
-    RegExp likelyIdl = new RegExp(" $prop\\w*\\(");
-
-    for (Element e in fragment.queryAll("pre")) {
-      // Check if it looks like idl...
-      String txt = e.text.trim();
-      if (likelyIdl.hasMatch(txt) && txt.contains("\n") && txt.contains(")")) {
-        idl.write(e.outerHTML);
-        e.remove();
-      }
-    }
-  }
-  return new SectionParseResult(genCleanHtml(fragment), url, idl.toString());
-}
-
-/**
- * Find the best child element of [root] that appears to be an API definition
- * for [prop].  [allText] is a list of all text nodes under root computed by
- * the caller to improve performance.
- */
-Element findBest(Element root, List<Text> allText, String prop,
-    String propType) {
-  // Best bet: find a child of root where the id matches the property name.
-  Element cand = root.query("#$prop");
-
-  if (cand == null && propType == "methods") {
-    cand = root.query("[id=$prop\\(\\)]");
-  }
-  while (cand != null && cand.text.trim().length == 0) {
-    // We found the bookmark for the element but sadly it is just an empty
-    // placeholder. Find the first real element.
-    cand = cand.nextElementSibling;
-  }
-  if (cand != null) {
-    return cand;
-  }
-
-  // If we are at least 70 pixels from the left, something is definitely
-  // fishy and we shouldn't even consider this candidate as nobody visually
-  // formats API docs like that.
-  num candLeft = 70;
-
-  for (Text text in allText) {
-    Element proposed = null;
-
-    // TODO(jacobr): does it hurt precision to use the full cleanup?
-    String t = fullNameCleanup(text.text);
-    if (t == prop) {
-      proposed = text.parent;
-      ClientRect candRect = getClientRect(proposed);
-
-      // TODO(jacobr): this is a good heuristic
-      // if (selObj.selector.indexOf(" > DD ") == -1
-      if (candRect.left < candLeft) {
-        cand = proposed;
-        candLeft = candRect.left;
-      }
-    }
-  }
-  return cand;
-}
-
-/**
- * Checks whether [e] is tagged as obsolete or deprecated using heuristics
- * for what these tags look like in the MDN docs.
- */
-bool isObsolete(Element e) {
-  RegExp obsoleteRegExp = new RegExp(r"(^|\s)obsolete(?=\s|$)");
-  RegExp deprecatedRegExp = new RegExp(r"(^|\s)deprecated(?=\s|$)");
-  for (Element child in e.queryAll("span")) {
-    String t = child.text.toLowerCase();
-    if (t.startsWith("obsolete") || t.startsWith("deprecated")) return true;
-  }
-
-  String text = e.text.toLowerCase();
-  return obsoleteRegExp.hasMatch(text) || deprecatedRegExp.hasMatch(text);
-}
-
-bool isFirstCharLowerCase(String str) {
-  return new RegExp("^[a-z]").hasMatch(str);
-}
-
-/**
- * Extracts information from a fragment of HTML only searching under the [root]
- * html node.  [secitonSelector] specifies the query to use to find candidate
- * sections of the document to consider (there may be more than one).
- * [currentType] specifies the name of the current class. [members] specifies
- * the known class members for this class that we are attempting to find
- * documentation for.  [propType] indicates whether we are searching for
- * methods, properties, constants, or constructors.
- */
-void scrapeSection(Element root, String sectionSelector, String currentType,
-    List members, String propType) {
-  Map expectedProps = dartIdl[propType];
-
-  Set<String> alreadyMatchedProperties = new Set<String>();
-  bool onlyConsiderTables = false;
-  ElementList allMatches = root.queryAll(sectionSelector);
-  if (allMatches.length == 0) {
-    // If we can't find any matches to the sectionSelector, we fall back to
-    // considering all tables in the document.  This is dangerous so we only
-    // allow the safer table matching extraction rules for this case.
-    allMatches = root.queryAll(".fullwidth-table");
-    onlyConsiderTables = true;
-  }
-  for (Element matchElement in allMatches) {
-    final match = matchElement.parent;
-    if (!match.id.startsWith("section") && match.id != "pageText") {
-      throw "Unexpected element $match";
-    }
-    // We don't want to later display this text a second time while for example
-    // displaying class level summary information as then we would display
-    // the same documentation twice.
-    match.classes.add(DART_REMOVED);
-
-    bool foundProps = false;
-
-    // TODO(jacobr): we should really look for the table tag instead
-    // add an assert if we are missing something that is a table...
-    // TODO(jacobr) ignore tables in tables.
-    for (Element t in match.queryAll('.standard-table, .fullwidth-table')) {
-      int helpIndex = -1;
-      num i = 0;
-      for (Element r in t.queryAll("th, td.header")) {
-        final txt = r.text.trim().split(" ")[0].toLowerCase();
-        if (txt == "description") {
-          helpIndex = i;
-          break;
-        }
-        i++;
-      }
-
-      // Figure out which column in the table contains member names by
-      // tracking how many member names each column contains.
-      final numMatches = new List<int>(i);
-      for (int j = 0; j < i; j++) {
-        numMatches[j] = 0;
-      }
-
-      // Find the column that seems to have the most names that look like
-      // expected properties.
-      for (Element r in t.queryAll("tbody tr")) {
-        ElementList row = r.elements;
-        if (row.length == 0 || row.first.classes.contains(".header")) {
-          continue;
-        }
-
-        for (int k = 0; k < numMatches.length && k < row.length; k++) {
-          if (expectedProps.containsKey(fullNameCleanup(row[k].text))) {
-            numMatches[k]++;
-            break;
-          }
-        }
-      }
-
-      int propNameIndex = 0;
-      {
-        int bestCount = numMatches[0];
-        for (int k = 1; k < numMatches.length; k++) {
-          if (numMatches[k] > bestCount) {
-            bestCount = numMatches[k];
-            propNameIndex = k;
-          }
-        }
-      }
-
-      for (Element r in t.queryAll("tbody tr")) {
-        final row = r.elements;
-        if (row.length > propNameIndex && row.length > helpIndex) {
-          if (row.first.classes.contains(".header")) {
-            continue;
-          }
-          // TODO(jacobr): this code for determining the namestr is needlessly
-          // messy.
-          final nameRow = row[propNameIndex];
-          AnchorElement a = nameRow.query("a");
-          String goodName = '';
-          if (a != null) {
-            goodName = a.text.trim();
-          }
-          String nameStr = nameRow.text;
-
-          Map entry = new Map<String, String>();
-
-          entry["name"] = fullNameCleanup(nameStr.length > 0 ?
-              nameStr : goodName);
-
-          final parse = filteredHtml(nameRow, nameRow, entry["name"], null);
-          String altHelp = parse.html;
-
-          entry["help"] = (helpIndex == -1 || row[helpIndex] == null) ?
-              altHelp : genPrettyHtmlFromElement(row[helpIndex]);
-          if (parse.url != null) {
-            entry["url"] = parse.url;
-          }
-
-          if (parse.idl.length > 0) {
-            entry["idl"] = parse.idl;
-          }
-
-          entry["obsolete"] = isObsolete(r);
-
-          if (entry["name"].length > 0) {
-            cleanupEntry(members, entry);
-            alreadyMatchedProperties.add(entry['name']);
-            foundProps = true;
-          }
-        }
-      }
-    }
-
-    if (onlyConsiderTables) {
-      continue;
-    }
-
-    // After this point we have higher risk tests that attempt to perform
-    // rudimentary page segmentation.  This approach is much more error-prone
-    // than using tables because the HTML is far less clearly structured.
-
-    final allText = getAllTextNodes(match);
-
-    final pmap = new Map<String, Element>();
-    for (final prop in expectedProps.keys) {
-      if (alreadyMatchedProperties.contains(prop)) {
-        continue;
-      }
-      final e = findBest(match, allText, prop, propType);
-      if (e != null && !inTable(e)) {
-        pmap[prop] = e;
-      }
-    }
-
-    for (final prop in pmap.keys) {
-      pmap[prop].classes.add(DART_REMOVED);
-    }
-
-    // The problem is the MDN docs do place documentation for each method in a
-    // nice self contained subtree. Instead you will see something like:
-
-    // <h3>drawImage</h3>
-    // <p>Draw image is an awesome method</p>
-    // some more info on drawImage here
-    // <h3>mozDrawWindow</h3>
-    // <p>This API cannot currently be used by Web content.
-    // It is chrome only.</p>
-    // <h3>drawRect</h3>
-    // <p>Always call drawRect instead of drawImage</p>
-    // some more info on drawRect here...
-
-    // The trouble is we will easily detect that the drawImage and drawRect
-    // entries are method definitions because we know to search for these
-    // method names but we will not detect that mozDrawWindow is a method
-    // definition as that method doesn't exist in our IDL.  Thus if we are not
-    // careful the definition for the drawImage method will contain the
-    // definition for the mozDrawWindow method as well which would result in
-    // broken docs.  We solve this problem by finding all content with similar
-    // visual structure to the already found method definitions.  It turns out
-    // that using the visual position of each element on the page is much
-    // more reliable than using the DOM structure
-    // (e.g. section_root > div > h3) for the MDN docs because MDN authors
-    // carefully check that the documentation for each method comment is
-    // visually consistent but take less care to check that each
-    // method comment has identical markup structure.
-    for (String prop in pmap.keys) {
-      Element e = pmap[prop];
-      ClientRect r = getClientRect(e);
-      // TODO(jacobr): a lot of these queries are identical and this code
-      // could easily be optimized.
-      for (final cand in match.queryAll(e.tagName)) {
-        // TODO(jacobr): use a negative selector instead.
-        if (!cand.classes.contains(DART_REMOVED) && !inTable(cand)) {
-          final candRect = getClientRect(cand);
-          // Only consider matches that have similar heights and identical left
-          // coordinates.
-          if (candRect.left == r.left &&
-            (candRect.height - r.height).abs() < 5) {
-            String propName = fullNameCleanup(cand.text);
-            if (isFirstCharLowerCase(propName) && !pmap.containsKey(propName)
-                && !alreadyMatchedProperties.contains(propName)) {
-              pmap[propName] = cand;
-            }
-          }
-        }
-      }
-    }
-
-    // We mark these elements in batch to reduce the number of layouts
-    // triggered. TODO(jacobr): use new batch based async measurement to make
-    // this code flow simpler.
-    for (String prop in pmap.keys) {
-      Element e = pmap[prop];
-      e.classes.add(DART_REMOVED);
-    }
-
-    // Find likely "subsections" of the main section and mark them with
-    // DART_REMOVED so we don't include them in member descriptions... which
-    // would suck.
-    for (Element e in match.queryAll("[id]")) {
-      if (e.id.contains(matchElement.id)) {
-        e.classes.add(DART_REMOVED);
-      }
-    }
-
-    for (String prop in pmap.keys) {
-      Element elem = pmap[prop];
-      bool obsolete = false;
-      final parse = filteredHtml(
-        elem, match, prop,
-        (Element e) {
-          obsolete = isObsolete(e);
-        });
-      Map entry = {
-        "url" : parse.url,
-        "name" : prop,
-        "help" : parse.html,
-        "obsolete" : obsolete
-      };
-      if (parse.idl.length > 0) {
-        entry["idl"] = parse.idl;
-      }
-      cleanupEntry(members, entry);
-    }
-  }
-}
-
-String trimHtml(String html) {
-  // TODO(jacobr): implement this.  Remove spurious enclosing HTML tags, etc.
-  return html;
-}
-
-bool maybeName(String name) {
-  return new RegExp("^[a-z][a-z0-9A-Z]+\$").hasMatch(name) ||
-      new RegExp("^[A-Z][A-Z_]*\$").hasMatch(name);
-}
-
-// TODO(jacobr): this element is ugly at the moment but will become easier to
-// read once ElementList supports most of the Element functionality.
-void markRemoved(var e) {
-  if (e != null) {
-    if (e is Element) {
-      e.classes.add(DART_REMOVED);
-    } else {
-      for (Element el in e) {
-        el.classes.add(DART_REMOVED);
-      }
-    }
-  }
-}
-
-// TODO(jacobr): remove this when the dartium JSON parse handles \n correctly.
-String JSONFIXUPHACK(String value) {
-  return value.replaceAll("\n", "ZDARTIUMDOESNTESCAPESLASHNJXXXX");
-}
-
-String mozToWebkit(String name) {
-  return name.replaceFirst(new RegExp("^moz"), "webkit");
-}
-
-String stripWebkit(String name) {
-  return trimPrefix(name, "webkit");
-}
-
-// TODO(jacobr): be more principled about this.
-String fullNameCleanup(String name) {
-  int parenIndex = name.indexOf('(');
-  if (parenIndex != -1) {
-    name = name.substring(0, parenIndex);
-  }
-  name = name.split(" ")[0];
-  name = name.split("\n")[0];
-  name = name.split("\t")[0];
-  name = name.split("*")[0];
-  name = name.trim();
-  name = safeNameCleanup(name);
-  return name;
-}
-
-// Less agressive than the full name cleanup to avoid overeager matching.
-// TODO(jacobr): be more principled about this.
-String safeNameCleanup(String name) {
-  int parenIndex = name.indexOf('(');
-  if (parenIndex != -1 && name.indexOf(")") != -1) {
-    // TODO(jacobr): workaround bug in:
-    // name = name.split("(")[0];
-    name = name.substring(0, parenIndex);
-  }
-  name = name.trim();
-  name = trimPrefix(name, currentType + ".");
-  name = trimPrefix(name, currentType.toLowerCase() + ".");
-  name = trimPrefix(name, currentTypeShort + ".");
-  name = trimPrefix(name, currentTypeShort.toLowerCase() + ".");
-  name = trimPrefix(name, currentTypeTiny + ".");
-  name = trimPrefix(name, currentTypeTiny.toLowerCase() + ".");
-  name = name.trim();
-  name = mozToWebkit(name);
-  return name;
-}
-
-/**
- * Remove h1, h2, and h3 headers.
- */
-void removeHeaders(DocumentFragment fragment) {
-  for (Element e in fragment.queryAll("h1, h2, h3")) {
-    e.remove();
-  }
-}
-
-/**
- * Given an [entry] representing a single method or property cleanup the
- * values performing some simple normalization and only adding the entry to
- * [members] if it has a valid name.
- */
-void cleanupEntry(List members, Map entry) {
-  if (entry.containsKey('help')) {
-    entry['help'] = trimHtml(entry['help']);
-  }
-  String name = fullNameCleanup(entry['name']);
-  entry['name'] = name;
-  if (maybeName(name)) {
-    for (String key in entry.keys) {
-      var value = entry[key];
-      if (value == null) {
-        entry.remove(key);
-        continue;
-      }
-      if (value is String) {
-        entry[key] = JSONFIXUPHACK(value);
-      }
-    }
-    members.add(entry);
-  }
-}
-
-// TODO(jacobr) dup with trim start....
-String trimPrefix(String str, String prefix) {
-  if (str.indexOf(prefix) == 0) {
-    return str.substring(prefix.length);
-  } else {
-    return str;
-  }
-}
-
-String trimStart(String str, String start) {
-  if (str.startsWith(start) && str.length > start.length) {
-    return str.substring(start.length);
-  }
-  return str;
-}
-
-String trimEnd(String str, String end) {
-  if (str.endsWith(end) && str.length > end.length) {
-    return str.substring(0, str.length - end.length);
-  }
-  return str;
-}
-
-/**
- * Extract a section with name [key] using [selector] to find start points for
- * the section in the document.
- */
-void extractSection(String selector, String key) {
-  for (Element e in document.queryAll(selector)) {
-    e = e.parent;
-    for (Element skip in e.queryAll("h1, h2, $IDL_SELECTOR")) {
-      skip.remove();
-    }
-    String html = filteredHtml(e, e, null, removeHeaders).html;
-    if (html.length > 0) {
-      if (dbEntry.containsKey(key)) {
-        dbEntry[key] += html;
-      } else {
-        dbEntry[key] = html;
-      }
-    }
-    e.classes.add(DART_REMOVED);
-  }
-}
-
-void run() {
-  // Inject CSS to ensure lines don't wrap unless they were intended to.
-  // This is needed to make the logic to determine what is a single line
-  // behave consistently even for very long method names.
-  document.head.nodes.add(new Element.html("""
-<style type="text/css">
-  body {
-    width: 10000px;
-  }
-</style>"""));
-
-  String title = trimEnd(window.document.title.trim(), " - MDN");
-  dbEntry['title'] = title;
-
-  // TODO(rnystrom): Clean up the page a bunch. Not sure if this is the best
-  // place to do this...
-  // TODO(jacobr): move this to right before we extract HTML.
-
-  // Remove the "Introduced in HTML <version>" boxes.
-  for (Element e in document.queryAll('.htmlVersionHeaderTemplate')) {
-    e.remove();
-  }
-
-  // Flatten the list of known DOM types into a faster and case-insensitive
-  // map.
-  domTypes = {};
-  for (final domType in domTypesRaw) {
-    domTypes[domType.toLowerCase()] = domType;
-  }
-
-  // Fix up links.
-  final SHORT_LINK = new RegExp(r'^[\w/]+$');
-  final INNER_LINK = new RegExp(r'[Ee]n/(?:[\w/]+/|)([\w#.]+)(?:\(\))?$');
-  final MEMBER_LINK = new RegExp(r'(\w+)[.#](\w+)');
-  final RELATIVE_LINK = new RegExp(r'^(?:../)*/?[Ee][Nn]/(.+)');
-
-  // - Make relative links absolute.
-  // - If we can, take links that point to other MDN pages and retarget them
-  //   to appropriate pages in our docs.
-  // TODO(rnystrom): Add rel external to links we didn't fix.
-  for (AnchorElement a in document.queryAll('a')) {
-    // Get the raw attribute because we *don't* want the browser to fully-
-    // qualify the name for us since it has the wrong base address for the
-    // page.
-    var href = a.attributes['href'];
-
-    // Ignore busted links.
-    if (href == null) continue;
-
-    // If we can recognize what it's pointing to, point it to our page instead.
-    tryToLinkToRealType(maybeType) {
-      // See if we know a type with that name.
-      final realType = domTypes[maybeType.toLowerCase()];
-      if (realType != null) {
-        href = '../html/$realType.html';
-      }
-    }
-
-    // If it's a relative link (that we know how to root), make it absolute.
-    var match = RELATIVE_LINK.firstMatch(href);
-    if (match != null) {
-      href = 'https://developer.mozilla.org/en/${match[1]}';
-    }
-
-    // If it's a word link like "foo" find a type or make it absolute.
-    match = SHORT_LINK.firstMatch(href);
-    if (match != null) {
-      href = 'https://developer.mozilla.org/en/DOM/${match[0]}';
-    }
-
-    // TODO(rnystrom): This is a terrible way to do this. Should use the real
-    // mapping from DOM names to html class names that we use elsewhere in the
-    // DOM scripts.
-    match = INNER_LINK.firstMatch(href);
-    if (match != null) {
-      // See if we're linking to a member ("type.name" or "type#name") or just
-      // a type ("type").
-      final member = MEMBER_LINK.firstMatch(match[1]);
-      if (member != null) {
-        tryToLinkToRealType(member[1]);
-      } else {
-        tryToLinkToRealType(match[1]);
-      }
-    }
-
-    // Put it back into the element.
-    a.attributes['href'] = href;
-  }
-
-  if (!title.toLowerCase().contains(currentTypeTiny.toLowerCase())) {
-    bool foundMatch = false;
-    // Test out if the title is really an HTML tag that matches the
-    // current class name.
-    for (String tag in [title.split(" ")[0], title.split(".").last]) {
-      try {
-        Element element = new Element.tag(tag);
-        // TODO(jacobr): this is a really ugly way of doing this that will
-        // stop working at some point soon.
-        if (element.typeName == currentType) {
-          foundMatch = true;
-          break;
-        }
-      } catch (e) {}
-    }
-    if (!foundMatch) {
-      dbEntry['skipped'] = true;
-      dbEntry['cause'] = "Suspect title";
-      onEnd();
-      return;
-    }
-  }
-
-  Element root = document.query(".pageText");
-  if (root == null) {
-    dbEntry['cause'] = '.pageText not found';
-    onEnd();
-    return;
-  }
-
-  markRemoved(root.query("#Notes"));
-  List members = dbEntry['members'];
-
-  // This is a laundry list of CSS selectors for boilerplate content on the
-  // MDN pages that we should ignore for the purposes of extracting
-  // documentation.
-  markRemoved(document.queryAll(".pageToc, footer, header, #nav-toolbar"));
-  markRemoved(document.queryAll("#article-nav"));
-  markRemoved(document.queryAll(".hideforedit"));
-  markRemoved(document.queryAll(".navbox"));
-  markRemoved(document.query("#Method_overview"));
-  markRemoved(document.queryAll("h1, h2"));
-
-  scrapeSection(root, "#Methods", currentType, members, 'methods');
-  scrapeSection(root, "#Constants, #Error_codes, #State_constants",
-      currentType, members, 'constants');
-  // TODO(jacobr): infer tables based on multiple matches rather than
-  // using a hard coded list of section ids.
-  scrapeSection(root,
-      "[id^=Properties], #Notes, [id^=Other_properties], #Attributes, " +
-      "#DOM_properties, #Event_handlers, #Event_Handlers",
-      currentType, members, 'properties');
-
-  // Avoid doing this till now to avoid messing up the section scrape.
-  markRemoved(document.queryAll("h3"));
-
-  ElementList examples = root.queryAll("span[id^=example], span[id^=Example]");
-
-  extractSection("#See_also", 'seeAlso');
-  extractSection("#Specification, #Specifications", "specification");
-
-  // TODO(jacobr): actually extract the constructor(s)
-  extractSection("#Constructor, #Constructors", 'constructor');
-  extractSection("#Browser_compatibility, #Compatibility", 'compatibility');
-
-  // Extract examples.
-  List<String> exampleHtml = [];
-  for (Element e in examples) {
-    e.classes.add(DART_REMOVED);
-  }
-  for (Element e in examples) {
-    String html = filteredHtml(e, root, null,
-      (DocumentFragment fragment) {
-        removeHeaders(fragment);
-        if (fragment.text.trim().toLowerCase() == "example") {
-          // Degenerate example.
-          fragment.nodes.clear();
-        }
-      }).html;
-    if (html.length > 0) {
-      exampleHtml.add(html);
-    }
-  }
-  if (exampleHtml.length > 0) {
-    dbEntry['examples'] = exampleHtml;
-  }
-
-  // Extract the class summary.
-  // Basically everything left over after the #Summary or #Description tag is
-  // safe to include in the summary.
-  StringBuffer summary = new StringBuffer();
-  for (Element e in root.queryAll("#Summary, #Description")) {
-    summary.write(filteredHtml(root, e, null, removeHeaders).html);
-  }
-
-  if (summary.length == 0) {
-    // Remove the "Gecko DOM Reference text"
-    Element ref = root.query(".lang.lang-en");
-    if (ref != null) {
-      ref = ref.parent;
-      String refText = ref.text.trim();
-      if (refText == "Gecko DOM Reference" ||
-          refText == "« Gecko DOM Reference") {
-        ref.remove();
-      }
-    }
-    // Risky... this might add stuff we shouldn't.
-    summary.write(filteredHtml(root, root, null, removeHeaders).html);
-  }
-
-  if (summary.length > 0) {
-    dbEntry['summary'] = summary.toString();
-  }
-
-  // Inject CSS to aid debugging in the browser.
-  // We could avoid doing this if we know we are not running in a browser..
-  document.head.nodes.add(new Element.html(DEBUG_CSS));
-
-  onEnd();
-}
-
-void main() {
-  window.on.load.add(documentLoaded);
-}
-
-void documentLoaded(event) {
-  // Load the database of expected methods and properties with an HttpRequest.
-  new HttpRequest.get('${window.location}.json', (req) {
-    data = JSON.decode(req.responseText);
-    dbEntry = {'members': [], 'srcUrl': pageUrl};
-    run();
-  });
-}
diff --git a/utils/apidoc/mdn/extract.sh b/utils/apidoc/mdn/extract.sh
deleted file mode 100755
index 8ec9208..0000000
--- a/utils/apidoc/mdn/extract.sh
+++ /dev/null
@@ -1,19 +0,0 @@
-
-BUILT_DIR=../../../out/ReleaseIA32
-DART2JS=$BUILT_DIR/dart2js
-DARTVM=$BUILT_DIR/dart
-
-$DART2JS -ooutput/extract.dart.js -c extract.dart
-node extractRunner.js
-
-# Read database.json, 
-# write database.filtered.json (with "best" entries) 
-# and obsolete.json (with entries marked obsolete).
-$DARTVM postProcess.dart
-
-# Create database.html, examples.html, and obsolete.html.
-$DARTVM prettyPrint.dart
-
-# Copy up the final output to the main MDN directory so we can check it in.
-cp output/database.filtered.json database.json
-cp output/obsolete.json .
diff --git a/utils/apidoc/mdn/extractRunner.js b/utils/apidoc/mdn/extractRunner.js
deleted file mode 100644
index 6a95a2e..0000000
--- a/utils/apidoc/mdn/extractRunner.js
+++ /dev/null
@@ -1,194 +0,0 @@
-var fs = require('fs');
-var util = require('util');
-var exec = require('child_process').exec;
-var path = require('path');
-
-// We have numProcesses extraction tasks running simultaneously to improve
-// performance.  If your machine is slow, you may need to dial back the
-// parallelism.
-var numProcesses = 8;
-
-var db = {};
-var metadata = {};
-var USE_VM = false;
-
-// Warning: START_DART_MESSAGE must match the value hardcoded in extract.dart
-// TODO(jacobr): figure out a cleaner way to parse this data.
-var START_DART_MESSAGE = "START_DART_MESSAGE_UNIQUE_IDENTIFIER";
-var END_DART_MESSAGE = "END_DART_MESSAGE_UNIQUE_IDENTIFIER";
-
-var domTypes = JSON.parse(fs.readFileSync('data/domTypes.json',
-    'utf8').toString());
-var cacheData = JSON.parse(fs.readFileSync('output/crawl/cache.json',
-    'utf8').toString());
-var dartIdl = JSON.parse(fs.readFileSync('data/dartIdl.json',
-    'utf8').toString());
-
-try {
-  fs.mkdirSync('output/extract');
-} catch (e) {
-  // It doesn't matter if the directories already exist.
-}
-
-var errorFiles = [];
-// TODO(jacobr): blacklist these types as we can't get good docs for them.
-// ["Performance"]
-
-function parseFile(type, onDone, entry, file, searchResultIndex) {
-  var inputFile;
-  try {
-    inputFile = fs.readFileSync("output/crawl/" + file, 'utf8').toString();
-  } catch (e) {
-    console.warn("Couldn't read: " + file);
-    onDone();
-    return;
-  }
-
-  var inputFileRaw = inputFile;
-  // Cached pages have multiple DOCTYPE tags.  Strip off the first one so that
-  // we have valid HTML.
-  // TODO(jacobr): use a regular expression instead of indexOf.
-  if (inputFile.toLowerCase().indexOf("<!doctype") == 0) {
-    var matchIndex = inputFile.toLowerCase().indexOf("<!doctype", 1);
-    if (matchIndex == -1) {
-      // not a cached page.
-      inputFile = inputFileRaw;
-    } else {
-      inputFile = inputFile.substr(matchIndex);
-    }
-  }
-
-  // Disable all existing javascript in the input file to speed up parsing and
-  // avoid conflicts between our JS and the JS in the file.
-  inputFile = inputFile.replace(/<script type="text\/javascript"/g,
-      '<script type="text/ignored"');
-
-  var endBodyIndex = inputFile.lastIndexOf("</body>");
-  if (endBodyIndex == -1) {
-    // Some files are missing a closing body tag.
-    endBodyIndex = inputFile.lastIndexOf("</html>");
-  }
-  if (endBodyIndex == -1) {
-    if (inputFile.indexOf("Error 404 (Not Found)") != -1) {
-      console.warn("Skipping 404 file: " + file);
-      onDone();
-      return;
-    }
-    throw "Unexpected file format for " + file;
-  }
-
-  inputFile = inputFile.substring(0, endBodyIndex) +
-    '<script type="text/javascript">\n' +
-    '  if (window.layoutTestController) {\n' +
-    '    var controller = window.layoutTestController;\n' +
-    '    controller.dumpAsText();\n' +
-    '    controller.waitUntilDone();\n' +
-    '  }\n' +
-    'window.addEventListener("message", receiveMessage, false);\n' +
-    'function receiveMessage(event) {\n' +
-     '  if (event.data.indexOf("' + START_DART_MESSAGE + '") != 0) return;\n' +
-     '  console.log(event.data + "' + END_DART_MESSAGE + '");\n' +
-     // We feature detect whether the browser supports layoutTestController
-     // so we only clear the document content when running in the test shell
-     // and not when debugging using a normal browser.
-     '  if (window.layoutTestController) {\n' +
-     '    document.documentElement.textContent = "";\n' +
-     '    window.layoutTestController.notifyDone();\n' +
-     '  }\n' +
-     '}\n' +
-    '</script>\n' +
-    (USE_VM ?
-      '<script type="application/dart" src="../../extract.dart"></script>' :
-      '<script type="text/javascript" src="../../output/extract.dart.js">' +
-      '</script>') +
-      '\n' + inputFile.substring(endBodyIndex);
-
-  console.log("Processing: " + file);
-  var absoluteDumpFileName = path.resolve("output/extract/" + file);
-  fs.writeFileSync(absoluteDumpFileName, inputFile, 'utf8');
-  var parseArgs = {
-    type: type,
-    searchResult: entry,
-    dartIdl: dartIdl[type]
-  };
-  fs.writeFileSync(absoluteDumpFileName + ".json", JSON.stringify(parseArgs),
-      'utf8');
-
-  /*
-  // TODO(jacobr): Make this run on platforms other than OS X.
-  var cmd = '../../../client/tests/drt/Content Shell.app/Contents/MacOS/' +
-      Content Shell' + absoluteDumpFileName;
-  */
-  // TODO(eub): Make this run on platforms other than Linux.
-  var cmd = '../../../client/tests/drt/content_shell ' + absoluteDumpFileName;
-  console.log(cmd);
-  exec(cmd,
-    function (error, stdout, stderr) {
-      var msgIndex = stdout.indexOf(START_DART_MESSAGE);
-      console.log('all: ' + stdout);
-      console.log('stderr: ' + stderr);
-      if (error !== null) {
-        console.log('exec error: ' + error);
-      }
-
-      // TODO(jacobr): use a regexp.
-      var msg = stdout.substring(msgIndex + START_DART_MESSAGE.length);
-      msg = msg.substring(0, msg.indexOf(END_DART_MESSAGE));
-      if (!(type in db)) {
-        db[type] = [];
-      }
-      try {
-        db[type][searchResultIndex] = JSON.parse(msg);
-      } catch(e) {
-        // Write the errors file every time there is an error so that if the
-        // user aborts the script, the error file is valid.
-        console.warn("error parsing result for " + type + " file= "+ file);
-        errorFiles.push(file);
-        fs.writeFileSync("output/errors.json",
-            JSON.stringify(errorFiles, null, ' '), 'utf8');
-      }
-      onDone();
-  });
-}
-
-var tasks = [];
-
-var numPending = numProcesses;
-
-function processNextTask() {
-  numPending--;
-  if (tasks.length > 0) {
-    numPending++;
-    var task = tasks.pop();
-    task();
-  } else {
-    if (numPending <= 0) {
-      console.log("Successfully completed all tasks");
-      fs.writeFileSync("output/database.json",
-          JSON.stringify(db, null, ' '), 'utf8');
-    }
-  }
-}
-
-function createTask(type, entry, index) {
-  return function () {
-    var file = type + index + '.html';
-    parseFile(type, processNextTask, entry, file, index);
-  };
-}
-
-for (var i = 0; i < domTypes.length; i++) {
-  var type = domTypes[i];
-  var entries = cacheData[type];
-  if (entries != null) {
-    for (var j = 0; j < entries.length; j++) {
-      tasks.push(createTask(type, entries[j], j));
-    }
-  } else {
-    console.warn("No crawled files for " + type);
-  }
-}
-
-for (var p = 0; p < numProcesses; p++) {
-  processNextTask();
-}
diff --git a/utils/apidoc/mdn/full_run.sh b/utils/apidoc/mdn/full_run.sh
deleted file mode 100755
index 8e26096..0000000
--- a/utils/apidoc/mdn/full_run.sh
+++ /dev/null
@@ -1,8 +0,0 @@
-# This script goes from the input data in data/ all the way to the output data
-# in database.filtered.json
-# See output/database.html for a human readable view of the extracted data.
-
-rm -rf output
-node search.js
-node crawl.js
-./extract.sh
diff --git a/utils/apidoc/mdn/obsolete.json b/utils/apidoc/mdn/obsolete.json
deleted file mode 100644
index 48a8f5d..0000000
--- a/utils/apidoc/mdn/obsolete.json
+++ /dev/null
@@ -1 +0,0 @@
-[{"type":"HTMLDListElement","member":"compact"},{"type":"HTMLSelectElement","member":"tabIndex"},{"type":"HTMLAreaElement","member":"accessKey"},{"type":"HTMLAreaElement","member":"tabIndex"},{"type":"HTMLAreaElement","member":"noHref"},{"type":"HTMLParagraphElement","member":"align"},{"type":"CanvasRenderingContext2D","member":"webkitTextStyle"},{"type":"HTMLDivElement","member":"align"},{"type":"HTMLLegendElement","member":"accessKey"},{"type":"HTMLLegendElement","member":"align"},{"type":"KeyboardEvent","member":"keyCode"},{"type":"KeyboardEvent","member":"which"},{"type":"KeyboardEvent","member":"charCode"},{"type":"HTMLObjectElement","member":"declare"},{"type":"HTMLObjectElement","member":"codeBase"},{"type":"HTMLObjectElement","member":"code"},{"type":"HTMLObjectElement","member":"archive"},{"type":"HTMLObjectElement","member":"hspace"},{"type":"HTMLObjectElement","member":"border"},{"type":"HTMLObjectElement","member":"tabIndex"},{"type":"HTMLObjectElement","member":"vspace"},{"type":"HTMLObjectElement","member":"align"},{"type":"HTMLObjectElement","member":"codeType"},{"type":"HTMLObjectElement","member":"standby"},{"type":"HTMLImageElement","member":"longDesc"},{"type":"HTMLImageElement","member":"align"},{"type":"HTMLImageElement","member":"vspace"},{"type":"HTMLImageElement","member":"hspace"},{"type":"HTMLImageElement","member":"border"},{"type":"HTMLTableCaptionElement","member":"align"},{"type":"HTMLIFrameElement","member":"align"},{"type":"HTMLTableColElement","member":"align"},{"type":"HTMLTableColElement","member":"width"},{"type":"HTMLTableColElement","member":"ch"},{"type":"HTMLTableColElement","member":"vAlign"},{"type":"HTMLTableColElement","member":"chOff"},{"type":"HTMLHRElement","member":"width"},{"type":"HTMLHRElement","member":"align"},{"type":"HTMLHRElement","member":"noshade"},{"type":"HTMLHRElement","member":"size"},{"type":"HTMLHeadingElement","member":"align"},{"type":"HTMLBodyElement","member":"vLink"},{"type":"HTMLBodyElement","member":"background"},{"type":"HTMLBodyElement","member":"text"},{"type":"HTMLBodyElement","member":"link"},{"type":"HTMLBodyElement","member":"bgColor"},{"type":"HTMLBodyElement","member":"aLink"},{"type":"Document","member":"width"},{"type":"Document","member":"bgColor"},{"type":"Document","member":"all"},{"type":"Document","member":"xmlStandalone"},{"type":"Document","member":"xmlEncoding"},{"type":"Document","member":"applets"},{"type":"Document","member":"vlinkColor"},{"type":"Document","member":"linkColor"},{"type":"Document","member":"fgColor"},{"type":"Document","member":"height"},{"type":"Document","member":"alinkColor"},{"type":"Document","member":"xmlVersion"},{"type":"HTMLHtmlElement","member":"version"},{"type":"HTMLHeadElement","member":"profile"},{"type":"HTMLTextAreaElement","member":"accessKey"},{"type":"HTMLTextAreaElement","member":"tabIndex"},{"type":"HTMLTextAreaElement","member":"blur"},{"type":"HTMLTextAreaElement","member":"focus"},{"type":"XMLHttpRequest","member":"webkitResponseArrayBuffer"},{"type":"File","member":"fileName"},{"type":"File","member":"fileSize"},{"type":"HTMLInputElement","member":"accessKey"},{"type":"HTMLInputElement","member":"tabIndex"},{"type":"HTMLInputElement","member":"useMap"},{"type":"HTMLInputElement","member":"align"},{"type":"IDBVersionChangeEvent","member":"version"},{"type":"HTMLBRElement","member":"clear"},{"type":"HTMLAnchorElement","member":"accessKey"},{"type":"HTMLAnchorElement","member":"name"},{"type":"HTMLAnchorElement","member":"charset"},{"type":"HTMLAnchorElement","member":"rev"},{"type":"HTMLAnchorElement","member":"coords"},{"type":"HTMLAnchorElement","member":"tabIndex"},{"type":"HTMLAnchorElement","member":"shape"}]
\ No newline at end of file
diff --git a/utils/apidoc/mdn/postProcess.dart b/utils/apidoc/mdn/postProcess.dart
deleted file mode 100644
index ee61723..0000000
--- a/utils/apidoc/mdn/postProcess.dart
+++ /dev/null
@@ -1,38 +0,0 @@
-/**
- * Read database.json,
- * write database.filtered.json (with "best" entries)
- * and obsolete.json (with entries marked obsolete).
- */
-
-library postProcess;
-
-import 'dart:convert';
-import 'dart:io';
-import 'util.dart';
-
-void main() {
-  // Database of code documentation.
-  Map<String, List> database = JSON.decode(
-      new File('output/database.json').readAsStringSync());
-  final filteredDb = {};
-  final obsolete = [];
-  for (String type in database.keys) {
-    final entry = pickBestEntry(database[type], type);
-    if (entry == null) {
-      print("Can't find ${type} in database.  Skipping.");
-      continue;
-    }
-    filteredDb[type] = entry;
-    if (entry.containsKey("members")) {
-      Map members = getMembersMap(entry);
-      for (String name in members.keys) {
-        Map memberData = members[name];
-        if (memberData['obsolete'] == true) {
-          obsolete.add({'type': type, 'member' : name});
-        }
-      }
-    }
-  }
-  writeFileSync("output/database.filtered.json", JSON.encode(filteredDb));
-  writeFileSync("output/obsolete.json", JSON.encode(obsolete));
-}
diff --git a/utils/apidoc/mdn/prettyPrint.dart b/utils/apidoc/mdn/prettyPrint.dart
deleted file mode 100644
index 3e5c12a..0000000
--- a/utils/apidoc/mdn/prettyPrint.dart
+++ /dev/null
@@ -1,430 +0,0 @@
-/**
- * Creates database.html, examples.html, and obsolete.html.
- */
-
-library prettyPrint;
-
-import 'dart:convert';
-import 'dart:io';
-import 'util.dart';
-
-String orEmpty(String str) {
-  return str == null ? "" : str;
-}
-
-List<String> sortStringCollection(Iterable<String> collection) {
-  final out = <String>[];
-  out.addAll(collection);
-  out.sort((String a, String b) => a.compareTo(b));
-  return out;
-}
-
-int addMissing(StringBuffer sb, String type, Map members) {
-  int total = 0;
-  /**
-   * Add all missing members to the string output and return the number of
-   * missing members.
-   */
-  void addMissingHelper(String propType) {
-    Map expected = allProps[type][propType];
-    if (expected != null) {
-      for(final name in sortStringCollection(expected.keys)) {
-        if (!members.containsKey(name)) {
-          total++;
-        sb.write("""
-                <tr class="missing">
-                  <td>$name</td>
-                  <td></td>
-                  <td>Could not find documentation for $propType</td>
-                </tr>
-    """);
-        }
-      }
-    }
-  }
-
-  addMissingHelper('properties');
-  addMissingHelper('methods');
-  addMissingHelper('constants');
-  return total;
-}
-
-void main() {
-  // Database of code documentation.
-  final Map<String, Map> database = JSON.decode(
-      new File('output/database.filtered.json').readAsStringSync());
-
-  // Types we have documentation for.
-  matchedTypes = new Set<String>();
-  int numMissingMethods = 0;
-  int numFoundMethods = 0;
-  int numExtraMethods = 0;
-  int numGen = 0;
-  int numSkipped = 0;
-  final sbSkipped = new StringBuffer();
-  final sbAllExamples = new StringBuffer();
-
-  // Table rows for all obsolete members.
-  final sbObsolete = new StringBuffer();
-  // Main documentation file.
-  final sb = new StringBuffer();
-
-  // TODO(jacobr): switch to using a real template system instead of string
-  // interpolation combined with StringBuffers.
-  sb.write("""
-<html>
-  <head>
-    <style type="text/css">
-      body {
-      	background-color: #eee;
-      	margin: 10px;
-      	font: 14px/1.428 "Lucida Grande", "Lucida Sans Unicode", Lucida,
-            Arial, Helvetica, sans-serif;
-      }
-
-      .debug {
-      	color: #888;
-      }
-
-      .compatibility, .links, .see-also, .summary, .members, .example {
-      	border: 1px solid #CCC;
-        margin: 5px;
-        padding: 5px;
-      }
-
-      .type, #dart_summary {
-        border: 1px solid;
-        margin-top: 10px;
-        margin-bottom: 10px;
-        padding: 10px;
-        overflow: hidden;
-        background-color: white;
-        -moz-box-shadow: 5px 5px 5px #888;
-        -webkit-box-shadow: 5px 5px 5px #888;
-        box-shadow: 5px 5px 5px #888;
-      }
-
-      #dart_summary {
-      	border: 2px solid #00F;
-        margin: 5px;
-        padding: 5px;
-      }
-
-      th {
-        background-color:#ccc;
-        font-weight: bold;
-      }
-
-      tr:nth-child(odd) {
-        background-color:#eee;
-      }
-      tr:nth-child(even) {
-	      background-color:#fff;
-	    }
-
-      tr:nth-child(odd).unknown {
-        background-color:#dd0;
-      }
-      tr:nth-child(even).unknown {
-	      background-color:#ff0;
-	    }
-
-      tr:nth-child(odd).missing {
-        background-color:#d88;
-      }
-      tr:nth-child(even).missing {
-	      background-color:#faa;
-	    }
-
-	    li.unknown {
-        color: #f00;
-	    }
-
-	    td, th {
-	    	vertical-align: top;
-	    }
-    </style>
-    <title>Doc Dump</title>
-  </head>
-  <body>
-    <h1>Doc Dump</h1>
-    <ul>
-      <li><a href="#dart_summary">Summary</a></li>
-    </li>
-""");
-  for (String type in sortStringCollection(database.keys)) {
-  	final entry = database[type];
-    if (entry == null || entry.containsKey('skipped')) {
-      numSkipped++;
-      sbSkipped.write("""
-    <li id="$type">
-      <a target="_blank" href="http://www.google.com/cse?cx=017193972565947830266%3Awpqsk6dy6ee&ie=UTF-8&q=$type">
-        $type
-      </a>
-      --
-      Title: ${entry == null ? "???" : entry["title"]} -- Issue:
-      ${entry == null ? "???" : entry['cause']}
-      --
-      <a target="_blank" href="${entry == null ? "???" : entry["srcUrl"]}">
-        scraped url
-      </a>
-    </li>""");
-      continue;
-    }
-    matchedTypes.add(type);
-    numGen++;
-    StringBuffer sbSections = new StringBuffer();
-    StringBuffer sbMembers = new StringBuffer();
-    StringBuffer sbExamples = new StringBuffer();
-    if (entry.containsKey("members")) {
-      Map members = getMembersMap(entry);
-      sbMembers.write("""
-  	    <div class="members">
-          <h3><span class="debug">[dart]</span> Members</h3>
-          <table>
-            <tbody>
-              <tr>
-                <th>Name</th><th>Description</th><th>IDL</th><th>Status</th>
-              </tr>
-""");
-      for (String name in sortStringCollection(members.keys)) {
-        Map memberData = members[name];
-        bool unknown = !hasAny(type, name);
-        StringBuffer classes = new StringBuffer();
-        if (unknown) classes.write("unknown ");
-        if (unknown) {
-          numExtraMethods++;
-        } else {
-          numFoundMethods++;
-        }
-
-        final sbMember = new StringBuffer();
-
-        if (memberData.containsKey('url')) {
-          sbMember.write("""
-		         <td><a href="${memberData['url']}">$name</a></td>
-""");
-        } else {
-          sbMember.write("""
-		         <td>$name</td>
-""");
-        }
-        sbMember.write("""
-		  	     <td>${memberData['help']}</td>
-             <td>
-               <pre>${orEmpty(memberData['idl'])}</pre>
-             </td>
-             <td>${memberData['obsolete'] == true ? "Obsolete" : ""}</td>
-""");
-        if (memberData['obsolete'] == true) {
-          sbObsolete.write("<tr class='$classes'><td>$type</td>$sbMember</tr>");
-        }
-        sbMembers.write("<tr class='$classes'>$sbMember</tr>");
-    	}
-
-      numMissingMethods += addMissing(sbMembers, type, members);
-
-      sbMembers.write("""
-            </tbody>
-          </table>
-        </div>
-""");
-    }
-    for (String sectionName in
-        ["summary", "constructor", "compatibility", "specification",
-         "seeAlso"]) {
-      if (entry.containsKey(sectionName)) {
-        sbSections.write("""
-      <div class="$sectionName">
-        <h3><span class="debug">[Dart]</span> $sectionName</h3>
-        ${entry[sectionName]}
-      </div>
-""");
-      }
-    }
-    if (entry.containsKey("links")) {
-      sbSections.write("""
-      <div class="links">
-        <h3><span class="debug">[Dart]</span> Specification</h3>
-        <ul>
-""");
-    	List links = entry["links"];
-    	for (Map link in links) {
-    	  sbSections.write("""
-      <li><a href="${link['href']}">${link['title']}</a></li>
-""");
-      }
-      sbSections.write("""
-        </ul>
-      </div>
-""");
-    }
-    if (entry.containsKey("examples")) {
-    	for (String example in entry["examples"]) {
-  	  sbExamples.write("""
-	    <div class="example">
-	  	  <h3><span class="debug">[Dart]</span> Example</h3>
-	  	  $example
-	  	</div>
-""");
-      }
-    }
-
-    String title = entry['title'];
-    if (title != type) {
-      title = '<h4>Dart type: $type</h4><h2>$title</h2>';
-    } else {
-      title = '<h2>$title</h2>';
-    }
-    sb.write("""
-    <div class='type' id="$type">
-      <a href='${entry['srcUrl']}'>$title</a>
-$sbSections
-$sbExamples
-$sbMembers
-    </div>
-""");
-    if (sbExamples.length > 0) {
-      sbAllExamples.write("""
-    <div class='type' id="$type">
-      <a href='${entry['srcUrl']}'>$title</a>
-      $sbExamples
-    </div>
-""");
-    }
-  }
-
-  for (String type in sortStringCollection(allProps.keys)) {
-    if (!matchedTypes.contains(type) &&
-        !database.containsKey(type)) {
-      numSkipped++;
-      sbSkipped.write("""
-    <li class="unknown" id="$type">
-      <a target="_blank" href="http://www.google.com/cse?cx=017193972565947830266%3Awpqsk6dy6ee&ie=UTF-8&q=$type">
-        $type
-      </a>
-    </li>
-""");
-    }
-  }
-
-  sb.write("""
-<div id="#dart_summary">
-  <h2>Summary</h2>
-  <h3>
-    Generated docs for $numGen classes out of a possible
-    ${allProps.keys.length}
-  </h3>
-  <h3>Found documentation for $numFoundMethods methods listed in WebKit</h3>
-  <h3>
-    Found documentation for $numExtraMethods methods not listed in WebKit
-  </h3>
-  <h3>
-    Unable to find documentation for $numMissingMethods methods present in
-    WebKit
-  </h3>
-  <h3>
-    Skipped generating documentation for $numSkipped classes due to no
-    plausible matching files
-  </h3>
-  <ul>
-$sbSkipped
-  </ul>
-</div>
-""");
-  sb.write("""
-  </body>
-</html>
-""");
-
-  writeFileSync("output/database.html", sb.toString());
-
-  writeFileSync("output/examples.html", """
-<html>
-  <head>
-    <style type="text/css">
-      body {
-      	background-color: #eee;
-      	margin: 10px;
-      	font: 14px/1.428 "Lucida Grande", "Lucida Sans Unicode", Lucida, Arial,
-            Helvetica, sans-serif;
-      }
-
-      .debug {
-      	color: #888;
-      }
-
-      .example {
-      	border: 1px solid #CCC;
-        margin: 5px;
-        padding: 5px;
-      }
-
-      .type {
-        border: 1px solid;
-        margin-top: 10px;
-        margin-bottom: 10px;
-        padding: 10px;
-        overflow: hidden;
-        background-color: white;
-        -moz-box-shadow: 5px 5px 5px #888;
-        -webkit-box-shadow: 5px 5px 5px #888;
-        box-shadow: 5px 5px 5px #888;
-      }
-    </style>
-    <title>All examples</title>
-  </head>
-  <body>
-    <h1>All examples</h1>
-$sbAllExamples
-  </body>
- </html>
-""");
-
-  writeFileSync("output/obsolete.html", """
-<html>
-  <head>
-    <style type="text/css">
-      body {
-        background-color: #eee;
-        margin: 10px;
-        font: 14px/1.428 "Lucida Grande", "Lucida Sans Unicode", Lucida,
-            Arial, Helvetica, sans-serif;
-      }
-
-      .debug {
-        color: #888;
-      }
-
-      .type {
-        border: 1px solid;
-        margin-top: 10px;
-        margin-bottom: 10px;
-        padding: 10px;
-        overflow: hidden;
-        background-color: white;
-        -moz-box-shadow: 5px 5px 5px #888;
-        -webkit-box-shadow: 5px 5px 5px #888;
-        box-shadow: 5px 5px 5px #888;
-      }
-    </style>
-    <title>Methods marked as obsolete</title>
-  </head>
-  <body>
-    <h1>Methods marked as obsolete</h1>
-    <table>
-      <tbody>
-        <tr>
-          <th>Type</th>
-          <th>Name</th>
-          <th>Description</th>
-          <th>IDL</th>
-          <th>Status</th>
-        </tr>
-$sbObsolete
-    </tbody>
-   </table>
-  </body>
- </html>
- """);
-}
diff --git a/utils/apidoc/mdn/search.js b/utils/apidoc/mdn/search.js
deleted file mode 100644
index f01d692..0000000
--- a/utils/apidoc/mdn/search.js
+++ /dev/null
@@ -1,58 +0,0 @@
-/**
- * Uses a Google Custom Search Engine to find pages on
- * developer.mozilla.org that appear to match types from the Webkit IDL
- */
-var https = require('https');
-var fs = require('fs');
-
-var domTypes = JSON.parse(fs.readFileSync('data/domTypes.json', 'utf8'));
-
-try {
-  fs.mkdirSync('output');
-  fs.mkdirSync('output/search');
-} catch (e) {
-  // It doesn't matter if the directories already exist.
-}
-
-function searchForType(type) {
-  // Strip off WebKit specific prefixes from type names to increase the chances
-  // of getting matches on developer.mozilla.org.
-  var shortType = type.replace(/^WebKit/, "");
-
-  // We use a Google Custom Search Engine provisioned for 10,000 API based
-  // queries per day that limits search results to developer.mozilla.org.
-  // You shouldn't need to, but if you want to create your own Google Custom
-  // Search Engine, visit http://www.google.com/cse/
-  var options = {
-    host: 'www.googleapis.com',
-    path: '/customsearch/v1?key=AIzaSyDN1RhE5FafLzLfErGpoYhHlLHeyEkxTkM&' +
-          'cx=017193972565947830266:wpqsk6dy6ee&num=5&q=' + shortType,
-    port: 443,
-    method: 'GET'
-  };
-
-  var req = https.request(options, function(res) {
-    res.setEncoding('utf8');
-    var data = '';
-    res.on('data', function(d) {
-      data += d;
-    });
-    var onClose = function(e) {
-      fs.writeFile("output/search/" + type + ".json", data, function(err) {
-          if (err) throw err;
-      console.log('Done searching for ' + type);
-      });
-    }
-    res.on('close', onClose);
-    res.on('end', onClose);
-  });
-  req.end();
-
-  req.on('error', function(e) {
-    console.error(e);
-  });
-}
-
-for (var i = 0; i < domTypes.length; i++) {
-  searchForType(domTypes[i]);
-}
diff --git a/utils/apidoc/mdn/util.dart b/utils/apidoc/mdn/util.dart
deleted file mode 100644
index e5907bd..0000000
--- a/utils/apidoc/mdn/util.dart
+++ /dev/null
@@ -1,95 +0,0 @@
-library util;
-
-import 'dart:io';
-
-Map<String, Map> _allProps;
-
-Map<String, Map> get allProps {
-  if (_allProps == null) {
-    // Database of expected property names for each type in WebKit.
-    _allProps = parse.parse(
-        new File('data/dartIdl.json').readAsStringSync());
-  }
-  return _allProps;
-}
-
-Set<String> matchedTypes;
-
-/** Returns whether the type has any member matching the specified name. */
-bool hasAny(String type, String prop) {
-  final data = allProps[type];
-  return data['properties'].containsKey(prop) ||
-      data['methods'].containsKey(prop) ||
-      data['constants'].containsKey(prop);
-}
-
-/**
- * Return the members from an [entry] as Map of member names to member
- * objects.
- */
-Map getMembersMap(Map entry) {
-  List<Map> rawMembers = entry["members"];
-  final members = {};
-  for (final entry in rawMembers) {
-    members[entry['name']] = entry;
-  }
-  return members;
-}
-
-/**
- * Score entries using similarity heuristics calculated from the observed and
- * expected list of members. We could be much less naive and penalize spurious
- * methods, prefer entries with class level comments, etc. This method is
- * needed becase we extract entries for each of the top search results for
- * each class name and rely on these scores to determine which entry was
- * best.  Typically all scores but one will be zero.  Multiple pages have
- * non-zero scores when MDN has multiple pages on the same class or pages on
- * similar classes (e.g. HTMLElement and Element), or pages on Mozilla
- * specific classes that are similar to DOM classes (Console).
- */
-num scoreEntry(Map entry, String type) {
-  num score = 0;
-  // TODO(jacobr): consider removing skipped entries completely instead of
-  // just giving them lower scores.
-  if (!entry.containsKey('skipped')) {
-    score++;
-  }
-  if (entry.containsKey("members")) {
-    Map members = getMembersMap(entry);
-    for (String name in members.keys) {
-      if (hasAny(type, name)) {
-        score++;
-      }
-    }
-  }
-  return score;
-}
-
-/**
- * Given a list of candidates for the documentation for a type, find the one
- * that is the best.
- */
-Map pickBestEntry(List entries, String type) {
-  num bestScore = -1;
-  Map bestEntry;
-  for (Map entry in entries) {
-    if (entry != null) {
-      num score = scoreEntry(entry, type);
-      if (score > bestScore) {
-        bestScore = score;
-        bestEntry = entry;
-      }
-    }
-  }
-  return bestEntry;
-}
-
-/**
- * Helper for sync creation of a whole file from a string.
- */
-void writeFileSync(String filename, String data) {
-  File f = new File(filename);
-  RandomAccessFile raf = f.openSync(FileMode.WRITE);
-  raf.writeStringSync(data);
-  raf.closeSync();
-}
diff --git a/utils/apidoc/static/apidoc-styles.css b/utils/apidoc/static/apidoc-styles.css
deleted file mode 100644
index 05e4389..0000000
--- a/utils/apidoc/static/apidoc-styles.css
+++ /dev/null
@@ -1,92 +0,0 @@
-#comments {
-  width: 1000px;
-  margin: 0 auto 22px auto;
-}
-
-.mdn {
-  border: solid 1px hsl(10, 80%, 90%);
-  border-radius: 4px;
-  font-size: 16px;
-  line-height: 22px;
-  margin: 22px 0;
-  padding: 21px 21px 0 21px;
-}
-
-/* Try to massage the MDN content a bit to look nicer. This makes sure we don't
-   double pad the insides of the box. */
-.mdn > *:first-child {
-  margin-top: 0;
-}
-
-.mdn > *:last-child {
-  margin-bottom: 0;
-}
-
-.mdn .note {
-  background: hsl(220, 80%, 93%);
-  font: 400 14px/22px 'Open Sans', 'Lucida Sans Unicode', 'Lucida Grande',
-      sans-serif;
-  color: hsl(220, 40%, 40%);
-  border-radius: 4px;
-  padding: 11px;
-}
-
-.mdn .warning {
-  background: hsl(40, 80%, 90%);
-  font: 400 14px/22px 'Open Sans', 'Lucida Sans Unicode', 'Lucida Grande',
-      sans-serif;
-  color: hsl(40, 40%, 30%);
-  border-radius: 4px;
-  padding: 11px;
-}
-
-.mdn h6 {
-  font: 600 14px/22px 'Open Sans', 'Lucida Sans Unicode', 'Lucida Grande',
-      sans-serif;
-  color: #999;
-  margin: 22px 0 0 0;
-}
-
-/* End MDN massage. */
-
-.mdn-note {
-  font: 600 11px/22px 'Open Sans', 'Lucida Sans Unicode', 'Lucida Grande',
-      sans-serif;
-  color: hsl(10, 60%, 80%);
-  text-align: right;
-  line-height: 21px; /* To absorb bottom border 1px. */
-  margin-right: -14px;
-}
-
-.mdn-note a {
-  color: hsl(10, 60%, 80%);
-}
-
-.mdn-note a:hover {
-  color: hsl(10, 60%, 60%);
-}
-
-.mdn-attribution {
-  background: hsl(10, 80%, 95%);
-  border-radius: 4px;
-  font: 400 13px/22px 'Open Sans', 'Lucida Sans Unicode', 'Lucida Grande',
-      sans-serif;
-  color: hsl(10, 30%, 30%);
-  padding: 22px 22px 22px 75px;
-}
-
-.mdn-logo {
-  float: left;
-  margin-left: -53px;
-  /*padding-right: 11px;*/
-}
-
-.correspond {
-  font: italic 400 14px/22px 'Open Sans', 'Lucida Sans Unicode',
-      'Lucida Grande', sans-serif;
-  color: #666;
-}
-
-.correspond .crossref {
-  font: inherit;
-}
\ No newline at end of file
diff --git a/utils/apidoc/static/mdn-logo-tiny.png b/utils/apidoc/static/mdn-logo-tiny.png
deleted file mode 100644
index f19019d..0000000
--- a/utils/apidoc/static/mdn-logo-tiny.png
+++ /dev/null
Binary files differ
diff --git a/utils/compiler/compiler.gyp b/utils/compiler/compiler.gyp
index 37d2074..f57ad90 100644
--- a/utils/compiler/compiler.gyp
+++ b/utils/compiler/compiler.gyp
@@ -36,7 +36,6 @@
             'create_snapshot.dart',
             '--output_dir=<(SHARED_INTERMEDIATE_DIR)',
             '--dart2js_main=pkg/compiler/lib/src/dart2js.dart',
-            '--docgen_main=pkg/docgen/bin/docgen.dart',
             '--package_root=<(PRODUCT_DIR)/packages/',
           ],
         },
diff --git a/utils/compiler/create_snapshot.dart b/utils/compiler/create_snapshot.dart
index 0123792..1a27431 100644
--- a/utils/compiler/create_snapshot.dart
+++ b/utils/compiler/create_snapshot.dart
@@ -18,12 +18,10 @@
 
 Future<String> getSnapshotGenerationFile(var args, var rootPath) {
   var dart2js = rootPath.resolve(args["dart2js_main"]);
-  var docgen = rootPath.resolve(args["docgen_main"]);
   return getVersion(rootPath).then((version) {
     var snapshotGenerationText =
 """
 import '${dart2js.toFilePath(windows: false)}' as dart2jsMain;
-import '${docgen.toFilePath(windows: false)}' as docgenMain;
 import 'dart:io';
 
 void main(List<String> arguments) {
@@ -32,8 +30,6 @@
   if (tool == "dart2js") {
     dart2jsMain.BUILD_ID = "$version";
     dart2jsMain.main(arguments.skip(1).toList());
-  } else if (tool == "docgen") {
-    docgenMain.main(arguments.skip(1).toList());
   }
 }
 
@@ -84,12 +80,11 @@
  * 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.
- * --docgen_main=val    The path to the docgen main script relative to root.
  * --package-root=val   The package-root used to find packages for the snapshot.
  */
 void main(List<String> arguments) {
   var validArguments = ["--output_dir", "--dart2js_main",
-                        "--docgen_main", "--package_root"];
+                        "--package_root"];
   var args = {};
   for (var argument in arguments) {
     var argumentSplit = argument.split("=");
@@ -100,7 +95,6 @@
     args[argumentSplit[0].substring(2)] = argumentSplit[1];
   }
   if (!args.containsKey("dart2js_main")) throw "Please specify dart2js_main";
-  if (!args.containsKey("docgen_main")) throw "Please specify docgen_main";
   if (!args.containsKey("output_dir")) throw "Please specify output_dir";
   if (!args.containsKey("package_root")) throw "Please specify package_root";
 
diff --git a/utils/dartdoc/.gitignore b/utils/dartdoc/.gitignore
new file mode 100644
index 0000000..ce5803f
--- /dev/null
+++ b/utils/dartdoc/.gitignore
@@ -0,0 +1,2 @@
+/dartdoc.Makefile
+/dartdoc.target.mk